diff --git a/.github/ISSUE_TEMPLATE/50-other-issues.md b/.github/ISSUE_TEMPLATE/40-other-issues.md similarity index 100% rename from .github/ISSUE_TEMPLATE/50-other-issues.md rename to .github/ISSUE_TEMPLATE/40-other-issues.md diff --git a/.github/ISSUE_TEMPLATE/40-tflite-op-request.md b/.github/ISSUE_TEMPLATE/40-tflite-op-request.md deleted file mode 100644 index 7b391279e47..00000000000 --- a/.github/ISSUE_TEMPLATE/40-tflite-op-request.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: TensorFlow Lite Op Request -about: Use this template for reporting ops you are using or missing. - ---- - - -**System information** -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- TensorFlow installed from (source or binary): -- TensorFlow version (or github SHA if from source): - - -**Provide the text output from tflite_convert** - -``` -# Copy and paste here -``` - -Also, please include a link to a GraphDef or the model if possible. - -**Any other info / logs** - -Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..1b464b21c3c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,162 @@ +name: CI build +on: + push: + branches: + - master + - staging + - r[0-9]+.* + pull_request: + branches: + - master + - r[0-9]+.* + types: [opened, reopened, synchronize, labeled, unlabeled] +env: + STAGING_PROFILE_ID: 46f80d0729c92d + DEPLOY_SNAPSHOT: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} + DEPLOY_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }} +jobs: + check-format: + if: github.event_name == 'pull_request' + runs-on: ubuntu-22.04 + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '17' + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Build project + run: | + gcc --version + mvn -version + mvn clean install -Pjdk17 -B -U -e -Dlint.skip=true -Dmaven.test.skip=true + - name: Run format checks + run: | + mvn spotless:check -Pjdk17 -B -U -e + prepare: + runs-on: ubuntu-22.04 + outputs: + repositoryUrl: ${{ steps.repository.outputs.repositoryUrl }} + steps: + - name: Create staging repository + if: env.DEPLOY_RELEASE == 'true' + id: staging + run: | + echo "Creating staging repository with profile $STAGING_PROFILE_ID" + echo "Releasing TF Java - created by CI build" > request.xml + curl -X POST -d @request.xml -s -o response.xml -u ${{ secrets.CI_DEPLOY_USERNAME }}:${{ secrets.CI_DEPLOY_PASSWORD }} -H "Content-Type:application/xml" \ + https://oss.sonatype.org/service/local/staging/profiles/$STAGING_PROFILE_ID/start + export STAGING_REPOSITORY_ID=`awk -F'[<>]' '/stagedRepositoryId/{print $3}' response.xml` + echo "Staging repository created: $STAGING_REPOSITORY_ID" + echo "::set-output name=stagingRepositoryId::$STAGING_REPOSITORY_ID" + - name: Checkout repository + uses: actions/checkout@v6 + - name: Extract distribution repository URL + id: repository + run: | + if [[ "${{ env.DEPLOY_RELEASE }}" = "true" ]]; then + export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.repository.url}" -DstagingRepositoryId=${{ steps.staging.outputs.stagingRepositoryId }}` + else + export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.snapshotRepository.url}"` + fi + echo "Repository URL: $REPOSITORY_URL" + echo "::set-output name=repositoryUrl::$REPOSITORY_URL" + linux-arm64: + runs-on: ubuntu-2204-arm64-2c + needs: prepare + strategy: + matrix: + ext: [""] + steps: + - name: Install environment + run: | + sudo apt update + sudo apt install -y curl wget unzip tar git gcc g++ + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '17' + architecture: 'aarch64' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + gcc --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + linux-x86_64: + runs-on: ubuntu-22.04 + needs: prepare + strategy: + matrix: + ext: ["", -gpu] + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '11' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + gcc --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + macosx-arm64: + runs-on: macos-14 + needs: prepare + strategy: + matrix: + ext: [""] + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '17' + architecture: 'arm64' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + clang --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + deploy: + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} # DEPLOY_SNAPSHOT (releases should be signed and deployed manually from local machine) + needs: [linux-x86_64, macosx-arm64, linux-arm64] + runs-on: ubuntu-22.04 + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '11' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + java -version + mvn -version + mvn clean install -B -U -e -Pdeploying + - name: Deploy snapshot artifacts + run: | + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn deploy -Pdeploying -B -e -Dmaven.test.skip=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 603b1db84a5..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,274 +0,0 @@ -name: CI jobs -on: - push: - branches: - - master - - staging - - r[0-9]+.* - pull_request: - branches: - - master - - r[0-9]+.* - types: [opened, reopened, synchronize, labeled, unlabeled] -env: - STAGING_PROFILE_ID: 46f80d0729c92d - NATIVE_BUILD_PROJECTS: tensorflow-core/tensorflow-core-generator,tensorflow-core/tensorflow-core-api - GCP_CREDS: ${{ secrets.GCP_CREDS }} -jobs: - quick-build: - if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI build') - runs-on: ubuntu-latest - container: centos:7 - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - name: Install environment - run: | - yum -y update - yum -y install centos-release-scl-rh epel-release - yum -y install java-11-openjdk-devel devtoolset-7 - 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 - - name: Build project - run: | - source scl_source enable devtoolset-7 || true - export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac))))) - echo $JAVA_HOME - mvn -version - mvn clean install -Pdev,jdk11 -B -U -e -Dlint.skip=true - - name: Run lint checks - run: | - mvn compiler:compile -Pdev,jdk11 -B -U -e - check-format: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - container: centos:7 - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - name: Install environment - run: | - yum -y update - yum -y install centos-release-scl-rh epel-release - yum -y install java-11-openjdk-devel devtoolset-7 - 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 - - name: Build project - run: | - source scl_source enable devtoolset-7 || true - export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac))))) - echo $JAVA_HOME - mvn -version - mvn clean install -Pdev,jdk11 -B -U -e -Dlint.skip=true -Dmaven.test.skip=true - - name: Run format checks - run: | - mvn spotless:check -Pdev,jdk11 -B -U -e - prepare: - runs-on: ubuntu-latest - outputs: - stagingRepositoryId: ${{ steps.staging.outputs.stagingRepositoryId }} - steps: - - name: Create staging repository - if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') - id: staging - run: | - echo "Creating staging repository with profile $STAGING_PROFILE_ID" - echo "Releasing TF Java - created by CI build" > request.xml - curl -X POST -d @request.xml -s -o response.xml -u ${{ secrets.CI_DEPLOY_USERNAME }}:${{ secrets.CI_DEPLOY_PASSWORD }} -H "Content-Type:application/xml" \ - https://oss.sonatype.org/service/local/staging/profiles/$STAGING_PROFILE_ID/start - STAGING_REPOSITORY_ID=`awk -F'[<>]' '/stagedRepositoryId/{print $3}' response.xml` - echo "Staging repository created: $STAGING_REPOSITORY_ID" - echo "::set-output name=stagingRepositoryId::$STAGING_REPOSITORY_ID" - linux-x86_64: - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI build') - runs-on: ubuntu-latest - container: centos:7 - needs: prepare - strategy: - matrix: - ext: ["", -gpu] #, -mkl, -mkl-gpu] - steps: - - name: Install environment - run: | - 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/3.7.2/bazel-3.7.2-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/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 - 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 $HOME/*.rpm $HOME/*.tgz $HOME/*.txz $HOME/*.tar.* - rm -f $(find /usr/local/cuda/ -name '*.a' -and -not -name libcudart_static.a -and -not -name libcudadevrt.a) - rm -rf /usr/local/cuda/doc* /usr/local/cuda/libnvvp* /usr/local/cuda/nsight* /usr/local/cuda/samples* - fi - - name: Checkout repository - uses: actions/checkout@v1 - - name: Build project - run: | - source scl_source enable devtoolset-7 rh-git218 || true - git --version - gcc --version - mvn -version - bazel version - df -h - echo "Fixing HOME to /root (was '$HOME')" - export HOME=/root - mkdir -p $HOME/.m2 - [[ "${{ github.event_name }}" == "push" ]] && MAVEN_PHASE=deploy || MAVEN_PHASE=install - echo "ossrh${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml - if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "tensorflow/java" ]]; then - printf '%s\n' "${GCP_CREDS}" > $HOME/gcp_creds.json - export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=true --google_credentials=$HOME/gcp_creds.json" - else - export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=false" - fi - echo Executing Maven $MAVEN_PHASE - mvn clean $MAVEN_PHASE -B -U -e -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} -pl $NATIVE_BUILD_PROJECTS -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }} "-Dnative.build.flags=$BAZEL_CACHE" - df -h - macosx-x86_64: - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI build') - runs-on: macos-latest - needs: prepare - strategy: - matrix: - ext: [""] # , -mkl] - steps: - - name: Install environment - run: | - python3 -m pip install numpy six - echo Downloading Bazel - curl -L https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-installer-darwin-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - brew install libomp perl - - name: Checkout repository - uses: actions/checkout@v1 - - name: Build project - run: | - git --version - clang --version - mvn -version - bazel version - mkdir -p $HOME/.m2 - [[ "${{ github.event_name }}" == "push" ]] && MAVEN_PHASE=deploy || MAVEN_PHASE=install - echo "ossrh${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml - if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "tensorflow/java" ]]; then - printf '%s\n' "${GCP_CREDS}" > $HOME/gcp_creds.json - export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=true --google_credentials=$HOME/gcp_creds.json" - else - export BAZEL_CACHE="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=false" - fi - df -h - echo Executing Maven $MAVEN_PHASE - mvn clean $MAVEN_PHASE -B -U -e -Djavacpp.platform=macosx-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} -pl $NATIVE_BUILD_PROJECTS -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }} "-Dnative.build.flags=$BAZEL_CACHE" - df -h - windows-x86_64: - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'CI build') - runs-on: windows-latest - needs: prepare - strategy: - matrix: - ext: ["", -gpu] #, -mkl, -mkl-gpu] - 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 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/3.7.2/bazel-3.7.2-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 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/v11.0/" - ) - echo %JAVA_HOME% - - name: Checkout repository - uses: actions/checkout@v1 - - name: Build project - 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\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" - set "TEMP=C:\tmp" - set "TMP=C:\tmp" - mkdir C:\tmp - bash --version - git --version - cl - call mvn -version - bazel version - mkdir %USERPROFILE%\.m2 - if "${{ github.event_name }}" == "push" (set MAVEN_PHASE=deploy) else (set MAVEN_PHASE=install) - echo ^^^^ossrh^^${{ secrets.CI_DEPLOY_USERNAME }}^^${{ secrets.CI_DEPLOY_PASSWORD }}^^^^ > %USERPROFILE%\.m2\settings.xml - set "BAZEL_CACHE=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=false" - if "${{ github.event_name }}" == "push" ( - if "${{ github.repository }}" == "tensorflow/java" ( - printenv GCP_CREDS > %USERPROFILE%\gcp_creds.json - set "BAZEL_CACHE=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm --remote_upload_local_results=true --google_credentials=%USERPROFILE%\gcp_creds.json" - ) - ) - df -h - wmic pagefile list /format:list - set "SKIP_EXPORT=true" - echo Executing Maven %MAVEN_PHASE% - call mvn clean %MAVEN_PHASE% -B -U -e -Djavacpp.platform=windows-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} -pl %NATIVE_BUILD_PROJECTS% -am -DstagingRepositoryId=${{ needs.prepare.outputs.stagingRepositoryId }} "-Dnative.build.flags=%BAZEL_CACHE%" - if ERRORLEVEL 1 exit /b - df -h - wmic pagefile list /format:list - deploy: - if: github.event_name == 'push' && contains(github.ref, 'master') - needs: [linux-x86_64, macosx-x86_64, windows-x86_64] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - name: Deploy snapshot artifacts - run: | - echo "ossrh${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > settings.xml - bash deploy.sh diff --git a/.gitignore b/.gitignore index b9391f86945..d9e902d7d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,10 @@ xcuserdata/** /api_init_files_list.txt /estimator_api_init_files_list.txt *.whl +tensorflow-core/tensorflow-core-api/downloads/ + +# Vim backups +*~ # Patch files *.orig @@ -56,3 +60,10 @@ gradleBuild **/target .tf_configure.bazelrc .clwb/ + +# Deployment Files +settings.xml +pom.xml.asc + +# Docs +docs/docs/apidocs/ \ No newline at end of file diff --git a/.mvn/jvm.config b/.mvn/jvm.config new file mode 100644 index 00000000000..8488a4fce61 --- /dev/null +++ b/.mvn/jvm.config @@ -0,0 +1,10 @@ +--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad189bb59ff..9da8b9603aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,25 +1,21 @@ # Building and Contributing to TensorFlow Java -## Building +## Contributing + +### Formatting + +Java sources should be formatted according to the [Google style guide](https://google.github.io/styleguide/javaguide.html). It can be included +in [IntelliJ](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml) and +[Eclipse](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml). +[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html) should also be used for C++ code. -To build all the artifacts, simply invoke the command `mvn install` at the root of this repository (or the Maven command of your choice). It is also -possible to build artifacts with support for MKL enabled with -`mvn install -Djavacpp.platform.extension=-mkl` or CUDA with `mvn install -Djavacpp.platform.extension=-gpu` -or both with `mvn install -Djavacpp.platform.extension=-mkl-gpu`. +### Dependencies -When building this project for the first time in a given workspace, the script will attempt to download -the [TensorFlow runtime library sources](https://github.com/tensorflow/tensorflow) and build of all the native code for your platform. This requires a -valid environment for building TensorFlow, including the [bazel](https://bazel.build/) -build tool and a few Python dependencies (please read [TensorFlow documentation](https://www.tensorflow.org/install/source) -for more details). +For dependencies, we can use anything compliant with [this list](https://opensource.google/docs/thirdparty/licenses/#notice), but we want to keep the core libraries as dependency free as possible. -This step can take multiple hours on a regular laptop. It is possible though to skip completely the native build if you are working on a version that -already has pre-compiled native artifacts for your platform [available on Sonatype OSS Nexus repository](#Snapshots). You just need to activate -the `dev` profile in your Maven command to use those artifacts instead of building them from scratch -(e.g. `mvn install -Pdev`). +## Building -Modifying the native op generation code (not the annotation processor) or the JavaCPP configuration (not the abstract Pointers) will require a -complete build could be required to reflect the changes, otherwise `-Pdev` should be fine. +To build all the artifacts locally, simply invoke the command `mvn install` at the root of this repository (or the Maven command of your choice). ### JDK 16+ @@ -37,36 +33,13 @@ This can be done in `.mvn/jvm.config` or `MAVEN_OPTS`. ### Native Builds -In some cases, like when adding GPU support or re-generating op classes, you will need to re-build the native library. 99% of this is building -TensorFlow, which by default is configured for the [CI](.github/workflows/ci.yml). The build configuration can be customized using the same methods as -TensorFlow, so if you're building locally, you may need to clone the [tensorflow](https://github.com/tensorflow/tensorflow) project, run its -configuration script (`./configure`), and copy the resulting -`.tf_configure.bazelrc` to `tensorflow-core-api`. This overrides the default options, and you can add to it manually (i.e. adding `build --copt="-g"` -to build with debugging info). +By default, the build will attempt to download the existing TensorFlow binaries from the web for the platform it is running on (so you need to have an active internet connection). +If such binaries are not available for your platform, you will need to build the TensorFlow runtime library from sources, by appending the `-Pnative-build` argument to your Maven +command. This requires a valid environment for building TensorFlow, including the [bazel](https://bazel.build/) build tool and a few Python dependencies +(please read [TensorFlow documentation](https://www.tensorflow.org/install/source) for more details). Note that building from sources can take multiple hours on a regular laptop. -The `tensorflow-core/tensorflow-core-api/.bazelversion` file must be kept in sync with `@org_tensorflow/.bazel_version`. -This allows using [Bazelisk](https://github.com/bazelbuild/bazelisk) which runs the bazel version given in .bazelversion instead of having to -physically reinstall a specific `bazel` version each time the TensorFlow version changes. - - -### GPU Support - -Currently, due to build time constraints, the GPU binaries only support compute capacities 3.5 and 7.0. -To use with un-supported GPUs, you have to build it yourself, after changing the value [here](tensorflow-core/tensorflow-core-api/build.sh#L27), -setting the environment variable `TF_CUDA_COMPUTE_CAPABILITIES`, or configuring it in a bazel rc file ( -i.e. `build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"`). While this is far from ideal, we are working on getting more build resources, and for -now this is the best option. - -To build for GPU, pass `-Djavacpp.platform.extension=-gpu` to maven. By default, the CI options are used for the bazel build, see the above section -for more info. If you add `bazelrc` files, make sure the `TF_CUDA_COMPUTE_CAPABILITIES` value in them matches the value set elsewhere, as it will take -precedence if present. - -## Running Tests - -`ndarray` can be tested using the maven `test` target. `tensorflow-core` and `tensorflow-framework`, however, should be tested using -the `integration-test` target, due to the need to include native binaries. It will **not** be ran when using the `test` target of parent projects, but -will be ran by `install` or `integration-test`. If you see a `no jnitensorflow in java.library.path` error from tests it is likely because you're -running the wrong test target. +To build for GPU, pass `-Djavacpp.platform.extension=-gpu` to maven. If you want to use TensorFlow Java with unsupported GPUs, set the environment variable `TF_CUDA_COMPUTE_CAPABILITIES`, or +configure it in a bazel rc file (i.e. `build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"`). ### Native Crashes @@ -102,46 +75,62 @@ to tell what caused the issue. To upgrade the version of TensorFlow that is embedded within TensorFlow Java, please follow carefully these steps. -### Upgrading TensorFlow Runtime Library - -You can upgrade the version of the TensorFlow library by updating the archive downloadeded in the Bazel -[workspace](https://github.com/tensorflow/java/blob/master/tensorflow-core/tensorflow-core-api/WORKSPACE#L19) at build time. Make sure to -update the `urls`, `sha256` and `strip_prefix` fields of the `org_tensorflow` archive rule to reflect the values for the new version. - -### Ops Classification - -After building with the version of TensorFlow, you might notice that a lot of new operations appeared in the `org.tensorflow.ops.core` -package of the [generated sources](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core) of -the `tensorflow-core-api` module. Many of these ops must be reclassified manually after running this initial build. - -The actual classification process is a bit arbitrary and based on the good jugement of the developer. The reason is that most ops in Python +### Upgrading TensorFlow Native Library + +1. Download locally the archive of the tensorflow release at https://github.com/tensorflow/tensorflow/archive/refs/tags/vX.X.X.tar.gz +2. Compute the SHA sum using the shell command `shasum -a 256 ` +3. Update `urls`, `sha256` and `strip_prefix` fields of the `org_tensorflow` archive rule in Bazel [workspace](https://github.com/tensorflow/java/blob/master/tensorflow-core/tensorflow-core-native/WORKSPACE#L19) +4. Extract the archive in a temporary folder +5. Copy the content of `tensorflow-x.x.x/.bazelrc` file to `tensorflow-core/tensorflow-core-native/tensorflow.bazelrc` under TensorFlow Java source tree +6. Copy the content of `tensorflow-x.x.x/WORKSPACE` after the "###### Copy content of..." notice to `tensorflow-core/tensorflow-core-native/WORKSPACE`, read notice for more details +7. Copy the content of `tensorflow-x.x.x/.bazelversion` file to `tensorflow-core/tensorflow-core-native/.bazelversion` +8. Validate that options in `tensorflow-core/tensorflow-core-native/.bazelrc` are still accurate or update them accordingly +9. Update URLs of existing TensorFlow binaries in the `tensorflow-core/tensorflow-core-native/scripts/dist_download` script +10. Update URLs of TensorFlow-Text binaries used for testing in the `tensorflow-core/tensorflow-core-api/scripts/test_download` script + +#### Patching TensorFlow Sources + +In order to build the TensorFlow native library to work with TensorFlow Java, we sometimes need to apply some patches to the TensorFlow sources. These +patches are found in `tensorflow-core/tensorflow-core-native/external`. + +- If you have an error like "Error in fail: Error applying patch //external:xxx.patch:", verify why the patch is failing by looking at the TensorFlow source code. + Chances are that this code has changed and the patch needs to be updated. +- To create a new patch or update one, you can make a copy of the TensorFlow source file to change, make your change and generate a patch using `git diff ` +- If more than one file needs to be added to the patch, it's easier to clone the [TensorFlow repository](https://github.com/tensorflow/tensorflow), apply the changes and use `git diff` at the root of the tree + +### Generating Java Bindings + +After upgrading the TensorFlow library, you need to regenerate all Java bindings that depends on the native code. That includes Java protos, C API bindings (JavaCPP) and +operator classes. You can trigger the regeneration of these bindings with the Maven command `mvn clean install -Pgenerating`. + +This will also trigger a small Bazel build of the TensorFlow sources to regenerate the Java protos, so make sure your [environment](CONTRIBUTING.md#native-builds) is setup properly. + +#### Operations Classification + +When generating the operator classes, the build process might prompt you to provide information about the new operations found in the targeted TensorFlow version. This will generate a new API definition +under the [tensorflow-core/tensorflow-core-api/api](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api/api) folder. The required +information is: +* The visibility for this op + * VISIBLE to force the creation of a Java class that will be also exposed by the `*Ops` API classes. + * HIDDEN for creating a Java class that won't be exposed by the `*Ops` API classes. + * SKIP for not creating a Java class for this operation + * DEFAULT to rely on the visibility settings set in TensorFlow sources +* The name group for this operator + * This name is used to place this operator under the right subpackage and `*Ops` API. + * For example, the group `nn` will place the operator `Conv` under the `org.tensorflow.op.nn` package and in the `NnOps` API class. + * When no group is specified, the operator will go under the `org.tensorflow.op.core` package and in the `Ops` API class. +* The name for this op + * By default is the name found in TensorFlow registry but can be useful in some cases to rename it in case it clashes with Java keywords (e.g. `Switch`-> `SwitchCond`) + * Can also be used to remove the suffix of an operation that has multiple versions (e.g. `RestoreV2` -> `Restore`) + +The actual classification process is a bit arbitrary and based on the good judgement of the developer. The reason is that most ops in Python are being wrapped by a higher-level API and therefore are left unclassified, while in Java they are exposed and can be used directly by -the users. - -For classifying an op, a `api_def` proto must be added to the `tensorflow-core-api` [folder](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api/src/bazel/api_def) -for this purpose, redefining optionally its endpoints or its visibility. - -Writing these protos and trying the guess the right location for each new operation can become a tedious job so an utility program called `java_api_import` -has been created to help you with this task. This utility is available under the `bazel-bin` folder of `tensorflow-core-api` after the -initial build. Here is how to invoke it: +the users. -``` -cd tensorflow-core/tensorflow-core-api -./bazel-bin/java_api_import \ - --java_api_dir=src/bazel/api_def \ - --tf_src_dir=bazel-tensorflow-core-api/external/org_tensorflow \ - --tf_lib_path=bazel-bin/external/org_tensorflow/tensorflow/libtensorflow_cc.. -``` - -For each new operation detected (i.e. any operation that does not have a valid `api_def` proto yet), the utility will suggest you some possible -package names that can be a good match for its classification (unless a "perfect match" has been found in the Python code, in which case the utility -will automatically classify the op). It is also possible to enter manually the name of the package to use, and the package can have multiple levels (e.g. `linalg.sparse`). The utility -application will then take care to write the `api_def` proto for each operation classified. +Please review the location of the new generated operators after the build is complete and make necessary adjustments to the API definitions protos +manually if some of them seems to be in the "wrong" place, making sure to repeat this process until satisfaction. -Make sure to erase completely the generated source folder of the `tensorflow-core-api` module before rerunning the build so you can see -if your ops have been classified properly. - -#### Ops Kernel Upgrade +#### New Operation Version Some operations might be just an upgrade of another existing operations. For instance, there are many version of the `BatchMatMul` kernel (V1, V2, V3...). When you see that a new op is just an upgrade from another other one, make sure that the latest version has a valid endpoint and that all other @@ -149,48 +138,21 @@ previous versions of this operation are marked as `VISIBILITY: SKIP`. ### Java Protos Classification -TensorFlow Java distributes a large number proto definitions found in the TensorFlow Runtime Library as Java classes. Again, new protos might not -be classified properly since they may be lacking the `option java_*` statements at the beginning of their definition. If you notice in the -[generated protos](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto) of the `tensorflow-core-api` -that some new proto classes seems to be in the wrong package, create a Bazel patch at this effect to add the missing options. -See [existing patches](https://github.com/tensorflow/java/blob/master/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch) for examples. - -## Contributing - -### Formatting - -Java sources should be formatted according to the [Google style guide](https://google.github.io/styleguide/javaguide.html). It can be included -in [IntelliJ](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml) and -[Eclipse](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml). -[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html) should also be used for C++ code. - -### Dependencies - -For dependencies, we can use anything compliant with [this list](https://opensource.google/docs/thirdparty/licenses/#notice), but we want to keep the core libraries as dependency free as possible. +TensorFlow Java distributes a large number proto definitions found in the TensorFlow native library as Java classes. Again, new protos might not +be classified properly since they may be lacking the `option java_*` statements at the beginning of their definition. The build script will attempt +to mitigate this omission by generating the proto bindings under the same package as the `package` statement (if also present), and under the root package +`org.tensorflow.proto`. -### Code generation +#### Custom Operators Code generation for `Ops` and related classes is done during `tensorflow-core-api`'s `compile` phase, using the annotation processor in `tensorflow-core-generator`. If you change or add any operator classes (annotated with `org.tensorflow.op.annotation.Operator`), endpoint methods ( annotated with `org.tensorflow.op.annotation.Endpoint`), or change the annotation processor, be sure to re-run a -`mvn install` in `tensorflow-core-api` (`-Pdev` is fine for this, it just needs to run the annotation processor). - -### Working with Bazel generation +`mvn clean install -Pgenerating` in `tensorflow-core-api`. -`tensorflow-core-api` uses Bazel-built C++ code generation to generate most of the `@Operator` classes. See [Native Builds](#native-builds) for -instructions on configuring the bazel build. To run the code generation, use the `//:java_op_generator` target. The resulting binary has good help -text (viewable in -[op_gen_main.cc](tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_gen_main.cc#L31-L48)). Generally, it should be called with arguments -that are something like: +## Known Issues -``` -bazel-out/k8-opt/bin/external/org_tensorflow/tensorflow/libtensorflow_cc.so --output_dir=src/gen/java --api_dirs=bazel-tensorflow-core-api/external/org_tensorflow/tensorflow/core/api_def/base_api,src/bazel/api_def -``` - -(called in `tensorflow-core-api`). - - -## Adding Gradients +### Missing Gradients In some cases, a op supported by Tensorflow Java will not have a gradient defined, resulting in errors like this: ``` @@ -199,4 +161,6 @@ org.tensorflow.exceptions.TensorFlowException: No gradient defined for op: ReadV at org.tensorflow.Graph.addGradients(Graph.java:708) at org.tensorflow.Graph.addGradients(Graph.java:291) ``` -The description in the [linked file](https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md) are accurate for adding C++ Graph gradients, which are used by our `Graph`. Eexamples of doing that are [tensorflow/tensorflow#46115](https://github.com/tensorflow/tensorflow/pull/46115) and [tensorflow/tensorflow#47774](https://github.com/tensorflow/tensorflow/pull/47774). However, Tensorflow Core is in the process of migrating gradient definitions to [`c/experimental/gradients`](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/c/experimental/gradients), which will be what our eager mode uses once it has gradient support. Anyone adding gradients is strongly encouraged to add one there as well, and eventually it should replace the legacy `cc/gradients` gradients. +The description in the [linked file](https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md) are accurate for adding C++ Graph gradients, which are used by our `Graph`. Examples of doing that are [tensorflow/tensorflow#46115](https://github.com/tensorflow/tensorflow/pull/46115) and [tensorflow/tensorflow#47774](https://github.com/tensorflow/tensorflow/pull/47774). + +You can also code and register the missing gradients in Java, using the TensorFlow Java custom gradient registration capabilities. Check at the JavaDoc of `tensorflow-core-api` for more details. diff --git a/MIGRATING.md b/MIGRATING.md index 542f3a25e0d..ac7276eba99 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -3,6 +3,83 @@ TensorFlow Java is still in an alpha stage, therefore is subject to contain breaking changes between the different releases. This guide explain in detail how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible. +## Migrating to 1.0.0 + +TensorFlow-Java 1.0.0 requires Java 11 or later. + +### Native Artifact Renaming + +The native artifacts, that used to be distributed as `tensorflow-core-api`, are now distributed under `tensorflow-core-native`. If you still add +`tensorflow-core-platform` in your project, that won't affect you. But if you were adding dependencies to specific native runtimes, you need to update +them to reflect the new artifact name. + +For example, +```xml + + org.tensorflow + tensorflow-core-api + 0.5.0 + + + org.tensorflow + tensorflow-core-api + 0.5.0 + linux-x86_64 + +``` +will now be +```xml + + org.tensorflow + tensorflow-core-api + 1.0.0 + + + org.tensorflow + tensorflow-core-native + 1.0.0 + linux-x86_64 + +``` +### Java Module Renaming + +The Java Module (jigsaw) names has been updated to drop the leading `org.`, as follow: +- `tensorflow-core-api` : `tensorflow` (was `org.tensorflow` before) +- `tensorflow-core-generator` : `tensorflow.generator` (was `org.tensorflow-generator` before) +- `tensorflow-core-native` : `tensorflow.nativelib` +- `tensorflow-framework` : `tensorflow.framework` (was `org.tensorflow.framework` before) + +### GPU Support + +Previous versions of TF Java were building a `tensorflow-core-platform-gpu` artifact upon which application could depend +on to include any TensorFlow native library that GPU support enabled. Since TensorFlow has removed its support of GPU +on all platforms other than Linux, we removed our platform JAR in favour of simply adding a dependency on the +`linux-x86_64-gpu` native artifact. +```xml + + org.tensorflow + tensorflow-core-native + 1.0.0 + linux-x86_64-gpu + +``` +Please note that including this dependency won't work if your application also depends on `tensorflow-core-platform`. If +you need to support more platforms than Linux, you should include the other `tensorflow-core-native` dependencies +separately (see the [README](README.md) file). + +### Session Run Result + +In versions before 0.4.0 `Session.Runner.run` and `TensorFunction.call` returned a `List`. In newer versions +they return a `Result` class which is `AutoCloseable` to make management of the tensor lifetime simpler. To migrate +users should wrap the `run` invocation in a try-with-resources statement rather than closing the output tensors +individually. + +### Proto Definitions Moved + +Some proto definitions under `org.tensorflow.proto` have been moved to a different location under the same (`org.tensorflow.proto`) package. +Certain classes have moved packages, for example, `org.tensorflow.proto.example.Feature` to `org.tensorflow.proto.Feature`. +You will need to reimport these proto bindings to match the new location. Your IDE should easily be able to do this for you. + ## Migrating to 0.3.0 ### Non-parameterized Typed Tensors diff --git a/README.md b/README.md index 5c117740db8..67dae4fc1ab 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The following describes the layout of the repository and its different artifacts * `tensorflow-core` * All artifacts that build up the core language bindings of TensorFlow for Java * Intended audience: projects that provide their own APIs or frameworks on top of - TensorFlow and just want a thin layer to access the TensorFlow runtime from the JVM + TensorFlow and just want a thin layer to access the TensorFlow native library from the JVM * `tensorflow-framework` * Primary API for building and training neural networks with TensorFlow @@ -32,10 +32,10 @@ The following describes the layout of the repository and its different artifacts ## Communication -This repository is maintained by TensorFlow JVM Special Interest Group (SIG). You can easily join the group -by subscribing to the [jvm@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/jvm) -mailing list, or you can simply send pull requests and raise issues to this repository. -There is also a [sig-jvm Gitter channel](https://gitter.im/tensorflow/sig-jvm). +This repository is maintained by TensorFlow JVM Special Interest Group (SIG). You can easily contact the group +by posting to the [TensorFlow Forum](https://discuss.tensorflow.org), adding the `sig_jvm` tag, or by writing to us on +the [sig-jvm Gitter channel](https://gitter.im/tensorflow/sig-jvm). You can also simply send pull requests +and raise issues to this repository. ## Building Sources @@ -43,28 +43,49 @@ See [CONTRIBUTING.md](CONTRIBUTING.md#building). ## Using Maven Artifacts -To include TensorFlow in your Maven application, you first need to add a dependency on either the -`tensorflow-core` or `tensorflow-core-platform` artifacts. The former could be included multiple times -for different targeted systems by their classifiers, while the later includes them as dependencies for -`linux-x86_64`, `macosx-x86_64`, and `windows-x86_64`, with more to come in the future. There are also -`tensorflow-core-platform-mkl`, `tensorflow-core-platform-gpu`, and `tensorflow-core-platform-mkl-gpu` -artifacts that depend on artifacts with MKL and/or CUDA support enabled. +There are two options for adding TensorFlow Java as a dependency to your Maven project: with individual dependencies +for each targeted platform or with a single dependency that targets them all. + +### Individual dependencies + +With this option, you must first add a dependency to `tensorflow-core-api` and then one or multiple +dependencies to `tensorflow-core-native` with a classifier targeting a specific platform. This option is preferred as +it minimizes the size of your application by only including the TensorFlow builds you need, at the cost of being more +restrictive. + +While TensorFlow Java can be compiled for [multiple platforms](https://github.com/tensorflow/java/blob/master/tensorflow-core/pom.xml#L54), +only binaries for the following are being **supported and distributed** by this project: + +- `linux-x86_64`: Linux platforms on Intel/AMD chips +- `linux-x86_64-gpu`: Linux platforms on Intel/AMD chips with Cuda GPU support +- `linux-arm64`: Linux platforms on Arm chips +- `macosx-arm64`: MacOS X platforms on Apple Silicon chips +- `windows-x86_64`: Windows platforms on Intel/AMD chips (v1.1.0 and earlier) + +Binaries for `macosx-x86_64` are available for TF-Java 1.0 series releases and earlier, they were dropped from +TF-Java 1.1 and newer as they are no longer supported or released by Google. For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux -systems, you should add the following dependencies: +systems with no GPU support, you should add the following dependencies: ```xml org.tensorflow tensorflow-core-api - 0.3.3 + 1.1.0 org.tensorflow - tensorflow-core-api - 0.3.3 - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + linux-x86_64 ``` +Or Gradle: +```groovy +def tfVersion = '1.1.0' +implementation "org.tensorflow:tensorflow-core-api:$tfVersion" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:linux-x86_64" +``` On the other hand, if you plan to deploy your JAR on more platforms, you need additional native dependencies as follows: @@ -72,50 +93,74 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 0.3.3 + 1.1.0 org.tensorflow - tensorflow-core-api - 0.3.3 - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + linux-x86_64-gpu org.tensorflow - tensorflow-core-api - 0.3.3 - macosx-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + macosx-arm64 org.tensorflow - tensorflow-core-api - 0.3.3 - windows-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + windows-x86_64 ``` +Or Gradle: +```groovy +def tfVersion = '1.1.0' +implementation "org.tensorflow:tensorflow-core-api:$tfVersion" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:linux-x86_64-gpu" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:macosx-arm64" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:windows-x86_64" +``` -In some cases, pre-configured starter artifacts can help to automatically include all versions of -the native library for a given configuration. For example, the `tensorflow-core-platform`, -`tensorflow-core-platform-mkl`, `tensorflow-core-platform-gpu`, or `tensorflow-core-platform-mkl-gpu` -artifact includes transitively all the artifacts above as a single dependency: +Only one dependency can be added per platform, meaning that you cannot add native dependencies to both `linux-x86_64` and +`linux-x86_64-gpu` within the same project. + +To use an NVIDIA GPU, you need to install the NVIDIA device driver, CUDA Toolkit, and cuDNN. +For Ubuntu 24.04, you can install them with the following command: +```sudo apt install -y nvidia-driver-550 nvidia-cuda-toolkit nvidia-cudnn``` + +### Single dependency + +In some cases, it might be preferable to add a single dependency that includes transitively all the artifacts +required to run TensorFlow Java on any [supported platforms](README.md#individual-dependencies) + +- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-x86_64-arm64`, `macosx-arm64` and `windows-x86_64` + +For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can +simply add this dependency to your application: ```xml org.tensorflow - tensorflow-core-platform${javacpp.platform.extension} - 0.3.3 + tensorflow-core-platform + 1.1.0 ``` +Or Gradle: +```groovy +implementation "org.tensorflow:tensorflow-core-platform:1.1.0" +``` -Be aware though that the native library is quite large and including too many versions of it may -significantly increase the size of your JAR. So it is good practice to limit your dependencies to -the platforms you are targeting. For this purpose the `-platform` artifacts include profiles that follow +Be aware though that the builds of TensorFlow are quite voluminous and including too many native dependencies may +significantly increase the size of your application. So it is good practice to limit your dependencies to +the platforms you are targeting. For this purpose these artifacts include profiles that follow the conventions established on this page: * [Reducing the Number of Dependencies](https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies) ### Snapshots Snapshots of TensorFlow Java artifacts are automatically distributed after each update in the code. To use them, you need -to add Sonatype OSS repository in your pom.xml, like the following +to add Sonatype OSS repository in your `pom.xml`, like the following ```xml @@ -132,24 +177,50 @@ to add Sonatype OSS repository in your pom.xml, like the following org.tensorflow tensorflow-core-platform - 0.4.0-SNAPSHOT + 1.2.0-SNAPSHOT ``` +Or Gradle: +```groovy +repositories { + mavenCentral() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots") + } +} + +dependencies { + // Example of dependency, see section above for more options + implementation "org.tensorflow:tensorflow-core-platform:1.2.0-SNAPSHOT" +} +``` -## TensorFlow Version Support - -This table shows the mapping between different version of TensorFlow for Java and the core runtime libraries. - -| TensorFlow Java Version | TensorFlow Version | -| ------------- | ------------- | -| 0.2.0 | 2.3.1 | -| 0.3.0 | 2.4.1 | -| 0.3.1 | 2.4.1 | -| 0.3.2 | 2.4.1 | -| 0.3.3 | 2.4.1 | -| 0.4.0-SNAPSHOT | 2.6.0 +## TensorFlow/Java Version Support + +This table shows the mapping between TensorFlow, TensorFlow Java and minimum supported Java versions. + +| TensorFlow Java Version | TensorFlow Version | Minimum Java Version | +|-------------------------|--------------------|----------------------| +| 0.2.0 | 2.3.1 | 8 | +| 0.3.0 | 2.4.1 | 8 | +| 0.3.1 | 2.4.1 | 8 | +| 0.3.2 | 2.4.1 | 8 | +| 0.3.3 | 2.4.1 | 8 | +| 0.4.0 | 2.7.0 | 8 | +| 0.4.1 | 2.7.1 | 8 | +| 0.4.2 | 2.7.4 | 8 | +| 0.5.0 | 2.10.1 | 11 | +| 1.0.0-rc.1 | 2.16.1 | 11 | +| 1.0.0-rc.2 | 2.16.2 | 11 | +| 1.0.0 | 2.16.2 | 11 | +| 1.1.0 | 2.18.0 | 11 | +| 1.2.0-SNAPSHOT | 2.20.0 | 11 | ## How to Contribute? Contributions are welcome, guidelines are located in [CONTRIBUTING.md](CONTRIBUTING.md). + +## Code and Usage Examples + +Please look at this repository: https://github.com/tensorflow/java-models diff --git a/RELEASE.md b/RELEASE.md index e3e57fcd63f..70b79d5f8ad 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -59,10 +59,11 @@ version number. ``` mvn versions:set -DnewVersion=1.0.0 ``` -4. In the [README.md](https://github.com/tensorflow/java/blob/master/README.md) file, - update the ['Using Maven Artifacts'](https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts) - section and the ['TensorFlow Version Support'](https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support) - table to reflect the new version being released. +4. Update the TensorFlow Java version to reflect the new release at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L61 + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L167 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support 5. Commit the changes and push the new branch to the GitHub repository ``` @@ -89,12 +90,11 @@ version number. ``` mvn versions:set -DnewVersion=1.0.1 ``` -5. In the [README.md](https://github.com/tensorflow/java/blob/master/README.md) file, - update the ['Using Maven Artifacts'](https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts) - section and the ['TensorFlow Version Support'](https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support) - table to reflect the new version being released. - Also update all references to the previous version in the [installation instructions](https://github.com/tensorflow/java/blob/master/docs/install.md) - for the new one. +5. Update the TensorFlow Java version to reflect the new release at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L61 + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L167 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support 6. Commit the changes and push the branch to the GitHub repository ``` @@ -160,7 +160,7 @@ for temporary staging. 2. Execute the `release.sh` script. This will deploy artifacts on OSS Sonatype. All native artifacts previously temporarily staged by GitHub Actions will be fetched, signed and redeployed as well. - The script takes in paramater the sequence number of the staging repository created in OSSRH + The script takes in a parameter the sequence number of the staging repository created in OSSRH by the GitHub Actions workflow. You can retrieve this ID by looking in the staging repositories in OSSRH console directly, or check at the output of the step `Create Staging Repository` of the `prepare` job in the workflow execution, where the ID is printed. @@ -195,10 +195,10 @@ Some things of note: ``` mvn versions:set -DnewVersion=1.1.0-SNAPSHOT ``` -3. In the [README.md](https://github.com/tensorflow/java/blob/master/README.md) file, - update the ['Using Maven Artifacts'](https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts) - section and the ['TensorFlow Version Support'](https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support) - table to reflect the new snapshot version. +3. Update the TensorFlow Java version to reflect the new snapshot at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L104 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support 4. Commit your changes and push the master branch to the GitHub repository ``` diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 1d373464515..00000000000 --- a/deploy.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env bash -# 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 script is intended to be run inside a docker container to provide a -# hermetic process. See release.sh for the expected invocation. - -set -e - -IN_CONTAINER="${IN_CONTAINER:-false}" - -MVN_OPTIONS="-B -e --settings ${PWD}/settings.xml -Pdeploying" - -mvn_property() { - local property="$1" - mvn exec:exec $MVN_OPTIONS -q -N -Dexec.executable='echo' -Dexec.args="\${${property}}" -} - -# -# Clean the working directory before doing anything -# -echo "Cleaning working directory..." -mvn clean $MVN_OPTIONS -q -U - -# -# Extract deployed version from POM -# -echo "Parsing Maven configuration..." -TF_VERSION=`mvn_property "project.version"` -if [ -z "${TF_VERSION}" ]; then - echo "Fail to extract TF_VERSION from POM" - exit 1 -fi - -# -# Validate the environment based on if we are deploying a snapshot or a release version -# -echo -if [[ $TF_VERSION = *-SNAPSHOT ]]; then - echo "===> Deploying TensorFlow Java, version ${TF_VERSION} <===" - echo - DEPLOY_FILE_GOAL=deploy:deploy-file - DEPLOY_REPOSITORY_URL=`mvn_property "project.distributionManagement.snapshotRepository.url"` - -else - echo "===> Releasing TensorFlow Java, version ${TF_VERSION} <===" - echo - if [[ "${IN_CONTAINER}" != "true" ]]; then - echo "Release must be executed from a Docker container, please make sure to invoke release.sh" - exit 1 - fi - if [[ -z "${STAGING_SEQ}" ]]; then - echo "Staging sequence is required for release" - exit 1 - fi - DEPLOY_FILE_GOAL=gpg:sign-and-deploy-file - DEPLOY_REPOSITORY_URL=`mvn_property "project.distributionManagement.repository.url"` - - MVN_OPTIONS="$MVN_OPTIONS -Preleasing -DstagingRepositoryId=orgtensorflow-${STAGING_SEQ}" - - apt-get -qq update && apt-get -qq install -y gnupg2 -fi - -# -# Copy tensorflow-core-api dependencies for each supported platforms to our local maven tree, -# so retrieve the native artifacts that have been build and uploaded by the build servers -# -echo "Downloading native artifacts from Maven repository..." -for p in `find tensorflow-core -name tensorflow-core-platform* -type d -exec basename {} \;`; do - if [[ $p =~ tensorflow-core-platform(.*) ]]; then - # Remember each of our platform extension, we will it that when deploying the artifacts - # Note: Disable (temporarily?) MKL platforms for now, as their build is often broken - PLATFORM_EXT=${BASH_REMATCH[1]} - if [[ $PLATFORM_EXT != -mkl* ]]; then - if [[ -n $PLATFORM_EXT ]]; then - [[ -n $PLATFORM_EXTS ]] && PLATFORM_EXTS="$PLATFORM_EXTS $PLATFORM_EXT" || PLATFORM_EXTS=$PLATFORM_EXT - fi - mvn dependency:copy-dependencies $MVN_OPTIONS -q \ - -Djavacpp.platform.extension=$PLATFORM_EXT -DincludeArtifactIds=tensorflow-core-api \ - -DoutputDirectory=../../tensorflow-core/tensorflow-core-api/target -pl tensorflow-core/$p - fi - fi -done - -# -# Feed the FILES,TYPES and CLASSIFIERS variables for the maven-deploy-plugin with our native artifacts -# so that tensorflow-core-api can be deployed as a bundle -# -for f in tensorflow-core/tensorflow-core-api/target/tensorflow-core-api-$TF_VERSION-*.jar; do - echo "Found native artifact: $f" - if [[ $f =~ tensorflow-core-api-$TF_VERSION-(.*).jar ]]; then - [[ -n $NATIVE_FILES ]] && NATIVE_FILES=$NATIVE_FILES,$f || NATIVE_FILES=$f - [[ -n $NATIVE_FILE_TYPES ]] && NATIVE_FILE_TYPES=$NATIVE_FILE_TYPES,jar || NATIVE_FILE_TYPES=jar - [[ -n $NATIVE_CLASSIFIERS ]] && NATIVE_CLASSIFIERS=$NATIVE_CLASSIFIERS,${BASH_REMATCH[1]} || NATIVE_CLASSIFIERS=${BASH_REMATCH[1]} - fi -done - -# -# Build and deploy the artifacts on OSSRH -# We need to do it manually for all non-default platforms, as they are not automatically included as -# modules in the POM and depends on the javacpp.platform.extension property. -# Note that the tensorflow-core-api, which needs special care, won't be deployed yet, see below. -# -mvn deploy $MVN_OPTIONS -for p in $PLATFORM_EXTS; do - mvn deploy $MVN_OPTIONS -Djavacpp.platform.extension=$p -pl tensorflow-core/tensorflow-core-platform$p -done - -# Now deploy manually the tensorflow-core-api with all its native artifacts. -mvn $DEPLOY_FILE_GOAL $MVN_OPTIONS -pl tensorflow-core/tensorflow-core-api \ - -DgroupId=org.tensorflow -DartifactId=tensorflow-core-api -Dversion=$TF_VERSION -Dpackaging=jar \ - -Dfile=target/tensorflow-core-api-$TF_VERSION.jar \ - -Dfiles=$NATIVE_FILES -Dtypes=$NATIVE_FILE_TYPES -Dclassifiers=$NATIVE_CLASSIFIERS \ - -Dsources=target/tensorflow-core-api-$TF_VERSION-sources.jar \ - -Djavadoc=target/tensorflow-core-api-$TF_VERSION-javadoc.jar \ - -DpomFile=pom.xml \ - -DrepositoryId=ossrh -Durl=$DEPLOY_REPOSITORY_URL - -echo -if [[ $TF_VERSION = *-SNAPSHOT ]]; then - echo "Uploaded to snapshot repository" -else - echo "Uploaded to the staging repository" - echo "After validating the release: " - echo "* Login to https://oss.sonatype.org/#stagingRepositories" - echo "* Find the 'org.tensorflow' staging release and click either 'Release' to release or 'Drop' to abort" -fi -echo diff --git a/docs/_toc.yaml b/docs/_toc.yaml old mode 100644 new mode 100755 diff --git a/docs/docs/assets/tensorflow.svg b/docs/docs/assets/tensorflow.svg new file mode 100644 index 00000000000..c0778626d66 --- /dev/null +++ b/docs/docs/assets/tensorflow.svg @@ -0,0 +1 @@ + diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100755 index 00000000000..c9fcbf53e7e --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,42 @@ +# TensorFlow for Java + +TensorFlow Java can run on any JVM for building, training and running machine learning models. It comes with +a series of utilities and frameworks that help achieve most of the tasks common to data scientists +and developers working in this domain. Java and other JVM languages, such as Scala or Kotlin, are +frequently used in small-to-large enterprises all over the world, which makes TensorFlow a strategic +choice for adopting machine learning at a large scale. + +## The Repository + +In the early days, the Java language bindings for TensorFlow were hosted in the +[main TensorFlow repository](https://github.com/tensorflow/tensorflow) +and released only when a new version of the core library was ready to be distributed, which happens only +a few times a year. Now, all Java-related code has been moved to this repository so that it can evolve and +be released independently from official TensorFlow releases. In addition, most of the build tasks have been +migrated from Bazel to Maven, which is more familiar for most Java developers. + +The following describes the layout of the repository and its different artifacts: + +### [tensorflow-core](https://github.com/tensorflow/java/tree/master/tensorflow-core) + * **Intended audience**: developers who wants to deploy a TensorFlow model on a JVM for inference. Also for projects + that provide their own APIs or frameworks on top of TensorFlow and just want a thin layer to access the TensorFlow runtime from the JVM. + * All artifacts that make up the core language bindings of TensorFlow for Java. + +### [tensorflow-framework](https://github.com/tensorflow/java/tree/master/tensorflow-framework) + * **Intended audience**: neural network developers. + * Primary API for building and training neural networks with TensorFlow. + +### [ndarray](https://github.com/tensorflow/java-ndarray) + * **Intended audience**: any developer who needs a Java n-dimensional array implementation, whether or not they use it with TensorFlow. + * Generic utility library for n-dimensional data I/O operations. + * Used by TensorFlow but does not depend on TensorFlow. + +## Communication + +This repository is maintained by TensorFlow JVM Special Interest Group (SIG). You can easily contact the group +by posting to the [TensorFlow Forum](https://discuss.tensorflow.org), adding the `sig_jvm` tag, or by writing to us on +the [sig-jvm Gitter channel](https://gitter.im/tensorflow/sig-jvm). You can also simply send pull requests +and raise issues to this repository. + + + diff --git a/docs/install.md b/docs/docs/install.md old mode 100644 new mode 100755 similarity index 81% rename from docs/install.md rename to docs/docs/install.md index b102782ed4f..2fe676e956a --- a/docs/install.md +++ b/docs/docs/install.md @@ -8,24 +8,30 @@ Kotlin, are frequently used in large and small enterprises all over the world, which makes TensorFlow Java a strategic choice for adopting machine learning at a large scale. -Caution: The TensorFlow Java API is *not* covered by the TensorFlow -[API stability guarantees](../guide/versions.md). +Note: Starting from version 1.0.0, the TensorFlow Java project follows the +[TensorFlow API stability guarantees](https://www.tensorflow.org/guide/versions#api_stability). +However, as these bindings are downstream of the TensorFlow C API, users should +be aware that stability is subject to the evolution of the upstream TensorFlow core. ## Requirements -TensorFlow Java runs on Java 8 and above, and supports out-of-the-box the +TensorFlow Java runs on Java 11 and above, and supports out-of-the-box the following platforms: -* Ubuntu 16.04 or higher; 64-bit, x86 -* macOS 10.12.6 (Sierra) or higher; 64-bit, x86 -* Windows 7 or higher; 64-bit, x86 +* Ubuntu 20.04 or higher; 64-bit, x86 +* Ubuntu 22.04 or higher; 64-bit, arm +* macOS 14 or higher; 64-bit, arm +* Windows 10 or higher; 64-bit, x86 -*Note: To use TensorFlow on Android, see -[TensorFlow Lite](https://tensorflow.org/lite)* +TensorFlow Java 1.0 series and earlier releases also have binaries for: + +* macOS 12 or higher; 64-bit, x86 + +*Note: To use TensorFlow on Android, see [LiteRT](https://tensorflow.org/lite)* ## Versions -TensorFlow Java has its own release cycle, independent from the +TensorFlow Java has its own release cycle, independent of the [TensorFlow runtime](https://github.com/tensorflow/tensorflow). Consequently, its version does not match the version of TensorFlow runtime it runs on. Consult the TensorFlow Java @@ -41,14 +47,7 @@ TensorFlow Java to your project. The easiest one is to add a dependency on the Core API and the native dependencies it requires to run on all supported platforms. -You can also select one of the following extensions instead of the pure CPU -version: - -* `tensorflow-core-platform-mkl`: Support for Intel® MKL-DNN on all platforms -* `tensorflow-core-platform-gpu`: Support for CUDA® on Linux and Windows - platforms -* `tensorflow-core-platform-mkl-gpu`: Support for Intel® MKL-DNN and CUDA® on - Linux platform. +To include CUDA® support for Linux x86, select the `tensorflow-core-native:linux-x86_64-gpu` artifact. In addition, a separate dependency on the `tensorflow-framework` library can be added to benefit from a rich set of utilities for TensorFlow-based machine @@ -64,7 +63,7 @@ For example, org.tensorflow tensorflow-core-platform - 0.3.3 + 1.1.0 ``` @@ -107,7 +106,7 @@ snapshots repository in your `pom.xml`. org.tensorflow tensorflow-core-platform - 0.4.0-SNAPSHOT + 1.2.0-SNAPSHOT ``` @@ -124,7 +123,7 @@ repositories { } dependencies { - compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '0.3.3' + compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0' } ``` @@ -160,9 +159,9 @@ add the TensorFlow dependency to the project's `pom.xml` file: HelloTensorFlow - - 1.8 - 1.8 + + 11 + 11 @@ -170,7 +169,7 @@ add the TensorFlow dependency to the project's `pom.xml` file: org.tensorflow tensorflow-core-platform - 0.3.3 + 1.1.0 @@ -195,8 +194,8 @@ public class HelloTensorFlow { try (ConcreteFunction dbl = ConcreteFunction.create(HelloTensorFlow::dbl); TInt32 x = TInt32.scalarOf(10); - Tensor dblX = dbl.call(x)) { - System.out.println(x.getInt() + " doubled is " + ((TInt32)dblX).getInt()); + TInt32 dblX = (TInt32)dbl.call(x)) { + System.out.println(x.getInt() + " doubled is " + dblX.getInt()); } } diff --git a/docs/docs/references.md b/docs/docs/references.md new file mode 100644 index 00000000000..524b23dc675 --- /dev/null +++ b/docs/docs/references.md @@ -0,0 +1,8 @@ +--- +hide: + - navigation + - toc + - title +--- +# + \ No newline at end of file diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css new file mode 100644 index 00000000000..70aefe6843e --- /dev/null +++ b/docs/docs/stylesheets/extra.css @@ -0,0 +1,14 @@ +:root > * { + /*--md-primary-fg-color: #EE782F;*/ + /*--md-primary-fg-color--light: #455960;*/ + /*--md-primary-fg-color--dark: #90030C;*/ +} + +.md-typeset h1, .md-typeset h2 { + font-weight: 800; + letter-spacing: -.01em; +} + +.md-sidebar--primary { + display: none; +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index b689324fdc0..00000000000 --- a/docs/index.md +++ /dev/null @@ -1,52 +0,0 @@ -# TensorFlow for Java - - - - -
- View on TensorFlow.org - - View GitHub repository -
- -TensorFlow Java can run on any JVM for building, training and running machine learning models. It comes with -a series of utilities and frameworks that help achieve most of the tasks common to data scientists -and developers working in this domain. Java and other JVM languages, such as Scala or Kotlin, are -frequently used in small-to-large enterprises all over the world, which makes TensorFlow a strategic -choice for adopting machine learning at a large scale. - -## The Repository - -In the early days, the Java language bindings for TensorFlow were hosted in the -[main TensorFlow repository](https://github.com/tensorflow/tensorflow) -and released only when a new version of the core library was ready to be distributed, which happens only -a few times a year. Now, all Java-related code has been moved to this repository so that it can evolve and -be released independently from official TensorFlow releases. In addition, most of the build tasks have been -migrated from Bazel to Maven, which is more familiar for most Java developers. - -The following describes the layout of the repository and its different artifacts: - -* [tensorflow-core](https://github.com/tensorflow/java/tree/master/tensorflow-core) - * All artifacts that build up the core language bindings of TensorFlow for Java - * Intended audience: projects that provide their own APIs or frameworks on top of - TensorFlow and just want a thin layer to access the TensorFlow runtime from the JVM - -* [tensorflow-framework](https://github.com/tensorflow/java/tree/master/tensorflow-framework) - * Primary API for building and training neural networks with TensorFlow - * Intended audience: neural network developers - -* [ndarray](https://github.com/tensorflow/java-ndarray) - * Generic utility library for n-dimensional data I/O operations - * Used by TensorFlow but does not depend on TensorFlow - * Intended audience: any developer who needs a Java n-dimensional array implementation, whether or not they - use it with TensorFlow - - -## Communication - -This repository is maintained by TensorFlow JVM Special Interest Group (SIG). You can easily join the group -by subscribing to the [jvm@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/jvm) -mailing list, or you can simply send pull requests and raise issues to this repository. -There is also a [sig-jvm Gitter channel](https://gitter.im/tensorflow/sig-jvm). - - diff --git a/docs/legacy_tools/build_java_api_docs.py b/docs/legacy_tools/build_java_api_docs.py new file mode 100644 index 00000000000..77d3ba80f31 --- /dev/null +++ b/docs/legacy_tools/build_java_api_docs.py @@ -0,0 +1,132 @@ +# Lint as: python3 +# 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. +# ============================================================================== + +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + + +"""Generate TensorFlow Java reference docs for TensorFlow.org.""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import pathlib +import shutil +import tempfile +import io +import requests +import zipfile +from git import Repo + +from absl import app +from absl import flags + +from tensorflow_docs.api_generator import gen_java + +FLAGS = flags.FLAGS + +NDARRAY_VERSION = 'v1.0.0' +JAVACPP_VERSION = '1.5.11' +PROTOBUF_VERSION = 'v3.21.9' + +# __file__ is the path to this file +TOOLS_DIR = pathlib.Path(__file__).resolve().parent +DOCS_DIR = TOOLS_DIR.parent +REPO_ROOT = DOCS_DIR.parent +DOC_OUTPUT_DIR = DOCS_DIR.joinpath("output") + +SECTION_LABELS = { + 'org.tensorflow': 'Core', + 'org.tensorflow.ndarray': 'NdArray', + 'org.tensorflow.framework': 'Framework', +} + +# These flags are required by infrastructure, not all of them are used. +flags.DEFINE_string('output_dir', f"{DOC_OUTPUT_DIR}", + ("Use this branch as the root version and don't" + ' create in version directory')) + +flags.DEFINE_string('site_path', 'api_docs/', + 'Path prefix in the _toc.yaml') + +flags.DEFINE_string('code_url_prefix', None, + '[UNUSED] The url prefix for links to code.') + +flags.DEFINE_bool( + 'search_hints', True, + '[UNUSED] Include metadata search hints in the generated files') + + +def checkout_repo(repo_url: str, target_dir_name: str, version: str): + local_repo_path = f"{REPO_ROOT}/{target_dir_name}" + if not pathlib.Path(local_repo_path).exists(): + local_repo = Repo.clone_from(repo_url, local_repo_path) + else: + local_repo = Repo(local_repo_path) + local_repo.remotes['origin'].fetch() + local_repo.git.checkout(version) + + +def overlay(from_root, to_root): + for from_path in pathlib.Path(from_root).rglob('*'): + relpath = from_path.relative_to(from_root) + to_path = to_root/relpath + if from_path.is_file(): + assert not to_path.exists() + shutil.copyfile(from_path, to_path) + else: + to_path.mkdir(exist_ok=True) + + +def main(unused_argv): + checkout_repo('https://github.com/tensorflow/java-ndarray', 'ndarray', NDARRAY_VERSION) + checkout_repo('https://github.com/bytedeco/javacpp', 'javacpp', JAVACPP_VERSION) + response = requests.get('https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9-sources.jar') + with zipfile.ZipFile(io.BytesIO(response.content)) as z: + z.extractall(f"{REPO_ROOT}/protobuf") + response = requests.get('https://repo1.maven.org/maven2/org/osgi/osgi.annotation/8.1.0/osgi.annotation-8.1.0-sources.jar') + with zipfile.ZipFile(io.BytesIO(response.content)) as z: + z.extractall(f"{REPO_ROOT}/osgi") + + merged_source = pathlib.Path(tempfile.mkdtemp()) + (merged_source / 'java/org').mkdir(parents=True) + shutil.copytree(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/', merged_source/'java/org/tensorflow/') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow/') + shutil.copytree(REPO_ROOT/'tensorflow-framework/src/main/java/org/tensorflow/framework', merged_source/'java/org/tensorflow/framework') + shutil.copytree(REPO_ROOT/'ndarray/ndarray/src/main/java/org/tensorflow/ndarray', merged_source/'java/org/tensorflow/ndarray') + shutil.copytree(REPO_ROOT/'javacpp/src/main/java/org/bytedeco', merged_source/'java/org/bytedeco') + shutil.copytree(REPO_ROOT/'protobuf/com/', merged_source/'java/com') + shutil.copytree(REPO_ROOT/'osgi/org/osgi', merged_source/'java/org/osgi') + + gen_java.gen_java_docs( + package='org.tensorflow', + source_path=merged_source / 'java', + output_dir=pathlib.Path(FLAGS.output_dir), + site_path=pathlib.Path(FLAGS.site_path), + section_labels=SECTION_LABELS, + # Uncomment for local testing: + script_path=pathlib.Path(TOOLS_DIR, 'run-javadoc-for-tf-local.sh'), + ) + + +if __name__ == '__main__': + flags.mark_flags_as_required(['output_dir']) + app.run(main) diff --git a/docs/legacy_tools/requirements.txt b/docs/legacy_tools/requirements.txt new file mode 100644 index 00000000000..4435ca4d4a9 --- /dev/null +++ b/docs/legacy_tools/requirements.txt @@ -0,0 +1,8 @@ +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + +GitPython +requests +tensorflow-docs \ No newline at end of file diff --git a/docs/legacy_tools/run-javadoc-for-tf-local.sh b/docs/legacy_tools/run-javadoc-for-tf-local.sh new file mode 100644 index 00000000000..97d59ddfd6e --- /dev/null +++ b/docs/legacy_tools/run-javadoc-for-tf-local.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + +set -ex + +export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home # Or change to any JDK 11 home path + +# https://android.googlesource.com/platform/external/doclava/ +# There's a debian package: +# https://packages.debian.org/unstable/doclava-aosp +# Install with: +# +# $ sudo apt install doclava-aosp #v 6.0.1+r55-1+build1 +# +# https://unix.stackexchange.com/questions/594841/how-do-i-assign-a-value-to-a-bash-variable-iff-that-variable-is-null-unassigned +DOCLAVA_JAR=${DOCLAVA_JAR:-'tools/lib/doclava.jar'} # Build lib locally + + +# Install java clear silver templates with: +# +# $ sudo apt install libjsilver-aosp-java #v 6.0.1+r55-1+build1 +JSILVER_JAR=${JSILVER_JAR:-'tools/lib/jsilver.jar'} # Build lib locally + + +######### DELETE OUTPUT_DIR ################# + +# Empty the output directory in case a class has been deleted +rm -rf "${OUTPUT_DIR:?}"/* +############ RUN DOCLAVA ################### + +# $FEDERATED_DOCS is a space-separated string of url,file pairs. +read -a api_pairs <<< "${FEDERATED_DOCS}" +FEDERATED_PARAMS="" +for i in "${!api_pairs[@]}"; do + api_pair_str="${api_pairs[$i]}" # "url,api.txt" + read -a api_pair <<< "${api_pair_str//,/ }" + # Using the index as the API "name", build the federation params. Note that + # using 0 as an API name will evaluate to false and cause rendering bugs, + # so we preface with "api_". + FEDERATED_PARAMS+=" -federate api_${i} ${api_pair[0]}" + FEDERATED_PARAMS+=" -federationapi api_${i} ${api_pair[1]}" +done + +# To install javadoc, for example, use +# +# sudo apt install openjdk-11-jdk +# +# doclava doesn't work with openjdk-13 +# ``` +# javadoc: error - Class com.google.doclava.Doclava is not a valid doclet. +# Note: As of JDK 13, the com.sun.javadoc API is no longer supported. +# ``` +# It's used here: https://android.googlesource.com/platform/external/doclava/+/refs/heads/master/src/com/google/doclava/Doclava.java + +# Each package in $PACKAGE needs to prefaced with -subpackages, so do that. +SUBPACKAGES="" +read -r -a packages <<< "${PACKAGE}" +for pkg in "${packages[@]}"; do + SUBPACKAGES+=" -subpackages ${pkg}" +done +( # Capture the return code. it may be non-zero for minor errors. + /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/javadoc \ + -sourcepath "${SOURCE_PATH}" \ + -docletpath "${DOCLAVA_JAR}:${JSILVER_JAR}" \ + -doclet com.google.doclava.Doclava \ + -toroot "${SITE_PATH}"/ \ + -yaml _toc.yaml \ + -templatedir "${TEMPLATES}" \ + -public \ + -d "${OUTPUT_DIR}" \ + ${FEDERATED_PARAMS} \ + ${SUBPACKAGES} +) + + +mv "${OUTPUT_DIR}"/reference/* "${OUTPUT_DIR}" + +################################################################### +################### START OF POST-PROCESSING ###################### +################################################################### +rm "${OUTPUT_DIR}/navtree_data.js" || true +rm "${OUTPUT_DIR}/hierarchy.html" || true + +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|${SITE_PATH}/reference|${SITE_PATH}|g" +find ${OUTPUT_DIR} -name "*.yaml" | xargs sed -i '' "s|${SITE_PATH}/reference|${SITE_PATH}|g" +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/org/tensorflow|a href=\"${SITE_PATH}/org/tensorflow|g" +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/com/google|a href=\"${SITE_PATH}/com/google|g" + +JAVA_LANG=https://docs.oracle.com/javase/8/docs/api +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/java/lang|a href=\"${JAVA_LANG}/java/lang|g" + +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' 's|
|
|g'
+
+rm ${OUTPUT_DIR}/timestamp.js || true
+rm ${OUTPUT_DIR}/lists.js || true
+rm ${OUTPUT_DIR}/index.html || true
+
+cp ${TEMPLATES}/screen.css ${OUTPUT_DIR}/
+
+
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
new file mode 100644
index 00000000000..8729bca5af5
--- /dev/null
+++ b/docs/mkdocs.yml
@@ -0,0 +1,49 @@
+site_name: ''
+site_url: https://tensorflow.org
+repo_url: https://github.com/tensorflow/java
+site_description: Documentation of TensorFlow Java API and tools.
+copyright: "© TensorFlow Authors 2025"
+
+theme:
+  name: material
+  logo: assets/tensorflow.svg
+  features:
+    - navigation.indexes
+    - navigation.instant
+    - navigation.sections
+    - navigation.tabs
+    - navigation.tabs.sticky
+    - toc.follow
+  palette:
+    # Palette toggle for automatic mode
+    - media: "(prefers-color-scheme)"
+      toggle:
+        icon: material/brightness-auto
+        name: Switch to light mode
+    # Palette toggle for light mode
+    - media: "(prefers-color-scheme: light)"
+      scheme: default
+      primary: white
+      accent: orange
+      toggle:
+        icon: material/brightness-7
+        name: Switch to dark mode
+    # Palette toggle for dark mode
+    - media: "(prefers-color-scheme: dark)"
+      scheme: slate
+      primary: black
+      accent: orange
+      toggle:
+        icon: material/brightness-4
+        name: Switch to system preference
+
+extra_css:
+  - stylesheets/extra.css
+
+nav:
+  - Home:
+      - index.md
+  - Install:
+      - install.md
+  - References:
+      - apidocs/index.html
diff --git a/pom.xml b/pom.xml
index ed06b80c231..cd986f316a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
 
   org.tensorflow
   tensorflow-java
-  0.4.0-SNAPSHOT
+  1.2.0-SNAPSHOT
   pom
 
   TensorFlow Java Parent
@@ -19,34 +19,38 @@
   
     
       The Apache Software License, Version 2.0
-      http://www.apache.org/licenses/LICENSE-2.0.txt
+      https://www.apache.org/licenses/LICENSE-2.0.txt
       repo
     
   
 
   
-    https://github.com/tensorflow/tensorflow.git
-    git@github.com:tensorflow/tensorflow.git
-    scm:git:https://github.com/tensorflow/tensorflow.git
+    https://github.com/tensorflow/java.git
+    scm:git@github.com:tensorflow/java.git
+    scm:git:https://github.com/tensorflow/java.git
   
 
   
+    tensorflow-ndarray
     tensorflow-core
     tensorflow-framework
   
 
   
+    ${os.name}-${os.arch}
+
     UTF8
-    1.8
-    1.8
-    5.6.2
-    1.21
+    11
+    11
+    11
+    5.10.0
+    1.37
     2.7
-    2.6.0
+    2.25.0
     true
     true
     true
-    2.11.1
+    2.46.1
   
 
   
@@ -62,6 +66,7 @@
       
     
   
+
   
     
       ossrh-snapshots
@@ -83,8 +88,8 @@
   -->
   
     
-      ossrh
-      https://oss.sonatype.org/content/repositories/snapshots
+      central
+      https://central.sonatype.com/repository/maven-snapshots
     
     
       ossrh
@@ -147,6 +152,7 @@
         false
       
     
+
     
-        (1.9,)
         
         
-          !lint.skip
+          lint.skip
           !true
         
       
@@ -202,16 +206,18 @@
           
             org.apache.maven.plugins
             maven-compiler-plugin
-            3.8.0
+            3.11.0
             
               true
-              true 
               
                  
                 -Xlint:all
                 -XDcompilePolicy=simple
-                -Xplugin:ErrorProne
-                
+                
+                -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+                -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
+
+                
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
@@ -220,8 +226,6 @@
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
                 -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
-                -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
-                -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
               
               
                 
@@ -290,6 +294,182 @@
         
       
     
+
+    
+      linuxos
+      
+        linux
+      
+      
+        linux
+        linux
+      
+    
+    
+      linux-x86_64
+      
+        
+          linux
+          amd64
+        
+        
+          !javacpp.platform.extension
+        
+      
+    
+    
+      linux-x86_64-gpu
+      
+        
+          linux
+          amd64
+        
+        
+          javacpp.platform.extension
+          -gpu
+        
+      
+    
+    
+      linux-arm64
+      
+        
+          linux
+          aarch64
+        
+        
+          !javacpp.platform.extension
+        
+      
+    
+    
+      macosx
+      
+        mac os x
+      
+      
+        darwin
+        macosx
+      
+    
+    
+      macosx-x86_64
+      
+        
+          mac os x
+          x86_64
+        
+      
+    
+    
+      macosx-arm64
+      
+        
+          mac os x
+          aarch64
+        
+      
+    
+    
+      windowsos
+      
+        windows
+      
+      
+        windows
+        windows
+      
+    
+    
+      windows-x86_64
+      
+        
+          windows
+          x86_64
+        
+      
+    
+    
+      arm
+      
+        arm
+      
+      
+        armhf
+      
+    
+    
+      aarch64
+      
+        aarch64
+      
+      
+        arm64
+      
+    
+    
+      armv8
+      
+        armv8
+      
+      
+        arm64
+      
+    
+    
+      amd64
+      
+        amd64
+      
+      
+        x86_64
+      
+    
+    
+      x86-64
+      
+        x86-64
+      
+      
+        x86_64
+      
+    
+
+    
+      linux
+      
+        
+          unix
+          Linux
+        
+      
+      
+        linux
+      
+    
+    
+      darwin
+      
+        
+          unix
+          Mac OS X
+        
+      
+      
+        darwin
+      
+    
+    
+      windows
+      
+        
+          windows
+        
+      
+      
+        windows
+      
+    
   
 
   
@@ -297,17 +477,46 @@
     
       SIG JVM
       TensorFlow
-      http://www.tensorflow.org
+      https://www.tensorflow.org
     
   
 
   
     
+      
+        org.apache.maven.plugins
+        maven-compiler-plugin
+        3.11.0
+        
+          true 
+        
+      
+      
+        org.apache.maven.plugins
+        maven-enforcer-plugin
+        3.4.1
+        
+          
+            enforce
+            
+              
+                
+                
+                  3.6
+                
+              
+            
+            
+              enforce
+            
+          
+        
+      
       
       
         org.apache.maven.plugins
         maven-gpg-plugin
-        1.6
+        3.1.0
         
           
             sign-artifacts
@@ -326,7 +535,7 @@
       
       
         maven-source-plugin
-        3.2.1
+        3.3.0
         
           
             attach-sources
@@ -338,16 +547,38 @@
       
       
         maven-javadoc-plugin
-        3.2.0
+        3.12.0
+      
+          ./docs/overview.md
+          
+          Copyright 2015, 2025 The TensorFlow Authors. All Rights Reserved.
+          
+              -Xmaxerrs
+              65536
+              -Xmaxwarns
+              65536
+          
+          false
+          256m
+          2048m
+          
+              https://tensorflow.github.io/java/javadoc-ndarray/v1.0.0/
+              https://protobuf.dev/reference/java/api-docs
+              https://bytedeco.org/javacpp/apidocs
+          
+      
         
+            
+                javadoc-site
+                
+                    javadoc
+                
+            
           
             attach-javadocs
             
               jar
             
-            
-              true
-            
           
         
       
@@ -366,13 +597,12 @@
         spotless-maven-plugin
         ${spotless.version}
         
-
           origin/master
-
           
           
-            
-
+            
+              1.20.0
+            
             
           
         
@@ -383,7 +613,18 @@
         
           org.apache.maven.plugins
           maven-jar-plugin
-          3.2.0
+          3.3.0
+        
+        
+          org.apache.maven.plugins
+          maven-surefire-plugin
+          3.1.2
+          
+            
+              **/*Test.java
+            
+            false
+          
         
       
     
diff --git a/release.sh b/release.sh
index 6b48e303d9a..acd1041d766 100755
--- a/release.sh
+++ b/release.sh
@@ -15,7 +15,7 @@
 # ==============================================================================
 #
 # Script to upload release artifacts for the TensorFlow Java library to
-# Maven Central. See RELEASE.md for an explanation.
+# Maven Central. See RELEASE.md for explanation.
 
 cd $(dirname "$0")
 STAGING_SEQ="$1"
@@ -34,19 +34,29 @@ fi
 # To get a shell to poke around the maven artifacts with.
 if [[ -z "${CMD}" ]]
 then
-  CMD="bash deploy.sh"
+  CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=orgtensorflow-${STAGING_SEQ}"
 fi
 
 export GPG_TTY=$(tty)
 set -ex
 
+if [[ ! -f settings.xml ]]
+then
+  cp -f ~/.m2/settings.xml .
+fi
+
 docker run \
-  -e IN_CONTAINER="true" \
-  -e STAGING_SEQ="${STAGING_SEQ}" \
   -e GPG_TTY="${GPG_TTY}" \
   -v ${PWD}:/tensorflow-java \
   -v ${HOME}/.gnupg:/root/.gnupg \
   -w /tensorflow-java \
   -it \
-  maven:3.6.3-jdk-8  \
+  --platform linux/amd64 \
+  maven:3.8.6-jdk-11  \
   ${CMD}
+
+echo
+echo "Uploaded to the staging repository"
+echo "After validating the release: "
+echo "* Login to https://oss.sonatype.org/#stagingRepositories"
+echo "* Find the 'org.tensorflow' staging release and click either 'Release' to release or 'Drop' to abort"
diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml
index 6f61fc92e83..03c548a4111 100644
--- a/tensorflow-core/pom.xml
+++ b/tensorflow-core/pom.xml
@@ -22,7 +22,7 @@
   
     org.tensorflow
     tensorflow-java
-    0.4.0-SNAPSHOT
+    1.2.0-SNAPSHOT
   
   tensorflow-core
   pom
@@ -31,896 +31,47 @@
   Parent POM of TensorFlow core artifacts
 
   
+    tensorflow-core-native
     tensorflow-core-generator
     tensorflow-core-api
   
 
   
-    
-    3.9.2
+    
+    4.28.3
 
     ${javacpp.platform}${javacpp.platform.extension}
-    false       
-    false     
-    false 
     
     ${javacpp.platform}
     linux-armhf
     linux-arm64
-    linux-ppc64le
-    linux-x86
     linux-x86_64
+    macosx-arm64
     macosx-x86_64
-    windows-x86
     windows-x86_64
     linux-armhf${javacpp.platform.extension}
     linux-arm64${javacpp.platform.extension}
-    linux-ppc64le${javacpp.platform.extension}
-    linux-x86${javacpp.platform.extension}
     linux-x86_64${javacpp.platform.extension}
+    macosx-arm64${javacpp.platform.extension}
     macosx-x86_64${javacpp.platform.extension}
-    windows-x86${javacpp.platform.extension}
     windows-x86_64${javacpp.platform.extension}
-    1.5.6
+    1.5.12
   
 
   
-    
-    
-      javacpp-platform-extension-default
-      
-        
-          javacpp.platform.extension
-          !all
-        
-      
-      
-        tensorflow-core-platform${javacpp.platform.extension}
-      
-    
-
-    
     
-      javacpp-platform-extension-all
-      
-        
-          javacpp.platform.extension
-          all
-        
-      
+      
+      deploying
       
         tensorflow-core-platform
-        tensorflow-core-platform-gpu
-        
-        
-        
       
     
-
-    
-      javacpp-platform-default
-      
-        
-          !javacpp.platform
-        
-      
-      
-        ${os.name}-${os.arch}
-      
-    
-
-    
-      javacpp-platform-custom
-      
-        
-          javacpp.platform
-        
-      
-      
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-        ${javacpp.platform}${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp-platform-host
-      
-        
-          javacpp.platform.host
-        
-      
-      
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-        ${os.name}-${os.arch}${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-true
-      
-        
-          javacpp.platform.custom
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-none
-      
-        
-          javacpp.platform.none
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-armhf
-      
-        
-          javacpp.platform
-          linux-armhf
-        
-      
-      
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-arm64
-      
-        
-          javacpp.platform
-          linux-arm64
-        
-      
-      
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-ppc64le
-      
-        
-          javacpp.platform
-          linux-ppc64le
-        
-      
-      
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-x86
-      
-        
-          javacpp.platform
-          linux-x86
-        
-      
-      
-        
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-x86_64
-      
-        
-          javacpp.platform
-          linux-x86_64
-        
-      
-      
-        
-        
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-macosx-x86_64
-      
-        
-          javacpp.platform
-          macosx-x86_64
-        
-      
-      
-        
-        
-        
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-      
-    
-
-    
-      javacpp-platform-windows-x86
-      
-        
-          javacpp.platform
-          windows-x86
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-      
-    
-
-    
-      javacpp-platform-windows-x86_64
-      
-        
-          javacpp.platform
-          windows-x86_64
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-      
-    
-
-    
-    
-      javacpp.platform.linux-armhf-true
-      
-        
-          javacpp.platform.linux-armhf
-        
-      
-      
-        linux-armhf
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-arm64-true
-      
-        
-          javacpp.platform.linux-arm64
-        
-      
-      
-        linux-arm64
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-ppc64le-true
-      
-        
-          javacpp.platform.linux-ppc64le
-        
-      
-      
-        linux-ppc64le
-        linux-ppc64le${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-x86-true
-      
-        
-          javacpp.platform.linux-x86
-        
-      
-      
-        linux-x86
-        linux-x86${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-x86_64-true
-      
-        
-          javacpp.platform.linux-x86_64
-        
-      
-      
-        linux-x86_64
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.macosx-x86_64-true
-      
-        
-          javacpp.platform.macosx-x86_64
-        
-      
-      
-        macosx-x86_64
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.windows-x86-true
-      
-        
-          javacpp.platform.windows-x86
-        
-      
-      
-        windows-x86
-        windows-x86${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.windows-x86_64-true
-      
-        
-          javacpp.platform.windows-x86_64
-        
-      
-      
-        windows-x86_64
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-arm
-      
-        
-          javacpp.platform.host
-        
-        linuxarm
-      
-      
-        linux-armhf
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-armhf
-      
-        
-          javacpp.platform.host
-        
-        linuxarmhf
-      
-      
-        linux-armhf
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-aarch64
-      
-        
-          javacpp.platform.host
-        
-        linuxaarch64
-      
-      
-        linux-arm64
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-armv8
-      
-        
-          javacpp.platform.host
-        
-        linuxarmv8
-      
-      
-        linux-arm64
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-arm64
-      
-        
-          javacpp.platform.host
-        
-        linuxarm64
-      
-      
-        linux-arm64
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-ppc64le
-      
-        
-          javacpp.platform.host
-        
-        linuxppc64le
-      
-      
-        linux-ppc64le
-        linux-ppc64le${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-amd64
-      
-        
-          javacpp.platform.host
-        
-        linuxamd64
-      
-      
-        linux-x86_64
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-x86-64
-      
-        
-          javacpp.platform.host
-        
-        linuxx86-64
-      
-      
-        linux-x86_64
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-x86_64
-      
-        
-          javacpp.platform.host
-        
-        linuxx86_64
-      
-      
-        linux-x86_64
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-amd64
-      
-        
-          javacpp.platform.host
-        
-        mac os xamd64
-      
-      
-        macosx-x86_64
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-x86-64
-      
-        
-          javacpp.platform.host
-        
-        mac os xx86-64
-      
-      
-        macosx-x86_64
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-x86_64
-      
-        
-          javacpp.platform.host
-        
-        mac os xx86_64
-      
-      
-        macosx-x86_64
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-amd64
-      
-        
-          javacpp.platform.host
-        
-        windowsamd64
-      
-      
-        windows-x86_64
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-x86-64
-      
-        
-          javacpp.platform.host
-        
-        windowsx86-64
-      
-      
-        windows-x86_64
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-x86_64
-      
-        
-          javacpp.platform.host
-        
-        windowsx86_64
-      
-      
-        windows-x86_64
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-    
-      linuxos
-      
-        linux
-      
-      
-        linux
-        linux
-      
-    
-    
-      macosx
-      
-        mac os x
-      
-      
-        darwin
-        macosx
-      
-    
-    
-      windowsos
-      
-        windows
-      
-      
-        windows
-        windows
-      
-    
-    
-      arm
-      
-        arm
-      
-      
-        armhf
-      
-    
-    
-      aarch64
-      
-        aarch64
-      
-      
-        arm64
-      
-    
-    
-      armv8
-      
-        armv8
-      
-      
-        arm64
-      
-    
-    
-      i386
-      
-        i386
-      
-      
-        x86
-      
-    
-    
-      i486
-      
-        i486
-      
-      
-        x86
-      
-    
-    
-      i586
-      
-        i586
-      
-      
-        x86
-      
-    
-    
-      i686
-      
-        i686
-      
-      
-        x86
-      
-    
-    
-      amd64
-      
-        amd64
-      
-      
-        x86_64
-      
-    
-    
-      x86-64
-      
-        x86-64
-      
-      
-        x86_64
-      
-    
-
-    
-      linux
-      
-        
-          unix
-          Linux
-        
-      
-      
-        linux
-      
-    
-    
-      darwin
-      
-        
-          unix
-          Mac OS X
-        
-      
-      
-        darwin
-      
-    
-    
-      windows
-      
-        
-          windows
-        
-      
-      
-        windows
-      
-    
   
-
 
-
diff --git a/tensorflow-core/tensorflow-core-api/.bazelrc b/tensorflow-core/tensorflow-core-api/.bazelrc
deleted file mode 100644
index d15d83ee9a2..00000000000
--- a/tensorflow-core/tensorflow-core-api/.bazelrc
+++ /dev/null
@@ -1,648 +0,0 @@
-# TensorFlow Bazel configuration file.
-# This file tries to group and simplify build options for TensorFlow
-#
-# ----CONFIG OPTIONS----
-# Android options:
-#    android:
-#    android_arm:
-#    android_arm64:
-#    android_x86:
-#    android_x86_64:
-#
-# iOS options:
-#     ios:
-#     ios_armv7:
-#     ios_arm64:
-#     ios_i386:
-#     ios_x86_64:
-#     ios_fat:
-#
-# Compiler options:
-#     cuda_clang:             Use clang when building CUDA code.
-#     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.
-#     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;
-#     v1: Build TF V1 (without contrib)
-#     v2: Build TF v2
-#
-# 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).
-#     mkl:          Enable full mkl support.
-#     tensorrt:     Enable Tensorrt support.
-#     ngraph:       Enable ngraph support.
-#     numa:         Enable numa using hwloc.
-#     noaws:        Disable AWS S3 storage support
-#     nogcp:        Disable GCS support.
-#     nohdfs:       Disable hadoop hdfs support.
-#     nonccl:       Disable nccl support.
-#
-#
-# 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_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
-#
-#     rbe_win_py37: Windows Python 3.7 RBE config
-#     rbe_win_py38: Windows Python 3.8 RBE config
-#
-#     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
-# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
-build:android --crosstool_top=//external:android/crosstool
-build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
-build:android_arm --config=android
-build:android_arm --cpu=armeabi-v7a
-build:android_arm --fat_apk_cpu=armeabi-v7a
-build:android_arm64 --config=android
-build:android_arm64 --cpu=arm64-v8a
-build:android_arm64 --fat_apk_cpu=arm64-v8a
-build:android_x86 --config=android
-build:android_x86 --cpu=x86
-build:android_x86 --fat_apk_cpu=x86
-build:android_x86_64 --config=android
-build:android_x86_64 --cpu=x86_64
-build:android_x86_64 --fat_apk_cpu=x86_64
-
-# Sets the default Apple platform to macOS.
-build --apple_platform_type=macos
-
-# iOS configs for each architecture and the fat binary builds.
-build:ios --apple_platform_type=ios
-build:ios --apple_bitcode=embedded --copt=-fembed-bitcode
-build:ios --copt=-Wno-c++11-narrowing
-build:ios_armv7 --config=ios
-build:ios_armv7 --cpu=ios_armv7
-build:ios_arm64 --config=ios
-build:ios_arm64 --cpu=ios_arm64
-build:ios_i386 --config=ios
-build:ios_i386 --cpu=ios_i386
-build:ios_x86_64 --config=ios
-build:ios_x86_64 --cpu=ios_x86_64
-build:ios_fat --config=ios
-build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64
-
-# Config to use a mostly-static build and disable modular op registration
-# support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python).
-# By default, TensorFlow will build with a dependence on
-# //tensorflow:libtensorflow_framework.so.
-build:monolithic --define framework_shared_object=false
-
-# For projects which use TensorFlow as part of a Bazel build process, putting
-# nothing in a bazelrc will default to a monolithic build. The following line
-# opts in to modular op registration support by default.
-build --define framework_shared_object=true
-
-# Flags for open source build, always set to be true.
-build --define open_source_build=true
-test --define open_source_build=true
-
-# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1
-build --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain
-build --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain
-
-# Please note that MKL on MacOS or windows is still not supported.
-# If you would like to use a local MKL instead of downloading, please set the
-# 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_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
-
-# This config refers to building CUDA op kernels with clang.
-build:cuda_clang --config=using_cuda
-build:cuda_clang --define=using_cuda_clang=true
-build:cuda_clang --define=using_clang=true
-build:cuda_clang --action_env TF_CUDA_CLANG=1
-
-# dbg config, as a shorthand for '--config=opt -c dbg'
-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
-
-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
-
-# Options extracted from configure script
-build:ngraph --define=with_ngraph_support=true
-build:numa --define=with_numa_support=true
-
-# Options to disable default on features
-build:noaws --define=no_aws_support=true
-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
-
-build --spawn_strategy=standalone
-build -c opt
-
-# Make Bazel print out all options from rc files.
-build --announce_rc
-
-# Other build flags.
-build --define=grpc_no_ares=true
-
-# See https://github.com/bazelbuild/bazel/issues/7362 for information on what
-# --incompatible_remove_legacy_whole_archive flag does.
-# This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate
-# Tensorflow to the default, however test coverage wasn't enough to catch the
-# errors.
-# There is ongoing work on Bazel team's side to provide support for transitive
-# shared libraries. As part of migrating to transitive shared libraries, we
-# hope to provide a better mechanism for control over symbol exporting, and
-# then tackle this issue again.
-#
-# TODO: Remove this line once TF doesn't depend on Bazel wrapping all library
-# archives in -whole_archive -no_whole_archive.
-build --noincompatible_remove_legacy_whole_archive
-
-# These are bazel 2.0's incompatible flags. Tensorflow needs to use bazel 2.0.0
-# to use cc_shared_library, as part of the Tensorflow Build Improvements RFC:
-# https://github.com/tensorflow/community/pull/179
-build --noincompatible_prohibit_aapt1
-
-# Modular TF build options
-build:dynamic_kernels --define=dynamic_loaded_kernels=true
-build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS
-
-# Build TF with C++ 17 features.
-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, 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=/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
-build:macos --host_cxxopt=-std=c++14
-build:windows --cxxopt=/std:c++14
-build:windows --host_cxxopt=/std:c++14
-
-# On windows, we still link everything into a single DLL.
-build:windows --config=monolithic
-
-# On linux, we dynamically link small amount of kernels
-build:linux --config=dynamic_kernels
-
-# Make sure to include as little of windows.h as possible
-build:windows --copt=-DWIN32_LEAN_AND_MEAN
-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
-build:windows --linkopt=/OPT:REF
-build:windows --host_linkopt=/OPT:REF
-build:windows --linkopt=/OPT:ICF
-build:windows --host_linkopt=/OPT:ICF
-build:windows --experimental_strict_action_env=true
-
-# Verbose failure logs when something goes wrong
-build:windows --verbose_failures
-
-# On windows, we never cross compile
-build:windows --distinct_host_configuration=false
-
-# Following option reduces considerably the compilation time on Windows with VS16.4+
-build:windows --copt=/d2ReducedOptimizeHugeFunctions
-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
-build:avx2_win --copt=/arch=AVX2
-
-# Options to build TensorFlow 1.x or 2.x.
-build:v1 --define=tf_api_version=1
-build:v2 --define=tf_api_version=2
-build:v1 --action_env=TF2_BEHAVIOR=0
-build:v2 --action_env=TF2_BEHAVIOR=1
-build --config=v2
-test --config=v2
-
-# Enable XLA
-build:xla --define=with_xla_support=true
-
-# BEGIN TF REMOTE BUILD EXECUTION OPTIONS
-# Options when using remote execution
-# WARNING: THESE OPTIONS WONT WORK IF YOU DO NOT HAVE PROPER AUTHENTICATION AND PERMISSIONS
-
-# Flag to enable remote config
-common --experimental_repo_remote_exec
-
-build:rbe --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
-build:rbe --google_default_credentials
-build:rbe --bes_backend=buildeventservice.googleapis.com
-build:rbe --bes_results_url="https://source.cloud.google.com/results/invocations"
-build:rbe --bes_timeout=600s
-build:rbe --define=EXECUTOR=remote
-build:rbe --distinct_host_configuration=false
-build:rbe --flaky_test_attempts=3
-build:rbe --jobs=200
-build:rbe --remote_executor=grpcs://remotebuildexecution.googleapis.com
-build:rbe --remote_timeout=3600
-build:rbe --spawn_strategy=remote,worker,standalone,local
-test:rbe --test_env=USER=anon
-# Attempt to minimize the amount of data transfer between bazel and the remote
-# workers:
-build:rbe --remote_download_toplevel
-
-build:rbe_linux --config=rbe
-build:rbe_linux --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
-build:rbe_linux --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
-build:rbe_linux --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
-build:rbe_linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
-build:rbe_linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
-
-# Non-rbe settings we should include because we do not run configure
-build:rbe_linux --config=xla
-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="@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"
-build:rbe_linux_py2 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py"
-
-build:rbe_linux_py3 --config=rbe_linux
-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/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"
-build:rbe_win --host_platform="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019"
-build:rbe_win --platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019"
-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=100
-
-build:rbe_win_py37 --config=rbe
-build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python"
-build:rbe_win_py37 --python_path=C:\\Python37\\python.exe
-
-build:rbe_win_py38 --config=rbe
-build:rbe_win_py38 --repo_env=PYTHON_BIN_PATH=C:\\Python38\\python.exe
-build:rbe_win_py38 --repo_env=PYTHON_LIB_PATH=C:\\Python38\\lib\\site-packages
-build:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py38
-build:rbe_win_py38 --python_path=C:\\Python38\\python.exe
-
-# These you may need to change for your own GCP project.
-build:tensorflow_testing_rbe --project_id=tensorflow-testing
-common:tensorflow_testing_rbe_linux --remote_instance_name=projects/tensorflow-testing/instances/default_instance
-build:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe
-build:tensorflow_testing_rbe_linux --config=rbe
-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
-
-# Options from ./configure
-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"
-
-# Address sanitizer
-# CC=clang bazel build --config asan
-build:asan --strip=never
-build:asan --copt -fsanitize=address
-build:asan --copt -DADDRESS_SANITIZER
-build:asan --copt -g
-build:asan --copt -O3
-build:asan --copt -fno-omit-frame-pointer
-build:asan --linkopt -fsanitize=address
-
-# Memory sanitizer
-# CC=clang bazel build --config msan
-build:msan --strip=never
-build:msan --copt -fsanitize=memory
-build:msan --copt -DADDRESS_SANITIZER
-build:msan --copt -g
-build:msan --copt -O3
-build:msan --copt -fno-omit-frame-pointer
-build:msan --linkopt -fsanitize=memory
-
-# Undefined Behavior Sanitizer
-# CC=clang bazel build --config ubsan
-build:ubsan --strip=never
-build:ubsan --copt -fsanitize=undefined
-build:ubsan --copt -g
-build:ubsan --copt -O3
-build:ubsan --copt -fno-omit-frame-pointer
-build:ubsan --linkopt -fsanitize=undefined
-build:ubsan --linkopt -lubsan
diff --git a/tensorflow-core/tensorflow-core-api/.bazelversion b/tensorflow-core/tensorflow-core-api/.bazelversion
deleted file mode 100644
index 0b2eb36f508..00000000000
--- a/tensorflow-core/tensorflow-core-api/.bazelversion
+++ /dev/null
@@ -1 +0,0 @@
-3.7.2
diff --git a/tensorflow-core/tensorflow-core-api/BUILD b/tensorflow-core/tensorflow-core-api/BUILD
deleted file mode 100644
index efb865db308..00000000000
--- a/tensorflow-core/tensorflow-core-api/BUILD
+++ /dev/null
@@ -1,73 +0,0 @@
-load("@org_tensorflow//tensorflow:tensorflow.bzl", "tf_copts", "tf_cc_binary")
-load("@rules_java//java:defs.bzl", "java_proto_library")
-
-tf_cc_binary(
-    name = "java_op_exporter",
-    linkopts = select({
-        "@org_tensorflow//tensorflow:windows": [],
-        "//conditions:default": ["-lm"],
-    }),
-    deps = [
-        ":java_op_export_lib",
-    ],
-)
-
-cc_library(
-    name = "java_op_export_lib",
-    srcs = [
-        "src/bazel/op_generator/op_export_main.cc",
-    ],
-    hdrs = [
-    ],
-    copts = tf_copts(),
-    deps = [
-        "@org_tensorflow//tensorflow/core:framework",
-        "@org_tensorflow//tensorflow/core:lib",
-        "@org_tensorflow//tensorflow/core:op_gen_lib",
-        "@org_tensorflow//tensorflow/core:protos_all_cc",
-    ],
-)
-
-filegroup(
-    name = "java_api_def",
-    srcs = glob(["src/bazel/api_def/*"])
-)
-
-tf_cc_binary(
-    name = "java_api_import",
-    srcs = [
-        "src/bazel/api_def/import/api_import.cc",
-    ],
-    linkopts = select({
-        "@org_tensorflow//tensorflow:windows": [],
-        "//conditions:default": ["-lm"],
-    }),
-    deps = [
-        "@org_tensorflow//tensorflow/core:op_gen_lib",
-        "@org_tensorflow//tensorflow/tools/api/lib:api_objects_proto_cc",
-    ],
-)
-
-java_proto_library(
-    name = "java_proto_gen_sources",
-    deps = ["@org_tensorflow//tensorflow/core:protos_all"]
-)
-
-filegroup(
-    name = "custom_ops_test",
-    srcs = select({
-        # FIXME(karllessard) Disable custom ops test on Windows since TF is still monolithic on this platform
-        "@org_tensorflow//tensorflow:windows": [],
-        "//conditions:default": [":libcustom_ops_test.so"],
-    })
-)
-
-tf_cc_binary(
-	name = "libcustom_ops_test.so",
-	srcs = ["src/bazel/test/my_test_op.cc"],
-	linkshared = 1,
-	linkopts = ["-lm"],
-	deps = [
-		"@org_tensorflow//tensorflow/core:framework",
-	]
-)
diff --git a/tensorflow-core/tensorflow-core-api/WORKSPACE b/tensorflow-core/tensorflow-core-api/WORKSPACE
deleted file mode 100644
index f6aa07115ed..00000000000
--- a/tensorflow-core/tensorflow-core-api/WORKSPACE
+++ /dev/null
@@ -1,50 +0,0 @@
-workspace(name = "tensorflow_core_api")
-
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-# TensorFlow archive
-# Note: Make sure to synchronize Maven dependencies inherited from TensorFlow binaries when updating
-# the version of this archive (e.g. google protobuf)
-http_archive(
-    name = "org_tensorflow",
-    patches = [
-        ":tensorflow-visibility.patch",
-#        ":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/refs/tags/v2.6.0.tar.gz",
-    ],
-    sha256 = "41b32eeaddcbc02b0583660bcf508469550e4cd0f86b22d2abe72dfebeacde0f",
-    strip_prefix = "tensorflow-2.6.0"
-)
-
-# START: Upstream TensorFlow dependencies
-# TensorFlow build depends on these dependencies.
-# Needs to be in-sync with TensorFlow sources.
-load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")
-
-tf_workspace3()
-
-load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")
-
-tf_workspace2()
-
-load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")
-
-tf_workspace1()
-
-load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
-
-tf_workspace0()
-# END: Upstream TensorFlow dependencies
-
-load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
-grpc_deps()
-
-load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
-bazel_version_repository(name = "bazel_version")
diff --git a/tensorflow-core/tensorflow-core-api/build.sh b/tensorflow-core/tensorflow-core-api/build.sh
deleted file mode 100755
index fdddaafa18b..00000000000
--- a/tensorflow-core/tensorflow-core-api/build.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-# Script to build native TensorFlow libraries
-set -eu
-
-# Allows us to use ccache with Bazel on Mac
-export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
-
-export BAZEL_VC="${VCINSTALLDIR:-}"
-if [[ -d $BAZEL_VC ]]; then
-    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` --linkopt=-lstdc++ --host_linkopt=-lstdc++"
-    export PYTHON_BIN_PATH=$(which python3)
-fi
-
-if [[ "${EXTENSION:-}" == *mkl* ]]; then
-    export BUILD_FLAGS="$BUILD_FLAGS --config=mkl"
-fi
-
-if [[ "${EXTENSION:-}" == *gpu* ]]; then
-    export BUILD_FLAGS="$BUILD_FLAGS --config=cuda"
-    export TF_CUDA_COMPUTE_CAPABILITIES="${TF_CUDA_COMPUTE_CAPABILITIES:-"sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"}"
-    if [[ -z ${TF_CUDA_PATHS:-} ]] && [[ -d ${CUDA_PATH:-} ]]; then
-        # Work around some issue with Bazel preventing it from detecting CUDA on Windows
-        export TF_CUDA_PATHS="$CUDA_PATH"
-    fi
-fi
-
-BUILD_FLAGS="$BUILD_FLAGS --experimental_repo_remote_exec --python_path="$PYTHON_BIN_PATH" --output_filter=DONT_MATCH_ANYTHING --verbose_failures"
-
-# Always allow distinct host configuration since we rely on the host JVM for a few things (this was disabled by default on windows)
-BUILD_FLAGS="$BUILD_FLAGS --distinct_host_configuration=true"
-
-# Build C/C++ API of TensorFlow itself including a target to generate ops for Java
-bazel build $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \
-    @org_tensorflow//tensorflow:tensorflow_cc \
-    @org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate \
-    :java_proto_gen_sources \
-    :java_op_exporter \
-    :java_api_import \
-    :custom_ops_test
-
-export BAZEL_SRCS=$(pwd -P)/bazel-tensorflow-core-api
-export BAZEL_BIN=$(pwd -P)/bazel-bin
-export TENSORFLOW_BIN=$BAZEL_BIN/external/org_tensorflow/tensorflow
-
-# Normalize some paths with symbolic links
-TENSORFLOW_SO=($TENSORFLOW_BIN/libtensorflow_cc.so.?.?.?)
-if [[ -f $TENSORFLOW_SO ]]; then
-    export TENSORFLOW_LIB=$TENSORFLOW_SO
-    ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow_cc.so
-    ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow_cc.so.2
-fi
-TENSORFLOW_DYLIB=($TENSORFLOW_BIN/libtensorflow_cc.?.?.?.dylib)
-if [[ -f $TENSORFLOW_DYLIB ]]; then
-    export TENSORFLOW_LIB=$TENSORFLOW_DYLIB
-    ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow_cc.dylib
-    ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow_cc.2.dylib
-fi
-TENSORFLOW_DLLS=($TENSORFLOW_BIN/tensorflow_cc.dll.if.lib $TENSORFLOW_BIN/libtensorflow_cc.dll.ifso)
-for TENSORFLOW_DLL in ${TENSORFLOW_DLLS[@]}; do
-    if [[ -f $TENSORFLOW_DLL ]]; then
-        export TENSORFLOW_LIB=$TENSORFLOW_BIN/tensorflow_cc.dll
-        ln -sf $(basename $TENSORFLOW_DLL) $TENSORFLOW_BIN/tensorflow_cc.lib
-    fi
-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 ' ')
-   echo $UGLYPATH
-   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
-
-GEN_RESOURCE_DIR=src/gen/resources
-mkdir -p $GEN_RESOURCE_DIR
-
-if [[ -z "${SKIP_EXPORT:-}" ]]; then
-  # Export op defs
-  echo "Exporting Ops"
-  $BAZEL_BIN/java_op_exporter \
-      $TENSORFLOW_LIB \
-      $GEN_RESOURCE_DIR/ops.pb \
-      $GEN_RESOURCE_DIR/ops.pbtxt \
-      $BAZEL_SRCS/external/org_tensorflow/tensorflow/core/api_def/base_api \
-      src/bazel/api_def
-else
-  echo "Skipping Op export"
-fi
-
-
-# Copy generated Java protos from source jars
-
-cd $GEN_SRCS_DIR
-find $TENSORFLOW_BIN/core -name \*-speed-src.jar -exec jar xf {} \;
-rm -rf META-INF
diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch
deleted file mode 100644
index c83456e8408..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-macosx.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-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
deleted file mode 100644
index 7823514e4bc..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-diff -ruN tensorflow-2.6.0/tensorflow/core/protobuf/bfc_memory_map.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/bfc_memory_map.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/bfc_memory_map.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/bfc_memory_map.proto	2021-08-30 11:22:48.263351451 +0900
-@@ -3,6 +3,9 @@
- package tensorflow;
- 
- 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 tensorflow-2.6.0/tensorflow/core/protobuf/snapshot.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/snapshot.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/snapshot.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/snapshot.proto	2021-08-30 11:22:48.264351453 +0900
-@@ -8,6 +8,10 @@
- 
- option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
- 
-+option java_outer_classname = "SnapshotProtos";
-+option java_multiple_files = true;
-+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 tensorflow-2.6.0/tensorflow/core/protobuf/device_properties.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/device_properties.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/device_properties.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/device_properties.proto	2021-08-30 11:22:48.264351453 +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/protobuf/for_core_protos_go_proto";
- 
- message DeviceProperties {
-diff -ruN tensorflow-2.6.0/tensorflow/core/protobuf/saved_object_graph.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/saved_object_graph.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/saved_object_graph.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/saved_object_graph.proto	2021-08-30 11:22:48.265351456 +0900
-@@ -11,6 +11,9 @@
- 
- option cc_enable_arenas = true;
- 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 tensorflow-2.6.0/tensorflow/core/protobuf/struct.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/struct.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/struct.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/struct.proto	2021-08-30 11:22:48.265351456 +0900
-@@ -7,6 +7,9 @@
- import "tensorflow/core/framework/types.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 tensorflow-2.6.0/tensorflow/core/protobuf/trackable_object_graph.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/trackable_object_graph.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/trackable_object_graph.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/trackable_object_graph.proto	2021-08-30 11:22:48.266351458 +0900
-@@ -4,6 +4,9 @@
- 
- option cc_enable_arenas = true;
- 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 tensorflow-2.6.0/tensorflow/core/protobuf/transport_options.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/transport_options.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/transport_options.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/transport_options.proto	2021-08-30 11:22:48.266351458 +0900
-@@ -3,6 +3,7 @@
- package tensorflow;
- 
- 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 tensorflow-2.6.0/tensorflow/core/lib/core/error_codes.proto tensorflow-2.6.0-proto/tensorflow/core/lib/core/error_codes.proto
---- tensorflow-2.6.0/tensorflow/core/lib/core/error_codes.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/lib/core/error_codes.proto	2021-08-30 11:22:48.267351461 +0900
-@@ -1,3 +1,5 @@
- syntax = "proto3";
- 
-+option java_package = "org.tensorflow.framework";
-+
- import public "tensorflow/core/protobuf/error_codes.proto";
-diff -ruN tensorflow-2.6.0/tensorflow/core/profiler/protobuf/xplane.proto tensorflow-2.6.0-proto/tensorflow/core/profiler/protobuf/xplane.proto
---- tensorflow-2.6.0/tensorflow/core/profiler/protobuf/xplane.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/profiler/protobuf/xplane.proto	2021-08-30 11:22:48.267351461 +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: 5
-diff -ruN tensorflow-2.6.0/tensorflow/core/util/memmapped_file_system.proto tensorflow-2.6.0-proto/tensorflow/core/util/memmapped_file_system.proto
---- tensorflow-2.6.0/tensorflow/core/util/memmapped_file_system.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/util/memmapped_file_system.proto	2021-08-30 11:22:48.268351463 +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 -ruN tensorflow-2.6.0/tensorflow/core/profiler/profiler_options.proto tensorflow-2.6.0-proto/tensorflow/core/profiler/profiler_options.proto
---- tensorflow-2.6.0/tensorflow/core/profiler/profiler_options.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/profiler/profiler_options.proto	2021-08-30 11:22:48.268351463 +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 {
-diff -ruN tensorflow-2.6.0/tensorflow/core/protobuf/service_config.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/service_config.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/service_config.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/service_config.proto	2021-08-30 11:22:48.269351466 +0900
-@@ -1,6 +1,7 @@
- syntax = "proto3";
- 
- package tensorflow.data.experimental;
-+option java_package = "org.tensorflow.data.experimental";
- 
- option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
- 
-diff -ruN tensorflow-2.6.0/tensorflow/core/framework/dataset_options.proto tensorflow-2.6.0-proto/tensorflow/core/framework/dataset_options.proto
---- tensorflow-2.6.0/tensorflow/core/framework/dataset_options.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/framework/dataset_options.proto	2021-08-30 11:22:48.269351466 +0900
-@@ -4,6 +4,10 @@
- 
- option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/dataset_options_go_proto";
- 
-+option java_outer_classname = "DatasetOptionsProtos";
-+option java_multiple_files = true;
-+option java_package = "org.tensorflow.data";
-+
- // Represents the type of auto-sharding we enable.
- enum AutoShardPolicy {
-   // AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
-diff -ruN tensorflow-2.6.0/tensorflow/core/framework/model.proto tensorflow-2.6.0-proto/tensorflow/core/framework/model.proto
---- tensorflow-2.6.0/tensorflow/core/framework/model.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/framework/model.proto	2021-08-30 11:23:28.579451037 +0900
-@@ -3,6 +3,9 @@
- package tensorflow.data.model;
- 
- option cc_enable_arenas = true;
-+option java_outer_classname = "ModelProtos";
-+option java_multiple_files = true;
-+option java_package = "org.tensorflow.data.model";
- option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/model_go_proto";
- 
- // Class of a node in the performance model.
-diff -ruN tensorflow-2.6.0/tensorflow/core/grappler/costs/op_performance_data.proto tensorflow-2.6.0-proto/tensorflow/core/grappler/costs/op_performance_data.proto
---- tensorflow-2.6.0/tensorflow/core/grappler/costs/op_performance_data.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/grappler/costs/op_performance_data.proto	2021-08-30 11:22:48.270351468 +0900
-@@ -17,6 +17,9 @@
- 
- package tensorflow;
- option cc_enable_arenas = true;
-+option java_outer_classname = "OpPerformanceDataProtos";
-+option java_multiple_files = true;
-+option java_package = "org.tensorflow.framework";
- 
- import "tensorflow/core/framework/tensor.proto";
- import "tensorflow/core/framework/tensor_shape.proto";
-diff -ruN tensorflow-2.6.0/tensorflow/core/protobuf/composite_tensor_variant.proto tensorflow-2.6.0-proto/tensorflow/core/protobuf/composite_tensor_variant.proto
---- tensorflow-2.6.0/tensorflow/core/protobuf/composite_tensor_variant.proto	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-proto/tensorflow/core/protobuf/composite_tensor_variant.proto	2021-08-30 15:43:37.086090343 +0900
-@@ -3,7 +3,7 @@
- package tensorflow;
- 
- import "tensorflow/core/protobuf/struct.proto";
--
-+option java_package = "org.tensorflow.framework";
- option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
- 
- // Metadata for CompositeTensorVariant, used when serializing as Variant.
diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch
deleted file mode 100644
index f4394ad2f4c..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-visibility.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -ruN tensorflow-2.6.0/tensorflow/BUILD tensorflow-2.6.0-visibility/tensorflow/BUILD
---- tensorflow-2.6.0/tensorflow/BUILD	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-visibility/tensorflow/BUILD	2021-08-30 11:18:31.089781754 +0900
-@@ -37,7 +37,7 @@
- )
- load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
- 
--package(default_visibility = [":internal"])
-+package(default_visibility = ["//visibility:public"])
- 
- licenses(["notice"])
- 
-diff -ruN tensorflow-2.6.0/tensorflow/core/api_def/BUILD tensorflow-2.6.0-visibility/tensorflow/core/api_def/BUILD
---- tensorflow-2.6.0/tensorflow/core/api_def/BUILD	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-visibility/tensorflow/core/api_def/BUILD	2021-08-30 11:17:56.392705484 +0900
-@@ -29,7 +29,7 @@
- alias(
-     name = "base_api_def",
-     actual = "//tensorflow/core/api_def/base_api:base_api_def",
--    visibility = ["//tensorflow:internal"],
-+    visibility = ["//visibility:public"],
- )
- 
- alias(
-diff -ruN tensorflow-2.6.0/tensorflow/tools/api/lib/BUILD tensorflow-2.6.0-visibility/tensorflow/tools/api/lib/BUILD
---- tensorflow-2.6.0/tensorflow/tools/api/lib/BUILD	2021-08-10 04:10:27.000000000 +0900
-+++ tensorflow-2.6.0-visibility/tensorflow/tools/api/lib/BUILD	2021-08-30 11:17:56.392705484 +0900
-@@ -16,6 +16,7 @@
- tf_proto_library(
-     name = "api_objects_proto",
-     srcs = ["api_objects.proto"],
-+    visibility = ["//visibility:public"],
- )
- 
- py_library(
diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-windows.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-windows.patch
deleted file mode 100644
index be8622810aa..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-windows.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff --git a/third_party/mkl/BUILD b/third_party/mkl/BUILD
-index aa65b585b85..4e6546eac34 100644
---- a/third_party/mkl/BUILD
-+++ b/third_party/mkl/BUILD
-@@ -91,10 +91,23 @@ cc_library(
-     visibility = ["//visibility:public"],
- )
- 
-+cc_import(
-+    name = "iomp5",
-+    interface_library = "lib/libiomp5md.lib",
-+    system_provided = 1,
-+)
-+
-+cc_import(
-+    name = "mklml",
-+    interface_library = "lib/mklml.lib",
-+    system_provided = 1,
-+)
-+
- cc_library(
-     name = "mkl_libs_windows",
--    srcs = [
--        "@llvm_openmp//:libiomp5md.dll",
-+    deps = [
-+        "iomp5",
-+        "mklml"
-     ],
-     visibility = ["//visibility:public"],
- )
-diff --git a/third_party/llvm_openmp/BUILD b/third_party/llvm_openmp/BUILD
-index 099a84dcbaa..f7f9d44118f 100644
---- a/third_party/llvm_openmp/BUILD
-+++ b/third_party/llvm_openmp/BUILD
-@@ -71,7 +71,7 @@ omp_vars_linux = {
-
- # Windows Cmake vars to expand.
- omp_vars_win = {
--    "MSVC": 1,
-+    "MSVC": 0,
- }
-
- omp_all_cmake_vars = select({
- 
diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml
index 9f23757e83d..a4cd84dcf20 100644
--- a/tensorflow-core/tensorflow-core-api/pom.xml
+++ b/tensorflow-core/tensorflow-core-api/pom.xml
@@ -6,46 +6,37 @@
   
     org.tensorflow
     tensorflow-core
-    0.4.0-SNAPSHOT
+    1.2.0-SNAPSHOT
   
   tensorflow-core-api
   jar
 
-  TensorFlow Core API Library
+  TensorFlow API
   Platform-dependent native code and pure-Java code for the TensorFlow machine intelligence library.
 
   
-    false
-    ${native.build.skip}
-    ${native.build.skip}
-    ${native.build.skip}
-    org.tensorflow.core.api
-    0.3.3
-    1.0.1
+    1.1.5
+    false
+    ${project.build.directory}/tf-text-download/
   
 
   
     
-      org.bytedeco
-      javacpp
-      ${javacpp.version}
-    
-    
-      org.bytedeco
-      javacpp
-      ${javacpp.version}
-      ${javacpp.platform}
-      test
+      org.tensorflow
+      tensorflow-ndarray
+      ${project.version}
     
     
-      com.google.protobuf
-      protobuf-java
-      ${protobuf.version}
+      org.tensorflow
+      tensorflow-core-native
+      ${project.version}
     
     
       org.tensorflow
-      ndarray
-      ${ndarray.version}
+      tensorflow-core-native
+      ${project.version}
+      ${native.classifier}
+      test
     
     
       org.junit.jupiter
@@ -76,44 +67,114 @@
   
 
   
-    
     
-      dev
-      
-        
-          org.tensorflow
-          tensorflow-core-api
-          ${project.version}
-          ${native.classifier}
-        
-      
-      
-        true
-      
-    
-    
-    
-      deploying
-      
-        true
-        true
-      
+      
+      generating
+      
+        
+          
+            org.codehaus.mojo
+            exec-maven-plugin
+            3.1.0
+            
+              
+                
+                generate-ops
+                
+                  java
+                
+                generate-sources
+                
+                  false
+                  true
+                  org.tensorflow.generator.op.OpGenerator
+                  
+                    -a
+                    ${project.basedir}/src/api
+                    -o
+                    ${project.basedir}/src/gen/java
+                    -c
+                  
+                
+              
+            
+            
+              
+                org.tensorflow
+                tensorflow-core-generator
+                ${project.version}
+              
+            
+          
+
+          
+            maven-compiler-plugin
+            3.11.0
+            
+              
+                
+                default-compile
+                
+                  
+                    org.tensorflow.generator.op.processor.OperatorProcessor
+                  
+                  
+                    
+                      org.tensorflow
+                      tensorflow-core-generator
+                      ${project.version}
+                    
+                  
+                  
+                  ${project.basedir}/src/gen/annotations
+                
+              
+            
+          
+
+          
+            maven-clean-plugin
+            3.3.2
+            
+              
+                
+                generated-sources-clean
+                clean
+                
+                  clean
+                
+                
+                  
+                    
+                      src/gen
+                    
+                  
+                
+              
+            
+          
+        
+      
     
   
 
@@ -122,14 +183,14 @@
       
         org.codehaus.mojo
         build-helper-maven-plugin
-        3.0.0
+        3.4.0
         
-          
           
+            
             add-gen-sources
             generate-sources
             
@@ -138,350 +199,55 @@
             
               
                 ${project.basedir}/src/gen/java
+                ${project.basedir}/src/gen/annotations
               
             
           
         
       
+
       
-        maven-compiler-plugin
-        3.8.0
-        
-          
-          
-            default-compile
-            
-              
-                org.tensorflow.processor.operator.OperatorProcessor
-              
-              
-                
-                  org.tensorflow
-                  tensorflow-core-generator
-                  ${project.version}
-                
-              
-              
-              ${project.basedir}/src/gen/annotations
-            
-          
-          
-          
-            javacpp-parser
-            generate-sources
-            
-              compile
-            
-            
-              
-                org/tensorflow/internal/c_api/presets/*.java
-              
-            
-          
-        
-      
-      
-        org.bytedeco
-        javacpp
-        ${javacpp.version}
-        
-          ${javacpp.platform.properties}
-          
-            
-              platform.root
-              ${javacpp.platform.root}
-            
-            
-              platform.compiler
-              ${javacpp.platform.compiler}
-            
-            
-              platform.extension
-              ${javacpp.platform.extension}
-            
-          
-          ${project.build.outputDirectory}
-          
-            ${project.basedir}/
-            ${project.basedir}/bazel-${project.artifactId}/external/org_tensorflow/
-          
-          
-            ${project.basedir}/bazel-bin/external/llvm_openmp/
-            ${project.basedir}/bazel-bin/external/org_tensorflow/tensorflow/
-          
-          
-            ${project.basedir}/../../
-            ${project.basedir}/bazel-bin/external/org_tensorflow/tensorflow/tools/lib_package/
-          
-          
-            ${project.basedir}/bazel-${project.artifactId}/external/mkl_linux/lib/
-            ${project.basedir}/bazel-${project.artifactId}/external/mkl_darwin/lib/
-            ${project.basedir}/bazel-${project.artifactId}/external/mkl_windows/lib/
-          
-        
+        maven-source-plugin
+        3.3.0
         
           
-            
-            javacpp-validate
-            validate
-            
-              build
-            
-          
-          
-            
-            javacpp-build
-            initialize
-            
-              build
-            
-            
-              ${javacpp.build.skip}
-              
-                bash
-                ${project.basedir}/build.sh
-              
-              
-                ${javacpp.platform.extension}
-                ${native.build.flags}
-              
-              ${project.basedir}
-            
-          
-          
-            
-            javacpp-clean
-            clean
-            
-              build
-            
-            
-              ${javacpp.build.skip}
-              
-                bazel
-                clean
-              
-              ${project.basedir}
-            
-          
-          
-            
-            javacpp-parser
-            generate-sources
-            
-              parse
-            
-            
-              ${javacpp.parser.skip}
-              ${project.basedir}/src/gen/java
-              org.tensorflow.internal.c_api.presets.*
-            
-          
-          
-            
-            javacpp-compiler
-            process-classes
+            attach-sources
             
-              build
+              jar-no-fork
             
-            
-              ${project.build.directory}/native/org/tensorflow/internal/c_api/${native.classifier}/
-              ${javacpp.compiler.skip}
-              org.tensorflow.internal.c_api.**
-              true
-              true
-            
           
         
-        
-          
-            com.google.protobuf
-            protobuf-java
-            ${protobuf.version}
-          
-        
       
+
       
-        
         org.codehaus.mojo
         exec-maven-plugin
-        3.0.0
-        
-          
-            generate-ops
-            
-              java
-            
-            generate-sources
-          
-        
-        
-          
-            org.tensorflow
-            tensorflow-core-generator
-            ${project.version}
-          
-        
-        
-          false
-          true
-          org.tensorflow.op.generator.OpGenerator
-          
-            ${project.basedir}/src/gen/java
-            ${project.basedir}/src/gen/resources/ops.pb
-          
-        
-      
-      
-        maven-jar-plugin
         3.1.0
-        
-          
-            
-              ${java.module.name}
-            
-          
-        
-        
-          
-            
-            native-jar
-            package
-            
-              jar
-            
-            
-              ${native.classifier}
-              true
-              
-                
-                org/tensorflow/internal/c_api/${native.classifier}/
-              
-              ${project.build.directory}/native
-              
-                org/tensorflow/internal/c_api/${native.classifier}/*.exp
-                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}/*msvcr120*
-              
-            
-          
-        
-      
-      
-        maven-surefire-plugin
-        3.0.0-M5
         
           
             
-            default-test
-            integration-test
-            
-              test
-            
-          
-        
-        
-          
-          
-          
-            ${project.build.directory}/${project.artifactId}-${project.version}-${native.classifier}.jar
-            
-            ${project.build.directory}/native/
-          
-        
-      
-      
-        maven-source-plugin
-        3.2.1
-        
-          
-            attach-sources
-            leave-disabled-to-not-generate-sources-twice-on-release
-          
-          
-            attach-source
+            dist-download
+            test-compile
             
-              jar-no-fork
-            
-          
-        
-      
-      
-        maven-javadoc-plugin
-        3.2.0
-        
-          
-            attach-javadocs
-            
-              jar
+              exec
             
             
-              false
-              256m
-              2048m
-              
-                http://bytedeco.org/javacpp/apidocs
-              
+              ${test.download.skip}
+              bash
+              
+                scripts/test_download.sh
+                ${test.download.folder}
+              
+              
+                ${native.classifier}
+              
+              ${project.basedir}
             
           
         
       
-      
-        maven-assembly-plugin
-        3.2.0
-        
-          
-            jar-with-dependencies
-          
-        
-      
     
   
 
diff --git a/tensorflow-core/tensorflow-core-api/scripts/test_download.sh b/tensorflow-core/tensorflow-core-api/scripts/test_download.sh
new file mode 100755
index 00000000000..509468bade2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/scripts/test_download.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+
+DOWNLOAD_FOLDER="$1"
+
+case ${PLATFORM:-} in
+  'linux-x86_64')
+    TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/c3/e6/cfd784298ffb759a4235721cac2ac20f7ff758bf687069cfbaebb06c5804/tensorflow_text-2.20.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl'
+    ;;
+  'linux-arm64')
+    TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/f5/ca/796cfd97ae6693d3c84c37575a6d481be5f1ef36c920d1a73c884f31797b/tensorflow_text-2.20.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl'
+    ;;
+  'macosx-arm64')
+    TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/98/e4/e3c72d0a73caeba90cf5b31e69d44e9a08d614e0e829484d813f3b63e037/tensorflow_text-2.20.0-cp312-cp312-macosx_11_0_arm64.whl'
+    ;;
+  *)
+    echo "TensorFlow Text distribution for ${PLATFORM} is not supported for download"
+    exit 0;
+esac
+
+mkdir -p "$DOWNLOAD_FOLDER"
+cd "$DOWNLOAD_FOLDER"
+
+if [[ -n "$TEXT_WHEEL_URL" ]]; then
+  echo "Downloading $TEXT_WHEEL_URL"
+  if [ ! -f 'tensorflow-text.whl' ]; then
+    curl -L $TEXT_WHEEL_URL --output 'tensorflow-text.whl'
+  fi
+  yes | unzip -q -u 'tensorflow-text.whl' # use 'yes' because for some reasons -u does not work on Windows
+fi
+
+ls -l .
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Abort.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Abort.pbtxt
new file mode 100644
index 00000000000..7d90f6d9fc7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Abort.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Abort"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Abs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Abs.pbtxt
new file mode 100644
index 00000000000..5ae7934e3cf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Abs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Abs"
+  endpoint {
+    name: "math.Abs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulateNV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulateNV2.pbtxt
new file mode 100644
index 00000000000..ae2d6e0c7fd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulateNV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AccumulateNV2"
+  endpoint {
+    name: "math.AccumulateN"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorApplyGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorApplyGradient.pbtxt
new file mode 100644
index 00000000000..ecf18bfde4d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorApplyGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AccumulatorApplyGradient"
+  endpoint {
+    name: "train.AccumulatorApplyGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorNumAccumulated.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorNumAccumulated.pbtxt
new file mode 100644
index 00000000000..c9f5db313ee
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorNumAccumulated.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AccumulatorNumAccumulated"
+  endpoint {
+    name: "train.AccumulatorNumAccumulated"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorSetGlobalStep.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorSetGlobalStep.pbtxt
new file mode 100644
index 00000000000..53dbca3a28a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorSetGlobalStep.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AccumulatorSetGlobalStep"
+  endpoint {
+    name: "train.AccumulatorSetGlobalStep"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorTakeGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorTakeGradient.pbtxt
new file mode 100644
index 00000000000..d8482bfef55
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AccumulatorTakeGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AccumulatorTakeGradient"
+  endpoint {
+    name: "train.AccumulatorTakeGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Acos.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Acos.pbtxt
new file mode 100644
index 00000000000..d730005b322
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Acos.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Acos"
+  endpoint {
+    name: "math.Acos"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Acosh.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Acosh.pbtxt
new file mode 100644
index 00000000000..7f880491eae
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Acosh.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Acosh"
+  endpoint {
+    name: "math.Acosh"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Add.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Add.pbtxt
new file mode 100644
index 00000000000..b213eb8dd32
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Add.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Add"
+  endpoint {
+    name: "math.Add"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AddManySparseToTensorsMap.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddManySparseToTensorsMap.pbtxt
new file mode 100644
index 00000000000..8dcebf4c82b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddManySparseToTensorsMap.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AddManySparseToTensorsMap"
+  endpoint {
+    name: "sparse.AddManySparseToTensorsMap"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AddN.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddN.pbtxt
new file mode 100644
index 00000000000..8807e161276
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddN.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AddN"
+  endpoint {
+    name: "math.AddN"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AddSparseToTensorsMap.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddSparseToTensorsMap.pbtxt
new file mode 100644
index 00000000000..d46dc06cd51
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddSparseToTensorsMap.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AddSparseToTensorsMap"
+  endpoint {
+    name: "sparse.AddSparseToTensorsMap"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AddV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AddV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AddV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AddV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AdjustContrast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustContrast.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AdjustContrast.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustContrast.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustContrastv2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustContrastv2.pbtxt
new file mode 100644
index 00000000000..bbf539a05de
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustContrastv2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AdjustContrastv2"
+  endpoint {
+    name: "image.AdjustContrast"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustHue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustHue.pbtxt
new file mode 100644
index 00000000000..9cfca205fb5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustHue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AdjustHue"
+  endpoint {
+    name: "image.AdjustHue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustSaturation.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustSaturation.pbtxt
new file mode 100644
index 00000000000..679b1d48ab9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AdjustSaturation.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AdjustSaturation"
+  endpoint {
+    name: "image.AdjustSaturation"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_All.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_All.pbtxt
new file mode 100644
index 00000000000..89ab8929419
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_All.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "All"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AllCandidateSampler.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AllCandidateSampler.pbtxt
new file mode 100644
index 00000000000..2a260b630af
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AllCandidateSampler.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AllCandidateSampler"
+  endpoint {
+    name: "random.AllCandidateSampler"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AllToAll.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AllToAll.pbtxt
new file mode 100644
index 00000000000..1ce77f7d74a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AllToAll.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AllToAll"
+  endpoint {
+    name: "tpu.AllToAll"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Angle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Angle.pbtxt
new file mode 100644
index 00000000000..fd3770221f8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Angle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Angle"
+  endpoint {
+    name: "math.Angle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousHashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousHashTable.pbtxt
new file mode 100644
index 00000000000..5b60d123270
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousHashTable.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousHashTable"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AnonymousIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIterator.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AnonymousIterator.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIterator.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV2.pbtxt
new file mode 100644
index 00000000000..71b6959cf2d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "AnonymousIteratorV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV3.pbtxt
new file mode 100644
index 00000000000..0f12f6f369c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousIteratorV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "AnonymousIteratorV3"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.AnonymousIterator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMemoryCache.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMemoryCache.pbtxt
new file mode 100644
index 00000000000..fcde7026956
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMemoryCache.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousMemoryCache"
+  endpoint {
+    name: "data.AnonymousMemoryCache"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIterator.pbtxt
new file mode 100644
index 00000000000..f7b39a05c9c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIterator.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "AnonymousMultiDeviceIterator"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIteratorV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIteratorV3.pbtxt
new file mode 100644
index 00000000000..08238a57e52
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMultiDeviceIteratorV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "AnonymousMultiDeviceIteratorV3"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.AnonymousMultiDeviceIterator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableDenseHashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableDenseHashTable.pbtxt
new file mode 100644
index 00000000000..fe75322c561
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableDenseHashTable.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousMutableDenseHashTable"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTable.pbtxt
new file mode 100644
index 00000000000..69f531da488
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTable.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousMutableHashTable"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTableOfTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTableOfTensors.pbtxt
new file mode 100644
index 00000000000..409abc6f6d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousMutableHashTableOfTensors.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousMutableHashTableOfTensors"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousRandomSeedGenerator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousRandomSeedGenerator.pbtxt
new file mode 100644
index 00000000000..4c3c3cd98a6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousRandomSeedGenerator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousRandomSeedGenerator"
+  endpoint {
+    name: "random.AnonymousRandomSeedGenerator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousSeedGenerator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousSeedGenerator.pbtxt
new file mode 100644
index 00000000000..cf4c8f4f339
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AnonymousSeedGenerator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AnonymousSeedGenerator"
+  endpoint {
+    name: "random.AnonymousSeedGenerator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Any.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Any.pbtxt
new file mode 100644
index 00000000000..c96baa7525d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Any.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Any"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdaMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdaMax.pbtxt
new file mode 100644
index 00000000000..b552249c876
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdaMax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdaMax"
+  endpoint {
+    name: "train.ApplyAdaMax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdadelta.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdadelta.pbtxt
new file mode 100644
index 00000000000..e16875bc976
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdadelta.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdadelta"
+  endpoint {
+    name: "train.ApplyAdadelta"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagrad.pbtxt
new file mode 100644
index 00000000000..3de2b67d1b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdagrad"
+  endpoint {
+    name: "train.ApplyAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradDA.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradDA.pbtxt
new file mode 100644
index 00000000000..e51c4bd8155
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradDA.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdagradDA"
+  endpoint {
+    name: "train.ApplyAdagradDa"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradV2.pbtxt
new file mode 100644
index 00000000000..cfa90ac82c2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdagradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdagradV2"
+  endpoint {
+    name: "train.ApplyAdagradV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdam.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdam.pbtxt
new file mode 100644
index 00000000000..85ff2d1bad3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAdam.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAdam"
+  endpoint {
+    name: "train.ApplyAdam"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAddSign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAddSign.pbtxt
new file mode 100644
index 00000000000..21a5f40a078
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyAddSign.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyAddSign"
+  endpoint {
+    name: "train.ApplyAddSign"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyCenteredRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyCenteredRMSProp.pbtxt
new file mode 100644
index 00000000000..ec1b6380779
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyCenteredRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyCenteredRMSProp"
+  endpoint {
+    name: "train.ApplyCenteredRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ApplyFtrl.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyFtrl.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ApplyFtrl.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyFtrl.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyFtrlV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyFtrlV2.pbtxt
new file mode 100644
index 00000000000..08a86347aef
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyFtrlV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyFtrlV2"
+  endpoint {
+    name: "train.ApplyFtrl"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyGradientDescent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyGradientDescent.pbtxt
new file mode 100644
index 00000000000..335095ef520
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyGradientDescent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyGradientDescent"
+  endpoint {
+    name: "train.ApplyGradientDescent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyMomentum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyMomentum.pbtxt
new file mode 100644
index 00000000000..4a7079316b4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyMomentum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyMomentum"
+  endpoint {
+    name: "train.ApplyMomentum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyPowerSign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyPowerSign.pbtxt
new file mode 100644
index 00000000000..0a816803266
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyPowerSign.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyPowerSign"
+  endpoint {
+    name: "train.ApplyPowerSign"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalAdagrad.pbtxt
new file mode 100644
index 00000000000..774d00e707c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalAdagrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyProximalAdagrad"
+  endpoint {
+    name: "train.ApplyProximalAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalGradientDescent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalGradientDescent.pbtxt
new file mode 100644
index 00000000000..3458df77763
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyProximalGradientDescent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyProximalGradientDescent"
+  endpoint {
+    name: "train.ApplyProximalGradientDescent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyRMSProp.pbtxt
new file mode 100644
index 00000000000..259b5512e16
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApplyRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApplyRMSProp"
+  endpoint {
+    name: "train.ApplyRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproxTopK.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproxTopK.pbtxt
new file mode 100644
index 00000000000..51b0cc7c01f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproxTopK.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApproxTopK"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproximateEqual.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproximateEqual.pbtxt
new file mode 100644
index 00000000000..d392987d60a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ApproximateEqual.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ApproximateEqual"
+  endpoint {
+    name: "math.ApproximateEqual"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMax.pbtxt
new file mode 100644
index 00000000000..5627186359b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ArgMax"
+  endpoint {
+    name: "math.ArgMax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMin.pbtxt
new file mode 100644
index 00000000000..e01e5f2e72b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ArgMin.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ArgMin"
+  endpoint {
+    name: "math.ArgMin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AsString.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AsString.pbtxt
new file mode 100644
index 00000000000..a020c7aef85
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AsString.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AsString"
+  endpoint {
+    name: "dtypes.AsString"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Asin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Asin.pbtxt
new file mode 100644
index 00000000000..7b71c08eede
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Asin.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Asin"
+  endpoint {
+    name: "math.Asin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Asinh.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Asinh.pbtxt
new file mode 100644
index 00000000000..2a371a10071
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Asinh.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Asinh"
+  endpoint {
+    name: "math.Asinh"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Assert.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Assert.pbtxt
new file mode 100644
index 00000000000..44d1ce33dd7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Assert.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Assert"
+  endpoint {
+    name: "AssertThat"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AssertCardinalityDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertCardinalityDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AssertCardinalityDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AssertCardinalityDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AssertNextDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertNextDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AssertNextDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AssertNextDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertPrevDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertPrevDataset.pbtxt
new file mode 100644
index 00000000000..246fdd58a4a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssertPrevDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssertPrevDataset"
+  endpoint {
+    name: "data.AssertPrevDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Assign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Assign.pbtxt
new file mode 100644
index 00000000000..51c43e54d2e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Assign.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Assign"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAdd.pbtxt
new file mode 100644
index 00000000000..9f29218e945
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAddVariableOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAddVariableOp.pbtxt
new file mode 100644
index 00000000000..f724f706878
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignAddVariableOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignAddVariableOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSub.pbtxt
new file mode 100644
index 00000000000..a492c335154
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSubVariableOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSubVariableOp.pbtxt
new file mode 100644
index 00000000000..768f4c47169
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignSubVariableOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignSubVariableOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableOp.pbtxt
new file mode 100644
index 00000000000..9e61072ca68
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignVariableOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableXlaConcatND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableXlaConcatND.pbtxt
new file mode 100644
index 00000000000..9bf3d7734a6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AssignVariableXlaConcatND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AssignVariableXlaConcatND"
+  endpoint {
+    name: "xla.AssignVariableConcatND"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan.pbtxt
new file mode 100644
index 00000000000..bb00076b52d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Atan"
+  endpoint {
+    name: "math.Atan"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan2.pbtxt
new file mode 100644
index 00000000000..f313a44b032
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atan2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Atan2"
+  endpoint {
+    name: "math.Atan2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Atanh.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atanh.pbtxt
new file mode 100644
index 00000000000..59e98471ce1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Atanh.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Atanh"
+  endpoint {
+    name: "math.Atanh"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSpectrogram.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSpectrogram.pbtxt
new file mode 100644
index 00000000000..8731927d50c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSpectrogram.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AudioSpectrogram"
+  endpoint {
+    name: "audio.AudioSpectrogram"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AudioSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSummary.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AudioSummary.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSummary.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSummaryV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSummaryV2.pbtxt
new file mode 100644
index 00000000000..954dbf9bb50
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AudioSummaryV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AudioSummaryV2"
+  endpoint {
+    name: "summary.AudioSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AutoShardDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AutoShardDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_AutoShardDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_AutoShardDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool.pbtxt
new file mode 100644
index 00000000000..970557d9c96
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AvgPool"
+  endpoint {
+    name: "nn.AvgPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3D.pbtxt
new file mode 100644
index 00000000000..be8667cf31c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AvgPool3D"
+  endpoint {
+    name: "nn.AvgPool3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3DGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3DGrad.pbtxt
new file mode 100644
index 00000000000..6bc2df28667
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPool3DGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AvgPool3DGrad"
+  endpoint {
+    name: "nn.AvgPool3dGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPoolGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPoolGrad.pbtxt
new file mode 100644
index 00000000000..097ba7213f1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_AvgPoolGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "AvgPoolGrad"
+  endpoint {
+    name: "nn.AvgPoolGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BandedTriangularSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BandedTriangularSolve.pbtxt
new file mode 100644
index 00000000000..9cf217624c6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BandedTriangularSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BandedTriangularSolve"
+  endpoint {
+    name: "linalg.BandedTriangularSolve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Barrier.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Barrier.pbtxt
new file mode 100644
index 00000000000..7aada11ec00
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Barrier.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Barrier"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierClose.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierClose.pbtxt
new file mode 100644
index 00000000000..75d923401c4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierClose.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BarrierClose"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierIncompleteSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierIncompleteSize.pbtxt
new file mode 100644
index 00000000000..53729fe5652
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierIncompleteSize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BarrierIncompleteSize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierInsertMany.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierInsertMany.pbtxt
new file mode 100644
index 00000000000..163cfbeae5b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierInsertMany.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BarrierInsertMany"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierReadySize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierReadySize.pbtxt
new file mode 100644
index 00000000000..f648bb15560
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierReadySize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BarrierReadySize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierTakeMany.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierTakeMany.pbtxt
new file mode 100644
index 00000000000..5c6508a6963
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BarrierTakeMany.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BarrierTakeMany"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Batch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Batch.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Batch.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Batch.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholesky.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholesky.pbtxt
new file mode 100644
index 00000000000..c1cdb6b892e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholesky.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchCholesky"
+  endpoint {
+    name: "linalg.BatchCholesky"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholeskyGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholeskyGrad.pbtxt
new file mode 100644
index 00000000000..c8e9b4060e7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchCholeskyGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchCholeskyGrad"
+  endpoint {
+    name: "linalg.BatchCholeskyGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT.pbtxt
new file mode 100644
index 00000000000..cf02316b08c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchFFT"
+  endpoint {
+    name: "signal.BatchFft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT2D.pbtxt
new file mode 100644
index 00000000000..4b09c73a82b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchFFT2D"
+  endpoint {
+    name: "signal.BatchFft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT3D.pbtxt
new file mode 100644
index 00000000000..0b4cdfac071
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchFFT3D"
+  endpoint {
+    name: "signal.BatchFft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFunction.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFunction.pbtxt
new file mode 100644
index 00000000000..2160e9f7b8a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchFunction.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchFunction"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT.pbtxt
new file mode 100644
index 00000000000..491d21ad4c4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchIFFT"
+  endpoint {
+    name: "signal.BatchIfft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT2D.pbtxt
new file mode 100644
index 00000000000..61a773b3f76
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchIFFT2D"
+  endpoint {
+    name: "signal.BatchIfft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT3D.pbtxt
new file mode 100644
index 00000000000..6111f4c6006
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchIFFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchIFFT3D"
+  endpoint {
+    name: "signal.BatchIfft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchMatMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMul.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchMatMul.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMul.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchMatMulV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchMatMulV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV3.pbtxt
new file mode 100644
index 00000000000..8a70e8e6e55
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatMulV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatMulV3"
+  endpoint {
+    name: "train.BatchMatMul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixBandPart.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixBandPart.pbtxt
new file mode 100644
index 00000000000..af80b346df8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixBandPart.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixBandPart"
+  endpoint {
+    name: "linalg.BatchMatrixBandPart"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDeterminant.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDeterminant.pbtxt
new file mode 100644
index 00000000000..ac3c9b2a5ec
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDeterminant.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixDeterminant"
+  endpoint {
+    name: "linalg.BatchMatrixDeterminant"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiag.pbtxt
new file mode 100644
index 00000000000..c30ccfb3e28
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiag.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixDiag"
+  endpoint {
+    name: "linalg.BatchMatrixDiag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiagPart.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiagPart.pbtxt
new file mode 100644
index 00000000000..cf215430e8e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixDiagPart.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixDiagPart"
+  endpoint {
+    name: "linalg.BatchMatrixDiagPart"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixInverse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixInverse.pbtxt
new file mode 100644
index 00000000000..113f9e268d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixInverse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixInverse"
+  endpoint {
+    name: "linalg.BatchMatrixInverse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSetDiag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSetDiag.pbtxt
new file mode 100644
index 00000000000..4d402f61466
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSetDiag.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixSetDiag"
+  endpoint {
+    name: "linalg.BatchMatrixSetDiag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolve.pbtxt
new file mode 100644
index 00000000000..2b5a9c70205
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixSolve"
+  endpoint {
+    name: "linalg.BatchMatrixSolve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolveLs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolveLs.pbtxt
new file mode 100644
index 00000000000..b95a4b7f1aa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixSolveLs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixSolveLs"
+  endpoint {
+    name: "linalg.BatchMatrixSolveLs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixTriangularSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixTriangularSolve.pbtxt
new file mode 100644
index 00000000000..39f614c58a2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchMatrixTriangularSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchMatrixTriangularSolve"
+  endpoint {
+    name: "linalg.BatchMatrixTriangularSolve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalization.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalization.pbtxt
new file mode 100644
index 00000000000..0b8ed84a609
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalization.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchNormWithGlobalNormalization"
+  endpoint {
+    name: "nn.BatchNormWithGlobalNormalization"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalizationGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalizationGrad.pbtxt
new file mode 100644
index 00000000000..4aa3b421147
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchNormWithGlobalNormalizationGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchNormWithGlobalNormalizationGrad"
+  endpoint {
+    name: "nn.BatchNormWithGlobalNormalizationGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchSelfAdjointEig.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSelfAdjointEig.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BatchSelfAdjointEig.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSelfAdjointEig.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSelfAdjointEigV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSelfAdjointEigV2.pbtxt
new file mode 100644
index 00000000000..4137098cf32
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSelfAdjointEigV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchSelfAdjointEigV2"
+  endpoint {
+    name: "linalg.BatchSelfAdjointEig"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSvd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSvd.pbtxt
new file mode 100644
index 00000000000..73f619b157c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchSvd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchSvd"
+  endpoint {
+    name: "linalg.BatchSvd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpace.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpace.pbtxt
new file mode 100644
index 00000000000..2cd926bf567
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpace.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchToSpace"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpaceND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpaceND.pbtxt
new file mode 100644
index 00000000000..93d4335ac31
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchToSpaceND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BatchToSpaceND"
+  endpoint {
+    name: "BatchToSpaceNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0.pbtxt
new file mode 100644
index 00000000000..88301e94ba7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselI0"
+  endpoint {
+    name: "math.BesselI0"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0e.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0e.pbtxt
new file mode 100644
index 00000000000..f80adf8b7e6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI0e.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselI0e"
+  endpoint {
+    name: "math.BesselI0e"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1.pbtxt
new file mode 100644
index 00000000000..bbba9f7549f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselI1"
+  endpoint {
+    name: "math.BesselI1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1e.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1e.pbtxt
new file mode 100644
index 00000000000..e91b37684b8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselI1e.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselI1e"
+  endpoint {
+    name: "math.BesselI1e"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ0.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ0.pbtxt
new file mode 100644
index 00000000000..1898e526094
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ0.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselJ0"
+  endpoint {
+    name: "math.special.BesselJ0"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ1.pbtxt
new file mode 100644
index 00000000000..cbe95c525cc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselJ1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselJ1"
+  endpoint {
+    name: "math.special.BesselJ1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0.pbtxt
new file mode 100644
index 00000000000..ba380554645
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselK0"
+  endpoint {
+    name: "math.special.BesselK0"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0e.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0e.pbtxt
new file mode 100644
index 00000000000..09659504093
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK0e.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselK0e"
+  endpoint {
+    name: "math.special.BesselK0e"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1.pbtxt
new file mode 100644
index 00000000000..91c3f998864
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselK1"
+  endpoint {
+    name: "math.special.BesselK1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1e.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1e.pbtxt
new file mode 100644
index 00000000000..334c1025b5f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselK1e.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselK1e"
+  endpoint {
+    name: "math.special.BesselK1e"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY0.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY0.pbtxt
new file mode 100644
index 00000000000..a813593994b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY0.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselY0"
+  endpoint {
+    name: "math.special.BesselY0"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY1.pbtxt
new file mode 100644
index 00000000000..cb7a004e1a2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BesselY1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BesselY1"
+  endpoint {
+    name: "math.special.BesselY1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Betainc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Betainc.pbtxt
new file mode 100644
index 00000000000..1931537fa76
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Betainc.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Betainc"
+  endpoint {
+    name: "math.Betainc"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAdd.pbtxt
new file mode 100644
index 00000000000..fa509206f83
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAdd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BiasAdd"
+  endpoint {
+    name: "nn.BiasAdd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAddGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAddGrad.pbtxt
new file mode 100644
index 00000000000..f36f4d41ca5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAddGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BiasAddGrad"
+  endpoint {
+    name: "nn.BiasAddGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BiasAddV1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAddV1.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BiasAddV1.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BiasAddV1.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BigQueryReader.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BigQueryReader.pbtxt
similarity index 80%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BigQueryReader.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BigQueryReader.pbtxt
index 5b6e11687a2..b98f8304793 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BigQueryReader.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BigQueryReader.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "BigQueryReader"
   endpoint {
     name: "io.BigQueryReader"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Bincount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bincount.pbtxt
new file mode 100644
index 00000000000..d16999a510b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bincount.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Bincount"
+  endpoint {
+    name: "math.Bincount"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Bitcast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bitcast.pbtxt
new file mode 100644
index 00000000000..0b55c90620a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bitcast.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Bitcast"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseAnd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseAnd.pbtxt
new file mode 100644
index 00000000000..0b791ac5dda
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseAnd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BitwiseAnd"
+  endpoint {
+    name: "bitwise.BitwiseAnd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseOr.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseOr.pbtxt
new file mode 100644
index 00000000000..45796b0bf30
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseOr.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BitwiseOr"
+  endpoint {
+    name: "bitwise.BitwiseOr"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseXor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseXor.pbtxt
new file mode 100644
index 00000000000..c83fee544c6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BitwiseXor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BitwiseXor"
+  endpoint {
+    name: "bitwise.BitwiseXor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BlockLSTM.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTM.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BlockLSTM.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTM.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BlockLSTMGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMGrad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BlockLSTMGrad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMGrad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMGradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMGradV2.pbtxt
new file mode 100644
index 00000000000..d88c6c62f86
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMGradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BlockLSTMGradV2"
+  endpoint {
+    name: "nn.BlockLSTMGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMV2.pbtxt
new file mode 100644
index 00000000000..f20e824d7dc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BlockLSTMV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BlockLSTMV2"
+  endpoint {
+    name: "nn.BlockLSTM"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesAggregateStats.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesAggregateStats.pbtxt
new file mode 100644
index 00000000000..58978e6b6ba
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesAggregateStats.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesAggregateStats"
+  endpoint {
+    name: "estimator.BoostedTreesAggregateStats"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesBucketize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesBucketize.pbtxt
new file mode 100644
index 00000000000..d55fffeb182
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesBucketize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesBucketize"
+  endpoint {
+    name: "estimator.BoostedTreesBucketize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplit.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplit.pbtxt
new file mode 100644
index 00000000000..43ce3d8a8b8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplit.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCalculateBestFeatureSplit"
+  endpoint {
+    name: "estimator.BoostedTreesCalculateBestFeatureSplit"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplitV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplitV2.pbtxt
new file mode 100644
index 00000000000..d920e9bf6b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestFeatureSplitV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCalculateBestFeatureSplitV2"
+  endpoint {
+    name: "estimator.BoostedTreesCalculateBestFeatureSplitV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestGainsPerFeature.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestGainsPerFeature.pbtxt
new file mode 100644
index 00000000000..cab624efd61
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCalculateBestGainsPerFeature.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCalculateBestGainsPerFeature"
+  endpoint {
+    name: "estimator.BoostedTreesCalculateBestGainsPerFeature"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCenterBias.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCenterBias.pbtxt
new file mode 100644
index 00000000000..055cb5b067d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCenterBias.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCenterBias"
+  endpoint {
+    name: "estimator.BoostedTreesCenterBias"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateEnsemble.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateEnsemble.pbtxt
new file mode 100644
index 00000000000..01e25eb2270
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateEnsemble.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCreateEnsemble"
+  endpoint {
+    name: "estimator.BoostedTreesCreateEnsemble"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt
new file mode 100644
index 00000000000..7105d2a13ca
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesCreateQuantileStreamResource.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesCreateQuantileStreamResource"
+  endpoint {
+    name: "estimator.BoostedTreesCreateQuantileStreamResource"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesDeserializeEnsemble.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesDeserializeEnsemble.pbtxt
new file mode 100644
index 00000000000..7dbb508bad1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesDeserializeEnsemble.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesDeserializeEnsemble"
+  endpoint {
+    name: "estimator.BoostedTreesDeserializeEnsemble"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesEnsembleResourceHandleOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesEnsembleResourceHandleOp.pbtxt
new file mode 100644
index 00000000000..43f0f618a9d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesEnsembleResourceHandleOp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesEnsembleResourceHandleOp"
+  endpoint {
+    name: "estimator.BoostedTreesEnsembleResourceHandleOp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesExampleDebugOutputs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesExampleDebugOutputs.pbtxt
new file mode 100644
index 00000000000..0768f7ea464
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesExampleDebugOutputs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesExampleDebugOutputs"
+  endpoint {
+    name: "estimator.BoostedTreesExampleDebugOutputs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesFlushQuantileSummaries.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesFlushQuantileSummaries.pbtxt
new file mode 100644
index 00000000000..c5949350c42
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesFlushQuantileSummaries.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesFlushQuantileSummaries"
+  endpoint {
+    name: "estimator.BoostedTreesFlushQuantileSummaries"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesGetEnsembleStates.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesGetEnsembleStates.pbtxt
new file mode 100644
index 00000000000..1973e3ce0b6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesGetEnsembleStates.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesGetEnsembleStates"
+  endpoint {
+    name: "estimator.BoostedTreesGetEnsembleStates"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt
new file mode 100644
index 00000000000..f4de8855e9a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeQuantileSummaries.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesMakeQuantileSummaries"
+  endpoint {
+    name: "estimator.BoostedTreesMakeQuantileSummaries"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeStatsSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeStatsSummary.pbtxt
new file mode 100644
index 00000000000..5414e2aae97
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesMakeStatsSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesMakeStatsSummary"
+  endpoint {
+    name: "estimator.BoostedTreesMakeStatsSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesPredict.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesPredict.pbtxt
new file mode 100644
index 00000000000..7c93fcfdfc2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesPredict.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesPredict"
+  endpoint {
+    name: "estimator.BoostedTreesPredict"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt
new file mode 100644
index 00000000000..ab449a57d5c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceAddSummaries.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesQuantileStreamResourceAddSummaries"
+  endpoint {
+    name: "estimator.BoostedTreesQuantileStreamResourceAddSummaries"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceDeserialize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceDeserialize.pbtxt
new file mode 100644
index 00000000000..45103ae088a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceDeserialize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesQuantileStreamResourceDeserialize"
+  endpoint {
+    name: "estimator.BoostedTreesQuantileStreamResourceDeserialize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt
new file mode 100644
index 00000000000..16b68e4ac83
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceFlush.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesQuantileStreamResourceFlush"
+  endpoint {
+    name: "estimator.BoostedTreesQuantileStreamResourceFlush"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt
new file mode 100644
index 00000000000..990abb4effe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceGetBucketBoundaries.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesQuantileStreamResourceGetBucketBoundaries"
+  endpoint {
+    name: "estimator.BoostedTreesQuantileStreamResourceGetBucketBoundaries"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt
new file mode 100644
index 00000000000..12600896ec9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesQuantileStreamResourceHandleOp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesQuantileStreamResourceHandleOp"
+  endpoint {
+    name: "estimator.BoostedTreesQuantileStreamResourceHandleOp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSerializeEnsemble.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSerializeEnsemble.pbtxt
new file mode 100644
index 00000000000..5880c132063
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSerializeEnsemble.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesSerializeEnsemble"
+  endpoint {
+    name: "estimator.BoostedTreesSerializeEnsemble"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseAggregateStats.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseAggregateStats.pbtxt
new file mode 100644
index 00000000000..109f3bae4e2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseAggregateStats.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesSparseAggregateStats"
+  endpoint {
+    name: "estimator.BoostedTreesSparseAggregateStats"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseCalculateBestFeatureSplit.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseCalculateBestFeatureSplit.pbtxt
new file mode 100644
index 00000000000..aae4c225f7e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesSparseCalculateBestFeatureSplit.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesSparseCalculateBestFeatureSplit"
+  endpoint {
+    name: "estimator.BoostedTreesSparseCalculateBestFeatureSplit"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesTrainingPredict.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesTrainingPredict.pbtxt
new file mode 100644
index 00000000000..d4696dc6182
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesTrainingPredict.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesTrainingPredict"
+  endpoint {
+    name: "estimator.BoostedTreesTrainingPredict"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsemble.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsemble.pbtxt
new file mode 100644
index 00000000000..77f30bc409f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsemble.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesUpdateEnsemble"
+  endpoint {
+    name: "estimator.BoostedTreesUpdateEnsemble"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsembleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsembleV2.pbtxt
new file mode 100644
index 00000000000..df4e978b422
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BoostedTreesUpdateEnsembleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "BoostedTreesUpdateEnsembleV2"
+  endpoint {
+    name: "estimator.BoostedTreesUpdateEnsembleV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastArgs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastArgs.pbtxt
new file mode 100644
index 00000000000..ebc44eacd85
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastArgs.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BroadcastArgs"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastGradientArgs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastGradientArgs.pbtxt
new file mode 100644
index 00000000000..6e6f0d1b9b7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastGradientArgs.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BroadcastGradientArgs"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastTo.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastTo.pbtxt
new file mode 100644
index 00000000000..c5b07af0a18
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BroadcastTo.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "BroadcastTo"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Bucketize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bucketize.pbtxt
new file mode 100644
index 00000000000..a600ac3634d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Bucketize.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Bucketize"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BytesProducedStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BytesProducedStatsDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_BytesProducedStatsDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_BytesProducedStatsDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixComponents.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixComponents.pbtxt
new file mode 100644
index 00000000000..24b7e34e16b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixComponents.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CSRSparseMatrixComponents"
+  endpoint {
+    name: "linalg.sparse.CSRSparseMatrixComponents"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToDense.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToDense.pbtxt
new file mode 100644
index 00000000000..62baeff7b47
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToDense.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CSRSparseMatrixToDense"
+  endpoint {
+    name: "linalg.sparse.CSRSparseMatrixToDense"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToSparseTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToSparseTensor.pbtxt
new file mode 100644
index 00000000000..6be3fd9219b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSRSparseMatrixToSparseTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CSRSparseMatrixToSparseTensor"
+  endpoint {
+    name: "linalg.sparse.CSRSparseMatrixToSparseTensor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CSVDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CSVDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCBeamSearchDecoder.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCBeamSearchDecoder.pbtxt
new file mode 100644
index 00000000000..113d683f6be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCBeamSearchDecoder.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CTCBeamSearchDecoder"
+  endpoint {
+    name: "nn.CtcBeamSearchDecoder"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCGreedyDecoder.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCGreedyDecoder.pbtxt
new file mode 100644
index 00000000000..f82f1789f23
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCGreedyDecoder.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CTCGreedyDecoder"
+  endpoint {
+    name: "nn.CtcGreedyDecoder"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLoss.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLoss.pbtxt
new file mode 100644
index 00000000000..0c4d2f7843a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLoss.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CTCLoss"
+  endpoint {
+    name: "nn.CtcLoss"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLossV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLossV2.pbtxt
new file mode 100644
index 00000000000..4ea107e1445
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CTCLossV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CTCLossV2"
+  endpoint {
+    name: "nn.CTCLossV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CacheDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CacheDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CacheDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CacheDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CacheDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Case.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Case.pbtxt
new file mode 100644
index 00000000000..eb371486f04
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Case.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Case"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cast.pbtxt
new file mode 100644
index 00000000000..bd6b1b27204
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cast.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cast"
+  endpoint {
+    name: "dtypes.Cast"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Ceil.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Ceil.pbtxt
new file mode 100644
index 00000000000..41c23c44712
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Ceil.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Ceil"
+  endpoint {
+    name: "math.Ceil"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CheckNumerics.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumerics.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CheckNumerics.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumerics.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumericsV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumericsV2.pbtxt
new file mode 100644
index 00000000000..3085f985715
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumericsV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CheckNumericsV2"
+  endpoint {
+    name: "debugging.CheckNumerics"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt
new file mode 100644
index 00000000000..fff873c9bbf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckPinned.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "CheckPinned"
+  endpoint {
+    name: "CheckPinned"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cholesky.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cholesky.pbtxt
new file mode 100644
index 00000000000..0c1f48317d1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cholesky.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cholesky"
+  endpoint {
+    name: "linalg.Cholesky"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CholeskyGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CholeskyGrad.pbtxt
new file mode 100644
index 00000000000..22e4aa89a6f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CholeskyGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CholeskyGrad"
+  endpoint {
+    name: "linalg.CholeskyGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ChooseFastestBranchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestBranchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ChooseFastestBranchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestBranchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ChooseFastestDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ChooseFastestDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ChooseFastestDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ClipByValue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ClipByValue.pbtxt
new file mode 100644
index 00000000000..b6c8fae964f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ClipByValue.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ClipByValue"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CloseSummaryWriter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CloseSummaryWriter.pbtxt
new file mode 100644
index 00000000000..2d1ca9631d3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CloseSummaryWriter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CloseSummaryWriter"
+  endpoint {
+    name: "summary.CloseSummaryWriter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollateTPUEmbeddingMemory.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollateTPUEmbeddingMemory.pbtxt
new file mode 100644
index 00000000000..7e2b1aef93b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollateTPUEmbeddingMemory.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollateTPUEmbeddingMemory"
+  endpoint {
+    name: "tpu.CollateTPUEmbeddingMemory"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV2.pbtxt
new file mode 100644
index 00000000000..6460f0455c0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveAllToAllV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV3.pbtxt
new file mode 100644
index 00000000000..b2356ee5b36
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAllToAllV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveAllToAllV3"
+  endpoint {
+    name: "collective.CollectiveAllToAll"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAssignGroupV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAssignGroupV2.pbtxt
new file mode 100644
index 00000000000..d414cd66079
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveAssignGroupV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveAssignGroupV2"
+  endpoint {
+    name: "collective.CollectiveAssignGroup"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecv.pbtxt
new file mode 100644
index 00000000000..48feac2efa0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecv.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveBcastRecv"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecvV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecvV2.pbtxt
new file mode 100644
index 00000000000..be74a35b7f9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastRecvV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveBcastRecvV2"
+  endpoint {
+    name: "collective.CollectiveBcastRecv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSend.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSend.pbtxt
new file mode 100644
index 00000000000..3d444c00bf2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSend.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveBcastSend"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSendV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSendV2.pbtxt
new file mode 100644
index 00000000000..1fb22afed54
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveBcastSendV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveBcastSendV2"
+  endpoint {
+    name: "collective.CollectiveBcastSend"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGather.pbtxt
new file mode 100644
index 00000000000..8479efea1a8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGather.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveGather"
+  visibility: SKIP
+}
\ No newline at end of file
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGatherV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGatherV2.pbtxt
new file mode 100644
index 00000000000..d220f2ab11f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveGatherV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveGatherV2"
+  endpoint: {
+    name: "collective.CollectiveGather"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveInitializeCommunicator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveInitializeCommunicator.pbtxt
new file mode 100644
index 00000000000..fba9e620843
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveInitializeCommunicator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveInitializeCommunicator"
+  endpoint {
+    name: "collective.CollectiveInitializeCommunicator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectivePermute.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectivePermute.pbtxt
new file mode 100644
index 00000000000..5fa5a659df4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectivePermute.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectivePermute"
+  endpoint {
+    name: "collective.CollectivePermute"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduce.pbtxt
new file mode 100644
index 00000000000..e810cfb06da
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduce.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveReduce"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceScatterV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceScatterV2.pbtxt
new file mode 100644
index 00000000000..b36c3830ca1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceScatterV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveReduceScatterV2"
+  endpoint {
+    name: "collective.CollectiveReduceScatter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV2.pbtxt
new file mode 100644
index 00000000000..4fe3c35b51e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CollectiveReduceV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV3.pbtxt
new file mode 100644
index 00000000000..3a2779461d2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CollectiveReduceV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CollectiveReduceV3"
+  endpoint {
+    name: "collective.CollectiveReduce"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CombinedNonMaxSuppression.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CombinedNonMaxSuppression.pbtxt
new file mode 100644
index 00000000000..836a46a42b2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CombinedNonMaxSuppression.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CombinedNonMaxSuppression"
+  endpoint {
+    name: "image.CombinedNonMaxSuppression"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CompareAndBitpack.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompareAndBitpack.pbtxt
similarity index 81%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CompareAndBitpack.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CompareAndBitpack.pbtxt
index d744fbbc90f..4e5a5e1a2af 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CompareAndBitpack.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompareAndBitpack.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "CompareAndBitpack"
   endpoint {
     name: "math.CompareAndBitpack"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Complex.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Complex.pbtxt
new file mode 100644
index 00000000000..f649707afb8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Complex.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Complex"
+  endpoint {
+    name: "dtypes.Complex"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComplexAbs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComplexAbs.pbtxt
new file mode 100644
index 00000000000..be6aa59c92e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComplexAbs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ComplexAbs"
+  endpoint {
+    name: "math.ComplexAbs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantFromComponents.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantFromComponents.pbtxt
new file mode 100644
index 00000000000..adb638940d8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantFromComponents.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CompositeTensorVariantFromComponents"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantToComponents.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantToComponents.pbtxt
new file mode 100644
index 00000000000..b34054ead77
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompositeTensorVariantToComponents.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CompositeTensorVariantToComponents"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CompressElement.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompressElement.pbtxt
new file mode 100644
index 00000000000..09a543581d2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CompressElement.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CompressElement"
+  endpoint {
+    name: "data.CompressElement"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeAccidentalHits.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeAccidentalHits.pbtxt
new file mode 100644
index 00000000000..8c4d834016b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeAccidentalHits.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ComputeAccidentalHits"
+  endpoint {
+    name: "nn.ComputeAccidentalHits"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeBatchSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeBatchSize.pbtxt
new file mode 100644
index 00000000000..826f51ac87d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeBatchSize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ComputeBatchSize"
+  endpoint {
+    name: "train.ComputeBatchSize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt
new file mode 100644
index 00000000000..3bedfe49d78
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ComputeDedupDataSize"
+  visibility: SKIP
+  endpoint {
+    name: "tpu.ComputeDedupDataSize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt
new file mode 100644
index 00000000000..af5bdc31f13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSizeV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "ComputeDedupDataSizeV2"
+  endpoint {
+    name: "tpu.ComputeDedupDataSize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt
new file mode 100644
index 00000000000..cb0cd71c3f3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "ComputeDedupDataTupleMask"
+  endpoint {
+    name: "tpu.ComputeDedupDataTupleMask"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt
new file mode 100644
index 00000000000..75e34703b13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMaskV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "ComputeDedupDataTupleMaskV2"
+  endpoint {
+    name: "tpu.ComputeDedupDataTupleMask"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Concat.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Concat.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Concat.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Concat.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatOffset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatOffset.pbtxt
new file mode 100644
index 00000000000..876db502770
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatOffset.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConcatOffset"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatV2.pbtxt
new file mode 100644
index 00000000000..9bf9a9b8648
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConcatV2"
+  endpoint {
+    name: "Concat"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ConcatenateDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatenateDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ConcatenateDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatenateDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConditionalAccumulator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConditionalAccumulator.pbtxt
new file mode 100644
index 00000000000..3e8dd5299a1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConditionalAccumulator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConditionalAccumulator"
+  endpoint {
+    name: "train.ConditionalAccumulator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureAndInitializeGlobalTPU.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureAndInitializeGlobalTPU.pbtxt
new file mode 100644
index 00000000000..5ee6c848dee
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureAndInitializeGlobalTPU.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConfigureAndInitializeGlobalTPU"
+  endpoint {
+    name: "tpu.ConfigureAndInitializeGlobalTPU"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureDistributedTPU.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureDistributedTPU.pbtxt
new file mode 100644
index 00000000000..1dc468d8666
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureDistributedTPU.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConfigureDistributedTPU"
+  endpoint {
+    name: "tpu.ConfigureDistributedTPU"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbedding.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbedding.pbtxt
new file mode 100644
index 00000000000..1cd8caf6d34
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbedding.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConfigureTPUEmbedding"
+  endpoint {
+    name: "tpu.ConfigureTPUEmbedding"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingHost.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingHost.pbtxt
new file mode 100644
index 00000000000..aa4265b80ba
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingHost.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConfigureTPUEmbeddingHost"
+  endpoint {
+    name: "tpu.ConfigureTPUEmbeddingHost"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingMemory.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingMemory.pbtxt
new file mode 100644
index 00000000000..51b142d5c15
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConfigureTPUEmbeddingMemory.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConfigureTPUEmbeddingMemory"
+  endpoint {
+    name: "tpu.ConfigureTPUEmbeddingMemory"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conj.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conj.pbtxt
new file mode 100644
index 00000000000..0fb1ddc5788
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conj.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conj"
+  endpoint {
+    name: "math.Conj"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConjugateTranspose.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConjugateTranspose.pbtxt
new file mode 100644
index 00000000000..42fad3b7ee6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConjugateTranspose.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConjugateTranspose"
+  endpoint {
+    name: "linalg.ConjugateTranspose"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConnectTPUEmbeddingHosts.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConnectTPUEmbeddingHosts.pbtxt
new file mode 100644
index 00000000000..030cd71468e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConnectTPUEmbeddingHosts.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConnectTPUEmbeddingHosts"
+  endpoint {
+    name: "tpu.ConnectTPUEmbeddingHosts"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Const.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Const.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Const.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Const.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConsumeMutexLock.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConsumeMutexLock.pbtxt
new file mode 100644
index 00000000000..78c8099b9ac
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConsumeMutexLock.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ConsumeMutexLock"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ControlTrigger.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ControlTrigger.pbtxt
new file mode 100644
index 00000000000..8dc64a98773
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ControlTrigger.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ControlTrigger"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv.pbtxt
new file mode 100644
index 00000000000..cdc59f52e68
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conv"
+  endpoint {
+    name: "nn.Conv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2D.pbtxt
new file mode 100644
index 00000000000..1752f424f38
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conv2D"
+  endpoint {
+    name: "nn.Conv2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilter.pbtxt
new file mode 100644
index 00000000000..30b696c51d1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "Conv2DBackpropFilter"
+  visibility: VISIBLE
+  endpoint {
+    name: "nn.Conv2dBackpropFilter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilterV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilterV2.pbtxt
new file mode 100644
index 00000000000..83c1d10a28f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropFilterV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "Conv2DBackpropFilterV2"
+  visibility: HIDDEN
+  endpoint {
+    name: "nn.Conv2dBackpropFilterV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInput.pbtxt
new file mode 100644
index 00000000000..9c7eb533cca
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "Conv2DBackpropInput"
+  visibility: VISIBLE
+  endpoint {
+    name: "nn.Conv2dBackpropInput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInputV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInputV2.pbtxt
new file mode 100644
index 00000000000..821f284ad44
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv2DBackpropInputV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "Conv2DBackpropInputV2"
+  visibility: HIDDEN
+  endpoint {
+    name: "nn.Conv2dBackpropInputV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3D.pbtxt
new file mode 100644
index 00000000000..abafc5a703d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conv3D"
+  endpoint {
+    name: "nn.Conv3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Conv3DBackpropFilter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropFilter.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Conv3DBackpropFilter.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropFilter.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropFilterV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropFilterV2.pbtxt
new file mode 100644
index 00000000000..257a0e6f7fe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropFilterV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conv3DBackpropFilterV2"
+  endpoint {
+    name: "nn.Conv3dBackpropFilter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Conv3DBackpropInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropInput.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Conv3DBackpropInput.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropInput.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropInputV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropInputV2.pbtxt
new file mode 100644
index 00000000000..e192e5feedc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Conv3DBackpropInputV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Conv3DBackpropInputV2"
+  endpoint {
+    name: "nn.Conv3dBackpropInput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToCooTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToCooTensor.pbtxt
new file mode 100644
index 00000000000..3047ada98b7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToCooTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ConvertToCooTensor"
+  visibility: VISIBLE
+  endpoint {
+    name: "tpu.ConvertToCooTensor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt
new file mode 100644
index 00000000000..99d2ebea438
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToListOfSparseCoreCooTensors.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ConvertToListOfSparseCoreCooTensors"
+  visibility: VISIBLE
+  endpoint {
+    name: "sparse.ConvertToListOfSparseCoreCooTensors"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt
new file mode 100644
index 00000000000..6b78c0b216c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConvertToSparseCoreCsrWrappedCooTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ConvertToSparseCoreCsrWrappedCooTensor"
+  visibility: VISIBLE
+  endpoint {
+    name: "sparse.ConvertToSparseCoreCsrWrappedCooTensor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Copy.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Copy.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Copy.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Copy.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CopyHost.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyHost.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CopyHost.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CopyHost.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMesh.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMesh.pbtxt
new file mode 100644
index 00000000000..e70bf4ade58
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMesh.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CopyToMesh"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMeshGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMeshGrad.pbtxt
new file mode 100644
index 00000000000..5e3d38dd349
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CopyToMeshGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CopyToMeshGrad"
+  endpoint {
+    name: "CopyToMeshGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cos.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cos.pbtxt
new file mode 100644
index 00000000000..a8006cadd6b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cos.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cos"
+  endpoint {
+    name: "math.Cos"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cosh.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cosh.pbtxt
new file mode 100644
index 00000000000..6f08a1b1862
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cosh.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cosh"
+  endpoint {
+    name: "math.Cosh"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CountUpTo.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CountUpTo.pbtxt
new file mode 100644
index 00000000000..bdc63ba1e04
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CountUpTo.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CountUpTo"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryDbWriter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryDbWriter.pbtxt
new file mode 100644
index 00000000000..0c9840034b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryDbWriter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CreateSummaryDbWriter"
+  endpoint {
+    name: "summary.CreateSummaryDbWriter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryFileWriter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryFileWriter.pbtxt
new file mode 100644
index 00000000000..b85f13b6de4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CreateSummaryFileWriter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CreateSummaryFileWriter"
+  endpoint {
+    name: "summary.CreateSummaryFileWriter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResize.pbtxt
new file mode 100644
index 00000000000..b41932cf5ab
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CropAndResize"
+  endpoint {
+    name: "image.CropAndResize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradBoxes.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradBoxes.pbtxt
new file mode 100644
index 00000000000..8b29c975468
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradBoxes.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CropAndResizeGradBoxes"
+  endpoint {
+    name: "image.CropAndResizeGradBoxes"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradImage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradImage.pbtxt
new file mode 100644
index 00000000000..85607c39878
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CropAndResizeGradImage.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CropAndResizeGradImage"
+  endpoint {
+    name: "image.CropAndResizeGradImage"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cross.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cross.pbtxt
new file mode 100644
index 00000000000..a9717d3bc7d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cross.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cross"
+  endpoint {
+    name: "linalg.Cross"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CrossReplicaSum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CrossReplicaSum.pbtxt
new file mode 100644
index 00000000000..f83642ef04a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CrossReplicaSum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CrossReplicaSum"
+  endpoint {
+    name: "tpu.CrossReplicaSum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNN.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNN.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNN.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNN.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNBackprop.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackprop.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNBackprop.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackprop.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNBackpropV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackpropV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNBackpropV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackpropV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackpropV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackpropV3.pbtxt
new file mode 100644
index 00000000000..eb7800c71df
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNBackpropV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CudnnRNNBackpropV3"
+  endpoint {
+    name: "nn.CudnnRNNBackprop"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNCanonicalToParams.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNCanonicalToParams.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNCanonicalToParams.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNCanonicalToParams.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNCanonicalToParamsV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNCanonicalToParamsV2.pbtxt
new file mode 100644
index 00000000000..99b144ed11c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNCanonicalToParamsV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CudnnRNNCanonicalToParamsV2"
+  endpoint {
+    name: "nn.CudnnRNNCanonicalToParams"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsSize.pbtxt
new file mode 100644
index 00000000000..e0b34db1680
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsSize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CudnnRNNParamsSize"
+  endpoint {
+    name: "nn.CudnnRnnParamsSize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNParamsToCanonical.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsToCanonical.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNParamsToCanonical.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsToCanonical.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsToCanonicalV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsToCanonicalV2.pbtxt
new file mode 100644
index 00000000000..4542b63afcc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNParamsToCanonicalV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CudnnRNNParamsToCanonicalV2"
+  endpoint {
+    name: "nn.CudnnRNNParamsToCanonical"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CudnnRNNV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNV3.pbtxt
new file mode 100644
index 00000000000..0e07477c874
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CudnnRNNV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CudnnRNNV3"
+  endpoint {
+    name: "nn.CudnnRNN"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumprod.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumprod.pbtxt
new file mode 100644
index 00000000000..b49217a6d13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumprod.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cumprod"
+  endpoint {
+    name: "math.Cumprod"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumsum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumsum.pbtxt
new file mode 100644
index 00000000000..30db71c3b58
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Cumsum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Cumsum"
+  endpoint {
+    name: "math.Cumsum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_CumulativeLogsumexp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CumulativeLogsumexp.pbtxt
new file mode 100644
index 00000000000..5e815bd9dab
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CumulativeLogsumexp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "CumulativeLogsumexp"
+  endpoint {
+    name: "math.CumulativeLogsumexp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorRestoreV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorRestoreV2.pbtxt
new file mode 100644
index 00000000000..c494af28b78
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorRestoreV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DTensorRestoreV2"
+  endpoint {
+    name: "tpu.DTensorRestore"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorSetGlobalTPUArray.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorSetGlobalTPUArray.pbtxt
new file mode 100644
index 00000000000..9eb54c892bb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorSetGlobalTPUArray.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DTensorSetGlobalTPUArray"
+  endpoint {
+    name: "tpu.ExecuteTPUEmbeddingPartitioner"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorShardedPrefix.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorShardedPrefix.pbtxt
new file mode 100644
index 00000000000..28a477a0351
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DTensorShardedPrefix.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DTensorShardedPrefix"
+  endpoint {
+    name: "tpu.DTensorShardedPrefix"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatDimMap.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatDimMap.pbtxt
new file mode 100644
index 00000000000..8d1015ddf8a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatDimMap.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DataFormatDimMap"
+  endpoint {
+    name: "nn.DataFormatDimMap"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatVecPermute.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatVecPermute.pbtxt
new file mode 100644
index 00000000000..61766b93905
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataFormatVecPermute.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DataFormatVecPermute"
+  endpoint {
+    name: "nn.DataFormatVecPermute"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DataServiceDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DataServiceDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV2.pbtxt
new file mode 100644
index 00000000000..63f9d0c5aae
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "DataServiceDatasetV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV3.pbtxt
new file mode 100644
index 00000000000..67371f27cbf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV3.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "DataServiceDatasetV3"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV4.pbtxt
new file mode 100644
index 00000000000..4798e5bd703
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DataServiceDatasetV4.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DataServiceDatasetV4"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.DataServiceDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetCardinality.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetCardinality.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetCardinality.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetCardinality.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFingerprint.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFingerprint.pbtxt
new file mode 100644
index 00000000000..61e0086729b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFingerprint.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DatasetFingerprint"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.DatasetFingerprint"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetFromGraph.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFromGraph.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetFromGraph.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetFromGraph.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToGraph.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraph.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToGraph.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraph.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToGraphV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraphV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToGraphV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToGraphV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToSingleElement.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToSingleElement.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToSingleElement.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToSingleElement.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToTFRecord.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToTFRecord.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DatasetToTFRecord.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DatasetToTFRecord.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Dawsn.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dawsn.pbtxt
new file mode 100644
index 00000000000..8cd2717a601
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dawsn.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Dawsn"
+  endpoint {
+    name: "math.special.Dawsn"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugGradientIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientIdentity.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugGradientIdentity.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientIdentity.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugGradientRefIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientRefIdentity.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugGradientRefIdentity.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientRefIdentity.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentity.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugIdentity.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentity.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV2.pbtxt
new file mode 100644
index 00000000000..e9c29efad27
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "DebugIdentityV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV3.pbtxt
new file mode 100644
index 00000000000..ec79f482e44
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentityV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DebugIdentityV3"
+  visibility: HIDDEN
+  endpoint {
+    name: "debugging.DebugIdentity"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNanCount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNanCount.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNanCount.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNanCount.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNumericSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummary.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNumericSummary.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummary.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNumericSummaryV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummaryV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DebugNumericSummaryV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummaryV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeAndCropJpeg.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeAndCropJpeg.pbtxt
new file mode 100644
index 00000000000..13ffab4d225
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeAndCropJpeg.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeAndCropJpeg"
+  endpoint {
+    name: "image.DecodeAndCropJpeg"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBase64.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBase64.pbtxt
new file mode 100644
index 00000000000..6d091e3a52e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBase64.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeBase64"
+  endpoint {
+    name: "io.DecodeBase64"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBmp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBmp.pbtxt
new file mode 100644
index 00000000000..03f5e2d7aa0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeBmp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeBmp"
+  endpoint {
+    name: "image.DecodeBmp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCSV.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCSV.pbtxt
new file mode 100644
index 00000000000..f8c881d807f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCSV.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeCSV"
+  endpoint {
+    name: "io.DecodeCsv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCompressed.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCompressed.pbtxt
new file mode 100644
index 00000000000..e688002e944
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeCompressed.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeCompressed"
+  endpoint {
+    name: "io.DecodeCompressed"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeGif.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeGif.pbtxt
new file mode 100644
index 00000000000..ac36d9bc1f2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeGif.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeGif"
+  endpoint {
+    name: "image.DecodeGif"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeImage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeImage.pbtxt
new file mode 100644
index 00000000000..80516c0e1b1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeImage.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeImage"
+  endpoint {
+    name: "image.DecodeImage"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJSONExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJSONExample.pbtxt
new file mode 100644
index 00000000000..d78f8891a22
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJSONExample.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeJSONExample"
+  endpoint {
+    name: "io.DecodeJsonExample"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJpeg.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJpeg.pbtxt
new file mode 100644
index 00000000000..f1d5b1238d9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeJpeg.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeJpeg"
+  endpoint {
+    name: "image.DecodeJpeg"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePaddedRaw.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePaddedRaw.pbtxt
new file mode 100644
index 00000000000..daaabcd76c4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePaddedRaw.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodePaddedRaw"
+  endpoint {
+    name: "io.DecodePaddedRaw"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePng.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePng.pbtxt
new file mode 100644
index 00000000000..aed9c898a29
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodePng.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodePng"
+  endpoint {
+    name: "image.DecodePng"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeProtoV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeProtoV2.pbtxt
new file mode 100644
index 00000000000..b831161f690
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeProtoV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeProtoV2"
+  endpoint {
+    name: "DecodeProto"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeRaw.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeRaw.pbtxt
new file mode 100644
index 00000000000..d91490cc854
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeRaw.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeRaw"
+  endpoint {
+    name: "io.DecodeRaw"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWav.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWav.pbtxt
new file mode 100644
index 00000000000..f63a147de11
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWav.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DecodeWav"
+  endpoint {
+    name: "audio.DecodeWav"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt
new file mode 100644
index 00000000000..5bd8c3f5508
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DecodeWebP.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "DecodeWebP"
+  endpoint {
+    name: "image.DecodeWebP"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeepCopy.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeepCopy.pbtxt
new file mode 100644
index 00000000000..e55a4c21ffe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeepCopy.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeepCopy"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DeleteIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteIterator.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DeleteIterator.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteIterator.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMemoryCache.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMemoryCache.pbtxt
new file mode 100644
index 00000000000..e9ddbda3ed9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMemoryCache.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeleteMemoryCache"
+  endpoint {
+    name: "data.DeleteMemoryCache"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMultiDeviceIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMultiDeviceIterator.pbtxt
new file mode 100644
index 00000000000..b93b8c3541e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteMultiDeviceIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeleteMultiDeviceIterator"
+  endpoint {
+    name: "data.DeleteMultiDeviceIterator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteRandomSeedGenerator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteRandomSeedGenerator.pbtxt
new file mode 100644
index 00000000000..f1d06eccdbb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteRandomSeedGenerator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeleteRandomSeedGenerator"
+  endpoint {
+    name: "random.DeleteRandomSeedGenerator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSeedGenerator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSeedGenerator.pbtxt
new file mode 100644
index 00000000000..24e5394bf3f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSeedGenerator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeleteSeedGenerator"
+  endpoint {
+    name: "random.DeleteSeedGenerator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSessionTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSessionTensor.pbtxt
new file mode 100644
index 00000000000..a7e2ca5bfed
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteSessionTensor.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeleteSessionTensor"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseBincount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseBincount.pbtxt
new file mode 100644
index 00000000000..38af1580e36
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseBincount.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DenseBincount"
+  endpoint {
+    name: "math.DenseBincount"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseCountSparseOutput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseCountSparseOutput.pbtxt
new file mode 100644
index 00000000000..6496cb1c446
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseCountSparseOutput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DenseCountSparseOutput"
+  endpoint {
+    name: "sparse.DenseCountSparseOutput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToCSRSparseMatrix.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToCSRSparseMatrix.pbtxt
new file mode 100644
index 00000000000..dc7ecd1a204
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToCSRSparseMatrix.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DenseToCSRSparseMatrix"
+  endpoint {
+    name: "linalg.sparse.DenseToCSRSparseMatrix"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToDenseSetOperation.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToDenseSetOperation.pbtxt
new file mode 100644
index 00000000000..8772c2c0e3a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToDenseSetOperation.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DenseToDenseSetOperation"
+  endpoint {
+    name: "sparse.DenseToDenseSetOperation"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DenseToSparseBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseBatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DenseToSparseBatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseBatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseSetOperation.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseSetOperation.pbtxt
new file mode 100644
index 00000000000..80455026338
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DenseToSparseSetOperation.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DenseToSparseSetOperation"
+  endpoint {
+    name: "sparse.DenseToSparseSetOperation"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthToSpace.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthToSpace.pbtxt
new file mode 100644
index 00000000000..da338027869
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthToSpace.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DepthToSpace"
+  endpoint {
+    name: "nn.DepthToSpace"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNative.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNative.pbtxt
new file mode 100644
index 00000000000..eb20bbab725
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNative.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DepthwiseConv2dNative"
+  endpoint {
+    name: "nn.DepthwiseConv2dNative"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropFilter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropFilter.pbtxt
new file mode 100644
index 00000000000..e534f662ea2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropFilter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DepthwiseConv2dNativeBackpropFilter"
+  endpoint {
+    name: "nn.DepthwiseConv2dNativeBackpropFilter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropInput.pbtxt
new file mode 100644
index 00000000000..892160034cd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DepthwiseConv2dNativeBackpropInput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DepthwiseConv2dNativeBackpropInput"
+  endpoint {
+    name: "nn.DepthwiseConv2dNativeBackpropInput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Dequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dequantize.pbtxt
new file mode 100644
index 00000000000..7b32cd14882
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Dequantize"
+  endpoint {
+    name: "quantization.Dequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeIterator.pbtxt
new file mode 100644
index 00000000000..cb296d27127
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeserializeIterator"
+  endpoint {
+    name: "data.DeserializeIterator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeManySparse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeManySparse.pbtxt
new file mode 100644
index 00000000000..b57141ed844
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeManySparse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeserializeManySparse"
+  endpoint {
+    name: "io.DeserializeManySparse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeSparse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeSparse.pbtxt
new file mode 100644
index 00000000000..8b46d1060b8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeserializeSparse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeserializeSparse"
+  endpoint {
+    name: "sparse.DeserializeSparse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyResourceOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyResourceOp.pbtxt
new file mode 100644
index 00000000000..dbdcf2f0cea
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyResourceOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DestroyResourceOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyTemporaryVariable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyTemporaryVariable.pbtxt
new file mode 100644
index 00000000000..e9f167bd1fc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DestroyTemporaryVariable.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DestroyTemporaryVariable"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DeviceIndex.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeviceIndex.pbtxt
new file mode 100644
index 00000000000..de7b5bc2b58
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeviceIndex.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DeviceIndex"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Diag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Diag.pbtxt
new file mode 100644
index 00000000000..de116a55651
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Diag.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Diag"
+  endpoint {
+    name: "linalg.TensorDiag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DiagPart.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DiagPart.pbtxt
new file mode 100644
index 00000000000..b9ef4010d99
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DiagPart.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DiagPart"
+  endpoint {
+    name: "linalg.TensorDiagPart"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Digamma.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Digamma.pbtxt
new file mode 100644
index 00000000000..fafcf4cc8bc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Digamma.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Digamma"
+  endpoint {
+    name: "math.Digamma"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2D.pbtxt
new file mode 100644
index 00000000000..523cf20b08d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Dilation2D"
+  endpoint {
+    name: "nn.Dilation2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropFilter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropFilter.pbtxt
new file mode 100644
index 00000000000..0b7b84c8b5d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropFilter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Dilation2DBackpropFilter"
+  endpoint {
+    name: "nn.Dilation2dBackpropFilter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropInput.pbtxt
new file mode 100644
index 00000000000..c8d15a56c8b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Dilation2DBackpropInput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Dilation2DBackpropInput"
+  endpoint {
+    name: "nn.Dilation2dBackpropInput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DirectedInterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DirectedInterleaveDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DirectedInterleaveDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DirectedInterleaveDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DisableCopyOnRead.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DisableCopyOnRead.pbtxt
new file mode 100644
index 00000000000..4e6dae43607
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DisableCopyOnRead.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DisableCopyOnRead"
+  endpoint {
+    name: "io.DisableCopyOnRead"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DistributedSave.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DistributedSave.pbtxt
new file mode 100644
index 00000000000..74a8b4ddfc1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DistributedSave.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DistributedSave"
+  endpoint {
+    name: "train.DistributedSave"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Div.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Div.pbtxt
new file mode 100644
index 00000000000..70007de3ae0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Div.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Div"
+  endpoint {
+    name: "math.Div"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DivNoNan.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DivNoNan.pbtxt
new file mode 100644
index 00000000000..c8dcc9f80aa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DivNoNan.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DivNoNan"
+  endpoint {
+    name: "math.DivNoNan"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DrawBoundingBoxes.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DrawBoundingBoxes.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_DrawBoundingBoxes.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_DrawBoundingBoxes.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DrawBoundingBoxesV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DrawBoundingBoxesV2.pbtxt
new file mode 100644
index 00000000000..1a1bcc3c284
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DrawBoundingBoxesV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DrawBoundingBoxesV2"
+  endpoint {
+    name: "image.DrawBoundingBoxes"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyIterationCounter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyIterationCounter.pbtxt
new file mode 100644
index 00000000000..837647279de
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyIterationCounter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DummyIterationCounter"
+  endpoint {
+    name: "data.DummyIterationCounter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyMemoryCache.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyMemoryCache.pbtxt
new file mode 100644
index 00000000000..ac86013215f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummyMemoryCache.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DummyMemoryCache"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DummySeedGenerator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummySeedGenerator.pbtxt
new file mode 100644
index 00000000000..3d2cf2618ff
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DummySeedGenerator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DummySeedGenerator"
+  endpoint {
+    name: "random.DummySeedGenerator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt
new file mode 100644
index 00000000000..935786de8fa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DynamicEnqueueTPUEmbeddingArbitraryTensorBatch"
+  endpoint {
+    name: "tpu.DynamicEnqueueTPUEmbeddingArbitraryTensorBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingRaggedTensorBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingRaggedTensorBatch.pbtxt
new file mode 100644
index 00000000000..2f59cca069b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicEnqueueTPUEmbeddingRaggedTensorBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DynamicEnqueueTPUEmbeddingRaggedTensorBatch"
+  endpoint {
+    name: "tpu.DynamicEnqueueTPUEmbeddingRaggedTensorBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicPartition.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicPartition.pbtxt
new file mode 100644
index 00000000000..4550ff6fbbc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicPartition.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DynamicPartition"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicStitch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicStitch.pbtxt
new file mode 100644
index 00000000000..609515974a7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DynamicStitch.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "DynamicStitch"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EagerPyFunc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EagerPyFunc.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EagerPyFunc.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_EagerPyFunc.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EditDistance.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EditDistance.pbtxt
new file mode 100644
index 00000000000..8e6dabb659f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EditDistance.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EditDistance"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Eig.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Eig.pbtxt
new file mode 100644
index 00000000000..fb0d5c4b045
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Eig.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Eig"
+  endpoint {
+    name: "linalg.Eig"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Einsum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Einsum.pbtxt
new file mode 100644
index 00000000000..fbfc95e1380
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Einsum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Einsum"
+  endpoint {
+    name: "linalg.Einsum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Elu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Elu.pbtxt
new file mode 100644
index 00000000000..432d2a70692
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Elu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Elu"
+  endpoint {
+    name: "nn.Elu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EluGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EluGrad.pbtxt
new file mode 100644
index 00000000000..e8722cc7d24
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EluGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EluGrad"
+  endpoint {
+    name: "nn.EluGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Empty.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Empty.pbtxt
new file mode 100644
index 00000000000..e2dfb53ab7b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Empty.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Empty"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorList.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorList.pbtxt
new file mode 100644
index 00000000000..df92f263af1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorList.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EmptyTensorList"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorMap.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorMap.pbtxt
new file mode 100644
index 00000000000..a2141d3fbd3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EmptyTensorMap.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EmptyTensorMap"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeBase64.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeBase64.pbtxt
new file mode 100644
index 00000000000..a060a92104d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeBase64.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodeBase64"
+  endpoint {
+    name: "io.EncodeBase64"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpeg.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpeg.pbtxt
new file mode 100644
index 00000000000..af995121608
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpeg.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodeJpeg"
+  endpoint {
+    name: "image.EncodeJpeg"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpegVariableQuality.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpegVariableQuality.pbtxt
new file mode 100644
index 00000000000..bb8eeba21b3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeJpegVariableQuality.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodeJpegVariableQuality"
+  endpoint {
+    name: "image.EncodeJpegVariableQuality"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodePng.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodePng.pbtxt
new file mode 100644
index 00000000000..b806e4917ff
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodePng.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodePng"
+  endpoint {
+    name: "image.EncodePng"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeProto.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeProto.pbtxt
new file mode 100644
index 00000000000..87b2c6ac4bc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeProto.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodeProto"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeWav.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeWav.pbtxt
new file mode 100644
index 00000000000..96ed73270da
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EncodeWav.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EncodeWav"
+  endpoint {
+    name: "audio.EncodeWav"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EnqueueInQueueDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueInQueueDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_EnqueueInQueueDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueInQueueDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt
new file mode 100644
index 00000000000..7335cf4e1cc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingArbitraryTensorBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingArbitraryTensorBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingArbitraryTensorBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingBatch.pbtxt
new file mode 100644
index 00000000000..a14d72b4a72
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingIntegerBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingIntegerBatch.pbtxt
new file mode 100644
index 00000000000..97b471f0ddd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingIntegerBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingIntegerBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingIntegerBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingRaggedTensorBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingRaggedTensorBatch.pbtxt
new file mode 100644
index 00000000000..d1d250dd27a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingRaggedTensorBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingRaggedTensorBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingRaggedTensorBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseBatch.pbtxt
new file mode 100644
index 00000000000..b346dd636a9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingSparseBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingSparseBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseTensorBatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseTensorBatch.pbtxt
new file mode 100644
index 00000000000..56864f899be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnqueueTPUEmbeddingSparseTensorBatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnqueueTPUEmbeddingSparseTensorBatch"
+  endpoint {
+    name: "tpu.EnqueueTPUEmbeddingSparseTensorBatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EnsureShape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnsureShape.pbtxt
new file mode 100644
index 00000000000..4e7d8ac0a55
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EnsureShape.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EnsureShape"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Enter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Enter.pbtxt
new file mode 100644
index 00000000000..07abdf23784
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Enter.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Enter"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Equal.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Equal.pbtxt
new file mode 100644
index 00000000000..afd1c9fcf85
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Equal.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Equal"
+  endpoint {
+    name: "math.Equal"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Erf.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erf.pbtxt
new file mode 100644
index 00000000000..0f3d2e6dc03
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erf.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Erf"
+  endpoint {
+    name: "math.Erf"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfc.pbtxt
new file mode 100644
index 00000000000..b1da0c02862
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfc.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Erfc"
+  endpoint {
+    name: "math.Erfc"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfinv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfinv.pbtxt
new file mode 100644
index 00000000000..68358ebb137
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Erfinv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Erfinv"
+  endpoint {
+    name: "math.erfinv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_EuclideanNorm.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_EuclideanNorm.pbtxt
new file mode 100644
index 00000000000..f4afae29cd7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_EuclideanNorm.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "EuclideanNorm"
+  endpoint {
+    name: "linalg.EuclideanNorm"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExecuteTPUEmbeddingPartitioner.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExecuteTPUEmbeddingPartitioner.pbtxt
new file mode 100644
index 00000000000..125aeb61d93
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExecuteTPUEmbeddingPartitioner.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExecuteTPUEmbeddingPartitioner"
+  endpoint {
+    name: "tpu.ExecuteTPUEmbeddingPartitioner"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Exit.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Exit.pbtxt
new file mode 100644
index 00000000000..0ca26a5aa7d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Exit.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Exit"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Exp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Exp.pbtxt
new file mode 100644
index 00000000000..7947019a666
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Exp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Exp"
+  endpoint {
+    name: "math.Exp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExpandDims.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExpandDims.pbtxt
new file mode 100644
index 00000000000..01c82186792
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExpandDims.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExpandDims"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAssertNextDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAssertNextDataset.pbtxt
new file mode 100644
index 00000000000..28e46dce87d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAssertNextDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalAssertNextDataset"
+  endpoint {
+    name: "data.experimental.AssertNextDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAutoShardDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAutoShardDataset.pbtxt
new file mode 100644
index 00000000000..df08aef09b3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalAutoShardDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalAutoShardDataset"
+  endpoint {
+    name: "data.experimental.AutoShardDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalBytesProducedStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalBytesProducedStatsDataset.pbtxt
new file mode 100644
index 00000000000..272f9e1eaae
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalBytesProducedStatsDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalBytesProducedStatsDataset"
+  endpoint {
+    name: "data.experimental.BytesProducedStatsDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalCSVDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalCSVDataset.pbtxt
new file mode 100644
index 00000000000..d548e72a07a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalCSVDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalCSVDataset"
+  endpoint {
+    name:  "data.experimental.CSVDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalChooseFastestDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalChooseFastestDataset.pbtxt
new file mode 100644
index 00000000000..d818de9d33e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalChooseFastestDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalChooseFastestDataset"
+  endpoint {
+    name: "data.experimental.ChooseFastestDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetCardinality.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetCardinality.pbtxt
new file mode 100644
index 00000000000..743bc536a0f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetCardinality.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalDatasetCardinality"
+  endpoint {
+    name: "data.experimental.DatasetCardinality"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetToTFRecord.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetToTFRecord.pbtxt
new file mode 100644
index 00000000000..45ca0a09034
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDatasetToTFRecord.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalDatasetToTFRecord"
+  endpoint {
+    name: "data.experimental.DatasetToTFRecord"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDenseToSparseBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDenseToSparseBatchDataset.pbtxt
new file mode 100644
index 00000000000..492eeee03a2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDenseToSparseBatchDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalDenseToSparseBatchDataset"
+  endpoint {
+    name: "data.experimental.DenseToSparseBatchDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDirectedInterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDirectedInterleaveDataset.pbtxt
new file mode 100644
index 00000000000..d0acd7ea288
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalDirectedInterleaveDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalDirectedInterleaveDataset"
+  endpoint {
+    name: "data.experimental.DirectedInterleaveDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResource.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResource.pbtxt
similarity index 86%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResource.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResource.pbtxt
index fef2a0fd2f2..f35eca43ca4 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResource.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResource.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "ExperimentalFunctionBufferingResource"
   endpoint {
     name: "data.experimental.FunctionBufferingResource"
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt
index 4c614345d59..e1b5ae6fac6 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceGetNext.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "ExperimentalFunctionBufferingResourceGetNext"
   endpoint {
     name: "data.experimental.FunctionBufferingResourceGetNext"
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt
similarity index 86%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt
index b819eeab663..8c9bdb4de26 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalFunctionBufferingResourceReset.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "ExperimentalFunctionBufferingResourceReset"
   endpoint {
     name: "data.experimental.FunctionBufferingResourceReset"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByReducerDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByReducerDataset.pbtxt
new file mode 100644
index 00000000000..8cf62d85942
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByReducerDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalGroupByReducerDataset"
+  endpoint {
+    name: "data.experimental.GroupByReducerDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByWindowDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByWindowDataset.pbtxt
new file mode 100644
index 00000000000..875aaa78dd8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalGroupByWindowDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalGroupByWindowDataset"
+  endpoint {
+    name: "data.experimental.GroupByWindowDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIgnoreErrorsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIgnoreErrorsDataset.pbtxt
new file mode 100644
index 00000000000..ad31e9738d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIgnoreErrorsDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalIgnoreErrorsDataset"
+  endpoint {
+    name: "data.experimental.IgnoreErrorsDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIteratorGetDevice.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIteratorGetDevice.pbtxt
new file mode 100644
index 00000000000..b1f2dfcf5c9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalIteratorGetDevice.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalIteratorGetDevice"
+  endpoint {
+    name: "data.experimental.IteratorGetDevice"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLMDBDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLMDBDataset.pbtxt
new file mode 100644
index 00000000000..a427a85e631
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLMDBDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalLMDBDataset"
+  endpoint {
+    name: "data.experimental.LmdbDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLatencyStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLatencyStatsDataset.pbtxt
new file mode 100644
index 00000000000..21ed0bfde64
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalLatencyStatsDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalLatencyStatsDataset"
+  endpoint {
+    name: "data.experimental.LatencyStatsDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapAndBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapAndBatchDataset.pbtxt
new file mode 100644
index 00000000000..fa88e18887b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapAndBatchDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalMapAndBatchDataset"
+  endpoint {
+    name: "data.experimental.MapAndBatchDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapDataset.pbtxt
new file mode 100644
index 00000000000..cdfa66a022e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMapDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalMapDataset"
+  endpoint {
+    name: "data.experimental.MapDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMatchingFilesDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMatchingFilesDataset.pbtxt
new file mode 100644
index 00000000000..ae0210b3f3e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMatchingFilesDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalMatchingFilesDataset"
+  endpoint {
+    name: "data.experimental.MatchingFilesDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMaxIntraOpParallelismDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMaxIntraOpParallelismDataset.pbtxt
new file mode 100644
index 00000000000..afe63cd09fe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalMaxIntraOpParallelismDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalMaxIntraOpParallelismDataset"
+  endpoint {
+    name: "data.experimental.MaxIntraOpParallelismDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalNonSerializableDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalNonSerializableDataset.pbtxt
new file mode 100644
index 00000000000..5e3386e8483
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalNonSerializableDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalNonSerializableDataset"
+  endpoint {
+    name: "data.experimental.NonSerializableDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParallelInterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParallelInterleaveDataset.pbtxt
new file mode 100644
index 00000000000..ad33fe82aa8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParallelInterleaveDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalParallelInterleaveDataset"
+  endpoint {
+    name: "data.experimental.ParallelInterleaveDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParseExampleDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParseExampleDataset.pbtxt
new file mode 100644
index 00000000000..741b6b1a96a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalParseExampleDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalParseExampleDataset"
+  endpoint {
+    name: "data.experimental.ParseExampleDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalPrivateThreadPoolDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalPrivateThreadPoolDataset.pbtxt
new file mode 100644
index 00000000000..667d9f53047
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalPrivateThreadPoolDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalPrivateThreadPoolDataset"
+  endpoint {
+    name: "data.experimental.PrivateThreadPoolDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRandomDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRandomDataset.pbtxt
new file mode 100644
index 00000000000..687e7c2782a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRandomDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalRandomDataset"
+  endpoint {
+    name: "data.experimental.RandomDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRebatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRebatchDataset.pbtxt
new file mode 100644
index 00000000000..8012dbae620
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalRebatchDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalRebatchDataset"
+  endpoint {
+    name: "data.experimental.RebatchDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalScanDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalScanDataset.pbtxt
new file mode 100644
index 00000000000..910fb561988
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalScanDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalScanDataset"
+  endpoint {
+    name: "data.experimental.ScanDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSetStatsAggregatorDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSetStatsAggregatorDataset.pbtxt
new file mode 100644
index 00000000000..d3039499942
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSetStatsAggregatorDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalSetStatsAggregatorDataset"
+  endpoint {
+    name: "data.experimental.SetStatsAggregatorDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSleepDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSleepDataset.pbtxt
new file mode 100644
index 00000000000..7c160528fcc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSleepDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalSleepDataset"
+  endpoint {
+    name: "data.experimental.SleepDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSlidingWindowDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSlidingWindowDataset.pbtxt
new file mode 100644
index 00000000000..aa0fe454722
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSlidingWindowDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalSlidingWindowDataset"
+  endpoint {
+    name: "data.experimental.SlidingWindowDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSqlDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSqlDataset.pbtxt
new file mode 100644
index 00000000000..f827b21b8b7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalSqlDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalSqlDataset"
+  endpoint {
+    name: "data.experimental.SqlDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorHandle.pbtxt
new file mode 100644
index 00000000000..ec2f2aff7ca
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorHandle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalStatsAggregatorHandle"
+  endpoint {
+    name: "data.experimental.StatsAggregatorHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorSummary.pbtxt
new file mode 100644
index 00000000000..6f9b79ac777
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalStatsAggregatorSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalStatsAggregatorSummary"
+  endpoint {
+    name: "data.experimental.StatsAggregatorSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalTakeWhileDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalTakeWhileDataset.pbtxt
new file mode 100644
index 00000000000..2b494bd04c4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalTakeWhileDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalTakeWhileDataset"
+  endpoint {
+    name: "data.experimental.TakeWhileDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolDataset.pbtxt
new file mode 100644
index 00000000000..55fc4665fd9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalThreadPoolDataset"
+  endpoint {
+    name: "data.experimental.ThreadPoolDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolHandle.pbtxt
new file mode 100644
index 00000000000..ecaa0ceb2c9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalThreadPoolHandle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalThreadPoolHandle"
+  endpoint {
+    name: "data.experimental.ThreadPoolHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUnbatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUnbatchDataset.pbtxt
new file mode 100644
index 00000000000..c08a60749be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUnbatchDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalUnbatchDataset"
+  endpoint {
+    name: "data.experimental.UnbatchDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUniqueDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUniqueDataset.pbtxt
new file mode 100644
index 00000000000..d644078b402
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExperimentalUniqueDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExperimentalUniqueDataset"
+  endpoint {
+    name: "data.experimental.UniqueDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Expint.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Expint.pbtxt
new file mode 100644
index 00000000000..64b09ca6ab7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Expint.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Expint"
+  endpoint {
+    name: "math.special.Expint"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Expm1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Expm1.pbtxt
new file mode 100644
index 00000000000..df2ece3b9e8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Expm1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Expm1"
+  endpoint {
+    name: "math.Expm1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExtractGlimpse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpse.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ExtractGlimpse.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpse.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpseV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpseV2.pbtxt
new file mode 100644
index 00000000000..e0491472fc4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpseV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExtractGlimpseV2"
+  endpoint {
+    name: "image.ExtractGlimpse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractImagePatches.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractImagePatches.pbtxt
new file mode 100644
index 00000000000..ab6177b5247
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractImagePatches.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExtractImagePatches"
+  endpoint {
+    name: "image.ExtractImagePatches"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractJpegShape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractJpegShape.pbtxt
new file mode 100644
index 00000000000..da8258cc5b2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractJpegShape.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExtractJpegShape"
+  endpoint {
+    name: "image.ExtractJpegShape"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractVolumePatches.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractVolumePatches.pbtxt
new file mode 100644
index 00000000000..5d5d80ce08f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractVolumePatches.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ExtractVolumePatches"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT.pbtxt
new file mode 100644
index 00000000000..a50549a383e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FFT"
+  endpoint {
+    name: "signal.Fft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT2D.pbtxt
new file mode 100644
index 00000000000..ffbf0a00050
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FFT2D"
+  endpoint {
+    name: "signal.Fft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT3D.pbtxt
new file mode 100644
index 00000000000..a7415cc5d03
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FFT3D"
+  endpoint {
+    name: "signal.Fft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FFTND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFTND.pbtxt
new file mode 100644
index 00000000000..753cdcb1997
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FFTND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FFTND"
+  endpoint {
+    name: "signal.FftNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FIFOQueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FIFOQueue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FIFOQueue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FIFOQueue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FIFOQueueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FIFOQueueV2.pbtxt
new file mode 100644
index 00000000000..797fe75a0b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FIFOQueueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FIFOQueueV2"
+  endpoint {
+    name: "io.FifoQueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Fact.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fact.pbtxt
new file mode 100644
index 00000000000..f60455d31a5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fact.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Fact"
+  endpoint {
+    name: "math.Fact"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeParam.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeParam.pbtxt
new file mode 100644
index 00000000000..3310fb8af02
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeParam.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeParam"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgs.pbtxt
new file mode 100644
index 00000000000..61723a6b616
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxArgs"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxArgs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgsGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgsGradient.pbtxt
new file mode 100644
index 00000000000..a995fff37e4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxArgsGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxArgsGradient"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxArgsGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVars.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVars.pbtxt
new file mode 100644
index 00000000000..7318899ee3f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVars.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxVars"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxVars"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsGradient.pbtxt
new file mode 100644
index 00000000000..7738b510c20
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxVarsGradient"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxVarsGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannel.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannel.pbtxt
new file mode 100644
index 00000000000..270c2644610
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannel.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxVarsPerChannel"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxVarsPerChannel"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannelGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannelGradient.pbtxt
new file mode 100644
index 00000000000..0cd372b0162
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQuantWithMinMaxVarsPerChannelGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQuantWithMinMaxVarsPerChannelGradient"
+  endpoint {
+    name: "quantization.FakeQuantWithMinMaxVarsPerChannelGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQueue.pbtxt
new file mode 100644
index 00000000000..b49719e8142
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FakeQueue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FakeQueue"
+  endpoint {
+    name: "io.FakeQueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FileSystemSetConfiguration.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FileSystemSetConfiguration.pbtxt
new file mode 100644
index 00000000000..48a9f01c087
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FileSystemSetConfiguration.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FileSystemSetConfiguration"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Fill.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fill.pbtxt
new file mode 100644
index 00000000000..b0883b54e03
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fill.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Fill"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FilterByLastComponentDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterByLastComponentDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FilterByLastComponentDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FilterByLastComponentDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FilterDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FilterDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FilterDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FinalizeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FinalizeDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt
new file mode 100644
index 00000000000..5a5262fbe5a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "FinalizeTPUEmbedding"
+  endpoint {
+    name: "tpu.FinalizeTPUEmbedding"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt
new file mode 100644
index 00000000000..7a8840309e4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbeddingV2.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "FinalizeTPUEmbeddingV2"
+  endpoint {
+    name: "tpu.FinalizeTPUEmbedding"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Fingerprint.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fingerprint.pbtxt
new file mode 100644
index 00000000000..42f780314bb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Fingerprint.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Fingerprint"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordReader.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordReader.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FixedLengthRecordReader.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordReader.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordReaderV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordReaderV2.pbtxt
new file mode 100644
index 00000000000..c6acb018dc2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedLengthRecordReaderV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FixedLengthRecordReaderV2"
+  endpoint {
+    name: "io.FixedLengthRecordReader"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedUnigramCandidateSampler.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedUnigramCandidateSampler.pbtxt
new file mode 100644
index 00000000000..b4e26238201
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FixedUnigramCandidateSampler.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FixedUnigramCandidateSampler"
+  endpoint {
+    name: "nn.FixedUnigramCandidateSampler"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FlatMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FlatMapDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FlatMapDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FlatMapDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Floor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Floor.pbtxt
new file mode 100644
index 00000000000..9cbf0eb0e4e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Floor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Floor"
+  endpoint {
+    name: "math.Floor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorDiv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorDiv.pbtxt
new file mode 100644
index 00000000000..693eed27e08
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorDiv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FloorDiv"
+  endpoint {
+    name: "math.FloorDiv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorMod.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorMod.pbtxt
new file mode 100644
index 00000000000..c6c7ea42659
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FloorMod.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FloorMod"
+  endpoint {
+    name: "math.FloorMod"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FlushSummaryWriter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FlushSummaryWriter.pbtxt
new file mode 100644
index 00000000000..5731ce679d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FlushSummaryWriter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FlushSummaryWriter"
+  endpoint {
+    name: "summary.FlushSummaryWriter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_For.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_For.pbtxt
new file mode 100644
index 00000000000..4d01b94bd26
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_For.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "For"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPool.pbtxt
new file mode 100644
index 00000000000..1e2afb0ca3b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FractionalAvgPool"
+  endpoint {
+    name: "nn.FractionalAvgPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPoolGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPoolGrad.pbtxt
new file mode 100644
index 00000000000..f51859f903e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalAvgPoolGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FractionalAvgPoolGrad"
+  endpoint {
+    name: "nn.FractionalAvgPoolGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPool.pbtxt
new file mode 100644
index 00000000000..ad0fddc2bc6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FractionalMaxPool"
+  endpoint {
+    name: "nn.FractionalMaxPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPoolGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPoolGrad.pbtxt
new file mode 100644
index 00000000000..00bf30c2b68
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FractionalMaxPoolGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FractionalMaxPoolGrad"
+  endpoint {
+    name: "nn.FractionalMaxPoolGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelCos.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelCos.pbtxt
new file mode 100644
index 00000000000..239ea452c59
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelCos.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FresnelCos"
+  endpoint {
+    name: "math.special.FresnelCos"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelSin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelSin.pbtxt
new file mode 100644
index 00000000000..01e64aa2368
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FresnelSin.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FresnelSin"
+  endpoint {
+    name: "math.special.FresnelSin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNorm.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNorm.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNorm.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNorm.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGrad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormGrad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGrad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormGradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGradV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormGradV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGradV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGradV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGradV3.pbtxt
new file mode 100644
index 00000000000..bf2ae00fd7f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormGradV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FusedBatchNormGradV3"
+  endpoint {
+    name: "nn.FusedBatchNormGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_FusedBatchNormV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormV3.pbtxt
new file mode 100644
index 00000000000..e3cc882ca7d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedBatchNormV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FusedBatchNormV3"
+  endpoint {
+    name: "nn.FusedBatchNorm"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedPadConv2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedPadConv2D.pbtxt
new file mode 100644
index 00000000000..7e0d6eb913d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedPadConv2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FusedPadConv2D"
+  endpoint {
+    name: "nn.FusedPadConv2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedResizeAndPadConv2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedResizeAndPadConv2D.pbtxt
new file mode 100644
index 00000000000..fc92f057104
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FusedResizeAndPadConv2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "FusedResizeAndPadConv2D"
+  endpoint {
+    name: "nn.FusedResizeAndPadConv2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCell.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCell.pbtxt
new file mode 100644
index 00000000000..0b5ab9c8b0b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCell.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GRUBlockCell"
+  endpoint {
+    name: "nn.GRUBlockCell"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCellGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCellGrad.pbtxt
new file mode 100644
index 00000000000..642a35b7945
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GRUBlockCellGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GRUBlockCellGrad"
+  endpoint {
+    name: "nn.GRUBlockCellGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Gather.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Gather.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Gather.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Gather.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherNd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherNd.pbtxt
new file mode 100644
index 00000000000..80ed9a514c5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherNd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GatherNd"
+  endpoint {
+    name: "GatherNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherV2.pbtxt
new file mode 100644
index 00000000000..d27fd30efa0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GatherV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GatherV2"
+  endpoint {
+    name: "Gather"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureBlockCache.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureBlockCache.pbtxt
new file mode 100644
index 00000000000..0878563c93b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureBlockCache.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GcsConfigureBlockCache"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureCredentials.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureCredentials.pbtxt
new file mode 100644
index 00000000000..1653b16c4ee
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GcsConfigureCredentials.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GcsConfigureCredentials"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBigQueryReaderPartitions.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBigQueryReaderPartitions.pbtxt
new file mode 100644
index 00000000000..3b037ef31c6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBigQueryReaderPartitions.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GenerateBigQueryReaderPartitions"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBoundingBoxProposals.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBoundingBoxProposals.pbtxt
new file mode 100644
index 00000000000..069e9b74fff
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateBoundingBoxProposals.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GenerateBoundingBoxProposals"
+  endpoint {
+    name: "image.GenerateBoundingBoxProposals"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateVocabRemapping.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateVocabRemapping.pbtxt
new file mode 100644
index 00000000000..02c132223ec
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GenerateVocabRemapping.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GenerateVocabRemapping"
+  endpoint {
+    name: "train.GenerateVocabRemapping"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GeneratorDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GeneratorDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GeneratorDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_GeneratorDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetElementAtIndex.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetElementAtIndex.pbtxt
new file mode 100644
index 00000000000..9fac3335954
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetElementAtIndex.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GetElementAtIndex"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchSplitsWithPhysicalReplica.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchSplitsWithPhysicalReplica.pbtxt
new file mode 100644
index 00000000000..a9a8710fdb5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchSplitsWithPhysicalReplica.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "GetMinibatchSplitsWithPhysicalReplica"
+  visibility: VISIBLE
+  endpoint {
+    name: "tpu.GetMinibatchSplitsWithPhysicalReplica"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchesInCsrWithPhysicalReplica.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchesInCsrWithPhysicalReplica.pbtxt
new file mode 100644
index 00000000000..9ee5d7e2e5b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetMinibatchesInCsrWithPhysicalReplica.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "GetMinibatchesInCsrWithPhysicalReplica"
+  visibility: VISIBLE
+  endpoint {
+    name: "tpu.GetMinibatchesInCsrWithPhysicalReplica"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetOptions.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetOptions.pbtxt
new file mode 100644
index 00000000000..eeb6d4c91d8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetOptions.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GetOptions"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GetSessionHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionHandle.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GetSessionHandle.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionHandle.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionHandleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionHandleV2.pbtxt
new file mode 100644
index 00000000000..3484fbcd5d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionHandleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GetSessionHandleV2"
+  endpoint {
+    name: "GetSessionHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionTensor.pbtxt
new file mode 100644
index 00000000000..496b31c6ef0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetSessionTensor.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GetSessionTensor"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt
new file mode 100644
index 00000000000..11a2b9eccba
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetStatsFromListOfSparseCoreCooTensors.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "GetStatsFromListOfSparseCoreCooTensors"
+  visibility: VISIBLE
+  endpoint {
+    name: "sparse.GetStatsFromListOfSparseCoreCooTensors"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt
new file mode 100644
index 00000000000..1072689506c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GetTpuTaskId.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "GetTpuTaskId"
+  visibility: VISIBLE
+  endpoint {
+    name: "tpu.GetTpuTaskId"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalIterId.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalIterId.pbtxt
new file mode 100644
index 00000000000..8a795a8ef23
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalIterId.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "GlobalIterId"
+  visibility: VISIBLE
+  endpoint {
+    name: "tpu.GlobalIterId"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt
new file mode 100644
index 00000000000..ed286d3ae31
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GlobalShuffleDataset.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "GlobalShuffleDataset"
+  endpoint {
+    name: "data.GlobalShuffleDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Greater.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Greater.pbtxt
new file mode 100644
index 00000000000..a84b4c9bc6b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Greater.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Greater"
+  endpoint {
+    name: "math.Greater"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GreaterEqual.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GreaterEqual.pbtxt
new file mode 100644
index 00000000000..57f8c014728
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GreaterEqual.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GreaterEqual"
+  endpoint {
+    name: "math.GreaterEqual"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GroupByReducerDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByReducerDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GroupByReducerDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByReducerDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GroupByWindowDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByWindowDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_GroupByWindowDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_GroupByWindowDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_GuaranteeConst.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_GuaranteeConst.pbtxt
new file mode 100644
index 00000000000..56a115a0603
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_GuaranteeConst.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "GuaranteeConst"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_HSVToRGB.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HSVToRGB.pbtxt
new file mode 100644
index 00000000000..5689d054353
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_HSVToRGB.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "HSVToRGB"
+  endpoint {
+    name: "image.HsvToRgb"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_HashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HashTable.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_HashTable.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_HashTable.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_HashTableV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HashTableV2.pbtxt
new file mode 100644
index 00000000000..4cde617757a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_HashTableV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "HashTableV2"
+  endpoint {
+    name: "HashTable"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramFixedWidth.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramFixedWidth.pbtxt
new file mode 100644
index 00000000000..f3d2065032f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramFixedWidth.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "HistogramFixedWidth"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramSummary.pbtxt
new file mode 100644
index 00000000000..6c2c3b8254a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_HistogramSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "HistogramSummary"
+  endpoint {
+    name: "summary.HistogramSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_HostConst.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_HostConst.pbtxt
new file mode 100644
index 00000000000..f2a7160eccd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_HostConst.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "HostConst"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT.pbtxt
new file mode 100644
index 00000000000..a84e2d6dd57
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IFFT"
+  endpoint {
+    name: "signal.Ifft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT2D.pbtxt
new file mode 100644
index 00000000000..3380f459463
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IFFT2D"
+  endpoint {
+    name: "signal.Ifft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT3D.pbtxt
new file mode 100644
index 00000000000..02db3a66379
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IFFT3D"
+  endpoint {
+    name: "signal.Ifft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFTND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFTND.pbtxt
new file mode 100644
index 00000000000..214a8bfc0b8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IFFTND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IFFTND"
+  endpoint {
+    name: "signal.IfftNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT.pbtxt
new file mode 100644
index 00000000000..ebd31423283
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IRFFT"
+  endpoint {
+    name: "signal.Irfft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT2D.pbtxt
new file mode 100644
index 00000000000..e73397a832f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IRFFT2D"
+  endpoint {
+    name: "signal.Irfft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT3D.pbtxt
new file mode 100644
index 00000000000..e6a064cfa6c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IRFFT3D"
+  endpoint {
+    name: "signal.Irfft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFTND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFTND.pbtxt
new file mode 100644
index 00000000000..848e444c33e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IRFFTND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IRFFTND"
+  endpoint {
+    name: "signal.IrfftNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Identity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Identity.pbtxt
new file mode 100644
index 00000000000..f90a3e1b0f9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Identity.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Identity"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityN.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityN.pbtxt
new file mode 100644
index 00000000000..a39e00d4106
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityN.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IdentityN"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IdentityReader.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityReader.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IdentityReader.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityReader.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityReaderV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityReaderV2.pbtxt
new file mode 100644
index 00000000000..92bc4a10279
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IdentityReaderV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IdentityReaderV2"
+  endpoint {
+    name: "io.IdentityReader"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_If.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_If.pbtxt
new file mode 100644
index 00000000000..292c093587e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_If.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "If"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Igamma.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Igamma.pbtxt
new file mode 100644
index 00000000000..e0134f5acc4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Igamma.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Igamma"
+  endpoint {
+    name: "math.Igamma"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IgammaGradA.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IgammaGradA.pbtxt
new file mode 100644
index 00000000000..46eaba97345
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IgammaGradA.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IgammaGradA"
+  endpoint {
+    name: "math.IgammaGradA"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Igammac.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Igammac.pbtxt
new file mode 100644
index 00000000000..3114d90fd61
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Igammac.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Igammac"
+  endpoint {
+    name: "math.Igammac"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IgnoreErrorsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IgnoreErrorsDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IgnoreErrorsDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_IgnoreErrorsDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Imag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Imag.pbtxt
new file mode 100644
index 00000000000..66427ed58bd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Imag.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Imag"
+  endpoint {
+    name: "math.Imag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV2.pbtxt
new file mode 100644
index 00000000000..ae6bb8507be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ImageProjectiveTransformV2"
+  endpoint {
+    name: "image.ImageProjectiveTransformV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV3.pbtxt
new file mode 100644
index 00000000000..2f477c6d695
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageProjectiveTransformV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ImageProjectiveTransformV3"
+  endpoint {
+    name: "image.ImageProjectiveTransformV3"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageSummary.pbtxt
new file mode 100644
index 00000000000..5c3bd5f5047
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImageSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ImageSummary"
+  endpoint {
+    name: "summary.ImageSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ImmutableConst.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImmutableConst.pbtxt
new file mode 100644
index 00000000000..6f7a34c5a69
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImmutableConst.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ImmutableConst"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ImportEvent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImportEvent.pbtxt
new file mode 100644
index 00000000000..630a8894724
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ImportEvent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ImportEvent"
+  endpoint {
+    name: "summary.ImportEvent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InTopK.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InTopK.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InTopK.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_InTopK.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InTopKV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InTopKV2.pbtxt
new file mode 100644
index 00000000000..0fc46096895
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InTopKV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InTopKV2"
+  endpoint {
+    name: "nn.InTopK"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt
new file mode 100644
index 00000000000..682904a7504
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IndexFlatMapDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "IndexFlatMapDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.IndexFlatMapDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeue.pbtxt
new file mode 100644
index 00000000000..0d57c36ce27
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InfeedDequeue"
+  endpoint {
+    name: "tpu.InfeedDequeue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeueTuple.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeueTuple.pbtxt
new file mode 100644
index 00000000000..3655572e592
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedDequeueTuple.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InfeedDequeueTuple"
+  endpoint {
+    name: "tpu.InfeedDequeueTuple"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueue.pbtxt
new file mode 100644
index 00000000000..889c70cbfb1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InfeedEnqueue"
+  endpoint {
+    name: "tpu.InfeedEnqueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueuePrelinearizedBuffer.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueuePrelinearizedBuffer.pbtxt
new file mode 100644
index 00000000000..e37e5ed26cf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueuePrelinearizedBuffer.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InfeedEnqueuePrelinearizedBuffer"
+  endpoint {
+    name: "tpu.InfeedEnqueuePrelinearizedBuffer"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueueTuple.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueueTuple.pbtxt
new file mode 100644
index 00000000000..99c1cc4f0a1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InfeedEnqueueTuple.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InfeedEnqueueTuple"
+  endpoint {
+    name: "tpu.InfeedEnqueueTuple"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTable.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTable.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTable.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTableFromDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTableFromDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTableFromTextFile.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromTextFile.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InitializeTableFromTextFile.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromTextFile.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromTextFileV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromTextFileV2.pbtxt
new file mode 100644
index 00000000000..34712e89316
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableFromTextFileV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InitializeTableFromTextFileV2"
+  endpoint {
+    name: "InitializeTableFromTextFile"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableV2.pbtxt
new file mode 100644
index 00000000000..efb93c75341
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InitializeTableV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InitializeTableV2"
+  endpoint {
+    name: "InitializeTable"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceAdd.pbtxt
new file mode 100644
index 00000000000..c5b62051abe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InplaceAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceSub.pbtxt
new file mode 100644
index 00000000000..2b6359ab957
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InplaceSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceUpdate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceUpdate.pbtxt
new file mode 100644
index 00000000000..8d3a0f9d699
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InplaceUpdate.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InplaceUpdate"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InterleaveDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_InterleaveDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_InterleaveDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Inv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Inv.pbtxt
new file mode 100644
index 00000000000..543e2c9bbe8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Inv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Inv"
+  endpoint {
+    name: "linalg.Inv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InvGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InvGrad.pbtxt
new file mode 100644
index 00000000000..560855ffcf2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InvGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InvGrad"
+  endpoint {
+    name: "nn.InvGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Invert.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Invert.pbtxt
new file mode 100644
index 00000000000..6119fb19629
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Invert.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Invert"
+  endpoint {
+    name: "bitwise.Invert"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_InvertPermutation.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InvertPermutation.pbtxt
new file mode 100644
index 00000000000..3fa442de299
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InvertPermutation.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "InvertPermutation"
+  endpoint {
+    name: "math.InvertPermutation"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesEnsembleInitialized.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesEnsembleInitialized.pbtxt
new file mode 100644
index 00000000000..9efd7cd8357
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesEnsembleInitialized.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "IsBoostedTreesEnsembleInitialized"
+  endpoint {
+    name: "estimator.IsBoostedTreesEnsembleInitialized"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt
new file mode 100644
index 00000000000..630406cc2f0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsBoostedTreesQuantileStreamResourceInitialized.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "IsBoostedTreesQuantileStreamResourceInitialized"
+  endpoint {
+    name: "estimator.IsBoostedTreesQuantileStreamResourceInitialized"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsFinite.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsFinite.pbtxt
new file mode 100644
index 00000000000..1c33eae3169
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsFinite.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsFinite"
+  endpoint {
+    name: "math.IsFinite"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsInf.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsInf.pbtxt
new file mode 100644
index 00000000000..dbe157edb81
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsInf.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsInf"
+  endpoint {
+    name: "math.IsInf"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsNan.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsNan.pbtxt
new file mode 100644
index 00000000000..a5575098082
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsNan.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsNan"
+  endpoint {
+    name: "math.IsNan"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsTPUEmbeddingInitialized.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsTPUEmbeddingInitialized.pbtxt
new file mode 100644
index 00000000000..8f99e9b3e71
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsTPUEmbeddingInitialized.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsTPUEmbeddingInitialized"
+  endpoint {
+    name: "tpu.IsTPUEmbeddingInitialized"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsVariableInitialized.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsVariableInitialized.pbtxt
new file mode 100644
index 00000000000..b5f0f182125
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsVariableInitialized.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsVariableInitialized"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IsotonicRegression.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsotonicRegression.pbtxt
new file mode 100644
index 00000000000..e0d1edb67aa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IsotonicRegression.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IsotonicRegression"
+  endpoint {
+    name: "nn.IsotonicRegression"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Iterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Iterator.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Iterator.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Iterator.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorFromStringHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorFromStringHandle.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorFromStringHandle.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorFromStringHandle.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorFromStringHandleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorFromStringHandleV2.pbtxt
new file mode 100644
index 00000000000..214318f4aea
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorFromStringHandleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IteratorFromStringHandleV2"
+  endpoint {
+    name: "data.IteratorFromStringHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetDevice.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetDevice.pbtxt
new file mode 100644
index 00000000000..9da26e5af9f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetDevice.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IteratorGetDevice"
+  endpoint {
+    name: "data.IteratorGetDevice"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt
new file mode 100644
index 00000000000..588803255e0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetModelProto.pbtxt
@@ -0,0 +1,6 @@
+op {
+  graph_op_name: "IteratorGetModelProto"
+  endpoint {
+    name: "data.IteratorGetModelProto"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorGetNext.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNext.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorGetNext.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNext.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextAsOptional.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextAsOptional.pbtxt
new file mode 100644
index 00000000000..95ea8dc4224
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextAsOptional.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IteratorGetNextAsOptional"
+  endpoint {
+    name: "data.IteratorGetNextAsOptional"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextSync.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextSync.pbtxt
new file mode 100644
index 00000000000..5f74f24e12f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNextSync.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IteratorGetNextSync"
+  endpoint {
+    name: "data.IteratorGetNextSync"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorToStringHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorToStringHandle.pbtxt
new file mode 100644
index 00000000000..0a7723ac676
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorToStringHandle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "IteratorToStringHandle"
+  endpoint {
+    name: "data.IteratorToStringHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_IteratorV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_KMC2ChainInitialization.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_KMC2ChainInitialization.pbtxt
new file mode 100644
index 00000000000..5c2ed95566d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_KMC2ChainInitialization.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "KMC2ChainInitialization"
+  endpoint {
+    name: "cluster.KMC2ChainInitialization"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KafkaDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_KafkaDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KafkaDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_KafkaDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_KmeansPlusPlusInitialization.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_KmeansPlusPlusInitialization.pbtxt
new file mode 100644
index 00000000000..b4cb77a981b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_KmeansPlusPlusInitialization.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "KmeansPlusPlusInitialization"
+  endpoint {
+    name: "cluster.KmeansPlusPlusInitialization"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_KthOrderStatistic.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_KthOrderStatistic.pbtxt
new file mode 100644
index 00000000000..98c602c5ebe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_KthOrderStatistic.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "KthOrderStatistic"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_L2Loss.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_L2Loss.pbtxt
new file mode 100644
index 00000000000..e00de2d3643
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_L2Loss.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "L2Loss"
+  endpoint {
+    name: "nn.L2Loss"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LMDBDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LMDBDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBReader.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBReader.pbtxt
new file mode 100644
index 00000000000..cff04abb5f5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LMDBReader.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LMDBReader"
+  endpoint {
+    name: "io.LmdbReader"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LRN.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LRN.pbtxt
new file mode 100644
index 00000000000..5990d283ee7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LRN.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LRN"
+  endpoint {
+    name: "nn.LocalResponseNormalization"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LRNGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LRNGrad.pbtxt
new file mode 100644
index 00000000000..f6c64ca6d04
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LRNGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LRNGrad"
+  endpoint {
+    name: "nn.LocalResponseNormalizationGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCell.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCell.pbtxt
new file mode 100644
index 00000000000..dd8baae2a1e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCell.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LSTMBlockCell"
+  endpoint {
+    name: "nn.LSTMBlockCell"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCellGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCellGrad.pbtxt
new file mode 100644
index 00000000000..518a29ef8b1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LSTMBlockCellGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LSTMBlockCellGrad"
+  endpoint {
+    name: "nn.LSTMBlockCellGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LatencyStatsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LatencyStatsDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LatencyStatsDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LatencyStatsDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LeakyRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyRelu.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LeakyRelu.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyRelu.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyReluGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyReluGrad.pbtxt
new file mode 100644
index 00000000000..0b6ab5953da
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyReluGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LeakyReluGrad"
+  endpoint {
+    name: "data.LeakyReluGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LearnedUnigramCandidateSampler.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LearnedUnigramCandidateSampler.pbtxt
new file mode 100644
index 00000000000..bc4ab82cdc2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LearnedUnigramCandidateSampler.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LearnedUnigramCandidateSampler"
+  endpoint {
+    name: "nn.LearnedUnigramCandidateSampler"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LeftShift.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeftShift.pbtxt
new file mode 100644
index 00000000000..e00c50f0d68
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeftShift.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LeftShift"
+  endpoint {
+    name: "bitwise.LeftShift"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LegacyParallelInterleaveDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LegacyParallelInterleaveDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LegacyParallelInterleaveDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LegacyParallelInterleaveDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Less.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Less.pbtxt
new file mode 100644
index 00000000000..0fa328a0f94
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Less.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Less"
+  endpoint {
+    name: "math.Less"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LessEqual.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LessEqual.pbtxt
new file mode 100644
index 00000000000..7faf528185e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LessEqual.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LessEqual"
+  endpoint {
+    name: "math.LessEqual"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Lgamma.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Lgamma.pbtxt
new file mode 100644
index 00000000000..b6e817d9d69
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Lgamma.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Lgamma"
+  endpoint {
+    name: "math.Lgamma"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LinSpace.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LinSpace.pbtxt
new file mode 100644
index 00000000000..09eb5212385
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LinSpace.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LinSpace"
+  endpoint {
+    name: "LinSpace"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDataset.pbtxt
new file mode 100644
index 00000000000..434f9b2c332
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ListDataset"
+  endpoint {
+    name: "data.ListDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDiff.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDiff.pbtxt
new file mode 100644
index 00000000000..4cac575906b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListDiff.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ListDiff"
+  endpoint {
+    name: "SetDiff1d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ListSnapshotChunksDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListSnapshotChunksDataset.pbtxt
new file mode 100644
index 00000000000..e48c7bf0a11
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ListSnapshotChunksDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ListSnapshotChunksDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.ListSnapshotChunksDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAllTPUEmbeddingParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAllTPUEmbeddingParameters.pbtxt
new file mode 100644
index 00000000000..1c5cf1f526e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAllTPUEmbeddingParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadAllTPUEmbeddingParameters"
+  endpoint {
+    name: "tpu.LoadAllTPUEmbeddingParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAndRemapMatrix.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAndRemapMatrix.pbtxt
new file mode 100644
index 00000000000..3c8984a6cb6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadAndRemapMatrix.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadAndRemapMatrix"
+  endpoint {
+    name: "linalg.LoadAndRemapMatrix"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParameters.pbtxt
new file mode 100644
index 00000000000..a591533cf42
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingADAMParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingADAMParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
index 6702f33be77..cd5c2cf8a4d 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingADAMParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingADAMParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParameters.pbtxt
new file mode 100644
index 00000000000..4b4466b3ebe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingAdadeltaParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingAdadeltaParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
index 3b4a4a8de5a..3e6fbd0cda8 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradMomentumParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradMomentumParameters.pbtxt
new file mode 100644
index 00000000000..4ab6b43fb23
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradMomentumParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingAdagradMomentumParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingAdagradMomentumParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParameters.pbtxt
new file mode 100644
index 00000000000..53dc92a921c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingAdagradParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingAdagradParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
index bd6f676de12..fa8a345407c 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingAdagradParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingAdagradParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingCenteredRMSPropParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingCenteredRMSPropParameters.pbtxt
new file mode 100644
index 00000000000..f1781c96808
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingCenteredRMSPropParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingCenteredRMSPropParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingCenteredRMSPropParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParameters.pbtxt
new file mode 100644
index 00000000000..6b3377f0d72
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingFTRLParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingFTRLParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
index 363d4f38bfa..f17d8fcc776 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingFTRLParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingFTRLParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParameters.pbtxt
new file mode 100644
index 00000000000..33baa18848c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingFrequencyEstimatorParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingFrequencyEstimatorParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..fba39f852dc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMDLAdagradLightParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMDLAdagradLightParameters.pbtxt
new file mode 100644
index 00000000000..d03ed8796c1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMDLAdagradLightParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingMDLAdagradLightParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingMDLAdagradLightParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParameters.pbtxt
new file mode 100644
index 00000000000..2ea9c9cfc8c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingMomentumParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingMomentumParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
index 99bdda45764..fccbff595f9 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingMomentumParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingMomentumParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParameters.pbtxt
new file mode 100644
index 00000000000..1b6f3afd838
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingProximalAdagradParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingProximalAdagradParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
index 870549ab640..65fe6e27afe 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParameters.pbtxt
new file mode 100644
index 00000000000..f416308b609
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingProximalYogiParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingProximalYogiParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
index c55d7d84731..2656c561bbb 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParameters.pbtxt
new file mode 100644
index 00000000000..bee7db0753b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingRMSPropParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingRMSPropParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
index 1dbe67ff290..3becf4df5d3 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingRMSPropParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParameters.pbtxt
new file mode 100644
index 00000000000..57102d66657
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoadTPUEmbeddingStochasticGradientDescentParameters"
+  endpoint {
+    name: "tpu.LoadTPUEmbeddingStochasticGradientDescentParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
similarity index 89%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
index 86e15662c61..e6dae92e1f2 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"
   endpoint {
     name: "tpu.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Log.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Log.pbtxt
new file mode 100644
index 00000000000..79d5b27a477
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Log.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Log"
+  endpoint {
+    name: "math.Log"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Log1p.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Log1p.pbtxt
new file mode 100644
index 00000000000..f91d9ec6a09
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Log1p.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Log1p"
+  endpoint {
+    name: "math.Log1p"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogMatrixDeterminant.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogMatrixDeterminant.pbtxt
new file mode 100644
index 00000000000..3828143fa9b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogMatrixDeterminant.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogMatrixDeterminant"
+  endpoint {
+    name: "linalg.LogMatrixDeterminant"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogSoftmax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogSoftmax.pbtxt
new file mode 100644
index 00000000000..94186851ee9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogSoftmax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogSoftmax"
+  endpoint {
+    name: "nn.LogSoftmax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogUniformCandidateSampler.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogUniformCandidateSampler.pbtxt
new file mode 100644
index 00000000000..c1f7c67d6e5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogUniformCandidateSampler.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogUniformCandidateSampler"
+  endpoint {
+    name: "random.LogUniformCandidateSampler"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalAnd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalAnd.pbtxt
new file mode 100644
index 00000000000..ebd2c0f5d60
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalAnd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogicalAnd"
+  endpoint {
+    name: "math.LogicalAnd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalNot.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalNot.pbtxt
new file mode 100644
index 00000000000..3665727828c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalNot.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogicalNot"
+  endpoint {
+    name: "math.LogicalNot"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalOr.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalOr.pbtxt
new file mode 100644
index 00000000000..e4a567d034e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LogicalOr.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LogicalOr"
+  endpoint {
+    name: "math.LogicalOr"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableExport.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableExport.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableExport.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableExport.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableExportV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableExportV2.pbtxt
new file mode 100644
index 00000000000..0e0c4a4fac3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableExportV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableExportV2"
+  endpoint {
+    name: "LookupTableExport"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableFind.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableFind.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableFind.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableFind.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableFindV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableFindV2.pbtxt
new file mode 100644
index 00000000000..936dd7afecf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableFindV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableFindV2"
+  endpoint {
+    name: "LookupTableFind"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableImport.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableImport.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableImport.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableImport.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableImportV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableImportV2.pbtxt
new file mode 100644
index 00000000000..9e7925797da
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableImportV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableImportV2"
+  endpoint {
+    name: "LookupTableImport"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableInsert.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableInsert.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableInsert.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableInsert.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableInsertV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableInsertV2.pbtxt
new file mode 100644
index 00000000000..d5db4b3b535
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableInsertV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableInsertV2"
+  endpoint {
+    name: "LookupTableInsert"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableRemoveV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableRemoveV2.pbtxt
new file mode 100644
index 00000000000..911df9ae719
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableRemoveV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableRemoveV2"
+  endpoint {
+    name: "LookupTableRemove"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableSize.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_LookupTableSize.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableSize.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableSizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableSizeV2.pbtxt
new file mode 100644
index 00000000000..fafc1f8c910
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LookupTableSizeV2.pbtxt
@@ -0,0 +1,11 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LookupTableSizeV2"
+  endpoint {
+    name: "LookupTableSize"
+  }
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LoopCond.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoopCond.pbtxt
new file mode 100644
index 00000000000..88907751f5e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoopCond.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LoopCond"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_LowerBound.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LowerBound.pbtxt
new file mode 100644
index 00000000000..3e92dbec886
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LowerBound.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "LowerBound"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Lu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Lu.pbtxt
new file mode 100644
index 00000000000..269a5fbb7d5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Lu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Lu"
+  endpoint {
+    name: "linalg.Lu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MakeIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeIterator.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MakeIterator.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MakeIterator.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeUnique.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeUnique.pbtxt
new file mode 100644
index 00000000000..3c61d469fd4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeUnique.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MakeUnique"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MapAndBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapAndBatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MapAndBatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MapAndBatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapClear.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapClear.pbtxt
new file mode 100644
index 00000000000..b5bba0a4941
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapClear.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapClear"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MapDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MapDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDefun.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDefun.pbtxt
new file mode 100644
index 00000000000..0e069d080fe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDefun.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapDefun"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapIncompleteSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapIncompleteSize.pbtxt
new file mode 100644
index 00000000000..cd28e3f8a28
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapIncompleteSize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapIncompleteSize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapPeek.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapPeek.pbtxt
new file mode 100644
index 00000000000..3541cc96d63
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapPeek.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapPeek"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapSize.pbtxt
new file mode 100644
index 00000000000..30bad2d2ccb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapSize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapSize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapStage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapStage.pbtxt
new file mode 100644
index 00000000000..fab2cf93595
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapStage.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapStage"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstage.pbtxt
new file mode 100644
index 00000000000..82be22f5dc8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstage.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapUnstage"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstageNoKey.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstageNoKey.pbtxt
new file mode 100644
index 00000000000..dac737d2486
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapUnstageNoKey.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MapUnstageNoKey"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatMul.pbtxt
new file mode 100644
index 00000000000..bc7b2833b00
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatMul.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatMul"
+  endpoint {
+    name: "linalg.MatMul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFiles.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFiles.pbtxt
new file mode 100644
index 00000000000..fea6f70d5cf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFiles.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatchingFiles"
+  endpoint {
+    name: "io.MatchingFiles"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatchingFilesDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFilesDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatchingFilesDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MatchingFilesDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixBandPart.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixBandPart.pbtxt
new file mode 100644
index 00000000000..24f955501f7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixBandPart.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixBandPart"
+  endpoint {
+    name: "linalg.BandPart"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDeterminant.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDeterminant.pbtxt
new file mode 100644
index 00000000000..933a41dddc0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDeterminant.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixDeterminant"
+  endpoint {
+    name: "linalg.Det"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixDiag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiag.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixDiag.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiag.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixDiagPart.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPart.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixDiagPart.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPart.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV2.pbtxt
new file mode 100644
index 00000000000..c40b2c16745
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixDiagPartV2"
+  endpoint {
+    name: "linalg.MatrixDiagPart"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV3.pbtxt
new file mode 100644
index 00000000000..05fadef2d8a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagPartV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixDiagPartV3"
+  endpoint {
+    name: "linalg.MatrixDiagPartV3"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV2.pbtxt
new file mode 100644
index 00000000000..b25ce946738
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixDiagV2"
+  endpoint {
+    name: "linalg.MatrixDiag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV3.pbtxt
new file mode 100644
index 00000000000..fdb19d77f1b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixDiagV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixDiagV3"
+  endpoint {
+    name: "linalg.MatrixDiagV3"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixExponential.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixExponential.pbtxt
new file mode 100644
index 00000000000..9db500e926a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixExponential.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixExponential"
+  endpoint {
+    name: "linalg.MatrixExponential"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixInverse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixInverse.pbtxt
new file mode 100644
index 00000000000..1792f6deef7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixInverse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixInverse"
+  endpoint {
+    name: "linalg.Inv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixLogarithm.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixLogarithm.pbtxt
new file mode 100644
index 00000000000..9fcb9badeb5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixLogarithm.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixLogarithm"
+  endpoint {
+    name: "linalg.MatrixLogarithm"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixSetDiag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiag.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixSetDiag.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiag.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixSetDiagV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MatrixSetDiagV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV3.pbtxt
new file mode 100644
index 00000000000..28a0fb5b934
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV3.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixSetDiagV3"
+  endpoint {
+    name: "linalg.MatrixSetDiag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolve.pbtxt
new file mode 100644
index 00000000000..cf4bc9b04a6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixSolve"
+  endpoint {
+    name: "linalg.Solve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolveLs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolveLs.pbtxt
new file mode 100644
index 00000000000..c7fc10c5447
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSolveLs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixSolveLs"
+  endpoint {
+    name: "linalg.MatrixSolveLs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSquareRoot.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSquareRoot.pbtxt
new file mode 100644
index 00000000000..42d3518b6e5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSquareRoot.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixSquareRoot"
+  endpoint {
+    name: "linalg.Sqrtm"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixTriangularSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixTriangularSolve.pbtxt
new file mode 100644
index 00000000000..0e20889c3ae
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixTriangularSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MatrixTriangularSolve"
+  endpoint {
+    name: "linalg.TriangularSolve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Max.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Max.pbtxt
new file mode 100644
index 00000000000..112ab3af60a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Max.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Max"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxIntraOpParallelismDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxIntraOpParallelismDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxIntraOpParallelismDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MaxIntraOpParallelismDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPool.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3D.pbtxt
new file mode 100644
index 00000000000..77232e6020a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPool3D"
+  endpoint {
+    name: "nn.MaxPool3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGrad.pbtxt
new file mode 100644
index 00000000000..bbdc2058f46
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPool3DGrad"
+  endpoint {
+    name: "nn.MaxPool3dGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGradGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGradGrad.pbtxt
new file mode 100644
index 00000000000..cd2d4d76817
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPool3DGradGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPool3DGradGrad"
+  endpoint {
+    name: "nn.MaxPool3dGradGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPoolGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGrad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPoolGrad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGrad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPoolGradGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGrad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MaxPoolGradGrad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGrad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradV2.pbtxt
new file mode 100644
index 00000000000..68a36bb8b63
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolGradGradV2"
+  endpoint {
+    name: "nn.MaxPoolGradGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradWithArgmax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradWithArgmax.pbtxt
new file mode 100644
index 00000000000..84f92c16fd9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradGradWithArgmax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolGradGradWithArgmax"
+  endpoint {
+    name: "nn.MaxPoolGradGradWithArgmax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradV2.pbtxt
new file mode 100644
index 00000000000..78c26e0d20a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolGradV2"
+  endpoint {
+    name: "nn.MaxPoolGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradWithArgmax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradWithArgmax.pbtxt
new file mode 100644
index 00000000000..82d58e00566
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolGradWithArgmax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolGradWithArgmax"
+  endpoint {
+    name: "nn.MaxPoolGradWithArgmax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolV2.pbtxt
new file mode 100644
index 00000000000..a8ebcfea908
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolV2"
+  endpoint {
+    name: "nn.MaxPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolWithArgmax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolWithArgmax.pbtxt
new file mode 100644
index 00000000000..c0e9bb2aa29
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MaxPoolWithArgmax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MaxPoolWithArgmax"
+  endpoint {
+    name: "nn.MaxPoolWithArgmax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Maximum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Maximum.pbtxt
new file mode 100644
index 00000000000..0a510be5947
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Maximum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Maximum"
+  endpoint {
+    name: "math.Maximum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Mean.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mean.pbtxt
new file mode 100644
index 00000000000..707b1eddb86
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mean.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Mean"
+  endpoint {
+    name: "math.Mean"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Merge.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Merge.pbtxt
new file mode 100644
index 00000000000..e04a5e7670d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Merge.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Merge"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeDedupData.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeDedupData.pbtxt
new file mode 100644
index 00000000000..c62ad85f44d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeDedupData.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MergeDedupData"
+  endpoint {
+    name: "tpu.MergeDedupData"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeSummary.pbtxt
new file mode 100644
index 00000000000..528399aaec1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MergeSummary"
+  endpoint {
+    name: "summary.MergeSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeV2Checkpoints.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeV2Checkpoints.pbtxt
new file mode 100644
index 00000000000..671ae3f9917
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MergeV2Checkpoints.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MergeV2Checkpoints"
+  endpoint {
+    name: "train.MergeV2Checkpoints"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Mfcc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mfcc.pbtxt
new file mode 100644
index 00000000000..018361798cc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mfcc.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Mfcc"
+  endpoint {
+    name: "audio.Mfcc"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Min.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Min.pbtxt
new file mode 100644
index 00000000000..3355adfbdde
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Min.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Min"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Minimum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Minimum.pbtxt
new file mode 100644
index 00000000000..cb33aa21fb4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Minimum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Minimum"
+  endpoint {
+    name: "math.Minimum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPad.pbtxt
new file mode 100644
index 00000000000..5bc1ebdacbc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPad.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MirrorPad"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPadGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPadGrad.pbtxt
new file mode 100644
index 00000000000..0a9c168e261
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MirrorPadGrad.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MirrorPadGrad"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MlirPassthroughOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MlirPassthroughOp.pbtxt
new file mode 100644
index 00000000000..bf4453b8f2d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MlirPassthroughOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MlirPassthroughOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Mod.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mod.pbtxt
new file mode 100644
index 00000000000..e4003385089
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mod.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Mod"
+  endpoint {
+    name: "math.Mod"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ModelDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ModelDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ModelDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ModelDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Mul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mul.pbtxt
new file mode 100644
index 00000000000..8d1f243721d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Mul.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Mul"
+  endpoint {
+    name: "math.Mul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MulNoNan.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MulNoNan.pbtxt
new file mode 100644
index 00000000000..e5af10eb9b4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MulNoNan.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MulNoNan"
+  endpoint {
+    name: "math.MulNoNan"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIterator.pbtxt
new file mode 100644
index 00000000000..b51de3ab1e5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MultiDeviceIterator"
+  endpoint {
+    name: "data.MultiDeviceIterator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorFromStringHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorFromStringHandle.pbtxt
new file mode 100644
index 00000000000..59f8a287dad
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorFromStringHandle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MultiDeviceIteratorFromStringHandle"
+  endpoint {
+    name: "data.MultiDeviceIteratorFromStringHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorGetNextFromShard.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorGetNextFromShard.pbtxt
new file mode 100644
index 00000000000..f36e12598c4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorGetNextFromShard.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MultiDeviceIteratorGetNextFromShard"
+  endpoint {
+    name: "data.MultiDeviceIteratorGetNextFromShard"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorInit.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorInit.pbtxt
new file mode 100644
index 00000000000..3b477b5b21f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorInit.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MultiDeviceIteratorInit"
+  endpoint {
+    name: "data.MultiDeviceIteratorInit"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorToStringHandle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorToStringHandle.pbtxt
new file mode 100644
index 00000000000..3d4958f4495
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MultiDeviceIteratorToStringHandle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MultiDeviceIteratorToStringHandle"
+  endpoint {
+    name: "data.MultiDeviceIteratorToStringHandle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Multinomial.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Multinomial.pbtxt
new file mode 100644
index 00000000000..2b693f02801
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Multinomial.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Multinomial"
+  endpoint {
+    name: "random.Multinomial"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableDenseHashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableDenseHashTable.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableDenseHashTable.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MutableDenseHashTable.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableDenseHashTableV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableDenseHashTableV2.pbtxt
new file mode 100644
index 00000000000..8f20cfd93f5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableDenseHashTableV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MutableDenseHashTableV2"
+  endpoint {
+    name: "MutableDenseHashTable"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableHashTable.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTable.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableHashTable.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTable.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableHashTableOfTensors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableOfTensors.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_MutableHashTableOfTensors.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableOfTensors.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableOfTensorsV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableOfTensorsV2.pbtxt
new file mode 100644
index 00000000000..d9c26fde9dc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableOfTensorsV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MutableHashTableOfTensorsV2"
+  endpoint {
+    name: "MutableHashTableOfTensors"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableV2.pbtxt
new file mode 100644
index 00000000000..0cfaa1a226b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutableHashTableV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MutableHashTableV2"
+  endpoint {
+    name: "MutableHashTable"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexLock.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexLock.pbtxt
new file mode 100644
index 00000000000..99bf40ba1ed
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexLock.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MutexLock"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexV2.pbtxt
new file mode 100644
index 00000000000..17198f4f38c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MutexV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "MutexV2"
+  endpoint {
+    name: "Mutex"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclAllReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclAllReduce.pbtxt
new file mode 100644
index 00000000000..cd7390fa15e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclAllReduce.pbtxt
@@ -0,0 +1,11 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NcclAllReduce"
+  endpoint: {
+    name: "distribute.NcclAllReduce"
+  }
+  endpoint: {
+    name: "NcclAllReduce"
+    deprecated: true
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclBroadcast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclBroadcast.pbtxt
new file mode 100644
index 00000000000..74abc5b82d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclBroadcast.pbtxt
@@ -0,0 +1,11 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NcclBroadcast"
+  endpoint: {
+    name: "distribute.NcclBroadcast"
+  }
+  endpoint: {
+    name: "NcclBroadcast"
+    deprecated: true
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclReduce.pbtxt
new file mode 100644
index 00000000000..a0ee5487b3e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NcclReduce.pbtxt
@@ -0,0 +1,11 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NcclReduce"
+  endpoint: {
+    name: "distribute.NcclReduce"
+  }
+  endpoint: {
+    name: "NcclReduce"
+    deprecated: true
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Ndtri.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Ndtri.pbtxt
new file mode 100644
index 00000000000..9394ba422af
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Ndtri.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Ndtri"
+  endpoint {
+    name: "math.Ndtri"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NearestNeighbors.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NearestNeighbors.pbtxt
new file mode 100644
index 00000000000..d50362c31fd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NearestNeighbors.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NearestNeighbors"
+  endpoint {
+    name: "image.NearestNeighbors"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Neg.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Neg.pbtxt
new file mode 100644
index 00000000000..440db9e6414
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Neg.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Neg"
+  endpoint {
+    name: "math.Neg"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NegTrain.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NegTrain.pbtxt
new file mode 100644
index 00000000000..5f381b6e034
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NegTrain.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NegTrain"
+  endpoint {
+    name: "train.NegTrain"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NextAfter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NextAfter.pbtxt
new file mode 100644
index 00000000000..c1c88706cb2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NextAfter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NextAfter"
+  endpoint {
+    name: "math.NextAfter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NextIteration.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NextIteration.pbtxt
new file mode 100644
index 00000000000..63b551aad19
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NextIteration.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NextIteration"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NoOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NoOp.pbtxt
new file mode 100644
index 00000000000..f3d89127156
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NoOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NoOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NonDeterministicInts.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonDeterministicInts.pbtxt
new file mode 100644
index 00000000000..aa8cc027cd6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonDeterministicInts.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NonDeterministicInts"
+  endpoint {
+    name: "random.NonDeterministicInts"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppression.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppression.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppression.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppression.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV3.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV3.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV3.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV4.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonMaxSuppressionV4.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV4.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV5.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV5.pbtxt
new file mode 100644
index 00000000000..7821a13912d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionV5.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NonMaxSuppressionV5"
+  endpoint {
+    name: "image.NonMaxSuppression"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionWithOverlaps.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionWithOverlaps.pbtxt
new file mode 100644
index 00000000000..de5488bb255
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonMaxSuppressionWithOverlaps.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NonMaxSuppressionWithOverlaps"
+  endpoint {
+    name: "image.NonMaxSuppressionWithOverlaps"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonSerializableDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NonSerializableDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NonSerializableDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_NonSerializableDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NotEqual.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NotEqual.pbtxt
new file mode 100644
index 00000000000..5b587960e14
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NotEqual.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NotEqual"
+  endpoint {
+    name: "math.NotEqual"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_NthElement.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_NthElement.pbtxt
new file mode 100644
index 00000000000..7930c041ad3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_NthElement.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "NthElement"
+  endpoint {
+    name: "nn.NthElement"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OneHot.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OneHot.pbtxt
new file mode 100644
index 00000000000..116d0272f16
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OneHot.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OneHot"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OneShotIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OneShotIterator.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OneShotIterator.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_OneShotIterator.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OnesLike.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OnesLike.pbtxt
new file mode 100644
index 00000000000..06bdeacbd0e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OnesLike.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OnesLike"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptimizeDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_OptimizeDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalFromValue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalFromValue.pbtxt
new file mode 100644
index 00000000000..282d866f180
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalFromValue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OptionalFromValue"
+  endpoint {
+    name: "data.OptionalFromValue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalGetValue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalGetValue.pbtxt
new file mode 100644
index 00000000000..b0be584ec90
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalGetValue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OptionalGetValue"
+  endpoint {
+    name: "data.OptionalGetValue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalHasValue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalHasValue.pbtxt
new file mode 100644
index 00000000000..f2778d04bb8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalHasValue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OptionalHasValue"
+  endpoint {
+    name: "data.OptionalHasValue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalNone.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalNone.pbtxt
new file mode 100644
index 00000000000..77ec49c964c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionalNone.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OptionalNone"
+  endpoint {
+    name: "data.OptionalNone"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptionsDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OptionsDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_OptionsDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_OptionsDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapClear.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapClear.pbtxt
new file mode 100644
index 00000000000..30c9cc626d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapClear.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapClear"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapIncompleteSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapIncompleteSize.pbtxt
new file mode 100644
index 00000000000..ef2e4e4f272
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapIncompleteSize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapIncompleteSize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapPeek.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapPeek.pbtxt
new file mode 100644
index 00000000000..2ac8b71d2fb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapPeek.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapPeek"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapSize.pbtxt
new file mode 100644
index 00000000000..47e4f6188ce
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapSize.pbtxt
@@ -0,0 +1,8 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapSize"
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapStage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapStage.pbtxt
new file mode 100644
index 00000000000..22a96eaccb0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapStage.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapStage"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstage.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstage.pbtxt
new file mode 100644
index 00000000000..b617e0ad11e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstage.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapUnstage"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstageNoKey.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstageNoKey.pbtxt
new file mode 100644
index 00000000000..e5beaff8915
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OrderedMapUnstageNoKey.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OrderedMapUnstageNoKey"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeue.pbtxt
new file mode 100644
index 00000000000..6a8b5d5f562
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedDequeue"
+  endpoint {
+    name: "tpu.OutfeedDequeue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTuple.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTuple.pbtxt
new file mode 100644
index 00000000000..9b8a9b7bebd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTuple.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedDequeueTuple"
+  endpoint {
+    name: "tpu.OutfeedDequeueTuple"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTupleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTupleV2.pbtxt
new file mode 100644
index 00000000000..7fef814d5b3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueTupleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedDequeueTupleV2"
+  endpoint {
+    name: "tpu.OutfeedDequeueTupleV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueV2.pbtxt
new file mode 100644
index 00000000000..02c947f23f8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedDequeueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedDequeueV2"
+  endpoint {
+    name: "tpu.OutfeedDequeueV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueue.pbtxt
new file mode 100644
index 00000000000..18694993470
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueue.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedEnqueue"
+  endpoint {
+    name: "tpu.OutfeedEnqueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueueTuple.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueueTuple.pbtxt
new file mode 100644
index 00000000000..e4347fe0bcd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OutfeedEnqueueTuple.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "OutfeedEnqueueTuple"
+  endpoint {
+    name: "tpu.OutfeedEnqueueTuple"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Pack.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Pack.pbtxt
new file mode 100644
index 00000000000..2be5e46f791
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Pack.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Pack"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Pad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Pad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Pad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Pad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PadV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PadV2.pbtxt
new file mode 100644
index 00000000000..2462c556cf3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PadV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PadV2"
+  endpoint {
+    name: "Pad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddedBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddedBatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddedBatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddedBatchDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PaddedBatchDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddingFIFOQueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddingFIFOQueue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PaddingFIFOQueue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PaddingFIFOQueue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddingFIFOQueueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddingFIFOQueueV2.pbtxt
new file mode 100644
index 00000000000..d0b4a712ff8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PaddingFIFOQueueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PaddingFIFOQueueV2"
+  endpoint {
+    name: "io.PaddingFifoQueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelBatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelBatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelBatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelConcat.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelConcat.pbtxt
new file mode 100644
index 00000000000..cead44173d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelConcat.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParallelConcat"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelDynamicStitch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelDynamicStitch.pbtxt
new file mode 100644
index 00000000000..a8bebe9f4f5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelDynamicStitch.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParallelDynamicStitch"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelFilterDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelFilterDataset.pbtxt
new file mode 100644
index 00000000000..32e189b0963
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelFilterDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParallelFilterDataset"
+  endpoint {
+    name: "data.ParallelFilterDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV3.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV3.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV3.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV4.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelInterleaveDatasetV4.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV4.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelMapDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelMapDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParallelMapDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParameterizedTruncatedNormal.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParameterizedTruncatedNormal.pbtxt
new file mode 100644
index 00000000000..e271245d703
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParameterizedTruncatedNormal.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParameterizedTruncatedNormal"
+  endpoint {
+    name: "random.ParameterizedTruncatedNormal"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExample.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExample.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExample.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExampleDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExampleDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExampleDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseExampleDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleV2.pbtxt
new file mode 100644
index 00000000000..c78eb77249c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExampleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParseExampleV2"
+  endpoint {
+    name: "io.ParseExample"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseSequenceExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSequenceExample.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ParseSequenceExample.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSequenceExample.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSequenceExampleV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSequenceExampleV2.pbtxt
new file mode 100644
index 00000000000..3ce6e01560f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSequenceExampleV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParseSequenceExampleV2"
+  endpoint {
+    name: "io.ParseSequenceExample"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleExample.pbtxt
new file mode 100644
index 00000000000..d2dfdc20ea2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleExample.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParseSingleExample"
+  endpoint {
+    name: "io.ParseSingleExample"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleSequenceExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleSequenceExample.pbtxt
new file mode 100644
index 00000000000..2a83b9105e0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseSingleSequenceExample.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParseSingleSequenceExample"
+  endpoint {
+    name: "io.ParseSingleSequenceExample"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseTensor.pbtxt
new file mode 100644
index 00000000000..e8e5db934af
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ParseTensor"
+  endpoint {
+    name: "io.ParseTensor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PartitionedCall.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PartitionedCall.pbtxt
new file mode 100644
index 00000000000..268c519a8a7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PartitionedCall.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PartitionedCall"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Placeholder.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Placeholder.pbtxt
new file mode 100644
index 00000000000..2e83fe4d8f8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Placeholder.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Placeholder"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PlaceholderV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PlaceholderV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PlaceholderV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PlaceholderV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PlaceholderWithDefault.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PlaceholderWithDefault.pbtxt
new file mode 100644
index 00000000000..d20aff9cb92
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PlaceholderWithDefault.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PlaceholderWithDefault"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Polygamma.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Polygamma.pbtxt
new file mode 100644
index 00000000000..f81d95924f1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Polygamma.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Polygamma"
+  endpoint {
+    name: "math.Polygamma"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PopulationCount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PopulationCount.pbtxt
new file mode 100644
index 00000000000..840404a23d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PopulationCount.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PopulationCount"
+  endpoint {
+    name: "math.PopulationCount"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Pow.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Pow.pbtxt
new file mode 100644
index 00000000000..8657e4afb98
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Pow.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Pow"
+  endpoint {
+    name: "math.Pow"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrefetchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrefetchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrefetchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PrefetchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Prelinearize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Prelinearize.pbtxt
new file mode 100644
index 00000000000..71d98c0868f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Prelinearize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Prelinearize"
+  endpoint {
+    name: "tpu.Prelinearize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PrelinearizeTuple.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrelinearizeTuple.pbtxt
new file mode 100644
index 00000000000..59751130dfc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrelinearizeTuple.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PrelinearizeTuple"
+  endpoint {
+    name: "tpu.PrelinearizeTuple"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrependFromQueueAndPaddedBatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrependFromQueueAndPaddedBatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrependFromQueueAndPaddedBatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PrependFromQueueAndPaddedBatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PreventGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PreventGradient.pbtxt
new file mode 100644
index 00000000000..bafa0a5a739
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PreventGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PreventGradient"
+  endpoint {
+    name: "train.PreventGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Print.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Print.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Print.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Print.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PrintV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrintV2.pbtxt
new file mode 100644
index 00000000000..573751c55b8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrintV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PrintV2"
+  endpoint {
+    name: "Print"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PriorityQueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PriorityQueue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PriorityQueue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PriorityQueue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_PriorityQueueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PriorityQueueV2.pbtxt
new file mode 100644
index 00000000000..8bd3b0a04dc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_PriorityQueueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "PriorityQueueV2"
+  endpoint {
+    name: "io.PriorityQueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrivateThreadPoolDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PrivateThreadPoolDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PrivateThreadPoolDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PrivateThreadPoolDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Prod.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Prod.pbtxt
new file mode 100644
index 00000000000..d1c62ee4c7d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Prod.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Prod"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PyFunc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PyFunc.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PyFunc.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PyFunc.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PyFuncStateless.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_PyFuncStateless.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_PyFuncStateless.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_PyFuncStateless.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Qr.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Qr.pbtxt
new file mode 100644
index 00000000000..13b372131af
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Qr.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Qr"
+  endpoint {
+    name: "linalg.Qr"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantize.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantize.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantize.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizeAndDequantizeV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV3.pbtxt
new file mode 100644
index 00000000000..49b0b0d4878
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV3.pbtxt
@@ -0,0 +1,10 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizeAndDequantizeV3"
+  endpoint {
+    name: "quantization.QuantizeAndDequantizeV3"
+  }
+  endpoint {
+    name: "quantization.QuantizeAndDequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4.pbtxt
new file mode 100644
index 00000000000..4e9780f470c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizeAndDequantizeV4"
+  endpoint {
+    name: "quantization.QuantizeAndDequantizeV4"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4Grad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4Grad.pbtxt
new file mode 100644
index 00000000000..3c86a135f58
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeAndDequantizeV4Grad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizeAndDequantizeV4Grad"
+  endpoint {
+    name: "quantization.QuantizeAndDequantizeV4Grad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeDownAndShrinkRange.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeDownAndShrinkRange.pbtxt
new file mode 100644
index 00000000000..ac2dc64b29b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeDownAndShrinkRange.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizeDownAndShrinkRange"
+  endpoint {
+    name: "quantization.QuantizeDownAndShrinkRange"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeV2.pbtxt
new file mode 100644
index 00000000000..8dd0155b0cc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizeV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizeV2"
+  endpoint {
+    name: "quantization.Quantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAdd.pbtxt
new file mode 100644
index 00000000000..409160600a2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAdd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedAdd"
+  endpoint {
+    name: "math.QuantizedAdd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAvgPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAvgPool.pbtxt
new file mode 100644
index 00000000000..4f6112fd2d6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedAvgPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedAvgPool"
+  endpoint {
+    name: "nn.QuantizedAvgPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBatchNormWithGlobalNormalization.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBatchNormWithGlobalNormalization.pbtxt
new file mode 100644
index 00000000000..f83d5c2433a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBatchNormWithGlobalNormalization.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedBatchNormWithGlobalNormalization"
+  endpoint {
+    name: "nn.QuantizedBatchNormWithGlobalNormalization"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBiasAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBiasAdd.pbtxt
new file mode 100644
index 00000000000..42af03225d9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedBiasAdd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedBiasAdd"
+  endpoint {
+    name: "nn.QuantizedBiasAdd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcat.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcat.pbtxt
new file mode 100644
index 00000000000..6f494b440b1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcat.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConcat"
+  endpoint {
+    name: "quantization.QuantizedConcat"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizedConcatV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcatV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QuantizedConcatV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcatV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2D.pbtxt
new file mode 100644
index 00000000000..a6e20f4585d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2D"
+  endpoint {
+    name: "nn.QuantizedConv2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRelu.pbtxt
new file mode 100644
index 00000000000..11babc82e64
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DAndRelu"
+  endpoint {
+    name: "nn.QuantizedConv2DAndRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..69598eb29e7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DAndReluAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRequantize.pbtxt
new file mode 100644
index 00000000000..074c8bb81dc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DPerChannel.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DPerChannel.pbtxt
new file mode 100644
index 00000000000..8e0ad23bd42
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DPerChannel.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DPerChannel"
+  endpoint {
+    name: "nn.QuantizedConv2DPerChannel"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBias.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBias.pbtxt
new file mode 100644
index 00000000000..bfb35fd99ee
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBias.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBias"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBias"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRelu.pbtxt
new file mode 100644
index 00000000000..094b5484db9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasAndRelu"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasAndRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..45a9ae59f11
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasAndReluAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRequantize.pbtxt
new file mode 100644
index 00000000000..e2360686b4a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..16c15d1bcbb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndRelu.pbtxt
new file mode 100644
index 00000000000..210d5287924
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasSumAndRelu"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasSumAndRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..910800ac4f0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConv2DWithBiasSumAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedConv2DWithBiasSumAndReluAndRequantize"
+  endpoint {
+    name: "nn.QuantizedConv2DWithBiasSumAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2D.pbtxt
new file mode 100644
index 00000000000..cfcc863566b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedDepthwiseConv2D"
+  endpoint {
+    name: "nn.QuantizedDepthwiseConv2D"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBias.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBias.pbtxt
new file mode 100644
index 00000000000..961de7a11f7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBias.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedDepthwiseConv2DWithBias"
+  endpoint {
+    name: "nn.QuantizedDepthwiseConv2DWithBias"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndRelu.pbtxt
new file mode 100644
index 00000000000..4470675b660
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedDepthwiseConv2DWithBiasAndRelu"
+  endpoint {
+    name: "nn.QuantizedDepthwiseConv2DWithBiasAndRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..e2673935a16
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"
+  endpoint {
+    name: "nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedInstanceNorm.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedInstanceNorm.pbtxt
new file mode 100644
index 00000000000..52620d0f998
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedInstanceNorm.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedInstanceNorm"
+  endpoint {
+    name: "nn.QuantizedInstanceNorm"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMul.pbtxt
new file mode 100644
index 00000000000..40f0a5e788c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMul.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMul"
+  endpoint {
+    name: "linalg.QuantizedMatMul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBias.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBias.pbtxt
new file mode 100644
index 00000000000..65cd7780258
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBias.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMulWithBias"
+  endpoint {
+    name: "linalg.QuantizedMatMulWithBias"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndDequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndDequantize.pbtxt
new file mode 100644
index 00000000000..2c47dfba1b0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndDequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMulWithBiasAndDequantize"
+  endpoint {
+    name: "quantization.QuantizedMatMulWithBiasAndDequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRelu.pbtxt
new file mode 100644
index 00000000000..9f7d19c4203
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMulWithBiasAndRelu"
+  endpoint {
+    name: "linalg.QuantizedMatMulWithBiasAndRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndReluAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndReluAndRequantize.pbtxt
new file mode 100644
index 00000000000..548eeb7b9ef
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndReluAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMulWithBiasAndReluAndRequantize"
+  endpoint {
+    name: "linalg.QuantizedMatMulWithBiasAndReluAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRequantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRequantize.pbtxt
new file mode 100644
index 00000000000..24994b5662f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMatMulWithBiasAndRequantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMatMulWithBiasAndRequantize"
+  endpoint {
+    name: "quantization.QuantizedMatMulWithBiasAndRequantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMaxPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMaxPool.pbtxt
new file mode 100644
index 00000000000..40f6f65c9b1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMaxPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMaxPool"
+  endpoint {
+    name: "nn.QuantizedMaxPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMul.pbtxt
new file mode 100644
index 00000000000..6b14b69beb5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedMul.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedMul"
+  endpoint {
+    name: "math.QuantizedMul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu.pbtxt
new file mode 100644
index 00000000000..8e1b314e688
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedRelu"
+  endpoint {
+    name: "nn.QuantizedRelu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu6.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu6.pbtxt
new file mode 100644
index 00000000000..f5230201707
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedRelu6.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedRelu6"
+  endpoint {
+    name: "nn.QuantizedRelu6"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReluX.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReluX.pbtxt
new file mode 100644
index 00000000000..a52915868d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReluX.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedReluX"
+  endpoint {
+    name: "nn.QuantizedReluX"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReshape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReshape.pbtxt
new file mode 100644
index 00000000000..f2049b9f380
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedReshape.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedReshape"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedResizeBilinear.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedResizeBilinear.pbtxt
new file mode 100644
index 00000000000..28191a12de9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedResizeBilinear.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QuantizedResizeBilinear"
+  endpoint {
+    name: "image.QuantizedResizeBilinear"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueClose.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueClose.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueClose.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueClose.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueCloseV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueCloseV2.pbtxt
new file mode 100644
index 00000000000..08c2af13ab5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueCloseV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueCloseV2"
+  endpoint {
+    name: "io.QueueClose"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeueMany.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueMany.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeueMany.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueMany.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueManyV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueManyV2.pbtxt
new file mode 100644
index 00000000000..e0cdf5ce764
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueManyV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueDequeueManyV2"
+  endpoint {
+    name: "io.QueueDequeueMany"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeueUpTo.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueUpTo.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueDequeueUpTo.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueUpTo.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueUpToV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueUpToV2.pbtxt
new file mode 100644
index 00000000000..715b614ccda
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueUpToV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueDequeueUpToV2"
+  endpoint {
+    name: "io.QueueDequeueUpTo"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueV2.pbtxt
new file mode 100644
index 00000000000..670a81b09c6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueDequeueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueDequeueV2"
+  endpoint {
+    name: "io.QueueDequeue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueEnqueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueEnqueue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueEnqueueMany.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueMany.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueEnqueueMany.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueMany.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueManyV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueManyV2.pbtxt
new file mode 100644
index 00000000000..8f08727b990
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueManyV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueEnqueueManyV2"
+  endpoint {
+    name: "io.QueueEnqueueMany"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueV2.pbtxt
new file mode 100644
index 00000000000..56700dbe62d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueEnqueueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueEnqueueV2"
+  endpoint {
+    name: "io.QueueEnqueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueIsClosed.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueIsClosed.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueIsClosed.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueIsClosed.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueIsClosedV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueIsClosedV2.pbtxt
new file mode 100644
index 00000000000..e3c27b82fe8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueIsClosedV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueIsClosedV2"
+  endpoint {
+    name: "io.QueueIsClosed"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueSize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueSize.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_QueueSize.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_QueueSize.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueSizeV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueSizeV2.pbtxt
new file mode 100644
index 00000000000..f352e15e0c7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QueueSizeV2.pbtxt
@@ -0,0 +1,11 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "QueueSizeV2"
+  endpoint {
+    name: "io.QueueSize"
+  }
+  out_arg {
+    name: "size"
+    rename_to: "output"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT.pbtxt
new file mode 100644
index 00000000000..708de1951ae
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RFFT"
+  endpoint {
+    name: "signal.Rfft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT2D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT2D.pbtxt
new file mode 100644
index 00000000000..8488c65b5d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT2D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RFFT2D"
+  endpoint {
+    name: "signal.Rfft2d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT3D.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT3D.pbtxt
new file mode 100644
index 00000000000..09218cd6296
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFT3D.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RFFT3D"
+  endpoint {
+    name: "signal.Rfft3d"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFTND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFTND.pbtxt
new file mode 100644
index 00000000000..4b46e0f0d31
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RFFTND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RFFTND"
+  endpoint {
+    name: "signal.RfftNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RGBToHSV.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RGBToHSV.pbtxt
new file mode 100644
index 00000000000..2172f52405b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RGBToHSV.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RGBToHSV"
+  endpoint {
+    name: "image.RgbToHsv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedBincount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedBincount.pbtxt
new file mode 100644
index 00000000000..632be33d30d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedBincount.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedBincount"
+  endpoint {
+    name: "ragged.RaggedBincount"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCountSparseOutput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCountSparseOutput.pbtxt
new file mode 100644
index 00000000000..e74b9bd9d0a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCountSparseOutput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedCountSparseOutput"
+  endpoint {
+    name: "ragged.RaggedCountSparseOutput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCross.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCross.pbtxt
new file mode 100644
index 00000000000..7da3096c7ef
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedCross.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedCross"
+  endpoint {
+    name: "ragged.RaggedCross"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRows.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRows.pbtxt
new file mode 100644
index 00000000000..5f135f87e74
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRows.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedFillEmptyRows"
+  endpoint {
+    name: "ragged.RaggedFillEmptyRows"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRowsGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRowsGrad.pbtxt
new file mode 100644
index 00000000000..5f8f1790f32
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedFillEmptyRowsGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedFillEmptyRowsGrad"
+  endpoint {
+    name: "ragged.RaggedFillEmptyRowsGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedGather.pbtxt
new file mode 100644
index 00000000000..10da3a31954
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedGather.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedGather"
+  endpoint {
+    name: "ragged.RaggedGather"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedRange.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedRange.pbtxt
new file mode 100644
index 00000000000..6ec658b61fe
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedRange.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedRange"
+  endpoint {
+    name: "ragged.RaggedRange"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorFromVariant.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorFromVariant.pbtxt
new file mode 100644
index 00000000000..2067148bde1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorFromVariant.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedTensorFromVariant"
+  endpoint {
+    name: "ragged.RaggedTensorFromVariant"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToSparse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToSparse.pbtxt
new file mode 100644
index 00000000000..c6d61a22606
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToSparse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedTensorToSparse"
+  endpoint {
+    name: "ragged.RaggedTensorToSparse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToTensor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToTensor.pbtxt
new file mode 100644
index 00000000000..2bae8ad3de2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToTensor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedTensorToTensor"
+  endpoint {
+    name: "ragged.RaggedTensorToTensor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariant.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariant.pbtxt
new file mode 100644
index 00000000000..3e4b2029a1b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariant.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedTensorToVariant"
+  endpoint {
+    name: "ragged.RaggedTensorToVariant"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariantGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariantGradient.pbtxt
new file mode 100644
index 00000000000..a09acd4debd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RaggedTensorToVariantGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RaggedTensorToVariantGradient"
+  endpoint {
+    name: "ragged.RaggedTensorToVariantGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomCrop.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomCrop.pbtxt
new file mode 100644
index 00000000000..be299f2ed38
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomCrop.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomCrop"
+  endpoint {
+    name: "image.RandomCrop"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDataset.pbtxt
new file mode 100644
index 00000000000..6c64c2b8818
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDataset.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "RandomDataset"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDatasetV2.pbtxt
new file mode 100644
index 00000000000..77231322675
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomDatasetV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "RandomDatasetV2"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.RandomDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGamma.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGamma.pbtxt
new file mode 100644
index 00000000000..c8fbfbf0134
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGamma.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomGamma"
+  endpoint {
+    name: "random.RandomGamma"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGammaGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGammaGrad.pbtxt
new file mode 100644
index 00000000000..6d0b3466690
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomGammaGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomGammaGrad"
+  endpoint {
+    name: "random.RandomGammaGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomIndexShuffle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomIndexShuffle.pbtxt
new file mode 100644
index 00000000000..0af6f3e5b1e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomIndexShuffle.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomIndexShuffle"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RandomPoisson.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomPoisson.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RandomPoisson.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RandomPoisson.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomPoissonV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomPoissonV2.pbtxt
new file mode 100644
index 00000000000..09bdecdaa10
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomPoissonV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomPoissonV2"
+  endpoint {
+    name: "random.RandomPoisson"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffle.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffle.pbtxt
new file mode 100644
index 00000000000..5d0d7a3b680
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffle.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomShuffle"
+  endpoint {
+    name: "random.RandomShuffle"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RandomShuffleQueue.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffleQueue.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RandomShuffleQueue.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffleQueue.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffleQueueV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffleQueueV2.pbtxt
new file mode 100644
index 00000000000..4dd84fac74d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomShuffleQueueV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomShuffleQueueV2"
+  endpoint {
+    name: "io.RandomShuffleQueue"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomStandardNormal.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomStandardNormal.pbtxt
new file mode 100644
index 00000000000..5ac99b9005b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomStandardNormal.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomStandardNormal"
+  endpoint {
+    name: "random.RandomStandardNormal"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniform.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniform.pbtxt
new file mode 100644
index 00000000000..bdec5ac99d7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniform.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomUniform"
+  endpoint {
+    name: "random.RandomUniform"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniformInt.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniformInt.pbtxt
new file mode 100644
index 00000000000..4102517f3de
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RandomUniformInt.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RandomUniformInt"
+  endpoint {
+    name: "random.RandomUniformInt"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Range.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Range.pbtxt
new file mode 100644
index 00000000000..dbda35b7374
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Range.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Range"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RangeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RangeDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RangeDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RangeDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Rank.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rank.pbtxt
new file mode 100644
index 00000000000..dc306a7ae56
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rank.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Rank"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadFile.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadFile.pbtxt
new file mode 100644
index 00000000000..8d2c022f428
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadFile.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReadFile"
+  endpoint {
+    name: "io.ReadFile"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableOp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableOp.pbtxt
new file mode 100644
index 00000000000..7f053e301a6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableOp.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReadVariableOp"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableXlaSplitND.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableXlaSplitND.pbtxt
new file mode 100644
index 00000000000..5d6bfb45373
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReadVariableXlaSplitND.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReadVariableXlaSplitND"
+  endpoint {
+    name: "xla.ReadVariableSplitND"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderNumRecordsProduced.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumRecordsProduced.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderNumRecordsProduced.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumRecordsProduced.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumRecordsProducedV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumRecordsProducedV2.pbtxt
new file mode 100644
index 00000000000..13578bcba83
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumRecordsProducedV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderNumRecordsProducedV2"
+  endpoint {
+    name: "io.ReaderNumRecordsProduced"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderNumWorkUnitsCompleted.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumWorkUnitsCompleted.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderNumWorkUnitsCompleted.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumWorkUnitsCompleted.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumWorkUnitsCompletedV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumWorkUnitsCompletedV2.pbtxt
new file mode 100644
index 00000000000..1a72c3be10a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderNumWorkUnitsCompletedV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderNumWorkUnitsCompletedV2"
+  endpoint {
+    name: "io.ReaderNumWorkUnitsCompleted"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderRead.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRead.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderRead.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRead.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderReadUpTo.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadUpTo.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderReadUpTo.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadUpTo.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadUpToV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadUpToV2.pbtxt
new file mode 100644
index 00000000000..06a316fbb70
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadUpToV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderReadUpToV2"
+  endpoint {
+    name: "io.ReaderReadUpTo"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadV2.pbtxt
new file mode 100644
index 00000000000..64bd40cdde8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReadV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderReadV2"
+  endpoint {
+    name: "io.ReaderRead"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderReset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderReset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderReset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderResetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderResetV2.pbtxt
new file mode 100644
index 00000000000..05bd5c48bc3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderResetV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderResetV2"
+  endpoint {
+    name: "io.ReaderReset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderRestoreState.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRestoreState.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderRestoreState.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRestoreState.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRestoreStateV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRestoreStateV2.pbtxt
new file mode 100644
index 00000000000..c53c47ff372
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderRestoreStateV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderRestoreStateV2"
+  endpoint {
+    name: "io.ReaderRestoreState"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderSerializeState.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderSerializeState.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReaderSerializeState.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderSerializeState.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderSerializeStateV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderSerializeStateV2.pbtxt
new file mode 100644
index 00000000000..ec18d3c71b6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReaderSerializeStateV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReaderSerializeStateV2"
+  endpoint {
+    name: "io.ReaderSerializeState"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Real.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Real.pbtxt
new file mode 100644
index 00000000000..3ddd3bc902a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Real.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Real"
+  endpoint {
+    name: "math.Real"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RealDiv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RealDiv.pbtxt
new file mode 100644
index 00000000000..366c95f2566
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RealDiv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RealDiv"
+  endpoint {
+    name: "math.RealDiv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDatasetV2.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RebatchDatasetV2.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RebatchDatasetV2.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Reciprocal.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Reciprocal.pbtxt
new file mode 100644
index 00000000000..bb6956bbe3c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Reciprocal.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Reciprocal"
+  endpoint {
+    name: "math.Reciprocal"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReciprocalGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReciprocalGrad.pbtxt
new file mode 100644
index 00000000000..57cc8c630e1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReciprocalGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReciprocalGrad"
+  endpoint {
+    name: "math.ReciprocalGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RecordInput.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RecordInput.pbtxt
new file mode 100644
index 00000000000..bf8836b3d81
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RecordInput.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RecordInput"
+  endpoint {
+    name: "random.RecordInput"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Recv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Recv.pbtxt
new file mode 100644
index 00000000000..6ba56fa3392
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Recv.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Recv"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RecvTPUEmbeddingActivations.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RecvTPUEmbeddingActivations.pbtxt
new file mode 100644
index 00000000000..05ce63f87aa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RecvTPUEmbeddingActivations.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RecvTPUEmbeddingActivations"
+  endpoint {
+    name: "tpu.RecvTPUEmbeddingActivations"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReduceDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ReduceDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceJoin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceJoin.pbtxt
new file mode 100644
index 00000000000..bb2b90169a1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReduceJoin.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReduceJoin"
+  endpoint {
+    name: "strings.ReduceJoin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefEnter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefEnter.pbtxt
new file mode 100644
index 00000000000..886f9cc3436
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefEnter.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefEnter"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefExit.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefExit.pbtxt
new file mode 100644
index 00000000000..1495c957912
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefExit.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefExit"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefIdentity.pbtxt
new file mode 100644
index 00000000000..013b3bcce61
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefIdentity.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefIdentity"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefMerge.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefMerge.pbtxt
new file mode 100644
index 00000000000..97599f361be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefMerge.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefMerge"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefNextIteration.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefNextIteration.pbtxt
new file mode 100644
index 00000000000..0b94ec2d5d0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefNextIteration.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefNextIteration"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSelect.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSelect.pbtxt
new file mode 100644
index 00000000000..dc135b3cc98
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSelect.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefSelect"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSwitch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSwitch.pbtxt
new file mode 100644
index 00000000000..abccabbf444
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RefSwitch.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RefSwitch"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexFullMatch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexFullMatch.pbtxt
new file mode 100644
index 00000000000..ed0a0765b5c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexFullMatch.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RegexFullMatch"
+  endpoint {
+    name: "strings.RegexFullMatch"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexReplace.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexReplace.pbtxt
new file mode 100644
index 00000000000..a2987dba302
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegexReplace.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RegexReplace"
+  endpoint {
+    name: "strings.RegexReplace"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDataset.pbtxt
new file mode 100644
index 00000000000..03947c43e92
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDataset.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "RegisterDataset"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDatasetV2.pbtxt
new file mode 100644
index 00000000000..b44314327a5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RegisterDatasetV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "RegisterDatasetV2"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.RegisterDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Relayout.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relayout.pbtxt
new file mode 100644
index 00000000000..50f3036cc78
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relayout.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Relayout"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RelayoutLike.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RelayoutLike.pbtxt
new file mode 100644
index 00000000000..b83aaf0cf61
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RelayoutLike.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RelayoutLike"
+  endpoint {
+    name: "RelayoutLike"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu.pbtxt
new file mode 100644
index 00000000000..87e110a0739
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Relu"
+  endpoint {
+    name: "nn.Relu"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6.pbtxt
new file mode 100644
index 00000000000..c1dc6c6d205
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Relu6"
+  endpoint {
+    name: "nn.Relu6"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6Grad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6Grad.pbtxt
new file mode 100644
index 00000000000..bb4621ffb5b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Relu6Grad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Relu6Grad"
+  endpoint {
+    name: "nn.Relu6Grad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReluGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReluGrad.pbtxt
new file mode 100644
index 00000000000..7830ad371d6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReluGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReluGrad"
+  endpoint {
+    name: "nn.ReluGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteCall.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteCall.pbtxt
new file mode 100644
index 00000000000..b2f13cc48b9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteCall.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RemoteCall"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteFusedGraphExecute.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteFusedGraphExecute.pbtxt
new file mode 100644
index 00000000000..c30673aa76e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RemoteFusedGraphExecute.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RemoteFusedGraphExecute"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RepeatDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RepeatDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RepeatDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RepeatDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRange.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRange.pbtxt
new file mode 100644
index 00000000000..81e17cf420d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRange.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RequantizationRange"
+  endpoint {
+    name: "quantization.RequantizationRange"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRangePerChannel.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRangePerChannel.pbtxt
new file mode 100644
index 00000000000..2073052bfe9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizationRangePerChannel.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RequantizationRangePerChannel"
+  endpoint {
+    name: "math.RequantizationRangePerChannel"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Requantize.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Requantize.pbtxt
new file mode 100644
index 00000000000..c771cef0746
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Requantize.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Requantize"
+  endpoint {
+    name: "quantization.Requantize"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizePerChannel.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizePerChannel.pbtxt
new file mode 100644
index 00000000000..2539fbe9528
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RequantizePerChannel.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RequantizePerChannel"
+  endpoint {
+    name: "math.RequantizePerChannel"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Reshape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Reshape.pbtxt
new file mode 100644
index 00000000000..bd628df6d68
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Reshape.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Reshape"
+  endpoint {
+    name: "Reshape"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeArea.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeArea.pbtxt
new file mode 100644
index 00000000000..2514478bc1e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeArea.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeArea"
+  endpoint {
+    name: "image.ResizeArea"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubic.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubic.pbtxt
new file mode 100644
index 00000000000..669b0889911
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubic.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeBicubic"
+  endpoint {
+    name: "image.ResizeBicubic"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubicGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubicGrad.pbtxt
new file mode 100644
index 00000000000..63478567394
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBicubicGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeBicubicGrad"
+  endpoint {
+    name: "image.ResizeBicubicGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinear.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinear.pbtxt
new file mode 100644
index 00000000000..42bc9578c0b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinear.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeBilinear"
+  endpoint {
+    name: "image.ResizeBilinear"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinearGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinearGrad.pbtxt
new file mode 100644
index 00000000000..88bccdf83ca
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeBilinearGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeBilinearGrad"
+  endpoint {
+    name: "image.ResizeBilinearGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighbor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighbor.pbtxt
new file mode 100644
index 00000000000..84f8e26218d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighbor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeNearestNeighbor"
+  endpoint {
+    name: "image.ResizeNearestNeighbor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighborGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighborGrad.pbtxt
new file mode 100644
index 00000000000..2b5ce61b1cf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResizeNearestNeighborGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResizeNearestNeighborGrad"
+  endpoint {
+    name: "image.ResizeNearestNeighborGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorApplyGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorApplyGradient.pbtxt
new file mode 100644
index 00000000000..2463e311f36
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorApplyGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceAccumulatorApplyGradient"
+  endpoint {
+    name: "train.ResourceAccumulatorApplyGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorNumAccumulated.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorNumAccumulated.pbtxt
new file mode 100644
index 00000000000..414247dc55b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorNumAccumulated.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceAccumulatorNumAccumulated"
+  endpoint {
+    name: "train.ResourceAccumulatorNumAccumulated"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorSetGlobalStep.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorSetGlobalStep.pbtxt
new file mode 100644
index 00000000000..02083395b15
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorSetGlobalStep.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceAccumulatorSetGlobalStep"
+  endpoint {
+    name: "train.ResourceAccumulatorSetGlobalStep"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorTakeGradient.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorTakeGradient.pbtxt
new file mode 100644
index 00000000000..7d7fbd9c9ba
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceAccumulatorTakeGradient.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceAccumulatorTakeGradient"
+  endpoint {
+    name: "train.ResourceAccumulatorTakeGradient"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdaMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdaMax.pbtxt
new file mode 100644
index 00000000000..cbe0abd7fd2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdaMax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdaMax"
+  endpoint {
+    name: "train.ResourceApplyAdaMax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdadelta.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdadelta.pbtxt
new file mode 100644
index 00000000000..11ea32f0474
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdadelta.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdadelta"
+  endpoint {
+    name: "train.ResourceApplyAdadelta"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceApplyAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagrad.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceApplyAdagrad.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagrad.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradDA.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradDA.pbtxt
new file mode 100644
index 00000000000..7de1a78a3e7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradDA.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdagradDA"
+  endpoint {
+    name: "train.ResourceApplyAdagradDa"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradV2.pbtxt
new file mode 100644
index 00000000000..4b2cdf69a9b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdagradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdagradV2"
+  endpoint {
+    name: "train.ResourceApplyAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdam.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdam.pbtxt
new file mode 100644
index 00000000000..13b9b145b78
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdam.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdam"
+  endpoint {
+    name: "train.ResourceApplyAdam"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdamWithAmsgrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdamWithAmsgrad.pbtxt
new file mode 100644
index 00000000000..3afb7a28c5c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAdamWithAmsgrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAdamWithAmsgrad"
+  endpoint {
+    name: "train.ResourceApplyAdamWithAmsgrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAddSign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAddSign.pbtxt
new file mode 100644
index 00000000000..8e57cf8d4c9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyAddSign.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyAddSign"
+  endpoint {
+    name: "train.ResourceApplyAddSign"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyCenteredRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyCenteredRMSProp.pbtxt
new file mode 100644
index 00000000000..5bc55386fb3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyCenteredRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyCenteredRMSProp"
+  endpoint {
+    name: "train.ResourceApplyCenteredRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceApplyFtrl.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyFtrl.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceApplyFtrl.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyFtrl.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyFtrlV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyFtrlV2.pbtxt
new file mode 100644
index 00000000000..db4e93ed80e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyFtrlV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyFtrlV2"
+  endpoint {
+    name: "train.ResourceApplyFtrl"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyGradientDescent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyGradientDescent.pbtxt
new file mode 100644
index 00000000000..48a55a96cc1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyGradientDescent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyGradientDescent"
+  endpoint {
+    name: "train.ResourceApplyGradientDescent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyKerasMomentum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyKerasMomentum.pbtxt
new file mode 100644
index 00000000000..35b88fc8869
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyKerasMomentum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyKerasMomentum"
+  endpoint {
+    name: "train.ResourceApplyKerasMomentum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyMomentum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyMomentum.pbtxt
new file mode 100644
index 00000000000..ea88f416f0f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyMomentum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyMomentum"
+  endpoint {
+    name: "train.ResourceApplyMomentum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyPowerSign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyPowerSign.pbtxt
new file mode 100644
index 00000000000..c2a67f1fee3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyPowerSign.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyPowerSign"
+  endpoint {
+    name: "train.ResourceApplyPowerSign"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalAdagrad.pbtxt
new file mode 100644
index 00000000000..c022658a317
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalAdagrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyProximalAdagrad"
+  endpoint {
+    name: "train.ResourceApplyProximalAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalGradientDescent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalGradientDescent.pbtxt
new file mode 100644
index 00000000000..a209ab6a065
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyProximalGradientDescent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyProximalGradientDescent"
+  endpoint {
+    name: "train.ResourceApplyProximalGradientDescent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyRMSProp.pbtxt
new file mode 100644
index 00000000000..7e5a287fbdf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceApplyRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceApplyRMSProp"
+  endpoint {
+    name: "train.ResourceApplyRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceConditionalAccumulator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceConditionalAccumulator.pbtxt
new file mode 100644
index 00000000000..9b23eb1891c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceConditionalAccumulator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceConditionalAccumulator"
+  endpoint {
+    name: "train.ResourceConditionalAccumulator"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceCountUpTo.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceCountUpTo.pbtxt
new file mode 100644
index 00000000000..4c1309f160d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceCountUpTo.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceCountUpTo"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGather.pbtxt
new file mode 100644
index 00000000000..a9b829ebd04
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGather.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceGather"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGatherNd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGatherNd.pbtxt
new file mode 100644
index 00000000000..ec282febc2b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceGatherNd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceGatherNd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterAdd.pbtxt
new file mode 100644
index 00000000000..33b6d9c67d6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterDiv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterDiv.pbtxt
new file mode 100644
index 00000000000..b32181fde11
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterDiv.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterDiv"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMax.pbtxt
new file mode 100644
index 00000000000..e758222d6ed
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMax.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterMax"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMin.pbtxt
new file mode 100644
index 00000000000..bce335396b4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMin.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterMin"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMul.pbtxt
new file mode 100644
index 00000000000..4740ed6669c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterMul.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterMul"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdAdd.pbtxt
new file mode 100644
index 00000000000..29e9541aac8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterNdAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMax.pbtxt
new file mode 100644
index 00000000000..2b2382e88b7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMax.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterNdMax"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMin.pbtxt
new file mode 100644
index 00000000000..bad7c7741b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdMin.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterNdMin"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdSub.pbtxt
new file mode 100644
index 00000000000..5dad023a56a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterNdSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdUpdate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdUpdate.pbtxt
new file mode 100644
index 00000000000..72d079bef41
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterNdUpdate.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterNdUpdate"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterSub.pbtxt
new file mode 100644
index 00000000000..ca9e5fa6a25
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterUpdate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterUpdate.pbtxt
new file mode 100644
index 00000000000..bd850c7bcd2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceScatterUpdate.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceScatterUpdate"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdadelta.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdadelta.pbtxt
new file mode 100644
index 00000000000..7614ee61566
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdadelta.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyAdadelta"
+  endpoint {
+    name: "train.ResourceSparseApplyAdadelta"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagrad.pbtxt
new file mode 100644
index 00000000000..3acd27409f1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyAdagrad"
+  endpoint {
+    name: "train.ResourceSparseApplyAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradDA.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradDA.pbtxt
new file mode 100644
index 00000000000..dff8e161d04
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradDA.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyAdagradDA"
+  endpoint {
+    name: "train.ResourceSparseApplyAdagradDa"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradV2.pbtxt
new file mode 100644
index 00000000000..f86922242c7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyAdagradV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyAdagradV2"
+  endpoint {
+    name: "train.ResourceSparseApplyAdagradV2"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyCenteredRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyCenteredRMSProp.pbtxt
new file mode 100644
index 00000000000..0f402d6bb96
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyCenteredRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyCenteredRMSProp"
+  endpoint {
+    name: "train.ResourceSparseApplyCenteredRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceSparseApplyFtrl.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyFtrl.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ResourceSparseApplyFtrl.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyFtrl.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyFtrlV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyFtrlV2.pbtxt
new file mode 100644
index 00000000000..553da2bcb6f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyFtrlV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyFtrlV2"
+  endpoint {
+    name: "train.ResourceSparseApplyFtrl"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyKerasMomentum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyKerasMomentum.pbtxt
new file mode 100644
index 00000000000..8c39775ba83
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyKerasMomentum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyKerasMomentum"
+  endpoint {
+    name: "train.ResourceSparseApplyKerasMomentum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyMomentum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyMomentum.pbtxt
new file mode 100644
index 00000000000..d165cf2f94e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyMomentum.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyMomentum"
+  endpoint {
+    name: "train.ResourceSparseApplyMomentum"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalAdagrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalAdagrad.pbtxt
new file mode 100644
index 00000000000..a97d3c5d608
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalAdagrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyProximalAdagrad"
+  endpoint {
+    name: "train.ResourceSparseApplyProximalAdagrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalGradientDescent.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalGradientDescent.pbtxt
new file mode 100644
index 00000000000..69db57fbc14
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyProximalGradientDescent.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyProximalGradientDescent"
+  endpoint {
+    name: "train.ResourceSparseApplyProximalGradientDescent"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyRMSProp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyRMSProp.pbtxt
new file mode 100644
index 00000000000..3cac8411190
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceSparseApplyRMSProp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceSparseApplyRMSProp"
+  endpoint {
+    name: "train.ResourceSparseApplyRmsProp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceStridedSliceAssign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceStridedSliceAssign.pbtxt
new file mode 100644
index 00000000000..bf142658402
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ResourceStridedSliceAssign.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ResourceStridedSliceAssign"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Restore.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Restore.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Restore.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Restore.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreSlice.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreSlice.pbtxt
new file mode 100644
index 00000000000..d49abdc2abf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreSlice.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RestoreSlice"
+  endpoint {
+    name: "train.RestoreSlice"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreV2.pbtxt
new file mode 100644
index 00000000000..f73221177e7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RestoreV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RestoreV2"
+  endpoint {
+    name: "train.Restore"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveAllTPUEmbeddingParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveAllTPUEmbeddingParameters.pbtxt
new file mode 100644
index 00000000000..0918a4bbd71
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveAllTPUEmbeddingParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveAllTPUEmbeddingParameters"
+  endpoint {
+    name: "tpu.RetrieveAllTPUEmbeddingParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParameters.pbtxt
new file mode 100644
index 00000000000..6fa45ac4709
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingADAMParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingADAMParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
index c185287ab80..19024de237a 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingADAMParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingADAMParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingADAMParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParameters.pbtxt
new file mode 100644
index 00000000000..608071b458b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingAdadeltaParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingAdadeltaParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
index 3e4226d1e29..ce7f843c0d3 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradMomentumParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradMomentumParameters.pbtxt
new file mode 100644
index 00000000000..c086360d4fb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradMomentumParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingAdagradMomentumParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingAdagradMomentumParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParameters.pbtxt
new file mode 100644
index 00000000000..2829ab63f30
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingAdagradParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingAdagradParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
index 5c0d7d42f0e..08a26da1fc2 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingCenteredRMSPropParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingCenteredRMSPropParameters.pbtxt
new file mode 100644
index 00000000000..b339631e163
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingCenteredRMSPropParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingCenteredRMSPropParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParameters.pbtxt
new file mode 100644
index 00000000000..de9f9931616
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingFTRLParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingFTRLParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
similarity index 87%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
index b5ce64d483d..57b3e0e2e28 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParameters.pbtxt
new file mode 100644
index 00000000000..a30b2e979d9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingFrequencyEstimatorParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingFrequencyEstimatorParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..eff5462872f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMDLAdagradLightParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMDLAdagradLightParameters.pbtxt
new file mode 100644
index 00000000000..c4320af9050
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMDLAdagradLightParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingMDLAdagradLightParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParameters.pbtxt
new file mode 100644
index 00000000000..cae7612c2b2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingMomentumParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingMomentumParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
index fdcd930b1c9..c3d1eea0d1d 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParameters.pbtxt
new file mode 100644
index 00000000000..a6a7b7d8582
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingProximalAdagradParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingProximalAdagradParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
similarity index 89%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
index 16b7e25975d..8f0cba646fd 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParameters.pbtxt
new file mode 100644
index 00000000000..3e516888ec3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingProximalYogiParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingProximalYogiParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
index a04bed75d87..26a810e8794 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParameters.pbtxt
new file mode 100644
index 00000000000..03b991ee6b4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingRMSPropParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingRMSPropParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
similarity index 88%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
index 5eb9017d4d2..2a873e27fc3 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParameters.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParameters.pbtxt
new file mode 100644
index 00000000000..a0377103d49
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParameters.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RetrieveTPUEmbeddingStochasticGradientDescentParameters"
+  endpoint {
+    name: "tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
similarity index 90%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
index 6d476f70bd5..71758e43589 100644
--- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
@@ -1,4 +1,5 @@
 op {
+  visibility: VISIBLE
   graph_op_name: "RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"
   endpoint {
     name: "tpu.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Reverse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Reverse.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Reverse.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Reverse.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseSequence.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseSequence.pbtxt
new file mode 100644
index 00000000000..f0e6bd4a1cc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseSequence.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReverseSequence"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseV2.pbtxt
new file mode 100644
index 00000000000..c286316354f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ReverseV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ReverseV2"
+  endpoint {
+    name: "Reverse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RewriteDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RewriteDataset.pbtxt
new file mode 100644
index 00000000000..cd73223372b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RewriteDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RewriteDataset"
+  endpoint {
+    name: "data.RewriteDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RightShift.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RightShift.pbtxt
new file mode 100644
index 00000000000..8f6889fd4d5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RightShift.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RightShift"
+  endpoint {
+    name: "bitwise.RightShift"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Rint.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rint.pbtxt
new file mode 100644
index 00000000000..0bf2aa48f28
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rint.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Rint"
+  endpoint {
+    name: "math.Rint"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAbs.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAbs.pbtxt
new file mode 100644
index 00000000000..16a02df71a8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAbs.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscAbs"
+  endpoint {
+    name: "risc.RiscAbs"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAdd.pbtxt
new file mode 100644
index 00000000000..db1cafd86b1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscAdd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscAdd"
+  endpoint {
+    name: "risc.RiscAdd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryArithmetic.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryArithmetic.pbtxt
new file mode 100644
index 00000000000..a6b0d3849d9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryArithmetic.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscBinaryArithmetic"
+  endpoint {
+    name: "risc.RiscBinaryArithmetic"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryComparison.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryComparison.pbtxt
new file mode 100644
index 00000000000..b278cdb19b5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBinaryComparison.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscBinaryComparison"
+  endpoint {
+    name: "risc.RiscBinaryComparison"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBitcast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBitcast.pbtxt
new file mode 100644
index 00000000000..3576ea43316
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBitcast.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscBitcast"
+  endpoint {
+    name: "risc.RiscBitcast"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBroadcast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBroadcast.pbtxt
new file mode 100644
index 00000000000..70f651c5595
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscBroadcast.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscBroadcast"
+  endpoint {
+    name: "risc.RiscBroadcast"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCast.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCast.pbtxt
new file mode 100644
index 00000000000..03d2dddb2a7
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCast.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscCast"
+  endpoint {
+    name: "risc.RiscCast"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCeil.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCeil.pbtxt
new file mode 100644
index 00000000000..7cc1796e649
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCeil.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscCeil"
+  endpoint {
+    name: "risc.RiscCeil"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCholesky.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCholesky.pbtxt
new file mode 100644
index 00000000000..f58e0969b02
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCholesky.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscCholesky"
+  endpoint {
+    name: "risc.RiscCholesky"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConcat.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConcat.pbtxt
new file mode 100644
index 00000000000..e5aad1d665c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConcat.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscConcat"
+  endpoint {
+    name: "risc.RiscConcat"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCondition.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCondition.pbtxt
new file mode 100644
index 00000000000..20b4043192e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCondition.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscCondition"
+  endpoint {
+    name: "risc.RiscCondition"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConv.pbtxt
new file mode 100644
index 00000000000..3b85466aad8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscConv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscConv"
+  endpoint {
+    name: "risc.RiscConv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCos.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCos.pbtxt
new file mode 100644
index 00000000000..bd0bd4faa20
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscCos.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscCos"
+  endpoint {
+    name: "risc.RiscCos"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDiv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDiv.pbtxt
new file mode 100644
index 00000000000..62752229c2b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDiv.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscDiv"
+  endpoint {
+    name: "risc.RiscDiv"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDot.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDot.pbtxt
new file mode 100644
index 00000000000..884d0093f49
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscDot.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscDot"
+  endpoint {
+    name: "risc.RiscDot"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscExp.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscExp.pbtxt
new file mode 100644
index 00000000000..a0f735e9812
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscExp.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscExp"
+  endpoint {
+    name: "risc.RiscExp"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFft.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFft.pbtxt
new file mode 100644
index 00000000000..7939ade66d4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFft.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscFft"
+  endpoint {
+    name: "risc.RiscFft"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFloor.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFloor.pbtxt
new file mode 100644
index 00000000000..4bbf58f30be
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscFloor.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscFloor"
+  endpoint {
+    name: "risc.RiscFloor"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscGather.pbtxt
new file mode 100644
index 00000000000..65e03eabd05
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscGather.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscGather"
+  endpoint {
+    name: "risc.RiscGather"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscImag.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscImag.pbtxt
new file mode 100644
index 00000000000..c8473b54de1
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscImag.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscImag"
+  endpoint {
+    name: "risc.RiscImag"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscIsFinite.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscIsFinite.pbtxt
new file mode 100644
index 00000000000..9155259eba0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscIsFinite.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscIsFinite"
+  endpoint {
+    name: "risc.RiscIsFinite"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLog.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLog.pbtxt
new file mode 100644
index 00000000000..c8e1afe2a75
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLog.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscLog"
+  endpoint {
+    name: "risc.RiscLog"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalAnd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalAnd.pbtxt
new file mode 100644
index 00000000000..bc2d5b1f9eb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalAnd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscLogicalAnd"
+  endpoint {
+    name: "risc.RiscLogicalAnd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalNot.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalNot.pbtxt
new file mode 100644
index 00000000000..c4743d410b3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalNot.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscLogicalNot"
+  endpoint {
+    name: "risc.RiscLogicalNot"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalOr.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalOr.pbtxt
new file mode 100644
index 00000000000..f23f059b514
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscLogicalOr.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscLogicalOr"
+  endpoint {
+    name: "risc.RiscLogicalOr"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMax.pbtxt
new file mode 100644
index 00000000000..06d25cbc86a
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMax.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscMax"
+  endpoint {
+    name: "risc.RiscMax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMin.pbtxt
new file mode 100644
index 00000000000..309d515d6fd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMin.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscMin"
+  endpoint {
+    name: "risc.RiscMin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMul.pbtxt
new file mode 100644
index 00000000000..51927d3a135
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscMul.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscMul"
+  endpoint {
+    name: "risc.RiscMul"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscNeg.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscNeg.pbtxt
new file mode 100644
index 00000000000..0e0dd0ea4b0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscNeg.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscNeg"
+  endpoint {
+    name: "risc.RiscNeg"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPad.pbtxt
new file mode 100644
index 00000000000..0e3d478d02b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscPad"
+  endpoint {
+    name: "risc.RiscPad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPool.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPool.pbtxt
new file mode 100644
index 00000000000..74cd28a15fd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPool.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscPool"
+  endpoint {
+    name: "risc.RiscPool"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPow.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPow.pbtxt
new file mode 100644
index 00000000000..2565bd11555
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscPow.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscPow"
+  endpoint {
+    name: "risc.RiscPow"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRandomUniform.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRandomUniform.pbtxt
new file mode 100644
index 00000000000..942c4bec622
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRandomUniform.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscRandomUniform"
+  endpoint {
+    name: "risc.RiscRandomUniform"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReal.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReal.pbtxt
new file mode 100644
index 00000000000..5d24d2ad837
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReal.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscReal"
+  endpoint {
+    name: "risc.RiscReal"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReduce.pbtxt
new file mode 100644
index 00000000000..bc9b20496e5
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReduce.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscReduce"
+  endpoint {
+    name: "risc.RiscReduce"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRem.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRem.pbtxt
new file mode 100644
index 00000000000..22de8c713ea
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscRem.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscRem"
+  endpoint {
+    name: "risc.RiscRem"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReshape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReshape.pbtxt
new file mode 100644
index 00000000000..fd3bacbd2d6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReshape.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscReshape"
+  endpoint {
+    name: "risc.RiscReshape"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReverse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReverse.pbtxt
new file mode 100644
index 00000000000..ee8e646e4b9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscReverse.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscReverse"
+  endpoint {
+    name: "risc.RiscReverse"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscScatter.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscScatter.pbtxt
new file mode 100644
index 00000000000..dabe270375d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscScatter.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscScatter"
+  endpoint {
+    name: "risc.RiscScatter"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscShape.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscShape.pbtxt
new file mode 100644
index 00000000000..83666efcdf6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscShape.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscShape"
+  endpoint {
+    name: "risc.RiscShape"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSign.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSign.pbtxt
new file mode 100644
index 00000000000..2cc5dfc378c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSign.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscSign"
+  endpoint {
+    name: "risc.RiscSign"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSlice.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSlice.pbtxt
new file mode 100644
index 00000000000..ecb7b991196
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSlice.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscSlice"
+  endpoint {
+    name: "risc.RiscSlice"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSort.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSort.pbtxt
new file mode 100644
index 00000000000..3361401d336
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSort.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscSort"
+  endpoint {
+    name: "risc.RiscSort"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSqueeze.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSqueeze.pbtxt
new file mode 100644
index 00000000000..5b9b50d209e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSqueeze.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscSqueeze"
+  endpoint {
+    name: "risc.RiscSqueeze"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSub.pbtxt
new file mode 100644
index 00000000000..ea48b182d22
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscSub.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscSub"
+  endpoint {
+    name: "risc.RiscSub"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTranspose.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTranspose.pbtxt
new file mode 100644
index 00000000000..f2d3e739b50
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTranspose.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscTranspose"
+  endpoint {
+    name: "risc.RiscTranspose"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTriangularSolve.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTriangularSolve.pbtxt
new file mode 100644
index 00000000000..70b4fbdeed4
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscTriangularSolve.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscTriangularSolve"
+  endpoint {
+    name: "risc.RiscTriangularSolve"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscUnary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscUnary.pbtxt
new file mode 100644
index 00000000000..d1d03367c05
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscUnary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscUnary"
+  endpoint {
+    name: "risc.RiscUnary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscWhile.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscWhile.pbtxt
new file mode 100644
index 00000000000..745b47cdfab
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RiscWhile.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: SKIP
+  graph_op_name: "RiscWhile"
+  endpoint {
+    name: "risc.RiscWhile"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RngReadAndSkip.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RngReadAndSkip.pbtxt
new file mode 100644
index 00000000000..8603fa95988
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RngReadAndSkip.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RngReadAndSkip"
+  endpoint {
+    name: "random.RngReadAndSkip"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RngSkip.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RngSkip.pbtxt
new file mode 100644
index 00000000000..9074f38c5da
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RngSkip.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RngSkip"
+  endpoint {
+    name: "random.RngSkip"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Roll.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Roll.pbtxt
new file mode 100644
index 00000000000..fe4eed9ab13
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Roll.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Roll"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Round.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Round.pbtxt
new file mode 100644
index 00000000000..960ffba508f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Round.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Round"
+  endpoint {
+    name: "math.Round"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Rpc.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rpc.pbtxt
new file mode 100644
index 00000000000..528afe26709
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rpc.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Rpc"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_Rsqrt.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rsqrt.pbtxt
new file mode 100644
index 00000000000..97165e2d758
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Rsqrt.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "Rsqrt"
+  endpoint {
+    name: "math.Rsqrt"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_RsqrtGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RsqrtGrad.pbtxt
new file mode 100644
index 00000000000..8aa9f02b9bc
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RsqrtGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "RsqrtGrad"
+  endpoint {
+    name: "math.RsqrtGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SampleDistortedBoundingBox.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SampleDistortedBoundingBox.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SampleDistortedBoundingBox.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_SampleDistortedBoundingBox.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SampleDistortedBoundingBoxV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SampleDistortedBoundingBoxV2.pbtxt
new file mode 100644
index 00000000000..0aef133b9e6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SampleDistortedBoundingBoxV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SampleDistortedBoundingBoxV2"
+  endpoint {
+    name: "image.SampleDistortedBoundingBox"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SamplingDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SamplingDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SamplingDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_SamplingDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Save.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Save.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_Save.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_Save.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDataset.pbtxt
new file mode 100644
index 00000000000..8c4d87ac61c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDataset.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SaveDataset"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDatasetV2.pbtxt
new file mode 100644
index 00000000000..a0723dc3d7b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveDatasetV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "SaveDatasetV2"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.SaveDataset"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveSlices.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveSlices.pbtxt
new file mode 100644
index 00000000000..33af2108dd0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveSlices.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SaveSlices"
+  endpoint {
+    name: "train.SaveSlices"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveV2.pbtxt
new file mode 100644
index 00000000000..0fc943f3540
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SaveV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SaveV2"
+  endpoint {
+    name: "train.Save"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScalarSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScalarSummary.pbtxt
new file mode 100644
index 00000000000..7b6f6129353
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScalarSummary.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScalarSummary"
+  endpoint {
+    name: "summary.ScalarSummary"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslate.pbtxt
new file mode 100644
index 00000000000..25364907a30
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslate.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScaleAndTranslate"
+  endpoint {
+    name: "image.ScaleAndTranslate"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslateGrad.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslateGrad.pbtxt
new file mode 100644
index 00000000000..e3256e0f704
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScaleAndTranslateGrad.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScaleAndTranslateGrad"
+  endpoint {
+    name: "image.ScaleAndTranslateGrad"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ScanDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScanDataset.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_ScanDataset.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_ScanDataset.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterAdd.pbtxt
new file mode 100644
index 00000000000..74492ab813b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterDiv.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterDiv.pbtxt
new file mode 100644
index 00000000000..97252d64db3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterDiv.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterDiv"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMax.pbtxt
new file mode 100644
index 00000000000..5217cb1f668
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMax.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterMax"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMin.pbtxt
new file mode 100644
index 00000000000..c082832265c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMin.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterMin"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMul.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMul.pbtxt
new file mode 100644
index 00000000000..4d284a527c2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterMul.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterMul"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNd.pbtxt
new file mode 100644
index 00000000000..5d5308a7444
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNd.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNd"
+  endpoint {
+    name: "ScatterNd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdAdd.pbtxt
new file mode 100644
index 00000000000..61d9acdd48c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMax.pbtxt
new file mode 100644
index 00000000000..617c639add6
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMax.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdMax"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMin.pbtxt
new file mode 100644
index 00000000000..53d6754e0e3
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdMin.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdMin"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdNonAliasingAdd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdNonAliasingAdd.pbtxt
new file mode 100644
index 00000000000..98baca56e19
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdNonAliasingAdd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdNonAliasingAdd"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdSub.pbtxt
new file mode 100644
index 00000000000..867227b1507
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdUpdate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdUpdate.pbtxt
new file mode 100644
index 00000000000..2c4432c9ed0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterNdUpdate.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterNdUpdate"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterSub.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterSub.pbtxt
new file mode 100644
index 00000000000..25a2e9519fa
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterSub.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterSub"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterUpdate.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterUpdate.pbtxt
new file mode 100644
index 00000000000..cfcff646652
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ScatterUpdate.pbtxt
@@ -0,0 +1,4 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "ScatterUpdate"
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaFprint.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaFprint.pbtxt
new file mode 100644
index 00000000000..19725ee76d2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaFprint.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SdcaFprint"
+  endpoint {
+    name: "train.SdcaFprint"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SdcaOptimizer.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaOptimizer.pbtxt
similarity index 100%
rename from tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_SdcaOptimizer.pbtxt
rename to tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaOptimizer.pbtxt
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaOptimizerV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaOptimizerV2.pbtxt
new file mode 100644
index 00000000000..b67c06a7069
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaOptimizerV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SdcaOptimizerV2"
+  endpoint {
+    name: "train.SdcaOptimizer"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaShrinkL1.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaShrinkL1.pbtxt
new file mode 100644
index 00000000000..b65cd2a92c0
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SdcaShrinkL1.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SdcaShrinkL1"
+  endpoint {
+    name: "train.SdcaShrinkL1"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMax.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMax.pbtxt
new file mode 100644
index 00000000000..b3ba099ebef
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMax.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SegmentMax"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMaxV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMaxV2.pbtxt
new file mode 100644
index 00000000000..58d1cce4a47
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMaxV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SegmentMaxV2"
+  endpoint {
+    name: "math.SegmentMax"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMean.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMean.pbtxt
new file mode 100644
index 00000000000..78a64153e26
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMean.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SegmentMean"
+  endpoint {
+    name: "math.SegmentMean"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMin.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMin.pbtxt
new file mode 100644
index 00000000000..33dafd9c445
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMin.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SegmentMin"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMinV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMinV2.pbtxt
new file mode 100644
index 00000000000..8d3c1ea4bdd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentMinV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SegmentMinV2"
+  endpoint {
+    name: "math.SegmentMin"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProd.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProd.pbtxt
new file mode 100644
index 00000000000..c813c7c1457
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProd.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SegmentProd"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProdV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProdV2.pbtxt
new file mode 100644
index 00000000000..6ed9d2bf402
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentProdV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SegmentProdV2"
+  endpoint {
+    name: "math.SegmentProd"
+  }
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSum.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSum.pbtxt
new file mode 100644
index 00000000000..091d5892796
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSum.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SegmentSum"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt
new file mode 100644
index 00000000000..4478e3a5fb8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_SegmentSumV2.pbtxt
@@ -0,0 +1,21 @@
+op {
+  visibility: VISIBLE
+  graph_op_name: "SegmentSumV2"
+  endpoint {
+    name: "math.SegmentSum"
+  }
+  description: <
* - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseAnd} output and operands * @return a new instance of BitwiseAnd */ @@ -91,9 +90,8 @@ public BitwiseAnd bitwiseAnd(Operand x, Operand y) * tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE *
* - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseOr} output and operands * @return a new instance of BitwiseOr */ @@ -121,9 +119,8 @@ public BitwiseOr bitwiseOr(Operand x, Operand y) { * tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE * * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseXor} output and operands * @return a new instance of BitwiseXor */ @@ -172,8 +169,7 @@ public BitwiseXor bitwiseXor(Operand x, Operand y) * tf.assert_equal(tf.cast(inverted, tf.float32), tf.cast(expected, tf.float32)) * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Invert} output and operands * @return a new instance of Invert */ @@ -212,9 +208,8 @@ public Invert invert(Operand x) { * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> * * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code LeftShift} output and operands * @return a new instance of LeftShift */ @@ -255,9 +250,8 @@ public LeftShift leftShift(Operand x, Operand y) { * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> * * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code RightShift} output and operands * @return a new instance of RightShift */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ClusterOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ClusterOps.java new file mode 100644 index 00000000000..e59e86f23ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ClusterOps.java @@ -0,0 +1,85 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.cluster.KMC2ChainInitialization; +import org.tensorflow.op.cluster.KmeansPlusPlusInitialization; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt64; + +/** + * An API for building {@code cluster} operations as {@link Op Op}s + * + * @see Ops + */ +public final class ClusterOps { + private final Scope scope; + + private final Ops ops; + + ClusterOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Returns the index of a data point that should be added to the seed set. + * Entries in distances are assumed to be squared distances of candidate points to + * the already sampled centers in the seed set. The op constructs one Markov chain + * of the k-MC^2 algorithm and returns the index of one candidate point to be added + * as an additional cluster center. + * + * @param distances Vector with squared distances to the closest previously sampled cluster center + * for each candidate point. + * @param seed Scalar. Seed for initializing the random number generator. + * @return a new instance of KMC2ChainInitialization + */ + public KMC2ChainInitialization kMC2ChainInitialization(Operand distances, + Operand seed) { + return KMC2ChainInitialization.create(scope, distances, seed); + } + + /** + * Selects num_to_sample rows of input using the KMeans++ criterion. + * Rows of points are assumed to be input points. One row is selected at random. + * Subsequent rows are sampled with probability proportional to the squared L2 + * distance from the nearest row selected thus far till num_to_sample rows have + * been sampled. + * + * @param points Matrix of shape (n, d). Rows are assumed to be input points. + * @param numToSample Scalar. The number of rows to sample. This value must not be larger than n. + * @param seed Scalar. Seed for initializing the random number generator. + * @param numRetriesPerSample Scalar. For each row that is sampled, this parameter + * specifies the number of additional points to draw from the current + * distribution before selecting the best. If a negative value is specified, a + * heuristic is used to sample O(log(num_to_sample)) additional points. + * @return a new instance of KmeansPlusPlusInitialization + */ + public KmeansPlusPlusInitialization kmeansPlusPlusInitialization(Operand points, + Operand numToSample, Operand seed, Operand numRetriesPerSample) { + return KmeansPlusPlusInitialization.create(scope, points, numToSample, seed, numRetriesPerSample); + } + + /** + * 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/CollectiveOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/CollectiveOps.java new file mode 100644 index 00000000000..de786dc95fe --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/CollectiveOps.java @@ -0,0 +1,214 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.collective.CollectiveAllToAll; +import org.tensorflow.op.collective.CollectiveAssignGroup; +import org.tensorflow.op.collective.CollectiveBcastRecv; +import org.tensorflow.op.collective.CollectiveBcastSend; +import org.tensorflow.op.collective.CollectiveGather; +import org.tensorflow.op.collective.CollectiveInitializeCommunicator; +import org.tensorflow.op.collective.CollectivePermute; +import org.tensorflow.op.collective.CollectiveReduce; +import org.tensorflow.op.collective.CollectiveReduceScatter; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code collective} operations as {@link Op Op}s + * + * @see Ops + */ +public final class CollectiveOps { + private final Scope scope; + + private final Ops ops; + + CollectiveOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Mutually exchanges multiple tensors of identical type and shape. + * + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param options carries optional attribute values + * @param data type for {@code CollectiveAllToAllV3} output and operands + * @return a new instance of CollectiveAllToAll + */ + public CollectiveAllToAll collectiveAllToAll(Operand input, + Operand communicator, Operand groupAssignment, + CollectiveAllToAll.Options... options) { + return CollectiveAllToAll.create(scope, input, communicator, groupAssignment, options); + } + + /** + * Assign group keys based on group assignment. + * + * @param groupAssignment The groupAssignment value + * @param deviceIndex The deviceIndex value + * @param baseKey The baseKey value + * @return a new instance of CollectiveAssignGroup + */ + public CollectiveAssignGroup collectiveAssignGroup(Operand groupAssignment, + Operand deviceIndex, Operand baseKey) { + return CollectiveAssignGroup.create(scope, groupAssignment, deviceIndex, baseKey); + } + + /** + * Receives a tensor value broadcast from another device. + * + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param shape The shape value + * @param T The value of the T attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastRecvV2} output and operands + * @return a new instance of CollectiveBcastRecv + */ + public CollectiveBcastRecv collectiveBcastRecv(Operand groupSize, + Operand groupKey, Operand instanceKey, Operand shape, + Class T, CollectiveBcastRecv.Options... options) { + return CollectiveBcastRecv.create(scope, groupSize, groupKey, instanceKey, shape, T, options); + } + + /** + * Broadcasts a tensor value to one or more other devices. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastSendV2} output and operands + * @return a new instance of CollectiveBcastSend + */ + public CollectiveBcastSend collectiveBcastSend(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + CollectiveBcastSend.Options... options) { + return CollectiveBcastSend.create(scope, input, groupSize, groupKey, instanceKey, options); + } + + /** + * Mutually accumulates multiple tensors of identical type and shape. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param options carries optional attribute values + * @param data type for {@code CollectiveGatherV2} output and operands + * @return a new instance of CollectiveGather + */ + public CollectiveGather collectiveGather(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, CollectiveGather.Options... options) { + return CollectiveGather.create(scope, input, groupSize, groupKey, instanceKey, orderingToken, options); + } + + /** + * Initializes a group for collective operations. + * + * @param groupKey The groupKey value + * @param rank The rank value + * @param groupSize The groupSize value + * @param options carries optional attribute values + * @return a new instance of CollectiveInitializeCommunicator + */ + public CollectiveInitializeCommunicator collectiveInitializeCommunicator(Operand groupKey, + Operand rank, Operand groupSize, + CollectiveInitializeCommunicator.Options... options) { + return CollectiveInitializeCommunicator.create(scope, groupKey, rank, groupSize, options); + } + + /** + * An Op to permute tensors across replicated TPU instances. + * Each instance supplies its own input. + *

For example, suppose there are 4 TPU instances: {@code [A, B, C, D]}. Passing + * source_target_pairs={@code [[0,1],[1,2],[2,3],[3,0]]} gets the outputs: + * {@code [D, A, B, C]}. + * + * @param input The local input to be permuted. Currently only supports float and + * bfloat16. + * @param sourceTargetPairs A tensor with shape [num_pairs, 2]. + * @param data type for {@code CollectivePermute} output and operands + * @return a new instance of CollectivePermute + */ + public CollectivePermute collectivePermute(Operand input, + Operand sourceTargetPairs) { + return CollectivePermute.create(scope, input, sourceTargetPairs); + } + + /** + * Mutually reduces multiple tensors of identical type and shape. + * + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param reduction The value of the reduction attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceV3} output and operands + * @return a new instance of CollectiveReduce + */ + public CollectiveReduce collectiveReduce(Operand input, + Operand communicator, Operand groupAssignment, String reduction, + CollectiveReduce.Options... options) { + return CollectiveReduce.create(scope, input, communicator, groupAssignment, reduction, options); + } + + /** + * Mutually reduces multiple tensors of identical type and shape and scatters the result. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param mergeOp The value of the mergeOp attribute + * @param finalOp The value of the finalOp attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceScatterV2} output and operands + * @return a new instance of CollectiveReduceScatter + */ + public CollectiveReduceScatter collectiveReduceScatter(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, String mergeOp, String finalOp, + CollectiveReduceScatter.Options... options) { + return CollectiveReduceScatter.create(scope, input, groupSize, groupKey, instanceKey, orderingToken, mergeOp, finalOp, 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/DataExperimentalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataExperimentalOps.java new file mode 100644 index 00000000000..4fa8e60e295 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataExperimentalOps.java @@ -0,0 +1,738 @@ +// Copyright 2020-2022 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.ConcreteFunction; +import org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.data.experimental.AssertNextDataset; +import org.tensorflow.op.data.experimental.AutoShardDataset; +import org.tensorflow.op.data.experimental.BytesProducedStatsDataset; +import org.tensorflow.op.data.experimental.CSVDataset; +import org.tensorflow.op.data.experimental.ChooseFastestDataset; +import org.tensorflow.op.data.experimental.DatasetCardinality; +import org.tensorflow.op.data.experimental.DatasetToTFRecord; +import org.tensorflow.op.data.experimental.DenseToSparseBatchDataset; +import org.tensorflow.op.data.experimental.DirectedInterleaveDataset; +import org.tensorflow.op.data.experimental.GroupByReducerDataset; +import org.tensorflow.op.data.experimental.GroupByWindowDataset; +import org.tensorflow.op.data.experimental.IgnoreErrorsDataset; +import org.tensorflow.op.data.experimental.IteratorGetDevice; +import org.tensorflow.op.data.experimental.LatencyStatsDataset; +import org.tensorflow.op.data.experimental.LmdbDataset; +import org.tensorflow.op.data.experimental.MapAndBatchDataset; +import org.tensorflow.op.data.experimental.MapDataset; +import org.tensorflow.op.data.experimental.MatchingFilesDataset; +import org.tensorflow.op.data.experimental.MaxIntraOpParallelismDataset; +import org.tensorflow.op.data.experimental.NonSerializableDataset; +import org.tensorflow.op.data.experimental.ParallelInterleaveDataset; +import org.tensorflow.op.data.experimental.ParseExampleDataset; +import org.tensorflow.op.data.experimental.PrivateThreadPoolDataset; +import org.tensorflow.op.data.experimental.RandomDataset; +import org.tensorflow.op.data.experimental.RebatchDataset; +import org.tensorflow.op.data.experimental.ScanDataset; +import org.tensorflow.op.data.experimental.SetStatsAggregatorDataset; +import org.tensorflow.op.data.experimental.SleepDataset; +import org.tensorflow.op.data.experimental.SlidingWindowDataset; +import org.tensorflow.op.data.experimental.SqlDataset; +import org.tensorflow.op.data.experimental.StatsAggregatorHandle; +import org.tensorflow.op.data.experimental.StatsAggregatorSummary; +import org.tensorflow.op.data.experimental.TakeWhileDataset; +import org.tensorflow.op.data.experimental.ThreadPoolDataset; +import org.tensorflow.op.data.experimental.ThreadPoolHandle; +import org.tensorflow.op.data.experimental.UnbatchDataset; +import org.tensorflow.op.data.experimental.UniqueDataset; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code data.experimental} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DataExperimentalOps { + private final Scope scope; + + private final Ops ops; + + DataExperimentalOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * The ExperimentalAssertNextDataset operation + * + * @param inputDataset The inputDataset value + * @param transformations The transformations value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertNextDataset + */ + public AssertNextDataset assertNextDataset(Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + return AssertNextDataset.create(scope, inputDataset, transformations, outputTypes, outputShapes); + } + + /** + * Creates a dataset that shards the input dataset. + * Creates a dataset that shards the input dataset by num_workers, returning a + * sharded dataset for the index-th worker. This attempts to automatically shard + * a dataset by examining the Dataset graph and inserting a shard op before the + * inputs to a reader Dataset (e.g. CSVDataset, TFRecordDataset). + *

This dataset will throw a NotFound error if we cannot shard the dataset + * automatically. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param numWorkers A scalar representing the number of workers to distribute this dataset across. + * @param index A scalar representing the index of the current worker out of num_workers. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of AutoShardDataset + */ + public AutoShardDataset autoShardDataset(Operand inputDataset, + Operand numWorkers, Operand index, List> outputTypes, + List outputShapes, AutoShardDataset.Options... options) { + return AutoShardDataset.create(scope, inputDataset, numWorkers, index, outputTypes, outputShapes, options); + } + + /** + * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. + * + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of BytesProducedStatsDataset + */ + public BytesProducedStatsDataset bytesProducedStatsDataset(Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + return BytesProducedStatsDataset.create(scope, inputDataset, tag, outputTypes, outputShapes); + } + + /** + * The ExperimentalCSVDataset operation + * + * @param filenames The filenames value + * @param compressionType The compressionType value + * @param bufferSize The bufferSize value + * @param header The header value + * @param fieldDelim The fieldDelim value + * @param useQuoteDelim The useQuoteDelim value + * @param naValue The naValue value + * @param selectCols The selectCols value + * @param recordDefaults The recordDefaults value + * @param outputShapes The value of the outputShapes attribute + * @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); + } + + /** + * The ExperimentalChooseFastestDataset operation + * + * @param inputDatasets The inputDatasets value + * @param numExperiments The value of the numExperiments attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ChooseFastestDataset + */ + public ChooseFastestDataset chooseFastestDataset(Iterable> inputDatasets, + Long numExperiments, List> outputTypes, List outputShapes) { + return ChooseFastestDataset.create(scope, inputDatasets, numExperiments, outputTypes, outputShapes); + } + + /** + * Returns the cardinality of {@code input_dataset}. + * Returns the cardinality of {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return cardinality for. + * @return a new instance of DatasetCardinality + */ + public DatasetCardinality datasetCardinality(Operand inputDataset) { + return DatasetCardinality.create(scope, inputDataset); + } + + /** + * Writes the given dataset to the given file using the TFRecord format. + * + * @param inputDataset A variant tensor representing the dataset to write. + * @param filename A scalar string tensor representing the filename to use. + * @param compressionType A scalar string tensor containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return a new instance of DatasetToTFRecord + */ + public DatasetToTFRecord datasetToTFRecord(Operand inputDataset, + Operand filename, Operand compressionType) { + return DatasetToTFRecord.create(scope, inputDataset, filename, compressionType); + } + + /** + * Creates a dataset that batches input elements into a SparseTensor. + * + * @param inputDataset A handle to an input dataset. Must have a single component. + * @param batchSize A scalar representing the number of elements to accumulate in a + * batch. + * @param rowShape A vector representing the dense shape of each row in the produced + * SparseTensor. The shape may be partially specified, using {@code -1} to indicate + * that a particular dimension should use the maximum size of all batch elements. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of DenseToSparseBatchDataset + */ + public DenseToSparseBatchDataset denseToSparseBatchDataset(Operand inputDataset, + Operand batchSize, Operand rowShape, List> outputTypes, + List outputShapes) { + return DenseToSparseBatchDataset.create(scope, inputDataset, batchSize, rowShape, outputTypes, outputShapes); + } + + /** + * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. + * + * @param selectorInputDataset A dataset of scalar {@code DT_INT64} elements that determines which of the + * {@code N} data inputs should produce the next output element. + * @param dataInputDatasets {@code N} datasets with the same type that will be interleaved according to + * the values of {@code selector_input_dataset}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of DirectedInterleaveDataset + */ + public DirectedInterleaveDataset directedInterleaveDataset( + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes) { + return DirectedInterleaveDataset.create(scope, selectorInputDataset, dataInputDatasets, outputTypes, outputShapes); + } + + /** + * Creates a dataset that computes a group-by on {@code input_dataset}. + * Creates a dataset that computes a group-by on {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param keyFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code key_func}. + * @param initFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code init_func}. + * @param reduceFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code reduce_func}. + * @param finalizeFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code finalize_func}. + * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated + * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. + * @param initFunc A function mapping a key of type DT_INT64, concatenated with + * {@code init_func_other_arguments} to the initial reducer state. + * @param reduceFunc A function mapping the current reducer state and an element of {@code input_dataset}, + * concatenated with {@code reduce_func_other_arguments} to a new reducer state. + * @param finalizeFunc A function mapping the final reducer state to an output element. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of GroupByReducerDataset + */ + public GroupByReducerDataset groupByReducerDataset(Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> initFuncOtherArguments, + Iterable> reduceFuncOtherArguments, + Iterable> finalizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction initFunc, ConcreteFunction reduceFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes) { + return GroupByReducerDataset.create(scope, inputDataset, keyFuncOtherArguments, initFuncOtherArguments, reduceFuncOtherArguments, finalizeFuncOtherArguments, keyFunc, initFunc, reduceFunc, finalizeFunc, outputTypes, outputShapes); + } + + /** + * Creates a dataset that computes a windowed group-by on {@code input_dataset}. + * // TODO(mrry): Support non-int64 keys. + * + * @param inputDataset The inputDataset value + * @param keyFuncOtherArguments The keyFuncOtherArguments value + * @param reduceFuncOtherArguments The reduceFuncOtherArguments value + * @param windowSizeFuncOtherArguments The windowSizeFuncOtherArguments value + * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated + * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. + * @param reduceFunc The value of the reduceFunc attribute + * @param windowSizeFunc The value of the windowSizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of GroupByWindowDataset + */ + public GroupByWindowDataset groupByWindowDataset(Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, + Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, + List> outputTypes, List outputShapes) { + return GroupByWindowDataset.create(scope, inputDataset, keyFuncOtherArguments, reduceFuncOtherArguments, windowSizeFuncOtherArguments, keyFunc, reduceFunc, windowSizeFunc, outputTypes, outputShapes); + } + + /** + * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of IgnoreErrorsDataset + */ + public IgnoreErrorsDataset ignoreErrorsDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + IgnoreErrorsDataset.Options... options) { + return IgnoreErrorsDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * Returns the name of the device on which {@code resource} has been placed. + * + * @param resource The resource value + * @return a new instance of IteratorGetDevice + */ + public IteratorGetDevice iteratorGetDevice(Operand resource) { + return IteratorGetDevice.create(scope, resource); + } + + /** + * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. + * + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of LatencyStatsDataset + */ + public LatencyStatsDataset latencyStatsDataset(Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + return LatencyStatsDataset.create(scope, inputDataset, tag, outputTypes, outputShapes); + } + + /** + * The ExperimentalLMDBDataset operation + * + * @param filenames The filenames value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of LmdbDataset + */ + public LmdbDataset lmdbDataset(Operand filenames, + List> outputTypes, List outputShapes) { + return LmdbDataset.create(scope, filenames, outputTypes, outputShapes); + } + + /** + * Creates a dataset that fuses mapping with batching. + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset} and then + * batches {@code batch_size} of them. + *

Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up + * to {@code batch_size * num_parallel_batches} copies of {@code f} in parallel. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param otherArguments A list of tensors, typically values that were captured when building a closure + * for {@code f}. + * @param batchSize A scalar representing the number of elements to accumulate in a + * batch. It determines the number of concurrent invocations of {@code f} that process + * elements from {@code input_dataset} in parallel. + * @param numParallelCalls A scalar representing the maximum number of parallel invocations of the {@code map_fn} + * function. Applying the {@code map_fn} on consecutive input elements in parallel has + * the potential to improve input pipeline throughput. + * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + * @param f A function to apply to the outputs of {@code input_dataset}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of MapAndBatchDataset + */ + public MapAndBatchDataset mapAndBatchDataset(Operand inputDataset, + Iterable> otherArguments, Operand batchSize, + Operand numParallelCalls, Operand dropRemainder, ConcreteFunction f, + List> outputTypes, List outputShapes, + MapAndBatchDataset.Options... options) { + return MapAndBatchDataset.create(scope, inputDataset, otherArguments, batchSize, numParallelCalls, dropRemainder, f, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of MapDataset + */ + public MapDataset mapDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, + MapDataset.Options... options) { + return MapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes, options); + } + + /** + * The ExperimentalMatchingFilesDataset operation + * + * @param patterns The patterns value + * @return a new instance of MatchingFilesDataset + */ + public MatchingFilesDataset matchingFilesDataset(Operand patterns) { + return MatchingFilesDataset.create(scope, patterns); + } + + /** + * Creates a dataset that overrides the maximum intra-op parallelism. + * + * @param inputDataset The inputDataset value + * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of MaxIntraOpParallelismDataset + */ + public MaxIntraOpParallelismDataset maxIntraOpParallelismDataset( + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { + return MaxIntraOpParallelismDataset.create(scope, inputDataset, maxIntraOpParallelism, outputTypes, outputShapes); + } + + /** + * The ExperimentalNonSerializableDataset operation + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of NonSerializableDataset + */ + public NonSerializableDataset nonSerializableDataset(Operand inputDataset, + List> outputTypes, List outputShapes) { + return NonSerializableDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * The resulting dataset is similar to the {@code InterleaveDataset}, with the exception + * that if retrieving the next value from a dataset would cause the requester to + * block, it will skip that input dataset. This dataset is especially useful + * when loading data from a variable-latency datastores (e.g. HDFS, GCS), as it + * allows the training step to proceed so long as some data is available. + *

!! WARNING !! This dataset is not deterministic! + * + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value + * @param sloppy The sloppy value + * @param bufferOutputElements The bufferOutputElements value + * @param prefetchInputElements The prefetchInputElements value + * @param f A function mapping elements of {@code input_dataset}, concatenated with + * {@code other_arguments}, to a Dataset variant that contains elements matching + * {@code output_types} and {@code output_shapes}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ParallelInterleaveDataset + */ + public ParallelInterleaveDataset parallelInterleaveDataset(Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + Operand sloppy, Operand bufferOutputElements, + Operand prefetchInputElements, ConcreteFunction f, + List> outputTypes, List outputShapes) { + return ParallelInterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, sloppy, bufferOutputElements, prefetchInputElements, f, outputTypes, outputShapes); + } + + /** + * Transforms {@code input_dataset} containing {@code Example} protos as vectors of DT_STRING into a dataset of {@code Tensor} or {@code SparseTensor} objects representing the parsed features. + * + * @param inputDataset The inputDataset value + * @param numParallelCalls The numParallelCalls value + * @param denseDefaults A dict mapping string keys to {@code Tensor}s. + * The keys of the dict must match the dense_keys of the feature. + * @param sparseKeys A list of string keys in the examples features. + * The results for these keys will be returned as {@code SparseTensor} objects. + * @param denseKeys A list of Ndense string Tensors (scalars). + * The keys expected in the Examples features associated with dense values. + * @param sparseTypes A list of {@code DTypes} of the same length as {@code sparse_keys}. + * Only {@code tf.float32} ({@code FloatList}), {@code tf.int64} ({@code Int64List}), + * and {@code tf.string} ({@code BytesList}) are supported. + * @param denseShapes List of tuples with the same length as {@code dense_keys}. + * The shape of the data for each dense feature referenced by {@code dense_keys}. + * Required for any input tensors identified by {@code dense_keys}. Must be + * either fully defined, or may contain an unknown first dimension. + * An unknown first dimension means the feature is treated as having + * a variable number of blocks, and the output shape along this dimension + * is considered unknown at graph build time. Padding is applied for + * minibatch elements smaller than the maximum number of blocks for the + * given feature along this dimension. + * @param outputTypes The type list for the return values. + * @param outputShapes The list of shapes being produced. + * @param options carries optional attribute values + * @return a new instance of ParseExampleDataset + */ + public ParseExampleDataset parseExampleDataset(Operand inputDataset, + Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes, + List> outputTypes, List outputShapes, + ParseExampleDataset.Options... options) { + return ParseExampleDataset.create(scope, inputDataset, numParallelCalls, denseDefaults, sparseKeys, denseKeys, sparseTypes, denseShapes, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param numThreads Identifies the number of threads to use for the private threadpool. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of PrivateThreadPoolDataset + */ + public PrivateThreadPoolDataset privateThreadPoolDataset(Operand inputDataset, + Operand numThreads, List> outputTypes, + List outputShapes) { + return PrivateThreadPoolDataset.create(scope, inputDataset, numThreads, outputTypes, outputShapes); + } + + /** + * Creates a Dataset that returns pseudorandom numbers. + * + * @param seed A scalar seed for the random number generator. If either seed or + * seed2 is set to be non-zero, the random number generator is seeded + * by the given seed. Otherwise, a random seed is used. + * @param seed2 A second scalar seed to avoid seed collision. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of RandomDataset + */ + public RandomDataset randomDataset(Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { + return RandomDataset.create(scope, seed, seed2, outputTypes, outputShapes); + } + + /** + * Creates a dataset that changes the batch size. + * Creates a dataset that changes the batch size of the dataset to current batch + * size // num_replicas. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param numReplicas A scalar representing the number of replicas to distribute this batch across. As + * a result of this transformation the current batch size would end up being + * divided by this parameter. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of RebatchDataset + */ + public RebatchDataset rebatchDataset(Operand inputDataset, + Operand numReplicas, List> outputTypes, + List outputShapes, RebatchDataset.Options... options) { + return RebatchDataset.create(scope, inputDataset, numReplicas, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset successively reduces {@code f} over the elements of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param initialState The initialState value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ScanDataset + */ + public ScanDataset scanDataset(Operand inputDataset, + Iterable> initialState, Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, + ScanDataset.Options... options) { + return ScanDataset.create(scope, inputDataset, initialState, otherArguments, f, outputTypes, outputShapes, options); + } + + /** + * The ExperimentalSetStatsAggregatorDataset operation + * + * @param inputDataset The inputDataset value + * @param statsAggregator The statsAggregator value + * @param tag The tag value + * @param counterPrefix The counterPrefix value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SetStatsAggregatorDataset + */ + public SetStatsAggregatorDataset setStatsAggregatorDataset(Operand inputDataset, + Operand statsAggregator, Operand tag, + Operand counterPrefix, List> outputTypes, + List outputShapes) { + return SetStatsAggregatorDataset.create(scope, inputDataset, statsAggregator, tag, counterPrefix, outputTypes, outputShapes); + } + + /** + * The ExperimentalSleepDataset operation + * + * @param inputDataset The inputDataset value + * @param sleepMicroseconds The sleepMicroseconds value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SleepDataset + */ + public SleepDataset sleepDataset(Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { + return SleepDataset.create(scope, inputDataset, sleepMicroseconds, outputTypes, outputShapes); + } + + /** + * Creates a dataset that passes a sliding window over {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param windowSize A scalar representing the number of elements in the + * sliding window. + * @param windowShift A scalar representing the steps moving the sliding window + * forward in one iteration. It must be positive. + * @param windowStride A scalar representing the stride of the input elements of the sliding window. + * It must be positive. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SlidingWindowDataset + */ + public SlidingWindowDataset slidingWindowDataset(Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes) { + return SlidingWindowDataset.create(scope, inputDataset, windowSize, windowShift, windowStride, outputTypes, outputShapes); + } + + /** + * Creates a dataset that executes a SQL query and emits rows of the result set. + * + * @param driverName The database type. Currently, the only supported type is 'sqlite'. + * @param dataSourceName A connection string to connect to the database. + * @param query A SQL query to execute. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SqlDataset + */ + public SqlDataset sqlDataset(Operand driverName, Operand dataSourceName, + Operand query, List> outputTypes, List outputShapes) { + return SqlDataset.create(scope, driverName, dataSourceName, query, outputTypes, outputShapes); + } + + /** + * Creates a statistics manager resource. + * + * @param options carries optional attribute values + * @return a new instance of StatsAggregatorHandle + */ + public StatsAggregatorHandle statsAggregatorHandle(StatsAggregatorHandle.Options... options) { + return StatsAggregatorHandle.create(scope, options); + } + + /** + * Produces a summary of any statistics recorded by the given statistics manager. + * + * @param iterator The iterator value + * @return a new instance of StatsAggregatorSummary + */ + public StatsAggregatorSummary statsAggregatorSummary(Operand iterator) { + return StatsAggregatorSummary.create(scope, iterator); + } + + /** + * Creates a dataset that stops iteration when predicate` is false. + * The {@code predicate} function must return a scalar boolean and accept the + * following arguments: + *

    + *
  • One tensor for each component of an element of {@code input_dataset}.
  • + *
  • One tensor for each value in {@code other_arguments}.
  • + *
+ * + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of TakeWhileDataset + */ + public TakeWhileDataset takeWhileDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes) { + return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param threadPool A resource produced by the ThreadPoolHandle op. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ThreadPoolDataset + */ + public ThreadPoolDataset threadPoolDataset(Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + return ThreadPoolDataset.create(scope, inputDataset, threadPool, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param numThreads The number of threads in the thread pool. + * @param displayName A human-readable name for the threads that may be visible in some + * visualizations. + * threadpool. + * @param options carries optional attribute values + * @return a new instance of ThreadPoolHandle + */ + public ThreadPoolHandle threadPoolHandle(Long numThreads, String displayName, + ThreadPoolHandle.Options... options) { + return ThreadPoolHandle.create(scope, numThreads, displayName, options); + } + + /** + * A dataset that splits the elements of its input into multiple elements. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UnbatchDataset + */ + public UnbatchDataset unbatchDataset(Operand inputDataset, + List> outputTypes, List outputShapes) { + return UnbatchDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * Creates a dataset that contains the unique elements of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UniqueDataset + */ + public UniqueDataset uniqueDataset(Operand inputDataset, + List> outputTypes, List outputShapes) { + return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * 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/DataOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java index 685dda6e2ac..5a3a14b799e 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -22,8 +22,11 @@ import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.data.AnonymousIterator; +import org.tensorflow.op.data.AnonymousMemoryCache; +import org.tensorflow.op.data.AnonymousMultiDeviceIterator; import org.tensorflow.op.data.AssertCardinalityDataset; import org.tensorflow.op.data.AssertNextDataset; +import org.tensorflow.op.data.AssertPrevDataset; import org.tensorflow.op.data.AutoShardDataset; import org.tensorflow.op.data.BatchDataset; import org.tensorflow.op.data.BytesProducedStatsDataset; @@ -31,17 +34,22 @@ import org.tensorflow.op.data.CacheDataset; import org.tensorflow.op.data.ChooseFastestBranchDataset; import org.tensorflow.op.data.ChooseFastestDataset; +import org.tensorflow.op.data.CompressElement; import org.tensorflow.op.data.ConcatenateDataset; -import org.tensorflow.op.data.DataServiceDatasetV2; +import org.tensorflow.op.data.DataServiceDataset; import org.tensorflow.op.data.DatasetCardinality; +import org.tensorflow.op.data.DatasetFingerprint; import org.tensorflow.op.data.DatasetFromGraph; import org.tensorflow.op.data.DatasetToGraph; import org.tensorflow.op.data.DatasetToSingleElement; import org.tensorflow.op.data.DatasetToTfRecord; import org.tensorflow.op.data.DeleteIterator; +import org.tensorflow.op.data.DeleteMemoryCache; +import org.tensorflow.op.data.DeleteMultiDeviceIterator; import org.tensorflow.op.data.DenseToSparseBatchDataset; import org.tensorflow.op.data.DeserializeIterator; import org.tensorflow.op.data.DirectedInterleaveDataset; +import org.tensorflow.op.data.DummyIterationCounter; import org.tensorflow.op.data.FilterByLastComponentDataset; import org.tensorflow.op.data.FilterDataset; import org.tensorflow.op.data.FinalizeDataset; @@ -51,16 +59,22 @@ import org.tensorflow.op.data.GroupByReducerDataset; import org.tensorflow.op.data.GroupByWindowDataset; import org.tensorflow.op.data.IgnoreErrorsDataset; +import org.tensorflow.op.data.IndexFlatMapDataset; import org.tensorflow.op.data.InitializeTableFromDataset; import org.tensorflow.op.data.InterleaveDataset; import org.tensorflow.op.data.Iterator; +import org.tensorflow.op.data.IteratorFromStringHandle; +import org.tensorflow.op.data.IteratorGetDevice; import org.tensorflow.op.data.IteratorGetNext; import org.tensorflow.op.data.IteratorGetNextAsOptional; import org.tensorflow.op.data.IteratorGetNextSync; import org.tensorflow.op.data.IteratorToStringHandle; import org.tensorflow.op.data.LMDBDataset; import org.tensorflow.op.data.LatencyStatsDataset; +import org.tensorflow.op.data.LeakyReluGrad; import org.tensorflow.op.data.LegacyParallelInterleaveDataset; +import org.tensorflow.op.data.ListDataset; +import org.tensorflow.op.data.ListSnapshotChunksDataset; import org.tensorflow.op.data.LoadDataset; import org.tensorflow.op.data.MakeIterator; import org.tensorflow.op.data.MapAndBatchDataset; @@ -68,6 +82,11 @@ import org.tensorflow.op.data.MatchingFilesDataset; import org.tensorflow.op.data.MaxIntraOpParallelismDataset; import org.tensorflow.op.data.ModelDataset; +import org.tensorflow.op.data.MultiDeviceIterator; +import org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle; +import org.tensorflow.op.data.MultiDeviceIteratorGetNextFromShard; +import org.tensorflow.op.data.MultiDeviceIteratorInit; +import org.tensorflow.op.data.MultiDeviceIteratorToStringHandle; import org.tensorflow.op.data.NonSerializableDataset; import org.tensorflow.op.data.OneShotIterator; import org.tensorflow.op.data.OptimizeDataset; @@ -78,6 +97,7 @@ import org.tensorflow.op.data.OptionsDataset; import org.tensorflow.op.data.PaddedBatchDataset; import org.tensorflow.op.data.ParallelBatchDataset; +import org.tensorflow.op.data.ParallelFilterDataset; import org.tensorflow.op.data.ParallelInterleaveDataset; import org.tensorflow.op.data.ParallelMapDataset; import org.tensorflow.op.data.ParseExampleDataset; @@ -89,6 +109,7 @@ import org.tensorflow.op.data.ReduceDataset; import org.tensorflow.op.data.RegisterDataset; import org.tensorflow.op.data.RepeatDataset; +import org.tensorflow.op.data.RewriteDataset; import org.tensorflow.op.data.SamplingDataset; import org.tensorflow.op.data.SaveDataset; import org.tensorflow.op.data.ScanDataset; @@ -100,9 +121,14 @@ import org.tensorflow.op.data.SkipDataset; import org.tensorflow.op.data.SleepDataset; import org.tensorflow.op.data.SlidingWindowDataset; +import org.tensorflow.op.data.SnapshotChunkDataset; import org.tensorflow.op.data.SnapshotDataset; +import org.tensorflow.op.data.SnapshotDatasetReader; +import org.tensorflow.op.data.SnapshotNestedDatasetReader; import org.tensorflow.op.data.SparseTensorSliceDataset; import org.tensorflow.op.data.SqlDataset; +import org.tensorflow.op.data.StatsAggregatorHandle; +import org.tensorflow.op.data.StatsAggregatorSetSummaryWriter; import org.tensorflow.op.data.TakeDataset; import org.tensorflow.op.data.TakeWhileDataset; import org.tensorflow.op.data.TensorDataset; @@ -110,14 +136,18 @@ import org.tensorflow.op.data.TextLineDataset; import org.tensorflow.op.data.TfRecordDataset; import org.tensorflow.op.data.ThreadPoolDataset; +import org.tensorflow.op.data.ThreadPoolHandle; import org.tensorflow.op.data.UnbatchDataset; +import org.tensorflow.op.data.UncompressElement; import org.tensorflow.op.data.UniqueDataset; import org.tensorflow.op.data.UnwrapDatasetVariant; import org.tensorflow.op.data.WindowDataset; +import org.tensorflow.op.data.WindowOp; import org.tensorflow.op.data.WrapDatasetVariant; import org.tensorflow.op.data.ZipDataset; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -126,9 +156,11 @@ /** * An API for building {@code data} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class DataOps { + public final DataExperimentalOps experimental; + private final Scope scope; private final Ops ops; @@ -136,13 +168,14 @@ public final class DataOps { DataOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + experimental = new DataExperimentalOps(ops); } /** * A container for an iterator resource. * - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AnonymousIterator */ public AnonymousIterator anonymousIterator(List> outputTypes, @@ -150,13 +183,35 @@ public AnonymousIterator anonymousIterator(List> outputTy return AnonymousIterator.create(scope, outputTypes, outputShapes); } + /** + * The AnonymousMemoryCache operation + * + * @return a new instance of AnonymousMemoryCache + */ + public AnonymousMemoryCache anonymousMemoryCache() { + return AnonymousMemoryCache.create(scope); + } + + /** + * A container for a multi device iterator resource. + * + * @param devices The value of the devices attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AnonymousMultiDeviceIterator + */ + public AnonymousMultiDeviceIterator anonymousMultiDeviceIterator(List devices, + List> outputTypes, List outputShapes) { + return AnonymousMultiDeviceIterator.create(scope, devices, outputTypes, outputShapes); + } + /** * The AssertCardinalityDataset operation * - * @param inputDataset the inputDataset value - * @param cardinality the cardinality value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param cardinality The cardinality value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AssertCardinalityDataset */ public AssertCardinalityDataset assertCardinalityDataset(Operand inputDataset, @@ -179,8 +234,8 @@ public AssertCardinalityDataset assertCardinalityDataset(Operand inputDataset, @@ -189,6 +244,30 @@ public AssertNextDataset assertNextDataset(Operand inputDataset return AssertNextDataset.create(scope, inputDataset, transformations, outputTypes, outputShapes); } + /** + * A transformation that asserts which transformations happened previously. + * This transformation checks the names and, optionally, the attribute name-value + * pairs in the {@code transformations} argument against those of the transformations + * that preceded this transformation. If there is a mismatch, the transformation + * raises an exception. + *

The check occurs when iterating over the contents of the dataset, which + * means that the check happens after any static optimizations are applied + * to the dataset graph. + * + * @param inputDataset A variant tensor representing the input dataset. + * {@code data.AssertPrevDataset} passes through the outputs of its input dataset. + * @param transformations A {@code tf.string} vector {@code tf.Tensor} identifying the transformations, with optional + * attribute name-value pairs, that are expected to have happened previously. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertPrevDataset + */ + public AssertPrevDataset assertPrevDataset(Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + return AssertPrevDataset.create(scope, inputDataset, transformations, outputTypes, outputShapes); + } + /** * Creates a dataset that shards the input dataset. * Creates a dataset that shards the input dataset by num_workers, returning a @@ -201,8 +280,8 @@ public AssertNextDataset assertNextDataset(Operand inputDataset * @param inputDataset A variant tensor representing the input dataset. * @param numWorkers A scalar representing the number of workers to distribute this dataset across. * @param index A scalar representing the index of the current worker out of num_workers. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of AutoShardDataset */ @@ -215,12 +294,12 @@ public AutoShardDataset autoShardDataset(Operand inputDataset, /** * Creates a dataset that batches {@code batch_size} elements from {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param batchSize A scalar representing the number of elements to accumulate in a batch. * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of BatchDataset */ @@ -233,10 +312,10 @@ public BatchDataset batchDataset(Operand inputDataset, Operand< /** * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. * - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of BytesProducedStatsDataset */ public BytesProducedStatsDataset bytesProducedStatsDataset(Operand inputDataset, @@ -247,17 +326,17 @@ public BytesProducedStatsDataset bytesProducedStatsDataset(Operand filenames, Operand compressionType, @@ -270,31 +349,32 @@ public CSVDataset cSVDataset(Operand filenames, Operand compre /** * The CacheDatasetV2 operation * - * @param inputDataset the inputDataset value - * @param filename the filename value - * @param cache the cache value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param filename The filename value + * @param cache The cache value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of CacheDataset */ public CacheDataset cacheDataset(Operand inputDataset, Operand filename, Operand cache, List> outputTypes, - List outputShapes) { - return CacheDataset.create(scope, inputDataset, filename, cache, outputTypes, outputShapes); + List outputShapes, CacheDataset.Options... options) { + return CacheDataset.create(scope, inputDataset, filename, cache, outputTypes, outputShapes, options); } /** * The ChooseFastestBranchDataset operation * - * @param inputDataset the inputDataset value - * @param ratioNumerator the ratioNumerator value - * @param ratioDenominator the ratioDenominator value - * @param otherArguments the otherArguments value - * @param numElementsPerBranch the value of the numElementsPerBranch property - * @param branches the value of the branches property - * @param otherArgumentsLengths the value of the otherArgumentsLengths property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param ratioNumerator The ratioNumerator value + * @param ratioDenominator The ratioDenominator value + * @param otherArguments The otherArguments value + * @param numElementsPerBranch The value of the numElementsPerBranch attribute + * @param branches The value of the branches attribute + * @param otherArgumentsLengths The value of the otherArgumentsLengths attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ChooseFastestBranchDataset */ public ChooseFastestBranchDataset chooseFastestBranchDataset( @@ -308,10 +388,10 @@ public ChooseFastestBranchDataset chooseFastestBranchDataset( /** * The ChooseFastestDataset operation * - * @param inputDatasets the inputDatasets value - * @param numExperiments the value of the numExperiments property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDatasets The inputDatasets value + * @param numExperiments The value of the numExperiments attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ChooseFastestDataset */ public ChooseFastestDataset chooseFastestDataset(Iterable> inputDatasets, @@ -319,45 +399,57 @@ public ChooseFastestDataset chooseFastestDataset(Iterable> components) { + return CompressElement.create(scope, components); + } + /** * Creates a dataset that concatenates {@code input_dataset} with {@code another_dataset}. * - * @param inputDataset the inputDataset value - * @param anotherDataset the anotherDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param anotherDataset The anotherDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of ConcatenateDataset */ public ConcatenateDataset concatenateDataset(Operand inputDataset, Operand anotherDataset, List> outputTypes, - List outputShapes) { - return ConcatenateDataset.create(scope, inputDataset, anotherDataset, outputTypes, outputShapes); + List outputShapes, ConcatenateDataset.Options... options) { + return ConcatenateDataset.create(scope, inputDataset, anotherDataset, outputTypes, outputShapes, options); } /** * Creates a dataset that reads data from the tf.data service. * - * @param datasetId the datasetId value - * @param processingMode the processingMode value - * @param address the address value - * @param protocol the protocol value - * @param jobName the jobName value - * @param consumerIndex the consumerIndex value - * @param numConsumers the numConsumers value - * @param maxOutstandingRequests the maxOutstandingRequests value - * @param iterationCounter the iterationCounter value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @param options carries optional attribute values - * @return a new instance of DataServiceDatasetV2 - */ - public DataServiceDatasetV2 dataServiceDatasetV2(Operand datasetId, + * @param datasetId The datasetId value + * @param processingMode The processingMode value + * @param address The address value + * @param protocol The protocol value + * @param jobName The jobName value + * @param consumerIndex The consumerIndex value + * @param numConsumers The numConsumers value + * @param maxOutstandingRequests The maxOutstandingRequests value + * @param iterationCounter The iterationCounter value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param uncompressFn The value of the uncompressFn attribute + * @param options carries optional attribute values + * @return a new instance of DataServiceDataset + */ + public DataServiceDataset dataServiceDataset(Operand datasetId, Operand processingMode, Operand address, Operand protocol, Operand jobName, Operand consumerIndex, Operand numConsumers, Operand maxOutstandingRequests, Operand iterationCounter, List> outputTypes, List outputShapes, - DataServiceDatasetV2.Options... options) { - return DataServiceDatasetV2.create(scope, datasetId, processingMode, address, protocol, jobName, consumerIndex, numConsumers, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, options); + ConcreteFunction uncompressFn, DataServiceDataset.Options... options) { + return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, consumerIndex, numConsumers, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, uncompressFn, options); } /** @@ -365,10 +457,23 @@ public DataServiceDatasetV2 dataServiceDatasetV2(Operand datasetId, * Returns the cardinality of {@code input_dataset}. * * @param inputDataset A variant tensor representing the dataset to return cardinality for. + * @param options carries optional attribute values * @return a new instance of DatasetCardinality */ - public DatasetCardinality datasetCardinality(Operand inputDataset) { - return DatasetCardinality.create(scope, inputDataset); + public DatasetCardinality datasetCardinality(Operand inputDataset, + DatasetCardinality.Options... options) { + return DatasetCardinality.create(scope, inputDataset, options); + } + + /** + * Returns the fingerprint of {@code input_dataset}. + * Returns the fingerprint of {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return fingerprint for. + * @return a new instance of DatasetFingerprint + */ + public DatasetFingerprint datasetFingerprint(Operand inputDataset) { + return DatasetFingerprint.create(scope, inputDataset); } /** @@ -399,13 +504,15 @@ public DatasetToGraph datasetToGraph(Operand inputDataset, * Outputs the single element from the given dataset. * * @param dataset A handle to a dataset that contains a single element. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of DatasetToSingleElement */ public DatasetToSingleElement datasetToSingleElement(Operand dataset, - List> outputTypes, List outputShapes) { - return DatasetToSingleElement.create(scope, dataset, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + DatasetToSingleElement.Options... options) { + return DatasetToSingleElement.create(scope, dataset, outputTypes, outputShapes, options); } /** @@ -434,6 +541,32 @@ public DeleteIterator deleteIterator(Operand handle, return DeleteIterator.create(scope, handle, deleter); } + /** + * The DeleteMemoryCache operation + * + * @param handle The handle value + * @param deleter The deleter value + * @return a new instance of DeleteMemoryCache + */ + public DeleteMemoryCache deleteMemoryCache(Operand handle, + Operand deleter) { + return DeleteMemoryCache.create(scope, handle, deleter); + } + + /** + * A container for an iterator resource. + * + * @param multiDeviceIterator A handle to the multi device iterator to delete. + * @param iterators A list of iterator handles (unused). This is added so that automatic control dependencies get added during function tracing that ensure this op runs after all the dependent iterators are deleted. + * @param deleter A variant deleter. + * @return a new instance of DeleteMultiDeviceIterator + */ + public DeleteMultiDeviceIterator deleteMultiDeviceIterator( + Operand multiDeviceIterator, Iterable> iterators, + Operand deleter) { + return DeleteMultiDeviceIterator.create(scope, multiDeviceIterator, iterators, deleter); + } + /** * Creates a dataset that batches input elements into a SparseTensor. * @@ -443,8 +576,8 @@ public DeleteIterator deleteIterator(Operand handle, * @param rowShape A vector representing the dense shape of each row in the produced * SparseTensor. The shape may be partially specified, using {@code -1} to indicate * that a particular dimension should use the maximum size of all batch elements. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DenseToSparseBatchDataset */ public DenseToSparseBatchDataset denseToSparseBatchDataset(Operand inputDataset, @@ -473,8 +606,8 @@ public DeserializeIterator deserializeIterator(Operand resource * {@code N} data inputs should produce the next output element. * @param dataInputDatasets {@code N} datasets with the same type that will be interleaved according to * the values of {@code selector_input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of DirectedInterleaveDataset */ @@ -486,12 +619,21 @@ public DirectedInterleaveDataset directedInterleaveDataset( return DirectedInterleaveDataset.create(scope, selectorInputDataset, dataInputDatasets, outputTypes, outputShapes, options); } + /** + * The DummyIterationCounter operation + * + * @return a new instance of DummyIterationCounter + */ + public DummyIterationCounter dummyIterationCounter() { + return DummyIterationCounter.create(scope); + } + /** * Creates a dataset containing elements of first component of {@code input_dataset} having true in the last component. * - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of FilterByLastComponentDataset */ public FilterByLastComponentDataset filterByLastComponentDataset( @@ -509,26 +651,28 @@ public FilterByLastComponentDataset filterByLastComponentDataset( *

  • One tensor for each value in {@code other_arguments}.
  • * * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param otherArguments A list of tensors, typically values that were captured when * building a closure for {@code predicate}. * @param predicate A function returning a scalar boolean. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of FilterDataset */ public FilterDataset filterDataset(Operand inputDataset, Iterable> otherArguments, ConcreteFunction predicate, - List> outputTypes, List outputShapes) { - return FilterDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + FilterDataset.Options... options) { + return FilterDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes, options); } /** * Creates a dataset by applying {@code tf.data.Options} to {@code input_dataset}. * * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of FinalizeDataset */ @@ -541,18 +685,20 @@ public FinalizeDataset finalizeDataset(Operand inputDataset, /** * The FixedLengthRecordDatasetV2 operation * - * @param filenames the filenames value - * @param headerBytes the headerBytes value - * @param recordBytes the recordBytes value - * @param footerBytes the footerBytes value - * @param bufferSize the bufferSize value - * @param compressionType the compressionType value + * @param filenames The filenames value + * @param headerBytes The headerBytes value + * @param recordBytes The recordBytes value + * @param footerBytes The footerBytes value + * @param bufferSize The bufferSize value + * @param compressionType The compressionType value + * @param options carries optional attribute values * @return a new instance of FixedLengthRecordDataset */ public FixedLengthRecordDataset fixedLengthRecordDataset(Operand filenames, Operand headerBytes, Operand recordBytes, Operand footerBytes, - Operand bufferSize, Operand compressionType) { - return FixedLengthRecordDataset.create(scope, filenames, headerBytes, recordBytes, footerBytes, bufferSize, compressionType); + Operand bufferSize, Operand compressionType, + FixedLengthRecordDataset.Options... options) { + return FixedLengthRecordDataset.create(scope, filenames, headerBytes, recordBytes, footerBytes, bufferSize, compressionType, options); } /** @@ -561,39 +707,43 @@ public FixedLengthRecordDataset fixedLengthRecordDataset(Operand filena * Dataset variant, and FlatMapDataset will flatten successive results * into a single Dataset. * - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of FlatMapDataset */ public FlatMapDataset flatMapDataset(Operand inputDataset, Iterable> otherArguments, ConcreteFunction f, - List> outputTypes, List outputShapes) { - return FlatMapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + FlatMapDataset.Options... options) { + return FlatMapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes, options); } /** * Creates a dataset that invokes a function to generate elements. * - * @param initFuncOtherArgs the initFuncOtherArgs value - * @param nextFuncOtherArgs the nextFuncOtherArgs value - * @param finalizeFuncOtherArgs the finalizeFuncOtherArgs value - * @param initFunc the value of the initFunc property - * @param nextFunc the value of the nextFunc property - * @param finalizeFunc the value of the finalizeFunc property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param initFuncOtherArgs The initFuncOtherArgs value + * @param nextFuncOtherArgs The nextFuncOtherArgs value + * @param finalizeFuncOtherArgs The finalizeFuncOtherArgs value + * @param initFunc The value of the initFunc attribute + * @param nextFunc The value of the nextFunc attribute + * @param finalizeFunc The value of the finalizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of GeneratorDataset */ public GeneratorDataset generatorDataset(Iterable> initFuncOtherArgs, Iterable> nextFuncOtherArgs, Iterable> finalizeFuncOtherArgs, ConcreteFunction initFunc, ConcreteFunction nextFunc, ConcreteFunction finalizeFunc, - List> outputTypes, List outputShapes) { - return GeneratorDataset.create(scope, initFuncOtherArgs, nextFuncOtherArgs, finalizeFuncOtherArgs, initFunc, nextFunc, finalizeFunc, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + GeneratorDataset.Options... options) { + return GeneratorDataset.create(scope, initFuncOtherArgs, nextFuncOtherArgs, finalizeFuncOtherArgs, initFunc, nextFunc, finalizeFunc, outputTypes, outputShapes, options); } /** @@ -616,8 +766,8 @@ public GeneratorDataset generatorDataset(Iterable> initFuncOtherArgs, * @param reduceFunc A function mapping the current reducer state and an element of {@code input_dataset}, * concatenated with {@code reduce_func_other_arguments} to a new reducer state. * @param finalizeFunc A function mapping the final reducer state to an output element. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of GroupByReducerDataset */ public GroupByReducerDataset groupByReducerDataset(Operand inputDataset, @@ -633,32 +783,34 @@ public GroupByReducerDataset groupByReducerDataset(Operand inpu * Creates a dataset that computes a windowed group-by on {@code input_dataset}. * // TODO(mrry): Support non-int64 keys. * - * @param inputDataset the inputDataset value - * @param keyFuncOtherArguments the keyFuncOtherArguments value - * @param reduceFuncOtherArguments the reduceFuncOtherArguments value - * @param windowSizeFuncOtherArguments the windowSizeFuncOtherArguments value + * @param inputDataset The inputDataset value + * @param keyFuncOtherArguments The keyFuncOtherArguments value + * @param reduceFuncOtherArguments The reduceFuncOtherArguments value + * @param windowSizeFuncOtherArguments The windowSizeFuncOtherArguments value * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. - * @param reduceFunc the value of the reduceFunc property - * @param windowSizeFunc the value of the windowSizeFunc property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param reduceFunc The value of the reduceFunc attribute + * @param windowSizeFunc The value of the windowSizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of GroupByWindowDataset */ public GroupByWindowDataset groupByWindowDataset(Operand inputDataset, Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, - List> outputTypes, List outputShapes) { - return GroupByWindowDataset.create(scope, inputDataset, keyFuncOtherArguments, reduceFuncOtherArguments, windowSizeFuncOtherArguments, keyFunc, reduceFunc, windowSizeFunc, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + GroupByWindowDataset.Options... options) { + return GroupByWindowDataset.create(scope, inputDataset, keyFuncOtherArguments, reduceFuncOtherArguments, windowSizeFuncOtherArguments, keyFunc, reduceFunc, windowSizeFunc, outputTypes, outputShapes, options); } /** * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. * - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of IgnoreErrorsDataset */ @@ -668,11 +820,33 @@ public IgnoreErrorsDataset ignoreErrorsDataset(Operand inputDat return IgnoreErrorsDataset.create(scope, inputDataset, outputTypes, outputShapes, options); } + /** + * The IndexFlatMapDataset operation + * + * @param inputDataset The inputDataset value + * @param mapFuncOtherArgs The mapFuncOtherArgs value + * @param indexMapFuncOtherArgs The indexMapFuncOtherArgs value + * @param outputCardinality The outputCardinality value + * @param mapFunc The value of the mapFunc attribute + * @param indexMapFunc The value of the indexMapFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of IndexFlatMapDataset + */ + public IndexFlatMapDataset indexFlatMapDataset(Operand inputDataset, + Iterable> mapFuncOtherArgs, Iterable> indexMapFuncOtherArgs, + Operand outputCardinality, ConcreteFunction mapFunc, ConcreteFunction indexMapFunc, + List> outputTypes, List outputShapes, + IndexFlatMapDataset.Options... options) { + return IndexFlatMapDataset.create(scope, inputDataset, mapFuncOtherArgs, indexMapFuncOtherArgs, outputCardinality, mapFunc, indexMapFunc, outputTypes, outputShapes, options); + } + /** * The InitializeTableFromDataset operation * - * @param tableHandle the tableHandle value - * @param dataset the dataset value + * @param tableHandle The tableHandle value + * @param dataset The dataset value * @return a new instance of InitializeTableFromDataset */ public InitializeTableFromDataset initializeTableFromDataset(Operand tableHandle, @@ -688,30 +862,32 @@ public InitializeTableFromDataset initializeTableFromDataset(Operand inputDataset, Iterable> otherArguments, Operand cycleLength, Operand blockLength, - ConcreteFunction f, List> outputTypes, List outputShapes) { - return InterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, f, outputTypes, outputShapes); + ConcreteFunction f, List> outputTypes, List outputShapes, + InterleaveDataset.Options... options) { + return InterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, f, outputTypes, outputShapes, options); } /** * The IteratorV2 operation * - * @param sharedName the value of the sharedName property - * @param container the value of the container property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param sharedName The value of the sharedName attribute + * @param container The value of the container attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of Iterator */ public Iterator iterator(String sharedName, String container, @@ -719,12 +895,35 @@ public Iterator iterator(String sharedName, String container, return Iterator.create(scope, sharedName, container, outputTypes, outputShapes); } + /** + * The IteratorFromStringHandleV2 operation + * + * @param stringHandle The stringHandle value + * @param outputTypes The value of the outputTypes attribute + * @param options carries optional attribute values + * @return a new instance of IteratorFromStringHandle + */ + public IteratorFromStringHandle iteratorFromStringHandle(Operand stringHandle, + List> outputTypes, IteratorFromStringHandle.Options... options) { + return IteratorFromStringHandle.create(scope, stringHandle, outputTypes, options); + } + + /** + * Returns the name of the device on which {@code resource} has been placed. + * + * @param resource The resource value + * @return a new instance of IteratorGetDevice + */ + public IteratorGetDevice iteratorGetDevice(Operand resource) { + return IteratorGetDevice.create(scope, resource); + } + /** * Gets the next output from the given iterator . * - * @param iterator the iterator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNext */ public IteratorGetNext iteratorGetNext(Operand iterator, @@ -735,9 +934,9 @@ public IteratorGetNext iteratorGetNext(Operand iterator, /** * Gets the next output from the given iterator as an Optional variant. * - * @param iterator the iterator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNextAsOptional */ public IteratorGetNextAsOptional iteratorGetNextAsOptional(Operand iterator, @@ -752,9 +951,9 @@ public IteratorGetNextAsOptional iteratorGetNextAsOptional(Operand iterator, @@ -785,8 +984,8 @@ public IteratorToStringHandle iteratorToStringHandle(Operand re * * @param filenames A scalar or a vector containing the name(s) of the binary file(s) to be * read. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LMDBDataset */ public LMDBDataset lMDBDataset(Operand filenames, @@ -797,10 +996,10 @@ public LMDBDataset lMDBDataset(Operand filenames, /** * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. * - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LatencyStatsDataset */ public LatencyStatsDataset latencyStatsDataset(Operand inputDataset, @@ -808,6 +1007,21 @@ public LatencyStatsDataset latencyStatsDataset(Operand inputDat return LatencyStatsDataset.create(scope, inputDataset, tag, outputTypes, outputShapes); } + /** + * Computes rectified linear gradients for a LeakyRelu operation. + * + * @param gradients The backpropagated gradients to the corresponding LeakyRelu operation. + * @param features The features passed as input to the corresponding LeakyRelu operation, + * OR the outputs of that operation (both work equivalently). + * @param options carries optional attribute values + * @param data type for {@code LeakyReluGrad} output and operands + * @return a new instance of LeakyReluGrad + */ + public LeakyReluGrad leakyReluGrad(Operand gradients, + Operand features, LeakyReluGrad.Options... options) { + return LeakyReluGrad.create(scope, gradients, features, options); + } + /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. * The resulting dataset is similar to the {@code InterleaveDataset}, with the exception @@ -817,17 +1031,17 @@ public LatencyStatsDataset latencyStatsDataset(Operand inputDat * allows the training step to proceed so long as some data is available. *

    !! WARNING !! This dataset is not deterministic! * - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param cycleLength the cycleLength value - * @param blockLength the blockLength value - * @param bufferOutputElements the bufferOutputElements value - * @param prefetchInputElements the prefetchInputElements value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value + * @param bufferOutputElements The bufferOutputElements value + * @param prefetchInputElements The prefetchInputElements value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of LegacyParallelInterleaveDataset */ @@ -840,14 +1054,42 @@ public LegacyParallelInterleaveDataset legacyParallelInterleaveDataset( return LegacyParallelInterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, bufferOutputElements, prefetchInputElements, f, outputTypes, outputShapes, options); } + /** + * Creates a dataset that emits each of {@code tensors} once. + * + * @param tensors The tensors value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ListDataset + */ + public ListDataset listDataset(Iterable> tensors, + List> outputTypes, List outputShapes, + ListDataset.Options... options) { + return ListDataset.create(scope, tensors, outputTypes, outputShapes, options); + } + + /** + * The ListSnapshotChunksDataset operation + * + * @param snapshotPath The snapshotPath value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ListSnapshotChunksDataset + */ + public ListSnapshotChunksDataset listSnapshotChunksDataset(Operand snapshotPath, + List> outputTypes, List outputShapes) { + return ListSnapshotChunksDataset.create(scope, snapshotPath, outputTypes, outputShapes); + } + /** * The LoadDataset operation * - * @param path the path value - * @param readerFuncOtherArgs the readerFuncOtherArgs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @param readerFunc the value of the readerFunc property + * @param path The path value + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param readerFunc The value of the readerFunc attribute * @param options carries optional attribute values * @return a new instance of LoadDataset */ @@ -862,8 +1104,8 @@ public LoadDataset loadDataset(Operand path, Iterable> reade * This operation may be executed multiple times. Each execution will reset the * iterator in {@code iterator} to the first element of {@code dataset}. * - * @param dataset the dataset value - * @param iterator the iterator value + * @param dataset The dataset value + * @param iterator The iterator value * @return a new instance of MakeIterator */ public MakeIterator makeIterator(Operand dataset, @@ -890,8 +1132,8 @@ public MakeIterator makeIterator(Operand dataset, * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. * @param f A function to apply to the outputs of {@code input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapAndBatchDataset */ @@ -906,11 +1148,11 @@ public MapAndBatchDataset mapAndBatchDataset(Operand inputDatas /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. * - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapDataset */ @@ -924,7 +1166,7 @@ public MapDataset mapDataset(Operand inputDataset, /** * The MatchingFilesDataset operation * - * @param patterns the patterns value + * @param patterns The patterns value * @return a new instance of MatchingFilesDataset */ public MatchingFilesDataset matchingFilesDataset(Operand patterns) { @@ -934,10 +1176,10 @@ public MatchingFilesDataset matchingFilesDataset(Operand patterns) { /** * Creates a dataset that overrides the maximum intra-op parallelism. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of MaxIntraOpParallelismDataset */ public MaxIntraOpParallelismDataset maxIntraOpParallelismDataset( @@ -951,8 +1193,8 @@ public MaxIntraOpParallelismDataset maxIntraOpParallelismDataset( * Identity transformation that models performance. * * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ModelDataset */ @@ -962,12 +1204,84 @@ public ModelDataset modelDataset(Operand inputDataset, return ModelDataset.create(scope, inputDataset, outputTypes, outputShapes, options); } + /** + * Creates a MultiDeviceIterator resource. + * + * @param devices A list of devices the iterator works across. + * @param sharedName If non-empty, this resource will be shared under the given name + * across multiple sessions. + * @param container If non-empty, this resource is placed in the given container. + * Otherwise, a default container is used. + * @param outputTypes The type list for the return values. + * @param outputShapes The list of shapes being produced. + * @return a new instance of MultiDeviceIterator + */ + public MultiDeviceIterator multiDeviceIterator(List devices, String sharedName, + String container, List> outputTypes, List outputShapes) { + return MultiDeviceIterator.create(scope, devices, sharedName, container, outputTypes, outputShapes); + } + + /** + * Generates a MultiDeviceIterator resource from its provided string handle. + * + * @param stringHandle String representing the resource. + * @param outputTypes The type list for the return values. + * @param options carries optional attribute values + * @return a new instance of MultiDeviceIteratorFromStringHandle + */ + public MultiDeviceIteratorFromStringHandle multiDeviceIteratorFromStringHandle( + Operand stringHandle, List> outputTypes, + MultiDeviceIteratorFromStringHandle.Options... options) { + return MultiDeviceIteratorFromStringHandle.create(scope, stringHandle, outputTypes, options); + } + + /** + * Gets next element for the provided shard number. + * + * @param multiDeviceIterator A MultiDeviceIterator resource. + * @param shardNum Integer representing which shard to fetch data for. + * @param incarnationId Which incarnation of the MultiDeviceIterator is running. + * @param outputTypes The type list for the return values. + * @param outputShapes The list of shapes being produced. + * @return a new instance of MultiDeviceIteratorGetNextFromShard + */ + public MultiDeviceIteratorGetNextFromShard multiDeviceIteratorGetNextFromShard( + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, + List outputShapes) { + return MultiDeviceIteratorGetNextFromShard.create(scope, multiDeviceIterator, shardNum, incarnationId, outputTypes, outputShapes); + } + + /** + * Initializes the multi device iterator with the given dataset. + * + * @param dataset Dataset to be iterated upon. + * @param multiDeviceIterator A MultiDeviceIteratorResource. + * @param maxBufferSize The maximum size of the host side per device buffer to keep. + * @return a new instance of MultiDeviceIteratorInit + */ + public MultiDeviceIteratorInit multiDeviceIteratorInit(Operand dataset, + Operand multiDeviceIterator, Operand maxBufferSize) { + return MultiDeviceIteratorInit.create(scope, dataset, multiDeviceIterator, maxBufferSize); + } + + /** + * Produces a string handle for the given MultiDeviceIterator. + * + * @param multiDeviceIterator A MultiDeviceIterator resource. + * @return a new instance of MultiDeviceIteratorToStringHandle + */ + public MultiDeviceIteratorToStringHandle multiDeviceIteratorToStringHandle( + Operand multiDeviceIterator) { + return MultiDeviceIteratorToStringHandle.create(scope, multiDeviceIterator); + } + /** * The NonSerializableDataset operation * - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of NonSerializableDataset */ public NonSerializableDataset nonSerializableDataset(Operand inputDataset, @@ -996,8 +1310,8 @@ public NonSerializableDataset nonSerializableDataset(Operand in * * @param datasetFactory A function of type {@code () -> DT_VARIANT}, where the returned * DT_VARIANT is a dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of OneShotIterator */ @@ -1015,8 +1329,8 @@ public OneShotIterator oneShotIterator(ConcreteFunction datasetFactory, * @param optimizationsEnabled A {@code tf.string} vector {@code tf.Tensor} identifying user enabled optimizations. * @param optimizationsDisabled A {@code tf.string} vector {@code tf.Tensor} identifying user disabled optimizations. * @param optimizationsDefault A {@code tf.string} vector {@code tf.Tensor} identifying optimizations by default. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of OptimizeDataset */ @@ -1030,7 +1344,7 @@ public OptimizeDataset optimizeDataset(Operand inputDataset, /** * Constructs an Optional variant from a tuple of tensors. * - * @param components the components value + * @param components The components value * @return a new instance of OptionalFromValue */ public OptionalFromValue optionalFromValue(Iterable> components) { @@ -1040,9 +1354,9 @@ public OptionalFromValue optionalFromValue(Iterable> components) { /** * Returns the value stored in an Optional variant or raises an error if none exists. * - * @param optional the optional value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param optional The optional value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of OptionalGetValue */ public OptionalGetValue optionalGetValue(Operand optional, @@ -1053,7 +1367,7 @@ public OptionalGetValue optionalGetValue(Operand optional, /** * Returns true if and only if the given Optional variant has a value. * - * @param optional the optional value + * @param optional The optional value * @return a new instance of OptionalHasValue */ public OptionalHasValue optionalHasValue(Operand optional) { @@ -1074,20 +1388,21 @@ public OptionalNone optionalNone() { * * @param inputDataset A variant tensor representing the input dataset. * @param serializedOptions A {@code tf.string} scalar {@code tf.Tensor} of serialized {@code tf.data.Options} protocol buffer. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of OptionsDataset */ public OptionsDataset optionsDataset(Operand inputDataset, - String serializedOptions, List> outputTypes, - List outputShapes) { - return OptionsDataset.create(scope, inputDataset, serializedOptions, outputTypes, outputShapes); + String serializedOptions, List> outputTypes, List outputShapes, + OptionsDataset.Options... options) { + return OptionsDataset.create(scope, inputDataset, serializedOptions, outputTypes, outputShapes, options); } /** * Creates a dataset that batches and pads {@code batch_size} elements from the input. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param batchSize A scalar representing the number of elements to accumulate in a * batch. * @param paddedShapes A list of int64 tensors representing the desired padded shapes @@ -1098,7 +1413,7 @@ public OptionsDataset optionsDataset(Operand inputDataset, * each of the outputs. * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. - * @param outputShapes the value of the outputShapes property + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of PaddedBatchDataset */ @@ -1112,12 +1427,12 @@ public PaddedBatchDataset paddedBatchDataset(Operand inputDatas /** * The ParallelBatchDataset operation * - * @param inputDataset the inputDataset value - * @param batchSize the batchSize value - * @param numParallelCalls the numParallelCalls value - * @param dropRemainder the dropRemainder value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param batchSize The batchSize value + * @param numParallelCalls The numParallelCalls value + * @param dropRemainder The dropRemainder value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ParallelBatchDataset */ @@ -1128,6 +1443,35 @@ public ParallelBatchDataset parallelBatchDataset(Operand inputD return ParallelBatchDataset.create(scope, inputDataset, batchSize, numParallelCalls, dropRemainder, outputTypes, outputShapes, options); } + /** + * Creates a dataset containing elements of {@code input_dataset} matching {@code predicate}. + * The {@code predicate} function must return a scalar boolean and accept the + * following arguments: + *

      + *
    • One tensor for each component of an element of {@code input_dataset}.
    • + *
    • One tensor for each value in {@code other_arguments}.
    • + *
    + *

    Unlike a "FilterDataset", which applies {@code predicate} sequentially, this dataset + * invokes up to {@code num_parallel_calls} copies of {@code predicate} in parallel. + * + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param numParallelCalls The number of concurrent invocations of {@code predicate} that process + * elements from {@code input_dataset} in parallel. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ParallelFilterDataset + */ + public ParallelFilterDataset parallelFilterDataset(Operand inputDataset, + Iterable> otherArguments, Operand numParallelCalls, + ConcreteFunction predicate, List> outputTypes, + List outputShapes, ParallelFilterDataset.Options... options) { + return ParallelFilterDataset.create(scope, inputDataset, otherArguments, numParallelCalls, predicate, outputTypes, outputShapes, options); + } + /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. * The resulting dataset is similar to the {@code InterleaveDataset}, except that the @@ -1160,8 +1504,8 @@ public ParallelBatchDataset parallelBatchDataset(Operand inputD * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ParallelInterleaveDataset */ @@ -1179,13 +1523,13 @@ public ParallelInterleaveDataset parallelInterleaveDataset(Operand inputDatas /** * Transforms {@code input_dataset} containing {@code Example} protos as vectors of DT_STRING into a dataset of {@code Tensor} or {@code SparseTensor} objects representing the parsed features. * - * @param inputDataset the inputDataset value - * @param numParallelCalls the numParallelCalls value + * @param inputDataset The inputDataset value + * @param numParallelCalls The numParallelCalls value * @param denseDefaults A dict mapping string keys to {@code Tensor}s. * The keys of the dict must match the dense_keys of the feature. * @param sparseKeys A list of string keys in the examples features. @@ -1221,8 +1565,8 @@ public ParallelMapDataset parallelMapDataset(Operand inputDatas * given feature along this dimension. * @param outputTypes The type list for the return values. * @param outputShapes The list of shapes being produced. - * @param raggedValueTypes the value of the raggedValueTypes property - * @param raggedSplitTypes the value of the raggedSplitTypes property + * @param raggedValueTypes The value of the raggedValueTypes attribute + * @param raggedSplitTypes The value of the raggedSplitTypes attribute * @param options carries optional attribute values * @return a new instance of ParseExampleDataset */ @@ -1238,11 +1582,11 @@ public ParseExampleDataset parseExampleDataset(Operand inputDat /** * Creates a dataset that asynchronously prefetches elements from {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param bufferSize The maximum number of elements to buffer in an iterator over * this dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of PrefetchDataset */ @@ -1255,10 +1599,10 @@ public PrefetchDataset prefetchDataset(Operand inputDataset, /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of PrivateThreadPoolDataset */ public PrivateThreadPoolDataset privateThreadPoolDataset(Operand inputDataset, @@ -1270,25 +1614,29 @@ public PrivateThreadPoolDataset privateThreadPoolDataset(OperandIn the TensorFlow Python API, you can instantiate this dataset via the - * class {@code tf.data.experimental.RandomDataset}. - *

    Instances of this dataset are also created as a result of the - * {@code hoist_random_uniform} static optimization. Whether this optimization is - * performed is determined by the {@code experimental_optimization.hoist_random_uniform} - * option of {@code tf.data.Options}. + * class {@code tf.data.experimental.RandomDatasetV2}. * * @param seed A scalar seed for the random number generator. If either seed or * seed2 is set to be non-zero, the random number generator is seeded * by the given seed. Otherwise, a random seed is used. * @param seed2 A second scalar seed to avoid seed collision. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param seedGenerator A resource for the random number seed generator. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RandomDataset */ public RandomDataset randomDataset(Operand seed, Operand seed2, - List> outputTypes, List outputShapes) { - return RandomDataset.create(scope, seed, seed2, outputTypes, outputShapes); + Operand seedGenerator, List> outputTypes, + List outputShapes, RandomDataset.Options... options) { + return RandomDataset.create(scope, seed, seed2, seedGenerator, outputTypes, outputShapes, options); } /** @@ -1297,13 +1645,15 @@ public RandomDataset randomDataset(Operand seed, Operand seed2, * @param start corresponds to start in python's xrange(). * @param stop corresponds to stop in python's xrange(). * @param step corresponds to step in python's xrange(). - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RangeDataset */ public RangeDataset rangeDataset(Operand start, Operand stop, - Operand step, List> outputTypes, List outputShapes) { - return RangeDataset.create(scope, start, stop, step, outputTypes, outputShapes); + Operand step, List> outputTypes, List outputShapes, + RangeDataset.Options... options) { + return RangeDataset.create(scope, start, stop, step, outputTypes, outputShapes, options); } /** @@ -1314,9 +1664,9 @@ public RangeDataset rangeDataset(Operand start, Operand stop, * @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 the dropRemainder value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param dropRemainder The dropRemainder value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of RebatchDatasetV2 */ public RebatchDatasetV2 rebatchDatasetV2(Operand inputDataset, @@ -1331,12 +1681,12 @@ public RebatchDatasetV2 rebatchDatasetV2(Operand inputDataset, * @param inputDataset A variant tensor representing the input dataset. * @param initialState A nested structure of tensors, representing the initial state of the * transformation. - * @param otherArguments the otherArguments value + * @param otherArguments The otherArguments value * @param f A function that maps {@code (old_state, input_element)} to {@code new_state}. It must take * two arguments and return a nested structures of tensors. The structure of * {@code new_state} must match the structure of {@code initial_state}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ReduceDataset */ @@ -1350,30 +1700,48 @@ public ReduceDataset reduceDataset(Operand inputDataset, /** * Registers a dataset with the tf.data service. * - * @param dataset the dataset value - * @param address the address value - * @param protocol the protocol value - * @param externalStatePolicy the value of the externalStatePolicy property + * @param dataset The dataset value + * @param address The address value + * @param protocol The protocol value + * @param externalStatePolicy The value of the externalStatePolicy attribute + * @param options carries optional attribute values * @return a new instance of RegisterDataset */ public RegisterDataset registerDataset(Operand dataset, Operand address, - Operand protocol, Long externalStatePolicy) { - return RegisterDataset.create(scope, dataset, address, protocol, externalStatePolicy); + Operand protocol, Long externalStatePolicy, RegisterDataset.Options... options) { + return RegisterDataset.create(scope, dataset, address, protocol, externalStatePolicy, options); } /** * Creates a dataset that emits the outputs of {@code input_dataset} {@code count} times. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of times that {@code input_dataset} should * be repeated. A value of {@code -1} indicates that it should be repeated infinitely. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RepeatDataset */ public RepeatDataset repeatDataset(Operand inputDataset, Operand count, - List> outputTypes, List outputShapes) { - return RepeatDataset.create(scope, inputDataset, count, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + RepeatDataset.Options... options) { + return RepeatDataset.create(scope, inputDataset, count, outputTypes, outputShapes, options); + } + + /** + * The RewriteDataset operation + * + * @param inputDataset The inputDataset value + * @param rewriteName The rewriteName value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of RewriteDataset + */ + public RewriteDataset rewriteDataset(Operand inputDataset, + Operand rewriteName, List> outputTypes, + List outputShapes) { + return RewriteDataset.create(scope, inputDataset, rewriteName, outputTypes, outputShapes); } /** @@ -1384,13 +1752,13 @@ public RepeatDataset repeatDataset(Operand inputDataset, Operan * {@code experimental_optimization.filter_with_random_uniform_fusion} option of * {@code tf.data.Options}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param rate A scalar representing the sample rate. Each element of {@code input_dataset} is * retained with this probability, independent of all other elements. * @param seed A scalar representing seed of random number generator. * @param seed2 A scalar representing seed2 of random number generator. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SamplingDataset */ public SamplingDataset samplingDataset(Operand inputDataset, @@ -1400,30 +1768,33 @@ public SamplingDataset samplingDataset(Operand inputDataset, } /** - * The SaveDataset operation + * The SaveDatasetV2 operation * - * @param inputDataset the inputDataset value - * @param path the path value - * @param shardFuncOtherArgs the shardFuncOtherArgs value - * @param shardFunc the value of the shardFunc property + * @param inputDataset The inputDataset value + * @param path The path value + * @param shardFuncOtherArgs The shardFuncOtherArgs value + * @param shardFunc The value of the shardFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of SaveDataset */ public SaveDataset saveDataset(Operand inputDataset, Operand path, Iterable> shardFuncOtherArgs, ConcreteFunction shardFunc, + List> outputTypes, List outputShapes, SaveDataset.Options... options) { - return SaveDataset.create(scope, inputDataset, path, shardFuncOtherArgs, shardFunc, options); + return SaveDataset.create(scope, inputDataset, path, shardFuncOtherArgs, shardFunc, outputTypes, outputShapes, options); } /** * Creates a dataset successively reduces {@code f} over the elements of {@code input_dataset}. * - * @param inputDataset the inputDataset value - * @param initialState the initialState value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param initialState The initialState value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ScanDataset */ @@ -1449,12 +1820,12 @@ public SerializeIterator serializeIterator(Operand resourceHand /** * The SetStatsAggregatorDataset operation * - * @param inputDataset the inputDataset value - * @param statsAggregator the statsAggregator value - * @param tag the tag value - * @param counterPrefix the counterPrefix value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param statsAggregator The statsAggregator value + * @param tag The tag value + * @param counterPrefix The counterPrefix value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SetStatsAggregatorDataset */ public SetStatsAggregatorDataset setStatsAggregatorDataset(Operand inputDataset, @@ -1467,11 +1838,11 @@ public SetStatsAggregatorDataset setStatsAggregatorDataset(Operand inputDataset, Operand< /** * The ShuffleAndRepeatDatasetV2 operation * - * @param inputDataset the inputDataset value - * @param bufferSize the bufferSize value - * @param seed the seed value - * @param seed2 the seed2 value - * @param count the count value - * @param seedGenerator the seedGenerator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param bufferSize The bufferSize value + * @param seed The seed value + * @param seed2 The seed2 value + * @param count The count value + * @param seedGenerator The seedGenerator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ShuffleAndRepeatDataset */ @@ -1506,13 +1877,13 @@ public ShuffleAndRepeatDataset shuffleAndRepeatDataset(Operand /** * The ShuffleDatasetV3 operation * - * @param inputDataset the inputDataset value - * @param bufferSize the bufferSize value - * @param seed the seed value - * @param seed2 the seed2 value - * @param seedGenerator the seedGenerator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param bufferSize The bufferSize value + * @param seed The seed value + * @param seed2 The seed2 value + * @param seedGenerator The seedGenerator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ShuffleDataset */ @@ -1526,25 +1897,27 @@ public ShuffleDataset shuffleDataset(Operand inputDataset, /** * Creates a dataset that skips {@code count} elements from the {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of elements from the {@code input_dataset} * that should be skipped. If count is -1, skips everything. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of SkipDataset */ public SkipDataset skipDataset(Operand inputDataset, Operand count, - List> outputTypes, List outputShapes) { - return SkipDataset.create(scope, inputDataset, count, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + SkipDataset.Options... options) { + return SkipDataset.create(scope, inputDataset, count, outputTypes, outputShapes, options); } /** * The SleepDataset operation * - * @param inputDataset the inputDataset value - * @param sleepMicroseconds the sleepMicroseconds value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param sleepMicroseconds The sleepMicroseconds value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SleepDataset */ public SleepDataset sleepDataset(Operand inputDataset, @@ -1556,21 +1929,38 @@ public SleepDataset sleepDataset(Operand inputDataset, /** * Creates a dataset that passes a sliding window over {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param windowSize A scalar representing the number of elements in the * sliding window. * @param windowShift A scalar representing the steps moving the sliding window * forward in one iteration. It must be positive. * @param windowStride A scalar representing the stride of the input elements of the sliding window. * It must be positive. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of SlidingWindowDataset */ public SlidingWindowDataset slidingWindowDataset(Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, - List> outputTypes, List outputShapes) { - return SlidingWindowDataset.create(scope, inputDataset, windowSize, windowShift, windowStride, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + SlidingWindowDataset.Options... options) { + return SlidingWindowDataset.create(scope, inputDataset, windowSize, windowShift, windowStride, outputTypes, outputShapes, options); + } + + /** + * The SnapshotChunkDataset operation + * + * @param chunkFile The chunkFile value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of SnapshotChunkDataset + */ + public SnapshotChunkDataset snapshotChunkDataset(Operand chunkFile, + List> outputTypes, List outputShapes, + SnapshotChunkDataset.Options... options) { + return SnapshotChunkDataset.create(scope, chunkFile, outputTypes, outputShapes, options); } /** @@ -1582,10 +1972,10 @@ public SlidingWindowDataset slidingWindowDataset(Operand inputD * * @param inputDataset A variant tensor representing the input dataset. * @param path The path we should write snapshots to / read snapshots from. - * @param readerFuncOtherArgs the readerFuncOtherArgs value - * @param shardFuncOtherArgs the shardFuncOtherArgs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param shardFuncOtherArgs The shardFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param readerFunc Optional. A function to control how to read data from snapshot shards. * @param shardFunc Optional. A function to control how to shard data when writing a snapshot. * @param options carries optional attribute values @@ -1599,12 +1989,43 @@ public SnapshotDataset snapshotDataset(Operand inputDataset, return SnapshotDataset.create(scope, inputDataset, path, readerFuncOtherArgs, shardFuncOtherArgs, outputTypes, outputShapes, readerFunc, shardFunc, options); } + /** + * The SnapshotDatasetReader operation + * + * @param shardDir The shardDir value + * @param startIndex The startIndex value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param version The value of the version attribute + * @param options carries optional attribute values + * @return a new instance of SnapshotDatasetReader + */ + public SnapshotDatasetReader snapshotDatasetReader(Operand shardDir, + Operand startIndex, List> outputTypes, + List outputShapes, Long version, SnapshotDatasetReader.Options... options) { + return SnapshotDatasetReader.create(scope, shardDir, startIndex, outputTypes, outputShapes, version, options); + } + + /** + * The SnapshotNestedDatasetReader operation + * + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SnapshotNestedDatasetReader + */ + public SnapshotNestedDatasetReader snapshotNestedDatasetReader( + Iterable> inputs, List> outputTypes, + List outputShapes) { + return SnapshotNestedDatasetReader.create(scope, inputs, outputTypes, outputShapes); + } + /** * Creates a dataset that splits a SparseTensor into elements row-wise. * - * @param indices the indices value - * @param values the values value - * @param denseShape the denseShape value + * @param indices The indices value + * @param values The values value + * @param denseShape The denseShape value * @return a new instance of SparseTensorSliceDataset */ public SparseTensorSliceDataset sparseTensorSliceDataset(Operand indices, @@ -1618,8 +2039,8 @@ public SparseTensorSliceDataset sparseTensorSliceDataset(Operand indices * @param driverName The database type. Currently, the only supported type is 'sqlite'. * @param dataSourceName A connection string to connect to the database. * @param query A SQL query to execute. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SqlDataset */ public SqlDataset sqlDataset(Operand driverName, Operand dataSourceName, @@ -1627,20 +2048,44 @@ public SqlDataset sqlDataset(Operand driverName, Operand dataS return SqlDataset.create(scope, driverName, dataSourceName, query, outputTypes, outputShapes); } + /** + * The StatsAggregatorHandleV2 operation + * + * @param options carries optional attribute values + * @return a new instance of StatsAggregatorHandle + */ + public StatsAggregatorHandle statsAggregatorHandle(StatsAggregatorHandle.Options... options) { + return StatsAggregatorHandle.create(scope, options); + } + + /** + * Set a summary_writer_interface to record statistics using given stats_aggregator. + * + * @param statsAggregator The statsAggregator value + * @param summary The summary value + * @return a new instance of StatsAggregatorSetSummaryWriter + */ + public StatsAggregatorSetSummaryWriter statsAggregatorSetSummaryWriter( + Operand statsAggregator, Operand summary) { + return StatsAggregatorSetSummaryWriter.create(scope, statsAggregator, summary); + } + /** * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of elements from the {@code input_dataset} * that should be taken. A value of {@code -1} indicates that all of {@code input_dataset} * is taken. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TakeDataset */ public TakeDataset takeDataset(Operand inputDataset, Operand count, - List> outputTypes, List outputShapes) { - return TakeDataset.create(scope, inputDataset, count, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + TakeDataset.Options... options) { + return TakeDataset.create(scope, inputDataset, count, outputTypes, outputShapes, options); } /** @@ -1652,41 +2097,46 @@ public TakeDataset takeDataset(Operand inputDataset, OperandOne tensor for each value in {@code other_arguments}. * * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param otherArguments A list of tensors, typically values that were captured when * building a closure for {@code predicate}. * @param predicate A function returning a scalar boolean. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TakeWhileDataset */ public TakeWhileDataset takeWhileDataset(Operand inputDataset, Iterable> otherArguments, ConcreteFunction predicate, - List> outputTypes, List outputShapes) { - return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + TakeWhileDataset.Options... options) { + return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes, options); } /** * Creates a dataset that emits {@code components} as a tuple of tensors once. * - * @param components the components value - * @param outputShapes the value of the outputShapes property + * @param components The components value + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TensorDataset */ - public TensorDataset tensorDataset(Iterable> components, List outputShapes) { - return TensorDataset.create(scope, components, outputShapes); + public TensorDataset tensorDataset(Iterable> components, List outputShapes, + TensorDataset.Options... options) { + return TensorDataset.create(scope, components, outputShapes, options); } /** * Creates a dataset that emits each dim-0 slice of {@code components} once. * - * @param components the components value - * @param outputShapes the value of the outputShapes property + * @param components The components value + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TensorSliceDataset */ public TensorSliceDataset tensorSliceDataset(Iterable> components, - List outputShapes) { - return TensorSliceDataset.create(scope, components, outputShapes); + List outputShapes, TensorSliceDataset.Options... options) { + return TensorSliceDataset.create(scope, components, outputShapes, options); } /** @@ -1697,11 +2147,13 @@ public TensorSliceDataset tensorSliceDataset(Iterable> components, * @param compressionType A scalar containing either (i) the empty string (no * compression), (ii) "ZLIB", or (iii) "GZIP". * @param bufferSize A scalar containing the number of bytes to buffer. + * @param options carries optional attribute values * @return a new instance of TextLineDataset */ public TextLineDataset textLineDataset(Operand filenames, - Operand compressionType, Operand bufferSize) { - return TextLineDataset.create(scope, filenames, compressionType, bufferSize); + Operand compressionType, Operand bufferSize, + TextLineDataset.Options... options) { + return TextLineDataset.create(scope, filenames, compressionType, bufferSize, options); } /** @@ -1713,20 +2165,24 @@ public TextLineDataset textLineDataset(Operand filenames, * compression), (ii) "ZLIB", or (iii) "GZIP". * @param bufferSize A scalar representing the number of bytes to buffer. A value of * 0 means no buffering will be performed. + * @param byteOffsets A scalar or vector containing the number of bytes for each file + * that will be skipped prior to reading. + * @param options carries optional attribute values * @return a new instance of TfRecordDataset */ public TfRecordDataset tfRecordDataset(Operand filenames, - Operand compressionType, Operand bufferSize) { - return TfRecordDataset.create(scope, filenames, compressionType, bufferSize); + Operand compressionType, Operand bufferSize, Operand byteOffsets, + TfRecordDataset.Options... options) { + return TfRecordDataset.create(scope, filenames, compressionType, bufferSize, byteOffsets, options); } /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ThreadPoolDataset */ public ThreadPoolDataset threadPoolDataset(Operand inputDataset, @@ -1735,36 +2191,68 @@ public ThreadPoolDataset threadPoolDataset(Operand inputDataset return ThreadPoolDataset.create(scope, inputDataset, threadPool, outputTypes, outputShapes); } + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param numThreads The number of threads in the thread pool. + * @param displayName A human-readable name for the threads that may be visible in some + * visualizations. + * threadpool. + * @param options carries optional attribute values + * @return a new instance of ThreadPoolHandle + */ + public ThreadPoolHandle threadPoolHandle(Long numThreads, String displayName, + ThreadPoolHandle.Options... options) { + return ThreadPoolHandle.create(scope, numThreads, displayName, options); + } + /** * A dataset that splits the elements of its input into multiple elements. * - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of UnbatchDataset */ public UnbatchDataset unbatchDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + UnbatchDataset.Options... options) { + return UnbatchDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * Uncompresses a compressed dataset element. + * + * @param compressed The compressed value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UncompressElement + */ + public UncompressElement uncompressElement(Operand compressed, List> outputTypes, List outputShapes) { - return UnbatchDataset.create(scope, inputDataset, outputTypes, outputShapes); + return UncompressElement.create(scope, compressed, outputTypes, outputShapes); } /** * Creates a dataset that contains the unique elements of {@code input_dataset}. * - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of UniqueDataset */ public UniqueDataset uniqueDataset(Operand inputDataset, - List> outputTypes, List outputShapes) { - return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + UniqueDataset.Options... options) { + return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes, options); } /** * The UnwrapDatasetVariant operation * - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of UnwrapDatasetVariant */ public UnwrapDatasetVariant unwrapDatasetVariant(Operand inputHandle) { @@ -1809,7 +2297,7 @@ public UnwrapDatasetVariant unwrapDatasetVariant(Operand inputH * produces {@code {{"a": {0, 1}}, {"a": {2, 3}}}} * * - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param sizeOutput An integer scalar, representing the number of elements * of the input dataset to combine into a window. Must be positive. * @param shift An integer scalar, representing the number of input elements @@ -1820,21 +2308,35 @@ public UnwrapDatasetVariant unwrapDatasetVariant(Operand inputH * "retain every input element". * @param dropRemainder A Boolean scalar, representing whether the last window should be * dropped if its size is smaller than {@code window_size}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of WindowDataset */ public WindowDataset windowDataset(Operand inputDataset, Operand sizeOutput, Operand shift, Operand stride, Operand dropRemainder, List> outputTypes, + List outputShapes, WindowDataset.Options... options) { + return WindowDataset.create(scope, inputDataset, sizeOutput, shift, stride, dropRemainder, outputTypes, outputShapes, options); + } + + /** + * The WindowOp operation + * + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of WindowOp + */ + public WindowOp windowOp(Iterable> inputs, List> outputTypes, List outputShapes) { - return WindowDataset.create(scope, inputDataset, sizeOutput, shift, stride, dropRemainder, outputTypes, outputShapes); + return WindowOp.create(scope, inputs, outputTypes, outputShapes); } /** * The WrapDatasetVariant operation * - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of WrapDatasetVariant */ public WrapDatasetVariant wrapDatasetVariant(Operand inputHandle) { @@ -1849,13 +2351,15 @@ public WrapDatasetVariant wrapDatasetVariant(Operand inputHandl * dataset, and no error will be raised if input datasets have different sizes. * * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of ZipDataset */ public ZipDataset zipDataset(Iterable> inputDatasets, - List> outputTypes, List outputShapes) { - return ZipDataset.create(scope, inputDatasets, outputTypes, outputShapes); + List> outputTypes, List outputShapes, + ZipDataset.Options... options) { + return ZipDataset.create(scope, inputDatasets, outputTypes, outputShapes, options); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java new file mode 100644 index 00000000000..4ea1efd10db --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java @@ -0,0 +1,61 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.debugging.CheckNumerics; +import org.tensorflow.types.family.TNumber; + +/** + * An API for building {@code debugging} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DebuggingOps { + private final Scope scope; + + private final Ops ops; + + DebuggingOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Checks a tensor for NaN, -Inf and +Inf values. + * When run, reports an {@code InvalidArgument} error if {@code tensor} has any values + * that are not a number (NaN) or infinity (Inf). Otherwise, returns the input + * tensor. Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf + * in the errors it throws. + * + * @param tensor The tensor value + * @param message Prefix of the error message. + * @param data type for {@code CheckNumericsV2} output and operands + * @return a new instance of CheckNumerics + */ + public CheckNumerics checkNumerics(Operand tensor, String message) { + return CheckNumerics.create(scope, tensor, message); + } + + /** + * 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/DistributeOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DistributeOps.java new file mode 100644 index 00000000000..4f30df6352d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DistributeOps.java @@ -0,0 +1,110 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.distribute.NcclAllReduce; +import org.tensorflow.op.distribute.NcclBroadcast; +import org.tensorflow.op.distribute.NcclReduce; +import org.tensorflow.types.family.TNumber; + +/** + * An API for building {@code distribute} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DistributeOps { + private final Scope scope; + + private final Ops ops; + + DistributeOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * 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 {@code c}, + * then {@code num_devices} ops will run with shared_name value {@code 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 {@code 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 input The input value + * @param reduction The value of the reduction attribute + * @param numDevices The value of the numDevices attribute + * @param sharedName The value of the sharedName attribute + * @param data type for {@code NcclAllReduce} output and operands + * @return a new instance of NcclAllReduce + */ + public NcclAllReduce ncclAllReduce(Operand input, String reduction, + Long numDevices, String sharedName) { + return NcclAllReduce.create(scope, input, reduction, numDevices, sharedName); + } + + /** + * Sends {@code input} to all devices that are connected to the output. + * Sends {@code 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 input The input value + * @param shape The value of the shape attribute + * @param data type for {@code NcclBroadcast} output and operands + * @return a new instance of NcclBroadcast + */ + public NcclBroadcast ncclBroadcast(Operand input, Shape shape) { + return NcclBroadcast.create(scope, input, shape); + } + + /** + * Reduces {@code input} from {@code num_devices} using {@code reduction} to a single device. + * Reduces {@code input} from {@code num_devices} using {@code 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 {@code num_devices} devices. + * reduction: the reduction operation to perform. + * + * @param input The input value + * @param reduction The value of the reduction attribute + * @param data type for {@code NcclReduce} output and operands + * @return a new instance of NcclReduce + */ + public NcclReduce ncclReduce(Iterable> input, + String reduction) { + return NcclReduce.create(scope, input, reduction); + } + + /** + * 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/DtypesOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java index 8fa99de450d..df58cb578a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -21,13 +21,14 @@ import org.tensorflow.op.dtypes.AsString; import org.tensorflow.op.dtypes.Cast; import org.tensorflow.op.dtypes.Complex; +import org.tensorflow.op.dtypes.ToBool; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * An API for building {@code dtypes} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class DtypesOps { private final Scope scope; @@ -43,7 +44,7 @@ public final class DtypesOps { * Converts each entry in the given tensor to strings. * Supports many numeric types and boolean. *

    For Unicode, see the - * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) + * [https://www.tensorflow.org/text/guide/unicode](Working with Unicode text) * tutorial. *

    Examples: *

    @@ -57,7 +58,7 @@ public final class DtypesOps { *
    * * - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @return a new instance of AsString */ @@ -68,9 +69,8 @@ public AsString asString(Operand input, AsString.Options... opt /** * Cast x of type SrcT to y of DstT. * - * @param data type for {@code y} output - * @param x the x value - * @param DstT the value of the DstT property + * @param x The x value + * @param DstT The value of the DstT attribute * @param options carries optional attribute values * @param data type for {@code Cast} output and operands * @return a new instance of Cast @@ -94,10 +94,9 @@ public Cast cast(Operand x, Class DstT, * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] * * - * @param data type for {@code out} output - * @param real the real value - * @param imag the imag value - * @param Tout the value of the Tout property + * @param real The real value + * @param imag The imag value + * @param Tout The value of the Tout attribute * @param data type for {@code Complex} output and operands * @param data type for {@code Complex} output and operands * @return a new instance of Complex @@ -107,6 +106,31 @@ public Complex complex(Operand real, return Complex.create(scope, real, imag, Tout); } + /** + * Converts a tensor to a scalar predicate. + * Converts a tensor to a scalar predicate with the following rules: + *
      + *
    • + *

      For 0D tensors, truthiness is determined by comparing against a "zero" + * value. For numerical types it is the obvious zero. For strings it is the + * empty string. + *

    • + *
    • + *

      For >0D tensors, truthiness is determined by looking at the number of + * elements. If has zero elements, then the result is false. Otherwise the + * result is true. + *

    • + *
    + *

    This matches the behavior of If and While for determining if a tensor counts + * as true/false for a branch condition. + * + * @param input The input value + * @return a new instance of ToBool + */ + public ToBool toBool(Operand input) { + return ToBool.create(scope, input); + } + /** * Get the parent {@link Ops} object. */ 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 94bfe32ace0..896bb62de5c 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -32,24 +32,34 @@ import org.tensorflow.op.image.DecodeImage; import org.tensorflow.op.image.DecodeJpeg; import org.tensorflow.op.image.DecodePng; +import org.tensorflow.op.image.DecodeWebP; import org.tensorflow.op.image.DrawBoundingBoxes; import org.tensorflow.op.image.EncodeJpeg; import org.tensorflow.op.image.EncodeJpegVariableQuality; import org.tensorflow.op.image.EncodePng; +import org.tensorflow.op.image.ExtractGlimpse; import org.tensorflow.op.image.ExtractImagePatches; import org.tensorflow.op.image.ExtractJpegShape; +import org.tensorflow.op.image.GenerateBoundingBoxProposals; import org.tensorflow.op.image.HsvToRgb; +import org.tensorflow.op.image.ImageProjectiveTransformV2; +import org.tensorflow.op.image.ImageProjectiveTransformV3; +import org.tensorflow.op.image.NearestNeighbors; import org.tensorflow.op.image.NonMaxSuppression; import org.tensorflow.op.image.NonMaxSuppressionWithOverlaps; import org.tensorflow.op.image.QuantizedResizeBilinear; import org.tensorflow.op.image.RandomCrop; import org.tensorflow.op.image.ResizeArea; import org.tensorflow.op.image.ResizeBicubic; +import org.tensorflow.op.image.ResizeBicubicGrad; import org.tensorflow.op.image.ResizeBilinear; +import org.tensorflow.op.image.ResizeBilinearGrad; import org.tensorflow.op.image.ResizeNearestNeighbor; +import org.tensorflow.op.image.ResizeNearestNeighborGrad; import org.tensorflow.op.image.RgbToHsv; import org.tensorflow.op.image.SampleDistortedBoundingBox; import org.tensorflow.op.image.ScaleAndTranslate; +import org.tensorflow.op.image.ScaleAndTranslateGrad; import org.tensorflow.op.image.StatelessSampleDistortedBoundingBox; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -62,7 +72,7 @@ /** * An API for building {@code image} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class ImageOps { private final Scope scope; @@ -84,7 +94,6 @@ public final class ImageOps { * channel and then adjusts each component of each pixel to * {@code (x - mean) * contrast_factor + mean}. * - * @param data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param contrastFactor A float multiplier for adjusting contrast. * @param data type for {@code AdjustContrastv2} output and operands @@ -103,7 +112,6 @@ public AdjustContrast adjustContrast(Operand images, * colors are first mapped into HSV. A delta is then applied all the hue values, * and then remapped back to RGB colorspace. * - * @param data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param delta A float delta to add to the hue. * @param data type for {@code AdjustHue} output and operands @@ -121,7 +129,6 @@ public AdjustHue adjustHue(Operand images, Operand data type for {@code output} output * @param images Images to adjust. At least 3-D. * @param scale A float scale to add to the saturation. * @param data type for {@code AdjustSaturation} output and operands @@ -241,7 +248,6 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. * - * @param data type for {@code output} output * @param grads A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. * @param boxes A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified @@ -254,7 +260,7 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, * @param imageSize A 1-D tensor with value {@code [batch, image_height, image_width, depth]} * containing the original image size. Both {@code image_height} and {@code image_width} need * to be positive. - * @param T the value of the T property + * @param T The value of the T attribute * @param options carries optional attribute values * @param data type for {@code CropAndResizeGradImage} output and operands * @return a new instance of CropAndResizeGradImage @@ -331,51 +337,52 @@ public DecodeGif decodeGif(Operand 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 + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, 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: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated 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 animations 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 attribute values * @return a new instance of DecodeImage, with default output types */ - public DecodeImage decodeImage(Operand contents, DecodeImage.Options[] options) { + 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 + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, 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: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated 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 animations 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 attribute values @@ -429,12 +436,11 @@ public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... op *

    This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param data type for {@code image} output * @param contents 0-D. The PNG-encoded image. * @param options carries optional attribute values * @return a new instance of DecodePng, with default output types */ - public DecodePng decodePng(Operand contents, DecodePng.Options[] options) { + public DecodePng decodePng(Operand contents, DecodePng.Options... options) { return DecodePng.create(scope, contents, options); } @@ -454,9 +460,8 @@ public DecodePng decodePng(Operand contents, DecodePng.Options[ *

    This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. * - * @param data type for {@code image} output * @param contents 0-D. The PNG-encoded image. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code DecodePng} output and operands * @return a new instance of DecodePng @@ -466,6 +471,51 @@ public DecodePng decodePng(Operand contents, Cla return DecodePng.create(scope, contents, dtype, options); } + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + *

    Accepted values are: + *

      + *
    • 0: Use the number of channels in the WebP-encoded image.
    • + *
    • 3: output an RGB image.
    • + *
    • 4: output an RGBA image.
    • + *
    + *

    The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param options carries optional attribute values + * @return a new instance of DecodeWebP, with default output types + */ + public DecodeWebP decodeWebP(Operand contents, DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, options); + } + + /** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + *

    Accepted values are: + *

      + *
    • 0: Use the number of channels in the WebP-encoded image.
    • + *
    • 3: output an RGB image.
    • + *
    • 4: output an RGBA image.
    • + *
    + *

    The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + * + * @param contents 0-D. The WebP-encoded image. + * @param dtype The value of the dtype attribute + * @param options carries optional attribute values + * @param data type for {@code DecodeWebP} output and operands + * @return a new instance of DecodeWebP + */ + public DecodeWebP decodeWebP(Operand contents, Class dtype, + DecodeWebP.Options... options) { + return DecodeWebP.create(scope, contents, dtype, options); + } + /** * Draw bounding boxes on a batch of images. * Outputs a copy of {@code images} but draws on top of the pixels zero or more bounding @@ -478,7 +528,6 @@ public DecodePng decodePng(Operand contents, Cla * the bounding box will be {@code (40, 10)} to {@code (100, 50)} (in (x,y) coordinates). *

    Parts of the bounding box may fall outside the image. * - * @param data type for {@code output} output * @param images 4-D with shape {@code [batch, height, width, depth]}. A batch of images. * @param boxes 3-D with shape {@code [batch, num_bounding_boxes, 4]} containing bounding * boxes. @@ -554,10 +603,45 @@ public EncodePng encodePng(Operand image, EncodePng.Options.. return EncodePng.create(scope, image, options); } + /** + * Extracts a glimpse from the input tensor. + * Returns a set of windows called glimpses extracted at location + * {@code offsets} from the input tensor. If the windows only partially + * overlaps the inputs, the non overlapping areas will be filled with + * random noise. + *

    The result is a 4-D tensor of shape {@code [batch_size, glimpse_height, glimpse_width, channels]}. The channels and batch dimensions are the + * same as that of the input tensor. The height and width of the output + * windows are specified in the {@code size} parameter. + *

    The argument {@code normalized} and {@code centered} controls how the windows are built: + *

      + *
    • If the coordinates are normalized but not centered, 0.0 and 1.0 + * correspond to the minimum and maximum of each height and width + * dimension.
    • + *
    • If the coordinates are both normalized and centered, they range from + * -1.0 to 1.0. The coordinates (-1.0, -1.0) correspond to the upper + * left corner, the lower right corner is located at (1.0, 1.0) and the + * center is at (0, 0).
    • + *
    • If the coordinates are not normalized they are interpreted as + * numbers of pixels.
    • + *
    + * + * @param input A 4-D float tensor of shape {@code [batch_size, height, width, channels]}. + * @param sizeOutput A 1-D tensor of 2 elements containing the size of the glimpses + * to extract. The glimpse height must be specified first, following + * by the glimpse width. + * @param offsets A 2-D integer tensor of shape {@code [batch_size, 2]} containing + * the y, x locations of the center of each window. + * @param options carries optional attribute values + * @return a new instance of ExtractGlimpse + */ + public ExtractGlimpse extractGlimpse(Operand input, Operand sizeOutput, + Operand offsets, ExtractGlimpse.Options... options) { + return ExtractGlimpse.create(scope, input, sizeOutput, offsets, options); + } + /** * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. * - * @param data type for {@code patches} output * @param images 4-D Tensor with shape {@code [batch, in_rows, in_cols, depth]}. * @param ksizes The size of the sliding window for each dimension of {@code images}. * @param strides How far the centers of two consecutive patches are in @@ -581,7 +665,6 @@ public ExtractImagePatches extractImagePatches(Operand i * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @return a new instance of ExtractJpegShape, with default output types */ @@ -593,7 +676,6 @@ public ExtractJpegShape extractJpegShape(Operand contents) { * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. * - * @param data type for {@code image_shape} output * @param contents 0-D. The JPEG-encoded image. * @param outputType (Optional) The output type of the operation (int32 or int64). * Defaults to int32. @@ -605,6 +687,40 @@ public ExtractJpegShape extractJpegShape(Operand return ExtractJpegShape.create(scope, contents, outputType); } + /** + * This op produces Region of Interests from given bounding boxes(bbox_deltas) encoded wrt anchors according to eq.2 in arXiv:1506.01497 + *
    +   *    The op selects top `pre_nms_topn` scoring boxes, decodes them with respect to anchors,
    +   *    applies non-maximal suppression on overlapping boxes with higher than
    +   *    `nms_threshold` intersection-over-union (iou) value, discarding boxes where shorter
    +   *    side is less than `min_size`.
    +   *    Inputs:
    +   *    `scores`: A 4D tensor of shape [Batch, Height, Width, Num Anchors] containing the scores per anchor at given position
    +   *    `bbox_deltas`: is a tensor of shape [Batch, Height, Width, 4 x Num Anchors] boxes encoded to each anchor
    +   *    `anchors`: A 1D tensor of shape [4 x Num Anchors], representing the anchors.
    +   *    Outputs:
    +   *    `rois`: output RoIs, a 3D tensor of shape [Batch, post_nms_topn, 4], padded by 0 if less than post_nms_topn candidates found.
    +   *    `roi_probabilities`: probability scores of each roi in 'rois', a 2D tensor of shape [Batch,post_nms_topn], padded with 0 if needed, sorted by scores.
    +   *  
    + * + * @param scores A 4-D float tensor of shape {@code [num_images, height, width, num_achors]} containing scores of the boxes for given anchors, can be unsorted. + * @param bboxDeltas A 4-D float tensor of shape {@code [num_images, height, width, 4 x num_anchors]}. encoding boxes with respec to each anchor. + * Coordinates are given in the form [dy, dx, dh, dw]. + * @param imageInfo A 2-D float tensor of shape {@code [num_images, 5]} containing image information Height, Width, Scale. + * @param anchors A 2-D float tensor of shape {@code [num_anchors, 4]} describing the anchor boxes. Boxes are formatted in the form [y1, x1, y2, x2]. + * @param nmsThreshold A scalar float tensor for non-maximal-suppression threshold. + * @param preNmsTopn A scalar int tensor for the number of top scoring boxes to be used as input. + * @param minSize A scalar float tensor. Any box that has a smaller size than min_size will be discarded. + * @param options carries optional attribute values + * @return a new instance of GenerateBoundingBoxProposals + */ + public GenerateBoundingBoxProposals generateBoundingBoxProposals(Operand scores, + Operand bboxDeltas, Operand imageInfo, Operand anchors, + Operand nmsThreshold, Operand preNmsTopn, Operand minSize, + GenerateBoundingBoxProposals.Options... options) { + return GenerateBoundingBoxProposals.create(scope, scores, bboxDeltas, imageInfo, anchors, nmsThreshold, preNmsTopn, minSize, options); + } + /** * Convert one or more images from HSV to RGB. * Outputs a tensor of the same shape as the {@code images} tensor, containing the RGB @@ -612,7 +728,6 @@ public ExtractJpegShape extractJpegShape(Operand * are in {@code [0,1]}. *

    See {@code rgb_to_hsv} for a description of the HSV encoding. * - * @param data type for {@code output} output * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. * @param data type for {@code HSVToRGB} output and operands * @return a new instance of HsvToRgb @@ -621,6 +736,73 @@ public HsvToRgb hsvToRgb(Operand images) { return HsvToRgb.create(scope, images); } + /** + * Applies the given transform to each of the images. + * If one row of {@code transforms} is {@code [a0, a1, a2, b0, b1, b2, c0, c1]}, then it maps + * the output point {@code (x, y)} to a transformed input point + * {@code (x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)}, where + * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input + * image, the output pixel is set to 0. + * + * @param images 4-D with shape {@code [batch, height, width, channels]}. + * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [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 interpolation Interpolation method, "NEAREST" or "BILINEAR". + * @param options carries optional attribute values + * @param data type for {@code ImageProjectiveTransformV2} output and operands + * @return a new instance of ImageProjectiveTransformV2 + */ + public ImageProjectiveTransformV2 imageProjectiveTransformV2( + Operand images, Operand transforms, Operand outputShape, + String interpolation, ImageProjectiveTransformV2.Options... options) { + return ImageProjectiveTransformV2.create(scope, images, transforms, outputShape, interpolation, options); + } + + /** + * Applies the given transform to each of the images. + * If one row of {@code transforms} is {@code [a0, a1, a2, b0, b1, b2, c0, c1]}, then it maps + * the output point {@code (x, y)} to a transformed input point + * {@code (x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)}, where + * {@code 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 images 4-D with shape {@code [batch, height, width, channels]}. + * @param transforms 2-D Tensor, {@code [batch, 8]} or {@code [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 attribute values + * @param data type for {@code ImageProjectiveTransformV3} output and operands + * @return a new instance of ImageProjectiveTransformV3 + */ + public ImageProjectiveTransformV3 imageProjectiveTransformV3( + Operand images, Operand transforms, Operand outputShape, + Operand fillValue, String interpolation, + ImageProjectiveTransformV3.Options... options) { + return ImageProjectiveTransformV3.create(scope, images, transforms, outputShape, fillValue, interpolation, options); + } + + /** + * Selects the k nearest centers for each point. + * Rows of points are assumed to be input points. Rows of centers are assumed to be + * the list of candidate centers. For each point, the k centers that have least L2 + * distance to it are computed. + * + * @param points Matrix of shape (n, d). Rows are assumed to be input points. + * @param centers Matrix of shape (m, d). Rows are assumed to be centers. + * @param k Number of nearest centers to return for each point. If k is larger than m, then + * only m centers are returned. + * @return a new instance of NearestNeighbors + */ + public NearestNeighbors nearestNeighbors(Operand points, Operand centers, + Operand k) { + return NearestNeighbors.create(scope, points, centers, k); + } + /** * Greedily selects a subset of bounding boxes in descending order of score, * pruning away boxes that have high intersection-over-union (IOU) overlap @@ -646,7 +828,6 @@ public HsvToRgb hsvToRgb(Operand images) { * To enable this Soft-NMS mode, set the {@code soft_nms_sigma} parameter to be * larger than 0. * - * @param data type for {@code selected_scores} output * @param boxes A 2-D float tensor of shape {@code [num_boxes, 4]}. * @param scores A 1-D float tensor of shape {@code [num_boxes]} representing a single * score corresponding to each box (each row of boxes). @@ -706,12 +887,11 @@ public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @param data type for {@code QuantizedResizeBilinear} output and operands * @return a new instance of QuantizedResizeBilinear @@ -730,7 +910,6 @@ public QuantizedResizeBilinear quantizedResizeBilinear(Op * rectangle from that location. The random location is picked so the cropped * area will fit inside the original image. * - * @param data type for {@code output} output * @param image 3-D of shape {@code [height, width, channels]}. * @param sizeOutput 1-D of length 2 containing: {@code crop_height}, {@code crop_width}.. * @param options carries optional attribute values @@ -780,6 +959,21 @@ public ResizeBicubic resizeBicubic(Operand images, Operand data type for {@code ResizeBicubicGrad} output and operands + * @return a new instance of ResizeBicubicGrad + */ + public ResizeBicubicGrad resizeBicubicGrad(Operand grads, + Operand originalImage, ResizeBicubicGrad.Options... options) { + return ResizeBicubicGrad.create(scope, grads, originalImage, options); + } + /** * Resize {@code images} to {@code size} using bilinear interpolation. * Input images can be of different types but output images are always float. @@ -795,10 +989,24 @@ public ResizeBilinear resizeBilinear(Operand images, return ResizeBilinear.create(scope, images, sizeOutput, options); } + /** + * Computes the gradient of bilinear interpolation. + * + * @param grads 4-D with shape {@code [batch, height, width, channels]}. + * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, + * The image tensor that was resized. + * @param options carries optional attribute values + * @param data type for {@code ResizeBilinearGrad} output and operands + * @return a new instance of ResizeBilinearGrad + */ + public ResizeBilinearGrad resizeBilinearGrad(Operand grads, + Operand originalImage, ResizeBilinearGrad.Options... options) { + return ResizeBilinearGrad.create(scope, grads, originalImage, options); + } + /** * Resize {@code images} to {@code size} using nearest neighbor interpolation. * - * @param data type for {@code resized_images} output * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -811,6 +1019,21 @@ public ResizeNearestNeighbor resizeNearestNeighbor(Operan return ResizeNearestNeighbor.create(scope, images, sizeOutput, options); } + /** + * Computes the gradient of nearest neighbor interpolation. + * + * @param grads 4-D with shape {@code [batch, height, width, channels]}. + * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code orig_height, orig_width}. The + * original input size. + * @param options carries optional attribute values + * @param data type for {@code ResizeNearestNeighborGrad} output and operands + * @return a new instance of ResizeNearestNeighborGrad + */ + public ResizeNearestNeighborGrad resizeNearestNeighborGrad( + Operand grads, Operand sizeOutput, ResizeNearestNeighborGrad.Options... options) { + return ResizeNearestNeighborGrad.create(scope, grads, sizeOutput, options); + } + /** * Converts one or more images from RGB to HSV. * Outputs a tensor of the same shape as the {@code images} tensor, containing the HSV @@ -835,7 +1058,6 @@ public ResizeNearestNeighbor resizeNearestNeighbor(Operan * * * - * @param data type for {@code output} output * @param images 1-D or higher rank. RGB data to convert. Last dimension must be size 3. * @param data type for {@code RGBToHSV} output and operands * @return a new instance of RgbToHsv @@ -880,7 +1102,6 @@ public RgbToHsv rgbToHsv(Operand images) { * bounding box covering the whole image. If {@code 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 {@code [height, width, channels]}. * @param boundingBoxes 3-D with shape {@code [batch, N, 4]} describing the N bounding boxes * associated with the image. @@ -901,10 +1122,10 @@ public SampleDistortedBoundingBox sampleDistortedBounding /** * The ScaleAndTranslate operation * - * @param images the images value - * @param sizeOutput the sizeOutput value - * @param scale the scale value - * @param translation the translation value + * @param images The images value + * @param sizeOutput The sizeOutput value + * @param scale The scale value + * @param translation The translation value * @param options carries optional attribute values * @return a new instance of ScaleAndTranslate */ @@ -914,6 +1135,23 @@ public ScaleAndTranslate scaleAndTranslate(Operand images, return ScaleAndTranslate.create(scope, images, sizeOutput, scale, translation, options); } + /** + * The ScaleAndTranslateGrad operation + * + * @param grads The grads value + * @param originalImage The originalImage value + * @param scale The scale value + * @param translation The translation value + * @param options carries optional attribute values + * @param data type for {@code ScaleAndTranslateGrad} output and operands + * @return a new instance of ScaleAndTranslateGrad + */ + public ScaleAndTranslateGrad scaleAndTranslateGrad(Operand grads, + Operand originalImage, Operand scale, Operand translation, + ScaleAndTranslateGrad.Options... options) { + return ScaleAndTranslateGrad.create(scope, grads, originalImage, 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 @@ -975,7 +1213,6 @@ public ScaleAndTranslate scaleAndTranslate(Operand images, * bounding box covering the whole image. If {@code 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 {@code [height, width, channels]}. * @param boundingBoxes 3-D with shape {@code [batch, N, 4]} describing the N bounding boxes * associated with the image. diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java index 889c234eff1..5c33c56e962 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -27,7 +27,9 @@ import org.tensorflow.op.io.DecodePaddedRaw; import org.tensorflow.op.io.DecodeRaw; import org.tensorflow.op.io.DeserializeManySparse; +import org.tensorflow.op.io.DisableCopyOnRead; import org.tensorflow.op.io.EncodeBase64; +import org.tensorflow.op.io.FakeQueue; import org.tensorflow.op.io.FifoQueue; import org.tensorflow.op.io.FixedLengthRecordReader; import org.tensorflow.op.io.IdentityReader; @@ -76,7 +78,7 @@ /** * An API for building {@code io} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class IoOps { private final Scope scope; @@ -90,8 +92,9 @@ public final class IoOps { /** * Decode web-safe base64-encoded strings. - * Input may or may not have padding at the end. See EncodeBase64 for padding. - * Web-safe means that input must use - and _ instead of + and /. + * Input may or may not have padding at the end. See + * EncodeBase64 + * for padding. Web-safe means that input must use - and _ instead of + and /. * * @param input Base64 strings to decode. * @return a new instance of DecodeBase64 @@ -157,11 +160,10 @@ public DecodeJsonExample decodeJsonExample(Operand jsonExamples) { /** * Reinterpret the bytes of a string as a vector of numbers. * - * @param data type for {@code output} output * @param inputBytes Tensor of string to be decoded. * @param fixedLength Length in bytes for each element of the decoded output. Must be a multiple * of the size of the output type. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param options carries optional attribute values * @param data type for {@code DecodePaddedRaw} output and operands * @return a new instance of DecodePaddedRaw @@ -174,9 +176,8 @@ public DecodePaddedRaw decodePaddedRaw(Operand i /** * Reinterpret the bytes of a string as a vector of numbers. * - * @param data type for {@code output} output * @param bytes All the elements must have the same length. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param options carries optional attribute values * @param data type for {@code DecodeRaw} output and operands * @return a new instance of DecodeRaw @@ -228,7 +229,6 @@ public DecodeRaw decodeRaw(Operand bytes, Class * shape = [2 50] * * - * @param data type for {@code sparse_values} output * @param serializedSparse 2-D, The {@code N} serialized {@code SparseTensor} objects. * Must have 3 columns. * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. @@ -240,10 +240,21 @@ public DeserializeManySparse deserializeManySparse( return DeserializeManySparse.create(scope, serializedSparse, dtype); } + /** + * Turns off the copy-on-read mode. + * Turns off the copy-on-read mode of a resource variable. If the variable is not in copy-on-read mode, this op has no effect. + * + * @param resource The resource handle of the resource variable. + * @return a new instance of DisableCopyOnRead + */ + public DisableCopyOnRead disableCopyOnRead(Operand resource) { + return DisableCopyOnRead.create(scope, resource); + } + /** * Encode strings into web-safe base64 format. - * Refer to the following article for more information on base64 format: - * en.wikipedia.org/wiki/Base64. Base64 strings may have padding with '=' at the + * Refer to this article for more information on + * base64 format. Base64 strings may have padding with '=' at the * end so that the encoded has length multiple of 4. See Padding section of the * link above. *

    Web-safe means that the encoder uses - and _ instead of + and /. @@ -256,6 +267,16 @@ public EncodeBase64 encodeBase64(Operand input, EncodeBase64.Options... return EncodeBase64.create(scope, input, options); } + /** + * Deprecated. Do not use. + * + * @param resource The resource value + * @return a new instance of FakeQueue + */ + public FakeQueue fakeQueue(Operand resource) { + return FakeQueue.create(scope, resource); + } + /** * A queue that produces elements in first-in first-out order. * @@ -430,7 +451,7 @@ public ParseExample parseExample(Operand serialized, Operand n * DT_INT64 (Int64List), and DT_STRING (BytesList). * @param contextRaggedValueTypes RaggedTensor.value dtypes for the ragged context features. * @param contextRaggedSplitTypes RaggedTensor.row_split dtypes for the ragged context features. - * @param featureListDenseTypes the value of the featureListDenseTypes property + * @param featureListDenseTypes The value of the featureListDenseTypes attribute * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types * of data in each FeatureList given in feature_list_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), @@ -534,7 +555,7 @@ public ParseSingleExample parseSingleExample(Operand serialized, * each context Feature given in context_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), * DT_INT64 (Int64List), and DT_STRING (BytesList). - * @param featureListDenseTypes the value of the featureListDenseTypes property + * @param featureListDenseTypes The value of the featureListDenseTypes attribute * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types * of data in each FeatureList given in feature_list_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), @@ -557,7 +578,6 @@ public ParseSingleSequenceExample parseSingleSequenceExample(Operand se /** * Transforms a serialized tensorflow.TensorProto proto into a Tensor. * - * @param data type for {@code output} output * @param serialized A scalar string containing a serialized TensorProto proto. * @param outType The type of the serialized tensor. The provided type must match the * type of the serialized tensor and no implicit conversion will take place. @@ -751,7 +771,7 @@ public RandomShuffleQueue randomShuffleQueue(List> compon /** * Reads and outputs the entire contents of the input filename. * - * @param filename the filename value + * @param filename The filename value * @return a new instance of ReadFile */ public ReadFile readFile(Operand filename) { @@ -859,7 +879,6 @@ public ReaderSerializeState readerSerializeState(Operand reader * rank {@code R-1}. *

    The minibatch size {@code N} is extracted from {@code sparse_shape[0]}. * - * @param data type for {@code serialized_sparse} output * @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}. * @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}. * @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}. @@ -879,7 +898,6 @@ public SerializeManySparse serializeManySparse(Operand sparseIn * rank {@code R-1}. *

    The minibatch size {@code N} is extracted from {@code sparse_shape[0]}. * - * @param data type for {@code serialized_sparse} output * @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}. * @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}. * @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}. @@ -896,7 +914,6 @@ public SerializeManySparse serializeManySparse(Operand data type for {@code serialized_sparse} output * @param sparseIndices 2-D. The {@code indices} of the {@code SparseTensor}. * @param sparseValues 1-D. The {@code values} of the {@code SparseTensor}. * @param sparseShape 1-D. The {@code shape} of the {@code SparseTensor}. @@ -910,7 +927,6 @@ public SerializeSparse serializeSparse(Operand sparseIndices, /** * Serialize a {@code SparseTensor} into a {@code [3]} {@code Tensor} object. * - * @param data type for {@code serialized_sparse} output * @param sparseIndices 2-D. The {@code indices} of the {@code SparseTensor}. * @param sparseValues 1-D. The {@code values} of the {@code SparseTensor}. * @param sparseShape 1-D. The {@code shape} of the {@code SparseTensor}. @@ -938,9 +954,9 @@ public SerializeTensor serializeTensor(Operand tensor) { * Generate a sharded filename. The filename is printf formatted as * %s-%05d-of-%05d, basename, shard, num_shards. * - * @param basename the basename value - * @param shard the shard value - * @param numShards the numShards value + * @param basename The basename value + * @param shard The shard value + * @param numShards The numShards value * @return a new instance of ShardedFilename */ public ShardedFilename shardedFilename(Operand basename, Operand shard, @@ -951,8 +967,8 @@ public ShardedFilename shardedFilename(Operand basename, Operand basename, Operand numShards) { @@ -992,8 +1008,8 @@ public WholeFileReader wholeFileReader(WholeFileReader.Options... options) { } /** - * Writes contents to the file at input filename. Creates file and recursively - * creates directory if not existing. + * Writes {@code contents} to the file at input {@code filename}. + * Creates the file and recursively creates directory if it does not exist. * * @param filename scalar. The name of the file to which we write the contents. * @param contents scalar. The content to be written to the output file. 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 192973c6a32..7cb8027ca3a 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -19,6 +19,7 @@ import org.tensorflow.Operand; import org.tensorflow.op.linalg.BandPart; +import org.tensorflow.op.linalg.BandedTriangularSolve; import org.tensorflow.op.linalg.BatchCholesky; import org.tensorflow.op.linalg.BatchCholeskyGrad; import org.tensorflow.op.linalg.BatchMatrixBandPart; @@ -49,10 +50,15 @@ import org.tensorflow.op.linalg.MatrixDiagPart; import org.tensorflow.op.linalg.MatrixDiagPartV3; import org.tensorflow.op.linalg.MatrixDiagV3; +import org.tensorflow.op.linalg.MatrixExponential; +import org.tensorflow.op.linalg.MatrixLogarithm; import org.tensorflow.op.linalg.MatrixSetDiag; import org.tensorflow.op.linalg.MatrixSolveLs; import org.tensorflow.op.linalg.Qr; import org.tensorflow.op.linalg.QuantizedMatMul; +import org.tensorflow.op.linalg.QuantizedMatMulWithBias; +import org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndRelu; +import org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndReluAndRequantize; import org.tensorflow.op.linalg.SelfAdjointEig; import org.tensorflow.op.linalg.Solve; import org.tensorflow.op.linalg.Sqrtm; @@ -61,6 +67,8 @@ import org.tensorflow.op.linalg.TensorDiagPart; import org.tensorflow.op.linalg.Transpose; import org.tensorflow.op.linalg.TriangularSolve; +import org.tensorflow.op.linalg.TridiagonalMatMul; +import org.tensorflow.op.linalg.TridiagonalSolve; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; import org.tensorflow.types.TInt32; @@ -72,9 +80,11 @@ /** * An API for building {@code linalg} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class LinalgOps { + public final LinalgSparseOps sparse; + private final Scope scope; private final Ops ops; @@ -82,6 +92,7 @@ public final class LinalgOps { LinalgOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + sparse = new LinalgSparseOps(ops); } /** @@ -116,7 +127,6 @@ public final class LinalgOps { * tf.linalg.band_part(input, 0, 0) ==> Diagonal. * * - * @param data type for {@code band} output * @param input Rank {@code k} tensor. * @param numLower 0-D tensor. Number of subdiagonals to keep. If negative, keep entire * lower triangle. @@ -131,11 +141,24 @@ public BandPart bandPart(Operand inpu return BandPart.create(scope, input, numLower, numUpper); } + /** + * The BandedTriangularSolve operation + * + * @param matrix The matrix value + * @param rhs The rhs value + * @param options carries optional attribute values + * @param data type for {@code BandedTriangularSolve} output and operands + * @return a new instance of BandedTriangularSolve + */ + public BandedTriangularSolve bandedTriangularSolve(Operand matrix, + Operand rhs, BandedTriangularSolve.Options... options) { + return BandedTriangularSolve.create(scope, matrix, rhs, options); + } + /** * The BatchCholesky operation * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code BatchCholesky} output and operands * @return a new instance of BatchCholesky */ @@ -146,9 +169,8 @@ public BatchCholesky batchCholesky(Operand input) { /** * The BatchCholeskyGrad operation * - * @param data type for {@code output} output - * @param l the l value - * @param grad the grad value + * @param l The l value + * @param grad The grad value * @param data type for {@code BatchCholeskyGrad} output and operands * @return a new instance of BatchCholeskyGrad */ @@ -159,10 +181,9 @@ public BatchCholeskyGrad batchCholeskyGrad(Operand l, /** * The BatchMatrixBandPart operation * - * @param data type for {@code band} output - * @param input the input value - * @param numLower the numLower value - * @param numUpper the numUpper value + * @param input The input value + * @param numLower The numLower value + * @param numUpper The numUpper value * @param data type for {@code BatchMatrixBandPart} output and operands * @return a new instance of BatchMatrixBandPart */ @@ -174,8 +195,7 @@ public BatchMatrixBandPart batchMatrixBandPart(Operand i /** * The BatchMatrixDeterminant operation * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code BatchMatrixDeterminant} output and operands * @return a new instance of BatchMatrixDeterminant */ @@ -186,8 +206,7 @@ public BatchMatrixDeterminant batchMatrixDeterminant(Operan /** * The BatchMatrixDiag operation * - * @param data type for {@code output} output - * @param diagonal the diagonal value + * @param diagonal The diagonal value * @param data type for {@code BatchMatrixDiag} output and operands * @return a new instance of BatchMatrixDiag */ @@ -198,8 +217,7 @@ public BatchMatrixDiag batchMatrixDiag(Operand diagonal) /** * The BatchMatrixDiagPart operation * - * @param data type for {@code diagonal} output - * @param input the input value + * @param input The input value * @param data type for {@code BatchMatrixDiagPart} output and operands * @return a new instance of BatchMatrixDiagPart */ @@ -209,9 +227,12 @@ public BatchMatrixDiagPart batchMatrixDiagPart(Operand i /** * The BatchMatrixInverse operation + * DEPRECATED: This operation is deprecated and will be removed in a future version. + * Use tf.linalg.inv instead. + *

    Computes the inverse of one or more square invertible matrices or their + * adjoints (conjugate transposes). * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchMatrixInverse} output and operands * @return a new instance of BatchMatrixInverse @@ -224,9 +245,8 @@ public BatchMatrixInverse batchMatrixInverse(Operand i /** * The BatchMatrixSetDiag operation * - * @param data type for {@code output} output - * @param input the input value - * @param diagonal the diagonal value + * @param input The input value + * @param diagonal The diagonal value * @param data type for {@code BatchMatrixSetDiag} output and operands * @return a new instance of BatchMatrixSetDiag */ @@ -238,9 +258,8 @@ public BatchMatrixSetDiag batchMatrixSetDiag(Operand inp /** * The BatchMatrixSolve operation * - * @param data type for {@code output} output - * @param matrix the matrix value - * @param rhs the rhs value + * @param matrix The matrix value + * @param rhs The rhs value * @param options carries optional attribute values * @param data type for {@code BatchMatrixSolve} output and operands * @return a new instance of BatchMatrixSolve @@ -253,10 +272,9 @@ public BatchMatrixSolve batchMatrixSolve(Operand matri /** * The BatchMatrixSolveLs operation * - * @param data type for {@code output} output - * @param matrix the matrix value - * @param rhs the rhs value - * @param l2Regularizer the l2Regularizer value + * @param matrix The matrix value + * @param rhs The rhs value + * @param l2Regularizer The l2Regularizer value * @param options carries optional attribute values * @param data type for {@code BatchMatrixSolveLs} output and operands * @return a new instance of BatchMatrixSolveLs @@ -269,9 +287,8 @@ public BatchMatrixSolveLs batchMatrixSolveLs(Operand m /** * The BatchMatrixTriangularSolve operation * - * @param data type for {@code output} output - * @param matrix the matrix value - * @param rhs the rhs value + * @param matrix The matrix value + * @param rhs The rhs value * @param options carries optional attribute values * @param data type for {@code BatchMatrixTriangularSolve} output and operands * @return a new instance of BatchMatrixTriangularSolve @@ -284,8 +301,7 @@ public BatchMatrixTriangularSolve batchMatrixTriangularSo /** * The BatchSelfAdjointEigV2 operation * - * @param data type for {@code e} output - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchSelfAdjointEigV2} output and operands * @return a new instance of BatchSelfAdjointEig @@ -298,8 +314,7 @@ public BatchSelfAdjointEig batchSelfAdjointEig(Operand /** * The BatchSvd operation * - * @param data type for {@code s} output - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchSvd} output and operands * @return a new instance of BatchSvd @@ -321,7 +336,6 @@ public BatchSvd batchSvd(Operand input, BatchSvd.Options * not for large batch dimensions when the submatrices are small. In this * case it might be faster to use the CPU. * - * @param data type for {@code output} output * @param input Shape is {@code [..., M, M]}. * @param data type for {@code Cholesky} output and operands * @return a new instance of Cholesky @@ -335,7 +349,6 @@ public Cholesky cholesky(Operand input) { * For an explanation see "Differentiation of the Cholesky algorithm" by * Iain Murray http://arxiv.org/abs/1602.07527. * - * @param data type for {@code output} output * @param l Output of batch Cholesky algorithm l = cholesky(A). Shape is {@code [..., M, M]}. * Algorithm depends only on lower triangular part of the innermost matrices of * this tensor. @@ -355,9 +368,8 @@ public CholeskyGrad choleskyGrad(Operand l, Operand * {@code y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]} * {@code y[i,j,k,...,s,t,u] == conj(x[perm[i], perm[j], perm[k],...,perm[s], perm[t], perm[u]])} * - * @param data type for {@code y} output - * @param x the x value - * @param perm the perm value + * @param x The x value + * @param perm The perm value * @param data type for {@code ConjugateTranspose} output and operands * @return a new instance of ConjugateTranspose */ @@ -372,7 +384,6 @@ public ConjugateTranspose conjugateTranspose(Operand x, * or any shape where the innermost dimension is 3. In the latter case, each pair * of corresponding 3-element vectors is cross-multiplied independently. * - * @param data type for {@code product} output * @param a A tensor containing 3-element vectors. * @param b Another tensor, of same type and shape as {@code a}. * @param data type for {@code Cross} output and operands @@ -388,7 +399,6 @@ public Cross cross(Operand a, Operand b) { * form square matrices. The output is a tensor containing the determinants * for all input submatrices {@code [..., :, :]}. * - * @param data type for {@code output} output * @param input Shape is {@code [..., M, M]}. * @param data type for {@code MatrixDeterminant} output and operands * @return a new instance of Det @@ -410,9 +420,8 @@ public Det det(Operand input) { * e = eig(a, compute_v=False) * * - * @param data type for {@code e} output * @param input {@code Tensor} input of shape {@code [N, N]}. - * @param Tout the value of the Tout property + * @param Tout The value of the Tout attribute * @param options carries optional attribute values * @param data type for {@code Eig} output and operands * @return a new instance of Eig @@ -488,7 +497,6 @@ public Eig eig(Operand input, Class Tou *
    {@literal @}end_compatibility * * - * @param data type for {@code output} output * @param inputs List of 1 or 2 Tensors. * @param equation String describing the Einstein Summation operation; in the format of np.einsum. * @param data type for {@code Einsum} output and operands @@ -505,7 +513,6 @@ public Einsum einsum(Iterable> inputs, String eq * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -528,7 +535,6 @@ public EuclideanNorm euclideanNorm(Operand input, * may detect the condition and raise an exception or it may simply return a * garbage result. * - * @param data type for {@code output} output * @param input Shape is {@code [..., M, M]}. * @param options carries optional attribute values * @param data type for {@code MatrixInverse} output and operands @@ -606,7 +612,6 @@ public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, * is the {@code LU} decomposition of the input and {@code P} is the corresponding * permutation matrix. * - * @param data type for {@code sign} output * @param input Shape is {@code [N, M, M]}. * @param data type for {@code LogMatrixDeterminant} output and operands * @return a new instance of LogMatrixDeterminant @@ -631,8 +636,6 @@ public LogMatrixDeterminant logMatrixDeterminant(Operand * and {@code M-1}, inclusive. If P_mat denotes the permutation matrix corresponding to * P, then the L, U and P satisfies P_mat * input = L * U. * - * @param data type for {@code lu} output - * @param data type for {@code p} output * @param input A tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form matrices of * size {@code [M, M]}. * @param data type for {@code Lu} output and operands @@ -658,11 +661,9 @@ public Lu lu(Operand input) { * and {@code M-1}, inclusive. If P_mat denotes the permutation matrix corresponding to * P, then the L, U and P satisfies P_mat * input = L * U. * - * @param data type for {@code lu} output - * @param data type for {@code p} output * @param input A tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form matrices of * size {@code [M, M]}. - * @param outputIdxType the value of the outputIdxType property + * @param outputIdxType The value of the outputIdxType attribute * @param data type for {@code Lu} output and operands * @param data type for {@code Lu} output and operands * @return a new instance of Lu @@ -681,9 +682,8 @@ public Lu lu(Operand input, *

    Note: The default kernel implementation for MatMul on GPUs uses * cublas. * - * @param data type for {@code product} output - * @param a the a value - * @param b the b value + * @param a The a value + * @param b The b value * @param options carries optional attribute values * @param data type for {@code MatMul} output and operands * @return a new instance of MatMul @@ -775,7 +775,6 @@ public MatMul matMul(Operand a, Operand b, MatMul.Opt * [9, 2]] * * - * @param data type for {@code output} output * @param diagonal Rank {@code r}, where {@code r >= 1} * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main * diagonal, and negative value means subdiagonals. {@code k} can be a single integer @@ -860,7 +859,6 @@ public MatrixDiag matrixDiag(Operand diagonal, Operand * - * @param data type for {@code diagonal} output * @param input Rank {@code r} tensor where {@code r >= 2}. * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main * diagonal, and negative value means subdiagonals. {@code k} can be a single integer @@ -969,7 +967,6 @@ public MatrixDiagPart matrixDiagPart(Operand input, Oper * * * - * @param data type for {@code diagonal} output * @param input Rank {@code r} tensor where {@code r >= 2}. * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main * diagonal, and negative value means subdiagonals. {@code k} can be a single integer @@ -1097,7 +1094,6 @@ public MatrixDiagPartV3 matrixDiagPartV3(Operand input, * * * - * @param data type for {@code output} output * @param diagonal Rank {@code r}, where {@code r >= 1} * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main * diagonal, and negative value means subdiagonals. {@code k} can be a single integer @@ -1121,6 +1117,39 @@ public MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera return MatrixDiagV3.create(scope, diagonal, k, numRows, numCols, paddingValue, options); } + /** + * Deprecated, use python implementation tf.linalg.matrix_exponential. + * + * @param input The input value + * @param data type for {@code MatrixExponential} output and operands + * @return a new instance of MatrixExponential + */ + public MatrixExponential matrixExponential(Operand input) { + return MatrixExponential.create(scope, input); + } + + /** + * Computes the matrix logarithm of one or more square matrices: + * \(log(exp(A)) = A\) + *

    This op is only defined for complex matrices. If A is positive-definite and + * real, then casting to a complex matrix, taking the logarithm and casting back + * to a real matrix will give the correct result. + *

    This function computes the matrix logarithm using the Schur-Parlett algorithm. + * Details of the algorithm can be found in Section 11.6.2 of: + * Nicholas J. Higham, Functions of Matrices: Theory and Computation, SIAM 2008. + * ISBN 978-0-898716-46-7. + *

    The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions + * form square matrices. The output is a tensor of the same shape as the input + * containing the exponential for all input submatrices {@code [..., :, :]}. + * + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixLogarithm} output and operands + * @return a new instance of MatrixLogarithm + */ + public MatrixLogarithm matrixLogarithm(Operand input) { + return MatrixLogarithm.create(scope, input); + } + /** * Returns a batched matrix tensor with new batched diagonal values. * Given {@code input} and {@code diagonal}, this operation returns a tensor with the @@ -1220,7 +1249,6 @@ public MatrixDiagV3 matrixDiagV3(Operand diagonal, Opera * * * - * @param data type for {@code output} output * @param input Rank {@code r+1}, where {@code r >= 1}. * @param diagonal Rank {@code r} when {@code k} is an integer or {@code k[0] == k[1]}. Otherwise, it has rank {@code r+1}. * {@code k >= 1}. @@ -1270,7 +1298,6 @@ public MatrixSetDiag matrixSetDiag(Operand input, Operan * typically 6-7 times slower than the fast path. If {@code fast} is {@code False} then * {@code l2_regularizer} is ignored. * - * @param data type for {@code output} output * @param matrix Shape is {@code [..., M, N]}. * @param rhs Shape is {@code [..., M, K]}. * @param l2Regularizer Scalar tensor. @@ -1301,7 +1328,6 @@ public MatrixSolveLs matrixSolveLs(Operand matrix, Opera * q_full, r_full = qr(a, full_matrices=True) * * - * @param data type for {@code q} output * @param input A tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions * form matrices of size {@code [M, N]}. Let {@code P} be the minimum of {@code M} and {@code N}. * @param options carries optional attribute values @@ -1319,14 +1345,13 @@ public Qr qr(Operand input, Qr.Options... options) { * outer dimension of {@code b} (after being transposed if {@code transposed_b} is * non-zero). * - * @param data type for {@code out} output * @param a Must be a two-dimensional tensor. * @param b Must be a two-dimensional tensor. * @param minA The float value that the lowest quantized {@code a} value represents. * @param maxA The float value that the highest quantized {@code a} value represents. * @param minB The float value that the lowest quantized {@code b} value represents. * @param maxB The float value that the highest quantized {@code b} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param Tactivation The type of output produced by activation function * following this operation. * @param options carries optional attribute values @@ -1341,6 +1366,100 @@ public QuantizedMatMul quantizedMatMul return QuantizedMatMul.create(scope, a, b, minA, maxA, minB, maxB, Toutput, Tactivation, options); } + /** + * Performs a quantized matrix multiplication of {@code a} by the matrix {@code b} with bias + * add. + * The inputs must be two-dimensional matrices and 1D bias vector. And the inner + * dimension of {@code a} (after being transposed if {@code transpose_a} is non-zero) must + * match the outer dimension of {@code b} (after being transposed if {@code transposed_b} is + * non-zero). Then do broadcast add operation with bias values on the matrix + * multiplication result. The bias size must match inner dimension of {@code b}. + * + * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + * @param b A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + * @param bias A 1D bias tensor with size matching inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + * @param minA The float value that the lowest quantized {@code a} value represents. + * @param maxA The float value that the highest quantized {@code a} value represents. + * @param minB The float value that the lowest quantized {@code b} value represents. + * @param maxB The float value that the highest quantized {@code b} value represents. + * @param Toutput The value of the Toutput attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBias} output and operands + * @return a new instance of QuantizedMatMulWithBias + */ + public QuantizedMatMulWithBias quantizedMatMulWithBias( + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, QuantizedMatMulWithBias.Options... options) { + return QuantizedMatMulWithBias.create(scope, a, b, bias, minA, maxA, minB, maxB, Toutput, options); + } + + /** + * Perform a quantized matrix multiplication of {@code a} by the matrix {@code b} with bias + * add and relu fusion. + * The inputs must be two-dimensional matrices and 1D bias vector. And the inner + * dimension of {@code a} (after being transposed if {@code transpose_a} is non-zero) must + * match the outer dimension of {@code b} (after being transposed if {@code transposed_b} is + * non-zero). Then do broadcast add operation with bias values on the matrix + * multiplication result. The bias size must match inner dimension of {@code b}. Then do + * relu activation to get non-negative result. + * + * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + * @param b A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + * @param bias A 1D bias tensor with size matching with inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + * @param minA The float value that the lowest quantized {@code a} value represents. + * @param maxA The float value that the highest quantized {@code a} value represents. + * @param minB The float value that the lowest quantized {@code b} value represents. + * @param maxB The float value that the highest quantized {@code b} value represents. + * @param Toutput The value of the Toutput attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndRelu} output and operands + * @return a new instance of QuantizedMatMulWithBiasAndRelu + */ + public QuantizedMatMulWithBiasAndRelu quantizedMatMulWithBiasAndRelu( + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, QuantizedMatMulWithBiasAndRelu.Options... options) { + return QuantizedMatMulWithBiasAndRelu.create(scope, a, b, bias, minA, maxA, minB, maxB, Toutput, options); + } + + /** + * Perform a quantized matrix multiplication of {@code a} by the matrix {@code b} with bias + * add and relu and requantize fusion. + * The inputs must be two-dimensional matrices and 1D bias vector. And the inner + * dimension of {@code a} (after being transposed if {@code transpose_a} is non-zero) must + * match the outer dimension of {@code b} (after being transposed if {@code transposed_b} is + * non-zero). Then do broadcast add operation with bias values on the matrix + * multiplication result. The bias size must match inner dimension of {@code b}. Then do + * relu activation to get non-negative result. Then do requantize operation to get + * final uint8 result. + * + * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + * @param b A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + * @param bias A 1D bias tensor with size matching with inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + * @param minA The float value that the lowest quantized {@code a} value represents. + * @param maxA The float value that the highest quantized {@code a} value represents. + * @param minB The float value that the lowest quantized {@code b} value represents. + * @param maxB The float value that the highest quantized {@code b} value represents. + * @param minFreezedOutput The float value that the highest quantized output value after requantize. + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndReluAndRequantize} output and operands + * @return a new instance of QuantizedMatMulWithBiasAndReluAndRequantize + */ + public QuantizedMatMulWithBiasAndReluAndRequantize quantizedMatMulWithBiasAndReluAndRequantize( + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, + QuantizedMatMulWithBiasAndReluAndRequantize.Options... options) { + return QuantizedMatMulWithBiasAndReluAndRequantize.create(scope, a, b, bias, minA, maxA, minB, maxB, minFreezedOutput, maxFreezedOutput, Toutput, options); + } + /** * Computes the eigen decomposition of one or more square self-adjoint matrices. * Computes the eigenvalues and (optionally) eigenvectors of each inner matrix in @@ -1354,7 +1473,6 @@ public QuantizedMatMul quantizedMatMul * e = self_adjoint_eig(a, compute_v=False) * * - * @param data type for {@code e} output * @param input {@code Tensor} input of shape {@code [N, N]}. * @param options carries optional attribute values * @param data type for {@code SelfAdjointEigV2} output and operands @@ -1374,7 +1492,6 @@ public SelfAdjointEig selfAdjointEig(Operand input, * If {@code adjoint} is {@code True} then each output matrix satisfies * {@code adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]}. * - * @param data type for {@code output} output * @param matrix Shape is {@code [..., M, M]}. * @param rhs Shape is {@code [..., M, K]}. * @param options carries optional attribute values @@ -1401,7 +1518,6 @@ public Solve solve(Operand matrix, Operand rhs, * form square matrices. The output is a tensor of the same shape as the input * containing the matrix square root for all input submatrices {@code [..., :, :]}. * - * @param data type for {@code output} output * @param input Shape is {@code [..., M, M]}. * @param data type for {@code MatrixSquareRoot} output and operands * @return a new instance of Sqrtm @@ -1423,7 +1539,6 @@ public Sqrtm sqrtm(Operand input) { * s, _, _ = svd(a, compute_uv=False) * * - * @param data type for {@code s} output * @param input A tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions * form matrices of size {@code [M, N]}. Let {@code P} be the minimum of {@code M} and {@code N}. * @param options carries optional attribute values @@ -1450,7 +1565,6 @@ public Svd svd(Operand input, Svd.Options... options) { * [0, 0, 0, 4]] * * - * @param data type for {@code output} output * @param diagonal Rank k tensor where k is at most 1. * @param data type for {@code Diag} output and operands * @return a new instance of TensorDiag @@ -1476,7 +1590,6 @@ public TensorDiag tensorDiag(Operand diagonal) { * tf.diag_part(input) ==> [1, 2, 3, 4] * * - * @param data type for {@code diagonal} output * @param input Rank k tensor where k is even and not zero. * @param data type for {@code DiagPart} output and operands * @return a new instance of TensorDiagPart @@ -1490,9 +1603,8 @@ public TensorDiagPart tensorDiagPart(Operand input) { * The output {@code y} has the same rank as {@code x}. The shapes of {@code x} and {@code y} satisfy: * {@code y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]} * - * @param data type for {@code y} output - * @param x the x value - * @param perm the perm value + * @param x The x value + * @param perm The perm value * @param data type for {@code Transpose} output and operands * @return a new instance of Transpose */ @@ -1545,7 +1657,6 @@ public Transpose transpose(Operand x, Operand * - * @param data type for {@code output} output * @param matrix Shape is {@code [..., M, M]}. * @param rhs Shape is {@code [..., M, K]}. * @param options carries optional attribute values @@ -1557,6 +1668,51 @@ public TriangularSolve triangularSolve(Operand matrix, O return TriangularSolve.create(scope, matrix, rhs, options); } + /** + * Calculate product with tridiagonal matrix. + * Calculates product of two matrices, where left matrix is a tridiagonal matrix. + * + * @param superdiag Tensor of shape {@code [..., 1, M]}, representing superdiagonals of + * tri-diagonal matrices to the left of multiplication. Last element is ignored. + * @param maindiag Tensor of shape {@code [..., 1, M]}, representing main diagonals of tri-diagonal + * matrices to the left of multiplication. + * @param subdiag Tensor of shape {@code [..., 1, M]}, representing subdiagonals of tri-diagonal + * matrices to the left of multiplication. First element is ignored. + * @param rhs Tensor of shape {@code [..., M, N]}, representing MxN matrices to the right of + * multiplication. + * @param data type for {@code TridiagonalMatMul} output and operands + * @return a new instance of TridiagonalMatMul + */ + public TridiagonalMatMul tridiagonalMatMul(Operand superdiag, + Operand maindiag, Operand subdiag, Operand rhs) { + return TridiagonalMatMul.create(scope, superdiag, maindiag, subdiag, rhs); + } + + /** + * Solves tridiagonal systems of equations. + * Solves tridiagonal systems of equations. + * Supports batch dimensions and multiple right-hand sides per each left-hand + * side. + * On CPU, solution is computed via Gaussian elimination with or without partial + * pivoting, depending on {@code partial_pivoting} attribute. On GPU, Nvidia's cuSPARSE + * library is used: https://docs.nvidia.com/cuda/cusparse/index.html#gtsv + * Partial pivoting is not yet supported by XLA backends. + * + * @param diagonals Tensor of shape {@code [..., 3, M]} whose innermost 2 dimensions represent the + * tridiagonal matrices with three rows being the superdiagonal, diagonals, and + * subdiagonals, in order. The last element of the superdiagonal and the first + * element of the subdiagonal is ignored. + * @param rhs Tensor of shape {@code [..., M, K]}, representing K right-hand sides per each + * left-hand side. + * @param options carries optional attribute values + * @param data type for {@code TridiagonalSolve} output and operands + * @return a new instance of TridiagonalSolve + */ + public TridiagonalSolve tridiagonalSolve(Operand diagonals, + Operand rhs, TridiagonalSolve.Options... options) { + return TridiagonalSolve.create(scope, diagonals, rhs, options); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgSparseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgSparseOps.java new file mode 100644 index 00000000000..7210249ba1f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgSparseOps.java @@ -0,0 +1,480 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.linalg.sparse.CSRSparseMatrixComponents; +import org.tensorflow.op.linalg.sparse.CSRSparseMatrixToDense; +import org.tensorflow.op.linalg.sparse.CSRSparseMatrixToSparseTensor; +import org.tensorflow.op.linalg.sparse.DenseToCSRSparseMatrix; +import org.tensorflow.op.linalg.sparse.SparseMatrixAdd; +import org.tensorflow.op.linalg.sparse.SparseMatrixMatMul; +import org.tensorflow.op.linalg.sparse.SparseMatrixMul; +import org.tensorflow.op.linalg.sparse.SparseMatrixNNZ; +import org.tensorflow.op.linalg.sparse.SparseMatrixOrderingAMD; +import org.tensorflow.op.linalg.sparse.SparseMatrixSoftmax; +import org.tensorflow.op.linalg.sparse.SparseMatrixSoftmaxGrad; +import org.tensorflow.op.linalg.sparse.SparseMatrixSparseCholesky; +import org.tensorflow.op.linalg.sparse.SparseMatrixSparseMatMul; +import org.tensorflow.op.linalg.sparse.SparseMatrixTranspose; +import org.tensorflow.op.linalg.sparse.SparseMatrixZeros; +import org.tensorflow.op.linalg.sparse.SparseTensorToCSRSparseMatrix; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code linalg.sparse} operations as {@link Op Op}s + * + * @see Ops + */ +public final class LinalgSparseOps { + private final Scope scope; + + private final Ops ops; + + LinalgSparseOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Reads out the CSR components at batch {@code index}. + * This op is meant only for debugging / testing, and its interface is not expected + * to be stable. + * + * @param csrSparseMatrix A batched CSRSparseMatrix. + * @param index The index in {@code csr_sparse_matrix}'s batch. + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixComponents} output and operands + * @return a new instance of CSRSparseMatrixComponents + */ + public CSRSparseMatrixComponents cSRSparseMatrixComponents( + Operand csrSparseMatrix, Operand index, Class type) { + return CSRSparseMatrixComponents.create(scope, csrSparseMatrix, index, type); + } + + /** + * Convert a (possibly batched) CSRSparseMatrix to dense. + * + * @param sparseInput A batched CSRSparseMatrix. + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixToDense} output and operands + * @return a new instance of CSRSparseMatrixToDense + */ + public CSRSparseMatrixToDense cSRSparseMatrixToDense( + Operand sparseInput, Class type) { + return CSRSparseMatrixToDense.create(scope, sparseInput, type); + } + + /** + * Converts a (possibly batched) CSRSparesMatrix to a SparseTensor. + * + * @param sparseMatrix A (possibly batched) CSRSparseMatrix. + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixToSparseTensor} output and operands + * @return a new instance of CSRSparseMatrixToSparseTensor + */ + public CSRSparseMatrixToSparseTensor cSRSparseMatrixToSparseTensor( + Operand sparseMatrix, Class type) { + return CSRSparseMatrixToSparseTensor.create(scope, sparseMatrix, type); + } + + /** + * Converts a dense tensor to a (possibly batched) CSRSparseMatrix. + * + * @param denseInput A Dense tensor. + * @param indices Indices of nonzero elements. + * @return a new instance of DenseToCSRSparseMatrix + */ + public DenseToCSRSparseMatrix denseToCSRSparseMatrix(Operand denseInput, + Operand indices) { + return DenseToCSRSparseMatrix.create(scope, denseInput, indices); + } + + /** + * Sparse addition of two CSR matrices, C = alpha * A + beta * B. + * The gradients of SparseMatrixAdd outputs with respect to alpha and beta are not + * currently defined (TensorFlow will return zeros for these entries). + * + * @param a A CSRSparseMatrix. + * @param b A CSRSparseMatrix. + * @param alpha A constant scalar. + * @param beta A constant scalar. + * @param data type for {@code SparseMatrixAdd} output and operands + * @return a new instance of SparseMatrixAdd + */ + public SparseMatrixAdd sparseMatrixAdd(Operand a, + Operand b, Operand alpha, Operand beta) { + return SparseMatrixAdd.create(scope, a, b, alpha, beta); + } + + /** + * Matrix-multiplies a sparse matrix with a dense matrix. + * Returns a dense matrix. + * For inputs A and B, where A is CSR and B is dense; this op returns a dense C; + *

    If transpose_output is false, returns: + *

    +   *    C = A . B
    +   *  
    + *

    If transpose_output is {@code true}, returns: + *

    +   *    C = transpose(A . B) = transpose(B) . transpose(A)
    +   *  
    + *

    where the transposition is performed along the two innermost (matrix) + * dimensions. + *

    If conjugate_output is {@code true}, returns: + *

    +   *    C = conjugate(A . B) = conjugate(A) . conjugate(B)
    +   *  
    + *

    If both conjugate_output and transpose_output are {@code true}, returns: + *

    +   *    C = conjugate(transpose(A . B)) = conjugate(transpose(B)) .
    +   *                                      conjugate(transpose(A))
    +   *  
    + * + * @param a A CSRSparseMatrix. + * @param b A dense tensor. + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixMatMul} output and operands + * @return a new instance of SparseMatrixMatMul + */ + public SparseMatrixMatMul sparseMatrixMatMul(Operand a, + Operand b, SparseMatrixMatMul.Options... options) { + return SparseMatrixMatMul.create(scope, a, b, options); + } + + /** + * Element-wise multiplication of a sparse matrix with a dense tensor. + * Returns a sparse matrix. + *

    The dense tensor {@code b} may be either a scalar; otherwise {@code a} must be a rank-3 + * {@code SparseMatrix}; in this case {@code b} must be shaped {@code [batch_size, 1, 1]} and the + * multiply operation broadcasts. + *

    NOTE even if {@code b} is zero, the sparsity structure of the output does not + * change. + * + * @param a A CSRSparseMatrix. + * @param b A dense tensor. + * @return a new instance of SparseMatrixMul + */ + public SparseMatrixMul sparseMatrixMul(Operand a, Operand b) { + return SparseMatrixMul.create(scope, a, b); + } + + /** + * Returns the number of nonzeroes of {@code sparse_matrix}. + * + * @param sparseMatrix A CSRSparseMatrix. + * @return a new instance of SparseMatrixNNZ + */ + public SparseMatrixNNZ sparseMatrixNNZ(Operand sparseMatrix) { + return SparseMatrixNNZ.create(scope, sparseMatrix); + } + + /** + * Computes the Approximate Minimum Degree (AMD) ordering of {@code input}. + * Computes the Approximate Minimum Degree (AMD) ordering for a sparse matrix. + *

    The returned permutation may be used to permute the rows and columns of the + * given sparse matrix. This typically results in permuted sparse matrix's sparse + * Cholesky (or other decompositions) in having fewer zero fill-in compared to + * decomposition of the original matrix. + *

    The input sparse matrix may have rank 2 or rank 3. The output Tensor, + * representing would then have rank 1 or 2 respectively, with the same batch + * shape as the input. + *

    Each component of the input sparse matrix must represent a square symmetric + * matrix; only the lower triangular part of the matrix is read. The values of the + * sparse matrix does not affect the returned permutation, only the sparsity + * pattern of the sparse matrix is used. Hence, a single AMD ordering may be + * reused for the Cholesky decompositions of sparse matrices with the same sparsity + * pattern but with possibly different values. + *

    Each batch component of the output permutation represents a permutation of {@code N} + * elements, where the input sparse matrix components each have {@code N} rows. That is, + * the component contains each of the integers {@code {0, .. N-1}} exactly once. The + * {@code i}th element represents the row index that the {@code i}th row maps to. + *

    Usage example: + *

    +   *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    +   *
    +   *      a_indices = np.array([[0, 0], [1, 1], [2, 1], [2, 2], [3, 3]])
    +   *      a_values = np.array([1.0, 2.0, 1.0, 3.0, 4.0], np.float32)
    +   *      a_dense_shape = [4, 4]
    +   *
    +   *      with tf.Session() as sess:
    +   *        # Define (COO format) SparseTensor over Numpy array.
    +   *        a_st = tf.sparse.SparseTensor(a_indices, a_values, a_dense_shape)
    +   *
    +   *        # Convert SparseTensors to CSR SparseMatrix.
    +   *        a_sm = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
    +   *            a_st.indices, a_st.values, a_st.dense_shape)
    +   *
    +   *        # Obtain the AMD Ordering for the CSR SparseMatrix.
    +   *        ordering_amd = sparse_csr_matrix_ops.sparse_matrix_ordering_amd(sparse_matrix)
    +   *
    +   *        ordering_amd_value = sess.run(ordering_amd)
    +   *  
    + *

    {@code ordering_amd_value} stores the AMD ordering: {@code [1 2 3 0]}. + *

    input: A {@code CSRSparseMatrix}. + * + * @param input A {@code CSRSparseMatrix}. + * @return a new instance of SparseMatrixOrderingAMD + */ + public SparseMatrixOrderingAMD sparseMatrixOrderingAMD(Operand input) { + return SparseMatrixOrderingAMD.create(scope, input); + } + + /** + * Calculates the softmax of a CSRSparseMatrix. + * Calculate the softmax of the innermost dimensions of a SparseMatrix. + *

    Missing values are treated as {@code -inf} (i.e., logits of zero probability); and + * the output has the same sparsity structure as the input (though missing values + * in the output may now be treated as having probability zero). + * + * @param logits A CSRSparseMatrix. + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixSoftmax} output and operands + * @return a new instance of SparseMatrixSoftmax + */ + public SparseMatrixSoftmax sparseMatrixSoftmax( + Operand logits, Class type) { + return SparseMatrixSoftmax.create(scope, logits, type); + } + + /** + * Calculates the gradient of the SparseMatrixSoftmax op. + * + * @param softmax A CSRSparseMatrix. + * @param gradSoftmax The gradient of {@code softmax}. + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixSoftmaxGrad} output and operands + * @return a new instance of SparseMatrixSoftmaxGrad + */ + public SparseMatrixSoftmaxGrad sparseMatrixSoftmaxGrad( + Operand softmax, Operand gradSoftmax, Class type) { + return SparseMatrixSoftmaxGrad.create(scope, softmax, gradSoftmax, type); + } + + /** + * Computes the sparse Cholesky decomposition of {@code input}. + * Computes the Sparse Cholesky decomposition of a sparse matrix, with the given + * fill-in reducing permutation. + *

    The input sparse matrix and the fill-in reducing permutation {@code permutation} must + * have compatible shapes. If the sparse matrix has rank 3; with the batch + * dimension {@code B}, then the {@code permutation} must be of rank 2; with the same batch + * dimension {@code B}. There is no support for broadcasting. + *

    Furthermore, each component vector of {@code permutation} must be of length {@code N}, + * containing each of the integers {0, 1, ..., N - 1} exactly once, where {@code N} is + * the number of rows of each component of the sparse matrix. + *

    Each component of the input sparse matrix must represent a symmetric positive + * definite (SPD) matrix; although only the lower triangular part of the matrix is + * read. If any individual component is not SPD, then an InvalidArgument error is + * thrown. + *

    The returned sparse matrix has the same dense shape as the input sparse matrix. + * For each component {@code A} of the input sparse matrix, the corresponding output + * sparse matrix represents {@code L}, the lower triangular Cholesky factor satisfying + * the following identity: + *

    +   *    A = L * Lt
    +   *  
    + *

    where Lt denotes the transpose of L (or its conjugate transpose, if {@code type} is + * {@code complex64} or {@code complex128}). + *

    The {@code type} parameter denotes the type of the matrix elements. The supported + * types are: {@code float32}, {@code float64}, {@code complex64} and {@code complex128}. + *

    Usage example: + *

    +   *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    +   *
    +   *      a_indices = np.array([[0, 0], [1, 1], [2, 1], [2, 2], [3, 3]])
    +   *      a_values = np.array([1.0, 2.0, 1.0, 3.0, 4.0], np.float32)
    +   *      a_dense_shape = [4, 4]
    +   *
    +   *      with tf.Session() as sess:
    +   *        # Define (COO format) SparseTensor over Numpy array.
    +   *        a_st = tf.sparse.SparseTensor(a_indices, a_values, a_dense_shape)
    +   *
    +   *        # Convert SparseTensors to CSR SparseMatrix.
    +   *        a_sm = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
    +   *            a_st.indices, a_st.values, a_st.dense_shape)
    +   *
    +   *        # Obtain the Sparse Cholesky factor using AMD Ordering for reducing zero
    +   *        # fill-in (number of structural non-zeros in the sparse Cholesky factor).
    +   *        ordering_amd = sparse_csr_matrix_ops.sparse_matrix_ordering_amd(sparse_matrix)
    +   *        cholesky_sparse_matrices = (
    +   *            sparse_csr_matrix_ops.sparse_matrix_sparse_cholesky(
    +   *                sparse_matrix, ordering_amd, type=tf.float32))
    +   *
    +   *        # Convert the CSRSparseMatrix Cholesky factor to a dense Tensor
    +   *        dense_cholesky = sparse_csr_matrix_ops.csr_sparse_matrix_to_dense(
    +   *            cholesky_sparse_matrices, tf.float32)
    +   *
    +   *        # Evaluate the dense Tensor value.
    +   *        dense_cholesky_value = sess.run(dense_cholesky)
    +   *  
    + *

    {@code dense_cholesky_value} stores the dense Cholesky factor: + *

    +   *      [[  1.  0.    0.    0.]
    +   *       [  0.  1.41  0.    0.]
    +   *       [  0.  0.70  1.58  0.]
    +   *       [  0.  0.    0.    2.]]
    +   *  
    + *

    input: A {@code CSRSparseMatrix}. + * permutation: A {@code Tensor}. + * type: The type of {@code input}. + * + * @param input A {@code CSRSparseMatrix}. + * @param permutation A fill-in reducing permutation matrix. + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixSparseCholesky} output and operands + * @return a new instance of SparseMatrixSparseCholesky + */ + public SparseMatrixSparseCholesky sparseMatrixSparseCholesky( + Operand input, Operand permutation, Class type) { + return SparseMatrixSparseCholesky.create(scope, input, permutation, type); + } + + /** + * Sparse-matrix-multiplies two CSR matrices {@code a} and {@code b}. + * Performs a matrix multiplication of a sparse matrix {@code a} with a sparse matrix + * {@code b}; returns a sparse matrix {@code a * b}, unless either {@code a} or {@code b} is transposed or + * adjointed. + *

    Each matrix may be transposed or adjointed (conjugated and transposed) + * according to the Boolean parameters {@code transpose_a}, {@code adjoint_a}, {@code transpose_b} + * and {@code adjoint_b}. At most one of {@code transpose_a} or {@code adjoint_a} may be True. + * Similarly, at most one of {@code transpose_b} or {@code adjoint_b} may be True. + *

    The inputs must have compatible shapes. That is, the inner dimension of {@code a} + * must be equal to the outer dimension of {@code b}. This requirement is adjusted + * according to whether either {@code a} or {@code b} is transposed or adjointed. + *

    The {@code type} parameter denotes the type of the matrix elements. Both {@code a} and {@code b} + * must have the same type. The supported types are: {@code float32}, {@code float64}, + * {@code complex64} and {@code complex128}. + *

    Both {@code a} and {@code b} must have the same rank. Broadcasting is not supported. If they + * have rank 3, each batch of 2D CSRSparseMatrices within {@code a} and {@code b} must have the + * same dense shape. + *

    The sparse matrix product may have numeric (non-structural) zeros. + * TODO(anudhyan): Consider adding a boolean attribute to control whether to prune + * zeros. + *

    Usage example: + *

    +   *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    +   *
    +   *      a_indices = np.array([[0, 0], [2, 3], [2, 4], [3, 0]])
    +   *      a_values = np.array([1.0, 5.0, -1.0, -2.0], np.float32)
    +   *      a_dense_shape = [4, 5]
    +   *
    +   *      b_indices = np.array([[0, 0], [3, 0], [3, 1]])
    +   *      b_values = np.array([2.0, 7.0, 8.0], np.float32)
    +   *      b_dense_shape = [5, 3]
    +   *
    +   *      with tf.Session() as sess:
    +   *        # Define (COO format) Sparse Tensors over Numpy arrays
    +   *        a_st = tf.sparse.SparseTensor(a_indices, a_values, a_dense_shape)
    +   *        b_st = tf.sparse.SparseTensor(b_indices, b_values, b_dense_shape)
    +   *
    +   *        # Convert SparseTensors to CSR SparseMatrix
    +   *        a_sm = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
    +   *            a_st.indices, a_st.values, a_st.dense_shape)
    +   *        b_sm = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
    +   *            b_st.indices, b_st.values, b_st.dense_shape)
    +   *
    +   *        # Compute the CSR SparseMatrix matrix multiplication
    +   *        c_sm = sparse_csr_matrix_ops.sparse_matrix_sparse_mat_mul(
    +   *            a=a_sm, b=b_sm, type=tf.float32)
    +   *
    +   *        # Convert the CSR SparseMatrix product to a dense Tensor
    +   *        c_sm_dense = sparse_csr_matrix_ops.csr_sparse_matrix_to_dense(
    +   *            c_sm, tf.float32)
    +   *        # Evaluate the dense Tensor value
    +   *        c_sm_dense_value = sess.run(c_sm_dense)
    +   *  
    + *

    {@code c_sm_dense_value} stores the dense matrix product: + *

    +   *      [[  2.   0.   0.]
    +   *       [  0.   0.   0.]
    +   *       [ 35.  40.   0.]
    +   *       [ -4.   0.   0.]]
    +   *  
    + *

    a: A {@code CSRSparseMatrix}. + * b: A {@code CSRSparseMatrix} with the same type and rank as {@code a}. + * type: The type of both {@code a} and {@code b}. + * transpose_a: If True, {@code a} transposed before multiplication. + * transpose_b: If True, {@code b} transposed before multiplication. + * adjoint_a: If True, {@code a} adjointed before multiplication. + * adjoint_b: If True, {@code b} adjointed before multiplication. + * + * @param a A CSRSparseMatrix. + * @param b A CSRSparseMatrix. + * @param type The value of the type attribute + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixSparseMatMul} output and operands + * @return a new instance of SparseMatrixSparseMatMul + */ + public SparseMatrixSparseMatMul sparseMatrixSparseMatMul( + Operand a, Operand b, Class type, + SparseMatrixSparseMatMul.Options... options) { + return SparseMatrixSparseMatMul.create(scope, a, b, type, options); + } + + /** + * Transposes the inner (matrix) dimensions of a CSRSparseMatrix. + * Transposes the inner (matrix) dimensions of a SparseMatrix and optionally + * conjugates its values. + * + * @param input A CSRSparseMatrix. + * @param type The value of the type attribute + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixTranspose} output and operands + * @return a new instance of SparseMatrixTranspose + */ + public SparseMatrixTranspose sparseMatrixTranspose( + Operand input, Class type, SparseMatrixTranspose.Options... options) { + return SparseMatrixTranspose.create(scope, input, type, options); + } + + /** + * Creates an all-zeros CSRSparseMatrix with shape {@code dense_shape}. + * + * @param denseShape The desired matrix shape. + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixZeros} output and operands + * @return a new instance of SparseMatrixZeros + */ + public SparseMatrixZeros sparseMatrixZeros(Operand denseShape, + Class type) { + return SparseMatrixZeros.create(scope, denseShape, type); + } + + /** + * Converts a SparseTensor to a (possibly batched) CSRSparseMatrix. + * + * @param indices SparseTensor indices. + * @param values SparseTensor values. + * @param denseShape SparseTensor dense shape. + * @return a new instance of SparseTensorToCSRSparseMatrix + */ + public SparseTensorToCSRSparseMatrix sparseTensorToCSRSparseMatrix(Operand indices, + Operand values, Operand denseShape) { + return SparseTensorToCSRSparseMatrix.create(scope, indices, values, denseShape); + } + + /** + * 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/MathOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java index 5f76519403f..d3dcfc686ad 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -34,6 +34,10 @@ import org.tensorflow.op.math.Atan; import org.tensorflow.op.math.Atan2; import org.tensorflow.op.math.Atanh; +import org.tensorflow.op.math.BesselI0; +import org.tensorflow.op.math.BesselI0e; +import org.tensorflow.op.math.BesselI1; +import org.tensorflow.op.math.BesselI1e; import org.tensorflow.op.math.Betainc; import org.tensorflow.op.math.Bincount; import org.tensorflow.op.math.Ceil; @@ -43,6 +47,7 @@ import org.tensorflow.op.math.Cosh; import org.tensorflow.op.math.Cumprod; import org.tensorflow.op.math.Cumsum; +import org.tensorflow.op.math.CumulativeLogsumexp; import org.tensorflow.op.math.DenseBincount; import org.tensorflow.op.math.Digamma; import org.tensorflow.op.math.Div; @@ -59,6 +64,7 @@ import org.tensorflow.op.math.Greater; import org.tensorflow.op.math.GreaterEqual; import org.tensorflow.op.math.Igamma; +import org.tensorflow.op.math.IgammaGradA; import org.tensorflow.op.math.Igammac; import org.tensorflow.op.math.Imag; import org.tensorflow.op.math.InvertPermutation; @@ -91,27 +97,37 @@ import org.tensorflow.op.math.Real; import org.tensorflow.op.math.RealDiv; import org.tensorflow.op.math.Reciprocal; +import org.tensorflow.op.math.ReciprocalGrad; +import org.tensorflow.op.math.RequantizationRangePerChannel; +import org.tensorflow.op.math.RequantizePerChannel; import org.tensorflow.op.math.Rint; import org.tensorflow.op.math.Round; import org.tensorflow.op.math.Rsqrt; +import org.tensorflow.op.math.RsqrtGrad; import org.tensorflow.op.math.SegmentMax; import org.tensorflow.op.math.SegmentMean; import org.tensorflow.op.math.SegmentMin; import org.tensorflow.op.math.SegmentProd; import org.tensorflow.op.math.SegmentSum; import org.tensorflow.op.math.Sigmoid; +import org.tensorflow.op.math.SigmoidGrad; import org.tensorflow.op.math.Sign; import org.tensorflow.op.math.Sin; import org.tensorflow.op.math.Sinh; +import org.tensorflow.op.math.SobolSample; import org.tensorflow.op.math.Softplus; +import org.tensorflow.op.math.SoftplusGrad; import org.tensorflow.op.math.Sqrt; +import org.tensorflow.op.math.SqrtGrad; import org.tensorflow.op.math.Square; import org.tensorflow.op.math.SquaredDifference; import org.tensorflow.op.math.Sub; import org.tensorflow.op.math.Tan; import org.tensorflow.op.math.Tanh; +import org.tensorflow.op.math.TanhGrad; import org.tensorflow.op.math.TruncateDiv; import org.tensorflow.op.math.TruncateMod; +import org.tensorflow.op.math.UniformQuantizedAdd; import org.tensorflow.op.math.UnsortedSegmentMax; import org.tensorflow.op.math.UnsortedSegmentMin; import org.tensorflow.op.math.UnsortedSegmentProd; @@ -131,9 +147,11 @@ /** * An API for building {@code math} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class MathOps { + public final MathSpecialOps special; + private final Scope scope; private final Ops ops; @@ -141,6 +159,7 @@ public final class MathOps { MathOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + special = new MathSpecialOps(ops); } /** @@ -149,8 +168,7 @@ public final class MathOps { * value of each element in {@code x}. For example, if x is an input element and y is * an output element, this operation computes \(y = |x|\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Abs} output and operands * @return a new instance of Abs */ @@ -167,7 +185,6 @@ public Abs abs(Operand x) { *

    Unlike the original {@code accumulate_n}, {@code accumulate_n_v2} is differentiable. *

    Returns a {@code Tensor} of same shape and type as the elements of {@code inputs}. * - * @param data type for {@code sum} output * @param inputs A list of {@code Tensor} objects, each with same shape and type. * @param shape Shape of elements of {@code inputs}. * @param data type for {@code AccumulateNV2} output and operands @@ -182,8 +199,7 @@ public AccumulateN accumulateN(Iterable> inputs, * Provided an input tensor, the {@code tf.math.acos} operation returns the inverse cosine of each element of the tensor. If {@code y = tf.math.cos(x)} then, {@code x = tf.math.acos(y)}. *

    Input range is {@code [-1, 1]} and the output has a range of {@code [0, pi]}. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Acos} output and operands * @return a new instance of Acos */ @@ -200,8 +216,7 @@ public Acos acos(Operand x) { * tf.math.acosh(x) ==> [nan nan 0. 0.62236255 5.9914584 9.903487 inf] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Acosh} output and operands * @return a new instance of Acosh */ @@ -216,9 +231,8 @@ public Acosh acosh(Operand x) { *

    Given two input tensors, the {@code tf.add} operation computes the sum for every element in the tensor. *

    Both input and output have a range {@code (-inf, inf)}. * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Add} output and operands * @return a new instance of Add */ @@ -234,8 +248,7 @@ public Add add(Operand x, Operand y) { * tf.math.add_n(x) ==> 26 * * - * @param data type for {@code sum} output - * @param inputs the inputs value + * @param inputs The inputs value * @param data type for {@code AddN} output and operands * @return a new instance of AddN */ @@ -253,14 +266,13 @@ public AddN addN(Iterable> inputs) { *

    For example: *

        *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
    -   *  tf.angle(input) ==> [2.0132, 1.056]
    +   *  tf.math.angle(input) ==> [2.0132, 1.056]
        *  
    *

    {@literal @}compatibility(numpy)
    * Equivalent to np.angle. *
    {@literal @}end_compatibility * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of Angle, with default output types */ public Angle angle(Operand input) { @@ -277,15 +289,14 @@ public Angle angle(Operand input) { *

    For example: *

        *  # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
    -   *  tf.angle(input) ==> [2.0132, 1.056]
    +   *  tf.math.angle(input) ==> [2.0132, 1.056]
        *  
    *

    {@literal @}compatibility(numpy)
    * Equivalent to np.angle. *
    {@literal @}end_compatibility * - * @param data type for {@code output} output - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Angle} output and operands * @return a new instance of Angle */ @@ -296,8 +307,8 @@ public Angle angle(Operand input, Class< /** * Returns the truth value of abs(x-y) < tolerance element-wise. * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code ApproximateEqual} output and operands * @return a new instance of ApproximateEqual @@ -320,9 +331,8 @@ public ApproximateEqual approximateEqual(Operand x, Operand * # here a[4] = 166.32 which is the largest element of a across axis 0 * * - * @param data type for {@code output} output - * @param input the input value - * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. + * @param input The input value + * @param dimension int16, int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. * @return a new instance of ArgMax, with default output types @@ -345,12 +355,11 @@ public ArgMax argMax(Operand input, * # here a[4] = 166.32 which is the largest element of a across axis 0 * * - * @param data type for {@code output} output - * @param input the input value - * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. + * @param input The input value + * @param dimension int16, int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. - * @param outputType the value of the outputType property + * @param outputType The value of the outputType attribute * @param data type for {@code ArgMax} output and operands * @return a new instance of ArgMax */ @@ -372,8 +381,7 @@ public ArgMax argMax(Operand input, * # here a[0] = 1 which is the smallest element of a across axis 0 * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. @@ -397,12 +405,11 @@ public ArgMin argMin(Operand input, * # here a[0] = 1 which is the smallest element of a across axis 0 * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. - * @param outputType the value of the outputType property + * @param outputType The value of the outputType attribute * @param data type for {@code ArgMin} output and operands * @return a new instance of ArgMin */ @@ -426,8 +433,7 @@ public ArgMin argMin(Operand input, * tf.math.asin(y) # [1.047, 0.785] = x * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Asin} output and operands * @return a new instance of Asin */ @@ -445,8 +451,7 @@ public Asin asin(Operand x) { * tf.math.asinh(x) ==> [-inf -1.4436355 -0.4812118 0.8813736 1.0159732 5.991471 9.903487 inf] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Asinh} output and operands * @return a new instance of Asinh */ @@ -469,8 +474,7 @@ public Asinh asinh(Operand x) { * tf.math.atan(y) # [1.047, 0.785] = x * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Atan} output and operands * @return a new instance of Atan */ @@ -497,9 +501,8 @@ public Atan atan(Operand x) { * * * - * @param data type for {@code z} output - * @param y the y value - * @param x the x value + * @param y The y value + * @param x The x value * @param data type for {@code Atan2} output and operands * @return a new instance of Atan2 */ @@ -519,8 +522,7 @@ public Atan2 atan2(Operand y, Operand x) { * tf.math.atanh(x) ==> [nan -inf -0.54930615 inf 0. 0.54930615 nan nan] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Atanh} output and operands * @return a new instance of Atanh */ @@ -528,6 +530,50 @@ public Atanh atanh(Operand x) { return Atanh.create(scope, x); } + /** + * The BesselI0 operation + * + * @param x The x value + * @param data type for {@code BesselI0} output and operands + * @return a new instance of BesselI0 + */ + public BesselI0 besselI0(Operand x) { + return BesselI0.create(scope, x); + } + + /** + * The BesselI0e operation + * + * @param x The x value + * @param data type for {@code BesselI0e} output and operands + * @return a new instance of BesselI0e + */ + public BesselI0e besselI0e(Operand x) { + return BesselI0e.create(scope, x); + } + + /** + * The BesselI1 operation + * + * @param x The x value + * @param data type for {@code BesselI1} output and operands + * @return a new instance of BesselI1 + */ + public BesselI1 besselI1(Operand x) { + return BesselI1.create(scope, x); + } + + /** + * The BesselI1e operation + * + * @param x The x value + * @param data type for {@code BesselI1e} output and operands + * @return a new instance of BesselI1e + */ + public BesselI1e besselI1e(Operand x) { + return BesselI1e.create(scope, x); + } + /** * Compute the regularized incomplete beta integral \(I_x(a, b)\). * The regularized incomplete beta integral is defined as: @@ -537,10 +583,9 @@ public Atanh atanh(Operand x) { *

    is the incomplete beta function and \(B(a, b)\) is the complete * beta function. * - * @param data type for {@code z} output - * @param a the a value - * @param b the b value - * @param x the x value + * @param a The a value + * @param b The b value + * @param x The x value * @param data type for {@code Betainc} output and operands * @return a new instance of Betainc */ @@ -557,7 +602,6 @@ public Betainc betainc(Operand a, Operand b, Operan * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. * - * @param data type for {@code bins} output * @param arr int32 {@code Tensor}. * @param sizeOutput non-negative int32 scalar {@code Tensor}. * @param weights is an int32, int64, float32, or float64 {@code Tensor} with the same @@ -574,8 +618,7 @@ public Bincount bincount(Operand arr, Operand data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Ceil} output and operands * @return a new instance of Ceil */ @@ -600,8 +643,7 @@ public Ceil ceil(Operand x) { * * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @return a new instance of ComplexAbs, with default output types */ public ComplexAbs complexAbs(Operand x) { @@ -625,9 +667,8 @@ public ComplexAbs complexAbs(Operand x) { * * * - * @param data type for {@code y} output - * @param x the x value - * @param Tout the value of the Tout property + * @param x The x value + * @param Tout The value of the Tout attribute * @param data type for {@code ComplexAbs} output and operands * @return a new instance of ComplexAbs */ @@ -648,8 +689,7 @@ public ComplexAbs complexAbs(Operand x, * tf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code Conj} output and operands * @return a new instance of Conj */ @@ -668,8 +708,7 @@ public Conj conj(Operand input) { * tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Cos} output and operands * @return a new instance of Cos */ @@ -687,8 +726,7 @@ public Cos cos(Operand x) { * tf.math.cosh(x) ==> [inf 4.0515420e+03 1.1276259e+00 1.5430807e+00 1.8106556e+00 3.7621956e+00 1.1013233e+04 inf] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Cosh} output and operands * @return a new instance of Cosh */ @@ -719,7 +757,6 @@ public Cosh cosh(Operand x) { * tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1] * * - * @param data type for {@code out} output * @param x A {@code Tensor}. Must be one of the following types: {@code float32}, {@code float64}, * {@code int64}, {@code int32}, {@code uint8}, {@code uint16}, {@code int16}, {@code int8}, {@code complex64}, * {@code complex128}, {@code qint8}, {@code quint8}, {@code qint32}, {@code half}. @@ -757,7 +794,6 @@ public Cumprod cumprod(Operand x, Operand * - * @param data type for {@code out} output * @param x A {@code Tensor}. Must be one of the following types: {@code float32}, {@code float64}, * {@code int64}, {@code int32}, {@code uint8}, {@code uint16}, {@code int16}, {@code int8}, {@code complex64}, * {@code complex128}, {@code qint8}, {@code quint8}, {@code qint32}, {@code half}. @@ -772,6 +808,37 @@ public Cumsum cumsum(Operand x, Operand + * tf.math.cumulative_logsumexp([a, b, c]) # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))] + * + *

    By setting the {@code exclusive} kwarg to {@code True}, an exclusive cumulative log-sum-exp is + * performed instead: + *

    +   *  tf.cumulative_logsumexp([a, b, c], exclusive=True)  # => [-inf, a, log(exp(a) * exp(b))]
    +   *  
    + *

    Note that the neutral element of the log-sum-exp operation is {@code -inf}, + * however, for performance reasons, the minimal value representable by the + * floating point type is used instead. + *

    By setting the {@code reverse} kwarg to {@code True}, the cumulative log-sum-exp is performed in the + * opposite direction. + * + * @param x A {@code Tensor}. Must be one of the following types: {@code float16}, {@code float32}, {@code float64}. + * @param axis A {@code Tensor} of type {@code int32} (default: 0). Must be in the range + * {@code [-rank(x), rank(x))}. + * @param options carries optional attribute values + * @param data type for {@code CumulativeLogsumexp} output and operands + * @return a new instance of CumulativeLogsumexp + */ + public CumulativeLogsumexp cumulativeLogsumexp(Operand x, + Operand axis, CumulativeLogsumexp.Options... options) { + return CumulativeLogsumexp.create(scope, x, axis, options); + } + /** * Counts the number of occurrences of each value in an integer array. * Outputs a vector with length {@code size} and the same dtype as {@code weights}. If @@ -781,7 +848,6 @@ public Cumsum cumsum(Operand x, OperandValues in {@code arr} outside of the range [0, size) are ignored. * - * @param data type for {@code output} output * @param input 1D or 2D int {@code Tensor}. * @param sizeOutput non-negative int scalar {@code Tensor}. * @param weights is an int32, int64, float32, or float64 {@code Tensor} with the same @@ -801,8 +867,7 @@ public DenseBincount denseBincount(Ope * Computes Psi, the derivative of Lgamma (the log of the absolute value of * {@code Gamma(x)}), element-wise. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Digamma} output and operands * @return a new instance of Digamma */ @@ -815,9 +880,8 @@ public Digamma digamma(Operand x) { * NOTE: {@code math.Div} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Div} output and operands * @return a new instance of Div */ @@ -830,9 +894,8 @@ public Div div(Operand x, Operand y) { * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code DivNoNan} output and operands * @return a new instance of DivNoNan */ @@ -854,8 +917,8 @@ public DivNoNan divNoNan(Operand x, Operand y) { * tf.math.equal(x, y) ==> array([True, True]) * * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code Equal} output and operands * @return a new instance of Equal @@ -867,8 +930,7 @@ public Equal equal(Operand x, Operand y, Equal.Options.. /** * Computes the Gauss error function of {@code x} element-wise. In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Erf} output and operands * @return a new instance of Erf */ @@ -879,8 +941,7 @@ public Erf erf(Operand x) { /** * Computes the complementary error function of {@code x} element-wise. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Erfc} output and operands * @return a new instance of Erfc */ @@ -891,8 +952,7 @@ public Erfc erfc(Operand x) { /** * The Erfinv operation * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Erfinv} output and operands * @return a new instance of erfinv */ @@ -924,8 +984,7 @@ public erfinv erfinv(Operand x) { * tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Exp} output and operands * @return a new instance of Exp */ @@ -948,8 +1007,7 @@ public Exp exp(Operand x) { * tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j) * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Expm1} output and operands * @return a new instance of Expm1 */ @@ -969,8 +1027,7 @@ public Fact fact() { /** * Returns element-wise largest integer not greater than x. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Floor} output and operands * @return a new instance of Floor */ @@ -983,9 +1040,8 @@ public Floor floor(Operand x) { * NOTE: {@code math.FloorDiv} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code FloorDiv} output and operands * @return a new instance of FloorDiv */ @@ -994,15 +1050,15 @@ public FloorDiv floorDiv(Operand x, Operand y) { } /** - * Returns element-wise remainder of division. When {@code x < 0} xor {@code y < 0} is - * true, this follows Python semantics in that the result here is consistent - * with a flooring divide. E.g. {@code floor(x / y) * y + mod(x, y) = x}. + * Returns element-wise remainder of division. + * This follows Python semantics in that the + * result here is consistent with a flooring divide. E.g. + * {@code floor(x / y) * y + floormod(x, y) = x}, regardless of the signs of x and y. *

    NOTE: {@code math.FloorMod} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code FloorMod} output and operands * @return a new instance of FloorMod */ @@ -1025,8 +1081,8 @@ public FloorMod floorMod(Operand x, Operand y) { * tf.math.greater(x, y) ==> [False, False, True] * * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Greater} output and operands * @return a new instance of Greater */ @@ -1049,8 +1105,8 @@ public Greater greater(Operand x, Operand y) { * tf.math.greater_equal(x, y) ==> [True, False, True, True] * * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code GreaterEqual} output and operands * @return a new instance of GreaterEqual */ @@ -1068,9 +1124,8 @@ public GreaterEqual greaterEqual(Operand x, Operand y) *

    Note, above {@code Q(a, x)} ({@code Igammac}) is the upper regularized complete * Gamma function. * - * @param data type for {@code z} output - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Igamma} output and operands * @return a new instance of Igamma */ @@ -1078,6 +1133,18 @@ public Igamma igamma(Operand a, Operand x) { return Igamma.create(scope, a, x); } + /** + * Computes the gradient of {@code igamma(a, x)} wrt {@code a}. + * + * @param a The a value + * @param x The x value + * @param data type for {@code IgammaGradA} output and operands + * @return a new instance of IgammaGradA + */ + public IgammaGradA igammaGradA(Operand a, Operand x) { + return IgammaGradA.create(scope, a, x); + } + /** * Compute the upper regularized incomplete Gamma function {@code Q(a, x)}. * The upper regularized incomplete Gamma function is defined as: @@ -1088,9 +1155,8 @@ public Igamma igamma(Operand a, Operand x) { *

    Note, above {@code P(a, x)} ({@code Igamma}) is the lower regularized complete * Gamma function. * - * @param data type for {@code z} output - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Igammac} output and operands * @return a new instance of Igammac */ @@ -1110,8 +1176,7 @@ public Igammac igammac(Operand a, Operand x) { * tf.imag(input) ==> [4.75, 5.75] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of Imag, with default output types */ public Imag imag(Operand input) { @@ -1130,9 +1195,8 @@ public Imag imag(Operand input) { * tf.imag(input) ==> [4.75, 5.75] * * - * @param data type for {@code output} output - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Imag} output and operands * @return a new instance of Imag */ @@ -1154,7 +1218,6 @@ public Imag imag(Operand input, Class * invert_permutation(x) ==> [2, 4, 3, 0, 1] * * - * @param data type for {@code y} output * @param x 1-D. * @param data type for {@code InvertPermutation} output and operands * @return a new instance of InvertPermutation @@ -1174,7 +1237,7 @@ public InvertPermutation invertPermutation(Operand x) * tf.math.is_finite(x) ==> [True, True, True, False, False] * * - * @param x the x value + * @param x The x value * @return a new instance of IsFinite */ public IsFinite isFinite(Operand x) { @@ -1192,7 +1255,7 @@ public IsFinite isFinite(Operand x) { * tf.math.is_inf(x) ==> [False, True, False, True] * * - * @param x the x value + * @param x The x value * @return a new instance of IsInf */ public IsInf isInf(Operand x) { @@ -1210,7 +1273,7 @@ public IsInf isInf(Operand x) { * tf.math.is_nan(x) ==> [False, True, False, True, False] * * - * @param x the x value + * @param x The x value * @return a new instance of IsNan */ public IsNan isNan(Operand x) { @@ -1232,8 +1295,8 @@ public IsNan isNan(Operand x) { * tf.math.less(x, y) ==> [False, True, True] * * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Less} output and operands * @return a new instance of Less */ @@ -1256,8 +1319,8 @@ public Less less(Operand x, Operand y) { * tf.math.less_equal(x, y) ==> [True, True, True] * * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code LessEqual} output and operands * @return a new instance of LessEqual */ @@ -1275,8 +1338,7 @@ public LessEqual lessEqual(Operand x, Operand y) { * tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Lgamma} output and operands * @return a new instance of Lgamma */ @@ -1293,8 +1355,7 @@ public Lgamma lgamma(Operand x) { * tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Log} output and operands * @return a new instance of Log */ @@ -1311,8 +1372,7 @@ public Log log(Operand x) { * tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Log1p} output and operands * @return a new instance of Log1p */ @@ -1325,8 +1385,8 @@ public Log1p log1p(Operand x) { * NOTE: {@code math.LogicalAnd} supports broadcasting. More about broadcasting * here * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @return a new instance of LogicalAnd */ public LogicalAnd logicalAnd(Operand x, Operand y) { @@ -1348,8 +1408,8 @@ public LogicalNot logicalNot(Operand x) { * NOTE: {@code math.LogicalOr} supports broadcasting. More about broadcasting * here * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @return a new instance of LogicalOr */ public LogicalOr logicalOr(Operand x, Operand y) { @@ -1361,9 +1421,8 @@ public LogicalOr logicalOr(Operand x, Operand y) { * NOTE: {@code math.Maximum} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Maximum} output and operands * @return a new instance of Maximum */ @@ -1378,7 +1437,6 @@ public Maximum maximum(Operand x, Operand y) { * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -1396,9 +1454,8 @@ public Mean mean(Operand input, OperandNOTE: {@code math.Minimum} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Minimum} output and operands * @return a new instance of Minimum */ @@ -1413,9 +1470,8 @@ public Minimum minimum(Operand x, Operand y) { *

    NOTE: {@code math.Mod} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Mod} output and operands * @return a new instance of Mod */ @@ -1428,9 +1484,8 @@ public Mod mod(Operand x, Operand y) { * NOTE: {@code math.Mul} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Mul} output and operands * @return a new instance of Mul */ @@ -1443,9 +1498,8 @@ public Mul mul(Operand x, Operand y) { * NOTE: {@code math.MulNoNan} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code MulNoNan} output and operands * @return a new instance of MulNoNan */ @@ -1456,8 +1510,7 @@ public MulNoNan mulNoNan(Operand x, Operand y) { /** * The Ndtri operation * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Ndtri} output and operands * @return a new instance of Ndtri */ @@ -1469,8 +1522,7 @@ public Ndtri ndtri(Operand x) { * Computes numerical negative value element-wise. * I.e., \(y = -x\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Neg} output and operands * @return a new instance of Neg */ @@ -1486,9 +1538,8 @@ public Neg neg(Operand x) { * Equivalent to C++ std::nextafter function. *
    {@literal @}end_compatibility * - * @param data type for {@code output} output - * @param x1 the x1 value - * @param x2 the x2 value + * @param x1 The x1 value + * @param x2 The x2 value * @param data type for {@code NextAfter} output and operands * @return a new instance of NextAfter */ @@ -1501,8 +1552,8 @@ public NextAfter nextAfter(Operand x1, Operand x2) * NOTE: {@code math.NotEqual} supports broadcasting. More about broadcasting * here * - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code NotEqual} output and operands * @return a new instance of NotEqual @@ -1519,9 +1570,8 @@ public NotEqual notEqual(Operand x, Operand y, *

    where \(\psi(x)\) is the digamma function. * The polygamma function is defined only for non-negative integer orders \a\. * - * @param data type for {@code z} output - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Polygamma} output and operands * @return a new instance of Polygamma */ @@ -1537,7 +1587,7 @@ public Polygamma polygamma(Operand a, Operand x) { * {@code int32} or {@code int64} and perform the bitcount on the result, than to feed in * 8- or 16-bit inputs and then aggregate the resulting counts. * - * @param x the x value + * @param x The x value * @return a new instance of PopulationCount */ public PopulationCount populationCount(Operand x) { @@ -1554,9 +1604,8 @@ public PopulationCount populationCount(Operand x) { * tf.pow(x, y) ==> [[256, 65536], [9, 27]] * * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Pow} output and operands * @return a new instance of Pow */ @@ -1567,14 +1616,13 @@ public Pow pow(Operand x, Operand y) { /** * Returns x + y element-wise, working on quantized buffers. * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param minX The float value that the lowest quantized {@code x} value represents. * @param maxX The float value that the highest quantized {@code x} value represents. * @param minY The float value that the lowest quantized {@code y} value represents. * @param maxY The float value that the highest quantized {@code y} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param data type for {@code QuantizedAdd} output and operands * @return a new instance of QuantizedAdd */ @@ -1587,14 +1635,13 @@ public QuantizedAdd quantizedAdd(Operand data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param minX The float value that the lowest quantized {@code x} value represents. * @param maxX The float value that the highest quantized {@code x} value represents. * @param minY The float value that the lowest quantized {@code y} value represents. * @param maxY The float value that the highest quantized {@code y} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param data type for {@code QuantizedMul} output and operands * @return a new instance of QuantizedMul */ @@ -1616,8 +1663,7 @@ public QuantizedMul quantizedMul(Operand * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of Real, with default output types */ public Real real(Operand input) { @@ -1636,9 +1682,8 @@ public Real real(Operand input) { * tf.real(input) ==> [-2.25, 3.25] * * - * @param data type for {@code output} output - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Real} output and operands * @return a new instance of Real */ @@ -1652,9 +1697,8 @@ public Real real(Operand input, Class *

    NOTE: {@code Div} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code RealDiv} output and operands * @return a new instance of RealDiv */ @@ -1666,8 +1710,7 @@ public RealDiv realDiv(Operand x, Operand y) { * Computes the reciprocal of x element-wise. * I.e., \(y = 1 / x\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Reciprocal} output and operands * @return a new instance of Reciprocal */ @@ -1675,6 +1718,55 @@ public Reciprocal reciprocal(Operand x) { return Reciprocal.create(scope, x); } + /** + * Computes the gradient for the inverse of {@code x} wrt its input. + * Specifically, {@code grad = -dy * y*y}, where {@code y = 1/x}, and {@code dy} + * is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code ReciprocalGrad} output and operands + * @return a new instance of ReciprocalGrad + */ + public ReciprocalGrad reciprocalGrad(Operand y, Operand dy) { + return ReciprocalGrad.create(scope, y, dy); + } + + /** + * Computes requantization range per channel. + * + * @param input The original input tensor. + * @param inputMin The minimum value of the input tensor + * @param inputMax The maximum value of the input tensor. + * @param clipValueMax The maximum value of the output that needs to be clipped. + * Example: set this to 6 for Relu6. + * @return a new instance of RequantizationRangePerChannel + */ + public RequantizationRangePerChannel requantizationRangePerChannel( + Operand input, Operand inputMin, Operand inputMax, + Float clipValueMax) { + return RequantizationRangePerChannel.create(scope, input, inputMin, inputMax, clipValueMax); + } + + /** + * Requantizes input with min and max values known per channel. + * + * @param input The original input tensor. + * @param inputMin The minimum value of the input tensor + * @param inputMax The maximum value of the input tensor. + * @param requestedOutputMin The minimum value of the output tensor requested. + * @param requestedOutputMax The maximum value of the output tensor requested. + * @param outType The quantized type of output tensor that needs to be converted. + * @param data type for {@code RequantizePerChannel} output and operands + * @return a new instance of RequantizePerChannel + */ + public RequantizePerChannel requantizePerChannel( + Operand input, Operand inputMin, Operand inputMax, + Operand requestedOutputMin, Operand requestedOutputMax, + Class outType) { + return RequantizePerChannel.create(scope, input, inputMin, inputMax, requestedOutputMin, requestedOutputMax, outType); + } + /** * Returns element-wise integer closest to x. * If the result is midway between two representable values, @@ -1686,8 +1778,7 @@ public Reciprocal reciprocal(Operand x) { * rint([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) ==> [-2., -2., -0., 0., 2., 2., 2.] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Rint} output and operands * @return a new instance of Rint */ @@ -1700,8 +1791,7 @@ public Rint rint(Operand x) { * Rounds half to even. Also known as bankers rounding. If you want to round * according to the current system rounding mode use std::cint. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Round} output and operands * @return a new instance of Round */ @@ -1713,8 +1803,7 @@ public Round round(Operand x) { * Computes reciprocal of square root of x element-wise. * I.e., \(y = 1 / \sqrt{x}\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Rsqrt} output and operands * @return a new instance of Rsqrt */ @@ -1722,6 +1811,20 @@ public Rsqrt rsqrt(Operand x) { return Rsqrt.create(scope, x); } + /** + * Computes the gradient for the rsqrt of {@code x} wrt its input. + * Specifically, {@code grad = dy * -0.5 * y^3}, where {@code y = rsqrt(x)}, and {@code dy} + * is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code RsqrtGrad} output and operands + * @return a new instance of RsqrtGrad + */ + public RsqrtGrad rsqrtGrad(Operand y, Operand dy) { + return RsqrtGrad.create(scope, y, dy); + } + /** * Computes the maximum along segments of a tensor. * Read @@ -1730,28 +1833,52 @@ public Rsqrt rsqrt(Operand x) { *

    Computes a tensor such that * \(output_i = \max_j(data_j)\) where {@code max} is over {@code j} such * that {@code segment_ids[j] == i}. - *

    If the max is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    + *

    If the maximum is empty for a given segment ID {@code i}, it outputs the smallest + * possible value for the specific numeric type, + * {@code output[i] = numeric_limits::lowest()}. + *

    Note: That this op is currently only supported with jit_compile=True. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as the same as a smaller following index. + *

    The only difference with SegmentMax is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) should be equal to {@code num_segments} - 1 for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned + * smallest possible value for the specific numeric type. *

    For example: - *

    +   *  
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentMaxV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_max(c, tf.constant([0, 0, 1])) - * # ==> [[4, 3, 3, 4], - * # [5, 6, 7, 8]] - *

    + * test(c).numpy() + * array([[4, 3, 3, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentMax} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentMaxV2} output and operands * @return a new instance of SegmentMax */ public SegmentMax segmentMax(Operand data, - Operand segmentIds) { - return SegmentMax.create(scope, data, segmentIds); + Operand segmentIds, Operand numSegments) { + return SegmentMax.create(scope, data, segmentIds, numSegments); } /** @@ -1764,21 +1891,32 @@ public SegmentMax segmentMax(Operand data, * over {@code j} such that {@code segment_ids[j] == i} and {@code N} is the total number of * values summed. *

    If the mean is empty for a given segment ID {@code i}, {@code output[i] = 0}. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as a smaller following index when computing the numerator + * of the mean. *

    * *
    *

    For example: - *

    -   *  c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
    -   *  tf.segment_mean(c, tf.constant([0, 0, 1]))
    -   *  # ==> [[2.5, 2.5, 2.5, 2.5],
    -   *  #      [5, 6, 7, 8]]
    -   *  
    + *
    + *
    + *
    + *

    c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) + * tf.math.segment_mean(c, tf.constant([0, 0, 1])).numpy() + * array([[2.5, 2.5, 2.5, 2.5], + * [5., 6., 7., 8.]], dtype=float32) + *

    + *
    + *
    * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. * @param data type for {@code SegmentMean} output and operands * @return a new instance of SegmentMean */ @@ -1795,28 +1933,52 @@ public SegmentMean segmentMean(Operand data, *

    Computes a tensor such that * \(output_i = \min_j(data_j)\) where {@code min} is over {@code j} such * that {@code segment_ids[j] == i}. - *

    If the min is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    + *

    If the minimum is empty for a given segment ID {@code i}, it outputs the largest + * possible value for the specific numeric type, + * {@code output[i] = numeric_limits::max()}. + *

    Note: That this op is currently only supported with jit_compile=True. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as the same as a smaller following index. + *

    The only difference with SegmentMin is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) should be equal to {@code num_segments} - 1 for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned + * the largest possible value for the specific numeric type. *

    For example: - *

    +   *  
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentMinV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_min(c, tf.constant([0, 0, 1])) - * # ==> [[1, 2, 2, 1], - * # [5, 6, 7, 8]] - *

    + * test(c).numpy() + * array([[1, 2, 2, 1], + * [5, 6, 7, 8]], dtype=int32) + * + * + * * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentMin} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentMinV2} output and operands * @return a new instance of SegmentMin */ public SegmentMin segmentMin(Operand data, - Operand segmentIds) { - return SegmentMin.create(scope, data, segmentIds); + Operand segmentIds, Operand numSegments) { + return SegmentMin.create(scope, data, segmentIds, numSegments); } /** @@ -1828,27 +1990,43 @@ public SegmentMin segmentMin(Operand data, * \(output_i = \prod_j data_j\) where the product is over {@code j} such * that {@code segment_ids[j] == i}. *

    If the product is empty for a given segment ID {@code i}, {@code output[i] = 1}. - *

    - * - *
    + *

    Note: That this op is currently only supported with jit_compile=True. + *

    The only difference with SegmentProd is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) - 1 should be equal to {@code num_segments} for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned 1. *

    For example: - *

    +   *  
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentProdV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_prod(c, tf.constant([0, 0, 1])) - * # ==> [[4, 6, 6, 4], - * # [5, 6, 7, 8]] - *

    + * test(c).numpy() + * array([[4, 6, 6, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentProd} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentProdV2} output and operands * @return a new instance of SegmentProd */ public SegmentProd segmentProd(Operand data, - Operand segmentIds) { - return SegmentProd.create(scope, data, segmentIds); + Operand segmentIds, Operand numSegments) { + return SegmentProd.create(scope, data, segmentIds, numSegments); } /** @@ -1860,35 +2038,28 @@ public SegmentProd segmentProd(Operand data, * \(output_i = \sum_j data_j\) where sum is over {@code j} such * that {@code segment_ids[j] == i}. *

    If the sum is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    - *

    For example: - *

    -   *  c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
    -   *  tf.segment_sum(c, tf.constant([0, 0, 1]))
    -   *  # ==> [[5, 5, 5, 5],
    -   *  #      [5, 6, 7, 8]]
    -   *  
    + *

    Note that this op is currently only supported with jit_compile=True. * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentSum} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentSumV2} output and operands * @return a new instance of SegmentSum */ public SegmentSum segmentSum(Operand data, - Operand segmentIds) { - return SegmentSum.create(scope, data, segmentIds); + Operand segmentIds, Operand numSegments) { + return SegmentSum.create(scope, data, segmentIds, numSegments); } /** * Computes sigmoid of {@code x} element-wise. * Specifically, {@code y = 1 / (1 + exp(-x))}. * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Sigmoid} output and operands * @return a new instance of Sigmoid */ @@ -1896,6 +2067,20 @@ public Sigmoid sigmoid(Operand x) { return Sigmoid.create(scope, x); } + /** + * Computes the gradient of the sigmoid of {@code x} wrt its input. + * Specifically, {@code grad = dy * y * (1 - y)}, where {@code y = sigmoid(x)}, and + * {@code dy} is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code SigmoidGrad} output and operands + * @return a new instance of SigmoidGrad + */ + public SigmoidGrad sigmoidGrad(Operand y, Operand dy) { + return SigmoidGrad.create(scope, y, dy); + } + /** * Returns an element-wise indication of the sign of a number. * {@code y = sign(x) = -1} if {@code x < 0}; 0 if {@code x == 0}; 1 if {@code x > 0}. @@ -1910,8 +2095,7 @@ public Sigmoid sigmoid(Operand x) { * * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Sign} output and operands * @return a new instance of Sign */ @@ -1929,8 +2113,7 @@ public Sign sign(Operand x) { * tf.math.sin(x) ==> [nan -0.4121185 -0.47942555 0.84147096 0.9320391 -0.87329733 -0.54402107 nan] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Sin} output and operands * @return a new instance of Sin */ @@ -1948,8 +2131,7 @@ public Sin sin(Operand x) { * tf.math.sinh(x) ==> [-inf -4.0515420e+03 -5.2109528e-01 1.1752012e+00 1.5094614e+00 3.6268604e+00 1.1013232e+04 inf] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Sinh} output and operands * @return a new instance of Sinh */ @@ -1957,11 +2139,46 @@ public Sinh sinh(Operand x) { return Sinh.create(scope, x); } + /** + * Generates points from the Sobol sequence. + * Creates a Sobol sequence with {@code num_results} samples. Each sample has dimension + * {@code dim}. Skips the first {@code skip} samples. + * + * @param dim Positive scalar {@code Tensor} representing each sample's dimension. + * @param numResults Positive scalar {@code Tensor} of dtype int32. The number of Sobol points to return + * in the output. + * @param skip Positive scalar {@code Tensor} of dtype int32. The number of initial points of the + * Sobol sequence to skip. + * @return a new instance of SobolSample, with default output types + */ + public SobolSample sobolSample(Operand dim, Operand numResults, + Operand skip) { + return SobolSample.create(scope, dim, numResults, skip); + } + + /** + * Generates points from the Sobol sequence. + * Creates a Sobol sequence with {@code num_results} samples. Each sample has dimension + * {@code dim}. Skips the first {@code skip} samples. + * + * @param dim Positive scalar {@code Tensor} representing each sample's dimension. + * @param numResults Positive scalar {@code Tensor} of dtype int32. The number of Sobol points to return + * in the output. + * @param skip Positive scalar {@code Tensor} of dtype int32. The number of initial points of the + * Sobol sequence to skip. + * @param dtype The type of the sample. One of: {@code float32} or {@code float64}. + * @param data type for {@code SobolSample} output and operands + * @return a new instance of SobolSample + */ + public SobolSample sobolSample(Operand dim, + Operand numResults, Operand skip, Class dtype) { + return SobolSample.create(scope, dim, numResults, skip, dtype); + } + /** * The Softplus operation * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Softplus} output and operands * @return a new instance of Softplus */ @@ -1969,12 +2186,24 @@ public Softplus softplus(Operand features) { return Softplus.create(scope, features); } + /** + * Computes softplus gradients for a softplus operation. + * + * @param gradients The backpropagated gradients to the corresponding softplus operation. + * @param features The features passed as input to the corresponding softplus operation. + * @param data type for {@code SoftplusGrad} output and operands + * @return a new instance of SoftplusGrad + */ + public SoftplusGrad softplusGrad(Operand gradients, + Operand features) { + return SoftplusGrad.create(scope, gradients, features); + } + /** * Computes square root of x element-wise. * I.e., \(y = \sqrt{x} = x^{1/2}\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Sqrt} output and operands * @return a new instance of Sqrt */ @@ -1982,12 +2211,25 @@ public Sqrt sqrt(Operand x) { return Sqrt.create(scope, x); } + /** + * Computes the gradient for the sqrt of {@code x} wrt its input. + * Specifically, {@code grad = dy * 0.5 / y}, where {@code y = sqrt(x)}, and {@code dy} + * is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code SqrtGrad} output and operands + * @return a new instance of SqrtGrad + */ + public SqrtGrad sqrtGrad(Operand y, Operand dy) { + return SqrtGrad.create(scope, y, dy); + } + /** * Computes square of x element-wise. * I.e., \(y = x * x = x^2\). * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Square} output and operands * @return a new instance of Square */ @@ -2000,9 +2242,8 @@ public Square square(Operand x) { * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code SquaredDifference} output and operands * @return a new instance of SquaredDifference */ @@ -2015,9 +2256,8 @@ public SquaredDifference squaredDifference(Operand x, Op * NOTE: {@code math.Sub} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Sub} output and operands * @return a new instance of Sub */ @@ -2036,8 +2276,7 @@ public Sub sub(Operand x, Operand y) { * tf.math.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan] * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Tan} output and operands * @return a new instance of Tan */ @@ -2056,14 +2295,13 @@ public Tan tan(Operand x) { *

    x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) * tf.math.tanh(x) * <tf.Tensor: shape=(8,), dtype=float32, numpy= - * array([-1. , -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , - * 0.9640276 , 0.9950547 , 1. ], dtype=float32)> + * array([-1.0, -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , + * 0.9640276 , 0.9950547 , 1.0], dtype=float32)> * * * * - * @param data type for {@code y} output - * @param x the x value + * @param x The x value * @param data type for {@code Tanh} output and operands * @return a new instance of Tanh */ @@ -2072,7 +2310,21 @@ public Tanh tanh(Operand x) { } /** - * Returns x / y element-wise for integer types. + * Computes the gradient for the tanh of {@code x} wrt its input. + * Specifically, {@code grad = dy * (1 - y*y)}, where {@code y = tanh(x)}, and {@code dy} + * is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code TanhGrad} output and operands + * @return a new instance of TanhGrad + */ + public TanhGrad tanhGrad(Operand y, Operand dy) { + return TanhGrad.create(scope, y, dy); + } + + /** + * Returns x / y element-wise, rounded towards zero. * Truncation designates that negative numbers will round fractional quantities * toward zero. I.e. -7 / 5 = -1. This matches C semantics but it is different * than Python semantics. See {@code FloorDiv} for a division function that matches @@ -2080,9 +2332,8 @@ public Tanh tanh(Operand x) { *

    NOTE: {@code math.TruncateDiv} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code TruncateDiv} output and operands * @return a new instance of TruncateDiv */ @@ -2096,9 +2347,8 @@ public TruncateDiv truncateDiv(Operand x, Operand y) *

    NOTE: {@code math.TruncateMod} supports broadcasting. More about broadcasting * here * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code TruncateMod} output and operands * @return a new instance of TruncateMod */ @@ -2106,13 +2356,66 @@ public TruncateMod truncateMod(Operand x, Operand y return TruncateMod.create(scope, x, y); } + /** + * Perform quantized add of quantized Tensor {@code lhs} and quantized Tensor {@code rhs} to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized add on {@code lhs} and {@code rhs} to make quantized {@code output}. + *

    {@code math.UniformQuantizedAdd} follows Numpy broadcasting rules. + * The two input array shapes are compared element-wise. + * Starting with the trailing dimensions, the two dimensions either have to be equal or one of them needs to be 1. + *

    {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + *

    +   *  quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)
    +   *  
    + *

    {@code output} is also quantized, using the same formula. + *

    If {@code lhs} and {@code output} is both per-axis quantized, the quantization axis must match. + * Also, if {@code rhs} and {@code output} is both per-axis quantized, the quantization axis must match. + * Match means the axis must match when adding, regarding the broadcasting. + * i.e. For both operands {@code lhs} and {@code rhs}, + * if {@code operand.quantization_axis} >= 0 and {@code output.quantization_axis} >= 0, + * {@code operand.dims} - {@code operand.quantization_axis} must be equal to {@code output.dims} - {@code output.quantization_axis}. + * + * @param lhs Must be a quantized tensor. + * @param rhs Must be a quantized tensor. + * @param lhsScales The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + * @param lhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Must have same shape with {@code lhs_scales}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * @param rhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Must have same shape with {@code rhs_scales}. + * @param outputScales The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + * @param outputZeroPoints The int32 value(s) used as zero points when quantizing original data that output represents. + * Must have same shape with {@code output_scales}. + * @param lhsQuantizationMinVal The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedAdd} output and operands + * @return a new instance of UniformQuantizedAdd + */ + public UniformQuantizedAdd uniformQuantizedAdd(Operand lhs, + Operand rhs, Operand lhsScales, Operand lhsZeroPoints, + Operand rhsScales, Operand rhsZeroPoints, Operand outputScales, + Operand outputZeroPoints, Long lhsQuantizationMinVal, Long lhsQuantizationMaxVal, + Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, Long outputQuantizationMinVal, + Long outputQuantizationMaxVal, UniformQuantizedAdd.Options... options) { + return UniformQuantizedAdd.create(scope, lhs, rhs, lhsScales, lhsZeroPoints, rhsScales, rhsZeroPoints, outputScales, outputZeroPoints, lhsQuantizationMinVal, lhsQuantizationMaxVal, rhsQuantizationMinVal, rhsQuantizationMaxVal, outputQuantizationMinVal, outputQuantizationMaxVal, options); + } + /** * Computes the maximum along segments of a tensor. * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the maximum such that: *

    \(output_i = \max_{j...} data[j...]\) where max is over tuples {@code j...} such * that {@code segment_ids[j...] == i}. @@ -2121,21 +2424,33 @@ public TruncateMod truncateMod(Operand x, Operand y * {@code output[i] = numeric_limits::lowest()}. *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. *

    * *
    *

    For example: - *

    -   *  c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    -   *  tf.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2)
    -   *  # ==> [[ 4,  3, 3, 4],
    -   *  #       [5,  6, 7, 8]]
    -   *  
    + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[4, 3, 3, 4], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentMax} output and operands * @return a new instance of UnsortedSegmentMax */ @@ -2149,8 +2464,7 @@ public UnsortedSegmentMax unsortedSegmentMax(Operand d * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the minimum such that: *

    \(output_i = \min_{j...} data_[j...]\) where min is over tuples {@code j...} such * that {@code segment_ids[j...] == i}. @@ -2158,19 +2472,31 @@ public UnsortedSegmentMax unsortedSegmentMax(Operand d * possible value for the specific numeric type, * {@code output[i] = numeric_limits::max()}. *

    For example: - *

    -   *  c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    -   *  tf.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2)
    -   *  # ==> [[ 1,  2, 2, 1],
    -   *  #       [5,  6, 7, 8]]
    -   *  
    + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[1, 2, 2, 1], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. - * - * @param data type for {@code output} output - * @param data the data value + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. + * + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentMin} output and operands * @return a new instance of UnsortedSegmentMin */ @@ -2184,27 +2510,38 @@ public UnsortedSegmentMin unsortedSegmentMin(Operand d * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the product of all * entries belonging to a segment such that: *

    \(output_i = \prod_{j...} data[j...]\) where the product is over tuples * {@code j...} such that {@code segment_ids[j...] == i}. *

    For example: - *

    -   *  c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    -   *  tf.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2)
    -   *  # ==> [[ 4,  6, 6, 4],
    -   *  #       [5,  6, 7, 8]]
    -   *  
    + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[4, 6, 6, 4], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    *

    If there is no entry for a given segment ID {@code i}, it outputs 1. *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. - * - * @param data type for {@code output} output - * @param data the data value + * Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. + * + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentProd} output and operands * @return a new instance of UnsortedSegmentProd */ @@ -2227,20 +2564,32 @@ public UnsortedSegmentProd unsortedSegmentProd(Operand d * If the given segment ID {@code i} is negative, the value is dropped and will not be * added to the sum of the segment. *

    {@code num_segments} should equal the number of distinct segment IDs. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. *

    * *
    - *
    -   *  c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    -   *  tf.math.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
    -   *  # ==> [[ 5, 5, 5, 5],
    -   *  #       [5, 6, 7, 8]]
    -   *  
    + *
    + *
    + *
    + *

    c = [[1,2,3,4], [5,6,7,8], [4,3,2,1]] + * tf.math.unsorted_segment_sum(c, [0, 1, 0], num_segments=2).numpy() + * array([[5, 5, 5, 5], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentSum} output and operands * @return a new instance of UnsortedSegmentSum */ @@ -2252,9 +2601,8 @@ public UnsortedSegmentSum unsortedSegmentSum(Operand dat /** * Returns 0 if x == 0, and x / y otherwise, elementwise. * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xdivy} output and operands * @return a new instance of Xdivy */ @@ -2265,9 +2613,8 @@ public Xdivy xdivy(Operand x, Operand y) { /** * Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise. * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xlog1py} output and operands * @return a new instance of Xlog1py */ @@ -2278,9 +2625,8 @@ public Xlog1py xlog1py(Operand x, Operand y) { /** * Returns 0 if x == 0, and x * log(y) otherwise, elementwise. * - * @param data type for {@code z} output - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xlogy} output and operands * @return a new instance of Xlogy */ @@ -2293,9 +2639,8 @@ public Xlogy xlogy(Operand x, Operand y) { * The Hurwitz zeta function is defined as: *

    \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) * - * @param data type for {@code z} output - * @param x the x value - * @param q the q value + * @param x The x value + * @param q The q value * @param data type for {@code Zeta} output and operands * @return a new instance of Zeta */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathSpecialOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathSpecialOps.java new file mode 100644 index 00000000000..e486615af1b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathSpecialOps.java @@ -0,0 +1,200 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.math.special.BesselJ0; +import org.tensorflow.op.math.special.BesselJ1; +import org.tensorflow.op.math.special.BesselK0; +import org.tensorflow.op.math.special.BesselK0e; +import org.tensorflow.op.math.special.BesselK1; +import org.tensorflow.op.math.special.BesselK1e; +import org.tensorflow.op.math.special.BesselY0; +import org.tensorflow.op.math.special.BesselY1; +import org.tensorflow.op.math.special.Dawsn; +import org.tensorflow.op.math.special.Expint; +import org.tensorflow.op.math.special.FresnelCos; +import org.tensorflow.op.math.special.FresnelSin; +import org.tensorflow.op.math.special.Spence; +import org.tensorflow.types.family.TNumber; + +/** + * An API for building {@code math.special} operations as {@link Op Op}s + * + * @see Ops + */ +public final class MathSpecialOps { + private final Scope scope; + + private final Ops ops; + + MathSpecialOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * The BesselJ0 operation + * + * @param x The x value + * @param data type for {@code BesselJ0} output and operands + * @return a new instance of BesselJ0 + */ + public BesselJ0 besselJ0(Operand x) { + return BesselJ0.create(scope, x); + } + + /** + * The BesselJ1 operation + * + * @param x The x value + * @param data type for {@code BesselJ1} output and operands + * @return a new instance of BesselJ1 + */ + public BesselJ1 besselJ1(Operand x) { + return BesselJ1.create(scope, x); + } + + /** + * The BesselK0 operation + * + * @param x The x value + * @param data type for {@code BesselK0} output and operands + * @return a new instance of BesselK0 + */ + public BesselK0 besselK0(Operand x) { + return BesselK0.create(scope, x); + } + + /** + * The BesselK0e operation + * + * @param x The x value + * @param data type for {@code BesselK0e} output and operands + * @return a new instance of BesselK0e + */ + public BesselK0e besselK0e(Operand x) { + return BesselK0e.create(scope, x); + } + + /** + * The BesselK1 operation + * + * @param x The x value + * @param data type for {@code BesselK1} output and operands + * @return a new instance of BesselK1 + */ + public BesselK1 besselK1(Operand x) { + return BesselK1.create(scope, x); + } + + /** + * The BesselK1e operation + * + * @param x The x value + * @param data type for {@code BesselK1e} output and operands + * @return a new instance of BesselK1e + */ + public BesselK1e besselK1e(Operand x) { + return BesselK1e.create(scope, x); + } + + /** + * The BesselY0 operation + * + * @param x The x value + * @param data type for {@code BesselY0} output and operands + * @return a new instance of BesselY0 + */ + public BesselY0 besselY0(Operand x) { + return BesselY0.create(scope, x); + } + + /** + * The BesselY1 operation + * + * @param x The x value + * @param data type for {@code BesselY1} output and operands + * @return a new instance of BesselY1 + */ + public BesselY1 besselY1(Operand x) { + return BesselY1.create(scope, x); + } + + /** + * The Dawsn operation + * + * @param x The x value + * @param data type for {@code Dawsn} output and operands + * @return a new instance of Dawsn + */ + public Dawsn dawsn(Operand x) { + return Dawsn.create(scope, x); + } + + /** + * The Expint operation + * + * @param x The x value + * @param data type for {@code Expint} output and operands + * @return a new instance of Expint + */ + public Expint expint(Operand x) { + return Expint.create(scope, x); + } + + /** + * The FresnelCos operation + * + * @param x The x value + * @param data type for {@code FresnelCos} output and operands + * @return a new instance of FresnelCos + */ + public FresnelCos fresnelCos(Operand x) { + return FresnelCos.create(scope, x); + } + + /** + * The FresnelSin operation + * + * @param x The x value + * @param data type for {@code FresnelSin} output and operands + * @return a new instance of FresnelSin + */ + public FresnelSin fresnelSin(Operand x) { + return FresnelSin.create(scope, x); + } + + /** + * The Spence operation + * + * @param x The x value + * @param data type for {@code Spence} output and operands + * @return a new instance of Spence + */ + public Spence spence(Operand x) { + return Spence.create(scope, x); + } + + /** + * 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/NnOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java index 9ec8edfb8c1..c9f086a3255 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -22,11 +22,16 @@ import org.tensorflow.op.nn.AvgPool; import org.tensorflow.op.nn.AvgPool3d; import org.tensorflow.op.nn.AvgPool3dGrad; +import org.tensorflow.op.nn.AvgPoolGrad; import org.tensorflow.op.nn.BatchNormWithGlobalNormalization; import org.tensorflow.op.nn.BatchNormWithGlobalNormalizationGrad; import org.tensorflow.op.nn.BiasAdd; import org.tensorflow.op.nn.BiasAddGrad; +import org.tensorflow.op.nn.BlockLSTM; +import org.tensorflow.op.nn.BlockLSTMGrad; +import org.tensorflow.op.nn.CTCLossV2; import org.tensorflow.op.nn.ComputeAccidentalHits; +import org.tensorflow.op.nn.Conv; import org.tensorflow.op.nn.Conv2d; import org.tensorflow.op.nn.Conv2dBackpropFilter; import org.tensorflow.op.nn.Conv2dBackpropInput; @@ -36,6 +41,8 @@ import org.tensorflow.op.nn.CtcBeamSearchDecoder; import org.tensorflow.op.nn.CtcGreedyDecoder; import org.tensorflow.op.nn.CtcLoss; +import org.tensorflow.op.nn.CudnnRNN; +import org.tensorflow.op.nn.CudnnRNNBackprop; import org.tensorflow.op.nn.CudnnRNNCanonicalToParams; import org.tensorflow.op.nn.CudnnRNNParamsToCanonical; import org.tensorflow.op.nn.CudnnRnnParamsSize; @@ -49,18 +56,28 @@ import org.tensorflow.op.nn.Dilation2dBackpropFilter; import org.tensorflow.op.nn.Dilation2dBackpropInput; import org.tensorflow.op.nn.Elu; +import org.tensorflow.op.nn.EluGrad; import org.tensorflow.op.nn.FixedUnigramCandidateSampler; import org.tensorflow.op.nn.FractionalAvgPool; +import org.tensorflow.op.nn.FractionalAvgPoolGrad; import org.tensorflow.op.nn.FractionalMaxPool; +import org.tensorflow.op.nn.FractionalMaxPoolGrad; import org.tensorflow.op.nn.FusedBatchNorm; import org.tensorflow.op.nn.FusedBatchNormGrad; import org.tensorflow.op.nn.FusedPadConv2d; import org.tensorflow.op.nn.FusedResizeAndPadConv2d; +import org.tensorflow.op.nn.GRUBlockCell; +import org.tensorflow.op.nn.GRUBlockCellGrad; import org.tensorflow.op.nn.InTopK; +import org.tensorflow.op.nn.InvGrad; +import org.tensorflow.op.nn.IsotonicRegression; import org.tensorflow.op.nn.L2Loss; +import org.tensorflow.op.nn.LSTMBlockCell; +import org.tensorflow.op.nn.LSTMBlockCellGrad; import org.tensorflow.op.nn.LeakyRelu; import org.tensorflow.op.nn.LearnedUnigramCandidateSampler; import org.tensorflow.op.nn.LocalResponseNormalization; +import org.tensorflow.op.nn.LocalResponseNormalizationGrad; import org.tensorflow.op.nn.LogSoftmax; import org.tensorflow.op.nn.MaxPool; import org.tensorflow.op.nn.MaxPool3d; @@ -69,12 +86,28 @@ import org.tensorflow.op.nn.MaxPoolGrad; import org.tensorflow.op.nn.MaxPoolGradGrad; import org.tensorflow.op.nn.MaxPoolGradGradWithArgmax; +import org.tensorflow.op.nn.MaxPoolGradWithArgmax; import org.tensorflow.op.nn.MaxPoolWithArgmax; import org.tensorflow.op.nn.NthElement; import org.tensorflow.op.nn.QuantizedAvgPool; import org.tensorflow.op.nn.QuantizedBatchNormWithGlobalNormalization; import org.tensorflow.op.nn.QuantizedBiasAdd; +import org.tensorflow.op.nn.QuantizedConv2DAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DPerChannel; +import org.tensorflow.op.nn.QuantizedConv2DWithBias; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize; import org.tensorflow.op.nn.QuantizedConv2d; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2D; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize; import org.tensorflow.op.nn.QuantizedInstanceNorm; import org.tensorflow.op.nn.QuantizedMaxPool; import org.tensorflow.op.nn.QuantizedRelu; @@ -82,14 +115,20 @@ import org.tensorflow.op.nn.QuantizedReluX; import org.tensorflow.op.nn.Relu; import org.tensorflow.op.nn.Relu6; +import org.tensorflow.op.nn.Relu6Grad; +import org.tensorflow.op.nn.ReluGrad; import org.tensorflow.op.nn.Selu; +import org.tensorflow.op.nn.SeluGrad; import org.tensorflow.op.nn.Softmax; import org.tensorflow.op.nn.SoftmaxCrossEntropyWithLogits; import org.tensorflow.op.nn.Softsign; +import org.tensorflow.op.nn.SoftsignGrad; import org.tensorflow.op.nn.SpaceToBatch; import org.tensorflow.op.nn.SpaceToDepth; import org.tensorflow.op.nn.SparseSoftmaxCrossEntropyWithLogits; import org.tensorflow.op.nn.TopK; +import org.tensorflow.op.nn.UniformQuantizedConvolution; +import org.tensorflow.op.nn.UniformQuantizedConvolutionHybrid; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -99,7 +138,7 @@ /** * An API for building {@code nn} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class NnOps { private final Scope scope; @@ -116,7 +155,6 @@ public final class NnOps { * Each entry in {@code output} is the mean of the corresponding size {@code ksize} * window in {@code value}. * - * @param data type for {@code output} output * @param value 4-D with shape {@code [batch, height, width, channels]}. * @param ksize The size of the sliding window for each dimension of {@code value}. * @param strides The stride of the sliding window for each dimension of {@code value}. @@ -135,7 +173,6 @@ public AvgPool avgPool(Operand value, List ksize * Each entry in {@code output} is the mean of the corresponding size {@code ksize} window in * {@code value}. * - * @param data type for {@code output} output * @param input Shape {@code [batch, depth, rows, cols, channels]} tensor to pool over. * @param ksize 1-D tensor of length 5. The size of the window for each dimension of * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. @@ -154,7 +191,6 @@ public AvgPool3d avgPool3d(Operand input, List k /** * Computes gradients of average pooling function. * - * @param data type for {@code output} output * @param origInputShape The original input dimensions. * @param grad Output backprop of shape {@code [batch, depth, rows, cols, channels]}. * @param ksize 1-D tensor of length 5. The size of the window for each dimension of @@ -172,11 +208,29 @@ public AvgPool3dGrad avgPool3dGrad(Operand origIn return AvgPool3dGrad.create(scope, origInputShape, grad, ksize, strides, padding, options); } + /** + * Computes gradients of the average pooling function. + * + * @param origInputShape 1-D. Shape of the original input to {@code avg_pool}. + * @param grad 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. + * the output of {@code avg_pool}. + * @param ksize The size of the sliding window for each dimension of the input. + * @param strides The stride of the sliding window for each dimension of the input. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code AvgPoolGrad} output and operands + * @return a new instance of AvgPoolGrad + */ + public AvgPoolGrad avgPoolGrad(Operand origInputShape, + Operand grad, List ksize, List strides, String padding, + AvgPoolGrad.Options... options) { + return AvgPoolGrad.create(scope, origInputShape, grad, ksize, strides, padding, options); + } + /** * Batch normalization. * This op is deprecated. Prefer {@code tf.nn.batch_normalization}. * - * @param data type for {@code result} output * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. * This is the first output from tf.nn.moments, @@ -205,7 +259,6 @@ public BatchNormWithGlobalNormalization batchNormWithGlobal * Gradients for batch normalization. * This op is deprecated. See {@code tf.nn.batch_normalization}. * - * @param data type for {@code dx} output * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. * This is the first output from tf.nn.moments, @@ -234,7 +287,6 @@ public BatchNormWithGlobalNormalizationGrad batchNormWithGl * This is a special case of {@code tf.add} where {@code bias} is restricted to be 1-D. * Broadcasting is supported, so {@code value} may have any number of dimensions. * - * @param data type for {@code output} output * @param value Any number of dimensions. * @param bias 1-D with size the last dimension of {@code value}. * @param options carries optional attribute values @@ -252,7 +304,6 @@ public BiasAdd biasAdd(Operand value, Operand bias, * For NHWC data format, the feature dimension is the last. For NCHW data format, * the feature dimension is the third-to-last. * - * @param data type for {@code output} output * @param outBackprop Any number of dimensions. * @param options carries optional attribute values * @param data type for {@code BiasAddGrad} output and operands @@ -263,6 +314,104 @@ public BiasAddGrad biasAddGrad(Operand outBackprop, return BiasAddGrad.create(scope, outBackprop, options); } + /** + * Computes the LSTM cell forward propagation for all the time steps. + * This is equivalent to applying LSTMBlockCell in a loop, like so: + *

    +   *  for x1 in unpack(x):
    +   *    i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(
    +   *      x1, cs_prev, h_prev, w, wci, wcf, wco, b)
    +   *    cs_prev = cs1
    +   *    h_prev = h1
    +   *    i.append(i1)
    +   *    cs.append(cs1)
    +   *    f.append(f1)
    +   *    o.append(o1)
    +   *    ci.append(ci1)
    +   *    co.append(co1)
    +   *    h.append(h1)
    +   *  return pack(i), pack(cs), pack(f), pack(o), pack(ci), pack(ch), pack(h)
    +   *
    +   *  Note that unlike LSTMBlockCell (and BlockLSTM) which uses ICFO gate layout,
    +   *  this op uses IFCO. So in order for the following snippet to be equivalent
    +   *  all gate-related outputs should be reordered.
    +   *  
    + * + * @param seqLenMax Maximum time length actually used by this input. Outputs are padded + * with zeros beyond this length. + * @param x The sequence input to the LSTM, shape (timelen, batch_size, num_inputs). + * @param csPrev Value of the initial cell state. + * @param hPrev Initial output of cell (to be used for peephole). + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param options carries optional attribute values + * @param data type for {@code BlockLSTMV2} output and operands + * @return a new instance of BlockLSTM + */ + public BlockLSTM blockLSTM(Operand seqLenMax, Operand x, + Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, + Operand wco, Operand b, BlockLSTM.Options... options) { + return BlockLSTM.create(scope, seqLenMax, x, csPrev, hPrev, w, wci, wcf, wco, b, options); + } + + /** + * Computes the LSTM cell backward propagation for the entire time sequence. + * This implementation is to be used in conjunction of BlockLSTMV2. + * + * @param seqLenMax Maximum time length actually used by this input. Outputs are padded + * with zeros beyond this length. + * @param x The sequence input to the LSTM, shape (timelen, batch_size, num_inputs). + * @param csPrev Value of the initial cell state. + * @param hPrev Initial output of cell (to be used for peephole). + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param i The input gate over the whole time sequence. + * @param cs The cell state before the tanh over the whole time sequence. + * @param f The forget gate over the whole time sequence. + * @param o The output gate over the whole time sequence. + * @param ci The cell input over the whole time sequence. + * @param co The cell after the tanh over the whole time sequence. + * @param h The output h vector over the whole time sequence. + * @param csGrad The current gradient of cs. + * @param hGrad The gradient of h vector. + * @param usePeephole Whether to use peephole weights. + * @param data type for {@code BlockLSTMGradV2} output and operands + * @return a new instance of BlockLSTMGrad + */ + public BlockLSTMGrad blockLSTMGrad(Operand seqLenMax, Operand x, + Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, + Operand wco, Operand b, Operand i, Operand cs, Operand f, Operand o, + Operand ci, Operand co, Operand h, Operand csGrad, Operand hGrad, + Boolean usePeephole) { + return BlockLSTMGrad.create(scope, seqLenMax, x, csPrev, hPrev, w, wci, wcf, wco, b, i, cs, f, o, ci, co, h, csGrad, hGrad, usePeephole); + } + + /** + * Calculates the CTC Loss (log probability) for each batch entry. Also calculates + * the gradient. This class performs the softmax operation for you, so inputs + * should be e.g. linear projections of outputs by an LSTM. + * + * @param inputs 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. Default blank + * label is 0 rather num_classes - 1. + * @param labelsIndices The indices of a {@code SparseTensor}. + * {@code labels_indices(i, :) == [b, t]} means {@code labels_values(i)} stores the id for + * {@code (batch b, time t)}. + * @param labelsValues The values (labels) associated with the given batch and time. + * @param sequenceLength A vector containing sequence lengths (batch). + * @param options carries optional attribute values + * @return a new instance of CTCLossV2 + */ + public CTCLossV2 cTCLossV2(Operand inputs, Operand labelsIndices, + Operand labelsValues, Operand sequenceLength, CTCLossV2.Options... options) { + return CTCLossV2.create(scope, inputs, labelsIndices, labelsValues, sequenceLength, options); + } + /** * Computes the ids of the positions in sampled_candidates that match true_labels. * When doing log-odds NCE, the result of this op should be passed through a @@ -281,6 +430,32 @@ public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, return ComputeAccidentalHits.create(scope, trueClasses, sampledCandidates, numTrue, options); } + /** + * Computes a N-D convolution given (N+1+batch_dims)-D {@code input} and (N+2)-D {@code filter} tensors. + * General function for computing a N-D convolution. It is required that + * {@code 1 <= N <= 3}. + * + * @param input Tensor of type T and shape {@code batch_shape + spatial_shape + [in_channels]} in the + * case that {@code channels_last_format = true} or shape + * {@code batch_shape + [in_channels] + spatial_shape} if {@code channels_last_format = false}. + * spatial_shape is N-dimensional with {@code N=2} or {@code N=3}. + * Also note that {@code batch_shape} is dictated by the parameter {@code batch_dims} + * and defaults to 1. + * @param filter An {@code (N+2)-D} Tensor with the same type as {@code input} and shape + * {@code spatial_filter_shape + [in_channels, out_channels]}, where spatial_filter_shape + * is N-dimensional with {@code N=2} or {@code N=3}. + * @param strides 1-D tensor of length {@code N+2}. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[N+1] = 1}. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code Conv} output and operands + * @return a new instance of Conv + */ + public Conv conv(Operand input, Operand filter, List strides, + String padding, Conv.Options... options) { + return Conv.create(scope, input, filter, strides, padding, options); + } + /** * Computes a 2-D convolution given 4-D {@code input} and {@code filter} tensors. * Given an input tensor of shape {@code [batch, in_height, in_width, in_channels]} @@ -304,7 +479,6 @@ public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, *

    Must have {@code strides[0] = strides[3] = 1}. For the most common case of the same * horizontal and vertices strides, {@code strides = [1, stride, stride, 1]}. * - * @param data type for {@code output} output * @param input A 4-D tensor. The dimension order is interpreted according to the value * of {@code data_format}, see below for details. * @param filter A 4-D tensor of shape @@ -325,7 +499,6 @@ public Conv2d conv2d(Operand input, Operand filter, /** * Computes the gradients of convolution with respect to the filter. * - * @param data type for {@code output} output * @param input 4-D with shape {@code [batch, in_height, in_width, in_channels]}. * @param filterSizes An integer vector representing the tensor shape of {@code filter}, * where {@code filter} is a 4-D @@ -349,7 +522,6 @@ public Conv2dBackpropFilter conv2dBackpropFilter(Operand< /** * Computes the gradients of convolution with respect to the input. * - * @param data type for {@code output} output * @param inputSizes An integer vector representing the shape of {@code input}, * where {@code input} is a 4-D {@code [batch, height, width, channels]} tensor. * @param filter 4-D with shape @@ -377,7 +549,6 @@ public Conv2dBackpropInput conv2dBackpropInput(OperandOur Conv3D implements a form of cross-correlation. * - * @param data type for {@code output} output * @param input Shape {@code [batch, in_depth, in_height, in_width, in_channels]}. * @param filter Shape {@code [filter_depth, filter_height, filter_width, in_channels, out_channels]}. {@code in_channels} must match between {@code input} and {@code filter}. * @param strides 1-D tensor of length 5. The stride of the sliding window for each @@ -395,7 +566,6 @@ public Conv3d conv3d(Operand input, Operand filter, /** * Computes the gradients of 3-D convolution with respect to the filter. * - * @param data type for {@code output} output * @param input Shape {@code [batch, depth, rows, cols, in_channels]}. * @param filterSizes An integer vector representing the tensor shape of {@code filter}, * where {@code filter} is a 5-D @@ -418,7 +588,6 @@ public Conv3dBackpropFilter conv3dBackpropFilter(Operand< /** * Computes the gradients of 3-D convolution with respect to the input. * - * @param data type for {@code output} output * @param inputSizes An integer vector representing the tensor shape of {@code input}, * where {@code input} is a 5-D * {@code [batch, depth, rows, cols, in_channels]} tensor. @@ -446,7 +615,6 @@ public Conv3dBackpropInput conv3dBackpropInput( * "A B" is returned if merge_repeated = True but "A B B B B" is * returned if merge_repeated = False. * - * @param data type for {@code log_probability} output * @param inputs 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. * @param sequenceLength A vector containing sequence lengths, size {@code (batch)}. * @param beamWidth A scalar >= 0 (beam search beam width). @@ -472,7 +640,6 @@ public CtcBeamSearchDecoder ctcBeamSearchDecoder(Operand< * time and batch corresponds to the blank, index {@code (num_classes - 1)}, no new * element is emitted. * - * @param data type for {@code log_probability} output * @param inputs 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. * @param sequenceLength A vector containing sequence lengths, size {@code (batch_size)}. * @param options carries optional attribute values @@ -489,7 +656,6 @@ public CtcGreedyDecoder ctcGreedyDecoder(Operand input * the gradient. This class performs the softmax operation for you, so inputs * should be e.g. linear projections of outputs by an LSTM. * - * @param data type for {@code loss} output * @param inputs 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. * @param labelsIndices The indices of a {@code SparseTensor}. * {@code labels_indices(i, :) == [b, t]} means {@code labels_values(i)} stores the id for @@ -505,6 +671,134 @@ public CtcLoss ctcLoss(Operand inputs, Operand return CtcLoss.create(scope, inputs, labelsIndices, labelsValues, sequenceLength, options); } + /** + * A RNN backed by cuDNN. + * Computes the RNN from the input and initial states, with respect to the params + * buffer. Accepts one extra input "sequence_lengths" than CudnnRNN. + *

    rnn_mode: Indicates the type of the RNN model. + * input_mode: Indicates whether there is a linear projection between the input and + * the actual computation before the first layer. 'skip_input' is only allowed + * when input_size == num_units; 'auto_select' implies 'skip_input' when + * input_size == num_units; otherwise, it implies 'linear_input'. + * direction: Indicates whether a bidirectional model will be used. Should be + * "unidirectional" or "bidirectional". + * dropout: Dropout probability. When set to 0., dropout is disabled. + * seed: The 1st part of a seed to initialize dropout. + * seed2: The 2nd part of a seed to initialize dropout. + * input: If time_major is true, this is a 3-D tensor with the shape of + * [seq_length, batch_size, input_size]. If time_major is false, the shape is + * [batch_size, seq_length, input_size]. + * input_h: If time_major is true, this is a 3-D tensor with the shape of + * [num_layer * dir, batch_size, num_units]. If time_major is false, the shape + * is [batch_size, num_layer * dir, num_units]. + * input_c: For LSTM, a 3-D tensor with the shape of + * [num_layer * dir, batch, num_units]. For other models, it is ignored. + * params: A 1-D tensor that contains the weights and biases in an opaque layout. + * The size must be created through CudnnRNNParamsSize, and initialized + * separately. Note that they might not be compatible across different + * generations. So it is a good idea to save and restore + * sequence_lengths: a vector of lengths of each input sequence. + * output: If time_major is true, this is a 3-D tensor with the shape of + * [seq_length, batch_size, dir * num_units]. If time_major is false, the + * shape is [batch_size, seq_length, dir * num_units]. + * output_h: The same shape has input_h. + * output_c: The same shape as input_c for LSTM. An empty tensor for other models. + * is_training: Indicates whether this operation is used for inference or + * training. + * time_major: Indicates whether the input/output format is time major or batch + * major. + * reserve_space: An opaque tensor that can be used in backprop calculation. It + * is only produced if is_training is true. + * + * @param input The input value + * @param inputH The inputH value + * @param inputC The inputC value + * @param params The params value + * @param sequenceLengths The sequenceLengths value + * @param options carries optional attribute values + * @param data type for {@code CudnnRNNV3} output and operands + * @return a new instance of CudnnRNN + */ + public CudnnRNN cudnnRNN(Operand input, Operand inputH, + Operand inputC, Operand params, Operand sequenceLengths, + CudnnRNN.Options... options) { + return CudnnRNN.create(scope, input, inputH, inputC, params, sequenceLengths, options); + } + + /** + * Backprop step of CudnnRNNV3. + * Compute the backprop of both data and weights in a RNN. Takes an extra + * "sequence_lengths" input than CudnnRNNBackprop. + *

    rnn_mode: Indicates the type of the RNN model. + * input_mode: Indicates whether there is a linear projection between the input and + * the actual computation before the first layer. 'skip_input' is only allowed + * when input_size == num_units; 'auto_select' implies 'skip_input' when + * input_size == num_units; otherwise, it implies 'linear_input'. + * direction: Indicates whether a bidirectional model will be used. Should be + * "unidirectional" or "bidirectional". + * dropout: Dropout probability. When set to 0., dropout is disabled. + * seed: The 1st part of a seed to initialize dropout. + * seed2: The 2nd part of a seed to initialize dropout. + * input: If time_major is true, this is a 3-D tensor with the shape of + * [seq_length, batch_size, input_size]. If time_major is false, the shape is + * [batch_size, seq_length, input_size]. + * input_h: If time_major is true, this is a 3-D tensor with the shape of + * [num_layer * dir, batch_size, num_units]. If time_major is false, the shape + * is [batch_size, num_layer * dir, num_units]. + * input_c: For LSTM, a 3-D tensor with the shape of + * [num_layer * dir, batch, num_units]. For other models, it is ignored. + * params: A 1-D tensor that contains the weights and biases in an opaque layout. + * The size must be created through CudnnRNNParamsSize, and initialized + * separately. Note that they might not be compatible across different + * generations. So it is a good idea to save and restore + * sequence_lengths: a vector of lengths of each input sequence. + * output: If time_major is true, this is a 3-D tensor with the shape of + * [seq_length, batch_size, dir * num_units]. If time_major is false, the + * shape is [batch_size, seq_length, dir * num_units]. + * output_h: The same shape has input_h. + * output_c: The same shape as input_c for LSTM. An empty tensor for other models. + * output_backprop: A 3-D tensor with the same shape as output in the forward pass. + * output_h_backprop: A 3-D tensor with the same shape as output_h in the forward + * pass. + * output_c_backprop: A 3-D tensor with the same shape as output_c in the forward + * pass. + * time_major: Indicates whether the input/output format is time major or batch + * major. + * reserve_space: The same reserve_space produced in the forward operation. + * input_backprop: The backprop to input in the forward pass. Has the same shape + * as input. + * input_h_backprop: The backprop to input_h in the forward pass. Has the same + * shape as input_h. + * input_c_backprop: The backprop to input_c in the forward pass. Has the same + * shape as input_c. + * params_backprop: The backprop to the params buffer in the forward pass. Has the + * same shape as params. + * + * @param input The input value + * @param inputH The inputH value + * @param inputC The inputC value + * @param params The params value + * @param sequenceLengths The sequenceLengths value + * @param output The output value + * @param outputH The outputH value + * @param outputC The outputC value + * @param outputBackprop The outputBackprop value + * @param outputHBackprop The outputHBackprop value + * @param outputCBackprop The outputCBackprop value + * @param reserveSpace The reserveSpace value + * @param hostReserved The hostReserved value + * @param options carries optional attribute values + * @param data type for {@code CudnnRNNBackpropV3} output and operands + * @return a new instance of CudnnRNNBackprop + */ + public CudnnRNNBackprop cudnnRNNBackprop(Operand input, + Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, + Operand output, Operand outputH, Operand outputC, Operand outputBackprop, + Operand outputHBackprop, Operand outputCBackprop, Operand reserveSpace, + Operand hostReserved, CudnnRNNBackprop.Options... options) { + return CudnnRNNBackprop.create(scope, input, inputH, inputC, params, sequenceLengths, output, outputH, outputC, outputBackprop, outputHBackprop, outputCBackprop, reserveSpace, hostReserved, options); + } + /** * Converts CudnnRNN params from canonical form to usable form. It supports the projection in LSTM. * Writes a set of weights into the opaque params buffer so they can be used in @@ -536,12 +830,11 @@ public CtcLoss ctcLoss(Operand inputs, Operand * num_proj: The output dimensionality for the projection matrices. If None or 0, * no projection is performed. * - * @param data type for {@code params} output - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param weights the weights value - * @param biases the biases value + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param weights The weights value + * @param biases The biases value * @param options carries optional attribute values * @param data type for {@code CudnnRNNCanonicalToParamsV2} output and operands * @return a new instance of CudnnRNNCanonicalToParams @@ -584,13 +877,12 @@ public CudnnRNNCanonicalToParams cudnnRNNCanonicalToParam * num_proj: The output dimensionality for the projection matrices. If None or 0, * no projection is performed. * - * @param data type for {@code weights} output - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param params the params value - * @param numParamsWeights the value of the numParamsWeights property - * @param numParamsBiases the value of the numParamsBiases property + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param params The params value + * @param numParamsWeights The value of the numParamsWeights attribute + * @param numParamsBiases The value of the numParamsBiases attribute * @param options carries optional attribute values * @param data type for {@code CudnnRNNParamsToCanonicalV2} output and operands * @return a new instance of CudnnRNNParamsToCanonical @@ -625,12 +917,11 @@ public CudnnRNNParamsToCanonical cudnnRNNParamsToCanonica * CudnnRNNParamsBiases to save and restore them in a way that is compatible * across different runs. * - * @param data type for {@code params_size} output - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param T the value of the T property - * @param S the value of the S property + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param T The value of the T attribute + * @param S The value of the S attribute * @param options carries optional attribute values * @param data type for {@code CudnnRNNParamsSize} output and operands * @param data type for {@code CudnnRNNParamsSize} output and operands @@ -646,7 +937,6 @@ public CudnnRnnParamsSize cudnnRnnPara * Returns the dimension index in the destination data format given the one in * the source data format. * - * @param data type for {@code y} output * @param x A Tensor with each element as a dimension index in source data format. * Must be in the range [-4, 4). * @param options carries optional attribute values @@ -660,28 +950,37 @@ public DataFormatDimMap dataFormatDimMap(Operand x, /** * Permute input tensor from {@code src_format} to {@code dst_format}. - * Input tensor must be a vector of size 4, or a 4x2 tensor. - *

    For example, with {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and inputs: + * Given source and destination format strings of length n=4 or 5, the input + * tensor must be a vector of size n or n-2, or a 2D tensor of shape + * (n, 2) or (n-2, 2). + *

    If the first dimension of the input tensor is n-2, it is assumed that + * non-spatial dimensions are omitted (i.e {@code N}, {@code C}). + *

    For example, with {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and input: *

        *  [1, 2, 3, 4]
        *  
    - *

    and + *

    , the output will be: *

    -   *  [[1, 2, 3, 4],
    -   *   [5, 6, 7, 8]]
    +   *  [1, 4, 2, 3]
        *  
    - *

    , the outputs will be (respectively): + *

    With {@code src_format} of {@code NDHWC}, {@code dst_format} of {@code NCDHW}, and input: *

    -   *  [1, 4, 2, 3]
    +   *  [[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]
    +   *  
    + *

    , the output will be: + *

    +   *  [[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]
        *  
    - *

    and + *

    With {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and input: *

    -   *  [[1, 4, 2, 3],
    -   *   [5, 8, 6, 7]]
    +   *  [1, 2]
    +   *  
    + *

    , the output will be: + *

    +   *  [1, 2]
        *  
    * - * @param data type for {@code y} output - * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. + * @param x Tensor of rank 1 or 2 in source data format. * @param options carries optional attribute values * @param data type for {@code DataFormatVecPermute} output and operands * @return a new instance of DataFormatVecPermute @@ -701,7 +1000,7 @@ public DataFormatVecPermute dataFormatVecPermute(Operand< *
      *
    • Chunks of data of size {@code block_size * block_size} from depth are rearranged * into non-overlapping blocks of size {@code block_size x block_size}
    • - *
    • The width the output tensor is {@code input_depth * block_size}, whereas the + *
    • The width of the output tensor is {@code input_depth * block_size}, whereas the * height is {@code input_height * block_size}.
    • *
    • The Y, X coordinates within each block of the output image are determined * by the high order component of the input channel index.
    • @@ -768,8 +1067,7 @@ public DataFormatVecPermute dataFormatVecPermute(Operand< * * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param blockSize The size of the spatial block, same as in Space2Depth. * @param options carries optional attribute values * @param data type for {@code DepthToSpace} output and operands @@ -799,9 +1097,8 @@ public DepthToSpace depthToSpace(Operand input, Long blo *

      Must have {@code strides[0] = strides[3] = 1}. For the most common case of the same * horizontal and vertices strides, {@code strides = [1, stride, stride, 1]}. * - * @param data type for {@code output} output - * @param input the input value - * @param filter the filter value + * @param input The input value + * @param filter The filter value * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. * @param padding The type of padding algorithm to use. @@ -818,7 +1115,6 @@ public DepthwiseConv2dNative depthwiseConv2dNative(Operan /** * Computes the gradients of depthwise convolution with respect to the filter. * - * @param data type for {@code output} output * @param input 4-D with shape based on {@code data_format}. For example, if * {@code data_format} is 'NHWC' then {@code input} is a 4-D {@code [batch, in_height, in_width, in_channels]} tensor. * @param filterSizes An integer vector representing the tensor shape of {@code filter}, @@ -844,7 +1140,6 @@ public DepthwiseConv2dNativeBackpropFilter depthwiseConv2 /** * Computes the gradients of depthwise convolution with respect to the input. * - * @param data type for {@code output} output * @param inputSizes An integer vector representing the shape of {@code input}, based * on {@code data_format}. For example, if {@code data_format} is 'NHWC' then * {@code input} is a 4-D {@code [batch, height, width, channels]} tensor. @@ -891,7 +1186,6 @@ public DepthwiseConv2dNativeBackpropInput depthwiseConv2d *

      Note on duality: The dilation of {@code input} by the {@code filter} is equal to the * negation of the erosion of {@code -input} by the reflected {@code filter}. * - * @param data type for {@code output} output * @param input 4-D with shape {@code [batch, in_height, in_width, depth]}. * @param filter 3-D with shape {@code [filter_height, filter_width, depth]}. * @param strides The stride of the sliding window for each dimension of the input @@ -910,7 +1204,6 @@ public Dilation2d dilation2d(Operand input, Operand /** * Computes the gradient of morphological 2-D dilation with respect to the filter. * - * @param data type for {@code filter_backprop} output * @param input 4-D with shape {@code [batch, in_height, in_width, depth]}. * @param filter 3-D with shape {@code [filter_height, filter_width, depth]}. * @param outBackprop 4-D with shape {@code [batch, out_height, out_width, depth]}. @@ -931,7 +1224,6 @@ public Dilation2dBackpropFilter dilation2dBackpropFilter( /** * Computes the gradient of morphological 2-D dilation with respect to the input. * - * @param data type for {@code in_backprop} output * @param input 4-D with shape {@code [batch, in_height, in_width, depth]}. * @param filter 3-D with shape {@code [filter_height, filter_width, depth]}. * @param outBackprop 4-D with shape {@code [batch, out_height, out_width, depth]}. @@ -972,8 +1264,7 @@ public Dilation2dBackpropInput dilation2dBackpropInput(Op *

      See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) * * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Elu} output and operands * @return a new instance of Elu */ @@ -981,6 +1272,18 @@ public Elu elu(Operand features) { return Elu.create(scope, features); } + /** + * Computes gradients for the exponential linear (Elu) operation. + * + * @param gradients The backpropagated gradients to the corresponding Elu operation. + * @param outputs The outputs of the corresponding Elu operation. + * @param data type for {@code EluGrad} output and operands + * @return a new instance of EluGrad + */ + public EluGrad eluGrad(Operand gradients, Operand outputs) { + return EluGrad.create(scope, gradients, outputs); + } + /** * Generates labels for candidate sampling with a learned unigram distribution. * A unigram sampler could use a fixed unigram distribution read from a @@ -1019,7 +1322,6 @@ public FixedUnigramCandidateSampler fixedUnigramCandidateSampler(Operand * generated, a mean operation is performed instead of a max operation in each * pooling region. * - * @param data type for {@code output} output * @param value 4-D with shape {@code [batch, height, width, channels]}. * @param poolingRatio Pooling ratio for each dimension of {@code value}, currently only * supports row and col dimension and should be >= 1.0. For example, a valid @@ -1036,6 +1338,32 @@ public FractionalAvgPool fractionalAvgPool(Operand val return FractionalAvgPool.create(scope, value, poolingRatio, options); } + /** + * Computes gradient of the FractionalAvgPool function. + * Unlike FractionalMaxPoolGrad, we don't need to find arg_max for + * FractionalAvgPoolGrad, we just need to evenly back-propagate each element of + * out_backprop to those indices that form the same pooling cell. Therefore, we + * just need to know the shape of original input tensor, instead of the whole + * tensor. + * + * @param origInputTensorShape Original input tensor shape for {@code fractional_avg_pool} + * @param outBackprop 4-D with shape {@code [batch, height, width, channels]}. Gradients + * w.r.t. the output of {@code fractional_avg_pool}. + * @param rowPoolingSequence row pooling sequence, form pooling region with + * col_pooling_sequence. + * @param colPoolingSequence column pooling sequence, form pooling region with + * row_pooling sequence. + * @param options carries optional attribute values + * @param data type for {@code FractionalAvgPoolGrad} output and operands + * @return a new instance of FractionalAvgPoolGrad + */ + public FractionalAvgPoolGrad fractionalAvgPoolGrad( + Operand origInputTensorShape, Operand outBackprop, + Operand rowPoolingSequence, Operand colPoolingSequence, + FractionalAvgPoolGrad.Options... options) { + return FractionalAvgPoolGrad.create(scope, origInputTensorShape, outBackprop, rowPoolingSequence, colPoolingSequence, options); + } + /** * Performs fractional max pooling on the input. * Fractional max pooling is slightly different than regular max pooling. In @@ -1065,7 +1393,6 @@ public FractionalAvgPool fractionalAvgPool(Operand val *

      For more details on fractional max pooling, see this paper: * Benjamin Graham, Fractional Max-Pooling * - * @param data type for {@code output} output * @param value 4-D with shape {@code [batch, height, width, channels]}. * @param poolingRatio Pooling ratio for each dimension of {@code value}, currently only * supports row and col dimension and should be >= 1.0. For example, a valid @@ -1082,13 +1409,32 @@ public FractionalMaxPool fractionalMaxPool(Operand val return FractionalMaxPool.create(scope, value, poolingRatio, options); } + /** + * Computes gradient of the FractionalMaxPool function. + * + * @param origInput Original input for {@code fractional_max_pool} + * @param origOutput Original output for {@code fractional_max_pool} + * @param outBackprop 4-D with shape {@code [batch, height, width, channels]}. Gradients + * w.r.t. the output of {@code fractional_max_pool}. + * @param rowPoolingSequence row pooling sequence, form pooling region with + * col_pooling_sequence. + * @param colPoolingSequence column pooling sequence, form pooling region with + * row_pooling sequence. + * @param options carries optional attribute values + * @param data type for {@code FractionalMaxPoolGrad} output and operands + * @return a new instance of FractionalMaxPoolGrad + */ + public FractionalMaxPoolGrad fractionalMaxPoolGrad(Operand origInput, + Operand origOutput, Operand outBackprop, Operand rowPoolingSequence, + Operand colPoolingSequence, FractionalMaxPoolGrad.Options... options) { + return FractionalMaxPoolGrad.create(scope, origInput, origOutput, outBackprop, rowPoolingSequence, colPoolingSequence, options); + } + /** * Batch normalization. * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". * The size of 1D Tensors matches the dimension C of the 4D Tensors. * - * @param data type for {@code y} output - * @param data type for {@code batch_mean} output * @param x A 4D Tensor for input data. * @param scale A 1D Tensor for scaling factor, to scale the normalized x. * @param offset A 1D Tensor for offset, to shift to the normalized x. @@ -1112,8 +1458,6 @@ public FusedBatchNorm fusedBatchNor * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". * The size of 1D Tensors matches the dimension C of the 4D Tensors. * - * @param data type for {@code x_backprop} output - * @param data type for {@code scale_backprop} output * @param yBackprop A 4D Tensor for the gradient with respect to y. * @param x A 4D Tensor for input data. * @param scale A 1D Tensor for scaling factor, to scale the normalized x. @@ -1154,13 +1498,12 @@ public FusedBatchNormGrad fusedBatc * will block if multiple versions are being run in parallel. This is because this * operator is primarily an optimization to minimize memory usage. * - * @param data type for {@code output} output * @param input 4-D with shape {@code [batch, in_height, in_width, in_channels]}. * @param paddings A two-column matrix specifying the padding sizes. The number of * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape * {@code [filter_height, filter_width, in_channels, out_channels]}. - * @param mode the value of the mode property + * @param mode The value of the mode attribute * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. @@ -1186,7 +1529,6 @@ public FusedPadConv2d fusedPadConv2d(Operand input, * will block if multiple versions are being run in parallel. This is because this * operator is primarily an optimization to minimize memory usage. * - * @param data type for {@code output} output * @param input 4-D with shape {@code [batch, in_height, in_width, in_channels]}. * @param sizeOutput A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. @@ -1194,7 +1536,7 @@ public FusedPadConv2d fusedPadConv2d(Operand input, * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape * {@code [filter_height, filter_width, in_channels, out_channels]}. - * @param mode the value of the mode property + * @param mode The value of the mode attribute * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. @@ -1208,6 +1550,156 @@ public FusedResizeAndPadConv2d fusedResizeAndPadConv2d(Op return FusedResizeAndPadConv2d.create(scope, input, sizeOutput, paddings, filter, mode, strides, padding, options); } + /** + * Computes the GRU cell forward propagation for 1 time step. + * Args + * x: Input to the GRU cell. + * h_prev: State input from the previous GRU cell. + * w_ru: Weight matrix for the reset and update gate. + * w_c: Weight matrix for the cell connection gate. + * b_ru: Bias vector for the reset and update gate. + * b_c: Bias vector for the cell connection gate. + *

      Returns + * r: Output of the reset gate. + * u: Output of the update gate. + * c: Output of the cell connection gate. + * h: Current state of the GRU cell. + *

      Note on notation of the variables: + *

      Concatenation of a and b is represented by a_b + * Element-wise dot product of a and b is represented by ab + * Element-wise dot product is represented by \circ + * Matrix multiplication is represented by * + *

      Biases are initialized with : + * {@code b_ru} - constant_initializer(1.0) + * {@code b_c} - constant_initializer(0.0) + *

      This kernel op implements the following mathematical equations: + *

      +   *  x_h_prev = [x, h_prev]
      +   *
      +   *  [r_bar u_bar] = x_h_prev * w_ru + b_ru
      +   *
      +   *  r = sigmoid(r_bar)
      +   *  u = sigmoid(u_bar)
      +   *
      +   *  h_prevr = h_prev \circ r
      +   *
      +   *  x_h_prevr = [x h_prevr]
      +   *
      +   *  c_bar = x_h_prevr * w_c + b_c
      +   *  c = tanh(c_bar)
      +   *
      +   *  h = (1-u) \circ c + u \circ h_prev
      +   *  
      + * + * @param x The x value + * @param hPrev The hPrev value + * @param wRu The wRu value + * @param wC The wC value + * @param bRu The bRu value + * @param bC The bC value + * @param data type for {@code GRUBlockCell} output and operands + * @return a new instance of GRUBlockCell + */ + public GRUBlockCell gRUBlockCell(Operand x, Operand hPrev, + Operand wRu, Operand wC, Operand bRu, Operand bC) { + return GRUBlockCell.create(scope, x, hPrev, wRu, wC, bRu, bC); + } + + /** + * Computes the GRU cell back-propagation for 1 time step. + * Args + * x: Input to the GRU cell. + * h_prev: State input from the previous GRU cell. + * w_ru: Weight matrix for the reset and update gate. + * w_c: Weight matrix for the cell connection gate. + * b_ru: Bias vector for the reset and update gate. + * b_c: Bias vector for the cell connection gate. + * r: Output of the reset gate. + * u: Output of the update gate. + * c: Output of the cell connection gate. + * d_h: Gradients of the h_new wrt to objective function. + *

      Returns + * d_x: Gradients of the x wrt to objective function. + * d_h_prev: Gradients of the h wrt to objective function. + * d_c_bar Gradients of the c_bar wrt to objective function. + * d_r_bar_u_bar Gradients of the r_bar & u_bar wrt to objective function. + *

      This kernel op implements the following mathematical equations: + *

      Note on notation of the variables: + *

      Concatenation of a and b is represented by a_b + * Element-wise dot product of a and b is represented by ab + * Element-wise dot product is represented by \circ + * Matrix multiplication is represented by * + *

      Additional notes for clarity: + *

      {@code w_ru} can be segmented into 4 different matrices. + *

      +   *  w_ru = [w_r_x w_u_x
      +   *          w_r_h_prev w_u_h_prev]
      +   *  
      + *

      Similarly, {@code w_c} can be segmented into 2 different matrices. + *

      +   *  w_c = [w_c_x w_c_h_prevr]
      +   *  
      + *

      Same goes for biases. + *

      +   *  b_ru = [b_ru_x b_ru_h]
      +   *  b_c = [b_c_x b_c_h]
      +   *  
      + *

      Another note on notation: + *

      +   *  d_x = d_x_component_1 + d_x_component_2
      +   *
      +   *  where d_x_component_1 = d_r_bar * w_r_x^T + d_u_bar * w_r_x^T
      +   *  and d_x_component_2 = d_c_bar * w_c_x^T
      +   *
      +   *  d_h_prev = d_h_prev_component_1 + d_h_prevr \circ r + d_h \circ u
      +   *  where d_h_prev_componenet_1 = d_r_bar * w_r_h_prev^T + d_u_bar * w_r_h_prev^T
      +   *  
      + *

      Mathematics behind the Gradients below: + *

      +   *  d_c_bar = d_h \circ (1-u) \circ (1-c \circ c)
      +   *  d_u_bar = d_h \circ (h-c) \circ u \circ (1-u)
      +   *
      +   *  d_r_bar_u_bar = [d_r_bar d_u_bar]
      +   *
      +   *  [d_x_component_1 d_h_prev_component_1] = d_r_bar_u_bar * w_ru^T
      +   *
      +   *  [d_x_component_2 d_h_prevr] = d_c_bar * w_c^T
      +   *
      +   *  d_x = d_x_component_1 + d_x_component_2
      +   *
      +   *  d_h_prev = d_h_prev_component_1 + d_h_prevr \circ r + u
      +   *  
      + *

      Below calculation is performed in the python wrapper for the Gradients + * (not in the gradient kernel.) + *

      +   *  d_w_ru = x_h_prevr^T * d_c_bar
      +   *
      +   *  d_w_c = x_h_prev^T * d_r_bar_u_bar
      +   *
      +   *  d_b_ru = sum of d_r_bar_u_bar along axis = 0
      +   *
      +   *  d_b_c = sum of d_c_bar along axis = 0
      +   *  
      + * + * @param x The x value + * @param hPrev The hPrev value + * @param wRu The wRu value + * @param wC The wC value + * @param bRu The bRu value + * @param bC The bC value + * @param r The r value + * @param u The u value + * @param c The c value + * @param dH The dH value + * @param data type for {@code GRUBlockCellGrad} output and operands + * @return a new instance of GRUBlockCellGrad + */ + public GRUBlockCellGrad gRUBlockCellGrad(Operand x, Operand hPrev, + Operand wRu, Operand wC, Operand bRu, Operand bC, Operand r, Operand u, + Operand c, Operand dH) { + return GRUBlockCellGrad.create(scope, x, hPrev, wRu, wC, bRu, bC, r, u, c, dH); + } + /** * Says whether the targets are in the top {@code K} predictions. * This outputs a {@code batch_size} bool array, an entry {@code out[i]} is {@code true} if the @@ -1233,6 +1725,43 @@ public InTopK inTopK(Operand predictions, Operand< return InTopK.create(scope, predictions, targets, k); } + /** + * Computes the gradient for the inverse of {@code x} wrt its input. + * Specifically, {@code grad = -dy * y*y}, where {@code y = 1/x}, and {@code dy} + * is the corresponding input gradient. + * + * @param y The y value + * @param dy The dy value + * @param data type for {@code InvGrad} output and operands + * @return a new instance of InvGrad + */ + public InvGrad invGrad(Operand y, Operand dy) { + return InvGrad.create(scope, y, dy); + } + + /** + * Solves a batch of isotonic regression problems. + * + * @param input A (batch_size, dim)-tensor holding a batch of inputs. + * @return a new instance of IsotonicRegression, with default output types + */ + public IsotonicRegression isotonicRegression(Operand input) { + return IsotonicRegression.create(scope, input); + } + + /** + * Solves a batch of isotonic regression problems. + * + * @param input A (batch_size, dim)-tensor holding a batch of inputs. + * @param outputDtype Dtype of output. + * @param data type for {@code IsotonicRegression} output and operands + * @return a new instance of IsotonicRegression + */ + public IsotonicRegression isotonicRegression( + Operand input, Class outputDtype) { + return IsotonicRegression.create(scope, input, outputDtype); + } + /** * L2 Loss. * Computes half the L2 norm of a tensor without the {@code sqrt}: @@ -1240,7 +1769,6 @@ public InTopK inTopK(Operand predictions, Operand< * output = sum(t ** 2) / 2 * * - * @param data type for {@code output} output * @param t Typically 2-D, but may have any dimensions. * @param data type for {@code L2Loss} output and operands * @return a new instance of L2Loss @@ -1249,11 +1777,84 @@ public L2Loss l2Loss(Operand t) { return L2Loss.create(scope, t); } + /** + * Computes the LSTM cell forward propagation for 1 time step. + * This implementation uses 1 weight matrix and 1 bias vector, and there's an + * optional peephole connection. + *

      This kernel op implements the following mathematical equations: + *

      +   *  xh = [x, h_prev]
      +   *  [i, f, ci, o] = xh * w + b
      +   *  f = f + forget_bias
      +   *
      +   *  if not use_peephole:
      +   *    wci = wcf = wco = 0
      +   *
      +   *  i = sigmoid(cs_prev * wci + i)
      +   *  f = sigmoid(cs_prev * wcf + f)
      +   *  ci = tanh(ci)
      +   *
      +   *  cs = ci .* i + cs_prev .* f
      +   *  cs = clip(cs, cell_clip)
      +   *
      +   *  o = sigmoid(cs * wco + o)
      +   *  co = tanh(cs)
      +   *  h = co .* o
      +   *  
      + * + * @param x The input to the LSTM cell, shape (batch_size, num_inputs). + * @param csPrev Value of the cell state at previous time step. + * @param hPrev Output of the previous cell at previous time step. + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param options carries optional attribute values + * @param data type for {@code LSTMBlockCell} output and operands + * @return a new instance of LSTMBlockCell + */ + public LSTMBlockCell lSTMBlockCell(Operand x, Operand csPrev, + Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, + LSTMBlockCell.Options... options) { + return LSTMBlockCell.create(scope, x, csPrev, hPrev, w, wci, wcf, wco, b, options); + } + + /** + * Computes the LSTM cell backward propagation for 1 timestep. + * This implementation is to be used in conjunction of LSTMBlockCell. + * + * @param x The input to the LSTM cell, shape (batch_size, num_inputs). + * @param csPrev The previous cell state. + * @param hPrev The previous h state. + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param i The input gate. + * @param cs The cell state before the tanh. + * @param f The forget gate. + * @param o The output gate. + * @param ci The cell input. + * @param co The cell after the tanh. + * @param csGrad The current gradient of cs. + * @param hGrad The gradient of h vector. + * @param usePeephole Whether the cell uses peephole connections. + * @param data type for {@code LSTMBlockCellGrad} output and operands + * @return a new instance of LSTMBlockCellGrad + */ + public LSTMBlockCellGrad lSTMBlockCellGrad(Operand x, Operand csPrev, + Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, + Operand i, Operand cs, Operand f, Operand o, Operand ci, Operand co, + Operand csGrad, Operand hGrad, Boolean usePeephole) { + return LSTMBlockCellGrad.create(scope, x, csPrev, hPrev, w, wci, wcf, wco, b, i, cs, f, o, ci, co, csGrad, hGrad, usePeephole); + } + /** * Computes rectified linear: {@code max(features, features * alpha)}. * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param options carries optional attribute values * @param data type for {@code LeakyRelu} output and operands * @return a new instance of LeakyRelu @@ -1304,7 +1905,6 @@ public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(OperandFor details, see Krizhevsky et al., ImageNet classification with deep * convolutional neural networks (NIPS 2012) . * - * @param data type for {@code output} output * @param input 4-D. * @param options carries optional attribute values * @param data type for {@code LRN} output and operands @@ -1315,6 +1915,22 @@ public LocalResponseNormalization localResponseNormalizat return LocalResponseNormalization.create(scope, input, options); } + /** + * Gradients for Local Response Normalization. + * + * @param inputGrads 4-D with shape {@code [batch, height, width, channels]}. + * @param inputImage 4-D with shape {@code [batch, height, width, channels]}. + * @param outputImage 4-D with shape {@code [batch, height, width, channels]}. + * @param options carries optional attribute values + * @param data type for {@code LRNGrad} output and operands + * @return a new instance of LocalResponseNormalizationGrad + */ + public LocalResponseNormalizationGrad localResponseNormalizationGrad( + Operand inputGrads, Operand inputImage, Operand outputImage, + LocalResponseNormalizationGrad.Options... options) { + return LocalResponseNormalizationGrad.create(scope, inputGrads, inputImage, outputImage, options); + } + /** * Computes log softmax activations. * For each batch {@code i} and class {@code j} we have @@ -1322,7 +1938,6 @@ public LocalResponseNormalization localResponseNormalizat * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) * * - * @param data type for {@code logsoftmax} output * @param logits 2-D with shape {@code [batch_size, num_classes]}. * @param data type for {@code LogSoftmax} output and operands * @return a new instance of LogSoftmax @@ -1334,7 +1949,6 @@ public LogSoftmax logSoftmax(Operand logits) { /** * Performs max pooling on the input. * - * @param data type for {@code output} output * @param input 4-D input to pool over. * @param ksize The size of the window for each dimension of the input tensor. * @param strides The stride of the sliding window for each dimension of the @@ -1352,7 +1966,6 @@ public MaxPool maxPool(Operand input, Operand /** * Performs 3D max pooling on the input. * - * @param data type for {@code output} output * @param input Shape {@code [batch, depth, rows, cols, channels]} tensor to pool over. * @param ksize 1-D tensor of length 5. The size of the window for each dimension of * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. @@ -1371,7 +1984,6 @@ public MaxPool3d maxPool3d(Operand input, List k /** * Computes gradients of 3D max pooling function. * - * @param data type for {@code output} output * @param origInput The original input tensor. * @param origOutput The original output tensor. * @param grad Output backprop of shape {@code [batch, depth, rows, cols, channels]}. @@ -1394,7 +2006,6 @@ public MaxPool3dGrad maxPool3dGrad(Ope /** * Computes second-order gradients of the maxpooling function. * - * @param data type for {@code output} output * @param origInput The original input tensor. * @param origOutput The original output tensor. * @param grad Output backprop of shape {@code [batch, depth, rows, cols, channels]}. @@ -1416,7 +2027,6 @@ public MaxPool3dGradGrad maxPool3dGradGrad(Operand ori /** * Computes gradients of the maxpooling function. * - * @param data type for {@code output} output * @param origInput The original input tensor. * @param origOutput The original output tensor. * @param grad 4-D. Gradients w.r.t. the output of {@code max_pool}. @@ -1437,7 +2047,6 @@ public MaxPoolGrad maxPoolGrad(Operand origInput, Oper /** * Computes second-order gradients of the maxpooling function. * - * @param data type for {@code output} output * @param origInput The original input tensor. * @param origOutput The original output tensor. * @param grad 4-D. Gradients of gradients w.r.t. the input of {@code max_pool}. @@ -1458,7 +2067,6 @@ public MaxPoolGradGrad maxPoolGradGrad(Operand origInp /** * Computes second-order gradients of the maxpooling function. * - * @param data type for {@code output} output * @param input The original input. * @param grad 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the * input of {@code max_pool}. @@ -1477,6 +2085,27 @@ public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgma return MaxPoolGradGradWithArgmax.create(scope, input, grad, argmax, ksize, strides, padding, options); } + /** + * Computes gradients of the maxpooling function. + * + * @param input The original input. + * @param grad 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the + * output of {@code max_pool}. + * @param argmax The indices of the maximum values chosen for each output of {@code max_pool}. + * @param ksize The size of the window for each dimension of the input tensor. + * @param strides The stride of the sliding window for each dimension of the + * input tensor. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradWithArgmax} output and operands + * @return a new instance of MaxPoolGradWithArgmax + */ + public MaxPoolGradWithArgmax maxPoolGradWithArgmax(Operand input, + Operand grad, Operand argmax, List ksize, List strides, + String padding, MaxPoolGradWithArgmax.Options... options) { + return MaxPoolGradWithArgmax.create(scope, input, grad, argmax, ksize, strides, padding, options); + } + /** * Performs max pooling on the input and outputs both max values and indices. * The indices in {@code argmax} are flattened, so that a maximum value at position @@ -1488,8 +2117,6 @@ public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgma * (either negative or too large). This is a bug, but fixing it is difficult to do * in a safe backwards compatible way, especially due to flattening. * - * @param data type for {@code output} output - * @param data type for {@code argmax} output * @param input 4-D with shape {@code [batch, height, width, channels]}. Input to pool over. * @param ksize The size of the window for each dimension of the input tensor. * @param strides The stride of the sliding window for each dimension of the @@ -1500,7 +2127,7 @@ public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgma * @return a new instance of MaxPoolWithArgmax, with default output types */ public MaxPoolWithArgmax maxPoolWithArgmax(Operand input, - List ksize, List strides, String padding, MaxPoolWithArgmax.Options[] options) { + List ksize, List strides, String padding, MaxPoolWithArgmax.Options... options) { return MaxPoolWithArgmax.create(scope, input, ksize, strides, padding, options); } @@ -1515,13 +2142,11 @@ public MaxPoolWithArgmax maxPoolWithArgmax(Operan * (either negative or too large). This is a bug, but fixing it is difficult to do * in a safe backwards compatible way, especially due to flattening. * - * @param data type for {@code output} output - * @param data type for {@code argmax} output * @param input 4-D with shape {@code [batch, height, width, channels]}. Input to pool over. * @param ksize The size of the window for each dimension of the input tensor. * @param strides The stride of the sliding window for each dimension of the * input tensor. - * @param Targmax the value of the Targmax property + * @param Targmax The value of the Targmax attribute * @param padding The type of padding algorithm to use. * @param options carries optional attribute values * @param data type for {@code MaxPoolWithArgmax} output and operands @@ -1544,7 +2169,6 @@ public MaxPoolWithArgmax maxPoolWit * values.shape = input.shape[:-1] * * - * @param data type for {@code values} output * @param input 1-D or higher with last dimension at least {@code n+1}. * @param n 0-D. Position of sorted vector to select along the last dimension (along * each row for matrices). Valid range of n is {@code [0, input.shape[:-1])} @@ -1560,7 +2184,6 @@ public NthElement nthElement(Operand input, Operand data type for {@code output} output * @param input 4-D with shape {@code [batch, height, width, channels]}. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. @@ -1583,7 +2206,6 @@ public QuantizedAvgPool quantizedAvgPool(Operand input * This op is deprecated and will be removed in the future. Prefer * {@code tf.nn.batch_normalization}. * - * @param data type for {@code result} output * @param t A 4D input Tensor. * @param tMin The value represented by the lowest quantized input. * @param tMax The value represented by the highest quantized input. @@ -1606,7 +2228,7 @@ public QuantizedAvgPool quantizedAvgPool(Operand input * with the normalized tensor. * @param gammaMin The value represented by the lowest quantized gamma. * @param gammaMax The value represented by the highest quantized gamma. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param varianceEpsilon A small float number to avoid dividing by 0. * @param scaleAfterNormalization A bool indicating whether the resulted tensor * needs to be multiplied with gamma. @@ -1627,14 +2249,13 @@ public QuantizedBatchNormWithGlobalNormal * Adds Tensor 'bias' to Tensor 'input' for Quantized types. * Broadcasts the values of bias on dimensions 0..N-2 of 'input'. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param bias A 1D bias Tensor with size matching the last dimension of 'input'. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. * @param minBias The float value that the lowest quantized bias value represents. * @param maxBias The float value that the highest quantized bias value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedBiasAdd} output and operands * @return a new instance of QuantizedBiasAdd */ @@ -1644,6 +2265,306 @@ public QuantizedBiasAdd quantizedBiasAdd(Operand data type for {@code QuantizedConv2DAndRelu} output and operands + * @return a new instance of QuantizedConv2DAndRelu + */ + public QuantizedConv2DAndRelu quantizedConv2DAndRelu( + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedConv2DAndRelu.Options... options) { + return QuantizedConv2DAndRelu.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DAndReluAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DAndReluAndRequantize} output and operands + * @return a new instance of QuantizedConv2DAndReluAndRequantize + */ + public QuantizedConv2DAndReluAndRequantize quantizedConv2DAndReluAndRequantize( + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + QuantizedConv2DAndReluAndRequantize.Options... options) { + return QuantizedConv2DAndReluAndRequantize.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DAndRequantize} output and operands + * @return a new instance of QuantizedConv2DAndRequantize + */ + public QuantizedConv2DAndRequantize quantizedConv2DAndRequantize( + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + QuantizedConv2DAndRequantize.Options... options) { + return QuantizedConv2DAndRequantize.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, outType, strides, padding, options); + } + + /** + * Computes QuantizedConv2D per channel. + * + * @param input The original input tensor. + * @param filter The original filter tensor. + * @param minInput The minimum value of the input tensor + * @param maxInput The maximum value of the input tensor. + * @param minFilter The minimum value of the filter tensor. + * @param maxFilter The maximum value of the filter tensor. + * @param outType The quantized type of output tensor that needs to be converted. + * @param strides list of stride values. + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DPerChannel} output and operands + * @return a new instance of QuantizedConv2DPerChannel + */ + public QuantizedConv2DPerChannel quantizedConv2DPerChannel( + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedConv2DPerChannel.Options... options) { + return QuantizedConv2DPerChannel.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBias operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBias} output and operands + * @return a new instance of QuantizedConv2DWithBias + */ + public QuantizedConv2DWithBias quantizedConv2DWithBias( + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedConv2DWithBias.Options... options) { + return QuantizedConv2DWithBias.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasAndRelu operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndRelu} output and operands + * @return a new instance of QuantizedConv2DWithBiasAndRelu + */ + public QuantizedConv2DWithBiasAndRelu quantizedConv2DWithBiasAndRelu( + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedConv2DWithBiasAndRelu.Options... options) { + return QuantizedConv2DWithBiasAndRelu.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasAndReluAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndReluAndRequantize} output and operands + * @return a new instance of QuantizedConv2DWithBiasAndReluAndRequantize + */ + public QuantizedConv2DWithBiasAndReluAndRequantize quantizedConv2DWithBiasAndReluAndRequantize( + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + QuantizedConv2DWithBiasAndReluAndRequantize.Options... options) { + return QuantizedConv2DWithBiasAndReluAndRequantize.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndRequantize} output and operands + * @return a new instance of QuantizedConv2DWithBiasAndRequantize + */ + public QuantizedConv2DWithBiasAndRequantize quantizedConv2DWithBiasAndRequantize( + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + QuantizedConv2DWithBiasAndRequantize.Options... options) { + return QuantizedConv2DWithBiasAndRequantize.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param summand The summand value + * @param minSummand The minSummand value + * @param maxSummand The maxSummand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} output and operands + * @return a new instance of QuantizedConv2DWithBiasSignedSumAndReluAndRequantize + */ + public QuantizedConv2DWithBiasSignedSumAndReluAndRequantize quantizedConv2DWithBiasSignedSumAndReluAndRequantize( + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Operand summand, + Operand minSummand, Operand maxSummand, Class outType, + List strides, String padding, + QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.Options... options) { + return QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, summand, minSummand, maxSummand, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasSumAndRelu operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param summand The summand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSumAndRelu} output and operands + * @return a new instance of QuantizedConv2DWithBiasSumAndRelu + */ + public QuantizedConv2DWithBiasSumAndRelu quantizedConv2DWithBiasSumAndRelu( + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand summand, Class outType, List strides, + String padding, QuantizedConv2DWithBiasSumAndRelu.Options... options) { + return QuantizedConv2DWithBiasSumAndRelu.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, summand, outType, strides, padding, options); + } + + /** + * The QuantizedConv2DWithBiasSumAndReluAndRequantize operation + * + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param summand The summand value + * @param minSummand The minSummand value + * @param maxSummand The maxSummand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSumAndReluAndRequantize} output and operands + * @return a new instance of QuantizedConv2DWithBiasSumAndReluAndRequantize + */ + public QuantizedConv2DWithBiasSumAndReluAndRequantize quantizedConv2DWithBiasSumAndReluAndRequantize( + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Operand summand, + Operand minSummand, Operand maxSummand, Class outType, + List strides, String padding, + QuantizedConv2DWithBiasSumAndReluAndRequantize.Options... options) { + return QuantizedConv2DWithBiasSumAndReluAndRequantize.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, summand, minSummand, maxSummand, outType, strides, padding, options); + } + /** * Computes a 2D convolution given quantized 4D input and filter tensors. * The inputs are quantized tensors where the lowest value represents the real @@ -1651,14 +2572,13 @@ public QuantizedBiasAdd quantizedBiasAdd(Operand data type for {@code output} output - * @param input the input value + * @param input The input value * @param filter filter's input_depth dimension must match input's depth dimensions. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. * @param minFilter The float value that the lowest quantized filter value represents. * @param maxFilter The float value that the highest quantized filter value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param strides The stride of the sliding window for each dimension of the input * tensor. * @param padding The type of padding algorithm to use. @@ -1673,10 +2593,111 @@ public QuantizedConv2d quantizedConv2d(Operand data type for {@code QuantizedDepthwiseConv2D} output and operands + * @return a new instance of QuantizedDepthwiseConv2D + */ + public QuantizedDepthwiseConv2D quantizedDepthwiseConv2D( + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedDepthwiseConv2D.Options... options) { + return QuantizedDepthwiseConv2D.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * Computes quantized depthwise Conv2D with Bias. + * + * @param input The original input tensor. + * @param filter The original filter tensor. + * @param bias The original bias tensor. + * @param minInput The float value that the minimum quantized input value represents. + * @param maxInput The float value that the maximum quantized input value represents. + * @param minFilter The float value that the minimum quantized filter value represents. + * @param maxFilter The float value that the maximum quantized filter value represents. + * @param outType The type of the output. + * @param strides List of stride values. + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBias} output and operands + * @return a new instance of QuantizedDepthwiseConv2DWithBias + */ + public QuantizedDepthwiseConv2DWithBias quantizedDepthwiseConv2DWithBias( + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedDepthwiseConv2DWithBias.Options... options) { + return QuantizedDepthwiseConv2DWithBias.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * Computes quantized depthwise Conv2D with Bias and Relu. + * + * @param input The original input tensor. + * @param filter The original filter tensor. + * @param bias The original bias tensor. + * @param minInput The float value that the minimum quantized input value represents. + * @param maxInput The float value that the maximum quantized input value represents. + * @param minFilter The float value that the minimum quantized filter value represents. + * @param maxFilter The float value that the maximum quantized filter value represents. + * @param outType The type of the output. + * @param strides List of stride values. + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndRelu} output and operands + * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndRelu + */ + public QuantizedDepthwiseConv2DWithBiasAndRelu quantizedDepthwiseConv2DWithBiasAndRelu( + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + QuantizedDepthwiseConv2DWithBiasAndRelu.Options... options) { + return QuantizedDepthwiseConv2DWithBiasAndRelu.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + } + + /** + * Computes quantized depthwise Conv2D with Bias, Relu and Requantize. + * + * @param input The original input tensor. + * @param filter The original filter tensor. + * @param bias The original bias tensor. + * @param minInput The float value that the minimum quantized input value represents. + * @param maxInput The float value that the maximum quantized input value represents. + * @param minFilter The float value that the minimum quantized filter value represents. + * @param maxFilter The float value that the maximum quantized filter value represents. + * @param minFreezedOutput The minimum float value of the output tensor. + * @param maxFreezedOutput The maximum float value of the output tensor. + * @param outType The type of the output. + * @param strides List of stride values. + * @param padding The value of the padding attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} output and operands + * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize + */ + public QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize quantizedDepthwiseConv2DWithBiasAndReluAndRequantize( + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.Options... options) { + return QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.create(scope, input, filter, bias, minInput, maxInput, minFilter, maxFilter, minFreezedOutput, maxFreezedOutput, outType, strides, padding, options); + } + /** * Quantized Instance normalization. * - * @param data type for {@code y} output * @param x A 4D input Tensor. * @param xMin The value represented by the lowest quantized input. * @param xMax The value represented by the highest quantized input. @@ -1692,7 +2713,6 @@ public QuantizedInstanceNorm quantizedInstanceNorm(Operan /** * Produces the max pool of the input tensor for quantized types. * - * @param data type for {@code output} output * @param input The 4D (batch x rows x cols x depth) Tensor to MaxReduce over. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. @@ -1713,11 +2733,10 @@ public QuantizedMaxPool quantizedMaxPool(Operand input /** * Computes Quantized Rectified Linear: {@code max(features, 0)} * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedRelu} output and operands * @return a new instance of QuantizedRelu */ @@ -1729,11 +2748,10 @@ public QuantizedRelu quantizedRelu(Operand data type for {@code activations} output - * @param features the features value + * @param features The features value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedRelu6} output and operands * @return a new instance of QuantizedRelu6 */ @@ -1745,12 +2763,11 @@ public QuantizedRelu6 quantizedRelu6(Operand data type for {@code activations} output - * @param features the features value - * @param maxValue the maxValue value + * @param features The features value + * @param maxValue The maxValue value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedReluX} output and operands * @return a new instance of QuantizedReluX */ @@ -1773,8 +2790,7 @@ public QuantizedReluX quantizedReluX(Operand * * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Relu} output and operands * @return a new instance of Relu */ @@ -1785,8 +2801,7 @@ public Relu relu(Operand features) { /** * Computes rectified linear 6: {@code min(max(features, 0), 6)}. * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Relu6} output and operands * @return a new instance of Relu6 */ @@ -1794,6 +2809,32 @@ public Relu6 relu6(Operand features) { return Relu6.create(scope, features); } + /** + * Computes rectified linear 6 gradients for a Relu6 operation. + * + * @param gradients The backpropagated gradients to the corresponding Relu6 operation. + * @param features The features passed as input to the corresponding Relu6 operation, or + * its output; using either one produces the same result. + * @param data type for {@code Relu6Grad} output and operands + * @return a new instance of Relu6Grad + */ + public Relu6Grad relu6Grad(Operand gradients, Operand features) { + return Relu6Grad.create(scope, gradients, features); + } + + /** + * Computes rectified linear gradients for a Relu operation. + * + * @param gradients The backpropagated gradients to the corresponding Relu operation. + * @param features The features passed as input to the corresponding Relu operation, OR + * the outputs of that operation (both work equivalently). + * @param data type for {@code ReluGrad} output and operands + * @return a new instance of ReluGrad + */ + public ReluGrad reluGrad(Operand gradients, Operand features) { + return ReluGrad.create(scope, gradients, features); + } + /** * Computes scaled exponential linear: {@code scale * alpha * (exp(features) - 1)} * if < 0, {@code scale * features} otherwise. @@ -1802,8 +2843,7 @@ public Relu6 relu6(Operand features) { * For correct dropout, use {@code tf.contrib.nn.alpha_dropout}. *

      See Self-Normalizing Neural Networks * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Selu} output and operands * @return a new instance of Selu */ @@ -1811,6 +2851,18 @@ public Selu selu(Operand features) { return Selu.create(scope, features); } + /** + * Computes gradients for the scaled exponential linear (Selu) operation. + * + * @param gradients The backpropagated gradients to the corresponding Selu operation. + * @param outputs The outputs of the corresponding Selu operation. + * @param data type for {@code SeluGrad} output and operands + * @return a new instance of SeluGrad + */ + public SeluGrad seluGrad(Operand gradients, Operand outputs) { + return SeluGrad.create(scope, gradients, outputs); + } + /** * Computes softmax activations. * For each batch {@code i} and class {@code j} we have @@ -1818,7 +2870,6 @@ public Selu selu(Operand features) { * $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$ * * - * @param data type for {@code softmax} output * @param logits 2-D with shape {@code [batch_size, num_classes]}. * @param data type for {@code Softmax} output and operands * @return a new instance of Softmax @@ -1831,7 +2882,6 @@ public Softmax softmax(Operand logits) { * Computes softmax cross entropy cost and gradients to backpropagate. * Inputs are the logits, not probabilities. * - * @param data type for {@code loss} output * @param features batch_size x num_classes matrix * @param labels batch_size x num_classes matrix * The caller must ensure that each batch of labels represents a valid @@ -1847,8 +2897,7 @@ public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyW /** * Computes softsign: {@code features / (abs(features) + 1)}. * - * @param data type for {@code activations} output - * @param features the features value + * @param features The features value * @param data type for {@code Softsign} output and operands * @return a new instance of Softsign */ @@ -1856,6 +2905,19 @@ public Softsign softsign(Operand features) { return Softsign.create(scope, features); } + /** + * Computes softsign gradients for a softsign operation. + * + * @param gradients The backpropagated gradients to the corresponding softsign operation. + * @param features The features passed as input to the corresponding softsign operation. + * @param data type for {@code SoftsignGrad} output and operands + * @return a new instance of SoftsignGrad + */ + public SoftsignGrad softsignGrad(Operand gradients, + Operand features) { + return SoftsignGrad.create(scope, gradients, features); + } + /** * SpaceToBatch for 4-D tensors of type T. * This is a legacy version of the more general SpaceToBatchND. @@ -1923,7 +2985,6 @@ public Softsign softsign(Operand features) { *

      Among others, this operation is useful for reducing atrous convolution into * regular convolution. * - * @param data type for {@code output} output * @param input 4-D with shape {@code [batch, height, width, depth]}. * @param paddings 2-D tensor of non-negative integers with shape {@code [2, 2]}. It specifies * the padding of the input with zeros across the spatial dimensions as follows: @@ -1935,7 +2996,7 @@ public Softsign softsign(Operand features) { * height_pad = pad_top + height + pad_bottom * width_pad = pad_left + width + pad_right * - * @param blockSize the value of the blockSize property + * @param blockSize The value of the blockSize attribute * @param data type for {@code SpaceToBatch} output and operands * @return a new instance of SpaceToBatch */ @@ -2015,8 +3076,7 @@ public SpaceToBatch spaceToBatch(Operand input, * [13, 14, 15, 16]]]] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param blockSize The size of the spatial block. * @param options carries optional attribute values * @param data type for {@code SpaceToDepth} output and operands @@ -2035,7 +3095,6 @@ public SpaceToDepth spaceToDepth(Operand input, Long blo * given row. *

      Inputs are the logits, not probabilities. * - * @param data type for {@code loss} output * @param features batch_size x num_classes matrix * @param labels batch_size vector with values in [0, num_classes). * This is the label for the given minibatch entry. @@ -2059,19 +3118,157 @@ public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxC * *

      If two elements are equal, the lower-index element appears first. * - * @param data type for {@code values} output * @param input 1-D or higher with last dimension at least {@code k}. * @param k 0-D. Number of top elements to look for along the last dimension (along each * row for matrices). * @param options carries optional attribute values * @param data type for {@code TopKV2} output and operands - * @return a new instance of TopK + * @return a new instance of TopK, with default output types */ - public TopK topK(Operand input, Operand k, + public TopK topK(Operand input, Operand k, TopK.Options... options) { return TopK.create(scope, input, k, options); } + /** + * Finds values and indices of the {@code k} largest elements for the last dimension. + * If the input is a vector (rank-1), finds the {@code k} largest entries in the vector + * and outputs their values and indices as vectors. Thus {@code values[j]} is the + * {@code j}-th largest entry in {@code input}, and its index is {@code indices[j]}. + *

      For matrices (resp. higher rank input), computes the top {@code k} entries in each + * row (resp. vector along the last dimension). Thus, + *

      +   *  values.shape = indices.shape = input.shape[:-1] + [k]
      +   *  
      + *

      If two elements are equal, the lower-index element appears first. + * + * @param input 1-D or higher with last dimension at least {@code k}. + * @param k 0-D. Number of top elements to look for along the last dimension (along each + * row for matrices). + * @param indexType The value of the indexType attribute + * @param options carries optional attribute values + * @param data type for {@code TopKV2} output and operands + * @param data type for {@code TopKV2} output and operands + * @return a new instance of TopK + */ + public TopK topK(Operand input, + Operand k, Class indexType, TopK.Options... options) { + return TopK.create(scope, input, k, indexType, options); + } + + /** + * Perform quantized convolution of quantized Tensor {@code lhs} and quantized Tensor {@code rhs}. to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized dot on {@code lhs} and {@code rhs} to make quantized {@code output}. + *

      {@code lhs} and {@code rhs} must be Tensors of same rank, and meet following shape conditions. + *

        + *
      • {@code lhs_feature} % {@code feature_group_count} == 0
      • + *
      • {@code lhs_feature} % {@code rhs_input_feature} == 0
      • + *
      • {@code lhs_feature} / {@code feature_group_count} == {@code rhs_input_feature}
      • + *
      • {@code rhs_output_feature} % {@code feature_group_count} == 0
      • + *
      • {@code lhs_batch} % {@code batch_group_count} == 0
      • + *
      • {@code rhs_output_feature} % {@code batch_group_count} == 0
      • + *
      + *

      {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + *

      +   *  quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)
      +   *  
      + *

      {@code output} is also quantized, using the same formula. + * If {@code rhs} is per-tensor quantized, {@code output} must be also per-tensor quantized. + * + * @param lhs Must be a quantized tensor, rank >= 3. + * @param rhs Must be a quantized tensor, same rank as {@code lhs}. + * @param lhsScales The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + * Must be a scalar {@code Tensor} ({@code lhs} supports only per-tensor quantization). + * @param lhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Same shape condition as {@code lhs_scales}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + * @param rhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + * @param outputScales The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)} + *

        + *
      • which is equal to {@code output.dim_size(output_feature_dimension)}, + * for per-channel quantization. + * If {@code rhs} is per-tensor quantized, output must be also per-tensor quantized. + * This means that if {@code rhs_scales} and {@code rhs_zero_points} are scalar {@code Tensor}s, {@code output_scales} and {@code output_zero_points} must be scalar {@code Tensor}s as well.
      • + *
      + * @param outputZeroPoints The int32 value(s) used as zero points when quantizing original data that output represents. + * Same shape condition as {@code output_scales}. + * @param Tout The type of {@code output} {@code Tensor}. + * @param padding string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + * @param lhsQuantizationMinVal The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedConvolution} output and operands + * @param data type for {@code UniformQuantizedConvolution} output and operands + * @return a new instance of UniformQuantizedConvolution + */ + public UniformQuantizedConvolution uniformQuantizedConvolution( + Operand lhs, Operand rhs, Operand lhsScales, Operand lhsZeroPoints, + Operand rhsScales, Operand rhsZeroPoints, Operand outputScales, + Operand outputZeroPoints, Class Tout, String padding, Long lhsQuantizationMinVal, + Long lhsQuantizationMaxVal, Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, + Long outputQuantizationMinVal, Long outputQuantizationMaxVal, + UniformQuantizedConvolution.Options... options) { + return UniformQuantizedConvolution.create(scope, lhs, rhs, lhsScales, lhsZeroPoints, rhsScales, rhsZeroPoints, outputScales, outputZeroPoints, Tout, padding, lhsQuantizationMinVal, lhsQuantizationMaxVal, rhsQuantizationMinVal, rhsQuantizationMaxVal, outputQuantizationMinVal, outputQuantizationMaxVal, options); + } + + /** + * Perform hybrid quantized convolution of float Tensor {@code lhs} and quantized Tensor {@code rhs}. + * Given float {@code lhs} and quantized {@code rhs}, internally performs quantization on {@code lhs}, + * and then performs quantized convolution on quantized {@code lhs} and {@code rhs}. + *

      The internal quantization on {@code lhs} is a quantization to {@code Trhs}, dynamic range, + * per-batch (per-axis along axis {@code dimension_numbers.input_batch_dimension}), asymmetric, + * and not narrow range (the range is [Trhs_MIN, Trhs_MAX]). + *

      {@code lhs} and {@code rhs} must be Tensors of same rank, and meet following shape conditions. + *

        + *
      • lhs_feature % feature_group_count == 0
      • + *
      • lhs_feature % rhs_input_feature == 0
      • + *
      • lhs_feature / feature_group_count == rhs_input_feature
      • + *
      • rhs_output_feature % feature_group_count == 0
      • + *
      • lhs_batch % batch_group_count == 0
      • + *
      • rhs_output_feature % batch_group_count == 0
      • + *
      + *

      {@code rhs} must be quantized Tensor, where its data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + * + * @param lhs Must be a non-quantized Tensor of {@code Tlhs}, rank >= 3. + * @param rhs Must be a quantized Tensor of {@code Trhs}, same rank as {@code lhs}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar Tensor for per-tensor quantization, + * or 1D Tensor of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + * @param Tout The type of output Tensor. + * @param padding string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedConvolutionHybrid} output and operands + * @return a new instance of UniformQuantizedConvolutionHybrid + */ + public UniformQuantizedConvolutionHybrid uniformQuantizedConvolutionHybrid( + Operand lhs, Operand rhs, Operand rhsScales, + Operand rhsZeroPoints, Class Tout, String padding, Long rhsQuantizationMinVal, + Long rhsQuantizationMaxVal, UniformQuantizedConvolutionHybrid.Options... options) { + return UniformQuantizedConvolutionHybrid.create(scope, lhs, rhs, rhsScales, rhsZeroPoints, Tout, padding, rhsQuantizationMinVal, rhsQuantizationMaxVal, options); + } + /** * Get the parent {@link Ops} object. */ 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 74f7efb4623..8483a4efb61 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -18,6 +18,7 @@ package org.tensorflow.op; import java.nio.charset.Charset; +import java.util.Arrays; import java.util.List; import java.util.Map; import org.tensorflow.ConcreteFunction; @@ -25,6 +26,8 @@ import org.tensorflow.EagerSession; import org.tensorflow.ExecutionEnvironment; import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.Tensor; import org.tensorflow.ndarray.BooleanNdArray; import org.tensorflow.ndarray.ByteNdArray; import org.tensorflow.ndarray.DoubleNdArray; @@ -43,7 +46,12 @@ import org.tensorflow.ndarray.index.Index; import org.tensorflow.op.core.Abort; import org.tensorflow.op.core.All; +import org.tensorflow.op.core.AnonymousHashTable; +import org.tensorflow.op.core.AnonymousMutableDenseHashTable; +import org.tensorflow.op.core.AnonymousMutableHashTable; +import org.tensorflow.op.core.AnonymousMutableHashTableOfTensors; import org.tensorflow.op.core.Any; +import org.tensorflow.op.core.ApproxTopK; import org.tensorflow.op.core.AssertThat; import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.AssignAdd; @@ -65,20 +73,29 @@ import org.tensorflow.op.core.BooleanMask; import org.tensorflow.op.core.BooleanMaskUpdate; import org.tensorflow.op.core.BroadcastDynamicShape; +import org.tensorflow.op.core.BroadcastGradientArgs; import org.tensorflow.op.core.BroadcastTo; import org.tensorflow.op.core.Bucketize; import org.tensorflow.op.core.Case; +import org.tensorflow.op.core.CheckPinned; import org.tensorflow.op.core.ClipByValue; +import org.tensorflow.op.core.CompositeTensorVariantFromComponents; +import org.tensorflow.op.core.CompositeTensorVariantToComponents; import org.tensorflow.op.core.Concat; +import org.tensorflow.op.core.ConcatOffset; import org.tensorflow.op.core.Constant; import org.tensorflow.op.core.ConsumeMutexLock; import org.tensorflow.op.core.ControlTrigger; +import org.tensorflow.op.core.CopyToMesh; +import org.tensorflow.op.core.CopyToMeshGrad; 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; import org.tensorflow.op.core.DestroyTemporaryVariable; +import org.tensorflow.op.core.DeviceIndex; +import org.tensorflow.op.core.DummyMemoryCache; import org.tensorflow.op.core.DynamicPartition; import org.tensorflow.op.core.DynamicStitch; import org.tensorflow.op.core.EditDistance; @@ -87,14 +104,20 @@ import org.tensorflow.op.core.EmptyTensorMap; import org.tensorflow.op.core.EncodeProto; import org.tensorflow.op.core.EnsureShape; +import org.tensorflow.op.core.Enter; +import org.tensorflow.op.core.Exit; import org.tensorflow.op.core.ExpandDims; import org.tensorflow.op.core.ExtractVolumePatches; +import org.tensorflow.op.core.FakeParam; +import org.tensorflow.op.core.FileSystemSetConfiguration; import org.tensorflow.op.core.Fill; import org.tensorflow.op.core.Fingerprint; import org.tensorflow.op.core.For; import org.tensorflow.op.core.Function; import org.tensorflow.op.core.Gather; import org.tensorflow.op.core.GatherNd; +import org.tensorflow.op.core.GetElementAtIndex; +import org.tensorflow.op.core.GetOptions; import org.tensorflow.op.core.GetSessionHandle; import org.tensorflow.op.core.GetSessionTensor; import org.tensorflow.op.core.Gradients; @@ -102,6 +125,7 @@ import org.tensorflow.op.core.HashTable; import org.tensorflow.op.core.Helpers; import org.tensorflow.op.core.HistogramFixedWidth; +import org.tensorflow.op.core.HostConst; import org.tensorflow.op.core.Identity; import org.tensorflow.op.core.IdentityN; import org.tensorflow.op.core.If; @@ -113,14 +137,18 @@ import org.tensorflow.op.core.InplaceUpdate; import org.tensorflow.op.core.IsVariableInitialized; import org.tensorflow.op.core.KthOrderStatistic; +import org.tensorflow.op.core.LinSpace; 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.LookupTableRemove; import org.tensorflow.op.core.LookupTableSize; import org.tensorflow.op.core.LoopCond; +import org.tensorflow.op.core.LowerBound; import org.tensorflow.op.core.MakeUnique; import org.tensorflow.op.core.MapClear; +import org.tensorflow.op.core.MapDefun; import org.tensorflow.op.core.MapIncompleteSize; import org.tensorflow.op.core.MapPeek; import org.tensorflow.op.core.MapSize; @@ -131,12 +159,16 @@ import org.tensorflow.op.core.Merge; import org.tensorflow.op.core.Min; import org.tensorflow.op.core.MirrorPad; +import org.tensorflow.op.core.MirrorPadGrad; import org.tensorflow.op.core.MlirPassthroughOp; import org.tensorflow.op.core.MutableDenseHashTable; import org.tensorflow.op.core.MutableHashTable; import org.tensorflow.op.core.MutableHashTableOfTensors; import org.tensorflow.op.core.Mutex; import org.tensorflow.op.core.MutexLock; +import org.tensorflow.op.core.NcclAllReduce; +import org.tensorflow.op.core.NcclBroadcast; +import org.tensorflow.op.core.NcclReduce; import org.tensorflow.op.core.NextIteration; import org.tensorflow.op.core.NoOp; import org.tensorflow.op.core.OneHot; @@ -158,18 +190,26 @@ import org.tensorflow.op.core.Print; import org.tensorflow.op.core.Prod; import org.tensorflow.op.core.QuantizedReshape; +import org.tensorflow.op.core.RandomIndexShuffle; import org.tensorflow.op.core.Range; import org.tensorflow.op.core.Rank; import org.tensorflow.op.core.ReadVariableOp; +import org.tensorflow.op.core.Recv; import org.tensorflow.op.core.ReduceAll; import org.tensorflow.op.core.ReduceAny; import org.tensorflow.op.core.ReduceMax; import org.tensorflow.op.core.ReduceMin; import org.tensorflow.op.core.ReduceProd; import org.tensorflow.op.core.ReduceSum; +import org.tensorflow.op.core.RefEnter; +import org.tensorflow.op.core.RefExit; +import org.tensorflow.op.core.RefIdentity; +import org.tensorflow.op.core.RefMerge; import org.tensorflow.op.core.RefNextIteration; import org.tensorflow.op.core.RefSelect; import org.tensorflow.op.core.RefSwitch; +import org.tensorflow.op.core.Relayout; +import org.tensorflow.op.core.RelayoutLike; import org.tensorflow.op.core.RemoteCall; import org.tensorflow.op.core.Reshape; import org.tensorflow.op.core.ResourceCountUpTo; @@ -198,12 +238,15 @@ import org.tensorflow.op.core.ScatterMul; import org.tensorflow.op.core.ScatterNd; import org.tensorflow.op.core.ScatterNdAdd; +import org.tensorflow.op.core.ScatterNdMax; +import org.tensorflow.op.core.ScatterNdMin; import org.tensorflow.op.core.ScatterNdNonAliasingAdd; import org.tensorflow.op.core.ScatterNdSub; import org.tensorflow.op.core.ScatterNdUpdate; import org.tensorflow.op.core.ScatterSub; import org.tensorflow.op.core.ScatterUpdate; import org.tensorflow.op.core.Select; +import org.tensorflow.op.core.Send; import org.tensorflow.op.core.SetDiff1d; import org.tensorflow.op.core.SetSize; import org.tensorflow.op.core.ShapeN; @@ -216,6 +259,10 @@ import org.tensorflow.op.core.SplitV; import org.tensorflow.op.core.Squeeze; import org.tensorflow.op.core.Stack; +import org.tensorflow.op.core.StackClose; +import org.tensorflow.op.core.StackCreate; +import org.tensorflow.op.core.StackPop; +import org.tensorflow.op.core.StackPush; import org.tensorflow.op.core.Stage; import org.tensorflow.op.core.StageClear; import org.tensorflow.op.core.StagePeek; @@ -224,9 +271,10 @@ import org.tensorflow.op.core.StatefulIf; import org.tensorflow.op.core.StatefulPartitionedCall; import org.tensorflow.op.core.StatefulWhile; +import org.tensorflow.op.core.StatelessCase; import org.tensorflow.op.core.StatelessIf; -import org.tensorflow.op.core.StatelessPartitionedCall; import org.tensorflow.op.core.StatelessWhile; +import org.tensorflow.op.core.StochasticCastToInt; import org.tensorflow.op.core.StopGradient; import org.tensorflow.op.core.StridedSlice; import org.tensorflow.op.core.StridedSliceAssign; @@ -234,6 +282,7 @@ import org.tensorflow.op.core.StridedSliceHelper; import org.tensorflow.op.core.Sum; import org.tensorflow.op.core.SwitchCond; +import org.tensorflow.op.core.SyncDevice; import org.tensorflow.op.core.TemporaryVariable; import org.tensorflow.op.core.TensorArray; import org.tensorflow.op.core.TensorArrayClose; @@ -283,11 +332,13 @@ import org.tensorflow.op.core.TopKWithUnique; import org.tensorflow.op.core.Unbatch; import org.tensorflow.op.core.UnbatchGrad; +import org.tensorflow.op.core.UniformQuantizedClipByValue; import org.tensorflow.op.core.Unique; import org.tensorflow.op.core.UniqueWithCounts; import org.tensorflow.op.core.UnravelIndex; import org.tensorflow.op.core.Unstack; import org.tensorflow.op.core.Unstage; +import org.tensorflow.op.core.UpperBound; import org.tensorflow.op.core.VarHandleOp; import org.tensorflow.op.core.VarIsInitializedOp; import org.tensorflow.op.core.Variable; @@ -341,68 +392,80 @@ public final class Ops { public final NnOps nn; - public final SummaryOps summary; - - public final ImageOps image; - - public final RaggedOps ragged; + public final ClusterOps cluster; public final DataOps data; - public final ShapeOps shape; - - public final IoOps io; - - public final DtypesOps dtypes; - - public final XlaOps xla; - - public final LinalgOps linalg; + public final MathOps math; public final RandomOps random; public final StringsOps strings; - public final SparseOps sparse; + public final BitwiseOps bitwise; - public final TpuOps tpu; + public final DebuggingOps debugging; - public final BitwiseOps bitwise; + public final CollectiveOps collective; - public final MathOps math; + public final DistributeOps distribute; public final AudioOps audio; public final SignalOps signal; + public final TrainOps train; + public final QuantizationOps quantization; - public final TrainOps train; + public final SummaryOps summary; + + public final RaggedOps ragged; + + public final ImageOps image; + + public final ShapeOps shape; + + public final IoOps io; + + public final DtypesOps dtypes; + + public final LinalgOps linalg; + + public final XlaOps xla; + + public final SparseOps sparse; + + public final TpuOps tpu; private final Scope scope; - private Ops(Scope scope) { + Ops(Scope scope) { this.scope = scope; nn = new NnOps(this); + cluster = new ClusterOps(this); + data = new DataOps(this); + math = new MathOps(this); + random = new RandomOps(this); + strings = new StringsOps(this); + bitwise = new BitwiseOps(this); + debugging = new DebuggingOps(this); + collective = new CollectiveOps(this); + distribute = new DistributeOps(this); + audio = new AudioOps(this); + signal = new SignalOps(this); + train = new TrainOps(this); + quantization = new QuantizationOps(this); summary = new SummaryOps(this); - image = new ImageOps(this); ragged = new RaggedOps(this); - data = new DataOps(this); + image = new ImageOps(this); shape = new ShapeOps(this); io = new IoOps(this); dtypes = new DtypesOps(this); - xla = new XlaOps(this); linalg = new LinalgOps(this); - random = new RandomOps(this); - strings = new StringsOps(this); + xla = new XlaOps(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); - quantization = new QuantizationOps(this); - train = new TrainOps(this); } /** @@ -435,6 +498,105 @@ public All all(Operand input, Operand axis, All.Option return All.create(scope, input, axis, options); } + /** + * Creates a uninitialized anonymous hash table. + * This op creates a new anonymous hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Before using the table you will have + * to initialize it. After initialization the table will be + * immutable. The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + * + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param data type for {@code AnonymousHashTable} output and operands + * @param data type for {@code AnonymousHashTable} output and operands + * @return a new instance of AnonymousHashTable + */ + public AnonymousHashTable anonymousHashTable(Class keyDtype, + Class valueDtype) { + return AnonymousHashTable.create(scope, keyDtype, valueDtype); + } + + /** + * Creates an empty anonymous mutable hash table that uses tensors as the backing store. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a scalar. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + *

      It uses "open addressing" with quadratic reprobing to resolve + * collisions. + *

      The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + * + * @param emptyKey The key used to represent empty key buckets internally. Must not + * be used in insert or lookup operations. + * @param deletedKey The deletedKey value + * @param valueDtype Type of the table values. + * @param options carries optional attribute values + * @param data type for {@code AnonymousMutableDenseHashTable} output and operands + * @param data type for {@code AnonymousMutableDenseHashTable} output and operands + * @return a new instance of AnonymousMutableDenseHashTable + */ + public AnonymousMutableDenseHashTable anonymousMutableDenseHashTable( + Operand emptyKey, Operand deletedKey, Class valueDtype, + AnonymousMutableDenseHashTable.Options... options) { + return AnonymousMutableDenseHashTable.create(scope, emptyKey, deletedKey, valueDtype, options); + } + + /** + * Creates an empty anonymous mutable hash table. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a scalar. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + * The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + * + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param data type for {@code AnonymousMutableHashTable} output and operands + * @param data type for {@code AnonymousMutableHashTable} output and operands + * @return a new instance of AnonymousMutableHashTable + */ + public AnonymousMutableHashTable anonymousMutableHashTable( + Class keyDtype, Class valueDtype) { + return AnonymousMutableHashTable.create(scope, keyDtype, valueDtype); + } + + /** + * Creates an empty anonymous mutable hash table of vector values. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a vector. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + * The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + * + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param options carries optional attribute values + * @param data type for {@code AnonymousMutableHashTableOfTensors} output and operands + * @param data type for {@code AnonymousMutableHashTableOfTensors} output and operands + * @return a new instance of AnonymousMutableHashTableOfTensors + */ + public AnonymousMutableHashTableOfTensors anonymousMutableHashTableOfTensors( + Class keyDtype, Class valueDtype, + AnonymousMutableHashTableOfTensors.Options... options) { + return AnonymousMutableHashTableOfTensors.create(scope, keyDtype, valueDtype, options); + } + /** * Computes the "logical or" of elements across dimensions of a tensor. * Reduces {@code input} along the dimensions given in {@code axis}. Unless @@ -453,72 +615,88 @@ public Any any(Operand input, Operand axis, Any.Option } /** - * Creates a constant of {@code String} elements, using the default UTF-8 charset. + * Returns min/max k values and their indices of the input operand in an approximate manner. + * See https://arxiv.org/abs/2206.14286 for the algorithm details. + * This op is only optimized on TPU currently. + * + * @param input Array to search. Must be at least 1-D of the floating type + * @param k Specifies the number of min/max-k. + * @param options carries optional attribute values + * @param data type for {@code ApproxTopK} output and operands + * @return a new instance of ApproxTopK + */ + public ApproxTopK approxTopK(Operand input, Long k, + ApproxTopK.Options... options) { + return ApproxTopK.create(scope, input, k, options); + } + + /** + * Creates a constant of {@code long} elements. * * @param data An array containing the values to put into the new constant. - * @return the {@code String} constant + * @return a long constant */ - public Constant array(String... data) { + public Constant array(long... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code int} elements. + * Creates a constant of {@code float} elements. * * @param data An array containing the values to put into the new constant. * @return a float constant */ - public Constant array(int... data) { + public Constant array(float... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code double} elements. + * Creates a constant of {@code String} elements, using the default UTF-8 charset. * * @param data An array containing the values to put into the new constant. - * @return a double constant + * @return the {@code String} constant */ - public Constant array(double... data) { + public Constant array(String... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code long} elements. + * Creates a constant of {@code int} elements. * * @param data An array containing the values to put into the new constant. - * @return a long constant + * @return a float constant */ - public Constant array(long... data) { + public Constant array(int... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code byte} elements. + * Creates a constant of {@code double} elements. * * @param data An array containing the values to put into the new constant. - * @return a byte constant + * @return a double constant */ - public Constant array(byte... data) { + public Constant array(double... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code boolean} elements. + * Creates a constant of {@code byte} elements. * * @param data An array containing the values to put into the new constant. - * @return a boolean constant + * @return a byte constant */ - public Constant array(boolean... data) { + public Constant array(byte... data) { return Constant.arrayOf(scope, data); } /** - * Creates a constant of {@code float} elements. + * Creates a constant of {@code boolean} elements. * * @param data An array containing the values to put into the new constant. - * @return a float constant + * @return a boolean constant */ - public Constant array(float... data) { + public Constant array(boolean... data) { return Constant.arrayOf(scope, data); } @@ -554,7 +732,6 @@ public AssertThat assertThat(Operand condition, Iterable> data * This operation outputs "ref" after the assignment is done. * This makes it easier to chain operations that need to use the reset value. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. May be uninitialized. * @param value The value to be assigned to the variable. * @param options carries optional attribute values @@ -571,7 +748,6 @@ public Assign assign(Operand ref, Operand value, * This operation outputs "ref" after the update is done. * This makes it easier to chain operations that need to use the reset value. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param value The value to be added to the variable. * @param options carries optional attribute values @@ -602,7 +778,6 @@ public AssignAddVariableOp assignAddVariableOp(Operand resource * This operation outputs "ref" after the update is done. * This makes it easier to chain operations that need to use the reset value. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param value The value to be subtracted to the variable. * @param options carries optional attribute values @@ -635,11 +810,12 @@ public AssignSubVariableOp assignSubVariableOp(Operand resource * * @param resource handle to the resource in which to store the variable. * @param value the value to set the new tensor to use. + * @param options carries optional attribute values * @return a new instance of AssignVariableOp */ public AssignVariableOp assignVariableOp(Operand resource, - Operand value) { - return AssignVariableOp.create(scope, resource, value); + Operand value, AssignVariableOp.Options... options) { + return AssignVariableOp.create(scope, resource, value, options); } /** @@ -771,11 +947,11 @@ public BarrierTakeMany barrierTakeMany(Operand handle, Operand * empty, the op name will be used as the shared name. * T: the types of tensors to be batched. * - * @param inTensors the inTensors value - * @param numBatchThreads the value of the numBatchThreads property - * @param maxBatchSize the value of the maxBatchSize property - * @param batchTimeoutMicros the value of the batchTimeoutMicros property - * @param gradTimeoutMicros the value of the gradTimeoutMicros property + * @param inTensors The inTensors value + * @param numBatchThreads The value of the numBatchThreads attribute + * @param maxBatchSize The value of the maxBatchSize attribute + * @param batchTimeoutMicros The value of the batchTimeoutMicros attribute + * @param gradTimeoutMicros The value of the gradTimeoutMicros attribute * @param options carries optional attribute values * @return a new instance of Batch */ @@ -822,7 +998,7 @@ public Batch batch(Iterable> inTensors, Long numBatchThreads, Long ma * @param inTensors The tensors to be batched. * @param capturedTensors The tensors which are captured in the function, and don't need * to be batched. - * @param f the value of the f property + * @param f The value of the f attribute * @param numBatchThreads Number of scheduling threads for processing batches of work. * Determines the number of batches processed in parallel. * @param maxBatchSize Batch sizes will never be bigger than this. @@ -848,7 +1024,6 @@ public BatchFunction batchFunction(Iterable> inTensors, * dimension are moved in spatial blocks to the {@code height} and {@code width} dimensions, * followed by cropping along the {@code height} and {@code width} dimensions. * - * @param data type for {@code output} output * @param input 4-D tensor with shape * {@code [batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]}. Note that the batch size of the input tensor must be divisible by * {@code block_size * block_size}. @@ -858,7 +1033,7 @@ public BatchFunction batchFunction(Iterable> inTensors, *

          *  crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
          *  
      - * @param blockSize the value of the blockSize property + * @param blockSize The value of the blockSize attribute * @param data type for {@code BatchToSpace} output and operands * @return a new instance of BatchToSpace */ @@ -876,7 +1051,6 @@ public BatchToSpace batchToSpace(Operand input, * optionally cropped according to {@code crops} to produce the output. This is the * reverse of SpaceToBatch. See below for a precise description. * - * @param data type for {@code output} output * @param input N-D with shape {@code input_shape = [batch] + spatial_shape + remaining_shape}, * where spatial_shape has M dimensions. * @param blockShape 1-D with shape {@code [M]}, all values must be >= 1. @@ -1038,11 +1212,12 @@ public BatchToSpaceNd batchToSpaceNd(Operand input, * * *

      NOTE: Bitcast is implemented as a low-level cast, so machines with different - * endian orderings will give different results. + * endian orderings will give different results. A copy from input buffer to output + * buffer is made on BE machines when types are of different sizes in order to get + * the same casting results as on LE machines. * - * @param data type for {@code output} output - * @param input the input value - * @param type the value of the type property + * @param input The input value + * @param type The value of the type attribute * @param data type for {@code Bitcast} output and operands * @return a new instance of Bitcast */ @@ -1051,18 +1226,19 @@ public Bitcast bitcast(Operand input, Clas } /** - * Apply boolean mask to tensor. Returns the flat array of each element corresponding to a {@code true} in the mask. - *

      - * Numpy equivalent is {@code tensor[mask]}. - *

      - * In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match - * the first K dimensions of {@code tensor}'s shape. We then have: - * {@code booleanMask(tensor, mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} - * where {@code (i1,...,iK)} is the ith {@code true} entry of {@code mask} (row-major order). - *

      - * The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 by default). - * In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match - * the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * Apply boolean mask to tensor. Returns the flat array of each element corresponding to a {@code + * true} in the mask. + * + *

      Numpy equivalent is {@code tensor[mask]}. + * + *

      In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match + * the first K dimensions of {@code tensor}'s shape. We then have: {@code booleanMask(tensor, + * mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code + * true} entry of {@code mask} (row-major order). + * + *

      The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 + * by default). In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape + * must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. * * @param tensor The tensor to mask. * @param mask The mask to apply. @@ -1075,23 +1251,24 @@ public Operand booleanMask(Operand tensor, Operand - * Numpy equivalent is `tensor[mask] = updates`. - *

      - * In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match the first K dimensions of - * {@code tensor}'s shape. We then have: {@code booleanMask(tensor, mask)[i, j1,...,jd] = - * tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code true} entry of {@code mask} (row-major - * order). - *

      - * The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 by default). In that - * case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match the first {@code axis + - * dim(mask)} dimensions of {@code tensor}'s shape. - *

      - * The shape of {@code updates} should be {@code [n, t_1, t_2, ...]} where {@code n} is the number of true values in - * {@code mask} and {@code t_i} is the {@code i}th dimension of {@code tensor} after {@code axis} and {@code mask}. - * {@code updates} will be broadcasted to this shape by default, which can be disabled using {@code options}. + * Updates a tensor at the masked values, and returns the updated tensor. Does not mutate the + * input tensors. {@code updates} will be broadcasted by default + * + *

      Numpy equivalent is `tensor[mask] = updates`. + * + *

      In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match + * the first K dimensions of {@code tensor}'s shape. We then have: {@code booleanMask(tensor, + * mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code + * true} entry of {@code mask} (row-major order). + * + *

      The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 + * by default). In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape + * must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * + *

      The shape of {@code updates} should be {@code [n, t_1, t_2, ...]} where {@code n} is the + * number of true values in {@code mask} and {@code t_i} is the {@code i}th dimension of {@code + * tensor} after {@code axis} and {@code mask}. {@code updates} will be broadcasted to this shape + * by default, which can be disabled using {@code options}. * * @param tensor The tensor to mask. * @param mask The mask to apply. @@ -1109,9 +1286,8 @@ public Operand booleanMaskUpdate(Operand tensor, Operand * Given {@code s0} and {@code s1}, tensors that represent shapes, compute {@code r0}, the * broadcasted shape. {@code s0}, {@code s1} and {@code r0} are all integer vectors. * - * @param data type for {@code r0} output - * @param s0 the s0 value - * @param s1 the s1 value + * @param s0 The s0 value + * @param s1 The s1 value * @param data type for {@code BroadcastArgs} output and operands * @return a new instance of BroadcastDynamicShape */ @@ -1120,29 +1296,51 @@ public BroadcastDynamicShape broadcastDynamicShape(Operan return BroadcastDynamicShape.create(scope, s0, s1); } + /** + * Return the reduction indices for computing gradients of s0 op s1 with broadcast. + * This is typically used by gradient computations for a broadcasting operation. + * + * @param s0 The s0 value + * @param s1 The s1 value + * @param data type for {@code BroadcastGradientArgs} output and operands + * @return a new instance of BroadcastGradientArgs + */ + public BroadcastGradientArgs broadcastGradientArgs(Operand s0, + Operand s1) { + return BroadcastGradientArgs.create(scope, s0, s1); + } + /** * Broadcast an array for a compatible shape. * Broadcasting is the process of making arrays to have compatible shapes * for arithmetic operations. Two shapes are compatible if for each - * dimension pair they are either equal or one of them is one. When trying - * to broadcast a Tensor to a shape, it starts with the trailing dimensions, - * and works its way forward. - *

      For example, + * dimension pair they are either equal or one of them is one. + *

      For example: *

      *
      *
      - *

      x = tf.constant([1, 2, 3]) - * y = tf.broadcast_to(x, [3, 3]) + *

      x = tf.constant([[1, 2, 3]]) # Shape (1, 3,) + * y = tf.broadcast_to(x, [2, 3]) * print(y) * tf.Tensor( * [[1 2 3] - * [1 2 3] - * [1 2 3]], shape=(3, 3), dtype=int32) + * [1 2 3]], shape=(2, 3), dtype=int32) *

      *
      *
      *

      In the above example, the input Tensor with the shape of {@code [1, 3]} - * is broadcasted to output Tensor with shape of {@code [3, 3]}. + * is broadcasted to output Tensor with shape of {@code [2, 3]}. + *

      When broadcasting, if a tensor has fewer axes than necessary its shape is + * padded on the left with ones. So this gives the same result as the previous + * example: + *

      + *
      + *
      + *

      x = tf.constant([1, 2, 3]) # Shape (3,) + * y = tf.broadcast_to(x, [2, 3]) + *

      + *
      + *
      *

      When doing broadcasted operations such as multiplying a tensor * by a scalar, broadcasting (usually) confers some time or space * benefit, as the broadcasted tensor is never materialized. @@ -1151,7 +1349,6 @@ public BroadcastDynamicShape broadcastDynamicShape(Operan * shape. (In a graph context, {@code broadcast_to} might be fused to * subsequent operation and then be optimized away, however.) * - * @param data type for {@code output} output * @param input A Tensor to broadcast. * @param shape An 1-D {@code int} Tensor. The shape of the desired output. * @param data type for {@code BroadcastTo} output and operands @@ -1245,6 +1442,22 @@ public Case caseOp(Operand branchIndex, Iterable> input, return Case.create(scope, branchIndex, input, Tout, branches, options); } + /** + * Checks whether a tensor is located in host memory pinned for GPU. + * When run: + *

        + *
      • Reports an {@code InvalidArgument} error if {@code tensor} is not in pinned memory.
      • + *
      • Reports a {@code FailedPrecondition} error if not built with CUDA.
      • + *
      + * + * @param tensor The tensor value + * @param data type for {@code CheckPinned} output and operands + * @return a new instance of CheckPinned + */ + public CheckPinned checkPinned(Operand tensor) { + return CheckPinned.create(scope, tensor); + } + /** * Clips tensor values to a specified min and max. * Given a tensor {@code t}, this operation returns a tensor of the same type and @@ -1252,7 +1465,6 @@ public Case caseOp(Operand branchIndex, Iterable> input, * Any values less than {@code clip_value_min} are set to {@code clip_value_min}. Any values * greater than {@code clip_value_max} are set to {@code clip_value_max}. * - * @param data type for {@code output} output * @param t A {@code Tensor}. * @param clipValueMin A 0-D (scalar) {@code Tensor}, or a {@code Tensor} with the same shape * as {@code t}. The minimum value to clip by. @@ -1266,10 +1478,42 @@ public ClipByValue clipByValue(Operand t, Operand cli return ClipByValue.create(scope, t, clipValueMin, clipValueMax); } + /** + * Encodes an {@code ExtensionType} value into a {@code variant} scalar Tensor. + * Returns a scalar variant tensor containing a single {@code CompositeTensorVariant} + * with the specified Tensor components and TypeSpec. + * + * @param components The component tensors for the extension type value. + * @param metadata String serialization for the TypeSpec. (Note: the encoding for the TypeSpec + * may change in future versions of TensorFlow.) + * @return a new instance of CompositeTensorVariantFromComponents + */ + public CompositeTensorVariantFromComponents compositeTensorVariantFromComponents( + Iterable> components, String metadata) { + return CompositeTensorVariantFromComponents.create(scope, components, metadata); + } + + /** + * Decodes a {@code variant} scalar Tensor into an {@code ExtensionType} value. + * Returns the Tensor components encoded in a {@code CompositeTensorVariant}. + *

      Raises an error if {@code type_spec_proto} doesn't match the TypeSpec + * in {@code encoded}. + * + * @param encoded A scalar {@code variant} Tensor containing an encoded ExtensionType value. + * @param metadata String serialization for the TypeSpec. Must be compatible with the + * {@code TypeSpec} contained in {@code encoded}. (Note: the encoding for the TypeSpec + * may change in future versions of TensorFlow.) + * @param Tcomponents Expected dtypes for components. + * @return a new instance of CompositeTensorVariantToComponents + */ + public CompositeTensorVariantToComponents compositeTensorVariantToComponents( + Operand encoded, String metadata, List> Tcomponents) { + return CompositeTensorVariantToComponents.create(scope, encoded, metadata, Tcomponents); + } + /** * Concatenates tensors along one dimension. * - * @param data type for {@code output} output * @param values List of {@code N} Tensors to concatenate. Their ranks and types must match, * and their sizes must match in all dimensions except {@code concat_dim}. * @param axis 0-D. The dimension along which to concatenate. Must be in the @@ -1282,6 +1526,33 @@ public Concat concat(Iterable> values, return Concat.create(scope, values, axis); } + /** + * Computes offsets of concat inputs within its output. + * For example: + *

      + *
      + *
      + *

      x = [2, 2, 7] + * y = [2, 3, 7] + * z = [2, 9, 7] + * offsets = concat_offset(1, [x, y, z]) + * [[a.item() for a in list(off.numpy())] for off in offsets] + * [[0, 0, 0], [0, 2, 0], [0, 5, 0]] + *

      + *
      + *
      + *

      This is typically used by gradient computations for a concat operation. + * + * @param concatDim The dimension along which to concatenate. + * @param shape The {@code N} int32 or int64 vectors representing shape of tensors being concatenated. + * @param data type for {@code ConcatOffset} output and operands + * @return a new instance of ConcatOffset + */ + public ConcatOffset concatOffset(Operand concatDim, + Iterable> shape) { + return ConcatOffset.create(scope, concatDim, shape); + } + /** * Creates a constant containing a single {@code int} element. * @@ -1314,17 +1585,6 @@ public Constant constant(byte[][][][][] data) { return Constant.tensorOf(scope, data); } - /** - * Creates a constant of {@code String} elements that is a copy of a given n-dimensional array, - * using the default UTF-8 encoding. - * - * @param data an n-dimensional array of {@code String} elements. - * @return a string constant - */ - public Constant constant(NdArray data) { - return Constant.tensorOf(scope, data); - } - /** * Creates a rank-4 constant of {@code int} elements. * @@ -1346,17 +1606,6 @@ public Constant constant(byte data) { return Constant.scalarOf(scope, data); } - /** - * Creates a rank-2 constant of {@code long} elements. - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a long constant - */ - public Constant constant(long[][] data) { - return Constant.tensorOf(scope, data); - } - /** * Creates a rank-6 constant of {@code float} elements. * @@ -1391,259 +1640,324 @@ public Constant constant(boolean[][][][] data) { } /** - * Creates a rank-3 constant of {@code float} elements. + * Creates a rank-5 constant of {@code long} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a float constant + * @return a long constant */ - public Constant constant(float[][][] data) { + public Constant constant(long[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code float} elements. + * Creates a rank-1 constant of {@code int} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a float constant + * @return an integer constant */ - public Constant constant(float[][][][][] data) { + public Constant constant(int[] data) { + return Constant.vectorOf(scope, data); + } + + /** + * Creates a rank-2 constant of {@code boolean} elements. + * + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a boolean constant + */ + public Constant constant(boolean[][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code long} elements. + * Creates a constant of {@code boolean} elements that is a copy of a given n-dimensional array. + * + * @param data an n-dimensional array of {@code boolean} elements. + * @return a boolean constant + */ + public Constant constant(BooleanNdArray data) { + return Constant.tensorOf(scope, data); + } + + /** + * Creates a rank-1 constant of {@code double} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. + * @return a double constant + */ + public Constant constant(double[] data) { + return Constant.vectorOf(scope, data); + } + + /** + * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. + * + * @param data an n-dimensional array of {@code long} elements. * @return a long constant */ - public Constant constant(long[][][][][] data) { + public Constant constant(LongNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code int} elements. + * Creates a rank-3 constant of {@code long} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return an integer constant + * @return a long constant */ - public Constant constant(int[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(long[][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code float} elements. + * Creates a rank-1 constant of {@code byte} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. + * @return a byte constant + */ + public Constant constant(byte[] data) { + return Constant.vectorOf(scope, data); + } + + /** + * Creates a constant of {@code float} elements that is a copy of a given n-dimensional array. + * + * @param data an n-dimensional array of {@code float} elements. * @return a float constant */ - public Constant constant(float[][] data) { + public Constant constant(FloatNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code boolean} elements. + * Creates a rank-5 constant of {@code int} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a boolean constant + * @return an integer constant */ - public Constant constant(boolean[][] data) { + public Constant constant(int[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code double} element. + * Creates a rank-5 constant of {@code double} elements. * - * @param data The value to put into the new constant. + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. * @return a double constant */ - public Constant constant(double data) { - return Constant.scalarOf(scope, data); + public Constant constant(double[][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code boolean} element. + * Creates a rank-5 constant of {@code boolean} elements. * - * @param data The value to put into the new constant. + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. * @return a boolean constant */ - public Constant constant(boolean data) { - return Constant.scalarOf(scope, data); + public Constant constant(boolean[][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a constant containing a single {@code long} element. + * Creates a constant containing a single {@code float} element. * * @param data The value to put into the new constant. - * @return a long constant + * @return a float constant */ - public Constant constant(long data) { + public Constant constant(float data) { return Constant.scalarOf(scope, data); } /** - * Creates a {@code String} constant using the default, UTF-8 encoding. + * Creates a rank-2 constant of {@code byte} elements. * - * @param data The string to put into the new constant. - * @return a string constant + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a byte constant */ - public Constant constant(String data) { - return Constant.scalarOf(scope, data); + public Constant constant(byte[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a constant of {@code boolean} elements that is a copy of a given n-dimensional array. + * Creates a rank-2 constant of {@code double} elements. * - * @param data an n-dimensional array of {@code boolean} elements. - * @return a boolean constant + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a double constant */ - public Constant constant(BooleanNdArray data) { + public Constant constant(double[][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code double} elements. + * Creates a rank-3 constant of {@code byte} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a double constant + * @return a byte constant */ - public Constant constant(double[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(byte[][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. + * Creates a constant of {@code String} elements that is a copy of a given n-dimensional array, + * using the default UTF-8 encoding. * - * @param data an n-dimensional array of {@code long} elements. - * @return a long constant + * @param data an n-dimensional array of {@code String} elements. + * @return a string constant */ - public Constant constant(LongNdArray data) { + public Constant constant(NdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code float} elements. + * Creates a rank-2 constant of {@code long} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a float constant + * @return a long constant */ - public Constant constant(float[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(long[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-3 constant of {@code long} elements. + * Creates a rank-3 constant of {@code float} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a long constant + * @return a float constant */ - public Constant constant(long[][][] data) { + public Constant constant(float[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-3 constant of {@code boolean} elements. + * Creates a rank-5 constant of {@code float} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a boolean constant + * @return a float constant */ - public Constant constant(boolean[][][] data) { + public Constant constant(float[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-1 constant of {@code byte} elements. + * Creates a rank-2 constant of {@code float} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a byte constant + * @return a float constant */ - public Constant constant(byte[] data) { - return Constant.vectorOf(scope, data); + public Constant constant(float[][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a rank-3 constant of {@code int} elements. + * Creates a constant containing a single {@code double} element. * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return an integer constant + * @param data The value to put into the new constant. + * @return a double constant */ - public Constant constant(int[][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(double data) { + return Constant.scalarOf(scope, data); } /** - * Creates a constant of {@code int} elements that is a copy of a given n-dimensional array. + * Creates a constant containing a single {@code boolean} element. * - * @param data an n-dimensional array of {@code int} elements. - * @return an integer constant + * @param data The value to put into the new constant. + * @return a boolean constant */ - public Constant constant(IntNdArray data) { - return Constant.tensorOf(scope, data); + public Constant constant(boolean data) { + return Constant.scalarOf(scope, data); } /** - * Creates a rank-1 constant of {@code long} elements. + * Creates a constant containing a single {@code long} element. + * + * @param data The value to put into the new constant. + * @return a long constant + */ + public Constant constant(long data) { + return Constant.scalarOf(scope, data); + } + + /** + * Creates a {@code String} constant using the default, UTF-8 encoding. + * + * @param data The string to put into the new constant. + * @return a string constant + */ + public Constant constant(String data) { + return Constant.scalarOf(scope, data); + } + + /** + * Creates a rank-1 constant of {@code float} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a long constant + * @return a float constant */ - public Constant constant(long[] data) { + public Constant constant(float[] data) { return Constant.vectorOf(scope, data); } /** - * Creates a constant of {@code float} elements that is a copy of a given n-dimensional array. + * Creates a rank-3 constant of {@code boolean} elements. * - * @param data an n-dimensional array of {@code float} elements. - * @return a float constant + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a boolean constant */ - public Constant constant(FloatNdArray data) { + public Constant constant(boolean[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code int} elements. + * Creates a rank-3 constant of {@code int} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. * @return an integer constant */ - public Constant constant(int[][][][][] data) { + public Constant constant(int[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code double} elements. + * Creates a constant of {@code int} elements that is a copy of a given n-dimensional array. * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a double constant + * @param data an n-dimensional array of {@code int} elements. + * @return an integer constant */ - public Constant constant(double[][][][][] data) { + public Constant constant(IntNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code boolean} elements. + * Creates a rank-1 constant of {@code long} elements. * * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. - * @return a boolean constant + * @return a long constant */ - public Constant constant(boolean[][][][][] data) { - return Constant.tensorOf(scope, data); + public Constant constant(long[] data) { + return Constant.vectorOf(scope, data); } /** @@ -1703,22 +2017,12 @@ public Constant constant(int[][] data) { /** * Creates a rank-1 constant of {@code boolean} elements. * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a boolean constant - */ - public Constant constant(boolean[] data) { - return Constant.vectorOf(scope, data); - } - - /** - * Creates a constant containing a single {@code float} element. - * - * @param data The value to put into the new constant. - * @return a float constant + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a boolean constant */ - public Constant constant(float data) { - return Constant.scalarOf(scope, data); + public Constant constant(boolean[] data) { + return Constant.vectorOf(scope, data); } /** @@ -1775,39 +2079,6 @@ public Constant constant(long[][][][] data) { return Constant.tensorOf(scope, data); } - /** - * Creates a rank-2 constant of {@code byte} elements. - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a byte constant - */ - public Constant constant(byte[][] data) { - return Constant.tensorOf(scope, data); - } - - /** - * Creates a rank-2 constant of {@code double} elements. - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a double constant - */ - public Constant constant(double[][] data) { - return Constant.tensorOf(scope, data); - } - - /** - * Creates a rank-3 constant of {@code byte} elements. - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * new constant will match those of the array. - * @return a byte constant - */ - public Constant constant(byte[][][] data) { - return Constant.tensorOf(scope, data); - } - /** * Creates a rank-4 constant of {@code double} elements. * @@ -1915,26 +2186,26 @@ public Constant constant(Shape shape, IntDataBuffer data) { } /** - * Create a {@link TInt64} constant with data from the given buffer. + * Create a {@link TFloat64} constant with data from the given buffer. * * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return a long constant + * @return a double constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, LongDataBuffer data) { + public Constant constant(Shape shape, DoubleDataBuffer data) { return Constant.tensorOf(scope, shape, data); } /** - * Create a {@link TFloat64} constant with data from the given buffer. + * Create a {@link TInt64} constant with data from the given buffer. * * @param shape the tensor shape. * @param data a buffer containing the tensor data. - * @return a double constant + * @return a long constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public Constant constant(Shape shape, DoubleDataBuffer data) { + public Constant constant(Shape shape, LongDataBuffer data) { return Constant.tensorOf(scope, shape, data); } @@ -1995,11 +2266,7 @@ public Constant constant(Class type, Shape shape, ByteDa /** * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed - * afterwards without issue. - * - *

      Note: this endpoint cannot be simply called {@code constant} since it will conflict with - * other endpoints accepting an NdArray in parameter {e.g. {@link #tensorOf(Scope, - * FloatNdArray)}}. + * afterward without issue. * * @param tensor a Tensor holding the constant value * @return a constant of the same data type as `tensor` @@ -2048,10 +2315,34 @@ public ControlTrigger controlTrigger() { return ControlTrigger.create(scope); } + /** + * The CopyToMesh operation + * + * @param input The input value + * @param mesh The value of the mesh attribute + * @param data type for {@code CopyToMesh} output and operands + * @return a new instance of CopyToMesh + */ + public CopyToMesh copyToMesh(Operand input, String mesh) { + return CopyToMesh.create(scope, input, mesh); + } + + /** + * The CopyToMeshGrad operation + * + * @param input The input value + * @param forwardInput The forwardInput value + * @param data type for {@code CopyToMeshGrad} output and operands + * @return a new instance of CopyToMeshGrad + */ + public CopyToMeshGrad copyToMeshGrad(Operand input, + Operand forwardInput) { + return CopyToMeshGrad.create(scope, input, forwardInput); + } + /** * Increments 'ref' until it reaches 'limit'. * - * @param data type for {@code output} output * @param ref Should be from a scalar {@code Variable} node. * @param limit If incrementing ref would bring it above limit, instead generates an * 'OutOfRange' error. @@ -2064,7 +2355,10 @@ public CountUpTo countUpTo(Operand ref, Long limit) { /** * The op extracts fields from a serialized protocol buffers message into tensors. - * The {@code decode_proto} op extracts fields from a serialized protocol buffers + * Note: This API is designed for orthogonality rather than human-friendliness. It + * can be used to parse input protos by hand, but it is intended for use in + * generated code. + *

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

      A {@code message_type} name must be provided to give context for the field names. @@ -2094,6 +2388,16 @@ public CountUpTo countUpTo(Operand ref, Long limit) { * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in * the {@code output_types} attribute. * + *

    • + *

      {@code map} fields are not directly decoded. They are treated as {@code repeated} fields, + * of the appropriate entry type. The proto-compiler defines entry types for each + * map field. The type-name is the field name, converted to "CamelCase" with + * "Entry" appended. The {@code tf.train.Features.FeatureEntry} message is an example of + * one of these implicit {@code Entry} types. + *

    • + *
    • + *

      {@code enum} fields should be read as int32. + *

    • *
    *

    Both binary and text proto serializations are supported, and can be * chosen using the {@code format} attribute. @@ -2133,7 +2437,6 @@ public DecodeProto decodeProto(Operand bytes, String messageType, /** * Makes a copy of {@code x}. * - * @param data type for {@code y} output * @param x The source tensor of type {@code T}. * @param data type for {@code DeepCopy} output and operands * @return a new instance of DeepCopy @@ -2175,7 +2478,6 @@ public DestroyResourceOp destroyResourceOp(Operand resource, * using control dependencies. *

    Outputs the final value of the tensor pointed to by 'ref'. * - * @param data type for {@code value} output * @param ref A reference to the temporary variable tensor. * @param varName Name of the temporary variable, usually the name of the matching * 'TemporaryVariable' op. @@ -2187,6 +2489,29 @@ public DestroyTemporaryVariable destroyTemporaryVariable(Op return DestroyTemporaryVariable.create(scope, ref, varName); } + /** + * Return the index of device the op runs. + * Given a list of device names, this operation returns the index of the device + * this op runs. The length of the list is returned in two cases: + * (1) Device does not exist in the given device list. + * (2) It is in XLA compilation. + * + * @param deviceNames The value of the deviceNames attribute + * @return a new instance of DeviceIndex + */ + public DeviceIndex deviceIndex(List deviceNames) { + return DeviceIndex.create(scope, deviceNames); + } + + /** + * The DummyMemoryCache operation + * + * @return a new instance of DummyMemoryCache + */ + public DummyMemoryCache dummyMemoryCache() { + return DummyMemoryCache.create(scope); + } + /** * Partitions {@code data} into {@code num_partitions} tensors using indices from {@code partitions}. * For each index tuple {@code js} of size {@code partitions.ndim}, the slice {@code data[js, ...]} @@ -2220,9 +2545,17 @@ public DestroyTemporaryVariable destroyTemporaryVariable(Op *

    * *
    + *

    Raises: + *

      + *
    • {@code InvalidArgumentError} in following cases: + *
        + *
      • If partitions is not in range {@code [0, num_partiions)}
      • + *
      • If {@code partitions.shape} does not match prefix of {@code data.shape} argument.
      • + *
      + *
    • + *
    * - * @param data type for {@code outputs} output - * @param data the data value + * @param data The data value * @param partitions Any shape. Indices in the range {@code [0, num_partitions)}. * @param numPartitions The number of partitions to output. * @param data type for {@code DynamicPartition} output and operands @@ -2252,7 +2585,7 @@ public DynamicPartition dynamicPartition(Operand data, * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this * {@code constant}, the output shape is *
    -   *  merged.shape = [max(indices)] + constant
    +   *  merged.shape = [max(indices) + 1] + constant
        *  
    *

    Values are merged in order, so if an index appears in both {@code indices[m][i]} and * {@code indices[n][j]} for {@code (m,i) < (n,j)} the slice {@code data[n][j]} will appear in the @@ -2289,9 +2622,8 @@ public DynamicPartition dynamicPartition(Operand data, * * * - * @param data type for {@code merged} output - * @param indices the indices value - * @param data the data value + * @param indices The indices value + * @param data The data value * @param data type for {@code DynamicStitch} output and operands * @return a new instance of DynamicStitch */ @@ -2333,9 +2665,8 @@ public EditDistance editDistance(Operand hypothesisInd * Creates a tensor with the given shape. *

    This operation creates a tensor of {@code shape} and {@code dtype}. * - * @param data type for {@code output} output * @param shape 1-D. Represents the shape of the output tensor. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code Empty} output and operands * @return a new instance of Empty @@ -2353,9 +2684,9 @@ public Empty empty(Operand shape, Class dtype, * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. * - * @param elementShape the elementShape value - * @param maxNumElements the maxNumElements value - * @param elementDtype the value of the elementDtype property + * @param elementShape The elementShape value + * @param maxNumElements The maxNumElements value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code EmptyTensorList} output and operands * @return a new instance of EmptyTensorList */ @@ -2439,7 +2770,6 @@ public EncodeProto encodeProto(Operand sizes, Iterable> value * Raises an error if the input tensor's shape does not match the specified shape. * Returns the input tensor otherwise. * - * @param data type for {@code output} output * @param input A tensor, whose shape is to be validated. * @param shape The expected (possibly partially specified) shape of the input tensor. * @param data type for {@code EnsureShape} output and operands @@ -2449,6 +2779,37 @@ public EnsureShape ensureShape(Operand input, Shape shap return EnsureShape.create(scope, input, shape); } + /** + * Creates or finds a child frame, and makes {@code data} available to the child frame. + * This op is used together with {@code Exit} to create loops in the graph. + * The unique {@code frame_name} is used by the {@code Executor} to identify frames. If + * {@code is_constant} is true, {@code output} is a constant in the child frame; otherwise + * it may be changed in the child frame. At most {@code parallel_iterations} iterations + * are run in parallel in the child frame. + * + * @param data The tensor to be made available to the child frame. + * @param frameName The name of the child frame. + * @param options carries optional attribute values + * @param data type for {@code Enter} output and operands + * @return a new instance of Enter + */ + public Enter enter(Operand data, String frameName, + Enter.Options... options) { + return Enter.create(scope, data, frameName, options); + } + + /** + * Exits the current frame to its parent frame. + * Exit makes its input {@code data} available to the parent frame. + * + * @param data The tensor to be made available to the parent frame. + * @param data type for {@code Exit} output and operands + * @return a new instance of Exit + */ + public Exit exit(Operand data) { + return Exit.create(scope, data); + } + /** * Inserts a dimension of 1 into a tensor's shape. * Given a tensor {@code input}, this operation inserts a dimension of 1 at the @@ -2475,8 +2836,7 @@ public EnsureShape ensureShape(Operand input, Shape shap *

    This operation is related to {@code squeeze()}, which removes dimensions of * size 1. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param axis 0-D (scalar). Specifies the dimension index at which to * expand the shape of {@code input}. Must be in the range * {@code [-rank(input) - 1, rank(input)]}. @@ -2491,7 +2851,6 @@ public ExpandDims expandDims(Operand input, /** * Extract {@code patches} from {@code input} and put them in the {@code "depth"} output dimension. 3D extension of {@code extract_image_patches}. * - * @param data type for {@code patches} output * @param input 5-D Tensor with shape {@code [batch, in_planes, in_rows, in_cols, depth]}. * @param ksizes The size of the sliding window for each dimension of {@code input}. * @param strides 1-D of length 5. How far the centers of two consecutive patches are in @@ -2510,6 +2869,37 @@ public ExtractVolumePatches extractVolumePatches(Operand< return ExtractVolumePatches.create(scope, input, ksizes, strides, padding); } + /** + * This op is used as a placeholder in If branch functions. It doesn't provide a + * valid output when run, so must either be removed (e.g. replaced with a + * function input) or guaranteed not to be used (e.g. if mirroring an + * intermediate output needed for the gradient computation of the other branch). + * + * @param dtype The type of the output. + * @param shape

    +   *  The purported shape of the output. This is only used for shape inference;
    +   *  the output will not necessarily have this shape. Can be a partial shape.
    +   *  
    + * @param data type for {@code FakeParam} output and operands + * @return a new instance of FakeParam + */ + public FakeParam fakeParam(Class dtype, Shape shape) { + return FakeParam.create(scope, dtype, shape); + } + + /** + * Set configuration of the file system. + * + * @param scheme File system scheme. + * @param key The name of the configuration option. + * @param value The value of the configuration option. + * @return a new instance of FileSystemSetConfiguration + */ + public FileSystemSetConfiguration fileSystemSetConfiguration(Operand scheme, + Operand key, Operand value) { + return FileSystemSetConfiguration.create(scope, scheme, key, value); + } + /** * Creates a tensor filled with a scalar value. * This operation creates a tensor of shape {@code dims} and fills it with {@code value}. @@ -2530,7 +2920,6 @@ public ExtractVolumePatches extractVolumePatches(Operand< * based on other runtime Tensors, unlike {@code tf.constant}. * * - * @param data type for {@code output} output * @param dims 1-D. Represents the shape of the output tensor. * @param value 0-D (scalar). Value to fill the returned tensor. *

    {@literal @}compatibility(numpy)
    @@ -2579,7 +2968,8 @@ public Fingerprint fingerprint(Operand data, Operand m } /** - *

    +   * Applies a for loop.
    +   *  
        *   output = input;
        *   for i in range(start, limit, delta)
        *     output = body(i, output);
    @@ -2623,9 +3013,11 @@ public For forOp(Operand start, Operand limit, Operand d
        *  

    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, a 0 is stored in the * corresponding output value. + *

    Note that on TPU, if any dimension of {@code params} is of size 0 then the output will + * be the expected shape filled with zeros. On CPU and GPU an error will be + * returned. *

    See also {@code tf.batch_gather} and {@code tf.gather_nd}. * - * @param data type for {@code output} output * @param params The tensor from which to gather values. Must be at least rank * {@code axis + 1}. * @param indices Index tensor. Must be in range {@code [0, params.shape[axis])}. @@ -2663,9 +3055,17 @@ public Gather gather(Operand params, Operand * indices.shape[:-1] + params.shape[indices.shape[-1]:] *

    - *

    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, a 0 is stored in the - * corresponding output value. + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore error and set the corresponding output to 0; + * supported on both CPU and GPU.
    6. + *
    *

    Some examples below. *

    Simple indexing into a matrix: *

    @@ -2732,15 +3132,39 @@ public  Gather gather(Operand params, Operand
        *  

    See also {@code tf.gather} and {@code tf.batch_gather}. * - * @param data type for {@code output} output * @param params The tensor from which to gather values. * @param indices Index tensor. + * @param options carries optional attribute values * @param data type for {@code GatherNd} output and operands * @return a new instance of GatherNd */ public GatherNd gatherNd(Operand params, - Operand indices) { - return GatherNd.create(scope, params, indices); + Operand indices, GatherNd.Options... options) { + return GatherNd.create(scope, params, indices, options); + } + + /** + * Gets the element at the specified index in a dataset. + * + * @param dataset The dataset value + * @param index The index value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of GetElementAtIndex + */ + public GetElementAtIndex getElementAtIndex(Operand dataset, + Operand index, List> outputTypes, List outputShapes) { + return GetElementAtIndex.create(scope, dataset, index, outputTypes, outputShapes); + } + + /** + * Returns the {@code tf.data.Options} attached to {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the input dataset. + * @return a new instance of GetOptions + */ + public GetOptions getOptions(Operand inputDataset) { + return GetOptions.create(scope, inputDataset); } /** @@ -2756,7 +3180,6 @@ public GetSessionHandle getSessionHandle(Operand value) { /** * Get the value of the tensor specified by its handle. * - * @param data type for {@code value} output * @param handle The handle for a tensor stored in the session state. * @param dtype The type of the output value. * @param data type for {@code GetSessionTensor} output and operands @@ -2768,46 +3191,48 @@ public GetSessionTensor getSessionTensor(Operand h } /** - * Adds gradients computation ops to the graph according to scope. + * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, i.e., + * {@code d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...} * - * @param y outputs of the function to derive + *

    If {@code Options.dx()} values are set, they are as the initial symbolic partial derivatives + * of some loss function {@code L} w.r.t. {@code y}. {@code Options.dx()} must have the size of + * {@code y}. + * + *

    If {@code Options.dx()} is not set, the implementation will use dx of {@code OnesLike} for all + * shapes in {@code y}. + * + *

    The partial derivatives are returned in output {@code dy}, with the size of {@code x}. + * + *

    Example of usage: + * + *

    {@code
    +   *  Gradients gradients = tf.gradients(loss, Arrays.asList(w, b));
    +   *  Constant alpha = tf.constant(1.0f);
    +   *  tf.train.applyGradientDescent(w, alpha, gradients.dy(0));
    +   *  tf.train.applyGradientDescent(b, alpha, gradients.dy(1));
    +   *  }
    + * + * @param y output of the function to derive * @param x inputs of the function for which partial derivatives are computed * @param options carries optional attributes values * @return a new instance of {@code Gradients} * @throws IllegalArgumentException if execution environment is not a graph */ - public Gradients gradients(Iterable> y, Iterable> x, + public Gradients gradients(Operand y, Iterable> x, Gradients.Options... options) { return Gradients.create(scope, y, x, options); } /** - * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, - * i.e., {@code d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...} - *

    - * If {@code Options.dx()} values are set, they are as the initial symbolic partial derivatives of some loss - * function {@code L} w.r.t. {@code y}. {@code Options.dx()} must have the size of {@code y}. - *

    - * If {@code Options.dx()} is not set, the implementation will use dx of {@code OnesLike} for all - * shapes in {@code y}. - *

    - * The partial derivatives are returned in output {@code dy}, with the size of {@code x}. - *

    - * Example of usage: - *

    {@code
    -   *  Gradients gradients = tf.gradients(loss, Arrays.asList(w, b));
    -   *  Constant alpha = tf.constant(1.0f);
    -   *  tf.train.applyGradientDescent(w, alpha, gradients.dy(0));
    -   *  tf.train.applyGradientDescent(b, alpha, gradients.dy(1));
    -   *  }
    + * Adds gradients computation ops to the graph according to scope. * - * @param y output of the function to derive + * @param y outputs of the function to derive * @param x inputs of the function for which partial derivatives are computed * @param options carries optional attributes values * @return a new instance of {@code Gradients} * @throws IllegalArgumentException if execution environment is not a graph */ - public Gradients gradients(Operand y, Iterable> x, + public Gradients gradients(Iterable> y, Iterable> x, Gradients.Options... options) { return Gradients.create(scope, y, x, options); } @@ -2819,8 +3244,7 @@ public Gradients gradients(Operand y, Iterable> x, * as input. *

    Returns the input tensor without modification. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code GuaranteeConst} output and operands * @return a new instance of GuaranteeConst */ @@ -2863,7 +3287,6 @@ public HashTable hashTable(Class keyDtype, * sess.run(hist) => [2, 1, 1, 0, 2] *

    * - * @param data type for {@code out} output * @param values Numeric {@code Tensor}. * @param valueRange Shape [2] {@code Tensor} of same {@code dtype} as {@code values}. * values <= value_range[0] will be mapped to hist[0], @@ -2894,13 +3317,12 @@ public HistogramFixedWidth histogramFixedWidth(Opera * sess.run(hist) => [2, 1, 1, 0, 2] *
    * - * @param data type for {@code out} output * @param values Numeric {@code Tensor}. * @param valueRange Shape [2] {@code Tensor} of same {@code dtype} as {@code values}. * values <= value_range[0] will be mapped to hist[0], * values >= value_range[1] will be mapped to hist[-1]. * @param nbins Scalar {@code int32 Tensor}. Number of histogram bins. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param data type for {@code HistogramFixedWidth} output and operands * @param data type for {@code HistogramFixedWidth} output and operands * @return a new instance of HistogramFixedWidth @@ -2910,11 +3332,22 @@ public HistogramFixedWidth histogramFi return HistogramFixedWidth.create(scope, values, valueRange, nbins, dtype); } + /** + * Returns a constant tensor on the host. Only for writing C++ tests. + * + * @param value Attr {@code value} is the tensor to return. + * @param dtype The value of the dtype attribute + * @param data type for {@code HostConst} output and operands + * @return a new instance of HostConst + */ + public HostConst hostConst(Tensor value, Class dtype) { + return HostConst.create(scope, value, dtype); + } + /** * Return a tensor with the same shape and contents as the input tensor or value. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code Identity} output and operands * @return a new instance of Identity */ @@ -2938,7 +3371,7 @@ public Identity identity(Operand input) { * return [None, g(dy)] # Do not backprop to f(x). * * - * @param input the input value + * @param input The input value * @return a new instance of IdentityN */ public IdentityN identityN(Iterable> input) { @@ -2981,7 +3414,6 @@ public If ifOp(Operand cond, Iterable> input, * Returns immutable tensor from memory region. * The current implementation memmaps the tensor from a file. * - * @param data type for {@code tensor} output * @param dtype Type of the returned tensor. * @param shape Shape of the returned tensor. * @param memoryRegionName Name of readonly memory region used by the tensor, see @@ -3041,7 +3473,6 @@ public InitializeTableFromTextFile initializeTableFromTextFile( * Computes y = x; y[i, :] += v; return y. * * - * @param data type for {@code y} output * @param x A {@code Tensor} of type T. * @param i A vector. Indices into the left-most dimension of {@code x}. * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. @@ -3059,7 +3490,6 @@ public InplaceAdd inplaceAdd(Operand x, Operand * Computes y = x; y[i, :] -= v; return y. * * - * @param data type for {@code y} output * @param x A {@code Tensor} of type T. * @param i A vector. Indices into the left-most dimension of {@code x}. * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. @@ -3076,7 +3506,6 @@ public InplaceSub inplaceSub(Operand x, Operand *

    Originally this function is mutative however for compilation we make this * operation create / operate on a copy of {@code x}. * - * @param data type for {@code y} output * @param x A tensor of type {@code T}. * @param i A vector. Indices into the left-most dimension of {@code x}. * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. @@ -3116,22 +3545,41 @@ public IsVariableInitialized isVariableInitialized(Operand ref) * equal to the Kth order statistic. The semantics are not the same as * top_k_unique. * - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of KthOrderStatistic */ public KthOrderStatistic kthOrderStatistic(Operand input, Long k) { return KthOrderStatistic.create(scope, input, k); } + /** + * Generates values in an interval. + * A sequence of {@code num} evenly-spaced values are generated beginning at {@code start}. + * If {@code num > 1}, the values in the sequence increase by + * {@code (stop - start) / (num - 1)}, so that the last one is exactly {@code stop}. + *

    For example: + *

    +   *  tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0  11.0  12.0]
    +   *  
    + * + * @param start 0-D tensor. First entry in the range. + * @param stop 0-D tensor. Last entry in the range. + * @param num 0-D tensor. Number of values to generate. + * @param data type for {@code LinSpace} output and operands + * @return a new instance of LinSpace + */ + public LinSpace linSpace(Operand start, Operand stop, + Operand num) { + return LinSpace.create(scope, start, stop, num); + } + /** * Outputs all keys and values in the table. * - * @param data type for {@code keys} output - * @param data type for {@code values} output * @param tableHandle Handle to the table. - * @param Tkeys the value of the Tkeys property - * @param Tvalues the value of the Tvalues property + * @param Tkeys The value of the Tkeys attribute + * @param Tvalues The value of the Tvalues attribute * @param data type for {@code LookupTableExportV2} output and operands * @param data type for {@code LookupTableExportV2} output and operands * @return a new instance of LookupTableExport @@ -3148,10 +3596,9 @@ public LookupTableExport lookupTableExp *

    The scalar {@code default_value} is the value output for keys not present in the * table. It must also be of the same type as the table values. * - * @param data type for {@code values} output * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. - * @param defaultValue the defaultValue value + * @param defaultValue The defaultValue value * @param data type for {@code LookupTableFindV2} output and operands * @return a new instance of LookupTableFind */ @@ -3190,6 +3637,20 @@ public LookupTableInsert lookupTableInsert(Operand tableHandle, return LookupTableInsert.create(scope, tableHandle, keys, values); } + /** + * Removes keys and its associated values from a table. + * The tensor {@code keys} must of the same type as the keys of the table. Keys not + * already in the table are silently ignored. + * + * @param tableHandle Handle to the table. + * @param keys Any shape. Keys of the elements to remove. + * @return a new instance of LookupTableRemove + */ + public LookupTableRemove lookupTableRemove(Operand tableHandle, + Operand keys) { + return LookupTableRemove.create(scope, tableHandle, keys); + } + /** * Computes the number of elements in the given table. * @@ -3212,6 +3673,62 @@ public LoopCond loopCond(Operand input) { return LoopCond.create(scope, input); } + /** + * Applies lower_bound(sorted_search_values, values) along each row. + * Each set of rows with the same index in (sorted_inputs, values) is treated + * independently. The resulting row is the equivalent of calling + * {@code np.searchsorted(sorted_inputs, values, side='left')}. + *

    The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

    A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

    result = LowerBound(sorted_sequence, values) + *

    result == [[1, 2, 2], + * [0, 1, 5]] + * + * @param sortedInputs 2-D Tensor where each row is ordered. + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param data type for {@code LowerBound} output and operands + * @return a new instance of LowerBound, with default output types + */ + public LowerBound lowerBound(Operand sortedInputs, + Operand values) { + return LowerBound.create(scope, sortedInputs, values); + } + + /** + * Applies lower_bound(sorted_search_values, values) along each row. + * Each set of rows with the same index in (sorted_inputs, values) is treated + * independently. The resulting row is the equivalent of calling + * {@code np.searchsorted(sorted_inputs, values, side='left')}. + *

    The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

    A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

    result = LowerBound(sorted_sequence, values) + *

    result == [[1, 2, 2], + * [0, 1, 5]] + * + * @param sortedInputs 2-D Tensor where each row is ordered. + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param outType The value of the outType attribute + * @param data type for {@code LowerBound} output and operands + * @param data type for {@code LowerBound} output and operands + * @return a new instance of LowerBound + */ + public LowerBound lowerBound(Operand sortedInputs, + Operand values, Class outType) { + return LowerBound.create(scope, sortedInputs, values, outType); + } + /** * Make all elements in the non-Batch dimension unique, but "close" to * their initial value. Never returns a sub-normal number. Never returns @@ -3219,7 +3736,7 @@ public LoopCond loopCond(Operand input) { * of the corresponding output element. Behavior for infinite elements is * undefined. Behavior for subnormal elements is undefined. * - * @param input the input value + * @param input The input value * @return a new instance of MakeUnique */ public MakeUnique makeUnique(Operand input) { @@ -3229,7 +3746,7 @@ public MakeUnique makeUnique(Operand input) { /** * Op removes all elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapClear */ @@ -3237,10 +3754,42 @@ public MapClear mapClear(List> dtypes, MapClear.Options.. return MapClear.create(scope, dtypes, options); } + /** + * Maps a function on the list of tensors unpacked from arguments on dimension 0. + * The function given by {@code f} is assumed to be stateless, and is executed + * concurrently on all the slices; up to batch_size (i.e. the size of the 0th + * dimension of each argument) functions will be scheduled at once. + *

    The {@code max_intra_op_parallelism} attr, which defaults to 1, can be used to + * limit the intra op parallelism. To limit inter-op parallelism, a user can + * set a private threadpool on the dataset using {@code tf.data.Options}'s + * {@code ThreadingOptions}. + *

    Note that this op is not exposed to users directly, but is invoked in tf.data + * rewrites. + * + * @param arguments

    +   *  A list of tensors whose types are `Targuments`, corresponding to the inputs
    +   *  the function should be mapped over.
    +   *  
    + * @param capturedInputs
    +   *  A list of tensors whose types are `Tcaptured`, corresponding to the captured
    +   *  inputs of the defun.
    +   *  
    + * @param outputTypes A list of types. + * @param outputShapes A list of shapes. + * @param f The value of the f attribute + * @param options carries optional attribute values + * @return a new instance of MapDefun + */ + public MapDefun mapDefun(Iterable> arguments, Iterable> capturedInputs, + List> outputTypes, List outputShapes, ConcreteFunction f, + MapDefun.Options... options) { + return MapDefun.create(scope, arguments, capturedInputs, outputTypes, outputShapes, f, options); + } + /** * Op returns the number of incomplete elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapIncompleteSize */ @@ -3254,9 +3803,9 @@ public MapIncompleteSize mapIncompleteSize(List> dtypes, * underlying container does not contain this key * this op will block until it does. * - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapPeek */ @@ -3268,7 +3817,7 @@ public MapPeek mapPeek(Operand key, Operand indices, /** * Op returns the number of elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapSize */ @@ -3280,10 +3829,10 @@ public MapSize mapSize(List> dtypes, MapSize.Options... o * Stage (key, values) in the underlying container which behaves like a hashtable. * * @param key int64 - * @param indices the indices value + * @param indices The indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapStage */ @@ -3298,9 +3847,9 @@ public MapStage mapStage(Operand key, Operand indices, * from the underlying container. If the underlying container * does not contain this key, the op will block until it does. * - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapUnstage */ @@ -3314,8 +3863,8 @@ public MapUnstage mapUnstage(Operand key, Operand indices, * from the underlying container. If the underlying container * does not contain elements, the op will block until it does. * - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapUnstageNoKey */ @@ -3331,7 +3880,6 @@ public MapUnstageNoKey mapUnstageNoKey(Operand indices, * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -3351,7 +3899,6 @@ public Max max(Operand input, Operand{@code Merge} forwards the first tensor to become available to {@code output}, and sets * {@code value_index} to its index in {@code inputs}. * - * @param data type for {@code output} output * @param inputs The input tensors, exactly one of which will become available. * @param data type for {@code Merge} output and operands * @return a new instance of Merge @@ -3367,7 +3914,6 @@ public Merge merge(Iterable> inputs) { * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -3404,7 +3950,6 @@ public Min min(Operand input, Operand * - * @param data type for {@code output} output * @param input The input tensor to be padded. * @param paddings A two-column matrix specifying the padding sizes. The number of * rows must be the same as the rank of {@code input}. @@ -3421,6 +3966,35 @@ public MirrorPad mirrorPad(Operand input, return MirrorPad.create(scope, input, paddings, mode); } + /** + * Gradient op for {@code MirrorPad} op. This op folds a mirror-padded tensor. + * This operation folds the padded areas of {@code input} by {@code MirrorPad} according to the + * {@code paddings} you specify. {@code paddings} must be the same as {@code paddings} argument + * given to the corresponding {@code MirrorPad} op. + *

    The folded size of each dimension D of the output is: + *

    {@code input.dim_size(D) - paddings(D, 0) - paddings(D, 1)} + *

    For example: + *

    +   *  # 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]].
    +   *  # 'paddings' is [[0, 1]], [0, 1]].
    +   *  # 'mode' is SYMMETRIC.
    +   *  # rank of 't' is 2.
    +   *  pad(t, paddings) ==> [[ 1,  5]
    +   *                        [11, 28]]
    +   *  
    + * + * @param input The input tensor to be folded. + * @param paddings A two-column matrix specifying the padding sizes. The number of + * rows must be the same as the rank of {@code input}. + * @param mode The mode used in the {@code MirrorPad} op. + * @param data type for {@code MirrorPadGrad} output and operands + * @return a new instance of MirrorPadGrad + */ + public MirrorPadGrad mirrorPadGrad(Operand input, + Operand paddings, String mode) { + return MirrorPadGrad.create(scope, input, paddings, mode); + } + /** * Wraps an arbitrary MLIR computation expressed as a module with a main() function. * This operation does not have an associated kernel and is not intended to be @@ -3452,9 +4026,9 @@ public MirrorPad mirrorPad(Operand input, * graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def() * * - * @param inputs the inputs value - * @param mlirModule the value of the mlirModule property - * @param Toutputs the value of the Toutputs property + * @param inputs The inputs value + * @param mlirModule The value of the mlirModule attribute + * @param Toutputs The value of the Toutputs attribute * @return a new instance of MlirPassthroughOp */ public MlirPassthroughOp mlirPassthroughOp(Iterable> inputs, String mlirModule, @@ -3472,7 +4046,7 @@ public MlirPassthroughOp mlirPassthroughOp(Iterable> inputs, String m * * @param emptyKey The key used to represent empty key buckets internally. Must not * be used in insert or lookup operations. - * @param deletedKey the deletedKey value + * @param deletedKey The deletedKey value * @param valueDtype Type of the table values. * @param options carries optional attribute values * @param data type for {@code MutableDenseHashTableV2} output and operands @@ -3574,10 +4148,77 @@ public MutexLock mutexLock(Operand mutex) { return MutexLock.create(scope, mutex); } + /** + * 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 {@code c}, + * then {@code num_devices} ops will run with shared_name value {@code 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 {@code 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. + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclAllReduce} instead + * @param input The input value + * @param reduction The value of the reduction attribute + * @param numDevices The value of the numDevices attribute + * @param sharedName The value of the sharedName attribute + * @param data type for {@code NcclAllReduce} output and operands + * @return a new instance of NcclAllReduce + */ + @Deprecated + public NcclAllReduce ncclAllReduce(Operand input, String reduction, + Long numDevices, String sharedName) { + return NcclAllReduce.create(scope, input, reduction, numDevices, sharedName); + } + + /** + * Sends {@code input} to all devices that are connected to the output. + * Sends {@code 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. + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclBroadcast} instead + * @param input The input value + * @param shape The value of the shape attribute + * @param data type for {@code NcclBroadcast} output and operands + * @return a new instance of NcclBroadcast + */ + @Deprecated + public NcclBroadcast ncclBroadcast(Operand input, Shape shape) { + return NcclBroadcast.create(scope, input, shape); + } + + /** + * Reduces {@code input} from {@code num_devices} using {@code reduction} to a single device. + * Reduces {@code input} from {@code num_devices} using {@code 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 {@code num_devices} devices. + * reduction: the reduction operation to perform. + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclReduce} instead + * @param input The input value + * @param reduction The value of the reduction attribute + * @param data type for {@code NcclReduce} output and operands + * @return a new instance of NcclReduce + */ + @Deprecated + public NcclReduce ncclReduce(Iterable> input, + String reduction) { + return NcclReduce.create(scope, input, reduction); + } + /** * Makes its input available to the next iteration. * - * @param data type for {@code output} output * @param data The tensor to be made available to the next iteration. * @param data type for {@code NextIteration} output and operands * @return a new instance of NextIteration @@ -3672,7 +4313,6 @@ public NoOp noOp() { * ] * * - * @param data type for {@code output} output * @param indices A tensor of indices. * @param depth A scalar defining the depth of the one hot dimension. * @param onValue A scalar defining the value to fill in output when {@code indices[j] = i}. @@ -3701,7 +4341,6 @@ public Ones ones(Operand dims, Class /** * Returns a tensor of ones with the same shape and type as x. * - * @param data type for {@code y} output * @param x a tensor of type T. * @param data type for {@code OnesLike} output and operands * @return a new instance of OnesLike @@ -3713,7 +4352,7 @@ public OnesLike onesLike(Operand x) { /** * Op removes all elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapClear */ @@ -3725,7 +4364,7 @@ public OrderedMapClear orderedMapClear(List> dtypes, /** * Op returns the number of incomplete elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapIncompleteSize */ @@ -3740,9 +4379,9 @@ public OrderedMapIncompleteSize orderedMapIncompleteSize(List key, Operand indice /** * Op returns the number of elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapSize */ @@ -3768,10 +4407,10 @@ public OrderedMapSize orderedMapSize(List> dtypes, * associative container. Elements are ordered by key. * * @param key int64 - * @param indices the indices value + * @param indices The indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapStage */ @@ -3786,9 +4425,9 @@ public OrderedMapStage orderedMapStage(Operand key, Operand indi * from the underlying container. If the underlying container * does not contain this key, the op will block until it does. * - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapUnstage */ @@ -3802,8 +4441,8 @@ public OrderedMapUnstage orderedMapUnstage(Operand key, Operand * key from the underlying container. If the underlying container * does not contain elements, the op will block until it does. * - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapUnstageNoKey */ @@ -3835,10 +4474,9 @@ public OrderedMapUnstageNoKey orderedMapUnstageNoKey(Operand indices, * [0, 0, 0, 0, 0, 0]] * * - * @param data type for {@code output} output - * @param input the input value - * @param paddings the paddings value - * @param constantValues the constantValues value + * @param input The input value + * @param paddings The paddings value + * @param constantValues The constantValues value * @param data type for {@code PadV2} output and operands * @return a new instance of Pad */ @@ -3863,7 +4501,6 @@ public Pad pad(Operand input, Operand * will copy pieces of the input into the output as they become available, in * some situations this can provide a performance benefit. * - * @param data type for {@code output} output * @param values Tensors to be concatenated. All must have size 1 in the first dimension * and same shape. * @param shape the final shape of the result; should be equal to the shapes of any input @@ -3931,9 +4568,8 @@ public ParallelConcat parallelConcat(Iterable> v * * * - * @param data type for {@code merged} output - * @param indices the indices value - * @param data the data value + * @param indices The indices value + * @param data The data value * @param data type for {@code ParallelDynamicStitch} output and operands * @return a new instance of ParallelDynamicStitch */ @@ -3944,8 +4580,9 @@ public ParallelDynamicStitch parallelDynamicStitch( /** * returns {@code f(inputs)}, where {@code f}'s body is placed and partitioned. - * - *

    Selects between {@link StatefulPartitionedCall} and {@link StatelessPartitionedCall} based on the statefulness of the function arguments. + * Asynchronously executes a function, potentially across multiple devices but + * within a single process. The kernel places and partitions a given function's + * underlying graph, and executes each of the partitioned subgraphs as a function. * * @param args A list of input tensors. * @param Tout A list of output types. @@ -3953,8 +4590,7 @@ public ParallelDynamicStitch parallelDynamicStitch( * A function that takes 'args', a list of tensors, and returns 'output', * another list of tensors. Input and output types are specified by 'Tin' * and 'Tout'. The function body of f will be placed and partitioned across - * devices, setting this op apart from the regular Call op. This op is - * stateful. + * devices, setting this op apart from the regular Call op. * * @param options carries optional attribute values * @return a new instance of PartitionedCall @@ -3970,7 +4606,6 @@ public PartitionedCall partitionedCall(Iterable> args, * intended as a way to represent a value that will always be fed, and to * provide attrs that enable the fed value to be checked at runtime. * - * @param data type for {@code output} output * @param dtype The type of elements in the tensor. * @param options carries optional attribute values * @param data type for {@code Placeholder} output and operands @@ -3984,7 +4619,6 @@ public Placeholder placeholder(Class dtype, /** * A placeholder op that passes through {@code input} when its output is not fed. * - * @param data type for {@code output} output * @param input The default value to produce when {@code output} is not fed. * @param shape The (possibly partial) shape of the tensor. * @param data type for {@code PlaceholderWithDefault} output and operands @@ -4014,7 +4648,6 @@ public Print print(Operand input, Print.Options... options) { * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -4030,8 +4663,7 @@ public Prod prod(Operand input, Operand data type for {@code output} output - * @param tensor the tensor value + * @param tensor The tensor value * @param shape Defines the shape of the output tensor. * @param inputMin The minimum value of the input. * @param inputMax The maximum value of the input. @@ -4043,6 +4675,25 @@ public QuantizedReshape quantizedReshape(Operand tensor, return QuantizedReshape.create(scope, tensor, shape, inputMin, inputMax); } + /** + * Outputs the position of {@code value} in a permutation of [0, ..., max_index]. + * Output values are a bijection of the {@code index} for any combination and {@code seed} and {@code max_index}. + *

    If multiple inputs are vectors (matrix in case of seed) then the size of the + * first dimension must match. + *

    The outputs are deterministic. + * + * @param index A scalar tensor or a vector of dtype {@code dtype}. The index (or indices) to be shuffled. Must be within [0, max_index]. + * @param seed A tensor of dtype {@code Tseed} and shape [3] or [n, 3]. The random seed. + * @param maxIndex A scalar tensor or vector of dtype {@code dtype}. The upper bound(s) of the interval (inclusive). + * @param options carries optional attribute values + * @param data type for {@code RandomIndexShuffle} output and operands + * @return a new instance of RandomIndexShuffle + */ + public RandomIndexShuffle randomIndexShuffle(Operand index, + Operand seed, Operand maxIndex, RandomIndexShuffle.Options... options) { + return RandomIndexShuffle.create(scope, index, seed, maxIndex, options); + } + /** * Creates a sequence of numbers. * This operation creates a sequence of numbers that begins at {@code start} and @@ -4055,7 +4706,6 @@ public QuantizedReshape quantizedReshape(Operand tensor, * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] * * - * @param data type for {@code output} output * @param start 0-D (scalar). First entry in the sequence. * @param limit 0-D (scalar). Upper limit of sequence, exclusive. * @param delta 0-D (scalar). Optional. Default is 1. Number that increments {@code start}. @@ -4079,7 +4729,7 @@ public Range range(Operand start, Operand limit, Op * of a tensor is the number of indices required to uniquely select each element * of the tensor. Rank is also known as "order", "degree", or "ndims." * - * @param input the input value + * @param input The input value * @return a new instance of Rank */ public Rank rank(Operand input) { @@ -4094,7 +4744,6 @@ public Rank rank(Operand input) { * influenced by any of the writes which depend directly or indirectly on this * operation. * - * @param data type for {@code value} output * @param resource handle to the resource in which to store the variable. * @param dtype the dtype of the value. * @param data type for {@code ReadVariableOp} output and operands @@ -4105,6 +4754,23 @@ public ReadVariableOp readVariableOp(Operand data type for {@code Recv} output and operands + * @return a new instance of Recv + */ + public Recv recv(Class tensorType, String tensorName, String sendDevice, + Long sendDeviceIncarnation, String recvDevice, Recv.Options... options) { + return Recv.create(scope, tensorType, tensorName, sendDevice, sendDeviceIncarnation, recvDevice, options); + } + /** * Computes the "logical and" of elements across dimensions of a tensor. * Reduces {@code input} along the dimensions given in {@code axis}. Unless @@ -4148,7 +4814,6 @@ public ReduceAny reduceAny(Operand input, Operand axis * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -4168,7 +4833,6 @@ public ReduceMax reduceMax(Operand input, * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -4188,7 +4852,6 @@ public ReduceMin reduceMin(Operand input, * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -4208,7 +4871,6 @@ public ReduceProd reduceProd(Operand input, * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -4221,10 +4883,65 @@ public ReduceSum reduceSum(Operand input, Operand data type for {@code RefEnter} output and operands + * @return a new instance of RefEnter + */ + public RefEnter refEnter(Operand data, String frameName, + RefEnter.Options... options) { + return RefEnter.create(scope, data, frameName, options); + } + + /** + * Exits the current frame to its parent frame. + * Exit makes its input {@code data} available to the parent frame. + * + * @param data The tensor to be made available to the parent frame. + * @param data type for {@code RefExit} output and operands + * @return a new instance of RefExit + */ + public RefExit refExit(Operand data) { + return RefExit.create(scope, data); + } + + /** + * Return the same ref tensor as the input ref tensor. + * + * @param input The input value + * @param data type for {@code RefIdentity} output and operands + * @return a new instance of RefIdentity + */ + public RefIdentity refIdentity(Operand input) { + return RefIdentity.create(scope, input); + } + + /** + * Forwards the value of an available tensor from {@code inputs} to {@code output}. + * {@code Merge} waits for at least one of the tensors in {@code inputs} to become available. + * It is usually combined with {@code Switch} to implement branching. + *

    {@code Merge} forwards the first tensor for become available to {@code output}, and sets + * {@code value_index} to its index in {@code inputs}. + * + * @param inputs The input tensors, exactly one of which will become available. + * @param data type for {@code RefMerge} output and operands + * @return a new instance of RefMerge + */ + public RefMerge refMerge(Iterable> inputs) { + return RefMerge.create(scope, inputs); + } + /** * Makes its input available to the next iteration. * - * @param data type for {@code output} output * @param data The tensor to be made available to the next iteration. * @param data type for {@code RefNextIteration} output and operands * @return a new instance of RefNextIteration @@ -4236,7 +4953,6 @@ public RefNextIteration refNextIteration(Operand data) { /** * Forwards the {@code index}th element of {@code inputs} to {@code output}. * - * @param data type for {@code output} output * @param index A scalar that determines the input that gets selected. * @param inputs A list of ref tensors, one of which will be forwarded to {@code output}. * @param data type for {@code RefSelect} output and operands @@ -4253,7 +4969,6 @@ public RefSelect refSelect(Operand index, * the data goes to {@code output_false}. *

    See also {@code Switch} and {@code Merge}. * - * @param data type for {@code output_false} output * @param data The ref tensor to be forwarded to the appropriate output. * @param pred A scalar that specifies which output port will receive data. * @param data type for {@code RefSwitch} output and operands @@ -4263,6 +4978,31 @@ public RefSwitch refSwitch(Operand data, Operand return RefSwitch.create(scope, data, pred); } + /** + * The Relayout operation + * + * @param input The input value + * @param layout The value of the layout attribute + * @param data type for {@code Relayout} output and operands + * @return a new instance of Relayout + */ + public Relayout relayout(Operand input, String layout) { + return Relayout.create(scope, input, layout); + } + + /** + * The RelayoutLike operation + * + * @param input The input value + * @param layoutInput The layoutInput value + * @param data type for {@code RelayoutLike} output and operands + * @return a new instance of RelayoutLike + */ + public RelayoutLike relayoutLike(Operand input, + Operand layoutInput) { + return RelayoutLike.create(scope, input, layoutInput); + } + /** * Runs function {@code f} on a remote device indicated by {@code target}. * @@ -4334,8 +5074,7 @@ public RemoteCall remoteCall(Operand target, Iterable> args, * reshape(t, []) ==> 7 * * - * @param data type for {@code output} output - * @param tensor the tensor value + * @param tensor The tensor value * @param shape Defines the shape of the output tensor. * @param data type for {@code Reshape} output and operands * @return a new instance of Reshape @@ -4347,11 +5086,10 @@ public Reshape reshape(Operand tensor, Operand data type for {@code output} output * @param resource Should be from a scalar {@code Variable} node. * @param limit If incrementing ref would bring it above limit, instead generates an * 'OutOfRange' error. - * @param T the value of the T property + * @param T The value of the T attribute * @param data type for {@code ResourceCountUpTo} output and operands * @return a new instance of ResourceCountUpTo */ @@ -4375,10 +5113,9 @@ public ResourceCountUpTo resourceCountUpTo( * output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :] * * - * @param data type for {@code output} output - * @param resource the resource value - * @param indices the indices value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param indices The indices value + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code ResourceGather} output and operands * @return a new instance of ResourceGather @@ -4391,10 +5128,9 @@ public ResourceGather resourceGather(Operand data type for {@code output} output - * @param resource the resource value - * @param indices the indices value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param indices The indices value + * @param dtype The value of the dtype attribute * @param data type for {@code ResourceGatherNd} output and operands * @return a new instance of ResourceGatherNd */ @@ -4779,11 +5515,11 @@ public ResourceScatterUpdate resourceScatterUpdate(Operand reso *

    NOTE this op currently does not support broadcasting and so {@code value}'s * shape must be exactly the shape produced by the slice of {@code ref}. * - * @param ref the ref value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param ref The ref value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code ResourceStridedSliceAssign} output and operands * @return a new instance of ResourceStridedSliceAssign @@ -4796,9 +5532,7 @@ public ResourceStridedSliceAssign resourceStridedSliceAssign /** * Reverses specific dimensions of a tensor. - * NOTE {@code tf.reverse} has now changed behavior in preparation for 1.0. - * {@code tf.reverse_v2} is currently an alias that will be deprecated before TF 1.0. - *

    Given a {@code tensor}, and a {@code int32} tensor {@code axis} representing the set of + * Given a {@code tensor}, and a {@code int32} tensor {@code axis} representing the set of * dimensions of {@code tensor} to reverse. This operation reverses each dimension * {@code i} for which there exists {@code j} s.t. {@code axis[j] == i}. *

    {@code tensor} can have up to 8 dimensions. The number of dimensions specified @@ -4839,7 +5573,6 @@ public ResourceStridedSliceAssign resourceStridedSliceAssign * [12, 13, 14, 15]]]] * * - * @param data type for {@code output} output * @param tensor Up to 8-D. * @param axis 1-D. The indices of the dimensions to reverse. Must be in the range * {@code [-rank(tensor), rank(tensor))}. @@ -4901,7 +5634,6 @@ public Reverse reverse(Operand tensor, Operand * - * @param data type for {@code output} output * @param input The input to reverse. * @param seqLengths 1-D with length {@code input.dims(batch_dim)} and * {@code max(seq_lengths) <= input.dims(seq_dim)} @@ -4936,8 +5668,7 @@ public ReverseSequence reverseSequence(Operand input, * roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param shift Dimension must be 0-D or 1-D. {@code shift[i]} specifies the number of places by which * elements are shifted positively (towards larger indices) along the dimension * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite @@ -4976,7 +5707,6 @@ public Roll roll(Operand input, Operand * * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to add to {@code ref}. @@ -5008,7 +5738,6 @@ public ScatterAdd scatterAdd(Operand ref, * the same location, their contributions divide. *

    Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of values that {@code ref} is divided by. @@ -5043,7 +5772,6 @@ public ScatterDiv scatterDiv(Operand ref, * * * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to reduce into {@code ref}. @@ -5078,7 +5806,6 @@ public ScatterMax scatterMax(Operand ref, * * * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to reduce into {@code ref}. @@ -5110,7 +5837,6 @@ public ScatterMin scatterMin(Operand ref, * the same location, their contributions multiply. *

    Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to multiply to {@code ref}. @@ -5124,34 +5850,39 @@ public ScatterMul scatterMul(Operand ref, } /** - * Scatter {@code updates} into a new tensor according to {@code indices}. - * Creates a new tensor by applying sparse {@code updates} to individual values or - * slices within a tensor (initially zero for numeric, empty for string) of - * the given {@code shape} according to indices. This operator is the inverse of the - * {@code tf.gather_nd} operator which extracts values or slices from a given tensor. - *

    This operation is similar to tensor_scatter_add, except that the tensor is - * zero-initialized. Calling {@code tf.scatter_nd(indices, values, shape)} is identical - * to {@code tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)} - *

    If {@code indices} contains duplicates, then their updates are accumulated (summed). - *

    WARNING: The order in which updates are applied is nondeterministic, so the - * output will be nondeterministic if {@code indices} contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. - *

    {@code indices} is an integer tensor containing indices into a new tensor of shape - * {@code shape}. The last dimension of {@code indices} can be at most the rank of {@code shape}: + * Scatters {@code updates} into a tensor of shape {@code shape} according to {@code indices}. + * Scatter sparse {@code updates} according to individual values at the specified + * {@code indices}. This op returns an output tensor with the {@code shape} you specify. This + * op is the inverse of the {@code tf.gather_nd} operator which extracts values or slices + * from a given tensor. + *

    This operation is similar to {@code tf.tensor_scatter_nd_add}, except that the tensor + * is zero-initialized. Calling {@code tf.scatter_nd(indices, updates, shape)} + * is identical to calling + * {@code tf.tensor_scatter_nd_add(tf.zeros(shape, updates.dtype), indices, updates)} + *

    If {@code indices} contains duplicates, the associated {@code updates} are accumulated + * (summed) into the output tensor. + *

    WARNING: For floating-point data types, the output may be nondeterministic. + * This is because the order in which the updates are applied is nondeterministic + * and when floating-point numbers are added in different orders the resulting + * numerical approximation error can be slightly different. However, the output + * will be deterministic if op determinism is enabled via + * {@code tf.config.experimental.enable_op_determinism}. + *

    {@code indices} is an integer tensor containing indices into the output tensor. The + * last dimension of {@code indices} can be at most the rank of {@code shape}: *

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

    The last dimension of {@code indices} corresponds to indices into elements + *

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

    {@code 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. + *

    The simplest form of the scatter op is to insert individual elements in + * a tensor by index. Consider an example where you want to insert 4 scattered + * elements in a rank-1 tensor with 8 elements. *

    * *
    @@ -5167,15 +5898,15 @@ public ScatterMul scatterMul(Operand ref, *
        *  [0, 11, 0, 10, 9, 0, 0, 12]
        *  
    - *

    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. + *

    You can also insert entire slices of a higher rank tensor all at once. For + * example, you can 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]])
    +   *      indices = tf.constant([[1], [3]])
        *      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],
    @@ -5186,25 +5917,33 @@ public  ScatterMul scatterMul(Operand ref,
        *  
    *

    The resulting tensor would look like this: *

    -   *  [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
    -   *   [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
    +   *  [[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
        *   [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
    -   *   [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]
    +   *   [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
    +   *   [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]
        *  
    - *

    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. + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
    6. + *
    * - * @param data type for {@code output} output - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @param shape 1-D. The shape of the resulting tensor. + * @param indices Tensor of indices. + * @param updates Values to scatter into the output tensor. + * @param shape 1-D. The shape of the output tensor. + * @param options carries optional attribute values * @param data type for {@code ScatterNd} output and operands * @param data type for {@code ScatterNd} output and operands * @return a new instance of ScatterNd */ public ScatterNd scatterNd(Operand indices, - Operand updates, Operand shape) { - return ScatterNd.create(scope, indices, updates, shape); + Operand updates, Operand shape, ScatterNd.Options... options) { + return ScatterNd.create(scope, indices, updates, shape, options); } /** @@ -5236,7 +5975,6 @@ public ScatterNd scatterNd(Operand in *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. * - * @param data type for {@code output_ref} output * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. @@ -5251,6 +5989,40 @@ public ScatterNdAdd scatterNdAdd(Operand ref, return ScatterNdAdd.create(scope, ref, indices, updates, options); } + /** + * Computes element-wise maximum. + * + * @param ref A mutable Tensor. Should be from a Variable node. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated values + * to add to ref. + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMax} output and operands + * @return a new instance of ScatterNdMax + */ + public ScatterNdMax scatterNdMax(Operand ref, + Operand indices, Operand updates, ScatterNdMax.Options... options) { + return ScatterNdMax.create(scope, ref, indices, updates, options); + } + + /** + * Computes element-wise minimum. + * + * @param ref A mutable Tensor. Should be from a Variable node. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated values + * to add to ref. + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMin} output and operands + * @return a new instance of ScatterNdMin + */ + public ScatterNdMin scatterNdMin(Operand ref, + Operand indices, Operand updates, ScatterNdMin.Options... options) { + return ScatterNdMin.create(scope, ref, indices, updates, options); + } + /** * Applies sparse addition to {@code input} using individual values or slices * from {@code updates} according to indices {@code indices}. The updates are non-aliasing: @@ -5281,18 +6053,19 @@ public ScatterNdAdd scatterNdAdd(Operand ref, * *

    See {@code tf.scatter_nd} for more details about how to make updates to slices. * - * @param data type for {@code output} output * @param input A Tensor. * @param indices A Tensor. Must be one of the following types: {@code int32}, {@code int64}. * A tensor of indices into {@code input}. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to {@code input}. + * @param options carries optional attribute values * @param data type for {@code ScatterNdNonAliasingAdd} output and operands * @return a new instance of ScatterNdNonAliasingAdd */ public ScatterNdNonAliasingAdd scatterNdNonAliasingAdd(Operand input, - Operand indices, Operand updates) { - return ScatterNdNonAliasingAdd.create(scope, input, indices, updates); + Operand indices, Operand updates, + ScatterNdNonAliasingAdd.Options... options) { + return ScatterNdNonAliasingAdd.create(scope, input, indices, updates, options); } /** @@ -5325,7 +6098,6 @@ public ScatterNdNonAliasingAdd scatterNdNonAliasingAdd(Oper *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. * - * @param data type for {@code output_ref} output * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. @@ -5369,7 +6141,6 @@ public ScatterNdSub scatterNdSub(Operand ref, * slices. *

    See also {@code tf.scatter_update} and {@code tf.batch_scatter_update}. * - * @param data type for {@code output_ref} output * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. @@ -5405,7 +6176,6 @@ public ScatterNdUpdate scatterNdUpdate(Operand ref, * * * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to subtract from {@code ref}. @@ -5442,7 +6212,6 @@ public ScatterSub scatterSub(Operand ref, * *

    See also {@code tf.batch_scatter_update} and {@code tf.scatter_nd_update}. * - * @param data type for {@code output_ref} output * @param ref Should be from a {@code Variable} node. * @param indices A tensor of indices into the first dimension of {@code ref}. * @param updates A tensor of updated values to store in {@code ref}. @@ -5458,10 +6227,9 @@ public ScatterUpdate scatterUpdate(Operand ref, /** * The SelectV2 operation * - * @param data type for {@code output} output - * @param condition the condition value - * @param t the t value - * @param e the e value + * @param condition The condition value + * @param t The t value + * @param e The e value * @param data type for {@code SelectV2} output and operands * @return a new instance of Select */ @@ -5469,6 +6237,22 @@ public Select select(Operand condition, Operand t return Select.create(scope, condition, t, e); } + /** + * Sends the named tensor from send_device to recv_device. + * + * @param tensor The tensor to send. + * @param tensorName The name of the tensor to send. + * @param sendDevice The name of the device sending the tensor. + * @param sendDeviceIncarnation The current incarnation of send_device. + * @param recvDevice The name of the device receiving the tensor. + * @param options carries optional attribute values + * @return a new instance of Send + */ + public Send send(Operand tensor, String tensorName, String sendDevice, + Long sendDeviceIncarnation, String recvDevice, Send.Options... options) { + return Send.create(scope, tensor, tensorName, sendDevice, sendDeviceIncarnation, recvDevice, options); + } + /** * Computes the difference between two lists of numbers or strings. * Given a list {@code x} and a list {@code y}, this operation returns a list {@code out} that @@ -5488,8 +6272,6 @@ public Select select(Operand condition, Operand t * idx ==> [1, 3, 5] * * - * @param data type for {@code out} output - * @param data type for {@code idx} output * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. * @param data type for {@code ListDiff} output and operands @@ -5518,11 +6300,9 @@ public SetDiff1d setDiff1d(Operand x, Operand * idx ==> [1, 3, 5] * * - * @param data type for {@code out} output - * @param data type for {@code idx} output * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code ListDiff} output and operands * @param data type for {@code ListDiff} output and operands * @return a new instance of SetDiff1d @@ -5538,7 +6318,8 @@ public SetDiff1d setDiff1d(Operand * and {@code set_shape}. The last dimension contains values in a set, duplicates are * allowed but ignored. *

    If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set} - * indices. + * indices. Setting is to {@code False} while passing invalid arguments results in + * undefined behavior. * * @param setIndices 2D {@code Tensor}, indices of a {@code SparseTensor}. * @param setValues 1D {@code Tensor}, values of a {@code SparseTensor}. @@ -5560,8 +6341,7 @@ public SetSize setSize(Operand setIndices, Operand setV * shape(t) ==> [2, 2, 3] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of Shape, with default output types */ public org.tensorflow.op.core.Shape shape(Operand input) { @@ -5577,9 +6357,8 @@ public org.tensorflow.op.core.Shape shape(Operand input * shape(t) ==> [2, 2, 3] * * - * @param data type for {@code output} output - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code Shape} output and operands * @return a new instance of Shape */ @@ -5592,8 +6371,7 @@ public org.tensorflow.op.core.Shape shape(Operand data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of ShapeN, with default output types */ public ShapeN shapeN(Iterable> input) { @@ -5604,9 +6382,8 @@ public ShapeN shapeN(Iterable> input) { * Returns shape of tensors. * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. * - * @param data type for {@code output} output - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code ShapeN} output and operands * @return a new instance of ShapeN */ @@ -5625,8 +6402,7 @@ public ShapeN shapeN(Iterable> i * size(t) ==> 12 * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of Size, with default output types */ public Size size(Operand input) { @@ -5643,9 +6419,8 @@ public Size size(Operand input) { * size(t) ==> 12 * * - * @param data type for {@code output} output - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code Size} output and operands * @return a new instance of Size */ @@ -5673,8 +6448,7 @@ public Skipgram skipgram(String filename, Long batchSize, Skipgram.Options... op *

    Requirements: * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param begin begin[i] specifies the offset into the 'i'th dimension of * 'input' to slice from. * @param sizeOutput size[i] specifies the number of elements of the 'i'th dimension @@ -5693,8 +6467,7 @@ public Slice slice(Operand input, Ope /** * Returns a copy of the input tensor. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code Snapshot} output and operands * @return a new instance of Snapshot */ @@ -5801,7 +6574,6 @@ public Snapshot snapshot(Operand input) { *

    Among others, this operation is useful for reducing atrous convolution into * regular convolution. * - * @param data type for {@code output} output * @param input N-D with shape {@code input_shape = [batch] + spatial_shape + remaining_shape}, * where spatial_shape has {@code M} dimensions. * @param blockShape 1-D with shape {@code [M]}, all values must be >= 1. @@ -5820,7 +6592,6 @@ public SpaceToBatchNd spaceToBatchNd(Operand input, /** * Splits a tensor into {@code num_split} tensors along one dimension. * - * @param data type for {@code output} output * @param axis 0-D. The dimension along which to split. Must be in the range * {@code [-rank(value), rank(value))}. * @param value The tensor to split. @@ -5836,14 +6607,13 @@ public Split split(Operand axis, Operand value, /** * Splits a tensor into {@code num_split} tensors along one dimension. * - * @param data type for {@code output} output * @param value The tensor to split. * @param sizeSplits list containing the sizes of each output tensor along the split * dimension. Must sum to the dimension of value along split_dim. * Can contain one -1 indicating that dimension is to be inferred. * @param axis 0-D. The dimension along which to split. Must be in the range * {@code [-rank(value), rank(value))}. - * @param numSplit the value of the numSplit property + * @param numSplit The value of the numSplit attribute * @param data type for {@code SplitV} output and operands * @return a new instance of SplitV */ @@ -5869,7 +6639,6 @@ public SplitV splitV(Operand value, Operand * - * @param data type for {@code output} output * @param input The {@code input} to squeeze. * @param options carries optional attribute values * @param data type for {@code Squeeze} output and operands @@ -5897,7 +6666,6 @@ public Squeeze squeeze(Operand input, Squeeze.Options... * *

    This is the opposite of {@code unpack}. * - * @param data type for {@code output} output * @param values Must be of same shape and type. * @param options carries optional attribute values * @param data type for {@code Pack} output and operands @@ -5907,6 +6675,58 @@ public Stack stack(Iterable> values, Stack.Optio return Stack.create(scope, values, options); } + /** + * Delete the stack from its resource container. + * + * @param handle The handle to a stack. + * @return a new instance of StackClose + */ + public StackClose stackClose(Operand handle) { + return StackClose.create(scope, handle); + } + + /** + * A stack that produces elements in first-in last-out order. + * + * @param maxSize The maximum size of the stack if non-negative. If negative, the stack + * size is unlimited. + * @param elemType The type of the elements on the stack. + * @param options carries optional attribute values + * @param data type for {@code StackV2} output and operands + * @return a new instance of StackCreate + */ + public StackCreate stackCreate(Operand maxSize, Class elemType, + StackCreate.Options... options) { + return StackCreate.create(scope, maxSize, elemType, options); + } + + /** + * Pop the element at the top of the stack. + * + * @param handle The handle to a stack. + * @param elemType The type of the elem that is popped. + * @param data type for {@code StackPopV2} output and operands + * @return a new instance of StackPop + */ + public StackPop stackPop(Operand handle, + Class elemType) { + return StackPop.create(scope, handle, elemType); + } + + /** + * Push an element onto the stack. + * + * @param handle The handle to a stack. + * @param elem The tensor to be pushed onto the stack. + * @param options carries optional attribute values + * @param data type for {@code StackPushV2} output and operands + * @return a new instance of StackPush + */ + public StackPush stackPush(Operand handle, Operand elem, + StackPush.Options... options) { + return StackPush.create(scope, handle, elem, options); + } + /** * Stage values similar to a lightweight Enqueue. * The basic functionality of this Op is similar to a queue with many @@ -5924,7 +6744,7 @@ public Stage stage(Iterable> values, Stage.Options... options) { /** * Op removes all elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StageClear */ @@ -5938,8 +6758,8 @@ public StageClear stageClear(List> dtypes, StageClear.Opt * this op will block until it does. This Op is optimized for * performance. * - * @param index the index value - * @param dtypes the value of the dtypes property + * @param index The index value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StagePeek */ @@ -5951,7 +6771,7 @@ public StagePeek stagePeek(Operand index, List> d /** * Op returns the number of elements in the underlying container. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StageSize */ @@ -6041,7 +6861,8 @@ public StatefulIf statefulIf(Operand cond, Iterable> * @return a new instance of StatefulPartitionedCall */ public StatefulPartitionedCall statefulPartitionedCall(Iterable> args, - List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { + List> Tout, ConcreteFunction f, + StatefulPartitionedCall.Options... options) { return StatefulPartitionedCall.create(scope, args, Tout, f, options); } @@ -6071,6 +6892,44 @@ public StatefulWhile statefulWhile(Iterable> input, ConcreteFunction return StatefulWhile.create(scope, input, cond, body, options); } + /** + * An n-way switch statement which calls a single branch function. + *

    +   *  An n-way switch statement, implementing the following:
    +   *  ```
    +   *  switch (branch_index) {
    +   *    case 0:
    +   *      output = branches[0](input);
    +   *      break;
    +   *    case 1:
    +   *      output = branches[1](input);
    +   *      break;
    +   *    ...
    +   *    case [[nbranches-1]]:
    +   *    default:
    +   *      output = branches[nbranches-1](input);
    +   *      break;
    +   *  }
    +   *  ```
    +   *
    +   *  This should only be used when the none of branches has stateful ops.
    +   *  
    + * + * @param branchIndex The branch selector, an int32 Tensor. + * @param input A list of input tensors passed to the branch function. + * @param Tout A list of output types. + * @param branches
    +   *    A list of functions each of which takes 'inputs' and returns a list of
    +   *    tensors, whose types are the same as what every other branch returns.
    +   *  
    + * @param options carries optional attribute values + * @return a new instance of StatelessCase + */ + public StatelessCase statelessCase(Operand branchIndex, Iterable> input, + List> Tout, List branches, Case.Options... options) { + return StatelessCase.create(scope, branchIndex, input, Tout, branches, options); + } + /** * output = cond ? then_branch(input) : else_branch(input) * @@ -6104,28 +6963,6 @@ public StatelessIf statelessIf(Operand cond, Iterable - * A function that takes 'args', a list of tensors, and returns 'output', - * another list of tensors. Input and output types are specified by 'Tin' - * and 'Tout'. The function body of f will be placed and partitioned across - * devices, setting this op apart from the regular Call op. - * - * @param options carries optional attribute values - * @return a new instance of StatelessPartitionedCall - */ - public StatelessPartitionedCall statelessPartitionedCall(Iterable> args, - List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { - return StatelessPartitionedCall.create(scope, args, Tout, f, options); - } - /** * output = input; While (Cond(output)) { output = Body(output) } * @@ -6155,6 +6992,25 @@ public StatelessWhile statelessWhile(Iterable> input, ConcreteFunctio return StatelessWhile.create(scope, input, cond, body, options); } + /** + * Stochastically cast a given tensor from floats to ints. + * The values are cast with a deterministic pseudo-random tensor from a uniform distribution generated from user given key, counter, algorithm. Values will saturate if out of the specified integer type range, and will become zero if inputs are NaN. + *

    The outputs are a deterministic function of {@code input}, {@code key}, {@code counter}, {@code alg}. + * + * @param input The operand to stochastically cast to int. + * @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 Tout The type of the output. + * @param data type for {@code StochasticCastToInt} output and operands + * @return a new instance of StochasticCastToInt + */ + public StochasticCastToInt stochasticCastToInt( + Operand input, Operand key, + Operand counter, Operand alg, Class Tout) { + return StochasticCastToInt.create(scope, input, key, counter, alg, Tout); + } + /** * Stops gradient computation. * When executed in a graph, this op outputs its input tensor as-is. @@ -6208,8 +7064,7 @@ public StatelessWhile statelessWhile(Iterable> input, ConcreteFunctio * example generation process. * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param data type for {@code StopGradient} output and operands * @return a new instance of StopGradient */ @@ -6219,48 +7074,55 @@ public StopGradient stopGradient(Operand input) { /** * Return a strided slice from `input`. - *

    - * The goal of this op is to produce a new tensor with a subset of the elements from the `n` dimensional `input` - * tensor. The subset is chosen using a sequence of `m` sparse range specifications encoded into the arguments of this - * function. Note, in some cases `m` could be equal to `n`, but this need not be the case. Each range specification - * entry can be one of the following: - *

    - * - An ellipsis (...) using {@link Indices#ellipsis()}. Ellipses are used to imply zero or more dimensions of - * full-dimension selection. For example, {@code stridedSlice(foo, Indices.ellipsis()} is the identity slice. - *

    - * - A new axis using {@link Indices#newAxis()}. This is used to insert a new shape=1 dimension. - * For example, `{@code stridedSlice(foo, Indices.newAxis())} where {@code foo} is shape {@code (3, 4)} - * produces a {@code (1, 3, 4)} tensor. - *

    - * - A range {@code begin:end:stride} using {@link Indices#slice(Long, Long, long)} Index.slice()} or {@link Indices#all()}. This is used to specify - * how much to choose from a given dimension. {@code stride} can be any integer but 0. {@code begin} is an integer which - * represents the index of the first value to select while {@code end} represents the index of the last value to select - * (exclusive). Begin and end can be null, in which case the index begins or ends at the beginning or end of the dimension, - * respectively (reversed if stride is negative). When both are null, {@code slice()} is the same as {@code all()}. - * The number of values selected in each dimension is {@code end - begin} if {@code stride > 0} and {@code begin - end} - * if {@code stride < 0}. {@code begin} and {@code end} can be negative where {@code -1} is the last element, {@code -2} - * is the second to last. For example, given a shape {@code (3,)} tensor {@code stridedSlice(foo, Indices.all())}, the - * effective {@code begin} and {@code end} are {@code 0} and {@code 3}. Do not assume this is equivalent to - * {@code stridedSlice(foo, Indices.slice(0, -1))} which has an effective {@code begin} and {@code end} of {@code 0} and - * {@code 2}. Another example is {@code stridedSlice(foo, Indices.slice(-2, null, -1))} which reverses the first dimension - * of a tensor while dropping the last two (in the original order elements). For example {@code foo = [1,2,3,4]; - * stridedSlice(foo, Indices.slice(-2, null, -1)} is {@code [4,3]}. - *

    - * - A single index using {@link Indices#at(long)}. This is used to keep only elements that have a given index. For - * example ({@code stridedSlice(foo, Indices.at(2))} on a shape {@code (5,6)} tensor produces a shape {@code (6,)} tensor. - * The dimension can be kept with size one using {@link Indices#at(long, boolean)}. - *

    - * These semantics generally follow NumPy's indexing semantics, which can be found here: - * https://numpy.org/doc/stable/reference/arrays.indexing.html - *

    - * - * Requirements: - * `0 != strides[i] for i in [0, m)` Only one ellipsis. + * + *

    The goal of this op is to produce a new tensor with a subset of the elements from the `n` + * dimensional `input` tensor. The subset is chosen using a sequence of `m` sparse range + * specifications encoded into the arguments of this function. Note, in some cases `m` could be + * equal to `n`, but this need not be the case. Each range specification entry can be one of the + * following: + * + *

    - An ellipsis (...) using {@link org.tensorflow.ndarray.index.Indices#ellipsis()}. Ellipses + * are used to imply zero or more dimensions of full-dimension selection. For example, {@code + * stridedSlice(foo, Indices.ellipsis()} is the identity slice. + * + *

    - A new axis using {@link org.tensorflow.ndarray.index.Indices#newAxis()}. This is used to + * insert a new shape=1 dimension. For example, `{@code stridedSlice(foo, Indices.newAxis())} + * where {@code foo} is shape {@code (3, 4)} produces a {@code (1, 3, 4)} tensor. + * + *

    - A range {@code begin:end:stride} using {@link + * org.tensorflow.ndarray.index.Indices#slice(Long, Long, long)} Index.slice()} or {@link + * org.tensorflow.ndarray.index.Indices#all()}. This is used to specify how much to choose from a + * given dimension. {@code stride} can be any integer but 0. {@code begin} is an integer which + * represents the index of the first value to select while {@code end} represents the index of the + * last value to select (exclusive). Begin and end can be null, in which case the index begins or + * ends at the beginning or end of the dimension, respectively (reversed if stride is negative). + * When both are null, {@code slice()} is the same as {@code all()}. The number of values selected + * in each dimension is {@code end - begin} if {@code stride > 0} and {@code begin - end} if + * {@code stride < 0}. {@code begin} and {@code end} can be negative where {@code -1} is the last + * element, {@code -2} is the second to last. For example, given a shape {@code (3,)} tensor + * {@code stridedSlice(foo, Indices.all())}, the effective {@code begin} and {@code end} are + * {@code 0} and {@code 3}. Do not assume this is equivalent to {@code stridedSlice(foo, + * Indices.slice(0, -1))} which has an effective {@code begin} and {@code end} of {@code 0} and + * {@code 2}. Another example is {@code stridedSlice(foo, Indices.slice(-2, null, -1))} which + * reverses the first dimension of a tensor while dropping the last two (in the original order + * elements). For example {@code foo = [1,2,3,4]; stridedSlice(foo, Indices.slice(-2, null, -1)} + * is {@code [4,3]}. + * + *

    - A single index using {@link org.tensorflow.ndarray.index.Indices#at(long)}. This is used + * to keep only elements that have a given index. For example ({@code stridedSlice(foo, + * Indices.at(2))} on a shape {@code (5,6)} tensor produces a shape {@code (6,)} tensor. The + * dimension can be kept with size one using {@link org.tensorflow.ndarray.index.Indices#at(long, + * boolean)}. + * + *

    These semantics generally follow NumPy's indexing semantics, which can be found here: https://numpy.org/doc/stable/reference/arrays.indexing.html + * + *

    Requirements: `0 != strides[i] for i in [0, m)` Only one ellipsis. * * @param data type for {@code output()} output - * @param indices The indices to slice. See {@link Indices}. + * @param indices The indices to slice. See {@link org.tensorflow.ndarray.index.Indices}. * @return a new instance of StridedSlice - * @see Indices + * @see org.tensorflow.ndarray.index.Indices */ public StridedSlice stridedSlice(Operand input, Index... indices) { return StridedSliceHelper.stridedSlice(scope, input, indices); @@ -6366,8 +7228,7 @@ public StridedSlice stridedSlice(Operand input, Index... * {@code 0 != strides[i] for i in [0, m)} * {@code ellipsis_mask must be a power of two (only one ellipsis)} * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param begin {@code begin[k]} specifies the offset into the {@code k}th range specification. * The exact dimension this corresponds to will be determined by context. * Out-of-bounds values will be silently clamped. If the {@code k}th bit of @@ -6392,19 +7253,21 @@ public StridedSlice stridedSlice(Operand /** * Assign `value` to the sliced l-value reference of `ref`. - *

    - * The values of `value` are assigned to the positions in the variable `ref` that are selected by the slice - * parameters. The slice parameters `begin`, `end`, `strides`, etc. work exactly as in `StridedSlice`. - *

    - * NOTE this op currently does not support broadcasting and so `value`'s shape must be exactly the shape produced by - * the slice of `ref`. + * + *

    The values of `value` are assigned to the positions in the variable `ref` that are selected + * by the slice parameters. The slice parameters `begin`, `end`, `strides`, etc. work exactly as + * in `StridedSlice`. + * + *

    NOTE this op currently does not support broadcasting and so `value`'s shape must be exactly + * the shape produced by the slice of `ref`. * * @param data type for {@code outputRef()} output * @param ref the tensor to assign to. * @param value the value to assign. - * @param indices The indices to slice. See {@link Indices}. + * @param indices The indices to slice. See {@link org.tensorflow.ndarray.index.Indices}. * @return a new instance of StridedSliceAssign - * @see org.tensorflow.op.Ops#stridedSlice(Operand, Index...) + * @see org.tensorflow.op.Ops#stridedSlice(org.tensorflow.Operand, + * org.tensorflow.ndarray.index.Index...) */ public StridedSliceAssign stridedSliceAssign(Operand ref, Operand value, Index... indices) { @@ -6419,12 +7282,11 @@ public StridedSliceAssign stridedSliceAssign(Operand ref *

    NOTE this op currently does not support broadcasting and so {@code value}'s * shape must be exactly the shape produced by the slice of {@code ref}. * - * @param data type for {@code output_ref} output - * @param ref the ref value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param ref The ref value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code StridedSliceAssign} output and operands * @param data type for {@code StridedSliceAssign} output and operands @@ -6446,12 +7308,11 @@ public StridedSliceAssign stridedSliceAs * {@code dy} is the input gradient to be propagated and {@code shape} is the * shape of {@code StridedSlice}'s {@code input}. * - * @param data type for {@code output} output - * @param shape the shape value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param dy the dy value + * @param shape The shape value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param dy The dy value * @param options carries optional attribute values * @param data type for {@code StridedSliceGrad} output and operands * @param data type for {@code StridedSliceGrad} output and operands @@ -6470,7 +7331,6 @@ public StridedSliceGrad stridedSliceGrad * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. * - * @param data type for {@code output} output * @param input The tensor to reduce. * @param axis The dimensions to reduce. Must be in the range * {@code [-rank(input), rank(input))}. @@ -6489,7 +7349,6 @@ public Sum sum(Operand input, Operand * the data goes to {@code output_false}. *

    See also {@code RefSwitch} and {@code Merge}. * - * @param data type for {@code output_false} output * @param data The tensor to be forwarded to the appropriate output. * @param pred A scalar that specifies which output port will receive data. * @param data type for {@code Switch} output and operands @@ -6499,6 +7358,17 @@ public SwitchCond switchCond(Operand data, Operand SwitchCond switchCond(Operand data, Operand data type for {@code ref} output * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. * @param options carries optional attribute values @@ -6559,10 +7428,11 @@ public TensorArrayClose tensorArrayClose(Operand handle) { * (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...) * *

    and concatenates them into a Tensor of shape: - *

    {@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)} + *

    +   *  (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)
    +   *  
    *

    All elements must have the same shape (excepting the first dimension). * - * @param data type for {@code value} output * @param handle The handle to a TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. @@ -6579,7 +7449,6 @@ public TensorArrayConcat tensorArrayConcat(Operand data type for {@code value} output * @param handle The handle to a TensorArray. * @param indices The locations in the TensorArray from which to read tensor elements. * @param flowIn A float scalar that enforces proper chaining of operations. @@ -6660,10 +7529,9 @@ public TensorArrayGradWithShape tensorArrayGradWithShape(Operand data type for {@code value} output - * @param handle the handle value - * @param flowIn the flowIn value - * @param dtype the value of the dtype property + * @param handle The handle value + * @param flowIn The flowIn value + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code TensorArrayPack} output and operands * @return a new instance of TensorArrayPack @@ -6676,9 +7544,8 @@ public TensorArrayPack tensorArrayPack(Operand han /** * Read an element from the TensorArray into output {@code value}. * - * @param data type for {@code value} output * @param handle The handle to a TensorArray. - * @param index the index value + * @param index The index value * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. * @param data type for {@code TensorArrayReadV3} output and operands @@ -6719,14 +7586,22 @@ public TensorArraySize tensorArraySize(Operand handle, /** * Split the data from the input value into TensorArray elements. * Assuming that {@code lengths} takes on values - *

    {@code (n0, n1, ..., n(T-1))} + *

    +   *  (n0, n1, ..., n(T-1))
    +   *  
    *

    and that {@code value} has shape - *

    {@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)}, + *

    +   *  (n0 + n1 + ... + n(T-1) x d0 x d1 x ...),
    +   *  
    *

    this splits values into a TensorArray with T tensors. *

    TensorArray index t will be the subtensor of values with starting position - *

    {@code (n0 + n1 + ... + n(t-1), 0, 0, ...)} + *

    +   *  (n0 + n1 + ... + n(t-1), 0, 0, ...)
    +   *  
    *

    and having size - *

    {@code nt x d0 x d1 x ...} + *

    +   *  nt x d0 x d1 x ...
    +   *  
    * * @param handle The handle to a TensorArray. * @param value The concatenated tensor to write to the TensorArray. @@ -6743,9 +7618,9 @@ public TensorArraySplit tensorArraySplit(Operand handle, /** * The TensorArrayUnpack operation * - * @param handle the handle value - * @param value the value value - * @param flowIn the flowIn value + * @param handle The handle value + * @param value The value value + * @param flowIn The flowIn value * @return a new instance of TensorArrayUnpack */ public TensorArrayUnpack tensorArrayUnpack(Operand handle, @@ -6780,11 +7655,10 @@ public TensorArrayWrite tensorArrayWrite(Operand handle, Operan * tensor: The concated result. * lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient. * - * @param data type for {@code tensor} output - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param leadingDims the leadingDims value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param leadingDims The leadingDims value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListConcatV2} output and operands * @return a new instance of TensorListConcat */ @@ -6797,9 +7671,9 @@ public TensorListConcat tensorListConcat( /** * The TensorListConcatLists operation * - * @param inputA the inputA value - * @param inputB the inputB value - * @param elementDtype the value of the elementDtype property + * @param inputA The inputA value + * @param inputB The inputB value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListConcatLists} output and operands * @return a new instance of TensorListConcatLists */ @@ -6813,9 +7687,8 @@ public TensorListConcatLists tensorListConcatLists( * input_handle: the list * element_shape: the shape of elements of the list * - * @param data type for {@code element_shape} output - * @param inputHandle the inputHandle value - * @param shapeType the value of the shapeType property + * @param inputHandle The inputHandle value + * @param shapeType The value of the shapeType attribute * @param data type for {@code TensorListElementShape} output and operands * @return a new instance of TensorListElementShape */ @@ -6830,8 +7703,8 @@ public TensorListElementShape tensorListElementShape( *

    tensor: The input tensor. * output_handle: The list. * - * @param tensor the tensor value - * @param elementShape the elementShape value + * @param tensor The tensor value + * @param elementShape The elementShape value * @return a new instance of TensorListFromTensor */ public TensorListFromTensor tensorListFromTensor(Operand tensor, @@ -6847,11 +7720,10 @@ public TensorListFromTensor tensorListFromTensor(Operand tensor * indices: The indices used to index into the list. * values: The tensor. * - * @param data type for {@code values} output - * @param inputHandle the inputHandle value - * @param indices the indices value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param indices The indices value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListGather} output and operands * @return a new instance of TensorListGather */ @@ -6862,13 +7734,15 @@ public TensorListGather tensorListGather( } /** - * The TensorListGetItem operation + * Returns the item in the list with the given index. + * input_handle: the list + * index: the position in the list from which an element will be retrieved + * item: the element at that position * - * @param data type for {@code item} output - * @param inputHandle the inputHandle value - * @param index the index value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param index The index value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListGetItem} output and operands * @return a new instance of TensorListGetItem */ @@ -6883,7 +7757,7 @@ public TensorListGetItem tensorListGetItem( * input_handle: the input list * length: the number of tensors in the list * - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of TensorListLength */ public TensorListLength tensorListLength(Operand inputHandle) { @@ -6898,10 +7772,9 @@ public TensorListLength tensorListLength(Operand inputHandle) { * element_dtype: the type of elements in the list * element_shape: the shape of the output tensor * - * @param data type for {@code tensor} output - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListPopBack} output and operands * @return a new instance of TensorListPopBack */ @@ -6918,8 +7791,8 @@ public TensorListPopBack tensorListPopBack( * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. * - * @param inputHandle the inputHandle value - * @param tensor the tensor value + * @param inputHandle The inputHandle value + * @param tensor The tensor value * @return a new instance of TensorListPushBack */ public TensorListPushBack tensorListPushBack(Operand inputHandle, @@ -6930,8 +7803,8 @@ public TensorListPushBack tensorListPushBack(Operand inputHandl /** * The TensorListPushBackBatch operation * - * @param inputHandles the inputHandles value - * @param tensor the tensor value + * @param inputHandles The inputHandles value + * @param tensor The tensor value * @return a new instance of TensorListPushBackBatch */ public TensorListPushBackBatch tensorListPushBackBatch(Operand inputHandles, @@ -6946,9 +7819,9 @@ public TensorListPushBackBatch tensorListPushBackBatch(Operand * handle: the output list * element_dtype: the desired type of elements in the list. * - * @param elementShape the elementShape value - * @param numElements the numElements value - * @param elementDtype the value of the elementDtype property + * @param elementShape The elementShape value + * @param numElements The numElements value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListReserve} output and operands * @return a new instance of TensorListReserve */ @@ -6962,8 +7835,8 @@ public TensorListReserve tensorListReserve( * input_handle: the input list * size: size of the output list * - * @param inputHandle the inputHandle value - * @param sizeOutput the sizeOutput value + * @param inputHandle The inputHandle value + * @param sizeOutput The sizeOutput value * @return a new instance of TensorListResize */ public TensorListResize tensorListResize(Operand inputHandle, @@ -6984,10 +7857,10 @@ public TensorListResize tensorListResize(Operand inputHandle, * the largest index in indices. * output_handle: The TensorList. * - * @param tensor the tensor value - * @param indices the indices value - * @param elementShape the elementShape value - * @param numElements the numElements value + * @param tensor The tensor value + * @param indices The indices value + * @param elementShape The elementShape value + * @param numElements The numElements value * @return a new instance of TensorListScatter */ public TensorListScatter tensorListScatter(Operand tensor, @@ -7005,9 +7878,9 @@ public TensorListScatter tensorListScatter(Operand tensor, * indices: The indices used to index into the list. * output_handle: The TensorList. * - * @param inputHandle the inputHandle value - * @param tensor the tensor value - * @param indices the indices value + * @param inputHandle The inputHandle value + * @param tensor The tensor value + * @param indices The indices value * @return a new instance of TensorListScatterIntoExistingList */ public TensorListScatterIntoExistingList tensorListScatterIntoExistingList( @@ -7017,16 +7890,21 @@ public TensorListScatterIntoExistingList tensorListScatterIntoExistingList( } /** - * The TensorListSetItem operation + * Sets the index-th position of the list to contain the given tensor. + * input_handle: the list + * index: the position in the list to which the tensor will be assigned + * item: the element to be assigned to that position + * output_handle: the new list, with the element in the proper position * - * @param inputHandle the inputHandle value - * @param index the index value - * @param item the item value + * @param inputHandle The inputHandle value + * @param index The index value + * @param item The item value + * @param options carries optional attribute values * @return a new instance of TensorListSetItem */ public TensorListSetItem tensorListSetItem(Operand inputHandle, - Operand index, Operand item) { - return TensorListSetItem.create(scope, inputHandle, index, item); + Operand index, Operand item, TensorListSetItem.Options... options) { + return TensorListSetItem.create(scope, inputHandle, index, item, options); } /** @@ -7038,9 +7916,9 @@ public TensorListSetItem tensorListSetItem(Operand inputHandle, * lengths: Vector of sizes of the 0th dimension of tensors in the list. * output_handle: The list. * - * @param tensor the tensor value - * @param elementShape the elementShape value - * @param lengths the lengths value + * @param tensor The tensor value + * @param elementShape The elementShape value + * @param lengths The lengths value * @return a new instance of TensorListSplit */ public TensorListSplit tensorListSplit(Operand tensor, @@ -7055,10 +7933,9 @@ public TensorListSplit tensorListSplit(Operand tensor, * tensor: the gathered result * num_elements: optional. If not -1, the number of elements in the list. * - * @param data type for {@code tensor} output - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param options carries optional attribute values * @param data type for {@code TensorListStack} output and operands * @return a new instance of TensorListStack @@ -7074,9 +7951,9 @@ public TensorListStack tensorListStack(Operand data type for {@code TensorMapErase} output and operands * @return a new instance of TensorMapErase */ @@ -7091,8 +7968,8 @@ public TensorMapErase tensorMapErase(Operand * key: the key to check * has_key: whether the key is already in the map or not * - * @param inputHandle the inputHandle value - * @param key the key value + * @param inputHandle The inputHandle value + * @param key The key value * @return a new instance of TensorMapHasKey */ public TensorMapHasKey tensorMapHasKey(Operand inputHandle, @@ -7107,9 +7984,9 @@ public TensorMapHasKey tensorMapHasKey(Operand inputHandle, * key: the key to be inserted * value: the value to be inserted * - * @param inputHandle the inputHandle value - * @param key the key value - * @param value the value value + * @param inputHandle The inputHandle value + * @param key The key value + * @param value The value value * @return a new instance of TensorMapInsert */ public TensorMapInsert tensorMapInsert(Operand inputHandle, @@ -7123,10 +8000,9 @@ public TensorMapInsert tensorMapInsert(Operand inputHandle, * key: the key to be looked up * value: the value found from the given key * - * @param data type for {@code value} output - * @param inputHandle the inputHandle value - * @param key the key value - * @param valueDtype the value of the valueDtype property + * @param inputHandle The inputHandle value + * @param key The key value + * @param valueDtype The value of the valueDtype attribute * @param data type for {@code TensorMapLookup} output and operands * @return a new instance of TensorMapLookup */ @@ -7140,7 +8016,7 @@ public TensorMapLookup tensorMapLookup(Operand inputHandle) { @@ -7152,9 +8028,8 @@ public TensorMapSize tensorMapSize(Operand inputHandle) { * input_handle: the input map * keys: the returned Tensor of all keys in the map * - * @param data type for {@code keys} output - * @param inputHandle the inputHandle value - * @param keyDtype the value of the keyDtype property + * @param inputHandle The inputHandle value + * @param keyDtype The value of the keyDtype attribute * @param data type for {@code TensorMapStackKeys} output and operands * @return a new instance of TensorMapStackKeys */ @@ -7167,9 +8042,9 @@ public TensorMapStackKeys tensorMapStackKeys( * Adds sparse {@code updates} to an existing tensor according to {@code indices}. * This operation creates a new tensor by adding sparse {@code updates} to the passed * in {@code tensor}. - * This operation is very similar to {@code tf.compat.v1.scatter_nd_add}, except that the updates - * are added onto an existing tensor (as opposed to a variable). If the memory - * for the existing tensor cannot be re-used, a copy is made and updated. + * This operation is very similar to {@code tf.compat.v1.scatter_nd_add}, except that the + * updates are added onto an existing tensor (as opposed to a variable). If the + * memory for the existing tensor cannot be re-used, a copy is made and updated. *

    {@code indices} is an integer tensor containing indices into a new tensor of shape * {@code tensor.shape}. The last dimension of {@code indices} can be at most the rank of * {@code tensor.shape}: @@ -7183,85 +8058,114 @@ public TensorMapStackKeys tensorMapStackKeys( *

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

    The simplest form of tensor_scatter_add is to add individual elements to a + *

    The simplest form of {@code tensor_scatter_nd_add} is to add individual elements to a * tensor by index. For example, say we want to add 4 elements in a rank-1 * tensor with 8 elements. *

    In Python, this scatter add 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)
    -   *      updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
    -   *      print(updated)
    -   *  
    - *

    The resulting tensor would look like this: - *

    -   *  [1, 12, 1, 11, 10, 1, 1, 13]
    -   *  
    + *
    + *
    + *
    + *

    indices = tf.constant([[4], [3], [1], [7]]) + * updates = tf.constant([9, 10, 11, 12]) + * tensor = tf.ones([8], dtype=tf.int32) + * updated = tf.tensor_scatter_nd_add(tensor, indices, updates) + * updated + * <tf.Tensor: shape=(8,), dtype=int32, + * numpy=array([ 1, 12, 1, 11, 10, 1, 1, 13], 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 add 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)
    -   *      updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
    -   *      print(updated)
    -   *  
    - *

    The resulting tensor would look like this: - *

    -   *  [[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
    -   *   [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
    -   *   [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
    -   *   [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
    -   *  
    - *

    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. + *

    + *
    + *
    + *

    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) + * updated = tf.tensor_scatter_nd_add(tensor, indices, updates) + * updated + * <tf.Tensor: shape=(4, 4, 4), dtype=int32, + * numpy=array([[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], + * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], + * [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], + * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]], dtype=int32)> + *

    + *
    + *
    + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
    6. + *
    * - * @param data type for {@code output} output * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterAdd} output and operands * @return a new instance of TensorScatterNdAdd */ public TensorScatterNdAdd tensorScatterNdAdd(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterNdAdd.create(scope, tensor, indices, updates); + Operand indices, Operand updates, + TensorScatterNdAdd.Options... options) { + return TensorScatterNdAdd.create(scope, tensor, indices, updates, options); } /** - * The TensorScatterMax operation + * Apply a sparse update to a tensor taking the element-wise maximum. + * Returns a new tensor copied from {@code tensor} whose values are element-wise maximum between + * tensor and updates according to the indices. + *
    + *
    + *
    + *

    tensor = [0, 0, 0, 0, 0, 0, 0, 0] + * indices = [[1], [4], [5]] + * updates = [1, -1, 1] + * tf.tensor_scatter_nd_max(tensor, indices, updates).numpy() + * array([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32) + *

    + *
    + *
    + *

    Refer to {@code tf.tensor_scatter_nd_update} for more details. * - * @param data type for {@code output} output * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterMax} output and operands * @return a new instance of TensorScatterNdMax */ public TensorScatterNdMax tensorScatterNdMax(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterNdMax.create(scope, tensor, indices, updates); + Operand indices, Operand updates, + TensorScatterNdMax.Options... options) { + return TensorScatterNdMax.create(scope, tensor, indices, updates, options); } /** * The TensorScatterMin operation * - * @param data type for {@code output} output * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterMin} output and operands * @return a new instance of TensorScatterNdMin */ public TensorScatterNdMin tensorScatterNdMin(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterNdMin.create(scope, tensor, indices, updates); + Operand indices, Operand updates, + TensorScatterNdMin.Options... options) { + return TensorScatterNdMin.create(scope, tensor, indices, updates, options); } /** @@ -7322,16 +8226,17 @@ public TensorScatterNdMin tensorScatterNdMin(Operand ten *

    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. * - * @param data type for {@code output} output * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterSub} output and operands * @return a new instance of TensorScatterNdSub */ public TensorScatterNdSub tensorScatterNdSub(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterNdSub.create(scope, tensor, indices, updates); + Operand indices, Operand updates, + TensorScatterNdSub.Options... options) { + return TensorScatterNdSub.create(scope, tensor, indices, updates, options); } /** @@ -7342,7 +8247,6 @@ 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 {@code indices} contains duplicates, then we pick the last update for the index. - *

    If an out of bound index is found on CPU, an error is returned. *

    WARNING: There are some GPU specific semantics for this operation. *

      *
    • If an out of bound index is found, the index is ignored.
    • @@ -7364,18 +8268,29 @@ public TensorScatterNdSub tensorScatterNdSub(Operand ten *
          *  indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
          *  
      + *

      If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

        + *
      1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
      2. + *
      3. "ERROR": raises error; GPU does not support this value.
      4. + *
      5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
      6. + *
      *

      For usage examples see the python tf.tensor_scatter_nd_update {@link org.tensorflow.op.Ops#tensorScatterNdUpdate} function * - * @param data type for {@code output} output * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterUpdate} output and operands * @return a new instance of TensorScatterNdUpdate */ public TensorScatterNdUpdate tensorScatterNdUpdate(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterNdUpdate.create(scope, tensor, indices, updates); + Operand indices, Operand updates, + TensorScatterNdUpdate.Options... options) { + return TensorScatterNdUpdate.create(scope, tensor, indices, updates, options); } /** @@ -7386,12 +8301,11 @@ public TensorScatterNdUpdate tensorScatterNdUpdate(Operand< *

      NOTE this op currently does not support broadcasting and so {@code value}'s shape * must be exactly the shape produced by the slice of {@code input}. * - * @param data type for {@code output} output - * @param input the input value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param input The input value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code TensorStridedSliceUpdate} output and operands * @param data type for {@code TensorStridedSliceUpdate} output and operands @@ -7437,8 +8351,7 @@ public TensorStridedSliceUpdate tensorSt * * * - * @param data type for {@code output} output - * @param input 1-D or higher. + * @param input Can be of any rank. * @param multiples 1-D. Length must be the same as the number of dimensions in {@code input} * @param data type for {@code Tile} output and operands * @return a new instance of Tile @@ -7450,8 +8363,16 @@ public Tile tile(Operand input, OperandNote: the timestamp is computed when the op is executed, not when it is added - * to the graph. + *

      Common usages include: + *

        + *
      • Logging
      • + *
      • Providing a random number seed
      • + *
      • Debugging graph execution
      • + *
      • Generating timing information, mainly through comparison of timestamps
      • + *
      + *

      Note: In graph mode, the timestamp is computed when the op is executed, + * not when it is added to the graph. In eager mode, the timestamp is computed + * when the op is eagerly executed. * * @return a new instance of Timestamp */ @@ -7474,8 +8395,8 @@ public Timestamp timestamp() { * padding value will be returned. The semantics are not the same as * kth_order_statistic. * - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKUnique */ public TopKUnique topKUnique(Operand input, Long k) { @@ -7490,8 +8411,8 @@ public TopKUnique topKUnique(Operand input, Long k) { * of K and the input size. NaNs are never returned. Subnormal numbers are flushed * to zero. * - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKWithUnique */ public TopKWithUnique topKWithUnique(Operand input, Long k) { @@ -7518,11 +8439,10 @@ public TopKWithUnique topKWithUnique(Operand input, Long k) { * assumed to possibly belong to the same batch. If left empty, the op name will * be used as the shared name. * - * @param data type for {@code unbatched_tensor} output - * @param batchedTensor the batchedTensor value - * @param batchIndex the batchIndex value - * @param id the id value - * @param timeoutMicros the value of the timeoutMicros property + * @param batchedTensor The batchedTensor value + * @param batchIndex The batchIndex value + * @param id The id value + * @param timeoutMicros The value of the timeoutMicros attribute * @param options carries optional attribute values * @param data type for {@code Unbatch} output and operands * @return a new instance of Unbatch @@ -7548,11 +8468,10 @@ public Unbatch unbatch(Operand batchedTensor, Operand data type for {@code batched_grad} output - * @param originalInput the originalInput value - * @param batchIndex the batchIndex value - * @param grad the grad value - * @param id the id value + * @param originalInput The originalInput value + * @param batchIndex The batchIndex value + * @param grad The grad value + * @param id The id value * @param options carries optional attribute values * @param data type for {@code UnbatchGrad} output and operands * @return a new instance of UnbatchGrad @@ -7563,6 +8482,34 @@ public UnbatchGrad unbatchGrad(Operand originalInput, return UnbatchGrad.create(scope, originalInput, batchIndex, grad, id, options); } + /** + * Perform clip by value on the quantized Tensor {@code operand}. + * Given quantized {@code operand} which was quantized using {@code scales} and {@code zero_points}, performs clip by value using {@code min} and {@code max} values. + * If quantization_axis is -1 (per-tensor quantized), the entire operand is clipped using scalar min, max. + * Otherwise (per-channel quantized), the clipping is also done per-channel. + * + * @param operand Must be a Tensor of T. + * @param min The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param max The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param scales The float value(s) used as scale(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) used as zero_point(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Same shape condition as scales. + * @param quantizationMinVal The quantization min value that was used when operand was quantized. + * @param quantizationMaxVal The quantization max value that was used when operand was quantized. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedClipByValue} output and operands + * @return a new instance of UniformQuantizedClipByValue + */ + public UniformQuantizedClipByValue uniformQuantizedClipByValue( + Operand operand, Operand min, Operand max, Operand scales, + Operand zeroPoints, Long quantizationMinVal, Long quantizationMaxVal, + UniformQuantizedClipByValue.Options... options) { + return UniformQuantizedClipByValue.create(scope, operand, min, max, scales, zeroPoints, quantizationMinVal, quantizationMaxVal, options); + } + /** * Finds unique elements along an axis of a tensor. * This operation either returns a tensor {@code y} containing unique elements @@ -7602,8 +8549,6 @@ public UnbatchGrad unbatchGrad(Operand originalInput, * idx ==> [0, 1, 1] * * - * @param data type for {@code y} output - * @param data type for {@code idx} output * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. @@ -7653,12 +8598,10 @@ public Unique unique(Operand x, Operand * - * @param data type for {@code y} output - * @param data type for {@code idx} output * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code UniqueV2} output and operands * @param data type for {@code UniqueV2} output and operands * @return a new instance of Unique @@ -7682,7 +8625,7 @@ public Unique unique(Operand x, *

      For example: *

          *  x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis = [0])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis = [0])
          *  y ==> [1, 2, 4, 7, 8]
          *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
          *  count ==> [2, 1, 3, 1, 2]
      @@ -7692,7 +8635,7 @@ public  Unique unique(Operand x,
          *  x = tf.constant([[1, 0, 0],
          *                  [1, 0, 0],
          *                  [2, 0, 0]])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis=[0])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
          *  y ==> [[1, 0, 0],
          *         [2, 0, 0]]
          *  idx ==> [0, 0, 1]
      @@ -7703,7 +8646,7 @@ public  Unique unique(Operand x,
          *  x = tf.constant([[1, 0, 0],
          *                  [1, 0, 0],
          *                  [2, 0, 0]])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis=[1])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[1])
          *  y ==> [[1, 0],
          *         [1, 0],
          *         [2, 0]]
      @@ -7711,8 +8654,6 @@ public  Unique unique(Operand x,
          *  count ==> [1, 2]
          *  
      * - * @param data type for {@code y} output - * @param data type for {@code idx} output * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. @@ -7738,7 +8679,7 @@ public UniqueWithCounts uniqueWithCounts(Operand *

      For example: *

          *  x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis = [0])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis = [0])
          *  y ==> [1, 2, 4, 7, 8]
          *  idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
          *  count ==> [2, 1, 3, 1, 2]
      @@ -7748,7 +8689,7 @@ public  UniqueWithCounts uniqueWithCounts(Operand
          *  x = tf.constant([[1, 0, 0],
          *                  [1, 0, 0],
          *                  [2, 0, 0]])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis=[0])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
          *  y ==> [[1, 0, 0],
          *         [2, 0, 0]]
          *  idx ==> [0, 0, 1]
      @@ -7759,7 +8700,7 @@ public  UniqueWithCounts uniqueWithCounts(Operand
          *  x = tf.constant([[1, 0, 0],
          *                  [1, 0, 0],
          *                  [2, 0, 0]])
      -   *  y, idx, count = UniqueWithCountsV2(x, axis=[1])
      +   *  y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[1])
          *  y ==> [[1, 0],
          *         [1, 0],
          *         [2, 0]]
      @@ -7767,12 +8708,10 @@ public  UniqueWithCounts uniqueWithCounts(Operand
          *  count ==> [1, 2]
          *  
      * - * @param data type for {@code y} output - * @param data type for {@code idx} output * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code UniqueWithCountsV2} output and operands * @param data type for {@code UniqueWithCountsV2} output and operands * @return a new instance of UniqueWithCounts @@ -7802,7 +8741,6 @@ public UniqueWithCounts uniqueWithCou * Equivalent to np.unravel_index *
      {@literal @}end_compatibility * - * @param data type for {@code output} output * @param indices An 0-D or 1-D {@code int} Tensor whose elements are indices into the * flattened version of an array of dimensions dims. * @param dims An 1-D {@code int} Tensor. The shape of the array to use for unraveling @@ -7826,9 +8764,8 @@ public UnravelIndex unravelIndex(Operand indices, Oper * Etc. *

      This is the opposite of {@code pack}. * - * @param data type for {@code output} output * @param value 1-D or higher, with {@code axis} dimension size equal to {@code num}. - * @param num the value of the num property + * @param num The value of the num attribute * @param options carries optional attribute values * @param data type for {@code Unpack} output and operands * @return a new instance of Unstack @@ -7843,7 +8780,7 @@ public Unstack unstack(Operand value, Long num, * The basic functionality is similar to dequeue with many fewer * capabilities and options. This Op is optimized for performance. * - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of Unstage */ @@ -7851,6 +8788,62 @@ public Unstage unstage(List> dtypes, Unstage.Options... o return Unstage.create(scope, dtypes, options); } + /** + * Applies upper_bound(sorted_search_values, values) along each row. + * Each set of rows with the same index in (sorted_inputs, values) is treated + * independently. The resulting row is the equivalent of calling + * {@code np.searchsorted(sorted_inputs, values, side='right')}. + *

      The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

      A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

      result = UpperBound(sorted_sequence, values) + *

      result == [[1, 2, 4], + * [0, 2, 5]] + * + * @param sortedInputs 2-D Tensor where each row is ordered. + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param data type for {@code UpperBound} output and operands + * @return a new instance of UpperBound, with default output types + */ + public UpperBound upperBound(Operand sortedInputs, + Operand values) { + return UpperBound.create(scope, sortedInputs, values); + } + + /** + * Applies upper_bound(sorted_search_values, values) along each row. + * Each set of rows with the same index in (sorted_inputs, values) is treated + * independently. The resulting row is the equivalent of calling + * {@code np.searchsorted(sorted_inputs, values, side='right')}. + *

      The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

      A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

      result = UpperBound(sorted_sequence, values) + *

      result == [[1, 2, 4], + * [0, 2, 5]] + * + * @param sortedInputs 2-D Tensor where each row is ordered. + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param outType The value of the outType attribute + * @param data type for {@code UpperBound} output and operands + * @param data type for {@code UpperBound} output and operands + * @return a new instance of UpperBound + */ + public UpperBound upperBound(Operand sortedInputs, + Operand values, Class outType) { + return UpperBound.create(scope, sortedInputs, values, outType); + } + /** * Creates a handle to a Variable resource. * @@ -7897,7 +8890,6 @@ public Variable variable(Operand init, Variable.Options. * TODO(zhifengc/mrry): Adds a pointer to a more detail document * about sharing states in tensorflow. * - * @param data type for {@code ref} output * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. * @param options carries optional attribute values @@ -7918,8 +8910,7 @@ public Variable variable(Shape shape, Class dtype, * shape(t) ==> [2, 2, 3] * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @return a new instance of VariableShape, with default output types */ public VariableShape variableShape(Operand input) { @@ -7935,9 +8926,8 @@ public VariableShape variableShape(Operand input) { * shape(t) ==> [2, 2, 3] * * - * @param data type for {@code output} output - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code VariableShape} output and operands * @return a new instance of VariableShape */ @@ -8006,7 +8996,7 @@ public VariableShape variableShape(Operand * - * @param condition the condition value + * @param condition The condition value * @return a new instance of Where */ public Where where(Operand condition) { @@ -8056,7 +9046,6 @@ public Zeros zeros(Operand dims, Class data type for {@code y} output * @param x a tensor of type T. * @param data type for {@code ZerosLike} output and operands * @return a new instance of ZerosLike @@ -8068,47 +9057,29 @@ public ZerosLike zerosLike(Operand x) { /** * Returns an API that builds operations with the provided name prefix. * - * @see {@link Scope#withSubScope(String)} + * @see Scope#withSubScope(String) */ public Ops withSubScope(String childScopeName) { return new Ops(scope.withSubScope(childScopeName)); } /** - * Returns an API that builds init operations. {@link #liftToInitScope(Operand)} will be called for all created operations. + * Returns an API that builds init operations. *

      * Init operations will be initialized at session creation, will have their inputs (and control inputs) made init ops as well, * and are ignored when used as control dependencies. * Additionally, this scope ignores any control dependencies. *

      * If an input can not be made an init op (i.e. a Placeholder), will throw an {@link IllegalStateException} on op creation. - * @see #liftToInitScope(Operand) */ public Ops withInitScope() { return new Ops(scope.withInitScope()); } - /** - * Make {@code op} an init operation, doing the same for all of it's inputs (and control inputs). - *

      - * Init operations will be initialized at session creation, will have their inputs (and control inputs) made init ops as well, - * and are ignored when used as control dependencies. - * Additionally, this scope ignores any control dependencies. - *

      - * If an input can not be made an init op (i.e. a Placeholder), will throw an {@link IllegalStateException} on op creation. - * @see ExecutionEnvironment#registerInitOp(Operation) - * - * @throws IllegalStateException if the op or one of its inputs can't be made an init op. - */ - public T liftToInitScope(T op) { - scope.env().registerInitOp(op.op()); - return op; - } - /** * Returns an API that uses the provided name for an op. * - * @see {@link Scope#withName(String)} + * @see Scope#withName(String) */ public Ops withName(String opName) { return new Ops(scope.withName(opName)); @@ -8117,7 +9088,7 @@ public Ops withName(String opName) { /** * Returns an API that places the created operations on the device(s) matching the provided spec. * - * @see {@link Scope#withDevice(DeviceSpec)} + * @see Scope#withDevice(DeviceSpec) */ public Ops withDevice(DeviceSpec deviceSpec) { return new Ops(scope.withDevice(deviceSpec)); @@ -8126,12 +9097,39 @@ public Ops withDevice(DeviceSpec deviceSpec) { /** * Returns an API that adds operations to the graph with the provided control dependencies. * - * @see {@link Scope#withControlDependencies(Iterable>)} + * @see Scope#withControlDependencies(Iterable) */ public Ops withControlDependencies(Iterable controls) { return new Ops(scope.withControlDependencies(controls)); } + /** + * Returns an API that adds operations to the graph with the provided control dependencies. + * + * @see Scope#withControlDependencies(Iterable) + */ + public Ops withControlDependencies(Op... controls) { + return withControlDependencies(Arrays.asList(controls)); + } + + /** + * Returns an API that adds operations to the graph with the provided control dependencies. + * + * @see Scope#withControlDependencyOps(Iterable) + */ + public Ops withControlDependencyOps(Iterable controls) { + return new Ops(scope.withControlDependencyOps(controls)); + } + + /** + * Returns an API that adds operations to the graph with the provided control dependencies. + * + * @see Scope#withControlDependencyOps(Iterable) + */ + public Ops withControlDependencyOps(Operation... controls) { + return withControlDependencyOps(Arrays.asList(controls)); + } + /** * Returns the current {@link Scope scope} of this API */ 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 fee68e6042d..88df6bf8a0e 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -32,8 +32,15 @@ import org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad; import org.tensorflow.op.quantization.QuantizeDownAndShrinkRange; import org.tensorflow.op.quantization.QuantizedConcat; +import org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndDequantize; +import org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndRequantize; import org.tensorflow.op.quantization.RequantizationRange; import org.tensorflow.op.quantization.Requantize; +import org.tensorflow.op.quantization.UniformDequantize; +import org.tensorflow.op.quantization.UniformQuantize; +import org.tensorflow.op.quantization.UniformQuantizedDot; +import org.tensorflow.op.quantization.UniformQuantizedDotHybrid; +import org.tensorflow.op.quantization.UniformRequantize; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -42,7 +49,7 @@ /** * An API for building {@code quantization} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class QuantizationOps { private final Scope scope; @@ -100,15 +107,14 @@ public final class QuantizationOps { * max_range / max_expected_T); * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. * @param options carries optional attribute values * @return a new instance of Dequantize, with default output types */ public Dequantize dequantize(Operand input, - Operand minRange, Operand maxRange, Dequantize.Options[] options) { + Operand minRange, Operand maxRange, Dequantize.Options... options) { return Dequantize.create(scope, input, minRange, maxRange, options); } @@ -158,8 +164,7 @@ public Dequantize dequantize(Operand input, * max_range / max_expected_T); * * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. * @param dtype Type of the output tensor. Currently Dequantize supports float and bfloat16. @@ -175,8 +180,11 @@ public Dequantize dequantize(Operand i } /** - * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. - * Attributes + * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same shape and type. + * Quantization is called fake since the output is still in floating point. + * The API converts inputs into values within the range [min and max] and returns + * as output. + *

      Attributes *

        *
      • {@code [min; max]} define the clamping range for the {@code inputs} data.
      • *
      • {@code inputs} values are quantized into the quantization range ( @@ -195,9 +203,29 @@ public Dequantize dequantize(Operand i *
      • If {@code min <= 0 <= max}: {@code scale = (max - min) / (2^num_bits - 1) }, * {@code min_adj = scale * round(min / scale)} and {@code max_adj = max + min_adj - min}.
      • *
      - *

      Quantization is called fake since the output is still in floating point. + *

      Examples + *

      +   *
      +   *  inp = tf.constant ([10.03, -10.23, 3])
      +   *  out = tf.quantization.fake_quant_with_min_max_args(inp, min=-5, max=5,
      +   *                                                     num_bits=16)
      +   *  print(out)
      +   *
      +   *  #  Output:
      +   *  #  tf.Tensor([ 4.9999237 -5.0000763  3.0000763], shape=(3,), dtype=float32)
      +   *  
      + *

      Raises: + *

        + *
      • InvalidArgumentError: + *
          + *
        • If num_bits are outside of range [2, 16].
        • + *
        • If min >= max.
        • + *
        + *
      • + *
      • ValueError: If {@code inputs} are of any other type than float32.
      • + *
      * - * @param inputs the inputs value + * @param inputs The inputs value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgs */ @@ -245,10 +273,32 @@ public FakeQuantWithMinMaxArgsGradient fakeQuantWithMinMaxArgsGradient( *
    *

    This operation has a gradient and thus allows for training {@code min} and {@code max} * values. + *

    + *
    + *
    + *

    constant_input = tf.constant([[1.2, -0.3, 0.7], [2.1, 0.5, -1.0]], dtype=tf.float32) + *

    min_val = -0.5 + * max_val = 0.8 + * num_bits = 8 + * narrow_range = False #False:for the quantization range [0; 2^num_bits - 1] + *

    quantized_data = tf.quantization.fake_quant_with_min_max_vars( + * ... inputs=constant_input, min=min_val, max=max_val, num_bits=num_bits, narrow_range=narrow_range + * ... ) + *

    print("Input:\n", constant_input.numpy()) + * Input: + * [[ 1.2 -0.3 0.7] + * [ 2.1 0.5 -1. ]] + * print("Output:\n", quantized_data.numpy()) + * Output: + * [[ 0.8003921 -0.3007843 0.6984313] + * [ 0.8003921 0.4996078 -0.4996078]] + *

    + *
    + *
    * - * @param inputs the inputs value - * @param min the min value - * @param max the max value + * @param inputs The inputs value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVars */ @@ -263,8 +313,8 @@ public FakeQuantWithMinMaxVars fakeQuantWithMinMaxVars(Operand inputs, * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation. * min, max: Quantization interval, scalar floats. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsGradient */ @@ -301,9 +351,9 @@ public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient( *

    This operation has a gradient and thus allows for training {@code min} and {@code max} * values. * - * @param inputs the inputs value - * @param min the min value - * @param max the max value + * @param inputs The inputs value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannel */ @@ -321,8 +371,8 @@ public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel( * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape * same as {@code gradients}. * min, max: Quantization interval, floats of shape {@code [d]}. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ @@ -426,8 +476,7 @@ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChann * The legacy default value for this is 0.01, but it is strongly suggested to * set it to 0 for new uses. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param minRange The minimum value of the quantization range. This value may be adjusted by the * op depending on other parameters. The adjusted value is written to {@code output_min}. * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size @@ -436,7 +485,7 @@ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChann * op depending on other parameters. The adjusted value is written to {@code output_max}. * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size * matches the {@code axis} dimension of the input and output tensors. - * @param T the value of the T property + * @param T The value of the T attribute * @param options carries optional attribute values * @param data type for {@code QuantizeV2} output and operands * @return a new instance of Quantize @@ -452,11 +501,10 @@ public Quantize quantize(Operand input, * 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 the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value - * @param numBits the numBits value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value + * @param numBits The numBits value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantize @@ -472,11 +520,10 @@ public QuantizeAndDequantize quantizeAndDequantize(Operan * 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 the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value - * @param numBits the numBits value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value + * @param numBits The numBits value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantizeV3 @@ -492,7 +539,6 @@ public QuantizeAndDequantizeV3 quantizeAndDequantizeV3(Op * 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 Tensor to quantize and then dequantize. * @param inputMin If {@code range_given == True}, this specifies the minimum input value that needs to * be represented, otherwise it is determined from the min value of the {@code input} @@ -514,11 +560,10 @@ public QuantizeAndDequantizeV4 quantizeAndDequantizeV4(Op * Returns a gradient of 1 for inputs that are within the quantization range, * or 0 otherwise. * - * @param data type for {@code input_backprop} output - * @param gradients the gradients value - * @param input the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value + * @param gradients The gradients value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV4Grad} output and operands * @return a new instance of QuantizeAndDequantizeV4Grad @@ -551,8 +596,7 @@ public QuantizeAndDequantizeV4Grad quantizeAndDequantizeV * that output into this operator, we can reduce it from 32 bits down to 8 with * minimal loss of accuracy. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. @@ -568,7 +612,6 @@ public QuantizeDownAndShrinkRange quantizeDownAndShrinkRa /** * Concatenates quantized tensors along one dimension. * - * @param data type for {@code output} output * @param concatDim 0-D. The dimension along which to concatenate. Must be in the * range [0, rank(values)). * @param values The {@code N} Tensors to concatenate. Their ranks and types must match, @@ -584,6 +627,58 @@ public QuantizedConcat quantizedConcat(Operand conc return QuantizedConcat.create(scope, concatDim, values, inputMins, inputMaxes); } + /** + * The QuantizedMatMulWithBiasAndDequantize operation + * + * @param a The a value + * @param b The b value + * @param bias The bias value + * @param minA The minA value + * @param maxA The maxA value + * @param minB The minB value + * @param maxB The maxB value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndDequantize} output and operands + * @return a new instance of QuantizedMatMulWithBiasAndDequantize + */ + public QuantizedMatMulWithBiasAndDequantize quantizedMatMulWithBiasAndDequantize( + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, + QuantizedMatMulWithBiasAndDequantize.Options... options) { + return QuantizedMatMulWithBiasAndDequantize.create(scope, a, b, bias, minA, maxA, minB, maxB, minFreezedOutput, maxFreezedOutput, Toutput, options); + } + + /** + * The QuantizedMatMulWithBiasAndRequantize operation + * + * @param a The a value + * @param b The b value + * @param bias The bias value + * @param minA The minA value + * @param maxA The maxA value + * @param minB The minB value + * @param maxB The maxB value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndRequantize} output and operands + * @return a new instance of QuantizedMatMulWithBiasAndRequantize + */ + public QuantizedMatMulWithBiasAndRequantize quantizedMatMulWithBiasAndRequantize( + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, + QuantizedMatMulWithBiasAndRequantize.Options... options) { + return QuantizedMatMulWithBiasAndRequantize.create(scope, a, b, bias, minA, maxA, minB, maxB, minFreezedOutput, maxFreezedOutput, Toutput, options); + } + /** * Computes a range that covers the actual values present in a quantized tensor. * Given a quantized tensor described by {@code (input, input_min, input_max)}, outputs a @@ -591,7 +686,7 @@ public QuantizedConcat quantizedConcat(Operand conc * used to produce the {@code requested_output_min} and {@code requested_output_max} for * {@code Requantize}. * - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @return a new instance of RequantizationRange @@ -610,8 +705,7 @@ public RequantizationRange requantizationRange(Operand input, * {@code input_max} is 1.0f, and we are dealing with {@code quint16} quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. * - * @param data type for {@code output} output - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param requestedOutputMin The float value that the minimum quantized output value represents. @@ -626,6 +720,198 @@ public Requantize requantize(Operand i return Requantize.create(scope, input, inputMin, inputMax, requestedOutputMin, requestedOutputMax, outType); } + /** + * Perform dequantization on the quantized Tensor {@code input}. + * Given quantized {@code input} which was quantized using {@code scales} and {@code zero_points}, performs dequantization using the formula: + * dequantized_data = (quantized_data - zero_point) * scale. + * + * @param input Must be a Tensor of Tin. + * @param scales The float value(s) used as scale(s) when quantizing original data that input represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) used as zero_point(s) when quantizing original data that input represents. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + * @param quantizationMinVal The quantization min value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param quantizationMaxVal The quantization max value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformDequantize} output and operands + * @return a new instance of UniformDequantize + */ + public UniformDequantize uniformDequantize( + Operand input, Operand scales, Operand zeroPoints, + Class Tout, Long quantizationMinVal, Long quantizationMaxVal, + UniformDequantize.Options... options) { + return UniformDequantize.create(scope, input, scales, zeroPoints, Tout, quantizationMinVal, quantizationMaxVal, options); + } + + /** + * Perform quantization on Tensor {@code input}. + * Given {@code input}, {@code scales} and {@code zero_points}, performs quantization using the formula: + * quantized_data = floor(input_data * (1.0f / scale) + 0.5f) + zero_point + * + * @param input Must be a Tensor of Tin. + * @param scales The float value(s) to use as scale(s) to quantize {@code input}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) to use as zero_point(s) to quantize {@code input}. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.float32 + * @param quantizationMinVal The quantization min value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param quantizationMaxVal The quantization max value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantize} output and operands + * @return a new instance of UniformQuantize + */ + public UniformQuantize uniformQuantize(Operand input, + Operand scales, Operand zeroPoints, Class Tout, Long quantizationMinVal, + Long quantizationMaxVal, UniformQuantize.Options... options) { + return UniformQuantize.create(scope, input, scales, zeroPoints, Tout, quantizationMinVal, quantizationMaxVal, options); + } + + /** + * Perform quantized dot of quantized Tensor {@code lhs} and quantized Tensor {@code rhs} to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized dot on {@code lhs} and {@code rhs} to make quantized {@code output}. + * {@code lhs} and {@code rhs} must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0). + * {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + * {@code output} is also quantized, using the same formula. + * If {@code rhs} is per-tensor quantized, {@code output} must be also per-tensor quantized. + * + * @param lhs Must be a 2D Tensor of Tin. + * @param rhs Must be a 2D Tensor of Tin. + * @param lhsScales The float value(s) used as scale when quantizing original data that lhs represents. + * Must be a scalar Tensor (lhs supports only per-tensor quantization). + * @param lhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that lhs represents. + * Same shape condition as lhs_scales. + * @param rhsScales The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + * @param outputScales The float value(s) to use as scales when quantizing original data that output represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (output.dim_size(1),) (per-channel quantization). + * If rhs is per-tensor quantized, output must be also per-tensor quantized. + * This means that if rhs_scales and rhs_zero_points are scalar Tensors, output_scales and output_zero_points must be scalar Tensors as well. + * @param outputZeroPoints The int32 value(s) used as zero_point when quantizing original data that output represents. + * Same shape condition as rhs_scales. + * @param Tout The type of output Tensor. + * @param lhsQuantizationMinVal The min value of the quantized data stored in lhs. + * For example, if Tin is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Tin is qint8, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedDot} output and operands + * @param data type for {@code UniformQuantizedDot} output and operands + * @return a new instance of UniformQuantizedDot + */ + public UniformQuantizedDot uniformQuantizedDot( + Operand lhs, Operand rhs, Operand lhsScales, Operand lhsZeroPoints, + Operand rhsScales, Operand rhsZeroPoints, Operand outputScales, + Operand outputZeroPoints, Class Tout, Long lhsQuantizationMinVal, + Long lhsQuantizationMaxVal, Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, + Long outputQuantizationMinVal, Long outputQuantizationMaxVal, + UniformQuantizedDot.Options... options) { + return UniformQuantizedDot.create(scope, lhs, rhs, lhsScales, lhsZeroPoints, rhsScales, rhsZeroPoints, outputScales, outputZeroPoints, Tout, lhsQuantizationMinVal, lhsQuantizationMaxVal, rhsQuantizationMinVal, rhsQuantizationMaxVal, outputQuantizationMinVal, outputQuantizationMaxVal, options); + } + + /** + * Perform hybrid quantized dot of float Tensor {@code lhs} and quantized Tensor {@code rhs}. + * Given float {@code lhs} and quantized {@code rhs}, internally performs quantization on {@code lhs}, and then performs quantized dot on quantized lhs and {@code rhs}. + * The internal quantization on {@code lhs} is a quantization to qint8, dynamic range, per-batch (per-axis along axis 0), asymmetric, and not narrow range (the range is [-128, 127]). + * {@code lhs} and {@code rhs} must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0). + * {@code rhs} must be quantized Tensor, where its data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + * + * @param lhs Must be a 2D Tensor of Tlhs. + * @param rhs Must be a 2D Tensor of Trhs. + * @param rhsScales The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + * @param Tout The type of output Tensor. + * @param rhsQuantizationMinVal The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedDotHybrid} output and operands + * @return a new instance of UniformQuantizedDotHybrid + */ + public UniformQuantizedDotHybrid uniformQuantizedDotHybrid( + Operand lhs, Operand rhs, Operand rhsScales, + Operand rhsZeroPoints, Class Tout, Long rhsQuantizationMinVal, + Long rhsQuantizationMaxVal, UniformQuantizedDotHybrid.Options... options) { + return UniformQuantizedDotHybrid.create(scope, lhs, rhs, rhsScales, rhsZeroPoints, Tout, rhsQuantizationMinVal, rhsQuantizationMaxVal, options); + } + + /** + * Given quantized tensor {@code input}, requantize it with new quantization parameters. + * Given quantized tensor {@code input}, which was quantized using {input_scales, input_zero_points, input_quantization_axis, input_quantization_min_val, input_quantization_max_val}, + * requantize it to a tensor, which is quantized using {output_scales, output_zero_points, output_quantization_axis, output_quantization_min_val, output_quantization_max_val}. + * The requantization is done by using the formula: + * output_quantized_data = clip( + * (input_quantized_data - input_zero_point) * (input_scale / output_scale) + output_zero_point, + * output_quantization_min_val, + * output_quantization_max_val) + *

    Per-tensor and per-axis quantization supported cases are followings: + *

      + *
    • per-tensor -> per-tensor
    • + *
    • per-tensor -> per-axis
    • + *
    • per-axis -> per-axis where input_quantization_axis equals output_quantization_axis. + * i.e. At least one among input_quantization_axis and output_quantization_axis must be -1, or two must be equal.
    • + *
    + * + * @param input Must be a Tensor of Tin. + * @param inputScales The float value(s) used as scale(s) when quantizing original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param inputZeroPoints The int32 value(s) used as zero_point(s) when quantizing original data that {@code input} represents. + * Same shape condition as scales. + * @param outputScales The float value(s) to use as new scale(s) to quantize original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param outputZeroPoints The int32 value(s) to use as new zero_point(s) to quantize original data that {@code input} represents. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + * @param inputQuantizationMinVal The quantization min value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param inputQuantizationMaxVal The quantization max value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param outputQuantizationMinVal The new quantization min value to quantize original data that {@code input} represents. + * @param outputQuantizationMaxVal The new quantization max value to quantize original data that {@code input} represents. + * @param options carries optional attribute values + * @param data type for {@code UniformRequantize} output and operands + * @return a new instance of UniformRequantize + */ + public UniformRequantize uniformRequantize( + Operand input, Operand inputScales, + Operand inputZeroPoints, Operand outputScales, + Operand outputZeroPoints, Class Tout, Long inputQuantizationMinVal, + Long inputQuantizationMaxVal, Long outputQuantizationMinVal, Long outputQuantizationMaxVal, + UniformRequantize.Options... options) { + return UniformRequantize.create(scope, input, inputScales, inputZeroPoints, outputScales, outputZeroPoints, Tout, inputQuantizationMinVal, inputQuantizationMaxVal, outputQuantizationMinVal, outputQuantizationMaxVal, options); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RaggedOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RaggedOps.java index 74397d04200..43b18f0cf57 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RaggedOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RaggedOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -17,15 +17,29 @@ // package org.tensorflow.op; +import java.util.List; import org.tensorflow.Operand; import org.tensorflow.op.ragged.RaggedBincount; +import org.tensorflow.op.ragged.RaggedCountSparseOutput; +import org.tensorflow.op.ragged.RaggedCross; +import org.tensorflow.op.ragged.RaggedFillEmptyRows; +import org.tensorflow.op.ragged.RaggedFillEmptyRowsGrad; +import org.tensorflow.op.ragged.RaggedGather; +import org.tensorflow.op.ragged.RaggedRange; +import org.tensorflow.op.ragged.RaggedTensorFromVariant; +import org.tensorflow.op.ragged.RaggedTensorToSparse; +import org.tensorflow.op.ragged.RaggedTensorToTensor; +import org.tensorflow.op.ragged.RaggedTensorToVariant; +import org.tensorflow.op.ragged.RaggedTensorToVariantGradient; +import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code ragged} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class RaggedOps { private final Scope scope; @@ -46,7 +60,6 @@ public final class RaggedOps { * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. * - * @param data type for {@code output} output * @param splits 1D int64 {@code Tensor}. * @param values 2D int {@code Tensor}. * @param sizeOutput non-negative int scalar {@code Tensor}. @@ -64,6 +77,363 @@ public RaggedBincount raggedBincount( return RaggedBincount.create(scope, splits, values, sizeOutput, weights, options); } + /** + * Performs sparse-output bin counting for a ragged tensor input. + * Counts the number of times each value occurs in the input. + * + * @param splits Tensor containing the row splits of the ragged tensor to count. + * @param values Tensor containing values of the sparse tensor to count. + * @param weights A Tensor of the same shape as indices containing per-index weight values. + * May also be the empty tensor if no weights are used. + * @param binaryOutput Whether to output the number of occurrences of each value or 1. + * @param options carries optional attribute values + * @param data type for {@code RaggedCountSparseOutput} output and operands + * @return a new instance of RaggedCountSparseOutput + */ + public RaggedCountSparseOutput raggedCountSparseOutput( + Operand splits, Operand values, Operand weights, + Boolean binaryOutput, RaggedCountSparseOutput.Options... options) { + return RaggedCountSparseOutput.create(scope, splits, values, weights, binaryOutput, options); + } + + /** + * Generates a feature cross from a list of tensors, and returns it as a + * RaggedTensor. See {@code tf.ragged.cross} for more details. + * + * @param raggedValues The values tensor for each RaggedTensor input. + * @param raggedRowSplits The row_splits tensor for each RaggedTensor input. + * @param sparseIndices The indices tensor for each SparseTensor input. + * @param sparseValues The values tensor for each SparseTensor input. + * @param sparseShape The dense_shape tensor for each SparseTensor input. + * @param denseInputs The tf.Tensor inputs. + * @param inputOrder String specifying the tensor type for each input. The {@code i}th character in + * this string specifies the type of the {@code i}th input, and is one of: 'R' (ragged), + * 'D' (dense), or 'S' (sparse). This attr is used to ensure that the crossed + * values are combined in the order of the inputs from the call to tf.ragged.cross. + * @param hashedOutput The value of the hashedOutput attribute + * @param numBuckets The value of the numBuckets attribute + * @param hashKey The value of the hashKey attribute + * @param outValuesType The value of the outValuesType attribute + * @param outRowSplitsType The value of the outRowSplitsType attribute + * @param data type for {@code RaggedCross} output and operands + * @param data type for {@code RaggedCross} output and operands + * @return a new instance of RaggedCross + */ + public RaggedCross raggedCross( + Iterable> raggedValues, Iterable> raggedRowSplits, + Iterable> sparseIndices, Iterable> sparseValues, + Iterable> sparseShape, Iterable> denseInputs, String inputOrder, + Boolean hashedOutput, Long numBuckets, Long hashKey, Class outValuesType, + Class outRowSplitsType) { + return RaggedCross.create(scope, raggedValues, raggedRowSplits, sparseIndices, sparseValues, sparseShape, denseInputs, inputOrder, hashedOutput, numBuckets, hashKey, outValuesType, outRowSplitsType); + } + + /** + * The RaggedFillEmptyRows operation + * + * @param valueRowids The valueRowids value + * @param values The values value + * @param nrows The nrows value + * @param defaultValue The defaultValue value + * @param data type for {@code RaggedFillEmptyRows} output and operands + * @return a new instance of RaggedFillEmptyRows + */ + public RaggedFillEmptyRows raggedFillEmptyRows(Operand valueRowids, + Operand values, Operand nrows, Operand defaultValue) { + return RaggedFillEmptyRows.create(scope, valueRowids, values, nrows, defaultValue); + } + + /** + * The RaggedFillEmptyRowsGrad operation + * + * @param reverseIndexMap The reverseIndexMap value + * @param gradValues The gradValues value + * @param data type for {@code RaggedFillEmptyRowsGrad} output and operands + * @return a new instance of RaggedFillEmptyRowsGrad + */ + public RaggedFillEmptyRowsGrad raggedFillEmptyRowsGrad( + Operand reverseIndexMap, Operand gradValues) { + return RaggedFillEmptyRowsGrad.create(scope, reverseIndexMap, gradValues); + } + + /** + * Gather ragged slices from {@code params} axis {@code 0} according to {@code indices}. + * Outputs a {@code RaggedTensor} output composed from {@code output_dense_values} and + * {@code output_nested_splits}, such that: + *

    +   *  output.shape = indices.shape + params.shape[1:]
    +   *  output.ragged_rank = indices.shape.ndims + params.ragged_rank
    +   *  output[i...j, d0...dn] = params[indices[i...j], d0...dn]
    +   *  
    + *

    where + *

      + *
    • {@code params = ragged.from_nested_row_splits(params_dense_values, params_nested_splits)} + * provides the values that should be gathered.
    • + *
    • {@code indices} ia a dense tensor with dtype {@code int32} or {@code int64}, indicating which + * values should be gathered.
    • + *
    • {@code output = ragged.from_nested_row_splits(output_dense_values, output_nested_splits)} + * is the output tensor.
    • + *
    + *

    (Note: This c++ op is used to implement the higher-level python + * {@code tf.ragged.gather} op, which also supports ragged indices.) + * + * @param paramsNestedSplits The {@code nested_row_splits} tensors that define the row-partitioning for the + * {@code params} RaggedTensor input. + * @param paramsDenseValues The {@code flat_values} for the {@code params} RaggedTensor. There was a terminology change + * at the python level from dense_values to flat_values, so dense_values is the + * deprecated name. + * @param indices Indices in the outermost dimension of {@code params} of the values that should be + * gathered. + * @param OUTPUTRAGGEDRANK The ragged rank of the output RaggedTensor. {@code output_nested_splits} will contain + * this number of {@code row_splits} tensors. This value should equal + * {@code indices.shape.ndims + params.ragged_rank - 1}. + * @param data type for {@code RaggedGather} output and operands + * @param data type for {@code RaggedGather} output and operands + * @return a new instance of RaggedGather + */ + public RaggedGather raggedGather( + Iterable> paramsNestedSplits, Operand paramsDenseValues, + Operand indices, Long OUTPUTRAGGEDRANK) { + return RaggedGather.create(scope, paramsNestedSplits, paramsDenseValues, indices, OUTPUTRAGGEDRANK); + } + + /** + * Returns a {@code RaggedTensor} containing the specified sequences of numbers. + * Returns a {@code RaggedTensor} {@code result} composed from {@code rt_dense_values} and + * {@code rt_nested_splits}, such that + * {@code result[i] = range(starts[i], limits[i], deltas[i])}. + *

    +   *  (rt_nested_splits, rt_dense_values) = ragged_range(
    +   *        starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)
    +   *  result = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)
    +   *  print(result)
    +   *  <tf.RaggedTensor [[2], [], [8, 9, 10, 11]] >
    +   *  
    + *

    The input tensors {@code starts}, {@code limits}, and {@code deltas} may be scalars or vectors. + * The vector inputs must all have the same size. Scalar inputs are broadcast + * to match the size of the vector inputs. + * + * @param starts The starts of each range. + * @param limits The limits of each range. + * @param deltas The deltas of each range. + * @param data type for {@code RaggedRange} output and operands + * @return a new instance of RaggedRange, with default output types + */ + public RaggedRange raggedRange(Operand starts, + Operand limits, Operand deltas) { + return RaggedRange.create(scope, starts, limits, deltas); + } + + /** + * Returns a {@code RaggedTensor} containing the specified sequences of numbers. + * Returns a {@code RaggedTensor} {@code result} composed from {@code rt_dense_values} and + * {@code rt_nested_splits}, such that + * {@code result[i] = range(starts[i], limits[i], deltas[i])}. + *

    +   *  (rt_nested_splits, rt_dense_values) = ragged_range(
    +   *        starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)
    +   *  result = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)
    +   *  print(result)
    +   *  <tf.RaggedTensor [[2], [], [8, 9, 10, 11]] >
    +   *  
    + *

    The input tensors {@code starts}, {@code limits}, and {@code deltas} may be scalars or vectors. + * The vector inputs must all have the same size. Scalar inputs are broadcast + * to match the size of the vector inputs. + * + * @param starts The starts of each range. + * @param limits The limits of each range. + * @param deltas The deltas of each range. + * @param Tsplits The value of the Tsplits attribute + * @param data type for {@code RaggedRange} output and operands + * @param data type for {@code RaggedRange} output and operands + * @return a new instance of RaggedRange + */ + public RaggedRange raggedRange(Operand starts, + Operand limits, Operand deltas, Class Tsplits) { + return RaggedRange.create(scope, starts, limits, deltas, Tsplits); + } + + /** + * Decodes a {@code variant} Tensor into a {@code RaggedTensor}. + * Decodes the given {@code variant} Tensor and returns a {@code RaggedTensor}. The input + * could be a scalar, meaning it encodes a single {@code RaggedTensor} with ragged_rank + * {@code output_ragged_rank}. It could also have an arbitrary rank, in which case each + * element is decoded into a {@code RaggedTensor} with ragged_rank {@code input_ragged_rank} + * and these are then stacked according to the input shape to output a single + * {@code RaggedTensor} with ragged_rank {@code output_ragged_rank}. Each {@code variant} element in + * the input Tensor is decoded by retrieving from the element a 1-D {@code variant} + * Tensor with {@code input_ragged_rank + 1} Tensors, corresponding to the splits and + * values of the decoded {@code RaggedTensor}. If {@code input_ragged_rank} is -1, then it is + * inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)}. See + * {@code RaggedTensorToVariant} for the corresponding encoding logic. + * + * @param encodedRagged A {@code variant} Tensor containing encoded {@code RaggedTensor}s. + * @param inputRaggedRank The ragged rank of each encoded {@code RaggedTensor} component in the input. If set to + * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} + * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: + * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. + * @param Tvalues The value of the Tvalues attribute + * @param data type for {@code RaggedTensorFromVariant} output and operands + * @return a new instance of RaggedTensorFromVariant, with default output types + */ + public RaggedTensorFromVariant raggedTensorFromVariant( + Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, + Class Tvalues) { + return RaggedTensorFromVariant.create(scope, encodedRagged, inputRaggedRank, outputRaggedRank, Tvalues); + } + + /** + * Decodes a {@code variant} Tensor into a {@code RaggedTensor}. + * Decodes the given {@code variant} Tensor and returns a {@code RaggedTensor}. The input + * could be a scalar, meaning it encodes a single {@code RaggedTensor} with ragged_rank + * {@code output_ragged_rank}. It could also have an arbitrary rank, in which case each + * element is decoded into a {@code RaggedTensor} with ragged_rank {@code input_ragged_rank} + * and these are then stacked according to the input shape to output a single + * {@code RaggedTensor} with ragged_rank {@code output_ragged_rank}. Each {@code variant} element in + * the input Tensor is decoded by retrieving from the element a 1-D {@code variant} + * Tensor with {@code input_ragged_rank + 1} Tensors, corresponding to the splits and + * values of the decoded {@code RaggedTensor}. If {@code input_ragged_rank} is -1, then it is + * inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)}. See + * {@code RaggedTensorToVariant} for the corresponding encoding logic. + * + * @param encodedRagged A {@code variant} Tensor containing encoded {@code RaggedTensor}s. + * @param inputRaggedRank The ragged rank of each encoded {@code RaggedTensor} component in the input. If set to + * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} + * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: + * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. + * @param Tvalues The value of the Tvalues attribute + * @param Tsplits The value of the Tsplits attribute + * @param data type for {@code RaggedTensorFromVariant} output and operands + * @param data type for {@code RaggedTensorFromVariant} output and operands + * @return a new instance of RaggedTensorFromVariant + */ + public RaggedTensorFromVariant raggedTensorFromVariant( + Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, + Class Tvalues, Class Tsplits) { + return RaggedTensorFromVariant.create(scope, encodedRagged, inputRaggedRank, outputRaggedRank, Tvalues, Tsplits); + } + + /** + * Converts a {@code RaggedTensor} into a {@code SparseTensor} with the same values. + * input=ragged.from_nested_row_splits(rt_dense_values, rt_nested_splits) + * output=SparseTensor(indices=sparse_indices, values=sparse_values, + * dense_shape=sparse_dense_shape) + * + * @param rtNestedSplits The {@code row_splits} for the {@code RaggedTensor}. + * @param rtDenseValues The {@code flat_values} for the {@code RaggedTensor}. + * @param data type for {@code RaggedTensorToSparse} output and operands + * @return a new instance of RaggedTensorToSparse + */ + public RaggedTensorToSparse raggedTensorToSparse( + Iterable> rtNestedSplits, Operand rtDenseValues) { + return RaggedTensorToSparse.create(scope, rtNestedSplits, rtDenseValues); + } + + /** + * Create a dense tensor from a ragged tensor, possibly altering its shape. + * The {@code ragged_to_dense} op creates a dense tensor from a list of row partition + * tensors, a value vector, and default values. If the shape is unspecified, the + * minimal shape required to contain all the elements in the ragged tensor (the + * natural shape) will be used. If some dimensions are left unspecified, then the + * size of the natural shape is used in that dimension. + *

    The default_value will be broadcast to the output shape. After that, the values + * from the ragged tensor overwrite the default values. Note that the default_value + * must have less dimensions than the value. + *

    The row partition tensors are in the order of the dimensions. + * At present, the types can be: + *

      + *
    • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
    • + *
    • "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor.
    • + *
    • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it + * is preceded by "FIRST_DIM_SIZE".
    • + *
    + * + * @param shape The desired shape of the output tensor. If left unspecified (empty), + * the minimal shape required to contain all the elements in the ragged tensor + * (the natural shape) will be used. If some dimensions are left unspecified, then + * the size of the natural shape is used in that dimension. + *

    Note that dense dimensions cannot be modified by the shape argument. Trying to + * change the size of a dense dimension will cause the op to fail. + * Examples: + * natural shape: [4, 5, 6] + * shape: -1 + * output shape: [4, 5, 6] + *

    natural shape: [4, 5, 6] + * shape: [3, -1, 2] + * output shape: [3, 5, 2] + *

    natural shape: [4, 5, 6] + * shape: [3, 7, 2] + * output shape: [3, 7, 2] + * @param values A 1D tensor representing the values of the ragged tensor. + * @param defaultValue The default_value when the shape is larger than the ragged tensor. The + * default_value is broadcast until it is the shape of the output tensor, and + * then overwritten by values in the ragged tensor. The default value must be + * compatible with this broadcast operation, and must have fewer dimensions than + * the value tensor. + * @param rowPartitionTensors The rowPartitionTensors value + * @param rowPartitionTypes The types of the row partition tensors. At present, these can be: + *

      + *
    • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
    • + *
    • "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor.
    • + *
    • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it + * is preceeded by "FIRST_DIM_SIZE". + * The tensors are in the order of the dimensions.
    • + *
    + * @param data type for {@code RaggedTensorToTensor} output and operands + * @return a new instance of RaggedTensorToTensor + */ + public RaggedTensorToTensor raggedTensorToTensor( + Operand shape, Operand values, Operand defaultValue, + Iterable> rowPartitionTensors, List rowPartitionTypes) { + return RaggedTensorToTensor.create(scope, shape, values, defaultValue, rowPartitionTensors, rowPartitionTypes); + } + + /** + * Encodes a {@code RaggedTensor} into a {@code variant} Tensor. + * Encodes the given {@code RaggedTensor} and returns a {@code variant} Tensor. If + * {@code batched_input} is True, then input {@code RaggedTensor} is unbatched along the + * zero-th dimension, each component {@code RaggedTensor} is encoded into a scalar + * {@code variant} Tensor, and these are stacked to return a 1-D {@code variant} Tensor. + * If {@code batched_input} is False, then the input {@code RaggedTensor} is encoded as is and + * a scalar {@code variant} Tensor is returned. A {@code RaggedTensor} is encoded by first + * creating a 1-D {@code variant} Tensor with {@code ragged_rank + 1} elements, containing the + * splits and values Tensors of the {@code RaggedTensor}. Then the 1-D {@code variant} Tensor + * is wrapped in a scalar {@code variant} Tensor. See {@code RaggedTensorFromVariant} for the + * corresponding decoding logic. + * + * @param rtNestedSplits A list of one or more Tensors representing the splits of the input + * {@code RaggedTensor}. + * @param rtDenseValues A Tensor representing the values of the input {@code RaggedTensor}. + * @param batchedInput A {@code bool} denoting whether the input is a batched {@code RaggedTensor}. + * @return a new instance of RaggedTensorToVariant + */ + public RaggedTensorToVariant raggedTensorToVariant( + Iterable> rtNestedSplits, Operand rtDenseValues, + Boolean batchedInput) { + return RaggedTensorToVariant.create(scope, rtNestedSplits, rtDenseValues, batchedInput); + } + + /** + * Helper used to compute the gradient for {@code 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 encodedRaggedGrad A {@code variant} Tensor containing encoded {@code 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 The value of the Tvalues attribute + * @param data type for {@code RaggedTensorToVariantGradient} output and operands + * @return a new instance of RaggedTensorToVariantGradient + */ + public RaggedTensorToVariantGradient raggedTensorToVariantGradient( + Operand encodedRaggedGrad, Operand rowSplits, + Operand denseValuesShape, Class Tvalues) { + return RaggedTensorToVariantGradient.create(scope, encodedRaggedGrad, rowSplits, denseValuesShape, Tvalues); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomExperimentalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomExperimentalOps.java new file mode 100644 index 00000000000..34d3585f270 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomExperimentalOps.java @@ -0,0 +1,70 @@ +// Copyright 2020-2022 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 org.tensorflow.Operand; +import org.tensorflow.op.random.experimental.StatelessShuffle; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code random.experimental} operations as {@link Op Op}s + * + * @see Ops + */ +public final class RandomExperimentalOps { + private final Scope scope; + + private final Ops ops; + + RandomExperimentalOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Randomly and deterministically shuffles a tensor along its first dimension. + * The tensor is shuffled along dimension 0, such that each {@code value[j]} is mapped + * to one and only one {@code output[i]}. For example, a mapping that might occur for a + * 3x2 tensor is: + *
    +   *  [[1, 2],       [[5, 6],
    +   *   [3, 4],  ==>   [1, 2],
    +   *   [5, 6]]        [3, 4]]
    +   *  
    + *

    The outputs are a deterministic function of {@code value}, {@code key}, {@code counter} and {@code alg}. + * + * @param value The tensor to be shuffled. + * @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 data type for {@code StatelessShuffle} output and operands + * @return a new instance of StatelessShuffle + */ + public StatelessShuffle statelessShuffle(Operand value, + Operand key, Operand counter, Operand alg) { + return StatelessShuffle.create(scope, value, key, counter, alg); + } + + /** + * 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/RandomOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java index 70d2d8995d2..6000af11c9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -19,24 +19,53 @@ import org.tensorflow.Operand; import org.tensorflow.op.random.AllCandidateSampler; +import org.tensorflow.op.random.AnonymousRandomSeedGenerator; +import org.tensorflow.op.random.AnonymousSeedGenerator; +import org.tensorflow.op.random.DeleteRandomSeedGenerator; +import org.tensorflow.op.random.DeleteSeedGenerator; +import org.tensorflow.op.random.DummySeedGenerator; import org.tensorflow.op.random.LogUniformCandidateSampler; import org.tensorflow.op.random.Multinomial; +import org.tensorflow.op.random.NonDeterministicInts; import org.tensorflow.op.random.ParameterizedTruncatedNormal; import org.tensorflow.op.random.RandomGamma; +import org.tensorflow.op.random.RandomGammaGrad; import org.tensorflow.op.random.RandomPoisson; import org.tensorflow.op.random.RandomShuffle; import org.tensorflow.op.random.RandomStandardNormal; import org.tensorflow.op.random.RandomUniform; import org.tensorflow.op.random.RandomUniformInt; import org.tensorflow.op.random.RecordInput; +import org.tensorflow.op.random.RngReadAndSkip; +import org.tensorflow.op.random.RngSkip; import org.tensorflow.op.random.StatefulRandomBinomial; import org.tensorflow.op.random.StatefulStandardNormal; +import org.tensorflow.op.random.StatefulTruncatedNormal; +import org.tensorflow.op.random.StatefulUniform; +import org.tensorflow.op.random.StatefulUniformFullInt; +import org.tensorflow.op.random.StatefulUniformInt; import org.tensorflow.op.random.StatelessMultinomial; +import org.tensorflow.op.random.StatelessParameterizedTruncatedNormal; +import org.tensorflow.op.random.StatelessRandomBinomial; +import org.tensorflow.op.random.StatelessRandomGamma; +import org.tensorflow.op.random.StatelessRandomGetAlg; +import org.tensorflow.op.random.StatelessRandomGetKeyCounter; +import org.tensorflow.op.random.StatelessRandomGetKeyCounterAlg; import org.tensorflow.op.random.StatelessRandomNormal; +import org.tensorflow.op.random.StatelessRandomNormalV2; +import org.tensorflow.op.random.StatelessRandomPoisson; import org.tensorflow.op.random.StatelessRandomUniform; +import org.tensorflow.op.random.StatelessRandomUniformFullInt; +import org.tensorflow.op.random.StatelessRandomUniformFullIntV2; +import org.tensorflow.op.random.StatelessRandomUniformInt; +import org.tensorflow.op.random.StatelessRandomUniformIntV2; +import org.tensorflow.op.random.StatelessRandomUniformV2; import org.tensorflow.op.random.StatelessTruncatedNormal; +import org.tensorflow.op.random.StatelessTruncatedNormalV2; +import org.tensorflow.op.random.ThreadUnsafeUnigramCandidateSampler; import org.tensorflow.op.random.TruncatedNormal; import org.tensorflow.op.random.UniformCandidateSampler; +import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -46,9 +75,11 @@ /** * An API for building {@code random} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class RandomOps { + public final RandomExperimentalOps experimental; + private final Scope scope; private final Ops ops; @@ -56,6 +87,7 @@ public final class RandomOps { RandomOps(Ops ops) { this.scope = ops.scope(); this.ops = ops; + experimental = new RandomExperimentalOps(ops); } /** @@ -83,6 +115,64 @@ public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long return AllCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, options); } + /** + * The AnonymousRandomSeedGenerator operation + * + * @param seed The seed value + * @param seed2 The seed2 value + * @return a new instance of AnonymousRandomSeedGenerator + */ + public AnonymousRandomSeedGenerator anonymousRandomSeedGenerator(Operand seed, + Operand seed2) { + return AnonymousRandomSeedGenerator.create(scope, seed, seed2); + } + + /** + * The AnonymousSeedGenerator operation + * + * @param seed The seed value + * @param seed2 The seed2 value + * @param reshuffle The reshuffle value + * @return a new instance of AnonymousSeedGenerator + */ + public AnonymousSeedGenerator anonymousSeedGenerator(Operand seed, Operand seed2, + Operand reshuffle) { + return AnonymousSeedGenerator.create(scope, seed, seed2, reshuffle); + } + + /** + * The DeleteRandomSeedGenerator operation + * + * @param handle The handle value + * @param deleter The deleter value + * @return a new instance of DeleteRandomSeedGenerator + */ + public DeleteRandomSeedGenerator deleteRandomSeedGenerator(Operand handle, + Operand deleter) { + return DeleteRandomSeedGenerator.create(scope, handle, deleter); + } + + /** + * The DeleteSeedGenerator operation + * + * @param handle The handle value + * @param deleter The deleter value + * @return a new instance of DeleteSeedGenerator + */ + public DeleteSeedGenerator deleteSeedGenerator(Operand handle, + Operand deleter) { + return DeleteSeedGenerator.create(scope, handle, deleter); + } + + /** + * The DummySeedGenerator operation + * + * @return a new instance of DummySeedGenerator + */ + public DummySeedGenerator dummySeedGenerator() { + return DummySeedGenerator.create(scope); + } + /** * Generates labels for candidate sampling with a log-uniform distribution. * See explanations of candidate sampling and the data formats at @@ -113,7 +203,6 @@ public LogUniformCandidateSampler logUniformCandidateSampler(Operand tru /** * Draws samples from a multinomial distribution. * - * @param data type for {@code output} output * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. @@ -121,18 +210,17 @@ public LogUniformCandidateSampler logUniformCandidateSampler(Operand tru * @return a new instance of Multinomial, with default output types */ public Multinomial multinomial(Operand logits, - Operand numSamples, Multinomial.Options[] options) { + Operand numSamples, Multinomial.Options... options) { return Multinomial.create(scope, logits, numSamples, options); } /** * Draws samples from a multinomial distribution. * - * @param data type for {@code output} output * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. - * @param outputDtype the value of the outputDtype property + * @param outputDtype The value of the outputDtype attribute * @param options carries optional attribute values * @param data type for {@code Multinomial} output and operands * @return a new instance of Multinomial @@ -142,12 +230,36 @@ public Multinomial multinomial(Operand return Multinomial.create(scope, logits, numSamples, outputDtype, options); } + /** + * Non-deterministically generates some integers. + * This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results. + * + * @param shape The shape of the output tensor. + * @return a new instance of NonDeterministicInts, with default output types + */ + public NonDeterministicInts nonDeterministicInts(Operand shape) { + return NonDeterministicInts.create(scope, shape); + } + + /** + * Non-deterministically generates some integers. + * This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results. + * + * @param shape The shape of the output tensor. + * @param dtype The type of the output. + * @param data type for {@code NonDeterministicInts} output and operands + * @return a new instance of NonDeterministicInts + */ + public NonDeterministicInts nonDeterministicInts( + Operand shape, Class dtype) { + return NonDeterministicInts.create(scope, shape, dtype); + } + /** * Outputs random values from a normal distribution. The parameters may each be a * scalar which applies to the entire output, or a vector of length shape[0] which * stores the parameters for each batch. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. Batches are indexed by the 0th dimension. * @param means The mean parameter of each batch. * @param stdevs The standard deviation parameter of each batch. Must be greater than 0. @@ -170,7 +282,6 @@ public ParameterizedTruncatedNormal parameterizedTruncate * transformation-rejection from pairs of uniform and normal random variables. * See http://dl.acm.org/citation.cfm?id=358414 * - * @param data type for {@code output} output * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in alpha. * @param alpha A tensor in which each scalar is a "shape" parameter describing the @@ -184,6 +295,19 @@ public RandomGamma randomGamma(Operand return RandomGamma.create(scope, shape, alpha, options); } + /** + * Computes the derivative of a Gamma random sample w.r.t. {@code alpha}. + * + * @param alpha The alpha value + * @param sample The sample value + * @param data type for {@code RandomGammaGrad} output and operands + * @return a new instance of RandomGammaGrad + */ + public RandomGammaGrad randomGammaGrad(Operand alpha, + Operand sample) { + return RandomGammaGrad.create(scope, alpha, sample); + } + /** * Outputs random values from the Poisson distribution(s) described by rate. * This op uses two algorithms, depending on rate. If rate >= 10, then @@ -195,7 +319,6 @@ public RandomGamma randomGamma(Operand * See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer * Programming, Volume 2. Addison Wesley * - * @param data type for {@code output} output * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in rate. * @param rate A tensor in which each scalar is a "rate" parameter describing the @@ -204,7 +327,7 @@ public RandomGamma randomGamma(Operand * @return a new instance of RandomPoisson, with default output types */ public RandomPoisson randomPoisson(Operand shape, - Operand rate, RandomPoisson.Options[] options) { + Operand rate, RandomPoisson.Options... options) { return RandomPoisson.create(scope, shape, rate, options); } @@ -219,12 +342,11 @@ public RandomPoisson randomPoisson(Operand shape, * See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer * Programming, Volume 2. Addison Wesley * - * @param data type for {@code output} output * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in rate. * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code RandomPoissonV2} output and operands * @return a new instance of RandomPoisson @@ -245,7 +367,6 @@ public RandomPoisson randomPoisson(Operand * - * @param data type for {@code output} output * @param value The tensor to be shuffled. * @param options carries optional attribute values * @param data type for {@code RandomShuffle} output and operands @@ -260,7 +381,6 @@ public RandomShuffle randomShuffle(Operand value, * Outputs random values from a normal distribution. * The generated values will have mean 0 and standard deviation 1. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param dtype The type of the output. * @param options carries optional attribute values @@ -277,7 +397,6 @@ public RandomStandardNormal randomStandardNormal( * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param dtype The type of the output. * @param options carries optional attribute values @@ -298,7 +417,6 @@ public RandomUniform randomUniform(Operand data type for {@code output} output * @param shape The shape of the output tensor. * @param minval 0-D. Inclusive lower bound on the generated integers. * @param maxval 0-D. Exclusive upper bound on the generated integers. @@ -322,15 +440,49 @@ public RecordInput recordInput(String filePattern, RecordInput.Options... option return RecordInput.create(scope, filePattern, options); } + /** + * Advance the counter of a counter-based RNG. + * The state of the RNG after + * {@code rng_read_and_skip(n)} will be the same as that after {@code uniform([n])} + * (or any other distribution). The actual increment added to the + * counter is an unspecified implementation choice. + *

    In the case that the input algorithm is RNG_ALG_AUTO_SELECT, the counter in the state needs to be of size int64[2], the current maximal counter size among algorithms. In this case, this op will manage the counter as if it is an 128-bit integer with layout [lower_64bits, higher_64bits]. If an algorithm needs less than 128 bits for the counter, it should use the left portion of the int64[2]. In this way, the int64[2] is compatible with all current RNG algorithms (Philox, ThreeFry and xla::RandomAlgorithm::RNG_DEFAULT). Downstream RNG ops can thus use this counter with any RNG algorithm. + * + * @param resource The handle of the resource variable that stores the state of the RNG. The state consists of the counter followed by the key. + * @param alg The RNG algorithm. + * @param delta The amount of advancement. + * @return a new instance of RngReadAndSkip + */ + public RngReadAndSkip rngReadAndSkip(Operand resource, Operand alg, + Operand delta) { + return RngReadAndSkip.create(scope, resource, alg, delta); + } + + /** + * Advance the counter of a counter-based RNG. + * The state of the RNG after + * {@code rng_skip(n)} will be the same as that after {@code stateful_uniform([n])} + * (or any other distribution). The actual increment added to the + * counter is an unspecified implementation detail. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param delta The amount of advancement. + * @return a new instance of RngSkip + */ + public RngSkip rngSkip(Operand resource, Operand algorithm, + Operand delta) { + return RngSkip.create(scope, resource, algorithm, delta); + } + /** * The StatefulRandomBinomial operation * - * @param data type for {@code output} output - * @param resource the resource value - * @param algorithm the algorithm value - * @param shape the shape value - * @param counts the counts value - * @param probs the probs value + * @param resource The resource value + * @param algorithm The algorithm value + * @param shape The shape value + * @param counts The counts value + * @param probs The probs value * @param data type for {@code StatefulRandomBinomial} output and operands * @return a new instance of StatefulRandomBinomial, with default output types */ @@ -343,13 +495,12 @@ public StatefulRandomBinomial statefulRandomBinomial /** * The StatefulRandomBinomial operation * - * @param data type for {@code output} output - * @param resource the resource value - * @param algorithm the algorithm value - * @param shape the shape value - * @param counts the counts value - * @param probs the probs value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param algorithm The algorithm value + * @param shape The shape value + * @param counts The counts value + * @param probs The probs value + * @param dtype The value of the dtype attribute * @param data type for {@code StatefulRandomBinomial} output and operands * @param data type for {@code StatefulRandomBinomial} output and operands * @return a new instance of StatefulRandomBinomial @@ -364,7 +515,6 @@ public StatefulRandomBinomial stateful * Outputs random values from a normal distribution. * The generated values will have mean 0 and standard deviation 1. * - * @param data type for {@code output} output * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. @@ -379,7 +529,6 @@ public StatefulStandardNormal statefulStandardNormal(Operand data type for {@code output} output * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. @@ -393,10 +542,117 @@ public StatefulStandardNormal statefulStandardNormal( return StatefulStandardNormal.create(scope, resource, algorithm, shape, dtype); } + /** + * Outputs random 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. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @return a new instance of StatefulTruncatedNormal, with default output types + */ + public StatefulTruncatedNormal statefulTruncatedNormal( + Operand resource, Operand algorithm, + Operand shape) { + return StatefulTruncatedNormal.create(scope, resource, algorithm, shape); + } + + /** + * Outputs random 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. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @param dtype The type of the output. + * @param data type for {@code StatefulTruncatedNormal} output and operands + * @return a new instance of StatefulTruncatedNormal + */ + public StatefulTruncatedNormal statefulTruncatedNormal( + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + return StatefulTruncatedNormal.create(scope, resource, algorithm, shape, dtype); + } + + /** + * Outputs random values from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The + * lower bound 0 is included in the range, while the upper bound 1 is excluded. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @return a new instance of StatefulUniform, with default output types + */ + public StatefulUniform statefulUniform(Operand resource, + Operand algorithm, Operand shape) { + return StatefulUniform.create(scope, resource, algorithm, shape); + } + + /** + * Outputs random values from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The + * lower bound 0 is included in the range, while the upper bound 1 is excluded. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @param dtype The type of the output. + * @param data type for {@code StatefulUniform} output and operands + * @return a new instance of StatefulUniform + */ + public StatefulUniform statefulUniform(Operand resource, + Operand algorithm, Operand shape, Class dtype) { + return StatefulUniform.create(scope, resource, algorithm, shape, dtype); + } + + /** + * Outputs random integers from a uniform distribution. + * The generated values are uniform integers covering the whole range of {@code dtype}. + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @param dtype The type of the output. + * @param data type for {@code StatefulUniformFullInt} output and operands + * @return a new instance of StatefulUniformFullInt + */ + public StatefulUniformFullInt statefulUniformFullInt( + Operand resource, Operand algorithm, Operand shape, + Class dtype) { + return StatefulUniformFullInt.create(scope, resource, algorithm, shape, dtype); + } + + /** + * Outputs random integers from a uniform distribution. + * The generated values are uniform integers in the range {@code [minval, maxval)}. + * The lower bound {@code minval} is included in the range, while the upper bound + * {@code maxval} is excluded. + *

    The random integers are slightly biased unless {@code maxval - minval} is an exact + * power of two. The bias is small for values of {@code maxval - minval} significantly + * smaller than the range of the output (either {@code 2^32} or {@code 2^64}). + * + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param algorithm The RNG algorithm. + * @param shape The shape of the output tensor. + * @param minval Minimum value (inclusive, scalar). + * @param maxval Maximum value (exclusive, scalar). + * @param data type for {@code StatefulUniformInt} output and operands + * @return a new instance of StatefulUniformInt + */ + public StatefulUniformInt statefulUniformInt( + Operand resource, Operand algorithm, Operand shape, + Operand minval, Operand maxval) { + return StatefulUniformInt.create(scope, resource, algorithm, shape, minval, maxval); + } + /** * Draws samples from a multinomial distribution. * - * @param data type for {@code output} output * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. @@ -411,12 +667,11 @@ public StatelessMultinomial statelessMultinomial(Operand data type for {@code output} output * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. * @param seed 2 seeds (shape [2]). - * @param outputDtype the value of the outputDtype property + * @param outputDtype The value of the outputDtype attribute * @param data type for {@code StatelessMultinomial} output and operands * @return a new instance of StatelessMultinomial */ @@ -426,12 +681,126 @@ public StatelessMultinomial statelessMultinomial( return StatelessMultinomial.create(scope, logits, numSamples, seed, outputDtype); } + /** + * The StatelessParameterizedTruncatedNormal operation + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param means The mean parameter of each batch. + * @param stddevs The standard deviation parameter of each batch. Must be greater than 0. + * @param minvals The minimum cutoff. May be -infinity. + * @param maxvals The maximum cutoff. May be +infinity, and must be more than the minval + * for each batch. + * @param data type for {@code StatelessParameterizedTruncatedNormal} output and operands + * @return a new instance of StatelessParameterizedTruncatedNormal + */ + public StatelessParameterizedTruncatedNormal statelessParameterizedTruncatedNormal( + Operand shape, Operand seed, Operand means, + Operand stddevs, Operand minvals, Operand maxvals) { + return StatelessParameterizedTruncatedNormal.create(scope, shape, seed, means, stddevs, minvals, maxvals); + } + + /** + * Outputs deterministic pseudorandom random numbers from a binomial distribution. + * Outputs random values from a binomial distribution. + *

    The outputs are a deterministic function of {@code shape}, {@code seed}, {@code counts}, and {@code probs}. + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param counts The counts of the binomial distribution. Must be broadcastable with {@code probs}, + * and broadcastable with the rightmost dimensions of {@code shape}. + * @param probs The probability of success for the binomial distribution. Must be broadcastable + * with {@code counts} and broadcastable with the rightmost dimensions of {@code shape}. + * @param data type for {@code StatelessRandomBinomial} output and operands + * @return a new instance of StatelessRandomBinomial, with default output types + */ + public StatelessRandomBinomial statelessRandomBinomial( + Operand shape, Operand seed, Operand counts, + Operand probs) { + return StatelessRandomBinomial.create(scope, shape, seed, counts, probs); + } + + /** + * Outputs deterministic pseudorandom random numbers from a binomial distribution. + * Outputs random values from a binomial distribution. + *

    The outputs are a deterministic function of {@code shape}, {@code seed}, {@code counts}, and {@code probs}. + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param counts The counts of the binomial distribution. Must be broadcastable with {@code probs}, + * and broadcastable with the rightmost dimensions of {@code shape}. + * @param probs The probability of success for the binomial distribution. Must be broadcastable + * with {@code counts} and broadcastable with the rightmost dimensions of {@code shape}. + * @param dtype The type of the output. + * @param data type for {@code StatelessRandomBinomial} output and operands + * @param data type for {@code StatelessRandomBinomial} output and operands + * @return a new instance of StatelessRandomBinomial + */ + public StatelessRandomBinomial statelessRandomBinomial( + Operand shape, Operand seed, Operand counts, + Operand probs, Class dtype) { + return StatelessRandomBinomial.create(scope, shape, seed, counts, probs, dtype); + } + + /** + * Outputs deterministic pseudorandom random numbers from a gamma distribution. + * Outputs random values from a gamma distribution. + *

    The outputs are a deterministic function of the inputs. + * + * @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 alpha The concentration of the gamma distribution. Shape must match the rightmost + * dimensions of {@code shape}. + * @param data type for {@code StatelessRandomGammaV3} output and operands + * @return a new instance of StatelessRandomGamma + */ + public StatelessRandomGamma statelessRandomGamma( + Operand shape, Operand key, + Operand counter, Operand alg, Operand alpha) { + return StatelessRandomGamma.create(scope, shape, key, counter, alg, alpha); + } + + /** + * Picks the best counter-based RNG algorithm based on device. + * This op picks the best counter-based RNG algorithm based on device. + * + * @return a new instance of StatelessRandomGetAlg + */ + public StatelessRandomGetAlg statelessRandomGetAlg() { + return StatelessRandomGetAlg.create(scope); + } + + /** + * Scrambles seed into key and counter, using the best algorithm based on device. + * This op scrambles a shape-[2] seed into a key and a counter, both needed by counter-based RNG algorithms. The scrambing uses the best algorithm based on device. 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). + * + * @param seed 2 seeds (shape [2]). + * @return a new instance of StatelessRandomGetKeyCounter + */ + public StatelessRandomGetKeyCounter statelessRandomGetKeyCounter( + Operand seed) { + return StatelessRandomGetKeyCounter.create(scope, seed); + } + + /** + * 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). + * + * @param seed 2 seeds (shape [2]). + * @return a new instance of StatelessRandomGetKeyCounterAlg + */ + public StatelessRandomGetKeyCounterAlg statelessRandomGetKeyCounterAlg( + Operand seed) { + return StatelessRandomGetKeyCounterAlg.create(scope, seed); + } + /** * 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 {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomNormal, with default output types @@ -446,7 +815,6 @@ public StatelessRandomNormal statelessRandomNormal(OperandThe outputs are a deterministic function of {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. @@ -458,13 +826,66 @@ public StatelessRandomNormal statelessRandomNormal( return StatelessRandomNormal.create(scope, shape, seed, dtype); } + /** + * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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, with default output types + */ + public StatelessRandomNormalV2 statelessRandomNormalV2(Operand shape, + Operand key, Operand counter, Operand alg) { + return StatelessRandomNormalV2.create(scope, shape, key, counter, alg); + } + + /** + * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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. + * @param data type for {@code StatelessRandomNormalV2} output and operands + * @return a new instance of StatelessRandomNormalV2 + */ + public StatelessRandomNormalV2 statelessRandomNormalV2( + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + return StatelessRandomNormalV2.create(scope, shape, key, counter, alg, dtype); + } + + /** + * Outputs deterministic pseudorandom random numbers from a Poisson distribution. + * Outputs random values from a Poisson distribution. + *

    The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code lam}. + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param lam The rate of the Poisson distribution. Shape must match the rightmost dimensions + * of {@code shape}. + * @param dtype The type of the output. + * @param data type for {@code StatelessRandomPoisson} output and operands + * @return a new instance of StatelessRandomPoisson + */ + public StatelessRandomPoisson statelessRandomPoisson( + Operand shape, Operand seed, + Operand lam, Class dtype) { + return StatelessRandomPoisson.create(scope, shape, seed, lam, dtype); + } + /** * Outputs deterministic pseudorandom random values from a uniform distribution. * The generated values follow a uniform distribution in the range {@code [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 {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomUniform, with default output types @@ -480,7 +901,6 @@ public StatelessRandomUniform statelessRandomUniform(OperandThe outputs are a deterministic function of {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. @@ -492,6 +912,117 @@ public StatelessRandomUniform statelessRandomUniform( return StatelessRandomUniform.create(scope, shape, seed, dtype); } + /** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + * The generated values are uniform integers covering the whole range of {@code dtype}. + *

    The outputs are a deterministic function of {@code shape} and {@code seed}. + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformFullInt} output and operands + * @return a new instance of StatelessRandomUniformFullInt + */ + public StatelessRandomUniformFullInt statelessRandomUniformFullInt( + Operand shape, Operand seed, Class dtype) { + return StatelessRandomUniformFullInt.create(scope, shape, seed, dtype); + } + + /** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + * The generated values are uniform integers covering the whole range of {@code dtype}. + *

    The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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. + * @param data type for {@code StatelessRandomUniformFullIntV2} output and operands + * @return a new instance of StatelessRandomUniformFullIntV2 + */ + public StatelessRandomUniformFullIntV2 statelessRandomUniformFullIntV2( + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + return StatelessRandomUniformFullIntV2.create(scope, shape, key, counter, alg, dtype); + } + + /** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [minval, maxval)}. + *

    The outputs are a deterministic function of {@code shape}, {@code seed}, {@code minval}, and {@code maxval}. + * + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param minval Minimum value (inclusive, scalar). + * @param maxval Maximum value (exclusive, scalar). + * @param data type for {@code StatelessRandomUniformInt} output and operands + * @return a new instance of StatelessRandomUniformInt + */ + public StatelessRandomUniformInt statelessRandomUniformInt( + Operand shape, Operand seed, Operand minval, + Operand maxval) { + return StatelessRandomUniformInt.create(scope, shape, seed, minval, maxval); + } + + /** + * Outputs deterministic pseudorandom random integers from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [minval, maxval)}. + *

    The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter}, {@code alg}, {@code minval} and {@code maxval}. + * + * @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). + * @param data type for {@code StatelessRandomUniformIntV2} output and operands + * @return a new instance of StatelessRandomUniformIntV2 + */ + public StatelessRandomUniformIntV2 statelessRandomUniformIntV2( + Operand shape, Operand key, + Operand counter, Operand alg, Operand minval, Operand maxval) { + return StatelessRandomUniformIntV2.create(scope, shape, key, counter, alg, minval, maxval); + } + + /** + * Outputs deterministic pseudorandom random values from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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, with default output types + */ + public StatelessRandomUniformV2 statelessRandomUniformV2( + Operand shape, Operand key, + Operand counter, Operand alg) { + return StatelessRandomUniformV2.create(scope, shape, key, counter, alg); + } + + /** + * Outputs deterministic pseudorandom random values from a uniform distribution. + * The generated values follow a uniform distribution in the range {@code [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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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. + * @param data type for {@code StatelessRandomUniformV2} output and operands + * @return a new instance of StatelessRandomUniformV2 + */ + public StatelessRandomUniformV2 statelessRandomUniformV2( + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + return StatelessRandomUniformV2.create(scope, shape, key, counter, alg, dtype); + } + /** * Outputs deterministic pseudorandom values from a truncated normal distribution. * The generated values follow a normal distribution with mean 0 and standard @@ -499,7 +1030,6 @@ public StatelessRandomUniform statelessRandomUniform( * deviations from the mean are dropped and re-picked. *

    The outputs are a deterministic function of {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessTruncatedNormal, with default output types @@ -516,7 +1046,6 @@ public StatelessTruncatedNormal statelessTruncatedNormal( * deviations from the mean are dropped and re-picked. *

    The outputs are a deterministic function of {@code shape} and {@code seed}. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. @@ -528,13 +1057,79 @@ public StatelessTruncatedNormal statelessTruncatedNormal( return StatelessTruncatedNormal.create(scope, shape, seed, dtype); } + /** + * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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, with default output types + */ + public StatelessTruncatedNormalV2 statelessTruncatedNormalV2( + Operand shape, Operand key, + Operand counter, Operand alg) { + return StatelessTruncatedNormalV2.create(scope, shape, key, counter, alg); + } + + /** + * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @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. + * @param data type for {@code StatelessTruncatedNormalV2} output and operands + * @return a new instance of StatelessTruncatedNormalV2 + */ + public StatelessTruncatedNormalV2 statelessTruncatedNormalV2( + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { + return StatelessTruncatedNormalV2.create(scope, shape, key, counter, alg, dtype); + } + + /** + * Generates labels for candidate sampling with a learned unigram distribution. + * See explanations of candidate sampling and the data formats at + * go/candidate-sampling. + *

    For each batch, this op picks a single set of sampled candidate labels. + *

    The advantages of sampling candidates per-batch are simplicity and the + * possibility of efficient dense matrix multiplication. The disadvantage is that + * the sampled candidates must be chosen independently of the context and of the + * true labels. + * + * @param trueClasses A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + * @param numTrue Number of true labels per context. + * @param numSampled Number of candidates to randomly sample. + * @param unique If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + * @param rangeMax The sampler will sample integers from the interval [0, range_max). + * @param options carries optional attribute values + * @return a new instance of ThreadUnsafeUnigramCandidateSampler + */ + public ThreadUnsafeUnigramCandidateSampler threadUnsafeUnigramCandidateSampler( + Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, + ThreadUnsafeUnigramCandidateSampler.Options... options) { + return ThreadUnsafeUnigramCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); + } + /** * Outputs random 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. * - * @param data type for {@code output} output * @param shape The shape of the output tensor. * @param dtype The type of the output. * @param options carries optional attribute values diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ShapeOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ShapeOps.java index 24a7cdca0e0..68cb802f86d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ShapeOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ShapeOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -28,7 +28,7 @@ /** * An API for building {@code shape} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class ShapeOps { private final Scope scope; @@ -388,7 +388,8 @@ public Operand tail(Shape shape, Class type) { * shape. * * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @return a 1-dimensional operand with the dimensions matching the first n dimensions of the * shape */ @@ -401,7 +402,8 @@ public Operand take(Shape shape, Operand n) { * shape. * * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @param type the shape datatype. * @param the shape datatype. * @return a 1-dimensional operand with the dimensions matching * the first n dimensions of the @@ -416,7 +418,8 @@ public Operand take(Shape shape, Operand n, Class Operand takeLast(Shape shape, Operand * shape. * * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @param type the shape datatype. * @param the shape datatype. * @return a 1-dimensional operand containing the dimensions matching the last n dimensions of the diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java index b18247b04eb..ac5703c264a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -27,15 +27,19 @@ import org.tensorflow.op.signal.Fft; import org.tensorflow.op.signal.Fft2d; import org.tensorflow.op.signal.Fft3d; +import org.tensorflow.op.signal.FftNd; import org.tensorflow.op.signal.Ifft; import org.tensorflow.op.signal.Ifft2d; import org.tensorflow.op.signal.Ifft3d; +import org.tensorflow.op.signal.IfftNd; import org.tensorflow.op.signal.Irfft; import org.tensorflow.op.signal.Irfft2d; import org.tensorflow.op.signal.Irfft3d; +import org.tensorflow.op.signal.IrfftNd; import org.tensorflow.op.signal.Rfft; import org.tensorflow.op.signal.Rfft2d; import org.tensorflow.op.signal.Rfft3d; +import org.tensorflow.op.signal.RfftNd; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -44,7 +48,7 @@ /** * An API for building {@code signal} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class SignalOps { private final Scope scope; @@ -59,7 +63,7 @@ public final class SignalOps { /** * The BatchFFT operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchFft */ public BatchFft batchFft(Operand input) { @@ -69,7 +73,7 @@ public BatchFft batchFft(Operand input) { /** * The BatchFFT2D operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchFft2d */ public BatchFft2d batchFft2d(Operand input) { @@ -79,7 +83,7 @@ public BatchFft2d batchFft2d(Operand input) { /** * The BatchFFT3D operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchFft3d */ public BatchFft3d batchFft3d(Operand input) { @@ -89,7 +93,7 @@ public BatchFft3d batchFft3d(Operand input) { /** * The BatchIFFT operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft */ public BatchIfft batchIfft(Operand input) { @@ -99,7 +103,7 @@ public BatchIfft batchIfft(Operand input) { /** * The BatchIFFT2D operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft2d */ public BatchIfft2d batchIfft2d(Operand input) { @@ -109,7 +113,7 @@ public BatchIfft2d batchIfft2d(Operand input) { /** * The BatchIFFT3D operation * - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft3d */ public BatchIfft3d batchIfft3d(Operand input) { @@ -121,7 +125,6 @@ public BatchIfft3d batchIfft3d(Operand input) { * Computes the 1-dimensional discrete Fourier transform over the inner-most * dimension of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code FFT} output and operands * @return a new instance of Fft @@ -135,7 +138,6 @@ public Fft fft(Operand input) { * Computes the 2-dimensional discrete Fourier transform over the inner-most * 2 dimensions of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code FFT2D} output and operands * @return a new instance of Fft2d @@ -149,7 +151,6 @@ public Fft2d fft2d(Operand input) { * Computes the 3-dimensional discrete Fourier transform over the inner-most 3 * dimensions of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code FFT3D} output and operands * @return a new instance of Fft3d @@ -158,12 +159,33 @@ public Fft3d fft3d(Operand input) { return Fft3d.create(scope, input); } + /** + * ND fast Fourier transform. + * Computes the n-dimensional discrete Fourier transform over + * designated dimensions of {@code input}. The designated dimensions of + * {@code input} are assumed to be the result of {@code signal.FftNd}. + *

    If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

    Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + * + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param data type for {@code FFTND} output and operands + * @return a new instance of FftNd + */ + public FftNd fftNd(Operand input, Operand fftLength, + Operand axes) { + return FftNd.create(scope, input, fftLength, axes); + } + /** * Inverse fast Fourier transform. * Computes the inverse 1-dimensional discrete Fourier transform over the * inner-most dimension of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code IFFT} output and operands * @return a new instance of Ifft @@ -177,7 +199,6 @@ public Ifft ifft(Operand input) { * Computes the inverse 2-dimensional discrete Fourier transform over the * inner-most 2 dimensions of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code IFFT2D} output and operands * @return a new instance of Ifft2d @@ -191,7 +212,6 @@ public Ifft2d ifft2d(Operand input) { * Computes the inverse 3-dimensional discrete Fourier transform over the * inner-most 3 dimensions of {@code input}. * - * @param data type for {@code output} output * @param input A complex tensor. * @param data type for {@code IFFT3D} output and operands * @return a new instance of Ifft3d @@ -200,6 +220,28 @@ public Ifft3d ifft3d(Operand input) { return Ifft3d.create(scope, input); } + /** + * ND inverse fast Fourier transform. + * Computes the n-dimensional inverse discrete Fourier transform over designated + * dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be + * the result of {@code signal.IfftNd}. + *

    If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

    Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + * + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param data type for {@code IFFTND} output and operands + * @return a new instance of IfftNd + */ + public IfftNd ifftNd(Operand input, Operand fftLength, + Operand axes) { + return IfftNd.create(scope, input, fftLength, axes); + } + /** * Inverse real-valued fast Fourier transform. * Computes the inverse 1-dimensional discrete Fourier transform of a real-valued @@ -214,7 +256,6 @@ public Ifft3d ifft3d(Operand input) { * than the corresponding dimension of {@code input}, the dimension is cropped. If it is * larger, the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. * @return a new instance of Irfft, with default output types @@ -237,10 +278,9 @@ public Irfft irfft(Operand input, Operand fft * than the corresponding dimension of {@code input}, the dimension is cropped. If it is * larger, the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT} output and operands * @return a new instance of Irfft */ @@ -264,7 +304,6 @@ public Irfft irfft(Operand input, * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. * @return a new instance of Irfft2d, with default output types @@ -288,10 +327,9 @@ public Irfft2d irfft2d(Operand input, Operand * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT2D} output and operands * @return a new instance of Irfft2d */ @@ -315,7 +353,6 @@ public Irfft2d irfft2d(Operand input, * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. * @return a new instance of Irfft3d, with default output types @@ -339,10 +376,9 @@ public Irfft3d irfft3d(Operand input, Operand * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT3D} output and operands * @return a new instance of Irfft3d */ @@ -351,6 +387,52 @@ public Irfft3d irfft3d(Operand input, return Irfft3d.create(scope, input, fftLength, Treal); } + /** + * ND inverse real fast Fourier transform. + * Computes the n-dimensional inverse real discrete Fourier transform over + * designated dimensions of {@code input}. The designated dimensions of {@code input} are + * assumed to be the result of {@code signal.IrfftNd}. The inner-most dimension contains the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. + *

    If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

    Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + * + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @return a new instance of IrfftNd, with default output types + */ + public IrfftNd irfftNd(Operand input, Operand fftLength, + Operand axes) { + return IrfftNd.create(scope, input, fftLength, axes); + } + + /** + * ND inverse real fast Fourier transform. + * Computes the n-dimensional inverse real discrete Fourier transform over + * designated dimensions of {@code input}. The designated dimensions of {@code input} are + * assumed to be the result of {@code signal.IrfftNd}. The inner-most dimension contains the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. + *

    If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

    Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + * + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFTND} output and operands + * @return a new instance of IrfftNd + */ + public IrfftNd irfftNd(Operand input, + Operand fftLength, Operand axes, Class Treal) { + return IrfftNd.create(scope, input, fftLength, axes, Treal); + } + /** * Real-valued fast Fourier transform. * Computes the 1-dimensional discrete Fourier transform of a real-valued signal @@ -362,10 +444,9 @@ public Irfft3d irfft3d(Operand input, * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT} output and operands * @return a new instance of Rfft */ @@ -386,10 +467,9 @@ public Rfft rfft(Operand input, Operand< * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT2D} output and operands * @return a new instance of Rfft2d */ @@ -410,10 +490,9 @@ public Rfft2d rfft2d(Operand input, * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. * - * @param data type for {@code output} output * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT3D} output and operands * @return a new instance of Rfft3d */ @@ -422,6 +501,30 @@ public Rfft3d rfft3d(Operand input, return Rfft3d.create(scope, input, fftLength, Tcomplex); } + /** + * ND fast real Fourier transform. + * Computes the n-dimensional real discrete Fourier transform over designated + * dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be + * the result of {@code signal.RfftNd}. The length of the last axis transformed will be + * fft_length[-1]//2+1. + *

    If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

    Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + * + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param Tcomplex The value of the Tcomplex attribute + * @param data type for {@code RFFTND} output and operands + * @return a new instance of RfftNd + */ + public RfftNd rfftNd(Operand input, + Operand fftLength, Operand axes, Class Tcomplex) { + return RfftNd.create(scope, input, fftLength, axes, Tcomplex); + } + /** * Get the parent {@link Ops} object. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java index 074cb7119d1..f6f83acce58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -17,13 +17,18 @@ // package org.tensorflow.op; +import java.util.List; import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.sparse.AddManySparseToTensorsMap; import org.tensorflow.op.sparse.AddSparseToTensorsMap; +import org.tensorflow.op.sparse.ConvertToListOfSparseCoreCooTensors; +import org.tensorflow.op.sparse.ConvertToSparseCoreCsrWrappedCooTensor; +import org.tensorflow.op.sparse.DenseCountSparseOutput; import org.tensorflow.op.sparse.DenseToDenseSetOperation; import org.tensorflow.op.sparse.DenseToSparseSetOperation; import org.tensorflow.op.sparse.DeserializeSparse; +import org.tensorflow.op.sparse.GetStatsFromListOfSparseCoreCooTensors; import org.tensorflow.op.sparse.SparseAccumulatorApplyGradient; import org.tensorflow.op.sparse.SparseAccumulatorTakeGradient; import org.tensorflow.op.sparse.SparseAdd; @@ -31,6 +36,7 @@ import org.tensorflow.op.sparse.SparseBincount; import org.tensorflow.op.sparse.SparseConcat; import org.tensorflow.op.sparse.SparseConditionalAccumulator; +import org.tensorflow.op.sparse.SparseCountSparseOutput; import org.tensorflow.op.sparse.SparseCross; import org.tensorflow.op.sparse.SparseCrossHashed; import org.tensorflow.op.sparse.SparseDenseCwiseAdd; @@ -66,6 +72,7 @@ import org.tensorflow.op.sparse.SparseToSparseSetOperation; import org.tensorflow.op.sparse.TakeManySparseFromTensorsMap; import org.tensorflow.types.TBool; +import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -75,7 +82,7 @@ /** * An API for building {@code sparse} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class SparseOps { private final Scope scope; @@ -149,6 +156,74 @@ public AddSparseToTensorsMap addSparseToTensorsMap(Operand sparseIndices return AddSparseToTensorsMap.create(scope, sparseIndices, sparseValues, sparseShape, options); } + /** + * The ConvertToListOfSparseCoreCooTensors operation + * + * @param indicesOrRowSplits The indicesOrRowSplits value + * @param values The values value + * @param weights The weights value + * @param sampleCount The value of the sampleCount attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param rowOffset The value of the rowOffset attribute + * @param colOffset The value of the colOffset attribute + * @param colShift The value of the colShift attribute + * @param numScShards The value of the numScShards attribute + * @param stackedTableSampleCount The value of the stackedTableSampleCount attribute + * @param combiner The value of the combiner attribute + * @return a new instance of ConvertToListOfSparseCoreCooTensors + */ + public ConvertToListOfSparseCoreCooTensors convertToListOfSparseCoreCooTensors( + Operand indicesOrRowSplits, Operand values, Operand weights, + Long sampleCount, Long numScPerChip, Long rowOffset, Long colOffset, Long colShift, + Long numScShards, Long stackedTableSampleCount, String combiner) { + return ConvertToListOfSparseCoreCooTensors.create(scope, indicesOrRowSplits, values, weights, sampleCount, numScPerChip, rowOffset, colOffset, colShift, numScShards, stackedTableSampleCount, combiner); + } + + /** + * The ConvertToSparseCoreCsrWrappedCooTensor operation + * + * @param sortedRowIdsList The sortedRowIdsList value + * @param sortedColIdsList The sortedColIdsList value + * @param sortedGainsList The sortedGainsList value + * @param idCountsList The idCountsList value + * @param splits The splits value + * @param sampleCountPerSc The value of the sampleCountPerSc attribute + * @param numReplica The value of the numReplica attribute + * @param maxMinibatchesPerSc The value of the maxMinibatchesPerSc attribute + * @param maxIdsPerChipPerSample The value of the maxIdsPerChipPerSample attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param tableName The value of the tableName attribute + * @param allowIdDropping The value of the allowIdDropping attribute + * @return a new instance of ConvertToSparseCoreCsrWrappedCooTensor + */ + public ConvertToSparseCoreCsrWrappedCooTensor convertToSparseCoreCsrWrappedCooTensor( + Iterable> sortedRowIdsList, Iterable> sortedColIdsList, + Iterable> sortedGainsList, Iterable> idCountsList, + Operand splits, Long sampleCountPerSc, Long numReplica, Long maxMinibatchesPerSc, + Long maxIdsPerChipPerSample, Long tableVocabSize, Long featureWidth, String tableName, + Boolean allowIdDropping) { + return ConvertToSparseCoreCsrWrappedCooTensor.create(scope, sortedRowIdsList, sortedColIdsList, sortedGainsList, idCountsList, splits, sampleCountPerSc, numReplica, maxMinibatchesPerSc, maxIdsPerChipPerSample, tableVocabSize, featureWidth, tableName, allowIdDropping); + } + + /** + * Performs sparse-output bin counting for a tf.tensor input. + * Counts the number of times each value occurs in the input. + * + * @param values Tensor containing data to count. + * @param weights A Tensor of the same shape as indices containing per-index weight values. May + * also be the empty tensor if no weights are used. + * @param binaryOutput Whether to output the number of occurrences of each value or 1. + * @param options carries optional attribute values + * @param data type for {@code DenseCountSparseOutput} output and operands + * @return a new instance of DenseCountSparseOutput + */ + public DenseCountSparseOutput denseCountSparseOutput( + Operand values, Operand weights, Boolean binaryOutput, + DenseCountSparseOutput.Options... options) { + return DenseCountSparseOutput.create(scope, values, weights, binaryOutput, options); + } + /** * Applies set operation along last dimension of 2 {@code Tensor} inputs. * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. @@ -158,12 +233,11 @@ public AddSparseToTensorsMap addSparseToTensorsMap(Operand sparseIndices * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. * - * @param data type for {@code result_values} output * @param set1 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. * @param set2 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set1}. * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code DenseToDenseSetOperation} output and operands * @return a new instance of DenseToDenseSetOperation @@ -188,7 +262,6 @@ public DenseToDenseSetOperation denseToDenseSetOperation(Op * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. * - * @param data type for {@code result_values} output * @param set1 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. * @param set2Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major @@ -198,7 +271,7 @@ public DenseToDenseSetOperation denseToDenseSetOperation(Op * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must * be the same as the 1st {@code n-1} dimensions of {@code set1}, {@code result_shape[n]} is the * max set size across {@code n-1} dimensions. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code DenseToSparseSetOperation} output and operands * @return a new instance of DenseToSparseSetOperation @@ -251,7 +324,6 @@ public DenseToSparseSetOperation denseToSparseSetOperation( * shape = [2 50] * * - * @param data type for {@code sparse_values} output * @param serializedSparse The serialized {@code SparseTensor} objects. The last dimension * must have 3 columns. * @param dtype The {@code dtype} of the serialized {@code SparseTensor} objects. @@ -263,6 +335,29 @@ public DeserializeSparse deserializeSparse( return DeserializeSparse.create(scope, serializedSparse, dtype); } + /** + * The GetStatsFromListOfSparseCoreCooTensors operation + * + * @param rowIdsList The rowIdsList value + * @param colIdsList The colIdsList value + * @param gainsList The gainsList value + * @param sampleCountList The value of the sampleCountList attribute + * @param colOffsetList The value of the colOffsetList attribute + * @param numReplica The value of the numReplica attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @return a new instance of GetStatsFromListOfSparseCoreCooTensors + */ + public GetStatsFromListOfSparseCoreCooTensors getStatsFromListOfSparseCoreCooTensors( + Iterable> rowIdsList, Iterable> colIdsList, + Iterable> gainsList, List sampleCountList, List colOffsetList, + Long numReplica, Long tableVocabSize, Long featureWidth, Long numScPerChip, + String tableName) { + return GetStatsFromListOfSparseCoreCooTensors.create(scope, rowIdsList, colIdsList, gainsList, sampleCountList, colOffsetList, numReplica, tableVocabSize, featureWidth, numScPerChip, tableName); + } + /** * Applies a sparse gradient to a given accumulator. * Does not add if local_step is smaller than the accumulator's @@ -296,7 +391,6 @@ public SparseAccumulatorApplyGradient sparseAccumulatorApplyGradient(Operand data type for {@code values} output * @param handle The handle to a SparseConditionalAccumulator. * @param numRequired Number of gradients required before we return an aggregate. * @param dtype The data type of accumulated gradients. Needs to correspond to the type @@ -323,7 +417,6 @@ public SparseAccumulatorTakeGradient sparseAccumulatorTakeG * only for a positive value. *

    In the following shapes, {@code nnz} is the count after taking {@code thresh} into account. * - * @param data type for {@code sum_values} output * @param aIndices 2-D. The {@code indices} of the first {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. * @param aValues 1-D. The {@code values} of the first {@code SparseTensor}, size {@code [nnz]} Vector. * @param aShape 1-D. The {@code shape} of the first {@code SparseTensor}, size {@code [ndims]} Vector. @@ -348,7 +441,6 @@ public SparseAdd sparseAdd(Operand aIndices, Operan * non-empty values of the sum, and outputs the gradients w.r.t. the non-empty * values of A and B. * - * @param data type for {@code a_val_grad} output * @param backpropValGrad 1-D with shape {@code [nnz(sum)]}. The gradient with respect to * the non-empty values of the sum. * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor} A, size {@code [nnz(A), ndims]}. @@ -372,7 +464,6 @@ public SparseAddGrad sparseAddGrad(Operand backpropValGr * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. * - * @param data type for {@code output} output * @param indices 2D int64 {@code Tensor}. * @param values 1D int {@code Tensor}. * @param denseShape 1D int64 {@code Tensor}. @@ -431,7 +522,6 @@ public SparseBincount sparseBincount( * [b c ] [ ] [b c ] * * - * @param data type for {@code output_values} output * @param indices 2-D. Indices of each input {@code SparseTensor}. * @param values 1-D. Non-empty values of each {@code SparseTensor}. * @param shapes 1-D. Shapes of each {@code SparseTensor}. @@ -465,6 +555,26 @@ public SparseConditionalAccumulator sparseConditionalAccumulat return SparseConditionalAccumulator.create(scope, dtype, shape, options); } + /** + * Performs sparse-output bin counting for a sparse tensor input. + * Counts the number of times each value occurs in the input. + * + * @param indices Tensor containing the indices of the sparse tensor to count. + * @param values Tensor containing values of the sparse tensor to count. + * @param denseShape Tensor containing the dense shape of the sparse tensor to count. + * @param weights A Tensor of the same shape as indices containing per-index weight values. + * May also be the empty tensor if no weights are used. + * @param binaryOutput Whether to output the number of occurrences of each value or 1. + * @param options carries optional attribute values + * @param data type for {@code SparseCountSparseOutput} output and operands + * @return a new instance of SparseCountSparseOutput + */ + public SparseCountSparseOutput sparseCountSparseOutput( + Operand indices, Operand values, Operand denseShape, + Operand weights, Boolean binaryOutput, SparseCountSparseOutput.Options... options) { + return SparseCountSparseOutput.create(scope, indices, values, denseShape, weights, binaryOutput, options); + } + /** * Generates sparse cross from a list of sparse and dense tensors. * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each @@ -582,7 +692,6 @@ public SparseCrossHashed sparseCrossHashed(Iterable> indices, * indices and shape, but possibly with different non-zero values. The output of * this Op is the resultant non-zero values. * - * @param data type for {@code output} output * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. @@ -601,7 +710,6 @@ public SparseDenseCwiseAdd sparseDenseCwiseAdd(OperandLimitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. * - * @param data type for {@code output} output * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. @@ -623,7 +731,6 @@ public SparseDenseCwiseDiv sparseDenseCwiseDiv(OperandLimitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. * - * @param data type for {@code output} output * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. @@ -674,7 +781,6 @@ public SparseDenseCwiseMul sparseDenseCwiseMul(Operand * - * @param data type for {@code output_values} output * @param indices 2-D. the indices of the sparse tensor. * @param values 1-D. the values of the sparse tensor. * @param denseShape 1-D. the shape of the sparse tensor. @@ -699,7 +805,6 @@ public SparseFillEmptyRows sparseFillEmptyRows(Operand data type for {@code d_values} output * @param reverseIndexMap 1-D. The reverse index map from SparseFillEmptyRows. * @param gradValues 1-D. The gradients from backprop. * @param data type for {@code SparseFillEmptyRowsGrad} output and operands @@ -721,8 +826,8 @@ public SparseFillEmptyRowsGrad sparseFillEmptyRowsGrad( *

    The gradient computation of this operation will only take advantage of sparsity * in the input gradient when that gradient comes from a Relu. * - * @param a the a value - * @param b the b value + * @param a The a value + * @param b The b value * @param options carries optional attribute values * @return a new instance of SparseMatMul */ @@ -744,7 +849,6 @@ public SparseMatMul sparseMatMul(Operand a, Operand data type for {@code output} output * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. @@ -773,7 +877,6 @@ public SparseReduceMax sparseReduceMax(Operand in * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. * - * @param data type for {@code output_values} output * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. @@ -802,7 +905,6 @@ public SparseReduceMaxSparse sparseReduceMaxSparse( * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. * - * @param data type for {@code output} output * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. @@ -831,7 +933,6 @@ public SparseReduceSum sparseReduceSum(Operand inpu * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. * - * @param data type for {@code output_values} output * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. @@ -856,7 +957,6 @@ public SparseReduceSumSparse sparseReduceSumSparse( *

    If the tensor has rank {@code R} and {@code N} non-empty values, {@code input_indices} has * shape {@code [N, R]}, input_values has length {@code N}, and input_shape has length {@code R}. * - * @param data type for {@code output_values} output * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. @@ -901,35 +1001,37 @@ public SparseReshape sparseReshape(Operand inputIndices, Operand *

    Like {@code SegmentMean}, but {@code segment_ids} can have rank less than {@code data}'s first * dimension, selecting a subset of dimension 0, specified by {@code indices}. * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentMean} output and operands * @return a new instance of SparseSegmentMean */ public SparseSegmentMean sparseSegmentMean(Operand data, - Operand indices, Operand segmentIds) { - return SparseSegmentMean.create(scope, data, indices, segmentIds); + Operand indices, Operand segmentIds, + SparseSegmentMean.Options... options) { + return SparseSegmentMean.create(scope, data, indices, segmentIds, options); } /** * Computes gradients for SparseSegmentMean. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". * - * @param data type for {@code output} output * @param grad gradient propagated to the SparseSegmentMean op. * @param indices indices passed to the corresponding SparseSegmentMean op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentMean op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentMean op. - * @param data type for {@code SparseSegmentMeanGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentMean op. + * @param data type for {@code SparseSegmentMeanGradV2} output and operands + * @param data type for {@code SparseSegmentMeanGradV2} output and operands * @return a new instance of SparseSegmentMeanGrad */ - public SparseSegmentMeanGrad sparseSegmentMeanGrad(Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { - return SparseSegmentMeanGrad.create(scope, grad, indices, segmentIds, outputDim0); + public SparseSegmentMeanGrad sparseSegmentMeanGrad( + Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { + return SparseSegmentMeanGrad.create(scope, grad, indices, segmentIds, denseOutputDim0); } /** @@ -940,18 +1042,18 @@ public SparseSegmentMeanGrad sparseSegmentMeanGrad(Operan * the section on segmentation * for an explanation of segments. * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentMeanWithNumSegments} output and operands * @return a new instance of SparseSegmentMeanWithNumSegments */ public SparseSegmentMeanWithNumSegments sparseSegmentMeanWithNumSegments( Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { - return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments); + Operand numSegments, SparseSegmentMeanWithNumSegments.Options... options) { + return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options); } /** @@ -959,35 +1061,37 @@ public SparseSegmentMeanWithNumSegments sparseSegmentMean * N is the size of the segment being reduced. *

    See {@code tf.sparse.segment_sum} for usage examples. * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSqrtN} output and operands * @return a new instance of SparseSegmentSqrtN */ public SparseSegmentSqrtN sparseSegmentSqrtN(Operand data, - Operand indices, Operand segmentIds) { - return SparseSegmentSqrtN.create(scope, data, indices, segmentIds); + Operand indices, Operand segmentIds, + SparseSegmentSqrtN.Options... options) { + return SparseSegmentSqrtN.create(scope, data, indices, segmentIds, options); } /** * Computes gradients for SparseSegmentSqrtN. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". * - * @param data type for {@code output} output * @param grad gradient propagated to the SparseSegmentSqrtN op. * @param indices indices passed to the corresponding SparseSegmentSqrtN op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentSqrtN op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. - * @param data type for {@code SparseSegmentSqrtNGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. + * @param data type for {@code SparseSegmentSqrtNGradV2} output and operands + * @param data type for {@code SparseSegmentSqrtNGradV2} output and operands * @return a new instance of SparseSegmentSqrtNGrad */ - public SparseSegmentSqrtNGrad sparseSegmentSqrtNGrad(Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { - return SparseSegmentSqrtNGrad.create(scope, grad, indices, segmentIds, outputDim0); + public SparseSegmentSqrtNGrad sparseSegmentSqrtNGrad( + Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { + return SparseSegmentSqrtNGrad.create(scope, grad, indices, segmentIds, denseOutputDim0); } /** @@ -999,18 +1103,19 @@ public SparseSegmentSqrtNGrad sparseSegmentSqrtNGrad(Oper * the section on segmentation * for an explanation of segments. * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSqrtNWithNumSegments} output and operands * @return a new instance of SparseSegmentSqrtNWithNumSegments */ public SparseSegmentSqrtNWithNumSegments sparseSegmentSqrtNWithNumSegments( Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { - return SparseSegmentSqrtNWithNumSegments.create(scope, data, indices, segmentIds, numSegments); + Operand numSegments, + SparseSegmentSqrtNWithNumSegments.Options... options) { + return SparseSegmentSqrtNWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options); } /** @@ -1042,35 +1147,37 @@ public SparseSegmentSqrtNWithNumSegments sparseSegmentSqr * tf.segment_sum(c, tf.constant([0, 0, 1])) * * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSum} output and operands * @return a new instance of SparseSegmentSum */ public SparseSegmentSum sparseSegmentSum(Operand data, - Operand indices, Operand segmentIds) { - return SparseSegmentSum.create(scope, data, indices, segmentIds); + Operand indices, Operand segmentIds, + SparseSegmentSum.Options... options) { + return SparseSegmentSum.create(scope, data, indices, segmentIds, options); } /** * Computes gradients for SparseSegmentSum. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". * - * @param data type for {@code output} output * @param grad gradient propagated to the SparseSegmentSum op. * @param indices indices passed to the corresponding SparseSegmentSum op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentSum op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSum op. - * @param data type for {@code SparseSegmentSumGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentSum op. + * @param data type for {@code SparseSegmentSumGradV2} output and operands + * @param data type for {@code SparseSegmentSumGradV2} output and operands * @return a new instance of SparseSegmentSumGrad */ - public SparseSegmentSumGrad sparseSegmentSumGrad(Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { - return SparseSegmentSumGrad.create(scope, grad, indices, segmentIds, outputDim0); + public SparseSegmentSumGrad sparseSegmentSumGrad( + Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { + return SparseSegmentSumGrad.create(scope, grad, indices, segmentIds, denseOutputDim0); } /** @@ -1100,18 +1207,18 @@ public SparseSegmentSumGrad sparseSegmentSumGrad(Operand< * # [ 0 0 0 0]] * * - * @param data type for {@code output} output - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSumWithNumSegments} output and operands * @return a new instance of SparseSegmentSumWithNumSegments */ public SparseSegmentSumWithNumSegments sparseSegmentSumWithNumSegments( Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { - return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments); + Operand numSegments, SparseSegmentSumWithNumSegments.Options... options) { + return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments, options); } /** @@ -1133,7 +1240,6 @@ public SparseSegmentSumWithNumSegments sparseSegmentSumWi * [ ] * * - * @param data type for {@code output_values} output * @param indices 2-D tensor represents the indices of the sparse tensor. * @param values 1-D tensor represents the values of the sparse tensor. * @param shape 1-D. tensor represents the shape of the sparse tensor. @@ -1155,7 +1261,6 @@ public SparseSlice sparseSlice(Operand indices, Ope * the sliced {@code SparseTensor}, and outputs the gradients w.r.t. * the non-empty values of input {@code SparseTensor}. * - * @param data type for {@code val_grad} output * @param backpropValGrad 1-D. The gradient with respect to * the non-empty values of the sliced {@code SparseTensor}. * @param inputIndices 2-D. The {@code indices} of the input {@code SparseTensor}. @@ -1184,7 +1289,6 @@ public SparseSliceGrad sparseSliceGrad(Operand backpropV *

    Hence, the {@code SparseTensor} result has exactly the same non-zero indices and * shape. * - * @param data type for {@code output} output * @param spIndices 2-D. {@code NNZ x R} matrix with the indices of non-empty values in a * SparseTensor, in canonical ordering. * @param spValues 1-D. {@code NNZ} non-empty values corresponding to {@code sp_indices}. @@ -1201,7 +1305,6 @@ public SparseSoftmax sparseSoftmax(Operand spIndi * Returns the element-wise max of two SparseTensors. * Assumes the two SparseTensors have the same shape, i.e., no broadcasting. * - * @param data type for {@code output_values} output * @param aIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, in the canonical lexicographic ordering. * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. @@ -1222,7 +1325,6 @@ public SparseSparseMaximum sparseSparseMaximum(Operand data type for {@code output_values} output * @param aIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, in the canonical lexicographic ordering. * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. @@ -1260,7 +1362,6 @@ public SparseSparseMinimum sparseSparseMinimum(Operand * - * @param data type for {@code output_values} output * @param splitDim 0-D. The dimension along which to split. Must be in the range * {@code [0, rank(shape))}. * @param indices 2-D tensor represents the indices of the sparse tensor. @@ -1281,7 +1382,6 @@ public SparseSplit sparseSplit(Operand splitDim, * Adds up a {@code SparseTensor} and a dense {@code Tensor}, producing a dense {@code Tensor}. * This Op does not require {@code a_indices} be sorted in standard lexicographic order. * - * @param data type for {@code output} output * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor}, with shape {@code [nnz, ndims]}. * @param aValues 1-D. The {@code values} of the {@code SparseTensor}, with shape {@code [nnz]}. * @param aShape 1-D. The {@code shape} of the {@code SparseTensor}, with shape {@code [ndims]}. @@ -1306,7 +1406,6 @@ public SparseTensorDenseAdd sparseTensor * A should be sorted in order of increasing dimension 1 (i.e., "column major" * order instead of "row major" order). * - * @param data type for {@code product} output * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor}, size {@code [nnz, 2]} Matrix. * @param aValues 1-D. The {@code values} of the {@code SparseTensor}, size {@code [nnz]} Vector. * @param aShape 1-D. The {@code shape} of the {@code SparseTensor}, size {@code [2]} Vector. @@ -1340,7 +1439,6 @@ public SparseTensorDenseMatMul sparseTensorDenseMatMul( * contain any repeats. If {@code validate_indices} is true, these properties * are checked during execution. * - * @param data type for {@code dense} output * @param sparseIndices 0-D, 1-D, or 2-D. {@code sparse_indices[i]} contains the complete * index where {@code sparse_values[i]} will be placed. * @param outputShape 1-D. Shape of the dense output tensor. @@ -1380,7 +1478,6 @@ public SparseToDense sparseToDense( * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. * - * @param data type for {@code result_values} output * @param set1Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. * @param set1Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major @@ -1395,7 +1492,7 @@ public SparseToDense sparseToDense( * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must * be the same as {@code set1_shape[0...n-1]}, {@code set2_shape[n]} is the * max set size across {@code 0...n-1} dimensions. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code SparseToSparseSetOperation} output and operands * @return a new instance of SparseToSparseSetOperation @@ -1450,7 +1547,6 @@ public SparseToSparseSetOperation sparseToSparseSetOperatio * shape = [2 50] * * - * @param data type for {@code sparse_values} output * @param sparseHandles 1-D, The {@code N} serialized {@code SparseTensor} objects. * Shape: {@code [N]}. * @param dtype The {@code dtype} of the {@code SparseTensor} objects stored in 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 77caa699358..2b49dd474a3 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -24,6 +24,8 @@ import org.tensorflow.op.strings.ReduceJoin; import org.tensorflow.op.strings.RegexFullMatch; import org.tensorflow.op.strings.RegexReplace; +import org.tensorflow.op.strings.StaticRegexFullMatch; +import org.tensorflow.op.strings.StaticRegexReplace; import org.tensorflow.op.strings.StringFormat; import org.tensorflow.op.strings.StringLength; import org.tensorflow.op.strings.StringNGrams; @@ -34,19 +36,23 @@ import org.tensorflow.op.strings.ToHashBucketFast; import org.tensorflow.op.strings.ToHashBucketStrong; import org.tensorflow.op.strings.ToNumber; +import org.tensorflow.op.strings.UnicodeDecode; +import org.tensorflow.op.strings.UnicodeDecodeWithOffsets; +import org.tensorflow.op.strings.UnicodeEncode; import org.tensorflow.op.strings.UnicodeScript; import org.tensorflow.op.strings.UnicodeTranscode; import org.tensorflow.op.strings.UnsortedSegmentJoin; import org.tensorflow.op.strings.Upper; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * An API for building {@code strings} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class StringsOps { private final Scope scope; @@ -182,6 +188,37 @@ public RegexReplace regexReplace(Operand input, Operand patter return RegexReplace.create(scope, input, pattern, rewrite, options); } + /** + * Check if the input matches the regex pattern. + * The input is a string tensor of any shape. The pattern is the + * regular expression to be matched with every element of the input tensor. + * The boolean values (True or False) of the output tensor indicate + * if the input matches the regex pattern provided. + *

    The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + * + * @param input A string tensor of the text to be processed. + * @param pattern The regular expression to match the input. + * @return a new instance of StaticRegexFullMatch + */ + public StaticRegexFullMatch staticRegexFullMatch(Operand input, String pattern) { + return StaticRegexFullMatch.create(scope, input, pattern); + } + + /** + * Replaces the match of pattern in input with rewrite. + * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + * + * @param input The text to be processed. + * @param pattern The regular expression to match the input. + * @param rewrite The rewrite to be applied to the matched expression. + * @param options carries optional attribute values + * @return a new instance of StaticRegexReplace + */ + public StaticRegexReplace staticRegexReplace(Operand input, String pattern, + String rewrite, StaticRegexReplace.Options... options) { + return StaticRegexReplace.create(scope, input, pattern, rewrite, options); + } + /** * Formats a string template using a list of tensors. * Formats a string template using a list of tensors, pretty-printing tensor summaries. @@ -223,7 +260,6 @@ public StringLength stringLength(Operand input, StringLength.Options... * strings and outputs a ragged tensor with 1 ragged dimension containing ngrams * of that string, joined along the innermost axis. * - * @param data type for {@code ngrams_splits} output * @param data The values tensor of the ragged string tensor to make ngrams out of. Must be a * 1D string tensor. * @param dataSplits The splits tensor of the ragged string tensor to make ngrams out of. @@ -237,7 +273,7 @@ public StringLength stringLength(Operand input, StringLength.Options... * sequence. Note that padding will never be greater than 'ngram_widths'-1 * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} * elements. - * @param preserveShortSequences the value of the preserveShortSequences property + * @param preserveShortSequences The value of the preserveShortSequences attribute * @param data type for {@code StringNGrams} output and operands * @return a new instance of StringNGrams */ @@ -390,7 +426,7 @@ public Substr substr(Operand input, Operand pos, * This functionality will be deprecated and it's recommended to use * {@code tf.string_to_hash_bucket_fast()} or {@code tf.string_to_hash_bucket_strong()}. * - * @param stringTensor the stringTensor value + * @param stringTensor The stringTensor value * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ @@ -473,8 +509,7 @@ public ToHashBucketStrong toHashBucketStrong(Operand input, Long numBuc * * * - * @param data type for {@code output} output - * @param stringTensor the stringTensor value + * @param stringTensor The stringTensor value * @return a new instance of ToNumber, with default output types */ public ToNumber toNumber(Operand stringTensor) { @@ -496,8 +531,7 @@ public ToNumber toNumber(Operand stringTensor) { * * * - * @param data type for {@code output} output - * @param stringTensor the stringTensor value + * @param stringTensor The stringTensor value * @param outType The numeric type to interpret each string in {@code string_tensor} as. * @param data type for {@code StringToNumber} output and operands * @return a new instance of ToNumber @@ -506,6 +540,160 @@ public ToNumber toNumber(Operand stringTensor, C return ToNumber.create(scope, stringTensor, outType); } + /** + * Decodes each string in {@code input} into a sequence of Unicode code points. + * The character codepoints for all strings are returned using a single vector + * {@code char_values}, with strings expanded to characters in row-major order. + *

    The {@code row_splits} tensor indicates where the codepoints for + * each input string begin and end within the {@code char_values} tensor. + * In particular, the values for the {@code i}th + * string (in row-major order) are stored in the slice + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: + *

      + *
    • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
    • + *
    + * + * @param input The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param options carries optional attribute values + * @return a new instance of UnicodeDecode, with default output types + */ + public UnicodeDecode unicodeDecode(Operand input, String inputEncoding, + UnicodeDecode.Options... options) { + return UnicodeDecode.create(scope, input, inputEncoding, options); + } + + /** + * Decodes each string in {@code input} into a sequence of Unicode code points. + * The character codepoints for all strings are returned using a single vector + * {@code char_values}, with strings expanded to characters in row-major order. + *

    The {@code row_splits} tensor indicates where the codepoints for + * each input string begin and end within the {@code char_values} tensor. + * In particular, the values for the {@code i}th + * string (in row-major order) are stored in the slice + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: + *

      + *
    • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
    • + *
    + * + * @param input The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param Tsplits The value of the Tsplits attribute + * @param options carries optional attribute values + * @param data type for {@code UnicodeDecode} output and operands + * @return a new instance of UnicodeDecode + */ + public UnicodeDecode unicodeDecode(Operand input, + String inputEncoding, Class Tsplits, UnicodeDecode.Options... options) { + return UnicodeDecode.create(scope, input, inputEncoding, Tsplits, options); + } + + /** + * Decodes each string in {@code input} into a sequence of Unicode code points. + * The character codepoints for all strings are returned using a single vector + * {@code char_values}, with strings expanded to characters in row-major order. + * Similarly, the character start byte offsets are returned using a single vector + * {@code char_to_byte_starts}, with strings expanded in row-major order. + *

    The {@code row_splits} tensor indicates where the codepoints and start offsets for + * each input string begin and end within the {@code char_values} and + * {@code char_to_byte_starts} tensors. In particular, the values for the {@code i}th + * string (in row-major order) are stored in the slice + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: + *

      + *
    • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code char_to_bytes_starts[row_splits[i]+j]} is the start byte offset for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
    • + *
    + * + * @param input The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param options carries optional attribute values + * @return a new instance of UnicodeDecodeWithOffsets, with default output types + */ + public UnicodeDecodeWithOffsets unicodeDecodeWithOffsets(Operand input, + String inputEncoding, UnicodeDecodeWithOffsets.Options... options) { + return UnicodeDecodeWithOffsets.create(scope, input, inputEncoding, options); + } + + /** + * Decodes each string in {@code input} into a sequence of Unicode code points. + * The character codepoints for all strings are returned using a single vector + * {@code char_values}, with strings expanded to characters in row-major order. + * Similarly, the character start byte offsets are returned using a single vector + * {@code char_to_byte_starts}, with strings expanded in row-major order. + *

    The {@code row_splits} tensor indicates where the codepoints and start offsets for + * each input string begin and end within the {@code char_values} and + * {@code char_to_byte_starts} tensors. In particular, the values for the {@code i}th + * string (in row-major order) are stored in the slice + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: + *

      + *
    • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code char_to_bytes_starts[row_splits[i]+j]} is the start byte offset for the {@code j}th + * character in the {@code i}th string (in row-major order).
    • + *
    • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
    • + *
    + * + * @param input The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param Tsplits The value of the Tsplits attribute + * @param options carries optional attribute values + * @param data type for {@code UnicodeDecodeWithOffsets} output and operands + * @return a new instance of UnicodeDecodeWithOffsets + */ + public UnicodeDecodeWithOffsets unicodeDecodeWithOffsets( + Operand input, String inputEncoding, Class Tsplits, + UnicodeDecodeWithOffsets.Options... options) { + return UnicodeDecodeWithOffsets.create(scope, input, inputEncoding, Tsplits, options); + } + + /** + * Encode a tensor of ints into unicode strings. + * Returns a vector of strings, where {@code output[i]} is constructed by encoding the + * Unicode codepoints in {@code input_values[input_splits[i]:input_splits[i+1]]} + * using {@code output_encoding}. + *
    + *

    Example: + *

    +   *  input_values = [72, 101, 108, 108, 111, 87, 111, 114, 108, 100]
    +   *  input_splits = [0, 5, 10]
    +   *  output_encoding = 'UTF-8'
    +   *
    +   *  output = ['Hello', 'World']
    +   *  
    + * + * @param inputValues A 1D tensor containing the unicode codepoints that should be encoded. + * @param inputSplits A 1D tensor specifying how the unicode codepoints should be split into strings. + * In particular, {@code output[i]} is constructed by encoding the codepoints in the + * slice {@code input_values[input_splits[i]:input_splits[i+1]]}. + * @param outputEncoding Unicode encoding of the output strings. Valid encodings are: {@code "UTF-8", "UTF-16-BE", and "UTF-32-BE"}. + * @param options carries optional attribute values + * @return a new instance of UnicodeEncode + */ + public UnicodeEncode unicodeEncode(Operand inputValues, + Operand inputSplits, String outputEncoding, + UnicodeEncode.Options... options) { + return UnicodeEncode.create(scope, inputValues, inputSplits, outputEncoding, options); + } + /** * Determine the script codes of a given tensor of Unicode integer code points. * This operation converts Unicode code points to script codes corresponding to @@ -587,36 +775,11 @@ public UnicodeTranscode unicodeTranscode(Operand input, String inputEnc } /** - * Joins the elements of {@code inputs} based on {@code segment_ids}. - * Computes the string join along segments of a tensor. - * Given {@code segment_ids} with rank {@code N} and {@code data} with rank {@code N+M}: - *
    -   *  `output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
    -   *  
    - *

    where the join is over all [j1...jN] such that segment_ids[j1...jN] = i. - * Strings are joined in row-major order. - *

    For example: - *

    -   *  inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
    -   *  output_array = string_ops.unsorted_segment_join(inputs=inputs,
    -   *                                                  segment_ids=[1, 0, 1],
    -   *                                                  num_segments=2,
    -   *                                                  separator=':'))
    -   *  # output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
    -   *
    -   *
    -   *  inputs = ['this', 'is', 'a', 'test']
    -   *  output_array = string_ops.unsorted_segment_join(inputs=inputs,
    -   *                                                  segment_ids=[0, 0, 0, 0],
    -   *                                                  num_segments=1,
    -   *                                                  separator=':'))
    -   *  # output_array ==> ['this:is:a:test']
    -   *  
    + * The UnsortedSegmentJoin operation * - * @param inputs The input to be joined. - * @param segmentIds A tensor whose shape is a prefix of data.shape. Negative segment ids are not - * supported. - * @param numSegments A scalar. + * @param inputs The inputs value + * @param segmentIds The segmentIds value + * @param numSegments The numSegments value * @param options carries optional attribute values * @return a new instance of UnsortedSegmentJoin */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java index 2be5f8e6bd3..d7690d11d71 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -19,20 +19,37 @@ import org.tensorflow.Operand; import org.tensorflow.op.summary.AudioSummary; +import org.tensorflow.op.summary.CloseSummaryWriter; +import org.tensorflow.op.summary.CreateSummaryDbWriter; +import org.tensorflow.op.summary.CreateSummaryFileWriter; +import org.tensorflow.op.summary.FlushSummaryWriter; import org.tensorflow.op.summary.HistogramSummary; import org.tensorflow.op.summary.ImageSummary; +import org.tensorflow.op.summary.ImportEvent; import org.tensorflow.op.summary.MergeSummary; import org.tensorflow.op.summary.ScalarSummary; +import org.tensorflow.op.summary.StatsAggregatorSummary; +import org.tensorflow.op.summary.SummaryWriter; import org.tensorflow.op.summary.TensorSummary; +import org.tensorflow.op.summary.WriteAudioSummary; +import org.tensorflow.op.summary.WriteGraphSummary; +import org.tensorflow.op.summary.WriteHistogramSummary; +import org.tensorflow.op.summary.WriteImageSummary; +import org.tensorflow.op.summary.WriteRawProtoSummary; +import org.tensorflow.op.summary.WriteScalarSummary; +import org.tensorflow.op.summary.WriteSummary; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * An API for building {@code summary} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class SummaryOps { private final Scope scope; @@ -68,6 +85,58 @@ public AudioSummary audioSummary(Operand tag, Operand tensor, return AudioSummary.create(scope, tag, tensor, sampleRate, options); } + /** + * The CloseSummaryWriter operation + * + * @param writer The writer value + * @return a new instance of CloseSummaryWriter + */ + public CloseSummaryWriter closeSummaryWriter(Operand writer) { + return CloseSummaryWriter.create(scope, writer); + } + + /** + * The CreateSummaryDbWriter operation + * + * @param writer The writer value + * @param dbUri The dbUri value + * @param experimentName The experimentName value + * @param runName The runName value + * @param userName The userName value + * @return a new instance of CreateSummaryDbWriter + */ + public CreateSummaryDbWriter createSummaryDbWriter(Operand writer, + Operand dbUri, Operand experimentName, Operand runName, + Operand userName) { + return CreateSummaryDbWriter.create(scope, writer, dbUri, experimentName, runName, userName); + } + + /** + * The CreateSummaryFileWriter operation + * + * @param writer The writer value + * @param logdir The logdir value + * @param maxQueue The maxQueue value + * @param flushMillis The flushMillis value + * @param filenameSuffix The filenameSuffix value + * @return a new instance of CreateSummaryFileWriter + */ + public CreateSummaryFileWriter createSummaryFileWriter(Operand writer, + Operand logdir, Operand maxQueue, Operand flushMillis, + Operand filenameSuffix) { + return CreateSummaryFileWriter.create(scope, writer, logdir, maxQueue, flushMillis, filenameSuffix); + } + + /** + * The FlushSummaryWriter operation + * + * @param writer The writer value + * @return a new instance of FlushSummaryWriter + */ + public FlushSummaryWriter flushSummaryWriter(Operand writer) { + return FlushSummaryWriter.create(scope, writer); + } + /** * Outputs a {@code Summary} protocol buffer with a histogram. * The generated @@ -133,6 +202,17 @@ public ImageSummary imageSummary(Operand tag, Operand writer, Operand event) { + return ImportEvent.create(scope, writer, event); + } + /** * Merges summaries. * This op creates a @@ -163,6 +243,26 @@ public ScalarSummary scalarSummary(Operand tags, Operand iterator) { + return StatsAggregatorSummary.create(scope, iterator); + } + + /** + * The SummaryWriter operation + * + * @param options carries optional attribute values + * @return a new instance of SummaryWriter + */ + public SummaryWriter summaryWriter(SummaryWriter.Options... options) { + return SummaryWriter.create(scope, options); + } + /** * Outputs a {@code Summary} protocol buffer with a tensor and per-plugin data. * @@ -177,6 +277,118 @@ public TensorSummary tensorSummary(Operand tag, Operand writer, Operand step, + Operand tag, Operand tensor, Operand sampleRate, + WriteAudioSummary.Options... options) { + return WriteAudioSummary.create(scope, writer, step, tag, tensor, sampleRate, options); + } + + /** + * Writes a graph summary. + * Writes TensorFlow graph {@code tensor} at {@code step} using summary {@code writer}. + * + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value + * @return a new instance of WriteGraphSummary + */ + public WriteGraphSummary writeGraphSummary(Operand writer, Operand step, + Operand tensor) { + return WriteGraphSummary.create(scope, writer, step, tensor); + } + + /** + * Writes a histogram summary. + * Writes histogram {@code values} at {@code step} with {@code tag} using summary {@code writer}. + * + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param values The values value + * @return a new instance of WriteHistogramSummary + */ + public WriteHistogramSummary writeHistogramSummary(Operand writer, + Operand step, Operand tag, Operand values) { + return WriteHistogramSummary.create(scope, writer, step, tag, values); + } + + /** + * Writes an image summary. + * Writes image {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. + * {@code tensor} is image with shape [height, width, channels]. + * + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param tensor The tensor value + * @param badColor The badColor value + * @param options carries optional attribute values + * @return a new instance of WriteImageSummary + */ + public WriteImageSummary writeImageSummary(Operand writer, Operand step, + Operand tag, Operand tensor, Operand badColor, + WriteImageSummary.Options... options) { + return WriteImageSummary.create(scope, writer, step, tag, tensor, badColor, options); + } + + /** + * Writes a serialized proto summary. + * Writes {@code tensor}, a serialized proto at {@code step} using summary {@code writer}. + * + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value + * @return a new instance of WriteRawProtoSummary + */ + public WriteRawProtoSummary writeRawProtoSummary(Operand writer, + Operand step, Operand tensor) { + return WriteRawProtoSummary.create(scope, writer, step, tensor); + } + + /** + * Writes a scalar summary. + * Writes scalar {@code value} at {@code step} with {@code tag} using summary {@code writer}. + * + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param value The value value + * @return a new instance of WriteScalarSummary + */ + public WriteScalarSummary writeScalarSummary(Operand writer, + Operand step, Operand tag, Operand value) { + return WriteScalarSummary.create(scope, writer, step, tag, value); + } + + /** + * Writes a tensor summary. + * Writes {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. + * + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value + * @param tag The tag value + * @param summaryMetadata The summaryMetadata value + * @return a new instance of WriteSummary + */ + public WriteSummary writeSummary(Operand writer, Operand step, + Operand tensor, Operand tag, Operand summaryMetadata) { + return WriteSummary.create(scope, writer, step, tensor, tag, summaryMetadata); + } + /** * Get the parent {@link Ops} object. */ 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 index 2bfd21c438e..f6ea8e12178 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -20,20 +20,116 @@ import java.util.List; import org.tensorflow.ConcreteFunction; import org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.tpu.AllToAll; +import org.tensorflow.op.tpu.CollateTPUEmbeddingMemory; +import org.tensorflow.op.tpu.CompilationResult; import org.tensorflow.op.tpu.Compile; import org.tensorflow.op.tpu.CompileSucceededAssert; +import org.tensorflow.op.tpu.ConfigureAndInitializeGlobalTPU; +import org.tensorflow.op.tpu.ConfigureDistributedTPU; +import org.tensorflow.op.tpu.ConfigureTPUEmbedding; +import org.tensorflow.op.tpu.ConfigureTPUEmbeddingHost; +import org.tensorflow.op.tpu.ConfigureTPUEmbeddingMemory; +import org.tensorflow.op.tpu.ConnectTPUEmbeddingHosts; +import org.tensorflow.op.tpu.ConvertToCooTensor; +import org.tensorflow.op.tpu.CrossReplicaSum; +import org.tensorflow.op.tpu.DTensorRestore; +import org.tensorflow.op.tpu.DynamicEnqueueTPUEmbeddingArbitraryTensorBatch; +import org.tensorflow.op.tpu.DynamicEnqueueTPUEmbeddingRaggedTensorBatch; +import org.tensorflow.op.tpu.EmbeddingActivations; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingArbitraryTensorBatch; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingBatch; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingIntegerBatch; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingRaggedTensorBatch; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseBatch; +import org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseTensorBatch; import org.tensorflow.op.tpu.Execute; import org.tensorflow.op.tpu.ExecuteAndUpdateVariables; +import org.tensorflow.op.tpu.ExecuteTPUEmbeddingPartitioner; +import org.tensorflow.op.tpu.FinalizeTPUEmbedding; +import org.tensorflow.op.tpu.GetMinibatchSplitsWithPhysicalReplica; +import org.tensorflow.op.tpu.GetMinibatchesInCsrWithPhysicalReplica; +import org.tensorflow.op.tpu.GetTpuTaskId; +import org.tensorflow.op.tpu.GlobalIterId; +import org.tensorflow.op.tpu.InfeedDequeue; +import org.tensorflow.op.tpu.InfeedDequeueTuple; +import org.tensorflow.op.tpu.InfeedEnqueue; +import org.tensorflow.op.tpu.InfeedEnqueuePrelinearizedBuffer; +import org.tensorflow.op.tpu.InfeedEnqueueTuple; +import org.tensorflow.op.tpu.IsTPUEmbeddingInitialized; +import org.tensorflow.op.tpu.LoadAllTPUEmbeddingParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradMomentumParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingCenteredRMSPropParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingFrequencyEstimatorParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingMDLAdagradLightParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParameters; +import org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParameters; +import org.tensorflow.op.tpu.MergeDedupData; +import org.tensorflow.op.tpu.OrdinalSelector; +import org.tensorflow.op.tpu.OutfeedDequeue; +import org.tensorflow.op.tpu.OutfeedDequeueTuple; +import org.tensorflow.op.tpu.OutfeedDequeueTupleV2; +import org.tensorflow.op.tpu.OutfeedDequeueV2; +import org.tensorflow.op.tpu.OutfeedEnqueue; +import org.tensorflow.op.tpu.OutfeedEnqueueTuple; +import org.tensorflow.op.tpu.PartitionedCall; import org.tensorflow.op.tpu.PartitionedInput; import org.tensorflow.op.tpu.PartitionedOutput; +import org.tensorflow.op.tpu.Prelinearize; +import org.tensorflow.op.tpu.PrelinearizeTuple; +import org.tensorflow.op.tpu.RecvTPUEmbeddingActivations; +import org.tensorflow.op.tpu.ReplicateMetadata; +import org.tensorflow.op.tpu.ReplicatedInput; +import org.tensorflow.op.tpu.ReplicatedOutput; +import org.tensorflow.op.tpu.RetrieveAllTPUEmbeddingParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradMomentumParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingFrequencyEstimatorParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParameters; +import org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters; +import org.tensorflow.op.tpu.SendTPUEmbeddingGradients; +import org.tensorflow.op.tpu.ShutdownDistributedTPU; +import org.tensorflow.op.tpu.ShutdownTPUSystem; +import org.tensorflow.op.tpu.SplitDedupData; +import org.tensorflow.op.tpu.StoreMinibatchStatisticsInFdo; +import org.tensorflow.op.tpu.TPUAnnotateTensorsWithDynamicShape; +import org.tensorflow.op.tpu.TPUCompilationResult; +import org.tensorflow.op.tpu.TPUCopyWithDynamicShape; +import org.tensorflow.op.tpu.TPUEmbeddingActivations; +import org.tensorflow.op.tpu.TPUReplicateMetadata; +import org.tensorflow.op.tpu.TPUReplicatedInput; +import org.tensorflow.op.tpu.TPUReplicatedOutput; +import org.tensorflow.op.tpu.TPUReshardVariables; +import org.tensorflow.op.tpu.TPURoundRobin; +import org.tensorflow.op.tpu.TpuHandleToProtoKey; +import org.tensorflow.op.tpu.WorkerHeartbeat; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * An API for building {@code tpu} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class TpuOps { private final Scope scope; @@ -45,6 +141,62 @@ public final class TpuOps { this.ops = ops; } + /** + * An Op to exchange data across TPU replicas. + * On each replica, the input is split into {@code split_count} blocks along + * {@code split_dimension} and send to the other replicas given group_assignment. After + * receiving {@code split_count} - 1 blocks from other replicas, we concatenate the + * blocks along {@code concat_dimension} as the output. + *

    For example, suppose there are 2 TPU replicas: + * replica 0 receives input: {@code [[A, B]]} + * replica 1 receives input: {@code [[C, D]]} + *

    group_assignment={@code [[0, 1]]} + * concat_dimension=0 + * split_dimension=1 + * split_count=2 + *

    replica 0's output: {@code [[A], [C]]} + * replica 1's output: {@code [[B], [D]]} + * + * @param input The local input to the sum. + * @param groupAssignment An int32 tensor with shape + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the + * replica ids in the ith subgroup. + * @param concatDimension The dimension number to concatenate. + * @param splitDimension The dimension number to split. + * @param splitCount The number of splits, this number must equal to the sub-group + * size(group_assignment.get_shape()[1]) + * @param data type for {@code AllToAll} output and operands + * @return a new instance of AllToAll + */ + public AllToAll allToAll(Operand input, Operand groupAssignment, + Long concatDimension, Long splitDimension, Long splitCount) { + return AllToAll.create(scope, input, groupAssignment, concatDimension, splitDimension, splitCount); + } + + /** + * An op that merges the string-encoded memory config protos from all hosts. + * + * @param memoryConfigs String-encoded memory config protos containing metadata about + * the memory allocations reserved for TPUEmbedding across all hosts. + * @return a new instance of CollateTPUEmbeddingMemory + */ + public CollateTPUEmbeddingMemory collateTPUEmbeddingMemory( + Iterable> memoryConfigs) { + return CollateTPUEmbeddingMemory.create(scope, memoryConfigs); + } + + /** + * 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. + * + * @return a new instance of CompilationResult + */ + public CompilationResult compilationResult() { + return CompilationResult.create(scope); + } + /** * Compiles a computations for execution on one or more TPU devices. * For the internal use of the distributed TPU compiler. @@ -62,11 +214,11 @@ public final class TpuOps { * used to look up the program in the compilation cache. * 'may_modify_variables' indicates whether variables may be modified. * - * @param dynamicShapes the dynamicShapes value - * @param guaranteedConstants the guaranteedConstants value - * @param numComputations the value of the numComputations property - * @param function the value of the function property - * @param metadata the value of the metadata property + * @param dynamicShapes The dynamicShapes value + * @param guaranteedConstants The guaranteedConstants value + * @param numComputations The value of the numComputations attribute + * @param function The value of the function attribute + * @param metadata The value of the metadata attribute * @return a new instance of Compile */ public Compile compile(Iterable> dynamicShapes, @@ -81,20 +233,425 @@ public Compile compile(Iterable> dynamicShapes, * pending device interactions fail. *

    'compilation_status' is a serialized CompilationResultProto. * - * @param compilationStatus the compilationStatus value + * @param compilationStatus The compilationStatus value * @return a new instance of CompileSucceededAssert */ public CompileSucceededAssert compileSucceededAssert(Operand compilationStatus) { return CompileSucceededAssert.create(scope, compilationStatus); } + /** + * An op that sets up the centralized structures for a distributed TPU system. + * + * @param options carries optional attribute values + * @return a new instance of ConfigureAndInitializeGlobalTPU + */ + public ConfigureAndInitializeGlobalTPU configureAndInitializeGlobalTPU( + ConfigureAndInitializeGlobalTPU.Options... options) { + return ConfigureAndInitializeGlobalTPU.create(scope, options); + } + + /** + * Sets up the centralized structures for a distributed TPU system. + * + * @param options carries optional attribute values + * @return a new instance of ConfigureDistributedTPU + */ + public ConfigureDistributedTPU configureDistributedTPU( + ConfigureDistributedTPU.Options... options) { + return ConfigureDistributedTPU.create(scope, options); + } + + /** + * Sets up TPUEmbedding in a distributed TPU system. + * + * @param config Serialized tensorflow.tpu.TPUEmbeddingConfiguration that + * describes the embedding lookups of the program. + * @return a new instance of ConfigureTPUEmbedding + */ + public ConfigureTPUEmbedding configureTPUEmbedding(String config) { + return ConfigureTPUEmbedding.create(scope, config); + } + + /** + * An op that configures the TPUEmbedding software on a host. + * + * @param commonConfig A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output. + * @param memoryConfig A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + * @param config An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + * @return a new instance of ConfigureTPUEmbeddingHost + */ + public ConfigureTPUEmbeddingHost configureTPUEmbeddingHost(Operand commonConfig, + Operand memoryConfig, String config) { + return ConfigureTPUEmbeddingHost.create(scope, commonConfig, memoryConfig, config); + } + + /** + * An op that configures the TPUEmbedding software on a host. + * + * @param commonConfig A string-encoded CommonConfiguration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + * @return a new instance of ConfigureTPUEmbeddingMemory + */ + public ConfigureTPUEmbeddingMemory configureTPUEmbeddingMemory(Operand commonConfig) { + return ConfigureTPUEmbeddingMemory.create(scope, commonConfig); + } + + /** + * An op that sets up communication between TPUEmbedding host software instances + * after ConfigureTPUEmbeddingHost has been called on each host. + * + * @param networkConfigs Strings containing metadata about the hostname and RPC port + * used for communication with all hosts. + * @return a new instance of ConnectTPUEmbeddingHosts + */ + public ConnectTPUEmbeddingHosts connectTPUEmbeddingHosts( + Iterable> networkConfigs) { + return ConnectTPUEmbeddingHosts.create(scope, networkConfigs); + } + + /** + * The ConvertToCooTensor operation + * + * @param indicesOrRowSplits The indicesOrRowSplits value + * @param values The values value + * @param weights The weights value + * @param sampleCount The value of the sampleCount attribute + * @param combiner The value of the combiner attribute + * @return a new instance of ConvertToCooTensor + */ + public ConvertToCooTensor convertToCooTensor(Operand indicesOrRowSplits, + Operand values, Operand weights, Long sampleCount, String combiner) { + return ConvertToCooTensor.create(scope, indicesOrRowSplits, values, weights, sampleCount, combiner); + } + + /** + * An Op to sum inputs across replicated TPU instances. + * Each instance supplies its own input. + *

    For example, suppose there are 8 TPU instances: {@code [A, B, C, D, E, F, G, H]}. + * Passing group_assignment={@code [[0,2,4,6],[1,3,5,7]]} sets {@code A, C, E, G} as group 0, + * and {@code B, D, F, H} as group 1. Thus we get the outputs: + * {@code [A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]}. + * + * @param input The local input to the sum. + * @param groupAssignment An int32 tensor with shape + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the + * replica ids in the ith subgroup. + * @param data type for {@code CrossReplicaSum} output and operands + * @return a new instance of CrossReplicaSum + */ + public CrossReplicaSum crossReplicaSum(Operand input, + Operand groupAssignment) { + return CrossReplicaSum.create(scope, input, groupAssignment); + } + + /** + * The DTensorRestoreV2 operation + * + * @param prefix The prefix value + * @param tensorNames The tensorNames value + * @param shapeAndSlices The shapeAndSlices value + * @param inputShapes The value of the inputShapes attribute + * @param inputLayouts The value of the inputLayouts attribute + * @param dtypes The value of the dtypes attribute + * @return a new instance of DTensorRestore + */ + public DTensorRestore dTensorRestore(Operand prefix, Operand tensorNames, + Operand shapeAndSlices, List inputShapes, List inputLayouts, + List> dtypes) { + return DTensorRestore.create(scope, prefix, tensorNames, shapeAndSlices, inputShapes, inputLayouts, dtypes); + } + + /** + * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). + * embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. + *

    The tensors at corresponding positions in the three input lists (sample_indices, + * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + * + * @param sampleIndicesOrRowSplits A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param aggregationWeights A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @param options carries optional attribute values + * @return a new instance of DynamicEnqueueTPUEmbeddingArbitraryTensorBatch + */ + public DynamicEnqueueTPUEmbeddingArbitraryTensorBatch dynamicEnqueueTPUEmbeddingArbitraryTensorBatch( + Iterable> sampleIndicesOrRowSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Operand deviceOrdinal, + DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.Options... options) { + return DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.create(scope, sampleIndicesOrRowSplits, embeddingIndices, aggregationWeights, modeOverride, deviceOrdinal, options); + } + + /** + * The DynamicEnqueueTPUEmbeddingRaggedTensorBatch operation + * + * @param sampleSplits The sampleSplits value + * @param embeddingIndices The embeddingIndices value + * @param aggregationWeights The aggregationWeights value + * @param modeOverride The modeOverride value + * @param deviceOrdinal The deviceOrdinal value + * @param tableIds The value of the tableIds attribute + * @param options carries optional attribute values + * @return a new instance of DynamicEnqueueTPUEmbeddingRaggedTensorBatch + */ + public DynamicEnqueueTPUEmbeddingRaggedTensorBatch dynamicEnqueueTPUEmbeddingRaggedTensorBatch( + Iterable> sampleSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Operand deviceOrdinal, List tableIds, + DynamicEnqueueTPUEmbeddingRaggedTensorBatch.Options... options) { + return DynamicEnqueueTPUEmbeddingRaggedTensorBatch.create(scope, sampleSplits, embeddingIndices, aggregationWeights, modeOverride, deviceOrdinal, tableIds, options); + } + + /** + * 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. + * + * @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 + */ + public EmbeddingActivations embeddingActivations(Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { + return EmbeddingActivations.create(scope, embeddingVariable, slicedActivations, tableId, lookupId); + } + + /** + * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). + * embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. + *

    The tensors at corresponding positions in the three input lists (sample_indices, + * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + * + * @param sampleIndicesOrRowSplits A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param aggregationWeights A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingArbitraryTensorBatch + */ + public EnqueueTPUEmbeddingArbitraryTensorBatch enqueueTPUEmbeddingArbitraryTensorBatch( + Iterable> sampleIndicesOrRowSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + EnqueueTPUEmbeddingArbitraryTensorBatch.Options... options) { + return EnqueueTPUEmbeddingArbitraryTensorBatch.create(scope, sampleIndicesOrRowSplits, embeddingIndices, aggregationWeights, modeOverride, options); + } + + /** + * An op that enqueues a list of input batch tensors to TPUEmbedding. + * An op that enqueues a list of input batch tensors to TPUEmbedding. + * + * @param batch A list of 1D tensors, one for each embedding table, containing the + * batch inputs encoded as dist_belief.SparseFeatures protos. If the weight + * field in the SparseFeatures proto is not populated for an ID, a weight of + * 1.0 is assumed. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingBatch + */ + public EnqueueTPUEmbeddingBatch enqueueTPUEmbeddingBatch(Iterable> batch, + Operand modeOverride, EnqueueTPUEmbeddingBatch.Options... options) { + return EnqueueTPUEmbeddingBatch.create(scope, batch, modeOverride, options); + } + + /** + * An op that enqueues a list of input batch tensors to TPUEmbedding. + * + * @param batch A list of 1D tensors, one for each embedding table, containing the + * indices into the tables. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingIntegerBatch + */ + public EnqueueTPUEmbeddingIntegerBatch enqueueTPUEmbeddingIntegerBatch( + Iterable> batch, Operand modeOverride, + EnqueueTPUEmbeddingIntegerBatch.Options... options) { + return EnqueueTPUEmbeddingIntegerBatch.create(scope, batch, modeOverride, options); + } + + /** + * Eases the porting of code that uses tf.nn.embedding_lookup(). + * sample_splits[i], embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. table_ids[i] indicates which embedding table to look up ith + * feature. + *

    The tensors at corresponding positions in two of the input lists, + * embedding_indices and aggregation_weights, must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + * + * @param sampleSplits A list of rank 1 Tensors specifying the break points for splitting + * embedding_indices and aggregation_weights into rows. + * It corresponds to ids.row_splits in embedding_lookup(), when ids is a + * RaggedTensor. + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding tables. + * It corresponds to ids.values in embedding_lookup(), when ids is a RaggedTensor. + * @param aggregationWeights A list of rank 1 Tensors containing per training example + * aggregation weights. It corresponds to the values field of a RaggedTensor + * with the same row_splits as ids in embedding_lookup(), when ids is a + * RaggedTensor. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param tableIds A list of integers specifying the identifier of the embedding table + * (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the + * corresponding input. The ith input is looked up using table_ids[i]. The size + * of the table_ids list must be equal to that of sample_indices, + * embedding_indices and aggregation_weights. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingRaggedTensorBatch + */ + public EnqueueTPUEmbeddingRaggedTensorBatch enqueueTPUEmbeddingRaggedTensorBatch( + Iterable> sampleSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, EnqueueTPUEmbeddingRaggedTensorBatch.Options... options) { + return EnqueueTPUEmbeddingRaggedTensorBatch.create(scope, sampleSplits, embeddingIndices, aggregationWeights, modeOverride, tableIds, options); + } + + /** + * An op that enqueues TPUEmbedding input indices from a SparseTensor. + * This Op eases the porting of code that uses embedding_lookup_sparse(), + * although some Python preprocessing of the SparseTensor arguments to + * embedding_lookup_sparse() is required to produce the arguments to this Op, + * since only a single EnqueueTPUEmbeddingSparseBatch Op is allowed per training + * step. + *

    The tensors at corresponding positions in the three input lists + * must have the same shape, i.e. rank 1 with dim_size() equal to the total + * number of lookups into the table described by the corresponding table_id. + * + * @param sampleIndices A list of rank 1 Tensors specifying the training example and + * feature to which the corresponding embedding_indices and aggregation_weights + * values belong. sample_indices[i] must equal b * nf + f, where nf is the + * number of features from the corresponding table, f is in [0, nf), and + * b is in [0, batch size). + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding tables. + * @param aggregationWeights A list of rank 1 Tensors containing per sample -- i.e. per + * (training example, feature) -- aggregation weights. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingSparseBatch + */ + public EnqueueTPUEmbeddingSparseBatch enqueueTPUEmbeddingSparseBatch( + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + EnqueueTPUEmbeddingSparseBatch.Options... options) { + return EnqueueTPUEmbeddingSparseBatch.create(scope, sampleIndices, embeddingIndices, aggregationWeights, modeOverride, options); + } + + /** + * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). + * sample_indices[i], embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. table_ids[i] indicates which embedding table to look up ith + * feature. + *

    The tensors at corresponding positions in the three input lists (sample_indices, + * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + * + * @param sampleIndices A list of rank 1 Tensors specifying the training example to + * which the corresponding embedding_indices and aggregation_weights values + * belong. It corresponds to sp_ids.indices[:,0] in embedding_lookup_sparse(). + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding tables. + * It corresponds to sp_ids.values in embedding_lookup_sparse(). + * @param aggregationWeights A list of rank 1 Tensors containing per training example + * aggregation weights. It corresponds to sp_weights.values in + * embedding_lookup_sparse(). + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param tableIds A list of integers specifying the identifier of the embedding table + * (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the + * corresponding input. The ith input is looked up using table_ids[i]. The size + * of the table_ids list must be equal to that of sample_indices, + * embedding_indices and aggregation_weights. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingSparseTensorBatch + */ + public EnqueueTPUEmbeddingSparseTensorBatch enqueueTPUEmbeddingSparseTensorBatch( + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, EnqueueTPUEmbeddingSparseTensorBatch.Options... options) { + return EnqueueTPUEmbeddingSparseTensorBatch.create(scope, sampleIndices, embeddingIndices, aggregationWeights, modeOverride, tableIds, options); + } + /** * Op that loads and executes a TPU program on a TPU device. * For the internal use of the distributed TPU compiler. * - * @param args the args value - * @param key the key value - * @param Tresults the value of the Tresults property + * @param args The args value + * @param key The key value + * @param Tresults The value of the Tresults attribute * @return a new instance of Execute */ public Execute execute(Iterable> args, Operand key, @@ -112,11 +669,11 @@ public Execute execute(Iterable> args, Operand key, * 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 the args value - * @param key the key value - * @param Tresults the value of the Tresults property - * @param deviceVarReadsIndices the value of the deviceVarReadsIndices property - * @param deviceVarUpdatesIndices the value of the deviceVarUpdatesIndices property + * @param args The args value + * @param key The key value + * @param Tresults The value of the Tresults attribute + * @param deviceVarReadsIndices The value of the deviceVarReadsIndices attribute + * @param deviceVarUpdatesIndices The value of the deviceVarUpdatesIndices attribute * @return a new instance of ExecuteAndUpdateVariables */ public ExecuteAndUpdateVariables executeAndUpdateVariables(Iterable> args, @@ -126,33 +683,1301 @@ public ExecuteAndUpdateVariables executeAndUpdateVariables(Iterable> } /** - * An op that groups a list of partitioned inputs together. This op + * An op that executes the TPUEmbedding partitioner on the central configuration + * device and computes the HBM size (in bytes) required for TPUEmbedding operation. * - * @param data type for {@code output} output - * @param inputs A list of partitioned inputs which must have the same shape. + * @param config An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + * @return a new instance of ExecuteTPUEmbeddingPartitioner + */ + public ExecuteTPUEmbeddingPartitioner executeTPUEmbeddingPartitioner(String config) { + return ExecuteTPUEmbeddingPartitioner.create(scope, config); + } + + /** + * An op that finalizes the TPUEmbedding configuration. + * + * @param commonConfig A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + * @param memoryConfig A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + * @return a new instance of FinalizeTPUEmbedding + */ + public FinalizeTPUEmbedding finalizeTPUEmbedding(Operand commonConfig, + Operand memoryConfig) { + return FinalizeTPUEmbedding.create(scope, commonConfig, memoryConfig); + } + + /** + * The GetMinibatchSplitsWithPhysicalReplica operation + * + * @param programKey The programKey value + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param gains The gains value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchSplits The value of the miniBatchSplits attribute + * @return a new instance of GetMinibatchSplitsWithPhysicalReplica + */ + public GetMinibatchSplitsWithPhysicalReplica getMinibatchSplitsWithPhysicalReplica( + Operand programKey, Operand rowIds, Operand colIds, + Operand gains, Long sampleCount, Long numReplica, Long tableVocabSize, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchSplits) { + return GetMinibatchSplitsWithPhysicalReplica.create(scope, programKey, rowIds, colIds, gains, sampleCount, numReplica, tableVocabSize, featureWidth, numScPerChip, tableName, miniBatchSplits); + } + + /** + * The GetMinibatchesInCsrWithPhysicalReplica operation + * + * @param programKey The programKey value + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param gains The gains value + * @param splits The splits value + * @param idCounts The idCounts value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param maxMinibatchesPerSc The value of the maxMinibatchesPerSc attribute + * @param maxIdsPerChipPerSample The value of the maxIdsPerChipPerSample attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchInCsr The value of the miniBatchInCsr attribute + * @return a new instance of GetMinibatchesInCsrWithPhysicalReplica + */ + public GetMinibatchesInCsrWithPhysicalReplica getMinibatchesInCsrWithPhysicalReplica( + Operand programKey, Operand rowIds, Operand colIds, + Operand gains, Operand splits, Operand idCounts, Long sampleCount, + Long numReplica, Long maxMinibatchesPerSc, Long maxIdsPerChipPerSample, Long tableVocabSize, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchInCsr) { + return GetMinibatchesInCsrWithPhysicalReplica.create(scope, programKey, rowIds, colIds, gains, splits, idCounts, sampleCount, numReplica, maxMinibatchesPerSc, maxIdsPerChipPerSample, tableVocabSize, featureWidth, numScPerChip, tableName, miniBatchInCsr); + } + + /** + * An op returns the TPU task ID from TPU topology. + * This op is to return the TPU task ID from TPU topology. + * + * @return a new instance of GetTpuTaskId + */ + public GetTpuTaskId getTpuTaskId() { + return GetTpuTaskId.create(scope); + } + + /** + * The GlobalIterId operation + * + * @return a new instance of GlobalIterId + */ + public GlobalIterId globalIterId() { + return GlobalIterId.create(scope); + } + + /** + * A placeholder op for a value that will be fed into the computation. + * + * @param dtype The type of elements in the tensor. + * @param shape The shape of the tensor. + * @param data type for {@code InfeedDequeue} output and operands + * @return a new instance of InfeedDequeue + */ + public InfeedDequeue infeedDequeue(Class dtype, Shape shape) { + return InfeedDequeue.create(scope, dtype, shape); + } + + /** + * Fetches multiple values from infeed as an XLA tuple. + * + * @param dtypes The element types of each element in {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. + * @return a new instance of InfeedDequeueTuple + */ + public InfeedDequeueTuple infeedDequeueTuple(List> dtypes, + List shapes) { + return InfeedDequeueTuple.create(scope, dtypes, shapes); + } + + /** + * An op which feeds a single Tensor value into the computation. + * + * @param input A tensor that will be provided using the infeed mechanism. * @param options carries optional attribute values - * @param data type for {@code TPUPartitionedInput} output and operands - * @return a new instance of PartitionedInput + * @return a new instance of InfeedEnqueue */ - public PartitionedInput partitionedInput(Iterable> inputs, - PartitionedInput.Options... options) { - return PartitionedInput.create(scope, inputs, options); + public InfeedEnqueue infeedEnqueue(Operand input, + InfeedEnqueue.Options... options) { + return InfeedEnqueue.create(scope, input, options); } /** - * An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned - * outputs outside the XLA computation. + * An op which enqueues prelinearized buffer into TPU infeed. * - * @param data type for {@code output} output - * @param inputs A tensor which represents the full shape of partitioned tensors. - * @param numSplits the value of the numSplits property + * @param input A variant tensor representing linearized output. * @param options carries optional attribute values - * @param data type for {@code TPUPartitionedOutput} output and operands - * @return a new instance of PartitionedOutput + * @return a new instance of InfeedEnqueuePrelinearizedBuffer */ - public PartitionedOutput partitionedOutput(Operand inputs, Long numSplits, - PartitionedOutput.Options... options) { - return PartitionedOutput.create(scope, inputs, numSplits, options); + public InfeedEnqueuePrelinearizedBuffer infeedEnqueuePrelinearizedBuffer( + Operand input, InfeedEnqueuePrelinearizedBuffer.Options... options) { + return InfeedEnqueuePrelinearizedBuffer.create(scope, input, options); + } + + /** + * Feeds multiple Tensor values into the computation as an XLA tuple. + * + * @param inputs A list of tensors that will be provided using the infeed mechanism. + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values + * @return a new instance of InfeedEnqueueTuple + */ + public InfeedEnqueueTuple infeedEnqueueTuple(Iterable> inputs, List shapes, + InfeedEnqueueTuple.Options... options) { + return InfeedEnqueueTuple.create(scope, inputs, shapes, options); + } + + /** + * Whether TPU Embedding is initialized in a distributed TPU system. + * + * @param options carries optional attribute values + * @return a new instance of IsTPUEmbeddingInitialized + */ + public IsTPUEmbeddingInitialized isTPUEmbeddingInitialized( + IsTPUEmbeddingInitialized.Options... options) { + return IsTPUEmbeddingInitialized.create(scope, options); + } + + /** + * An op that loads optimization parameters into embedding memory. + * An op that loads optimization parameters into embedding memory. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct embedding + * table configuration. For example, this op is used to install parameters that are + * loaded from a checkpoint before a training loop is executed. For Adagrad, + * auxiliary1 should be the accumulators. For SGD, all of the auxiliary* values + * should be empty. For FTRL, auxiliary1 should be the accumulators and auxiliary2 + * should be the linear terms. For ADAM, auxiliary1 should be the momenta and + * auxiliary2 should be the velocities. + * + * @param parameters A list of tensors, one for each embedding table, + * containing the initial embedding table parameters to use in embedding + * lookups. + * @param auxiliary1 A list of tensors, one for each embedding table, containing the + * initial values of the first auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have at least one + * auxiliary parameter. + * @param auxiliary2 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least two auxiliary + * @param auxiliary3 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have three + * auxiliary parameters. + * @param auxiliary4 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least four auxiliary + * @param auxiliary5 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have five + * auxiliary parameters. + * @param auxiliary6 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least six auxiliary + * @param auxiliary7 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have sevan + * auxiliary parameters. + * @param config An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + * @param numShards Number of shards into which the embedding tables are divided. + * @param shardId Identifier of shard for this operation. + * @return a new instance of LoadAllTPUEmbeddingParameters + */ + public LoadAllTPUEmbeddingParameters loadAllTPUEmbeddingParameters( + Iterable> parameters, Iterable> auxiliary1, + Iterable> auxiliary2, Iterable> auxiliary3, + Iterable> auxiliary4, Iterable> auxiliary5, + Iterable> auxiliary6, Iterable> auxiliary7, String config, + Long numShards, Long shardId) { + return LoadAllTPUEmbeddingParameters.create(scope, parameters, auxiliary1, auxiliary2, auxiliary3, auxiliary4, auxiliary5, auxiliary6, auxiliary7, config, numShards, shardId); + } + + /** + * Load ADAM embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the ADAM optimization algorithm. + * @param momenta Value of momenta used in the ADAM optimization algorithm. + * @param velocities Value of velocities used in the ADAM optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingADAMParameters + */ + public LoadTPUEmbeddingADAMParameters loadTPUEmbeddingADAMParameters(Operand parameters, + Operand momenta, Operand velocities, Long numShards, Long shardId, + LoadTPUEmbeddingADAMParameters.Options... options) { + return LoadTPUEmbeddingADAMParameters.create(scope, parameters, momenta, velocities, numShards, shardId, options); + } + + /** + * Load Adadelta embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the Adadelta optimization algorithm. + * @param accumulators Value of accumulators used in the Adadelta optimization algorithm. + * @param updates Value of updates used in the Adadelta optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingAdadeltaParameters + */ + public LoadTPUEmbeddingAdadeltaParameters loadTPUEmbeddingAdadeltaParameters( + Operand parameters, Operand accumulators, Operand updates, + Long numShards, Long shardId, LoadTPUEmbeddingAdadeltaParameters.Options... options) { + return LoadTPUEmbeddingAdadeltaParameters.create(scope, parameters, accumulators, updates, numShards, shardId, options); + } + + /** + * Load Adagrad Momentum embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the Adagrad Momentum optimization algorithm. + * @param accumulators Value of accumulators used in the Adagrad Momentum optimization algorithm. + * @param momenta Value of momenta used in the Adagrad Momentum optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingAdagradMomentumParameters + */ + public LoadTPUEmbeddingAdagradMomentumParameters loadTPUEmbeddingAdagradMomentumParameters( + Operand parameters, Operand accumulators, Operand momenta, + Long numShards, Long shardId, LoadTPUEmbeddingAdagradMomentumParameters.Options... options) { + return LoadTPUEmbeddingAdagradMomentumParameters.create(scope, parameters, accumulators, momenta, numShards, shardId, options); + } + + /** + * Load Adagrad embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the Adagrad optimization algorithm. + * @param accumulators Value of accumulators used in the Adagrad optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingAdagradParameters + */ + public LoadTPUEmbeddingAdagradParameters loadTPUEmbeddingAdagradParameters( + Operand parameters, Operand accumulators, Long numShards, Long shardId, + LoadTPUEmbeddingAdagradParameters.Options... options) { + return LoadTPUEmbeddingAdagradParameters.create(scope, parameters, accumulators, numShards, shardId, options); + } + + /** + * Load centered RMSProp embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the centered RMSProp optimization algorithm. + * @param ms Value of ms used in the centered RMSProp optimization algorithm. + * @param mom Value of mom used in the centered RMSProp optimization algorithm. + * @param mg Value of mg used in the centered RMSProp optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingCenteredRMSPropParameters + */ + public LoadTPUEmbeddingCenteredRMSPropParameters loadTPUEmbeddingCenteredRMSPropParameters( + Operand parameters, Operand ms, Operand mom, + Operand mg, Long numShards, Long shardId, + LoadTPUEmbeddingCenteredRMSPropParameters.Options... options) { + return LoadTPUEmbeddingCenteredRMSPropParameters.create(scope, parameters, ms, mom, mg, numShards, shardId, options); + } + + /** + * Load FTRL embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the FTRL optimization algorithm. + * @param accumulators Value of accumulators used in the FTRL optimization algorithm. + * @param linears Value of linears used in the FTRL optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingFTRLParameters + */ + public LoadTPUEmbeddingFTRLParameters loadTPUEmbeddingFTRLParameters(Operand parameters, + Operand accumulators, Operand linears, Long numShards, Long shardId, + LoadTPUEmbeddingFTRLParameters.Options... options) { + return LoadTPUEmbeddingFTRLParameters.create(scope, parameters, accumulators, linears, numShards, shardId, options); + } + + /** + * Load frequency estimator embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the frequency estimator optimization algorithm. + * @param lastHitStep Value of last_hit_step used in the frequency estimator optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingFrequencyEstimatorParameters + */ + public LoadTPUEmbeddingFrequencyEstimatorParameters loadTPUEmbeddingFrequencyEstimatorParameters( + Operand parameters, Operand lastHitStep, Long numShards, Long shardId, + LoadTPUEmbeddingFrequencyEstimatorParameters.Options... options) { + return LoadTPUEmbeddingFrequencyEstimatorParameters.create(scope, parameters, lastHitStep, numShards, shardId, options); + } + + /** + * Load MDL Adagrad Light embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the MDL Adagrad Light optimization algorithm. + * @param accumulators Value of accumulators used in the MDL Adagrad Light optimization algorithm. + * @param weights Value of weights used in the MDL Adagrad Light optimization algorithm. + * @param benefits Value of benefits used in the MDL Adagrad Light optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingMDLAdagradLightParameters + */ + public LoadTPUEmbeddingMDLAdagradLightParameters loadTPUEmbeddingMDLAdagradLightParameters( + Operand parameters, Operand accumulators, Operand weights, + Operand benefits, Long numShards, Long shardId, + LoadTPUEmbeddingMDLAdagradLightParameters.Options... options) { + return LoadTPUEmbeddingMDLAdagradLightParameters.create(scope, parameters, accumulators, weights, benefits, numShards, shardId, options); + } + + /** + * Load Momentum embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the Momentum optimization algorithm. + * @param momenta Value of momenta used in the Momentum optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingMomentumParameters + */ + public LoadTPUEmbeddingMomentumParameters loadTPUEmbeddingMomentumParameters( + Operand parameters, Operand momenta, Long numShards, Long shardId, + LoadTPUEmbeddingMomentumParameters.Options... options) { + return LoadTPUEmbeddingMomentumParameters.create(scope, parameters, momenta, numShards, shardId, options); + } + + /** + * Load proximal Adagrad embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the proximal Adagrad optimization algorithm. + * @param accumulators Value of accumulators used in the proximal Adagrad optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingProximalAdagradParameters + */ + public LoadTPUEmbeddingProximalAdagradParameters loadTPUEmbeddingProximalAdagradParameters( + Operand parameters, Operand accumulators, Long numShards, Long shardId, + LoadTPUEmbeddingProximalAdagradParameters.Options... options) { + return LoadTPUEmbeddingProximalAdagradParameters.create(scope, parameters, accumulators, numShards, shardId, options); + } + + /** + * The LoadTPUEmbeddingProximalYogiParameters operation + * + * @param parameters The parameters value + * @param v The v value + * @param m The m value + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingProximalYogiParameters + */ + public LoadTPUEmbeddingProximalYogiParameters loadTPUEmbeddingProximalYogiParameters( + Operand parameters, Operand v, Operand m, Long numShards, + Long shardId, LoadTPUEmbeddingProximalYogiParameters.Options... options) { + return LoadTPUEmbeddingProximalYogiParameters.create(scope, parameters, v, m, numShards, shardId, options); + } + + /** + * Load RMSProp embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the RMSProp optimization algorithm. + * @param ms Value of ms used in the RMSProp optimization algorithm. + * @param mom Value of mom used in the RMSProp optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingRMSPropParameters + */ + public LoadTPUEmbeddingRMSPropParameters loadTPUEmbeddingRMSPropParameters( + Operand parameters, Operand ms, Operand mom, Long numShards, + Long shardId, LoadTPUEmbeddingRMSPropParameters.Options... options) { + return LoadTPUEmbeddingRMSPropParameters.create(scope, parameters, ms, mom, numShards, shardId, options); + } + + /** + * Load SGD embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + * + * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParameters + */ + public LoadTPUEmbeddingStochasticGradientDescentParameters loadTPUEmbeddingStochasticGradientDescentParameters( + Operand parameters, Long numShards, Long shardId, + LoadTPUEmbeddingStochasticGradientDescentParameters.Options... options) { + return LoadTPUEmbeddingStochasticGradientDescentParameters.create(scope, parameters, numShards, shardId, options); + } + + /** + * An op merges elements of integer and float tensors into deduplication data as + * XLA tuple. + * This op merges outputs of SplitDedupDataOp, which gives two 1-D tensors, integer + * and floating point. With respect to tuple_mask, this op merges values of these + * two tensors into an XLA tuple, which should be as same as input to + * SplitDedupDataOp. + * + * @param integerTensor A 1-D integer tensor, includes integer elements of deduplication data tuple. + * @param floatTensor A 1-D float tensor, includes float elements of deduplication data tuple. + * @param tupleMask A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + * @param options carries optional attribute values + * @return a new instance of MergeDedupData + */ + public MergeDedupData mergeDedupData(Operand integerTensor, + Operand floatTensor, String tupleMask, MergeDedupData.Options... options) { + return MergeDedupData.create(scope, integerTensor, floatTensor, tupleMask, options); + } + + /** + * A TPU core selector Op. + * This Op produces a set of TPU cores (for warm-up) or a single TPU core + * (for regular inference) to execute the TPU program on. The output is + * consumed by TPUPartitionedCall. + * + * @return a new instance of OrdinalSelector + */ + public OrdinalSelector ordinalSelector() { + return OrdinalSelector.create(scope); + } + + /** + * Retrieves a single tensor from the computation outfeed. + * This operation will block indefinitely until data is available. + * + * @param dtype The type of elements in the tensor. + * @param shape The shape of the tensor. + * @param options carries optional attribute values + * @param data type for {@code OutfeedDequeue} output and operands + * @return a new instance of OutfeedDequeue + */ + public OutfeedDequeue outfeedDequeue(Class dtype, Shape shape, + OutfeedDequeue.Options... options) { + return OutfeedDequeue.create(scope, dtype, shape, options); + } + + /** + * Retrieve multiple values from the computation outfeed. + * This operation will block indefinitely until data is available. Output {@code i} + * corresponds to XLA tuple element {@code i}. + * + * @param dtypes The element types of each element in {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. + * @param options carries optional attribute values + * @return a new instance of OutfeedDequeueTuple + */ + public OutfeedDequeueTuple outfeedDequeueTuple(List> dtypes, + List shapes, OutfeedDequeueTuple.Options... options) { + return OutfeedDequeueTuple.create(scope, dtypes, shapes, options); + } + + /** + * 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 {@code i} + * corresponds to XLA tuple element {@code i}. + * + * @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 {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. + * @return a new instance of OutfeedDequeueTupleV2 + */ + public OutfeedDequeueTupleV2 outfeedDequeueTupleV2(Operand deviceOrdinal, + List> dtypes, List shapes) { + return OutfeedDequeueTupleV2.create(scope, deviceOrdinal, dtypes, shapes); + } + + /** + * 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 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. + * @param data type for {@code OutfeedDequeueV2} output and operands + * @return a new instance of OutfeedDequeueV2 + */ + public OutfeedDequeueV2 outfeedDequeueV2(Operand deviceOrdinal, + Class dtype, Shape shape) { + return OutfeedDequeueV2.create(scope, deviceOrdinal, dtype, shape); + } + + /** + * Enqueue a Tensor on the computation outfeed. + * + * @param input A tensor that will be inserted into the outfeed queue. + * @return a new instance of OutfeedEnqueue + */ + public OutfeedEnqueue outfeedEnqueue(Operand input) { + return OutfeedEnqueue.create(scope, input); + } + + /** + * Enqueue multiple Tensor values on the computation outfeed. + * + * @param inputs A list of tensors that will be inserted into the outfeed queue as an + * XLA tuple. + * @return a new instance of OutfeedEnqueueTuple + */ + public OutfeedEnqueueTuple outfeedEnqueueTuple(Iterable> inputs) { + return OutfeedEnqueueTuple.create(scope, inputs); + } + + /** + * Calls a function placed on a specified TPU device. + * + * @param args The arguments to the function. + * @param deviceOrdinal The TPU device ordinal to run the function on. + * @param Tout The types of the outputs of the function. + * @param f The function to call. + * @param options carries optional attribute values + * @return a new instance of PartitionedCall + */ + public PartitionedCall partitionedCall(Iterable> args, Operand deviceOrdinal, + List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { + return PartitionedCall.create(scope, args, deviceOrdinal, Tout, f, options); + } + + /** + * An op that groups a list of partitioned inputs together. Supports ND sharding. + * + * @param inputs A list of partitioned inputs which must have the same shape. + * @param partitionDims A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. + * @param options carries optional attribute values + * @param data type for {@code TPUPartitionedInputV2} output and operands + * @return a new instance of PartitionedInput + */ + public PartitionedInput partitionedInput(Iterable> inputs, + List partitionDims, PartitionedInput.Options... options) { + return PartitionedInput.create(scope, inputs, partitionDims, options); + } + + /** + * An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned + * outputs outside the XLA computation. Supports ND sharding. + * + * @param inputs A tensor which represents the full shape of partitioned tensors. + * @param numSplits The value of the numSplits attribute + * @param partitionDims A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. + * @param data type for {@code TPUPartitionedOutputV2} output and operands + * @return a new instance of PartitionedOutput + */ + public PartitionedOutput partitionedOutput(Operand inputs, Long numSplits, + List partitionDims) { + return PartitionedOutput.create(scope, inputs, numSplits, partitionDims); + } + + /** + * An op which linearizes one Tensor value to an opaque variant tensor. + * + * @param input A tensor that will be linearized. + * @param options carries optional attribute values + * @return a new instance of Prelinearize + */ + public Prelinearize prelinearize(Operand input, + Prelinearize.Options... options) { + return Prelinearize.create(scope, input, options); + } + + /** + * An op which linearizes multiple Tensor values to an opaque variant tensor. + * + * @param inputs A list of tensors that will be provided using the infeed mechanism. + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values + * @return a new instance of PrelinearizeTuple + */ + public PrelinearizeTuple prelinearizeTuple(Iterable> inputs, List shapes, + PrelinearizeTuple.Options... options) { + return PrelinearizeTuple.create(scope, inputs, shapes, options); + } + + /** + * An op that receives embedding activations on the TPU. + * The TPU system performs the embedding lookups and aggregations specified by + * the arguments to TPUEmbeddingEnqueue(Integer/Sparse/SparseTensor)Batch. The + * results of these aggregations are visible to the Tensorflow Graph as the + * outputs of a RecvTPUEmbeddingActivations op. This op returns a list containing + * one Tensor of activations per table specified in the model. There can be at + * most one RecvTPUEmbeddingActivations op in the TPU graph. + * + * @param numOutputs The number of output activation tensors, equal to the number of + * embedding tables in the model. + * @param config Serialized TPUEmbeddingConfiguration proto. + * @return a new instance of RecvTPUEmbeddingActivations + */ + public RecvTPUEmbeddingActivations recvTPUEmbeddingActivations(Long numOutputs, String config) { + return RecvTPUEmbeddingActivations.create(scope, numOutputs, config); + } + + /** + * Metadata indicating how the TPU computation should be replicated. + * This operation holds the metadata common to operations of a {@code tpu.replicate()} computation subgraph. + * + * @param numReplicas Number of replicas of the computation + * @param options carries optional attribute values + * @return a new instance of ReplicateMetadata + */ + public ReplicateMetadata replicateMetadata(Long numReplicas, + ReplicateMetadata.Options... options) { + return ReplicateMetadata.create(scope, numReplicas, options); + } + + /** + * Connects N inputs to an N-way replicated TPU computation. + * This operation holds a replicated input to a {@code tpu.replicate()} computation subgraph. + * Each replicated input has the same shape and type alongside the output. + *

    For example: + *

    +   *  %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 inputs The inputs value + * @param options carries optional attribute values + * @param data type for {@code TPUReplicatedInput} output and operands + * @return a new instance of ReplicatedInput + */ + public ReplicatedInput replicatedInput(Iterable> inputs, + ReplicatedInput.Options... options) { + return ReplicatedInput.create(scope, inputs, options); + } + + /** + * Connects N outputs from an N-way replicated TPU computation. + * This operation holds a replicated output from a {@code tpu.replicate()} computation subgraph. + * Each replicated output has the same shape and type alongside the input. + *

    For example: + *

    +   *  %computation = "tf.Computation"()
    +   *  %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
    +   *  
    + *

    The above computation has a replicated output of two replicas. + * + * @param input The input value + * @param numReplicas The value of the numReplicas attribute + * @param data type for {@code TPUReplicatedOutput} output and operands + * @return a new instance of ReplicatedOutput + */ + public ReplicatedOutput replicatedOutput(Operand input, + Long numReplicas) { + return ReplicatedOutput.create(scope, input, numReplicas); + } + + /** + * An op that retrieves optimization parameters from embedding to host memory. + * An op that retrieves optimization parameters from embedding to host memory. + * Must be preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to retrieve updated + * parameters before saving a checkpoint. For Adagrad, auxiliary1 will contain the + * accumulators after running this op. For SGD, all of the auxiliary* values will + * be empty (0x0 tensors for that table). For FTRL, auxiliary1 will contain the + * accumulators and auxiliary2 will contain the linear terms. For ADAM, auxiliary1 + * will contain the momenta and auxiliary2 will contain the velocities. + * + * @param NumTables The number of embedding tables. + * @param config An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + * @param numShards Number of shards into which the embedding tables are divided. + * @param shardId Identifier of shard for this operation. + * @return a new instance of RetrieveAllTPUEmbeddingParameters + */ + public RetrieveAllTPUEmbeddingParameters retrieveAllTPUEmbeddingParameters(Long NumTables, + String config, Long numShards, Long shardId) { + return RetrieveAllTPUEmbeddingParameters.create(scope, NumTables, config, numShards, shardId); + } + + /** + * Retrieve ADAM embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingADAMParameters + */ + public RetrieveTPUEmbeddingADAMParameters retrieveTPUEmbeddingADAMParameters(Long numShards, + Long shardId, RetrieveTPUEmbeddingADAMParameters.Options... options) { + return RetrieveTPUEmbeddingADAMParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve Adadelta embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingAdadeltaParameters + */ + public RetrieveTPUEmbeddingAdadeltaParameters retrieveTPUEmbeddingAdadeltaParameters( + Long numShards, Long shardId, RetrieveTPUEmbeddingAdadeltaParameters.Options... options) { + return RetrieveTPUEmbeddingAdadeltaParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve Adagrad Momentum embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingAdagradMomentumParameters + */ + public RetrieveTPUEmbeddingAdagradMomentumParameters retrieveTPUEmbeddingAdagradMomentumParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingAdagradMomentumParameters.Options... options) { + return RetrieveTPUEmbeddingAdagradMomentumParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve Adagrad embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingAdagradParameters + */ + public RetrieveTPUEmbeddingAdagradParameters retrieveTPUEmbeddingAdagradParameters(Long numShards, + Long shardId, RetrieveTPUEmbeddingAdagradParameters.Options... options) { + return RetrieveTPUEmbeddingAdagradParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve centered RMSProp embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingCenteredRMSPropParameters + */ + public RetrieveTPUEmbeddingCenteredRMSPropParameters retrieveTPUEmbeddingCenteredRMSPropParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingCenteredRMSPropParameters.Options... options) { + return RetrieveTPUEmbeddingCenteredRMSPropParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve FTRL embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingFTRLParameters + */ + public RetrieveTPUEmbeddingFTRLParameters retrieveTPUEmbeddingFTRLParameters(Long numShards, + Long shardId, RetrieveTPUEmbeddingFTRLParameters.Options... options) { + return RetrieveTPUEmbeddingFTRLParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve frequency estimator embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingFrequencyEstimatorParameters + */ + public RetrieveTPUEmbeddingFrequencyEstimatorParameters retrieveTPUEmbeddingFrequencyEstimatorParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingFrequencyEstimatorParameters.Options... options) { + return RetrieveTPUEmbeddingFrequencyEstimatorParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve MDL Adagrad Light embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingMDLAdagradLightParameters + */ + public RetrieveTPUEmbeddingMDLAdagradLightParameters retrieveTPUEmbeddingMDLAdagradLightParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingMDLAdagradLightParameters.Options... options) { + return RetrieveTPUEmbeddingMDLAdagradLightParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve Momentum embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingMomentumParameters + */ + public RetrieveTPUEmbeddingMomentumParameters retrieveTPUEmbeddingMomentumParameters( + Long numShards, Long shardId, RetrieveTPUEmbeddingMomentumParameters.Options... options) { + return RetrieveTPUEmbeddingMomentumParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve proximal Adagrad embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingProximalAdagradParameters + */ + public RetrieveTPUEmbeddingProximalAdagradParameters retrieveTPUEmbeddingProximalAdagradParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingProximalAdagradParameters.Options... options) { + return RetrieveTPUEmbeddingProximalAdagradParameters.create(scope, numShards, shardId, options); + } + + /** + * The RetrieveTPUEmbeddingProximalYogiParameters operation + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingProximalYogiParameters + */ + public RetrieveTPUEmbeddingProximalYogiParameters retrieveTPUEmbeddingProximalYogiParameters( + Long numShards, Long shardId, RetrieveTPUEmbeddingProximalYogiParameters.Options... options) { + return RetrieveTPUEmbeddingProximalYogiParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve RMSProp embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingRMSPropParameters + */ + public RetrieveTPUEmbeddingRMSPropParameters retrieveTPUEmbeddingRMSPropParameters(Long numShards, + Long shardId, RetrieveTPUEmbeddingRMSPropParameters.Options... options) { + return RetrieveTPUEmbeddingRMSPropParameters.create(scope, numShards, shardId, options); + } + + /** + * Retrieve SGD embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + * + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingStochasticGradientDescentParameters + */ + public RetrieveTPUEmbeddingStochasticGradientDescentParameters retrieveTPUEmbeddingStochasticGradientDescentParameters( + Long numShards, Long shardId, + RetrieveTPUEmbeddingStochasticGradientDescentParameters.Options... options) { + return RetrieveTPUEmbeddingStochasticGradientDescentParameters.create(scope, numShards, shardId, options); + } + + /** + * Performs gradient updates of embedding tables. + * + * @param inputs A TensorList of gradients with which to update embedding tables. + * This argument has the same length and shapes as the return value of + * RecvTPUEmbeddingActivations, but contains gradients of the model's loss + * with respect to the embedding activations. The embedding tables are updated + * from these gradients via the optimizer specified in the TPU embedding + * configuration given to tpu.initialize_system. + * @param learningRates A TensorList of float32 scalars, one for each dynamic learning + * rate tag: see the comments in + * //third_party/tensorflow/core/protobuf/tpu/optimization_parameters.proto. + * Multiple tables can share the same dynamic learning rate tag as specified + * in the configuration. If the learning rates for all tables are constant, + * this list should be empty. + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param options carries optional attribute values + * @return a new instance of SendTPUEmbeddingGradients + */ + public SendTPUEmbeddingGradients sendTPUEmbeddingGradients(Iterable> inputs, + Iterable> learningRates, String config, + SendTPUEmbeddingGradients.Options... options) { + return SendTPUEmbeddingGradients.create(scope, inputs, learningRates, config, options); + } + + /** + * Shuts down a running distributed TPU system. + * The op returns an error if no system is running. + * + * @return a new instance of ShutdownDistributedTPU + */ + public ShutdownDistributedTPU shutdownDistributedTPU() { + return ShutdownDistributedTPU.create(scope); + } + + /** + * An op that shuts down the TPU system. + * + * @return a new instance of ShutdownTPUSystem + */ + public ShutdownTPUSystem shutdownTPUSystem() { + return ShutdownTPUSystem.create(scope); + } + + /** + * An op splits input deduplication data XLA tuple into integer and floating point + * tensors. + * Deduplication data is an XLA tuple, which consists of integer and floating point + * values. This op is to split these values into two groups for two types, and + * construct each group as one tensor to return. + * + * @param input An XLA tuple including integer and float elements as deduplication data tuple. + * @param integerType integer_tensor type. Allowed types: int32, int64, uint32, uint64. + * @param floatType float_tensor type. Allowed types: half, bfloat16, float. + * @param tupleMask A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + * @param options carries optional attribute values + * @param data type for {@code SplitDedupData} output and operands + * @param data type for {@code SplitDedupData} output and operands + * @return a new instance of SplitDedupData + */ + public SplitDedupData splitDedupData( + Operand input, Class integerType, Class floatType, String tupleMask, + SplitDedupData.Options... options) { + return SplitDedupData.create(scope, input, integerType, floatType, tupleMask, options); + } + + /** + * The StoreMinibatchStatisticsInFdo operation + * + * @param programKey The programKey value + * @param maxIds The maxIds value + * @param maxUniques The maxUniques value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchSplits The value of the miniBatchSplits attribute + * @return a new instance of StoreMinibatchStatisticsInFdo + */ + public StoreMinibatchStatisticsInFdo storeMinibatchStatisticsInFdo(Operand programKey, + Operand maxIds, Operand maxUniques, Long sampleCount, Long numReplica, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchSplits) { + return StoreMinibatchStatisticsInFdo.create(scope, programKey, maxIds, maxUniques, sampleCount, numReplica, featureWidth, numScPerChip, tableName, miniBatchSplits); + } + + /** + * The TPUAnnotateTensorsWithDynamicShape operation + * + * @param tensors The tensors value + * @return a new instance of TPUAnnotateTensorsWithDynamicShape + */ + public TPUAnnotateTensorsWithDynamicShape tPUAnnotateTensorsWithDynamicShape( + Iterable> tensors) { + return TPUAnnotateTensorsWithDynamicShape.create(scope, tensors); + } + + /** + * 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. + * + * @deprecated use {@link org.tensorflow.op.tpu.CompilationResult} instead + * @return a new instance of TPUCompilationResult + */ + @Deprecated + public TPUCompilationResult tPUCompilationResult() { + return TPUCompilationResult.create(scope); + } + + /** + * Op that copies host tensor to device with dynamic shape support. + * For internal use only. + * + * @param tensors The tensors value + * @param unpaddedSizes The unpaddedSizes value + * @return a new instance of TPUCopyWithDynamicShape + */ + public TPUCopyWithDynamicShape tPUCopyWithDynamicShape(Iterable> tensors, + Iterable> unpaddedSizes) { + return TPUCopyWithDynamicShape.create(scope, tensors, unpaddedSizes); + } + + /** + * 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. + * + * @deprecated use {@link org.tensorflow.op.tpu.EmbeddingActivations} instead + * @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 TPUEmbeddingActivations + */ + @Deprecated + public TPUEmbeddingActivations tPUEmbeddingActivations(Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { + return TPUEmbeddingActivations.create(scope, embeddingVariable, slicedActivations, tableId, lookupId); + } + + /** + * Metadata indicating how the TPU computation should be replicated. + * This operation holds the metadata common to operations of a {@code tpu.replicate()} computation subgraph. + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicateMetadata} instead + * @param numReplicas Number of replicas of the computation + * @param options carries optional attribute values + * @return a new instance of TPUReplicateMetadata + */ + @Deprecated + public TPUReplicateMetadata tPUReplicateMetadata(Long numReplicas, + TPUReplicateMetadata.Options... options) { + return TPUReplicateMetadata.create(scope, numReplicas, options); + } + + /** + * Connects N inputs to an N-way replicated TPU computation. + * This operation holds a replicated input to a {@code tpu.replicate()} computation subgraph. + * Each replicated input has the same shape and type alongside the output. + *

    For example: + *

    +   *  %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. + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedInput} instead + * @param inputs The inputs value + * @param options carries optional attribute values + * @param data type for {@code TPUReplicatedInput} output and operands + * @return a new instance of TPUReplicatedInput + */ + @Deprecated + public TPUReplicatedInput tPUReplicatedInput(Iterable> inputs, + TPUReplicatedInput.Options... options) { + return TPUReplicatedInput.create(scope, inputs, options); + } + + /** + * Connects N outputs from an N-way replicated TPU computation. + * This operation holds a replicated output from a {@code tpu.replicate()} computation subgraph. + * Each replicated output has the same shape and type alongside the input. + *

    For example: + *

    +   *  %computation = "tf.Computation"()
    +   *  %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
    +   *  
    + *

    The above computation has a replicated output of two replicas. + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedOutput} instead + * @param input The input value + * @param numReplicas The value of the numReplicas attribute + * @param data type for {@code TPUReplicatedOutput} output and operands + * @return a new instance of TPUReplicatedOutput + */ + @Deprecated + public TPUReplicatedOutput tPUReplicatedOutput(Operand input, + Long numReplicas) { + return TPUReplicatedOutput.create(scope, input, numReplicas); + } + + /** + * Op that reshards on-device TPU variables to specified state. + * Op that reshards on-device TPU variables to specified state. Internal use only. + *

    The sharding state is represented as the key of the compilation that generated + * the sharding/unsharding programs along with the main program. new_format_key + * specifies the desired state, and format_state_var is the current state of the + * variables. + * + * @param vars The vars value + * @param newFormatKey The newFormatKey value + * @param formatStateVar The formatStateVar value + * @return a new instance of TPUReshardVariables + */ + public TPUReshardVariables tPUReshardVariables(Iterable> vars, + Operand newFormatKey, Operand formatStateVar) { + return TPUReshardVariables.create(scope, vars, newFormatKey, formatStateVar); + } + + /** + * Round-robin load balancing on TPU cores. + * A load balancing op that round-robins among TPU cores. + *

    This op round-robins between the integers in [0, NumTPUCoresVisiblePerHost]. It + * is useful for interfacing with TensorFlow ops that take as input a TPU core on + * which to execute computations, such as {@code TPUPartitionedCall}. + *

    device_ordinal: An integer in [0, NumTPUCoresVisiblePerHost]. + * + * @return a new instance of TPURoundRobin + */ + public TPURoundRobin tPURoundRobin() { + return TPURoundRobin.create(scope); + } + + /** + * Converts XRT's uid handles to TensorFlow-friendly input format. + * Converts a uid handle for a compiled program into a vector of proto keys. + *

    XRT compile ops return uids, and the TensorFlow execute op takes a proto + * key. This op enables a client to compile on TPU using XRT and execute using the + * standard TensorFlow execute op. + *

    'uid' is the input handle. + * 'proto_keys' is a vector of proto keys, one for each core program. + * + * @param uid The uid value + * @return a new instance of TpuHandleToProtoKey + */ + public TpuHandleToProtoKey tpuHandleToProtoKey(Operand uid) { + return TpuHandleToProtoKey.create(scope, uid); + } + + /** + * Worker heartbeat op. + * Heartbeats may be sent periodically to indicate the coordinator is still active, + * to retrieve the current worker status and to expedite shutdown when necessary. + * + * @param request A string tensor containing a serialized WorkerHeartbeatRequest + * @return a new instance of WorkerHeartbeat + */ + public WorkerHeartbeat workerHeartbeat(Operand request) { + return WorkerHeartbeat.create(scope, request); } /** 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 d12c25a5ac8..3ee5b8de813 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -25,9 +25,11 @@ import org.tensorflow.op.train.AccumulatorNumAccumulated; import org.tensorflow.op.train.AccumulatorSetGlobalStep; import org.tensorflow.op.train.AccumulatorTakeGradient; +import org.tensorflow.op.train.ApplyAdaMax; import org.tensorflow.op.train.ApplyAdadelta; import org.tensorflow.op.train.ApplyAdagrad; import org.tensorflow.op.train.ApplyAdagradDa; +import org.tensorflow.op.train.ApplyAdagradV2; import org.tensorflow.op.train.ApplyAdam; import org.tensorflow.op.train.ApplyAddSign; import org.tensorflow.op.train.ApplyCenteredRmsProp; @@ -39,12 +41,20 @@ import org.tensorflow.op.train.ApplyProximalGradientDescent; import org.tensorflow.op.train.ApplyRmsProp; import org.tensorflow.op.train.BatchMatMul; +import org.tensorflow.op.train.ComputeBatchSize; import org.tensorflow.op.train.ConditionalAccumulator; +import org.tensorflow.op.train.DistributedSave; import org.tensorflow.op.train.GenerateVocabRemapping; import org.tensorflow.op.train.MergeV2Checkpoints; import org.tensorflow.op.train.NegTrain; import org.tensorflow.op.train.PreventGradient; +import org.tensorflow.op.train.ResourceAccumulatorApplyGradient; +import org.tensorflow.op.train.ResourceAccumulatorNumAccumulated; +import org.tensorflow.op.train.ResourceAccumulatorSetGlobalStep; +import org.tensorflow.op.train.ResourceAccumulatorTakeGradient; +import org.tensorflow.op.train.ResourceApplyAdaMax; import org.tensorflow.op.train.ResourceApplyAdadelta; +import org.tensorflow.op.train.ResourceApplyAdagrad; import org.tensorflow.op.train.ResourceApplyAdagradDa; import org.tensorflow.op.train.ResourceApplyAdam; import org.tensorflow.op.train.ResourceApplyAdamWithAmsgrad; @@ -58,9 +68,11 @@ import org.tensorflow.op.train.ResourceApplyProximalAdagrad; import org.tensorflow.op.train.ResourceApplyProximalGradientDescent; import org.tensorflow.op.train.ResourceApplyRmsProp; +import org.tensorflow.op.train.ResourceConditionalAccumulator; import org.tensorflow.op.train.ResourceSparseApplyAdadelta; import org.tensorflow.op.train.ResourceSparseApplyAdagrad; import org.tensorflow.op.train.ResourceSparseApplyAdagradDa; +import org.tensorflow.op.train.ResourceSparseApplyAdagradV2; import org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp; import org.tensorflow.op.train.ResourceSparseApplyFtrl; import org.tensorflow.op.train.ResourceSparseApplyKerasMomentum; @@ -73,8 +85,10 @@ import org.tensorflow.op.train.Save; import org.tensorflow.op.train.SaveSlices; import org.tensorflow.op.train.SdcaFprint; +import org.tensorflow.op.train.SdcaOptimizer; import org.tensorflow.op.train.SdcaShrinkL1; import org.tensorflow.op.train.SparseApplyAdadelta; +import org.tensorflow.op.train.SparseApplyAdagrad; import org.tensorflow.op.train.SparseApplyAdagradDa; import org.tensorflow.op.train.SparseApplyCenteredRmsProp; import org.tensorflow.op.train.SparseApplyFtrl; @@ -94,7 +108,7 @@ /** * An API for building {@code train} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class TrainOps { private final Scope scope; @@ -152,7 +166,6 @@ public AccumulatorSetGlobalStep accumulatorSetGlobalStep(Operand handle * the accumulated gradients. Also automatically increments the recorded * global_step in the accumulator by 1, and resets the aggregate to 0. * - * @param data type for {@code average} output * @param handle The handle to an accumulator. * @param numRequired Number of gradients required before we return an aggregate. * @param dtype The data type of accumulated gradients. Needs to correspond to the type @@ -165,6 +178,31 @@ public AccumulatorTakeGradient accumulatorTakeGradient( return AccumulatorTakeGradient.create(scope, handle, numRequired, dtype); } + /** + * Update '*var' according to the AdaMax algorithm. + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * v_t <- max(beta2 * v_{t-1}, abs(g)) + * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) + * + * @param var Should be from a Variable(). + * @param m Should be from a Variable(). + * @param v Should be from a Variable(). + * @param beta1Power Must be a scalar. + * @param lr Scaling factor. Must be a scalar. + * @param beta1 Momentum factor. Must be a scalar. + * @param beta2 Momentum factor. Must be a scalar. + * @param epsilon Ridge term. Must be a scalar. + * @param grad The gradient. + * @param options carries optional attribute values + * @param data type for {@code ApplyAdaMax} output and operands + * @return a new instance of ApplyAdaMax + */ + public ApplyAdaMax applyAdaMax(Operand var, Operand m, Operand v, + Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, + Operand grad, ApplyAdaMax.Options... options) { + return ApplyAdaMax.create(scope, var, m, v, beta1Power, lr, beta1, beta2, epsilon, grad, options); + } + /** * Update '*var' according to the adadelta scheme. * accum = rho() * accum + (1 - rho()) * grad.square(); @@ -172,7 +210,6 @@ public AccumulatorTakeGradient accumulatorTakeGradient( * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param accumUpdate Should be from a Variable(). @@ -195,7 +232,6 @@ public ApplyAdadelta applyAdadelta(Operand var, Operand< * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -212,7 +248,6 @@ public ApplyAdagrad applyAdagrad(Operand var, Operand /** * Update '*var' according to the proximal adagrad scheme. * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). * @param gradientSquaredAccumulator Should be from a Variable(). @@ -232,14 +267,32 @@ public ApplyAdagradDa applyAdagradDa(Operand var, return ApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); } + /** + * Update '*var' according to the adagrad scheme. + * accum += grad * grad + * var -= lr * grad * (1 / sqrt(accum)) + * + * @param var Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param lr Scaling factor. Must be a scalar. + * @param epsilon Constant factor. Must be a scalar. + * @param grad The gradient. + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradV2} output and operands + * @return a new instance of ApplyAdagradV2 + */ + public ApplyAdagradV2 applyAdagradV2(Operand var, Operand accum, + Operand lr, Operand epsilon, Operand grad, ApplyAdagradV2.Options... options) { + return ApplyAdagradV2.create(scope, var, accum, lr, epsilon, grad, options); + } + /** * Update '*var' according to the Adam algorithm. - * $$lr_t := \text{learning_rate} * \sqrt{1 - beta_2^t} / (1 - beta_1^t)$$ - * $$m_t := beta_1 * m_{t-1} + (1 - beta_1) * g$$ - * $$v_t := beta_2 * v_{t-1} + (1 - beta_2) * g * g$$ - * $$variable := variable - lr_t * m_t / (\sqrt{v_t} + \epsilon)$$ + * $$\text{lr}t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta_2^t}}{1 - \beta_1^t}$$ + * $$m_t := \beta_1 \cdot m{t-1} + (1 - \beta_1) \cdot g$$ + * $$v_t := \beta_2 \cdot v_{t-1} + (1 - \beta_2) \cdot g^2$$ + * $$\text{var} := \begin{cases} \text{var} - (m_t \beta_1 + g \cdot (1 - \beta_1))\cdot\text{lr}_t/(\sqrt{v_t} + \epsilon), &\text{if use_nesterov}\\ \text{var} - m_t \cdot \text{lr}_t /(\sqrt{v_t} + \epsilon), &\text{otherwise} \end{cases}$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param v Should be from a Variable(). @@ -266,7 +319,6 @@ public ApplyAdam applyAdam(Operand var, Operand m, Op * update <- (alpha + sign_decay * sign(g) *sign(m)) * g * variable <- variable - lr_t * update * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -301,7 +353,6 @@ public ApplyAddSign applyAddSign(Operand var, Operand * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) * var <- var - mom * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param mg Should be from a Variable(). * @param ms Should be from a Variable(). @@ -332,7 +383,6 @@ public ApplyCenteredRmsProp applyCenteredRmsProp(Operand * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param linear Should be from a Variable(). @@ -340,7 +390,7 @@ public ApplyCenteredRmsProp applyCenteredRmsProp(Operand * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ApplyFtrlV2} output and operands @@ -355,7 +405,6 @@ public ApplyFtrl applyFtrl(Operand var, Operand accum /** * Update '*var' by subtracting 'alpha' * 'delta' from it. * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. @@ -374,7 +423,6 @@ public ApplyGradientDescent applyGradientDescent(Operand *

    accum = accum * momentum + grad * var -= lr * accum * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -395,7 +443,6 @@ public ApplyMomentum applyMomentum(Operand var, Operand< * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g * variable <- variable - lr_t * update * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -419,7 +466,6 @@ public ApplyPowerSign applyPowerSign(Operand var, Operan * prox_v = var - lr * grad * (1 / sqrt(accum)) * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. @@ -441,7 +487,6 @@ public ApplyProximalAdagrad applyProximalAdagrad(Operand * prox_v = var - alpha * delta * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. @@ -468,13 +513,12 @@ public ApplyProximalGradientDescent applyProximalGradientDe * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) * var <- var - mom * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attribute values @@ -510,7 +554,6 @@ public ApplyRmsProp applyRmsProp(Operand var, Operand * about broadcasting * here . * - * @param data type for {@code output} output * @param x 2-D or higher with shape {@code [..., r_x, c_x]}. * @param y 2-D or higher with shape {@code [..., r_y, c_y]}. * @param Tout If not spcified, Tout is the same type to input type. @@ -523,6 +566,16 @@ public BatchMatMul batchMatMul(Operand x, return BatchMatMul.create(scope, x, y, Tout, options); } + /** + * Computes the static batch size of a dataset sans partial batches. + * + * @param inputDataset The inputDataset value + * @return a new instance of ComputeBatchSize + */ + public ComputeBatchSize computeBatchSize(Operand inputDataset) { + return ComputeBatchSize.create(scope, inputDataset); + } + /** * A conditional accumulator for aggregating gradients. * The accumulator accepts gradients marked with local_step greater or @@ -543,6 +596,20 @@ public ConditionalAccumulator conditionalAccumulator(Class return ConditionalAccumulator.create(scope, dtype, shape, options); } + /** + * The DistributedSave operation + * + * @param dataset The dataset value + * @param directory The directory value + * @param address The address value + * @param options carries optional attribute values + * @return a new instance of DistributedSave + */ + public DistributedSave distributedSave(Operand dataset, + Operand directory, Operand address, DistributedSave.Options... options) { + return DistributedSave.create(scope, dataset, directory, address, options); + } + /** * Given a path to new and old vocabulary files, returns a remapping Tensor of * length {@code num_new_vocab}, where {@code remapping[i]} contains the row number in the old @@ -591,6 +658,9 @@ public GenerateVocabRemapping generateVocabRemapping(Operand newVocabFi *

    If delete_old_dirs is true, attempts to delete recursively the dirname of each * path in the input checkpoint_prefixes. This is useful when those paths are non * user-facing temporary locations. + *

    If allow_missing_files is true, merges the checkpoint prefixes as long as + * at least one file exists. Otherwise, if no files exist, an error will be thrown. + * The default value for allow_missing_files is false. * * @param checkpointPrefixes prefixes of V2 checkpoints to merge. * @param destinationPrefix scalar. The desired final prefix. Allowed to be the same @@ -610,7 +680,7 @@ public MergeV2Checkpoints mergeV2Checkpoints(Operand checkpointPrefixes * @param wOut output word embedding. * @param examples A vector of word ids. * @param labels A vector of word ids. - * @param lr the lr value + * @param lr The lr value * @param vocabCount Count of words in the vocabulary. * @param numNegativeSamples Number of negative samples per example. * @return a new instance of NegTrain @@ -630,7 +700,6 @@ public NegTrain negTrain(Operand wIn, Operand wOut, Operand< * op exists to prevent subtle bugs from silently returning unimplemented * gradients in some corner cases. * - * @param data type for {@code output} output * @param input any tensor. * @param options carries optional attribute values * @param data type for {@code PreventGradient} output and operands @@ -641,6 +710,92 @@ public PreventGradient preventGradient(Operand input, return PreventGradient.create(scope, input, options); } + /** + * Applies a gradient to a given accumulator. + * Does not add if local_step is lesser than the accumulator's global_step. + * + * @param handle The handle to a accumulator. + * @param localStep The local_step value at which the gradient was computed. + * @param gradient A tensor of the gradient to be accumulated. + * @return a new instance of ResourceAccumulatorApplyGradient + */ + public ResourceAccumulatorApplyGradient resourceAccumulatorApplyGradient( + Operand handle, Operand localStep, + Operand gradient) { + return ResourceAccumulatorApplyGradient.create(scope, handle, localStep, gradient); + } + + /** + * Returns the number of gradients aggregated in the given accumulators. + * + * @param handle The handle to an accumulator. + * @return a new instance of ResourceAccumulatorNumAccumulated + */ + public ResourceAccumulatorNumAccumulated resourceAccumulatorNumAccumulated( + Operand handle) { + return ResourceAccumulatorNumAccumulated.create(scope, handle); + } + + /** + * Updates the accumulator with a new value for global_step. + * Logs warning if the accumulator's value is already higher than + * new_global_step. + * + * @param handle The handle to an accumulator. + * @param newGlobalStep The new global_step value to set. + * @return a new instance of ResourceAccumulatorSetGlobalStep + */ + public ResourceAccumulatorSetGlobalStep resourceAccumulatorSetGlobalStep( + Operand handle, Operand newGlobalStep) { + return ResourceAccumulatorSetGlobalStep.create(scope, handle, newGlobalStep); + } + + /** + * Extracts the average gradient in the given ConditionalAccumulator. + * The op blocks until sufficient (i.e., more than num_required) + * gradients have been accumulated. If the accumulator has already + * aggregated more than num_required gradients, it returns the average of + * the accumulated gradients. Also automatically increments the recorded + * global_step in the accumulator by 1, and resets the aggregate to 0. + * + * @param handle The handle to an accumulator. + * @param numRequired Number of gradients required before we return an aggregate. + * @param dtype The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + * @param data type for {@code ResourceAccumulatorTakeGradient} output and operands + * @return a new instance of ResourceAccumulatorTakeGradient + */ + public ResourceAccumulatorTakeGradient resourceAccumulatorTakeGradient( + Operand handle, Operand numRequired, Class dtype) { + return ResourceAccumulatorTakeGradient.create(scope, handle, numRequired, dtype); + } + + /** + * Update '*var' according to the AdaMax algorithm. + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * v_t <- max(beta2 * v_{t-1}, abs(g)) + * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) + * + * @param var Should be from a Variable(). + * @param m Should be from a Variable(). + * @param v Should be from a Variable(). + * @param beta1Power Must be a scalar. + * @param lr Scaling factor. Must be a scalar. + * @param beta1 Momentum factor. Must be a scalar. + * @param beta2 Momentum factor. Must be a scalar. + * @param epsilon Ridge term. Must be a scalar. + * @param grad The gradient. + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdaMax} output and operands + * @return a new instance of ResourceApplyAdaMax + */ + public ResourceApplyAdaMax resourceApplyAdaMax(Operand var, + Operand m, Operand v, Operand beta1Power, Operand lr, + Operand beta1, Operand beta2, Operand epsilon, Operand grad, + ResourceApplyAdaMax.Options... options) { + return ResourceApplyAdaMax.create(scope, var, m, v, beta1Power, lr, beta1, beta2, epsilon, grad, options); + } + /** * Update '*var' according to the adadelta scheme. * accum = rho() * accum + (1 - rho()) * grad.square(); @@ -666,6 +821,26 @@ public ResourceApplyAdadelta resourceApplyAdadelta(Operand data type for {@code ResourceApplyAdagradV2} output and operands + * @return a new instance of ResourceApplyAdagrad + */ + public ResourceApplyAdagrad resourceApplyAdagrad(Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, + ResourceApplyAdagrad.Options... options) { + return ResourceApplyAdagrad.create(scope, var, accum, lr, epsilon, grad, options); + } + /** * Update '*var' according to the proximal adagrad scheme. * @@ -691,10 +866,10 @@ public ResourceApplyAdagradDa resourceApplyAdagradDa( /** * Update '*var' according to the Adam algorithm. - * $$\text{lr}t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ - * $$m_t := \beta_1 * m{t-1} + (1 - \beta_1) * g$$ - * $$v_t := \beta_2 * v_{t-1} + (1 - \beta_2) * g * g$$ - * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{v_t} + \epsilon)$$ + * $$\text{lr}t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta_2^t}}{1 - \beta_1^t}$$ + * $$m_t := \beta_1 \cdot m{t-1} + (1 - \beta_1) \cdot g$$ + * $$v_t := \beta_2 \cdot v_{t-1} + (1 - \beta_2) \cdot g^2$$ + * $$\text{var} := \begin{cases} \text{var} - (m_t \beta_1 + g \cdot (1 - \beta_1))\cdot\text{lr}_t/(\sqrt{v_t} + \epsilon), &\text{if use_nesterov}\\ \text{var} - m_t \cdot \text{lr}_t /(\sqrt{v_t} + \epsilon), &\text{otherwise} \end{cases}$$ * * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -825,7 +1000,7 @@ public ResourceApplyCenteredRmsProp resourceApplyCenteredRmsPr * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ResourceApplyFtrlV2} output and operands @@ -978,7 +1153,7 @@ public ResourceApplyProximalGradientDescent resourceApplyProxi * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attribute values @@ -992,10 +1167,32 @@ public ResourceApplyRmsProp resourceApplyRmsProp(Operand data type for {@code ResourceConditionalAccumulator} output and operands + * @return a new instance of ResourceConditionalAccumulator + */ + public ResourceConditionalAccumulator resourceConditionalAccumulator( + Class dtype, Shape shape, ResourceConditionalAccumulator.Options... options) { + return ResourceConditionalAccumulator.create(scope, dtype, shape, options); + } + /** * var: Should be from a Variable(). * - * @param var the var value + * @param var The var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -1060,6 +1257,29 @@ public ResourceSparseApplyAdagradDa resourceSparseApplyAdagrad return ResourceSparseApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, indices, lr, l1, l2, globalStep, options); } + /** + * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. + * That is for rows we have grad for, we update var and accum as follows: + * accum += grad * grad + * var -= lr * grad * (1 / sqrt(accum)) + * + * @param var Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param lr Learning rate. Must be a scalar. + * @param epsilon Constant factor. Must be a scalar. + * @param grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradV2} output and operands + * @return a new instance of ResourceSparseApplyAdagradV2 + */ + public ResourceSparseApplyAdagradV2 resourceSparseApplyAdagradV2( + Operand var, Operand accum, Operand lr, + Operand epsilon, Operand grad, Operand indices, + ResourceSparseApplyAdagradV2.Options... options) { + return ResourceSparseApplyAdagradV2.create(scope, var, accum, lr, epsilon, grad, indices, options); + } + /** * Update '*var' according to the centered RMSProp algorithm. * The centered RMSProp algorithm uses an estimate of the centered second moment @@ -1082,7 +1302,7 @@ public ResourceSparseApplyAdagradDa resourceSparseApplyAdagrad * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -1117,7 +1337,7 @@ public ResourceSparseApplyCenteredRmsProp resourceSparseApplyC * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ResourceSparseApplyFtrlV2} output and operands @@ -1244,7 +1464,7 @@ public ResourceSparseApplyProximalGradientDescent resourceSpar * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -1296,7 +1516,6 @@ public Restore restore(Operand prefix, Operand tensorNames, *

    The {@code shape_and_slice} input has the same format as the * elements of the {@code shapes_and_slices} input of the {@code SaveSlices} op. * - * @param data type for {@code tensor} output * @param filePattern Must have a single element. The pattern of the files from * which we read the tensor. * @param tensorName Must have a single element. The name of the tensor to be @@ -1379,6 +1598,59 @@ public SdcaFprint sdcaFprint(Operand input) { return SdcaFprint.create(scope, input); } + /** + * Distributed version of Stochastic Dual Coordinate Ascent (SDCA) optimizer for + * linear models with L1 + L2 regularization. As global optimization objective is + * strongly-convex, the optimizer optimizes the dual objective at each step. The + * optimizer applies each update one example at a time. Examples are sampled + * uniformly, and the optimizer is learning rate free and enjoys linear convergence + * rate. + *

    Proximal Stochastic Dual Coordinate Ascent .
    + * Shai Shalev-Shwartz, Tong Zhang. 2012 + *

    $$Loss Objective = \sum f_{i} (wx_{i}) + (l2 / 2) * |w|^2 + l1 * |w|$$ + *

    Adding vs. Averaging in Distributed Primal-Dual Optimization .
    + * Chenxin Ma, Virginia Smith, Martin Jaggi, Michael I. Jordan, + * Peter Richtarik, Martin Takac. 2015 + *

    Stochastic Dual Coordinate Ascent with Adaptive Probabilities .
    + * Dominik Csiba, Zheng Qu, Peter Richtarik. 2015 + * + * @param sparseExampleIndices a list of vectors which contain example indices. + * @param sparseFeatureIndices a list of vectors which contain feature indices. + * @param sparseFeatureValues a list of vectors which contains feature value + * associated with each feature group. + * @param denseFeatures a list of matrices which contains the dense feature values. + * @param exampleWeights a vector which contains the weight associated with each + * example. + * @param exampleLabels a vector which contains the label/target associated with each + * example. + * @param sparseIndices a list of vectors where each value is the indices which has + * corresponding weights in sparse_weights. This field maybe omitted for the + * dense approach. + * @param sparseWeights a list of vectors where each value is the weight associated with + * a sparse feature group. + * @param denseWeights a list of vectors where the values are the weights associated + * with a dense feature group. + * @param exampleStateData a list of vectors containing the example state data. + * @param lossType Type of the primal loss. Currently SdcaSolver supports logistic, + * squared and hinge losses. + * @param l1 Symmetric l1 regularization strength. + * @param l2 Symmetric l2 regularization strength. + * @param numLossPartitions Number of partitions of the global loss function. + * @param numInnerIterations Number of iterations per mini-batch. + * @param options carries optional attribute values + * @return a new instance of SdcaOptimizer + */ + public SdcaOptimizer sdcaOptimizer(Iterable> sparseExampleIndices, + Iterable> sparseFeatureIndices, + Iterable> sparseFeatureValues, Iterable> denseFeatures, + Operand exampleWeights, Operand exampleLabels, + Iterable> sparseIndices, Iterable> sparseWeights, + Iterable> denseWeights, Operand exampleStateData, String lossType, + Float l1, Float l2, Long numLossPartitions, Long numInnerIterations, + SdcaOptimizer.Options... options) { + return SdcaOptimizer.create(scope, sparseExampleIndices, sparseFeatureIndices, sparseFeatureValues, denseFeatures, exampleWeights, exampleLabels, sparseIndices, sparseWeights, denseWeights, exampleStateData, lossType, l1, l2, numLossPartitions, numInnerIterations, options); + } + /** * Applies L1 regularization shrink step on the parameters. * @@ -1395,8 +1667,7 @@ public SdcaShrinkL1 sdcaShrinkL1(Iterable> weights, Float l1, /** * var: Should be from a Variable(). * - * @param data type for {@code out} output - * @param var the var value + * @param var The var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -1414,10 +1685,31 @@ public SparseApplyAdadelta sparseApplyAdadelta(Operand v return SparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); } + /** + * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. + * That is for rows we have grad for, we update var and accum as follows: + * $$accum += grad * grad$$ + * $$var -= lr * grad * (1 / sqrt(accum))$$ + * + * @param var Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param lr Learning rate. Must be a scalar. + * @param epsilon Constant factor. Must be a scalar. + * @param grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradV2} output and operands + * @return a new instance of SparseApplyAdagrad + */ + public SparseApplyAdagrad sparseApplyAdagrad(Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, + Operand indices, SparseApplyAdagrad.Options... options) { + return SparseApplyAdagrad.create(scope, var, accum, lr, epsilon, grad, indices, options); + } + /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). * @param gradientSquaredAccumulator Should be from a Variable(). @@ -1454,14 +1746,13 @@ public SparseApplyAdagradDa sparseApplyAdagradDa(Operand * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ * $$var <- var - mom$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param mg Should be from a Variable(). * @param ms Should be from a Variable(). * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -1487,7 +1778,6 @@ public SparseApplyCenteredRmsProp sparseApplyCenteredRmsPro * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param linear Should be from a Variable(). @@ -1496,7 +1786,7 @@ public SparseApplyCenteredRmsProp sparseApplyCenteredRmsPro * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code SparseApplyFtrlV2} output and operands @@ -1516,7 +1806,6 @@ public SparseApplyFtrl sparseApplyFtrl(Operand var, Oper *

    $$accum = accum * momentum + grad$$ * $$var -= lr * accum$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -1541,7 +1830,6 @@ public SparseApplyMomentum sparseApplyMomentum(Operand v * $$prox_v -= lr * grad * (1 / sqrt(accum))$$ * $$var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0}$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -1565,7 +1853,6 @@ public SparseApplyProximalAdagrad sparseApplyProximalAdagra * $$prox_v = var - alpha * grad$$ * $$var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0}$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. @@ -1593,13 +1880,12 @@ public SparseApplyProximalGradientDescent sparseApplyProxim * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ * $$var <- var - mom$$ * - * @param data type for {@code out} output * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -1645,9 +1931,8 @@ public SymbolicGradient symbolicGradient(Iterable> input, * along each dimension, {@code train.TileGrad} takes in {@code multiples} and aggregates * each repeated tile of {@code input} into {@code output}. * - * @param data type for {@code output} output - * @param input the input value - * @param multiples the multiples value + * @param input The input value + * @param multiples The multiples value * @param data type for {@code TileGrad} output and operands * @return a new instance of TileGrad */ 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 9318cd63614..38961e1570a 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 @@ -1,4 +1,4 @@ -// Copyright 2020 The TensorFlow Authors. All Rights Reserved. +// Copyright 2020-2022 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. @@ -21,41 +21,32 @@ import org.tensorflow.ConcreteFunction; import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; -import org.tensorflow.op.xla.BroadcastHelper; -import org.tensorflow.op.xla.ClusterOutput; -import org.tensorflow.op.xla.Conv; -import org.tensorflow.op.xla.Dequantize; -import org.tensorflow.op.xla.Dot; -import org.tensorflow.op.xla.DynamicSlice; -import org.tensorflow.op.xla.DynamicUpdateSlice; -import org.tensorflow.op.xla.Einsum; -import org.tensorflow.op.xla.Gather; -import org.tensorflow.op.xla.If; -import org.tensorflow.op.xla.KeyValueSort; -import org.tensorflow.op.xla.Pad; -import org.tensorflow.op.xla.Recv; -import org.tensorflow.op.xla.Reduce; -import org.tensorflow.op.xla.ReduceWindow; -import org.tensorflow.op.xla.RemoveDynamicDimensionSize; -import org.tensorflow.op.xla.ReplicaId; -import org.tensorflow.op.xla.Scatter; -import org.tensorflow.op.xla.SelectAndScatter; -import org.tensorflow.op.xla.SelfAdjointEig; -import org.tensorflow.op.xla.Send; -import org.tensorflow.op.xla.SetDynamicDimensionSize; -import org.tensorflow.op.xla.Sharding; -import org.tensorflow.op.xla.Sort; -import org.tensorflow.op.xla.SpmdFullToShardShape; -import org.tensorflow.op.xla.SpmdShardToFullShape; -import org.tensorflow.op.xla.Svd; -import org.tensorflow.op.xla.While; +import org.tensorflow.op.xla.AssignVariableConcatND; +import org.tensorflow.op.xla.ConcatND; +import org.tensorflow.op.xla.ReadVariableSplitND; +import org.tensorflow.op.xla.SplitND; import org.tensorflow.op.xla.XlaHostCompute; -import org.tensorflow.op.xla.XlaLaunch; import org.tensorflow.op.xla.XlaRecvFromHost; import org.tensorflow.op.xla.XlaSendToHost; -import org.tensorflow.op.xla.XlaSetBound; -import org.tensorflow.op.xla.XlaVariadicReduce; -import org.tensorflow.op.xla.XlaVariadicSort; +import org.tensorflow.op.xla.XlaSparseActivationsUnstack; +import org.tensorflow.op.xla.XlaSparseCoreAdagrad; +import org.tensorflow.op.xla.XlaSparseCoreAdagradMomentum; +import org.tensorflow.op.xla.XlaSparseCoreAdam; +import org.tensorflow.op.xla.XlaSparseCoreFtrl; +import org.tensorflow.op.xla.XlaSparseCoreSgd; +import org.tensorflow.op.xla.XlaSparseDenseMatmul; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdamAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithFtrlAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithSgdAndCsrInput; +import org.tensorflow.op.xla.XlaSparseDenseMatmulWithCsrInput; +import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -63,7 +54,7 @@ /** * An API for building {@code xla} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class XlaOps { private final Scope scope; @@ -76,532 +67,184 @@ public final class XlaOps { } /** - * Helper operator for performing XLA-style broadcasts - * Broadcasts {@code lhs} and {@code rhs} to the same rank, by adding size 1 dimensions to - * whichever of {@code lhs} and {@code rhs} has the lower rank, using XLA's broadcasting rules - * for binary operators. - * - * @param data type for {@code lhs_output} output - * @param lhs the LHS input tensor - * @param rhs the RHS input tensor - * @param broadcastDims an XLA-style broadcast dimension specification - * @param data type for {@code XlaBroadcastHelper} output and operands - * @return a new instance of BroadcastHelper - */ - public BroadcastHelper broadcastHelper(Operand lhs, Operand rhs, - Operand broadcastDims) { - return BroadcastHelper.create(scope, lhs, rhs, broadcastDims); - } - - /** - * Operator that connects the output of an XLA computation to other consumer graph nodes. - * - * @param data type for {@code outputs} output - * @param input the input value - * @param data type for {@code XlaClusterOutput} output and operands - * @return a new instance of ClusterOutput - */ - public ClusterOutput clusterOutput(Operand input) { - return ClusterOutput.create(scope, input); - } - - /** - * Wraps the XLA ConvGeneralDilated operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution - * . - * - * @param data type for {@code output} output - * @param lhs the input tensor - * @param rhs the kernel tensor - * @param windowStrides the inter-window strides - * @param padding the padding to apply at the start and end of each input dimensions - * @param lhsDilation dilation to apply between input elements - * @param rhsDilation dilation to apply between kernel elements - * @param featureGroupCount number of feature groups for grouped convolution. - * @param dimensionNumbers a serialized xla::ConvolutionDimensionNumbers proto. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param preferredElementType The type of the tensor. - * @param data type for {@code XlaConvV2} output and operands - * @param data type for {@code XlaConvV2} output and operands - * @return a new instance of Conv - */ - public Conv conv(Operand lhs, - Operand rhs, Operand windowStrides, Operand padding, - Operand lhsDilation, Operand rhsDilation, Operand featureGroupCount, - String dimensionNumbers, String precisionConfig, Class preferredElementType) { - return Conv.create(scope, lhs, rhs, windowStrides, padding, lhsDilation, rhsDilation, featureGroupCount, dimensionNumbers, precisionConfig, preferredElementType); - } - - /** - * Takes the packed uint32 input and unpacks the input to uint8 to do - * Dequantization on device. - * - * @param input Input tensors whose types is uint32, shape is [d0, ..., dn]. - * @param minRange The minimum scalar value possibly produced for the input. - * @param maxRange The maximum scalar value possibly produced for the input. - * @param mode String to determine the dequantize mode in {"MIN_COMBINED", "MIN_FIRST", "SCALED"}. - * @param transposeOutput Boolean to determine if output is transposed. transpose_output - * is faster when input is large and rank of input is higher than 1. - * @return a new instance of Dequantize - */ - public Dequantize dequantize(Operand input, Float minRange, Float maxRange, - String mode, Boolean transposeOutput) { - return Dequantize.create(scope, input, minRange, maxRange, mode, transposeOutput); - } - - /** - * Wraps the XLA DotGeneral operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral - * . - * - * @param data type for {@code output} output - * @param lhs the LHS tensor - * @param rhs the RHS tensor - * @param dimensionNumbers a serialized xla::DotDimensionNumbers proto. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param preferredElementType The type of the tensor. - * @param data type for {@code XlaDotV2} output and operands - * @return a new instance of Dot - */ - public Dot dot(Operand lhs, Operand rhs, - String dimensionNumbers, String precisionConfig, Class preferredElementType) { - return Dot.create(scope, lhs, rhs, dimensionNumbers, precisionConfig, preferredElementType); - } - - /** - * Wraps the XLA DynamicSlice operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice - * . - *

    DynamicSlice extracts a sub-array from the input array at dynamic - * start_indices. The size of the slice in each dimension is passed in - * size_indices, which specify the end point of exclusive slice intervals in each - * dimension -- [start, start + size). The shape of start_indices must have rank 1, - * with dimension size equal to the rank of operand. - * - * @param data type for {@code output} output - * @param input A {@code Tensor} of type T. - * @param startIndices List of N integers containing the slice size for each - * dimension. Each value must be strictly greater than zero, and start + size - * must be less than or equal to the size of the dimension to avoid - * implementation defined behavior. - * @param sizeIndices the sizeIndices value - * @param data type for {@code XlaDynamicSlice} output and operands - * @param data type for {@code XlaDynamicSlice} output and operands - * @return a new instance of DynamicSlice - */ - public DynamicSlice dynamicSlice(Operand input, - Operand startIndices, Operand sizeIndices) { - return DynamicSlice.create(scope, input, startIndices, sizeIndices); - } - - /** - * Wraps the XLA DynamicUpdateSlice operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice - * . - *

    XlaDynamicUpdateSlice generates a result which is the value of the {@code input} - * operand, with a slice update overwritten at {@code indices}. The shape of {@code update} - * determines the shape of the sub-array of the result which is updated. The shape - * of indices must be rank == 1, with dimension size equal to the rank of {@code input}. - *

    Handling of out-of-bounds slice indices is implementation-defined. - * - * @param data type for {@code output} output - * @param input A {@code Tensor} of type T. - * @param update A {@code Tensor} of type T. Same rank as {@code input}. - * @param indices A vector of indices into {@code input}. Must have length equal to the rank of - * {@code input}. - * @param data type for {@code XlaDynamicUpdateSlice} output and operands - * @return a new instance of DynamicUpdateSlice - */ - public DynamicUpdateSlice dynamicUpdateSlice(Operand input, - Operand update, Operand indices) { - return DynamicUpdateSlice.create(scope, input, update, indices); - } - - /** - * An op which supports basic einsum op with 2 inputs and 1 output. - * This op has better TPU performance since it doesn't have explicitly reshape and - * transpose operations as tf.einsum does. - * - * @param data type for {@code product} output - * @param a the a value - * @param b the b value - * @param equation the value of the equation property - * @param data type for {@code XlaEinsum} output and operands - * @return a new instance of Einsum - */ - public Einsum einsum(Operand a, Operand b, String equation) { - return Einsum.create(scope, a, b, equation); - } - - /** - * Wraps the XLA Gather operator documented at - * https://www.tensorflow.org/xla/operation_semantics#gather - * - * @param data type for {@code output} output - * @param operand The array we're gathering from. - * @param startIndices Array containing the starting indices of the slices we gather. - * @param sliceSizes slice_sizes[i] is the bounds for the slice on dimension i. - * @param dimensionNumbers A serialized xla::GatherDimensionNumbers proto. - * @param indicesAreSorted Boolean indicating if the indices are sorted. - * @param data type for {@code XlaGather} output and operands - * @param data type for {@code XlaGather} output and operands - * @return a new instance of Gather - */ - public Gather gather(Operand operand, - Operand startIndices, Operand sliceSizes, String dimensionNumbers, - Boolean indicesAreSorted) { - return Gather.create(scope, operand, startIndices, sliceSizes, dimensionNumbers, indicesAreSorted); - } - - /** - * output = cond ? then_branch(inputs) : else_branch(inputs). - * - * @param cond A boolean scalar. - * @param inputs A list of input tensors. - * @param thenBranch A function takes 'inputs' and returns a list of tensors, - * whose types are the same as what else_branch returns. - * @param elseBranch A function takes 'inputs' and returns a list of tensors. - * whose types are the same as what then_branch returns. - * @param Tout the value of the Tout property - * @return a new instance of If - */ - public If ifOp(Operand cond, Iterable> inputs, - ConcreteFunction thenBranch, ConcreteFunction elseBranch, List> Tout) { - return If.create(scope, cond, inputs, thenBranch, elseBranch, Tout); - } - - /** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code sorted_keys} output - * @param data type for {@code sorted_values} output - * @param keys A {@code Tensor} of type K. - * @param values A {@code Tensor} of type V. - * @param data type for {@code XlaKeyValueSort} output and operands - * @param data type for {@code XlaKeyValueSort} output and operands - * @return a new instance of KeyValueSort - */ - public KeyValueSort keyValueSort(Operand keys, - Operand values) { - return KeyValueSort.create(scope, keys, values); - } - - /** - * Wraps the XLA Pad operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#pad - * . - * - * @param data type for {@code output} output - * @param input A {@code Tensor} of type T. - * @param paddingValue A scalar {@code Tensor} of type T. - * @param paddingLow the padding to apply at the start of each input dimensions. Must - * be a compile-time constant 1D tensor of length equal to rank of input. - * @param paddingHigh the padding to apply at the end of each input dimension. Must - * be a compile-time constant 1D tensor of length equal to rank of input. - * @param paddingInterior the padding to apply between each input element. Must - * be a compile-time constant 1D tensor of length equal to rank of input, - * containing only non-negative values. - * @param data type for {@code XlaPad} output and operands - * @param data type for {@code XlaPad} output and operands - * @return a new instance of Pad - */ - public Pad pad(Operand input, Operand paddingValue, - Operand paddingLow, Operand paddingHigh, Operand paddingInterior) { - return Pad.create(scope, input, paddingValue, paddingLow, paddingHigh, paddingInterior); - } - - /** - * Receives the named tensor from another XLA computation. Wraps the XLA Recv - * operator documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#recv . - * - * @param data type for {@code tensor} output - * @param dtype The type of the tensor. - * @param tensorName A string key that identifies the channel. - * @param shape The shape of the tensor. - * @param data type for {@code XlaRecv} output and operands - * @return a new instance of Recv - */ - public Recv recv(Class dtype, String tensorName, Shape shape) { - return Recv.create(scope, dtype, tensorName, shape); - } - - /** - * Wraps the XLA Reduce operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#reduce . - * - * @param data type for {@code output} output - * @param input the input tensor - * @param initValue a scalar representing the initial value for the reduction - * @param dimensionsToReduce dimension numbers over which to reduce - * @param reducer a reducer function to apply - * @param data type for {@code XlaReduce} output and operands - * @return a new instance of Reduce - */ - public Reduce reduce(Operand input, Operand initValue, - List dimensionsToReduce, ConcreteFunction reducer) { - return Reduce.create(scope, input, initValue, dimensionsToReduce, reducer); - } - - /** - * Wraps the XLA ReduceWindow operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow . - * - * @param data type for {@code output} output - * @param input the input tensor - * @param initValue a scalar representing the initial value for the reduction - * @param windowDimensions the shape of the window - * @param windowStrides the inter-window strides - * @param baseDilations the baseDilations value - * @param windowDilations the windowDilations value - * @param padding the padding to apply at the start and end of each input dimensions - * @param computation a reducer function to apply - * @param data type for {@code XlaReduceWindow} output and operands - * @param data type for {@code XlaReduceWindow} output and operands - * @return a new instance of ReduceWindow - */ - public ReduceWindow reduceWindow(Operand input, - Operand initValue, Operand windowDimensions, Operand windowStrides, - Operand baseDilations, Operand windowDilations, Operand padding, - ConcreteFunction computation) { - return ReduceWindow.create(scope, input, initValue, windowDimensions, windowStrides, baseDilations, windowDilations, padding, computation); - } - - /** - * Inverse of XlaSetDynamicDimensionSize. Make an xla bounded + * Concats input tensor across all dimensions. + * An op which merges slices the input tensor based on the given num_splits + * attribute, strips paddings optionally, and writes the merged tensor without + * paddings to the resource variable. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: *

    -   *      dynamic dimension into a static dimension. The bound of the size of
    -   *      dimension `dim_index` becomes the static dimension size.
    +   *  [[0, 1],
    +   *   [4, 5]]
    +   *  [[2, 3],
    +   *   [6, 7]]
    +   *  [[8, 9],
    +   *   [12, 13]]
    +   *  [[10, 11],
    +   *   [14, 15]]
        *  
    - * - * @param data type for {@code output} output - * @param input the input value - * @param dimIndex the dimIndex value - * @param data type for {@code XlaRemoveDynamicDimensionSize} output and operands - * @return a new instance of RemoveDynamicDimensionSize - */ - public RemoveDynamicDimensionSize removeDynamicDimensionSize( - Operand input, Operand dimIndex) { - return RemoveDynamicDimensionSize.create(scope, input, dimIndex); - } - - /** - * Replica ID. - * - * @return a new instance of ReplicaId - */ - public ReplicaId replicaId() { - return ReplicaId.create(scope); - } - - /** - * Wraps the XLA Scatter operator documented at - * https://www.tensorflow.org/xla/operation_semantics#scatter. - * - * @param data type for {@code output} output - * @param operand Array to be scattered into. - * @param scatterIndices Array containing the starting indices of the slices that must - * be scattered to. - * @param updates Array containing the values that must be used for scattering. - * @param updateComputation Computation to be used for combining the existing values in - * the input array and the updates during scatter. - * @param dimensionNumbers A serialized xla::ScatterDimensionNumbers proto. - * @param indicesAreSorted Boolean indicating if the indices are sorted. - * @param data type for {@code XlaScatter} output and operands - * @return a new instance of Scatter - */ - public Scatter scatter(Operand operand, - Operand scatterIndices, Operand updates, - ConcreteFunction updateComputation, String dimensionNumbers, Boolean indicesAreSorted) { - return Scatter.create(scope, operand, scatterIndices, updates, updateComputation, dimensionNumbers, indicesAreSorted); - } - - /** - * Wraps the XLA SelectAndScatter operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#selectandscatter - * . - * - * @param data type for {@code output} output - * @param operand the input tensor - * @param windowDimensions the shape of the window - * @param windowStrides the inter-window strides - * @param padding the padding to apply at the start and end of each input dimensions - * @param source a tensor of values to scatter - * @param initValue a scalar representing the initial value for the output tensor - * @param select a selection function to apply - * @param scatter a scatter function to apply - * @param data type for {@code XlaSelectAndScatter} output and operands - * @param data type for {@code XlaSelectAndScatter} output and operands - * @return a new instance of SelectAndScatter - */ - public SelectAndScatter selectAndScatter( - Operand operand, Operand windowDimensions, Operand windowStrides, Operand padding, - Operand source, Operand initValue, ConcreteFunction select, ConcreteFunction scatter) { - return SelectAndScatter.create(scope, operand, windowDimensions, windowStrides, padding, source, initValue, select, scatter); - } - - /** - * Computes the eigen decomposition of a batch of self-adjoint matrices - * (Note: Only real inputs are supported). - *

    Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in - * tensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for - * i=0...N-1. - * - * @param data type for {@code w} output - * @param a the input tensor. - * @param lower a boolean specifies whether the calculation is done with the lower - * triangular part or the upper triangular part. - * @param maxIter maximum number of sweep update, i.e., the whole lower triangular - * part or upper triangular part based on parameter lower. Heuristically, it has - * been argued that approximately logN sweeps are needed in practice (Ref: Golub & - * van Loan "Matrix Computation"). - * @param epsilon the tolerance ratio. - * @param data type for {@code XlaSelfAdjointEig} output and operands - * @return a new instance of SelfAdjointEig - */ - public SelfAdjointEig selfAdjointEig(Operand a, Boolean lower, - Long maxIter, Float epsilon) { - return SelfAdjointEig.create(scope, a, lower, maxIter, epsilon); - } - - /** - * Sends the named tensor to another XLA computation. Wraps the XLA Send operator - * documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#send . - * - * @param tensor The tensor to send. - * @param tensorName A string key that identifies the channel. - * @return a new instance of Send - */ - public Send send(Operand tensor, String tensorName) { - return Send.create(scope, tensor, tensorName); - } - - /** - * Make a static dimension into a xla bounded dynamic dimension. + *

    {@code num_splits}: *

    -   *      The current static dimension size will become the bound and the second
    -   *      operand becomes the dynamic size of the dimension.
    +   *  [2, 2]
    +   *  
    + *

    and {@code paddings}: + *

    +   *  [1, 1]
    +   *  
    + *

    the expected {@code outputs} is: + *

    +   *  [[0, 1, 2],
    +   *   [4, 5, 6],
    +   *   [8, 9, 10]]
        *  
    * - * @param data type for {@code output} output - * @param input the input value - * @param dimIndex the dimIndex value - * @param sizeOutput the sizeOutput value - * @param data type for {@code XlaSetDynamicDimensionSize} output and operands - * @return a new instance of SetDynamicDimensionSize - */ - public SetDynamicDimensionSize setDynamicDimensionSize(Operand input, - Operand dimIndex, Operand sizeOutput) { - return SetDynamicDimensionSize.create(scope, input, dimIndex, sizeOutput); - } - - /** - * An op which shards the input based on the given sharding attribute. - * - * @param data type for {@code output} output - * @param input the input value + * @param resource Resource variable for concatenated input tensors across all dimensions. + * @param inputs Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + * @param numConcats Number of ways to merge per dimension. * @param options carries optional attribute values - * @param data type for {@code XlaSharding} output and operands - * @return a new instance of Sharding - */ - public Sharding sharding(Operand input, Sharding.Options... options) { - return Sharding.create(scope, input, options); - } - - /** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code output} output - * @param input A {@code Tensor} of type T. - * @param data type for {@code XlaSort} output and operands - * @return a new instance of Sort + * @return a new instance of AssignVariableConcatND */ - public Sort sort(Operand input) { - return Sort.create(scope, input); + public AssignVariableConcatND assignVariableConcatND(Operand resource, + Iterable> inputs, List numConcats, + AssignVariableConcatND.Options... options) { + return AssignVariableConcatND.create(scope, resource, inputs, numConcats, options); } /** - * An op used by XLA SPMD partitioner to switch from automatic partitioning to - * manual partitioning. It annotates the input (full-shape, to be automatically - * partitioned) with the same sharding used by manual partitioning, and outputs a - * shard-shaped tensor to be consumed by later manually-partitioned ops. If the - * shape is not evenly partitionable, the padding region will be masked with 0s. - * - * @param data type for {@code output} output - * @param input the input value - * @param manualSharding the value of the manualSharding property - * @param data type for {@code XlaSpmdFullToShardShape} output and operands - * @return a new instance of SpmdFullToShardShape - */ - public SpmdFullToShardShape spmdFullToShardShape(Operand input, - String manualSharding) { - return SpmdFullToShardShape.create(scope, input, manualSharding); - } - - /** - * An op used by XLA SPMD partitioner to switch from manual partitioning to - * automatic partitioning. It converts the shard-shaped, manually partitioned input - * into full-shaped tensor to be partitioned automatically with the same sharding - * used by manual partitioning. + * Concats input tensor across all dimensions. + * An op which merges slices the input tensor based on the given num_splits + * attribute, strips paddings optionally, and returns the merged tensor without + * paddings. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    +   *  [[0, 1],
    +   *   [4, 5]]
    +   *  [[2, 3],
    +   *   [6, 7]]
    +   *  [[8, 9],
    +   *   [12, 13]]
    +   *  [[10, 11],
    +   *   [14, 15]]
    +   *  
    + *

    {@code num_splits}: + *

    +   *  [2, 2]
    +   *  
    + *

    and {@code paddings}: + *

    +   *  [1, 1]
    +   *  
    + *

    the expected {@code outputs} is: + *

    +   *  [[0, 1, 2],
    +   *   [4, 5, 6],
    +   *   [8, 9, 10]]
    +   *  
    * - * @param data type for {@code output} output - * @param input the input value - * @param manualSharding the value of the manualSharding property - * @param fullShape the value of the fullShape property - * @param data type for {@code XlaSpmdShardToFullShape} output and operands - * @return a new instance of SpmdShardToFullShape + * @param inputs Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + * @param numConcats Number of ways to merge per dimension. + * @param options carries optional attribute values + * @param data type for {@code XlaConcatND} output and operands + * @return a new instance of ConcatND */ - public SpmdShardToFullShape spmdShardToFullShape(Operand input, - String manualSharding, Shape fullShape) { - return SpmdShardToFullShape.create(scope, input, manualSharding, fullShape); + public ConcatND concatND(Iterable> inputs, List numConcats, + ConcatND.Options... options) { + return ConcatND.create(scope, inputs, numConcats, options); } /** - * Computes the eigen decomposition of a batch of self-adjoint matrices - * (Note: Only real inputs are supported). - *

    Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in - * tensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]). + * Splits resource variable input tensor across all dimensions. + * An op which splits the resource variable input tensor based on the given + * num_splits attribute, pads slices optionally, and returned the slices. Slices + * are returned in row-major order. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    +   *  [[0, 1, 2],
    +   *   [3, 4, 5],
    +   *   [6, 7, 8]]
    +   *  
    + *

    {@code num_splits}: + *

    +   *  [2, 2]
    +   *  
    + *

    and {@code paddings}: + *

    +   *  [1, 1]
    +   *  
    + *

    the expected {@code outputs} is: + *

    +   *  [[0, 1],
    +   *   [3, 4]]
    +   *  [[2, 0],
    +   *   [5, 0]]
    +   *  [[6, 7],
    +   *   [0, 0]]
    +   *  [[8, 0],
    +   *   [0, 0]]
    +   *  
    * - * @param data type for {@code s} output - * @param a the input tensor. - * @param maxIter maximum number of sweep update, i.e., the whole lower triangular - * part or upper triangular part based on parameter lower. Heuristically, it has - * been argued that approximately log(min (M, N)) sweeps are needed in practice - * (Ref: Golub & van Loan "Matrix Computation"). - * @param epsilon the tolerance ratio. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param data type for {@code XlaSvd} output and operands - * @return a new instance of Svd + * @param resource Resource variable of input tensor to split across all dimensions. + * @param T The value of the T attribute + * @param N The value of the N attribute + * @param numSplits Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + * @param options carries optional attribute values + * @param data type for {@code ReadVariableXlaSplitND} output and operands + * @return a new instance of ReadVariableSplitND */ - public Svd svd(Operand a, Long maxIter, Float epsilon, - String precisionConfig) { - return Svd.create(scope, a, maxIter, epsilon, precisionConfig); + public ReadVariableSplitND readVariableSplitND( + Operand resource, Class T, Long N, List numSplits, + ReadVariableSplitND.Options... options) { + return ReadVariableSplitND.create(scope, resource, T, N, numSplits, options); } /** - * output = input; While (Cond(output)) { output = Body(output) } + * Splits input tensor across all dimensions. + * An op which slices the input tensor based on the given num_splits attribute, + * pads slices optionally, and returned the slices. Slices are returned in + * row-major order. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    +   *  [[0, 1, 2],
    +   *   [3, 4, 5],
    +   *   [6, 7, 8]]
    +   *  
    + *

    {@code num_splits}: + *

    +   *  [2, 2]
    +   *  
    + *

    and {@code paddings}: + *

    +   *  [1, 1]
    +   *  
    + *

    the expected {@code outputs} is: + *

    +   *  [[0, 1],
    +   *   [3, 4]]
    +   *  [[2, 0],
    +   *   [5, 0]]
    +   *  [[6, 7],
    +   *   [0, 0]]
    +   *  [[8, 0],
    +   *   [0, 0]]
    +   *  
    * - * @param input A list of input tensors whose types are T. - * @param cond A function takes 'input' and returns a tensor. If the tensor is - * a scalar of non-boolean, the scalar is converted to a boolean - * according to the following rule: if the scalar is a numerical - * value, non-zero means True and zero means False; if the scalar is - * a string, non-empty means True and empty means False. If the - * tensor is not a scalar, non-emptiness means True and False - * otherwise. - * @param body A function that takes a list of tensors and returns another - * list of tensors. Both lists have the same types as specified by T. - * @return a new instance of While + * @param input Input tensor to split across all dimensions. + * @param N The value of the N attribute + * @param numSplits Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + * @param options carries optional attribute values + * @param data type for {@code XlaSplitND} output and operands + * @return a new instance of SplitND */ - public While whileOp(Iterable> input, ConcreteFunction cond, ConcreteFunction body) { - return While.create(scope, input, cond, body); + public SplitND splitND(Operand input, Long N, List numSplits, + SplitND.Options... options) { + return SplitND.create(scope, input, N, numSplits, options); } /** @@ -624,22 +267,6 @@ public XlaHostCompute xlaHostCompute(Iterable> inputs, return XlaHostCompute.create(scope, inputs, Toutputs, ancestors, shapes, shapeInferenceGraph, key, options); } - /** - * XLA Launch Op. For use by the XLA JIT only. - * - * @param constants the constants value - * @param args the args value - * @param resources the resources value - * @param Tresults the value of the Tresults property - * @param function the value of the function property - * @return a new instance of XlaLaunch - */ - public XlaLaunch xlaLaunch(Iterable> constants, Iterable> args, - Iterable> resources, List> Tresults, - ConcreteFunction function) { - return XlaLaunch.create(scope, constants, args, resources, Tresults, function); - } - /** * An op to receive a tensor from the host. * output: the tensor that will be received from the host. @@ -647,10 +274,9 @@ public XlaLaunch xlaLaunch(Iterable> constants, Iterable> * 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 the value of the Toutput property - * @param shape the value of the shape property - * @param key the value of the key property + * @param Toutput The value of the Toutput attribute + * @param shape The value of the shape attribute + * @param key The value of the key attribute * @param data type for {@code XlaRecvFromHost} output and operands * @return a new instance of XlaRecvFromHost */ @@ -665,8 +291,8 @@ public XlaRecvFromHost xlaRecvFromHost(Class Toutput, Sh * Tinput: element type for input. * key: A unique identifier for this region used to match up host transfers. * - * @param input the input value - * @param key the value of the key property + * @param input The input value + * @param key The value of the key attribute * @return a new instance of XlaSendToHost */ public XlaSendToHost xlaSendToHost(Operand input, String key) { @@ -674,55 +300,532 @@ public XlaSendToHost xlaSendToHost(Operand input, String key) { } /** - * Set a bound for the given input value as a hint to Xla compiler, - *
    -   *      returns the same value.
    -   *  
    - * - * @param input the input value - * @param bound the bound value - * @return a new instance of XlaSetBound + * The XlaSparseActivationsUnstack operation + * + * @param stackedActivations The stackedActivations value + * @param numTables The value of the numTables attribute + * @param sampleCounts The value of the sampleCounts attribute + * @param features The value of the features attribute + * @param interleaved The value of the interleaved attribute + * @param dtype The value of the dtype attribute + * @param data type for {@code XlaSparseActivationsUnstack} output and operands + * @return a new instance of XlaSparseActivationsUnstack */ - public XlaSetBound xlaSetBound(Operand input, Operand bound) { - return XlaSetBound.create(scope, input, bound); + public XlaSparseActivationsUnstack xlaSparseActivationsUnstack( + Operand stackedActivations, Long numTables, List sampleCounts, + List features, Boolean interleaved, Class dtype) { + return XlaSparseActivationsUnstack.create(scope, stackedActivations, numTables, sampleCounts, features, interleaved, dtype); } - + /** - * Wraps the variadic XLA Reduce operator. - * Semantics are documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce. + * The XlaSparseCoreAdagrad operation * - * @param data type for {@code output} output - * @param input the input tensor(s) - * @param initValue scalar initial value(s) for the reduction - * @param dimensionsToReduce dimension numbers over which to reduce - * @param reducer a reducer function to apply - * @param data type for {@code XlaVariadicReduce} output and operands - * @return a new instance of XlaVariadicReduce + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param accumulator The accumulator value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @return a new instance of XlaSparseCoreAdagrad */ - public XlaVariadicReduce xlaVariadicReduce(Iterable> input, - Iterable> initValue, List dimensionsToReduce, ConcreteFunction reducer) { - return XlaVariadicReduce.create(scope, input, initValue, dimensionsToReduce, reducer); + public XlaSparseCoreAdagrad xlaSparseCoreAdagrad(Operand indices, + Operand gradient, Operand learningRate, Operand accumulator, + Operand embeddingTable, Long featureWidth) { + return XlaSparseCoreAdagrad.create(scope, indices, gradient, learningRate, accumulator, embeddingTable, featureWidth); } /** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts one or more tensors, with support for custom comparator, dimension, and - * is_stable attributes. + * The XlaSparseCoreAdagradMomentum operation * - * @param inputs A list of {@code Tensor} of identical shape but possibly different types. - * @param dimension The dimension along which to sort. Must be a compile-time constant. - * @param comparator A comparator function to apply to 2*N scalars and returning a - * boolean. N is the number of sort inputs. If you want to sort in ascending - * order then the comparator should perform a less-than comparison. - * @param isStable Whether to use stable sort. - * @return a new instance of XlaVariadicSort + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param beta1 The beta1 value + * @param epsilon The epsilon value + * @param accumulator The accumulator value + * @param momentum The momentum value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @param useNesterov The value of the useNesterov attribute + * @param beta2 The value of the beta2 attribute + * @param exponent The value of the exponent attribute + * @return a new instance of XlaSparseCoreAdagradMomentum */ - public XlaVariadicSort xlaVariadicSort(Iterable> inputs, Operand dimension, - ConcreteFunction comparator, Boolean isStable) { - return XlaVariadicSort.create(scope, inputs, dimension, comparator, isStable); + public XlaSparseCoreAdagradMomentum xlaSparseCoreAdagradMomentum(Operand indices, + Operand gradient, Operand learningRate, Operand beta1, + Operand epsilon, Operand accumulator, Operand momentum, + Operand embeddingTable, Long featureWidth, Boolean useNesterov, Float beta2, + Float exponent) { + return XlaSparseCoreAdagradMomentum.create(scope, indices, gradient, learningRate, beta1, epsilon, accumulator, momentum, embeddingTable, featureWidth, useNesterov, beta2, exponent); + } + + /** + * The XlaSparseCoreAdam operation + * + * @param embeddingTable The embeddingTable value + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param momentum The momentum value + * @param velocity The velocity value + * @param beta1 The beta1 value + * @param beta2 The beta2 value + * @param epsilon The epsilon value + * @param featureWidth The value of the featureWidth attribute + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @return a new instance of XlaSparseCoreAdam + */ + public XlaSparseCoreAdam xlaSparseCoreAdam(Operand embeddingTable, + Operand indices, Operand gradient, Operand learningRate, + Operand momentum, Operand velocity, Operand beta1, + Operand beta2, Operand epsilon, Long featureWidth, + Boolean useSumInsideSqrt) { + return XlaSparseCoreAdam.create(scope, embeddingTable, indices, gradient, learningRate, momentum, velocity, beta1, beta2, epsilon, featureWidth, useSumInsideSqrt); + } + + /** + * The XlaSparseCoreFtrl operation + * + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param learningRate The learningRate value + * @param indices The indices value + * @param gradient The gradient value + * @param beta The beta value + * @param learningRatePower The learningRatePower value + * @param l2RegularizationStrength The l2RegularizationStrength value + * @param featureWidth The value of the featureWidth attribute + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @return a new instance of XlaSparseCoreFtrl + */ + public XlaSparseCoreFtrl xlaSparseCoreFtrl(Operand embeddingTable, + Operand accumulator, Operand linear, Operand learningRate, + Operand indices, Operand gradient, Operand beta, + Operand learningRatePower, Operand l2RegularizationStrength, + Long featureWidth, Boolean multiplyLinearByLearningRate, Float l1RegularizationStrength) { + return XlaSparseCoreFtrl.create(scope, embeddingTable, accumulator, linear, learningRate, indices, gradient, beta, learningRatePower, l2RegularizationStrength, featureWidth, multiplyLinearByLearningRate, l1RegularizationStrength); + } + + /** + * The XlaSparseCoreSgd operation + * + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @return a new instance of XlaSparseCoreSgd + */ + public XlaSparseCoreSgd xlaSparseCoreSgd(Operand indices, Operand gradient, + Operand learningRate, Operand embeddingTable, Long featureWidth) { + return XlaSparseCoreSgd.create(scope, indices, gradient, learningRate, embeddingTable, featureWidth); + } + + /** + * The XlaSparseDenseMatmul operation + * + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param values The values value + * @param offsets The offsets value + * @param embeddingTable The embeddingTable value + * @param maxIdsPerPartition The value of the maxIdsPerPartition attribute + * @param maxUniqueIdsPerPartition The value of the maxUniqueIdsPerPartition attribute + * @param inputSize The value of the inputSize attribute + * @return a new instance of XlaSparseDenseMatmul + */ + public XlaSparseDenseMatmul xlaSparseDenseMatmul(Operand rowIds, + Operand colIds, Operand values, Operand offsets, + Operand embeddingTable, Long maxIdsPerPartition, Long maxUniqueIdsPerPartition, + Long inputSize) { + return XlaSparseDenseMatmul.create(scope, rowIds, colIds, values, offsets, embeddingTable, maxIdsPerPartition, maxUniqueIdsPerPartition, inputSize); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Operand momenta, + Boolean useNesterov, Float exponent, Float beta1, Float beta2, Float epsilon, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, momenta, useNesterov, exponent, beta1, beta2, epsilon, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand momenta, Operand velocity, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, momenta, velocity, useSumInsideSqrt, beta1, beta2, epsilon, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param tables The tables value + * @param hyperparameters The hyperparameters value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param optimizerCustomComputation The value of the optimizerCustomComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Iterable> tables, Iterable> hyperparameters, + Operand combinerWeightsLearningRate, Long maxValency, Long numWeights, + ConcreteFunction combinerTableVjpComputation, ConcreteFunction combinerWeightsVjpComputation, + ConcreteFunction optimizerCustomComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, tables, hyperparameters, combinerWeightsLearningRate, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, optimizerCustomComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput + */ + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput xlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Operand linear, + Boolean multiplyLinearByLearningRate, Float beta, Float learningRatePower, + Float l1RegularizationStrength, Float l2RegularizationStrength, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, + XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.Options... options) { + return XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedPosIds, sortedGains, weights, preservedValencies, preservedVectors, preservedWeights, activationGradients, learningRate, combinerWeightsLearningRate, embeddingTable, accumulator, linear, multiplyLinearByLearningRate, beta, learningRatePower, l1RegularizationStrength, l2RegularizationStrength, maxValency, numWeights, combinerTableVjpComputation, combinerWeightsVjpComputation, tableName, options); + } + + /** + * The XlaSparseDenseMatmulGradWithAdagradAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradAndCsrInput + */ + public XlaSparseDenseMatmulGradWithAdagradAndCsrInput xlaSparseDenseMatmulGradWithAdagradAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand numMinibatchesPerPhysicalSparseCore, + String tableName, XlaSparseDenseMatmulGradWithAdagradAndCsrInput.Options... options) { + return XlaSparseDenseMatmulGradWithAdagradAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, activationGradients, learningRate, embeddingTable, accumulator, numMinibatchesPerPhysicalSparseCore, tableName, options); + } + + /** + * The XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput + */ + public XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput xlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand momenta, + Operand numMinibatchesPerPhysicalSparseCore, Boolean useNesterov, Float exponent, + Float beta1, Float beta2, Float epsilon, String tableName, + XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.Options... options) { + return XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, activationGradients, learningRate, embeddingTable, accumulator, momenta, numMinibatchesPerPhysicalSparseCore, useNesterov, exponent, beta1, beta2, epsilon, tableName, options); + } + + /** + * The XlaSparseDenseMatmulGradWithAdamAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdamAndCsrInput + */ + public XlaSparseDenseMatmulGradWithAdamAndCsrInput xlaSparseDenseMatmulGradWithAdamAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, Operand momenta, + Operand velocity, Operand numMinibatchesPerPhysicalSparseCore, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, String tableName, + XlaSparseDenseMatmulGradWithAdamAndCsrInput.Options... options) { + return XlaSparseDenseMatmulGradWithAdamAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, activationGradients, learningRate, embeddingTable, momenta, velocity, numMinibatchesPerPhysicalSparseCore, useSumInsideSqrt, beta1, beta2, epsilon, tableName, options); + } + + /** + * The XlaSparseDenseMatmulGradWithFtrlAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithFtrlAndCsrInput + */ + public XlaSparseDenseMatmulGradWithFtrlAndCsrInput xlaSparseDenseMatmulGradWithFtrlAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand linear, + Operand numMinibatchesPerPhysicalSparseCore, Boolean multiplyLinearByLearningRate, + Float beta, Float learningRatePower, Float l1RegularizationStrength, + Float l2RegularizationStrength, String tableName, + XlaSparseDenseMatmulGradWithFtrlAndCsrInput.Options... options) { + return XlaSparseDenseMatmulGradWithFtrlAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, activationGradients, learningRate, embeddingTable, accumulator, linear, numMinibatchesPerPhysicalSparseCore, multiplyLinearByLearningRate, beta, learningRatePower, l1RegularizationStrength, l2RegularizationStrength, tableName, options); + } + + /** + * The XlaSparseDenseMatmulGradWithSgdAndCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithSgdAndCsrInput + */ + public XlaSparseDenseMatmulGradWithSgdAndCsrInput xlaSparseDenseMatmulGradWithSgdAndCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, String tableName, + XlaSparseDenseMatmulGradWithSgdAndCsrInput.Options... options) { + return XlaSparseDenseMatmulGradWithSgdAndCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, activationGradients, learningRate, embeddingTable, numMinibatchesPerPhysicalSparseCore, tableName, options); + } + + /** + * The XlaSparseDenseMatmulWithCsrInput operation + * + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param inputSize The value of the inputSize attribute + * @param quantizationConfigLow The value of the quantizationConfigLow attribute + * @param quantizationConfigHigh The value of the quantizationConfigHigh attribute + * @param quantizationConfigNumBuckets The value of the quantizationConfigNumBuckets attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @param data type for {@code XlaSparseDenseMatmulWithCsrInput} output and operands + * @return a new instance of XlaSparseDenseMatmulWithCsrInput + */ + public XlaSparseDenseMatmulWithCsrInput xlaSparseDenseMatmulWithCsrInput( + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, Long inputSize, + Float quantizationConfigLow, Float quantizationConfigHigh, Long quantizationConfigNumBuckets, + String tableName, XlaSparseDenseMatmulWithCsrInput.Options... options) { + return XlaSparseDenseMatmulWithCsrInput.create(scope, rowPointers, sortedSampleIds, sortedTokenIds, sortedGains, embeddingTable, numMinibatchesPerPhysicalSparseCore, inputSize, quantizationConfigLow, quantizationConfigHigh, quantizationConfigNumBuckets, tableName, options); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java deleted file mode 100644 index 0bb944eed82..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java +++ /dev/null @@ -1,19 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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 Compute_func_Pointer_TF_OpKernelContext extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Compute_func_Pointer_TF_OpKernelContext(Pointer p) { super(p); } - protected Compute_func_Pointer_TF_OpKernelContext() { allocate(); } - private native void allocate(); - public native void call(Pointer arg0, TF_OpKernelContext arg1); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java deleted file mode 100644 index 01c6b8b9cd8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java +++ /dev/null @@ -1,48 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - - -// Allocates a new kernel builder and returns a pointer to it. -// -// If non-null, TensorFlow will call create_func when it needs to instantiate -// the kernel. The pointer returned by create_func will be passed to -// compute_func and delete_func, thereby functioning as a "this" pointer for -// referring to kernel instances. -// -// The TF_OpKernelConstruction pointer passed to create_func is owned by -// TensorFlow and will be deleted once create_func returns. It must not be used -// after this. -// -// When TensorFlow needs to perform a computation with this kernel, it will -// call compute_func. This function will receive the pointer returned by -// create_func (or null if no create_func was provided), along with the inputs -// to the computation. -// -// The TF_OpKernelContext pointer received by compute_func is owned by -// TensorFlow and will be deleted once compute_func returns. It must not be used -// after this. -// -// Finally, when TensorFlow no longer needs the kernel, it will call -// delete_func if one is provided. This function will receive the pointer -// returned in `create_func` or nullptr if no `create_func` was provided. -// -// The caller should pass the result of this function to -// TF_RegisterKernelBuilder, which will take ownership of the pointer. If, for -// some reason, the kernel builder will not be registered, the caller should -// delete it with TF_DeleteKernelBuilder. -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class Create_func_TF_OpKernelConstruction extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Create_func_TF_OpKernelConstruction(Pointer p) { super(p); } - protected Create_func_TF_OpKernelConstruction() { allocate(); } - private native void allocate(); - public native Pointer call(TF_OpKernelConstruction arg0); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java deleted file mode 100644 index 2e3b079ae0a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java +++ /dev/null @@ -1,19 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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 Delete_func_Pointer extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Delete_func_Pointer(Pointer p) { super(p); } - protected Delete_func_Pointer() { allocate(); } - private native void allocate(); - public native void call(Pointer arg0); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java deleted file mode 100644 index b2168d8a48c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java +++ /dev/null @@ -1,22 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - - -// Sets the shape inference function for the op. -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class Shape_inference_func_TF_ShapeInferenceContext_TF_Status extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Shape_inference_func_TF_ShapeInferenceContext_TF_Status(Pointer p) { super(p); } - protected Shape_inference_func_TF_ShapeInferenceContext_TF_Status() { allocate(); } - private native void allocate(); - public native void call(TF_ShapeInferenceContext ctx, - TF_Status status); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java deleted file mode 100644 index e4bb017db8c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java +++ /dev/null @@ -1,19 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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 - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_DimensionHandle extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_DimensionHandle() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_DimensionHandle(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java deleted file mode 100644 index e36b7b206bf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - - -// -------------------------------------------------------------------------- -// C API for TensorFlow Kernels. -// -// This API allows developers to register custom kernel implementations for -// TensorFlow. -// -// See c_api.h header comments for a discussion about API conventions. -// -// Users wishing to extend TensorFlow with new kernels will call -// `TF_NewKernelBuilder`. The resulting kernel builder can be registered with -// `TF_RegisterKernelBuilder`, which will allow TF to construct user-provided -// kernels when necessary. - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_KernelBuilder extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_KernelBuilder() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_KernelBuilder(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java deleted file mode 100644 index 9949307e8e9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java +++ /dev/null @@ -1,17 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_OpDefinitionBuilder extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_OpDefinitionBuilder() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_OpDefinitionBuilder(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java deleted file mode 100644 index 0ee6afaae99..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java +++ /dev/null @@ -1,17 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_OpKernelConstruction extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_OpKernelConstruction() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_OpKernelConstruction(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java deleted file mode 100644 index 24c0373404d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java +++ /dev/null @@ -1,17 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_OpKernelContext extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_OpKernelContext() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_OpKernelContext(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java deleted file mode 100644 index 2721dcac4b6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java +++ /dev/null @@ -1,17 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_ShapeHandle extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_ShapeHandle() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_ShapeHandle(Pointer p) { super(p); } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java deleted file mode 100644 index 15f0b1dc8b7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java +++ /dev/null @@ -1,17 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: 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.*; - -@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public class TF_ShapeInferenceContext extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public TF_ShapeInferenceContext() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public TF_ShapeInferenceContext(Pointer p) { super(p); } -} 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 deleted file mode 100644 index d40163dc22d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java +++ /dev/null @@ -1,4747 +0,0 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE - -package org.tensorflow.internal.c_api.global; - -import org.tensorflow.internal.c_api.*; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -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 void TF_TString_ReserveAmortized(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'. -// Reserve 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. -// Similar to TF_TString_Reserve, except that we ensure amortized growth, i.e. -// that we grow the capacity by at least a constant factor >1. - -// 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. - -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_UTIL_PORT_H_ -// #define TENSORFLOW_CORE_UTIL_PORT_H_ - -// Returns true if GOOGLE_CUDA is defined. -@Namespace("tensorflow") public static native @Cast("bool") boolean IsGoogleCudaEnabled(); - -// Returns true if TENSORFLOW_USE_ROCM is defined. (i.e. TF is built with ROCm) -@Namespace("tensorflow") public static native @Cast("bool") boolean IsBuiltWithROCm(); - -// Returns true if TENSORFLOW_USE_XLA is defined. (i.e. TF is built with XLA) -@Namespace("tensorflow") public static native @Cast("bool") boolean IsBuiltWithXLA(); - -// Returns true if TENSORFLOW_USE_NVCC is defined. (i.e. TF is built with nvcc) -@Namespace("tensorflow") public static native @Cast("bool") boolean IsBuiltWithNvcc(); - -// Returns true if either -// -// GOOGLE_CUDA is defined, and the given CUDA version supports -// half-precision matrix multiplications and convolution operations. -// -// OR -// -// TENSORFLOW_USE_ROCM is defined -// -@Namespace("tensorflow") public static native @Cast("bool") boolean GpuSupportsHalfMatMulAndConv(); - -// Returns true if INTEL_MKL is defined -@Namespace("tensorflow") public static native @Cast("bool") boolean IsMklEnabled(); - - // end namespace tensorflow - -// #endif // TENSORFLOW_CORE_UTIL_PORT_H_ - - -// Parsed from tensorflow/c/tf_attrtype.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_C_TF_ATTRTYPE_H_ -// #define TENSORFLOW_C_TF_ATTRTYPE_H_ - -// #ifdef __cplusplus -// #endif - -// TF_AttrType describes the type of the value of an attribute on an operation. -/** enum TF_AttrType */ -public static final int - TF_ATTR_STRING = 0, - TF_ATTR_INT = 1, - TF_ATTR_FLOAT = 2, - TF_ATTR_BOOL = 3, - TF_ATTR_TYPE = 4, - TF_ATTR_SHAPE = 5, - TF_ATTR_TENSOR = 6, - TF_ATTR_PLACEHOLDER = 7, - TF_ATTR_FUNC = 8; - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #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. - -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_DATATYPE_H_ -// #define TENSORFLOW_C_TF_DATATYPE_H_ - -// #include - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -// #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 - -// #ifdef __cplusplus -// #endif - -// -------------------------------------------------------------------------- -// TF_DataType holds the type for a scalar value. E.g., one slot in a tensor. -// The enum values here are identical to corresponding values in types.proto. -/** enum TF_DataType */ -public static final int - TF_FLOAT = 1, - TF_DOUBLE = 2, - TF_INT32 = 3, // Int32 tensors are always in 'host' memory. - TF_UINT8 = 4, - TF_INT16 = 5, - TF_INT8 = 6, - TF_STRING = 7, - TF_COMPLEX64 = 8, // Single-precision complex - TF_COMPLEX = 8, // Old identifier kept for API backwards compatibility - TF_INT64 = 9, - TF_BOOL = 10, - TF_QINT8 = 11, // Quantized int8 - TF_QUINT8 = 12, // Quantized uint8 - TF_QINT32 = 13, // Quantized int32 - TF_BFLOAT16 = 14, // Float32 truncated to 16 bits. Only for cast ops. - TF_QINT16 = 15, // Quantized int16 - TF_QUINT16 = 16, // Quantized uint16 - TF_UINT16 = 17, - TF_COMPLEX128 = 18, // Double-precision complex - TF_HALF = 19, - TF_RESOURCE = 20, - TF_VARIANT = 21, - TF_UINT32 = 22, - TF_UINT64 = 23; - -// TF_DataTypeSize returns the sizeof() for the underlying type corresponding -// to the given TF_DataType enum value. Returns 0 for variable length types -// (eg. TF_STRING) or on failure. -public static native @Cast("size_t") long TF_DataTypeSize(@Cast("TF_DataType") int dt); - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #endif // TENSORFLOW_C_TF_DATATYPE_H_ - - -// Parsed from tensorflow/c/tf_status.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_C_TF_STATUS_H_ -// #define TENSORFLOW_C_TF_STATUS_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 - -// #ifdef __cplusplus -// Targeting ../TF_Status.java - - - -// -------------------------------------------------------------------------- -// TF_Code holds an error code. The enum values here are identical to -// corresponding values in error_codes.proto. -/** enum TF_Code */ -public static final int - TF_OK = 0, - TF_CANCELLED = 1, - TF_UNKNOWN = 2, - TF_INVALID_ARGUMENT = 3, - TF_DEADLINE_EXCEEDED = 4, - TF_NOT_FOUND = 5, - TF_ALREADY_EXISTS = 6, - TF_PERMISSION_DENIED = 7, - TF_UNAUTHENTICATED = 16, - TF_RESOURCE_EXHAUSTED = 8, - TF_FAILED_PRECONDITION = 9, - TF_ABORTED = 10, - TF_OUT_OF_RANGE = 11, - TF_UNIMPLEMENTED = 12, - TF_INTERNAL = 13, - TF_UNAVAILABLE = 14, - TF_DATA_LOSS = 15; - -// -------------------------------------------------------------------------- - -// Return a new status object. -public static native TF_Status TF_NewStatus(); - -// Delete a previously created status object. -public static native void TF_DeleteStatus(TF_Status arg0); - -// Record in *s. Any previous information is lost. -// A common use is to clear a status: TF_SetStatus(s, TF_OK, ""); -public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, - @Cast("const char*") BytePointer msg); -public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, - String msg); - -// Convert from an I/O error code (e.g., errno) to a TF_Status value. -// Any previous information is lost. Prefer to use this instead of TF_SetStatus -// when the error comes from I/O operations. -public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, - @Cast("const char*") BytePointer context); -public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, - String context); - -// Return the code record in *s. -public static native @Cast("TF_Code") int TF_GetCode(@Const TF_Status s); - -// Return a pointer to the (null-terminated) error message in *s. The -// return value points to memory that is only usable until the next -// mutation to *s. Always returns an empty string if TF_GetCode(s) is -// TF_OK. -public static native @Cast("const char*") BytePointer TF_Message(@Const TF_Status s); - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #endif // TENSORFLOW_C_TF_STATUS_H_ - - -// Parsed from tensorflow/c/tf_tensor.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_C_TF_TENSOR_H_ -// #define TENSORFLOW_C_TF_TENSOR_H_ - -// #include -// #include - -// #include "tensorflow/c/c_api_macros.h" -// #include "tensorflow/c/tf_datatype.h" -// #include "tensorflow/c/tf_status.h" - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -// #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 - -// #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 - - -// Targeting ../Deallocator_Pointer_long_Pointer.java - - -public static native TF_Tensor TF_NewTensor( - @Cast("TF_DataType") int arg0, @Cast("const int64_t*") LongPointer dims, int num_dims, Pointer data, @Cast("size_t") long len, - Deallocator_Pointer_long_Pointer deallocator, - Pointer deallocator_arg); -public static native TF_Tensor TF_NewTensor( - @Cast("TF_DataType") int arg0, @Cast("const int64_t*") LongBuffer dims, int num_dims, Pointer data, @Cast("size_t") long len, - Deallocator_Pointer_long_Pointer deallocator, - Pointer deallocator_arg); -public static native TF_Tensor TF_NewTensor( - @Cast("TF_DataType") int arg0, @Cast("const int64_t*") long[] dims, int num_dims, Pointer data, @Cast("size_t") long len, - Deallocator_Pointer_long_Pointer deallocator, - Pointer deallocator_arg); - -// Allocate and return a new Tensor. -// -// This function is an alternative to TF_NewTensor and should be used when -// memory is allocated to pass the Tensor to the C API. The allocated memory -// satisfies TensorFlow's memory alignment preferences and should be preferred -// over calling malloc and free. -// -// The caller must set the Tensor values by writing them to the pointer returned -// by TF_TensorData with length TF_TensorByteSize. -public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, - @Cast("const int64_t*") LongPointer dims, - int num_dims, @Cast("size_t") long len); -public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, - @Cast("const int64_t*") LongBuffer dims, - int num_dims, @Cast("size_t") long len); -public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, - @Cast("const int64_t*") long[] dims, - int num_dims, @Cast("size_t") long len); - -// Deletes `tensor` and returns a new TF_Tensor with the same content if -// possible. Returns nullptr and leaves `tensor` untouched if not. -public static native TF_Tensor TF_TensorMaybeMove(TF_Tensor tensor); - -// Destroy a tensor. -public static native void TF_DeleteTensor(TF_Tensor arg0); - -// Return the type of a tensor element. -public static native @Cast("TF_DataType") int TF_TensorType(@Const TF_Tensor arg0); - -// Return the number of dimensions that the tensor has. -public static native int TF_NumDims(@Const TF_Tensor arg0); - -// Return the length of the tensor in the "dim_index" dimension. -// REQUIRES: 0 <= dim_index < TF_NumDims(tensor) -public static native @Cast("int64_t") long TF_Dim(@Const TF_Tensor tensor, int dim_index); - -// Return the size of the underlying data in bytes. -public static native @Cast("size_t") long TF_TensorByteSize(@Const TF_Tensor arg0); - -// Return a pointer to the underlying data buffer. -public static native Pointer TF_TensorData(@Const TF_Tensor arg0); - -// Returns the number of elements in the tensor. -public static native @Cast("int64_t") long TF_TensorElementCount(@Const TF_Tensor tensor); - -// Copy the internal data representation of `from` to `to`. `new_dims` and -// `num_new_dims` specify the new shape of the `to` tensor, `type` specifies its -// data type. On success, *status is set to TF_OK and the two tensors share the -// same data buffer. -// -// This call requires that the `from` tensor and the given type and shape (dims -// and num_dims) are "compatible" (i.e. they occupy the same number of bytes). -// Specifically, given from_type_size = TF_DataTypeSize(TF_TensorType(from)): -// -// ShapeElementCount(dims, num_dims) * TF_DataTypeSize(type) -// -// must equal -// -// TF_TensorElementCount(from) * from_type_size -// -// where TF_ShapeElementCount would be the number of elements in a tensor with -// the given shape. -// -// In addition, this function requires: -// * TF_DataTypeSize(TF_TensorType(from)) != 0 -// * TF_DataTypeSize(type) != 0 -// -// If any of the requirements are not met, *status is set to -// TF_INVALID_ARGUMENT. -public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, - @Cast("TF_DataType") int type, TF_Tensor to, - @Cast("const int64_t*") LongPointer new_dims, - int num_new_dims, - TF_Status status); -public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, - @Cast("TF_DataType") int type, TF_Tensor to, - @Cast("const int64_t*") LongBuffer new_dims, - int num_new_dims, - TF_Status status); -public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, - @Cast("TF_DataType") int type, TF_Tensor to, - @Cast("const int64_t*") long[] new_dims, - int num_new_dims, - TF_Status status); - -// Returns bool iff this tensor is aligned. -public static native @Cast("bool") boolean TF_TensorIsAligned(@Const TF_Tensor arg0); - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #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/c/tf_tensor.h" -// #include "tensorflow/core/platform/ctstring.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 - -// #ifdef __cplusplus -// #endif - -public static native void TF_StringInit(TF_TString t); - -public static native void TF_StringCopy(TF_TString dst, @Cast("const char*") BytePointer src, - @Cast("size_t") long size); -public static native void TF_StringCopy(TF_TString dst, String src, - @Cast("size_t") long size); - -public static native void TF_StringAssignView(TF_TString dst, @Cast("const char*") BytePointer src, - @Cast("size_t") long size); -public static native void TF_StringAssignView(TF_TString dst, String src, - @Cast("size_t") long size); - -public static native @Cast("const char*") BytePointer TF_StringGetDataPointer( - @Const TF_TString tstr); - -public static native @Cast("TF_TString_Type") int TF_StringGetType(@Const TF_TString str); - -public static native @Cast("size_t") long TF_StringGetSize(@Const TF_TString tstr); - -public static native @Cast("size_t") long TF_StringGetCapacity(@Const TF_TString str); - -public static native void TF_StringDealloc(TF_TString tstr); - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_ - - -// Parsed from tensorflow/c/c_api.h - -/* Copyright 2015 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_H_ -// #define TENSORFLOW_C_C_API_H_ - -// #include -// #include - -// #include "tensorflow/c/tf_attrtype.h" -// #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. -// -// The API leans towards simplicity and uniformity instead of convenience -// since most usage will be by language specific wrappers. -// -// Conventions: -// * We use the prefix TF_ for everything in the API. -// * Objects are always passed around as pointers to opaque structs -// and these structs are allocated/deallocated via the API. -// * TF_Status holds error information. It is an object type -// and therefore is passed around as a pointer to an opaque -// struct as mentioned above. -// * Every call that has a TF_Status* argument clears it on success -// and fills it with error info on failure. -// * unsigned char is used for booleans (instead of the 'bool' type). -// In C++ bool is a keyword while in C99 bool is a macro defined -// in stdbool.h. It is possible for the two to be inconsistent. -// For example, neither the C99 nor the C++11 standard force a byte -// size on the bool type, so the macro defined in stdbool.h could -// be inconsistent with the bool keyword in C++. Thus, the use -// of stdbool.h is avoided and unsigned char is used instead. -// * size_t is used to represent byte sizes of objects that are -// materialized in the address space of the calling process. -// * int is used as an index into arrays. -// * Deletion functions are safe to call on nullptr. -// -// Questions left to address: -// * Might at some point need a way for callers to provide their own Env. -// * Maybe add TF_TensorShape that encapsulates dimension info. -// -// Design decisions made: -// * Backing store for tensor memory has an associated deallocation -// function. This deallocation function will point to client code -// for tensors populated by the client. So the client can do things -// like shadowing a numpy array. -// * We do not provide TF_OK since it is not strictly necessary and we -// are not optimizing for convenience. -// * We make assumption that one session has one graph. This should be -// fine since we have the ability to run sub-graphs. -// * We could allow NULL for some arguments (e.g., NULL options arg). -// However since convenience is not a primary goal, we don't do this. -// * Devices are not in this API. Instead, they are created/used internally -// and the API just provides high level controls over the number of -// devices of each type. - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -// #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 - -// #ifdef __cplusplus -// #endif - -// -------------------------------------------------------------------------- -// TF_Version returns a string describing version information of the -// TensorFlow library. TensorFlow using semantic versioning. -public static native @Cast("const char*") BytePointer TF_Version(); -// Targeting ../TF_Buffer.java - - - -// Makes a copy of the input and sets an appropriate deallocator. Useful for -// passing in read-only, input protobufs. -public static native TF_Buffer TF_NewBufferFromString(@Const Pointer proto, - @Cast("size_t") long proto_len); - -// Useful for passing *out* a protobuf. -public static native TF_Buffer TF_NewBuffer(); - -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 - - - -// Return a new options object. -public static native TF_SessionOptions TF_NewSessionOptions(); - -// Set the target in TF_SessionOptions.options. -// target can be empty, a single entry, or a comma separated list of entries. -// Each entry is in one of the following formats : -// "local" -// ip:port -// host:port -public static native void TF_SetTarget(TF_SessionOptions options, - @Cast("const char*") BytePointer target); -public static native void TF_SetTarget(TF_SessionOptions options, - String target); - -// Set the config in TF_SessionOptions.options. -// config should be a serialized tensorflow.ConfigProto proto. -// If config was not parsed successfully as a ConfigProto, record the -// error information in *status. -public static native void TF_SetConfig(TF_SessionOptions options, - @Const Pointer proto, @Cast("size_t") long proto_len, - TF_Status status); - -// Destroy an options object. -public static native void TF_DeleteSessionOptions(TF_SessionOptions arg0); -// Targeting ../TF_Graph.java - - - -// Return a new graph object. -public static native TF_Graph TF_NewGraph(); - -// Destroy an options object. Graph will be deleted once no more -// TFSession's are referencing it. -public static native void TF_DeleteGraph(TF_Graph arg0); -// Targeting ../TF_OperationDescription.java - - -// Targeting ../TF_Operation.java - - -// Targeting ../TF_Input.java - - -// Targeting ../TF_Output.java - - -// Targeting ../TF_Function.java - - -// Targeting ../TF_FunctionOptions.java - - - -// Sets the shape of the Tensor referenced by `output` in `graph` to -// the shape described by `dims` and `num_dims`. -// -// If the number of dimensions is unknown, `num_dims` must be set to -// -1 and `dims` can be null. If a dimension is unknown, the -// corresponding entry in the `dims` array must be -1. -// -// This does not overwrite the existing shape associated with `output`, -// but merges the input shape with the existing shape. For example, -// setting a shape of [-1, 2] with an existing shape [2, -1] would set -// a final shape of [2, 2] based on shape merging semantics. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -// * An invalid shape is being set (e.g., the shape being set -// is incompatible with the existing shape). -public static native void TF_GraphSetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("const int64_t*") LongPointer dims, - int num_dims, - TF_Status status); -public static native void TF_GraphSetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("const int64_t*") LongBuffer dims, - int num_dims, - TF_Status status); -public static native void TF_GraphSetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("const int64_t*") long[] dims, - int num_dims, - TF_Status status); - -// Returns the number of dimensions of the Tensor referenced by `output` -// in `graph`. -// -// If the number of dimensions in the shape is unknown, returns -1. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -public static native int TF_GraphGetTensorNumDims(TF_Graph graph, - @ByVal TF_Output output, - TF_Status status); - -// Returns the shape of the Tensor referenced by `output` in `graph` -// into `dims`. `dims` must be an array large enough to hold `num_dims` -// entries (e.g., the return value of TF_GraphGetTensorNumDims). -// -// If the number of dimensions in the shape is unknown or the shape is -// a scalar, `dims` will remain untouched. Otherwise, each element of -// `dims` will be set corresponding to the size of the dimension. An -// unknown dimension is represented by `-1`. -// -// Returns an error into `status` if: -// * `output` is not in `graph`. -// * `num_dims` does not match the actual number of dimensions. -public static native void TF_GraphGetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("int64_t*") LongPointer dims, int num_dims, - TF_Status status); -public static native void TF_GraphGetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("int64_t*") LongBuffer dims, int num_dims, - TF_Status status); -public static native void TF_GraphGetTensorShape(TF_Graph graph, - @ByVal TF_Output output, - @Cast("int64_t*") long[] dims, int num_dims, - TF_Status status); - -// Operation will only be added to *graph when TF_FinishOperation() is -// called (assuming TF_FinishOperation() does not return an error). -// *graph must not be deleted until after TF_FinishOperation() is -// called. -public static native TF_OperationDescription TF_NewOperation( - TF_Graph graph, @Cast("const char*") BytePointer op_type, @Cast("const char*") BytePointer oper_name); -public static native TF_OperationDescription TF_NewOperation( - TF_Graph graph, String op_type, String oper_name); - -// Specify the device for `desc`. Defaults to empty, meaning unconstrained. -public static native void TF_SetDevice(TF_OperationDescription desc, - @Cast("const char*") BytePointer device); -public static native void TF_SetDevice(TF_OperationDescription desc, - String device); - -// The calls to TF_AddInput and TF_AddInputList must match (in number, -// order, and type) the op declaration. For example, the "Concat" op -// has registration: -// REGISTER_OP("Concat") -// .Input("concat_dim: int32") -// .Input("values: N * T") -// .Output("output: T") -// .Attr("N: int >= 2") -// .Attr("T: type"); -// that defines two inputs, "concat_dim" and "values" (in that order). -// You must use TF_AddInput() for the first input (since it takes a -// single tensor), and TF_AddInputList() for the second input (since -// it takes a list, even if you were to pass a list with a single -// tensor), as in: -// TF_OperationDescription* desc = TF_NewOperation(graph, "Concat", "c"); -// TF_Output concat_dim_input = {...}; -// TF_AddInput(desc, concat_dim_input); -// TF_Output values_inputs[5] = {{...}, ..., {...}}; -// TF_AddInputList(desc, values_inputs, 5); - -// For inputs that take a single tensor. -public static native void TF_AddInput(TF_OperationDescription desc, - @ByVal TF_Output input); - -// For inputs that take a list of tensors. -// inputs must point to TF_Output[num_inputs]. -public static native void TF_AddInputList(TF_OperationDescription desc, - @Const TF_Output inputs, - int num_inputs); - -// Call once per control input to `desc`. -public static native void TF_AddControlInput(TF_OperationDescription desc, - TF_Operation input); - -// Request that `desc` be co-located on the device where `op` -// is placed. -// -// Use of this is discouraged since the implementation of device placement is -// subject to change. Primarily intended for internal libraries -public static native void TF_ColocateWith(TF_OperationDescription desc, - TF_Operation op); - -// Call some TF_SetAttr*() function for every attr that is not -// inferred from an input and doesn't have a default value you wish to -// keep. - -// `value` must point to a string of length `length` bytes. -public static native void TF_SetAttrString(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Const Pointer value, @Cast("size_t") long length); -public static native void TF_SetAttrString(TF_OperationDescription desc, - String attr_name, - @Const Pointer value, @Cast("size_t") long length); -// `values` and `lengths` each must have lengths `num_values`. -// `values[i]` must point to a string of length `lengths[i]` bytes. -public static native void TF_SetAttrStringList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") PointerPointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TF_SetAttrStringList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TF_SetAttrStringList(TF_OperationDescription desc, - String attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TF_SetAttrInt(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, @Cast("int64_t") long value); -public static native void TF_SetAttrInt(TF_OperationDescription desc, - String attr_name, @Cast("int64_t") long value); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongPointer values, - int num_values); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") LongBuffer values, - int num_values); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") long[] values, - int num_values); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") LongPointer values, - int num_values); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongBuffer values, - int num_values); -public static native void TF_SetAttrIntList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") long[] values, - int num_values); -public static native void TF_SetAttrFloat(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, float value); -public static native void TF_SetAttrFloat(TF_OperationDescription desc, - String attr_name, float value); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Const FloatPointer values, - int num_values); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - String attr_name, - @Const FloatBuffer values, - int num_values); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Const float[] values, - int num_values); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - String attr_name, - @Const FloatPointer values, - int num_values); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Const FloatBuffer values, - int num_values); -public static native void TF_SetAttrFloatList(TF_OperationDescription desc, - String attr_name, - @Const float[] values, - int num_values); -public static native void TF_SetAttrBool(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char") byte value); -public static native void TF_SetAttrBool(TF_OperationDescription desc, - String attr_name, - @Cast("unsigned char") byte value); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") BytePointer values, - int num_values); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - String attr_name, - @Cast("const unsigned char*") ByteBuffer values, - int num_values); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") byte[] values, - int num_values); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - String attr_name, - @Cast("const unsigned char*") BytePointer values, - int num_values); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") ByteBuffer values, - int num_values); -public static native void TF_SetAttrBoolList(TF_OperationDescription desc, - String attr_name, - @Cast("const unsigned char*") byte[] values, - int num_values); -public static native void TF_SetAttrType(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType") int value); -public static native void TF_SetAttrType(TF_OperationDescription desc, - String attr_name, - @Cast("TF_DataType") int value); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") IntPointer values, - int num_values); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - String attr_name, - @Cast("const TF_DataType*") IntBuffer values, - int num_values); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") int[] values, - int num_values); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - String attr_name, - @Cast("const TF_DataType*") IntPointer values, - int num_values); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") IntBuffer values, - int num_values); -public static native void TF_SetAttrTypeList(TF_OperationDescription desc, - String attr_name, - @Cast("const TF_DataType*") int[] values, - int num_values); -public static native void TF_SetAttrPlaceholder(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const char*") BytePointer placeholder); -public static native void TF_SetAttrPlaceholder(TF_OperationDescription desc, - String attr_name, - String placeholder); - -// Set a 'func' attribute to the specified name. -// `value` must point to a string of length `length` bytes. -public static native void TF_SetAttrFuncName(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const char*") BytePointer value, @Cast("size_t") long length); -public static native void TF_SetAttrFuncName(TF_OperationDescription desc, - String attr_name, - String value, @Cast("size_t") long length); - -// Set `num_dims` to -1 to represent "unknown rank". Otherwise, -// `dims` points to an array of length `num_dims`. `dims[i]` must be -// >= -1, with -1 meaning "unknown dimension". -public static native void TF_SetAttrShape(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongPointer dims, int num_dims); -public static native void TF_SetAttrShape(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") LongBuffer dims, int num_dims); -public static native void TF_SetAttrShape(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") long[] dims, int num_dims); -public static native void TF_SetAttrShape(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") LongPointer dims, int num_dims); -public static native void TF_SetAttrShape(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongBuffer dims, int num_dims); -public static native void TF_SetAttrShape(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*") long[] dims, int num_dims); -// `dims` and `num_dims` must point to arrays of length `num_shapes`. -// Set `num_dims[i]` to -1 to represent "unknown rank". Otherwise, -// `dims[i]` points to an array of length `num_dims[i]`. `dims[i][j]` -// must be >= -1, with -1 meaning "unknown dimension". -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*const*") PointerPointer dims, - @Const IntPointer num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*const*") @ByPtrPtr LongPointer dims, - @Const IntPointer num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*const*") @ByPtrPtr LongBuffer dims, - @Const IntBuffer num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*const*") @ByPtrPtr long[] dims, - @Const int[] num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*const*") @ByPtrPtr LongPointer dims, - @Const IntPointer num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*const*") @ByPtrPtr LongBuffer dims, - @Const IntBuffer num_dims, - int num_shapes); -public static native void TF_SetAttrShapeList(TF_OperationDescription desc, - String attr_name, - @Cast("const int64_t*const*") @ByPtrPtr long[] dims, - @Const int[] num_dims, - int num_shapes); -// `proto` must point to an array of `proto_len` bytes representing a -// binary-serialized TensorShapeProto. -public static native void TF_SetAttrTensorShapeProto( - TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, @Const Pointer proto, - @Cast("size_t") long proto_len, TF_Status status); -public static native void TF_SetAttrTensorShapeProto( - TF_OperationDescription desc, String attr_name, @Const Pointer proto, - @Cast("size_t") long proto_len, TF_Status status); -// `protos` and `proto_lens` must point to arrays of length `num_shapes`. -// `protos[i]` must point to an array of `proto_lens[i]` bytes -// representing a binary-serialized TensorShapeProto. -public static native void TF_SetAttrTensorShapeProtoList( - TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") PointerPointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, - TF_Status status); -public static native void TF_SetAttrTensorShapeProtoList( - TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, - TF_Status status); -public static native void TF_SetAttrTensorShapeProtoList( - TF_OperationDescription desc, String attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, - TF_Status status); - -public static native void TF_SetAttrTensor(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - TF_Tensor value, - TF_Status status); -public static native void TF_SetAttrTensor(TF_OperationDescription desc, - String attr_name, - TF_Tensor value, - TF_Status status); -public static native void TF_SetAttrTensorList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_Tensor*const*") PointerPointer values, - int num_values, - TF_Status status); -public static native void TF_SetAttrTensorList(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @ByPtrPtr TF_Tensor values, - int num_values, - TF_Status status); -public static native void TF_SetAttrTensorList(TF_OperationDescription desc, - String attr_name, - @ByPtrPtr TF_Tensor values, - int num_values, - TF_Status status); - -// `proto` should point to a sequence of bytes of length `proto_len` -// representing a binary serialization of an AttrValue protocol -// buffer. -public static native void TF_SetAttrValueProto(TF_OperationDescription desc, - @Cast("const char*") BytePointer attr_name, - @Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); -public static native void TF_SetAttrValueProto(TF_OperationDescription desc, - String attr_name, - @Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); - -// If this function succeeds: -// * *status is set to an OK value, -// * a TF_Operation is added to the graph, -// * a non-null value pointing to the added operation is returned -- -// this value is valid until the underlying graph is deleted. -// Otherwise: -// * *status is set to a non-OK value, -// * the graph is not modified, -// * a null value is returned. -// In either case, it deletes `desc`. -public static native TF_Operation TF_FinishOperation( - TF_OperationDescription desc, TF_Status status); - -// TF_Operation functions. Operations are immutable once created, so -// these are all query functions. - -public static native @Cast("const char*") BytePointer TF_OperationName(TF_Operation oper); -public static native @Cast("const char*") BytePointer TF_OperationOpType(TF_Operation oper); -public static native @Cast("const char*") BytePointer TF_OperationDevice(TF_Operation oper); - -public static native int TF_OperationNumOutputs(TF_Operation oper); -public static native @Cast("TF_DataType") int TF_OperationOutputType(@ByVal TF_Output oper_out); -public static native int TF_OperationOutputListLength(TF_Operation oper, - @Cast("const char*") BytePointer arg_name, - TF_Status status); -public static native int TF_OperationOutputListLength(TF_Operation oper, - String arg_name, - TF_Status status); - -public static native int TF_OperationNumInputs(TF_Operation oper); -public static native @Cast("TF_DataType") int TF_OperationInputType(@ByVal TF_Input oper_in); -public static native int TF_OperationInputListLength(TF_Operation oper, - @Cast("const char*") BytePointer arg_name, - TF_Status status); -public static native int TF_OperationInputListLength(TF_Operation oper, - String arg_name, - TF_Status status); - -// In this code: -// TF_Output producer = TF_OperationInput(consumer); -// There is an edge from producer.oper's output (given by -// producer.index) to consumer.oper's input (given by consumer.index). -public static native @ByVal TF_Output TF_OperationInput(@ByVal TF_Input oper_in); - -// Get list of all inputs of a specific operation. `inputs` must point to -// an array of length at least `max_inputs` (ideally set to -// TF_OperationNumInputs(oper)). Beware that a concurrent -// modification of the graph can increase the number of inputs of -// an operation. -public static native void TF_OperationAllInputs(TF_Operation oper, - TF_Output inputs, - int max_inputs); - -// Get the number of current consumers of a specific output of an -// operation. Note that this number can change when new operations -// are added to the graph. -public static native int TF_OperationOutputNumConsumers(@ByVal TF_Output oper_out); - -// Get list of all current consumers of a specific output of an -// operation. `consumers` must point to an array of length at least -// `max_consumers` (ideally set to -// TF_OperationOutputNumConsumers(oper_out)). Beware that a concurrent -// modification of the graph can increase the number of consumers of -// an operation. Returns the number of output consumers (should match -// TF_OperationOutputNumConsumers(oper_out)). -public static native int TF_OperationOutputConsumers(@ByVal TF_Output oper_out, - TF_Input consumers, - int max_consumers); - -// Get the number of control inputs to an operation. -public static native int TF_OperationNumControlInputs(TF_Operation oper); - -// Get list of all control inputs to an operation. `control_inputs` must -// point to an array of length `max_control_inputs` (ideally set to -// TF_OperationNumControlInputs(oper)). Returns the number of control -// inputs (should match TF_OperationNumControlInputs(oper)). -public static native int TF_OperationGetControlInputs( - TF_Operation oper, @Cast("TF_Operation**") PointerPointer control_inputs, int max_control_inputs); -public static native int TF_OperationGetControlInputs( - TF_Operation oper, @ByPtrPtr TF_Operation control_inputs, int max_control_inputs); - -// Get the number of operations that have `*oper` as a control input. -// Note that this number can change when new operations are added to -// the graph. -public static native int TF_OperationNumControlOutputs(TF_Operation oper); - -// Get the list of operations that have `*oper` as a control input. -// `control_outputs` must point to an array of length at least -// `max_control_outputs` (ideally set to -// TF_OperationNumControlOutputs(oper)). Beware that a concurrent -// modification of the graph can increase the number of control -// outputs. Returns the number of control outputs (should match -// TF_OperationNumControlOutputs(oper)). -public static native int TF_OperationGetControlOutputs( - TF_Operation oper, @Cast("TF_Operation**") PointerPointer control_outputs, - int max_control_outputs); -public static native int TF_OperationGetControlOutputs( - TF_Operation oper, @ByPtrPtr TF_Operation control_outputs, - int max_control_outputs); -// Targeting ../TF_AttrMetadata.java - - - -// Returns metadata about the value of the attribute `attr_name` of `oper`. -public static native @ByVal TF_AttrMetadata TF_OperationGetAttrMetadata( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Status status); -public static native @ByVal TF_AttrMetadata TF_OperationGetAttrMetadata( - TF_Operation oper, String attr_name, TF_Status status); - -// Fills in `value` with the value of the attribute `attr_name`. `value` must -// point to an array of length at least `max_length` (ideally set to -// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -public static native void TF_OperationGetAttrString(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - Pointer value, - @Cast("size_t") long max_length, - TF_Status status); -public static native void TF_OperationGetAttrString(TF_Operation oper, - String attr_name, - Pointer value, - @Cast("size_t") long max_length, - TF_Status status); - -// Get the list of strings in the value of the attribute `attr_name`. Fills in -// `values` and `lengths`, each of which must point to an array of length at -// least `max_values`. -// -// The elements of values will point to addresses in `storage` which must be at -// least `storage_size` bytes in length. Ideally, max_values would be set to -// TF_AttrMetadata.list_size and `storage` would be at least -// TF_AttrMetadata.total_size, obtained from TF_OperationGetAttrMetadata(oper, -// attr_name). -// -// Fails if storage_size is too small to hold the requested number of strings. -public static native void TF_OperationGetAttrStringList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("void**") PointerPointer values, @Cast("size_t*") SizeTPointer lengths, - int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); -public static native void TF_OperationGetAttrStringList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("void**") @ByPtrPtr Pointer values, @Cast("size_t*") SizeTPointer lengths, - int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); -public static native void TF_OperationGetAttrStringList( - TF_Operation oper, String attr_name, @Cast("void**") @ByPtrPtr Pointer values, @Cast("size_t*") SizeTPointer lengths, - int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); - -public static native void TF_OperationGetAttrInt(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongPointer value, - TF_Status status); -public static native void TF_OperationGetAttrInt(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrInt(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") long[] value, - TF_Status status); -public static native void TF_OperationGetAttrInt(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongPointer value, - TF_Status status); -public static native void TF_OperationGetAttrInt(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrInt(TF_Operation oper, - String attr_name, - @Cast("int64_t*") long[] value, - TF_Status status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") long[] values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrIntList(TF_Operation oper, - String attr_name, - @Cast("int64_t*") long[] values, - int max_values, - TF_Status status); - -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - FloatPointer value, - TF_Status status); -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - String attr_name, - FloatBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - float[] value, - TF_Status status); -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - String attr_name, - FloatPointer value, - TF_Status status); -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - FloatBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrFloat(TF_Operation oper, - String attr_name, - float[] value, - TF_Status status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - FloatPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - String attr_name, - FloatBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - float[] values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - String attr_name, - FloatPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - FloatBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrFloatList(TF_Operation oper, - String attr_name, - float[] values, - int max_values, - TF_Status status); - -public static native void TF_OperationGetAttrBool(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") BytePointer value, - TF_Status status); -public static native void TF_OperationGetAttrBool(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") ByteBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrBool(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") byte[] value, - TF_Status status); -public static native void TF_OperationGetAttrBool(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") BytePointer value, - TF_Status status); -public static native void TF_OperationGetAttrBool(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") ByteBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrBool(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") byte[] value, - TF_Status status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") BytePointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") ByteBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") byte[] values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") BytePointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") ByteBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrBoolList(TF_Operation oper, - String attr_name, - @Cast("unsigned char*") byte[] values, - int max_values, - TF_Status status); - -public static native void TF_OperationGetAttrType(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") IntPointer value, - TF_Status status); -public static native void TF_OperationGetAttrType(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") IntBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrType(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") int[] value, - TF_Status status); -public static native void TF_OperationGetAttrType(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") IntPointer value, - TF_Status status); -public static native void TF_OperationGetAttrType(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") IntBuffer value, - TF_Status status); -public static native void TF_OperationGetAttrType(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") int[] value, - TF_Status status); - -// Fills in `values` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `max_values` (ideally set -// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, -// attr_name)). -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") IntPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") IntBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") int[] values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") IntPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType*") IntBuffer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTypeList(TF_Operation oper, - String attr_name, - @Cast("TF_DataType*") int[] values, - int max_values, - TF_Status status); - -// Fills in `value` with the value of the attribute `attr_name` of `oper`. -// `values` must point to an array of length at least `num_dims` (ideally set to -// TF_Attr_Meta.size from TF_OperationGetAttrMetadata(oper, attr_name)). -public static native void TF_OperationGetAttrShape(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongPointer value, - int num_dims, - TF_Status status); -public static native void TF_OperationGetAttrShape(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongBuffer value, - int num_dims, - TF_Status status); -public static native void TF_OperationGetAttrShape(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") long[] value, - int num_dims, - TF_Status status); -public static native void TF_OperationGetAttrShape(TF_Operation oper, - String attr_name, - @Cast("int64_t*") LongPointer value, - int num_dims, - TF_Status status); -public static native void TF_OperationGetAttrShape(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("int64_t*") LongBuffer value, - int num_dims, - TF_Status status); -public static native void TF_OperationGetAttrShape(TF_Operation oper, - String attr_name, - @Cast("int64_t*") long[] value, - int num_dims, - TF_Status status); - -// Fills in `dims` with the list of shapes in the attribute `attr_name` of -// `oper` and `num_dims` with the corresponding number of dimensions. On return, -// for every i where `num_dims[i]` > 0, `dims[i]` will be an array of -// `num_dims[i]` elements. A value of -1 for `num_dims[i]` indicates that the -// i-th shape in the list is unknown. -// -// The elements of `dims` will point to addresses in `storage` which must be -// large enough to hold at least `storage_size` int64_ts. Ideally, `num_shapes` -// would be set to TF_AttrMetadata.list_size and `storage_size` would be set to -// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, -// attr_name). -// -// Fails if storage_size is insufficient to hold the requested shapes. -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") PointerPointer dims, IntPointer num_dims, - int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr LongPointer dims, IntPointer num_dims, - int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr LongBuffer dims, IntBuffer num_dims, - int num_shapes, @Cast("int64_t*") LongBuffer storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr long[] dims, int[] num_dims, - int num_shapes, @Cast("int64_t*") long[] storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr LongPointer dims, IntPointer num_dims, - int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr LongBuffer dims, IntBuffer num_dims, - int num_shapes, @Cast("int64_t*") LongBuffer storage, int storage_size, TF_Status status); -public static native void TF_OperationGetAttrShapeList( - TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr long[] dims, int[] num_dims, - int num_shapes, @Cast("int64_t*") long[] storage, int storage_size, TF_Status status); - -// Sets `value` to the binary-serialized TensorShapeProto of the value of -// `attr_name` attribute of `oper`'. -public static native void TF_OperationGetAttrTensorShapeProto( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Buffer value, - TF_Status status); -public static native void TF_OperationGetAttrTensorShapeProto( - TF_Operation oper, String attr_name, TF_Buffer value, - TF_Status status); - -// Fills in `values` with binary-serialized TensorShapeProto values of the -// attribute `attr_name` of `oper`. `values` must point to an array of length at -// least `num_values` (ideally set to TF_AttrMetadata.list_size from -// TF_OperationGetAttrMetadata(oper, attr_name)). -public static native void TF_OperationGetAttrTensorShapeProtoList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("TF_Buffer**") PointerPointer values, - int max_values, TF_Status status); -public static native void TF_OperationGetAttrTensorShapeProtoList( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, @ByPtrPtr TF_Buffer values, - int max_values, TF_Status status); -public static native void TF_OperationGetAttrTensorShapeProtoList( - TF_Operation oper, String attr_name, @ByPtrPtr TF_Buffer values, - int max_values, TF_Status status); - -// Gets the TF_Tensor valued attribute of `attr_name` of `oper`. -// -// Allocates a new TF_Tensor which the caller is expected to take -// ownership of (and can deallocate using TF_DeleteTensor). -public static native void TF_OperationGetAttrTensor(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_Tensor**") PointerPointer value, - TF_Status status); -public static native void TF_OperationGetAttrTensor(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @ByPtrPtr TF_Tensor value, - TF_Status status); -public static native void TF_OperationGetAttrTensor(TF_Operation oper, - String attr_name, - @ByPtrPtr TF_Tensor value, - TF_Status status); - -// Fills in `values` with the TF_Tensor values of the attribute `attr_name` of -// `oper`. `values` must point to an array of TF_Tensor* of length at least -// `max_values` (ideally set to TF_AttrMetadata.list_size from -// TF_OperationGetAttrMetadata(oper, attr_name)). -// -// The caller takes ownership of all the non-null TF_Tensor* entries in `values` -// (which can be deleted using TF_DeleteTensor(values[i])). -public static native void TF_OperationGetAttrTensorList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @Cast("TF_Tensor**") PointerPointer values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTensorList(TF_Operation oper, - @Cast("const char*") BytePointer attr_name, - @ByPtrPtr TF_Tensor values, - int max_values, - TF_Status status); -public static native void TF_OperationGetAttrTensorList(TF_Operation oper, - String attr_name, - @ByPtrPtr TF_Tensor values, - int max_values, - TF_Status status); - -// Sets `output_attr_value` to the binary-serialized AttrValue proto -// representation of the value of the `attr_name` attr of `oper`. -public static native void TF_OperationGetAttrValueProto( - TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Buffer output_attr_value, - TF_Status status); -public static native void TF_OperationGetAttrValueProto( - TF_Operation oper, String attr_name, TF_Buffer output_attr_value, - TF_Status status); - -// Returns the operation in the graph with `oper_name`. Returns nullptr if -// no operation found. -public static native TF_Operation TF_GraphOperationByName( - TF_Graph graph, @Cast("const char*") BytePointer oper_name); -public static native TF_Operation TF_GraphOperationByName( - TF_Graph graph, String oper_name); - -// Iterate through the operations of a graph. To use: -// size_t pos = 0; -// TF_Operation* oper; -// while ((oper = TF_GraphNextOperation(graph, &pos)) != nullptr) { -// DoSomethingWithOperation(oper); -// } -public static native TF_Operation TF_GraphNextOperation(TF_Graph graph, - @Cast("size_t*") SizeTPointer pos); - -// Write out a serialized representation of `graph` (as a GraphDef protocol -// message) to `output_graph_def` (allocated by TF_NewBuffer()). -// `output_graph_def`'s underlying buffer will be freed when TF_DeleteBuffer() -// is called. -// -// May fail on very large graphs in the future. -public static native void TF_GraphToGraphDef(TF_Graph graph, - TF_Buffer output_graph_def, - TF_Status status); - -// Returns the serialized OpDef proto with name `op_name`, or a bad status if no -// such op exists. This can return OpDefs of functions copied into the graph. -public static native void TF_GraphGetOpDef(TF_Graph graph, - @Cast("const char*") BytePointer op_name, - TF_Buffer output_op_def, - TF_Status status); -public static native void TF_GraphGetOpDef(TF_Graph graph, - String op_name, - TF_Buffer output_op_def, - TF_Status status); - -// Returns the serialized VersionDef proto for this graph. -public static native void TF_GraphVersions(TF_Graph graph, - TF_Buffer output_version_def, - TF_Status status); -// Targeting ../TF_ImportGraphDefOptions.java - - - -public static native TF_ImportGraphDefOptions TF_NewImportGraphDefOptions(); -public static native void TF_DeleteImportGraphDefOptions( - TF_ImportGraphDefOptions opts); - -// Set the prefix to be prepended to the names of nodes in `graph_def` that will -// be imported into `graph`. `prefix` is copied and has no lifetime -// requirements. -public static native void TF_ImportGraphDefOptionsSetPrefix( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer prefix); -public static native void TF_ImportGraphDefOptionsSetPrefix( - TF_ImportGraphDefOptions opts, String prefix); - -// Set the execution device for nodes in `graph_def`. -// Only applies to nodes where a device was not already explicitly specified. -// `device` is copied and has no lifetime requirements. -public static native void TF_ImportGraphDefOptionsSetDefaultDevice( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer device); -public static native void TF_ImportGraphDefOptionsSetDefaultDevice( - TF_ImportGraphDefOptions opts, String device); - -// Set whether to uniquify imported operation names. If true, imported operation -// names will be modified if their name already exists in the graph. If false, -// conflicting names will be treated as an error. Note that this option has no -// effect if a prefix is set, since the prefix will guarantee all names are -// unique. Defaults to false. -public static native void TF_ImportGraphDefOptionsSetUniquifyNames( - TF_ImportGraphDefOptions opts, @Cast("unsigned char") byte uniquify_names); - -// If true, the specified prefix will be modified if it already exists as an -// operation name or prefix in the graph. If false, a conflicting prefix will be -// treated as an error. This option has no effect if no prefix is specified. -public static native void TF_ImportGraphDefOptionsSetUniquifyPrefix( - TF_ImportGraphDefOptions opts, @Cast("unsigned char") byte uniquify_prefix); - -// Set any imported nodes with input `src_name:src_index` to have that input -// replaced with `dst`. `src_name` refers to a node in the graph to be imported, -// `dst` references a node already existing in the graph being imported into. -// `src_name` is copied and has no lifetime requirements. -public static native void TF_ImportGraphDefOptionsAddInputMapping( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer src_name, int src_index, - @ByVal TF_Output dst); -public static native void TF_ImportGraphDefOptionsAddInputMapping( - TF_ImportGraphDefOptions opts, String src_name, int src_index, - @ByVal TF_Output dst); - -// Set any imported nodes with control input `src_name` to have that input -// replaced with `dst`. `src_name` refers to a node in the graph to be imported, -// `dst` references an operation already existing in the graph being imported -// into. `src_name` is copied and has no lifetime requirements. -public static native void TF_ImportGraphDefOptionsRemapControlDependency( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer src_name, TF_Operation dst); -public static native void TF_ImportGraphDefOptionsRemapControlDependency( - TF_ImportGraphDefOptions opts, String src_name, TF_Operation dst); - -// Cause the imported graph to have a control dependency on `oper`. `oper` -// should exist in the graph being imported into. -public static native void TF_ImportGraphDefOptionsAddControlDependency( - TF_ImportGraphDefOptions opts, TF_Operation oper); - -// Add an output in `graph_def` to be returned via the `return_outputs` output -// parameter of TF_GraphImportGraphDef(). If the output is remapped via an input -// mapping, the corresponding existing tensor in `graph` will be returned. -// `oper_name` is copied and has no lifetime requirements. -public static native void TF_ImportGraphDefOptionsAddReturnOutput( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer oper_name, int index); -public static native void TF_ImportGraphDefOptionsAddReturnOutput( - TF_ImportGraphDefOptions opts, String oper_name, int index); - -// Returns the number of return outputs added via -// TF_ImportGraphDefOptionsAddReturnOutput(). -public static native int TF_ImportGraphDefOptionsNumReturnOutputs( - @Const TF_ImportGraphDefOptions opts); - -// Add an operation in `graph_def` to be returned via the `return_opers` output -// parameter of TF_GraphImportGraphDef(). `oper_name` is copied and has no -// lifetime requirements. -public static native void TF_ImportGraphDefOptionsAddReturnOperation( - TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer oper_name); -public static native void TF_ImportGraphDefOptionsAddReturnOperation( - TF_ImportGraphDefOptions opts, String oper_name); - -// Returns the number of return operations added via -// TF_ImportGraphDefOptionsAddReturnOperation(). -public static native int TF_ImportGraphDefOptionsNumReturnOperations( - @Const TF_ImportGraphDefOptions opts); -// Targeting ../TF_ImportGraphDefResults.java - - - -// Fetches the return outputs requested via -// TF_ImportGraphDefOptionsAddReturnOutput(). The number of fetched outputs is -// returned in `num_outputs`. The array of return outputs is returned in -// `outputs`. `*outputs` is owned by and has the lifetime of `results`. -public static native void TF_ImportGraphDefResultsReturnOutputs( - TF_ImportGraphDefResults results, IntPointer num_outputs, @Cast("TF_Output**") PointerPointer outputs); -public static native void TF_ImportGraphDefResultsReturnOutputs( - TF_ImportGraphDefResults results, IntPointer num_outputs, @ByPtrPtr TF_Output outputs); -public static native void TF_ImportGraphDefResultsReturnOutputs( - TF_ImportGraphDefResults results, IntBuffer num_outputs, @ByPtrPtr TF_Output outputs); -public static native void TF_ImportGraphDefResultsReturnOutputs( - TF_ImportGraphDefResults results, int[] num_outputs, @ByPtrPtr TF_Output outputs); - -// Fetches the return operations requested via -// TF_ImportGraphDefOptionsAddReturnOperation(). The number of fetched -// operations is returned in `num_opers`. The array of return operations is -// returned in `opers`. `*opers` is owned by and has the lifetime of `results`. -public static native void TF_ImportGraphDefResultsReturnOperations( - TF_ImportGraphDefResults results, IntPointer num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); -public static native void TF_ImportGraphDefResultsReturnOperations( - TF_ImportGraphDefResults results, IntBuffer num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); -public static native void TF_ImportGraphDefResultsReturnOperations( - TF_ImportGraphDefResults results, int[] num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); - -// Fetches any input mappings requested via -// TF_ImportGraphDefOptionsAddInputMapping() that didn't appear in the GraphDef -// and weren't used as input to any node in the imported graph def. The number -// of fetched mappings is returned in `num_missing_unused_input_mappings`. The -// array of each mapping's source node name is returned in `src_names`, and the -// array of each mapping's source index is returned in `src_indexes`. -// -// `*src_names`, `*src_indexes`, and the memory backing each string in -// `src_names` are owned by and have the lifetime of `results`. -public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( - TF_ImportGraphDefResults results, IntPointer num_missing_unused_input_mappings, - @Cast("const char***") @ByPtrPtr PointerPointer src_names, @Cast("int**") PointerPointer src_indexes); -public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( - TF_ImportGraphDefResults results, IntPointer num_missing_unused_input_mappings, - @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr IntPointer src_indexes); -public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( - TF_ImportGraphDefResults results, IntBuffer num_missing_unused_input_mappings, - @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr IntBuffer src_indexes); -public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( - TF_ImportGraphDefResults results, int[] num_missing_unused_input_mappings, - @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr int[] src_indexes); - -// Deletes a results object returned by TF_GraphImportGraphDefWithResults(). -public static native void TF_DeleteImportGraphDefResults( - TF_ImportGraphDefResults results); - -// Import the graph serialized in `graph_def` into `graph`. Returns nullptr and -// a bad status on error. Otherwise, returns a populated -// TF_ImportGraphDefResults instance. The returned instance must be deleted via -// TF_DeleteImportGraphDefResults(). -public static native TF_ImportGraphDefResults TF_GraphImportGraphDefWithResults(TF_Graph graph, @Const TF_Buffer graph_def, - @Const TF_ImportGraphDefOptions options, - TF_Status status); - -// Import the graph serialized in `graph_def` into `graph`. -// Convenience function for when only return outputs are needed. -// -// `num_return_outputs` must be the number of return outputs added (i.e. the -// result of TF_ImportGraphDefOptionsNumReturnOutputs()). If -// `num_return_outputs` is non-zero, `return_outputs` must be of length -// `num_return_outputs`. Otherwise it can be null. -public static native void TF_GraphImportGraphDefWithReturnOutputs( - TF_Graph graph, @Const TF_Buffer graph_def, - @Const TF_ImportGraphDefOptions options, TF_Output return_outputs, - int num_return_outputs, TF_Status status); - -// Import the graph serialized in `graph_def` into `graph`. -// Convenience function for when no results are needed. -public static native void TF_GraphImportGraphDef( - TF_Graph graph, @Const TF_Buffer graph_def, - @Const TF_ImportGraphDefOptions options, TF_Status status); - -// Adds a copy of function `func` and optionally its gradient function `grad` -// to `g`. Once `func`/`grad` is added to `g`, it can be called by creating -// an operation using the function's name. -// Any changes to `func`/`grad` (including deleting it) done after this method -// returns, won't affect the copy of `func`/`grad` in `g`. -// If `func` or `grad` are already in `g`, TF_GraphCopyFunction has no -// effect on them, but can establish the function->gradient relationship -// between them if `func` does not already have a gradient. If `func` already -// has a gradient different from `grad`, an error is returned. -// -// `func` must not be null. -// If `grad` is null and `func` is not in `g`, `func` is added without a -// gradient. -// If `grad` is null and `func` is in `g`, TF_GraphCopyFunction is a noop. -// `grad` must have appropriate signature as described in the doc of -// GradientDef in tensorflow/core/framework/function.proto. -// -// If successful, status is set to OK and `func` and `grad` are added to `g`. -// Otherwise, status is set to the encountered error and `g` is unmodified. -public static native void TF_GraphCopyFunction(TF_Graph g, - @Const TF_Function func, - @Const TF_Function grad, - TF_Status status); - -// Returns the number of TF_Functions registered in `g`. -public static native int TF_GraphNumFunctions(TF_Graph g); - -// Fills in `funcs` with the TF_Function* registered in `g`. -// `funcs` must point to an array of TF_Function* of length at least -// `max_func`. In usual usage, max_func should be set to the result of -// TF_GraphNumFunctions(g). In this case, all the functions registered in -// `g` will be returned. Else, an unspecified subset. -// -// If successful, returns the number of TF_Function* successfully set in -// `funcs` and sets status to OK. The caller takes ownership of -// all the returned TF_Functions. They must be deleted with TF_DeleteFunction. -// On error, returns 0, sets status to the encountered error, and the contents -// of funcs will be undefined. -public static native int TF_GraphGetFunctions(TF_Graph g, @Cast("TF_Function**") PointerPointer funcs, - int max_func, TF_Status status); -public static native int TF_GraphGetFunctions(TF_Graph g, @ByPtrPtr TF_Function funcs, - int max_func, TF_Status status); - -// Note: The following function may fail on very large protos in the future. - -public static native void TF_OperationToNodeDef(TF_Operation oper, - TF_Buffer output_node_def, - TF_Status status); -// Targeting ../TF_WhileParams.java - - - -// Creates a TF_WhileParams for creating a while loop in `g`. `inputs` are -// outputs that already exist in `g` used as initial values for the loop -// variables. -// -// The returned TF_WhileParams will have all fields initialized except -// `cond_output`, `body_outputs`, and `name`. The `body_outputs` buffer will be -// allocated to size `ninputs`. The caller should build `cond_graph` and -// `body_graph` starting from the inputs, and store the final outputs in -// `cond_output` and `body_outputs`. -// -// If `status` is OK, the caller must call either TF_FinishWhile or -// TF_AbortWhile on the returned TF_WhileParams. If `status` isn't OK, the -// returned TF_WhileParams is not valid, and the caller should not call -// TF_FinishWhile() or TF_AbortWhile(). -// -// Missing functionality (TODO): -// - Gradients -// - Reference-type inputs -// - Directly referencing external tensors from the cond/body graphs (this is -// possible in the Python API) -public static native @ByVal TF_WhileParams TF_NewWhile(TF_Graph g, TF_Output inputs, - int ninputs, - TF_Status status); - -// Builds the while loop specified by `params` and returns the output tensors of -// the while loop in `outputs`. `outputs` should be allocated to size -// `params.ninputs`. -// -// `params` is no longer valid once this returns. -// -// Either this or TF_AbortWhile() must be called after a successful -// TF_NewWhile() call. -public static native void TF_FinishWhile(@Const TF_WhileParams params, - TF_Status status, - TF_Output outputs); - -// Frees `params`s resources without building a while loop. `params` is no -// longer valid after this returns. Either this or TF_FinishWhile() must be -// called after a successful TF_NewWhile() call. -public static native void TF_AbortWhile(@Const TF_WhileParams params); - -// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, -// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... -// -// `dx` are used as initial gradients (which represent the symbolic partial -// derivatives of some loss function `L` w.r.t. `y`). -// `dx` must be nullptr or have size `ny`. -// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all -// shapes in `y`. -// The partial derivatives are returned in `dy`. `dy` should be allocated to -// size `nx`. -// -// Gradient nodes are automatically named under the "gradients/" prefix. To -// guarantee name uniqueness, subsequent calls to the same graph will -// append an incremental tag to the prefix: "gradients_1/", "gradients_2/", ... -// See TF_AddGradientsWithPrefix, which provides a means to specify a custom -// name prefix for operations added to a graph to compute the gradients. -// -// WARNING: This function does not yet support all the gradients that python -// supports. See -// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md -// for instructions on how to add C++ more gradients. -public static native void TF_AddGradients(TF_Graph g, TF_Output y, int ny, - TF_Output x, int nx, TF_Output dx, - TF_Status status, TF_Output dy); - -// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, -// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... -// This is a variant of TF_AddGradients that allows to caller to pass a custom -// name prefix to the operations added to a graph to compute the gradients. -// -// `dx` are used as initial gradients (which represent the symbolic partial -// derivatives of some loss function `L` w.r.t. `y`). -// `dx` must be nullptr or have size `ny`. -// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all -// shapes in `y`. -// The partial derivatives are returned in `dy`. `dy` should be allocated to -// size `nx`. -// `prefix` names the scope into which all gradients operations are being added. -// `prefix` must be unique within the provided graph otherwise this operation -// will fail. If `prefix` is nullptr, the default prefixing behaviour takes -// place, see TF_AddGradients for more details. -// -// WARNING: This function does not yet support all the gradients that python -// supports. See -// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md -// for instructions on how to add C++ more gradients. -public static native void TF_AddGradientsWithPrefix(TF_Graph g, @Cast("const char*") BytePointer prefix, - TF_Output y, int ny, - TF_Output x, int nx, - TF_Output dx, TF_Status status, - TF_Output dy); -public static native void TF_AddGradientsWithPrefix(TF_Graph g, String prefix, - TF_Output y, int ny, - TF_Output x, int nx, - TF_Output dx, TF_Status status, - TF_Output dy); - -// Create a TF_Function from a TF_Graph -// -// Params: -// fn_body - the graph whose operations (or subset of whose operations) will be -// converted to TF_Function. -// fn_name - the name of the new TF_Function. Should match the operation -// name (OpDef.name) regexp [A-Z][A-Za-z0-9_.\\-/]*. -// If `append_hash_to_fn_name` is false, `fn_name` must be distinct -// from other function and operation names (at least those -// registered in graphs where this function will be used). -// append_hash_to_fn_name - Must be 0 or 1. If set to 1, the actual name -// of the function will be `fn_name` appended with -// '_'. -// If set to 0, the function's name will be `fn_name`. -// num_opers - `num_opers` contains the number of elements in the `opers` array -// or a special value of -1 meaning that no array is given. -// The distinction between an empty array of operations and no -// array of operations is necessary to distinguish the case of -// creating a function with no body (e.g. identity or permutation) -// and the case of creating a function whose body contains all -// the nodes in the graph (except for the automatic skipping, see -// below). -// opers - Array of operations to become the body of the function or null. -// - If no array is given (`num_opers` = -1), all the -// operations in `fn_body` will become part of the function -// except operations referenced in `inputs`. These operations -// must have a single output (these operations are typically -// placeholders created for the sole purpose of representing -// an input. We can relax this constraint if there are -// compelling use cases). -// - If an array is given (`num_opers` >= 0), all operations -// in it will become part of the function. In particular, no -// automatic skipping of dummy input operations is performed. -// ninputs - number of elements in `inputs` array -// inputs - array of TF_Outputs that specify the inputs to the function. -// If `ninputs` is zero (the function takes no inputs), `inputs` -// can be null. The names used for function inputs are normalized -// names of the operations (usually placeholders) pointed to by -// `inputs`. These operation names should start with a letter. -// Normalization will convert all letters to lowercase and -// non-alphanumeric characters to '_' to make resulting names match -// the "[a-z][a-z0-9_]*" pattern for operation argument names. -// `inputs` cannot contain the same tensor twice. -// noutputs - number of elements in `outputs` array -// outputs - array of TF_Outputs that specify the outputs of the function. -// If `noutputs` is zero (the function returns no outputs), `outputs` -// can be null. `outputs` can contain the same tensor more than once. -// output_names - The names of the function's outputs. `output_names` array -// must either have the same length as `outputs` -// (i.e. `noutputs`) or be null. In the former case, -// the names should match the regular expression for ArgDef -// names - "[a-z][a-z0-9_]*". In the latter case, -// names for outputs will be generated automatically. -// opts - various options for the function, e.g. XLA's inlining control. -// description - optional human-readable description of this function. -// status - Set to OK on success and an appropriate error on failure. -// -// Note that when the same TF_Output is listed as both an input and an output, -// the corresponding function's output will equal to this input, -// instead of the original node's output. -// -// Callers must also satisfy the following constraints: -// - `inputs` cannot refer to TF_Outputs within a control flow context. For -// example, one cannot use the output of "switch" node as input. -// - `inputs` and `outputs` cannot have reference types. Reference types are -// not exposed through C API and are being replaced with Resources. We support -// reference types inside function's body to support legacy code. Do not -// use them in new code. -// - Every node in the function's body must have all of its inputs (including -// control inputs). In other words, for every node in the body, each input -// must be either listed in `inputs` or must come from another node in -// the body. In particular, it is an error to have a control edge going from -// a node outside of the body into a node in the body. This applies to control -// edges going from nodes referenced in `inputs` to nodes in the body when -// the former nodes are not in the body (automatically skipped or not -// included in explicitly specified body). -// -// Returns: -// On success, a newly created TF_Function instance. It must be deleted by -// calling TF_DeleteFunction. -// -// On failure, null. -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Cast("const TF_Operation*const*") PointerPointer opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") PointerPointer output_names, - @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, - @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, - @Const TF_FunctionOptions opts, String description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, - @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, - @Const TF_FunctionOptions opts, String description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, - @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunction( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, - @Const TF_FunctionOptions opts, String description, TF_Status status); - -// Similar to TF_GraphToFunction but allows specifying control outputs of the -// function. -// -// The arguments of TF_GraphToFunction have the same meaning, but the new -// arguments are as follows: -// -// ncontrol_outputs: Number of control outputs of the function. -// control_outputs: vector of TF_Operation objects to be marked as control -// outputs of the function. Operations marked as control outputs are -// guaranteed to execute. -// control_output_names: Optional. If not nullptr, vector of strings, one -// per control output, with their names to be added to the function's -// OpDef. -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Cast("const TF_Operation*const*") PointerPointer opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") PointerPointer output_names, - int ncontrol_outputs, @Cast("const TF_Operation*const*") PointerPointer control_outputs, - @Cast("const char*const*") PointerPointer control_output_names, @Const TF_FunctionOptions opts, - @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr BytePointer control_output_names, @Const TF_FunctionOptions opts, - @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr ByteBuffer control_output_names, @Const TF_FunctionOptions opts, - String description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr byte[] control_output_names, @Const TF_FunctionOptions opts, - @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr BytePointer control_output_names, @Const TF_FunctionOptions opts, - String description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr ByteBuffer control_output_names, @Const TF_FunctionOptions opts, - @Cast("const char*") BytePointer description, TF_Status status); -public static native TF_Function TF_GraphToFunctionWithControlOutputs( - @Const TF_Graph fn_body, String fn_name, - @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, - @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, - int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, - int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, - @Cast("const char*const*") @ByPtrPtr byte[] control_output_names, @Const TF_FunctionOptions opts, - String description, TF_Status status); - -// Returns the name of the graph function. -// The return value points to memory that is only usable until the next -// mutation to *func. -public static native @Cast("const char*") BytePointer TF_FunctionName(TF_Function func); - -// Write out a serialized representation of `func` (as a FunctionDef protocol -// message) to `output_func_def` (allocated by TF_NewBuffer()). -// `output_func_def`'s underlying buffer will be freed when TF_DeleteBuffer() -// is called. -// -// May fail on very large graphs in the future. -public static native void TF_FunctionToFunctionDef(TF_Function func, - TF_Buffer output_func_def, - TF_Status status); - -// Construct and return the function whose FunctionDef representation is -// serialized in `proto`. `proto_len` must equal the number of bytes -// pointed to by `proto`. -// Returns: -// On success, a newly created TF_Function instance. It must be deleted by -// calling TF_DeleteFunction. -// -// On failure, null. -public static native TF_Function TF_FunctionImportFunctionDef( - @Const Pointer proto, @Cast("size_t") long proto_len, TF_Status status); - -// Sets function attribute named `attr_name` to value stored in `proto`. -// If this attribute is already set to another value, it is overridden. -// `proto` should point to a sequence of bytes of length `proto_len` -// representing a binary serialization of an AttrValue protocol -// buffer. -public static native void TF_FunctionSetAttrValueProto(TF_Function func, - @Cast("const char*") BytePointer attr_name, - @Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); -public static native void TF_FunctionSetAttrValueProto(TF_Function func, - String attr_name, - @Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); - -// Sets `output_attr_value` to the binary-serialized AttrValue proto -// representation of the value of the `attr_name` attr of `func`. -// If `attr_name` attribute is not present, status is set to an error. -public static native void TF_FunctionGetAttrValueProto( - TF_Function func, @Cast("const char*") BytePointer attr_name, TF_Buffer output_attr_value, - TF_Status status); -public static native void TF_FunctionGetAttrValueProto( - TF_Function func, String attr_name, TF_Buffer output_attr_value, - TF_Status status); - -// Frees the memory used by the `func` struct. -// TF_DeleteFunction is a noop if `func` is null. -// Deleting a function does not remove it from any graphs it was copied to. -public static native void TF_DeleteFunction(TF_Function func); - -// Attempts to evaluate `output`. This will only be possible if `output` doesn't -// depend on any graph inputs (this function is safe to call if this isn't the -// case though). -// -// If the evaluation is successful, this function returns true and `output`s -// value is returned in `result`. Otherwise returns false. An error status is -// returned if something is wrong with the graph or input. Note that this may -// return false even if no error status is set. -public static native @Cast("unsigned char") byte TF_TryEvaluateConstant(TF_Graph graph, - @ByVal TF_Output output, - @Cast("TF_Tensor**") PointerPointer result, - TF_Status status); -public static native @Cast("unsigned char") byte TF_TryEvaluateConstant(TF_Graph graph, - @ByVal TF_Output output, - @ByPtrPtr TF_Tensor result, - TF_Status status); -// Targeting ../TF_Session.java - - - -// Return a new execution session with the associated graph, or NULL on -// error. Does not take ownership of any input parameters. -// -// *`graph` must be a valid graph (not deleted or nullptr). `graph` will be -// kept alive for the lifetime of the returned TF_Session. New nodes can still -// be added to `graph` after this call. -public static native TF_Session TF_NewSession(TF_Graph graph, - @Const TF_SessionOptions opts, - TF_Status status); - -// This function creates a new TF_Session (which is created on success) using -// `session_options`, and then initializes state (restoring tensors and other -// assets) using `run_options`. -// -// Any NULL and non-NULL value combinations for (`run_options, `meta_graph_def`) -// are valid. -// -// - `export_dir` must be set to the path of the exported SavedModel. -// - `tags` must include the set of tags used to identify one MetaGraphDef in -// the SavedModel. -// - `graph` must be a graph newly allocated with TF_NewGraph(). -// -// If successful, populates `graph` with the contents of the Graph and -// `meta_graph_def` with the MetaGraphDef of the loaded model. -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") PointerPointer tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr BytePointer tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - String export_dir, @Cast("const char*const*") @ByPtrPtr ByteBuffer tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr byte[] tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - String export_dir, @Cast("const char*const*") @ByPtrPtr BytePointer tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr ByteBuffer tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); -public static native TF_Session TF_LoadSessionFromSavedModel( - @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, - String export_dir, @Cast("const char*const*") @ByPtrPtr byte[] tags, int tags_len, - TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); - -// Close a session. -// -// Contacts any other processes associated with the session, if applicable. -// May not be called after TF_DeleteSession(). -public static native void TF_CloseSession(TF_Session arg0, TF_Status status); - -// Destroy a session object. -// -// Even if error information is recorded in *status, this call discards all -// local resources associated with the session. The session may not be used -// during or after this call (and the session drops its reference to the -// corresponding graph). -public static native void TF_DeleteSession(TF_Session arg0, TF_Status status); - -// Run the graph associated with the session starting with the supplied inputs -// (inputs[0,ninputs-1] with corresponding values in input_values[0,ninputs-1]). -// -// Any NULL and non-NULL value combinations for (`run_options`, -// `run_metadata`) are valid. -// -// - `run_options` may be NULL, in which case it will be ignored; or -// non-NULL, in which case it must point to a `TF_Buffer` containing the -// serialized representation of a `RunOptions` protocol buffer. -// - `run_metadata` may be NULL, in which case it will be ignored; or -// non-NULL, in which case it must point to an empty, freshly allocated -// `TF_Buffer` that may be updated to contain the serialized representation -// of a `RunMetadata` protocol buffer. -// -// The caller retains ownership of `input_values` (which can be deleted using -// TF_DeleteTensor). The caller also retains ownership of `run_options` and/or -// `run_metadata` (when not NULL) and should manually call TF_DeleteBuffer on -// them. -// -// On success, the tensors corresponding to outputs[0,noutputs-1] are placed in -// output_values[]. Ownership of the elements of output_values[] is transferred -// to the caller, which must eventually call TF_DeleteTensor on them. -// -// On failure, output_values[] contains NULLs. -public static native void TF_SessionRun( - TF_Session session, - @Const TF_Buffer run_options, - @Const TF_Output inputs, @Cast("TF_Tensor*const*") PointerPointer input_values, int ninputs, - @Const TF_Output outputs, @Cast("TF_Tensor**") PointerPointer output_values, int noutputs, - @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, - TF_Buffer run_metadata, - TF_Status arg11); -public static native void TF_SessionRun( - TF_Session session, - @Const TF_Buffer run_options, - @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, - @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - TF_Buffer run_metadata, - TF_Status arg11); - -// Set up the graph with the intended feeds (inputs) and fetches (outputs) for a -// sequence of partial run calls. -// -// On success, returns a handle that is used for subsequent PRun calls. The -// handle should be deleted with TF_DeletePRunHandle when it is no longer -// needed. -// -// On failure, out_status contains a tensorflow::Status with an error -// message. *handle is set to nullptr. -public static native void TF_SessionPRunSetup( - TF_Session arg0, - @Const TF_Output inputs, int ninputs, - @Const TF_Output outputs, int noutputs, - @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, - @Cast("const char**") PointerPointer handle, - TF_Status arg8); -public static native void TF_SessionPRunSetup( - TF_Session arg0, - @Const TF_Output inputs, int ninputs, - @Const TF_Output outputs, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - @Cast("const char**") @ByPtrPtr BytePointer handle, - TF_Status arg8); -public static native void TF_SessionPRunSetup( - TF_Session arg0, - @Const TF_Output inputs, int ninputs, - @Const TF_Output outputs, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - @Cast("const char**") @ByPtrPtr ByteBuffer handle, - TF_Status arg8); -public static native void TF_SessionPRunSetup( - TF_Session arg0, - @Const TF_Output inputs, int ninputs, - @Const TF_Output outputs, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - @Cast("const char**") @ByPtrPtr byte[] handle, - TF_Status arg8); - -// Continue to run the graph with additional feeds and fetches. The -// execution state is uniquely identified by the handle. -public static native void TF_SessionPRun( - TF_Session arg0, @Cast("const char*") BytePointer handle, - @Const TF_Output inputs, @Cast("TF_Tensor*const*") PointerPointer input_values, int ninputs, - @Const TF_Output outputs, @Cast("TF_Tensor**") PointerPointer output_values, int noutputs, - @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, - TF_Status arg10); -public static native void TF_SessionPRun( - TF_Session arg0, @Cast("const char*") BytePointer handle, - @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, - @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - TF_Status arg10); -public static native void TF_SessionPRun( - TF_Session arg0, String handle, - @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, - @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, - @Const @ByPtrPtr TF_Operation target_opers, int ntargets, - TF_Status arg10); - -// Deletes a handle allocated by TF_SessionPRunSetup. -// Once called, no more calls to TF_SessionPRun should be made. -public static native void TF_DeletePRunHandle(@Cast("const char*") BytePointer handle); -public static native void TF_DeletePRunHandle(String handle); -// Targeting ../TF_DeprecatedSession.java - - - -public static native TF_DeprecatedSession TF_NewDeprecatedSession( - @Const TF_SessionOptions arg0, TF_Status status); -public static native void TF_CloseDeprecatedSession(TF_DeprecatedSession arg0, - TF_Status status); -public static native void TF_DeleteDeprecatedSession(TF_DeprecatedSession arg0, - TF_Status status); -public static native void TF_Reset(@Const TF_SessionOptions opt, - @Cast("const char**") PointerPointer containers, int ncontainers, - TF_Status status); -public static native void TF_Reset(@Const TF_SessionOptions opt, - @Cast("const char**") @ByPtrPtr BytePointer containers, int ncontainers, - TF_Status status); -public static native void TF_Reset(@Const TF_SessionOptions opt, - @Cast("const char**") @ByPtrPtr ByteBuffer containers, int ncontainers, - TF_Status status); -public static native void TF_Reset(@Const TF_SessionOptions opt, - @Cast("const char**") @ByPtrPtr byte[] containers, int ncontainers, - TF_Status status); -// Treat the bytes proto[0,proto_len-1] as a serialized GraphDef and -// add the nodes in that GraphDef to the graph for the session. -// -// Prefer use of TF_Session and TF_GraphImportGraphDef over this. -public static native void TF_ExtendGraph(TF_DeprecatedSession arg0, - @Const Pointer proto, @Cast("size_t") long proto_len, - TF_Status arg3); - -// See TF_SessionRun() above. -public static native void TF_Run(TF_DeprecatedSession arg0, - @Const TF_Buffer run_options, - @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, - int ninputs, @Cast("const char**") PointerPointer output_names, - @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, - @Cast("const char**") PointerPointer target_oper_names, int ntargets, - TF_Buffer run_metadata, TF_Status arg11); -public static native void TF_Run(TF_DeprecatedSession arg0, - @Const TF_Buffer run_options, - @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, - TF_Buffer run_metadata, TF_Status arg11); -public static native void TF_Run(TF_DeprecatedSession arg0, - @Const TF_Buffer run_options, - @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, - TF_Buffer run_metadata, TF_Status arg11); -public static native void TF_Run(TF_DeprecatedSession arg0, - @Const TF_Buffer run_options, - @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, - TF_Buffer run_metadata, TF_Status arg11); - -// See TF_SessionPRunSetup() above. -public static native void TF_PRunSetup(TF_DeprecatedSession arg0, - @Cast("const char**") PointerPointer input_names, int ninputs, - @Cast("const char**") PointerPointer output_names, int noutputs, - @Cast("const char**") PointerPointer target_oper_names, - int ntargets, @Cast("const char**") PointerPointer handle, - TF_Status arg8); -public static native void TF_PRunSetup(TF_DeprecatedSession arg0, - @Cast("const char**") @ByPtrPtr BytePointer input_names, int ninputs, - @Cast("const char**") @ByPtrPtr BytePointer output_names, int noutputs, - @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, - int ntargets, @Cast("const char**") @ByPtrPtr BytePointer handle, - TF_Status arg8); -public static native void TF_PRunSetup(TF_DeprecatedSession arg0, - @Cast("const char**") @ByPtrPtr ByteBuffer input_names, int ninputs, - @Cast("const char**") @ByPtrPtr ByteBuffer output_names, int noutputs, - @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, - int ntargets, @Cast("const char**") @ByPtrPtr ByteBuffer handle, - TF_Status arg8); -public static native void TF_PRunSetup(TF_DeprecatedSession arg0, - @Cast("const char**") @ByPtrPtr byte[] input_names, int ninputs, - @Cast("const char**") @ByPtrPtr byte[] output_names, int noutputs, - @Cast("const char**") @ByPtrPtr byte[] target_oper_names, - int ntargets, @Cast("const char**") @ByPtrPtr byte[] handle, - TF_Status arg8); - -// See TF_SessionPRun above. -public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, - @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, - int ninputs, @Cast("const char**") PointerPointer output_names, - @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, - @Cast("const char**") PointerPointer target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, - @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, - @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, - @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, - @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, - @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, - TF_Status arg10); -public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, - @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, - int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, - @ByPtrPtr TF_Tensor outputs, int noutputs, - @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, - TF_Status arg10); -// Targeting ../TF_DeviceList.java - - - -// Lists all devices in a TF_Session. -// -// Caller takes ownership of the returned TF_DeviceList* which must eventually -// be freed with a call to TF_DeleteDeviceList. -public static native TF_DeviceList TF_SessionListDevices(TF_Session session, - TF_Status status); - -// Lists all devices in a TF_Session. -// -// Caller takes ownership of the returned TF_DeviceList* which must eventually -// be freed with a call to TF_DeleteDeviceList. -public static native TF_DeviceList TF_DeprecatedSessionListDevices( - TF_DeprecatedSession session, TF_Status status); - -// Deallocates the device list. -public static native void TF_DeleteDeviceList(TF_DeviceList list); - -// Counts the number of elements in the device list. -public static native int TF_DeviceListCount(@Const TF_DeviceList list); - -// Retrieves the full name of the device (e.g. /job:worker/replica:0/...) -// The return value will be a pointer to a null terminated string. The caller -// must not modify or delete the string. It will be deallocated upon a call to -// TF_DeleteDeviceList. -// -// If index is out of bounds, an error code will be set in the status object, -// and a null pointer will be returned. -public static native @Cast("const char*") BytePointer TF_DeviceListName(@Const TF_DeviceList list, - int index, - TF_Status status); - -// Retrieves the type of the device at the given index. -// -// The caller must not modify or delete the string. It will be deallocated upon -// a call to TF_DeleteDeviceList. -// -// If index is out of bounds, an error code will be set in the status object, -// and a null pointer will be returned. -public static native @Cast("const char*") BytePointer TF_DeviceListType(@Const TF_DeviceList list, - int index, - TF_Status status); - -// Retrieve the amount of memory associated with a given device. -// -// If index is out of bounds, an error code will be set in the status object, -// and -1 will be returned. -public static native @Cast("int64_t") long TF_DeviceListMemoryBytes( - @Const TF_DeviceList list, int index, TF_Status status); - -// Retrieve the incarnation number of a given device. -// -// If index is out of bounds, an error code will be set in the status object, -// and 0 will be returned. -public static native @Cast("uint64_t") long TF_DeviceListIncarnation( - @Const TF_DeviceList list, int index, TF_Status status); -// Targeting ../TF_Library.java - - - -// Load the library specified by library_filename and register the ops and -// kernels present in that library. -// -// Pass "library_filename" to a platform-specific mechanism for dynamically -// loading a library. The rules for determining the exact location of the -// library are platform-specific and are not documented here. -// -// On success, place OK in status and return the newly created library handle. -// The caller owns the library handle. -// -// On failure, place an error status in status and return NULL. -public static native TF_Library TF_LoadLibrary(@Cast("const char*") BytePointer library_filename, - TF_Status status); -public static native TF_Library TF_LoadLibrary(String library_filename, - TF_Status status); - -// Get the OpList of OpDefs defined in the library pointed by lib_handle. -// -// Returns a TF_Buffer. The memory pointed to by the result is owned by -// lib_handle. The data in the buffer will be the serialized OpList proto for -// ops defined in the library. -public static native @ByVal TF_Buffer TF_GetOpList(TF_Library lib_handle); - -// Frees the memory associated with the library handle. -// Does NOT unload the library. -public static native void TF_DeleteLibraryHandle(TF_Library lib_handle); - -// Get the OpList of all OpDefs defined in this address space. -// Returns a TF_Buffer, ownership of which is transferred to the caller -// (and can be freed using TF_DeleteBuffer). -// -// The data in the buffer will be the serialized OpList proto for ops registered -// in this address space. -public static native TF_Buffer TF_GetAllOpList(); -// Targeting ../TF_ApiDefMap.java - - - -// Creates a new TF_ApiDefMap instance. -// -// Params: -// op_list_buffer - TF_Buffer instance containing serialized OpList -// protocol buffer. (See -// https://www.tensorflow.org/code/tensorflow/core/framework/op_def.proto -// for the OpList proto definition). -// status - Set to OK on success and an appropriate error on failure. -public static native TF_ApiDefMap TF_NewApiDefMap(TF_Buffer op_list_buffer, - TF_Status status); - -// Deallocates a TF_ApiDefMap. -public static native void TF_DeleteApiDefMap(TF_ApiDefMap apimap); - -// Add ApiDefs to the map. -// -// `text` corresponds to a text representation of an ApiDefs protocol message. -// (https://www.tensorflow.org/code/tensorflow/core/framework/api_def.proto). -// -// The provided ApiDefs will be merged with existing ones in the map, with -// precedence given to the newly added version in case of conflicts with -// previous calls to TF_ApiDefMapPut. -public static native void TF_ApiDefMapPut(TF_ApiDefMap api_def_map, - @Cast("const char*") BytePointer text, @Cast("size_t") long text_len, - TF_Status status); -public static native void TF_ApiDefMapPut(TF_ApiDefMap api_def_map, - String text, @Cast("size_t") long text_len, - TF_Status status); - -// Returns a serialized ApiDef protocol buffer for the TensorFlow operation -// named `name`. -public static native TF_Buffer TF_ApiDefMapGet(TF_ApiDefMap api_def_map, - @Cast("const char*") BytePointer name, - @Cast("size_t") long name_len, - TF_Status status); -public static native TF_Buffer TF_ApiDefMapGet(TF_ApiDefMap api_def_map, - String name, - @Cast("size_t") long name_len, - TF_Status status); - -// -------------------------------------------------------------------------- -// Kernel definition information. - -// Returns a serialized KernelList protocol buffer containing KernelDefs for all -// registered kernels. -public static native TF_Buffer TF_GetAllRegisteredKernels(TF_Status status); - -// Returns a serialized KernelList protocol buffer containing KernelDefs for all -// kernels registered for the operation named `name`. -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 - - - -// Creates a new in-process TensorFlow server configured using a serialized -// ServerDef protocol buffer provided via `proto` and `proto_len`. -// -// The server will not serve any requests until TF_ServerStart is invoked. -// The server will stop serving requests once TF_ServerStop or -// TF_DeleteServer is invoked. -public static native TF_Server TF_NewServer(@Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); - -// Starts an in-process TensorFlow server. -public static native void TF_ServerStart(TF_Server server, TF_Status status); - -// Stops an in-process TensorFlow server. -public static native void TF_ServerStop(TF_Server server, TF_Status status); - -// Blocks until the server has been successfully stopped (via TF_ServerStop or -// TF_ServerClose). -public static native void TF_ServerJoin(TF_Server server, TF_Status status); - -// Returns the target string that can be provided to TF_SetTarget() to connect -// a TF_Session to `server`. -// -// The returned string is valid only until TF_DeleteServer is invoked. -public static native @Cast("const char*") BytePointer TF_ServerTarget(TF_Server server); - -// Destroy an in-process TensorFlow server, frees memory. If server is running -// it will be stopped and joined. -public static native void TF_DeleteServer(TF_Server server); -// Targeting ../Listener_BytePointer.java - - -public static native void TF_RegisterLogListener( - Listener_BytePointer listener); -// Targeting ../Listener_String.java - - -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 - -// #endif // TENSORFLOW_C_C_API_H_ - - -// Parsed from tensorflow/c/kernels.h - -/* 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. -==============================================================================*/ - -// #ifndef TENSORFLOW_C_KERNELS_H_ -// #define TENSORFLOW_C_KERNELS_H_ - -// #include - -// #include "tensorflow/c/c_api.h" -// #include "tensorflow/c/experimental/stream_executor/stream_executor.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). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes. -// #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 - -// #ifdef __cplusplus -// #endif -// Targeting ../TF_KernelBuilder.java - - -// Targeting ../TF_OpKernelConstruction.java - - -// Targeting ../TF_OpKernelContext.java - - - -// TF_InitKernel to do op/kernel registration. -// Plugin should implement TF_InitKernel to register kernels. This function -// should register all kernels in a plugin. - -// Targeting ../Create_func_TF_OpKernelConstruction.java - - -// Targeting ../Compute_func_Pointer_TF_OpKernelContext.java - - -// Targeting ../Delete_func_Pointer.java - - -public static native TF_KernelBuilder TF_NewKernelBuilder( - @Cast("const char*") BytePointer op_name, @Cast("const char*") BytePointer device_name, - Create_func_TF_OpKernelConstruction create_func, - Compute_func_Pointer_TF_OpKernelContext compute_func, - Delete_func_Pointer delete_func); -public static native TF_KernelBuilder TF_NewKernelBuilder( - String op_name, String device_name, - Create_func_TF_OpKernelConstruction create_func, - Compute_func_Pointer_TF_OpKernelContext compute_func, - Delete_func_Pointer delete_func); - -// Specifies that this kernel's attribute only supports the given type. -public static native void TF_KernelBuilder_TypeConstraint( - TF_KernelBuilder kernel_builder, @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType") int type, TF_Status status); -public static native void TF_KernelBuilder_TypeConstraint( - TF_KernelBuilder kernel_builder, String attr_name, - @Cast("const TF_DataType") int type, TF_Status status); - -// Specify that this kernel requires/provides an input/output arg -// in host memory (instead of the default, device memory). -public static native void TF_KernelBuilder_HostMemory( - TF_KernelBuilder kernel_builder, @Cast("const char*") BytePointer arg_name); -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. -// -// This call takes ownership of the `builder` pointer. -public static native void TF_RegisterKernelBuilder(@Cast("const char*") BytePointer kernel_name, - TF_KernelBuilder builder, - TF_Status status); -public static native void TF_RegisterKernelBuilder(String kernel_name, - TF_KernelBuilder builder, - TF_Status status); - -// Deletes the given TF_KernelBuilder. This should be called only if the kernel -// builder is not registered with TensorFlow via TF_RegisterKernelBuilder. -public static native void TF_DeleteKernelBuilder(TF_KernelBuilder builder); - -// -------------------------------------------------------------------------- -// OpKernelContext routines - -// TF_GetStream returns the SP_Stream available in ctx. -// This function returns a stream only for devices registered using the -// StreamExecutor C API -// (tensorflow/c/experimental/stream_executor/stream_executor.h). It will return -// nullptr and set error status in all other cases. -// Experimental: this function doesn't have compatibility guarantees and subject -// to change at any time. -public static native @ByVal @Cast("SP_Stream*") Pointer TF_GetStream(TF_OpKernelContext ctx, - TF_Status status); - -// TF_NumInputs returns the number of inputs available in ctx. -public static native int TF_NumInputs(TF_OpKernelContext ctx); - -// TF_NumOutputs returns the number of outputs to be placed in *ctx by the -// kernel. -public static native int TF_NumOutputs(TF_OpKernelContext ctx); - -// Retrieves the ith input from ctx. If TF_GetCode(status) is TF_OK, *tensor is -// populated and its ownership is passed to the caller. In any other case, -// *tensor is not modified. -// -// If i < 0 or i >= TF_NumInputs(ctx), *status is set to TF_OUT_OF_RANGE. -public static native void TF_GetInput(TF_OpKernelContext ctx, int i, - @Cast("TF_Tensor**") PointerPointer tensor, TF_Status status); -public static native void TF_GetInput(TF_OpKernelContext ctx, int i, - @ByPtrPtr TF_Tensor tensor, TF_Status status); - -// Sets the ith output of ctx to tensor. If TF_GetCode(status) is anything but -// TF_OK, ctx is left unmodified. -// -// If i < 0 or i >= TF_NumOutputs(ctx), *status is set to TF_OUT_OF_RANGE. -public static native void TF_SetOutput(TF_OpKernelContext ctx, int i, - @Const TF_Tensor tensor, - TF_Status status); - -// Notifies the given OpKernelConstruction that kernel construction has failed. -public static native void TF_OpKernelConstruction_Failure( - TF_OpKernelConstruction ctx, TF_Status status); - -// Notifies the given OpKernelContext that the kernel's compute function has -// failed. -public static native void TF_OpKernelContext_Failure(TF_OpKernelContext ctx, - TF_Status status); - -// Returns the expected output data type of the ith output. If i < 0 or -// i >= TF_NumOutputs(ctx), the program aborts. -public static native @Cast("TF_DataType") int TF_ExpectedOutputDataType( - TF_OpKernelContext ctx, int i); - -// Returns the step ID of the given context. -public static native @Cast("int64_t") long TF_StepId(TF_OpKernelContext ctx); - -// Get the list_size and total_size of the attribute `attr_name` of `oper`. -// list_size - the length of the list. -// total_size - total size of the list. -// (1) If attr_type == TF_ATTR_STRING -// then total_size is the cumulative byte size -// of all the strings in the list. -// (3) If attr_type == TF_ATTR_SHAPE -// then total_size is the number of dimensions -// of the shape valued attribute, or -1 -// if its rank is unknown. -// (4) If attr_type == TF_ATTR_SHAPE -// then total_size is the cumulative number -// of dimensions of all shapes in the list. -// (5) Otherwise, total_size is undefined. -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntPointer list_size, - IntPointer total_size, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, String attr_name, IntBuffer list_size, - IntBuffer total_size, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, int[] list_size, - int[] total_size, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, String attr_name, IntPointer list_size, - IntPointer total_size, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntBuffer list_size, - IntBuffer total_size, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrSize( - TF_OpKernelConstruction ctx, String attr_name, int[] list_size, - int[] total_size, TF_Status status); - -// Interprets the named kernel construction attribute as a TF_DataType and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// TF_DataType, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") int[] val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrType( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") int[] val, - TF_Status status); - -// Interprets the named kernel construction attribute as int32_t and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// int32, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, String attr_name, IntBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, int[] val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, String attr_name, IntPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32( - TF_OpKernelConstruction ctx, String attr_name, int[] val, - TF_Status status); - -// Interprets the named kernel construction attribute as int64_t and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// int64, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") long[] val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") long[] val, - TF_Status status); - -// Interprets the named kernel construction attribute as float and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// float, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, String attr_name, FloatBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, float[] val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, String attr_name, FloatPointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloat( - TF_OpKernelConstruction ctx, String attr_name, float[] val, - TF_Status status); - -// Interprets the named kernel construction attribute as bool and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// bool, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") BytePointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") ByteBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") byte[] val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") BytePointer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") ByteBuffer val, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBool( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") byte[] val, - TF_Status status); - -// Interprets the named kernel construction attribute as string and -// places it into *val. `val` must -// point to an array of length at least `max_length` (ideally set to -// total_size from TF_OpKernelConstruction_GetAttrSize(ctx, -// attr_name, list_size, total_size)). *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// string, *status is populated with an error. -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") BytePointer val, - @Cast("size_t") long max_length, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") ByteBuffer val, - @Cast("size_t") long max_length, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") byte[] val, - @Cast("size_t") long max_length, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") BytePointer val, - @Cast("size_t") long max_length, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") ByteBuffer val, - @Cast("size_t") long max_length, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrString( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") byte[] val, - @Cast("size_t") long max_length, TF_Status status); - -// Interprets the named kernel construction attribute as a TF_DataType array and -// places it into *vals. *status is set to TF_OK. -// `vals` must point to an array of length at least `max_values` (ideally set -// to list_size from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size)). -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") int[] vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrTypeList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") int[] vals, - int max_vals, TF_Status status); - -// Interprets the named kernel construction attribute as int32_t array and -// places it into *vals. *status is set to TF_OK. -// `vals` must point to an array of length at least `max_values` (ideally set -// to list_size from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size)). -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, String attr_name, IntBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, int[] vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, String attr_name, IntPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt32List( - TF_OpKernelConstruction ctx, String attr_name, int[] vals, - int max_vals, TF_Status status); - -// Interprets the named kernel construction attribute as int64_t array and -// places it into *vals. *status is set to TF_OK. -// `vals` must point to an array of length at least `max_values` (ideally set -// to list_size from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size)). -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") long[] vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrInt64List( - TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") long[] vals, - int max_vals, TF_Status status); - -// Interprets the named kernel construction attribute as float array and -// places it into *vals. *status is set to TF_OK. -// `vals` must point to an array of length at least `max_values` (ideally set -// to list_size from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size)). -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, String attr_name, FloatBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, float[] vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, String attr_name, FloatPointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrFloatList( - TF_OpKernelConstruction ctx, String attr_name, float[] vals, - int max_vals, TF_Status status); - -// Interprets the named kernel construction attribute as bool array and -// places it into *vals. *status is set to TF_OK. -// `vals` must point to an array of length at least `max_values` (ideally set -// to list_size from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size)). -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") BytePointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") ByteBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") byte[] vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") BytePointer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") ByteBuffer vals, - int max_vals, TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrBoolList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") byte[] vals, - int max_vals, TF_Status status); - -// Interprets the named kernel construction attribute as string array and fills -// in `vals` and `lengths`, each of which must point to an array of length at -// least `max_values`. *status is set to TF_OK. The elements of values will -// point to addresses in `storage` which must be at least `storage_size` bytes -// in length. Ideally, max_values would be set to list_size and `storage` would -// be at least total_size, obtained from -// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size, -// total_size). -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") PointerPointer vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr BytePointer vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr ByteBuffer vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr byte[] vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr BytePointer vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr ByteBuffer vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); -public static native void TF_OpKernelConstruction_GetAttrStringList( - TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr byte[] vals, - @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size, - TF_Status status); - -// Return true if the kernel construction has the attr_name -public static native @Cast("bool") boolean TF_OpKernelConstruction_HasAttr( - TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, TF_Status status); -public static native @Cast("bool") boolean TF_OpKernelConstruction_HasAttr( - TF_OpKernelConstruction ctx, String attr_name, 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). -// -// This function should be used to allocate outputs inside kernel -// compute function. -public static native TF_Tensor TF_AllocateOutput(TF_OpKernelContext context, - int index, @Cast("TF_DataType") int dtype, - @Cast("int64_t*") LongPointer dims, int num_dims, - @Cast("size_t") long len, TF_Status status); -public static native TF_Tensor TF_AllocateOutput(TF_OpKernelContext context, - int index, @Cast("TF_DataType") int dtype, - @Cast("int64_t*") LongBuffer dims, int num_dims, - @Cast("size_t") long len, TF_Status status); -public static native TF_Tensor TF_AllocateOutput(TF_OpKernelContext context, - int index, @Cast("TF_DataType") int dtype, - @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 - -// #endif // TENSORFLOW_C_KERNELS_H_ - - -// Parsed from tensorflow/c/ops.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. -==============================================================================*/ - -// Routines for registering new ops and for implementing op shape inference -// functions. -// -// This API is alpha software and is subject to change. -// -// REGISTRATION -// ------------ -// -// In order to register a new op, create a new TF_OpDefinitionBuilder: -// -// TF_OpDefinitionBuilder* builder = TF_NewOpDefinitionBuilder("OpName"); -// -// Inputs, outputs and attributes can be added to the builder with the -// corresponding functions, e.g. -// -// TF_OpDefinitionBuilderAddInput(builder, "input1: int32"); -// TF_OpDefinitionBuilderAddOutput(builder, "output1: int64"); -// TF_OpDefinitionBuilderAddAttr(builder, "attr: int32"); -// -// The builder may then be registered with TensorFlow using the -// TF_RegisterOpDefinition function. E.g. -// -// TF_Status* status = TF_NewStatus(); -// TF_RegisterOpDefinition(builder, &status); -// if (TF_GetCode(status) != TF_OK) { -// // handle error -// } -// -// SHAPE INFERENCE -// --------------- -// -// You can provide a shape inference function that TensorFlow will call when it -// wants to understand the shape of outputs that the op will produce. Use the -// TF_OpDefinitionBuilderSetShapeInferenceFunction function to register a shape -// inference function pointer with TensorFlow. The following is an example of a -// very simple shape inference function: -// -// void identity_shape_fn(TF_ShapeInferenceContext* ctx, TF_Status* status) { -// TF_ShapeHandle* input = TF_NewShapeHandle(); -// TF_ShapeInferenceContextGetInput(ctx, 0, input, status); -// if (TF_GetCode(status) == TF_OK) { -// TF_ShapeInferenceContextSetOutput(ctx, 0, input, status); -// } -// TF_DeleteShapeHandle(input); -// } -// -// The following code registers the inference function with TensorFlow: -// -// TF_OpDefinitionBuilderSetShapeInferenceFunction(builder, &identity_shape_fn); -// -// For more details about shape inference, see the documentation for -// TF_OpDefinitionBuilderSetShapeInferenceFunction. - -// #ifndef TENSORFLOW_C_OPS_H_ -// #define TENSORFLOW_C_OPS_H_ - -// #include -// #include -// #include - -// #include "tensorflow/c/tf_datatype.h" -// #include "tensorflow/c/tf_status.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 - -// #ifdef __cplusplus -// Targeting ../TF_DimensionHandle.java - - -// Targeting ../TF_OpDefinitionBuilder.java - - -// Targeting ../TF_ShapeHandle.java - - -// Targeting ../TF_ShapeInferenceContext.java - - - -// Returns a newly allocated op definition builder for the given op name. The -// returned builder may be customized with the `TF_OpDefinitionBuilder...` -// functions and then registered with TensorFlow with TF_RegisterOpDefinition. -// -// The returned pointer is either freed by a call to TF_RegisterOpDefinition, or -// can be manually deleted by TF_DeleteOpDefinitionBuilder if it is never -// registered. -public static native TF_OpDefinitionBuilder TF_NewOpDefinitionBuilder( - @Cast("const char*") BytePointer op_name); -public static native TF_OpDefinitionBuilder TF_NewOpDefinitionBuilder( - String op_name); - -// Registers the given op builder with TensorFlow. Indicates success or -// otherwise in the given status. -// -// `builder` is freed whether the op was successfully registered or not. You -// must call either this function or TF_DeleteOpDefinitionBuilder to free the -// builder, but never both. -public static native void TF_RegisterOpDefinition( - TF_OpDefinitionBuilder builder, TF_Status status); - -// Frees the given op definition builder. You must call either this function or -// TF_RegisterOpDefinition to free the builder, but never both. -public static native void TF_DeleteOpDefinitionBuilder( - TF_OpDefinitionBuilder builder); - -//---------------------------------------------------- -// Attribute functions. - -// Adds an attr to the given TF_OpDefinitionBuilder. The spec has -// format ":" or ":=" -// where matches regexp [a-zA-Z][a-zA-Z0-9_]*. -// By convention, names containing only capital letters are reserved for -// attributes whose values can be inferred by the operator implementation if not -// supplied by the user. If the attribute name contains characters other than -// capital letters, the operator expects the user to provide the attribute value -// at operation runtime. -// -// can be: -// "string", "int", "float", "bool", "type", "shape", or "tensor" -// "numbertype", "realnumbertype", "quantizedtype" -// (meaning "type" with a restriction on valid values) -// "{int32,int64}" or {realnumbertype,quantizedtype,string}" -// (meaning "type" with a restriction containing unions of value types) -// "{\"foo\", \"bar\n baz\"}", or "{'foo', 'bar\n baz'}" -// (meaning "string" with a restriction on valid values) -// "list(string)", ..., "list(tensor)", "list(numbertype)", ... -// (meaning lists of the above types) -// "int >= 2" (meaning "int" with a restriction on valid values) -// "list(string) >= 2", "list(int) >= 2" -// (meaning "list(string)" / "list(int)" with length at least 2) -// , if included, should use the Proto text format -// of . For lists use [a, b, c] format. -// -// Note that any attr specifying the length of an input or output will -// get a default minimum of 1 unless the >= # syntax is used. -public static native void TF_OpDefinitionBuilderAddAttr( - TF_OpDefinitionBuilder builder, @Cast("const char*") BytePointer attr_spec); -public static native void TF_OpDefinitionBuilderAddAttr( - TF_OpDefinitionBuilder builder, String attr_spec); - -// Adds an input to this TF_OpDefinitionBuilder. -// The spec has form ":" or ":Ref()" -// where matches regexp [a-z][a-z0-9_]* and can be: -// * For a single tensor: -// * For a sequence of tensors with the same type: * -// * For a sequence of tensors with different types: -// Where: -// is either one of "float", "int32", "string", ... -// or the name of an attr (see TF_OpDefinitionBuilderAddAttr) -// with type "type". -// is the name of an attr with type "int". -// is the name of an attr with type "list(type)". -public static native void TF_OpDefinitionBuilderAddInput( - TF_OpDefinitionBuilder builder, @Cast("const char*") BytePointer input_spec); -public static native void TF_OpDefinitionBuilderAddInput( - TF_OpDefinitionBuilder builder, String input_spec); - -// Adds an output to this TF_OpDefinitionBuilder. -// The spec has form ":" or ":Ref()" -// where matches regexp [a-z][a-z0-9_]* and can be: -// * For a single tensor: -// * For a sequence of tensors with the same type: * -// * For a sequence of tensors with different types: -// Where: -// is either one of "float", "int32", "string", ... -// or the name of an attr (see TF_OpDefinitionBuilderAddAttr) -// with type "type". -// is the name of an attr with type "int". -// is the name of an attr with type "list(type)". -public static native void TF_OpDefinitionBuilderAddOutput( - TF_OpDefinitionBuilder builder, @Cast("const char*") BytePointer output_spec); -public static native void TF_OpDefinitionBuilderAddOutput( - TF_OpDefinitionBuilder builder, String output_spec); - -// Sets the commutative property for the op built by the given builder. -public static native void TF_OpDefinitionBuilderSetIsCommutative( - TF_OpDefinitionBuilder builder, @Cast("bool") boolean is_commutative); - -// Sets the is_aggregate property of the builder to the given value. -// -// If is_aggregate is true, then the operation produced by this builder accepts -// N >= 2 inputs and produces 1 output all of the same type. Should be -// associative and commutative, and produce output with the same shape as the -// input. The optimizer may replace an aggregate op taking input from multiple -// devices with a tree of aggregate ops that aggregate locally within each -// device (and possibly within groups of nearby devices) before communicating. -public static native void TF_OpDefinitionBuilderSetIsAggregate( - TF_OpDefinitionBuilder builder, @Cast("bool") boolean is_aggregate); - -// Sets the is_stateful property of the builder to the given value. -// -// The op built by this builder is stateful if its behavior depends on some -// state beyond its input tensors (e.g. variable reading op) or if it has a -// side-effect (e.g. printing or asserting ops). Equivalently, stateless ops -// must always produce the same output for the same input and have no -// side-effects. -// -// By default Ops may be moved between devices. Stateful ops should either not -// be moved, or should only be moved if that state can also be moved (e.g. via -// some sort of save / restore). Stateful ops are guaranteed to never be -// optimized away by Common Subexpression Elimination (CSE). -public static native void TF_OpDefinitionBuilderSetIsStateful( - TF_OpDefinitionBuilder builder, @Cast("bool") boolean is_stateful); - -// Sets the allows_uninitialized_input property of the operation built by this -// builder. -// -// By default, all inputs to an Op must be initialized Tensors. Ops that may -// initialize tensors for the first time should set this field to true, to allow -// the Op to take an uninitialized Tensor as input. -public static native void TF_OpDefinitionBuilderSetAllowsUninitializedInput( - TF_OpDefinitionBuilder builder, @Cast("bool") boolean allows_uninitialized_input); - -// Adds a deprecation warning for the given op. This indicates to the user that -// `version` is the first TensorFlow GraphDef version for which the operation is -// deprecated. `explanation` should contain the reason for the deprecation and -// what to use instead. -// -// This function is only an indicator that the operation may disappear in a -// version of TensorFlow after `version`. It does not affect op registration. -public static native void TF_OpDefinitionBuilderDeprecated( - TF_OpDefinitionBuilder builder, int version, @Cast("const char*") BytePointer explanation); -public static native void TF_OpDefinitionBuilderDeprecated( - TF_OpDefinitionBuilder builder, int version, String explanation); -// Targeting ../Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java - - -public static native void TF_OpDefinitionBuilderSetShapeInferenceFunction( - TF_OpDefinitionBuilder builder, - Shape_inference_func_TF_ShapeInferenceContext_TF_Status shape_inference_func); - -//---------------------------------------------------- -// Functions for TF_ShapeInferenceContext. -// -// Functions for implementing shape inference functions. TensorFlow uses these -// functions to determine the shape of tensors produced by an operation without -// having to actually run the operation. If an operation chooses to provide a -// shape inference function, it will be invoked by TensorFlow as needed. -// -// When invoked by TensorFlow, the shape inference function is provided with a -// TF_ShapeInferenceContext pointer. The function's implementation will use the -// accessor and mutator functions with names beginning with -// TF_ShapeInferenceContext to examine the input state and determine the output -// shape. - -// Returns the number of inputs in the given shape inference context. -public static native @Cast("int64_t") long TF_ShapeInferenceContextNumInputs( - TF_ShapeInferenceContext ctx); - -// Returns a newly allocated shape handle. The shapes represented by these -// handles may be queried or mutated with the corresponding -// TF_ShapeInferenceContext... functions. -public static native TF_ShapeHandle TF_NewShapeHandle(); - -// Places the ith input of the given shape inference context into the given -// shape handle, or returns a status other than TF_OK indicating why the input -// could not be retrieved -// (for example, if i < 0 || i >= TF_ShapeInferenceContextNumInputs(ctx)). -public static native void TF_ShapeInferenceContextGetInput( - TF_ShapeInferenceContext ctx, int i, TF_ShapeHandle handle, - TF_Status status); - -// Places the given shape handle into the `i`th output position of the given -// context. Internally, the shape handle is copied; the caller may subsequently -// delete `handle`. -public static native void TF_ShapeInferenceContextSetOutput(TF_ShapeInferenceContext ctx, - 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( - TF_ShapeInferenceContext ctx, @Cast("size_t") long size); - -// Returns a newly allocated dimension handle. It must be freed with -// TF_DeleteDimensionHandle. -public static native TF_DimensionHandle TF_NewDimensionHandle(); - -// Interprets the named shape inference context attribute as a TF_DataType and -// places it into *val. *status is set to TF_OK. -// -// If the attribute could not be found or could not be interpreted as -// TF_DataType, *status is populated with an error. -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntPointer val, - TF_Status status); -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, String attr_name, @Cast("TF_DataType*") IntBuffer val, - TF_Status status); -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") int[] val, - TF_Status status); -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, String attr_name, @Cast("TF_DataType*") IntPointer val, - TF_Status status); -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntBuffer val, - TF_Status status); -public static native void TF_ShapeInferenceContext_GetAttrType( - TF_ShapeInferenceContext ctx, String attr_name, @Cast("TF_DataType*") int[] val, - TF_Status status); - -// Returns the rank of the shape represented by the given handle. -public static native @Cast("int64_t") long TF_ShapeInferenceContextRank( - TF_ShapeInferenceContext ctx, TF_ShapeHandle handle); - -// Returns 1 if `handle` has a known rank, 0 otherwise. -public static native int TF_ShapeInferenceContextRankKnown( - TF_ShapeInferenceContext ctx, TF_ShapeHandle handle); - -// If has rank , or its rank is unknown, return OK and return the -// shape with asserted rank in <*result>. Otherwise an error is placed into -// `status`. -public static native void TF_ShapeInferenceContextWithRank( - TF_ShapeInferenceContext ctx, TF_ShapeHandle handle, @Cast("int64_t") long rank, - TF_ShapeHandle result, TF_Status status); - -// If has rank at least , or its rank is unknown, return OK and -// return the shape with asserted rank in <*result>. Otherwise an error is -// placed into `status`. -public static native void TF_ShapeInferenceContextWithRankAtLeast( - TF_ShapeInferenceContext ctx, TF_ShapeHandle handle, @Cast("int64_t") long rank, - TF_ShapeHandle result, TF_Status status); - -// If has rank at most , or its rank is unknown, return OK and -// return the shape with asserted rank in <*result>. Otherwise an error is -// placed into `status`. -public static native void TF_ShapeInferenceContextWithRankAtMost( - TF_ShapeInferenceContext ctx, TF_ShapeHandle handle, @Cast("int64_t") long rank, - TF_ShapeHandle result, TF_Status status); - -// Places a handle to the ith dimension of the given shape into *result. -public static native void TF_ShapeInferenceContextDim( - TF_ShapeInferenceContext ctx, TF_ShapeHandle shape_handle, @Cast("int64_t") long i, - TF_DimensionHandle result); - -// Returns in <*result> a sub-shape of , with dimensions -// [start:end]. and can be negative, to index from the end of the -// shape. and are set to the rank of if > rank of -// . -public static native void TF_ShapeInferenceContextSubshape( - TF_ShapeInferenceContext ctx, TF_ShapeHandle shape_handle, @Cast("int64_t") long start, - @Cast("int64_t") long end, TF_ShapeHandle result, TF_Status status); - -// Places an unknown shape in all outputs for the given inference context. Used -// for shape inference functions with ops whose output shapes are unknown. -public static native void TF_ShapeInferenceContextSetUnknownShape( - TF_ShapeInferenceContext ctx, TF_Status status); - -// Returns whether the given handle represents a known dimension. -public static native int TF_DimensionHandleValueKnown( - TF_DimensionHandle dim_handle); - -// Returns the value of the given dimension. -public static native @Cast("int64_t") long TF_DimensionHandleValue( - TF_DimensionHandle dim_handle); - -// Returns in <*result> the result of appending the dimensions of to -// those of . -public static native void TF_ShapeInferenceContextConcatenateShapes( - TF_ShapeInferenceContext ctx, TF_ShapeHandle first, - TF_ShapeHandle second, TF_ShapeHandle result, TF_Status status); - -// Frees the given shape handle. -public static native void TF_DeleteShapeHandle(TF_ShapeHandle handle); - -// Frees the given dimension handle. -public static native void TF_DeleteDimensionHandle(TF_DimensionHandle handle); - -// #ifdef __cplusplus /* end extern "C" */ -// #endif - -// #endif // TENSORFLOW_C_OPS_H_ - - -// Parsed from tensorflow/c/eager/c_api.h - -/* Copyright 2017 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_EAGER_C_API_H_ -// #define TENSORFLOW_C_EAGER_C_API_H_ - -// C API extensions to experiment with eager execution of kernels. -// WARNING: Unlike tensorflow/c/c_api.h, the API here is not guaranteed to be -// stable and can change without notice. - -// #include "tensorflow/c/c_api.h" - -// Macro to control visibility of exported symbols in the shared library (.so, -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent -// of any other includes.$a -// #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 - -// #ifdef __cplusplus -// Targeting ../TFE_ContextOptions.java - - - -// Return a new options object. -public static native TFE_ContextOptions TFE_NewContextOptions(); - -// Set the config in TF_ContextOptions.options. -// config should be a serialized tensorflow.ConfigProto proto. -// If config was not parsed successfully as a ConfigProto, record the -// error information in *status. -public static native void TFE_ContextOptionsSetConfig( - TFE_ContextOptions options, @Const Pointer proto, @Cast("size_t") long proto_len, - TF_Status status); - -// Controls how to act when we try to run an operation on a given device but -// some input tensors are not on that device. -// LINT.IfChange -// Note: Keep in sync with internal copy of enum in eager/context.h. -/** enum TFE_ContextDevicePlacementPolicy */ -public static final int - // Running operations with input tensors on the wrong device will fail. - TFE_DEVICE_PLACEMENT_EXPLICIT = 0, - // Copy the tensor to the right device but log a warning. - TFE_DEVICE_PLACEMENT_WARN = 1, - // Silently copy the tensor, which has a performance cost since the operation - // will be blocked till the copy completes. This is the default placement - // policy. - 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/c/eager/immediate_execution_context.h) - -// Sets the default execution mode (sync/async). Note that this can be -// overridden per thread using TFE_ContextSetExecutorForThread. -public static native void TFE_ContextOptionsSetAsync(TFE_ContextOptions arg0, - @Cast("unsigned char") byte enable); - -public static native void TFE_ContextOptionsSetDevicePlacementPolicy( - TFE_ContextOptions arg0, @Cast("TFE_ContextDevicePlacementPolicy") int arg1); - -// Destroy an options object. -public static native void TFE_DeleteContextOptions(TFE_ContextOptions arg0); -// Targeting ../TFE_Context.java - - - -public static native TFE_Context TFE_NewContext( - @Const TFE_ContextOptions opts, TF_Status status); -public static native void TFE_DeleteContext(TFE_Context ctx); -public static native TF_DeviceList TFE_ContextListDevices(TFE_Context ctx, - TF_Status status); - -// Clears the internal caches in the TFE context. Useful when reseeding random -// ops. -public static native void TFE_ContextClearCaches(TFE_Context ctx); - -// Sets a thread-local device placement policy. After this call, other calls to -// TFE_Execute in the same thread will use the device policy specified here -// instead of the device policy used to construct the context. This has no -// effect on the device policy used by other program threads. -public static native void TFE_ContextSetThreadLocalDevicePlacementPolicy( - TFE_Context ctx, @Cast("TFE_ContextDevicePlacementPolicy") int policy); - -// Returns the device placement policy to be used by this context in the current -// thread. -public static native @Cast("TFE_ContextDevicePlacementPolicy") int TFE_ContextGetDevicePlacementPolicy(TFE_Context ctx); - -// A tensorflow.ServerDef specifies remote workers (in addition to the current -// workers name). Operations created on this context can then be executed on -// any of these remote workers by setting an appropriate device. -// -// If the following is set, all servers identified by the -// ServerDef must be up when the context is created. -public static native void TFE_ContextSetServerDef(TFE_Context ctx, - int keep_alive_secs, - @Const Pointer proto, - @Cast("size_t") long proto_len, - TF_Status status); -// Targeting ../TFE_TensorHandle.java - - - -public static native TFE_TensorHandle TFE_NewTensorHandle(@Const TF_Tensor t, - TF_Status status); -// Indicates that the caller will not be using `h` any more. -public static native void TFE_DeleteTensorHandle(TFE_TensorHandle h); -public static native @Cast("TF_DataType") int TFE_TensorHandleDataType(TFE_TensorHandle h); -// This function will block till the operation that produces `h` has completed. -public static native int TFE_TensorHandleNumDims(TFE_TensorHandle h, - TF_Status status); -public static native @Cast("int64_t") long TFE_TensorHandleNumElements(TFE_TensorHandle h, - TF_Status status); -// This function will block till the operation that produces `h` has completed. -public static native @Cast("int64_t") long TFE_TensorHandleDim(TFE_TensorHandle h, - int dim_index, - TF_Status status); - -// Returns the device of the operation that produced `h`. If `h` was produced by -// a copy, returns the destination device of the copy. Note that the returned -// device name is not always the device holding the tensor handle's memory. If -// you want the latter, use TFE_TensorHandleBackingDeviceName. This function -// will block till the operation that produces `h` has completed. -public static native @Cast("const char*") BytePointer TFE_TensorHandleDeviceName( - TFE_TensorHandle h, TF_Status status); - -// Returns the name of the device in whose memory `h` resides. -// -// This function will block till the operation that produces `h` has completed. -public static native @Cast("const char*") BytePointer TFE_TensorHandleBackingDeviceName( - TFE_TensorHandle h, TF_Status status); - -// Return a pointer to a new TFE_TensorHandle that shares the underlying tensor -// with `h`. On success, `status` is set to OK. On failure, `status` reflects -// the error and a nullptr is returned. -public static native TFE_TensorHandle TFE_TensorHandleCopySharingTensor( - TFE_TensorHandle h, TF_Status status); - -// This function will block till the operation that produces `h` has -// completed. The memory returned might alias the internal memory used by -// TensorFlow. Hence, callers should not mutate this memory (for example by -// modifying the memory region pointed to by TF_TensorData() on the returned -// TF_Tensor). -public static native TF_Tensor TFE_TensorHandleResolve(TFE_TensorHandle h, - TF_Status status); - -// Create a new TFE_TensorHandle with the same contents as 'h' but placed -// in the memory of the device name 'device_name'. -// If source and destination are the same device, then this creates a new handle -// that shares the underlying buffer. Otherwise, it currently requires at least -// one of the source or destination devices to be CPU (i.e., for the source or -// destination tensor to be placed in host memory). -// If async execution is enabled, the copy may be enqueued and the call will -// return "non-ready" handle. Else, this function returns after the copy has -// been done. -public static native TFE_TensorHandle TFE_TensorHandleCopyToDevice( - TFE_TensorHandle h, TFE_Context ctx, @Cast("const char*") BytePointer device_name, - TF_Status status); -public static native TFE_TensorHandle TFE_TensorHandleCopyToDevice( - TFE_TensorHandle h, TFE_Context ctx, String device_name, - TF_Status status); -// Targeting ../TFE_TensorDebugInfo.java - - - -// Retrieves TFE_TensorDebugInfo for `handle`. -// If TFE_TensorHandleTensorDebugInfo succeeds, `status` is set to OK and caller -// is responsible for deleting returned TFE_TensorDebugInfo. -// If TFE_TensorHandleTensorDebugInfo fails, `status` is set to appropriate -// error and nullptr is returned. This function can block till the operation -// that produces `handle` has completed. -public static native TFE_TensorDebugInfo TFE_TensorHandleTensorDebugInfo( - TFE_TensorHandle h, TF_Status status); - -// Deletes `debug_info`. -public static native void TFE_DeleteTensorDebugInfo( - TFE_TensorDebugInfo debug_info); - -// Returns the number of dimensions used to represent the tensor on its device. -// The number of dimensions used to represent the tensor on device can be -// different from the number returned by TFE_TensorHandleNumDims. -// The return value was current at the time of TFE_TensorDebugInfo creation. -public static native int TFE_TensorDebugInfoOnDeviceNumDims( - TFE_TensorDebugInfo debug_info); - -// Returns the number of elements in dimension `dim_index`. -// Tensor representation on device can be transposed from its representation -// on host. The data contained in dimension `dim_index` on device -// can correspond to the data contained in another dimension in on-host -// representation. The dimensions are indexed using the standard TensorFlow -// major-to-minor order (slowest varying dimension first), -// not the XLA's minor-to-major order. -// On-device dimensions can be padded. TFE_TensorDebugInfoOnDeviceDim returns -// the number of elements in a dimension after padding. -// The return value was current at the time of TFE_TensorDebugInfo creation. -public static native @Cast("int64_t") long TFE_TensorDebugInfoOnDeviceDim( - TFE_TensorDebugInfo debug_info, int dim_index); -// Targeting ../TFE_Op.java - - - -public static native TFE_Op TFE_NewOp(TFE_Context ctx, - @Cast("const char*") BytePointer op_or_function_name, - TF_Status status); -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(@Const TFE_Op op, - TF_Status status); - -public static native void TFE_OpAddInput(TFE_Op op, TFE_TensorHandle input, - TF_Status status); - -public static native void TFE_OpAddInputList(TFE_Op op, - @Cast("TFE_TensorHandle**") PointerPointer inputs, - int num_inputs, - TF_Status status); -public static native void TFE_OpAddInputList(TFE_Op op, - @ByPtrPtr TFE_TensorHandle inputs, - 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, - TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, - String attr_name, - @Cast("unsigned char*") ByteBuffer is_list, - TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") byte[] is_list, - TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, - String attr_name, - @Cast("unsigned char*") BytePointer is_list, - TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") ByteBuffer is_list, - TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, - String attr_name, - @Cast("unsigned char*") byte[] is_list, - TF_Status status); -// Get an attribute type given an op name; a fusion of TFE_NewOp and -// TFE_OpGetAttrType for use from Python without the overhead of the individual -// calls and memory management of TFE_Op. -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") BytePointer is_list, TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, String op_or_function_name, String attr_name, - @Cast("unsigned char*") ByteBuffer is_list, TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") byte[] is_list, TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, String op_or_function_name, String attr_name, - @Cast("unsigned char*") BytePointer is_list, TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char*") ByteBuffer is_list, TF_Status status); -public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( - TFE_Context ctx, String op_or_function_name, String attr_name, - @Cast("unsigned char*") byte[] is_list, TF_Status status); - -public static native void TFE_OpSetAttrString(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const Pointer value, - @Cast("size_t") long length); -public static native void TFE_OpSetAttrString(TFE_Op op, - String attr_name, - @Const Pointer value, - @Cast("size_t") long length); -public static native void TFE_OpSetAttrInt(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("int64_t") long value); -public static native void TFE_OpSetAttrInt(TFE_Op op, String attr_name, - @Cast("int64_t") long value); -public static native void TFE_OpSetAttrFloat(TFE_Op op, @Cast("const char*") BytePointer attr_name, - float value); -public static native void TFE_OpSetAttrFloat(TFE_Op op, String attr_name, - float value); -public static native void TFE_OpSetAttrBool(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("unsigned char") byte value); -public static native void TFE_OpSetAttrBool(TFE_Op op, String attr_name, - @Cast("unsigned char") byte value); -public static native void TFE_OpSetAttrType(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("TF_DataType") int value); -public static native void TFE_OpSetAttrType(TFE_Op op, String attr_name, - @Cast("TF_DataType") int value); -// If the number of dimensions is unknown, `num_dims` must be set to -// -1 and `dims` can be null. If a dimension is unknown, the -// corresponding entry in the `dims` array must be -1. -public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongPointer dims, - int num_dims, - TF_Status out_status); -public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, - @Cast("const int64_t*") LongBuffer dims, - int num_dims, - TF_Status out_status); -public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") long[] dims, - int num_dims, - TF_Status out_status); -public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, - @Cast("const int64_t*") LongPointer dims, - int num_dims, - TF_Status out_status); -public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongBuffer dims, - int num_dims, - TF_Status out_status); -public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, - @Cast("const int64_t*") long[] dims, - int num_dims, - TF_Status out_status); - -// Sets the attribute attr_name to be a function specified by 'function'. -// -// TODO(ashankar,iga): Add this functionality to the C API for graph -// construction. Perhaps we want an AttrValueMap equivalent in the C API? -public static native void TFE_OpSetAttrFunction(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const TFE_Op value); -public static native void TFE_OpSetAttrFunction(TFE_Op op, - String attr_name, - @Const TFE_Op value); - -public static native void TFE_OpSetAttrFunctionName(TFE_Op op, @Cast("const char*") BytePointer attr_name, - @Cast("const char*") BytePointer data, @Cast("size_t") long length); -public static native void TFE_OpSetAttrFunctionName(TFE_Op op, String attr_name, - String data, @Cast("size_t") long length); - -public static native void TFE_OpSetAttrTensor(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - TF_Tensor tensor, - TF_Status status); -public static native void TFE_OpSetAttrTensor(TFE_Op op, - String attr_name, - TF_Tensor tensor, - TF_Status status); - -public static native void TFE_OpSetAttrStringList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") PointerPointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TFE_OpSetAttrStringList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TFE_OpSetAttrStringList(TFE_Op op, - String attr_name, - @Cast("const void*const*") @ByPtrPtr Pointer values, - @Cast("const size_t*") SizeTPointer lengths, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongPointer values, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - String attr_name, - @Cast("const int64_t*") LongBuffer values, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") long[] values, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - String attr_name, - @Cast("const int64_t*") LongPointer values, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const int64_t*") LongBuffer values, - int num_values); -public static native void TFE_OpSetAttrIntList(TFE_Op op, - String attr_name, - @Cast("const int64_t*") long[] values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const FloatPointer values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - String attr_name, - @Const FloatBuffer values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const float[] values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - String attr_name, - @Const FloatPointer values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const FloatBuffer values, - int num_values); -public static native void TFE_OpSetAttrFloatList(TFE_Op op, - String attr_name, - @Const float[] values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") BytePointer values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - String attr_name, - @Cast("const unsigned char*") ByteBuffer values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") byte[] values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - String attr_name, - @Cast("const unsigned char*") BytePointer values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const unsigned char*") ByteBuffer values, - int num_values); -public static native void TFE_OpSetAttrBoolList(TFE_Op op, - String attr_name, - @Cast("const unsigned char*") byte[] values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") IntPointer values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - String attr_name, - @Cast("const TF_DataType*") IntBuffer values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") int[] values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - String attr_name, - @Cast("const TF_DataType*") IntPointer values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const TF_DataType*") IntBuffer values, - int num_values); -public static native void TFE_OpSetAttrTypeList(TFE_Op op, - String attr_name, - @Cast("const TF_DataType*") int[] values, - int num_values); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") PointerPointer dims, - @Const IntPointer num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr LongPointer dims, - @Const IntPointer num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr LongBuffer dims, - @Const IntBuffer num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr long[] dims, - @Const int[] num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr LongPointer dims, - @Const IntPointer num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr LongBuffer dims, - @Const IntBuffer num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrShapeList( - TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr long[] dims, - @Const int[] num_dims, int num_values, TF_Status out_status); -public static native void TFE_OpSetAttrFunctionList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Cast("const TFE_Op**") PointerPointer value, - int num_values); -public static native void TFE_OpSetAttrFunctionList(TFE_Op op, - @Cast("const char*") BytePointer attr_name, - @Const @ByPtrPtr TFE_Op value, - int num_values); -public static native void TFE_OpSetAttrFunctionList(TFE_Op op, - String attr_name, - @Const @ByPtrPtr TFE_Op value, - int num_values); - -// Returns the length (number of tensors) of the input argument `input_name` -// found in the provided `op`. -public static native int TFE_OpGetInputLength(TFE_Op op, - @Cast("const char*") BytePointer input_name, - TF_Status status); -public static native int TFE_OpGetInputLength(TFE_Op op, - String input_name, - TF_Status status); - -// Returns the length (number of tensors) of the output argument `output_name` -// found in the provided `op`. -public static native int TFE_OpGetOutputLength(TFE_Op op, - @Cast("const char*") BytePointer output_name, - TF_Status status); -public static native int TFE_OpGetOutputLength(TFE_Op op, - String output_name, - TF_Status status); - -// Execute the operation defined by 'op' and return handles to computed -// tensors in `retvals`. -// -// 'retvals' must point to a pre-allocated array of TFE_TensorHandle* and -// '*num_retvals' should be set to the size of this array. It is an error if -// the size of 'retvals' is less than the number of outputs. This call sets -// *num_retvals to the number of outputs. -// -// If async execution is enabled, the call may simply enqueue the execution -// and return "non-ready" handles in `retvals`. Note that any handles contained -// in 'op' should not be mutated till the kernel execution actually finishes. -// -// For sync execution, if any of the inputs to `op` are not ready, this call -// will block till they become ready and then return when the kernel execution -// is done. -// TODO(agarwal): change num_retvals to int from int*. -public static native void TFE_Execute(TFE_Op op, @Cast("TFE_TensorHandle**") PointerPointer retvals, - IntPointer num_retvals, TF_Status status); -public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, - IntPointer num_retvals, TF_Status status); -public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, - IntBuffer num_retvals, TF_Status status); -public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, - int[] num_retvals, TF_Status status); - -// Add a function (serialized FunctionDef protocol buffer) to ctx so -// that it can be invoked using TFE_Execute. -public static native void TFE_ContextAddFunctionDef( - TFE_Context ctx, @Cast("const char*") BytePointer serialized_function_def, @Cast("size_t") long size, - TF_Status status); -public static native void TFE_ContextAddFunctionDef( - TFE_Context ctx, String serialized_function_def, @Cast("size_t") long size, - TF_Status status); - -// Adds a function (created from TF_GraphToFunction or -// TF_FunctionImportFunctionDef) to the context, allowing it to be executed with -// TFE_Execute by creating an op with the same name as the function. -public static native void TFE_ContextAddFunction(TFE_Context ctx, - TF_Function function, - TF_Status status); - -// Removes a function from the context. Once removed, you can no longer -// TFE_Execute it or TFE_Execute any TFE_Op which has it as an attribute or any -// other function which calls it as an attribute. -public static native void TFE_ContextRemoveFunction(TFE_Context ctx, - @Cast("const char*") BytePointer name, - TF_Status status); -public static native void TFE_ContextRemoveFunction(TFE_Context ctx, - String name, - TF_Status status); - -// Checks whether a function is registered under `name`. -public static native @Cast("unsigned char") byte TFE_ContextHasFunction(TFE_Context ctx, - @Cast("const char*") BytePointer name); -public static native @Cast("unsigned char") byte TFE_ContextHasFunction(TFE_Context ctx, - String name); - -// Enables tracing of RunMetadata on the ops executed from this context. -public static native void TFE_ContextEnableRunMetadata(TFE_Context ctx); - -// Disables tracing of RunMetadata on the ops executed from this context. -public static native void TFE_ContextDisableRunMetadata(TFE_Context ctx); - -// Populates the passed-in buffer with a serialized RunMetadata protocol buffer -// containing any run metadata information accumulated so far and clears this -// information. -// If async mode is enabled, this call blocks till all currently pending ops are -// done. -public static native void TFE_ContextExportRunMetadata(TFE_Context ctx, - TF_Buffer buf, - TF_Status status); - -// Some TF ops need a step container to be set to limit the lifetime of some -// resources (mostly TensorArray and Stack, used in while loop gradients in -// graph mode). Calling this on a context tells it to start a step. -public static native void TFE_ContextStartStep(TFE_Context ctx); - -// Ends a step. When there is no active step (that is, every started step has -// been ended) step containers will be cleared. Note: it is not safe to call -// TFE_ContextEndStep while ops which rely on the step container may be running. -public static native void TFE_ContextEndStep(TFE_Context ctx); - -// #ifdef __cplusplus -// Targeting ../Tensor.java - - - // namespace tensorflow - - -// #endif - -// #endif // TENSORFLOW_C_EAGER_C_API_H_ - - -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java index e8fa2db9789..35eb9cb2bb1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.audio; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; @@ -51,6 +56,10 @@ * tensorflow/examples/wav_to_spectrogram to read in an audio file and save out the * resulting spectrogram as a PNG image. */ +@OpMetadata( + opType = AudioSpectrogram.OP_NAME, + inputsClass = AudioSpectrogram.Inputs.class +) @Operator( group = "audio" ) @@ -62,8 +71,8 @@ public final class AudioSpectrogram extends RawOp implements Operand { private Output spectrogram; - private AudioSpectrogram(Operation operation) { - super(operation); + public AudioSpectrogram(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; spectrogram = operation.output(outputIdx++); } @@ -144,4 +153,40 @@ public Options magnitudeSquared(Boolean magnitudeSquared) { return this; } } + + @OpInputsMetadata( + outputsClass = AudioSpectrogram.class + ) + public static class Inputs extends RawOpInputs { + /** + * Float representation of audio data. + */ + public final Operand input; + + /** + * How wide the input window is in samples. For the highest efficiency + * this should be a power of two, but other values are accepted. + */ + public final long windowSize; + + /** + * How widely apart the center of adjacent sample windows should be. + */ + public final long stride; + + /** + * Whether to return the squared magnitude or just the + * magnitude. Using squared magnitude can avoid extra calculations. + */ + public final boolean magnitudeSquared; + + public Inputs(GraphOperation op) { + super(new AudioSpectrogram(op), op, Arrays.asList("window_size", "stride", "magnitude_squared")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + windowSize = op.attributes().getAttrInt("window_size"); + stride = op.attributes().getAttrInt("stride"); + magnitudeSquared = op.attributes().getAttrBool("magnitude_squared"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java index ed0fbc78f59..793ef8aed8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.audio; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -43,6 +48,10 @@ * number of samples. For example, a ten-sample-long stereo WAV file should give an * output shape of [10, 2]. */ +@OpMetadata( + opType = DecodeWav.OP_NAME, + inputsClass = DecodeWav.Inputs.class +) @Operator( group = "audio" ) @@ -56,8 +65,8 @@ public final class DecodeWav extends RawOp { private Output sampleRate; - private DecodeWav(Operation operation) { - super(operation); + public DecodeWav(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; audio = operation.output(outputIdx++); sampleRate = operation.output(outputIdx++); @@ -161,4 +170,32 @@ public Options desiredSamples(Long desiredSamples) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeWav.class + ) + public static class Inputs extends RawOpInputs { + /** + * The WAV-encoded audio, usually from a file. + */ + public final Operand contents; + + /** + * Number of sample channels wanted. + */ + public final long desiredChannels; + + /** + * Length of audio requested. + */ + public final long desiredSamples; + + public Inputs(GraphOperation op) { + super(new DecodeWav(op), op, Arrays.asList("desired_channels", "desired_samples")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + desiredChannels = op.attributes().getAttrInt("desired_channels"); + desiredSamples = op.attributes().getAttrInt("desired_samples"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java index 242dac20819..71298e578a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.audio; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -38,6 +43,10 @@ *

    {@code audio} is a 2-D float Tensor of shape {@code [length, channels]}. * {@code sample_rate} is a scalar Tensor holding the rate to use (e.g. 44100). */ +@OpMetadata( + opType = EncodeWav.OP_NAME, + inputsClass = EncodeWav.Inputs.class +) @Operator( group = "audio" ) @@ -49,8 +58,8 @@ public final class EncodeWav extends RawOp implements Operand { private Output contents; - private EncodeWav(Operation operation) { - super(operation); + public EncodeWav(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; contents = operation.output(outputIdx++); } @@ -86,4 +95,26 @@ public Output contents() { public Output asOutput() { return contents; } + + @OpInputsMetadata( + outputsClass = EncodeWav.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D with shape {@code [length, channels]}. + */ + public final Operand audio; + + /** + * Scalar containing the sample frequency. + */ + public final Operand sampleRate; + + public Inputs(GraphOperation op) { + super(new EncodeWav(op), op, Arrays.asList()); + int inputIndex = 0; + audio = (Operand) op.input(inputIndex++); + sampleRate = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java index bc76f03920f..3654035e929 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.audio; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -37,6 +42,10 @@ * history in the speech recognition world, and https://en.wikipedia.org/wiki/Mel-frequency_cepstrum * is a good resource to learn more. */ +@OpMetadata( + opType = Mfcc.OP_NAME, + inputsClass = Mfcc.Inputs.class +) @Operator( group = "audio" ) @@ -48,8 +57,8 @@ public final class Mfcc extends RawOp implements Operand { private Output output; - private Mfcc(Operation operation) { - super(operation); + public Mfcc(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -208,4 +217,53 @@ public Options dctCoefficientCount(Long dctCoefficientCount) { return this; } } + + @OpInputsMetadata( + outputsClass = Mfcc.class + ) + public static class Inputs extends RawOpInputs { + /** + * Typically produced by the Spectrogram op, with magnitude_squared + * set to true. + */ + public final Operand spectrogram; + + /** + * How many samples per second the source audio used. + */ + public final Operand sampleRate; + + /** + * The highest frequency to use when calculating the + * ceptstrum. + */ + public final float upperFrequencyLimit; + + /** + * The lowest frequency to use when calculating the + * ceptstrum. + */ + public final float lowerFrequencyLimit; + + /** + * Resolution of the Mel bank used internally. + */ + public final long filterbankChannelCount; + + /** + * How many output channels to produce per time slice. + */ + public final long dctCoefficientCount; + + public Inputs(GraphOperation op) { + super(new Mfcc(op), op, Arrays.asList("upper_frequency_limit", "lower_frequency_limit", "filterbank_channel_count", "dct_coefficient_count")); + int inputIndex = 0; + spectrogram = (Operand) op.input(inputIndex++); + sampleRate = (Operand) op.input(inputIndex++); + upperFrequencyLimit = op.attributes().getAttrFloat("upper_frequency_limit"); + lowerFrequencyLimit = op.attributes().getAttrFloat("lower_frequency_limit"); + filterbankChannelCount = op.attributes().getAttrInt("filterbank_channel_count"); + dctCoefficientCount = op.attributes().getAttrInt("dct_coefficient_count"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java index a4723f1eca5..7fea36a03b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -46,9 +52,11 @@ * res = bitwise_ops.bitwise_and(lhs, rhs) * tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = BitwiseAnd.OP_NAME, + inputsClass = BitwiseAnd.Inputs.class +) @Operator( group = "bitwise" ) @@ -60,8 +68,8 @@ public final class BitwiseAnd extends RawOp implements Operan private Output z; - private BitwiseAnd(Operation operation) { - super(operation); + public BitwiseAnd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -70,8 +78,8 @@ private BitwiseAnd(Operation operation) { * Factory method to create a class wrapping a new BitwiseAnd operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseAnd} output and operands * @return a new instance of BitwiseAnd */ @@ -98,4 +106,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = BitwiseAnd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BitwiseAnd<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java index a69cd3e282d..1e57451698b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -46,9 +52,11 @@ * res = bitwise_ops.bitwise_or(lhs, rhs) * tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = BitwiseOr.OP_NAME, + inputsClass = BitwiseOr.Inputs.class +) @Operator( group = "bitwise" ) @@ -60,8 +68,8 @@ public final class BitwiseOr extends RawOp implements Operand private Output z; - private BitwiseOr(Operation operation) { - super(operation); + public BitwiseOr(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -70,8 +78,8 @@ private BitwiseOr(Operation operation) { * Factory method to create a class wrapping a new BitwiseOr operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseOr} output and operands * @return a new instance of BitwiseOr */ @@ -98,4 +106,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = BitwiseOr.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BitwiseOr<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java index 98123299b7e..52953422482 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -46,9 +52,11 @@ * res = bitwise_ops.bitwise_xor(lhs, rhs) * tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = BitwiseXor.OP_NAME, + inputsClass = BitwiseXor.Inputs.class +) @Operator( group = "bitwise" ) @@ -60,8 +68,8 @@ public final class BitwiseXor extends RawOp implements Operan private Output z; - private BitwiseXor(Operation operation) { - super(operation); + public BitwiseXor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -70,8 +78,8 @@ private BitwiseXor(Operation operation) { * Factory method to create a class wrapping a new BitwiseXor operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code BitwiseXor} output and operands * @return a new instance of BitwiseXor */ @@ -98,4 +106,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = BitwiseXor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BitwiseXor<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java index cf052eb2235..8dcb5a72de7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -67,9 +73,11 @@ * expected = tf.constant([dtype.max - x for x in inputs], dtype=tf.float32) * tf.assert_equal(tf.cast(inverted, tf.float32), tf.cast(expected, tf.float32)) * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Invert.OP_NAME, + inputsClass = Invert.Inputs.class +) @Operator( group = "bitwise" ) @@ -81,8 +89,8 @@ public final class Invert extends RawOp implements Operand private Output y; - private Invert(Operation operation) { - super(operation); + public Invert(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -91,7 +99,7 @@ private Invert(Operation operation) { * Factory method to create a class wrapping a new Invert operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Invert} output and operands * @return a new instance of Invert */ @@ -117,4 +125,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Invert.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Invert<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java index bad49a692a4..ccf41c473f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -57,9 +63,11 @@ * bitwise_ops.left_shift(lhs, rhs) * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = LeftShift.OP_NAME, + inputsClass = LeftShift.Inputs.class +) @Operator( group = "bitwise" ) @@ -71,8 +79,8 @@ public final class LeftShift extends RawOp implements Operand private Output z; - private LeftShift(Operation operation) { - super(operation); + public LeftShift(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -81,8 +89,8 @@ private LeftShift(Operation operation) { * Factory method to create a class wrapping a new LeftShift operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code LeftShift} output and operands * @return a new instance of LeftShift */ @@ -109,4 +117,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = LeftShift.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LeftShift<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java index b633e0c4d0f..6c1407b9d19 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.bitwise; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -59,9 +65,11 @@ * bitwise_ops.right_shift(lhs, rhs) * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = RightShift.OP_NAME, + inputsClass = RightShift.Inputs.class +) @Operator( group = "bitwise" ) @@ -73,8 +81,8 @@ public final class RightShift extends RawOp implements Operan private Output z; - private RightShift(Operation operation) { - super(operation); + public RightShift(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -83,8 +91,8 @@ private RightShift(Operation operation) { * Factory method to create a class wrapping a new RightShift operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code RightShift} output and operands * @return a new instance of RightShift */ @@ -111,4 +119,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = RightShift.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RightShift<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java index 76ed4d0228e..fb5a6c31581 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.cluster; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -34,6 +40,13 @@ * of the k-MC^2 algorithm and returns the index of one candidate point to be added * as an additional cluster center. */ +@OpMetadata( + opType = KMC2ChainInitialization.OP_NAME, + inputsClass = KMC2ChainInitialization.Inputs.class +) +@Operator( + group = "cluster" +) public final class KMC2ChainInitialization extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class KMC2ChainInitialization extends RawOp implements Operand index; - private KMC2ChainInitialization(Operation operation) { - super(operation); + public KMC2ChainInitialization(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; index = operation.output(outputIdx++); } @@ -81,4 +94,27 @@ public Output index() { public Output asOutput() { return index; } + + @OpInputsMetadata( + outputsClass = KMC2ChainInitialization.class + ) + public static class Inputs extends RawOpInputs { + /** + * Vector with squared distances to the closest previously sampled cluster center + * for each candidate point. + */ + public final Operand distances; + + /** + * Scalar. Seed for initializing the random number generator. + */ + public final Operand seed; + + public Inputs(GraphOperation op) { + super(new KMC2ChainInitialization(op), op, Arrays.asList()); + int inputIndex = 0; + distances = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java index b73162109f7..820fdabb7b9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.cluster; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -34,6 +40,13 @@ * distance from the nearest row selected thus far till num_to_sample rows have * been sampled. */ +@OpMetadata( + opType = KmeansPlusPlusInitialization.OP_NAME, + inputsClass = KmeansPlusPlusInitialization.Inputs.class +) +@Operator( + group = "cluster" +) public final class KmeansPlusPlusInitialization extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class KmeansPlusPlusInitialization extends RawOp implements Operand private Output samples; - private KmeansPlusPlusInitialization(Operation operation) { - super(operation); + public KmeansPlusPlusInitialization(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; samples = operation.output(outputIdx++); } @@ -87,4 +100,41 @@ public Output samples() { public Output asOutput() { return samples; } + + @OpInputsMetadata( + outputsClass = KmeansPlusPlusInitialization.class + ) + public static class Inputs extends RawOpInputs { + /** + * Matrix of shape (n, d). Rows are assumed to be input points. + */ + public final Operand points; + + /** + * Scalar. The number of rows to sample. This value must not be larger than n. + */ + public final Operand numToSample; + + /** + * Scalar. Seed for initializing the random number generator. + */ + public final Operand seed; + + /** + * Scalar. For each row that is sampled, this parameter + * specifies the number of additional points to draw from the current + * distribution before selecting the best. If a negative value is specified, a + * heuristic is used to sample O(log(num_to_sample)) additional points. + */ + public final Operand numRetriesPerSample; + + public Inputs(GraphOperation op) { + super(new KmeansPlusPlusInitialization(op), op, Arrays.asList()); + int inputIndex = 0; + points = (Operand) op.input(inputIndex++); + numToSample = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + numRetriesPerSample = (Operand) op.input(inputIndex++); + } + } } 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 deleted file mode 100644 index 5404521a40f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java +++ /dev/null @@ -1,217 +0,0 @@ -/* 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.Arrays; -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.types.family.TNumber; - -/** - * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data} output - * - * @deprecated use {@link org.tensorflow.op.collective.Reduce} instead - */ -@Deprecated -public final class AllReduce extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveReduce"; - - private Output data; - - private AllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveReduce operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param mergeOp the value of the mergeOp property - * @param finalOp the value of the finalOp property - * @param subdivOffsets the value of the subdivOffsets property - * @param options carries optional attribute values - * @param data type for {@code CollectiveReduce} output and operands - * @return a new instance of AllReduce - */ - @Endpoint( - describeByClass = true - ) - public static AllReduce create(Scope scope, Operand input, - Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, - List subdivOffsets, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AllReduce"); - opBuilder.addInput(input.asOutput()); - 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 AllReduce<>(opBuilder.build()); - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public static Options waitFor(List waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public static Options waitFor(Long[] waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.AllReduce} - */ - public static class Options { - private List waitFor; - - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public Options waitFor(Long... waitFor) { - this.waitFor = Arrays.asList(waitFor); - return this; - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} 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 deleted file mode 100644 index 2db3893987d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java +++ /dev/null @@ -1,154 +0,0 @@ -/* 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.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.family.TType; - -/** - * Receives a tensor value broadcast from another device. - * - * @param data type for {@code data} output - */ -public final class BroadcastRecv extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveBcastRecv"; - - private Output data; - - private BroadcastRecv(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveBcastRecv operation. - * - * @param scope current scope - * @param T the value of the T property - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param shape the value of the shape property - * @param options carries optional attribute values - * @param data type for {@code CollectiveBcastRecv} output and operands - * @return a new instance of BroadcastRecv - */ - @Endpoint( - describeByClass = true - ) - public static BroadcastRecv create(Scope scope, Class T, Long groupSize, - Long groupKey, Long instanceKey, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastRecv"); - opBuilder.setAttr("T", Operands.toDataType(T)); - 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 BroadcastRecv<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastRecv} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} 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 deleted file mode 100644 index fb6edd95351..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java +++ /dev/null @@ -1,153 +0,0 @@ -/* 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.types.family.TType; - -/** - * Broadcasts a tensor value to one or more other devices. - * - * @param data type for {@code data} output - */ -public final class BroadcastSend extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveBcastSend"; - - private Output data; - - private BroadcastSend(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveBcastSend operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param shape the value of the shape property - * @param options carries optional attribute values - * @param data type for {@code CollectiveBcastSend} output and operands - * @return a new instance of BroadcastSend - */ - @Endpoint( - describeByClass = true - ) - public static BroadcastSend create(Scope scope, Operand input, - Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastSend"); - opBuilder.addInput(input.asOutput()); - 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 BroadcastSend<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastSend} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAllToAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAllToAll.java new file mode 100644 index 00000000000..9c513486b9b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAllToAll.java @@ -0,0 +1,176 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Mutually exchanges multiple tensors of identical type and shape. + */ +@OpMetadata( + opType = CollectiveAllToAll.OP_NAME, + inputsClass = CollectiveAllToAll.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveAllToAll extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveAllToAllV3"; + + private Output data; + + public CollectiveAllToAll(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveAllToAllV3 operation. + * + * @param scope current scope + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param options carries optional attribute values + * @param data type for {@code CollectiveAllToAllV3} output and operands + * @return a new instance of CollectiveAllToAll + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveAllToAll create(Scope scope, Operand input, + Operand communicator, Operand groupAssignment, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveAllToAll"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(communicator.asOutput()); + opBuilder.addInput(groupAssignment.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new CollectiveAllToAll<>(opBuilder.build()); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveAllToAll} + */ + public static class Options { + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveAllToAll.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The communicator input + */ + public final Operand communicator; + + /** + * The groupAssignment input + */ + public final Operand groupAssignment; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + public Inputs(GraphOperation op) { + super(new CollectiveAllToAll<>(op), op, Arrays.asList("T", "timeout_seconds")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + communicator = (Operand) op.input(inputIndex++); + groupAssignment = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAssignGroup.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAssignGroup.java new file mode 100644 index 00000000000..598986e3da3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveAssignGroup.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * Assign group keys based on group assignment. + */ +@OpMetadata( + opType = CollectiveAssignGroup.OP_NAME, + inputsClass = CollectiveAssignGroup.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveAssignGroup extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveAssignGroupV2"; + + private Output groupSize; + + private Output groupKey; + + public CollectiveAssignGroup(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + groupSize = operation.output(outputIdx++); + groupKey = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveAssignGroupV2 operation. + * + * @param scope current scope + * @param groupAssignment The groupAssignment value + * @param deviceIndex The deviceIndex value + * @param baseKey The baseKey value + * @return a new instance of CollectiveAssignGroup + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveAssignGroup create(Scope scope, Operand groupAssignment, + Operand deviceIndex, Operand baseKey) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveAssignGroup"); + opBuilder.addInput(groupAssignment.asOutput()); + opBuilder.addInput(deviceIndex.asOutput()); + opBuilder.addInput(baseKey.asOutput()); + return new CollectiveAssignGroup(opBuilder.build()); + } + + /** + * Gets groupSize. + * + * @return groupSize. + */ + public Output groupSize() { + return groupSize; + } + + /** + * Gets groupKey. + * + * @return groupKey. + */ + public Output groupKey() { + return groupKey; + } + + @OpInputsMetadata( + outputsClass = CollectiveAssignGroup.class + ) + public static class Inputs extends RawOpInputs { + /** + * The groupAssignment input + */ + public final Operand groupAssignment; + + /** + * The deviceIndex input + */ + public final Operand deviceIndex; + + /** + * The baseKey input + */ + public final Operand baseKey; + + public Inputs(GraphOperation op) { + super(new CollectiveAssignGroup(op), op, Arrays.asList()); + int inputIndex = 0; + groupAssignment = (Operand) op.input(inputIndex++); + deviceIndex = (Operand) op.input(inputIndex++); + baseKey = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastRecv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastRecv.java new file mode 100644 index 00000000000..a66995e4d4e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastRecv.java @@ -0,0 +1,226 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Receives a tensor value broadcast from another device. + */ +@OpMetadata( + opType = CollectiveBcastRecv.OP_NAME, + inputsClass = CollectiveBcastRecv.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveBcastRecv extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveBcastRecvV2"; + + private Output data; + + public CollectiveBcastRecv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveBcastRecvV2 operation. + * + * @param scope current scope + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param shape The shape value + * @param T The value of the T attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastRecvV2} output and operands + * @return a new instance of CollectiveBcastRecv + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveBcastRecv create(Scope scope, + Operand groupSize, Operand groupKey, Operand instanceKey, + Operand shape, Class T, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveBcastRecv"); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + opBuilder.addInput(shape.asOutput()); + opBuilder.setAttr("T", Operands.toDataType(T)); + 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 CollectiveBcastRecv<>(opBuilder.build()); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveBcastRecv} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveBcastRecv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The groupSize input + */ + public final Operand groupSize; + + /** + * The groupKey input + */ + public final Operand groupKey; + + /** + * The instanceKey input + */ + public final Operand instanceKey; + + /** + * The shape input + */ + public final Operand shape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + /** + * The communicationHint attribute + */ + public final String communicationHint; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + public Inputs(GraphOperation op) { + super(new CollectiveBcastRecv<>(op), op, Arrays.asList("T", "Tshape", "communication_hint", "timeout_seconds")); + int inputIndex = 0; + groupSize = (Operand) op.input(inputIndex++); + groupKey = (Operand) op.input(inputIndex++); + instanceKey = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tshape = op.attributes().getAttrType("Tshape"); + communicationHint = op.attributes().getAttrString("communication_hint"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastSend.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastSend.java new file mode 100644 index 00000000000..df7a315413f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveBcastSend.java @@ -0,0 +1,216 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Broadcasts a tensor value to one or more other devices. + */ +@OpMetadata( + opType = CollectiveBcastSend.OP_NAME, + inputsClass = CollectiveBcastSend.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveBcastSend extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveBcastSendV2"; + + private Output data; + + public CollectiveBcastSend(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveBcastSendV2 operation. + * + * @param scope current scope + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastSendV2} output and operands + * @return a new instance of CollectiveBcastSend + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveBcastSend create(Scope scope, Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveBcastSend"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + 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 CollectiveBcastSend<>(opBuilder.build()); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveBcastSend} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveBcastSend.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The groupSize input + */ + public final Operand groupSize; + + /** + * The groupKey input + */ + public final Operand groupKey; + + /** + * The instanceKey input + */ + public final Operand instanceKey; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The communicationHint attribute + */ + public final String communicationHint; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + public Inputs(GraphOperation op) { + super(new CollectiveBcastSend<>(op), op, Arrays.asList("T", "communication_hint", "timeout_seconds")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + groupSize = (Operand) op.input(inputIndex++); + groupKey = (Operand) op.input(inputIndex++); + instanceKey = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + communicationHint = op.attributes().getAttrString("communication_hint"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveGather.java new file mode 100644 index 00000000000..57a2b134ff6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveGather.java @@ -0,0 +1,289 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Mutually accumulates multiple tensors of identical type and shape. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + */ +@OpMetadata( + opType = CollectiveGather.OP_NAME, + inputsClass = CollectiveGather.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveGather extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveGatherV2"; + + private Output data; + + public CollectiveGather(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveGatherV2 operation. + * + * @param scope current scope + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param options carries optional attribute values + * @param data type for {@code CollectiveGatherV2} output and operands + * @return a new instance of CollectiveGather + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveGather create(Scope scope, Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveGather"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + opBuilder.addInputList(Operands.asOutputs(orderingToken)); + 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); + } + if (opts.isStateless != null) { + opBuilder.setAttr("is_stateless", opts.isStateless); + } + if (opts.NorderingToken != null) { + opBuilder.setAttr("Nordering_token", opts.NorderingToken); + } + } + } + return new CollectiveGather<>(opBuilder.build()); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Sets the isStateless option. + * + * @param isStateless the isStateless option + * @return this Options instance. + */ + public static Options isStateless(Boolean isStateless) { + return new Options().isStateless(isStateless); + } + + /** + * Sets the NorderingToken option. + * + * @param NorderingToken the NorderingToken option + * @return this Options instance. + */ + public static Options NorderingToken(Long NorderingToken) { + return new Options().NorderingToken(NorderingToken); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveGather} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Boolean isStateless; + + private Long NorderingToken; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Sets the isStateless option. + * + * @param isStateless the isStateless option + * @return this Options instance. + */ + public Options isStateless(Boolean isStateless) { + this.isStateless = isStateless; + return this; + } + + /** + * Sets the NorderingToken option. + * + * @param NorderingToken the NorderingToken option + * @return this Options instance. + */ + public Options NorderingToken(Long NorderingToken) { + this.NorderingToken = NorderingToken; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveGather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The groupSize input + */ + public final Operand groupSize; + + /** + * The groupKey input + */ + public final Operand groupKey; + + /** + * The instanceKey input + */ + public final Operand instanceKey; + + /** + * The orderingToken input + */ + public final Iterable> orderingToken; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The communicationHint attribute + */ + public final String communicationHint; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + /** + * The isStateless attribute + */ + public final boolean isStateless; + + public Inputs(GraphOperation op) { + super(new CollectiveGather<>(op), op, Arrays.asList("T", "communication_hint", "timeout_seconds", "is_stateless")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + groupSize = (Operand) op.input(inputIndex++); + groupKey = (Operand) op.input(inputIndex++); + instanceKey = (Operand) op.input(inputIndex++); + int orderingTokenLength = op.inputListLength("ordering_token"); + orderingToken = Arrays.asList((Operand[]) op.inputList(inputIndex, orderingTokenLength)); + inputIndex += orderingTokenLength; + T = op.attributes().getAttrType("T"); + communicationHint = op.attributes().getAttrString("communication_hint"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + isStateless = op.attributes().getAttrBool("is_stateless"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveInitializeCommunicator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveInitializeCommunicator.java new file mode 100644 index 00000000000..e6ea4b8b79c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveInitializeCommunicator.java @@ -0,0 +1,201 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Initializes a group for collective operations. + */ +@OpMetadata( + opType = CollectiveInitializeCommunicator.OP_NAME, + inputsClass = CollectiveInitializeCommunicator.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveInitializeCommunicator extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveInitializeCommunicator"; + + private Output communicator; + + @SuppressWarnings("unchecked") + public CollectiveInitializeCommunicator(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + communicator = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveInitializeCommunicator operation. + * + * @param scope current scope + * @param groupKey The groupKey value + * @param rank The rank value + * @param groupSize The groupSize value + * @param options carries optional attribute values + * @return a new instance of CollectiveInitializeCommunicator + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveInitializeCommunicator create(Scope scope, Operand groupKey, + Operand rank, Operand groupSize, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveInitializeCommunicator"); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(rank.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + 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 CollectiveInitializeCommunicator(opBuilder.build()); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Gets communicator. + * + * @return communicator. + */ + public Output communicator() { + return communicator; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) communicator; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveInitializeCommunicator} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveInitializeCommunicator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The groupKey input + */ + public final Operand groupKey; + + /** + * The rank input + */ + public final Operand rank; + + /** + * The groupSize input + */ + public final Operand groupSize; + + /** + * The communicationHint attribute + */ + public final String communicationHint; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + public Inputs(GraphOperation op) { + super(new CollectiveInitializeCommunicator(op), op, Arrays.asList("communication_hint", "timeout_seconds")); + int inputIndex = 0; + groupKey = (Operand) op.input(inputIndex++); + rank = (Operand) op.input(inputIndex++); + groupSize = (Operand) op.input(inputIndex++); + communicationHint = op.attributes().getAttrString("communication_hint"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectivePermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectivePermute.java new file mode 100644 index 00000000000..380a949a664 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectivePermute.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * An Op to permute tensors across replicated TPU instances. + * Each instance supplies its own input. + *

    For example, suppose there are 4 TPU instances: {@code [A, B, C, D]}. Passing + * source_target_pairs={@code [[0,1],[1,2],[2,3],[3,0]]} gets the outputs: + * {@code [D, A, B, C]}. + */ +@OpMetadata( + opType = CollectivePermute.OP_NAME, + inputsClass = CollectivePermute.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectivePermute extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectivePermute"; + + private Output output; + + public CollectivePermute(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectivePermute operation. + * + * @param scope current scope + * @param input The local input to be permuted. Currently only supports float and + * bfloat16. + * @param sourceTargetPairs A tensor with shape [num_pairs, 2]. + * @param data type for {@code CollectivePermute} output and operands + * @return a new instance of CollectivePermute + */ + @Endpoint( + describeByClass = true + ) + public static CollectivePermute create(Scope scope, Operand input, + Operand sourceTargetPairs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectivePermute"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(sourceTargetPairs.asOutput()); + return new CollectivePermute<>(opBuilder.build()); + } + + /** + * Gets output. + * The permuted input. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = CollectivePermute.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The local input to be permuted. Currently only supports float and + * bfloat16. + */ + public final Operand input; + + /** + * A tensor with shape [num_pairs, 2]. + */ + public final Operand sourceTargetPairs; + + /** + * The type of elements to be exchanged. + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CollectivePermute<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + sourceTargetPairs = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduce.java new file mode 100644 index 00000000000..8f6c26778e1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduce.java @@ -0,0 +1,185 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Mutually reduces multiple tensors of identical type and shape. + */ +@OpMetadata( + opType = CollectiveReduce.OP_NAME, + inputsClass = CollectiveReduce.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveReduce extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveReduceV3"; + + private Output data; + + public CollectiveReduce(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveReduceV3 operation. + * + * @param scope current scope + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param reduction The value of the reduction attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceV3} output and operands + * @return a new instance of CollectiveReduce + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveReduce create(Scope scope, Operand input, + Operand communicator, Operand groupAssignment, String reduction, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveReduce"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(communicator.asOutput()); + opBuilder.addInput(groupAssignment.asOutput()); + opBuilder.setAttr("reduction", reduction); + if (options != null) { + for (Options opts : options) { + if (opts.timeoutSeconds != null) { + opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds); + } + } + } + return new CollectiveReduce<>(opBuilder.build()); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveReduce} + */ + public static class Options { + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveReduce.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The communicator input + */ + public final Operand communicator; + + /** + * The groupAssignment input + */ + public final Operand groupAssignment; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The reduction attribute + */ + public final String reduction; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + public Inputs(GraphOperation op) { + super(new CollectiveReduce<>(op), op, Arrays.asList("T", "reduction", "timeout_seconds")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + communicator = (Operand) op.input(inputIndex++); + groupAssignment = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + reduction = op.attributes().getAttrString("reduction"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduceScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduceScatter.java new file mode 100644 index 00000000000..8b89dbaf183 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/CollectiveReduceScatter.java @@ -0,0 +1,338 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Mutually reduces multiple tensors of identical type and shape and scatters the result. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + */ +@OpMetadata( + opType = CollectiveReduceScatter.OP_NAME, + inputsClass = CollectiveReduceScatter.Inputs.class +) +@Operator( + group = "collective" +) +public final class CollectiveReduceScatter extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectiveReduceScatterV2"; + + private Output data; + + public CollectiveReduceScatter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollectiveReduceScatterV2 operation. + * + * @param scope current scope + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param mergeOp The value of the mergeOp attribute + * @param finalOp The value of the finalOp attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceScatterV2} output and operands + * @return a new instance of CollectiveReduceScatter + */ + @Endpoint( + describeByClass = true + ) + public static CollectiveReduceScatter create(Scope scope, Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, String mergeOp, String finalOp, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveReduceScatter"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(groupSize.asOutput()); + opBuilder.addInput(groupKey.asOutput()); + opBuilder.addInput(instanceKey.asOutput()); + opBuilder.addInputList(Operands.asOutputs(orderingToken)); + 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); + } + if (opts.isStateless != null) { + opBuilder.setAttr("is_stateless", opts.isStateless); + } + if (opts.NorderingToken != null) { + opBuilder.setAttr("Nordering_token", opts.NorderingToken); + } + if (opts.maxSubdivsPerDevice != null) { + opBuilder.setAttr("max_subdivs_per_device", opts.maxSubdivsPerDevice); + } + } + } + return new CollectiveReduceScatter<>(opBuilder.build()); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public static Options communicationHint(String communicationHint) { + return new Options().communicationHint(communicationHint); + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public static Options timeoutSeconds(Float timeoutSeconds) { + return new Options().timeoutSeconds(timeoutSeconds); + } + + /** + * Sets the isStateless option. + * + * @param isStateless the isStateless option + * @return this Options instance. + */ + public static Options isStateless(Boolean isStateless) { + return new Options().isStateless(isStateless); + } + + /** + * Sets the NorderingToken option. + * + * @param NorderingToken the NorderingToken option + * @return this Options instance. + */ + public static Options NorderingToken(Long NorderingToken) { + return new Options().NorderingToken(NorderingToken); + } + + /** + * Sets the maxSubdivsPerDevice option. + * + * @param maxSubdivsPerDevice the maxSubdivsPerDevice option + * @return this Options instance. + */ + public static Options maxSubdivsPerDevice(Long maxSubdivsPerDevice) { + return new Options().maxSubdivsPerDevice(maxSubdivsPerDevice); + } + + /** + * Gets data. + * + * @return data. + */ + public Output data() { + return data; + } + + @Override + public Output asOutput() { + return data; + } + + /** + * Optional attributes for {@link org.tensorflow.op.collective.CollectiveReduceScatter} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Boolean isStateless; + + private Long NorderingToken; + + private Long maxSubdivsPerDevice; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Sets the isStateless option. + * + * @param isStateless the isStateless option + * @return this Options instance. + */ + public Options isStateless(Boolean isStateless) { + this.isStateless = isStateless; + return this; + } + + /** + * Sets the NorderingToken option. + * + * @param NorderingToken the NorderingToken option + * @return this Options instance. + */ + public Options NorderingToken(Long NorderingToken) { + this.NorderingToken = NorderingToken; + return this; + } + + /** + * Sets the maxSubdivsPerDevice option. + * + * @param maxSubdivsPerDevice the maxSubdivsPerDevice option + * @return this Options instance. + */ + public Options maxSubdivsPerDevice(Long maxSubdivsPerDevice) { + this.maxSubdivsPerDevice = maxSubdivsPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CollectiveReduceScatter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The groupSize input + */ + public final Operand groupSize; + + /** + * The groupKey input + */ + public final Operand groupKey; + + /** + * The instanceKey input + */ + public final Operand instanceKey; + + /** + * The orderingToken input + */ + public final Iterable> orderingToken; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The mergeOp attribute + */ + public final String mergeOp; + + /** + * The finalOp attribute + */ + public final String finalOp; + + /** + * The communicationHint attribute + */ + public final String communicationHint; + + /** + * The timeoutSeconds attribute + */ + public final float timeoutSeconds; + + /** + * The isStateless attribute + */ + public final boolean isStateless; + + /** + * The maxSubdivsPerDevice attribute + */ + public final long maxSubdivsPerDevice; + + public Inputs(GraphOperation op) { + super(new CollectiveReduceScatter<>(op), op, Arrays.asList("T", "merge_op", "final_op", "communication_hint", "timeout_seconds", "is_stateless", "max_subdivs_per_device")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + groupSize = (Operand) op.input(inputIndex++); + groupKey = (Operand) op.input(inputIndex++); + instanceKey = (Operand) op.input(inputIndex++); + int orderingTokenLength = op.inputListLength("ordering_token"); + orderingToken = Arrays.asList((Operand[]) op.inputList(inputIndex, orderingTokenLength)); + inputIndex += orderingTokenLength; + T = op.attributes().getAttrType("T"); + mergeOp = op.attributes().getAttrString("merge_op"); + finalOp = op.attributes().getAttrString("final_op"); + communicationHint = op.attributes().getAttrString("communication_hint"); + timeoutSeconds = op.attributes().getAttrFloat("timeout_seconds"); + isStateless = op.attributes().getAttrBool("is_stateless"); + maxSubdivsPerDevice = op.attributes().getAttrInt("max_subdivs_per_device"); + } + } +} 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 deleted file mode 100644 index 2a1a3b7b41f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java +++ /dev/null @@ -1,153 +0,0 @@ -/* 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.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 { - /** - * 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++); - } - - /** - * Factory method to create a class wrapping a new CollectiveGather operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param shape the value of the shape property - * @param options carries optional attribute values - * @param data type for {@code CollectiveGather} output and operands - * @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.opBuilder(OP_NAME, "Gather"); - opBuilder.addInput(input.asOutput()); - 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()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.Gather} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} 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 deleted file mode 100644 index 2900c31041e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java +++ /dev/null @@ -1,182 +0,0 @@ -/* 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.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data} output - */ -public final class GatherV2 extends RawOp implements Operand { - /** - * 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++); - } - - /** - * Factory method to create a class wrapping a new CollectiveGatherV2 operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the groupSize value - * @param groupKey the groupKey value - * @param instanceKey the instanceKey value - * @param orderingToken the orderingToken value - * @param options carries optional attribute values - * @param data type for {@code CollectiveGatherV2} output and operands - * @return a new instance of GatherV2 - */ - @Endpoint( - describeByClass = true - ) - public static GatherV2 create(Scope scope, Operand input, - Operand groupSize, Operand groupKey, Operand instanceKey, - Iterable> orderingToken, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GatherV2"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - opBuilder.addInputList(Operands.asOutputs(orderingToken)); - 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); - } - if (opts.NorderingToken != null) { - opBuilder.setAttr("Nordering_token", opts.NorderingToken); - } - } - } - return new GatherV2<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Sets the NorderingToken option. - * - * @param NorderingToken the NorderingToken option - * @return this Options instance. - */ - public static Options NorderingToken(Long NorderingToken) { - return new Options().NorderingToken(NorderingToken); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.GatherV2} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Long NorderingToken; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - /** - * Sets the NorderingToken option. - * - * @param NorderingToken the NorderingToken option - * @return this Options instance. - */ - public Options NorderingToken(Long NorderingToken) { - this.NorderingToken = NorderingToken; - return this; - } - } -} 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 deleted file mode 100644 index cf4bc4328c1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java +++ /dev/null @@ -1,214 +0,0 @@ -/* 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.Arrays; -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.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 { - /** - * 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++); - } - - /** - * Factory method to create a class wrapping a new CollectiveReduce operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param mergeOp the value of the mergeOp property - * @param finalOp the value of the finalOp property - * @param subdivOffsets the value of the subdivOffsets property - * @param options carries optional attribute values - * @param data type for {@code CollectiveReduce} output and operands - * @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.opBuilder(OP_NAME, "Reduce"); - opBuilder.addInput(input.asOutput()); - 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()); - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public static Options waitFor(List waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public static Options waitFor(Long[] waitFor) { - return new Options().waitFor(waitFor); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.Reduce} - */ - public static class Options { - private List waitFor; - - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * Sets the waitFor option. - * - * @param waitFor the waitFor option - * @return this Options instance. - */ - public Options waitFor(Long... waitFor) { - this.waitFor = Arrays.asList(waitFor); - return this; - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} 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 deleted file mode 100644 index 77a5b8eade4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java +++ /dev/null @@ -1,213 +0,0 @@ -/* 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.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data} output - */ -public final class ReduceV2 extends RawOp implements Operand { - /** - * 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++); - } - - /** - * Factory method to create a class wrapping a new CollectiveReduceV2 operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the groupSize value - * @param groupKey the groupKey value - * @param instanceKey the instanceKey value - * @param orderingToken the orderingToken value - * @param mergeOp the value of the mergeOp property - * @param finalOp the value of the finalOp property - * @param options carries optional attribute values - * @param data type for {@code CollectiveReduceV2} output and operands - * @return a new instance of ReduceV2 - */ - @Endpoint( - describeByClass = true - ) - public static ReduceV2 create(Scope scope, Operand input, - Operand groupSize, Operand groupKey, Operand instanceKey, - Iterable> orderingToken, String mergeOp, String finalOp, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceV2"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - opBuilder.addInputList(Operands.asOutputs(orderingToken)); - 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); - } - if (opts.NorderingToken != null) { - opBuilder.setAttr("Nordering_token", opts.NorderingToken); - } - if (opts.maxSubdivsPerDevice != null) { - opBuilder.setAttr("max_subdivs_per_device", opts.maxSubdivsPerDevice); - } - } - } - return new ReduceV2<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Sets the NorderingToken option. - * - * @param NorderingToken the NorderingToken option - * @return this Options instance. - */ - public static Options NorderingToken(Long NorderingToken) { - return new Options().NorderingToken(NorderingToken); - } - - /** - * Sets the maxSubdivsPerDevice option. - * - * @param maxSubdivsPerDevice the maxSubdivsPerDevice option - * @return this Options instance. - */ - public static Options maxSubdivsPerDevice(Long maxSubdivsPerDevice) { - return new Options().maxSubdivsPerDevice(maxSubdivsPerDevice); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.collective.ReduceV2} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Long NorderingToken; - - private Long maxSubdivsPerDevice; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - /** - * Sets the NorderingToken option. - * - * @param NorderingToken the NorderingToken option - * @return this Options instance. - */ - public Options NorderingToken(Long NorderingToken) { - this.NorderingToken = NorderingToken; - return this; - } - - /** - * Sets the maxSubdivsPerDevice option. - * - * @param maxSubdivsPerDevice the maxSubdivsPerDevice option - * @return this Options instance. - */ - public Options maxSubdivsPerDevice(Long maxSubdivsPerDevice) { - this.maxSubdivsPerDevice = maxSubdivsPerDevice; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java index 850854a9523..f634f318b2b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,11 +17,16 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; /** @@ -30,6 +35,10 @@ * otherwise it will exit with a SIGABORT signal. *

    Returns nothing but an exception. */ +@OpMetadata( + opType = Abort.OP_NAME, + inputsClass = Abort.Inputs.class +) @Operator public final class Abort extends RawOp { /** @@ -37,8 +46,8 @@ public final class Abort extends RawOp { */ public static final String OP_NAME = "Abort"; - private Abort(Operation operation) { - super(operation); + public Abort(Operation operation) { + super(operation, OP_NAME); } /** @@ -119,4 +128,26 @@ public Options exitWithoutError(Boolean exitWithoutError) { return this; } } + + @OpInputsMetadata( + outputsClass = Abort.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string which is the message associated with the exception. + */ + public final String errorMsg; + + /** + * The exitWithoutError attribute + */ + public final boolean exitWithoutError; + + public Inputs(GraphOperation op) { + super(new Abort(op), op, Arrays.asList("error_msg", "exit_without_error")); + int inputIndex = 0; + errorMsg = op.attributes().getAttrString("error_msg"); + exitWithoutError = op.attributes().getAttrBool("exit_without_error"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java index 58a16e2306b..defb98c912b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. */ +@OpMetadata( + opType = All.OP_NAME, + inputsClass = All.Inputs.class +) @Operator public final class All extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class All extends RawOp implements Operand { private Output output; - private All(Operation operation) { - super(operation); + public All(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -122,4 +132,39 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = All.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new All(op), op, Arrays.asList("keep_dims", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousHashTable.java new file mode 100644 index 00000000000..0dcfd8003dc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousHashTable.java @@ -0,0 +1,125 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Creates a uninitialized anonymous hash table. + * This op creates a new anonymous hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Before using the table you will have + * to initialize it. After initialization the table will be + * immutable. The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + */ +@OpMetadata( + opType = AnonymousHashTable.OP_NAME, + inputsClass = AnonymousHashTable.Inputs.class +) +@Operator +public final class AnonymousHashTable extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousHashTable"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public AnonymousHashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousHashTable operation. + * + * @param scope current scope + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param data type for {@code AnonymousHashTable} output and operands + * @param data type for {@code AnonymousHashTable} output and operands + * @return a new instance of AnonymousHashTable + */ + @Endpoint( + describeByClass = true + ) + public static AnonymousHashTable create(Scope scope, + Class keyDtype, Class valueDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousHashTable"); + opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + return new AnonymousHashTable(opBuilder.build()); + } + + /** + * Gets tableHandle. + * The resource handle to the newly created hash-table resource. + * @return tableHandle. + */ + public Output tableHandle() { + return tableHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) tableHandle; + } + + @OpInputsMetadata( + outputsClass = AnonymousHashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new AnonymousHashTable(op), op, Arrays.asList("key_dtype", "value_dtype")); + int inputIndex = 0; + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableDenseHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableDenseHashTable.java new file mode 100644 index 00000000000..9e3baa34b1f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableDenseHashTable.java @@ -0,0 +1,261 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Creates an empty anonymous mutable hash table that uses tensors as the backing store. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a scalar. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + *

    It uses "open addressing" with quadratic reprobing to resolve + * collisions. + *

    The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + */ +@OpMetadata( + opType = AnonymousMutableDenseHashTable.OP_NAME, + inputsClass = AnonymousMutableDenseHashTable.Inputs.class +) +@Operator +public final class AnonymousMutableDenseHashTable extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMutableDenseHashTable"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public AnonymousMutableDenseHashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousMutableDenseHashTable operation. + * + * @param scope current scope + * @param emptyKey The key used to represent empty key buckets internally. Must not + * be used in insert or lookup operations. + * @param deletedKey The deletedKey value + * @param valueDtype Type of the table values. + * @param options carries optional attribute values + * @param data type for {@code AnonymousMutableDenseHashTable} output and operands + * @param data type for {@code AnonymousMutableDenseHashTable} output and operands + * @return a new instance of AnonymousMutableDenseHashTable + */ + @Endpoint( + describeByClass = true + ) + public static AnonymousMutableDenseHashTable create( + Scope scope, Operand emptyKey, Operand deletedKey, Class valueDtype, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousMutableDenseHashTable"); + opBuilder.addInput(emptyKey.asOutput()); + opBuilder.addInput(deletedKey.asOutput()); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + if (options != null) { + for (Options opts : options) { + if (opts.valueShape != null) { + opBuilder.setAttr("value_shape", opts.valueShape); + } + if (opts.initialNumBuckets != null) { + opBuilder.setAttr("initial_num_buckets", opts.initialNumBuckets); + } + if (opts.maxLoadFactor != null) { + opBuilder.setAttr("max_load_factor", opts.maxLoadFactor); + } + } + } + return new AnonymousMutableDenseHashTable(opBuilder.build()); + } + + /** + * Sets the valueShape option. + * + * @param valueShape The shape of each value. + * @return this Options instance. + */ + public static Options valueShape(Shape valueShape) { + return new Options().valueShape(valueShape); + } + + /** + * Sets the initialNumBuckets option. + * + * @param initialNumBuckets The initial number of hash table buckets. Must be a power + * to 2. + * @return this Options instance. + */ + public static Options initialNumBuckets(Long initialNumBuckets) { + return new Options().initialNumBuckets(initialNumBuckets); + } + + /** + * Sets the maxLoadFactor option. + * + * @param maxLoadFactor The maximum ratio between number of entries and number of + * buckets before growing the table. Must be between 0 and 1. + * @return this Options instance. + */ + public static Options maxLoadFactor(Float maxLoadFactor) { + return new Options().maxLoadFactor(maxLoadFactor); + } + + /** + * Gets tableHandle. + * The resource handle to the newly created hash-table resource. + * @return tableHandle. + */ + public Output tableHandle() { + return tableHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) tableHandle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.AnonymousMutableDenseHashTable} + */ + public static class Options { + private Shape valueShape; + + private Long initialNumBuckets; + + private Float maxLoadFactor; + + private Options() { + } + + /** + * Sets the valueShape option. + * + * @param valueShape The shape of each value. + * @return this Options instance. + */ + public Options valueShape(Shape valueShape) { + this.valueShape = valueShape; + return this; + } + + /** + * Sets the initialNumBuckets option. + * + * @param initialNumBuckets The initial number of hash table buckets. Must be a power + * to 2. + * @return this Options instance. + */ + public Options initialNumBuckets(Long initialNumBuckets) { + this.initialNumBuckets = initialNumBuckets; + return this; + } + + /** + * Sets the maxLoadFactor option. + * + * @param maxLoadFactor The maximum ratio between number of entries and number of + * buckets before growing the table. Must be between 0 and 1. + * @return this Options instance. + */ + public Options maxLoadFactor(Float maxLoadFactor) { + this.maxLoadFactor = maxLoadFactor; + return this; + } + } + + @OpInputsMetadata( + outputsClass = AnonymousMutableDenseHashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key used to represent empty key buckets internally. Must not + * be used in insert or lookup operations. + */ + public final Operand emptyKey; + + /** + * The deletedKey input + */ + public final Operand deletedKey; + + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + /** + * The shape of each value. + */ + public final Shape valueShape; + + /** + * The initial number of hash table buckets. Must be a power + * to 2. + */ + public final long initialNumBuckets; + + /** + * The maximum ratio between number of entries and number of + * buckets before growing the table. Must be between 0 and 1. + */ + public final float maxLoadFactor; + + public Inputs(GraphOperation op) { + super(new AnonymousMutableDenseHashTable(op), op, Arrays.asList("key_dtype", "value_dtype", "value_shape", "initial_num_buckets", "max_load_factor")); + int inputIndex = 0; + emptyKey = (Operand) op.input(inputIndex++); + deletedKey = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + valueShape = op.attributes().getAttrShape("value_shape"); + initialNumBuckets = op.attributes().getAttrInt("initial_num_buckets"); + maxLoadFactor = op.attributes().getAttrFloat("max_load_factor"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTable.java new file mode 100644 index 00000000000..a010e6bc71c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTable.java @@ -0,0 +1,126 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Creates an empty anonymous mutable hash table. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a scalar. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + * The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + */ +@OpMetadata( + opType = AnonymousMutableHashTable.OP_NAME, + inputsClass = AnonymousMutableHashTable.Inputs.class +) +@Operator +public final class AnonymousMutableHashTable extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMutableHashTable"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public AnonymousMutableHashTable(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousMutableHashTable operation. + * + * @param scope current scope + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param data type for {@code AnonymousMutableHashTable} output and operands + * @param data type for {@code AnonymousMutableHashTable} output and operands + * @return a new instance of AnonymousMutableHashTable + */ + @Endpoint( + describeByClass = true + ) + public static AnonymousMutableHashTable create(Scope scope, + Class keyDtype, Class valueDtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousMutableHashTable"); + opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + return new AnonymousMutableHashTable(opBuilder.build()); + } + + /** + * Gets tableHandle. + * The resource handle to the newly created hash-table resource. + * @return tableHandle. + */ + public Output tableHandle() { + return tableHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) tableHandle; + } + + @OpInputsMetadata( + outputsClass = AnonymousMutableHashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new AnonymousMutableHashTable(op), op, Arrays.asList("key_dtype", "value_dtype")); + int inputIndex = 0; + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTableOfTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTableOfTensors.java new file mode 100644 index 00000000000..263438f8099 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMutableHashTableOfTensors.java @@ -0,0 +1,172 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Creates an empty anonymous mutable hash table of vector values. + * This op creates a new anonymous mutable hash table (as a resource) everytime + * it is executed, with the specified dtype of its keys and values, + * returning the resource handle. Each value must be a vector. + * Data can be inserted into the table using + * the insert operations. It does not support the initialization operation. + * The table is anonymous in the sense that it can only be + * accessed by the returned resource handle (e.g. it cannot be looked up + * by a name in a resource manager). The table will be automatically + * deleted when all resource handles pointing to it are gone. + */ +@OpMetadata( + opType = AnonymousMutableHashTableOfTensors.OP_NAME, + inputsClass = AnonymousMutableHashTableOfTensors.Inputs.class +) +@Operator +public final class AnonymousMutableHashTableOfTensors extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMutableHashTableOfTensors"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + public AnonymousMutableHashTableOfTensors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousMutableHashTableOfTensors operation. + * + * @param scope current scope + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param options carries optional attribute values + * @param data type for {@code AnonymousMutableHashTableOfTensors} output and operands + * @param data type for {@code AnonymousMutableHashTableOfTensors} output and operands + * @return a new instance of AnonymousMutableHashTableOfTensors + */ + @Endpoint( + describeByClass = true + ) + public static AnonymousMutableHashTableOfTensors create( + Scope scope, Class keyDtype, Class valueDtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AnonymousMutableHashTableOfTensors"); + opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); + opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); + if (options != null) { + for (Options opts : options) { + if (opts.valueShape != null) { + opBuilder.setAttr("value_shape", opts.valueShape); + } + } + } + return new AnonymousMutableHashTableOfTensors(opBuilder.build()); + } + + /** + * Sets the valueShape option. + * + * @param valueShape the valueShape option + * @return this Options instance. + */ + public static Options valueShape(Shape valueShape) { + return new Options().valueShape(valueShape); + } + + /** + * Gets tableHandle. + * The resource handle to the newly created hash-table resource. + * @return tableHandle. + */ + public Output tableHandle() { + return tableHandle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) tableHandle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.AnonymousMutableHashTableOfTensors} + */ + public static class Options { + private Shape valueShape; + + private Options() { + } + + /** + * Sets the valueShape option. + * + * @param valueShape the valueShape option + * @return this Options instance. + */ + public Options valueShape(Shape valueShape) { + this.valueShape = valueShape; + return this; + } + } + + @OpInputsMetadata( + outputsClass = AnonymousMutableHashTableOfTensors.class + ) + public static class Inputs extends RawOpInputs { + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + /** + * The valueShape attribute + */ + public final Shape valueShape; + + public Inputs(GraphOperation op) { + super(new AnonymousMutableHashTableOfTensors(op), op, Arrays.asList("key_dtype", "value_dtype", "value_shape")); + int inputIndex = 0; + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + valueShape = op.attributes().getAttrShape("value_shape"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java index a629c8d4895..a3f709663e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. */ +@OpMetadata( + opType = Any.OP_NAME, + inputsClass = Any.Inputs.class +) @Operator public final class Any extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class Any extends RawOp implements Operand { private Output output; - private Any(Operation operation) { - super(operation); + public Any(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -122,4 +132,39 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Any.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Any(op), op, Arrays.asList("keep_dims", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApproxTopK.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApproxTopK.java new file mode 100644 index 00000000000..48f4f94315b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApproxTopK.java @@ -0,0 +1,324 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Returns min/max k values and their indices of the input operand in an approximate manner. + * See https://arxiv.org/abs/2206.14286 for the algorithm details. + * This op is only optimized on TPU currently. + */ +@OpMetadata( + opType = ApproxTopK.OP_NAME, + inputsClass = ApproxTopK.Inputs.class +) +@Operator +public final class ApproxTopK extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ApproxTopK"; + + private Output values; + + private Output indices; + + public ApproxTopK(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + values = operation.output(outputIdx++); + indices = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ApproxTopK operation. + * + * @param scope current scope + * @param input Array to search. Must be at least 1-D of the floating type + * @param k Specifies the number of min/max-k. + * @param options carries optional attribute values + * @param data type for {@code ApproxTopK} output and operands + * @return a new instance of ApproxTopK + */ + @Endpoint( + describeByClass = true + ) + public static ApproxTopK create(Scope scope, Operand input, Long k, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ApproxTopK"); + opBuilder.addInput(input.asOutput()); + opBuilder.setAttr("k", k); + if (options != null) { + for (Options opts : options) { + if (opts.reductionDimension != null) { + opBuilder.setAttr("reduction_dimension", opts.reductionDimension); + } + if (opts.recallTarget != null) { + opBuilder.setAttr("recall_target", opts.recallTarget); + } + if (opts.isMaxK != null) { + opBuilder.setAttr("is_max_k", opts.isMaxK); + } + if (opts.reductionInputSizeOverride != null) { + opBuilder.setAttr("reduction_input_size_override", opts.reductionInputSizeOverride); + } + if (opts.aggregateToTopk != null) { + opBuilder.setAttr("aggregate_to_topk", opts.aggregateToTopk); + } + } + } + return new ApproxTopK<>(opBuilder.build()); + } + + /** + * Sets the reductionDimension option. + * + * @param reductionDimension Integer dimension along which to search. Default: -1. + * @return this Options instance. + */ + public static Options reductionDimension(Long reductionDimension) { + return new Options().reductionDimension(reductionDimension); + } + + /** + * Sets the recallTarget option. + * + * @param recallTarget Recall target for the approximation. Range in (0,1] + * @return this Options instance. + */ + public static Options recallTarget(Float recallTarget) { + return new Options().recallTarget(recallTarget); + } + + /** + * Sets the isMaxK option. + * + * @param isMaxK When true, computes max-k; otherwise computes min-k. + * @return this Options instance. + */ + public static Options isMaxK(Boolean isMaxK) { + return new Options().isMaxK(isMaxK); + } + + /** + * Sets the reductionInputSizeOverride option. + * + * @param reductionInputSizeOverride When set to a positive value, it overrides the size determined by + * {@code input[reduction_dim]} for evaluating the recall. This option is useful when + * the given {@code input} is only a subset of the overall computation in SPMD or + * distributed pipelines, where the true input size cannot be deferred by the + * {@code input} shape. + * @return this Options instance. + */ + public static Options reductionInputSizeOverride(Long reductionInputSizeOverride) { + return new Options().reductionInputSizeOverride(reductionInputSizeOverride); + } + + /** + * Sets the aggregateToTopk option. + * + * @param aggregateToTopk When true, aggregates approximate results to top-k. When false, returns the + * approximate results. The number of the approximate results is implementation + * defined and is greater equals to the specified {@code k}. + * @return this Options instance. + */ + public static Options aggregateToTopk(Boolean aggregateToTopk) { + return new Options().aggregateToTopk(aggregateToTopk); + } + + /** + * Gets values. + * The min/max k values along the {@code reduction_dimension} of the {@code input} operand. + * The dimension are the same as the {@code input} operand except for the + * {@code reduction_dimension}: when {@code aggregate_to_topk} is true, the reduction + * dimension is {@code k}; otherwise, it is greater equals to {@code k} where the size is + * implementation-defined. + * @return values. + */ + public Output values() { + return values; + } + + /** + * Gets indices. + * The indices of {@code values} along the {@code reduction_dimension} of the {@code input} operand. + * @return indices. + */ + public Output indices() { + return indices; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.ApproxTopK} + */ + public static class Options { + private Long reductionDimension; + + private Float recallTarget; + + private Boolean isMaxK; + + private Long reductionInputSizeOverride; + + private Boolean aggregateToTopk; + + private Options() { + } + + /** + * Sets the reductionDimension option. + * + * @param reductionDimension Integer dimension along which to search. Default: -1. + * @return this Options instance. + */ + public Options reductionDimension(Long reductionDimension) { + this.reductionDimension = reductionDimension; + return this; + } + + /** + * Sets the recallTarget option. + * + * @param recallTarget Recall target for the approximation. Range in (0,1] + * @return this Options instance. + */ + public Options recallTarget(Float recallTarget) { + this.recallTarget = recallTarget; + return this; + } + + /** + * Sets the isMaxK option. + * + * @param isMaxK When true, computes max-k; otherwise computes min-k. + * @return this Options instance. + */ + public Options isMaxK(Boolean isMaxK) { + this.isMaxK = isMaxK; + return this; + } + + /** + * Sets the reductionInputSizeOverride option. + * + * @param reductionInputSizeOverride When set to a positive value, it overrides the size determined by + * {@code input[reduction_dim]} for evaluating the recall. This option is useful when + * the given {@code input} is only a subset of the overall computation in SPMD or + * distributed pipelines, where the true input size cannot be deferred by the + * {@code input} shape. + * @return this Options instance. + */ + public Options reductionInputSizeOverride(Long reductionInputSizeOverride) { + this.reductionInputSizeOverride = reductionInputSizeOverride; + return this; + } + + /** + * Sets the aggregateToTopk option. + * + * @param aggregateToTopk When true, aggregates approximate results to top-k. When false, returns the + * approximate results. The number of the approximate results is implementation + * defined and is greater equals to the specified {@code k}. + * @return this Options instance. + */ + public Options aggregateToTopk(Boolean aggregateToTopk) { + this.aggregateToTopk = aggregateToTopk; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ApproxTopK.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Array to search. Must be at least 1-D of the floating type + */ + public final Operand input; + + /** + * Specifies the number of min/max-k. + */ + public final long k; + + /** + * Integer dimension along which to search. Default: -1. + */ + public final long reductionDimension; + + /** + * Recall target for the approximation. Range in (0,1] + */ + public final float recallTarget; + + /** + * When true, computes max-k; otherwise computes min-k. + */ + public final boolean isMaxK; + + /** + * When set to a positive value, it overrides the size determined by + * {@code input[reduction_dim]} for evaluating the recall. This option is useful when + * the given {@code input} is only a subset of the overall computation in SPMD or + * distributed pipelines, where the true input size cannot be deferred by the + * {@code input} shape. + */ + public final long reductionInputSizeOverride; + + /** + * When true, aggregates approximate results to top-k. When false, returns the + * approximate results. The number of the approximate results is implementation + * defined and is greater equals to the specified {@code k}. + */ + public final boolean aggregateToTopk; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ApproxTopK<>(op), op, Arrays.asList("k", "reduction_dimension", "recall_target", "is_max_k", "reduction_input_size_override", "aggregate_to_topk", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = op.attributes().getAttrInt("k"); + reductionDimension = op.attributes().getAttrInt("reduction_dimension"); + recallTarget = op.attributes().getAttrFloat("recall_target"); + isMaxK = op.attributes().getAttrBool("is_max_k"); + reductionInputSizeOverride = op.attributes().getAttrInt("reduction_input_size_override"); + aggregateToTopk = op.attributes().getAttrBool("aggregate_to_topk"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java index 58afa56676c..a2ede8e9cc8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; /** @@ -32,6 +38,10 @@ * If {@code condition} evaluates to false, print the list of tensors in {@code data}. * {@code summarize} determines how many entries of the tensors to print. */ +@OpMetadata( + opType = AssertThat.OP_NAME, + inputsClass = AssertThat.Inputs.class +) @Operator public final class AssertThat extends RawOp { /** @@ -39,8 +49,8 @@ public final class AssertThat extends RawOp { */ public static final String OP_NAME = "Assert"; - private AssertThat(Operation operation) { - super(operation); + public AssertThat(Operation operation) { + super(operation, OP_NAME); } /** @@ -100,4 +110,40 @@ public Options summarize(Long summarize) { return this; } } + + @OpInputsMetadata( + outputsClass = AssertThat.class + ) + public static class Inputs extends RawOpInputs { + /** + * The condition to evaluate. + */ + public final Operand condition; + + /** + * The tensors to print out when condition is false. + */ + public final Iterable> data; + + /** + * The T attribute + */ + public final DataType[] T; + + /** + * Print this many entries of each tensor. + */ + public final long summarize; + + public Inputs(GraphOperation op) { + super(new AssertThat(op), op, Arrays.asList("T", "summarize")); + int inputIndex = 0; + condition = (Operand) op.input(inputIndex++); + int dataLength = op.inputListLength("data"); + data = Arrays.asList((Operand[]) op.inputList(inputIndex, dataLength)); + inputIndex += dataLength; + T = op.attributes().getAttrTypeList("T"); + summarize = op.attributes().getAttrInt("summarize"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java index 4ad9ca40e03..e49f3eafacc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update 'ref' by assigning 'value' to it. * This operation outputs "ref" after the assignment is done. * This makes it easier to chain operations that need to use the reset value. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = Assign.OP_NAME, + inputsClass = Assign.Inputs.class +) @Operator public final class Assign extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class Assign extends RawOp implements Operand { private Output outputRef; - private Assign(Operation operation) { - super(operation); + public Assign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -154,4 +162,47 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = Assign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. May be uninitialized. + */ + public final Operand ref; + + /** + * The value to be assigned to the variable. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the operation will validate that the shape + * of 'value' matches the shape of the Tensor being assigned to. If false, + * 'ref' will take on the shape of 'value'. + */ + public final boolean validateShape; + + /** + * If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new Assign<>(op), op, Arrays.asList("T", "validate_shape", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + validateShape = op.attributes().getAttrBool("validate_shape"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java index fd8b3bcc793..848231d569a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update 'ref' by adding 'value' to it. * This operation outputs "ref" after the update is done. * This makes it easier to chain operations that need to use the reset value. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = AssignAdd.OP_NAME, + inputsClass = AssignAdd.Inputs.class +) @Operator public final class AssignAdd extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class AssignAdd extends RawOp implements Operand outputRef; - private AssignAdd(Operation operation) { - super(operation); + public AssignAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -124,4 +132,39 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = AssignAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * The value to be added to the variable. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new AssignAdd<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java index 10e0c5cd327..1b0fb994278 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * Any ReadVariableOp with a control dependency on this op is guaranteed to * see the incremented value or a subsequent newer one. */ +@OpMetadata( + opType = AssignAddVariableOp.OP_NAME, + inputsClass = AssignAddVariableOp.Inputs.class +) @Operator public final class AssignAddVariableOp extends RawOp { /** @@ -38,8 +48,8 @@ public final class AssignAddVariableOp extends RawOp { */ public static final String OP_NAME = "AssignAddVariableOp"; - private AssignAddVariableOp(Operation operation) { - super(operation); + public AssignAddVariableOp(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +70,32 @@ public static AssignAddVariableOp create(Scope scope, Operand r opBuilder.addInput(value.asOutput()); return new AssignAddVariableOp(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = AssignAddVariableOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * handle to the resource in which to store the variable. + */ + public final Operand resource; + + /** + * the value by which the variable will be incremented. + */ + public final Operand value; + + /** + * the dtype of the value. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new AssignAddVariableOp(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java index dbba967ad2f..cc96d634945 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update 'ref' by subtracting 'value' from it. * This operation outputs "ref" after the update is done. * This makes it easier to chain operations that need to use the reset value. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = AssignSub.OP_NAME, + inputsClass = AssignSub.Inputs.class +) @Operator public final class AssignSub extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class AssignSub extends RawOp implements Operand outputRef; - private AssignSub(Operation operation) { - super(operation); + public AssignSub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -124,4 +132,39 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = AssignSub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * The value to be subtracted to the variable. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new AssignSub<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java index 2821427195c..e5a22f772e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * Any ReadVariableOp with a control dependency on this op is guaranteed to * see the decremented value or a subsequent newer one. */ +@OpMetadata( + opType = AssignSubVariableOp.OP_NAME, + inputsClass = AssignSubVariableOp.Inputs.class +) @Operator public final class AssignSubVariableOp extends RawOp { /** @@ -38,8 +48,8 @@ public final class AssignSubVariableOp extends RawOp { */ public static final String OP_NAME = "AssignSubVariableOp"; - private AssignSubVariableOp(Operation operation) { - super(operation); + public AssignSubVariableOp(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +70,32 @@ public static AssignSubVariableOp create(Scope scope, Operand r opBuilder.addInput(value.asOutput()); return new AssignSubVariableOp(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = AssignSubVariableOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * handle to the resource in which to store the variable. + */ + public final Operand resource; + + /** + * the value by which the variable will be incremented. + */ + public final Operand value; + + /** + * the dtype of the value. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new AssignSubVariableOp(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java index a8d89c838c9..19672d6db42 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * Any ReadVariableOp with a control dependency on this op is guaranteed to return * this value or a subsequent newer value of the variable. */ +@OpMetadata( + opType = AssignVariableOp.OP_NAME, + inputsClass = AssignVariableOp.Inputs.class +) @Operator public final class AssignVariableOp extends RawOp { /** @@ -38,8 +48,8 @@ public final class AssignVariableOp extends RawOp { */ public static final String OP_NAME = "AssignVariableOp"; - private AssignVariableOp(Operation operation) { - super(operation); + public AssignVariableOp(Operation operation) { + super(operation, OP_NAME); } /** @@ -48,16 +58,89 @@ private AssignVariableOp(Operation operation) { * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value to set the new tensor to use. + * @param options carries optional attribute values * @return a new instance of AssignVariableOp */ @Endpoint( describeByClass = true ) public static AssignVariableOp create(Scope scope, Operand resource, - Operand value) { + Operand value, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignVariableOp"); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.validateShape != null) { + opBuilder.setAttr("validate_shape", opts.validateShape); + } + } + } return new AssignVariableOp(opBuilder.build()); } + + /** + * Sets the validateShape option. + * + * @param validateShape the validateShape option + * @return this Options instance. + */ + public static Options validateShape(Boolean validateShape) { + return new Options().validateShape(validateShape); + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssignVariableOp} + */ + public static class Options { + private Boolean validateShape; + + private Options() { + } + + /** + * Sets the validateShape option. + * + * @param validateShape the validateShape option + * @return this Options instance. + */ + public Options validateShape(Boolean validateShape) { + this.validateShape = validateShape; + return this; + } + } + + @OpInputsMetadata( + outputsClass = AssignVariableOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * handle to the resource in which to store the variable. + */ + public final Operand resource; + + /** + * the value to set the new tensor to use. + */ + public final Operand value; + + /** + * the dtype of the value. + */ + public final DataType dtype; + + /** + * The validateShape attribute + */ + public final boolean validateShape; + + public Inputs(GraphOperation op) { + super(new AssignVariableOp(op), op, Arrays.asList("dtype", "validate_shape")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + validateShape = op.attributes().getAttrBool("validate_shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java index eb042cce417..114a98f2020 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -42,6 +47,10 @@ * incomplete element has some undefined components in its value tuple, * and may be updated using BarrierInsertMany. */ +@OpMetadata( + opType = Barrier.OP_NAME, + inputsClass = Barrier.Inputs.class +) @Operator public final class Barrier extends RawOp implements Operand { /** @@ -51,8 +60,8 @@ public final class Barrier extends RawOp implements Operand { private Output handle; - private Barrier(Operation operation) { - super(operation); + public Barrier(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -115,7 +124,7 @@ public static Options shapes(List shapes) { * component_types. * @return this Options instance. */ - public static Options shapes(Shape[] shapes) { + public static Options shapes(Shape... shapes) { return new Options().shapes(shapes); } @@ -243,4 +252,49 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Barrier.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * The shape of each component in a value. Each shape must be 1 in the + * first dimension. The length of this attr must be the same as the length of + * component_types. + */ + public final Shape[] shapes; + + /** + * The capacity of the barrier. The default capacity is MAX_INT32, + * which is the largest capacity of the underlying queue. + */ + public final long capacity; + + /** + * If non-empty, this barrier is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this barrier will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new Barrier(op), op, Arrays.asList("component_types", "shapes", "capacity", "container", "shared_name")); + int inputIndex = 0; + componentTypes = op.attributes().getAttrTypeList("component_types"); + shapes = op.attributes().getAttrShapeList("shapes"); + capacity = op.attributes().getAttrInt("capacity"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java index 6d2a912722c..3cd742dbc36 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -35,6 +40,10 @@ * continue to succeed if sufficient completed elements remain in the barrier. * Subsequent TakeMany operations that would block will fail immediately. */ +@OpMetadata( + opType = BarrierClose.OP_NAME, + inputsClass = BarrierClose.Inputs.class +) @Operator public final class BarrierClose extends RawOp { /** @@ -42,8 +51,8 @@ public final class BarrierClose extends RawOp { */ public static final String OP_NAME = "BarrierClose"; - private BarrierClose(Operation operation) { - super(operation); + public BarrierClose(Operation operation) { + super(operation, OP_NAME); } /** @@ -104,4 +113,28 @@ public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return this; } } + + @OpInputsMetadata( + outputsClass = BarrierClose.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a barrier. + */ + public final Operand handle; + + /** + * If true, all pending enqueue requests that are + * blocked on the barrier's queue will be canceled. InsertMany will fail, even + * if no new key is introduced. + */ + public final boolean cancelPendingEnqueues; + + public Inputs(GraphOperation op) { + super(new BarrierClose(op), op, Arrays.asList("cancel_pending_enqueues")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + cancelPendingEnqueues = op.attributes().getAttrBool("cancel_pending_enqueues"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java index 4b4e7f1f3e5..3e3525b4731 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -31,6 +36,10 @@ /** * Computes the number of incomplete elements in the given barrier. */ +@OpMetadata( + opType = BarrierIncompleteSize.OP_NAME, + inputsClass = BarrierIncompleteSize.Inputs.class +) @Operator public final class BarrierIncompleteSize extends RawOp implements Operand { /** @@ -40,8 +49,8 @@ public final class BarrierIncompleteSize extends RawOp implements Operand output; - private BarrierIncompleteSize(Operation operation) { - super(operation); + public BarrierIncompleteSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +85,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BarrierIncompleteSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a barrier. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new BarrierIncompleteSize(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java index 371cc0b7c16..f21f9b16411 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ * already has a value at component_index, this operation will fail with * INVALID_ARGUMENT, and leave the barrier in an undefined state. */ +@OpMetadata( + opType = BarrierInsertMany.OP_NAME, + inputsClass = BarrierInsertMany.Inputs.class +) @Operator public final class BarrierInsertMany extends RawOp { /** @@ -41,8 +51,8 @@ public final class BarrierInsertMany extends RawOp { */ public static final String OP_NAME = "BarrierInsertMany"; - private BarrierInsertMany(Operation operation) { - super(operation); + public BarrierInsertMany(Operation operation) { + super(operation, OP_NAME); } /** @@ -68,4 +78,45 @@ public static BarrierInsertMany create(Scope scope, Operand handle, opBuilder.setAttr("component_index", componentIndex); return new BarrierInsertMany(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = BarrierInsertMany.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a barrier. + */ + public final Operand handle; + + /** + * A one-dimensional tensor of keys, with length n. + */ + public final Operand keys; + + /** + * An any-dimensional tensor of values, which are associated with the + * respective keys. The 0th dimension must have length n. + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The component of the barrier elements that is being assigned. + */ + public final long componentIndex; + + public Inputs(GraphOperation op) { + super(new BarrierInsertMany(op), op, Arrays.asList("T", "component_index")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + componentIndex = op.attributes().getAttrInt("component_index"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java index df7cf5cc40e..7f699b2b2e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -31,6 +36,10 @@ /** * Computes the number of complete elements in the given barrier. */ +@OpMetadata( + opType = BarrierReadySize.OP_NAME, + inputsClass = BarrierReadySize.Inputs.class +) @Operator public final class BarrierReadySize extends RawOp implements Operand { /** @@ -40,8 +49,8 @@ public final class BarrierReadySize extends RawOp implements Operand { private Output output; - private BarrierReadySize(Operation operation) { - super(operation); + public BarrierReadySize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +85,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BarrierReadySize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a barrier. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new BarrierReadySize(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java index 72ee2fcc356..307b4087091 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,15 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -42,6 +47,10 @@ * information about the batch in which each element was originally inserted * into the barrier. */ +@OpMetadata( + opType = BarrierTakeMany.OP_NAME, + inputsClass = BarrierTakeMany.Inputs.class +) @Operator public final class BarrierTakeMany extends RawOp { /** @@ -56,8 +65,8 @@ public final class BarrierTakeMany extends RawOp { private List> values; @SuppressWarnings("unchecked") - private BarrierTakeMany(Operation operation) { - super(operation); + public BarrierTakeMany(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; indices = operation.output(outputIdx++); keys = operation.output(outputIdx++); @@ -215,4 +224,54 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = BarrierTakeMany.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a barrier. + */ + public final Operand handle; + + /** + * A single-element tensor containing the number of elements to + * take. + */ + public final Operand numElements; + + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * Allow to return less than num_elements items if barrier is + * already closed. + */ + public final boolean allowSmallBatch; + + /** + * The waitForIncomplete attribute + */ + public final boolean waitForIncomplete; + + /** + * If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new BarrierTakeMany(op), op, Arrays.asList("component_types", "allow_small_batch", "wait_for_incomplete", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + numElements = (Operand) op.input(inputIndex++); + componentTypes = op.attributes().getAttrTypeList("component_types"); + allowSmallBatch = op.attributes().getAttrBool("allow_small_batch"); + waitForIncomplete = op.attributes().getAttrBool("wait_for_incomplete"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java index af01b21cadf..c6130676b8d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,15 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; /** @@ -64,6 +69,10 @@ * empty, the op name will be used as the shared name. * T: the types of tensors to be batched. */ +@OpMetadata( + opType = Batch.OP_NAME, + inputsClass = Batch.Inputs.class +) @Operator public final class Batch extends RawOp { /** @@ -78,8 +87,8 @@ public final class Batch extends RawOp { private Output id; @SuppressWarnings("unchecked") - private Batch(Operation operation) { - super(operation); + public Batch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int batchedTensorsLength = operation.outputListLength("batched_tensors"); batchedTensors = Arrays.asList(operation.outputList(outputIdx, batchedTensorsLength)); @@ -92,11 +101,11 @@ private Batch(Operation operation) { * Factory method to create a class wrapping a new Batch operation. * * @param scope current scope - * @param inTensors the inTensors value - * @param numBatchThreads the value of the numBatchThreads property - * @param maxBatchSize the value of the maxBatchSize property - * @param batchTimeoutMicros the value of the batchTimeoutMicros property - * @param gradTimeoutMicros the value of the gradTimeoutMicros property + * @param inTensors The inTensors value + * @param numBatchThreads The value of the numBatchThreads attribute + * @param maxBatchSize The value of the maxBatchSize attribute + * @param batchTimeoutMicros The value of the batchTimeoutMicros attribute + * @param gradTimeoutMicros The value of the gradTimeoutMicros attribute * @param options carries optional attribute values * @return a new instance of Batch */ @@ -163,7 +172,7 @@ public static Options allowedBatchSizes(List allowedBatchSizes) { * @param allowedBatchSizes the allowedBatchSizes option * @return this Options instance. */ - public static Options allowedBatchSizes(Long[] allowedBatchSizes) { + public static Options allowedBatchSizes(Long... allowedBatchSizes) { return new Options().allowedBatchSizes(allowedBatchSizes); } @@ -307,4 +316,82 @@ public Options batchingQueue(String batchingQueue) { return this; } } + + @OpInputsMetadata( + outputsClass = Batch.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inTensors input + */ + public final Iterable> inTensors; + + /** + * The numBatchThreads attribute + */ + public final long numBatchThreads; + + /** + * The maxBatchSize attribute + */ + public final long maxBatchSize; + + /** + * The maxEnqueuedBatches attribute + */ + public final long maxEnqueuedBatches; + + /** + * The batchTimeoutMicros attribute + */ + public final long batchTimeoutMicros; + + /** + * The allowedBatchSizes attribute + */ + public final long[] allowedBatchSizes; + + /** + * The gradTimeoutMicros attribute + */ + public final long gradTimeoutMicros; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + /** + * The batchingQueue attribute + */ + public final String batchingQueue; + + /** + * The T attribute + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new Batch(op), op, Arrays.asList("num_batch_threads", "max_batch_size", "max_enqueued_batches", "batch_timeout_micros", "allowed_batch_sizes", "grad_timeout_micros", "container", "shared_name", "batching_queue", "T")); + int inputIndex = 0; + int inTensorsLength = op.inputListLength("in_tensors"); + inTensors = Arrays.asList((Operand[]) op.inputList(inputIndex, inTensorsLength)); + inputIndex += inTensorsLength; + numBatchThreads = op.attributes().getAttrInt("num_batch_threads"); + maxBatchSize = op.attributes().getAttrInt("max_batch_size"); + maxEnqueuedBatches = op.attributes().getAttrInt("max_enqueued_batches"); + batchTimeoutMicros = op.attributes().getAttrInt("batch_timeout_micros"); + allowedBatchSizes = op.attributes().getAttrIntList("allowed_batch_sizes"); + gradTimeoutMicros = op.attributes().getAttrInt("grad_timeout_micros"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + batchingQueue = op.attributes().getAttrString("batching_queue"); + T = op.attributes().getAttrTypeList("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchFunction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchFunction.java index f59367caae1..577f213f47d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchFunction.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchFunction.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,15 +21,20 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -67,6 +72,10 @@ *

    SparseTensor is not supported. The return value of the decorated function * must be a Tensor or a list/tuple of Tensors. */ +@OpMetadata( + opType = BatchFunction.OP_NAME, + inputsClass = BatchFunction.Inputs.class +) @Operator public final class BatchFunction extends RawOp implements Iterable> { /** @@ -77,8 +86,8 @@ public final class BatchFunction extends RawOp implements Iterable> outTensors; @SuppressWarnings("unchecked") - private BatchFunction(Operation operation) { - super(operation); + public BatchFunction(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outTensorsLength = operation.outputListLength("out_tensors"); outTensors = Arrays.asList(operation.outputList(outputIdx, outTensorsLength)); @@ -92,7 +101,7 @@ private BatchFunction(Operation operation) { * @param inTensors The tensors to be batched. * @param capturedTensors The tensors which are captured in the function, and don't need * to be batched. - * @param f the value of the f property + * @param f The value of the f attribute * @param numBatchThreads Number of scheduling threads for processing batches of work. * Determines the number of batches processed in parallel. * @param maxBatchSize Batch sizes will never be bigger than this. @@ -138,6 +147,28 @@ public static BatchFunction create(Scope scope, Iterable> inTensors, if (opts.batchingQueue != null) { opBuilder.setAttr("batching_queue", opts.batchingQueue); } + if (opts.lowPriorityMaxBatchSize != null) { + opBuilder.setAttr("low_priority_max_batch_size", opts.lowPriorityMaxBatchSize); + } + if (opts.lowPriorityBatchTimeoutMicros != null) { + opBuilder.setAttr("low_priority_batch_timeout_micros", opts.lowPriorityBatchTimeoutMicros); + } + if (opts.lowPriorityAllowedBatchSizes != null) { + long[] lowPriorityAllowedBatchSizesArray = new long[opts.lowPriorityAllowedBatchSizes.size()]; + for (int i = 0 ; i < lowPriorityAllowedBatchSizesArray.length ; i++) { + lowPriorityAllowedBatchSizesArray[i] = opts.lowPriorityAllowedBatchSizes.get(i); + } + opBuilder.setAttr("low_priority_allowed_batch_sizes", lowPriorityAllowedBatchSizesArray); + } + if (opts.lowPriorityMaxEnqueuedBatches != null) { + opBuilder.setAttr("low_priority_max_enqueued_batches", opts.lowPriorityMaxEnqueuedBatches); + } + if (opts.mixedPriorityPolicy != null) { + opBuilder.setAttr("mixed_priority_policy", opts.mixedPriorityPolicy); + } + if (opts.batchPaddingPolicy != null) { + opBuilder.setAttr("batch_padding_policy", opts.batchPaddingPolicy); + } if (opts.enableLargeBatchSplitting != null) { opBuilder.setAttr("enable_large_batch_splitting", opts.enableLargeBatchSplitting); } @@ -180,7 +211,7 @@ public static Options allowedBatchSizes(List allowedBatchSizes) { * enabled) the final entry must equal max_batch_size. * @return this Options instance. */ - public static Options allowedBatchSizes(Long[] allowedBatchSizes) { + public static Options allowedBatchSizes(Long... allowedBatchSizes) { return new Options().allowedBatchSizes(allowedBatchSizes); } @@ -216,6 +247,76 @@ public static Options batchingQueue(String batchingQueue) { return new Options().batchingQueue(batchingQueue); } + /** + * Sets the lowPriorityMaxBatchSize option. + * + * @param lowPriorityMaxBatchSize the lowPriorityMaxBatchSize option + * @return this Options instance. + */ + public static Options lowPriorityMaxBatchSize(Long lowPriorityMaxBatchSize) { + return new Options().lowPriorityMaxBatchSize(lowPriorityMaxBatchSize); + } + + /** + * Sets the lowPriorityBatchTimeoutMicros option. + * + * @param lowPriorityBatchTimeoutMicros the lowPriorityBatchTimeoutMicros option + * @return this Options instance. + */ + public static Options lowPriorityBatchTimeoutMicros(Long lowPriorityBatchTimeoutMicros) { + return new Options().lowPriorityBatchTimeoutMicros(lowPriorityBatchTimeoutMicros); + } + + /** + * Sets the lowPriorityAllowedBatchSizes option. + * + * @param lowPriorityAllowedBatchSizes the lowPriorityAllowedBatchSizes option + * @return this Options instance. + */ + public static Options lowPriorityAllowedBatchSizes(List lowPriorityAllowedBatchSizes) { + return new Options().lowPriorityAllowedBatchSizes(lowPriorityAllowedBatchSizes); + } + + /** + * Sets the lowPriorityAllowedBatchSizes option. + * + * @param lowPriorityAllowedBatchSizes the lowPriorityAllowedBatchSizes option + * @return this Options instance. + */ + public static Options lowPriorityAllowedBatchSizes(Long... lowPriorityAllowedBatchSizes) { + return new Options().lowPriorityAllowedBatchSizes(lowPriorityAllowedBatchSizes); + } + + /** + * Sets the lowPriorityMaxEnqueuedBatches option. + * + * @param lowPriorityMaxEnqueuedBatches the lowPriorityMaxEnqueuedBatches option + * @return this Options instance. + */ + public static Options lowPriorityMaxEnqueuedBatches(Long lowPriorityMaxEnqueuedBatches) { + return new Options().lowPriorityMaxEnqueuedBatches(lowPriorityMaxEnqueuedBatches); + } + + /** + * Sets the mixedPriorityPolicy option. + * + * @param mixedPriorityPolicy the mixedPriorityPolicy option + * @return this Options instance. + */ + public static Options mixedPriorityPolicy(String mixedPriorityPolicy) { + return new Options().mixedPriorityPolicy(mixedPriorityPolicy); + } + + /** + * Sets the batchPaddingPolicy option. + * + * @param batchPaddingPolicy the batchPaddingPolicy option + * @return this Options instance. + */ + public static Options batchPaddingPolicy(String batchPaddingPolicy) { + return new Options().batchPaddingPolicy(batchPaddingPolicy); + } + /** * Sets the enableLargeBatchSplitting option. * @@ -256,6 +357,18 @@ public static class Options { private String batchingQueue; + private Long lowPriorityMaxBatchSize; + + private Long lowPriorityBatchTimeoutMicros; + + private List lowPriorityAllowedBatchSizes; + + private Long lowPriorityMaxEnqueuedBatches; + + private String mixedPriorityPolicy; + + private String batchPaddingPolicy; + private Boolean enableLargeBatchSplitting; private Options() { @@ -337,6 +450,83 @@ public Options batchingQueue(String batchingQueue) { return this; } + /** + * Sets the lowPriorityMaxBatchSize option. + * + * @param lowPriorityMaxBatchSize the lowPriorityMaxBatchSize option + * @return this Options instance. + */ + public Options lowPriorityMaxBatchSize(Long lowPriorityMaxBatchSize) { + this.lowPriorityMaxBatchSize = lowPriorityMaxBatchSize; + return this; + } + + /** + * Sets the lowPriorityBatchTimeoutMicros option. + * + * @param lowPriorityBatchTimeoutMicros the lowPriorityBatchTimeoutMicros option + * @return this Options instance. + */ + public Options lowPriorityBatchTimeoutMicros(Long lowPriorityBatchTimeoutMicros) { + this.lowPriorityBatchTimeoutMicros = lowPriorityBatchTimeoutMicros; + return this; + } + + /** + * Sets the lowPriorityAllowedBatchSizes option. + * + * @param lowPriorityAllowedBatchSizes the lowPriorityAllowedBatchSizes option + * @return this Options instance. + */ + public Options lowPriorityAllowedBatchSizes(List lowPriorityAllowedBatchSizes) { + this.lowPriorityAllowedBatchSizes = lowPriorityAllowedBatchSizes; + return this; + } + + /** + * Sets the lowPriorityAllowedBatchSizes option. + * + * @param lowPriorityAllowedBatchSizes the lowPriorityAllowedBatchSizes option + * @return this Options instance. + */ + public Options lowPriorityAllowedBatchSizes(Long... lowPriorityAllowedBatchSizes) { + this.lowPriorityAllowedBatchSizes = Arrays.asList(lowPriorityAllowedBatchSizes); + return this; + } + + /** + * Sets the lowPriorityMaxEnqueuedBatches option. + * + * @param lowPriorityMaxEnqueuedBatches the lowPriorityMaxEnqueuedBatches option + * @return this Options instance. + */ + public Options lowPriorityMaxEnqueuedBatches(Long lowPriorityMaxEnqueuedBatches) { + this.lowPriorityMaxEnqueuedBatches = lowPriorityMaxEnqueuedBatches; + return this; + } + + /** + * Sets the mixedPriorityPolicy option. + * + * @param mixedPriorityPolicy the mixedPriorityPolicy option + * @return this Options instance. + */ + public Options mixedPriorityPolicy(String mixedPriorityPolicy) { + this.mixedPriorityPolicy = mixedPriorityPolicy; + return this; + } + + /** + * Sets the batchPaddingPolicy option. + * + * @param batchPaddingPolicy the batchPaddingPolicy option + * @return this Options instance. + */ + public Options batchPaddingPolicy(String batchPaddingPolicy) { + this.batchPaddingPolicy = batchPaddingPolicy; + return this; + } + /** * Sets the enableLargeBatchSplitting option. * @@ -349,4 +539,148 @@ public Options enableLargeBatchSplitting(Boolean enableLargeBatchSplitting) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchFunction.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensors to be batched. + */ + public final Iterable> inTensors; + + /** + * The tensors which are captured in the function, and don't need + * to be batched. + */ + public final Iterable> capturedTensors; + + /** + * Number of scheduling threads for processing batches of work. + * Determines the number of batches processed in parallel. + */ + public final long numBatchThreads; + + /** + * Batch sizes will never be bigger than this. + */ + public final long maxBatchSize; + + /** + * Maximum number of microseconds to wait before outputting + * an incomplete batch. + */ + public final long batchTimeoutMicros; + + /** + * Maximum number of batches enqueued. Default: 10. + */ + public final long maxEnqueuedBatches; + + /** + * Optional list of allowed batch sizes. If left empty, does + * nothing. Otherwise, supplies a list of batch sizes, causing the op to pad + * batches up to one of those sizes. The entries must increase monotonically. + * If enable_large_batch_splitting is false (i.e., large-input-split is not + * enabled) the final entry must equal max_batch_size. + */ + public final long[] allowedBatchSizes; + + /** + * Controls the scope of sharing of this batch. + */ + public final String container; + + /** + * Concurrently running instances of batch in the same device with the + * same container and shared_name will batch their elements together. If left + * empty, the op name will be used as the shared name. + */ + public final String sharedName; + + /** + * The batchingQueue attribute + */ + public final String batchingQueue; + + /** + * The lowPriorityMaxBatchSize attribute + */ + public final long lowPriorityMaxBatchSize; + + /** + * The lowPriorityBatchTimeoutMicros attribute + */ + public final long lowPriorityBatchTimeoutMicros; + + /** + * The lowPriorityAllowedBatchSizes attribute + */ + public final long[] lowPriorityAllowedBatchSizes; + + /** + * The lowPriorityMaxEnqueuedBatches attribute + */ + public final long lowPriorityMaxEnqueuedBatches; + + /** + * The mixedPriorityPolicy attribute + */ + public final String mixedPriorityPolicy; + + /** + * The batchPaddingPolicy attribute + */ + public final String batchPaddingPolicy; + + /** + * the types of tensors to be batched. + */ + public final DataType[] Tin; + + /** + * the types of the captured tensors. + */ + public final DataType[] Tcaptured; + + /** + * the types of the output tensors. + */ + public final DataType[] Tout; + + /** + * input with a large size (i.e., larger than the largest value of + * {@code allowed_batch_sizes}) will be splitted into multiple batches with batch size. + */ + public final boolean enableLargeBatchSplitting; + + public Inputs(GraphOperation op) { + super(new BatchFunction(op), op, Arrays.asList("num_batch_threads", "max_batch_size", "batch_timeout_micros", "max_enqueued_batches", "allowed_batch_sizes", "container", "shared_name", "batching_queue", "low_priority_max_batch_size", "low_priority_batch_timeout_micros", "low_priority_allowed_batch_sizes", "low_priority_max_enqueued_batches", "mixed_priority_policy", "batch_padding_policy", "Tin", "Tcaptured", "Tout", "enable_large_batch_splitting")); + int inputIndex = 0; + int inTensorsLength = op.inputListLength("in_tensors"); + inTensors = Arrays.asList((Operand[]) op.inputList(inputIndex, inTensorsLength)); + inputIndex += inTensorsLength; + int capturedTensorsLength = op.inputListLength("captured_tensors"); + capturedTensors = Arrays.asList((Operand[]) op.inputList(inputIndex, capturedTensorsLength)); + inputIndex += capturedTensorsLength; + numBatchThreads = op.attributes().getAttrInt("num_batch_threads"); + maxBatchSize = op.attributes().getAttrInt("max_batch_size"); + batchTimeoutMicros = op.attributes().getAttrInt("batch_timeout_micros"); + maxEnqueuedBatches = op.attributes().getAttrInt("max_enqueued_batches"); + allowedBatchSizes = op.attributes().getAttrIntList("allowed_batch_sizes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + batchingQueue = op.attributes().getAttrString("batching_queue"); + lowPriorityMaxBatchSize = op.attributes().getAttrInt("low_priority_max_batch_size"); + lowPriorityBatchTimeoutMicros = op.attributes().getAttrInt("low_priority_batch_timeout_micros"); + lowPriorityAllowedBatchSizes = op.attributes().getAttrIntList("low_priority_allowed_batch_sizes"); + lowPriorityMaxEnqueuedBatches = op.attributes().getAttrInt("low_priority_max_enqueued_batches"); + mixedPriorityPolicy = op.attributes().getAttrString("mixed_priority_policy"); + batchPaddingPolicy = op.attributes().getAttrString("batch_padding_policy"); + Tin = op.attributes().getAttrTypeList("Tin"); + Tcaptured = op.attributes().getAttrTypeList("Tcaptured"); + Tout = op.attributes().getAttrTypeList("Tout"); + enableLargeBatchSplitting = op.attributes().getAttrBool("enable_large_batch_splitting"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java index b465736a7d7..09fa1d49bcb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ * this op outputs a copy of the input tensor where values from the {@code batch} * dimension are moved in spatial blocks to the {@code height} and {@code width} dimensions, * followed by cropping along the {@code height} and {@code width} dimensions. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchToSpace.OP_NAME, + inputsClass = BatchToSpace.Inputs.class +) @Operator public final class BatchToSpace extends RawOp implements Operand { /** @@ -48,8 +56,8 @@ public final class BatchToSpace extends RawOp implements Operan private Output output; - private BatchToSpace(Operation operation) { - super(operation); + public BatchToSpace(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private BatchToSpace(Operation operation) { *

        * crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
        * 
    - * @param blockSize the value of the blockSize property + * @param blockSize The value of the blockSize attribute * @param data type for {@code BatchToSpace} output and operands * @return a new instance of BatchToSpace */ @@ -145,4 +153,51 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchToSpace.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D tensor with shape + * {@code [batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]}. Note that the batch size of the input tensor must be divisible by + * {@code block_size * block_size}. + */ + public final Operand input; + + /** + * 2-D tensor of non-negative integers with shape {@code [2, 2]}. It specifies + * how many elements to crop from the intermediate result across the spatial + * dimensions as follows: + *
    +     * crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
    +     * 
    + */ + public final Operand crops; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The blockSize attribute + */ + public final long blockSize; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new BatchToSpace<>(op), op, Arrays.asList("T", "block_size", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + crops = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + blockSize = op.attributes().getAttrInt("block_size"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java index 819550b066d..65a98188342 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ * the input. The spatial dimensions of this intermediate result are then * optionally cropped according to {@code crops} to produce the output. This is the * reverse of SpaceToBatch. See below for a precise description. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchToSpaceNd.OP_NAME, + inputsClass = BatchToSpaceNd.Inputs.class +) @Operator public final class BatchToSpaceNd extends RawOp implements Operand { /** @@ -48,8 +56,8 @@ public final class BatchToSpaceNd extends RawOp implements Oper private Output output; - private BatchToSpaceNd(Operation operation) { - super(operation); + public BatchToSpaceNd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -180,4 +188,141 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchToSpaceNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * N-D with shape {@code input_shape = [batch] + spatial_shape + remaining_shape}, + * where spatial_shape has M dimensions. + */ + public final Operand input; + + /** + * 1-D with shape {@code [M]}, all values must be >= 1. + */ + public final Operand blockShape; + + /** + * 2-D with shape {@code [M, 2]}, all values must be >= 0. + * {@code crops[i] = [crop_start, crop_end]} specifies the amount to crop from input + * dimension {@code i + 1}, which corresponds to spatial dimension {@code i}. It is + * required that + * {@code crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]}. + *

    This operation is equivalent to the following steps: + *

      + *
    1. + *

      Reshape {@code input} to {@code reshaped} of shape: + * [block_shape[0], ..., block_shape[M-1], + * batch / prod(block_shape), + * input_shape[1], ..., input_shape[N-1]] + *

    2. + *
    3. + *

      Permute dimensions of {@code reshaped} to produce {@code permuted} of shape + * [batch / prod(block_shape), + *

      input_shape[1], block_shape[0], + * ..., + * input_shape[M], block_shape[M-1], + *

      input_shape[M+1], ..., input_shape[N-1]] + *

    4. + *
    5. + *

      Reshape {@code permuted} to produce {@code reshaped_permuted} of shape + * [batch / prod(block_shape), + *

      input_shape[1] * block_shape[0], + * ..., + * input_shape[M] * block_shape[M-1], + *

      input_shape[M+1], + * ..., + * input_shape[N-1]] + *

    6. + *
    7. + *

      Crop the start and end of dimensions {@code [1, ..., M]} of + * {@code reshaped_permuted} according to {@code crops} to produce the output of shape: + * [batch / prod(block_shape), + *

      input_shape[1] * block_shape[0] - crops[0,0] - crops[0,1], + * ..., + * input_shape[M] * block_shape[M-1] - crops[M-1,0] - crops[M-1,1], + *

      input_shape[M+1], ..., input_shape[N-1]] + *

    8. + *
    + *

    Some examples: + *

    (1) For the following input of shape {@code [4, 1, 1, 1]}, {@code block_shape = [2, 2]}, and + * {@code crops = [[0, 0], [0, 0]]}: + *

    +     * [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
    +     * 
    + *

    The output tensor has shape {@code [1, 2, 2, 1]} and value: + *

    +     * x = [[[[1], [2]], [[3], [4]]]]
    +     * 
    + *

    (2) For the following input of shape {@code [4, 1, 1, 3]}, {@code block_shape = [2, 2]}, and + * {@code crops = [[0, 0], [0, 0]]}: + *

    +     * [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
    +     * 
    + *

    The output tensor has shape {@code [1, 2, 2, 3]} and value: + *

    +     * x = [[[[1, 2, 3], [4, 5, 6]],
    +     *       [[7, 8, 9], [10, 11, 12]]]]
    +     * 
    + *

    (3) For the following input of shape {@code [4, 2, 2, 1]}, {@code block_shape = [2, 2]}, and + * {@code crops = [[0, 0], [0, 0]]}: + *

    +     * x = [[[[1], [3]], [[9], [11]]],
    +     *      [[[2], [4]], [[10], [12]]],
    +     *      [[[5], [7]], [[13], [15]]],
    +     *      [[[6], [8]], [[14], [16]]]]
    +     * 
    + *

    The output tensor has shape {@code [1, 4, 4, 1]} and value: + *

    +     * x = [[[[1],   [2],  [3],  [4]],
    +     *      [[5],   [6],  [7],  [8]],
    +     *      [[9],  [10], [11],  [12]],
    +     *      [[13], [14], [15],  [16]]]]
    +     * 
    + *

    (4) For the following input of shape {@code [8, 1, 3, 1]}, {@code block_shape = [2, 2]}, and + * {@code crops = [[0, 0], [2, 0]]}: + *

    +     * x = [[[[0], [1], [3]]], [[[0], [9], [11]]],
    +     *      [[[0], [2], [4]]], [[[0], [10], [12]]],
    +     *      [[[0], [5], [7]]], [[[0], [13], [15]]],
    +     *      [[[0], [6], [8]]], [[[0], [14], [16]]]]
    +     * 
    + *

    The output tensor has shape {@code [2, 2, 4, 1]} and value: + *

    +     * x = [[[[1],   [2],  [3],  [4]],
    +     *       [[5],   [6],  [7],  [8]]],
    +     *      [[[9],  [10], [11],  [12]],
    +     *       [[13], [14], [15],  [16]]]]
    +     * 
    + */ + public final Operand crops; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The TblockShape attribute + */ + public final DataType TblockShape; + + /** + * The Tcrops attribute + */ + public final DataType Tcrops; + + public Inputs(GraphOperation op) { + super(new BatchToSpaceNd<>(op), op, Arrays.asList("T", "Tblock_shape", "Tcrops")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + blockShape = (Operand) op.input(inputIndex++); + crops = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + TblockShape = op.attributes().getAttrType("Tblock_shape"); + Tcrops = op.attributes().getAttrType("Tcrops"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java index 027d11b822f..82a2a99d295 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -87,10 +93,14 @@ * * *

    NOTE: Bitcast is implemented as a low-level cast, so machines with different - * endian orderings will give different results. - * - * @param data type for {@code output} output + * endian orderings will give different results. A copy from input buffer to output + * buffer is made on BE machines when types are of different sizes in order to get + * the same casting results as on LE machines. */ +@OpMetadata( + opType = Bitcast.OP_NAME, + inputsClass = Bitcast.Inputs.class +) @Operator public final class Bitcast extends RawOp implements Operand { /** @@ -100,8 +110,8 @@ public final class Bitcast extends RawOp implements Operand private Output output; - private Bitcast(Operation operation) { - super(operation); + public Bitcast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -110,8 +120,8 @@ private Bitcast(Operation operation) { * Factory method to create a class wrapping a new Bitcast operation. * * @param scope current scope - * @param input the input value - * @param type the value of the type property + * @param input The input value + * @param type The value of the type attribute * @param data type for {@code Bitcast} output and operands * @return a new instance of Bitcast */ @@ -139,4 +149,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Bitcast.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new Bitcast<>(op), op, Arrays.asList("T", "type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java index 850d7db1a2f..165e7e12b9a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Return the shape of s0 op s1 with broadcast. * Given {@code s0} and {@code s1}, tensors that represent shapes, compute {@code r0}, the * broadcasted shape. {@code s0}, {@code s1} and {@code r0} are all integer vectors. - * - * @param data type for {@code r0} output */ +@OpMetadata( + opType = BroadcastDynamicShape.OP_NAME, + inputsClass = BroadcastDynamicShape.Inputs.class +) @Operator public final class BroadcastDynamicShape extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class BroadcastDynamicShape extends RawOp implem private Output r0; - private BroadcastDynamicShape(Operation operation) { - super(operation); + public BroadcastDynamicShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; r0 = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private BroadcastDynamicShape(Operation operation) { * Factory method to create a class wrapping a new BroadcastArgs operation. * * @param scope current scope - * @param s0 the s0 value - * @param s1 the s1 value + * @param s0 The s0 value + * @param s1 The s1 value * @param data type for {@code BroadcastArgs} output and operands * @return a new instance of BroadcastDynamicShape */ @@ -82,4 +90,32 @@ public Output r0() { public Output asOutput() { return r0; } + + @OpInputsMetadata( + outputsClass = BroadcastDynamicShape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The s0 input + */ + public final Operand s0; + + /** + * The s1 input + */ + public final Operand s1; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BroadcastDynamicShape<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + s0 = (Operand) op.input(inputIndex++); + s1 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java index f1b36da9a40..f29d66c8de6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Return the reduction indices for computing gradients of s0 op s1 with broadcast. * This is typically used by gradient computations for a broadcasting operation. - * - * @param data type for {@code r0} output */ +@OpMetadata( + opType = BroadcastGradientArgs.OP_NAME, + inputsClass = BroadcastGradientArgs.Inputs.class +) +@Operator public final class BroadcastGradientArgs extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +52,8 @@ public final class BroadcastGradientArgs extends RawOp { private Output r1; - private BroadcastGradientArgs(Operation operation) { - super(operation); + public BroadcastGradientArgs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; r0 = operation.output(outputIdx++); r1 = operation.output(outputIdx++); @@ -53,8 +63,8 @@ private BroadcastGradientArgs(Operation operation) { * Factory method to create a class wrapping a new BroadcastGradientArgs operation. * * @param scope current scope - * @param s0 the s0 value - * @param s1 the s1 value + * @param s0 The s0 value + * @param s1 The s1 value * @param data type for {@code BroadcastGradientArgs} output and operands * @return a new instance of BroadcastGradientArgs */ @@ -86,4 +96,32 @@ public Output r0() { public Output r1() { return r1; } + + @OpInputsMetadata( + outputsClass = BroadcastGradientArgs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The s0 input + */ + public final Operand s0; + + /** + * The s1 input + */ + public final Operand s1; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BroadcastGradientArgs<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + s0 = (Operand) op.input(inputIndex++); + s1 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java index deb648f6e2f..f27247cd37a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,25 +38,33 @@ * Broadcast an array for a compatible shape. * Broadcasting is the process of making arrays to have compatible shapes * for arithmetic operations. Two shapes are compatible if for each - * dimension pair they are either equal or one of them is one. When trying - * to broadcast a Tensor to a shape, it starts with the trailing dimensions, - * and works its way forward. - *

    For example, + * dimension pair they are either equal or one of them is one. + *

    For example: *

    *
    *
    - *

    x = tf.constant([1, 2, 3]) - * y = tf.broadcast_to(x, [3, 3]) + *

    x = tf.constant([[1, 2, 3]]) # Shape (1, 3,) + * y = tf.broadcast_to(x, [2, 3]) * print(y) * tf.Tensor( * [[1 2 3] - * [1 2 3] - * [1 2 3]], shape=(3, 3), dtype=int32) + * [1 2 3]], shape=(2, 3), dtype=int32) *

    *
    *
    *

    In the above example, the input Tensor with the shape of {@code [1, 3]} - * is broadcasted to output Tensor with shape of {@code [3, 3]}. + * is broadcasted to output Tensor with shape of {@code [2, 3]}. + *

    When broadcasting, if a tensor has fewer axes than necessary its shape is + * padded on the left with ones. So this gives the same result as the previous + * example: + *

    + *
    + *
    + *

    x = tf.constant([1, 2, 3]) # Shape (3,) + * y = tf.broadcast_to(x, [2, 3]) + *

    + *
    + *
    *

    When doing broadcasted operations such as multiplying a tensor * by a scalar, broadcasting (usually) confers some time or space * benefit, as the broadcasted tensor is never materialized. @@ -58,9 +72,11 @@ * The newly-created tensor takes the full memory of the broadcasted * shape. (In a graph context, {@code broadcast_to} might be fused to * subsequent operation and then be optimized away, however.) - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BroadcastTo.OP_NAME, + inputsClass = BroadcastTo.Inputs.class +) @Operator public final class BroadcastTo extends RawOp implements Operand { /** @@ -70,8 +86,8 @@ public final class BroadcastTo extends RawOp implements Operand private Output output; - private BroadcastTo(Operation operation) { - super(operation); + public BroadcastTo(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -109,4 +125,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BroadcastTo.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A Tensor to broadcast. + */ + public final Operand input; + + /** + * An 1-D {@code int} Tensor. The shape of the desired output. + */ + public final Operand shape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new BroadcastTo<>(op), op, Arrays.asList("T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java index 24fecab9660..33ae116612f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -41,6 +47,10 @@ * [3, 2] * [1, 3]] */ +@OpMetadata( + opType = Bucketize.OP_NAME, + inputsClass = Bucketize.Inputs.class +) @Operator public final class Bucketize extends RawOp implements Operand { /** @@ -50,8 +60,8 @@ public final class Bucketize extends RawOp implements Operand { private Output output; - private Bucketize(Operation operation) { - super(operation); + public Bucketize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -95,4 +105,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Bucketize.class + ) + public static class Inputs extends RawOpInputs { + /** + * Any shape of Tensor contains with int or float type. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A sorted list of floats gives the boundary of the buckets. + */ + public final float[] boundaries; + + public Inputs(GraphOperation op) { + super(new Bucketize(op), op, Arrays.asList("T", "boundaries")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + boundaries = op.attributes().getAttrFloatList("boundaries"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Case.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Case.java index b137e28f283..7fbdce56dda 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Case.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Case.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -102,7 +102,7 @@ static Options outputShapes(List outputShapes) { * @param outputShapes the outputShapes option * @return this Options instance. */ - static Options outputShapes(Shape[] outputShapes) { + static Options outputShapes(Shape... outputShapes) { return new Options().outputShapes(outputShapes); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CheckPinned.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CheckPinned.java new file mode 100644 index 00000000000..2708bcad2bf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CheckPinned.java @@ -0,0 +1,115 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Checks whether a tensor is located in host memory pinned for GPU. + * When run: + *

      + *
    • Reports an {@code InvalidArgument} error if {@code tensor} is not in pinned memory.
    • + *
    • Reports a {@code FailedPrecondition} error if not built with CUDA.
    • + *
    + */ +@OpMetadata( + opType = CheckPinned.OP_NAME, + inputsClass = CheckPinned.Inputs.class +) +@Operator +public final class CheckPinned extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CheckPinned"; + + private Output output; + + public CheckPinned(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CheckPinned operation. + * + * @param scope current scope + * @param tensor The tensor value + * @param data type for {@code CheckPinned} output and operands + * @return a new instance of CheckPinned + */ + @Endpoint( + describeByClass = true + ) + public static CheckPinned create(Scope scope, Operand tensor) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CheckPinned"); + opBuilder.addInput(tensor.asOutput()); + return new CheckPinned<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = CheckPinned.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CheckPinned<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java index 938a931b78d..2ae7185a7e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ * shape as {@code t} with its values clipped to {@code clip_value_min} and {@code clip_value_max}. * Any values less than {@code clip_value_min} are set to {@code clip_value_min}. Any values * greater than {@code clip_value_max} are set to {@code clip_value_max}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ClipByValue.OP_NAME, + inputsClass = ClipByValue.Inputs.class +) @Operator public final class ClipByValue extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class ClipByValue extends RawOp implements Operand private Output output; - private ClipByValue(Operation operation) { - super(operation); + public ClipByValue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -88,4 +96,40 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ClipByValue.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. + */ + public final Operand t; + + /** + * A 0-D (scalar) {@code Tensor}, or a {@code Tensor} with the same shape + * as {@code t}. The minimum value to clip by. + */ + public final Operand clipValueMin; + + /** + * A 0-D (scalar) {@code Tensor}, or a {@code Tensor} with the same shape + * as {@code t}. The maximum value to clip by. + */ + public final Operand clipValueMax; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ClipByValue<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + t = (Operand) op.input(inputIndex++); + clipValueMin = (Operand) op.input(inputIndex++); + clipValueMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 deleted file mode 100644 index 8ab6435aff9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java +++ /dev/null @@ -1,156 +0,0 @@ -/* 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.ndarray.Shape; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.family.TNumber; - -/** - * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data} output - * - * @deprecated use {@link org.tensorflow.op.collective.Gather} instead - */ -@Deprecated -public final class CollectiveGather extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveGather"; - - private Output data; - - private CollectiveGather(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveGather operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the value of the groupSize property - * @param groupKey the value of the groupKey property - * @param instanceKey the value of the instanceKey property - * @param shape the value of the shape property - * @param options carries optional attribute values - * @param data type for {@code CollectiveGather} output and operands - * @return a new instance of CollectiveGather - */ - @Endpoint( - describeByClass = true - ) - public static CollectiveGather create(Scope scope, Operand input, - Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveGather"); - opBuilder.addInput(input.asOutput()); - 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 CollectiveGather<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.core.CollectiveGather} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java index f8afbadb121..bc5322574d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantFromComponents.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +39,11 @@ * Returns a scalar variant tensor containing a single {@code CompositeTensorVariant} * with the specified Tensor components and TypeSpec. */ +@OpMetadata( + opType = CompositeTensorVariantFromComponents.OP_NAME, + inputsClass = CompositeTensorVariantFromComponents.Inputs.class +) +@Operator public final class CompositeTensorVariantFromComponents extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class CompositeTensorVariantFromComponents extends RawOp implements private Output encoded; @SuppressWarnings("unchecked") - private CompositeTensorVariantFromComponents(Operation operation) { - super(operation); + public CompositeTensorVariantFromComponents(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; encoded = operation.output(outputIdx++); } @@ -81,4 +93,35 @@ public Output encoded() { public Output asOutput() { return (Output) encoded; } + + @OpInputsMetadata( + outputsClass = CompositeTensorVariantFromComponents.class + ) + public static class Inputs extends RawOpInputs { + /** + * The component tensors for the extension type value. + */ + public final Iterable> components; + + /** + * String serialization for the TypeSpec. (Note: the encoding for the TypeSpec + * may change in future versions of TensorFlow.) + */ + public final String metadata; + + /** + * The Tcomponents attribute + */ + public final DataType[] Tcomponents; + + public Inputs(GraphOperation op) { + super(new CompositeTensorVariantFromComponents(op), op, Arrays.asList("metadata", "Tcomponents")); + int inputIndex = 0; + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + metadata = op.attributes().getAttrString("metadata"); + Tcomponents = op.attributes().getAttrTypeList("Tcomponents"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantToComponents.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantToComponents.java index 3dbad9c91b7..e8288c59607 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantToComponents.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CompositeTensorVariantToComponents.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,14 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,6 +42,11 @@ *

    Raises an error if {@code type_spec_proto} doesn't match the TypeSpec * in {@code encoded}. */ +@OpMetadata( + opType = CompositeTensorVariantToComponents.OP_NAME, + inputsClass = CompositeTensorVariantToComponents.Inputs.class +) +@Operator public final class CompositeTensorVariantToComponents extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +56,8 @@ public final class CompositeTensorVariantToComponents extends RawOp implements I private List> components; @SuppressWarnings("unchecked") - private CompositeTensorVariantToComponents(Operation operation) { - super(operation); + public CompositeTensorVariantToComponents(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -90,4 +101,34 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = CompositeTensorVariantToComponents.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar {@code variant} Tensor containing an encoded ExtensionType value. + */ + public final Operand encoded; + + /** + * String serialization for the TypeSpec. Must be compatible with the + * {@code TypeSpec} contained in {@code encoded}. (Note: the encoding for the TypeSpec + * may change in future versions of TensorFlow.) + */ + public final String metadata; + + /** + * Expected dtypes for components. + */ + public final DataType[] Tcomponents; + + public Inputs(GraphOperation op) { + super(new CompositeTensorVariantToComponents(op), op, Arrays.asList("metadata", "Tcomponents")); + int inputIndex = 0; + encoded = (Operand) op.input(inputIndex++); + metadata = op.attributes().getAttrString("metadata"); + Tcomponents = op.attributes().getAttrTypeList("Tcomponents"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java index 80e2a2fe207..cf3b735f4be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Concatenates tensors along one dimension. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Concat.OP_NAME, + inputsClass = Concat.Inputs.class +) @Operator public final class Concat extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class Concat extends RawOp implements Operand { private Output output; - private Concat(Operation operation) { - super(operation); + public Concat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -86,4 +94,42 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Concat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * List of {@code N} Tensors to concatenate. Their ranks and types must match, + * and their sizes must match in all dimensions except {@code concat_dim}. + */ + public final Iterable> values; + + /** + * 0-D. The dimension along which to concatenate. Must be in the + * range [-rank(values), rank(values)). + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Concat<>(op), op, Arrays.asList("T", "Tidx")); + int inputIndex = 0; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConcatOffset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConcatOffset.java new file mode 100644 index 00000000000..9b9a8d813c3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConcatOffset.java @@ -0,0 +1,144 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Computes offsets of concat inputs within its output. + * For example: + *

    + *
    + *
    + *

    x = [2, 2, 7] + * y = [2, 3, 7] + * z = [2, 9, 7] + * offsets = concat_offset(1, [x, y, z]) + * [[a.item() for a in list(off.numpy())] for off in offsets] + * [[0, 0, 0], [0, 2, 0], [0, 5, 0]] + *

    + *
    + *
    + *

    This is typically used by gradient computations for a concat operation. + */ +@OpMetadata( + opType = ConcatOffset.OP_NAME, + inputsClass = ConcatOffset.Inputs.class +) +@Operator +public final class ConcatOffset extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConcatOffset"; + + private List> offset; + + @SuppressWarnings("unchecked") + public ConcatOffset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int offsetLength = operation.outputListLength("offset"); + offset = Arrays.asList((Output[]) operation.outputList(outputIdx, offsetLength)); + outputIdx += offsetLength; + } + + /** + * Factory method to create a class wrapping a new ConcatOffset operation. + * + * @param scope current scope + * @param concatDim The dimension along which to concatenate. + * @param shape The {@code N} int32 or int64 vectors representing shape of tensors being concatenated. + * @param data type for {@code ConcatOffset} output and operands + * @return a new instance of ConcatOffset + */ + @Endpoint( + describeByClass = true + ) + public static ConcatOffset create(Scope scope, Operand concatDim, + Iterable> shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConcatOffset"); + opBuilder.addInput(concatDim.asOutput()); + opBuilder.addInputList(Operands.asOutputs(shape)); + return new ConcatOffset<>(opBuilder.build()); + } + + /** + * Gets offset. + * The {@code N} vectors representing the starting offset + * of input tensors within the concatenated output with type matching {@code shape}. + * @return offset. + */ + public List> offset() { + return offset; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) offset.iterator(); + } + + @OpInputsMetadata( + outputsClass = ConcatOffset.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The dimension along which to concatenate. + */ + public final Operand concatDim; + + /** + * The {@code N} int32 or int64 vectors representing shape of tensors being concatenated. + */ + public final Iterable> shape; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new ConcatOffset<>(op), op, Arrays.asList("shape_type")); + int inputIndex = 0; + concatDim = (Operand) op.input(inputIndex++); + int shapeLength = op.inputListLength("shape"); + shape = Arrays.asList((Operand[]) op.inputList(inputIndex, shapeLength)); + inputIndex += shapeLength; + shapeType = op.attributes().getAttrType("shape_type"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java index 9dc127e3d70..9a39cc9f8d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -35,6 +40,10 @@ *

    NOTE: This operation must run on the same device as its input. This may * be enforced via the {@code colocate_with} mechanism. */ +@OpMetadata( + opType = ConsumeMutexLock.OP_NAME, + inputsClass = ConsumeMutexLock.Inputs.class +) @Operator public final class ConsumeMutexLock extends RawOp { /** @@ -42,8 +51,8 @@ public final class ConsumeMutexLock extends RawOp { */ public static final String OP_NAME = "ConsumeMutexLock"; - private ConsumeMutexLock(Operation operation) { - super(operation); + public ConsumeMutexLock(Operation operation) { + super(operation, OP_NAME); } /** @@ -61,4 +70,20 @@ public static ConsumeMutexLock create(Scope scope, Operand mute opBuilder.addInput(mutexLock.asOutput()); return new ConsumeMutexLock(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ConsumeMutexLock.class + ) + public static class Inputs extends RawOpInputs { + /** + * A tensor returned by {@code MutexLock}. + */ + public final Operand mutexLock; + + public Inputs(GraphOperation op) { + super(new ConsumeMutexLock(op), op, Arrays.asList()); + int inputIndex = 0; + mutexLock = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java index b60a6f674b0..721b26668fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,17 +17,26 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; /** * Does nothing. Serves as a control trigger for scheduling. * Only useful as a placeholder for control edges. */ +@OpMetadata( + opType = ControlTrigger.OP_NAME, + inputsClass = ControlTrigger.Inputs.class +) @Operator public final class ControlTrigger extends RawOp { /** @@ -35,8 +44,8 @@ public final class ControlTrigger extends RawOp { */ public static final String OP_NAME = "ControlTrigger"; - private ControlTrigger(Operation operation) { - super(operation); + public ControlTrigger(Operation operation) { + super(operation, OP_NAME); } /** @@ -52,4 +61,14 @@ public static ControlTrigger create(Scope scope) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ControlTrigger"); return new ControlTrigger(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ControlTrigger.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new ControlTrigger(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java index d8e9700422e..a04de48877b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,18 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +42,11 @@ * deep-copying. See the documentation of Debug* ops for more details. *

    Unlike the CopyHost Op, this op does not have HostMemory constraint on its * input or output. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Copy.OP_NAME, + inputsClass = Copy.Inputs.class +) public final class Copy extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +55,8 @@ public final class Copy extends RawOp implements Operand { private Output output; - private Copy(Operation operation) { - super(operation); + public Copy(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -121,7 +128,7 @@ public static Options debugOpsSpec(List debugOpsSpec) { * "DebugIdentity;file:///tmp/tfdbg_1;0". * @return this Options instance. */ - public static Options debugOpsSpec(String[] debugOpsSpec) { + public static Options debugOpsSpec(String... debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } @@ -191,4 +198,42 @@ public Options debugOpsSpec(String... debugOpsSpec) { return this; } } + + @OpInputsMetadata( + outputsClass = Copy.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The name of the input tensor. + */ + public final String tensorName; + + /** + * A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + */ + public final String[] debugOpsSpec; + + public Inputs(GraphOperation op) { + super(new Copy<>(op), op, Arrays.asList("T", "tensor_name", "debug_ops_spec")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + tensorName = op.attributes().getAttrString("tensor_name"); + debugOpsSpec = op.attributes().getAttrStringList("debug_ops_spec"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java index 3c348d13929..055c9d878bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,18 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +40,11 @@ * gRPC gating status, the output will simply forward the input tensor without * deep-copying. See the documentation of Debug* ops for more details. *

    Unlike the Copy Op, this op has HostMemory constraint on its input or output. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CopyHost.OP_NAME, + inputsClass = CopyHost.Inputs.class +) public final class CopyHost extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +53,8 @@ public final class CopyHost extends RawOp implements Operand private Output output; - private CopyHost(Operation operation) { - super(operation); + public CopyHost(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -119,7 +126,7 @@ public static Options debugOpsSpec(List debugOpsSpec) { * "DebugIdentity;file:///tmp/tfdbg_1;0". * @return this Options instance. */ - public static Options debugOpsSpec(String[] debugOpsSpec) { + public static Options debugOpsSpec(String... debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } @@ -189,4 +196,42 @@ public Options debugOpsSpec(String... debugOpsSpec) { return this; } } + + @OpInputsMetadata( + outputsClass = CopyHost.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The name of the input tensor. + */ + public final String tensorName; + + /** + * A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + */ + public final String[] debugOpsSpec; + + public Inputs(GraphOperation op) { + super(new CopyHost<>(op), op, Arrays.asList("T", "tensor_name", "debug_ops_spec")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + tensorName = op.attributes().getAttrString("tensor_name"); + debugOpsSpec = op.attributes().getAttrStringList("debug_ops_spec"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMesh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMesh.java new file mode 100644 index 00000000000..166d4613d54 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMesh.java @@ -0,0 +1,118 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The CopyToMesh operation + */ +@OpMetadata( + opType = CopyToMesh.OP_NAME, + inputsClass = CopyToMesh.Inputs.class +) +@Operator +public final class CopyToMesh extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CopyToMesh"; + + private Output output; + + public CopyToMesh(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CopyToMesh operation. + * + * @param scope current scope + * @param input The input value + * @param mesh The value of the mesh attribute + * @param data type for {@code CopyToMesh} output and operands + * @return a new instance of CopyToMesh + */ + @Endpoint( + describeByClass = true + ) + public static CopyToMesh create(Scope scope, Operand input, String mesh) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CopyToMesh"); + opBuilder.addInput(input.asOutput()); + opBuilder.setAttr("mesh", mesh); + return new CopyToMesh<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = CopyToMesh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The mesh attribute + */ + public final String mesh; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CopyToMesh<>(op), op, Arrays.asList("mesh", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + mesh = op.attributes().getAttrString("mesh"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMeshGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMeshGrad.java new file mode 100644 index 00000000000..095d5b5d7ce --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyToMeshGrad.java @@ -0,0 +1,119 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The CopyToMeshGrad operation + */ +@OpMetadata( + opType = CopyToMeshGrad.OP_NAME, + inputsClass = CopyToMeshGrad.Inputs.class +) +@Operator +public final class CopyToMeshGrad extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CopyToMeshGrad"; + + private Output output; + + public CopyToMeshGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CopyToMeshGrad operation. + * + * @param scope current scope + * @param input The input value + * @param forwardInput The forwardInput value + * @param data type for {@code CopyToMeshGrad} output and operands + * @return a new instance of CopyToMeshGrad + */ + @Endpoint( + describeByClass = true + ) + public static CopyToMeshGrad create(Scope scope, Operand input, + Operand forwardInput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CopyToMeshGrad"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(forwardInput.asOutput()); + return new CopyToMeshGrad<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = CopyToMeshGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The forwardInput input + */ + public final Operand forwardInput; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CopyToMeshGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + forwardInput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java index d84ead6e789..0f404fa1419 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Increments 'ref' until it reaches 'limit'. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CountUpTo.OP_NAME, + inputsClass = CountUpTo.Inputs.class +) @Operator public final class CountUpTo extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class CountUpTo extends RawOp implements Operand private Output output; - private CountUpTo(Operation operation) { - super(operation); + public CountUpTo(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -81,4 +89,33 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = CountUpTo.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a scalar {@code Variable} node. + */ + public final Operand ref; + + /** + * If incrementing ref would bring it above limit, instead generates an + * 'OutOfRange' error. + */ + public final long limit; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CountUpTo<>(op), op, Arrays.asList("limit", "T")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + limit = op.attributes().getAttrInt("limit"); + T = op.attributes().getAttrType("T"); + } + } } 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 1668fc15c89..be36191dd31 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,30 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The op extracts fields from a serialized protocol buffers message into tensors. - * The {@code decode_proto} op extracts fields from a serialized protocol buffers + * Note: This API is designed for orthogonality rather than human-friendliness. It + * can be used to parse input protos by hand, but it is intended for use in + * generated code. + *

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

    A {@code message_type} name must be provided to give context for the field names. @@ -64,6 +72,16 @@ * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in * the {@code output_types} attribute. * + *

  • + *

    {@code map} fields are not directly decoded. They are treated as {@code repeated} fields, + * of the appropriate entry type. The proto-compiler defines entry types for each + * map field. The type-name is the field name, converted to "CamelCase" with + * "Entry" appended. The {@code tf.train.Features.FeatureEntry} message is an example of + * one of these implicit {@code Entry} types. + *

  • + *
  • + *

    {@code enum} fields should be read as int32. + *

  • * *

    Both binary and text proto serializations are supported, and can be * chosen using the {@code format} attribute. @@ -86,6 +104,10 @@ * * */ +@OpMetadata( + opType = DecodeProto.OP_NAME, + inputsClass = DecodeProto.Inputs.class +) @Operator public final class DecodeProto extends RawOp { /** @@ -98,8 +120,8 @@ public final class DecodeProto extends RawOp { private List> values; @SuppressWarnings("unchecked") - private DecodeProto(Operation operation) { - super(operation); + public DecodeProto(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sizes = operation.output(outputIdx++); int valuesLength = operation.outputListLength("values"); @@ -249,4 +271,58 @@ public Options sanitize(Boolean sanitize) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeProto.class + ) + public static class Inputs extends RawOpInputs { + /** + * Tensor of serialized protos with shape {@code batch_shape}. + */ + public final Operand bytes; + + /** + * Name of the proto message type to decode. + */ + public final String messageType; + + /** + * 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. + */ + public final String[] fieldNames; + + /** + * List of TF types to use for the respective field in field_names. + */ + public final DataType[] outputTypes; + + /** + * Either the special value {@code local://} or a path to a file containing + * a serialized {@code FileDescriptorSet}. + */ + public final String descriptorSource; + + /** + * Either {@code binary} or {@code text}. + */ + public final String messageFormat; + + /** + * Whether to sanitize the result or not. + */ + public final boolean sanitize; + + public Inputs(GraphOperation op) { + super(new DecodeProto(op), op, Arrays.asList("message_type", "field_names", "output_types", "descriptor_source", "message_format", "sanitize")); + int inputIndex = 0; + bytes = (Operand) op.input(inputIndex++); + messageType = op.attributes().getAttrString("message_type"); + fieldNames = op.attributes().getAttrStringList("field_names"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + descriptorSource = op.attributes().getAttrString("descriptor_source"); + messageFormat = op.attributes().getAttrString("message_format"); + sanitize = op.attributes().getAttrBool("sanitize"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java index 8826f1d4a67..f0b9b3927a8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Makes a copy of {@code x}. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = DeepCopy.OP_NAME, + inputsClass = DeepCopy.Inputs.class +) @Operator public final class DeepCopy extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class DeepCopy extends RawOp implements Operand private Output y; - private DeepCopy(Operation operation) { - super(operation); + public DeepCopy(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = DeepCopy.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The source tensor of type {@code T}. + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DeepCopy<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java index e2438b7d763..4557500c448 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,27 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Delete the tensor specified by its handle in the session. */ +@OpMetadata( + opType = DeleteSessionTensor.OP_NAME, + inputsClass = DeleteSessionTensor.Inputs.class +) @Operator public final class DeleteSessionTensor extends RawOp { /** @@ -36,8 +45,8 @@ public final class DeleteSessionTensor extends RawOp { */ public static final String OP_NAME = "DeleteSessionTensor"; - private DeleteSessionTensor(Operation operation) { - super(operation); + public DeleteSessionTensor(Operation operation) { + super(operation, OP_NAME); } /** @@ -55,4 +64,20 @@ public static DeleteSessionTensor create(Scope scope, Operand handle) { opBuilder.addInput(handle.asOutput()); return new DeleteSessionTensor(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeleteSessionTensor.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle for a tensor stored in the session state. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new DeleteSessionTensor(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java index 712a226b7f9..01a9dc71df0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ * All subsequent operations using the resource will result in a NotFound * error status. */ +@OpMetadata( + opType = DestroyResourceOp.OP_NAME, + inputsClass = DestroyResourceOp.Inputs.class +) @Operator public final class DestroyResourceOp extends RawOp { /** @@ -38,8 +47,8 @@ public final class DestroyResourceOp extends RawOp { */ public static final String OP_NAME = "DestroyResourceOp"; - private DestroyResourceOp(Operation operation) { - super(operation); + public DestroyResourceOp(Operation operation) { + super(operation, OP_NAME); } /** @@ -99,4 +108,27 @@ public Options ignoreLookupError(Boolean ignoreLookupError) { return this; } } + + @OpInputsMetadata( + outputsClass = DestroyResourceOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * handle to the resource to delete. + */ + public final Operand resource; + + /** + * whether to ignore the error when the resource + * doesn't exist. + */ + public final boolean ignoreLookupError; + + public Inputs(GraphOperation op) { + super(new DestroyResourceOp(op), op, Arrays.asList("ignore_lookup_error")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + ignoreLookupError = op.attributes().getAttrBool("ignore_lookup_error"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java index 7fb5b12b2c5..876a1e46ee5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * This is typically achieved by chaining the ref through each assign op, or by * using control dependencies. *

    Outputs the final value of the tensor pointed to by 'ref'. - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = DestroyTemporaryVariable.OP_NAME, + inputsClass = DestroyTemporaryVariable.Inputs.class +) @Operator public final class DestroyTemporaryVariable extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class DestroyTemporaryVariable extends RawOp imple private Output value; - private DestroyTemporaryVariable(Operation operation) { - super(operation); + public DestroyTemporaryVariable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -87,4 +95,33 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = DestroyTemporaryVariable.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A reference to the temporary variable tensor. + */ + public final Operand ref; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Name of the temporary variable, usually the name of the matching + * 'TemporaryVariable' op. + */ + public final String varName; + + public Inputs(GraphOperation op) { + super(new DestroyTemporaryVariable<>(op), op, Arrays.asList("T", "var_name")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + varName = op.attributes().getAttrString("var_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java index de834ee3fb4..fb05a1a7a09 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; /** @@ -34,6 +40,11 @@ * (1) Device does not exist in the given device list. * (2) It is in XLA compilation. */ +@OpMetadata( + opType = DeviceIndex.OP_NAME, + inputsClass = DeviceIndex.Inputs.class +) +@Operator public final class DeviceIndex extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +53,8 @@ public final class DeviceIndex extends RawOp implements Operand { private Output index; - private DeviceIndex(Operation operation) { - super(operation); + public DeviceIndex(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; index = operation.output(outputIdx++); } @@ -52,7 +63,7 @@ private DeviceIndex(Operation operation) { * Factory method to create a class wrapping a new DeviceIndex operation. * * @param scope current scope - * @param deviceNames the value of the deviceNames property + * @param deviceNames The value of the deviceNames attribute * @return a new instance of DeviceIndex */ @Endpoint( @@ -81,4 +92,20 @@ public Output index() { public Output asOutput() { return index; } + + @OpInputsMetadata( + outputsClass = DeviceIndex.class + ) + public static class Inputs extends RawOpInputs { + /** + * The deviceNames attribute + */ + public final String[] deviceNames; + + public Inputs(GraphOperation op) { + super(new DeviceIndex(op), op, Arrays.asList("device_names")); + int inputIndex = 0; + deviceNames = op.attributes().getAttrStringList("device_names"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java index dd24b4a64af..d4dcdcb0735 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DummyMemoryCache operation */ +@OpMetadata( + opType = DummyMemoryCache.OP_NAME, + inputsClass = DummyMemoryCache.Inputs.class +) +@Operator public final class DummyMemoryCache extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +49,8 @@ public final class DummyMemoryCache extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private DummyMemoryCache(Operation operation) { - super(operation); + public DummyMemoryCache(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -72,4 +83,14 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DummyMemoryCache.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new DummyMemoryCache(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java index f777b6b2f70..d7d7bf7c328 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,14 +20,19 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -64,9 +69,20 @@ *

    * *
    - * - * @param data type for {@code outputs} output + *

    Raises: + *

      + *
    • {@code InvalidArgumentError} in following cases: + *
        + *
      • If partitions is not in range {@code [0, num_partiions)}
      • + *
      • If {@code partitions.shape} does not match prefix of {@code data.shape} argument.
      • + *
      + *
    • + *
    */ +@OpMetadata( + opType = DynamicPartition.OP_NAME, + inputsClass = DynamicPartition.Inputs.class +) @Operator public final class DynamicPartition extends RawOp implements Iterable> { /** @@ -77,8 +93,8 @@ public final class DynamicPartition extends RawOp implements It private List> outputs; @SuppressWarnings("unchecked") - private DynamicPartition(Operation operation) { - super(operation); + public DynamicPartition(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); @@ -89,7 +105,7 @@ private DynamicPartition(Operation operation) { * Factory method to create a class wrapping a new DynamicPartition operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param partitions Any shape. Indices in the range {@code [0, num_partitions)}. * @param numPartitions The number of partitions to output. * @param data type for {@code DynamicPartition} output and operands @@ -121,4 +137,32 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = DynamicPartition.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * Any shape. Indices in the range {@code [0, num_partitions)}. + */ + public final Operand partitions; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DynamicPartition<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + partitions = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java index 5cbf9e59a1d..d160ab8255c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -48,7 +54,7 @@ * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this * {@code constant}, the output shape is *
    - * merged.shape = [max(indices)] + constant
    + * merged.shape = [max(indices) + 1] + constant
      * 
    *

    Values are merged in order, so if an index appears in both {@code indices[m][i]} and * {@code indices[n][j]} for {@code (m,i) < (n,j)} the slice {@code data[n][j]} will appear in the @@ -84,9 +90,11 @@ *

    * *
    - * - * @param data type for {@code merged} output */ +@OpMetadata( + opType = DynamicStitch.OP_NAME, + inputsClass = DynamicStitch.Inputs.class +) @Operator public final class DynamicStitch extends RawOp implements Operand { /** @@ -96,8 +104,8 @@ public final class DynamicStitch extends RawOp implements Opera private Output merged; - private DynamicStitch(Operation operation) { - super(operation); + public DynamicStitch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; merged = operation.output(outputIdx++); } @@ -106,8 +114,8 @@ private DynamicStitch(Operation operation) { * Factory method to create a class wrapping a new DynamicStitch operation. * * @param scope current scope - * @param indices the indices value - * @param data the data value + * @param indices The indices value + * @param data The data value * @param data type for {@code DynamicStitch} output and operands * @return a new instance of DynamicStitch */ @@ -135,4 +143,36 @@ public Output merged() { public Output asOutput() { return merged; } + + @OpInputsMetadata( + outputsClass = DynamicStitch.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The indices input + */ + public final Iterable> indices; + + /** + * The data input + */ + public final Iterable> data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DynamicStitch<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + int indicesLength = op.inputListLength("indices"); + indices = Arrays.asList((Operand[]) op.inputList(inputIndex, indicesLength)); + inputIndex += indicesLength; + int dataLength = op.inputListLength("data"); + data = Arrays.asList((Operand[]) op.inputList(inputIndex, dataLength)); + inputIndex += dataLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java index 266d2c3c6c6..228743f17cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,6 +43,10 @@ * (truth_indices, truth_values, truth_shape). *

    The inputs are: */ +@OpMetadata( + opType = EditDistance.OP_NAME, + inputsClass = EditDistance.Inputs.class +) @Operator public final class EditDistance extends RawOp implements Operand { /** @@ -46,8 +56,8 @@ public final class EditDistance extends RawOp implements Operand { private Output output; - private EditDistance(Operation operation) { - super(operation); + public EditDistance(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -170,4 +180,68 @@ public Options normalize(Boolean normalize) { return this; } } + + @OpInputsMetadata( + outputsClass = EditDistance.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices of the hypothesis list SparseTensor. + * This is an N x R int64 matrix. + */ + public final Operand hypothesisIndices; + + /** + * The values of the hypothesis list SparseTensor. + * This is an N-length vector. + */ + public final Operand hypothesisValues; + + /** + * The shape of the hypothesis list SparseTensor. + * This is an R-length vector. + */ + public final Operand hypothesisShape; + + /** + * The indices of the truth list SparseTensor. + * This is an M x R int64 matrix. + */ + public final Operand truthIndices; + + /** + * The values of the truth list SparseTensor. + * This is an M-length vector. + */ + public final Operand truthValues; + + /** + * truth indices, vector. + */ + public final Operand truthShape; + + /** + * boolean (if true, edit distances are normalized by length of truth). + *

    The output is: + */ + public final boolean normalize; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new EditDistance(op), op, Arrays.asList("normalize", "T")); + int inputIndex = 0; + hypothesisIndices = (Operand) op.input(inputIndex++); + hypothesisValues = (Operand) op.input(inputIndex++); + hypothesisShape = (Operand) op.input(inputIndex++); + truthIndices = (Operand) op.input(inputIndex++); + truthValues = (Operand) op.input(inputIndex++); + truthShape = (Operand) op.input(inputIndex++); + normalize = op.attributes().getAttrBool("normalize"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java index e83fc532726..6f7d74d94e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Creates a tensor with the given shape. *

    This operation creates a tensor of {@code shape} and {@code dtype}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Empty.OP_NAME, + inputsClass = Empty.Inputs.class +) @Operator public final class Empty extends RawOp implements Operand { /** @@ -44,8 +52,8 @@ public final class Empty extends RawOp implements Operand { private Output output; - private Empty(Operation operation) { - super(operation); + public Empty(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,7 +63,7 @@ private Empty(Operation operation) { * * @param scope current scope * @param shape 1-D. Represents the shape of the output tensor. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code Empty} output and operands * @return a new instance of Empty @@ -122,4 +130,32 @@ public Options init(Boolean init) { return this; } } + + @OpInputsMetadata( + outputsClass = Empty.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. Represents the shape of the output tensor. + */ + public final Operand shape; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. + */ + public final boolean init; + + public Inputs(GraphOperation op) { + super(new Empty<>(op), op, Arrays.asList("dtype", "init")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + init = op.attributes().getAttrBool("init"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java index 5d96174e298..9f06eda9da7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,6 +44,10 @@ * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. */ +@OpMetadata( + opType = EmptyTensorList.OP_NAME, + inputsClass = EmptyTensorList.Inputs.class +) @Operator public final class EmptyTensorList extends RawOp implements Operand { /** @@ -48,8 +58,8 @@ public final class EmptyTensorList extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private EmptyTensorList(Operation operation) { - super(operation); + public EmptyTensorList(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,9 +68,9 @@ private EmptyTensorList(Operation operation) { * Factory method to create a class wrapping a new EmptyTensorList operation. * * @param scope current scope - * @param elementShape the elementShape value - * @param maxNumElements the maxNumElements value - * @param elementDtype the value of the elementDtype property + * @param elementShape The elementShape value + * @param maxNumElements The maxNumElements value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code EmptyTensorList} output and operands * @return a new instance of EmptyTensorList */ @@ -91,4 +101,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = EmptyTensorList.class + ) + public static class Inputs extends RawOpInputs { + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The maxNumElements input + */ + public final Operand maxNumElements; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new EmptyTensorList(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + elementShape = (Operand) op.input(inputIndex++); + maxNumElements = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } 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 index 7bb4274e2b5..a0c10ecae1c 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ * Creates and returns an empty tensor map. * handle: an empty tensor map */ +@OpMetadata( + opType = EmptyTensorMap.OP_NAME, + inputsClass = EmptyTensorMap.Inputs.class +) @Operator public final class EmptyTensorMap extends RawOp implements Operand { /** @@ -41,8 +50,8 @@ public final class EmptyTensorMap extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private EmptyTensorMap(Operation operation) { - super(operation); + public EmptyTensorMap(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -75,4 +84,14 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = EmptyTensorMap.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new EmptyTensorMap(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } 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 14ea6f4a3a1..fa8f10ba366 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,16 +17,22 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -78,6 +84,10 @@ * * */ +@OpMetadata( + opType = EncodeProto.OP_NAME, + inputsClass = EncodeProto.Inputs.class +) @Operator public final class EncodeProto extends RawOp implements Operand { /** @@ -87,8 +97,8 @@ public final class EncodeProto extends RawOp implements Operand { private Output bytes; - private EncodeProto(Operation operation) { - super(operation); + public EncodeProto(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; bytes = operation.output(outputIdx++); } @@ -172,4 +182,52 @@ public Options descriptorSource(String descriptorSource) { return this; } } + + @OpInputsMetadata( + outputsClass = EncodeProto.class + ) + public static class Inputs extends RawOpInputs { + /** + * Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. + */ + public final Operand sizes; + + /** + * List of tensors containing values for the corresponding field. + */ + public final Iterable> values; + + /** + * List of strings containing proto field names. + */ + public final String[] fieldNames; + + /** + * Name of the proto message type to decode. + */ + public final String messageType; + + /** + * The descriptorSource attribute + */ + public final String descriptorSource; + + /** + * The input types. + */ + public final DataType[] TinputTypes; + + public Inputs(GraphOperation op) { + super(new EncodeProto(op), op, Arrays.asList("field_names", "message_type", "descriptor_source", "Tinput_types")); + int inputIndex = 0; + sizes = (Operand) op.input(inputIndex++); + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + fieldNames = op.attributes().getAttrStringList("field_names"); + messageType = op.attributes().getAttrString("message_type"); + descriptorSource = op.attributes().getAttrString("descriptor_source"); + TinputTypes = op.attributes().getAttrTypeList("Tinput_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java index 26575671b80..bbada3714ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Ensures that the tensor's shape matches the expected shape. * Raises an error if the input tensor's shape does not match the specified shape. * Returns the input tensor otherwise. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = EnsureShape.OP_NAME, + inputsClass = EnsureShape.Inputs.class +) @Operator public final class EnsureShape extends RawOp implements Operand { /** @@ -44,8 +52,8 @@ public final class EnsureShape extends RawOp implements Operand private Output output; - private EnsureShape(Operation operation) { - super(operation); + public EnsureShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,4 +91,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = EnsureShape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor, whose shape is to be validated. + */ + public final Operand input; + + /** + * The expected (possibly partially specified) shape of the input tensor. + */ + public final Shape shape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new EnsureShape<>(op), op, Arrays.asList("shape", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + shape = op.attributes().getAttrShape("shape"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java index 6451e8e8c5a..309e5700eb1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +40,12 @@ * {@code is_constant} is true, {@code output} is a constant in the child frame; otherwise * it may be changed in the child frame. At most {@code parallel_iterations} iterations * are run in parallel in the child frame. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Enter.OP_NAME, + inputsClass = Enter.Inputs.class +) +@Operator public final class Enter extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +54,8 @@ public final class Enter extends RawOp implements Operand { private Output output; - private Enter(Operation operation) { - super(operation); + public Enter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -148,4 +158,44 @@ public Options parallelIterations(Long parallelIterations) { return this; } } + + @OpInputsMetadata( + outputsClass = Enter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the child frame. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The name of the child frame. + */ + public final String frameName; + + /** + * If true, the output is constant within the child frame. + */ + public final boolean isConstant; + + /** + * The number of iterations allowed to run in parallel. + */ + public final long parallelIterations; + + public Inputs(GraphOperation op) { + super(new Enter<>(op), op, Arrays.asList("T", "frame_name", "is_constant", "parallel_iterations")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + frameName = op.attributes().getAttrString("frame_name"); + isConstant = op.attributes().getAttrBool("is_constant"); + parallelIterations = op.attributes().getAttrInt("parallel_iterations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java index d9cc8f881bd..8dea6a66fe6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. * Exit makes its input {@code data} available to the parent frame. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Exit.OP_NAME, + inputsClass = Exit.Inputs.class +) +@Operator public final class Exit extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +50,8 @@ public final class Exit extends RawOp implements Operand { private Output output; - private Exit(Operation operation) { - super(operation); + public Exit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +86,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Exit.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the parent frame. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Exit<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java index b5382bba07f..0f0e030b71d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -53,9 +59,11 @@ *

    {@code -1-input.dims() <= dim <= input.dims()} *

    This operation is related to {@code squeeze()}, which removes dimensions of * size 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ExpandDims.OP_NAME, + inputsClass = ExpandDims.Inputs.class +) @Operator public final class ExpandDims extends RawOp implements Operand { /** @@ -65,8 +73,8 @@ public final class ExpandDims extends RawOp implements Operand< private Output output; - private ExpandDims(Operation operation) { - super(operation); + public ExpandDims(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -75,7 +83,7 @@ private ExpandDims(Operation operation) { * Factory method to create a class wrapping a new ExpandDims operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param axis 0-D (scalar). Specifies the dimension index at which to * expand the shape of {@code input}. Must be in the range * {@code [-rank(input) - 1, rank(input)]}. @@ -107,4 +115,40 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ExpandDims.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * 0-D (scalar). Specifies the dimension index at which to + * expand the shape of {@code input}. Must be in the range + * {@code [-rank(input) - 1, rank(input)]}. + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tdim attribute + */ + public final DataType Tdim; + + public Inputs(GraphOperation op) { + super(new ExpandDims<>(op), op, Arrays.asList("T", "Tdim")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tdim = op.attributes().getAttrType("Tdim"); + } + } } 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 9326536a87b..350c416e235 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Extract {@code patches} from {@code input} and put them in the {@code "depth"} output dimension. 3D extension of {@code extract_image_patches}. - * - * @param data type for {@code patches} output */ +@OpMetadata( + opType = ExtractVolumePatches.OP_NAME, + inputsClass = ExtractVolumePatches.Inputs.class +) @Operator public final class ExtractVolumePatches extends RawOp implements Operand { /** @@ -42,8 +50,8 @@ public final class ExtractVolumePatches extends RawOp impleme private Output patches; - private ExtractVolumePatches(Operation operation) { - super(operation); + public ExtractVolumePatches(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; patches = operation.output(outputIdx++); } @@ -102,4 +110,50 @@ public Output patches() { public Output asOutput() { return patches; } + + @OpInputsMetadata( + outputsClass = ExtractVolumePatches.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 5-D Tensor with shape {@code [batch, in_planes, in_rows, in_cols, depth]}. + */ + public final Operand input; + + /** + * The size of the sliding window for each dimension of {@code input}. + */ + public final long[] ksizes; + + /** + * 1-D of length 5. How far the centers of two consecutive patches are in + * {@code input}. Must be: {@code [1, stride_planes, stride_rows, stride_cols, 1]}. + */ + public final long[] strides; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The type of padding algorithm to use. + *

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

    +     * ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
    +     * strides = [1, stride_planes, strides_rows, strides_cols, 1]
    +     * 
    + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new ExtractVolumePatches<>(op), op, Arrays.asList("ksizes", "strides", "T", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + ksizes = op.attributes().getAttrIntList("ksizes"); + strides = op.attributes().getAttrIntList("strides"); + T = op.attributes().getAttrType("T"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FakeParam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FakeParam.java new file mode 100644 index 00000000000..79e63958dda --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FakeParam.java @@ -0,0 +1,125 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * This op is used as a placeholder in If branch functions. It doesn't provide a + * valid output when run, so must either be removed (e.g. replaced with a + * function input) or guaranteed not to be used (e.g. if mirroring an + * intermediate output needed for the gradient computation of the other branch). + */ +@OpMetadata( + opType = FakeParam.OP_NAME, + inputsClass = FakeParam.Inputs.class +) +@Operator +public final class FakeParam extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FakeParam"; + + private Output output; + + public FakeParam(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FakeParam operation. + * + * @param scope current scope + * @param dtype The type of the output. + * @param shape
    +   * The purported shape of the output. This is only used for shape inference;
    +   * the output will not necessarily have this shape. Can be a partial shape.
    +   * 
    + * @param data type for {@code FakeParam} output and operands + * @return a new instance of FakeParam + */ + @Endpoint( + describeByClass = true + ) + public static FakeParam create(Scope scope, Class dtype, Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeParam"); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + opBuilder.setAttr("shape", shape); + return new FakeParam<>(opBuilder.build()); + } + + /** + * Gets output. + *
    +   * \"Fake\" output value. This should not be consumed by another op.
    +   * 
    + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = FakeParam.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The type of the output. + */ + public final DataType dtype; + + /** + *
    +     * The purported shape of the output. This is only used for shape inference;
    +     * the output will not necessarily have this shape. Can be a partial shape.
    +     * 
    + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new FakeParam<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FileSystemSetConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FileSystemSetConfiguration.java new file mode 100644 index 00000000000..42984c322f9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FileSystemSetConfiguration.java @@ -0,0 +1,100 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * Set configuration of the file system. + */ +@OpMetadata( + opType = FileSystemSetConfiguration.OP_NAME, + inputsClass = FileSystemSetConfiguration.Inputs.class +) +@Operator +public final class FileSystemSetConfiguration extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FileSystemSetConfiguration"; + + public FileSystemSetConfiguration(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new FileSystemSetConfiguration operation. + * + * @param scope current scope + * @param scheme File system scheme. + * @param key The name of the configuration option. + * @param value The value of the configuration option. + * @return a new instance of FileSystemSetConfiguration + */ + @Endpoint( + describeByClass = true + ) + public static FileSystemSetConfiguration create(Scope scope, Operand scheme, + Operand key, Operand value) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FileSystemSetConfiguration"); + opBuilder.addInput(scheme.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(value.asOutput()); + return new FileSystemSetConfiguration(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = FileSystemSetConfiguration.class + ) + public static class Inputs extends RawOpInputs { + /** + * File system scheme. + */ + public final Operand scheme; + + /** + * The name of the configuration option. + */ + public final Operand key; + + /** + * The value of the configuration option. + */ + public final Operand value; + + public Inputs(GraphOperation op) { + super(new FileSystemSetConfiguration(op), op, Arrays.asList()); + int inputIndex = 0; + scheme = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java index c4f7cd0e435..8634981f57c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,9 +53,11 @@ *
  • Because {@code tf.fill} evaluates at graph runtime, it supports dynamic shapes * based on other runtime Tensors, unlike {@code tf.constant}.
  • * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Fill.OP_NAME, + inputsClass = Fill.Inputs.class +) @Operator public final class Fill extends RawOp implements Operand { /** @@ -59,8 +67,8 @@ public final class Fill extends RawOp implements Operand { private Output output; - private Fill(Operation operation) { - super(operation); + public Fill(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -101,4 +109,41 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Fill.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. Represents the shape of the output tensor. + */ + public final Operand dims; + + /** + * 0-D (scalar). Value to fill the returned tensor. + *

    {@literal @}compatibility(numpy)
    + * Equivalent to np.full + *
    {@literal @}end_compatibility + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The indexType attribute + */ + public final DataType indexType; + + public Inputs(GraphOperation op) { + super(new Fill<>(op), op, Arrays.asList("T", "index_type")); + int inputIndex = 0; + dims = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + indexType = op.attributes().getAttrType("index_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java index ed232337e3f..54d34db0923 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TType; @@ -55,6 +61,10 @@ * *

    For string data, one should expect {@code Fingerprint(data) != Fingerprint(ReduceJoin(data))} in general. */ +@OpMetadata( + opType = Fingerprint.OP_NAME, + inputsClass = Fingerprint.Inputs.class +) @Operator public final class Fingerprint extends RawOp implements Operand { /** @@ -64,8 +74,8 @@ public final class Fingerprint extends RawOp implements Operand { private Output fingerprint; - private Fingerprint(Operation operation) { - super(operation); + public Fingerprint(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; fingerprint = operation.output(outputIdx++); } @@ -105,4 +115,33 @@ public Output fingerprint() { public Output asOutput() { return fingerprint; } + + @OpInputsMetadata( + outputsClass = Fingerprint.class + ) + public static class Inputs extends RawOpInputs { + /** + * Must have rank 1 or higher. + */ + public final Operand data; + + /** + * Fingerprint method used by this op. Currently available method is + * {@code farmhash::fingerprint64}. + */ + public final Operand method; + + /** + * This can be a POD-type or string type. + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Fingerprint(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + method = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/For.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/For.java index 5cd95205c5e..db91928c495 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/For.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/For.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,25 +21,35 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** + * Applies a for loop. *

      *  output = input;
      *  for i in range(start, limit, delta)
      *    output = body(i, output);
      * 
    */ +@OpMetadata( + opType = For.OP_NAME, + inputsClass = For.Inputs.class +) @Operator public final class For extends RawOp implements Iterable> { /** @@ -50,8 +60,8 @@ public final class For extends RawOp implements Iterable> { private List> output; @SuppressWarnings("unchecked") - private For(Operation operation) { - super(operation); + public For(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -101,4 +111,46 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = For.class + ) + public static class Inputs extends RawOpInputs { + /** + * The lower bound. An int32 + */ + public final Operand start; + + /** + * The upper bound. An int32 + */ + public final Operand limit; + + /** + * The increment. An int32 + */ + public final Operand delta; + + /** + * A list of input tensors whose types are T. + */ + public final Iterable> input; + + /** + * A list of dtypes. + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new For(op), op, Arrays.asList("T")); + int inputIndex = 0; + start = (Operand) op.input(inputIndex++); + limit = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + T = op.attributes().getAttrTypeList("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java index 62b2184b690..43e09807b66 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -51,10 +57,15 @@ *

    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, a 0 is stored in the * corresponding output value. + *

    Note that on TPU, if any dimension of {@code params} is of size 0 then the output will + * be the expected shape filled with zeros. On CPU and GPU an error will be + * returned. *

    See also {@code tf.batch_gather} and {@code tf.gather_nd}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Gather.OP_NAME, + inputsClass = Gather.Inputs.class +) @Operator public final class Gather extends RawOp implements Operand { /** @@ -64,8 +75,8 @@ public final class Gather extends RawOp implements Operand { private Output output; - private Gather(Operation operation) { - super(operation); + public Gather(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -147,4 +158,58 @@ public Options batchDims(Long batchDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Gather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor from which to gather values. Must be at least rank + * {@code axis + 1}. + */ + public final Operand params; + + /** + * Index tensor. Must be in range {@code [0, params.shape[axis])}. + */ + public final Operand indices; + + /** + * The axis in {@code params} to gather {@code indices} from. Defaults to the first + * dimension. Supports negative indexes. + */ + public final Operand axis; + + /** + * The batchDims attribute + */ + public final long batchDims; + + /** + * The Tparams attribute + */ + public final DataType Tparams; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Taxis attribute + */ + public final DataType Taxis; + + public Inputs(GraphOperation op) { + super(new Gather<>(op), op, Arrays.asList("batch_dims", "Tparams", "Tindices", "Taxis")); + int inputIndex = 0; + params = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + batchDims = op.attributes().getAttrInt("batch_dims"); + Tparams = op.attributes().getAttrType("Tparams"); + Tindices = op.attributes().getAttrType("Tindices"); + Taxis = op.attributes().getAttrType("Taxis"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java index 3d0b72d0985..755bf4e7905 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -51,9 +57,17 @@ *

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

    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, a 0 is stored in the - * corresponding output value. + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore error and set the corresponding output to 0; + * supported on both CPU and GPU.
    6. + *
    *

    Some examples below. *

    Simple indexing into a matrix: *

    @@ -119,9 +133,11 @@
      *     output = [['b0', 'b1'], ['d0', 'c1']]
      * 
    *

    See also {@code tf.gather} and {@code tf.batch_gather}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = GatherNd.OP_NAME, + inputsClass = GatherNd.Inputs.class +) @Operator public final class GatherNd extends RawOp implements Operand { /** @@ -131,8 +147,8 @@ public final class GatherNd extends RawOp implements Operand private Output output; - private GatherNd(Operation operation) { - super(operation); + public GatherNd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -143,6 +159,7 @@ private GatherNd(Operation operation) { * @param scope current scope * @param params The tensor from which to gather values. * @param indices Index tensor. + * @param options carries optional attribute values * @param data type for {@code GatherNd} output and operands * @return a new instance of GatherNd */ @@ -150,13 +167,30 @@ private GatherNd(Operation operation) { describeByClass = true ) public static GatherNd create(Scope scope, Operand params, - Operand indices) { + Operand indices, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GatherNd"); opBuilder.addInput(params.asOutput()); opBuilder.addInput(indices.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new GatherNd<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * Values from {@code params} gathered from indices given by {@code indices}, with @@ -171,4 +205,65 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.GatherNd} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = GatherNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor from which to gather values. + */ + public final Operand params; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * The Tparams attribute + */ + public final DataType Tparams; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new GatherNd<>(op), op, Arrays.asList("Tparams", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + params = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + Tparams = op.attributes().getAttrType("Tparams"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetElementAtIndex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetElementAtIndex.java new file mode 100644 index 00000000000..065404e1735 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetElementAtIndex.java @@ -0,0 +1,141 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * Gets the element at the specified index in a dataset. + */ +@OpMetadata( + opType = GetElementAtIndex.OP_NAME, + inputsClass = GetElementAtIndex.Inputs.class +) +@Operator +public final class GetElementAtIndex extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetElementAtIndex"; + + private List> components; + + @SuppressWarnings("unchecked") + public GetElementAtIndex(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + + /** + * Factory method to create a class wrapping a new GetElementAtIndex operation. + * + * @param scope current scope + * @param dataset The dataset value + * @param index The index value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of GetElementAtIndex + */ + @Endpoint( + describeByClass = true + ) + public static GetElementAtIndex create(Scope scope, Operand dataset, + Operand index, List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetElementAtIndex"); + opBuilder.addInput(dataset.asOutput()); + opBuilder.addInput(index.asOutput()); + 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 GetElementAtIndex(opBuilder.build()); + } + + /** + * Gets components. + * + * @return components. + */ + public List> components() { + return components; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) components.iterator(); + } + + @OpInputsMetadata( + outputsClass = GetElementAtIndex.class + ) + public static class Inputs extends RawOpInputs { + /** + * The dataset input + */ + public final Operand dataset; + + /** + * The index input + */ + public final Operand index; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new GetElementAtIndex(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetOptions.java new file mode 100644 index 00000000000..f6c5340587d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetOptions.java @@ -0,0 +1,103 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Returns the {@code tf.data.Options} attached to {@code input_dataset}. + */ +@OpMetadata( + opType = GetOptions.OP_NAME, + inputsClass = GetOptions.Inputs.class +) +@Operator +public final class GetOptions extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetOptions"; + + private Output serializedOptions; + + public GetOptions(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + serializedOptions = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetOptions operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the input dataset. + * @return a new instance of GetOptions + */ + @Endpoint( + describeByClass = true + ) + public static GetOptions create(Scope scope, Operand inputDataset) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetOptions"); + opBuilder.addInput(inputDataset.asOutput()); + return new GetOptions(opBuilder.build()); + } + + /** + * Gets serializedOptions. + * + * @return serializedOptions. + */ + public Output serializedOptions() { + return serializedOptions; + } + + @Override + public Output asOutput() { + return serializedOptions; + } + + @OpInputsMetadata( + outputsClass = GetOptions.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + public Inputs(GraphOperation op) { + super(new GetOptions(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java index ddc417fe239..36f2e7a2cb5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Store the input tensor in the state of the current session. */ +@OpMetadata( + opType = GetSessionHandle.OP_NAME, + inputsClass = GetSessionHandle.Inputs.class +) @Operator public final class GetSessionHandle extends RawOp implements Operand { /** @@ -40,8 +50,8 @@ public final class GetSessionHandle extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private GetSessionHandle(Operation operation) { - super(operation); + public GetSessionHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -77,4 +87,26 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = GetSessionHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to be stored. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new GetSessionHandle(op), op, Arrays.asList("T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java index f49527c73eb..0cccfb42045 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Get the value of the tensor specified by its handle. - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = GetSessionTensor.OP_NAME, + inputsClass = GetSessionTensor.Inputs.class +) @Operator public final class GetSessionTensor extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class GetSessionTensor extends RawOp implements Op private Output value; - private GetSessionTensor(Operation operation) { - super(operation); + public GetSessionTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -82,4 +90,26 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = GetSessionTensor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle for a tensor stored in the session state. + */ + public final Operand handle; + + /** + * The type of the output value. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new GetSessionTensor<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java index 12869e0b856..c4235de8ff2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ *

    Only accepts value typed tensors as inputs and rejects resource variable handles * as input. *

    Returns the input tensor without modification. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = GuaranteeConst.OP_NAME, + inputsClass = GuaranteeConst.Inputs.class +) @Operator public final class GuaranteeConst extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class GuaranteeConst extends RawOp implements Oper private Output output; - private GuaranteeConst(Operation operation) { - super(operation); + public GuaranteeConst(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,7 +63,7 @@ private GuaranteeConst(Operation operation) { * Factory method to create a class wrapping a new GuaranteeConst operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code GuaranteeConst} output and operands * @return a new instance of GuaranteeConst */ @@ -81,4 +89,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = GuaranteeConst.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new GuaranteeConst<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java index e29387af1b8..2b635533191 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ * Before using the table you will have to initialize it. After initialization the * table will be immutable. */ +@OpMetadata( + opType = HashTable.OP_NAME, + inputsClass = HashTable.Inputs.class +) @Operator public final class HashTable extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class HashTable extends RawOp implements Operand { private Output tableHandle; @SuppressWarnings("unchecked") - private HashTable(Operation operation) { - super(operation); + public HashTable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tableHandle = operation.output(outputIdx++); } @@ -182,4 +192,47 @@ public Options useNodeNameSharing(Boolean useNodeNameSharing) { return this; } } + + @OpInputsMetadata( + outputsClass = HashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this table is shared under the given name across + * multiple sessions. + */ + public final String sharedName; + + /** + * If true and shared_name is empty, the table is shared + * using the node name. + */ + public final boolean useNodeNameSharing; + + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new HashTable(op), op, Arrays.asList("container", "shared_name", "use_node_name_sharing", "key_dtype", "value_dtype")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + useNodeNameSharing = op.attributes().getAttrBool("use_node_name_sharing"); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java index 0188d810dad..782cfc69f05 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -45,9 +51,11 @@ * variables.global_variables_initializer().run() * sess.run(hist) => [2, 1, 1, 0, 2] * - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = HistogramFixedWidth.OP_NAME, + inputsClass = HistogramFixedWidth.Inputs.class +) @Operator public final class HistogramFixedWidth extends RawOp implements Operand { /** @@ -57,8 +65,8 @@ public final class HistogramFixedWidth extends RawOp implemen private Output out; - private HistogramFixedWidth(Operation operation) { - super(operation); + public HistogramFixedWidth(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -72,7 +80,7 @@ private HistogramFixedWidth(Operation operation) { * values <= value_range[0] will be mapped to hist[0], * values >= value_range[1] will be mapped to hist[-1]. * @param nbins Scalar {@code int32 Tensor}. Number of histogram bins. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param data type for {@code HistogramFixedWidth} output and operands * @param data type for {@code HistogramFixedWidth} output and operands * @return a new instance of HistogramFixedWidth @@ -123,4 +131,46 @@ public Output out() { public Output asOutput() { return out; } + + @OpInputsMetadata( + outputsClass = HistogramFixedWidth.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Numeric {@code Tensor}. + */ + public final Operand values; + + /** + * Shape [2] {@code Tensor} of same {@code dtype} as {@code values}. + * values <= value_range[0] will be mapped to hist[0], + * values >= value_range[1] will be mapped to hist[-1]. + */ + public final Operand valueRange; + + /** + * Scalar {@code int32 Tensor}. Number of histogram bins. + */ + public final Operand nbins; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new HistogramFixedWidth<>(op), op, Arrays.asList("T", "dtype")); + int inputIndex = 0; + values = (Operand) op.input(inputIndex++); + valueRange = (Operand) op.input(inputIndex++); + nbins = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HostConst.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HostConst.java new file mode 100644 index 00000000000..82f5ef8f295 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HostConst.java @@ -0,0 +1,114 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.Tensor; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Returns a constant tensor on the host. Only for writing C++ tests. + */ +@OpMetadata( + opType = HostConst.OP_NAME, + inputsClass = HostConst.Inputs.class +) +@Operator +public final class HostConst extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HostConst"; + + private Output output; + + public HostConst(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new HostConst operation. + * + * @param scope current scope + * @param value Attr {@code value} is the tensor to return. + * @param dtype The value of the dtype attribute + * @param data type for {@code HostConst} output and operands + * @return a new instance of HostConst + */ + @Endpoint( + describeByClass = true + ) + public static HostConst create(Scope scope, Tensor value, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "HostConst"); + opBuilder.setAttr("value", value); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new HostConst<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = HostConst.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Attr {@code value} is the tensor to return. + */ + public final Tensor value; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new HostConst<>(op), op, Arrays.asList("value", "dtype")); + int inputIndex = 0; + value = op.attributes().getAttrTensor("value"); + dtype = op.attributes().getAttrType("dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java index 25cb4a0ee7e..d0729ab93da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Return a tensor with the same shape and contents as the input tensor or value. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Identity.OP_NAME, + inputsClass = Identity.Inputs.class +) @Operator public final class Identity extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class Identity extends RawOp implements Operand private Output output; - private Identity(Operation operation) { - super(operation); + public Identity(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -51,7 +59,7 @@ private Identity(Operation operation) { * Factory method to create a class wrapping a new Identity operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code Identity} output and operands * @return a new instance of Identity */ @@ -77,4 +85,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Identity.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Identity<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java index 794f2a63e4a..f3f9d1a017b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -47,6 +52,10 @@ * return [None, g(dy)] # Do not backprop to f(x). * */ +@OpMetadata( + opType = IdentityN.OP_NAME, + inputsClass = IdentityN.Inputs.class +) @Operator public final class IdentityN extends RawOp implements Iterable> { /** @@ -57,8 +66,8 @@ public final class IdentityN extends RawOp implements Iterable> { private List> output; @SuppressWarnings("unchecked") - private IdentityN(Operation operation) { - super(operation); + public IdentityN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -69,7 +78,7 @@ private IdentityN(Operation operation) { * Factory method to create a class wrapping a new IdentityN operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of IdentityN */ @Endpoint( @@ -95,4 +104,28 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = IdentityN.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Iterable> input; + + /** + * The T attribute + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new IdentityN(op), op, Arrays.asList("T")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + T = op.attributes().getAttrTypeList("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/If.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/If.java index 2ba19c25f25..c1635ef8c06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/If.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/If.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -98,7 +98,7 @@ static Options outputShapes(List outputShapes) { * @param outputShapes the outputShapes option * @return this Options instance. */ - static Options outputShapes(Shape[] outputShapes) { + static Options outputShapes(Shape... outputShapes) { return new Options().outputShapes(outputShapes); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java index be6d47d25ab..12d647268ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,17 +26,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns immutable tensor from memory region. * The current implementation memmaps the tensor from a file. - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = ImmutableConst.OP_NAME, + inputsClass = ImmutableConst.Inputs.class +) @Operator public final class ImmutableConst extends RawOp implements Operand { /** @@ -44,8 +52,8 @@ public final class ImmutableConst extends RawOp implements Oper private Output tensor; - private ImmutableConst(Operation operation) { - super(operation); + public ImmutableConst(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tensor = operation.output(outputIdx++); } @@ -86,4 +94,33 @@ public Output tensor() { public Output asOutput() { return tensor; } + + @OpInputsMetadata( + outputsClass = ImmutableConst.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Type of the returned tensor. + */ + public final DataType dtype; + + /** + * Shape of the returned tensor. + */ + public final Shape shape; + + /** + * Name of readonly memory region used by the tensor, see + * NewReadOnlyMemoryRegionFromFile in tensorflow::Env. + */ + public final String memoryRegionName; + + public Inputs(GraphOperation op) { + super(new ImmutableConst<>(op), op, Arrays.asList("dtype", "shape", "memory_region_name")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + memoryRegionName = op.attributes().getAttrString("memory_region_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java index 65156cd5a92..40225873359 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,28 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Table initializer that takes two tensors for keys and values respectively. */ +@OpMetadata( + opType = InitializeTable.OP_NAME, + inputsClass = InitializeTable.Inputs.class +) @Operator public final class InitializeTable extends RawOp { /** @@ -36,8 +46,8 @@ public final class InitializeTable extends RawOp { */ public static final String OP_NAME = "InitializeTableV2"; - private InitializeTable(Operation operation) { - super(operation); + public InitializeTable(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +70,44 @@ public static InitializeTable create(Scope scope, Operand table opBuilder.addInput(values.asOutput()); return new InitializeTable(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = InitializeTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a table which will be initialized. + */ + public final Operand tableHandle; + + /** + * Keys of type Tkey. + */ + public final Operand keys; + + /** + * Values of type Tval. + */ + public final Operand values; + + /** + * The Tkey attribute + */ + public final DataType Tkey; + + /** + * The Tval attribute + */ + public final DataType Tval; + + public Inputs(GraphOperation op) { + super(new InitializeTable(op), op, Arrays.asList("Tkey", "Tval")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + Tkey = op.attributes().getAttrType("Tkey"); + Tval = op.attributes().getAttrType("Tval"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java index 27971df17b5..d8a78e24266 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -41,6 +46,10 @@ * on {@code delimiter}. * */ +@OpMetadata( + opType = InitializeTableFromTextFile.OP_NAME, + inputsClass = InitializeTableFromTextFile.Inputs.class +) @Operator public final class InitializeTableFromTextFile extends RawOp { /** @@ -48,8 +57,8 @@ public final class InitializeTableFromTextFile extends RawOp { */ public static final String OP_NAME = "InitializeTableFromTextFileV2"; - private InitializeTableFromTextFile(Operation operation) { - super(operation); + public InitializeTableFromTextFile(Operation operation) { + super(operation, OP_NAME); } /** @@ -167,4 +176,57 @@ public Options offset(Long offset) { return this; } } + + @OpInputsMetadata( + outputsClass = InitializeTableFromTextFile.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a table which will be initialized. + */ + public final Operand tableHandle; + + /** + * Filename of a vocabulary text file. + */ + public final Operand filename; + + /** + * Column index in a line to get the table {@code key} values from. + */ + public final long keyIndex; + + /** + * Column index that represents information of a line to get the table + * {@code value} values from. + */ + public final long valueIndex; + + /** + * Number of elements of the file, use -1 if unknown. + */ + public final long vocabSize; + + /** + * Delimiter to separate fields in a line. + */ + public final String delimiter; + + /** + * The offset attribute + */ + public final long offset; + + public Inputs(GraphOperation op) { + super(new InitializeTableFromTextFile(op), op, Arrays.asList("key_index", "value_index", "vocab_size", "delimiter", "offset")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + filename = (Operand) op.input(inputIndex++); + keyIndex = op.attributes().getAttrInt("key_index"); + valueIndex = op.attributes().getAttrInt("value_index"); + vocabSize = op.attributes().getAttrInt("vocab_size"); + delimiter = op.attributes().getAttrString("delimiter"); + offset = op.attributes().getAttrInt("offset"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java index 42f4d90e0a6..78f37851589 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ *

      * Computes y = x; y[i, :] += v; return y.
      * 
    - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = InplaceAdd.OP_NAME, + inputsClass = InplaceAdd.Inputs.class +) @Operator public final class InplaceAdd extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class InplaceAdd extends RawOp implements Operand< private Output y; - private InplaceAdd(Operation operation) { - super(operation); + public InplaceAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -86,4 +94,38 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = InplaceAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor} of type T. + */ + public final Operand x; + + /** + * A vector. Indices into the left-most dimension of {@code x}. + */ + public final Operand i; + + /** + * A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + */ + public final Operand v; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InplaceAdd<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + i = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java index 67be6f601a8..31d0287aab2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * * Computes y = x; y[i, :] -= v; return y. * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = InplaceSub.OP_NAME, + inputsClass = InplaceSub.Inputs.class +) @Operator public final class InplaceSub extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class InplaceSub extends RawOp implements Operand< private Output y; - private InplaceSub(Operation operation) { - super(operation); + public InplaceSub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -87,4 +95,38 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = InplaceSub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor} of type T. + */ + public final Operand x; + + /** + * A vector. Indices into the left-most dimension of {@code x}. + */ + public final Operand i; + + /** + * A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + */ + public final Operand v; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InplaceSub<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + i = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java index 0cdc6d077f8..d34e0f15011 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * Computes {@code x[i, :] = v; return x}. *

    Originally this function is mutative however for compilation we make this * operation create / operate on a copy of {@code x}. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = InplaceUpdate.OP_NAME, + inputsClass = InplaceUpdate.Inputs.class +) @Operator public final class InplaceUpdate extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class InplaceUpdate extends RawOp implements Opera private Output y; - private InplaceUpdate(Operation operation) { - super(operation); + public InplaceUpdate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -86,4 +94,38 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = InplaceUpdate.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor of type {@code T}. + */ + public final Operand x; + + /** + * A vector. Indices into the left-most dimension of {@code x}. + */ + public final Operand i; + + /** + * A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + */ + public final Operand v; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InplaceUpdate<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + i = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java index 30f37d85402..c4519eb940e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -32,6 +38,10 @@ * Checks whether a tensor has been initialized. * Outputs boolean scalar indicating whether the tensor has been initialized. */ +@OpMetadata( + opType = IsVariableInitialized.OP_NAME, + inputsClass = IsVariableInitialized.Inputs.class +) @Operator public final class IsVariableInitialized extends RawOp implements Operand { /** @@ -41,8 +51,8 @@ public final class IsVariableInitialized extends RawOp implements Operand private Output isInitialized; - private IsVariableInitialized(Operation operation) { - super(operation); + public IsVariableInitialized(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; isInitialized = operation.output(outputIdx++); } @@ -76,4 +86,26 @@ public Output isInitialized() { public Output asOutput() { return isInitialized; } + + @OpInputsMetadata( + outputsClass = IsVariableInitialized.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. May be uninitialized. + */ + public final Operand ref; + + /** + * The type of elements in the variable tensor. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new IsVariableInitialized(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } 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 index 000f85c7791..41f2ee0be06 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; @@ -44,6 +49,10 @@ * equal to the Kth order statistic. The semantics are not the same as * top_k_unique. */ +@OpMetadata( + opType = KthOrderStatistic.OP_NAME, + inputsClass = KthOrderStatistic.Inputs.class +) @Operator public final class KthOrderStatistic extends RawOp implements Operand { /** @@ -53,8 +62,8 @@ public final class KthOrderStatistic extends RawOp implements Operand private Output output; - private KthOrderStatistic(Operation operation) { - super(operation); + public KthOrderStatistic(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -63,8 +72,8 @@ private KthOrderStatistic(Operation operation) { * Factory method to create a class wrapping a new KthOrderStatistic operation. * * @param scope current scope - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of KthOrderStatistic */ @Endpoint( @@ -90,4 +99,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = KthOrderStatistic.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The k attribute + */ + public final long k; + + public Inputs(GraphOperation op) { + super(new KthOrderStatistic(op), op, Arrays.asList("k")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = op.attributes().getAttrInt("k"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java index 03f9bfde2fa..317eb054e29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,27 +17,37 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Generates values in an interval. * A sequence of {@code num} evenly-spaced values are generated beginning at {@code start}. - * If {@code num > 1}, the values in the sequence increase by {@code stop - start / num - 1}, - * so that the last one is exactly {@code stop}. + * If {@code num > 1}, the values in the sequence increase by + * {@code (stop - start) / (num - 1)}, so that the last one is exactly {@code stop}. *

    For example: *

      * tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0  11.0  12.0]
      * 
    - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = LinSpace.OP_NAME, + inputsClass = LinSpace.Inputs.class +) +@Operator public final class LinSpace extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +56,8 @@ public final class LinSpace extends RawOp implements Operand< private Output output; - private LinSpace(Operation operation) { - super(operation); + public LinSpace(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -87,4 +97,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = LinSpace.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D tensor. First entry in the range. + */ + public final Operand start; + + /** + * 0-D tensor. Last entry in the range. + */ + public final Operand stop; + + /** + * 0-D tensor. Number of values to generate. + */ + public final Operand num; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new LinSpace<>(op), op, Arrays.asList("T", "Tidx")); + int inputIndex = 0; + start = (Operand) op.input(inputIndex++); + stop = (Operand) op.input(inputIndex++); + num = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java index 2b8b6d6c798..7546b26f8f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Outputs all keys and values in the table. - * - * @param data type for {@code keys} output - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = LookupTableExport.OP_NAME, + inputsClass = LookupTableExport.Inputs.class +) @Operator public final class LookupTableExport extends RawOp { /** @@ -46,8 +52,8 @@ public final class LookupTableExport extends R private Output values; - private LookupTableExport(Operation operation) { - super(operation); + public LookupTableExport(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; keys = operation.output(outputIdx++); values = operation.output(outputIdx++); @@ -58,8 +64,8 @@ private LookupTableExport(Operation operation) { * * @param scope current scope * @param tableHandle Handle to the table. - * @param Tkeys the value of the Tkeys property - * @param Tvalues the value of the Tvalues property + * @param Tkeys The value of the Tkeys attribute + * @param Tvalues The value of the Tvalues attribute * @param data type for {@code LookupTableExportV2} output and operands * @param data type for {@code LookupTableExportV2} output and operands * @return a new instance of LookupTableExport @@ -93,4 +99,32 @@ public Output keys() { public Output values() { return values; } + + @OpInputsMetadata( + outputsClass = LookupTableExport.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + /** + * The Tkeys attribute + */ + public final DataType Tkeys; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + public Inputs(GraphOperation op) { + super(new LookupTableExport<>(op), op, Arrays.asList("Tkeys", "Tvalues")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + Tkeys = op.attributes().getAttrType("Tkeys"); + Tvalues = op.attributes().getAttrType("Tvalues"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java index e7d4586a47e..1155c94662f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ * The output {@code values} is of the type of the table values. *

    The scalar {@code default_value} is the value output for keys not present in the * table. It must also be of the same type as the table values. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = LookupTableFind.OP_NAME, + inputsClass = LookupTableFind.Inputs.class +) @Operator public final class LookupTableFind extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class LookupTableFind extends RawOp implements Ope private Output values; - private LookupTableFind(Operation operation) { - super(operation); + public LookupTableFind(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; values = operation.output(outputIdx++); } @@ -57,7 +65,7 @@ private LookupTableFind(Operation operation) { * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. - * @param defaultValue the defaultValue value + * @param defaultValue The defaultValue value * @param data type for {@code LookupTableFindV2} output and operands * @return a new instance of LookupTableFind */ @@ -88,4 +96,44 @@ public Output values() { public Output asOutput() { return values; } + + @OpInputsMetadata( + outputsClass = LookupTableFind.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + /** + * Any shape. Keys to look up. + */ + public final Operand keys; + + /** + * The defaultValue input + */ + public final Operand defaultValue; + + /** + * The Tin attribute + */ + public final DataType Tin; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new LookupTableFind<>(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + defaultValue = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java index 053f2f0091d..b2297992969 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * The tensor {@code keys} must be of the same type as the keys of the table. * The tensor {@code values} must be of the type of the table values. */ +@OpMetadata( + opType = LookupTableImport.OP_NAME, + inputsClass = LookupTableImport.Inputs.class +) @Operator public final class LookupTableImport extends RawOp { /** @@ -38,8 +48,8 @@ public final class LookupTableImport extends RawOp { */ public static final String OP_NAME = "LookupTableImportV2"; - private LookupTableImport(Operation operation) { - super(operation); + public LookupTableImport(Operation operation) { + super(operation, OP_NAME); } /** @@ -62,4 +72,44 @@ public static LookupTableImport create(Scope scope, Operand tab opBuilder.addInput(values.asOutput()); return new LookupTableImport(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = LookupTableImport.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + /** + * Any shape. Keys to look up. + */ + public final Operand keys; + + /** + * Values to associate with keys. + */ + public final Operand values; + + /** + * The Tin attribute + */ + public final DataType Tin; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new LookupTableImport(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java index f5616043057..37533b9501d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * The tensor {@code keys} must be of the same type as the keys of the table. * The tensor {@code values} must be of the type of the table values. */ +@OpMetadata( + opType = LookupTableInsert.OP_NAME, + inputsClass = LookupTableInsert.Inputs.class +) @Operator public final class LookupTableInsert extends RawOp { /** @@ -38,8 +48,8 @@ public final class LookupTableInsert extends RawOp { */ public static final String OP_NAME = "LookupTableInsertV2"; - private LookupTableInsert(Operation operation) { - super(operation); + public LookupTableInsert(Operation operation) { + super(operation, OP_NAME); } /** @@ -62,4 +72,44 @@ public static LookupTableInsert create(Scope scope, Operand tab opBuilder.addInput(values.asOutput()); return new LookupTableInsert(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = LookupTableInsert.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + /** + * Any shape. Keys to look up. + */ + public final Operand keys; + + /** + * Values to associate with keys. + */ + public final Operand values; + + /** + * The Tin attribute + */ + public final DataType Tin; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new LookupTableInsert(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java index c732e49e4a2..9d52aae0ff8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -30,14 +37,19 @@ * The tensor {@code keys} must of the same type as the keys of the table. Keys not * already in the table are silently ignored. */ +@OpMetadata( + opType = LookupTableRemove.OP_NAME, + inputsClass = LookupTableRemove.Inputs.class +) +@Operator public final class LookupTableRemove extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LookupTableRemoveV2"; - private LookupTableRemove(Operation operation) { - super(operation); + public LookupTableRemove(Operation operation) { + super(operation, OP_NAME); } /** @@ -58,4 +70,32 @@ public static LookupTableRemove create(Scope scope, Operand tab opBuilder.addInput(keys.asOutput()); return new LookupTableRemove(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = LookupTableRemove.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + /** + * Any shape. Keys of the elements to remove. + */ + public final Operand keys; + + /** + * The Tin attribute + */ + public final DataType Tin; + + public Inputs(GraphOperation op) { + super(new LookupTableRemove(op), op, Arrays.asList("Tin")); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + keys = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java index 3f830d19ae6..d5109600e72 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Computes the number of elements in the given table. */ +@OpMetadata( + opType = LookupTableSize.OP_NAME, + inputsClass = LookupTableSize.Inputs.class +) @Operator public final class LookupTableSize extends RawOp implements Operand { /** @@ -40,8 +49,8 @@ public final class LookupTableSize extends RawOp implements Operand { private Output output; - private LookupTableSize(Operation operation) { - super(operation); + public LookupTableSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -75,4 +84,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = LookupTableSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to the table. + */ + public final Operand tableHandle; + + public Inputs(GraphOperation op) { + super(new LookupTableSize(op), op, Arrays.asList()); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java index ebec402e7c7..a2e558f17a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; @@ -32,6 +37,10 @@ * This operator represents the loop termination condition used by the * "pivot" switches of a loop. */ +@OpMetadata( + opType = LoopCond.OP_NAME, + inputsClass = LoopCond.Inputs.class +) @Operator public final class LoopCond extends RawOp implements Operand { /** @@ -41,8 +50,8 @@ public final class LoopCond extends RawOp implements Operand { private Output output; - private LoopCond(Operation operation) { - super(operation); + public LoopCond(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +85,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = LoopCond.class + ) + public static class Inputs extends RawOpInputs { + /** + * A boolean scalar, representing the branch predicate of the Switch op. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new LoopCond(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java index c85ad6e4d03..2a4b761a8fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -44,9 +51,12 @@ *

    result = LowerBound(sorted_sequence, values) *

    result == [[1, 2, 2], * [0, 1, 5]] - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = LowerBound.OP_NAME, + inputsClass = LowerBound.Inputs.class +) +@Operator public final class LowerBound extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -55,8 +65,8 @@ public final class LowerBound extends RawOp implements Operan private Output output; - private LowerBound(Operation operation) { - super(operation); + public LowerBound(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -68,7 +78,7 @@ private LowerBound(Operation operation) { * @param sortedInputs 2-D Tensor where each row is ordered. * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains * the values that will be searched for in {@code sorted_search_values}. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code LowerBound} output and operands * @param data type for {@code LowerBound} output and operands * @return a new instance of LowerBound @@ -118,4 +128,39 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = LowerBound.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D Tensor where each row is ordered. + */ + public final Operand sortedInputs; + + /** + * 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new LowerBound<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + sortedInputs = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } 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 index 08c937e66d0..a769abd1d5a 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; @@ -34,6 +39,10 @@ * of the corresponding output element. Behavior for infinite elements is * undefined. Behavior for subnormal elements is undefined. */ +@OpMetadata( + opType = MakeUnique.OP_NAME, + inputsClass = MakeUnique.Inputs.class +) @Operator public final class MakeUnique extends RawOp implements Operand { /** @@ -43,8 +52,8 @@ public final class MakeUnique extends RawOp implements Operand { private Output output; - private MakeUnique(Operation operation) { - super(operation); + public MakeUnique(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +62,7 @@ private MakeUnique(Operation operation) { * Factory method to create a class wrapping a new MakeUnique operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of MakeUnique */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = MakeUnique.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new MakeUnique(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java index 3c5286f441e..ddde416f94f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Op removes all elements in the underlying container. */ +@OpMetadata( + opType = MapClear.OP_NAME, + inputsClass = MapClear.Inputs.class +) @Operator public final class MapClear extends RawOp { /** @@ -37,15 +47,15 @@ public final class MapClear extends RawOp { */ public static final String OP_NAME = "MapClear"; - private MapClear(Operation operation) { - super(operation); + public MapClear(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new MapClear operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapClear */ @@ -174,4 +184,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapClear.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapClear(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapDefun.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapDefun.java index 79a32975feb..5c91ffea662 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapDefun.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapDefun.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,8 +29,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -44,6 +50,11 @@ *

    Note that this op is not exposed to users directly, but is invoked in tf.data * rewrites. */ +@OpMetadata( + opType = MapDefun.OP_NAME, + inputsClass = MapDefun.Inputs.class +) +@Operator public final class MapDefun extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +64,8 @@ public final class MapDefun extends RawOp implements Iterable> { private List> output; @SuppressWarnings("unchecked") - private MapDefun(Operation operation) { - super(operation); + public MapDefun(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -75,7 +86,7 @@ private MapDefun(Operation operation) { * * @param outputTypes A list of types. * @param outputShapes A list of shapes. - * @param f the value of the f property + * @param f The value of the f attribute * @param options carries optional attribute values * @return a new instance of MapDefun */ @@ -154,4 +165,66 @@ public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { return this; } } + + @OpInputsMetadata( + outputsClass = MapDefun.class + ) + public static class Inputs extends RawOpInputs { + /** + *

    +     * A list of tensors whose types are `Targuments`, corresponding to the inputs
    +     * the function should be mapped over.
    +     * 
    + */ + public final Iterable> arguments; + + /** + *
    +     * A list of tensors whose types are `Tcaptured`, corresponding to the captured
    +     * inputs of the defun.
    +     * 
    + */ + public final Iterable> capturedInputs; + + /** + * A list of types. + */ + public final DataType[] Targuments; + + /** + * A list of types. + */ + public final DataType[] Tcaptured; + + /** + * A list of types. + */ + public final DataType[] outputTypes; + + /** + * A list of shapes. + */ + public final Shape[] outputShapes; + + /** + * The maxIntraOpParallelism attribute + */ + public final long maxIntraOpParallelism; + + public Inputs(GraphOperation op) { + super(new MapDefun(op), op, Arrays.asList("Targuments", "Tcaptured", "output_types", "output_shapes", "max_intra_op_parallelism")); + int inputIndex = 0; + int argumentsLength = op.inputListLength("arguments"); + arguments = Arrays.asList((Operand[]) op.inputList(inputIndex, argumentsLength)); + inputIndex += argumentsLength; + int capturedInputsLength = op.inputListLength("captured_inputs"); + capturedInputs = Arrays.asList((Operand[]) op.inputList(inputIndex, capturedInputsLength)); + inputIndex += capturedInputsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + Tcaptured = op.attributes().getAttrTypeList("Tcaptured"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + maxIntraOpParallelism = op.attributes().getAttrInt("max_intra_op_parallelism"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java index 62bd05c0e04..5229601cc82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Op returns the number of incomplete elements in the underlying container. */ +@OpMetadata( + opType = MapIncompleteSize.OP_NAME, + inputsClass = MapIncompleteSize.Inputs.class +) @Operator public final class MapIncompleteSize extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class MapIncompleteSize extends RawOp implements Operand { private Output output; - private MapIncompleteSize(Operation operation) { - super(operation); + public MapIncompleteSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +62,7 @@ private MapIncompleteSize(Operation operation) { * Factory method to create a class wrapping a new MapIncompleteSize operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapIncompleteSize */ @@ -195,4 +205,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapIncompleteSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapIncompleteSize(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java index c6adbd2b857..1c97902548a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -38,6 +43,10 @@ * underlying container does not contain this key * this op will block until it does. */ +@OpMetadata( + opType = MapPeek.OP_NAME, + inputsClass = MapPeek.Inputs.class +) @Operator public final class MapPeek extends RawOp implements Iterable> { /** @@ -48,8 +57,8 @@ public final class MapPeek extends RawOp implements Iterable> { private List> values; @SuppressWarnings("unchecked") - private MapPeek(Operation operation) { - super(operation); + public MapPeek(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -60,9 +69,9 @@ private MapPeek(Operation operation) { * Factory method to create a class wrapping a new MapPeek operation. * * @param scope current scope - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapPeek */ @@ -208,4 +217,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapPeek.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key input + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapPeek(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java index ceadc2bef4e..b1ccfb83c75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Op returns the number of elements in the underlying container. */ +@OpMetadata( + opType = MapSize.OP_NAME, + inputsClass = MapSize.Inputs.class +) @Operator public final class MapSize extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class MapSize extends RawOp implements Operand { private Output output; - private MapSize(Operation operation) { - super(operation); + public MapSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +62,7 @@ private MapSize(Operation operation) { * Factory method to create a class wrapping a new MapSize operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapSize */ @@ -195,4 +205,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapSize(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java index 574cd60547f..19d9c0e99f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ /** * Stage (key, values) in the underlying container which behaves like a hashtable. */ +@OpMetadata( + opType = MapStage.OP_NAME, + inputsClass = MapStage.Inputs.class +) @Operator public final class MapStage extends RawOp { /** @@ -40,8 +50,8 @@ public final class MapStage extends RawOp { */ public static final String OP_NAME = "MapStage"; - private MapStage(Operation operation) { - super(operation); + public MapStage(Operation operation) { + super(operation, OP_NAME); } /** @@ -49,10 +59,10 @@ private MapStage(Operation operation) { * * @param scope current scope * @param key int64 - * @param indices the indices value + * @param indices The indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapStage */ @@ -188,4 +198,73 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapStage.class + ) + public static class Inputs extends RawOpInputs { + /** + * int64 + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * a list of tensors + * dtypes A list of data types that inserted values should adhere to. + */ + public final Iterable> values; + + /** + * Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The fakeDtypes attribute + */ + public final DataType[] fakeDtypes; + + /** + * If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + */ + public final String container; + + /** + * It is necessary to match this name to the matching Unstage Op. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapStage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "fake_dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + fakeDtypes = op.attributes().getAttrTypeList("fake_dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java index 2ef7744f042..f96989e592e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -38,6 +43,10 @@ * from the underlying container. If the underlying container * does not contain this key, the op will block until it does. */ +@OpMetadata( + opType = MapUnstage.OP_NAME, + inputsClass = MapUnstage.Inputs.class +) @Operator public final class MapUnstage extends RawOp implements Iterable> { /** @@ -48,8 +57,8 @@ public final class MapUnstage extends RawOp implements Iterable> private List> values; @SuppressWarnings("unchecked") - private MapUnstage(Operation operation) { - super(operation); + public MapUnstage(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -60,9 +69,9 @@ private MapUnstage(Operation operation) { * Factory method to create a class wrapping a new MapUnstage operation. * * @param scope current scope - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapUnstage */ @@ -208,4 +217,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapUnstage.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key input + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapUnstage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java index 81f4f6d9be4..7126cc62c2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,15 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,6 +42,10 @@ * from the underlying container. If the underlying container * does not contain elements, the op will block until it does. */ +@OpMetadata( + opType = MapUnstageNoKey.OP_NAME, + inputsClass = MapUnstageNoKey.Inputs.class +) @Operator public final class MapUnstageNoKey extends RawOp { /** @@ -49,8 +58,8 @@ public final class MapUnstageNoKey extends RawOp { private List> values; @SuppressWarnings("unchecked") - private MapUnstageNoKey(Operation operation) { - super(operation); + public MapUnstageNoKey(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; key = operation.output(outputIdx++); int valuesLength = operation.outputListLength("values"); @@ -62,8 +71,8 @@ private MapUnstageNoKey(Operation operation) { * Factory method to create a class wrapping a new MapUnstageNoKey operation. * * @param scope current scope - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of MapUnstageNoKey */ @@ -211,4 +220,50 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = MapUnstageNoKey.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new MapUnstageNoKey(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java index 80021bab383..04c4f1481d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Max.OP_NAME, + inputsClass = Max.Inputs.class +) @Operator public final class Max extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class Max extends RawOp implements Operand { private Output output; - private Max(Operation operation) { - super(operation); + public Max(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +132,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Max.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Max<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java index 1394ac32f14..f5a189c9c58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * It is usually combined with {@code Switch} to implement branching. *

    {@code Merge} forwards the first tensor to become available to {@code output}, and sets * {@code value_index} to its index in {@code inputs}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Merge.OP_NAME, + inputsClass = Merge.Inputs.class +) @Operator public final class Merge extends RawOp { /** @@ -49,8 +57,8 @@ public final class Merge extends RawOp { private Output valueIndex; - private Merge(Operation operation) { - super(operation); + public Merge(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); valueIndex = operation.output(outputIdx++); @@ -90,4 +98,28 @@ public Output output() { public Output valueIndex() { return valueIndex; } + + @OpInputsMetadata( + outputsClass = Merge.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input tensors, exactly one of which will become available. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Merge<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java index 103d84eb153..89ac31b5854 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Min.OP_NAME, + inputsClass = Min.Inputs.class +) @Operator public final class Min extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class Min extends RawOp implements Operand { private Output output; - private Min(Operation operation) { - super(operation); + public Min(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +132,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Min.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Min<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java index 023d692cc37..751bec8fd66 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -51,9 +57,11 @@ * [5, 4, 4, 5, 6, 6, 5] * [5, 4, 4, 5, 6, 6, 5]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MirrorPad.OP_NAME, + inputsClass = MirrorPad.Inputs.class +) @Operator public final class MirrorPad extends RawOp implements Operand { /** @@ -63,8 +71,8 @@ public final class MirrorPad extends RawOp implements Operand output; - private MirrorPad(Operation operation) { - super(operation); + public MirrorPad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -109,4 +117,49 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = MirrorPad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input tensor to be padded. + */ + public final Operand input; + + /** + * A two-column matrix specifying the padding sizes. The number of + * rows must be the same as the rank of {@code input}. + */ + public final Operand paddings; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tpaddings attribute + */ + public final DataType Tpaddings; + + /** + * Either {@code REFLECT} or {@code SYMMETRIC}. In reflect mode the padded regions + * do not include the borders, while in symmetric mode the padded regions + * do include the borders. For example, if {@code input} is {@code [1, 2, 3]} and {@code paddings} + * is {@code [0, 2]}, then the output is {@code [1, 2, 3, 2, 1]} in reflect mode, and + * it is {@code [1, 2, 3, 3, 2]} in symmetric mode. + */ + public final String mode; + + public Inputs(GraphOperation op) { + super(new MirrorPad<>(op), op, Arrays.asList("T", "Tpaddings", "mode")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tpaddings = op.attributes().getAttrType("Tpaddings"); + mode = op.attributes().getAttrString("mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java index d3b94e606cf..d1286e4bd89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -43,9 +50,12 @@ * pad(t, paddings) ==> [[ 1, 5] * [11, 28]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MirrorPadGrad.OP_NAME, + inputsClass = MirrorPadGrad.Inputs.class +) +@Operator public final class MirrorPadGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -54,8 +64,8 @@ public final class MirrorPadGrad extends RawOp implements Opera private Output output; - private MirrorPadGrad(Operation operation) { - super(operation); + public MirrorPadGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -96,4 +106,45 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = MirrorPadGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input tensor to be folded. + */ + public final Operand input; + + /** + * A two-column matrix specifying the padding sizes. The number of + * rows must be the same as the rank of {@code input}. + */ + public final Operand paddings; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tpaddings attribute + */ + public final DataType Tpaddings; + + /** + * The mode used in the {@code MirrorPad} op. + */ + public final String mode; + + public Inputs(GraphOperation op) { + super(new MirrorPadGrad<>(op), op, Arrays.asList("T", "Tpaddings", "mode")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tpaddings = op.attributes().getAttrType("Tpaddings"); + mode = op.attributes().getAttrString("mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java index 5640a48575d..6991e280241 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -62,6 +67,10 @@ * graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def() * */ +@OpMetadata( + opType = MlirPassthroughOp.OP_NAME, + inputsClass = MlirPassthroughOp.Inputs.class +) @Operator public final class MlirPassthroughOp extends RawOp implements Iterable> { /** @@ -72,8 +81,8 @@ public final class MlirPassthroughOp extends RawOp implements Iterable> outputs; @SuppressWarnings("unchecked") - private MlirPassthroughOp(Operation operation) { - super(operation); + public MlirPassthroughOp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); @@ -84,9 +93,9 @@ private MlirPassthroughOp(Operation operation) { * Factory method to create a class wrapping a new MlirPassthroughOp operation. * * @param scope current scope - * @param inputs the inputs value - * @param mlirModule the value of the mlirModule property - * @param Toutputs the value of the Toutputs property + * @param inputs The inputs value + * @param mlirModule The value of the mlirModule attribute + * @param Toutputs The value of the Toutputs attribute * @return a new instance of MlirPassthroughOp */ @Endpoint( @@ -115,4 +124,40 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = MlirPassthroughOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The mlirModule attribute + */ + public final String mlirModule; + + /** + * The Tinputs attribute + */ + public final DataType[] Tinputs; + + /** + * The Toutputs attribute + */ + public final DataType[] Toutputs; + + public Inputs(GraphOperation op) { + super(new MlirPassthroughOp(op), op, Arrays.asList("mlir_module", "Tinputs", "Toutputs")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + mlirModule = op.attributes().getAttrString("mlir_module"); + Tinputs = op.attributes().getAttrTypeList("Tinputs"); + Toutputs = op.attributes().getAttrTypeList("Toutputs"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java index 85c6d3e59bc..5c0f4f2c38a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +43,10 @@ * values. Each value must be a scalar. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ +@OpMetadata( + opType = MutableDenseHashTable.OP_NAME, + inputsClass = MutableDenseHashTable.Inputs.class +) @Operator public final class MutableDenseHashTable extends RawOp implements Operand { /** @@ -47,8 +57,8 @@ public final class MutableDenseHashTable extends RawOp implements Operand private Output tableHandle; @SuppressWarnings("unchecked") - private MutableDenseHashTable(Operation operation) { - super(operation); + public MutableDenseHashTable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tableHandle = operation.output(outputIdx++); } @@ -59,7 +69,7 @@ private MutableDenseHashTable(Operation operation) { * @param scope current scope * @param emptyKey The key used to represent empty key buckets internally. Must not * be used in insert or lookup operations. - * @param deletedKey the deletedKey value + * @param deletedKey The deletedKey value * @param valueDtype Type of the table values. * @param options carries optional attribute values * @param data type for {@code MutableDenseHashTableV2} output and operands @@ -268,4 +278,79 @@ public Options maxLoadFactor(Float maxLoadFactor) { return this; } } + + @OpInputsMetadata( + outputsClass = MutableDenseHashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key used to represent empty key buckets internally. Must not + * be used in insert or lookup operations. + */ + public final Operand emptyKey; + + /** + * The deletedKey input + */ + public final Operand deletedKey; + + /** + * If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this table is shared under the given name across + * multiple sessions. + */ + public final String sharedName; + + /** + * The useNodeNameSharing attribute + */ + public final boolean useNodeNameSharing; + + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + /** + * The shape of each value. + */ + public final Shape valueShape; + + /** + * The initial number of hash table buckets. Must be a power + * to 2. + */ + public final long initialNumBuckets; + + /** + * The maximum ratio between number of entries and number of + * buckets before growing the table. Must be between 0 and 1. + */ + public final float maxLoadFactor; + + public Inputs(GraphOperation op) { + super(new MutableDenseHashTable(op), op, Arrays.asList("container", "shared_name", "use_node_name_sharing", "key_dtype", "value_dtype", "value_shape", "initial_num_buckets", "max_load_factor")); + int inputIndex = 0; + emptyKey = (Operand) op.input(inputIndex++); + deletedKey = (Operand) op.input(inputIndex++); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + useNodeNameSharing = op.attributes().getAttrBool("use_node_name_sharing"); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + valueShape = op.attributes().getAttrShape("value_shape"); + initialNumBuckets = op.attributes().getAttrInt("initial_num_buckets"); + maxLoadFactor = op.attributes().getAttrFloat("max_load_factor"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java index c36a434d511..2d903a7b2d9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ * values. Each value must be a scalar. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ +@OpMetadata( + opType = MutableHashTable.OP_NAME, + inputsClass = MutableHashTable.Inputs.class +) @Operator public final class MutableHashTable extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class MutableHashTable extends RawOp implements Operand { private Output tableHandle; @SuppressWarnings("unchecked") - private MutableHashTable(Operation operation) { - super(operation); + public MutableHashTable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tableHandle = operation.output(outputIdx++); } @@ -182,4 +192,47 @@ public Options useNodeNameSharing(Boolean useNodeNameSharing) { return this; } } + + @OpInputsMetadata( + outputsClass = MutableHashTable.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this table is shared under the given name across + * multiple sessions. + */ + public final String sharedName; + + /** + * If true and shared_name is empty, the table is shared + * using the node name. + */ + public final boolean useNodeNameSharing; + + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new MutableHashTable(op), op, Arrays.asList("container", "shared_name", "use_node_name_sharing", "key_dtype", "value_dtype")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + useNodeNameSharing = op.attributes().getAttrBool("use_node_name_sharing"); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java index 642d121f525..83a79519dc9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,6 +41,10 @@ * values. Each value must be a vector. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ +@OpMetadata( + opType = MutableHashTableOfTensors.OP_NAME, + inputsClass = MutableHashTableOfTensors.Inputs.class +) @Operator public final class MutableHashTableOfTensors extends RawOp implements Operand { /** @@ -45,8 +55,8 @@ public final class MutableHashTableOfTensors extends RawOp implements Operand tableHandle; @SuppressWarnings("unchecked") - private MutableHashTableOfTensors(Operation operation) { - super(operation); + public MutableHashTableOfTensors(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tableHandle = operation.output(outputIdx++); } @@ -207,4 +217,52 @@ public Options valueShape(Shape valueShape) { return this; } } + + @OpInputsMetadata( + outputsClass = MutableHashTableOfTensors.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this table is shared under the given name across + * multiple sessions. + */ + public final String sharedName; + + /** + * The useNodeNameSharing attribute + */ + public final boolean useNodeNameSharing; + + /** + * Type of the table keys. + */ + public final DataType keyDtype; + + /** + * Type of the table values. + */ + public final DataType valueDtype; + + /** + * The valueShape attribute + */ + public final Shape valueShape; + + public Inputs(GraphOperation op) { + super(new MutableHashTableOfTensors(op), op, Arrays.asList("container", "shared_name", "use_node_name_sharing", "key_dtype", "value_dtype", "value_shape")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + useNodeNameSharing = op.attributes().getAttrBool("use_node_name_sharing"); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + valueShape = op.attributes().getAttrShape("value_shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java index 077d073461f..7c582226e61 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a Mutex resource that can be locked by {@code MutexLock}. */ +@OpMetadata( + opType = Mutex.OP_NAME, + inputsClass = Mutex.Inputs.class +) @Operator public final class Mutex extends RawOp implements Operand { /** @@ -40,8 +49,8 @@ public final class Mutex extends RawOp implements Operand { private Output resource; @SuppressWarnings("unchecked") - private Mutex(Operation operation) { - super(operation); + public Mutex(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resource = operation.output(outputIdx++); } @@ -143,4 +152,28 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Mutex.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new Mutex(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java index f455b008631..acfe74ccd98 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -63,6 +68,10 @@ *

    It is also useful if two separate functions must share a resource, but we * wish to ensure the usage is exclusive. */ +@OpMetadata( + opType = MutexLock.OP_NAME, + inputsClass = MutexLock.Inputs.class +) @Operator public final class MutexLock extends RawOp implements Operand { /** @@ -73,8 +82,8 @@ public final class MutexLock extends RawOp implements Operand { private Output mutexLock; @SuppressWarnings("unchecked") - private MutexLock(Operation operation) { - super(operation); + public MutexLock(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; mutexLock = operation.output(outputIdx++); } @@ -111,4 +120,20 @@ public Output mutexLock() { public Output asOutput() { return (Output) mutexLock; } + + @OpInputsMetadata( + outputsClass = MutexLock.class + ) + public static class Inputs extends RawOpInputs { + /** + * The mutex resource to lock. + */ + public final Operand mutex; + + public Inputs(GraphOperation op) { + super(new MutexLock(op), op, Arrays.asList()); + int inputIndex = 0; + mutex = (Operand) op.input(inputIndex++); + } + } } 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 20f02704c1e..5e8f5709b65 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -39,11 +46,14 @@ * 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 - * * @deprecated use {@link org.tensorflow.op.distribute.NcclAllReduce} instead */ +@OpMetadata( + opType = NcclAllReduce.OP_NAME, + inputsClass = NcclAllReduce.Inputs.class +) @Deprecated +@Operator public final class NcclAllReduce extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -52,8 +62,8 @@ public final class NcclAllReduce extends RawOp implements Ope private Output data; - private NcclAllReduce(Operation operation) { - super(operation); + public NcclAllReduce(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; data = operation.output(outputIdx++); } @@ -62,10 +72,10 @@ private NcclAllReduce(Operation operation) { * Factory method to create a class wrapping a new NcclAllReduce operation. * * @param scope current scope - * @param input the input value - * @param reduction the value of the reduction property - * @param numDevices the value of the numDevices property - * @param sharedName the value of the sharedName property + * @param input The input value + * @param reduction The value of the reduction attribute + * @param numDevices The value of the numDevices attribute + * @param sharedName The value of the sharedName attribute * @param data type for {@code NcclAllReduce} output and operands * @return a new instance of NcclAllReduce */ @@ -95,4 +105,44 @@ public Output data() { public Output asOutput() { return data; } + + @OpInputsMetadata( + outputsClass = NcclAllReduce.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The reduction attribute + */ + public final String reduction; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The numDevices attribute + */ + public final long numDevices; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new NcclAllReduce<>(op), op, Arrays.asList("reduction", "T", "num_devices", "shared_name")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + reduction = op.attributes().getAttrString("reduction"); + T = op.attributes().getAttrType("T"); + numDevices = op.attributes().getAttrInt("num_devices"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java index 051928fcc27..5e6c2a583ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -36,11 +43,14 @@ * output: The same as input. * shape: The shape of the input tensor. * - * @param data type for {@code output} output - * * @deprecated use {@link org.tensorflow.op.distribute.NcclBroadcast} instead */ +@OpMetadata( + opType = NcclBroadcast.OP_NAME, + inputsClass = NcclBroadcast.Inputs.class +) @Deprecated +@Operator public final class NcclBroadcast extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -49,8 +59,8 @@ public final class NcclBroadcast extends RawOp implements Ope private Output output; - private NcclBroadcast(Operation operation) { - super(operation); + public NcclBroadcast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,8 +69,8 @@ private NcclBroadcast(Operation operation) { * Factory method to create a class wrapping a new NcclBroadcast operation. * * @param scope current scope - * @param input the input value - * @param shape the value of the shape property + * @param input The input value + * @param shape The value of the shape attribute * @param data type for {@code NcclBroadcast} output and operands * @return a new instance of NcclBroadcast */ @@ -88,4 +98,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = NcclBroadcast.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The shape attribute + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new NcclBroadcast<>(op), op, Arrays.asList("T", "shape")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + shape = op.attributes().getAttrShape("shape"); + } + } } 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 41e9310df19..cd3dea3af6f 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -36,11 +43,14 @@ * data: the value of the reduction across all {@code num_devices} devices. * reduction: the reduction operation to perform. * - * @param data type for {@code data} output - * * @deprecated use {@link org.tensorflow.op.distribute.NcclReduce} instead */ +@OpMetadata( + opType = NcclReduce.OP_NAME, + inputsClass = NcclReduce.Inputs.class +) @Deprecated +@Operator public final class NcclReduce extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -49,8 +59,8 @@ public final class NcclReduce extends RawOp implements Operan private Output data; - private NcclReduce(Operation operation) { - super(operation); + public NcclReduce(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; data = operation.output(outputIdx++); } @@ -59,8 +69,8 @@ private NcclReduce(Operation operation) { * Factory method to create a class wrapping a new NcclReduce operation. * * @param scope current scope - * @param input the input value - * @param reduction the value of the reduction property + * @param input The input value + * @param reduction The value of the reduction attribute * @param data type for {@code NcclReduce} output and operands * @return a new instance of NcclReduce */ @@ -88,4 +98,34 @@ public Output data() { public Output asOutput() { return data; } + + @OpInputsMetadata( + outputsClass = NcclReduce.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Iterable> input; + + /** + * The reduction attribute + */ + public final String reduction; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new NcclReduce<>(op), op, Arrays.asList("reduction", "T")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + reduction = op.attributes().getAttrString("reduction"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java index 749b779b930..1f0f73c672f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Makes its input available to the next iteration. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = NextIteration.OP_NAME, + inputsClass = NextIteration.Inputs.class +) @Operator public final class NextIteration extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class NextIteration extends RawOp implements Opera private Output output; - private NextIteration(Operation operation) { - super(operation); + public NextIteration(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -77,4 +85,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = NextIteration.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the next iteration. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new NextIteration<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java index 1ac38903d0e..fa32a327305 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,16 +17,25 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; /** * Does nothing. Only useful as a placeholder for control edges. */ +@OpMetadata( + opType = NoOp.OP_NAME, + inputsClass = NoOp.Inputs.class +) @Operator public final class NoOp extends RawOp { /** @@ -34,8 +43,8 @@ public final class NoOp extends RawOp { */ public static final String OP_NAME = "NoOp"; - private NoOp(Operation operation) { - super(operation); + public NoOp(Operation operation) { + super(operation, OP_NAME); } /** @@ -51,4 +60,14 @@ public static NoOp create(Scope scope) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "NoOp"); return new NoOp(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = NoOp.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new NoOp(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java index ba0abba8433..8ed3c25bd8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -105,9 +111,11 @@ * [0.0, 0.0, 0.0] // one_hot(-1) * ] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = OneHot.OP_NAME, + inputsClass = OneHot.Inputs.class +) @Operator public final class OneHot extends RawOp implements Operand { /** @@ -117,8 +125,8 @@ public final class OneHot extends RawOp implements Operand { private Output output; - private OneHot(Operation operation) { - super(operation); + public OneHot(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -199,4 +207,56 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = OneHot.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor of indices. + */ + public final Operand indices; + + /** + * A scalar defining the depth of the one hot dimension. + */ + public final Operand depth; + + /** + * A scalar defining the value to fill in output when {@code indices[j] = i}. + */ + public final Operand onValue; + + /** + * A scalar defining the value to fill in output when {@code indices[j] != i}. + */ + public final Operand offValue; + + /** + * The axis to fill (default: -1, a new inner-most axis). + */ + public final long axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The TI attribute + */ + public final DataType TI; + + public Inputs(GraphOperation op) { + super(new OneHot<>(op), op, Arrays.asList("axis", "T", "TI")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + depth = (Operand) op.input(inputIndex++); + onValue = (Operand) op.input(inputIndex++); + offValue = (Operand) op.input(inputIndex++); + axis = op.attributes().getAttrInt("axis"); + T = op.attributes().getAttrType("T"); + TI = op.attributes().getAttrType("TI"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java index b2b7ca9aea1..51178e062f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns a tensor of ones with the same shape and type as x. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = OnesLike.OP_NAME, + inputsClass = OnesLike.Inputs.class +) @Operator public final class OnesLike extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class OnesLike extends RawOp implements Operand private Output y; - private OnesLike(Operation operation) { - super(operation); + public OnesLike(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -77,4 +85,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = OnesLike.class + ) + public static class Inputs extends RawOpInputs> { + /** + * a tensor of type T. + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new OnesLike<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java index 0802458e81a..49bf9d12367 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Op removes all elements in the underlying container. */ +@OpMetadata( + opType = OrderedMapClear.OP_NAME, + inputsClass = OrderedMapClear.Inputs.class +) @Operator public final class OrderedMapClear extends RawOp { /** @@ -37,15 +47,15 @@ public final class OrderedMapClear extends RawOp { */ public static final String OP_NAME = "OrderedMapClear"; - private OrderedMapClear(Operation operation) { - super(operation); + public OrderedMapClear(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new OrderedMapClear operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapClear */ @@ -174,4 +184,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapClear.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapClear(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java index a57953ba304..15bedf39cb3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Op returns the number of incomplete elements in the underlying container. */ +@OpMetadata( + opType = OrderedMapIncompleteSize.OP_NAME, + inputsClass = OrderedMapIncompleteSize.Inputs.class +) @Operator public final class OrderedMapIncompleteSize extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class OrderedMapIncompleteSize extends RawOp implements Operand output; - private OrderedMapIncompleteSize(Operation operation) { - super(operation); + public OrderedMapIncompleteSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +62,7 @@ private OrderedMapIncompleteSize(Operation operation) { * Factory method to create a class wrapping a new OrderedMapIncompleteSize operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapIncompleteSize */ @@ -195,4 +205,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapIncompleteSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapIncompleteSize(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java index ae95103b6e6..0108d6ead56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -39,6 +44,10 @@ * this op will block until it does. This Op is optimized for * performance. */ +@OpMetadata( + opType = OrderedMapPeek.OP_NAME, + inputsClass = OrderedMapPeek.Inputs.class +) @Operator public final class OrderedMapPeek extends RawOp implements Iterable> { /** @@ -49,8 +58,8 @@ public final class OrderedMapPeek extends RawOp implements Iterable> values; @SuppressWarnings("unchecked") - private OrderedMapPeek(Operation operation) { - super(operation); + public OrderedMapPeek(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -61,9 +70,9 @@ private OrderedMapPeek(Operation operation) { * Factory method to create a class wrapping a new OrderedMapPeek operation. * * @param scope current scope - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapPeek */ @@ -209,4 +218,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapPeek.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key input + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapPeek(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java index 4c84756d610..02582eef02e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Op returns the number of elements in the underlying container. */ +@OpMetadata( + opType = OrderedMapSize.OP_NAME, + inputsClass = OrderedMapSize.Inputs.class +) @Operator public final class OrderedMapSize extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class OrderedMapSize extends RawOp implements Operand { private Output output; - private OrderedMapSize(Operation operation) { - super(operation); + public OrderedMapSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +62,7 @@ private OrderedMapSize(Operation operation) { * Factory method to create a class wrapping a new OrderedMapSize operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapSize */ @@ -195,4 +205,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapSize(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java index 760eb4ca9c2..cd5c7dfdec3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ * Stage (key, values) in the underlying container which behaves like a ordered * associative container. Elements are ordered by key. */ +@OpMetadata( + opType = OrderedMapStage.OP_NAME, + inputsClass = OrderedMapStage.Inputs.class +) @Operator public final class OrderedMapStage extends RawOp { /** @@ -41,8 +51,8 @@ public final class OrderedMapStage extends RawOp { */ public static final String OP_NAME = "OrderedMapStage"; - private OrderedMapStage(Operation operation) { - super(operation); + public OrderedMapStage(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,10 +60,10 @@ private OrderedMapStage(Operation operation) { * * @param scope current scope * @param key int64 - * @param indices the indices value + * @param indices The indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapStage */ @@ -189,4 +199,73 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapStage.class + ) + public static class Inputs extends RawOpInputs { + /** + * int64 + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * a list of tensors + * dtypes A list of data types that inserted values should adhere to. + */ + public final Iterable> values; + + /** + * Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The fakeDtypes attribute + */ + public final DataType[] fakeDtypes; + + /** + * If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + */ + public final String container; + + /** + * It is necessary to match this name to the matching Unstage Op. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapStage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "fake_dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + fakeDtypes = op.attributes().getAttrTypeList("fake_dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java index 28b1341ab2d..15794430c34 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -38,6 +43,10 @@ * from the underlying container. If the underlying container * does not contain this key, the op will block until it does. */ +@OpMetadata( + opType = OrderedMapUnstage.OP_NAME, + inputsClass = OrderedMapUnstage.Inputs.class +) @Operator public final class OrderedMapUnstage extends RawOp implements Iterable> { /** @@ -48,8 +57,8 @@ public final class OrderedMapUnstage extends RawOp implements Iterable> values; @SuppressWarnings("unchecked") - private OrderedMapUnstage(Operation operation) { - super(operation); + public OrderedMapUnstage(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -60,9 +69,9 @@ private OrderedMapUnstage(Operation operation) { * Factory method to create a class wrapping a new OrderedMapUnstage operation. * * @param scope current scope - * @param key the key value - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param key The key value + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapUnstage */ @@ -208,4 +217,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapUnstage.class + ) + public static class Inputs extends RawOpInputs { + /** + * The key input + */ + public final Operand key; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapUnstage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + key = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java index eb283576e4a..b849306633d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,15 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,6 +42,10 @@ * key from the underlying container. If the underlying container * does not contain elements, the op will block until it does. */ +@OpMetadata( + opType = OrderedMapUnstageNoKey.OP_NAME, + inputsClass = OrderedMapUnstageNoKey.Inputs.class +) @Operator public final class OrderedMapUnstageNoKey extends RawOp { /** @@ -49,8 +58,8 @@ public final class OrderedMapUnstageNoKey extends RawOp { private List> values; @SuppressWarnings("unchecked") - private OrderedMapUnstageNoKey(Operation operation) { - super(operation); + public OrderedMapUnstageNoKey(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; key = operation.output(outputIdx++); int valuesLength = operation.outputListLength("values"); @@ -62,8 +71,8 @@ private OrderedMapUnstageNoKey(Operation operation) { * Factory method to create a class wrapping a new OrderedMapUnstageNoKey operation. * * @param scope current scope - * @param indices the indices value - * @param dtypes the value of the dtypes property + * @param indices The indices value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of OrderedMapUnstageNoKey */ @@ -211,4 +220,50 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OrderedMapUnstageNoKey.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OrderedMapUnstageNoKey(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java index 4bcbc23ecaa..60ddbcf6817 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -50,9 +56,11 @@ * [0, 0, 2, 2, 0, 0] * [0, 0, 0, 0, 0, 0]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Pad.OP_NAME, + inputsClass = Pad.Inputs.class +) @Operator public final class Pad extends RawOp implements Operand { /** @@ -62,8 +70,8 @@ public final class Pad extends RawOp implements Operand { private Output output; - private Pad(Operation operation) { - super(operation); + public Pad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -72,9 +80,9 @@ private Pad(Operation operation) { * Factory method to create a class wrapping a new PadV2 operation. * * @param scope current scope - * @param input the input value - * @param paddings the paddings value - * @param constantValues the constantValues value + * @param input The input value + * @param paddings The paddings value + * @param constantValues The constantValues value * @param data type for {@code PadV2} output and operands * @return a new instance of Pad */ @@ -103,4 +111,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Pad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The paddings input + */ + public final Operand paddings; + + /** + * The constantValues input + */ + public final Operand constantValues; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tpaddings attribute + */ + public final DataType Tpaddings; + + public Inputs(GraphOperation op) { + super(new Pad<>(op), op, Arrays.asList("T", "Tpaddings")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + constantValues = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tpaddings = op.attributes().getAttrType("Tpaddings"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java index e126523c99d..b12c3b896aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -44,9 +50,11 @@ * that the input shapes be known during graph construction. Parallel concat * will copy pieces of the input into the output as they become available, in * some situations this can provide a performance benefit. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ParallelConcat.OP_NAME, + inputsClass = ParallelConcat.Inputs.class +) @Operator public final class ParallelConcat extends RawOp implements Operand { /** @@ -56,8 +64,8 @@ public final class ParallelConcat extends RawOp implements Oper private Output output; - private ParallelConcat(Operation operation) { - super(operation); + public ParallelConcat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -97,4 +105,36 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ParallelConcat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensors to be concatenated. All must have size 1 in the first dimension + * and same shape. + */ + public final Iterable> values; + + /** + * The T attribute + */ + public final DataType T; + + /** + * the final shape of the result; should be equal to the shapes of any input + * but with the number of input values in the first dimension. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new ParallelConcat<>(op), op, Arrays.asList("T", "shape")); + int inputIndex = 0; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + T = op.attributes().getAttrType("T"); + shape = op.attributes().getAttrShape("shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java index 3cf3afa61d6..c9fd16880ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -83,9 +89,11 @@ *

    * *
    - * - * @param data type for {@code merged} output */ +@OpMetadata( + opType = ParallelDynamicStitch.OP_NAME, + inputsClass = ParallelDynamicStitch.Inputs.class +) @Operator public final class ParallelDynamicStitch extends RawOp implements Operand { /** @@ -95,8 +103,8 @@ public final class ParallelDynamicStitch extends RawOp implemen private Output merged; - private ParallelDynamicStitch(Operation operation) { - super(operation); + public ParallelDynamicStitch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; merged = operation.output(outputIdx++); } @@ -105,8 +113,8 @@ private ParallelDynamicStitch(Operation operation) { * Factory method to create a class wrapping a new ParallelDynamicStitch operation. * * @param scope current scope - * @param indices the indices value - * @param data the data value + * @param indices The indices value + * @param data The data value * @param data type for {@code ParallelDynamicStitch} output and operands * @return a new instance of ParallelDynamicStitch */ @@ -134,4 +142,36 @@ public Output merged() { public Output asOutput() { return merged; } + + @OpInputsMetadata( + outputsClass = ParallelDynamicStitch.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The indices input + */ + public final Iterable> indices; + + /** + * The data input + */ + public final Iterable> data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ParallelDynamicStitch<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + int indicesLength = op.inputListLength("indices"); + indices = Arrays.asList((Operand[]) op.inputList(inputIndex, indicesLength)); + inputIndex += indicesLength; + int dataLength = op.inputListLength("data"); + data = Arrays.asList((Operand[]) op.inputList(inputIndex, dataLength)); + inputIndex += dataLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PartitionedCall.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PartitionedCall.java index 7deb23131c8..08b8952e099 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PartitionedCall.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PartitionedCall.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,56 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * returns {@code f(inputs)}, where {@code f}'s body is placed and partitioned. - * - *

    Selects between {@link StatefulPartitionedCall} and {@link StatelessPartitionedCall} based on the statefulness of the function arguments. + * Asynchronously executes a function, potentially across multiple devices but + * within a single process. The kernel places and partitions a given function's + * underlying graph, and executes each of the partitioned subgraphs as a function. */ +@OpMetadata( + opType = PartitionedCall.OP_NAME, + inputsClass = PartitionedCall.Inputs.class +) @Operator -public interface PartitionedCall extends Iterable> { +public final class PartitionedCall extends RawOp implements Iterable> { /** - * Factory method to create a class wrapping a new StatefulPartitionedCall operation. + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PartitionedCall"; + + private List> output; + + @SuppressWarnings("unchecked") + public PartitionedCall(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList(operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } + + /** + * Factory method to create a class wrapping a new PartitionedCall operation. * * @param scope current scope * @param args A list of input tensors. @@ -44,8 +75,7 @@ public interface PartitionedCall extends Iterable> { * A function that takes 'args', a list of tensors, and returns 'output', * another list of tensors. Input and output types are specified by 'Tin' * and 'Tout'. The function body of f will be placed and partitioned across - * devices, setting this op apart from the regular Call op. This op is - * stateful. + * devices, setting this op apart from the regular Call op. * * @param options carries optional attribute values * @return a new instance of PartitionedCall @@ -53,17 +83,26 @@ public interface PartitionedCall extends Iterable> { @Endpoint( describeByClass = true ) - static PartitionedCall create(Scope scope, Iterable> args, + public static PartitionedCall create(Scope scope, Iterable> args, List> Tout, ConcreteFunction f, Options... options) { - boolean isStateful = false; - if (f.isStateful()) { - isStateful = true; - } - if (isStateful) { - return StatefulPartitionedCall.create(scope, args, Tout, f, options); - } else { - return StatelessPartitionedCall.create(scope, args, Tout, f, options); + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedCall"); + opBuilder.addInputList(Operands.asOutputs(args)); + opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); + opBuilder.setAttr("f", f); + if (options != null) { + for (Options opts : options) { + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + if (opts.configProto != null) { + opBuilder.setAttr("config_proto", opts.configProto); + } + if (opts.executorType != null) { + opBuilder.setAttr("executor_type", opts.executorType); + } + } } + return new PartitionedCall(opBuilder.build()); } /** @@ -72,7 +111,7 @@ static PartitionedCall create(Scope scope, Iterable> args, * @param config the config option * @return this Options instance. */ - static Options config(String config) { + public static Options config(String config) { return new Options().config(config); } @@ -82,7 +121,7 @@ static Options config(String config) { * @param configProto the configProto option * @return this Options instance. */ - static Options configProto(String configProto) { + public static Options configProto(String configProto) { return new Options().configProto(configProto); } @@ -92,7 +131,7 @@ static Options configProto(String configProto) { * @param executorType the executorType option * @return this Options instance. */ - static Options executorType(String executorType) { + public static Options executorType(String executorType) { return new Options().executorType(executorType); } @@ -101,21 +140,25 @@ static Options executorType(String executorType) { * A list of return values. * @return output. */ - List> output(); + public List> output() { + return output; + } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - Iterator> iterator(); + public Iterator> iterator() { + return (Iterator) output.iterator(); + } /** * Optional attributes for {@link org.tensorflow.op.core.PartitionedCall} */ - class Options { - String config; + public static class Options { + private String config; - String configProto; + private String configProto; - String executorType; + private String executorType; private Options() { } @@ -153,4 +196,52 @@ public Options executorType(String executorType) { return this; } } + + @OpInputsMetadata( + outputsClass = PartitionedCall.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of input tensors. + */ + public final Iterable> args; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The config attribute + */ + public final String config; + + /** + * The configProto attribute + */ + public final String configProto; + + /** + * The executorType attribute + */ + public final String executorType; + + public Inputs(GraphOperation op) { + super(new PartitionedCall(op), op, Arrays.asList("Tin", "Tout", "config", "config_proto", "executor_type")); + int inputIndex = 0; + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + config = op.attributes().getAttrString("config"); + configProto = op.attributes().getAttrString("config_proto"); + executorType = op.attributes().getAttrString("executor_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java index c8af0e07380..f4c450973da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,9 +40,11 @@ * N.B. This operation will fail with an error if it is executed. It is * intended as a way to represent a value that will always be fed, and to * provide attrs that enable the fed value to be checked at runtime. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Placeholder.OP_NAME, + inputsClass = Placeholder.Inputs.class +) @Operator public final class Placeholder extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class Placeholder extends RawOp implements Operand private Output output; - private Placeholder(Operation operation) { - super(operation); + public Placeholder(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +132,27 @@ public Options shape(Shape shape) { return this; } } + + @OpInputsMetadata( + outputsClass = Placeholder.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * (Optional) The shape of the tensor. If the shape has 0 dimensions, the + * shape is unconstrained. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new Placeholder<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java index cbfefa3b7e0..202d4cc476c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A placeholder op that passes through {@code input} when its output is not fed. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = PlaceholderWithDefault.OP_NAME, + inputsClass = PlaceholderWithDefault.Inputs.class +) @Operator public final class PlaceholderWithDefault extends RawOp implements Operand { /** @@ -42,8 +50,8 @@ public final class PlaceholderWithDefault extends RawOp impleme private Output output; - private PlaceholderWithDefault(Operation operation) { - super(operation); + public PlaceholderWithDefault(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -81,4 +89,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = PlaceholderWithDefault.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The default value to produce when {@code output} is not fed. + */ + public final Operand input; + + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The (possibly partial) shape of the tensor. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new PlaceholderWithDefault<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java index 3b5a840baba..d856d0224ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -30,6 +35,10 @@ * Prints a string scalar. * Prints a string scalar to the desired output_stream. */ +@OpMetadata( + opType = Print.OP_NAME, + inputsClass = Print.Inputs.class +) @Operator public final class Print extends RawOp { /** @@ -37,8 +46,8 @@ public final class Print extends RawOp { */ public static final String OP_NAME = "PrintV2"; - private Print(Operation operation) { - super(operation); + public Print(Operation operation) { + super(operation, OP_NAME); } /** @@ -121,4 +130,32 @@ public Options end(String end) { return this; } } + + @OpInputsMetadata( + outputsClass = Print.class + ) + public static class Inputs extends RawOpInputs { + /** + * The string scalar to print. + */ + public final Operand input; + + /** + * A string specifying the output stream or logging level to print to. + */ + public final String outputStream; + + /** + * The end attribute + */ + public final String end; + + public Inputs(GraphOperation op) { + super(new Print(op), op, Arrays.asList("output_stream", "end")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + outputStream = op.attributes().getAttrString("output_stream"); + end = op.attributes().getAttrString("end"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java index bdbc831c731..3f1c696a0bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Prod.OP_NAME, + inputsClass = Prod.Inputs.class +) @Operator public final class Prod extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class Prod extends RawOp implements Operand { private Output output; - private Prod(Operation operation) { - super(operation); + public Prod(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -125,4 +133,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Prod.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Prod<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java index 109794e32d1..84816c6893f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Reshapes a quantized tensor as per the Reshape op. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedReshape.OP_NAME, + inputsClass = QuantizedReshape.Inputs.class +) @Operator public final class QuantizedReshape extends RawOp { /** @@ -47,8 +55,8 @@ public final class QuantizedReshape extends RawOp { private Output outputMax; - private QuantizedReshape(Operation operation) { - super(operation); + public QuantizedReshape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -59,7 +67,7 @@ private QuantizedReshape(Operation operation) { * Factory method to create a class wrapping a new QuantizedReshape operation. * * @param scope current scope - * @param tensor the tensor value + * @param tensor The tensor value * @param shape Defines the shape of the output tensor. * @param inputMin The minimum value of the input. * @param inputMax The maximum value of the input. @@ -105,4 +113,50 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = QuantizedReshape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * Defines the shape of the output tensor. + */ + public final Operand shape; + + /** + * The minimum value of the input. + */ + public final Operand inputMin; + + /** + * The maximum value of the input. + */ + public final Operand inputMax; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new QuantizedReshape<>(op), op, Arrays.asList("T", "Tshape")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RandomIndexShuffle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RandomIndexShuffle.java new file mode 100644 index 00000000000..76538abf9cb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RandomIndexShuffle.java @@ -0,0 +1,182 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Outputs the position of {@code value} in a permutation of [0, ..., max_index]. + * Output values are a bijection of the {@code index} for any combination and {@code seed} and {@code max_index}. + *

    If multiple inputs are vectors (matrix in case of seed) then the size of the + * first dimension must match. + *

    The outputs are deterministic. + */ +@OpMetadata( + opType = RandomIndexShuffle.OP_NAME, + inputsClass = RandomIndexShuffle.Inputs.class +) +@Operator +public final class RandomIndexShuffle extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RandomIndexShuffle"; + + private Output output; + + public RandomIndexShuffle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RandomIndexShuffle operation. + * + * @param scope current scope + * @param index A scalar tensor or a vector of dtype {@code dtype}. The index (or indices) to be shuffled. Must be within [0, max_index]. + * @param seed A tensor of dtype {@code Tseed} and shape [3] or [n, 3]. The random seed. + * @param maxIndex A scalar tensor or vector of dtype {@code dtype}. The upper bound(s) of the interval (inclusive). + * @param options carries optional attribute values + * @param data type for {@code RandomIndexShuffle} output and operands + * @return a new instance of RandomIndexShuffle + */ + @Endpoint( + describeByClass = true + ) + public static RandomIndexShuffle create(Scope scope, Operand index, + Operand seed, Operand maxIndex, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomIndexShuffle"); + opBuilder.addInput(index.asOutput()); + opBuilder.addInput(seed.asOutput()); + opBuilder.addInput(maxIndex.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.rounds != null) { + opBuilder.setAttr("rounds", opts.rounds); + } + } + } + return new RandomIndexShuffle<>(opBuilder.build()); + } + + /** + * Sets the rounds option. + * + * @param rounds The number of rounds to use the in block cipher. + * @return this Options instance. + */ + public static Options rounds(Long rounds) { + return new Options().rounds(rounds); + } + + /** + * Gets output. + * A scalar tensor of dtype {@code dtype}, within [0, max_index]. The randomly shuffled index. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.RandomIndexShuffle} + */ + public static class Options { + private Long rounds; + + private Options() { + } + + /** + * Sets the rounds option. + * + * @param rounds The number of rounds to use the in block cipher. + * @return this Options instance. + */ + public Options rounds(Long rounds) { + this.rounds = rounds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RandomIndexShuffle.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A scalar tensor or a vector of dtype {@code dtype}. The index (or indices) to be shuffled. Must be within [0, max_index]. + */ + public final Operand index; + + /** + * A tensor of dtype {@code Tseed} and shape [3] or [n, 3]. The random seed. + */ + public final Operand seed; + + /** + * A scalar tensor or vector of dtype {@code dtype}. The upper bound(s) of the interval (inclusive). + */ + public final Operand maxIndex; + + /** + * The number of rounds to use the in block cipher. + */ + public final long rounds; + + /** + * The dtype of the input and output. + */ + public final DataType dtype; + + /** + * The type of {@code seed}. + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new RandomIndexShuffle<>(op), op, Arrays.asList("rounds", "dtype", "Tseed")); + int inputIndex = 0; + index = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + maxIndex = (Operand) op.input(inputIndex++); + rounds = op.attributes().getAttrInt("rounds"); + dtype = op.attributes().getAttrType("dtype"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java index efa7b52d5de..702214095a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -38,9 +44,11 @@ * # 'delta' is 3 * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Range.OP_NAME, + inputsClass = Range.Inputs.class +) @Operator public final class Range extends RawOp implements Operand { /** @@ -50,8 +58,8 @@ public final class Range extends RawOp implements Operand private Output output; - private Range(Operation operation) { - super(operation); + public Range(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -91,4 +99,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Range.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D (scalar). First entry in the sequence. + */ + public final Operand start; + + /** + * 0-D (scalar). Upper limit of sequence, exclusive. + */ + public final Operand limit; + + /** + * 0-D (scalar). Optional. Default is 1. Number that increments {@code start}. + */ + public final Operand delta; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Range<>(op), op, Arrays.asList("Tidx")); + int inputIndex = 0; + start = (Operand) op.input(inputIndex++); + limit = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java index 107dcf55c3c..0de92672581 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -41,6 +47,10 @@ * of a tensor is the number of indices required to uniquely select each element * of the tensor. Rank is also known as "order", "degree", or "ndims." */ +@OpMetadata( + opType = Rank.OP_NAME, + inputsClass = Rank.Inputs.class +) @Operator public final class Rank extends RawOp implements Operand { /** @@ -50,8 +60,8 @@ public final class Rank extends RawOp implements Operand { private Output output; - private Rank(Operation operation) { - super(operation); + public Rank(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -60,7 +70,7 @@ private Rank(Operation operation) { * Factory method to create a class wrapping a new Rank operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of Rank */ @Endpoint( @@ -85,4 +95,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Rank.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Rank(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java index 574f737fbf5..f57c2781c3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * writes on which this operation depends directly or indirectly, and to not be * influenced by any of the writes which depend directly or indirectly on this * operation. - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = ReadVariableOp.OP_NAME, + inputsClass = ReadVariableOp.Inputs.class +) @Operator public final class ReadVariableOp extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class ReadVariableOp extends RawOp implements Oper private Output value; - private ReadVariableOp(Operation operation) { - super(operation); + public ReadVariableOp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -86,4 +94,26 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = ReadVariableOp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * handle to the resource in which to store the variable. + */ + public final Operand resource; + + /** + * the dtype of the value. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new ReadVariableOp<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java index f149bf45dfd..5b3caab37b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Receives the named tensor from send_device on recv_device. - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = Recv.OP_NAME, + inputsClass = Recv.Inputs.class +) +@Operator public final class Recv extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +50,8 @@ public final class Recv extends RawOp implements Operand { private Output tensor; - private Recv(Operation operation) { - super(operation); + public Recv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tensor = operation.output(outputIdx++); } @@ -50,7 +60,7 @@ private Recv(Operation operation) { * Factory method to create a class wrapping a new Recv operation. * * @param scope current scope - * @param tensorType the value of the tensorType property + * @param tensorType The value of the tensorType attribute * @param tensorName The name of the tensor to receive. * @param sendDevice The name of the device sending the tensor. * @param sendDeviceIncarnation The current incarnation of send_device. @@ -131,4 +141,53 @@ public Options clientTerminated(Boolean clientTerminated) { return this; } } + + @OpInputsMetadata( + outputsClass = Recv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensorType attribute + */ + public final DataType tensorType; + + /** + * The name of the tensor to receive. + */ + public final String tensorName; + + /** + * The name of the device sending the tensor. + */ + public final String sendDevice; + + /** + * The current incarnation of send_device. + */ + public final long sendDeviceIncarnation; + + /** + * The name of the device receiving the tensor. + */ + public final String recvDevice; + + /** + * If set to true, this indicates that the node was added + * to the graph as a result of a client-side feed or fetch of Tensor data, + * in which case the corresponding send or recv is expected to be managed + * locally by the caller. + */ + public final boolean clientTerminated; + + public Inputs(GraphOperation op) { + super(new Recv<>(op), op, Arrays.asList("tensor_type", "tensor_name", "send_device", "send_device_incarnation", "recv_device", "client_terminated")); + int inputIndex = 0; + tensorType = op.attributes().getAttrType("tensor_type"); + tensorName = op.attributes().getAttrString("tensor_name"); + sendDevice = op.attributes().getAttrString("send_device"); + sendDeviceIncarnation = op.attributes().getAttrInt("send_device_incarnation"); + recvDevice = op.attributes().getAttrString("recv_device"); + clientTerminated = op.attributes().getAttrBool("client_terminated"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java index 2f6880725e2..22746fae83c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. */ +@OpMetadata( + opType = ReduceAll.OP_NAME, + inputsClass = ReduceAll.Inputs.class +) @Operator public final class ReduceAll extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class ReduceAll extends RawOp implements Operand { private Output output; - private ReduceAll(Operation operation) { - super(operation); + public ReduceAll(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -122,4 +132,39 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceAll.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceAll(op), op, Arrays.asList("keep_dims", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java index 268b0bdb9dd..b9f571672ed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. */ +@OpMetadata( + opType = ReduceAny.OP_NAME, + inputsClass = ReduceAny.Inputs.class +) @Operator public final class ReduceAny extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class ReduceAny extends RawOp implements Operand { private Output output; - private ReduceAny(Operation operation) { - super(operation); + public ReduceAny(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -122,4 +132,39 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceAny.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceAny(op), op, Arrays.asList("keep_dims", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java index cae290b380e..dca6c6a5ffc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReduceMax.OP_NAME, + inputsClass = ReduceMax.Inputs.class +) @Operator public final class ReduceMax extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class ReduceMax extends RawOp implements Operand private Output output; - private ReduceMax(Operation operation) { - super(operation); + public ReduceMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +132,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceMax<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java index 34ea53c5ea2..a7e544cfaab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReduceMin.OP_NAME, + inputsClass = ReduceMin.Inputs.class +) @Operator public final class ReduceMin extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class ReduceMin extends RawOp implements Operand private Output output; - private ReduceMin(Operation operation) { - super(operation); + public ReduceMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +132,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceMin<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java index 41fe7e66613..3dc53ad9c58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReduceProd.OP_NAME, + inputsClass = ReduceProd.Inputs.class +) @Operator public final class ReduceProd extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class ReduceProd extends RawOp implements Operand< private Output output; - private ReduceProd(Operation operation) { - super(operation); + public ReduceProd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -125,4 +133,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceProd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceProd<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java index e41f01ec5e9..bbe161f9210 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReduceSum.OP_NAME, + inputsClass = ReduceSum.Inputs.class +) @Operator public final class ReduceSum extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class ReduceSum extends RawOp implements Operand output; - private ReduceSum(Operation operation) { - super(operation); + public ReduceSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -125,4 +133,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new ReduceSum<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java index f1da7e2da97..218092a2563 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +39,12 @@ * {@code is_constant} is true, {@code output} is a constant in the child frame; otherwise * it may be changed in the child frame. At most {@code parallel_iterations} iterations * are run in parallel in the child frame. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefEnter.OP_NAME, + inputsClass = RefEnter.Inputs.class +) +@Operator public final class RefEnter extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +53,8 @@ public final class RefEnter extends RawOp implements Operand private Output output; - private RefEnter(Operation operation) { - super(operation); + public RefEnter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -147,4 +157,44 @@ public Options parallelIterations(Long parallelIterations) { return this; } } + + @OpInputsMetadata( + outputsClass = RefEnter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the child frame. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The name of the child frame. + */ + public final String frameName; + + /** + * If true, the output is constant within the child frame. + */ + public final boolean isConstant; + + /** + * The number of iterations allowed to run in parallel. + */ + public final long parallelIterations; + + public Inputs(GraphOperation op) { + super(new RefEnter<>(op), op, Arrays.asList("T", "frame_name", "is_constant", "parallel_iterations")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + frameName = op.attributes().getAttrString("frame_name"); + isConstant = op.attributes().getAttrBool("is_constant"); + parallelIterations = op.attributes().getAttrInt("parallel_iterations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java index 126ed3227fd..9a840da2c3d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. * Exit makes its input {@code data} available to the parent frame. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefExit.OP_NAME, + inputsClass = RefExit.Inputs.class +) +@Operator public final class RefExit extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +50,8 @@ public final class RefExit extends RawOp implements Operand private Output output; - private RefExit(Operation operation) { - super(operation); + public RefExit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +86,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RefExit.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the parent frame. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefExit<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java index d96655bda8e..c3bb004b548 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Return the same ref tensor as the input ref tensor. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefIdentity.OP_NAME, + inputsClass = RefIdentity.Inputs.class +) +@Operator public final class RefIdentity extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +49,8 @@ public final class RefIdentity extends RawOp implements Operand private Output output; - private RefIdentity(Operation operation) { - super(operation); + public RefIdentity(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -49,7 +59,7 @@ private RefIdentity(Operation operation) { * Factory method to create a class wrapping a new RefIdentity operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code RefIdentity} output and operands * @return a new instance of RefIdentity */ @@ -75,4 +85,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RefIdentity.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefIdentity<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java index 85832cf8256..4baf6cc6260 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -34,9 +41,12 @@ * It is usually combined with {@code Switch} to implement branching. *

    {@code Merge} forwards the first tensor for become available to {@code output}, and sets * {@code value_index} to its index in {@code inputs}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefMerge.OP_NAME, + inputsClass = RefMerge.Inputs.class +) +@Operator public final class RefMerge extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +57,8 @@ public final class RefMerge extends RawOp { private Output valueIndex; - private RefMerge(Operation operation) { - super(operation); + public RefMerge(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); valueIndex = operation.output(outputIdx++); @@ -88,4 +98,28 @@ public Output output() { public Output valueIndex() { return valueIndex; } + + @OpInputsMetadata( + outputsClass = RefMerge.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input tensors, exactly one of which will become available. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefMerge<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java index b2759dd69c6..ef647c70cd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Makes its input available to the next iteration. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefNextIteration.OP_NAME, + inputsClass = RefNextIteration.Inputs.class +) @Operator public final class RefNextIteration extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class RefNextIteration extends RawOp implements Op private Output output; - private RefNextIteration(Operation operation) { - super(operation); + public RefNextIteration(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -77,4 +85,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RefNextIteration.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be made available to the next iteration. + */ + public final Operand data; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefNextIteration<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java index dfa4056c286..d7ffa33956e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Forwards the {@code index}th element of {@code inputs} to {@code output}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RefSelect.OP_NAME, + inputsClass = RefSelect.Inputs.class +) @Operator public final class RefSelect extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class RefSelect extends RawOp implements Operand output; - private RefSelect(Operation operation) { - super(operation); + public RefSelect(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -82,4 +90,34 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RefSelect.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A scalar that determines the input that gets selected. + */ + public final Operand index; + + /** + * A list of ref tensors, one of which will be forwarded to {@code output}. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefSelect<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + index = (Operand) op.input(inputIndex++); + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java index 67cc4bfda6e..2e97b2bbcad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * If {@code pred} is true, the {@code data} input is forwarded to {@code output_true}. Otherwise, * the data goes to {@code output_false}. *

    See also {@code Switch} and {@code Merge}. - * - * @param data type for {@code output_false} output */ +@OpMetadata( + opType = RefSwitch.OP_NAME, + inputsClass = RefSwitch.Inputs.class +) @Operator public final class RefSwitch extends RawOp { /** @@ -47,8 +55,8 @@ public final class RefSwitch extends RawOp { private Output outputTrue; - private RefSwitch(Operation operation) { - super(operation); + public RefSwitch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputFalse = operation.output(outputIdx++); outputTrue = operation.output(outputIdx++); @@ -91,4 +99,32 @@ public Output outputFalse() { public Output outputTrue() { return outputTrue; } + + @OpInputsMetadata( + outputsClass = RefSwitch.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The ref tensor to be forwarded to the appropriate output. + */ + public final Operand data; + + /** + * A scalar that specifies which output port will receive data. + */ + public final Operand pred; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RefSwitch<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + pred = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Relayout.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Relayout.java new file mode 100644 index 00000000000..503d3cfe42a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Relayout.java @@ -0,0 +1,118 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The Relayout operation + */ +@OpMetadata( + opType = Relayout.OP_NAME, + inputsClass = Relayout.Inputs.class +) +@Operator +public final class Relayout extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relayout"; + + private Output output; + + public Relayout(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Relayout operation. + * + * @param scope current scope + * @param input The input value + * @param layout The value of the layout attribute + * @param data type for {@code Relayout} output and operands + * @return a new instance of Relayout + */ + @Endpoint( + describeByClass = true + ) + public static Relayout create(Scope scope, Operand input, String layout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Relayout"); + opBuilder.addInput(input.asOutput()); + opBuilder.setAttr("layout", layout); + return new Relayout<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = Relayout.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The layout attribute + */ + public final String layout; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Relayout<>(op), op, Arrays.asList("layout", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + layout = op.attributes().getAttrString("layout"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RelayoutLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RelayoutLike.java new file mode 100644 index 00000000000..499cb8d6c72 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RelayoutLike.java @@ -0,0 +1,125 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The RelayoutLike operation + */ +@OpMetadata( + opType = RelayoutLike.OP_NAME, + inputsClass = RelayoutLike.Inputs.class +) +@Operator +public final class RelayoutLike extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RelayoutLike"; + + private Output output; + + public RelayoutLike(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RelayoutLike operation. + * + * @param scope current scope + * @param input The input value + * @param layoutInput The layoutInput value + * @param data type for {@code RelayoutLike} output and operands + * @return a new instance of RelayoutLike + */ + @Endpoint( + describeByClass = true + ) + public static RelayoutLike create(Scope scope, Operand input, + Operand layoutInput) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RelayoutLike"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(layoutInput.asOutput()); + return new RelayoutLike<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = RelayoutLike.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The layoutInput input + */ + public final Operand layoutInput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The U attribute + */ + public final DataType U; + + public Inputs(GraphOperation op) { + super(new RelayoutLike<>(op), op, Arrays.asList("T", "U")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + layoutInput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + U = op.attributes().getAttrType("U"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteCall.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteCall.java index 7d7b1288f0e..7613a302dbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteCall.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteCall.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,21 +21,30 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Runs function {@code f} on a remote device indicated by {@code target}. */ +@OpMetadata( + opType = RemoteCall.OP_NAME, + inputsClass = RemoteCall.Inputs.class +) @Operator public final class RemoteCall extends RawOp implements Iterable> { /** @@ -46,8 +55,8 @@ public final class RemoteCall extends RawOp implements Iterable> private List> output; @SuppressWarnings("unchecked") - private RemoteCall(Operation operation) { - super(operation); + public RemoteCall(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -91,4 +100,40 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = RemoteCall.class + ) + public static class Inputs extends RawOpInputs { + /** + * A fully specified device name where we want to run the function. + */ + public final Operand target; + + /** + * A list of arguments for the function. + */ + public final Iterable> args; + + /** + * The type list for the arguments. + */ + public final DataType[] Tin; + + /** + * The type list for the return values. + */ + public final DataType[] Tout; + + public Inputs(GraphOperation op) { + super(new RemoteCall(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + target = (Operand) op.input(inputIndex++); + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java index 7a3bc9a893d..54c0aba057e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -84,9 +90,11 @@ * # shape `[]` reshapes to a scalar * reshape(t, []) ==> 7 * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Reshape.OP_NAME, + inputsClass = Reshape.Inputs.class +) @Operator public final class Reshape extends RawOp implements Operand { /** @@ -96,8 +104,8 @@ public final class Reshape extends RawOp implements Operand private Output output; - private Reshape(Operation operation) { - super(operation); + public Reshape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -106,7 +114,7 @@ private Reshape(Operation operation) { * Factory method to create a class wrapping a new Reshape operation. * * @param scope current scope - * @param tensor the tensor value + * @param tensor The tensor value * @param shape Defines the shape of the output tensor. * @param data type for {@code Reshape} output and operands * @return a new instance of Reshape @@ -135,4 +143,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Reshape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * Defines the shape of the output tensor. + */ + public final Operand shape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new Reshape<>(op), op, Arrays.asList("T", "Tshape")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java index 34f0284ae4b..0ca0faa179e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Increments variable pointed to by 'resource' until it reaches 'limit'. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResourceCountUpTo.OP_NAME, + inputsClass = ResourceCountUpTo.Inputs.class +) @Operator public final class ResourceCountUpTo extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class ResourceCountUpTo extends RawOp implements private Output output; - private ResourceCountUpTo(Operation operation) { - super(operation); + public ResourceCountUpTo(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,7 +64,7 @@ private ResourceCountUpTo(Operation operation) { * @param resource Should be from a scalar {@code Variable} node. * @param limit If incrementing ref would bring it above limit, instead generates an * 'OutOfRange' error. - * @param T the value of the T property + * @param T The value of the T attribute * @param data type for {@code ResourceCountUpTo} output and operands * @return a new instance of ResourceCountUpTo */ @@ -86,4 +94,33 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ResourceCountUpTo.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a scalar {@code Variable} node. + */ + public final Operand resource; + + /** + * If incrementing ref would bring it above limit, instead generates an + * 'OutOfRange' error. + */ + public final long limit; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ResourceCountUpTo<>(op), op, Arrays.asList("limit", "T")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + limit = op.attributes().getAttrInt("limit"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java index fdaab3aec2c..c458bacea4c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -43,9 +49,11 @@ * # Higher rank indices * output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResourceGather.OP_NAME, + inputsClass = ResourceGather.Inputs.class +) @Operator public final class ResourceGather extends RawOp implements Operand { /** @@ -55,8 +63,8 @@ public final class ResourceGather extends RawOp implements Oper private Output output; - private ResourceGather(Operation operation) { - super(operation); + public ResourceGather(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -65,9 +73,9 @@ private ResourceGather(Operation operation) { * Factory method to create a class wrapping a new ResourceGather operation. * * @param scope current scope - * @param resource the resource value - * @param indices the indices value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param indices The indices value + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code ResourceGather} output and operands * @return a new instance of ResourceGather @@ -162,4 +170,50 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceGather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The resource input + */ + public final Operand resource; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The batchDims attribute + */ + public final long batchDims; + + /** + * The validateIndices attribute + */ + public final boolean validateIndices; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceGather<>(op), op, Arrays.asList("batch_dims", "validate_indices", "dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + batchDims = op.attributes().getAttrInt("batch_dims"); + validateIndices = op.attributes().getAttrBool("validate_indices"); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java index af2d44099ab..f9c6b72b544 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * The ResourceGatherNd operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResourceGatherNd.OP_NAME, + inputsClass = ResourceGatherNd.Inputs.class +) @Operator public final class ResourceGatherNd extends RawOp implements Operand { /** @@ -43,8 +51,8 @@ public final class ResourceGatherNd extends RawOp implements Op private Output output; - private ResourceGatherNd(Operation operation) { - super(operation); + public ResourceGatherNd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,9 +61,9 @@ private ResourceGatherNd(Operation operation) { * Factory method to create a class wrapping a new ResourceGatherNd operation. * * @param scope current scope - * @param resource the resource value - * @param indices the indices value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param indices The indices value + * @param dtype The value of the dtype attribute * @param data type for {@code ResourceGatherNd} output and operands * @return a new instance of ResourceGatherNd */ @@ -84,4 +92,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ResourceGatherNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The resource input + */ + public final Operand resource; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceGatherNd<>(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java index aac3be02552..349b50a440f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterAdd.OP_NAME, + inputsClass = ResourceScatterAdd.Inputs.class +) @Operator public final class ResourceScatterAdd extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterAdd extends RawOp { */ public static final String OP_NAME = "ResourceScatterAdd"; - private ResourceScatterAdd(Operation operation) { - super(operation); + public ResourceScatterAdd(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterAdd create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterAdd(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterAdd.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterAdd(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java index 7b8f2a59f17..107a14eb110 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterDiv.OP_NAME, + inputsClass = ResourceScatterDiv.Inputs.class +) @Operator public final class ResourceScatterDiv extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterDiv extends RawOp { */ public static final String OP_NAME = "ResourceScatterDiv"; - private ResourceScatterDiv(Operation operation) { - super(operation); + public ResourceScatterDiv(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterDiv create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterDiv(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterDiv.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterDiv(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java index 6ac4a9b54c5..38401cd418c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterMax.OP_NAME, + inputsClass = ResourceScatterMax.Inputs.class +) @Operator public final class ResourceScatterMax extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterMax extends RawOp { */ public static final String OP_NAME = "ResourceScatterMax"; - private ResourceScatterMax(Operation operation) { - super(operation); + public ResourceScatterMax(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterMax create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterMax(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterMax.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterMax(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java index d6564b259f5..cf1c36e2ec7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterMin.OP_NAME, + inputsClass = ResourceScatterMin.Inputs.class +) @Operator public final class ResourceScatterMin extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterMin extends RawOp { */ public static final String OP_NAME = "ResourceScatterMin"; - private ResourceScatterMin(Operation operation) { - super(operation); + public ResourceScatterMin(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterMin create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterMin(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterMin.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterMin(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java index e684d3d59c3..a659eee9979 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterMul.OP_NAME, + inputsClass = ResourceScatterMul.Inputs.class +) @Operator public final class ResourceScatterMul extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterMul extends RawOp { */ public static final String OP_NAME = "ResourceScatterMul"; - private ResourceScatterMul(Operation operation) { - super(operation); + public ResourceScatterMul(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterMul create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterMul(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterMul.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterMul(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java index 2dbcbb99fb4..ee6c1cf7d61 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -56,6 +62,10 @@ *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ +@OpMetadata( + opType = ResourceScatterNdAdd.OP_NAME, + inputsClass = ResourceScatterNdAdd.Inputs.class +) @Operator public final class ResourceScatterNdAdd extends RawOp { /** @@ -63,8 +73,8 @@ public final class ResourceScatterNdAdd extends RawOp { */ public static final String OP_NAME = "ResourceScatterNdAdd"; - private ResourceScatterNdAdd(Operation operation) { - super(operation); + public ResourceScatterNdAdd(Operation operation) { + super(operation, OP_NAME); } /** @@ -93,6 +103,9 @@ public static ResourceScatterNdAdd create(Scope scope, Operand if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ResourceScatterNdAdd(opBuilder.build()); @@ -110,12 +123,24 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdAdd} */ public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -131,5 +156,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ResourceScatterNdAdd.class + ) + public static class Inputs extends RawOpInputs { + /** + * A resource handle. Must be from a VarHandleOp. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of + * values to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ResourceScatterNdAdd(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMax.java index e13320ecbbd..379843a67c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * The ResourceScatterNdMax operation */ +@OpMetadata( + opType = ResourceScatterNdMax.OP_NAME, + inputsClass = ResourceScatterNdMax.Inputs.class +) @Operator public final class ResourceScatterNdMax extends RawOp { /** @@ -37,8 +47,8 @@ public final class ResourceScatterNdMax extends RawOp { */ public static final String OP_NAME = "ResourceScatterNdMax"; - private ResourceScatterNdMax(Operation operation) { - super(operation); + public ResourceScatterNdMax(Operation operation) { + super(operation, OP_NAME); } /** @@ -67,6 +77,9 @@ public static ResourceScatterNdMax create(Scope scope, Operand if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ResourceScatterNdMax(opBuilder.build()); @@ -84,12 +97,24 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdMax} */ public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -105,5 +130,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ResourceScatterNdMax.class + ) + public static class Inputs extends RawOpInputs { + /** + * A resource handle. Must be from a VarHandleOp. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of + * values whose element wise max is taken with ref + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ResourceScatterNdMax(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMin.java index 4ae8c20a593..ba46417abba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * The ResourceScatterNdMin operation */ +@OpMetadata( + opType = ResourceScatterNdMin.OP_NAME, + inputsClass = ResourceScatterNdMin.Inputs.class +) @Operator public final class ResourceScatterNdMin extends RawOp { /** @@ -37,8 +47,8 @@ public final class ResourceScatterNdMin extends RawOp { */ public static final String OP_NAME = "ResourceScatterNdMin"; - private ResourceScatterNdMin(Operation operation) { - super(operation); + public ResourceScatterNdMin(Operation operation) { + super(operation, OP_NAME); } /** @@ -67,6 +77,9 @@ public static ResourceScatterNdMin create(Scope scope, Operand if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ResourceScatterNdMin(opBuilder.build()); @@ -84,12 +97,24 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdMin} */ public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -105,5 +130,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ResourceScatterNdMin.class + ) + public static class Inputs extends RawOpInputs { + /** + * A resource handle. Must be from a VarHandleOp. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of + * values whose element wise min is taken with ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ResourceScatterNdMin(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java index efb90c87f24..f39e42e742b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -56,6 +62,10 @@ *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ +@OpMetadata( + opType = ResourceScatterNdSub.OP_NAME, + inputsClass = ResourceScatterNdSub.Inputs.class +) @Operator public final class ResourceScatterNdSub extends RawOp { /** @@ -63,8 +73,8 @@ public final class ResourceScatterNdSub extends RawOp { */ public static final String OP_NAME = "ResourceScatterNdSub"; - private ResourceScatterNdSub(Operation operation) { - super(operation); + public ResourceScatterNdSub(Operation operation) { + super(operation, OP_NAME); } /** @@ -93,6 +103,9 @@ public static ResourceScatterNdSub create(Scope scope, Operand if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ResourceScatterNdSub(opBuilder.build()); @@ -110,12 +123,24 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdSub} */ public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -131,5 +156,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ResourceScatterNdSub.class + ) + public static class Inputs extends RawOpInputs { + /** + * A resource handle. Must be from a VarHandleOp. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of + * values to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ResourceScatterNdSub(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java index 14d91f6efcf..588d923c05a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -57,6 +63,10 @@ *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ +@OpMetadata( + opType = ResourceScatterNdUpdate.OP_NAME, + inputsClass = ResourceScatterNdUpdate.Inputs.class +) @Operator public final class ResourceScatterNdUpdate extends RawOp { /** @@ -64,8 +74,8 @@ public final class ResourceScatterNdUpdate extends RawOp { */ public static final String OP_NAME = "ResourceScatterNdUpdate"; - private ResourceScatterNdUpdate(Operation operation) { - super(operation); + public ResourceScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); } /** @@ -94,6 +104,9 @@ public static ResourceScatterNdUpdate create(Scope scope, Operand { + /** + * A resource handle. Must be from a VarHandleOp. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated + * values to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ResourceScatterNdUpdate(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java index 671bad91fea..52f5e1414a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,6 +53,10 @@ * * */ +@OpMetadata( + opType = ResourceScatterSub.OP_NAME, + inputsClass = ResourceScatterSub.Inputs.class +) @Operator public final class ResourceScatterSub extends RawOp { /** @@ -54,8 +64,8 @@ public final class ResourceScatterSub extends RawOp { */ public static final String OP_NAME = "ResourceScatterSub"; - private ResourceScatterSub(Operation operation) { - super(operation); + public ResourceScatterSub(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,44 @@ public static ResourceScatterSub create(Scope scope, Operand re opBuilder.addInput(updates.asOutput()); return new ResourceScatterSub(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterSub.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterSub(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java index 29267287d92..67dfa05354e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,6 +47,10 @@ * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] * */ +@OpMetadata( + opType = ResourceScatterUpdate.OP_NAME, + inputsClass = ResourceScatterUpdate.Inputs.class +) @Operator public final class ResourceScatterUpdate extends RawOp { /** @@ -48,8 +58,8 @@ public final class ResourceScatterUpdate extends RawOp { */ public static final String OP_NAME = "ResourceScatterUpdate"; - private ResourceScatterUpdate(Operation operation) { - super(operation); + public ResourceScatterUpdate(Operation operation) { + super(operation, OP_NAME); } /** @@ -72,4 +82,44 @@ public static ResourceScatterUpdate create(Scope scope, Operand opBuilder.addInput(updates.asOutput()); return new ResourceScatterUpdate(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceScatterUpdate.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a {@code Variable} node. + */ + public final Operand resource; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new ResourceScatterUpdate(op), op, Arrays.asList("dtype", "Tindices")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java index 955b0ada1c7..c7450648c27 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ *

    NOTE this op currently does not support broadcasting and so {@code value}'s * shape must be exactly the shape produced by the slice of {@code ref}. */ +@OpMetadata( + opType = ResourceStridedSliceAssign.OP_NAME, + inputsClass = ResourceStridedSliceAssign.Inputs.class +) @Operator public final class ResourceStridedSliceAssign extends RawOp { /** @@ -42,19 +52,19 @@ public final class ResourceStridedSliceAssign extends RawOp { */ public static final String OP_NAME = "ResourceStridedSliceAssign"; - private ResourceStridedSliceAssign(Operation operation) { - super(operation); + public ResourceStridedSliceAssign(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new ResourceStridedSliceAssign operation. * * @param scope current scope - * @param ref the ref value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param ref The ref value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code ResourceStridedSliceAssign} output and operands * @return a new instance of ResourceStridedSliceAssign @@ -215,4 +225,86 @@ public Options shrinkAxisMask(Long shrinkAxisMask) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceStridedSliceAssign.class + ) + public static class Inputs extends RawOpInputs { + /** + * The ref input + */ + public final Operand ref; + + /** + * The begin input + */ + public final Operand begin; + + /** + * The end input + */ + public final Operand end; + + /** + * The strides input + */ + public final Operand strides; + + /** + * The value input + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + /** + * The beginMask attribute + */ + public final long beginMask; + + /** + * The endMask attribute + */ + public final long endMask; + + /** + * The ellipsisMask attribute + */ + public final long ellipsisMask; + + /** + * The newAxisMask attribute + */ + public final long newAxisMask; + + /** + * The shrinkAxisMask attribute + */ + public final long shrinkAxisMask; + + public Inputs(GraphOperation op) { + super(new ResourceStridedSliceAssign(op), op, Arrays.asList("T", "Index", "begin_mask", "end_mask", "ellipsis_mask", "new_axis_mask", "shrink_axis_mask")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + end = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + beginMask = op.attributes().getAttrInt("begin_mask"); + endMask = op.attributes().getAttrInt("end_mask"); + ellipsisMask = op.attributes().getAttrInt("ellipsis_mask"); + newAxisMask = op.attributes().getAttrInt("new_axis_mask"); + shrinkAxisMask = op.attributes().getAttrInt("shrink_axis_mask"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java index 837592b303e..711b7148209 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,26 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Reverses specific dimensions of a tensor. - * NOTE {@code tf.reverse} has now changed behavior in preparation for 1.0. - * {@code tf.reverse_v2} is currently an alias that will be deprecated before TF 1.0. - *

    Given a {@code tensor}, and a {@code int32} tensor {@code axis} representing the set of + * Given a {@code tensor}, and a {@code int32} tensor {@code axis} representing the set of * dimensions of {@code tensor} to reverse. This operation reverses each dimension * {@code i} for which there exists {@code j} s.t. {@code axis[j] == i}. *

    {@code tensor} can have up to 8 dimensions. The number of dimensions specified @@ -72,9 +76,11 @@ * [16, 17, 18, 19], * [12, 13, 14, 15]]]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Reverse.OP_NAME, + inputsClass = Reverse.Inputs.class +) @Operator public final class Reverse extends RawOp implements Operand { /** @@ -84,8 +90,8 @@ public final class Reverse extends RawOp implements Operand private Output output; - private Reverse(Operation operation) { - super(operation); + public Reverse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +130,39 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Reverse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Up to 8-D. + */ + public final Operand tensor; + + /** + * 1-D. The indices of the dimensions to reverse. Must be in the range + * {@code [-rank(tensor), rank(tensor))}. + */ + public final Operand axis; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Reverse<>(op), op, Arrays.asList("Tidx", "T")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java index daf11cec5d7..e18f16874f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -78,9 +84,11 @@ * output[3:, :, 2, :, ...] = input[3:, :, 2, :, ...] * output[2:, :, 3, :, ...] = input[2:, :, 3, :, ...] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReverseSequence.OP_NAME, + inputsClass = ReverseSequence.Inputs.class +) @Operator public final class ReverseSequence extends RawOp implements Operand { /** @@ -90,8 +98,8 @@ public final class ReverseSequence extends RawOp implements Ope private Output output; - private ReverseSequence(Operation operation) { - super(operation); + public ReverseSequence(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -171,4 +179,51 @@ public Options batchDim(Long batchDim) { return this; } } + + @OpInputsMetadata( + outputsClass = ReverseSequence.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input to reverse. + */ + public final Operand input; + + /** + * 1-D with length {@code input.dims(batch_dim)} and + * {@code max(seq_lengths) <= input.dims(seq_dim)} + */ + public final Operand seqLengths; + + /** + * The dimension which is partially reversed. + */ + public final long seqDim; + + /** + * The dimension along which reversal is performed. + */ + public final long batchDim; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tlen attribute + */ + public final DataType Tlen; + + public Inputs(GraphOperation op) { + super(new ReverseSequence<>(op), op, Arrays.asList("seq_dim", "batch_dim", "T", "Tlen")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + seqLengths = (Operand) op.input(inputIndex++); + seqDim = op.attributes().getAttrInt("seq_dim"); + batchDim = op.attributes().getAttrInt("batch_dim"); + T = op.attributes().getAttrType("T"); + Tlen = op.attributes().getAttrType("Tlen"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java index aac1ac5b97c..e190730b970 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -48,9 +54,11 @@ * # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] * roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Roll.OP_NAME, + inputsClass = Roll.Inputs.class +) @Operator public final class Roll extends RawOp implements Operand { /** @@ -60,8 +68,8 @@ public final class Roll extends RawOp implements Operand { private Output output; - private Roll(Operation operation) { - super(operation); + public Roll(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -70,7 +78,7 @@ private Roll(Operation operation) { * Factory method to create a class wrapping a new Roll operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param shift Dimension must be 0-D or 1-D. {@code shift[i]} specifies the number of places by which * elements are shifted positively (towards larger indices) along the dimension * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite @@ -109,4 +117,56 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Roll.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * Dimension must be 0-D or 1-D. {@code shift[i]} specifies the number of places by which + * elements are shifted positively (towards larger indices) along the dimension + * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite + * direction. + */ + public final Operand shift; + + /** + * Dimension must be 0-D or 1-D. {@code axis[i]} specifies the dimension that the shift + * {@code shift[i]} should occur. If the same axis is referenced more than once, the + * total shift for that axis will be the sum of all the shifts that belong to that + * axis. + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tshift attribute + */ + public final DataType Tshift; + + /** + * The Taxis attribute + */ + public final DataType Taxis; + + public Inputs(GraphOperation op) { + super(new Roll<>(op), op, Arrays.asList("T", "Tshift", "Taxis")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + shift = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tshift = op.attributes().getAttrType("Tshift"); + Taxis = op.attributes().getAttrType("Taxis"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java index c81635554e4..9f0bc6a526f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -49,9 +55,11 @@ *

    * *
    - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterAdd.OP_NAME, + inputsClass = ScatterAdd.Inputs.class +) @Operator public final class ScatterAdd extends RawOp implements Operand { /** @@ -61,8 +69,8 @@ public final class ScatterAdd extends RawOp implements Operand< private Output outputRef; - private ScatterAdd(Operation operation) { - super(operation); + public ScatterAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -144,4 +152,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to add to {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterAdd<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java index 4b10a83e82e..902d11400e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -46,9 +52,11 @@ *

    Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions divide. *

    Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterDiv.OP_NAME, + inputsClass = ScatterDiv.Inputs.class +) @Operator public final class ScatterDiv extends RawOp implements Operand { /** @@ -58,8 +66,8 @@ public final class ScatterDiv extends RawOp implements Operand< private Output outputRef; - private ScatterDiv(Operation operation) { - super(operation); + public ScatterDiv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -141,4 +149,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterDiv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of values that {@code ref} is divided by. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterDiv<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java index 78e7a0941e2..9b761e52419 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -48,9 +54,11 @@ *

    * *
    - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterMax.OP_NAME, + inputsClass = ScatterMax.Inputs.class +) @Operator public final class ScatterMax extends RawOp implements Operand { /** @@ -60,8 +68,8 @@ public final class ScatterMax extends RawOp implements Operan private Output outputRef; - private ScatterMax(Operation operation) { - super(operation); + public ScatterMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -143,4 +151,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to reduce into {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterMax<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java index 3123ee56351..7f725ad19d0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -48,9 +54,11 @@ *
    * *
    - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterMin.OP_NAME, + inputsClass = ScatterMin.Inputs.class +) @Operator public final class ScatterMin extends RawOp implements Operand { /** @@ -60,8 +68,8 @@ public final class ScatterMin extends RawOp implements Operan private Output outputRef; - private ScatterMin(Operation operation) { - super(operation); + public ScatterMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -143,4 +151,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to reduce into {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterMin<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java index 69b0b2d4f0a..ae8bbca9670 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -46,9 +52,11 @@ *

    Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions multiply. *

    Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterMul.OP_NAME, + inputsClass = ScatterMul.Inputs.class +) @Operator public final class ScatterMul extends RawOp implements Operand { /** @@ -58,8 +66,8 @@ public final class ScatterMul extends RawOp implements Operand< private Output outputRef; - private ScatterMul(Operation operation) { - super(operation); + public ScatterMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -141,4 +149,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to multiply to {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterMul<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java index 9527ab8a9d1..ad6bcd00a16 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,46 +17,57 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Scatter {@code updates} into a new tensor according to {@code indices}. - * Creates a new tensor by applying sparse {@code updates} to individual values or - * slices within a tensor (initially zero for numeric, empty for string) of - * the given {@code shape} according to indices. This operator is the inverse of the - * {@code tf.gather_nd} operator which extracts values or slices from a given tensor. - *

    This operation is similar to tensor_scatter_add, except that the tensor is - * zero-initialized. Calling {@code tf.scatter_nd(indices, values, shape)} is identical - * to {@code tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)} - *

    If {@code indices} contains duplicates, then their updates are accumulated (summed). - *

    WARNING: The order in which updates are applied is nondeterministic, so the - * output will be nondeterministic if {@code indices} contains duplicates -- because - * of some numerical approximation issues, numbers summed in different order - * may yield different results. - *

    {@code indices} is an integer tensor containing indices into a new tensor of shape - * {@code shape}. The last dimension of {@code indices} can be at most the rank of {@code shape}: + * Scatters {@code updates} into a tensor of shape {@code shape} according to {@code indices}. + * Scatter sparse {@code updates} according to individual values at the specified + * {@code indices}. This op returns an output tensor with the {@code shape} you specify. This + * op is the inverse of the {@code tf.gather_nd} operator which extracts values or slices + * from a given tensor. + *

    This operation is similar to {@code tf.tensor_scatter_nd_add}, except that the tensor + * is zero-initialized. Calling {@code tf.scatter_nd(indices, updates, shape)} + * is identical to calling + * {@code tf.tensor_scatter_nd_add(tf.zeros(shape, updates.dtype), indices, updates)} + *

    If {@code indices} contains duplicates, the associated {@code updates} are accumulated + * (summed) into the output tensor. + *

    WARNING: For floating-point data types, the output may be nondeterministic. + * This is because the order in which the updates are applied is nondeterministic + * and when floating-point numbers are added in different orders the resulting + * numerical approximation error can be slightly different. However, the output + * will be deterministic if op determinism is enabled via + * {@code tf.config.experimental.enable_op_determinism}. + *

    {@code indices} is an integer tensor containing indices into the output tensor. The + * last dimension of {@code indices} can be at most the rank of {@code shape}: *

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

    The last dimension of {@code indices} corresponds to indices into elements + *

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

    {@code 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. + *

    The simplest form of the scatter op is to insert individual elements in + * a tensor by index. Consider an example where you want to insert 4 scattered + * elements in a rank-1 tensor with 8 elements. *

    * *
    @@ -72,15 +83,15 @@ *
      * [0, 11, 0, 10, 9, 0, 0, 12]
      * 
    - *

    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. + *

    You can also insert entire slices of a higher rank tensor all at once. For + * example, you can 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]])
    + *     indices = tf.constant([[1], [3]])
      *     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],
    @@ -91,16 +102,26 @@
      * 
    *

    The resulting tensor would look like this: *

    - * [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
    - *  [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
    + * [[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
      *  [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
    - *  [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]
    + *  [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
    + *  [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]
      * 
    - *

    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. - * - * @param data type for {@code output} output + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
    6. + *
    */ +@OpMetadata( + opType = ScatterNd.OP_NAME, + inputsClass = ScatterNd.Inputs.class +) @Operator public final class ScatterNd extends RawOp implements Operand { /** @@ -110,8 +131,8 @@ public final class ScatterNd extends RawOp implements Operand output; - private ScatterNd(Operation operation) { - super(operation); + public ScatterNd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -120,9 +141,10 @@ private ScatterNd(Operation operation) { * Factory method to create a class wrapping a new ScatterNd operation. * * @param scope current scope - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @param shape 1-D. The shape of the resulting tensor. + * @param indices Tensor of indices. + * @param updates Values to scatter into the output tensor. + * @param shape 1-D. The shape of the output tensor. + * @param options carries optional attribute values * @param data type for {@code ScatterNd} output and operands * @param data type for {@code ScatterNd} output and operands * @return a new instance of ScatterNd @@ -131,14 +153,31 @@ private ScatterNd(Operation operation) { describeByClass = true ) public static ScatterNd create(Scope scope, - Operand indices, Operand updates, Operand shape) { + Operand indices, Operand updates, Operand shape, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNd"); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder.addInput(shape.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new ScatterNd<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor with the given shape and updates applied according @@ -153,4 +192,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNd} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of indices. + */ + public final Operand indices; + + /** + * Values to scatter into the output tensor. + */ + public final Operand updates; + + /** + * 1-D. The shape of the output tensor. + */ + public final Operand shape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNd<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java index 0637e6e539f..257dce25682 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -56,9 +62,11 @@ * *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterNdAdd.OP_NAME, + inputsClass = ScatterNdAdd.Inputs.class +) @Operator public final class ScatterNdAdd extends RawOp implements Operand { /** @@ -68,8 +76,8 @@ public final class ScatterNdAdd extends RawOp implements Operan private Output outputRef; - private ScatterNdAdd(Operation operation) { - super(operation); + public ScatterNdAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -101,6 +109,9 @@ public static ScatterNdAdd create(Scope scope, Operand r if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ScatterNdAdd<>(opBuilder.build()); @@ -118,6 +129,16 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets outputRef. * Same as ref. Returned as a convenience for operations that want @@ -139,6 +160,8 @@ public Output asOutput() { public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -154,5 +177,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A mutable Tensor. Should be from a Variable node. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated values + * to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdAdd<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java index c518f023126..a7ebdf162d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Computes element-wise maximum. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterNdMax.OP_NAME, + inputsClass = ScatterNdMax.Inputs.class +) +@Operator public final class ScatterNdMax extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +50,8 @@ public final class ScatterNdMax extends RawOp implements Operan private Output outputRef; - private ScatterNdMax(Operation operation) { - super(operation); + public ScatterNdMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -73,6 +83,9 @@ public static ScatterNdMax create(Scope scope, Operand r if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ScatterNdMax<>(opBuilder.build()); @@ -90,6 +103,16 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets outputRef. * Same as ref. Returned as a convenience for operations that want @@ -111,6 +134,8 @@ public Output asOutput() { public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -126,5 +151,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A mutable Tensor. Should be from a Variable node. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated values + * to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdMax<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java index e273fac503d..3ade02671ed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Computes element-wise minimum. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterNdMin.OP_NAME, + inputsClass = ScatterNdMin.Inputs.class +) +@Operator public final class ScatterNdMin extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +50,8 @@ public final class ScatterNdMin extends RawOp implements Operan private Output outputRef; - private ScatterNdMin(Operation operation) { - super(operation); + public ScatterNdMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -73,6 +83,9 @@ public static ScatterNdMin create(Scope scope, Operand r if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ScatterNdMin<>(opBuilder.build()); @@ -90,6 +103,16 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets outputRef. * Same as ref. Returned as a convenience for operations that want @@ -111,6 +134,8 @@ public Output asOutput() { public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -126,5 +151,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A mutable Tensor. Should be from a Variable node. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated values + * to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdMin<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java index 585cfaae92e..c152dadc35e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -57,9 +63,11 @@ * [1, 13, 3, 14, 14, 6, 7, 20] * *

    See {@code tf.scatter_nd} for more details about how to make updates to slices. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ScatterNdNonAliasingAdd.OP_NAME, + inputsClass = ScatterNdNonAliasingAdd.Inputs.class +) @Operator public final class ScatterNdNonAliasingAdd extends RawOp implements Operand { /** @@ -69,8 +77,8 @@ public final class ScatterNdNonAliasingAdd extends RawOp implem private Output output; - private ScatterNdNonAliasingAdd(Operation operation) { - super(operation); + public ScatterNdNonAliasingAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -84,6 +92,7 @@ private ScatterNdNonAliasingAdd(Operation operation) { * A tensor of indices into {@code input}. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to {@code input}. + * @param options carries optional attribute values * @param data type for {@code ScatterNdNonAliasingAdd} output and operands * @return a new instance of ScatterNdNonAliasingAdd */ @@ -91,14 +100,31 @@ private ScatterNdNonAliasingAdd(Operation operation) { describeByClass = true ) public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ScatterNdNonAliasingAdd"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new ScatterNdNonAliasingAdd<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A {@code Tensor} with the same shape as {@code input}, containing values of {@code input} @@ -113,4 +139,73 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdNonAliasingAdd} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdNonAliasingAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A Tensor. + */ + public final Operand input; + + /** + * A Tensor. Must be one of the following types: {@code int32}, {@code int64}. + * A tensor of indices into {@code input}. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated values + * to add to {@code input}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdNonAliasingAdd<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java index ee2cff02224..21654611e88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -57,9 +63,11 @@ * *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterNdSub.OP_NAME, + inputsClass = ScatterNdSub.Inputs.class +) @Operator public final class ScatterNdSub extends RawOp implements Operand { /** @@ -69,8 +77,8 @@ public final class ScatterNdSub extends RawOp implements Operan private Output outputRef; - private ScatterNdSub(Operation operation) { - super(operation); + public ScatterNdSub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -102,6 +110,9 @@ public static ScatterNdSub create(Scope scope, Operand r if (opts.useLocking != null) { opBuilder.setAttr("use_locking", opts.useLocking); } + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } } } return new ScatterNdSub<>(opBuilder.build()); @@ -119,6 +130,16 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets outputRef. * Same as ref. Returned as a convenience for operations that want @@ -140,6 +161,8 @@ public Output asOutput() { public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -155,5 +178,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdSub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A mutable Tensor. Should be from a Variable node. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated values + * to subtract from ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdSub<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java index ba0b795aa83..5bf1e30fe35 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -56,9 +62,11 @@ *

    See {@code tf.scatter_nd} for more details about how to make updates to * slices. *

    See also {@code tf.scatter_update} and {@code tf.batch_scatter_update}. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterNdUpdate.OP_NAME, + inputsClass = ScatterNdUpdate.Inputs.class +) @Operator public final class ScatterNdUpdate extends RawOp implements Operand { /** @@ -68,8 +76,8 @@ public final class ScatterNdUpdate extends RawOp implements Ope private Output outputRef; - private ScatterNdUpdate(Operation operation) { - super(operation); + public ScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -101,6 +109,9 @@ public static ScatterNdUpdate create(Scope scope, Operand(opBuilder.build()); @@ -118,6 +129,16 @@ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets outputRef. * Same as ref. Returned as a convenience for operations that want to @@ -139,6 +160,8 @@ public Output asOutput() { public static class Options { private Boolean useLocking; + private String badIndicesPolicy; + private Options() { } @@ -154,5 +177,72 @@ public Options useLocking(Boolean useLocking) { this.useLocking = useLocking; return this; } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScatterNdUpdate.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A mutable Tensor. Should be from a Variable node. + */ + public final Operand ref; + + /** + * A Tensor. Must be one of the following types: int32, int64. + * A tensor of indices into ref. + */ + public final Operand indices; + + /** + * A Tensor. Must have the same type as ref. A tensor of updated + * values to add to ref. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + */ + public final boolean useLocking; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new ScatterNdUpdate<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "bad_indices_policy")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java index cae017a50ac..4686a81470f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -48,9 +54,11 @@ *

    * *
    - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterSub.OP_NAME, + inputsClass = ScatterSub.Inputs.class +) @Operator public final class ScatterSub extends RawOp implements Operand { /** @@ -60,8 +68,8 @@ public final class ScatterSub extends RawOp implements Operand< private Output outputRef; - private ScatterSub(Operation operation) { - super(operation); + public ScatterSub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -143,4 +151,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterSub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to subtract from {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterSub<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java index 4bd3154363b..60e22039589 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -51,9 +57,11 @@ * * *

    See also {@code tf.batch_scatter_update} and {@code tf.scatter_nd_update}. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = ScatterUpdate.OP_NAME, + inputsClass = ScatterUpdate.Inputs.class +) @Operator public final class ScatterUpdate extends RawOp implements Operand { /** @@ -63,8 +71,8 @@ public final class ScatterUpdate extends RawOp implements Opera private Output outputRef; - private ScatterUpdate(Operation operation) { - super(operation); + public ScatterUpdate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -146,4 +154,51 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ScatterUpdate.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a {@code Variable} node. + */ + public final Operand ref; + + /** + * A tensor of indices into the first dimension of {@code ref}. + */ + public final Operand indices; + + /** + * A tensor of updated values to store in {@code ref}. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ScatterUpdate<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java index 440d414329a..c88ea468f39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; /** * The SelectV2 operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Select.OP_NAME, + inputsClass = Select.Inputs.class +) @Operator public final class Select extends RawOp implements Operand { /** @@ -42,8 +50,8 @@ public final class Select extends RawOp implements Operand { private Output output; - private Select(Operation operation) { - super(operation); + public Select(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,9 +60,9 @@ private Select(Operation operation) { * Factory method to create a class wrapping a new SelectV2 operation. * * @param scope current scope - * @param condition the condition value - * @param t the t value - * @param e the e value + * @param condition The condition value + * @param t The t value + * @param e The e value * @param data type for {@code SelectV2} output and operands * @return a new instance of Select */ @@ -83,4 +91,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Select.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The condition input + */ + public final Operand condition; + + /** + * The t input + */ + public final Operand t; + + /** + * The e input + */ + public final Operand e; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Select<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + condition = (Operand) op.input(inputIndex++); + t = (Operand) op.input(inputIndex++); + e = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java index 5109bd3822b..e722ace450a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,37 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Sends the named tensor from send_device to recv_device. */ +@OpMetadata( + opType = Send.OP_NAME, + inputsClass = Send.Inputs.class +) +@Operator public final class Send extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "Send"; - private Send(Operation operation) { - super(operation); + public Send(Operation operation) { + super(operation, OP_NAME); } /** @@ -107,4 +119,59 @@ public Options clientTerminated(Boolean clientTerminated) { return this; } } + + @OpInputsMetadata( + outputsClass = Send.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor to send. + */ + public final Operand tensor; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The name of the tensor to send. + */ + public final String tensorName; + + /** + * The name of the device sending the tensor. + */ + public final String sendDevice; + + /** + * The current incarnation of send_device. + */ + public final long sendDeviceIncarnation; + + /** + * The name of the device receiving the tensor. + */ + public final String recvDevice; + + /** + * If set to true, this indicates that the node was added + * to the graph as a result of a client-side feed or fetch of Tensor data, + * in which case the corresponding send or recv is expected to be managed + * locally by the caller. + */ + public final boolean clientTerminated; + + public Inputs(GraphOperation op) { + super(new Send(op), op, Arrays.asList("T", "tensor_name", "send_device", "send_device_incarnation", "recv_device", "client_terminated")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + tensorName = op.attributes().getAttrString("tensor_name"); + sendDevice = op.attributes().getAttrString("send_device"); + sendDeviceIncarnation = op.attributes().getAttrInt("send_device_incarnation"); + recvDevice = op.attributes().getAttrString("recv_device"); + clientTerminated = op.attributes().getAttrBool("client_terminated"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java index 97a1e34ec7c..562b2088b93 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -48,11 +54,11 @@ * out ==> [2, 4, 6] * idx ==> [1, 3, 5] * - * - * @param data type for {@code out} output - * - * @param data type for {@code idx} output */ +@OpMetadata( + opType = SetDiff1d.OP_NAME, + inputsClass = SetDiff1d.Inputs.class +) @Operator public final class SetDiff1d extends RawOp { /** @@ -64,8 +70,8 @@ public final class SetDiff1d extends RawOp { private Output idx; - private SetDiff1d(Operation operation) { - super(operation); + public SetDiff1d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); idx = operation.output(outputIdx++); @@ -77,7 +83,7 @@ private SetDiff1d(Operation operation) { * @param scope current scope * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code ListDiff} output and operands * @param data type for {@code ListDiff} output and operands * @return a new instance of SetDiff1d @@ -128,4 +134,38 @@ public Output out() { public Output idx() { return idx; } + + @OpInputsMetadata( + outputsClass = SetDiff1d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. Values to keep. + */ + public final Operand x; + + /** + * 1-D. Values to remove. + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outIdx attribute + */ + public final DataType outIdx; + + public Inputs(GraphOperation op) { + super(new SetDiff1d<>(op), op, Arrays.asList("T", "out_idx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outIdx = op.attributes().getAttrType("out_idx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java index c604a916ab0..3444bef9840 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,8 +41,13 @@ * and {@code set_shape}. The last dimension contains values in a set, duplicates are * allowed but ignored. *

    If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set} - * indices. + * indices. Setting is to {@code False} while passing invalid arguments results in + * undefined behavior. */ +@OpMetadata( + opType = SetSize.OP_NAME, + inputsClass = SetSize.Inputs.class +) @Operator public final class SetSize extends RawOp implements Operand { /** @@ -46,8 +57,8 @@ public final class SetSize extends RawOp implements Operand { private Output output; - private SetSize(Operation operation) { - super(operation); + public SetSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,4 +138,44 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = SetSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2D {@code Tensor}, indices of a {@code SparseTensor}. + */ + public final Operand setIndices; + + /** + * 1D {@code Tensor}, values of a {@code SparseTensor}. + */ + public final Operand setValues; + + /** + * 1D {@code Tensor}, shape of a {@code SparseTensor}. + */ + public final Operand setShape; + + /** + * The validateIndices attribute + */ + public final boolean validateIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SetSize(op), op, Arrays.asList("validate_indices", "T")); + int inputIndex = 0; + setIndices = (Operand) op.input(inputIndex++); + setValues = (Operand) op.input(inputIndex++); + setShape = (Operand) op.input(inputIndex++); + validateIndices = op.attributes().getAttrBool("validate_indices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java index 64a2b0a20b4..2f7592fbc03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,9 +44,11 @@ * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]] * shape(t) ==> [2, 2, 3] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Shape.OP_NAME, + inputsClass = Shape.Inputs.class +) @Operator public final class Shape extends RawOp implements Operand { /** @@ -50,8 +58,8 @@ public final class Shape extends RawOp implements Operand private Output output; - private Shape(Operation operation) { - super(operation); + public Shape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -60,8 +68,8 @@ private Shape(Operation operation) { * Factory method to create a class wrapping a new Shape operation. * * @param scope current scope - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code Shape} output and operands * @return a new instance of Shape */ @@ -80,7 +88,7 @@ public static Shape create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Shape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new Shape<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java index 7b253f50380..b53a00a1a82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -36,9 +41,11 @@ /** * Returns shape of tensors. * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ShapeN.OP_NAME, + inputsClass = ShapeN.Inputs.class +) @Operator public final class ShapeN extends RawOp implements Iterable> { /** @@ -49,8 +56,8 @@ public final class ShapeN extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private ShapeN(Operation operation) { - super(operation); + public ShapeN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); @@ -61,8 +68,8 @@ private ShapeN(Operation operation) { * Factory method to create a class wrapping a new ShapeN operation. * * @param scope current scope - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code ShapeN} output and operands * @return a new instance of ShapeN */ @@ -81,7 +88,7 @@ public static ShapeN create(Scope scope, * Factory method to create a class wrapping a new ShapeN operation, with the default output types. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of ShapeN, with default output types */ @Endpoint( @@ -105,4 +112,34 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = ShapeN.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Iterable> input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new ShapeN<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java index 0f53c9b0d96..2be90850900 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -39,9 +45,11 @@ * # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]] * size(t) ==> 12 * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Size.OP_NAME, + inputsClass = Size.Inputs.class +) @Operator public final class Size extends RawOp implements Operand { /** @@ -51,8 +59,8 @@ public final class Size extends RawOp implements Operand { private Output output; - private Size(Operation operation) { - super(operation); + public Size(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -61,8 +69,8 @@ private Size(Operation operation) { * Factory method to create a class wrapping a new Size operation. * * @param scope current scope - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code Size} output and operands * @return a new instance of Size */ @@ -81,7 +89,7 @@ public static Size create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Size.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new Size<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java index f456a2cfe18..a6c1b030eff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -31,6 +36,10 @@ /** * Parses a text file and creates a batch of examples. */ +@OpMetadata( + opType = Skipgram.OP_NAME, + inputsClass = Skipgram.Inputs.class +) @Operator public final class Skipgram extends RawOp { /** @@ -52,8 +61,8 @@ public final class Skipgram extends RawOp { private Output labels; - private Skipgram(Operation operation) { - super(operation); + public Skipgram(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; vocabWord = operation.output(outputIdx++); vocabFreq = operation.output(outputIdx++); @@ -239,4 +248,46 @@ public Options subsample(Float subsample) { return this; } } + + @OpInputsMetadata( + outputsClass = Skipgram.class + ) + public static class Inputs extends RawOpInputs { + /** + * The corpus's text file name. + */ + public final String filename; + + /** + * The size of produced batch. + */ + public final long batchSize; + + /** + * The number of words to predict to the left and right of the target. + */ + public final long windowSize; + + /** + * The minimum number of word occurrences for it to be included in the + * vocabulary. + */ + public final long minCount; + + /** + * Threshold for word occurrence. Words that appear with higher + * frequency will be randomly down-sampled. Set to 0 to disable. + */ + public final float subsample; + + public Inputs(GraphOperation op) { + super(new Skipgram(op), op, Arrays.asList("filename", "batch_size", "window_size", "min_count", "subsample")); + int inputIndex = 0; + filename = op.attributes().getAttrString("filename"); + batchSize = op.attributes().getAttrInt("batch_size"); + windowSize = op.attributes().getAttrInt("window_size"); + minCount = op.attributes().getAttrInt("min_count"); + subsample = op.attributes().getAttrFloat("subsample"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java index 0a746d7218c..37a168fb6f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * 'begin'. *

    Requirements: * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Slice.OP_NAME, + inputsClass = Slice.Inputs.class +) @Operator public final class Slice extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class Slice extends RawOp implements Operand { private Output output; - private Slice(Operation operation) { - super(operation); + public Slice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -57,7 +65,7 @@ private Slice(Operation operation) { * Factory method to create a class wrapping a new Slice operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param begin begin[i] specifies the offset into the 'i'th dimension of * 'input' to slice from. * @param sizeOutput size[i] specifies the number of elements of the 'i'th dimension @@ -93,4 +101,48 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Slice.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * begin[i] specifies the offset into the 'i'th dimension of + * 'input' to slice from. + */ + public final Operand begin; + + /** + * size[i] specifies the number of elements of the 'i'th dimension + * of 'input' to slice. If size[i] is -1, all remaining elements in dimension + * i are included in the slice (i.e. this is equivalent to setting + * size[i] = input.dim_size(i) - begin[i]). + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + public Inputs(GraphOperation op) { + super(new Slice<>(op), op, Arrays.asList("T", "Index")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java index c4c48291adb..bafca31221f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns a copy of the input tensor. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Snapshot.OP_NAME, + inputsClass = Snapshot.Inputs.class +) @Operator public final class Snapshot extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class Snapshot extends RawOp implements Operand private Output output; - private Snapshot(Operation operation) { - super(operation); + public Snapshot(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -51,7 +59,7 @@ private Snapshot(Operation operation) { * Factory method to create a class wrapping a new Snapshot operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code Snapshot} output and operands * @return a new instance of Snapshot */ @@ -77,4 +85,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Snapshot.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Snapshot<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java index 16509bc4a85..2a366e46641 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -126,9 +132,11 @@ * *

    Among others, this operation is useful for reducing atrous convolution into * regular convolution. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SpaceToBatchNd.OP_NAME, + inputsClass = SpaceToBatchNd.Inputs.class +) @Operator public final class SpaceToBatchNd extends RawOp implements Operand { /** @@ -138,8 +146,8 @@ public final class SpaceToBatchNd extends RawOp implements Oper private Output output; - private SpaceToBatchNd(Operation operation) { - super(operation); + public SpaceToBatchNd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -183,4 +191,54 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SpaceToBatchNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * N-D with shape {@code input_shape = [batch] + spatial_shape + remaining_shape}, + * where spatial_shape has {@code M} dimensions. + */ + public final Operand input; + + /** + * 1-D with shape {@code [M]}, all values must be >= 1. + */ + public final Operand blockShape; + + /** + * 2-D with shape {@code [M, 2]}, all values must be >= 0. + * {@code paddings[i] = [pad_start, pad_end]} specifies the padding for input dimension + * {@code i + 1}, which corresponds to spatial dimension {@code i}. It is required that + * {@code block_shape[i]} divides {@code input_shape[i + 1] + pad_start + pad_end}. + */ + public final Operand paddings; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The TblockShape attribute + */ + public final DataType TblockShape; + + /** + * The Tpaddings attribute + */ + public final DataType Tpaddings; + + public Inputs(GraphOperation op) { + super(new SpaceToBatchNd<>(op), op, Arrays.asList("T", "Tblock_shape", "Tpaddings")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + blockShape = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + TblockShape = op.attributes().getAttrType("Tblock_shape"); + Tpaddings = op.attributes().getAttrType("Tpaddings"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java index a6427f4b6e6..dc4fad88677 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,22 +20,29 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Splits a tensor into {@code num_split} tensors along one dimension. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Split.OP_NAME, + inputsClass = Split.Inputs.class +) @Operator public final class Split extends RawOp implements Iterable> { /** @@ -46,8 +53,8 @@ public final class Split extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private Split(Operation operation) { - super(operation); + public Split(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); @@ -94,4 +101,33 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = Split.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The dimension along which to split. Must be in the range + * {@code [-rank(value), rank(value))}. + */ + public final Operand axis; + + /** + * The tensor to split. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Split<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + axis = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java index 6bec947b699..cc0525e9645 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,23 +20,30 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Splits a tensor into {@code num_split} tensors along one dimension. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SplitV.OP_NAME, + inputsClass = SplitV.Inputs.class +) @Operator public final class SplitV extends RawOp implements Iterable> { /** @@ -47,8 +54,8 @@ public final class SplitV extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private SplitV(Operation operation) { - super(operation); + public SplitV(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); @@ -65,7 +72,7 @@ private SplitV(Operation operation) { * Can contain one -1 indicating that dimension is to be inferred. * @param axis 0-D. The dimension along which to split. Must be in the range * {@code [-rank(value), rank(value))}. - * @param numSplit the value of the numSplit property + * @param numSplit The value of the numSplit attribute * @param data type for {@code SplitV} output and operands * @return a new instance of SplitV */ @@ -98,4 +105,47 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = SplitV.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to split. + */ + public final Operand value; + + /** + * list containing the sizes of each output tensor along the split + * dimension. Must sum to the dimension of value along split_dim. + * Can contain one -1 indicating that dimension is to be inferred. + */ + public final Operand sizeSplits; + + /** + * 0-D. The dimension along which to split. Must be in the range + * {@code [-rank(value), rank(value))}. + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tlen attribute + */ + public final DataType Tlen; + + public Inputs(GraphOperation op) { + super(new SplitV<>(op), op, Arrays.asList("T", "Tlen")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + sizeSplits = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tlen = op.attributes().getAttrType("Tlen"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java index a835bd6a74b..52155b47d43 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -45,9 +50,11 @@ * # 't' is a tensor of shape [1, 2, 1, 3, 1, 1] * shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Squeeze.OP_NAME, + inputsClass = Squeeze.Inputs.class +) @Operator public final class Squeeze extends RawOp implements Operand { /** @@ -57,8 +64,8 @@ public final class Squeeze extends RawOp implements Operand private Output output; - private Squeeze(Operation operation) { - super(operation); + public Squeeze(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -113,7 +120,7 @@ public static Options axis(List axis) { * be in the range {@code [-rank(input), rank(input))}. * @return this Options instance. */ - public static Options axis(Long[] axis) { + public static Options axis(Long... axis) { return new Options().axis(axis); } @@ -167,4 +174,34 @@ public Options axis(Long... axis) { return this; } } + + @OpInputsMetadata( + outputsClass = Squeeze.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The {@code input} to squeeze. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If specified, only squeezes the dimensions listed. The dimension + * index starts at 0. It is an error to squeeze a dimension that is not 1. Must + * be in the range {@code [-rank(input), rank(input))}. + */ + public final long[] axis; + + public Inputs(GraphOperation op) { + super(new Squeeze<>(op), op, Arrays.asList("T", "squeeze_dims")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + axis = op.attributes().getAttrIntList("squeeze_dims"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java index 7c8e0e5a906..976a86955b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -45,9 +51,11 @@ * pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]] * *

    This is the opposite of {@code unpack}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Stack.OP_NAME, + inputsClass = Stack.Inputs.class +) @Operator public final class Stack extends RawOp implements Operand { /** @@ -57,8 +65,8 @@ public final class Stack extends RawOp implements Operand { private Output output; - private Stack(Operation operation) { - super(operation); + public Stack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -135,4 +143,35 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = Stack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be of same shape and type. + */ + public final Iterable> values; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Dimension along which to pack. Negative values wrap around, so the + * valid range is {@code [-(R+1), R+1)}. + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new Stack<>(op), op, Arrays.asList("T", "axis")); + int inputIndex = 0; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + T = op.attributes().getAttrType("T"); + axis = op.attributes().getAttrInt("axis"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackClose.java new file mode 100644 index 00000000000..810fb716a34 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackClose.java @@ -0,0 +1,83 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Delete the stack from its resource container. + */ +@OpMetadata( + opType = StackClose.OP_NAME, + inputsClass = StackClose.Inputs.class +) +@Operator +public final class StackClose extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StackCloseV2"; + + public StackClose(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new StackCloseV2 operation. + * + * @param scope current scope + * @param handle The handle to a stack. + * @return a new instance of StackClose + */ + @Endpoint( + describeByClass = true + ) + public static StackClose create(Scope scope, Operand handle) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StackClose"); + opBuilder.addInput(handle.asOutput()); + return new StackClose(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = StackClose.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a stack. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new StackClose(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackCreate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackCreate.java new file mode 100644 index 00000000000..173c63d4c1e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackCreate.java @@ -0,0 +1,167 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * A stack that produces elements in first-in last-out order. + */ +@OpMetadata( + opType = StackCreate.OP_NAME, + inputsClass = StackCreate.Inputs.class +) +@Operator +public final class StackCreate extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StackV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + public StackCreate(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StackV2 operation. + * + * @param scope current scope + * @param maxSize The maximum size of the stack if non-negative. If negative, the stack + * size is unlimited. + * @param elemType The type of the elements on the stack. + * @param options carries optional attribute values + * @param data type for {@code StackV2} output and operands + * @return a new instance of StackCreate + */ + @Endpoint( + describeByClass = true + ) + public static StackCreate create(Scope scope, Operand maxSize, + Class elemType, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StackCreate"); + opBuilder.addInput(maxSize.asOutput()); + opBuilder.setAttr("elem_type", Operands.toDataType(elemType)); + if (options != null) { + for (Options opts : options) { + if (opts.stackName != null) { + opBuilder.setAttr("stack_name", opts.stackName); + } + } + } + return new StackCreate(opBuilder.build()); + } + + /** + * Sets the stackName option. + * + * @param stackName Overrides the name used for the temporary stack resource. Default + * value is the name of the 'Stack' op (which is guaranteed unique). + * @return this Options instance. + */ + public static Options stackName(String stackName) { + return new Options().stackName(stackName); + } + + /** + * Gets handle. + * The handle to the stack. + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.StackCreate} + */ + public static class Options { + private String stackName; + + private Options() { + } + + /** + * Sets the stackName option. + * + * @param stackName Overrides the name used for the temporary stack resource. Default + * value is the name of the 'Stack' op (which is guaranteed unique). + * @return this Options instance. + */ + public Options stackName(String stackName) { + this.stackName = stackName; + return this; + } + } + + @OpInputsMetadata( + outputsClass = StackCreate.class + ) + public static class Inputs extends RawOpInputs { + /** + * The maximum size of the stack if non-negative. If negative, the stack + * size is unlimited. + */ + public final Operand maxSize; + + /** + * The type of the elements on the stack. + */ + public final DataType elemType; + + /** + * Overrides the name used for the temporary stack resource. Default + * value is the name of the 'Stack' op (which is guaranteed unique). + */ + public final String stackName; + + public Inputs(GraphOperation op) { + super(new StackCreate(op), op, Arrays.asList("elem_type", "stack_name")); + int inputIndex = 0; + maxSize = (Operand) op.input(inputIndex++); + elemType = op.attributes().getAttrType("elem_type"); + stackName = op.attributes().getAttrString("stack_name"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPop.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPop.java new file mode 100644 index 00000000000..502cfcc8c06 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPop.java @@ -0,0 +1,114 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Pop the element at the top of the stack. + */ +@OpMetadata( + opType = StackPop.OP_NAME, + inputsClass = StackPop.Inputs.class +) +@Operator +public final class StackPop extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StackPopV2"; + + private Output elem; + + public StackPop(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + elem = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StackPopV2 operation. + * + * @param scope current scope + * @param handle The handle to a stack. + * @param elemType The type of the elem that is popped. + * @param data type for {@code StackPopV2} output and operands + * @return a new instance of StackPop + */ + @Endpoint( + describeByClass = true + ) + public static StackPop create(Scope scope, Operand handle, + Class elemType) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StackPop"); + opBuilder.addInput(handle.asOutput()); + opBuilder.setAttr("elem_type", Operands.toDataType(elemType)); + return new StackPop<>(opBuilder.build()); + } + + /** + * Gets elem. + * The tensor that is popped from the top of the stack. + * @return elem. + */ + public Output elem() { + return elem; + } + + @Override + public Output asOutput() { + return elem; + } + + @OpInputsMetadata( + outputsClass = StackPop.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a stack. + */ + public final Operand handle; + + /** + * The type of the elem that is popped. + */ + public final DataType elemType; + + public Inputs(GraphOperation op) { + super(new StackPop<>(op), op, Arrays.asList("elem_type")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + elemType = op.attributes().getAttrType("elem_type"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPush.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPush.java new file mode 100644 index 00000000000..f9f05ff1912 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StackPush.java @@ -0,0 +1,164 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Push an element onto the stack. + */ +@OpMetadata( + opType = StackPush.OP_NAME, + inputsClass = StackPush.Inputs.class +) +@Operator +public final class StackPush extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StackPushV2"; + + private Output output; + + public StackPush(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StackPushV2 operation. + * + * @param scope current scope + * @param handle The handle to a stack. + * @param elem The tensor to be pushed onto the stack. + * @param options carries optional attribute values + * @param data type for {@code StackPushV2} output and operands + * @return a new instance of StackPush + */ + @Endpoint( + describeByClass = true + ) + public static StackPush create(Scope scope, Operand handle, + Operand elem, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StackPush"); + opBuilder.addInput(handle.asOutput()); + opBuilder.addInput(elem.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.swapMemory != null) { + opBuilder.setAttr("swap_memory", opts.swapMemory); + } + } + } + return new StackPush<>(opBuilder.build()); + } + + /** + * Sets the swapMemory option. + * + * @param swapMemory Swap {@code elem} to CPU. Default to false. + * @return this Options instance. + */ + public static Options swapMemory(Boolean swapMemory) { + return new Options().swapMemory(swapMemory); + } + + /** + * Gets output. + * The same tensor as the input 'elem'. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.StackPush} + */ + public static class Options { + private Boolean swapMemory; + + private Options() { + } + + /** + * Sets the swapMemory option. + * + * @param swapMemory Swap {@code elem} to CPU. Default to false. + * @return this Options instance. + */ + public Options swapMemory(Boolean swapMemory) { + this.swapMemory = swapMemory; + return this; + } + } + + @OpInputsMetadata( + outputsClass = StackPush.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a stack. + */ + public final Operand handle; + + /** + * The tensor to be pushed onto the stack. + */ + public final Operand elem; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Swap {@code elem} to CPU. Default to false. + */ + public final boolean swapMemory; + + public Inputs(GraphOperation op) { + super(new StackPush<>(op), op, Arrays.asList("T", "swap_memory")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + elem = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + swapMemory = op.attributes().getAttrBool("swap_memory"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java index 3256cf414d0..11adc169e0d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; /** * Stage values similar to a lightweight Enqueue. * The basic functionality of this Op is similar to a queue with many * fewer capabilities and options. This Op is optimized for performance. */ +@OpMetadata( + opType = Stage.OP_NAME, + inputsClass = Stage.Inputs.class +) @Operator public final class Stage extends RawOp { /** @@ -38,8 +48,8 @@ public final class Stage extends RawOp { */ public static final String OP_NAME = "Stage"; - private Stage(Operation operation) { - super(operation); + public Stage(Operation operation) { + super(operation, OP_NAME); } /** @@ -181,4 +191,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Stage.class + ) + public static class Inputs extends RawOpInputs { + /** + * a list of tensors + * dtypes A list of data types that inserted values should adhere to. + */ + public final Iterable> values; + + /** + * Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + */ + public final long capacity; + + /** + * The maximum number of bytes allowed for Tensors in the Staging Area. + * If > 0, inserts will block until sufficient space is available. + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + */ + public final String container; + + /** + * It is necessary to match this name to the matching Unstage Op. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new Stage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java index 5b0783a7749..e72a7a7100d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Op removes all elements in the underlying container. */ +@OpMetadata( + opType = StageClear.OP_NAME, + inputsClass = StageClear.Inputs.class +) @Operator public final class StageClear extends RawOp { /** @@ -37,15 +47,15 @@ public final class StageClear extends RawOp { */ public static final String OP_NAME = "StageClear"; - private StageClear(Operation operation) { - super(operation); + public StageClear(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new StageClear operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StageClear */ @@ -174,4 +184,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = StageClear.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new StageClear(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java index aec3b040f83..203c44f5cd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -38,6 +43,10 @@ * this op will block until it does. This Op is optimized for * performance. */ +@OpMetadata( + opType = StagePeek.OP_NAME, + inputsClass = StagePeek.Inputs.class +) @Operator public final class StagePeek extends RawOp implements Iterable> { /** @@ -48,8 +57,8 @@ public final class StagePeek extends RawOp implements Iterable> { private List> values; @SuppressWarnings("unchecked") - private StagePeek(Operation operation) { - super(operation); + public StagePeek(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -60,8 +69,8 @@ private StagePeek(Operation operation) { * Factory method to create a class wrapping a new StagePeek operation. * * @param scope current scope - * @param index the index value - * @param dtypes the value of the dtypes property + * @param index The index value + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StagePeek */ @@ -206,4 +215,50 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = StagePeek.class + ) + public static class Inputs extends RawOpInputs { + /** + * The index input + */ + public final Operand index; + + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new StagePeek(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + index = (Operand) op.input(inputIndex++); + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java index e850b1ef705..53e2e2edead 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Op returns the number of elements in the underlying container. */ +@OpMetadata( + opType = StageSize.OP_NAME, + inputsClass = StageSize.Inputs.class +) @Operator public final class StageSize extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class StageSize extends RawOp implements Operand { private Output output; - private StageSize(Operation operation) { - super(operation); + public StageSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +62,7 @@ private StageSize(Operation operation) { * Factory method to create a class wrapping a new StageSize operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of StageSize */ @@ -195,4 +205,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = StageSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new StageSize(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulCase.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulCase.java index 33592086451..97e4aa05449 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulCase.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulCase.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,9 +29,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -55,6 +60,10 @@ * ``` * */ +@OpMetadata( + opType = StatefulCase.OP_NAME, + inputsClass = StatefulCase.Inputs.class +) @Operator public final class StatefulCase extends RawOp implements Case { /** @@ -65,8 +74,8 @@ public final class StatefulCase extends RawOp implements Case { private List> output; @SuppressWarnings("unchecked") - private StatefulCase(Operation operation) { - super(operation); + public StatefulCase(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -131,4 +140,46 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatefulCase.class + ) + public static class Inputs extends RawOpInputs { + /** + * The branch selector, an int32 Tensor. + */ + public final Operand branchIndex; + + /** + * A list of input tensors passed to the branch function. + */ + public final Iterable> input; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new StatefulCase(op), op, Arrays.asList("Tin", "Tout", "output_shapes")); + int inputIndex = 0; + branchIndex = (Operand) op.input(inputIndex++); + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulIf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulIf.java index 9aa0ff99791..b920fe2da46 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulIf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulIf.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * output = cond ? then_branch(input) : else_branch(input) */ +@OpMetadata( + opType = StatefulIf.OP_NAME, + inputsClass = StatefulIf.Inputs.class +) @Operator public final class StatefulIf extends RawOp implements If { /** @@ -46,8 +55,8 @@ public final class StatefulIf extends RawOp implements If { private List> output; @SuppressWarnings("unchecked") - private StatefulIf(Operation operation) { - super(operation); + public StatefulIf(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -120,4 +129,59 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatefulIf.class + ) + public static class Inputs extends RawOpInputs { + /** + *

    +     *   A Tensor. If the tensor is a scalar of non-boolean type, the
    +     *   scalar is converted to a boolean according to the
    +     *   following rule: if the scalar is a numerical value, non-zero means
    +     *   `True` and zero means False; if the scalar is a string, non-empty
    +     *   means `True` and empty means `False`. If the tensor is not a scalar,
    +     *   being empty means False and being non-empty means True.
    +     * 
    + */ + public final Operand cond; + + /** + * A list of input tensors. + */ + public final Iterable> input; + + /** + * The Tcond attribute + */ + public final DataType Tcond; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new StatefulIf(op), op, Arrays.asList("Tcond", "Tin", "Tout", "output_shapes")); + int inputIndex = 0; + cond = (Operand) op.input(inputIndex++); + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + Tcond = op.attributes().getAttrType("Tcond"); + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulPartitionedCall.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulPartitionedCall.java index 465930a4057..ca19af055db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulPartitionedCall.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulPartitionedCall.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,22 +21,31 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * returns {@code f(inputs)}, where {@code f}'s body is placed and partitioned. */ +@OpMetadata( + opType = StatefulPartitionedCall.OP_NAME, + inputsClass = StatefulPartitionedCall.Inputs.class +) @Operator -public final class StatefulPartitionedCall extends RawOp implements PartitionedCall { +public final class StatefulPartitionedCall extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine */ @@ -45,8 +54,8 @@ public final class StatefulPartitionedCall extends RawOp implements PartitionedC private List> output; @SuppressWarnings("unchecked") - private StatefulPartitionedCall(Operation operation) { - super(operation); + public StatefulPartitionedCall(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -73,13 +82,13 @@ private StatefulPartitionedCall(Operation operation) { describeByClass = true ) public static StatefulPartitionedCall create(Scope scope, Iterable> args, - List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { + List> Tout, ConcreteFunction f, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatefulPartitionedCall"); opBuilder.addInputList(Operands.asOutputs(args)); opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); opBuilder.setAttr("f", f); if (options != null) { - for (PartitionedCall.Options opts : options) { + for (Options opts : options) { if (opts.config != null) { opBuilder.setAttr("config", opts.config); } @@ -94,12 +103,41 @@ public static StatefulPartitionedCall create(Scope scope, Iterable> a return new StatefulPartitionedCall(opBuilder.build()); } + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Sets the configProto option. + * + * @param configProto the configProto option + * @return this Options instance. + */ + public static Options configProto(String configProto) { + return new Options().configProto(configProto); + } + + /** + * Sets the executorType option. + * + * @param executorType the executorType option + * @return this Options instance. + */ + public static Options executorType(String executorType) { + return new Options().executorType(executorType); + } + /** * Gets output. * A list of return values. * @return output. */ - @Override public List> output() { return output; } @@ -109,4 +147,99 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + /** + * Optional attributes for {@link org.tensorflow.op.core.StatefulPartitionedCall} + */ + public static class Options { + private String config; + + private String configProto; + + private String executorType; + + private Options() { + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + + /** + * Sets the configProto option. + * + * @param configProto the configProto option + * @return this Options instance. + */ + public Options configProto(String configProto) { + this.configProto = configProto; + return this; + } + + /** + * Sets the executorType option. + * + * @param executorType the executorType option + * @return this Options instance. + */ + public Options executorType(String executorType) { + this.executorType = executorType; + return this; + } + } + + @OpInputsMetadata( + outputsClass = StatefulPartitionedCall.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of input tensors. + */ + public final Iterable> args; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The config attribute + */ + public final String config; + + /** + * The configProto attribute + */ + public final String configProto; + + /** + * The executorType attribute + */ + public final String executorType; + + public Inputs(GraphOperation op) { + super(new StatefulPartitionedCall(op), op, Arrays.asList("Tin", "Tout", "config", "config_proto", "executor_type")); + int inputIndex = 0; + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + config = op.attributes().getAttrString("config"); + configProto = op.attributes().getAttrString("config_proto"); + executorType = op.attributes().getAttrString("executor_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulWhile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulWhile.java index 4ea25bdd005..afc78346a40 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulWhile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulWhile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * output = input; While (Cond(output)) { output = Body(output) } */ +@OpMetadata( + opType = StatefulWhile.OP_NAME, + inputsClass = StatefulWhile.Inputs.class +) @Operator public final class StatefulWhile extends RawOp implements While { /** @@ -46,8 +55,8 @@ public final class StatefulWhile extends RawOp implements While { private List> output; @SuppressWarnings("unchecked") - private StatefulWhile(Operation operation) { - super(operation); + public StatefulWhile(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -117,4 +126,40 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatefulWhile.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of input tensors whose types are T. + */ + public final Iterable> input; + + /** + * dtype in use. + */ + public final DataType[] T; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The parallelIterations attribute + */ + public final long parallelIterations; + + public Inputs(GraphOperation op) { + super(new StatefulWhile(op), op, Arrays.asList("T", "output_shapes", "parallel_iterations")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + T = op.attributes().getAttrTypeList("T"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + parallelIterations = op.attributes().getAttrInt("parallel_iterations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessCase.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessCase.java index 2241b1c8c5f..915d6908936 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessCase.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessCase.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,8 +29,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -56,6 +62,11 @@ * This should only be used when the none of branches has stateful ops. * */ +@OpMetadata( + opType = StatelessCase.OP_NAME, + inputsClass = StatelessCase.Inputs.class +) +@Operator public final class StatelessCase extends RawOp implements Case { /** * The name of this op, as known by TensorFlow core engine @@ -65,8 +76,8 @@ public final class StatelessCase extends RawOp implements Case { private List> output; @SuppressWarnings("unchecked") - private StatelessCase(Operation operation) { - super(operation); + public StatelessCase(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -131,4 +142,46 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatelessCase.class + ) + public static class Inputs extends RawOpInputs { + /** + * The branch selector, an int32 Tensor. + */ + public final Operand branchIndex; + + /** + * A list of input tensors passed to the branch function. + */ + public final Iterable> input; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new StatelessCase(op), op, Arrays.asList("Tin", "Tout", "output_shapes")); + int inputIndex = 0; + branchIndex = (Operand) op.input(inputIndex++); + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessIf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessIf.java index 820c287e503..898516ff813 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessIf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessIf.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * output = cond ? then_branch(input) : else_branch(input) */ +@OpMetadata( + opType = StatelessIf.OP_NAME, + inputsClass = StatelessIf.Inputs.class +) @Operator public final class StatelessIf extends RawOp implements If { /** @@ -46,8 +55,8 @@ public final class StatelessIf extends RawOp implements If { private List> output; @SuppressWarnings("unchecked") - private StatelessIf(Operation operation) { - super(operation); + public StatelessIf(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -123,4 +132,62 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatelessIf.class + ) + public static class Inputs extends RawOpInputs { + /** + *
    +     *   A Tensor. If the tensor is a scalar of non-boolean type, the
    +     *   scalar is converted to a boolean according to the
    +     *   following rule: if the scalar is a numerical value, non-zero means
    +     *   `True` and zero means False; if the scalar is a string, non-empty
    +     *   means `True` and empty means `False`. If the tensor is not a scalar,
    +     *   being empty means False and being non-empty means True.
    +     *
    +     *   This should only be used when the if then/else body functions do not
    +     *   have stateful ops.
    +     * 
    + */ + public final Operand cond; + + /** + * A list of input tensors. + */ + public final Iterable> input; + + /** + * The Tcond attribute + */ + public final DataType Tcond; + + /** + * A list of input types. + */ + public final DataType[] Tin; + + /** + * A list of output types. + */ + public final DataType[] Tout; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new StatelessIf(op), op, Arrays.asList("Tcond", "Tin", "Tout", "output_shapes")); + int inputIndex = 0; + cond = (Operand) op.input(inputIndex++); + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + Tcond = op.attributes().getAttrType("Tcond"); + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessPartitionedCall.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessPartitionedCall.java deleted file mode 100644 index 1563fa781d6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessPartitionedCall.java +++ /dev/null @@ -1,114 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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 {@code f(inputs)}, where {@code f}'s body is placed and partitioned. - * Asynchronously executes a function, potentially across multiple devices but - * within a single process. The kernel places and partitions a given function's - * underlying graph, and executes each of the partitioned subgraphs as a function. - */ -@Operator -public final class StatelessPartitionedCall extends RawOp implements PartitionedCall { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "PartitionedCall"; - - private List> output; - - @SuppressWarnings("unchecked") - private StatelessPartitionedCall(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } - - /** - * Factory method to create a class wrapping a new PartitionedCall operation. - * - * @param scope current scope - * @param args A list of input tensors. - * @param Tout A list of output types. - * @param f
    -   *   A function that takes 'args', a list of tensors, and returns 'output',
    -   *   another list of tensors. Input and output types are specified by 'Tin'
    -   *   and 'Tout'. The function body of f will be placed and partitioned across
    -   *   devices, setting this op apart from the regular Call op.
    -   * 
    - * @param options carries optional attribute values - * @return a new instance of StatelessPartitionedCall - */ - @Endpoint( - describeByClass = true - ) - public static StatelessPartitionedCall create(Scope scope, Iterable> args, - List> Tout, ConcreteFunction f, PartitionedCall.Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessPartitionedCall"); - opBuilder.addInputList(Operands.asOutputs(args)); - opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); - opBuilder.setAttr("f", f); - if (options != null) { - for (PartitionedCall.Options opts : options) { - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - if (opts.configProto != null) { - opBuilder.setAttr("config_proto", opts.configProto); - } - if (opts.executorType != null) { - opBuilder.setAttr("executor_type", opts.executorType); - } - } - } - return new StatelessPartitionedCall(opBuilder.build()); - } - - /** - * Gets output. - * A list of return values. - * @return output. - */ - @Override - public List> output() { - return output; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) output.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java index 94fc05214d6..cad5b32e302 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatelessWhile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * output = input; While (Cond(output)) { output = Body(output) } */ +@OpMetadata( + opType = StatelessWhile.OP_NAME, + inputsClass = StatelessWhile.Inputs.class +) @Operator public final class StatelessWhile extends RawOp implements While { /** @@ -46,8 +55,8 @@ public final class StatelessWhile extends RawOp implements While { private List> output; @SuppressWarnings("unchecked") - private StatelessWhile(Operation operation) { - super(operation); + public StatelessWhile(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -120,4 +129,40 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = StatelessWhile.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of input tensors whose types are T. + */ + public final Iterable> input; + + /** + * dtype in use. + */ + public final DataType[] T; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The parallelIterations attribute + */ + public final long parallelIterations; + + public Inputs(GraphOperation op) { + super(new StatelessWhile(op), op, Arrays.asList("T", "output_shapes", "parallel_iterations")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + T = op.attributes().getAttrTypeList("T"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + parallelIterations = op.attributes().getAttrInt("parallel_iterations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StochasticCastToInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StochasticCastToInt.java new file mode 100644 index 00000000000..a06a2c8017d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StochasticCastToInt.java @@ -0,0 +1,149 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Stochastically cast a given tensor from floats to ints. + * The values are cast with a deterministic pseudo-random tensor from a uniform distribution generated from user given key, counter, algorithm. Values will saturate if out of the specified integer type range, and will become zero if inputs are NaN. + *

    The outputs are a deterministic function of {@code input}, {@code key}, {@code counter}, {@code alg}. + */ +@OpMetadata( + opType = StochasticCastToInt.OP_NAME, + inputsClass = StochasticCastToInt.Inputs.class +) +@Operator +public final class StochasticCastToInt extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StochasticCastToInt"; + + private Output output; + + public StochasticCastToInt(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StochasticCastToInt operation. + * + * @param scope current scope + * @param input The operand to stochastically cast to int. + * @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 Tout The type of the output. + * @param data type for {@code StochasticCastToInt} output and operands + * @return a new instance of StochasticCastToInt + */ + @Endpoint( + describeByClass = true + ) + public static StochasticCastToInt create(Scope scope, + Operand input, Operand key, + Operand counter, Operand alg, Class Tout) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StochasticCastToInt"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + return new StochasticCastToInt<>(opBuilder.build()); + } + + /** + * Gets output. + * The cast result with the same shape as the input. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = StochasticCastToInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The operand to stochastically cast to int. + */ + public final Operand input; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The type of the input. + */ + public final DataType Tin; + + /** + * The type of the output. + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new StochasticCastToInt<>(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java index 045f9f840ec..fb486c42253 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -79,9 +85,11 @@ *

  • Adversarial training, where no backprop should happen through the adversarial * example generation process.
  • * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StopGradient.OP_NAME, + inputsClass = StopGradient.Inputs.class +) @Operator public final class StopGradient extends RawOp implements Operand { /** @@ -91,8 +99,8 @@ public final class StopGradient extends RawOp implements Operan private Output output; - private StopGradient(Operation operation) { - super(operation); + public StopGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -101,7 +109,7 @@ private StopGradient(Operation operation) { * Factory method to create a class wrapping a new StopGradient operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code StopGradient} output and operands * @return a new instance of StopGradient */ @@ -127,4 +135,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StopGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new StopGradient<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java index 60be840fc96..ec55dae1c24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -127,9 +133,11 @@ *

    Requirements: * {@code 0 != strides[i] for i in [0, m)} * {@code ellipsis_mask must be a power of two (only one ellipsis)} - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StridedSlice.OP_NAME, + inputsClass = StridedSlice.Inputs.class +) @Operator public final class StridedSlice extends RawOp implements Operand { /** @@ -139,8 +147,8 @@ public final class StridedSlice extends RawOp implements Operan private Output output; - private StridedSlice(Operation operation) { - super(operation); + public StridedSlice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -149,7 +157,7 @@ private StridedSlice(Operation operation) { * Factory method to create a class wrapping a new StridedSlice operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param begin {@code begin[k]} specifies the offset into the {@code k}th range specification. * The exact dimension this corresponds to will be determined by context. * Out-of-bounds values will be silently clamped. If the {@code k}th bit of @@ -365,4 +373,104 @@ public Options shrinkAxisMask(Long shrinkAxisMask) { return this; } } + + @OpInputsMetadata( + outputsClass = StridedSlice.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * {@code begin[k]} specifies the offset into the {@code k}th range specification. + * The exact dimension this corresponds to will be determined by context. + * Out-of-bounds values will be silently clamped. If the {@code k}th bit of + * {@code begin_mask} then {@code begin[k]} is ignored and the full range of the + * appropriate dimension is used instead. Negative values causes indexing + * to start from the highest element e.g. If {@code foo==[1,2,3]} then {@code foo[-1]==3}. + */ + public final Operand begin; + + /** + * {@code end[i]} is like {@code begin} with the exception that {@code end_mask} is + * used to determine full ranges. + */ + public final Operand end; + + /** + * {@code strides[i]} specifies the increment in the {@code i}th specification + * after extracting a given element. Negative indices will reverse + * the original order. Out or range values are + * clamped to {@code [0,dim[i]) if slice[i]>0} or {@code [-1,dim[i]-1] if slice[i] < 0} + */ + public final Operand strides; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + /** + * a bitmask where a bit i being 1 means to ignore the begin + * value and instead use the largest interval possible. At runtime + * begin[i] will be replaced with {@code [0, n-1)} if {@code stride[i] > 0} or + * {@code [-1, n-1]} if {@code stride[i] < 0} + */ + public final long beginMask; + + /** + * analogous to {@code begin_mask} + */ + public final long endMask; + + /** + * a bitmask where bit {@code i} being 1 means the {@code i}th + * position is actually an ellipsis. One bit at most can be 1. + * If {@code ellipsis_mask == 0}, then an implicit ellipsis mask of {@code 1 << (m+1)} + * is provided. This means that {@code foo[3:5] == foo[3:5, ...]}. An ellipsis + * implicitly creates as many range specifications as necessary to fully + * specify the sliced range for every dimension. For example for a 4-dimensional + * tensor {@code foo} the slice {@code foo[2, ..., 5:8]} implies {@code foo[2, :, :, 5:8]}. + */ + public final long ellipsisMask; + + /** + * a bitmask where bit {@code i} being 1 means the {@code i}th + * specification creates a new shape 1 dimension. For example + * {@code foo[:4, tf.newaxis, :2]} would produce a shape {@code (4, 1, 2)} tensor. + */ + public final long newAxisMask; + + /** + * a bitmask where bit {@code i} implies that the {@code i}th + * specification should shrink the dimensionality. begin and end + * must imply a slice of size 1 in the dimension. For example in + * python one might do {@code foo[:, 3, :]} which would result in + * {@code shrink_axis_mask} being 2. + */ + public final long shrinkAxisMask; + + public Inputs(GraphOperation op) { + super(new StridedSlice<>(op), op, Arrays.asList("T", "Index", "begin_mask", "end_mask", "ellipsis_mask", "new_axis_mask", "shrink_axis_mask")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + end = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + beginMask = op.attributes().getAttrInt("begin_mask"); + endMask = op.attributes().getAttrInt("end_mask"); + ellipsisMask = op.attributes().getAttrInt("ellipsis_mask"); + newAxisMask = op.attributes().getAttrInt("new_axis_mask"); + shrinkAxisMask = op.attributes().getAttrInt("shrink_axis_mask"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java index dc64084c4d5..2911a675905 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * {@code begin}, {@code end}, {@code strides}, etc. work exactly as in {@code StridedSlice}. *

    NOTE this op currently does not support broadcasting and so {@code value}'s * shape must be exactly the shape produced by the slice of {@code ref}. - * - * @param data type for {@code output_ref} output */ +@OpMetadata( + opType = StridedSliceAssign.OP_NAME, + inputsClass = StridedSliceAssign.Inputs.class +) @Operator public final class StridedSliceAssign extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class StridedSliceAssign extends RawOp implements private Output outputRef; - private StridedSliceAssign(Operation operation) { - super(operation); + public StridedSliceAssign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputRef = operation.output(outputIdx++); } @@ -57,11 +65,11 @@ private StridedSliceAssign(Operation operation) { * Factory method to create a class wrapping a new StridedSliceAssign operation. * * @param scope current scope - * @param ref the ref value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param ref The ref value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code StridedSliceAssign} output and operands * @param data type for {@code StridedSliceAssign} output and operands @@ -237,4 +245,86 @@ public Options shrinkAxisMask(Long shrinkAxisMask) { return this; } } + + @OpInputsMetadata( + outputsClass = StridedSliceAssign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The ref input + */ + public final Operand ref; + + /** + * The begin input + */ + public final Operand begin; + + /** + * The end input + */ + public final Operand end; + + /** + * The strides input + */ + public final Operand strides; + + /** + * The value input + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + /** + * The beginMask attribute + */ + public final long beginMask; + + /** + * The endMask attribute + */ + public final long endMask; + + /** + * The ellipsisMask attribute + */ + public final long ellipsisMask; + + /** + * The newAxisMask attribute + */ + public final long newAxisMask; + + /** + * The shrinkAxisMask attribute + */ + public final long shrinkAxisMask; + + public Inputs(GraphOperation op) { + super(new StridedSliceAssign<>(op), op, Arrays.asList("T", "Index", "begin_mask", "end_mask", "ellipsis_mask", "new_axis_mask", "shrink_axis_mask")); + int inputIndex = 0; + ref = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + end = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + beginMask = op.attributes().getAttrInt("begin_mask"); + endMask = op.attributes().getAttrInt("end_mask"); + ellipsisMask = op.attributes().getAttrInt("ellipsis_mask"); + newAxisMask = op.attributes().getAttrInt("new_axis_mask"); + shrinkAxisMask = op.attributes().getAttrInt("shrink_axis_mask"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java index 123691b24c9..fcd7518dd87 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -37,9 +43,11 @@ *

    Arguments are the same as StridedSliceGrad with the exception that * {@code dy} is the input gradient to be propagated and {@code shape} is the * shape of {@code StridedSlice}'s {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StridedSliceGrad.OP_NAME, + inputsClass = StridedSliceGrad.Inputs.class +) @Operator public final class StridedSliceGrad extends RawOp implements Operand { /** @@ -49,8 +57,8 @@ public final class StridedSliceGrad extends RawOp implements Op private Output output; - private StridedSliceGrad(Operation operation) { - super(operation); + public StridedSliceGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,11 +67,11 @@ private StridedSliceGrad(Operation operation) { * Factory method to create a class wrapping a new StridedSliceGrad operation. * * @param scope current scope - * @param shape the shape value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param dy the dy value + * @param shape The shape value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param dy The dy value * @param options carries optional attribute values * @param data type for {@code StridedSliceGrad} output and operands * @param data type for {@code StridedSliceGrad} output and operands @@ -239,4 +247,86 @@ public Options shrinkAxisMask(Long shrinkAxisMask) { return this; } } + + @OpInputsMetadata( + outputsClass = StridedSliceGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape input + */ + public final Operand shape; + + /** + * The begin input + */ + public final Operand begin; + + /** + * The end input + */ + public final Operand end; + + /** + * The strides input + */ + public final Operand strides; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + /** + * The beginMask attribute + */ + public final long beginMask; + + /** + * The endMask attribute + */ + public final long endMask; + + /** + * The ellipsisMask attribute + */ + public final long ellipsisMask; + + /** + * The newAxisMask attribute + */ + public final long newAxisMask; + + /** + * The shrinkAxisMask attribute + */ + public final long shrinkAxisMask; + + public Inputs(GraphOperation op) { + super(new StridedSliceGrad<>(op), op, Arrays.asList("T", "Index", "begin_mask", "end_mask", "ellipsis_mask", "new_axis_mask", "shrink_axis_mask")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + end = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + beginMask = op.attributes().getAttrInt("begin_mask"); + endMask = op.attributes().getAttrInt("end_mask"); + ellipsisMask = op.attributes().getAttrInt("ellipsis_mask"); + newAxisMask = op.attributes().getAttrInt("new_axis_mask"); + shrinkAxisMask = op.attributes().getAttrInt("shrink_axis_mask"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java index ec0dfd9f6e9..abcdb1ee9ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Sum.OP_NAME, + inputsClass = Sum.Inputs.class +) @Operator public final class Sum extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class Sum extends RawOp implements Operand { private Output output; - private Sum(Operation operation) { - super(operation); + public Sum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -125,4 +133,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Sum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Sum<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java index a65d91c3038..c6842c9ab87 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * If {@code pred} is true, the {@code data} input is forwarded to {@code output_true}. Otherwise, * the data goes to {@code output_false}. *

    See also {@code RefSwitch} and {@code Merge}. - * - * @param data type for {@code output_false} output */ +@OpMetadata( + opType = SwitchCond.OP_NAME, + inputsClass = SwitchCond.Inputs.class +) @Operator public final class SwitchCond extends RawOp { /** @@ -47,8 +55,8 @@ public final class SwitchCond extends RawOp { private Output outputTrue; - private SwitchCond(Operation operation) { - super(operation); + public SwitchCond(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputFalse = operation.output(outputIdx++); outputTrue = operation.output(outputIdx++); @@ -91,4 +99,32 @@ public Output outputFalse() { public Output outputTrue() { return outputTrue; } + + @OpInputsMetadata( + outputsClass = SwitchCond.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be forwarded to the appropriate output. + */ + public final Operand data; + + /** + * A scalar that specifies which output port will receive data. + */ + public final Operand pred; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SwitchCond<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + pred = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SyncDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SyncDevice.java new file mode 100644 index 00000000000..a85fd9312c5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SyncDevice.java @@ -0,0 +1,75 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; + +/** + * Synchronizes the device this op is run on. + * Only GPU ops are asynchrous in TensorFlow, and so this only has an effect when + * run on GPUs. On GPUs, this op synchronizes the GPU's compute stream. + */ +@OpMetadata( + opType = SyncDevice.OP_NAME, + inputsClass = SyncDevice.Inputs.class +) +@Operator +public final class SyncDevice extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SyncDevice"; + + public SyncDevice(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new SyncDevice operation. + * + * @param scope current scope + * @return a new instance of SyncDevice + */ + @Endpoint( + describeByClass = true + ) + public static SyncDevice create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SyncDevice"); + return new SyncDevice(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = SyncDevice.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new SyncDevice(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java index 93baf455fa5..d66021bb728 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -42,9 +48,11 @@ * var = state_ops.assign(var, [[4.0, 5.0]]) * var = state_ops.assign_add(var, [[6.0, 7.0]]) * final = state_ops._destroy_temporary_variable(var, var_name=var_name) - * - * @param data type for {@code ref} output */ +@OpMetadata( + opType = TemporaryVariable.OP_NAME, + inputsClass = TemporaryVariable.Inputs.class +) @Operator public final class TemporaryVariable extends RawOp implements Operand { /** @@ -54,8 +62,8 @@ public final class TemporaryVariable extends RawOp implements O private Output ref; - private TemporaryVariable(Operation operation) { - super(operation); + public TemporaryVariable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; ref = operation.output(outputIdx++); } @@ -134,4 +142,33 @@ public Options varName(String varName) { return this; } } + + @OpInputsMetadata( + outputsClass = TemporaryVariable.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the variable tensor. + */ + public final Shape shape; + + /** + * The type of elements in the variable tensor. + */ + public final DataType dtype; + + /** + * Overrides the name used for the temporary variable resource. Default + * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). + */ + public final String varName; + + public Inputs(GraphOperation op) { + super(new TemporaryVariable<>(op), op, Arrays.asList("shape", "dtype", "var_name")); + int inputIndex = 0; + shape = op.attributes().getAttrShape("shape"); + dtype = op.attributes().getAttrType("dtype"); + varName = op.attributes().getAttrString("var_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java index 39979757083..61bf11cfd75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ * An array of Tensors of given size. * Write data via Write and read via Read or Pack. */ +@OpMetadata( + opType = TensorArray.OP_NAME, + inputsClass = TensorArray.Inputs.class +) @Operator public final class TensorArray extends RawOp { /** @@ -47,8 +57,8 @@ public final class TensorArray extends RawOp { private Output flow; @SuppressWarnings("unchecked") - private TensorArray(Operation operation) { - super(operation); + public TensorArray(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); flow = operation.output(outputIdx++); @@ -258,4 +268,68 @@ public Options tensorArrayName(String tensorArrayName) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorArray.class + ) + public static class Inputs extends RawOpInputs { + /** + * The size of the array. + */ + public final Operand sizeOutput; + + /** + * The type of the elements on the tensor_array. + */ + public final DataType dtype; + + /** + * The expected shape of an element, if known. Used to + * validate the shapes of TensorArray elements. If this shape is not + * fully specified, gathering zero-size TensorArrays is an error. + */ + public final Shape elementShape; + + /** + * A boolean that determines whether writes to the TensorArray + * are allowed to grow the size. By default, this is not allowed. + */ + public final boolean dynamicSize; + + /** + * If true (default), Tensors in the TensorArray are cleared + * after being read. This disables multiple read semantics but allows early + * release of memory. + */ + public final boolean clearAfterRead; + + /** + * If true (default is false), then all + * elements in the TensorArray will be expected to have identical shapes. + * This allows certain behaviors, like dynamically checking for + * consistent shapes on write, and being able to fill in properly + * shaped zero tensors on stack -- even if the element_shape attribute + * is not fully defined. + */ + public final boolean identicalElementShapes; + + /** + * Overrides the name used for the temporary tensor_array + * resource. Default value is the name of the 'TensorArray' op (which + * is guaranteed unique). + */ + public final String tensorArrayName; + + public Inputs(GraphOperation op) { + super(new TensorArray(op), op, Arrays.asList("dtype", "element_shape", "dynamic_size", "clear_after_read", "identical_element_shapes", "tensor_array_name")); + int inputIndex = 0; + sizeOutput = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + elementShape = op.attributes().getAttrShape("element_shape"); + dynamicSize = op.attributes().getAttrBool("dynamic_size"); + clearAfterRead = op.attributes().getAttrBool("clear_after_read"); + identicalElementShapes = op.attributes().getAttrBool("identical_element_shapes"); + tensorArrayName = op.attributes().getAttrString("tensor_array_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java index 37ac21f17af..4fd8a01d8e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ * This enables the user to close and release the resource in the middle * of a step/run. */ +@OpMetadata( + opType = TensorArrayClose.OP_NAME, + inputsClass = TensorArrayClose.Inputs.class +) @Operator public final class TensorArrayClose extends RawOp { /** @@ -38,8 +47,8 @@ public final class TensorArrayClose extends RawOp { */ public static final String OP_NAME = "TensorArrayCloseV3"; - private TensorArrayClose(Operation operation) { - super(operation); + public TensorArrayClose(Operation operation) { + super(operation, OP_NAME); } /** @@ -57,4 +66,20 @@ public static TensorArrayClose create(Scope scope, Operand hand opBuilder.addInput(handle.asOutput()); return new TensorArrayClose(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = TensorArrayClose.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a TensorArray (output of TensorArray or TensorArrayGrad). + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new TensorArrayClose(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java index 6c4cb0582ff..75ba48a0102 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -38,11 +44,15 @@ * (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...) * *

    and concatenates them into a Tensor of shape: - *

    {@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)} + *

    + * (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)
    + * 
    *

    All elements must have the same shape (excepting the first dimension). - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = TensorArrayConcat.OP_NAME, + inputsClass = TensorArrayConcat.Inputs.class +) @Operator public final class TensorArrayConcat extends RawOp { /** @@ -54,8 +64,8 @@ public final class TensorArrayConcat extends RawOp { private Output lengths; - private TensorArrayConcat(Operation operation) { - super(operation); + public TensorArrayConcat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); lengths = operation.output(outputIdx++); @@ -149,4 +159,41 @@ public Options elementShapeExcept0(Shape elementShapeExcept0) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorArrayConcat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The type of the elem that is returned. + */ + public final DataType dtype; + + /** + * The expected shape of an element, if known, + * excluding the first dimension. Used to validate the shapes of + * TensorArray elements. If this shape is not fully specified, concatenating + * zero-size TensorArrays is an error. + */ + public final Shape elementShapeExcept0; + + public Inputs(GraphOperation op) { + super(new TensorArrayConcat<>(op), op, Arrays.asList("dtype", "element_shape_except0")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + elementShapeExcept0 = op.attributes().getAttrShape("element_shape_except0"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java index 9560693fd21..60d8b437b00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ /** * Gather specific elements from the TensorArray into output {@code value}. * All elements selected by {@code indices} must have the same shape. - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = TensorArrayGather.OP_NAME, + inputsClass = TensorArrayGather.Inputs.class +) @Operator public final class TensorArrayGather extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class TensorArrayGather extends RawOp implements O private Output value; - private TensorArrayGather(Operation operation) { - super(operation); + public TensorArrayGather(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -134,4 +142,46 @@ public Options elementShape(Shape elementShape) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorArrayGather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * The locations in the TensorArray from which to read tensor elements. + */ + public final Operand indices; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The type of the elem that is returned. + */ + public final DataType dtype; + + /** + * The expected shape of an element, if known. Used to + * validate the shapes of TensorArray elements. If this shape is not + * fully specified, gathering zero-size TensorArrays is an error. + */ + public final Shape elementShape; + + public Inputs(GraphOperation op) { + super(new TensorArrayGather<>(op), op, Arrays.asList("dtype", "element_shape")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + elementShape = op.attributes().getAttrShape("element_shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java index 0047982655f..1fcbb8e913b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TType; @@ -59,6 +64,10 @@ * name when performing the creation / lookup, so that each separate gradient * calculation gets its own TensorArray accumulator. */ +@OpMetadata( + opType = TensorArrayGrad.OP_NAME, + inputsClass = TensorArrayGrad.Inputs.class +) @Operator public final class TensorArrayGrad extends RawOp { /** @@ -71,8 +80,8 @@ public final class TensorArrayGrad extends RawOp { private Output flowOut; @SuppressWarnings("unchecked") - private TensorArrayGrad(Operation operation) { - super(operation); + public TensorArrayGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; gradHandle = operation.output(outputIdx++); flowOut = operation.output(outputIdx++); @@ -117,4 +126,33 @@ public Output gradHandle() { public Output flowOut() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArrayGrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to the forward TensorArray. + */ + public final Operand handle; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The gradient source string, used to decide which gradient TensorArray + * to return. + */ + public final String source; + + public Inputs(GraphOperation op) { + super(new TensorArrayGrad(op), op, Arrays.asList("source")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + source = op.attributes().getAttrString("source"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java index c4da5d01248..449564fc74f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -36,6 +41,10 @@ * computed. This enables multiple gradients for the same TensorArray to be * calculated using the same accumulator. */ +@OpMetadata( + opType = TensorArrayGradWithShape.OP_NAME, + inputsClass = TensorArrayGradWithShape.Inputs.class +) @Operator public final class TensorArrayGradWithShape extends RawOp { /** @@ -48,8 +57,8 @@ public final class TensorArrayGradWithShape extends RawOp { private Output flowOut; @SuppressWarnings("unchecked") - private TensorArrayGradWithShape(Operation operation) { - super(operation); + public TensorArrayGradWithShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; gradHandle = operation.output(outputIdx++); flowOut = operation.output(outputIdx++); @@ -98,4 +107,41 @@ public Output gradHandle() { public Output flowOut() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArrayGradWithShape.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to the forward TensorArray. + */ + public final Operand handle; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * An int32 vector representing a shape. Elements in the gradient accumulator will + * have shape which is this shape_to_prepend value concatenated with shape of the + * elements in the TensorArray corresponding to the input handle. + */ + public final Operand shapeToPrepend; + + /** + * The gradient source string, used to decide which gradient TensorArray + * to return. + */ + public final String source; + + public Inputs(GraphOperation op) { + super(new TensorArrayGradWithShape(op), op, Arrays.asList("source")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + shapeToPrepend = (Operand) op.input(inputIndex++); + source = op.attributes().getAttrString("source"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java index f51f2f30a17..d1cf5c89e65 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,18 +26,24 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The TensorArrayPack operation - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = TensorArrayPack.OP_NAME, + inputsClass = TensorArrayPack.Inputs.class +) @Operator public final class TensorArrayPack extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class TensorArrayPack extends RawOp implements Ope private Output value; - private TensorArrayPack(Operation operation) { - super(operation); + public TensorArrayPack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -55,9 +63,9 @@ private TensorArrayPack(Operation operation) { * Factory method to create a class wrapping a new TensorArrayPack operation. * * @param scope current scope - * @param handle the handle value - * @param flowIn the flowIn value - * @param dtype the value of the dtype property + * @param handle The handle value + * @param flowIn The flowIn value + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code TensorArrayPack} output and operands * @return a new instance of TensorArrayPack @@ -125,4 +133,38 @@ public Options elementShape(Shape elementShape) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorArrayPack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle input + */ + public final Operand handle; + + /** + * The flowIn input + */ + public final Operand flowIn; + + /** + * The dtype attribute + */ + public final DataType dtype; + + /** + * The elementShape attribute + */ + public final Shape elementShape; + + public Inputs(GraphOperation op) { + super(new TensorArrayPack<>(op), op, Arrays.asList("dtype", "element_shape")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + elementShape = op.attributes().getAttrShape("element_shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java index a7f254c8395..f5a0aa073a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Read an element from the TensorArray into output {@code value}. - * - * @param data type for {@code value} output */ +@OpMetadata( + opType = TensorArrayRead.OP_NAME, + inputsClass = TensorArrayRead.Inputs.class +) @Operator public final class TensorArrayRead extends RawOp implements Operand { /** @@ -44,8 +52,8 @@ public final class TensorArrayRead extends RawOp implements Ope private Output value; - private TensorArrayRead(Operation operation) { - super(operation); + public TensorArrayRead(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -55,7 +63,7 @@ private TensorArrayRead(Operation operation) { * * @param scope current scope * @param handle The handle to a TensorArray. - * @param index the index value + * @param index The index value * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. * @param data type for {@code TensorArrayReadV3} output and operands @@ -88,4 +96,38 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = TensorArrayRead.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * The index input + */ + public final Operand index; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The type of the elem that is returned. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new TensorArrayRead<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java index 2fd32332990..70e1b748367 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ * Scatter the data from the input value into specific TensorArray elements. * {@code indices} must be a vector, its length must match the first dim of {@code value}. */ +@OpMetadata( + opType = TensorArrayScatter.OP_NAME, + inputsClass = TensorArrayScatter.Inputs.class +) @Operator public final class TensorArrayScatter extends RawOp implements Operand { /** @@ -42,8 +52,8 @@ public final class TensorArrayScatter extends RawOp implements Operand private Output flowOut; - private TensorArrayScatter(Operation operation) { - super(operation); + public TensorArrayScatter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; flowOut = operation.output(outputIdx++); } @@ -84,4 +94,44 @@ public Output flowOut() { public Output asOutput() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArrayScatter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * The locations at which to write the tensor elements. + */ + public final Operand indices; + + /** + * The concatenated tensor to write to the TensorArray. + */ + public final Operand value; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorArrayScatter(op), op, Arrays.asList("T")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java index b1c0847805e..7719d72486a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -32,6 +37,10 @@ /** * Get the current size of the TensorArray. */ +@OpMetadata( + opType = TensorArraySize.OP_NAME, + inputsClass = TensorArraySize.Inputs.class +) @Operator public final class TensorArraySize extends RawOp implements Operand { /** @@ -41,8 +50,8 @@ public final class TensorArraySize extends RawOp implements Operand { private Output output; - private TensorArraySize(Operation operation) { - super(operation); + public TensorArraySize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -79,4 +88,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TensorArraySize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a TensorArray (output of TensorArray or TensorArrayGrad). + */ + public final Operand handle; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + public Inputs(GraphOperation op) { + super(new TensorArraySize(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java index 69fa801b51c..64ae60f124f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,15 +38,27 @@ /** * Split the data from the input value into TensorArray elements. * Assuming that {@code lengths} takes on values - *

    {@code (n0, n1, ..., n(T-1))} + *

    + * (n0, n1, ..., n(T-1))
    + * 
    *

    and that {@code value} has shape - *

    {@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)}, + *

    + * (n0 + n1 + ... + n(T-1) x d0 x d1 x ...),
    + * 
    *

    this splits values into a TensorArray with T tensors. *

    TensorArray index t will be the subtensor of values with starting position - *

    {@code (n0 + n1 + ... + n(t-1), 0, 0, ...)} + *

    + * (n0 + n1 + ... + n(t-1), 0, 0, ...)
    + * 
    *

    and having size - *

    {@code nt x d0 x d1 x ...} + *

    + * nt x d0 x d1 x ...
    + * 
    */ +@OpMetadata( + opType = TensorArraySplit.OP_NAME, + inputsClass = TensorArraySplit.Inputs.class +) @Operator public final class TensorArraySplit extends RawOp implements Operand { /** @@ -50,8 +68,8 @@ public final class TensorArraySplit extends RawOp implements Operand { private Output flowOut; - private TensorArraySplit(Operation operation) { - super(operation); + public TensorArraySplit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; flowOut = operation.output(outputIdx++); } @@ -93,4 +111,45 @@ public Output flowOut() { public Output asOutput() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArraySplit.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * The concatenated tensor to write to the TensorArray. + */ + public final Operand value; + + /** + * The vector of lengths, how to split the rows of value into the + * TensorArray. + */ + public final Operand lengths; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorArraySplit(op), op, Arrays.asList("T")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + lengths = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java index 21d9122155f..da4be8f4436 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,6 +38,10 @@ /** * The TensorArrayUnpack operation */ +@OpMetadata( + opType = TensorArrayUnpack.OP_NAME, + inputsClass = TensorArrayUnpack.Inputs.class +) @Operator public final class TensorArrayUnpack extends RawOp implements Operand { /** @@ -41,8 +51,8 @@ public final class TensorArrayUnpack extends RawOp implements Operand private Output flowOut; - private TensorArrayUnpack(Operation operation) { - super(operation); + public TensorArrayUnpack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; flowOut = operation.output(outputIdx++); } @@ -51,9 +61,9 @@ private TensorArrayUnpack(Operation operation) { * Factory method to create a class wrapping a new TensorArrayUnpack operation. * * @param scope current scope - * @param handle the handle value - * @param value the value value - * @param flowIn the flowIn value + * @param handle The handle value + * @param value The value value + * @param flowIn The flowIn value * @return a new instance of TensorArrayUnpack */ @Endpoint( @@ -81,4 +91,38 @@ public Output flowOut() { public Output asOutput() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArrayUnpack.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle input + */ + public final Operand handle; + + /** + * The value input + */ + public final Operand value; + + /** + * The flowIn input + */ + public final Operand flowIn; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorArrayUnpack(op), op, Arrays.asList("T")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java index cb344c15cf2..0b0a2156551 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -32,6 +38,10 @@ /** * Push an element onto the tensor_array. */ +@OpMetadata( + opType = TensorArrayWrite.OP_NAME, + inputsClass = TensorArrayWrite.Inputs.class +) @Operator public final class TensorArrayWrite extends RawOp implements Operand { /** @@ -41,8 +51,8 @@ public final class TensorArrayWrite extends RawOp implements Operand { private Output flowOut; - private TensorArrayWrite(Operation operation) { - super(operation); + public TensorArrayWrite(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; flowOut = operation.output(outputIdx++); } @@ -83,4 +93,44 @@ public Output flowOut() { public Output asOutput() { return flowOut; } + + @OpInputsMetadata( + outputsClass = TensorArrayWrite.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a TensorArray. + */ + public final Operand handle; + + /** + * The position to write to inside the TensorArray. + */ + public final Operand index; + + /** + * The tensor to write to the TensorArray. + */ + public final Operand value; + + /** + * A float scalar that enforces proper chaining of operations. + */ + public final Operand flowIn; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorArrayWrite(op), op, Arrays.asList("T")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + flowIn = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java index c30cfe610c4..70ef65f9314 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * is not already set. * tensor: The concated result. * lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient. - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = TensorListConcat.OP_NAME, + inputsClass = TensorListConcat.Inputs.class +) @Operator public final class TensorListConcat extends RawOp { /** @@ -56,8 +64,8 @@ public final class TensorListConcat extends RawOp { private Output lengths; - private TensorListConcat(Operation operation) { - super(operation); + public TensorListConcat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tensor = operation.output(outputIdx++); lengths = operation.output(outputIdx++); @@ -67,10 +75,10 @@ private TensorListConcat(Operation operation) { * Factory method to create a class wrapping a new TensorListConcatV2 operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param leadingDims the leadingDims value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param leadingDims The leadingDims value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListConcatV2} output and operands * @return a new instance of TensorListConcat */ @@ -105,4 +113,44 @@ public Output tensor() { public Output lengths() { return lengths; } + + @OpInputsMetadata( + outputsClass = TensorListConcat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The leadingDims input + */ + public final Operand leadingDims; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListConcat<>(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + leadingDims = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java index 3e2759d282f..c42fdd43d92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The TensorListConcatLists operation */ +@OpMetadata( + opType = TensorListConcatLists.OP_NAME, + inputsClass = TensorListConcatLists.Inputs.class +) @Operator public final class TensorListConcatLists extends RawOp implements Operand { /** @@ -41,8 +51,8 @@ public final class TensorListConcatLists extends RawOp implements Operand private Output output; @SuppressWarnings("unchecked") - private TensorListConcatLists(Operation operation) { - super(operation); + public TensorListConcatLists(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -51,9 +61,9 @@ private TensorListConcatLists(Operation operation) { * Factory method to create a class wrapping a new TensorListConcatLists operation. * * @param scope current scope - * @param inputA the inputA value - * @param inputB the inputB value - * @param elementDtype the value of the elementDtype property + * @param inputA The inputA value + * @param inputB The inputB value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListConcatLists} output and operands * @return a new instance of TensorListConcatLists */ @@ -83,4 +93,32 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = TensorListConcatLists.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputA input + */ + public final Operand inputA; + + /** + * The inputB input + */ + public final Operand inputB; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListConcatLists(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputA = (Operand) op.input(inputIndex++); + inputB = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java index 578a7978697..6190f9c1c01 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * The shape of the elements of the given list, as a tensor. * input_handle: the list * element_shape: the shape of elements of the list - * - * @param data type for {@code element_shape} output */ +@OpMetadata( + opType = TensorListElementShape.OP_NAME, + inputsClass = TensorListElementShape.Inputs.class +) @Operator public final class TensorListElementShape extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class TensorListElementShape extends RawOp imple private Output elementShape; - private TensorListElementShape(Operation operation) { - super(operation); + public TensorListElementShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; elementShape = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private TensorListElementShape(Operation operation) { * Factory method to create a class wrapping a new TensorListElementShape operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param shapeType the value of the shapeType property + * @param inputHandle The inputHandle value + * @param shapeType The value of the shapeType attribute * @param data type for {@code TensorListElementShape} output and operands * @return a new instance of TensorListElementShape */ @@ -84,4 +92,26 @@ public Output elementShape() { public Output asOutput() { return elementShape; } + + @OpInputsMetadata( + outputsClass = TensorListElementShape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListElementShape<>(op), op, Arrays.asList("shape_type")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java index 76f3a4c3c51..6b268fa40b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ *

    tensor: The input tensor. * output_handle: The list. */ +@OpMetadata( + opType = TensorListFromTensor.OP_NAME, + inputsClass = TensorListFromTensor.Inputs.class +) @Operator public final class TensorListFromTensor extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class TensorListFromTensor extends RawOp implements Operand private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListFromTensor(Operation operation) { - super(operation); + public TensorListFromTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -54,8 +64,8 @@ private TensorListFromTensor(Operation operation) { * Factory method to create a class wrapping a new TensorListFromTensor operation. * * @param scope current scope - * @param tensor the tensor value - * @param elementShape the elementShape value + * @param tensor The tensor value + * @param elementShape The elementShape value * @return a new instance of TensorListFromTensor */ @Endpoint( @@ -83,4 +93,38 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListFromTensor.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListFromTensor(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java index 41848040b03..ac725c72b97 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ *

    input_handle: The input tensor list. * indices: The indices used to index into the list. * values: The tensor. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = TensorListGather.OP_NAME, + inputsClass = TensorListGather.Inputs.class +) @Operator public final class TensorListGather extends RawOp implements Operand { /** @@ -48,8 +56,8 @@ public final class TensorListGather extends RawOp implements Op private Output values; - private TensorListGather(Operation operation) { - super(operation); + public TensorListGather(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; values = operation.output(outputIdx++); } @@ -58,10 +66,10 @@ private TensorListGather(Operation operation) { * Factory method to create a class wrapping a new TensorListGather operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param indices the indices value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param indices The indices value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListGather} output and operands * @return a new instance of TensorListGather */ @@ -92,4 +100,38 @@ public Output values() { public Output asOutput() { return values; } + + @OpInputsMetadata( + outputsClass = TensorListGather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListGather<>(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java index 61fdb9b41b6..244704b5754 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,34 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** - * The TensorListGetItem operation - * - * @param data type for {@code item} output + * Returns the item in the list with the given index. + * input_handle: the list + * index: the position in the list from which an element will be retrieved + * item: the element at that position */ +@OpMetadata( + opType = TensorListGetItem.OP_NAME, + inputsClass = TensorListGetItem.Inputs.class +) @Operator public final class TensorListGetItem extends RawOp implements Operand { /** @@ -43,8 +54,8 @@ public final class TensorListGetItem extends RawOp implements O private Output item; - private TensorListGetItem(Operation operation) { - super(operation); + public TensorListGetItem(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; item = operation.output(outputIdx++); } @@ -53,10 +64,10 @@ private TensorListGetItem(Operation operation) { * Factory method to create a class wrapping a new TensorListGetItem operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param index the index value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param index The index value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListGetItem} output and operands * @return a new instance of TensorListGetItem */ @@ -87,4 +98,38 @@ public Output item() { public Output asOutput() { return item; } + + @OpInputsMetadata( + outputsClass = TensorListGetItem.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The index input + */ + public final Operand index; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListGetItem<>(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java index 9fd22ca4a11..c00f4e03790 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * input_handle: the input list * length: the number of tensors in the list */ +@OpMetadata( + opType = TensorListLength.OP_NAME, + inputsClass = TensorListLength.Inputs.class +) @Operator public final class TensorListLength extends RawOp implements Operand { /** @@ -42,8 +51,8 @@ public final class TensorListLength extends RawOp implements Operand { private Output length; - private TensorListLength(Operation operation) { - super(operation); + public TensorListLength(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; length = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private TensorListLength(Operation operation) { * Factory method to create a class wrapping a new TensorListLength operation. * * @param scope current scope - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of TensorListLength */ @Endpoint( @@ -77,4 +86,20 @@ public Output length() { public Output asOutput() { return length; } + + @OpInputsMetadata( + outputsClass = TensorListLength.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + public Inputs(GraphOperation op) { + super(new TensorListLength(op), op, Arrays.asList()); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java index 09b6bf41be9..af805e71f9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ * tensor: the withdrawn last element of the list * element_dtype: the type of elements in the list * element_shape: the shape of the output tensor - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = TensorListPopBack.OP_NAME, + inputsClass = TensorListPopBack.Inputs.class +) @Operator public final class TensorListPopBack extends RawOp { /** @@ -51,8 +59,8 @@ public final class TensorListPopBack extends RawOp { private Output tensor; @SuppressWarnings("unchecked") - private TensorListPopBack(Operation operation) { - super(operation); + public TensorListPopBack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); tensor = operation.output(outputIdx++); @@ -62,9 +70,9 @@ private TensorListPopBack(Operation operation) { * Factory method to create a class wrapping a new TensorListPopBack operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListPopBack} output and operands * @return a new instance of TensorListPopBack */ @@ -97,4 +105,32 @@ public Output outputHandle() { public Output tensor() { return tensor; } + + @OpInputsMetadata( + outputsClass = TensorListPopBack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListPopBack<>(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java index e347e64313d..3a85c898752 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,6 +41,10 @@ * element_dtype: the type of elements in the list. * element_shape: a shape compatible with that of elements in the list. */ +@OpMetadata( + opType = TensorListPushBack.OP_NAME, + inputsClass = TensorListPushBack.Inputs.class +) @Operator public final class TensorListPushBack extends RawOp implements Operand { /** @@ -45,8 +55,8 @@ public final class TensorListPushBack extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListPushBack(Operation operation) { - super(operation); + public TensorListPushBack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -55,8 +65,8 @@ private TensorListPushBack(Operation operation) { * Factory method to create a class wrapping a new TensorListPushBack operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param tensor the tensor value + * @param inputHandle The inputHandle value + * @param tensor The tensor value * @return a new instance of TensorListPushBack */ @Endpoint( @@ -84,4 +94,32 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListPushBack.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListPushBack(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java index a48e5c5f2d4..fe3c113c12a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The TensorListPushBackBatch operation */ +@OpMetadata( + opType = TensorListPushBackBatch.OP_NAME, + inputsClass = TensorListPushBackBatch.Inputs.class +) @Operator public final class TensorListPushBackBatch extends RawOp implements Operand { /** @@ -40,8 +50,8 @@ public final class TensorListPushBackBatch extends RawOp implements Operand outputHandles; @SuppressWarnings("unchecked") - private TensorListPushBackBatch(Operation operation) { - super(operation); + public TensorListPushBackBatch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandles = operation.output(outputIdx++); } @@ -50,8 +60,8 @@ private TensorListPushBackBatch(Operation operation) { * Factory method to create a class wrapping a new TensorListPushBackBatch operation. * * @param scope current scope - * @param inputHandles the inputHandles value - * @param tensor the tensor value + * @param inputHandles The inputHandles value + * @param tensor The tensor value * @return a new instance of TensorListPushBackBatch */ @Endpoint( @@ -79,4 +89,32 @@ public Output outputHandles() { public Output asOutput() { return (Output) outputHandles; } + + @OpInputsMetadata( + outputsClass = TensorListPushBackBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandles input + */ + public final Operand inputHandles; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListPushBackBatch(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandles = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java index 923592b48be..8c3393a1ef0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -37,6 +43,10 @@ * handle: the output list * element_dtype: the desired type of elements in the list. */ +@OpMetadata( + opType = TensorListReserve.OP_NAME, + inputsClass = TensorListReserve.Inputs.class +) @Operator public final class TensorListReserve extends RawOp implements Operand { /** @@ -47,8 +57,8 @@ public final class TensorListReserve extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TensorListReserve(Operation operation) { - super(operation); + public TensorListReserve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,9 +67,9 @@ private TensorListReserve(Operation operation) { * Factory method to create a class wrapping a new TensorListReserve operation. * * @param scope current scope - * @param elementShape the elementShape value - * @param numElements the numElements value - * @param elementDtype the value of the elementDtype property + * @param elementShape The elementShape value + * @param numElements The numElements value + * @param elementDtype The value of the elementDtype attribute * @param data type for {@code TensorListReserve} output and operands * @return a new instance of TensorListReserve */ @@ -89,4 +99,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = TensorListReserve.class + ) + public static class Inputs extends RawOpInputs { + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The numElements input + */ + public final Operand numElements; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListReserve(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + elementShape = (Operand) op.input(inputIndex++); + numElements = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java index 5642bc4ba3a..0b8aa70e6b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * input_handle: the input list * size: size of the output list */ +@OpMetadata( + opType = TensorListResize.OP_NAME, + inputsClass = TensorListResize.Inputs.class +) @Operator public final class TensorListResize extends RawOp implements Operand { /** @@ -43,8 +52,8 @@ public final class TensorListResize extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListResize(Operation operation) { - super(operation); + public TensorListResize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -53,8 +62,8 @@ private TensorListResize(Operation operation) { * Factory method to create a class wrapping a new TensorListResize operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param sizeOutput the sizeOutput value + * @param inputHandle The inputHandle value + * @param sizeOutput The sizeOutput value * @return a new instance of TensorListResize */ @Endpoint( @@ -82,4 +91,26 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListResize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The sizeOutput input + */ + public final Operand sizeOutput; + + public Inputs(GraphOperation op) { + super(new TensorListResize(op), op, Arrays.asList()); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java index efc6c1b57e6..43bf2d40dd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,6 +48,10 @@ * the largest index in indices. * output_handle: The TensorList. */ +@OpMetadata( + opType = TensorListScatter.OP_NAME, + inputsClass = TensorListScatter.Inputs.class +) @Operator public final class TensorListScatter extends RawOp implements Operand { /** @@ -52,8 +62,8 @@ public final class TensorListScatter extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListScatter(Operation operation) { - super(operation); + public TensorListScatter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -62,10 +72,10 @@ private TensorListScatter(Operation operation) { * Factory method to create a class wrapping a new TensorListScatterV2 operation. * * @param scope current scope - * @param tensor the tensor value - * @param indices the indices value - * @param elementShape the elementShape value - * @param numElements the numElements value + * @param tensor The tensor value + * @param indices The indices value + * @param elementShape The elementShape value + * @param numElements The numElements value * @return a new instance of TensorListScatter */ @Endpoint( @@ -96,4 +106,50 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListScatter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The numElements input + */ + public final Operand numElements; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListScatter(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + numElements = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java index 6365d722f80..4a7c7523b6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -37,6 +43,10 @@ * indices: The indices used to index into the list. * output_handle: The TensorList. */ +@OpMetadata( + opType = TensorListScatterIntoExistingList.OP_NAME, + inputsClass = TensorListScatterIntoExistingList.Inputs.class +) @Operator public final class TensorListScatterIntoExistingList extends RawOp implements Operand { /** @@ -47,8 +57,8 @@ public final class TensorListScatterIntoExistingList extends RawOp implements Op private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListScatterIntoExistingList(Operation operation) { - super(operation); + public TensorListScatterIntoExistingList(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -57,9 +67,9 @@ private TensorListScatterIntoExistingList(Operation operation) { * Factory method to create a class wrapping a new TensorListScatterIntoExistingList operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param tensor the tensor value - * @param indices the indices value + * @param inputHandle The inputHandle value + * @param tensor The tensor value + * @param indices The indices value * @return a new instance of TensorListScatterIntoExistingList */ @Endpoint( @@ -89,4 +99,38 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListScatterIntoExistingList.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + public Inputs(GraphOperation op) { + super(new TensorListScatterIntoExistingList(op), op, Arrays.asList("element_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java index 6974ee0a1a1..9819855d789 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,34 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** - * The TensorListSetItem operation + * Sets the index-th position of the list to contain the given tensor. + * input_handle: the list + * index: the position in the list to which the tensor will be assigned + * item: the element to be assigned to that position + * output_handle: the new list, with the element in the proper position */ +@OpMetadata( + opType = TensorListSetItem.OP_NAME, + inputsClass = TensorListSetItem.Inputs.class +) @Operator public final class TensorListSetItem extends RawOp implements Operand { /** @@ -41,8 +55,8 @@ public final class TensorListSetItem extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListSetItem(Operation operation) { - super(operation); + public TensorListSetItem(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -51,23 +65,41 @@ private TensorListSetItem(Operation operation) { * Factory method to create a class wrapping a new TensorListSetItem operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param index the index value - * @param item the item value + * @param inputHandle The inputHandle value + * @param index The index value + * @param item The item value + * @param options carries optional attribute values * @return a new instance of TensorListSetItem */ @Endpoint( describeByClass = true ) public static TensorListSetItem create(Scope scope, Operand inputHandle, - Operand index, Operand item) { + Operand index, Operand item, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorListSetItem"); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(item.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.resizeIfIndexOutOfBounds != null) { + opBuilder.setAttr("resize_if_index_out_of_bounds", opts.resizeIfIndexOutOfBounds); + } + } + } return new TensorListSetItem(opBuilder.build()); } + /** + * Sets the resizeIfIndexOutOfBounds option. + * + * @param resizeIfIndexOutOfBounds the resizeIfIndexOutOfBounds option + * @return this Options instance. + */ + public static Options resizeIfIndexOutOfBounds(Boolean resizeIfIndexOutOfBounds) { + return new Options().resizeIfIndexOutOfBounds(resizeIfIndexOutOfBounds); + } + /** * Gets outputHandle. * @@ -82,4 +114,65 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorListSetItem} + */ + public static class Options { + private Boolean resizeIfIndexOutOfBounds; + + private Options() { + } + + /** + * Sets the resizeIfIndexOutOfBounds option. + * + * @param resizeIfIndexOutOfBounds the resizeIfIndexOutOfBounds option + * @return this Options instance. + */ + public Options resizeIfIndexOutOfBounds(Boolean resizeIfIndexOutOfBounds) { + this.resizeIfIndexOutOfBounds = resizeIfIndexOutOfBounds; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorListSetItem.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The index input + */ + public final Operand index; + + /** + * The item input + */ + public final Operand item; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The resizeIfIndexOutOfBounds attribute + */ + public final boolean resizeIfIndexOutOfBounds; + + public Inputs(GraphOperation op) { + super(new TensorListSetItem(op), op, Arrays.asList("element_dtype", "resize_if_index_out_of_bounds")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + item = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + resizeIfIndexOutOfBounds = op.attributes().getAttrBool("resize_if_index_out_of_bounds"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java index 18987c1c9ef..eb757e2f297 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,6 +44,10 @@ * lengths: Vector of sizes of the 0th dimension of tensors in the list. * output_handle: The list. */ +@OpMetadata( + opType = TensorListSplit.OP_NAME, + inputsClass = TensorListSplit.Inputs.class +) @Operator public final class TensorListSplit extends RawOp implements Operand { /** @@ -48,8 +58,8 @@ public final class TensorListSplit extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorListSplit(Operation operation) { - super(operation); + public TensorListSplit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -58,9 +68,9 @@ private TensorListSplit(Operation operation) { * Factory method to create a class wrapping a new TensorListSplit operation. * * @param scope current scope - * @param tensor the tensor value - * @param elementShape the elementShape value - * @param lengths the lengths value + * @param tensor The tensor value + * @param elementShape The elementShape value + * @param lengths The lengths value * @return a new instance of TensorListSplit */ @Endpoint( @@ -89,4 +99,44 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorListSplit.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The lengths input + */ + public final Operand lengths; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The shapeType attribute + */ + public final DataType shapeType; + + public Inputs(GraphOperation op) { + super(new TensorListSplit(op), op, Arrays.asList("element_dtype", "shape_type")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + lengths = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + shapeType = op.attributes().getAttrType("shape_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java index 28c33663b69..2d058b8e00d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ *

    input_handle: the input list * tensor: the gathered result * num_elements: optional. If not -1, the number of elements in the list. - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = TensorListStack.OP_NAME, + inputsClass = TensorListStack.Inputs.class +) @Operator public final class TensorListStack extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class TensorListStack extends RawOp implements Ope private Output tensor; - private TensorListStack(Operation operation) { - super(operation); + public TensorListStack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tensor = operation.output(outputIdx++); } @@ -57,9 +65,9 @@ private TensorListStack(Operation operation) { * Factory method to create a class wrapping a new TensorListStack operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param elementShape the elementShape value - * @param elementDtype the value of the elementDtype property + * @param inputHandle The inputHandle value + * @param elementShape The elementShape value + * @param elementDtype The value of the elementDtype attribute * @param options carries optional attribute values * @param data type for {@code TensorListStack} output and operands * @return a new instance of TensorListStack @@ -128,4 +136,38 @@ public Options numElements(Long numElements) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorListStack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The elementShape input + */ + public final Operand elementShape; + + /** + * The elementDtype attribute + */ + public final DataType elementDtype; + + /** + * The numElements attribute + */ + public final long numElements; + + public Inputs(GraphOperation op) { + super(new TensorListStack<>(op), op, Arrays.asList("element_dtype", "num_elements")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + elementShape = (Operand) op.input(inputIndex++); + elementDtype = op.attributes().getAttrType("element_dtype"); + numElements = op.attributes().getAttrInt("num_elements"); + } + } } 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 index a714154cb25..ff8d9eb84c7 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ * output_handle: the map with value from given key removed * key: the key of the value to be erased */ +@OpMetadata( + opType = TensorMapErase.OP_NAME, + inputsClass = TensorMapErase.Inputs.class +) @Operator public final class TensorMapErase extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class TensorMapErase extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorMapErase(Operation operation) { - super(operation); + public TensorMapErase(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -54,9 +64,9 @@ private TensorMapErase(Operation operation) { * Factory method to create a class wrapping a new TensorMapErase operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param key the key value - * @param valueDtype the value of the valueDtype property + * @param inputHandle The inputHandle value + * @param key The key value + * @param valueDtype The value of the valueDtype attribute * @param data type for {@code TensorMapErase} output and operands * @return a new instance of TensorMapErase */ @@ -86,4 +96,38 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorMapErase.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The key input + */ + public final Operand key; + + /** + * The keyDtype attribute + */ + public final DataType keyDtype; + + /** + * The valueDtype attribute + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new TensorMapErase(op), op, Arrays.asList("key_dtype", "value_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } } 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 index 99bbff077b5..bbc9ac4d483 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ * key: the key to check * has_key: whether the key is already in the map or not */ +@OpMetadata( + opType = TensorMapHasKey.OP_NAME, + inputsClass = TensorMapHasKey.Inputs.class +) @Operator public final class TensorMapHasKey extends RawOp implements Operand { /** @@ -43,8 +53,8 @@ public final class TensorMapHasKey extends RawOp implements Operand { private Output hasKey; - private TensorMapHasKey(Operation operation) { - super(operation); + public TensorMapHasKey(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; hasKey = operation.output(outputIdx++); } @@ -53,8 +63,8 @@ private TensorMapHasKey(Operation operation) { * Factory method to create a class wrapping a new TensorMapHasKey operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param key the key value + * @param inputHandle The inputHandle value + * @param key The key value * @return a new instance of TensorMapHasKey */ @Endpoint( @@ -81,4 +91,32 @@ public Output hasKey() { public Output asOutput() { return hasKey; } + + @OpInputsMetadata( + outputsClass = TensorMapHasKey.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The key input + */ + public final Operand key; + + /** + * The keyDtype attribute + */ + public final DataType keyDtype; + + public Inputs(GraphOperation op) { + super(new TensorMapHasKey(op), op, Arrays.asList("key_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + } + } } 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 index c51ea51b187..4569d8eb59f 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ * key: the key to be inserted * value: the value to be inserted */ +@OpMetadata( + opType = TensorMapInsert.OP_NAME, + inputsClass = TensorMapInsert.Inputs.class +) @Operator public final class TensorMapInsert extends RawOp implements Operand { /** @@ -44,8 +54,8 @@ public final class TensorMapInsert extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private TensorMapInsert(Operation operation) { - super(operation); + public TensorMapInsert(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -54,9 +64,9 @@ private TensorMapInsert(Operation operation) { * Factory method to create a class wrapping a new TensorMapInsert operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param key the key value - * @param value the value value + * @param inputHandle The inputHandle value + * @param key The key value + * @param value The value value * @return a new instance of TensorMapInsert */ @Endpoint( @@ -85,4 +95,44 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = TensorMapInsert.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The key input + */ + public final Operand key; + + /** + * The value input + */ + public final Operand value; + + /** + * The keyDtype attribute + */ + public final DataType keyDtype; + + /** + * The valueDtype attribute + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new TensorMapInsert(op), op, Arrays.asList("key_dtype", "value_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } } 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 index 74455fd3cba..a3e8b54e888 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ * 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 */ +@OpMetadata( + opType = TensorMapLookup.OP_NAME, + inputsClass = TensorMapLookup.Inputs.class +) @Operator public final class TensorMapLookup extends RawOp implements Operand { /** @@ -45,8 +53,8 @@ public final class TensorMapLookup extends RawOp implements Ope private Output value; - private TensorMapLookup(Operation operation) { - super(operation); + public TensorMapLookup(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -55,9 +63,9 @@ private TensorMapLookup(Operation operation) { * Factory method to create a class wrapping a new TensorMapLookup operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param key the key value - * @param valueDtype the value of the valueDtype property + * @param inputHandle The inputHandle value + * @param key The key value + * @param valueDtype The value of the valueDtype attribute * @param data type for {@code TensorMapLookup} output and operands * @return a new instance of TensorMapLookup */ @@ -86,4 +94,38 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = TensorMapLookup.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The key input + */ + public final Operand key; + + /** + * The keyDtype attribute + */ + public final DataType keyDtype; + + /** + * The valueDtype attribute + */ + public final DataType valueDtype; + + public Inputs(GraphOperation op) { + super(new TensorMapLookup<>(op), op, Arrays.asList("key_dtype", "value_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + valueDtype = op.attributes().getAttrType("value_dtype"); + } + } } 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 index aac7031a7ec..5f32974f0e2 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * input_handle: the input map * size: the number of tensors in the map */ +@OpMetadata( + opType = TensorMapSize.OP_NAME, + inputsClass = TensorMapSize.Inputs.class +) @Operator public final class TensorMapSize extends RawOp implements Operand { /** @@ -42,8 +51,8 @@ public final class TensorMapSize extends RawOp implements Operand { private Output output; - private TensorMapSize(Operation operation) { - super(operation); + public TensorMapSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private TensorMapSize(Operation operation) { * Factory method to create a class wrapping a new TensorMapSize operation. * * @param scope current scope - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of TensorMapSize */ @Endpoint( @@ -77,4 +86,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TensorMapSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + public Inputs(GraphOperation op) { + super(new TensorMapSize(op), op, Arrays.asList()); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + } + } } 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 index 968e251c9ec..8942b2f9f8b 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 */ +@OpMetadata( + opType = TensorMapStackKeys.OP_NAME, + inputsClass = TensorMapStackKeys.Inputs.class +) @Operator public final class TensorMapStackKeys extends RawOp implements Operand { /** @@ -44,8 +52,8 @@ public final class TensorMapStackKeys extends RawOp implements private Output keys; - private TensorMapStackKeys(Operation operation) { - super(operation); + public TensorMapStackKeys(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; keys = operation.output(outputIdx++); } @@ -54,8 +62,8 @@ private TensorMapStackKeys(Operation operation) { * Factory method to create a class wrapping a new TensorMapStackKeys operation. * * @param scope current scope - * @param inputHandle the inputHandle value - * @param keyDtype the value of the keyDtype property + * @param inputHandle The inputHandle value + * @param keyDtype The value of the keyDtype attribute * @param data type for {@code TensorMapStackKeys} output and operands * @return a new instance of TensorMapStackKeys */ @@ -83,4 +91,26 @@ public Output keys() { public Output asOutput() { return keys; } + + @OpInputsMetadata( + outputsClass = TensorMapStackKeys.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + /** + * The keyDtype attribute + */ + public final DataType keyDtype; + + public Inputs(GraphOperation op) { + super(new TensorMapStackKeys<>(op), op, Arrays.asList("key_dtype")); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + keyDtype = op.attributes().getAttrType("key_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java index d3ab1b40ef3..77d1dd111d5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,9 +38,9 @@ * Adds sparse {@code updates} to an existing tensor according to {@code indices}. * This operation creates a new tensor by adding sparse {@code updates} to the passed * in {@code tensor}. - * This operation is very similar to {@code tf.compat.v1.scatter_nd_add}, except that the updates - * are added onto an existing tensor (as opposed to a variable). If the memory - * for the existing tensor cannot be re-used, a copy is made and updated. + * This operation is very similar to {@code tf.compat.v1.scatter_nd_add}, except that the + * updates are added onto an existing tensor (as opposed to a variable). If the + * memory for the existing tensor cannot be re-used, a copy is made and updated. *

    {@code indices} is an integer tensor containing indices into a new tensor of shape * {@code tensor.shape}. The last dimension of {@code indices} can be at most the rank of * {@code tensor.shape}: @@ -48,47 +54,61 @@ *

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

    The simplest form of tensor_scatter_add is to add individual elements to a + *

    The simplest form of {@code tensor_scatter_nd_add} is to add individual elements to a * tensor by index. For example, say we want to add 4 elements in a rank-1 * tensor with 8 elements. *

    In Python, this scatter add 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)
    - *     updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
    - *     print(updated)
    - * 
    - *

    The resulting tensor would look like this: - *

    - * [1, 12, 1, 11, 10, 1, 1, 13]
    - * 
    + *
    + *
    + *
    + *

    indices = tf.constant([[4], [3], [1], [7]]) + * updates = tf.constant([9, 10, 11, 12]) + * tensor = tf.ones([8], dtype=tf.int32) + * updated = tf.tensor_scatter_nd_add(tensor, indices, updates) + * updated + * <tf.Tensor: shape=(8,), dtype=int32, + * numpy=array([ 1, 12, 1, 11, 10, 1, 1, 13], 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 add 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)
    - *     updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
    - *     print(updated)
    - * 
    - *

    The resulting tensor would look like this: - *

    - * [[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
    - *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
    - *  [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
    - *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
    - * 
    - *

    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. - * - * @param data type for {@code output} output + *

    + *
    + *
    + *

    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) + * updated = tf.tensor_scatter_nd_add(tensor, indices, updates) + * updated + * <tf.Tensor: shape=(4, 4, 4), dtype=int32, + * numpy=array([[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], + * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], + * [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], + * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]], dtype=int32)> + *

    + *
    + *
    + *

    If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

      + *
    1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
    2. + *
    3. "ERROR": raises error; GPU does not support this value.
    4. + *
    5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
    6. + *
    */ +@OpMetadata( + opType = TensorScatterNdAdd.OP_NAME, + inputsClass = TensorScatterNdAdd.Inputs.class +) @Operator public final class TensorScatterNdAdd extends RawOp implements Operand { /** @@ -98,8 +118,8 @@ public final class TensorScatterNdAdd extends RawOp implements private Output output; - private TensorScatterNdAdd(Operation operation) { - super(operation); + public TensorScatterNdAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -111,6 +131,7 @@ private TensorScatterNdAdd(Operation operation) { * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterAdd} output and operands * @return a new instance of TensorScatterNdAdd */ @@ -118,14 +139,31 @@ private TensorScatterNdAdd(Operation operation) { describeByClass = true ) public static TensorScatterNdAdd create(Scope scope, Operand tensor, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorScatterNdAdd"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new TensorScatterNdAdd<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor copied from tensor and updates added according to the indices. @@ -139,4 +177,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorScatterNdAdd} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorScatterNdAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to copy/update. + */ + public final Operand tensor; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * Updates to scatter into output. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new TensorScatterNdAdd<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java index 19e3b4e8a53..cbf9b2dd471 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,44 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * The TensorScatterMax operation - * - * @param data type for {@code output} output + * Apply a sparse update to a tensor taking the element-wise maximum. + * Returns a new tensor copied from {@code tensor} whose values are element-wise maximum between + * tensor and updates according to the indices. + *
    + *
    + *
    + *

    tensor = [0, 0, 0, 0, 0, 0, 0, 0] + * indices = [[1], [4], [5]] + * updates = [1, -1, 1] + * tf.tensor_scatter_nd_max(tensor, indices, updates).numpy() + * array([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32) + *

    + *
    + *
    + *

    Refer to {@code tf.tensor_scatter_nd_update} for more details. */ +@OpMetadata( + opType = TensorScatterNdMax.OP_NAME, + inputsClass = TensorScatterNdMax.Inputs.class +) @Operator public final class TensorScatterNdMax extends RawOp implements Operand { /** @@ -42,8 +64,8 @@ public final class TensorScatterNdMax extends RawOp implements private Output output; - private TensorScatterNdMax(Operation operation) { - super(operation); + public TensorScatterNdMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,6 +77,7 @@ private TensorScatterNdMax(Operation operation) { * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterMax} output and operands * @return a new instance of TensorScatterNdMax */ @@ -62,14 +85,31 @@ private TensorScatterNdMax(Operation operation) { describeByClass = true ) public static TensorScatterNdMax create(Scope scope, Operand tensor, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorScatterNdMax"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new TensorScatterNdMax<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor copied from tensor whose values are element-wise maximum between tensor and updates according to the indices. @@ -83,4 +123,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorScatterNdMax} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorScatterNdMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to update. + */ + public final Operand tensor; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * Updates to scatter into output. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new TensorScatterNdMax<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java index d8c54e576d1..7db99c551d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * The TensorScatterMin operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TensorScatterNdMin.OP_NAME, + inputsClass = TensorScatterNdMin.Inputs.class +) @Operator public final class TensorScatterNdMin extends RawOp implements Operand { /** @@ -42,8 +50,8 @@ public final class TensorScatterNdMin extends RawOp implements private Output output; - private TensorScatterNdMin(Operation operation) { - super(operation); + public TensorScatterNdMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,6 +63,7 @@ private TensorScatterNdMin(Operation operation) { * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterMin} output and operands * @return a new instance of TensorScatterNdMin */ @@ -62,14 +71,31 @@ private TensorScatterNdMin(Operation operation) { describeByClass = true ) public static TensorScatterNdMin create(Scope scope, Operand tensor, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorScatterNdMin"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new TensorScatterNdMin<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor copied from tensor whose values are element-wise minimum between tensor and updates according to the indices. @@ -83,4 +109,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorScatterNdMin} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorScatterNdMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to update. + */ + public final Operand tensor; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * Updates to scatter into output. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new TensorScatterNdMin<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java index 0cf16e8e677..095e0428962 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -85,9 +91,11 @@ * *

    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. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TensorScatterNdSub.OP_NAME, + inputsClass = TensorScatterNdSub.Inputs.class +) @Operator public final class TensorScatterNdSub extends RawOp implements Operand { /** @@ -97,8 +105,8 @@ public final class TensorScatterNdSub extends RawOp implements private Output output; - private TensorScatterNdSub(Operation operation) { - super(operation); + public TensorScatterNdSub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -110,6 +118,7 @@ private TensorScatterNdSub(Operation operation) { * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterSub} output and operands * @return a new instance of TensorScatterNdSub */ @@ -117,14 +126,31 @@ private TensorScatterNdSub(Operation operation) { describeByClass = true ) public static TensorScatterNdSub create(Scope scope, Operand tensor, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorScatterNdSub"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new TensorScatterNdSub<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor copied from tensor and updates subtracted according to the indices. @@ -138,4 +164,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorScatterNdSub} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorScatterNdSub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to copy/update. + */ + public final Operand tensor; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * Updates to scatter into output. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new TensorScatterNdSub<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } 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 0ed584af1b8..96323c0db29 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -36,7 +42,6 @@ * 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 {@code indices} contains duplicates, then we pick the last update for the index. - *

    If an out of bound index is found on CPU, an error is returned. *

    WARNING: There are some GPU specific semantics for this operation. *

      *
    • If an out of bound index is found, the index is ignored.
    • @@ -58,10 +63,22 @@ *
        * indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
        * 
      + *

      If {@code indices} contains any out-of-bound indices, depending on + * {@code bad_indices_policy}, the op will either return an error or ignore the + * out-of-bound indices. {@code bad_indices_policy} can be one of the following values: + *

        + *
      1. "" or "DEFAULT": raises on CPU and ignore on GPU. This is because + * historically on CPU and GPU we handle errors in different ways, and for + * backward compatibility we keep the default behavior.
      2. + *
      3. "ERROR": raises error; GPU does not support this value.
      4. + *
      5. "IGNORE": ignore the bad indices; supported on both CPU and GPU.
      6. + *
      *

      For usage examples see the python tf.tensor_scatter_nd_update {@link org.tensorflow.op.Ops#tensorScatterNdUpdate} function - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TensorScatterNdUpdate.OP_NAME, + inputsClass = TensorScatterNdUpdate.Inputs.class +) @Operator public final class TensorScatterNdUpdate extends RawOp implements Operand { /** @@ -71,8 +88,8 @@ public final class TensorScatterNdUpdate extends RawOp implemen private Output output; - private TensorScatterNdUpdate(Operation operation) { - super(operation); + public TensorScatterNdUpdate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -84,6 +101,7 @@ private TensorScatterNdUpdate(Operation operation) { * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param options carries optional attribute values * @param data type for {@code TensorScatterUpdate} output and operands * @return a new instance of TensorScatterNdUpdate */ @@ -91,14 +109,31 @@ private TensorScatterNdUpdate(Operation operation) { describeByClass = true ) public static TensorScatterNdUpdate create(Scope scope, Operand tensor, - Operand indices, Operand updates) { + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorScatterNdUpdate"); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.badIndicesPolicy != null) { + opBuilder.setAttr("bad_indices_policy", opts.badIndicesPolicy); + } + } + } return new TensorScatterNdUpdate<>(opBuilder.build()); } + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public static Options badIndicesPolicy(String badIndicesPolicy) { + return new Options().badIndicesPolicy(badIndicesPolicy); + } + /** * Gets output. * A new tensor with the given shape and updates applied according @@ -113,4 +148,71 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorScatterNdUpdate} + */ + public static class Options { + private String badIndicesPolicy; + + private Options() { + } + + /** + * Sets the badIndicesPolicy option. + * + * @param badIndicesPolicy the badIndicesPolicy option + * @return this Options instance. + */ + public Options badIndicesPolicy(String badIndicesPolicy) { + this.badIndicesPolicy = badIndicesPolicy; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorScatterNdUpdate.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to copy/update. + */ + public final Operand tensor; + + /** + * Index tensor. + */ + public final Operand indices; + + /** + * Updates to scatter into output. + */ + public final Operand updates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The badIndicesPolicy attribute + */ + public final String badIndicesPolicy; + + public Inputs(GraphOperation op) { + super(new TensorScatterNdUpdate<>(op), op, Arrays.asList("T", "Tindices", "bad_indices_policy")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + badIndicesPolicy = op.attributes().getAttrString("bad_indices_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java index 58d071b28c9..de80c141d72 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * {@code strides} etc. work exactly as in {@code StridedSlice}. *

      NOTE this op currently does not support broadcasting and so {@code value}'s shape * must be exactly the shape produced by the slice of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TensorStridedSliceUpdate.OP_NAME, + inputsClass = TensorStridedSliceUpdate.Inputs.class +) @Operator public final class TensorStridedSliceUpdate extends RawOp implements Operand { /** @@ -47,8 +55,8 @@ public final class TensorStridedSliceUpdate extends RawOp imple private Output output; - private TensorStridedSliceUpdate(Operation operation) { - super(operation); + public TensorStridedSliceUpdate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -57,11 +65,11 @@ private TensorStridedSliceUpdate(Operation operation) { * Factory method to create a class wrapping a new TensorStridedSliceUpdate operation. * * @param scope current scope - * @param input the input value - * @param begin the begin value - * @param end the end value - * @param strides the strides value - * @param value the value value + * @param input The input value + * @param begin The begin value + * @param end The end value + * @param strides The strides value + * @param value The value value * @param options carries optional attribute values * @param data type for {@code TensorStridedSliceUpdate} output and operands * @param data type for {@code TensorStridedSliceUpdate} output and operands @@ -237,4 +245,86 @@ public Options shrinkAxisMask(Long shrinkAxisMask) { return this; } } + + @OpInputsMetadata( + outputsClass = TensorStridedSliceUpdate.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The begin input + */ + public final Operand begin; + + /** + * The end input + */ + public final Operand end; + + /** + * The strides input + */ + public final Operand strides; + + /** + * The value input + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Index attribute + */ + public final DataType Index; + + /** + * The beginMask attribute + */ + public final long beginMask; + + /** + * The endMask attribute + */ + public final long endMask; + + /** + * The ellipsisMask attribute + */ + public final long ellipsisMask; + + /** + * The newAxisMask attribute + */ + public final long newAxisMask; + + /** + * The shrinkAxisMask attribute + */ + public final long shrinkAxisMask; + + public Inputs(GraphOperation op) { + super(new TensorStridedSliceUpdate<>(op), op, Arrays.asList("T", "Index", "begin_mask", "end_mask", "ellipsis_mask", "new_axis_mask", "shrink_axis_mask")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + begin = (Operand) op.input(inputIndex++); + end = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Index = op.attributes().getAttrType("Index"); + beginMask = op.attributes().getAttrInt("begin_mask"); + endMask = op.attributes().getAttrInt("end_mask"); + ellipsisMask = op.attributes().getAttrInt("ellipsis_mask"); + newAxisMask = op.attributes().getAttrInt("new_axis_mask"); + shrinkAxisMask = op.attributes().getAttrInt("shrink_axis_mask"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java index a417dea0725..7339fdbb3de 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -61,9 +67,11 @@ * * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Tile.OP_NAME, + inputsClass = Tile.Inputs.class +) @Operator public final class Tile extends RawOp implements Operand { /** @@ -73,8 +81,8 @@ public final class Tile extends RawOp implements Operand { private Output output; - private Tile(Operation operation) { - super(operation); + public Tile(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,7 +91,7 @@ private Tile(Operation operation) { * Factory method to create a class wrapping a new Tile operation. * * @param scope current scope - * @param input 1-D or higher. + * @param input Can be of any rank. * @param multiples 1-D. Length must be the same as the number of dimensions in {@code input} * @param data type for {@code Tile} output and operands * @return a new instance of Tile @@ -112,4 +120,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Tile.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Can be of any rank. + */ + public final Operand input; + + /** + * 1-D. Length must be the same as the number of dimensions in {@code input} + */ + public final Operand multiples; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tmultiples attribute + */ + public final DataType Tmultiples; + + public Inputs(GraphOperation op) { + super(new Tile<>(op), op, Arrays.asList("T", "Tmultiples")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + multiples = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tmultiples = op.attributes().getAttrType("Tmultiples"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java index 2c017c1cd51..68f438fd195 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,39 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat64; /** * Provides the time since epoch in seconds. * Returns the timestamp as a {@code float64} for seconds since the Unix epoch. - *

      Note: the timestamp is computed when the op is executed, not when it is added - * to the graph. + *

      Common usages include: + *

        + *
      • Logging
      • + *
      • Providing a random number seed
      • + *
      • Debugging graph execution
      • + *
      • Generating timing information, mainly through comparison of timestamps
      • + *
      + *

      Note: In graph mode, the timestamp is computed when the op is executed, + * not when it is added to the graph. In eager mode, the timestamp is computed + * when the op is eagerly executed. */ +@OpMetadata( + opType = Timestamp.OP_NAME, + inputsClass = Timestamp.Inputs.class +) @Operator public final class Timestamp extends RawOp implements Operand { /** @@ -42,8 +59,8 @@ public final class Timestamp extends RawOp implements Operand { private Output ts; - private Timestamp(Operation operation) { - super(operation); + public Timestamp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; ts = operation.output(outputIdx++); } @@ -75,4 +92,14 @@ public Output ts() { public Output asOutput() { return ts; } + + @OpInputsMetadata( + outputsClass = Timestamp.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new Timestamp(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } 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 index 5d20c9f2160..56727a653fc 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -43,6 +48,10 @@ * padding value will be returned. The semantics are not the same as * kth_order_statistic. */ +@OpMetadata( + opType = TopKUnique.OP_NAME, + inputsClass = TopKUnique.Inputs.class +) @Operator public final class TopKUnique extends RawOp { /** @@ -54,8 +63,8 @@ public final class TopKUnique extends RawOp { private Output topkIndices; - private TopKUnique(Operation operation) { - super(operation); + public TopKUnique(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; topk = operation.output(outputIdx++); topkIndices = operation.output(outputIdx++); @@ -65,8 +74,8 @@ private TopKUnique(Operation operation) { * Factory method to create a class wrapping a new TopKUnique operation. * * @param scope current scope - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKUnique */ @Endpoint( @@ -96,4 +105,26 @@ public Output topk() { public Output topkIndices() { return topkIndices; } + + @OpInputsMetadata( + outputsClass = TopKUnique.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The k attribute + */ + public final long k; + + public Inputs(GraphOperation op) { + super(new TopKUnique(op), op, Arrays.asList("k")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = op.attributes().getAttrInt("k"); + } + } } 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 index e0e4d468a0f..15abf1fcd6b 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -36,6 +41,10 @@ * of K and the input size. NaNs are never returned. Subnormal numbers are flushed * to zero. */ +@OpMetadata( + opType = TopKWithUnique.OP_NAME, + inputsClass = TopKWithUnique.Inputs.class +) @Operator public final class TopKWithUnique extends RawOp { /** @@ -47,8 +56,8 @@ public final class TopKWithUnique extends RawOp { private Output topkIndices; - private TopKWithUnique(Operation operation) { - super(operation); + public TopKWithUnique(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; topk = operation.output(outputIdx++); topkIndices = operation.output(outputIdx++); @@ -58,8 +67,8 @@ private TopKWithUnique(Operation operation) { * Factory method to create a class wrapping a new TopKWithUnique operation. * * @param scope current scope - * @param input the input value - * @param k the value of the k property + * @param input The input value + * @param k The value of the k attribute * @return a new instance of TopKWithUnique */ @Endpoint( @@ -89,4 +98,26 @@ public Output topk() { public Output topkIndices() { return topkIndices; } + + @OpInputsMetadata( + outputsClass = TopKWithUnique.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The k attribute + */ + public final long k; + + public Inputs(GraphOperation op) { + super(new TopKWithUnique(op), op, Arrays.asList("k")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = op.attributes().getAttrInt("k"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java index 00c93f97129..fa4c04f3c27 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -47,9 +53,11 @@ * shared_name: Instances of Unbatch with the same container and shared_name are * assumed to possibly belong to the same batch. If left empty, the op name will * be used as the shared name. - * - * @param data type for {@code unbatched_tensor} output */ +@OpMetadata( + opType = Unbatch.OP_NAME, + inputsClass = Unbatch.Inputs.class +) @Operator public final class Unbatch extends RawOp implements Operand { /** @@ -59,8 +67,8 @@ public final class Unbatch extends RawOp implements Operand private Output unbatchedTensor; - private Unbatch(Operation operation) { - super(operation); + public Unbatch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; unbatchedTensor = operation.output(outputIdx++); } @@ -69,10 +77,10 @@ private Unbatch(Operation operation) { * Factory method to create a class wrapping a new Unbatch operation. * * @param scope current scope - * @param batchedTensor the batchedTensor value - * @param batchIndex the batchIndex value - * @param id the id value - * @param timeoutMicros the value of the timeoutMicros property + * @param batchedTensor The batchedTensor value + * @param batchIndex The batchIndex value + * @param id The id value + * @param timeoutMicros The value of the timeoutMicros attribute * @param options carries optional attribute values * @param data type for {@code Unbatch} output and operands * @return a new instance of Unbatch @@ -167,4 +175,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Unbatch.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The batchedTensor input + */ + public final Operand batchedTensor; + + /** + * The batchIndex input + */ + public final Operand batchIndex; + + /** + * The id input + */ + public final Operand id; + + /** + * The timeoutMicros attribute + */ + public final long timeoutMicros; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Unbatch<>(op), op, Arrays.asList("timeout_micros", "container", "shared_name", "T")); + int inputIndex = 0; + batchedTensor = (Operand) op.input(inputIndex++); + batchIndex = (Operand) op.input(inputIndex++); + id = (Operand) op.input(inputIndex++); + timeoutMicros = op.attributes().getAttrInt("timeout_micros"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java index 877fda71471..25418f3986f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -43,9 +49,11 @@ * shared_name: Instances of UnbatchGrad with the same container and shared_name * are assumed to possibly belong to the same batch. If left empty, the op name * will be used as the shared name. - * - * @param data type for {@code batched_grad} output */ +@OpMetadata( + opType = UnbatchGrad.OP_NAME, + inputsClass = UnbatchGrad.Inputs.class +) @Operator public final class UnbatchGrad extends RawOp implements Operand { /** @@ -55,8 +63,8 @@ public final class UnbatchGrad extends RawOp implements Operand private Output batchedGrad; - private UnbatchGrad(Operation operation) { - super(operation); + public UnbatchGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; batchedGrad = operation.output(outputIdx++); } @@ -65,10 +73,10 @@ private UnbatchGrad(Operation operation) { * Factory method to create a class wrapping a new UnbatchGrad operation. * * @param scope current scope - * @param originalInput the originalInput value - * @param batchIndex the batchIndex value - * @param grad the grad value - * @param id the id value + * @param originalInput The originalInput value + * @param batchIndex The batchIndex value + * @param grad The grad value + * @param id The id value * @param options carries optional attribute values * @param data type for {@code UnbatchGrad} output and operands * @return a new instance of UnbatchGrad @@ -163,4 +171,56 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = UnbatchGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The originalInput input + */ + public final Operand originalInput; + + /** + * The batchIndex input + */ + public final Operand batchIndex; + + /** + * The grad input + */ + public final Operand grad; + + /** + * The id input + */ + public final Operand id; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new UnbatchGrad<>(op), op, Arrays.asList("container", "shared_name", "T")); + int inputIndex = 0; + originalInput = (Operand) op.input(inputIndex++); + batchIndex = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + id = (Operand) op.input(inputIndex++); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniformQuantizedClipByValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniformQuantizedClipByValue.java new file mode 100644 index 00000000000..f1a4eb739d1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniformQuantizedClipByValue.java @@ -0,0 +1,222 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform clip by value on the quantized Tensor {@code operand}. + * Given quantized {@code operand} which was quantized using {@code scales} and {@code zero_points}, performs clip by value using {@code min} and {@code max} values. + * If quantization_axis is -1 (per-tensor quantized), the entire operand is clipped using scalar min, max. + * Otherwise (per-channel quantized), the clipping is also done per-channel. + */ +@OpMetadata( + opType = UniformQuantizedClipByValue.OP_NAME, + inputsClass = UniformQuantizedClipByValue.Inputs.class +) +@Operator +public final class UniformQuantizedClipByValue extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedClipByValue"; + + private Output output; + + public UniformQuantizedClipByValue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedClipByValue operation. + * + * @param scope current scope + * @param operand Must be a Tensor of T. + * @param min The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param max The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param scales The float value(s) used as scale(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) used as zero_point(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Same shape condition as scales. + * @param quantizationMinVal The quantization min value that was used when operand was quantized. + * @param quantizationMaxVal The quantization max value that was used when operand was quantized. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedClipByValue} output and operands + * @return a new instance of UniformQuantizedClipByValue + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedClipByValue create(Scope scope, + Operand operand, Operand min, Operand max, Operand scales, + Operand zeroPoints, Long quantizationMinVal, Long quantizationMaxVal, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedClipByValue"); + opBuilder.addInput(operand.asOutput()); + opBuilder.addInput(min.asOutput()); + opBuilder.addInput(max.asOutput()); + opBuilder.addInput(scales.asOutput()); + opBuilder.addInput(zeroPoints.asOutput()); + opBuilder.setAttr("quantization_min_val", quantizationMinVal); + opBuilder.setAttr("quantization_max_val", quantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.quantizationAxis != null) { + opBuilder.setAttr("quantization_axis", opts.quantizationAxis); + } + } + } + return new UniformQuantizedClipByValue<>(opBuilder.build()); + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, operand.dims()). + * @return this Options instance. + */ + public static Options quantizationAxis(Long quantizationAxis) { + return new Options().quantizationAxis(quantizationAxis); + } + + /** + * Gets output. + * The output clipped Tensor of T, whose shape is same as operand. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.core.UniformQuantizedClipByValue} + */ + public static class Options { + private Long quantizationAxis; + + private Options() { + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, operand.dims()). + * @return this Options instance. + */ + public Options quantizationAxis(Long quantizationAxis) { + this.quantizationAxis = quantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedClipByValue.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a Tensor of T. + */ + public final Operand operand; + + /** + * The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand min; + + /** + * The min value(s) to clip operand. Must be a Tensor of T. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand max; + + /** + * The float value(s) used as scale(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (operand.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand scales; + + /** + * The int32 value(s) used as zero_point(s) when quantizing {@code operand}, {@code min} and {@code max}. + * Same shape condition as scales. + */ + public final Operand zeroPoints; + + /** + * The type of operand, min, max, and output. A tf.DType from: tf.qint32 + */ + public final DataType T; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, operand.dims()). + */ + public final long quantizationAxis; + + /** + * The quantization min value that was used when operand was quantized. + */ + public final long quantizationMinVal; + + /** + * The quantization max value that was used when operand was quantized. + */ + public final long quantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedClipByValue<>(op), op, Arrays.asList("T", "quantization_axis", "quantization_min_val", "quantization_max_val")); + int inputIndex = 0; + operand = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + scales = (Operand) op.input(inputIndex++); + zeroPoints = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + quantizationAxis = op.attributes().getAttrInt("quantization_axis"); + quantizationMinVal = op.attributes().getAttrInt("quantization_min_val"); + quantizationMaxVal = op.attributes().getAttrInt("quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java index 7fec4d36cce..4d17cf9f141 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -68,11 +74,11 @@ * [2, 0]] * idx ==> [0, 1, 1] * - * - * @param data type for {@code y} output - * - * @param data type for {@code idx} output */ +@OpMetadata( + opType = Unique.OP_NAME, + inputsClass = Unique.Inputs.class +) @Operator public final class Unique extends RawOp { /** @@ -84,8 +90,8 @@ public final class Unique extends RawOp { private Output idx; - private Unique(Operation operation) { - super(operation); + public Unique(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); idx = operation.output(outputIdx++); @@ -98,7 +104,7 @@ private Unique(Operation operation) { * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code UniqueV2} output and operands * @param data type for {@code UniqueV2} output and operands * @return a new instance of Unique @@ -151,4 +157,45 @@ public Output y() { public Output idx() { return idx; } + + @OpInputsMetadata( + outputsClass = Unique.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. + */ + public final Operand x; + + /** + * A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to + * find the unique elements. + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Taxis attribute + */ + public final DataType Taxis; + + /** + * The outIdx attribute + */ + public final DataType outIdx; + + public Inputs(GraphOperation op) { + super(new Unique<>(op), op, Arrays.asList("T", "Taxis", "out_idx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Taxis = op.attributes().getAttrType("Taxis"); + outIdx = op.attributes().getAttrType("out_idx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java index 9ccfcc22319..8046082f95b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -44,7 +50,7 @@ *

      For example: *

        * x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
      - * y, idx, count = UniqueWithCountsV2(x, axis = [0])
      + * y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis = [0])
        * y ==> [1, 2, 4, 7, 8]
        * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
        * count ==> [2, 1, 3, 1, 2]
      @@ -54,7 +60,7 @@
        * x = tf.constant([[1, 0, 0],
        *                 [1, 0, 0],
        *                 [2, 0, 0]])
      - * y, idx, count = UniqueWithCountsV2(x, axis=[0])
      + * y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[0])
        * y ==> [[1, 0, 0],
        *        [2, 0, 0]]
        * idx ==> [0, 0, 1]
      @@ -65,18 +71,18 @@
        * x = tf.constant([[1, 0, 0],
        *                 [1, 0, 0],
        *                 [2, 0, 0]])
      - * y, idx, count = UniqueWithCountsV2(x, axis=[1])
      + * y, idx, count = tf.raw_ops.UniqueWithCountsV2(x=x, axis=[1])
        * y ==> [[1, 0],
        *        [1, 0],
        *        [2, 0]]
        * idx ==> [0, 1, 1]
        * count ==> [1, 2]
        * 
      - * - * @param data type for {@code y} output - * - * @param data type for {@code idx} output */ +@OpMetadata( + opType = UniqueWithCounts.OP_NAME, + inputsClass = UniqueWithCounts.Inputs.class +) @Operator public final class UniqueWithCounts extends RawOp { /** @@ -90,8 +96,8 @@ public final class UniqueWithCounts extends private Output count; - private UniqueWithCounts(Operation operation) { - super(operation); + public UniqueWithCounts(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); idx = operation.output(outputIdx++); @@ -105,7 +111,7 @@ private UniqueWithCounts(Operation operation) { * @param x A {@code Tensor}. * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx the value of the outIdx property + * @param outIdx The value of the outIdx attribute * @param data type for {@code UniqueWithCountsV2} output and operands * @param data type for {@code UniqueWithCountsV2} output and operands * @return a new instance of UniqueWithCounts @@ -167,4 +173,45 @@ public Output idx() { public Output count() { return count; } + + @OpInputsMetadata( + outputsClass = UniqueWithCounts.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. + */ + public final Operand x; + + /** + * A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to + * find the unique elements. + */ + public final Operand axis; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Taxis attribute + */ + public final DataType Taxis; + + /** + * The outIdx attribute + */ + public final DataType outIdx; + + public Inputs(GraphOperation op) { + super(new UniqueWithCounts<>(op), op, Arrays.asList("T", "Taxis", "out_idx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Taxis = op.attributes().getAttrType("Taxis"); + outIdx = op.attributes().getAttrType("out_idx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java index 4a603b49357..ec7c8f8c6e9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -46,9 +52,11 @@ *

      {@literal @}compatibility(numpy)
      * Equivalent to np.unravel_index *
      {@literal @}end_compatibility - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = UnravelIndex.OP_NAME, + inputsClass = UnravelIndex.Inputs.class +) @Operator public final class UnravelIndex extends RawOp implements Operand { /** @@ -58,8 +66,8 @@ public final class UnravelIndex extends RawOp implements Oper private Output output; - private UnravelIndex(Operation operation) { - super(operation); + public UnravelIndex(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -100,4 +108,34 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnravelIndex.class + ) + public static class Inputs extends RawOpInputs> { + /** + * An 0-D or 1-D {@code int} Tensor whose elements are indices into the + * flattened version of an array of dimensions dims. + */ + public final Operand indices; + + /** + * An 1-D {@code int} Tensor. The shape of the array to use for unraveling + * indices. + */ + public final Operand dims; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new UnravelIndex<>(op), op, Arrays.asList("Tidx")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + dims = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java index 19d4e08c44e..64c8de23911 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,14 +20,19 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +46,11 @@ * and each tensor in {@code output} will have shape {@code (A, C, D)}. * Etc. *

      This is the opposite of {@code pack}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Unstack.OP_NAME, + inputsClass = Unstack.Inputs.class +) @Operator public final class Unstack extends RawOp implements Iterable> { /** @@ -54,8 +61,8 @@ public final class Unstack extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private Unstack(Operation operation) { - super(operation); + public Unstack(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); @@ -67,7 +74,7 @@ private Unstack(Operation operation) { * * @param scope current scope * @param value 1-D or higher, with {@code axis} dimension size equal to {@code num}. - * @param num the value of the num property + * @param num The value of the num attribute * @param options carries optional attribute values * @param data type for {@code Unpack} output and operands * @return a new instance of Unstack @@ -137,4 +144,33 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = Unstack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D or higher, with {@code axis} dimension size equal to {@code num}. + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Dimension along which to unpack. Negative values wrap around, so the + * valid range is {@code [-R, R)}. + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new Unstack<>(op), op, Arrays.asList("T", "axis")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + axis = op.attributes().getAttrInt("axis"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java index a0cd29d2014..908730c653a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,6 +41,10 @@ * The basic functionality is similar to dequeue with many fewer * capabilities and options. This Op is optimized for performance. */ +@OpMetadata( + opType = Unstage.OP_NAME, + inputsClass = Unstage.Inputs.class +) @Operator public final class Unstage extends RawOp implements Iterable> { /** @@ -46,8 +55,8 @@ public final class Unstage extends RawOp implements Iterable> { private List> values; @SuppressWarnings("unchecked") - private Unstage(Operation operation) { - super(operation); + public Unstage(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int valuesLength = operation.outputListLength("values"); values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); @@ -58,7 +67,7 @@ private Unstage(Operation operation) { * Factory method to create a class wrapping a new Unstage operation. * * @param scope current scope - * @param dtypes the value of the dtypes property + * @param dtypes The value of the dtypes attribute * @param options carries optional attribute values * @return a new instance of Unstage */ @@ -202,4 +211,44 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Unstage.class + ) + public static class Inputs extends RawOpInputs { + /** + * The capacity attribute + */ + public final long capacity; + + /** + * The memoryLimit attribute + */ + public final long memoryLimit; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new Unstage(op), op, Arrays.asList("capacity", "memory_limit", "dtypes", "container", "shared_name")); + int inputIndex = 0; + capacity = op.attributes().getAttrInt("capacity"); + memoryLimit = op.attributes().getAttrInt("memory_limit"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java index 23a292eeaf7..78e45391c8a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -44,9 +51,12 @@ *

      result = UpperBound(sorted_sequence, values) *

      result == [[1, 2, 4], * [0, 2, 5]] - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = UpperBound.OP_NAME, + inputsClass = UpperBound.Inputs.class +) +@Operator public final class UpperBound extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -55,8 +65,8 @@ public final class UpperBound extends RawOp implements Operan private Output output; - private UpperBound(Operation operation) { - super(operation); + public UpperBound(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -68,7 +78,7 @@ private UpperBound(Operation operation) { * @param sortedInputs 2-D Tensor where each row is ordered. * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains * the values that will be searched for in {@code sorted_search_values}. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code UpperBound} output and operands * @param data type for {@code UpperBound} output and operands * @return a new instance of UpperBound @@ -118,4 +128,39 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UpperBound.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D Tensor where each row is ordered. + */ + public final Operand sortedInputs; + + /** + * 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new UpperBound<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + sortedInputs = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java index 465941df1ab..6f3e7e55c9d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a handle to a Variable resource. */ +@OpMetadata( + opType = VarHandleOp.OP_NAME, + inputsClass = VarHandleOp.Inputs.class +) @Operator public final class VarHandleOp extends RawOp implements Operand { /** @@ -44,8 +53,8 @@ public final class VarHandleOp extends RawOp implements Operand { private Output resource; @SuppressWarnings("unchecked") - private VarHandleOp(Operation operation) { - super(operation); + public VarHandleOp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resource = operation.output(outputIdx++); } @@ -77,6 +86,9 @@ public static VarHandleOp create(Scope scope, Class dtype, if (opts.sharedName != null) { opBuilder.setAttr("shared_name", opts.sharedName); } + if (opts.debugName != null) { + opBuilder.setAttr("debug_name", opts.debugName); + } if (opts.allowedDevices != null) { String[] allowedDevicesArray = new String[opts.allowedDevices.size()]; for (int i = 0 ; i < allowedDevicesArray.length ; i++) { @@ -109,6 +121,16 @@ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } + /** + * Sets the debugName option. + * + * @param debugName the user-given name, which still applies in anonymous mode. + * @return this Options instance. + */ + public static Options debugName(String debugName) { + return new Options().debugName(debugName); + } + /** * Sets the allowedDevices option. * @@ -127,7 +149,7 @@ public static Options allowedDevices(List allowedDevices) { * output ResourceHandle represents a per-replica/partitioned resource variable. * @return this Options instance. */ - public static Options allowedDevices(String[] allowedDevices) { + public static Options allowedDevices(String... allowedDevices) { return new Options().allowedDevices(allowedDevices); } @@ -154,6 +176,8 @@ public static class Options { private String sharedName; + private String debugName; + private List allowedDevices; private Options() { @@ -181,6 +205,17 @@ public Options sharedName(String sharedName) { return this; } + /** + * Sets the debugName option. + * + * @param debugName the user-given name, which still applies in anonymous mode. + * @return this Options instance. + */ + public Options debugName(String debugName) { + this.debugName = debugName; + return this; + } + /** * Sets the allowedDevices option. * @@ -205,4 +240,52 @@ public Options allowedDevices(String... allowedDevices) { return this; } } + + @OpInputsMetadata( + outputsClass = VarHandleOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * the container this variable is placed in. + */ + public final String container; + + /** + * the name by which this variable is referred to. + */ + public final String sharedName; + + /** + * the user-given name, which still applies in anonymous mode. + */ + public final String debugName; + + /** + * the type of this variable. Must agree with the dtypes + * of all ops using this variable. + */ + public final DataType dtype; + + /** + * The (possibly partially specified) shape of this variable. + */ + public final Shape shape; + + /** + * DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + */ + public final String[] allowedDevices; + + public Inputs(GraphOperation op) { + super(new VarHandleOp(op), op, Arrays.asList("container", "shared_name", "debug_name", "dtype", "shape", "allowed_devices")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + debugName = op.attributes().getAttrString("debug_name"); + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + allowedDevices = op.attributes().getAttrStringList("allowed_devices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java index 93e9feb7f44..8e4abf0b74a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Checks whether a resource handle-based variable has been initialized. */ +@OpMetadata( + opType = VarIsInitializedOp.OP_NAME, + inputsClass = VarIsInitializedOp.Inputs.class +) @Operator public final class VarIsInitializedOp extends RawOp implements Operand { /** @@ -40,8 +49,8 @@ public final class VarIsInitializedOp extends RawOp implements Operand { private Output isInitialized; - private VarIsInitializedOp(Operation operation) { - super(operation); + public VarIsInitializedOp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; isInitialized = operation.output(outputIdx++); } @@ -76,4 +85,20 @@ public Output isInitialized() { public Output asOutput() { return isInitialized; } + + @OpInputsMetadata( + outputsClass = VarIsInitializedOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * the input resource handle. + */ + public final Operand resource; + + public Inputs(GraphOperation op) { + super(new VarIsInitializedOp(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java index 04b8a8df6f1..d8b09bfddde 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,9 +40,11 @@ * Outputs a ref to the tensor state so it may be read or modified. * TODO(zhifengc/mrry): Adds a pointer to a more detail document * about sharing states in tensorflow. - * - * @param data type for {@code ref} output */ +@OpMetadata( + opType = Variable.OP_NAME, + inputsClass = Variable.Inputs.class +) @Operator public final class Variable extends RawOp implements Operand { /** @@ -46,8 +54,8 @@ public final class Variable extends RawOp implements Operand private Output ref; - private Variable(Operation operation) { - super(operation); + public Variable(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; ref = operation.output(outputIdx++); } @@ -154,4 +162,40 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = Variable.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the variable tensor. + */ + public final Shape shape; + + /** + * The type of elements in the variable tensor. + */ + public final DataType dtype; + + /** + * If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new Variable<>(op), op, Arrays.asList("shape", "dtype", "container", "shared_name")); + int inputIndex = 0; + shape = op.attributes().getAttrShape("shape"); + dtype = op.attributes().getAttrType("dtype"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java index a026bd66862..abfd8d7c504 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,9 +44,11 @@ * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]] * shape(t) ==> [2, 2, 3] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = VariableShape.OP_NAME, + inputsClass = VariableShape.Inputs.class +) @Operator public final class VariableShape extends RawOp implements Operand { /** @@ -50,8 +58,8 @@ public final class VariableShape extends RawOp implements Ope private Output output; - private VariableShape(Operation operation) { - super(operation); + public VariableShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -60,8 +68,8 @@ private VariableShape(Operation operation) { * Factory method to create a class wrapping a new VariableShape operation. * * @param scope current scope - * @param input the input value - * @param outType the value of the outType property + * @param input The input value + * @param outType The value of the outType attribute * @param data type for {@code VariableShape} output and operands * @return a new instance of VariableShape */ @@ -80,7 +88,7 @@ public static VariableShape create(Scope scope, * Factory method to create a class wrapping a new VariableShape operation, with the default output types. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of VariableShape, with default output types */ @Endpoint( @@ -103,4 +111,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = VariableShape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new VariableShape<>(op), op, Arrays.asList("out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java index fefc32b1675..4a07d98f01a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -88,6 +94,10 @@ * [2, 1, 1]] * */ +@OpMetadata( + opType = Where.OP_NAME, + inputsClass = Where.Inputs.class +) @Operator public final class Where extends RawOp implements Operand { /** @@ -97,8 +107,8 @@ public final class Where extends RawOp implements Operand { private Output index; - private Where(Operation operation) { - super(operation); + public Where(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; index = operation.output(outputIdx++); } @@ -107,7 +117,7 @@ private Where(Operation operation) { * Factory method to create a class wrapping a new Where operation. * * @param scope current scope - * @param condition the condition value + * @param condition The condition value * @return a new instance of Where */ @Endpoint( @@ -132,4 +142,26 @@ public Output index() { public Output asOutput() { return index; } + + @OpInputsMetadata( + outputsClass = Where.class + ) + public static class Inputs extends RawOpInputs { + /** + * The condition input + */ + public final Operand condition; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Where(op), op, Arrays.asList("T")); + int inputIndex = 0; + condition = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/While.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/While.java index 714929f426c..d7c1b564a44 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/While.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/While.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -94,7 +94,7 @@ static Options outputShapes(List outputShapes) { * @param outputShapes the outputShapes option * @return this Options instance. */ - static Options outputShapes(Shape[] outputShapes) { + static Options outputShapes(Shape... outputShapes) { return new Options().outputShapes(outputShapes); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Window.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Window.java deleted file mode 100644 index e10608a3782..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Window.java +++ /dev/null @@ -1,89 +0,0 @@ -/* 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 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.types.family.TType; - -/** - * The Window operation - */ -public final class Window extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "Window"; - - private Output handle; - - @SuppressWarnings("unchecked") - private Window(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new Window operation. - * - * @param scope current scope - * @param inputs the inputs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @return a new instance of Window - */ - @Endpoint( - describeByClass = true - ) - public static Window create(Scope scope, Iterable> inputs, - List> outputTypes, List outputShapes) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Window"); - opBuilder.addInputList(Operands.asOutputs(inputs)); - 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 Window(opBuilder.build()); - } - - /** - * Gets handle. - * - * @return handle. - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java index 815c4adcc41..497cf5128b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.core; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns a tensor of zeros with the same shape and type as x. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = ZerosLike.OP_NAME, + inputsClass = ZerosLike.Inputs.class +) @Operator public final class ZerosLike extends RawOp implements Operand { /** @@ -41,8 +49,8 @@ public final class ZerosLike extends RawOp implements Operand y; - private ZerosLike(Operation operation) { - super(operation); + public ZerosLike(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -77,4 +85,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = ZerosLike.class + ) + public static class Inputs extends RawOpInputs> { + /** + * a tensor of type T. + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ZerosLike<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java index b6d11b4598b..deaff90fa25 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,48 +17,56 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ +@OpMetadata( + opType = AnonymousIterator.OP_NAME, + inputsClass = AnonymousIterator.Inputs.class +) @Operator( group = "data" ) -public final class AnonymousIterator extends RawOp { +public final class AnonymousIterator extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousIteratorV2"; + public static final String OP_NAME = "AnonymousIteratorV3"; private Output handle; - private Output deleter; - @SuppressWarnings("unchecked") - private AnonymousIterator(Operation operation) { - super(operation); + public AnonymousIterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new AnonymousIteratorV2 operation. + * Factory method to create a class wrapping a new AnonymousIteratorV3 operation. * * @param scope current scope - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AnonymousIterator */ @Endpoint( @@ -88,12 +96,31 @@ public Output handle() { return handle; } - /** - * Gets deleter. - * A variant deleter that should be passed into the op that deletes the iterator. - * @return deleter. - */ - public Output deleter() { - return deleter; + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = AnonymousIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AnonymousIterator(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java index 4a24a88e1ca..7554d2de110 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,17 +17,30 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The AnonymousMemoryCache operation */ +@OpMetadata( + opType = AnonymousMemoryCache.OP_NAME, + inputsClass = AnonymousMemoryCache.Inputs.class +) +@Operator( + group = "data" +) public final class AnonymousMemoryCache extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +52,8 @@ public final class AnonymousMemoryCache extends RawOp { private Output deleter; @SuppressWarnings("unchecked") - private AnonymousMemoryCache(Operation operation) { - super(operation); + public AnonymousMemoryCache(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); deleter = operation.output(outputIdx++); @@ -77,4 +90,14 @@ public Output handle() { public Output deleter() { return deleter; } + + @OpInputsMetadata( + outputsClass = AnonymousMemoryCache.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new AnonymousMemoryCache(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java index 362ff05583e..90c390e7b4f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,45 +17,57 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A container for a multi device iterator resource. */ -public final class AnonymousMultiDeviceIterator extends RawOp { +@OpMetadata( + opType = AnonymousMultiDeviceIterator.OP_NAME, + inputsClass = AnonymousMultiDeviceIterator.Inputs.class +) +@Operator( + group = "data" +) +public final class AnonymousMultiDeviceIterator extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousMultiDeviceIterator"; + public static final String OP_NAME = "AnonymousMultiDeviceIteratorV3"; private Output handle; - private Output deleter; - @SuppressWarnings("unchecked") - private AnonymousMultiDeviceIterator(Operation operation) { - super(operation); + public AnonymousMultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new AnonymousMultiDeviceIterator operation. + * Factory method to create a class wrapping a new AnonymousMultiDeviceIteratorV3 operation. * * @param scope current scope - * @param devices the value of the devices property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param devices The value of the devices attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AnonymousMultiDeviceIterator */ @Endpoint( @@ -90,12 +102,37 @@ public Output handle() { return handle; } - /** - * Gets deleter. - * A variant deleter that should be passed into the op that deletes the iterator. - * @return deleter. - */ - public Output deleter() { - return deleter; + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = AnonymousMultiDeviceIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The devices attribute + */ + public final String[] devices; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AnonymousMultiDeviceIterator(op), op, Arrays.asList("devices", "output_types", "output_shapes")); + int inputIndex = 0; + devices = op.attributes().getAttrStringList("devices"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertCardinalityDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertCardinalityDataset.java index 766e8632d32..f81fd1f4a62 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertCardinalityDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertCardinalityDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The AssertCardinalityDataset operation */ +@OpMetadata( + opType = AssertCardinalityDataset.OP_NAME, + inputsClass = AssertCardinalityDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class AssertCardinalityDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private AssertCardinalityDataset(Operation operation) { - super(operation); + public AssertCardinalityDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private AssertCardinalityDataset(Operation operation) { * Factory method to create a class wrapping a new AssertCardinalityDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param cardinality the cardinality value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param cardinality The cardinality value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AssertCardinalityDataset */ @Endpoint( @@ -94,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = AssertCardinalityDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The cardinality input + */ + public final Operand cardinality; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AssertCardinalityDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + cardinality = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java index d6598f345a2..efbdce50a60 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -41,6 +47,10 @@ * means that the check happens after any static optimizations are applied * to the dataset graph. */ +@OpMetadata( + opType = AssertNextDataset.OP_NAME, + inputsClass = AssertNextDataset.Inputs.class +) @Operator( group = "data" ) @@ -53,8 +63,8 @@ public final class AssertNextDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private AssertNextDataset(Operation operation) { - super(operation); + public AssertNextDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -67,8 +77,8 @@ private AssertNextDataset(Operation operation) { * {@code data.AssertNextDataset} passes through the outputs of its input dataset. * @param transformations A {@code tf.string} vector {@code tf.Tensor} identifying the transformations that are * expected to happen next. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AssertNextDataset */ @Endpoint( @@ -103,4 +113,40 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = AssertNextDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + * {@code data.AssertNextDataset} passes through the outputs of its input dataset. + */ + public final Operand inputDataset; + + /** + * A {@code tf.string} vector {@code tf.Tensor} identifying the transformations that are + * expected to happen next. + */ + public final Operand transformations; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AssertNextDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + transformations = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertPrevDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertPrevDataset.java new file mode 100644 index 00000000000..bab20bf1f31 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertPrevDataset.java @@ -0,0 +1,152 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * A transformation that asserts which transformations happened previously. + * This transformation checks the names and, optionally, the attribute name-value + * pairs in the {@code transformations} argument against those of the transformations + * that preceded this transformation. If there is a mismatch, the transformation + * raises an exception. + *

      The check occurs when iterating over the contents of the dataset, which + * means that the check happens after any static optimizations are applied + * to the dataset graph. + */ +@OpMetadata( + opType = AssertPrevDataset.OP_NAME, + inputsClass = AssertPrevDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class AssertPrevDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssertPrevDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public AssertPrevDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AssertPrevDataset operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the input dataset. + * {@code data.AssertPrevDataset} passes through the outputs of its input dataset. + * @param transformations A {@code tf.string} vector {@code tf.Tensor} identifying the transformations, with optional + * attribute name-value pairs, that are expected to have happened previously. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertPrevDataset + */ + @Endpoint( + describeByClass = true + ) + public static AssertPrevDataset create(Scope scope, Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssertPrevDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(transformations.asOutput()); + 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 AssertPrevDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = AssertPrevDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + * {@code data.AssertPrevDataset} passes through the outputs of its input dataset. + */ + public final Operand inputDataset; + + /** + * A {@code tf.string} vector {@code tf.Tensor} identifying the transformations, with optional + * attribute name-value pairs, that are expected to have happened previously. + */ + public final Operand transformations; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AssertPrevDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + transformations = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } +} 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 616e51b9948..de75538af09 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -40,6 +46,10 @@ *

      This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ +@OpMetadata( + opType = AutoShardDataset.OP_NAME, + inputsClass = AutoShardDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class AutoShardDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private AutoShardDataset(Operation operation) { - super(operation); + public AutoShardDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -65,8 +75,8 @@ private AutoShardDataset(Operation operation) { * @param inputDataset A variant tensor representing the input dataset. * @param numWorkers A scalar representing the number of workers to distribute this dataset across. * @param index A scalar representing the index of the current worker out of num_workers. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of AutoShardDataset */ @@ -167,4 +177,56 @@ public Options numReplicas(Long numReplicas) { return this; } } + + @OpInputsMetadata( + outputsClass = AutoShardDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of workers to distribute this dataset across. + */ + public final Operand numWorkers; + + /** + * A scalar representing the index of the current worker out of num_workers. + */ + public final Operand index; + + /** + * The autoShardPolicy attribute + */ + public final long autoShardPolicy; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The numReplicas attribute + */ + public final long numReplicas; + + public Inputs(GraphOperation op) { + super(new AutoShardDataset(op), op, Arrays.asList("auto_shard_policy", "output_types", "output_shapes", "num_replicas")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numWorkers = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + autoShardPolicy = op.attributes().getAttrInt("auto_shard_policy"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + numReplicas = op.attributes().getAttrInt("num_replicas"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java index 9443135081b..f0d6b9ae1a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ /** * Creates a dataset that batches {@code batch_size} elements from {@code input_dataset}. */ +@OpMetadata( + opType = BatchDataset.OP_NAME, + inputsClass = BatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class BatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private BatchDataset(Operation operation) { - super(operation); + public BatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,12 +67,12 @@ private BatchDataset(Operation operation) { * Factory method to create a class wrapping a new BatchDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param batchSize A scalar representing the number of elements to accumulate in a batch. * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of BatchDataset */ @@ -87,6 +97,9 @@ public static BatchDataset create(Scope scope, Operand inputDat if (opts.parallelCopy != null) { opBuilder.setAttr("parallel_copy", opts.parallelCopy); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new BatchDataset(opBuilder.build()); @@ -102,6 +115,16 @@ public static Options parallelCopy(Boolean parallelCopy) { return new Options().parallelCopy(parallelCopy); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -123,6 +146,8 @@ public Output asOutput() { public static class Options { private Boolean parallelCopy; + private String metadata; + private Options() { } @@ -136,5 +161,69 @@ public Options parallelCopy(Boolean parallelCopy) { this.parallelCopy = parallelCopy; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = BatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements to accumulate in a batch. + */ + public final Operand batchSize; + + /** + * A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + */ + public final Operand dropRemainder; + + /** + * The parallelCopy attribute + */ + public final boolean parallelCopy; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new BatchDataset(op), op, Arrays.asList("parallel_copy", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSize = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + parallelCopy = op.attributes().getAttrBool("parallel_copy"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java index 3eb3923a58c..854ad886a6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. */ +@OpMetadata( + opType = BytesProducedStatsDataset.OP_NAME, + inputsClass = BytesProducedStatsDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class BytesProducedStatsDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private BytesProducedStatsDataset(Operation operation) { - super(operation); + public BytesProducedStatsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private BytesProducedStatsDataset(Operation operation) { * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of BytesProducedStatsDataset */ @Endpoint( @@ -93,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = BytesProducedStatsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new BytesProducedStatsDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } 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 36f923b377f..a735fb49fb7 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -36,6 +42,10 @@ /** * The CSVDatasetV2 operation */ +@OpMetadata( + opType = CSVDataset.OP_NAME, + inputsClass = CSVDataset.Inputs.class +) @Operator( group = "data" ) @@ -48,8 +58,8 @@ public final class CSVDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private CSVDataset(Operation operation) { - super(operation); + public CSVDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,17 +68,17 @@ private CSVDataset(Operation operation) { * Factory method to create a class wrapping a new CSVDatasetV2 operation. * * @param scope current scope - * @param filenames the filenames value - * @param compressionType the compressionType value - * @param bufferSize the bufferSize value - * @param header the header value - * @param fieldDelim the fieldDelim value - * @param useQuoteDelim the useQuoteDelim value - * @param naValue the naValue value - * @param selectCols the selectCols value - * @param recordDefaults the recordDefaults value - * @param excludeCols the excludeCols value - * @param outputShapes the value of the outputShapes property + * @param filenames The filenames value + * @param compressionType The compressionType value + * @param bufferSize The bufferSize value + * @param header The header value + * @param fieldDelim The fieldDelim value + * @param useQuoteDelim The useQuoteDelim value + * @param naValue The naValue value + * @param selectCols The selectCols value + * @param recordDefaults The recordDefaults value + * @param excludeCols The excludeCols value + * @param outputShapes The value of the outputShapes attribute * @return a new instance of CSVDataset */ @Endpoint( @@ -112,4 +122,88 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = CSVDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The filenames input + */ + public final Operand filenames; + + /** + * The compressionType input + */ + public final Operand compressionType; + + /** + * The bufferSize input + */ + public final Operand bufferSize; + + /** + * The header input + */ + public final Operand header; + + /** + * The fieldDelim input + */ + public final Operand fieldDelim; + + /** + * The useQuoteDelim input + */ + public final Operand useQuoteDelim; + + /** + * The naValue input + */ + public final Operand naValue; + + /** + * The selectCols input + */ + public final Operand selectCols; + + /** + * The recordDefaults input + */ + public final Iterable> recordDefaults; + + /** + * The excludeCols input + */ + public final Operand excludeCols; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new CSVDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + header = (Operand) op.input(inputIndex++); + fieldDelim = (Operand) op.input(inputIndex++); + useQuoteDelim = (Operand) op.input(inputIndex++); + naValue = (Operand) op.input(inputIndex++); + selectCols = (Operand) op.input(inputIndex++); + int recordDefaultsLength = op.inputListLength("record_defaults"); + recordDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, recordDefaultsLength)); + inputIndex += recordDefaultsLength; + excludeCols = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java index a52a8fba718..d3e203779cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The CacheDatasetV2 operation */ +@OpMetadata( + opType = CacheDataset.OP_NAME, + inputsClass = CacheDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class CacheDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private CacheDataset(Operation operation) { - super(operation); + public CacheDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,11 +66,12 @@ private CacheDataset(Operation operation) { * Factory method to create a class wrapping a new CacheDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param filename the filename value - * @param cache the cache value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param filename The filename value + * @param cache The cache value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of CacheDataset */ @Endpoint( @@ -68,7 +79,7 @@ private CacheDataset(Operation operation) { ) public static CacheDataset create(Scope scope, Operand inputDataset, Operand filename, Operand cache, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CacheDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); @@ -79,9 +90,26 @@ public static CacheDataset create(Scope scope, Operand inputDat outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new CacheDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -96,4 +124,71 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.CacheDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = CacheDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The filename input + */ + public final Operand filename; + + /** + * The cache input + */ + public final Operand cache; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new CacheDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + filename = (Operand) op.input(inputIndex++); + cache = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java index 6a5cd6ae86f..2239a2f7d2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestBranchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,15 +28,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The ChooseFastestBranchDataset operation */ +@OpMetadata( + opType = ChooseFastestBranchDataset.OP_NAME, + inputsClass = ChooseFastestBranchDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class ChooseFastestBranchDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private ChooseFastestBranchDataset(Operation operation) { - super(operation); + public ChooseFastestBranchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,15 +67,15 @@ private ChooseFastestBranchDataset(Operation operation) { * Factory method to create a class wrapping a new ChooseFastestBranchDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param ratioNumerator the ratioNumerator value - * @param ratioDenominator the ratioDenominator value - * @param otherArguments the otherArguments value - * @param numElementsPerBranch the value of the numElementsPerBranch property - * @param branches the value of the branches property - * @param otherArgumentsLengths the value of the otherArgumentsLengths property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param ratioNumerator The ratioNumerator value + * @param ratioDenominator The ratioDenominator value + * @param otherArguments The otherArguments value + * @param numElementsPerBranch The value of the numElementsPerBranch attribute + * @param branches The value of the branches attribute + * @param otherArgumentsLengths The value of the otherArgumentsLengths attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ChooseFastestBranchDataset */ @Endpoint( @@ -115,4 +125,70 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ChooseFastestBranchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The ratioNumerator input + */ + public final Operand ratioNumerator; + + /** + * The ratioDenominator input + */ + public final Operand ratioDenominator; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The numElementsPerBranch attribute + */ + public final long numElementsPerBranch; + + /** + * The otherArgumentsLengths attribute + */ + public final long[] otherArgumentsLengths; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ChooseFastestBranchDataset(op), op, Arrays.asList("Targuments", "num_elements_per_branch", "other_arguments_lengths", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + ratioNumerator = (Operand) op.input(inputIndex++); + ratioDenominator = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + numElementsPerBranch = op.attributes().getAttrInt("num_elements_per_branch"); + otherArgumentsLengths = op.attributes().getAttrIntList("other_arguments_lengths"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java index bec675ca410..5d178ee720b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The ChooseFastestDataset operation */ +@OpMetadata( + opType = ChooseFastestDataset.OP_NAME, + inputsClass = ChooseFastestDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class ChooseFastestDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private ChooseFastestDataset(Operation operation) { - super(operation); + public ChooseFastestDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,10 +65,10 @@ private ChooseFastestDataset(Operation operation) { * Factory method to create a class wrapping a new ChooseFastestDataset operation. * * @param scope current scope - * @param inputDatasets the inputDatasets value - * @param numExperiments the value of the numExperiments property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDatasets The inputDatasets value + * @param numExperiments The value of the numExperiments attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ChooseFastestDataset */ @Endpoint( @@ -93,4 +103,40 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ChooseFastestDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDatasets input + */ + public final Iterable> inputDatasets; + + /** + * The numExperiments attribute + */ + public final long numExperiments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ChooseFastestDataset(op), op, Arrays.asList("num_experiments", "output_types", "output_shapes")); + int inputIndex = 0; + int inputDatasetsLength = op.inputListLength("input_datasets"); + inputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, inputDatasetsLength)); + inputIndex += inputDatasetsLength; + numExperiments = op.attributes().getAttrInt("num_experiments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CompressElement.java index 270538bf6a4..b070f5995d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CompressElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CompressElement.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,33 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Compresses a dataset element. */ +@OpMetadata( + opType = CompressElement.OP_NAME, + inputsClass = CompressElement.Inputs.class +) +@Operator( + group = "data" +) public final class CompressElement extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +53,8 @@ public final class CompressElement extends RawOp implements Operand { private Output compressed; @SuppressWarnings("unchecked") - private CompressElement(Operation operation) { - super(operation); + public CompressElement(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; compressed = operation.output(outputIdx++); } @@ -49,7 +63,7 @@ private CompressElement(Operation operation) { * Factory method to create a class wrapping a new CompressElement operation. * * @param scope current scope - * @param components the components value + * @param components The components value * @return a new instance of CompressElement */ @Endpoint( @@ -75,4 +89,28 @@ public Output compressed() { public Output asOutput() { return (Output) compressed; } + + @OpInputsMetadata( + outputsClass = CompressElement.class + ) + public static class Inputs extends RawOpInputs { + /** + * The components input + */ + public final Iterable> components; + + /** + * The inputTypes attribute + */ + public final DataType[] inputTypes; + + public Inputs(GraphOperation op) { + super(new CompressElement(op), op, Arrays.asList("input_types")); + int inputIndex = 0; + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + inputTypes = op.attributes().getAttrTypeList("input_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java index 0bc81bd18a2..656fc56e7cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that concatenates {@code input_dataset} with {@code another_dataset}. */ +@OpMetadata( + opType = ConcatenateDataset.OP_NAME, + inputsClass = ConcatenateDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class ConcatenateDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ConcatenateDataset(Operation operation) { - super(operation); + public ConcatenateDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,10 +65,11 @@ private ConcatenateDataset(Operation operation) { * Factory method to create a class wrapping a new ConcatenateDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param anotherDataset the anotherDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param anotherDataset The anotherDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of ConcatenateDataset */ @Endpoint( @@ -66,7 +77,7 @@ private ConcatenateDataset(Operation operation) { ) public static ConcatenateDataset create(Scope scope, Operand inputDataset, Operand anotherDataset, List> outputTypes, - List outputShapes) { + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConcatenateDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(anotherDataset.asOutput()); @@ -76,9 +87,26 @@ public static ConcatenateDataset create(Scope scope, Operand in outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new ConcatenateDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -93,4 +121,65 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ConcatenateDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ConcatenateDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The anotherDataset input + */ + public final Operand anotherDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ConcatenateDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + anotherDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDataset.java new file mode 100644 index 00000000000..7766d7e11ab --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDataset.java @@ -0,0 +1,377 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset that reads data from the tf.data service. + */ +@OpMetadata( + opType = DataServiceDataset.OP_NAME, + inputsClass = DataServiceDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class DataServiceDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DataServiceDatasetV4"; + + private Output handle; + + @SuppressWarnings("unchecked") + public DataServiceDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DataServiceDatasetV4 operation. + * + * @param scope current scope + * @param datasetId The datasetId value + * @param processingMode The processingMode value + * @param address The address value + * @param protocol The protocol value + * @param jobName The jobName value + * @param consumerIndex The consumerIndex value + * @param numConsumers The numConsumers value + * @param maxOutstandingRequests The maxOutstandingRequests value + * @param iterationCounter The iterationCounter value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param uncompressFn The value of the uncompressFn attribute + * @param options carries optional attribute values + * @return a new instance of DataServiceDataset + */ + @Endpoint( + describeByClass = true + ) + public static DataServiceDataset create(Scope scope, Operand datasetId, + Operand processingMode, Operand address, Operand protocol, + Operand jobName, Operand consumerIndex, Operand numConsumers, + Operand maxOutstandingRequests, Operand iterationCounter, + List> outputTypes, List outputShapes, + ConcreteFunction uncompressFn, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DataServiceDataset"); + opBuilder.addInput(datasetId.asOutput()); + opBuilder.addInput(processingMode.asOutput()); + opBuilder.addInput(address.asOutput()); + opBuilder.addInput(protocol.asOutput()); + opBuilder.addInput(jobName.asOutput()); + opBuilder.addInput(consumerIndex.asOutput()); + opBuilder.addInput(numConsumers.asOutput()); + opBuilder.addInput(maxOutstandingRequests.asOutput()); + opBuilder.addInput(iterationCounter.asOutput()); + 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); + opBuilder.setAttr("uncompress_fn", uncompressFn); + if (options != null) { + for (Options opts : options) { + if (opts.taskRefreshIntervalHintMs != null) { + opBuilder.setAttr("task_refresh_interval_hint_ms", opts.taskRefreshIntervalHintMs); + } + if (opts.dataTransferProtocol != null) { + opBuilder.setAttr("data_transfer_protocol", opts.dataTransferProtocol); + } + if (opts.targetWorkers != null) { + opBuilder.setAttr("target_workers", opts.targetWorkers); + } + if (opts.uncompress != null) { + opBuilder.setAttr("uncompress", opts.uncompress); + } + if (opts.crossTrainerCacheOptions != null) { + opBuilder.setAttr("cross_trainer_cache_options", opts.crossTrainerCacheOptions); + } + } + } + return new DataServiceDataset(opBuilder.build()); + } + + /** + * Sets the taskRefreshIntervalHintMs option. + * + * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option + * @return this Options instance. + */ + public static Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { + return new Options().taskRefreshIntervalHintMs(taskRefreshIntervalHintMs); + } + + /** + * Sets the dataTransferProtocol option. + * + * @param dataTransferProtocol the dataTransferProtocol option + * @return this Options instance. + */ + public static Options dataTransferProtocol(String dataTransferProtocol) { + return new Options().dataTransferProtocol(dataTransferProtocol); + } + + /** + * Sets the targetWorkers option. + * + * @param targetWorkers the targetWorkers option + * @return this Options instance. + */ + public static Options targetWorkers(String targetWorkers) { + return new Options().targetWorkers(targetWorkers); + } + + /** + * Sets the uncompress option. + * + * @param uncompress the uncompress option + * @return this Options instance. + */ + public static Options uncompress(Boolean uncompress) { + return new Options().uncompress(uncompress); + } + + /** + * Sets the crossTrainerCacheOptions option. + * + * @param crossTrainerCacheOptions the crossTrainerCacheOptions option + * @return this Options instance. + */ + public static Options crossTrainerCacheOptions(String crossTrainerCacheOptions) { + return new Options().crossTrainerCacheOptions(crossTrainerCacheOptions); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.DataServiceDataset} + */ + public static class Options { + private Long taskRefreshIntervalHintMs; + + private String dataTransferProtocol; + + private String targetWorkers; + + private Boolean uncompress; + + private String crossTrainerCacheOptions; + + private Options() { + } + + /** + * Sets the taskRefreshIntervalHintMs option. + * + * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option + * @return this Options instance. + */ + public Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { + this.taskRefreshIntervalHintMs = taskRefreshIntervalHintMs; + return this; + } + + /** + * Sets the dataTransferProtocol option. + * + * @param dataTransferProtocol the dataTransferProtocol option + * @return this Options instance. + */ + public Options dataTransferProtocol(String dataTransferProtocol) { + this.dataTransferProtocol = dataTransferProtocol; + return this; + } + + /** + * Sets the targetWorkers option. + * + * @param targetWorkers the targetWorkers option + * @return this Options instance. + */ + public Options targetWorkers(String targetWorkers) { + this.targetWorkers = targetWorkers; + return this; + } + + /** + * Sets the uncompress option. + * + * @param uncompress the uncompress option + * @return this Options instance. + */ + public Options uncompress(Boolean uncompress) { + this.uncompress = uncompress; + return this; + } + + /** + * Sets the crossTrainerCacheOptions option. + * + * @param crossTrainerCacheOptions the crossTrainerCacheOptions option + * @return this Options instance. + */ + public Options crossTrainerCacheOptions(String crossTrainerCacheOptions) { + this.crossTrainerCacheOptions = crossTrainerCacheOptions; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DataServiceDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The datasetId input + */ + public final Operand datasetId; + + /** + * The processingMode input + */ + public final Operand processingMode; + + /** + * The address input + */ + public final Operand address; + + /** + * The protocol input + */ + public final Operand protocol; + + /** + * The jobName input + */ + public final Operand jobName; + + /** + * The consumerIndex input + */ + public final Operand consumerIndex; + + /** + * The numConsumers input + */ + public final Operand numConsumers; + + /** + * The maxOutstandingRequests input + */ + public final Operand maxOutstandingRequests; + + /** + * The iterationCounter input + */ + public final Operand iterationCounter; + + /** + * The taskRefreshIntervalHintMs attribute + */ + public final long taskRefreshIntervalHintMs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The dataTransferProtocol attribute + */ + public final String dataTransferProtocol; + + /** + * The targetWorkers attribute + */ + public final String targetWorkers; + + /** + * The uncompress attribute + */ + public final boolean uncompress; + + /** + * The crossTrainerCacheOptions attribute + */ + public final String crossTrainerCacheOptions; + + public Inputs(GraphOperation op) { + super(new DataServiceDataset(op), op, Arrays.asList("task_refresh_interval_hint_ms", "output_types", "output_shapes", "data_transfer_protocol", "target_workers", "uncompress", "cross_trainer_cache_options")); + int inputIndex = 0; + datasetId = (Operand) op.input(inputIndex++); + processingMode = (Operand) op.input(inputIndex++); + address = (Operand) op.input(inputIndex++); + protocol = (Operand) op.input(inputIndex++); + jobName = (Operand) op.input(inputIndex++); + consumerIndex = (Operand) op.input(inputIndex++); + numConsumers = (Operand) op.input(inputIndex++); + maxOutstandingRequests = (Operand) op.input(inputIndex++); + iterationCounter = (Operand) op.input(inputIndex++); + taskRefreshIntervalHintMs = op.attributes().getAttrInt("task_refresh_interval_hint_ms"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + dataTransferProtocol = op.attributes().getAttrString("data_transfer_protocol"); + targetWorkers = op.attributes().getAttrString("target_workers"); + uncompress = op.attributes().getAttrBool("uncompress"); + crossTrainerCacheOptions = op.attributes().getAttrString("cross_trainer_cache_options"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDatasetV2.java deleted file mode 100644 index 2ee876e396f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DataServiceDatasetV2.java +++ /dev/null @@ -1,205 +0,0 @@ -/* 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.TInt64; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Creates a dataset that reads data from the tf.data service. - */ -@Operator( - group = "data" -) -public final class DataServiceDatasetV2 extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "DataServiceDatasetV2"; - - private Output handle; - - @SuppressWarnings("unchecked") - private DataServiceDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new DataServiceDatasetV2 operation. - * - * @param scope current scope - * @param datasetId the datasetId value - * @param processingMode the processingMode value - * @param address the address value - * @param protocol the protocol value - * @param jobName the jobName value - * @param consumerIndex the consumerIndex value - * @param numConsumers the numConsumers value - * @param maxOutstandingRequests the maxOutstandingRequests value - * @param iterationCounter the iterationCounter value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @param options carries optional attribute values - * @return a new instance of DataServiceDatasetV2 - */ - @Endpoint( - describeByClass = true - ) - public static DataServiceDatasetV2 create(Scope scope, Operand datasetId, - Operand processingMode, Operand address, Operand protocol, - Operand jobName, Operand consumerIndex, Operand numConsumers, - Operand maxOutstandingRequests, Operand iterationCounter, - List> outputTypes, List outputShapes, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DataServiceDatasetV2"); - opBuilder.addInput(datasetId.asOutput()); - opBuilder.addInput(processingMode.asOutput()); - opBuilder.addInput(address.asOutput()); - opBuilder.addInput(protocol.asOutput()); - opBuilder.addInput(jobName.asOutput()); - opBuilder.addInput(consumerIndex.asOutput()); - opBuilder.addInput(numConsumers.asOutput()); - opBuilder.addInput(maxOutstandingRequests.asOutput()); - opBuilder.addInput(iterationCounter.asOutput()); - 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.taskRefreshIntervalHintMs != null) { - opBuilder.setAttr("task_refresh_interval_hint_ms", opts.taskRefreshIntervalHintMs); - } - if (opts.dataTransferProtocol != null) { - opBuilder.setAttr("data_transfer_protocol", opts.dataTransferProtocol); - } - if (opts.targetWorkers != null) { - opBuilder.setAttr("target_workers", opts.targetWorkers); - } - } - } - return new DataServiceDatasetV2(opBuilder.build()); - } - - /** - * Sets the taskRefreshIntervalHintMs option. - * - * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option - * @return this Options instance. - */ - public static Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { - return new Options().taskRefreshIntervalHintMs(taskRefreshIntervalHintMs); - } - - /** - * Sets the dataTransferProtocol option. - * - * @param dataTransferProtocol the dataTransferProtocol option - * @return this Options instance. - */ - public static Options dataTransferProtocol(String dataTransferProtocol) { - return new Options().dataTransferProtocol(dataTransferProtocol); - } - - /** - * Sets the targetWorkers option. - * - * @param targetWorkers the targetWorkers option - * @return this Options instance. - */ - public static Options targetWorkers(String targetWorkers) { - return new Options().targetWorkers(targetWorkers); - } - - /** - * Gets handle. - * - * @return handle. - */ - public Output handle() { - return handle; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; - } - - /** - * Optional attributes for {@link org.tensorflow.op.data.DataServiceDatasetV2} - */ - public static class Options { - private Long taskRefreshIntervalHintMs; - - private String dataTransferProtocol; - - private String targetWorkers; - - private Options() { - } - - /** - * Sets the taskRefreshIntervalHintMs option. - * - * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option - * @return this Options instance. - */ - public Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { - this.taskRefreshIntervalHintMs = taskRefreshIntervalHintMs; - return this; - } - - /** - * Sets the dataTransferProtocol option. - * - * @param dataTransferProtocol the dataTransferProtocol option - * @return this Options instance. - */ - public Options dataTransferProtocol(String dataTransferProtocol) { - this.dataTransferProtocol = dataTransferProtocol; - return this; - } - - /** - * Sets the targetWorkers option. - * - * @param targetWorkers the targetWorkers option - * @return this Options instance. - */ - public Options targetWorkers(String targetWorkers) { - this.targetWorkers = targetWorkers; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java index 72216097974..8d7a987da81 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * Returns the cardinality of {@code input_dataset}. * Returns the cardinality of {@code input_dataset}. */ +@OpMetadata( + opType = DatasetCardinality.OP_NAME, + inputsClass = DatasetCardinality.Inputs.class +) @Operator( group = "data" ) @@ -43,8 +52,8 @@ public final class DatasetCardinality extends RawOp implements Operand { private Output cardinality; - private DatasetCardinality(Operation operation) { - super(operation); + public DatasetCardinality(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; cardinality = operation.output(outputIdx++); } @@ -54,17 +63,36 @@ private DatasetCardinality(Operation operation) { * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return cardinality for. + * @param options carries optional attribute values * @return a new instance of DatasetCardinality */ @Endpoint( describeByClass = true ) - public static DatasetCardinality create(Scope scope, Operand inputDataset) { + public static DatasetCardinality create(Scope scope, Operand inputDataset, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetCardinality"); opBuilder.addInput(inputDataset.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.cardinalityOptions != null) { + opBuilder.setAttr("cardinality_options", opts.cardinalityOptions); + } + } + } return new DatasetCardinality(opBuilder.build()); } + /** + * Sets the cardinalityOptions option. + * + * @param cardinalityOptions the cardinalityOptions option + * @return this Options instance. + */ + public static Options cardinalityOptions(String cardinalityOptions) { + return new Options().cardinalityOptions(cardinalityOptions); + } + /** * Gets cardinality. * The cardinality of {@code input_dataset}. Named constants are used to represent @@ -79,4 +107,47 @@ public Output cardinality() { public Output asOutput() { return cardinality; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.DatasetCardinality} + */ + public static class Options { + private String cardinalityOptions; + + private Options() { + } + + /** + * Sets the cardinalityOptions option. + * + * @param cardinalityOptions the cardinalityOptions option + * @return this Options instance. + */ + public Options cardinalityOptions(String cardinalityOptions) { + this.cardinalityOptions = cardinalityOptions; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DatasetCardinality.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to return cardinality for. + */ + public final Operand inputDataset; + + /** + * The cardinalityOptions attribute + */ + public final String cardinalityOptions; + + public Inputs(GraphOperation op) { + super(new DatasetCardinality(op), op, Arrays.asList("cardinality_options")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + cardinalityOptions = op.attributes().getAttrString("cardinality_options"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFingerprint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFingerprint.java new file mode 100644 index 00000000000..573670b6b26 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFingerprint.java @@ -0,0 +1,107 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Returns the fingerprint of {@code input_dataset}. + * Returns the fingerprint of {@code input_dataset}. + */ +@OpMetadata( + opType = DatasetFingerprint.OP_NAME, + inputsClass = DatasetFingerprint.Inputs.class +) +@Operator( + group = "data" +) +public final class DatasetFingerprint extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetFingerprint"; + + private Output fingerprint; + + @SuppressWarnings("unchecked") + public DatasetFingerprint(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + fingerprint = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DatasetFingerprint operation. + * + * @param scope current scope + * @param inputDataset A variant tensor representing the dataset to return fingerprint for. + * @return a new instance of DatasetFingerprint + */ + @Endpoint( + describeByClass = true + ) + public static DatasetFingerprint create(Scope scope, Operand inputDataset) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetFingerprint"); + opBuilder.addInput(inputDataset.asOutput()); + return new DatasetFingerprint(opBuilder.build()); + } + + /** + * Gets fingerprint. + * The fingerprint of {@code input_dataset} in {@code uint64} + * @return fingerprint. + */ + public Output fingerprint() { + return fingerprint; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) fingerprint; + } + + @OpInputsMetadata( + outputsClass = DatasetFingerprint.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to return fingerprint for. + */ + public final Operand inputDataset; + + public Inputs(GraphOperation op) { + super(new DatasetFingerprint(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java index c794a89a65d..7837a86948d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * Creates a dataset from the given {@code graph_def}. * Creates a dataset from the provided {@code graph_def}. */ +@OpMetadata( + opType = DatasetFromGraph.OP_NAME, + inputsClass = DatasetFromGraph.Inputs.class +) @Operator( group = "data" ) @@ -44,8 +53,8 @@ public final class DatasetFromGraph extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private DatasetFromGraph(Operation operation) { - super(operation); + public DatasetFromGraph(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -80,4 +89,20 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DatasetFromGraph.class + ) + public static class Inputs extends RawOpInputs { + /** + * The graph representation of the dataset (as serialized GraphDef). + */ + public final Operand graphDef; + + public Inputs(GraphOperation op) { + super(new DatasetFromGraph(op), op, Arrays.asList()); + int inputIndex = 0; + graphDef = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java index 0177a116cbe..e3858ff423a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * Returns a serialized GraphDef representing {@code input_dataset}. * Returns a graph representation for {@code input_dataset}. */ +@OpMetadata( + opType = DatasetToGraph.OP_NAME, + inputsClass = DatasetToGraph.Inputs.class +) @Operator( group = "data" ) @@ -43,8 +52,8 @@ public final class DatasetToGraph extends RawOp implements Operand { private Output graph; - private DatasetToGraph(Operation operation) { - super(operation); + public DatasetToGraph(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; graph = operation.output(outputIdx++); } @@ -144,4 +153,32 @@ public Options stripDeviceAssignment(Boolean stripDeviceAssignment) { return this; } } + + @OpInputsMetadata( + outputsClass = DatasetToGraph.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to return the graph representation for. + */ + public final Operand inputDataset; + + /** + * The externalStatePolicy attribute + */ + public final long externalStatePolicy; + + /** + * The stripDeviceAssignment attribute + */ + public final boolean stripDeviceAssignment; + + public Inputs(GraphOperation op) { + super(new DatasetToGraph(op), op, Arrays.asList("external_state_policy", "strip_device_assignment")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + externalStatePolicy = op.attributes().getAttrInt("external_state_policy"); + stripDeviceAssignment = op.attributes().getAttrBool("strip_device_assignment"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java index f5b779ed6bc..6249a1bf1b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Outputs the single element from the given dataset. */ +@OpMetadata( + opType = DatasetToSingleElement.OP_NAME, + inputsClass = DatasetToSingleElement.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +56,8 @@ public final class DatasetToSingleElement extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private DatasetToSingleElement(Operation operation) { - super(operation); + public DatasetToSingleElement(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -60,15 +69,16 @@ private DatasetToSingleElement(Operation operation) { * * @param scope current scope * @param dataset A handle to a dataset that contains a single element. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of DatasetToSingleElement */ @Endpoint( describeByClass = true ) public static DatasetToSingleElement create(Scope scope, Operand dataset, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DatasetToSingleElement"); opBuilder.addInput(dataset.asOutput()); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); @@ -77,9 +87,26 @@ public static DatasetToSingleElement create(Scope scope, Operand> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + /** + * Optional attributes for {@link org.tensorflow.op.data.DatasetToSingleElement} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DatasetToSingleElement.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to a dataset that contains a single element. + */ + public final Operand dataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new DatasetToSingleElement(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java index bb4b58da845..9c5e491ce17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -30,6 +35,10 @@ /** * Writes the given dataset to the given file using the TFRecord format. */ +@OpMetadata( + opType = DatasetToTfRecord.OP_NAME, + inputsClass = DatasetToTfRecord.Inputs.class +) @Operator( group = "data" ) @@ -39,8 +48,8 @@ public final class DatasetToTfRecord extends RawOp { */ public static final String OP_NAME = "DatasetToTFRecord"; - private DatasetToTfRecord(Operation operation) { - super(operation); + public DatasetToTfRecord(Operation operation) { + super(operation, OP_NAME); } /** @@ -64,4 +73,33 @@ public static DatasetToTfRecord create(Scope scope, Operand inp opBuilder.addInput(compressionType.asOutput()); return new DatasetToTfRecord(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DatasetToTfRecord.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to write. + */ + public final Operand inputDataset; + + /** + * A scalar string tensor representing the filename to use. + */ + public final Operand filename; + + /** + * A scalar string tensor containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + */ + public final Operand compressionType; + + public Inputs(GraphOperation op) { + super(new DatasetToTfRecord(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + filename = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java index 0a696c8288e..52449ff1d94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,27 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ +@OpMetadata( + opType = DeleteIterator.OP_NAME, + inputsClass = DeleteIterator.Inputs.class +) @Operator( group = "data" ) @@ -38,8 +47,8 @@ public final class DeleteIterator extends RawOp { */ public static final String OP_NAME = "DeleteIterator"; - private DeleteIterator(Operation operation) { - super(operation); + public DeleteIterator(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +69,26 @@ public static DeleteIterator create(Scope scope, Operand handle opBuilder.addInput(deleter.asOutput()); return new DeleteIterator(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeleteIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to the iterator to delete. + */ + public final Operand handle; + + /** + * A variant deleter. + */ + public final Operand deleter; + + public Inputs(GraphOperation op) { + super(new DeleteIterator(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + deleter = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java index c4b3b450727..a701e8ab58b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,33 +17,46 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DeleteMemoryCache operation */ +@OpMetadata( + opType = DeleteMemoryCache.OP_NAME, + inputsClass = DeleteMemoryCache.Inputs.class +) +@Operator( + group = "data" +) public final class DeleteMemoryCache extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "DeleteMemoryCache"; - private DeleteMemoryCache(Operation operation) { - super(operation); + public DeleteMemoryCache(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new DeleteMemoryCache operation. * * @param scope current scope - * @param handle the handle value - * @param deleter the deleter value + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteMemoryCache */ @Endpoint( @@ -56,4 +69,26 @@ public static DeleteMemoryCache create(Scope scope, Operand han opBuilder.addInput(deleter.asOutput()); return new DeleteMemoryCache(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeleteMemoryCache.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle input + */ + public final Operand handle; + + /** + * The deleter input + */ + public final Operand deleter; + + public Inputs(GraphOperation op) { + super(new DeleteMemoryCache(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + deleter = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java index af43926e234..8f8b0b35d33 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,26 +17,39 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ +@OpMetadata( + opType = DeleteMultiDeviceIterator.OP_NAME, + inputsClass = DeleteMultiDeviceIterator.Inputs.class +) +@Operator( + group = "data" +) public final class DeleteMultiDeviceIterator extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "DeleteMultiDeviceIterator"; - private DeleteMultiDeviceIterator(Operation operation) { - super(operation); + public DeleteMultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +73,34 @@ public static DeleteMultiDeviceIterator create(Scope scope, opBuilder.addInput(deleter.asOutput()); return new DeleteMultiDeviceIterator(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeleteMultiDeviceIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to the multi device iterator to delete. + */ + public final Operand multiDeviceIterator; + + /** + * A list of iterator handles (unused). This is added so that automatic control dependencies get added during function tracing that ensure this op runs after all the dependent iterators are deleted. + */ + public final Iterable> iterators; + + /** + * A variant deleter. + */ + public final Operand deleter; + + public Inputs(GraphOperation op) { + super(new DeleteMultiDeviceIterator(op), op, Arrays.asList()); + int inputIndex = 0; + multiDeviceIterator = (Operand) op.input(inputIndex++); + int iteratorsLength = op.inputListLength("iterators"); + iterators = Arrays.asList((Operand[]) op.inputList(inputIndex, iteratorsLength)); + inputIndex += iteratorsLength; + deleter = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java index d507b656d58..40f43645d01 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that batches input elements into a SparseTensor. */ +@OpMetadata( + opType = DenseToSparseBatchDataset.OP_NAME, + inputsClass = DenseToSparseBatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class DenseToSparseBatchDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private DenseToSparseBatchDataset(Operation operation) { - super(operation); + public DenseToSparseBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,8 +72,8 @@ private DenseToSparseBatchDataset(Operation operation) { * @param rowShape A vector representing the dense shape of each row in the produced * SparseTensor. The shape may be partially specified, using {@code -1} to indicate * that a particular dimension should use the maximum size of all batch elements. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DenseToSparseBatchDataset */ @Endpoint( @@ -99,4 +109,47 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DenseToSparseBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to an input dataset. Must have a single component. + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements to accumulate in a + * batch. + */ + public final Operand batchSize; + + /** + * A vector representing the dense shape of each row in the produced + * SparseTensor. The shape may be partially specified, using {@code -1} to indicate + * that a particular dimension should use the maximum size of all batch elements. + */ + public final Operand rowShape; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new DenseToSparseBatchDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSize = (Operand) op.input(inputIndex++); + rowShape = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java index a7254cf58ea..156248b1d64 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,27 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Converts the given variant tensor to an iterator and stores it in the given resource. */ +@OpMetadata( + opType = DeserializeIterator.OP_NAME, + inputsClass = DeserializeIterator.Inputs.class +) @Operator( group = "data" ) @@ -38,8 +47,8 @@ public final class DeserializeIterator extends RawOp { */ public static final String OP_NAME = "DeserializeIterator"; - private DeserializeIterator(Operation operation) { - super(operation); + public DeserializeIterator(Operation operation) { + super(operation, OP_NAME); } /** @@ -61,4 +70,27 @@ public static DeserializeIterator create(Scope scope, Operand r opBuilder.addInput(serialized.asOutput()); return new DeserializeIterator(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeserializeIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to an iterator resource. + */ + public final Operand resourceHandle; + + /** + * A variant tensor storing the state of the iterator contained in the + * resource. + */ + public final Operand serialized; + + public Inputs(GraphOperation op) { + super(new DeserializeIterator(op), op, Arrays.asList()); + int inputIndex = 0; + resourceHandle = (Operand) op.input(inputIndex++); + serialized = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java index 93fa60508a4..8609ca61f95 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. */ +@OpMetadata( + opType = DirectedInterleaveDataset.OP_NAME, + inputsClass = DirectedInterleaveDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class DirectedInterleaveDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private DirectedInterleaveDataset(Operation operation) { - super(operation); + public DirectedInterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,8 +69,8 @@ private DirectedInterleaveDataset(Operation operation) { * {@code N} data inputs should produce the next output element. * @param dataInputDatasets {@code N} datasets with the same type that will be interleaved according to * the values of {@code selector_input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of DirectedInterleaveDataset */ @@ -135,4 +145,48 @@ public Options stopOnEmptyDataset(Boolean stopOnEmptyDataset) { return this; } } + + @OpInputsMetadata( + outputsClass = DirectedInterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A dataset of scalar {@code DT_INT64} elements that determines which of the + * {@code N} data inputs should produce the next output element. + */ + public final Operand selectorInputDataset; + + /** + * {@code N} datasets with the same type that will be interleaved according to + * the values of {@code selector_input_dataset}. + */ + public final Iterable> dataInputDatasets; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The stopOnEmptyDataset attribute + */ + public final boolean stopOnEmptyDataset; + + public Inputs(GraphOperation op) { + super(new DirectedInterleaveDataset(op), op, Arrays.asList("output_types", "output_shapes", "stop_on_empty_dataset")); + int inputIndex = 0; + selectorInputDataset = (Operand) op.input(inputIndex++); + int dataInputDatasetsLength = op.inputListLength("data_input_datasets"); + dataInputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, dataInputDatasetsLength)); + inputIndex += dataInputDatasetsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + stopOnEmptyDataset = op.attributes().getAttrBool("stop_on_empty_dataset"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DummyIterationCounter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DummyIterationCounter.java index 837efe0f7b1..be7fc1c6ee8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DummyIterationCounter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DummyIterationCounter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DummyIterationCounter operation */ +@OpMetadata( + opType = DummyIterationCounter.OP_NAME, + inputsClass = DummyIterationCounter.Inputs.class +) +@Operator( + group = "data" +) public final class DummyIterationCounter extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class DummyIterationCounter extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private DummyIterationCounter(Operation operation) { - super(operation); + public DummyIterationCounter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -72,4 +85,14 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DummyIterationCounter.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new DummyIterationCounter(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java index a2b08845e55..da10b07c03f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset containing elements of first component of {@code input_dataset} having true in the last component. */ +@OpMetadata( + opType = FilterByLastComponentDataset.OP_NAME, + inputsClass = FilterByLastComponentDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class FilterByLastComponentDataset extends RawOp implements Operand private Output output; @SuppressWarnings("unchecked") - private FilterByLastComponentDataset(Operation operation) { - super(operation); + public FilterByLastComponentDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,9 +65,9 @@ private FilterByLastComponentDataset(Operation operation) { * Factory method to create a class wrapping a new FilterByLastComponentDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of FilterByLastComponentDataset */ @Endpoint( @@ -91,4 +101,32 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = FilterByLastComponentDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new FilterByLastComponentDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterDataset.java index afdbd819ee7..050fecfe986 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,6 +46,10 @@ *

    • One tensor for each value in {@code other_arguments}.
    • *
    */ +@OpMetadata( + opType = FilterDataset.OP_NAME, + inputsClass = FilterDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class FilterDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private FilterDataset(Operation operation) { - super(operation); + public FilterDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,12 +72,13 @@ private FilterDataset(Operation operation) { * Factory method to create a class wrapping a new FilterDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param otherArguments A list of tensors, typically values that were captured when * building a closure for {@code predicate}. * @param predicate A function returning a scalar boolean. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of FilterDataset */ @Endpoint( @@ -75,7 +86,7 @@ private FilterDataset(Operation operation) { ) public static FilterDataset create(Scope scope, Operand inputDataset, Iterable> otherArguments, ConcreteFunction predicate, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FilterDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(otherArguments)); @@ -86,9 +97,26 @@ public static FilterDataset create(Scope scope, Operand inputDa outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new FilterDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -103,4 +131,74 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.FilterDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = FilterDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new FilterDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FinalizeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FinalizeDataset.java index 5c81b9c4d02..e6cc09a0a8c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FinalizeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FinalizeDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset by applying {@code tf.data.Options} to {@code input_dataset}. */ +@OpMetadata( + opType = FinalizeDataset.OP_NAME, + inputsClass = FinalizeDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class FinalizeDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private FinalizeDataset(Operation operation) { - super(operation); + public FinalizeDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,8 +66,8 @@ private FinalizeDataset(Operation operation) { * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of FinalizeDataset */ @@ -129,4 +139,38 @@ public Options hasCapturedRef(Boolean hasCapturedRef) { return this; } } + + @OpInputsMetadata( + outputsClass = FinalizeDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * The hasCapturedRef attribute + */ + public final boolean hasCapturedRef; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new FinalizeDataset(op), op, Arrays.asList("has_captured_ref", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + hasCapturedRef = op.attributes().getAttrBool("has_captured_ref"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java index 3ff58fd3784..4c2bc264022 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ /** * The FixedLengthRecordDatasetV2 operation */ +@OpMetadata( + opType = FixedLengthRecordDataset.OP_NAME, + inputsClass = FixedLengthRecordDataset.Inputs.class +) @Operator( group = "data" ) @@ -44,8 +53,8 @@ public final class FixedLengthRecordDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private FixedLengthRecordDataset(Operation operation) { - super(operation); + public FixedLengthRecordDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -54,12 +63,13 @@ private FixedLengthRecordDataset(Operation operation) { * Factory method to create a class wrapping a new FixedLengthRecordDatasetV2 operation. * * @param scope current scope - * @param filenames the filenames value - * @param headerBytes the headerBytes value - * @param recordBytes the recordBytes value - * @param footerBytes the footerBytes value - * @param bufferSize the bufferSize value - * @param compressionType the compressionType value + * @param filenames The filenames value + * @param headerBytes The headerBytes value + * @param recordBytes The recordBytes value + * @param footerBytes The footerBytes value + * @param bufferSize The bufferSize value + * @param compressionType The compressionType value + * @param options carries optional attribute values * @return a new instance of FixedLengthRecordDataset */ @Endpoint( @@ -67,7 +77,7 @@ private FixedLengthRecordDataset(Operation operation) { ) public static FixedLengthRecordDataset create(Scope scope, Operand filenames, Operand headerBytes, Operand recordBytes, Operand footerBytes, - Operand bufferSize, Operand compressionType) { + Operand bufferSize, Operand compressionType, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FixedLengthRecordDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(headerBytes.asOutput()); @@ -75,9 +85,26 @@ public static FixedLengthRecordDataset create(Scope scope, Operand file opBuilder.addInput(footerBytes.asOutput()); opBuilder.addInput(bufferSize.asOutput()); opBuilder.addInput(compressionType.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new FixedLengthRecordDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -92,4 +119,77 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.FixedLengthRecordDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = FixedLengthRecordDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The filenames input + */ + public final Operand filenames; + + /** + * The headerBytes input + */ + public final Operand headerBytes; + + /** + * The recordBytes input + */ + public final Operand recordBytes; + + /** + * The footerBytes input + */ + public final Operand footerBytes; + + /** + * The bufferSize input + */ + public final Operand bufferSize; + + /** + * The compressionType input + */ + public final Operand compressionType; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new FixedLengthRecordDataset(op), op, Arrays.asList("metadata")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + headerBytes = (Operand) op.input(inputIndex++); + recordBytes = (Operand) op.input(inputIndex++); + footerBytes = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.java index de6f6783271..163094b2950 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FlatMapDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +43,10 @@ * Dataset variant, and FlatMapDataset will flatten successive results * into a single Dataset. */ +@OpMetadata( + opType = FlatMapDataset.OP_NAME, + inputsClass = FlatMapDataset.Inputs.class +) @Operator( group = "data" ) @@ -49,8 +59,8 @@ public final class FlatMapDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private FlatMapDataset(Operation operation) { - super(operation); + public FlatMapDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,13 +69,14 @@ private FlatMapDataset(Operation operation) { * Factory method to create a class wrapping a new FlatMapDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of FlatMapDataset */ @Endpoint( @@ -73,7 +84,7 @@ private FlatMapDataset(Operation operation) { ) public static FlatMapDataset create(Scope scope, Operand inputDataset, Iterable> otherArguments, ConcreteFunction f, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FlatMapDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(otherArguments)); @@ -84,9 +95,26 @@ public static FlatMapDataset create(Scope scope, Operand inputD outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new FlatMapDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -101,4 +129,73 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.FlatMapDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = FlatMapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new FlatMapDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GeneratorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GeneratorDataset.java index be66d0404a9..2ca97fa2418 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GeneratorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GeneratorDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that invokes a function to generate elements. */ +@OpMetadata( + opType = GeneratorDataset.OP_NAME, + inputsClass = GeneratorDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class GeneratorDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private GeneratorDataset(Operation operation) { - super(operation); + public GeneratorDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,14 +66,15 @@ private GeneratorDataset(Operation operation) { * Factory method to create a class wrapping a new GeneratorDataset operation. * * @param scope current scope - * @param initFuncOtherArgs the initFuncOtherArgs value - * @param nextFuncOtherArgs the nextFuncOtherArgs value - * @param finalizeFuncOtherArgs the finalizeFuncOtherArgs value - * @param initFunc the value of the initFunc property - * @param nextFunc the value of the nextFunc property - * @param finalizeFunc the value of the finalizeFunc property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param initFuncOtherArgs The initFuncOtherArgs value + * @param nextFuncOtherArgs The nextFuncOtherArgs value + * @param finalizeFuncOtherArgs The finalizeFuncOtherArgs value + * @param initFunc The value of the initFunc attribute + * @param nextFunc The value of the nextFunc attribute + * @param finalizeFunc The value of the finalizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of GeneratorDataset */ @Endpoint( @@ -72,7 +83,7 @@ private GeneratorDataset(Operation operation) { public static GeneratorDataset create(Scope scope, Iterable> initFuncOtherArgs, Iterable> nextFuncOtherArgs, Iterable> finalizeFuncOtherArgs, ConcreteFunction initFunc, ConcreteFunction nextFunc, ConcreteFunction finalizeFunc, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GeneratorDataset"); opBuilder.addInputList(Operands.asOutputs(initFuncOtherArgs)); opBuilder.addInputList(Operands.asOutputs(nextFuncOtherArgs)); @@ -86,9 +97,26 @@ public static GeneratorDataset create(Scope scope, Iterable> initFunc outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new GeneratorDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -103,4 +131,95 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.GeneratorDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = GeneratorDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The initFuncOtherArgs input + */ + public final Iterable> initFuncOtherArgs; + + /** + * The nextFuncOtherArgs input + */ + public final Iterable> nextFuncOtherArgs; + + /** + * The finalizeFuncOtherArgs input + */ + public final Iterable> finalizeFuncOtherArgs; + + /** + * The TinitFuncArgs attribute + */ + public final DataType[] TinitFuncArgs; + + /** + * The TnextFuncArgs attribute + */ + public final DataType[] TnextFuncArgs; + + /** + * The TfinalizeFuncArgs attribute + */ + public final DataType[] TfinalizeFuncArgs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new GeneratorDataset(op), op, Arrays.asList("Tinit_func_args", "Tnext_func_args", "Tfinalize_func_args", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + int initFuncOtherArgsLength = op.inputListLength("init_func_other_args"); + initFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, initFuncOtherArgsLength)); + inputIndex += initFuncOtherArgsLength; + int nextFuncOtherArgsLength = op.inputListLength("next_func_other_args"); + nextFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, nextFuncOtherArgsLength)); + inputIndex += nextFuncOtherArgsLength; + int finalizeFuncOtherArgsLength = op.inputListLength("finalize_func_other_args"); + finalizeFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, finalizeFuncOtherArgsLength)); + inputIndex += finalizeFuncOtherArgsLength; + TinitFuncArgs = op.attributes().getAttrTypeList("Tinit_func_args"); + TnextFuncArgs = op.attributes().getAttrTypeList("Tnext_func_args"); + TfinalizeFuncArgs = op.attributes().getAttrTypeList("Tfinalize_func_args"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GlobalShuffleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GlobalShuffleDataset.java new file mode 100644 index 00000000000..19ec4cd2e96 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GlobalShuffleDataset.java @@ -0,0 +1,230 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The GlobalShuffleDataset operation + */ +@OpMetadata( + opType = GlobalShuffleDataset.OP_NAME, + inputsClass = GlobalShuffleDataset.Inputs.class +) +public final class GlobalShuffleDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GlobalShuffleDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public GlobalShuffleDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GlobalShuffleDataset operation. + * + * @param scope current scope + * @param inputDataset The inputDataset value + * @param seed The seed value + * @param seed2 The seed2 value + * @param seedGenerator The seedGenerator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of GlobalShuffleDataset + */ + @Endpoint( + describeByClass = true + ) + public static GlobalShuffleDataset create(Scope scope, Operand inputDataset, + Operand seed, Operand seed2, Operand seedGenerator, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GlobalShuffleDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(seed.asOutput()); + opBuilder.addInput(seed2.asOutput()); + opBuilder.addInput(seedGenerator.asOutput()); + 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.reshuffleEachIteration != null) { + opBuilder.setAttr("reshuffle_each_iteration", opts.reshuffleEachIteration); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new GlobalShuffleDataset(opBuilder.build()); + } + + /** + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. + */ + public static Options reshuffleEachIteration(Boolean reshuffleEachIteration) { + return new Options().reshuffleEachIteration(reshuffleEachIteration); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.GlobalShuffleDataset} + */ + public static class Options { + private Boolean reshuffleEachIteration; + + private String metadata; + + private Options() { + } + + /** + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. + */ + public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { + this.reshuffleEachIteration = reshuffleEachIteration; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = GlobalShuffleDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The seed input + */ + public final Operand seed; + + /** + * The seed2 input + */ + public final Operand seed2; + + /** + * The seedGenerator input + */ + public final Operand seedGenerator; + + /** + * The reshuffleEachIteration attribute + */ + public final boolean reshuffleEachIteration; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new GlobalShuffleDataset(op), op, Arrays.asList("reshuffle_each_iteration", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + seedGenerator = (Operand) op.input(inputIndex++); + reshuffleEachIteration = op.attributes().getAttrBool("reshuffle_each_iteration"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByReducerDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByReducerDataset.java index 51a104f84c9..7591cbce6fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByReducerDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByReducerDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,15 +28,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that computes a group-by on {@code input_dataset}. * Creates a dataset that computes a group-by on {@code input_dataset}. */ +@OpMetadata( + opType = GroupByReducerDataset.OP_NAME, + inputsClass = GroupByReducerDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class GroupByReducerDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private GroupByReducerDataset(Operation operation) { - super(operation); + public GroupByReducerDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -73,8 +83,8 @@ private GroupByReducerDataset(Operation operation) { * @param reduceFunc A function mapping the current reducer state and an element of {@code input_dataset}, * concatenated with {@code reduce_func_other_arguments} to a new reducer state. * @param finalizeFunc A function mapping the final reducer state to an output element. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of GroupByReducerDataset */ @Endpoint( @@ -119,4 +129,92 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = GroupByReducerDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code key_func}. + */ + public final Iterable> keyFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code init_func}. + */ + public final Iterable> initFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code reduce_func}. + */ + public final Iterable> reduceFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code finalize_func}. + */ + public final Iterable> finalizeFuncOtherArguments; + + /** + * The TkeyFuncOtherArguments attribute + */ + public final DataType[] TkeyFuncOtherArguments; + + /** + * The TinitFuncOtherArguments attribute + */ + public final DataType[] TinitFuncOtherArguments; + + /** + * The TreduceFuncOtherArguments attribute + */ + public final DataType[] TreduceFuncOtherArguments; + + /** + * The TfinalizeFuncOtherArguments attribute + */ + public final DataType[] TfinalizeFuncOtherArguments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new GroupByReducerDataset(op), op, Arrays.asList("Tkey_func_other_arguments", "Tinit_func_other_arguments", "Treduce_func_other_arguments", "Tfinalize_func_other_arguments", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int keyFuncOtherArgumentsLength = op.inputListLength("key_func_other_arguments"); + keyFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, keyFuncOtherArgumentsLength)); + inputIndex += keyFuncOtherArgumentsLength; + int initFuncOtherArgumentsLength = op.inputListLength("init_func_other_arguments"); + initFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, initFuncOtherArgumentsLength)); + inputIndex += initFuncOtherArgumentsLength; + int reduceFuncOtherArgumentsLength = op.inputListLength("reduce_func_other_arguments"); + reduceFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, reduceFuncOtherArgumentsLength)); + inputIndex += reduceFuncOtherArgumentsLength; + int finalizeFuncOtherArgumentsLength = op.inputListLength("finalize_func_other_arguments"); + finalizeFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, finalizeFuncOtherArgumentsLength)); + inputIndex += finalizeFuncOtherArgumentsLength; + TkeyFuncOtherArguments = op.attributes().getAttrTypeList("Tkey_func_other_arguments"); + TinitFuncOtherArguments = op.attributes().getAttrTypeList("Tinit_func_other_arguments"); + TreduceFuncOtherArguments = op.attributes().getAttrTypeList("Treduce_func_other_arguments"); + TfinalizeFuncOtherArguments = op.attributes().getAttrTypeList("Tfinalize_func_other_arguments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByWindowDataset.java index 36c6568c109..55b76655428 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/GroupByWindowDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,15 +28,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that computes a windowed group-by on {@code input_dataset}. * // TODO(mrry): Support non-int64 keys. */ +@OpMetadata( + opType = GroupByWindowDataset.OP_NAME, + inputsClass = GroupByWindowDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class GroupByWindowDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private GroupByWindowDataset(Operation operation) { - super(operation); + public GroupByWindowDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,16 +67,17 @@ private GroupByWindowDataset(Operation operation) { * Factory method to create a class wrapping a new GroupByWindowDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param keyFuncOtherArguments the keyFuncOtherArguments value - * @param reduceFuncOtherArguments the reduceFuncOtherArguments value - * @param windowSizeFuncOtherArguments the windowSizeFuncOtherArguments value + * @param inputDataset The inputDataset value + * @param keyFuncOtherArguments The keyFuncOtherArguments value + * @param reduceFuncOtherArguments The reduceFuncOtherArguments value + * @param windowSizeFuncOtherArguments The windowSizeFuncOtherArguments value * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. - * @param reduceFunc the value of the reduceFunc property - * @param windowSizeFunc the value of the windowSizeFunc property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param reduceFunc The value of the reduceFunc attribute + * @param windowSizeFunc The value of the windowSizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of GroupByWindowDataset */ @Endpoint( @@ -76,7 +87,7 @@ public static GroupByWindowDataset create(Scope scope, Operand Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GroupByWindowDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(keyFuncOtherArguments)); @@ -91,9 +102,26 @@ public static GroupByWindowDataset create(Scope scope, Operand outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new GroupByWindowDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -108,4 +136,101 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.GroupByWindowDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = GroupByWindowDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The keyFuncOtherArguments input + */ + public final Iterable> keyFuncOtherArguments; + + /** + * The reduceFuncOtherArguments input + */ + public final Iterable> reduceFuncOtherArguments; + + /** + * The windowSizeFuncOtherArguments input + */ + public final Iterable> windowSizeFuncOtherArguments; + + /** + * The TkeyFuncOtherArguments attribute + */ + public final DataType[] TkeyFuncOtherArguments; + + /** + * The TreduceFuncOtherArguments attribute + */ + public final DataType[] TreduceFuncOtherArguments; + + /** + * The TwindowSizeFuncOtherArguments attribute + */ + public final DataType[] TwindowSizeFuncOtherArguments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new GroupByWindowDataset(op), op, Arrays.asList("Tkey_func_other_arguments", "Treduce_func_other_arguments", "Twindow_size_func_other_arguments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int keyFuncOtherArgumentsLength = op.inputListLength("key_func_other_arguments"); + keyFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, keyFuncOtherArgumentsLength)); + inputIndex += keyFuncOtherArgumentsLength; + int reduceFuncOtherArgumentsLength = op.inputListLength("reduce_func_other_arguments"); + reduceFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, reduceFuncOtherArgumentsLength)); + inputIndex += reduceFuncOtherArgumentsLength; + int windowSizeFuncOtherArgumentsLength = op.inputListLength("window_size_func_other_arguments"); + windowSizeFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, windowSizeFuncOtherArgumentsLength)); + inputIndex += windowSizeFuncOtherArgumentsLength; + TkeyFuncOtherArguments = op.attributes().getAttrTypeList("Tkey_func_other_arguments"); + TreduceFuncOtherArguments = op.attributes().getAttrTypeList("Treduce_func_other_arguments"); + TwindowSizeFuncOtherArguments = op.attributes().getAttrTypeList("Twindow_size_func_other_arguments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } 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 25a819a79c6..4079e750860 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. */ +@OpMetadata( + opType = IgnoreErrorsDataset.OP_NAME, + inputsClass = IgnoreErrorsDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class IgnoreErrorsDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private IgnoreErrorsDataset(Operation operation) { - super(operation); + public IgnoreErrorsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,9 +65,9 @@ private IgnoreErrorsDataset(Operation operation) { * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of IgnoreErrorsDataset */ @@ -129,4 +139,38 @@ public Options logWarning(Boolean logWarning) { return this; } } + + @OpInputsMetadata( + outputsClass = IgnoreErrorsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The logWarning attribute + */ + public final boolean logWarning; + + public Inputs(GraphOperation op) { + super(new IgnoreErrorsDataset(op), op, Arrays.asList("output_types", "output_shapes", "log_warning")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + logWarning = op.attributes().getAttrBool("log_warning"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IndexFlatMapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IndexFlatMapDataset.java new file mode 100644 index 00000000000..b5d3f116ad5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IndexFlatMapDataset.java @@ -0,0 +1,224 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The IndexFlatMapDataset operation + */ +@OpMetadata( + opType = IndexFlatMapDataset.OP_NAME, + inputsClass = IndexFlatMapDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class IndexFlatMapDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IndexFlatMapDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public IndexFlatMapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IndexFlatMapDataset operation. + * + * @param scope current scope + * @param inputDataset The inputDataset value + * @param mapFuncOtherArgs The mapFuncOtherArgs value + * @param indexMapFuncOtherArgs The indexMapFuncOtherArgs value + * @param outputCardinality The outputCardinality value + * @param mapFunc The value of the mapFunc attribute + * @param indexMapFunc The value of the indexMapFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of IndexFlatMapDataset + */ + @Endpoint( + describeByClass = true + ) + public static IndexFlatMapDataset create(Scope scope, Operand inputDataset, + Iterable> mapFuncOtherArgs, Iterable> indexMapFuncOtherArgs, + Operand outputCardinality, ConcreteFunction mapFunc, ConcreteFunction indexMapFunc, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IndexFlatMapDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(mapFuncOtherArgs)); + opBuilder.addInputList(Operands.asOutputs(indexMapFuncOtherArgs)); + opBuilder.addInput(outputCardinality.asOutput()); + opBuilder.setAttr("map_func", mapFunc); + opBuilder.setAttr("index_map_func", indexMapFunc); + 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.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new IndexFlatMapDataset(opBuilder.build()); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.IndexFlatMapDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = IndexFlatMapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The mapFuncOtherArgs input + */ + public final Iterable> mapFuncOtherArgs; + + /** + * The indexMapFuncOtherArgs input + */ + public final Iterable> indexMapFuncOtherArgs; + + /** + * The outputCardinality input + */ + public final Operand outputCardinality; + + /** + * The TmapFuncArgs attribute + */ + public final DataType[] TmapFuncArgs; + + /** + * The TindexMapFuncArgs attribute + */ + public final DataType[] TindexMapFuncArgs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new IndexFlatMapDataset(op), op, Arrays.asList("Tmap_func_args", "Tindex_map_func_args", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int mapFuncOtherArgsLength = op.inputListLength("map_func_other_args"); + mapFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, mapFuncOtherArgsLength)); + inputIndex += mapFuncOtherArgsLength; + int indexMapFuncOtherArgsLength = op.inputListLength("index_map_func_other_args"); + indexMapFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, indexMapFuncOtherArgsLength)); + inputIndex += indexMapFuncOtherArgsLength; + outputCardinality = (Operand) op.input(inputIndex++); + TmapFuncArgs = op.attributes().getAttrTypeList("Tmap_func_args"); + TindexMapFuncArgs = op.attributes().getAttrTypeList("Tindex_map_func_args"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java index a63dbae17c9..1b130e717e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,27 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The InitializeTableFromDataset operation */ +@OpMetadata( + opType = InitializeTableFromDataset.OP_NAME, + inputsClass = InitializeTableFromDataset.Inputs.class +) @Operator( group = "data" ) @@ -38,16 +47,16 @@ public final class InitializeTableFromDataset extends RawOp { */ public static final String OP_NAME = "InitializeTableFromDataset"; - private InitializeTableFromDataset(Operation operation) { - super(operation); + public InitializeTableFromDataset(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new InitializeTableFromDataset operation. * * @param scope current scope - * @param tableHandle the tableHandle value - * @param dataset the dataset value + * @param tableHandle The tableHandle value + * @param dataset The dataset value * @return a new instance of InitializeTableFromDataset */ @Endpoint( @@ -60,4 +69,26 @@ public static InitializeTableFromDataset create(Scope scope, Operand { + /** + * The tableHandle input + */ + public final Operand tableHandle; + + /** + * The dataset input + */ + public final Operand dataset; + + public Inputs(GraphOperation op) { + super(new InitializeTableFromDataset(op), op, Arrays.asList()); + int inputIndex = 0; + tableHandle = (Operand) op.input(inputIndex++); + dataset = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InterleaveDataset.java index f9a53cdc80b..4113a6905ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -40,6 +46,10 @@ * InterleaveDataset will interleave sequences of up to {@code block_length} * consecutive elements from {@code cycle_length} input elements. */ +@OpMetadata( + opType = InterleaveDataset.OP_NAME, + inputsClass = InterleaveDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class InterleaveDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private InterleaveDataset(Operation operation) { - super(operation); + public InterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,15 +72,16 @@ private InterleaveDataset(Operation operation) { * Factory method to create a class wrapping a new InterleaveDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param cycleLength the cycleLength value - * @param blockLength the blockLength value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of InterleaveDataset */ @Endpoint( @@ -78,7 +89,8 @@ private InterleaveDataset(Operation operation) { ) public static InterleaveDataset create(Scope scope, Operand inputDataset, Iterable> otherArguments, Operand cycleLength, Operand blockLength, - ConcreteFunction f, List> outputTypes, List outputShapes) { + ConcreteFunction f, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "InterleaveDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(otherArguments)); @@ -91,9 +103,26 @@ public static InterleaveDataset create(Scope scope, Operand inp outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new InterleaveDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -108,4 +137,85 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.InterleaveDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = InterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The cycleLength input + */ + public final Operand cycleLength; + + /** + * The blockLength input + */ + public final Operand blockLength; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new InterleaveDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + cycleLength = (Operand) op.input(inputIndex++); + blockLength = (Operand) op.input(inputIndex++); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java index 455c8628554..d116c721b3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The IteratorV2 operation */ +@OpMetadata( + opType = Iterator.OP_NAME, + inputsClass = Iterator.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class Iterator extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private Iterator(Operation operation) { - super(operation); + public Iterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,10 +65,10 @@ private Iterator(Operation operation) { * Factory method to create a class wrapping a new IteratorV2 operation. * * @param scope current scope - * @param sharedName the value of the sharedName property - * @param container the value of the container property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param sharedName The value of the sharedName attribute + * @param container The value of the container attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of Iterator */ @Endpoint( @@ -92,4 +102,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = Iterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The sharedName attribute + */ + public final String sharedName; + + /** + * The container attribute + */ + public final String container; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new Iterator(op), op, Arrays.asList("shared_name", "container", "output_types", "output_shapes")); + int inputIndex = 0; + sharedName = op.attributes().getAttrString("shared_name"); + container = op.attributes().getAttrString("container"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java index 8d05ee3163c..e8504283d32 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The IteratorFromStringHandleV2 operation */ +@OpMetadata( + opType = IteratorFromStringHandle.OP_NAME, + inputsClass = IteratorFromStringHandle.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorFromStringHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class IteratorFromStringHandle extends RawOp implements Operand resourceHandle; @SuppressWarnings("unchecked") - private IteratorFromStringHandle(Operation operation) { - super(operation); + public IteratorFromStringHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resourceHandle = operation.output(outputIdx++); } @@ -53,8 +66,8 @@ private IteratorFromStringHandle(Operation operation) { * Factory method to create a class wrapping a new IteratorFromStringHandleV2 operation. * * @param scope current scope - * @param stringHandle the stringHandle value - * @param outputTypes the value of the outputTypes property + * @param stringHandle The stringHandle value + * @param outputTypes The value of the outputTypes attribute * @param options carries optional attribute values * @return a new instance of IteratorFromStringHandle */ @@ -96,7 +109,7 @@ public static Options outputShapes(List outputShapes) { * @param outputShapes the outputShapes option * @return this Options instance. */ - public static Options outputShapes(Shape[] outputShapes) { + public static Options outputShapes(Shape... outputShapes) { return new Options().outputShapes(outputShapes); } @@ -146,4 +159,32 @@ public Options outputShapes(Shape... outputShapes) { return this; } } + + @OpInputsMetadata( + outputsClass = IteratorFromStringHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The stringHandle input + */ + public final Operand stringHandle; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new IteratorFromStringHandle(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + stringHandle = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java index d772a2e5066..a30963f9e6d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Returns the name of the device on which {@code resource} has been placed. */ +@OpMetadata( + opType = IteratorGetDevice.OP_NAME, + inputsClass = IteratorGetDevice.Inputs.class +) +@Operator( + group = "data" +) public final class IteratorGetDevice extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class IteratorGetDevice extends RawOp implements Operand { private Output device; - private IteratorGetDevice(Operation operation) { - super(operation); + public IteratorGetDevice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; device = operation.output(outputIdx++); } @@ -48,7 +61,7 @@ private IteratorGetDevice(Operation operation) { * Factory method to create a class wrapping a new IteratorGetDevice operation. * * @param scope current scope - * @param resource the resource value + * @param resource The resource value * @return a new instance of IteratorGetDevice */ @Endpoint( @@ -73,4 +86,20 @@ public Output device() { public Output asOutput() { return device; } + + @OpInputsMetadata( + outputsClass = IteratorGetDevice.class + ) + public static class Inputs extends RawOpInputs { + /** + * The resource input + */ + public final Operand resource; + + public Inputs(GraphOperation op) { + super(new IteratorGetDevice(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetModelProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetModelProto.java new file mode 100644 index 00000000000..1ad0de4c183 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetModelProto.java @@ -0,0 +1,102 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Returns the serialized model proto of an iterator resource. + * Returns the serialized model proto of an iterator resource. + */ +@OpMetadata( + opType = IteratorGetModelProto.OP_NAME, + inputsClass = IteratorGetModelProto.Inputs.class +) +public final class IteratorGetModelProto extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetModelProto"; + + private Output modelProto; + + public IteratorGetModelProto(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + modelProto = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IteratorGetModelProto operation. + * + * @param scope current scope + * @param iterator An resource from an dataset iterator. + * @return a new instance of IteratorGetModelProto + */ + @Endpoint( + describeByClass = true + ) + public static IteratorGetModelProto create(Scope scope, Operand iterator) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IteratorGetModelProto"); + opBuilder.addInput(iterator.asOutput()); + return new IteratorGetModelProto(opBuilder.build()); + } + + /** + * Gets modelProto. + * A serialized model proto. + * @return modelProto. + */ + public Output modelProto() { + return modelProto; + } + + @Override + public Output asOutput() { + return modelProto; + } + + @OpInputsMetadata( + outputsClass = IteratorGetModelProto.class + ) + public static class Inputs extends RawOpInputs { + /** + * An resource from an dataset iterator. + */ + public final Operand iterator; + + public Inputs(GraphOperation op) { + super(new IteratorGetModelProto(op), op, Arrays.asList()); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java index 5ef82bb3a3d..ebc775394ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Gets the next output from the given iterator . */ +@OpMetadata( + opType = IteratorGetNext.OP_NAME, + inputsClass = IteratorGetNext.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +56,8 @@ public final class IteratorGetNext extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private IteratorGetNext(Operation operation) { - super(operation); + public IteratorGetNext(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -59,9 +68,9 @@ private IteratorGetNext(Operation operation) { * Factory method to create a class wrapping a new IteratorGetNext operation. * * @param scope current scope - * @param iterator the iterator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNext */ @Endpoint( @@ -94,4 +103,32 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = IteratorGetNext.class + ) + public static class Inputs extends RawOpInputs { + /** + * The iterator input + */ + public final Operand iterator; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new IteratorGetNext(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java index 87cd3ef37ea..5b7e83de759 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Gets the next output from the given iterator as an Optional variant. */ +@OpMetadata( + opType = IteratorGetNextAsOptional.OP_NAME, + inputsClass = IteratorGetNextAsOptional.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class IteratorGetNextAsOptional extends RawOp implements Operand optional; @SuppressWarnings("unchecked") - private IteratorGetNextAsOptional(Operation operation) { - super(operation); + public IteratorGetNextAsOptional(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; optional = operation.output(outputIdx++); } @@ -55,9 +65,9 @@ private IteratorGetNextAsOptional(Operation operation) { * Factory method to create a class wrapping a new IteratorGetNextAsOptional operation. * * @param scope current scope - * @param iterator the iterator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNextAsOptional */ @Endpoint( @@ -90,4 +100,32 @@ public Output optional() { public Output asOutput() { return (Output) optional; } + + @OpInputsMetadata( + outputsClass = IteratorGetNextAsOptional.class + ) + public static class Inputs extends RawOpInputs { + /** + * The iterator input + */ + public final Operand iterator; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new IteratorGetNextAsOptional(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java index 018f28dead3..93efb318343 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,6 +44,10 @@ * the calling thread is not a member of the thread pool used to execute parallel * operations (e.g. in eager mode). */ +@OpMetadata( + opType = IteratorGetNextSync.OP_NAME, + inputsClass = IteratorGetNextSync.Inputs.class +) @Operator( group = "data" ) @@ -51,8 +60,8 @@ public final class IteratorGetNextSync extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private IteratorGetNextSync(Operation operation) { - super(operation); + public IteratorGetNextSync(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -63,9 +72,9 @@ private IteratorGetNextSync(Operation operation) { * Factory method to create a class wrapping a new IteratorGetNextSync operation. * * @param scope current scope - * @param iterator the iterator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNextSync */ @Endpoint( @@ -98,4 +107,32 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = IteratorGetNextSync.class + ) + public static class Inputs extends RawOpInputs { + /** + * The iterator input + */ + public final Operand iterator; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new IteratorGetNextSync(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java index 4973206deba..4431f25765e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Converts the given {@code resource_handle} representing an iterator to a string. */ +@OpMetadata( + opType = IteratorToStringHandle.OP_NAME, + inputsClass = IteratorToStringHandle.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class IteratorToStringHandle extends RawOp implements Operand stringHandle; - private IteratorToStringHandle(Operation operation) { - super(operation); + public IteratorToStringHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; stringHandle = operation.output(outputIdx++); } @@ -78,4 +87,20 @@ public Output stringHandle() { public Output asOutput() { return stringHandle; } + + @OpInputsMetadata( + outputsClass = IteratorToStringHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to an iterator resource. + */ + public final Operand resourceHandle; + + public Inputs(GraphOperation op) { + super(new IteratorToStringHandle(op), op, Arrays.asList()); + int inputIndex = 0; + resourceHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java index cad8616daa3..d8b6719325e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -42,6 +48,10 @@ *

    LMDB uses different file formats on big- and little-endian machines. * {@code data.LMDBDataset} can only read files in the format of the host machine. */ +@OpMetadata( + opType = LMDBDataset.OP_NAME, + inputsClass = LMDBDataset.Inputs.class +) @Operator( group = "data" ) @@ -54,8 +64,8 @@ public final class LMDBDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private LMDBDataset(Operation operation) { - super(operation); + public LMDBDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -66,8 +76,8 @@ private LMDBDataset(Operation operation) { * @param scope current scope * @param filenames A scalar or a vector containing the name(s) of the binary file(s) to be * read. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LMDBDataset */ @Endpoint( @@ -100,4 +110,33 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = LMDBDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar or a vector containing the name(s) of the binary file(s) to be + * read. + */ + public final Operand filenames; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new LMDBDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java index 73170c4fac0..7303a28e26c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. */ +@OpMetadata( + opType = LatencyStatsDataset.OP_NAME, + inputsClass = LatencyStatsDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class LatencyStatsDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private LatencyStatsDataset(Operation operation) { - super(operation); + public LatencyStatsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private LatencyStatsDataset(Operation operation) { * Factory method to create a class wrapping a new LatencyStatsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LatencyStatsDataset */ @Endpoint( @@ -93,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = LatencyStatsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new LatencyStatsDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java index f54fcd92daa..131903f2fc1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear gradients for a LeakyRelu operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = LeakyReluGrad.OP_NAME, + inputsClass = LeakyReluGrad.Inputs.class +) +@Operator( + group = "data" +) public final class LeakyReluGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class LeakyReluGrad extends RawOp implements Ope private Output backprops; - private LeakyReluGrad(Operation operation) { - super(operation); + public LeakyReluGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -118,4 +130,39 @@ public Options alpha(Float alpha) { return this; } } + + @OpInputsMetadata( + outputsClass = LeakyReluGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding LeakyRelu operation. + */ + public final Operand gradients; + + /** + * The features passed as input to the corresponding LeakyRelu operation, + * OR the outputs of that operation (both work equivalently). + */ + public final Operand features; + + /** + * The alpha attribute + */ + public final float alpha; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LeakyReluGrad<>(op), op, Arrays.asList("alpha", "T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + features = (Operand) op.input(inputIndex++); + alpha = op.attributes().getAttrFloat("alpha"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LegacyParallelInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LegacyParallelInterleaveDataset.java index cde48b6c8ee..51e9cef8460 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LegacyParallelInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LegacyParallelInterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -41,6 +47,10 @@ * allows the training step to proceed so long as some data is available. *

    !! WARNING !! This dataset is not deterministic! */ +@OpMetadata( + opType = LegacyParallelInterleaveDataset.OP_NAME, + inputsClass = LegacyParallelInterleaveDataset.Inputs.class +) @Operator( group = "data" ) @@ -53,8 +63,8 @@ public final class LegacyParallelInterleaveDataset extends RawOp implements Oper private Output handle; @SuppressWarnings("unchecked") - private LegacyParallelInterleaveDataset(Operation operation) { - super(operation); + public LegacyParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -63,17 +73,17 @@ private LegacyParallelInterleaveDataset(Operation operation) { * Factory method to create a class wrapping a new LegacyParallelInterleaveDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param cycleLength the cycleLength value - * @param blockLength the blockLength value - * @param bufferOutputElements the bufferOutputElements value - * @param prefetchInputElements the prefetchInputElements value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value + * @param bufferOutputElements The bufferOutputElements value + * @param prefetchInputElements The prefetchInputElements value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of LegacyParallelInterleaveDataset */ @@ -105,6 +115,9 @@ public static LegacyParallelInterleaveDataset create(Scope scope, if (opts.deterministic != null) { opBuilder.setAttr("deterministic", opts.deterministic); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new LegacyParallelInterleaveDataset(opBuilder.build()); @@ -120,6 +133,16 @@ public static Options deterministic(String deterministic) { return new Options().deterministic(deterministic); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -141,6 +164,8 @@ public Output asOutput() { public static class Options { private String deterministic; + private String metadata; + private Options() { } @@ -154,5 +179,94 @@ public Options deterministic(String deterministic) { this.deterministic = deterministic; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = LegacyParallelInterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The cycleLength input + */ + public final Operand cycleLength; + + /** + * The blockLength input + */ + public final Operand blockLength; + + /** + * The bufferOutputElements input + */ + public final Operand bufferOutputElements; + + /** + * The prefetchInputElements input + */ + public final Operand prefetchInputElements; + + /** + * The deterministic attribute + */ + public final String deterministic; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new LegacyParallelInterleaveDataset(op), op, Arrays.asList("deterministic", "Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + cycleLength = (Operand) op.input(inputIndex++); + blockLength = (Operand) op.input(inputIndex++); + bufferOutputElements = (Operand) op.input(inputIndex++); + prefetchInputElements = (Operand) op.input(inputIndex++); + deterministic = op.attributes().getAttrString("deterministic"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListDataset.java new file mode 100644 index 00000000000..76db7fe0eac --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListDataset.java @@ -0,0 +1,184 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset that emits each of {@code tensors} once. + */ +@OpMetadata( + opType = ListDataset.OP_NAME, + inputsClass = ListDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class ListDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ListDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ListDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ListDataset operation. + * + * @param scope current scope + * @param tensors The tensors value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ListDataset + */ + @Endpoint( + describeByClass = true + ) + public static ListDataset create(Scope scope, Iterable> tensors, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ListDataset"); + opBuilder.addInputList(Operands.asOutputs(tensors)); + 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.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new ListDataset(opBuilder.build()); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ListDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ListDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensors input + */ + public final Iterable> tensors; + + /** + * The TinputTypes attribute + */ + public final DataType[] TinputTypes; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ListDataset(op), op, Arrays.asList("Tinput_types", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + int tensorsLength = op.inputListLength("tensors"); + tensors = Arrays.asList((Operand[]) op.inputList(inputIndex, tensorsLength)); + inputIndex += tensorsLength; + TinputTypes = op.attributes().getAttrTypeList("Tinput_types"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListSnapshotChunksDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListSnapshotChunksDataset.java new file mode 100644 index 00000000000..0fe1bbb447b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ListSnapshotChunksDataset.java @@ -0,0 +1,132 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * The ListSnapshotChunksDataset operation + */ +@OpMetadata( + opType = ListSnapshotChunksDataset.OP_NAME, + inputsClass = ListSnapshotChunksDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class ListSnapshotChunksDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ListSnapshotChunksDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ListSnapshotChunksDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ListSnapshotChunksDataset operation. + * + * @param scope current scope + * @param snapshotPath The snapshotPath value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ListSnapshotChunksDataset + */ + @Endpoint( + describeByClass = true + ) + public static ListSnapshotChunksDataset create(Scope scope, Operand snapshotPath, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ListSnapshotChunksDataset"); + opBuilder.addInput(snapshotPath.asOutput()); + 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 ListSnapshotChunksDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = ListSnapshotChunksDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The snapshotPath input + */ + public final Operand snapshotPath; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ListSnapshotChunksDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + snapshotPath = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LoadDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LoadDataset.java index 0d484822f0c..53e32585c1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LoadDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LoadDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,15 +28,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The LoadDataset operation */ +@OpMetadata( + opType = LoadDataset.OP_NAME, + inputsClass = LoadDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class LoadDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private LoadDataset(Operation operation) { - super(operation); + public LoadDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,11 +67,11 @@ private LoadDataset(Operation operation) { * Factory method to create a class wrapping a new LoadDataset operation. * * @param scope current scope - * @param path the path value - * @param readerFuncOtherArgs the readerFuncOtherArgs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @param readerFunc the value of the readerFunc property + * @param path The path value + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param readerFunc The value of the readerFunc attribute * @param options carries optional attribute values * @return a new instance of LoadDataset */ @@ -136,4 +146,52 @@ public Options compression(String compression) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The path input + */ + public final Operand path; + + /** + * The readerFuncOtherArgs input + */ + public final Iterable> readerFuncOtherArgs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The compression attribute + */ + public final String compression; + + /** + * The TreaderFuncArgs attribute + */ + public final DataType[] TreaderFuncArgs; + + public Inputs(GraphOperation op) { + super(new LoadDataset(op), op, Arrays.asList("output_types", "output_shapes", "compression", "Treader_func_args")); + int inputIndex = 0; + path = (Operand) op.input(inputIndex++); + int readerFuncOtherArgsLength = op.inputListLength("reader_func_other_args"); + readerFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, readerFuncOtherArgsLength)); + inputIndex += readerFuncOtherArgsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + compression = op.attributes().getAttrString("compression"); + TreaderFuncArgs = op.attributes().getAttrTypeList("Treader_func_args"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java index e4a39b2f495..7abecc2744d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ * This operation may be executed multiple times. Each execution will reset the * iterator in {@code iterator} to the first element of {@code dataset}. */ +@OpMetadata( + opType = MakeIterator.OP_NAME, + inputsClass = MakeIterator.Inputs.class +) @Operator( group = "data" ) @@ -40,16 +49,16 @@ public final class MakeIterator extends RawOp { */ public static final String OP_NAME = "MakeIterator"; - private MakeIterator(Operation operation) { - super(operation); + public MakeIterator(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new MakeIterator operation. * * @param scope current scope - * @param dataset the dataset value - * @param iterator the iterator value + * @param dataset The dataset value + * @param iterator The iterator value * @return a new instance of MakeIterator */ @Endpoint( @@ -62,4 +71,26 @@ public static MakeIterator create(Scope scope, Operand dataset, opBuilder.addInput(iterator.asOutput()); return new MakeIterator(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = MakeIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The dataset input + */ + public final Operand dataset; + + /** + * The iterator input + */ + public final Operand iterator; + + public Inputs(GraphOperation op) { + super(new MakeIterator(op), op, Arrays.asList()); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + iterator = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapAndBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapAndBatchDataset.java index f45037d548f..ec935a6f8ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapAndBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapAndBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -40,6 +46,10 @@ *

    Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up * to {@code batch_size * num_parallel_batches} copies of {@code f} in parallel. */ +@OpMetadata( + opType = MapAndBatchDataset.OP_NAME, + inputsClass = MapAndBatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class MapAndBatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private MapAndBatchDataset(Operation operation) { - super(operation); + public MapAndBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -74,8 +84,8 @@ private MapAndBatchDataset(Operation operation) { * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. * @param f A function to apply to the outputs of {@code input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapAndBatchDataset */ @@ -104,6 +114,9 @@ public static MapAndBatchDataset create(Scope scope, Operand in if (opts.preserveCardinality != null) { opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new MapAndBatchDataset(opBuilder.build()); @@ -119,6 +132,16 @@ public static Options preserveCardinality(Boolean preserveCardinality) { return new Options().preserveCardinality(preserveCardinality); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -140,6 +163,8 @@ public Output asOutput() { public static class Options { private Boolean preserveCardinality; + private String metadata; + private Options() { } @@ -153,5 +178,94 @@ public Options preserveCardinality(Boolean preserveCardinality) { this.preserveCardinality = preserveCardinality; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MapAndBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when building a closure + * for {@code f}. + */ + public final Iterable> otherArguments; + + /** + * A scalar representing the number of elements to accumulate in a + * batch. It determines the number of concurrent invocations of {@code f} that process + * elements from {@code input_dataset} in parallel. + */ + public final Operand batchSize; + + /** + * A scalar representing the maximum number of parallel invocations of the {@code map_fn} + * function. Applying the {@code map_fn} on consecutive input elements in parallel has + * the potential to improve input pipeline throughput. + */ + public final Operand numParallelCalls; + + /** + * A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + */ + public final Operand dropRemainder; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new MapAndBatchDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "preserve_cardinality", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + batchSize = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapDataset.java index 872980cca18..4b6e7355a51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MapDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. */ +@OpMetadata( + opType = MapDataset.OP_NAME, + inputsClass = MapDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class MapDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private MapDataset(Operation operation) { - super(operation); + public MapDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,11 +66,11 @@ private MapDataset(Operation operation) { * Factory method to create a class wrapping a new MapDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapDataset */ @@ -88,6 +98,12 @@ public static MapDataset create(Scope scope, Operand inputDatas if (opts.preserveCardinality != null) { opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); } + if (opts.forceSynchronous != null) { + opBuilder.setAttr("force_synchronous", opts.forceSynchronous); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new MapDataset(opBuilder.build()); @@ -113,6 +129,26 @@ public static Options preserveCardinality(Boolean preserveCardinality) { return new Options().preserveCardinality(preserveCardinality); } + /** + * Sets the forceSynchronous option. + * + * @param forceSynchronous the forceSynchronous option + * @return this Options instance. + */ + public static Options forceSynchronous(Boolean forceSynchronous) { + return new Options().forceSynchronous(forceSynchronous); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -136,6 +172,10 @@ public static class Options { private Boolean preserveCardinality; + private Boolean forceSynchronous; + + private String metadata; + private Options() { } @@ -160,5 +200,93 @@ public Options preserveCardinality(Boolean preserveCardinality) { this.preserveCardinality = preserveCardinality; return this; } + + /** + * Sets the forceSynchronous option. + * + * @param forceSynchronous the forceSynchronous option + * @return this Options instance. + */ + public Options forceSynchronous(Boolean forceSynchronous) { + this.forceSynchronous = forceSynchronous; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The useInterOpParallelism attribute + */ + public final boolean useInterOpParallelism; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + /** + * The forceSynchronous attribute + */ + public final boolean forceSynchronous; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new MapDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "use_inter_op_parallelism", "preserve_cardinality", "force_synchronous", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + useInterOpParallelism = op.attributes().getAttrBool("use_inter_op_parallelism"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + forceSynchronous = op.attributes().getAttrBool("force_synchronous"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java index 8c7d3c019e3..3226a17d2a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * The MatchingFilesDataset operation */ +@OpMetadata( + opType = MatchingFilesDataset.OP_NAME, + inputsClass = MatchingFilesDataset.Inputs.class +) @Operator( group = "data" ) @@ -43,8 +52,8 @@ public final class MatchingFilesDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private MatchingFilesDataset(Operation operation) { - super(operation); + public MatchingFilesDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -53,7 +62,7 @@ private MatchingFilesDataset(Operation operation) { * Factory method to create a class wrapping a new MatchingFilesDataset operation. * * @param scope current scope - * @param patterns the patterns value + * @param patterns The patterns value * @return a new instance of MatchingFilesDataset */ @Endpoint( @@ -79,4 +88,20 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = MatchingFilesDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The patterns input + */ + public final Operand patterns; + + public Inputs(GraphOperation op) { + super(new MatchingFilesDataset(op), op, Arrays.asList()); + int inputIndex = 0; + patterns = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java index d32f1f39ae5..1ffcec71184 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that overrides the maximum intra-op parallelism. */ +@OpMetadata( + opType = MaxIntraOpParallelismDataset.OP_NAME, + inputsClass = MaxIntraOpParallelismDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class MaxIntraOpParallelismDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); + public MaxIntraOpParallelismDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private MaxIntraOpParallelismDataset(Operation operation) { * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of MaxIntraOpParallelismDataset */ @Endpoint( @@ -94,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = MaxIntraOpParallelismDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * Identifies the maximum intra-op parallelism to use. + */ + public final Operand maxIntraOpParallelism; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new MaxIntraOpParallelismDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + maxIntraOpParallelism = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } 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 0d200d35e3c..74bb242bb76 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Identity transformation that models performance. * Identity transformation that models performance. */ +@OpMetadata( + opType = ModelDataset.OP_NAME, + inputsClass = ModelDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class ModelDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ModelDataset(Operation operation) { - super(operation); + public ModelDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,8 +67,8 @@ private ModelDataset(Operation operation) { * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ModelDataset */ @@ -182,4 +192,50 @@ public Options ramBudget(Long ramBudget) { return this; } } + + @OpInputsMetadata( + outputsClass = ModelDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * The algorithm attribute + */ + public final long algorithm; + + /** + * The cpuBudget attribute + */ + public final long cpuBudget; + + /** + * The ramBudget attribute + */ + public final long ramBudget; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ModelDataset(op), op, Arrays.asList("algorithm", "cpu_budget", "ram_budget", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + algorithm = op.attributes().getAttrInt("algorithm"); + cpuBudget = op.attributes().getAttrInt("cpu_budget"); + ramBudget = op.attributes().getAttrInt("ram_budget"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java index 41b1fe1e662..467acc47e4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a MultiDeviceIterator resource. */ +@OpMetadata( + opType = MultiDeviceIterator.OP_NAME, + inputsClass = MultiDeviceIterator.Inputs.class +) +@Operator( + group = "data" +) public final class MultiDeviceIterator extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class MultiDeviceIterator extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private MultiDeviceIterator(Operation operation) { - super(operation); + public MultiDeviceIterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -96,4 +110,46 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = MultiDeviceIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of devices the iterator works across. + */ + public final String[] devices; + + /** + * If non-empty, this resource will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + /** + * If non-empty, this resource is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * The type list for the return values. + */ + public final DataType[] outputTypes; + + /** + * The list of shapes being produced. + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new MultiDeviceIterator(op), op, Arrays.asList("devices", "shared_name", "container", "output_types", "output_shapes")); + int inputIndex = 0; + devices = op.attributes().getAttrStringList("devices"); + sharedName = op.attributes().getAttrString("shared_name"); + container = op.attributes().getAttrString("container"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java index a1c0b1e529b..20cfc4f1010 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Generates a MultiDeviceIterator resource from its provided string handle. */ +@OpMetadata( + opType = MultiDeviceIteratorFromStringHandle.OP_NAME, + inputsClass = MultiDeviceIteratorFromStringHandle.Inputs.class +) +@Operator( + group = "data" +) public final class MultiDeviceIteratorFromStringHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class MultiDeviceIteratorFromStringHandle extends RawOp implements private Output multiDeviceIterator; @SuppressWarnings("unchecked") - private MultiDeviceIteratorFromStringHandle(Operation operation) { - super(operation); + public MultiDeviceIteratorFromStringHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; multiDeviceIterator = operation.output(outputIdx++); } @@ -96,7 +109,7 @@ public static Options outputShapes(List outputShapes) { * @param outputShapes The list of shapes being produced. * @return this Options instance. */ - public static Options outputShapes(Shape[] outputShapes) { + public static Options outputShapes(Shape... outputShapes) { return new Options().outputShapes(outputShapes); } @@ -146,4 +159,32 @@ public Options outputShapes(Shape... outputShapes) { return this; } } + + @OpInputsMetadata( + outputsClass = MultiDeviceIteratorFromStringHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * String representing the resource. + */ + public final Operand stringHandle; + + /** + * The type list for the return values. + */ + public final DataType[] outputTypes; + + /** + * The list of shapes being produced. + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new MultiDeviceIteratorFromStringHandle(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + stringHandle = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java index 5015e405b51..642935599c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -36,6 +42,13 @@ /** * Gets next element for the provided shard number. */ +@OpMetadata( + opType = MultiDeviceIteratorGetNextFromShard.OP_NAME, + inputsClass = MultiDeviceIteratorGetNextFromShard.Inputs.class +) +@Operator( + group = "data" +) public final class MultiDeviceIteratorGetNextFromShard extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +58,8 @@ public final class MultiDeviceIteratorGetNextFromShard extends RawOp implements private List> components; @SuppressWarnings("unchecked") - private MultiDeviceIteratorGetNextFromShard(Operation operation) { - super(operation); + public MultiDeviceIteratorGetNextFromShard(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -98,4 +111,44 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = MultiDeviceIteratorGetNextFromShard.class + ) + public static class Inputs extends RawOpInputs { + /** + * A MultiDeviceIterator resource. + */ + public final Operand multiDeviceIterator; + + /** + * Integer representing which shard to fetch data for. + */ + public final Operand shardNum; + + /** + * Which incarnation of the MultiDeviceIterator is running. + */ + public final Operand incarnationId; + + /** + * The type list for the return values. + */ + public final DataType[] outputTypes; + + /** + * The list of shapes being produced. + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new MultiDeviceIteratorGetNextFromShard(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + multiDeviceIterator = (Operand) op.input(inputIndex++); + shardNum = (Operand) op.input(inputIndex++); + incarnationId = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java index aa62b899a44..8cbc7b35693 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Initializes the multi device iterator with the given dataset. */ +@OpMetadata( + opType = MultiDeviceIteratorInit.OP_NAME, + inputsClass = MultiDeviceIteratorInit.Inputs.class +) +@Operator( + group = "data" +) public final class MultiDeviceIteratorInit extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class MultiDeviceIteratorInit extends RawOp implements Operand incarnationId; - private MultiDeviceIteratorInit(Operation operation) { - super(operation); + public MultiDeviceIteratorInit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; incarnationId = operation.output(outputIdx++); } @@ -79,4 +92,32 @@ public Output incarnationId() { public Output asOutput() { return incarnationId; } + + @OpInputsMetadata( + outputsClass = MultiDeviceIteratorInit.class + ) + public static class Inputs extends RawOpInputs { + /** + * Dataset to be iterated upon. + */ + public final Operand dataset; + + /** + * A MultiDeviceIteratorResource. + */ + public final Operand multiDeviceIterator; + + /** + * The maximum size of the host side per device buffer to keep. + */ + public final Operand maxBufferSize; + + public Inputs(GraphOperation op) { + super(new MultiDeviceIteratorInit(op), op, Arrays.asList()); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + multiDeviceIterator = (Operand) op.input(inputIndex++); + maxBufferSize = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java index 99f46b8f444..cc856b4ecc9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Produces a string handle for the given MultiDeviceIterator. */ +@OpMetadata( + opType = MultiDeviceIteratorToStringHandle.OP_NAME, + inputsClass = MultiDeviceIteratorToStringHandle.Inputs.class +) +@Operator( + group = "data" +) public final class MultiDeviceIteratorToStringHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class MultiDeviceIteratorToStringHandle extends RawOp implements Op private Output stringHandle; - private MultiDeviceIteratorToStringHandle(Operation operation) { - super(operation); + public MultiDeviceIteratorToStringHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; stringHandle = operation.output(outputIdx++); } @@ -74,4 +87,20 @@ public Output stringHandle() { public Output asOutput() { return stringHandle; } + + @OpInputsMetadata( + outputsClass = MultiDeviceIteratorToStringHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * A MultiDeviceIterator resource. + */ + public final Operand multiDeviceIterator; + + public Inputs(GraphOperation op) { + super(new MultiDeviceIteratorToStringHandle(op), op, Arrays.asList()); + int inputIndex = 0; + multiDeviceIterator = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java index ed6ce16777e..29769895d14 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The NonSerializableDataset operation */ +@OpMetadata( + opType = NonSerializableDataset.OP_NAME, + inputsClass = NonSerializableDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class NonSerializableDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private NonSerializableDataset(Operation operation) { - super(operation); + public NonSerializableDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,9 +65,9 @@ private NonSerializableDataset(Operation operation) { * Factory method to create a class wrapping a new NonSerializableDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of NonSerializableDataset */ @Endpoint( @@ -90,4 +100,32 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = NonSerializableDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new NonSerializableDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OneShotIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OneShotIterator.java index b37f927dc6d..bd34c84c511 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OneShotIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OneShotIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -50,6 +56,10 @@ * (including fed values) as parameters, and which may be reset multiple * times by rerunning "MakeIterator". */ +@OpMetadata( + opType = OneShotIterator.OP_NAME, + inputsClass = OneShotIterator.Inputs.class +) @Operator( group = "data" ) @@ -62,8 +72,8 @@ public final class OneShotIterator extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private OneShotIterator(Operation operation) { - super(operation); + public OneShotIterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -74,8 +84,8 @@ private OneShotIterator(Operation operation) { * @param scope current scope * @param datasetFactory A function of type {@code () -> DT_VARIANT}, where the returned * DT_VARIANT is a dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of OneShotIterator */ @@ -174,4 +184,38 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = OneShotIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new OneShotIterator(op), op, Arrays.asList("output_types", "output_shapes", "container", "shared_name")); + int inputIndex = 0; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java index d3f4ddb5a42..68ed2850f3c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -36,6 +41,10 @@ * Creates a dataset by applying related optimizations to {@code input_dataset}. * Creates a dataset by applying related optimizations to {@code input_dataset}. */ +@OpMetadata( + opType = OptimizeDataset.OP_NAME, + inputsClass = OptimizeDataset.Inputs.class +) @Operator( group = "data" ) @@ -48,8 +57,8 @@ public final class OptimizeDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private OptimizeDataset(Operation operation) { - super(operation); + public OptimizeDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,8 +71,8 @@ private OptimizeDataset(Operation operation) { * @param optimizationsEnabled A {@code tf.string} vector {@code tf.Tensor} identifying user enabled optimizations. * @param optimizationsDisabled A {@code tf.string} vector {@code tf.Tensor} identifying user disabled optimizations. * @param optimizationsDefault A {@code tf.string} vector {@code tf.Tensor} identifying optimizations by default. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of OptimizeDataset */ @@ -115,7 +124,7 @@ public static Options optimizationConfigs(List optimizationConfigs) { * @param optimizationConfigs the optimizationConfigs option * @return this Options instance. */ - public static Options optimizationConfigs(String[] optimizationConfigs) { + public static Options optimizationConfigs(String... optimizationConfigs) { return new Options().optimizationConfigs(optimizationConfigs); } @@ -165,4 +174,56 @@ public Options optimizationConfigs(String... optimizationConfigs) { return this; } } + + @OpInputsMetadata( + outputsClass = OptimizeDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A {@code tf.string} vector {@code tf.Tensor} identifying user enabled optimizations. + */ + public final Operand optimizationsEnabled; + + /** + * A {@code tf.string} vector {@code tf.Tensor} identifying user disabled optimizations. + */ + public final Operand optimizationsDisabled; + + /** + * A {@code tf.string} vector {@code tf.Tensor} identifying optimizations by default. + */ + public final Operand optimizationsDefault; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The optimizationConfigs attribute + */ + public final String[] optimizationConfigs; + + public Inputs(GraphOperation op) { + super(new OptimizeDataset(op), op, Arrays.asList("output_types", "output_shapes", "optimization_configs")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + optimizationsEnabled = (Operand) op.input(inputIndex++); + optimizationsDisabled = (Operand) op.input(inputIndex++); + optimizationsDefault = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + optimizationConfigs = op.attributes().getAttrStringList("optimization_configs"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java index dc91514ef43..c5e7ccb81a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Constructs an Optional variant from a tuple of tensors. */ +@OpMetadata( + opType = OptionalFromValue.OP_NAME, + inputsClass = OptionalFromValue.Inputs.class +) @Operator( group = "data" ) @@ -43,8 +53,8 @@ public final class OptionalFromValue extends RawOp implements Operand { private Output optional; @SuppressWarnings("unchecked") - private OptionalFromValue(Operation operation) { - super(operation); + public OptionalFromValue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; optional = operation.output(outputIdx++); } @@ -53,7 +63,7 @@ private OptionalFromValue(Operation operation) { * Factory method to create a class wrapping a new OptionalFromValue operation. * * @param scope current scope - * @param components the components value + * @param components The components value * @return a new instance of OptionalFromValue */ @Endpoint( @@ -79,4 +89,28 @@ public Output optional() { public Output asOutput() { return (Output) optional; } + + @OpInputsMetadata( + outputsClass = OptionalFromValue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The components input + */ + public final Iterable> components; + + /** + * The ToutputTypes attribute + */ + public final DataType[] ToutputTypes; + + public Inputs(GraphOperation op) { + super(new OptionalFromValue(op), op, Arrays.asList("Toutput_types")); + int inputIndex = 0; + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + ToutputTypes = op.attributes().getAttrTypeList("Toutput_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java index 2ab14866899..2cff5434803 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns the value stored in an Optional variant or raises an error if none exists. */ +@OpMetadata( + opType = OptionalGetValue.OP_NAME, + inputsClass = OptionalGetValue.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +56,8 @@ public final class OptionalGetValue extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private OptionalGetValue(Operation operation) { - super(operation); + public OptionalGetValue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -59,9 +68,9 @@ private OptionalGetValue(Operation operation) { * Factory method to create a class wrapping a new OptionalGetValue operation. * * @param scope current scope - * @param optional the optional value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param optional The optional value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of OptionalGetValue */ @Endpoint( @@ -94,4 +103,32 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = OptionalGetValue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The optional input + */ + public final Operand optional; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new OptionalGetValue(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + optional = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java index 73b80f6e5a8..20c8886190d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Returns true if and only if the given Optional variant has a value. */ +@OpMetadata( + opType = OptionalHasValue.OP_NAME, + inputsClass = OptionalHasValue.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class OptionalHasValue extends RawOp implements Operand { private Output hasValue; - private OptionalHasValue(Operation operation) { - super(operation); + public OptionalHasValue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; hasValue = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private OptionalHasValue(Operation operation) { * Factory method to create a class wrapping a new OptionalHasValue operation. * * @param scope current scope - * @param optional the optional value + * @param optional The optional value * @return a new instance of OptionalHasValue */ @Endpoint( @@ -77,4 +86,20 @@ public Output hasValue() { public Output asOutput() { return hasValue; } + + @OpInputsMetadata( + outputsClass = OptionalHasValue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The optional input + */ + public final Operand optional; + + public Inputs(GraphOperation op) { + super(new OptionalHasValue(op), op, Arrays.asList()); + int inputIndex = 0; + optional = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java index 8f19d2f0052..1aa80a4402d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates an Optional variant with no value. */ +@OpMetadata( + opType = OptionalNone.OP_NAME, + inputsClass = OptionalNone.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class OptionalNone extends RawOp implements Operand { private Output optional; @SuppressWarnings("unchecked") - private OptionalNone(Operation operation) { - super(operation); + public OptionalNone(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; optional = operation.output(outputIdx++); } @@ -76,4 +85,14 @@ public Output optional() { public Output asOutput() { return (Output) optional; } + + @OpInputsMetadata( + outputsClass = OptionalNone.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new OptionalNone(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionsDataset.java index ed6d4c382b5..529b1b93eaa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionsDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset by attaching tf.data.Options to {@code input_dataset}. */ +@OpMetadata( + opType = OptionsDataset.OP_NAME, + inputsClass = OptionsDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class OptionsDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private OptionsDataset(Operation operation) { - super(operation); + public OptionsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,16 +67,17 @@ private OptionsDataset(Operation operation) { * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. * @param serializedOptions A {@code tf.string} scalar {@code tf.Tensor} of serialized {@code tf.data.Options} protocol buffer. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of OptionsDataset */ @Endpoint( describeByClass = true ) public static OptionsDataset create(Scope scope, Operand inputDataset, - String serializedOptions, List> outputTypes, - List outputShapes) { + String serializedOptions, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "OptionsDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.setAttr("serialized_options", serializedOptions); @@ -76,9 +87,26 @@ public static OptionsDataset create(Scope scope, Operand inputD outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new OptionsDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -93,4 +121,65 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.OptionsDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = OptionsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A {@code tf.string} scalar {@code tf.Tensor} of serialized {@code tf.data.Options} protocol buffer. + */ + public final String serializedOptions; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new OptionsDataset(op), op, Arrays.asList("serialized_options", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + serializedOptions = op.attributes().getAttrString("serialized_options"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java index 9bd23430f4e..0974d997119 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ /** * Creates a dataset that batches and pads {@code batch_size} elements from the input. */ +@OpMetadata( + opType = PaddedBatchDataset.OP_NAME, + inputsClass = PaddedBatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class PaddedBatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private PaddedBatchDataset(Operation operation) { - super(operation); + public PaddedBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,7 +67,7 @@ private PaddedBatchDataset(Operation operation) { * Factory method to create a class wrapping a new PaddedBatchDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param batchSize A scalar representing the number of elements to accumulate in a * batch. * @param paddedShapes A list of int64 tensors representing the desired padded shapes @@ -68,7 +78,7 @@ private PaddedBatchDataset(Operation operation) { * each of the outputs. * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. - * @param outputShapes the value of the outputShapes property + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of PaddedBatchDataset */ @@ -95,6 +105,9 @@ public static PaddedBatchDataset create(Scope scope, Operand in if (opts.parallelCopy != null) { opBuilder.setAttr("parallel_copy", opts.parallelCopy); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new PaddedBatchDataset(opBuilder.build()); @@ -110,6 +123,16 @@ public static Options parallelCopy(Boolean parallelCopy) { return new Options().parallelCopy(parallelCopy); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -131,6 +154,8 @@ public Output asOutput() { public static class Options { private Boolean parallelCopy; + private String metadata; + private Options() { } @@ -144,5 +169,90 @@ public Options parallelCopy(Boolean parallelCopy) { this.parallelCopy = parallelCopy; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = PaddedBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements to accumulate in a + * batch. + */ + public final Operand batchSize; + + /** + * A list of int64 tensors representing the desired padded shapes + * of the corresponding output components. These shapes may be partially + * specified, using {@code -1} to indicate that a particular dimension should be + * padded to the maximum size of all batch elements. + */ + public final Iterable> paddedShapes; + + /** + * A list of scalars containing the padding value to use for + * each of the outputs. + */ + public final Iterable> paddingValues; + + /** + * A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + */ + public final Operand dropRemainder; + + /** + * The parallelCopy attribute + */ + public final boolean parallelCopy; + + /** + * The ToutputTypes attribute + */ + public final DataType[] ToutputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new PaddedBatchDataset(op), op, Arrays.asList("parallel_copy", "Toutput_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSize = (Operand) op.input(inputIndex++); + int paddedShapesLength = op.inputListLength("padded_shapes"); + paddedShapes = Arrays.asList((Operand[]) op.inputList(inputIndex, paddedShapesLength)); + inputIndex += paddedShapesLength; + int paddingValuesLength = op.inputListLength("padding_values"); + paddingValues = Arrays.asList((Operand[]) op.inputList(inputIndex, paddingValuesLength)); + inputIndex += paddingValuesLength; + dropRemainder = (Operand) op.input(inputIndex++); + parallelCopy = op.attributes().getAttrBool("parallel_copy"); + ToutputTypes = op.attributes().getAttrTypeList("Toutput_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelBatchDataset.java index 9d80c3b91f7..55b54d5cf24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ /** * The ParallelBatchDataset operation */ +@OpMetadata( + opType = ParallelBatchDataset.OP_NAME, + inputsClass = ParallelBatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -47,8 +57,8 @@ public final class ParallelBatchDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private ParallelBatchDataset(Operation operation) { - super(operation); + public ParallelBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -57,12 +67,12 @@ private ParallelBatchDataset(Operation operation) { * Factory method to create a class wrapping a new ParallelBatchDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param batchSize the batchSize value - * @param numParallelCalls the numParallelCalls value - * @param dropRemainder the dropRemainder value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param batchSize The batchSize value + * @param numParallelCalls The numParallelCalls value + * @param dropRemainder The dropRemainder value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ParallelBatchDataset */ @@ -91,6 +101,9 @@ public static ParallelBatchDataset create(Scope scope, Operand if (opts.deterministic != null) { opBuilder.setAttr("deterministic", opts.deterministic); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ParallelBatchDataset(opBuilder.build()); @@ -116,6 +129,16 @@ public static Options deterministic(String deterministic) { return new Options().deterministic(deterministic); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -139,6 +162,8 @@ public static class Options { private String deterministic; + private String metadata; + private Options() { } @@ -163,5 +188,80 @@ public Options deterministic(String deterministic) { this.deterministic = deterministic; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ParallelBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The batchSize input + */ + public final Operand batchSize; + + /** + * The numParallelCalls input + */ + public final Operand numParallelCalls; + + /** + * The dropRemainder input + */ + public final Operand dropRemainder; + + /** + * The parallelCopy attribute + */ + public final boolean parallelCopy; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The deterministic attribute + */ + public final String deterministic; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ParallelBatchDataset(op), op, Arrays.asList("parallel_copy", "output_types", "output_shapes", "deterministic", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSize = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + parallelCopy = op.attributes().getAttrBool("parallel_copy"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + deterministic = op.attributes().getAttrString("deterministic"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelFilterDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelFilterDataset.java new file mode 100644 index 00000000000..f87d2a27269 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelFilterDataset.java @@ -0,0 +1,262 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * Creates a dataset containing elements of {@code input_dataset} matching {@code predicate}. + * The {@code predicate} function must return a scalar boolean and accept the + * following arguments: + *

      + *
    • One tensor for each component of an element of {@code input_dataset}.
    • + *
    • One tensor for each value in {@code other_arguments}.
    • + *
    + *

    Unlike a "FilterDataset", which applies {@code predicate} sequentially, this dataset + * invokes up to {@code num_parallel_calls} copies of {@code predicate} in parallel. + */ +@OpMetadata( + opType = ParallelFilterDataset.OP_NAME, + inputsClass = ParallelFilterDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class ParallelFilterDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelFilterDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public ParallelFilterDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ParallelFilterDataset operation. + * + * @param scope current scope + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param numParallelCalls The number of concurrent invocations of {@code predicate} that process + * elements from {@code input_dataset} in parallel. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ParallelFilterDataset + */ + @Endpoint( + describeByClass = true + ) + public static ParallelFilterDataset create(Scope scope, Operand inputDataset, + Iterable> otherArguments, Operand numParallelCalls, + ConcreteFunction predicate, List> outputTypes, + List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ParallelFilterDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInputList(Operands.asOutputs(otherArguments)); + opBuilder.addInput(numParallelCalls.asOutput()); + opBuilder.setAttr("predicate", predicate); + 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.deterministic != null) { + opBuilder.setAttr("deterministic", opts.deterministic); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new ParallelFilterDataset(opBuilder.build()); + } + + /** + * Sets the deterministic option. + * + * @param deterministic A string indicating the op-level determinism to use. Deterministic controls + * whether the interleave is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + * @return this Options instance. + */ + public static Options deterministic(String deterministic) { + return new Options().deterministic(deterministic); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ParallelFilterDataset} + */ + public static class Options { + private String deterministic; + + private String metadata; + + private Options() { + } + + /** + * Sets the deterministic option. + * + * @param deterministic A string indicating the op-level determinism to use. Deterministic controls + * whether the interleave is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + * @return this Options instance. + */ + public Options deterministic(String deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ParallelFilterDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + */ + public final Iterable> otherArguments; + + /** + * The number of concurrent invocations of {@code predicate} that process + * elements from {@code input_dataset} in parallel. + */ + public final Operand numParallelCalls; + + /** + * A string indicating the op-level determinism to use. Deterministic controls + * whether the interleave is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + */ + public final String deterministic; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ParallelFilterDataset(op), op, Arrays.asList("deterministic", "Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + numParallelCalls = (Operand) op.input(inputIndex++); + deterministic = op.attributes().getAttrString("deterministic"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelInterleaveDataset.java index 07ac0e6f59a..d46fd839fc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelInterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -46,6 +52,10 @@ * {@code experimental_deterministic} parameter of {@code tf.data.Options} to {@code False}. * This can improve performance at the expense of non-determinism. */ +@OpMetadata( + opType = ParallelInterleaveDataset.OP_NAME, + inputsClass = ParallelInterleaveDataset.Inputs.class +) @Operator( group = "data" ) @@ -58,8 +68,8 @@ public final class ParallelInterleaveDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private ParallelInterleaveDataset(Operation operation) { - super(operation); + public ParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -86,8 +96,8 @@ private ParallelInterleaveDataset(Operation operation) { * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ParallelInterleaveDataset */ @@ -119,6 +129,9 @@ public static ParallelInterleaveDataset create(Scope scope, Operand asOutput() { public static class Options { private String deterministic; + private String metadata; + private Options() { } @@ -176,5 +201,112 @@ public Options deterministic(String deterministic) { this.deterministic = deterministic; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ParallelInterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * Dataset that produces a stream of arguments for the function {@code f}. + */ + public final Operand inputDataset; + + /** + * Additional arguments to pass to {@code f} beyond those produced by {@code input_dataset}. + * Evaluated once when the dataset is instantiated. + */ + public final Iterable> otherArguments; + + /** + * Number of datasets (each created by applying {@code f} to the elements of + * {@code input_dataset}) among which the {@code ParallelInterleaveDatasetV2} will cycle in a + * round-robin fashion. + */ + public final Operand cycleLength; + + /** + * Number of elements at a time to produce from each interleaved invocation of a + * dataset returned by {@code f}. + */ + public final Operand blockLength; + + /** + * The number of elements each iterator being interleaved should buffer (similar + * to the {@code .prefetch()} transformation for each interleaved iterator). + */ + public final Operand bufferOutputElements; + + /** + * Determines the number of iterators to prefetch, allowing buffers to warm up and + * data to be pre-fetched without blocking the main thread. + */ + public final Operand prefetchInputElements; + + /** + * Determines the number of threads that should be used for fetching data from + * input datasets in parallel. The Python API {@code tf.data.experimental.AUTOTUNE} + * constant can be used to indicate that the level of parallelism should be autotuned. + */ + public final Operand numParallelCalls; + + /** + * A string indicating the op-level determinism to use. Deterministic controls + * whether the interleave is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + */ + public final String deterministic; + + /** + * Types of the elements of {@code other_arguments}. + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ParallelInterleaveDataset(op), op, Arrays.asList("deterministic", "Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + cycleLength = (Operand) op.input(inputIndex++); + blockLength = (Operand) op.input(inputIndex++); + bufferOutputElements = (Operand) op.input(inputIndex++); + prefetchInputElements = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + deterministic = op.attributes().getAttrString("deterministic"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelMapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelMapDataset.java index e954f33b8ec..6b783929411 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelMapDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParallelMapDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,6 +43,10 @@ * Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up * to {@code num_parallel_calls} copies of {@code f} in parallel. */ +@OpMetadata( + opType = ParallelMapDataset.OP_NAME, + inputsClass = ParallelMapDataset.Inputs.class +) @Operator( group = "data" ) @@ -49,8 +59,8 @@ public final class ParallelMapDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ParallelMapDataset(Operation operation) { - super(operation); + public ParallelMapDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,13 +69,13 @@ private ParallelMapDataset(Operation operation) { * Factory method to create a class wrapping a new ParallelMapDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value * @param numParallelCalls The number of concurrent invocations of {@code f} that process * elements from {@code input_dataset} in parallel. - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ParallelMapDataset */ @@ -97,6 +107,12 @@ public static ParallelMapDataset create(Scope scope, Operand in if (opts.preserveCardinality != null) { opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); } + if (opts.useUnboundedThreadpool != null) { + opBuilder.setAttr("use_unbounded_threadpool", opts.useUnboundedThreadpool); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ParallelMapDataset(opBuilder.build()); @@ -132,6 +148,26 @@ public static Options preserveCardinality(Boolean preserveCardinality) { return new Options().preserveCardinality(preserveCardinality); } + /** + * Sets the useUnboundedThreadpool option. + * + * @param useUnboundedThreadpool the useUnboundedThreadpool option + * @return this Options instance. + */ + public static Options useUnboundedThreadpool(Boolean useUnboundedThreadpool) { + return new Options().useUnboundedThreadpool(useUnboundedThreadpool); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -157,6 +193,10 @@ public static class Options { private Boolean preserveCardinality; + private Boolean useUnboundedThreadpool; + + private String metadata; + private Options() { } @@ -192,5 +232,106 @@ public Options preserveCardinality(Boolean preserveCardinality) { this.preserveCardinality = preserveCardinality; return this; } + + /** + * Sets the useUnboundedThreadpool option. + * + * @param useUnboundedThreadpool the useUnboundedThreadpool option + * @return this Options instance. + */ + public Options useUnboundedThreadpool(Boolean useUnboundedThreadpool) { + this.useUnboundedThreadpool = useUnboundedThreadpool; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ParallelMapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The number of concurrent invocations of {@code f} that process + * elements from {@code input_dataset} in parallel. + */ + public final Operand numParallelCalls; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The useInterOpParallelism attribute + */ + public final boolean useInterOpParallelism; + + /** + * The deterministic attribute + */ + public final String deterministic; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + /** + * The useUnboundedThreadpool attribute + */ + public final boolean useUnboundedThreadpool; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ParallelMapDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "use_inter_op_parallelism", "deterministic", "preserve_cardinality", "use_unbounded_threadpool", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + numParallelCalls = (Operand) op.input(inputIndex++); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + useInterOpParallelism = op.attributes().getAttrBool("use_inter_op_parallelism"); + deterministic = op.attributes().getAttrString("deterministic"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + useUnboundedThreadpool = op.attributes().getAttrBool("use_unbounded_threadpool"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java index 16163f215e3..c50ec51e906 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -36,6 +41,10 @@ /** * Transforms {@code input_dataset} containing {@code Example} protos as vectors of DT_STRING into a dataset of {@code Tensor} or {@code SparseTensor} objects representing the parsed features. */ +@OpMetadata( + opType = ParseExampleDataset.OP_NAME, + inputsClass = ParseExampleDataset.Inputs.class +) @Operator( group = "data" ) @@ -48,8 +57,8 @@ public final class ParseExampleDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ParseExampleDataset(Operation operation) { - super(operation); + public ParseExampleDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,8 +67,8 @@ private ParseExampleDataset(Operation operation) { * Factory method to create a class wrapping a new ParseExampleDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param numParallelCalls the numParallelCalls value + * @param inputDataset The inputDataset value + * @param numParallelCalls The numParallelCalls value * @param denseDefaults A dict mapping string keys to {@code Tensor}s. * The keys of the dict must match the dense_keys of the feature. * @param sparseKeys A list of string keys in the examples features. @@ -80,8 +89,8 @@ private ParseExampleDataset(Operation operation) { * given feature along this dimension. * @param outputTypes The type list for the return values. * @param outputShapes The list of shapes being produced. - * @param raggedValueTypes the value of the raggedValueTypes property - * @param raggedSplitTypes the value of the raggedSplitTypes property + * @param raggedValueTypes The value of the raggedValueTypes attribute + * @param raggedSplitTypes The value of the raggedSplitTypes attribute * @param options carries optional attribute values * @return a new instance of ParseExampleDataset */ @@ -169,7 +178,7 @@ public static Options raggedKeys(List raggedKeys) { * @param raggedKeys the raggedKeys option * @return this Options instance. */ - public static Options raggedKeys(String[] raggedKeys) { + public static Options raggedKeys(String... raggedKeys) { return new Options().raggedKeys(raggedKeys); } @@ -236,4 +245,119 @@ public Options raggedKeys(String... raggedKeys) { return this; } } + + @OpInputsMetadata( + outputsClass = ParseExampleDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The numParallelCalls input + */ + public final Operand numParallelCalls; + + /** + * A dict mapping string keys to {@code Tensor}s. + * The keys of the dict must match the dense_keys of the feature. + */ + public final Iterable> denseDefaults; + + /** + * A list of string keys in the examples features. + * The results for these keys will be returned as {@code SparseTensor} objects. + */ + public final String[] sparseKeys; + + /** + * A list of Ndense string Tensors (scalars). + * The keys expected in the Examples features associated with dense values. + */ + public final String[] denseKeys; + + /** + * A list of {@code DTypes} of the same length as {@code sparse_keys}. + * Only {@code tf.float32} ({@code FloatList}), {@code tf.int64} ({@code Int64List}), + * and {@code tf.string} ({@code BytesList}) are supported. + */ + public final DataType[] sparseTypes; + + /** + * A list of DTypes of the same length as {@code dense_keys}. + * Only {@code tf.float32} ({@code FloatList}), {@code tf.int64} ({@code Int64List}), + * and {@code tf.string} ({@code BytesList}) are supported. + */ + public final DataType[] Tdense; + + /** + * List of tuples with the same length as {@code dense_keys}. + * The shape of the data for each dense feature referenced by {@code dense_keys}. + * Required for any input tensors identified by {@code dense_keys}. Must be + * either fully defined, or may contain an unknown first dimension. + * An unknown first dimension means the feature is treated as having + * a variable number of blocks, and the output shape along this dimension + * is considered unknown at graph build time. Padding is applied for + * minibatch elements smaller than the maximum number of blocks for the + * given feature along this dimension. + */ + public final Shape[] denseShapes; + + /** + * The type list for the return values. + */ + public final DataType[] outputTypes; + + /** + * The list of shapes being produced. + */ + public final Shape[] outputShapes; + + /** + * A string indicating the op-level determinism to use. Deterministic controls + * whether the dataset is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + */ + public final String deterministic; + + /** + * The raggedKeys attribute + */ + public final String[] raggedKeys; + + /** + * The raggedValueTypes attribute + */ + public final DataType[] raggedValueTypes; + + /** + * The raggedSplitTypes attribute + */ + public final DataType[] raggedSplitTypes; + + public Inputs(GraphOperation op) { + super(new ParseExampleDataset(op), op, Arrays.asList("sparse_keys", "dense_keys", "sparse_types", "Tdense", "dense_shapes", "output_types", "output_shapes", "deterministic", "ragged_keys", "ragged_value_types", "ragged_split_types")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + int denseDefaultsLength = op.inputListLength("dense_defaults"); + denseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, denseDefaultsLength)); + inputIndex += denseDefaultsLength; + sparseKeys = op.attributes().getAttrStringList("sparse_keys"); + denseKeys = op.attributes().getAttrStringList("dense_keys"); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + Tdense = op.attributes().getAttrTypeList("Tdense"); + denseShapes = op.attributes().getAttrShapeList("dense_shapes"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + deterministic = op.attributes().getAttrString("deterministic"); + raggedKeys = op.attributes().getAttrStringList("ragged_keys"); + raggedValueTypes = op.attributes().getAttrTypeList("ragged_value_types"); + raggedSplitTypes = op.attributes().getAttrTypeList("ragged_split_types"); + } + } } 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 e175f440778..2cf3b24eca8 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that asynchronously prefetches elements from {@code input_dataset}. */ +@OpMetadata( + opType = PrefetchDataset.OP_NAME, + inputsClass = PrefetchDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class PrefetchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private PrefetchDataset(Operation operation) { - super(operation); + public PrefetchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,11 +66,11 @@ private PrefetchDataset(Operation operation) { * Factory method to create a class wrapping a new PrefetchDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param bufferSize The maximum number of elements to buffer in an iterator over * this dataset. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of PrefetchDataset */ @@ -90,6 +100,9 @@ public static PrefetchDataset create(Scope scope, Operand input if (opts.bufferSizeMin != null) { opBuilder.setAttr("buffer_size_min", opts.bufferSizeMin); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new PrefetchDataset(opBuilder.build()); @@ -125,6 +138,16 @@ public static Options bufferSizeMin(Long bufferSizeMin) { return new Options().bufferSizeMin(bufferSizeMin); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -150,6 +173,8 @@ public static class Options { private Long bufferSizeMin; + private String metadata; + private Options() { } @@ -185,5 +210,75 @@ public Options bufferSizeMin(Long bufferSizeMin) { this.bufferSizeMin = bufferSizeMin; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = PrefetchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The maximum number of elements to buffer in an iterator over + * this dataset. + */ + public final Operand bufferSize; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The slackPeriod attribute + */ + public final long slackPeriod; + + /** + * The legacyAutotune attribute + */ + public final boolean legacyAutotune; + + /** + * The bufferSizeMin attribute + */ + public final long bufferSizeMin; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new PrefetchDataset(op), op, Arrays.asList("output_types", "output_shapes", "slack_period", "legacy_autotune", "buffer_size_min", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + slackPeriod = op.attributes().getAttrInt("slack_period"); + legacyAutotune = op.attributes().getAttrBool("legacy_autotune"); + bufferSizeMin = op.attributes().getAttrInt("buffer_size_min"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java index 73e293fa5f7..58e1c7866ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = PrivateThreadPoolDataset.OP_NAME, + inputsClass = PrivateThreadPoolDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class PrivateThreadPoolDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private PrivateThreadPoolDataset(Operation operation) { - super(operation); + public PrivateThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private PrivateThreadPoolDataset(Operation operation) { * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of PrivateThreadPoolDataset */ @Endpoint( @@ -94,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = PrivateThreadPoolDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * Identifies the number of threads to use for the private threadpool. + */ + public final Operand numThreads; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new PrivateThreadPoolDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numThreads = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java index 3d88d88c4e6..ff4d688baef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,23 +27,32 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a Dataset that returns pseudorandom numbers. * Creates a Dataset that returns a stream of uniformly distributed - * pseudorandom 64-bit signed integers. + * pseudorandom 64-bit signed integers. It accepts a boolean attribute that + * determines if the random number generators are re-applied at each epoch. The + * default value is True which means that the seeds are applied and the same + * sequence of random numbers are generated at each epoch. If set to False, the + * seeds are not re-applied and a different sequence of random numbers are + * generated at each epoch. *

    In the TensorFlow Python API, you can instantiate this dataset via the - * class {@code tf.data.experimental.RandomDataset}. - *

    Instances of this dataset are also created as a result of the - * {@code hoist_random_uniform} static optimization. Whether this optimization is - * performed is determined by the {@code experimental_optimization.hoist_random_uniform} - * option of {@code tf.data.Options}. + * class {@code tf.data.experimental.RandomDatasetV2}. */ +@OpMetadata( + opType = RandomDataset.OP_NAME, + inputsClass = RandomDataset.Inputs.class +) @Operator( group = "data" ) @@ -49,46 +60,81 @@ public final class RandomDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomDataset"; + public static final String OP_NAME = "RandomDatasetV2"; private Output handle; @SuppressWarnings("unchecked") - private RandomDataset(Operation operation) { - super(operation); + public RandomDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new RandomDataset operation. + * Factory method to create a class wrapping a new RandomDatasetV2 operation. * * @param scope current scope * @param seed A scalar seed for the random number generator. If either seed or * seed2 is set to be non-zero, the random number generator is seeded * by the given seed. Otherwise, a random seed is used. * @param seed2 A second scalar seed to avoid seed collision. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param seedGenerator A resource for the random number seed generator. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RandomDataset */ @Endpoint( describeByClass = true ) public static RandomDataset create(Scope scope, Operand seed, Operand seed2, - List> outputTypes, List outputShapes) { + Operand seedGenerator, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RandomDataset"); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); + opBuilder.addInput(seedGenerator.asOutput()); 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.rerandomizeEachIteration != null) { + opBuilder.setAttr("rerandomize_each_iteration", opts.rerandomizeEachIteration); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new RandomDataset(opBuilder.build()); } + /** + * Sets the rerandomizeEachIteration option. + * + * @param rerandomizeEachIteration A boolean attribute to rerandomize the sequence of random numbers generated + * at each epoch. + * @return this Options instance. + */ + public static Options rerandomizeEachIteration(Boolean rerandomizeEachIteration) { + return new Options().rerandomizeEachIteration(rerandomizeEachIteration); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -103,4 +149,94 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.RandomDataset} + */ + public static class Options { + private Boolean rerandomizeEachIteration; + + private String metadata; + + private Options() { + } + + /** + * Sets the rerandomizeEachIteration option. + * + * @param rerandomizeEachIteration A boolean attribute to rerandomize the sequence of random numbers generated + * at each epoch. + * @return this Options instance. + */ + public Options rerandomizeEachIteration(Boolean rerandomizeEachIteration) { + this.rerandomizeEachIteration = rerandomizeEachIteration; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RandomDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar seed for the random number generator. If either seed or + * seed2 is set to be non-zero, the random number generator is seeded + * by the given seed. Otherwise, a random seed is used. + */ + public final Operand seed; + + /** + * A second scalar seed to avoid seed collision. + */ + public final Operand seed2; + + /** + * A resource for the random number seed generator. + */ + public final Operand seedGenerator; + + /** + * A boolean attribute to rerandomize the sequence of random numbers generated + * at each epoch. + */ + public final boolean rerandomizeEachIteration; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new RandomDataset(op), op, Arrays.asList("rerandomize_each_iteration", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + seedGenerator = (Operand) op.input(inputIndex++); + rerandomizeEachIteration = op.attributes().getAttrBool("rerandomize_each_iteration"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java index ae0e82544c3..7ea0046b74e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset with a range of values. Corresponds to python's xrange. */ +@OpMetadata( + opType = RangeDataset.OP_NAME, + inputsClass = RangeDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class RangeDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RangeDataset(Operation operation) { - super(operation); + public RangeDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,15 +69,17 @@ private RangeDataset(Operation operation) { * @param start corresponds to start in python's xrange(). * @param stop corresponds to stop in python's xrange(). * @param step corresponds to step in python's xrange(). - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RangeDataset */ @Endpoint( describeByClass = true ) public static RangeDataset create(Scope scope, Operand start, Operand stop, - Operand step, List> outputTypes, List outputShapes) { + Operand step, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RangeDataset"); opBuilder.addInput(start.asOutput()); opBuilder.addInput(stop.asOutput()); @@ -78,9 +90,39 @@ public static RangeDataset create(Scope scope, Operand start, Operand handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.RangeDataset} + */ + public static class Options { + private String metadata; + + private Boolean replicateOnSplit; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Sets the replicateOnSplit option. + * + * @param replicateOnSplit the replicateOnSplit option + * @return this Options instance. + */ + public Options replicateOnSplit(Boolean replicateOnSplit) { + this.replicateOnSplit = replicateOnSplit; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RangeDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * corresponds to start in python's xrange(). + */ + public final Operand start; + + /** + * corresponds to stop in python's xrange(). + */ + public final Operand stop; + + /** + * corresponds to step in python's xrange(). + */ + public final Operand step; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + /** + * The replicateOnSplit attribute + */ + public final boolean replicateOnSplit; + + public Inputs(GraphOperation op) { + super(new RangeDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata", "replicate_on_split")); + int inputIndex = 0; + start = (Operand) op.input(inputIndex++); + stop = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + replicateOnSplit = op.attributes().getAttrBool("replicate_on_split"); + } + } } 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 index 1028ca5a6f4..cbc24380632 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,6 +43,10 @@ * Creates a dataset that rebatches elements from {@code input_dataset} into new batch * sizes. */ +@OpMetadata( + opType = RebatchDatasetV2.OP_NAME, + inputsClass = RebatchDatasetV2.Inputs.class +) @Operator( group = "data" ) @@ -49,8 +59,8 @@ public final class RebatchDatasetV2 extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RebatchDatasetV2(Operation operation) { - super(operation); + public RebatchDatasetV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,9 +72,9 @@ private RebatchDatasetV2(Operation operation) { * @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 the dropRemainder value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param dropRemainder The dropRemainder value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of RebatchDatasetV2 */ @Endpoint( @@ -100,4 +110,45 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = RebatchDatasetV2.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A vector of integers representing the size of batches to produce. These values + * are cycled through in order. + */ + public final Operand batchSizes; + + /** + * The dropRemainder input + */ + public final Operand dropRemainder; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new RebatchDatasetV2(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSizes = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ReduceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ReduceDataset.java index 1304c04223c..6b48d82f307 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ReduceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ReduceDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Reduces the input dataset to a singleton using a reduce function. */ +@OpMetadata( + opType = ReduceDataset.OP_NAME, + inputsClass = ReduceDataset.Inputs.class +) @Operator( group = "data" ) @@ -48,8 +57,8 @@ public final class ReduceDataset extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private ReduceDataset(Operation operation) { - super(operation); + public ReduceDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -63,12 +72,12 @@ private ReduceDataset(Operation operation) { * @param inputDataset A variant tensor representing the input dataset. * @param initialState A nested structure of tensors, representing the initial state of the * transformation. - * @param otherArguments the otherArguments value + * @param otherArguments The otherArguments value * @param f A function that maps {@code (old_state, input_element)} to {@code new_state}. It must take * two arguments and return a nested structures of tensors. The structure of * {@code new_state} must match the structure of {@code initial_state}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ReduceDataset */ @@ -94,6 +103,9 @@ public static ReduceDataset create(Scope scope, Operand inputDa if (opts.useInterOpParallelism != null) { opBuilder.setAttr("use_inter_op_parallelism", opts.useInterOpParallelism); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ReduceDataset(opBuilder.build()); @@ -109,6 +121,16 @@ public static Options useInterOpParallelism(Boolean useInterOpParallelism) { return new Options().useInterOpParallelism(useInterOpParallelism); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets components. * @@ -130,6 +152,8 @@ public Iterator> iterator() { public static class Options { private Boolean useInterOpParallelism; + private String metadata; + private Options() { } @@ -143,5 +167,85 @@ public Options useInterOpParallelism(Boolean useInterOpParallelism) { this.useInterOpParallelism = useInterOpParallelism; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ReduceDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A nested structure of tensors, representing the initial state of the + * transformation. + */ + public final Iterable> initialState; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Tstate attribute + */ + public final DataType[] Tstate; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The useInterOpParallelism attribute + */ + public final boolean useInterOpParallelism; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ReduceDataset(op), op, Arrays.asList("Tstate", "Targuments", "output_types", "output_shapes", "use_inter_op_parallelism", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int initialStateLength = op.inputListLength("initial_state"); + initialState = Arrays.asList((Operand[]) op.inputList(inputIndex, initialStateLength)); + inputIndex += initialStateLength; + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Tstate = op.attributes().getAttrTypeList("Tstate"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + useInterOpParallelism = op.attributes().getAttrBool("use_inter_op_parallelism"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java index d06a4615c20..c15f76584e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,72 +17,224 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Registers a dataset with the tf.data service. */ +@OpMetadata( + opType = RegisterDataset.OP_NAME, + inputsClass = RegisterDataset.Inputs.class +) @Operator( group = "data" ) -public final class RegisterDataset extends RawOp implements Operand { +public final class RegisterDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegisterDataset"; + public static final String OP_NAME = "RegisterDatasetV2"; - private Output datasetId; + private Output datasetId; - private RegisterDataset(Operation operation) { - super(operation); + public RegisterDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; datasetId = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new RegisterDataset operation. + * Factory method to create a class wrapping a new RegisterDatasetV2 operation. * * @param scope current scope - * @param dataset the dataset value - * @param address the address value - * @param protocol the protocol value - * @param externalStatePolicy the value of the externalStatePolicy property + * @param dataset The dataset value + * @param address The address value + * @param protocol The protocol value + * @param externalStatePolicy The value of the externalStatePolicy attribute + * @param options carries optional attribute values * @return a new instance of RegisterDataset */ @Endpoint( describeByClass = true ) public static RegisterDataset create(Scope scope, Operand dataset, - Operand address, Operand protocol, Long externalStatePolicy) { + Operand address, Operand protocol, Long externalStatePolicy, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RegisterDataset"); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(address.asOutput()); opBuilder.addInput(protocol.asOutput()); opBuilder.setAttr("external_state_policy", externalStatePolicy); + if (options != null) { + for (Options opts : options) { + if (opts.elementSpec != null) { + opBuilder.setAttr("element_spec", opts.elementSpec); + } + if (opts.requestedDatasetId != null) { + opBuilder.setAttr("requested_dataset_id", opts.requestedDatasetId); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new RegisterDataset(opBuilder.build()); } + /** + * Sets the elementSpec option. + * + * @param elementSpec the elementSpec option + * @return this Options instance. + */ + public static Options elementSpec(String elementSpec) { + return new Options().elementSpec(elementSpec); + } + + /** + * Sets the requestedDatasetId option. + * + * @param requestedDatasetId the requestedDatasetId option + * @return this Options instance. + */ + public static Options requestedDatasetId(String requestedDatasetId) { + return new Options().requestedDatasetId(requestedDatasetId); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets datasetId. * * @return datasetId. */ - public Output datasetId() { + public Output datasetId() { return datasetId; } @Override - public Output asOutput() { + public Output asOutput() { return datasetId; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.RegisterDataset} + */ + public static class Options { + private String elementSpec; + + private String requestedDatasetId; + + private String metadata; + + private Options() { + } + + /** + * Sets the elementSpec option. + * + * @param elementSpec the elementSpec option + * @return this Options instance. + */ + public Options elementSpec(String elementSpec) { + this.elementSpec = elementSpec; + return this; + } + + /** + * Sets the requestedDatasetId option. + * + * @param requestedDatasetId the requestedDatasetId option + * @return this Options instance. + */ + public Options requestedDatasetId(String requestedDatasetId) { + this.requestedDatasetId = requestedDatasetId; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RegisterDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The dataset input + */ + public final Operand dataset; + + /** + * The address input + */ + public final Operand address; + + /** + * The protocol input + */ + public final Operand protocol; + + /** + * The externalStatePolicy attribute + */ + public final long externalStatePolicy; + + /** + * The elementSpec attribute + */ + public final String elementSpec; + + /** + * The requestedDatasetId attribute + */ + public final String requestedDatasetId; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new RegisterDataset(op), op, Arrays.asList("external_state_policy", "element_spec", "requested_dataset_id", "metadata")); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + address = (Operand) op.input(inputIndex++); + protocol = (Operand) op.input(inputIndex++); + externalStatePolicy = op.attributes().getAttrInt("external_state_policy"); + elementSpec = op.attributes().getAttrString("element_spec"); + requestedDatasetId = op.attributes().getAttrString("requested_dataset_id"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java index 0aa7b1e0c9d..b62d7f2dce4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that emits the outputs of {@code input_dataset} {@code count} times. */ +@OpMetadata( + opType = RepeatDataset.OP_NAME, + inputsClass = RepeatDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class RepeatDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RepeatDataset(Operation operation) { - super(operation); + public RepeatDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,18 +66,20 @@ private RepeatDataset(Operation operation) { * Factory method to create a class wrapping a new RepeatDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of times that {@code input_dataset} should * be repeated. A value of {@code -1} indicates that it should be repeated infinitely. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of RepeatDataset */ @Endpoint( describeByClass = true ) public static RepeatDataset create(Scope scope, Operand inputDataset, - Operand count, List> outputTypes, List outputShapes) { + Operand count, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RepeatDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); @@ -77,9 +89,26 @@ public static RepeatDataset create(Scope scope, Operand inputDa outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new RepeatDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -94,4 +123,66 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.RepeatDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RepeatDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of times that {@code input_dataset} should + * be repeated. A value of {@code -1} indicates that it should be repeated infinitely. + */ + public final Operand count; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new RepeatDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + count = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RewriteDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RewriteDataset.java new file mode 100644 index 00000000000..d67c7d6e808 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RewriteDataset.java @@ -0,0 +1,141 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * The RewriteDataset operation + */ +@OpMetadata( + opType = RewriteDataset.OP_NAME, + inputsClass = RewriteDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class RewriteDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RewriteDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public RewriteDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RewriteDataset operation. + * + * @param scope current scope + * @param inputDataset The inputDataset value + * @param rewriteName The rewriteName value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of RewriteDataset + */ + @Endpoint( + describeByClass = true + ) + public static RewriteDataset create(Scope scope, Operand inputDataset, + Operand rewriteName, List> outputTypes, + List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RewriteDataset"); + opBuilder.addInput(inputDataset.asOutput()); + opBuilder.addInput(rewriteName.asOutput()); + 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 RewriteDataset(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = RewriteDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The rewriteName input + */ + public final Operand rewriteName; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new RewriteDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + rewriteName = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java index af6c4f4bfaa..efd021b2038 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -40,6 +46,10 @@ * {@code experimental_optimization.filter_with_random_uniform_fusion} option of * {@code tf.data.Options}. */ +@OpMetadata( + opType = SamplingDataset.OP_NAME, + inputsClass = SamplingDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class SamplingDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SamplingDataset(Operation operation) { - super(operation); + public SamplingDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,13 +72,13 @@ private SamplingDataset(Operation operation) { * Factory method to create a class wrapping a new SamplingDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param rate A scalar representing the sample rate. Each element of {@code input_dataset} is * retained with this probability, independent of all other elements. * @param seed A scalar representing seed of random number generator. * @param seed2 A scalar representing seed2 of random number generator. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SamplingDataset */ @Endpoint( @@ -105,4 +115,51 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SamplingDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the sample rate. Each element of {@code input_dataset} is + * retained with this probability, independent of all other elements. + */ + public final Operand rate; + + /** + * A scalar representing seed of random number generator. + */ + public final Operand seed; + + /** + * A scalar representing seed2 of random number generator. + */ + public final Operand seed2; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SamplingDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + rate = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SaveDataset.java index c034b1bcde2..67dd8890c15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,42 +17,62 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * The SaveDataset operation + * The SaveDatasetV2 operation */ +@OpMetadata( + opType = SaveDataset.OP_NAME, + inputsClass = SaveDataset.Inputs.class +) @Operator( group = "data" ) -public final class SaveDataset extends RawOp { +public final class SaveDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SaveDataset"; + public static final String OP_NAME = "SaveDatasetV2"; + + private Output handle; - private SaveDataset(Operation operation) { - super(operation); + @SuppressWarnings("unchecked") + public SaveDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SaveDataset operation. + * Factory method to create a class wrapping a new SaveDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param path the path value - * @param shardFuncOtherArgs the shardFuncOtherArgs value - * @param shardFunc the value of the shardFunc property + * @param inputDataset The inputDataset value + * @param path The path value + * @param shardFuncOtherArgs The shardFuncOtherArgs value + * @param shardFunc The value of the shardFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of SaveDataset */ @@ -61,12 +81,18 @@ private SaveDataset(Operation operation) { ) public static SaveDataset create(Scope scope, Operand inputDataset, Operand path, Iterable> shardFuncOtherArgs, ConcreteFunction shardFunc, - Options... options) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SaveDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(path.asOutput()); opBuilder.addInputList(Operands.asOutputs(shardFuncOtherArgs)); opBuilder.setAttr("shard_func", shardFunc); + 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.compression != null) { @@ -100,6 +126,21 @@ public static Options useShardFunc(Boolean useShardFunc) { return new Options().useShardFunc(useShardFunc); } + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + /** * Optional attributes for {@link org.tensorflow.op.data.SaveDataset} */ @@ -133,4 +174,64 @@ public Options useShardFunc(Boolean useShardFunc) { return this; } } + + @OpInputsMetadata( + outputsClass = SaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The path input + */ + public final Operand path; + + /** + * The shardFuncOtherArgs input + */ + public final Iterable> shardFuncOtherArgs; + + /** + * The compression attribute + */ + public final String compression; + + /** + * The useShardFunc attribute + */ + public final boolean useShardFunc; + + /** + * The TshardFuncArgs attribute + */ + public final DataType[] TshardFuncArgs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SaveDataset(op), op, Arrays.asList("compression", "use_shard_func", "Tshard_func_args", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + path = (Operand) op.input(inputIndex++); + int shardFuncOtherArgsLength = op.inputListLength("shard_func_other_args"); + shardFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, shardFuncOtherArgsLength)); + inputIndex += shardFuncOtherArgsLength; + compression = op.attributes().getAttrString("compression"); + useShardFunc = op.attributes().getAttrBool("use_shard_func"); + TshardFuncArgs = op.attributes().getAttrTypeList("Tshard_func_args"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ScanDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ScanDataset.java index 23b1f1a213a..df67784e95e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ScanDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ScanDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +28,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset successively reduces {@code f} over the elements of {@code input_dataset}. */ +@OpMetadata( + opType = ScanDataset.OP_NAME, + inputsClass = ScanDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class ScanDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ScanDataset(Operation operation) { - super(operation); + public ScanDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,12 +66,12 @@ private ScanDataset(Operation operation) { * Factory method to create a class wrapping a new ScanDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param initialState the initialState value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param initialState The initialState value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ScanDataset */ @@ -90,6 +100,9 @@ public static ScanDataset create(Scope scope, Operand inputData if (opts.useDefaultDevice != null) { opBuilder.setAttr("use_default_device", opts.useDefaultDevice); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ScanDataset(opBuilder.build()); @@ -115,6 +128,16 @@ public static Options useDefaultDevice(Boolean useDefaultDevice) { return new Options().useDefaultDevice(useDefaultDevice); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -138,6 +161,8 @@ public static class Options { private Boolean useDefaultDevice; + private String metadata; + private Options() { } @@ -162,5 +187,90 @@ public Options useDefaultDevice(Boolean useDefaultDevice) { this.useDefaultDevice = useDefaultDevice; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ScanDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The initialState input + */ + public final Iterable> initialState; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Tstate attribute + */ + public final DataType[] Tstate; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + /** + * The useDefaultDevice attribute + */ + public final boolean useDefaultDevice; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ScanDataset(op), op, Arrays.asList("Tstate", "Targuments", "output_types", "output_shapes", "preserve_cardinality", "use_default_device", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int initialStateLength = op.inputListLength("initial_state"); + initialState = Arrays.asList((Operand[]) op.inputList(inputIndex, initialStateLength)); + inputIndex += initialStateLength; + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Tstate = op.attributes().getAttrTypeList("Tstate"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + useDefaultDevice = op.attributes().getAttrBool("use_default_device"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java index 23849f93b36..404b6a107c5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Converts the given {@code resource_handle} representing an iterator to a variant tensor. */ +@OpMetadata( + opType = SerializeIterator.OP_NAME, + inputsClass = SerializeIterator.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class SerializeIterator extends RawOp implements Operand { private Output serialized; @SuppressWarnings("unchecked") - private SerializeIterator(Operation operation) { - super(operation); + public SerializeIterator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; serialized = operation.output(outputIdx++); } @@ -119,4 +128,26 @@ public Options externalStatePolicy(Long externalStatePolicy) { return this; } } + + @OpInputsMetadata( + outputsClass = SerializeIterator.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to an iterator resource. + */ + public final Operand resourceHandle; + + /** + * The externalStatePolicy attribute + */ + public final long externalStatePolicy; + + public Inputs(GraphOperation op) { + super(new SerializeIterator(op), op, Arrays.asList("external_state_policy")); + int inputIndex = 0; + resourceHandle = (Operand) op.input(inputIndex++); + externalStatePolicy = op.attributes().getAttrInt("external_state_policy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java index 96f5356c838..ba97c4e3e42 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The SetStatsAggregatorDataset operation */ +@OpMetadata( + opType = SetStatsAggregatorDataset.OP_NAME, + inputsClass = SetStatsAggregatorDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class SetStatsAggregatorDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private SetStatsAggregatorDataset(Operation operation) { - super(operation); + public SetStatsAggregatorDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,12 +66,12 @@ private SetStatsAggregatorDataset(Operation operation) { * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param statsAggregator the statsAggregator value - * @param tag the tag value - * @param counterPrefix the counterPrefix value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param statsAggregator The statsAggregator value + * @param tag The tag value + * @param counterPrefix The counterPrefix value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SetStatsAggregatorDataset */ @Endpoint( @@ -99,4 +109,50 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SetStatsAggregatorDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The statsAggregator input + */ + public final Operand statsAggregator; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The counterPrefix input + */ + public final Operand counterPrefix; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SetStatsAggregatorDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + statsAggregator = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + counterPrefix = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java index 981cbe60944..4f8a780330c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a {@code Dataset} that includes only 1/{@code num_shards} of this dataset. */ +@OpMetadata( + opType = ShardDataset.OP_NAME, + inputsClass = ShardDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class ShardDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ShardDataset(Operation operation) { - super(operation); + public ShardDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,11 +66,11 @@ private ShardDataset(Operation operation) { * Factory method to create a class wrapping a new ShardDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param numShards An integer representing the number of shards operating in parallel. * @param index An integer representing the current worker index. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ShardDataset */ @@ -85,6 +95,9 @@ public static ShardDataset create(Scope scope, Operand inputDat if (opts.requireNonEmpty != null) { opBuilder.setAttr("require_non_empty", opts.requireNonEmpty); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ShardDataset(opBuilder.build()); @@ -100,6 +113,16 @@ public static Options requireNonEmpty(Boolean requireNonEmpty) { return new Options().requireNonEmpty(requireNonEmpty); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -121,6 +144,8 @@ public Output asOutput() { public static class Options { private Boolean requireNonEmpty; + private String metadata; + private Options() { } @@ -134,5 +159,68 @@ public Options requireNonEmpty(Boolean requireNonEmpty) { this.requireNonEmpty = requireNonEmpty; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ShardDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * An integer representing the number of shards operating in parallel. + */ + public final Operand numShards; + + /** + * An integer representing the current worker index. + */ + public final Operand index; + + /** + * The requireNonEmpty attribute + */ + public final boolean requireNonEmpty; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ShardDataset(op), op, Arrays.asList("require_non_empty", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numShards = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + requireNonEmpty = op.attributes().getAttrBool("require_non_empty"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java index 72178a21672..a32c193ccd7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The ShuffleAndRepeatDatasetV2 operation */ +@OpMetadata( + opType = ShuffleAndRepeatDataset.OP_NAME, + inputsClass = ShuffleAndRepeatDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class ShuffleAndRepeatDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private ShuffleAndRepeatDataset(Operation operation) { - super(operation); + public ShuffleAndRepeatDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,14 +66,14 @@ private ShuffleAndRepeatDataset(Operation operation) { * Factory method to create a class wrapping a new ShuffleAndRepeatDatasetV2 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param bufferSize the bufferSize value - * @param seed the seed value - * @param seed2 the seed2 value - * @param count the count value - * @param seedGenerator the seedGenerator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param bufferSize The bufferSize value + * @param seed The seed value + * @param seed2 The seed2 value + * @param count The count value + * @param seedGenerator The seedGenerator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ShuffleAndRepeatDataset */ @@ -92,6 +102,9 @@ public static ShuffleAndRepeatDataset create(Scope scope, Operand asOutput() { public static class Options { private Boolean reshuffleEachIteration; + private String metadata; + private Options() { } @@ -141,5 +166,86 @@ public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { this.reshuffleEachIteration = reshuffleEachIteration; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ShuffleAndRepeatDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The bufferSize input + */ + public final Operand bufferSize; + + /** + * The seed input + */ + public final Operand seed; + + /** + * The seed2 input + */ + public final Operand seed2; + + /** + * The count input + */ + public final Operand count; + + /** + * The seedGenerator input + */ + public final Operand seedGenerator; + + /** + * The reshuffleEachIteration attribute + */ + public final boolean reshuffleEachIteration; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ShuffleAndRepeatDataset(op), op, Arrays.asList("reshuffle_each_iteration", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + count = (Operand) op.input(inputIndex++); + seedGenerator = (Operand) op.input(inputIndex++); + reshuffleEachIteration = op.attributes().getAttrBool("reshuffle_each_iteration"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java index 369f892c0da..56114971399 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The ShuffleDatasetV3 operation */ +@OpMetadata( + opType = ShuffleDataset.OP_NAME, + inputsClass = ShuffleDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class ShuffleDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ShuffleDataset(Operation operation) { - super(operation); + public ShuffleDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,13 +66,13 @@ private ShuffleDataset(Operation operation) { * Factory method to create a class wrapping a new ShuffleDatasetV3 operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param bufferSize the bufferSize value - * @param seed the seed value - * @param seed2 the seed2 value - * @param seedGenerator the seedGenerator value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param bufferSize The bufferSize value + * @param seed The seed value + * @param seed2 The seed2 value + * @param seedGenerator The seedGenerator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ShuffleDataset */ @@ -90,6 +100,9 @@ public static ShuffleDataset create(Scope scope, Operand inputD if (opts.reshuffleEachIteration != null) { opBuilder.setAttr("reshuffle_each_iteration", opts.reshuffleEachIteration); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new ShuffleDataset(opBuilder.build()); @@ -105,6 +118,16 @@ public static Options reshuffleEachIteration(Boolean reshuffleEachIteration) { return new Options().reshuffleEachIteration(reshuffleEachIteration); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -126,6 +149,8 @@ public Output asOutput() { public static class Options { private Boolean reshuffleEachIteration; + private String metadata; + private Options() { } @@ -139,5 +164,80 @@ public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { this.reshuffleEachIteration = reshuffleEachIteration; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ShuffleDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The bufferSize input + */ + public final Operand bufferSize; + + /** + * The seed input + */ + public final Operand seed; + + /** + * The seed2 input + */ + public final Operand seed2; + + /** + * The seedGenerator input + */ + public final Operand seedGenerator; + + /** + * The reshuffleEachIteration attribute + */ + public final boolean reshuffleEachIteration; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ShuffleDataset(op), op, Arrays.asList("reshuffle_each_iteration", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + seedGenerator = (Operand) op.input(inputIndex++); + reshuffleEachIteration = op.attributes().getAttrBool("reshuffle_each_iteration"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java index 5b219586c7e..ccff9acd0f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that skips {@code count} elements from the {@code input_dataset}. */ +@OpMetadata( + opType = SkipDataset.OP_NAME, + inputsClass = SkipDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class SkipDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SkipDataset(Operation operation) { - super(operation); + public SkipDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,18 +66,20 @@ private SkipDataset(Operation operation) { * Factory method to create a class wrapping a new SkipDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of elements from the {@code input_dataset} * that should be skipped. If count is -1, skips everything. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of SkipDataset */ @Endpoint( describeByClass = true ) public static SkipDataset create(Scope scope, Operand inputDataset, - Operand count, List> outputTypes, List outputShapes) { + Operand count, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SkipDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); @@ -77,9 +89,26 @@ public static SkipDataset create(Scope scope, Operand inputData outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new SkipDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -94,4 +123,66 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.SkipDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SkipDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements from the {@code input_dataset} + * that should be skipped. If count is -1, skips everything. + */ + public final Operand count; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new SkipDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + count = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java index 86bc79865a8..c1f08b4128e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The SleepDataset operation */ +@OpMetadata( + opType = SleepDataset.OP_NAME, + inputsClass = SleepDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class SleepDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SleepDataset(Operation operation) { - super(operation); + public SleepDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,10 +66,10 @@ private SleepDataset(Operation operation) { * Factory method to create a class wrapping a new SleepDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param sleepMicroseconds the sleepMicroseconds value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param sleepMicroseconds The sleepMicroseconds value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SleepDataset */ @Endpoint( @@ -94,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SleepDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The sleepMicroseconds input + */ + public final Operand sleepMicroseconds; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SleepDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + sleepMicroseconds = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java index 6c9b47b7a24..358a8ecf4dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that passes a sliding window over {@code input_dataset}. */ +@OpMetadata( + opType = SlidingWindowDataset.OP_NAME, + inputsClass = SlidingWindowDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class SlidingWindowDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private SlidingWindowDataset(Operation operation) { - super(operation); + public SlidingWindowDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,15 +66,16 @@ private SlidingWindowDataset(Operation operation) { * Factory method to create a class wrapping a new SlidingWindowDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param windowSize A scalar representing the number of elements in the * sliding window. * @param windowShift A scalar representing the steps moving the sliding window * forward in one iteration. It must be positive. * @param windowStride A scalar representing the stride of the input elements of the sliding window. * It must be positive. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of SlidingWindowDataset */ @Endpoint( @@ -72,7 +83,7 @@ private SlidingWindowDataset(Operation operation) { ) public static SlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SlidingWindowDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); @@ -84,9 +95,26 @@ public static SlidingWindowDataset create(Scope scope, Operand outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.dropRemainder != null) { + opBuilder.setAttr("drop_remainder", opts.dropRemainder); + } + } + } return new SlidingWindowDataset(opBuilder.build()); } + /** + * Sets the dropRemainder option. + * + * @param dropRemainder the dropRemainder option + * @return this Options instance. + */ + public static Options dropRemainder(Boolean dropRemainder) { + return new Options().dropRemainder(dropRemainder); + } + /** * Gets handle. * @@ -101,4 +129,80 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.SlidingWindowDataset} + */ + public static class Options { + private Boolean dropRemainder; + + private Options() { + } + + /** + * Sets the dropRemainder option. + * + * @param dropRemainder the dropRemainder option + * @return this Options instance. + */ + public Options dropRemainder(Boolean dropRemainder) { + this.dropRemainder = dropRemainder; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SlidingWindowDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements in the + * sliding window. + */ + public final Operand windowSize; + + /** + * A scalar representing the steps moving the sliding window + * forward in one iteration. It must be positive. + */ + public final Operand windowShift; + + /** + * A scalar representing the stride of the input elements of the sliding window. + * It must be positive. + */ + public final Operand windowStride; + + /** + * The dropRemainder attribute + */ + public final boolean dropRemainder; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SlidingWindowDataset(op), op, Arrays.asList("drop_remainder", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + windowSize = (Operand) op.input(inputIndex++); + windowShift = (Operand) op.input(inputIndex++); + windowStride = (Operand) op.input(inputIndex++); + dropRemainder = op.attributes().getAttrBool("drop_remainder"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotChunkDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotChunkDataset.java new file mode 100644 index 00000000000..df6172f9075 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotChunkDataset.java @@ -0,0 +1,177 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * The SnapshotChunkDataset operation + */ +@OpMetadata( + opType = SnapshotChunkDataset.OP_NAME, + inputsClass = SnapshotChunkDataset.Inputs.class +) +@Operator( + group = "data" +) +public final class SnapshotChunkDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SnapshotChunkDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public SnapshotChunkDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SnapshotChunkDataset operation. + * + * @param scope current scope + * @param chunkFile The chunkFile value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of SnapshotChunkDataset + */ + @Endpoint( + describeByClass = true + ) + public static SnapshotChunkDataset create(Scope scope, Operand chunkFile, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SnapshotChunkDataset"); + opBuilder.addInput(chunkFile.asOutput()); + 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.compression != null) { + opBuilder.setAttr("compression", opts.compression); + } + } + } + return new SnapshotChunkDataset(opBuilder.build()); + } + + /** + * Sets the compression option. + * + * @param compression the compression option + * @return this Options instance. + */ + public static Options compression(String compression) { + return new Options().compression(compression); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.SnapshotChunkDataset} + */ + public static class Options { + private String compression; + + private Options() { + } + + /** + * Sets the compression option. + * + * @param compression the compression option + * @return this Options instance. + */ + public Options compression(String compression) { + this.compression = compression; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SnapshotChunkDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The chunkFile input + */ + public final Operand chunkFile; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The compression attribute + */ + public final String compression; + + public Inputs(GraphOperation op) { + super(new SnapshotChunkDataset(op), op, Arrays.asList("output_types", "output_shapes", "compression")); + int inputIndex = 0; + chunkFile = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + compression = op.attributes().getAttrString("compression"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDataset.java index 071a1d9ff0a..38d3a7f88a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -39,6 +45,10 @@ * If not, it will run the preprocessing pipeline as usual, and write out a * snapshot of the data processed for future use. */ +@OpMetadata( + opType = SnapshotDataset.OP_NAME, + inputsClass = SnapshotDataset.Inputs.class +) @Operator( group = "data" ) @@ -51,8 +61,8 @@ public final class SnapshotDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SnapshotDataset(Operation operation) { - super(operation); + public SnapshotDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -63,10 +73,10 @@ private SnapshotDataset(Operation operation) { * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. * @param path The path we should write snapshots to / read snapshots from. - * @param readerFuncOtherArgs the readerFuncOtherArgs value - * @param shardFuncOtherArgs the shardFuncOtherArgs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param shardFuncOtherArgs The shardFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param readerFunc Optional. A function to control how to read data from snapshot shards. * @param shardFunc Optional. A function to control how to shard data when writing a snapshot. * @param options carries optional attribute values @@ -110,6 +120,9 @@ public static SnapshotDataset create(Scope scope, Operand input if (opts.hash != null) { opBuilder.setAttr("hash", opts.hash); } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } } } return new SnapshotDataset(opBuilder.build()); @@ -165,6 +178,16 @@ public static Options hash(Long hash) { return new Options().hash(hash); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -194,6 +217,8 @@ public static class Options { private Long hash; + private String metadata; + private Options() { } @@ -251,5 +276,114 @@ public Options hash(Long hash) { this.hash = hash; return this; } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SnapshotDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * The path we should write snapshots to / read snapshots from. + */ + public final Operand path; + + /** + * The readerFuncOtherArgs input + */ + public final Iterable> readerFuncOtherArgs; + + /** + * The shardFuncOtherArgs input + */ + public final Iterable> shardFuncOtherArgs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The type of compression to be applied to the saved snapshot files. + */ + public final String compression; + + /** + * The readerPrefix attribute + */ + public final String readerPrefix; + + /** + * The writerPrefix attribute + */ + public final String writerPrefix; + + /** + * The hashValid attribute + */ + public final boolean hashValid; + + /** + * The hash attribute + */ + public final long hash; + + /** + * The TreaderFuncArgs attribute + */ + public final DataType[] TreaderFuncArgs; + + /** + * The TshardFuncArgs attribute + */ + public final DataType[] TshardFuncArgs; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new SnapshotDataset(op), op, Arrays.asList("output_types", "output_shapes", "compression", "reader_prefix", "writer_prefix", "hash_valid", "hash", "Treader_func_args", "Tshard_func_args", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + path = (Operand) op.input(inputIndex++); + int readerFuncOtherArgsLength = op.inputListLength("reader_func_other_args"); + readerFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, readerFuncOtherArgsLength)); + inputIndex += readerFuncOtherArgsLength; + int shardFuncOtherArgsLength = op.inputListLength("shard_func_other_args"); + shardFuncOtherArgs = Arrays.asList((Operand[]) op.inputList(inputIndex, shardFuncOtherArgsLength)); + inputIndex += shardFuncOtherArgsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + compression = op.attributes().getAttrString("compression"); + readerPrefix = op.attributes().getAttrString("reader_prefix"); + writerPrefix = op.attributes().getAttrString("writer_prefix"); + hashValid = op.attributes().getAttrBool("hash_valid"); + hash = op.attributes().getAttrInt("hash"); + TreaderFuncArgs = op.attributes().getAttrTypeList("Treader_func_args"); + TshardFuncArgs = op.attributes().getAttrTypeList("Tshard_func_args"); + metadata = op.attributes().getAttrString("metadata"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDatasetReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDatasetReader.java index aa33c499b50..8a20a594bcf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDatasetReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotDatasetReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,8 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -34,6 +41,13 @@ /** * The SnapshotDatasetReader operation */ +@OpMetadata( + opType = SnapshotDatasetReader.OP_NAME, + inputsClass = SnapshotDatasetReader.Inputs.class +) +@Operator( + group = "data" +) public final class SnapshotDatasetReader extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +57,8 @@ public final class SnapshotDatasetReader extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private SnapshotDatasetReader(Operation operation) { - super(operation); + public SnapshotDatasetReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -53,11 +67,11 @@ private SnapshotDatasetReader(Operation operation) { * Factory method to create a class wrapping a new SnapshotDatasetReader operation. * * @param scope current scope - * @param shardDir the shardDir value - * @param startIndex the startIndex value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property - * @param version the value of the version property + * @param shardDir The shardDir value + * @param startIndex The startIndex value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param version The value of the version attribute * @param options carries optional attribute values * @return a new instance of SnapshotDatasetReader */ @@ -132,4 +146,50 @@ public Options compression(String compression) { return this; } } + + @OpInputsMetadata( + outputsClass = SnapshotDatasetReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * The shardDir input + */ + public final Operand shardDir; + + /** + * The startIndex input + */ + public final Operand startIndex; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The compression attribute + */ + public final String compression; + + /** + * The version attribute + */ + public final long version; + + public Inputs(GraphOperation op) { + super(new SnapshotDatasetReader(op), op, Arrays.asList("output_types", "output_shapes", "compression", "version")); + int inputIndex = 0; + shardDir = (Operand) op.input(inputIndex++); + startIndex = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + compression = op.attributes().getAttrString("compression"); + version = op.attributes().getAttrInt("version"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotNestedDatasetReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotNestedDatasetReader.java index db9712a9d14..3d60a2cc237 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotNestedDatasetReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SnapshotNestedDatasetReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The SnapshotNestedDatasetReader operation */ +@OpMetadata( + opType = SnapshotNestedDatasetReader.OP_NAME, + inputsClass = SnapshotNestedDatasetReader.Inputs.class +) +@Operator( + group = "data" +) public final class SnapshotNestedDatasetReader extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class SnapshotNestedDatasetReader extends RawOp implements Operand< private Output handle; @SuppressWarnings("unchecked") - private SnapshotNestedDatasetReader(Operation operation) { - super(operation); + public SnapshotNestedDatasetReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,9 +65,9 @@ private SnapshotNestedDatasetReader(Operation operation) { * Factory method to create a class wrapping a new SnapshotNestedDatasetReader operation. * * @param scope current scope - * @param inputs the inputs value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SnapshotNestedDatasetReader */ @Endpoint( @@ -87,4 +101,34 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SnapshotNestedDatasetReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SnapshotNestedDatasetReader(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java index f9040abd1c4..bc9b0ec42c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that splits a SparseTensor into elements row-wise. */ +@OpMetadata( + opType = SparseTensorSliceDataset.OP_NAME, + inputsClass = SparseTensorSliceDataset.Inputs.class +) @Operator( group = "data" ) @@ -43,8 +53,8 @@ public final class SparseTensorSliceDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private SparseTensorSliceDataset(Operation operation) { - super(operation); + public SparseTensorSliceDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -53,9 +63,9 @@ private SparseTensorSliceDataset(Operation operation) { * Factory method to create a class wrapping a new SparseTensorSliceDataset operation. * * @param scope current scope - * @param indices the indices value - * @param values the values value - * @param denseShape the denseShape value + * @param indices The indices value + * @param values The values value + * @param denseShape The denseShape value * @return a new instance of SparseTensorSliceDataset */ @Endpoint( @@ -84,4 +94,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SparseTensorSliceDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The values input + */ + public final Operand values; + + /** + * The denseShape input + */ + public final Operand denseShape; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + public Inputs(GraphOperation op) { + super(new SparseTensorSliceDataset(op), op, Arrays.asList("Tvalues")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + denseShape = (Operand) op.input(inputIndex++); + Tvalues = op.attributes().getAttrType("Tvalues"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java index 2b4bb39e58e..8c2b58b8b7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Creates a dataset that executes a SQL query and emits rows of the result set. */ +@OpMetadata( + opType = SqlDataset.OP_NAME, + inputsClass = SqlDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class SqlDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SqlDataset(Operation operation) { - super(operation); + public SqlDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,8 +69,8 @@ private SqlDataset(Operation operation) { * @param driverName The database type. Currently, the only supported type is 'sqlite'. * @param dataSourceName A connection string to connect to the database. * @param query A SQL query to execute. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SqlDataset */ @Endpoint( @@ -96,4 +106,44 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SqlDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The database type. Currently, the only supported type is 'sqlite'. + */ + public final Operand driverName; + + /** + * A connection string to connect to the database. + */ + public final Operand dataSourceName; + + /** + * A SQL query to execute. + */ + public final Operand query; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SqlDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + driverName = (Operand) op.input(inputIndex++); + dataSourceName = (Operand) op.input(inputIndex++); + query = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java index 0040b1848f8..080585d34a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The StatsAggregatorHandleV2 operation */ +@OpMetadata( + opType = StatsAggregatorHandle.OP_NAME, + inputsClass = StatsAggregatorHandle.Inputs.class +) +@Operator( + group = "data" +) public final class StatsAggregatorHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class StatsAggregatorHandle extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private StatsAggregatorHandle(Operation operation) { - super(operation); + public StatsAggregatorHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -137,4 +150,26 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = StatsAggregatorHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new StatsAggregatorHandle(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorSetSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorSetSummaryWriter.java index b97c1dd7100..c610409f62a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorSetSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorSetSummaryWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,33 +17,46 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Set a summary_writer_interface to record statistics using given stats_aggregator. */ +@OpMetadata( + opType = StatsAggregatorSetSummaryWriter.OP_NAME, + inputsClass = StatsAggregatorSetSummaryWriter.Inputs.class +) +@Operator( + group = "data" +) public final class StatsAggregatorSetSummaryWriter extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "StatsAggregatorSetSummaryWriter"; - private StatsAggregatorSetSummaryWriter(Operation operation) { - super(operation); + public StatsAggregatorSetSummaryWriter(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new StatsAggregatorSetSummaryWriter operation. * * @param scope current scope - * @param statsAggregator the statsAggregator value - * @param summary the summary value + * @param statsAggregator The statsAggregator value + * @param summary The summary value * @return a new instance of StatsAggregatorSetSummaryWriter */ @Endpoint( @@ -56,4 +69,26 @@ public static StatsAggregatorSetSummaryWriter create(Scope scope, opBuilder.addInput(summary.asOutput()); return new StatsAggregatorSetSummaryWriter(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = StatsAggregatorSetSummaryWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The statsAggregator input + */ + public final Operand statsAggregator; + + /** + * The summary input + */ + public final Operand summary; + + public Inputs(GraphOperation op) { + super(new StatsAggregatorSetSummaryWriter(op), op, Arrays.asList()); + int inputIndex = 0; + statsAggregator = (Operand) op.input(inputIndex++); + summary = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java index 788dbd06df5..d5217efbdbf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,15 +27,23 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. */ +@OpMetadata( + opType = TakeDataset.OP_NAME, + inputsClass = TakeDataset.Inputs.class +) @Operator( group = "data" ) @@ -46,8 +56,8 @@ public final class TakeDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TakeDataset(Operation operation) { - super(operation); + public TakeDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,19 +66,21 @@ private TakeDataset(Operation operation) { * Factory method to create a class wrapping a new TakeDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param count A scalar representing the number of elements from the {@code input_dataset} * that should be taken. A value of {@code -1} indicates that all of {@code input_dataset} * is taken. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TakeDataset */ @Endpoint( describeByClass = true ) public static TakeDataset create(Scope scope, Operand inputDataset, - Operand count, List> outputTypes, List outputShapes) { + Operand count, List> outputTypes, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); @@ -78,9 +90,26 @@ public static TakeDataset create(Scope scope, Operand inputData outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new TakeDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -95,4 +124,67 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TakeDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TakeDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements from the {@code input_dataset} + * that should be taken. A value of {@code -1} indicates that all of {@code input_dataset} + * is taken. + */ + public final Operand count; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new TakeDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + count = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeWhileDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeWhileDataset.java index 1e680f60071..5df499a1e60 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeWhileDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeWhileDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,6 +46,10 @@ *

  • One tensor for each value in {@code other_arguments}.
  • * */ +@OpMetadata( + opType = TakeWhileDataset.OP_NAME, + inputsClass = TakeWhileDataset.Inputs.class +) @Operator( group = "data" ) @@ -52,8 +62,8 @@ public final class TakeWhileDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TakeWhileDataset(Operation operation) { - super(operation); + public TakeWhileDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -62,12 +72,13 @@ private TakeWhileDataset(Operation operation) { * Factory method to create a class wrapping a new TakeWhileDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param otherArguments A list of tensors, typically values that were captured when * building a closure for {@code predicate}. * @param predicate A function returning a scalar boolean. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TakeWhileDataset */ @Endpoint( @@ -75,7 +86,7 @@ private TakeWhileDataset(Operation operation) { ) public static TakeWhileDataset create(Scope scope, Operand inputDataset, Iterable> otherArguments, ConcreteFunction predicate, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TakeWhileDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(otherArguments)); @@ -86,9 +97,26 @@ public static TakeWhileDataset create(Scope scope, Operand inpu outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new TakeWhileDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -103,4 +131,74 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TakeWhileDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TakeWhileDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new TakeWhileDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java index b11802e35ba..893fcfd9c6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that emits {@code components} as a tuple of tensors once. */ +@OpMetadata( + opType = TensorDataset.OP_NAME, + inputsClass = TensorDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class TensorDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TensorDataset(Operation operation) { - super(operation); + public TensorDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,15 +65,16 @@ private TensorDataset(Operation operation) { * Factory method to create a class wrapping a new TensorDataset operation. * * @param scope current scope - * @param components the components value - * @param outputShapes the value of the outputShapes property + * @param components The components value + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TensorDataset */ @Endpoint( describeByClass = true ) public static TensorDataset create(Scope scope, Iterable> components, - List outputShapes) { + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorDataset"); opBuilder.addInputList(Operands.asOutputs(components)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,9 +82,26 @@ public static TensorDataset create(Scope scope, Iterable> components, outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new TensorDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -88,4 +116,61 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TensorDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The components input + */ + public final Iterable> components; + + /** + * The ToutputTypes attribute + */ + public final DataType[] ToutputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new TensorDataset(op), op, Arrays.asList("Toutput_types", "output_shapes", "metadata")); + int inputIndex = 0; + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + ToutputTypes = op.attributes().getAttrTypeList("Toutput_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java index 420694899a5..89512f8ce8a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that emits each dim-0 slice of {@code components} once. */ +@OpMetadata( + opType = TensorSliceDataset.OP_NAME, + inputsClass = TensorSliceDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class TensorSliceDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TensorSliceDataset(Operation operation) { - super(operation); + public TensorSliceDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,15 +65,16 @@ private TensorSliceDataset(Operation operation) { * Factory method to create a class wrapping a new TensorSliceDataset operation. * * @param scope current scope - * @param components the components value - * @param outputShapes the value of the outputShapes property + * @param components The components value + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of TensorSliceDataset */ @Endpoint( describeByClass = true ) public static TensorSliceDataset create(Scope scope, Iterable> components, - List outputShapes) { + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TensorSliceDataset"); opBuilder.addInputList(Operands.asOutputs(components)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,9 +82,52 @@ public static TensorSliceDataset create(Scope scope, Iterable> compon outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.isFiles != null) { + opBuilder.setAttr("is_files", opts.isFiles); + } + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + if (opts.replicateOnSplit != null) { + opBuilder.setAttr("replicate_on_split", opts.replicateOnSplit); + } + } + } return new TensorSliceDataset(opBuilder.build()); } + /** + * Sets the isFiles option. + * + * @param isFiles the isFiles option + * @return this Options instance. + */ + public static Options isFiles(Boolean isFiles) { + return new Options().isFiles(isFiles); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Sets the replicateOnSplit option. + * + * @param replicateOnSplit the replicateOnSplit option + * @return this Options instance. + */ + public static Options replicateOnSplit(Boolean replicateOnSplit) { + return new Options().replicateOnSplit(replicateOnSplit); + } + /** * Gets handle. * @@ -88,4 +142,99 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TensorSliceDataset} + */ + public static class Options { + private Boolean isFiles; + + private String metadata; + + private Boolean replicateOnSplit; + + private Options() { + } + + /** + * Sets the isFiles option. + * + * @param isFiles the isFiles option + * @return this Options instance. + */ + public Options isFiles(Boolean isFiles) { + this.isFiles = isFiles; + return this; + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + + /** + * Sets the replicateOnSplit option. + * + * @param replicateOnSplit the replicateOnSplit option + * @return this Options instance. + */ + public Options replicateOnSplit(Boolean replicateOnSplit) { + this.replicateOnSplit = replicateOnSplit; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TensorSliceDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The components input + */ + public final Iterable> components; + + /** + * The ToutputTypes attribute + */ + public final DataType[] ToutputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The isFiles attribute + */ + public final boolean isFiles; + + /** + * The metadata attribute + */ + public final String metadata; + + /** + * The replicateOnSplit attribute + */ + public final boolean replicateOnSplit; + + public Inputs(GraphOperation op) { + super(new TensorSliceDataset(op), op, Arrays.asList("Toutput_types", "output_shapes", "is_files", "metadata", "replicate_on_split")); + int inputIndex = 0; + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + ToutputTypes = op.attributes().getAttrTypeList("Toutput_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + isFiles = op.attributes().getAttrBool("is_files"); + metadata = op.attributes().getAttrString("metadata"); + replicateOnSplit = op.attributes().getAttrBool("replicate_on_split"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java index b1076784e89..dcb30522f97 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ /** * Creates a dataset that emits the lines of one or more text files. */ +@OpMetadata( + opType = TextLineDataset.OP_NAME, + inputsClass = TextLineDataset.Inputs.class +) @Operator( group = "data" ) @@ -44,8 +53,8 @@ public final class TextLineDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TextLineDataset(Operation operation) { - super(operation); + public TextLineDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -59,20 +68,38 @@ private TextLineDataset(Operation operation) { * @param compressionType A scalar containing either (i) the empty string (no * compression), (ii) "ZLIB", or (iii) "GZIP". * @param bufferSize A scalar containing the number of bytes to buffer. + * @param options carries optional attribute values * @return a new instance of TextLineDataset */ @Endpoint( describeByClass = true ) public static TextLineDataset create(Scope scope, Operand filenames, - Operand compressionType, Operand bufferSize) { + Operand compressionType, Operand bufferSize, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TextLineDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); opBuilder.addInput(bufferSize.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new TextLineDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -87,4 +114,61 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TextLineDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TextLineDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar or a vector containing the name(s) of the file(s) to be + * read. + */ + public final Operand filenames; + + /** + * A scalar containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + */ + public final Operand compressionType; + + /** + * A scalar containing the number of bytes to buffer. + */ + public final Operand bufferSize; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new TextLineDataset(op), op, Arrays.asList("metadata")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java index 431e2a7db47..845f5dff106 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ /** * Creates a dataset that emits the records from one or more TFRecord files. */ +@OpMetadata( + opType = TfRecordDataset.OP_NAME, + inputsClass = TfRecordDataset.Inputs.class +) @Operator( group = "data" ) @@ -39,19 +48,19 @@ public final class TfRecordDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TFRecordDataset"; + public static final String OP_NAME = "TFRecordDatasetV2"; private Output handle; @SuppressWarnings("unchecked") - private TfRecordDataset(Operation operation) { - super(operation); + public TfRecordDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new TFRecordDataset operation. + * Factory method to create a class wrapping a new TFRecordDatasetV2 operation. * * @param scope current scope * @param filenames A scalar or vector containing the name(s) of the file(s) to be @@ -60,20 +69,42 @@ private TfRecordDataset(Operation operation) { * compression), (ii) "ZLIB", or (iii) "GZIP". * @param bufferSize A scalar representing the number of bytes to buffer. A value of * 0 means no buffering will be performed. + * @param byteOffsets A scalar or vector containing the number of bytes for each file + * that will be skipped prior to reading. + * @param options carries optional attribute values * @return a new instance of TfRecordDataset */ @Endpoint( describeByClass = true ) public static TfRecordDataset create(Scope scope, Operand filenames, - Operand compressionType, Operand bufferSize) { + Operand compressionType, Operand bufferSize, Operand byteOffsets, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TfRecordDataset"); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); opBuilder.addInput(bufferSize.asOutput()); + opBuilder.addInput(byteOffsets.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new TfRecordDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -88,4 +119,69 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.TfRecordDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TfRecordDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar or vector containing the name(s) of the file(s) to be + * read. + */ + public final Operand filenames; + + /** + * A scalar containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + */ + public final Operand compressionType; + + /** + * A scalar representing the number of bytes to buffer. A value of + * 0 means no buffering will be performed. + */ + public final Operand bufferSize; + + /** + * A scalar or vector containing the number of bytes for each file + * that will be skipped prior to reading. + */ + public final Operand byteOffsets; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new TfRecordDataset(op), op, Arrays.asList("metadata")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + byteOffsets = (Operand) op.input(inputIndex++); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java index 85aec5ab605..1f0b5fce727 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = ThreadPoolDataset.OP_NAME, + inputsClass = ThreadPoolDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class ThreadPoolDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ThreadPoolDataset(Operation operation) { - super(operation); + public ThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,10 +65,10 @@ private ThreadPoolDataset(Operation operation) { * Factory method to create a class wrapping a new ThreadPoolDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ThreadPoolDataset */ @Endpoint( @@ -93,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ThreadPoolDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A resource produced by the ThreadPoolHandle op. + */ + public final Operand threadPool; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ThreadPoolDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + threadPool = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java index 2ac0bcfd414..8e110f97a30 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = ThreadPoolHandle.OP_NAME, + inputsClass = ThreadPoolHandle.Inputs.class +) +@Operator( + group = "data" +) public final class ThreadPoolHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class ThreadPoolHandle extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ThreadPoolHandle(Operation operation) { - super(operation); + public ThreadPoolHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -173,4 +186,47 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = ThreadPoolHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The number of threads in the thread pool. + */ + public final long numThreads; + + /** + * The maximum degree of parallelism to use within operations that execute on this + * threadpool. + */ + public final long maxIntraOpParallelism; + + /** + * A human-readable name for the threads that may be visible in some + * visualizations. + * threadpool. + */ + public final String displayName; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new ThreadPoolHandle(op), op, Arrays.asList("num_threads", "max_intra_op_parallelism", "display_name", "container", "shared_name")); + int inputIndex = 0; + numThreads = op.attributes().getAttrInt("num_threads"); + maxIntraOpParallelism = op.attributes().getAttrInt("max_intra_op_parallelism"); + displayName = op.attributes().getAttrString("display_name"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java index 6d22e02d68f..8796a5c927c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ +@OpMetadata( + opType = UnbatchDataset.OP_NAME, + inputsClass = UnbatchDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class UnbatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private UnbatchDataset(Operation operation) { - super(operation); + public UnbatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,16 +65,17 @@ private UnbatchDataset(Operation operation) { * Factory method to create a class wrapping a new UnbatchDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of UnbatchDataset */ @Endpoint( describeByClass = true ) public static UnbatchDataset create(Scope scope, Operand inputDataset, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UnbatchDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); @@ -73,9 +84,26 @@ public static UnbatchDataset create(Scope scope, Operand inputD outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new UnbatchDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -90,4 +118,59 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.UnbatchDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UnbatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new UnbatchDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UncompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UncompressElement.java index 168ea7488f7..9c871ae7b08 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UncompressElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UncompressElement.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,13 +28,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Uncompresses a compressed dataset element. */ +@OpMetadata( + opType = UncompressElement.OP_NAME, + inputsClass = UncompressElement.Inputs.class +) +@Operator( + group = "data" +) public final class UncompressElement extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class UncompressElement extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private UncompressElement(Operation operation) { - super(operation); + public UncompressElement(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -55,9 +68,9 @@ private UncompressElement(Operation operation) { * Factory method to create a class wrapping a new UncompressElement operation. * * @param scope current scope - * @param compressed the compressed value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param compressed The compressed value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of UncompressElement */ @Endpoint( @@ -90,4 +103,32 @@ public List> components() { public Iterator> iterator() { return (Iterator) components.iterator(); } + + @OpInputsMetadata( + outputsClass = UncompressElement.class + ) + public static class Inputs extends RawOpInputs { + /** + * The compressed input + */ + public final Operand compressed; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new UncompressElement(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + compressed = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java index f8919551a23..e1d09ba23c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the unique elements of {@code input_dataset}. */ +@OpMetadata( + opType = UniqueDataset.OP_NAME, + inputsClass = UniqueDataset.Inputs.class +) @Operator( group = "data" ) @@ -45,8 +55,8 @@ public final class UniqueDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private UniqueDataset(Operation operation) { - super(operation); + public UniqueDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,16 +65,17 @@ private UniqueDataset(Operation operation) { * Factory method to create a class wrapping a new UniqueDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of UniqueDataset */ @Endpoint( describeByClass = true ) public static UniqueDataset create(Scope scope, Operand inputDataset, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniqueDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); @@ -73,9 +84,26 @@ public static UniqueDataset create(Scope scope, Operand inputDa outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new UniqueDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -90,4 +118,59 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.UniqueDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniqueDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new UniqueDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java index 12ffdcb7f9d..2d34856c703 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The UnwrapDatasetVariant operation */ +@OpMetadata( + opType = UnwrapDatasetVariant.OP_NAME, + inputsClass = UnwrapDatasetVariant.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class UnwrapDatasetVariant extends RawOp implements Operand private Output outputHandle; @SuppressWarnings("unchecked") - private UnwrapDatasetVariant(Operation operation) { - super(operation); + public UnwrapDatasetVariant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private UnwrapDatasetVariant(Operation operation) { * Factory method to create a class wrapping a new UnwrapDatasetVariant operation. * * @param scope current scope - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of UnwrapDatasetVariant */ @Endpoint( @@ -78,4 +87,20 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = UnwrapDatasetVariant.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + public Inputs(GraphOperation op) { + super(new UnwrapDatasetVariant(op), op, Arrays.asList()); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WeightedFlatMapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WeightedFlatMapDataset.java new file mode 100644 index 00000000000..2f97c1e168c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WeightedFlatMapDataset.java @@ -0,0 +1,186 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat64; +import org.tensorflow.types.family.TType; + +/** + * The WeightedFlatMapDataset operation + */ +@OpMetadata( + opType = WeightedFlatMapDataset.OP_NAME, + inputsClass = WeightedFlatMapDataset.Inputs.class +) +public final class WeightedFlatMapDataset extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WeightedFlatMapDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + public WeightedFlatMapDataset(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new WeightedFlatMapDataset operation. + * + * @param scope current scope + * @param inputDatasets The inputDatasets value + * @param weights The weights value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of WeightedFlatMapDataset + */ + @Endpoint( + describeByClass = true + ) + public static WeightedFlatMapDataset create(Scope scope, + Iterable> inputDatasets, Iterable> weights, + List> outputTypes, List outputShapes, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WeightedFlatMapDataset"); + opBuilder.addInputList(Operands.asOutputs(inputDatasets)); + opBuilder.addInputList(Operands.asOutputs(weights)); + 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.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new WeightedFlatMapDataset(opBuilder.build()); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + /** + * Optional attributes for {@link org.tensorflow.op.data.WeightedFlatMapDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = WeightedFlatMapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDatasets input + */ + public final Iterable> inputDatasets; + + /** + * The weights input + */ + public final Iterable> weights; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new WeightedFlatMapDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + int inputDatasetsLength = op.inputListLength("input_datasets"); + inputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, inputDatasetsLength)); + inputIndex += inputDatasetsLength; + int weightsLength = op.inputListLength("weights"); + weights = Arrays.asList((Operand[]) op.inputList(inputIndex, weightsLength)); + inputIndex += weightsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java index eefcbf8970c..97933bf6de3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -70,6 +76,10 @@ * produces {@code {{"a": {0, 1}}, {"a": {2, 3}}}} * */ +@OpMetadata( + opType = WindowDataset.OP_NAME, + inputsClass = WindowDataset.Inputs.class +) @Operator( group = "data" ) @@ -82,8 +92,8 @@ public final class WindowDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private WindowDataset(Operation operation) { - super(operation); + public WindowDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -92,7 +102,7 @@ private WindowDataset(Operation operation) { * Factory method to create a class wrapping a new WindowDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param sizeOutput An integer scalar, representing the number of elements * of the input dataset to combine into a window. Must be positive. * @param shift An integer scalar, representing the number of input elements @@ -103,8 +113,9 @@ private WindowDataset(Operation operation) { * "retain every input element". * @param dropRemainder A Boolean scalar, representing whether the last window should be * dropped if its size is smaller than {@code window_size}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of WindowDataset */ @Endpoint( @@ -113,7 +124,7 @@ private WindowDataset(Operation operation) { public static WindowDataset create(Scope scope, Operand inputDataset, Operand sizeOutput, Operand shift, Operand stride, Operand dropRemainder, List> outputTypes, - List outputShapes) { + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WindowDataset"); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sizeOutput.asOutput()); @@ -126,9 +137,26 @@ public static WindowDataset create(Scope scope, Operand inputDa outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new WindowDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -143,4 +171,89 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.WindowDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = WindowDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * An integer scalar, representing the number of elements + * of the input dataset to combine into a window. Must be positive. + */ + public final Operand sizeOutput; + + /** + * An integer scalar, representing the number of input elements + * by which the window moves in each iteration. Defaults to {@code size}. + * Must be positive. + */ + public final Operand shift; + + /** + * An integer scalar, representing the stride of the input elements + * in the sliding window. Must be positive. The default value of 1 means + * "retain every input element". + */ + public final Operand stride; + + /** + * A Boolean scalar, representing whether the last window should be + * dropped if its size is smaller than {@code window_size}. + */ + public final Operand dropRemainder; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new WindowDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + shift = (Operand) op.input(inputIndex++); + stride = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowOp.java new file mode 100644 index 00000000000..74097c53e64 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowOp.java @@ -0,0 +1,139 @@ +/* Copyright 2018-2023 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.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The WindowOp operation + */ +@OpMetadata( + opType = WindowOp.OP_NAME, + inputsClass = WindowOp.Inputs.class +) +@Operator( + group = "data" +) +public final class WindowOp extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WindowOp"; + + private Output handle; + + @SuppressWarnings("unchecked") + public WindowOp(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new WindowOp operation. + * + * @param scope current scope + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of WindowOp + */ + @Endpoint( + describeByClass = true + ) + public static WindowOp create(Scope scope, Iterable> inputs, + List> outputTypes, List outputShapes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "WindowOp"); + opBuilder.addInputList(Operands.asOutputs(inputs)); + 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 WindowOp(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + @OpInputsMetadata( + outputsClass = WindowOp.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The Tinputs attribute + */ + public final DataType[] Tinputs; + + public Inputs(GraphOperation op) { + super(new WindowOp(op), op, Arrays.asList("output_types", "output_shapes", "Tinputs")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + Tinputs = op.attributes().getAttrTypeList("Tinputs"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java index dcc6efc6332..6359864b83b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.data; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The WrapDatasetVariant operation */ +@OpMetadata( + opType = WrapDatasetVariant.OP_NAME, + inputsClass = WrapDatasetVariant.Inputs.class +) @Operator( group = "data" ) @@ -42,8 +51,8 @@ public final class WrapDatasetVariant extends RawOp implements Operand { private Output outputHandle; @SuppressWarnings("unchecked") - private WrapDatasetVariant(Operation operation) { - super(operation); + public WrapDatasetVariant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputHandle = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private WrapDatasetVariant(Operation operation) { * Factory method to create a class wrapping a new WrapDatasetVariant operation. * * @param scope current scope - * @param inputHandle the inputHandle value + * @param inputHandle The inputHandle value * @return a new instance of WrapDatasetVariant */ @Endpoint( @@ -78,4 +87,20 @@ public Output outputHandle() { public Output asOutput() { return (Output) outputHandle; } + + @OpInputsMetadata( + outputsClass = WrapDatasetVariant.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputHandle input + */ + public final Operand inputHandle; + + public Inputs(GraphOperation op) { + super(new WrapDatasetVariant(op), op, Arrays.asList()); + int inputIndex = 0; + inputHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java index 46a341e0d33..26fede75c81 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +43,10 @@ *

    The size of the resulting dataset will match the size of the smallest input * dataset, and no error will be raised if input datasets have different sizes. */ +@OpMetadata( + opType = ZipDataset.OP_NAME, + inputsClass = ZipDataset.Inputs.class +) @Operator( group = "data" ) @@ -49,8 +59,8 @@ public final class ZipDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ZipDataset(Operation operation) { - super(operation); + public ZipDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -60,15 +70,16 @@ private ZipDataset(Operation operation) { * * @param scope current scope * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values * @return a new instance of ZipDataset */ @Endpoint( describeByClass = true ) public static ZipDataset create(Scope scope, Iterable> inputDatasets, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ZipDataset"); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); @@ -77,9 +88,26 @@ public static ZipDataset create(Scope scope, Iterable> outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } return new ZipDataset(opBuilder.build()); } + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + /** * Gets handle. * @@ -94,4 +122,61 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + /** + * Optional attributes for {@link org.tensorflow.op.data.ZipDataset} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ZipDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * List of {@code N} variant Tensors representing datasets to be zipped together. + */ + public final Iterable> inputDatasets; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new ZipDataset(op), op, Arrays.asList("output_types", "output_shapes", "metadata")); + int inputIndex = 0; + int inputDatasetsLength = op.inputListLength("input_datasets"); + inputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, inputDatasetsLength)); + inputIndex += inputDatasetsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + metadata = op.attributes().getAttrString("metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java index 1a7829d5102..92f21d06c07 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The ExperimentalAssertNextDataset operation */ +@OpMetadata( + opType = AssertNextDataset.OP_NAME, + inputsClass = AssertNextDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class AssertNextDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class AssertNextDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private AssertNextDataset(Operation operation) { - super(operation); + public AssertNextDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private AssertNextDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalAssertNextDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param transformations the transformations value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param transformations The transformations value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of AssertNextDataset */ @Endpoint( @@ -90,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = AssertNextDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The transformations input + */ + public final Operand transformations; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AssertNextDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + transformations = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java index dfbe0d4e060..8c22e6fa9e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,8 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -39,6 +46,13 @@ *

    This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ +@OpMetadata( + opType = AutoShardDataset.OP_NAME, + inputsClass = AutoShardDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class AutoShardDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +62,8 @@ public final class AutoShardDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private AutoShardDataset(Operation operation) { - super(operation); + public AutoShardDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -61,8 +75,8 @@ private AutoShardDataset(Operation operation) { * @param inputDataset A variant tensor representing the input dataset. * @param numWorkers A scalar representing the number of workers to distribute this dataset across. * @param index A scalar representing the index of the current worker out of num_workers. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of AutoShardDataset */ @@ -137,4 +151,50 @@ public Options autoShardPolicy(Long autoShardPolicy) { return this; } } + + @OpInputsMetadata( + outputsClass = AutoShardDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of workers to distribute this dataset across. + */ + public final Operand numWorkers; + + /** + * A scalar representing the index of the current worker out of num_workers. + */ + public final Operand index; + + /** + * The autoShardPolicy attribute + */ + public final long autoShardPolicy; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new AutoShardDataset(op), op, Arrays.asList("auto_shard_policy", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numWorkers = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + autoShardPolicy = op.attributes().getAttrInt("auto_shard_policy"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java index 7c77fc6e331..d98279464ed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. */ +@OpMetadata( + opType = BytesProducedStatsDataset.OP_NAME, + inputsClass = BytesProducedStatsDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class BytesProducedStatsDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class BytesProducedStatsDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private BytesProducedStatsDataset(Operation operation) { - super(operation); + public BytesProducedStatsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private BytesProducedStatsDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalBytesProducedStatsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of BytesProducedStatsDataset */ @Endpoint( @@ -89,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = BytesProducedStatsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new BytesProducedStatsDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java index 6a0450a2e61..43e1d9d58a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,8 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -35,6 +42,13 @@ /** * The ExperimentalCSVDataset operation */ +@OpMetadata( + opType = CSVDataset.OP_NAME, + inputsClass = CSVDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class CSVDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +58,8 @@ public final class CSVDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private CSVDataset(Operation operation) { - super(operation); + public CSVDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -54,16 +68,16 @@ private CSVDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalCSVDataset operation. * * @param scope current scope - * @param filenames the filenames value - * @param compressionType the compressionType value - * @param bufferSize the bufferSize value - * @param header the header value - * @param fieldDelim the fieldDelim value - * @param useQuoteDelim the useQuoteDelim value - * @param naValue the naValue value - * @param selectCols the selectCols value - * @param recordDefaults the recordDefaults value - * @param outputShapes the value of the outputShapes property + * @param filenames The filenames value + * @param compressionType The compressionType value + * @param bufferSize The bufferSize value + * @param header The header value + * @param fieldDelim The fieldDelim value + * @param useQuoteDelim The useQuoteDelim value + * @param naValue The naValue value + * @param selectCols The selectCols value + * @param recordDefaults The recordDefaults value + * @param outputShapes The value of the outputShapes attribute * @return a new instance of CSVDataset */ @Endpoint( @@ -105,4 +119,82 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = CSVDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The filenames input + */ + public final Operand filenames; + + /** + * The compressionType input + */ + public final Operand compressionType; + + /** + * The bufferSize input + */ + public final Operand bufferSize; + + /** + * The header input + */ + public final Operand header; + + /** + * The fieldDelim input + */ + public final Operand fieldDelim; + + /** + * The useQuoteDelim input + */ + public final Operand useQuoteDelim; + + /** + * The naValue input + */ + public final Operand naValue; + + /** + * The selectCols input + */ + public final Operand selectCols; + + /** + * The recordDefaults input + */ + public final Iterable> recordDefaults; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new CSVDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + bufferSize = (Operand) op.input(inputIndex++); + header = (Operand) op.input(inputIndex++); + fieldDelim = (Operand) op.input(inputIndex++); + useQuoteDelim = (Operand) op.input(inputIndex++); + naValue = (Operand) op.input(inputIndex++); + selectCols = (Operand) op.input(inputIndex++); + int recordDefaultsLength = op.inputListLength("record_defaults"); + recordDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, recordDefaultsLength)); + inputIndex += recordDefaultsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java index 53549e4ef72..cab5575a928 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The ExperimentalChooseFastestDataset operation */ +@OpMetadata( + opType = ChooseFastestDataset.OP_NAME, + inputsClass = ChooseFastestDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ChooseFastestDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class ChooseFastestDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private ChooseFastestDataset(Operation operation) { - super(operation); + public ChooseFastestDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,10 +65,10 @@ private ChooseFastestDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalChooseFastestDataset operation. * * @param scope current scope - * @param inputDatasets the inputDatasets value - * @param numExperiments the value of the numExperiments property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDatasets The inputDatasets value + * @param numExperiments The value of the numExperiments attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ChooseFastestDataset */ @Endpoint( @@ -89,4 +103,40 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ChooseFastestDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDatasets input + */ + public final Iterable> inputDatasets; + + /** + * The numExperiments attribute + */ + public final long numExperiments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ChooseFastestDataset(op), op, Arrays.asList("num_experiments", "output_types", "output_shapes")); + int inputIndex = 0; + int inputDatasetsLength = op.inputListLength("input_datasets"); + inputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, inputDatasetsLength)); + inputIndex += inputDatasetsLength; + numExperiments = op.attributes().getAttrInt("num_experiments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java index 7efa5d34525..d73785b9a91 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -31,6 +37,13 @@ * Returns the cardinality of {@code input_dataset}. * Returns the cardinality of {@code input_dataset}. */ +@OpMetadata( + opType = DatasetCardinality.OP_NAME, + inputsClass = DatasetCardinality.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class DatasetCardinality extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +52,8 @@ public final class DatasetCardinality extends RawOp implements Operand { private Output cardinality; - private DatasetCardinality(Operation operation) { - super(operation); + public DatasetCardinality(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; cardinality = operation.output(outputIdx++); } @@ -75,4 +88,20 @@ public Output cardinality() { public Output asOutput() { return cardinality; } + + @OpInputsMetadata( + outputsClass = DatasetCardinality.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to return cardinality for. + */ + public final Operand inputDataset; + + public Inputs(GraphOperation op) { + super(new DatasetCardinality(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java index 5a82c0ece34..35889dec71c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,26 +17,39 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Writes the given dataset to the given file using the TFRecord format. */ +@OpMetadata( + opType = DatasetToTFRecord.OP_NAME, + inputsClass = DatasetToTFRecord.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class DatasetToTFRecord extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ExperimentalDatasetToTFRecord"; - private DatasetToTFRecord(Operation operation) { - super(operation); + public DatasetToTFRecord(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,4 +73,33 @@ public static DatasetToTFRecord create(Scope scope, Operand inp opBuilder.addInput(compressionType.asOutput()); return new DatasetToTFRecord(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DatasetToTFRecord.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the dataset to write. + */ + public final Operand inputDataset; + + /** + * A scalar string tensor representing the filename to use. + */ + public final Operand filename; + + /** + * A scalar string tensor containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + */ + public final Operand compressionType; + + public Inputs(GraphOperation op) { + super(new DatasetToTFRecord(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + filename = (Operand) op.input(inputIndex++); + compressionType = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java index 3cf5ef82177..414bb684323 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that batches input elements into a SparseTensor. */ +@OpMetadata( + opType = DenseToSparseBatchDataset.OP_NAME, + inputsClass = DenseToSparseBatchDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class DenseToSparseBatchDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class DenseToSparseBatchDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private DenseToSparseBatchDataset(Operation operation) { - super(operation); + public DenseToSparseBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,8 +72,8 @@ private DenseToSparseBatchDataset(Operation operation) { * @param rowShape A vector representing the dense shape of each row in the produced * SparseTensor. The shape may be partially specified, using {@code -1} to indicate * that a particular dimension should use the maximum size of all batch elements. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DenseToSparseBatchDataset */ @Endpoint( @@ -95,4 +109,47 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DenseToSparseBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A handle to an input dataset. Must have a single component. + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements to accumulate in a + * batch. + */ + public final Operand batchSize; + + /** + * A vector representing the dense shape of each row in the produced + * SparseTensor. The shape may be partially specified, using {@code -1} to indicate + * that a particular dimension should use the maximum size of all batch elements. + */ + public final Operand rowShape; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new DenseToSparseBatchDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + batchSize = (Operand) op.input(inputIndex++); + rowShape = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java index ac6de0d5dc6..6d4464a7746 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. */ +@OpMetadata( + opType = DirectedInterleaveDataset.OP_NAME, + inputsClass = DirectedInterleaveDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class DirectedInterleaveDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class DirectedInterleaveDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private DirectedInterleaveDataset(Operation operation) { - super(operation); + public DirectedInterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,8 +69,8 @@ private DirectedInterleaveDataset(Operation operation) { * {@code N} data inputs should produce the next output element. * @param dataInputDatasets {@code N} datasets with the same type that will be interleaved according to * the values of {@code selector_input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of DirectedInterleaveDataset */ @Endpoint( @@ -92,4 +106,42 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DirectedInterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A dataset of scalar {@code DT_INT64} elements that determines which of the + * {@code N} data inputs should produce the next output element. + */ + public final Operand selectorInputDataset; + + /** + * {@code N} datasets with the same type that will be interleaved according to + * the values of {@code selector_input_dataset}. + */ + public final Iterable> dataInputDatasets; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new DirectedInterleaveDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + selectorInputDataset = (Operand) op.input(inputIndex++); + int dataInputDatasetsLength = op.inputListLength("data_input_datasets"); + dataInputDatasets = Arrays.asList((Operand[]) op.inputList(inputIndex, dataInputDatasetsLength)); + inputIndex += dataInputDatasetsLength; + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java index 7529ad3c740..db37b2fc4e8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByReducerDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +28,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that computes a group-by on {@code input_dataset}. * Creates a dataset that computes a group-by on {@code input_dataset}. */ +@OpMetadata( + opType = GroupByReducerDataset.OP_NAME, + inputsClass = GroupByReducerDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class GroupByReducerDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +57,8 @@ public final class GroupByReducerDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private GroupByReducerDataset(Operation operation) { - super(operation); + public GroupByReducerDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -69,8 +83,8 @@ private GroupByReducerDataset(Operation operation) { * @param reduceFunc A function mapping the current reducer state and an element of {@code input_dataset}, * concatenated with {@code reduce_func_other_arguments} to a new reducer state. * @param finalizeFunc A function mapping the final reducer state to an output element. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of GroupByReducerDataset */ @Endpoint( @@ -115,4 +129,92 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = GroupByReducerDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code key_func}. + */ + public final Iterable> keyFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code init_func}. + */ + public final Iterable> initFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code reduce_func}. + */ + public final Iterable> reduceFuncOtherArguments; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code finalize_func}. + */ + public final Iterable> finalizeFuncOtherArguments; + + /** + * The TkeyFuncOtherArguments attribute + */ + public final DataType[] TkeyFuncOtherArguments; + + /** + * The TinitFuncOtherArguments attribute + */ + public final DataType[] TinitFuncOtherArguments; + + /** + * The TreduceFuncOtherArguments attribute + */ + public final DataType[] TreduceFuncOtherArguments; + + /** + * The TfinalizeFuncOtherArguments attribute + */ + public final DataType[] TfinalizeFuncOtherArguments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new GroupByReducerDataset(op), op, Arrays.asList("Tkey_func_other_arguments", "Tinit_func_other_arguments", "Treduce_func_other_arguments", "Tfinalize_func_other_arguments", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int keyFuncOtherArgumentsLength = op.inputListLength("key_func_other_arguments"); + keyFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, keyFuncOtherArgumentsLength)); + inputIndex += keyFuncOtherArgumentsLength; + int initFuncOtherArgumentsLength = op.inputListLength("init_func_other_arguments"); + initFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, initFuncOtherArgumentsLength)); + inputIndex += initFuncOtherArgumentsLength; + int reduceFuncOtherArgumentsLength = op.inputListLength("reduce_func_other_arguments"); + reduceFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, reduceFuncOtherArgumentsLength)); + inputIndex += reduceFuncOtherArgumentsLength; + int finalizeFuncOtherArgumentsLength = op.inputListLength("finalize_func_other_arguments"); + finalizeFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, finalizeFuncOtherArgumentsLength)); + inputIndex += finalizeFuncOtherArgumentsLength; + TkeyFuncOtherArguments = op.attributes().getAttrTypeList("Tkey_func_other_arguments"); + TinitFuncOtherArguments = op.attributes().getAttrTypeList("Tinit_func_other_arguments"); + TreduceFuncOtherArguments = op.attributes().getAttrTypeList("Treduce_func_other_arguments"); + TfinalizeFuncOtherArguments = op.attributes().getAttrTypeList("Tfinalize_func_other_arguments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByWindowDataset.java index 167a637ae37..a24b41f050d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/GroupByWindowDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +28,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that computes a windowed group-by on {@code input_dataset}. * // TODO(mrry): Support non-int64 keys. */ +@OpMetadata( + opType = GroupByWindowDataset.OP_NAME, + inputsClass = GroupByWindowDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class GroupByWindowDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +57,8 @@ public final class GroupByWindowDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private GroupByWindowDataset(Operation operation) { - super(operation); + public GroupByWindowDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -53,16 +67,16 @@ private GroupByWindowDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalGroupByWindowDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param keyFuncOtherArguments the keyFuncOtherArguments value - * @param reduceFuncOtherArguments the reduceFuncOtherArguments value - * @param windowSizeFuncOtherArguments the windowSizeFuncOtherArguments value + * @param inputDataset The inputDataset value + * @param keyFuncOtherArguments The keyFuncOtherArguments value + * @param reduceFuncOtherArguments The reduceFuncOtherArguments value + * @param windowSizeFuncOtherArguments The windowSizeFuncOtherArguments value * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. - * @param reduceFunc the value of the reduceFunc property - * @param windowSizeFunc the value of the windowSizeFunc property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param reduceFunc The value of the reduceFunc attribute + * @param windowSizeFunc The value of the windowSizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of GroupByWindowDataset */ @Endpoint( @@ -104,4 +118,74 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = GroupByWindowDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The keyFuncOtherArguments input + */ + public final Iterable> keyFuncOtherArguments; + + /** + * The reduceFuncOtherArguments input + */ + public final Iterable> reduceFuncOtherArguments; + + /** + * The windowSizeFuncOtherArguments input + */ + public final Iterable> windowSizeFuncOtherArguments; + + /** + * The TkeyFuncOtherArguments attribute + */ + public final DataType[] TkeyFuncOtherArguments; + + /** + * The TreduceFuncOtherArguments attribute + */ + public final DataType[] TreduceFuncOtherArguments; + + /** + * The TwindowSizeFuncOtherArguments attribute + */ + public final DataType[] TwindowSizeFuncOtherArguments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new GroupByWindowDataset(op), op, Arrays.asList("Tkey_func_other_arguments", "Treduce_func_other_arguments", "Twindow_size_func_other_arguments", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int keyFuncOtherArgumentsLength = op.inputListLength("key_func_other_arguments"); + keyFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, keyFuncOtherArgumentsLength)); + inputIndex += keyFuncOtherArgumentsLength; + int reduceFuncOtherArgumentsLength = op.inputListLength("reduce_func_other_arguments"); + reduceFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, reduceFuncOtherArgumentsLength)); + inputIndex += reduceFuncOtherArgumentsLength; + int windowSizeFuncOtherArgumentsLength = op.inputListLength("window_size_func_other_arguments"); + windowSizeFuncOtherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, windowSizeFuncOtherArgumentsLength)); + inputIndex += windowSizeFuncOtherArgumentsLength; + TkeyFuncOtherArguments = op.attributes().getAttrTypeList("Tkey_func_other_arguments"); + TreduceFuncOtherArguments = op.attributes().getAttrTypeList("Treduce_func_other_arguments"); + TwindowSizeFuncOtherArguments = op.attributes().getAttrTypeList("Twindow_size_func_other_arguments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } 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 f53e17499bc..26f1eabead2 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. */ +@OpMetadata( + opType = IgnoreErrorsDataset.OP_NAME, + inputsClass = IgnoreErrorsDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class IgnoreErrorsDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class IgnoreErrorsDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private IgnoreErrorsDataset(Operation operation) { - super(operation); + public IgnoreErrorsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,9 +65,9 @@ private IgnoreErrorsDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalIgnoreErrorsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of IgnoreErrorsDataset */ @@ -125,4 +139,38 @@ public Options logWarning(Boolean logWarning) { return this; } } + + @OpInputsMetadata( + outputsClass = IgnoreErrorsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The logWarning attribute + */ + public final boolean logWarning; + + public Inputs(GraphOperation op) { + super(new IgnoreErrorsDataset(op), op, Arrays.asList("output_types", "output_shapes", "log_warning")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + logWarning = op.attributes().getAttrBool("log_warning"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java index 3058f0435f2..b7dde3d078e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Returns the name of the device on which {@code resource} has been placed. */ +@OpMetadata( + opType = IteratorGetDevice.OP_NAME, + inputsClass = IteratorGetDevice.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class IteratorGetDevice extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class IteratorGetDevice extends RawOp implements Operand { private Output device; - private IteratorGetDevice(Operation operation) { - super(operation); + public IteratorGetDevice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; device = operation.output(outputIdx++); } @@ -48,7 +61,7 @@ private IteratorGetDevice(Operation operation) { * Factory method to create a class wrapping a new ExperimentalIteratorGetDevice operation. * * @param scope current scope - * @param resource the resource value + * @param resource The resource value * @return a new instance of IteratorGetDevice */ @Endpoint( @@ -73,4 +86,20 @@ public Output device() { public Output asOutput() { return device; } + + @OpInputsMetadata( + outputsClass = IteratorGetDevice.class + ) + public static class Inputs extends RawOpInputs { + /** + * The resource input + */ + public final Operand resource; + + public Inputs(GraphOperation op) { + super(new IteratorGetDevice(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java index 9f16e3a897e..582fde7e038 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. */ +@OpMetadata( + opType = LatencyStatsDataset.OP_NAME, + inputsClass = LatencyStatsDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class LatencyStatsDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class LatencyStatsDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private LatencyStatsDataset(Operation operation) { - super(operation); + public LatencyStatsDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private LatencyStatsDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalLatencyStatsDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param tag the tag value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param tag The tag value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LatencyStatsDataset */ @Endpoint( @@ -89,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = LatencyStatsDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new LatencyStatsDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java index 70be4842be2..5bbb82db008 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The ExperimentalLMDBDataset operation */ +@OpMetadata( + opType = LmdbDataset.OP_NAME, + inputsClass = LmdbDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class LmdbDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class LmdbDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private LmdbDataset(Operation operation) { - super(operation); + public LmdbDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,9 +66,9 @@ private LmdbDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalLMDBDataset operation. * * @param scope current scope - * @param filenames the filenames value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param filenames The filenames value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of LmdbDataset */ @Endpoint( @@ -87,4 +101,32 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = LmdbDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The filenames input + */ + public final Operand filenames; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new LmdbDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + filenames = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapAndBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapAndBatchDataset.java index 558a9dcfc73..18ac4e051f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapAndBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapAndBatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -39,6 +46,13 @@ *

    Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up * to {@code batch_size * num_parallel_batches} copies of {@code f} in parallel. */ +@OpMetadata( + opType = MapAndBatchDataset.OP_NAME, + inputsClass = MapAndBatchDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class MapAndBatchDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +62,8 @@ public final class MapAndBatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private MapAndBatchDataset(Operation operation) { - super(operation); + public MapAndBatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -70,8 +84,8 @@ private MapAndBatchDataset(Operation operation) { * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size * is smaller than desired. * @param f A function to apply to the outputs of {@code input_dataset}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapAndBatchDataset */ @@ -150,4 +164,76 @@ public Options preserveCardinality(Boolean preserveCardinality) { return this; } } + + @OpInputsMetadata( + outputsClass = MapAndBatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when building a closure + * for {@code f}. + */ + public final Iterable> otherArguments; + + /** + * A scalar representing the number of elements to accumulate in a + * batch. It determines the number of concurrent invocations of {@code f} that process + * elements from {@code input_dataset} in parallel. + */ + public final Operand batchSize; + + /** + * A scalar representing the maximum number of parallel invocations of the {@code map_fn} + * function. Applying the {@code map_fn} on consecutive input elements in parallel has + * the potential to improve input pipeline throughput. + */ + public final Operand numParallelCalls; + + /** + * A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + */ + public final Operand dropRemainder; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + public Inputs(GraphOperation op) { + super(new MapAndBatchDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "preserve_cardinality")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + batchSize = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + dropRemainder = (Operand) op.input(inputIndex++); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapDataset.java index 0e62ebd5e11..7c8cfafc8f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MapDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,13 +28,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. */ +@OpMetadata( + opType = MapDataset.OP_NAME, + inputsClass = MapDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class MapDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class MapDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private MapDataset(Operation operation) { - super(operation); + public MapDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,11 +66,11 @@ private MapDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalMapDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of MapDataset */ @@ -84,6 +98,9 @@ public static MapDataset create(Scope scope, Operand inputDatas if (opts.preserveCardinality != null) { opBuilder.setAttr("preserve_cardinality", opts.preserveCardinality); } + if (opts.forceSynchronous != null) { + opBuilder.setAttr("force_synchronous", opts.forceSynchronous); + } } } return new MapDataset(opBuilder.build()); @@ -109,6 +126,16 @@ public static Options preserveCardinality(Boolean preserveCardinality) { return new Options().preserveCardinality(preserveCardinality); } + /** + * Sets the forceSynchronous option. + * + * @param forceSynchronous the forceSynchronous option + * @return this Options instance. + */ + public static Options forceSynchronous(Boolean forceSynchronous) { + return new Options().forceSynchronous(forceSynchronous); + } + /** * Gets handle. * @@ -132,6 +159,8 @@ public static class Options { private Boolean preserveCardinality; + private Boolean forceSynchronous; + private Options() { } @@ -156,5 +185,76 @@ public Options preserveCardinality(Boolean preserveCardinality) { this.preserveCardinality = preserveCardinality; return this; } + + /** + * Sets the forceSynchronous option. + * + * @param forceSynchronous the forceSynchronous option + * @return this Options instance. + */ + public Options forceSynchronous(Boolean forceSynchronous) { + this.forceSynchronous = forceSynchronous; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MapDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The useInterOpParallelism attribute + */ + public final boolean useInterOpParallelism; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + /** + * The forceSynchronous attribute + */ + public final boolean forceSynchronous; + + public Inputs(GraphOperation op) { + super(new MapDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes", "use_inter_op_parallelism", "preserve_cardinality", "force_synchronous")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + useInterOpParallelism = op.attributes().getAttrBool("use_inter_op_parallelism"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + forceSynchronous = op.attributes().getAttrBool("force_synchronous"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java index ab878c00539..37486a2a506 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The ExperimentalMatchingFilesDataset operation */ +@OpMetadata( + opType = MatchingFilesDataset.OP_NAME, + inputsClass = MatchingFilesDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class MatchingFilesDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +52,8 @@ public final class MatchingFilesDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private MatchingFilesDataset(Operation operation) { - super(operation); + public MatchingFilesDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -49,7 +62,7 @@ private MatchingFilesDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalMatchingFilesDataset operation. * * @param scope current scope - * @param patterns the patterns value + * @param patterns The patterns value * @return a new instance of MatchingFilesDataset */ @Endpoint( @@ -75,4 +88,20 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = MatchingFilesDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The patterns input + */ + public final Operand patterns; + + public Inputs(GraphOperation op) { + super(new MatchingFilesDataset(op), op, Arrays.asList()); + int inputIndex = 0; + patterns = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java index 9cb10df0fa7..e8d73813cbd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that overrides the maximum intra-op parallelism. */ +@OpMetadata( + opType = MaxIntraOpParallelismDataset.OP_NAME, + inputsClass = MaxIntraOpParallelismDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class MaxIntraOpParallelismDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class MaxIntraOpParallelismDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); + public MaxIntraOpParallelismDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private MaxIntraOpParallelismDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalMaxIntraOpParallelismDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of MaxIntraOpParallelismDataset */ @Endpoint( @@ -90,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = MaxIntraOpParallelismDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * Identifies the maximum intra-op parallelism to use. + */ + public final Operand maxIntraOpParallelism; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new MaxIntraOpParallelismDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + maxIntraOpParallelism = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java index 3f181e88877..fcfeda256ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The ExperimentalNonSerializableDataset operation */ +@OpMetadata( + opType = NonSerializableDataset.OP_NAME, + inputsClass = NonSerializableDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class NonSerializableDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class NonSerializableDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private NonSerializableDataset(Operation operation) { - super(operation); + public NonSerializableDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,9 +65,9 @@ private NonSerializableDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalNonSerializableDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of NonSerializableDataset */ @Endpoint( @@ -86,4 +100,32 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = NonSerializableDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new NonSerializableDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParallelInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParallelInterleaveDataset.java index 7d12f7468dc..df03bf4d26a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParallelInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParallelInterleaveDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -41,6 +48,13 @@ * allows the training step to proceed so long as some data is available. *

    !! WARNING !! This dataset is not deterministic! */ +@OpMetadata( + opType = ParallelInterleaveDataset.OP_NAME, + inputsClass = ParallelInterleaveDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ParallelInterleaveDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -50,8 +64,8 @@ public final class ParallelInterleaveDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private ParallelInterleaveDataset(Operation operation) { - super(operation); + public ParallelInterleaveDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -60,18 +74,18 @@ private ParallelInterleaveDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalParallelInterleaveDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param otherArguments the otherArguments value - * @param cycleLength the cycleLength value - * @param blockLength the blockLength value - * @param sloppy the sloppy value - * @param bufferOutputElements the bufferOutputElements value - * @param prefetchInputElements the prefetchInputElements value + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value + * @param sloppy The sloppy value + * @param bufferOutputElements The bufferOutputElements value + * @param prefetchInputElements The prefetchInputElements value * @param f A function mapping elements of {@code input_dataset}, concatenated with * {@code other_arguments}, to a Dataset variant that contains elements matching * {@code output_types} and {@code output_shapes}. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ParallelInterleaveDataset */ @Endpoint( @@ -114,4 +128,76 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ParallelInterleaveDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The cycleLength input + */ + public final Operand cycleLength; + + /** + * The blockLength input + */ + public final Operand blockLength; + + /** + * The sloppy input + */ + public final Operand sloppy; + + /** + * The bufferOutputElements input + */ + public final Operand bufferOutputElements; + + /** + * The prefetchInputElements input + */ + public final Operand prefetchInputElements; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ParallelInterleaveDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + cycleLength = (Operand) op.input(inputIndex++); + blockLength = (Operand) op.input(inputIndex++); + sloppy = (Operand) op.input(inputIndex++); + bufferOutputElements = (Operand) op.input(inputIndex++); + prefetchInputElements = (Operand) op.input(inputIndex++); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java index 07382c698c9..28c138c0032 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Transforms {@code input_dataset} containing {@code Example} protos as vectors of DT_STRING into a dataset of {@code Tensor} or {@code SparseTensor} objects representing the parsed features. */ +@OpMetadata( + opType = ParseExampleDataset.OP_NAME, + inputsClass = ParseExampleDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ParseExampleDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class ParseExampleDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ParseExampleDataset(Operation operation) { - super(operation); + public ParseExampleDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,8 +66,8 @@ private ParseExampleDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalParseExampleDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param numParallelCalls the numParallelCalls value + * @param inputDataset The inputDataset value + * @param numParallelCalls The numParallelCalls value * @param denseDefaults A dict mapping string keys to {@code Tensor}s. * The keys of the dict must match the dense_keys of the feature. * @param sparseKeys A list of string keys in the examples features. @@ -165,4 +179,97 @@ public Options sloppy(Boolean sloppy) { return this; } } + + @OpInputsMetadata( + outputsClass = ParseExampleDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The numParallelCalls input + */ + public final Operand numParallelCalls; + + /** + * A dict mapping string keys to {@code Tensor}s. + * The keys of the dict must match the dense_keys of the feature. + */ + public final Iterable> denseDefaults; + + /** + * A list of string keys in the examples features. + * The results for these keys will be returned as {@code SparseTensor} objects. + */ + public final String[] sparseKeys; + + /** + * A list of Ndense string Tensors (scalars). + * The keys expected in the Examples features associated with dense values. + */ + public final String[] denseKeys; + + /** + * A list of {@code DTypes} of the same length as {@code sparse_keys}. + * Only {@code tf.float32} ({@code FloatList}), {@code tf.int64} ({@code Int64List}), + * and {@code tf.string} ({@code BytesList}) are supported. + */ + public final DataType[] sparseTypes; + + /** + * A list of DTypes of the same length as {@code dense_keys}. + * Only {@code tf.float32} ({@code FloatList}), {@code tf.int64} ({@code Int64List}), + * and {@code tf.string} ({@code BytesList}) are supported. + */ + public final DataType[] Tdense; + + /** + * List of tuples with the same length as {@code dense_keys}. + * The shape of the data for each dense feature referenced by {@code dense_keys}. + * Required for any input tensors identified by {@code dense_keys}. Must be + * either fully defined, or may contain an unknown first dimension. + * An unknown first dimension means the feature is treated as having + * a variable number of blocks, and the output shape along this dimension + * is considered unknown at graph build time. Padding is applied for + * minibatch elements smaller than the maximum number of blocks for the + * given feature along this dimension. + */ + public final Shape[] denseShapes; + + /** + * The type list for the return values. + */ + public final DataType[] outputTypes; + + /** + * The list of shapes being produced. + */ + public final Shape[] outputShapes; + + /** + * The sloppy attribute + */ + public final boolean sloppy; + + public Inputs(GraphOperation op) { + super(new ParseExampleDataset(op), op, Arrays.asList("sparse_keys", "dense_keys", "sparse_types", "Tdense", "dense_shapes", "output_types", "output_shapes", "sloppy")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numParallelCalls = (Operand) op.input(inputIndex++); + int denseDefaultsLength = op.inputListLength("dense_defaults"); + denseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, denseDefaultsLength)); + inputIndex += denseDefaultsLength; + sparseKeys = op.attributes().getAttrStringList("sparse_keys"); + denseKeys = op.attributes().getAttrStringList("dense_keys"); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + Tdense = op.attributes().getAttrTypeList("Tdense"); + denseShapes = op.attributes().getAttrShapeList("dense_shapes"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + sloppy = op.attributes().getAttrBool("sloppy"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java index 5a00063f195..f555de177d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = PrivateThreadPoolDataset.OP_NAME, + inputsClass = PrivateThreadPoolDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class PrivateThreadPoolDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class PrivateThreadPoolDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private PrivateThreadPoolDataset(Operation operation) { - super(operation); + public PrivateThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private PrivateThreadPoolDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalPrivateThreadPoolDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of PrivateThreadPoolDataset */ @Endpoint( @@ -90,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = PrivateThreadPoolDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * Identifies the number of threads to use for the private threadpool. + */ + public final Operand numThreads; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new PrivateThreadPoolDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numThreads = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java index aa9519d9f7a..ca62de342d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a Dataset that returns pseudorandom numbers. */ +@OpMetadata( + opType = RandomDataset.OP_NAME, + inputsClass = RandomDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class RandomDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class RandomDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RandomDataset(Operation operation) { - super(operation); + public RandomDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -56,8 +70,8 @@ private RandomDataset(Operation operation) { * seed2 is set to be non-zero, the random number generator is seeded * by the given seed. Otherwise, a random seed is used. * @param seed2 A second scalar seed to avoid seed collision. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of RandomDataset */ @Endpoint( @@ -91,4 +105,40 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = RandomDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar seed for the random number generator. If either seed or + * seed2 is set to be non-zero, the random number generator is seeded + * by the given seed. Otherwise, a random seed is used. + */ + public final Operand seed; + + /** + * A second scalar seed to avoid seed collision. + */ + public final Operand seed2; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new RandomDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java index b6916632de5..f83fa7d5bc6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,8 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,6 +42,13 @@ * Creates a dataset that changes the batch size of the dataset to current batch * size // num_replicas. */ +@OpMetadata( + opType = RebatchDataset.OP_NAME, + inputsClass = RebatchDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class RebatchDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +58,8 @@ public final class RebatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RebatchDataset(Operation operation) { - super(operation); + public RebatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,8 +72,8 @@ private RebatchDataset(Operation operation) { * @param numReplicas A scalar representing the number of replicas to distribute this batch across. As * a result of this transformation the current batch size would end up being * divided by this parameter. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of RebatchDataset */ @@ -133,4 +147,46 @@ public Options useFallback(Boolean useFallback) { return this; } } + + @OpInputsMetadata( + outputsClass = RebatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing the input dataset. + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of replicas to distribute this batch across. As + * a result of this transformation the current batch size would end up being + * divided by this parameter. + */ + public final Operand numReplicas; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The useFallback attribute + */ + public final boolean useFallback; + + public Inputs(GraphOperation op) { + super(new RebatchDataset(op), op, Arrays.asList("output_types", "output_shapes", "use_fallback")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + numReplicas = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + useFallback = op.attributes().getAttrBool("use_fallback"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ScanDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ScanDataset.java index 83d1e9d00ff..782889a68ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ScanDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ScanDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,13 +28,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset successively reduces {@code f} over the elements of {@code input_dataset}. */ +@OpMetadata( + opType = ScanDataset.OP_NAME, + inputsClass = ScanDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ScanDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class ScanDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ScanDataset(Operation operation) { - super(operation); + public ScanDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,12 +66,12 @@ private ScanDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalScanDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param initialState the initialState value - * @param otherArguments the otherArguments value - * @param f the value of the f property - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param initialState The initialState value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @param options carries optional attribute values * @return a new instance of ScanDataset */ @@ -133,4 +147,66 @@ public Options preserveCardinality(Boolean preserveCardinality) { return this; } } + + @OpInputsMetadata( + outputsClass = ScanDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The initialState input + */ + public final Iterable> initialState; + + /** + * The otherArguments input + */ + public final Iterable> otherArguments; + + /** + * The Tstate attribute + */ + public final DataType[] Tstate; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + /** + * The preserveCardinality attribute + */ + public final boolean preserveCardinality; + + public Inputs(GraphOperation op) { + super(new ScanDataset(op), op, Arrays.asList("Tstate", "Targuments", "output_types", "output_shapes", "preserve_cardinality")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int initialStateLength = op.inputListLength("initial_state"); + initialState = Arrays.asList((Operand[]) op.inputList(inputIndex, initialStateLength)); + inputIndex += initialStateLength; + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Tstate = op.attributes().getAttrTypeList("Tstate"); + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + preserveCardinality = op.attributes().getAttrBool("preserve_cardinality"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java index 48cb4200150..1d083fa51b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The ExperimentalSetStatsAggregatorDataset operation */ +@OpMetadata( + opType = SetStatsAggregatorDataset.OP_NAME, + inputsClass = SetStatsAggregatorDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class SetStatsAggregatorDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class SetStatsAggregatorDataset extends RawOp implements Operand handle; @SuppressWarnings("unchecked") - private SetStatsAggregatorDataset(Operation operation) { - super(operation); + public SetStatsAggregatorDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,12 +66,12 @@ private SetStatsAggregatorDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalSetStatsAggregatorDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param statsAggregator the statsAggregator value - * @param tag the tag value - * @param counterPrefix the counterPrefix value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param statsAggregator The statsAggregator value + * @param tag The tag value + * @param counterPrefix The counterPrefix value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SetStatsAggregatorDataset */ @Endpoint( @@ -95,4 +109,50 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SetStatsAggregatorDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The statsAggregator input + */ + public final Operand statsAggregator; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The counterPrefix input + */ + public final Operand counterPrefix; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SetStatsAggregatorDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + statsAggregator = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + counterPrefix = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java index f491ee77fa1..8b494e8d2bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The ExperimentalSleepDataset operation */ +@OpMetadata( + opType = SleepDataset.OP_NAME, + inputsClass = SleepDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class SleepDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class SleepDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SleepDataset(Operation operation) { - super(operation); + public SleepDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,10 +66,10 @@ private SleepDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalSleepDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param sleepMicroseconds the sleepMicroseconds value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param sleepMicroseconds The sleepMicroseconds value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SleepDataset */ @Endpoint( @@ -90,4 +104,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SleepDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The sleepMicroseconds input + */ + public final Operand sleepMicroseconds; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SleepDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + sleepMicroseconds = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java index 78d282bf214..71063d28d11 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that passes a sliding window over {@code input_dataset}. */ +@OpMetadata( + opType = SlidingWindowDataset.OP_NAME, + inputsClass = SlidingWindowDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class SlidingWindowDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class SlidingWindowDataset extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private SlidingWindowDataset(Operation operation) { - super(operation); + public SlidingWindowDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -52,15 +66,15 @@ private SlidingWindowDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalSlidingWindowDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param windowSize A scalar representing the number of elements in the * sliding window. * @param windowShift A scalar representing the steps moving the sliding window * forward in one iteration. It must be positive. * @param windowStride A scalar representing the stride of the input elements of the sliding window. * It must be positive. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SlidingWindowDataset */ @Endpoint( @@ -97,4 +111,53 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SlidingWindowDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A scalar representing the number of elements in the + * sliding window. + */ + public final Operand windowSize; + + /** + * A scalar representing the steps moving the sliding window + * forward in one iteration. It must be positive. + */ + public final Operand windowShift; + + /** + * A scalar representing the stride of the input elements of the sliding window. + * It must be positive. + */ + public final Operand windowStride; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SlidingWindowDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + windowSize = (Operand) op.input(inputIndex++); + windowShift = (Operand) op.input(inputIndex++); + windowStride = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java index e5e46b1bdf3..906ad5aeed0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,14 +27,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Creates a dataset that executes a SQL query and emits rows of the result set. */ +@OpMetadata( + opType = SqlDataset.OP_NAME, + inputsClass = SqlDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class SqlDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +56,8 @@ public final class SqlDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private SqlDataset(Operation operation) { - super(operation); + public SqlDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -55,8 +69,8 @@ private SqlDataset(Operation operation) { * @param driverName The database type. Currently, the only supported type is 'sqlite'. * @param dataSourceName A connection string to connect to the database. * @param query A SQL query to execute. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of SqlDataset */ @Endpoint( @@ -92,4 +106,44 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = SqlDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The database type. Currently, the only supported type is 'sqlite'. + */ + public final Operand driverName; + + /** + * A connection string to connect to the database. + */ + public final Operand dataSourceName; + + /** + * A SQL query to execute. + */ + public final Operand query; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new SqlDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + driverName = (Operand) op.input(inputIndex++); + dataSourceName = (Operand) op.input(inputIndex++); + query = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java index c39b34e4b66..23dea9a06da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a statistics manager resource. */ +@OpMetadata( + opType = StatsAggregatorHandle.OP_NAME, + inputsClass = StatsAggregatorHandle.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class StatsAggregatorHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class StatsAggregatorHandle extends RawOp implements Operand private Output handle; @SuppressWarnings("unchecked") - private StatsAggregatorHandle(Operation operation) { - super(operation); + public StatsAggregatorHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -137,4 +150,26 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = StatsAggregatorHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new StatsAggregatorHandle(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java index cd3b21e170d..ee33f0944f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Produces a summary of any statistics recorded by the given statistics manager. */ +@OpMetadata( + opType = StatsAggregatorSummary.OP_NAME, + inputsClass = StatsAggregatorSummary.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class StatsAggregatorSummary extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class StatsAggregatorSummary extends RawOp implements Operand summary; - private StatsAggregatorSummary(Operation operation) { - super(operation); + public StatsAggregatorSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -48,7 +61,7 @@ private StatsAggregatorSummary(Operation operation) { * Factory method to create a class wrapping a new ExperimentalStatsAggregatorSummary operation. * * @param scope current scope - * @param iterator the iterator value + * @param iterator The iterator value * @return a new instance of StatsAggregatorSummary */ @Endpoint( @@ -73,4 +86,20 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = StatsAggregatorSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The iterator input + */ + public final Operand iterator; + + public Inputs(GraphOperation op) { + super(new StatsAggregatorSummary(op), op, Arrays.asList()); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/TakeWhileDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/TakeWhileDataset.java index b4390229eb2..2d3097055fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/TakeWhileDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/TakeWhileDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,8 +17,10 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,6 +46,13 @@ *

  • One tensor for each value in {@code other_arguments}.
  • * */ +@OpMetadata( + opType = TakeWhileDataset.OP_NAME, + inputsClass = TakeWhileDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class TakeWhileDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +62,8 @@ public final class TakeWhileDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private TakeWhileDataset(Operation operation) { - super(operation); + public TakeWhileDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -58,12 +72,12 @@ private TakeWhileDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalTakeWhileDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param otherArguments A list of tensors, typically values that were captured when * building a closure for {@code predicate}. * @param predicate A function returning a scalar boolean. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of TakeWhileDataset */ @Endpoint( @@ -99,4 +113,47 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = TakeWhileDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + */ + public final Iterable> otherArguments; + + /** + * The Targuments attribute + */ + public final DataType[] Targuments; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new TakeWhileDataset(op), op, Arrays.asList("Targuments", "output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + int otherArgumentsLength = op.inputListLength("other_arguments"); + otherArguments = Arrays.asList((Operand[]) op.inputList(inputIndex, otherArgumentsLength)); + inputIndex += otherArgumentsLength; + Targuments = op.attributes().getAttrTypeList("Targuments"); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java index 467f53a61af..5ceeb9f1745 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = ThreadPoolDataset.OP_NAME, + inputsClass = ThreadPoolDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ThreadPoolDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class ThreadPoolDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ThreadPoolDataset(Operation operation) { - super(operation); + public ThreadPoolDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,10 +65,10 @@ private ThreadPoolDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalThreadPoolDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of ThreadPoolDataset */ @Endpoint( @@ -89,4 +103,38 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = ThreadPoolDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * A resource produced by the ThreadPoolHandle op. + */ + public final Operand threadPool; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new ThreadPoolDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + threadPool = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java index 1635a481604..edcfe5cd3b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ +@OpMetadata( + opType = ThreadPoolHandle.OP_NAME, + inputsClass = ThreadPoolHandle.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class ThreadPoolHandle extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class ThreadPoolHandle extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private ThreadPoolHandle(Operation operation) { - super(operation); + public ThreadPoolHandle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -173,4 +186,47 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = ThreadPoolHandle.class + ) + public static class Inputs extends RawOpInputs { + /** + * The number of threads in the thread pool. + */ + public final long numThreads; + + /** + * The maximum degree of parallelism to use within operations that execute on this + * threadpool. + */ + public final long maxIntraOpParallelism; + + /** + * A human-readable name for the threads that may be visible in some + * visualizations. + * threadpool. + */ + public final String displayName; + + /** + * The container attribute + */ + public final String container; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new ThreadPoolHandle(op), op, Arrays.asList("num_threads", "max_intra_op_parallelism", "display_name", "container", "shared_name")); + int inputIndex = 0; + numThreads = op.attributes().getAttrInt("num_threads"); + maxIntraOpParallelism = op.attributes().getAttrInt("max_intra_op_parallelism"); + displayName = op.attributes().getAttrString("display_name"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java index dfd9dbbc8d9..6f207dabb59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ +@OpMetadata( + opType = UnbatchDataset.OP_NAME, + inputsClass = UnbatchDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class UnbatchDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class UnbatchDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private UnbatchDataset(Operation operation) { - super(operation); + public UnbatchDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,9 +65,9 @@ private UnbatchDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalUnbatchDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of UnbatchDataset */ @Endpoint( @@ -86,4 +100,32 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = UnbatchDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new UnbatchDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java index 224d8c5758b..9ac956cc829 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the unique elements of {@code input_dataset}. */ +@OpMetadata( + opType = UniqueDataset.OP_NAME, + inputsClass = UniqueDataset.Inputs.class +) +@Operator( + group = "data.experimental" +) public final class UniqueDataset extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class UniqueDataset extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private UniqueDataset(Operation operation) { - super(operation); + public UniqueDataset(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -51,9 +65,9 @@ private UniqueDataset(Operation operation) { * Factory method to create a class wrapping a new ExperimentalUniqueDataset operation. * * @param scope current scope - * @param inputDataset the inputDataset value - * @param outputTypes the value of the outputTypes property - * @param outputShapes the value of the outputShapes property + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of UniqueDataset */ @Endpoint( @@ -86,4 +100,32 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = UniqueDataset.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + /** + * The outputTypes attribute + */ + public final DataType[] outputTypes; + + /** + * The outputShapes attribute + */ + public final Shape[] outputShapes; + + public Inputs(GraphOperation op) { + super(new UniqueDataset(op), op, Arrays.asList("output_types", "output_shapes")); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + outputTypes = op.attributes().getAttrTypeList("output_types"); + outputShapes = op.attributes().getAttrShapeList("output_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java index 48fb6f1a702..86215fa9a9c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +39,14 @@ * that are not a number (NaN) or infinity (Inf). Otherwise, returns the input * tensor. Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf * in the errors it throws. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CheckNumerics.OP_NAME, + inputsClass = CheckNumerics.Inputs.class +) +@Operator( + group = "debugging" +) public final class CheckNumerics extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +55,8 @@ public final class CheckNumerics extends RawOp implements Ope private Output output; - private CheckNumerics(Operation operation) { - super(operation); + public CheckNumerics(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +65,7 @@ private CheckNumerics(Operation operation) { * Factory method to create a class wrapping a new CheckNumericsV2 operation. * * @param scope current scope - * @param tensor the tensor value + * @param tensor The tensor value * @param message Prefix of the error message. * @param data type for {@code CheckNumericsV2} output and operands * @return a new instance of CheckNumerics @@ -82,4 +94,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = CheckNumerics.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Prefix of the error message. + */ + public final String message; + + public Inputs(GraphOperation op) { + super(new CheckNumerics<>(op), op, Arrays.asList("T", "message")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + message = op.attributes().getAttrString("message"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java index 1038acbc9f3..776a971ef27 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,9 +37,11 @@ * This op is hidden from public in Python. It is used by TensorFlow Debugger to * register gradient tensors for gradient debugging. * This op operates on non-reference-type tensors. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DebugGradientIdentity.OP_NAME, + inputsClass = DebugGradientIdentity.Inputs.class +) public final class DebugGradientIdentity extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +50,8 @@ public final class DebugGradientIdentity extends RawOp implemen private Output output; - private DebugGradientIdentity(Operation operation) { - super(operation); + public DebugGradientIdentity(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +60,7 @@ private DebugGradientIdentity(Operation operation) { * Factory method to create a class wrapping a new DebugGradientIdentity operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code DebugGradientIdentity} output and operands * @return a new instance of DebugGradientIdentity */ @@ -78,4 +86,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = DebugGradientIdentity.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DebugGradientIdentity<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java index b80cfd3951f..76a9e9029ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,9 +37,11 @@ * This op is hidden from public in Python. It is used by TensorFlow Debugger to * register gradient tensors for gradient debugging. * This op operates on reference-type tensors. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DebugGradientRefIdentity.OP_NAME, + inputsClass = DebugGradientRefIdentity.Inputs.class +) public final class DebugGradientRefIdentity extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +50,8 @@ public final class DebugGradientRefIdentity extends RawOp imple private Output output; - private DebugGradientRefIdentity(Operation operation) { - super(operation); + public DebugGradientRefIdentity(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +60,7 @@ private DebugGradientRefIdentity(Operation operation) { * Factory method to create a class wrapping a new DebugGradientRefIdentity operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code DebugGradientRefIdentity} output and operands * @return a new instance of DebugGradientRefIdentity */ @@ -79,4 +87,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = DebugGradientRefIdentity.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DebugGradientRefIdentity<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java index 066e18c068e..10edd71d4b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,49 +19,49 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** - * Debug Identity V2 Op. - * Provides an identity mapping from input to output, while writing the content of - * the input tensor by calling DebugEventsWriter. - *

    The semantics of the input tensor depends on tensor_debug_mode. In typical - * usage, the input tensor comes directly from the user computation only when - * graph_debug_mode is FULL_TENSOR (see protobuf/debug_event.proto for a - * list of all the possible values of graph_debug_mode). For the other debug modes, - * the input tensor should be produced by an additional op or subgraph that - * computes summary information about one or more tensors. - * - * @param data type for {@code output} output + * Provides an identity mapping of the non-Ref type input tensor for debugging. + * Provides an identity mapping of the non-Ref type input tensor for debugging. */ +@OpMetadata( + opType = DebugIdentity.OP_NAME, + inputsClass = DebugIdentity.Inputs.class +) public final class DebugIdentity extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugIdentityV2"; + public static final String OP_NAME = "DebugIdentityV3"; private Output output; - private DebugIdentity(Operation operation) { - super(operation); + public DebugIdentity(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new DebugIdentityV2 operation. + * Factory method to create a class wrapping a new DebugIdentityV3 operation. * * @param scope current scope * @param input Input tensor, non-Reference type * @param options carries optional attribute values - * @param data type for {@code DebugIdentityV2} output and operands + * @param data type for {@code DebugIdentityV3} output and operands * @return a new instance of DebugIdentity */ @Endpoint( @@ -73,17 +73,20 @@ public static DebugIdentity create(Scope scope, Operand opBuilder.addInput(input.asOutput()); if (options != null) { for (Options opts : options) { - if (opts.tfdbgContextId != null) { - opBuilder.setAttr("tfdbg_context_id", opts.tfdbgContextId); + if (opts.deviceName != null) { + opBuilder.setAttr("device_name", opts.deviceName); } - if (opts.opName != null) { - opBuilder.setAttr("op_name", opts.opName); + if (opts.tensorName != null) { + opBuilder.setAttr("tensor_name", opts.tensorName); } - if (opts.outputSlot != null) { - opBuilder.setAttr("output_slot", opts.outputSlot); + if (opts.ioOfNode != null) { + opBuilder.setAttr("io_of_node", opts.ioOfNode); } - if (opts.tensorDebugMode != null) { - opBuilder.setAttr("tensor_debug_mode", opts.tensorDebugMode); + if (opts.isInput != null) { + opBuilder.setAttr("is_input", opts.isInput); + } + if (opts.ioIndex != null) { + opBuilder.setAttr("io_index", opts.ioIndex); } if (opts.debugUrls != null) { String[] debugUrlsArray = new String[opts.debugUrls.size()]; @@ -92,11 +95,8 @@ public static DebugIdentity create(Scope scope, Operand } opBuilder.setAttr("debug_urls", debugUrlsArray); } - if (opts.circularBufferSize != null) { - opBuilder.setAttr("circular_buffer_size", opts.circularBufferSize); - } - if (opts.tfdbgRunId != null) { - opBuilder.setAttr("tfdbg_run_id", opts.tfdbgRunId); + if (opts.gatedGrpc != null) { + opBuilder.setAttr("gated_grpc", opts.gatedGrpc); } } } @@ -104,86 +104,90 @@ public static DebugIdentity create(Scope scope, Operand } /** - * Sets the tfdbgContextId option. + * Sets the deviceName option. * - * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. + * @param deviceName Name of the device on which the tensor resides. * @return this Options instance. */ - public static Options tfdbgContextId(String tfdbgContextId) { - return new Options().tfdbgContextId(tfdbgContextId); + public static Options deviceName(String deviceName) { + return new Options().deviceName(deviceName); } /** - * Sets the opName option. + * Sets the tensorName option. * - * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. + * @param tensorName Name of the input tensor. * @return this Options instance. */ - public static Options opName(String opName) { - return new Options().opName(opName); + public static Options tensorName(String tensorName) { + return new Options().tensorName(tensorName); } /** - * Sets the outputSlot option. + * Sets the ioOfNode option. * - * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. + * @param ioOfNode Name of the node of which the tensor is an input or output. * @return this Options instance. */ - public static Options outputSlot(Long outputSlot) { - return new Options().outputSlot(outputSlot); + public static Options ioOfNode(String ioOfNode) { + return new Options().ioOfNode(ioOfNode); } /** - * Sets the tensorDebugMode option. + * Sets the isInput option. * - * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. + * @param isInput If true, the tensor is an input of the node; otherwise the output. * @return this Options instance. */ - public static Options tensorDebugMode(Long tensorDebugMode) { - return new Options().tensorDebugMode(tensorDebugMode); + public static Options isInput(Boolean isInput) { + return new Options().isInput(isInput); } /** - * Sets the debugUrls option. + * Sets the ioIndex option. * - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @param ioIndex The index of which the tensor is an input or output of the node. * @return this Options instance. */ - public static Options debugUrls(List debugUrls) { - return new Options().debugUrls(debugUrls); + public static Options ioIndex(Long ioIndex) { + return new Options().ioIndex(ioIndex); } /** * Sets the debugUrls option. * - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011 * @return this Options instance. */ - public static Options debugUrls(String[] debugUrls) { + public static Options debugUrls(List debugUrls) { return new Options().debugUrls(debugUrls); } /** - * Sets the circularBufferSize option. + * Sets the debugUrls option. * - * @param circularBufferSize the circularBufferSize option + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011 * @return this Options instance. */ - public static Options circularBufferSize(Long circularBufferSize) { - return new Options().circularBufferSize(circularBufferSize); + public static Options debugUrls(String... debugUrls) { + return new Options().debugUrls(debugUrls); } /** - * Sets the tfdbgRunId option. + * Sets the gatedGrpc option. * - * @param tfdbgRunId the tfdbgRunId option + * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. * @return this Options instance. */ - public static Options tfdbgRunId(String tfdbgRunId) { - return new Options().tfdbgRunId(tfdbgRunId); + public static Options gatedGrpc(Boolean gatedGrpc) { + return new Options().gatedGrpc(gatedGrpc); } /** @@ -204,74 +208,83 @@ public Output asOutput() { * Optional attributes for {@link org.tensorflow.op.debugging.DebugIdentity} */ public static class Options { - private String tfdbgContextId; + private String deviceName; - private String opName; + private String tensorName; - private Long outputSlot; + private String ioOfNode; - private Long tensorDebugMode; + private Boolean isInput; - private List debugUrls; + private Long ioIndex; - private Long circularBufferSize; + private List debugUrls; - private String tfdbgRunId; + private Boolean gatedGrpc; private Options() { } /** - * Sets the tfdbgContextId option. + * Sets the deviceName option. * - * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. + * @param deviceName Name of the device on which the tensor resides. * @return this Options instance. */ - public Options tfdbgContextId(String tfdbgContextId) { - this.tfdbgContextId = tfdbgContextId; + public Options deviceName(String deviceName) { + this.deviceName = deviceName; return this; } /** - * Sets the opName option. + * Sets the tensorName option. * - * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. + * @param tensorName Name of the input tensor. * @return this Options instance. */ - public Options opName(String opName) { - this.opName = opName; + public Options tensorName(String tensorName) { + this.tensorName = tensorName; return this; } /** - * Sets the outputSlot option. + * Sets the ioOfNode option. * - * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. + * @param ioOfNode Name of the node of which the tensor is an input or output. * @return this Options instance. */ - public Options outputSlot(Long outputSlot) { - this.outputSlot = outputSlot; + public Options ioOfNode(String ioOfNode) { + this.ioOfNode = ioOfNode; return this; } /** - * Sets the tensorDebugMode option. + * Sets the isInput option. * - * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. + * @param isInput If true, the tensor is an input of the node; otherwise the output. * @return this Options instance. */ - public Options tensorDebugMode(Long tensorDebugMode) { - this.tensorDebugMode = tensorDebugMode; + public Options isInput(Boolean isInput) { + this.isInput = isInput; + return this; + } + + /** + * Sets the ioIndex option. + * + * @param ioIndex The index of which the tensor is an input or output of the node. + * @return this Options instance. + */ + public Options ioIndex(Long ioIndex) { + this.ioIndex = ioIndex; return this; } /** * Sets the debugUrls option. * - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011 * @return this Options instance. */ public Options debugUrls(List debugUrls) { @@ -282,7 +295,8 @@ public Options debugUrls(List debugUrls) { /** * Sets the debugUrls option. * - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011 * @return this Options instance. */ public Options debugUrls(String... debugUrls) { @@ -291,25 +305,89 @@ public Options debugUrls(String... debugUrls) { } /** - * Sets the circularBufferSize option. + * Sets the gatedGrpc option. * - * @param circularBufferSize the circularBufferSize option + * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. * @return this Options instance. */ - public Options circularBufferSize(Long circularBufferSize) { - this.circularBufferSize = circularBufferSize; + public Options gatedGrpc(Boolean gatedGrpc) { + this.gatedGrpc = gatedGrpc; return this; } + } + @OpInputsMetadata( + outputsClass = DebugIdentity.class + ) + public static class Inputs extends RawOpInputs> { /** - * Sets the tfdbgRunId option. - * - * @param tfdbgRunId the tfdbgRunId option - * @return this Options instance. + * Input tensor, non-Reference type */ - public Options tfdbgRunId(String tfdbgRunId) { - this.tfdbgRunId = tfdbgRunId; - return this; + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Name of the device on which the tensor resides. + */ + public final String deviceName; + + /** + * Name of the input tensor. + */ + public final String tensorName; + + /** + * Name of the node of which the tensor is an input or output. + */ + public final String ioOfNode; + + /** + * If true, the tensor is an input of the node; otherwise the output. + */ + public final boolean isInput; + + /** + * The index of which the tensor is an input or output of the node. + */ + public final long ioIndex; + + /** + * List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011 + */ + public final String[] debugUrls; + + /** + * Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. + */ + public final boolean gatedGrpc; + + public Inputs(GraphOperation op) { + super(new DebugIdentity<>(op), op, Arrays.asList("T", "device_name", "tensor_name", "io_of_node", "is_input", "io_index", "debug_urls", "gated_grpc")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + deviceName = op.attributes().getAttrString("device_name"); + tensorName = op.attributes().getAttrString("tensor_name"); + ioOfNode = op.attributes().getAttrString("io_of_node"); + isInput = op.attributes().getAttrBool("is_input"); + ioIndex = op.attributes().getAttrInt("io_index"); + debugUrls = op.attributes().getAttrStringList("debug_urls"); + gatedGrpc = op.attributes().getAttrBool("gated_grpc"); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java index 0ebdb1005cd..2d0e2f5fe94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,18 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * Debug NaN Value Counter Op. * Counts number of NaNs in the input tensor, for debugging. */ +@OpMetadata( + opType = DebugNanCount.OP_NAME, + inputsClass = DebugNanCount.Inputs.class +) public final class DebugNanCount extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +50,8 @@ public final class DebugNanCount extends RawOp implements Operand { private Output output; - private DebugNanCount(Operation operation) { - super(operation); + public DebugNanCount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -123,7 +132,7 @@ public static Options debugUrls(List debugUrls) { * file:///foo/tfdbg_dump, grpc:://localhost:11011. * @return this Options instance. */ - public static Options debugUrls(String[] debugUrls) { + public static Options debugUrls(String... debugUrls) { return new Options().debugUrls(debugUrls); } @@ -233,4 +242,56 @@ public Options gatedGrpc(Boolean gatedGrpc) { return this; } } + + @OpInputsMetadata( + outputsClass = DebugNanCount.class + ) + public static class Inputs extends RawOpInputs { + /** + * Input tensor, non-Reference type. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The deviceName attribute + */ + public final String deviceName; + + /** + * Name of the input tensor. + */ + public final String tensorName; + + /** + * List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + */ + public final String[] debugUrls; + + /** + * Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. + */ + public final boolean gatedGrpc; + + public Inputs(GraphOperation op) { + super(new DebugNanCount(op), op, Arrays.asList("T", "device_name", "tensor_name", "debug_urls", "gated_grpc")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + deviceName = op.attributes().getAttrString("device_name"); + tensorName = op.attributes().getAttrString("tensor_name"); + debugUrls = op.attributes().getAttrStringList("debug_urls"); + gatedGrpc = op.attributes().getAttrBool("gated_grpc"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java index 34ab74a640f..d83f728b452 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * Computes a numeric summary of the input tensor. The shape of the output * depends on the tensor_debug_mode attribute. * This op is used internally by TensorFlow Debugger (tfdbg) v2. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DebugNumericsSummary.OP_NAME, + inputsClass = DebugNumericsSummary.Inputs.class +) public final class DebugNumericsSummary extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +53,8 @@ public final class DebugNumericsSummary extends RawOp impleme private Output output; - private DebugNumericsSummary(Operation operation) { - super(operation); + public DebugNumericsSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -94,7 +102,7 @@ public static DebugNumericsSummary create(Scope scope, describeByClass = true ) public static DebugNumericsSummary create(Scope scope, Operand input, - Options[] options) { + Options... options) { return create(scope, input, TFloat32.class, options); } @@ -259,4 +267,91 @@ public Options tensorId(Long tensorId) { return this; } } + + @OpInputsMetadata( + outputsClass = DebugNumericsSummary.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor, to be summarized by the op. + */ + public final Operand input; + + /** + * Optional. The type of the output. Can be float32 or float64 (default: float32). + */ + public final DataType outputDtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Tensor debug mode: the mode in which the input tensor is summarized + * by the op. See the TensorDebugMode enum in + * tensorflow/core/protobuf/debug_event.proto for details. + *

    Supported values: + * 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is a bit which is set to 1 if the input tensor has an + * infinity or nan value, or zero otherwise. + *

    3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The + * remaining four slots are the total number of elements, -infs, + * +infs, and nans in the input tensor respectively. + *

    4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The remaining elements hold the total number of elements, -infs, + * +infs, nans, negative finite numbers, zeros, and positive finite + * numbers in the input tensor respectively. + *

    5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 3rd element holds the rank of the tensor. The 4th element holds + * the number of elements within the tensor. Finally the remaining 6 + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. + *

    6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 4th element holds the rank of the tensor. The 5th to 11th + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. The 12th to + * 18th elements hold the number of elements, -infs, +infs, nans, + * denormal floats, negative finite numbers, zeros, and positive + * finite numbers in the input tensor respectively. The final four + * elements hold the min value, max value, mean, and variance of the + * input tensor. + *

    8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape + * [3]. The 1st element is -inf if any elements of the input tensor + * is -inf, or zero otherwise. The 2nd element is +inf if any elements + * of the input tensor is +inf, or zero otherwise. The 3rd element is + * nan if any element of the input tensor is nan, or zero otherwise. + */ + public final long tensorDebugMode; + + /** + * Optional. An integer identifier for the tensor being summarized by this op. + */ + public final long tensorId; + + public Inputs(GraphOperation op) { + super(new DebugNumericsSummary<>(op), op, Arrays.asList("output_dtype", "T", "tensor_debug_mode", "tensor_id")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + outputDtype = op.attributes().getAttrType("output_dtype"); + T = op.attributes().getAttrType("T"); + tensorDebugMode = op.attributes().getAttrInt("tensor_debug_mode"); + tensorId = op.attributes().getAttrInt("tensor_id"); + } + } } 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 index 72bc90a364c..7cc17dd9d36 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.distribute; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -38,9 +45,14 @@ * 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 */ +@OpMetadata( + opType = NcclAllReduce.OP_NAME, + inputsClass = NcclAllReduce.Inputs.class +) +@Operator( + group = "distribute" +) public final class NcclAllReduce extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -49,8 +61,8 @@ public final class NcclAllReduce extends RawOp implements Ope private Output data; - private NcclAllReduce(Operation operation) { - super(operation); + public NcclAllReduce(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; data = operation.output(outputIdx++); } @@ -59,10 +71,10 @@ private NcclAllReduce(Operation operation) { * Factory method to create a class wrapping a new NcclAllReduce operation. * * @param scope current scope - * @param input the input value - * @param reduction the value of the reduction property - * @param numDevices the value of the numDevices property - * @param sharedName the value of the sharedName property + * @param input The input value + * @param reduction The value of the reduction attribute + * @param numDevices The value of the numDevices attribute + * @param sharedName The value of the sharedName attribute * @param data type for {@code NcclAllReduce} output and operands * @return a new instance of NcclAllReduce */ @@ -92,4 +104,44 @@ public Output data() { public Output asOutput() { return data; } + + @OpInputsMetadata( + outputsClass = NcclAllReduce.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The reduction attribute + */ + public final String reduction; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The numDevices attribute + */ + public final long numDevices; + + /** + * The sharedName attribute + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new NcclAllReduce<>(op), op, Arrays.asList("reduction", "T", "num_devices", "shared_name")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + reduction = op.attributes().getAttrString("reduction"); + T = op.attributes().getAttrType("T"); + numDevices = op.attributes().getAttrInt("num_devices"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } 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 index 0b34c24a7cc..41a2050e44f 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.distribute; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +42,14 @@ *

    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 */ +@OpMetadata( + opType = NcclBroadcast.OP_NAME, + inputsClass = NcclBroadcast.Inputs.class +) +@Operator( + group = "distribute" +) public final class NcclBroadcast extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class NcclBroadcast extends RawOp implements Ope private Output output; - private NcclBroadcast(Operation operation) { - super(operation); + public NcclBroadcast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,8 +68,8 @@ private NcclBroadcast(Operation operation) { * Factory method to create a class wrapping a new NcclBroadcast operation. * * @param scope current scope - * @param input the input value - * @param shape the value of the shape property + * @param input The input value + * @param shape The value of the shape attribute * @param data type for {@code NcclBroadcast} output and operands * @return a new instance of NcclBroadcast */ @@ -85,4 +97,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = NcclBroadcast.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The shape attribute + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new NcclBroadcast<>(op), op, Arrays.asList("T", "shape")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + shape = op.attributes().getAttrShape("shape"); + } + } } 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 index 2204b1c0a72..8fcf62bf4cc 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.distribute; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +42,14 @@ *

    input: The input to the reduction. * data: the value of the reduction across all {@code num_devices} devices. * reduction: the reduction operation to perform. - * - * @param data type for {@code data} output */ +@OpMetadata( + opType = NcclReduce.OP_NAME, + inputsClass = NcclReduce.Inputs.class +) +@Operator( + group = "distribute" +) public final class NcclReduce extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class NcclReduce extends RawOp implements Operan private Output data; - private NcclReduce(Operation operation) { - super(operation); + public NcclReduce(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; data = operation.output(outputIdx++); } @@ -56,8 +68,8 @@ private NcclReduce(Operation operation) { * Factory method to create a class wrapping a new NcclReduce operation. * * @param scope current scope - * @param input the input value - * @param reduction the value of the reduction property + * @param input The input value + * @param reduction The value of the reduction attribute * @param data type for {@code NcclReduce} output and operands * @return a new instance of NcclReduce */ @@ -85,4 +97,34 @@ public Output data() { public Output asOutput() { return data; } + + @OpInputsMetadata( + outputsClass = NcclReduce.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Iterable> input; + + /** + * The reduction attribute + */ + public final String reduction; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new NcclReduce<>(op), op, Arrays.asList("reduction", "T")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + reduction = op.attributes().getAttrString("reduction"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java index 56c385236bf..25dfbfe50ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.dtypes; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,7 +38,7 @@ * Converts each entry in the given tensor to strings. * Supports many numeric types and boolean. *

    For Unicode, see the - * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) + * [https://www.tensorflow.org/text/guide/unicode](Working with Unicode text) * tutorial. *

    Examples: *

    @@ -46,6 +52,10 @@ *
    * */ +@OpMetadata( + opType = AsString.OP_NAME, + inputsClass = AsString.Inputs.class +) @Operator( group = "dtypes" ) @@ -57,8 +67,8 @@ public final class AsString extends RawOp implements Operand { private Output output; - private AsString(Operation operation) { - super(operation); + public AsString(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -67,7 +77,7 @@ private AsString(Operation operation) { * Factory method to create a class wrapping a new AsString operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @return a new instance of AsString */ @@ -245,4 +255,61 @@ public Options fill(String fill) { return this; } } + + @OpInputsMetadata( + outputsClass = AsString.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The post-decimal precision to use for floating point numbers. + * Only used if precision > -1. + */ + public final long precision; + + /** + * Use scientific notation for floating point numbers. + */ + public final boolean scientific; + + /** + * Use shortest representation (either scientific or standard) for + * floating point numbers. + */ + public final boolean shortest; + + /** + * Pad pre-decimal numbers to this width. + * Applies to both floating point and integer numbers. + * Only used if width > -1. + */ + public final long width; + + /** + * The value to pad if width > -1. If empty, pads with spaces. + * Another typical value is '0'. String cannot be longer than 1 character. + */ + public final String fill; + + public Inputs(GraphOperation op) { + super(new AsString(op), op, Arrays.asList("T", "precision", "scientific", "shortest", "width", "fill")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + precision = op.attributes().getAttrInt("precision"); + scientific = op.attributes().getAttrBool("scientific"); + shortest = op.attributes().getAttrBool("shortest"); + width = op.attributes().getAttrInt("width"); + fill = op.attributes().getAttrString("fill"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java index 38e5860f94a..af516490d88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.dtypes; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Cast x of type SrcT to y of DstT. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Cast.OP_NAME, + inputsClass = Cast.Inputs.class +) @Operator( group = "dtypes" ) @@ -44,8 +52,8 @@ public final class Cast extends RawOp implements Operand { private Output y; - private Cast(Operation operation) { - super(operation); + public Cast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,8 +62,8 @@ private Cast(Operation operation) { * Factory method to create a class wrapping a new Cast operation. * * @param scope current scope - * @param x the x value - * @param DstT the value of the DstT property + * @param x The x value + * @param DstT The value of the DstT attribute * @param options carries optional attribute values * @param data type for {@code Cast} output and operands * @return a new instance of Cast @@ -122,4 +130,38 @@ public Options Truncate(Boolean Truncate) { return this; } } + + @OpInputsMetadata( + outputsClass = Cast.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The SrcT attribute + */ + public final DataType SrcT; + + /** + * The DstT attribute + */ + public final DataType DstT; + + /** + * The Truncate attribute + */ + public final boolean Truncate; + + public Inputs(GraphOperation op) { + super(new Cast<>(op), op, Arrays.asList("SrcT", "DstT", "Truncate")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + SrcT = op.attributes().getAttrType("SrcT"); + DstT = op.attributes().getAttrType("DstT"); + Truncate = op.attributes().getAttrBool("Truncate"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java index c7fdf63b966..0da2678549f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.dtypes; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * # tensor `imag` is [4.75, 5.75] * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] * - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = Complex.OP_NAME, + inputsClass = Complex.Inputs.class +) @Operator( group = "dtypes" ) @@ -56,8 +64,8 @@ public final class Complex extends RawOp implements Operand private Output out; - private Complex(Operation operation) { - super(operation); + public Complex(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -66,9 +74,9 @@ private Complex(Operation operation) { * Factory method to create a class wrapping a new Complex operation. * * @param scope current scope - * @param real the real value - * @param imag the imag value - * @param Tout the value of the Tout property + * @param real The real value + * @param imag The imag value + * @param Tout The value of the Tout attribute * @param data type for {@code Complex} output and operands * @param data type for {@code Complex} output and operands * @return a new instance of Complex @@ -98,4 +106,38 @@ public Output out() { public Output asOutput() { return out; } + + @OpInputsMetadata( + outputsClass = Complex.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The real input + */ + public final Operand real; + + /** + * The imag input + */ + public final Operand imag; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new Complex<>(op), op, Arrays.asList("T", "Tout")); + int inputIndex = 0; + real = (Operand) op.input(inputIndex++); + imag = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java index 3fac763c3eb..0db30e9ca62 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.dtypes; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -45,6 +52,13 @@ *

    This matches the behavior of If and While for determining if a tensor counts * as true/false for a branch condition. */ +@OpMetadata( + opType = ToBool.OP_NAME, + inputsClass = ToBool.Inputs.class +) +@Operator( + group = "dtypes" +) public final class ToBool extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +67,8 @@ public final class ToBool extends RawOp implements Operand { private Output output; - private ToBool(Operation operation) { - super(operation); + public ToBool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -63,7 +77,7 @@ private ToBool(Operation operation) { * Factory method to create a class wrapping a new ToBool operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of ToBool */ @Endpoint( @@ -88,4 +102,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ToBool.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ToBool(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java deleted file mode 100644 index 80f669c35d3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java +++ /dev/null @@ -1,90 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * Aggregates the summary of accumulated stats for the batch. - * The summary stats contains gradients and hessians accumulated for each node, feature dimension id and bucket. - */ -public final class BoostedTreesAggregateStats extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesAggregateStats"; - - private Output statsSummary; - - private BoostedTreesAggregateStats(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummary = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesAggregateStats operation. - * - * @param scope current scope - * @param nodeIds int32; Rank 1 Tensor containing node ids for each example, shape [batch_size]. - * @param gradients float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example. - * @param hessians float32; Rank 2 Tensor (shape=[batch_size, hessian_dimension]) with hessians for each example. - * @param feature int32; Rank 2 feature Tensors (shape=[batch_size, feature_dimension]). - * @param maxSplits int; the maximum number of splits possible in the whole tree. - * @param numBuckets int; equals to the maximum possible value of bucketized feature. - * @return a new instance of BoostedTreesAggregateStats - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesAggregateStats create(Scope scope, Operand nodeIds, - Operand gradients, Operand hessians, Operand feature, - Long maxSplits, Long numBuckets) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesAggregateStats"); - opBuilder.addInput(nodeIds.asOutput()); - opBuilder.addInput(gradients.asOutput()); - opBuilder.addInput(hessians.asOutput()); - opBuilder.addInput(feature.asOutput()); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesAggregateStats(opBuilder.build()); - } - - /** - * Gets statsSummary. - * output Rank 4 Tensor (shape=[splits, feature_dimension, buckets, logits_dimension + hessian_dimension]) - * containing accumulated stats for each node, feature dimension and bucket. - * @return statsSummary. - */ - public Output statsSummary() { - return statsSummary; - } - - @Override - public Output asOutput() { - return statsSummary; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java deleted file mode 100644 index b0a7183f681..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java +++ /dev/null @@ -1,90 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * Bucketize each feature based on bucket boundaries. - * An op that returns a list of float tensors, where each tensor represents the - * bucketized values for a single feature. - */ -public final class BoostedTreesBucketize extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesBucketize"; - - private List> buckets; - - @SuppressWarnings("unchecked") - private BoostedTreesBucketize(Operation operation) { - super(operation); - int outputIdx = 0; - int bucketsLength = operation.outputListLength("buckets"); - buckets = Arrays.asList((Output[]) operation.outputList(outputIdx, bucketsLength)); - outputIdx += bucketsLength; - } - - /** - * Factory method to create a class wrapping a new BoostedTreesBucketize operation. - * - * @param scope current scope - * @param floatValues float; List of Rank 1 Tensor each containing float values for a single feature. - * @param bucketBoundaries float; List of Rank 1 Tensors each containing the bucket boundaries for a single - * feature. - * @return a new instance of BoostedTreesBucketize - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesBucketize create(Scope scope, Iterable> floatValues, - Iterable> bucketBoundaries) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesBucketize"); - opBuilder.addInputList(Operands.asOutputs(floatValues)); - opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); - return new BoostedTreesBucketize(opBuilder.build()); - } - - /** - * Gets buckets. - * int; List of Rank 1 Tensors each containing the bucketized values for a single feature. - * @return buckets. - */ - public List> buckets() { - return buckets; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) buckets.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java deleted file mode 100644 index 01eb21bba88..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java +++ /dev/null @@ -1,204 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; - -/** - * Calculates gains for each feature and returns the best possible split information for the feature. - * The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

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

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

    The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. - */ -public final class BoostedTreesCalculateBestFeatureSplit extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplit"; - - private Output nodeIds; - - private Output gains; - - private Output featureDimensions; - - private Output thresholds; - - private Output leftNodeContribs; - - private Output rightNodeContribs; - - private Output splitWithDefaultDirections; - - private BoostedTreesCalculateBestFeatureSplit(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCalculateBestFeatureSplit operation. - * - * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). - * @param statsSummary A Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature. - * The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. - * @param l1 l1 regularization factor on leaf weights, per instance based. - * @param l2 l2 regularization factor on leaf weights, per instance based. - * @param treeComplexity adjustment to the gain, per leaf based. - * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. - * @param logitsDimension The dimension of logit, i.e., number of classes. - * @param options carries optional attribute values - * @return a new instance of BoostedTreesCalculateBestFeatureSplit - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCalculateBestFeatureSplit create(Scope scope, - Operand nodeIdRange, Operand statsSummary, Operand l1, - Operand l2, Operand treeComplexity, Operand minNodeWeight, - Long logitsDimension, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCalculateBestFeatureSplit"); - opBuilder.addInput(nodeIdRange.asOutput()); - opBuilder.addInput(statsSummary.asOutput()); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - opBuilder.addInput(treeComplexity.asOutput()); - opBuilder.addInput(minNodeWeight.asOutput()); - opBuilder.setAttr("logits_dimension", logitsDimension); - if (options != null) { - for (Options opts : options) { - if (opts.splitType != null) { - opBuilder.setAttr("split_type", opts.splitType); - } - } - } - return new BoostedTreesCalculateBestFeatureSplit(opBuilder.build()); - } - - /** - * Sets the splitType option. - * - * @param splitType A string indicating if this Op should perform inequality split or equality split. - * @return this Options instance. - */ - public static Options splitType(String splitType) { - return new Options().splitType(splitType); - } - - /** - * Gets nodeIds. - * A Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. - * @return nodeIds. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * Gets gains. - * A Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. - * @return gains. - */ - public Output gains() { - return gains; - } - - /** - * Gets featureDimensions. - * A Rank 1 tensors indicating the best feature dimension for each feature to split for certain nodes if the feature is multi-dimension. See above for details like shapes and sizes. - * @return featureDimensions. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * Gets thresholds. - * A Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. - * @return thresholds. - */ - public Output thresholds() { - return thresholds; - } - - /** - * Gets leftNodeContribs. - * A Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. - * @return leftNodeContribs. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * Gets rightNodeContribs. - * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - * @return rightNodeContribs. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * Gets splitWithDefaultDirections. - * A Rank 1 tensors indicating the which direction to go if data is missing. See above for details like shapes and sizes. - * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. - * @return splitWithDefaultDirections. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCalculateBestFeatureSplit} - */ - public static class Options { - private String splitType; - - private Options() { - } - - /** - * Sets the splitType option. - * - * @param splitType A string indicating if this Op should perform inequality split or equality split. - * @return this Options instance. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java deleted file mode 100644 index 666b544d323..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java +++ /dev/null @@ -1,183 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; - -/** - * Calculates gains for each feature and returns the best possible split information for each node. However, if no split is found, then no split information is returned for that node. - * The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

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

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

    The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. - */ -public final class BoostedTreesCalculateBestFeatureSplitV2 extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplitV2"; - - private Output nodeIds; - - private Output gains; - - private Output featureIds; - - private Output featureDimensions; - - private Output thresholds; - - private Output leftNodeContribs; - - private Output rightNodeContribs; - - private Output splitWithDefaultDirections; - - private BoostedTreesCalculateBestFeatureSplitV2(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureIds = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCalculateBestFeatureSplitV2 operation. - * - * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). - * @param statsSummariesList A list of Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature. - * The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. - * @param splitTypes A Rank 1 tensor indicating if this Op should perform inequality split or equality split per feature. - * @param candidateFeatureIds Rank 1 tensor with ids for each feature. This is the real id of the feature. - * @param l1 l1 regularization factor on leaf weights, per instance based. - * @param l2 l2 regularization factor on leaf weights, per instance based. - * @param treeComplexity adjustment to the gain, per leaf based. - * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. - * @param logitsDimension The dimension of logit, i.e., number of classes. - * @return a new instance of BoostedTreesCalculateBestFeatureSplitV2 - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCalculateBestFeatureSplitV2 create(Scope scope, - Operand nodeIdRange, Iterable> statsSummariesList, - Operand splitTypes, Operand candidateFeatureIds, Operand l1, - Operand l2, Operand treeComplexity, Operand minNodeWeight, - Long logitsDimension) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCalculateBestFeatureSplitV2"); - opBuilder.addInput(nodeIdRange.asOutput()); - opBuilder.addInputList(Operands.asOutputs(statsSummariesList)); - opBuilder.addInput(splitTypes.asOutput()); - opBuilder.addInput(candidateFeatureIds.asOutput()); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - opBuilder.addInput(treeComplexity.asOutput()); - opBuilder.addInput(minNodeWeight.asOutput()); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesCalculateBestFeatureSplitV2(opBuilder.build()); - } - - /** - * Gets nodeIds. - * A Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. - * @return nodeIds. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * Gets gains. - * A Rank 1 tensor indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. - * @return gains. - */ - public Output gains() { - return gains; - } - - /** - * Gets featureIds. - * A Rank 1 tensors indicating the best feature id for each node. See above for details like shapes and sizes. - * @return featureIds. - */ - public Output featureIds() { - return featureIds; - } - - /** - * Gets featureDimensions. - * A Rank 1 tensors indicating the best feature dimension for each feature to split for certain nodes if the feature is multi-dimension. See above for details like shapes and sizes. - * @return featureDimensions. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * Gets thresholds. - * A Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. - * @return thresholds. - */ - public Output thresholds() { - return thresholds; - } - - /** - * Gets leftNodeContribs. - * A Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. - * @return leftNodeContribs. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * Gets rightNodeContribs. - * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - * @return rightNodeContribs. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * Gets splitWithDefaultDirections. - * A Rank 1 tensors indicating the which direction to go if data is missing. See above for details like shapes and sizes. - * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. - * @return splitWithDefaultDirections. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java deleted file mode 100644 index ea1a95a6d51..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java +++ /dev/null @@ -1,153 +0,0 @@ -/* 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.estimator; - -import java.util.Arrays; -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.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * Calculates gains for each feature and returns the best possible split information for the feature. - * The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

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

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

    The length of output lists are all of the same length, {@code num_features}. - * The output shapes are compatible in a way that the first dimension of all tensors of all lists are the same and equal to the number of possible split nodes for each feature. - */ -public final class BoostedTreesCalculateBestGainsPerFeature extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCalculateBestGainsPerFeature"; - - private List> nodeIdsList; - - private List> gainsList; - - private List> thresholdsList; - - private List> leftNodeContribsList; - - private List> rightNodeContribsList; - - @SuppressWarnings("unchecked") - private BoostedTreesCalculateBestGainsPerFeature(Operation operation) { - super(operation); - int outputIdx = 0; - int nodeIdsListLength = operation.outputListLength("node_ids_list"); - nodeIdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, nodeIdsListLength)); - outputIdx += nodeIdsListLength; - int gainsListLength = operation.outputListLength("gains_list"); - gainsList = Arrays.asList((Output[]) operation.outputList(outputIdx, gainsListLength)); - outputIdx += gainsListLength; - int thresholdsListLength = operation.outputListLength("thresholds_list"); - thresholdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, thresholdsListLength)); - outputIdx += thresholdsListLength; - int leftNodeContribsListLength = operation.outputListLength("left_node_contribs_list"); - leftNodeContribsList = Arrays.asList((Output[]) operation.outputList(outputIdx, leftNodeContribsListLength)); - outputIdx += leftNodeContribsListLength; - int rightNodeContribsListLength = operation.outputListLength("right_node_contribs_list"); - rightNodeContribsList = Arrays.asList((Output[]) operation.outputList(outputIdx, rightNodeContribsListLength)); - outputIdx += rightNodeContribsListLength; - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCalculateBestGainsPerFeature operation. - * - * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). - * @param statsSummaryList A list of Rank 3 tensor (#shape=[max_splits, bucket, 2]) for accumulated stats summary (gradient/hessian) per node per buckets for each feature. The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. - * @param l1 l1 regularization factor on leaf weights, per instance based. - * @param l2 l2 regularization factor on leaf weights, per instance based. - * @param treeComplexity adjustment to the gain, per leaf based. - * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. - * @param maxSplits the number of nodes that can be split in the whole tree. Used as a dimension of output tensors. - * @return a new instance of BoostedTreesCalculateBestGainsPerFeature - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, - Operand nodeIdRange, Iterable> statsSummaryList, - Operand l1, Operand l2, Operand treeComplexity, - Operand minNodeWeight, Long maxSplits) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCalculateBestGainsPerFeature"); - opBuilder.addInput(nodeIdRange.asOutput()); - opBuilder.addInputList(Operands.asOutputs(statsSummaryList)); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - opBuilder.addInput(treeComplexity.asOutput()); - opBuilder.addInput(minNodeWeight.asOutput()); - opBuilder.setAttr("max_splits", maxSplits); - return new BoostedTreesCalculateBestGainsPerFeature(opBuilder.build()); - } - - /** - * Gets nodeIdsList. - * An output list of Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. - * @return nodeIdsList. - */ - public List> nodeIdsList() { - return nodeIdsList; - } - - /** - * Gets gainsList. - * An output list of Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. - * @return gainsList. - */ - public List> gainsList() { - return gainsList; - } - - /** - * Gets thresholdsList. - * An output list of Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. - * @return thresholdsList. - */ - public List> thresholdsList() { - return thresholdsList; - } - - /** - * Gets leftNodeContribsList. - * A list of Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. - * @return leftNodeContribsList. - */ - public List> leftNodeContribsList() { - return leftNodeContribsList; - } - - /** - * Gets rightNodeContribsList. - * A list of Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - * @return rightNodeContribsList. - */ - public List> rightNodeContribsList() { - return rightNodeContribsList; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java deleted file mode 100644 index dd45c6709a5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java +++ /dev/null @@ -1,87 +0,0 @@ -/* 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.estimator; - -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.types.TBool; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; - -/** - * Calculates the prior from the training data (the bias) and fills in the first node with the logits' prior. Returns a boolean indicating whether to continue centering. - */ -public final class BoostedTreesCenterBias extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCenterBias"; - - private Output continueCentering; - - private BoostedTreesCenterBias(Operation operation) { - super(operation); - int outputIdx = 0; - continueCentering = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCenterBias operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble. - * @param meanGradients A tensor with shape=[logits_dimension] with mean of gradients for a first node. - * @param meanHessians A tensor with shape=[logits_dimension] mean of hessians for a first node. - * @param l1 l1 regularization factor on leaf weights, per instance based. - * @param l2 l2 regularization factor on leaf weights, per instance based. - * @return a new instance of BoostedTreesCenterBias - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCenterBias create(Scope scope, - Operand treeEnsembleHandle, Operand meanGradients, - Operand meanHessians, Operand l1, Operand l2) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCenterBias"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(meanGradients.asOutput()); - opBuilder.addInput(meanHessians.asOutput()); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - return new BoostedTreesCenterBias(opBuilder.build()); - } - - /** - * Gets continueCentering. - * Bool, whether to continue bias centering. - * @return continueCentering. - */ - public Output continueCentering() { - return continueCentering; - } - - @Override - public Output asOutput() { - return continueCentering; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java deleted file mode 100644 index 0793a9d4dad..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java +++ /dev/null @@ -1,64 +0,0 @@ -/* 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.estimator; - -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.types.TInt64; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Creates a tree ensemble model and returns a handle to it. - */ -public final class BoostedTreesCreateEnsemble extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCreateEnsemble"; - - private BoostedTreesCreateEnsemble(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCreateEnsemble operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble resource to be created. - * @param stampToken Token to use as the initial value of the resource stamp. - * @param treeEnsembleSerialized Serialized proto of the tree ensemble. - * @return a new instance of BoostedTreesCreateEnsemble - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCreateEnsemble create(Scope scope, - Operand treeEnsembleHandle, Operand stampToken, - Operand treeEnsembleSerialized) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCreateEnsemble"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(stampToken.asOutput()); - opBuilder.addInput(treeEnsembleSerialized.asOutput()); - return new BoostedTreesCreateEnsemble(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java deleted file mode 100644 index 0fa016c985c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java +++ /dev/null @@ -1,103 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.family.TType; - -/** - * Create the Resource for Quantile Streams. - */ -public final class BoostedTreesCreateQuantileStreamResource extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesCreateQuantileStreamResource"; - - private BoostedTreesCreateQuantileStreamResource(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesCreateQuantileStreamResource operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource; Handle to quantile stream resource. - * @param epsilon float; The required approximation error of the stream resource. - * @param numStreams int; The number of streams managed by the resource that shares the same epsilon. - * @param options carries optional attribute values - * @return a new instance of BoostedTreesCreateQuantileStreamResource - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesCreateQuantileStreamResource create(Scope scope, - Operand quantileStreamResourceHandle, Operand epsilon, - Operand numStreams, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesCreateQuantileStreamResource"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInput(epsilon.asOutput()); - opBuilder.addInput(numStreams.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.maxElements != null) { - opBuilder.setAttr("max_elements", opts.maxElements); - } - } - } - return new BoostedTreesCreateQuantileStreamResource(opBuilder.build()); - } - - /** - * Sets the maxElements option. - * - * @param maxElements int; The maximum number of data points that can be fed to the stream. - * @return this Options instance. - */ - public static Options maxElements(Long maxElements) { - return new Options().maxElements(maxElements); - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCreateQuantileStreamResource} - */ - public static class Options { - private Long maxElements; - - private Options() { - } - - /** - * Sets the maxElements option. - * - * @param maxElements int; The maximum number of data points that can be fed to the stream. - * @return this Options instance. - */ - public Options maxElements(Long maxElements) { - this.maxElements = maxElements; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java deleted file mode 100644 index 40af63f7302..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java +++ /dev/null @@ -1,65 +0,0 @@ -/* 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.estimator; - -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.types.TInt64; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Deserializes a serialized tree ensemble config and replaces current tree - * ensemble. - */ -public final class BoostedTreesDeserializeEnsemble extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesDeserializeEnsemble"; - - private BoostedTreesDeserializeEnsemble(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesDeserializeEnsemble operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble. - * @param stampToken Token to use as the new value of the resource stamp. - * @param treeEnsembleSerialized Serialized proto of the ensemble. - * @return a new instance of BoostedTreesDeserializeEnsemble - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesDeserializeEnsemble create(Scope scope, - Operand treeEnsembleHandle, Operand stampToken, - Operand treeEnsembleSerialized) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesDeserializeEnsemble"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(stampToken.asOutput()); - opBuilder.addInput(treeEnsembleSerialized.asOutput()); - return new BoostedTreesDeserializeEnsemble(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java deleted file mode 100644 index 5d9a5b8687a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java +++ /dev/null @@ -1,140 +0,0 @@ -/* 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.estimator; - -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.types.family.TType; - -/** - * Creates a handle to a BoostedTreesEnsembleResource - */ -public final class BoostedTreesEnsembleResourceHandleOp extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesEnsembleResourceHandleOp"; - - private Output resource; - - @SuppressWarnings("unchecked") - private BoostedTreesEnsembleResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesEnsembleResourceHandleOp operation. - * - * @param scope current scope - * @param options carries optional attribute values - * @return a new instance of BoostedTreesEnsembleResourceHandleOp - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesEnsembleResourceHandleOp create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesEnsembleResourceHandleOp"); - if (options != null) { - for (Options opts : options) { - if (opts.container != null) { - opBuilder.setAttr("container", opts.container); - } - if (opts.sharedName != null) { - opBuilder.setAttr("shared_name", opts.sharedName); - } - } - } - return new BoostedTreesEnsembleResourceHandleOp(opBuilder.build()); - } - - /** - * Sets the container option. - * - * @param container the container option - * @return this Options instance. - */ - public static Options container(String container) { - return new Options().container(container); - } - - /** - * Sets the sharedName option. - * - * @param sharedName the sharedName option - * @return this Options instance. - */ - public static Options sharedName(String sharedName) { - return new Options().sharedName(sharedName); - } - - /** - * Gets resource. - * - * @return resource. - */ - public Output resource() { - return resource; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesEnsembleResourceHandleOp} - */ - public static class Options { - private String container; - - private String sharedName; - - private Options() { - } - - /** - * Sets the container option. - * - * @param container the container option - * @return this Options instance. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * Sets the sharedName option. - * - * @param sharedName the sharedName option - * @return this Options instance. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java deleted file mode 100644 index 4576b2e4bb5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java +++ /dev/null @@ -1,89 +0,0 @@ -/* 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.estimator; - -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.types.TInt32; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Debugging/model interpretability outputs for each example. - * It traverses all the trees and computes debug metrics for individual examples, - * such as getting split feature ids and logits after each split along the decision - * path used to compute directional feature contributions. - */ -public final class BoostedTreesExampleDebugOutputs extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesExampleDebugOutputs"; - - private Output examplesDebugOutputsSerialized; - - private BoostedTreesExampleDebugOutputs(Operation operation) { - super(operation); - int outputIdx = 0; - examplesDebugOutputsSerialized = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesExampleDebugOutputs operation. - * - * @param scope current scope - * @param treeEnsembleHandle the treeEnsembleHandle value - * @param bucketizedFeatures A list of rank 1 Tensors containing bucket id for each - * feature. - * @param logitsDimension scalar, dimension of the logits, to be used for constructing the protos in - * examples_debug_outputs_serialized. - * @return a new instance of BoostedTreesExampleDebugOutputs - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesExampleDebugOutputs create(Scope scope, - Operand treeEnsembleHandle, Iterable> bucketizedFeatures, - Long logitsDimension) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesExampleDebugOutputs"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesExampleDebugOutputs(opBuilder.build()); - } - - /** - * Gets examplesDebugOutputsSerialized. - * Output rank 1 Tensor containing a proto serialized as a string for each example. - * @return examplesDebugOutputsSerialized. - */ - public Output examplesDebugOutputsSerialized() { - return examplesDebugOutputsSerialized; - } - - @Override - public Output asOutput() { - return examplesDebugOutputsSerialized; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java deleted file mode 100644 index a3db29c7ec7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java +++ /dev/null @@ -1,89 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.family.TType; - -/** - * Flush the quantile summaries from each quantile stream resource. - * An op that outputs a list of quantile summaries of a quantile stream resource. - * Each summary Tensor is rank 2, containing summaries (value, weight, min_rank, - * max_rank) for a single feature. - */ -public final class BoostedTreesFlushQuantileSummaries extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesFlushQuantileSummaries"; - - private List> summaries; - - @SuppressWarnings("unchecked") - private BoostedTreesFlushQuantileSummaries(Operation operation) { - super(operation); - int outputIdx = 0; - int summariesLength = operation.outputListLength("summaries"); - summaries = Arrays.asList((Output[]) operation.outputList(outputIdx, summariesLength)); - outputIdx += summariesLength; - } - - /** - * Factory method to create a class wrapping a new BoostedTreesFlushQuantileSummaries operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param numFeatures the value of the numFeatures property - * @return a new instance of BoostedTreesFlushQuantileSummaries - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesFlushQuantileSummaries create(Scope scope, - Operand quantileStreamResourceHandle, Long numFeatures) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesFlushQuantileSummaries"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.setAttr("num_features", numFeatures); - return new BoostedTreesFlushQuantileSummaries(opBuilder.build()); - } - - /** - * Gets summaries. - * - * @return summaries. - */ - public List> summaries() { - return summaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) summaries.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java deleted file mode 100644 index 66c95e96655..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java +++ /dev/null @@ -1,122 +0,0 @@ -/* 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.estimator; - -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.types.TInt32; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.family.TType; - -/** - * Retrieves the tree ensemble resource stamp token, number of trees and growing statistics. - */ -public final class BoostedTreesGetEnsembleStates extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesGetEnsembleStates"; - - private Output stampToken; - - private Output numTrees; - - private Output numFinalizedTrees; - - private Output numAttemptedLayers; - - private Output lastLayerNodesRange; - - private BoostedTreesGetEnsembleStates(Operation operation) { - super(operation); - int outputIdx = 0; - stampToken = operation.output(outputIdx++); - numTrees = operation.output(outputIdx++); - numFinalizedTrees = operation.output(outputIdx++); - numAttemptedLayers = operation.output(outputIdx++); - lastLayerNodesRange = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesGetEnsembleStates operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble. - * @return a new instance of BoostedTreesGetEnsembleStates - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesGetEnsembleStates create(Scope scope, - Operand treeEnsembleHandle) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesGetEnsembleStates"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - return new BoostedTreesGetEnsembleStates(opBuilder.build()); - } - - /** - * Gets stampToken. - * Stamp token of the tree ensemble resource. - * @return stampToken. - */ - public Output stampToken() { - return stampToken; - } - - /** - * Gets numTrees. - * The number of trees in the tree ensemble resource. - * @return numTrees. - */ - public Output numTrees() { - return numTrees; - } - - /** - * Gets numFinalizedTrees. - * The number of trees that were finished successfully. - * @return numFinalizedTrees. - */ - public Output numFinalizedTrees() { - return numFinalizedTrees; - } - - /** - * Gets numAttemptedLayers. - * The number of layers we attempted to build (but not necessarily succeeded). - * @return numAttemptedLayers. - */ - public Output numAttemptedLayers() { - return numAttemptedLayers; - } - - /** - * Gets lastLayerNodesRange. - * Rank size 2 tensor that contains start and end ids of the nodes in the latest - * layer. - * @return lastLayerNodesRange. - */ - public Output lastLayerNodesRange() { - return lastLayerNodesRange; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java deleted file mode 100644 index ad40fc7f30f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java +++ /dev/null @@ -1,92 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; - -/** - * Makes the summary of quantiles for the batch. - * An op that takes a list of tensors (one tensor per feature) and outputs the - * quantile summaries for each tensor. - */ -public final class BoostedTreesMakeQuantileSummaries extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesMakeQuantileSummaries"; - - private List> summaries; - - @SuppressWarnings("unchecked") - private BoostedTreesMakeQuantileSummaries(Operation operation) { - super(operation); - int outputIdx = 0; - int summariesLength = operation.outputListLength("summaries"); - summaries = Arrays.asList((Output[]) operation.outputList(outputIdx, summariesLength)); - outputIdx += summariesLength; - } - - /** - * Factory method to create a class wrapping a new BoostedTreesMakeQuantileSummaries operation. - * - * @param scope current scope - * @param floatValues float; List of Rank 1 Tensors each containing values for a single feature. - * @param exampleWeights float; Rank 1 Tensor with weights per instance. - * @param epsilon float; The required maximum approximation error. - * @return a new instance of BoostedTreesMakeQuantileSummaries - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesMakeQuantileSummaries create(Scope scope, - Iterable> floatValues, Operand exampleWeights, - Operand epsilon) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesMakeQuantileSummaries"); - opBuilder.addInputList(Operands.asOutputs(floatValues)); - opBuilder.addInput(exampleWeights.asOutput()); - opBuilder.addInput(epsilon.asOutput()); - return new BoostedTreesMakeQuantileSummaries(opBuilder.build()); - } - - /** - * Gets summaries. - * float; List of Rank 2 Tensors each containing the quantile summary - * (value, weight, min_rank, max_rank) of a single feature. - * @return summaries. - */ - public List> summaries() { - return summaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) summaries.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java deleted file mode 100644 index 4827fd7cbcc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java +++ /dev/null @@ -1,90 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * Makes the summary of accumulated stats for the batch. - * The summary stats contains gradients and hessians accumulated into the corresponding node and bucket for each example. - */ -public final class BoostedTreesMakeStatsSummary extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesMakeStatsSummary"; - - private Output statsSummary; - - private BoostedTreesMakeStatsSummary(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummary = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesMakeStatsSummary operation. - * - * @param scope current scope - * @param nodeIds int32 Rank 1 Tensor containing node ids, which each example falls into for the requested layer. - * @param gradients float32; Rank 2 Tensor (shape=[#examples, 1]) for gradients. - * @param hessians float32; Rank 2 Tensor (shape=[#examples, 1]) for hessians. - * @param bucketizedFeaturesList int32 list of Rank 1 Tensors, each containing the bucketized feature (for each feature column). - * @param maxSplits int; the maximum number of splits possible in the whole tree. - * @param numBuckets int; equals to the maximum possible value of bucketized feature. - * @return a new instance of BoostedTreesMakeStatsSummary - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesMakeStatsSummary create(Scope scope, Operand nodeIds, - Operand gradients, Operand hessians, - Iterable> bucketizedFeaturesList, Long maxSplits, Long numBuckets) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesMakeStatsSummary"); - opBuilder.addInput(nodeIds.asOutput()); - opBuilder.addInput(gradients.asOutput()); - opBuilder.addInput(hessians.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeaturesList)); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesMakeStatsSummary(opBuilder.build()); - } - - /** - * Gets statsSummary. - * output Rank 4 Tensor (shape=[#features, #splits, #buckets, 2]) containing accumulated stats put into the corresponding node and bucket. The first index of 4th dimension refers to gradients, and the second to hessians. - * @return statsSummary. - */ - public Output statsSummary() { - return statsSummary; - } - - @Override - public Output asOutput() { - return statsSummary; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java deleted file mode 100644 index 0ac4d12e6ee..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java +++ /dev/null @@ -1,87 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TType; - -/** - * Runs multiple additive regression ensemble predictors on input instances and - * computes the logits. It is designed to be used during prediction. - * It traverses all the trees and calculates the final score for each instance. - */ -public final class BoostedTreesPredict extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesPredict"; - - private Output logits; - - private BoostedTreesPredict(Operation operation) { - super(operation); - int outputIdx = 0; - logits = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesPredict operation. - * - * @param scope current scope - * @param treeEnsembleHandle the treeEnsembleHandle value - * @param bucketizedFeatures A list of rank 1 Tensors containing bucket id for each - * feature. - * @param logitsDimension scalar, dimension of the logits, to be used for partial logits - * shape. - * @return a new instance of BoostedTreesPredict - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesPredict create(Scope scope, Operand treeEnsembleHandle, - Iterable> bucketizedFeatures, Long logitsDimension) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesPredict"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesPredict(opBuilder.build()); - } - - /** - * Gets logits. - * Output rank 2 Tensor containing logits for each example. - * @return logits. - */ - public Output logits() { - return logits; - } - - @Override - public Output asOutput() { - return logits; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java deleted file mode 100644 index 954e39d5ad7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java +++ /dev/null @@ -1,65 +0,0 @@ -/* 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.estimator; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; - -/** - * Add the quantile summaries to each quantile stream resource. - * An op that adds a list of quantile summaries to a quantile stream resource. Each - * summary Tensor is rank 2, containing summaries (value, weight, min_rank, max_rank) - * for a single feature. - */ -public final class BoostedTreesQuantileStreamResourceAddSummaries extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceAddSummaries"; - - private BoostedTreesQuantileStreamResourceAddSummaries(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceAddSummaries operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param summaries string; List of Rank 2 Tensor each containing the summaries for a single feature. - * @return a new instance of BoostedTreesQuantileStreamResourceAddSummaries - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesQuantileStreamResourceAddSummaries create(Scope scope, - Operand quantileStreamResourceHandle, - Iterable> summaries) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesQuantileStreamResourceAddSummaries"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(summaries)); - return new BoostedTreesQuantileStreamResourceAddSummaries(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java deleted file mode 100644 index b5468eabcdd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java +++ /dev/null @@ -1,63 +0,0 @@ -/* 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.estimator; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; - -/** - * Deserialize bucket boundaries and ready flag into current QuantileAccumulator. - * An op that deserializes bucket boundaries and are boundaries ready flag into current QuantileAccumulator. - */ -public final class BoostedTreesQuantileStreamResourceDeserialize extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceDeserialize"; - - private BoostedTreesQuantileStreamResourceDeserialize(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceDeserialize operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param bucketBoundaries float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. - * @return a new instance of BoostedTreesQuantileStreamResourceDeserialize - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesQuantileStreamResourceDeserialize create(Scope scope, - Operand quantileStreamResourceHandle, - Iterable> bucketBoundaries) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesQuantileStreamResourceDeserialize"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); - return new BoostedTreesQuantileStreamResourceDeserialize(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java deleted file mode 100644 index 6fada5bf903..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java +++ /dev/null @@ -1,111 +0,0 @@ -/* 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.estimator; - -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.types.TInt64; -import org.tensorflow.types.family.TType; - -/** - * Flush the summaries for a quantile stream resource. - * An op that flushes the summaries for a quantile stream resource. - */ -public final class BoostedTreesQuantileStreamResourceFlush extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceFlush"; - - private BoostedTreesQuantileStreamResourceFlush(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceFlush operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param numBuckets int; approximate number of buckets unless using generate_quantiles. - * @param options carries optional attribute values - * @return a new instance of BoostedTreesQuantileStreamResourceFlush - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesQuantileStreamResourceFlush create(Scope scope, - Operand quantileStreamResourceHandle, Operand numBuckets, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesQuantileStreamResourceFlush"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.addInput(numBuckets.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.generateQuantiles != null) { - opBuilder.setAttr("generate_quantiles", opts.generateQuantiles); - } - } - } - return new BoostedTreesQuantileStreamResourceFlush(opBuilder.build()); - } - - /** - * Sets the generateQuantiles option. - * - * @param generateQuantiles bool; If True, the output will be the num_quantiles for each stream where the ith - * entry is the ith quantile of the input with an approximation error of epsilon. - * Duplicate values may be present. - * If False, the output will be the points in the histogram that we got which roughly - * translates to 1/epsilon boundaries and without any duplicates. - * Default to False. - * @return this Options instance. - */ - public static Options generateQuantiles(Boolean generateQuantiles) { - return new Options().generateQuantiles(generateQuantiles); - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceFlush} - */ - public static class Options { - private Boolean generateQuantiles; - - private Options() { - } - - /** - * Sets the generateQuantiles option. - * - * @param generateQuantiles bool; If True, the output will be the num_quantiles for each stream where the ith - * entry is the ith quantile of the input with an approximation error of epsilon. - * Duplicate values may be present. - * If False, the output will be the points in the histogram that we got which roughly - * translates to 1/epsilon boundaries and without any duplicates. - * Default to False. - * @return this Options instance. - */ - public Options generateQuantiles(Boolean generateQuantiles) { - this.generateQuantiles = generateQuantiles; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java deleted file mode 100644 index c615b19b3ec..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java +++ /dev/null @@ -1,88 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.family.TType; - -/** - * Generate the bucket boundaries for each feature based on accumulated summaries. - * An op that returns a list of float tensors for a quantile stream resource. Each - * tensor is Rank 1 containing bucket boundaries for a single feature. - */ -public final class BoostedTreesQuantileStreamResourceGetBucketBoundaries extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceGetBucketBoundaries"; - - private List> bucketBoundaries; - - @SuppressWarnings("unchecked") - private BoostedTreesQuantileStreamResourceGetBucketBoundaries(Operation operation) { - super(operation); - int outputIdx = 0; - int bucketBoundariesLength = operation.outputListLength("bucket_boundaries"); - bucketBoundaries = Arrays.asList((Output[]) operation.outputList(outputIdx, bucketBoundariesLength)); - outputIdx += bucketBoundariesLength; - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceGetBucketBoundaries operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param numFeatures inferred int; number of features to get bucket boundaries for. - * @return a new instance of BoostedTreesQuantileStreamResourceGetBucketBoundaries - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesQuantileStreamResourceGetBucketBoundaries create(Scope scope, - Operand quantileStreamResourceHandle, Long numFeatures) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesQuantileStreamResourceGetBucketBoundaries"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - opBuilder.setAttr("num_features", numFeatures); - return new BoostedTreesQuantileStreamResourceGetBucketBoundaries(opBuilder.build()); - } - - /** - * Gets bucketBoundaries. - * float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. - * @return bucketBoundaries. - */ - public List> bucketBoundaries() { - return bucketBoundaries; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) bucketBoundaries.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java deleted file mode 100644 index 48af0041d87..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java +++ /dev/null @@ -1,140 +0,0 @@ -/* 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.estimator; - -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.types.family.TType; - -/** - * Creates a handle to a BoostedTreesQuantileStreamResource. - */ -public final class BoostedTreesQuantileStreamResourceHandleOp extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceHandleOp"; - - private Output resource; - - @SuppressWarnings("unchecked") - private BoostedTreesQuantileStreamResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceHandleOp operation. - * - * @param scope current scope - * @param options carries optional attribute values - * @return a new instance of BoostedTreesQuantileStreamResourceHandleOp - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesQuantileStreamResourceHandleOp create(Scope scope, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesQuantileStreamResourceHandleOp"); - if (options != null) { - for (Options opts : options) { - if (opts.container != null) { - opBuilder.setAttr("container", opts.container); - } - if (opts.sharedName != null) { - opBuilder.setAttr("shared_name", opts.sharedName); - } - } - } - return new BoostedTreesQuantileStreamResourceHandleOp(opBuilder.build()); - } - - /** - * Sets the container option. - * - * @param container the container option - * @return this Options instance. - */ - public static Options container(String container) { - return new Options().container(container); - } - - /** - * Sets the sharedName option. - * - * @param sharedName the sharedName option - * @return this Options instance. - */ - public static Options sharedName(String sharedName) { - return new Options().sharedName(sharedName); - } - - /** - * Gets resource. - * - * @return resource. - */ - public Output resource() { - return resource; - } - - @Override - @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceHandleOp} - */ - public static class Options { - private String container; - - private String sharedName; - - private Options() { - } - - /** - * Sets the container option. - * - * @param container the container option - * @return this Options instance. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * Sets the sharedName option. - * - * @param sharedName the sharedName option - * @return this Options instance. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java deleted file mode 100644 index b3c0bee4eb8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java +++ /dev/null @@ -1,85 +0,0 @@ -/* 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.estimator; - -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.types.TInt64; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Serializes the tree ensemble to a proto. - */ -public final class BoostedTreesSerializeEnsemble extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesSerializeEnsemble"; - - private Output stampToken; - - private Output treeEnsembleSerialized; - - private BoostedTreesSerializeEnsemble(Operation operation) { - super(operation); - int outputIdx = 0; - stampToken = operation.output(outputIdx++); - treeEnsembleSerialized = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesSerializeEnsemble operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble. - * @return a new instance of BoostedTreesSerializeEnsemble - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesSerializeEnsemble create(Scope scope, - Operand treeEnsembleHandle) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesSerializeEnsemble"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - return new BoostedTreesSerializeEnsemble(opBuilder.build()); - } - - /** - * Gets stampToken. - * Stamp token of the tree ensemble resource. - * @return stampToken. - */ - public Output stampToken() { - return stampToken; - } - - /** - * Gets treeEnsembleSerialized. - * Serialized proto of the ensemble. - * @return treeEnsembleSerialized. - */ - public Output treeEnsembleSerialized() { - return treeEnsembleSerialized; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java deleted file mode 100644 index 7b6cae32a40..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java +++ /dev/null @@ -1,126 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; - -/** - * Aggregates the summary of accumulated stats for the batch. - * The summary stats contains gradients and hessians accumulated for each node, bucket and dimension id. - */ -public final class BoostedTreesSparseAggregateStats extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesSparseAggregateStats"; - - private Output statsSummaryIndices; - - private Output statsSummaryValues; - - private Output statsSummaryShape; - - private BoostedTreesSparseAggregateStats(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummaryIndices = operation.output(outputIdx++); - statsSummaryValues = operation.output(outputIdx++); - statsSummaryShape = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesSparseAggregateStats operation. - * - * @param scope current scope - * @param nodeIds int32; Rank 1 Tensor containing node ids for each example, shape [batch_size]. - * @param gradients float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example. - * @param hessians float32; Rank 2 Tensor (shape=[batch_size, hessian_dimension]) with hessians for each example. - * @param featureIndices int32; Rank 2 indices of feature sparse Tensors (shape=[number of sparse entries, 2]). - * Number of sparse entries across all instances from the batch. The first value is - * the index of the instance, the second is dimension of the feature. The second axis - * can only have 2 values, i.e., the input dense version of Tensor can only be matrix. - * @param featureValues int32; Rank 1 values of feature sparse Tensors (shape=[number of sparse entries]). - * Number of sparse entries across all instances from the batch. The first value is - * the index of the instance, the second is dimension of the feature. - * @param featureShape int32; Rank 1 dense shape of feature sparse Tensors (shape=[2]). - * The first axis can only have 2 values, [batch_size, feature_dimension]. - * @param maxSplits int; the maximum number of splits possible in the whole tree. - * @param numBuckets int; equals to the maximum possible value of bucketized feature + 1. - * @return a new instance of BoostedTreesSparseAggregateStats - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesSparseAggregateStats create(Scope scope, Operand nodeIds, - Operand gradients, Operand hessians, Operand featureIndices, - Operand featureValues, Operand featureShape, Long maxSplits, - Long numBuckets) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesSparseAggregateStats"); - opBuilder.addInput(nodeIds.asOutput()); - opBuilder.addInput(gradients.asOutput()); - opBuilder.addInput(hessians.asOutput()); - opBuilder.addInput(featureIndices.asOutput()); - opBuilder.addInput(featureValues.asOutput()); - opBuilder.addInput(featureShape.asOutput()); - opBuilder.setAttr("max_splits", maxSplits); - opBuilder.setAttr("num_buckets", numBuckets); - return new BoostedTreesSparseAggregateStats(opBuilder.build()); - } - - /** - * Gets statsSummaryIndices. - * int32; Rank 2 indices of summary sparse Tensors (shape=[number of non zero statistics, 4]) - * The second axis can only be 4 including node id, feature dimension, bucket id, and statistics_dimension. - * statistics_dimension = logits_dimension + hessian_dimension. - * @return statsSummaryIndices. - */ - public Output statsSummaryIndices() { - return statsSummaryIndices; - } - - /** - * Gets statsSummaryValues. - * output Rank 1 Tensor (shape=[number of non zero statistics]) - * @return statsSummaryValues. - */ - public Output statsSummaryValues() { - return statsSummaryValues; - } - - /** - * Gets statsSummaryShape. - * output Rank 1 Tensor (shape=[4]) - * The tensor has following 4 values: [max_splits, feature_dimension, num_buckets, statistics_dimension], - * where statistics_dimension = gradient_dimension + hessian_dimension. gradient_dimension - * is the same as label_dimension, i.e., the output space. hessian_dimension can be the same - * as logits dimension when diagonal hessian is used, or label_dimension^2 when full - * hessian is used. - * @return statsSummaryShape. - */ - public Output statsSummaryShape() { - return statsSummaryShape; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java deleted file mode 100644 index b5e90ffdb83..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java +++ /dev/null @@ -1,210 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; - -/** - * Calculates gains for each feature and returns the best possible split information for the feature. - * The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

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

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

    The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. - */ -public final class BoostedTreesSparseCalculateBestFeatureSplit extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesSparseCalculateBestFeatureSplit"; - - private Output nodeIds; - - private Output gains; - - private Output featureDimensions; - - private Output thresholds; - - private Output leftNodeContribs; - - private Output rightNodeContribs; - - private Output splitWithDefaultDirections; - - private BoostedTreesSparseCalculateBestFeatureSplit(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesSparseCalculateBestFeatureSplit operation. - * - * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). - * @param statsSummaryIndices A Rank 2 int64 tensor of dense shape [N, 4] (N specifies the number of non-zero values) for accumulated stats summary (gradient/hessian) per node per bucket for each feature. The second dimension contains node id, feature dimension, bucket id, and stats dim. - * stats dim is the sum of logits dimension and hessian dimension, hessian dimension can either be logits dimension if diagonal hessian is used, or logits dimension^2 if full hessian is used. - * @param statsSummaryValues A Rank 1 float tensor of dense shape [N] (N specifies the number of non-zero values), which supplies the values for each element in summary_indices. - * @param statsSummaryShape A Rank 1 float tensor of dense shape [4], which specifies the dense shape of the sparse tensor, which is [num tree nodes, feature dimensions, num buckets, stats dim]. - * @param l1 l1 regularization factor on leaf weights, per instance based. - * @param l2 l2 regularization factor on leaf weights, per instance based. - * @param treeComplexity adjustment to the gain, per leaf based. - * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. - * @param logitsDimension The dimension of logit, i.e., number of classes. - * @param options carries optional attribute values - * @return a new instance of BoostedTreesSparseCalculateBestFeatureSplit - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesSparseCalculateBestFeatureSplit create(Scope scope, - Operand nodeIdRange, Operand statsSummaryIndices, - Operand statsSummaryValues, Operand statsSummaryShape, Operand l1, - Operand l2, Operand treeComplexity, Operand minNodeWeight, - Long logitsDimension, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesSparseCalculateBestFeatureSplit"); - opBuilder.addInput(nodeIdRange.asOutput()); - opBuilder.addInput(statsSummaryIndices.asOutput()); - opBuilder.addInput(statsSummaryValues.asOutput()); - opBuilder.addInput(statsSummaryShape.asOutput()); - opBuilder.addInput(l1.asOutput()); - opBuilder.addInput(l2.asOutput()); - opBuilder.addInput(treeComplexity.asOutput()); - opBuilder.addInput(minNodeWeight.asOutput()); - opBuilder.setAttr("logits_dimension", logitsDimension); - if (options != null) { - for (Options opts : options) { - if (opts.splitType != null) { - opBuilder.setAttr("split_type", opts.splitType); - } - } - } - return new BoostedTreesSparseCalculateBestFeatureSplit(opBuilder.build()); - } - - /** - * Sets the splitType option. - * - * @param splitType A string indicating if this Op should perform inequality split or equality split. - * @return this Options instance. - */ - public static Options splitType(String splitType) { - return new Options().splitType(splitType); - } - - /** - * Gets nodeIds. - * A Rank 1 tensor indicating possible node ids that can be split. - * @return nodeIds. - */ - public Output nodeIds() { - return nodeIds; - } - - /** - * Gets gains. - * A Rank 1 tensor indicating the best gains to split each node. - * @return gains. - */ - public Output gains() { - return gains; - } - - /** - * Gets featureDimensions. - * A Rank 1 tensor indicating the best feature dimension for each feature to split for each node. - * @return featureDimensions. - */ - public Output featureDimensions() { - return featureDimensions; - } - - /** - * Gets thresholds. - * A Rank 1 tensor indicating the bucket id to compare with (as a threshold) for split in each node. - * @return thresholds. - */ - public Output thresholds() { - return thresholds; - } - - /** - * Gets leftNodeContribs. - * A Rank 2 tensor indicating the contribution of the left nodes when branching from parent nodes to the left direction by the given threshold for each feature. - * This value will be used to make the left node value by adding to the parent node value. Second dimension size is logits dimension. - * @return leftNodeContribs. - */ - public Output leftNodeContribs() { - return leftNodeContribs; - } - - /** - * Gets rightNodeContribs. - * A Rank 2 tensor, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. - * @return rightNodeContribs. - */ - public Output rightNodeContribs() { - return rightNodeContribs; - } - - /** - * Gets splitWithDefaultDirections. - * A Rank 1 tensor indicating which direction to go if data is missing. - * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. - * @return splitWithDefaultDirections. - */ - public Output splitWithDefaultDirections() { - return splitWithDefaultDirections; - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesSparseCalculateBestFeatureSplit} - */ - public static class Options { - private String splitType; - - private Options() { - } - - /** - * Sets the splitType option. - * - * @param splitType A string indicating if this Op should perform inequality split or equality split. - * @return this Options instance. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java deleted file mode 100644 index ea3356846b7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java +++ /dev/null @@ -1,116 +0,0 @@ -/* 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.estimator; - -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.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TType; - -/** - * Runs multiple additive regression ensemble predictors on input instances and - * computes the update to cached logits. It is designed to be used during training. - * It traverses the trees starting from cached tree id and cached node id and - * calculates the updates to be pushed to the cache. - */ -public final class BoostedTreesTrainingPredict extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesTrainingPredict"; - - private Output partialLogits; - - private Output treeIds; - - private Output nodeIds; - - private BoostedTreesTrainingPredict(Operation operation) { - super(operation); - int outputIdx = 0; - partialLogits = operation.output(outputIdx++); - treeIds = operation.output(outputIdx++); - nodeIds = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesTrainingPredict operation. - * - * @param scope current scope - * @param treeEnsembleHandle the treeEnsembleHandle value - * @param cachedTreeIds Rank 1 Tensor containing cached tree ids which is the starting - * tree of prediction. - * @param cachedNodeIds Rank 1 Tensor containing cached node id which is the starting - * node of prediction. - * @param bucketizedFeatures A list of rank 1 Tensors containing bucket id for each - * feature. - * @param logitsDimension scalar, dimension of the logits, to be used for partial logits - * shape. - * @return a new instance of BoostedTreesTrainingPredict - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesTrainingPredict create(Scope scope, - Operand treeEnsembleHandle, Operand cachedTreeIds, - Operand cachedNodeIds, Iterable> bucketizedFeatures, - Long logitsDimension) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesTrainingPredict"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(cachedTreeIds.asOutput()); - opBuilder.addInput(cachedNodeIds.asOutput()); - opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); - opBuilder.setAttr("logits_dimension", logitsDimension); - return new BoostedTreesTrainingPredict(opBuilder.build()); - } - - /** - * Gets partialLogits. - * Rank 2 Tensor containing logits update (with respect to cached - * values stored) for each example. - * @return partialLogits. - */ - public Output partialLogits() { - return partialLogits; - } - - /** - * Gets treeIds. - * Rank 1 Tensor containing new tree ids for each example. - * @return treeIds. - */ - public Output treeIds() { - return treeIds; - } - - /** - * Gets nodeIds. - * Rank 1 Tensor containing new node ids in the new tree_ids. - * @return nodeIds. - */ - public Output nodeIds() { - return nodeIds; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java deleted file mode 100644 index 69b68815545..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java +++ /dev/null @@ -1,91 +0,0 @@ -/* 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.estimator; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TType; - -/** - * Updates the tree ensemble by either adding a layer to the last tree being grown - * or by starting a new tree. - */ -public final class BoostedTreesUpdateEnsemble extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesUpdateEnsemble"; - - private BoostedTreesUpdateEnsemble(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesUpdateEnsemble operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the ensemble variable. - * @param featureIds Rank 1 tensor with ids for each feature. This is the real id of - * the feature that will be used in the split. - * @param nodeIds List of rank 1 tensors representing the nodes for which this feature - * has a split. - * @param gains List of rank 1 tensors representing the gains for each of the feature's - * split. - * @param thresholds List of rank 1 tensors representing the thesholds for each of the - * feature's split. - * @param leftNodeContribs List of rank 2 tensors with left leaf contribs for each of - * the feature's splits. Will be added to the previous node values to constitute - * the values of the left nodes. - * @param rightNodeContribs List of rank 2 tensors with right leaf contribs for each - * of the feature's splits. Will be added to the previous node values to constitute - * the values of the right nodes. - * @param maxDepth Max depth of the tree to build. - * @param learningRate shrinkage const for each new tree. - * @param pruningMode 0-No pruning, 1-Pre-pruning, 2-Post-pruning. - * @return a new instance of BoostedTreesUpdateEnsemble - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesUpdateEnsemble create(Scope scope, - Operand treeEnsembleHandle, Operand featureIds, - Iterable> nodeIds, Iterable> gains, - Iterable> thresholds, Iterable> leftNodeContribs, - Iterable> rightNodeContribs, Operand maxDepth, - Operand learningRate, Long pruningMode) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesUpdateEnsemble"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInput(featureIds.asOutput()); - opBuilder.addInputList(Operands.asOutputs(nodeIds)); - opBuilder.addInputList(Operands.asOutputs(gains)); - opBuilder.addInputList(Operands.asOutputs(thresholds)); - opBuilder.addInputList(Operands.asOutputs(leftNodeContribs)); - opBuilder.addInputList(Operands.asOutputs(rightNodeContribs)); - opBuilder.addInput(maxDepth.asOutput()); - opBuilder.addInput(learningRate.asOutput()); - opBuilder.setAttr("pruning_mode", pruningMode); - return new BoostedTreesUpdateEnsemble(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java deleted file mode 100644 index e4ba8d4a353..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java +++ /dev/null @@ -1,166 +0,0 @@ -/* 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.estimator; - -import org.tensorflow.Operand; -import org.tensorflow.Operation; -import org.tensorflow.OperationBuilder; -import org.tensorflow.op.Operands; -import org.tensorflow.op.RawOp; -import org.tensorflow.op.Scope; -import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.types.TFloat32; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Updates the tree ensemble by adding a layer to the last tree being grown - * or by starting a new tree. - */ -public final class BoostedTreesUpdateEnsembleV2 extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "BoostedTreesUpdateEnsembleV2"; - - private BoostedTreesUpdateEnsembleV2(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new BoostedTreesUpdateEnsembleV2 operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the ensemble variable. - * @param featureIds Rank 1 tensor with ids for each feature. This is the real id of - * the feature that will be used in the split. - * @param dimensionIds List of rank 1 tensors representing the dimension in each feature. - * @param nodeIds List of rank 1 tensors representing the nodes for which this feature - * has a split. - * @param gains List of rank 1 tensors representing the gains for each of the feature's - * split. - * @param thresholds List of rank 1 tensors representing the thesholds for each of the - * feature's split. - * @param leftNodeContribs List of rank 2 tensors with left leaf contribs for each of - * the feature's splits. Will be added to the previous node values to constitute - * the values of the left nodes. - * @param rightNodeContribs List of rank 2 tensors with right leaf contribs for each - * of the feature's splits. Will be added to the previous node values to constitute - * the values of the right nodes. - * @param splitTypes List of rank 1 tensors representing the split type for each feature. - * @param maxDepth Max depth of the tree to build. - * @param learningRate shrinkage const for each new tree. - * @param pruningMode 0-No pruning, 1-Pre-pruning, 2-Post-pruning. - * @param options carries optional attribute values - * @return a new instance of BoostedTreesUpdateEnsembleV2 - */ - @Endpoint( - describeByClass = true - ) - public static BoostedTreesUpdateEnsembleV2 create(Scope scope, - Operand treeEnsembleHandle, Iterable> featureIds, - Iterable> dimensionIds, Iterable> nodeIds, - Iterable> gains, Iterable> thresholds, - Iterable> leftNodeContribs, Iterable> rightNodeContribs, - Iterable> splitTypes, Operand maxDepth, - Operand learningRate, Operand pruningMode, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BoostedTreesUpdateEnsembleV2"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - opBuilder.addInputList(Operands.asOutputs(featureIds)); - opBuilder.addInputList(Operands.asOutputs(dimensionIds)); - opBuilder.addInputList(Operands.asOutputs(nodeIds)); - opBuilder.addInputList(Operands.asOutputs(gains)); - opBuilder.addInputList(Operands.asOutputs(thresholds)); - opBuilder.addInputList(Operands.asOutputs(leftNodeContribs)); - opBuilder.addInputList(Operands.asOutputs(rightNodeContribs)); - opBuilder.addInputList(Operands.asOutputs(splitTypes)); - opBuilder.addInput(maxDepth.asOutput()); - opBuilder.addInput(learningRate.asOutput()); - opBuilder.addInput(pruningMode.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.logitsDimension != null) { - opBuilder.setAttr("logits_dimension", opts.logitsDimension); - } - if (opts.numGroups != null) { - opBuilder.setAttr("num_groups", opts.numGroups); - } - } - } - return new BoostedTreesUpdateEnsembleV2(opBuilder.build()); - } - - /** - * Sets the logitsDimension option. - * - * @param logitsDimension scalar, dimension of the logits - * @return this Options instance. - */ - public static Options logitsDimension(Long logitsDimension) { - return new Options().logitsDimension(logitsDimension); - } - - /** - * Sets the numGroups option. - * - * @param numGroups Number of groups of split information to process, where a group contains feature - * ids that are processed together in BoostedTreesCalculateBestFeatureSplitOpV2. - * INFERRED. - * @return this Options instance. - */ - public static Options numGroups(Long numGroups) { - return new Options().numGroups(numGroups); - } - - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesUpdateEnsembleV2} - */ - public static class Options { - private Long logitsDimension; - - private Long numGroups; - - private Options() { - } - - /** - * Sets the logitsDimension option. - * - * @param logitsDimension scalar, dimension of the logits - * @return this Options instance. - */ - public Options logitsDimension(Long logitsDimension) { - this.logitsDimension = logitsDimension; - return this; - } - - /** - * Sets the numGroups option. - * - * @param numGroups Number of groups of split information to process, where a group contains feature - * ids that are processed together in BoostedTreesCalculateBestFeatureSplitOpV2. - * INFERRED. - * @return this Options instance. - */ - public Options numGroups(Long numGroups) { - this.numGroups = numGroups; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java deleted file mode 100644 index 98ca381fce6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java +++ /dev/null @@ -1,77 +0,0 @@ -/* 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.estimator; - -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.types.TBool; -import org.tensorflow.types.family.TType; - -/** - * Checks whether a tree ensemble has been initialized. - */ -public final class IsBoostedTreesEnsembleInitialized extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "IsBoostedTreesEnsembleInitialized"; - - private Output isInitialized; - - private IsBoostedTreesEnsembleInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new IsBoostedTreesEnsembleInitialized operation. - * - * @param scope current scope - * @param treeEnsembleHandle Handle to the tree ensemble resource. - * @return a new instance of IsBoostedTreesEnsembleInitialized - */ - @Endpoint( - describeByClass = true - ) - public static IsBoostedTreesEnsembleInitialized create(Scope scope, - Operand treeEnsembleHandle) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsBoostedTreesEnsembleInitialized"); - opBuilder.addInput(treeEnsembleHandle.asOutput()); - return new IsBoostedTreesEnsembleInitialized(opBuilder.build()); - } - - /** - * Gets isInitialized. - * output boolean on whether it is initialized or not. - * @return isInitialized. - */ - public Output isInitialized() { - return isInitialized; - } - - @Override - public Output asOutput() { - return isInitialized; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java deleted file mode 100644 index 0fce945d36f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.estimator; - -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.types.TBool; -import org.tensorflow.types.family.TType; - -/** - * Checks whether a quantile stream has been initialized. - * An Op that checks if quantile stream resource is initialized. - */ -public final class IsBoostedTreesQuantileStreamResourceInitialized extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "IsBoostedTreesQuantileStreamResourceInitialized"; - - private Output isInitialized; - - private IsBoostedTreesQuantileStreamResourceInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new IsBoostedTreesQuantileStreamResourceInitialized operation. - * - * @param scope current scope - * @param quantileStreamResourceHandle resource; The reference to quantile stream resource handle. - * @return a new instance of IsBoostedTreesQuantileStreamResourceInitialized - */ - @Endpoint( - describeByClass = true - ) - public static IsBoostedTreesQuantileStreamResourceInitialized create(Scope scope, - Operand quantileStreamResourceHandle) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsBoostedTreesQuantileStreamResourceInitialized"); - opBuilder.addInput(quantileStreamResourceHandle.asOutput()); - return new IsBoostedTreesQuantileStreamResourceInitialized(opBuilder.build()); - } - - /** - * Gets isInitialized. - * bool; True if the resource is initialized, False otherwise. - * @return isInitialized. - */ - public Output isInitialized() { - return isInitialized; - } - - @Override - public Output asOutput() { - return isInitialized; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java index 151f7ddee9e..123c74afd50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -37,9 +43,11 @@ *

    For each channel, the Op first computes the mean of the image pixels in the * channel and then adjusts each component of each pixel to * {@code (x - mean) * contrast_factor + mean}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AdjustContrast.OP_NAME, + inputsClass = AdjustContrast.Inputs.class +) @Operator( group = "image" ) @@ -51,8 +59,8 @@ public final class AdjustContrast extends RawOp implements Op private Output output; - private AdjustContrast(Operation operation) { - super(operation); + public AdjustContrast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -90,4 +98,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = AdjustContrast.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Images to adjust. At least 3-D. + */ + public final Operand images; + + /** + * A float multiplier for adjusting contrast. + */ + public final Operand contrastFactor; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AdjustContrast<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + contrastFactor = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java index 747f8f12713..b0001085638 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ *

    The input image is considered in the RGB colorspace. Conceptually, the RGB * colors are first mapped into HSV. A delta is then applied all the hue values, * and then remapped back to RGB colorspace. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AdjustHue.OP_NAME, + inputsClass = AdjustHue.Inputs.class +) @Operator( group = "image" ) @@ -49,8 +57,8 @@ public final class AdjustHue extends RawOp implements Operand private Output output; - private AdjustHue(Operation operation) { - super(operation); + public AdjustHue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -88,4 +96,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = AdjustHue.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Images to adjust. At least 3-D. + */ + public final Operand images; + + /** + * A float delta to add to the hue. + */ + public final Operand delta; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AdjustHue<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java index 0de6e84071b..5f0c063dc1d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ *

    The input image is considered in the RGB colorspace. Conceptually, the RGB * colors are first mapped into HSV. A scale is then applied all the saturation * values, and then remapped back to RGB colorspace. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AdjustSaturation.OP_NAME, + inputsClass = AdjustSaturation.Inputs.class +) @Operator( group = "image" ) @@ -49,8 +57,8 @@ public final class AdjustSaturation extends RawOp implements private Output output; - private AdjustSaturation(Operation operation) { - super(operation); + public AdjustSaturation(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -88,4 +96,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = AdjustSaturation.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Images to adjust. At least 3-D. + */ + public final Operand images; + + /** + * A float scale to add to the saturation. + */ + public final Operand scale; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AdjustSaturation<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + scale = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java index 5357f75dd95..d3dff6d2a2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -44,6 +49,10 @@ * The output of this operation is the final boxes, scores and classes tensor * returned after performing non_max_suppression. */ +@OpMetadata( + opType = CombinedNonMaxSuppression.OP_NAME, + inputsClass = CombinedNonMaxSuppression.Inputs.class +) @Operator( group = "image" ) @@ -61,8 +70,8 @@ public final class CombinedNonMaxSuppression extends RawOp { private Output validDetections; - private CombinedNonMaxSuppression(Operation operation) { - super(operation); + public CombinedNonMaxSuppression(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; nmsedBoxes = operation.output(outputIdx++); nmsedScores = operation.output(outputIdx++); @@ -224,4 +233,76 @@ public Options clipBoxes(Boolean clipBoxes) { return this; } } + + @OpInputsMetadata( + outputsClass = CombinedNonMaxSuppression.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 4-D float tensor of shape {@code [batch_size, num_boxes, q, 4]}. If {@code q} is 1 then + * same boxes are used for all classes otherwise, if {@code q} is equal to number of + * classes, class-specific boxes are used. + */ + public final Operand boxes; + + /** + * A 3-D float tensor of shape {@code [batch_size, num_boxes, num_classes]} + * representing a single score corresponding to each box (each row of boxes). + */ + public final Operand scores; + + /** + * A scalar integer tensor representing the maximum number of + * boxes to be selected by non max suppression per class + */ + public final Operand maxOutputSizePerClass; + + /** + * An int32 scalar representing the maximum number of boxes retained over all + * classes. Note that setting this value to a large number may result in OOM error + * depending on the system workload. + */ + public final Operand maxTotalSize; + + /** + * A 0-D float tensor representing the threshold for deciding whether + * boxes overlap too much with respect to IOU. + */ + public final Operand iouThreshold; + + /** + * A 0-D float tensor representing the threshold for deciding when to remove + * boxes based on score. + */ + public final Operand scoreThreshold; + + /** + * If false, the output nmsed boxes, scores and classes + * are padded/clipped to {@code max_total_size}. If true, the + * output nmsed boxes, scores and classes are padded to be of length + * {@code max_size_per_class}*{@code num_classes}, unless it exceeds {@code max_total_size} in + * which case it is clipped to {@code max_total_size}. Defaults to false. + */ + public final boolean padPerClass; + + /** + * If true, assume the box coordinates are between [0, 1] and clip the output boxes + * if they fall beyond [0, 1]. If false, do not do clipping and output the box + * coordinates as it is. + */ + public final boolean clipBoxes; + + public Inputs(GraphOperation op) { + super(new CombinedNonMaxSuppression(op), op, Arrays.asList("pad_per_class", "clip_boxes")); + int inputIndex = 0; + boxes = (Operand) op.input(inputIndex++); + scores = (Operand) op.input(inputIndex++); + maxOutputSizePerClass = (Operand) op.input(inputIndex++); + maxTotalSize = (Operand) op.input(inputIndex++); + iouThreshold = (Operand) op.input(inputIndex++); + scoreThreshold = (Operand) op.input(inputIndex++); + padPerClass = op.attributes().getAttrBool("pad_per_class"); + clipBoxes = op.attributes().getAttrBool("clip_boxes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java index 4d6f9761230..68289e7cdb3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -46,6 +52,10 @@ * {@code tf.image.resize_nearest_neighbor()}(depends on the {@code method} argument) with * {@code align_corners=True}. */ +@OpMetadata( + opType = CropAndResize.OP_NAME, + inputsClass = CropAndResize.Inputs.class +) @Operator( group = "image" ) @@ -57,8 +67,8 @@ public final class CropAndResize extends RawOp implements Operand { private Output crops; - private CropAndResize(Operation operation) { - super(operation); + public CropAndResize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; crops = operation.output(outputIdx++); } @@ -183,4 +193,72 @@ public Options extrapolationValue(Float extrapolationValue) { return this; } } + + @OpInputsMetadata( + outputsClass = CropAndResize.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 4-D tensor of shape {@code [batch, image_height, image_width, depth]}. + * Both {@code image_height} and {@code image_width} need to be positive. + */ + public final Operand image; + + /** + * A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor + * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified + * in normalized coordinates {@code [y1, x1, y2, x2]}. A normalized coordinate value of + * {@code y} is mapped to the image coordinate at {@code y * (image_height - 1)}, so as the + * {@code [0, 1]} interval of normalized image height is mapped to + * {@code [0, image_height - 1]} in image height coordinates. We do allow {@code y1} > {@code y2}, in + * which case the sampled crop is an up-down flipped version of the original + * image. The width dimension is treated similarly. Normalized coordinates + * outside the {@code [0, 1]} range are allowed, in which case we use + * {@code extrapolation_value} to extrapolate the input image values. + */ + public final Operand boxes; + + /** + * A 1-D tensor of shape {@code [num_boxes]} with int32 values in {@code [0, batch)}. + * The value of {@code box_ind[i]} specifies the image that the {@code i}-th box refers to. + */ + public final Operand boxInd; + + /** + * A 1-D tensor of 2 elements, {@code size = [crop_height, crop_width]}. All + * cropped image patches are resized to this size. The aspect ratio of the image + * content is not preserved. Both {@code crop_height} and {@code crop_width} need to be + * positive. + */ + public final Operand cropSize; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A string specifying the sampling method for resizing. It can be either + * {@code "bilinear"} or {@code "nearest"} and default to {@code "bilinear"}. Currently two sampling + * methods are supported: Bilinear and Nearest Neighbor. + */ + public final String method; + + /** + * Value used for extrapolation, when applicable. + */ + public final float extrapolationValue; + + public Inputs(GraphOperation op) { + super(new CropAndResize(op), op, Arrays.asList("T", "method", "extrapolation_value")); + int inputIndex = 0; + image = (Operand) op.input(inputIndex++); + boxes = (Operand) op.input(inputIndex++); + boxInd = (Operand) op.input(inputIndex++); + cropSize = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + method = op.attributes().getAttrString("method"); + extrapolationValue = op.attributes().getAttrFloat("extrapolation_value"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java index a43190b7447..de8e9fc17d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -32,6 +38,10 @@ /** * Computes the gradient of the crop_and_resize op wrt the input boxes tensor. */ +@OpMetadata( + opType = CropAndResizeGradBoxes.OP_NAME, + inputsClass = CropAndResizeGradBoxes.Inputs.class +) @Operator( group = "image" ) @@ -43,8 +53,8 @@ public final class CropAndResizeGradBoxes extends RawOp implements Operand output; - private CropAndResizeGradBoxes(Operation operation) { - super(operation); + public CropAndResizeGradBoxes(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -134,4 +144,58 @@ public Options method(String method) { return this; } } + + @OpInputsMetadata( + outputsClass = CropAndResizeGradBoxes.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + */ + public final Operand grads; + + /** + * A 4-D tensor of shape {@code [batch, image_height, image_width, depth]}. + * Both {@code image_height} and {@code image_width} need to be positive. + */ + public final Operand image; + + /** + * A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor + * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified + * in normalized coordinates {@code [y1, x1, y2, x2]}. A normalized coordinate value of + * {@code y} is mapped to the image coordinate at {@code y * (image_height - 1)}, so as the + * {@code [0, 1]} interval of normalized image height is mapped to + * {@code [0, image_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the }[0, 1]{@code range are allowed, in which case we use}extrapolation_value` to extrapolate the input image values. + */ + public final Operand boxes; + + /** + * A 1-D tensor of shape {@code [num_boxes]} with int32 values in {@code [0, batch)}. + * The value of {@code box_ind[i]} specifies the image that the {@code i}-th box refers to. + */ + public final Operand boxInd; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + */ + public final String method; + + public Inputs(GraphOperation op) { + super(new CropAndResizeGradBoxes(op), op, Arrays.asList("T", "method")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + image = (Operand) op.input(inputIndex++); + boxes = (Operand) op.input(inputIndex++); + boxInd = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + method = op.attributes().getAttrString("method"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java index 48b350c1c6a..e639b0f2cb7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CropAndResizeGradImage.OP_NAME, + inputsClass = CropAndResizeGradImage.Inputs.class +) @Operator( group = "image" ) @@ -46,8 +54,8 @@ public final class CropAndResizeGradImage extends RawOp imple private Output output; - private CropAndResizeGradImage(Operation operation) { - super(operation); + public CropAndResizeGradImage(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -68,7 +76,7 @@ private CropAndResizeGradImage(Operation operation) { * @param imageSize A 1-D tensor with value {@code [batch, image_height, image_width, depth]} * containing the original image size. Both {@code image_height} and {@code image_width} need * to be positive. - * @param T the value of the T property + * @param T The value of the T attribute * @param options carries optional attribute values * @param data type for {@code CropAndResizeGradImage} output and operands * @return a new instance of CropAndResizeGradImage @@ -141,4 +149,59 @@ public Options method(String method) { return this; } } + + @OpInputsMetadata( + outputsClass = CropAndResizeGradImage.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + */ + public final Operand grads; + + /** + * A 2-D tensor of shape {@code [num_boxes, 4]}. The {@code i}-th row of the tensor + * specifies the coordinates of a box in the {@code box_ind[i]} image and is specified + * in normalized coordinates {@code [y1, x1, y2, x2]}. A normalized coordinate value of + * {@code y} is mapped to the image coordinate at {@code y * (image_height - 1)}, so as the + * {@code [0, 1]} interval of normalized image height is mapped to + * {@code [0, image_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the }[0, 1]{@code range are allowed, in which case we use}extrapolation_value` to extrapolate the input image values. + */ + public final Operand boxes; + + /** + * A 1-D tensor of shape {@code [num_boxes]} with int32 values in {@code [0, batch)}. + * The value of {@code box_ind[i]} specifies the image that the {@code i}-th box refers to. + */ + public final Operand boxInd; + + /** + * A 1-D tensor with value {@code [batch, image_height, image_width, depth]} + * containing the original image size. Both {@code image_height} and {@code image_width} need + * to be positive. + */ + public final Operand imageSize; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + */ + public final String method; + + public Inputs(GraphOperation op) { + super(new CropAndResizeGradImage<>(op), op, Arrays.asList("T", "method")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + boxes = (Operand) op.input(inputIndex++); + boxInd = (Operand) op.input(inputIndex++); + imageSize = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + method = op.attributes().getAttrString("method"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java index 21e551ab39f..9cf114193b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -47,6 +52,10 @@ *

    It is equivalent to a combination of decode and crop, but much faster by only * decoding partial jpeg image. */ +@OpMetadata( + opType = DecodeAndCropJpeg.OP_NAME, + inputsClass = DecodeAndCropJpeg.Inputs.class +) @Operator( group = "image" ) @@ -58,8 +67,8 @@ public final class DecodeAndCropJpeg extends RawOp implements Operand { private Output image; - private DecodeAndCropJpeg(Operation operation) { - super(operation); + public DecodeAndCropJpeg(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -279,4 +288,69 @@ public Options dctMethod(String dctMethod) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeAndCropJpeg.class + ) + public static class Inputs extends RawOpInputs { + /** + * 0-D. The JPEG-encoded image. + */ + public final Operand contents; + + /** + * 1-D. The crop window: [crop_y, crop_x, crop_height, crop_width]. + */ + public final Operand cropWindow; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * Downscaling ratio. + */ + public final long ratio; + + /** + * If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + */ + public final boolean fancyUpscaling; + + /** + * If true try to recover an image from truncated input. + */ + public final boolean tryRecoverTruncated; + + /** + * The minimum required fraction of lines before a truncated + * input is accepted. + */ + public final float acceptableFraction; + + /** + * string specifying a hint about the algorithm used for + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * jpeg library changes to a version that does not have that specific + * option.) + */ + public final String dctMethod; + + public Inputs(GraphOperation op) { + super(new DecodeAndCropJpeg(op), op, Arrays.asList("channels", "ratio", "fancy_upscaling", "try_recover_truncated", "acceptable_fraction", "dct_method")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + cropWindow = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + ratio = op.attributes().getAttrInt("ratio"); + fancyUpscaling = op.attributes().getAttrBool("fancy_upscaling"); + tryRecoverTruncated = op.attributes().getAttrBool("try_recover_truncated"); + acceptableFraction = op.attributes().getAttrFloat("acceptable_fraction"); + dctMethod = op.attributes().getAttrString("dct_method"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java index 922f9912a13..f7998c66a07 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; @@ -39,6 +44,10 @@ *

  • 4: output an RGBA image.
  • * */ +@OpMetadata( + opType = DecodeBmp.OP_NAME, + inputsClass = DecodeBmp.Inputs.class +) @Operator( group = "image" ) @@ -50,8 +59,8 @@ public final class DecodeBmp extends RawOp implements Operand { private Output image; - private DecodeBmp(Operation operation) { - super(operation); + public DecodeBmp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -124,4 +133,26 @@ public Options channels(Long channels) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeBmp.class + ) + public static class Inputs extends RawOpInputs { + /** + * 0-D. The BMP-encoded image. + */ + public final Operand contents; + + /** + * The channels attribute + */ + public final long channels; + + public Inputs(GraphOperation op) { + super(new DecodeBmp(op), op, Arrays.asList("channels")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java index 1007eba6b56..ba42c503424 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; @@ -39,6 +44,10 @@ *

    This op also supports decoding JPEGs and PNGs, though it is cleaner to use * {@code tf.io.decode_image}. */ +@OpMetadata( + opType = DecodeGif.OP_NAME, + inputsClass = DecodeGif.Inputs.class +) @Operator( group = "image" ) @@ -50,8 +59,8 @@ public final class DecodeGif extends RawOp implements Operand { private Output image; - private DecodeGif(Operation operation) { - super(operation); + public DecodeGif(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -85,4 +94,20 @@ public Output image() { public Output asOutput() { return image; } + + @OpInputsMetadata( + outputsClass = DecodeGif.class + ) + public static class Inputs extends RawOpInputs { + /** + * 0-D. The GIF-encoded image. + */ + public final Operand contents; + + public Inputs(GraphOperation op) { + super(new DecodeGif(op), op, Arrays.asList()); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + } + } } 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 index 375b6eb693d..891c31bb514 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,39 +17,48 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 + * Function for decode_bmp, decode_gif, decode_jpeg, decode_webp, and decode_png. + * Detects whether an image is a BMP, GIF, JPEG, WebP, 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: decode_gif and decode_webp return a 4-D + * array [num_frames, height, width, 3], as opposed to decode_bmp, + * decode_jpeg, and decode_png, which always return 3-D arrays [height, + * width, num_channels]. Make sure to take this into account when + * constructing your graph if you are intermixing animated 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 animations 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 */ +@OpMetadata( + opType = DecodeImage.OP_NAME, + inputsClass = DecodeImage.Inputs.class +) @Operator( group = "image" ) @@ -61,8 +70,8 @@ public final class DecodeImage extends RawOp implements Opera private Output image; - private DecodeImage(Operation operation) { - super(operation); + public DecodeImage(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -110,7 +119,7 @@ public static DecodeImage create(Scope scope, Operand create(Scope scope, Operand contents, - Options[] options) { + Options... options) { return create(scope, contents, TUint8.class, options); } @@ -127,10 +136,11 @@ public static Options channels(Long channels) { /** * Sets the expandAnimations option. * - * @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. + * @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 and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. * @return this Options instance. */ public static Options expandAnimations(Boolean expandAnimations) { @@ -177,10 +187,11 @@ public Options channels(Long channels) { /** * Sets the expandAnimations option. * - * @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. + * @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 and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. * @return this Options instance. */ public Options expandAnimations(Boolean expandAnimations) { @@ -188,4 +199,42 @@ public Options expandAnimations(Boolean expandAnimations) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeImage.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The encoded image bytes. + */ + public final Operand contents; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * The desired DType of the returned Tensor. + */ + public final DataType dtype; + + /** + * 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 and WebP images, whether animated or not. If, + * False, the returned op will produce a 3-D tensor for all file types + * and will truncate animated images to the first frame. + */ + public final boolean expandAnimations; + + public Inputs(GraphOperation op) { + super(new DecodeImage<>(op), op, Arrays.asList("channels", "dtype", "expand_animations")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + dtype = op.attributes().getAttrType("dtype"); + expandAnimations = op.attributes().getAttrBool("expand_animations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java index 48241719071..4deb6ce61e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; @@ -46,6 +51,10 @@ *

    This op also supports decoding PNGs and non-animated GIFs since the interface is * the same, though it is cleaner to use {@code tf.io.decode_image}. */ +@OpMetadata( + opType = DecodeJpeg.OP_NAME, + inputsClass = DecodeJpeg.Inputs.class +) @Operator( group = "image" ) @@ -57,8 +66,8 @@ public final class DecodeJpeg extends RawOp implements Operand { private Output image; - private DecodeJpeg(Operation operation) { - super(operation); + public DecodeJpeg(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -275,4 +284,63 @@ public Options dctMethod(String dctMethod) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeJpeg.class + ) + public static class Inputs extends RawOpInputs { + /** + * 0-D. The JPEG-encoded image. + */ + public final Operand contents; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * Downscaling ratio. + */ + public final long ratio; + + /** + * If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + */ + public final boolean fancyUpscaling; + + /** + * If true try to recover an image from truncated input. + */ + public final boolean tryRecoverTruncated; + + /** + * The minimum required fraction of lines before a truncated + * input is accepted. + */ + public final float acceptableFraction; + + /** + * string specifying a hint about the algorithm used for + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * jpeg library changes to a version that does not have that specific + * option.) + */ + public final String dctMethod; + + public Inputs(GraphOperation op) { + super(new DecodeJpeg(op), op, Arrays.asList("channels", "ratio", "fancy_upscaling", "try_recover_truncated", "acceptable_fraction", "dct_method")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + ratio = op.attributes().getAttrInt("ratio"); + fancyUpscaling = op.attributes().getAttrBool("fancy_upscaling"); + tryRecoverTruncated = op.attributes().getAttrBool("try_recover_truncated"); + acceptableFraction = op.attributes().getAttrFloat("acceptable_fraction"); + dctMethod = op.attributes().getAttrString("dct_method"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java index 30beedadb3d..8352476fae0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TNumber; @@ -45,9 +51,11 @@ * of color channels. *

    This op also supports decoding JPEGs and non-animated GIFs since the interface * is the same, though it is cleaner to use {@code tf.io.decode_image}. - * - * @param data type for {@code image} output */ +@OpMetadata( + opType = DecodePng.OP_NAME, + inputsClass = DecodePng.Inputs.class +) @Operator( group = "image" ) @@ -59,8 +67,8 @@ public final class DecodePng extends RawOp implements Operand private Output image; - private DecodePng(Operation operation) { - super(operation); + public DecodePng(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; image = operation.output(outputIdx++); } @@ -70,7 +78,7 @@ private DecodePng(Operation operation) { * * @param scope current scope * @param contents 0-D. The PNG-encoded image. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code DecodePng} output and operands * @return a new instance of DecodePng @@ -105,7 +113,7 @@ public static DecodePng create(Scope scope, Operand create(Scope scope, Operand contents, - Options[] options) { + Options... options) { return create(scope, contents, TUint8.class, options); } @@ -153,4 +161,32 @@ public Options channels(Long channels) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodePng.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The PNG-encoded image. + */ + public final Operand contents; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new DecodePng<>(op), op, Arrays.asList("channels", "dtype")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java new file mode 100644 index 00000000000..16a7b6b54cb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeWebP.java @@ -0,0 +1,189 @@ +/* Copyright 2018-2023 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.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUint8; +import org.tensorflow.types.family.TNumber; + +/** + * Decode a WebP-encoded image to a uint8 tensor. + * The attr {@code channels} indicates the desired number of color channels for the + * decoded image. + *

    Accepted values are: + *

      + *
    • 0: Use the number of channels in the WebP-encoded image.
    • + *
    • 3: output an RGB image.
    • + *
    • 4: output an RGBA image.
    • + *
    + *

    The number of channels must currently match that of the underlying file. + * For WebP animations, only 4-channel RGBA is supported. + */ +@OpMetadata( + opType = DecodeWebP.OP_NAME, + inputsClass = DecodeWebP.Inputs.class +) +@Operator( + group = "image" +) +public final class DecodeWebP extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeWebP"; + + private Output image; + + public DecodeWebP(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + image = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DecodeWebP operation. + * + * @param scope current scope + * @param contents 0-D. The WebP-encoded image. + * @param dtype The value of the dtype attribute + * @param options carries optional attribute values + * @param data type for {@code DecodeWebP} output and operands + * @return a new instance of DecodeWebP + */ + @Endpoint( + describeByClass = true + ) + public static DecodeWebP create(Scope scope, Operand contents, + Class dtype, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DecodeWebP"); + opBuilder.addInput(contents.asOutput()); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + if (options != null) { + for (Options opts : options) { + if (opts.channels != null) { + opBuilder.setAttr("channels", opts.channels); + } + } + } + return new DecodeWebP<>(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new DecodeWebP operation, with the default output types. + * + * @param scope current scope + * @param contents 0-D. The WebP-encoded image. + * @param options carries optional attribute values + * @return a new instance of DecodeWebP, with default output types + */ + @Endpoint( + describeByClass = true + ) + public static DecodeWebP create(Scope scope, Operand contents, + Options... options) { + return create(scope, contents, TUint8.class, options); + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public static Options channels(Long channels) { + return new Options().channels(channels); + } + + /** + * Gets image. + * 4-D with shape {@code [num_frames, height, width, channels]}. + * @return image. + */ + public Output image() { + return image; + } + + @Override + public Output asOutput() { + return image; + } + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeWebP} + */ + public static class Options { + private Long channels; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DecodeWebP.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The WebP-encoded image. + */ + public final Operand contents; + + /** + * Number of color channels for the decoded image. + */ + public final long channels; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new DecodeWebP<>(op), op, Arrays.asList("channels", "dtype")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + channels = op.attributes().getAttrInt("channels"); + dtype = op.attributes().getAttrType("dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java index 9ed95d1cb4f..56c64a5e50c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -39,9 +45,11 @@ * box is {@code [0.1, 0.2, 0.5, 0.9]}, the upper-left and bottom-right coordinates of * the bounding box will be {@code (40, 10)} to {@code (100, 50)} (in (x,y) coordinates). *

    Parts of the bounding box may fall outside the image. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DrawBoundingBoxes.OP_NAME, + inputsClass = DrawBoundingBoxes.Inputs.class +) @Operator( group = "image" ) @@ -53,8 +61,8 @@ public final class DrawBoundingBoxes extends RawOp implements private Output output; - private DrawBoundingBoxes(Operation operation) { - super(operation); + public DrawBoundingBoxes(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -96,4 +104,39 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = DrawBoundingBoxes.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, depth]}. A batch of images. + */ + public final Operand images; + + /** + * 3-D with shape {@code [batch, num_bounding_boxes, 4]} containing bounding + * boxes. + */ + public final Operand boxes; + + /** + * 2-D. A list of RGBA colors to cycle through for the boxes. + */ + public final Operand colors; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DrawBoundingBoxes<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + boxes = (Operand) op.input(inputIndex++); + colors = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java index 3fd8f3c3e0f..7ff1e224e6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; @@ -47,6 +52,10 @@ *

  • 3: Output an RGB image.
  • * */ +@OpMetadata( + opType = EncodeJpeg.OP_NAME, + inputsClass = EncodeJpeg.Inputs.class +) @Operator( group = "image" ) @@ -58,8 +67,8 @@ public final class EncodeJpeg extends RawOp implements Operand { private Output contents; - private EncodeJpeg(Operation operation) { - super(operation); + public EncodeJpeg(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; contents = operation.output(outputIdx++); } @@ -342,4 +351,75 @@ public Options xmpMetadata(String xmpMetadata) { return this; } } + + @OpInputsMetadata( + outputsClass = EncodeJpeg.class + ) + public static class Inputs extends RawOpInputs { + /** + * 3-D with shape {@code [height, width, channels]}. + */ + public final Operand image; + + /** + * Per pixel image format. + */ + public final String format; + + /** + * Quality of the compression from 0 to 100 (higher is better and slower). + */ + public final long quality; + + /** + * If True, create a JPEG that loads progressively (coarse to fine). + */ + public final boolean progressive; + + /** + * If True, spend CPU/RAM to reduce size with no quality change. + */ + public final boolean optimizeSize; + + /** + * See http://en.wikipedia.org/wiki/Chroma_subsampling. + */ + public final boolean chromaDownsampling; + + /** + * Unit used to specify {@code x_density} and {@code y_density}: + * pixels per inch ({@code 'in'}) or centimeter ({@code 'cm'}). + */ + public final String densityUnit; + + /** + * Horizontal pixels per density unit. + */ + public final long xDensity; + + /** + * Vertical pixels per density unit. + */ + public final long yDensity; + + /** + * If not empty, embed this XMP metadata in the image header. + */ + public final String xmpMetadata; + + public Inputs(GraphOperation op) { + super(new EncodeJpeg(op), op, Arrays.asList("format", "quality", "progressive", "optimize_size", "chroma_downsampling", "density_unit", "x_density", "y_density", "xmp_metadata")); + int inputIndex = 0; + image = (Operand) op.input(inputIndex++); + format = op.attributes().getAttrString("format"); + quality = op.attributes().getAttrInt("quality"); + progressive = op.attributes().getAttrBool("progressive"); + optimizeSize = op.attributes().getAttrBool("optimize_size"); + chromaDownsampling = op.attributes().getAttrBool("chroma_downsampling"); + densityUnit = op.attributes().getAttrString("density_unit"); + xDensity = op.attributes().getAttrInt("x_density"); + yDensity = op.attributes().getAttrInt("y_density"); + xmpMetadata = op.attributes().getAttrString("xmp_metadata"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java index 1a9960ab6ad..40ee9eb61fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -34,6 +39,10 @@ * {@code image} is a 3-D uint8 Tensor of shape {@code [height, width, channels]}. * {@code quality} is an int32 jpeg compression quality value between 0 and 100. */ +@OpMetadata( + opType = EncodeJpegVariableQuality.OP_NAME, + inputsClass = EncodeJpegVariableQuality.Inputs.class +) @Operator( group = "image" ) @@ -45,8 +54,8 @@ public final class EncodeJpegVariableQuality extends RawOp implements Operand contents; - private EncodeJpegVariableQuality(Operation operation) { - super(operation); + public EncodeJpegVariableQuality(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; contents = operation.output(outputIdx++); } @@ -83,4 +92,26 @@ public Output contents() { public Output asOutput() { return contents; } + + @OpInputsMetadata( + outputsClass = EncodeJpegVariableQuality.class + ) + public static class Inputs extends RawOpInputs { + /** + * Images to adjust. At least 3-D. + */ + public final Operand images; + + /** + * An int quality to encode to. + */ + public final Operand quality; + + public Inputs(GraphOperation op) { + super(new EncodeJpegVariableQuality(op), op, Arrays.asList()); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + quality = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java index 21823f42582..88e33cd5464 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -42,6 +48,10 @@ * default or a value from 0 to 9. 9 is the highest compression level, generating * the smallest output, but is slower. */ +@OpMetadata( + opType = EncodePng.OP_NAME, + inputsClass = EncodePng.Inputs.class +) @Operator( group = "image" ) @@ -53,8 +63,8 @@ public final class EncodePng extends RawOp implements Operand { private Output contents; - private EncodePng(Operation operation) { - super(operation); + public EncodePng(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; contents = operation.output(outputIdx++); } @@ -128,4 +138,32 @@ public Options compression(Long compression) { return this; } } + + @OpInputsMetadata( + outputsClass = EncodePng.class + ) + public static class Inputs extends RawOpInputs { + /** + * 3-D with shape {@code [height, width, channels]}. + */ + public final Operand image; + + /** + * Compression level. + */ + public final long compression; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new EncodePng(op), op, Arrays.asList("compression", "T")); + int inputIndex = 0; + image = (Operand) op.input(inputIndex++); + compression = op.attributes().getAttrInt("compression"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java index d90f89c2b05..44daff67647 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -49,6 +55,13 @@ * numbers of pixels. * */ +@OpMetadata( + opType = ExtractGlimpse.OP_NAME, + inputsClass = ExtractGlimpse.Inputs.class +) +@Operator( + group = "image" +) public final class ExtractGlimpse extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -57,8 +70,8 @@ public final class ExtractGlimpse extends RawOp implements Operand { private Output glimpse; - private ExtractGlimpse(Operation operation) { - super(operation); + public ExtractGlimpse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; glimpse = operation.output(outputIdx++); } @@ -229,4 +242,65 @@ public Options noise(String noise) { return this; } } + + @OpInputsMetadata( + outputsClass = ExtractGlimpse.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 4-D float tensor of shape {@code [batch_size, height, width, channels]}. + */ + public final Operand input; + + /** + * A 1-D tensor of 2 elements containing the size of the glimpses + * to extract. The glimpse height must be specified first, following + * by the glimpse width. + */ + public final Operand sizeOutput; + + /** + * A 2-D integer tensor of shape {@code [batch_size, 2]} containing + * the y, x locations of the center of each window. + */ + public final Operand offsets; + + /** + * indicates if the offset coordinates are centered relative to + * the image, in which case the (0, 0) offset is relative to the center + * of the input images. If false, the (0,0) offset corresponds to the + * upper left corner of the input images. + */ + public final boolean centered; + + /** + * indicates if the offset coordinates are normalized. + */ + public final boolean normalized; + + /** + * indicates if the noise should be generated using a + * uniform distribution or a Gaussian distribution. + */ + public final boolean uniformNoise; + + /** + * indicates if the noise should {@code uniform}, {@code gaussian}, or + * {@code zero}. The default is {@code uniform} which means the noise type + * will be decided by {@code uniform_noise}. + */ + public final String noise; + + public Inputs(GraphOperation op) { + super(new ExtractGlimpse(op), op, Arrays.asList("centered", "normalized", "uniform_noise", "noise")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + offsets = (Operand) op.input(inputIndex++); + centered = op.attributes().getAttrBool("centered"); + normalized = op.attributes().getAttrBool("normalized"); + uniformNoise = op.attributes().getAttrBool("uniform_noise"); + noise = op.attributes().getAttrString("noise"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java index 28c178721c6..54395a44acc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.image; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. - * - * @param data type for {@code patches} output */ +@OpMetadata( + opType = ExtractImagePatches.OP_NAME, + inputsClass = ExtractImagePatches.Inputs.class +) @Operator( group = "image" ) @@ -44,8 +52,8 @@ public final class ExtractImagePatches extends RawOp implements private Output patches; - private ExtractImagePatches(Operation operation) { - super(operation); + public ExtractImagePatches(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; patches = operation.output(outputIdx++); } @@ -109,4 +117,56 @@ public Output patches() { public Output asOutput() { return patches; } + + @OpInputsMetadata( + outputsClass = ExtractImagePatches.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D Tensor with shape {@code [batch, in_rows, in_cols, depth]}. + */ + public final Operand images; + + /** + * The size of the sliding window for each dimension of {@code images}. + */ + public final long[] ksizes; + + /** + * How far the centers of two consecutive patches are in + * the images. Must be: {@code [1, stride_rows, stride_cols, 1]}. + */ + public final long[] strides; + + /** + * Must be: {@code [1, rate_rows, rate_cols, 1]}. This is the + * input stride, specifying how far two consecutive patch samples are in the + * input. Equivalent to extracting patches with + * {@code patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)}, followed by + * subsampling them spatially by a factor of {@code rates}. This is equivalent to + * {@code rate} in dilated (a.k.a. Atrous) convolutions. + */ + public final long[] rates; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new ExtractImagePatches<>(op), op, Arrays.asList("ksizes", "strides", "rates", "T", "padding")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + ksizes = op.attributes().getAttrIntList("ksizes"); + strides = op.attributes().getAttrIntList("strides"); + rates = op.attributes().getAttrIntList("rates"); + T = op.attributes().getAttrType("T"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java index 880ee3722cd..4ca887e7e72 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -33,9 +39,11 @@ /** * Extract the shape information of a JPEG-encoded image. * This op only parses the image header, so it is much faster than DecodeJpeg. - * - * @param data type for {@code image_shape} output */ +@OpMetadata( + opType = ExtractJpegShape.OP_NAME, + inputsClass = ExtractJpegShape.Inputs.class +) @Operator( group = "image" ) @@ -47,8 +55,8 @@ public final class ExtractJpegShape extends RawOp implements private Output imageShape; - private ExtractJpegShape(Operation operation) { - super(operation); + public ExtractJpegShape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; imageShape = operation.output(outputIdx++); } @@ -101,4 +109,27 @@ public Output imageShape() { public Output asOutput() { return imageShape; } + + @OpInputsMetadata( + outputsClass = ExtractJpegShape.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The JPEG-encoded image. + */ + public final Operand contents; + + /** + * (Optional) The output type of the operation (int32 or int64). + * Defaults to int32. + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new ExtractJpegShape<>(op), op, Arrays.asList("output_type")); + int inputIndex = 0; + contents = (Operand) op.input(inputIndex++); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java index 0607171e993..9b8b8c1d7dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -43,6 +49,13 @@ * `roi_probabilities`: probability scores of each roi in 'rois', a 2D tensor of shape [Batch,post_nms_topn], padded with 0 if needed, sorted by scores. * */ +@OpMetadata( + opType = GenerateBoundingBoxProposals.OP_NAME, + inputsClass = GenerateBoundingBoxProposals.Inputs.class +) +@Operator( + group = "image" +) public final class GenerateBoundingBoxProposals extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +66,8 @@ public final class GenerateBoundingBoxProposals extends RawOp { private Output roiProbabilities; - private GenerateBoundingBoxProposals(Operation operation) { - super(operation); + public GenerateBoundingBoxProposals(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; rois = operation.output(outputIdx++); roiProbabilities = operation.output(outputIdx++); @@ -150,4 +163,63 @@ public Options postNmsTopn(Long postNmsTopn) { return this; } } + + @OpInputsMetadata( + outputsClass = GenerateBoundingBoxProposals.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 4-D float tensor of shape {@code [num_images, height, width, num_achors]} containing scores of the boxes for given anchors, can be unsorted. + */ + public final Operand scores; + + /** + * A 4-D float tensor of shape {@code [num_images, height, width, 4 x num_anchors]}. encoding boxes with respec to each anchor. + * Coordinates are given in the form [dy, dx, dh, dw]. + */ + public final Operand bboxDeltas; + + /** + * A 2-D float tensor of shape {@code [num_images, 5]} containing image information Height, Width, Scale. + */ + public final Operand imageInfo; + + /** + * A 2-D float tensor of shape {@code [num_anchors, 4]} describing the anchor boxes. Boxes are formatted in the form [y1, x1, y2, x2]. + */ + public final Operand anchors; + + /** + * A scalar float tensor for non-maximal-suppression threshold. + */ + public final Operand nmsThreshold; + + /** + * A scalar int tensor for the number of top scoring boxes to be used as input. + */ + public final Operand preNmsTopn; + + /** + * A scalar float tensor. Any box that has a smaller size than min_size will be discarded. + */ + public final Operand minSize; + + /** + * An integer. Maximum number of rois in the output. + */ + public final long postNmsTopn; + + public Inputs(GraphOperation op) { + super(new GenerateBoundingBoxProposals(op), op, Arrays.asList("post_nms_topn")); + int inputIndex = 0; + scores = (Operand) op.input(inputIndex++); + bboxDeltas = (Operand) op.input(inputIndex++); + imageInfo = (Operand) op.input(inputIndex++); + anchors = (Operand) op.input(inputIndex++); + nmsThreshold = (Operand) op.input(inputIndex++); + preNmsTopn = (Operand) op.input(inputIndex++); + minSize = (Operand) op.input(inputIndex++); + postNmsTopn = op.attributes().getAttrInt("post_nms_topn"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java index 16a7bc54010..abd3d53d884 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * value of the pixels. The output is only well defined if the value in {@code images} * are in {@code [0,1]}. *

    See {@code rgb_to_hsv} for a description of the HSV encoding. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = HsvToRgb.OP_NAME, + inputsClass = HsvToRgb.Inputs.class +) @Operator( group = "image" ) @@ -47,8 +55,8 @@ public final class HsvToRgb extends RawOp implements Operand< private Output output; - private HsvToRgb(Operation operation) { - super(operation); + public HsvToRgb(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,4 +91,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = HsvToRgb.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D or higher rank. HSV data to convert. Last dimension must be size 3. + */ + public final Operand images; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new HsvToRgb<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java index e7e270e7584..cef590ad519 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -35,9 +42,14 @@ * {@code (x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)}, where * {@code k = c0 x + c1 y + 1}. If the transformed point lays outside of the input * image, the output pixel is set to 0. - * - * @param data type for {@code transformed_images} output */ +@OpMetadata( + opType = ImageProjectiveTransformV2.OP_NAME, + inputsClass = ImageProjectiveTransformV2.Inputs.class +) +@Operator( + group = "image" +) public final class ImageProjectiveTransformV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class ImageProjectiveTransformV2 extends RawOp i private Output transformedImages; - private ImageProjectiveTransformV2(Operation operation) { - super(operation); + public ImageProjectiveTransformV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; transformedImages = operation.output(outputIdx++); } @@ -132,4 +144,52 @@ public Options fillMode(String fillMode) { return this; } } + + @OpInputsMetadata( + outputsClass = ImageProjectiveTransformV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * 2-D Tensor, {@code [batch, 8]} or {@code [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. + */ + public final Operand transforms; + + /** + * 1-D Tensor [new_height, new_width]. + */ + public final Operand outputShape; + + /** + * Input dtype. + */ + public final DataType dtype; + + /** + * Interpolation method, "NEAREST" or "BILINEAR". + */ + public final String interpolation; + + /** + * Fill mode, "REFLECT", "WRAP", or "CONSTANT". + */ + public final String fillMode; + + public Inputs(GraphOperation op) { + super(new ImageProjectiveTransformV2<>(op), op, Arrays.asList("dtype", "interpolation", "fill_mode")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + transforms = (Operand) op.input(inputIndex++); + outputShape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + interpolation = op.attributes().getAttrString("interpolation"); + fillMode = op.attributes().getAttrString("fill_mode"); + } + } } 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 index 463275fda01..59f06c2b982 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -35,9 +42,14 @@ * {@code (x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)}, where * {@code 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 transformed_images} output */ +@OpMetadata( + opType = ImageProjectiveTransformV3.OP_NAME, + inputsClass = ImageProjectiveTransformV3.Inputs.class +) +@Operator( + group = "image" +) public final class ImageProjectiveTransformV3 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class ImageProjectiveTransformV3 extends RawOp i private Output transformedImages; - private ImageProjectiveTransformV3(Operation operation) { - super(operation); + public ImageProjectiveTransformV3(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; transformedImages = operation.output(outputIdx++); } @@ -134,4 +146,58 @@ public Options fillMode(String fillMode) { return this; } } + + @OpInputsMetadata( + outputsClass = ImageProjectiveTransformV3.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * 2-D Tensor, {@code [batch, 8]} or {@code [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. + */ + public final Operand transforms; + + /** + * 1-D Tensor [new_height, new_width]. + */ + public final Operand outputShape; + + /** + * float, the value to be filled when fill_mode is constant". + */ + public final Operand fillValue; + + /** + * Input dtype. + */ + public final DataType dtype; + + /** + * Interpolation method, "NEAREST" or "BILINEAR". + */ + public final String interpolation; + + /** + * Fill mode, "REFLECT", "WRAP", "CONSTANT", or "NEAREST". + */ + public final String fillMode; + + public Inputs(GraphOperation op) { + super(new ImageProjectiveTransformV3<>(op), op, Arrays.asList("dtype", "interpolation", "fill_mode")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + transforms = (Operand) op.input(inputIndex++); + outputShape = (Operand) op.input(inputIndex++); + fillValue = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + interpolation = op.attributes().getAttrString("interpolation"); + fillMode = op.attributes().getAttrString("fill_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java index 36ce8f31151..c6be173a44c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -33,6 +39,13 @@ * the list of candidate centers. For each point, the k centers that have least L2 * distance to it are computed. */ +@OpMetadata( + opType = NearestNeighbors.OP_NAME, + inputsClass = NearestNeighbors.Inputs.class +) +@Operator( + group = "image" +) public final class NearestNeighbors extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class NearestNeighbors extends RawOp { private Output nearestCenterDistances; - private NearestNeighbors(Operation operation) { - super(operation); + public NearestNeighbors(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; nearestCenterIndices = operation.output(outputIdx++); nearestCenterDistances = operation.output(outputIdx++); @@ -91,4 +104,33 @@ public Output nearestCenterIndices() { public Output nearestCenterDistances() { return nearestCenterDistances; } + + @OpInputsMetadata( + outputsClass = NearestNeighbors.class + ) + public static class Inputs extends RawOpInputs { + /** + * Matrix of shape (n, d). Rows are assumed to be input points. + */ + public final Operand points; + + /** + * Matrix of shape (m, d). Rows are assumed to be centers. + */ + public final Operand centers; + + /** + * Number of nearest centers to return for each point. If k is larger than m, then + * only m centers are returned. + */ + public final Operand k; + + public Inputs(GraphOperation op) { + super(new NearestNeighbors(op), op, Arrays.asList()); + int inputIndex = 0; + points = (Operand) op.input(inputIndex++); + centers = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java index 907ed3a5055..f682bfd1f5a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -52,9 +58,11 @@ * of other overlapping boxes instead of directly causing them to be pruned. * To enable this Soft-NMS mode, set the {@code soft_nms_sigma} parameter to be * larger than 0. - * - * @param data type for {@code selected_scores} output */ +@OpMetadata( + opType = NonMaxSuppression.OP_NAME, + inputsClass = NonMaxSuppression.Inputs.class +) @Operator( group = "image" ) @@ -70,8 +78,8 @@ public final class NonMaxSuppression extends RawOp { private Output validOutputs; - private NonMaxSuppression(Operation operation) { - super(operation); + public NonMaxSuppression(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; selectedIndices = operation.output(outputIdx++); selectedScores = operation.output(outputIdx++); @@ -185,4 +193,69 @@ public Options padToMaxOutputSize(Boolean padToMaxOutputSize) { return this; } } + + @OpInputsMetadata( + outputsClass = NonMaxSuppression.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 2-D float tensor of shape {@code [num_boxes, 4]}. + */ + public final Operand boxes; + + /** + * A 1-D float tensor of shape {@code [num_boxes]} representing a single + * score corresponding to each box (each row of boxes). + */ + public final Operand scores; + + /** + * A scalar integer tensor representing the maximum number of + * boxes to be selected by non max suppression. + */ + public final Operand maxOutputSize; + + /** + * A 0-D float tensor representing the threshold for deciding whether + * boxes overlap too much with respect to IOU. + */ + public final Operand iouThreshold; + + /** + * A 0-D float tensor representing the threshold for deciding when to remove + * boxes based on score. + */ + public final Operand scoreThreshold; + + /** + * A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et + * al (c.f. https://arxiv.org/abs/1704.04503). When {@code soft_nms_sigma=0.0} (which + * is default), we fall back to standard (hard) NMS. + */ + public final Operand softNmsSigma; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the output {@code selected_indices} is padded to be of length + * {@code max_output_size}. Defaults to false. + */ + public final boolean padToMaxOutputSize; + + public Inputs(GraphOperation op) { + super(new NonMaxSuppression<>(op), op, Arrays.asList("T", "pad_to_max_output_size")); + int inputIndex = 0; + boxes = (Operand) op.input(inputIndex++); + scores = (Operand) op.input(inputIndex++); + maxOutputSize = (Operand) op.input(inputIndex++); + iouThreshold = (Operand) op.input(inputIndex++); + scoreThreshold = (Operand) op.input(inputIndex++); + softNmsSigma = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + padToMaxOutputSize = op.attributes().getAttrBool("pad_to_max_output_size"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java index c5ebfebdb71..3d36256517a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -43,6 +48,10 @@ * overlaps, scores, max_output_size, overlap_threshold, score_threshold) * selected_boxes = tf.gather(boxes, selected_indices) */ +@OpMetadata( + opType = NonMaxSuppressionWithOverlaps.OP_NAME, + inputsClass = NonMaxSuppressionWithOverlaps.Inputs.class +) @Operator( group = "image" ) @@ -54,8 +63,8 @@ public final class NonMaxSuppressionWithOverlaps extends RawOp implements Operan private Output selectedIndices; - private NonMaxSuppressionWithOverlaps(Operation operation) { - super(operation); + public NonMaxSuppressionWithOverlaps(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; selectedIndices = operation.output(outputIdx++); } @@ -105,4 +114,49 @@ public Output selectedIndices() { public Output asOutput() { return selectedIndices; } + + @OpInputsMetadata( + outputsClass = NonMaxSuppressionWithOverlaps.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 2-D float tensor of shape {@code [num_boxes, num_boxes]} representing + * the n-by-n box overlap values. + */ + public final Operand overlaps; + + /** + * A 1-D float tensor of shape {@code [num_boxes]} representing a single + * score corresponding to each box (each row of boxes). + */ + public final Operand scores; + + /** + * A scalar integer tensor representing the maximum number of + * boxes to be selected by non max suppression. + */ + public final Operand maxOutputSize; + + /** + * A 0-D float tensor representing the threshold for deciding whether + * boxes overlap too. + */ + public final Operand overlapThreshold; + + /** + * A 0-D float tensor representing the threshold for deciding when to remove + * boxes based on score. + */ + public final Operand scoreThreshold; + + public Inputs(GraphOperation op) { + super(new NonMaxSuppressionWithOverlaps(op), op, Arrays.asList()); + int inputIndex = 0; + overlaps = (Operand) op.input(inputIndex++); + scores = (Operand) op.input(inputIndex++); + maxOutputSize = (Operand) op.input(inputIndex++); + overlapThreshold = (Operand) op.input(inputIndex++); + scoreThreshold = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java index 79c01f8a7dc..94b4e077416 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -32,9 +38,11 @@ /** * Resize quantized {@code images} to {@code size} using quantized bilinear interpolation. * Input images and output images must be quantized types. - * - * @param data type for {@code resized_images} output */ +@OpMetadata( + opType = QuantizedResizeBilinear.OP_NAME, + inputsClass = QuantizedResizeBilinear.Inputs.class +) @Operator( group = "image" ) @@ -50,8 +58,8 @@ public final class QuantizedResizeBilinear extends RawOp { private Output outMax; - private QuantizedResizeBilinear(Operation operation) { - super(operation); + public QuantizedResizeBilinear(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); outMin = operation.output(outputIdx++); @@ -65,8 +73,8 @@ private QuantizedResizeBilinear(Operation operation) { * @param images 4-D with shape {@code [batch, height, width, channels]}. * @param sizeOutput = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The * new size for the images. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @param data type for {@code QuantizedResizeBilinear} output and operands * @return a new instance of QuantizedResizeBilinear @@ -178,4 +186,58 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedResizeBilinear.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * The min input + */ + public final Operand min; + + /** + * The max input + */ + public final Operand max; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new QuantizedResizeBilinear<>(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java index e791a670099..063b7b8f529 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ *

    This Op picks a random location in {@code image} and crops a {@code height} by {@code width} * rectangle from that location. The random location is picked so the cropped * area will fit inside the original image. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomCrop.OP_NAME, + inputsClass = RandomCrop.Inputs.class +) @Operator( group = "image" ) @@ -49,8 +57,8 @@ public final class RandomCrop extends RawOp implements Operan private Output output; - private RandomCrop(Operation operation) { - super(operation); + public RandomCrop(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -157,4 +165,46 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomCrop.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 3-D of shape {@code [height, width, channels]}. + */ + public final Operand image; + + /** + * 1-D of length 2 containing: {@code crop_height}, {@code crop_width}.. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new RandomCrop<>(op), op, Arrays.asList("T", "seed", "seed2")); + int inputIndex = 0; + image = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java index b83213e6ddf..788c12a50fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -41,6 +47,10 @@ * input pixel's contribution to the average is weighted by the fraction of its * area that intersects the footprint. This is the same as OpenCV's INTER_AREA. */ +@OpMetadata( + opType = ResizeArea.OP_NAME, + inputsClass = ResizeArea.Inputs.class +) @Operator( group = "image" ) @@ -52,8 +62,8 @@ public final class ResizeArea extends RawOp implements Operand { private Output resizedImages; - private ResizeArea(Operation operation) { - super(operation); + public ResizeArea(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); } @@ -133,4 +143,40 @@ public Options alignCorners(Boolean alignCorners) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeArea.class + ) + public static class Inputs extends RawOpInputs { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean alignCorners; + + public Inputs(GraphOperation op) { + super(new ResizeArea(op), op, Arrays.asList("T", "align_corners")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java index 9453984bb64..6e5d26a7761 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -33,6 +39,10 @@ * Resize {@code images} to {@code size} using bicubic interpolation. * Input images can be of different types but output images are always float. */ +@OpMetadata( + opType = ResizeBicubic.OP_NAME, + inputsClass = ResizeBicubic.Inputs.class +) @Operator( group = "image" ) @@ -44,8 +54,8 @@ public final class ResizeBicubic extends RawOp implements Operand { private Output resizedImages; - private ResizeBicubic(Operation operation) { - super(operation); + public ResizeBicubic(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); } @@ -151,4 +161,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeBicubic.class + ) + public static class Inputs extends RawOpInputs { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeBicubic(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java index 77b7a4ff486..c04fe6d13e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of bicubic interpolation. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResizeBicubicGrad.OP_NAME, + inputsClass = ResizeBicubicGrad.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeBicubicGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class ResizeBicubicGrad extends RawOp implements private Output output; - private ResizeBicubicGrad(Operation operation) { - super(operation); + public ResizeBicubicGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -149,4 +161,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeBicubicGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand grads; + + /** + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}, + * The image tensor that was resized. + */ + public final Operand originalImage; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeBicubicGrad<>(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + originalImage = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java index 20cf19314b1..a1813cd7a97 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -33,6 +39,10 @@ * Resize {@code images} to {@code size} using bilinear interpolation. * Input images can be of different types but output images are always float. */ +@OpMetadata( + opType = ResizeBilinear.OP_NAME, + inputsClass = ResizeBilinear.Inputs.class +) @Operator( group = "image" ) @@ -44,8 +54,8 @@ public final class ResizeBilinear extends RawOp implements Operand { private Output resizedImages; - private ResizeBilinear(Operation operation) { - super(operation); + public ResizeBilinear(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); } @@ -151,4 +161,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeBilinear.class + ) + public static class Inputs extends RawOpInputs { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeBilinear(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java index 4e71b41ddcf..166d6b46de6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of bilinear interpolation. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResizeBilinearGrad.OP_NAME, + inputsClass = ResizeBilinearGrad.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeBilinearGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class ResizeBilinearGrad extends RawOp implement private Output output; - private ResizeBilinearGrad(Operation operation) { - super(operation); + public ResizeBilinearGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -149,4 +161,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeBilinearGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand grads; + + /** + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}, + * The image tensor that was resized. + */ + public final Operand originalImage; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeBilinearGrad<>(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + originalImage = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java index 916023700e4..355ac564de1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Resize {@code images} to {@code size} using nearest neighbor interpolation. - * - * @param data type for {@code resized_images} output */ +@OpMetadata( + opType = ResizeNearestNeighbor.OP_NAME, + inputsClass = ResizeNearestNeighbor.Inputs.class +) @Operator( group = "image" ) @@ -44,8 +52,8 @@ public final class ResizeNearestNeighbor extends RawOp implem private Output resizedImages; - private ResizeNearestNeighbor(Operation operation) { - super(operation); + public ResizeNearestNeighbor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); } @@ -152,4 +160,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeNearestNeighbor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand images; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeNearestNeighbor<>(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java index 16ed3716716..36df9e12b2d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of nearest neighbor interpolation. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ResizeNearestNeighborGrad.OP_NAME, + inputsClass = ResizeNearestNeighborGrad.Inputs.class +) +@Operator( + group = "image" +) public final class ResizeNearestNeighborGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class ResizeNearestNeighborGrad extends RawOp im private Output output; - private ResizeNearestNeighborGrad(Operation operation) { - super(operation); + public ResizeNearestNeighborGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -148,4 +160,46 @@ public Options halfPixelCenters(Boolean halfPixelCenters) { return this; } } + + @OpInputsMetadata( + outputsClass = ResizeNearestNeighborGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand grads; + + /** + * = A 1-D int32 Tensor of 2 elements: {@code orig_height, orig_width}. The + * original input size. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + */ + public final boolean alignCorners; + + /** + * The halfPixelCenters attribute + */ + public final boolean halfPixelCenters; + + public Inputs(GraphOperation op) { + super(new ResizeNearestNeighborGrad<>(op), op, Arrays.asList("T", "align_corners", "half_pixel_centers")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + alignCorners = op.attributes().getAttrBool("align_corners"); + halfPixelCenters = op.attributes().getAttrBool("half_pixel_centers"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java index b61b476fa53..be3c84d9b66 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -50,9 +56,11 @@ * * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RgbToHsv.OP_NAME, + inputsClass = RgbToHsv.Inputs.class +) @Operator( group = "image" ) @@ -64,8 +72,8 @@ public final class RgbToHsv extends RawOp implements Operand< private Output output; - private RgbToHsv(Operation operation) { - super(operation); + public RgbToHsv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -100,4 +108,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RgbToHsv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D or higher rank. RGB data to convert. Last dimension must be size 3. + */ + public final Operand images; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RgbToHsv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java index f4cab77b394..a7378278309 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -65,9 +70,11 @@ * {@code use_image_if_no_bounding_boxes = true} will assume there is a single implicit * bounding box covering the whole image. If {@code 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 */ +@OpMetadata( + opType = SampleDistortedBoundingBox.OP_NAME, + inputsClass = SampleDistortedBoundingBox.Inputs.class +) @Operator( group = "image" ) @@ -83,8 +90,8 @@ public final class SampleDistortedBoundingBox extends RawOp { private Output bboxes; - private SampleDistortedBoundingBox(Operation operation) { - super(operation); + public SampleDistortedBoundingBox(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; begin = operation.output(outputIdx++); sizeOutput = operation.output(outputIdx++); @@ -189,7 +196,7 @@ public static Options aspectRatioRange(List aspectRatioRange) { * width / height within this range. * @return this Options instance. */ - public static Options aspectRatioRange(Float[] aspectRatioRange) { + public static Options aspectRatioRange(Float... aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } @@ -211,7 +218,7 @@ public static Options areaRange(List areaRange) { * supplied image within this range. * @return this Options instance. */ - public static Options areaRange(Float[] areaRange) { + public static Options areaRange(Float... areaRange) { return new Options().areaRange(areaRange); } @@ -386,4 +393,86 @@ public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return this; } } + + @OpInputsMetadata( + outputsClass = SampleDistortedBoundingBox.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D, containing {@code [height, width, channels]}. + */ + public final Operand imageSize; + + /** + * 3-D with shape {@code [batch, N, 4]} describing the N bounding boxes + * associated with the image. + */ + public final Operand boundingBoxes; + + /** + * 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. + */ + public final Operand minObjectCovered; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If either {@code seed} or {@code seed2} are set to non-zero, the random number + * generator is seeded by the given {@code seed}. Otherwise, it is seeded by a random + * seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The cropped area of the image must have an aspect ratio = + * width / height within this range. + */ + public final float[] aspectRatioRange; + + /** + * The cropped area of the image must contain a fraction of the + * supplied image within this range. + */ + public final float[] areaRange; + + /** + * Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + */ + public final long maxAttempts; + + /** + * Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + */ + public final boolean useImageIfNoBoundingBoxes; + + public Inputs(GraphOperation op) { + super(new SampleDistortedBoundingBox<>(op), op, Arrays.asList("T", "seed", "seed2", "aspect_ratio_range", "area_range", "max_attempts", "use_image_if_no_bounding_boxes")); + int inputIndex = 0; + imageSize = (Operand) op.input(inputIndex++); + boundingBoxes = (Operand) op.input(inputIndex++); + minObjectCovered = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + aspectRatioRange = op.attributes().getAttrFloatList("aspect_ratio_range"); + areaRange = op.attributes().getAttrFloatList("area_range"); + maxAttempts = op.attributes().getAttrInt("max_attempts"); + useImageIfNoBoundingBoxes = op.attributes().getAttrBool("use_image_if_no_bounding_boxes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java index 6c90fce4b0d..849f70a20f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -32,6 +38,10 @@ /** * The ScaleAndTranslate operation */ +@OpMetadata( + opType = ScaleAndTranslate.OP_NAME, + inputsClass = ScaleAndTranslate.Inputs.class +) @Operator( group = "image" ) @@ -43,8 +53,8 @@ public final class ScaleAndTranslate extends RawOp implements Operand private Output resizedImages; - private ScaleAndTranslate(Operation operation) { - super(operation); + public ScaleAndTranslate(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resizedImages = operation.output(outputIdx++); } @@ -53,10 +63,10 @@ private ScaleAndTranslate(Operation operation) { * Factory method to create a class wrapping a new ScaleAndTranslate operation. * * @param scope current scope - * @param images the images value - * @param sizeOutput the sizeOutput value - * @param scale the scale value - * @param translation the translation value + * @param images The images value + * @param sizeOutput The sizeOutput value + * @param scale The scale value + * @param translation The translation value * @param options carries optional attribute values * @return a new instance of ScaleAndTranslate */ @@ -151,4 +161,56 @@ public Options antialias(Boolean antialias) { return this; } } + + @OpInputsMetadata( + outputsClass = ScaleAndTranslate.class + ) + public static class Inputs extends RawOpInputs { + /** + * The images input + */ + public final Operand images; + + /** + * The sizeOutput input + */ + public final Operand sizeOutput; + + /** + * The scale input + */ + public final Operand scale; + + /** + * The translation input + */ + public final Operand translation; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The kernelType attribute + */ + public final String kernelType; + + /** + * The antialias attribute + */ + public final boolean antialias; + + public Inputs(GraphOperation op) { + super(new ScaleAndTranslate(op), op, Arrays.asList("T", "kernel_type", "antialias")); + int inputIndex = 0; + images = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + scale = (Operand) op.input(inputIndex++); + translation = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + kernelType = op.attributes().getAttrString("kernel_type"); + antialias = op.attributes().getAttrBool("antialias"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java index c9dd12e7d31..1749d046b37 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.image; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The ScaleAndTranslateGrad operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ScaleAndTranslateGrad.OP_NAME, + inputsClass = ScaleAndTranslateGrad.Inputs.class +) +@Operator( + group = "image" +) public final class ScaleAndTranslateGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class ScaleAndTranslateGrad extends RawOp implem private Output output; - private ScaleAndTranslateGrad(Operation operation) { - super(operation); + public ScaleAndTranslateGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -50,10 +62,10 @@ private ScaleAndTranslateGrad(Operation operation) { * Factory method to create a class wrapping a new ScaleAndTranslateGrad operation. * * @param scope current scope - * @param grads the grads value - * @param originalImage the originalImage value - * @param scale the scale value - * @param translation the translation value + * @param grads The grads value + * @param originalImage The originalImage value + * @param scale The scale value + * @param translation The translation value * @param options carries optional attribute values * @param data type for {@code ScaleAndTranslateGrad} output and operands * @return a new instance of ScaleAndTranslateGrad @@ -149,4 +161,56 @@ public Options antialias(Boolean antialias) { return this; } } + + @OpInputsMetadata( + outputsClass = ScaleAndTranslateGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The grads input + */ + public final Operand grads; + + /** + * The originalImage input + */ + public final Operand originalImage; + + /** + * The scale input + */ + public final Operand scale; + + /** + * The translation input + */ + public final Operand translation; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The kernelType attribute + */ + public final String kernelType; + + /** + * The antialias attribute + */ + public final boolean antialias; + + public Inputs(GraphOperation op) { + super(new ScaleAndTranslateGrad<>(op), op, Arrays.asList("T", "kernel_type", "antialias")); + int inputIndex = 0; + grads = (Operand) op.input(inputIndex++); + originalImage = (Operand) op.input(inputIndex++); + scale = (Operand) op.input(inputIndex++); + translation = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + kernelType = op.attributes().getAttrString("kernel_type"); + antialias = op.attributes().getAttrBool("antialias"); + } + } } 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 index 43ced526792..31c4de5388d 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -90,9 +95,11 @@ * {@code use_image_if_no_bounding_boxes = true} will assume there is a single implicit * bounding box covering the whole image. If {@code 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 */ +@OpMetadata( + opType = StatelessSampleDistortedBoundingBox.OP_NAME, + inputsClass = StatelessSampleDistortedBoundingBox.Inputs.class +) @Operator( group = "image" ) @@ -108,8 +115,8 @@ public final class StatelessSampleDistortedBoundingBox extend private Output bboxes; - private StatelessSampleDistortedBoundingBox(Operation operation) { - super(operation); + public StatelessSampleDistortedBoundingBox(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; begin = operation.output(outputIdx++); sizeOutput = operation.output(outputIdx++); @@ -189,7 +196,7 @@ public static Options aspectRatioRange(List aspectRatioRange) { * width / height within this range. * @return this Options instance. */ - public static Options aspectRatioRange(Float[] aspectRatioRange) { + public static Options aspectRatioRange(Float... aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } @@ -211,7 +218,7 @@ public static Options areaRange(List areaRange) { * supplied image within this range. * @return this Options instance. */ - public static Options areaRange(Float[] areaRange) { + public static Options areaRange(Float... areaRange) { return new Options().areaRange(areaRange); } @@ -358,4 +365,85 @@ public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return this; } } + + @OpInputsMetadata( + outputsClass = StatelessSampleDistortedBoundingBox.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D, containing {@code [height, width, channels]}. + */ + public final Operand imageSize; + + /** + * 3-D with shape {@code [batch, N, 4]} describing the N bounding boxes + * associated with the image. + */ + public final Operand boundingBoxes; + + /** + * 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. + */ + public final Operand minObjectCovered; + + /** + * 1-D with shape {@code [2]}. The seed to the random number generator. Must have dtype + * {@code int32} or {@code int64}. (When using XLA, only {@code int32} is allowed.) + */ + public final Operand seed; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + /** + * The cropped area of the image must have an aspect ratio = + * width / height within this range. + */ + public final float[] aspectRatioRange; + + /** + * The cropped area of the image must contain a fraction of the + * supplied image within this range. + */ + public final float[] areaRange; + + /** + * Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + */ + public final long maxAttempts; + + /** + * Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + */ + public final boolean useImageIfNoBoundingBoxes; + + public Inputs(GraphOperation op) { + super(new StatelessSampleDistortedBoundingBox<>(op), op, Arrays.asList("T", "Tseed", "aspect_ratio_range", "area_range", "max_attempts", "use_image_if_no_bounding_boxes")); + int inputIndex = 0; + imageSize = (Operand) op.input(inputIndex++); + boundingBoxes = (Operand) op.input(inputIndex++); + minObjectCovered = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + aspectRatioRange = op.attributes().getAttrFloatList("aspect_ratio_range"); + areaRange = op.attributes().getAttrFloatList("area_range"); + maxAttempts = op.attributes().getAttrInt("max_attempts"); + useImageIfNoBoundingBoxes = op.attributes().getAttrBool("use_image_if_no_bounding_boxes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java index 0b2b977050b..ef2f654a6a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Decode web-safe base64-encoded strings. - * Input may or may not have padding at the end. See EncodeBase64 for padding. - * Web-safe means that input must use - and _ instead of + and /. + * Input may or may not have padding at the end. See + * EncodeBase64 + * for padding. Web-safe means that input must use - and _ instead of + and /. */ +@OpMetadata( + opType = DecodeBase64.OP_NAME, + inputsClass = DecodeBase64.Inputs.class +) @Operator( group = "io" ) @@ -43,8 +53,8 @@ public final class DecodeBase64 extends RawOp implements Operand { private Output output; - private DecodeBase64(Operation operation) { - super(operation); + public DecodeBase64(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -78,4 +88,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = DecodeBase64.class + ) + public static class Inputs extends RawOpInputs { + /** + * Base64 strings to decode. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new DecodeBase64(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java index 94adf046198..90f22cc4226 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -35,6 +40,10 @@ * each element containing the decompressed data from the corresponding * element in {@code bytes}. */ +@OpMetadata( + opType = DecodeCompressed.OP_NAME, + inputsClass = DecodeCompressed.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +55,8 @@ public final class DecodeCompressed extends RawOp implements Operand { private Output output; - private DecodeCompressed(Operation operation) { - super(operation); + public DecodeCompressed(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -123,4 +132,27 @@ public Options compressionType(String compressionType) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeCompressed.class + ) + public static class Inputs extends RawOpInputs { + /** + * A Tensor of string which is compressed. + */ + public final Operand bytes; + + /** + * A scalar containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + */ + public final String compressionType; + + public Inputs(GraphOperation op) { + super(new DecodeCompressed(op), op, Arrays.asList("compression_type")); + int inputIndex = 0; + bytes = (Operand) op.input(inputIndex++); + compressionType = op.attributes().getAttrString("compression_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java index 0076c52f1b5..899877be0c6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -38,6 +43,10 @@ * (https://tools.ietf.org/html/rfc4180) * Note that we allow leading and trailing spaces with int or float field. */ +@OpMetadata( + opType = DecodeCsv.OP_NAME, + inputsClass = DecodeCsv.Inputs.class +) @Operator( group = "io" ) @@ -50,8 +59,8 @@ public final class DecodeCsv extends RawOp implements Iterable> { private List> output; @SuppressWarnings("unchecked") - private DecodeCsv(Operation operation) { - super(operation); + public DecodeCsv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -149,7 +158,7 @@ public static Options selectCols(List selectCols) { * @param selectCols the selectCols option * @return this Options instance. */ - public static Options selectCols(Long[] selectCols) { + public static Options selectCols(Long... selectCols) { return new Options().selectCols(selectCols); } @@ -240,4 +249,63 @@ public Options selectCols(Long... selectCols) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeCsv.class + ) + public static class Inputs extends RawOpInputs { + /** + * Each string is a record/row in the csv and all records should have + * the same format. + */ + public final Operand records; + + /** + * One tensor per column of the input record, with either a + * scalar default value for that column or an empty vector if the column is + * required. + */ + public final Iterable> recordDefaults; + + /** + * The OUTTYPE attribute + */ + public final DataType[] OUTTYPE; + + /** + * char delimiter to separate fields in a record. + */ + public final String fieldDelim; + + /** + * If false, treats double quotation marks as regular + * characters inside of the string fields (ignoring RFC 4180, Section 2, + * Bullet 5). + */ + public final boolean useQuoteDelim; + + /** + * Additional string to recognize as NA/NaN. + */ + public final String naValue; + + /** + * The selectCols attribute + */ + public final long[] selectCols; + + public Inputs(GraphOperation op) { + super(new DecodeCsv(op), op, Arrays.asList("OUT_TYPE", "field_delim", "use_quote_delim", "na_value", "select_cols")); + int inputIndex = 0; + records = (Operand) op.input(inputIndex++); + int recordDefaultsLength = op.inputListLength("record_defaults"); + recordDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, recordDefaultsLength)); + inputIndex += recordDefaultsLength; + OUTTYPE = op.attributes().getAttrTypeList("OUT_TYPE"); + fieldDelim = op.attributes().getAttrString("field_delim"); + useQuoteDelim = op.attributes().getAttrBool("use_quote_delim"); + naValue = op.attributes().getAttrString("na_value"); + selectCols = op.attributes().getAttrIntList("select_cols"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java index 7d56647384c..8142a12f4bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -37,6 +42,10 @@ * {@code Example.SerializeToString()}) suitable for conversion to tensors with * {@code tf.io.parse_example}. */ +@OpMetadata( + opType = DecodeJsonExample.OP_NAME, + inputsClass = DecodeJsonExample.Inputs.class +) @Operator( group = "io" ) @@ -48,8 +57,8 @@ public final class DecodeJsonExample extends RawOp implements Operand { private Output binaryExamples; - private DecodeJsonExample(Operation operation) { - super(operation); + public DecodeJsonExample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; binaryExamples = operation.output(outputIdx++); } @@ -85,4 +94,21 @@ public Output binaryExamples() { public Output asOutput() { return binaryExamples; } + + @OpInputsMetadata( + outputsClass = DecodeJsonExample.class + ) + public static class Inputs extends RawOpInputs { + /** + * Each string is a JSON object serialized according to the JSON + * mapping of the Example proto. + */ + public final Operand jsonExamples; + + public Inputs(GraphOperation op) { + super(new DecodeJsonExample(op), op, Arrays.asList()); + int inputIndex = 0; + jsonExamples = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java index 2bee34b952d..07eac6679d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * Reinterpret the bytes of a string as a vector of numbers. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DecodePaddedRaw.OP_NAME, + inputsClass = DecodePaddedRaw.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +54,8 @@ public final class DecodePaddedRaw extends RawOp implements O private Output output; - private DecodePaddedRaw(Operation operation) { - super(operation); + public DecodePaddedRaw(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private DecodePaddedRaw(Operation operation) { * @param inputBytes Tensor of string to be decoded. * @param fixedLength Length in bytes for each element of the decoded output. Must be a multiple * of the size of the output type. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param options carries optional attribute values * @param data type for {@code DecodePaddedRaw} output and operands * @return a new instance of DecodePaddedRaw @@ -132,4 +140,40 @@ public Options littleEndian(Boolean littleEndian) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodePaddedRaw.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of string to be decoded. + */ + public final Operand inputBytes; + + /** + * Length in bytes for each element of the decoded output. Must be a multiple + * of the size of the output type. + */ + public final Operand fixedLength; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * Whether the input {@code input_bytes} is in little-endian order. Ignored for + * {@code out_type} values that are stored in a single byte, like {@code uint8} + */ + public final boolean littleEndian; + + public Inputs(GraphOperation op) { + super(new DecodePaddedRaw<>(op), op, Arrays.asList("out_type", "little_endian")); + int inputIndex = 0; + inputBytes = (Operand) op.input(inputIndex++); + fixedLength = (Operand) op.input(inputIndex++); + outType = op.attributes().getAttrType("out_type"); + littleEndian = op.attributes().getAttrBool("little_endian"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java index af00d63a45f..217c843796f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Reinterpret the bytes of a string as a vector of numbers. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DecodeRaw.OP_NAME, + inputsClass = DecodeRaw.Inputs.class +) @Operator( group = "io" ) @@ -45,8 +53,8 @@ public final class DecodeRaw extends RawOp implements Operand output; - private DecodeRaw(Operation operation) { - super(operation); + public DecodeRaw(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,7 +64,7 @@ private DecodeRaw(Operation operation) { * * @param scope current scope * @param bytes All the elements must have the same length. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param options carries optional attribute values * @param data type for {@code DecodeRaw} output and operands * @return a new instance of DecodeRaw @@ -129,4 +137,34 @@ public Options littleEndian(Boolean littleEndian) { return this; } } + + @OpInputsMetadata( + outputsClass = DecodeRaw.class + ) + public static class Inputs extends RawOpInputs> { + /** + * All the elements must have the same length. + */ + public final Operand bytes; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * Whether the input {@code bytes} are in little-endian order. + * Ignored for {@code out_type} values that are stored in a single byte like + * {@code uint8}. + */ + public final boolean littleEndian; + + public Inputs(GraphOperation op) { + super(new DecodeRaw<>(op), op, Arrays.asList("out_type", "little_endian")); + int inputIndex = 0; + bytes = (Operand) op.input(inputIndex++); + outType = op.attributes().getAttrType("out_type"); + littleEndian = op.attributes().getAttrBool("little_endian"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java index 93380160f31..9704bd78d15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -71,9 +77,11 @@ * values = [1, 2, 3, 4, 5] * shape = [2 50] * - * - * @param data type for {@code sparse_values} output */ +@OpMetadata( + opType = DeserializeManySparse.OP_NAME, + inputsClass = DeserializeManySparse.Inputs.class +) @Operator( group = "io" ) @@ -89,8 +97,8 @@ public final class DeserializeManySparse extends RawOp { private Output sparseShape; - private DeserializeManySparse(Operation operation) { - super(operation); + public DeserializeManySparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseIndices = operation.output(outputIdx++); sparseValues = operation.output(outputIdx++); @@ -144,4 +152,27 @@ public Output sparseValues() { public Output sparseShape() { return sparseShape; } + + @OpInputsMetadata( + outputsClass = DeserializeManySparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D, The {@code N} serialized {@code SparseTensor} objects. + * Must have 3 columns. + */ + public final Operand serializedSparse; + + /** + * The {@code dtype} of the serialized {@code SparseTensor} objects. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new DeserializeManySparse<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + serializedSparse = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DisableCopyOnRead.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DisableCopyOnRead.java new file mode 100644 index 00000000000..b3117dbe119 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DisableCopyOnRead.java @@ -0,0 +1,86 @@ +/* Copyright 2018-2023 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.io; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; + +/** + * Turns off the copy-on-read mode. + * Turns off the copy-on-read mode of a resource variable. If the variable is not in copy-on-read mode, this op has no effect. + */ +@OpMetadata( + opType = DisableCopyOnRead.OP_NAME, + inputsClass = DisableCopyOnRead.Inputs.class +) +@Operator( + group = "io" +) +public final class DisableCopyOnRead extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DisableCopyOnRead"; + + public DisableCopyOnRead(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new DisableCopyOnRead operation. + * + * @param scope current scope + * @param resource The resource handle of the resource variable. + * @return a new instance of DisableCopyOnRead + */ + @Endpoint( + describeByClass = true + ) + public static DisableCopyOnRead create(Scope scope, Operand resource) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DisableCopyOnRead"); + opBuilder.addInput(resource.asOutput()); + return new DisableCopyOnRead(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = DisableCopyOnRead.class + ) + public static class Inputs extends RawOpInputs { + /** + * The resource handle of the resource variable. + */ + public final Operand resource; + + public Inputs(GraphOperation op) { + super(new DisableCopyOnRead(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java index 6b1d2623b00..ecdbb780a55 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,33 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Encode strings into web-safe base64 format. - * Refer to the following article for more information on base64 format: - * en.wikipedia.org/wiki/Base64. Base64 strings may have padding with '=' at the + * Refer to this article for more information on + * base64 format. Base64 strings may have padding with '=' at the * end so that the encoded has length multiple of 4. See Padding section of the * link above. *

    Web-safe means that the encoder uses - and _ instead of + and /. */ +@OpMetadata( + opType = EncodeBase64.OP_NAME, + inputsClass = EncodeBase64.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +55,8 @@ public final class EncodeBase64 extends RawOp implements Operand { private Output output; - private EncodeBase64(Operation operation) { - super(operation); + public EncodeBase64(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -120,4 +129,26 @@ public Options pad(Boolean pad) { return this; } } + + @OpInputsMetadata( + outputsClass = EncodeBase64.class + ) + public static class Inputs extends RawOpInputs { + /** + * Strings to be encoded. + */ + public final Operand input; + + /** + * Bool whether padding is applied at the ends. + */ + public final boolean pad; + + public Inputs(GraphOperation op) { + super(new EncodeBase64(op), op, Arrays.asList("pad")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pad = op.attributes().getAttrBool("pad"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FakeQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FakeQueue.java new file mode 100644 index 00000000000..9000deaef1a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FakeQueue.java @@ -0,0 +1,105 @@ +/* Copyright 2018-2023 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.io; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * Deprecated. Do not use. + */ +@OpMetadata( + opType = FakeQueue.OP_NAME, + inputsClass = FakeQueue.Inputs.class +) +@Operator( + group = "io" +) +public final class FakeQueue extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FakeQueue"; + + private Output handle; + + public FakeQueue(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FakeQueue operation. + * + * @param scope current scope + * @param resource The resource value + * @return a new instance of FakeQueue + */ + @Endpoint( + describeByClass = true + ) + public static FakeQueue create(Scope scope, Operand resource) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FakeQueue"); + opBuilder.addInput(resource.asOutput()); + return new FakeQueue(opBuilder.build()); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { + return handle; + } + + @Override + public Output asOutput() { + return handle; + } + + @OpInputsMetadata( + outputsClass = FakeQueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The resource input + */ + public final Operand resource; + + public Inputs(GraphOperation op) { + super(new FakeQueue(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java index e024c6e94f8..c4e1d980658 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A queue that produces elements in first-in first-out order. */ +@OpMetadata( + opType = FifoQueue.OP_NAME, + inputsClass = FifoQueue.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +55,8 @@ public final class FifoQueue extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private FifoQueue(Operation operation) { - super(operation); + public FifoQueue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -112,7 +121,7 @@ public static Options shapes(List shapes) { * only one element may be dequeued at a time. * @return this Options instance. */ - public static Options shapes(Shape[] shapes) { + public static Options shapes(Shape... shapes) { return new Options().shapes(shapes); } @@ -243,4 +252,50 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = FifoQueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. If the length of + * this attr is 0, the shapes of queue elements are not constrained, and + * only one element may be dequeued at a time. + */ + public final Shape[] shapes; + + /** + * The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + */ + public final long capacity; + + /** + * If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this queue will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new FifoQueue(op), op, Arrays.asList("component_types", "shapes", "capacity", "container", "shared_name")); + int inputIndex = 0; + componentTypes = op.attributes().getAttrTypeList("component_types"); + shapes = op.attributes().getAttrShapeList("shapes"); + capacity = op.attributes().getAttrInt("capacity"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java index 719f83c45e3..d72a8a98a8d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A Reader that outputs fixed-length records from a file. */ +@OpMetadata( + opType = FixedLengthRecordReader.OP_NAME, + inputsClass = FixedLengthRecordReader.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class FixedLengthRecordReader extends RawOp implements Operand readerHandle; @SuppressWarnings("unchecked") - private FixedLengthRecordReader(Operation operation) { - super(operation); + public FixedLengthRecordReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -255,4 +264,60 @@ public Options encoding(String encoding) { return this; } } + + @OpInputsMetadata( + outputsClass = FixedLengthRecordReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * Number of bytes in the header, defaults to 0. + */ + public final long headerBytes; + + /** + * Number of bytes in the record. + */ + public final long recordBytes; + + /** + * Number of bytes in the footer, defaults to 0. + */ + public final long footerBytes; + + /** + * Number of bytes to hop before each read. Default of 0 means using + * record_bytes. + */ + public final long hopBytes; + + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + /** + * The type of encoding for the file. Currently ZLIB and GZIP + * are supported. Defaults to none. + */ + public final String encoding; + + public Inputs(GraphOperation op) { + super(new FixedLengthRecordReader(op), op, Arrays.asList("header_bytes", "record_bytes", "footer_bytes", "hop_bytes", "container", "shared_name", "encoding")); + int inputIndex = 0; + headerBytes = op.attributes().getAttrInt("header_bytes"); + recordBytes = op.attributes().getAttrInt("record_bytes"); + footerBytes = op.attributes().getAttrInt("footer_bytes"); + hopBytes = op.attributes().getAttrInt("hop_bytes"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + encoding = op.attributes().getAttrString("encoding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java index bc70cf49882..bde3a10bdd0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * To use, enqueue strings in a Queue. ReaderRead will take the front * work string and output (work, work). */ +@OpMetadata( + opType = IdentityReader.OP_NAME, + inputsClass = IdentityReader.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class IdentityReader extends RawOp implements Operand { private Output readerHandle; @SuppressWarnings("unchecked") - private IdentityReader(Operation operation) { - super(operation); + public IdentityReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -147,4 +156,28 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = IdentityReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new IdentityReader(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java index e29f59597ef..580ff7cef20 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * A Reader that outputs the records from a LMDB file. */ +@OpMetadata( + opType = LmdbReader.OP_NAME, + inputsClass = LmdbReader.Inputs.class +) @Operator( group = "io" ) @@ -41,8 +50,8 @@ public final class LmdbReader extends RawOp implements Operand { private Output readerHandle; - private LmdbReader(Operation operation) { - super(operation); + public LmdbReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -143,4 +152,28 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = LmdbReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new LmdbReader(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java index 604aacfb348..4c12a408efa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -33,6 +38,10 @@ * basename portion of the pattern, not in the directory portion. * Note also that the order of filenames returned is deterministic. */ +@OpMetadata( + opType = MatchingFiles.OP_NAME, + inputsClass = MatchingFiles.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class MatchingFiles extends RawOp implements Operand { private Output filenames; - private MatchingFiles(Operation operation) { - super(operation); + public MatchingFiles(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; filenames = operation.output(outputIdx++); } @@ -79,4 +88,20 @@ public Output filenames() { public Output asOutput() { return filenames; } + + @OpInputsMetadata( + outputsClass = MatchingFiles.class + ) + public static class Inputs extends RawOpInputs { + /** + * Shell wildcard pattern(s). Scalar or vector of type string. + */ + public final Operand pattern; + + public Inputs(GraphOperation op) { + super(new MatchingFiles(op), op, Arrays.asList()); + int inputIndex = 0; + pattern = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java index fd89bf18ede..d2628f3195d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +42,10 @@ * to 0 in the shape attr. In this case DequeueMany will pad up to the maximum * size of any given element in the minibatch. See below for details. */ +@OpMetadata( + opType = PaddingFifoQueue.OP_NAME, + inputsClass = PaddingFifoQueue.Inputs.class +) @Operator( group = "io" ) @@ -49,8 +58,8 @@ public final class PaddingFifoQueue extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private PaddingFifoQueue(Operation operation) { - super(operation); + public PaddingFifoQueue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -123,7 +132,7 @@ public static Options shapes(List shapes) { * different ranks and shapes, but only one element may be dequeued at a time. * @return this Options instance. */ - public static Options shapes(Shape[] shapes) { + public static Options shapes(Shape... shapes) { return new Options().shapes(shapes); } @@ -262,4 +271,54 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = PaddingFifoQueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. + * Shapes of fixed rank but variable size are allowed by setting + * any shape dimension to -1. In this case, the inputs' shape may vary along + * the given dimension, and DequeueMany will pad the given dimension with + * zeros up to the maximum shape of all elements in the given batch. + * If the length of this attr is 0, different queue elements may have + * different ranks and shapes, but only one element may be dequeued at a time. + */ + public final Shape[] shapes; + + /** + * The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + */ + public final long capacity; + + /** + * If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this queue will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new PaddingFifoQueue(op), op, Arrays.asList("component_types", "shapes", "capacity", "container", "shared_name")); + int inputIndex = 0; + componentTypes = op.attributes().getAttrTypeList("component_types"); + shapes = op.attributes().getAttrShapeList("shapes"); + capacity = op.attributes().getAttrInt("capacity"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java index 2d4958fffb0..624d698e828 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -37,6 +42,10 @@ /** * Transforms a vector of tf.Example protos (as strings) into typed tensors. */ +@OpMetadata( + opType = ParseExample.OP_NAME, + inputsClass = ParseExample.Inputs.class +) @Operator( group = "io" ) @@ -59,8 +68,8 @@ public final class ParseExample extends RawOp { private List> raggedRowSplits; @SuppressWarnings("unchecked") - private ParseExample(Operation operation) { - super(operation); + public ParseExample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int sparseIndicesLength = operation.outputListLength("sparse_indices"); sparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseIndicesLength)); @@ -218,4 +227,121 @@ public List> raggedValues() { public List> raggedRowSplits() { return raggedRowSplits; } + + @OpInputsMetadata( + outputsClass = ParseExample.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar or vector containing binary serialized Example protos. + */ + public final Operand serialized; + + /** + * A tensor containing the names of the serialized protos. + * Corresponds 1:1 with the {@code serialized} tensor. + * May contain, for example, table key (descriptive) names for the + * corresponding serialized protos. These are purely useful for debugging + * purposes, and the presence of values here has no effect on the output. + * May also be an empty vector if no names are available. + * If non-empty, this tensor must have the same shape as "serialized". + */ + public final Operand names; + + /** + * Vector of strings. + * The keys expected in the Examples' features associated with sparse values. + */ + public final Operand sparseKeys; + + /** + * Vector of strings. + * The keys expected in the Examples' features associated with dense values. + */ + public final Operand denseKeys; + + /** + * Vector of strings. + * The keys expected in the Examples' features associated with ragged values. + */ + public final Operand raggedKeys; + + /** + * A list of Tensors (some may be empty). Corresponds 1:1 with {@code dense_keys}. + * dense_defaults[j] provides default values + * when the example's feature_map lacks dense_key[j]. If an empty Tensor is + * provided for dense_defaults[j], then the Feature dense_keys[j] is required. + * The input type is inferred from dense_defaults[j], even when it's empty. + * If dense_defaults[j] is not empty, and dense_shapes[j] is fully defined, + * then the shape of dense_defaults[j] must match that of dense_shapes[j]. + * If dense_shapes[j] has an undefined major dimension (variable strides dense + * feature), dense_defaults[j] must contain a single element: + * the padding element. + */ + public final Iterable> denseDefaults; + + /** + * The Tdense attribute + */ + public final DataType[] Tdense; + + /** + * A list of {@code num_sparse} types; the data types of data in each Feature + * given in sparse_keys. + * Currently the ParseExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] sparseTypes; + + /** + * A list of {@code num_ragged} types; the data types of data in each Feature + * given in ragged_keys (where {@code num_ragged = sparse_keys.size()}). + * Currently the ParseExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] raggedValueTypes; + + /** + * A list of {@code num_ragged} types; the data types of row_splits in each Feature + * given in ragged_keys (where {@code num_ragged = sparse_keys.size()}). + * May be DT_INT32 or DT_INT64. + */ + public final DataType[] raggedSplitTypes; + + /** + * A list of {@code num_dense} shapes; the shapes of data in each Feature + * given in dense_keys (where {@code num_dense = dense_keys.size()}). + * The number of elements in the Feature corresponding to dense_key[j] + * must always equal dense_shapes[j].NumEntries(). + * If dense_shapes[j] == (D0, D1, ..., DN) then the shape of output + * Tensor dense_values[j] will be (|serialized|, D0, D1, ..., DN): + * The dense outputs are just the inputs row-stacked by batch. + * This works for dense_shapes[j] = (-1, D1, ..., DN). In this case + * the shape of the output Tensor dense_values[j] will be + * (|serialized|, M, D1, .., DN), where M is the maximum number of blocks + * of elements of length D1 * .... * DN, across all minibatch entries + * in the input. Any minibatch entry with less than M blocks of elements of + * length D1 * ... * DN will be padded with the corresponding default_value + * scalar element along the second dimension. + */ + public final Shape[] denseShapes; + + public Inputs(GraphOperation op) { + super(new ParseExample(op), op, Arrays.asList("Tdense", "sparse_types", "ragged_value_types", "ragged_split_types", "dense_shapes")); + int inputIndex = 0; + serialized = (Operand) op.input(inputIndex++); + names = (Operand) op.input(inputIndex++); + sparseKeys = (Operand) op.input(inputIndex++); + denseKeys = (Operand) op.input(inputIndex++); + raggedKeys = (Operand) op.input(inputIndex++); + int denseDefaultsLength = op.inputListLength("dense_defaults"); + denseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, denseDefaultsLength)); + inputIndex += denseDefaultsLength; + Tdense = op.attributes().getAttrTypeList("Tdense"); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + raggedValueTypes = op.attributes().getAttrTypeList("ragged_value_types"); + raggedSplitTypes = op.attributes().getAttrTypeList("ragged_split_types"); + denseShapes = op.attributes().getAttrShapeList("dense_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java index 5482d1ff93a..e5223edfcff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -39,6 +44,10 @@ * Transforms a vector of tf.io.SequenceExample protos (as strings) into * typed tensors. */ +@OpMetadata( + opType = ParseSequenceExample.OP_NAME, + inputsClass = ParseSequenceExample.Inputs.class +) @Operator( group = "io" ) @@ -77,8 +86,8 @@ public final class ParseSequenceExample extends RawOp { private List> featureListRaggedInnerSplits; @SuppressWarnings("unchecked") - private ParseSequenceExample(Operation operation) { - super(operation); + public ParseSequenceExample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); contextSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseIndicesLength)); @@ -161,7 +170,7 @@ private ParseSequenceExample(Operation operation) { * DT_INT64 (Int64List), and DT_STRING (BytesList). * @param contextRaggedValueTypes RaggedTensor.value dtypes for the ragged context features. * @param contextRaggedSplitTypes RaggedTensor.row_split dtypes for the ragged context features. - * @param featureListDenseTypes the value of the featureListDenseTypes property + * @param featureListDenseTypes The value of the featureListDenseTypes attribute * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types * of data in each FeatureList given in feature_list_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), @@ -268,7 +277,7 @@ public static Options contextDenseShapes(List contextDenseShapes) { * The shape of context_dense_values[j] will match context_dense_shapes[j]. * @return this Options instance. */ - public static Options contextDenseShapes(Shape[] contextDenseShapes) { + public static Options contextDenseShapes(Shape... contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } @@ -316,7 +325,7 @@ public static Options featureListDenseShapes(List featureListDenseShapes) * feature_list_dense_shapes[j].NumEntries(). * @return this Options instance. */ - public static Options featureListDenseShapes(Shape[] featureListDenseShapes) { + public static Options featureListDenseShapes(Shape... featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } @@ -556,4 +565,167 @@ public Options featureListDenseShapes(Shape... featureListDenseShapes) { return this; } } + + @OpInputsMetadata( + outputsClass = ParseSequenceExample.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar or vector containing binary serialized SequenceExample protos. + */ + public final Operand serialized; + + /** + * A scalar or vector containing the names of the serialized protos. + * May contain, for example, table key (descriptive) name for the + * corresponding serialized proto. This is purely useful for debugging + * purposes, and the presence of values here has no effect on the output. + * May also be an empty vector if no name is available. + */ + public final Operand debugName; + + /** + * The keys expected in the Examples' features associated with context_sparse + * values. + */ + public final Operand contextSparseKeys; + + /** + * The keys expected in the SequenceExamples' context features associated with + * dense values. + */ + public final Operand contextDenseKeys; + + /** + * The keys expected in the Examples' features associated with context_ragged + * values. + */ + public final Operand contextRaggedKeys; + + /** + * The keys expected in the FeatureLists associated with sparse values. + */ + public final Operand featureListSparseKeys; + + /** + * The keys expected in the SequenceExamples' feature_lists associated + * with lists of dense values. + */ + public final Operand featureListDenseKeys; + + /** + * The keys expected in the FeatureLists associated with ragged values. + */ + public final Operand featureListRaggedKeys; + + /** + * A vector corresponding 1:1 with feature_list_dense_keys, indicating which + * features may be missing from the SequenceExamples. If the associated + * FeatureList is missing, it is treated as empty. + */ + public final Operand featureListDenseMissingAssumedEmpty; + + /** + * A list of Ncontext_dense Tensors (some may be empty). + * context_dense_defaults[j] provides default values + * when the SequenceExample's context map lacks context_dense_key[j]. + * If an empty Tensor is provided for context_dense_defaults[j], + * then the Feature context_dense_keys[j] is required. + * The input type is inferred from context_dense_defaults[j], even when it's + * empty. If context_dense_defaults[j] is not empty, its shape must match + * context_dense_shapes[j]. + */ + public final Iterable> contextDenseDefaults; + + /** + * The TcontextDense attribute + */ + public final DataType[] TcontextDense; + + /** + * A list of Ncontext_sparse types; the data types of data in + * each context Feature given in context_sparse_keys. + * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] contextSparseTypes; + + /** + * RaggedTensor.value dtypes for the ragged context features. + */ + public final DataType[] contextRaggedValueTypes; + + /** + * RaggedTensor.row_split dtypes for the ragged context features. + */ + public final DataType[] contextRaggedSplitTypes; + + /** + * A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + */ + public final Shape[] contextDenseShapes; + + /** + * The featureListDenseTypes attribute + */ + public final DataType[] featureListDenseTypes; + + /** + * A list of Nfeature_list_sparse types; the data types + * of data in each FeatureList given in feature_list_sparse_keys. + * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] featureListSparseTypes; + + /** + * RaggedTensor.value dtypes for the ragged FeatureList features. + */ + public final DataType[] featureListRaggedValueTypes; + + /** + * RaggedTensor.row_split dtypes for the ragged FeatureList features. + */ + public final DataType[] featureListRaggedSplitTypes; + + /** + * A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + */ + public final Shape[] featureListDenseShapes; + + public Inputs(GraphOperation op) { + super(new ParseSequenceExample(op), op, Arrays.asList("Tcontext_dense", "context_sparse_types", "context_ragged_value_types", "context_ragged_split_types", "context_dense_shapes", "feature_list_dense_types", "feature_list_sparse_types", "feature_list_ragged_value_types", "feature_list_ragged_split_types", "feature_list_dense_shapes")); + int inputIndex = 0; + serialized = (Operand) op.input(inputIndex++); + debugName = (Operand) op.input(inputIndex++); + contextSparseKeys = (Operand) op.input(inputIndex++); + contextDenseKeys = (Operand) op.input(inputIndex++); + contextRaggedKeys = (Operand) op.input(inputIndex++); + featureListSparseKeys = (Operand) op.input(inputIndex++); + featureListDenseKeys = (Operand) op.input(inputIndex++); + featureListRaggedKeys = (Operand) op.input(inputIndex++); + featureListDenseMissingAssumedEmpty = (Operand) op.input(inputIndex++); + int contextDenseDefaultsLength = op.inputListLength("context_dense_defaults"); + contextDenseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, contextDenseDefaultsLength)); + inputIndex += contextDenseDefaultsLength; + TcontextDense = op.attributes().getAttrTypeList("Tcontext_dense"); + contextSparseTypes = op.attributes().getAttrTypeList("context_sparse_types"); + contextRaggedValueTypes = op.attributes().getAttrTypeList("context_ragged_value_types"); + contextRaggedSplitTypes = op.attributes().getAttrTypeList("context_ragged_split_types"); + contextDenseShapes = op.attributes().getAttrShapeList("context_dense_shapes"); + featureListDenseTypes = op.attributes().getAttrTypeList("feature_list_dense_types"); + featureListSparseTypes = op.attributes().getAttrTypeList("feature_list_sparse_types"); + featureListRaggedValueTypes = op.attributes().getAttrTypeList("feature_list_ragged_value_types"); + featureListRaggedSplitTypes = op.attributes().getAttrTypeList("feature_list_ragged_split_types"); + featureListDenseShapes = op.attributes().getAttrShapeList("feature_list_dense_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java index 8db82e49e41..ace0959c7ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -36,6 +41,10 @@ /** * Transforms a tf.Example proto (as a string) into typed tensors. */ +@OpMetadata( + opType = ParseSingleExample.OP_NAME, + inputsClass = ParseSingleExample.Inputs.class +) @Operator( group = "io" ) @@ -54,8 +63,8 @@ public final class ParseSingleExample extends RawOp { private List> denseValues; @SuppressWarnings("unchecked") - private ParseSingleExample(Operation operation) { - super(operation); + public ParseSingleExample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int sparseIndicesLength = operation.outputListLength("sparse_indices"); sparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseIndicesLength)); @@ -171,4 +180,83 @@ public List> sparseShapes() { public List> denseValues() { return denseValues; } + + @OpInputsMetadata( + outputsClass = ParseSingleExample.class + ) + public static class Inputs extends RawOpInputs { + /** + * A vector containing a batch of binary serialized Example protos. + */ + public final Operand serialized; + + /** + * A list of Tensors (some may be empty), whose length matches + * the length of {@code dense_keys}. dense_defaults[j] provides default values + * when the example's feature_map lacks dense_key[j]. If an empty Tensor is + * provided for dense_defaults[j], then the Feature dense_keys[j] is required. + * The input type is inferred from dense_defaults[j], even when it's empty. + * If dense_defaults[j] is not empty, and dense_shapes[j] is fully defined, + * then the shape of dense_defaults[j] must match that of dense_shapes[j]. + * If dense_shapes[j] has an undefined major dimension (variable strides dense + * feature), dense_defaults[j] must contain a single element: + * the padding element. + */ + public final Iterable> denseDefaults; + + /** + * A list of {@code num_sparse} strings. + * The keys expected in the Examples' features associated with sparse values. + */ + public final String[] sparseKeys; + + /** + * The keys expected in the Examples' features associated with dense + * values. + */ + public final String[] denseKeys; + + /** + * A list of {@code num_sparse} types; the data types of data in each + * Feature given in sparse_keys. + * Currently the ParseSingleExample op supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] sparseTypes; + + /** + * The data types of data in each Feature given in dense_keys. + * The length of this list must match the length of {@code dense_keys}. + * Currently the ParseSingleExample op supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] Tdense; + + /** + * The shapes of data in each Feature given in dense_keys. + * The length of this list must match the length of {@code dense_keys}. The + * number of elements in the Feature corresponding to dense_key[j] must + * always equal dense_shapes[j].NumEntries(). If dense_shapes[j] == + * (D0, D1, ..., DN) then the shape of output Tensor dense_values[j] + * will be (D0, D1, ..., DN): In the case dense_shapes[j] = (-1, D1, + * ..., DN), the shape of the output Tensor dense_values[j] will be (M, + * D1, .., DN), where M is the number of blocks of elements of length + * D1 * .... * DN, in the input. + */ + public final Shape[] denseShapes; + + public Inputs(GraphOperation op) { + super(new ParseSingleExample(op), op, Arrays.asList("sparse_keys", "dense_keys", "sparse_types", "Tdense", "dense_shapes")); + int inputIndex = 0; + serialized = (Operand) op.input(inputIndex++); + int denseDefaultsLength = op.inputListLength("dense_defaults"); + denseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, denseDefaultsLength)); + inputIndex += denseDefaultsLength; + sparseKeys = op.attributes().getAttrStringList("sparse_keys"); + denseKeys = op.attributes().getAttrStringList("dense_keys"); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + Tdense = op.attributes().getAttrTypeList("Tdense"); + denseShapes = op.attributes().getAttrShapeList("dense_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java index f7517cfe3a1..06c354fb182 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -36,6 +41,10 @@ /** * Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. */ +@OpMetadata( + opType = ParseSingleSequenceExample.OP_NAME, + inputsClass = ParseSingleSequenceExample.Inputs.class +) @Operator( group = "io" ) @@ -62,8 +71,8 @@ public final class ParseSingleSequenceExample extends RawOp { private List> featureListDenseValues; @SuppressWarnings("unchecked") - private ParseSingleSequenceExample(Operation operation) { - super(operation); + public ParseSingleSequenceExample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); contextSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseIndicesLength)); @@ -129,7 +138,7 @@ private ParseSingleSequenceExample(Operation operation) { * each context Feature given in context_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), * DT_INT64 (Int64List), and DT_STRING (BytesList). - * @param featureListDenseTypes the value of the featureListDenseTypes property + * @param featureListDenseTypes The value of the featureListDenseTypes attribute * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types * of data in each FeatureList given in feature_list_sparse_keys. * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), @@ -257,7 +266,7 @@ public static Options contextDenseShapes(List contextDenseShapes) { * The shape of context_dense_values[j] will match context_dense_shapes[j]. * @return this Options instance. */ - public static Options contextDenseShapes(Shape[] contextDenseShapes) { + public static Options contextDenseShapes(Shape... contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } @@ -285,7 +294,7 @@ public static Options featureListDenseShapes(List featureListDenseShapes) * feature_list_dense_shapes[j].NumEntries(). * @return this Options instance. */ - public static Options featureListDenseShapes(Shape[] featureListDenseShapes) { + public static Options featureListDenseShapes(Shape... featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } @@ -484,4 +493,144 @@ public Options featureListDenseShapes(Shape... featureListDenseShapes) { return this; } } + + @OpInputsMetadata( + outputsClass = ParseSingleSequenceExample.class + ) + public static class Inputs extends RawOpInputs { + /** + * A scalar containing a binary serialized SequenceExample proto. + */ + public final Operand serialized; + + /** + * A vector listing the + * FeatureList keys which may be missing from the SequenceExample. If the + * associated FeatureList is missing, it is treated as empty. By default, + * any FeatureList not listed in this vector must exist in the SequenceExample. + */ + public final Operand featureListDenseMissingAssumedEmpty; + + /** + * A list of Ncontext_sparse string Tensors (scalars). + * The keys expected in the Examples' features associated with context_sparse + * values. + */ + public final Iterable> contextSparseKeys; + + /** + * A list of Ncontext_dense string Tensors (scalars). + * The keys expected in the SequenceExamples' context features associated with + * dense values. + */ + public final Iterable> contextDenseKeys; + + /** + * A list of Nfeature_list_sparse string Tensors + * (scalars). The keys expected in the FeatureLists associated with sparse + * values. + */ + public final Iterable> featureListSparseKeys; + + /** + * A list of Nfeature_list_dense string Tensors (scalars). + * The keys expected in the SequenceExamples' feature_lists associated + * with lists of dense values. + */ + public final Iterable> featureListDenseKeys; + + /** + * A list of Ncontext_dense Tensors (some may be empty). + * context_dense_defaults[j] provides default values + * when the SequenceExample's context map lacks context_dense_key[j]. + * If an empty Tensor is provided for context_dense_defaults[j], + * then the Feature context_dense_keys[j] is required. + * The input type is inferred from context_dense_defaults[j], even when it's + * empty. If context_dense_defaults[j] is not empty, its shape must match + * context_dense_shapes[j]. + */ + public final Iterable> contextDenseDefaults; + + /** + * A scalar containing the name of the serialized proto. + * May contain, for example, table key (descriptive) name for the + * corresponding serialized proto. This is purely useful for debugging + * purposes, and the presence of values here has no effect on the output. + * May also be an empty scalar if no name is available. + */ + public final Operand debugName; + + /** + * A list of Ncontext_sparse types; the data types of data in + * each context Feature given in context_sparse_keys. + * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] contextSparseTypes; + + /** + * The TcontextDense attribute + */ + public final DataType[] TcontextDense; + + /** + * The featureListDenseTypes attribute + */ + public final DataType[] featureListDenseTypes; + + /** + * A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + */ + public final Shape[] contextDenseShapes; + + /** + * A list of Nfeature_list_sparse types; the data types + * of data in each FeatureList given in feature_list_sparse_keys. + * Currently the ParseSingleSequenceExample supports DT_FLOAT (FloatList), + * DT_INT64 (Int64List), and DT_STRING (BytesList). + */ + public final DataType[] featureListSparseTypes; + + /** + * A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + */ + public final Shape[] featureListDenseShapes; + + public Inputs(GraphOperation op) { + super(new ParseSingleSequenceExample(op), op, Arrays.asList("context_sparse_types", "Tcontext_dense", "feature_list_dense_types", "context_dense_shapes", "feature_list_sparse_types", "feature_list_dense_shapes")); + int inputIndex = 0; + serialized = (Operand) op.input(inputIndex++); + featureListDenseMissingAssumedEmpty = (Operand) op.input(inputIndex++); + int contextSparseKeysLength = op.inputListLength("context_sparse_keys"); + contextSparseKeys = Arrays.asList((Operand[]) op.inputList(inputIndex, contextSparseKeysLength)); + inputIndex += contextSparseKeysLength; + int contextDenseKeysLength = op.inputListLength("context_dense_keys"); + contextDenseKeys = Arrays.asList((Operand[]) op.inputList(inputIndex, contextDenseKeysLength)); + inputIndex += contextDenseKeysLength; + int featureListSparseKeysLength = op.inputListLength("feature_list_sparse_keys"); + featureListSparseKeys = Arrays.asList((Operand[]) op.inputList(inputIndex, featureListSparseKeysLength)); + inputIndex += featureListSparseKeysLength; + int featureListDenseKeysLength = op.inputListLength("feature_list_dense_keys"); + featureListDenseKeys = Arrays.asList((Operand[]) op.inputList(inputIndex, featureListDenseKeysLength)); + inputIndex += featureListDenseKeysLength; + int contextDenseDefaultsLength = op.inputListLength("context_dense_defaults"); + contextDenseDefaults = Arrays.asList((Operand[]) op.inputList(inputIndex, contextDenseDefaultsLength)); + inputIndex += contextDenseDefaultsLength; + debugName = (Operand) op.input(inputIndex++); + contextSparseTypes = op.attributes().getAttrTypeList("context_sparse_types"); + TcontextDense = op.attributes().getAttrTypeList("Tcontext_dense"); + featureListDenseTypes = op.attributes().getAttrTypeList("feature_list_dense_types"); + contextDenseShapes = op.attributes().getAttrShapeList("context_dense_shapes"); + featureListSparseTypes = op.attributes().getAttrTypeList("feature_list_sparse_types"); + featureListDenseShapes = op.attributes().getAttrShapeList("feature_list_dense_shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java index 3a49a3ba191..039ff1546f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Transforms a serialized tensorflow.TensorProto proto into a Tensor. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ParseTensor.OP_NAME, + inputsClass = ParseTensor.Inputs.class +) @Operator( group = "io" ) @@ -45,8 +53,8 @@ public final class ParseTensor extends RawOp implements Operand private Output output; - private ParseTensor(Operation operation) { - super(operation); + public ParseTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,27 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ParseTensor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A scalar string containing a serialized TensorProto proto. + */ + public final Operand serialized; + + /** + * The type of the serialized tensor. The provided type must match the + * type of the serialized tensor and no implicit conversion will take place. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new ParseTensor<>(op), op, Arrays.asList("out_type")); + int inputIndex = 0; + serialized = (Operand) op.input(inputIndex++); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java index 893f41c9b33..08e1b147a84 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,7 +17,9 @@ package org.tensorflow.op.io; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -25,9 +27,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -38,6 +44,10 @@ * and DequeueMany) on a PriorityQueue will all require (resp. output) one extra * entry in their input (resp. output) lists. */ +@OpMetadata( + opType = PriorityQueue.OP_NAME, + inputsClass = PriorityQueue.Inputs.class +) @Operator( group = "io" ) @@ -50,8 +60,8 @@ public final class PriorityQueue extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private PriorityQueue(Operation operation) { - super(operation); + public PriorityQueue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -193,4 +203,50 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = PriorityQueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. If the length of + * this attr is 0, the shapes of queue elements are not constrained, and + * only one element may be dequeued at a time. + */ + public final Shape[] shapes; + + /** + * The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + */ + public final long capacity; + + /** + * If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this queue will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new PriorityQueue(op), op, Arrays.asList("component_types", "shapes", "capacity", "container", "shared_name")); + int inputIndex = 0; + componentTypes = op.attributes().getAttrTypeList("component_types"); + shapes = op.attributes().getAttrShapeList("shapes"); + capacity = op.attributes().getAttrInt("capacity"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java index a982ee68ff5..0f591896e1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -34,6 +39,10 @@ * sufficient elements remain in the queue. Subsequent Dequeue(Many) * operations that would block will fail immediately. */ +@OpMetadata( + opType = QueueClose.OP_NAME, + inputsClass = QueueClose.Inputs.class +) @Operator( group = "io" ) @@ -43,8 +52,8 @@ public final class QueueClose extends RawOp { */ public static final String OP_NAME = "QueueCloseV2"; - private QueueClose(Operation operation) { - super(operation); + public QueueClose(Operation operation) { + super(operation, OP_NAME); } /** @@ -104,4 +113,27 @@ public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueClose.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * If true, all pending enqueue requests that are + * blocked on the given queue will be canceled. + */ + public final boolean cancelPendingEnqueues; + + public Inputs(GraphOperation op) { + super(new QueueClose(op), op, Arrays.asList("cancel_pending_enqueues")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + cancelPendingEnqueues = op.attributes().getAttrBool("cancel_pending_enqueues"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java index 2f6692c5d92..3b770d54c8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,6 +44,10 @@ *

    N.B. If the queue is empty, this operation will block until an element * has been dequeued (or 'timeout_ms' elapses, if specified). */ +@OpMetadata( + opType = QueueDequeue.OP_NAME, + inputsClass = QueueDequeue.Inputs.class +) @Operator( group = "io" ) @@ -51,8 +60,8 @@ public final class QueueDequeue extends RawOp implements Iterable private List> components; @SuppressWarnings("unchecked") - private QueueDequeue(Operation operation) { - super(operation); + public QueueDequeue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -135,4 +144,34 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueDequeue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * The type of each component in a tuple. + */ + public final DataType[] componentTypes; + + /** + * If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new QueueDequeue(op), op, Arrays.asList("component_types", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + componentTypes = op.attributes().getAttrTypeList("component_types"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java index b7128d86bc0..ad7af3269a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -45,6 +50,10 @@ *

    N.B. If the queue is empty, this operation will block until {@code n} elements * have been dequeued (or 'timeout_ms' elapses, if specified). */ +@OpMetadata( + opType = QueueDequeueMany.OP_NAME, + inputsClass = QueueDequeueMany.Inputs.class +) @Operator( group = "io" ) @@ -57,8 +66,8 @@ public final class QueueDequeueMany extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private QueueDequeueMany(Operation operation) { - super(operation); + public QueueDequeueMany(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -143,4 +152,40 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueDequeueMany.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * The number of tuples to dequeue. + */ + public final Operand n; + + /** + * The type of each component in a tuple. + */ + public final DataType[] componentTypes; + + /** + * If the queue has fewer than n elements, this operation + * will block for up to timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new QueueDequeueMany(op), op, Arrays.asList("component_types", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + n = (Operand) op.input(inputIndex++); + componentTypes = op.attributes().getAttrTypeList("component_types"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java index 10ab3ed3307..91ee202e624 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -49,6 +54,10 @@ * the tuples stored in the given queue, and output {@code i} is the ith * component of the dequeued tuple. */ +@OpMetadata( + opType = QueueDequeueUpTo.OP_NAME, + inputsClass = QueueDequeueUpTo.Inputs.class +) @Operator( group = "io" ) @@ -61,8 +70,8 @@ public final class QueueDequeueUpTo extends RawOp implements Iterable> components; @SuppressWarnings("unchecked") - private QueueDequeueUpTo(Operation operation) { - super(operation); + public QueueDequeueUpTo(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int componentsLength = operation.outputListLength("components"); components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); @@ -147,4 +156,40 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueDequeueUpTo.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * The number of tuples to dequeue. + */ + public final Operand n; + + /** + * The type of each component in a tuple. + */ + public final DataType[] componentTypes; + + /** + * If the queue has fewer than n elements, this operation + * will block for up to timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new QueueDequeueUpTo(op), op, Arrays.asList("component_types", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + n = (Operand) op.input(inputIndex++); + componentTypes = op.attributes().getAttrTypeList("component_types"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java index d4df07bb301..251361ed720 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ *

    N.B. If the queue is full, this operation will block until the given * element has been enqueued (or 'timeout_ms' elapses, if specified). */ +@OpMetadata( + opType = QueueEnqueue.OP_NAME, + inputsClass = QueueEnqueue.Inputs.class +) @Operator( group = "io" ) @@ -43,8 +53,8 @@ public final class QueueEnqueue extends RawOp { */ public static final String OP_NAME = "QueueEnqueueV2"; - private QueueEnqueue(Operation operation) { - super(operation); + public QueueEnqueue(Operation operation) { + super(operation, OP_NAME); } /** @@ -108,4 +118,42 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueEnqueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * One or more tensors from which the enqueued tensors should be taken. + */ + public final Iterable> components; + + /** + * The Tcomponents attribute + */ + public final DataType[] Tcomponents; + + /** + * If the queue is full, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new QueueEnqueue(op), op, Arrays.asList("Tcomponents", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + Tcomponents = op.attributes().getAttrTypeList("Tcomponents"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueueMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueueMany.java index 04b14587a04..eb5fb20cc78 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueueMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueueMany.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +43,10 @@ *

    N.B. If the queue is full, this operation will block until the given * elements have been enqueued (or 'timeout_ms' elapses, if specified). */ +@OpMetadata( + opType = QueueEnqueueMany.OP_NAME, + inputsClass = QueueEnqueueMany.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +56,8 @@ public final class QueueEnqueueMany extends RawOp { */ public static final String OP_NAME = "QueueEnqueueManyV2"; - private QueueEnqueueMany(Operation operation) { - super(operation); + public QueueEnqueueMany(Operation operation) { + super(operation, OP_NAME); } /** @@ -112,4 +122,43 @@ public Options timeoutMs(Long timeoutMs) { return this; } } + + @OpInputsMetadata( + outputsClass = QueueEnqueueMany.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + /** + * One or more tensors from which the enqueued tensors should + * be taken. + */ + public final Iterable> components; + + /** + * The Tcomponents attribute + */ + public final DataType[] Tcomponents; + + /** + * If the queue is too full, this operation will block for up + * to timeout_ms milliseconds. + * Note: This option is not supported yet. + */ + public final long timeoutMs; + + public Inputs(GraphOperation op) { + super(new QueueEnqueueMany(op), op, Arrays.asList("Tcomponents", "timeout_ms")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + int componentsLength = op.inputListLength("components"); + components = Arrays.asList((Operand[]) op.inputList(inputIndex, componentsLength)); + inputIndex += componentsLength; + Tcomponents = op.attributes().getAttrTypeList("Tcomponents"); + timeoutMs = op.attributes().getAttrInt("timeout_ms"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java index edb895517b6..1116fd11d24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * This operation returns true if the queue is closed and false if the queue * is open. */ +@OpMetadata( + opType = QueueIsClosed.OP_NAME, + inputsClass = QueueIsClosed.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class QueueIsClosed extends RawOp implements Operand { private Output isClosed; - private QueueIsClosed(Operation operation) { - super(operation); + public QueueIsClosed(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; isClosed = operation.output(outputIdx++); } @@ -79,4 +88,20 @@ public Output isClosed() { public Output asOutput() { return isClosed; } + + @OpInputsMetadata( + outputsClass = QueueIsClosed.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new QueueIsClosed(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java index d585e6bfc69..58ed7db8c24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Computes the number of elements in the given queue. */ +@OpMetadata( + opType = QueueSize.OP_NAME, + inputsClass = QueueSize.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class QueueSize extends RawOp implements Operand { private Output output; - private QueueSize(Operation operation) { - super(operation); + public QueueSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -77,4 +86,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = QueueSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a queue. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new QueueSize(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java index 9058ef08c5c..565c0c09606 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,14 +27,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A queue that randomizes the order of elements. */ +@OpMetadata( + opType = RandomShuffleQueue.OP_NAME, + inputsClass = RandomShuffleQueue.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +55,8 @@ public final class RandomShuffleQueue extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private RandomShuffleQueue(Operation operation) { - super(operation); + public RandomShuffleQueue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -121,7 +130,7 @@ public static Options shapes(List shapes) { * only one element may be dequeued at a time. * @return this Options instance. */ - public static Options shapes(Shape[] shapes) { + public static Options shapes(Shape... shapes) { return new Options().shapes(shapes); } @@ -327,4 +336,71 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomShuffleQueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of each component in a value. + */ + public final DataType[] componentTypes; + + /** + * The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. If the length of + * this attr is 0, the shapes of queue elements are not constrained, and + * only one element may be dequeued at a time. + */ + public final Shape[] shapes; + + /** + * The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + */ + public final long capacity; + + /** + * Dequeue will block unless there would be this + * many elements after the dequeue or the queue is closed. This + * ensures a minimum level of mixing of elements. + */ + public final long minAfterDequeue; + + /** + * If either seed or seed2 is set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, a random seed is used. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this queue will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new RandomShuffleQueue(op), op, Arrays.asList("component_types", "shapes", "capacity", "min_after_dequeue", "seed", "seed2", "container", "shared_name")); + int inputIndex = 0; + componentTypes = op.attributes().getAttrTypeList("component_types"); + shapes = op.attributes().getAttrShapeList("shapes"); + capacity = op.attributes().getAttrInt("capacity"); + minAfterDequeue = op.attributes().getAttrInt("min_after_dequeue"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java index 898d1e577e9..ad3cafef32c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Reads and outputs the entire contents of the input filename. */ +@OpMetadata( + opType = ReadFile.OP_NAME, + inputsClass = ReadFile.Inputs.class +) @Operator( group = "io" ) @@ -41,8 +50,8 @@ public final class ReadFile extends RawOp implements Operand { private Output contents; - private ReadFile(Operation operation) { - super(operation); + public ReadFile(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; contents = operation.output(outputIdx++); } @@ -51,7 +60,7 @@ private ReadFile(Operation operation) { * Factory method to create a class wrapping a new ReadFile operation. * * @param scope current scope - * @param filename the filename value + * @param filename The filename value * @return a new instance of ReadFile */ @Endpoint( @@ -76,4 +85,20 @@ public Output contents() { public Output asOutput() { return contents; } + + @OpInputsMetadata( + outputsClass = ReadFile.class + ) + public static class Inputs extends RawOpInputs { + /** + * The filename input + */ + public final Operand filename; + + public Inputs(GraphOperation op) { + super(new ReadFile(op), op, Arrays.asList()); + int inputIndex = 0; + filename = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java index 6d49f6b8947..ca44f692588 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * This is the same as the number of ReaderRead executions that have * succeeded. */ +@OpMetadata( + opType = ReaderNumRecordsProduced.OP_NAME, + inputsClass = ReaderNumRecordsProduced.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class ReaderNumRecordsProduced extends RawOp implements Operand recordsProduced; - private ReaderNumRecordsProduced(Operation operation) { - super(operation); + public ReaderNumRecordsProduced(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; recordsProduced = operation.output(outputIdx++); } @@ -80,4 +89,20 @@ public Output recordsProduced() { public Output asOutput() { return recordsProduced; } + + @OpInputsMetadata( + outputsClass = ReaderNumRecordsProduced.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + public Inputs(GraphOperation op) { + super(new ReaderNumRecordsProduced(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java index 01b3d0fec55..1aaff9f8e3e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -31,6 +36,10 @@ /** * Returns the number of work units this Reader has finished processing. */ +@OpMetadata( + opType = ReaderNumWorkUnitsCompleted.OP_NAME, + inputsClass = ReaderNumWorkUnitsCompleted.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class ReaderNumWorkUnitsCompleted extends RawOp implements Operand< private Output unitsCompleted; - private ReaderNumWorkUnitsCompleted(Operation operation) { - super(operation); + public ReaderNumWorkUnitsCompleted(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; unitsCompleted = operation.output(outputIdx++); } @@ -78,4 +87,20 @@ public Output unitsCompleted() { public Output asOutput() { return unitsCompleted; } + + @OpInputsMetadata( + outputsClass = ReaderNumWorkUnitsCompleted.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + public Inputs(GraphOperation op) { + super(new ReaderNumWorkUnitsCompleted(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java index 6e47e762d54..5456030358a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -34,6 +39,10 @@ * Reader needs to start reading from a new file since it has finished * with the previous file). */ +@OpMetadata( + opType = ReaderRead.OP_NAME, + inputsClass = ReaderRead.Inputs.class +) @Operator( group = "io" ) @@ -47,8 +56,8 @@ public final class ReaderRead extends RawOp { private Output value; - private ReaderRead(Operation operation) { - super(operation); + public ReaderRead(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; key = operation.output(outputIdx++); value = operation.output(outputIdx++); @@ -90,4 +99,26 @@ public Output key() { public Output value() { return value; } + + @OpInputsMetadata( + outputsClass = ReaderRead.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + /** + * Handle to a Queue, with string work items. + */ + public final Operand queueHandle; + + public Inputs(GraphOperation op) { + super(new ReaderRead(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + queueHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java index 87094364f9f..e1776234efb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -36,6 +41,10 @@ * with the previous file). * It may return less than {@code num_records} even before the last batch. */ +@OpMetadata( + opType = ReaderReadUpTo.OP_NAME, + inputsClass = ReaderReadUpTo.Inputs.class +) @Operator( group = "io" ) @@ -49,8 +58,8 @@ public final class ReaderReadUpTo extends RawOp { private Output values; - private ReaderReadUpTo(Operation operation) { - super(operation); + public ReaderReadUpTo(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; keys = operation.output(outputIdx++); values = operation.output(outputIdx++); @@ -94,4 +103,32 @@ public Output keys() { public Output values() { return values; } + + @OpInputsMetadata( + outputsClass = ReaderReadUpTo.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a {@code Reader}. + */ + public final Operand readerHandle; + + /** + * Handle to a {@code Queue}, with string work items. + */ + public final Operand queueHandle; + + /** + * number of records to read from {@code Reader}. + */ + public final Operand numRecords; + + public Inputs(GraphOperation op) { + super(new ReaderReadUpTo(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + queueHandle = (Operand) op.input(inputIndex++); + numRecords = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java index 697f0bf388b..f0cbb706adb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,27 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Restore a Reader to its initial clean state. */ +@OpMetadata( + opType = ReaderReset.OP_NAME, + inputsClass = ReaderReset.Inputs.class +) @Operator( group = "io" ) @@ -38,8 +47,8 @@ public final class ReaderReset extends RawOp { */ public static final String OP_NAME = "ReaderResetV2"; - private ReaderReset(Operation operation) { - super(operation); + public ReaderReset(Operation operation) { + super(operation, OP_NAME); } /** @@ -57,4 +66,20 @@ public static ReaderReset create(Scope scope, Operand readerHan opBuilder.addInput(readerHandle.asOutput()); return new ReaderReset(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ReaderReset.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + public Inputs(GraphOperation op) { + super(new ReaderReset(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java index 838df56eaf8..6733c87d6d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * Not all Readers support being restored, so this can produce an * Unimplemented error. */ +@OpMetadata( + opType = ReaderRestoreState.OP_NAME, + inputsClass = ReaderRestoreState.Inputs.class +) @Operator( group = "io" ) @@ -41,8 +50,8 @@ public final class ReaderRestoreState extends RawOp { */ public static final String OP_NAME = "ReaderRestoreStateV2"; - private ReaderRestoreState(Operation operation) { - super(operation); + public ReaderRestoreState(Operation operation) { + super(operation, OP_NAME); } /** @@ -64,4 +73,27 @@ public static ReaderRestoreState create(Scope scope, Operand re opBuilder.addInput(state.asOutput()); return new ReaderRestoreState(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ReaderRestoreState.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + /** + * Result of a ReaderSerializeState of a Reader with type + * matching reader_handle. + */ + public final Operand state; + + public Inputs(GraphOperation op) { + super(new ReaderRestoreState(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + state = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java index 486eddbb5ef..c66fb07912b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -33,6 +38,10 @@ * Not all Readers support being serialized, so this can produce an * Unimplemented error. */ +@OpMetadata( + opType = ReaderSerializeState.OP_NAME, + inputsClass = ReaderSerializeState.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class ReaderSerializeState extends RawOp implements Operand state; - private ReaderSerializeState(Operation operation) { - super(operation); + public ReaderSerializeState(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; state = operation.output(outputIdx++); } @@ -79,4 +88,20 @@ public Output state() { public Output asOutput() { return state; } + + @OpInputsMetadata( + outputsClass = ReaderSerializeState.class + ) + public static class Inputs extends RawOpInputs { + /** + * Handle to a Reader. + */ + public final Operand readerHandle; + + public Inputs(GraphOperation op) { + super(new ReaderSerializeState(op), op, Arrays.asList()); + int inputIndex = 0; + readerHandle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java index 94ffbca759e..70f9327d112 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -38,9 +44,11 @@ * {@code SparseTensor} objects going into each row of {@code serialized_sparse} will have * rank {@code R-1}. *

    The minibatch size {@code N} is extracted from {@code sparse_shape[0]}. - * - * @param data type for {@code serialized_sparse} output */ +@OpMetadata( + opType = SerializeManySparse.OP_NAME, + inputsClass = SerializeManySparse.Inputs.class +) @Operator( group = "io" ) @@ -52,8 +60,8 @@ public final class SerializeManySparse extends RawOp implements private Output serializedSparse; - private SerializeManySparse(Operation operation) { - super(operation); + public SerializeManySparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; serializedSparse = operation.output(outputIdx++); } @@ -114,4 +122,45 @@ public Output serializedSparse() { public Output asOutput() { return serializedSparse; } + + @OpInputsMetadata( + outputsClass = SerializeManySparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + */ + public final Operand sparseIndices; + + /** + * 1-D. The {@code values} of the minibatch {@code SparseTensor}. + */ + public final Operand sparseValues; + + /** + * 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + */ + public final Operand sparseShape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new SerializeManySparse<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + sparseIndices = (Operand) op.input(inputIndex++); + sparseValues = (Operand) op.input(inputIndex++); + sparseShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java index 65f33687722..b0c2b5935bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Serialize a {@code SparseTensor} into a {@code [3]} {@code Tensor} object. - * - * @param data type for {@code serialized_sparse} output */ +@OpMetadata( + opType = SerializeSparse.OP_NAME, + inputsClass = SerializeSparse.Inputs.class +) @Operator( group = "io" ) @@ -46,8 +54,8 @@ public final class SerializeSparse extends RawOp implements Ope private Output serializedSparse; - private SerializeSparse(Operation operation) { - super(operation); + public SerializeSparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; serializedSparse = operation.output(outputIdx++); } @@ -108,4 +116,45 @@ public Output serializedSparse() { public Output asOutput() { return serializedSparse; } + + @OpInputsMetadata( + outputsClass = SerializeSparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. The {@code indices} of the {@code SparseTensor}. + */ + public final Operand sparseIndices; + + /** + * 1-D. The {@code values} of the {@code SparseTensor}. + */ + public final Operand sparseValues; + + /** + * 1-D. The {@code shape} of the {@code SparseTensor}. + */ + public final Operand sparseShape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The {@code dtype} to use for serialization; the supported types are {@code string} + * (default) and {@code variant}. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new SerializeSparse<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + sparseIndices = (Operand) op.input(inputIndex++); + sparseValues = (Operand) op.input(inputIndex++); + sparseShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java index 78518c5ae50..bd5d5723c6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Transforms a Tensor into a serialized TensorProto proto. */ +@OpMetadata( + opType = SerializeTensor.OP_NAME, + inputsClass = SerializeTensor.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +52,8 @@ public final class SerializeTensor extends RawOp implements Operand { private Output serialized; - private SerializeTensor(Operation operation) { - super(operation); + public SerializeTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; serialized = operation.output(outputIdx++); } @@ -77,4 +87,26 @@ public Output serialized() { public Output asOutput() { return serialized; } + + @OpInputsMetadata( + outputsClass = SerializeTensor.class + ) + public static class Inputs extends RawOpInputs { + /** + * A Tensor of type {@code T}. + */ + public final Operand tensor; + + /** + * The type of the input tensor. + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SerializeTensor(op), op, Arrays.asList("T")); + int inputIndex = 0; + tensor = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java index f762ef77640..e4f11d652dc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ * Generate a sharded filename. The filename is printf formatted as * %s-%05d-of-%05d, basename, shard, num_shards. */ +@OpMetadata( + opType = ShardedFilename.OP_NAME, + inputsClass = ShardedFilename.Inputs.class +) @Operator( group = "io" ) @@ -43,8 +52,8 @@ public final class ShardedFilename extends RawOp implements Operand { private Output filename; - private ShardedFilename(Operation operation) { - super(operation); + public ShardedFilename(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; filename = operation.output(outputIdx++); } @@ -53,9 +62,9 @@ private ShardedFilename(Operation operation) { * Factory method to create a class wrapping a new ShardedFilename operation. * * @param scope current scope - * @param basename the basename value - * @param shard the shard value - * @param numShards the numShards value + * @param basename The basename value + * @param shard The shard value + * @param numShards The numShards value * @return a new instance of ShardedFilename */ @Endpoint( @@ -83,4 +92,32 @@ public Output filename() { public Output asOutput() { return filename; } + + @OpInputsMetadata( + outputsClass = ShardedFilename.class + ) + public static class Inputs extends RawOpInputs { + /** + * The basename input + */ + public final Operand basename; + + /** + * The shard input + */ + public final Operand shard; + + /** + * The numShards input + */ + public final Operand numShards; + + public Inputs(GraphOperation op) { + super(new ShardedFilename(op), op, Arrays.asList()); + int inputIndex = 0; + basename = (Operand) op.input(inputIndex++); + shard = (Operand) op.input(inputIndex++); + numShards = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java index 933d0e45f36..72f889b6e59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -31,6 +36,10 @@ /** * Generate a glob pattern matching all sharded file names. */ +@OpMetadata( + opType = ShardedFilespec.OP_NAME, + inputsClass = ShardedFilespec.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class ShardedFilespec extends RawOp implements Operand { private Output filename; - private ShardedFilespec(Operation operation) { - super(operation); + public ShardedFilespec(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; filename = operation.output(outputIdx++); } @@ -52,8 +61,8 @@ private ShardedFilespec(Operation operation) { * Factory method to create a class wrapping a new ShardedFilespec operation. * * @param scope current scope - * @param basename the basename value - * @param numShards the numShards value + * @param basename The basename value + * @param numShards The numShards value * @return a new instance of ShardedFilespec */ @Endpoint( @@ -80,4 +89,26 @@ public Output filename() { public Output asOutput() { return filename; } + + @OpInputsMetadata( + outputsClass = ShardedFilespec.class + ) + public static class Inputs extends RawOpInputs { + /** + * The basename input + */ + public final Operand basename; + + /** + * The numShards input + */ + public final Operand numShards; + + public Inputs(GraphOperation op) { + super(new ShardedFilespec(op), op, Arrays.asList()); + int inputIndex = 0; + basename = (Operand) op.input(inputIndex++); + numShards = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java index 6fa1e3c7065..c9222d78057 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A Reader that outputs the lines of a file delimited by '\n'. */ +@OpMetadata( + opType = TextLineReader.OP_NAME, + inputsClass = TextLineReader.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class TextLineReader extends RawOp implements Operand { private Output readerHandle; @SuppressWarnings("unchecked") - private TextLineReader(Operation operation) { - super(operation); + public TextLineReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -171,4 +180,34 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = TextLineReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * Number of lines to skip from the beginning of every file. + */ + public final long skipHeaderLines; + + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new TextLineReader(op), op, Arrays.asList("skip_header_lines", "container", "shared_name")); + int inputIndex = 0; + skipHeaderLines = op.attributes().getAttrInt("skip_header_lines"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java index b587c0915da..e8a38b41cd9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A Reader that outputs the records from a TensorFlow Records file. */ +@OpMetadata( + opType = TfRecordReader.OP_NAME, + inputsClass = TfRecordReader.Inputs.class +) @Operator( group = "io" ) @@ -42,8 +51,8 @@ public final class TfRecordReader extends RawOp implements Operand { private Output readerHandle; @SuppressWarnings("unchecked") - private TfRecordReader(Operation operation) { - super(operation); + public TfRecordReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -171,4 +180,34 @@ public Options compressionType(String compressionType) { return this; } } + + @OpInputsMetadata( + outputsClass = TfRecordReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + /** + * The compressionType attribute + */ + public final String compressionType; + + public Inputs(GraphOperation op) { + super(new TfRecordReader(op), op, Arrays.asList("container", "shared_name", "compression_type")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + compressionType = op.attributes().getAttrString("compression_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java index 862983e5cb1..94e28afede6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; @@ -32,6 +37,10 @@ * To use, enqueue filenames in a Queue. The output of ReaderRead will * be a filename (key) and the contents of that file (value). */ +@OpMetadata( + opType = WholeFileReader.OP_NAME, + inputsClass = WholeFileReader.Inputs.class +) @Operator( group = "io" ) @@ -44,8 +53,8 @@ public final class WholeFileReader extends RawOp implements Operand { private Output readerHandle; @SuppressWarnings("unchecked") - private WholeFileReader(Operation operation) { - super(operation); + public WholeFileReader(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; readerHandle = operation.output(outputIdx++); } @@ -147,4 +156,28 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = WholeFileReader.class + ) + public static class Inputs extends RawOpInputs { + /** + * If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new WholeFileReader(op), op, Arrays.asList("container", "shared_name")); + int inputIndex = 0; + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java index 28fd7ee6335..73235695d93 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.io; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** - * Writes contents to the file at input filename. Creates file and recursively - * creates directory if not existing. + * Writes {@code contents} to the file at input {@code filename}. + * Creates the file and recursively creates directory if it does not exist. */ +@OpMetadata( + opType = WriteFile.OP_NAME, + inputsClass = WriteFile.Inputs.class +) @Operator( group = "io" ) @@ -39,8 +48,8 @@ public final class WriteFile extends RawOp { */ public static final String OP_NAME = "WriteFile"; - private WriteFile(Operation operation) { - super(operation); + public WriteFile(Operation operation) { + super(operation, OP_NAME); } /** @@ -61,4 +70,26 @@ public static WriteFile create(Scope scope, Operand filename, opBuilder.addInput(contents.asOutput()); return new WriteFile(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteFile.class + ) + public static class Inputs extends RawOpInputs { + /** + * scalar. The name of the file to which we write the contents. + */ + public final Operand filename; + + /** + * scalar. The content to be written to the output file. + */ + public final Operand contents; + + public Inputs(GraphOperation op) { + super(new WriteFile(op), op, Arrays.asList()); + int inputIndex = 0; + filename = (Operand) op.input(inputIndex++); + contents = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java index f43a48cb7ef..a521e77b040 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -59,9 +65,11 @@ * tf.linalg.band_part(input, -1, 0) ==> Lower triangular part. * tf.linalg.band_part(input, 0, 0) ==> Diagonal. * - * - * @param data type for {@code band} output */ +@OpMetadata( + opType = BandPart.OP_NAME, + inputsClass = BandPart.Inputs.class +) @Operator( group = "linalg" ) @@ -73,8 +81,8 @@ public final class BandPart extends RawOp implements Operand private Output band; - private BandPart(Operation operation) { - super(operation); + public BandPart(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; band = operation.output(outputIdx++); } @@ -117,4 +125,46 @@ public Output band() { public Output asOutput() { return band; } + + @OpInputsMetadata( + outputsClass = BandPart.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code k} tensor. + */ + public final Operand input; + + /** + * 0-D tensor. Number of subdiagonals to keep. If negative, keep entire + * lower triangle. + */ + public final Operand numLower; + + /** + * 0-D tensor. Number of superdiagonals to keep. If negative, keep + * entire upper triangle. + */ + public final Operand numUpper; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindex attribute + */ + public final DataType Tindex; + + public Inputs(GraphOperation op) { + super(new BandPart<>(op), op, Arrays.asList("T", "Tindex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + numLower = (Operand) op.input(inputIndex++); + numUpper = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindex = op.attributes().getAttrType("Tindex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java index 77d9642ffed..532d4fe148b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BandedTriangularSolve operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BandedTriangularSolve.OP_NAME, + inputsClass = BandedTriangularSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class BandedTriangularSolve extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BandedTriangularSolve extends RawOp implemen private Output output; - private BandedTriangularSolve(Operation operation) { - super(operation); + public BandedTriangularSolve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -49,8 +61,8 @@ private BandedTriangularSolve(Operation operation) { * Factory method to create a class wrapping a new BandedTriangularSolve operation. * * @param scope current scope - * @param matrix the matrix value - * @param rhs the rhs value + * @param matrix The matrix value + * @param rhs The rhs value * @param options carries optional attribute values * @param data type for {@code BandedTriangularSolve} output and operands * @return a new instance of BandedTriangularSolve @@ -143,4 +155,44 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = BandedTriangularSolve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The matrix input + */ + public final Operand matrix; + + /** + * The rhs input + */ + public final Operand rhs; + + /** + * The lower attribute + */ + public final boolean lower; + + /** + * The adjoint attribute + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BandedTriangularSolve<>(op), op, Arrays.asList("lower", "adjoint", "T")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lower = op.attributes().getAttrBool("lower"); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java index 11f03e8d543..b43cf15b48e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchCholesky operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchCholesky.OP_NAME, + inputsClass = BatchCholesky.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchCholesky extends RawOp implements Ope private Output output; - private BatchCholesky(Operation operation) { - super(operation); + public BatchCholesky(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private BatchCholesky(Operation operation) { * Factory method to create a class wrapping a new BatchCholesky operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code BatchCholesky} output and operands * @return a new instance of BatchCholesky */ @@ -79,4 +87,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchCholesky.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchCholesky<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java index e7554b4a92b..5e917e740b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchCholeskyGrad operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchCholeskyGrad.OP_NAME, + inputsClass = BatchCholeskyGrad.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchCholeskyGrad extends RawOp implements private Output output; - private BatchCholeskyGrad(Operation operation) { - super(operation); + public BatchCholeskyGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private BatchCholeskyGrad(Operation operation) { * Factory method to create a class wrapping a new BatchCholeskyGrad operation. * * @param scope current scope - * @param l the l value - * @param grad the grad value + * @param l The l value + * @param grad The grad value * @param data type for {@code BatchCholeskyGrad} output and operands * @return a new instance of BatchCholeskyGrad */ @@ -82,4 +90,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchCholeskyGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The l input + */ + public final Operand l; + + /** + * The grad input + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchCholeskyGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + l = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java index 17d71e27f7f..99cb57ff97f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The BatchMatrixBandPart operation - * - * @param data type for {@code band} output */ +@OpMetadata( + opType = BatchMatrixBandPart.OP_NAME, + inputsClass = BatchMatrixBandPart.Inputs.class +) @Operator( group = "linalg" ) @@ -44,8 +52,8 @@ public final class BatchMatrixBandPart extends RawOp implements private Output band; - private BatchMatrixBandPart(Operation operation) { - super(operation); + public BatchMatrixBandPart(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; band = operation.output(outputIdx++); } @@ -54,9 +62,9 @@ private BatchMatrixBandPart(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixBandPart operation. * * @param scope current scope - * @param input the input value - * @param numLower the numLower value - * @param numUpper the numUpper value + * @param input The input value + * @param numLower The numLower value + * @param numUpper The numUpper value * @param data type for {@code BatchMatrixBandPart} output and operands * @return a new instance of BatchMatrixBandPart */ @@ -85,4 +93,38 @@ public Output band() { public Output asOutput() { return band; } + + @OpInputsMetadata( + outputsClass = BatchMatrixBandPart.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The numLower input + */ + public final Operand numLower; + + /** + * The numUpper input + */ + public final Operand numUpper; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixBandPart<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + numLower = (Operand) op.input(inputIndex++); + numUpper = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java index d0d15d8d22a..7f1bd32a749 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BatchMatrixDeterminant operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixDeterminant.OP_NAME, + inputsClass = BatchMatrixDeterminant.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixDeterminant extends RawOp impleme private Output output; - private BatchMatrixDeterminant(Operation operation) { - super(operation); + public BatchMatrixDeterminant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private BatchMatrixDeterminant(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixDeterminant operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code BatchMatrixDeterminant} output and operands * @return a new instance of BatchMatrixDeterminant */ @@ -79,4 +87,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchMatrixDeterminant.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixDeterminant<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java index a8af1f6cfba..edc731b1f36 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BatchMatrixDiag operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixDiag.OP_NAME, + inputsClass = BatchMatrixDiag.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixDiag extends RawOp implements Ope private Output output; - private BatchMatrixDiag(Operation operation) { - super(operation); + public BatchMatrixDiag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private BatchMatrixDiag(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixDiag operation. * * @param scope current scope - * @param diagonal the diagonal value + * @param diagonal The diagonal value * @param data type for {@code BatchMatrixDiag} output and operands * @return a new instance of BatchMatrixDiag */ @@ -79,4 +87,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchMatrixDiag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The diagonal input + */ + public final Operand diagonal; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixDiag<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + diagonal = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java index c3de49e9c75..ac379b960aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BatchMatrixDiagPart operation - * - * @param data type for {@code diagonal} output */ +@OpMetadata( + opType = BatchMatrixDiagPart.OP_NAME, + inputsClass = BatchMatrixDiagPart.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixDiagPart extends RawOp implements private Output diagonal; - private BatchMatrixDiagPart(Operation operation) { - super(operation); + public BatchMatrixDiagPart(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; diagonal = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private BatchMatrixDiagPart(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixDiagPart operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code BatchMatrixDiagPart} output and operands * @return a new instance of BatchMatrixDiagPart */ @@ -79,4 +87,26 @@ public Output diagonal() { public Output asOutput() { return diagonal; } + + @OpInputsMetadata( + outputsClass = BatchMatrixDiagPart.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixDiagPart<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java index ffaf294076d..009deec3658 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchMatrixInverse operation - * - * @param data type for {@code output} output + * DEPRECATED: This operation is deprecated and will be removed in a future version. + * Use tf.linalg.inv instead. + *

    Computes the inverse of one or more square invertible matrices or their + * adjoints (conjugate transposes). */ +@OpMetadata( + opType = BatchMatrixInverse.OP_NAME, + inputsClass = BatchMatrixInverse.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +55,8 @@ public final class BatchMatrixInverse extends RawOp implement private Output output; - private BatchMatrixInverse(Operation operation) { - super(operation); + public BatchMatrixInverse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,7 +65,7 @@ private BatchMatrixInverse(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixInverse operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchMatrixInverse} output and operands * @return a new instance of BatchMatrixInverse @@ -119,4 +131,32 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchMatrixInverse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The adjoint attribute + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixInverse<>(op), op, Arrays.asList("adjoint", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java index ea3e2277b38..eaea0c7db31 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BatchMatrixSetDiag operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixSetDiag.OP_NAME, + inputsClass = BatchMatrixSetDiag.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixSetDiag extends RawOp implements private Output output; - private BatchMatrixSetDiag(Operation operation) { - super(operation); + public BatchMatrixSetDiag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private BatchMatrixSetDiag(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixSetDiag operation. * * @param scope current scope - * @param input the input value - * @param diagonal the diagonal value + * @param input The input value + * @param diagonal The diagonal value * @param data type for {@code BatchMatrixSetDiag} output and operands * @return a new instance of BatchMatrixSetDiag */ @@ -82,4 +90,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = BatchMatrixSetDiag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The diagonal input + */ + public final Operand diagonal; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixSetDiag<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + diagonal = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java index 896451d0c58..5b6749c53e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchMatrixSolve operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixSolve.OP_NAME, + inputsClass = BatchMatrixSolve.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixSolve extends RawOp implements private Output output; - private BatchMatrixSolve(Operation operation) { - super(operation); + public BatchMatrixSolve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private BatchMatrixSolve(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixSolve operation. * * @param scope current scope - * @param matrix the matrix value - * @param rhs the rhs value + * @param matrix The matrix value + * @param rhs The rhs value * @param options carries optional attribute values * @param data type for {@code BatchMatrixSolve} output and operands * @return a new instance of BatchMatrixSolve @@ -121,4 +129,38 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchMatrixSolve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The matrix input + */ + public final Operand matrix; + + /** + * The rhs input + */ + public final Operand rhs; + + /** + * The adjoint attribute + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixSolve<>(op), op, Arrays.asList("adjoint", "T")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java index cfe318269e2..7cb6714696f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat64; import org.tensorflow.types.family.TNumber; /** * The BatchMatrixSolveLs operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixSolveLs.OP_NAME, + inputsClass = BatchMatrixSolveLs.Inputs.class +) @Operator( group = "linalg" ) @@ -44,8 +52,8 @@ public final class BatchMatrixSolveLs extends RawOp implement private Output output; - private BatchMatrixSolveLs(Operation operation) { - super(operation); + public BatchMatrixSolveLs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -54,9 +62,9 @@ private BatchMatrixSolveLs(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixSolveLs operation. * * @param scope current scope - * @param matrix the matrix value - * @param rhs the rhs value - * @param l2Regularizer the l2Regularizer value + * @param matrix The matrix value + * @param rhs The rhs value + * @param l2Regularizer The l2Regularizer value * @param options carries optional attribute values * @param data type for {@code BatchMatrixSolveLs} output and operands * @return a new instance of BatchMatrixSolveLs @@ -124,4 +132,44 @@ public Options fast(Boolean fast) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchMatrixSolveLs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The matrix input + */ + public final Operand matrix; + + /** + * The rhs input + */ + public final Operand rhs; + + /** + * The l2Regularizer input + */ + public final Operand l2Regularizer; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The fast attribute + */ + public final boolean fast; + + public Inputs(GraphOperation op) { + super(new BatchMatrixSolveLs<>(op), op, Arrays.asList("T", "fast")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + l2Regularizer = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + fast = op.attributes().getAttrBool("fast"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java index a52a7ce9c9e..d7b326bae21 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchMatrixTriangularSolve operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatrixTriangularSolve.OP_NAME, + inputsClass = BatchMatrixTriangularSolve.Inputs.class +) @Operator( group = "linalg" ) @@ -43,8 +51,8 @@ public final class BatchMatrixTriangularSolve extends RawOp i private Output output; - private BatchMatrixTriangularSolve(Operation operation) { - super(operation); + public BatchMatrixTriangularSolve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private BatchMatrixTriangularSolve(Operation operation) { * Factory method to create a class wrapping a new BatchMatrixTriangularSolve operation. * * @param scope current scope - * @param matrix the matrix value - * @param rhs the rhs value + * @param matrix The matrix value + * @param rhs The rhs value * @param options carries optional attribute values * @param data type for {@code BatchMatrixTriangularSolve} output and operands * @return a new instance of BatchMatrixTriangularSolve @@ -147,4 +155,44 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchMatrixTriangularSolve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The matrix input + */ + public final Operand matrix; + + /** + * The rhs input + */ + public final Operand rhs; + + /** + * The lower attribute + */ + public final boolean lower; + + /** + * The adjoint attribute + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchMatrixTriangularSolve<>(op), op, Arrays.asList("lower", "adjoint", "T")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lower = op.attributes().getAttrBool("lower"); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java index 3bc1baa374d..637625bd5db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BatchSelfAdjointEigV2 operation - * - * @param data type for {@code e} output */ +@OpMetadata( + opType = BatchSelfAdjointEig.OP_NAME, + inputsClass = BatchSelfAdjointEig.Inputs.class +) @Operator( group = "linalg" ) @@ -45,8 +53,8 @@ public final class BatchSelfAdjointEig extends RawOp { private Output v; - private BatchSelfAdjointEig(Operation operation) { - super(operation); + public BatchSelfAdjointEig(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; e = operation.output(outputIdx++); v = operation.output(outputIdx++); @@ -56,7 +64,7 @@ private BatchSelfAdjointEig(Operation operation) { * Factory method to create a class wrapping a new BatchSelfAdjointEigV2 operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchSelfAdjointEigV2} output and operands * @return a new instance of BatchSelfAdjointEig @@ -126,4 +134,32 @@ public Options computeV(Boolean computeV) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchSelfAdjointEig.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The computeV attribute + */ + public final boolean computeV; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchSelfAdjointEig<>(op), op, Arrays.asList("compute_v", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + computeV = op.attributes().getAttrBool("compute_v"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java index e52f57dc8b4..a2411601e63 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * The BatchSvd operation - * - * @param data type for {@code s} output */ +@OpMetadata( + opType = BatchSvd.OP_NAME, + inputsClass = BatchSvd.Inputs.class +) @Operator( group = "linalg" ) @@ -47,8 +55,8 @@ public final class BatchSvd extends RawOp { private Output v; - private BatchSvd(Operation operation) { - super(operation); + public BatchSvd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; s = operation.output(outputIdx++); u = operation.output(outputIdx++); @@ -59,7 +67,7 @@ private BatchSvd(Operation operation) { * Factory method to create a class wrapping a new BatchSvd operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param options carries optional attribute values * @param data type for {@code BatchSvd} output and operands * @return a new instance of BatchSvd @@ -164,4 +172,38 @@ public Options fullMatrices(Boolean fullMatrices) { return this; } } + + @OpInputsMetadata( + outputsClass = BatchSvd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The computeUv attribute + */ + public final boolean computeUv; + + /** + * The fullMatrices attribute + */ + public final boolean fullMatrices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BatchSvd<>(op), op, Arrays.asList("compute_uv", "full_matrices", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + computeUv = op.attributes().getAttrBool("compute_uv"); + fullMatrices = op.attributes().getAttrBool("full_matrices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java index 655831f5ebb..ef6d0ca1a3d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +45,11 @@ *

    Note: The gradient computation on GPU is faster for large matrices but * not for large batch dimensions when the submatrices are small. In this * case it might be faster to use the CPU. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Cholesky.OP_NAME, + inputsClass = Cholesky.Inputs.class +) @Operator( group = "linalg" ) @@ -53,8 +61,8 @@ public final class Cholesky extends RawOp implements Operand private Output output; - private Cholesky(Operation operation) { - super(operation); + public Cholesky(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -89,4 +97,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Cholesky.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Cholesky<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java index f66f879332f..ce7975bbb29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the reverse mode backpropagated gradient of the Cholesky algorithm. * For an explanation see "Differentiation of the Cholesky algorithm" by * Iain Murray http://arxiv.org/abs/1602.07527. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CholeskyGrad.OP_NAME, + inputsClass = CholeskyGrad.Inputs.class +) @Operator( group = "linalg" ) @@ -45,8 +53,8 @@ public final class CholeskyGrad extends RawOp implements Oper private Output output; - private CholeskyGrad(Operation operation) { - super(operation); + public CholeskyGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -88,4 +96,36 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = CholeskyGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Output of batch Cholesky algorithm l = cholesky(A). Shape is {@code [..., M, M]}. + * Algorithm depends only on lower triangular part of the innermost matrices of + * this tensor. + */ + public final Operand l; + + /** + * df/dl where f is some scalar function. Shape is {@code [..., M, M]}. + * Algorithm depends only on lower triangular part of the innermost matrices of + * this tensor. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CholeskyGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + l = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java index 98618b9e7b7..561e4fecbf1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * The output {@code y} has the same rank as {@code x}. The shapes of {@code x} and {@code y} satisfy: * {@code y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]} * {@code y[i,j,k,...,s,t,u] == conj(x[perm[i], perm[j], perm[k],...,perm[s], perm[t], perm[u]])} - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = ConjugateTranspose.OP_NAME, + inputsClass = ConjugateTranspose.Inputs.class +) @Operator( group = "linalg" ) @@ -47,8 +55,8 @@ public final class ConjugateTranspose extends RawOp implements private Output y; - private ConjugateTranspose(Operation operation) { - super(operation); + public ConjugateTranspose(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -57,8 +65,8 @@ private ConjugateTranspose(Operation operation) { * Factory method to create a class wrapping a new ConjugateTranspose operation. * * @param scope current scope - * @param x the x value - * @param perm the perm value + * @param x The x value + * @param perm The perm value * @param data type for {@code ConjugateTranspose} output and operands * @return a new instance of ConjugateTranspose */ @@ -86,4 +94,38 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = ConjugateTranspose.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The perm input + */ + public final Operand perm; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tperm attribute + */ + public final DataType Tperm; + + public Inputs(GraphOperation op) { + super(new ConjugateTranspose<>(op), op, Arrays.asList("T", "Tperm")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + perm = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tperm = op.attributes().getAttrType("Tperm"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java index 537c6cdcb48..5c942c1e41b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +38,11 @@ * {@code a} and {@code b} must be the same shape; they can either be simple 3-element vectors, * or any shape where the innermost dimension is 3. In the latter case, each pair * of corresponding 3-element vectors is cross-multiplied independently. - * - * @param data type for {@code product} output */ +@OpMetadata( + opType = Cross.OP_NAME, + inputsClass = Cross.Inputs.class +) @Operator( group = "linalg" ) @@ -46,8 +54,8 @@ public final class Cross extends RawOp implements Operand private Output product; - private Cross(Operation operation) { - super(operation); + public Cross(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; product = operation.output(outputIdx++); } @@ -84,4 +92,32 @@ public Output product() { public Output asOutput() { return product; } + + @OpInputsMetadata( + outputsClass = Cross.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor containing 3-element vectors. + */ + public final Operand a; + + /** + * Another tensor, of same type and shape as {@code a}. + */ + public final Operand b; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Cross<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java index 0fb44b629a9..d63118c9f73 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. The output is a tensor containing the determinants * for all input submatrices {@code [..., :, :]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Det.OP_NAME, + inputsClass = Det.Inputs.class +) @Operator( group = "linalg" ) @@ -46,8 +54,8 @@ public final class Det extends RawOp implements Operand { private Output output; - private Det(Operation operation) { - super(operation); + public Det(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -82,4 +90,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Det.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Det<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java index 0a38377eb0c..3276bbb78fe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,9 +46,11 @@ * e, v = eig(a) * e = eig(a, compute_v=False) * - * - * @param data type for {@code e} output */ +@OpMetadata( + opType = Eig.OP_NAME, + inputsClass = Eig.Inputs.class +) @Operator( group = "linalg" ) @@ -56,8 +64,8 @@ public final class Eig extends RawOp { private Output v; - private Eig(Operation operation) { - super(operation); + public Eig(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; e = operation.output(outputIdx++); v = operation.output(outputIdx++); @@ -68,7 +76,7 @@ private Eig(Operation operation) { * * @param scope current scope * @param input {@code Tensor} input of shape {@code [N, N]}. - * @param Tout the value of the Tout property + * @param Tout The value of the Tout attribute * @param options carries optional attribute values * @param data type for {@code Eig} output and operands * @return a new instance of Eig @@ -141,4 +149,39 @@ public Options computeV(Boolean computeV) { return this; } } + + @OpInputsMetadata( + outputsClass = Eig.class + ) + public static class Inputs extends RawOpInputs> { + /** + * {@code Tensor} input of shape {@code [N, N]}. + */ + public final Operand input; + + /** + * If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + */ + public final boolean computeV; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new Eig<>(op), op, Arrays.asList("compute_v", "T", "Tout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + computeV = op.attributes().getAttrBool("compute_v"); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java index b95c42f015e..5b57bad8aa4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -93,9 +99,11 @@ * supported by {@code numpy.einsum}. *
    {@literal @}end_compatibility * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Einsum.OP_NAME, + inputsClass = Einsum.Inputs.class +) @Operator( group = "linalg" ) @@ -107,8 +115,8 @@ public final class Einsum extends RawOp implements Operand { private Output output; - private Einsum(Operation operation) { - super(operation); + public Einsum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -146,4 +154,34 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Einsum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * List of 1 or 2 Tensors. + */ + public final Iterable> inputs; + + /** + * String describing the Einstein Summation operation; in the format of np.einsum. + */ + public final String equation; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Einsum<>(op), op, Arrays.asList("equation", "T")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + equation = op.attributes().getAttrString("equation"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java index 3128f30a34d..f544381e1a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = EuclideanNorm.OP_NAME, + inputsClass = EuclideanNorm.Inputs.class +) @Operator( group = "linalg" ) @@ -48,8 +56,8 @@ public final class EuclideanNorm extends RawOp implements Opera private Output output; - private EuclideanNorm(Operation operation) { - super(operation); + public EuclideanNorm(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,4 +135,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = EuclideanNorm.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new EuclideanNorm<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } 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 7c8e91dbe9a..93338f1df07 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ *

    If a matrix is not invertible there is no guarantee what the op does. It * may detect the condition and raise an exception or it may simply return a * garbage result. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Inv.OP_NAME, + inputsClass = Inv.Inputs.class +) @Operator( group = "linalg" ) @@ -50,8 +58,8 @@ public final class Inv extends RawOp implements Operand { private Output output; - private Inv(Operation operation) { - super(operation); + public Inv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -128,4 +136,32 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = Inv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand input; + + /** + * The adjoint attribute + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Inv<>(op), op, Arrays.asList("adjoint", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java index 3f6396dfa99..23f15383945 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -61,6 +66,10 @@ * [w(0, 0), w(0, 2), -0.5], * [0.25, -0.25, 42]] */ +@OpMetadata( + opType = LoadAndRemapMatrix.OP_NAME, + inputsClass = LoadAndRemapMatrix.Inputs.class +) @Operator( group = "linalg" ) @@ -72,8 +81,8 @@ public final class LoadAndRemapMatrix extends RawOp implements Operand private Output outputMatrix; - private LoadAndRemapMatrix(Operation operation) { - super(operation); + public LoadAndRemapMatrix(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputMatrix = operation.output(outputIdx++); } @@ -173,4 +182,72 @@ public Options maxRowsInMemory(Long maxRowsInMemory) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadAndRemapMatrix.class + ) + public static class Inputs extends RawOpInputs { + /** + * Path to the TensorFlow checkpoint (version 2, {@code TensorBundle}) from + * which the old matrix {@code Tensor} will be loaded. + */ + public final Operand ckptPath; + + /** + * Name of the 2-D {@code Tensor} to load from checkpoint. + */ + public final Operand oldTensorName; + + /** + * An int {@code Tensor} of row remappings (generally created by + * {@code generate_vocab_remapping}). Even if no row remapping is needed, this must + * still be an index-valued Tensor (e.g. [0, 1, 2, ...]), or a shifted + * index-valued {@code Tensor} (e.g. [8, 9, 10, ...], for partitioned {@code Variables}). + */ + public final Operand rowRemapping; + + /** + * An int {@code Tensor} of column remappings (generally created by + * {@code generate_vocab_remapping}). May be a size-0 {@code Tensor} if only row remapping + * is to be done (e.g. column ordering is the same). + */ + public final Operand colRemapping; + + /** + * A float {@code Tensor} containing values to fill in for cells + * in the output matrix that are not loaded from the checkpoint. Length must be + * exactly the same as the number of missing / new cells. + */ + public final Operand initializingValues; + + /** + * Number of rows (length of the 1st dimension) in the output matrix. + */ + public final long numRows; + + /** + * Number of columns (length of the 2nd dimension) in the output matrix. + */ + public final long numCols; + + /** + * The maximum number of rows to load from the checkpoint at + * once. If less than or equal to 0, the entire matrix will be loaded into + * memory. Setting this arg trades increased disk reads for lower memory usage. + */ + public final long maxRowsInMemory; + + public Inputs(GraphOperation op) { + super(new LoadAndRemapMatrix(op), op, Arrays.asList("num_rows", "num_cols", "max_rows_in_memory")); + int inputIndex = 0; + ckptPath = (Operand) op.input(inputIndex++); + oldTensorName = (Operand) op.input(inputIndex++); + rowRemapping = (Operand) op.input(inputIndex++); + colRemapping = (Operand) op.input(inputIndex++); + initializingValues = (Operand) op.input(inputIndex++); + numRows = op.attributes().getAttrInt("num_rows"); + numCols = op.attributes().getAttrInt("num_cols"); + maxRowsInMemory = op.attributes().getAttrInt("max_rows_in_memory"); + } + } } 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 d1b62eae3d3..a144ac2d31c 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ * The {@code log_abs_determinant} is computed as {@code det(P)*sum(log(diag(LU)))} where {@code LU} * is the {@code LU} decomposition of the input and {@code P} is the corresponding * permutation matrix. - * - * @param data type for {@code sign} output */ +@OpMetadata( + opType = LogMatrixDeterminant.OP_NAME, + inputsClass = LogMatrixDeterminant.Inputs.class +) @Operator( group = "linalg" ) @@ -53,8 +61,8 @@ public final class LogMatrixDeterminant extends RawOp { private Output logAbsDeterminant; - private LogMatrixDeterminant(Operation operation) { - super(operation); + public LogMatrixDeterminant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sign = operation.output(outputIdx++); logAbsDeterminant = operation.output(outputIdx++); @@ -95,4 +103,26 @@ public Output sign() { public Output logAbsDeterminant() { return logAbsDeterminant; } + + @OpInputsMetadata( + outputsClass = LogMatrixDeterminant.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [N, M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LogMatrixDeterminant<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java index 5cd692a71bc..9063fab1875 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -45,11 +51,11 @@ *

    P represents a permutation matrix encoded as a list of indices each between {@code 0} * and {@code M-1}, inclusive. If P_mat denotes the permutation matrix corresponding to * P, then the L, U and P satisfies P_mat * input = L * U. - * - * @param data type for {@code lu} output - * - * @param data type for {@code p} output */ +@OpMetadata( + opType = Lu.OP_NAME, + inputsClass = Lu.Inputs.class +) @Operator( group = "linalg" ) @@ -63,8 +69,8 @@ public final class Lu extends RawOp { private Output p; - private Lu(Operation operation) { - super(operation); + public Lu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; lu = operation.output(outputIdx++); p = operation.output(outputIdx++); @@ -76,7 +82,7 @@ private Lu(Operation operation) { * @param scope current scope * @param input A tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form matrices of * size {@code [M, M]}. - * @param outputIdxType the value of the outputIdxType property + * @param outputIdxType The value of the outputIdxType attribute * @param data type for {@code Lu} output and operands * @param data type for {@code Lu} output and operands * @return a new instance of Lu @@ -134,4 +140,33 @@ public Output lu() { public Output p() { return p; } + + @OpInputsMetadata( + outputsClass = Lu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions form matrices of + * size {@code [M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outputIdxType attribute + */ + public final DataType outputIdxType; + + public Inputs(GraphOperation op) { + super(new Lu<>(op), op, Arrays.asList("T", "output_idx_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outputIdxType = op.attributes().getAttrType("output_idx_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java index a0269b20948..c817cbc9037 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * true). *

    Note: The default kernel implementation for MatMul on GPUs uses * cublas. - * - * @param data type for {@code product} output */ +@OpMetadata( + opType = MatMul.OP_NAME, + inputsClass = MatMul.Inputs.class +) @Operator( group = "linalg" ) @@ -49,8 +57,8 @@ public final class MatMul extends RawOp implements Operand { private Output product; - private MatMul(Operation operation) { - super(operation); + public MatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; product = operation.output(outputIdx++); } @@ -59,8 +67,8 @@ private MatMul(Operation operation) { * Factory method to create a class wrapping a new MatMul operation. * * @param scope current scope - * @param a the a value - * @param b the b value + * @param a The a value + * @param b The b value * @param options carries optional attribute values * @param data type for {@code MatMul} output and operands * @return a new instance of MatMul @@ -81,6 +89,12 @@ public static MatMul create(Scope scope, Operand a, Oper if (opts.transposeB != null) { opBuilder.setAttr("transpose_b", opts.transposeB); } + if (opts.gradA != null) { + opBuilder.setAttr("grad_a", opts.gradA); + } + if (opts.gradB != null) { + opBuilder.setAttr("grad_b", opts.gradB); + } } } return new MatMul<>(opBuilder.build()); @@ -106,6 +120,26 @@ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } + /** + * Sets the gradA option. + * + * @param gradA the gradA option + * @return this Options instance. + */ + public static Options gradA(Boolean gradA) { + return new Options().gradA(gradA); + } + + /** + * Sets the gradB option. + * + * @param gradB the gradB option + * @return this Options instance. + */ + public static Options gradB(Boolean gradB) { + return new Options().gradB(gradB); + } + /** * Gets product. * @@ -128,6 +162,10 @@ public static class Options { private Boolean transposeB; + private Boolean gradA; + + private Boolean gradB; + private Options() { } @@ -152,5 +190,79 @@ public Options transposeB(Boolean transposeB) { this.transposeB = transposeB; return this; } + + /** + * Sets the gradA option. + * + * @param gradA the gradA option + * @return this Options instance. + */ + public Options gradA(Boolean gradA) { + this.gradA = gradA; + return this; + } + + /** + * Sets the gradB option. + * + * @param gradB the gradB option + * @return this Options instance. + */ + public Options gradB(Boolean gradB) { + this.gradB = gradB; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The b input + */ + public final Operand b; + + /** + * If true, "a" is transposed before multiplication. + */ + public final boolean transposeA; + + /** + * If true, "b" is transposed before multiplication. + */ + public final boolean transposeB; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The gradA attribute + */ + public final boolean gradA; + + /** + * The gradB attribute + */ + public final boolean gradB; + + public Inputs(GraphOperation op) { + super(new MatMul<>(op), op, Arrays.asList("transpose_a", "transpose_b", "T", "grad_a", "grad_b")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + T = op.attributes().getAttrType("T"); + gradA = op.attributes().getAttrBool("grad_a"); + gradB = op.attributes().getAttrBool("grad_b"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java index 74e7289ba2d..5241708f71a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -110,9 +116,11 @@ * [1, 9], * [9, 2]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MatrixDiag.OP_NAME, + inputsClass = MatrixDiag.Inputs.class +) @Operator( group = "linalg" ) @@ -124,8 +132,8 @@ public final class MatrixDiag extends RawOp implements Operand< private Output output; - private MatrixDiag(Operation operation) { - super(operation); + public MatrixDiag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -178,4 +186,58 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = MatrixDiag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code r}, where {@code r >= 1} + */ + public final Operand diagonal; + + /** + * Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + */ + public final Operand k; + + /** + * The number of rows of the output matrix. If it is not provided, the op assumes + * the output matrix is a square matrix and infers the matrix size from k and the + * innermost dimension of {@code diagonal}. + */ + public final Operand numRows; + + /** + * The number of columns of the output matrix. If it is not provided, the op + * assumes the output matrix is a square matrix and infers the matrix size from + * k and the innermost dimension of {@code diagonal}. + */ + public final Operand numCols; + + /** + * The number to fill the area outside the specified diagonal band with. + * Default is 0. + */ + public final Operand paddingValue; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MatrixDiag<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + diagonal = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + numRows = (Operand) op.input(inputIndex++); + numCols = (Operand) op.input(inputIndex++); + paddingValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java index 6bde824a10a..a818b134cbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -90,9 +96,11 @@ * [3, 4, 9], * [4, 3, 8]]] * - * - * @param data type for {@code diagonal} output */ +@OpMetadata( + opType = MatrixDiagPart.OP_NAME, + inputsClass = MatrixDiagPart.Inputs.class +) @Operator( group = "linalg" ) @@ -104,8 +112,8 @@ public final class MatrixDiagPart extends RawOp implements Oper private Output diagonal; - private MatrixDiagPart(Operation operation) { - super(operation); + public MatrixDiagPart(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; diagonal = operation.output(outputIdx++); } @@ -149,4 +157,42 @@ public Output diagonal() { public Output asOutput() { return diagonal; } + + @OpInputsMetadata( + outputsClass = MatrixDiagPart.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code r} tensor where {@code r >= 2}. + */ + public final Operand input; + + /** + * Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + */ + public final Operand k; + + /** + * The value to fill the area outside the specified diagonal band with. + * Default is 0. + */ + public final Operand paddingValue; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MatrixDiagPart<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + paddingValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java index 7039e1e4abc..c6ecab46bab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -120,9 +126,11 @@ * [4, 3, 8]]] * * - * - * @param data type for {@code diagonal} output */ +@OpMetadata( + opType = MatrixDiagPartV3.OP_NAME, + inputsClass = MatrixDiagPartV3.Inputs.class +) @Operator( group = "linalg" ) @@ -134,8 +142,8 @@ public final class MatrixDiagPartV3 extends RawOp implements Op private Output diagonal; - private MatrixDiagPartV3(Operation operation) { - super(operation); + public MatrixDiagPartV3(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; diagonal = operation.output(outputIdx++); } @@ -230,4 +238,54 @@ public Options align(String align) { return this; } } + + @OpInputsMetadata( + outputsClass = MatrixDiagPartV3.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code r} tensor where {@code r >= 2}. + */ + public final Operand input; + + /** + * Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + */ + public final Operand k; + + /** + * The value to fill the area outside the specified diagonal band with. + * Default is 0. + */ + public final Operand paddingValue; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + */ + public final String align; + + public Inputs(GraphOperation op) { + super(new MatrixDiagPartV3<>(op), op, Arrays.asList("T", "align")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + paddingValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + align = op.attributes().getAttrString("align"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java index 9a812c4504f..67b5b3b74b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -138,9 +144,11 @@ * [9, 2]] * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MatrixDiagV3.OP_NAME, + inputsClass = MatrixDiagV3.Inputs.class +) @Operator( group = "linalg" ) @@ -152,8 +160,8 @@ public final class MatrixDiagV3 extends RawOp implements Operan private Output output; - private MatrixDiagV3(Operation operation) { - super(operation); + public MatrixDiagV3(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -257,4 +265,70 @@ public Options align(String align) { return this; } } + + @OpInputsMetadata( + outputsClass = MatrixDiagV3.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code r}, where {@code r >= 1} + */ + public final Operand diagonal; + + /** + * Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + */ + public final Operand k; + + /** + * The number of rows of the output matrix. If it is not provided, the op assumes + * the output matrix is a square matrix and infers the matrix size from k and the + * innermost dimension of {@code diagonal}. + */ + public final Operand numRows; + + /** + * The number of columns of the output matrix. If it is not provided, the op + * assumes the output matrix is a square matrix and infers the matrix size from + * k and the innermost dimension of {@code diagonal}. + */ + public final Operand numCols; + + /** + * The number to fill the area outside the specified diagonal band with. + * Default is 0. + */ + public final Operand paddingValue; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + */ + public final String align; + + public Inputs(GraphOperation op) { + super(new MatrixDiagV3<>(op), op, Arrays.asList("T", "align")); + int inputIndex = 0; + diagonal = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + numRows = (Operand) op.input(inputIndex++); + numCols = (Operand) op.input(inputIndex++); + paddingValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + align = op.attributes().getAttrString("align"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixExponential.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixExponential.java new file mode 100644 index 00000000000..9332cd02b3e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixExponential.java @@ -0,0 +1,112 @@ +/* Copyright 2018-2023 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.linalg; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Deprecated, use python implementation tf.linalg.matrix_exponential. + */ +@OpMetadata( + opType = MatrixExponential.OP_NAME, + inputsClass = MatrixExponential.Inputs.class +) +@Operator( + group = "linalg" +) +public final class MatrixExponential extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixExponential"; + + private Output output; + + public MatrixExponential(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixExponential operation. + * + * @param scope current scope + * @param input The input value + * @param data type for {@code MatrixExponential} output and operands + * @return a new instance of MatrixExponential + */ + @Endpoint( + describeByClass = true + ) + public static MatrixExponential create(Scope scope, Operand input) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MatrixExponential"); + opBuilder.addInput(input.asOutput()); + return new MatrixExponential<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = MatrixExponential.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MatrixExponential<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java index 822ba52caa7..f1529a1c264 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +46,14 @@ *

    The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. The output is a tensor of the same shape as the input * containing the exponential for all input submatrices {@code [..., :, :]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MatrixLogarithm.OP_NAME, + inputsClass = MatrixLogarithm.Inputs.class +) +@Operator( + group = "linalg" +) public final class MatrixLogarithm extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -50,8 +62,8 @@ public final class MatrixLogarithm extends RawOp implements Ope private Output output; - private MatrixLogarithm(Operation operation) { - super(operation); + public MatrixLogarithm(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -89,4 +101,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = MatrixLogarithm.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MatrixLogarithm<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java index 7cf8c61e559..1ec3a1444f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -126,9 +132,11 @@ * [7, 4, 2, 4]]] * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MatrixSetDiag.OP_NAME, + inputsClass = MatrixSetDiag.Inputs.class +) @Operator( group = "linalg" ) @@ -140,8 +148,8 @@ public final class MatrixSetDiag extends RawOp implements Opera private Output output; - private MatrixSetDiag(Operation operation) { - super(operation); + public MatrixSetDiag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -236,4 +244,54 @@ public Options align(String align) { return this; } } + + @OpInputsMetadata( + outputsClass = MatrixSetDiag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank {@code r+1}, where {@code r >= 1}. + */ + public final Operand input; + + /** + * Rank {@code r} when {@code k} is an integer or {@code k[0] == k[1]}. Otherwise, it has rank {@code r+1}. + * {@code k >= 1}. + */ + public final Operand diagonal; + + /** + * Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + */ + public final Operand k; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + */ + public final String align; + + public Inputs(GraphOperation op) { + super(new MatrixSetDiag<>(op), op, Arrays.asList("T", "align")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + diagonal = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + align = op.attributes().getAttrString("align"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java index f3cf21c2138..d0601c6ee57 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat64; import org.tensorflow.types.family.TType; @@ -60,9 +66,11 @@ * least-squares solution, even when \(A\) is rank deficient. This path is * typically 6-7 times slower than the fast path. If {@code fast} is {@code False} then * {@code l2_regularizer} is ignored. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MatrixSolveLs.OP_NAME, + inputsClass = MatrixSolveLs.Inputs.class +) @Operator( group = "linalg" ) @@ -74,8 +82,8 @@ public final class MatrixSolveLs extends RawOp implements Opera private Output output; - private MatrixSolveLs(Operation operation) { - super(operation); + public MatrixSolveLs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -157,4 +165,47 @@ public Options fast(Boolean fast) { return this; } } + + @OpInputsMetadata( + outputsClass = MatrixSolveLs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, N]}. + */ + public final Operand matrix; + + /** + * Shape is {@code [..., M, K]}. + */ + public final Operand rhs; + + /** + * Scalar tensor. + *

    {@literal @}compatibility(numpy)
    + * Equivalent to np.linalg.lstsq + *
    {@literal @}end_compatibility + */ + public final Operand l2Regularizer; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The fast attribute + */ + public final boolean fast; + + public Inputs(GraphOperation op) { + super(new MatrixSolveLs<>(op), op, Arrays.asList("T", "fast")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + l2Regularizer = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + fast = op.attributes().getAttrBool("fast"); + } + } } 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 02839271a61..037f024d04b 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +47,11 @@ * q, r = qr(a) * q_full, r_full = qr(a, full_matrices=True) * - * - * @param data type for {@code q} output */ +@OpMetadata( + opType = Qr.OP_NAME, + inputsClass = Qr.Inputs.class +) @Operator( group = "linalg" ) @@ -57,8 +65,8 @@ public final class Qr extends RawOp { private Output r; - private Qr(Operation operation) { - super(operation); + public Qr(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; q = operation.output(outputIdx++); r = operation.output(outputIdx++); @@ -143,4 +151,34 @@ public Options fullMatrices(Boolean fullMatrices) { return this; } } + + @OpInputsMetadata( + outputsClass = Qr.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions + * form matrices of size {@code [M, N]}. Let {@code P} be the minimum of {@code M} and {@code N}. + */ + public final Operand input; + + /** + * If true, compute full-sized {@code q} and {@code r}. If false + * (the default), compute only the leading {@code P} columns of {@code q}. + */ + public final boolean fullMatrices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Qr<>(op), op, Arrays.asList("full_matrices", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fullMatrices = op.attributes().getAttrBool("full_matrices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java index 3f8fae35715..d3136668a39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ * {@code a} (after being transposed if {@code transpose_a} is non-zero) must match the * outer dimension of {@code b} (after being transposed if {@code transposed_b} is * non-zero). - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMul.OP_NAME, + inputsClass = QuantizedMatMul.Inputs.class +) @Operator( group = "linalg" ) @@ -53,8 +61,8 @@ public final class QuantizedMatMul extends RawOp { private Output maxOut; - private QuantizedMatMul(Operation operation) { - super(operation); + public QuantizedMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -71,7 +79,7 @@ private QuantizedMatMul(Operation operation) { * @param maxA The float value that the highest quantized {@code a} value represents. * @param minB The float value that the lowest quantized {@code b} value represents. * @param maxB The float value that the highest quantized {@code b} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param Tactivation The type of output produced by activation function * following this operation. * @param options carries optional attribute values @@ -188,4 +196,87 @@ public Options transposeB(Boolean transposeB) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a two-dimensional tensor. + */ + public final Operand a; + + /** + * Must be a two-dimensional tensor. + */ + public final Operand b; + + /** + * The float value that the lowest quantized {@code a} value represents. + */ + public final Operand minA; + + /** + * The float value that the highest quantized {@code a} value represents. + */ + public final Operand maxA; + + /** + * The float value that the lowest quantized {@code b} value represents. + */ + public final Operand minB; + + /** + * The float value that the highest quantized {@code b} value represents. + */ + public final Operand maxB; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * If true, {@code a} is transposed before multiplication. + */ + public final boolean transposeA; + + /** + * If true, {@code b} is transposed before multiplication. + */ + public final boolean transposeB; + + /** + * The type of output produced by activation function + * following this operation. + */ + public final DataType Tactivation; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMul<>(op), op, Arrays.asList("T1", "T2", "Toutput", "transpose_a", "transpose_b", "Tactivation")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + Tactivation = op.attributes().getAttrType("Tactivation"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java index c7af6356a65..0cc43361bf4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -36,9 +43,14 @@ * match the outer dimension of {@code b} (after being transposed if {@code transposed_b} is * non-zero). Then do broadcast add operation with bias values on the matrix * multiplication result. The bias size must match inner dimension of {@code b}. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMulWithBias.OP_NAME, + inputsClass = QuantizedMatMulWithBias.Inputs.class +) +@Operator( + group = "linalg" +) public final class QuantizedMatMulWithBias extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -51,8 +63,8 @@ public final class QuantizedMatMulWithBias extends RawOp { private Output maxOut; - private QuantizedMatMulWithBias(Operation operation) { - super(operation); + public QuantizedMatMulWithBias(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -71,7 +83,7 @@ private QuantizedMatMulWithBias(Operation operation) { * @param maxA The float value that the highest quantized {@code a} value represents. * @param minB The float value that the lowest quantized {@code b} value represents. * @param maxB The float value that the highest quantized {@code b} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param options carries optional attribute values * @param data type for {@code QuantizedMatMulWithBias} output and operands * @return a new instance of QuantizedMatMulWithBias @@ -211,4 +223,99 @@ public Options inputQuantMode(String inputQuantMode) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMulWithBias.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + */ + public final Operand a; + + /** + * A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + */ + public final Operand b; + + /** + * A 1D bias tensor with size matching inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + */ + public final Operand bias; + + /** + * The float value that the lowest quantized {@code a} value represents. + */ + public final Operand minA; + + /** + * The float value that the highest quantized {@code a} value represents. + */ + public final Operand maxA; + + /** + * The float value that the lowest quantized {@code b} value represents. + */ + public final Operand minB; + + /** + * The float value that the highest quantized {@code b} value represents. + */ + public final Operand maxB; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * If true, {@code a} is transposed before multiplication. + */ + public final boolean transposeA; + + /** + * If true, {@code b} is transposed before multiplication. + */ + public final boolean transposeB; + + /** + * Input data quantization mode. Either MIN_FIRST(default) or SCALED. + */ + public final String inputQuantMode; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMulWithBias<>(op), op, Arrays.asList("T1", "T2", "Tbias", "Toutput", "transpose_a", "transpose_b", "input_quant_mode")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Tbias = op.attributes().getAttrType("Tbias"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + inputQuantMode = op.attributes().getAttrString("input_quant_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java index 7b5d8f0d05f..eee116597b9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -37,9 +44,14 @@ * non-zero). Then do broadcast add operation with bias values on the matrix * multiplication result. The bias size must match inner dimension of {@code b}. Then do * relu activation to get non-negative result. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMulWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndRelu.Inputs.class +) +@Operator( + group = "linalg" +) public final class QuantizedMatMulWithBiasAndRelu extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -52,8 +64,8 @@ public final class QuantizedMatMulWithBiasAndRelu extends Raw private Output maxOut; - private QuantizedMatMulWithBiasAndRelu(Operation operation) { - super(operation); + public QuantizedMatMulWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -72,7 +84,7 @@ private QuantizedMatMulWithBiasAndRelu(Operation operation) { * @param maxA The float value that the highest quantized {@code a} value represents. * @param minB The float value that the lowest quantized {@code b} value represents. * @param maxB The float value that the highest quantized {@code b} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param options carries optional attribute values * @param data type for {@code QuantizedMatMulWithBiasAndRelu} output and operands * @return a new instance of QuantizedMatMulWithBiasAndRelu @@ -212,4 +224,93 @@ public Options inputQuantMode(String inputQuantMode) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMulWithBiasAndRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + */ + public final Operand a; + + /** + * A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + */ + public final Operand b; + + /** + * A 1D bias tensor with size matching with inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + */ + public final Operand bias; + + /** + * The float value that the lowest quantized {@code a} value represents. + */ + public final Operand minA; + + /** + * The float value that the highest quantized {@code a} value represents. + */ + public final Operand maxA; + + /** + * The float value that the lowest quantized {@code b} value represents. + */ + public final Operand minB; + + /** + * The float value that the highest quantized {@code b} value represents. + */ + public final Operand maxB; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * If true, {@code a} is transposed before multiplication. + */ + public final boolean transposeA; + + /** + * If true, {@code b} is transposed before multiplication. + */ + public final boolean transposeB; + + /** + * Input data quantization mode. Either MIN_FIRST(default) or SCALED. + */ + public final String inputQuantMode; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMulWithBiasAndRelu<>(op), op, Arrays.asList("T1", "T2", "Toutput", "transpose_a", "transpose_b", "input_quant_mode")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + inputQuantMode = op.attributes().getAttrString("input_quant_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java index 22e29864166..82bdde439f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -38,9 +45,14 @@ * multiplication result. The bias size must match inner dimension of {@code b}. Then do * relu activation to get non-negative result. Then do requantize operation to get * final uint8 result. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMulWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "linalg" +) public final class QuantizedMatMulWithBiasAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +65,8 @@ public final class QuantizedMatMulWithBiasAndReluAndRequantize maxOut; - private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -74,8 +86,8 @@ private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { * @param minB The float value that the lowest quantized {@code b} value represents. * @param maxB The float value that the highest quantized {@code b} value represents. * @param minFreezedOutput The float value that the highest quantized output value after requantize. - * @param maxFreezedOutput the maxFreezedOutput value - * @param Toutput the value of the Toutput property + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute * @param options carries optional attribute values * @param data type for {@code QuantizedMatMulWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndReluAndRequantize @@ -218,4 +230,111 @@ public Options inputQuantMode(String inputQuantMode) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMulWithBiasAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A matrix to be multiplied. Must be a two-dimensional tensor of type {@code quint8}. + */ + public final Operand a; + + /** + * A matrix to be multiplied and must be a two-dimensional tensor of type {@code qint8}. + */ + public final Operand b; + + /** + * A 1D bias tensor with size matching with inner dimension of {@code b} (after being + * transposed if {@code transposed_b} is non-zero). + */ + public final Operand bias; + + /** + * The float value that the lowest quantized {@code a} value represents. + */ + public final Operand minA; + + /** + * The float value that the highest quantized {@code a} value represents. + */ + public final Operand maxA; + + /** + * The float value that the lowest quantized {@code b} value represents. + */ + public final Operand minB; + + /** + * The float value that the highest quantized {@code b} value represents. + */ + public final Operand maxB; + + /** + * The float value that the highest quantized output value after requantize. + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * If true, {@code a} is transposed before multiplication. + */ + public final boolean transposeA; + + /** + * If true, {@code b} is transposed before multiplication. + */ + public final boolean transposeB; + + /** + * Input data quantization mode. Either MIN_FIRST(default) or SCALED. + */ + public final String inputQuantMode; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMulWithBiasAndReluAndRequantize<>(op), op, Arrays.asList("T1", "T2", "Tbias", "Toutput", "transpose_a", "transpose_b", "input_quant_mode")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Tbias = op.attributes().getAttrType("Tbias"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + inputQuantMode = op.attributes().getAttrString("input_quant_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java index d2c93e69887..75c06a99f2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +45,11 @@ * e, v = self_adjoint_eig(a) * e = self_adjoint_eig(a, compute_v=False) * - * - * @param data type for {@code e} output */ +@OpMetadata( + opType = SelfAdjointEig.OP_NAME, + inputsClass = SelfAdjointEig.Inputs.class +) @Operator( group = "linalg" ) @@ -55,8 +63,8 @@ public final class SelfAdjointEig extends RawOp { private Output v; - private SelfAdjointEig(Operation operation) { - super(operation); + public SelfAdjointEig(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; e = operation.output(outputIdx++); v = operation.output(outputIdx++); @@ -138,4 +146,33 @@ public Options computeV(Boolean computeV) { return this; } } + + @OpInputsMetadata( + outputsClass = SelfAdjointEig.class + ) + public static class Inputs extends RawOpInputs> { + /** + * {@code Tensor} input of shape {@code [N, N]}. + */ + public final Operand input; + + /** + * If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + */ + public final boolean computeV; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SelfAdjointEig<>(op), op, Arrays.asList("compute_v", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + computeV = op.attributes().getAttrBool("compute_v"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java index 42731f6edf4..d1057183227 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * satisfies {@code matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]}. * If {@code adjoint} is {@code True} then each output matrix satisfies * {@code adjoint(matrix[..., :, :]) * output[..., :, :] = rhs[..., :, :]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Solve.OP_NAME, + inputsClass = Solve.Inputs.class +) @Operator( group = "linalg" ) @@ -49,8 +57,8 @@ public final class Solve extends RawOp implements Operand { private Output output; - private Solve(Operation operation) { - super(operation); + public Solve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -129,4 +137,39 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = Solve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand matrix; + + /** + * Shape is {@code [..., M, K]}. + */ + public final Operand rhs; + + /** + * Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Solve<>(op), op, Arrays.asList("adjoint", "T")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java index 9dfa820a4da..cf48c52605a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +47,11 @@ *

    The input is a tensor of shape {@code [..., M, M]} whose inner-most 2 dimensions * form square matrices. The output is a tensor of the same shape as the input * containing the matrix square root for all input submatrices {@code [..., :, :]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Sqrtm.OP_NAME, + inputsClass = Sqrtm.Inputs.class +) @Operator( group = "linalg" ) @@ -55,8 +63,8 @@ public final class Sqrtm extends RawOp implements Operand { private Output output; - private Sqrtm(Operation operation) { - super(operation); + public Sqrtm(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -94,4 +102,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Sqrtm.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sqrtm<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java index 2314f25ec56..b11eafdccfc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +45,11 @@ * s, u, v = svd(a) * s, _, _ = svd(a, compute_uv=False) * - * - * @param data type for {@code s} output */ +@OpMetadata( + opType = Svd.OP_NAME, + inputsClass = Svd.Inputs.class +) @Operator( group = "linalg" ) @@ -57,8 +65,8 @@ public final class Svd extends RawOp { private Output v; - private Svd(Operation operation) { - super(operation); + public Svd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; s = operation.output(outputIdx++); u = operation.output(outputIdx++); @@ -186,4 +194,43 @@ public Options fullMatrices(Boolean fullMatrices) { return this; } } + + @OpInputsMetadata( + outputsClass = Svd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor of shape {@code [..., M, N]} whose inner-most 2 dimensions + * form matrices of size {@code [M, N]}. Let {@code P} be the minimum of {@code M} and {@code N}. + */ + public final Operand input; + + /** + * If true, left and right singular vectors will be + * computed and returned in {@code u} and {@code v}, respectively. + * If false, {@code u} and {@code v} are not set and should never referenced. + */ + public final boolean computeUv; + + /** + * If true, compute full-sized {@code u} and {@code v}. If false + * (the default), compute only the leading {@code P} singular vectors. + * Ignored if {@code compute_uv} is {@code False}. + */ + public final boolean fullMatrices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Svd<>(op), op, Arrays.asList("compute_uv", "full_matrices", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + computeUv = op.attributes().getAttrBool("compute_uv"); + fullMatrices = op.attributes().getAttrBool("full_matrices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java index 5a4037cd396..69ee9258392 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -42,9 +48,11 @@ * [0, 0, 3, 0] * [0, 0, 0, 4]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TensorDiag.OP_NAME, + inputsClass = TensorDiag.Inputs.class +) @Operator( group = "linalg" ) @@ -56,8 +64,8 @@ public final class TensorDiag extends RawOp implements Operand< private Output output; - private TensorDiag(Operation operation) { - super(operation); + public TensorDiag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -92,4 +100,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TensorDiag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank k tensor where k is at most 1. + */ + public final Operand diagonal; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorDiag<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + diagonal = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java index ddcc97d638b..838a036f84b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -43,9 +49,11 @@ * * tf.diag_part(input) ==> [1, 2, 3, 4] * - * - * @param data type for {@code diagonal} output */ +@OpMetadata( + opType = TensorDiagPart.OP_NAME, + inputsClass = TensorDiagPart.Inputs.class +) @Operator( group = "linalg" ) @@ -57,8 +65,8 @@ public final class TensorDiagPart extends RawOp implements Oper private Output diagonal; - private TensorDiagPart(Operation operation) { - super(operation); + public TensorDiagPart(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; diagonal = operation.output(outputIdx++); } @@ -93,4 +101,26 @@ public Output diagonal() { public Output asOutput() { return diagonal; } + + @OpInputsMetadata( + outputsClass = TensorDiagPart.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Rank k tensor where k is even and not zero. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorDiagPart<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java index 1df128d376d..712576c0989 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,9 +38,11 @@ * Shuffle dimensions of x according to a permutation. * The output {@code y} has the same rank as {@code x}. The shapes of {@code x} and {@code y} satisfy: * {@code y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]} - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Transpose.OP_NAME, + inputsClass = Transpose.Inputs.class +) @Operator( group = "linalg" ) @@ -46,8 +54,8 @@ public final class Transpose extends RawOp implements Operand y; - private Transpose(Operation operation) { - super(operation); + public Transpose(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -56,8 +64,8 @@ private Transpose(Operation operation) { * Factory method to create a class wrapping a new Transpose operation. * * @param scope current scope - * @param x the x value - * @param perm the perm value + * @param x The x value + * @param perm The perm value * @param data type for {@code Transpose} output and operands * @return a new instance of Transpose */ @@ -85,4 +93,38 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Transpose.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The perm input + */ + public final Operand perm; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tperm attribute + */ + public final DataType Tperm; + + public Inputs(GraphOperation op) { + super(new Transpose<>(op), op, Arrays.asList("T", "Tperm")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + perm = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tperm = op.attributes().getAttrType("Tperm"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java index 6b44f83ab59..026fbfb70bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -71,9 +77,11 @@ * # [4. ], * # [1.9999999]], dtype=float32)> * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TriangularSolve.OP_NAME, + inputsClass = TriangularSolve.Inputs.class +) @Operator( group = "linalg" ) @@ -85,8 +93,8 @@ public final class TriangularSolve extends RawOp implements Ope private Output output; - private TriangularSolve(Operation operation) { - super(operation); + public TriangularSolve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -199,4 +207,49 @@ public Options adjoint(Boolean adjoint) { return this; } } + + @OpInputsMetadata( + outputsClass = TriangularSolve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape is {@code [..., M, M]}. + */ + public final Operand matrix; + + /** + * Shape is {@code [..., M, K]}. + */ + public final Operand rhs; + + /** + * Boolean indicating whether the innermost matrices in {@code matrix} are + * lower or upper triangular. + */ + public final boolean lower; + + /** + * Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + *

    {@literal @}compatibility(numpy)
    + * Equivalent to scipy.linalg.solve_triangular + *
    {@literal @}end_compatibility + */ + public final boolean adjoint; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TriangularSolve<>(op), op, Arrays.asList("lower", "adjoint", "T")); + int inputIndex = 0; + matrix = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lower = op.attributes().getAttrBool("lower"); + adjoint = op.attributes().getAttrBool("adjoint"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java index a43a50262a2..a6122dabc83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Calculate product with tridiagonal matrix. * Calculates product of two matrices, where left matrix is a tridiagonal matrix. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TridiagonalMatMul.OP_NAME, + inputsClass = TridiagonalMatMul.Inputs.class +) +@Operator( + group = "linalg" +) public final class TridiagonalMatMul extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class TridiagonalMatMul extends RawOp implements O private Output output; - private TridiagonalMatMul(Operation operation) { - super(operation); + public TridiagonalMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -87,4 +99,48 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TridiagonalMatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of shape {@code [..., 1, M]}, representing superdiagonals of + * tri-diagonal matrices to the left of multiplication. Last element is ignored. + */ + public final Operand superdiag; + + /** + * Tensor of shape {@code [..., 1, M]}, representing main diagonals of tri-diagonal + * matrices to the left of multiplication. + */ + public final Operand maindiag; + + /** + * Tensor of shape {@code [..., 1, M]}, representing subdiagonals of tri-diagonal + * matrices to the left of multiplication. First element is ignored. + */ + public final Operand subdiag; + + /** + * Tensor of shape {@code [..., M, N]}, representing MxN matrices to the right of + * multiplication. + */ + public final Operand rhs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TridiagonalMatMul<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + superdiag = (Operand) op.input(inputIndex++); + maindiag = (Operand) op.input(inputIndex++); + subdiag = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java index da22a9d990e..6b0a890d12e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.linalg; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +42,14 @@ * pivoting, depending on {@code partial_pivoting} attribute. On GPU, Nvidia's cuSPARSE * library is used: https://docs.nvidia.com/cuda/cusparse/index.html#gtsv * Partial pivoting is not yet supported by XLA backends. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TridiagonalSolve.OP_NAME, + inputsClass = TridiagonalSolve.Inputs.class +) +@Operator( + group = "linalg" +) public final class TridiagonalSolve extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class TridiagonalSolve extends RawOp implements Op private Output output; - private TridiagonalSolve(Operation operation) { - super(operation); + public TridiagonalSolve(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -156,4 +168,49 @@ public Options perturbSingular(Boolean perturbSingular) { return this; } } + + @OpInputsMetadata( + outputsClass = TridiagonalSolve.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of shape {@code [..., 3, M]} whose innermost 2 dimensions represent the + * tridiagonal matrices with three rows being the superdiagonal, diagonals, and + * subdiagonals, in order. The last element of the superdiagonal and the first + * element of the subdiagonal is ignored. + */ + public final Operand diagonals; + + /** + * Tensor of shape {@code [..., M, K]}, representing K right-hand sides per each + * left-hand side. + */ + public final Operand rhs; + + /** + * Whether to apply partial pivoting. Partial pivoting makes the procedure more + * stable, but slower. + */ + public final boolean partialPivoting; + + /** + * The perturbSingular attribute + */ + public final boolean perturbSingular; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TridiagonalSolve<>(op), op, Arrays.asList("partial_pivoting", "perturb_singular", "T")); + int inputIndex = 0; + diagonals = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + partialPivoting = op.attributes().getAttrBool("partial_pivoting"); + perturbSingular = op.attributes().getAttrBool("perturb_singular"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java index ed9ea8f002d..7fd47c7c6f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -32,9 +39,14 @@ * Reads out the CSR components at batch {@code index}. * This op is meant only for debugging / testing, and its interface is not expected * to be stable. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = CSRSparseMatrixComponents.OP_NAME, + inputsClass = CSRSparseMatrixComponents.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class CSRSparseMatrixComponents extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +59,8 @@ public final class CSRSparseMatrixComponents extends RawOp { private Output values; - private CSRSparseMatrixComponents(Operation operation) { - super(operation); + public CSRSparseMatrixComponents(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; rowPtrs = operation.output(outputIdx++); colInds = operation.output(outputIdx++); @@ -61,7 +73,7 @@ private CSRSparseMatrixComponents(Operation operation) { * @param scope current scope * @param csrSparseMatrix A batched CSRSparseMatrix. * @param index The index in {@code csr_sparse_matrix}'s batch. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code CSRSparseMatrixComponents} output and operands * @return a new instance of CSRSparseMatrixComponents */ @@ -103,4 +115,32 @@ public Output colInds() { public Output values() { return values; } + + @OpInputsMetadata( + outputsClass = CSRSparseMatrixComponents.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A batched CSRSparseMatrix. + */ + public final Operand csrSparseMatrix; + + /** + * The index in {@code csr_sparse_matrix}'s batch. + */ + public final Operand index; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new CSRSparseMatrixComponents<>(op), op, Arrays.asList("type")); + int inputIndex = 0; + csrSparseMatrix = (Operand) op.input(inputIndex++); + index = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java index 1eab3760775..97fb87d7250 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Convert a (possibly batched) CSRSparseMatrix to dense. - * - * @param data type for {@code dense_output} output */ +@OpMetadata( + opType = CSRSparseMatrixToDense.OP_NAME, + inputsClass = CSRSparseMatrixToDense.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class CSRSparseMatrixToDense extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class CSRSparseMatrixToDense extends RawOp impleme private Output denseOutput; - private CSRSparseMatrixToDense(Operation operation) { - super(operation); + public CSRSparseMatrixToDense(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; denseOutput = operation.output(outputIdx++); } @@ -51,7 +63,7 @@ private CSRSparseMatrixToDense(Operation operation) { * * @param scope current scope * @param sparseInput A batched CSRSparseMatrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code CSRSparseMatrixToDense} output and operands * @return a new instance of CSRSparseMatrixToDense */ @@ -79,4 +91,26 @@ public Output denseOutput() { public Output asOutput() { return denseOutput; } + + @OpInputsMetadata( + outputsClass = CSRSparseMatrixToDense.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A batched CSRSparseMatrix. + */ + public final Operand sparseInput; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new CSRSparseMatrixToDense<>(op), op, Arrays.asList("type")); + int inputIndex = 0; + sparseInput = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java index ec0efb39f90..ad365783cea 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Converts a (possibly batched) CSRSparesMatrix to a SparseTensor. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = CSRSparseMatrixToSparseTensor.OP_NAME, + inputsClass = CSRSparseMatrixToSparseTensor.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class CSRSparseMatrixToSparseTensor extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class CSRSparseMatrixToSparseTensor extends RawOp private Output denseShape; - private CSRSparseMatrixToSparseTensor(Operation operation) { - super(operation); + public CSRSparseMatrixToSparseTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; indices = operation.output(outputIdx++); values = operation.output(outputIdx++); @@ -58,7 +70,7 @@ private CSRSparseMatrixToSparseTensor(Operation operation) { * * @param scope current scope * @param sparseMatrix A (possibly batched) CSRSparseMatrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code CSRSparseMatrixToSparseTensor} output and operands * @return a new instance of CSRSparseMatrixToSparseTensor */ @@ -99,4 +111,26 @@ public Output values() { public Output denseShape() { return denseShape; } + + @OpInputsMetadata( + outputsClass = CSRSparseMatrixToSparseTensor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A (possibly batched) CSRSparseMatrix. + */ + public final Operand sparseMatrix; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new CSRSparseMatrixToSparseTensor<>(op), op, Arrays.asList("type")); + int inputIndex = 0; + sparseMatrix = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java index e1d3794be5a..dfd4cdefccc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,33 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Converts a dense tensor to a (possibly batched) CSRSparseMatrix. */ +@OpMetadata( + opType = DenseToCSRSparseMatrix.OP_NAME, + inputsClass = DenseToCSRSparseMatrix.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class DenseToCSRSparseMatrix extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +53,8 @@ public final class DenseToCSRSparseMatrix extends RawOp implements Operand sparseOutput; @SuppressWarnings("unchecked") - private DenseToCSRSparseMatrix(Operation operation) { - super(operation); + public DenseToCSRSparseMatrix(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseOutput = operation.output(outputIdx++); } @@ -78,4 +92,32 @@ public Output sparseOutput() { public Output asOutput() { return (Output) sparseOutput; } + + @OpInputsMetadata( + outputsClass = DenseToCSRSparseMatrix.class + ) + public static class Inputs extends RawOpInputs { + /** + * A Dense tensor. + */ + public final Operand denseInput; + + /** + * Indices of nonzero elements. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DenseToCSRSparseMatrix(op), op, Arrays.asList("T")); + int inputIndex = 0; + denseInput = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java index 2dbacec3ded..fab4f97ab71 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +38,13 @@ * The gradients of SparseMatrixAdd outputs with respect to alpha and beta are not * currently defined (TensorFlow will return zeros for these entries). */ +@OpMetadata( + opType = SparseMatrixAdd.OP_NAME, + inputsClass = SparseMatrixAdd.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixAdd extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +54,8 @@ public final class SparseMatrixAdd extends RawOp implements Operand { private Output c; @SuppressWarnings("unchecked") - private SparseMatrixAdd(Operation operation) { - super(operation); + public SparseMatrixAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; c = operation.output(outputIdx++); } @@ -84,4 +98,44 @@ public Output c() { public Output asOutput() { return (Output) c; } + + @OpInputsMetadata( + outputsClass = SparseMatrixAdd.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand a; + + /** + * A CSRSparseMatrix. + */ + public final Operand b; + + /** + * A constant scalar. + */ + public final Operand alpha; + + /** + * A constant scalar. + */ + public final Operand beta; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseMatrixAdd(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java index c59e026a0a5..5d9ed9bbbf2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -49,9 +56,14 @@ * C = conjugate(transpose(A . B)) = conjugate(transpose(B)) . * conjugate(transpose(A)) * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseMatrixMatMul.OP_NAME, + inputsClass = SparseMatrixMatMul.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixMatMul extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -60,8 +72,8 @@ public final class SparseMatrixMatMul extends RawOp implements private Output output; - private SparseMatrixMatMul(Operation operation) { - super(operation); + public SparseMatrixMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -268,4 +280,68 @@ public Options conjugateOutput(Boolean conjugateOutput) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseMatrixMatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A CSRSparseMatrix. + */ + public final Operand a; + + /** + * A dense tensor. + */ + public final Operand b; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Indicates whether {@code a} should be transposed. + */ + public final boolean transposeA; + + /** + * Indicates whether {@code b} should be transposed. + */ + public final boolean transposeB; + + /** + * Indicates whether {@code a} should be conjugate-transposed. + */ + public final boolean adjointA; + + /** + * Indicates whether {@code b} should be conjugate-transposed. + */ + public final boolean adjointB; + + /** + * Transposes the product of {@code a} and {@code b}. + */ + public final boolean transposeOutput; + + /** + * Conjugates the product of {@code a} and {@code b}. + */ + public final boolean conjugateOutput; + + public Inputs(GraphOperation op) { + super(new SparseMatrixMatMul<>(op), op, Arrays.asList("T", "transpose_a", "transpose_b", "adjoint_a", "adjoint_b", "transpose_output", "conjugate_output")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + adjointA = op.attributes().getAttrBool("adjoint_a"); + adjointB = op.attributes().getAttrBool("adjoint_b"); + transposeOutput = op.attributes().getAttrBool("transpose_output"); + conjugateOutput = op.attributes().getAttrBool("conjugate_output"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java index bfe5470377b..8b5a5e779c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,6 +42,13 @@ *

    NOTE even if {@code b} is zero, the sparsity structure of the output does not * change. */ +@OpMetadata( + opType = SparseMatrixMul.OP_NAME, + inputsClass = SparseMatrixMul.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixMul extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +58,8 @@ public final class SparseMatrixMul extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private SparseMatrixMul(Operation operation) { - super(operation); + public SparseMatrixMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,4 +97,32 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = SparseMatrixMul.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand a; + + /** + * A dense tensor. + */ + public final Operand b; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseMatrixMul(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java index ec8f88c871c..2499a1060fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Returns the number of nonzeroes of {@code sparse_matrix}. */ +@OpMetadata( + opType = SparseMatrixNNZ.OP_NAME, + inputsClass = SparseMatrixNNZ.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixNNZ extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class SparseMatrixNNZ extends RawOp implements Operand { private Output nnz; - private SparseMatrixNNZ(Operation operation) { - super(operation); + public SparseMatrixNNZ(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; nnz = operation.output(outputIdx++); } @@ -73,4 +86,20 @@ public Output nnz() { public Output asOutput() { return nnz; } + + @OpInputsMetadata( + outputsClass = SparseMatrixNNZ.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand sparseMatrix; + + public Inputs(GraphOperation op) { + super(new SparseMatrixNNZ(op), op, Arrays.asList()); + int inputIndex = 0; + sparseMatrix = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java index 044f77cd7ea..d9287ea0611 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -71,6 +77,13 @@ *

    {@code ordering_amd_value} stores the AMD ordering: {@code [1 2 3 0]}. *

    input: A {@code CSRSparseMatrix}. */ +@OpMetadata( + opType = SparseMatrixOrderingAMD.OP_NAME, + inputsClass = SparseMatrixOrderingAMD.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixOrderingAMD extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -79,8 +92,8 @@ public final class SparseMatrixOrderingAMD extends RawOp implements Operand output; - private SparseMatrixOrderingAMD(Operation operation) { - super(operation); + public SparseMatrixOrderingAMD(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -114,4 +127,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseMatrixOrderingAMD.class + ) + public static class Inputs extends RawOpInputs { + /** + * A {@code CSRSparseMatrix}. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new SparseMatrixOrderingAMD(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java index ff71d3a1e0e..35bd0313c79 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,6 +42,13 @@ * the output has the same sparsity structure as the input (though missing values * in the output may now be treated as having probability zero). */ +@OpMetadata( + opType = SparseMatrixSoftmax.OP_NAME, + inputsClass = SparseMatrixSoftmax.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixSoftmax extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +58,8 @@ public final class SparseMatrixSoftmax extends RawOp implements Operand { private Output softmax; @SuppressWarnings("unchecked") - private SparseMatrixSoftmax(Operation operation) { - super(operation); + public SparseMatrixSoftmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; softmax = operation.output(outputIdx++); } @@ -55,7 +69,7 @@ private SparseMatrixSoftmax(Operation operation) { * * @param scope current scope * @param logits A CSRSparseMatrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code SparseMatrixSoftmax} output and operands * @return a new instance of SparseMatrixSoftmax */ @@ -84,4 +98,26 @@ public Output softmax() { public Output asOutput() { return (Output) softmax; } + + @OpInputsMetadata( + outputsClass = SparseMatrixSoftmax.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand logits; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new SparseMatrixSoftmax(op), op, Arrays.asList("type")); + int inputIndex = 0; + logits = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java index f5d48cd58d0..0dba5334bcb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,34 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Calculates the gradient of the SparseMatrixSoftmax op. */ +@OpMetadata( + opType = SparseMatrixSoftmaxGrad.OP_NAME, + inputsClass = SparseMatrixSoftmaxGrad.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixSoftmaxGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +54,8 @@ public final class SparseMatrixSoftmaxGrad extends RawOp implements Operand gradient; @SuppressWarnings("unchecked") - private SparseMatrixSoftmaxGrad(Operation operation) { - super(operation); + public SparseMatrixSoftmaxGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; gradient = operation.output(outputIdx++); } @@ -52,7 +66,7 @@ private SparseMatrixSoftmaxGrad(Operation operation) { * @param scope current scope * @param softmax A CSRSparseMatrix. * @param gradSoftmax The gradient of {@code softmax}. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code SparseMatrixSoftmaxGrad} output and operands * @return a new instance of SparseMatrixSoftmaxGrad */ @@ -82,4 +96,32 @@ public Output gradient() { public Output asOutput() { return (Output) gradient; } + + @OpInputsMetadata( + outputsClass = SparseMatrixSoftmaxGrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand softmax; + + /** + * The gradient of {@code softmax}. + */ + public final Operand gradSoftmax; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new SparseMatrixSoftmaxGrad(op), op, Arrays.asList("type")); + int inputIndex = 0; + softmax = (Operand) op.input(inputIndex++); + gradSoftmax = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java index 854d7714176..6542ed2c6cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -95,6 +102,13 @@ * permutation: A {@code Tensor}. * type: The type of {@code input}. */ +@OpMetadata( + opType = SparseMatrixSparseCholesky.OP_NAME, + inputsClass = SparseMatrixSparseCholesky.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixSparseCholesky extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -104,8 +118,8 @@ public final class SparseMatrixSparseCholesky extends RawOp implements Operand output; @SuppressWarnings("unchecked") - private SparseMatrixSparseCholesky(Operation operation) { - super(operation); + public SparseMatrixSparseCholesky(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -116,7 +130,7 @@ private SparseMatrixSparseCholesky(Operation operation) { * @param scope current scope * @param input A {@code CSRSparseMatrix}. * @param permutation A fill-in reducing permutation matrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code SparseMatrixSparseCholesky} output and operands * @return a new instance of SparseMatrixSparseCholesky */ @@ -146,4 +160,32 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = SparseMatrixSparseCholesky.class + ) + public static class Inputs extends RawOpInputs { + /** + * A {@code CSRSparseMatrix}. + */ + public final Operand input; + + /** + * A fill-in reducing permutation matrix. + */ + public final Operand permutation; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new SparseMatrixSparseCholesky(op), op, Arrays.asList("type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + permutation = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java index 052bcd4aaeb..0c7e049a352 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -96,6 +103,13 @@ * adjoint_a: If True, {@code a} adjointed before multiplication. * adjoint_b: If True, {@code b} adjointed before multiplication. */ +@OpMetadata( + opType = SparseMatrixSparseMatMul.OP_NAME, + inputsClass = SparseMatrixSparseMatMul.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixSparseMatMul extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -105,8 +119,8 @@ public final class SparseMatrixSparseMatMul extends RawOp implements Operand c; @SuppressWarnings("unchecked") - private SparseMatrixSparseMatMul(Operation operation) { - super(operation); + public SparseMatrixSparseMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; c = operation.output(outputIdx++); } @@ -117,7 +131,7 @@ private SparseMatrixSparseMatMul(Operation operation) { * @param scope current scope * @param a A CSRSparseMatrix. * @param b A CSRSparseMatrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param options carries optional attribute values * @param data type for {@code SparseMatrixSparseMatMul} output and operands * @return a new instance of SparseMatrixSparseMatMul @@ -264,4 +278,56 @@ public Options adjointB(Boolean adjointB) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseMatrixSparseMatMul.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand a; + + /** + * A CSRSparseMatrix. + */ + public final Operand b; + + /** + * The type attribute + */ + public final DataType type; + + /** + * Indicates whether {@code a} should be transposed. + */ + public final boolean transposeA; + + /** + * Indicates whether {@code b} should be transposed. + */ + public final boolean transposeB; + + /** + * Indicates whether {@code a} should be conjugate-transposed. + */ + public final boolean adjointA; + + /** + * Indicates whether {@code b} should be conjugate-transposed. + */ + public final boolean adjointB; + + public Inputs(GraphOperation op) { + super(new SparseMatrixSparseMatMul(op), op, Arrays.asList("type", "transpose_a", "transpose_b", "adjoint_a", "adjoint_b")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + adjointA = op.attributes().getAttrBool("adjoint_a"); + adjointB = op.attributes().getAttrBool("adjoint_b"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java index 510d784415f..783fb5c2ebc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +39,13 @@ * Transposes the inner (matrix) dimensions of a SparseMatrix and optionally * conjugates its values. */ +@OpMetadata( + opType = SparseMatrixTranspose.OP_NAME, + inputsClass = SparseMatrixTranspose.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixTranspose extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +55,8 @@ public final class SparseMatrixTranspose extends RawOp implements Operand private Output output; @SuppressWarnings("unchecked") - private SparseMatrixTranspose(Operation operation) { - super(operation); + public SparseMatrixTranspose(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +66,7 @@ private SparseMatrixTranspose(Operation operation) { * * @param scope current scope * @param input A CSRSparseMatrix. - * @param type the value of the type property + * @param type The value of the type attribute * @param options carries optional attribute values * @param data type for {@code SparseMatrixTranspose} output and operands * @return a new instance of SparseMatrixTranspose @@ -120,4 +134,32 @@ public Options conjugate(Boolean conjugate) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseMatrixTranspose.class + ) + public static class Inputs extends RawOpInputs { + /** + * A CSRSparseMatrix. + */ + public final Operand input; + + /** + * Indicates whether {@code input} should be conjugated. + */ + public final boolean conjugate; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new SparseMatrixTranspose(op), op, Arrays.asList("conjugate", "type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + conjugate = op.attributes().getAttrBool("conjugate"); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java index 13439e2a49e..7e4fecb5c60 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,34 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates an all-zeros CSRSparseMatrix with shape {@code dense_shape}. */ +@OpMetadata( + opType = SparseMatrixZeros.OP_NAME, + inputsClass = SparseMatrixZeros.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseMatrixZeros extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +54,8 @@ public final class SparseMatrixZeros extends RawOp implements Operand { private Output sparseMatrix; @SuppressWarnings("unchecked") - private SparseMatrixZeros(Operation operation) { - super(operation); + public SparseMatrixZeros(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseMatrix = operation.output(outputIdx++); } @@ -51,7 +65,7 @@ private SparseMatrixZeros(Operation operation) { * * @param scope current scope * @param denseShape The desired matrix shape. - * @param type the value of the type property + * @param type The value of the type attribute * @param data type for {@code SparseMatrixZeros} output and operands * @return a new instance of SparseMatrixZeros */ @@ -80,4 +94,26 @@ public Output sparseMatrix() { public Output asOutput() { return (Output) sparseMatrix; } + + @OpInputsMetadata( + outputsClass = SparseMatrixZeros.class + ) + public static class Inputs extends RawOpInputs { + /** + * The desired matrix shape. + */ + public final Operand denseShape; + + /** + * The type attribute + */ + public final DataType type; + + public Inputs(GraphOperation op) { + super(new SparseMatrixZeros(op), op, Arrays.asList("type")); + int inputIndex = 0; + denseShape = (Operand) op.input(inputIndex++); + type = op.attributes().getAttrType("type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java index b9d3aebaa6e..cec991e5159 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,33 @@ package org.tensorflow.op.linalg.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Converts a SparseTensor to a (possibly batched) CSRSparseMatrix. */ +@OpMetadata( + opType = SparseTensorToCSRSparseMatrix.OP_NAME, + inputsClass = SparseTensorToCSRSparseMatrix.Inputs.class +) +@Operator( + group = "linalg.sparse" +) public final class SparseTensorToCSRSparseMatrix extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +53,8 @@ public final class SparseTensorToCSRSparseMatrix extends RawOp implements Operan private Output sparseMatrix; @SuppressWarnings("unchecked") - private SparseTensorToCSRSparseMatrix(Operation operation) { - super(operation); + public SparseTensorToCSRSparseMatrix(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseMatrix = operation.output(outputIdx++); } @@ -80,4 +94,38 @@ public Output sparseMatrix() { public Output asOutput() { return (Output) sparseMatrix; } + + @OpInputsMetadata( + outputsClass = SparseTensorToCSRSparseMatrix.class + ) + public static class Inputs extends RawOpInputs { + /** + * SparseTensor indices. + */ + public final Operand indices; + + /** + * SparseTensor values. + */ + public final Operand values; + + /** + * SparseTensor dense shape. + */ + public final Operand denseShape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseTensorToCSRSparseMatrix(op), op, Arrays.asList("T")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + denseShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java index e18c875dc03..0f4ee840704 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +38,11 @@ * Given a tensor {@code x}, this operation returns a tensor containing the absolute * value of each element in {@code x}. For example, if x is an input element and y is * an output element, this operation computes \(y = |x|\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Abs.OP_NAME, + inputsClass = Abs.Inputs.class +) @Operator( group = "math" ) @@ -46,8 +54,8 @@ public final class Abs extends RawOp implements Operand { private Output y; - private Abs(Operation operation) { - super(operation); + public Abs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -56,7 +64,7 @@ private Abs(Operation operation) { * Factory method to create a class wrapping a new Abs operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Abs} output and operands * @return a new instance of Abs */ @@ -82,4 +90,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Abs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Abs<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java index ecdb5d78af9..3a0e466e8cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ * storage is proportional to the output size rather than the inputs size. *

    Unlike the original {@code accumulate_n}, {@code accumulate_n_v2} is differentiable. *

    Returns a {@code Tensor} of same shape and type as the elements of {@code inputs}. - * - * @param data type for {@code sum} output */ +@OpMetadata( + opType = AccumulateN.OP_NAME, + inputsClass = AccumulateN.Inputs.class +) @Operator( group = "math" ) @@ -51,8 +59,8 @@ public final class AccumulateN extends RawOp implements Operand private Output sum; - private AccumulateN(Operation operation) { - super(operation); + public AccumulateN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sum = operation.output(outputIdx++); } @@ -90,4 +98,34 @@ public Output sum() { public Output asOutput() { return sum; } + + @OpInputsMetadata( + outputsClass = AccumulateN.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A list of {@code Tensor} objects, each with same shape and type. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Shape of elements of {@code inputs}. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new AccumulateN<>(op), op, Arrays.asList("T", "shape")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + shape = op.attributes().getAttrShape("shape"); + } + } } 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 bf83134db52..915e5b98b63 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes acos of x element-wise. * Provided an input tensor, the {@code tf.math.acos} operation returns the inverse cosine of each element of the tensor. If {@code y = tf.math.cos(x)} then, {@code x = tf.math.acos(y)}. *

    Input range is {@code [-1, 1]} and the output has a range of {@code [0, pi]}. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Acos.OP_NAME, + inputsClass = Acos.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Acos extends RawOp implements Operand { private Output y; - private Acos(Operation operation) { - super(operation); + public Acos(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -55,7 +63,7 @@ private Acos(Operation operation) { * Factory method to create a class wrapping a new Acos operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Acos} output and operands * @return a new instance of Acos */ @@ -81,4 +89,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Acos.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Acos<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java index f8324e7bf17..8ade37b1990 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * x = tf.constant([-2, -0.5, 1, 1.2, 200, 10000, float("inf")]) * tf.math.acosh(x) ==> [nan nan 0. 0.62236255 5.9914584 9.903487 inf] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Acosh.OP_NAME, + inputsClass = Acosh.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class Acosh extends RawOp implements Operand { private Output y; - private Acosh(Operation operation) { - super(operation); + public Acosh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private Acosh(Operation operation) { * Factory method to create a class wrapping a new Acosh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Acosh} output and operands * @return a new instance of Acosh */ @@ -85,4 +93,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Acosh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Acosh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 ef34ca94ba9..61db4d2e4ec 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ * here *

    Given two input tensors, the {@code tf.add} operation computes the sum for every element in the tensor. *

    Both input and output have a range {@code (-inf, inf)}. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Add.OP_NAME, + inputsClass = Add.Inputs.class +) @Operator( group = "math" ) @@ -47,8 +55,8 @@ public final class Add extends RawOp implements Operand { private Output z; - private Add(Operation operation) { - super(operation); + public Add(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -57,8 +65,8 @@ private Add(Operation operation) { * Factory method to create a class wrapping a new Add operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Add} output and operands * @return a new instance of Add */ @@ -85,4 +93,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Add.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Add<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java index 9968751c73d..f2ef9209796 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * x = [9, 7, 10] * tf.math.add_n(x) ==> 26 * - * - * @param data type for {@code sum} output */ +@OpMetadata( + opType = AddN.OP_NAME, + inputsClass = AddN.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class AddN extends RawOp implements Operand { private Output sum; - private AddN(Operation operation) { - super(operation); + public AddN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sum = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private AddN(Operation operation) { * Factory method to create a class wrapping a new AddN operation. * * @param scope current scope - * @param inputs the inputs value + * @param inputs The inputs value * @param data type for {@code AddN} output and operands * @return a new instance of AddN */ @@ -85,4 +93,28 @@ public Output sum() { public Output asOutput() { return sum; } + + @OpInputsMetadata( + outputsClass = AddN.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AddN<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java index 85c68982edf..6ad1ff84bba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -40,14 +46,16 @@ *

    For example: *

      * # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
    - * tf.angle(input) ==> [2.0132, 1.056]
    + * tf.math.angle(input) ==> [2.0132, 1.056]
      * 
    *

    {@literal @}compatibility(numpy)
    * Equivalent to np.angle. *
    {@literal @}end_compatibility - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Angle.OP_NAME, + inputsClass = Angle.Inputs.class +) @Operator( group = "math" ) @@ -59,8 +67,8 @@ public final class Angle extends RawOp implements Operand private Output output; - private Angle(Operation operation) { - super(operation); + public Angle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -69,8 +77,8 @@ private Angle(Operation operation) { * Factory method to create a class wrapping a new Angle operation. * * @param scope current scope - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Angle} output and operands * @return a new instance of Angle */ @@ -89,7 +97,7 @@ public static Angle create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Angle.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new Angle<>(op), op, Arrays.asList("T", "Tout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java index 0ff28f5272f..3b17f3b42e9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; /** * Returns the truth value of abs(x-y) < tolerance element-wise. */ +@OpMetadata( + opType = ApproximateEqual.OP_NAME, + inputsClass = ApproximateEqual.Inputs.class +) @Operator( group = "math" ) @@ -42,8 +52,8 @@ public final class ApproximateEqual extends RawOp implements Operand { private Output z; - private ApproximateEqual(Operation operation) { - super(operation); + public ApproximateEqual(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -52,8 +62,8 @@ private ApproximateEqual(Operation operation) { * Factory method to create a class wrapping a new ApproximateEqual operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code ApproximateEqual} output and operands * @return a new instance of ApproximateEqual @@ -120,4 +130,38 @@ public Options tolerance(Float tolerance) { return this; } } + + @OpInputsMetadata( + outputsClass = ApproximateEqual.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The tolerance attribute + */ + public final float tolerance; + + public Inputs(GraphOperation op) { + super(new ApproximateEqual(op), op, Arrays.asList("T", "tolerance")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + tolerance = op.attributes().getAttrFloat("tolerance"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java index 48709c643ab..c222f3d54d5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * # c = 4 * # here a[4] = 166.32 which is the largest element of a across axis 0 * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ArgMax.OP_NAME, + inputsClass = ArgMax.Inputs.class +) @Operator( group = "math" ) @@ -56,8 +64,8 @@ public final class ArgMax extends RawOp implements Operand private Output output; - private ArgMax(Operation operation) { - super(operation); + public ArgMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -66,11 +74,11 @@ private ArgMax(Operation operation) { * Factory method to create a class wrapping a new ArgMax operation. * * @param scope current scope - * @param input the input value - * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. + * @param input The input value + * @param dimension int16, int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. - * @param outputType the value of the outputType property + * @param outputType The value of the outputType attribute * @param data type for {@code ArgMax} output and operands * @return a new instance of ArgMax */ @@ -90,8 +98,8 @@ public static ArgMax create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ArgMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * int16, int32 or int64, must be in the range {@code [-rank(input), rank(input))}. + * Describes which dimension of the input Tensor to reduce across. For vectors, + * use dimension = 0. + */ + public final Operand dimension; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The outputType attribute + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new ArgMax<>(op), op, Arrays.asList("T", "Tidx", "output_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dimension = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java index fc75352c9a7..41aa45a10ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * # c = 0 * # here a[0] = 1 which is the smallest element of a across axis 0 * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ArgMin.OP_NAME, + inputsClass = ArgMin.Inputs.class +) @Operator( group = "math" ) @@ -56,8 +64,8 @@ public final class ArgMin extends RawOp implements Operand private Output output; - private ArgMin(Operation operation) { - super(operation); + public ArgMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -66,11 +74,11 @@ private ArgMin(Operation operation) { * Factory method to create a class wrapping a new ArgMin operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param dimension int32 or int64, must be in the range {@code [-rank(input), rank(input))}. * Describes which dimension of the input Tensor to reduce across. For vectors, * use dimension = 0. - * @param outputType the value of the outputType property + * @param outputType The value of the outputType attribute * @param data type for {@code ArgMin} output and operands * @return a new instance of ArgMin */ @@ -90,7 +98,7 @@ public static ArgMin create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ArgMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * int32 or int64, must be in the range {@code [-rank(input), rank(input))}. + * Describes which dimension of the input Tensor to reduce across. For vectors, + * use dimension = 0. + */ + public final Operand dimension; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The outputType attribute + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new ArgMin<>(op), op, Arrays.asList("T", "Tidx", "output_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dimension = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java index ee04e8cf388..810aeb5fa3b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +47,11 @@ * * tf.math.asin(y) # [1.047, 0.785] = x * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Asin.OP_NAME, + inputsClass = Asin.Inputs.class +) @Operator( group = "math" ) @@ -55,8 +63,8 @@ public final class Asin extends RawOp implements Operand { private Output y; - private Asin(Operation operation) { - super(operation); + public Asin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -65,7 +73,7 @@ private Asin(Operation operation) { * Factory method to create a class wrapping a new Asin operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Asin} output and operands * @return a new instance of Asin */ @@ -91,4 +99,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Asin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Asin<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java index 0119bd153bc..918518f2b82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * x = tf.constant([-float("inf"), -2, -0.5, 1, 1.2, 200, 10000, float("inf")]) * tf.math.asinh(x) ==> [-inf -1.4436355 -0.4812118 0.8813736 1.0159732 5.991471 9.903487 inf] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Asinh.OP_NAME, + inputsClass = Asinh.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Asinh extends RawOp implements Operand { private Output y; - private Asinh(Operation operation) { - super(operation); + public Asinh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private Asinh(Operation operation) { * Factory method to create a class wrapping a new Asinh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Asinh} output and operands * @return a new instance of Asinh */ @@ -86,4 +94,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Asinh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Asinh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java index 23d406fc212..8979ab75d9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +47,11 @@ * * tf.math.atan(y) # [1.047, 0.785] = x * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Atan.OP_NAME, + inputsClass = Atan.Inputs.class +) @Operator( group = "math" ) @@ -55,8 +63,8 @@ public final class Atan extends RawOp implements Operand { private Output y; - private Atan(Operation operation) { - super(operation); + public Atan(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -65,7 +73,7 @@ private Atan(Operation operation) { * Factory method to create a class wrapping a new Atan operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Atan} output and operands * @return a new instance of Atan */ @@ -91,4 +99,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Atan.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Atan<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java index ce96908dcde..2d566d3cc22 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -45,9 +51,11 @@ * * * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Atan2.OP_NAME, + inputsClass = Atan2.Inputs.class +) @Operator( group = "math" ) @@ -59,8 +67,8 @@ public final class Atan2 extends RawOp implements Operand private Output z; - private Atan2(Operation operation) { - super(operation); + public Atan2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -69,8 +77,8 @@ private Atan2(Operation operation) { * Factory method to create a class wrapping a new Atan2 operation. * * @param scope current scope - * @param y the y value - * @param x the x value + * @param y The y value + * @param x The x value * @param data type for {@code Atan2} output and operands * @return a new instance of Atan2 */ @@ -97,4 +105,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Atan2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Atan2<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java index 044b5024ce0..c4dd0f1ead2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -38,9 +44,11 @@ * x = tf.constant([-float("inf"), -1, -0.5, 1, 0, 0.5, 10, float("inf")]) * tf.math.atanh(x) ==> [nan -inf -0.54930615 inf 0. 0.54930615 nan nan] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Atanh.OP_NAME, + inputsClass = Atanh.Inputs.class +) @Operator( group = "math" ) @@ -52,8 +60,8 @@ public final class Atanh extends RawOp implements Operand { private Output y; - private Atanh(Operation operation) { - super(operation); + public Atanh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -62,7 +70,7 @@ private Atanh(Operation operation) { * Factory method to create a class wrapping a new Atanh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Atanh} output and operands * @return a new instance of Atanh */ @@ -88,4 +96,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Atanh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Atanh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java index 35381f86ecc..945d2107a39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselI0 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselI0.OP_NAME, + inputsClass = BesselI0.Inputs.class +) +@Operator( + group = "math" +) public final class BesselI0 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselI0 extends RawOp implements Operand< private Output y; - private BesselI0(Operation operation) { - super(operation); + public BesselI0(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselI0(Operation operation) { * Factory method to create a class wrapping a new BesselI0 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselI0} output and operands * @return a new instance of BesselI0 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselI0.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselI0<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java index 5aaf7dc071b..7e27d3e4263 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselI0e operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselI0e.OP_NAME, + inputsClass = BesselI0e.Inputs.class +) +@Operator( + group = "math" +) public final class BesselI0e extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselI0e extends RawOp implements Operand private Output y; - private BesselI0e(Operation operation) { - super(operation); + public BesselI0e(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselI0e(Operation operation) { * Factory method to create a class wrapping a new BesselI0e operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselI0e} output and operands * @return a new instance of BesselI0e */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselI0e.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselI0e<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java index 48be4da8852..28304567e86 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselI1 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselI1.OP_NAME, + inputsClass = BesselI1.Inputs.class +) +@Operator( + group = "math" +) public final class BesselI1 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselI1 extends RawOp implements Operand< private Output y; - private BesselI1(Operation operation) { - super(operation); + public BesselI1(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselI1(Operation operation) { * Factory method to create a class wrapping a new BesselI1 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselI1} output and operands * @return a new instance of BesselI1 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselI1.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselI1<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java index 86c91135186..df3b3f937e8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselI1e operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselI1e.OP_NAME, + inputsClass = BesselI1e.Inputs.class +) +@Operator( + group = "math" +) public final class BesselI1e extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselI1e extends RawOp implements Operand private Output y; - private BesselI1e(Operation operation) { - super(operation); + public BesselI1e(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselI1e(Operation operation) { * Factory method to create a class wrapping a new BesselI1e operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselI1e} output and operands * @return a new instance of BesselI1e */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselI1e.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselI1e<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java index 12a6deebcb8..1a895c89f00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +41,11 @@ *

    \(B(x; a, b) = \int_0^x t^{a-1} (1 - t)^{b-1} dt\) *

    is the incomplete beta function and \(B(a, b)\) is the complete * beta function. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Betainc.OP_NAME, + inputsClass = Betainc.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class Betainc extends RawOp implements Operand z; - private Betainc(Operation operation) { - super(operation); + public Betainc(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -59,9 +67,9 @@ private Betainc(Operation operation) { * Factory method to create a class wrapping a new Betainc operation. * * @param scope current scope - * @param a the a value - * @param b the b value - * @param x the x value + * @param a The a value + * @param b The b value + * @param x The x value * @param data type for {@code Betainc} output and operands * @return a new instance of Betainc */ @@ -90,4 +98,38 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Betainc.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The b input + */ + public final Operand b; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Betainc<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java index e5c3df77bb5..463dc277eae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -36,9 +42,11 @@ * the value in {@code weights} at each index where the corresponding value in {@code arr} is * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. - * - * @param data type for {@code bins} output */ +@OpMetadata( + opType = Bincount.OP_NAME, + inputsClass = Bincount.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Bincount extends RawOp implements Operand< private Output bins; - private Bincount(Operation operation) { - super(operation); + public Bincount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; bins = operation.output(outputIdx++); } @@ -94,4 +102,40 @@ public Output bins() { public Output asOutput() { return bins; } + + @OpInputsMetadata( + outputsClass = Bincount.class + ) + public static class Inputs extends RawOpInputs> { + /** + * int32 {@code Tensor}. + */ + public final Operand arr; + + /** + * non-negative int32 scalar {@code Tensor}. + */ + public final Operand sizeOutput; + + /** + * is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code arr}, or a length-0 {@code Tensor}, in which case it acts as all weights + * equal to 1. + */ + public final Operand weights; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Bincount<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + arr = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java index 9b811445925..1a69b94a8e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns element-wise smallest integer not less than x. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Ceil.OP_NAME, + inputsClass = Ceil.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Ceil extends RawOp implements Operand { private Output y; - private Ceil(Operation operation) { - super(operation); + public Ceil(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Ceil(Operation operation) { * Factory method to create a class wrapping a new Ceil operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Ceil} output and operands * @return a new instance of Ceil */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Ceil.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Ceil<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java index 6e5df44de86..9461d599888 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -46,9 +52,11 @@ * * * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = ComplexAbs.OP_NAME, + inputsClass = ComplexAbs.Inputs.class +) @Operator( group = "math" ) @@ -60,8 +68,8 @@ public final class ComplexAbs extends RawOp implements Operan private Output y; - private ComplexAbs(Operation operation) { - super(operation); + public ComplexAbs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -70,8 +78,8 @@ private ComplexAbs(Operation operation) { * Factory method to create a class wrapping a new ComplexAbs operation. * * @param scope current scope - * @param x the x value - * @param Tout the value of the Tout property + * @param x The x value + * @param Tout The value of the Tout attribute * @param data type for {@code ComplexAbs} output and operands * @return a new instance of ComplexAbs */ @@ -90,7 +98,7 @@ public static ComplexAbs create(Scope scope, Operand y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = ComplexAbs.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new ComplexAbs<>(op), op, Arrays.asList("T", "Tout")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java index cbe6cc9c710..d46b7f2ae5b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +45,11 @@ * # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j] * tf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conj.OP_NAME, + inputsClass = Conj.Inputs.class +) @Operator( group = "math" ) @@ -53,8 +61,8 @@ public final class Conj extends RawOp implements Operand { private Output output; - private Conj(Operation operation) { - super(operation); + public Conj(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -63,7 +71,7 @@ private Conj(Operation operation) { * Factory method to create a class wrapping a new Conj operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param data type for {@code Conj} output and operands * @return a new instance of Conj */ @@ -89,4 +97,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Conj.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Conj<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java index 23ce30f2b39..b6b5b9595c5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ * x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")]) * tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Cos.OP_NAME, + inputsClass = Cos.Inputs.class +) @Operator( group = "math" ) @@ -51,8 +59,8 @@ public final class Cos extends RawOp implements Operand { private Output y; - private Cos(Operation operation) { - super(operation); + public Cos(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -61,7 +69,7 @@ private Cos(Operation operation) { * Factory method to create a class wrapping a new Cos operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Cos} output and operands * @return a new instance of Cos */ @@ -87,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Cos.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Cos<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java index d47a6e1e490..391d2efd7ab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 2, 10, float("inf")]) * tf.math.cosh(x) ==> [inf 4.0515420e+03 1.1276259e+00 1.5430807e+00 1.8106556e+00 3.7621956e+00 1.1013233e+04 inf] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Cosh.OP_NAME, + inputsClass = Cosh.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Cosh extends RawOp implements Operand { private Output y; - private Cosh(Operation operation) { - super(operation); + public Cosh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private Cosh(Operation operation) { * Factory method to create a class wrapping a new Cosh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Cosh} output and operands * @return a new instance of Cosh */ @@ -86,4 +94,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Cosh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Cosh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java index b22b0fb1e72..90bdcdc0038 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -50,9 +56,11 @@ *

      * tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]
      * 
    - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = Cumprod.OP_NAME, + inputsClass = Cumprod.Inputs.class +) @Operator( group = "math" ) @@ -64,8 +72,8 @@ public final class Cumprod extends RawOp implements Operand private Output out; - private Cumprod(Operation operation) { - super(operation); + public Cumprod(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -171,4 +179,53 @@ public Options reverse(Boolean reverse) { return this; } } + + @OpInputsMetadata( + outputsClass = Cumprod.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. Must be one of the following types: {@code float32}, {@code float64}, + * {@code int64}, {@code int32}, {@code uint8}, {@code uint16}, {@code int16}, {@code int8}, {@code complex64}, + * {@code complex128}, {@code qint8}, {@code quint8}, {@code qint32}, {@code half}. + */ + public final Operand x; + + /** + * A {@code Tensor} of type {@code int32} (default: 0). Must be in the range + * {@code [-rank(x), rank(x))}. + */ + public final Operand axis; + + /** + * If {@code True}, perform exclusive cumprod. + */ + public final boolean exclusive; + + /** + * A {@code bool} (default: False). + */ + public final boolean reverse; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Cumprod<>(op), op, Arrays.asList("exclusive", "reverse", "T", "Tidx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + exclusive = op.attributes().getAttrBool("exclusive"); + reverse = op.attributes().getAttrBool("reverse"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java index ecc7e3b0aff..ff8dca235c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -50,9 +56,11 @@ *
      * tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]
      * 
    - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = Cumsum.OP_NAME, + inputsClass = Cumsum.Inputs.class +) @Operator( group = "math" ) @@ -64,8 +72,8 @@ public final class Cumsum extends RawOp implements Operand { private Output out; - private Cumsum(Operation operation) { - super(operation); + public Cumsum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -171,4 +179,53 @@ public Options reverse(Boolean reverse) { return this; } } + + @OpInputsMetadata( + outputsClass = Cumsum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. Must be one of the following types: {@code float32}, {@code float64}, + * {@code int64}, {@code int32}, {@code uint8}, {@code uint16}, {@code int16}, {@code int8}, {@code complex64}, + * {@code complex128}, {@code qint8}, {@code quint8}, {@code qint32}, {@code half}. + */ + public final Operand x; + + /** + * A {@code Tensor} of type {@code int32} (default: 0). Must be in the range + * {@code [-rank(x), rank(x))}. + */ + public final Operand axis; + + /** + * If {@code True}, perform exclusive cumsum. + */ + public final boolean exclusive; + + /** + * A {@code bool} (default: False). + */ + public final boolean reverse; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Cumsum<>(op), op, Arrays.asList("exclusive", "reverse", "T", "Tidx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + exclusive = op.attributes().getAttrBool("exclusive"); + reverse = op.attributes().getAttrBool("reverse"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java index 6e98ab061c4..f7367703a41 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -44,9 +51,14 @@ * floating point type is used instead. *

    By setting the {@code reverse} kwarg to {@code True}, the cumulative log-sum-exp is performed in the * opposite direction. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = CumulativeLogsumexp.OP_NAME, + inputsClass = CumulativeLogsumexp.Inputs.class +) +@Operator( + group = "math" +) public final class CumulativeLogsumexp extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -55,8 +67,8 @@ public final class CumulativeLogsumexp extends RawOp implemen private Output out; - private CumulativeLogsumexp(Operation operation) { - super(operation); + public CumulativeLogsumexp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -160,4 +172,51 @@ public Options reverse(Boolean reverse) { return this; } } + + @OpInputsMetadata( + outputsClass = CumulativeLogsumexp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code Tensor}. Must be one of the following types: {@code float16}, {@code float32}, {@code float64}. + */ + public final Operand x; + + /** + * A {@code Tensor} of type {@code int32} (default: 0). Must be in the range + * {@code [-rank(x), rank(x))}. + */ + public final Operand axis; + + /** + * If {@code True}, perform exclusive cumulative log-sum-exp. + */ + public final boolean exclusive; + + /** + * A {@code bool} (default: False). + */ + public final boolean reverse; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new CumulativeLogsumexp<>(op), op, Arrays.asList("exclusive", "reverse", "T", "Tidx")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + exclusive = op.attributes().getAttrBool("exclusive"); + reverse = op.attributes().getAttrBool("reverse"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java index 6310445901f..808be372c5f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +41,11 @@ * the value in {@code weights} at each index where the corresponding value in {@code arr} is * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DenseBincount.OP_NAME, + inputsClass = DenseBincount.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class DenseBincount extends RawOp implements Ope private Output output; - private DenseBincount(Operation operation) { - super(operation); + public DenseBincount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -133,4 +141,52 @@ public Options binaryOutput(Boolean binaryOutput) { return this; } } + + @OpInputsMetadata( + outputsClass = DenseBincount.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1D or 2D int {@code Tensor}. + */ + public final Operand input; + + /** + * non-negative int scalar {@code Tensor}. + */ + public final Operand sizeOutput; + + /** + * is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code arr}, or a length-0 {@code Tensor}, in which case it acts as all weights + * equal to 1. + */ + public final Operand weights; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The T attribute + */ + public final DataType T; + + /** + * bool; Whether the kernel should count the appearance or number of occurrences. + */ + public final boolean binaryOutput; + + public Inputs(GraphOperation op) { + super(new DenseBincount<>(op), op, Arrays.asList("Tidx", "T", "binary_output")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + T = op.attributes().getAttrType("T"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java index 6e60883e429..3a48d548bd4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes Psi, the derivative of Lgamma (the log of the absolute value of * {@code Gamma(x)}), element-wise. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Digamma.OP_NAME, + inputsClass = Digamma.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Digamma extends RawOp implements Operand y; - private Digamma(Operation operation) { - super(operation); + public Digamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Digamma(Operation operation) { * Factory method to create a class wrapping a new Digamma operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Digamma} output and operands * @return a new instance of Digamma */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Digamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Digamma<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java index 8988d560e5a..8ad37113d3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns x / y element-wise. * NOTE: {@code math.Div} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Div.OP_NAME, + inputsClass = Div.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Div extends RawOp implements Operand { private Output z; - private Div(Operation operation) { - super(operation); + public Div(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Div(Operation operation) { * Factory method to create a class wrapping a new Div operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Div} output and operands * @return a new instance of Div */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Div.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Div<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java index fc3fe91315d..43047bad3c6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns 0 if the denominator is zero. * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = DivNoNan.OP_NAME, + inputsClass = DivNoNan.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class DivNoNan extends RawOp implements Operand private Output z; - private DivNoNan(Operation operation) { - super(operation); + public DivNoNan(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private DivNoNan(Operation operation) { * Factory method to create a class wrapping a new DivNoNan operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code DivNoNan} output and operands * @return a new instance of DivNoNan */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = DivNoNan.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DivNoNan<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java index 4c37a703bb8..da812914c96 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -42,6 +48,10 @@ * tf.math.equal(x, y) ==> array([True, True]) * */ +@OpMetadata( + opType = Equal.OP_NAME, + inputsClass = Equal.Inputs.class +) @Operator( group = "math" ) @@ -53,8 +63,8 @@ public final class Equal extends RawOp implements Operand { private Output z; - private Equal(Operation operation) { - super(operation); + public Equal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -63,8 +73,8 @@ private Equal(Operation operation) { * Factory method to create a class wrapping a new Equal operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code Equal} output and operands * @return a new instance of Equal @@ -131,4 +141,38 @@ public Options incompatibleShapeError(Boolean incompatibleShapeError) { return this; } } + + @OpInputsMetadata( + outputsClass = Equal.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The incompatibleShapeError attribute + */ + public final boolean incompatibleShapeError; + + public Inputs(GraphOperation op) { + super(new Equal(op), op, Arrays.asList("T", "incompatible_shape_error")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + incompatibleShapeError = op.attributes().getAttrBool("incompatible_shape_error"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java index 78103474f66..ef607d7778b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the Gauss error function of {@code x} element-wise. In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Erf.OP_NAME, + inputsClass = Erf.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Erf extends RawOp implements Operand { private Output y; - private Erf(Operation operation) { - super(operation); + public Erf(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Erf(Operation operation) { * Factory method to create a class wrapping a new Erf operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Erf} output and operands * @return a new instance of Erf */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Erf.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Erf<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java index 68bad7cb746..25fdbcd648c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the complementary error function of {@code x} element-wise. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Erfc.OP_NAME, + inputsClass = Erfc.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Erfc extends RawOp implements Operand { private Output y; - private Erfc(Operation operation) { - super(operation); + public Erfc(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Erfc(Operation operation) { * Factory method to create a class wrapping a new Erfc operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Erfc} output and operands * @return a new instance of Erfc */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Erfc.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Erfc<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java index 03d468a2553..fe1d6ed1515 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -50,9 +56,11 @@ * x = tf.constant(1 + 1j) * tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Exp.OP_NAME, + inputsClass = Exp.Inputs.class +) @Operator( group = "math" ) @@ -64,8 +72,8 @@ public final class Exp extends RawOp implements Operand { private Output y; - private Exp(Operation operation) { - super(operation); + public Exp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -74,7 +82,7 @@ private Exp(Operation operation) { * Factory method to create a class wrapping a new Exp operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Exp} output and operands * @return a new instance of Exp */ @@ -100,4 +108,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Exp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Exp<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java index 47759eeab1d..b9c80edf84b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -41,9 +47,11 @@ * x = tf.constant(1 + 1j) * tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j) * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Expm1.OP_NAME, + inputsClass = Expm1.Inputs.class +) @Operator( group = "math" ) @@ -55,8 +63,8 @@ public final class Expm1 extends RawOp implements Operand { private Output y; - private Expm1(Operation operation) { - super(operation); + public Expm1(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -65,7 +73,7 @@ private Expm1(Operation operation) { * Factory method to create a class wrapping a new Expm1 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Expm1} output and operands * @return a new instance of Expm1 */ @@ -91,4 +99,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Expm1.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Expm1<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java index d7fae0d2495..0e0e269f43f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Output a fact about factorials. */ +@OpMetadata( + opType = Fact.OP_NAME, + inputsClass = Fact.Inputs.class +) @Operator( group = "math" ) @@ -41,8 +50,8 @@ public final class Fact extends RawOp implements Operand { private Output fact; - private Fact(Operation operation) { - super(operation); + public Fact(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; fact = operation.output(outputIdx++); } @@ -74,4 +83,14 @@ public Output fact() { public Output asOutput() { return fact; } + + @OpInputsMetadata( + outputsClass = Fact.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new Fact(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java index 2901b5af2ac..27ed6af66ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns element-wise largest integer not greater than x. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Floor.OP_NAME, + inputsClass = Floor.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Floor extends RawOp implements Operand private Output y; - private Floor(Operation operation) { - super(operation); + public Floor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Floor(Operation operation) { * Factory method to create a class wrapping a new Floor operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Floor} output and operands * @return a new instance of Floor */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Floor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Floor<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java index 88c184551e3..61d57ac8c4f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns x // y element-wise. * NOTE: {@code math.FloorDiv} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = FloorDiv.OP_NAME, + inputsClass = FloorDiv.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class FloorDiv extends RawOp implements Operand private Output z; - private FloorDiv(Operation operation) { - super(operation); + public FloorDiv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private FloorDiv(Operation operation) { * Factory method to create a class wrapping a new FloorDiv operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code FloorDiv} output and operands * @return a new instance of FloorDiv */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = FloorDiv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FloorDiv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java index d8292045766..b41e5d112b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** - * Returns element-wise remainder of division. When {@code x < 0} xor {@code y < 0} is - * true, this follows Python semantics in that the result here is consistent - * with a flooring divide. E.g. {@code floor(x / y) * y + mod(x, y) = x}. + * Returns element-wise remainder of division. + * This follows Python semantics in that the + * result here is consistent with a flooring divide. E.g. + * {@code floor(x / y) * y + floormod(x, y) = x}, regardless of the signs of x and y. *

    NOTE: {@code math.FloorMod} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = FloorMod.OP_NAME, + inputsClass = FloorMod.Inputs.class +) @Operator( group = "math" ) @@ -47,8 +56,8 @@ public final class FloorMod extends RawOp implements Operand< private Output z; - private FloorMod(Operation operation) { - super(operation); + public FloorMod(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -57,8 +66,8 @@ private FloorMod(Operation operation) { * Factory method to create a class wrapping a new FloorMod operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code FloorMod} output and operands * @return a new instance of FloorMod */ @@ -85,4 +94,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = FloorMod.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FloorMod<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java index 5986b90cc87..a740dc51f03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -43,6 +49,10 @@ * tf.math.greater(x, y) ==> [False, False, True] * */ +@OpMetadata( + opType = Greater.OP_NAME, + inputsClass = Greater.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +64,8 @@ public final class Greater extends RawOp implements Operand { private Output z; - private Greater(Operation operation) { - super(operation); + public Greater(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -64,8 +74,8 @@ private Greater(Operation operation) { * Factory method to create a class wrapping a new Greater operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Greater} output and operands * @return a new instance of Greater */ @@ -92,4 +102,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Greater.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Greater(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java index 96a0c33cdac..d264acca6db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -43,6 +49,10 @@ * tf.math.greater_equal(x, y) ==> [True, False, True, True] * */ +@OpMetadata( + opType = GreaterEqual.OP_NAME, + inputsClass = GreaterEqual.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +64,8 @@ public final class GreaterEqual extends RawOp implements Operand { private Output z; - private GreaterEqual(Operation operation) { - super(operation); + public GreaterEqual(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -64,8 +74,8 @@ private GreaterEqual(Operation operation) { * Factory method to create a class wrapping a new GreaterEqual operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code GreaterEqual} output and operands * @return a new instance of GreaterEqual */ @@ -92,4 +102,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = GreaterEqual.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new GreaterEqual(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java index d6b96a559bb..224c434af9f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -36,9 +42,11 @@ *

    is the lower incomplete Gamma function. *

    Note, above {@code Q(a, x)} ({@code Igammac}) is the upper regularized complete * Gamma function. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Igamma.OP_NAME, + inputsClass = Igamma.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Igamma extends RawOp implements Operand private Output z; - private Igamma(Operation operation) { - super(operation); + public Igamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -60,8 +68,8 @@ private Igamma(Operation operation) { * Factory method to create a class wrapping a new Igamma operation. * * @param scope current scope - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Igamma} output and operands * @return a new instance of Igamma */ @@ -88,4 +96,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Igamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Igamma<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java index cca8e5abc1b..a3c6c4f20ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of {@code igamma(a, x)} wrt {@code a}. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = IgammaGradA.OP_NAME, + inputsClass = IgammaGradA.Inputs.class +) +@Operator( + group = "math" +) public final class IgammaGradA extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class IgammaGradA extends RawOp implements Opera private Output z; - private IgammaGradA(Operation operation) { - super(operation); + public IgammaGradA(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -49,8 +61,8 @@ private IgammaGradA(Operation operation) { * Factory method to create a class wrapping a new IgammaGradA operation. * * @param scope current scope - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code IgammaGradA} output and operands * @return a new instance of IgammaGradA */ @@ -77,4 +89,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = IgammaGradA.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new IgammaGradA<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java index 02a42548c8a..80f2545ce69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -36,9 +42,11 @@ *

    is the upper incomplete Gamma function. *

    Note, above {@code P(a, x)} ({@code Igamma}) is the lower regularized complete * Gamma function. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Igammac.OP_NAME, + inputsClass = Igammac.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Igammac extends RawOp implements Operand z; - private Igammac(Operation operation) { - super(operation); + public Igammac(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -60,8 +68,8 @@ private Igammac(Operation operation) { * Factory method to create a class wrapping a new Igammac operation. * * @param scope current scope - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Igammac} output and operands * @return a new instance of Igammac */ @@ -88,4 +96,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Igammac.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Igammac<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java index e650e5ed4fc..509de2b8c7b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ * # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j] * tf.imag(input) ==> [4.75, 5.75] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Imag.OP_NAME, + inputsClass = Imag.Inputs.class +) @Operator( group = "math" ) @@ -55,8 +63,8 @@ public final class Imag extends RawOp implements Operand { private Output output; - private Imag(Operation operation) { - super(operation); + public Imag(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -65,8 +73,8 @@ private Imag(Operation operation) { * Factory method to create a class wrapping a new Imag operation. * * @param scope current scope - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Imag} output and operands * @return a new instance of Imag */ @@ -85,7 +93,7 @@ public static Imag create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Imag.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new Imag<>(op), op, Arrays.asList("T", "Tout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java index 25f38778533..a466109898c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -40,9 +46,11 @@ * # tensor `x` is [3, 4, 0, 2, 1] * invert_permutation(x) ==> [2, 4, 3, 0, 1] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = InvertPermutation.OP_NAME, + inputsClass = InvertPermutation.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +62,8 @@ public final class InvertPermutation extends RawOp implements private Output y; - private InvertPermutation(Operation operation) { - super(operation); + public InvertPermutation(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -90,4 +98,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = InvertPermutation.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InvertPermutation<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java index 793ab136dcd..37a1e77fab6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -39,6 +45,10 @@ * tf.math.is_finite(x) ==> [True, True, True, False, False] * */ +@OpMetadata( + opType = IsFinite.OP_NAME, + inputsClass = IsFinite.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +60,8 @@ public final class IsFinite extends RawOp implements Operand { private Output y; - private IsFinite(Operation operation) { - super(operation); + public IsFinite(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +70,7 @@ private IsFinite(Operation operation) { * Factory method to create a class wrapping a new IsFinite operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @return a new instance of IsFinite */ @Endpoint( @@ -85,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = IsFinite.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new IsFinite(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java index 6a347f259ee..5255fec1b5a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -39,6 +45,10 @@ * tf.math.is_inf(x) ==> [False, True, False, True] * */ +@OpMetadata( + opType = IsInf.OP_NAME, + inputsClass = IsInf.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +60,8 @@ public final class IsInf extends RawOp implements Operand { private Output y; - private IsInf(Operation operation) { - super(operation); + public IsInf(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +70,7 @@ private IsInf(Operation operation) { * Factory method to create a class wrapping a new IsInf operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @return a new instance of IsInf */ @Endpoint( @@ -85,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = IsInf.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new IsInf(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java index 35e52265f72..f0f3491eb33 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -39,6 +45,10 @@ * tf.math.is_nan(x) ==> [False, True, False, True, False] * */ +@OpMetadata( + opType = IsNan.OP_NAME, + inputsClass = IsNan.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +60,8 @@ public final class IsNan extends RawOp implements Operand { private Output y; - private IsNan(Operation operation) { - super(operation); + public IsNan(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +70,7 @@ private IsNan(Operation operation) { * Factory method to create a class wrapping a new IsNan operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @return a new instance of IsNan */ @Endpoint( @@ -85,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = IsNan.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new IsNan(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java index a45e1462e4e..8774ccbfb54 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -43,6 +49,10 @@ * tf.math.less(x, y) ==> [False, True, True] * */ +@OpMetadata( + opType = Less.OP_NAME, + inputsClass = Less.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +64,8 @@ public final class Less extends RawOp implements Operand { private Output z; - private Less(Operation operation) { - super(operation); + public Less(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -64,8 +74,8 @@ private Less(Operation operation) { * Factory method to create a class wrapping a new Less operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Less} output and operands * @return a new instance of Less */ @@ -92,4 +102,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Less.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Less(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java index 2ded1a54f94..ffb18c81dd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -43,6 +49,10 @@ * tf.math.less_equal(x, y) ==> [True, True, True] * */ +@OpMetadata( + opType = LessEqual.OP_NAME, + inputsClass = LessEqual.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +64,8 @@ public final class LessEqual extends RawOp implements Operand { private Output z; - private LessEqual(Operation operation) { - super(operation); + public LessEqual(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -64,8 +74,8 @@ private LessEqual(Operation operation) { * Factory method to create a class wrapping a new LessEqual operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code LessEqual} output and operands * @return a new instance of LessEqual */ @@ -92,4 +102,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = LessEqual.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LessEqual(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java index 30a35ea9223..4c5aea1de84 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -36,9 +42,11 @@ * x = tf.constant([0, 0.5, 1, 4.5, -4, -5.6]) * tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Lgamma.OP_NAME, + inputsClass = Lgamma.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Lgamma extends RawOp implements Operand private Output y; - private Lgamma(Operation operation) { - super(operation); + public Lgamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private Lgamma(Operation operation) { * Factory method to create a class wrapping a new Lgamma operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Lgamma} output and operands * @return a new instance of Lgamma */ @@ -86,4 +94,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Lgamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Lgamma<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java index 69190a0255c..911ab61ff0c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * x = tf.constant([0, 0.5, 1, 5]) * tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Log.OP_NAME, + inputsClass = Log.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class Log extends RawOp implements Operand { private Output y; - private Log(Operation operation) { - super(operation); + public Log(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private Log(Operation operation) { * Factory method to create a class wrapping a new Log operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Log} output and operands * @return a new instance of Log */ @@ -85,4 +93,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Log.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Log<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java index cf86bcf4420..05fe31ad376 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * x = tf.constant([0, 0.5, 1, 5]) * tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Log1p.OP_NAME, + inputsClass = Log1p.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class Log1p extends RawOp implements Operand { private Output y; - private Log1p(Operation operation) { - super(operation); + public Log1p(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private Log1p(Operation operation) { * Factory method to create a class wrapping a new Log1p operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Log1p} output and operands * @return a new instance of Log1p */ @@ -85,4 +93,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Log1p.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Log1p<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java index c5db6740088..96a6f9ff23c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; @@ -32,6 +37,10 @@ * NOTE: {@code math.LogicalAnd} supports broadcasting. More about broadcasting * here */ +@OpMetadata( + opType = LogicalAnd.OP_NAME, + inputsClass = LogicalAnd.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +52,8 @@ public final class LogicalAnd extends RawOp implements Operand { private Output z; - private LogicalAnd(Operation operation) { - super(operation); + public LogicalAnd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -53,8 +62,8 @@ private LogicalAnd(Operation operation) { * Factory method to create a class wrapping a new LogicalAnd operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @return a new instance of LogicalAnd */ @Endpoint( @@ -80,4 +89,26 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = LogicalAnd.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + public Inputs(GraphOperation op) { + super(new LogicalAnd(op), op, Arrays.asList()); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java index d0a2c92741d..61330ed35d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; /** * Returns the truth value of {@code NOT x} element-wise. */ +@OpMetadata( + opType = LogicalNot.OP_NAME, + inputsClass = LogicalNot.Inputs.class +) @Operator( group = "math" ) @@ -41,8 +50,8 @@ public final class LogicalNot extends RawOp implements Operand { private Output y; - private LogicalNot(Operation operation) { - super(operation); + public LogicalNot(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -76,4 +85,20 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = LogicalNot.class + ) + public static class Inputs extends RawOpInputs { + /** + * A {@code Tensor} of type {@code bool}. + */ + public final Operand x; + + public Inputs(GraphOperation op) { + super(new LogicalNot(op), op, Arrays.asList()); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java index 98cd56008ac..34b009edb77 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; @@ -32,6 +37,10 @@ * NOTE: {@code math.LogicalOr} supports broadcasting. More about broadcasting * here */ +@OpMetadata( + opType = LogicalOr.OP_NAME, + inputsClass = LogicalOr.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +52,8 @@ public final class LogicalOr extends RawOp implements Operand { private Output z; - private LogicalOr(Operation operation) { - super(operation); + public LogicalOr(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -53,8 +62,8 @@ private LogicalOr(Operation operation) { * Factory method to create a class wrapping a new LogicalOr operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @return a new instance of LogicalOr */ @Endpoint( @@ -80,4 +89,26 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = LogicalOr.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + public Inputs(GraphOperation op) { + super(new LogicalOr(op), op, Arrays.asList()); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java index 93762b5eefb..0c864b79f5e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns the max of x and y (i.e. x > y ? x : y) element-wise. * NOTE: {@code math.Maximum} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Maximum.OP_NAME, + inputsClass = Maximum.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Maximum extends RawOp implements Operand z; - private Maximum(Operation operation) { - super(operation); + public Maximum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Maximum(Operation operation) { * Factory method to create a class wrapping a new Maximum operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Maximum} output and operands * @return a new instance of Maximum */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Maximum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Maximum<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java index 2dea3ff81fa..9018aa2bd6d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in * {@code axis}. If {@code keep_dims} is true, the reduced dimensions are * retained with length 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Mean.OP_NAME, + inputsClass = Mean.Inputs.class +) @Operator( group = "math" ) @@ -48,8 +56,8 @@ public final class Mean extends RawOp implements Operand { private Output output; - private Mean(Operation operation) { - super(operation); + public Mean(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,4 +135,45 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = Mean.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to reduce. + */ + public final Operand input; + + /** + * The dimensions to reduce. Must be in the range + * {@code [-rank(input), rank(input))}. + */ + public final Operand axis; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + public Inputs(GraphOperation op) { + super(new Mean<>(op), op, Arrays.asList("keep_dims", "T", "Tidx")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + axis = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java index aeff1863af4..b516ee5c302 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns the min of x and y (i.e. x < y ? x : y) element-wise. * NOTE: {@code math.Minimum} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Minimum.OP_NAME, + inputsClass = Minimum.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Minimum extends RawOp implements Operand z; - private Minimum(Operation operation) { - super(operation); + public Minimum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Minimum(Operation operation) { * Factory method to create a class wrapping a new Minimum operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Minimum} output and operands * @return a new instance of Minimum */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Minimum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Minimum<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java index 21b00a05bf7..60ccc32e855 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * {@code tf.truncatediv(x, y) * y + truncate_mod(x, y) = x}. *

    NOTE: {@code math.Mod} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Mod.OP_NAME, + inputsClass = Mod.Inputs.class +) @Operator( group = "math" ) @@ -47,8 +55,8 @@ public final class Mod extends RawOp implements Operand { private Output z; - private Mod(Operation operation) { - super(operation); + public Mod(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -57,8 +65,8 @@ private Mod(Operation operation) { * Factory method to create a class wrapping a new Mod operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Mod} output and operands * @return a new instance of Mod */ @@ -85,4 +93,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Mod.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Mod<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java index d763f538ab7..d18a48a6472 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns x * y element-wise. * NOTE: {@code math.Mul} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Mul.OP_NAME, + inputsClass = Mul.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Mul extends RawOp implements Operand { private Output z; - private Mul(Operation operation) { - super(operation); + public Mul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Mul(Operation operation) { * Factory method to create a class wrapping a new Mul operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Mul} output and operands * @return a new instance of Mul */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Mul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Mul<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java index 9752010053f..7e85f94c31d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns x * y element-wise. Returns zero if y is zero, even if x if infinite or NaN. * NOTE: {@code math.MulNoNan} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = MulNoNan.OP_NAME, + inputsClass = MulNoNan.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class MulNoNan extends RawOp implements Operand private Output z; - private MulNoNan(Operation operation) { - super(operation); + public MulNoNan(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private MulNoNan(Operation operation) { * Factory method to create a class wrapping a new MulNoNan operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code MulNoNan} output and operands * @return a new instance of MulNoNan */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = MulNoNan.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MulNoNan<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java index 8ebe4057cf5..2c9b4f4719f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Ndtri operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Ndtri.OP_NAME, + inputsClass = Ndtri.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Ndtri extends RawOp implements Operand private Output y; - private Ndtri(Operation operation) { - super(operation); + public Ndtri(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Ndtri(Operation operation) { * Factory method to create a class wrapping a new Ndtri operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Ndtri} output and operands * @return a new instance of Ndtri */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Ndtri.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Ndtri<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java index d5778161810..e11b274470a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes numerical negative value element-wise. * I.e., \(y = -x\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Neg.OP_NAME, + inputsClass = Neg.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Neg extends RawOp implements Operand { private Output y; - private Neg(Operation operation) { - super(operation); + public Neg(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Neg(Operation operation) { * Factory method to create a class wrapping a new Neg operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Neg} output and operands * @return a new instance of Neg */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Neg.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Neg<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java index 51cc6a5efd4..fef32810db3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -34,9 +40,11 @@ *

    {@literal @}compatibility(cpp)
    * Equivalent to C++ std::nextafter function. *
    {@literal @}end_compatibility - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = NextAfter.OP_NAME, + inputsClass = NextAfter.Inputs.class +) @Operator( group = "math" ) @@ -48,8 +56,8 @@ public final class NextAfter extends RawOp implements Operand private Output output; - private NextAfter(Operation operation) { - super(operation); + public NextAfter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -58,8 +66,8 @@ private NextAfter(Operation operation) { * Factory method to create a class wrapping a new NextAfter operation. * * @param scope current scope - * @param x1 the x1 value - * @param x2 the x2 value + * @param x1 The x1 value + * @param x2 The x2 value * @param data type for {@code NextAfter} output and operands * @return a new instance of NextAfter */ @@ -86,4 +94,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = NextAfter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x1 input + */ + public final Operand x1; + + /** + * The x2 input + */ + public final Operand x2; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new NextAfter<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x1 = (Operand) op.input(inputIndex++); + x2 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java index a47f07b2d49..f5f3a80b352 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ * NOTE: {@code math.NotEqual} supports broadcasting. More about broadcasting * here */ +@OpMetadata( + opType = NotEqual.OP_NAME, + inputsClass = NotEqual.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +54,8 @@ public final class NotEqual extends RawOp implements Operand { private Output z; - private NotEqual(Operation operation) { - super(operation); + public NotEqual(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -54,8 +64,8 @@ private NotEqual(Operation operation) { * Factory method to create a class wrapping a new NotEqual operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param options carries optional attribute values * @param data type for {@code NotEqual} output and operands * @return a new instance of NotEqual @@ -122,4 +132,38 @@ public Options incompatibleShapeError(Boolean incompatibleShapeError) { return this; } } + + @OpInputsMetadata( + outputsClass = NotEqual.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The incompatibleShapeError attribute + */ + public final boolean incompatibleShapeError; + + public Inputs(GraphOperation op) { + super(new NotEqual(op), op, Arrays.asList("T", "incompatible_shape_error")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + incompatibleShapeError = op.attributes().getAttrBool("incompatible_shape_error"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java index a64e3f6c0c4..f391fef2335 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ *

    \(\psi^{(a)}(x) = \frac{d^a}{dx^a} \psi(x)\) *

    where \(\psi(x)\) is the digamma function. * The polygamma function is defined only for non-negative integer orders \a\. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Polygamma.OP_NAME, + inputsClass = Polygamma.Inputs.class +) @Operator( group = "math" ) @@ -47,8 +55,8 @@ public final class Polygamma extends RawOp implements Operand private Output z; - private Polygamma(Operation operation) { - super(operation); + public Polygamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -57,8 +65,8 @@ private Polygamma(Operation operation) { * Factory method to create a class wrapping a new Polygamma operation. * * @param scope current scope - * @param a the a value - * @param x the x value + * @param a The a value + * @param x The x value * @param data type for {@code Polygamma} output and operands * @return a new instance of Polygamma */ @@ -85,4 +93,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Polygamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Polygamma<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java index 4dd412ed439..f0ba71ac5de 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TNumber; @@ -36,6 +42,10 @@ * {@code int32} or {@code int64} and perform the bitcount on the result, than to feed in * 8- or 16-bit inputs and then aggregate the resulting counts. */ +@OpMetadata( + opType = PopulationCount.OP_NAME, + inputsClass = PopulationCount.Inputs.class +) @Operator( group = "math" ) @@ -47,8 +57,8 @@ public final class PopulationCount extends RawOp implements Operand { private Output y; - private PopulationCount(Operation operation) { - super(operation); + public PopulationCount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -57,7 +67,7 @@ private PopulationCount(Operation operation) { * Factory method to create a class wrapping a new PopulationCount operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @return a new instance of PopulationCount */ @Endpoint( @@ -82,4 +92,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = PopulationCount.class + ) + public static class Inputs extends RawOpInputs { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new PopulationCount(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java index ae2f093d57e..3a8f8acbb7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * # tensor 'y' is [[8, 16], [2, 3]] * tf.pow(x, y) ==> [[256, 65536], [9, 27]] * - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Pow.OP_NAME, + inputsClass = Pow.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Pow extends RawOp implements Operand { private Output z; - private Pow(Operation operation) { - super(operation); + public Pow(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -60,8 +68,8 @@ private Pow(Operation operation) { * Factory method to create a class wrapping a new Pow operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Pow} output and operands * @return a new instance of Pow */ @@ -88,4 +96,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Pow.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Pow<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java index be18d7ab977..cf02c4ad713 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Returns x + y element-wise, working on quantized buffers. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = QuantizedAdd.OP_NAME, + inputsClass = QuantizedAdd.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class QuantizedAdd extends RawOp { private Output maxZ; - private QuantizedAdd(Operation operation) { - super(operation); + public QuantizedAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); minZ = operation.output(outputIdx++); @@ -61,13 +69,13 @@ private QuantizedAdd(Operation operation) { * Factory method to create a class wrapping a new QuantizedAdd operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param minX The float value that the lowest quantized {@code x} value represents. * @param maxX The float value that the highest quantized {@code x} value represents. * @param minY The float value that the lowest quantized {@code y} value represents. * @param maxY The float value that the highest quantized {@code y} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param data type for {@code QuantizedAdd} output and operands * @return a new instance of QuantizedAdd */ @@ -116,4 +124,68 @@ public Output minZ() { public Output maxZ() { return maxZ; } + + @OpInputsMetadata( + outputsClass = QuantizedAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The float value that the lowest quantized {@code x} value represents. + */ + public final Operand minX; + + /** + * The float value that the highest quantized {@code x} value represents. + */ + public final Operand maxX; + + /** + * The float value that the lowest quantized {@code y} value represents. + */ + public final Operand minY; + + /** + * The float value that the highest quantized {@code y} value represents. + */ + public final Operand maxY; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + public Inputs(GraphOperation op) { + super(new QuantizedAdd<>(op), op, Arrays.asList("T1", "T2", "Toutput")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + minX = (Operand) op.input(inputIndex++); + maxX = (Operand) op.input(inputIndex++); + minY = (Operand) op.input(inputIndex++); + maxY = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Toutput = op.attributes().getAttrType("Toutput"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java index 8091f86dd3f..b9f1e5b062c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Returns x * y element-wise, working on quantized buffers. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = QuantizedMul.OP_NAME, + inputsClass = QuantizedMul.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class QuantizedMul extends RawOp { private Output maxZ; - private QuantizedMul(Operation operation) { - super(operation); + public QuantizedMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); minZ = operation.output(outputIdx++); @@ -61,13 +69,13 @@ private QuantizedMul(Operation operation) { * Factory method to create a class wrapping a new QuantizedMul operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param minX The float value that the lowest quantized {@code x} value represents. * @param maxX The float value that the highest quantized {@code x} value represents. * @param minY The float value that the lowest quantized {@code y} value represents. * @param maxY The float value that the highest quantized {@code y} value represents. - * @param Toutput the value of the Toutput property + * @param Toutput The value of the Toutput attribute * @param data type for {@code QuantizedMul} output and operands * @return a new instance of QuantizedMul */ @@ -116,4 +124,68 @@ public Output minZ() { public Output maxZ() { return maxZ; } + + @OpInputsMetadata( + outputsClass = QuantizedMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The float value that the lowest quantized {@code x} value represents. + */ + public final Operand minX; + + /** + * The float value that the highest quantized {@code x} value represents. + */ + public final Operand maxX; + + /** + * The float value that the lowest quantized {@code y} value represents. + */ + public final Operand minY; + + /** + * The float value that the highest quantized {@code y} value represents. + */ + public final Operand maxY; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + public Inputs(GraphOperation op) { + super(new QuantizedMul<>(op), op, Arrays.asList("T1", "T2", "Toutput")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + minX = (Operand) op.input(inputIndex++); + maxX = (Operand) op.input(inputIndex++); + minY = (Operand) op.input(inputIndex++); + maxY = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Toutput = op.attributes().getAttrType("Toutput"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java index 7534337cb26..c85e0d73861 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ * # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j] * tf.real(input) ==> [-2.25, 3.25] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Real.OP_NAME, + inputsClass = Real.Inputs.class +) @Operator( group = "math" ) @@ -55,8 +63,8 @@ public final class Real extends RawOp implements Operand { private Output output; - private Real(Operation operation) { - super(operation); + public Real(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -65,8 +73,8 @@ private Real(Operation operation) { * Factory method to create a class wrapping a new Real operation. * * @param scope current scope - * @param input the input value - * @param Tout the value of the Tout property + * @param input The input value + * @param Tout The value of the Tout attribute * @param data type for {@code Real} output and operands * @return a new instance of Real */ @@ -85,7 +93,7 @@ public static Real create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Real.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tout attribute + */ + public final DataType Tout; + + public Inputs(GraphOperation op) { + super(new Real<>(op), op, Arrays.asList("T", "Tout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tout = op.attributes().getAttrType("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java index 7073764f171..fb2e7e77d33 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * If {@code x} and {@code y} are reals, this will return the floating-point division. *

    NOTE: {@code Div} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = RealDiv.OP_NAME, + inputsClass = RealDiv.Inputs.class +) @Operator( group = "math" ) @@ -46,8 +54,8 @@ public final class RealDiv extends RawOp implements Operand private Output z; - private RealDiv(Operation operation) { - super(operation); + public RealDiv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -56,8 +64,8 @@ private RealDiv(Operation operation) { * Factory method to create a class wrapping a new RealDiv operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code RealDiv} output and operands * @return a new instance of RealDiv */ @@ -84,4 +92,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = RealDiv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RealDiv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java index 6b199d06c72..c0e6b9c573a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the reciprocal of x element-wise. * I.e., \(y = 1 / x\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Reciprocal.OP_NAME, + inputsClass = Reciprocal.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Reciprocal extends RawOp implements Operand< private Output y; - private Reciprocal(Operation operation) { - super(operation); + public Reciprocal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Reciprocal(Operation operation) { * Factory method to create a class wrapping a new Reciprocal operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Reciprocal} output and operands * @return a new instance of Reciprocal */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Reciprocal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Reciprocal<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java index 1865d94ada7..9d1c672629f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient for the inverse of {@code x} wrt its input. * Specifically, {@code grad = -dy * y*y}, where {@code y = 1/x}, and {@code dy} * is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = ReciprocalGrad.OP_NAME, + inputsClass = ReciprocalGrad.Inputs.class +) +@Operator( + group = "math" +) public final class ReciprocalGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class ReciprocalGrad extends RawOp implements Oper private Output z; - private ReciprocalGrad(Operation operation) { - super(operation); + public ReciprocalGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private ReciprocalGrad(Operation operation) { * Factory method to create a class wrapping a new ReciprocalGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code ReciprocalGrad} output and operands * @return a new instance of ReciprocalGrad */ @@ -80,4 +92,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = ReciprocalGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ReciprocalGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java index d1b018c5a51..a0681e950ab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,33 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes requantization range per channel. */ +@OpMetadata( + opType = RequantizationRangePerChannel.OP_NAME, + inputsClass = RequantizationRangePerChannel.Inputs.class +) +@Operator( + group = "math" +) public final class RequantizationRangePerChannel extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +54,8 @@ public final class RequantizationRangePerChannel extends RawOp { private Output outputMax; - private RequantizationRangePerChannel(Operation operation) { - super(operation); + public RequantizationRangePerChannel(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputMin = operation.output(outputIdx++); outputMax = operation.output(outputIdx++); @@ -88,4 +102,45 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = RequantizationRangePerChannel.class + ) + public static class Inputs extends RawOpInputs { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The minimum value of the input tensor + */ + public final Operand inputMin; + + /** + * The maximum value of the input tensor. + */ + public final Operand inputMax; + + /** + * The quantized type of input tensor that needs to be converted. + */ + public final DataType T; + + /** + * The maximum value of the output that needs to be clipped. + * Example: set this to 6 for Relu6. + */ + public final float clipValueMax; + + public Inputs(GraphOperation op) { + super(new RequantizationRangePerChannel(op), op, Arrays.asList("T", "clip_value_max")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + clipValueMax = op.attributes().getAttrFloat("clip_value_max"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java index 833e4472731..f6dcf220ade 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Requantizes input with min and max values known per channel. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RequantizePerChannel.OP_NAME, + inputsClass = RequantizePerChannel.Inputs.class +) +@Operator( + group = "math" +) public final class RequantizePerChannel extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class RequantizePerChannel extends RawOp { private Output outputMax; - private RequantizePerChannel(Operation operation) { - super(operation); + public RequantizePerChannel(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -109,4 +121,56 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = RequantizePerChannel.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The minimum value of the input tensor + */ + public final Operand inputMin; + + /** + * The maximum value of the input tensor. + */ + public final Operand inputMax; + + /** + * The minimum value of the output tensor requested. + */ + public final Operand requestedOutputMin; + + /** + * The maximum value of the output tensor requested. + */ + public final Operand requestedOutputMax; + + /** + * The quantized type of input tensor that needs to be converted. + */ + public final DataType T; + + /** + * The quantized type of output tensor that needs to be converted. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new RequantizePerChannel<>(op), op, Arrays.asList("T", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + requestedOutputMin = (Operand) op.input(inputIndex++); + requestedOutputMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java index e1eb0d407d9..62a48d4ecd0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -37,9 +43,11 @@ * rint(0.5000001) ==> 1.0 * rint([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) ==> [-2., -2., -0., 0., 2., 2., 2.] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Rint.OP_NAME, + inputsClass = Rint.Inputs.class +) @Operator( group = "math" ) @@ -51,8 +59,8 @@ public final class Rint extends RawOp implements Operand { private Output y; - private Rint(Operation operation) { - super(operation); + public Rint(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -61,7 +69,7 @@ private Rint(Operation operation) { * Factory method to create a class wrapping a new Rint operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Rint} output and operands * @return a new instance of Rint */ @@ -87,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Rint.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Rint<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java index 1adeea2a548..0e7441efeb1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Rounds the values of a tensor to the nearest integer, element-wise. * Rounds half to even. Also known as bankers rounding. If you want to round * according to the current system rounding mode use std::cint. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Round.OP_NAME, + inputsClass = Round.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Round extends RawOp implements Operand { private Output y; - private Round(Operation operation) { - super(operation); + public Round(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -55,7 +63,7 @@ private Round(Operation operation) { * Factory method to create a class wrapping a new Round operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Round} output and operands * @return a new instance of Round */ @@ -81,4 +89,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Round.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Round<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java index be3fa6fdac3..3d438f10f12 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes reciprocal of square root of x element-wise. * I.e., \(y = 1 / \sqrt{x}\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Rsqrt.OP_NAME, + inputsClass = Rsqrt.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Rsqrt extends RawOp implements Operand { private Output y; - private Rsqrt(Operation operation) { - super(operation); + public Rsqrt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Rsqrt(Operation operation) { * Factory method to create a class wrapping a new Rsqrt operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Rsqrt} output and operands * @return a new instance of Rsqrt */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Rsqrt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Rsqrt<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java index 6e0c26a41a4..90fc4892083 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient for the rsqrt of {@code x} wrt its input. * Specifically, {@code grad = dy * -0.5 * y^3}, where {@code y = rsqrt(x)}, and {@code dy} * is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = RsqrtGrad.OP_NAME, + inputsClass = RsqrtGrad.Inputs.class +) +@Operator( + group = "math" +) public final class RsqrtGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class RsqrtGrad extends RawOp implements Operand z; - private RsqrtGrad(Operation operation) { - super(operation); + public RsqrtGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private RsqrtGrad(Operation operation) { * Factory method to create a class wrapping a new RsqrtGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code RsqrtGrad} output and operands * @return a new instance of RsqrtGrad */ @@ -79,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = RsqrtGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RsqrtGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java index 364dcf15551..44ec468eaf4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,20 +41,43 @@ *

    Computes a tensor such that * \(output_i = \max_j(data_j)\) where {@code max} is over {@code j} such * that {@code segment_ids[j] == i}. - *

    If the max is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    + *

    If the maximum is empty for a given segment ID {@code i}, it outputs the smallest + * possible value for the specific numeric type, + * {@code output[i] = numeric_limits::lowest()}. + *

    Note: That this op is currently only supported with jit_compile=True. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as the same as a smaller following index. + *

    The only difference with SegmentMax is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) should be equal to {@code num_segments} - 1 for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned + * smallest possible value for the specific numeric type. *

    For example: - *

    + * 
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentMaxV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_max(c, tf.constant([0, 0, 1])) - * # ==> [[4, 3, 3, 4], - * # [5, 6, 7, 8]] - *

    - * - * @param data type for {@code output} output + * test(c).numpy() + * array([[4, 3, 3, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * */ +@OpMetadata( + opType = SegmentMax.OP_NAME, + inputsClass = SegmentMax.Inputs.class +) @Operator( group = "math" ) @@ -56,41 +85,47 @@ public final class SegmentMax extends RawOp implements Operan /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMax"; + public static final String OP_NAME = "SegmentMaxV2"; private Output output; - private SegmentMax(Operation operation) { - super(operation); + public SegmentMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SegmentMax operation. + * Factory method to create a class wrapping a new SegmentMaxV2 operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentMax} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentMaxV2} output and operands * @return a new instance of SegmentMax */ @Endpoint( describeByClass = true ) public static SegmentMax create(Scope scope, Operand data, - Operand segmentIds) { + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentMax"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + opBuilder.addInput(numSegments.asOutput()); return new SegmentMax<>(opBuilder.build()); } /** * Gets output. - * Has same shape as data, except for dimension 0 which - * has size {@code k}, the number of segments. + * Has same shape as data, except for the first {@code segment_ids.rank} + * dimensions, which are replaced with a single dimensionw which has size + * {@code num_segments}. * @return output. */ public Output output() { @@ -101,4 +136,54 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SegmentMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor whose size is equal to the size of {@code data}'s + * first dimension. Values should be sorted and can be repeated. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new SegmentMax<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java index b3f41259f52..2e69b2bb8b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,19 +44,31 @@ * over {@code j} such that {@code segment_ids[j] == i} and {@code N} is the total number of * values summed. *

    If the mean is empty for a given segment ID {@code i}, {@code output[i] = 0}. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as a smaller following index when computing the numerator + * of the mean. *

    * *
    *

    For example: - *

    - * c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
    - * tf.segment_mean(c, tf.constant([0, 0, 1]))
    - * # ==> [[2.5, 2.5, 2.5, 2.5],
    - * #      [5, 6, 7, 8]]
    - * 
    - * - * @param data type for {@code output} output + *
    + *
    + *
    + *

    c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) + * tf.math.segment_mean(c, tf.constant([0, 0, 1])).numpy() + * array([[2.5, 2.5, 2.5, 2.5], + * [5., 6., 7., 8.]], dtype=float32) + *

    + *
    + *
    */ +@OpMetadata( + opType = SegmentMean.OP_NAME, + inputsClass = SegmentMean.Inputs.class +) @Operator( group = "math" ) @@ -62,8 +80,8 @@ public final class SegmentMean extends RawOp implements Operand private Output output; - private SegmentMean(Operation operation) { - super(operation); + public SegmentMean(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -72,9 +90,11 @@ private SegmentMean(Operation operation) { * Factory method to create a class wrapping a new SegmentMean operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. * @param data type for {@code SegmentMean} output and operands * @return a new instance of SegmentMean */ @@ -103,4 +123,41 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SegmentMean.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor whose size is equal to the size of {@code data}'s + * first dimension. Values should be sorted and can be repeated. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new SegmentMean<>(op), op, Arrays.asList("T", "Tindices")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java index 2f2fc4a349b..9dce52fceed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,20 +41,43 @@ *

    Computes a tensor such that * \(output_i = \min_j(data_j)\) where {@code min} is over {@code j} such * that {@code segment_ids[j] == i}. - *

    If the min is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    + *

    If the minimum is empty for a given segment ID {@code i}, it outputs the largest + * possible value for the specific numeric type, + * {@code output[i] = numeric_limits::max()}. + *

    Note: That this op is currently only supported with jit_compile=True. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be sorted, + * and an error is thrown for indices that are not increasing. On GPU, this + * does not throw an error for unsorted indices. On GPU, out-of-order indices + * result in safe but unspecified behavior, which may include treating + * out-of-order indices as the same as a smaller following index. + *

    The only difference with SegmentMin is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) should be equal to {@code num_segments} - 1 for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned + * the largest possible value for the specific numeric type. *

    For example: - *

    + * 
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentMinV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_min(c, tf.constant([0, 0, 1])) - * # ==> [[1, 2, 2, 1], - * # [5, 6, 7, 8]] - *

    - * - * @param data type for {@code output} output + * test(c).numpy() + * array([[1, 2, 2, 1], + * [5, 6, 7, 8]], dtype=int32) + * + * + * */ +@OpMetadata( + opType = SegmentMin.OP_NAME, + inputsClass = SegmentMin.Inputs.class +) @Operator( group = "math" ) @@ -56,41 +85,47 @@ public final class SegmentMin extends RawOp implements Operan /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMin"; + public static final String OP_NAME = "SegmentMinV2"; private Output output; - private SegmentMin(Operation operation) { - super(operation); + public SegmentMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SegmentMin operation. + * Factory method to create a class wrapping a new SegmentMinV2 operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentMin} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentMinV2} output and operands * @return a new instance of SegmentMin */ @Endpoint( describeByClass = true ) public static SegmentMin create(Scope scope, Operand data, - Operand segmentIds) { + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentMin"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + opBuilder.addInput(numSegments.asOutput()); return new SegmentMin<>(opBuilder.build()); } /** * Gets output. - * Has same shape as data, except for dimension 0 which - * has size {@code k}, the number of segments. + * Has same shape as data, except for the first {@code segment_ids.rank} + * dimensions, which are replaced with a single dimensionw which has size + * {@code num_segments}. * @return output. */ public Output output() { @@ -101,4 +136,54 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SegmentMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor whose size is equal to the size of {@code data}'s + * first dimension. Values should be sorted and can be repeated. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new SegmentMin<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java index 3bd1645daa8..77fd53d92a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -37,19 +43,34 @@ * \(output_i = \prod_j data_j\) where the product is over {@code j} such * that {@code segment_ids[j] == i}. *

    If the product is empty for a given segment ID {@code i}, {@code output[i] = 1}. - *

    - * - *
    + *

    Note: That this op is currently only supported with jit_compile=True. + *

    The only difference with SegmentProd is the additional input {@code num_segments}. + * This helps in evaluating the output shape in compile time. + * {@code num_segments} should be consistent with segment_ids. + * e.g. Max(segment_ids) - 1 should be equal to {@code num_segments} for a 1-d segment_ids + * With inconsistent num_segments, the op still runs. only difference is, + * the output takes the size of num_segments irrespective of size of segment_ids and data. + * for num_segments less than expected output size, the last elements are ignored + * for num_segments more than the expected output size, last elements are assigned 1. *

    For example: - *

    + * 
    + *
    + *
    + *

    {@literal @}tf.function(jit_compile=True) + * ... def test(c): + * ... return tf.raw_ops.SegmentProdV2(data=c, segment_ids=tf.constant([0, 0, 1]), num_segments=2) * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) - * tf.segment_prod(c, tf.constant([0, 0, 1])) - * # ==> [[4, 6, 6, 4], - * # [5, 6, 7, 8]] - *

    - * - * @param data type for {@code output} output + * test(c).numpy() + * array([[4, 6, 6, 4], + * [5, 6, 7, 8]], dtype=int32) + * + * + * */ +@OpMetadata( + opType = SegmentProd.OP_NAME, + inputsClass = SegmentProd.Inputs.class +) @Operator( group = "math" ) @@ -57,41 +78,47 @@ public final class SegmentProd extends RawOp implements Operand /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentProd"; + public static final String OP_NAME = "SegmentProdV2"; private Output output; - private SegmentProd(Operation operation) { - super(operation); + public SegmentProd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SegmentProd operation. + * Factory method to create a class wrapping a new SegmentProdV2 operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentProd} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentProdV2} output and operands * @return a new instance of SegmentProd */ @Endpoint( describeByClass = true ) public static SegmentProd create(Scope scope, Operand data, - Operand segmentIds) { + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentProd"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + opBuilder.addInput(numSegments.asOutput()); return new SegmentProd<>(opBuilder.build()); } /** * Gets output. - * Has same shape as data, except for dimension 0 which - * has size {@code k}, the number of segments. + * Has same shape as data, except for the first {@code segment_ids.rank} + * dimensions, which are replaced with a single dimensionw which has size + * {@code num_segments}. * @return output. */ public Output output() { @@ -102,4 +129,54 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SegmentProd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor whose size is equal to the size of {@code data}'s + * first dimension. Values should be sorted and can be repeated. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new SegmentProd<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java index c2cc2fb479a..c47c3acd24f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -37,19 +43,12 @@ * \(output_i = \sum_j data_j\) where sum is over {@code j} such * that {@code segment_ids[j] == i}. *

    If the sum is empty for a given segment ID {@code i}, {@code output[i] = 0}. - *

    - * - *
    - *

    For example: - *

    - * c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
    - * tf.segment_sum(c, tf.constant([0, 0, 1]))
    - * # ==> [[5, 5, 5, 5],
    - * #      [5, 6, 7, 8]]
    - * 
    - * - * @param data type for {@code output} output + *

    Note that this op is currently only supported with jit_compile=True. */ +@OpMetadata( + opType = SegmentSum.OP_NAME, + inputsClass = SegmentSum.Inputs.class +) @Operator( group = "math" ) @@ -57,41 +56,47 @@ public final class SegmentSum extends RawOp implements Operand< /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentSum"; + public static final String OP_NAME = "SegmentSumV2"; private Output output; - private SegmentSum(Operation operation) { - super(operation); + public SegmentSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SegmentSum operation. + * Factory method to create a class wrapping a new SegmentSumV2 operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A 1-D tensor whose size is equal to the size of {@code data}'s * first dimension. Values should be sorted and can be repeated. - * @param data type for {@code SegmentSum} output and operands + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + * @param numSegments The numSegments value + * @param data type for {@code SegmentSumV2} output and operands * @return a new instance of SegmentSum */ @Endpoint( describeByClass = true ) public static SegmentSum create(Scope scope, Operand data, - Operand segmentIds) { + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SegmentSum"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + opBuilder.addInput(numSegments.asOutput()); return new SegmentSum<>(opBuilder.build()); } /** * Gets output. - * Has same shape as data, except for dimension 0 which - * has size {@code k}, the number of segments. + * Has same shape as data, except for the first {@code segment_ids.rank} + * dimensions, which are replaced with a single dimension which has size + * {@code num_segments}. * @return output. */ public Output output() { @@ -102,4 +107,54 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SegmentSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor whose size is equal to the size of {@code data}'s + * first dimension. Values should be sorted and can be repeated. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be sorted on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new SegmentSum<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java index 485274fa7ee..8e71006a2c0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes sigmoid of {@code x} element-wise. * Specifically, {@code y = 1 / (1 + exp(-x))}. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Sigmoid.OP_NAME, + inputsClass = Sigmoid.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Sigmoid extends RawOp implements Operand private Output y; - private Sigmoid(Operation operation) { - super(operation); + public Sigmoid(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Sigmoid(Operation operation) { * Factory method to create a class wrapping a new Sigmoid operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Sigmoid} output and operands * @return a new instance of Sigmoid */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Sigmoid.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sigmoid<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java index a5c4a9ebfbf..a85b754cc61 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient of the sigmoid of {@code x} wrt its input. * Specifically, {@code grad = dy * y * (1 - y)}, where {@code y = sigmoid(x)}, and * {@code dy} is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = SigmoidGrad.OP_NAME, + inputsClass = SigmoidGrad.Inputs.class +) +@Operator( + group = "math" +) public final class SigmoidGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class SigmoidGrad extends RawOp implements Operand private Output z; - private SigmoidGrad(Operation operation) { - super(operation); + public SigmoidGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private SigmoidGrad(Operation operation) { * Factory method to create a class wrapping a new SigmoidGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code SigmoidGrad} output and operands * @return a new instance of SigmoidGrad */ @@ -79,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = SigmoidGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SigmoidGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java index ccdba9e8bb8..ee9d2d65154 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,9 +46,11 @@ * * * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Sign.OP_NAME, + inputsClass = Sign.Inputs.class +) @Operator( group = "math" ) @@ -54,8 +62,8 @@ public final class Sign extends RawOp implements Operand { private Output y; - private Sign(Operation operation) { - super(operation); + public Sign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -64,7 +72,7 @@ private Sign(Operation operation) { * Factory method to create a class wrapping a new Sign operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Sign} output and operands * @return a new instance of Sign */ @@ -90,4 +98,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Sign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sign<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java index 25913e2d26e..1a13ada1838 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10, float("inf")]) * tf.math.sin(x) ==> [nan -0.4121185 -0.47942555 0.84147096 0.9320391 -0.87329733 -0.54402107 nan] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Sin.OP_NAME, + inputsClass = Sin.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Sin extends RawOp implements Operand { private Output y; - private Sin(Operation operation) { - super(operation); + public Sin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private Sin(Operation operation) { * Factory method to create a class wrapping a new Sin operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Sin} output and operands * @return a new instance of Sin */ @@ -86,4 +94,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Sin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sin<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java index 14c8e9a2d9c..b4af201ab99 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 2, 10, float("inf")]) * tf.math.sinh(x) ==> [-inf -4.0515420e+03 -5.2109528e-01 1.1752012e+00 1.5094614e+00 3.6268604e+00 1.1013232e+04 inf] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Sinh.OP_NAME, + inputsClass = Sinh.Inputs.class +) @Operator( group = "math" ) @@ -50,8 +58,8 @@ public final class Sinh extends RawOp implements Operand { private Output y; - private Sinh(Operation operation) { - super(operation); + public Sinh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private Sinh(Operation operation) { * Factory method to create a class wrapping a new Sinh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Sinh} output and operands * @return a new instance of Sinh */ @@ -86,4 +94,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Sinh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sinh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java index ad9d308baa8..5989ca78f57 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -33,9 +40,14 @@ * Generates points from the Sobol sequence. * Creates a Sobol sequence with {@code num_results} samples. Each sample has dimension * {@code dim}. Skips the first {@code skip} samples. - * - * @param data type for {@code samples} output */ +@OpMetadata( + opType = SobolSample.OP_NAME, + inputsClass = SobolSample.Inputs.class +) +@Operator( + group = "math" +) public final class SobolSample extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +56,8 @@ public final class SobolSample extends RawOp implements Opera private Output samples; - private SobolSample(Operation operation) { - super(operation); + public SobolSample(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; samples = operation.output(outputIdx++); } @@ -108,4 +120,40 @@ public Output samples() { public Output asOutput() { return samples; } + + @OpInputsMetadata( + outputsClass = SobolSample.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Positive scalar {@code Tensor} representing each sample's dimension. + */ + public final Operand dim; + + /** + * Positive scalar {@code Tensor} of dtype int32. The number of Sobol points to return + * in the output. + */ + public final Operand numResults; + + /** + * Positive scalar {@code Tensor} of dtype int32. The number of initial points of the + * Sobol sequence to skip. + */ + public final Operand skip; + + /** + * The type of the sample. One of: {@code float32} or {@code float64}. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new SobolSample<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + dim = (Operand) op.input(inputIndex++); + numResults = (Operand) op.input(inputIndex++); + skip = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java index b8e861fda0d..cdb0aea4f9f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Softplus operation - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Softplus.OP_NAME, + inputsClass = Softplus.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Softplus extends RawOp implements Operand< private Output activations; - private Softplus(Operation operation) { - super(operation); + public Softplus(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Softplus(Operation operation) { * Factory method to create a class wrapping a new Softplus operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Softplus} output and operands * @return a new instance of Softplus */ @@ -79,4 +87,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Softplus.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Softplus<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java index 56f08bc78b6..3f2901810ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes softplus gradients for a softplus operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = SoftplusGrad.OP_NAME, + inputsClass = SoftplusGrad.Inputs.class +) +@Operator( + group = "math" +) public final class SoftplusGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class SoftplusGrad extends RawOp implements Oper private Output backprops; - private SoftplusGrad(Operation operation) { - super(operation); + public SoftplusGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -78,4 +90,32 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = SoftplusGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding softplus operation. + */ + public final Operand gradients; + + /** + * The features passed as input to the corresponding softplus operation. + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SoftplusGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java index 81a0fd29f58..8c6edfc6e89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes square root of x element-wise. * I.e., \(y = \sqrt{x} = x^{1/2}\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Sqrt.OP_NAME, + inputsClass = Sqrt.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Sqrt extends RawOp implements Operand { private Output y; - private Sqrt(Operation operation) { - super(operation); + public Sqrt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Sqrt(Operation operation) { * Factory method to create a class wrapping a new Sqrt operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Sqrt} output and operands * @return a new instance of Sqrt */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Sqrt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sqrt<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java index eae4da43173..eed0209152b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient for the sqrt of {@code x} wrt its input. * Specifically, {@code grad = dy * 0.5 / y}, where {@code y = sqrt(x)}, and {@code dy} * is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = SqrtGrad.OP_NAME, + inputsClass = SqrtGrad.Inputs.class +) +@Operator( + group = "math" +) public final class SqrtGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class SqrtGrad extends RawOp implements Operand private Output z; - private SqrtGrad(Operation operation) { - super(operation); + public SqrtGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private SqrtGrad(Operation operation) { * Factory method to create a class wrapping a new SqrtGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code SqrtGrad} output and operands * @return a new instance of SqrtGrad */ @@ -79,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = SqrtGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SqrtGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java index 19622576247..2952af307d2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes square of x element-wise. * I.e., \(y = x * x = x^2\). - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Square.OP_NAME, + inputsClass = Square.Inputs.class +) @Operator( group = "math" ) @@ -44,8 +52,8 @@ public final class Square extends RawOp implements Operand { private Output y; - private Square(Operation operation) { - super(operation); + public Square(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private Square(Operation operation) { * Factory method to create a class wrapping a new Square operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Square} output and operands * @return a new instance of Square */ @@ -80,4 +88,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Square.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Square<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 cb01df2fd23..4d880a79baa 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns conj(x - y)(x - y) element-wise. * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = SquaredDifference.OP_NAME, + inputsClass = SquaredDifference.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class SquaredDifference extends RawOp implements O private Output z; - private SquaredDifference(Operation operation) { - super(operation); + public SquaredDifference(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private SquaredDifference(Operation operation) { * Factory method to create a class wrapping a new SquaredDifference operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code SquaredDifference} output and operands * @return a new instance of SquaredDifference */ @@ -84,4 +92,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = SquaredDifference.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SquaredDifference<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java index 006833e67d6..b48b311d80e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns x - y element-wise. * NOTE: {@code math.Sub} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Sub.OP_NAME, + inputsClass = Sub.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Sub extends RawOp implements Operand { private Output z; - private Sub(Operation operation) { - super(operation); + public Sub(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Sub(Operation operation) { * Factory method to create a class wrapping a new Sub operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Sub} output and operands * @return a new instance of Sub */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Sub.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Sub<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java index 69d3fd517d4..c1073f8a5bb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ * x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")]) * tf.math.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan] * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Tan.OP_NAME, + inputsClass = Tan.Inputs.class +) @Operator( group = "math" ) @@ -51,8 +59,8 @@ public final class Tan extends RawOp implements Operand { private Output y; - private Tan(Operation operation) { - super(operation); + public Tan(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -61,7 +69,7 @@ private Tan(Operation operation) { * Factory method to create a class wrapping a new Tan operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Tan} output and operands * @return a new instance of Tan */ @@ -87,4 +95,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Tan.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Tan<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 2bbdb6d5078..706a8d90cd0 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -38,14 +44,16 @@ *

    x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) * tf.math.tanh(x) * <tf.Tensor: shape=(8,), dtype=float32, numpy= - * array([-1. , -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , - * 0.9640276 , 0.9950547 , 1. ], dtype=float32)> + * array([-1.0, -0.99990916, -0.46211717, 0.7615942 , 0.8336547 , + * 0.9640276 , 0.9950547 , 1.0], dtype=float32)> * * * - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Tanh.OP_NAME, + inputsClass = Tanh.Inputs.class +) @Operator( group = "math" ) @@ -57,8 +65,8 @@ public final class Tanh extends RawOp implements Operand { private Output y; - private Tanh(Operation operation) { - super(operation); + public Tanh(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private Tanh(Operation operation) { * Factory method to create a class wrapping a new Tanh operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Tanh} output and operands * @return a new instance of Tanh */ @@ -93,4 +101,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Tanh.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Tanh<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java index 3ee48eb3711..273adcf20a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient for the tanh of {@code x} wrt its input. * Specifically, {@code grad = dy * (1 - y*y)}, where {@code y = tanh(x)}, and {@code dy} * is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = TanhGrad.OP_NAME, + inputsClass = TanhGrad.Inputs.class +) +@Operator( + group = "math" +) public final class TanhGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class TanhGrad extends RawOp implements Operand private Output z; - private TanhGrad(Operation operation) { - super(operation); + public TanhGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private TanhGrad(Operation operation) { * Factory method to create a class wrapping a new TanhGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code TanhGrad} output and operands * @return a new instance of TanhGrad */ @@ -79,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = TanhGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TanhGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java index 8bd43a99784..7857bd6221b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,27 +17,35 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** - * Returns x / y element-wise for integer types. + * Returns x / y element-wise, rounded towards zero. * Truncation designates that negative numbers will round fractional quantities * toward zero. I.e. -7 / 5 = -1. This matches C semantics but it is different * than Python semantics. See {@code FloorDiv} for a division function that matches * Python Semantics. *

    NOTE: {@code math.TruncateDiv} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = TruncateDiv.OP_NAME, + inputsClass = TruncateDiv.Inputs.class +) @Operator( group = "math" ) @@ -49,8 +57,8 @@ public final class TruncateDiv extends RawOp implements Operand private Output z; - private TruncateDiv(Operation operation) { - super(operation); + public TruncateDiv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -59,8 +67,8 @@ private TruncateDiv(Operation operation) { * Factory method to create a class wrapping a new TruncateDiv operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code TruncateDiv} output and operands * @return a new instance of TruncateDiv */ @@ -87,4 +95,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = TruncateDiv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TruncateDiv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java index c1614618783..bd7a41fafd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +38,11 @@ * the result here is consistent with a truncating divide. E.g. {@code truncate(x / y) * y + truncate_mod(x, y) = x}. *

    NOTE: {@code math.TruncateMod} supports broadcasting. More about broadcasting * here - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = TruncateMod.OP_NAME, + inputsClass = TruncateMod.Inputs.class +) @Operator( group = "math" ) @@ -46,8 +54,8 @@ public final class TruncateMod extends RawOp implements Opera private Output z; - private TruncateMod(Operation operation) { - super(operation); + public TruncateMod(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -56,8 +64,8 @@ private TruncateMod(Operation operation) { * Factory method to create a class wrapping a new TruncateMod operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code TruncateMod} output and operands * @return a new instance of TruncateMod */ @@ -84,4 +92,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = TruncateMod.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TruncateMod<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UniformQuantizedAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UniformQuantizedAdd.java new file mode 100644 index 00000000000..312c712b44e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UniformQuantizedAdd.java @@ -0,0 +1,404 @@ +/* Copyright 2018-2023 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.math; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform quantized add of quantized Tensor {@code lhs} and quantized Tensor {@code rhs} to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized add on {@code lhs} and {@code rhs} to make quantized {@code output}. + *

    {@code math.UniformQuantizedAdd} follows Numpy broadcasting rules. + * The two input array shapes are compared element-wise. + * Starting with the trailing dimensions, the two dimensions either have to be equal or one of them needs to be 1. + *

    {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + *

    + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)
    + * 
    + *

    {@code output} is also quantized, using the same formula. + *

    If {@code lhs} and {@code output} is both per-axis quantized, the quantization axis must match. + * Also, if {@code rhs} and {@code output} is both per-axis quantized, the quantization axis must match. + * Match means the axis must match when adding, regarding the broadcasting. + * i.e. For both operands {@code lhs} and {@code rhs}, + * if {@code operand.quantization_axis} >= 0 and {@code output.quantization_axis} >= 0, + * {@code operand.dims} - {@code operand.quantization_axis} must be equal to {@code output.dims} - {@code output.quantization_axis}. + */ +@OpMetadata( + opType = UniformQuantizedAdd.OP_NAME, + inputsClass = UniformQuantizedAdd.Inputs.class +) +@Operator( + group = "math" +) +public final class UniformQuantizedAdd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedAdd"; + + private Output output; + + public UniformQuantizedAdd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedAdd operation. + * + * @param scope current scope + * @param lhs Must be a quantized tensor. + * @param rhs Must be a quantized tensor. + * @param lhsScales The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + * @param lhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Must have same shape with {@code lhs_scales}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * @param rhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Must have same shape with {@code rhs_scales}. + * @param outputScales The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + * @param outputZeroPoints The int32 value(s) used as zero points when quantizing original data that output represents. + * Must have same shape with {@code output_scales}. + * @param lhsQuantizationMinVal The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedAdd} output and operands + * @return a new instance of UniformQuantizedAdd + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedAdd create(Scope scope, Operand lhs, + Operand rhs, Operand lhsScales, Operand lhsZeroPoints, + Operand rhsScales, Operand rhsZeroPoints, Operand outputScales, + Operand outputZeroPoints, Long lhsQuantizationMinVal, Long lhsQuantizationMaxVal, + Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, Long outputQuantizationMinVal, + Long outputQuantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedAdd"); + opBuilder.addInput(lhs.asOutput()); + opBuilder.addInput(rhs.asOutput()); + opBuilder.addInput(lhsScales.asOutput()); + opBuilder.addInput(lhsZeroPoints.asOutput()); + opBuilder.addInput(rhsScales.asOutput()); + opBuilder.addInput(rhsZeroPoints.asOutput()); + opBuilder.addInput(outputScales.asOutput()); + opBuilder.addInput(outputZeroPoints.asOutput()); + opBuilder.setAttr("lhs_quantization_min_val", lhsQuantizationMinVal); + opBuilder.setAttr("lhs_quantization_max_val", lhsQuantizationMaxVal); + opBuilder.setAttr("rhs_quantization_min_val", rhsQuantizationMinVal); + opBuilder.setAttr("rhs_quantization_max_val", rhsQuantizationMaxVal); + opBuilder.setAttr("output_quantization_min_val", outputQuantizationMinVal); + opBuilder.setAttr("output_quantization_max_val", outputQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.lhsQuantizationAxis != null) { + opBuilder.setAttr("lhs_quantization_axis", opts.lhsQuantizationAxis); + } + if (opts.rhsQuantizationAxis != null) { + opBuilder.setAttr("rhs_quantization_axis", opts.rhsQuantizationAxis); + } + if (opts.outputQuantizationAxis != null) { + opBuilder.setAttr("output_quantization_axis", opts.outputQuantizationAxis); + } + } + } + return new UniformQuantizedAdd<>(opBuilder.build()); + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + return new Options().lhsQuantizationAxis(lhsQuantizationAxis); + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + return new Options().rhsQuantizationAxis(rhsQuantizationAxis); + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options outputQuantizationAxis(Long outputQuantizationAxis) { + return new Options().outputQuantizationAxis(outputQuantizationAxis); + } + + /** + * Gets output. + * The output quantized tensor. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.math.UniformQuantizedAdd} + */ + public static class Options { + private Long lhsQuantizationAxis; + + private Long rhsQuantizationAxis; + + private Long outputQuantizationAxis; + + private Options() { + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + this.lhsQuantizationAxis = lhsQuantizationAxis; + return this; + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + this.rhsQuantizationAxis = rhsQuantizationAxis; + return this; + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options outputQuantizationAxis(Long outputQuantizationAxis) { + this.outputQuantizationAxis = outputQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a quantized tensor. + */ + public final Operand lhs; + + /** + * Must be a quantized tensor. + */ + public final Operand rhs; + + /** + * The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + */ + public final Operand lhsScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Must have same shape with {@code lhs_scales}. + */ + public final Operand lhsZeroPoints; + + /** + * The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + */ + public final Operand rhsScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Must have same shape with {@code rhs_scales}. + */ + public final Operand rhsZeroPoints; + + /** + * The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + */ + public final Operand outputScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that output represents. + * Must have same shape with {@code output_scales}. + */ + public final Operand outputZeroPoints; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + */ + public final long lhsQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long lhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + */ + public final long lhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + */ + public final long rhsQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long rhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + */ + public final long rhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + */ + public final long outputQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long outputQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + */ + public final long outputQuantizationMaxVal; + + /** + * The type of {@code lhs}, {@code rhs}, and {@code output}. + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedAdd<>(op), op, Arrays.asList("lhs_quantization_axis", "lhs_quantization_min_val", "lhs_quantization_max_val", "rhs_quantization_axis", "rhs_quantization_min_val", "rhs_quantization_max_val", "output_quantization_axis", "output_quantization_min_val", "output_quantization_max_val", "T")); + int inputIndex = 0; + lhs = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lhsScales = (Operand) op.input(inputIndex++); + lhsZeroPoints = (Operand) op.input(inputIndex++); + rhsScales = (Operand) op.input(inputIndex++); + rhsZeroPoints = (Operand) op.input(inputIndex++); + outputScales = (Operand) op.input(inputIndex++); + outputZeroPoints = (Operand) op.input(inputIndex++); + lhsQuantizationAxis = op.attributes().getAttrInt("lhs_quantization_axis"); + lhsQuantizationMinVal = op.attributes().getAttrInt("lhs_quantization_min_val"); + lhsQuantizationMaxVal = op.attributes().getAttrInt("lhs_quantization_max_val"); + rhsQuantizationAxis = op.attributes().getAttrInt("rhs_quantization_axis"); + rhsQuantizationMinVal = op.attributes().getAttrInt("rhs_quantization_min_val"); + rhsQuantizationMaxVal = op.attributes().getAttrInt("rhs_quantization_max_val"); + outputQuantizationAxis = op.attributes().getAttrInt("output_quantization_axis"); + outputQuantizationMinVal = op.attributes().getAttrInt("output_quantization_min_val"); + outputQuantizationMaxVal = op.attributes().getAttrInt("output_quantization_max_val"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java index dbdeb204a82..27888d7f1f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,8 +38,7 @@ * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the maximum such that: *

    \(output_i = \max_{j...} data[j...]\) where max is over tuples {@code j...} such * that {@code segment_ids[j...] == i}. @@ -42,19 +47,31 @@ * {@code output[i] = numeric_limits::lowest()}. *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. *

    * *
    *

    For example: - *

    - * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    - * tf.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2)
    - * # ==> [[ 4,  3, 3, 4],
    - * #       [5,  6, 7, 8]]
    - * 
    - * - * @param data type for {@code output} output + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[4, 3, 3, 4], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    */ +@OpMetadata( + opType = UnsortedSegmentMax.OP_NAME, + inputsClass = UnsortedSegmentMax.Inputs.class +) @Operator( group = "math" ) @@ -66,8 +83,8 @@ public final class UnsortedSegmentMax extends RawOp implement private Output output; - private UnsortedSegmentMax(Operation operation) { - super(operation); + public UnsortedSegmentMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,9 +93,12 @@ private UnsortedSegmentMax(Operation operation) { * Factory method to create a class wrapping a new UnsortedSegmentMax operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentMax} output and operands * @return a new instance of UnsortedSegmentMax */ @@ -109,4 +129,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnsortedSegmentMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A tensor whose shape is a prefix of {@code data.shape}. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new UnsortedSegmentMax<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java index 7d2a113e53d..af919665a56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,8 +38,7 @@ * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the minimum such that: *

    \(output_i = \min_{j...} data_[j...]\) where min is over tuples {@code j...} such * that {@code segment_ids[j...] == i}. @@ -41,17 +46,29 @@ * possible value for the specific numeric type, * {@code output[i] = numeric_limits::max()}. *

    For example: - *

    - * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    - * tf.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2)
    - * # ==> [[ 1,  2, 2, 1],
    - * #       [5,  6, 7, 8]]
    - * 
    + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[1, 2, 2, 1], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. - * - * @param data type for {@code output} output + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. */ +@OpMetadata( + opType = UnsortedSegmentMin.OP_NAME, + inputsClass = UnsortedSegmentMin.Inputs.class +) @Operator( group = "math" ) @@ -63,8 +80,8 @@ public final class UnsortedSegmentMin extends RawOp implement private Output output; - private UnsortedSegmentMin(Operation operation) { - super(operation); + public UnsortedSegmentMin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -73,9 +90,12 @@ private UnsortedSegmentMin(Operation operation) { * Factory method to create a class wrapping a new UnsortedSegmentMin operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentMin} output and operands * @return a new instance of UnsortedSegmentMin */ @@ -106,4 +126,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnsortedSegmentMin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A tensor whose shape is a prefix of {@code data.shape}. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new UnsortedSegmentMin<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java index eda5093e66a..fd3f76bc1e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,25 +39,36 @@ * Read * the section on segmentation * for an explanation of segments. - *

    This operator is similar to the unsorted segment sum operator found - * (here) . + *

    This operator is similar to {@code tf.math.unsorted_segment_sum}, * Instead of computing the sum over segments, it computes the product of all * entries belonging to a segment such that: *

    \(output_i = \prod_{j...} data[j...]\) where the product is over tuples * {@code j...} such that {@code segment_ids[j...] == i}. *

    For example: - *

    - * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    - * tf.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2)
    - * # ==> [[ 4,  6, 6, 4],
    - * #       [5,  6, 7, 8]]
    - * 
    + *
    + *
    + *
    + *

    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) + * tf.math.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2).numpy() + * array([[4, 6, 6, 4], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    *

    If there is no entry for a given segment ID {@code i}, it outputs 1. *

    If the given segment ID {@code i} is negative, then the corresponding value is * dropped, and will not be included in the result. - * - * @param data type for {@code output} output + * Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. */ +@OpMetadata( + opType = UnsortedSegmentProd.OP_NAME, + inputsClass = UnsortedSegmentProd.Inputs.class +) @Operator( group = "math" ) @@ -63,8 +80,8 @@ public final class UnsortedSegmentProd extends RawOp implements private Output output; - private UnsortedSegmentProd(Operation operation) { - super(operation); + public UnsortedSegmentProd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -73,9 +90,12 @@ private UnsortedSegmentProd(Operation operation) { * Factory method to create a class wrapping a new UnsortedSegmentProd operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentProd} output and operands * @return a new instance of UnsortedSegmentProd */ @@ -106,4 +126,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnsortedSegmentProd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A tensor whose shape is a prefix of {@code data.shape}. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new UnsortedSegmentProd<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java index d5587f5e862..af4dd57e39f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,18 +48,30 @@ * If the given segment ID {@code i} is negative, the value is dropped and will not be * added to the sum of the segment. *

    {@code num_segments} should equal the number of distinct segment IDs. + *

    Caution: On CPU, values in {@code segment_ids} are always validated to be less than + * {@code num_segments}, and an error is thrown for out-of-bound indices. On GPU, this + * does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices + * result in safe but unspecified behavior, which may include ignoring + * out-of-bound indices or outputting a tensor with a 0 stored in the first + * dimension of its shape if {@code num_segments} is 0. *

    * *
    - *
    - * c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
    - * tf.math.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
    - * # ==> [[ 5, 5, 5, 5],
    - * #       [5, 6, 7, 8]]
    - * 
    - * - * @param data type for {@code output} output + *
    + *
    + *
    + *

    c = [[1,2,3,4], [5,6,7,8], [4,3,2,1]] + * tf.math.unsorted_segment_sum(c, [0, 1, 0], num_segments=2).numpy() + * array([[5, 5, 5, 5], + * [5, 6, 7, 8]], dtype=int32) + *

    + *
    + *
    */ +@OpMetadata( + opType = UnsortedSegmentSum.OP_NAME, + inputsClass = UnsortedSegmentSum.Inputs.class +) @Operator( group = "math" ) @@ -65,8 +83,8 @@ public final class UnsortedSegmentSum extends RawOp implements private Output output; - private UnsortedSegmentSum(Operation operation) { - super(operation); + public UnsortedSegmentSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -75,9 +93,12 @@ private UnsortedSegmentSum(Operation operation) { * Factory method to create a class wrapping a new UnsortedSegmentSum operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. - * @param numSegments the numSegments value + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + * @param numSegments The numSegments value * @param data type for {@code UnsortedSegmentSum} output and operands * @return a new instance of UnsortedSegmentSum */ @@ -108,4 +129,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnsortedSegmentSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A tensor whose shape is a prefix of {@code data.shape}. + * The values must be less than {@code num_segments}. + *

    Caution: The values are always validated to be in range on CPU, never validated + * on GPU. + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new UnsortedSegmentSum<>(op), op, Arrays.asList("T", "Tindices", "Tnumsegments")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java index cc6624e1cd0..0ba35ba8a83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns 0 if x == 0, and x / y otherwise, elementwise. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Xdivy.OP_NAME, + inputsClass = Xdivy.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Xdivy extends RawOp implements Operand { private Output z; - private Xdivy(Operation operation) { - super(operation); + public Xdivy(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private Xdivy(Operation operation) { * Factory method to create a class wrapping a new Xdivy operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xdivy} output and operands * @return a new instance of Xdivy */ @@ -81,4 +89,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Xdivy.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Xdivy<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java index 100ff3d2122..c6e6184bed0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Xlog1py.OP_NAME, + inputsClass = Xlog1py.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Xlog1py extends RawOp implements Operand private Output z; - private Xlog1py(Operation operation) { - super(operation); + public Xlog1py(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private Xlog1py(Operation operation) { * Factory method to create a class wrapping a new Xlog1py operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xlog1py} output and operands * @return a new instance of Xlog1py */ @@ -81,4 +89,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Xlog1py.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Xlog1py<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java index edf378b4512..e27ef9a210c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Returns 0 if x == 0, and x * log(y) otherwise, elementwise. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Xlogy.OP_NAME, + inputsClass = Xlogy.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class Xlogy extends RawOp implements Operand { private Output z; - private Xlogy(Operation operation) { - super(operation); + public Xlogy(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -53,8 +61,8 @@ private Xlogy(Operation operation) { * Factory method to create a class wrapping a new Xlogy operation. * * @param scope current scope - * @param x the x value - * @param y the y value + * @param x The x value + * @param y The y value * @param data type for {@code Xlogy} output and operands * @return a new instance of Xlogy */ @@ -81,4 +89,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Xlogy.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The y input + */ + public final Operand y; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Xlogy<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java index 78aa171bfb2..593507c4340 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Compute the Hurwitz zeta function \(\zeta(x, q)\). * The Hurwitz zeta function is defined as: *

    \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = Zeta.OP_NAME, + inputsClass = Zeta.Inputs.class +) @Operator( group = "math" ) @@ -45,8 +53,8 @@ public final class Zeta extends RawOp implements Operand { private Output z; - private Zeta(Operation operation) { - super(operation); + public Zeta(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -55,8 +63,8 @@ private Zeta(Operation operation) { * Factory method to create a class wrapping a new Zeta operation. * * @param scope current scope - * @param x the x value - * @param q the q value + * @param x The x value + * @param q The q value * @param data type for {@code Zeta} output and operands * @return a new instance of Zeta */ @@ -83,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = Zeta.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The q input + */ + public final Operand q; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Zeta<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + q = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java index 6953ecc8077..a208c49973f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.math; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Erfinv operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = erfinv.OP_NAME, + inputsClass = erfinv.Inputs.class +) @Operator( group = "math" ) @@ -43,8 +51,8 @@ public final class erfinv extends RawOp implements Operand private Output y; - private erfinv(Operation operation) { - super(operation); + public erfinv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private erfinv(Operation operation) { * Factory method to create a class wrapping a new Erfinv operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Erfinv} output and operands * @return a new instance of erfinv */ @@ -79,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = erfinv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new erfinv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java index 519967fc69b..839ca6179b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselJ0 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselJ0.OP_NAME, + inputsClass = BesselJ0.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselJ0 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselJ0 extends RawOp implements Operand< private Output y; - private BesselJ0(Operation operation) { - super(operation); + public BesselJ0(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselJ0(Operation operation) { * Factory method to create a class wrapping a new BesselJ0 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselJ0} output and operands * @return a new instance of BesselJ0 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselJ0.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselJ0<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java index 2c7665e4453..6e125a29821 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselJ1 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselJ1.OP_NAME, + inputsClass = BesselJ1.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselJ1 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselJ1 extends RawOp implements Operand< private Output y; - private BesselJ1(Operation operation) { - super(operation); + public BesselJ1(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselJ1(Operation operation) { * Factory method to create a class wrapping a new BesselJ1 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselJ1} output and operands * @return a new instance of BesselJ1 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselJ1.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselJ1<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java index 89f9f9053e6..8ec9f528212 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselK0 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselK0.OP_NAME, + inputsClass = BesselK0.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselK0 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselK0 extends RawOp implements Operand< private Output y; - private BesselK0(Operation operation) { - super(operation); + public BesselK0(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselK0(Operation operation) { * Factory method to create a class wrapping a new BesselK0 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselK0} output and operands * @return a new instance of BesselK0 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselK0.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselK0<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java index 312a80d2c7a..69d5995c59d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselK0e operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselK0e.OP_NAME, + inputsClass = BesselK0e.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselK0e extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselK0e extends RawOp implements Operand private Output y; - private BesselK0e(Operation operation) { - super(operation); + public BesselK0e(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselK0e(Operation operation) { * Factory method to create a class wrapping a new BesselK0e operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselK0e} output and operands * @return a new instance of BesselK0e */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselK0e.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselK0e<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java index 509eb4af314..f26b95a8c53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselK1 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselK1.OP_NAME, + inputsClass = BesselK1.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselK1 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselK1 extends RawOp implements Operand< private Output y; - private BesselK1(Operation operation) { - super(operation); + public BesselK1(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselK1(Operation operation) { * Factory method to create a class wrapping a new BesselK1 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselK1} output and operands * @return a new instance of BesselK1 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselK1.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselK1<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java index 0044ef761cc..995eaccd9dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselK1e operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselK1e.OP_NAME, + inputsClass = BesselK1e.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselK1e extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselK1e extends RawOp implements Operand private Output y; - private BesselK1e(Operation operation) { - super(operation); + public BesselK1e(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselK1e(Operation operation) { * Factory method to create a class wrapping a new BesselK1e operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselK1e} output and operands * @return a new instance of BesselK1e */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselK1e.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselK1e<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java index 55c8e7de4d9..1beae63d61f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselY0 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselY0.OP_NAME, + inputsClass = BesselY0.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselY0 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselY0 extends RawOp implements Operand< private Output y; - private BesselY0(Operation operation) { - super(operation); + public BesselY0(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselY0(Operation operation) { * Factory method to create a class wrapping a new BesselY0 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselY0} output and operands * @return a new instance of BesselY0 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselY0.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselY0<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java index 8dace2d3cbb..3985dee42d0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The BesselY1 operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = BesselY1.OP_NAME, + inputsClass = BesselY1.Inputs.class +) +@Operator( + group = "math.special" +) public final class BesselY1 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class BesselY1 extends RawOp implements Operand< private Output y; - private BesselY1(Operation operation) { - super(operation); + public BesselY1(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private BesselY1(Operation operation) { * Factory method to create a class wrapping a new BesselY1 operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code BesselY1} output and operands * @return a new instance of BesselY1 */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = BesselY1.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BesselY1<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java index 1c7334efbc9..e34e0376249 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Dawsn operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Dawsn.OP_NAME, + inputsClass = Dawsn.Inputs.class +) +@Operator( + group = "math.special" +) public final class Dawsn extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class Dawsn extends RawOp implements Operand private Output y; - private Dawsn(Operation operation) { - super(operation); + public Dawsn(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private Dawsn(Operation operation) { * Factory method to create a class wrapping a new Dawsn operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Dawsn} output and operands * @return a new instance of Dawsn */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Dawsn.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Dawsn<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java index 75e4da57938..9b61e0fcb90 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Expint operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Expint.OP_NAME, + inputsClass = Expint.Inputs.class +) +@Operator( + group = "math.special" +) public final class Expint extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class Expint extends RawOp implements Operand private Output y; - private Expint(Operation operation) { - super(operation); + public Expint(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private Expint(Operation operation) { * Factory method to create a class wrapping a new Expint operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Expint} output and operands * @return a new instance of Expint */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Expint.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Expint<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java index 62ad26be841..dffb6bda0f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The FresnelCos operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = FresnelCos.OP_NAME, + inputsClass = FresnelCos.Inputs.class +) +@Operator( + group = "math.special" +) public final class FresnelCos extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class FresnelCos extends RawOp implements Operan private Output y; - private FresnelCos(Operation operation) { - super(operation); + public FresnelCos(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private FresnelCos(Operation operation) { * Factory method to create a class wrapping a new FresnelCos operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code FresnelCos} output and operands * @return a new instance of FresnelCos */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = FresnelCos.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FresnelCos<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java index c3f8e75299b..23e7e1d4bbd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The FresnelSin operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = FresnelSin.OP_NAME, + inputsClass = FresnelSin.Inputs.class +) +@Operator( + group = "math.special" +) public final class FresnelSin extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class FresnelSin extends RawOp implements Operan private Output y; - private FresnelSin(Operation operation) { - super(operation); + public FresnelSin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private FresnelSin(Operation operation) { * Factory method to create a class wrapping a new FresnelSin operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code FresnelSin} output and operands * @return a new instance of FresnelSin */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = FresnelSin.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FresnelSin<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java index 96588efcd87..0a012a3be6c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.math.special; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The Spence operation - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = Spence.OP_NAME, + inputsClass = Spence.Inputs.class +) +@Operator( + group = "math.special" +) public final class Spence extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class Spence extends RawOp implements Operand private Output y; - private Spence(Operation operation) { - super(operation); + public Spence(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -49,7 +61,7 @@ private Spence(Operation operation) { * Factory method to create a class wrapping a new Spence operation. * * @param scope current scope - * @param x the x value + * @param x The x value * @param data type for {@code Spence} output and operands * @return a new instance of Spence */ @@ -75,4 +87,26 @@ public Output y() { public Output asOutput() { return y; } + + @OpInputsMetadata( + outputsClass = Spence.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Spence<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java index c96b474b4a0..3d6355679c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Performs average pooling on the input. * Each entry in {@code output} is the mean of the corresponding size {@code ksize} * window in {@code value}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AvgPool.OP_NAME, + inputsClass = AvgPool.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +54,8 @@ public final class AvgPool extends RawOp implements Operand output; - private AvgPool(Operation operation) { - super(operation); + public AvgPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -144,4 +152,54 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = AvgPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand value; + + /** + * The size of the sliding window for each dimension of {@code value}. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of {@code value}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AvgPool<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } 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 d1500731844..5f5410d91d5 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Performs 3D average pooling on the input. * Each entry in {@code output} is the mean of the corresponding size {@code ksize} window in * {@code value}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AvgPool3d.OP_NAME, + inputsClass = AvgPool3d.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +54,8 @@ public final class AvgPool3d extends RawOp implements Operand private Output output; - private AvgPool3d(Operation operation) { - super(operation); + public AvgPool3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -146,4 +154,56 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = AvgPool3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape {@code [batch, depth, rows, cols, channels]} tensor to pool over. + */ + public final Operand input; + + /** + * 1-D tensor of length 5. The size of the window for each dimension of + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. + */ + public final long[] ksize; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AvgPool3d<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java index 9be20b9dd64..4b41a0338b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients of average pooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AvgPool3dGrad.OP_NAME, + inputsClass = AvgPool3dGrad.Inputs.class +) @Operator( group = "nn" ) @@ -45,8 +53,8 @@ public final class AvgPool3dGrad extends RawOp implements Ope private Output output; - private AvgPool3dGrad(Operation operation) { - super(operation); + public AvgPool3dGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -148,4 +156,62 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = AvgPool3dGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input dimensions. + */ + public final Operand origInputShape; + + /** + * Output backprop of shape {@code [batch, depth, rows, cols, channels]}. + */ + public final Operand grad; + + /** + * 1-D tensor of length 5. The size of the window for each dimension of + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. + */ + public final long[] ksize; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AvgPool3dGrad<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + origInputShape = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java index cc6b577a475..9a2c1511bba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients of the average pooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AvgPoolGrad.OP_NAME, + inputsClass = AvgPoolGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class AvgPoolGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class AvgPoolGrad extends RawOp implements Opera private Output output; - private AvgPoolGrad(Operation operation) { - super(operation); + public AvgPoolGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -143,4 +155,61 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = AvgPoolGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. Shape of the original input to {@code avg_pool}. + */ + public final Operand origInputShape; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. + * the output of {@code avg_pool}. + */ + public final Operand grad; + + /** + * The size of the sliding window for each dimension of the input. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the input. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new AvgPoolGrad<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + origInputShape = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java index 3f53920618b..ef7ead8115e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Batch normalization. * This op is deprecated. Prefer {@code tf.nn.batch_normalization}. - * - * @param data type for {@code result} output */ +@OpMetadata( + opType = BatchNormWithGlobalNormalization.OP_NAME, + inputsClass = BatchNormWithGlobalNormalization.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class BatchNormWithGlobalNormalization extends Raw private Output result; - private BatchNormWithGlobalNormalization(Operation operation) { - super(operation); + public BatchNormWithGlobalNormalization(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; result = operation.output(outputIdx++); } @@ -102,4 +110,70 @@ public Output result() { public Output asOutput() { return result; } + + @OpInputsMetadata( + outputsClass = BatchNormWithGlobalNormalization.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D input Tensor. + */ + public final Operand t; + + /** + * A 1D mean Tensor with size matching the last dimension of t. + * This is the first output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand m; + + /** + * A 1D variance Tensor with size matching the last dimension of t. + * This is the second output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand v; + + /** + * A 1D beta Tensor with size matching the last dimension of t. + * An offset to be added to the normalized tensor. + */ + public final Operand beta; + + /** + * A 1D gamma Tensor with size matching the last dimension of t. + * If "scale_after_normalization" is true, this tensor will be multiplied + * with the normalized tensor. + */ + public final Operand gamma; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A small float number to avoid dividing by 0. + */ + public final float varianceEpsilon; + + /** + * A bool indicating whether the resulted tensor + * needs to be multiplied with gamma. + */ + public final boolean scaleAfterNormalization; + + public Inputs(GraphOperation op) { + super(new BatchNormWithGlobalNormalization<>(op), op, Arrays.asList("T", "variance_epsilon", "scale_after_normalization")); + int inputIndex = 0; + t = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + gamma = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + varianceEpsilon = op.attributes().getAttrFloat("variance_epsilon"); + scaleAfterNormalization = op.attributes().getAttrBool("scale_after_normalization"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java index e248dc193d2..03e84d778c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Gradients for batch normalization. * This op is deprecated. See {@code tf.nn.batch_normalization}. - * - * @param data type for {@code dx} output */ +@OpMetadata( + opType = BatchNormWithGlobalNormalizationGrad.OP_NAME, + inputsClass = BatchNormWithGlobalNormalizationGrad.Inputs.class +) @Operator( group = "nn" ) @@ -52,8 +60,8 @@ public final class BatchNormWithGlobalNormalizationGrad extends private Output dg; - private BatchNormWithGlobalNormalizationGrad(Operation operation) { - super(operation); + public BatchNormWithGlobalNormalizationGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; dx = operation.output(outputIdx++); dm = operation.output(outputIdx++); @@ -144,4 +152,69 @@ public Output db() { public Output dg() { return dg; } + + @OpInputsMetadata( + outputsClass = BatchNormWithGlobalNormalizationGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D input Tensor. + */ + public final Operand t; + + /** + * A 1D mean Tensor with size matching the last dimension of t. + * This is the first output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand m; + + /** + * A 1D variance Tensor with size matching the last dimension of t. + * This is the second output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand v; + + /** + * A 1D gamma Tensor with size matching the last dimension of t. + * If "scale_after_normalization" is true, this Tensor will be multiplied + * with the normalized Tensor. + */ + public final Operand gamma; + + /** + * 4D backprop Tensor. + */ + public final Operand backprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A small float number to avoid dividing by 0. + */ + public final float varianceEpsilon; + + /** + * A bool indicating whether the resulted tensor + * needs to be multiplied with gamma. + */ + public final boolean scaleAfterNormalization; + + public Inputs(GraphOperation op) { + super(new BatchNormWithGlobalNormalizationGrad<>(op), op, Arrays.asList("T", "variance_epsilon", "scale_after_normalization")); + int inputIndex = 0; + t = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + gamma = (Operand) op.input(inputIndex++); + backprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + varianceEpsilon = op.attributes().getAttrFloat("variance_epsilon"); + scaleAfterNormalization = op.attributes().getAttrBool("scale_after_normalization"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java index ba021575492..5f826546b07 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Adds {@code bias} to {@code value}. * This is a special case of {@code tf.add} where {@code bias} is restricted to be 1-D. * Broadcasting is supported, so {@code value} may have any number of dimensions. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BiasAdd.OP_NAME, + inputsClass = BiasAdd.Inputs.class +) @Operator( group = "nn" ) @@ -45,8 +53,8 @@ public final class BiasAdd extends RawOp implements Operand private Output output; - private BiasAdd(Operation operation) { - super(operation); + public BiasAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -135,4 +143,44 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = BiasAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Any number of dimensions. + */ + public final Operand value; + + /** + * 1-D with size the last dimension of {@code value}. + */ + public final Operand bias; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the bias tensor will be added to the last dimension + * of the value tensor. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + */ + public final String dataFormat; + + public Inputs(GraphOperation op) { + super(new BiasAdd<>(op), op, Arrays.asList("T", "data_format")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + dataFormat = op.attributes().getAttrString("data_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java index 661a84087e0..33c2829c271 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * It accumulates all the values from out_backprop into the feature dimension. * For NHWC data format, the feature dimension is the last. For NCHW data format, * the feature dimension is the third-to-last. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BiasAddGrad.OP_NAME, + inputsClass = BiasAddGrad.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +54,8 @@ public final class BiasAddGrad extends RawOp implements Operand private Output output; - private BiasAddGrad(Operation operation) { - super(operation); + public BiasAddGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -134,4 +142,38 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = BiasAddGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Any number of dimensions. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the bias tensor will be added to the last dimension + * of the value tensor. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + */ + public final String dataFormat; + + public Inputs(GraphOperation op) { + super(new BiasAddGrad<>(op), op, Arrays.asList("T", "data_format")); + int inputIndex = 0; + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + dataFormat = op.attributes().getAttrString("data_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java index fd6708a1772..ef303c35efc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -49,9 +56,14 @@ * this op uses IFCO. So in order for the following snippet to be equivalent * all gate-related outputs should be reordered. * - * - * @param data type for {@code i} output */ +@OpMetadata( + opType = BlockLSTM.OP_NAME, + inputsClass = BlockLSTM.Inputs.class +) +@Operator( + group = "nn" +) public final class BlockLSTM extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -72,8 +84,8 @@ public final class BlockLSTM extends RawOp { private Output h; - private BlockLSTM(Operation operation) { - super(operation); + public BlockLSTM(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; i = operation.output(outputIdx++); cs = operation.output(outputIdx++); @@ -247,4 +259,87 @@ public Options usePeephole(Boolean usePeephole) { return this; } } + + @OpInputsMetadata( + outputsClass = BlockLSTM.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Maximum time length actually used by this input. Outputs are padded + * with zeros beyond this length. + */ + public final Operand seqLenMax; + + /** + * The sequence input to the LSTM, shape (timelen, batch_size, num_inputs). + */ + public final Operand x; + + /** + * Value of the initial cell state. + */ + public final Operand csPrev; + + /** + * Initial output of cell (to be used for peephole). + */ + public final Operand hPrev; + + /** + * The weight matrix. + */ + public final Operand w; + + /** + * The weight matrix for input gate peephole connection. + */ + public final Operand wci; + + /** + * The weight matrix for forget gate peephole connection. + */ + public final Operand wcf; + + /** + * The weight matrix for output gate peephole connection. + */ + public final Operand wco; + + /** + * The bias vector. + */ + public final Operand b; + + /** + * Value to clip the 'cs' value to. + */ + public final float cellClip; + + /** + * Whether to use peephole weights. + */ + public final boolean usePeephole; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BlockLSTM<>(op), op, Arrays.asList("cell_clip", "use_peephole", "T")); + int inputIndex = 0; + seqLenMax = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + csPrev = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + w = (Operand) op.input(inputIndex++); + wci = (Operand) op.input(inputIndex++); + wcf = (Operand) op.input(inputIndex++); + wco = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + cellClip = op.attributes().getAttrFloat("cell_clip"); + usePeephole = op.attributes().getAttrBool("use_peephole"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java index 522df1b3b32..85bc08f38b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Computes the LSTM cell backward propagation for the entire time sequence. * This implementation is to be used in conjunction of BlockLSTMV2. - * - * @param data type for {@code x_grad} output */ +@OpMetadata( + opType = BlockLSTMGrad.OP_NAME, + inputsClass = BlockLSTMGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class BlockLSTMGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -55,8 +67,8 @@ public final class BlockLSTMGrad extends RawOp { private Output bGrad; - private BlockLSTMGrad(Operation operation) { - super(operation); + public BlockLSTMGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; xGrad = operation.output(outputIdx++); csPrevGrad = operation.output(outputIdx++); @@ -197,4 +209,135 @@ public Output wcoGrad() { public Output bGrad() { return bGrad; } + + @OpInputsMetadata( + outputsClass = BlockLSTMGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Maximum time length actually used by this input. Outputs are padded + * with zeros beyond this length. + */ + public final Operand seqLenMax; + + /** + * The sequence input to the LSTM, shape (timelen, batch_size, num_inputs). + */ + public final Operand x; + + /** + * Value of the initial cell state. + */ + public final Operand csPrev; + + /** + * Initial output of cell (to be used for peephole). + */ + public final Operand hPrev; + + /** + * The weight matrix. + */ + public final Operand w; + + /** + * The weight matrix for input gate peephole connection. + */ + public final Operand wci; + + /** + * The weight matrix for forget gate peephole connection. + */ + public final Operand wcf; + + /** + * The weight matrix for output gate peephole connection. + */ + public final Operand wco; + + /** + * The bias vector. + */ + public final Operand b; + + /** + * The input gate over the whole time sequence. + */ + public final Operand i; + + /** + * The cell state before the tanh over the whole time sequence. + */ + public final Operand cs; + + /** + * The forget gate over the whole time sequence. + */ + public final Operand f; + + /** + * The output gate over the whole time sequence. + */ + public final Operand o; + + /** + * The cell input over the whole time sequence. + */ + public final Operand ci; + + /** + * The cell after the tanh over the whole time sequence. + */ + public final Operand co; + + /** + * The output h vector over the whole time sequence. + */ + public final Operand h; + + /** + * The current gradient of cs. + */ + public final Operand csGrad; + + /** + * The gradient of h vector. + */ + public final Operand hGrad; + + /** + * Whether to use peephole weights. + */ + public final boolean usePeephole; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new BlockLSTMGrad<>(op), op, Arrays.asList("use_peephole", "T")); + int inputIndex = 0; + seqLenMax = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + csPrev = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + w = (Operand) op.input(inputIndex++); + wci = (Operand) op.input(inputIndex++); + wcf = (Operand) op.input(inputIndex++); + wco = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + i = (Operand) op.input(inputIndex++); + cs = (Operand) op.input(inputIndex++); + f = (Operand) op.input(inputIndex++); + o = (Operand) op.input(inputIndex++); + ci = (Operand) op.input(inputIndex++); + co = (Operand) op.input(inputIndex++); + h = (Operand) op.input(inputIndex++); + csGrad = (Operand) op.input(inputIndex++); + hGrad = (Operand) op.input(inputIndex++); + usePeephole = op.attributes().getAttrBool("use_peephole"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java index 2c3309dc9fc..f64d2f7bc3d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -33,6 +39,13 @@ * the gradient. This class performs the softmax operation for you, so inputs * should be e.g. linear projections of outputs by an LSTM. */ +@OpMetadata( + opType = CTCLossV2.OP_NAME, + inputsClass = CTCLossV2.Inputs.class +) +@Operator( + group = "nn" +) public final class CTCLossV2 extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class CTCLossV2 extends RawOp { private Output gradient; - private CTCLossV2(Operation operation) { - super(operation); + public CTCLossV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; loss = operation.output(outputIdx++); gradient = operation.output(outputIdx++); @@ -196,4 +209,64 @@ public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInpu return this; } } + + @OpInputsMetadata( + outputsClass = CTCLossV2.class + ) + public static class Inputs extends RawOpInputs { + /** + * 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. Default blank + * label is 0 rather num_classes - 1. + */ + public final Operand inputs; + + /** + * The indices of a {@code SparseTensor}. + * {@code labels_indices(i, :) == [b, t]} means {@code labels_values(i)} stores the id for + * {@code (batch b, time t)}. + */ + public final Operand labelsIndices; + + /** + * The values (labels) associated with the given batch and time. + */ + public final Operand labelsValues; + + /** + * A vector containing sequence lengths (batch). + */ + public final Operand sequenceLength; + + /** + * Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + */ + public final boolean preprocessCollapseRepeated; + + /** + * Scalar. If set to false, during CTC calculation + * repeated non-blank labels will not be merged and are interpreted as + * individual labels. This is a simplified version of CTC. + */ + public final boolean ctcMergeRepeated; + + /** + * Scalar. If set to true, during CTC + * calculation, items that have longer output sequences than input sequences + * are skipped: they don't contribute to the loss term and have zero-gradient. + */ + public final boolean ignoreLongerOutputsThanInputs; + + public Inputs(GraphOperation op) { + super(new CTCLossV2(op), op, Arrays.asList("preprocess_collapse_repeated", "ctc_merge_repeated", "ignore_longer_outputs_than_inputs")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + labelsIndices = (Operand) op.input(inputIndex++); + labelsValues = (Operand) op.input(inputIndex++); + sequenceLength = (Operand) op.input(inputIndex++); + preprocessCollapseRepeated = op.attributes().getAttrBool("preprocess_collapse_repeated"); + ctcMergeRepeated = op.attributes().getAttrBool("ctc_merge_repeated"); + ignoreLongerOutputsThanInputs = op.attributes().getAttrBool("ignore_longer_outputs_than_inputs"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java index 6de1761c2b1..a36d0911e6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -36,6 +41,10 @@ * the effect of 'removing' the sampled labels that match the true labels by * making the classifier sure that they are sampled labels. */ +@OpMetadata( + opType = ComputeAccidentalHits.OP_NAME, + inputsClass = ComputeAccidentalHits.Inputs.class +) @Operator( group = "nn" ) @@ -51,8 +60,8 @@ public final class ComputeAccidentalHits extends RawOp { private Output weights; - private ComputeAccidentalHits(Operation operation) { - super(operation); + public ComputeAccidentalHits(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; indices = operation.output(outputIdx++); ids = operation.output(outputIdx++); @@ -177,4 +186,46 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = ComputeAccidentalHits.class + ) + public static class Inputs extends RawOpInputs { + /** + * The true_classes output of UnpackSparseLabels. + */ + public final Operand trueClasses; + + /** + * The sampled_candidates output of CandidateSampler. + */ + public final Operand sampledCandidates; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new ComputeAccidentalHits(op), op, Arrays.asList("num_true", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + sampledCandidates = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv.java new file mode 100644 index 00000000000..096c8a3719f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv.java @@ -0,0 +1,437 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Computes a N-D convolution given (N+1+batch_dims)-D {@code input} and (N+2)-D {@code filter} tensors. + * General function for computing a N-D convolution. It is required that + * {@code 1 <= N <= 3}. + */ +@OpMetadata( + opType = Conv.OP_NAME, + inputsClass = Conv.Inputs.class +) +@Operator( + group = "nn" +) +public final class Conv extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Conv"; + + private Output output; + + public Conv(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Conv operation. + * + * @param scope current scope + * @param input Tensor of type T and shape {@code batch_shape + spatial_shape + [in_channels]} in the + * case that {@code channels_last_format = true} or shape + * {@code batch_shape + [in_channels] + spatial_shape} if {@code channels_last_format = false}. + * spatial_shape is N-dimensional with {@code N=2} or {@code N=3}. + * Also note that {@code batch_shape} is dictated by the parameter {@code batch_dims} + * and defaults to 1. + * @param filter An {@code (N+2)-D} Tensor with the same type as {@code input} and shape + * {@code spatial_filter_shape + [in_channels, out_channels]}, where spatial_filter_shape + * is N-dimensional with {@code N=2} or {@code N=3}. + * @param strides 1-D tensor of length {@code N+2}. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[N+1] = 1}. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code Conv} output and operands + * @return a new instance of Conv + */ + @Endpoint( + describeByClass = true + ) + public static Conv create(Scope scope, Operand input, Operand filter, + List strides, String padding, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(filter.asOutput()); + long[] stridesArray = new long[strides.size()]; + for (int i = 0 ; i < stridesArray.length ; i++) { + stridesArray[i] = strides.get(i); + } + opBuilder.setAttr("strides", stridesArray); + opBuilder.setAttr("padding", padding); + if (options != null) { + for (Options opts : options) { + if (opts.explicitPaddings != null) { + long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { + explicitPaddingsArray[i] = opts.explicitPaddings.get(i); + } + opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); + } + if (opts.dataFormat != null) { + opBuilder.setAttr("data_format", opts.dataFormat); + } + if (opts.dilations != null) { + long[] dilationsArray = new long[opts.dilations.size()]; + for (int i = 0 ; i < dilationsArray.length ; i++) { + dilationsArray[i] = opts.dilations.get(i); + } + opBuilder.setAttr("dilations", dilationsArray); + } + if (opts.batchDims != null) { + opBuilder.setAttr("batch_dims", opts.batchDims); + } + if (opts.groups != null) { + opBuilder.setAttr("groups", opts.groups); + } + } + } + return new Conv<>(opBuilder.build()); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(List explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long... explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Used to set the data format. By default {@code CHANNELS_FIRST}, uses + * {@code NHWC (2D) / NDHWC (3D)} or if {@code CHANNELS_LAST}, uses {@code NCHW (2D) / NCDHW (3D)}. + * @return this Options instance. + */ + public static Options dataFormat(String dataFormat) { + return new Options().dataFormat(dataFormat); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length {@code N+2}. The dilation factor for each dimension of + * {@code input}. If set to {@code k > 1}, there will be {@code k-1} skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code channels_last_format}, see above for details. Dilations in the batch + * and depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(List dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length {@code N+2}. The dilation factor for each dimension of + * {@code input}. If set to {@code k > 1}, there will be {@code k-1} skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code channels_last_format}, see above for details. Dilations in the batch + * and depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the batchDims option. + * + * @param batchDims A positive integer specifying the number of batch dimensions for the input + * tensor. Should be less than the rank of the input tensor. + * @return this Options instance. + */ + public static Options batchDims(Long batchDims) { + return new Options().batchDims(batchDims); + } + + /** + * Sets the groups option. + * + * @param groups A positive integer specifying the number of groups in which the input is split + * along the channel axis. Each group is convolved separately with + * {@code filters / groups} filters. The output is the concatenation of all the groups + * results along the channel axis. Input channels and filters must both be + * divisible by groups. + * @return this Options instance. + */ + public static Options groups(Long groups) { + return new Options().groups(groups); + } + + /** + * Gets output. + * A (N+1+batch_dims)-D tensor. The dimension order is determined by the value of + * {@code channels_last_format}, see below for details. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Long batchDims; + + private Long groups; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Used to set the data format. By default {@code CHANNELS_FIRST}, uses + * {@code NHWC (2D) / NDHWC (3D)} or if {@code CHANNELS_LAST}, uses {@code NCHW (2D) / NCDHW (3D)}. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length {@code N+2}. The dilation factor for each dimension of + * {@code input}. If set to {@code k > 1}, there will be {@code k-1} skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code channels_last_format}, see above for details. Dilations in the batch + * and depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length {@code N+2}. The dilation factor for each dimension of + * {@code input}. If set to {@code k > 1}, there will be {@code k-1} skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code channels_last_format}, see above for details. Dilations in the batch + * and depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the batchDims option. + * + * @param batchDims A positive integer specifying the number of batch dimensions for the input + * tensor. Should be less than the rank of the input tensor. + * @return this Options instance. + */ + public Options batchDims(Long batchDims) { + this.batchDims = batchDims; + return this; + } + + /** + * Sets the groups option. + * + * @param groups A positive integer specifying the number of groups in which the input is split + * along the channel axis. Each group is convolved separately with + * {@code filters / groups} filters. The output is the concatenation of all the groups + * results along the channel axis. Input channels and filters must both be + * divisible by groups. + * @return this Options instance. + */ + public Options groups(Long groups) { + this.groups = groups; + return this; + } + } + + @OpInputsMetadata( + outputsClass = Conv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of type T and shape {@code batch_shape + spatial_shape + [in_channels]} in the + * case that {@code channels_last_format = true} or shape + * {@code batch_shape + [in_channels] + spatial_shape} if {@code channels_last_format = false}. + * spatial_shape is N-dimensional with {@code N=2} or {@code N=3}. + * Also note that {@code batch_shape} is dictated by the parameter {@code batch_dims} + * and defaults to 1. + */ + public final Operand input; + + /** + * An {@code (N+2)-D} Tensor with the same type as {@code input} and shape + * {@code spatial_filter_shape + [in_channels, out_channels]}, where spatial_filter_shape + * is N-dimensional with {@code N=2} or {@code N=3}. + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D tensor of length {@code N+2}. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[N+1] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Used to set the data format. By default {@code CHANNELS_FIRST}, uses + * {@code NHWC (2D) / NDHWC (3D)} or if {@code CHANNELS_LAST}, uses {@code NCHW (2D) / NCDHW (3D)}. + */ + public final String dataFormat; + + /** + * 1-D tensor of length {@code N+2}. The dilation factor for each dimension of + * {@code input}. If set to {@code k > 1}, there will be {@code k-1} skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code channels_last_format}, see above for details. Dilations in the batch + * and depth dimensions must be 1. + */ + public final long[] dilations; + + /** + * A positive integer specifying the number of batch dimensions for the input + * tensor. Should be less than the rank of the input tensor. + */ + public final long batchDims; + + /** + * A positive integer specifying the number of groups in which the input is split + * along the channel axis. Each group is convolved separately with + * {@code filters / groups} filters. The output is the concatenation of all the groups + * results along the channel axis. Input channels and filters must both be + * divisible by groups. + */ + public final long groups; + + public Inputs(GraphOperation op) { + super(new Conv<>(op), op, Arrays.asList("T", "strides", "padding", "explicit_paddings", "data_format", "dilations", "batch_dims", "groups")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + batchDims = op.attributes().getAttrInt("batch_dims"); + groups = op.attributes().getAttrInt("groups"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java index abe9e0e66dc..6d7eb6e004e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -51,9 +56,11 @@ * *

    Must have {@code strides[0] = strides[3] = 1}. For the most common case of the same * horizontal and vertices strides, {@code strides = [1, stride, stride, 1]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv2d.OP_NAME, + inputsClass = Conv2d.Inputs.class +) @Operator( group = "nn" ) @@ -65,8 +72,8 @@ public final class Conv2d extends RawOp implements Operand private Output output; - private Conv2d(Operation operation) { - super(operation); + public Conv2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -160,7 +167,7 @@ public static Options explicitPaddings(List explicitPaddings) { * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -202,7 +209,7 @@ public static Options dilations(List dilations) { * depth dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -320,4 +327,83 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4-D tensor. The dimension order is interpreted according to the value + * of {@code data_format}, see below for details. + */ + public final Operand input; + + /** + * A 4-D tensor of shape + * {@code [filter_height, filter_width, in_channels, out_channels]} + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D tensor of length 4. The stride of the sliding window for each + * dimension of {@code input}. The dimension order is determined by the value of + * {@code data_format}, see below for details. + */ + public final long[] strides; + + /** + * The useCudnnOnGpu attribute + */ + public final boolean useCudnnOnGpu; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv2d<>(op), op, Arrays.asList("T", "strides", "use_cudnn_on_gpu", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + useCudnnOnGpu = op.attributes().getAttrBool("use_cudnn_on_gpu"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java index e909a1ab6ff..2d5af50d5e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,29 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of convolution with respect to the filter. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv2dBackpropFilter.OP_NAME, + inputsClass = Conv2dBackpropFilter.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +53,8 @@ public final class Conv2dBackpropFilter extends RawOp impleme private Output output; - private Conv2dBackpropFilter(Operation operation) { - super(operation); + public Conv2dBackpropFilter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -145,7 +152,7 @@ public static Options explicitPaddings(List explicitPaddings) { * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -187,7 +194,7 @@ public static Options dilations(List dilations) { * dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -306,4 +313,90 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv2dBackpropFilter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + */ + public final Operand input; + + /** + * An integer vector representing the tensor shape of {@code filter}, + * where {@code filter} is a 4-D + * {@code [filter_height, filter_width, in_channels, out_channels]} tensor. + */ + public final Operand filterSizes; + + /** + * 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + */ + public final long[] strides; + + /** + * The useCudnnOnGpu attribute + */ + public final boolean useCudnnOnGpu; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv2dBackpropFilter<>(op), op, Arrays.asList("T", "strides", "use_cudnn_on_gpu", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filterSizes = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + useCudnnOnGpu = op.attributes().getAttrBool("use_cudnn_on_gpu"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilterV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilterV2.java new file mode 100644 index 00000000000..1b8a95c8728 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilterV2.java @@ -0,0 +1,395 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Computes the gradients of convolution with respect to the filter. + */ +@OpMetadata( + opType = Conv2dBackpropFilterV2.OP_NAME, + inputsClass = Conv2dBackpropFilterV2.Inputs.class +) +public final class Conv2dBackpropFilterV2 extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Conv2DBackpropFilterV2"; + + private Output output; + + public Conv2dBackpropFilterV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Conv2DBackpropFilterV2 operation. + * + * @param scope current scope + * @param input 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + * @param filter 4-D with shape {@code [filter_height, filter_width, in_channels, out_channels]}. + * Only shape of tensor is used. + * @param outBackprop 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + * @param strides The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropFilterV2} output and operands + * @return a new instance of Conv2dBackpropFilterV2 + */ + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropFilterV2 create(Scope scope, Operand input, + Operand filter, Operand outBackprop, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv2dBackpropFilterV2"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(filter.asOutput()); + opBuilder.addInput(outBackprop.asOutput()); + long[] stridesArray = new long[strides.size()]; + for (int i = 0 ; i < stridesArray.length ; i++) { + stridesArray[i] = strides.get(i); + } + opBuilder.setAttr("strides", stridesArray); + opBuilder.setAttr("padding", padding); + if (options != null) { + for (Options opts : options) { + if (opts.useCudnnOnGpu != null) { + opBuilder.setAttr("use_cudnn_on_gpu", opts.useCudnnOnGpu); + } + if (opts.explicitPaddings != null) { + long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { + explicitPaddingsArray[i] = opts.explicitPaddings.get(i); + } + opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); + } + if (opts.dataFormat != null) { + opBuilder.setAttr("data_format", opts.dataFormat); + } + if (opts.dilations != null) { + long[] dilationsArray = new long[opts.dilations.size()]; + for (int i = 0 ; i < dilationsArray.length ; i++) { + dilationsArray[i] = opts.dilations.get(i); + } + opBuilder.setAttr("dilations", dilationsArray); + } + } + } + return new Conv2dBackpropFilterV2<>(opBuilder.build()); + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + return new Options().useCudnnOnGpu(useCudnnOnGpu); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(List explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long... explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public static Options dataFormat(String dataFormat) { + return new Options().dataFormat(dataFormat); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(List dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Gets output. + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. Gradient w.r.t. + * the {@code filter} input of the convolution. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilterV2} + */ + public static class Options { + private Boolean useCudnnOnGpu; + + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + this.useCudnnOnGpu = useCudnnOnGpu; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + } + + @OpInputsMetadata( + outputsClass = Conv2dBackpropFilterV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + */ + public final Operand input; + + /** + * 4-D with shape {@code [filter_height, filter_width, in_channels, out_channels]}. + * Only shape of tensor is used. + */ + public final Operand filter; + + /** + * 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + */ + public final long[] strides; + + /** + * The useCudnnOnGpu attribute + */ + public final boolean useCudnnOnGpu; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv2dBackpropFilterV2<>(op), op, Arrays.asList("T", "strides", "use_cudnn_on_gpu", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + useCudnnOnGpu = op.attributes().getAttrBool("use_cudnn_on_gpu"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java index 7231ac48f8b..fc0f5f296e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,29 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of convolution with respect to the input. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv2dBackpropInput.OP_NAME, + inputsClass = Conv2dBackpropInput.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +53,8 @@ public final class Conv2dBackpropInput extends RawOp implemen private Output output; - private Conv2dBackpropInput(Operation operation) { - super(operation); + public Conv2dBackpropInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -145,7 +152,7 @@ public static Options explicitPaddings(List explicitPaddings) { * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -187,7 +194,7 @@ public static Options dilations(List dilations) { * dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -305,4 +312,90 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv2dBackpropInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * An integer vector representing the shape of {@code input}, + * where {@code input} is a 4-D {@code [batch, height, width, channels]} tensor. + */ + public final Operand inputSizes; + + /** + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. + */ + public final Operand filter; + + /** + * 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + */ + public final long[] strides; + + /** + * The useCudnnOnGpu attribute + */ + public final boolean useCudnnOnGpu; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv2dBackpropInput<>(op), op, Arrays.asList("T", "strides", "use_cudnn_on_gpu", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + inputSizes = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + useCudnnOnGpu = op.attributes().getAttrBool("use_cudnn_on_gpu"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInputV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInputV2.java new file mode 100644 index 00000000000..04941640016 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInputV2.java @@ -0,0 +1,396 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Computes the gradients of convolution with respect to the input. + */ +@OpMetadata( + opType = Conv2dBackpropInputV2.OP_NAME, + inputsClass = Conv2dBackpropInputV2.Inputs.class +) +public final class Conv2dBackpropInputV2 extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Conv2DBackpropInputV2"; + + private Output output; + + public Conv2dBackpropInputV2(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Conv2DBackpropInputV2 operation. + * + * @param scope current scope + * @param input 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + * Only shape of tensor is used. + * @param filter 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. + * @param outBackprop 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + * @param strides The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + * @param padding The type of padding algorithm to use. + * @param options carries optional attribute values + * @param data type for {@code Conv2DBackpropInputV2} output and operands + * @return a new instance of Conv2dBackpropInputV2 + */ + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropInputV2 create(Scope scope, Operand input, + Operand filter, Operand outBackprop, List strides, String padding, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv2dBackpropInputV2"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(filter.asOutput()); + opBuilder.addInput(outBackprop.asOutput()); + long[] stridesArray = new long[strides.size()]; + for (int i = 0 ; i < stridesArray.length ; i++) { + stridesArray[i] = strides.get(i); + } + opBuilder.setAttr("strides", stridesArray); + opBuilder.setAttr("padding", padding); + if (options != null) { + for (Options opts : options) { + if (opts.useCudnnOnGpu != null) { + opBuilder.setAttr("use_cudnn_on_gpu", opts.useCudnnOnGpu); + } + if (opts.explicitPaddings != null) { + long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { + explicitPaddingsArray[i] = opts.explicitPaddings.get(i); + } + opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); + } + if (opts.dataFormat != null) { + opBuilder.setAttr("data_format", opts.dataFormat); + } + if (opts.dilations != null) { + long[] dilationsArray = new long[opts.dilations.size()]; + for (int i = 0 ; i < dilationsArray.length ; i++) { + dilationsArray[i] = opts.dilations.get(i); + } + opBuilder.setAttr("dilations", dilationsArray); + } + } + } + return new Conv2dBackpropInputV2<>(opBuilder.build()); + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + return new Options().useCudnnOnGpu(useCudnnOnGpu); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(List explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long... explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public static Options dataFormat(String dataFormat) { + return new Options().dataFormat(dataFormat); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(List dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long... dilations) { + return new Options().dilations(dilations); + } + + /** + * Gets output. + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. Gradient + * w.r.t. the input of the convolution. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInputV2} + */ + public static class Options { + private Boolean useCudnnOnGpu; + + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + this.useCudnnOnGpu = useCudnnOnGpu; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + } + + @OpInputsMetadata( + outputsClass = Conv2dBackpropInputV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + * Only shape of tensor is used. + */ + public final Operand input; + + /** + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. + */ + public final Operand filter; + + /** + * 4-D with shape {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. Must be in the same order as the dimension specified with + * format. + */ + public final long[] strides; + + /** + * The useCudnnOnGpu attribute + */ + public final boolean useCudnnOnGpu; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv2dBackpropInputV2<>(op), op, Arrays.asList("T", "strides", "use_cudnn_on_gpu", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + useCudnnOnGpu = op.attributes().getAttrBool("use_cudnn_on_gpu"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java index b3059545246..7de4f93716d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +40,11 @@ * two waveforms as a function of a time-lag applied to one of them. This * is also known as a sliding dot product or sliding inner-product. *

    Our Conv3D implements a form of cross-correlation. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv3d.OP_NAME, + inputsClass = Conv3d.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +56,8 @@ public final class Conv3d extends RawOp implements Operand private Output output; - private Conv3d(Operation operation) { - super(operation); + public Conv3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -137,7 +144,7 @@ public static Options dilations(List dilations) { * depth dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -211,4 +218,65 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape {@code [batch, in_depth, in_height, in_width, in_channels]}. + */ + public final Operand input; + + /** + * Shape {@code [filter_depth, filter_height, filter_width, in_channels, out_channels]}. {@code in_channels} must match between {@code input} and {@code filter}. + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv3d<>(op), op, Arrays.asList("T", "strides", "padding", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java index c9f15f99431..79970ac4d15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,29 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of 3-D convolution with respect to the filter. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv3dBackpropFilter.OP_NAME, + inputsClass = Conv3dBackpropFilter.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +53,8 @@ public final class Conv3dBackpropFilter extends RawOp impleme private Output output; - private Conv3dBackpropFilter(Operation operation) { - super(operation); + public Conv3dBackpropFilter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -140,7 +147,7 @@ public static Options dilations(List dilations) { * depth dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -214,4 +221,74 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv3dBackpropFilter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape {@code [batch, depth, rows, cols, in_channels]}. + */ + public final Operand input; + + /** + * An integer vector representing the tensor shape of {@code filter}, + * where {@code filter} is a 5-D + * {@code [filter_depth, filter_height, filter_width, in_channels, out_channels]} + * tensor. + */ + public final Operand filterSizes; + + /** + * Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new Conv3dBackpropFilter<>(op), op, Arrays.asList("T", "strides", "padding", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filterSizes = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java index 4cfce74a0ce..d60306ab96d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,21 +19,28 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of 3-D convolution with respect to the input. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Conv3dBackpropInput.OP_NAME, + inputsClass = Conv3dBackpropInput.Inputs.class +) @Operator( group = "nn" ) @@ -45,8 +52,8 @@ public final class Conv3dBackpropInput extends RawOp implemen private Output output; - private Conv3dBackpropInput(Operation operation) { - super(operation); + public Conv3dBackpropInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -139,7 +146,7 @@ public static Options dilations(List dilations) { * depth dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -213,4 +220,80 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = Conv3dBackpropInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * An integer vector representing the tensor shape of {@code input}, + * where {@code input} is a 5-D + * {@code [batch, depth, rows, cols, in_channels]} tensor. + */ + public final Operand inputSizes; + + /** + * Shape {@code [depth, rows, cols, in_channels, out_channels]}. + * {@code in_channels} must match between {@code input} and {@code filter}. + */ + public final Operand filter; + + /** + * Backprop signal of shape {@code [batch, out_depth, out_rows, out_cols, out_channels]}. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + */ + public final long[] dilations; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new Conv3dBackpropInput<>(op), op, Arrays.asList("T", "strides", "padding", "data_format", "dilations", "Tshape")); + int inputIndex = 0; + inputSizes = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java index ff6a6420b0c..f270607bb50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -38,9 +43,11 @@ * the first of these is emitted. That is, when the top path is "A B B B B", * "A B" is returned if merge_repeated = True but "A B B B B" is * returned if merge_repeated = False. - * - * @param data type for {@code log_probability} output */ +@OpMetadata( + opType = CtcBeamSearchDecoder.OP_NAME, + inputsClass = CtcBeamSearchDecoder.Inputs.class +) @Operator( group = "nn" ) @@ -59,8 +66,8 @@ public final class CtcBeamSearchDecoder extends RawOp { private Output logProbability; @SuppressWarnings("unchecked") - private CtcBeamSearchDecoder(Operation operation) { - super(operation); + public CtcBeamSearchDecoder(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int decodedIndicesLength = operation.outputListLength("decoded_indices"); decodedIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedIndicesLength)); @@ -179,4 +186,44 @@ public Options mergeRepeated(Boolean mergeRepeated) { return this; } } + + @OpInputsMetadata( + outputsClass = CtcBeamSearchDecoder.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. + */ + public final Operand inputs; + + /** + * A vector containing sequence lengths, size {@code (batch)}. + */ + public final Operand sequenceLength; + + /** + * A scalar >= 0 (beam search beam width). + */ + public final long beamWidth; + + /** + * If true, merge repeated classes in output. + */ + public final boolean mergeRepeated; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CtcBeamSearchDecoder<>(op), op, Arrays.asList("beam_width", "merge_repeated", "T")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + sequenceLength = (Operand) op.input(inputIndex++); + beamWidth = op.attributes().getAttrInt("beam_width"); + mergeRepeated = op.attributes().getAttrBool("merge_repeated"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java index 525cc165763..688f60ab28e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -39,9 +45,11 @@ *

    Regardless of the value of merge_repeated, if the maximum index of a given * time and batch corresponds to the blank, index {@code (num_classes - 1)}, no new * element is emitted. - * - * @param data type for {@code log_probability} output */ +@OpMetadata( + opType = CtcGreedyDecoder.OP_NAME, + inputsClass = CtcGreedyDecoder.Inputs.class +) @Operator( group = "nn" ) @@ -59,8 +67,8 @@ public final class CtcGreedyDecoder extends RawOp { private Output logProbability; - private CtcGreedyDecoder(Operation operation) { - super(operation); + public CtcGreedyDecoder(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; decodedIndices = operation.output(outputIdx++); decodedValues = operation.output(outputIdx++); @@ -192,4 +200,44 @@ public Options blankIndex(Long blankIndex) { return this; } } + + @OpInputsMetadata( + outputsClass = CtcGreedyDecoder.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. + */ + public final Operand inputs; + + /** + * A vector containing sequence lengths, size {@code (batch_size)}. + */ + public final Operand sequenceLength; + + /** + * If True, merge repeated classes in output. + */ + public final boolean mergeRepeated; + + /** + * The blankIndex attribute + */ + public final long blankIndex; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CtcGreedyDecoder<>(op), op, Arrays.asList("merge_repeated", "blank_index", "T")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + sequenceLength = (Operand) op.input(inputIndex++); + mergeRepeated = op.attributes().getAttrBool("merge_repeated"); + blankIndex = op.attributes().getAttrInt("blank_index"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java index 92460960518..8369dae6c75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -33,9 +39,11 @@ * Calculates the CTC Loss (log probability) for each batch entry. Also calculates * the gradient. This class performs the softmax operation for you, so inputs * should be e.g. linear projections of outputs by an LSTM. - * - * @param data type for {@code loss} output */ +@OpMetadata( + opType = CtcLoss.OP_NAME, + inputsClass = CtcLoss.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class CtcLoss extends RawOp { private Output gradient; - private CtcLoss(Operation operation) { - super(operation); + public CtcLoss(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; loss = operation.output(outputIdx++); gradient = operation.output(outputIdx++); @@ -202,4 +210,69 @@ public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInpu return this; } } + + @OpInputsMetadata( + outputsClass = CtcLoss.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 3-D, shape: {@code (max_time x batch_size x num_classes)}, the logits. + */ + public final Operand inputs; + + /** + * The indices of a {@code SparseTensor}. + * {@code labels_indices(i, :) == [b, t]} means {@code labels_values(i)} stores the id for + * {@code (batch b, time t)}. + */ + public final Operand labelsIndices; + + /** + * The values (labels) associated with the given batch and time. + */ + public final Operand labelsValues; + + /** + * A vector containing sequence lengths (batch). + */ + public final Operand sequenceLength; + + /** + * Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + */ + public final boolean preprocessCollapseRepeated; + + /** + * Scalar. If set to false, during CTC calculation + * repeated non-blank labels will not be merged and are interpreted as + * individual labels. This is a simplified version of CTC. + */ + public final boolean ctcMergeRepeated; + + /** + * Scalar. If set to true, during CTC + * calculation, items that have longer output sequences than input sequences + * are skipped: they don't contribute to the loss term and have zero-gradient. + */ + public final boolean ignoreLongerOutputsThanInputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CtcLoss<>(op), op, Arrays.asList("preprocess_collapse_repeated", "ctc_merge_repeated", "ignore_longer_outputs_than_inputs", "T")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + labelsIndices = (Operand) op.input(inputIndex++); + labelsValues = (Operand) op.input(inputIndex++); + sequenceLength = (Operand) op.input(inputIndex++); + preprocessCollapseRepeated = op.attributes().getAttrBool("preprocess_collapse_repeated"); + ctcMergeRepeated = op.attributes().getAttrBool("ctc_merge_repeated"); + ignoreLongerOutputsThanInputs = op.attributes().getAttrBool("ignore_longer_outputs_than_inputs"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java index 5d32b0db85d..8845090aa6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -66,9 +73,14 @@ * major. * reserve_space: An opaque tensor that can be used in backprop calculation. It * is only produced if is_training is true. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CudnnRNN.OP_NAME, + inputsClass = CudnnRNN.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNN extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -86,8 +98,8 @@ public final class CudnnRNN extends RawOp { private Output hostReserved; @SuppressWarnings("unchecked") - private CudnnRNN(Operation operation) { - super(operation); + public CudnnRNN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputH = operation.output(outputIdx++); @@ -100,11 +112,11 @@ private CudnnRNN(Operation operation) { * Factory method to create a class wrapping a new CudnnRNNV3 operation. * * @param scope current scope - * @param input the input value - * @param inputH the inputH value - * @param inputC the inputC value - * @param params the params value - * @param sequenceLengths the sequenceLengths value + * @param input The input value + * @param inputH The inputH value + * @param inputC The inputC value + * @param params The params value + * @param sequenceLengths The sequenceLengths value * @param options carries optional attribute values * @param data type for {@code CudnnRNNV3} output and operands * @return a new instance of CudnnRNN @@ -414,4 +426,104 @@ public Options timeMajor(Boolean timeMajor) { return this; } } + + @OpInputsMetadata( + outputsClass = CudnnRNN.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The inputH input + */ + public final Operand inputH; + + /** + * The inputC input + */ + public final Operand inputC; + + /** + * The params input + */ + public final Operand params; + + /** + * The sequenceLengths input + */ + public final Operand sequenceLengths; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The rnnMode attribute + */ + public final String rnnMode; + + /** + * The inputMode attribute + */ + public final String inputMode; + + /** + * The direction attribute + */ + public final String direction; + + /** + * The dropout attribute + */ + public final float dropout; + + /** + * The seed attribute + */ + public final long seed; + + /** + * The seed2 attribute + */ + public final long seed2; + + /** + * The numProj attribute + */ + public final long numProj; + + /** + * The isTraining attribute + */ + public final boolean isTraining; + + /** + * The timeMajor attribute + */ + public final boolean timeMajor; + + public Inputs(GraphOperation op) { + super(new CudnnRNN<>(op), op, Arrays.asList("T", "rnn_mode", "input_mode", "direction", "dropout", "seed", "seed2", "num_proj", "is_training", "time_major")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputH = (Operand) op.input(inputIndex++); + inputC = (Operand) op.input(inputIndex++); + params = (Operand) op.input(inputIndex++); + sequenceLengths = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + rnnMode = op.attributes().getAttrString("rnn_mode"); + inputMode = op.attributes().getAttrString("input_mode"); + direction = op.attributes().getAttrString("direction"); + dropout = op.attributes().getAttrFloat("dropout"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + numProj = op.attributes().getAttrInt("num_proj"); + isTraining = op.attributes().getAttrBool("is_training"); + timeMajor = op.attributes().getAttrBool("time_major"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java index 4c9166bc46d..a1e09f597ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -76,9 +83,14 @@ * shape as input_c. * params_backprop: The backprop to the params buffer in the forward pass. Has the * same shape as params. - * - * @param data type for {@code input_backprop} output */ +@OpMetadata( + opType = CudnnRNNBackprop.OP_NAME, + inputsClass = CudnnRNNBackprop.Inputs.class +) +@Operator( + group = "nn" +) public final class CudnnRNNBackprop extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -93,8 +105,8 @@ public final class CudnnRNNBackprop extends RawOp { private Output paramsBackprop; - private CudnnRNNBackprop(Operation operation) { - super(operation); + public CudnnRNNBackprop(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; inputBackprop = operation.output(outputIdx++); inputHBackprop = operation.output(outputIdx++); @@ -106,19 +118,19 @@ private CudnnRNNBackprop(Operation operation) { * Factory method to create a class wrapping a new CudnnRNNBackpropV3 operation. * * @param scope current scope - * @param input the input value - * @param inputH the inputH value - * @param inputC the inputC value - * @param params the params value - * @param sequenceLengths the sequenceLengths value - * @param output the output value - * @param outputH the outputH value - * @param outputC the outputC value - * @param outputBackprop the outputBackprop value - * @param outputHBackprop the outputHBackprop value - * @param outputCBackprop the outputCBackprop value - * @param reserveSpace the reserveSpace value - * @param hostReserved the hostReserved value + * @param input The input value + * @param inputH The inputH value + * @param inputC The inputC value + * @param params The params value + * @param sequenceLengths The sequenceLengths value + * @param output The output value + * @param outputH The outputH value + * @param outputC The outputC value + * @param outputBackprop The outputBackprop value + * @param outputHBackprop The outputHBackprop value + * @param outputCBackprop The outputCBackprop value + * @param reserveSpace The reserveSpace value + * @param hostReserved The hostReserved value * @param options carries optional attribute values * @param data type for {@code CudnnRNNBackpropV3} output and operands * @return a new instance of CudnnRNNBackprop @@ -403,4 +415,146 @@ public Options timeMajor(Boolean timeMajor) { return this; } } + + @OpInputsMetadata( + outputsClass = CudnnRNNBackprop.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The inputH input + */ + public final Operand inputH; + + /** + * The inputC input + */ + public final Operand inputC; + + /** + * The params input + */ + public final Operand params; + + /** + * The sequenceLengths input + */ + public final Operand sequenceLengths; + + /** + * The output input + */ + public final Operand output; + + /** + * The outputH input + */ + public final Operand outputH; + + /** + * The outputC input + */ + public final Operand outputC; + + /** + * The outputBackprop input + */ + public final Operand outputBackprop; + + /** + * The outputHBackprop input + */ + public final Operand outputHBackprop; + + /** + * The outputCBackprop input + */ + public final Operand outputCBackprop; + + /** + * The reserveSpace input + */ + public final Operand reserveSpace; + + /** + * The hostReserved input + */ + public final Operand hostReserved; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The rnnMode attribute + */ + public final String rnnMode; + + /** + * The inputMode attribute + */ + public final String inputMode; + + /** + * The direction attribute + */ + public final String direction; + + /** + * The dropout attribute + */ + public final float dropout; + + /** + * The seed attribute + */ + public final long seed; + + /** + * The seed2 attribute + */ + public final long seed2; + + /** + * The numProj attribute + */ + public final long numProj; + + /** + * The timeMajor attribute + */ + public final boolean timeMajor; + + public Inputs(GraphOperation op) { + super(new CudnnRNNBackprop<>(op), op, Arrays.asList("T", "rnn_mode", "input_mode", "direction", "dropout", "seed", "seed2", "num_proj", "time_major")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputH = (Operand) op.input(inputIndex++); + inputC = (Operand) op.input(inputIndex++); + params = (Operand) op.input(inputIndex++); + sequenceLengths = (Operand) op.input(inputIndex++); + output = (Operand) op.input(inputIndex++); + outputH = (Operand) op.input(inputIndex++); + outputC = (Operand) op.input(inputIndex++); + outputBackprop = (Operand) op.input(inputIndex++); + outputHBackprop = (Operand) op.input(inputIndex++); + outputCBackprop = (Operand) op.input(inputIndex++); + reserveSpace = (Operand) op.input(inputIndex++); + hostReserved = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + rnnMode = op.attributes().getAttrString("rnn_mode"); + inputMode = op.attributes().getAttrString("input_mode"); + direction = op.attributes().getAttrString("direction"); + dropout = op.attributes().getAttrFloat("dropout"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + numProj = op.attributes().getAttrInt("num_proj"); + timeMajor = op.attributes().getAttrBool("time_major"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java index ca5b35320f8..0c38a68a23e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -59,9 +65,11 @@ * seed2: the 2nd part of a seed to initialize dropout. * num_proj: The output dimensionality for the projection matrices. If None or 0, * no projection is performed. - * - * @param data type for {@code params} output */ +@OpMetadata( + opType = CudnnRNNCanonicalToParams.OP_NAME, + inputsClass = CudnnRNNCanonicalToParams.Inputs.class +) @Operator( group = "nn" ) @@ -73,8 +81,8 @@ public final class CudnnRNNCanonicalToParams extends RawOp im private Output params; - private CudnnRNNCanonicalToParams(Operation operation) { - super(operation); + public CudnnRNNCanonicalToParams(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; params = operation.output(outputIdx++); } @@ -83,11 +91,11 @@ private CudnnRNNCanonicalToParams(Operation operation) { * Factory method to create a class wrapping a new CudnnRNNCanonicalToParamsV2 operation. * * @param scope current scope - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param weights the weights value - * @param biases the biases value + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param weights The weights value + * @param biases The biases value * @param options carries optional attribute values * @param data type for {@code CudnnRNNCanonicalToParamsV2} output and operands * @return a new instance of CudnnRNNCanonicalToParams @@ -314,4 +322,96 @@ public Options numProj(Long numProj) { return this; } } + + @OpInputsMetadata( + outputsClass = CudnnRNNCanonicalToParams.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The numLayers input + */ + public final Operand numLayers; + + /** + * The numUnits input + */ + public final Operand numUnits; + + /** + * The inputSize input + */ + public final Operand inputSize; + + /** + * The weights input + */ + public final Iterable> weights; + + /** + * The biases input + */ + public final Iterable> biases; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The rnnMode attribute + */ + public final String rnnMode; + + /** + * The inputMode attribute + */ + public final String inputMode; + + /** + * The direction attribute + */ + public final String direction; + + /** + * The dropout attribute + */ + public final float dropout; + + /** + * The seed attribute + */ + public final long seed; + + /** + * The seed2 attribute + */ + public final long seed2; + + /** + * The numProj attribute + */ + public final long numProj; + + public Inputs(GraphOperation op) { + super(new CudnnRNNCanonicalToParams<>(op), op, Arrays.asList("T", "rnn_mode", "input_mode", "direction", "dropout", "seed", "seed2", "num_proj")); + int inputIndex = 0; + numLayers = (Operand) op.input(inputIndex++); + numUnits = (Operand) op.input(inputIndex++); + inputSize = (Operand) op.input(inputIndex++); + int weightsLength = op.inputListLength("weights"); + weights = Arrays.asList((Operand[]) op.inputList(inputIndex, weightsLength)); + inputIndex += weightsLength; + int biasesLength = op.inputListLength("biases"); + biases = Arrays.asList((Operand[]) op.inputList(inputIndex, biasesLength)); + inputIndex += biasesLength; + T = op.attributes().getAttrType("T"); + rnnMode = op.attributes().getAttrString("rnn_mode"); + inputMode = op.attributes().getAttrString("input_mode"); + direction = op.attributes().getAttrString("direction"); + dropout = op.attributes().getAttrFloat("dropout"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + numProj = op.attributes().getAttrInt("num_proj"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java index 4f161d810f5..b85a3568412 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -60,9 +65,11 @@ * seed2: the 2nd part of a seed to initialize dropout. * num_proj: The output dimensionality for the projection matrices. If None or 0, * no projection is performed. - * - * @param data type for {@code weights} output */ +@OpMetadata( + opType = CudnnRNNParamsToCanonical.OP_NAME, + inputsClass = CudnnRNNParamsToCanonical.Inputs.class +) @Operator( group = "nn" ) @@ -77,8 +84,8 @@ public final class CudnnRNNParamsToCanonical extends RawOp { private List> biases; @SuppressWarnings("unchecked") - private CudnnRNNParamsToCanonical(Operation operation) { - super(operation); + public CudnnRNNParamsToCanonical(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int weightsLength = operation.outputListLength("weights"); weights = Arrays.asList((Output[]) operation.outputList(outputIdx, weightsLength)); @@ -92,12 +99,12 @@ private CudnnRNNParamsToCanonical(Operation operation) { * Factory method to create a class wrapping a new CudnnRNNParamsToCanonicalV2 operation. * * @param scope current scope - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param params the params value - * @param numParamsWeights the value of the numParamsWeights property - * @param numParamsBiases the value of the numParamsBiases property + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param params The params value + * @param numParamsWeights The value of the numParamsWeights attribute + * @param numParamsBiases The value of the numParamsBiases attribute * @param options carries optional attribute values * @param data type for {@code CudnnRNNParamsToCanonicalV2} output and operands * @return a new instance of CudnnRNNParamsToCanonical @@ -329,4 +336,86 @@ public Options numProj(Long numProj) { return this; } } + + @OpInputsMetadata( + outputsClass = CudnnRNNParamsToCanonical.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The numLayers input + */ + public final Operand numLayers; + + /** + * The numUnits input + */ + public final Operand numUnits; + + /** + * The inputSize input + */ + public final Operand inputSize; + + /** + * The params input + */ + public final Operand params; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The rnnMode attribute + */ + public final String rnnMode; + + /** + * The inputMode attribute + */ + public final String inputMode; + + /** + * The direction attribute + */ + public final String direction; + + /** + * The dropout attribute + */ + public final float dropout; + + /** + * The seed attribute + */ + public final long seed; + + /** + * The seed2 attribute + */ + public final long seed2; + + /** + * The numProj attribute + */ + public final long numProj; + + public Inputs(GraphOperation op) { + super(new CudnnRNNParamsToCanonical<>(op), op, Arrays.asList("T", "rnn_mode", "input_mode", "direction", "dropout", "seed", "seed2", "num_proj")); + int inputIndex = 0; + numLayers = (Operand) op.input(inputIndex++); + numUnits = (Operand) op.input(inputIndex++); + inputSize = (Operand) op.input(inputIndex++); + params = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + rnnMode = op.attributes().getAttrString("rnn_mode"); + inputMode = op.attributes().getAttrString("input_mode"); + direction = op.attributes().getAttrString("direction"); + dropout = op.attributes().getAttrFloat("dropout"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + numProj = op.attributes().getAttrInt("num_proj"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java index 676460b8765..1dbc4d48ad8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -51,9 +57,11 @@ * compatible across GPUs. Please use CudnnRNNParamsWeights and * CudnnRNNParamsBiases to save and restore them in a way that is compatible * across different runs. - * - * @param data type for {@code params_size} output */ +@OpMetadata( + opType = CudnnRnnParamsSize.OP_NAME, + inputsClass = CudnnRnnParamsSize.Inputs.class +) @Operator( group = "nn" ) @@ -65,8 +73,8 @@ public final class CudnnRnnParamsSize extends RawOp implement private Output paramsSize; - private CudnnRnnParamsSize(Operation operation) { - super(operation); + public CudnnRnnParamsSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; paramsSize = operation.output(outputIdx++); } @@ -75,11 +83,11 @@ private CudnnRnnParamsSize(Operation operation) { * Factory method to create a class wrapping a new CudnnRNNParamsSize operation. * * @param scope current scope - * @param numLayers the numLayers value - * @param numUnits the numUnits value - * @param inputSize the inputSize value - * @param T the value of the T property - * @param S the value of the S property + * @param numLayers The numLayers value + * @param numUnits The numUnits value + * @param inputSize The inputSize value + * @param T The value of the T attribute + * @param S The value of the S attribute * @param options carries optional attribute values * @param data type for {@code CudnnRNNParamsSize} output and operands * @param data type for {@code CudnnRNNParamsSize} output and operands @@ -307,4 +315,86 @@ public Options numProj(Long numProj) { return this; } } + + @OpInputsMetadata( + outputsClass = CudnnRnnParamsSize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The numLayers input + */ + public final Operand numLayers; + + /** + * The numUnits input + */ + public final Operand numUnits; + + /** + * The inputSize input + */ + public final Operand inputSize; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The rnnMode attribute + */ + public final String rnnMode; + + /** + * The inputMode attribute + */ + public final String inputMode; + + /** + * The direction attribute + */ + public final String direction; + + /** + * The dropout attribute + */ + public final float dropout; + + /** + * The seed attribute + */ + public final long seed; + + /** + * The seed2 attribute + */ + public final long seed2; + + /** + * The numProj attribute + */ + public final long numProj; + + public Inputs(GraphOperation op) { + super(new CudnnRnnParamsSize<>(op), op, Arrays.asList("T", "S", "rnn_mode", "input_mode", "direction", "dropout", "seed", "seed2", "num_proj")); + int inputIndex = 0; + numLayers = (Operand) op.input(inputIndex++); + numUnits = (Operand) op.input(inputIndex++); + inputSize = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + S = op.attributes().getAttrType("S"); + rnnMode = op.attributes().getAttrString("rnn_mode"); + inputMode = op.attributes().getAttrString("input_mode"); + direction = op.attributes().getAttrString("direction"); + dropout = op.attributes().getAttrFloat("dropout"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + numProj = op.attributes().getAttrInt("num_proj"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java index 1ce3cba2ce5..6e83cd0c867 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns the dimension index in the destination data format given the one in * the source data format. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = DataFormatDimMap.OP_NAME, + inputsClass = DataFormatDimMap.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class DataFormatDimMap extends RawOp implements private Output y; - private DataFormatDimMap(Operation operation) { - super(operation); + public DataFormatDimMap(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -147,4 +155,39 @@ public Options dstFormat(String dstFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = DataFormatDimMap.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A Tensor with each element as a dimension index in source data format. + * Must be in the range [-4, 4). + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + /** + * source data format. + */ + public final String srcFormat; + + /** + * destination data format. + */ + public final String dstFormat; + + public Inputs(GraphOperation op) { + super(new DataFormatDimMap<>(op), op, Arrays.asList("T", "src_format", "dst_format")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + srcFormat = op.attributes().getAttrString("src_format"); + dstFormat = op.attributes().getAttrString("dst_format"); + } + } } 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 73e7653b3a7..f719f7cc7ce 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,40 +17,58 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Permute input tensor from {@code src_format} to {@code dst_format}. - * Input tensor must be a vector of size 4, or a 4x2 tensor. - *

    For example, with {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and inputs: + * Given source and destination format strings of length n=4 or 5, the input + * tensor must be a vector of size n or n-2, or a 2D tensor of shape + * (n, 2) or (n-2, 2). + *

    If the first dimension of the input tensor is n-2, it is assumed that + * non-spatial dimensions are omitted (i.e {@code N}, {@code C}). + *

    For example, with {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and input: *

      * [1, 2, 3, 4]
      * 
    - *

    and + *

    , the output will be: *

    - * [[1, 2, 3, 4],
    - *  [5, 6, 7, 8]]
    + * [1, 4, 2, 3]
      * 
    - *

    , the outputs will be (respectively): + *

    With {@code src_format} of {@code NDHWC}, {@code dst_format} of {@code NCDHW}, and input: *

    - * [1, 4, 2, 3]
    + * [[1, 6], [2, 7], [3, 8], [4, 9], [5, 10]]
    + * 
    + *

    , the output will be: + *

    + * [[1, 6], [5, 10], [2, 7], [3, 8], [4, 9]]
    + * 
    + *

    With {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and input: + *

    + * [1, 2]
      * 
    - *

    and + *

    , the output will be: *

    - * [[1, 4, 2, 3],
    - *  [5, 8, 6, 7]]
    + * [1, 2]
      * 
    - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = DataFormatVecPermute.OP_NAME, + inputsClass = DataFormatVecPermute.Inputs.class +) @Operator( group = "nn" ) @@ -62,8 +80,8 @@ public final class DataFormatVecPermute extends RawOp impleme private Output y; - private DataFormatVecPermute(Operation operation) { - super(operation); + public DataFormatVecPermute(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); } @@ -72,7 +90,7 @@ private DataFormatVecPermute(Operation operation) { * Factory method to create a class wrapping a new DataFormatVecPermute operation. * * @param scope current scope - * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. + * @param x Tensor of rank 1 or 2 in source data format. * @param options carries optional attribute values * @param data type for {@code DataFormatVecPermute} output and operands * @return a new instance of DataFormatVecPermute @@ -119,7 +137,7 @@ public static Options dstFormat(String dstFormat) { /** * Gets y. - * Vector of size 4 or Tensor of shape (4, 2) in destination data format. + * Tensor of rank 1 or 2 in destination data format. * @return y. */ public Output y() { @@ -164,4 +182,38 @@ public Options dstFormat(String dstFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = DataFormatVecPermute.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor of rank 1 or 2 in source data format. + */ + public final Operand x; + + /** + * The T attribute + */ + public final DataType T; + + /** + * source data format. + */ + public final String srcFormat; + + /** + * destination data format. + */ + public final String dstFormat; + + public Inputs(GraphOperation op) { + super(new DataFormatVecPermute<>(op), op, Arrays.asList("T", "src_format", "dst_format")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + srcFormat = op.attributes().getAttrString("src_format"); + dstFormat = op.attributes().getAttrString("dst_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java index 2e22c5f1658..2f1880cda02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,7 +43,7 @@ *
      *
    • Chunks of data of size {@code block_size * block_size} from depth are rearranged * into non-overlapping blocks of size {@code block_size x block_size}
    • - *
    • The width the output tensor is {@code input_depth * block_size}, whereas the + *
    • The width of the output tensor is {@code input_depth * block_size}, whereas the * height is {@code input_height * block_size}.
    • *
    • The Y, X coordinates within each block of the output image are determined * by the high order component of the input channel index.
    • @@ -103,9 +109,11 @@ * [ [11], [12], [15], [16]]]] * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DepthToSpace.OP_NAME, + inputsClass = DepthToSpace.Inputs.class +) @Operator( group = "nn" ) @@ -117,8 +125,8 @@ public final class DepthToSpace extends RawOp implements Operan private Output output; - private DepthToSpace(Operation operation) { - super(operation); + public DepthToSpace(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,7 +135,7 @@ private DepthToSpace(Operation operation) { * Factory method to create a class wrapping a new DepthToSpace operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param blockSize The size of the spatial block, same as in Space2Depth. * @param options carries optional attribute values * @param data type for {@code DepthToSpace} output and operands @@ -195,4 +203,38 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = DepthToSpace.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The size of the spatial block, same as in Space2Depth. + */ + public final long blockSize; + + /** + * The dataFormat attribute + */ + public final String dataFormat; + + public Inputs(GraphOperation op) { + super(new DepthToSpace<>(op), op, Arrays.asList("T", "block_size", "data_format")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + blockSize = op.attributes().getAttrInt("block_size"); + dataFormat = op.attributes().getAttrString("data_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java index 262ae8aaeab..93a0b744513 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -47,9 +52,11 @@ * *

      Must have {@code strides[0] = strides[3] = 1}. For the most common case of the same * horizontal and vertices strides, {@code strides = [1, stride, stride, 1]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DepthwiseConv2dNative.OP_NAME, + inputsClass = DepthwiseConv2dNative.Inputs.class +) @Operator( group = "nn" ) @@ -61,8 +68,8 @@ public final class DepthwiseConv2dNative extends RawOp implem private Output output; - private DepthwiseConv2dNative(Operation operation) { - super(operation); + public DepthwiseConv2dNative(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -71,8 +78,8 @@ private DepthwiseConv2dNative(Operation operation) { * Factory method to create a class wrapping a new DepthwiseConv2dNative operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value + * @param input The input value + * @param filter The filter value * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. * @param padding The type of padding algorithm to use. @@ -134,7 +141,7 @@ public static Options explicitPaddings(List explicitPaddings) { * @param explicitPaddings the explicitPaddings option * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -176,7 +183,7 @@ public static Options dilations(List dilations) { * dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -274,4 +281,71 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = DepthwiseConv2dNative.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D of length 4. The stride of the sliding window for each dimension + * of {@code input}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The explicitPaddings attribute + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new DepthwiseConv2dNative<>(op), op, Arrays.asList("T", "strides", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java index 07e30fc3001..66eb190debf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,29 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of depthwise convolution with respect to the filter. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DepthwiseConv2dNativeBackpropFilter.OP_NAME, + inputsClass = DepthwiseConv2dNativeBackpropFilter.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +53,8 @@ public final class DepthwiseConv2dNativeBackpropFilter extend private Output output; - private DepthwiseConv2dNativeBackpropFilter(Operation operation) { - super(operation); + public DepthwiseConv2dNativeBackpropFilter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -128,7 +135,7 @@ public static Options explicitPaddings(List explicitPaddings) { * @param explicitPaddings the explicitPaddings option * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -170,7 +177,7 @@ public static Options dilations(List dilations) { * dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -270,4 +277,83 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = DepthwiseConv2dNativeBackpropFilter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape based on {@code data_format}. For example, if + * {@code data_format} is 'NHWC' then {@code input} is a 4-D {@code [batch, in_height, in_width, in_channels]} tensor. + */ + public final Operand input; + + /** + * An integer vector representing the tensor shape of {@code filter}, + * where {@code filter} is a 4-D + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]} tensor. + */ + public final Operand filterSizes; + + /** + * 4-D with shape based on {@code data_format}. + * For example, if {@code data_format} is 'NHWC' then + * out_backprop shape is {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The explicitPaddings attribute + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new DepthwiseConv2dNativeBackpropFilter<>(op), op, Arrays.asList("T", "strides", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filterSizes = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java index 392345ee075..287b29abba1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,29 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradients of depthwise convolution with respect to the input. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = DepthwiseConv2dNativeBackpropInput.OP_NAME, + inputsClass = DepthwiseConv2dNativeBackpropInput.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +53,8 @@ public final class DepthwiseConv2dNativeBackpropInput extends private Output output; - private DepthwiseConv2dNativeBackpropInput(Operation operation) { - super(operation); + public DepthwiseConv2dNativeBackpropInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -128,7 +135,7 @@ public static Options explicitPaddings(List explicitPaddings) { * @param explicitPaddings the explicitPaddings option * @return this Options instance. */ - public static Options explicitPaddings(Long[] explicitPaddings) { + public static Options explicitPaddings(Long... explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } @@ -170,7 +177,7 @@ public static Options dilations(List dilations) { * dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -270,4 +277,83 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = DepthwiseConv2dNativeBackpropInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * An integer vector representing the shape of {@code input}, based + * on {@code data_format}. For example, if {@code data_format} is 'NHWC' then + * {@code input} is a 4-D {@code [batch, height, width, channels]} tensor. + */ + public final Operand inputSizes; + + /** + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, depthwise_multiplier]}. + */ + public final Operand filter; + + /** + * 4-D with shape based on {@code data_format}. + * For example, if {@code data_format} is 'NHWC' then + * out_backprop shape is {@code [batch, out_height, out_width, out_channels]}. + * Gradients w.r.t. the output of the convolution. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * of the convolution. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The explicitPaddings attribute + */ + public final long[] explicitPaddings; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + */ + public final String dataFormat; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new DepthwiseConv2dNativeBackpropInput<>(op), op, Arrays.asList("T", "strides", "padding", "explicit_paddings", "data_format", "dilations")); + int inputIndex = 0; + inputSizes = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + explicitPaddings = op.attributes().getAttrIntList("explicit_paddings"); + dataFormat = op.attributes().getAttrString("data_format"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java index a070c09c659..019c786873c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -51,9 +57,11 @@ * kernel size and contains all zeros. *

      Note on duality: The dilation of {@code input} by the {@code filter} is equal to the * negation of the erosion of {@code -input} by the reflected {@code filter}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Dilation2d.OP_NAME, + inputsClass = Dilation2d.Inputs.class +) @Operator( group = "nn" ) @@ -65,8 +73,8 @@ public final class Dilation2d extends RawOp implements Operan private Output output; - private Dilation2d(Operation operation) { - super(operation); + public Dilation2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -120,4 +128,52 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Dilation2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, depth]}. + */ + public final Operand input; + + /** + * 3-D with shape {@code [filter_height, filter_width, depth]}. + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The stride of the sliding window for each dimension of the input + * tensor. Must be: {@code [1, stride_height, stride_width, 1]}. + */ + public final long[] strides; + + /** + * The input stride for atrous morphological dilation. Must be: + * {@code [1, rate_height, rate_width, 1]}. + */ + public final long[] rates; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new Dilation2d<>(op), op, Arrays.asList("T", "strides", "rates", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + rates = op.attributes().getAttrIntList("rates"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java index e4b191ab199..cae841aee0d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of morphological 2-D dilation with respect to the filter. - * - * @param data type for {@code filter_backprop} output */ +@OpMetadata( + opType = Dilation2dBackpropFilter.OP_NAME, + inputsClass = Dilation2dBackpropFilter.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class Dilation2dBackpropFilter extends RawOp imp private Output filterBackprop; - private Dilation2dBackpropFilter(Operation operation) { - super(operation); + public Dilation2dBackpropFilter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; filterBackprop = operation.output(outputIdx++); } @@ -102,4 +110,58 @@ public Output filterBackprop() { public Output asOutput() { return filterBackprop; } + + @OpInputsMetadata( + outputsClass = Dilation2dBackpropFilter.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, depth]}. + */ + public final Operand input; + + /** + * 3-D with shape {@code [filter_height, filter_width, depth]}. + */ + public final Operand filter; + + /** + * 4-D with shape {@code [batch, out_height, out_width, depth]}. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D of length 4. The stride of the sliding window for each dimension of + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. + */ + public final long[] strides; + + /** + * 1-D of length 4. The input stride for atrous morphological dilation. + * Must be: {@code [1, rate_height, rate_width, 1]}. + */ + public final long[] rates; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new Dilation2dBackpropFilter<>(op), op, Arrays.asList("T", "strides", "rates", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + rates = op.attributes().getAttrIntList("rates"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java index 12e8a9b2094..8204785ae02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of morphological 2-D dilation with respect to the input. - * - * @param data type for {@code in_backprop} output */ +@OpMetadata( + opType = Dilation2dBackpropInput.OP_NAME, + inputsClass = Dilation2dBackpropInput.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class Dilation2dBackpropInput extends RawOp impl private Output inBackprop; - private Dilation2dBackpropInput(Operation operation) { - super(operation); + public Dilation2dBackpropInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; inBackprop = operation.output(outputIdx++); } @@ -102,4 +110,58 @@ public Output inBackprop() { public Output asOutput() { return inBackprop; } + + @OpInputsMetadata( + outputsClass = Dilation2dBackpropInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, depth]}. + */ + public final Operand input; + + /** + * 3-D with shape {@code [filter_height, filter_width, depth]}. + */ + public final Operand filter; + + /** + * 4-D with shape {@code [batch, out_height, out_width, depth]}. + */ + public final Operand outBackprop; + + /** + * The T attribute + */ + public final DataType T; + + /** + * 1-D of length 4. The stride of the sliding window for each dimension of + * the input tensor. Must be: {@code [1, stride_height, stride_width, 1]}. + */ + public final long[] strides; + + /** + * 1-D of length 4. The input stride for atrous morphological dilation. + * Must be: {@code [1, rate_height, rate_width, 1]}. + */ + public final long[] rates; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new Dilation2dBackpropInput<>(op), op, Arrays.asList("T", "strides", "rates", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + strides = op.attributes().getAttrIntList("strides"); + rates = op.attributes().getAttrIntList("rates"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java index 801e842cd57..253baee2601 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -49,9 +55,11 @@ * *

      See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) * - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Elu.OP_NAME, + inputsClass = Elu.Inputs.class +) @Operator( group = "nn" ) @@ -63,8 +71,8 @@ public final class Elu extends RawOp implements Operand { private Output activations; - private Elu(Operation operation) { - super(operation); + public Elu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -73,7 +81,7 @@ private Elu(Operation operation) { * Factory method to create a class wrapping a new Elu operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Elu} output and operands * @return a new instance of Elu */ @@ -99,4 +107,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Elu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Elu<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java index 01b0f59507a..4d32b6d365f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes gradients for the exponential linear (Elu) operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = EluGrad.OP_NAME, + inputsClass = EluGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class EluGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class EluGrad extends RawOp implements Operand backprops; - private EluGrad(Operation operation) { - super(operation); + public EluGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -79,4 +91,32 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = EluGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding Elu operation. + */ + public final Operand gradients; + + /** + * The outputs of the corresponding Elu operation. + */ + public final Operand outputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new EluGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + outputs = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java index cd5a577fad0..df81bfa5b8b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,17 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -44,6 +48,10 @@ * the sampled candidates must be chosen independently of the context and of the * true labels. */ +@OpMetadata( + opType = FixedUnigramCandidateSampler.OP_NAME, + inputsClass = FixedUnigramCandidateSampler.Inputs.class +) @Operator( group = "nn" ) @@ -59,8 +67,8 @@ public final class FixedUnigramCandidateSampler extends RawOp { private Output sampledExpectedCount; - private FixedUnigramCandidateSampler(Operation operation) { - super(operation); + public FixedUnigramCandidateSampler(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sampledCandidates = operation.output(outputIdx++); trueExpectedCount = operation.output(outputIdx++); @@ -212,7 +220,7 @@ public static Options unigrams(List unigrams) { * order. Exactly one of vocab_file and unigrams should be passed to this op. * @return this Options instance. */ - public static Options unigrams(Float[] unigrams) { + public static Options unigrams(Float... unigrams) { return new Options().unigrams(unigrams); } @@ -413,4 +421,114 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = FixedUnigramCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to randomly sample. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * The sampler will sample integers from the interval [0, range_max). + */ + public final long rangeMax; + + /** + * Each valid line in this file (which should have a CSV-like format) + * corresponds to a valid word ID. IDs are in sequential order, starting from + * num_reserved_ids. The last entry in each line is expected to be a value + * corresponding to the count or relative probability. Exactly one of vocab_file + * and unigrams needs to be passed to this op. + */ + public final String vocabFile; + + /** + * The distortion is used to skew the unigram probability distribution. + * Each weight is first raised to the distortion's power before adding to the + * internal unigram distribution. As a result, distortion = 1.0 gives regular + * unigram sampling (as defined by the vocab file), and distortion = 0.0 gives + * a uniform distribution. + */ + public final float distortion; + + /** + * Optionally some reserved IDs can be added in the range [0, + * ..., num_reserved_ids) by the users. One use case is that a special unknown + * word token is used as ID 0. These IDs will have a sampling probability of 0. + */ + public final long numReservedIds; + + /** + * A sampler can be used to sample from a subset of the original range + * in order to speed up the whole computation through parallelism. This parameter + * (together with 'shard') indicates the number of partitions that are being + * used in the overall computation. + */ + public final long numShards; + + /** + * A sampler can be used to sample from a subset of the original range + * in order to speed up the whole computation through parallelism. This parameter + * (together with 'num_shards') indicates the particular partition number of a + * sampler op, when partitioning is being used. + */ + public final long shard; + + /** + * A list of unigram counts or probabilities, one per ID in sequential + * order. Exactly one of vocab_file and unigrams should be passed to this op. + */ + public final float[] unigrams; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new FixedUnigramCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "range_max", "vocab_file", "distortion", "num_reserved_ids", "num_shards", "shard", "unigrams", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + rangeMax = op.attributes().getAttrInt("range_max"); + vocabFile = op.attributes().getAttrString("vocab_file"); + distortion = op.attributes().getAttrFloat("distortion"); + numReservedIds = op.attributes().getAttrInt("num_reserved_ids"); + numShards = op.attributes().getAttrInt("num_shards"); + shard = op.attributes().getAttrInt("shard"); + unigrams = op.attributes().getAttrFloatList("unigrams"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java index ae6c9ebb5e9..bb525aac295 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ * region generation step. The only difference is that after pooling regions are * generated, a mean operation is performed instead of a max operation in each * pooling region. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FractionalAvgPool.OP_NAME, + inputsClass = FractionalAvgPool.Inputs.class +) @Operator( group = "nn" ) @@ -53,8 +61,8 @@ public final class FractionalAvgPool extends RawOp { private Output colPoolingSequence; - private FractionalAvgPool(Operation operation) { - super(operation); + public FractionalAvgPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); rowPoolingSequence = operation.output(outputIdx++); @@ -283,4 +291,79 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = FractionalAvgPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand value; + + /** + * Pooling ratio for each dimension of {@code value}, currently only + * supports row and col dimension and should be >= 1.0. For example, a valid + * pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements + * must be 1.0 because we don't allow pooling on batch and channels + * dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions + * respectively. + */ + public final float[] poolingRatio; + + /** + * When set to True, generates the pooling sequence in a + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for + * difference between pseudorandom and random. + */ + public final boolean pseudoRandom; + + /** + * When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

      {@code index 0 1 2 3 4} + *

      {@code value 20 5 16 3 7} + *

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [41/3, 26/3] for fractional avg pooling. + */ + public final boolean overlapping; + + /** + * When set to True, a fixed pooling region will be used when + * iterating over a FractionalAvgPool node in the computation graph. Mainly used + * in unit test to make FractionalAvgPool deterministic. + */ + public final boolean deterministic; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FractionalAvgPool<>(op), op, Arrays.asList("pooling_ratio", "pseudo_random", "overlapping", "deterministic", "seed", "seed2", "T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + poolingRatio = op.attributes().getAttrFloatList("pooling_ratio"); + pseudoRandom = op.attributes().getAttrBool("pseudo_random"); + overlapping = op.attributes().getAttrBool("overlapping"); + deterministic = op.attributes().getAttrBool("deterministic"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java index c703f47835a..eee42886ab1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -34,9 +41,14 @@ * out_backprop to those indices that form the same pooling cell. Therefore, we * just need to know the shape of original input tensor, instead of the whole * tensor. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FractionalAvgPoolGrad.OP_NAME, + inputsClass = FractionalAvgPoolGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class FractionalAvgPoolGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class FractionalAvgPoolGrad extends RawOp implem private Output output; - private FractionalAvgPoolGrad(Operation operation) { - super(operation); + public FractionalAvgPoolGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -141,4 +153,58 @@ public Options overlapping(Boolean overlapping) { return this; } } + + @OpInputsMetadata( + outputsClass = FractionalAvgPoolGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Original input tensor shape for {@code fractional_avg_pool} + */ + public final Operand origInputTensorShape; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. Gradients + * w.r.t. the output of {@code fractional_avg_pool}. + */ + public final Operand outBackprop; + + /** + * row pooling sequence, form pooling region with + * col_pooling_sequence. + */ + public final Operand rowPoolingSequence; + + /** + * column pooling sequence, form pooling region with + * row_pooling sequence. + */ + public final Operand colPoolingSequence; + + /** + * When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

      {@code index 0 1 2 3 4} + *

      {@code value 20 5 16 3 7} + *

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [41/3, 26/3] for fractional avg pooling. + */ + public final boolean overlapping; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FractionalAvgPoolGrad<>(op), op, Arrays.asList("overlapping", "T")); + int inputIndex = 0; + origInputTensorShape = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + rowPoolingSequence = (Operand) op.input(inputIndex++); + colPoolingSequence = (Operand) op.input(inputIndex++); + overlapping = op.attributes().getAttrBool("overlapping"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java index 44e4cd682c6..08bcbd1a63d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -57,9 +63,11 @@ * *

      For more details on fractional max pooling, see this paper: * Benjamin Graham, Fractional Max-Pooling - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FractionalMaxPool.OP_NAME, + inputsClass = FractionalMaxPool.Inputs.class +) @Operator( group = "nn" ) @@ -75,8 +83,8 @@ public final class FractionalMaxPool extends RawOp { private Output colPoolingSequence; - private FractionalMaxPool(Operation operation) { - super(operation); + public FractionalMaxPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); rowPoolingSequence = operation.output(outputIdx++); @@ -305,4 +313,79 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = FractionalMaxPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand value; + + /** + * Pooling ratio for each dimension of {@code value}, currently only + * supports row and col dimension and should be >= 1.0. For example, a valid + * pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements + * must be 1.0 because we don't allow pooling on batch and channels + * dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions + * respectively. + */ + public final float[] poolingRatio; + + /** + * When set to True, generates the pooling sequence in a + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for + * difference between pseudorandom and random. + */ + public final boolean pseudoRandom; + + /** + * When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

      {@code index 0 1 2 3 4} + *

      {@code value 20 5 16 3 7} + *

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [20, 16] for fractional max pooling. + */ + public final boolean overlapping; + + /** + * When set to True, a fixed pooling region will be used when + * iterating over a FractionalMaxPool node in the computation graph. Mainly used + * in unit test to make FractionalMaxPool deterministic. + */ + public final boolean deterministic; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FractionalMaxPool<>(op), op, Arrays.asList("pooling_ratio", "pseudo_random", "overlapping", "deterministic", "seed", "seed2", "T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + poolingRatio = op.attributes().getAttrFloatList("pooling_ratio"); + pseudoRandom = op.attributes().getAttrBool("pseudo_random"); + overlapping = op.attributes().getAttrBool("overlapping"); + deterministic = op.attributes().getAttrBool("deterministic"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java index b9f75ea53bb..d44e062ccf7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Computes gradient of the FractionalMaxPool function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FractionalMaxPoolGrad.OP_NAME, + inputsClass = FractionalMaxPoolGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class FractionalMaxPoolGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class FractionalMaxPoolGrad extends RawOp implem private Output output; - private FractionalMaxPoolGrad(Operation operation) { - super(operation); + public FractionalMaxPoolGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -138,4 +150,64 @@ public Options overlapping(Boolean overlapping) { return this; } } + + @OpInputsMetadata( + outputsClass = FractionalMaxPoolGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Original input for {@code fractional_max_pool} + */ + public final Operand origInput; + + /** + * Original output for {@code fractional_max_pool} + */ + public final Operand origOutput; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. Gradients + * w.r.t. the output of {@code fractional_max_pool}. + */ + public final Operand outBackprop; + + /** + * row pooling sequence, form pooling region with + * col_pooling_sequence. + */ + public final Operand rowPoolingSequence; + + /** + * column pooling sequence, form pooling region with + * row_pooling sequence. + */ + public final Operand colPoolingSequence; + + /** + * When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

      {@code index 0 1 2 3 4} + *

      {@code value 20 5 16 3 7} + *

      If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [20, 16] for fractional max pooling. + */ + public final boolean overlapping; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new FractionalMaxPoolGrad<>(op), op, Arrays.asList("overlapping", "T")); + int inputIndex = 0; + origInput = (Operand) op.input(inputIndex++); + origOutput = (Operand) op.input(inputIndex++); + outBackprop = (Operand) op.input(inputIndex++); + rowPoolingSequence = (Operand) op.input(inputIndex++); + colPoolingSequence = (Operand) op.input(inputIndex++); + overlapping = op.attributes().getAttrBool("overlapping"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java index b832e66d0f9..f5cede8855e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Batch normalization. * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". * The size of 1D Tensors matches the dimension C of the 4D Tensors. - * - * @param data type for {@code y} output - * - * @param data type for {@code batch_mean} output */ +@OpMetadata( + opType = FusedBatchNorm.OP_NAME, + inputsClass = FusedBatchNorm.Inputs.class +) @Operator( group = "nn" ) @@ -57,8 +63,8 @@ public final class FusedBatchNorm extends private Output reserveSpace3; - private FusedBatchNorm(Operation operation) { - super(operation); + public FusedBatchNorm(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); batchMean = operation.output(outputIdx++); @@ -275,4 +281,83 @@ public Options isTraining(Boolean isTraining) { return this; } } + + @OpInputsMetadata( + outputsClass = FusedBatchNorm.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D Tensor for input data. + */ + public final Operand x; + + /** + * A 1D Tensor for scaling factor, to scale the normalized x. + */ + public final Operand scale; + + /** + * A 1D Tensor for offset, to shift to the normalized x. + */ + public final Operand offset; + + /** + * A 1D Tensor for population mean. Used for inference only; + * must be empty for training. + */ + public final Operand mean; + + /** + * A 1D Tensor for population variance. Used for inference only; + * must be empty for training. + */ + public final Operand variance; + + /** + * The data type for the elements of input and output Tensors. + */ + public final DataType T; + + /** + * The data type for the scale, offset, mean, and variance. + */ + public final DataType U; + + /** + * A small float number added to the variance of x. + */ + public final float epsilon; + + /** + * The exponentialAvgFactor attribute + */ + public final float exponentialAvgFactor; + + /** + * The data format for x and y. Either "NHWC" (default) or "NCHW". + */ + public final String dataFormat; + + /** + * A bool value to indicate the operation is for training (default) + * or inference. + */ + public final boolean isTraining; + + public Inputs(GraphOperation op) { + super(new FusedBatchNorm<>(op), op, Arrays.asList("T", "U", "epsilon", "exponential_avg_factor", "data_format", "is_training")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + scale = (Operand) op.input(inputIndex++); + offset = (Operand) op.input(inputIndex++); + mean = (Operand) op.input(inputIndex++); + variance = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + U = op.attributes().getAttrType("U"); + epsilon = op.attributes().getAttrFloat("epsilon"); + exponentialAvgFactor = op.attributes().getAttrFloat("exponential_avg_factor"); + dataFormat = op.attributes().getAttrString("data_format"); + isTraining = op.attributes().getAttrBool("is_training"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java index d72aa33d4ee..985249a19fe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -32,11 +38,11 @@ * Gradient for batch normalization. * Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". * The size of 1D Tensors matches the dimension C of the 4D Tensors. - * - * @param data type for {@code x_backprop} output - * - * @param data type for {@code scale_backprop} output */ +@OpMetadata( + opType = FusedBatchNormGrad.OP_NAME, + inputsClass = FusedBatchNormGrad.Inputs.class +) @Operator( group = "nn" ) @@ -56,8 +62,8 @@ public final class FusedBatchNormGrad exte private Output reserveSpace5; - private FusedBatchNormGrad(Operation operation) { - super(operation); + public FusedBatchNormGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; xBackprop = operation.output(outputIdx++); scaleBackprop = operation.output(outputIdx++); @@ -245,4 +251,91 @@ public Options isTraining(Boolean isTraining) { return this; } } + + @OpInputsMetadata( + outputsClass = FusedBatchNormGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D Tensor for the gradient with respect to y. + */ + public final Operand yBackprop; + + /** + * A 4D Tensor for input data. + */ + public final Operand x; + + /** + * A 1D Tensor for scaling factor, to scale the normalized x. + */ + public final Operand scale; + + /** + * When is_training is True, a 1D Tensor for the computed batch + * mean to be reused in gradient computation. When is_training is + * False, a 1D Tensor for the population mean to be reused in both + * 1st and 2nd order gradient computation. + */ + public final Operand reserveSpace1; + + /** + * When is_training is True, a 1D Tensor for the computed batch + * variance (inverted variance in the cuDNN case) to be reused in + * gradient computation. When is_training is False, a 1D Tensor + * for the population variance to be reused in both 1st and 2nd + * order gradient computation. + */ + public final Operand reserveSpace2; + + /** + * When is_training is True, a 1D Tensor for some intermediate results to be reused + * in gradient computation. When is_training is False, a dummy empty Tensor will be + * created. + */ + public final Operand reserveSpace3; + + /** + * The data type for the elements of input and output Tensors. + */ + public final DataType T; + + /** + * The data type for the scale, offset, mean, and variance. + */ + public final DataType U; + + /** + * A small float number added to the variance of x. + */ + public final float epsilon; + + /** + * The data format for y_backprop, x, x_backprop. + * Either "NHWC" (default) or "NCHW". + */ + public final String dataFormat; + + /** + * A bool value to indicate the operation is for training (default) + * or inference. + */ + public final boolean isTraining; + + public Inputs(GraphOperation op) { + super(new FusedBatchNormGrad<>(op), op, Arrays.asList("T", "U", "epsilon", "data_format", "is_training")); + int inputIndex = 0; + yBackprop = (Operand) op.input(inputIndex++); + x = (Operand) op.input(inputIndex++); + scale = (Operand) op.input(inputIndex++); + reserveSpace1 = (Operand) op.input(inputIndex++); + reserveSpace2 = (Operand) op.input(inputIndex++); + reserveSpace3 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + U = op.attributes().getAttrType("U"); + epsilon = op.attributes().getAttrFloat("epsilon"); + dataFormat = op.attributes().getAttrString("data_format"); + isTraining = op.attributes().getAttrBool("is_training"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java index 2ca95bdf8ed..336419f92ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -42,9 +48,11 @@ * Internally this op uses a single per-graph scratch buffer, which means that it * will block if multiple versions are being run in parallel. This is because this * operator is primarily an optimization to minimize memory usage. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FusedPadConv2d.OP_NAME, + inputsClass = FusedPadConv2d.Inputs.class +) @Operator( group = "nn" ) @@ -56,8 +64,8 @@ public final class FusedPadConv2d extends RawOp implements Op private Output output; - private FusedPadConv2d(Operation operation) { - super(operation); + public FusedPadConv2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -71,7 +79,7 @@ private FusedPadConv2d(Operation operation) { * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape * {@code [filter_height, filter_width, in_channels, out_channels]}. - * @param mode the value of the mode property + * @param mode The value of the mode attribute * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. @@ -111,4 +119,59 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = FusedPadConv2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + */ + public final Operand input; + + /** + * A two-column matrix specifying the padding sizes. The number of + * rows must be the same as the rank of {@code input}. + */ + public final Operand paddings; + + /** + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The mode attribute + */ + public final String mode; + + /** + * 1-D of length 4. The stride of the sliding window for each dimension + * of {@code input}. Must be in the same order as the dimension specified with format. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new FusedPadConv2d<>(op), op, Arrays.asList("T", "mode", "strides", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + mode = op.attributes().getAttrString("mode"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java index 85ede719c12..8491feba1d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -41,9 +47,11 @@ * Internally this op uses a single per-graph scratch buffer, which means that it * will block if multiple versions are being run in parallel. This is because this * operator is primarily an optimization to minimize memory usage. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = FusedResizeAndPadConv2d.OP_NAME, + inputsClass = FusedResizeAndPadConv2d.Inputs.class +) @Operator( group = "nn" ) @@ -55,8 +63,8 @@ public final class FusedResizeAndPadConv2d extends RawOp impl private Output output; - private FusedResizeAndPadConv2d(Operation operation) { - super(operation); + public FusedResizeAndPadConv2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -72,7 +80,7 @@ private FusedResizeAndPadConv2d(Operation operation) { * rows must be the same as the rank of {@code input}. * @param filter 4-D with shape * {@code [filter_height, filter_width, in_channels, out_channels]}. - * @param mode the value of the mode property + * @param mode The value of the mode attribute * @param strides 1-D of length 4. The stride of the sliding window for each dimension * of {@code input}. Must be in the same order as the dimension specified with format. * @param padding The type of padding algorithm to use. @@ -154,4 +162,73 @@ public Options resizeAlignCorners(Boolean resizeAlignCorners) { return this; } } + + @OpInputsMetadata( + outputsClass = FusedResizeAndPadConv2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. + */ + public final Operand input; + + /** + * A 1-D int32 Tensor of 2 elements: {@code new_height, new_width}. The + * new size for the images. + */ + public final Operand sizeOutput; + + /** + * A two-column matrix specifying the padding sizes. The number of + * rows must be the same as the rank of {@code input}. + */ + public final Operand paddings; + + /** + * 4-D with shape + * {@code [filter_height, filter_width, in_channels, out_channels]}. + */ + public final Operand filter; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + */ + public final boolean resizeAlignCorners; + + /** + * The mode attribute + */ + public final String mode; + + /** + * 1-D of length 4. The stride of the sliding window for each dimension + * of {@code input}. Must be in the same order as the dimension specified with format. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new FusedResizeAndPadConv2d<>(op), op, Arrays.asList("T", "resize_align_corners", "mode", "strides", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + resizeAlignCorners = op.attributes().getAttrBool("resize_align_corners"); + mode = op.attributes().getAttrString("mode"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java index f097c11d9ba..0db7843bced 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -66,9 +73,14 @@ * * h = (1-u) \circ c + u \circ h_prev * - * - * @param data type for {@code r} output */ +@OpMetadata( + opType = GRUBlockCell.OP_NAME, + inputsClass = GRUBlockCell.Inputs.class +) +@Operator( + group = "nn" +) public final class GRUBlockCell extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -83,8 +95,8 @@ public final class GRUBlockCell extends RawOp { private Output h; - private GRUBlockCell(Operation operation) { - super(operation); + public GRUBlockCell(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; r = operation.output(outputIdx++); u = operation.output(outputIdx++); @@ -96,12 +108,12 @@ private GRUBlockCell(Operation operation) { * Factory method to create a class wrapping a new GRUBlockCell operation. * * @param scope current scope - * @param x the x value - * @param hPrev the hPrev value - * @param wRu the wRu value - * @param wC the wC value - * @param bRu the bRu value - * @param bC the bC value + * @param x The x value + * @param hPrev The hPrev value + * @param wRu The wRu value + * @param wC The wC value + * @param bRu The bRu value + * @param bC The bC value * @param data type for {@code GRUBlockCell} output and operands * @return a new instance of GRUBlockCell */ @@ -155,4 +167,56 @@ public Output c() { public Output h() { return h; } + + @OpInputsMetadata( + outputsClass = GRUBlockCell.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The hPrev input + */ + public final Operand hPrev; + + /** + * The wRu input + */ + public final Operand wRu; + + /** + * The wC input + */ + public final Operand wC; + + /** + * The bRu input + */ + public final Operand bRu; + + /** + * The bC input + */ + public final Operand bC; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new GRUBlockCell<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + wRu = (Operand) op.input(inputIndex++); + wC = (Operand) op.input(inputIndex++); + bRu = (Operand) op.input(inputIndex++); + bC = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java index 7491f7e22d4..7379a2790ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -101,9 +108,14 @@ * * d_b_c = sum of d_c_bar along axis = 0 * - * - * @param data type for {@code d_x} output */ +@OpMetadata( + opType = GRUBlockCellGrad.OP_NAME, + inputsClass = GRUBlockCellGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class GRUBlockCellGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -118,8 +130,8 @@ public final class GRUBlockCellGrad extends RawOp { private Output dRBarUBar; - private GRUBlockCellGrad(Operation operation) { - super(operation); + public GRUBlockCellGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; dX = operation.output(outputIdx++); dHPrev = operation.output(outputIdx++); @@ -131,16 +143,16 @@ private GRUBlockCellGrad(Operation operation) { * Factory method to create a class wrapping a new GRUBlockCellGrad operation. * * @param scope current scope - * @param x the x value - * @param hPrev the hPrev value - * @param wRu the wRu value - * @param wC the wC value - * @param bRu the bRu value - * @param bC the bC value - * @param r the r value - * @param u the u value - * @param c the c value - * @param dH the dH value + * @param x The x value + * @param hPrev The hPrev value + * @param wRu The wRu value + * @param wC The wC value + * @param bRu The bRu value + * @param bC The bC value + * @param r The r value + * @param u The u value + * @param c The c value + * @param dH The dH value * @param data type for {@code GRUBlockCellGrad} output and operands * @return a new instance of GRUBlockCellGrad */ @@ -199,4 +211,80 @@ public Output dCBar() { public Output dRBarUBar() { return dRBarUBar; } + + @OpInputsMetadata( + outputsClass = GRUBlockCellGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The x input + */ + public final Operand x; + + /** + * The hPrev input + */ + public final Operand hPrev; + + /** + * The wRu input + */ + public final Operand wRu; + + /** + * The wC input + */ + public final Operand wC; + + /** + * The bRu input + */ + public final Operand bRu; + + /** + * The bC input + */ + public final Operand bC; + + /** + * The r input + */ + public final Operand r; + + /** + * The u input + */ + public final Operand u; + + /** + * The c input + */ + public final Operand c; + + /** + * The dH input + */ + public final Operand dH; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new GRUBlockCellGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + wRu = (Operand) op.input(inputIndex++); + wC = (Operand) op.input(inputIndex++); + bRu = (Operand) op.input(inputIndex++); + bC = (Operand) op.input(inputIndex++); + r = (Operand) op.input(inputIndex++); + u = (Operand) op.input(inputIndex++); + c = (Operand) op.input(inputIndex++); + dH = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java index f6ba25f9885..50c11ca7986 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -43,6 +49,10 @@ * \(out_i\) be the output for example {@code i}, *

      $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ */ +@OpMetadata( + opType = InTopK.OP_NAME, + inputsClass = InTopK.Inputs.class +) @Operator( group = "nn" ) @@ -54,8 +64,8 @@ public final class InTopK extends RawOp implements Operand { private Output precision; - private InTopK(Operation operation) { - super(operation); + public InTopK(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; precision = operation.output(outputIdx++); } @@ -95,4 +105,38 @@ public Output precision() { public Output asOutput() { return precision; } + + @OpInputsMetadata( + outputsClass = InTopK.class + ) + public static class Inputs extends RawOpInputs { + /** + * A {@code batch_size} x {@code classes} tensor. + */ + public final Operand predictions; + + /** + * A {@code batch_size} vector of class ids. + */ + public final Operand targets; + + /** + * Number of top elements to look at for computing precision. + */ + public final Operand k; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InTopK(op), op, Arrays.asList("T")); + int inputIndex = 0; + predictions = (Operand) op.input(inputIndex++); + targets = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java index 0e8c241594d..5f178f53e50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient for the inverse of {@code x} wrt its input. * Specifically, {@code grad = -dy * y*y}, where {@code y = 1/x}, and {@code dy} * is the corresponding input gradient. - * - * @param data type for {@code z} output */ +@OpMetadata( + opType = InvGrad.OP_NAME, + inputsClass = InvGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class InvGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class InvGrad extends RawOp implements Operand private Output z; - private InvGrad(Operation operation) { - super(operation); + public InvGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; z = operation.output(outputIdx++); } @@ -51,8 +63,8 @@ private InvGrad(Operation operation) { * Factory method to create a class wrapping a new InvGrad operation. * * @param scope current scope - * @param y the y value - * @param dy the dy value + * @param y The y value + * @param dy The dy value * @param data type for {@code InvGrad} output and operands * @return a new instance of InvGrad */ @@ -79,4 +91,32 @@ public Output z() { public Output asOutput() { return z; } + + @OpInputsMetadata( + outputsClass = InvGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The y input + */ + public final Operand y; + + /** + * The dy input + */ + public final Operand dy; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new InvGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + y = (Operand) op.input(inputIndex++); + dy = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 index 20b1c7f5145..ecd511253e8 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,35 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 */ +@OpMetadata( + opType = IsotonicRegression.OP_NAME, + inputsClass = IsotonicRegression.Inputs.class +) +@Operator( + group = "nn" +) public final class IsotonicRegression extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +56,8 @@ public final class IsotonicRegression extends RawOp { private Output segments; - private IsotonicRegression(Operation operation) { - super(operation); + public IsotonicRegression(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); segments = operation.output(outputIdx++); @@ -102,4 +114,32 @@ public Output output() { public Output segments() { return segments; } + + @OpInputsMetadata( + outputsClass = IsotonicRegression.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A (batch_size, dim)-tensor holding a batch of inputs. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Dtype of output. + */ + public final DataType outputDtype; + + public Inputs(GraphOperation op) { + super(new IsotonicRegression<>(op), op, Arrays.asList("T", "output_dtype")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outputDtype = op.attributes().getAttrType("output_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java index 7f747028c27..9cc952c05cb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ *

        * output = sum(t ** 2) / 2
        * 
      - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = L2Loss.OP_NAME, + inputsClass = L2Loss.Inputs.class +) @Operator( group = "nn" ) @@ -47,8 +55,8 @@ public final class L2Loss extends RawOp implements Operand private Output output; - private L2Loss(Operation operation) { - super(operation); + public L2Loss(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,4 +91,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = L2Loss.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Typically 2-D, but may have any dimensions. + */ + public final Operand t; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new L2Loss<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + t = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java index b64f2d1ad90..5b1e38d3fbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -50,9 +57,14 @@ * co = tanh(cs) * h = co .* o * - * - * @param data type for {@code i} output */ +@OpMetadata( + opType = LSTMBlockCell.OP_NAME, + inputsClass = LSTMBlockCell.Inputs.class +) +@Operator( + group = "nn" +) public final class LSTMBlockCell extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -73,8 +85,8 @@ public final class LSTMBlockCell extends RawOp { private Output h; - private LSTMBlockCell(Operation operation) { - super(operation); + public LSTMBlockCell(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; i = operation.output(outputIdx++); cs = operation.output(outputIdx++); @@ -271,4 +283,86 @@ public Options usePeephole(Boolean usePeephole) { return this; } } + + @OpInputsMetadata( + outputsClass = LSTMBlockCell.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input to the LSTM cell, shape (batch_size, num_inputs). + */ + public final Operand x; + + /** + * Value of the cell state at previous time step. + */ + public final Operand csPrev; + + /** + * Output of the previous cell at previous time step. + */ + public final Operand hPrev; + + /** + * The weight matrix. + */ + public final Operand w; + + /** + * The weight matrix for input gate peephole connection. + */ + public final Operand wci; + + /** + * The weight matrix for forget gate peephole connection. + */ + public final Operand wcf; + + /** + * The weight matrix for output gate peephole connection. + */ + public final Operand wco; + + /** + * The bias vector. + */ + public final Operand b; + + /** + * The forget gate bias. + */ + public final float forgetBias; + + /** + * Value to clip the 'cs' value to. + */ + public final float cellClip; + + /** + * Whether to use peephole weights. + */ + public final boolean usePeephole; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LSTMBlockCell<>(op), op, Arrays.asList("forget_bias", "cell_clip", "use_peephole", "T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + csPrev = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + w = (Operand) op.input(inputIndex++); + wci = (Operand) op.input(inputIndex++); + wcf = (Operand) op.input(inputIndex++); + wco = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + forgetBias = op.attributes().getAttrFloat("forget_bias"); + cellClip = op.attributes().getAttrFloat("cell_clip"); + usePeephole = op.attributes().getAttrBool("use_peephole"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java index d2049d0183b..931e4bf2381 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the LSTM cell backward propagation for 1 timestep. * This implementation is to be used in conjunction of LSTMBlockCell. - * - * @param data type for {@code cs_prev_grad} output */ +@OpMetadata( + opType = LSTMBlockCellGrad.OP_NAME, + inputsClass = LSTMBlockCellGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class LSTMBlockCellGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +60,8 @@ public final class LSTMBlockCellGrad extends RawOp { private Output wcoGrad; - private LSTMBlockCellGrad(Operation operation) { - super(operation); + public LSTMBlockCellGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; csPrevGrad = operation.output(outputIdx++); dicfo = operation.output(outputIdx++); @@ -154,4 +166,122 @@ public Output wcfGrad() { public Output wcoGrad() { return wcoGrad; } + + @OpInputsMetadata( + outputsClass = LSTMBlockCellGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input to the LSTM cell, shape (batch_size, num_inputs). + */ + public final Operand x; + + /** + * The previous cell state. + */ + public final Operand csPrev; + + /** + * The previous h state. + */ + public final Operand hPrev; + + /** + * The weight matrix. + */ + public final Operand w; + + /** + * The weight matrix for input gate peephole connection. + */ + public final Operand wci; + + /** + * The weight matrix for forget gate peephole connection. + */ + public final Operand wcf; + + /** + * The weight matrix for output gate peephole connection. + */ + public final Operand wco; + + /** + * The bias vector. + */ + public final Operand b; + + /** + * The input gate. + */ + public final Operand i; + + /** + * The cell state before the tanh. + */ + public final Operand cs; + + /** + * The forget gate. + */ + public final Operand f; + + /** + * The output gate. + */ + public final Operand o; + + /** + * The cell input. + */ + public final Operand ci; + + /** + * The cell after the tanh. + */ + public final Operand co; + + /** + * The current gradient of cs. + */ + public final Operand csGrad; + + /** + * The gradient of h vector. + */ + public final Operand hGrad; + + /** + * Whether the cell uses peephole connections. + */ + public final boolean usePeephole; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LSTMBlockCellGrad<>(op), op, Arrays.asList("use_peephole", "T")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + csPrev = (Operand) op.input(inputIndex++); + hPrev = (Operand) op.input(inputIndex++); + w = (Operand) op.input(inputIndex++); + wci = (Operand) op.input(inputIndex++); + wcf = (Operand) op.input(inputIndex++); + wco = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + i = (Operand) op.input(inputIndex++); + cs = (Operand) op.input(inputIndex++); + f = (Operand) op.input(inputIndex++); + o = (Operand) op.input(inputIndex++); + ci = (Operand) op.input(inputIndex++); + co = (Operand) op.input(inputIndex++); + csGrad = (Operand) op.input(inputIndex++); + hGrad = (Operand) op.input(inputIndex++); + usePeephole = op.attributes().getAttrBool("use_peephole"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java index 1d13c658e78..a0f088f9a03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear: {@code max(features, features * alpha)}. - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = LeakyRelu.OP_NAME, + inputsClass = LeakyRelu.Inputs.class +) @Operator( group = "nn" ) @@ -43,8 +51,8 @@ public final class LeakyRelu extends RawOp implements Operand private Output activations; - private LeakyRelu(Operation operation) { - super(operation); + public LeakyRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private LeakyRelu(Operation operation) { * Factory method to create a class wrapping a new LeakyRelu operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param options carries optional attribute values * @param data type for {@code LeakyRelu} output and operands * @return a new instance of LeakyRelu @@ -119,4 +127,32 @@ public Options alpha(Float alpha) { return this; } } + + @OpInputsMetadata( + outputsClass = LeakyRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The alpha attribute + */ + public final float alpha; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LeakyRelu<>(op), op, Arrays.asList("alpha", "T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + alpha = op.attributes().getAttrFloat("alpha"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java index f9dede20ce7..2a3bcdeb74f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -38,6 +43,10 @@ * the sampled candidates must be chosen independently of the context and of the * true labels. */ +@OpMetadata( + opType = LearnedUnigramCandidateSampler.OP_NAME, + inputsClass = LearnedUnigramCandidateSampler.Inputs.class +) @Operator( group = "nn" ) @@ -53,8 +62,8 @@ public final class LearnedUnigramCandidateSampler extends RawOp { private Output sampledExpectedCount; - private LearnedUnigramCandidateSampler(Operation operation) { - super(operation); + public LearnedUnigramCandidateSampler(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sampledCandidates = operation.output(outputIdx++); trueExpectedCount = operation.output(outputIdx++); @@ -190,4 +199,61 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = LearnedUnigramCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to randomly sample. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * The sampler will sample integers from the interval [0, range_max). + */ + public final long rangeMax; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new LearnedUnigramCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "range_max", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + rangeMax = op.attributes().getAttrInt("range_max"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java index 1fd9649c309..17c1e5c0d04 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -40,9 +46,11 @@ * *

      For details, see Krizhevsky et al., ImageNet classification with deep * convolutional neural networks (NIPS 2012) . - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = LocalResponseNormalization.OP_NAME, + inputsClass = LocalResponseNormalization.Inputs.class +) @Operator( group = "nn" ) @@ -54,8 +62,8 @@ public final class LocalResponseNormalization extends RawOp i private Output output; - private LocalResponseNormalization(Operation operation) { - super(operation); + public LocalResponseNormalization(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -208,4 +216,50 @@ public Options beta(Float beta) { return this; } } + + @OpInputsMetadata( + outputsClass = LocalResponseNormalization.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D. + */ + public final Operand input; + + /** + * 0-D. Half-width of the 1-D normalization window. + */ + public final long depthRadius; + + /** + * An offset (usually positive to avoid dividing by 0). + */ + public final float bias; + + /** + * A scale factor, usually positive. + */ + public final float alpha; + + /** + * An exponent. + */ + public final float beta; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LocalResponseNormalization<>(op), op, Arrays.asList("depth_radius", "bias", "alpha", "beta", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + depthRadius = op.attributes().getAttrInt("depth_radius"); + bias = op.attributes().getAttrFloat("bias"); + alpha = op.attributes().getAttrFloat("alpha"); + beta = op.attributes().getAttrFloat("beta"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java index 57d51c9daf1..c0b795094aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Gradients for Local Response Normalization. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = LocalResponseNormalizationGrad.OP_NAME, + inputsClass = LocalResponseNormalizationGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class LocalResponseNormalizationGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class LocalResponseNormalizationGrad extends Raw private Output output; - private LocalResponseNormalizationGrad(Operation operation) { - super(operation); + public LocalResponseNormalizationGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -197,4 +209,62 @@ public Options beta(Float beta) { return this; } } + + @OpInputsMetadata( + outputsClass = LocalResponseNormalizationGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand inputGrads; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand inputImage; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand outputImage; + + /** + * A depth radius. + */ + public final long depthRadius; + + /** + * An offset (usually > 0 to avoid dividing by 0). + */ + public final float bias; + + /** + * A scale factor, usually positive. + */ + public final float alpha; + + /** + * An exponent. + */ + public final float beta; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LocalResponseNormalizationGrad<>(op), op, Arrays.asList("depth_radius", "bias", "alpha", "beta", "T")); + int inputIndex = 0; + inputGrads = (Operand) op.input(inputIndex++); + inputImage = (Operand) op.input(inputIndex++); + outputImage = (Operand) op.input(inputIndex++); + depthRadius = op.attributes().getAttrInt("depth_radius"); + bias = op.attributes().getAttrFloat("bias"); + alpha = op.attributes().getAttrFloat("alpha"); + beta = op.attributes().getAttrFloat("beta"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java index a70ad1ba80d..1e19b56c19f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ *

        * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
        * 
      - * - * @param data type for {@code logsoftmax} output */ +@OpMetadata( + opType = LogSoftmax.OP_NAME, + inputsClass = LogSoftmax.Inputs.class +) @Operator( group = "nn" ) @@ -47,8 +55,8 @@ public final class LogSoftmax extends RawOp implements Operan private Output logsoftmax; - private LogSoftmax(Operation operation) { - super(operation); + public LogSoftmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; logsoftmax = operation.output(outputIdx++); } @@ -83,4 +91,26 @@ public Output logsoftmax() { public Output asOutput() { return logsoftmax; } + + @OpInputsMetadata( + outputsClass = LogSoftmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D with shape {@code [batch_size, num_classes]}. + */ + public final Operand logits; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new LogSoftmax<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + logits = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java index 630374f0888..75b432b8ba3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Performs max pooling on the input. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPool.OP_NAME, + inputsClass = MaxPool.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPool extends RawOp implements Operand output; - private MaxPool(Operation operation) { - super(operation); + public MaxPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -135,4 +143,55 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D input to pool over. + */ + public final Operand input; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final Operand ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final Operand strides; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + public Inputs(GraphOperation op) { + super(new MaxPool<>(op), op, Arrays.asList("T", "padding", "data_format")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + ksize = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java index 321a5dcb029..d701189d5e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Performs 3D max pooling on the input. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPool3d.OP_NAME, + inputsClass = MaxPool3d.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPool3d extends RawOp implements Operand private Output output; - private MaxPool3d(Operation operation) { - super(operation); + public MaxPool3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -144,4 +152,56 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPool3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Shape {@code [batch, depth, rows, cols, channels]} tensor to pool over. + */ + public final Operand input; + + /** + * 1-D tensor of length 5. The size of the window for each dimension of + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. + */ + public final long[] ksize; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPool3d<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java index f3f0ec2b5cf..932399be80b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes gradients of 3D max pooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPool3dGrad.OP_NAME, + inputsClass = MaxPool3dGrad.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPool3dGrad extends RawOp implements Ope private Output output; - private MaxPool3dGrad(Operation operation) { - super(operation); + public MaxPool3dGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -150,4 +158,74 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPool3dGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand origInput; + + /** + * The original output tensor. + */ + public final Operand origOutput; + + /** + * Output backprop of shape {@code [batch, depth, rows, cols, channels]}. + */ + public final Operand grad; + + /** + * 1-D tensor of length 5. The size of the window for each dimension of + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. + */ + public final long[] ksize; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The TInput attribute + */ + public final DataType TInput; + + public Inputs(GraphOperation op) { + super(new MaxPool3dGrad<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T", "TInput")); + int inputIndex = 0; + origInput = (Operand) op.input(inputIndex++); + origOutput = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + TInput = op.attributes().getAttrType("TInput"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java index 79673ef2121..74dbc598b35 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPool3dGradGrad.OP_NAME, + inputsClass = MaxPool3dGradGrad.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPool3dGradGrad extends RawOp implements private Output output; - private MaxPool3dGradGrad(Operation operation) { - super(operation); + public MaxPool3dGradGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -149,4 +157,68 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPool3dGradGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand origInput; + + /** + * The original output tensor. + */ + public final Operand origOutput; + + /** + * Output backprop of shape {@code [batch, depth, rows, cols, channels]}. + */ + public final Operand grad; + + /** + * 1-D tensor of length 5. The size of the window for each dimension of + * the input tensor. Must have {@code ksize[0] = ksize[4] = 1}. + */ + public final long[] ksize; + + /** + * 1-D tensor of length 5. The stride of the sliding window for each + * dimension of {@code input}. Must have {@code strides[0] = strides[4] = 1}. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPool3dGradGrad<>(op), op, Arrays.asList("ksize", "strides", "padding", "data_format", "T")); + int inputIndex = 0; + origInput = (Operand) op.input(inputIndex++); + origOutput = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java index 60129b28217..a329757270c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients of the maxpooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPoolGrad.OP_NAME, + inputsClass = MaxPoolGrad.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPoolGrad extends RawOp implements Opera private Output output; - private MaxPoolGrad(Operation operation) { - super(operation); + public MaxPoolGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -140,4 +148,67 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPoolGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand origInput; + + /** + * The original output tensor. + */ + public final Operand origOutput; + + /** + * 4-D. Gradients w.r.t. the output of {@code max_pool}. + */ + public final Operand grad; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final Operand ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final Operand strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPoolGrad<>(op), op, Arrays.asList("padding", "data_format", "T")); + int inputIndex = 0; + origInput = (Operand) op.input(inputIndex++); + origOutput = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java index 7be3b57875e..0b0f0f616b7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPoolGradGrad.OP_NAME, + inputsClass = MaxPoolGradGrad.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPoolGradGrad extends RawOp implements O private Output output; - private MaxPoolGradGrad(Operation operation) { - super(operation); + public MaxPoolGradGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -140,4 +148,67 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPoolGradGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand origInput; + + /** + * The original output tensor. + */ + public final Operand origOutput; + + /** + * 4-D. Gradients of gradients w.r.t. the input of {@code max_pool}. + */ + public final Operand grad; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final Operand ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final Operand strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + */ + public final String dataFormat; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPoolGradGrad<>(op), op, Arrays.asList("padding", "data_format", "T")); + int inputIndex = 0; + origInput = (Operand) op.input(inputIndex++); + origOutput = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + ksize = (Operand) op.input(inputIndex++); + strides = (Operand) op.input(inputIndex++); + padding = op.attributes().getAttrString("padding"); + dataFormat = op.attributes().getAttrString("data_format"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java index 2e617fa36c4..9dedc6014b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPoolGradGradWithArgmax.OP_NAME, + inputsClass = MaxPoolGradGradWithArgmax.Inputs.class +) @Operator( group = "nn" ) @@ -44,8 +52,8 @@ public final class MaxPoolGradGradWithArgmax extends RawOp im private Output output; - private MaxPoolGradGradWithArgmax(Operation operation) { - super(operation); + public MaxPoolGradGradWithArgmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -141,4 +149,70 @@ public Options includeBatchInIndex(Boolean includeBatchInIndex) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPoolGradGradWithArgmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input. + */ + public final Operand input; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the + * input of {@code max_pool}. + */ + public final Operand grad; + + /** + * The indices of the maximum values chosen for each output of {@code max_pool}. + */ + public final Operand argmax; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Whether to include batch dimension in flattened index of {@code argmax}. + */ + public final boolean includeBatchInIndex; + + /** + * The Targmax attribute + */ + public final DataType Targmax; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPoolGradGradWithArgmax<>(op), op, Arrays.asList("ksize", "strides", "padding", "include_batch_in_index", "Targmax", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + argmax = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + includeBatchInIndex = op.attributes().getAttrBool("include_batch_in_index"); + Targmax = op.attributes().getAttrType("Targmax"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java index 79d6a05146e..60d7e7de94c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,33 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes gradients of the maxpooling function. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = MaxPoolGradWithArgmax.OP_NAME, + inputsClass = MaxPoolGradWithArgmax.Inputs.class +) +@Operator( + group = "nn" +) public final class MaxPoolGradWithArgmax extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +52,8 @@ public final class MaxPoolGradWithArgmax extends RawOp implem private Output output; - private MaxPoolGradWithArgmax(Operation operation) { - super(operation); + public MaxPoolGradWithArgmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -137,4 +149,70 @@ public Options includeBatchInIndex(Boolean includeBatchInIndex) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPoolGradWithArgmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input. + */ + public final Operand input; + + /** + * 4-D with shape {@code [batch, height, width, channels]}. Gradients w.r.t. the + * output of {@code max_pool}. + */ + public final Operand grad; + + /** + * The indices of the maximum values chosen for each output of {@code max_pool}. + */ + public final Operand argmax; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Whether to include batch dimension in flattened index of {@code argmax}. + */ + public final boolean includeBatchInIndex; + + /** + * The Targmax attribute + */ + public final DataType Targmax; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPoolGradWithArgmax<>(op), op, Arrays.asList("ksize", "strides", "padding", "include_batch_in_index", "Targmax", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + argmax = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + includeBatchInIndex = op.attributes().getAttrBool("include_batch_in_index"); + Targmax = op.attributes().getAttrType("Targmax"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java index f3685f3aa0e..78e871d2de7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,16 +17,22 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -40,11 +46,11 @@ * even if padding is involved and the mathematically correct answer is outside * (either negative or too large). This is a bug, but fixing it is difficult to do * in a safe backwards compatible way, especially due to flattening. - * - * @param data type for {@code output} output - * - * @param data type for {@code argmax} output */ +@OpMetadata( + opType = MaxPoolWithArgmax.OP_NAME, + inputsClass = MaxPoolWithArgmax.Inputs.class +) @Operator( group = "nn" ) @@ -58,8 +64,8 @@ public final class MaxPoolWithArgmax exten private Output argmax; - private MaxPoolWithArgmax(Operation operation) { - super(operation); + public MaxPoolWithArgmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); argmax = operation.output(outputIdx++); @@ -73,7 +79,7 @@ private MaxPoolWithArgmax(Operation operation) { * @param ksize The size of the window for each dimension of the input tensor. * @param strides The stride of the sliding window for each dimension of the * input tensor. - * @param Targmax the value of the Targmax property + * @param Targmax The value of the Targmax attribute * @param padding The type of padding algorithm to use. * @param options carries optional attribute values * @param data type for {@code MaxPoolWithArgmax} output and operands @@ -127,7 +133,7 @@ public static MaxPoolWithArgmax cre describeByClass = true ) public static MaxPoolWithArgmax create(Scope scope, - Operand input, List ksize, List strides, String padding, Options[] options) { + Operand input, List ksize, List strides, String padding, Options... options) { return create(scope, input, ksize, strides, TInt64.class, padding, options); } @@ -179,4 +185,57 @@ public Options includeBatchInIndex(Boolean includeBatchInIndex) { return this; } } + + @OpInputsMetadata( + outputsClass = MaxPoolWithArgmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. Input to pool over. + */ + public final Operand input; + + /** + * The size of the window for each dimension of the input tensor. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the + * input tensor. + */ + public final long[] strides; + + /** + * The Targmax attribute + */ + public final DataType Targmax; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * Whether to include batch dimension in flattened index of {@code argmax}. + */ + public final boolean includeBatchInIndex; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new MaxPoolWithArgmax<>(op), op, Arrays.asList("ksize", "strides", "Targmax", "padding", "include_batch_in_index", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + Targmax = op.attributes().getAttrType("Targmax"); + padding = op.attributes().getAttrString("padding"); + includeBatchInIndex = op.attributes().getAttrBool("include_batch_in_index"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java index 47f38a213fb..57754316380 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -37,9 +43,11 @@ *
        * values.shape = input.shape[:-1]
        * 
      - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = NthElement.OP_NAME, + inputsClass = NthElement.Inputs.class +) @Operator( group = "nn" ) @@ -51,8 +59,8 @@ public final class NthElement extends RawOp implements Operan private Output values; - private NthElement(Operation operation) { - super(operation); + public NthElement(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; values = operation.output(outputIdx++); } @@ -132,4 +140,40 @@ public Options reverse(Boolean reverse) { return this; } } + + @OpInputsMetadata( + outputsClass = NthElement.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D or higher with last dimension at least {@code n+1}. + */ + public final Operand input; + + /** + * 0-D. Position of sorted vector to select along the last dimension (along + * each row for matrices). Valid range of n is {@code [0, input.shape[:-1])} + */ + public final Operand n; + + /** + * When set to True, find the nth-largest value in the vector and vice + * versa. + */ + public final boolean reverse; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new NthElement<>(op), op, Arrays.asList("reverse", "T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + n = (Operand) op.input(inputIndex++); + reverse = op.attributes().getAttrBool("reverse"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java index d9ae295a485..8987fcd7d55 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Produces the average pool of the input tensor for quantized types. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedAvgPool.OP_NAME, + inputsClass = QuantizedAvgPool.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class QuantizedAvgPool extends RawOp { private Output maxOutput; - private QuantizedAvgPool(Operation operation) { - super(operation); + public QuantizedAvgPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -122,4 +130,58 @@ public Output minOutput() { public Output maxOutput() { return maxOutput; } + + @OpInputsMetadata( + outputsClass = QuantizedAvgPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, channels]}. + */ + public final Operand input; + + /** + * The float value that the lowest quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the highest quantized input value represents. + */ + public final Operand maxInput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The size of the window for each dimension of the input tensor. + * The length must be 4 to match the number of dimensions of the input. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the input + * tensor. The length must be 4 to match the number of dimensions of the input. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new QuantizedAvgPool<>(op), op, Arrays.asList("T", "ksize", "strides", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java index f7d54b8efa4..7f22995509c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -33,9 +39,11 @@ * Quantized Batch normalization. * This op is deprecated and will be removed in the future. Prefer * {@code tf.nn.batch_normalization}. - * - * @param data type for {@code result} output */ +@OpMetadata( + opType = QuantizedBatchNormWithGlobalNormalization.OP_NAME, + inputsClass = QuantizedBatchNormWithGlobalNormalization.Inputs.class +) @Operator( group = "nn" ) @@ -51,8 +59,8 @@ public final class QuantizedBatchNormWithGlobalNormalization private Output resultMax; - private QuantizedBatchNormWithGlobalNormalization(Operation operation) { - super(operation); + public QuantizedBatchNormWithGlobalNormalization(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; result = operation.output(outputIdx++); resultMin = operation.output(outputIdx++); @@ -85,7 +93,7 @@ private QuantizedBatchNormWithGlobalNormalization(Operation operation) { * with the normalized tensor. * @param gammaMin The value represented by the lowest quantized gamma. * @param gammaMax The value represented by the highest quantized gamma. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param varianceEpsilon A small float number to avoid dividing by 0. * @param scaleAfterNormalization A bool indicating whether the resulted tensor * needs to be multiplied with gamma. @@ -150,4 +158,136 @@ public Output resultMin() { public Output resultMax() { return resultMax; } + + @OpInputsMetadata( + outputsClass = QuantizedBatchNormWithGlobalNormalization.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D input Tensor. + */ + public final Operand t; + + /** + * The value represented by the lowest quantized input. + */ + public final Operand tMin; + + /** + * The value represented by the highest quantized input. + */ + public final Operand tMax; + + /** + * A 1D mean Tensor with size matching the last dimension of t. + * This is the first output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand m; + + /** + * The value represented by the lowest quantized mean. + */ + public final Operand mMin; + + /** + * The value represented by the highest quantized mean. + */ + public final Operand mMax; + + /** + * A 1D variance Tensor with size matching the last dimension of t. + * This is the second output from tf.nn.moments, + * or a saved moving average thereof. + */ + public final Operand v; + + /** + * The value represented by the lowest quantized variance. + */ + public final Operand vMin; + + /** + * The value represented by the highest quantized variance. + */ + public final Operand vMax; + + /** + * A 1D beta Tensor with size matching the last dimension of t. + * An offset to be added to the normalized tensor. + */ + public final Operand beta; + + /** + * The value represented by the lowest quantized offset. + */ + public final Operand betaMin; + + /** + * The value represented by the highest quantized offset. + */ + public final Operand betaMax; + + /** + * A 1D gamma Tensor with size matching the last dimension of t. + * If "scale_after_normalization" is true, this tensor will be multiplied + * with the normalized tensor. + */ + public final Operand gamma; + + /** + * The value represented by the lowest quantized gamma. + */ + public final Operand gammaMin; + + /** + * The value represented by the highest quantized gamma. + */ + public final Operand gammaMax; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * A small float number to avoid dividing by 0. + */ + public final float varianceEpsilon; + + /** + * A bool indicating whether the resulted tensor + * needs to be multiplied with gamma. + */ + public final boolean scaleAfterNormalization; + + public Inputs(GraphOperation op) { + super(new QuantizedBatchNormWithGlobalNormalization<>(op), op, Arrays.asList("Tinput", "out_type", "variance_epsilon", "scale_after_normalization")); + int inputIndex = 0; + t = (Operand) op.input(inputIndex++); + tMin = (Operand) op.input(inputIndex++); + tMax = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + mMin = (Operand) op.input(inputIndex++); + mMax = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + vMin = (Operand) op.input(inputIndex++); + vMax = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + betaMin = (Operand) op.input(inputIndex++); + betaMax = (Operand) op.input(inputIndex++); + gamma = (Operand) op.input(inputIndex++); + gammaMin = (Operand) op.input(inputIndex++); + gammaMax = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + varianceEpsilon = op.attributes().getAttrFloat("variance_epsilon"); + scaleAfterNormalization = op.attributes().getAttrBool("scale_after_normalization"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java index ac9a8fc2861..744eb1397eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Adds Tensor 'bias' to Tensor 'input' for Quantized types. * Broadcasts the values of bias on dimensions 0..N-2 of 'input'. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedBiasAdd.OP_NAME, + inputsClass = QuantizedBiasAdd.Inputs.class +) @Operator( group = "nn" ) @@ -50,8 +58,8 @@ public final class QuantizedBiasAdd extends RawOp { private Output maxOut; - private QuantizedBiasAdd(Operation operation) { - super(operation); + public QuantizedBiasAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -62,13 +70,13 @@ private QuantizedBiasAdd(Operation operation) { * Factory method to create a class wrapping a new QuantizedBiasAdd operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param bias A 1D bias Tensor with size matching the last dimension of 'input'. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. * @param minBias The float value that the lowest quantized bias value represents. * @param maxBias The float value that the highest quantized bias value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedBiasAdd} output and operands * @return a new instance of QuantizedBiasAdd */ @@ -116,4 +124,68 @@ public Output minOut() { public Output maxOut() { return maxOut; } + + @OpInputsMetadata( + outputsClass = QuantizedBiasAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * A 1D bias Tensor with size matching the last dimension of 'input'. + */ + public final Operand bias; + + /** + * The float value that the lowest quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the highest quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the lowest quantized bias value represents. + */ + public final Operand minBias; + + /** + * The float value that the highest quantized bias value represents. + */ + public final Operand maxBias; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new QuantizedBiasAdd<>(op), op, Arrays.asList("T1", "T2", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minBias = (Operand) op.input(inputIndex++); + maxBias = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java index c7980b56a44..9226b7b697e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DAndRelu operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DAndRelu.OP_NAME, + inputsClass = QuantizedConv2DAndRelu.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DAndRelu extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DAndRelu extends RawOp { private Output maxOutput; - private QuantizedConv2DAndRelu(Operation operation) { - super(operation); + public QuantizedConv2DAndRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,15 +70,15 @@ private QuantizedConv2DAndRelu(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DAndRelu operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DAndRelu} output and operands * @return a new instance of QuantizedConv2DAndRelu @@ -131,7 +142,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -151,7 +162,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -237,4 +248,92 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DAndRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DAndRelu<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java index e4adb5cf7f9..f02eba09012 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DAndReluAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DAndReluAndRequantize extend private Output maxOutput; - private QuantizedConv2DAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,17 +70,17 @@ private QuantizedConv2DAndReluAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DAndReluAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DAndReluAndRequantize @@ -136,7 +147,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -156,7 +167,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -242,4 +253,104 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DAndReluAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java index c4f415ebf8a..66344508160 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DAndRequantize extends RawOp private Output maxOutput; - private QuantizedConv2DAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,17 +70,17 @@ private QuantizedConv2DAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DAndRequantize} output and operands * @return a new instance of QuantizedConv2DAndRequantize @@ -136,7 +147,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -156,7 +167,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -242,4 +253,104 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java index eb8860fde35..bfd108c34d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes QuantizedConv2D per channel. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DPerChannel.OP_NAME, + inputsClass = QuantizedConv2DPerChannel.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DPerChannel extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DPerChannel extends RawOp { private Output maxOutput; - private QuantizedConv2DPerChannel(Operation operation) { - super(operation); + public QuantizedConv2DPerChannel(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -67,7 +78,7 @@ private QuantizedConv2DPerChannel(Operation operation) { * @param maxFilter The maximum value of the filter tensor. * @param outType The quantized type of output tensor that needs to be converted. * @param strides list of stride values. - * @param padding the value of the padding property + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DPerChannel} output and operands * @return a new instance of QuantizedConv2DPerChannel @@ -124,7 +135,7 @@ public static Options dilations(List dilations) { * @param dilations list of dilation values. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -186,4 +197,86 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DPerChannel.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The original filter tensor. + */ + public final Operand filter; + + /** + * The minimum value of the input tensor + */ + public final Operand minInput; + + /** + * The maximum value of the input tensor. + */ + public final Operand maxInput; + + /** + * The minimum value of the filter tensor. + */ + public final Operand minFilter; + + /** + * The maximum value of the filter tensor. + */ + public final Operand maxFilter; + + /** + * The quantized type of input tensor that needs to be converted. + */ + public final DataType Tinput; + + /** + * The quantized type of filter tensor that needs to be converted. + */ + public final DataType Tfilter; + + /** + * The quantized type of output tensor that needs to be converted. + */ + public final DataType outType; + + /** + * list of stride values. + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * list of dilation values. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DPerChannel<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java index ccdd59f9d22..fe5566ac7e9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBias operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBias.OP_NAME, + inputsClass = QuantizedConv2DWithBias.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBias extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBias extends RawOp { private Output maxOutput; - private QuantizedConv2DWithBias(Operation operation) { - super(operation); + public QuantizedConv2DWithBias(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,16 +70,16 @@ private QuantizedConv2DWithBias(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBias operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBias} output and operands * @return a new instance of QuantizedConv2DWithBias @@ -133,7 +144,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -153,7 +164,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -239,4 +250,98 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBias.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBias<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java index 591734ef5f1..ff7d157a846 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasAndRelu operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndRelu.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasAndRelu extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasAndRelu extends Raw private Output maxOutput; - private QuantizedConv2DWithBiasAndRelu(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,16 +70,16 @@ private QuantizedConv2DWithBiasAndRelu(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRelu operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasAndRelu} output and operands * @return a new instance of QuantizedConv2DWithBiasAndRelu @@ -133,7 +144,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -153,7 +164,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -239,4 +250,98 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasAndRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasAndRelu<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java index 238d0e6a440..b68080cc72c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasAndReluAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasAndReluAndRequantize maxOutput; - private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,18 +70,18 @@ private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndReluAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasAndReluAndRequantize @@ -138,7 +149,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -158,7 +169,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -244,4 +255,116 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasAndReluAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "Tbias", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + Tbias = op.attributes().getAttrType("Tbias"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java index cceca8676b0..5301017e666 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasAndRequantize exten private Output maxOutput; - private QuantizedConv2DWithBiasAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,18 +70,18 @@ private QuantizedConv2DWithBiasAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasAndRequantize @@ -138,7 +149,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -158,7 +169,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -244,4 +255,116 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "Tbias", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + Tbias = op.attributes().getAttrType("Tbias"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java index 07979421f05..687e41485d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize maxOutput; - private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,21 +70,21 @@ private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param summand the summand value - * @param minSummand the minSummand value - * @param maxSummand the maxSummand value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param summand The summand value + * @param minSummand The minSummand value + * @param maxSummand The maxSummand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasSignedSumAndReluAndRequantize @@ -145,7 +156,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -165,7 +176,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -251,4 +262,140 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The summand input + */ + public final Operand summand; + + /** + * The minSummand input + */ + public final Operand minSummand; + + /** + * The maxSummand input + */ + public final Operand maxSummand; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Tsummand attribute + */ + public final DataType Tsummand; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "Tbias", "Tsummand", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + summand = (Operand) op.input(inputIndex++); + minSummand = (Operand) op.input(inputIndex++); + maxSummand = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + Tbias = op.attributes().getAttrType("Tbias"); + Tsummand = op.attributes().getAttrType("Tsummand"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java index 3ae339e9774..34ceb6e7898 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasSumAndRelu operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasSumAndRelu.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSumAndRelu.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasSumAndRelu extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasSumAndRelu extends private Output maxOutput; - private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasSumAndRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,17 +70,17 @@ private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndRelu operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param summand the summand value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param summand The summand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasSumAndRelu} output and operands * @return a new instance of QuantizedConv2DWithBiasSumAndRelu @@ -135,7 +146,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -155,7 +166,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -241,4 +252,104 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasSumAndRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The summand input + */ + public final Operand summand; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasSumAndRelu<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + summand = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java index 53be5e9f6b0..021873d6885 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedConv2DWithBiasSumAndReluAndRequantize operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2DWithBiasSumAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedConv2DWithBiasSumAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedConv2DWithBiasSumAndReluAndRequantize maxOutput; - private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -59,21 +70,21 @@ private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndReluAndRequantize operation. * * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param bias the bias value - * @param minInput the minInput value - * @param maxInput the maxInput value - * @param minFilter the minFilter value - * @param maxFilter the maxFilter value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param summand the summand value - * @param minSummand the minSummand value - * @param maxSummand the maxSummand value - * @param outType the value of the outType property - * @param strides the value of the strides property - * @param padding the value of the padding property + * @param input The input value + * @param filter The filter value + * @param bias The bias value + * @param minInput The minInput value + * @param maxInput The maxInput value + * @param minFilter The minFilter value + * @param maxFilter The maxFilter value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param summand The summand value + * @param minSummand The minSummand value + * @param maxSummand The maxSummand value + * @param outType The value of the outType attribute + * @param strides The value of the strides attribute + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedConv2DWithBiasSumAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasSumAndReluAndRequantize @@ -145,7 +156,7 @@ public static Options dilations(List dilations) { * @param dilations the dilations option * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -165,7 +176,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -251,4 +262,140 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2DWithBiasSumAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The filter input + */ + public final Operand filter; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minInput input + */ + public final Operand minInput; + + /** + * The maxInput input + */ + public final Operand maxInput; + + /** + * The minFilter input + */ + public final Operand minFilter; + + /** + * The maxFilter input + */ + public final Operand maxFilter; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The summand input + */ + public final Operand summand; + + /** + * The minSummand input + */ + public final Operand minSummand; + + /** + * The maxSummand input + */ + public final Operand maxSummand; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Tsummand attribute + */ + public final DataType Tsummand; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The strides attribute + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * The dilations attribute + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2DWithBiasSumAndReluAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "Tbias", "Tsummand", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + summand = (Operand) op.input(inputIndex++); + minSummand = (Operand) op.input(inputIndex++); + maxSummand = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + Tbias = op.attributes().getAttrType("Tbias"); + Tsummand = op.attributes().getAttrType("Tsummand"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java index 3dabec4356c..77d21ba9794 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,15 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -37,9 +42,11 @@ * number of the associated minimum, and the highest represents the maximum. * This means that you can only interpret the quantized output in the same way, by * taking the returned minimum and maximum values into account. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConv2d.OP_NAME, + inputsClass = QuantizedConv2d.Inputs.class +) @Operator( group = "nn" ) @@ -55,8 +62,8 @@ public final class QuantizedConv2d extends RawOp { private Output maxOutput; - private QuantizedConv2d(Operation operation) { - super(operation); + public QuantizedConv2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -67,13 +74,13 @@ private QuantizedConv2d(Operation operation) { * Factory method to create a class wrapping a new QuantizedConv2D operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param filter filter's input_depth dimension must match input's depth dimensions. * @param minInput The float value that the lowest quantized input value represents. * @param maxInput The float value that the highest quantized input value represents. * @param minFilter The float value that the lowest quantized filter value represents. * @param maxFilter The float value that the highest quantized filter value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param strides The stride of the sliding window for each dimension of the input * tensor. * @param padding The type of padding algorithm to use. @@ -141,7 +148,7 @@ public static Options dilations(List dilations) { * depth dimensions must be 1. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -211,4 +218,91 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedConv2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * filter's input_depth dimension must match input's depth dimensions. + */ + public final Operand filter; + + /** + * The float value that the lowest quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the highest quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the lowest quantized filter value represents. + */ + public final Operand minFilter; + + /** + * The float value that the highest quantized filter value represents. + */ + public final Operand maxFilter; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The Tfilter attribute + */ + public final DataType Tfilter; + + /** + * The outType attribute + */ + public final DataType outType; + + /** + * The stride of the sliding window for each dimension of the input + * tensor. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + /** + * 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new QuantizedConv2d<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java index 4c830ea0e04..3281b31698b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedDepthwiseConv2D.OP_NAME, + inputsClass = QuantizedDepthwiseConv2D.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedDepthwiseConv2D extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedDepthwiseConv2D extends RawOp { private Output maxOutput; - private QuantizedDepthwiseConv2D(Operation operation) { - super(operation); + public QuantizedDepthwiseConv2D(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -67,7 +78,7 @@ private QuantizedDepthwiseConv2D(Operation operation) { * @param maxFilter The float value that the maximum quantized filter value represents. * @param outType The type of the output. * @param strides List of stride values. - * @param padding the value of the padding property + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedDepthwiseConv2D} output and operands * @return a new instance of QuantizedDepthwiseConv2D @@ -124,7 +135,7 @@ public static Options dilations(List dilations) { * @param dilations List of dilation values. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -186,4 +197,86 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedDepthwiseConv2D.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The original filter tensor. + */ + public final Operand filter; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the minimum quantized filter value represents. + */ + public final Operand minFilter; + + /** + * The float value that the maximum quantized filter value represents. + */ + public final Operand maxFilter; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the filter. + */ + public final DataType Tfilter; + + /** + * The type of the output. + */ + public final DataType outType; + + /** + * List of stride values. + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * List of dilation values. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new QuantizedDepthwiseConv2D<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java index b408de31728..70314ace0b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBias.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBias.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedDepthwiseConv2DWithBias extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedDepthwiseConv2DWithBias extends R private Output maxOutput; - private QuantizedDepthwiseConv2DWithBias(Operation operation) { - super(operation); + public QuantizedDepthwiseConv2DWithBias(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -68,7 +79,7 @@ private QuantizedDepthwiseConv2DWithBias(Operation operation) { * @param maxFilter The float value that the maximum quantized filter value represents. * @param outType The type of the output. * @param strides List of stride values. - * @param padding the value of the padding property + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedDepthwiseConv2DWithBias} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBias @@ -126,7 +137,7 @@ public static Options dilations(List dilations) { * @param dilations List of dilation values. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -188,4 +199,92 @@ public Options dilations(Long... dilations) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedDepthwiseConv2DWithBias.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The original filter tensor. + */ + public final Operand filter; + + /** + * The original bias tensor. + */ + public final Operand bias; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the minimum quantized filter value represents. + */ + public final Operand minFilter; + + /** + * The float value that the maximum quantized filter value represents. + */ + public final Operand maxFilter; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the filter. + */ + public final DataType Tfilter; + + /** + * The type of the output. + */ + public final DataType outType; + + /** + * List of stride values. + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * List of dilation values. + */ + public final long[] dilations; + + public Inputs(GraphOperation op) { + super(new QuantizedDepthwiseConv2DWithBias<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java index 70d0b72d0d1..76b0917f709 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias and Relu. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBiasAndRelu.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBiasAndRelu.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedDepthwiseConv2DWithBiasAndRelu ex private Output maxOutput; - private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { - super(operation); + public QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -68,7 +79,7 @@ private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { * @param maxFilter The float value that the maximum quantized filter value represents. * @param outType The type of the output. * @param strides List of stride values. - * @param padding the value of the padding property + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndRelu} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndRelu @@ -133,7 +144,7 @@ public static Options dilations(List dilations) { * @param dilations List of dilation values. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -153,7 +164,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -239,4 +250,98 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedDepthwiseConv2DWithBiasAndRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The original filter tensor. + */ + public final Operand filter; + + /** + * The original bias tensor. + */ + public final Operand bias; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the minimum quantized filter value represents. + */ + public final Operand minFilter; + + /** + * The float value that the maximum quantized filter value represents. + */ + public final Operand maxFilter; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the filter. + */ + public final DataType Tfilter; + + /** + * The type of the output. + */ + public final DataType outType; + + /** + * List of stride values. + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * List of dilation values. + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedDepthwiseConv2DWithBiasAndRelu<>(op), op, Arrays.asList("Tinput", "Tfilter", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java index 42c8519fdac..55dfdecdb39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,22 +19,33 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias, Relu and Requantize. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.OP_NAME, + inputsClass = QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.Inputs.class +) +@Operator( + group = "nn" +) public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +58,8 @@ public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize maxOutput; - private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); + public QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -70,7 +81,7 @@ private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation * @param maxFreezedOutput The maximum float value of the output tensor. * @param outType The type of the output. * @param strides List of stride values. - * @param padding the value of the padding property + * @param padding The value of the padding attribute * @param options carries optional attribute values * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize @@ -138,7 +149,7 @@ public static Options dilations(List dilations) { * @param dilations List of dilation values. * @return this Options instance. */ - public static Options dilations(Long[] dilations) { + public static Options dilations(Long... dilations) { return new Options().dilations(dilations); } @@ -158,7 +169,7 @@ public static Options paddingList(List paddingList) { * @param paddingList the paddingList option * @return this Options instance. */ - public static Options paddingList(Long[] paddingList) { + public static Options paddingList(Long... paddingList) { return new Options().paddingList(paddingList); } @@ -244,4 +255,116 @@ public Options paddingList(Long... paddingList) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The original input tensor. + */ + public final Operand input; + + /** + * The original filter tensor. + */ + public final Operand filter; + + /** + * The original bias tensor. + */ + public final Operand bias; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand maxInput; + + /** + * The float value that the minimum quantized filter value represents. + */ + public final Operand minFilter; + + /** + * The float value that the maximum quantized filter value represents. + */ + public final Operand maxFilter; + + /** + * The minimum float value of the output tensor. + */ + public final Operand minFreezedOutput; + + /** + * The maximum float value of the output tensor. + */ + public final Operand maxFreezedOutput; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the filter. + */ + public final DataType Tfilter; + + /** + * The type of the bias. + */ + public final DataType Tbias; + + /** + * The type of the output. + */ + public final DataType outType; + + /** + * List of stride values. + */ + public final long[] strides; + + /** + * The padding attribute + */ + public final String padding; + + /** + * List of dilation values. + */ + public final long[] dilations; + + /** + * The paddingList attribute + */ + public final long[] paddingList; + + public Inputs(GraphOperation op) { + super(new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize<>(op), op, Arrays.asList("Tinput", "Tfilter", "Tbias", "out_type", "strides", "padding", "dilations", "padding_list")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + filter = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + minFilter = (Operand) op.input(inputIndex++); + maxFilter = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + Tfilter = op.attributes().getAttrType("Tfilter"); + Tbias = op.attributes().getAttrType("Tbias"); + outType = op.attributes().getAttrType("out_type"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + dilations = op.attributes().getAttrIntList("dilations"); + paddingList = op.attributes().getAttrIntList("padding_list"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java index 7c7ccfe2d62..48aedde6806 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Quantized Instance normalization. - * - * @param data type for {@code y} output */ +@OpMetadata( + opType = QuantizedInstanceNorm.OP_NAME, + inputsClass = QuantizedInstanceNorm.Inputs.class +) @Operator( group = "nn" ) @@ -48,8 +56,8 @@ public final class QuantizedInstanceNorm extends RawOp { private Output yMax; - private QuantizedInstanceNorm(Operation operation) { - super(operation); + public QuantizedInstanceNorm(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; y = operation.output(outputIdx++); yMin = operation.output(outputIdx++); @@ -251,4 +259,70 @@ public Options minSeparation(Float minSeparation) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedInstanceNorm.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A 4D input Tensor. + */ + public final Operand x; + + /** + * The value represented by the lowest quantized input. + */ + public final Operand xMin; + + /** + * The value represented by the highest quantized input. + */ + public final Operand xMax; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, {@code given_y_min} and {@code given_y_min} + * and {@code given_y_max} are used as the output range. Otherwise, + * the implementation computes the output range. + */ + public final boolean outputRangeGiven; + + /** + * Output in {@code y_min} if {@code output_range_given} is True. + */ + public final float givenYMin; + + /** + * Output in {@code y_max} if {@code output_range_given} is True. + */ + public final float givenYMax; + + /** + * A small float number to avoid dividing by 0. + */ + public final float varianceEpsilon; + + /** + * Minimum value of {@code y_max - y_min} + */ + public final float minSeparation; + + public Inputs(GraphOperation op) { + super(new QuantizedInstanceNorm<>(op), op, Arrays.asList("T", "output_range_given", "given_y_min", "given_y_max", "variance_epsilon", "min_separation")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + xMin = (Operand) op.input(inputIndex++); + xMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + outputRangeGiven = op.attributes().getAttrBool("output_range_given"); + givenYMin = op.attributes().getAttrFloat("given_y_min"); + givenYMax = op.attributes().getAttrFloat("given_y_max"); + varianceEpsilon = op.attributes().getAttrFloat("variance_epsilon"); + minSeparation = op.attributes().getAttrFloat("min_separation"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java index 9e31416dc48..e57d4e945b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Produces the max pool of the input tensor for quantized types. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedMaxPool.OP_NAME, + inputsClass = QuantizedMaxPool.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class QuantizedMaxPool extends RawOp { private Output maxOutput; - private QuantizedMaxPool(Operation operation) { - super(operation); + public QuantizedMaxPool(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); minOutput = operation.output(outputIdx++); @@ -122,4 +130,58 @@ public Output minOutput() { public Output maxOutput() { return maxOutput; } + + @OpInputsMetadata( + outputsClass = QuantizedMaxPool.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The 4D (batch x rows x cols x depth) Tensor to MaxReduce over. + */ + public final Operand input; + + /** + * The float value that the lowest quantized input value represents. + */ + public final Operand minInput; + + /** + * The float value that the highest quantized input value represents. + */ + public final Operand maxInput; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The size of the window for each dimension of the input tensor. + * The length must be 4 to match the number of dimensions of the input. + */ + public final long[] ksize; + + /** + * The stride of the sliding window for each dimension of the input + * tensor. The length must be 4 to match the number of dimensions of the input. + */ + public final long[] strides; + + /** + * The type of padding algorithm to use. + */ + public final String padding; + + public Inputs(GraphOperation op) { + super(new QuantizedMaxPool<>(op), op, Arrays.asList("T", "ksize", "strides", "padding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + minInput = (Operand) op.input(inputIndex++); + maxInput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + ksize = op.attributes().getAttrIntList("ksize"); + strides = op.attributes().getAttrIntList("strides"); + padding = op.attributes().getAttrString("padding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java index a8021cf2c53..ad55085ab6f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes Quantized Rectified Linear: {@code max(features, 0)} - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = QuantizedRelu.OP_NAME, + inputsClass = QuantizedRelu.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class QuantizedRelu extends RawOp { private Output maxActivations; - private QuantizedRelu(Operation operation) { - super(operation); + public QuantizedRelu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); minActivations = operation.output(outputIdx++); @@ -61,10 +69,10 @@ private QuantizedRelu(Operation operation) { * Factory method to create a class wrapping a new QuantizedRelu operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedRelu} output and operands * @return a new instance of QuantizedRelu */ @@ -108,4 +116,44 @@ public Output minActivations() { public Output maxActivations() { return maxActivations; } + + @OpInputsMetadata( + outputsClass = QuantizedRelu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The float value that the lowest quantized value represents. + */ + public final Operand minFeatures; + + /** + * The float value that the highest quantized value represents. + */ + public final Operand maxFeatures; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new QuantizedRelu<>(op), op, Arrays.asList("Tinput", "out_type")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + minFeatures = (Operand) op.input(inputIndex++); + maxFeatures = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java index 713f3e800c3..2b2f21a6b45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes Quantized Rectified Linear 6: {@code min(max(features, 0), 6)} - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = QuantizedRelu6.OP_NAME, + inputsClass = QuantizedRelu6.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class QuantizedRelu6 extends RawOp { private Output maxActivations; - private QuantizedRelu6(Operation operation) { - super(operation); + public QuantizedRelu6(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); minActivations = operation.output(outputIdx++); @@ -61,10 +69,10 @@ private QuantizedRelu6(Operation operation) { * Factory method to create a class wrapping a new QuantizedRelu6 operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedRelu6} output and operands * @return a new instance of QuantizedRelu6 */ @@ -108,4 +116,44 @@ public Output minActivations() { public Output maxActivations() { return maxActivations; } + + @OpInputsMetadata( + outputsClass = QuantizedRelu6.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The float value that the lowest quantized value represents. + */ + public final Operand minFeatures; + + /** + * The float value that the highest quantized value represents. + */ + public final Operand maxFeatures; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new QuantizedRelu6<>(op), op, Arrays.asList("Tinput", "out_type")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + minFeatures = (Operand) op.input(inputIndex++); + maxFeatures = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java index 199e22b049c..41daae389b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes Quantized Rectified Linear X: {@code min(max(features, 0), max_value)} - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = QuantizedReluX.OP_NAME, + inputsClass = QuantizedReluX.Inputs.class +) @Operator( group = "nn" ) @@ -49,8 +57,8 @@ public final class QuantizedReluX extends RawOp { private Output maxActivations; - private QuantizedReluX(Operation operation) { - super(operation); + public QuantizedReluX(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); minActivations = operation.output(outputIdx++); @@ -61,11 +69,11 @@ private QuantizedReluX(Operation operation) { * Factory method to create a class wrapping a new QuantizedReluX operation. * * @param scope current scope - * @param features the features value - * @param maxValue the maxValue value + * @param features The features value + * @param maxValue The maxValue value * @param minFeatures The float value that the lowest quantized value represents. * @param maxFeatures The float value that the highest quantized value represents. - * @param outType the value of the outType property + * @param outType The value of the outType attribute * @param data type for {@code QuantizedReluX} output and operands * @return a new instance of QuantizedReluX */ @@ -110,4 +118,50 @@ public Output minActivations() { public Output maxActivations() { return maxActivations; } + + @OpInputsMetadata( + outputsClass = QuantizedReluX.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The maxValue input + */ + public final Operand maxValue; + + /** + * The float value that the lowest quantized value represents. + */ + public final Operand minFeatures; + + /** + * The float value that the highest quantized value represents. + */ + public final Operand maxFeatures; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The outType attribute + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new QuantizedReluX<>(op), op, Arrays.asList("Tinput", "out_type")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + maxValue = (Operand) op.input(inputIndex++); + minFeatures = (Operand) op.input(inputIndex++); + maxFeatures = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java index cbf2f6c2278..126eb0c4c56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -39,9 +45,11 @@ * * * - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Relu.OP_NAME, + inputsClass = Relu.Inputs.class +) @Operator( group = "nn" ) @@ -53,8 +61,8 @@ public final class Relu extends RawOp implements Operand { private Output activations; - private Relu(Operation operation) { - super(operation); + public Relu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -63,7 +71,7 @@ private Relu(Operation operation) { * Factory method to create a class wrapping a new Relu operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Relu} output and operands * @return a new instance of Relu */ @@ -89,4 +97,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Relu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Relu<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java index 0e31636c3cf..5500229b21c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear 6: {@code min(max(features, 0), 6)}. - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Relu6.OP_NAME, + inputsClass = Relu6.Inputs.class +) @Operator( group = "nn" ) @@ -43,8 +51,8 @@ public final class Relu6 extends RawOp implements Operand private Output activations; - private Relu6(Operation operation) { - super(operation); + public Relu6(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Relu6(Operation operation) { * Factory method to create a class wrapping a new Relu6 operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Relu6} output and operands * @return a new instance of Relu6 */ @@ -79,4 +87,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Relu6.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Relu6<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java index 5ec8c04501c..9af8b816d87 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear 6 gradients for a Relu6 operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = Relu6Grad.OP_NAME, + inputsClass = Relu6Grad.Inputs.class +) +@Operator( + group = "nn" +) public final class Relu6Grad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class Relu6Grad extends RawOp implements Operand private Output backprops; - private Relu6Grad(Operation operation) { - super(operation); + public Relu6Grad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -80,4 +92,33 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = Relu6Grad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding Relu6 operation. + */ + public final Operand gradients; + + /** + * The features passed as input to the corresponding Relu6 operation, or + * its output; using either one produces the same result. + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Relu6Grad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java index 3e0eacee22d..b15132dd583 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear gradients for a Relu operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = ReluGrad.OP_NAME, + inputsClass = ReluGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class ReluGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class ReluGrad extends RawOp implements Operand< private Output backprops; - private ReluGrad(Operation operation) { - super(operation); + public ReluGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -79,4 +91,33 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = ReluGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding Relu operation. + */ + public final Operand gradients; + + /** + * The features passed as input to the corresponding Relu operation, OR + * the outputs of that operation (both work equivalently). + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ReluGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java index d05637ab93c..33d504105ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -34,9 +40,11 @@ * {@code initializer = tf.variance_scaling_initializer(factor=1.0, mode='FAN_IN')}. * For correct dropout, use {@code tf.contrib.nn.alpha_dropout}. *

      See Self-Normalizing Neural Networks - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Selu.OP_NAME, + inputsClass = Selu.Inputs.class +) @Operator( group = "nn" ) @@ -48,8 +56,8 @@ public final class Selu extends RawOp implements Operand { private Output activations; - private Selu(Operation operation) { - super(operation); + public Selu(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -58,7 +66,7 @@ private Selu(Operation operation) { * Factory method to create a class wrapping a new Selu operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Selu} output and operands * @return a new instance of Selu */ @@ -84,4 +92,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Selu.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Selu<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java index 5516e9bd369..bd2d2203f69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes gradients for the scaled exponential linear (Selu) operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = SeluGrad.OP_NAME, + inputsClass = SeluGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class SeluGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class SeluGrad extends RawOp implements Operand< private Output backprops; - private SeluGrad(Operation operation) { - super(operation); + public SeluGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -79,4 +91,32 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = SeluGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding Selu operation. + */ + public final Operand gradients; + + /** + * The outputs of the corresponding Selu operation. + */ + public final Operand outputs; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SeluGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + outputs = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java index 306bcc22794..dd6b9ecb2b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ *

        * $$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$
        * 
      - * - * @param data type for {@code softmax} output */ +@OpMetadata( + opType = Softmax.OP_NAME, + inputsClass = Softmax.Inputs.class +) @Operator( group = "nn" ) @@ -47,8 +55,8 @@ public final class Softmax extends RawOp implements Operand softmax; - private Softmax(Operation operation) { - super(operation); + public Softmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; softmax = operation.output(outputIdx++); } @@ -83,4 +91,26 @@ public Output softmax() { public Output asOutput() { return softmax; } + + @OpInputsMetadata( + outputsClass = Softmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D with shape {@code [batch_size, num_classes]}. + */ + public final Operand logits; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Softmax<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + logits = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java index d703a649978..a7836f24051 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes softmax cross entropy cost and gradients to backpropagate. * Inputs are the logits, not probabilities. - * - * @param data type for {@code loss} output */ +@OpMetadata( + opType = SoftmaxCrossEntropyWithLogits.OP_NAME, + inputsClass = SoftmaxCrossEntropyWithLogits.Inputs.class +) @Operator( group = "nn" ) @@ -46,8 +54,8 @@ public final class SoftmaxCrossEntropyWithLogits extends RawO private Output backprop; - private SoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); + public SoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; loss = operation.output(outputIdx++); backprop = operation.output(outputIdx++); @@ -92,4 +100,34 @@ public Output loss() { public Output backprop() { return backprop; } + + @OpInputsMetadata( + outputsClass = SoftmaxCrossEntropyWithLogits.class + ) + public static class Inputs extends RawOpInputs> { + /** + * batch_size x num_classes matrix + */ + public final Operand features; + + /** + * batch_size x num_classes matrix + * The caller must ensure that each batch of labels represents a valid + * probability distribution. + */ + public final Operand labels; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SoftmaxCrossEntropyWithLogits<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + labels = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java index 67fa8f4211a..1144c4c21be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes softsign: {@code features / (abs(features) + 1)}. - * - * @param data type for {@code activations} output */ +@OpMetadata( + opType = Softsign.OP_NAME, + inputsClass = Softsign.Inputs.class +) @Operator( group = "nn" ) @@ -43,8 +51,8 @@ public final class Softsign extends RawOp implements Operand< private Output activations; - private Softsign(Operation operation) { - super(operation); + public Softsign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; activations = operation.output(outputIdx++); } @@ -53,7 +61,7 @@ private Softsign(Operation operation) { * Factory method to create a class wrapping a new Softsign operation. * * @param scope current scope - * @param features the features value + * @param features The features value * @param data type for {@code Softsign} output and operands * @return a new instance of Softsign */ @@ -79,4 +87,26 @@ public Output activations() { public Output asOutput() { return activations; } + + @OpInputsMetadata( + outputsClass = Softsign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The features input + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new Softsign<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java index c73893bd640..3ebe407b08e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes softsign gradients for a softsign operation. - * - * @param data type for {@code backprops} output */ +@OpMetadata( + opType = SoftsignGrad.OP_NAME, + inputsClass = SoftsignGrad.Inputs.class +) +@Operator( + group = "nn" +) public final class SoftsignGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class SoftsignGrad extends RawOp implements Oper private Output backprops; - private SoftsignGrad(Operation operation) { - super(operation); + public SoftsignGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -78,4 +90,32 @@ public Output backprops() { public Output asOutput() { return backprops; } + + @OpInputsMetadata( + outputsClass = SoftsignGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The backpropagated gradients to the corresponding softsign operation. + */ + public final Operand gradients; + + /** + * The features passed as input to the corresponding softsign operation. + */ + public final Operand features; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SoftsignGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + features = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java index 66ac883c8a6..e35f65ee574 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -94,9 +100,11 @@ * *

      Among others, this operation is useful for reducing atrous convolution into * regular convolution. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SpaceToBatch.OP_NAME, + inputsClass = SpaceToBatch.Inputs.class +) @Operator( group = "nn" ) @@ -108,8 +116,8 @@ public final class SpaceToBatch extends RawOp implements Operan private Output output; - private SpaceToBatch(Operation operation) { - super(operation); + public SpaceToBatch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -129,7 +137,7 @@ private SpaceToBatch(Operation operation) { * height_pad = pad_top + height + pad_bottom * width_pad = pad_left + width + pad_right * - * @param blockSize the value of the blockSize property + * @param blockSize The value of the blockSize attribute * @param data type for {@code SpaceToBatch} output and operands * @return a new instance of SpaceToBatch */ @@ -158,4 +166,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SpaceToBatch.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 4-D with shape {@code [batch, height, width, depth]}. + */ + public final Operand input; + + /** + * 2-D tensor of non-negative integers with shape {@code [2, 2]}. It specifies + * the padding of the input with zeros across the spatial dimensions as follows: + *

      +     *   paddings = [[pad_top, pad_bottom], [pad_left, pad_right]]
      +     * 
      + *

      The effective spatial dimensions of the zero-padded input tensor will be: + *

      +     *   height_pad = pad_top + height + pad_bottom
      +     *   width_pad = pad_left + width + pad_right
      +     * 
      + */ + public final Operand paddings; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tpaddings attribute + */ + public final DataType Tpaddings; + + /** + * The blockSize attribute + */ + public final long blockSize; + + public Inputs(GraphOperation op) { + super(new SpaceToBatch<>(op), op, Arrays.asList("T", "Tpaddings", "block_size")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + paddings = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tpaddings = op.attributes().getAttrType("Tpaddings"); + blockSize = op.attributes().getAttrInt("block_size"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java index 2c15ddacb58..aaaddf55663 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -97,9 +103,11 @@ * [[9, 10, 11, 12], * [13, 14, 15, 16]]]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SpaceToDepth.OP_NAME, + inputsClass = SpaceToDepth.Inputs.class +) @Operator( group = "nn" ) @@ -111,8 +119,8 @@ public final class SpaceToDepth extends RawOp implements Operan private Output output; - private SpaceToDepth(Operation operation) { - super(operation); + public SpaceToDepth(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -121,7 +129,7 @@ private SpaceToDepth(Operation operation) { * Factory method to create a class wrapping a new SpaceToDepth operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param blockSize The size of the spatial block. * @param options carries optional attribute values * @param data type for {@code SpaceToDepth} output and operands @@ -189,4 +197,38 @@ public Options dataFormat(String dataFormat) { return this; } } + + @OpInputsMetadata( + outputsClass = SpaceToDepth.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The size of the spatial block. + */ + public final long blockSize; + + /** + * The dataFormat attribute + */ + public final String dataFormat; + + public Inputs(GraphOperation op) { + super(new SpaceToDepth<>(op), op, Arrays.asList("T", "block_size", "data_format")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + blockSize = op.attributes().getAttrInt("block_size"); + dataFormat = op.attributes().getAttrString("data_format"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java index 399274a39d7..1b7c99a694e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -34,9 +40,11 @@ * of features. This label is considered to have probability 1.0 for the * given row. *

      Inputs are the logits, not probabilities. - * - * @param data type for {@code loss} output */ +@OpMetadata( + opType = SparseSoftmaxCrossEntropyWithLogits.OP_NAME, + inputsClass = SparseSoftmaxCrossEntropyWithLogits.Inputs.class +) @Operator( group = "nn" ) @@ -50,8 +58,8 @@ public final class SparseSoftmaxCrossEntropyWithLogits extend private Output backprop; - private SparseSoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); + public SparseSoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; loss = operation.output(outputIdx++); backprop = operation.output(outputIdx++); @@ -95,4 +103,39 @@ public Output loss() { public Output backprop() { return backprop; } + + @OpInputsMetadata( + outputsClass = SparseSoftmaxCrossEntropyWithLogits.class + ) + public static class Inputs extends RawOpInputs> { + /** + * batch_size x num_classes matrix + */ + public final Operand features; + + /** + * batch_size vector with values in [0, num_classes). + * This is the label for the given minibatch entry. + */ + public final Operand labels; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tlabels attribute + */ + public final DataType Tlabels; + + public Inputs(GraphOperation op) { + super(new SparseSoftmaxCrossEntropyWithLogits<>(op), op, Arrays.asList("T", "Tlabels")); + int inputIndex = 0; + features = (Operand) op.input(inputIndex++); + labels = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tlabels = op.attributes().getAttrType("Tlabels"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java index f7ecda41e2c..5185b5fd785 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.nn; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -39,13 +46,15 @@ * values.shape = indices.shape = input.shape[:-1] + [k] * *

      If two elements are equal, the lower-index element appears first. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = TopK.OP_NAME, + inputsClass = TopK.Inputs.class +) @Operator( group = "nn" ) -public final class TopK extends RawOp { +public final class TopK extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ @@ -53,10 +62,10 @@ public final class TopK extends RawOp { private Output values; - private Output indices; + private Output indices; - private TopK(Operation operation) { - super(operation); + public TopK(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; values = operation.output(outputIdx++); indices = operation.output(outputIdx++); @@ -69,18 +78,21 @@ private TopK(Operation operation) { * @param input 1-D or higher with last dimension at least {@code k}. * @param k 0-D. Number of top elements to look for along the last dimension (along each * row for matrices). + * @param indexType The value of the indexType attribute * @param options carries optional attribute values * @param data type for {@code TopKV2} output and operands + * @param data type for {@code TopKV2} output and operands * @return a new instance of TopK */ @Endpoint( describeByClass = true ) - public static TopK create(Scope scope, Operand input, Operand k, - Options... options) { + public static TopK create(Scope scope, + Operand input, Operand k, Class indexType, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TopK"); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); + opBuilder.setAttr("index_type", Operands.toDataType(indexType)); if (options != null) { for (Options opts : options) { if (opts.sorted != null) { @@ -91,6 +103,25 @@ public static TopK create(Scope scope, Operand input, return new TopK<>(opBuilder.build()); } + /** + * Factory method to create a class wrapping a new TopKV2 operation, with the default output types. + * + * @param scope current scope + * @param input 1-D or higher with last dimension at least {@code k}. + * @param k 0-D. Number of top elements to look for along the last dimension (along each + * row for matrices). + * @param options carries optional attribute values + * @param data type for {@code TopKV2} output and operands + * @return a new instance of TopK, with default output types + */ + @Endpoint( + describeByClass = true + ) + public static TopK create(Scope scope, Operand input, + Operand k, Options... options) { + return create(scope, input, k, TInt32.class, options); + } + /** * Sets the sorted option. * @@ -116,7 +147,7 @@ public Output values() { * The indices of {@code values} within the last dimension of {@code input}. * @return indices. */ - public Output indices() { + public Output indices() { return indices; } @@ -141,4 +172,52 @@ public Options sorted(Boolean sorted) { return this; } } + + @OpInputsMetadata( + outputsClass = TopK.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D or higher with last dimension at least {@code k}. + */ + public final Operand input; + + /** + * 0-D. Number of top elements to look for along the last dimension (along each + * row for matrices). + */ + public final Operand k; + + /** + * If true the resulting {@code k} elements will be sorted by the values in + * descending order. + */ + public final boolean sorted; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tk attribute + */ + public final DataType Tk; + + /** + * The indexType attribute + */ + public final DataType indexType; + + public Inputs(GraphOperation op) { + super(new TopK<>(op), op, Arrays.asList("sorted", "T", "Tk", "index_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + k = (Operand) op.input(inputIndex++); + sorted = op.attributes().getAttrBool("sorted"); + T = op.attributes().getAttrType("T"); + Tk = op.attributes().getAttrType("Tk"); + indexType = op.attributes().getAttrType("index_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolution.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolution.java new file mode 100644 index 00000000000..124c2b062f0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolution.java @@ -0,0 +1,838 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform quantized convolution of quantized Tensor {@code lhs} and quantized Tensor {@code rhs}. to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized dot on {@code lhs} and {@code rhs} to make quantized {@code output}. + *

      {@code lhs} and {@code rhs} must be Tensors of same rank, and meet following shape conditions. + *

        + *
      • {@code lhs_feature} % {@code feature_group_count} == 0
      • + *
      • {@code lhs_feature} % {@code rhs_input_feature} == 0
      • + *
      • {@code lhs_feature} / {@code feature_group_count} == {@code rhs_input_feature}
      • + *
      • {@code rhs_output_feature} % {@code feature_group_count} == 0
      • + *
      • {@code lhs_batch} % {@code batch_group_count} == 0
      • + *
      • {@code rhs_output_feature} % {@code batch_group_count} == 0
      • + *
      + *

      {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + *

      + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val)
      + * 
      + *

      {@code output} is also quantized, using the same formula. + * If {@code rhs} is per-tensor quantized, {@code output} must be also per-tensor quantized. + */ +@OpMetadata( + opType = UniformQuantizedConvolution.OP_NAME, + inputsClass = UniformQuantizedConvolution.Inputs.class +) +@Operator( + group = "nn" +) +public final class UniformQuantizedConvolution extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedConvolution"; + + private Output output; + + public UniformQuantizedConvolution(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedConvolution operation. + * + * @param scope current scope + * @param lhs Must be a quantized tensor, rank >= 3. + * @param rhs Must be a quantized tensor, same rank as {@code lhs}. + * @param lhsScales The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + * Must be a scalar {@code Tensor} ({@code lhs} supports only per-tensor quantization). + * @param lhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Same shape condition as {@code lhs_scales}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + * @param rhsZeroPoints The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + * @param outputScales The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)} + *

        + *
      • which is equal to {@code output.dim_size(output_feature_dimension)}, + * for per-channel quantization. + * If {@code rhs} is per-tensor quantized, output must be also per-tensor quantized. + * This means that if {@code rhs_scales} and {@code rhs_zero_points} are scalar {@code Tensor}s, {@code output_scales} and {@code output_zero_points} must be scalar {@code Tensor}s as well.
      • + *
      + * @param outputZeroPoints The int32 value(s) used as zero points when quantizing original data that output represents. + * Same shape condition as {@code output_scales}. + * @param Tout The type of {@code output} {@code Tensor}. + * @param padding string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + * @param lhsQuantizationMinVal The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedConvolution} output and operands + * @param data type for {@code UniformQuantizedConvolution} output and operands + * @return a new instance of UniformQuantizedConvolution + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedConvolution create( + Scope scope, Operand lhs, Operand rhs, Operand lhsScales, + Operand lhsZeroPoints, Operand rhsScales, Operand rhsZeroPoints, + Operand outputScales, Operand outputZeroPoints, Class Tout, + String padding, Long lhsQuantizationMinVal, Long lhsQuantizationMaxVal, + Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, Long outputQuantizationMinVal, + Long outputQuantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedConvolution"); + opBuilder.addInput(lhs.asOutput()); + opBuilder.addInput(rhs.asOutput()); + opBuilder.addInput(lhsScales.asOutput()); + opBuilder.addInput(lhsZeroPoints.asOutput()); + opBuilder.addInput(rhsScales.asOutput()); + opBuilder.addInput(rhsZeroPoints.asOutput()); + opBuilder.addInput(outputScales.asOutput()); + opBuilder.addInput(outputZeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("padding", padding); + opBuilder.setAttr("lhs_quantization_min_val", lhsQuantizationMinVal); + opBuilder.setAttr("lhs_quantization_max_val", lhsQuantizationMaxVal); + opBuilder.setAttr("rhs_quantization_min_val", rhsQuantizationMinVal); + opBuilder.setAttr("rhs_quantization_max_val", rhsQuantizationMaxVal); + opBuilder.setAttr("output_quantization_min_val", outputQuantizationMinVal); + opBuilder.setAttr("output_quantization_max_val", outputQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.windowStrides != null) { + long[] windowStridesArray = new long[opts.windowStrides.size()]; + for (int i = 0 ; i < windowStridesArray.length ; i++) { + windowStridesArray[i] = opts.windowStrides.get(i); + } + opBuilder.setAttr("window_strides", windowStridesArray); + } + if (opts.explicitPadding != null) { + long[] explicitPaddingArray = new long[opts.explicitPadding.size()]; + for (int i = 0 ; i < explicitPaddingArray.length ; i++) { + explicitPaddingArray[i] = opts.explicitPadding.get(i); + } + opBuilder.setAttr("explicit_padding", explicitPaddingArray); + } + if (opts.lhsDilation != null) { + long[] lhsDilationArray = new long[opts.lhsDilation.size()]; + for (int i = 0 ; i < lhsDilationArray.length ; i++) { + lhsDilationArray[i] = opts.lhsDilation.get(i); + } + opBuilder.setAttr("lhs_dilation", lhsDilationArray); + } + if (opts.rhsDilation != null) { + long[] rhsDilationArray = new long[opts.rhsDilation.size()]; + for (int i = 0 ; i < rhsDilationArray.length ; i++) { + rhsDilationArray[i] = opts.rhsDilation.get(i); + } + opBuilder.setAttr("rhs_dilation", rhsDilationArray); + } + if (opts.batchGroupCount != null) { + opBuilder.setAttr("batch_group_count", opts.batchGroupCount); + } + if (opts.featureGroupCount != null) { + opBuilder.setAttr("feature_group_count", opts.featureGroupCount); + } + if (opts.dimensionNumbers != null) { + opBuilder.setAttr("dimension_numbers", opts.dimensionNumbers); + } + if (opts.lhsQuantizationAxis != null) { + opBuilder.setAttr("lhs_quantization_axis", opts.lhsQuantizationAxis); + } + if (opts.rhsQuantizationAxis != null) { + opBuilder.setAttr("rhs_quantization_axis", opts.rhsQuantizationAxis); + } + if (opts.outputQuantizationAxis != null) { + opBuilder.setAttr("output_quantization_axis", opts.outputQuantizationAxis); + } + } + } + return new UniformQuantizedConvolution<>(opBuilder.build()); + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options windowStrides(List windowStrides) { + return new Options().windowStrides(windowStrides); + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options windowStrides(Long... windowStrides) { + return new Options().windowStrides(windowStrides); + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each {@code lhs} spatial dimension. + * Otherwise, this must be empty. + *

      (If used,) Must be a list of size {@code 2 * (number of lhs spatial dimensions)}, + * where {@code (explicit_padding[2 * i], explicit_padding[2 * i + 1])} indicates + * {@code (start_padding, end_padding)} of {@code spatial_dimensions[i]}. + * @return this Options instance. + */ + public static Options explicitPadding(List explicitPadding) { + return new Options().explicitPadding(explicitPadding); + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each {@code lhs} spatial dimension. + * Otherwise, this must be empty. + *

      (If used,) Must be a list of size {@code 2 * (number of lhs spatial dimensions)}, + * where {@code (explicit_padding[2 * i], explicit_padding[2 * i + 1])} indicates + * {@code (start_padding, end_padding)} of {@code spatial_dimensions[i]}. + * @return this Options instance. + */ + public static Options explicitPadding(Long... explicitPadding) { + return new Options().explicitPadding(explicitPadding); + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of {@code lhs} spatial dimensions). + * If empty list, the dilation for each {@code lhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options lhsDilation(List lhsDilation) { + return new Options().lhsDilation(lhsDilation); + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of {@code lhs} spatial dimensions). + * If empty list, the dilation for each {@code lhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options lhsDilation(Long... lhsDilation) { + return new Options().lhsDilation(lhsDilation); + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of {@code rhs} spatial dimensions). + * If empty list, the dilation for each {@code rhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options rhsDilation(List rhsDilation) { + return new Options().rhsDilation(rhsDilation); + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of {@code rhs} spatial dimensions). + * If empty list, the dilation for each {@code rhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options rhsDilation(Long... rhsDilation) { + return new Options().rhsDilation(rhsDilation); + } + + /** + * Sets the batchGroupCount option. + * + * @param batchGroupCount The number of batch groups. Used for grouped filters. + * Must be a divisor of {@code output_feature}. + * @return this Options instance. + */ + public static Options batchGroupCount(Long batchGroupCount) { + return new Options().batchGroupCount(batchGroupCount); + } + + /** + * Sets the featureGroupCount option. + * + * @param featureGroupCount The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both {@code lhs_feature} and {@code output_feature}. + * @return this Options instance. + */ + public static Options featureGroupCount(Long featureGroupCount) { + return new Options().featureGroupCount(featureGroupCount); + } + + /** + * Sets the dimensionNumbers option. + * + * @param dimensionNumbers Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of {@code tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr} proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + * @return this Options instance. + */ + public static Options dimensionNumbers(String dimensionNumbers) { + return new Options().dimensionNumbers(dimensionNumbers); + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + return new Options().lhsQuantizationAxis(lhsQuantizationAxis); + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + return new Options().rhsQuantizationAxis(rhsQuantizationAxis); + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options outputQuantizationAxis(Long outputQuantizationAxis) { + return new Options().outputQuantizationAxis(outputQuantizationAxis); + } + + /** + * Gets output. + * The output quantized tensor of {@code Tout}, same rank as {@code lhs} and {@code rhs}. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.nn.UniformQuantizedConvolution} + */ + public static class Options { + private List windowStrides; + + private List explicitPadding; + + private List lhsDilation; + + private List rhsDilation; + + private Long batchGroupCount; + + private Long featureGroupCount; + + private String dimensionNumbers; + + private Long lhsQuantizationAxis; + + private Long rhsQuantizationAxis; + + private Long outputQuantizationAxis; + + private Options() { + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public Options windowStrides(List windowStrides) { + this.windowStrides = windowStrides; + return this; + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public Options windowStrides(Long... windowStrides) { + this.windowStrides = Arrays.asList(windowStrides); + return this; + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each {@code lhs} spatial dimension. + * Otherwise, this must be empty. + *

      (If used,) Must be a list of size {@code 2 * (number of lhs spatial dimensions)}, + * where {@code (explicit_padding[2 * i], explicit_padding[2 * i + 1])} indicates + * {@code (start_padding, end_padding)} of {@code spatial_dimensions[i]}. + * @return this Options instance. + */ + public Options explicitPadding(List explicitPadding) { + this.explicitPadding = explicitPadding; + return this; + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each {@code lhs} spatial dimension. + * Otherwise, this must be empty. + *

      (If used,) Must be a list of size {@code 2 * (number of lhs spatial dimensions)}, + * where {@code (explicit_padding[2 * i], explicit_padding[2 * i + 1])} indicates + * {@code (start_padding, end_padding)} of {@code spatial_dimensions[i]}. + * @return this Options instance. + */ + public Options explicitPadding(Long... explicitPadding) { + this.explicitPadding = Arrays.asList(explicitPadding); + return this; + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of {@code lhs} spatial dimensions). + * If empty list, the dilation for each {@code lhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public Options lhsDilation(List lhsDilation) { + this.lhsDilation = lhsDilation; + return this; + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of {@code lhs} spatial dimensions). + * If empty list, the dilation for each {@code lhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public Options lhsDilation(Long... lhsDilation) { + this.lhsDilation = Arrays.asList(lhsDilation); + return this; + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of {@code rhs} spatial dimensions). + * If empty list, the dilation for each {@code rhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public Options rhsDilation(List rhsDilation) { + this.rhsDilation = rhsDilation; + return this; + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of {@code rhs} spatial dimensions). + * If empty list, the dilation for each {@code rhs} spatial dimension is set to 1. + * @return this Options instance. + */ + public Options rhsDilation(Long... rhsDilation) { + this.rhsDilation = Arrays.asList(rhsDilation); + return this; + } + + /** + * Sets the batchGroupCount option. + * + * @param batchGroupCount The number of batch groups. Used for grouped filters. + * Must be a divisor of {@code output_feature}. + * @return this Options instance. + */ + public Options batchGroupCount(Long batchGroupCount) { + this.batchGroupCount = batchGroupCount; + return this; + } + + /** + * Sets the featureGroupCount option. + * + * @param featureGroupCount The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both {@code lhs_feature} and {@code output_feature}. + * @return this Options instance. + */ + public Options featureGroupCount(Long featureGroupCount) { + this.featureGroupCount = featureGroupCount; + return this; + } + + /** + * Sets the dimensionNumbers option. + * + * @param dimensionNumbers Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of {@code tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr} proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + * @return this Options instance. + */ + public Options dimensionNumbers(String dimensionNumbers) { + this.dimensionNumbers = dimensionNumbers; + return this; + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + this.lhsQuantizationAxis = lhsQuantizationAxis; + return this; + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + this.rhsQuantizationAxis = rhsQuantizationAxis; + return this; + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options outputQuantizationAxis(Long outputQuantizationAxis) { + this.outputQuantizationAxis = outputQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedConvolution.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a quantized tensor, rank >= 3. + */ + public final Operand lhs; + + /** + * Must be a quantized tensor, same rank as {@code lhs}. + */ + public final Operand rhs; + + /** + * The float value(s) used as scale factors when quantizing the original data that {@code lhs} represents. + * Must be a scalar {@code Tensor} ({@code lhs} supports only per-tensor quantization). + */ + public final Operand lhsScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that {@code lhs} represents. + * Same shape condition as {@code lhs_scales}. + */ + public final Operand lhsZeroPoints; + + /** + * The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + */ + public final Operand rhsScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + */ + public final Operand rhsZeroPoints; + + /** + * The float value(s) to use as scale factors when quantizing original data that {@code output} represents. + * Must be a scalar {@code Tensor} for per-tensor quantization, + * or 1D {@code Tensor} of size {@code rhs.dim_size(kernel_output_feature_dimension)} + *

        + *
      • which is equal to {@code output.dim_size(output_feature_dimension)}, + * for per-channel quantization. + * If {@code rhs} is per-tensor quantized, output must be also per-tensor quantized. + * This means that if {@code rhs_scales} and {@code rhs_zero_points} are scalar {@code Tensor}s, {@code output_scales} and {@code output_zero_points} must be scalar {@code Tensor}s as well.
      • + *
      + */ + public final Operand outputScales; + + /** + * The int32 value(s) used as zero points when quantizing original data that output represents. + * Same shape condition as {@code output_scales}. + */ + public final Operand outputZeroPoints; + + /** + * The type of {@code lhs} and {@code rhs} input {@code Tensor}. + */ + public final DataType Tin; + + /** + * The type of {@code output} {@code Tensor}. + */ + public final DataType Tout; + + /** + * The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + */ + public final long[] windowStrides; + + /** + * string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each {@code lhs} spatial dimension. + * Otherwise, this must be empty. + *

      (If used,) Must be a list of size {@code 2 * (number of lhs spatial dimensions)}, + * where {@code (explicit_padding[2 * i], explicit_padding[2 * i + 1])} indicates + * {@code (start_padding, end_padding)} of {@code spatial_dimensions[i]}. + */ + public final long[] explicitPadding; + + /** + * The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of {@code lhs} spatial dimensions). + * If empty list, the dilation for each {@code lhs} spatial dimension is set to 1. + */ + public final long[] lhsDilation; + + /** + * The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of {@code rhs} spatial dimensions). + * If empty list, the dilation for each {@code rhs} spatial dimension is set to 1. + */ + public final long[] rhsDilation; + + /** + * The number of batch groups. Used for grouped filters. + * Must be a divisor of {@code output_feature}. + */ + public final long batchGroupCount; + + /** + * The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both {@code lhs_feature} and {@code output_feature}. + */ + public final long featureGroupCount; + + /** + * Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of {@code tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr} proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + */ + public final String dimensionNumbers; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code lhs}, only per-tensor quantization is supported. + * Thus, this must be set to -1. + * Other values will raise error at OpKernel construction. + */ + public final long lhsQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long lhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code lhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + */ + public final long lhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along {@code kernel_output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + */ + public final long rhsQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long rhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Tin} is {@code qint8}, this must be set to 127. + */ + public final long rhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code output}, only per-tensor quantization or per-channel quantization along {@code output_feature_dimension} is supported. + * Thus, this must be set to -1 or {@code dimension_numbers.output_feature_dimension}. + * Other values will raise error at OpKernel construction. + */ + public final long outputQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long outputQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code output}. + * For example, if {@code Tout} is {@code qint8}, this must be set to 127. + */ + public final long outputQuantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedConvolution<>(op), op, Arrays.asList("Tin", "Tout", "window_strides", "padding", "explicit_padding", "lhs_dilation", "rhs_dilation", "batch_group_count", "feature_group_count", "dimension_numbers", "lhs_quantization_axis", "lhs_quantization_min_val", "lhs_quantization_max_val", "rhs_quantization_axis", "rhs_quantization_min_val", "rhs_quantization_max_val", "output_quantization_axis", "output_quantization_min_val", "output_quantization_max_val")); + int inputIndex = 0; + lhs = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lhsScales = (Operand) op.input(inputIndex++); + lhsZeroPoints = (Operand) op.input(inputIndex++); + rhsScales = (Operand) op.input(inputIndex++); + rhsZeroPoints = (Operand) op.input(inputIndex++); + outputScales = (Operand) op.input(inputIndex++); + outputZeroPoints = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + windowStrides = op.attributes().getAttrIntList("window_strides"); + padding = op.attributes().getAttrString("padding"); + explicitPadding = op.attributes().getAttrIntList("explicit_padding"); + lhsDilation = op.attributes().getAttrIntList("lhs_dilation"); + rhsDilation = op.attributes().getAttrIntList("rhs_dilation"); + batchGroupCount = op.attributes().getAttrInt("batch_group_count"); + featureGroupCount = op.attributes().getAttrInt("feature_group_count"); + dimensionNumbers = op.attributes().getAttrString("dimension_numbers"); + lhsQuantizationAxis = op.attributes().getAttrInt("lhs_quantization_axis"); + lhsQuantizationMinVal = op.attributes().getAttrInt("lhs_quantization_min_val"); + lhsQuantizationMaxVal = op.attributes().getAttrInt("lhs_quantization_max_val"); + rhsQuantizationAxis = op.attributes().getAttrInt("rhs_quantization_axis"); + rhsQuantizationMinVal = op.attributes().getAttrInt("rhs_quantization_min_val"); + rhsQuantizationMaxVal = op.attributes().getAttrInt("rhs_quantization_max_val"); + outputQuantizationAxis = op.attributes().getAttrInt("output_quantization_axis"); + outputQuantizationMinVal = op.attributes().getAttrInt("output_quantization_min_val"); + outputQuantizationMaxVal = op.attributes().getAttrInt("output_quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolutionHybrid.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolutionHybrid.java new file mode 100644 index 00000000000..8510272759e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/UniformQuantizedConvolutionHybrid.java @@ -0,0 +1,659 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform hybrid quantized convolution of float Tensor {@code lhs} and quantized Tensor {@code rhs}. + * Given float {@code lhs} and quantized {@code rhs}, internally performs quantization on {@code lhs}, + * and then performs quantized convolution on quantized {@code lhs} and {@code rhs}. + *

      The internal quantization on {@code lhs} is a quantization to {@code Trhs}, dynamic range, + * per-batch (per-axis along axis {@code dimension_numbers.input_batch_dimension}), asymmetric, + * and not narrow range (the range is [Trhs_MIN, Trhs_MAX]). + *

      {@code lhs} and {@code rhs} must be Tensors of same rank, and meet following shape conditions. + *

        + *
      • lhs_feature % feature_group_count == 0
      • + *
      • lhs_feature % rhs_input_feature == 0
      • + *
      • lhs_feature / feature_group_count == rhs_input_feature
      • + *
      • rhs_output_feature % feature_group_count == 0
      • + *
      • lhs_batch % batch_group_count == 0
      • + *
      • rhs_output_feature % batch_group_count == 0
      • + *
      + *

      {@code rhs} must be quantized Tensor, where its data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + */ +@OpMetadata( + opType = UniformQuantizedConvolutionHybrid.OP_NAME, + inputsClass = UniformQuantizedConvolutionHybrid.Inputs.class +) +@Operator( + group = "nn" +) +public final class UniformQuantizedConvolutionHybrid extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedConvolutionHybrid"; + + private Output output; + + public UniformQuantizedConvolutionHybrid(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedConvolutionHybrid operation. + * + * @param scope current scope + * @param lhs Must be a non-quantized Tensor of {@code Tlhs}, rank >= 3. + * @param rhs Must be a quantized Tensor of {@code Trhs}, same rank as {@code lhs}. + * @param rhsScales The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar Tensor for per-tensor quantization, + * or 1D Tensor of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + * @param Tout The type of output Tensor. + * @param padding string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + * @param rhsQuantizationMinVal The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedConvolutionHybrid} output and operands + * @return a new instance of UniformQuantizedConvolutionHybrid + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedConvolutionHybrid create(Scope scope, + Operand lhs, Operand rhs, Operand rhsScales, + Operand rhsZeroPoints, Class Tout, String padding, Long rhsQuantizationMinVal, + Long rhsQuantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedConvolutionHybrid"); + opBuilder.addInput(lhs.asOutput()); + opBuilder.addInput(rhs.asOutput()); + opBuilder.addInput(rhsScales.asOutput()); + opBuilder.addInput(rhsZeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("padding", padding); + opBuilder.setAttr("rhs_quantization_min_val", rhsQuantizationMinVal); + opBuilder.setAttr("rhs_quantization_max_val", rhsQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.windowStrides != null) { + long[] windowStridesArray = new long[opts.windowStrides.size()]; + for (int i = 0 ; i < windowStridesArray.length ; i++) { + windowStridesArray[i] = opts.windowStrides.get(i); + } + opBuilder.setAttr("window_strides", windowStridesArray); + } + if (opts.explicitPadding != null) { + long[] explicitPaddingArray = new long[opts.explicitPadding.size()]; + for (int i = 0 ; i < explicitPaddingArray.length ; i++) { + explicitPaddingArray[i] = opts.explicitPadding.get(i); + } + opBuilder.setAttr("explicit_padding", explicitPaddingArray); + } + if (opts.lhsDilation != null) { + long[] lhsDilationArray = new long[opts.lhsDilation.size()]; + for (int i = 0 ; i < lhsDilationArray.length ; i++) { + lhsDilationArray[i] = opts.lhsDilation.get(i); + } + opBuilder.setAttr("lhs_dilation", lhsDilationArray); + } + if (opts.rhsDilation != null) { + long[] rhsDilationArray = new long[opts.rhsDilation.size()]; + for (int i = 0 ; i < rhsDilationArray.length ; i++) { + rhsDilationArray[i] = opts.rhsDilation.get(i); + } + opBuilder.setAttr("rhs_dilation", rhsDilationArray); + } + if (opts.batchGroupCount != null) { + opBuilder.setAttr("batch_group_count", opts.batchGroupCount); + } + if (opts.featureGroupCount != null) { + opBuilder.setAttr("feature_group_count", opts.featureGroupCount); + } + if (opts.dimensionNumbers != null) { + opBuilder.setAttr("dimension_numbers", opts.dimensionNumbers); + } + if (opts.rhsQuantizationAxis != null) { + opBuilder.setAttr("rhs_quantization_axis", opts.rhsQuantizationAxis); + } + } + } + return new UniformQuantizedConvolutionHybrid<>(opBuilder.build()); + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options windowStrides(List windowStrides) { + return new Options().windowStrides(windowStrides); + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options windowStrides(Long... windowStrides) { + return new Options().windowStrides(windowStrides); + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} Attr is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each lhs spatial dimension. + * Otherwise, this Attr is must be empty. + *

      (If used,) Must be a list of size 2 * (number of lhs spatial dimensions), + * where (explicit_padding[2 * i], explicit_padding[2 * i + 1]) indicates + * spatial_dimensions[i] (start_padding, end_padding). + * @return this Options instance. + */ + public static Options explicitPadding(List explicitPadding) { + return new Options().explicitPadding(explicitPadding); + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} Attr is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each lhs spatial dimension. + * Otherwise, this Attr is must be empty. + *

      (If used,) Must be a list of size 2 * (number of lhs spatial dimensions), + * where (explicit_padding[2 * i], explicit_padding[2 * i + 1]) indicates + * spatial_dimensions[i] (start_padding, end_padding). + * @return this Options instance. + */ + public static Options explicitPadding(Long... explicitPadding) { + return new Options().explicitPadding(explicitPadding); + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of lhs spatial dimensions). + * If empty list, the dilation for each lhs spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options lhsDilation(List lhsDilation) { + return new Options().lhsDilation(lhsDilation); + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of lhs spatial dimensions). + * If empty list, the dilation for each lhs spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options lhsDilation(Long... lhsDilation) { + return new Options().lhsDilation(lhsDilation); + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of rhs spatial dimensions). + * If empty list, the dilation for each rhs spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options rhsDilation(List rhsDilation) { + return new Options().rhsDilation(rhsDilation); + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of rhs spatial dimensions). + * If empty list, the dilation for each rhs spatial dimension is set to 1. + * @return this Options instance. + */ + public static Options rhsDilation(Long... rhsDilation) { + return new Options().rhsDilation(rhsDilation); + } + + /** + * Sets the batchGroupCount option. + * + * @param batchGroupCount The number of batch groups. Used for grouped filters. + * Must be a divisor of output_feature. + * @return this Options instance. + */ + public static Options batchGroupCount(Long batchGroupCount) { + return new Options().batchGroupCount(batchGroupCount); + } + + /** + * Sets the featureGroupCount option. + * + * @param featureGroupCount The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both lhs_feature and output_feature. + * @return this Options instance. + */ + public static Options featureGroupCount(Long featureGroupCount) { + return new Options().featureGroupCount(featureGroupCount); + } + + /** + * Sets the dimensionNumbers option. + * + * @param dimensionNumbers Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + * @return this Options instance. + */ + public static Options dimensionNumbers(String dimensionNumbers) { + return new Options().dimensionNumbers(dimensionNumbers); + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along kernel_output_feature_dimension is supported. + * Thus, this attribute must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public static Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + return new Options().rhsQuantizationAxis(rhsQuantizationAxis); + } + + /** + * Gets output. + * The output Tensor of {@code Tout}, same rank as {@code lhs} and {@code rhs}. + * The output data is the non-quantized output data. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.nn.UniformQuantizedConvolutionHybrid} + */ + public static class Options { + private List windowStrides; + + private List explicitPadding; + + private List lhsDilation; + + private List rhsDilation; + + private Long batchGroupCount; + + private Long featureGroupCount; + + private String dimensionNumbers; + + private Long rhsQuantizationAxis; + + private Options() { + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public Options windowStrides(List windowStrides) { + this.windowStrides = windowStrides; + return this; + } + + /** + * Sets the windowStrides option. + * + * @param windowStrides The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + * @return this Options instance. + */ + public Options windowStrides(Long... windowStrides) { + this.windowStrides = Arrays.asList(windowStrides); + return this; + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} Attr is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each lhs spatial dimension. + * Otherwise, this Attr is must be empty. + *

      (If used,) Must be a list of size 2 * (number of lhs spatial dimensions), + * where (explicit_padding[2 * i], explicit_padding[2 * i + 1]) indicates + * spatial_dimensions[i] (start_padding, end_padding). + * @return this Options instance. + */ + public Options explicitPadding(List explicitPadding) { + this.explicitPadding = explicitPadding; + return this; + } + + /** + * Sets the explicitPadding option. + * + * @param explicitPadding If {@code padding} Attr is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each lhs spatial dimension. + * Otherwise, this Attr is must be empty. + *

      (If used,) Must be a list of size 2 * (number of lhs spatial dimensions), + * where (explicit_padding[2 * i], explicit_padding[2 * i + 1]) indicates + * spatial_dimensions[i] (start_padding, end_padding). + * @return this Options instance. + */ + public Options explicitPadding(Long... explicitPadding) { + this.explicitPadding = Arrays.asList(explicitPadding); + return this; + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of lhs spatial dimensions). + * If empty list, the dilation for each lhs spatial dimension is set to 1. + * @return this Options instance. + */ + public Options lhsDilation(List lhsDilation) { + this.lhsDilation = lhsDilation; + return this; + } + + /** + * Sets the lhsDilation option. + * + * @param lhsDilation The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of lhs spatial dimensions). + * If empty list, the dilation for each lhs spatial dimension is set to 1. + * @return this Options instance. + */ + public Options lhsDilation(Long... lhsDilation) { + this.lhsDilation = Arrays.asList(lhsDilation); + return this; + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of rhs spatial dimensions). + * If empty list, the dilation for each rhs spatial dimension is set to 1. + * @return this Options instance. + */ + public Options rhsDilation(List rhsDilation) { + this.rhsDilation = rhsDilation; + return this; + } + + /** + * Sets the rhsDilation option. + * + * @param rhsDilation The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of rhs spatial dimensions). + * If empty list, the dilation for each rhs spatial dimension is set to 1. + * @return this Options instance. + */ + public Options rhsDilation(Long... rhsDilation) { + this.rhsDilation = Arrays.asList(rhsDilation); + return this; + } + + /** + * Sets the batchGroupCount option. + * + * @param batchGroupCount The number of batch groups. Used for grouped filters. + * Must be a divisor of output_feature. + * @return this Options instance. + */ + public Options batchGroupCount(Long batchGroupCount) { + this.batchGroupCount = batchGroupCount; + return this; + } + + /** + * Sets the featureGroupCount option. + * + * @param featureGroupCount The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both lhs_feature and output_feature. + * @return this Options instance. + */ + public Options featureGroupCount(Long featureGroupCount) { + this.featureGroupCount = featureGroupCount; + return this; + } + + /** + * Sets the dimensionNumbers option. + * + * @param dimensionNumbers Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + * @return this Options instance. + */ + public Options dimensionNumbers(String dimensionNumbers) { + this.dimensionNumbers = dimensionNumbers; + return this; + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along kernel_output_feature_dimension is supported. + * Thus, this attribute must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + * @return this Options instance. + */ + public Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + this.rhsQuantizationAxis = rhsQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedConvolutionHybrid.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a non-quantized Tensor of {@code Tlhs}, rank >= 3. + */ + public final Operand lhs; + + /** + * Must be a quantized Tensor of {@code Trhs}, same rank as {@code lhs}. + */ + public final Operand rhs; + + /** + * The float value(s) used as scale factors when quantizing the original data that {@code rhs} represents. + * Must be a scalar Tensor for per-tensor quantization, + * or 1D Tensor of size {@code rhs.dim_size(kernel_output_feature_dimension)}, for per-channel quantization. + */ + public final Operand rhsScales; + + /** + * The int32 value(s) used as zero_point when quantizing original data that {@code rhs} represents. + * Same shape condition as {@code rhs_scales}. + */ + public final Operand rhsZeroPoints; + + /** + * The type of {@code lhs} input Tensor. + */ + public final DataType Tlhs; + + /** + * The type of {@code rhs} (quantized) input Tensor. + */ + public final DataType Trhs; + + /** + * The type of output Tensor. + */ + public final DataType Tout; + + /** + * The stride of the sliding window for each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of spatial dimensions). + * If an empty list is provided, the stride for each spatial dimension is set to 1. + */ + public final long[] windowStrides; + + /** + * string from: {@code "SAME"}, {@code "VALID"}, or {@code "EXPLICIT"}, indicating the type of padding algorithm to use. + */ + public final String padding; + + /** + * If {@code padding} Attr is {@code "EXPLICIT"}, must be set as a list indicating + * the explicit paddings at the start and end of each lhs spatial dimension. + * Otherwise, this Attr is must be empty. + *

      (If used,) Must be a list of size 2 * (number of lhs spatial dimensions), + * where (explicit_padding[2 * i], explicit_padding[2 * i + 1]) indicates + * spatial_dimensions[i] (start_padding, end_padding). + */ + public final long[] explicitPadding; + + /** + * The dilation factor to apply in each spatial dimension of {@code lhs}. + * Must be an empty list (default) or a list of size (number of lhs spatial dimensions). + * If empty list, the dilation for each lhs spatial dimension is set to 1. + */ + public final long[] lhsDilation; + + /** + * The dilation factor to apply in each spatial dimension of {@code rhs}. + * Must be an empty list (default) or a list of size (number of rhs spatial dimensions). + * If empty list, the dilation for each rhs spatial dimension is set to 1. + */ + public final long[] rhsDilation; + + /** + * The number of batch groups. Used for grouped filters. + * Must be a divisor of output_feature. + */ + public final long batchGroupCount; + + /** + * The number of feature groups. Used for grouped convolutions. + * Must be a divisor of both lhs_feature and output_feature. + */ + public final long featureGroupCount; + + /** + * Structure of dimension information for the convolution op. + * Must be an empty string (default) or a serialized string of tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr proto. + * If empty string, the default is {@code ("NCHW", "OIHW", "NCHW")} (for a 2D convolution). + */ + public final String dimensionNumbers; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For the {@code rhs}, only per-tensor quantization + * or per-channel quantization along kernel_output_feature_dimension is supported. + * Thus, this attribute must be set to -1 or {@code dimension_numbers.kernel_output_feature_dimension}. + * Other values will raise error at OpKernel construction. + */ + public final long rhsQuantizationAxis; + + /** + * The min value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long rhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in {@code rhs}. + * For example, if {@code Trhs} is qint8, this must be set to 127. + */ + public final long rhsQuantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedConvolutionHybrid<>(op), op, Arrays.asList("Tlhs", "Trhs", "Tout", "window_strides", "padding", "explicit_padding", "lhs_dilation", "rhs_dilation", "batch_group_count", "feature_group_count", "dimension_numbers", "rhs_quantization_axis", "rhs_quantization_min_val", "rhs_quantization_max_val")); + int inputIndex = 0; + lhs = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + rhsScales = (Operand) op.input(inputIndex++); + rhsZeroPoints = (Operand) op.input(inputIndex++); + Tlhs = op.attributes().getAttrType("Tlhs"); + Trhs = op.attributes().getAttrType("Trhs"); + Tout = op.attributes().getAttrType("Tout"); + windowStrides = op.attributes().getAttrIntList("window_strides"); + padding = op.attributes().getAttrString("padding"); + explicitPadding = op.attributes().getAttrIntList("explicit_padding"); + lhsDilation = op.attributes().getAttrIntList("lhs_dilation"); + rhsDilation = op.attributes().getAttrIntList("rhs_dilation"); + batchGroupCount = op.attributes().getAttrInt("batch_group_count"); + featureGroupCount = op.attributes().getAttrInt("feature_group_count"); + dimensionNumbers = op.attributes().getAttrString("dimension_numbers"); + rhsQuantizationAxis = op.attributes().getAttrInt("rhs_quantization_axis"); + rhsQuantizationMinVal = op.attributes().getAttrInt("rhs_quantization_min_val"); + rhsQuantizationMaxVal = op.attributes().getAttrInt("rhs_quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java index 9d4c2e4cbea..e1333747ce9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -74,9 +80,11 @@ * : std::max(min_range / min_expected_T, * max_range / max_expected_T); * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Dequantize.OP_NAME, + inputsClass = Dequantize.Inputs.class +) @Operator( group = "quantization" ) @@ -88,8 +96,8 @@ public final class Dequantize extends RawOp implements Operan private Output output; - private Dequantize(Operation operation) { - super(operation); + public Dequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -98,7 +106,7 @@ private Dequantize(Operation operation) { * Factory method to create a class wrapping a new Dequantize operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. * @param dtype Type of the output tensor. Currently Dequantize supports float and bfloat16. @@ -138,7 +146,7 @@ public static Dequantize create(Scope scope, * Factory method to create a class wrapping a new Dequantize operation, with the default output types. * * @param scope current scope - * @param input the input value + * @param input The input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. * @param options carries optional attribute values @@ -148,7 +156,7 @@ public static Dequantize create(Scope scope, describeByClass = true ) public static Dequantize create(Scope scope, Operand input, - Operand minRange, Operand maxRange, Options[] options) { + Operand minRange, Operand maxRange, Options... options) { return create(scope, input, minRange, maxRange, TFloat32.class, options); } @@ -242,4 +250,63 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = Dequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The minimum scalar value possibly produced for the input. + */ + public final Operand minRange; + + /** + * The maximum scalar value possibly produced for the input. + */ + public final Operand maxRange; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The mode attribute + */ + public final String mode; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + /** + * The axis attribute + */ + public final long axis; + + /** + * Type of the output tensor. Currently Dequantize supports float and bfloat16. + * If 'dtype' is 'bfloat16', it only supports 'MIN_COMBINED' mode. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new Dequantize<>(op), op, Arrays.asList("T", "mode", "narrow_range", "axis", "dtype")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + minRange = (Operand) op.input(inputIndex++); + maxRange = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + mode = op.attributes().getAttrString("mode"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + axis = op.attributes().getAttrInt("axis"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java index aeb3f5bfbba..3266612b1c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,27 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** - * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. - * Attributes + * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same shape and type. + * Quantization is called fake since the output is still in floating point. + * The API converts inputs into values within the range [min and max] and returns + * as output. + *

      Attributes *

        *
      • {@code [min; max]} define the clamping range for the {@code inputs} data.
      • *
      • {@code inputs} values are quantized into the quantization range ( @@ -48,8 +56,32 @@ *
      • If {@code min <= 0 <= max}: {@code scale = (max - min) / (2^num_bits - 1) }, * {@code min_adj = scale * round(min / scale)} and {@code max_adj = max + min_adj - min}.
      • *
      - *

      Quantization is called fake since the output is still in floating point. + *

      Examples + *

      + *
      + * inp = tf.constant ([10.03, -10.23, 3])
      + * out = tf.quantization.fake_quant_with_min_max_args(inp, min=-5, max=5,
      + *                                                    num_bits=16)
      + * print(out)
      + *
      + * #  Output:
      + * #  tf.Tensor([ 4.9999237 -5.0000763  3.0000763], shape=(3,), dtype=float32)
      + * 
      + *

      Raises: + *

        + *
      • InvalidArgumentError: + *
          + *
        • If num_bits are outside of range [2, 16].
        • + *
        • If min >= max.
        • + *
        + *
      • + *
      • ValueError: If {@code inputs} are of any other type than float32.
      • + *
      */ +@OpMetadata( + opType = FakeQuantWithMinMaxArgs.OP_NAME, + inputsClass = FakeQuantWithMinMaxArgs.Inputs.class +) @Operator( group = "quantization" ) @@ -61,8 +93,8 @@ public final class FakeQuantWithMinMaxArgs extends RawOp implements Operand outputs; - private FakeQuantWithMinMaxArgs(Operation operation) { - super(operation); + public FakeQuantWithMinMaxArgs(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputs = operation.output(outputIdx++); } @@ -71,7 +103,7 @@ private FakeQuantWithMinMaxArgs(Operation operation) { * Factory method to create a class wrapping a new FakeQuantWithMinMaxArgs operation. * * @param scope current scope - * @param inputs the inputs value + * @param inputs The inputs value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgs */ @@ -214,4 +246,44 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxArgs.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Operand inputs; + + /** + * The min attribute + */ + public final float min; + + /** + * The max attribute + */ + public final float max; + + /** + * The numBits attribute + */ + public final long numBits; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxArgs(op), op, Arrays.asList("min", "max", "num_bits", "narrow_range")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + min = op.attributes().getAttrFloat("min"); + max = op.attributes().getAttrFloat("max"); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java index e02dbb09041..87007c73d6b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Compute gradients for a FakeQuantWithMinMaxArgs operation. */ +@OpMetadata( + opType = FakeQuantWithMinMaxArgsGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxArgsGradient.Inputs.class +) @Operator( group = "quantization" ) @@ -41,8 +50,8 @@ public final class FakeQuantWithMinMaxArgsGradient extends RawOp implements Oper private Output backprops; - private FakeQuantWithMinMaxArgsGradient(Operation operation) { - super(operation); + public FakeQuantWithMinMaxArgsGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backprops = operation.output(outputIdx++); } @@ -127,6 +136,38 @@ public static Options narrowRange(Boolean narrowRange) { * Gets backprops. * Backpropagated gradients below the FakeQuantWithMinMaxArgs operation: * {@code gradients * (inputs >= min && inputs <= max)}. + *
      +   * import tensorflow as tf
      +   *
      +   * # Define some sample data
      +   * gradients = tf.random.uniform((2, 3), minval=-5.0, maxval=5.0, dtype=tf.float32)
      +   * inputs = tf.random.uniform((2, 3), minval=-10.0, maxval=10.0, dtype=tf.float32)
      +   *
      +   * # Define quantization parameters (adjust as needed)
      +   * min_val = -2.0
      +   * max_val = 8.0
      +   * num_bits = 4  # Number of bits for quantization
      +   *
      +   * # Calculate gradients for fake quantization with specified parameters
      +   * output_gradients = tf.quantization.fake_quant_with_min_max_args_gradient(
      +   *     gradients=gradients, inputs=inputs, min=min_val, max=max_val, num_bits=num_bits, narrow_range = False, name=None
      +   * )
      +   *
      +   * # Print the original gradients and the gradients after the fake-quant operation
      +   * print("Original Gradients:")
      +   * print(gradients)
      +   * print("\nGradients after Fake-Quantization:")
      +   * print(output_gradients)
      +   *
      +   * 
      + *

      #Original Gradients: + * #tf.Tensor( + * #[[ 1.242547 3.217492 3.568469 ] + * #[-0.55371046 0.23130894 2.608243 ]], shape=(2, 3), dtype=float32) + *

      #Gradients after Fake-Quantization: + * #tf.Tensor( + * #[[ 0. 3.217492 3.568469 ] + * [-0.55371046 0.23130894 2.608243 ]], shape=(2, 3), dtype=float32)
      * @return backprops. */ public Output backprops() { @@ -197,4 +238,50 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxArgsGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. + */ + public final Operand gradients; + + /** + * Values passed as inputs to the FakeQuantWithMinMaxArgs operation. + */ + public final Operand inputs; + + /** + * The min attribute + */ + public final float min; + + /** + * The max attribute + */ + public final float max; + + /** + * The numBits attribute + */ + public final long numBits; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxArgsGradient(op), op, Arrays.asList("min", "max", "num_bits", "narrow_range")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + inputs = (Operand) op.input(inputIndex++); + min = op.attributes().getAttrFloat("min"); + max = op.attributes().getAttrFloat("max"); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java index 718a9acfb6a..e78b22ca6d5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; @@ -52,7 +57,33 @@ *

    *

    This operation has a gradient and thus allows for training {@code min} and {@code max} * values. + *

    + *
    + *
    + *

    constant_input = tf.constant([[1.2, -0.3, 0.7], [2.1, 0.5, -1.0]], dtype=tf.float32) + *

    min_val = -0.5 + * max_val = 0.8 + * num_bits = 8 + * narrow_range = False #False:for the quantization range [0; 2^num_bits - 1] + *

    quantized_data = tf.quantization.fake_quant_with_min_max_vars( + * ... inputs=constant_input, min=min_val, max=max_val, num_bits=num_bits, narrow_range=narrow_range + * ... ) + *

    print("Input:\n", constant_input.numpy()) + * Input: + * [[ 1.2 -0.3 0.7] + * [ 2.1 0.5 -1. ]] + * print("Output:\n", quantized_data.numpy()) + * Output: + * [[ 0.8003921 -0.3007843 0.6984313] + * [ 0.8003921 0.4996078 -0.4996078]] + *

    + *
    + *
    */ +@OpMetadata( + opType = FakeQuantWithMinMaxVars.OP_NAME, + inputsClass = FakeQuantWithMinMaxVars.Inputs.class +) @Operator( group = "quantization" ) @@ -64,8 +95,8 @@ public final class FakeQuantWithMinMaxVars extends RawOp implements Operand outputs; - private FakeQuantWithMinMaxVars(Operation operation) { - super(operation); + public FakeQuantWithMinMaxVars(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputs = operation.output(outputIdx++); } @@ -74,9 +105,9 @@ private FakeQuantWithMinMaxVars(Operation operation) { * Factory method to create a class wrapping a new FakeQuantWithMinMaxVars operation. * * @param scope current scope - * @param inputs the inputs value - * @param min the min value - * @param max the max value + * @param inputs The inputs value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVars */ @@ -169,4 +200,44 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxVars.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Operand inputs; + + /** + * The min input + */ + public final Operand min; + + /** + * The max input + */ + public final Operand max; + + /** + * The numBits attribute + */ + public final long numBits; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxVars(op), op, Arrays.asList("num_bits", "narrow_range")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java index c7f5e1eff1c..f8110d3a814 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Compute gradients for a FakeQuantWithMinMaxVars operation. */ +@OpMetadata( + opType = FakeQuantWithMinMaxVarsGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsGradient.Inputs.class +) @Operator( group = "quantization" ) @@ -45,8 +54,8 @@ public final class FakeQuantWithMinMaxVarsGradient extends RawOp { private Output backpropWrtMax; - private FakeQuantWithMinMaxVarsGradient(Operation operation) { - super(operation); + public FakeQuantWithMinMaxVarsGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backpropsWrtInput = operation.output(outputIdx++); backpropWrtMin = operation.output(outputIdx++); @@ -60,8 +69,8 @@ private FakeQuantWithMinMaxVarsGradient(Operation operation) { * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation. * min, max: Quantization interval, scalar floats. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsGradient */ @@ -171,4 +180,51 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxVarsGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * Backpropagated gradients above the FakeQuantWithMinMaxVars operation. + */ + public final Operand gradients; + + /** + * Values passed as inputs to the FakeQuantWithMinMaxVars operation. + * min, max: Quantization interval, scalar floats. + */ + public final Operand inputs; + + /** + * The min input + */ + public final Operand min; + + /** + * The max input + */ + public final Operand max; + + /** + * The bitwidth of the quantization; between 2 and 8, inclusive. + */ + public final long numBits; + + /** + * Whether to quantize into 2^num_bits - 1 distinct values. + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxVarsGradient(op), op, Arrays.asList("num_bits", "narrow_range")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + inputs = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java index 9ebe8dc4567..012e8349065 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; @@ -54,6 +59,10 @@ *

    This operation has a gradient and thus allows for training {@code min} and {@code max} * values. */ +@OpMetadata( + opType = FakeQuantWithMinMaxVarsPerChannel.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsPerChannel.Inputs.class +) @Operator( group = "quantization" ) @@ -65,8 +74,8 @@ public final class FakeQuantWithMinMaxVarsPerChannel extends RawOp implements Op private Output outputs; - private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { - super(operation); + public FakeQuantWithMinMaxVarsPerChannel(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputs = operation.output(outputIdx++); } @@ -75,9 +84,9 @@ private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsPerChannel operation. * * @param scope current scope - * @param inputs the inputs value - * @param min the min value - * @param max the max value + * @param inputs The inputs value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannel */ @@ -170,4 +179,44 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxVarsPerChannel.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Operand inputs; + + /** + * The min input + */ + public final Operand min; + + /** + * The max input + */ + public final Operand max; + + /** + * The numBits attribute + */ + public final long numBits; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxVarsPerChannel(op), op, Arrays.asList("num_bits", "narrow_range")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java index 66b9e432de6..5dd31d5f7b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation. */ +@OpMetadata( + opType = FakeQuantWithMinMaxVarsPerChannelGradient.OP_NAME, + inputsClass = FakeQuantWithMinMaxVarsPerChannelGradient.Inputs.class +) @Operator( group = "quantization" ) @@ -45,8 +54,8 @@ public final class FakeQuantWithMinMaxVarsPerChannelGradient extends RawOp { private Output backpropWrtMax; - private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { - super(operation); + public FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; backpropsWrtInput = operation.output(outputIdx++); backpropWrtMin = operation.output(outputIdx++); @@ -62,8 +71,8 @@ private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape * same as {@code gradients}. * min, max: Quantization interval, floats of shape {@code [d]}. - * @param min the min value - * @param max the max value + * @param min The min value + * @param max The max value * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ @@ -175,4 +184,53 @@ public Options narrowRange(Boolean narrowRange) { return this; } } + + @OpInputsMetadata( + outputsClass = FakeQuantWithMinMaxVarsPerChannelGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * Backpropagated gradients above the FakeQuantWithMinMaxVars operation, + * shape one of: {@code [d]}, {@code [b, d]}, {@code [b, h, w, d]}. + */ + public final Operand gradients; + + /** + * Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape + * same as {@code gradients}. + * min, max: Quantization interval, floats of shape {@code [d]}. + */ + public final Operand inputs; + + /** + * The min input + */ + public final Operand min; + + /** + * The max input + */ + public final Operand max; + + /** + * The bitwidth of the quantization; between 2 and 16, inclusive. + */ + public final long numBits; + + /** + * Whether to quantize into 2^num_bits - 1 distinct values. + */ + public final boolean narrowRange; + + public Inputs(GraphOperation op) { + super(new FakeQuantWithMinMaxVarsPerChannelGradient(op), op, Arrays.asList("num_bits", "narrow_range")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + inputs = (Operand) op.input(inputIndex++); + min = (Operand) op.input(inputIndex++); + max = (Operand) op.input(inputIndex++); + numBits = op.attributes().getAttrInt("num_bits"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java index 7710a448c9a..ed34d301ec7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -122,9 +128,11 @@ *

    Ensures the minimum quantization range is at least this value. * The legacy default value for this is 0.01, but it is strongly suggested to * set it to 0 for new uses. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Quantize.OP_NAME, + inputsClass = Quantize.Inputs.class +) @Operator( group = "quantization" ) @@ -140,8 +148,8 @@ public final class Quantize extends RawOp { private Output outputMax; - private Quantize(Operation operation) { - super(operation); + public Quantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -152,7 +160,7 @@ private Quantize(Operation operation) { * Factory method to create a class wrapping a new QuantizeV2 operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param minRange The minimum value of the quantization range. This value may be adjusted by the * op depending on other parameters. The adjusted value is written to {@code output_min}. * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size @@ -161,7 +169,7 @@ private Quantize(Operation operation) { * op depending on other parameters. The adjusted value is written to {@code output_max}. * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size * matches the {@code axis} dimension of the input and output tensors. - * @param T the value of the T property + * @param T The value of the T attribute * @param options carries optional attribute values * @param data type for {@code QuantizeV2} output and operands * @return a new instance of Quantize @@ -353,4 +361,74 @@ public Options ensureMinimumRange(Float ensureMinimumRange) { return this; } } + + @OpInputsMetadata( + outputsClass = Quantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The minimum value of the quantization range. This value may be adjusted by the + * op depending on other parameters. The adjusted value is written to {@code output_min}. + * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + */ + public final Operand minRange; + + /** + * The maximum value of the quantization range. This value may be adjusted by the + * op depending on other parameters. The adjusted value is written to {@code output_max}. + * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + */ + public final Operand maxRange; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The mode attribute + */ + public final String mode; + + /** + * The roundMode attribute + */ + public final String roundMode; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + /** + * The axis attribute + */ + public final long axis; + + /** + * The ensureMinimumRange attribute + */ + public final float ensureMinimumRange; + + public Inputs(GraphOperation op) { + super(new Quantize<>(op), op, Arrays.asList("T", "mode", "round_mode", "narrow_range", "axis", "ensure_minimum_range")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + minRange = (Operand) op.input(inputIndex++); + maxRange = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + mode = op.attributes().getAttrString("mode"); + roundMode = op.attributes().getAttrString("round_mode"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + axis = op.attributes().getAttrInt("axis"); + ensureMinimumRange = op.attributes().getAttrFloat("ensure_minimum_range"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java index e5bd785c488..eeb9f05536c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -32,9 +38,11 @@ * 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 */ +@OpMetadata( + opType = QuantizeAndDequantize.OP_NAME, + inputsClass = QuantizeAndDequantize.Inputs.class +) @Operator( group = "quantization" ) @@ -46,8 +54,8 @@ public final class QuantizeAndDequantize extends RawOp implem private Output output; - private QuantizeAndDequantize(Operation operation) { - super(operation); + public QuantizeAndDequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,10 +64,10 @@ private QuantizeAndDequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. * * @param scope current scope - * @param input the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value - * @param numBits the numBits value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value + * @param numBits The numBits value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantize @@ -206,4 +214,68 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizeAndDequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The inputMin input + */ + public final Operand inputMin; + + /** + * The inputMax input + */ + public final Operand inputMax; + + /** + * The numBits input + */ + public final Operand numBits; + + /** + * The signedInput attribute + */ + public final boolean signedInput; + + /** + * The rangeGiven attribute + */ + public final boolean rangeGiven; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + /** + * The axis attribute + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new QuantizeAndDequantize<>(op), op, Arrays.asList("signed_input", "range_given", "T", "narrow_range", "axis")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + numBits = (Operand) op.input(inputIndex++); + signedInput = op.attributes().getAttrBool("signed_input"); + rangeGiven = op.attributes().getAttrBool("range_given"); + T = op.attributes().getAttrType("T"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + axis = op.attributes().getAttrInt("axis"); + } + } } 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 index 475443feab6..e1de6cd2ab7 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -32,9 +38,11 @@ * 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 */ +@OpMetadata( + opType = QuantizeAndDequantizeV3.OP_NAME, + inputsClass = QuantizeAndDequantizeV3.Inputs.class +) @Operator( group = "quantization" ) @@ -46,8 +54,8 @@ public final class QuantizeAndDequantizeV3 extends RawOp impl private Output output; - private QuantizeAndDequantizeV3(Operation operation) { - super(operation); + public QuantizeAndDequantizeV3(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,10 +64,10 @@ private QuantizeAndDequantizeV3(Operation operation) { * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. * * @param scope current scope - * @param input the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value - * @param numBits the numBits value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value + * @param numBits The numBits value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantizeV3 @@ -206,4 +214,68 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizeAndDequantizeV3.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The inputMin input + */ + public final Operand inputMin; + + /** + * The inputMax input + */ + public final Operand inputMax; + + /** + * The numBits input + */ + public final Operand numBits; + + /** + * The signedInput attribute + */ + public final boolean signedInput; + + /** + * The rangeGiven attribute + */ + public final boolean rangeGiven; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The narrowRange attribute + */ + public final boolean narrowRange; + + /** + * The axis attribute + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new QuantizeAndDequantizeV3<>(op), op, Arrays.asList("signed_input", "range_given", "T", "narrow_range", "axis")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + numBits = (Operand) op.input(inputIndex++); + signedInput = op.attributes().getAttrBool("signed_input"); + rangeGiven = op.attributes().getAttrBool("range_given"); + T = op.attributes().getAttrType("T"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + axis = op.attributes().getAttrInt("axis"); + } + } } 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 index 61c58c8c21c..7de2e59c64b 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Quantizes then dequantizes a tensor. * 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 */ +@OpMetadata( + opType = QuantizeAndDequantizeV4.OP_NAME, + inputsClass = QuantizeAndDequantizeV4.Inputs.class +) @Operator( group = "quantization" ) @@ -45,8 +53,8 @@ public final class QuantizeAndDequantizeV4 extends RawOp impl private Output output; - private QuantizeAndDequantizeV4(Operation operation) { - super(operation); + public QuantizeAndDequantizeV4(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -104,7 +112,7 @@ public static QuantizeAndDequantizeV4 create(Scope scope, * Sets the signedInput option. * * @param signedInput Whether the quantization is signed or unsigned. (actually this parameter should - * have been called {@code signed_output}</b>) + * have been called {@code signed_output}) * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { @@ -208,7 +216,7 @@ private Options() { * Sets the signedInput option. * * @param signedInput Whether the quantization is signed or unsigned. (actually this parameter should - * have been called {@code signed_output}</b>) + * have been called {@code signed_output}) * @return this Options instance. */ public Options signedInput(Boolean signedInput) { @@ -281,4 +289,89 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizeAndDequantizeV4.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor to quantize and then dequantize. + */ + public final Operand input; + + /** + * If {@code range_given == True}, this specifies the minimum input value that needs to + * be represented, otherwise it is determined from the min value of the {@code input} + * tensor. + */ + public final Operand inputMin; + + /** + * If {@code range_given == True}, this specifies the maximum input value that needs to + * be represented, otherwise it is determined from the max value of the {@code input} + * tensor. + */ + public final Operand inputMax; + + /** + * Whether the quantization is signed or unsigned. (actually this parameter should + * have been called {@code signed_output}) + */ + public final boolean signedInput; + + /** + * The bitwidth of the quantization. + */ + public final long numBits; + + /** + * Whether the range is given or should be determined from the {@code input} tensor. + */ + public final boolean rangeGiven; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The 'round_mode' attribute controls which rounding tie-breaking algorithm is + * used when rounding float values to their quantized equivalents. The following + * rounding modes are currently supported: + *

      + *
    • HALF_TO_EVEN: this is the default round_mode.
    • + *
    • HALF_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 + * rounds up to -7.
    • + *
    + */ + public final String roundMode; + + /** + * If True, then the absolute value of the quantized minimum value is the same as + * the quantized maximum value, instead of 1 greater. + * i.e. for 8 bit quantization, the minimum value is -127 instead of -128. + */ + public final boolean narrowRange; + + /** + * If specified, this axis is treated as a channel or slice axis, and a separate + * quantization range is used for each channel or slice along this axis. + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new QuantizeAndDequantizeV4<>(op), op, Arrays.asList("signed_input", "num_bits", "range_given", "T", "round_mode", "narrow_range", "axis")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + signedInput = op.attributes().getAttrBool("signed_input"); + numBits = op.attributes().getAttrInt("num_bits"); + rangeGiven = op.attributes().getAttrBool("range_given"); + T = op.attributes().getAttrType("T"); + roundMode = op.attributes().getAttrString("round_mode"); + narrowRange = op.attributes().getAttrBool("narrow_range"); + axis = op.attributes().getAttrInt("axis"); + } + } } 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 index 80210f3fe28..65cf77c43ca 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Returns the gradient of {@code QuantizeAndDequantizeV4}. * Returns a gradient of 1 for inputs that are within the quantization range, * or 0 otherwise. - * - * @param data type for {@code input_backprop} output */ +@OpMetadata( + opType = QuantizeAndDequantizeV4Grad.OP_NAME, + inputsClass = QuantizeAndDequantizeV4Grad.Inputs.class +) @Operator( group = "quantization" ) @@ -49,8 +57,8 @@ public final class QuantizeAndDequantizeV4Grad extends RawOp private Output inputMaxBackprop; - private QuantizeAndDequantizeV4Grad(Operation operation) { - super(operation); + public QuantizeAndDequantizeV4Grad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; inputBackprop = operation.output(outputIdx++); inputMinBackprop = operation.output(outputIdx++); @@ -61,10 +69,10 @@ private QuantizeAndDequantizeV4Grad(Operation operation) { * Factory method to create a class wrapping a new QuantizeAndDequantizeV4Grad operation. * * @param scope current scope - * @param gradients the gradients value - * @param input the input value - * @param inputMin the inputMin value - * @param inputMax the inputMax value + * @param gradients The gradients value + * @param input The input value + * @param inputMin The inputMin value + * @param inputMax The inputMax value * @param options carries optional attribute values * @param data type for {@code QuantizeAndDequantizeV4Grad} output and operands * @return a new instance of QuantizeAndDequantizeV4Grad @@ -147,4 +155,50 @@ public Options axis(Long axis) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizeAndDequantizeV4Grad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The gradients input + */ + public final Operand gradients; + + /** + * The input input + */ + public final Operand input; + + /** + * The inputMin input + */ + public final Operand inputMin; + + /** + * The inputMax input + */ + public final Operand inputMax; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The axis attribute + */ + public final long axis; + + public Inputs(GraphOperation op) { + super(new QuantizeAndDequantizeV4Grad<>(op), op, Arrays.asList("T", "axis")); + int inputIndex = 0; + gradients = (Operand) op.input(inputIndex++); + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + axis = op.attributes().getAttrInt("axis"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java index d5e658a7f77..77aaa257758 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -50,9 +56,11 @@ * input values that only uses a small fraction of the possible range. By feeding * that output into this operator, we can reduce it from 32 bits down to 8 with * minimal loss of accuracy. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizeDownAndShrinkRange.OP_NAME, + inputsClass = QuantizeDownAndShrinkRange.Inputs.class +) @Operator( group = "quantization" ) @@ -68,8 +76,8 @@ public final class QuantizeDownAndShrinkRange extends RawOp { private Output outputMax; - private QuantizeDownAndShrinkRange(Operation operation) { - super(operation); + public QuantizeDownAndShrinkRange(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -80,7 +88,7 @@ private QuantizeDownAndShrinkRange(Operation operation) { * Factory method to create a class wrapping a new QuantizeDownAndShrinkRange operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. @@ -127,4 +135,44 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = QuantizeDownAndShrinkRange.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand inputMin; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand inputMax; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the output. Should be a lower bit depth than Tinput. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new QuantizeDownAndShrinkRange<>(op), op, Arrays.asList("Tinput", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java index 249fd86aa6f..a52e49b8080 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Concatenates quantized tensors along one dimension. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = QuantizedConcat.OP_NAME, + inputsClass = QuantizedConcat.Inputs.class +) @Operator( group = "quantization" ) @@ -50,8 +58,8 @@ public final class QuantizedConcat extends RawOp { private Output outputMax; - private QuantizedConcat(Operation operation) { - super(operation); + public QuantizedConcat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -113,4 +121,52 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = QuantizedConcat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The dimension along which to concatenate. Must be in the + * range [0, rank(values)). + */ + public final Operand concatDim; + + /** + * The {@code N} Tensors to concatenate. Their ranks and types must match, + * and their sizes must match in all dimensions except {@code concat_dim}. + */ + public final Iterable> values; + + /** + * The minimum scalar values for each of the input tensors. + */ + public final Iterable> inputMins; + + /** + * The maximum scalar values for each of the input tensors. + */ + public final Iterable> inputMaxes; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new QuantizedConcat<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + concatDim = (Operand) op.input(inputIndex++); + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + int inputMinsLength = op.inputListLength("input_mins"); + inputMins = Arrays.asList((Operand[]) op.inputList(inputIndex, inputMinsLength)); + inputIndex += inputMinsLength; + int inputMaxesLength = op.inputListLength("input_maxes"); + inputMaxes = Arrays.asList((Operand[]) op.inputList(inputIndex, inputMaxesLength)); + inputIndex += inputMaxesLength; + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java index e807fbaa2ab..c03a82caf5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedMatMulWithBiasAndDequantize operation - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMulWithBiasAndDequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndDequantize.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizedMatMulWithBiasAndDequantize extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class QuantizedMatMulWithBiasAndDequantize exten private Output out; - private QuantizedMatMulWithBiasAndDequantize(Operation operation) { - super(operation); + public QuantizedMatMulWithBiasAndDequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -51,16 +63,16 @@ private QuantizedMatMulWithBiasAndDequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndDequantize operation. * * @param scope current scope - * @param a the a value - * @param b the b value - * @param bias the bias value - * @param minA the minA value - * @param maxA the maxA value - * @param minB the minB value - * @param maxB the maxB value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param Toutput the value of the Toutput property + * @param a The a value + * @param b The b value + * @param bias The bias value + * @param minA The minA value + * @param maxA The maxA value + * @param minB The minB value + * @param maxB The maxB value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute * @param options carries optional attribute values * @param data type for {@code QuantizedMatMulWithBiasAndDequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndDequantize @@ -190,4 +202,110 @@ public Options inputQuantMode(String inputQuantMode) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMulWithBiasAndDequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The b input + */ + public final Operand b; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minA input + */ + public final Operand minA; + + /** + * The maxA input + */ + public final Operand maxA; + + /** + * The minB input + */ + public final Operand minB; + + /** + * The maxB input + */ + public final Operand maxB; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * The transposeA attribute + */ + public final boolean transposeA; + + /** + * The transposeB attribute + */ + public final boolean transposeB; + + /** + * The inputQuantMode attribute + */ + public final String inputQuantMode; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMulWithBiasAndDequantize<>(op), op, Arrays.asList("T1", "T2", "Tbias", "Toutput", "transpose_a", "transpose_b", "input_quant_mode")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Tbias = op.attributes().getAttrType("Tbias"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + inputQuantMode = op.attributes().getAttrString("input_quant_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java index b173c0f94fa..b848d068a15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * The QuantizedMatMulWithBiasAndRequantize operation - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = QuantizedMatMulWithBiasAndRequantize.OP_NAME, + inputsClass = QuantizedMatMulWithBiasAndRequantize.Inputs.class +) +@Operator( + group = "quantization" +) public final class QuantizedMatMulWithBiasAndRequantize extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class QuantizedMatMulWithBiasAndRequantize exten private Output maxOut; - private QuantizedMatMulWithBiasAndRequantize(Operation operation) { - super(operation); + public QuantizedMatMulWithBiasAndRequantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); minOut = operation.output(outputIdx++); @@ -57,16 +69,16 @@ private QuantizedMatMulWithBiasAndRequantize(Operation operation) { * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndRequantize operation. * * @param scope current scope - * @param a the a value - * @param b the b value - * @param bias the bias value - * @param minA the minA value - * @param maxA the maxA value - * @param minB the minB value - * @param maxB the maxB value - * @param minFreezedOutput the minFreezedOutput value - * @param maxFreezedOutput the maxFreezedOutput value - * @param Toutput the value of the Toutput property + * @param a The a value + * @param b The b value + * @param bias The bias value + * @param minA The minA value + * @param maxA The maxA value + * @param minB The minB value + * @param maxB The maxB value + * @param minFreezedOutput The minFreezedOutput value + * @param maxFreezedOutput The maxFreezedOutput value + * @param Toutput The value of the Toutput attribute * @param options carries optional attribute values * @param data type for {@code QuantizedMatMulWithBiasAndRequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndRequantize @@ -209,4 +221,110 @@ public Options inputQuantMode(String inputQuantMode) { return this; } } + + @OpInputsMetadata( + outputsClass = QuantizedMatMulWithBiasAndRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The a input + */ + public final Operand a; + + /** + * The b input + */ + public final Operand b; + + /** + * The bias input + */ + public final Operand bias; + + /** + * The minA input + */ + public final Operand minA; + + /** + * The maxA input + */ + public final Operand maxA; + + /** + * The minB input + */ + public final Operand minB; + + /** + * The maxB input + */ + public final Operand maxB; + + /** + * The minFreezedOutput input + */ + public final Operand minFreezedOutput; + + /** + * The maxFreezedOutput input + */ + public final Operand maxFreezedOutput; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The Tbias attribute + */ + public final DataType Tbias; + + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * The transposeA attribute + */ + public final boolean transposeA; + + /** + * The transposeB attribute + */ + public final boolean transposeB; + + /** + * The inputQuantMode attribute + */ + public final String inputQuantMode; + + public Inputs(GraphOperation op) { + super(new QuantizedMatMulWithBiasAndRequantize<>(op), op, Arrays.asList("T1", "T2", "Tbias", "Toutput", "transpose_a", "transpose_b", "input_quant_mode")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + bias = (Operand) op.input(inputIndex++); + minA = (Operand) op.input(inputIndex++); + maxA = (Operand) op.input(inputIndex++); + minB = (Operand) op.input(inputIndex++); + maxB = (Operand) op.input(inputIndex++); + minFreezedOutput = (Operand) op.input(inputIndex++); + maxFreezedOutput = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + Tbias = op.attributes().getAttrType("Tbias"); + Toutput = op.attributes().getAttrType("Toutput"); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + inputQuantMode = op.attributes().getAttrString("input_quant_mode"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java index 17dddee3427..e49e969889e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * used to produce the {@code requested_output_min} and {@code requested_output_max} for * {@code Requantize}. */ +@OpMetadata( + opType = RequantizationRange.OP_NAME, + inputsClass = RequantizationRange.Inputs.class +) @Operator( group = "quantization" ) @@ -48,8 +58,8 @@ public final class RequantizationRange extends RawOp { private Output outputMax; - private RequantizationRange(Operation operation) { - super(operation); + public RequantizationRange(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputMin = operation.output(outputIdx++); outputMax = operation.output(outputIdx++); @@ -59,7 +69,7 @@ private RequantizationRange(Operation operation) { * Factory method to create a class wrapping a new RequantizationRange operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @return a new instance of RequantizationRange @@ -93,4 +103,38 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = RequantizationRange.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand inputMin; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand inputMax; + + /** + * The type of the input. + */ + public final DataType Tinput; + + public Inputs(GraphOperation op) { + super(new RequantizationRange(op), op, Arrays.asList("Tinput")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java index 26c3c26e422..0ebd2ce0e3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.quantization; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -37,9 +43,11 @@ * interpretation of the {@code input} data. For example, if {@code input_min} is -1.0f and * {@code input_max} is 1.0f, and we are dealing with {@code quint16} quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Requantize.OP_NAME, + inputsClass = Requantize.Inputs.class +) @Operator( group = "quantization" ) @@ -55,8 +63,8 @@ public final class Requantize extends RawOp { private Output outputMax; - private Requantize(Operation operation) { - super(operation); + public Requantize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); outputMin = operation.output(outputIdx++); @@ -67,7 +75,7 @@ private Requantize(Operation operation) { * Factory method to create a class wrapping a new Requantize operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param requestedOutputMin The float value that the minimum quantized output value represents. @@ -119,4 +127,56 @@ public Output outputMin() { public Output outputMax() { return outputMax; } + + @OpInputsMetadata( + outputsClass = Requantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The float value that the minimum quantized input value represents. + */ + public final Operand inputMin; + + /** + * The float value that the maximum quantized input value represents. + */ + public final Operand inputMax; + + /** + * The float value that the minimum quantized output value represents. + */ + public final Operand requestedOutputMin; + + /** + * The float value that the maximum quantized output value represents. + */ + public final Operand requestedOutputMax; + + /** + * The type of the input. + */ + public final DataType Tinput; + + /** + * The type of the output. Should be a lower bit depth than Tinput. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new Requantize<>(op), op, Arrays.asList("Tinput", "out_type")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputMin = (Operand) op.input(inputIndex++); + inputMax = (Operand) op.input(inputIndex++); + requestedOutputMin = (Operand) op.input(inputIndex++); + requestedOutputMax = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformDequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformDequantize.java new file mode 100644 index 00000000000..8f5d44bf663 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformDequantize.java @@ -0,0 +1,223 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform dequantization on the quantized Tensor {@code input}. + * Given quantized {@code input} which was quantized using {@code scales} and {@code zero_points}, performs dequantization using the formula: + * dequantized_data = (quantized_data - zero_point) * scale. + */ +@OpMetadata( + opType = UniformDequantize.OP_NAME, + inputsClass = UniformDequantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class UniformDequantize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformDequantize"; + + private Output output; + + public UniformDequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformDequantize operation. + * + * @param scope current scope + * @param input Must be a Tensor of Tin. + * @param scales The float value(s) used as scale(s) when quantizing original data that input represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) used as zero_point(s) when quantizing original data that input represents. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + * @param quantizationMinVal The quantization min value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param quantizationMaxVal The quantization max value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformDequantize} output and operands + * @return a new instance of UniformDequantize + */ + @Endpoint( + describeByClass = true + ) + public static UniformDequantize create(Scope scope, + Operand input, Operand scales, Operand zeroPoints, + Class Tout, Long quantizationMinVal, Long quantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformDequantize"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(scales.asOutput()); + opBuilder.addInput(zeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("quantization_min_val", quantizationMinVal); + opBuilder.setAttr("quantization_max_val", quantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.quantizationAxis != null) { + opBuilder.setAttr("quantization_axis", opts.quantizationAxis); + } + } + } + return new UniformDequantize<>(opBuilder.build()); + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public static Options quantizationAxis(Long quantizationAxis) { + return new Options().quantizationAxis(quantizationAxis); + } + + /** + * Gets output. + * The output dequantized Tensor of Tout, whose shape is same as input. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.UniformDequantize} + */ + public static class Options { + private Long quantizationAxis; + + private Options() { + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public Options quantizationAxis(Long quantizationAxis) { + this.quantizationAxis = quantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformDequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a Tensor of Tin. + */ + public final Operand input; + + /** + * The float value(s) used as scale(s) when quantizing original data that input represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand scales; + + /** + * The int32 value(s) used as zero_point(s) when quantizing original data that input represents. + * Same shape condition as scales. + */ + public final Operand zeroPoints; + + /** + * The type of input Tensor. A tf.DType from: tf.float32 + */ + public final DataType Tin; + + /** + * The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + */ + public final DataType Tout; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + */ + public final long quantizationAxis; + + /** + * The quantization min value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + */ + public final long quantizationMinVal; + + /** + * The quantization max value that was used when input was quantized. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + */ + public final long quantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformDequantize<>(op), op, Arrays.asList("Tin", "Tout", "quantization_axis", "quantization_min_val", "quantization_max_val")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + scales = (Operand) op.input(inputIndex++); + zeroPoints = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + quantizationAxis = op.attributes().getAttrInt("quantization_axis"); + quantizationMinVal = op.attributes().getAttrInt("quantization_min_val"); + quantizationMaxVal = op.attributes().getAttrInt("quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantize.java new file mode 100644 index 00000000000..390ceb83d8a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantize.java @@ -0,0 +1,223 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform quantization on Tensor {@code input}. + * Given {@code input}, {@code scales} and {@code zero_points}, performs quantization using the formula: + * quantized_data = floor(input_data * (1.0f / scale) + 0.5f) + zero_point + */ +@OpMetadata( + opType = UniformQuantize.OP_NAME, + inputsClass = UniformQuantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class UniformQuantize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantize"; + + private Output output; + + public UniformQuantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantize operation. + * + * @param scope current scope + * @param input Must be a Tensor of Tin. + * @param scales The float value(s) to use as scale(s) to quantize {@code input}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param zeroPoints The int32 value(s) to use as zero_point(s) to quantize {@code input}. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.float32 + * @param quantizationMinVal The quantization min value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param quantizationMaxVal The quantization max value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantize} output and operands + * @return a new instance of UniformQuantize + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantize create(Scope scope, + Operand input, Operand scales, Operand zeroPoints, + Class Tout, Long quantizationMinVal, Long quantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantize"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(scales.asOutput()); + opBuilder.addInput(zeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("quantization_min_val", quantizationMinVal); + opBuilder.setAttr("quantization_max_val", quantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.quantizationAxis != null) { + opBuilder.setAttr("quantization_axis", opts.quantizationAxis); + } + } + } + return new UniformQuantize<>(opBuilder.build()); + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public static Options quantizationAxis(Long quantizationAxis) { + return new Options().quantizationAxis(quantizationAxis); + } + + /** + * Gets output. + * The output quantized Tensor of Tout, whose shape is same as input. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.UniformQuantize} + */ + public static class Options { + private Long quantizationAxis; + + private Options() { + } + + /** + * Sets the quantizationAxis option. + * + * @param quantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public Options quantizationAxis(Long quantizationAxis) { + this.quantizationAxis = quantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a Tensor of Tin. + */ + public final Operand input; + + /** + * The float value(s) to use as scale(s) to quantize {@code input}. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand scales; + + /** + * The int32 value(s) to use as zero_point(s) to quantize {@code input}. + * Same shape condition as scales. + */ + public final Operand zeroPoints; + + /** + * The type of input Tensor. A tf.DType from: tf.qint8, tf.qint32 + */ + public final DataType Tin; + + /** + * The type of output Tensor. A tf.DType from: tf.float32 + */ + public final DataType Tout; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + */ + public final long quantizationAxis; + + /** + * The quantization min value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + */ + public final long quantizationMinVal; + + /** + * The quantization max value to quantize {@code input}. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + */ + public final long quantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantize<>(op), op, Arrays.asList("Tin", "Tout", "quantization_axis", "quantization_min_val", "quantization_max_val")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + scales = (Operand) op.input(inputIndex++); + zeroPoints = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + quantizationAxis = op.attributes().getAttrInt("quantization_axis"); + quantizationMinVal = op.attributes().getAttrInt("quantization_min_val"); + quantizationMaxVal = op.attributes().getAttrInt("quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDot.java new file mode 100644 index 00000000000..eff33c22ce7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDot.java @@ -0,0 +1,403 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform quantized dot of quantized Tensor {@code lhs} and quantized Tensor {@code rhs} to make quantized {@code output}. + * Given quantized {@code lhs} and quantized {@code rhs}, performs quantized dot on {@code lhs} and {@code rhs} to make quantized {@code output}. + * {@code lhs} and {@code rhs} must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0). + * {@code lhs} and {@code rhs} must be quantized Tensor, where data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + * {@code output} is also quantized, using the same formula. + * If {@code rhs} is per-tensor quantized, {@code output} must be also per-tensor quantized. + */ +@OpMetadata( + opType = UniformQuantizedDot.OP_NAME, + inputsClass = UniformQuantizedDot.Inputs.class +) +@Operator( + group = "quantization" +) +public final class UniformQuantizedDot extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedDot"; + + private Output output; + + public UniformQuantizedDot(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedDot operation. + * + * @param scope current scope + * @param lhs Must be a 2D Tensor of Tin. + * @param rhs Must be a 2D Tensor of Tin. + * @param lhsScales The float value(s) used as scale when quantizing original data that lhs represents. + * Must be a scalar Tensor (lhs supports only per-tensor quantization). + * @param lhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that lhs represents. + * Same shape condition as lhs_scales. + * @param rhsScales The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + * @param outputScales The float value(s) to use as scales when quantizing original data that output represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (output.dim_size(1),) (per-channel quantization). + * If rhs is per-tensor quantized, output must be also per-tensor quantized. + * This means that if rhs_scales and rhs_zero_points are scalar Tensors, output_scales and output_zero_points must be scalar Tensors as well. + * @param outputZeroPoints The int32 value(s) used as zero_point when quantizing original data that output represents. + * Same shape condition as rhs_scales. + * @param Tout The type of output Tensor. + * @param lhsQuantizationMinVal The min value of the quantized data stored in lhs. + * For example, if Tin is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param lhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Tin is qint8, this must be set to 127. + * @param rhsQuantizationMinVal The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + * @param outputQuantizationMinVal The min value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param outputQuantizationMaxVal The max value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedDot} output and operands + * @param data type for {@code UniformQuantizedDot} output and operands + * @return a new instance of UniformQuantizedDot + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedDot create(Scope scope, + Operand lhs, Operand rhs, Operand lhsScales, Operand lhsZeroPoints, + Operand rhsScales, Operand rhsZeroPoints, Operand outputScales, + Operand outputZeroPoints, Class Tout, Long lhsQuantizationMinVal, + Long lhsQuantizationMaxVal, Long rhsQuantizationMinVal, Long rhsQuantizationMaxVal, + Long outputQuantizationMinVal, Long outputQuantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedDot"); + opBuilder.addInput(lhs.asOutput()); + opBuilder.addInput(rhs.asOutput()); + opBuilder.addInput(lhsScales.asOutput()); + opBuilder.addInput(lhsZeroPoints.asOutput()); + opBuilder.addInput(rhsScales.asOutput()); + opBuilder.addInput(rhsZeroPoints.asOutput()); + opBuilder.addInput(outputScales.asOutput()); + opBuilder.addInput(outputZeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("lhs_quantization_min_val", lhsQuantizationMinVal); + opBuilder.setAttr("lhs_quantization_max_val", lhsQuantizationMaxVal); + opBuilder.setAttr("rhs_quantization_min_val", rhsQuantizationMinVal); + opBuilder.setAttr("rhs_quantization_max_val", rhsQuantizationMaxVal); + opBuilder.setAttr("output_quantization_min_val", outputQuantizationMinVal); + opBuilder.setAttr("output_quantization_max_val", outputQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.lhsQuantizationAxis != null) { + opBuilder.setAttr("lhs_quantization_axis", opts.lhsQuantizationAxis); + } + if (opts.rhsQuantizationAxis != null) { + opBuilder.setAttr("rhs_quantization_axis", opts.rhsQuantizationAxis); + } + if (opts.outputQuantizationAxis != null) { + opBuilder.setAttr("output_quantization_axis", opts.outputQuantizationAxis); + } + } + } + return new UniformQuantizedDot<>(opBuilder.build()); + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op lhs, only per-tensor quantization is supported. + * Thus, this attribute must be set to -1. Other values are rejected. + * @return this Options instance. + */ + public static Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + return new Options().lhsQuantizationAxis(lhsQuantizationAxis); + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public static Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + return new Options().rhsQuantizationAxis(rhsQuantizationAxis); + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op output, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public static Options outputQuantizationAxis(Long outputQuantizationAxis) { + return new Options().outputQuantizationAxis(outputQuantizationAxis); + } + + /** + * Gets output. + * The output 2D Tensor of Tout, whose shape is (lhs.dim_size(0), rhs.dim_size(1)). + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.UniformQuantizedDot} + */ + public static class Options { + private Long lhsQuantizationAxis; + + private Long rhsQuantizationAxis; + + private Long outputQuantizationAxis; + + private Options() { + } + + /** + * Sets the lhsQuantizationAxis option. + * + * @param lhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op lhs, only per-tensor quantization is supported. + * Thus, this attribute must be set to -1. Other values are rejected. + * @return this Options instance. + */ + public Options lhsQuantizationAxis(Long lhsQuantizationAxis) { + this.lhsQuantizationAxis = lhsQuantizationAxis; + return this; + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + this.rhsQuantizationAxis = rhsQuantizationAxis; + return this; + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op output, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public Options outputQuantizationAxis(Long outputQuantizationAxis) { + this.outputQuantizationAxis = outputQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedDot.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a 2D Tensor of Tin. + */ + public final Operand lhs; + + /** + * Must be a 2D Tensor of Tin. + */ + public final Operand rhs; + + /** + * The float value(s) used as scale when quantizing original data that lhs represents. + * Must be a scalar Tensor (lhs supports only per-tensor quantization). + */ + public final Operand lhsScales; + + /** + * The int32 value(s) used as zero_point when quantizing original data that lhs represents. + * Same shape condition as lhs_scales. + */ + public final Operand lhsZeroPoints; + + /** + * The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + */ + public final Operand rhsScales; + + /** + * The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + */ + public final Operand rhsZeroPoints; + + /** + * The float value(s) to use as scales when quantizing original data that output represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (output.dim_size(1),) (per-channel quantization). + * If rhs is per-tensor quantized, output must be also per-tensor quantized. + * This means that if rhs_scales and rhs_zero_points are scalar Tensors, output_scales and output_zero_points must be scalar Tensors as well. + */ + public final Operand outputScales; + + /** + * The int32 value(s) used as zero_point when quantizing original data that output represents. + * Same shape condition as rhs_scales. + */ + public final Operand outputZeroPoints; + + /** + * The type of lhs and rhs input Tensor. + */ + public final DataType Tin; + + /** + * The type of output Tensor. + */ + public final DataType Tout; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op lhs, only per-tensor quantization is supported. + * Thus, this attribute must be set to -1. Other values are rejected. + */ + public final long lhsQuantizationAxis; + + /** + * The min value of the quantized data stored in lhs. + * For example, if Tin is qint8, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long lhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in rhs. + * For example, if Tin is qint8, this must be set to 127. + */ + public final long lhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + */ + public final long rhsQuantizationAxis; + + /** + * The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long rhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + */ + public final long rhsQuantizationMaxVal; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op output, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + */ + public final long outputQuantizationAxis; + + /** + * The min value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long outputQuantizationMinVal; + + /** + * The max value of the quantized data stored in output. + * For example, if Tout is qint8, this must be set to 127. + */ + public final long outputQuantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedDot<>(op), op, Arrays.asList("Tin", "Tout", "lhs_quantization_axis", "lhs_quantization_min_val", "lhs_quantization_max_val", "rhs_quantization_axis", "rhs_quantization_min_val", "rhs_quantization_max_val", "output_quantization_axis", "output_quantization_min_val", "output_quantization_max_val")); + int inputIndex = 0; + lhs = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + lhsScales = (Operand) op.input(inputIndex++); + lhsZeroPoints = (Operand) op.input(inputIndex++); + rhsScales = (Operand) op.input(inputIndex++); + rhsZeroPoints = (Operand) op.input(inputIndex++); + outputScales = (Operand) op.input(inputIndex++); + outputZeroPoints = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + lhsQuantizationAxis = op.attributes().getAttrInt("lhs_quantization_axis"); + lhsQuantizationMinVal = op.attributes().getAttrInt("lhs_quantization_min_val"); + lhsQuantizationMaxVal = op.attributes().getAttrInt("lhs_quantization_max_val"); + rhsQuantizationAxis = op.attributes().getAttrInt("rhs_quantization_axis"); + rhsQuantizationMinVal = op.attributes().getAttrInt("rhs_quantization_min_val"); + rhsQuantizationMaxVal = op.attributes().getAttrInt("rhs_quantization_max_val"); + outputQuantizationAxis = op.attributes().getAttrInt("output_quantization_axis"); + outputQuantizationMinVal = op.attributes().getAttrInt("output_quantization_min_val"); + outputQuantizationMaxVal = op.attributes().getAttrInt("output_quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDotHybrid.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDotHybrid.java new file mode 100644 index 00000000000..1f30f7a1a4c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformQuantizedDotHybrid.java @@ -0,0 +1,240 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Perform hybrid quantized dot of float Tensor {@code lhs} and quantized Tensor {@code rhs}. + * Given float {@code lhs} and quantized {@code rhs}, internally performs quantization on {@code lhs}, and then performs quantized dot on quantized lhs and {@code rhs}. + * The internal quantization on {@code lhs} is a quantization to qint8, dynamic range, per-batch (per-axis along axis 0), asymmetric, and not narrow range (the range is [-128, 127]). + * {@code lhs} and {@code rhs} must be 2D Tensors and the lhs.dim_size(1) must match rhs.dim_size(0). + * {@code rhs} must be quantized Tensor, where its data value is quantized using the formula: + * quantized_data = clip(original_data / scale + zero_point, quantization_min_val, quantization_max_val). + */ +@OpMetadata( + opType = UniformQuantizedDotHybrid.OP_NAME, + inputsClass = UniformQuantizedDotHybrid.Inputs.class +) +@Operator( + group = "quantization" +) +public final class UniformQuantizedDotHybrid extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformQuantizedDotHybrid"; + + private Output output; + + public UniformQuantizedDotHybrid(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformQuantizedDotHybrid operation. + * + * @param scope current scope + * @param lhs Must be a 2D Tensor of Tlhs. + * @param rhs Must be a 2D Tensor of Trhs. + * @param rhsScales The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + * @param rhsZeroPoints The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + * @param Tout The type of output Tensor. + * @param rhsQuantizationMinVal The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + * @param rhsQuantizationMaxVal The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + * @param options carries optional attribute values + * @param data type for {@code UniformQuantizedDotHybrid} output and operands + * @return a new instance of UniformQuantizedDotHybrid + */ + @Endpoint( + describeByClass = true + ) + public static UniformQuantizedDotHybrid create(Scope scope, + Operand lhs, Operand rhs, Operand rhsScales, + Operand rhsZeroPoints, Class Tout, Long rhsQuantizationMinVal, + Long rhsQuantizationMaxVal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformQuantizedDotHybrid"); + opBuilder.addInput(lhs.asOutput()); + opBuilder.addInput(rhs.asOutput()); + opBuilder.addInput(rhsScales.asOutput()); + opBuilder.addInput(rhsZeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("rhs_quantization_min_val", rhsQuantizationMinVal); + opBuilder.setAttr("rhs_quantization_max_val", rhsQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.rhsQuantizationAxis != null) { + opBuilder.setAttr("rhs_quantization_axis", opts.rhsQuantizationAxis); + } + } + } + return new UniformQuantizedDotHybrid<>(opBuilder.build()); + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public static Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + return new Options().rhsQuantizationAxis(rhsQuantizationAxis); + } + + /** + * Gets output. + * The output 2D Tensor of Tout, whose shape is (lhs.dim_size(0), rhs.dim_size(1)). + * The output data is the original output data itself (Not quantized). + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.UniformQuantizedDotHybrid} + */ + public static class Options { + private Long rhsQuantizationAxis; + + private Options() { + } + + /** + * Sets the rhsQuantizationAxis option. + * + * @param rhsQuantizationAxis Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + * @return this Options instance. + */ + public Options rhsQuantizationAxis(Long rhsQuantizationAxis) { + this.rhsQuantizationAxis = rhsQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformQuantizedDotHybrid.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a 2D Tensor of Tlhs. + */ + public final Operand lhs; + + /** + * Must be a 2D Tensor of Trhs. + */ + public final Operand rhs; + + /** + * The float value(s) used as scale when quantizing original data that rhs represents. + * Must be a scalar Tensor (per-tensor quantization) or 1D Tensor of size (rhs.dim_size(1),) (per-channel quantization). + */ + public final Operand rhsScales; + + /** + * The int32 value(s) used as zero_point when quantizing original data that rhs represents. + * Same shape condition as rhs_scales. + */ + public final Operand rhsZeroPoints; + + /** + * The type of lhs input Tensor. + */ + public final DataType Tlhs; + + /** + * The type of rhs (quantized) input Tensor. + */ + public final DataType Trhs; + + /** + * The type of output Tensor. + */ + public final DataType Tout; + + /** + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. + * For dot op rhs, only per-tensor quantization or per-channel quantization along dimension 1 is supported. + * Thus, this attribute must be set to -1 or 1. Other values are rejected. + */ + public final long rhsQuantizationAxis; + + /** + * The min value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to -127 if narrow range quantized or -128 if not. + */ + public final long rhsQuantizationMinVal; + + /** + * The max value of the quantized data stored in rhs. + * For example, if Trhs is qint8, this must be set to 127. + */ + public final long rhsQuantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformQuantizedDotHybrid<>(op), op, Arrays.asList("Tlhs", "Trhs", "Tout", "rhs_quantization_axis", "rhs_quantization_min_val", "rhs_quantization_max_val")); + int inputIndex = 0; + lhs = (Operand) op.input(inputIndex++); + rhs = (Operand) op.input(inputIndex++); + rhsScales = (Operand) op.input(inputIndex++); + rhsZeroPoints = (Operand) op.input(inputIndex++); + Tlhs = op.attributes().getAttrType("Tlhs"); + Trhs = op.attributes().getAttrType("Trhs"); + Tout = op.attributes().getAttrType("Tout"); + rhsQuantizationAxis = op.attributes().getAttrInt("rhs_quantization_axis"); + rhsQuantizationMinVal = op.attributes().getAttrInt("rhs_quantization_min_val"); + rhsQuantizationMaxVal = op.attributes().getAttrInt("rhs_quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformRequantize.java new file mode 100644 index 00000000000..eb4c511b567 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/UniformRequantize.java @@ -0,0 +1,309 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * Given quantized tensor {@code input}, requantize it with new quantization parameters. + * Given quantized tensor {@code input}, which was quantized using {input_scales, input_zero_points, input_quantization_axis, input_quantization_min_val, input_quantization_max_val}, + * requantize it to a tensor, which is quantized using {output_scales, output_zero_points, output_quantization_axis, output_quantization_min_val, output_quantization_max_val}. + * The requantization is done by using the formula: + * output_quantized_data = clip( + * (input_quantized_data - input_zero_point) * (input_scale / output_scale) + output_zero_point, + * output_quantization_min_val, + * output_quantization_max_val) + *

    Per-tensor and per-axis quantization supported cases are followings: + *

      + *
    • per-tensor -> per-tensor
    • + *
    • per-tensor -> per-axis
    • + *
    • per-axis -> per-axis where input_quantization_axis equals output_quantization_axis. + * i.e. At least one among input_quantization_axis and output_quantization_axis must be -1, or two must be equal.
    • + *
    + */ +@OpMetadata( + opType = UniformRequantize.OP_NAME, + inputsClass = UniformRequantize.Inputs.class +) +@Operator( + group = "quantization" +) +public final class UniformRequantize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniformRequantize"; + + private Output output; + + public UniformRequantize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniformRequantize operation. + * + * @param scope current scope + * @param input Must be a Tensor of Tin. + * @param inputScales The float value(s) used as scale(s) when quantizing original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param inputZeroPoints The int32 value(s) used as zero_point(s) when quantizing original data that {@code input} represents. + * Same shape condition as scales. + * @param outputScales The float value(s) to use as new scale(s) to quantize original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + * @param outputZeroPoints The int32 value(s) to use as new zero_point(s) to quantize original data that {@code input} represents. + * Same shape condition as scales. + * @param Tout The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + * @param inputQuantizationMinVal The quantization min value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + * @param inputQuantizationMaxVal The quantization max value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + * @param outputQuantizationMinVal The new quantization min value to quantize original data that {@code input} represents. + * @param outputQuantizationMaxVal The new quantization max value to quantize original data that {@code input} represents. + * @param options carries optional attribute values + * @param data type for {@code UniformRequantize} output and operands + * @return a new instance of UniformRequantize + */ + @Endpoint( + describeByClass = true + ) + public static UniformRequantize create(Scope scope, + Operand input, Operand inputScales, + Operand inputZeroPoints, Operand outputScales, + Operand outputZeroPoints, Class Tout, Long inputQuantizationMinVal, + Long inputQuantizationMaxVal, Long outputQuantizationMinVal, Long outputQuantizationMaxVal, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UniformRequantize"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(inputScales.asOutput()); + opBuilder.addInput(inputZeroPoints.asOutput()); + opBuilder.addInput(outputScales.asOutput()); + opBuilder.addInput(outputZeroPoints.asOutput()); + opBuilder.setAttr("Tout", Operands.toDataType(Tout)); + opBuilder.setAttr("input_quantization_min_val", inputQuantizationMinVal); + opBuilder.setAttr("input_quantization_max_val", inputQuantizationMaxVal); + opBuilder.setAttr("output_quantization_min_val", outputQuantizationMinVal); + opBuilder.setAttr("output_quantization_max_val", outputQuantizationMaxVal); + if (options != null) { + for (Options opts : options) { + if (opts.inputQuantizationAxis != null) { + opBuilder.setAttr("input_quantization_axis", opts.inputQuantizationAxis); + } + if (opts.outputQuantizationAxis != null) { + opBuilder.setAttr("output_quantization_axis", opts.outputQuantizationAxis); + } + } + } + return new UniformRequantize<>(opBuilder.build()); + } + + /** + * Sets the inputQuantizationAxis option. + * + * @param inputQuantizationAxis The quantization axis that was used when quantizing original data that {@code input} represents. + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public static Options inputQuantizationAxis(Long inputQuantizationAxis) { + return new Options().inputQuantizationAxis(inputQuantizationAxis); + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis The new quantization axis to use to quantize original data that {@code input} represents. + * @return this Options instance. + */ + public static Options outputQuantizationAxis(Long outputQuantizationAxis) { + return new Options().outputQuantizationAxis(outputQuantizationAxis); + } + + /** + * Gets output. + * The output quantized Tensor of Tout, whose shape is same as input. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.UniformRequantize} + */ + public static class Options { + private Long inputQuantizationAxis; + + private Long outputQuantizationAxis; + + private Options() { + } + + /** + * Sets the inputQuantizationAxis option. + * + * @param inputQuantizationAxis The quantization axis that was used when quantizing original data that {@code input} represents. + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + * @return this Options instance. + */ + public Options inputQuantizationAxis(Long inputQuantizationAxis) { + this.inputQuantizationAxis = inputQuantizationAxis; + return this; + } + + /** + * Sets the outputQuantizationAxis option. + * + * @param outputQuantizationAxis The new quantization axis to use to quantize original data that {@code input} represents. + * @return this Options instance. + */ + public Options outputQuantizationAxis(Long outputQuantizationAxis) { + this.outputQuantizationAxis = outputQuantizationAxis; + return this; + } + } + + @OpInputsMetadata( + outputsClass = UniformRequantize.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must be a Tensor of Tin. + */ + public final Operand input; + + /** + * The float value(s) used as scale(s) when quantizing original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand inputScales; + + /** + * The int32 value(s) used as zero_point(s) when quantizing original data that {@code input} represents. + * Same shape condition as scales. + */ + public final Operand inputZeroPoints; + + /** + * The float value(s) to use as new scale(s) to quantize original data that {@code input} represents. + * Must be a scalar Tensor if quantization_axis is -1 (per-tensor quantization), otherwise 1D Tensor of size (input.dim_size(quantization_axis),) (per-axis quantization). + */ + public final Operand outputScales; + + /** + * The int32 value(s) to use as new zero_point(s) to quantize original data that {@code input} represents. + * Same shape condition as scales. + */ + public final Operand outputZeroPoints; + + /** + * The type of input Tensor. A tf.DType from: tf.qint8, tf.qint32 + */ + public final DataType Tin; + + /** + * The type of output Tensor. A tf.DType from: tf.qint8, tf.qint32 + */ + public final DataType Tout; + + /** + * The quantization axis that was used when quantizing original data that {@code input} represents. + * Indicates the dimension index of the tensor where per-axis quantization is applied for the slices along that dimension. + * If set to -1 (default), this indicates per-tensor quantization. Otherwise, it must be set within range [0, input.dims()). + */ + public final long inputQuantizationAxis; + + /** + * The quantization min value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) to indicate narrow range, where this is set to: + * {@code (Tin lowest) + 1} if narrow range, and {@code (Tin lowest)} otherwise. + * For example, if Tin is qint8, this is set to -127 if narrow range quantized or -128 if not. + */ + public final long inputQuantizationMinVal; + + /** + * The quantization max value that was used when quantizing original data that {@code input} represents. + * The purpose of this attribute is typically (but not limited to) indicate narrow range, where this is set to: + * {@code (Tout max)} for both narrow range and not narrow range. + * For example, if Tin is qint8, this is set to 127. + */ + public final long inputQuantizationMaxVal; + + /** + * The new quantization axis to use to quantize original data that {@code input} represents. + */ + public final long outputQuantizationAxis; + + /** + * The new quantization min value to quantize original data that {@code input} represents. + */ + public final long outputQuantizationMinVal; + + /** + * The new quantization max value to quantize original data that {@code input} represents. + */ + public final long outputQuantizationMaxVal; + + public Inputs(GraphOperation op) { + super(new UniformRequantize<>(op), op, Arrays.asList("Tin", "Tout", "input_quantization_axis", "input_quantization_min_val", "input_quantization_max_val", "output_quantization_axis", "output_quantization_min_val", "output_quantization_max_val")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputScales = (Operand) op.input(inputIndex++); + inputZeroPoints = (Operand) op.input(inputIndex++); + outputScales = (Operand) op.input(inputIndex++); + outputZeroPoints = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrType("Tin"); + Tout = op.attributes().getAttrType("Tout"); + inputQuantizationAxis = op.attributes().getAttrInt("input_quantization_axis"); + inputQuantizationMinVal = op.attributes().getAttrInt("input_quantization_min_val"); + inputQuantizationMaxVal = op.attributes().getAttrInt("input_quantization_max_val"); + outputQuantizationAxis = op.attributes().getAttrInt("output_quantization_axis"); + outputQuantizationMinVal = op.attributes().getAttrInt("output_quantization_min_val"); + outputQuantizationMaxVal = op.attributes().getAttrInt("output_quantization_max_val"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java index 833005da978..0aadded3990 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -36,9 +42,11 @@ * the value in {@code weights} at each index where the corresponding value in {@code arr} is * {@code i}. *

    Values in {@code arr} outside of the range [0, size) are ignored. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RaggedBincount.OP_NAME, + inputsClass = RaggedBincount.Inputs.class +) @Operator( group = "ragged" ) @@ -50,8 +58,8 @@ public final class RaggedBincount extends RawOp implements Op private Output output; - private RaggedBincount(Operation operation) { - super(operation); + public RaggedBincount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -137,4 +145,58 @@ public Options binaryOutput(Boolean binaryOutput) { return this; } } + + @OpInputsMetadata( + outputsClass = RaggedBincount.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1D int64 {@code Tensor}. + */ + public final Operand splits; + + /** + * 2D int {@code Tensor}. + */ + public final Operand values; + + /** + * non-negative int scalar {@code Tensor}. + */ + public final Operand sizeOutput; + + /** + * is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights + * equal to 1. + */ + public final Operand weights; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The T attribute + */ + public final DataType T; + + /** + * bool; Whether the kernel should count the appearance or number of occurrences. + */ + public final boolean binaryOutput; + + public Inputs(GraphOperation op) { + super(new RaggedBincount<>(op), op, Arrays.asList("Tidx", "T", "binary_output")); + int inputIndex = 0; + splits = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + T = op.attributes().getAttrType("T"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java index 9849d5192ff..720919e6873 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a ragged tensor input. * Counts the number of times each value occurs in the input. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = RaggedCountSparseOutput.OP_NAME, + inputsClass = RaggedCountSparseOutput.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedCountSparseOutput extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class RaggedCountSparseOutput extends RawOp { private Output outputDenseShape; - private RaggedCountSparseOutput(Operation operation) { - super(operation); + public RaggedCountSparseOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -176,4 +188,63 @@ public Options maxlength(Long maxlength) { return this; } } + + @OpInputsMetadata( + outputsClass = RaggedCountSparseOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor containing the row splits of the ragged tensor to count. + */ + public final Operand splits; + + /** + * Tensor containing values of the sparse tensor to count. + */ + public final Operand values; + + /** + * A Tensor of the same shape as indices containing per-index weight values. + * May also be the empty tensor if no weights are used. + */ + public final Operand weights; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Minimum value to count. Can be set to -1 for no minimum. + */ + public final long minlength; + + /** + * Maximum value to count. Can be set to -1 for no maximum. + */ + public final long maxlength; + + /** + * Whether to output the number of occurrences of each value or 1. + */ + public final boolean binaryOutput; + + /** + * Dtype of the output values tensor. + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new RaggedCountSparseOutput<>(op), op, Arrays.asList("T", "minlength", "maxlength", "binary_output", "output_type")); + int inputIndex = 0; + splits = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + minlength = op.attributes().getAttrInt("minlength"); + maxlength = op.attributes().getAttrInt("maxlength"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java index 75cde85a9f8..3b356804b4f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,11 +39,14 @@ /** * Generates a feature cross from a list of tensors, and returns it as a * RaggedTensor. See {@code tf.ragged.cross} for more details. - * - * @param data type for {@code output_values} output - * - * @param data type for {@code output_row_splits} output */ +@OpMetadata( + opType = RaggedCross.OP_NAME, + inputsClass = RaggedCross.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedCross extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +57,8 @@ public final class RaggedCross extends RawOp private Output outputRowSplits; - private RaggedCross(Operation operation) { - super(operation); + public RaggedCross(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputValues = operation.output(outputIdx++); outputRowSplits = operation.output(outputIdx++); @@ -68,11 +78,11 @@ private RaggedCross(Operation operation) { * this string specifies the type of the {@code i}th input, and is one of: 'R' (ragged), * 'D' (dense), or 'S' (sparse). This attr is used to ensure that the crossed * values are combined in the order of the inputs from the call to tf.ragged.cross. - * @param hashedOutput the value of the hashedOutput property - * @param numBuckets the value of the numBuckets property - * @param hashKey the value of the hashKey property - * @param outValuesType the value of the outValuesType property - * @param outRowSplitsType the value of the outRowSplitsType property + * @param hashedOutput The value of the hashedOutput attribute + * @param numBuckets The value of the numBuckets attribute + * @param hashKey The value of the hashKey attribute + * @param outValuesType The value of the outValuesType attribute + * @param outRowSplitsType The value of the outRowSplitsType attribute * @param data type for {@code RaggedCross} output and operands * @param data type for {@code RaggedCross} output and operands * @return a new instance of RaggedCross @@ -119,4 +129,125 @@ public Output outputValues() { public Output outputRowSplits() { return outputRowSplits; } + + @OpInputsMetadata( + outputsClass = RaggedCross.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The values tensor for each RaggedTensor input. + */ + public final Iterable> raggedValues; + + /** + * The row_splits tensor for each RaggedTensor input. + */ + public final Iterable> raggedRowSplits; + + /** + * The indices tensor for each SparseTensor input. + */ + public final Iterable> sparseIndices; + + /** + * The values tensor for each SparseTensor input. + */ + public final Iterable> sparseValues; + + /** + * The dense_shape tensor for each SparseTensor input. + */ + public final Iterable> sparseShape; + + /** + * The tf.Tensor inputs. + */ + public final Iterable> denseInputs; + + /** + * String specifying the tensor type for each input. The {@code i}th character in + * this string specifies the type of the {@code i}th input, and is one of: 'R' (ragged), + * 'D' (dense), or 'S' (sparse). This attr is used to ensure that the crossed + * values are combined in the order of the inputs from the call to tf.ragged.cross. + */ + public final String inputOrder; + + /** + * The hashedOutput attribute + */ + public final boolean hashedOutput; + + /** + * The numBuckets attribute + */ + public final long numBuckets; + + /** + * The hashKey attribute + */ + public final long hashKey; + + /** + * The raggedValuesTypes attribute + */ + public final DataType[] raggedValuesTypes; + + /** + * The raggedSplitsTypes attribute + */ + public final DataType[] raggedSplitsTypes; + + /** + * The sparseValuesTypes attribute + */ + public final DataType[] sparseValuesTypes; + + /** + * The denseTypes attribute + */ + public final DataType[] denseTypes; + + /** + * The outValuesType attribute + */ + public final DataType outValuesType; + + /** + * The outRowSplitsType attribute + */ + public final DataType outRowSplitsType; + + public Inputs(GraphOperation op) { + super(new RaggedCross<>(op), op, Arrays.asList("input_order", "hashed_output", "num_buckets", "hash_key", "ragged_values_types", "ragged_splits_types", "sparse_values_types", "dense_types", "out_values_type", "out_row_splits_type")); + int inputIndex = 0; + int raggedValuesLength = op.inputListLength("ragged_values"); + raggedValues = Arrays.asList((Operand[]) op.inputList(inputIndex, raggedValuesLength)); + inputIndex += raggedValuesLength; + int raggedRowSplitsLength = op.inputListLength("ragged_row_splits"); + raggedRowSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, raggedRowSplitsLength)); + inputIndex += raggedRowSplitsLength; + int sparseIndicesLength = op.inputListLength("sparse_indices"); + sparseIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseIndicesLength)); + inputIndex += sparseIndicesLength; + int sparseValuesLength = op.inputListLength("sparse_values"); + sparseValues = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseValuesLength)); + inputIndex += sparseValuesLength; + int sparseShapeLength = op.inputListLength("sparse_shape"); + sparseShape = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseShapeLength)); + inputIndex += sparseShapeLength; + int denseInputsLength = op.inputListLength("dense_inputs"); + denseInputs = Arrays.asList((Operand[]) op.inputList(inputIndex, denseInputsLength)); + inputIndex += denseInputsLength; + inputOrder = op.attributes().getAttrString("input_order"); + hashedOutput = op.attributes().getAttrBool("hashed_output"); + numBuckets = op.attributes().getAttrInt("num_buckets"); + hashKey = op.attributes().getAttrInt("hash_key"); + raggedValuesTypes = op.attributes().getAttrTypeList("ragged_values_types"); + raggedSplitsTypes = op.attributes().getAttrTypeList("ragged_splits_types"); + sparseValuesTypes = op.attributes().getAttrTypeList("sparse_values_types"); + denseTypes = op.attributes().getAttrTypeList("dense_types"); + outValuesType = op.attributes().getAttrType("out_values_type"); + outRowSplitsType = op.attributes().getAttrType("out_row_splits_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRows.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRows.java new file mode 100644 index 00000000000..d8414fd1ae3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRows.java @@ -0,0 +1,171 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The RaggedFillEmptyRows operation + */ +@OpMetadata( + opType = RaggedFillEmptyRows.OP_NAME, + inputsClass = RaggedFillEmptyRows.Inputs.class +) +@Operator( + group = "ragged" +) +public final class RaggedFillEmptyRows extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedFillEmptyRows"; + + private Output outputValueRowids; + + private Output outputValues; + + private Output emptyRowIndicator; + + private Output reverseIndexMap; + + public RaggedFillEmptyRows(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputValueRowids = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + emptyRowIndicator = operation.output(outputIdx++); + reverseIndexMap = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RaggedFillEmptyRows operation. + * + * @param scope current scope + * @param valueRowids The valueRowids value + * @param values The values value + * @param nrows The nrows value + * @param defaultValue The defaultValue value + * @param data type for {@code RaggedFillEmptyRows} output and operands + * @return a new instance of RaggedFillEmptyRows + */ + @Endpoint( + describeByClass = true + ) + public static RaggedFillEmptyRows create(Scope scope, + Operand valueRowids, Operand values, Operand nrows, + Operand defaultValue) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedFillEmptyRows"); + opBuilder.addInput(valueRowids.asOutput()); + opBuilder.addInput(values.asOutput()); + opBuilder.addInput(nrows.asOutput()); + opBuilder.addInput(defaultValue.asOutput()); + return new RaggedFillEmptyRows<>(opBuilder.build()); + } + + /** + * Gets outputValueRowids. + * + * @return outputValueRowids. + */ + public Output outputValueRowids() { + return outputValueRowids; + } + + /** + * Gets outputValues. + * + * @return outputValues. + */ + public Output outputValues() { + return outputValues; + } + + /** + * Gets emptyRowIndicator. + * + * @return emptyRowIndicator. + */ + public Output emptyRowIndicator() { + return emptyRowIndicator; + } + + /** + * Gets reverseIndexMap. + * + * @return reverseIndexMap. + */ + public Output reverseIndexMap() { + return reverseIndexMap; + } + + @OpInputsMetadata( + outputsClass = RaggedFillEmptyRows.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The valueRowids input + */ + public final Operand valueRowids; + + /** + * The values input + */ + public final Operand values; + + /** + * The nrows input + */ + public final Operand nrows; + + /** + * The defaultValue input + */ + public final Operand defaultValue; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RaggedFillEmptyRows<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + valueRowids = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + nrows = (Operand) op.input(inputIndex++); + defaultValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRowsGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRowsGrad.java new file mode 100644 index 00000000000..314e4a689af --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedFillEmptyRowsGrad.java @@ -0,0 +1,129 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * The RaggedFillEmptyRowsGrad operation + */ +@OpMetadata( + opType = RaggedFillEmptyRowsGrad.OP_NAME, + inputsClass = RaggedFillEmptyRowsGrad.Inputs.class +) +@Operator( + group = "ragged" +) +public final class RaggedFillEmptyRowsGrad extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedFillEmptyRowsGrad"; + + private Output dValues; + + private Output dDefaultValue; + + public RaggedFillEmptyRowsGrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + dValues = operation.output(outputIdx++); + dDefaultValue = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RaggedFillEmptyRowsGrad operation. + * + * @param scope current scope + * @param reverseIndexMap The reverseIndexMap value + * @param gradValues The gradValues value + * @param data type for {@code RaggedFillEmptyRowsGrad} output and operands + * @return a new instance of RaggedFillEmptyRowsGrad + */ + @Endpoint( + describeByClass = true + ) + public static RaggedFillEmptyRowsGrad create(Scope scope, + Operand reverseIndexMap, Operand gradValues) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RaggedFillEmptyRowsGrad"); + opBuilder.addInput(reverseIndexMap.asOutput()); + opBuilder.addInput(gradValues.asOutput()); + return new RaggedFillEmptyRowsGrad<>(opBuilder.build()); + } + + /** + * Gets dValues. + * + * @return dValues. + */ + public Output dValues() { + return dValues; + } + + /** + * Gets dDefaultValue. + * + * @return dDefaultValue. + */ + public Output dDefaultValue() { + return dDefaultValue; + } + + @OpInputsMetadata( + outputsClass = RaggedFillEmptyRowsGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The reverseIndexMap input + */ + public final Operand reverseIndexMap; + + /** + * The gradValues input + */ + public final Operand gradValues; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RaggedFillEmptyRowsGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + reverseIndexMap = (Operand) op.input(inputIndex++); + gradValues = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java index 29020d73c27..3c71b9987c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -50,11 +56,14 @@ * *

    (Note: This c++ op is used to implement the higher-level python * {@code tf.ragged.gather} op, which also supports ragged indices.) - * - * @param data type for {@code output_nested_splits} output - * - * @param data type for {@code output_dense_values} output */ +@OpMetadata( + opType = RaggedGather.OP_NAME, + inputsClass = RaggedGather.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedGather extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -66,8 +75,8 @@ public final class RaggedGather extends RawO private Output outputDenseValues; @SuppressWarnings("unchecked") - private RaggedGather(Operation operation) { - super(operation); + public RaggedGather(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); outputNestedSplits = Arrays.asList((Output[]) operation.outputList(outputIdx, outputNestedSplitsLength)); @@ -125,4 +134,56 @@ public List> outputNestedSplits() { public Output outputDenseValues() { return outputDenseValues; } + + @OpInputsMetadata( + outputsClass = RaggedGather.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The {@code nested_row_splits} tensors that define the row-partitioning for the + * {@code params} RaggedTensor input. + */ + public final Iterable> paramsNestedSplits; + + /** + * The {@code flat_values} for the {@code params} RaggedTensor. There was a terminology change + * at the python level from dense_values to flat_values, so dense_values is the + * deprecated name. + */ + public final Operand paramsDenseValues; + + /** + * Indices in the outermost dimension of {@code params} of the values that should be + * gathered. + */ + public final Operand indices; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new RaggedGather<>(op), op, Arrays.asList("Tvalues", "Tindices", "Tsplits")); + int inputIndex = 0; + int paramsNestedSplitsLength = op.inputListLength("params_nested_splits"); + paramsNestedSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, paramsNestedSplitsLength)); + inputIndex += paramsNestedSplitsLength; + paramsDenseValues = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + Tvalues = op.attributes().getAttrType("Tvalues"); + Tindices = op.attributes().getAttrType("Tindices"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java index ae472c28100..39a6487398e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -43,11 +50,14 @@ *

    The input tensors {@code starts}, {@code limits}, and {@code deltas} may be scalars or vectors. * The vector inputs must all have the same size. Scalar inputs are broadcast * to match the size of the vector inputs. - * - * @param data type for {@code rt_nested_splits} output - * - * @param data type for {@code rt_dense_values} output */ +@OpMetadata( + opType = RaggedRange.OP_NAME, + inputsClass = RaggedRange.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedRange extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -58,8 +68,8 @@ public final class RaggedRange extends Raw private Output rtDenseValues; - private RaggedRange(Operation operation) { - super(operation); + public RaggedRange(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; rtNestedSplits = operation.output(outputIdx++); rtDenseValues = operation.output(outputIdx++); @@ -72,7 +82,7 @@ private RaggedRange(Operation operation) { * @param starts The starts of each range. * @param limits The limits of each range. * @param deltas The deltas of each range. - * @param Tsplits the value of the Tsplits property + * @param Tsplits The value of the Tsplits attribute * @param data type for {@code RaggedRange} output and operands * @param data type for {@code RaggedRange} output and operands * @return a new instance of RaggedRange @@ -125,4 +135,44 @@ public Output rtNestedSplits() { public Output rtDenseValues() { return rtDenseValues; } + + @OpInputsMetadata( + outputsClass = RaggedRange.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The starts of each range. + */ + public final Operand starts; + + /** + * The limits of each range. + */ + public final Operand limits; + + /** + * The deltas of each range. + */ + public final Operand deltas; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new RaggedRange<>(op), op, Arrays.asList("T", "Tsplits")); + int inputIndex = 0; + starts = (Operand) op.input(inputIndex++); + limits = (Operand) op.input(inputIndex++); + deltas = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java index 22dd0d2803f..5e9e6cae9a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,20 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -44,11 +50,14 @@ * values of the decoded {@code RaggedTensor}. If {@code input_ragged_rank} is -1, then it is * inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)}. See * {@code RaggedTensorToVariant} for the corresponding encoding logic. - * - * @param data type for {@code output_nested_splits} output - * - * @param data type for {@code output_dense_values} output */ +@OpMetadata( + opType = RaggedTensorFromVariant.OP_NAME, + inputsClass = RaggedTensorFromVariant.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedTensorFromVariant extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -60,8 +69,8 @@ public final class RaggedTensorFromVariant e private Output outputDenseValues; @SuppressWarnings("unchecked") - private RaggedTensorFromVariant(Operation operation) { - super(operation); + public RaggedTensorFromVariant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); outputNestedSplits = Arrays.asList((Output[]) operation.outputList(outputIdx, outputNestedSplitsLength)); @@ -78,8 +87,8 @@ private RaggedTensorFromVariant(Operation operation) { * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. - * @param Tvalues the value of the Tvalues property - * @param Tsplits the value of the Tsplits property + * @param Tvalues The value of the Tvalues attribute + * @param Tsplits The value of the Tsplits attribute * @param data type for {@code RaggedTensorFromVariant} output and operands * @param data type for {@code RaggedTensorFromVariant} output and operands * @return a new instance of RaggedTensorFromVariant @@ -108,7 +117,7 @@ public static RaggedTensorFromVariant * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. - * @param Tvalues the value of the Tvalues property + * @param Tvalues The value of the Tvalues attribute * @param data type for {@code RaggedTensorFromVariant} output and operands * @return a new instance of RaggedTensorFromVariant, with default output types */ @@ -139,4 +148,39 @@ public List> outputNestedSplits() { public Output outputDenseValues() { return outputDenseValues; } + + @OpInputsMetadata( + outputsClass = RaggedTensorFromVariant.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code variant} Tensor containing encoded {@code RaggedTensor}s. + */ + public final Operand encodedRagged; + + /** + * The ragged rank of each encoded {@code RaggedTensor} component in the input. If set to + * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} + */ + public final long inputRaggedRank; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new RaggedTensorFromVariant<>(op), op, Arrays.asList("input_ragged_rank", "Tvalues", "Tsplits")); + int inputIndex = 0; + encodedRagged = (Operand) op.input(inputIndex++); + inputRaggedRank = op.attributes().getAttrInt("input_ragged_rank"); + Tvalues = op.attributes().getAttrType("Tvalues"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java index 36cde5a2809..e765d995332 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +41,14 @@ * input=ragged.from_nested_row_splits(rt_dense_values, rt_nested_splits) * output=SparseTensor(indices=sparse_indices, values=sparse_values, * dense_shape=sparse_dense_shape) - * - * @param data type for {@code sparse_values} output */ +@OpMetadata( + opType = RaggedTensorToSparse.OP_NAME, + inputsClass = RaggedTensorToSparse.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedTensorToSparse extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -49,8 +61,8 @@ public final class RaggedTensorToSparse extends RawOp { private Output sparseDenseShape; - private RaggedTensorToSparse(Operation operation) { - super(operation); + public RaggedTensorToSparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseIndices = operation.output(outputIdx++); sparseValues = operation.output(outputIdx++); @@ -103,4 +115,40 @@ public Output sparseValues() { public Output sparseDenseShape() { return sparseDenseShape; } + + @OpInputsMetadata( + outputsClass = RaggedTensorToSparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The {@code row_splits} for the {@code RaggedTensor}. + */ + public final Iterable> rtNestedSplits; + + /** + * The {@code flat_values} for the {@code RaggedTensor}. + */ + public final Operand rtDenseValues; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new RaggedTensorToSparse<>(op), op, Arrays.asList("T", "Tsplits")); + int inputIndex = 0; + int rtNestedSplitsLength = op.inputListLength("rt_nested_splits"); + rtNestedSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, rtNestedSplitsLength)); + inputIndex += rtNestedSplitsLength; + rtDenseValues = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java index abe485f6628..1bbb93a9327 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,22 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -47,9 +54,14 @@ *

  • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it * is preceded by "FIRST_DIM_SIZE".
  • * - * - * @param data type for {@code result} output */ +@OpMetadata( + opType = RaggedTensorToTensor.OP_NAME, + inputsClass = RaggedTensorToTensor.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedTensorToTensor extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -58,8 +70,8 @@ public final class RaggedTensorToTensor extends RawOp implement private Output result; - private RaggedTensorToTensor(Operation operation) { - super(operation); + public RaggedTensorToTensor(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; result = operation.output(outputIdx++); } @@ -90,7 +102,7 @@ private RaggedTensorToTensor(Operation operation) { * then overwritten by values in the ragged tensor. The default value must be * compatible with this broadcast operation, and must have fewer dimensions than * the value tensor. - * @param rowPartitionTensors the rowPartitionTensors value + * @param rowPartitionTensors The rowPartitionTensors value * @param rowPartitionTypes The types of the row partition tensors. At present, these can be: *
      *
    • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
    • @@ -134,4 +146,90 @@ public Output result() { public Output asOutput() { return result; } + + @OpInputsMetadata( + outputsClass = RaggedTensorToTensor.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The desired shape of the output tensor. If left unspecified (empty), + * the minimal shape required to contain all the elements in the ragged tensor + * (the natural shape) will be used. If some dimensions are left unspecified, then + * the size of the natural shape is used in that dimension. + *

      Note that dense dimensions cannot be modified by the shape argument. Trying to + * change the size of a dense dimension will cause the op to fail. + * Examples: + * natural shape: [4, 5, 6] + * shape: -1 + * output shape: [4, 5, 6] + *

      natural shape: [4, 5, 6] + * shape: [3, -1, 2] + * output shape: [3, 5, 2] + *

      natural shape: [4, 5, 6] + * shape: [3, 7, 2] + * output shape: [3, 7, 2] + */ + public final Operand shape; + + /** + * A 1D tensor representing the values of the ragged tensor. + */ + public final Operand values; + + /** + * The default_value when the shape is larger than the ragged tensor. The + * default_value is broadcast until it is the shape of the output tensor, and + * then overwritten by values in the ragged tensor. The default value must be + * compatible with this broadcast operation, and must have fewer dimensions than + * the value tensor. + */ + public final Operand defaultValue; + + /** + * The rowPartitionTensors input + */ + public final Iterable> rowPartitionTensors; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindex attribute + */ + public final DataType Tindex; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + /** + * The types of the row partition tensors. At present, these can be: + *

        + *
      • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
      • + *
      • "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor.
      • + *
      • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it + * is preceeded by "FIRST_DIM_SIZE". + * The tensors are in the order of the dimensions.
      • + *
      + */ + public final String[] rowPartitionTypes; + + public Inputs(GraphOperation op) { + super(new RaggedTensorToTensor<>(op), op, Arrays.asList("T", "Tindex", "Tshape", "row_partition_types")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + defaultValue = (Operand) op.input(inputIndex++); + int rowPartitionTensorsLength = op.inputListLength("row_partition_tensors"); + rowPartitionTensors = Arrays.asList((Operand[]) op.inputList(inputIndex, rowPartitionTensorsLength)); + inputIndex += rowPartitionTensorsLength; + T = op.attributes().getAttrType("T"); + Tindex = op.attributes().getAttrType("Tindex"); + Tshape = op.attributes().getAttrType("Tshape"); + rowPartitionTypes = op.attributes().getAttrStringList("row_partition_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java index c757c916ad2..48918309097 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,6 +48,13 @@ * is wrapped in a scalar {@code variant} Tensor. See {@code RaggedTensorFromVariant} for the * corresponding decoding logic. */ +@OpMetadata( + opType = RaggedTensorToVariant.OP_NAME, + inputsClass = RaggedTensorToVariant.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedTensorToVariant extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -50,8 +64,8 @@ public final class RaggedTensorToVariant extends RawOp implements Operand private Output encodedRagged; @SuppressWarnings("unchecked") - private RaggedTensorToVariant(Operation operation) { - super(operation); + public RaggedTensorToVariant(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; encodedRagged = operation.output(outputIdx++); } @@ -93,4 +107,47 @@ public Output encodedRagged() { public Output asOutput() { return (Output) encodedRagged; } + + @OpInputsMetadata( + outputsClass = RaggedTensorToVariant.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of one or more Tensors representing the splits of the input + * {@code RaggedTensor}. + */ + public final Iterable> rtNestedSplits; + + /** + * A Tensor representing the values of the input {@code RaggedTensor}. + */ + public final Operand rtDenseValues; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + /** + * A {@code bool} denoting whether the input is a batched {@code RaggedTensor}. + */ + public final boolean batchedInput; + + public Inputs(GraphOperation op) { + super(new RaggedTensorToVariant(op), op, Arrays.asList("Tvalues", "Tsplits", "batched_input")); + int inputIndex = 0; + int rtNestedSplitsLength = op.inputListLength("rt_nested_splits"); + rtNestedSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, rtNestedSplitsLength)); + inputIndex += rtNestedSplitsLength; + rtDenseValues = (Operand) op.input(inputIndex++); + Tvalues = op.attributes().getAttrType("Tvalues"); + Tsplits = op.attributes().getAttrType("Tsplits"); + batchedInput = op.attributes().getAttrBool("batched_input"); + } + } } 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 index 6179c50fae2..ca254cd1cf5 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.ragged; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,9 +42,14 @@ * 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 dense_values_grad} output */ +@OpMetadata( + opType = RaggedTensorToVariantGradient.OP_NAME, + inputsClass = RaggedTensorToVariantGradient.Inputs.class +) +@Operator( + group = "ragged" +) public final class RaggedTensorToVariantGradient extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class RaggedTensorToVariantGradient extends RawOp private Output denseValuesGrad; - private RaggedTensorToVariantGradient(Operation operation) { - super(operation); + public RaggedTensorToVariantGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; denseValuesGrad = operation.output(outputIdx++); } @@ -60,7 +72,7 @@ private RaggedTensorToVariantGradient(Operation operation) { * @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 the value of the Tvalues property + * @param Tvalues The value of the Tvalues attribute * @param data type for {@code RaggedTensorToVariantGradient} output and operands * @return a new instance of RaggedTensorToVariantGradient */ @@ -91,4 +103,45 @@ public Output denseValuesGrad() { public Output asOutput() { return denseValuesGrad; } + + @OpInputsMetadata( + outputsClass = RaggedTensorToVariantGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A {@code variant} Tensor containing encoded {@code RaggedTensor} gradients. + */ + public final Operand encodedRaggedGrad; + + /** + * Outermost row-splits that were used as input to the RaggedTensorToVariant op. + */ + public final Operand rowSplits; + + /** + * Shape of the dense_values that was used as an input to the + * RaggedTensorToVariant op. + */ + public final Operand denseValuesShape; + + /** + * The Tvalues attribute + */ + public final DataType Tvalues; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new RaggedTensorToVariantGradient<>(op), op, Arrays.asList("Tvalues", "Tsplits")); + int inputIndex = 0; + encodedRaggedGrad = (Operand) op.input(inputIndex++); + rowSplits = (Operand) op.input(inputIndex++); + denseValuesShape = (Operand) op.input(inputIndex++); + Tvalues = op.attributes().getAttrType("Tvalues"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java index 2eac70e8b6b..aa36bccf654 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -38,6 +43,10 @@ * the sampled candidates must be chosen independently of the context and of the * true labels. */ +@OpMetadata( + opType = AllCandidateSampler.OP_NAME, + inputsClass = AllCandidateSampler.Inputs.class +) @Operator( group = "random" ) @@ -53,8 +62,8 @@ public final class AllCandidateSampler extends RawOp { private Output sampledExpectedCount; - private AllCandidateSampler(Operation operation) { - super(operation); + public AllCandidateSampler(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sampledCandidates = operation.output(outputIdx++); trueExpectedCount = operation.output(outputIdx++); @@ -188,4 +197,55 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = AllCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to produce. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new AllCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java index 00f7806ee8d..e7557a8d4c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * The AnonymousRandomSeedGenerator operation */ +@OpMetadata( + opType = AnonymousRandomSeedGenerator.OP_NAME, + inputsClass = AnonymousRandomSeedGenerator.Inputs.class +) +@Operator( + group = "random" +) public final class AnonymousRandomSeedGenerator extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +54,8 @@ public final class AnonymousRandomSeedGenerator extends RawOp { private Output deleter; @SuppressWarnings("unchecked") - private AnonymousRandomSeedGenerator(Operation operation) { - super(operation); + public AnonymousRandomSeedGenerator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); deleter = operation.output(outputIdx++); @@ -52,8 +65,8 @@ private AnonymousRandomSeedGenerator(Operation operation) { * Factory method to create a class wrapping a new AnonymousRandomSeedGenerator operation. * * @param scope current scope - * @param seed the seed value - * @param seed2 the seed2 value + * @param seed The seed value + * @param seed2 The seed2 value * @return a new instance of AnonymousRandomSeedGenerator */ @Endpoint( @@ -84,4 +97,26 @@ public Output handle() { public Output deleter() { return deleter; } + + @OpInputsMetadata( + outputsClass = AnonymousRandomSeedGenerator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The seed input + */ + public final Operand seed; + + /** + * The seed2 input + */ + public final Operand seed2; + + public Inputs(GraphOperation op) { + super(new AnonymousRandomSeedGenerator(op), op, Arrays.asList()); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java index d9fa99bec9c..1344c1ad9e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -31,6 +37,13 @@ /** * The AnonymousSeedGenerator operation */ +@OpMetadata( + opType = AnonymousSeedGenerator.OP_NAME, + inputsClass = AnonymousSeedGenerator.Inputs.class +) +@Operator( + group = "random" +) public final class AnonymousSeedGenerator extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class AnonymousSeedGenerator extends RawOp { private Output deleter; @SuppressWarnings("unchecked") - private AnonymousSeedGenerator(Operation operation) { - super(operation); + public AnonymousSeedGenerator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); deleter = operation.output(outputIdx++); @@ -53,9 +66,9 @@ private AnonymousSeedGenerator(Operation operation) { * Factory method to create a class wrapping a new AnonymousSeedGenerator operation. * * @param scope current scope - * @param seed the seed value - * @param seed2 the seed2 value - * @param reshuffle the reshuffle value + * @param seed The seed value + * @param seed2 The seed2 value + * @param reshuffle The reshuffle value * @return a new instance of AnonymousSeedGenerator */ @Endpoint( @@ -87,4 +100,32 @@ public Output handle() { public Output deleter() { return deleter; } + + @OpInputsMetadata( + outputsClass = AnonymousSeedGenerator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The seed input + */ + public final Operand seed; + + /** + * The seed2 input + */ + public final Operand seed2; + + /** + * The reshuffle input + */ + public final Operand reshuffle; + + public Inputs(GraphOperation op) { + super(new AnonymousSeedGenerator(op), op, Arrays.asList()); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + seed2 = (Operand) op.input(inputIndex++); + reshuffle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java index 934a3184728..32b867106f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,33 +17,46 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DeleteRandomSeedGenerator operation */ +@OpMetadata( + opType = DeleteRandomSeedGenerator.OP_NAME, + inputsClass = DeleteRandomSeedGenerator.Inputs.class +) +@Operator( + group = "random" +) public final class DeleteRandomSeedGenerator extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "DeleteRandomSeedGenerator"; - private DeleteRandomSeedGenerator(Operation operation) { - super(operation); + public DeleteRandomSeedGenerator(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new DeleteRandomSeedGenerator operation. * * @param scope current scope - * @param handle the handle value - * @param deleter the deleter value + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteRandomSeedGenerator */ @Endpoint( @@ -56,4 +69,26 @@ public static DeleteRandomSeedGenerator create(Scope scope, Operand { + /** + * The handle input + */ + public final Operand handle; + + /** + * The deleter input + */ + public final Operand deleter; + + public Inputs(GraphOperation op) { + super(new DeleteRandomSeedGenerator(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + deleter = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java index e3b8b8deb23..463a9ba87a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,33 +17,46 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DeleteSeedGenerator operation */ +@OpMetadata( + opType = DeleteSeedGenerator.OP_NAME, + inputsClass = DeleteSeedGenerator.Inputs.class +) +@Operator( + group = "random" +) public final class DeleteSeedGenerator extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "DeleteSeedGenerator"; - private DeleteSeedGenerator(Operation operation) { - super(operation); + public DeleteSeedGenerator(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new DeleteSeedGenerator operation. * * @param scope current scope - * @param handle the handle value - * @param deleter the deleter value + * @param handle The handle value + * @param deleter The deleter value * @return a new instance of DeleteSeedGenerator */ @Endpoint( @@ -56,4 +69,26 @@ public static DeleteSeedGenerator create(Scope scope, Operand h opBuilder.addInput(deleter.asOutput()); return new DeleteSeedGenerator(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = DeleteSeedGenerator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle input + */ + public final Operand handle; + + /** + * The deleter input + */ + public final Operand deleter; + + public Inputs(GraphOperation op) { + super(new DeleteSeedGenerator(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + deleter = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DummySeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DummySeedGenerator.java index 29de27f6982..a73f248e303 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DummySeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DummySeedGenerator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The DummySeedGenerator operation */ +@OpMetadata( + opType = DummySeedGenerator.OP_NAME, + inputsClass = DummySeedGenerator.Inputs.class +) +@Operator( + group = "random" +) public final class DummySeedGenerator extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class DummySeedGenerator extends RawOp implements Operand { private Output handle; @SuppressWarnings("unchecked") - private DummySeedGenerator(Operation operation) { - super(operation); + public DummySeedGenerator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -72,4 +85,14 @@ public Output handle() { public Output asOutput() { return (Output) handle; } + + @OpInputsMetadata( + outputsClass = DummySeedGenerator.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new DummySeedGenerator(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java index a07c10ab017..9e1268e46d9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -38,6 +43,10 @@ * the sampled candidates must be chosen independently of the context and of the * true labels. */ +@OpMetadata( + opType = LogUniformCandidateSampler.OP_NAME, + inputsClass = LogUniformCandidateSampler.Inputs.class +) @Operator( group = "random" ) @@ -53,8 +62,8 @@ public final class LogUniformCandidateSampler extends RawOp { private Output sampledExpectedCount; - private LogUniformCandidateSampler(Operation operation) { - super(operation); + public LogUniformCandidateSampler(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sampledCandidates = operation.output(outputIdx++); trueExpectedCount = operation.output(outputIdx++); @@ -190,4 +199,61 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = LogUniformCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to randomly sample. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * The sampler will sample integers from the interval [0, range_max). + */ + public final long rangeMax; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new LogUniformCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "range_max", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + rangeMax = op.attributes().getAttrInt("range_max"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java index dbcae3bd724..c4625651dc9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Draws samples from a multinomial distribution. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Multinomial.OP_NAME, + inputsClass = Multinomial.Inputs.class +) @Operator( group = "random" ) @@ -46,8 +54,8 @@ public final class Multinomial extends RawOp implements Opera private Output output; - private Multinomial(Operation operation) { - super(operation); + public Multinomial(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,7 +67,7 @@ private Multinomial(Operation operation) { * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. - * @param outputDtype the value of the outputDtype property + * @param outputDtype The value of the outputDtype attribute * @param options carries optional attribute values * @param data type for {@code Multinomial} output and operands * @return a new instance of Multinomial @@ -101,7 +109,7 @@ public static Multinomial create(Scope scope, describeByClass = true ) public static Multinomial create(Scope scope, Operand logits, - Operand numSamples, Options[] options) { + Operand numSamples, Options... options) { return create(scope, logits, numSamples, TInt64.class, options); } @@ -175,4 +183,52 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = Multinomial.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} + * represents the unnormalized log probabilities for all classes. + */ + public final Operand logits; + + /** + * 0-D. Number of independent samples to draw for each row slice. + */ + public final Operand numSamples; + + /** + * If either seed or seed2 is set to be non-zero, the internal random number + * generator is seeded by the given seed. Otherwise, a random seed is used. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The outputDtype attribute + */ + public final DataType outputDtype; + + public Inputs(GraphOperation op) { + super(new Multinomial<>(op), op, Arrays.asList("seed", "seed2", "T", "output_dtype")); + int inputIndex = 0; + logits = (Operand) op.input(inputIndex++); + numSamples = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + T = op.attributes().getAttrType("T"); + outputDtype = op.attributes().getAttrType("output_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java index 85b5e80aab5..83f81ee6c51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,35 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Non-deterministically generates some integers. * This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = NonDeterministicInts.OP_NAME, + inputsClass = NonDeterministicInts.Inputs.class +) +@Operator( + group = "random" +) public final class NonDeterministicInts extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class NonDeterministicInts extends RawOp implement private Output output; - private NonDeterministicInts(Operation operation) { - super(operation); + public NonDeterministicInts(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -95,4 +107,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = NonDeterministicInts.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new NonDeterministicInts<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java index bd1553dfbfa..4bc87b4da51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Outputs random values from a normal distribution. The parameters may each be a * scalar which applies to the entire output, or a vector of length shape[0] which * stores the parameters for each batch. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ParameterizedTruncatedNormal.OP_NAME, + inputsClass = ParameterizedTruncatedNormal.Inputs.class +) @Operator( group = "random" ) @@ -45,8 +53,8 @@ public final class ParameterizedTruncatedNormal extends RawOp private Output output; - private ParameterizedTruncatedNormal(Operation operation) { - super(operation); + public ParameterizedTruncatedNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -162,4 +170,71 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = ParameterizedTruncatedNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. Batches are indexed by the 0th dimension. + */ + public final Operand shape; + + /** + * The mean parameter of each batch. + */ + public final Operand means; + + /** + * The standard deviation parameter of each batch. Must be greater than 0. + */ + public final Operand stdevs; + + /** + * The minimum cutoff. May be -infinity. + */ + public final Operand minvals; + + /** + * The maximum cutoff. May be +infinity, and must be more than the minval + * for each batch. + */ + public final Operand maxvals; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ParameterizedTruncatedNormal<>(op), op, Arrays.asList("seed", "seed2", "dtype", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + means = (Operand) op.input(inputIndex++); + stdevs = (Operand) op.input(inputIndex++); + minvals = (Operand) op.input(inputIndex++); + maxvals = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java index e16823d482c..cc1a0ab9ba6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +38,11 @@ * This op uses the algorithm by Marsaglia et al. to acquire samples via * transformation-rejection from pairs of uniform and normal random variables. * See http://dl.acm.org/citation.cfm?id=358414 - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomGamma.OP_NAME, + inputsClass = RandomGamma.Inputs.class +) @Operator( group = "random" ) @@ -46,8 +54,8 @@ public final class RandomGamma extends RawOp implements Opera private Output output; - private RandomGamma(Operation operation) { - super(operation); + public RandomGamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -158,4 +166,54 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomGamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D integer tensor. Shape of independent samples to draw from each + * distribution described by the shape parameters given in alpha. + */ + public final Operand shape; + + /** + * A tensor in which each scalar is a "shape" parameter describing the + * associated gamma distribution. + */ + public final Operand alpha; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomGamma<>(op), op, Arrays.asList("seed", "seed2", "S", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + S = op.attributes().getAttrType("S"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java index 09c333cfa32..4ab62242717 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the derivative of a Gamma random sample w.r.t. {@code alpha}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomGammaGrad.OP_NAME, + inputsClass = RandomGammaGrad.Inputs.class +) +@Operator( + group = "random" +) public final class RandomGammaGrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class RandomGammaGrad extends RawOp implements O private Output output; - private RandomGammaGrad(Operation operation) { - super(operation); + public RandomGammaGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -49,8 +61,8 @@ private RandomGammaGrad(Operation operation) { * Factory method to create a class wrapping a new RandomGammaGrad operation. * * @param scope current scope - * @param alpha the alpha value - * @param sample the sample value + * @param alpha The alpha value + * @param sample The sample value * @param data type for {@code RandomGammaGrad} output and operands * @return a new instance of RandomGammaGrad */ @@ -78,4 +90,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RandomGammaGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The alpha input + */ + public final Operand alpha; + + /** + * The sample input + */ + public final Operand sample; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomGammaGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + alpha = (Operand) op.input(inputIndex++); + sample = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java index e38a0d7cff3..8abad16a003 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -39,9 +45,11 @@ * random variables. * See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer * Programming, Volume 2. Addison Wesley - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomPoisson.OP_NAME, + inputsClass = RandomPoisson.Inputs.class +) @Operator( group = "random" ) @@ -53,8 +61,8 @@ public final class RandomPoisson extends RawOp implements Ope private Output output; - private RandomPoisson(Operation operation) { - super(operation); + public RandomPoisson(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private RandomPoisson(Operation operation) { * distribution described by the shape parameters given in rate. * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param dtype the value of the dtype property + * @param dtype The value of the dtype attribute * @param options carries optional attribute values * @param data type for {@code RandomPoissonV2} output and operands * @return a new instance of RandomPoisson @@ -110,7 +118,7 @@ public static RandomPoisson create(Scope scope, describeByClass = true ) public static RandomPoisson create(Scope scope, Operand shape, - Operand rate, Options[] options) { + Operand rate, Options... options) { return create(scope, shape, rate, TInt64.class, options); } @@ -187,4 +195,60 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomPoisson.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D integer tensor. Shape of independent samples to draw from each + * distribution described by the shape parameters given in rate. + */ + public final Operand shape; + + /** + * A tensor in which each scalar is a "rate" parameter describing the + * associated poisson distribution. + */ + public final Operand rate; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The R attribute + */ + public final DataType R; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new RandomPoisson<>(op), op, Arrays.asList("seed", "seed2", "S", "R", "dtype")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + rate = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + S = op.attributes().getAttrType("S"); + R = op.attributes().getAttrType("R"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java index 1fae5771e0a..517900e7df1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ * [3, 4], ==> [1, 2], * [5, 6]] [3, 4]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomShuffle.OP_NAME, + inputsClass = RandomShuffle.Inputs.class +) @Operator( group = "random" ) @@ -51,8 +59,8 @@ public final class RandomShuffle extends RawOp implements Opera private Output output; - private RandomShuffle(Operation operation) { - super(operation); + public RandomShuffle(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -158,4 +166,40 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomShuffle.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be shuffled. + */ + public final Operand value; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomShuffle<>(op), op, Arrays.asList("seed", "seed2", "T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java index 2d6d6bdd0a7..322fe10883c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Outputs random values from a normal distribution. * The generated values will have mean 0 and standard deviation 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomStandardNormal.OP_NAME, + inputsClass = RandomStandardNormal.Inputs.class +) @Operator( group = "random" ) @@ -45,8 +53,8 @@ public final class RandomStandardNormal extends RawOp impleme private Output output; - private RandomStandardNormal(Operation operation) { - super(operation); + public RandomStandardNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -153,4 +161,46 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomStandardNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomStandardNormal<>(op), op, Arrays.asList("seed", "seed2", "dtype", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java index 87228ae9475..5940994392c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Outputs random values from a uniform distribution. * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomUniform.OP_NAME, + inputsClass = RandomUniform.Inputs.class +) @Operator( group = "random" ) @@ -46,8 +54,8 @@ public final class RandomUniform extends RawOp implements Ope private Output output; - private RandomUniform(Operation operation) { - super(operation); + public RandomUniform(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -154,4 +162,46 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomUniform.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomUniform<>(op), op, Arrays.asList("seed", "seed2", "dtype", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java index 9b33f2c9862..6eba6a6c8b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +41,11 @@ *

      The random integers are slightly biased unless {@code maxval - minval} is an exact * power of two. The bias is small for values of {@code maxval - minval} significantly * smaller than the range of the output (either {@code 2^32} or {@code 2^64}). - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = RandomUniformInt.OP_NAME, + inputsClass = RandomUniformInt.Inputs.class +) @Operator( group = "random" ) @@ -49,8 +57,8 @@ public final class RandomUniformInt extends RawOp implements private Output output; - private RandomUniformInt(Operation operation) { - super(operation); + public RandomUniformInt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -159,4 +167,58 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = RandomUniformInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 0-D. Inclusive lower bound on the generated integers. + */ + public final Operand minval; + + /** + * 0-D. Exclusive upper bound on the generated integers. + */ + public final Operand maxval; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The Tout attribute + */ + public final DataType Tout; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new RandomUniformInt<>(op), op, Arrays.asList("seed", "seed2", "Tout", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + minval = (Operand) op.input(inputIndex++); + maxval = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + Tout = op.attributes().getAttrType("Tout"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java index f9539c97f95..457c9a420b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Emits randomized records. */ +@OpMetadata( + opType = RecordInput.OP_NAME, + inputsClass = RecordInput.Inputs.class +) @Operator( group = "random" ) @@ -41,8 +50,8 @@ public final class RecordInput extends RawOp implements Operand { private Output records; - private RecordInput(Operation operation) { - super(operation); + public RecordInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; records = operation.output(outputIdx++); } @@ -249,4 +258,58 @@ public Options compressionType(String compressionType) { return this; } } + + @OpInputsMetadata( + outputsClass = RecordInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * Glob pattern for the data files. + */ + public final String filePattern; + + /** + * Random seeds used to produce randomized records. + */ + public final long fileRandomSeed; + + /** + * Shifts the list of files after the list is randomly + * shuffled. + */ + public final float fileShuffleShiftRatio; + + /** + * The randomization shuffling buffer. + */ + public final long fileBufferSize; + + /** + * How many sstables are opened and concurrently iterated over. + */ + public final long fileParallelism; + + /** + * The batch size. + */ + public final long batchSize; + + /** + * The type of compression for the file. Currently ZLIB and + * GZIP are supported. Defaults to none. + */ + public final String compressionType; + + public Inputs(GraphOperation op) { + super(new RecordInput(op), op, Arrays.asList("file_pattern", "file_random_seed", "file_shuffle_shift_ratio", "file_buffer_size", "file_parallelism", "batch_size", "compression_type")); + int inputIndex = 0; + filePattern = op.attributes().getAttrString("file_pattern"); + fileRandomSeed = op.attributes().getAttrInt("file_random_seed"); + fileShuffleShiftRatio = op.attributes().getAttrFloat("file_shuffle_shift_ratio"); + fileBufferSize = op.attributes().getAttrInt("file_buffer_size"); + fileParallelism = op.attributes().getAttrInt("file_parallelism"); + batchSize = op.attributes().getAttrInt("batch_size"); + compressionType = op.attributes().getAttrString("compression_type"); + } + } } 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 index 00540eed36a..78b596678fa 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -34,7 +40,15 @@ * {@code rng_read_and_skip(n)} will be the same as that after {@code uniform([n])} * (or any other distribution). The actual increment added to the * counter is an unspecified implementation choice. + *

      In the case that the input algorithm is RNG_ALG_AUTO_SELECT, the counter in the state needs to be of size int64[2], the current maximal counter size among algorithms. In this case, this op will manage the counter as if it is an 128-bit integer with layout [lower_64bits, higher_64bits]. If an algorithm needs less than 128 bits for the counter, it should use the left portion of the int64[2]. In this way, the int64[2] is compatible with all current RNG algorithms (Philox, ThreeFry and xla::RandomAlgorithm::RNG_DEFAULT). Downstream RNG ops can thus use this counter with any RNG algorithm. */ +@OpMetadata( + opType = RngReadAndSkip.OP_NAME, + inputsClass = RngReadAndSkip.Inputs.class +) +@Operator( + group = "random" +) public final class RngReadAndSkip extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +57,8 @@ public final class RngReadAndSkip extends RawOp implements Operand { private Output value; - private RngReadAndSkip(Operation operation) { - super(operation); + public RngReadAndSkip(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; value = operation.output(outputIdx++); } @@ -53,7 +67,7 @@ private RngReadAndSkip(Operation operation) { * 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 resource The handle of the resource variable that stores the state of the RNG. The state consists of the counter followed by the key. * @param alg The RNG algorithm. * @param delta The amount of advancement. * @return a new instance of RngReadAndSkip @@ -83,4 +97,32 @@ public Output value() { public Output asOutput() { return value; } + + @OpInputsMetadata( + outputsClass = RngReadAndSkip.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle of the resource variable that stores the state of the RNG. The state consists of the counter followed by the key. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand alg; + + /** + * The amount of advancement. + */ + public final Operand delta; + + public Inputs(GraphOperation op) { + super(new RngReadAndSkip(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java index 0e41e2bcfd8..41cd0aeff19 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,14 +39,21 @@ * (or any other distribution). The actual increment added to the * counter is an unspecified implementation detail. */ +@OpMetadata( + opType = RngSkip.OP_NAME, + inputsClass = RngSkip.Inputs.class +) +@Operator( + group = "random" +) public final class RngSkip extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "RngSkip"; - private RngSkip(Operation operation) { - super(operation); + public RngSkip(Operation operation) { + super(operation, OP_NAME); } /** @@ -63,4 +76,32 @@ public static RngSkip create(Scope scope, Operand resource, opBuilder.addInput(delta.asOutput()); return new RngSkip(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = RngSkip.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The amount of advancement. + */ + public final Operand delta; + + public Inputs(GraphOperation op) { + super(new RngSkip(op), op, Arrays.asList()); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java index 69eddaf8ab8..67bc6bf1167 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * The StatefulRandomBinomial operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulRandomBinomial.OP_NAME, + inputsClass = StatefulRandomBinomial.Inputs.class +) @Operator( group = "random" ) @@ -46,8 +54,8 @@ public final class StatefulRandomBinomial extends RawOp imple private Output output; - private StatefulRandomBinomial(Operation operation) { - super(operation); + public StatefulRandomBinomial(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,12 +64,12 @@ private StatefulRandomBinomial(Operation operation) { * Factory method to create a class wrapping a new StatefulRandomBinomial operation. * * @param scope current scope - * @param resource the resource value - * @param algorithm the algorithm value - * @param shape the shape value - * @param counts the counts value - * @param probs the probs value - * @param dtype the value of the dtype property + * @param resource The resource value + * @param algorithm The algorithm value + * @param shape The shape value + * @param counts The counts value + * @param probs The probs value + * @param dtype The value of the dtype attribute * @param data type for {@code StatefulRandomBinomial} output and operands * @param data type for {@code StatefulRandomBinomial} output and operands * @return a new instance of StatefulRandomBinomial @@ -86,11 +94,11 @@ public static StatefulRandomBinomial c * Factory method to create a class wrapping a new StatefulRandomBinomial operation, with the default output types. * * @param scope current scope - * @param resource the resource value - * @param algorithm the algorithm value - * @param shape the shape value - * @param counts the counts value - * @param probs the probs value + * @param resource The resource value + * @param algorithm The algorithm value + * @param shape The shape value + * @param counts The counts value + * @param probs The probs value * @param data type for {@code StatefulRandomBinomial} output and operands * @return a new instance of StatefulRandomBinomial, with default output types */ @@ -116,4 +124,62 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulRandomBinomial.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The resource input + */ + public final Operand resource; + + /** + * The algorithm input + */ + public final Operand algorithm; + + /** + * The shape input + */ + public final Operand shape; + + /** + * The counts input + */ + public final Operand counts; + + /** + * The probs input + */ + public final Operand probs; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new StatefulRandomBinomial<>(op), op, Arrays.asList("S", "T", "dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + counts = (Operand) op.input(inputIndex++); + probs = (Operand) op.input(inputIndex++); + S = op.attributes().getAttrType("S"); + T = op.attributes().getAttrType("T"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java index 8655e171171..ff905308114 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ /** * Outputs random values from a normal distribution. * The generated values will have mean 0 and standard deviation 1. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulStandardNormal.OP_NAME, + inputsClass = StatefulStandardNormal.Inputs.class +) @Operator( group = "random" ) @@ -47,8 +55,8 @@ public final class StatefulStandardNormal extends RawOp impleme private Output output; - private StatefulStandardNormal(Operation operation) { - super(operation); + public StatefulStandardNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -109,4 +117,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulStandardNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatefulStandardNormal<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java index 4e0742112e2..409dff36de6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -34,9 +41,14 @@ * 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. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulTruncatedNormal.OP_NAME, + inputsClass = StatefulTruncatedNormal.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulTruncatedNormal extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class StatefulTruncatedNormal extends RawOp implem private Output output; - private StatefulTruncatedNormal(Operation operation) { - super(operation); + public StatefulTruncatedNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -107,4 +119,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulTruncatedNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatefulTruncatedNormal<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java index 8b2e28317d1..65f86463b06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,9 +40,14 @@ * Outputs random values from a uniform distribution. * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulUniform.OP_NAME, + inputsClass = StatefulUniform.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulUniform extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +56,8 @@ public final class StatefulUniform extends RawOp implements Ope private Output output; - private StatefulUniform(Operation operation) { - super(operation); + public StatefulUniform(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -105,4 +117,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulUniform.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatefulUniform<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java index 2f858cfd43e..80f425ff575 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,35 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. * The generated values are uniform integers covering the whole range of {@code dtype}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulUniformFullInt.OP_NAME, + inputsClass = StatefulUniformFullInt.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulUniformFullInt extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class StatefulUniformFullInt extends RawOp impleme private Output output; - private StatefulUniformFullInt(Operation operation) { - super(operation); + public StatefulUniformFullInt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -86,4 +98,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulUniformFullInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatefulUniformFullInt<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java index ff5940afe1c..d2854aea992 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,9 +42,14 @@ *

      The random integers are slightly biased unless {@code maxval - minval} is an exact * power of two. The bias is small for values of {@code maxval - minval} significantly * smaller than the range of the output (either {@code 2^32} or {@code 2^64}). - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatefulUniformInt.OP_NAME, + inputsClass = StatefulUniformInt.Inputs.class +) +@Operator( + group = "random" +) public final class StatefulUniformInt extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class StatefulUniformInt extends RawOp implements private Output output; - private StatefulUniformInt(Operation operation) { - super(operation); + public StatefulUniformInt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -92,4 +104,56 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatefulUniformInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle of the resource variable that stores the state of the RNG. + */ + public final Operand resource; + + /** + * The RNG algorithm. + */ + public final Operand algorithm; + + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Minimum value (inclusive, scalar). + */ + public final Operand minval; + + /** + * Maximum value (exclusive, scalar). + */ + public final Operand maxval; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatefulUniformInt<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + algorithm = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + minval = (Operand) op.input(inputIndex++); + maxval = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java index 49bfb4df2e3..45a902b2da8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Draws samples from a multinomial distribution. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessMultinomial.OP_NAME, + inputsClass = StatelessMultinomial.Inputs.class +) @Operator( group = "random" ) @@ -46,8 +54,8 @@ public final class StatelessMultinomial extends RawOp impleme private Output output; - private StatelessMultinomial(Operation operation) { - super(operation); + public StatelessMultinomial(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -60,7 +68,7 @@ private StatelessMultinomial(Operation operation) { * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. * @param seed 2 seeds (shape [2]). - * @param outputDtype the value of the outputDtype property + * @param outputDtype The value of the outputDtype attribute * @param data type for {@code StatelessMultinomial} output and operands * @return a new instance of StatelessMultinomial */ @@ -110,4 +118,51 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessMultinomial.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} + * represents the unnormalized log probabilities for all classes. + */ + public final Operand logits; + + /** + * 0-D. Number of independent samples to draw for each row slice. + */ + public final Operand numSamples; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + /** + * The outputDtype attribute + */ + public final DataType outputDtype; + + public Inputs(GraphOperation op) { + super(new StatelessMultinomial<>(op), op, Arrays.asList("T", "Tseed", "output_dtype")); + int inputIndex = 0; + logits = (Operand) op.input(inputIndex++); + numSamples = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + outputDtype = op.attributes().getAttrType("output_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java index c7c31649a51..64f85682701 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,32 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * The StatelessParameterizedTruncatedNormal operation - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessParameterizedTruncatedNormal.OP_NAME, + inputsClass = StatelessParameterizedTruncatedNormal.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessParameterizedTruncatedNormal extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +51,8 @@ public final class StatelessParameterizedTruncatedNormal exte private Output output; - private StatelessParameterizedTruncatedNormal(Operation operation) { - super(operation); + public StatelessParameterizedTruncatedNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -89,4 +101,69 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessParameterizedTruncatedNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The mean parameter of each batch. + */ + public final Operand means; + + /** + * The standard deviation parameter of each batch. Must be greater than 0. + */ + public final Operand stddevs; + + /** + * The minimum cutoff. May be -infinity. + */ + public final Operand minvals; + + /** + * The maximum cutoff. May be +infinity, and must be more than the minval + * for each batch. + */ + public final Operand maxvals; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + /** + * The type of the output. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new StatelessParameterizedTruncatedNormal<>(op), op, Arrays.asList("S", "Tseed", "dtype")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + means = (Operand) op.input(inputIndex++); + stddevs = (Operand) op.input(inputIndex++); + minvals = (Operand) op.input(inputIndex++); + maxvals = (Operand) op.input(inputIndex++); + S = op.attributes().getAttrType("S"); + Tseed = op.attributes().getAttrType("Tseed"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java index f2fe43de2f2..ebd295592eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -32,9 +39,14 @@ * Outputs deterministic pseudorandom random numbers from a binomial distribution. * Outputs random values from a binomial distribution. *

      The outputs are a deterministic function of {@code shape}, {@code seed}, {@code counts}, and {@code probs}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomBinomial.OP_NAME, + inputsClass = StatelessRandomBinomial.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomBinomial extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +55,8 @@ public final class StatelessRandomBinomial extends RawOp impl private Output output; - private StatelessRandomBinomial(Operation operation) { - super(operation); + public StatelessRandomBinomial(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -114,4 +126,64 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomBinomial.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The counts of the binomial distribution. Must be broadcastable with {@code probs}, + * and broadcastable with the rightmost dimensions of {@code shape}. + */ + public final Operand counts; + + /** + * The probability of success for the binomial distribution. Must be broadcastable + * with {@code counts} and broadcastable with the rightmost dimensions of {@code shape}. + */ + public final Operand probs; + + /** + * The S attribute + */ + public final DataType S; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The type of the output. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new StatelessRandomBinomial<>(op), op, Arrays.asList("S", "Tseed", "T", "dtype")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + counts = (Operand) op.input(inputIndex++); + probs = (Operand) op.input(inputIndex++); + S = op.attributes().getAttrType("S"); + Tseed = op.attributes().getAttrType("Tseed"); + T = op.attributes().getAttrType("T"); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java index b8301f3e4ad..69bd0d03ddd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,55 +17,74 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random numbers from a gamma distribution. * Outputs random values from a gamma distribution. - *

      The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code alpha}. - * - * @param data type for {@code output} output + *

      The outputs are a deterministic function of the inputs. */ -public final class StatelessRandomGamma extends RawOp implements Operand { +@OpMetadata( + opType = StatelessRandomGamma.OP_NAME, + inputsClass = StatelessRandomGamma.Inputs.class +) +@Operator( + group = "random" +) +public final class StatelessRandomGamma extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomGammaV2"; + public static final String OP_NAME = "StatelessRandomGammaV3"; - private Output output; + private Output output; - private StatelessRandomGamma(Operation operation) { - super(operation); + public StatelessRandomGamma(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new StatelessRandomGammaV2 operation. + * Factory method to create a class wrapping a new StatelessRandomGammaV3 operation. * * @param scope current scope * @param shape The shape of the output tensor. - * @param seed 2 seeds (shape [2]). + * @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 alpha The concentration of the gamma distribution. Shape must match the rightmost * dimensions of {@code shape}. - * @param data type for {@code StatelessRandomGammaV2} output and operands + * @param data type for {@code StatelessRandomGammaV3} output and operands * @return a new instance of StatelessRandomGamma */ @Endpoint( describeByClass = true ) - public static StatelessRandomGamma create(Scope scope, - Operand shape, Operand seed, Operand alpha) { + public static StatelessRandomGamma create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Operand alpha) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGamma"); opBuilder.addInput(shape.asOutput()); - opBuilder.addInput(seed.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); opBuilder.addInput(alpha.asOutput()); return new StatelessRandomGamma<>(opBuilder.build()); } @@ -75,12 +94,65 @@ public static StatelessRandomGamma create(Scope scope, * Random values with specified shape. * @return output. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomGamma.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The concentration of the gamma distribution. Shape must match the rightmost + * dimensions of {@code shape}. + */ + public final Operand alpha; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The shapeDtype attribute + */ + public final DataType shapeDtype; + + public Inputs(GraphOperation op) { + super(new StatelessRandomGamma<>(op), op, Arrays.asList("dtype", "shape_dtype")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shapeDtype = op.attributes().getAttrType("shape_dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetAlg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetAlg.java new file mode 100644 index 00000000000..30e7dd10837 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetAlg.java @@ -0,0 +1,97 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * Picks the best counter-based RNG algorithm based on device. + * This op picks the best counter-based RNG algorithm based on device. + */ +@OpMetadata( + opType = StatelessRandomGetAlg.OP_NAME, + inputsClass = StatelessRandomGetAlg.Inputs.class +) +@Operator( + group = "random" +) +public final class StatelessRandomGetAlg extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomGetAlg"; + + private Output alg; + + public StatelessRandomGetAlg(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + alg = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatelessRandomGetAlg operation. + * + * @param scope current scope + * @return a new instance of StatelessRandomGetAlg + */ + @Endpoint( + describeByClass = true + ) + public static StatelessRandomGetAlg create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGetAlg"); + return new StatelessRandomGetAlg(opBuilder.build()); + } + + /** + * Gets alg. + * The RNG algorithm (shape int32[]). + * @return alg. + */ + public Output alg() { + return alg; + } + + @Override + public Output asOutput() { + return alg; + } + + @OpInputsMetadata( + outputsClass = StatelessRandomGetAlg.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new StatelessRandomGetAlg(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounter.java new file mode 100644 index 00000000000..db52e5ba0d4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounter.java @@ -0,0 +1,121 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * Scrambles seed into key and counter, using the best algorithm based on device. + * This op scrambles a shape-[2] seed into a key and a counter, both needed by counter-based RNG algorithms. The scrambing uses the best algorithm based on device. 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). + */ +@OpMetadata( + opType = StatelessRandomGetKeyCounter.OP_NAME, + inputsClass = StatelessRandomGetKeyCounter.Inputs.class +) +@Operator( + group = "random" +) +public final class StatelessRandomGetKeyCounter extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomGetKeyCounter"; + + private Output key; + + private Output counter; + + @SuppressWarnings("unchecked") + public StatelessRandomGetKeyCounter(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + key = operation.output(outputIdx++); + counter = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatelessRandomGetKeyCounter operation. + * + * @param scope current scope + * @param seed 2 seeds (shape [2]). + * @return a new instance of StatelessRandomGetKeyCounter + */ + @Endpoint( + describeByClass = true + ) + public static StatelessRandomGetKeyCounter create(Scope scope, Operand seed) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGetKeyCounter"); + opBuilder.addInput(seed.asOutput()); + return new StatelessRandomGetKeyCounter(opBuilder.build()); + } + + /** + * Gets key. + * Key for the counter-based RNG algorithm (shape uint64[1]). + * @return key. + */ + public Output key() { + return key; + } + + /** + * Gets counter. + * 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). + * @return counter. + */ + public Output counter() { + return counter; + } + + @OpInputsMetadata( + outputsClass = StatelessRandomGetKeyCounter.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomGetKeyCounter(op), op, Arrays.asList("Tseed")); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + Tseed = op.attributes().getAttrType("Tseed"); + } + } +} 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 index 19876715299..d98e7a1e935 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,6 +39,13 @@ * 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). */ +@OpMetadata( + opType = StatelessRandomGetKeyCounterAlg.OP_NAME, + inputsClass = StatelessRandomGetKeyCounterAlg.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomGetKeyCounterAlg extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +59,8 @@ public final class StatelessRandomGetKeyCounterAlg extends RawOp { private Output alg; @SuppressWarnings("unchecked") - private StatelessRandomGetKeyCounterAlg(Operation operation) { - super(operation); + public StatelessRandomGetKeyCounterAlg(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; key = operation.output(outputIdx++); counter = operation.output(outputIdx++); @@ -96,4 +110,26 @@ public Output counter() { public Output alg() { return alg; } + + @OpInputsMetadata( + outputsClass = StatelessRandomGetKeyCounterAlg.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomGetKeyCounterAlg(op), op, Arrays.asList("Tseed")); + int inputIndex = 0; + seed = (Operand) op.input(inputIndex++); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java index 433499b7e86..bf0fa718d0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -33,9 +39,11 @@ * 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 {@code shape} and {@code seed}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomNormal.OP_NAME, + inputsClass = StatelessRandomNormal.Inputs.class +) @Operator( group = "random" ) @@ -47,8 +55,8 @@ public final class StatelessRandomNormal extends RawOp implem private Output output; - private StatelessRandomNormal(Operation operation) { - super(operation); + public StatelessRandomNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -104,4 +112,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomNormal<>(op), op, Arrays.asList("dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } 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 index 244ecf26652..ef4f9aafee6 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -34,9 +41,14 @@ * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomNormalV2.OP_NAME, + inputsClass = StatelessRandomNormalV2.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomNormalV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class StatelessRandomNormalV2 extends RawOp impl private Output output; - private StatelessRandomNormalV2(Operation operation) { - super(operation); + public StatelessRandomNormalV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -110,4 +122,50 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomNormalV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new StatelessRandomNormalV2<>(op), op, Arrays.asList("dtype", "Tshape")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java index 0d38215c5e4..c617e49f652 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,35 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random numbers from a Poisson distribution. * Outputs random values from a Poisson distribution. *

      The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code lam}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomPoisson.OP_NAME, + inputsClass = StatelessRandomPoisson.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomPoisson extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class StatelessRandomPoisson extends RawOp imple private Output output; - private StatelessRandomPoisson(Operation operation) { - super(operation); + public StatelessRandomPoisson(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -87,4 +99,57 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomPoisson.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The rate of the Poisson distribution. Shape must match the rightmost dimensions + * of {@code shape}. + */ + public final Operand lam; + + /** + * The Rtype attribute + */ + public final DataType Rtype; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomPoisson<>(op), op, Arrays.asList("Rtype", "dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + lam = (Operand) op.input(inputIndex++); + Rtype = op.attributes().getAttrType("Rtype"); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java index a64ec02b6f2..86c24f1e171 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -34,9 +40,11 @@ * The generated values follow a uniform distribution in the range {@code [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 {@code shape} and {@code seed}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniform.OP_NAME, + inputsClass = StatelessRandomUniform.Inputs.class +) @Operator( group = "random" ) @@ -48,8 +56,8 @@ public final class StatelessRandomUniform extends RawOp imple private Output output; - private StatelessRandomUniform(Operation operation) { - super(operation); + public StatelessRandomUniform(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -105,4 +113,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniform.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniform<>(op), op, Arrays.asList("dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java index 2a9fb099f03..41e703d9ddf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,35 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 {@code dtype}. *

      The outputs are a deterministic function of {@code shape} and {@code seed}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniformFullInt.OP_NAME, + inputsClass = StatelessRandomUniformFullInt.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniformFullInt extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class StatelessRandomUniformFullInt extends RawO private Output output; - private StatelessRandomUniformFullInt(Operation operation) { - super(operation); + public StatelessRandomUniformFullInt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -83,4 +95,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniformFullInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniformFullInt<>(op), op, Arrays.asList("dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } 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 index 1375e8b1675..7a910d86feb 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,9 +40,14 @@ * Outputs deterministic pseudorandom random integers from a uniform distribution. * The generated values are uniform integers covering the whole range of {@code dtype}. *

      The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniformFullIntV2.OP_NAME, + inputsClass = StatelessRandomUniformFullIntV2.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniformFullIntV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +56,8 @@ public final class StatelessRandomUniformFullIntV2 extends Ra private Output output; - private StatelessRandomUniformFullIntV2(Operation operation) { - super(operation); + public StatelessRandomUniformFullIntV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -90,4 +102,50 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniformFullIntV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniformFullIntV2<>(op), op, Arrays.asList("dtype", "Tshape")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java index 6574e658ef3..5c792f75e51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 {@code [minval, maxval)}. *

      The outputs are a deterministic function of {@code shape}, {@code seed}, {@code minval}, and {@code maxval}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniformInt.OP_NAME, + inputsClass = StatelessRandomUniformInt.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniformInt extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class StatelessRandomUniformInt extends RawOp im private Output output; - private StatelessRandomUniformInt(Operation operation) { - super(operation); + public StatelessRandomUniformInt(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +97,56 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniformInt.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * Minimum value (inclusive, scalar). + */ + public final Operand minval; + + /** + * Maximum value (exclusive, scalar). + */ + public final Operand maxval; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniformInt<>(op), op, Arrays.asList("dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + minval = (Operand) op.input(inputIndex++); + maxval = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } 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 index f46ac81e12d..ae538d14050 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,9 +39,14 @@ * Outputs deterministic pseudorandom random integers from a uniform distribution. * The generated values follow a uniform distribution in the range {@code [minval, maxval)}. *

      The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter}, {@code alg}, {@code minval} and {@code maxval}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniformIntV2.OP_NAME, + inputsClass = StatelessRandomUniformIntV2.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniformIntV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +55,8 @@ public final class StatelessRandomUniformIntV2 extends RawOp private Output output; - private StatelessRandomUniformIntV2(Operation operation) { - super(operation); + public StatelessRandomUniformIntV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -91,4 +103,62 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniformIntV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * Minimum value (inclusive, scalar). + */ + public final Operand minval; + + /** + * Maximum value (exclusive, scalar). + */ + public final Operand maxval; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniformIntV2<>(op), op, Arrays.asList("dtype", "Tshape")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + minval = (Operand) op.input(inputIndex++); + maxval = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } 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 index e6a8f7b5047..86bb5202639 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -35,9 +42,14 @@ * The generated values follow a uniform distribution in the range {@code [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 {@code shape}, {@code key}, {@code counter} and {@code alg}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessRandomUniformV2.OP_NAME, + inputsClass = StatelessRandomUniformV2.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessRandomUniformV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class StatelessRandomUniformV2 extends RawOp imp private Output output; - private StatelessRandomUniformV2(Operation operation) { - super(operation); + public StatelessRandomUniformV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -111,4 +123,50 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessRandomUniformV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new StatelessRandomUniformV2<>(op), op, Arrays.asList("dtype", "Tshape")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java index 5e27e6fad9f..83c4ebdab9c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -35,9 +41,11 @@ * 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 {@code shape} and {@code seed}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessTruncatedNormal.OP_NAME, + inputsClass = StatelessTruncatedNormal.Inputs.class +) @Operator( group = "random" ) @@ -49,8 +57,8 @@ public final class StatelessTruncatedNormal extends RawOp imp private Output output; - private StatelessTruncatedNormal(Operation operation) { - super(operation); + public StatelessTruncatedNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -106,4 +114,44 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessTruncatedNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * 2 seeds (shape [2]). + */ + public final Operand seed; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tseed attribute + */ + public final DataType Tseed; + + public Inputs(GraphOperation op) { + super(new StatelessTruncatedNormal<>(op), op, Arrays.asList("dtype", "T", "Tseed")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + Tseed = op.attributes().getAttrType("Tseed"); + } + } } 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 index b66df2e0f67..ae8b00ae1df 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -36,9 +43,14 @@ * 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 {@code shape}, {@code key}, {@code counter} and {@code alg}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = StatelessTruncatedNormalV2.OP_NAME, + inputsClass = StatelessTruncatedNormalV2.Inputs.class +) +@Operator( + group = "random" +) public final class StatelessTruncatedNormalV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +59,8 @@ public final class StatelessTruncatedNormalV2 extends RawOp i private Output output; - private StatelessTruncatedNormalV2(Operation operation) { - super(operation); + public StatelessTruncatedNormalV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -112,4 +124,50 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StatelessTruncatedNormalV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The Tshape attribute + */ + public final DataType Tshape; + + public Inputs(GraphOperation op) { + super(new StatelessTruncatedNormalV2<>(op), op, Arrays.asList("dtype", "Tshape")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tshape = op.attributes().getAttrType("Tshape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ThreadUnsafeUnigramCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ThreadUnsafeUnigramCandidateSampler.java new file mode 100644 index 00000000000..1aff75975d1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ThreadUnsafeUnigramCandidateSampler.java @@ -0,0 +1,259 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt64; + +/** + * Generates labels for candidate sampling with a learned unigram distribution. + * See explanations of candidate sampling and the data formats at + * go/candidate-sampling. + *

      For each batch, this op picks a single set of sampled candidate labels. + *

      The advantages of sampling candidates per-batch are simplicity and the + * possibility of efficient dense matrix multiplication. The disadvantage is that + * the sampled candidates must be chosen independently of the context and of the + * true labels. + */ +@OpMetadata( + opType = ThreadUnsafeUnigramCandidateSampler.OP_NAME, + inputsClass = ThreadUnsafeUnigramCandidateSampler.Inputs.class +) +@Operator( + group = "random" +) +public final class ThreadUnsafeUnigramCandidateSampler extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ThreadUnsafeUnigramCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + public ThreadUnsafeUnigramCandidateSampler(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ThreadUnsafeUnigramCandidateSampler operation. + * + * @param scope current scope + * @param trueClasses A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + * @param numTrue Number of true labels per context. + * @param numSampled Number of candidates to randomly sample. + * @param unique If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + * @param rangeMax The sampler will sample integers from the interval [0, range_max). + * @param options carries optional attribute values + * @return a new instance of ThreadUnsafeUnigramCandidateSampler + */ + @Endpoint( + describeByClass = true + ) + public static ThreadUnsafeUnigramCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ThreadUnsafeUnigramCandidateSampler"); + opBuilder.addInput(trueClasses.asOutput()); + opBuilder.setAttr("num_true", numTrue); + opBuilder.setAttr("num_sampled", numSampled); + opBuilder.setAttr("unique", unique); + opBuilder.setAttr("range_max", rangeMax); + if (options != null) { + for (Options opts : options) { + if (opts.seed != null) { + opBuilder.setAttr("seed", opts.seed); + } + if (opts.seed2 != null) { + opBuilder.setAttr("seed2", opts.seed2); + } + } + } + return new ThreadUnsafeUnigramCandidateSampler(opBuilder.build()); + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public static Options seed(Long seed) { + return new Options().seed(seed); + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public static Options seed2(Long seed2) { + return new Options().seed2(seed2); + } + + /** + * Gets sampledCandidates. + * A vector of length num_sampled, in which each element is + * the ID of a sampled candidate. + * @return sampledCandidates. + */ + public Output sampledCandidates() { + return sampledCandidates; + } + + /** + * Gets trueExpectedCount. + * A batch_size * num_true matrix, representing + * the number of times each candidate is expected to occur in a batch + * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. + */ + public Output trueExpectedCount() { + return trueExpectedCount; + } + + /** + * Gets sampledExpectedCount. + * A vector of length num_sampled, for each sampled + * candidate representing the number of times the candidate is expected + * to occur in a batch of sampled candidates. If unique=true, then this is a + * probability. + * @return sampledExpectedCount. + */ + public Output sampledExpectedCount() { + return sampledExpectedCount; + } + + /** + * Optional attributes for {@link org.tensorflow.op.random.ThreadUnsafeUnigramCandidateSampler} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ThreadUnsafeUnigramCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to randomly sample. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * The sampler will sample integers from the interval [0, range_max). + */ + public final long rangeMax; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new ThreadUnsafeUnigramCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "range_max", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + rangeMax = op.attributes().getAttrInt("range_max"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java index 2413cecd2e0..36fbe8a2a05 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -33,9 +39,11 @@ * 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. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TruncatedNormal.OP_NAME, + inputsClass = TruncatedNormal.Inputs.class +) @Operator( group = "random" ) @@ -47,8 +55,8 @@ public final class TruncatedNormal extends RawOp implements O private Output output; - private TruncatedNormal(Operation operation) { - super(operation); + public TruncatedNormal(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -156,4 +164,46 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = TruncatedNormal.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The shape of the output tensor. + */ + public final Operand shape; + + /** + * If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * A second seed to avoid seed collision. + */ + public final long seed2; + + /** + * The type of the output. + */ + public final DataType dtype; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TruncatedNormal<>(op), op, Arrays.asList("seed", "seed2", "dtype", "T")); + int inputIndex = 0; + shape = (Operand) op.input(inputIndex++); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + dtype = op.attributes().getAttrType("dtype"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java index c43eba10640..e275c51fce7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.random; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -38,6 +43,10 @@ * the sampled candidates must be chosen independently of the context and of the * true labels. */ +@OpMetadata( + opType = UniformCandidateSampler.OP_NAME, + inputsClass = UniformCandidateSampler.Inputs.class +) @Operator( group = "random" ) @@ -53,8 +62,8 @@ public final class UniformCandidateSampler extends RawOp { private Output sampledExpectedCount; - private UniformCandidateSampler(Operation operation) { - super(operation); + public UniformCandidateSampler(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sampledCandidates = operation.output(outputIdx++); trueExpectedCount = operation.output(outputIdx++); @@ -190,4 +199,61 @@ public Options seed2(Long seed2) { return this; } } + + @OpInputsMetadata( + outputsClass = UniformCandidateSampler.class + ) + public static class Inputs extends RawOpInputs { + /** + * A batch_size * num_true matrix, in which each row contains the + * IDs of the num_true target_classes in the corresponding original label. + */ + public final Operand trueClasses; + + /** + * Number of true labels per context. + */ + public final long numTrue; + + /** + * Number of candidates to randomly sample. + */ + public final long numSampled; + + /** + * If unique is true, we sample with rejection, so that all sampled + * candidates in a batch are unique. This requires some approximation to + * estimate the post-rejection sampling probabilities. + */ + public final boolean unique; + + /** + * The sampler will sample integers from the interval [0, range_max). + */ + public final long rangeMax; + + /** + * If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + */ + public final long seed; + + /** + * An second seed to avoid seed collision. + */ + public final long seed2; + + public Inputs(GraphOperation op) { + super(new UniformCandidateSampler(op), op, Arrays.asList("num_true", "num_sampled", "unique", "range_max", "seed", "seed2")); + int inputIndex = 0; + trueClasses = (Operand) op.input(inputIndex++); + numTrue = op.attributes().getAttrInt("num_true"); + numSampled = op.attributes().getAttrInt("num_sampled"); + unique = op.attributes().getAttrBool("unique"); + rangeMax = op.attributes().getAttrInt("range_max"); + seed = op.attributes().getAttrInt("seed"); + seed2 = op.attributes().getAttrInt("seed2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/StatelessShuffle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/StatelessShuffle.java new file mode 100644 index 00000000000..dc17294084b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/StatelessShuffle.java @@ -0,0 +1,148 @@ +/* Copyright 2018-2023 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.experimental; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Randomly and deterministically shuffles a tensor along its first dimension. + * The tensor is shuffled along dimension 0, such that each {@code value[j]} is mapped + * to one and only one {@code output[i]}. For example, a mapping that might occur for a + * 3x2 tensor is: + *

      + * [[1, 2],       [[5, 6],
      + *  [3, 4],  ==>   [1, 2],
      + *  [5, 6]]        [3, 4]]
      + * 
      + *

      The outputs are a deterministic function of {@code value}, {@code key}, {@code counter} and {@code alg}. + */ +@OpMetadata( + opType = StatelessShuffle.OP_NAME, + inputsClass = StatelessShuffle.Inputs.class +) +@Operator( + group = "random.experimental" +) +public final class StatelessShuffle extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessShuffle"; + + private Output output; + + public StatelessShuffle(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatelessShuffle operation. + * + * @param scope current scope + * @param value The tensor to be shuffled. + * @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 data type for {@code StatelessShuffle} output and operands + * @return a new instance of StatelessShuffle + */ + @Endpoint( + describeByClass = true + ) + public static StatelessShuffle create(Scope scope, Operand value, + Operand key, Operand counter, Operand alg) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessShuffle"); + opBuilder.addInput(value.asOutput()); + opBuilder.addInput(key.asOutput()); + opBuilder.addInput(counter.asOutput()); + opBuilder.addInput(alg.asOutput()); + return new StatelessShuffle<>(opBuilder.build()); + } + + /** + * Gets output. + * A tensor of same shape and type as {@code value}, shuffled along its first + * dimension. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = StatelessShuffle.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The tensor to be shuffled. + */ + public final Operand value; + + /** + * Key for the counter-based RNG algorithm (shape uint64[1]). + */ + public final Operand key; + + /** + * 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. + */ + public final Operand counter; + + /** + * The RNG algorithm (shape int32[]). + */ + public final Operand alg; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new StatelessShuffle<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + value = (Operand) op.input(inputIndex++); + key = (Operand) op.input(inputIndex++); + counter = (Operand) op.input(inputIndex++); + alg = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastRecvV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastRecvV2.java deleted file mode 100644 index 9dc30db94d9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastRecvV2.java +++ /dev/null @@ -1,156 +0,0 @@ -/* 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.rawops; - -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.types.TInt32; -import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Receives a tensor value broadcast from another device. - * - * @param data type for {@code data} output - */ -public final class CollectiveBcastRecvV2 extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveBcastRecvV2"; - - private Output data; - - private CollectiveBcastRecvV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveBcastRecvV2 operation. - * - * @param scope current scope - * @param groupSize the groupSize value - * @param groupKey the groupKey value - * @param instanceKey the instanceKey value - * @param shape the shape value - * @param T the value of the T property - * @param options carries optional attribute values - * @param data type for {@code CollectiveBcastRecvV2} output and operands - * @return a new instance of CollectiveBcastRecvV2 - */ - @Endpoint( - describeByClass = true - ) - public static CollectiveBcastRecvV2 create(Scope scope, - Operand groupSize, Operand groupKey, Operand instanceKey, - Operand shape, Class T, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveBcastRecvV2"); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - opBuilder.addInput(shape.asOutput()); - opBuilder.setAttr("T", Operands.toDataType(T)); - 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 CollectiveBcastRecvV2<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.CollectiveBcastRecvV2} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastSendV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastSendV2.java deleted file mode 100644 index 3bfa4f56fea..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/CollectiveBcastSendV2.java +++ /dev/null @@ -1,152 +0,0 @@ -/* 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.rawops; - -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.types.TInt32; -import org.tensorflow.types.family.TType; - -/** - * Broadcasts a tensor value to one or more other devices. - * - * @param data type for {@code data} output - */ -public final class CollectiveBcastSendV2 extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectiveBcastSendV2"; - - private Output data; - - private CollectiveBcastSendV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectiveBcastSendV2 operation. - * - * @param scope current scope - * @param input the input value - * @param groupSize the groupSize value - * @param groupKey the groupKey value - * @param instanceKey the instanceKey value - * @param options carries optional attribute values - * @param data type for {@code CollectiveBcastSendV2} output and operands - * @return a new instance of CollectiveBcastSendV2 - */ - @Endpoint( - describeByClass = true - ) - public static CollectiveBcastSendV2 create(Scope scope, Operand input, - Operand groupSize, Operand groupKey, Operand instanceKey, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectiveBcastSendV2"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(groupSize.asOutput()); - opBuilder.addInput(groupKey.asOutput()); - opBuilder.addInput(instanceKey.asOutput()); - 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 CollectiveBcastSendV2<>(opBuilder.build()); - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public static Options communicationHint(String communicationHint) { - return new Options().communicationHint(communicationHint); - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public static Options timeoutSeconds(Float timeoutSeconds) { - return new Options().timeoutSeconds(timeoutSeconds); - } - - /** - * Gets data. - * - * @return data. - */ - public Output data() { - return data; - } - - @Override - public Output asOutput() { - return data; - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.CollectiveBcastSendV2} - */ - public static class Options { - private String communicationHint; - - private Float timeoutSeconds; - - private Options() { - } - - /** - * Sets the communicationHint option. - * - * @param communicationHint the communicationHint option - * @return this Options instance. - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * Sets the timeoutSeconds option. - * - * @param timeoutSeconds the timeoutSeconds option - * @return this Options instance. - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/GetOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/GetOptions.java deleted file mode 100644 index 17144898ed1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/GetOptions.java +++ /dev/null @@ -1,76 +0,0 @@ -/* 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.rawops; - -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.types.TString; -import org.tensorflow.types.family.TType; - -/** - * Returns the {@code tf.data.Options} attached to {@code input_dataset}. - */ -public final class GetOptions extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "GetOptions"; - - private Output serializedOptions; - - private GetOptions(Operation operation) { - super(operation); - int outputIdx = 0; - serializedOptions = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new GetOptions operation. - * - * @param scope current scope - * @param inputDataset A variant tensor representing the input dataset. - * @return a new instance of GetOptions - */ - @Endpoint( - describeByClass = true - ) - public static GetOptions create(Scope scope, Operand inputDataset) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetOptions"); - opBuilder.addInput(inputDataset.asOutput()); - return new GetOptions(opBuilder.build()); - } - - /** - * Gets serializedOptions. - * - * @return serializedOptions. - */ - public Output serializedOptions() { - return serializedOptions; - } - - @Override - public Output asOutput() { - return serializedOptions; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParameters.java deleted file mode 100644 index bf8befa00bd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParameters.java +++ /dev/null @@ -1,160 +0,0 @@ -/* 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.rawops; - -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.types.TFloat32; - -/** - * Load frequency estimator embedding parameters. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingFrequencyEstimatorParameters extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingFrequencyEstimatorParameters"; - - private LoadTPUEmbeddingFrequencyEstimatorParameters(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingFrequencyEstimatorParameters operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the frequency estimator optimization algorithm. - * @param lastHitStep Value of last_hit_step used in the frequency estimator optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingFrequencyEstimatorParameters - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingFrequencyEstimatorParameters create(Scope scope, - Operand parameters, Operand lastHitStep, Long numShards, Long shardId, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingFrequencyEstimatorParameters"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(lastHitStep.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingFrequencyEstimatorParameters(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.LoadTPUEmbeddingFrequencyEstimatorParameters} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java deleted file mode 100644 index 4d620783b32..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java +++ /dev/null @@ -1,163 +0,0 @@ -/* 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.rawops; - -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.types.TFloat32; - -/** - * Load frequency estimator embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"; - - private LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the frequency estimator optimization algorithm. - * @param lastHitStep Value of last_hit_step used in the frequency estimator optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the frequency estimator optimization - * algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand lastHitStep, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(lastHitStep.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.LoadTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java deleted file mode 100644 index bc7e7cc35a0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java +++ /dev/null @@ -1,180 +0,0 @@ -/* 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.rawops; - -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.types.TFloat32; - -/** - * Retrieve frequency estimator embedding parameters. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingFrequencyEstimatorParameters extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFrequencyEstimatorParameters"; - - private Output parameters; - - private Output lastHitStep; - - private RetrieveTPUEmbeddingFrequencyEstimatorParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - lastHitStep = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFrequencyEstimatorParameters operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingFrequencyEstimatorParameters - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingFrequencyEstimatorParameters create(Scope scope, Long numShards, - Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingFrequencyEstimatorParameters"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingFrequencyEstimatorParameters(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the frequency estimator optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets lastHitStep. - * Parameter last_hit_step updated by the frequency estimator optimization - * algorithm. - * @return lastHitStep. - */ - public Output lastHitStep() { - return lastHitStep; - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.RetrieveTPUEmbeddingFrequencyEstimatorParameters} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java deleted file mode 100644 index 03cfdd595fc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug.java +++ /dev/null @@ -1,193 +0,0 @@ -/* 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.rawops; - -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.types.TFloat32; - -/** - * Retrieve frequency estimator embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"; - - private Output parameters; - - private Output lastHitStep; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - lastHitStep = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the frequency estimator optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets lastHitStep. - * Parameter last_hit_step updated by the frequency estimator optimization - * algorithm. - * @return lastHitStep. - */ - public Output lastHitStep() { - return lastHitStep; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the frequency estimator optimization - * algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.rawops.RetrieveTPUEmbeddingFrequencyEstimatorParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetAlg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetAlg.java deleted file mode 100644 index d73bbace62c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetAlg.java +++ /dev/null @@ -1,74 +0,0 @@ -/* 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.rawops; - -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.types.TInt32; - -/** - * Picks the best counter-based RNG algorithm based on device. - * This op picks the best counter-based RNG algorithm based on device. - */ -public final class StatelessRandomGetAlg extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "StatelessRandomGetAlg"; - - private Output alg; - - private StatelessRandomGetAlg(Operation operation) { - super(operation); - int outputIdx = 0; - alg = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new StatelessRandomGetAlg operation. - * - * @param scope current scope - * @return a new instance of StatelessRandomGetAlg - */ - @Endpoint( - describeByClass = true - ) - public static StatelessRandomGetAlg create(Scope scope) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGetAlg"); - return new StatelessRandomGetAlg(opBuilder.build()); - } - - /** - * Gets alg. - * The RNG algorithm (shape int32[]). - * @return alg. - */ - public Output alg() { - return alg; - } - - @Override - public Output asOutput() { - return alg; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetKeyCounter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetKeyCounter.java deleted file mode 100644 index 9be0d0463d3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/rawops/StatelessRandomGetKeyCounter.java +++ /dev/null @@ -1,85 +0,0 @@ -/* 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.rawops; - -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.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Scrambles seed into key and counter, using the best algorithm based on device. - * This op scrambles a shape-[2] seed into a key and a counter, both needed by counter-based RNG algorithms. The scrambing uses the best algorithm based on device. 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 StatelessRandomGetKeyCounter extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "StatelessRandomGetKeyCounter"; - - private Output key; - - private Output counter; - - @SuppressWarnings("unchecked") - private StatelessRandomGetKeyCounter(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - counter = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new StatelessRandomGetKeyCounter operation. - * - * @param scope current scope - * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomGetKeyCounter - */ - @Endpoint( - describeByClass = true - ) - public static StatelessRandomGetKeyCounter create(Scope scope, Operand seed) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StatelessRandomGetKeyCounter"); - opBuilder.addInput(seed.asOutput()); - return new StatelessRandomGetKeyCounter(opBuilder.build()); - } - - /** - * Gets key. - * Key for the counter-based RNG algorithm (shape uint64[1]). - * @return key. - */ - public Output key() { - return key; - } - - /** - * Gets counter. - * 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). - * @return counter. - */ - public Output counter() { - return counter; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAbs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAbs.java deleted file mode 100644 index 62a9ded2e42..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAbs.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscAbs operation - * - * @param data type for {@code y} output - */ -public final class RiscAbs extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscAbs"; - - private Output y; - - private RiscAbs(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscAbs operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscAbs} output and operands - * @return a new instance of RiscAbs - */ - @Endpoint( - describeByClass = true - ) - public static RiscAbs create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscAbs"); - opBuilder.addInput(x.asOutput()); - return new RiscAbs<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAdd.java deleted file mode 100644 index 9c264ee76c4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscAdd.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * Returns x + y element-wise. - * NOTE: {@code risc.RiscAdd} does not supports broadcasting. - *

      Given two input tensors, the {@code tf.risc_add} operation computes the sum for every element in the tensor. - *

      Both input and output have a range {@code (-inf, inf)}. - * - * @param data type for {@code z} output - */ -public final class RiscAdd extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscAdd"; - - private Output z; - - private RiscAdd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscAdd operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscAdd} output and operands - * @return a new instance of RiscAdd - */ - @Endpoint( - describeByClass = true - ) - public static RiscAdd create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscAdd"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscAdd<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryArithmetic.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryArithmetic.java deleted file mode 100644 index 80c390630cf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryArithmetic.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscBinaryArithmetic operation - * - * @param data type for {@code z} output - */ -public final class RiscBinaryArithmetic extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscBinaryArithmetic"; - - private Output z; - - private RiscBinaryArithmetic(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscBinaryArithmetic operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param opType the value of the opType property - * @param data type for {@code RiscBinaryArithmetic} output and operands - * @return a new instance of RiscBinaryArithmetic - */ - @Endpoint( - describeByClass = true - ) - public static RiscBinaryArithmetic create(Scope scope, Operand x, - Operand y, String opType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscBinaryArithmetic"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - opBuilder.setAttr("op_type", opType); - return new RiscBinaryArithmetic<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryComparison.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryComparison.java deleted file mode 100644 index bfd597f5663..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBinaryComparison.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.TBool; -import org.tensorflow.types.family.TNumber; - -/** - * The RiscBinaryComparison operation - */ -public final class RiscBinaryComparison extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscBinaryComparison"; - - private Output z; - - private RiscBinaryComparison(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscBinaryComparison operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param opType the value of the opType property - * @param data type for {@code RiscBinaryComparison} output and operands - * @return a new instance of RiscBinaryComparison - */ - @Endpoint( - describeByClass = true - ) - public static RiscBinaryComparison create(Scope scope, Operand x, - Operand y, String opType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscBinaryComparison"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - opBuilder.setAttr("op_type", opType); - return new RiscBinaryComparison(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBitcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBitcast.java deleted file mode 100644 index 9eab1ea3e64..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBitcast.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.family.TType; - -/** - * The RiscBitcast operation - * - * @param data type for {@code y} output - */ -public final class RiscBitcast extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscBitcast"; - - private Output y; - - private RiscBitcast(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscBitcast operation. - * - * @param scope current scope - * @param x the x value - * @param DstT the value of the DstT property - * @param data type for {@code RiscBitcast} output and operands - * @return a new instance of RiscBitcast - */ - @Endpoint( - describeByClass = true - ) - public static RiscBitcast create(Scope scope, Operand x, - Class DstT) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscBitcast"); - opBuilder.addInput(x.asOutput()); - opBuilder.setAttr("DstT", Operands.toDataType(DstT)); - return new RiscBitcast<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBroadcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBroadcast.java deleted file mode 100644 index a61a489b630..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscBroadcast.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscBroadcast operation - * - * @param data type for {@code output} output - */ -public final class RiscBroadcast extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscBroadcast"; - - private Output output; - - private RiscBroadcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscBroadcast operation. - * - * @param scope current scope - * @param input the input value - * @param shape the shape value - * @param data type for {@code RiscBroadcast} output and operands - * @return a new instance of RiscBroadcast - */ - @Endpoint( - describeByClass = true - ) - public static RiscBroadcast create(Scope scope, Operand input, - Operand shape) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscBroadcast"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(shape.asOutput()); - return new RiscBroadcast<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCast.java deleted file mode 100644 index 43630d9b0fc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCast.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.family.TType; - -/** - * The RiscCast operation - * - * @param data type for {@code y} output - */ -public final class RiscCast extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscCast"; - - private Output y; - - private RiscCast(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscCast operation. - * - * @param scope current scope - * @param x the x value - * @param DstT the value of the DstT property - * @param data type for {@code RiscCast} output and operands - * @return a new instance of RiscCast - */ - @Endpoint( - describeByClass = true - ) - public static RiscCast create(Scope scope, Operand x, - Class DstT) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscCast"); - opBuilder.addInput(x.asOutput()); - opBuilder.setAttr("DstT", Operands.toDataType(DstT)); - return new RiscCast<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCeil.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCeil.java deleted file mode 100644 index e50de40805e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCeil.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscCeil operation - * - * @param data type for {@code y} output - */ -public final class RiscCeil extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscCeil"; - - private Output y; - - private RiscCeil(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscCeil operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscCeil} output and operands - * @return a new instance of RiscCeil - */ - @Endpoint( - describeByClass = true - ) - public static RiscCeil create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscCeil"); - opBuilder.addInput(x.asOutput()); - return new RiscCeil<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCholesky.java deleted file mode 100644 index e8ff60545ed..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCholesky.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscCholesky operation - * - * @param data type for {@code output} output - */ -public final class RiscCholesky extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscCholesky"; - - private Output output; - - private RiscCholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscCholesky operation. - * - * @param scope current scope - * @param input the input value - * @param data type for {@code RiscCholesky} output and operands - * @return a new instance of RiscCholesky - */ - @Endpoint( - describeByClass = true - ) - public static RiscCholesky create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscCholesky"); - opBuilder.addInput(input.asOutput()); - return new RiscCholesky<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConcat.java deleted file mode 100644 index 26c4d01d62a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConcat.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscConcat operation - * - * @param data type for {@code output} output - */ -public final class RiscConcat extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscConcat"; - - private Output output; - - private RiscConcat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscConcat operation. - * - * @param scope current scope - * @param values the values value - * @param axis the axis value - * @param data type for {@code RiscConcat} output and operands - * @return a new instance of RiscConcat - */ - @Endpoint( - describeByClass = true - ) - public static RiscConcat create(Scope scope, Iterable> values, - Operand axis) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscConcat"); - opBuilder.addInputList(Operands.asOutputs(values)); - opBuilder.addInput(axis.asOutput()); - return new RiscConcat<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCondition.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCondition.java deleted file mode 100644 index cfafe938468..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCondition.java +++ /dev/null @@ -1,94 +0,0 @@ -/* 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.risc; - -import org.tensorflow.ConcreteFunction; -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.types.TBool; -import org.tensorflow.types.family.TNumber; - -/** - * The RiscCondition operation - * - * @param data type for {@code output} output - */ -public final class RiscCondition extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscCondition"; - - private Output output; - - private RiscCondition(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscCondition operation. - * - * @param scope current scope - * @param pred the pred value - * @param inputTrue the inputTrue value - * @param inputFalse the inputFalse value - * @param funcTrue the value of the funcTrue property - * @param funcFalse the value of the funcFalse property - * @param DstT the value of the DstT property - * @param data type for {@code RiscCondition} output and operands - * @param data type for {@code RiscCondition} output and operands - * @return a new instance of RiscCondition - */ - @Endpoint( - describeByClass = true - ) - public static RiscCondition create(Scope scope, - Operand pred, Operand inputTrue, Operand inputFalse, ConcreteFunction funcTrue, - ConcreteFunction funcFalse, Class DstT) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscCondition"); - opBuilder.addInput(pred.asOutput()); - opBuilder.addInput(inputTrue.asOutput()); - opBuilder.addInput(inputFalse.asOutput()); - opBuilder.setAttr("func_true", funcTrue); - opBuilder.setAttr("func_false", funcFalse); - opBuilder.setAttr("DstT", Operands.toDataType(DstT)); - return new RiscCondition<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConv.java deleted file mode 100644 index e5f8100456d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscConv.java +++ /dev/null @@ -1,179 +0,0 @@ -/* 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.risc; - -import java.util.Arrays; -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.types.family.TNumber; - -/** - * The RiscConv operation - * - * @param data type for {@code output} output - */ -public final class RiscConv extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscConv"; - - private Output output; - - private RiscConv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscConv operation. - * - * @param scope current scope - * @param input the input value - * @param filter the filter value - * @param strides the value of the strides property - * @param options carries optional attribute values - * @param data type for {@code RiscConv} output and operands - * @return a new instance of RiscConv - */ - @Endpoint( - describeByClass = true - ) - public static RiscConv create(Scope scope, Operand input, - Operand filter, List strides, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscConv"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(filter.asOutput()); - long[] stridesArray = new long[strides.size()]; - for (int i = 0 ; i < stridesArray.length ; i++) { - stridesArray[i] = strides.get(i); - } - opBuilder.setAttr("strides", stridesArray); - if (options != null) { - for (Options opts : options) { - if (opts.dataFormat != null) { - opBuilder.setAttr("data_format", opts.dataFormat); - } - if (opts.dilations != null) { - long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0 ; i < dilationsArray.length ; i++) { - dilationsArray[i] = opts.dilations.get(i); - } - opBuilder.setAttr("dilations", dilationsArray); - } - } - } - return new RiscConv<>(opBuilder.build()); - } - - /** - * Sets the dataFormat option. - * - * @param dataFormat the dataFormat option - * @return this Options instance. - */ - public static Options dataFormat(String dataFormat) { - return new Options().dataFormat(dataFormat); - } - - /** - * Sets the dilations option. - * - * @param dilations the dilations option - * @return this Options instance. - */ - public static Options dilations(List dilations) { - return new Options().dilations(dilations); - } - - /** - * Sets the dilations option. - * - * @param dilations the dilations option - * @return this Options instance. - */ - public static Options dilations(Long[] dilations) { - return new Options().dilations(dilations); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscConv} - */ - public static class Options { - private String dataFormat; - - private List dilations; - - private Options() { - } - - /** - * Sets the dataFormat option. - * - * @param dataFormat the dataFormat option - * @return this Options instance. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * Sets the dilations option. - * - * @param dilations the dilations option - * @return this Options instance. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * Sets the dilations option. - * - * @param dilations the dilations option - * @return this Options instance. - */ - public Options dilations(Long... dilations) { - this.dilations = Arrays.asList(dilations); - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCos.java deleted file mode 100644 index c82fa527614..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscCos.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscCos operation - * - * @param data type for {@code y} output - */ -public final class RiscCos extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscCos"; - - private Output y; - - private RiscCos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscCos operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscCos} output and operands - * @return a new instance of RiscCos - */ - @Endpoint( - describeByClass = true - ) - public static RiscCos create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscCos"); - opBuilder.addInput(x.asOutput()); - return new RiscCos<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDiv.java deleted file mode 100644 index aa272b56121..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDiv.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscDiv operation - * - * @param data type for {@code z} output - */ -public final class RiscDiv extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscDiv"; - - private Output z; - - private RiscDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscDiv operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscDiv} output and operands - * @return a new instance of RiscDiv - */ - @Endpoint( - describeByClass = true - ) - public static RiscDiv create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscDiv"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscDiv<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDot.java deleted file mode 100644 index ddae24dbde4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscDot.java +++ /dev/null @@ -1,146 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscDot operation - * - * @param data type for {@code product} output - */ -public final class RiscDot extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscDot"; - - private Output product; - - private RiscDot(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscDot operation. - * - * @param scope current scope - * @param a the a value - * @param b the b value - * @param options carries optional attribute values - * @param data type for {@code RiscDot} output and operands - * @return a new instance of RiscDot - */ - @Endpoint( - describeByClass = true - ) - public static RiscDot create(Scope scope, Operand a, Operand b, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscDot"); - opBuilder.addInput(a.asOutput()); - opBuilder.addInput(b.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.transposeA != null) { - opBuilder.setAttr("transpose_a", opts.transposeA); - } - if (opts.transposeB != null) { - opBuilder.setAttr("transpose_b", opts.transposeB); - } - } - } - return new RiscDot<>(opBuilder.build()); - } - - /** - * Sets the transposeA option. - * - * @param transposeA the transposeA option - * @return this Options instance. - */ - public static Options transposeA(Boolean transposeA) { - return new Options().transposeA(transposeA); - } - - /** - * Sets the transposeB option. - * - * @param transposeB the transposeB option - * @return this Options instance. - */ - public static Options transposeB(Boolean transposeB) { - return new Options().transposeB(transposeB); - } - - /** - * Gets product. - * - * @return product. - */ - public Output product() { - return product; - } - - @Override - public Output asOutput() { - return product; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscDot} - */ - public static class Options { - private Boolean transposeA; - - private Boolean transposeB; - - private Options() { - } - - /** - * Sets the transposeA option. - * - * @param transposeA the transposeA option - * @return this Options instance. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * Sets the transposeB option. - * - * @param transposeB the transposeB option - * @return this Options instance. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscExp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscExp.java deleted file mode 100644 index 07e4e22f52d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscExp.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscExp operation - * - * @param data type for {@code y} output - */ -public final class RiscExp extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscExp"; - - private Output y; - - private RiscExp(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscExp operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscExp} output and operands - * @return a new instance of RiscExp - */ - @Endpoint( - describeByClass = true - ) - public static RiscExp create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscExp"); - opBuilder.addInput(x.asOutput()); - return new RiscExp<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFft.java deleted file mode 100644 index c835dc4e652..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFft.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TType; - -/** - * The RiscFft operation - * - * @param data type for {@code output} output - */ -public final class RiscFft extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscFft"; - - private Output output; - - private RiscFft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscFft operation. - * - * @param scope current scope - * @param input the input value - * @param data type for {@code RiscFft} output and operands - * @return a new instance of RiscFft - */ - @Endpoint( - describeByClass = true - ) - public static RiscFft create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscFft"); - opBuilder.addInput(input.asOutput()); - return new RiscFft<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFloor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFloor.java deleted file mode 100644 index 4f3d19c6ac2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscFloor.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscFloor operation - * - * @param data type for {@code y} output - */ -public final class RiscFloor extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscFloor"; - - private Output y; - - private RiscFloor(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscFloor operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscFloor} output and operands - * @return a new instance of RiscFloor - */ - @Endpoint( - describeByClass = true - ) - public static RiscFloor create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscFloor"); - opBuilder.addInput(x.asOutput()); - return new RiscFloor<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscGather.java deleted file mode 100644 index 3db996340a5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscGather.java +++ /dev/null @@ -1,123 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscGather operation - * - * @param data type for {@code output} output - */ -public final class RiscGather extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscGather"; - - private Output output; - - private RiscGather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscGather operation. - * - * @param scope current scope - * @param params the params value - * @param indices the indices value - * @param axis the axis value - * @param options carries optional attribute values - * @param data type for {@code RiscGather} output and operands - * @return a new instance of RiscGather - */ - @Endpoint( - describeByClass = true - ) - public static RiscGather create(Scope scope, Operand params, - Operand indices, Operand axis, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscGather"); - opBuilder.addInput(params.asOutput()); - opBuilder.addInput(indices.asOutput()); - opBuilder.addInput(axis.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.batchDims != null) { - opBuilder.setAttr("batch_dims", opts.batchDims); - } - } - } - return new RiscGather<>(opBuilder.build()); - } - - /** - * Sets the batchDims option. - * - * @param batchDims the batchDims option - * @return this Options instance. - */ - public static Options batchDims(Long batchDims) { - return new Options().batchDims(batchDims); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscGather} - */ - public static class Options { - private Long batchDims; - - private Options() { - } - - /** - * Sets the batchDims option. - * - * @param batchDims the batchDims option - * @return this Options instance. - */ - public Options batchDims(Long batchDims) { - this.batchDims = batchDims; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscImag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscImag.java deleted file mode 100644 index 0b48641bf62..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscImag.java +++ /dev/null @@ -1,98 +0,0 @@ -/* 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.risc; - -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.types.TFloat32; -import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscImag operation - * - * @param data type for {@code output} output - */ -public final class RiscImag extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscImag"; - - private Output output; - - private RiscImag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscImag operation. - * - * @param scope current scope - * @param input the input value - * @param Tout the value of the Tout property - * @param data type for {@code RiscImag} output and operands - * @return a new instance of RiscImag - */ - @Endpoint( - describeByClass = true - ) - public static RiscImag create(Scope scope, Operand input, - Class Tout) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscImag"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new RiscImag<>(opBuilder.build()); - } - - /** - * Factory method to create a class wrapping a new RiscImag operation, with the default output types. - * - * @param scope current scope - * @param input the input value - * @return a new instance of RiscImag, with default output types - */ - @Endpoint( - describeByClass = true - ) - public static RiscImag create(Scope scope, Operand input) { - return create(scope, input, TFloat32.class); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscIsFinite.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscIsFinite.java deleted file mode 100644 index 79371c4fa1e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscIsFinite.java +++ /dev/null @@ -1,76 +0,0 @@ -/* 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.risc; - -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.types.TBool; -import org.tensorflow.types.family.TNumber; - -/** - * The RiscIsFinite operation - */ -public final class RiscIsFinite extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscIsFinite"; - - private Output y; - - private RiscIsFinite(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscIsFinite operation. - * - * @param scope current scope - * @param x the x value - * @return a new instance of RiscIsFinite - */ - @Endpoint( - describeByClass = true - ) - public static RiscIsFinite create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscIsFinite"); - opBuilder.addInput(x.asOutput()); - return new RiscIsFinite(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLog.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLog.java deleted file mode 100644 index e04167ef115..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLog.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscLog operation - * - * @param data type for {@code y} output - */ -public final class RiscLog extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscLog"; - - private Output y; - - private RiscLog(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscLog operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscLog} output and operands - * @return a new instance of RiscLog - */ - @Endpoint( - describeByClass = true - ) - public static RiscLog create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscLog"); - opBuilder.addInput(x.asOutput()); - return new RiscLog<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalAnd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalAnd.java deleted file mode 100644 index 72bbd770a90..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalAnd.java +++ /dev/null @@ -1,77 +0,0 @@ -/* 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.risc; - -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.types.TBool; - -/** - * The RiscLogicalAnd operation - */ -public final class RiscLogicalAnd extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscLogicalAnd"; - - private Output z; - - private RiscLogicalAnd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscLogicalAnd operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @return a new instance of RiscLogicalAnd - */ - @Endpoint( - describeByClass = true - ) - public static RiscLogicalAnd create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscLogicalAnd"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscLogicalAnd(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalNot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalNot.java deleted file mode 100644 index 74c9a634ea8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalNot.java +++ /dev/null @@ -1,75 +0,0 @@ -/* 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.risc; - -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.types.TBool; - -/** - * The RiscLogicalNot operation - */ -public final class RiscLogicalNot extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscLogicalNot"; - - private Output z; - - private RiscLogicalNot(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscLogicalNot operation. - * - * @param scope current scope - * @param x the x value - * @return a new instance of RiscLogicalNot - */ - @Endpoint( - describeByClass = true - ) - public static RiscLogicalNot create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscLogicalNot"); - opBuilder.addInput(x.asOutput()); - return new RiscLogicalNot(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalOr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalOr.java deleted file mode 100644 index d22cbd7de03..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscLogicalOr.java +++ /dev/null @@ -1,77 +0,0 @@ -/* 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.risc; - -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.types.TBool; - -/** - * The RiscLogicalOr operation - */ -public final class RiscLogicalOr extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscLogicalOr"; - - private Output z; - - private RiscLogicalOr(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscLogicalOr operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @return a new instance of RiscLogicalOr - */ - @Endpoint( - describeByClass = true - ) - public static RiscLogicalOr create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscLogicalOr"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscLogicalOr(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMax.java deleted file mode 100644 index e415799e553..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMax.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * Returns max(x, y) element-wise. - * NOTE: {@code risc.RiscMax} does not supports broadcasting. - *

      Given two input tensors, the {@code tf.risc_max} operation computes the maximum for every element in the tensor. - * - * @param data type for {@code max} output - */ -public final class RiscMax extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscMax"; - - private Output max; - - private RiscMax(Operation operation) { - super(operation); - int outputIdx = 0; - max = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscMax operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscMax} output and operands - * @return a new instance of RiscMax - */ - @Endpoint( - describeByClass = true - ) - public static RiscMax create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscMax"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscMax<>(opBuilder.build()); - } - - /** - * Gets max. - * - * @return max. - */ - public Output max() { - return max; - } - - @Override - public Output asOutput() { - return max; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMin.java deleted file mode 100644 index 2063b4a32fb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMin.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscMin operation - * - * @param data type for {@code z} output - */ -public final class RiscMin extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscMin"; - - private Output z; - - private RiscMin(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscMin operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscMin} output and operands - * @return a new instance of RiscMin - */ - @Endpoint( - describeByClass = true - ) - public static RiscMin create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscMin"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscMin<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMul.java deleted file mode 100644 index 6bc95f2f430..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscMul.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscMul operation - * - * @param data type for {@code z} output - */ -public final class RiscMul extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscMul"; - - private Output z; - - private RiscMul(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscMul operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscMul} output and operands - * @return a new instance of RiscMul - */ - @Endpoint( - describeByClass = true - ) - public static RiscMul create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscMul"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscMul<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscNeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscNeg.java deleted file mode 100644 index 0ac4df637da..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscNeg.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscNeg operation - * - * @param data type for {@code y} output - */ -public final class RiscNeg extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscNeg"; - - private Output y; - - private RiscNeg(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscNeg operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscNeg} output and operands - * @return a new instance of RiscNeg - */ - @Endpoint( - describeByClass = true - ) - public static RiscNeg create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscNeg"); - opBuilder.addInput(x.asOutput()); - return new RiscNeg<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPad.java deleted file mode 100644 index d237088a626..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPad.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscPad operation - * - * @param data type for {@code output} output - */ -public final class RiscPad extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscPad"; - - private Output output; - - private RiscPad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscPad operation. - * - * @param scope current scope - * @param input the input value - * @param paddings the paddings value - * @param constantValues the constantValues value - * @param data type for {@code RiscPad} output and operands - * @return a new instance of RiscPad - */ - @Endpoint( - describeByClass = true - ) - public static RiscPad create(Scope scope, Operand input, - Operand paddings, Operand constantValues) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscPad"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(paddings.asOutput()); - opBuilder.addInput(constantValues.asOutput()); - return new RiscPad<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPool.java deleted file mode 100644 index 66fd3cbe326..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPool.java +++ /dev/null @@ -1,133 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscPool operation - * - * @param data type for {@code output} output - */ -public final class RiscPool extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscPool"; - - private Output output; - - private RiscPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscPool operation. - * - * @param scope current scope - * @param value the value value - * @param ksize the value of the ksize property - * @param strides the value of the strides property - * @param poolingType the value of the poolingType property - * @param options carries optional attribute values - * @param data type for {@code RiscPool} output and operands - * @return a new instance of RiscPool - */ - @Endpoint( - describeByClass = true - ) - public static RiscPool create(Scope scope, Operand value, - List ksize, List strides, String poolingType, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscPool"); - opBuilder.addInput(value.asOutput()); - long[] ksizeArray = new long[ksize.size()]; - for (int i = 0 ; i < ksizeArray.length ; i++) { - ksizeArray[i] = ksize.get(i); - } - opBuilder.setAttr("ksize", ksizeArray); - long[] stridesArray = new long[strides.size()]; - for (int i = 0 ; i < stridesArray.length ; i++) { - stridesArray[i] = strides.get(i); - } - opBuilder.setAttr("strides", stridesArray); - opBuilder.setAttr("pooling_type", poolingType); - if (options != null) { - for (Options opts : options) { - if (opts.dataFormat != null) { - opBuilder.setAttr("data_format", opts.dataFormat); - } - } - } - return new RiscPool<>(opBuilder.build()); - } - - /** - * Sets the dataFormat option. - * - * @param dataFormat the dataFormat option - * @return this Options instance. - */ - public static Options dataFormat(String dataFormat) { - return new Options().dataFormat(dataFormat); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscPool} - */ - public static class Options { - private String dataFormat; - - private Options() { - } - - /** - * Sets the dataFormat option. - * - * @param dataFormat the dataFormat option - * @return this Options instance. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPow.java deleted file mode 100644 index 57261654a6d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscPow.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscPow operation - * - * @param data type for {@code z} output - */ -public final class RiscPow extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscPow"; - - private Output z; - - private RiscPow(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscPow operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscPow} output and operands - * @return a new instance of RiscPow - */ - @Endpoint( - describeByClass = true - ) - public static RiscPow create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscPow"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscPow<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRandomUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRandomUniform.java deleted file mode 100644 index 194bbf3a944..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRandomUniform.java +++ /dev/null @@ -1,116 +0,0 @@ -/* 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.risc; - -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.types.TFloat32; -import org.tensorflow.types.family.TNumber; - -/** - * The RiscRandomUniform operation - */ -public final class RiscRandomUniform extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscRandomUniform"; - - private Output output; - - private RiscRandomUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscRandomUniform operation. - * - * @param scope current scope - * @param shape the shape value - * @param options carries optional attribute values - * @return a new instance of RiscRandomUniform - */ - @Endpoint( - describeByClass = true - ) - public static RiscRandomUniform create(Scope scope, Operand shape, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscRandomUniform"); - opBuilder.addInput(shape.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.seed != null) { - opBuilder.setAttr("seed", opts.seed); - } - } - } - return new RiscRandomUniform(opBuilder.build()); - } - - /** - * Sets the seed option. - * - * @param seed the seed option - * @return this Options instance. - */ - public static Options seed(Long seed) { - return new Options().seed(seed); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscRandomUniform} - */ - public static class Options { - private Long seed; - - private Options() { - } - - /** - * Sets the seed option. - * - * @param seed the seed option - * @return this Options instance. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReal.java deleted file mode 100644 index 2751bd35a2e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReal.java +++ /dev/null @@ -1,98 +0,0 @@ -/* 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.risc; - -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.types.TFloat32; -import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscReal operation - * - * @param data type for {@code output} output - */ -public final class RiscReal extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscReal"; - - private Output output; - - private RiscReal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscReal operation. - * - * @param scope current scope - * @param input the input value - * @param Tout the value of the Tout property - * @param data type for {@code RiscReal} output and operands - * @return a new instance of RiscReal - */ - @Endpoint( - describeByClass = true - ) - public static RiscReal create(Scope scope, Operand input, - Class Tout) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscReal"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new RiscReal<>(opBuilder.build()); - } - - /** - * Factory method to create a class wrapping a new RiscReal operation, with the default output types. - * - * @param scope current scope - * @param input the input value - * @return a new instance of RiscReal, with default output types - */ - @Endpoint( - describeByClass = true - ) - public static RiscReal create(Scope scope, Operand input) { - return create(scope, input, TFloat32.class); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReduce.java deleted file mode 100644 index 6fdba24a2a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReduce.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscReduce operation - * - * @param data type for {@code output} output - */ -public final class RiscReduce extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscReduce"; - - private Output output; - - private RiscReduce(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscReduce operation. - * - * @param scope current scope - * @param tensor the tensor value - * @param axis the axis value - * @param reduceType the value of the reduceType property - * @param data type for {@code RiscReduce} output and operands - * @return a new instance of RiscReduce - */ - @Endpoint( - describeByClass = true - ) - public static RiscReduce create(Scope scope, Operand tensor, - Operand axis, String reduceType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscReduce"); - opBuilder.addInput(tensor.asOutput()); - opBuilder.addInput(axis.asOutput()); - opBuilder.setAttr("reduce_type", reduceType); - return new RiscReduce<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRem.java deleted file mode 100644 index a5afe0bc654..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscRem.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscRem operation - * - * @param data type for {@code z} output - */ -public final class RiscRem extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscRem"; - - private Output z; - - private RiscRem(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscRem operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscRem} output and operands - * @return a new instance of RiscRem - */ - @Endpoint( - describeByClass = true - ) - public static RiscRem create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscRem"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscRem<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReshape.java deleted file mode 100644 index e38b38da3b8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReshape.java +++ /dev/null @@ -1,81 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscReshape operation - * - * @param data type for {@code output} output - */ -public final class RiscReshape extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscReshape"; - - private Output output; - - private RiscReshape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscReshape operation. - * - * @param scope current scope - * @param tensor the tensor value - * @param shape the shape value - * @param data type for {@code RiscReshape} output and operands - * @return a new instance of RiscReshape - */ - @Endpoint( - describeByClass = true - ) - public static RiscReshape create(Scope scope, Operand tensor, - Operand shape) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscReshape"); - opBuilder.addInput(tensor.asOutput()); - opBuilder.addInput(shape.asOutput()); - return new RiscReshape<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReverse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReverse.java deleted file mode 100644 index 01bc414dcea..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscReverse.java +++ /dev/null @@ -1,81 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscReverse operation - * - * @param data type for {@code output} output - */ -public final class RiscReverse extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscReverse"; - - private Output output; - - private RiscReverse(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscReverse operation. - * - * @param scope current scope - * @param tensor the tensor value - * @param axis the axis value - * @param data type for {@code RiscReverse} output and operands - * @return a new instance of RiscReverse - */ - @Endpoint( - describeByClass = true - ) - public static RiscReverse create(Scope scope, Operand tensor, - Operand axis) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscReverse"); - opBuilder.addInput(tensor.asOutput()); - opBuilder.addInput(axis.asOutput()); - return new RiscReverse<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscScatter.java deleted file mode 100644 index 7cff6bf97d7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscScatter.java +++ /dev/null @@ -1,84 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscScatter operation - * - * @param data type for {@code output} output - */ -public final class RiscScatter extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscScatter"; - - private Output output; - - private RiscScatter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscScatter operation. - * - * @param scope current scope - * @param indices the indices value - * @param updates the updates value - * @param shape the shape value - * @param data type for {@code RiscScatter} output and operands - * @param data type for {@code RiscScatter} output and operands - * @return a new instance of RiscScatter - */ - @Endpoint( - describeByClass = true - ) - public static RiscScatter create(Scope scope, - Operand indices, Operand updates, Operand shape) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscScatter"); - opBuilder.addInput(indices.asOutput()); - opBuilder.addInput(updates.asOutput()); - opBuilder.addInput(shape.asOutput()); - return new RiscScatter<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscShape.java deleted file mode 100644 index e62af54f8ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscShape.java +++ /dev/null @@ -1,97 +0,0 @@ -/* 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.risc; - -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.types.TInt32; -import org.tensorflow.types.family.TNumber; - -/** - * The RiscShape operation - * - * @param data type for {@code output} output - */ -public final class RiscShape extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscShape"; - - private Output output; - - private RiscShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscShape operation. - * - * @param scope current scope - * @param input the input value - * @param outType the value of the outType property - * @param data type for {@code RiscShape} output and operands - * @return a new instance of RiscShape - */ - @Endpoint( - describeByClass = true - ) - public static RiscShape create(Scope scope, - Operand input, Class outType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscShape"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new RiscShape<>(opBuilder.build()); - } - - /** - * Factory method to create a class wrapping a new RiscShape operation, with the default output types. - * - * @param scope current scope - * @param input the input value - * @return a new instance of RiscShape, with default output types - */ - @Endpoint( - describeByClass = true - ) - public static RiscShape create(Scope scope, Operand input) { - return create(scope, input, TInt32.class); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSign.java deleted file mode 100644 index adc02df655b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSign.java +++ /dev/null @@ -1,78 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscSign operation - * - * @param data type for {@code y} output - */ -public final class RiscSign extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscSign"; - - private Output y; - - private RiscSign(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscSign operation. - * - * @param scope current scope - * @param x the x value - * @param data type for {@code RiscSign} output and operands - * @return a new instance of RiscSign - */ - @Endpoint( - describeByClass = true - ) - public static RiscSign create(Scope scope, Operand x) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscSign"); - opBuilder.addInput(x.asOutput()); - return new RiscSign<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSlice.java deleted file mode 100644 index 021766472b9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSlice.java +++ /dev/null @@ -1,84 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscSlice operation - * - * @param data type for {@code output} output - */ -public final class RiscSlice extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscSlice"; - - private Output output; - - private RiscSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscSlice operation. - * - * @param scope current scope - * @param input the input value - * @param begin the begin value - * @param sizeOutput the sizeOutput value - * @param data type for {@code RiscSlice} output and operands - * @param data type for {@code RiscSlice} output and operands - * @return a new instance of RiscSlice - */ - @Endpoint( - describeByClass = true - ) - public static RiscSlice create(Scope scope, - Operand input, Operand begin, Operand sizeOutput) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscSlice"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(begin.asOutput()); - opBuilder.addInput(sizeOutput.asOutput()); - return new RiscSlice<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSort.java deleted file mode 100644 index 8740f1e2b38..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSort.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscSort operation - * - * @param data type for {@code output} output - */ -public final class RiscSort extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscSort"; - - private Output output; - - private RiscSort(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscSort operation. - * - * @param scope current scope - * @param input the input value - * @param axis the axis value - * @param direction the value of the direction property - * @param data type for {@code RiscSort} output and operands - * @return a new instance of RiscSort - */ - @Endpoint( - describeByClass = true - ) - public static RiscSort create(Scope scope, Operand input, - Operand axis, String direction) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscSort"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(axis.asOutput()); - opBuilder.setAttr("direction", direction); - return new RiscSort<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSqueeze.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSqueeze.java deleted file mode 100644 index 0f4aa6bb852..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSqueeze.java +++ /dev/null @@ -1,145 +0,0 @@ -/* 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.risc; - -import java.util.Arrays; -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.types.family.TType; - -/** - * The RiscSqueeze operation - * - * @param data type for {@code output} output - */ -public final class RiscSqueeze extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscSqueeze"; - - private Output output; - - private RiscSqueeze(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscSqueeze operation. - * - * @param scope current scope - * @param input the input value - * @param options carries optional attribute values - * @param data type for {@code RiscSqueeze} output and operands - * @return a new instance of RiscSqueeze - */ - @Endpoint( - describeByClass = true - ) - public static RiscSqueeze create(Scope scope, Operand input, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscSqueeze"); - opBuilder.addInput(input.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.squeezeDims != null) { - long[] squeezeDimsArray = new long[opts.squeezeDims.size()]; - for (int i = 0 ; i < squeezeDimsArray.length ; i++) { - squeezeDimsArray[i] = opts.squeezeDims.get(i); - } - opBuilder.setAttr("squeeze_dims", squeezeDimsArray); - } - } - } - return new RiscSqueeze<>(opBuilder.build()); - } - - /** - * Sets the squeezeDims option. - * - * @param squeezeDims the squeezeDims option - * @return this Options instance. - */ - public static Options squeezeDims(List squeezeDims) { - return new Options().squeezeDims(squeezeDims); - } - - /** - * Sets the squeezeDims option. - * - * @param squeezeDims the squeezeDims option - * @return this Options instance. - */ - public static Options squeezeDims(Long[] squeezeDims) { - return new Options().squeezeDims(squeezeDims); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscSqueeze} - */ - public static class Options { - private List squeezeDims; - - private Options() { - } - - /** - * Sets the squeezeDims option. - * - * @param squeezeDims the squeezeDims option - * @return this Options instance. - */ - public Options squeezeDims(List squeezeDims) { - this.squeezeDims = squeezeDims; - return this; - } - - /** - * Sets the squeezeDims option. - * - * @param squeezeDims the squeezeDims option - * @return this Options instance. - */ - public Options squeezeDims(Long... squeezeDims) { - this.squeezeDims = Arrays.asList(squeezeDims); - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSub.java deleted file mode 100644 index d52f056319e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscSub.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscSub operation - * - * @param data type for {@code z} output - */ -public final class RiscSub extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscSub"; - - private Output z; - - private RiscSub(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscSub operation. - * - * @param scope current scope - * @param x the x value - * @param y the y value - * @param data type for {@code RiscSub} output and operands - * @return a new instance of RiscSub - */ - @Endpoint( - describeByClass = true - ) - public static RiscSub create(Scope scope, Operand x, Operand y) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscSub"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(y.asOutput()); - return new RiscSub<>(opBuilder.build()); - } - - /** - * Gets z. - * - * @return z. - */ - public Output z() { - return z; - } - - @Override - public Output asOutput() { - return z; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTranspose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTranspose.java deleted file mode 100644 index 3d84b52f2c8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTranspose.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * The RiscTranspose operation - * - * @param data type for {@code y} output - */ -public final class RiscTranspose extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscTranspose"; - - private Output y; - - private RiscTranspose(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscTranspose operation. - * - * @param scope current scope - * @param x the x value - * @param perm the perm value - * @param data type for {@code RiscTranspose} output and operands - * @return a new instance of RiscTranspose - */ - @Endpoint( - describeByClass = true - ) - public static RiscTranspose create(Scope scope, Operand x, - Operand perm) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscTranspose"); - opBuilder.addInput(x.asOutput()); - opBuilder.addInput(perm.asOutput()); - return new RiscTranspose<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTriangularSolve.java deleted file mode 100644 index d7e8df3c8c1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscTriangularSolve.java +++ /dev/null @@ -1,146 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscTriangularSolve operation - * - * @param data type for {@code output} output - */ -public final class RiscTriangularSolve extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscTriangularSolve"; - - private Output output; - - private RiscTriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscTriangularSolve operation. - * - * @param scope current scope - * @param matrix the matrix value - * @param rhs the rhs value - * @param options carries optional attribute values - * @param data type for {@code RiscTriangularSolve} output and operands - * @return a new instance of RiscTriangularSolve - */ - @Endpoint( - describeByClass = true - ) - public static RiscTriangularSolve create(Scope scope, Operand matrix, - Operand rhs, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscTriangularSolve"); - opBuilder.addInput(matrix.asOutput()); - opBuilder.addInput(rhs.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.lower != null) { - opBuilder.setAttr("lower", opts.lower); - } - if (opts.adjoint != null) { - opBuilder.setAttr("adjoint", opts.adjoint); - } - } - } - return new RiscTriangularSolve<>(opBuilder.build()); - } - - /** - * Sets the lower option. - * - * @param lower the lower option - * @return this Options instance. - */ - public static Options lower(Boolean lower) { - return new Options().lower(lower); - } - - /** - * Sets the adjoint option. - * - * @param adjoint the adjoint option - * @return this Options instance. - */ - public static Options adjoint(Boolean adjoint) { - return new Options().adjoint(adjoint); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscTriangularSolve} - */ - public static class Options { - private Boolean lower; - - private Boolean adjoint; - - private Options() { - } - - /** - * Sets the lower option. - * - * @param lower the lower option - * @return this Options instance. - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * Sets the adjoint option. - * - * @param adjoint the adjoint option - * @return this Options instance. - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscUnary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscUnary.java deleted file mode 100644 index 0af89d9cfa0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscUnary.java +++ /dev/null @@ -1,80 +0,0 @@ -/* 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.risc; - -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.types.family.TNumber; - -/** - * The RiscUnary operation - * - * @param data type for {@code y} output - */ -public final class RiscUnary extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscUnary"; - - private Output y; - - private RiscUnary(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RiscUnary operation. - * - * @param scope current scope - * @param x the x value - * @param opType the value of the opType property - * @param data type for {@code RiscUnary} output and operands - * @return a new instance of RiscUnary - */ - @Endpoint( - describeByClass = true - ) - public static RiscUnary create(Scope scope, Operand x, String opType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscUnary"); - opBuilder.addInput(x.asOutput()); - opBuilder.setAttr("op_type", opType); - return new RiscUnary<>(opBuilder.build()); - } - - /** - * Gets y. - * - * @return y. - */ - public Output y() { - return y; - } - - @Override - public Output asOutput() { - return y; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscWhile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscWhile.java deleted file mode 100644 index ba34e5122b5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/risc/RiscWhile.java +++ /dev/null @@ -1,180 +0,0 @@ -/* 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.risc; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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.types.family.TType; - -/** - * The RiscWhile operation - */ -public final class RiscWhile extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RiscWhile"; - - private List> output; - - @SuppressWarnings("unchecked") - private RiscWhile(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } - - /** - * Factory method to create a class wrapping a new RiscWhile operation. - * - * @param scope current scope - * @param input the input value - * @param cond the value of the cond property - * @param body the value of the body property - * @param options carries optional attribute values - * @return a new instance of RiscWhile - */ - @Endpoint( - describeByClass = true - ) - public static RiscWhile create(Scope scope, Iterable> input, ConcreteFunction cond, - ConcreteFunction body, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RiscWhile"); - opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder.setAttr("cond", cond); - opBuilder.setAttr("body", body); - if (options != null) { - for (Options opts : options) { - if (opts.outputShapes != null) { - Shape[] outputShapesArray = new Shape[opts.outputShapes.size()]; - for (int i = 0 ; i < outputShapesArray.length ; i++) { - outputShapesArray[i] = opts.outputShapes.get(i); - } - opBuilder.setAttr("output_shapes", outputShapesArray); - } - if (opts.parallelIterations != null) { - opBuilder.setAttr("parallel_iterations", opts.parallelIterations); - } - } - } - return new RiscWhile(opBuilder.build()); - } - - /** - * Sets the outputShapes option. - * - * @param outputShapes the outputShapes option - * @return this Options instance. - */ - public static Options outputShapes(List outputShapes) { - return new Options().outputShapes(outputShapes); - } - - /** - * Sets the outputShapes option. - * - * @param outputShapes the outputShapes option - * @return this Options instance. - */ - public static Options outputShapes(Shape[] outputShapes) { - return new Options().outputShapes(outputShapes); - } - - /** - * Sets the parallelIterations option. - * - * @param parallelIterations the parallelIterations option - * @return this Options instance. - */ - public static Options parallelIterations(Long parallelIterations) { - return new Options().parallelIterations(parallelIterations); - } - - /** - * Gets output. - * - * @return output. - */ - public List> output() { - return output; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) output.iterator(); - } - - /** - * Optional attributes for {@link org.tensorflow.op.risc.RiscWhile} - */ - public static class Options { - private List outputShapes; - - private Long parallelIterations; - - private Options() { - } - - /** - * Sets the outputShapes option. - * - * @param outputShapes the outputShapes option - * @return this Options instance. - */ - public Options outputShapes(List outputShapes) { - this.outputShapes = outputShapes; - return this; - } - - /** - * Sets the outputShapes option. - * - * @param outputShapes the outputShapes option - * @return this Options instance. - */ - public Options outputShapes(Shape... outputShapes) { - this.outputShapes = Arrays.asList(outputShapes); - return this; - } - - /** - * Sets the parallelIterations option. - * - * @param parallelIterations the parallelIterations option - * @return this Options instance. - */ - public Options parallelIterations(Long parallelIterations) { - this.parallelIterations = parallelIterations; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java index 742b9fe08c4..aefc620caff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchFFT operation */ +@OpMetadata( + opType = BatchFft.OP_NAME, + inputsClass = BatchFft.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchFft extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchFft(Operation operation) { - super(operation); + public BatchFft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchFft(Operation operation) { * Factory method to create a class wrapping a new BatchFFT operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchFft */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchFft.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchFft(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java index 6767347af52..03f2f1f5f30 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchFFT2D operation */ +@OpMetadata( + opType = BatchFft2d.OP_NAME, + inputsClass = BatchFft2d.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchFft2d extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchFft2d(Operation operation) { - super(operation); + public BatchFft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchFft2d(Operation operation) { * Factory method to create a class wrapping a new BatchFFT2D operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchFft2d */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchFft2d.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchFft2d(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java index 91e241a7754..5ba203b113b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchFFT3D operation */ +@OpMetadata( + opType = BatchFft3d.OP_NAME, + inputsClass = BatchFft3d.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchFft3d extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchFft3d(Operation operation) { - super(operation); + public BatchFft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchFft3d(Operation operation) { * Factory method to create a class wrapping a new BatchFFT3D operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchFft3d */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchFft3d.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchFft3d(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java index f9268e359ae..54c3c6fe9d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchIFFT operation */ +@OpMetadata( + opType = BatchIfft.OP_NAME, + inputsClass = BatchIfft.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchIfft extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchIfft(Operation operation) { - super(operation); + public BatchIfft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchIfft(Operation operation) { * Factory method to create a class wrapping a new BatchIFFT operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchIfft.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchIfft(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java index 163b0271985..9c9a8160d17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchIFFT2D operation */ +@OpMetadata( + opType = BatchIfft2d.OP_NAME, + inputsClass = BatchIfft2d.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchIfft2d extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchIfft2d(Operation operation) { - super(operation); + public BatchIfft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchIfft2d(Operation operation) { * Factory method to create a class wrapping a new BatchIFFT2D operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft2d */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchIfft2d.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchIfft2d(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java index 32011d3e585..0ae48ebce45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The BatchIFFT3D operation */ +@OpMetadata( + opType = BatchIfft3d.OP_NAME, + inputsClass = BatchIfft3d.Inputs.class +) @Operator( group = "signal" ) @@ -42,8 +51,8 @@ public final class BatchIfft3d extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private BatchIfft3d(Operation operation) { - super(operation); + public BatchIfft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -52,7 +61,7 @@ private BatchIfft3d(Operation operation) { * Factory method to create a class wrapping a new BatchIFFT3D operation. * * @param scope current scope - * @param input the input value + * @param input The input value * @return a new instance of BatchIfft3d */ @Endpoint( @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return (Output) output; } + + @OpInputsMetadata( + outputsClass = BatchIfft3d.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new BatchIfft3d(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java index f4a1f5c64d8..220c72d1723 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Fast Fourier transform. * Computes the 1-dimensional discrete Fourier transform over the inner-most * dimension of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Fft.OP_NAME, + inputsClass = Fft.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Fft extends RawOp implements Operand { private Output output; - private Fft(Operation operation) { - super(operation); + public Fft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Fft.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Fft<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java index 63778ffca11..4f78086027b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * 2D fast Fourier transform. * Computes the 2-dimensional discrete Fourier transform over the inner-most * 2 dimensions of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Fft2d.OP_NAME, + inputsClass = Fft2d.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Fft2d extends RawOp implements Operand { private Output output; - private Fft2d(Operation operation) { - super(operation); + public Fft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Fft2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Fft2d<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java index 41ce94f46c3..7f5478e228a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * 3D fast Fourier transform. * Computes the 3-dimensional discrete Fourier transform over the inner-most 3 * dimensions of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Fft3d.OP_NAME, + inputsClass = Fft3d.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Fft3d extends RawOp implements Operand { private Output output; - private Fft3d(Operation operation) { - super(operation); + public Fft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Fft3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Fft3d<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/FftNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/FftNd.java new file mode 100644 index 00000000000..8f530229379 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/FftNd.java @@ -0,0 +1,142 @@ +/* Copyright 2018-2023 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.signal; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * ND fast Fourier transform. + * Computes the n-dimensional discrete Fourier transform over + * designated dimensions of {@code input}. The designated dimensions of + * {@code input} are assumed to be the result of {@code signal.FftNd}. + *

      If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

      Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + */ +@OpMetadata( + opType = FftNd.OP_NAME, + inputsClass = FftNd.Inputs.class +) +@Operator( + group = "signal" +) +public final class FftNd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFTND"; + + private Output output; + + public FftNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFTND operation. + * + * @param scope current scope + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param data type for {@code FFTND} output and operands + * @return a new instance of FftNd + */ + @Endpoint( + describeByClass = true + ) + public static FftNd create(Scope scope, Operand input, + Operand fftLength, Operand axes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FftNd"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(fftLength.asOutput()); + opBuilder.addInput(axes.asOutput()); + return new FftNd<>(opBuilder.build()); + } + + /** + * Gets output. + * A complex tensor of the same shape as {@code input}. The designated + * dimensions of {@code input} are replaced with their Fourier transforms. + *

      {@literal @}compatibility(numpy)
      + * Equivalent to np.fft.fftn. + *
      {@literal @}end_compatibility + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = FftNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * An int32 tensor with a same shape as fft_length. Axes to perform the transform. + */ + public final Operand axes; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new FftNd<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + axes = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java index 2a4b7b56db8..6b1f6fa6d8c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Inverse fast Fourier transform. * Computes the inverse 1-dimensional discrete Fourier transform over the * inner-most dimension of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Ifft.OP_NAME, + inputsClass = Ifft.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Ifft extends RawOp implements Operand { private Output output; - private Ifft(Operation operation) { - super(operation); + public Ifft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Ifft.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Ifft<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java index 6dbd0bc7d93..2c4c19b2ead 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Inverse 2D fast Fourier transform. * Computes the inverse 2-dimensional discrete Fourier transform over the * inner-most 2 dimensions of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Ifft2d.OP_NAME, + inputsClass = Ifft2d.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Ifft2d extends RawOp implements Operand { private Output output; - private Ifft2d(Operation operation) { - super(operation); + public Ifft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Ifft2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Ifft2d<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java index 4b427df602d..efcb06fafcd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Inverse 3D fast Fourier transform. * Computes the inverse 3-dimensional discrete Fourier transform over the * inner-most 3 dimensions of {@code input}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Ifft3d.OP_NAME, + inputsClass = Ifft3d.Inputs.class +) @Operator( group = "signal" ) @@ -45,8 +53,8 @@ public final class Ifft3d extends RawOp implements Operand { private Output output; - private Ifft3d(Operation operation) { - super(operation); + public Ifft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Ifft3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Ifft3d<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IfftNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IfftNd.java new file mode 100644 index 00000000000..181e3756015 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IfftNd.java @@ -0,0 +1,143 @@ +/* Copyright 2018-2023 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.signal; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * ND inverse fast Fourier transform. + * Computes the n-dimensional inverse discrete Fourier transform over designated + * dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be + * the result of {@code signal.IfftNd}. + *

      If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

      Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + */ +@OpMetadata( + opType = IfftNd.OP_NAME, + inputsClass = IfftNd.Inputs.class +) +@Operator( + group = "signal" +) +public final class IfftNd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFTND"; + + private Output output; + + public IfftNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFTND operation. + * + * @param scope current scope + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param data type for {@code IFFTND} output and operands + * @return a new instance of IfftNd + */ + @Endpoint( + describeByClass = true + ) + public static IfftNd create(Scope scope, Operand input, + Operand fftLength, Operand axes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IfftNd"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(fftLength.asOutput()); + opBuilder.addInput(axes.asOutput()); + return new IfftNd<>(opBuilder.build()); + } + + /** + * Gets output. + * A complex tensor of the same shape as {@code input}. The designated dimensions of + * {@code input} are replaced with their inverse Fourier + * transforms. + *

      {@literal @}compatibility(numpy)
      + * Equivalent to np.fft.fftn. + *
      {@literal @}end_compatibility + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = IfftNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * An int32 tensor with a same shape as fft_length. Axes to perform the transform. + */ + public final Operand axes; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new IfftNd<>(op), op, Arrays.asList("Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + axes = (Operand) op.input(inputIndex++); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java index 2501fca9f4f..50f6daef0a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -44,9 +50,11 @@ *

      Along the axis {@code signal.Irfft} is computed on, if {@code fft_length / 2 + 1} is smaller * than the corresponding dimension of {@code input}, the dimension is cropped. If it is * larger, the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Irfft.OP_NAME, + inputsClass = Irfft.Inputs.class +) @Operator( group = "signal" ) @@ -58,8 +66,8 @@ public final class Irfft extends RawOp implements Operand private Output output; - private Irfft(Operation operation) { - super(operation); + public Irfft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -70,7 +78,7 @@ private Irfft(Operation operation) { * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT} output and operands * @return a new instance of Irfft */ @@ -120,4 +128,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Irfft.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [1]. The FFT length. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Irfft<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java index 3ec6240540a..01214bfec41 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -45,9 +51,11 @@ * {@code fft_length / 2 + 1} for the inner-most dimension) is smaller than the * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Irfft2d.OP_NAME, + inputsClass = Irfft2d.Inputs.class +) @Operator( group = "signal" ) @@ -59,8 +67,8 @@ public final class Irfft2d extends RawOp implements Operand output; - private Irfft2d(Operation operation) { - super(operation); + public Irfft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -71,7 +79,7 @@ private Irfft2d(Operation operation) { * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT2D} output and operands * @return a new instance of Irfft2d */ @@ -121,4 +129,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Irfft2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [2]. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Irfft2d<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java index 8fb04f1d567..c83389668b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -45,9 +51,11 @@ * {@code fft_length / 2 + 1} for the inner-most dimension) is smaller than the * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Irfft3d.OP_NAME, + inputsClass = Irfft3d.Inputs.class +) @Operator( group = "signal" ) @@ -59,8 +67,8 @@ public final class Irfft3d extends RawOp implements Operand output; - private Irfft3d(Operation operation) { - super(operation); + public Irfft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -71,7 +79,7 @@ private Irfft3d(Operation operation) { * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Treal the value of the Treal property + * @param Treal The value of the Treal attribute * @param data type for {@code IRFFT3D} output and operands * @return a new instance of Irfft3d */ @@ -121,4 +129,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Irfft3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [3]. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Irfft3d<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IrfftNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IrfftNd.java new file mode 100644 index 00000000000..5e83c9f4dc3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/IrfftNd.java @@ -0,0 +1,171 @@ +/* Copyright 2018-2023 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.signal; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * ND inverse real fast Fourier transform. + * Computes the n-dimensional inverse real discrete Fourier transform over + * designated dimensions of {@code input}. The designated dimensions of {@code input} are + * assumed to be the result of {@code signal.IrfftNd}. The inner-most dimension contains the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. + *

      If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

      Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + */ +@OpMetadata( + opType = IrfftNd.OP_NAME, + inputsClass = IrfftNd.Inputs.class +) +@Operator( + group = "signal" +) +public final class IrfftNd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFTND"; + + private Output output; + + public IrfftNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFTND operation. + * + * @param scope current scope + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param Treal The value of the Treal attribute + * @param data type for {@code IRFFTND} output and operands + * @return a new instance of IrfftNd + */ + @Endpoint( + describeByClass = true + ) + public static IrfftNd create(Scope scope, Operand input, + Operand fftLength, Operand axes, Class Treal) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IrfftNd"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(fftLength.asOutput()); + opBuilder.addInput(axes.asOutput()); + opBuilder.setAttr("Treal", Operands.toDataType(Treal)); + return new IrfftNd<>(opBuilder.build()); + } + + /** + * Factory method to create a class wrapping a new IRFFTND operation, with the default output types. + * + * @param scope current scope + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @return a new instance of IrfftNd, with default output types + */ + @Endpoint( + describeByClass = true + ) + public static IrfftNd create(Scope scope, Operand input, + Operand fftLength, Operand axes) { + return create(scope, input, fftLength, axes, TFloat32.class); + } + + /** + * Gets output. + * A complex tensor of the same shape as {@code input}. The designated dimensions of + * {@code input} are replaced with their inverse real Fourier transforms. + *

      {@literal @}compatibility(numpy)
      + * Equivalent to np.fft.irfftn. + *
      {@literal @}end_compatibility + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = IrfftNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * An int32 tensor with a same shape as fft_length. Axes to perform the transform. + */ + public final Operand axes; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new IrfftNd<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + axes = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java index 7fcf1e8931c..c4d7b74e39a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -40,9 +46,11 @@ *

      Along the axis {@code signal.Rfft} is computed on, if {@code fft_length} is smaller than the * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Rfft.OP_NAME, + inputsClass = Rfft.Inputs.class +) @Operator( group = "signal" ) @@ -54,8 +62,8 @@ public final class Rfft extends RawOp implements Operand { private Output output; - private Rfft(Operation operation) { - super(operation); + public Rfft(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -66,7 +74,7 @@ private Rfft(Operation operation) { * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT} output and operands * @return a new instance of Rfft */ @@ -100,4 +108,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Rfft.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [1]. The FFT length. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Rfft<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java index 786c0be03b0..314d16f4eec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ *

      Along each axis {@code signal.Rfft2d} is computed on, if {@code fft_length} is smaller than the * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Rfft2d.OP_NAME, + inputsClass = Rfft2d.Inputs.class +) @Operator( group = "signal" ) @@ -55,8 +63,8 @@ public final class Rfft2d extends RawOp implements Operand { private Output output; - private Rfft2d(Operation operation) { - super(operation); + public Rfft2d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private Rfft2d(Operation operation) { * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT2D} output and operands * @return a new instance of Rfft2d */ @@ -102,4 +110,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Rfft2d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [2]. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Rfft2d<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java index 180d73ea184..282c4b7386e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.signal; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ *

      Along each axis {@code signal.Rfft3d} is computed on, if {@code fft_length} is smaller than the * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = Rfft3d.OP_NAME, + inputsClass = Rfft3d.Inputs.class +) @Operator( group = "signal" ) @@ -55,8 +63,8 @@ public final class Rfft3d extends RawOp implements Operand { private Output output; - private Rfft3d(Operation operation) { - super(operation); + public Rfft3d(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private Rfft3d(Operation operation) { * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Tcomplex the value of the Tcomplex property + * @param Tcomplex The value of the Tcomplex attribute * @param data type for {@code RFFT3D} output and operands * @return a new instance of Rfft3d */ @@ -102,4 +110,38 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Rfft3d.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A float32 tensor. + */ + public final Operand input; + + /** + * An int32 tensor of shape [3]. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new Rfft3d<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/RfftNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/RfftNd.java new file mode 100644 index 00000000000..17bf1368600 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/RfftNd.java @@ -0,0 +1,153 @@ +/* Copyright 2018-2023 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.signal; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * ND fast real Fourier transform. + * Computes the n-dimensional real discrete Fourier transform over designated + * dimensions of {@code input}. The designated dimensions of {@code input} are assumed to be + * the result of {@code signal.RfftNd}. The length of the last axis transformed will be + * fft_length[-1]//2+1. + *

      If fft_length[i]<shape(input)[i], the input is cropped. If + * fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length + * is not given, the default shape(input) is used. + *

      Axes mean the dimensions to perform the transform on. Default is to perform on + * all axes. + */ +@OpMetadata( + opType = RfftNd.OP_NAME, + inputsClass = RfftNd.Inputs.class +) +@Operator( + group = "signal" +) +public final class RfftNd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFTND"; + + private Output output; + + public RfftNd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFTND operation. + * + * @param scope current scope + * @param input A complex tensor. + * @param fftLength An int32 tensor. The FFT length for each dimension. + * @param axes An int32 tensor with a same shape as fft_length. Axes to perform the transform. + * @param Tcomplex The value of the Tcomplex attribute + * @param data type for {@code RFFTND} output and operands + * @return a new instance of RfftNd + */ + @Endpoint( + describeByClass = true + ) + public static RfftNd create(Scope scope, Operand input, + Operand fftLength, Operand axes, Class Tcomplex) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RfftNd"); + opBuilder.addInput(input.asOutput()); + opBuilder.addInput(fftLength.asOutput()); + opBuilder.addInput(axes.asOutput()); + opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); + return new RfftNd<>(opBuilder.build()); + } + + /** + * Gets output. + * A complex tensor of the same shape as {@code input}. The designated + * dimensions of {@code input} are replaced with their real Fourier transforms. + *

      {@literal @}compatibility(numpy)
      + * Equivalent to np.fft.rfftn. + *
      {@literal @}end_compatibility + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = RfftNd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A complex tensor. + */ + public final Operand input; + + /** + * An int32 tensor. The FFT length for each dimension. + */ + public final Operand fftLength; + + /** + * An int32 tensor with a same shape as fft_length. Axes to perform the transform. + */ + public final Operand axes; + + /** + * The Treal attribute + */ + public final DataType Treal; + + /** + * The Tcomplex attribute + */ + public final DataType Tcomplex; + + public Inputs(GraphOperation op) { + super(new RfftNd<>(op), op, Arrays.asList("Treal", "Tcomplex")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + fftLength = (Operand) op.input(inputIndex++); + axes = (Operand) op.input(inputIndex++); + Treal = op.attributes().getAttrType("Treal"); + Tcomplex = op.attributes().getAttrType("Tcomplex"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java index 06ae4329408..59d8449fa2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -49,6 +55,10 @@ * {@code sparse.AddManySparseToTensorsMap} as the {@code shared_name} passed to * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ +@OpMetadata( + opType = AddManySparseToTensorsMap.OP_NAME, + inputsClass = AddManySparseToTensorsMap.Inputs.class +) @Operator( group = "sparse" ) @@ -60,8 +70,8 @@ public final class AddManySparseToTensorsMap extends RawOp implements Operand sparseHandles; - private AddManySparseToTensorsMap(Operation operation) { - super(operation); + public AddManySparseToTensorsMap(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseHandles = operation.output(outputIdx++); } @@ -170,4 +180,53 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = AddManySparseToTensorsMap.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * {@code sparse_indices[:, 0]} must be ordered values in {@code [0, N)}. + */ + public final Operand sparseIndices; + + /** + * 1-D. The {@code values} of the minibatch {@code SparseTensor}. + */ + public final Operand sparseValues; + + /** + * 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * The minibatch size {@code N == sparse_shape[0]}. + */ + public final Operand sparseShape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The container name for the {@code SparseTensorsMap} created by this op. + */ + public final String container; + + /** + * The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new AddManySparseToTensorsMap(op), op, Arrays.asList("T", "container", "shared_name")); + int inputIndex = 0; + sparseIndices = (Operand) op.input(inputIndex++); + sparseValues = (Operand) op.input(inputIndex++); + sparseShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java index 32450a5d1d3..ddfba840a21 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -43,6 +49,10 @@ * {@code sparse.AddSparseToTensorsMap} as the {@code shared_name} passed to * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ +@OpMetadata( + opType = AddSparseToTensorsMap.OP_NAME, + inputsClass = AddSparseToTensorsMap.Inputs.class +) @Operator( group = "sparse" ) @@ -54,8 +64,8 @@ public final class AddSparseToTensorsMap extends RawOp implements Operand sparseHandle; - private AddSparseToTensorsMap(Operation operation) { - super(operation); + public AddSparseToTensorsMap(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseHandle = operation.output(outputIdx++); } @@ -162,4 +172,51 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = AddSparseToTensorsMap.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D. The {@code indices} of the {@code SparseTensor}. + */ + public final Operand sparseIndices; + + /** + * 1-D. The {@code values} of the {@code SparseTensor}. + */ + public final Operand sparseValues; + + /** + * 1-D. The {@code shape} of the {@code SparseTensor}. + */ + public final Operand sparseShape; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The container name for the {@code SparseTensorsMap} created by this op. + */ + public final String container; + + /** + * The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new AddSparseToTensorsMap(op), op, Arrays.asList("T", "container", "shared_name")); + int inputIndex = 0; + sparseIndices = (Operand) op.input(inputIndex++); + sparseValues = (Operand) op.input(inputIndex++); + sparseShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToListOfSparseCoreCooTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToListOfSparseCoreCooTensors.java new file mode 100644 index 00000000000..7ed71c4c316 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToListOfSparseCoreCooTensors.java @@ -0,0 +1,209 @@ +/* Copyright 2018-2023 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.sparse; + +import java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The ConvertToListOfSparseCoreCooTensors operation + */ +@OpMetadata( + opType = ConvertToListOfSparseCoreCooTensors.OP_NAME, + inputsClass = ConvertToListOfSparseCoreCooTensors.Inputs.class +) +@Operator( + group = "sparse" +) +public final class ConvertToListOfSparseCoreCooTensors extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConvertToListOfSparseCoreCooTensors"; + + private List> rowIdsList; + + private List> colIdsList; + + private List> gainsList; + + @SuppressWarnings("unchecked") + public ConvertToListOfSparseCoreCooTensors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int rowIdsListLength = operation.outputListLength("row_ids_list"); + rowIdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, rowIdsListLength)); + outputIdx += rowIdsListLength; + int colIdsListLength = operation.outputListLength("col_ids_list"); + colIdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, colIdsListLength)); + outputIdx += colIdsListLength; + int gainsListLength = operation.outputListLength("gains_list"); + gainsList = Arrays.asList((Output[]) operation.outputList(outputIdx, gainsListLength)); + outputIdx += gainsListLength; + } + + /** + * Factory method to create a class wrapping a new ConvertToListOfSparseCoreCooTensors operation. + * + * @param scope current scope + * @param indicesOrRowSplits The indicesOrRowSplits value + * @param values The values value + * @param weights The weights value + * @param sampleCount The value of the sampleCount attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param rowOffset The value of the rowOffset attribute + * @param colOffset The value of the colOffset attribute + * @param colShift The value of the colShift attribute + * @param numScShards The value of the numScShards attribute + * @param stackedTableSampleCount The value of the stackedTableSampleCount attribute + * @param combiner The value of the combiner attribute + * @return a new instance of ConvertToListOfSparseCoreCooTensors + */ + @Endpoint( + describeByClass = true + ) + public static ConvertToListOfSparseCoreCooTensors create(Scope scope, + Operand indicesOrRowSplits, Operand values, Operand weights, + Long sampleCount, Long numScPerChip, Long rowOffset, Long colOffset, Long colShift, + Long numScShards, Long stackedTableSampleCount, String combiner) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConvertToListOfSparseCoreCooTensors"); + opBuilder.addInput(indicesOrRowSplits.asOutput()); + opBuilder.addInput(values.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.setAttr("sample_count", sampleCount); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("row_offset", rowOffset); + opBuilder.setAttr("col_offset", colOffset); + opBuilder.setAttr("col_shift", colShift); + opBuilder.setAttr("num_sc_shards", numScShards); + opBuilder.setAttr("stacked_table_sample_count", stackedTableSampleCount); + opBuilder.setAttr("combiner", combiner); + return new ConvertToListOfSparseCoreCooTensors(opBuilder.build()); + } + + /** + * Gets rowIdsList. + * + * @return rowIdsList. + */ + public List> rowIdsList() { + return rowIdsList; + } + + /** + * Gets colIdsList. + * + * @return colIdsList. + */ + public List> colIdsList() { + return colIdsList; + } + + /** + * Gets gainsList. + * + * @return gainsList. + */ + public List> gainsList() { + return gainsList; + } + + @OpInputsMetadata( + outputsClass = ConvertToListOfSparseCoreCooTensors.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indicesOrRowSplits input + */ + public final Operand indicesOrRowSplits; + + /** + * The values input + */ + public final Operand values; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The sampleCount attribute + */ + public final long sampleCount; + + /** + * The rowOffset attribute + */ + public final long rowOffset; + + /** + * The colOffset attribute + */ + public final long colOffset; + + /** + * The colShift attribute + */ + public final long colShift; + + /** + * The numScShards attribute + */ + public final long numScShards; + + /** + * The stackedTableSampleCount attribute + */ + public final long stackedTableSampleCount; + + /** + * The combiner attribute + */ + public final String combiner; + + public Inputs(GraphOperation op) { + super(new ConvertToListOfSparseCoreCooTensors(op), op, Arrays.asList("sample_count", "row_offset", "col_offset", "col_shift", "num_sc_shards", "stacked_table_sample_count", "combiner")); + int inputIndex = 0; + indicesOrRowSplits = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + sampleCount = op.attributes().getAttrInt("sample_count"); + rowOffset = op.attributes().getAttrInt("row_offset"); + colOffset = op.attributes().getAttrInt("col_offset"); + colShift = op.attributes().getAttrInt("col_shift"); + numScShards = op.attributes().getAttrInt("num_sc_shards"); + stackedTableSampleCount = op.attributes().getAttrInt("stacked_table_sample_count"); + combiner = op.attributes().getAttrString("combiner"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToSparseCoreCsrWrappedCooTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToSparseCoreCsrWrappedCooTensor.java new file mode 100644 index 00000000000..6590a927699 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/ConvertToSparseCoreCsrWrappedCooTensor.java @@ -0,0 +1,283 @@ +/* Copyright 2018-2023 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.sparse; + +import java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; + +/** + * The ConvertToSparseCoreCsrWrappedCooTensor operation + */ +@OpMetadata( + opType = ConvertToSparseCoreCsrWrappedCooTensor.OP_NAME, + inputsClass = ConvertToSparseCoreCsrWrappedCooTensor.Inputs.class +) +@Operator( + group = "sparse" +) +public final class ConvertToSparseCoreCsrWrappedCooTensor extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConvertToSparseCoreCsrWrappedCooTensor"; + + private Output rowPointers; + + private Output sortedSampleIds; + + private Output sortedTokenIds; + + private Output sortedGains; + + private Output rowPointersUnpaddedSize; + + private Output idsUnpaddedSize; + + private Output numMinibatchesPerSc; + + public ConvertToSparseCoreCsrWrappedCooTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowPointers = operation.output(outputIdx++); + sortedSampleIds = operation.output(outputIdx++); + sortedTokenIds = operation.output(outputIdx++); + sortedGains = operation.output(outputIdx++); + rowPointersUnpaddedSize = operation.output(outputIdx++); + idsUnpaddedSize = operation.output(outputIdx++); + numMinibatchesPerSc = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConvertToSparseCoreCsrWrappedCooTensor operation. + * + * @param scope current scope + * @param sortedRowIdsList The sortedRowIdsList value + * @param sortedColIdsList The sortedColIdsList value + * @param sortedGainsList The sortedGainsList value + * @param idCountsList The idCountsList value + * @param splits The splits value + * @param sampleCountPerSc The value of the sampleCountPerSc attribute + * @param numReplica The value of the numReplica attribute + * @param maxMinibatchesPerSc The value of the maxMinibatchesPerSc attribute + * @param maxIdsPerChipPerSample The value of the maxIdsPerChipPerSample attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param tableName The value of the tableName attribute + * @param allowIdDropping The value of the allowIdDropping attribute + * @return a new instance of ConvertToSparseCoreCsrWrappedCooTensor + */ + @Endpoint( + describeByClass = true + ) + public static ConvertToSparseCoreCsrWrappedCooTensor create(Scope scope, + Iterable> sortedRowIdsList, Iterable> sortedColIdsList, + Iterable> sortedGainsList, Iterable> idCountsList, + Operand splits, Long sampleCountPerSc, Long numReplica, Long maxMinibatchesPerSc, + Long maxIdsPerChipPerSample, Long tableVocabSize, Long featureWidth, String tableName, + Boolean allowIdDropping) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConvertToSparseCoreCsrWrappedCooTensor"); + opBuilder.addInputList(Operands.asOutputs(sortedRowIdsList)); + opBuilder.addInputList(Operands.asOutputs(sortedColIdsList)); + opBuilder.addInputList(Operands.asOutputs(sortedGainsList)); + opBuilder.addInputList(Operands.asOutputs(idCountsList)); + opBuilder.addInput(splits.asOutput()); + opBuilder.setAttr("sample_count_per_sc", sampleCountPerSc); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("max_minibatches_per_sc", maxMinibatchesPerSc); + opBuilder.setAttr("max_ids_per_chip_per_sample", maxIdsPerChipPerSample); + opBuilder.setAttr("table_vocab_size", tableVocabSize); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("table_name", tableName); + opBuilder.setAttr("allow_id_dropping", allowIdDropping); + return new ConvertToSparseCoreCsrWrappedCooTensor(opBuilder.build()); + } + + /** + * Gets rowPointers. + * + * @return rowPointers. + */ + public Output rowPointers() { + return rowPointers; + } + + /** + * Gets sortedSampleIds. + * + * @return sortedSampleIds. + */ + public Output sortedSampleIds() { + return sortedSampleIds; + } + + /** + * Gets sortedTokenIds. + * + * @return sortedTokenIds. + */ + public Output sortedTokenIds() { + return sortedTokenIds; + } + + /** + * Gets sortedGains. + * + * @return sortedGains. + */ + public Output sortedGains() { + return sortedGains; + } + + /** + * Gets rowPointersUnpaddedSize. + * + * @return rowPointersUnpaddedSize. + */ + public Output rowPointersUnpaddedSize() { + return rowPointersUnpaddedSize; + } + + /** + * Gets idsUnpaddedSize. + * + * @return idsUnpaddedSize. + */ + public Output idsUnpaddedSize() { + return idsUnpaddedSize; + } + + /** + * Gets numMinibatchesPerSc. + * + * @return numMinibatchesPerSc. + */ + public Output numMinibatchesPerSc() { + return numMinibatchesPerSc; + } + + @OpInputsMetadata( + outputsClass = ConvertToSparseCoreCsrWrappedCooTensor.class + ) + public static class Inputs extends RawOpInputs { + /** + * The sortedRowIdsList input + */ + public final Iterable> sortedRowIdsList; + + /** + * The sortedColIdsList input + */ + public final Iterable> sortedColIdsList; + + /** + * The sortedGainsList input + */ + public final Iterable> sortedGainsList; + + /** + * The idCountsList input + */ + public final Iterable> idCountsList; + + /** + * The splits input + */ + public final Operand splits; + + /** + * The sampleCountPerSc attribute + */ + public final long sampleCountPerSc; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The maxMinibatchesPerSc attribute + */ + public final long maxMinibatchesPerSc; + + /** + * The maxIdsPerChipPerSample attribute + */ + public final long maxIdsPerChipPerSample; + + /** + * The tableVocabSize attribute + */ + public final long tableVocabSize; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The allowIdDropping attribute + */ + public final boolean allowIdDropping; + + public Inputs(GraphOperation op) { + super(new ConvertToSparseCoreCsrWrappedCooTensor(op), op, Arrays.asList("sample_count_per_sc", "num_replica", "max_minibatches_per_sc", "max_ids_per_chip_per_sample", "table_vocab_size", "feature_width", "table_name", "allow_id_dropping")); + int inputIndex = 0; + int sortedRowIdsListLength = op.inputListLength("sorted_row_ids_list"); + sortedRowIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, sortedRowIdsListLength)); + inputIndex += sortedRowIdsListLength; + int sortedColIdsListLength = op.inputListLength("sorted_col_ids_list"); + sortedColIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, sortedColIdsListLength)); + inputIndex += sortedColIdsListLength; + int sortedGainsListLength = op.inputListLength("sorted_gains_list"); + sortedGainsList = Arrays.asList((Operand[]) op.inputList(inputIndex, sortedGainsListLength)); + inputIndex += sortedGainsListLength; + int idCountsListLength = op.inputListLength("id_counts_list"); + idCountsList = Arrays.asList((Operand[]) op.inputList(inputIndex, idCountsListLength)); + inputIndex += idCountsListLength; + splits = (Operand) op.input(inputIndex++); + sampleCountPerSc = op.attributes().getAttrInt("sample_count_per_sc"); + numReplica = op.attributes().getAttrInt("num_replica"); + maxMinibatchesPerSc = op.attributes().getAttrInt("max_minibatches_per_sc"); + maxIdsPerChipPerSample = op.attributes().getAttrInt("max_ids_per_chip_per_sample"); + tableVocabSize = op.attributes().getAttrInt("table_vocab_size"); + featureWidth = op.attributes().getAttrInt("feature_width"); + tableName = op.attributes().getAttrString("table_name"); + allowIdDropping = op.attributes().getAttrBool("allow_id_dropping"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java index 20cc808c8a1..5cf78a2a0a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a tf.tensor input. * Counts the number of times each value occurs in the input. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = DenseCountSparseOutput.OP_NAME, + inputsClass = DenseCountSparseOutput.Inputs.class +) +@Operator( + group = "sparse" +) public final class DenseCountSparseOutput extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class DenseCountSparseOutput extends RawOp { private Output outputDenseShape; - private DenseCountSparseOutput(Operation operation) { - super(operation); + public DenseCountSparseOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -168,4 +180,57 @@ public Options maxlength(Long maxlength) { return this; } } + + @OpInputsMetadata( + outputsClass = DenseCountSparseOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor containing data to count. + */ + public final Operand values; + + /** + * A Tensor of the same shape as indices containing per-index weight values. May + * also be the empty tensor if no weights are used. + */ + public final Operand weights; + + /** + * Dtype of the input values tensor. + */ + public final DataType T; + + /** + * Minimum value to count. Can be set to -1 for no minimum. + */ + public final long minlength; + + /** + * Maximum value to count. Can be set to -1 for no maximum. + */ + public final long maxlength; + + /** + * Whether to output the number of occurrences of each value or 1. + */ + public final boolean binaryOutput; + + /** + * Dtype of the output values tensor. + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new DenseCountSparseOutput<>(op), op, Arrays.asList("T", "minlength", "maxlength", "binary_output", "output_type")); + int inputIndex = 0; + values = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + minlength = op.attributes().getAttrInt("minlength"); + maxlength = op.attributes().getAttrInt("maxlength"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java index 7ef4cdef3ba..546adba1a9d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. - * - * @param data type for {@code result_values} output */ +@OpMetadata( + opType = DenseToDenseSetOperation.OP_NAME, + inputsClass = DenseToDenseSetOperation.Inputs.class +) @Operator( group = "sparse" ) @@ -54,8 +62,8 @@ public final class DenseToDenseSetOperation extends RawOp { private Output resultShape; - private DenseToDenseSetOperation(Operation operation) { - super(operation); + public DenseToDenseSetOperation(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resultIndices = operation.output(outputIdx++); resultValues = operation.output(outputIdx++); @@ -70,7 +78,7 @@ private DenseToDenseSetOperation(Operation operation) { * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. * @param set2 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set1}. * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code DenseToDenseSetOperation} output and operands * @return a new instance of DenseToDenseSetOperation @@ -153,4 +161,46 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = DenseToDenseSetOperation.class + ) + public static class Inputs extends RawOpInputs> { + /** + * {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + */ + public final Operand set1; + + /** + * {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set1}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + */ + public final Operand set2; + + /** + * The setOperation attribute + */ + public final String setOperation; + + /** + * The validateIndices attribute + */ + public final boolean validateIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DenseToDenseSetOperation<>(op), op, Arrays.asList("set_operation", "validate_indices", "T")); + int inputIndex = 0; + set1 = (Operand) op.input(inputIndex++); + set2 = (Operand) op.input(inputIndex++); + setOperation = op.attributes().getAttrString("set_operation"); + validateIndices = op.attributes().getAttrBool("validate_indices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java index 6afc0248772..1b8cbcaee50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. - * - * @param data type for {@code result_values} output */ +@OpMetadata( + opType = DenseToSparseSetOperation.OP_NAME, + inputsClass = DenseToSparseSetOperation.Inputs.class +) @Operator( group = "sparse" ) @@ -60,8 +68,8 @@ public final class DenseToSparseSetOperation extends RawOp { private Output resultShape; - private DenseToSparseSetOperation(Operation operation) { - super(operation); + public DenseToSparseSetOperation(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resultIndices = operation.output(outputIdx++); resultValues = operation.output(outputIdx++); @@ -81,7 +89,7 @@ private DenseToSparseSetOperation(Operation operation) { * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must * be the same as the 1st {@code n-1} dimensions of {@code set1}, {@code result_shape[n]} is the * max set size across {@code n-1} dimensions. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code DenseToSparseSetOperation} output and operands * @return a new instance of DenseToSparseSetOperation @@ -167,4 +175,61 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = DenseToSparseSetOperation.class + ) + public static class Inputs extends RawOpInputs> { + /** + * {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + */ + public final Operand set1; + + /** + * 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set2Indices; + + /** + * 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set2Values; + + /** + * 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must + * be the same as the 1st {@code n-1} dimensions of {@code set1}, {@code result_shape[n]} is the + * max set size across {@code n-1} dimensions. + */ + public final Operand set2Shape; + + /** + * The setOperation attribute + */ + public final String setOperation; + + /** + * The validateIndices attribute + */ + public final boolean validateIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new DenseToSparseSetOperation<>(op), op, Arrays.asList("set_operation", "validate_indices", "T")); + int inputIndex = 0; + set1 = (Operand) op.input(inputIndex++); + set2Indices = (Operand) op.input(inputIndex++); + set2Values = (Operand) op.input(inputIndex++); + set2Shape = (Operand) op.input(inputIndex++); + setOperation = op.attributes().getAttrString("set_operation"); + validateIndices = op.attributes().getAttrBool("validate_indices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java index a57326729d1..ba0c51f9a1e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -70,9 +76,11 @@ * values = [1, 2, 3, 4, 5] * shape = [2 50] * - * - * @param data type for {@code sparse_values} output */ +@OpMetadata( + opType = DeserializeSparse.OP_NAME, + inputsClass = DeserializeSparse.Inputs.class +) @Operator( group = "sparse" ) @@ -88,8 +96,8 @@ public final class DeserializeSparse extends RawOp { private Output sparseShape; - private DeserializeSparse(Operation operation) { - super(operation); + public DeserializeSparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseIndices = operation.output(outputIdx++); sparseValues = operation.output(outputIdx++); @@ -143,4 +151,33 @@ public Output sparseValues() { public Output sparseShape() { return sparseShape; } + + @OpInputsMetadata( + outputsClass = DeserializeSparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The serialized {@code SparseTensor} objects. The last dimension + * must have 3 columns. + */ + public final Operand serializedSparse; + + /** + * The {@code dtype} of the serialized {@code SparseTensor} objects. + */ + public final DataType dtype; + + /** + * The Tserialized attribute + */ + public final DataType Tserialized; + + public Inputs(GraphOperation op) { + super(new DeserializeSparse<>(op), op, Arrays.asList("dtype", "Tserialized")); + int inputIndex = 0; + serializedSparse = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + Tserialized = op.attributes().getAttrType("Tserialized"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/GetStatsFromListOfSparseCoreCooTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/GetStatsFromListOfSparseCoreCooTensors.java new file mode 100644 index 00000000000..51f5c33d66b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/GetStatsFromListOfSparseCoreCooTensors.java @@ -0,0 +1,204 @@ +/* Copyright 2018-2023 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.sparse; + +import java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The GetStatsFromListOfSparseCoreCooTensors operation + */ +@OpMetadata( + opType = GetStatsFromListOfSparseCoreCooTensors.OP_NAME, + inputsClass = GetStatsFromListOfSparseCoreCooTensors.Inputs.class +) +@Operator( + group = "sparse" +) +public final class GetStatsFromListOfSparseCoreCooTensors extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetStatsFromListOfSparseCoreCooTensors"; + + private Output maxIdsPerSparseCore; + + private Output maxUniqueIdsPerSparseCore; + + public GetStatsFromListOfSparseCoreCooTensors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + maxIdsPerSparseCore = operation.output(outputIdx++); + maxUniqueIdsPerSparseCore = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetStatsFromListOfSparseCoreCooTensors operation. + * + * @param scope current scope + * @param rowIdsList The rowIdsList value + * @param colIdsList The colIdsList value + * @param gainsList The gainsList value + * @param sampleCountList The value of the sampleCountList attribute + * @param colOffsetList The value of the colOffsetList attribute + * @param numReplica The value of the numReplica attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @return a new instance of GetStatsFromListOfSparseCoreCooTensors + */ + @Endpoint( + describeByClass = true + ) + public static GetStatsFromListOfSparseCoreCooTensors create(Scope scope, + Iterable> rowIdsList, Iterable> colIdsList, + Iterable> gainsList, List sampleCountList, List colOffsetList, + Long numReplica, Long tableVocabSize, Long featureWidth, Long numScPerChip, + String tableName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetStatsFromListOfSparseCoreCooTensors"); + opBuilder.addInputList(Operands.asOutputs(rowIdsList)); + opBuilder.addInputList(Operands.asOutputs(colIdsList)); + opBuilder.addInputList(Operands.asOutputs(gainsList)); + long[] sampleCountListArray = new long[sampleCountList.size()]; + for (int i = 0 ; i < sampleCountListArray.length ; i++) { + sampleCountListArray[i] = sampleCountList.get(i); + } + opBuilder.setAttr("sample_count_list", sampleCountListArray); + long[] colOffsetListArray = new long[colOffsetList.size()]; + for (int i = 0 ; i < colOffsetListArray.length ; i++) { + colOffsetListArray[i] = colOffsetList.get(i); + } + opBuilder.setAttr("col_offset_list", colOffsetListArray); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("table_vocab_size", tableVocabSize); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("table_name", tableName); + return new GetStatsFromListOfSparseCoreCooTensors(opBuilder.build()); + } + + /** + * Gets maxIdsPerSparseCore. + * + * @return maxIdsPerSparseCore. + */ + public Output maxIdsPerSparseCore() { + return maxIdsPerSparseCore; + } + + /** + * Gets maxUniqueIdsPerSparseCore. + * + * @return maxUniqueIdsPerSparseCore. + */ + public Output maxUniqueIdsPerSparseCore() { + return maxUniqueIdsPerSparseCore; + } + + @OpInputsMetadata( + outputsClass = GetStatsFromListOfSparseCoreCooTensors.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowIdsList input + */ + public final Iterable> rowIdsList; + + /** + * The colIdsList input + */ + public final Iterable> colIdsList; + + /** + * The gainsList input + */ + public final Iterable> gainsList; + + /** + * The sampleCountList attribute + */ + public final long[] sampleCountList; + + /** + * The colOffsetList attribute + */ + public final long[] colOffsetList; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The tableVocabSize attribute + */ + public final long tableVocabSize; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The numScPerChip attribute + */ + public final long numScPerChip; + + /** + * The tableName attribute + */ + public final String tableName; + + public Inputs(GraphOperation op) { + super(new GetStatsFromListOfSparseCoreCooTensors(op), op, Arrays.asList("sample_count_list", "col_offset_list", "num_replica", "table_vocab_size", "feature_width", "num_sc_per_chip", "table_name")); + int inputIndex = 0; + int rowIdsListLength = op.inputListLength("row_ids_list"); + rowIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, rowIdsListLength)); + inputIndex += rowIdsListLength; + int colIdsListLength = op.inputListLength("col_ids_list"); + colIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, colIdsListLength)); + inputIndex += colIdsListLength; + int gainsListLength = op.inputListLength("gains_list"); + gainsList = Arrays.asList((Operand[]) op.inputList(inputIndex, gainsListLength)); + inputIndex += gainsListLength; + sampleCountList = op.attributes().getAttrIntList("sample_count_list"); + colOffsetList = op.attributes().getAttrIntList("col_offset_list"); + numReplica = op.attributes().getAttrInt("num_replica"); + tableVocabSize = op.attributes().getAttrInt("table_vocab_size"); + featureWidth = op.attributes().getAttrInt("feature_width"); + numScPerChip = op.attributes().getAttrInt("num_sc_per_chip"); + tableName = op.attributes().getAttrString("table_name"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SortListOfSparseCoreCooTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SortListOfSparseCoreCooTensors.java new file mode 100644 index 00000000000..fb26033cfd2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SortListOfSparseCoreCooTensors.java @@ -0,0 +1,240 @@ +/* Copyright 2018-2023 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.sparse; + +import java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The SortListOfSparseCoreCooTensors operation + */ +@OpMetadata( + opType = SortListOfSparseCoreCooTensors.OP_NAME, + inputsClass = SortListOfSparseCoreCooTensors.Inputs.class +) +public final class SortListOfSparseCoreCooTensors extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SortListOfSparseCoreCooTensors"; + + private Output sortedRowIds; + + private Output sortedColIds; + + private Output sortedGains; + + private Output idCounts; + + public SortListOfSparseCoreCooTensors(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sortedRowIds = operation.output(outputIdx++); + sortedColIds = operation.output(outputIdx++); + sortedGains = operation.output(outputIdx++); + idCounts = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SortListOfSparseCoreCooTensors operation. + * + * @param scope current scope + * @param rowIdsList The rowIdsList value + * @param colIdsList The colIdsList value + * @param gainsList The gainsList value + * @param sampleCountList The value of the sampleCountList attribute + * @param colOffsetList The value of the colOffsetList attribute + * @param numReplica The value of the numReplica attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @return a new instance of SortListOfSparseCoreCooTensors + */ + @Endpoint( + describeByClass = true + ) + public static SortListOfSparseCoreCooTensors create(Scope scope, + Iterable> rowIdsList, Iterable> colIdsList, + Iterable> gainsList, List sampleCountList, List colOffsetList, + Long numReplica, Long tableVocabSize, Long featureWidth, Long numScPerChip, + Long maxIdsPerSparseCore, Long maxUniqueIdsPerSparseCore, String tableName) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SortListOfSparseCoreCooTensors"); + opBuilder.addInputList(Operands.asOutputs(rowIdsList)); + opBuilder.addInputList(Operands.asOutputs(colIdsList)); + opBuilder.addInputList(Operands.asOutputs(gainsList)); + long[] sampleCountListArray = new long[sampleCountList.size()]; + for (int i = 0 ; i < sampleCountListArray.length ; i++) { + sampleCountListArray[i] = sampleCountList.get(i); + } + opBuilder.setAttr("sample_count_list", sampleCountListArray); + long[] colOffsetListArray = new long[colOffsetList.size()]; + for (int i = 0 ; i < colOffsetListArray.length ; i++) { + colOffsetListArray[i] = colOffsetList.get(i); + } + opBuilder.setAttr("col_offset_list", colOffsetListArray); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("table_vocab_size", tableVocabSize); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + return new SortListOfSparseCoreCooTensors(opBuilder.build()); + } + + /** + * Gets sortedRowIds. + * + * @return sortedRowIds. + */ + public Output sortedRowIds() { + return sortedRowIds; + } + + /** + * Gets sortedColIds. + * + * @return sortedColIds. + */ + public Output sortedColIds() { + return sortedColIds; + } + + /** + * Gets sortedGains. + * + * @return sortedGains. + */ + public Output sortedGains() { + return sortedGains; + } + + /** + * Gets idCounts. + * + * @return idCounts. + */ + public Output idCounts() { + return idCounts; + } + + @OpInputsMetadata( + outputsClass = SortListOfSparseCoreCooTensors.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowIdsList input + */ + public final Iterable> rowIdsList; + + /** + * The colIdsList input + */ + public final Iterable> colIdsList; + + /** + * The gainsList input + */ + public final Iterable> gainsList; + + /** + * The sampleCountList attribute + */ + public final long[] sampleCountList; + + /** + * The colOffsetList attribute + */ + public final long[] colOffsetList; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The tableVocabSize attribute + */ + public final long tableVocabSize; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The numScPerChip attribute + */ + public final long numScPerChip; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + public Inputs(GraphOperation op) { + super(new SortListOfSparseCoreCooTensors(op), op, Arrays.asList("sample_count_list", "col_offset_list", "num_replica", "table_vocab_size", "feature_width", "num_sc_per_chip", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name")); + int inputIndex = 0; + int rowIdsListLength = op.inputListLength("row_ids_list"); + rowIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, rowIdsListLength)); + inputIndex += rowIdsListLength; + int colIdsListLength = op.inputListLength("col_ids_list"); + colIdsList = Arrays.asList((Operand[]) op.inputList(inputIndex, colIdsListLength)); + inputIndex += colIdsListLength; + int gainsListLength = op.inputListLength("gains_list"); + gainsList = Arrays.asList((Operand[]) op.inputList(inputIndex, gainsListLength)); + inputIndex += gainsListLength; + sampleCountList = op.attributes().getAttrIntList("sample_count_list"); + colOffsetList = op.attributes().getAttrIntList("col_offset_list"); + numReplica = op.attributes().getAttrInt("num_replica"); + tableVocabSize = op.attributes().getAttrInt("table_vocab_size"); + featureWidth = op.attributes().getAttrInt("feature_width"); + numScPerChip = op.attributes().getAttrInt("num_sc_per_chip"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java index 98d092850d7..a298f251835 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ * Does not add if local_step is smaller than the accumulator's * global_step. */ +@OpMetadata( + opType = SparseAccumulatorApplyGradient.OP_NAME, + inputsClass = SparseAccumulatorApplyGradient.Inputs.class +) @Operator( group = "sparse" ) @@ -42,8 +52,8 @@ public final class SparseAccumulatorApplyGradient extends RawOp { */ public static final String OP_NAME = "SparseAccumulatorApplyGradient"; - private SparseAccumulatorApplyGradient(Operation operation) { - super(operation); + public SparseAccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); } /** @@ -78,4 +88,61 @@ public static SparseAccumulatorApplyGradient create(Scope scope, Operand { + /** + * The handle to a accumulator. + */ + public final Operand handle; + + /** + * The local_step value at which the sparse gradient was computed. + */ + public final Operand localStep; + + /** + * Indices of the sparse gradient to be accumulated. Must be a + * vector. + */ + public final Operand gradientIndices; + + /** + * Values are the non-zero slices of the gradient, and must have + * the same first dimension as indices, i.e., the nnz represented by indices and + * values must be consistent. + */ + public final Operand gradientValues; + + /** + * Shape of the sparse gradient to be accumulated. + */ + public final Operand gradientShape; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + /** + * Boolean indicating whether gradient_shape is unknown, in which + * case the input is ignored during validation. + */ + public final boolean hasKnownShape; + + public Inputs(GraphOperation op) { + super(new SparseAccumulatorApplyGradient(op), op, Arrays.asList("dtype", "has_known_shape")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + localStep = (Operand) op.input(inputIndex++); + gradientIndices = (Operand) op.input(inputIndex++); + gradientValues = (Operand) op.input(inputIndex++); + gradientShape = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + hasKnownShape = op.attributes().getAttrBool("has_known_shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java index 1e82f4bef9a..fb8a868349d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -39,9 +45,11 @@ * average of the accumulated gradients. Also automatically increments * the recorded global_step in the accumulator by 1, and resets the * aggregate to 0. - * - * @param data type for {@code values} output */ +@OpMetadata( + opType = SparseAccumulatorTakeGradient.OP_NAME, + inputsClass = SparseAccumulatorTakeGradient.Inputs.class +) @Operator( group = "sparse" ) @@ -57,8 +65,8 @@ public final class SparseAccumulatorTakeGradient extends RawOp private Output shape; - private SparseAccumulatorTakeGradient(Operation operation) { - super(operation); + public SparseAccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; indices = operation.output(outputIdx++); values = operation.output(outputIdx++); @@ -114,4 +122,33 @@ public Output values() { public Output shape() { return shape; } + + @OpInputsMetadata( + outputsClass = SparseAccumulatorTakeGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to a SparseConditionalAccumulator. + */ + public final Operand handle; + + /** + * Number of gradients required before we return an aggregate. + */ + public final Operand numRequired; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new SparseAccumulatorTakeGradient<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + numRequired = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java index 792e1101808..88ef61b78a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -42,9 +48,11 @@ * {@code thresh == 0} (default) means everything is kept and actual thresholding happens * only for a positive value. *

      In the following shapes, {@code nnz} is the count after taking {@code thresh} into account. - * - * @param data type for {@code sum_values} output */ +@OpMetadata( + opType = SparseAdd.OP_NAME, + inputsClass = SparseAdd.Inputs.class +) @Operator( group = "sparse" ) @@ -60,8 +68,8 @@ public final class SparseAdd extends RawOp { private Output sumShape; - private SparseAdd(Operation operation) { - super(operation); + public SparseAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sumIndices = operation.output(outputIdx++); sumValues = operation.output(outputIdx++); @@ -126,4 +134,69 @@ public Output sumValues() { public Output sumShape() { return sumShape; } + + @OpInputsMetadata( + outputsClass = SparseAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. The {@code indices} of the first {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + */ + public final Operand aIndices; + + /** + * 1-D. The {@code values} of the first {@code SparseTensor}, size {@code [nnz]} Vector. + */ + public final Operand aValues; + + /** + * 1-D. The {@code shape} of the first {@code SparseTensor}, size {@code [ndims]} Vector. + */ + public final Operand aShape; + + /** + * 2-D. The {@code indices} of the second {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + */ + public final Operand bIndices; + + /** + * 1-D. The {@code values} of the second {@code SparseTensor}, size {@code [nnz]} Vector. + */ + public final Operand bValues; + + /** + * 1-D. The {@code shape} of the second {@code SparseTensor}, size {@code [ndims]} Vector. + */ + public final Operand bShape; + + /** + * 0-D. The magnitude threshold that determines if an output value/index + * pair takes space. + */ + public final Operand thresh; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Treal attribute + */ + public final DataType Treal; + + public Inputs(GraphOperation op) { + super(new SparseAdd<>(op), op, Arrays.asList("T", "Treal")); + int inputIndex = 0; + aIndices = (Operand) op.input(inputIndex++); + aValues = (Operand) op.input(inputIndex++); + aShape = (Operand) op.input(inputIndex++); + bIndices = (Operand) op.input(inputIndex++); + bValues = (Operand) op.input(inputIndex++); + bShape = (Operand) op.input(inputIndex++); + thresh = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Treal = op.attributes().getAttrType("Treal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java index e88a90c5e92..8a844c96eff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ * as {@code SparseTensor} objects. This op takes in the upstream gradient w.r.t. * non-empty values of the sum, and outputs the gradients w.r.t. the non-empty * values of A and B. - * - * @param data type for {@code a_val_grad} output */ +@OpMetadata( + opType = SparseAddGrad.OP_NAME, + inputsClass = SparseAddGrad.Inputs.class +) @Operator( group = "sparse" ) @@ -50,8 +58,8 @@ public final class SparseAddGrad extends RawOp { private Output bValGrad; - private SparseAddGrad(Operation operation) { - super(operation); + public SparseAddGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; aValGrad = operation.output(outputIdx++); bValGrad = operation.output(outputIdx++); @@ -102,4 +110,46 @@ public Output aValGrad() { public Output bValGrad() { return bValGrad; } + + @OpInputsMetadata( + outputsClass = SparseAddGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D with shape {@code [nnz(sum)]}. The gradient with respect to + * the non-empty values of the sum. + */ + public final Operand backpropValGrad; + + /** + * 2-D. The {@code indices} of the {@code SparseTensor} A, size {@code [nnz(A), ndims]}. + */ + public final Operand aIndices; + + /** + * 2-D. The {@code indices} of the {@code SparseTensor} B, size {@code [nnz(B), ndims]}. + */ + public final Operand bIndices; + + /** + * 2-D. The {@code indices} of the sum {@code SparseTensor}, size + * {@code [nnz(sum), ndims]}. + */ + public final Operand sumIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseAddGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + backpropValGrad = (Operand) op.input(inputIndex++); + aIndices = (Operand) op.input(inputIndex++); + bIndices = (Operand) op.input(inputIndex++); + sumIndices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java index b13f2f043d3..9eca1295d45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -36,9 +42,11 @@ * the value in {@code weights} at each index where the corresponding value in {@code arr} is * {@code i}. *

      Values in {@code arr} outside of the range [0, size) are ignored. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseBincount.OP_NAME, + inputsClass = SparseBincount.Inputs.class +) @Operator( group = "sparse" ) @@ -50,8 +58,8 @@ public final class SparseBincount extends RawOp implements Op private Output output; - private SparseBincount(Operation operation) { - super(operation); + public SparseBincount(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -139,4 +147,64 @@ public Options binaryOutput(Boolean binaryOutput) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseBincount.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2D int64 {@code Tensor}. + */ + public final Operand indices; + + /** + * 1D int {@code Tensor}. + */ + public final Operand values; + + /** + * 1D int64 {@code Tensor}. + */ + public final Operand denseShape; + + /** + * non-negative int scalar {@code Tensor}. + */ + public final Operand sizeOutput; + + /** + * is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights + * equal to 1. + */ + public final Operand weights; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The T attribute + */ + public final DataType T; + + /** + * bool; Whether the kernel should count the appearance or number of occurrences. + */ + public final boolean binaryOutput; + + public Inputs(GraphOperation op) { + super(new SparseBincount<>(op), op, Arrays.asList("Tidx", "T", "binary_output")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + denseShape = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + Tidx = op.attributes().getAttrType("Tidx"); + T = op.attributes().getAttrType("T"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java index 4b4f2aad88e..016f010647b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -68,9 +74,11 @@ * [ a] concat [ d e ] = [ a d e ] * [b c ] [ ] [b c ] * - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseConcat.OP_NAME, + inputsClass = SparseConcat.Inputs.class +) @Operator( group = "sparse" ) @@ -86,8 +94,8 @@ public final class SparseConcat extends RawOp { private Output outputShape; - private SparseConcat(Operation operation) { - super(operation); + public SparseConcat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -146,4 +154,51 @@ public Output outputValues() { public Output outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseConcat.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. Indices of each input {@code SparseTensor}. + */ + public final Iterable> indices; + + /** + * 1-D. Non-empty values of each {@code SparseTensor}. + */ + public final Iterable> values; + + /** + * 1-D. Shapes of each {@code SparseTensor}. + */ + public final Iterable> shapes; + + /** + * Dimension to concatenate along. Must be in range [-rank, rank), + * where rank is the number of dimensions in each input {@code SparseTensor}. + */ + public final long concatDim; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseConcat<>(op), op, Arrays.asList("concat_dim", "T")); + int inputIndex = 0; + int indicesLength = op.inputListLength("indices"); + indices = Arrays.asList((Operand[]) op.inputList(inputIndex, indicesLength)); + inputIndex += indicesLength; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + int shapesLength = op.inputListLength("shapes"); + shapes = Arrays.asList((Operand[]) op.inputList(inputIndex, shapesLength)); + inputIndex += shapesLength; + concatDim = op.attributes().getAttrInt("concat_dim"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java index 42b9e9795e9..1ee7db0413c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -39,6 +45,10 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ +@OpMetadata( + opType = SparseConditionalAccumulator.OP_NAME, + inputsClass = SparseConditionalAccumulator.Inputs.class +) @Operator( group = "sparse" ) @@ -50,8 +60,8 @@ public final class SparseConditionalAccumulator extends RawOp implements Operand private Output handle; - private SparseConditionalAccumulator(Operation operation) { - super(operation); + public SparseConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -184,4 +194,46 @@ public Options reductionType(String reductionType) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseConditionalAccumulator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of the value being accumulated. + */ + public final DataType dtype; + + /** + * The shape of the values. + */ + public final Shape shape; + + /** + * If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this accumulator will be shared under the given name + * across multiple sessions. + */ + public final String sharedName; + + /** + * The reductionType attribute + */ + public final String reductionType; + + public Inputs(GraphOperation op) { + super(new SparseConditionalAccumulator(op), op, Arrays.asList("dtype", "shape", "container", "shared_name", "reduction_type")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + reductionType = op.attributes().getAttrString("reduction_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java index f5a952335fa..4c59b4e2774 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a sparse tensor input. * Counts the number of times each value occurs in the input. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseCountSparseOutput.OP_NAME, + inputsClass = SparseCountSparseOutput.Inputs.class +) +@Operator( + group = "sparse" +) public final class SparseCountSparseOutput extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class SparseCountSparseOutput extends RawOp { private Output outputDenseShape; - private SparseCountSparseOutput(Operation operation) { - super(operation); + public SparseCountSparseOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -172,4 +184,69 @@ public Options maxlength(Long maxlength) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseCountSparseOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Tensor containing the indices of the sparse tensor to count. + */ + public final Operand indices; + + /** + * Tensor containing values of the sparse tensor to count. + */ + public final Operand values; + + /** + * Tensor containing the dense shape of the sparse tensor to count. + */ + public final Operand denseShape; + + /** + * A Tensor of the same shape as indices containing per-index weight values. + * May also be the empty tensor if no weights are used. + */ + public final Operand weights; + + /** + * Dtype of the input values tensor. + */ + public final DataType T; + + /** + * Minimum value to count. Can be set to -1 for no minimum. + */ + public final long minlength; + + /** + * Maximum value to count. Can be set to -1 for no maximum. + */ + public final long maxlength; + + /** + * Whether to output the number of occurrences of each value or 1. + */ + public final boolean binaryOutput; + + /** + * Dtype of the output values tensor. + */ + public final DataType outputType; + + public Inputs(GraphOperation op) { + super(new SparseCountSparseOutput<>(op), op, Arrays.asList("T", "minlength", "maxlength", "binary_output", "output_type")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + denseShape = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + minlength = op.attributes().getAttrInt("minlength"); + maxlength = op.attributes().getAttrInt("maxlength"); + binaryOutput = op.attributes().getAttrBool("binary_output"); + outputType = op.attributes().getAttrType("output_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java index 30fc19a5315..ae78a88f0cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -68,6 +74,10 @@ * Fingerprint64("e"), Fingerprint64("c"))) * */ +@OpMetadata( + opType = SparseCross.OP_NAME, + inputsClass = SparseCross.Inputs.class +) @Operator( group = "sparse" ) @@ -83,8 +93,8 @@ public final class SparseCross extends RawOp { private Output outputShape; - private SparseCross(Operation operation) { - super(operation); + public SparseCross(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -144,4 +154,64 @@ public Output outputValues() { public Output outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseCross.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D. Indices of each input {@code SparseTensor}. + */ + public final Iterable> indices; + + /** + * 1-D. values of each {@code SparseTensor}. + */ + public final Iterable> values; + + /** + * 1-D. Shapes of each {@code SparseTensor}. + */ + public final Iterable> shapes; + + /** + * 2-D. Columns represented by dense {@code Tensor}. + */ + public final Iterable> denseInputs; + + /** + * string used when joining a list of string inputs, can be used as separator later. + */ + public final Operand sep; + + /** + * The sparseTypes attribute + */ + public final DataType[] sparseTypes; + + /** + * The denseTypes attribute + */ + public final DataType[] denseTypes; + + public Inputs(GraphOperation op) { + super(new SparseCross(op), op, Arrays.asList("sparse_types", "dense_types")); + int inputIndex = 0; + int indicesLength = op.inputListLength("indices"); + indices = Arrays.asList((Operand[]) op.inputList(inputIndex, indicesLength)); + inputIndex += indicesLength; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + int shapesLength = op.inputListLength("shapes"); + shapes = Arrays.asList((Operand[]) op.inputList(inputIndex, shapesLength)); + inputIndex += shapesLength; + int denseInputsLength = op.inputListLength("dense_inputs"); + denseInputs = Arrays.asList((Operand[]) op.inputList(inputIndex, denseInputsLength)); + inputIndex += denseInputsLength; + sep = (Operand) op.input(inputIndex++); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + denseTypes = op.attributes().getAttrTypeList("dense_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java index 93e93fe4531..68265f4058c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; @@ -68,6 +74,10 @@ * Fingerprint64("e"), Fingerprint64("c"))) * */ +@OpMetadata( + opType = SparseCrossHashed.OP_NAME, + inputsClass = SparseCrossHashed.Inputs.class +) @Operator( group = "sparse" ) @@ -83,8 +93,8 @@ public final class SparseCrossHashed extends RawOp { private Output outputShape; - private SparseCrossHashed(Operation operation) { - super(operation); + public SparseCrossHashed(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -150,4 +160,77 @@ public Output outputValues() { public Output outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseCrossHashed.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D. Indices of each input {@code SparseTensor}. + */ + public final Iterable> indices; + + /** + * 1-D. values of each {@code SparseTensor}. + */ + public final Iterable> values; + + /** + * 1-D. Shapes of each {@code SparseTensor}. + */ + public final Iterable> shapes; + + /** + * 2-D. Columns represented by dense {@code Tensor}. + */ + public final Iterable> denseInputs; + + /** + * It is used if hashed_output is true. + * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. + */ + public final Operand numBuckets; + + /** + * boolean, if true, siphash with salt will be used instead of farmhash. + */ + public final Operand strongHash; + + /** + * Specify the salt that will be used by the siphash function. + */ + public final Operand salt; + + /** + * The sparseTypes attribute + */ + public final DataType[] sparseTypes; + + /** + * The denseTypes attribute + */ + public final DataType[] denseTypes; + + public Inputs(GraphOperation op) { + super(new SparseCrossHashed(op), op, Arrays.asList("sparse_types", "dense_types")); + int inputIndex = 0; + int indicesLength = op.inputListLength("indices"); + indices = Arrays.asList((Operand[]) op.inputList(inputIndex, indicesLength)); + inputIndex += indicesLength; + int valuesLength = op.inputListLength("values"); + values = Arrays.asList((Operand[]) op.inputList(inputIndex, valuesLength)); + inputIndex += valuesLength; + int shapesLength = op.inputListLength("shapes"); + shapes = Arrays.asList((Operand[]) op.inputList(inputIndex, shapesLength)); + inputIndex += shapesLength; + int denseInputsLength = op.inputListLength("dense_inputs"); + denseInputs = Arrays.asList((Operand[]) op.inputList(inputIndex, denseInputsLength)); + inputIndex += denseInputsLength; + numBuckets = (Operand) op.input(inputIndex++); + strongHash = (Operand) op.input(inputIndex++); + salt = (Operand) op.input(inputIndex++); + sparseTypes = op.attributes().getAttrTypeList("sparse_types"); + denseTypes = op.attributes().getAttrTypeList("dense_types"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java index 96911d81a5d..10ac8721d98 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,9 +43,11 @@ *

      By these rules, the result is a logical SparseTensor with exactly the same * indices and shape, but possibly with different non-zero values. The output of * this Op is the resultant non-zero values. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseDenseCwiseAdd.OP_NAME, + inputsClass = SparseDenseCwiseAdd.Inputs.class +) @Operator( group = "sparse" ) @@ -51,8 +59,8 @@ public final class SparseDenseCwiseAdd extends RawOp implements private Output output; - private SparseDenseCwiseAdd(Operation operation) { - super(operation); + public SparseDenseCwiseAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -95,4 +103,45 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseDenseCwiseAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand spIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. + */ + public final Operand spValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand spShape; + + /** + * {@code R}-D. The dense Tensor operand. + */ + public final Operand dense; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseDenseCwiseAdd<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + spIndices = (Operand) op.input(inputIndex++); + spValues = (Operand) op.input(inputIndex++); + spShape = (Operand) op.input(inputIndex++); + dense = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java index dabb95c94f4..724997892b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,9 +38,11 @@ * Component-wise divides a SparseTensor by a dense Tensor. * Limitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseDenseCwiseDiv.OP_NAME, + inputsClass = SparseDenseCwiseDiv.Inputs.class +) @Operator( group = "sparse" ) @@ -46,8 +54,8 @@ public final class SparseDenseCwiseDiv extends RawOp implements private Output output; - private SparseDenseCwiseDiv(Operation operation) { - super(operation); + public SparseDenseCwiseDiv(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -90,4 +98,45 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseDenseCwiseDiv.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand spIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. + */ + public final Operand spValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand spShape; + + /** + * {@code R}-D. The dense Tensor operand. + */ + public final Operand dense; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseDenseCwiseDiv<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + spIndices = (Operand) op.input(inputIndex++); + spValues = (Operand) op.input(inputIndex++); + spShape = (Operand) op.input(inputIndex++); + dense = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java index 046426ce0c4..fe8386f0838 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * contents of the dense tensor (even if it's +/-INF and that INF*0 == NaN). *

      Limitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseDenseCwiseMul.OP_NAME, + inputsClass = SparseDenseCwiseMul.Inputs.class +) @Operator( group = "sparse" ) @@ -49,8 +57,8 @@ public final class SparseDenseCwiseMul extends RawOp implements private Output output; - private SparseDenseCwiseMul(Operation operation) { - super(operation); + public SparseDenseCwiseMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -93,4 +101,45 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseDenseCwiseMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand spIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. + */ + public final Operand spValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand spShape; + + /** + * {@code R}-D. The dense Tensor operand. + */ + public final Operand dense; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseDenseCwiseMul<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + spIndices = (Operand) op.input(inputIndex++); + spValues = (Operand) op.input(inputIndex++); + spShape = (Operand) op.input(inputIndex++); + dense = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java index 1f22702059e..ef0d2f85afa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -65,9 +71,11 @@ *

        * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
        * 
      - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseFillEmptyRows.OP_NAME, + inputsClass = SparseFillEmptyRows.Inputs.class +) @Operator( group = "sparse" ) @@ -85,8 +93,8 @@ public final class SparseFillEmptyRows extends RawOp { private Output reverseIndexMap; - private SparseFillEmptyRows(Operation operation) { - super(operation); + public SparseFillEmptyRows(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -157,4 +165,46 @@ public Output emptyRowIndicator() { public Output reverseIndexMap() { return reverseIndexMap; } + + @OpInputsMetadata( + outputsClass = SparseFillEmptyRows.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. the indices of the sparse tensor. + */ + public final Operand indices; + + /** + * 1-D. the values of the sparse tensor. + */ + public final Operand values; + + /** + * 1-D. the shape of the sparse tensor. + */ + public final Operand denseShape; + + /** + * 0-D. default value to insert into location {@code [row, 0, ..., 0]} + * for rows missing from the input sparse tensor. + * output indices: 2-D. the indices of the filled sparse tensor. + */ + public final Operand defaultValue; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseFillEmptyRows<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + denseShape = (Operand) op.input(inputIndex++); + defaultValue = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java index bd262ebb278..3b1c80bb5b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -37,9 +43,11 @@ *

      d_values[j] = grad_values[reverse_index_map[j]] * d_default_value = sum_{k : 0 .. N_full - 1} ( * grad_values[k] * 1{k not in reverse_index_map}) - * - * @param data type for {@code d_values} output */ +@OpMetadata( + opType = SparseFillEmptyRowsGrad.OP_NAME, + inputsClass = SparseFillEmptyRowsGrad.Inputs.class +) @Operator( group = "sparse" ) @@ -53,8 +61,8 @@ public final class SparseFillEmptyRowsGrad extends RawOp { private Output dDefaultValue; - private SparseFillEmptyRowsGrad(Operation operation) { - super(operation); + public SparseFillEmptyRowsGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; dValues = operation.output(outputIdx++); dDefaultValue = operation.output(outputIdx++); @@ -97,4 +105,32 @@ public Output dValues() { public Output dDefaultValue() { return dDefaultValue; } + + @OpInputsMetadata( + outputsClass = SparseFillEmptyRowsGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. The reverse index map from SparseFillEmptyRows. + */ + public final Operand reverseIndexMap; + + /** + * 1-D. The gradients from backprop. + */ + public final Operand gradValues; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseFillEmptyRowsGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + reverseIndexMap = (Operand) op.input(inputIndex++); + gradValues = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java index b913561a039..03e41db4930 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; @@ -39,6 +45,10 @@ *

      The gradient computation of this operation will only take advantage of sparsity * in the input gradient when that gradient comes from a Relu. */ +@OpMetadata( + opType = SparseMatMul.OP_NAME, + inputsClass = SparseMatMul.Inputs.class +) @Operator( group = "sparse" ) @@ -50,8 +60,8 @@ public final class SparseMatMul extends RawOp implements Operand { private Output product; - private SparseMatMul(Operation operation) { - super(operation); + public SparseMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; product = operation.output(outputIdx++); } @@ -60,8 +70,8 @@ private SparseMatMul(Operation operation) { * Factory method to create a class wrapping a new SparseMatMul operation. * * @param scope current scope - * @param a the a value - * @param b the b value + * @param a The a value + * @param b The b value * @param options carries optional attribute values * @return a new instance of SparseMatMul */ @@ -205,4 +215,62 @@ public Options bIsSparse(Boolean bIsSparse) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseMatMul.class + ) + public static class Inputs extends RawOpInputs { + /** + * The a input + */ + public final Operand a; + + /** + * The b input + */ + public final Operand b; + + /** + * The transposeA attribute + */ + public final boolean transposeA; + + /** + * The transposeB attribute + */ + public final boolean transposeB; + + /** + * The aIsSparse attribute + */ + public final boolean aIsSparse; + + /** + * The bIsSparse attribute + */ + public final boolean bIsSparse; + + /** + * The Ta attribute + */ + public final DataType Ta; + + /** + * The Tb attribute + */ + public final DataType Tb; + + public Inputs(GraphOperation op) { + super(new SparseMatMul(op), op, Arrays.asList("transpose_a", "transpose_b", "a_is_sparse", "b_is_sparse", "Ta", "Tb")); + int inputIndex = 0; + a = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + transposeA = op.attributes().getAttrBool("transpose_a"); + transposeB = op.attributes().getAttrBool("transpose_b"); + aIsSparse = op.attributes().getAttrBool("a_is_sparse"); + bIsSparse = op.attributes().getAttrBool("b_is_sparse"); + Ta = op.attributes().getAttrType("Ta"); + Tb = op.attributes().getAttrType("Tb"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java index 534e256d548..256695f0acd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -41,9 +47,11 @@ *

      If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseReduceMax.OP_NAME, + inputsClass = SparseReduceMax.Inputs.class +) @Operator( group = "sparse" ) @@ -55,8 +63,8 @@ public final class SparseReduceMax extends RawOp implements O private Output output; - private SparseReduceMax(Operation operation) { - super(operation); + public SparseReduceMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -139,4 +147,51 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseReduceMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code input_indices}. + */ + public final Operand inputValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand inputShape; + + /** + * 1-D. Length-{@code K} vector containing the reduction axes. + */ + public final Operand reductionAxes; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseReduceMax<>(op), op, Arrays.asList("keep_dims", "T")); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputValues = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + reductionAxes = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java index 075937687d8..b0a65daea67 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -41,9 +47,11 @@ *

      If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseReduceMaxSparse.OP_NAME, + inputsClass = SparseReduceMaxSparse.Inputs.class +) @Operator( group = "sparse" ) @@ -59,8 +67,8 @@ public final class SparseReduceMaxSparse extends RawOp { private Output outputShape; - private SparseReduceMaxSparse(Operation operation) { - super(operation); + public SparseReduceMaxSparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -158,4 +166,51 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseReduceMaxSparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code input_indices}. + */ + public final Operand inputValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand inputShape; + + /** + * 1-D. Length-{@code K} vector containing the reduction axes. + */ + public final Operand reductionAxes; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseReduceMaxSparse<>(op), op, Arrays.asList("keep_dims", "T")); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputValues = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + reductionAxes = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java index b3e4e20e8c0..3589487bece 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ *

      If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseReduceSum.OP_NAME, + inputsClass = SparseReduceSum.Inputs.class +) @Operator( group = "sparse" ) @@ -55,8 +63,8 @@ public final class SparseReduceSum extends RawOp implements Ope private Output output; - private SparseReduceSum(Operation operation) { - super(operation); + public SparseReduceSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -139,4 +147,51 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseReduceSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code input_indices}. + */ + public final Operand inputValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand inputShape; + + /** + * 1-D. Length-{@code K} vector containing the reduction axes. + */ + public final Operand reductionAxes; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseReduceSum<>(op), op, Arrays.asList("keep_dims", "T")); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputValues = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + reductionAxes = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java index 20e3887bffa..ef58eac0af1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -41,9 +47,11 @@ *

      If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseReduceSumSparse.OP_NAME, + inputsClass = SparseReduceSumSparse.Inputs.class +) @Operator( group = "sparse" ) @@ -59,8 +67,8 @@ public final class SparseReduceSumSparse extends RawOp { private Output outputShape; - private SparseReduceSumSparse(Operation operation) { - super(operation); + public SparseReduceSumSparse(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -158,4 +166,51 @@ public Options keepDims(Boolean keepDims) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseReduceSumSparse.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code input_indices}. + */ + public final Operand inputValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand inputShape; + + /** + * 1-D. Length-{@code K} vector containing the reduction axes. + */ + public final Operand reductionAxes; + + /** + * If true, retain reduced dimensions with length 1. + */ + public final boolean keepDims; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseReduceSumSparse<>(op), op, Arrays.asList("keep_dims", "T")); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputValues = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + reductionAxes = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java index b1b836e6563..4e2883435f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ *

      Reordering does not affect the shape of the SparseTensor. *

      If the tensor has rank {@code R} and {@code N} non-empty values, {@code input_indices} has * shape {@code [N, R]}, input_values has length {@code N}, and input_shape has length {@code R}. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseReorder.OP_NAME, + inputsClass = SparseReorder.Inputs.class +) @Operator( group = "sparse" ) @@ -52,8 +60,8 @@ public final class SparseReorder extends RawOp { private Output outputValues; - private SparseReorder(Operation operation) { - super(operation); + public SparseReorder(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -100,4 +108,39 @@ public Output outputIndices() { public Output outputValues() { return outputValues; } + + @OpInputsMetadata( + outputsClass = SparseReorder.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, possibly not in canonical ordering. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code input_indices}. + */ + public final Operand inputValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand inputShape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseReorder<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputValues = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java index 59eedfde460..8d9f5272c58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; @@ -42,6 +47,10 @@ * {@code input_shape} has length {@code R_in}, {@code output_indices} has shape {@code [N, R_out]}, and * {@code output_shape} has length {@code R_out}. */ +@OpMetadata( + opType = SparseReshape.OP_NAME, + inputsClass = SparseReshape.Inputs.class +) @Operator( group = "sparse" ) @@ -55,8 +64,8 @@ public final class SparseReshape extends RawOp { private Output outputShape; - private SparseReshape(Operation operation) { - super(operation); + public SparseReshape(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputShape = operation.output(outputIdx++); @@ -104,4 +113,33 @@ public Output outputIndices() { public Output outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseReshape.class + ) + public static class Inputs extends RawOpInputs { + /** + * 2-D. {@code N x R_in} matrix with the indices of non-empty values in a + * SparseTensor. + */ + public final Operand inputIndices; + + /** + * 1-D. {@code R_in} vector with the input SparseTensor's dense shape. + */ + public final Operand inputShape; + + /** + * 1-D. {@code R_out} vector with the requested new dense shape. + */ + public final Operand newShape; + + public Inputs(GraphOperation op) { + super(new SparseReshape(op), op, Arrays.asList()); + int inputIndex = 0; + inputIndices = (Operand) op.input(inputIndex++); + inputShape = (Operand) op.input(inputIndex++); + newShape = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java index cfa2fadbd74..4703ba10fca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -32,9 +38,11 @@ * See {@code tf.sparse.segment_sum} for usage examples. *

      Like {@code SegmentMean}, but {@code segment_ids} can have rank less than {@code data}'s first * dimension, selecting a subset of dimension 0, specified by {@code indices}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentMean.OP_NAME, + inputsClass = SparseSegmentMean.Inputs.class +) @Operator( group = "sparse" ) @@ -46,8 +54,8 @@ public final class SparseSegmentMean extends RawOp implements private Output output; - private SparseSegmentMean(Operation operation) { - super(operation); + public SparseSegmentMean(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -56,9 +64,10 @@ private SparseSegmentMean(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentMean operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentMean} output and operands * @return a new instance of SparseSegmentMean */ @@ -66,14 +75,32 @@ private SparseSegmentMean(Operation operation) { describeByClass = true ) public static SparseSegmentMean create(Scope scope, Operand data, - Operand indices, Operand segmentIds) { + Operand indices, Operand segmentIds, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentMean"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentMean<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which @@ -88,4 +115,77 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentMean} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentMean.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentMean<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java index 25245eb2db0..9da8038eee9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,63 +17,76 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients for SparseSegmentMean. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. - * - * @param data type for {@code output} output + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". */ +@OpMetadata( + opType = SparseSegmentMeanGrad.OP_NAME, + inputsClass = SparseSegmentMeanGrad.Inputs.class +) @Operator( group = "sparse" ) -public final class SparseSegmentMeanGrad extends RawOp implements Operand { +public final class SparseSegmentMeanGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMeanGrad"; + public static final String OP_NAME = "SparseSegmentMeanGradV2"; private Output output; - private SparseSegmentMeanGrad(Operation operation) { - super(operation); + private Output sortedUniqueIndices; + + public SparseSegmentMeanGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); + sortedUniqueIndices = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SparseSegmentMeanGrad operation. + * Factory method to create a class wrapping a new SparseSegmentMeanGradV2 operation. * * @param scope current scope * @param grad gradient propagated to the SparseSegmentMean op. * @param indices indices passed to the corresponding SparseSegmentMean op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentMean op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentMean op. - * @param data type for {@code SparseSegmentMeanGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentMean op. + * @param data type for {@code SparseSegmentMeanGradV2} output and operands + * @param data type for {@code SparseSegmentMeanGradV2} output and operands * @return a new instance of SparseSegmentMeanGrad */ @Endpoint( describeByClass = true ) - public static SparseSegmentMeanGrad create(Scope scope, Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { + public static SparseSegmentMeanGrad create( + Scope scope, Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentMeanGrad"); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder.addInput(outputDim0.asOutput()); + opBuilder.addInput(denseOutputDim0.asOutput()); return new SparseSegmentMeanGrad<>(opBuilder.build()); } @@ -86,8 +99,64 @@ public Output output() { return output; } - @Override - public Output asOutput() { - return output; + /** + * Gets sortedUniqueIndices. + * + * @return sortedUniqueIndices. + */ + public Output sortedUniqueIndices() { + return sortedUniqueIndices; + } + + @OpInputsMetadata( + outputsClass = SparseSegmentMeanGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * gradient propagated to the SparseSegmentMean op. + */ + public final Operand grad; + + /** + * indices passed to the corresponding SparseSegmentMean op. + */ + public final Operand indices; + + /** + * segment_ids passed to the corresponding SparseSegmentMean op. + */ + public final Operand segmentIds; + + /** + * dimension 0 of "data" passed to SparseSegmentMean op. + */ + public final Operand denseOutputDim0; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + public Inputs(GraphOperation op) { + super(new SparseSegmentMeanGrad<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids")); + int inputIndex = 0; + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + denseOutputDim0 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java index ddc60bd6065..99cf33231a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -34,9 +40,11 @@ *

      Read * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentMeanWithNumSegments.OP_NAME, + inputsClass = SparseSegmentMeanWithNumSegments.Inputs.class +) @Operator( group = "sparse" ) @@ -48,8 +56,8 @@ public final class SparseSegmentMeanWithNumSegments extends R private Output output; - private SparseSegmentMeanWithNumSegments(Operation operation) { - super(operation); + public SparseSegmentMeanWithNumSegments(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -58,10 +66,11 @@ private SparseSegmentMeanWithNumSegments(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentMeanWithNumSegments operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentMeanWithNumSegments} output and operands * @return a new instance of SparseSegmentMeanWithNumSegments */ @@ -70,15 +79,32 @@ private SparseSegmentMeanWithNumSegments(Operation operation) { ) public static SparseSegmentMeanWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { + Operand numSegments, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentMeanWithNumSegments"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentMeanWithNumSegments<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which has size @@ -93,4 +119,89 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentMeanWithNumSegments} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentMeanWithNumSegments.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * Should equal the number of distinct segment IDs. + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentMeanWithNumSegments<>(op), op, Arrays.asList("T", "Tidx", "Tnumsegments", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java index 7834485434d..5e299d7d124 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. * N is the size of the segment being reduced. *

      See {@code tf.sparse.segment_sum} for usage examples. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentSqrtN.OP_NAME, + inputsClass = SparseSegmentSqrtN.Inputs.class +) @Operator( group = "sparse" ) @@ -45,8 +53,8 @@ public final class SparseSegmentSqrtN extends RawOp implement private Output output; - private SparseSegmentSqrtN(Operation operation) { - super(operation); + public SparseSegmentSqrtN(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -55,9 +63,10 @@ private SparseSegmentSqrtN(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentSqrtN operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSqrtN} output and operands * @return a new instance of SparseSegmentSqrtN */ @@ -65,14 +74,32 @@ private SparseSegmentSqrtN(Operation operation) { describeByClass = true ) public static SparseSegmentSqrtN create(Scope scope, Operand data, - Operand indices, Operand segmentIds) { + Operand indices, Operand segmentIds, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSqrtN"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentSqrtN<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which @@ -87,4 +114,77 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentSqrtN} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSqrtN.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSqrtN<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java index b6e5b54277a..b458c7daff9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,63 +17,76 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients for SparseSegmentSqrtN. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. - * - * @param data type for {@code output} output + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". */ +@OpMetadata( + opType = SparseSegmentSqrtNGrad.OP_NAME, + inputsClass = SparseSegmentSqrtNGrad.Inputs.class +) @Operator( group = "sparse" ) -public final class SparseSegmentSqrtNGrad extends RawOp implements Operand { +public final class SparseSegmentSqrtNGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtNGrad"; + public static final String OP_NAME = "SparseSegmentSqrtNGradV2"; private Output output; - private SparseSegmentSqrtNGrad(Operation operation) { - super(operation); + private Output sortedUniqueIndices; + + public SparseSegmentSqrtNGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); + sortedUniqueIndices = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SparseSegmentSqrtNGrad operation. + * Factory method to create a class wrapping a new SparseSegmentSqrtNGradV2 operation. * * @param scope current scope * @param grad gradient propagated to the SparseSegmentSqrtN op. * @param indices indices passed to the corresponding SparseSegmentSqrtN op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentSqrtN op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. - * @param data type for {@code SparseSegmentSqrtNGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. + * @param data type for {@code SparseSegmentSqrtNGradV2} output and operands + * @param data type for {@code SparseSegmentSqrtNGradV2} output and operands * @return a new instance of SparseSegmentSqrtNGrad */ @Endpoint( describeByClass = true ) - public static SparseSegmentSqrtNGrad create(Scope scope, Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { + public static SparseSegmentSqrtNGrad create( + Scope scope, Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSqrtNGrad"); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder.addInput(outputDim0.asOutput()); + opBuilder.addInput(denseOutputDim0.asOutput()); return new SparseSegmentSqrtNGrad<>(opBuilder.build()); } @@ -86,8 +99,64 @@ public Output output() { return output; } - @Override - public Output asOutput() { - return output; + /** + * Gets sortedUniqueIndices. + * + * @return sortedUniqueIndices. + */ + public Output sortedUniqueIndices() { + return sortedUniqueIndices; + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSqrtNGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * gradient propagated to the SparseSegmentSqrtN op. + */ + public final Operand grad; + + /** + * indices passed to the corresponding SparseSegmentSqrtN op. + */ + public final Operand indices; + + /** + * segment_ids passed to the corresponding SparseSegmentSqrtN op. + */ + public final Operand segmentIds; + + /** + * dimension 0 of "data" passed to SparseSegmentSqrtN op. + */ + public final Operand denseOutputDim0; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSqrtNGrad<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids")); + int inputIndex = 0; + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + denseOutputDim0 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java index 6bd3339813e..146dd696d6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -35,9 +41,11 @@ *

      Read * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentSqrtNWithNumSegments.OP_NAME, + inputsClass = SparseSegmentSqrtNWithNumSegments.Inputs.class +) @Operator( group = "sparse" ) @@ -49,8 +57,8 @@ public final class SparseSegmentSqrtNWithNumSegments extends private Output output; - private SparseSegmentSqrtNWithNumSegments(Operation operation) { - super(operation); + public SparseSegmentSqrtNWithNumSegments(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,10 +67,11 @@ private SparseSegmentSqrtNWithNumSegments(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentSqrtNWithNumSegments operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSqrtNWithNumSegments} output and operands * @return a new instance of SparseSegmentSqrtNWithNumSegments */ @@ -71,15 +80,32 @@ private SparseSegmentSqrtNWithNumSegments(Operation operation) { ) public static SparseSegmentSqrtNWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { + Operand numSegments, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSqrtNWithNumSegments"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentSqrtNWithNumSegments<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which @@ -94,4 +120,89 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentSqrtNWithNumSegments} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSqrtNWithNumSegments.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * Should equal the number of distinct segment IDs. + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSqrtNWithNumSegments<>(op), op, Arrays.asList("T", "Tidx", "Tnumsegments", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java index 13f9842bbfa..2f28386d05c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -55,9 +61,11 @@ * # Which is equivalent to: * tf.segment_sum(c, tf.constant([0, 0, 1])) * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentSum.OP_NAME, + inputsClass = SparseSegmentSum.Inputs.class +) @Operator( group = "sparse" ) @@ -69,8 +77,8 @@ public final class SparseSegmentSum extends RawOp implements private Output output; - private SparseSegmentSum(Operation operation) { - super(operation); + public SparseSegmentSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -79,9 +87,10 @@ private SparseSegmentSum(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentSum operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSum} output and operands * @return a new instance of SparseSegmentSum */ @@ -89,14 +98,32 @@ private SparseSegmentSum(Operation operation) { describeByClass = true ) public static SparseSegmentSum create(Scope scope, Operand data, - Operand indices, Operand segmentIds) { + Operand indices, Operand segmentIds, + Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSum"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentSum<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which @@ -111,4 +138,77 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentSum} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSum<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumGrad.java index c82f3dbab2e..1372d6f7089 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,63 +17,76 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients for SparseSegmentSum. * Returns tensor "output" with same shape as grad, except for dimension 0 whose - * value is output_dim0. - * - * @param data type for {@code output} output + * value is the number of unique indexes in "indices". Also returns vector + * "sorted_unique_indices" containing the corresponding indexes from "indices". */ +@OpMetadata( + opType = SparseSegmentSumGrad.OP_NAME, + inputsClass = SparseSegmentSumGrad.Inputs.class +) @Operator( group = "sparse" ) -public final class SparseSegmentSumGrad extends RawOp implements Operand { +public final class SparseSegmentSumGrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSumGrad"; + public static final String OP_NAME = "SparseSegmentSumGradV2"; private Output output; - private SparseSegmentSumGrad(Operation operation) { - super(operation); + private Output sortedUniqueIndices; + + public SparseSegmentSumGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); + sortedUniqueIndices = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new SparseSegmentSumGrad operation. + * Factory method to create a class wrapping a new SparseSegmentSumGradV2 operation. * * @param scope current scope * @param grad gradient propagated to the SparseSegmentSum op. * @param indices indices passed to the corresponding SparseSegmentSum op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentSum op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSum op. - * @param data type for {@code SparseSegmentSumGrad} output and operands + * @param denseOutputDim0 dimension 0 of "data" passed to SparseSegmentSum op. + * @param data type for {@code SparseSegmentSumGradV2} output and operands + * @param data type for {@code SparseSegmentSumGradV2} output and operands * @return a new instance of SparseSegmentSumGrad */ @Endpoint( describeByClass = true ) - public static SparseSegmentSumGrad create(Scope scope, Operand grad, - Operand indices, Operand segmentIds, - Operand outputDim0) { + public static SparseSegmentSumGrad create( + Scope scope, Operand grad, Operand indices, Operand segmentIds, + Operand denseOutputDim0) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSumGrad"); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); - opBuilder.addInput(outputDim0.asOutput()); + opBuilder.addInput(denseOutputDim0.asOutput()); return new SparseSegmentSumGrad<>(opBuilder.build()); } @@ -86,8 +99,64 @@ public Output output() { return output; } - @Override - public Output asOutput() { - return output; + /** + * Gets sortedUniqueIndices. + * + * @return sortedUniqueIndices. + */ + public Output sortedUniqueIndices() { + return sortedUniqueIndices; + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSumGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * gradient propagated to the SparseSegmentSum op. + */ + public final Operand grad; + + /** + * indices passed to the corresponding SparseSegmentSum op. + */ + public final Operand indices; + + /** + * segment_ids passed to the corresponding SparseSegmentSum op. + */ + public final Operand segmentIds; + + /** + * dimension 0 of "data" passed to SparseSegmentSum op. + */ + public final Operand denseOutputDim0; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSumGrad<>(op), op, Arrays.asList("T", "Tidx", "Tsegmentids")); + int inputIndex = 0; + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + denseOutputDim0 = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java index d67e08a73e5..88b577afec1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; /** @@ -53,9 +59,11 @@ * # [-1 -2 -3 -4] * # [ 0 0 0 0]] * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSegmentSumWithNumSegments.OP_NAME, + inputsClass = SparseSegmentSumWithNumSegments.Inputs.class +) @Operator( group = "sparse" ) @@ -67,8 +75,8 @@ public final class SparseSegmentSumWithNumSegments extends Ra private Output output; - private SparseSegmentSumWithNumSegments(Operation operation) { - super(operation); + public SparseSegmentSumWithNumSegments(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -77,10 +85,11 @@ private SparseSegmentSumWithNumSegments(Operation operation) { * Factory method to create a class wrapping a new SparseSegmentSumWithNumSegments operation. * * @param scope current scope - * @param data the data value + * @param data The data value * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param options carries optional attribute values * @param data type for {@code SparseSegmentSumWithNumSegments} output and operands * @return a new instance of SparseSegmentSumWithNumSegments */ @@ -89,15 +98,32 @@ private SparseSegmentSumWithNumSegments(Operation operation) { ) public static SparseSegmentSumWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, - Operand numSegments) { + Operand numSegments, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SparseSegmentSumWithNumSegments"); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.sparseGradient != null) { + opBuilder.setAttr("sparse_gradient", opts.sparseGradient); + } + } + } return new SparseSegmentSumWithNumSegments<>(opBuilder.build()); } + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public static Options sparseGradient(Boolean sparseGradient) { + return new Options().sparseGradient(sparseGradient); + } + /** * Gets output. * Has same shape as data, except for dimension 0 which @@ -112,4 +138,89 @@ public Output output() { public Output asOutput() { return output; } + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseSegmentSumWithNumSegments} + */ + public static class Options { + private Boolean sparseGradient; + + private Options() { + } + + /** + * Sets the sparseGradient option. + * + * @param sparseGradient the sparseGradient option + * @return this Options instance. + */ + public Options sparseGradient(Boolean sparseGradient) { + this.sparseGradient = sparseGradient; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SparseSegmentSumWithNumSegments.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The data input + */ + public final Operand data; + + /** + * A 1-D tensor. Has same rank as {@code segment_ids}. + */ + public final Operand indices; + + /** + * A 1-D tensor. Values should be sorted and can be repeated. + */ + public final Operand segmentIds; + + /** + * Should equal the number of distinct segment IDs. + */ + public final Operand numSegments; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tidx attribute + */ + public final DataType Tidx; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + /** + * The Tsegmentids attribute + */ + public final DataType Tsegmentids; + + /** + * The sparseGradient attribute + */ + public final boolean sparseGradient; + + public Inputs(GraphOperation op) { + super(new SparseSegmentSumWithNumSegments<>(op), op, Arrays.asList("T", "Tidx", "Tnumsegments", "Tsegmentids", "sparse_gradient")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tidx = op.attributes().getAttrType("Tidx"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + Tsegmentids = op.attributes().getAttrType("Tsegmentids"); + sparseGradient = op.attributes().getAttrBool("sparse_gradient"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java index 3afe4ce5fa7..a3718f1a7e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -46,9 +52,11 @@ * [ d e ] * [ ] * - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseSlice.OP_NAME, + inputsClass = SparseSlice.Inputs.class +) @Operator( group = "sparse" ) @@ -64,8 +72,8 @@ public final class SparseSlice extends RawOp { private Output outputShape; - private SparseSlice(Operation operation) { - super(operation); + public SparseSlice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -128,4 +136,52 @@ public Output outputValues() { public Output outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseSlice.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D tensor represents the indices of the sparse tensor. + */ + public final Operand indices; + + /** + * 1-D tensor represents the values of the sparse tensor. + */ + public final Operand values; + + /** + * 1-D. tensor represents the shape of the sparse tensor. + */ + public final Operand shape; + + /** + * 1-D. tensor represents the start of the slice. + */ + public final Operand start; + + /** + * 1-D. tensor represents the size of the slice. + * output indices: A list of 1-D tensors represents the indices of the output + * sparse tensors. + */ + public final Operand sizeOutput; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSlice<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + start = (Operand) op.input(inputIndex++); + sizeOutput = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java index 3e1fc4a3eae..969ef935dc7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * This op takes in the upstream gradient w.r.t. non-empty values of * the sliced {@code SparseTensor}, and outputs the gradients w.r.t. * the non-empty values of input {@code SparseTensor}. - * - * @param data type for {@code val_grad} output */ +@OpMetadata( + opType = SparseSliceGrad.OP_NAME, + inputsClass = SparseSliceGrad.Inputs.class +) @Operator( group = "sparse" ) @@ -47,8 +55,8 @@ public final class SparseSliceGrad extends RawOp implements Ope private Output valGrad; - private SparseSliceGrad(Operation operation) { - super(operation); + public SparseSliceGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; valGrad = operation.output(outputIdx++); } @@ -91,4 +99,45 @@ public Output valGrad() { public Output asOutput() { return valGrad; } + + @OpInputsMetadata( + outputsClass = SparseSliceGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D. The gradient with respect to + * the non-empty values of the sliced {@code SparseTensor}. + */ + public final Operand backpropValGrad; + + /** + * 2-D. The {@code indices} of the input {@code SparseTensor}. + */ + public final Operand inputIndices; + + /** + * 1-D. tensor represents the start of the slice. + */ + public final Operand inputStart; + + /** + * 2-D. The {@code indices} of the sliced {@code SparseTensor}. + */ + public final Operand outputIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSliceGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + backpropValGrad = (Operand) op.input(inputIndex++); + inputIndices = (Operand) op.input(inputIndex++); + inputStart = (Operand) op.input(inputIndex++); + outputIndices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java index 5259cdc9127..43cd85b5a9f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; @@ -42,9 +48,11 @@ * (3) Renormalizes the remaining elements. *

      Hence, the {@code SparseTensor} result has exactly the same non-zero indices and * shape. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseSoftmax.OP_NAME, + inputsClass = SparseSoftmax.Inputs.class +) @Operator( group = "sparse" ) @@ -56,8 +64,8 @@ public final class SparseSoftmax extends RawOp implements Ope private Output output; - private SparseSoftmax(Operation operation) { - super(operation); + public SparseSoftmax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -98,4 +106,39 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseSoftmax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code NNZ x R} matrix with the indices of non-empty values in a + * SparseTensor, in canonical ordering. + */ + public final Operand spIndices; + + /** + * 1-D. {@code NNZ} non-empty values corresponding to {@code sp_indices}. + */ + public final Operand spValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand spShape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSoftmax<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + spIndices = (Operand) op.input(inputIndex++); + spValues = (Operand) op.input(inputIndex++); + spShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java index 166ae8dc7f2..80b44623ca8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Returns the element-wise max of two SparseTensors. * Assumes the two SparseTensors have the same shape, i.e., no broadcasting. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseSparseMaximum.OP_NAME, + inputsClass = SparseSparseMaximum.Inputs.class +) @Operator( group = "sparse" ) @@ -47,8 +55,8 @@ public final class SparseSparseMaximum extends RawOp { private Output outputValues; - private SparseSparseMaximum(Operation operation) { - super(operation); + public SparseSparseMaximum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -101,4 +109,57 @@ public Output outputIndices() { public Output outputValues() { return outputValues; } + + @OpInputsMetadata( + outputsClass = SparseSparseMaximum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, in the canonical lexicographic ordering. + */ + public final Operand aIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code a_indices}. + */ + public final Operand aValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand aShape; + + /** + * counterpart to {@code a_indices} for the other operand. + */ + public final Operand bIndices; + + /** + * counterpart to {@code a_values} for the other operand; must be of the same dtype. + */ + public final Operand bValues; + + /** + * counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + */ + public final Operand bShape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSparseMaximum<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + aIndices = (Operand) op.input(inputIndex++); + aValues = (Operand) op.input(inputIndex++); + aShape = (Operand) op.input(inputIndex++); + bIndices = (Operand) op.input(inputIndex++); + bValues = (Operand) op.input(inputIndex++); + bShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java index 01a9ceb7431..ecbc022d09d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Returns the element-wise min of two SparseTensors. * Assumes the two SparseTensors have the same shape, i.e., no broadcasting. - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseSparseMinimum.OP_NAME, + inputsClass = SparseSparseMinimum.Inputs.class +) @Operator( group = "sparse" ) @@ -47,8 +55,8 @@ public final class SparseSparseMinimum extends RawOp { private Output outputValues; - private SparseSparseMinimum(Operation operation) { - super(operation); + public SparseSparseMinimum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outputIndices = operation.output(outputIdx++); outputValues = operation.output(outputIdx++); @@ -101,4 +109,57 @@ public Output outputIndices() { public Output outputValues() { return outputValues; } + + @OpInputsMetadata( + outputsClass = SparseSparseMinimum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. {@code N x R} matrix with the indices of non-empty values in a + * SparseTensor, in the canonical lexicographic ordering. + */ + public final Operand aIndices; + + /** + * 1-D. {@code N} non-empty values corresponding to {@code a_indices}. + */ + public final Operand aValues; + + /** + * 1-D. Shape of the input SparseTensor. + */ + public final Operand aShape; + + /** + * counterpart to {@code a_indices} for the other operand. + */ + public final Operand bIndices; + + /** + * counterpart to {@code a_values} for the other operand; must be of the same dtype. + */ + public final Operand bValues; + + /** + * counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + */ + public final Operand bShape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSparseMinimum<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + aIndices = (Operand) op.input(inputIndex++); + aValues = (Operand) op.input(inputIndex++); + aShape = (Operand) op.input(inputIndex++); + bIndices = (Operand) op.input(inputIndex++); + bValues = (Operand) op.input(inputIndex++); + bShape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java index 9154c405640..da66d34d134 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -50,9 +55,11 @@ * [ d e ] * [ ] * - * - * @param data type for {@code output_values} output */ +@OpMetadata( + opType = SparseSplit.OP_NAME, + inputsClass = SparseSplit.Inputs.class +) @Operator( group = "sparse" ) @@ -69,8 +76,8 @@ public final class SparseSplit extends RawOp { private List> outputShape; @SuppressWarnings("unchecked") - private SparseSplit(Operation operation) { - super(operation); + public SparseSplit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputIndicesLength = operation.outputListLength("output_indices"); outputIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, outputIndicesLength)); @@ -140,4 +147,47 @@ public List> outputValues() { public List> outputShape() { return outputShape; } + + @OpInputsMetadata( + outputsClass = SparseSplit.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D. The dimension along which to split. Must be in the range + * {@code [0, rank(shape))}. + */ + public final Operand splitDim; + + /** + * 2-D tensor represents the indices of the sparse tensor. + */ + public final Operand indices; + + /** + * 1-D tensor represents the values of the sparse tensor. + */ + public final Operand values; + + /** + * 1-D. tensor represents the shape of the sparse tensor. + * output indices: A list of 1-D tensors represents the indices of the output + * sparse tensors. + */ + public final Operand shape; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseSplit<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + splitDim = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + shape = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java index d181580983d..7f73769030b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Adds up a {@code SparseTensor} and a dense {@code Tensor}, producing a dense {@code Tensor}. * This Op does not require {@code a_indices} be sorted in standard lexicographic order. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = SparseTensorDenseAdd.OP_NAME, + inputsClass = SparseTensorDenseAdd.Inputs.class +) @Operator( group = "sparse" ) @@ -45,8 +53,8 @@ public final class SparseTensorDenseAdd extends RawOp implement private Output output; - private SparseTensorDenseAdd(Operation operation) { - super(operation); + public SparseTensorDenseAdd(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -89,4 +97,50 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SparseTensorDenseAdd.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. The {@code indices} of the {@code SparseTensor}, with shape {@code [nnz, ndims]}. + */ + public final Operand aIndices; + + /** + * 1-D. The {@code values} of the {@code SparseTensor}, with shape {@code [nnz]}. + */ + public final Operand aValues; + + /** + * 1-D. The {@code shape} of the {@code SparseTensor}, with shape {@code [ndims]}. + */ + public final Operand aShape; + + /** + * {@code ndims}-D Tensor. With shape {@code a_shape}. + */ + public final Operand b; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new SparseTensorDenseAdd<>(op), op, Arrays.asList("T", "Tindices")); + int inputIndex = 0; + aIndices = (Operand) op.input(inputIndex++); + aValues = (Operand) op.input(inputIndex++); + aShape = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java index 346b2917327..0425354268c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -39,9 +45,11 @@ * if adjoint_a == true: * A should be sorted in order of increasing dimension 1 (i.e., "column major" * order instead of "row major" order). - * - * @param data type for {@code product} output */ +@OpMetadata( + opType = SparseTensorDenseMatMul.OP_NAME, + inputsClass = SparseTensorDenseMatMul.Inputs.class +) @Operator( group = "sparse" ) @@ -53,8 +61,8 @@ public final class SparseTensorDenseMatMul extends RawOp implem private Output product; - private SparseTensorDenseMatMul(Operation operation) { - super(operation); + public SparseTensorDenseMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; product = operation.output(outputIdx++); } @@ -166,4 +174,64 @@ public Options adjointB(Boolean adjointB) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseTensorDenseMatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D. The {@code indices} of the {@code SparseTensor}, size {@code [nnz, 2]} Matrix. + */ + public final Operand aIndices; + + /** + * 1-D. The {@code values} of the {@code SparseTensor}, size {@code [nnz]} Vector. + */ + public final Operand aValues; + + /** + * 1-D. The {@code shape} of the {@code SparseTensor}, size {@code [2]} Vector. + */ + public final Operand aShape; + + /** + * 2-D. A dense Matrix. + */ + public final Operand b; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * Use the adjoint of A in the matrix multiply. If A is complex, this + * is transpose(conj(A)). Otherwise it's transpose(A). + */ + public final boolean adjointA; + + /** + * Use the adjoint of B in the matrix multiply. If B is complex, this + * is transpose(conj(B)). Otherwise it's transpose(B). + */ + public final boolean adjointB; + + public Inputs(GraphOperation op) { + super(new SparseTensorDenseMatMul<>(op), op, Arrays.asList("T", "Tindices", "adjoint_a", "adjoint_b")); + int inputIndex = 0; + aIndices = (Operand) op.input(inputIndex++); + aValues = (Operand) op.input(inputIndex++); + aShape = (Operand) op.input(inputIndex++); + b = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + adjointA = op.attributes().getAttrBool("adjoint_a"); + adjointB = op.attributes().getAttrBool("adjoint_b"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java index 63fed696d31..448a7c4ec83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -46,9 +52,11 @@ *

      Indices should be sorted in lexicographic order, and indices must not * contain any repeats. If {@code validate_indices} is true, these properties * are checked during execution. - * - * @param data type for {@code dense} output */ +@OpMetadata( + opType = SparseToDense.OP_NAME, + inputsClass = SparseToDense.Inputs.class +) @Operator( group = "sparse" ) @@ -60,8 +68,8 @@ public final class SparseToDense extends RawOp implements Opera private Output dense; - private SparseToDense(Operation operation) { - super(operation); + public SparseToDense(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; dense = operation.output(outputIdx++); } @@ -149,4 +157,60 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseToDense.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 0-D, 1-D, or 2-D. {@code sparse_indices[i]} contains the complete + * index where {@code sparse_values[i]} will be placed. + */ + public final Operand sparseIndices; + + /** + * 1-D. Shape of the dense output tensor. + */ + public final Operand outputShape; + + /** + * 1-D. Values corresponding to each row of {@code sparse_indices}, + * or a scalar value to be used for all sparse indices. + */ + public final Operand sparseValues; + + /** + * Scalar value to set for indices not specified in + * {@code sparse_indices}. + */ + public final Operand defaultValue; + + /** + * If true, indices are checked to make sure they are sorted in + * lexicographic order and that there are no repeats. + */ + public final boolean validateIndices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + public Inputs(GraphOperation op) { + super(new SparseToDense<>(op), op, Arrays.asList("validate_indices", "T", "Tindices")); + int inputIndex = 0; + sparseIndices = (Operand) op.input(inputIndex++); + outputShape = (Operand) op.input(inputIndex++); + sparseValues = (Operand) op.input(inputIndex++); + defaultValue = (Operand) op.input(inputIndex++); + validateIndices = op.attributes().getAttrBool("validate_indices"); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java index 1877c8cbed5..e658f88abb7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -48,9 +54,11 @@ * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} * dimension contains the result of {@code set_operation} applied to the corresponding * {@code [0...n-1]} dimension of {@code set}. - * - * @param data type for {@code result_values} output */ +@OpMetadata( + opType = SparseToSparseSetOperation.OP_NAME, + inputsClass = SparseToSparseSetOperation.Inputs.class +) @Operator( group = "sparse" ) @@ -66,8 +74,8 @@ public final class SparseToSparseSetOperation extends RawOp { private Output resultShape; - private SparseToSparseSetOperation(Operation operation) { - super(operation); + public SparseToSparseSetOperation(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; resultIndices = operation.output(outputIdx++); resultValues = operation.output(outputIdx++); @@ -92,7 +100,7 @@ private SparseToSparseSetOperation(Operation operation) { * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must * be the same as {@code set1_shape[0...n-1]}, {@code set2_shape[n]} is the * max set size across {@code 0...n-1} dimensions. - * @param setOperation the value of the setOperation property + * @param setOperation The value of the setOperation attribute * @param options carries optional attribute values * @param data type for {@code SparseToSparseSetOperation} output and operands * @return a new instance of SparseToSparseSetOperation @@ -181,4 +189,76 @@ public Options validateIndices(Boolean validateIndices) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseToSparseSetOperation.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set1Indices; + + /** + * 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set1Values; + + /** + * 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set1_shape[0...n-1]} must + * be the same as {@code set2_shape[0...n-1]}, {@code set1_shape[n]} is the + * max set size across {@code 0...n-1} dimensions. + */ + public final Operand set1Shape; + + /** + * 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set2Indices; + + /** + * 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major + * order. + */ + public final Operand set2Values; + + /** + * 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must + * be the same as {@code set1_shape[0...n-1]}, {@code set2_shape[n]} is the + * max set size across {@code 0...n-1} dimensions. + */ + public final Operand set2Shape; + + /** + * The setOperation attribute + */ + public final String setOperation; + + /** + * The validateIndices attribute + */ + public final boolean validateIndices; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new SparseToSparseSetOperation<>(op), op, Arrays.asList("set_operation", "validate_indices", "T")); + int inputIndex = 0; + set1Indices = (Operand) op.input(inputIndex++); + set1Values = (Operand) op.input(inputIndex++); + set1Shape = (Operand) op.input(inputIndex++); + set2Indices = (Operand) op.input(inputIndex++); + set2Values = (Operand) op.input(inputIndex++); + set2Shape = (Operand) op.input(inputIndex++); + setOperation = op.attributes().getAttrString("set_operation"); + validateIndices = op.attributes().getAttrBool("validate_indices"); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java index 0f0e504a484..2c6293f402d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.sparse; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -71,9 +77,11 @@ * values = [1, 2, 3, 4, 5] * shape = [2 50] * - * - * @param data type for {@code sparse_values} output */ +@OpMetadata( + opType = TakeManySparseFromTensorsMap.OP_NAME, + inputsClass = TakeManySparseFromTensorsMap.Inputs.class +) @Operator( group = "sparse" ) @@ -89,8 +97,8 @@ public final class TakeManySparseFromTensorsMap extends RawOp { private Output sparseShape; - private TakeManySparseFromTensorsMap(Operation operation) { - super(operation); + public TakeManySparseFromTensorsMap(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; sparseIndices = operation.output(outputIdx++); sparseValues = operation.output(outputIdx++); @@ -214,4 +222,42 @@ public Options sharedName(String sharedName) { return this; } } + + @OpInputsMetadata( + outputsClass = TakeManySparseFromTensorsMap.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 1-D, The {@code N} serialized {@code SparseTensor} objects. + * Shape: {@code [N]}. + */ + public final Operand sparseHandles; + + /** + * The {@code dtype} of the {@code SparseTensor} objects stored in the + * {@code SparseTensorsMap}. + */ + public final DataType dtype; + + /** + * The container name for the {@code SparseTensorsMap} read by this op. + */ + public final String container; + + /** + * The shared name for the {@code SparseTensorsMap} read by this op. + * It should not be blank; rather the {@code shared_name} or unique Operation name + * of the Op that created the original {@code SparseTensorsMap} should be used. + */ + public final String sharedName; + + public Inputs(GraphOperation op) { + super(new TakeManySparseFromTensorsMap<>(op), op, Arrays.asList("dtype", "container", "shared_name")); + int inputIndex = 0; + sparseHandles = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java index 0edb7c882ce..976fdf880df 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,19 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -42,6 +47,10 @@ * * */ +@OpMetadata( + opType = Join.OP_NAME, + inputsClass = Join.Inputs.class +) @Operator( group = "strings" ) @@ -53,8 +62,8 @@ public final class Join extends RawOp implements Operand { private Output output; - private Join(Operation operation) { - super(operation); + public Join(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -129,4 +138,30 @@ public Options separator(String separator) { return this; } } + + @OpInputsMetadata( + outputsClass = Join.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of string tensors. The tensors must all have the same shape, + * or be scalars. Scalars may be mixed in; these will be broadcast to the shape + * of non-scalar inputs. + */ + public final Iterable> inputs; + + /** + * string, an optional join separator. + */ + public final String separator; + + public Inputs(GraphOperation op) { + super(new Join(op), op, Arrays.asList("separator")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + separator = op.attributes().getAttrString("separator"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java index 61b4a5664e6..62c18ce5098 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -39,6 +44,10 @@ * * */ +@OpMetadata( + opType = Lower.OP_NAME, + inputsClass = Lower.Inputs.class +) @Operator( group = "strings" ) @@ -50,8 +59,8 @@ public final class Lower extends RawOp implements Operand { private Output output; - private Lower(Operation operation) { - super(operation); + public Lower(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -126,4 +135,27 @@ public Options encoding(String encoding) { return this; } } + + @OpInputsMetadata( + outputsClass = Lower.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input to be lower-cased. + */ + public final Operand input; + + /** + * Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + */ + public final String encoding; + + public Inputs(GraphOperation op) { + super(new Lower(op), op, Arrays.asList("encoding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + encoding = op.attributes().getAttrString("encoding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java index 4e914486e2a..5bbc3e772ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -52,6 +57,10 @@ * tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd" * */ +@OpMetadata( + opType = ReduceJoin.OP_NAME, + inputsClass = ReduceJoin.Inputs.class +) @Operator( group = "strings" ) @@ -63,8 +72,8 @@ public final class ReduceJoin extends RawOp implements Operand { private Output output; - private ReduceJoin(Operation operation) { - super(operation); + public ReduceJoin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -169,4 +178,40 @@ public Options separator(String separator) { return this; } } + + @OpInputsMetadata( + outputsClass = ReduceJoin.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input to be joined. All reduced indices must have non-zero size. + */ + public final Operand inputs; + + /** + * The dimensions to reduce over. Dimensions are reduced in the + * order specified. Omitting {@code reduction_indices} is equivalent to passing + * {@code [n-1, n-2, ..., 0]}. Negative indices from {@code -n} to {@code -1} are supported. + */ + public final Operand reductionIndices; + + /** + * If {@code True}, retain reduced dimensions with length {@code 1}. + */ + public final boolean keepDims; + + /** + * The separator to use when joining. + */ + public final String separator; + + public Inputs(GraphOperation op) { + super(new ReduceJoin(op), op, Arrays.asList("keep_dims", "separator")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + reductionIndices = (Operand) op.input(inputIndex++); + keepDims = op.attributes().getAttrBool("keep_dims"); + separator = op.attributes().getAttrString("separator"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java index 17fd9dddcc7..357ca785164 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TString; @@ -47,6 +52,10 @@ * * */ +@OpMetadata( + opType = RegexFullMatch.OP_NAME, + inputsClass = RegexFullMatch.Inputs.class +) @Operator( group = "strings" ) @@ -58,8 +67,8 @@ public final class RegexFullMatch extends RawOp implements Operand { private Output output; - private RegexFullMatch(Operation operation) { - super(operation); + public RegexFullMatch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -96,4 +105,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = RegexFullMatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string tensor of the text to be processed. + */ + public final Operand input; + + /** + * A scalar string tensor containing the regular expression to match the input. + */ + public final Operand pattern; + + public Inputs(GraphOperation op) { + super(new RegexFullMatch(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pattern = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java index 535d46e9897..bec4a4a7219 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ * replacement string provided in {@code rewrite}. * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ +@OpMetadata( + opType = RegexReplace.OP_NAME, + inputsClass = RegexReplace.Inputs.class +) @Operator( group = "strings" ) @@ -43,8 +52,8 @@ public final class RegexReplace extends RawOp implements Operand { private Output output; - private RegexReplace(Operation operation) { - super(operation); + public RegexReplace(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,4 +136,41 @@ public Options replaceGlobal(Boolean replaceGlobal) { return this; } } + + @OpInputsMetadata( + outputsClass = RegexReplace.class + ) + public static class Inputs extends RawOpInputs { + /** + * The text to be processed. + */ + public final Operand input; + + /** + * The regular expression to be matched in the {@code input} strings. + */ + public final Operand pattern; + + /** + * The rewrite string to be substituted for the {@code pattern} expression where it is + * matched in the {@code input} strings. + */ + public final Operand rewrite; + + /** + * If True, the replacement is global (that is, all matches of the {@code pattern} regular + * expression in each input string are rewritten), otherwise the {@code rewrite} + * substitution is only made for the first {@code pattern} match. + */ + public final boolean replaceGlobal; + + public Inputs(GraphOperation op) { + super(new RegexReplace(op), op, Arrays.asList("replace_global")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pattern = (Operand) op.input(inputIndex++); + rewrite = (Operand) op.input(inputIndex++); + replaceGlobal = op.attributes().getAttrBool("replace_global"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java index 1eba6e9c223..8ba7591ee79 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TString; @@ -35,6 +41,13 @@ * if the input matches the regex pattern provided. *

      The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ +@OpMetadata( + opType = StaticRegexFullMatch.OP_NAME, + inputsClass = StaticRegexFullMatch.Inputs.class +) +@Operator( + group = "strings" +) public final class StaticRegexFullMatch extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class StaticRegexFullMatch extends RawOp implements Operand private Output output; - private StaticRegexFullMatch(Operation operation) { - super(operation); + public StaticRegexFullMatch(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -80,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = StaticRegexFullMatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string tensor of the text to be processed. + */ + public final Operand input; + + /** + * The regular expression to match the input. + */ + public final String pattern; + + public Inputs(GraphOperation op) { + super(new StaticRegexFullMatch(op), op, Arrays.asList("pattern")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pattern = op.attributes().getAttrString("pattern"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java index 565437356c0..a7a156a731f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Replaces the match of pattern in input with rewrite. * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ +@OpMetadata( + opType = StaticRegexReplace.OP_NAME, + inputsClass = StaticRegexReplace.Inputs.class +) +@Operator( + group = "strings" +) public final class StaticRegexReplace extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class StaticRegexReplace extends RawOp implements Operand private Output output; - private StaticRegexReplace(Operation operation) { - super(operation); + public StaticRegexReplace(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -119,4 +132,39 @@ public Options replaceGlobal(Boolean replaceGlobal) { return this; } } + + @OpInputsMetadata( + outputsClass = StaticRegexReplace.class + ) + public static class Inputs extends RawOpInputs { + /** + * The text to be processed. + */ + public final Operand input; + + /** + * The regular expression to match the input. + */ + public final String pattern; + + /** + * The rewrite to be applied to the matched expression. + */ + public final String rewrite; + + /** + * If True, the replacement is global, otherwise the replacement + * is done only on the first match. + */ + public final boolean replaceGlobal; + + public Inputs(GraphOperation op) { + super(new StaticRegexReplace(op), op, Arrays.asList("pattern", "rewrite", "replace_global")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pattern = op.attributes().getAttrString("pattern"); + rewrite = op.attributes().getAttrString("rewrite"); + replaceGlobal = op.attributes().getAttrBool("replace_global"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java index 73e13bc795a..aa53f8013e9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,31 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; /** * Formats a string template using a list of tensors. * Formats a string template using a list of tensors, pretty-printing tensor summaries. */ +@OpMetadata( + opType = StringFormat.OP_NAME, + inputsClass = StringFormat.Inputs.class +) @Operator( group = "strings" ) @@ -43,8 +53,8 @@ public final class StringFormat extends RawOp implements Operand { private Output output; - private StringFormat(Operation operation) { - super(operation); + public StringFormat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -169,4 +179,46 @@ public Options summarize(Long summarize) { return this; } } + + @OpInputsMetadata( + outputsClass = StringFormat.class + ) + public static class Inputs extends RawOpInputs { + /** + * The list of tensors to format into the placeholder string. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType[] T; + + /** + * A string, the template to format tensor summaries into. + */ + public final String template; + + /** + * A string, at each placeholder in the template a subsequent tensor summary will be inserted. + */ + public final String placeholder; + + /** + * When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. + */ + public final long summarize; + + public Inputs(GraphOperation op) { + super(new StringFormat(op), op, Arrays.asList("T", "template", "placeholder", "summarize")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrTypeList("T"); + template = op.attributes().getAttrString("template"); + placeholder = op.attributes().getAttrString("placeholder"); + summarize = op.attributes().getAttrInt("summarize"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java index cab105ec8ee..0a1ee1dff0d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -43,6 +48,10 @@ * * */ +@OpMetadata( + opType = StringLength.OP_NAME, + inputsClass = StringLength.Inputs.class +) @Operator( group = "strings" ) @@ -54,8 +63,8 @@ public final class StringLength extends RawOp implements Operand { private Output output; - private StringLength(Operation operation) { - super(operation); + public StringLength(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -137,4 +146,30 @@ public Options unit(String unit) { return this; } } + + @OpInputsMetadata( + outputsClass = StringLength.class + ) + public static class Inputs extends RawOpInputs { + /** + * The strings for which to compute the length for each element. + */ + public final Operand input; + + /** + * The unit that is counted to compute string length. One of: {@code "BYTE"} (for + * the number of bytes in each string) or {@code "UTF8_CHAR"} (for the number of UTF-8 + * encoded Unicode code points in each string). Results are undefined + * if {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally + * valid UTF-8. + */ + public final String unit; + + public Inputs(GraphOperation op) { + super(new StringLength(op), op, Arrays.asList("unit")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + unit = op.attributes().getAttrString("unit"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java index c768a8cd421..c04fa6cd987 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.strings; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -34,9 +40,11 @@ * This op accepts a ragged tensor with 1 ragged dimension containing only * strings and outputs a ragged tensor with 1 ragged dimension containing ngrams * of that string, joined along the innermost axis. - * - * @param data type for {@code ngrams_splits} output */ +@OpMetadata( + opType = StringNGrams.OP_NAME, + inputsClass = StringNGrams.Inputs.class +) @Operator( group = "strings" ) @@ -50,8 +58,8 @@ public final class StringNGrams extends RawOp { private Output ngramsSplits; - private StringNGrams(Operation operation) { - super(operation); + public StringNGrams(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; ngrams = operation.output(outputIdx++); ngramsSplits = operation.output(outputIdx++); @@ -74,7 +82,7 @@ private StringNGrams(Operation operation) { * sequence. Note that padding will never be greater than 'ngram_widths'-1 * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} * elements. - * @param preserveShortSequences the value of the preserveShortSequences property + * @param preserveShortSequences The value of the preserveShortSequences attribute * @param data type for {@code StringNGrams} output and operands * @return a new instance of StringNGrams */ @@ -117,4 +125,74 @@ public Output ngrams() { public Output ngramsSplits() { return ngramsSplits; } + + @OpInputsMetadata( + outputsClass = StringNGrams.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The values tensor of the ragged string tensor to make ngrams out of. Must be a + * 1D string tensor. + */ + public final Operand data; + + /** + * The splits tensor of the ragged string tensor to make ngrams out of. + */ + public final Operand dataSplits; + + /** + * The string to append between elements of the token. Use "" for no separator. + */ + public final String separator; + + /** + * The sizes of the ngrams to create. + */ + public final long[] ngramWidths; + + /** + * The string to use to pad the left side of the ngram sequence. Only used if + * pad_width != 0. + */ + public final String leftPad; + + /** + * The string to use to pad the right side of the ngram sequence. Only used if + * pad_width != 0. + */ + public final String rightPad; + + /** + * The number of padding elements to add to each side of each + * sequence. Note that padding will never be greater than 'ngram_widths'-1 + * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} + * elements. + */ + public final long padWidth; + + /** + * The preserveShortSequences attribute + */ + public final boolean preserveShortSequences; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new StringNGrams<>(op), op, Arrays.asList("separator", "ngram_widths", "left_pad", "right_pad", "pad_width", "preserve_short_sequences", "Tsplits")); + int inputIndex = 0; + data = (Operand) op.input(inputIndex++); + dataSplits = (Operand) op.input(inputIndex++); + separator = op.attributes().getAttrString("separator"); + ngramWidths = op.attributes().getAttrIntList("ngram_widths"); + leftPad = op.attributes().getAttrString("left_pad"); + rightPad = op.attributes().getAttrString("right_pad"); + padWidth = op.attributes().getAttrInt("pad_width"); + preserveShortSequences = op.attributes().getAttrBool("preserve_short_sequences"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java index 51a137ca33b..7de080ecd16 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -52,6 +57,10 @@ * leading or trailing whitespace. *

      Note that the above mentioned behavior matches python's str.split. */ +@OpMetadata( + opType = StringSplit.OP_NAME, + inputsClass = StringSplit.Inputs.class +) @Operator( group = "strings" ) @@ -67,8 +76,8 @@ public final class StringSplit extends RawOp { private Output shape; - private StringSplit(Operation operation) { - super(operation); + public StringSplit(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; indices = operation.output(outputIdx++); values = operation.output(outputIdx++); @@ -159,4 +168,32 @@ public Options maxsplit(Long maxsplit) { return this; } } + + @OpInputsMetadata( + outputsClass = StringSplit.class + ) + public static class Inputs extends RawOpInputs { + /** + * {@code 1-D} string {@code Tensor}, the strings to split. + */ + public final Operand input; + + /** + * {@code 0-D} string {@code Tensor}, the delimiter character. + */ + public final Operand sep; + + /** + * An {@code int}. If {@code maxsplit > 0}, limit of the split of the result. + */ + public final long maxsplit; + + public Inputs(GraphOperation op) { + super(new StringSplit(op), op, Arrays.asList("maxsplit")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + sep = (Operand) op.input(inputIndex++); + maxsplit = op.attributes().getAttrInt("maxsplit"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java index afd03047152..1d29e8f2c33 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -39,6 +44,10 @@ * * */ +@OpMetadata( + opType = Strip.OP_NAME, + inputsClass = Strip.Inputs.class +) @Operator( group = "strings" ) @@ -50,8 +59,8 @@ public final class Strip extends RawOp implements Operand { private Output output; - private Strip(Operation operation) { - super(operation); + public Strip(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -85,4 +94,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = Strip.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string {@code Tensor} of any shape. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new Strip(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java index fae4b2a26ec..868f2bc239b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -98,6 +104,10 @@ *

    • {@code ValueError}: If {@code pos} and {@code len} are not the same shape.
    • *
    */ +@OpMetadata( + opType = Substr.OP_NAME, + inputsClass = Substr.Inputs.class +) @Operator( group = "strings" ) @@ -109,8 +119,8 @@ public final class Substr extends RawOp implements Operand { private Output output; - private Substr(Operation operation) { - super(operation); + public Substr(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -197,4 +207,48 @@ public Options unit(String unit) { return this; } } + + @OpInputsMetadata( + outputsClass = Substr.class + ) + public static class Inputs extends RawOpInputs { + /** + * Tensor of strings + */ + public final Operand input; + + /** + * Scalar defining the position of first character in each substring + */ + public final Operand pos; + + /** + * Scalar defining the number of characters to include in each substring + */ + public final Operand len; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The unit that is used to create the substring. One of: {@code "BYTE"} (for + * defining position and length by bytes) or {@code "UTF8_CHAR"} (for the UTF-8 + * encoded Unicode code points). The default is {@code "BYTE"}. Results are undefined if + * {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally valid + * UTF-8. + */ + public final String unit; + + public Inputs(GraphOperation op) { + super(new Substr(op), op, Arrays.asList("T", "unit")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + pos = (Operand) op.input(inputIndex++); + len = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + unit = op.attributes().getAttrString("unit"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java index 17e4f6946d3..1aeeb33f906 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -36,6 +41,10 @@ * This functionality will be deprecated and it's recommended to use * {@code tf.string_to_hash_bucket_fast()} or {@code tf.string_to_hash_bucket_strong()}. */ +@OpMetadata( + opType = ToHashBucket.OP_NAME, + inputsClass = ToHashBucket.Inputs.class +) @Operator( group = "strings" ) @@ -47,8 +56,8 @@ public final class ToHashBucket extends RawOp implements Operand { private Output output; - private ToHashBucket(Operation operation) { - super(operation); + public ToHashBucket(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -57,7 +66,7 @@ private ToHashBucket(Operation operation) { * Factory method to create a class wrapping a new StringToHashBucket operation. * * @param scope current scope - * @param stringTensor the stringTensor value + * @param stringTensor The stringTensor value * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ @@ -84,4 +93,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ToHashBucket.class + ) + public static class Inputs extends RawOpInputs { + /** + * The stringTensor input + */ + public final Operand stringTensor; + + /** + * The number of buckets. + */ + public final long numBuckets; + + public Inputs(GraphOperation op) { + super(new ToHashBucket(op), op, Arrays.asList("num_buckets")); + int inputIndex = 0; + stringTensor = (Operand) op.input(inputIndex++); + numBuckets = op.attributes().getAttrInt("num_buckets"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java index 5e85fc085a7..e2d293d1715 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -46,6 +51,10 @@ * * */ +@OpMetadata( + opType = ToHashBucketFast.OP_NAME, + inputsClass = ToHashBucketFast.Inputs.class +) @Operator( group = "strings" ) @@ -57,8 +66,8 @@ public final class ToHashBucketFast extends RawOp implements Operand { private Output output; - private ToHashBucketFast(Operation operation) { - super(operation); + public ToHashBucketFast(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -94,4 +103,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ToHashBucketFast.class + ) + public static class Inputs extends RawOpInputs { + /** + * The strings to assign a hash bucket. + */ + public final Operand input; + + /** + * The number of buckets. + */ + public final long numBuckets; + + public Inputs(GraphOperation op) { + super(new ToHashBucketFast(op), op, Arrays.asList("num_buckets")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + numBuckets = op.attributes().getAttrInt("num_buckets"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java index 9cf389be380..d3a0f1bea99 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,19 @@ package org.tensorflow.op.strings; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -52,6 +57,10 @@ * * */ +@OpMetadata( + opType = ToHashBucketStrong.OP_NAME, + inputsClass = ToHashBucketStrong.Inputs.class +) @Operator( group = "strings" ) @@ -63,8 +72,8 @@ public final class ToHashBucketStrong extends RawOp implements Operand { private Output output; - private ToHashBucketStrong(Operation operation) { - super(operation); + public ToHashBucketStrong(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -108,4 +117,33 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ToHashBucketStrong.class + ) + public static class Inputs extends RawOpInputs { + /** + * The strings to assign a hash bucket. + */ + public final Operand input; + + /** + * The number of buckets. + */ + public final long numBuckets; + + /** + * The key used to seed the hash function, passed as a list of two uint64 + * elements. + */ + public final long[] key; + + public Inputs(GraphOperation op) { + super(new ToHashBucketStrong(op), op, Arrays.asList("num_buckets", "key")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + numBuckets = op.attributes().getAttrInt("num_buckets"); + key = op.attributes().getAttrIntList("key"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java index 733233bdba9..74e4816ed43 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -44,9 +50,11 @@ * * * - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ToNumber.OP_NAME, + inputsClass = ToNumber.Inputs.class +) @Operator( group = "strings" ) @@ -58,8 +66,8 @@ public final class ToNumber extends RawOp implements Operand< private Output output; - private ToNumber(Operation operation) { - super(operation); + public ToNumber(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -68,7 +76,7 @@ private ToNumber(Operation operation) { * Factory method to create a class wrapping a new StringToNumber operation. * * @param scope current scope - * @param stringTensor the stringTensor value + * @param stringTensor The stringTensor value * @param outType The numeric type to interpret each string in {@code string_tensor} as. * @param data type for {@code StringToNumber} output and operands * @return a new instance of ToNumber @@ -88,7 +96,7 @@ public static ToNumber create(Scope scope, Operand output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = ToNumber.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The stringTensor input + */ + public final Operand stringTensor; + + /** + * The numeric type to interpret each string in {@code string_tensor} as. + */ + public final DataType outType; + + public Inputs(GraphOperation op) { + super(new ToNumber<>(op), op, Arrays.asList("out_type")); + int inputIndex = 0; + stringTensor = (Operand) op.input(inputIndex++); + outType = op.attributes().getAttrType("out_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java index 9640d30b1c1..cc29b554bef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -45,9 +52,14 @@ *
  • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th * string (in row-major order).
  • * - * - * @param data type for {@code row_splits} output */ +@OpMetadata( + opType = UnicodeDecode.OP_NAME, + inputsClass = UnicodeDecode.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeDecode extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -58,8 +70,8 @@ public final class UnicodeDecode extends RawOp { private Output charValues; - private UnicodeDecode(Operation operation) { - super(operation); + public UnicodeDecode(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; rowSplits = operation.output(outputIdx++); charValues = operation.output(outputIdx++); @@ -73,7 +85,7 @@ private UnicodeDecode(Operation operation) { * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. - * @param Tsplits the value of the Tsplits property + * @param Tsplits The value of the Tsplits attribute * @param options carries optional attribute values * @param data type for {@code UnicodeDecode} output and operands * @return a new instance of UnicodeDecode @@ -118,7 +130,7 @@ public static UnicodeDecode create(Scope scope, Operand create(Scope scope, Operand input, - String inputEncoding, Options[] options) { + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } @@ -236,4 +248,62 @@ public Options replaceControlCharacters(Boolean replaceControlCharacters) { return this; } } + + @OpInputsMetadata( + outputsClass = UnicodeDecode.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + */ + public final Operand input; + + /** + * Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + */ + public final String inputEncoding; + + /** + * Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + */ + public final String errors; + + /** + * The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + */ + public final long replacementChar; + + /** + * Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + */ + public final boolean replaceControlCharacters; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new UnicodeDecode<>(op), op, Arrays.asList("input_encoding", "errors", "replacement_char", "replace_control_characters", "Tsplits")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputEncoding = op.attributes().getAttrString("input_encoding"); + errors = op.attributes().getAttrString("errors"); + replacementChar = op.attributes().getAttrInt("replacement_char"); + replaceControlCharacters = op.attributes().getAttrBool("replace_control_characters"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java index 0cb5419064a..fb8887c4594 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -49,9 +56,14 @@ *
  • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th * string (in row-major order).
  • * - * - * @param data type for {@code row_splits} output */ +@OpMetadata( + opType = UnicodeDecodeWithOffsets.OP_NAME, + inputsClass = UnicodeDecodeWithOffsets.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeDecodeWithOffsets extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -64,8 +76,8 @@ public final class UnicodeDecodeWithOffsets extends RawOp { private Output charToByteStarts; - private UnicodeDecodeWithOffsets(Operation operation) { - super(operation); + public UnicodeDecodeWithOffsets(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; rowSplits = operation.output(outputIdx++); charValues = operation.output(outputIdx++); @@ -80,7 +92,7 @@ private UnicodeDecodeWithOffsets(Operation operation) { * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. - * @param Tsplits the value of the Tsplits property + * @param Tsplits The value of the Tsplits attribute * @param options carries optional attribute values * @param data type for {@code UnicodeDecodeWithOffsets} output and operands * @return a new instance of UnicodeDecodeWithOffsets @@ -125,7 +137,7 @@ public static UnicodeDecodeWithOffsets create(Scope scope describeByClass = true ) public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, - String inputEncoding, Options[] options) { + String inputEncoding, Options... options) { return create(scope, input, inputEncoding, TInt64.class, options); } @@ -253,4 +265,62 @@ public Options replaceControlCharacters(Boolean replaceControlCharacters) { return this; } } + + @OpInputsMetadata( + outputsClass = UnicodeDecodeWithOffsets.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The text to be decoded. Can have any shape. Note that the output is flattened + * to a vector of char values. + */ + public final Operand input; + + /** + * Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + */ + public final String inputEncoding; + + /** + * Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + */ + public final String errors; + + /** + * The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + */ + public final long replacementChar; + + /** + * Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + */ + public final boolean replaceControlCharacters; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new UnicodeDecodeWithOffsets<>(op), op, Arrays.asList("input_encoding", "errors", "replacement_char", "replace_control_characters", "Tsplits")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputEncoding = op.attributes().getAttrString("input_encoding"); + errors = op.attributes().getAttrString("errors"); + replacementChar = op.attributes().getAttrInt("replacement_char"); + replaceControlCharacters = op.attributes().getAttrBool("replace_control_characters"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java index 31270365f6b..074ff7af61b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -43,6 +50,13 @@ * output = ['Hello', 'World'] * */ +@OpMetadata( + opType = UnicodeEncode.OP_NAME, + inputsClass = UnicodeEncode.Inputs.class +) +@Operator( + group = "strings" +) public final class UnicodeEncode extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -51,8 +65,8 @@ public final class UnicodeEncode extends RawOp implements Operand { private Output output; - private UnicodeEncode(Operation operation) { - super(operation); + public UnicodeEncode(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -176,4 +190,61 @@ public Options replacementChar(Long replacementChar) { return this; } } + + @OpInputsMetadata( + outputsClass = UnicodeEncode.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 1D tensor containing the unicode codepoints that should be encoded. + */ + public final Operand inputValues; + + /** + * A 1D tensor specifying how the unicode codepoints should be split into strings. + * In particular, {@code output[i]} is constructed by encoding the codepoints in the + * slice {@code input_values[input_splits[i]:input_splits[i+1]]}. + */ + public final Operand inputSplits; + + /** + * Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + */ + public final String errors; + + /** + * Unicode encoding of the output strings. Valid encodings are: {@code "UTF-8", "UTF-16-BE", and "UTF-32-BE"}. + */ + public final String outputEncoding; + + /** + * The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD (U+65533). + */ + public final long replacementChar; + + /** + * The Tsplits attribute + */ + public final DataType Tsplits; + + public Inputs(GraphOperation op) { + super(new UnicodeEncode(op), op, Arrays.asList("errors", "output_encoding", "replacement_char", "Tsplits")); + int inputIndex = 0; + inputValues = (Operand) op.input(inputIndex++); + inputSplits = (Operand) op.input(inputIndex++); + errors = op.attributes().getAttrString("errors"); + outputEncoding = op.attributes().getAttrString("output_encoding"); + replacementChar = op.attributes().getAttrInt("replacement_char"); + Tsplits = op.attributes().getAttrType("Tsplits"); + } + } } 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 ea638c3aad7..77807f29e8b 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; @@ -49,6 +54,10 @@ * * */ +@OpMetadata( + opType = UnicodeScript.OP_NAME, + inputsClass = UnicodeScript.Inputs.class +) @Operator( group = "strings" ) @@ -60,8 +69,8 @@ public final class UnicodeScript extends RawOp implements Operand { private Output output; - private UnicodeScript(Operation operation) { - super(operation); + public UnicodeScript(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -95,4 +104,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = UnicodeScript.class + ) + public static class Inputs extends RawOpInputs { + /** + * A Tensor of int32 Unicode code points. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new UnicodeScript(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java index b200bf64022..56bfc2e406e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -65,6 +70,10 @@ * * */ +@OpMetadata( + opType = UnicodeTranscode.OP_NAME, + inputsClass = UnicodeTranscode.Inputs.class +) @Operator( group = "strings" ) @@ -76,8 +85,8 @@ public final class UnicodeTranscode extends RawOp implements Operand { private Output output; - private UnicodeTranscode(Operation operation) { - super(operation); + public UnicodeTranscode(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -237,4 +246,66 @@ public Options replaceControlCharacters(Boolean replaceControlCharacters) { return this; } } + + @OpInputsMetadata( + outputsClass = UnicodeTranscode.class + ) + public static class Inputs extends RawOpInputs { + /** + * The text to be processed. Can have any shape. + */ + public final Operand input; + + /** + * Text encoding of the input strings. This is any of the encodings supported + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + */ + public final String inputEncoding; + + /** + * The unicode encoding to use in the output. Must be one of + * {@code "UTF-8", "UTF-16-BE", "UTF-32-BE"}. Multi-byte encodings will be big-endian. + */ + public final String outputEncoding; + + /** + * Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + */ + public final String errors; + + /** + * The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + *

    Note that for UTF-8, passing a replacement character expressible in 1 byte, such + * as ' ', will preserve string alignment to the source since invalid bytes will be + * replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte + * replacement character will preserve byte alignment to the source. + */ + public final long replacementChar; + + /** + * Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + */ + public final boolean replaceControlCharacters; + + public Inputs(GraphOperation op) { + super(new UnicodeTranscode(op), op, Arrays.asList("input_encoding", "output_encoding", "errors", "replacement_char", "replace_control_characters")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + inputEncoding = op.attributes().getAttrString("input_encoding"); + outputEncoding = op.attributes().getAttrString("output_encoding"); + errors = op.attributes().getAttrString("errors"); + replacementChar = op.attributes().getAttrInt("replacement_char"); + replaceControlCharacters = op.attributes().getAttrBool("replace_control_characters"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java index cbd8c518994..b9d82efab59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,44 +17,30 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** - * Joins the elements of {@code inputs} based on {@code segment_ids}. - * Computes the string join along segments of a tensor. - * Given {@code segment_ids} with rank {@code N} and {@code data} with rank {@code N+M}: - *

    - * `output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
    - * 
    - *

    where the join is over all [j1...jN] such that segment_ids[j1...jN] = i. - * Strings are joined in row-major order. - *

    For example: - *

    - * inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
    - * output_array = string_ops.unsorted_segment_join(inputs=inputs,
    - *                                                 segment_ids=[1, 0, 1],
    - *                                                 num_segments=2,
    - *                                                 separator=':'))
    - * # output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
    - *
    - *
    - * inputs = ['this', 'is', 'a', 'test']
    - * output_array = string_ops.unsorted_segment_join(inputs=inputs,
    - *                                                 segment_ids=[0, 0, 0, 0],
    - *                                                 num_segments=1,
    - *                                                 separator=':'))
    - * # output_array ==> ['this:is:a:test']
    - * 
    + * The UnsortedSegmentJoin operation */ +@OpMetadata( + opType = UnsortedSegmentJoin.OP_NAME, + inputsClass = UnsortedSegmentJoin.Inputs.class +) @Operator( group = "strings" ) @@ -66,8 +52,8 @@ public final class UnsortedSegmentJoin extends RawOp implements Operand private Output output; - private UnsortedSegmentJoin(Operation operation) { - super(operation); + public UnsortedSegmentJoin(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,10 +62,9 @@ private UnsortedSegmentJoin(Operation operation) { * Factory method to create a class wrapping a new UnsortedSegmentJoin operation. * * @param scope current scope - * @param inputs The input to be joined. - * @param segmentIds A tensor whose shape is a prefix of data.shape. Negative segment ids are not - * supported. - * @param numSegments A scalar. + * @param inputs The inputs value + * @param segmentIds The segmentIds value + * @param numSegments The numSegments value * @param options carries optional attribute values * @return a new instance of UnsortedSegmentJoin */ @@ -106,7 +91,7 @@ public static UnsortedSegmentJoin create(Scope scope, Operand inputs, /** * Sets the separator option. * - * @param separator The separator to use when joining. + * @param separator the separator option * @return this Options instance. */ public static Options separator(String separator) { @@ -139,7 +124,7 @@ private Options() { /** * Sets the separator option. * - * @param separator The separator to use when joining. + * @param separator the separator option * @return this Options instance. */ public Options separator(String separator) { @@ -147,4 +132,50 @@ public Options separator(String separator) { return this; } } + + @OpInputsMetadata( + outputsClass = UnsortedSegmentJoin.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputs input + */ + public final Operand inputs; + + /** + * The segmentIds input + */ + public final Operand segmentIds; + + /** + * The numSegments input + */ + public final Operand numSegments; + + /** + * The separator attribute + */ + public final String separator; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * The Tnumsegments attribute + */ + public final DataType Tnumsegments; + + public Inputs(GraphOperation op) { + super(new UnsortedSegmentJoin(op), op, Arrays.asList("separator", "Tindices", "Tnumsegments")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + segmentIds = (Operand) op.input(inputIndex++); + numSegments = (Operand) op.input(inputIndex++); + separator = op.attributes().getAttrString("separator"); + Tindices = op.attributes().getAttrType("Tindices"); + Tnumsegments = op.attributes().getAttrType("Tnumsegments"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java index 8e8b0c06ff9..230e5a618a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.strings; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -39,6 +44,10 @@ * * */ +@OpMetadata( + opType = Upper.OP_NAME, + inputsClass = Upper.Inputs.class +) @Operator( group = "strings" ) @@ -50,8 +59,8 @@ public final class Upper extends RawOp implements Operand { private Output output; - private Upper(Operation operation) { - super(operation); + public Upper(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -126,4 +135,27 @@ public Options encoding(String encoding) { return this; } } + + @OpInputsMetadata( + outputsClass = Upper.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input to be upper-cased. + */ + public final Operand input; + + /** + * Character encoding of {@code input}. Allowed values are '' and 'utf-8'. + * Value '' is interpreted as ASCII. + */ + public final String encoding; + + public Inputs(GraphOperation op) { + super(new Upper(op), op, Arrays.asList("encoding")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + encoding = op.attributes().getAttrString("encoding"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java index a971795dd2d..5cb95d34e34 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TString; @@ -41,6 +46,10 @@ * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc. * */ +@OpMetadata( + opType = AudioSummary.OP_NAME, + inputsClass = AudioSummary.Inputs.class +) @Operator( group = "summary" ) @@ -52,8 +61,8 @@ public final class AudioSummary extends RawOp implements Operand { private Output summary; - private AudioSummary(Operation operation) { - super(operation); + public AudioSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -131,4 +140,38 @@ public Options maxOutputs(Long maxOutputs) { return this; } } + + @OpInputsMetadata( + outputsClass = AudioSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * Scalar. Used to build the {@code tag} attribute of the summary values. + */ + public final Operand tag; + + /** + * 2-D of shape {@code [batch_size, frames]}. + */ + public final Operand tensor; + + /** + * The sample rate of the signal in hertz. + */ + public final Operand sampleRate; + + /** + * Max number of batch elements to generate audio for. + */ + public final long maxOutputs; + + public Inputs(GraphOperation op) { + super(new AudioSummary(op), op, Arrays.asList("max_outputs")); + int inputIndex = 0; + tag = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + sampleRate = (Operand) op.input(inputIndex++); + maxOutputs = op.attributes().getAttrInt("max_outputs"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java index c7bb55643da..6621499b9ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,32 +17,45 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The CloseSummaryWriter operation */ +@OpMetadata( + opType = CloseSummaryWriter.OP_NAME, + inputsClass = CloseSummaryWriter.Inputs.class +) +@Operator( + group = "summary" +) public final class CloseSummaryWriter extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CloseSummaryWriter"; - private CloseSummaryWriter(Operation operation) { - super(operation); + public CloseSummaryWriter(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new CloseSummaryWriter operation. * * @param scope current scope - * @param writer the writer value + * @param writer The writer value * @return a new instance of CloseSummaryWriter */ @Endpoint( @@ -53,4 +66,20 @@ public static CloseSummaryWriter create(Scope scope, Operand wr opBuilder.addInput(writer.asOutput()); return new CloseSummaryWriter(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = CloseSummaryWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + public Inputs(GraphOperation op) { + super(new CloseSummaryWriter(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java index c7dc8ec117f..5a24e79a5f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,37 +17,50 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The CreateSummaryDbWriter operation */ +@OpMetadata( + opType = CreateSummaryDbWriter.OP_NAME, + inputsClass = CreateSummaryDbWriter.Inputs.class +) +@Operator( + group = "summary" +) public final class CreateSummaryDbWriter extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CreateSummaryDbWriter"; - private CreateSummaryDbWriter(Operation operation) { - super(operation); + public CreateSummaryDbWriter(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new CreateSummaryDbWriter operation. * * @param scope current scope - * @param writer the writer value - * @param dbUri the dbUri value - * @param experimentName the experimentName value - * @param runName the runName value - * @param userName the userName value + * @param writer The writer value + * @param dbUri The dbUri value + * @param experimentName The experimentName value + * @param runName The runName value + * @param userName The userName value * @return a new instance of CreateSummaryDbWriter */ @Endpoint( @@ -64,4 +77,44 @@ public static CreateSummaryDbWriter create(Scope scope, Operand opBuilder.addInput(userName.asOutput()); return new CreateSummaryDbWriter(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = CreateSummaryDbWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The dbUri input + */ + public final Operand dbUri; + + /** + * The experimentName input + */ + public final Operand experimentName; + + /** + * The runName input + */ + public final Operand runName; + + /** + * The userName input + */ + public final Operand userName; + + public Inputs(GraphOperation op) { + super(new CreateSummaryDbWriter(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + dbUri = (Operand) op.input(inputIndex++); + experimentName = (Operand) op.input(inputIndex++); + runName = (Operand) op.input(inputIndex++); + userName = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java index cc448613793..1e62bfe05c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -30,25 +36,32 @@ /** * The CreateSummaryFileWriter operation */ +@OpMetadata( + opType = CreateSummaryFileWriter.OP_NAME, + inputsClass = CreateSummaryFileWriter.Inputs.class +) +@Operator( + group = "summary" +) public final class CreateSummaryFileWriter extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "CreateSummaryFileWriter"; - private CreateSummaryFileWriter(Operation operation) { - super(operation); + public CreateSummaryFileWriter(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new CreateSummaryFileWriter operation. * * @param scope current scope - * @param writer the writer value - * @param logdir the logdir value - * @param maxQueue the maxQueue value - * @param flushMillis the flushMillis value - * @param filenameSuffix the filenameSuffix value + * @param writer The writer value + * @param logdir The logdir value + * @param maxQueue The maxQueue value + * @param flushMillis The flushMillis value + * @param filenameSuffix The filenameSuffix value * @return a new instance of CreateSummaryFileWriter */ @Endpoint( @@ -65,4 +78,44 @@ public static CreateSummaryFileWriter create(Scope scope, Operand { + /** + * The writer input + */ + public final Operand writer; + + /** + * The logdir input + */ + public final Operand logdir; + + /** + * The maxQueue input + */ + public final Operand maxQueue; + + /** + * The flushMillis input + */ + public final Operand flushMillis; + + /** + * The filenameSuffix input + */ + public final Operand filenameSuffix; + + public Inputs(GraphOperation op) { + super(new CreateSummaryFileWriter(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + logdir = (Operand) op.input(inputIndex++); + maxQueue = (Operand) op.input(inputIndex++); + flushMillis = (Operand) op.input(inputIndex++); + filenameSuffix = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java index e2756661a48..3faedb9a03b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,32 +17,45 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The FlushSummaryWriter operation */ +@OpMetadata( + opType = FlushSummaryWriter.OP_NAME, + inputsClass = FlushSummaryWriter.Inputs.class +) +@Operator( + group = "summary" +) public final class FlushSummaryWriter extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "FlushSummaryWriter"; - private FlushSummaryWriter(Operation operation) { - super(operation); + public FlushSummaryWriter(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new FlushSummaryWriter operation. * * @param scope current scope - * @param writer the writer value + * @param writer The writer value * @return a new instance of FlushSummaryWriter */ @Endpoint( @@ -53,4 +66,20 @@ public static FlushSummaryWriter create(Scope scope, Operand wr opBuilder.addInput(writer.asOutput()); return new FlushSummaryWriter(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = FlushSummaryWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + public Inputs(GraphOperation op) { + super(new FlushSummaryWriter(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java index 0c5ab5b5eec..0931040efe9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -35,6 +41,10 @@ * has one summary value containing a histogram for {@code values}. *

    This op reports an {@code InvalidArgument} error if any value is not finite. */ +@OpMetadata( + opType = HistogramSummary.OP_NAME, + inputsClass = HistogramSummary.Inputs.class +) @Operator( group = "summary" ) @@ -46,8 +56,8 @@ public final class HistogramSummary extends RawOp implements Operand { private Output summary; - private HistogramSummary(Operation operation) { - super(operation); + public HistogramSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -84,4 +94,32 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = HistogramSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * Scalar. Tag to use for the {@code Summary.Value}. + */ + public final Operand tag; + + /** + * Any shape. Values to use to build the histogram. + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new HistogramSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + tag = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java index f9685d3e7ce..706c85390ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.Tensor; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -67,6 +73,10 @@ * replaced by this tensor in the output image. The default value is the color * red. */ +@OpMetadata( + opType = ImageSummary.OP_NAME, + inputsClass = ImageSummary.Inputs.class +) @Operator( group = "summary" ) @@ -78,8 +88,8 @@ public final class ImageSummary extends RawOp implements Operand { private Output summary; - private ImageSummary(Operation operation) { - super(operation); + public ImageSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -182,4 +192,45 @@ public Options badColor(Tensor badColor) { return this; } } + + @OpInputsMetadata( + outputsClass = ImageSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * Scalar. Used to build the {@code tag} attribute of the summary values. + */ + public final Operand tag; + + /** + * 4-D of shape {@code [batch_size, height, width, channels]} where + * {@code channels} is 1, 3, or 4. + */ + public final Operand tensor; + + /** + * Max number of batch elements to generate images for. + */ + public final long maxImages; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Color to use for pixels with non-finite values. + */ + public final Tensor badColor; + + public Inputs(GraphOperation op) { + super(new ImageSummary(op), op, Arrays.asList("max_images", "T", "bad_color")); + int inputIndex = 0; + tag = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + maxImages = op.attributes().getAttrInt("max_images"); + T = op.attributes().getAttrType("T"); + badColor = op.attributes().getAttrTensor("bad_color"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java index 4eb68fbc68d..a9723ef2fcb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,34 +17,47 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * The ImportEvent operation */ +@OpMetadata( + opType = ImportEvent.OP_NAME, + inputsClass = ImportEvent.Inputs.class +) +@Operator( + group = "summary" +) public final class ImportEvent extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ImportEvent"; - private ImportEvent(Operation operation) { - super(operation); + public ImportEvent(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new ImportEvent operation. * * @param scope current scope - * @param writer the writer value - * @param event the event value + * @param writer The writer value + * @param event The event value * @return a new instance of ImportEvent */ @Endpoint( @@ -57,4 +70,26 @@ public static ImportEvent create(Scope scope, Operand writer, opBuilder.addInput(event.asOutput()); return new ImportEvent(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ImportEvent.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The event input + */ + public final Operand event; + + public Inputs(GraphOperation op) { + super(new ImportEvent(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + event = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java index c52ddaac7a4..2888682c97d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,19 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -37,6 +42,10 @@ *

    When the Op is run, it reports an {@code InvalidArgument} error if multiple values * in the summaries to merge use the same tag. */ +@OpMetadata( + opType = MergeSummary.OP_NAME, + inputsClass = MergeSummary.Inputs.class +) @Operator( group = "summary" ) @@ -48,8 +57,8 @@ public final class MergeSummary extends RawOp implements Operand { private Output summary; - private MergeSummary(Operation operation) { - super(operation); + public MergeSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -84,4 +93,23 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = MergeSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * Can be of any shape. Each must contain serialized {@code Summary} protocol + * buffers. + */ + public final Iterable> inputs; + + public Inputs(GraphOperation op) { + super(new MergeSummary(op), op, Arrays.asList()); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java index a41165f3327..d7a9c42c0f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -33,6 +39,10 @@ * The input {@code tags} and {@code values} must have the same shape. The generated summary * has a summary value for each tag-value pair in {@code tags} and {@code values}. */ +@OpMetadata( + opType = ScalarSummary.OP_NAME, + inputsClass = ScalarSummary.Inputs.class +) @Operator( group = "summary" ) @@ -44,8 +54,8 @@ public final class ScalarSummary extends RawOp implements Operand { private Output summary; - private ScalarSummary(Operation operation) { - super(operation); + public ScalarSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -82,4 +92,32 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = ScalarSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * Tags for the summary. + */ + public final Operand tags; + + /** + * Same shape as `tags. Values for the summary. + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ScalarSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + tags = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java index 8c6ce2b25d2..b604a6b85ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Produces a summary of any statistics recorded by the given statistics manager. */ +@OpMetadata( + opType = StatsAggregatorSummary.OP_NAME, + inputsClass = StatsAggregatorSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class StatsAggregatorSummary extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class StatsAggregatorSummary extends RawOp implements Operand summary; - private StatsAggregatorSummary(Operation operation) { - super(operation); + public StatsAggregatorSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -48,7 +61,7 @@ private StatsAggregatorSummary(Operation operation) { * Factory method to create a class wrapping a new StatsAggregatorSummary operation. * * @param scope current scope - * @param iterator the iterator value + * @param iterator The iterator value * @return a new instance of StatsAggregatorSummary */ @Endpoint( @@ -73,4 +86,20 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = StatsAggregatorSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The iterator input + */ + public final Operand iterator; + + public Inputs(GraphOperation op) { + super(new StatsAggregatorSummary(op), op, Arrays.asList()); + int inputIndex = 0; + iterator = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java index 3183ca16a90..d891f9b35a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * The SummaryWriter operation */ +@OpMetadata( + opType = SummaryWriter.OP_NAME, + inputsClass = SummaryWriter.Inputs.class +) +@Operator( + group = "summary" +) public final class SummaryWriter extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class SummaryWriter extends RawOp implements Operand { private Output writer; @SuppressWarnings("unchecked") - private SummaryWriter(Operation operation) { - super(operation); + public SummaryWriter(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; writer = operation.output(outputIdx++); } @@ -137,4 +150,26 @@ public Options container(String container) { return this; } } + + @OpInputsMetadata( + outputsClass = SummaryWriter.class + ) + public static class Inputs extends RawOpInputs { + /** + * The sharedName attribute + */ + public final String sharedName; + + /** + * The container attribute + */ + public final String container; + + public Inputs(GraphOperation op) { + super(new SummaryWriter(op), op, Arrays.asList("shared_name", "container")); + int inputIndex = 0; + sharedName = op.attributes().getAttrString("shared_name"); + container = op.attributes().getAttrString("container"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java index 573a9961992..156661177a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,20 +17,30 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Outputs a {@code Summary} protocol buffer with a tensor and per-plugin data. */ +@OpMetadata( + opType = TensorSummary.OP_NAME, + inputsClass = TensorSummary.Inputs.class +) @Operator( group = "summary" ) @@ -42,8 +52,8 @@ public final class TensorSummary extends RawOp implements Operand { private Output summary; - private TensorSummary(Operation operation) { - super(operation); + public TensorSummary(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; summary = operation.output(outputIdx++); } @@ -83,4 +93,39 @@ public Output summary() { public Output asOutput() { return summary; } + + @OpInputsMetadata( + outputsClass = TensorSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string attached to this summary. Used for organization in TensorBoard. + */ + public final Operand tag; + + /** + * A tensor to serialize. + */ + public final Operand tensor; + + /** + * A serialized SummaryMetadata proto. Contains plugin + * data. + */ + public final Operand serializedSummaryMetadata; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TensorSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + tag = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + serializedSummaryMetadata = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 2163effbc50..9ba1858b59e 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -33,25 +39,32 @@ * Writes encoded audio summary {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. * {@code sample_rate} is the audio sample rate is Hz. */ +@OpMetadata( + opType = WriteAudioSummary.OP_NAME, + inputsClass = WriteAudioSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteAudioSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteAudioSummary"; - private WriteAudioSummary(Operation operation) { - super(operation); + public WriteAudioSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteAudioSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tag the tag value - * @param tensor the tensor value - * @param sampleRate the sampleRate value + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param tensor The tensor value + * @param sampleRate The sampleRate value * @param options carries optional attribute values * @return a new instance of WriteAudioSummary */ @@ -107,4 +120,50 @@ public Options maxOutputs(Long maxOutputs) { return this; } } + + @OpInputsMetadata( + outputsClass = WriteAudioSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The sampleRate input + */ + public final Operand sampleRate; + + /** + * The maxOutputs attribute + */ + public final long maxOutputs; + + public Inputs(GraphOperation op) { + super(new WriteAudioSummary(op), op, Arrays.asList("max_outputs")); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + sampleRate = (Operand) op.input(inputIndex++); + maxOutputs = op.attributes().getAttrInt("max_outputs"); + } + } } 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 725f481eab9..565ef3940f3 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,23 +37,30 @@ * Writes a graph summary. * Writes TensorFlow graph {@code tensor} at {@code step} using summary {@code writer}. */ +@OpMetadata( + opType = WriteGraphSummary.OP_NAME, + inputsClass = WriteGraphSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteGraphSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteGraphSummary"; - private WriteGraphSummary(Operation operation) { - super(operation); + public WriteGraphSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteGraphSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tensor the tensor value + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value * @return a new instance of WriteGraphSummary */ @Endpoint( @@ -61,4 +74,32 @@ public static WriteGraphSummary create(Scope scope, Operand wri opBuilder.addInput(tensor.asOutput()); return new WriteGraphSummary(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteGraphSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tensor input + */ + public final Operand tensor; + + public Inputs(GraphOperation op) { + super(new WriteGraphSummary(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + } + } } 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 b82701d2fec..ba431bc0d7e 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,24 +38,31 @@ * Writes a histogram summary. * Writes histogram {@code values} at {@code step} with {@code tag} using summary {@code writer}. */ +@OpMetadata( + opType = WriteHistogramSummary.OP_NAME, + inputsClass = WriteHistogramSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteHistogramSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteHistogramSummary"; - private WriteHistogramSummary(Operation operation) { - super(operation); + public WriteHistogramSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteHistogramSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tag the tag value - * @param values the values value + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param values The values value * @return a new instance of WriteHistogramSummary */ @Endpoint( @@ -63,4 +77,44 @@ public static WriteHistogramSummary create(Scope scope, Operand opBuilder.addInput(values.asOutput()); return new WriteHistogramSummary(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteHistogramSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The values input + */ + public final Operand values; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new WriteHistogramSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 374525fd3c0..12d4578a8b3 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; @@ -34,25 +41,32 @@ * Writes image {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. * {@code tensor} is image with shape [height, width, channels]. */ +@OpMetadata( + opType = WriteImageSummary.OP_NAME, + inputsClass = WriteImageSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteImageSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteImageSummary"; - private WriteImageSummary(Operation operation) { - super(operation); + public WriteImageSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteImageSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tag the tag value - * @param tensor the tensor value - * @param badColor the badColor value + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param tensor The tensor value + * @param badColor The badColor value * @param options carries optional attribute values * @return a new instance of WriteImageSummary */ @@ -108,4 +122,56 @@ public Options maxImages(Long maxImages) { return this; } } + + @OpInputsMetadata( + outputsClass = WriteImageSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The badColor input + */ + public final Operand badColor; + + /** + * The maxImages attribute + */ + public final long maxImages; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new WriteImageSummary(op), op, Arrays.asList("max_images", "T")); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + badColor = (Operand) op.input(inputIndex++); + maxImages = op.attributes().getAttrInt("max_images"); + T = op.attributes().getAttrType("T"); + } + } } 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 47ab6026a7f..d56f66e11c6 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,23 +37,30 @@ * Writes a serialized proto summary. * Writes {@code tensor}, a serialized proto at {@code step} using summary {@code writer}. */ +@OpMetadata( + opType = WriteRawProtoSummary.OP_NAME, + inputsClass = WriteRawProtoSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteRawProtoSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteRawProtoSummary"; - private WriteRawProtoSummary(Operation operation) { - super(operation); + public WriteRawProtoSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteRawProtoSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tensor the tensor value + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value * @return a new instance of WriteRawProtoSummary */ @Endpoint( @@ -61,4 +74,32 @@ public static WriteRawProtoSummary create(Scope scope, Operand opBuilder.addInput(tensor.asOutput()); return new WriteRawProtoSummary(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteRawProtoSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tensor input + */ + public final Operand tensor; + + public Inputs(GraphOperation op) { + super(new WriteRawProtoSummary(op), op, Arrays.asList()); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + } + } } 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 9313cff199e..d7055fb14dc 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -32,24 +39,31 @@ * Writes a scalar summary. * Writes scalar {@code value} at {@code step} with {@code tag} using summary {@code writer}. */ +@OpMetadata( + opType = WriteScalarSummary.OP_NAME, + inputsClass = WriteScalarSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteScalarSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteScalarSummary"; - private WriteScalarSummary(Operation operation) { - super(operation); + public WriteScalarSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteScalarSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tag the tag value - * @param value the value value + * @param writer The writer value + * @param step The step value + * @param tag The tag value + * @param value The value value * @return a new instance of WriteScalarSummary */ @Endpoint( @@ -64,4 +78,44 @@ public static WriteScalarSummary create(Scope scope, Operand wr opBuilder.addInput(value.asOutput()); return new WriteScalarSummary(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteScalarSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The value input + */ + public final Operand value; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new WriteScalarSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + value = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } 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 2783d80ea64..31a5a470394 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.summary; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -31,25 +38,32 @@ * Writes a tensor summary. * Writes {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. */ +@OpMetadata( + opType = WriteSummary.OP_NAME, + inputsClass = WriteSummary.Inputs.class +) +@Operator( + group = "summary" +) public final class WriteSummary extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "WriteSummary"; - private WriteSummary(Operation operation) { - super(operation); + public WriteSummary(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new WriteSummary operation. * * @param scope current scope - * @param writer the writer value - * @param step the step value - * @param tensor the tensor value - * @param tag the tag value - * @param summaryMetadata the summaryMetadata value + * @param writer The writer value + * @param step The step value + * @param tensor The tensor value + * @param tag The tag value + * @param summaryMetadata The summaryMetadata value * @return a new instance of WriteSummary */ @Endpoint( @@ -66,4 +80,50 @@ public static WriteSummary create(Scope scope, Operand writer, opBuilder.addInput(summaryMetadata.asOutput()); return new WriteSummary(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = WriteSummary.class + ) + public static class Inputs extends RawOpInputs { + /** + * The writer input + */ + public final Operand writer; + + /** + * The step input + */ + public final Operand step; + + /** + * The tensor input + */ + public final Operand tensor; + + /** + * The tag input + */ + public final Operand tag; + + /** + * The summaryMetadata input + */ + public final Operand summaryMetadata; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new WriteSummary(op), op, Arrays.asList("T")); + int inputIndex = 0; + writer = (Operand) op.input(inputIndex++); + step = (Operand) op.input(inputIndex++); + tensor = (Operand) op.input(inputIndex++); + tag = (Operand) op.input(inputIndex++); + summaryMetadata = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/AllToAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/AllToAll.java index 34599cbbbda..3bd1592cbc7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/AllToAll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/AllToAll.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -42,9 +49,14 @@ * split_count=2 *

    replica 0's output: {@code [[A], [C]]} * replica 1's output: {@code [[B], [D]]} - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = AllToAll.OP_NAME, + inputsClass = AllToAll.Inputs.class +) +@Operator( + group = "tpu" +) public final class AllToAll extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +65,8 @@ public final class AllToAll extends RawOp implements Operand private Output output; - private AllToAll(Operation operation) { - super(operation); + public AllToAll(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -101,4 +113,53 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = AllToAll.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The local input to the sum. + */ + public final Operand input; + + /** + * An int32 tensor with shape + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the + * replica ids in the ith subgroup. + */ + public final Operand groupAssignment; + + /** + * The type of elements to be exchanged. + */ + public final DataType T; + + /** + * The dimension number to concatenate. + */ + public final long concatDimension; + + /** + * The dimension number to split. + */ + public final long splitDimension; + + /** + * The number of splits, this number must equal to the sub-group + * size(group_assignment.get_shape()[1]) + */ + public final long splitCount; + + public Inputs(GraphOperation op) { + super(new AllToAll<>(op), op, Arrays.asList("T", "concat_dimension", "split_dimension", "split_count")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + groupAssignment = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + concatDimension = op.attributes().getAttrInt("concat_dimension"); + splitDimension = op.attributes().getAttrInt("split_dimension"); + splitCount = op.attributes().getAttrInt("split_count"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollateTPUEmbeddingMemory.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollateTPUEmbeddingMemory.java new file mode 100644 index 00000000000..83307a9f5b5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollateTPUEmbeddingMemory.java @@ -0,0 +1,110 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that merges the string-encoded memory config protos from all hosts. + */ +@OpMetadata( + opType = CollateTPUEmbeddingMemory.OP_NAME, + inputsClass = CollateTPUEmbeddingMemory.Inputs.class +) +@Operator( + group = "tpu" +) +public final class CollateTPUEmbeddingMemory extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollateTPUEmbeddingMemory"; + + private Output mergedMemoryConfig; + + public CollateTPUEmbeddingMemory(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + mergedMemoryConfig = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CollateTPUEmbeddingMemory operation. + * + * @param scope current scope + * @param memoryConfigs String-encoded memory config protos containing metadata about + * the memory allocations reserved for TPUEmbedding across all hosts. + * @return a new instance of CollateTPUEmbeddingMemory + */ + @Endpoint( + describeByClass = true + ) + public static CollateTPUEmbeddingMemory create(Scope scope, + Iterable> memoryConfigs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollateTPUEmbeddingMemory"); + opBuilder.addInputList(Operands.asOutputs(memoryConfigs)); + return new CollateTPUEmbeddingMemory(opBuilder.build()); + } + + /** + * Gets mergedMemoryConfig. + * + * @return mergedMemoryConfig. + */ + public Output mergedMemoryConfig() { + return mergedMemoryConfig; + } + + @Override + public Output asOutput() { + return mergedMemoryConfig; + } + + @OpInputsMetadata( + outputsClass = CollateTPUEmbeddingMemory.class + ) + public static class Inputs extends RawOpInputs { + /** + * String-encoded memory config protos containing metadata about + * the memory allocations reserved for TPUEmbedding across all hosts. + */ + public final Iterable> memoryConfigs; + + public Inputs(GraphOperation op) { + super(new CollateTPUEmbeddingMemory(op), op, Arrays.asList()); + int inputIndex = 0; + int memoryConfigsLength = op.inputListLength("memory_configs"); + memoryConfigs = Arrays.asList((Operand[]) op.inputList(inputIndex, memoryConfigsLength)); + inputIndex += memoryConfigsLength; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java deleted file mode 100644 index 3083821cf79..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java +++ /dev/null @@ -1,87 +0,0 @@ -/* 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.types.TInt32; -import org.tensorflow.types.family.TType; - -/** - * An Op to permute tensors across replicated TPU instances. - * Each instance supplies its own input. - *

    For example, suppose there are 4 TPU instances: {@code [A, B, C, D]}. Passing - * source_target_pairs={@code [[0,1],[1,2],[2,3],[3,0]]} gets the outputs: - * {@code [D, A, B, C]}. - * - * @param data type for {@code output} output - */ -public final class CollectivePermute extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "CollectivePermute"; - - private Output output; - - private CollectivePermute(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new CollectivePermute operation. - * - * @param scope current scope - * @param input The local input to be permuted. Currently only supports float and - * bfloat16. - * @param sourceTargetPairs A tensor with shape [num_pairs, 2]. - * @param data type for {@code CollectivePermute} output and operands - * @return a new instance of CollectivePermute - */ - @Endpoint( - describeByClass = true - ) - public static CollectivePermute create(Scope scope, Operand input, - Operand sourceTargetPairs) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "CollectivePermute"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(sourceTargetPairs.asOutput()); - return new CollectivePermute<>(opBuilder.build()); - } - - /** - * Gets output. - * The permuted input. - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} 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 index 7811ec35db4..f6253a3f89f 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** @@ -32,6 +38,13 @@ * CompilationResultProto, which holds a status and an error message if an error * occurred during compilation. */ +@OpMetadata( + opType = CompilationResult.OP_NAME, + inputsClass = CompilationResult.Inputs.class +) +@Operator( + group = "tpu" +) public final class CompilationResult extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +53,8 @@ public final class CompilationResult extends RawOp implements Operand { private Output output; - private CompilationResult(Operation operation) { - super(operation); + public CompilationResult(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -73,4 +86,14 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = CompilationResult.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new CompilationResult(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Compile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Compile.java index 7442a387d67..ed24b8e762c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Compile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Compile.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -50,6 +55,10 @@ * used to look up the program in the compilation cache. * 'may_modify_variables' indicates whether variables may be modified. */ +@OpMetadata( + opType = Compile.OP_NAME, + inputsClass = Compile.Inputs.class +) @Operator( group = "tpu" ) @@ -66,8 +75,8 @@ public final class Compile extends RawOp { private List> mayModifyVariables; @SuppressWarnings("unchecked") - private Compile(Operation operation) { - super(operation); + public Compile(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; compilationStatus = operation.output(outputIdx++); int programLength = operation.outputListLength("program"); @@ -82,11 +91,11 @@ private Compile(Operation operation) { * Factory method to create a class wrapping a new TPUCompile operation. * * @param scope current scope - * @param dynamicShapes the dynamicShapes value - * @param guaranteedConstants the guaranteedConstants value - * @param numComputations the value of the numComputations property - * @param function the value of the function property - * @param metadata the value of the metadata property + * @param dynamicShapes The dynamicShapes value + * @param guaranteedConstants The guaranteedConstants value + * @param numComputations The value of the numComputations attribute + * @param function The value of the function attribute + * @param metadata The value of the metadata attribute * @return a new instance of Compile */ @Endpoint( @@ -130,4 +139,42 @@ public List> program() { public List> mayModifyVariables() { return mayModifyVariables; } + + @OpInputsMetadata( + outputsClass = Compile.class + ) + public static class Inputs extends RawOpInputs { + /** + * The dynamicShapes input + */ + public final Iterable> dynamicShapes; + + /** + * The guaranteedConstants input + */ + public final Iterable> guaranteedConstants; + + /** + * The metadata attribute + */ + public final String metadata; + + /** + * The TguaranteedConstants attribute + */ + public final DataType[] TguaranteedConstants; + + public Inputs(GraphOperation op) { + super(new Compile(op), op, Arrays.asList("metadata", "Tguaranteed_constants")); + int inputIndex = 0; + int dynamicShapesLength = op.inputListLength("dynamic_shapes"); + dynamicShapes = Arrays.asList((Operand[]) op.inputList(inputIndex, dynamicShapesLength)); + inputIndex += dynamicShapesLength; + int guaranteedConstantsLength = op.inputListLength("guaranteed_constants"); + guaranteedConstants = Arrays.asList((Operand[]) op.inputList(inputIndex, guaranteedConstantsLength)); + inputIndex += guaranteedConstantsLength; + metadata = op.attributes().getAttrString("metadata"); + TguaranteedConstants = op.attributes().getAttrTypeList("Tguaranteed_constants"); + } + } } 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 index 31e5550bdb8..0e1f88b758d 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ * pending device interactions fail. *

    'compilation_status' is a serialized CompilationResultProto. */ +@OpMetadata( + opType = CompileSucceededAssert.OP_NAME, + inputsClass = CompileSucceededAssert.Inputs.class +) @Operator( group = "tpu" ) @@ -41,15 +50,15 @@ public final class CompileSucceededAssert extends RawOp { */ public static final String OP_NAME = "TPUCompileSucceededAssert"; - private CompileSucceededAssert(Operation operation) { - super(operation); + public CompileSucceededAssert(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new TPUCompileSucceededAssert operation. * * @param scope current scope - * @param compilationStatus the compilationStatus value + * @param compilationStatus The compilationStatus value * @return a new instance of CompileSucceededAssert */ @Endpoint( @@ -60,4 +69,20 @@ public static CompileSucceededAssert create(Scope scope, Operand compil opBuilder.addInput(compilationStatus.asOutput()); return new CompileSucceededAssert(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = CompileSucceededAssert.class + ) + public static class Inputs extends RawOpInputs { + /** + * The compilationStatus input + */ + public final Operand compilationStatus; + + public Inputs(GraphOperation op) { + super(new CompileSucceededAssert(op), op, Arrays.asList()); + int inputIndex = 0; + compilationStatus = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataSize.java new file mode 100644 index 00000000000..6ff27567e92 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataSize.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TInt32; + +/** + * An op computes the size of the deduplication data from embedding core and returns the updated config. + * This op is to compute size of the deduplication data so to provide this + * information to the op that computes the tuple mask of deduplication data can + * have static output shape. + */ +@OpMetadata( + opType = ComputeDedupDataSize.OP_NAME, + inputsClass = ComputeDedupDataSize.Inputs.class +) +public final class ComputeDedupDataSize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ComputeDedupDataSizeV2"; + + private Output numElements; + + public ComputeDedupDataSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + numElements = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ComputeDedupDataSizeV2 operation. + * + * @param scope current scope + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param embeddingPartitions Serialized EmbeddingPartitionsProto proto. + * @param hbmBuffersConfig Serialized HbmBuffersConfig proto. + * @param tpuTopology Serialized TpuTopologyArgsProto proto. + * @return a new instance of ComputeDedupDataSize + */ + @Endpoint( + describeByClass = true + ) + public static ComputeDedupDataSize create(Scope scope, String config, String embeddingPartitions, + String hbmBuffersConfig, String tpuTopology) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ComputeDedupDataSize"); + opBuilder.setAttr("config", config); + opBuilder.setAttr("embedding_partitions", embeddingPartitions); + opBuilder.setAttr("hbm_buffers_config", hbmBuffersConfig); + opBuilder.setAttr("tpu_topology", tpuTopology); + return new ComputeDedupDataSize(opBuilder.build()); + } + + /** + * Gets numElements. + * The size of the deduplicated data from infeed. + * @return numElements. + */ + public Output numElements() { + return numElements; + } + + @Override + public Output asOutput() { + return numElements; + } + + @OpInputsMetadata( + outputsClass = ComputeDedupDataSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + /** + * Serialized EmbeddingPartitionsProto proto. + */ + public final String embeddingPartitions; + + /** + * Serialized HbmBuffersConfig proto. + */ + public final String hbmBuffersConfig; + + /** + * Serialized TpuTopologyArgsProto proto. + */ + public final String tpuTopology; + + public Inputs(GraphOperation op) { + super(new ComputeDedupDataSize(op), op, Arrays.asList("config", "embedding_partitions", "hbm_buffers_config", "tpu_topology")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + embeddingPartitions = op.attributes().getAttrString("embedding_partitions"); + hbmBuffersConfig = op.attributes().getAttrString("hbm_buffers_config"); + tpuTopology = op.attributes().getAttrString("tpu_topology"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataTupleMask.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataTupleMask.java new file mode 100644 index 00000000000..1160a8536a2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ComputeDedupDataTupleMask.java @@ -0,0 +1,133 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TInt32; + +/** + * An op computes tuple mask of deduplication data from embedding core. + * The deduplication data receiving from embedding core is a Tensor with + * type=DT_VARIANT. The tensor itself is an XLA nested tuple, whose elements are + * rank 1 tensors. This op is to represents types and length of these elements. + */ +@OpMetadata( + opType = ComputeDedupDataTupleMask.OP_NAME, + inputsClass = ComputeDedupDataTupleMask.Inputs.class +) +public final class ComputeDedupDataTupleMask extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ComputeDedupDataTupleMaskV2"; + + private Output outputShape; + + public ComputeDedupDataTupleMask(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + outputShape = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ComputeDedupDataTupleMaskV2 operation. + * + * @param scope current scope + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param embeddingPartitions Serialized EmbeddingPartitionsProto proto. + * @param hbmBuffersConfig Serialized HbmBuffersConfig proto. + * @param tpuTopology Serialized TpuTopologyArgsProto proto. + * @return a new instance of ComputeDedupDataTupleMask + */ + @Endpoint( + describeByClass = true + ) + public static ComputeDedupDataTupleMask create(Scope scope, String config, + String embeddingPartitions, String hbmBuffersConfig, String tpuTopology) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ComputeDedupDataTupleMask"); + opBuilder.setAttr("config", config); + opBuilder.setAttr("embedding_partitions", embeddingPartitions); + opBuilder.setAttr("hbm_buffers_config", hbmBuffersConfig); + opBuilder.setAttr("tpu_topology", tpuTopology); + return new ComputeDedupDataTupleMask(opBuilder.build()); + } + + /** + * Gets outputShape. + * A 2-D int tensor represent mask of deduplication data tuple generated by + * {@code XlaRecvTPUEmbeddingDeduplicationData}. The tuple has several integer and float + * type 1-D tensor tuple elements. The first dimenion of this output_shape 2-D + * tensor is tensor type of tuple elements, {@code 0} represents integer tensor, {@code 1} + * represents float tensor. The second dimension of {@code output_shape} gives length of + * each tuple element. + * @return outputShape. + */ + public Output outputShape() { + return outputShape; + } + + @Override + public Output asOutput() { + return outputShape; + } + + @OpInputsMetadata( + outputsClass = ComputeDedupDataTupleMask.class + ) + public static class Inputs extends RawOpInputs { + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + /** + * Serialized EmbeddingPartitionsProto proto. + */ + public final String embeddingPartitions; + + /** + * Serialized HbmBuffersConfig proto. + */ + public final String hbmBuffersConfig; + + /** + * Serialized TpuTopologyArgsProto proto. + */ + public final String tpuTopology; + + public Inputs(GraphOperation op) { + super(new ComputeDedupDataTupleMask(op), op, Arrays.asList("config", "embedding_partitions", "hbm_buffers_config", "tpu_topology")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + embeddingPartitions = op.attributes().getAttrString("embedding_partitions"); + hbmBuffersConfig = op.attributes().getAttrString("hbm_buffers_config"); + tpuTopology = op.attributes().getAttrString("tpu_topology"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureAndInitializeGlobalTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureAndInitializeGlobalTPU.java new file mode 100644 index 00000000000..9fcdf7585af --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureAndInitializeGlobalTPU.java @@ -0,0 +1,141 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * An op that sets up the centralized structures for a distributed TPU system. + */ +@OpMetadata( + opType = ConfigureAndInitializeGlobalTPU.OP_NAME, + inputsClass = ConfigureAndInitializeGlobalTPU.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ConfigureAndInitializeGlobalTPU extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConfigureAndInitializeGlobalTPU"; + + private Output output; + + public ConfigureAndInitializeGlobalTPU(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConfigureAndInitializeGlobalTPU operation. + * + * @param scope current scope + * @param options carries optional attribute values + * @return a new instance of ConfigureAndInitializeGlobalTPU + */ + @Endpoint( + describeByClass = true + ) + public static ConfigureAndInitializeGlobalTPU create(Scope scope, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConfigureAndInitializeGlobalTPU"); + if (options != null) { + for (Options opts : options) { + if (opts.useTfrtHostRuntime != null) { + opBuilder.setAttr("use_tfrt_host_runtime", opts.useTfrtHostRuntime); + } + } + } + return new ConfigureAndInitializeGlobalTPU(opBuilder.build()); + } + + /** + * Sets the useTfrtHostRuntime option. + * + * @param useTfrtHostRuntime the useTfrtHostRuntime option + * @return this Options instance. + */ + public static Options useTfrtHostRuntime(Boolean useTfrtHostRuntime) { + return new Options().useTfrtHostRuntime(useTfrtHostRuntime); + } + + /** + * Gets output. + * A vector containing the global TPU id of each TPU on the host. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ConfigureAndInitializeGlobalTPU} + */ + public static class Options { + private Boolean useTfrtHostRuntime; + + private Options() { + } + + /** + * Sets the useTfrtHostRuntime option. + * + * @param useTfrtHostRuntime the useTfrtHostRuntime option + * @return this Options instance. + */ + public Options useTfrtHostRuntime(Boolean useTfrtHostRuntime) { + this.useTfrtHostRuntime = useTfrtHostRuntime; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ConfigureAndInitializeGlobalTPU.class + ) + public static class Inputs extends RawOpInputs { + /** + * The useTfrtHostRuntime attribute + */ + public final boolean useTfrtHostRuntime; + + public Inputs(GraphOperation op) { + super(new ConfigureAndInitializeGlobalTPU(op), op, Arrays.asList("use_tfrt_host_runtime")); + int inputIndex = 0; + useTfrtHostRuntime = op.attributes().getAttrBool("use_tfrt_host_runtime"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java index bfbed670d1e..058a08bcba8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,31 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Sets up the centralized structures for a distributed TPU system. */ +@OpMetadata( + opType = ConfigureDistributedTPU.OP_NAME, + inputsClass = ConfigureDistributedTPU.Inputs.class +) +@Operator( + group = "tpu" +) public final class ConfigureDistributedTPU extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -37,8 +50,8 @@ public final class ConfigureDistributedTPU extends RawOp implements Operand topology; - private ConfigureDistributedTPU(Operation operation) { - super(operation); + public ConfigureDistributedTPU(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; topology = operation.output(outputIdx++); } @@ -72,6 +85,9 @@ public static ConfigureDistributedTPU create(Scope scope, Options... options) { if (opts.compilationFailureClosesChips != null) { opBuilder.setAttr("compilation_failure_closes_chips", opts.compilationFailureClosesChips); } + if (opts.tpuCancellationClosesChips != null) { + opBuilder.setAttr("tpu_cancellation_closes_chips", opts.tpuCancellationClosesChips); + } } } return new ConfigureDistributedTPU(opBuilder.build()); @@ -128,6 +144,16 @@ public static Options compilationFailureClosesChips(Boolean compilationFailureCl return new Options().compilationFailureClosesChips(compilationFailureClosesChips); } + /** + * Sets the tpuCancellationClosesChips option. + * + * @param tpuCancellationClosesChips the tpuCancellationClosesChips option + * @return this Options instance. + */ + public static Options tpuCancellationClosesChips(Long tpuCancellationClosesChips) { + return new Options().tpuCancellationClosesChips(tpuCancellationClosesChips); + } + /** * Gets topology. * A serialized tensorflow.tpu.TopologyProto that describes the TPU @@ -157,6 +183,8 @@ public static class Options { private Boolean compilationFailureClosesChips; + private Long tpuCancellationClosesChips; + private Options() { } @@ -215,5 +243,63 @@ public Options compilationFailureClosesChips(Boolean compilationFailureClosesChi this.compilationFailureClosesChips = compilationFailureClosesChips; return this; } + + /** + * Sets the tpuCancellationClosesChips option. + * + * @param tpuCancellationClosesChips the tpuCancellationClosesChips option + * @return this Options instance. + */ + public Options tpuCancellationClosesChips(Long tpuCancellationClosesChips) { + this.tpuCancellationClosesChips = tpuCancellationClosesChips; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ConfigureDistributedTPU.class + ) + public static class Inputs extends RawOpInputs { + /** + * Reserved. Do not use. + */ + public final String embeddingConfig; + + /** + * Serialized tensorflow.tpu.TPUEmbeddingConfiguration that + * describes the embedding lookups of the program. + */ + public final String tpuEmbeddingConfig; + + /** + * Reserved. Do not use. + */ + public final boolean isGlobalInit; + + /** + * The enableWholeMeshCompilations attribute + */ + public final boolean enableWholeMeshCompilations; + + /** + * The compilationFailureClosesChips attribute + */ + public final boolean compilationFailureClosesChips; + + /** + * The tpuCancellationClosesChips attribute + */ + public final long tpuCancellationClosesChips; + + public Inputs(GraphOperation op) { + super(new ConfigureDistributedTPU(op), op, Arrays.asList("embedding_config", "tpu_embedding_config", "is_global_init", "enable_whole_mesh_compilations", "compilation_failure_closes_chips", "tpu_cancellation_closes_chips")); + int inputIndex = 0; + embeddingConfig = op.attributes().getAttrString("embedding_config"); + tpuEmbeddingConfig = op.attributes().getAttrString("tpu_embedding_config"); + isGlobalInit = op.attributes().getAttrBool("is_global_init"); + enableWholeMeshCompilations = op.attributes().getAttrBool("enable_whole_mesh_compilations"); + compilationFailureClosesChips = op.attributes().getAttrBool("compilation_failure_closes_chips"); + tpuCancellationClosesChips = op.attributes().getAttrInt("tpu_cancellation_closes_chips"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java index 0a9aa88e9a5..99f92e64fc1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,36 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; /** * Sets up TPUEmbedding in a distributed TPU system. */ +@OpMetadata( + opType = ConfigureTPUEmbedding.OP_NAME, + inputsClass = ConfigureTPUEmbedding.Inputs.class +) +@Operator( + group = "tpu" +) public final class ConfigureTPUEmbedding extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ConfigureTPUEmbedding"; - private ConfigureTPUEmbedding(Operation operation) { - super(operation); + public ConfigureTPUEmbedding(Operation operation) { + super(operation, OP_NAME); } /** @@ -52,4 +65,21 @@ public static ConfigureTPUEmbedding create(Scope scope, String config) { opBuilder.setAttr("config", config); return new ConfigureTPUEmbedding(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ConfigureTPUEmbedding.class + ) + public static class Inputs extends RawOpInputs { + /** + * Serialized tensorflow.tpu.TPUEmbeddingConfiguration that + * describes the embedding lookups of the program. + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new ConfigureTPUEmbedding(op), op, Arrays.asList("config")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingHost.java new file mode 100644 index 00000000000..b1559ccaba9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingHost.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that configures the TPUEmbedding software on a host. + */ +@OpMetadata( + opType = ConfigureTPUEmbeddingHost.OP_NAME, + inputsClass = ConfigureTPUEmbeddingHost.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ConfigureTPUEmbeddingHost extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConfigureTPUEmbeddingHost"; + + private Output networkConfig; + + public ConfigureTPUEmbeddingHost(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + networkConfig = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConfigureTPUEmbeddingHost operation. + * + * @param scope current scope + * @param commonConfig A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output. + * @param memoryConfig A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + * @param config An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + * @return a new instance of ConfigureTPUEmbeddingHost + */ + @Endpoint( + describeByClass = true + ) + public static ConfigureTPUEmbeddingHost create(Scope scope, Operand commonConfig, + Operand memoryConfig, String config) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConfigureTPUEmbeddingHost"); + opBuilder.addInput(commonConfig.asOutput()); + opBuilder.addInput(memoryConfig.asOutput()); + opBuilder.setAttr("config", config); + return new ConfigureTPUEmbeddingHost(opBuilder.build()); + } + + /** + * Gets networkConfig. + * A string containing metadata about the hostname and RPC port + * used for communication with this host. + * @return networkConfig. + */ + public Output networkConfig() { + return networkConfig; + } + + @Override + public Output asOutput() { + return networkConfig; + } + + @OpInputsMetadata( + outputsClass = ConfigureTPUEmbeddingHost.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output. + */ + public final Operand commonConfig; + + /** + * A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + */ + public final Operand memoryConfig; + + /** + * An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new ConfigureTPUEmbeddingHost(op), op, Arrays.asList("config")); + int inputIndex = 0; + commonConfig = (Operand) op.input(inputIndex++); + memoryConfig = (Operand) op.input(inputIndex++); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingMemory.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingMemory.java new file mode 100644 index 00000000000..1b1fe7adc35 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbeddingMemory.java @@ -0,0 +1,109 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that configures the TPUEmbedding software on a host. + */ +@OpMetadata( + opType = ConfigureTPUEmbeddingMemory.OP_NAME, + inputsClass = ConfigureTPUEmbeddingMemory.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ConfigureTPUEmbeddingMemory extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConfigureTPUEmbeddingMemory"; + + private Output memoryConfig; + + public ConfigureTPUEmbeddingMemory(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + memoryConfig = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConfigureTPUEmbeddingMemory operation. + * + * @param scope current scope + * @param commonConfig A string-encoded CommonConfiguration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + * @return a new instance of ConfigureTPUEmbeddingMemory + */ + @Endpoint( + describeByClass = true + ) + public static ConfigureTPUEmbeddingMemory create(Scope scope, Operand commonConfig) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConfigureTPUEmbeddingMemory"); + opBuilder.addInput(commonConfig.asOutput()); + return new ConfigureTPUEmbeddingMemory(opBuilder.build()); + } + + /** + * Gets memoryConfig. + * A string-encoded memory configuration containing metadata about + * the memory allocations reserved for TPUEmbedding. + * @return memoryConfig. + */ + public Output memoryConfig() { + return memoryConfig; + } + + @Override + public Output asOutput() { + return memoryConfig; + } + + @OpInputsMetadata( + outputsClass = ConfigureTPUEmbeddingMemory.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string-encoded CommonConfiguration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + */ + public final Operand commonConfig; + + public Inputs(GraphOperation op) { + super(new ConfigureTPUEmbeddingMemory(op), op, Arrays.asList()); + int inputIndex = 0; + commonConfig = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConnectTPUEmbeddingHosts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConnectTPUEmbeddingHosts.java new file mode 100644 index 00000000000..5cd4bd820c9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConnectTPUEmbeddingHosts.java @@ -0,0 +1,92 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that sets up communication between TPUEmbedding host software instances + * after ConfigureTPUEmbeddingHost has been called on each host. + */ +@OpMetadata( + opType = ConnectTPUEmbeddingHosts.OP_NAME, + inputsClass = ConnectTPUEmbeddingHosts.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ConnectTPUEmbeddingHosts extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConnectTPUEmbeddingHosts"; + + public ConnectTPUEmbeddingHosts(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new ConnectTPUEmbeddingHosts operation. + * + * @param scope current scope + * @param networkConfigs Strings containing metadata about the hostname and RPC port + * used for communication with all hosts. + * @return a new instance of ConnectTPUEmbeddingHosts + */ + @Endpoint( + describeByClass = true + ) + public static ConnectTPUEmbeddingHosts create(Scope scope, + Iterable> networkConfigs) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConnectTPUEmbeddingHosts"); + opBuilder.addInputList(Operands.asOutputs(networkConfigs)); + return new ConnectTPUEmbeddingHosts(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = ConnectTPUEmbeddingHosts.class + ) + public static class Inputs extends RawOpInputs { + /** + * Strings containing metadata about the hostname and RPC port + * used for communication with all hosts. + */ + public final Iterable> networkConfigs; + + public Inputs(GraphOperation op) { + super(new ConnectTPUEmbeddingHosts(op), op, Arrays.asList()); + int inputIndex = 0; + int networkConfigsLength = op.inputListLength("network_configs"); + networkConfigs = Arrays.asList((Operand[]) op.inputList(inputIndex, networkConfigsLength)); + inputIndex += networkConfigsLength; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConvertToCooTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConvertToCooTensor.java new file mode 100644 index 00000000000..efec4caa44a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConvertToCooTensor.java @@ -0,0 +1,157 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The ConvertToCooTensor operation + */ +@OpMetadata( + opType = ConvertToCooTensor.OP_NAME, + inputsClass = ConvertToCooTensor.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ConvertToCooTensor extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConvertToCooTensor"; + + private Output rowIds; + + private Output colIds; + + private Output gains; + + public ConvertToCooTensor(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowIds = operation.output(outputIdx++); + colIds = operation.output(outputIdx++); + gains = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConvertToCooTensor operation. + * + * @param scope current scope + * @param indicesOrRowSplits The indicesOrRowSplits value + * @param values The values value + * @param weights The weights value + * @param sampleCount The value of the sampleCount attribute + * @param combiner The value of the combiner attribute + * @return a new instance of ConvertToCooTensor + */ + @Endpoint( + describeByClass = true + ) + public static ConvertToCooTensor create(Scope scope, Operand indicesOrRowSplits, + Operand values, Operand weights, Long sampleCount, String combiner) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConvertToCooTensor"); + opBuilder.addInput(indicesOrRowSplits.asOutput()); + opBuilder.addInput(values.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.setAttr("sample_count", sampleCount); + opBuilder.setAttr("combiner", combiner); + return new ConvertToCooTensor(opBuilder.build()); + } + + /** + * Gets rowIds. + * + * @return rowIds. + */ + public Output rowIds() { + return rowIds; + } + + /** + * Gets colIds. + * + * @return colIds. + */ + public Output colIds() { + return colIds; + } + + /** + * Gets gains. + * + * @return gains. + */ + public Output gains() { + return gains; + } + + @OpInputsMetadata( + outputsClass = ConvertToCooTensor.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indicesOrRowSplits input + */ + public final Operand indicesOrRowSplits; + + /** + * The values input + */ + public final Operand values; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The sampleCount attribute + */ + public final long sampleCount; + + /** + * The combiner attribute + */ + public final String combiner; + + public Inputs(GraphOperation op) { + super(new ConvertToCooTensor(op), op, Arrays.asList("sample_count", "combiner")); + int inputIndex = 0; + indicesOrRowSplits = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + sampleCount = op.attributes().getAttrInt("sample_count"); + combiner = op.attributes().getAttrString("combiner"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java index c1267521173..15e942cac31 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; @@ -34,9 +41,14 @@ * Passing group_assignment={@code [[0,2,4,6],[1,3,5,7]]} sets {@code A, C, E, G} as group 0, * and {@code B, D, F, H} as group 1. Thus we get the outputs: * {@code [A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = CrossReplicaSum.OP_NAME, + inputsClass = CrossReplicaSum.Inputs.class +) +@Operator( + group = "tpu" +) public final class CrossReplicaSum extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +57,8 @@ public final class CrossReplicaSum extends RawOp implements O private Output output; - private CrossReplicaSum(Operation operation) { - super(operation); + public CrossReplicaSum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -86,4 +98,34 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = CrossReplicaSum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The local input to the sum. + */ + public final Operand input; + + /** + * An int32 tensor with shape + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the + * replica ids in the ith subgroup. + */ + public final Operand groupAssignment; + + /** + * The type of elements to be summed. + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new CrossReplicaSum<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + groupAssignment = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DTensorRestore.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DTensorRestore.java new file mode 100644 index 00000000000..6f432bb9bd7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DTensorRestore.java @@ -0,0 +1,164 @@ +/* Copyright 2018-2023 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.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * The DTensorRestoreV2 operation + */ +@OpMetadata( + opType = DTensorRestore.OP_NAME, + inputsClass = DTensorRestore.Inputs.class +) +@Operator( + group = "tpu" +) +public final class DTensorRestore extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DTensorRestoreV2"; + + private List> tensors; + + @SuppressWarnings("unchecked") + public DTensorRestore(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int tensorsLength = operation.outputListLength("tensors"); + tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength)); + outputIdx += tensorsLength; + } + + /** + * Factory method to create a class wrapping a new DTensorRestoreV2 operation. + * + * @param scope current scope + * @param prefix The prefix value + * @param tensorNames The tensorNames value + * @param shapeAndSlices The shapeAndSlices value + * @param inputShapes The value of the inputShapes attribute + * @param inputLayouts The value of the inputLayouts attribute + * @param dtypes The value of the dtypes attribute + * @return a new instance of DTensorRestore + */ + @Endpoint( + describeByClass = true + ) + public static DTensorRestore create(Scope scope, Operand prefix, + Operand tensorNames, Operand shapeAndSlices, List inputShapes, + List inputLayouts, List> dtypes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DTensorRestore"); + opBuilder.addInput(prefix.asOutput()); + opBuilder.addInput(tensorNames.asOutput()); + opBuilder.addInput(shapeAndSlices.asOutput()); + Shape[] inputShapesArray = new Shape[inputShapes.size()]; + for (int i = 0 ; i < inputShapesArray.length ; i++) { + inputShapesArray[i] = inputShapes.get(i); + } + opBuilder.setAttr("input_shapes", inputShapesArray); + String[] inputLayoutsArray = new String[inputLayouts.size()]; + for (int i = 0 ; i < inputLayoutsArray.length ; i++) { + inputLayoutsArray[i] = inputLayouts.get(i); + } + opBuilder.setAttr("input_layouts", inputLayoutsArray); + opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); + return new DTensorRestore(opBuilder.build()); + } + + /** + * Gets tensors. + * + * @return tensors. + */ + public List> tensors() { + return tensors; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) tensors.iterator(); + } + + @OpInputsMetadata( + outputsClass = DTensorRestore.class + ) + public static class Inputs extends RawOpInputs { + /** + * The prefix input + */ + public final Operand prefix; + + /** + * The tensorNames input + */ + public final Operand tensorNames; + + /** + * The shapeAndSlices input + */ + public final Operand shapeAndSlices; + + /** + * The inputShapes attribute + */ + public final Shape[] inputShapes; + + /** + * The inputLayouts attribute + */ + public final String[] inputLayouts; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + public Inputs(GraphOperation op) { + super(new DTensorRestore(op), op, Arrays.asList("input_shapes", "input_layouts", "dtypes")); + int inputIndex = 0; + prefix = (Operand) op.input(inputIndex++); + tensorNames = (Operand) op.input(inputIndex++); + shapeAndSlices = (Operand) op.input(inputIndex++); + inputShapes = op.attributes().getAttrShapeList("input_shapes"); + inputLayouts = op.attributes().getAttrStringList("input_layouts"); + dtypes = op.attributes().getAttrTypeList("dtypes"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.java new file mode 100644 index 00000000000..8badd319ee1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.java @@ -0,0 +1,289 @@ +/* Copyright 2018-2023 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.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; + +/** + * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). + * embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. + *

    The tensors at corresponding positions in the three input lists (sample_indices, + * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + */ +@OpMetadata( + opType = DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.OP_NAME, + inputsClass = DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) +public final class DynamicEnqueueTPUEmbeddingArbitraryTensorBatch extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicEnqueueTPUEmbeddingArbitraryTensorBatch"; + + public DynamicEnqueueTPUEmbeddingArbitraryTensorBatch(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new DynamicEnqueueTPUEmbeddingArbitraryTensorBatch operation. + * + * @param scope current scope + * @param sampleIndicesOrRowSplits A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param aggregationWeights A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @param options carries optional attribute values + * @return a new instance of DynamicEnqueueTPUEmbeddingArbitraryTensorBatch + */ + @Endpoint( + describeByClass = true + ) + public static DynamicEnqueueTPUEmbeddingArbitraryTensorBatch create(Scope scope, + Iterable> sampleIndicesOrRowSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Operand deviceOrdinal, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicEnqueueTPUEmbeddingArbitraryTensorBatch"); + opBuilder.addInputList(Operands.asOutputs(sampleIndicesOrRowSplits)); + opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); + opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); + opBuilder.addInput(modeOverride.asOutput()); + opBuilder.addInput(deviceOrdinal.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.combiners != null) { + String[] combinersArray = new String[opts.combiners.size()]; + for (int i = 0 ; i < combinersArray.length ; i++) { + combinersArray[i] = opts.combiners.get(i); + } + opBuilder.setAttr("combiners", combinersArray); + } + } + } + return new DynamicEnqueueTPUEmbeddingArbitraryTensorBatch(opBuilder.build()); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(List combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String... combiners) { + return new Options().combiners(combiners); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.DynamicEnqueueTPUEmbeddingArbitraryTensorBatch} + */ + public static class Options { + private List combiners; + + private Options() { + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + } + + @OpInputsMetadata( + outputsClass = DynamicEnqueueTPUEmbeddingArbitraryTensorBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + */ + public final Iterable> sampleIndicesOrRowSplits; + + /** + * A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + */ + public final Iterable> embeddingIndices; + + /** + * A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + */ + public final Iterable> aggregationWeights; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final Operand deviceOrdinal; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + public Inputs(GraphOperation op) { + super(new DynamicEnqueueTPUEmbeddingArbitraryTensorBatch(op), op, Arrays.asList("T1", "T2", "T3", "combiners")); + int inputIndex = 0; + int sampleIndicesOrRowSplitsLength = op.inputListLength("sample_indices_or_row_splits"); + sampleIndicesOrRowSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleIndicesOrRowSplitsLength)); + inputIndex += sampleIndicesOrRowSplitsLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + deviceOrdinal = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + combiners = op.attributes().getAttrStringList("combiners"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingRaggedTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingRaggedTensorBatch.java new file mode 100644 index 00000000000..48cd749fe92 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/DynamicEnqueueTPUEmbeddingRaggedTensorBatch.java @@ -0,0 +1,346 @@ +/* Copyright 2018-2023 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.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; + +/** + * The DynamicEnqueueTPUEmbeddingRaggedTensorBatch operation + */ +@OpMetadata( + opType = DynamicEnqueueTPUEmbeddingRaggedTensorBatch.OP_NAME, + inputsClass = DynamicEnqueueTPUEmbeddingRaggedTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) +public final class DynamicEnqueueTPUEmbeddingRaggedTensorBatch extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicEnqueueTPUEmbeddingRaggedTensorBatch"; + + public DynamicEnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new DynamicEnqueueTPUEmbeddingRaggedTensorBatch operation. + * + * @param scope current scope + * @param sampleSplits The sampleSplits value + * @param embeddingIndices The embeddingIndices value + * @param aggregationWeights The aggregationWeights value + * @param modeOverride The modeOverride value + * @param deviceOrdinal The deviceOrdinal value + * @param tableIds The value of the tableIds attribute + * @param options carries optional attribute values + * @return a new instance of DynamicEnqueueTPUEmbeddingRaggedTensorBatch + */ + @Endpoint( + describeByClass = true + ) + public static DynamicEnqueueTPUEmbeddingRaggedTensorBatch create(Scope scope, + Iterable> sampleSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Operand deviceOrdinal, List tableIds, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicEnqueueTPUEmbeddingRaggedTensorBatch"); + opBuilder.addInputList(Operands.asOutputs(sampleSplits)); + opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); + opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); + opBuilder.addInput(modeOverride.asOutput()); + opBuilder.addInput(deviceOrdinal.asOutput()); + long[] tableIdsArray = new long[tableIds.size()]; + for (int i = 0 ; i < tableIdsArray.length ; i++) { + tableIdsArray[i] = tableIds.get(i); + } + opBuilder.setAttr("table_ids", tableIdsArray); + if (options != null) { + for (Options opts : options) { + if (opts.combiners != null) { + String[] combinersArray = new String[opts.combiners.size()]; + for (int i = 0 ; i < combinersArray.length ; i++) { + combinersArray[i] = opts.combiners.get(i); + } + opBuilder.setAttr("combiners", combinersArray); + } + if (opts.maxSequenceLengths != null) { + long[] maxSequenceLengthsArray = new long[opts.maxSequenceLengths.size()]; + for (int i = 0 ; i < maxSequenceLengthsArray.length ; i++) { + maxSequenceLengthsArray[i] = opts.maxSequenceLengths.get(i); + } + opBuilder.setAttr("max_sequence_lengths", maxSequenceLengthsArray); + } + if (opts.numFeatures != null) { + long[] numFeaturesArray = new long[opts.numFeatures.size()]; + for (int i = 0 ; i < numFeaturesArray.length ; i++) { + numFeaturesArray[i] = opts.numFeatures.get(i); + } + opBuilder.setAttr("num_features", numFeaturesArray); + } + } + } + return new DynamicEnqueueTPUEmbeddingRaggedTensorBatch(opBuilder.build()); + } + + /** + * Sets the combiners option. + * + * @param combiners the combiners option + * @return this Options instance. + */ + public static Options combiners(List combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the combiners option. + * + * @param combiners the combiners option + * @return this Options instance. + */ + public static Options combiners(String... combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public static Options maxSequenceLengths(List maxSequenceLengths) { + return new Options().maxSequenceLengths(maxSequenceLengths); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public static Options maxSequenceLengths(Long... maxSequenceLengths) { + return new Options().maxSequenceLengths(maxSequenceLengths); + } + + /** + * Sets the numFeatures option. + * + * @param numFeatures the numFeatures option + * @return this Options instance. + */ + public static Options numFeatures(List numFeatures) { + return new Options().numFeatures(numFeatures); + } + + /** + * Sets the numFeatures option. + * + * @param numFeatures the numFeatures option + * @return this Options instance. + */ + public static Options numFeatures(Long... numFeatures) { + return new Options().numFeatures(numFeatures); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.DynamicEnqueueTPUEmbeddingRaggedTensorBatch} + */ + public static class Options { + private List combiners; + + private List maxSequenceLengths; + + private List numFeatures; + + private Options() { + } + + /** + * Sets the combiners option. + * + * @param combiners the combiners option + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners the combiners option + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(List maxSequenceLengths) { + this.maxSequenceLengths = maxSequenceLengths; + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(Long... maxSequenceLengths) { + this.maxSequenceLengths = Arrays.asList(maxSequenceLengths); + return this; + } + + /** + * Sets the numFeatures option. + * + * @param numFeatures the numFeatures option + * @return this Options instance. + */ + public Options numFeatures(List numFeatures) { + this.numFeatures = numFeatures; + return this; + } + + /** + * Sets the numFeatures option. + * + * @param numFeatures the numFeatures option + * @return this Options instance. + */ + public Options numFeatures(Long... numFeatures) { + this.numFeatures = Arrays.asList(numFeatures); + return this; + } + } + + @OpInputsMetadata( + outputsClass = DynamicEnqueueTPUEmbeddingRaggedTensorBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * The sampleSplits input + */ + public final Iterable> sampleSplits; + + /** + * The embeddingIndices input + */ + public final Iterable> embeddingIndices; + + /** + * The aggregationWeights input + */ + public final Iterable> aggregationWeights; + + /** + * The modeOverride input + */ + public final Operand modeOverride; + + /** + * The deviceOrdinal input + */ + public final Operand deviceOrdinal; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * The combiners attribute + */ + public final String[] combiners; + + /** + * The tableIds attribute + */ + public final long[] tableIds; + + /** + * The maxSequenceLengths attribute + */ + public final long[] maxSequenceLengths; + + /** + * The numFeatures attribute + */ + public final long[] numFeatures; + + public Inputs(GraphOperation op) { + super(new DynamicEnqueueTPUEmbeddingRaggedTensorBatch(op), op, Arrays.asList("T1", "T2", "T3", "combiners", "table_ids", "max_sequence_lengths", "num_features")); + int inputIndex = 0; + int sampleSplitsLength = op.inputListLength("sample_splits"); + sampleSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleSplitsLength)); + inputIndex += sampleSplitsLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + deviceOrdinal = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + combiners = op.attributes().getAttrStringList("combiners"); + tableIds = op.attributes().getAttrIntList("table_ids"); + maxSequenceLengths = op.attributes().getAttrIntList("max_sequence_lengths"); + numFeatures = op.attributes().getAttrIntList("num_features"); + } + } +} 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 index 0c98c598a4c..b952f8edcae 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -34,6 +40,13 @@ * differentiation of graphs containing embeddings via the TPU Embedding Python * libraries. */ +@OpMetadata( + opType = EmbeddingActivations.OP_NAME, + inputsClass = EmbeddingActivations.Inputs.class +) +@Operator( + group = "tpu" +) public final class EmbeddingActivations extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class EmbeddingActivations extends RawOp implements Operand output; - private EmbeddingActivations(Operation operation) { - super(operation); + public EmbeddingActivations(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -86,4 +99,40 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = EmbeddingActivations.class + ) + public static class Inputs extends RawOpInputs { + /** + * A trainable variable, enabling optimizers to find this op. + */ + public final Operand embeddingVariable; + + /** + * The embedding activations Tensor to return. + */ + public final Operand slicedActivations; + + /** + * The id of the table in the embedding layer configuration from which + * these activations were computed. + */ + public final long tableId; + + /** + * Identifier of the set of embedding indices which produced these + * activations. + */ + public final long lookupId; + + public Inputs(GraphOperation op) { + super(new EmbeddingActivations(op), op, Arrays.asList("table_id", "lookup_id")); + int inputIndex = 0; + embeddingVariable = (Operand) op.input(inputIndex++); + slicedActivations = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + lookupId = op.attributes().getAttrInt("lookup_id"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingArbitraryTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingArbitraryTensorBatch.java new file mode 100644 index 00000000000..248871292ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingArbitraryTensorBatch.java @@ -0,0 +1,313 @@ +/* Copyright 2018-2023 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.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; + +/** + * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). + * embedding_indices[i] and aggregation_weights[i] correspond + * to the ith feature. + *

    The tensors at corresponding positions in the three input lists (sample_indices, + * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 + * with dim_size() equal to the total number of lookups into the table described by + * the corresponding feature. + */ +@OpMetadata( + opType = EnqueueTPUEmbeddingArbitraryTensorBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingArbitraryTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) +public final class EnqueueTPUEmbeddingArbitraryTensorBatch extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EnqueueTPUEmbeddingArbitraryTensorBatch"; + + public EnqueueTPUEmbeddingArbitraryTensorBatch(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new EnqueueTPUEmbeddingArbitraryTensorBatch operation. + * + * @param scope current scope + * @param sampleIndicesOrRowSplits A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param embeddingIndices A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + * @param aggregationWeights A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingArbitraryTensorBatch + */ + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingArbitraryTensorBatch create(Scope scope, + Iterable> sampleIndicesOrRowSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingArbitraryTensorBatch"); + opBuilder.addInputList(Operands.asOutputs(sampleIndicesOrRowSplits)); + opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); + opBuilder.addInputList(Operands.asOutputs(aggregationWeights)); + opBuilder.addInput(modeOverride.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.deviceOrdinal != null) { + opBuilder.setAttr("device_ordinal", opts.deviceOrdinal); + } + if (opts.combiners != null) { + String[] combinersArray = new String[opts.combiners.size()]; + for (int i = 0 ; i < combinersArray.length ; i++) { + combinersArray[i] = opts.combiners.get(i); + } + opBuilder.setAttr("combiners", combinersArray); + } + } + } + return new EnqueueTPUEmbeddingArbitraryTensorBatch(opBuilder.build()); + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public static Options deviceOrdinal(Long deviceOrdinal) { + return new Options().deviceOrdinal(deviceOrdinal); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(List combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String... combiners) { + return new Options().combiners(combiners); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingArbitraryTensorBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingArbitraryTensorBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of rank 2 Tensors specifying the training example to which the + * corresponding embedding_indices and aggregation_weights values belong. + * If the size of its first dimension is 0, we assume each embedding_indices + * belongs to a different sample. Both int32 and int64 are allowed and will + * be converted to int32 internally. + *

    Or a list of rank 1 Tensors specifying the row splits for splitting + * embedding_indices and aggregation_weights into rows. It corresponds to + * ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When + * enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged. + * the row splits is 1-D dense tensor. When empty, we assume a dense tensor is + * passed to the op Both int32 and int64 are allowed and will be converted to + * int32 internally. + */ + public final Iterable> sampleIndicesOrRowSplits; + + /** + * A list of rank 1 Tensors, indices into the embedding + * tables. Both int32 and int64 are allowed and will be converted to + * int32 internally. + */ + public final Iterable> embeddingIndices; + + /** + * A list of rank 1 Tensors containing per training + * example aggregation weights. Both float32 and float64 are allowed and will + * be converted to float32 internally. + */ + public final Iterable> aggregationWeights; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final long deviceOrdinal; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingArbitraryTensorBatch(op), op, Arrays.asList("T1", "T2", "T3", "device_ordinal", "combiners")); + int inputIndex = 0; + int sampleIndicesOrRowSplitsLength = op.inputListLength("sample_indices_or_row_splits"); + sampleIndicesOrRowSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleIndicesOrRowSplitsLength)); + inputIndex += sampleIndicesOrRowSplitsLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + combiners = op.attributes().getAttrStringList("combiners"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingBatch.java new file mode 100644 index 00000000000..811be9baee8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingBatch.java @@ -0,0 +1,244 @@ +/* Copyright 2018-2023 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.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that enqueues a list of input batch tensors to TPUEmbedding. + * An op that enqueues a list of input batch tensors to TPUEmbedding. + */ +@OpMetadata( + opType = EnqueueTPUEmbeddingBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingBatch.Inputs.class +) +@Operator( + group = "tpu" +) +public final class EnqueueTPUEmbeddingBatch extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EnqueueTPUEmbeddingBatch"; + + public EnqueueTPUEmbeddingBatch(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new EnqueueTPUEmbeddingBatch operation. + * + * @param scope current scope + * @param batch A list of 1D tensors, one for each embedding table, containing the + * batch inputs encoded as dist_belief.SparseFeatures protos. If the weight + * field in the SparseFeatures proto is not populated for an ID, a weight of + * 1.0 is assumed. + * @param modeOverride A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + * @param options carries optional attribute values + * @return a new instance of EnqueueTPUEmbeddingBatch + */ + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingBatch create(Scope scope, Iterable> batch, + Operand modeOverride, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "EnqueueTPUEmbeddingBatch"); + opBuilder.addInputList(Operands.asOutputs(batch)); + opBuilder.addInput(modeOverride.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.deviceOrdinal != null) { + opBuilder.setAttr("device_ordinal", opts.deviceOrdinal); + } + if (opts.combiners != null) { + String[] combinersArray = new String[opts.combiners.size()]; + for (int i = 0 ; i < combinersArray.length ; i++) { + combinersArray[i] = opts.combiners.get(i); + } + opBuilder.setAttr("combiners", combinersArray); + } + } + } + return new EnqueueTPUEmbeddingBatch(opBuilder.build()); + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal 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. + * @return this Options instance. + */ + public static Options deviceOrdinal(Long deviceOrdinal) { + return new Options().deviceOrdinal(deviceOrdinal); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(List combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String... combiners) { + return new Options().combiners(combiners); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal 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. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of 1D tensors, one for each embedding table, containing the + * batch inputs encoded as dist_belief.SparseFeatures protos. If the weight + * field in the SparseFeatures proto is not populated for an ID, a weight of + * 1.0 is assumed. + */ + public final Iterable> batch; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * 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. + */ + public final long deviceOrdinal; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingBatch(op), op, Arrays.asList("device_ordinal", "combiners")); + int inputIndex = 0; + int batchLength = op.inputListLength("batch"); + batch = Arrays.asList((Operand[]) op.inputList(inputIndex, batchLength)); + inputIndex += batchLength; + modeOverride = (Operand) op.input(inputIndex++); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + combiners = op.attributes().getAttrStringList("combiners"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java index d80625786c5..e68de9fd067 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,27 +17,40 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; /** * An op that enqueues a list of input batch tensors to TPUEmbedding. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingIntegerBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingIntegerBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingIntegerBatch extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "EnqueueTPUEmbeddingIntegerBatch"; - private EnqueueTPUEmbeddingIntegerBatch(Operation operation) { - super(operation); + public EnqueueTPUEmbeddingIntegerBatch(Operation operation) { + super(operation, OP_NAME); } /** @@ -103,4 +116,39 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingIntegerBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of 1D tensors, one for each embedding table, containing the + * indices into the tables. + */ + public final Iterable> batch; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingIntegerBatch(op), op, Arrays.asList("device_ordinal")); + int inputIndex = 0; + int batchLength = op.inputListLength("batch"); + batch = Arrays.asList((Operand[]) op.inputList(inputIndex, batchLength)); + inputIndex += batchLength; + modeOverride = (Operand) op.input(inputIndex++); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java index e63d8e5e7c1..14853b93ac7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -39,14 +45,21 @@ * with dim_size() equal to the total number of lookups into the table described by * the corresponding feature. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingRaggedTensorBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingRaggedTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingRaggedTensorBatch extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "EnqueueTPUEmbeddingRaggedTensorBatch"; - private EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { - super(operation); + public EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { + super(operation, OP_NAME); } /** @@ -161,7 +174,7 @@ public static Options combiners(List combiners) { * all tables. * @return this Options instance. */ - public static Options combiners(String[] combiners) { + public static Options combiners(String... combiners) { return new Options().combiners(combiners); } @@ -181,7 +194,7 @@ public static Options maxSequenceLengths(List maxSequenceLengths) { * @param maxSequenceLengths the maxSequenceLengths option * @return this Options instance. */ - public static Options maxSequenceLengths(Long[] maxSequenceLengths) { + public static Options maxSequenceLengths(Long... maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } @@ -201,7 +214,7 @@ public static Options numFeatures(List numFeatures) { * @param numFeatures the numFeatures option * @return this Options instance. */ - public static Options numFeatures(Long[] numFeatures) { + public static Options numFeatures(Long... numFeatures) { return new Options().numFeatures(numFeatures); } @@ -308,4 +321,112 @@ public Options numFeatures(Long... numFeatures) { return this; } } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingRaggedTensorBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of rank 1 Tensors specifying the break points for splitting + * embedding_indices and aggregation_weights into rows. + * It corresponds to ids.row_splits in embedding_lookup(), when ids is a + * RaggedTensor. + */ + public final Iterable> sampleSplits; + + /** + * A list of rank 1 Tensors, indices into the embedding tables. + * It corresponds to ids.values in embedding_lookup(), when ids is a RaggedTensor. + */ + public final Iterable> embeddingIndices; + + /** + * A list of rank 1 Tensors containing per training example + * aggregation weights. It corresponds to the values field of a RaggedTensor + * with the same row_splits as ids in embedding_lookup(), when ids is a + * RaggedTensor. + */ + public final Iterable> aggregationWeights; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final long deviceOrdinal; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + /** + * A list of integers specifying the identifier of the embedding table + * (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the + * corresponding input. The ith input is looked up using table_ids[i]. The size + * of the table_ids list must be equal to that of sample_indices, + * embedding_indices and aggregation_weights. + */ + public final long[] tableIds; + + /** + * The maxSequenceLengths attribute + */ + public final long[] maxSequenceLengths; + + /** + * The numFeatures attribute + */ + public final long[] numFeatures; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingRaggedTensorBatch(op), op, Arrays.asList("T1", "T2", "T3", "device_ordinal", "combiners", "table_ids", "max_sequence_lengths", "num_features")); + int inputIndex = 0; + int sampleSplitsLength = op.inputListLength("sample_splits"); + sampleSplits = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleSplitsLength)); + inputIndex += sampleSplitsLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + combiners = op.attributes().getAttrStringList("combiners"); + tableIds = op.attributes().getAttrIntList("table_ids"); + maxSequenceLengths = op.attributes().getAttrIntList("max_sequence_lengths"); + numFeatures = op.attributes().getAttrIntList("num_features"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java index af6164c23e5..9c78459892d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -40,14 +46,21 @@ * must have the same shape, i.e. rank 1 with dim_size() equal to the total * number of lookups into the table described by the corresponding table_id. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingSparseBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingSparseBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingSparseBatch extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "EnqueueTPUEmbeddingSparseBatch"; - private EnqueueTPUEmbeddingSparseBatch(Operation operation) { - super(operation); + public EnqueueTPUEmbeddingSparseBatch(Operation operation) { + super(operation, OP_NAME); } /** @@ -136,7 +149,7 @@ public static Options combiners(List combiners) { * all tables. * @return this Options instance. */ - public static Options combiners(String[] combiners) { + public static Options combiners(String... combiners) { return new Options().combiners(combiners); } @@ -195,4 +208,88 @@ public Options combiners(String... combiners) { return this; } } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingSparseBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of rank 1 Tensors specifying the training example and + * feature to which the corresponding embedding_indices and aggregation_weights + * values belong. sample_indices[i] must equal b * nf + f, where nf is the + * number of features from the corresponding table, f is in [0, nf), and + * b is in [0, batch size). + */ + public final Iterable> sampleIndices; + + /** + * A list of rank 1 Tensors, indices into the embedding tables. + */ + public final Iterable> embeddingIndices; + + /** + * A list of rank 1 Tensors containing per sample -- i.e. per + * (training example, feature) -- aggregation weights. + */ + public final Iterable> aggregationWeights; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final long deviceOrdinal; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingSparseBatch(op), op, Arrays.asList("T1", "T2", "T3", "device_ordinal", "combiners")); + int inputIndex = 0; + int sampleIndicesLength = op.inputListLength("sample_indices"); + sampleIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleIndicesLength)); + inputIndex += sampleIndicesLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + combiners = op.attributes().getAttrStringList("combiners"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java index a153a5c005e..40c6df43f92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,13 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; @@ -39,14 +45,21 @@ * with dim_size() equal to the total number of lookups into the table described by * the corresponding feature. */ +@OpMetadata( + opType = EnqueueTPUEmbeddingSparseTensorBatch.OP_NAME, + inputsClass = EnqueueTPUEmbeddingSparseTensorBatch.Inputs.class +) +@Operator( + group = "tpu" +) public final class EnqueueTPUEmbeddingSparseTensorBatch extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "EnqueueTPUEmbeddingSparseTensorBatch"; - private EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { - super(operation); + public EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { + super(operation, OP_NAME); } /** @@ -159,7 +172,7 @@ public static Options combiners(List combiners) { * all tables. * @return this Options instance. */ - public static Options combiners(String[] combiners) { + public static Options combiners(String... combiners) { return new Options().combiners(combiners); } @@ -179,7 +192,7 @@ public static Options maxSequenceLengths(List maxSequenceLengths) { * @param maxSequenceLengths the maxSequenceLengths option * @return this Options instance. */ - public static Options maxSequenceLengths(Long[] maxSequenceLengths) { + public static Options maxSequenceLengths(Long... maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } @@ -199,7 +212,7 @@ public static Options numFeatures(List numFeatures) { * @param numFeatures the numFeatures option * @return this Options instance. */ - public static Options numFeatures(Long[] numFeatures) { + public static Options numFeatures(Long... numFeatures) { return new Options().numFeatures(numFeatures); } @@ -306,4 +319,110 @@ public Options numFeatures(Long... numFeatures) { return this; } } + + @OpInputsMetadata( + outputsClass = EnqueueTPUEmbeddingSparseTensorBatch.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of rank 1 Tensors specifying the training example to + * which the corresponding embedding_indices and aggregation_weights values + * belong. It corresponds to sp_ids.indices[:,0] in embedding_lookup_sparse(). + */ + public final Iterable> sampleIndices; + + /** + * A list of rank 1 Tensors, indices into the embedding tables. + * It corresponds to sp_ids.values in embedding_lookup_sparse(). + */ + public final Iterable> embeddingIndices; + + /** + * A list of rank 1 Tensors containing per training example + * aggregation weights. It corresponds to sp_weights.values in + * embedding_lookup_sparse(). + */ + public final Iterable> aggregationWeights; + + /** + * A string input that overrides the mode specified in the + * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', + * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set + * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. + */ + public final Operand modeOverride; + + /** + * The T1 attribute + */ + public final DataType T1; + + /** + * The T2 attribute + */ + public final DataType T2; + + /** + * The T3 attribute + */ + public final DataType T3; + + /** + * The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + */ + public final long deviceOrdinal; + + /** + * A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + */ + public final String[] combiners; + + /** + * A list of integers specifying the identifier of the embedding table + * (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the + * corresponding input. The ith input is looked up using table_ids[i]. The size + * of the table_ids list must be equal to that of sample_indices, + * embedding_indices and aggregation_weights. + */ + public final long[] tableIds; + + /** + * The maxSequenceLengths attribute + */ + public final long[] maxSequenceLengths; + + /** + * The numFeatures attribute + */ + public final long[] numFeatures; + + public Inputs(GraphOperation op) { + super(new EnqueueTPUEmbeddingSparseTensorBatch(op), op, Arrays.asList("T1", "T2", "T3", "device_ordinal", "combiners", "table_ids", "max_sequence_lengths", "num_features")); + int inputIndex = 0; + int sampleIndicesLength = op.inputListLength("sample_indices"); + sampleIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sampleIndicesLength)); + inputIndex += sampleIndicesLength; + int embeddingIndicesLength = op.inputListLength("embedding_indices"); + embeddingIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, embeddingIndicesLength)); + inputIndex += embeddingIndicesLength; + int aggregationWeightsLength = op.inputListLength("aggregation_weights"); + aggregationWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, aggregationWeightsLength)); + inputIndex += aggregationWeightsLength; + modeOverride = (Operand) op.input(inputIndex++); + T1 = op.attributes().getAttrType("T1"); + T2 = op.attributes().getAttrType("T2"); + T3 = op.attributes().getAttrType("T3"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + combiners = op.attributes().getAttrStringList("combiners"); + tableIds = op.attributes().getAttrIntList("table_ids"); + maxSequenceLengths = op.attributes().getAttrIntList("max_sequence_lengths"); + numFeatures = op.attributes().getAttrIntList("num_features"); + } + } } 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 index d525ac67f35..db394384a6f 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -36,6 +41,10 @@ * Op that loads and executes a TPU program on a TPU device. * For the internal use of the distributed TPU compiler. */ +@OpMetadata( + opType = Execute.OP_NAME, + inputsClass = Execute.Inputs.class +) @Operator( group = "tpu" ) @@ -48,8 +57,8 @@ public final class Execute extends RawOp implements Iterable> { private List> results; @SuppressWarnings("unchecked") - private Execute(Operation operation) { - super(operation); + public Execute(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int resultsLength = operation.outputListLength("results"); results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); @@ -60,9 +69,9 @@ private Execute(Operation operation) { * Factory method to create a class wrapping a new TPUExecute operation. * * @param scope current scope - * @param args the args value - * @param key the key value - * @param Tresults the value of the Tresults property + * @param args The args value + * @param key The key value + * @param Tresults The value of the Tresults attribute * @return a new instance of Execute */ @Endpoint( @@ -91,4 +100,40 @@ public List> results() { public Iterator> iterator() { return (Iterator) results.iterator(); } + + @OpInputsMetadata( + outputsClass = Execute.class + ) + public static class Inputs extends RawOpInputs { + /** + * The args input + */ + public final Iterable> args; + + /** + * The key input + */ + public final Operand key; + + /** + * The Targs attribute + */ + public final DataType[] Targs; + + /** + * The Tresults attribute + */ + public final DataType[] Tresults; + + public Inputs(GraphOperation op) { + super(new Execute(op), op, Arrays.asList("Targs", "Tresults")); + int inputIndex = 0; + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + key = (Operand) op.input(inputIndex++); + Targs = op.attributes().getAttrTypeList("Targs"); + Tresults = op.attributes().getAttrTypeList("Tresults"); + } + } } 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 index 9b3cbe0100e..83983a299cf 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -42,6 +47,10 @@ * program outputs are consumed by these variables will not appear in the op * output. For the internal use of the distributed TPU compiler. */ +@OpMetadata( + opType = ExecuteAndUpdateVariables.OP_NAME, + inputsClass = ExecuteAndUpdateVariables.Inputs.class +) @Operator( group = "tpu" ) @@ -54,8 +63,8 @@ public final class ExecuteAndUpdateVariables extends RawOp implements Iterable> results; @SuppressWarnings("unchecked") - private ExecuteAndUpdateVariables(Operation operation) { - super(operation); + public ExecuteAndUpdateVariables(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int resultsLength = operation.outputListLength("results"); results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); @@ -66,11 +75,11 @@ private ExecuteAndUpdateVariables(Operation operation) { * Factory method to create a class wrapping a new TPUExecuteAndUpdateVariables operation. * * @param scope current scope - * @param args the args value - * @param key the key value - * @param Tresults the value of the Tresults property - * @param deviceVarReadsIndices the value of the deviceVarReadsIndices property - * @param deviceVarUpdatesIndices the value of the deviceVarUpdatesIndices property + * @param args The args value + * @param key The key value + * @param Tresults The value of the Tresults attribute + * @param deviceVarReadsIndices The value of the deviceVarReadsIndices attribute + * @param deviceVarUpdatesIndices The value of the deviceVarUpdatesIndices attribute * @return a new instance of ExecuteAndUpdateVariables */ @Endpoint( @@ -110,4 +119,52 @@ public List> results() { public Iterator> iterator() { return (Iterator) results.iterator(); } + + @OpInputsMetadata( + outputsClass = ExecuteAndUpdateVariables.class + ) + public static class Inputs extends RawOpInputs { + /** + * The args input + */ + public final Iterable> args; + + /** + * The key input + */ + public final Operand key; + + /** + * The Targs attribute + */ + public final DataType[] Targs; + + /** + * The Tresults attribute + */ + public final DataType[] Tresults; + + /** + * The deviceVarReadsIndices attribute + */ + public final long[] deviceVarReadsIndices; + + /** + * The deviceVarUpdatesIndices attribute + */ + public final long[] deviceVarUpdatesIndices; + + public Inputs(GraphOperation op) { + super(new ExecuteAndUpdateVariables(op), op, Arrays.asList("Targs", "Tresults", "device_var_reads_indices", "device_var_updates_indices")); + int inputIndex = 0; + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + key = (Operand) op.input(inputIndex++); + Targs = op.attributes().getAttrTypeList("Targs"); + Tresults = op.attributes().getAttrTypeList("Tresults"); + deviceVarReadsIndices = op.attributes().getAttrIntList("device_var_reads_indices"); + deviceVarUpdatesIndices = op.attributes().getAttrIntList("device_var_updates_indices"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteTPUEmbeddingPartitioner.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteTPUEmbeddingPartitioner.java new file mode 100644 index 00000000000..621cd583d18 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteTPUEmbeddingPartitioner.java @@ -0,0 +1,109 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that executes the TPUEmbedding partitioner on the central configuration + * device and computes the HBM size (in bytes) required for TPUEmbedding operation. + */ +@OpMetadata( + opType = ExecuteTPUEmbeddingPartitioner.OP_NAME, + inputsClass = ExecuteTPUEmbeddingPartitioner.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ExecuteTPUEmbeddingPartitioner extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExecuteTPUEmbeddingPartitioner"; + + private Output commonConfig; + + public ExecuteTPUEmbeddingPartitioner(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + commonConfig = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExecuteTPUEmbeddingPartitioner operation. + * + * @param scope current scope + * @param config An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + * @return a new instance of ExecuteTPUEmbeddingPartitioner + */ + @Endpoint( + describeByClass = true + ) + public static ExecuteTPUEmbeddingPartitioner create(Scope scope, String config) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ExecuteTPUEmbeddingPartitioner"); + opBuilder.setAttr("config", config); + return new ExecuteTPUEmbeddingPartitioner(opBuilder.build()); + } + + /** + * Gets commonConfig. + * A string-encoded common configuration proto + * containing metadata about the TPUEmbedding partitioner output and + * the HBM size (in bytes) required for operation. + * @return commonConfig. + */ + public Output commonConfig() { + return commonConfig; + } + + @Override + public Output asOutput() { + return commonConfig; + } + + @OpInputsMetadata( + outputsClass = ExecuteTPUEmbeddingPartitioner.class + ) + public static class Inputs extends RawOpInputs { + /** + * An TPUEmbeddingConfiguration proto serialized to a string, + * describing the desired TPUEmbedding configuration. + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new ExecuteTPUEmbeddingPartitioner(op), op, Arrays.asList("config")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/FinalizeTPUEmbedding.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/FinalizeTPUEmbedding.java new file mode 100644 index 00000000000..db44a52d05b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/FinalizeTPUEmbedding.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + * An op that finalizes the TPUEmbedding configuration. + */ +@OpMetadata( + opType = FinalizeTPUEmbedding.OP_NAME, + inputsClass = FinalizeTPUEmbedding.Inputs.class +) +@Operator( + group = "tpu" +) +public final class FinalizeTPUEmbedding extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FinalizeTPUEmbeddingV2"; + + private Output embeddingPartitions; + + private Output hbmBuffersConfig; + + public FinalizeTPUEmbedding(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + embeddingPartitions = operation.output(outputIdx++); + hbmBuffersConfig = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FinalizeTPUEmbeddingV2 operation. + * + * @param scope current scope + * @param commonConfig A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + * @param memoryConfig A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + * @return a new instance of FinalizeTPUEmbedding + */ + @Endpoint( + describeByClass = true + ) + public static FinalizeTPUEmbedding create(Scope scope, Operand commonConfig, + Operand memoryConfig) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "FinalizeTPUEmbedding"); + opBuilder.addInput(commonConfig.asOutput()); + opBuilder.addInput(memoryConfig.asOutput()); + return new FinalizeTPUEmbedding(opBuilder.build()); + } + + /** + * Gets embeddingPartitions. + * A string-encoded embedding partitions proto describing how embedding tables are + * partitioned along their feature and ID. + * @return embeddingPartitions. + */ + public Output embeddingPartitions() { + return embeddingPartitions; + } + + /** + * Gets hbmBuffersConfig. + * A string-encoded HBM buffers config proto specifies where HBM buffers are + * located. + * @return hbmBuffersConfig. + */ + public Output hbmBuffersConfig() { + return hbmBuffersConfig; + } + + @OpInputsMetadata( + outputsClass = FinalizeTPUEmbedding.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string-encoded common configuration proto containing metadata + * about the TPUEmbedding partitioner output and the HBM size (in bytes) required + * for operation. + */ + public final Operand commonConfig; + + /** + * A string-encoded memory config proto containing metadata about + * the memory allocations reserved for TPUEmbedding. + */ + public final Operand memoryConfig; + + public Inputs(GraphOperation op) { + super(new FinalizeTPUEmbedding(op), op, Arrays.asList()); + int inputIndex = 0; + commonConfig = (Operand) op.input(inputIndex++); + memoryConfig = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchSplitsWithPhysicalReplica.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchSplitsWithPhysicalReplica.java new file mode 100644 index 00000000000..7746ebadb48 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchSplitsWithPhysicalReplica.java @@ -0,0 +1,257 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; + +/** + * The GetMinibatchSplitsWithPhysicalReplica operation + */ +@OpMetadata( + opType = GetMinibatchSplitsWithPhysicalReplica.OP_NAME, + inputsClass = GetMinibatchSplitsWithPhysicalReplica.Inputs.class +) +@Operator( + group = "tpu" +) +public final class GetMinibatchSplitsWithPhysicalReplica extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetMinibatchSplitsWithPhysicalReplica"; + + private Output sortedRowIds; + + private Output sortedColIds; + + private Output sortedGains; + + private Output splits; + + private Output idCounts; + + private Output maxIds; + + private Output maxUniques; + + public GetMinibatchSplitsWithPhysicalReplica(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + sortedRowIds = operation.output(outputIdx++); + sortedColIds = operation.output(outputIdx++); + sortedGains = operation.output(outputIdx++); + splits = operation.output(outputIdx++); + idCounts = operation.output(outputIdx++); + maxIds = operation.output(outputIdx++); + maxUniques = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetMinibatchSplitsWithPhysicalReplica operation. + * + * @param scope current scope + * @param programKey The programKey value + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param gains The gains value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchSplits The value of the miniBatchSplits attribute + * @return a new instance of GetMinibatchSplitsWithPhysicalReplica + */ + @Endpoint( + describeByClass = true + ) + public static GetMinibatchSplitsWithPhysicalReplica create(Scope scope, + Operand programKey, Operand rowIds, Operand colIds, + Operand gains, Long sampleCount, Long numReplica, Long tableVocabSize, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchSplits) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetMinibatchSplitsWithPhysicalReplica"); + opBuilder.addInput(programKey.asOutput()); + opBuilder.addInput(rowIds.asOutput()); + opBuilder.addInput(colIds.asOutput()); + opBuilder.addInput(gains.asOutput()); + opBuilder.setAttr("sample_count", sampleCount); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("table_vocab_size", tableVocabSize); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("table_name", tableName); + opBuilder.setAttr("mini_batch_splits", miniBatchSplits); + return new GetMinibatchSplitsWithPhysicalReplica(opBuilder.build()); + } + + /** + * Gets sortedRowIds. + * + * @return sortedRowIds. + */ + public Output sortedRowIds() { + return sortedRowIds; + } + + /** + * Gets sortedColIds. + * + * @return sortedColIds. + */ + public Output sortedColIds() { + return sortedColIds; + } + + /** + * Gets sortedGains. + * + * @return sortedGains. + */ + public Output sortedGains() { + return sortedGains; + } + + /** + * Gets splits. + * + * @return splits. + */ + public Output splits() { + return splits; + } + + /** + * Gets idCounts. + * + * @return idCounts. + */ + public Output idCounts() { + return idCounts; + } + + /** + * Gets maxIds. + * + * @return maxIds. + */ + public Output maxIds() { + return maxIds; + } + + /** + * Gets maxUniques. + * + * @return maxUniques. + */ + public Output maxUniques() { + return maxUniques; + } + + @OpInputsMetadata( + outputsClass = GetMinibatchSplitsWithPhysicalReplica.class + ) + public static class Inputs extends RawOpInputs { + /** + * The programKey input + */ + public final Operand programKey; + + /** + * The rowIds input + */ + public final Operand rowIds; + + /** + * The colIds input + */ + public final Operand colIds; + + /** + * The gains input + */ + public final Operand gains; + + /** + * The sampleCount attribute + */ + public final long sampleCount; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The tableVocabSize attribute + */ + public final long tableVocabSize; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The numScPerChip attribute + */ + public final long numScPerChip; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The miniBatchSplits attribute + */ + public final String miniBatchSplits; + + public Inputs(GraphOperation op) { + super(new GetMinibatchSplitsWithPhysicalReplica(op), op, Arrays.asList("sample_count", "num_replica", "table_vocab_size", "feature_width", "num_sc_per_chip", "table_name", "mini_batch_splits")); + int inputIndex = 0; + programKey = (Operand) op.input(inputIndex++); + rowIds = (Operand) op.input(inputIndex++); + colIds = (Operand) op.input(inputIndex++); + gains = (Operand) op.input(inputIndex++); + sampleCount = op.attributes().getAttrInt("sample_count"); + numReplica = op.attributes().getAttrInt("num_replica"); + tableVocabSize = op.attributes().getAttrInt("table_vocab_size"); + featureWidth = op.attributes().getAttrInt("feature_width"); + numScPerChip = op.attributes().getAttrInt("num_sc_per_chip"); + tableName = op.attributes().getAttrString("table_name"); + miniBatchSplits = op.attributes().getAttrString("mini_batch_splits"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchesInCsrWithPhysicalReplica.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchesInCsrWithPhysicalReplica.java new file mode 100644 index 00000000000..d51f1c3959f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetMinibatchesInCsrWithPhysicalReplica.java @@ -0,0 +1,290 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; + +/** + * The GetMinibatchesInCsrWithPhysicalReplica operation + */ +@OpMetadata( + opType = GetMinibatchesInCsrWithPhysicalReplica.OP_NAME, + inputsClass = GetMinibatchesInCsrWithPhysicalReplica.Inputs.class +) +@Operator( + group = "tpu" +) +public final class GetMinibatchesInCsrWithPhysicalReplica extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetMinibatchesInCsrWithPhysicalReplica"; + + private Output rowPointers; + + private Output sortedSampleIds; + + private Output sortedTokenIds; + + private Output sortedGains; + + private Output rowPointersUnpaddedSize; + + private Output idsUnpaddedSize; + + private Output numMinibatchesPerPhysicalSparseCore; + + public GetMinibatchesInCsrWithPhysicalReplica(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + rowPointers = operation.output(outputIdx++); + sortedSampleIds = operation.output(outputIdx++); + sortedTokenIds = operation.output(outputIdx++); + sortedGains = operation.output(outputIdx++); + rowPointersUnpaddedSize = operation.output(outputIdx++); + idsUnpaddedSize = operation.output(outputIdx++); + numMinibatchesPerPhysicalSparseCore = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetMinibatchesInCsrWithPhysicalReplica operation. + * + * @param scope current scope + * @param programKey The programKey value + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param gains The gains value + * @param splits The splits value + * @param idCounts The idCounts value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param maxMinibatchesPerSc The value of the maxMinibatchesPerSc attribute + * @param maxIdsPerChipPerSample The value of the maxIdsPerChipPerSample attribute + * @param tableVocabSize The value of the tableVocabSize attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchInCsr The value of the miniBatchInCsr attribute + * @return a new instance of GetMinibatchesInCsrWithPhysicalReplica + */ + @Endpoint( + describeByClass = true + ) + public static GetMinibatchesInCsrWithPhysicalReplica create(Scope scope, + Operand programKey, Operand rowIds, Operand colIds, + Operand gains, Operand splits, Operand idCounts, Long sampleCount, + Long numReplica, Long maxMinibatchesPerSc, Long maxIdsPerChipPerSample, Long tableVocabSize, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchInCsr) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetMinibatchesInCsrWithPhysicalReplica"); + opBuilder.addInput(programKey.asOutput()); + opBuilder.addInput(rowIds.asOutput()); + opBuilder.addInput(colIds.asOutput()); + opBuilder.addInput(gains.asOutput()); + opBuilder.addInput(splits.asOutput()); + opBuilder.addInput(idCounts.asOutput()); + opBuilder.setAttr("sample_count", sampleCount); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("max_minibatches_per_sc", maxMinibatchesPerSc); + opBuilder.setAttr("max_ids_per_chip_per_sample", maxIdsPerChipPerSample); + opBuilder.setAttr("table_vocab_size", tableVocabSize); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("table_name", tableName); + opBuilder.setAttr("mini_batch_in_csr", miniBatchInCsr); + return new GetMinibatchesInCsrWithPhysicalReplica(opBuilder.build()); + } + + /** + * Gets rowPointers. + * + * @return rowPointers. + */ + public Output rowPointers() { + return rowPointers; + } + + /** + * Gets sortedSampleIds. + * + * @return sortedSampleIds. + */ + public Output sortedSampleIds() { + return sortedSampleIds; + } + + /** + * Gets sortedTokenIds. + * + * @return sortedTokenIds. + */ + public Output sortedTokenIds() { + return sortedTokenIds; + } + + /** + * Gets sortedGains. + * + * @return sortedGains. + */ + public Output sortedGains() { + return sortedGains; + } + + /** + * Gets rowPointersUnpaddedSize. + * + * @return rowPointersUnpaddedSize. + */ + public Output rowPointersUnpaddedSize() { + return rowPointersUnpaddedSize; + } + + /** + * Gets idsUnpaddedSize. + * + * @return idsUnpaddedSize. + */ + public Output idsUnpaddedSize() { + return idsUnpaddedSize; + } + + /** + * Gets numMinibatchesPerPhysicalSparseCore. + * + * @return numMinibatchesPerPhysicalSparseCore. + */ + public Output numMinibatchesPerPhysicalSparseCore() { + return numMinibatchesPerPhysicalSparseCore; + } + + @OpInputsMetadata( + outputsClass = GetMinibatchesInCsrWithPhysicalReplica.class + ) + public static class Inputs extends RawOpInputs { + /** + * The programKey input + */ + public final Operand programKey; + + /** + * The rowIds input + */ + public final Operand rowIds; + + /** + * The colIds input + */ + public final Operand colIds; + + /** + * The gains input + */ + public final Operand gains; + + /** + * The splits input + */ + public final Operand splits; + + /** + * The idCounts input + */ + public final Operand idCounts; + + /** + * The sampleCount attribute + */ + public final long sampleCount; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The maxMinibatchesPerSc attribute + */ + public final long maxMinibatchesPerSc; + + /** + * The maxIdsPerChipPerSample attribute + */ + public final long maxIdsPerChipPerSample; + + /** + * The tableVocabSize attribute + */ + public final long tableVocabSize; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The numScPerChip attribute + */ + public final long numScPerChip; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The miniBatchInCsr attribute + */ + public final String miniBatchInCsr; + + public Inputs(GraphOperation op) { + super(new GetMinibatchesInCsrWithPhysicalReplica(op), op, Arrays.asList("sample_count", "num_replica", "max_minibatches_per_sc", "max_ids_per_chip_per_sample", "table_vocab_size", "feature_width", "num_sc_per_chip", "table_name", "mini_batch_in_csr")); + int inputIndex = 0; + programKey = (Operand) op.input(inputIndex++); + rowIds = (Operand) op.input(inputIndex++); + colIds = (Operand) op.input(inputIndex++); + gains = (Operand) op.input(inputIndex++); + splits = (Operand) op.input(inputIndex++); + idCounts = (Operand) op.input(inputIndex++); + sampleCount = op.attributes().getAttrInt("sample_count"); + numReplica = op.attributes().getAttrInt("num_replica"); + maxMinibatchesPerSc = op.attributes().getAttrInt("max_minibatches_per_sc"); + maxIdsPerChipPerSample = op.attributes().getAttrInt("max_ids_per_chip_per_sample"); + tableVocabSize = op.attributes().getAttrInt("table_vocab_size"); + featureWidth = op.attributes().getAttrInt("feature_width"); + numScPerChip = op.attributes().getAttrInt("num_sc_per_chip"); + tableName = op.attributes().getAttrString("table_name"); + miniBatchInCsr = op.attributes().getAttrString("mini_batch_in_csr"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetTpuTaskId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetTpuTaskId.java new file mode 100644 index 00000000000..c4eb00be8dd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GetTpuTaskId.java @@ -0,0 +1,97 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * An op returns the TPU task ID from TPU topology. + * This op is to return the TPU task ID from TPU topology. + */ +@OpMetadata( + opType = GetTpuTaskId.OP_NAME, + inputsClass = GetTpuTaskId.Inputs.class +) +@Operator( + group = "tpu" +) +public final class GetTpuTaskId extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetTpuTaskId"; + + private Output tpuTaskId; + + public GetTpuTaskId(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + tpuTaskId = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetTpuTaskId operation. + * + * @param scope current scope + * @return a new instance of GetTpuTaskId + */ + @Endpoint( + describeByClass = true + ) + public static GetTpuTaskId create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GetTpuTaskId"); + return new GetTpuTaskId(opBuilder.build()); + } + + /** + * Gets tpuTaskId. + * The TPU task ID from TPU topology. + * @return tpuTaskId. + */ + public Output tpuTaskId() { + return tpuTaskId; + } + + @Override + public Output asOutput() { + return tpuTaskId; + } + + @OpInputsMetadata( + outputsClass = GetTpuTaskId.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new GetTpuTaskId(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GlobalIterId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GlobalIterId.java new file mode 100644 index 00000000000..f0f71accb37 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/GlobalIterId.java @@ -0,0 +1,96 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; + +/** + * The GlobalIterId operation + */ +@OpMetadata( + opType = GlobalIterId.OP_NAME, + inputsClass = GlobalIterId.Inputs.class +) +@Operator( + group = "tpu" +) +public final class GlobalIterId extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GlobalIterId"; + + private Output iterId; + + public GlobalIterId(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + iterId = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GlobalIterId operation. + * + * @param scope current scope + * @return a new instance of GlobalIterId + */ + @Endpoint( + describeByClass = true + ) + public static GlobalIterId create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "GlobalIterId"); + return new GlobalIterId(opBuilder.build()); + } + + /** + * Gets iterId. + * + * @return iterId. + */ + public Output iterId() { + return iterId; + } + + @Override + public Output asOutput() { + return iterId; + } + + @OpInputsMetadata( + outputsClass = GlobalIterId.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new GlobalIterId(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java index 9133d876829..2f2d689a23a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,15 +26,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A placeholder op for a value that will be fed into the computation. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = InfeedDequeue.OP_NAME, + inputsClass = InfeedDequeue.Inputs.class +) +@Operator( + group = "tpu" +) public final class InfeedDequeue extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class InfeedDequeue extends RawOp implements Opera private Output output; - private InfeedDequeue(Operation operation) { - super(operation); + public InfeedDequeue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -80,4 +92,26 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = InfeedDequeue.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The shape of the tensor. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new InfeedDequeue<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java index 25c5bb5f3d2..1aaa438e7c6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,13 +28,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Fetches multiple values from infeed as an XLA tuple. */ +@OpMetadata( + opType = InfeedDequeueTuple.OP_NAME, + inputsClass = InfeedDequeueTuple.Inputs.class +) +@Operator( + group = "tpu" +) public final class InfeedDequeueTuple extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class InfeedDequeueTuple extends RawOp implements Iterable> outputs; @SuppressWarnings("unchecked") - private InfeedDequeueTuple(Operation operation) { - super(operation); + public InfeedDequeueTuple(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); @@ -88,4 +101,26 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = InfeedDequeueTuple.class + ) + public static class Inputs extends RawOpInputs { + /** + * The element types of each element in {@code outputs}. + */ + public final DataType[] dtypes; + + /** + * The shapes of each tensor in {@code outputs}. + */ + public final Shape[] shapes; + + public Inputs(GraphOperation op) { + super(new InfeedDequeueTuple(op), op, Arrays.asList("dtypes", "shapes")); + int inputIndex = 0; + dtypes = op.attributes().getAttrTypeList("dtypes"); + shapes = op.attributes().getAttrShapeList("shapes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java index 54c1c436dae..bc6c1e51a79 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,26 +19,39 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * An op which feeds a single Tensor value into the computation. */ +@OpMetadata( + opType = InfeedEnqueue.OP_NAME, + inputsClass = InfeedEnqueue.Inputs.class +) +@Operator( + group = "tpu" +) public final class InfeedEnqueue extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "InfeedEnqueue"; - private InfeedEnqueue(Operation operation) { - super(operation); + public InfeedEnqueue(Operation operation) { + super(operation, OP_NAME); } /** @@ -106,7 +119,7 @@ public static Options layout(List layout) { * be computed by the infeed operation. * @return this Options instance. */ - public static Options layout(Long[] layout) { + public static Options layout(Long... layout) { return new Options().layout(layout); } @@ -185,4 +198,48 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = InfeedEnqueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * A tensor that will be provided using the infeed mechanism. + */ + public final Operand input; + + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The shape of the tensor. + */ + public final Shape shape; + + /** + * A vector holding the requested layout in minor-to-major sequence. + * If a layout attribute is passed, but its values are all -1, the layout will + * be computed by the infeed operation. + */ + public final long[] layout; + + /** + * 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. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new InfeedEnqueue(op), op, Arrays.asList("dtype", "shape", "layout", "device_ordinal")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + layout = op.attributes().getAttrIntList("layout"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java index e2e31f1e1a4..0e2294decc2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,38 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * An op which enqueues prelinearized buffer into TPU infeed. */ +@OpMetadata( + opType = InfeedEnqueuePrelinearizedBuffer.OP_NAME, + inputsClass = InfeedEnqueuePrelinearizedBuffer.Inputs.class +) +@Operator( + group = "tpu" +) public final class InfeedEnqueuePrelinearizedBuffer extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "InfeedEnqueuePrelinearizedBuffer"; - private InfeedEnqueuePrelinearizedBuffer(Operation operation) { - super(operation); + public InfeedEnqueuePrelinearizedBuffer(Operation operation) { + super(operation, OP_NAME); } /** @@ -95,4 +108,27 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = InfeedEnqueuePrelinearizedBuffer.class + ) + public static class Inputs extends RawOpInputs { + /** + * A variant tensor representing linearized output. + */ + public final Operand input; + + /** + * 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. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new InfeedEnqueuePrelinearizedBuffer(op), op, Arrays.asList("device_ordinal")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java index 1e4e5275ab9..faae10fe8a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,26 +19,39 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; /** * Feeds multiple Tensor values into the computation as an XLA tuple. */ +@OpMetadata( + opType = InfeedEnqueueTuple.OP_NAME, + inputsClass = InfeedEnqueueTuple.Inputs.class +) +@Operator( + group = "tpu" +) public final class InfeedEnqueueTuple extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "InfeedEnqueueTuple"; - private InfeedEnqueueTuple(Operation operation) { - super(operation); + public InfeedEnqueueTuple(Operation operation) { + super(operation, OP_NAME); } /** @@ -101,7 +114,7 @@ public static Options layouts(List layouts) { * corresponding layout will be computed by the infeed operation. * @return this Options instance. */ - public static Options layouts(Long[] layouts) { + public static Options layouts(Long... layouts) { return new Options().layouts(layouts); } @@ -169,4 +182,51 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = InfeedEnqueueTuple.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of tensors that will be provided using the infeed mechanism. + */ + public final Iterable> inputs; + + /** + * The element types of each element in {@code inputs}. + */ + public final DataType[] dtypes; + + /** + * The shapes of each tensor in {@code inputs}. + */ + public final Shape[] shapes; + + /** + * A vector holding the requested layout in minor-to-major sequence for + * all the tuple shapes, in the order the shapes appear in the "shapes" input. + * The layout elements for a sub-shape can be set to -1, in which case the + * corresponding layout will be computed by the infeed operation. + */ + public final long[] layouts; + + /** + * 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. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new InfeedEnqueueTuple(op), op, Arrays.asList("dtypes", "shapes", "layouts", "device_ordinal")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + dtypes = op.attributes().getAttrTypeList("dtypes"); + shapes = op.attributes().getAttrShapeList("shapes"); + layouts = op.attributes().getAttrIntList("layouts"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/IsTPUEmbeddingInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/IsTPUEmbeddingInitialized.java new file mode 100644 index 00000000000..a34b2fd2361 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/IsTPUEmbeddingInitialized.java @@ -0,0 +1,141 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; + +/** + * Whether TPU Embedding is initialized in a distributed TPU system. + */ +@OpMetadata( + opType = IsTPUEmbeddingInitialized.OP_NAME, + inputsClass = IsTPUEmbeddingInitialized.Inputs.class +) +@Operator( + group = "tpu" +) +public final class IsTPUEmbeddingInitialized extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsTPUEmbeddingInitialized"; + + private Output isTpuEmbeddingInitialized; + + public IsTPUEmbeddingInitialized(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + isTpuEmbeddingInitialized = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IsTPUEmbeddingInitialized operation. + * + * @param scope current scope + * @param options carries optional attribute values + * @return a new instance of IsTPUEmbeddingInitialized + */ + @Endpoint( + describeByClass = true + ) + public static IsTPUEmbeddingInitialized create(Scope scope, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "IsTPUEmbeddingInitialized"); + if (options != null) { + for (Options opts : options) { + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new IsTPUEmbeddingInitialized(opBuilder.build()); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Gets isTpuEmbeddingInitialized. + * + * @return isTpuEmbeddingInitialized. + */ + public Output isTpuEmbeddingInitialized() { + return isTpuEmbeddingInitialized; + } + + @Override + public Output asOutput() { + return isTpuEmbeddingInitialized; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.IsTPUEmbeddingInitialized} + */ + public static class Options { + private String config; + + private Options() { + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = IsTPUEmbeddingInitialized.class + ) + public static class Inputs extends RawOpInputs { + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new IsTPUEmbeddingInitialized(op), op, Arrays.asList("config")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadAllTPUEmbeddingParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadAllTPUEmbeddingParameters.java new file mode 100644 index 00000000000..7729db3d126 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadAllTPUEmbeddingParameters.java @@ -0,0 +1,257 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * An op that loads optimization parameters into embedding memory. + * An op that loads optimization parameters into embedding memory. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct embedding + * table configuration. For example, this op is used to install parameters that are + * loaded from a checkpoint before a training loop is executed. For Adagrad, + * auxiliary1 should be the accumulators. For SGD, all of the auxiliary* values + * should be empty. For FTRL, auxiliary1 should be the accumulators and auxiliary2 + * should be the linear terms. For ADAM, auxiliary1 should be the momenta and + * auxiliary2 should be the velocities. + */ +@OpMetadata( + opType = LoadAllTPUEmbeddingParameters.OP_NAME, + inputsClass = LoadAllTPUEmbeddingParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class LoadAllTPUEmbeddingParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoadAllTPUEmbeddingParameters"; + + public LoadAllTPUEmbeddingParameters(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LoadAllTPUEmbeddingParameters operation. + * + * @param scope current scope + * @param parameters A list of tensors, one for each embedding table, + * containing the initial embedding table parameters to use in embedding + * lookups. + * @param auxiliary1 A list of tensors, one for each embedding table, containing the + * initial values of the first auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have at least one + * auxiliary parameter. + * @param auxiliary2 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least two auxiliary + * @param auxiliary3 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have three + * auxiliary parameters. + * @param auxiliary4 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least four auxiliary + * @param auxiliary5 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have five + * auxiliary parameters. + * @param auxiliary6 A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least six auxiliary + * @param auxiliary7 A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have sevan + * auxiliary parameters. + * @param config An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + * @param numShards Number of shards into which the embedding tables are divided. + * @param shardId Identifier of shard for this operation. + * @return a new instance of LoadAllTPUEmbeddingParameters + */ + @Endpoint( + describeByClass = true + ) + public static LoadAllTPUEmbeddingParameters create(Scope scope, + Iterable> parameters, Iterable> auxiliary1, + Iterable> auxiliary2, Iterable> auxiliary3, + Iterable> auxiliary4, Iterable> auxiliary5, + Iterable> auxiliary6, Iterable> auxiliary7, String config, + Long numShards, Long shardId) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadAllTPUEmbeddingParameters"); + opBuilder.addInputList(Operands.asOutputs(parameters)); + opBuilder.addInputList(Operands.asOutputs(auxiliary1)); + opBuilder.addInputList(Operands.asOutputs(auxiliary2)); + opBuilder.addInputList(Operands.asOutputs(auxiliary3)); + opBuilder.addInputList(Operands.asOutputs(auxiliary4)); + opBuilder.addInputList(Operands.asOutputs(auxiliary5)); + opBuilder.addInputList(Operands.asOutputs(auxiliary6)); + opBuilder.addInputList(Operands.asOutputs(auxiliary7)); + opBuilder.setAttr("config", config); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + return new LoadAllTPUEmbeddingParameters(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = LoadAllTPUEmbeddingParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of tensors, one for each embedding table, + * containing the initial embedding table parameters to use in embedding + * lookups. + */ + public final Iterable> parameters; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the first auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have at least one + * auxiliary parameter. + */ + public final Iterable> auxiliary1; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least two auxiliary + */ + public final Iterable> auxiliary2; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have three + * auxiliary parameters. + */ + public final Iterable> auxiliary3; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least four auxiliary + */ + public final Iterable> auxiliary4; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have five + * auxiliary parameters. + */ + public final Iterable> auxiliary5; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the second auxiliary optimization parameter to use in + * embedding training loop updates. The shape of each entry is ignored (and thus + * can be empty) for those tables whose optimization algorithms do not have at + * least six auxiliary + */ + public final Iterable> auxiliary6; + + /** + * A list of tensors, one for each embedding table, containing the + * initial values of the third auxiliary optimization parameter to use in embedding + * training loop updates. The shape of each entry is ignored (and thus can be + * empty) for those tables whose optimization algorithms do not have sevan + * auxiliary parameters. + */ + public final Iterable> auxiliary7; + + /** + * An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + */ + public final String config; + + /** + * Number of shards into which the embedding tables are divided. + */ + public final long numShards; + + /** + * Identifier of shard for this operation. + */ + public final long shardId; + + public Inputs(GraphOperation op) { + super(new LoadAllTPUEmbeddingParameters(op), op, Arrays.asList("config", "num_shards", "shard_id")); + int inputIndex = 0; + int parametersLength = op.inputListLength("parameters"); + parameters = Arrays.asList((Operand[]) op.inputList(inputIndex, parametersLength)); + inputIndex += parametersLength; + int auxiliary1Length = op.inputListLength("auxiliary1"); + auxiliary1 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary1Length)); + inputIndex += auxiliary1Length; + int auxiliary2Length = op.inputListLength("auxiliary2"); + auxiliary2 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary2Length)); + inputIndex += auxiliary2Length; + int auxiliary3Length = op.inputListLength("auxiliary3"); + auxiliary3 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary3Length)); + inputIndex += auxiliary3Length; + int auxiliary4Length = op.inputListLength("auxiliary4"); + auxiliary4 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary4Length)); + inputIndex += auxiliary4Length; + int auxiliary5Length = op.inputListLength("auxiliary5"); + auxiliary5 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary5Length)); + inputIndex += auxiliary5Length; + int auxiliary6Length = op.inputListLength("auxiliary6"); + auxiliary6 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary6Length)); + inputIndex += auxiliary6Length; + int auxiliary7Length = op.inputListLength("auxiliary7"); + auxiliary7 = Arrays.asList((Operand[]) op.inputList(inputIndex, auxiliary7Length)); + inputIndex += auxiliary7Length; + config = op.attributes().getAttrString("config"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java index 9fbc8ce5bb3..284da4dccac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingADAMParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingADAMParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingADAMParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingADAMParameters"; - private LoadTPUEmbeddingADAMParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingADAMParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,8 +63,8 @@ private LoadTPUEmbeddingADAMParameters(Operation operation) { * @param parameters Value of parameters used in the ADAM optimization algorithm. * @param momenta Value of momenta used in the ADAM optimization algorithm. * @param velocities Value of velocities used in the ADAM optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingADAMParameters */ @@ -159,4 +172,62 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingADAMParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the ADAM optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of momenta used in the ADAM optimization algorithm. + */ + public final Operand momenta; + + /** + * Value of velocities used in the ADAM optimization algorithm. + */ + public final Operand velocities; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingADAMParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + velocities = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParametersGradAccumDebug.java deleted file mode 100644 index e6a19adf6b8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParametersGradAccumDebug.java +++ /dev/null @@ -1,164 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load ADAM embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingADAMParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingADAMParametersGradAccumDebug"; - - private LoadTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingADAMParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the ADAM optimization algorithm. - * @param momenta Value of momenta used in the ADAM optimization algorithm. - * @param velocities Value of velocities used in the ADAM optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the ADAM optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingADAMParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand momenta, Operand velocities, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingADAMParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(momenta.asOutput()); - opBuilder.addInput(velocities.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingADAMParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java index 9ef74ac8b76..f82fc61402b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingAdadeltaParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingAdadeltaParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingAdadeltaParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParameters"; - private LoadTPUEmbeddingAdadeltaParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,8 +63,8 @@ private LoadTPUEmbeddingAdadeltaParameters(Operation operation) { * @param parameters Value of parameters used in the Adadelta optimization algorithm. * @param accumulators Value of accumulators used in the Adadelta optimization algorithm. * @param updates Value of updates used in the Adadelta optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdadeltaParameters */ @@ -159,4 +172,62 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingAdadeltaParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the Adadelta optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the Adadelta optimization algorithm. + */ + public final Operand accumulators; + + /** + * Value of updates used in the Adadelta optimization algorithm. + */ + public final Operand updates; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingAdadeltaParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + updates = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java deleted file mode 100644 index 6a8bb70e0aa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ /dev/null @@ -1,164 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load Adadelta parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingAdadeltaParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingAdadeltaParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the Adadelta optimization algorithm. - * @param accumulators Value of accumulators used in the Adadelta optimization algorithm. - * @param updates Value of updates used in the Adadelta optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the Adadelta optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingAdadeltaParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand accumulators, Operand updates, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(updates.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradMomentumParameters.java new file mode 100644 index 00000000000..54f09315582 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradMomentumParameters.java @@ -0,0 +1,233 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Load Adagrad Momentum embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + */ +@OpMetadata( + opType = LoadTPUEmbeddingAdagradMomentumParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingAdagradMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class LoadTPUEmbeddingAdagradMomentumParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoadTPUEmbeddingAdagradMomentumParameters"; + + public LoadTPUEmbeddingAdagradMomentumParameters(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LoadTPUEmbeddingAdagradMomentumParameters operation. + * + * @param scope current scope + * @param parameters Value of parameters used in the Adagrad Momentum optimization algorithm. + * @param accumulators Value of accumulators used in the Adagrad Momentum optimization algorithm. + * @param momenta Value of momenta used in the Adagrad Momentum optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingAdagradMomentumParameters + */ + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdagradMomentumParameters create(Scope scope, + Operand parameters, Operand accumulators, Operand momenta, + Long numShards, Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingAdagradMomentumParameters"); + opBuilder.addInput(parameters.asOutput()); + opBuilder.addInput(accumulators.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + if (options != null) { + for (Options opts : options) { + if (opts.tableId != null) { + opBuilder.setAttr("table_id", opts.tableId); + } + if (opts.tableName != null) { + opBuilder.setAttr("table_name", opts.tableName); + } + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new LoadTPUEmbeddingAdagradMomentumParameters(opBuilder.build()); + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public static Options tableId(Long tableId) { + return new Options().tableId(tableId); + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public static Options tableName(String tableName) { + return new Options().tableName(tableName); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradMomentumParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingAdagradMomentumParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the Adagrad Momentum optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the Adagrad Momentum optimization algorithm. + */ + public final Operand accumulators; + + /** + * Value of momenta used in the Adagrad Momentum optimization algorithm. + */ + public final Operand momenta; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingAdagradMomentumParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java index ec3eb041f92..fba43cc1e1e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingAdagradParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingAdagradParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingAdagradParameters"; - private LoadTPUEmbeddingAdagradParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingAdagradParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -49,8 +62,8 @@ private LoadTPUEmbeddingAdagradParameters(Operation operation) { * @param scope current scope * @param parameters Value of parameters used in the Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the Adagrad optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdagradParameters */ @@ -156,4 +169,56 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingAdagradParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the Adagrad optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the Adagrad optimization algorithm. + */ + public final Operand accumulators; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingAdagradParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java deleted file mode 100644 index 79df9ecd358..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,162 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load Adagrad embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingAdagradParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the Adagrad optimization algorithm. - * @param accumulators Value of accumulators used in the Adagrad optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the Adagrad optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingAdagradParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand accumulators, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingAdagradParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingAdagradParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java index 9d5f01cf52f..274e83ee16e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingCenteredRMSPropParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingCenteredRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingCenteredRMSPropParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingCenteredRMSPropParameters"; - private LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -51,8 +64,8 @@ private LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { * @param ms Value of ms used in the centered RMSProp optimization algorithm. * @param mom Value of mom used in the centered RMSProp optimization algorithm. * @param mg Value of mg used in the centered RMSProp optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingCenteredRMSPropParameters */ @@ -161,4 +174,68 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingCenteredRMSPropParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the centered RMSProp optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of ms used in the centered RMSProp optimization algorithm. + */ + public final Operand ms; + + /** + * Value of mom used in the centered RMSProp optimization algorithm. + */ + public final Operand mom; + + /** + * Value of mg used in the centered RMSProp optimization algorithm. + */ + public final Operand mg; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingCenteredRMSPropParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + mg = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java index 9b31d9975fc..d765e76ddf5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingFTRLParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingFTRLParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingFTRLParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingFTRLParameters"; - private LoadTPUEmbeddingFTRLParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingFTRLParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,8 +63,8 @@ private LoadTPUEmbeddingFTRLParameters(Operation operation) { * @param parameters Value of parameters used in the FTRL optimization algorithm. * @param accumulators Value of accumulators used in the FTRL optimization algorithm. * @param linears Value of linears used in the FTRL optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingFTRLParameters */ @@ -159,4 +172,62 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingFTRLParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the FTRL optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the FTRL optimization algorithm. + */ + public final Operand accumulators; + + /** + * Value of linears used in the FTRL optimization algorithm. + */ + public final Operand linears; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingFTRLParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + linears = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java deleted file mode 100644 index 422515c24a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java +++ /dev/null @@ -1,164 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load FTRL embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingFTRLParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingFTRLParametersGradAccumDebug"; - - private LoadTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingFTRLParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the FTRL optimization algorithm. - * @param accumulators Value of accumulators used in the FTRL optimization algorithm. - * @param linears Value of linears used in the FTRL optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the FTRL optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingFTRLParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand accumulators, Operand linears, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingFTRLParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(linears.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingFTRLParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFrequencyEstimatorParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFrequencyEstimatorParameters.java new file mode 100644 index 00000000000..89988b64472 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFrequencyEstimatorParameters.java @@ -0,0 +1,225 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Load frequency estimator embedding parameters. + * An op that loads optimization parameters into HBM for embedding. Must be + * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to install + * parameters that are loaded from a checkpoint before a training loop is + * executed. + */ +@OpMetadata( + opType = LoadTPUEmbeddingFrequencyEstimatorParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingFrequencyEstimatorParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class LoadTPUEmbeddingFrequencyEstimatorParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoadTPUEmbeddingFrequencyEstimatorParameters"; + + public LoadTPUEmbeddingFrequencyEstimatorParameters(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new LoadTPUEmbeddingFrequencyEstimatorParameters operation. + * + * @param scope current scope + * @param parameters Value of parameters used in the frequency estimator optimization algorithm. + * @param lastHitStep Value of last_hit_step used in the frequency estimator optimization algorithm. + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of LoadTPUEmbeddingFrequencyEstimatorParameters + */ + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingFrequencyEstimatorParameters create(Scope scope, + Operand parameters, Operand lastHitStep, Long numShards, Long shardId, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingFrequencyEstimatorParameters"); + opBuilder.addInput(parameters.asOutput()); + opBuilder.addInput(lastHitStep.asOutput()); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + if (options != null) { + for (Options opts : options) { + if (opts.tableId != null) { + opBuilder.setAttr("table_id", opts.tableId); + } + if (opts.tableName != null) { + opBuilder.setAttr("table_name", opts.tableName); + } + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new LoadTPUEmbeddingFrequencyEstimatorParameters(opBuilder.build()); + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public static Options tableId(Long tableId) { + return new Options().tableId(tableId); + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public static Options tableName(String tableName) { + return new Options().tableName(tableName); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFrequencyEstimatorParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingFrequencyEstimatorParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the frequency estimator optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of last_hit_step used in the frequency estimator optimization algorithm. + */ + public final Operand lastHitStep; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingFrequencyEstimatorParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + lastHitStep = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java index 328d83e2c87..1bb174085a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingMDLAdagradLightParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingMDLAdagradLightParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingMDLAdagradLightParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingMDLAdagradLightParameters"; - private LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -51,8 +64,8 @@ private LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { * @param accumulators Value of accumulators used in the MDL Adagrad Light optimization algorithm. * @param weights Value of weights used in the MDL Adagrad Light optimization algorithm. * @param benefits Value of benefits used in the MDL Adagrad Light optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingMDLAdagradLightParameters */ @@ -161,4 +174,68 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingMDLAdagradLightParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the MDL Adagrad Light optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the MDL Adagrad Light optimization algorithm. + */ + public final Operand accumulators; + + /** + * Value of weights used in the MDL Adagrad Light optimization algorithm. + */ + public final Operand weights; + + /** + * Value of benefits used in the MDL Adagrad Light optimization algorithm. + */ + public final Operand benefits; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingMDLAdagradLightParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + benefits = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java index 2b448ef111d..a2588e51af9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingMomentumParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingMomentumParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingMomentumParameters"; - private LoadTPUEmbeddingMomentumParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingMomentumParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -49,8 +62,8 @@ private LoadTPUEmbeddingMomentumParameters(Operation operation) { * @param scope current scope * @param parameters Value of parameters used in the Momentum optimization algorithm. * @param momenta Value of momenta used in the Momentum optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingMomentumParameters */ @@ -156,4 +169,56 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingMomentumParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the Momentum optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of momenta used in the Momentum optimization algorithm. + */ + public final Operand momenta; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingMomentumParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java deleted file mode 100644 index 8bfd0dc74eb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java +++ /dev/null @@ -1,162 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load Momentum embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingMomentumParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingMomentumParametersGradAccumDebug"; - - private LoadTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingMomentumParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the Momentum optimization algorithm. - * @param momenta Value of momenta used in the Momentum optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the Momentum optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingMomentumParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand momenta, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingMomentumParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(momenta.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingMomentumParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java index 90bd696b108..f7f2ec6524b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingProximalAdagradParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingProximalAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingProximalAdagradParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParameters"; - private LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -49,8 +62,8 @@ private LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { * @param scope current scope * @param parameters Value of parameters used in the proximal Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the proximal Adagrad optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalAdagradParameters */ @@ -157,4 +170,56 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingProximalAdagradParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the proximal Adagrad optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of accumulators used in the proximal Adagrad optimization algorithm. + */ + public final Operand accumulators; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingProximalAdagradParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + accumulators = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java deleted file mode 100644 index 7fa88cc5273..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,162 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load proximal Adagrad embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the proximal Adagrad optimization algorithm. - * @param accumulators Value of accumulators used in the proximal Adagrad optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the proximal Adagrad optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand accumulators, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(accumulators.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java index c722394cb64..670993c8cbd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,36 +17,49 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * The LoadTPUEmbeddingProximalYogiParameters operation */ +@OpMetadata( + opType = LoadTPUEmbeddingProximalYogiParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingProximalYogiParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingProximalYogiParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParameters"; - private LoadTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingProximalYogiParameters(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalYogiParameters operation. * * @param scope current scope - * @param parameters the parameters value - * @param v the v value - * @param m the m value - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param parameters The parameters value + * @param v The v value + * @param m The m value + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalYogiParameters */ @@ -154,4 +167,62 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingProximalYogiParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The parameters input + */ + public final Operand parameters; + + /** + * The v input + */ + public final Operand v; + + /** + * The m input + */ + public final Operand m; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingProximalYogiParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java deleted file mode 100644 index 139a4b7928d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java +++ /dev/null @@ -1,159 +0,0 @@ -/* 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.types.TFloat32; - -/** - * The LoadTPUEmbeddingProximalYogiParametersGradAccumDebug operation - */ -public final class LoadTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters the parameters value - * @param v the v value - * @param m the m value - * @param gradientAccumulators the gradientAccumulators value - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingProximalYogiParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand v, Operand m, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(v.asOutput()); - opBuilder.addInput(m.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java index 855cd064132..02c378df53e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingRMSPropParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingRMSPropParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParameters"; - private LoadTPUEmbeddingRMSPropParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,8 +63,8 @@ private LoadTPUEmbeddingRMSPropParameters(Operation operation) { * @param parameters Value of parameters used in the RMSProp optimization algorithm. * @param ms Value of ms used in the RMSProp optimization algorithm. * @param mom Value of mom used in the RMSProp optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingRMSPropParameters */ @@ -159,4 +172,62 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingRMSPropParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the RMSProp optimization algorithm. + */ + public final Operand parameters; + + /** + * Value of ms used in the RMSProp optimization algorithm. + */ + public final Operand ms; + + /** + * Value of mom used in the RMSProp optimization algorithm. + */ + public final Operand mom; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingRMSPropParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java deleted file mode 100644 index 3831217f2c9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ /dev/null @@ -1,164 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load RMSProp embedding parameters with debug support. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingRMSPropParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"; - - private LoadTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingRMSPropParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the RMSProp optimization algorithm. - * @param ms Value of ms used in the RMSProp optimization algorithm. - * @param mom Value of mom used in the RMSProp optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the RMSProp optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingRMSPropParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, - Operand parameters, Operand ms, Operand mom, - Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(ms.asOutput()); - opBuilder.addInput(mom.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingRMSPropParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java index c263af2f921..cb0883872c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,14 +39,21 @@ * parameters that are loaded from a checkpoint before a training loop is * executed. */ +@OpMetadata( + opType = LoadTPUEmbeddingStochasticGradientDescentParameters.OP_NAME, + inputsClass = LoadTPUEmbeddingStochasticGradientDescentParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class LoadTPUEmbeddingStochasticGradientDescentParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParameters"; - private LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); + public LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation, OP_NAME); } /** @@ -48,8 +61,8 @@ private LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) * * @param scope current scope * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParameters */ @@ -154,4 +167,50 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = LoadTPUEmbeddingStochasticGradientDescentParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * Value of parameters used in the stochastic gradient descent optimization algorithm. + */ + public final Operand parameters; + + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new LoadTPUEmbeddingStochasticGradientDescentParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + parameters = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java deleted file mode 100644 index 2b8c8979f43..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java +++ /dev/null @@ -1,160 +0,0 @@ -/* 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.types.TFloat32; - -/** - * Load SGD embedding parameters. - * An op that loads optimization parameters into HBM for embedding. Must be - * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct - * embedding table configuration. For example, this op is used to install - * parameters that are loaded from a checkpoint before a training loop is - * executed. - */ -public final class LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; - - private LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug operation. - * - * @param scope current scope - * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. - * @param gradientAccumulators Value of gradient_accumulators used in the Adadelta optimization algorithm. - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create( - Scope scope, Operand parameters, Operand gradientAccumulators, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"); - opBuilder.addInput(parameters.asOutput()); - opBuilder.addInput(gradientAccumulators.asOutput()); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/MergeDedupData.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/MergeDedupData.java new file mode 100644 index 00000000000..e524db43c5f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/MergeDedupData.java @@ -0,0 +1,193 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * An op merges elements of integer and float tensors into deduplication data as + * XLA tuple. + * This op merges outputs of SplitDedupDataOp, which gives two 1-D tensors, integer + * and floating point. With respect to tuple_mask, this op merges values of these + * two tensors into an XLA tuple, which should be as same as input to + * SplitDedupDataOp. + */ +@OpMetadata( + opType = MergeDedupData.OP_NAME, + inputsClass = MergeDedupData.Inputs.class +) +@Operator( + group = "tpu" +) +public final class MergeDedupData extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MergeDedupData"; + + private Output output; + + @SuppressWarnings("unchecked") + public MergeDedupData(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MergeDedupData operation. + * + * @param scope current scope + * @param integerTensor A 1-D integer tensor, includes integer elements of deduplication data tuple. + * @param floatTensor A 1-D float tensor, includes float elements of deduplication data tuple. + * @param tupleMask A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + * @param options carries optional attribute values + * @return a new instance of MergeDedupData + */ + @Endpoint( + describeByClass = true + ) + public static MergeDedupData create(Scope scope, Operand integerTensor, + Operand floatTensor, String tupleMask, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "MergeDedupData"); + opBuilder.addInput(integerTensor.asOutput()); + opBuilder.addInput(floatTensor.asOutput()); + opBuilder.setAttr("tuple_mask", tupleMask); + if (options != null) { + for (Options opts : options) { + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new MergeDedupData(opBuilder.build()); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Gets output. + * An XLA tuple merging integer and float elements as deduplication data tuple. + * @return output. + */ + public Output output() { + return output; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.MergeDedupData} + */ + public static class Options { + private String config; + + private Options() { + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MergeDedupData.class + ) + public static class Inputs extends RawOpInputs { + /** + * A 1-D integer tensor, includes integer elements of deduplication data tuple. + */ + public final Operand integerTensor; + + /** + * A 1-D float tensor, includes float elements of deduplication data tuple. + */ + public final Operand floatTensor; + + /** + * A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + */ + public final String tupleMask; + + /** + * integer_tensor type. Allowed types: {int32, int64, uint32, uint64}. + */ + public final DataType integerType; + + /** + * float_tensor type. Allowed types: {half, bfloat16, float}. + */ + public final DataType floatType; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new MergeDedupData(op), op, Arrays.asList("tuple_mask", "integer_type", "float_type", "config")); + int inputIndex = 0; + integerTensor = (Operand) op.input(inputIndex++); + floatTensor = (Operand) op.input(inputIndex++); + tupleMask = op.attributes().getAttrString("tuple_mask"); + integerType = op.attributes().getAttrType("integer_type"); + floatType = op.attributes().getAttrType("float_type"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java index 27ac214d707..5df0d72c590 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; /** @@ -32,6 +38,13 @@ * (for regular inference) to execute the TPU program on. The output is * consumed by TPUPartitionedCall. */ +@OpMetadata( + opType = OrdinalSelector.OP_NAME, + inputsClass = OrdinalSelector.Inputs.class +) +@Operator( + group = "tpu" +) public final class OrdinalSelector extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +53,8 @@ public final class OrdinalSelector extends RawOp implements Operand { private Output deviceOrdinals; - private OrdinalSelector(Operation operation) { - super(operation); + public OrdinalSelector(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; deviceOrdinals = operation.output(outputIdx++); } @@ -73,4 +86,14 @@ public Output deviceOrdinals() { public Output asOutput() { return deviceOrdinals; } + + @OpInputsMetadata( + outputsClass = OrdinalSelector.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new OrdinalSelector(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java index c86acd651b9..f2043c5047c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,16 +26,26 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Retrieves a single tensor from the computation outfeed. * This operation will block indefinitely until data is available. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = OutfeedDequeue.OP_NAME, + inputsClass = OutfeedDequeue.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedDequeue extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class OutfeedDequeue extends RawOp implements Oper private Output output; - private OutfeedDequeue(Operation operation) { - super(operation); + public OutfeedDequeue(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -124,4 +136,34 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = OutfeedDequeue.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The shape of the tensor. + */ + public final Shape shape; + + /** + * 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. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new OutfeedDequeue<>(op), op, Arrays.asList("dtype", "shape", "device_ordinal")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java index 317b8c9fe94..e3256963740 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,6 +42,13 @@ * This operation will block indefinitely until data is available. Output {@code i} * corresponds to XLA tuple element {@code i}. */ +@OpMetadata( + opType = OutfeedDequeueTuple.OP_NAME, + inputsClass = OutfeedDequeueTuple.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedDequeueTuple extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +58,8 @@ public final class OutfeedDequeueTuple extends RawOp implements Iterable> outputs; @SuppressWarnings("unchecked") - private OutfeedDequeueTuple(Operation operation) { - super(operation); + public OutfeedDequeueTuple(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); @@ -133,4 +146,34 @@ public Options deviceOrdinal(Long deviceOrdinal) { return this; } } + + @OpInputsMetadata( + outputsClass = OutfeedDequeueTuple.class + ) + public static class Inputs extends RawOpInputs { + /** + * The element types of each element in {@code outputs}. + */ + public final DataType[] dtypes; + + /** + * The shapes of each tensor in {@code outputs}. + */ + public final Shape[] shapes; + + /** + * 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. + */ + public final long deviceOrdinal; + + public Inputs(GraphOperation op) { + super(new OutfeedDequeueTuple(op), op, Arrays.asList("dtypes", "shapes", "device_ordinal")); + int inputIndex = 0; + dtypes = op.attributes().getAttrTypeList("dtypes"); + shapes = op.attributes().getAttrShapeList("shapes"); + deviceOrdinal = op.attributes().getAttrInt("device_ordinal"); + } + } } 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 index d76cb039bcf..dc78bf09faa 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -27,8 +28,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -38,6 +44,13 @@ * This operation will block indefinitely until data is available. Output {@code i} * corresponds to XLA tuple element {@code i}. */ +@OpMetadata( + opType = OutfeedDequeueTupleV2.OP_NAME, + inputsClass = OutfeedDequeueTupleV2.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedDequeueTupleV2 extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +60,8 @@ public final class OutfeedDequeueTupleV2 extends RawOp implements Iterable> outputs; @SuppressWarnings("unchecked") - private OutfeedDequeueTupleV2(Operation operation) { - super(operation); + public OutfeedDequeueTupleV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); @@ -96,4 +109,34 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = OutfeedDequeueTupleV2.class + ) + public static class Inputs extends RawOpInputs { + /** + * 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. + */ + public final Operand deviceOrdinal; + + /** + * The element types of each element in {@code outputs}. + */ + public final DataType[] dtypes; + + /** + * The shapes of each tensor in {@code outputs}. + */ + public final Shape[] shapes; + + public Inputs(GraphOperation op) { + super(new OutfeedDequeueTupleV2(op), op, Arrays.asList("dtypes", "shapes")); + int inputIndex = 0; + deviceOrdinal = (Operand) op.input(inputIndex++); + dtypes = op.attributes().getAttrTypeList("dtypes"); + shapes = op.attributes().getAttrShapeList("shapes"); + } + } } 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 index 52c59042db0..dc0d6a3649a 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,8 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,9 +40,14 @@ * 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 */ +@OpMetadata( + opType = OutfeedDequeueV2.OP_NAME, + inputsClass = OutfeedDequeueV2.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedDequeueV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +56,8 @@ public final class OutfeedDequeueV2 extends RawOp implements Op private Output output; - private OutfeedDequeueV2(Operation operation) { - super(operation); + public OutfeedDequeueV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -87,4 +99,34 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = OutfeedDequeueV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 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. + */ + public final Operand deviceOrdinal; + + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The shape of the tensor. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new OutfeedDequeueV2<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + deviceOrdinal = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java index 91b06a891c3..f79f949acbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,39 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Enqueue a Tensor on the computation outfeed. */ +@OpMetadata( + opType = OutfeedEnqueue.OP_NAME, + inputsClass = OutfeedEnqueue.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedEnqueue extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "OutfeedEnqueue"; - private OutfeedEnqueue(Operation operation) { - super(operation); + public OutfeedEnqueue(Operation operation) { + super(operation, OP_NAME); } /** @@ -53,4 +67,26 @@ public static OutfeedEnqueue create(Scope scope, Operand input) opBuilder.addInput(input.asOutput()); return new OutfeedEnqueue(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = OutfeedEnqueue.class + ) + public static class Inputs extends RawOpInputs { + /** + * A tensor that will be inserted into the outfeed queue. + */ + public final Operand input; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new OutfeedEnqueue(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java index 14b280a0e91..df3eb3df0e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,39 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; /** * Enqueue multiple Tensor values on the computation outfeed. */ +@OpMetadata( + opType = OutfeedEnqueueTuple.OP_NAME, + inputsClass = OutfeedEnqueueTuple.Inputs.class +) +@Operator( + group = "tpu" +) public final class OutfeedEnqueueTuple extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "OutfeedEnqueueTuple"; - private OutfeedEnqueueTuple(Operation operation) { - super(operation); + public OutfeedEnqueueTuple(Operation operation) { + super(operation, OP_NAME); } /** @@ -54,4 +68,29 @@ public static OutfeedEnqueueTuple create(Scope scope, Iterable> input opBuilder.addInputList(Operands.asOutputs(inputs)); return new OutfeedEnqueueTuple(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = OutfeedEnqueueTuple.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of tensors that will be inserted into the outfeed queue as an + * XLA tuple. + */ + public final Iterable> inputs; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + public Inputs(GraphOperation op) { + super(new OutfeedEnqueueTuple(op), op, Arrays.asList("dtypes")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + dtypes = op.attributes().getAttrTypeList("dtypes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedCall.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedCall.java index 72ea7263328..f20a2de4bda 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedCall.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedCall.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,20 +21,33 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Calls a function placed on a specified TPU device. */ +@OpMetadata( + opType = PartitionedCall.OP_NAME, + inputsClass = PartitionedCall.Inputs.class +) +@Operator( + group = "tpu" +) public final class PartitionedCall extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +57,8 @@ public final class PartitionedCall extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private PartitionedCall(Operation operation) { - super(operation); + public PartitionedCall(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -129,4 +142,46 @@ public Options autotunerThresh(Long autotunerThresh) { return this; } } + + @OpInputsMetadata( + outputsClass = PartitionedCall.class + ) + public static class Inputs extends RawOpInputs { + /** + * The arguments to the function. + */ + public final Iterable> args; + + /** + * The TPU device ordinal to run the function on. + */ + public final Operand deviceOrdinal; + + /** + * The types of the arguments to the function. + */ + public final DataType[] Tin; + + /** + * The types of the outputs of the function. + */ + public final DataType[] Tout; + + /** + * The autotunerThresh attribute + */ + public final long autotunerThresh; + + public Inputs(GraphOperation op) { + super(new PartitionedCall(op), op, Arrays.asList("Tin", "Tout", "autotuner_thresh")); + int inputIndex = 0; + int argsLength = op.inputListLength("args"); + args = Arrays.asList((Operand[]) op.inputList(inputIndex, argsLength)); + inputIndex += argsLength; + deviceOrdinal = (Operand) op.input(inputIndex++); + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + autotunerThresh = op.attributes().getAttrInt("autotuner_thresh"); + } + } } 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 index 36808e6cf20..89d11541c1b 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,31 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 + * An op that groups a list of partitioned inputs together. Supports ND sharding. */ +@OpMetadata( + opType = PartitionedInput.OP_NAME, + inputsClass = PartitionedInput.Inputs.class +) @Operator( group = "tpu" ) @@ -40,36 +49,43 @@ public final class PartitionedInput extends RawOp implements Op /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedInput"; + public static final String OP_NAME = "TPUPartitionedInputV2"; private Output output; - private PartitionedInput(Operation operation) { - super(operation); + public PartitionedInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } /** - * Factory method to create a class wrapping a new TPUPartitionedInput operation. + * Factory method to create a class wrapping a new TPUPartitionedInputV2 operation. * * @param scope current scope * @param inputs A list of partitioned inputs which must have the same shape. + * @param partitionDims A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. * @param options carries optional attribute values - * @param data type for {@code TPUPartitionedInput} output and operands + * @param data type for {@code TPUPartitionedInputV2} output and operands * @return a new instance of PartitionedInput */ @Endpoint( describeByClass = true ) public static PartitionedInput create(Scope scope, - Iterable> inputs, Options... options) { + Iterable> inputs, List partitionDims, Options... options) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedInput"); opBuilder.addInputList(Operands.asOutputs(inputs)); + long[] partitionDimsArray = new long[partitionDims.size()]; + for (int i = 0 ; i < partitionDimsArray.length ; i++) { + partitionDimsArray[i] = partitionDims.get(i); + } + opBuilder.setAttr("partition_dims", partitionDimsArray); if (options != null) { for (Options opts : options) { - if (opts.partitionDim != null) { - opBuilder.setAttr("partition_dim", opts.partitionDim); + if (opts.isPacked != null) { + opBuilder.setAttr("is_packed", opts.isPacked); } } } @@ -77,14 +93,13 @@ public static PartitionedInput create(Scope scope, } /** - * Sets the partitionDim option. + * Sets the isPacked option. * - * @param partitionDim An integer describles which dimension is partitioned. -1 means - * those inputs are replicated. + * @param isPacked Indicates whether the input is a packed resource. * @return this Options instance. */ - public static Options partitionDim(Long partitionDim) { - return new Options().partitionDim(partitionDim); + public static Options isPacked(Boolean isPacked) { + return new Options().isPacked(isPacked); } /** @@ -105,21 +120,57 @@ public Output asOutput() { * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} */ public static class Options { - private Long partitionDim; + private Boolean isPacked; private Options() { } /** - * Sets the partitionDim option. + * Sets the isPacked option. * - * @param partitionDim An integer describles which dimension is partitioned. -1 means - * those inputs are replicated. + * @param isPacked Indicates whether the input is a packed resource. * @return this Options instance. */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; + public Options isPacked(Boolean isPacked) { + this.isPacked = isPacked; return this; } } + + @OpInputsMetadata( + outputsClass = PartitionedInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A list of partitioned inputs which must have the same shape. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. + */ + public final long[] partitionDims; + + /** + * Indicates whether the input is a packed resource. + */ + public final boolean isPacked; + + public Inputs(GraphOperation op) { + super(new PartitionedInput<>(op), op, Arrays.asList("T", "partition_dims", "is_packed")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + partitionDims = op.attributes().getAttrIntList("partition_dims"); + isPacked = op.attributes().getAttrBool("is_packed"); + } + } } 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 index 55df563614e..b69bdea9a7b 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,22 +20,29 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; 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 + * outputs outside the XLA computation. Supports ND sharding. */ +@OpMetadata( + opType = PartitionedOutput.OP_NAME, + inputsClass = PartitionedOutput.Inputs.class +) @Operator( group = "tpu" ) @@ -43,13 +50,13 @@ public final class PartitionedOutput extends RawOp implements I /** * The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedOutput"; + public static final String OP_NAME = "TPUPartitionedOutputV2"; private List> output; @SuppressWarnings("unchecked") - private PartitionedOutput(Operation operation) { - super(operation); + public PartitionedOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); @@ -57,46 +64,35 @@ private PartitionedOutput(Operation operation) { } /** - * Factory method to create a class wrapping a new TPUPartitionedOutput operation. + * Factory method to create a class wrapping a new TPUPartitionedOutputV2 operation. * * @param scope current scope * @param inputs A tensor which represents the full shape of partitioned tensors. - * @param numSplits the value of the numSplits property - * @param options carries optional attribute values - * @param data type for {@code TPUPartitionedOutput} output and operands + * @param numSplits The value of the numSplits attribute + * @param partitionDims A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. + * @param data type for {@code TPUPartitionedOutputV2} output and operands * @return a new instance of PartitionedOutput */ @Endpoint( describeByClass = true ) public static PartitionedOutput create(Scope scope, Operand inputs, - Long numSplits, Options... options) { + Long numSplits, List partitionDims) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "PartitionedOutput"); opBuilder.addInput(inputs.asOutput()); opBuilder.setAttr("num_splits", numSplits); - if (options != null) { - for (Options opts : options) { - if (opts.partitionDim != null) { - opBuilder.setAttr("partition_dim", opts.partitionDim); - } - } + long[] partitionDimsArray = new long[partitionDims.size()]; + for (int i = 0 ; i < partitionDimsArray.length ; i++) { + partitionDimsArray[i] = partitionDims.get(i); } + opBuilder.setAttr("partition_dims", partitionDimsArray); return new PartitionedOutput<>(opBuilder.build()); } - /** - * Sets the partitionDim option. - * - * @param partitionDim An integer describles which dimension is partitioned. - * @return this Options instance. - */ - public static Options partitionDim(Long partitionDim) { - return new Options().partitionDim(partitionDim); - } - /** * Gets output. - * A list of partitioned inputs which must have the same shape. + * A list of partitioned outputs which have the same shape. * @return output. */ public List> output() { @@ -109,24 +105,32 @@ public Iterator> iterator() { return (Iterator) output.iterator(); } - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedOutput} - */ - public static class Options { - private Long partitionDim; + @OpInputsMetadata( + outputsClass = PartitionedOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * A tensor which represents the full shape of partitioned tensors. + */ + public final Operand inputs; - private Options() { - } + /** + * The T attribute + */ + public final DataType T; /** - * Sets the partitionDim option. - * - * @param partitionDim An integer describles which dimension is partitioned. - * @return this Options instance. + * A list of integers describing how each dimension is partitioned. Emptiness + * indicates the inputs are replicated. */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; - return this; + public final long[] partitionDims; + + public Inputs(GraphOperation op) { + super(new PartitionedOutput<>(op), op, Arrays.asList("T", "partition_dims")); + int inputIndex = 0; + inputs = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + partitionDims = op.attributes().getAttrIntList("partition_dims"); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java index b88ba6f8fb6..d5417a9aa80 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,19 +19,32 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * An op which linearizes one Tensor value to an opaque variant tensor. */ +@OpMetadata( + opType = Prelinearize.OP_NAME, + inputsClass = Prelinearize.Inputs.class +) +@Operator( + group = "tpu" +) public final class Prelinearize extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +54,8 @@ public final class Prelinearize extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private Prelinearize(Operation operation) { - super(operation); + public Prelinearize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -109,7 +122,7 @@ public static Options layout(List layout) { * the infeed operation. * @return this Options instance. */ - public static Options layout(Long[] layout) { + public static Options layout(Long... layout) { return new Options().layout(layout); } @@ -176,4 +189,40 @@ public Options layout(Long... layout) { return this; } } + + @OpInputsMetadata( + outputsClass = Prelinearize.class + ) + public static class Inputs extends RawOpInputs { + /** + * A tensor that will be linearized. + */ + public final Operand input; + + /** + * The type of elements in the tensor. + */ + public final DataType dtype; + + /** + * The shape of the tensor. + */ + public final Shape shape; + + /** + * A vector holding the requested layout in minor-to-major sequence. If a layout + * attribute is passed but its values are all -1 the layout will be computed by + * the infeed operation. + */ + public final long[] layout; + + public Inputs(GraphOperation op) { + super(new Prelinearize(op), op, Arrays.asList("dtype", "shape", "layout")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + layout = op.attributes().getAttrIntList("layout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java index a7683d006e9..9c0217fded0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -26,13 +27,25 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * An op which linearizes multiple Tensor values to an opaque variant tensor. */ +@OpMetadata( + opType = PrelinearizeTuple.OP_NAME, + inputsClass = PrelinearizeTuple.Inputs.class +) +@Operator( + group = "tpu" +) public final class PrelinearizeTuple extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class PrelinearizeTuple extends RawOp implements Operand { private Output output; @SuppressWarnings("unchecked") - private PrelinearizeTuple(Operation operation) { - super(operation); + public PrelinearizeTuple(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -105,7 +118,7 @@ public static Options layouts(List layouts) { * will be computed by the infeed operation. * @return this Options instance. */ - public static Options layouts(Long[] layouts) { + public static Options layouts(Long... layouts) { return new Options().layouts(layouts); } @@ -161,4 +174,43 @@ public Options layouts(Long... layouts) { return this; } } + + @OpInputsMetadata( + outputsClass = PrelinearizeTuple.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of tensors that will be provided using the infeed mechanism. + */ + public final Iterable> inputs; + + /** + * The element types of each element in {@code inputs}. + */ + public final DataType[] dtypes; + + /** + * The shapes of each tensor in {@code inputs}. + */ + public final Shape[] shapes; + + /** + * A vector holding the requested layout in minor-to-major sequence for all the + * tuple shapes in the order the shapes appear in the "shapes" input. The layout + * elements for a sub-shape can be set to -1 in which case the corresponding layout + * will be computed by the infeed operation. + */ + public final long[] layouts; + + public Inputs(GraphOperation op) { + super(new PrelinearizeTuple(op), op, Arrays.asList("dtypes", "shapes", "layouts")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + dtypes = op.attributes().getAttrTypeList("dtypes"); + shapes = op.attributes().getAttrShapeList("shapes"); + layouts = op.attributes().getAttrIntList("layouts"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java index bce36be28ce..68dcd11b979 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,13 +20,18 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -38,6 +43,13 @@ * one Tensor of activations per table specified in the model. There can be at * most one RecvTPUEmbeddingActivations op in the TPU graph. */ +@OpMetadata( + opType = RecvTPUEmbeddingActivations.OP_NAME, + inputsClass = RecvTPUEmbeddingActivations.Inputs.class +) +@Operator( + group = "tpu" +) public final class RecvTPUEmbeddingActivations extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -47,8 +59,8 @@ public final class RecvTPUEmbeddingActivations extends RawOp implements Iterable private List> outputs; @SuppressWarnings("unchecked") - private RecvTPUEmbeddingActivations(Operation operation) { - super(operation); + public RecvTPUEmbeddingActivations(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); @@ -89,4 +101,20 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = RecvTPUEmbeddingActivations.class + ) + public static class Inputs extends RawOpInputs { + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RecvTPUEmbeddingActivations(op), op, Arrays.asList("config")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + } + } } 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 index ea469e87a9f..3e9453b7789 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,24 +19,36 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +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 {@code tpu.replicate()} computation subgraph. */ +@OpMetadata( + opType = ReplicateMetadata.OP_NAME, + inputsClass = ReplicateMetadata.Inputs.class +) +@Operator( + group = "tpu" +) public final class ReplicateMetadata extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "TPUReplicateMetadata"; - private ReplicateMetadata(Operation operation) { - super(operation); + public ReplicateMetadata(Operation operation) { + super(operation, OP_NAME); } /** @@ -101,6 +113,12 @@ public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... if (opts.useSpmdForXlaPartitioning != null) { opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); } + if (opts.useShardyPartitioner != null) { + opBuilder.setAttr("use_shardy_partitioner", opts.useShardyPartitioner); + } + if (opts.tpuCompileOptionsProto != null) { + opBuilder.setAttr("tpu_compile_options_proto", opts.tpuCompileOptionsProto); + } } } return new ReplicateMetadata(opBuilder.build()); @@ -152,7 +170,7 @@ public static Options deviceAssignment(List deviceAssignment) { * @param deviceAssignment The assignment of devices for the computation. * @return this Options instance. */ - public static Options deviceAssignment(Long[] deviceAssignment) { + public static Options deviceAssignment(Long... deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } @@ -172,7 +190,7 @@ public static Options computationShape(List computationShape) { * @param computationShape DEPRECATED. Use num_cores_per_replica instead. * @return this Options instance. */ - public static Options computationShape(Long[] computationShape) { + public static Options computationShape(Long... computationShape) { return new Options().computationShape(computationShape); } @@ -192,7 +210,7 @@ public static Options hostComputeCore(List hostComputeCore) { * @param hostComputeCore the hostComputeCore option * @return this Options instance. */ - public static Options hostComputeCore(String[] hostComputeCore) { + public static Options hostComputeCore(String... hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } @@ -212,7 +230,7 @@ public static Options paddingMap(List paddingMap) { * @param paddingMap the paddingMap option * @return this Options instance. */ - public static Options paddingMap(String[] paddingMap) { + public static Options paddingMap(String... paddingMap) { return new Options().paddingMap(paddingMap); } @@ -246,6 +264,26 @@ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitionin return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public static Options useShardyPartitioner(Boolean useShardyPartitioner) { + return new Options().useShardyPartitioner(useShardyPartitioner); + } + + /** + * Sets the tpuCompileOptionsProto option. + * + * @param tpuCompileOptionsProto the tpuCompileOptionsProto option + * @return this Options instance. + */ + public static Options tpuCompileOptionsProto(String tpuCompileOptionsProto) { + return new Options().tpuCompileOptionsProto(tpuCompileOptionsProto); + } + /** * Optional attributes for {@link org.tensorflow.op.tpu.ReplicateMetadata} */ @@ -270,6 +308,10 @@ public static class Options { private Boolean useSpmdForXlaPartitioning; + private Boolean useShardyPartitioner; + + private String tpuCompileOptionsProto; + private Options() { } @@ -426,5 +468,115 @@ public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; return this; } + + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public Options useShardyPartitioner(Boolean useShardyPartitioner) { + this.useShardyPartitioner = useShardyPartitioner; + return this; + } + + /** + * Sets the tpuCompileOptionsProto option. + * + * @param tpuCompileOptionsProto the tpuCompileOptionsProto option + * @return this Options instance. + */ + public Options tpuCompileOptionsProto(String tpuCompileOptionsProto) { + this.tpuCompileOptionsProto = tpuCompileOptionsProto; + return this; + } + } + + @OpInputsMetadata( + outputsClass = ReplicateMetadata.class + ) + public static class Inputs extends RawOpInputs { + /** + * Number of replicas of the computation + */ + public final long numReplicas; + + /** + * Number of cores per replica. Used for model parallelism. + */ + public final long numCoresPerReplica; + + /** + * TopologyProto indicating the topology of the TPU pod slice. + */ + public final String topology; + + /** + * Whether to place the computation on the TPU. + */ + public final boolean useTpu; + + /** + * The assignment of devices for the computation. + */ + public final long[] deviceAssignment; + + /** + * DEPRECATED. Use num_cores_per_replica instead. + */ + public final long[] computationShape; + + /** + * The hostComputeCore attribute + */ + public final String[] hostComputeCore; + + /** + * The paddingMap attribute + */ + public final String[] paddingMap; + + /** + * The stepMarkerLocation attribute + */ + public final String stepMarkerLocation; + + /** + * The allowSoftPlacement attribute + */ + public final boolean allowSoftPlacement; + + /** + * The useSpmdForXlaPartitioning attribute + */ + public final boolean useSpmdForXlaPartitioning; + + /** + * The useShardyPartitioner attribute + */ + public final boolean useShardyPartitioner; + + /** + * The tpuCompileOptionsProto attribute + */ + public final String tpuCompileOptionsProto; + + public Inputs(GraphOperation op) { + super(new ReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "use_shardy_partitioner", "tpu_compile_options_proto")); + int inputIndex = 0; + numReplicas = op.attributes().getAttrInt("num_replicas"); + numCoresPerReplica = op.attributes().getAttrInt("num_cores_per_replica"); + topology = op.attributes().getAttrString("topology"); + useTpu = op.attributes().getAttrBool("use_tpu"); + deviceAssignment = op.attributes().getAttrIntList("device_assignment"); + computationShape = op.attributes().getAttrIntList("computation_shape"); + hostComputeCore = op.attributes().getAttrStringList("host_compute_core"); + paddingMap = op.attributes().getAttrStringList("padding_map"); + stepMarkerLocation = op.attributes().getAttrString("step_marker_location"); + allowSoftPlacement = op.attributes().getAttrBool("allow_soft_placement"); + useSpmdForXlaPartitioning = op.attributes().getAttrBool("use_spmd_for_xla_partitioning"); + useShardyPartitioner = op.attributes().getAttrBool("use_shardy_partitioner"); + tpuCompileOptionsProto = op.attributes().getAttrString("tpu_compile_options_proto"); + } } } 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 index 609ba0ffea6..5f5ae14be0e 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +46,14 @@ * %computation = "tf.Computation"(%replicated_input) * *

    The above computation has a replicated input of two replicas. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = ReplicatedInput.OP_NAME, + inputsClass = ReplicatedInput.Inputs.class +) +@Operator( + group = "tpu" +) public final class ReplicatedInput extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -50,8 +62,8 @@ public final class ReplicatedInput extends RawOp implements Ope private Output output; - private ReplicatedInput(Operation operation) { - super(operation); + public ReplicatedInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -60,7 +72,7 @@ private ReplicatedInput(Operation operation) { * Factory method to create a class wrapping a new TPUReplicatedInput operation. * * @param scope current scope - * @param inputs the inputs value + * @param inputs The inputs value * @param options carries optional attribute values * @param data type for {@code TPUReplicatedInput} output and operands * @return a new instance of ReplicatedInput @@ -178,4 +190,46 @@ public Options isPacked(Boolean isPacked) { return this; } } + + @OpInputsMetadata( + outputsClass = ReplicatedInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The isMirroredVariable attribute + */ + public final boolean isMirroredVariable; + + /** + * The index attribute + */ + public final long index; + + /** + * The isPacked attribute + */ + public final boolean isPacked; + + public Inputs(GraphOperation op) { + super(new ReplicatedInput<>(op), op, Arrays.asList("T", "is_mirrored_variable", "index", "is_packed")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + isMirroredVariable = op.attributes().getAttrBool("is_mirrored_variable"); + index = op.attributes().getAttrInt("index"); + isPacked = op.attributes().getAttrBool("is_packed"); + } + } } 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 index 53c2f484f09..6daab9ae1a2 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,13 +20,19 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,9 +45,14 @@ * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation) * *

    The above computation has a replicated output of two replicas. - * - * @param data type for {@code outputs} output */ +@OpMetadata( + opType = ReplicatedOutput.OP_NAME, + inputsClass = ReplicatedOutput.Inputs.class +) +@Operator( + group = "tpu" +) public final class ReplicatedOutput extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -51,8 +62,8 @@ public final class ReplicatedOutput extends RawOp implements It private List> outputs; @SuppressWarnings("unchecked") - private ReplicatedOutput(Operation operation) { - super(operation); + public ReplicatedOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); @@ -63,8 +74,8 @@ private ReplicatedOutput(Operation operation) { * Factory method to create a class wrapping a new TPUReplicatedOutput operation. * * @param scope current scope - * @param input the input value - * @param numReplicas the value of the numReplicas property + * @param input The input value + * @param numReplicas The value of the numReplicas attribute * @param data type for {@code TPUReplicatedOutput} output and operands * @return a new instance of ReplicatedOutput */ @@ -93,4 +104,26 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = ReplicatedOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new ReplicatedOutput<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveAllTPUEmbeddingParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveAllTPUEmbeddingParameters.java new file mode 100644 index 00000000000..723885b54fd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveAllTPUEmbeddingParameters.java @@ -0,0 +1,251 @@ +/* Copyright 2018-2023 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.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * An op that retrieves optimization parameters from embedding to host memory. + * An op that retrieves optimization parameters from embedding to host memory. + * Must be preceded by a ConfigureTPUEmbeddingHost op that sets up the correct + * embedding table configuration. For example, this op is used to retrieve updated + * parameters before saving a checkpoint. For Adagrad, auxiliary1 will contain the + * accumulators after running this op. For SGD, all of the auxiliary* values will + * be empty (0x0 tensors for that table). For FTRL, auxiliary1 will contain the + * accumulators and auxiliary2 will contain the linear terms. For ADAM, auxiliary1 + * will contain the momenta and auxiliary2 will contain the velocities. + */ +@OpMetadata( + opType = RetrieveAllTPUEmbeddingParameters.OP_NAME, + inputsClass = RetrieveAllTPUEmbeddingParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class RetrieveAllTPUEmbeddingParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RetrieveAllTPUEmbeddingParameters"; + + private List> parameters; + + private List> auxiliary1; + + private List> auxiliary2; + + private List> auxiliary3; + + private List> auxiliary4; + + private List> auxiliary5; + + private List> auxiliary6; + + private List> auxiliary7; + + @SuppressWarnings("unchecked") + public RetrieveAllTPUEmbeddingParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int parametersLength = operation.outputListLength("parameters"); + parameters = Arrays.asList((Output[]) operation.outputList(outputIdx, parametersLength)); + outputIdx += parametersLength; + int auxiliary1Length = operation.outputListLength("auxiliary1"); + auxiliary1 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary1Length)); + outputIdx += auxiliary1Length; + int auxiliary2Length = operation.outputListLength("auxiliary2"); + auxiliary2 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary2Length)); + outputIdx += auxiliary2Length; + int auxiliary3Length = operation.outputListLength("auxiliary3"); + auxiliary3 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary3Length)); + outputIdx += auxiliary3Length; + int auxiliary4Length = operation.outputListLength("auxiliary4"); + auxiliary4 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary4Length)); + outputIdx += auxiliary4Length; + int auxiliary5Length = operation.outputListLength("auxiliary5"); + auxiliary5 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary5Length)); + outputIdx += auxiliary5Length; + int auxiliary6Length = operation.outputListLength("auxiliary6"); + auxiliary6 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary6Length)); + outputIdx += auxiliary6Length; + int auxiliary7Length = operation.outputListLength("auxiliary7"); + auxiliary7 = Arrays.asList((Output[]) operation.outputList(outputIdx, auxiliary7Length)); + outputIdx += auxiliary7Length; + } + + /** + * Factory method to create a class wrapping a new RetrieveAllTPUEmbeddingParameters operation. + * + * @param scope current scope + * @param NumTables The number of embedding tables. + * @param config An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + * @param numShards Number of shards into which the embedding tables are divided. + * @param shardId Identifier of shard for this operation. + * @return a new instance of RetrieveAllTPUEmbeddingParameters + */ + @Endpoint( + describeByClass = true + ) + public static RetrieveAllTPUEmbeddingParameters create(Scope scope, Long NumTables, String config, + Long numShards, Long shardId) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveAllTPUEmbeddingParameters"); + opBuilder.setAttr("NumTables", NumTables); + opBuilder.setAttr("config", config); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + return new RetrieveAllTPUEmbeddingParameters(opBuilder.build()); + } + + /** + * Gets parameters. + * A list of tensors, one for each embedding table, containing the + * stored embedding table parameters. + * @return parameters. + */ + public List> parameters() { + return parameters; + } + + /** + * Gets auxiliary1. + * A list of tensors, one for each embedding table, containing the + * first auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary1. + */ + public List> auxiliary1() { + return auxiliary1; + } + + /** + * Gets auxiliary2. + * A list of tensors, one for each embedding table, containing the + * second auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary2. + */ + public List> auxiliary2() { + return auxiliary2; + } + + /** + * Gets auxiliary3. + * A list of tensors, one for each embedding table, containing the + * third auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary3. + */ + public List> auxiliary3() { + return auxiliary3; + } + + /** + * Gets auxiliary4. + * A list of tensors, one for each embedding table, containing the + * fourth auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary4. + */ + public List> auxiliary4() { + return auxiliary4; + } + + /** + * Gets auxiliary5. + * A list of tensors, one for each embedding table, containing the + * fifth auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary5. + */ + public List> auxiliary5() { + return auxiliary5; + } + + /** + * Gets auxiliary6. + * A list of tensors, one for each embedding table, containing the + * six auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary6. + */ + public List> auxiliary6() { + return auxiliary6; + } + + /** + * Gets auxiliary7. + * A list of tensors, one for each embedding table, containing the + * seventh auxiliary optimization parameter stored. Elements are + * present in the list, but have zero size, for unused optimization parameters + * (based on the algorithm in use for each table). + * @return auxiliary7. + */ + public List> auxiliary7() { + return auxiliary7; + } + + @OpInputsMetadata( + outputsClass = RetrieveAllTPUEmbeddingParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * An TPUEmbeddingConfiguration proto describing the + * table parameters being loaded, serialized to a string. + */ + public final String config; + + /** + * Number of shards into which the embedding tables are divided. + */ + public final long numShards; + + /** + * Identifier of shard for this operation. + */ + public final long shardId; + + public Inputs(GraphOperation op) { + super(new RetrieveAllTPUEmbeddingParameters(op), op, Arrays.asList("config", "num_shards", "shard_id")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java index 2d5b5a035b9..3b2c5c54d62 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingADAMParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingADAMParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingADAMParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +57,8 @@ public final class RetrieveTPUEmbeddingADAMParameters extends RawOp { private Output velocities; - private RetrieveTPUEmbeddingADAMParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingADAMParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); momenta = operation.output(outputIdx++); @@ -56,8 +69,8 @@ private RetrieveTPUEmbeddingADAMParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingADAMParameters */ @@ -188,4 +201,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingADAMParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingADAMParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java deleted file mode 100644 index b35d58f4620..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java +++ /dev/null @@ -1,203 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve ADAM embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingADAMParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParametersGradAccumDebug"; - - private Output parameters; - - private Output momenta; - - private Output velocities; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - velocities = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingADAMParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, Long numShards, - Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingADAMParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingADAMParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the ADAM optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets momenta. - * Parameter momenta updated by the ADAM optimization algorithm. - * @return momenta. - */ - public Output momenta() { - return momenta; - } - - /** - * Gets velocities. - * Parameter velocities updated by the ADAM optimization algorithm. - * @return velocities. - */ - public Output velocities() { - return velocities; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the ADAM optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java index bf5c12097f8..39fc4708c75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingAdadeltaParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingAdadeltaParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingAdadeltaParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +57,8 @@ public final class RetrieveTPUEmbeddingAdadeltaParameters extends RawOp { private Output updates; - private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); accumulators = operation.output(outputIdx++); @@ -56,8 +69,8 @@ private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdadeltaParameters */ @@ -188,4 +201,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingAdadeltaParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingAdadeltaParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java deleted file mode 100644 index 77eeff609e9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ /dev/null @@ -1,203 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve Adadelta embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"; - - private Output parameters; - - private Output accumulators; - - private Output updates; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - updates = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the Adadelta optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets accumulators. - * Parameter accumulators updated by the Adadelta optimization algorithm. - * @return accumulators. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Gets updates. - * Parameter updates updated by the Adadelta optimization algorithm. - * @return updates. - */ - public Output updates() { - return updates; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradMomentumParameters.java new file mode 100644 index 00000000000..29120ef3f9b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradMomentumParameters.java @@ -0,0 +1,244 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Retrieve Adagrad Momentum embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + */ +@OpMetadata( + opType = RetrieveTPUEmbeddingAdagradMomentumParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingAdagradMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class RetrieveTPUEmbeddingAdagradMomentumParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradMomentumParameters"; + + private Output parameters; + + private Output accumulators; + + private Output momenta; + + public RetrieveTPUEmbeddingAdagradMomentumParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradMomentumParameters operation. + * + * @param scope current scope + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingAdagradMomentumParameters + */ + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdagradMomentumParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingAdagradMomentumParameters"); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + if (options != null) { + for (Options opts : options) { + if (opts.tableId != null) { + opBuilder.setAttr("table_id", opts.tableId); + } + if (opts.tableName != null) { + opBuilder.setAttr("table_name", opts.tableName); + } + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new RetrieveTPUEmbeddingAdagradMomentumParameters(opBuilder.build()); + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public static Options tableId(Long tableId) { + return new Options().tableId(tableId); + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public static Options tableName(String tableName) { + return new Options().tableName(tableName); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Gets parameters. + * Parameter parameters updated by the Adagrad Momentum optimization algorithm. + * @return parameters. + */ + public Output parameters() { + return parameters; + } + + /** + * Gets accumulators. + * Parameter accumulators updated by the Adagrad Momentum optimization algorithm. + * @return accumulators. + */ + public Output accumulators() { + return accumulators; + } + + /** + * Gets momenta. + * Parameter momenta updated by the Adagrad Momentum optimization algorithm. + * @return momenta. + */ + public Output momenta() { + return momenta; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradMomentumParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingAdagradMomentumParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingAdagradMomentumParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java index 259d7301875..9ec5823b9b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingAdagradParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingAdagradParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class RetrieveTPUEmbeddingAdagradParameters extends RawOp { private Output accumulators; - private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingAdagradParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); accumulators = operation.output(outputIdx++); @@ -53,8 +66,8 @@ private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdagradParameters */ @@ -176,4 +189,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingAdagradParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingAdagradParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java deleted file mode 100644 index d0c18009b22..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,191 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve Adagrad embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingAdagradParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"; - - private Output parameters; - - private Output accumulators; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingAdagradParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the Adagrad optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets accumulators. - * Parameter accumulators updated by the Adagrad optimization algorithm. - * @return accumulators. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the Adagrad optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java index 58c257c4a38..321d91d8acc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingCenteredRMSPropParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingCenteredRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingCenteredRMSPropParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +59,8 @@ public final class RetrieveTPUEmbeddingCenteredRMSPropParameters extends RawOp { private Output mg; - private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); ms = operation.output(outputIdx++); @@ -59,8 +72,8 @@ private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingCenteredRMSPropParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingCenteredRMSPropParameters */ @@ -200,4 +213,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingCenteredRMSPropParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingCenteredRMSPropParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java index 4f8cdfc578c..712be9b6d8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingFTRLParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingFTRLParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingFTRLParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +57,8 @@ public final class RetrieveTPUEmbeddingFTRLParameters extends RawOp { private Output linears; - private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingFTRLParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); accumulators = operation.output(outputIdx++); @@ -56,8 +69,8 @@ private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingFTRLParameters */ @@ -188,4 +201,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingFTRLParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingFTRLParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java deleted file mode 100644 index b2100385e37..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java +++ /dev/null @@ -1,203 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve FTRL embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingFTRLParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"; - - private Output parameters; - - private Output accumulators; - - private Output linears; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - linears = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingFTRLParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, Long numShards, - Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the FTRL optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets accumulators. - * Parameter accumulators updated by the FTRL optimization algorithm. - * @return accumulators. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Gets linears. - * Parameter linears updated by the FTRL optimization algorithm. - * @return linears. - */ - public Output linears() { - return linears; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the FTRL optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java new file mode 100644 index 00000000000..1f8d062c7d3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFrequencyEstimatorParameters.java @@ -0,0 +1,233 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; + +/** + * Retrieve frequency estimator embedding parameters. + * An op that retrieves optimization parameters from embedding to host + * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up + * the correct embedding table configuration. For example, this op is + * used to retrieve updated parameters before saving a checkpoint. + */ +@OpMetadata( + opType = RetrieveTPUEmbeddingFrequencyEstimatorParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingFrequencyEstimatorParameters.Inputs.class +) +@Operator( + group = "tpu" +) +public final class RetrieveTPUEmbeddingFrequencyEstimatorParameters extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RetrieveTPUEmbeddingFrequencyEstimatorParameters"; + + private Output parameters; + + private Output lastHitStep; + + public RetrieveTPUEmbeddingFrequencyEstimatorParameters(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + lastHitStep = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFrequencyEstimatorParameters operation. + * + * @param scope current scope + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute + * @param options carries optional attribute values + * @return a new instance of RetrieveTPUEmbeddingFrequencyEstimatorParameters + */ + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingFrequencyEstimatorParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingFrequencyEstimatorParameters"); + opBuilder.setAttr("num_shards", numShards); + opBuilder.setAttr("shard_id", shardId); + if (options != null) { + for (Options opts : options) { + if (opts.tableId != null) { + opBuilder.setAttr("table_id", opts.tableId); + } + if (opts.tableName != null) { + opBuilder.setAttr("table_name", opts.tableName); + } + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new RetrieveTPUEmbeddingFrequencyEstimatorParameters(opBuilder.build()); + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public static Options tableId(Long tableId) { + return new Options().tableId(tableId); + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public static Options tableName(String tableName) { + return new Options().tableName(tableName); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Gets parameters. + * Parameter parameters updated by the frequency estimator optimization algorithm. + * @return parameters. + */ + public Output parameters() { + return parameters; + } + + /** + * Gets lastHitStep. + * Parameter last_hit_step updated by the frequency estimator optimization + * algorithm. + * @return lastHitStep. + */ + public Output lastHitStep() { + return lastHitStep; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFrequencyEstimatorParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingFrequencyEstimatorParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingFrequencyEstimatorParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java index 84f4b4a7da0..ab167935ad5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingMDLAdagradLightParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingMDLAdagradLightParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingMDLAdagradLightParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +59,8 @@ public final class RetrieveTPUEmbeddingMDLAdagradLightParameters extends RawOp { private Output benefits; - private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); accumulators = operation.output(outputIdx++); @@ -59,8 +72,8 @@ private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMDLAdagradLightParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingMDLAdagradLightParameters */ @@ -200,4 +213,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingMDLAdagradLightParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingMDLAdagradLightParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java index 14c67e9e170..747f704c7a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingMomentumParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingMomentumParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingMomentumParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class RetrieveTPUEmbeddingMomentumParameters extends RawOp { private Output momenta; - private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingMomentumParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); momenta = operation.output(outputIdx++); @@ -53,8 +66,8 @@ private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingMomentumParameters */ @@ -176,4 +189,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingMomentumParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingMomentumParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java deleted file mode 100644 index c374fb8ecc5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java +++ /dev/null @@ -1,191 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve Momentum embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingMomentumParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"; - - private Output parameters; - - private Output momenta; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingMomentumParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the Momentum optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets momenta. - * Parameter momenta updated by the Momentum optimization algorithm. - * @return momenta. - */ - public Output momenta() { - return momenta; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the Momentum optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java index 5aea831a41b..7bcac9a6f1d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingProximalAdagradParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingProximalAdagradParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingProximalAdagradParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +55,8 @@ public final class RetrieveTPUEmbeddingProximalAdagradParameters extends RawOp { private Output accumulators; - private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); accumulators = operation.output(outputIdx++); @@ -53,8 +66,8 @@ private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalAdagradParameters */ @@ -176,4 +189,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingProximalAdagradParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingProximalAdagradParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java deleted file mode 100644 index 587d0dc3b1d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ /dev/null @@ -1,191 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve proximal Adagrad embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"; - - private Output parameters; - - private Output accumulators; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the proximal Adagrad optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets accumulators. - * Parameter accumulators updated by the proximal Adagrad optimization algorithm. - * @return accumulators. - */ - public Output accumulators() { - return accumulators; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the proximal Adagrad optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java index 26b6a4f0b65..ab801fa3778 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,17 +17,30 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * The RetrieveTPUEmbeddingProximalYogiParameters operation */ +@OpMetadata( + opType = RetrieveTPUEmbeddingProximalYogiParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingProximalYogiParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingProximalYogiParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -40,8 +53,8 @@ public final class RetrieveTPUEmbeddingProximalYogiParameters extends RawOp { private Output m; - private RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); v = operation.output(outputIdx++); @@ -52,8 +65,8 @@ private RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalYogiParameters */ @@ -184,4 +197,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingProximalYogiParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingProximalYogiParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java deleted file mode 100644 index 6ff27ae7156..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java +++ /dev/null @@ -1,199 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * The RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug operation - */ -public final class RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"; - - private Output parameters; - - private Output v; - - private Output m; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - v = operation.output(outputIdx++); - m = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets v. - * - * @return v. - */ - public Output v() { - return v; - } - - /** - * Gets m. - * - * @return m. - */ - public Output m() { - return m; - } - - /** - * Gets gradientAccumulators. - * - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java index beecf2f21ba..94904073f5b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -32,6 +38,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingRMSPropParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingRMSPropParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingRMSPropParameters extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -44,8 +57,8 @@ public final class RetrieveTPUEmbeddingRMSPropParameters extends RawOp { private Output mom; - private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); ms = operation.output(outputIdx++); @@ -56,8 +69,8 @@ private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingRMSPropParameters */ @@ -188,4 +201,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingRMSPropParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingRMSPropParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java deleted file mode 100644 index 569044de7cc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ /dev/null @@ -1,203 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve RMSProp embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"; - - private Output parameters; - - private Output ms; - - private Output mom; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, - Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the RMSProp optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets ms. - * Parameter ms updated by the RMSProp optimization algorithm. - * @return ms. - */ - public Output ms() { - return ms; - } - - /** - * Gets mom. - * Parameter mom updated by the RMSProp optimization algorithm. - * @return mom. - */ - public Output mom() { - return mom; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the RMSProp optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java index f80a04cf0dc..b64685d5b06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -33,6 +39,13 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ +@OpMetadata( + opType = RetrieveTPUEmbeddingStochasticGradientDescentParameters.OP_NAME, + inputsClass = RetrieveTPUEmbeddingStochasticGradientDescentParameters.Inputs.class +) +@Operator( + group = "tpu" +) public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +54,8 @@ public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters exten private Output parameters; - private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); + public RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; parameters = operation.output(outputIdx++); } @@ -51,8 +64,8 @@ private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operat * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParameters operation. * * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property + * @param numShards The value of the numShards attribute + * @param shardId The value of the shardId attribute * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingStochasticGradientDescentParameters */ @@ -170,4 +183,44 @@ public Options config(String config) { return this; } } + + @OpInputsMetadata( + outputsClass = RetrieveTPUEmbeddingStochasticGradientDescentParameters.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tableId attribute + */ + public final long tableId; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numShards attribute + */ + public final long numShards; + + /** + * The shardId attribute + */ + public final long shardId; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new RetrieveTPUEmbeddingStochasticGradientDescentParameters(op), op, Arrays.asList("table_id", "table_name", "num_shards", "shard_id", "config")); + int inputIndex = 0; + tableId = op.attributes().getAttrInt("table_id"); + tableName = op.attributes().getAttrString("table_name"); + numShards = op.attributes().getAttrInt("num_shards"); + shardId = op.attributes().getAttrInt("shard_id"); + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java deleted file mode 100644 index 95d897459b1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java +++ /dev/null @@ -1,180 +0,0 @@ -/* 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.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.types.TFloat32; - -/** - * Retrieve SGD embedding parameters with debug support. - * An op that retrieves optimization parameters from embedding to host - * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up - * the correct embedding table configuration. For example, this op is - * used to retrieve updated parameters before saving a checkpoint. - */ -public final class RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; - - private Output parameters; - - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug( - Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug operation. - * - * @param scope current scope - * @param numShards the value of the numShards property - * @param shardId the value of the shardId property - * @param options carries optional attribute values - * @return a new instance of RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug - */ - @Endpoint( - describeByClass = true - ) - public static RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create( - Scope scope, Long numShards, Long shardId, Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"); - opBuilder.setAttr("num_shards", numShards); - opBuilder.setAttr("shard_id", shardId); - if (options != null) { - for (Options opts : options) { - if (opts.tableId != null) { - opBuilder.setAttr("table_id", opts.tableId); - } - if (opts.tableName != null) { - opBuilder.setAttr("table_name", opts.tableName); - } - if (opts.config != null) { - opBuilder.setAttr("config", opts.config); - } - } - } - return new RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(opBuilder.build()); - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public static Options tableId(Long tableId) { - return new Options().tableId(tableId); - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public static Options tableName(String tableName) { - return new Options().tableName(tableName); - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public static Options config(String config) { - return new Options().config(config); - } - - /** - * Gets parameters. - * Parameter parameters updated by the stochastic gradient descent optimization algorithm. - * @return parameters. - */ - public Output parameters() { - return parameters; - } - - /** - * Gets gradientAccumulators. - * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. - * @return gradientAccumulators. - */ - public Output gradientAccumulators() { - return gradientAccumulators; - } - - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} - */ - public static class Options { - private Long tableId; - - private String tableName; - - private String config; - - private Options() { - } - - /** - * Sets the tableId option. - * - * @param tableId the tableId option - * @return this Options instance. - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * Sets the tableName option. - * - * @param tableName the tableName option - * @return this Options instance. - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * Sets the config option. - * - * @param config the config option - * @return this Options instance. - */ - public Options config(String config) { - this.config = config; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java index e9925b25235..ec244c2d780 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,26 +17,39 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Performs gradient updates of embedding tables. */ +@OpMetadata( + opType = SendTPUEmbeddingGradients.OP_NAME, + inputsClass = SendTPUEmbeddingGradients.Inputs.class +) +@Operator( + group = "tpu" +) public final class SendTPUEmbeddingGradients extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "SendTPUEmbeddingGradients"; - private SendTPUEmbeddingGradients(Operation operation) { - super(operation); + public SendTPUEmbeddingGradients(Operation operation) { + super(operation, OP_NAME); } /** @@ -108,4 +121,46 @@ public Options NN(Long NN) { return this; } } + + @OpInputsMetadata( + outputsClass = SendTPUEmbeddingGradients.class + ) + public static class Inputs extends RawOpInputs { + /** + * A TensorList of gradients with which to update embedding tables. + * This argument has the same length and shapes as the return value of + * RecvTPUEmbeddingActivations, but contains gradients of the model's loss + * with respect to the embedding activations. The embedding tables are updated + * from these gradients via the optimizer specified in the TPU embedding + * configuration given to tpu.initialize_system. + */ + public final Iterable> inputs; + + /** + * A TensorList of float32 scalars, one for each dynamic learning + * rate tag: see the comments in + * //third_party/tensorflow/core/protobuf/tpu/optimization_parameters.proto. + * Multiple tables can share the same dynamic learning rate tag as specified + * in the configuration. If the learning rates for all tables are constant, + * this list should be empty. + */ + public final Iterable> learningRates; + + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new SendTPUEmbeddingGradients(op), op, Arrays.asList("config")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + int learningRatesLength = op.inputListLength("learning_rates"); + learningRates = Arrays.asList((Operand[]) op.inputList(inputIndex, learningRatesLength)); + inputIndex += learningRatesLength; + config = op.attributes().getAttrString("config"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java index 75fb90a9caa..d3a002317a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,24 +17,37 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; /** * Shuts down a running distributed TPU system. * The op returns an error if no system is running. */ +@OpMetadata( + opType = ShutdownDistributedTPU.OP_NAME, + inputsClass = ShutdownDistributedTPU.Inputs.class +) +@Operator( + group = "tpu" +) public final class ShutdownDistributedTPU extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ShutdownDistributedTPU"; - private ShutdownDistributedTPU(Operation operation) { - super(operation); + public ShutdownDistributedTPU(Operation operation) { + super(operation, OP_NAME); } /** @@ -50,4 +63,14 @@ public static ShutdownDistributedTPU create(Scope scope) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShutdownDistributedTPU"); return new ShutdownDistributedTPU(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ShutdownDistributedTPU.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new ShutdownDistributedTPU(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownTPUSystem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownTPUSystem.java new file mode 100644 index 00000000000..6b5de6b860b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownTPUSystem.java @@ -0,0 +1,96 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; + +/** + * An op that shuts down the TPU system. + */ +@OpMetadata( + opType = ShutdownTPUSystem.OP_NAME, + inputsClass = ShutdownTPUSystem.Inputs.class +) +@Operator( + group = "tpu" +) +public final class ShutdownTPUSystem extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShutdownTPUSystem"; + + private Output success; + + public ShutdownTPUSystem(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + success = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ShutdownTPUSystem operation. + * + * @param scope current scope + * @return a new instance of ShutdownTPUSystem + */ + @Endpoint( + describeByClass = true + ) + public static ShutdownTPUSystem create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ShutdownTPUSystem"); + return new ShutdownTPUSystem(opBuilder.build()); + } + + /** + * Gets success. + * A boolean that indicates if the shut down process succeeds. + * @return success. + */ + public Output success() { + return success; + } + + @Override + public Output asOutput() { + return success; + } + + @OpInputsMetadata( + outputsClass = ShutdownTPUSystem.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new ShutdownTPUSystem(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SplitDedupData.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SplitDedupData.java new file mode 100644 index 00000000000..8e8d4537dff --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SplitDedupData.java @@ -0,0 +1,197 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * An op splits input deduplication data XLA tuple into integer and floating point + * tensors. + * Deduplication data is an XLA tuple, which consists of integer and floating point + * values. This op is to split these values into two groups for two types, and + * construct each group as one tensor to return. + */ +@OpMetadata( + opType = SplitDedupData.OP_NAME, + inputsClass = SplitDedupData.Inputs.class +) +@Operator( + group = "tpu" +) +public final class SplitDedupData extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SplitDedupData"; + + private Output integerTensor; + + private Output floatTensor; + + public SplitDedupData(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + integerTensor = operation.output(outputIdx++); + floatTensor = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SplitDedupData operation. + * + * @param scope current scope + * @param input An XLA tuple including integer and float elements as deduplication data tuple. + * @param integerType integer_tensor type. Allowed types: int32, int64, uint32, uint64. + * @param floatType float_tensor type. Allowed types: half, bfloat16, float. + * @param tupleMask A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + * @param options carries optional attribute values + * @param data type for {@code SplitDedupData} output and operands + * @param data type for {@code SplitDedupData} output and operands + * @return a new instance of SplitDedupData + */ + @Endpoint( + describeByClass = true + ) + public static SplitDedupData create(Scope scope, + Operand input, Class integerType, Class floatType, String tupleMask, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SplitDedupData"); + opBuilder.addInput(input.asOutput()); + opBuilder.setAttr("integer_type", Operands.toDataType(integerType)); + opBuilder.setAttr("float_type", Operands.toDataType(floatType)); + opBuilder.setAttr("tuple_mask", tupleMask); + if (options != null) { + for (Options opts : options) { + if (opts.config != null) { + opBuilder.setAttr("config", opts.config); + } + } + } + return new SplitDedupData<>(opBuilder.build()); + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public static Options config(String config) { + return new Options().config(config); + } + + /** + * Gets integerTensor. + * A 1-D integer tensor, includes integer elements of deduplication data tuple. + * @return integerTensor. + */ + public Output integerTensor() { + return integerTensor; + } + + /** + * Gets floatTensor. + * A 1-D float tensor, includes float elements of deduplication data tuple. + * @return floatTensor. + */ + public Output floatTensor() { + return floatTensor; + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.SplitDedupData} + */ + public static class Options { + private String config; + + private Options() { + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } + } + + @OpInputsMetadata( + outputsClass = SplitDedupData.class + ) + public static class Inputs extends RawOpInputs> { + /** + * An XLA tuple including integer and float elements as deduplication data tuple. + */ + public final Operand input; + + /** + * integer_tensor type. Allowed types: int32, int64, uint32, uint64. + */ + public final DataType integerType; + + /** + * float_tensor type. Allowed types: half, bfloat16, float. + */ + public final DataType floatType; + + /** + * A serialized TensorProto string of output tuple mask. This mask is a 2-D tensor, + * with first column as tuple element type, and second column as span of this type. + * For example, an output tuple of (1, 2, 0.1, 3), its mask is [[0, 2], [1, 1], [0, + * 1]]. We expect only two types of elements: integer(0) and float(1). + */ + public final String tupleMask; + + /** + * The config attribute + */ + public final String config; + + public Inputs(GraphOperation op) { + super(new SplitDedupData<>(op), op, Arrays.asList("integer_type", "float_type", "tuple_mask", "config")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + integerType = op.attributes().getAttrType("integer_type"); + floatType = op.attributes().getAttrType("float_type"); + tupleMask = op.attributes().getAttrString("tuple_mask"); + config = op.attributes().getAttrString("config"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/StoreMinibatchStatisticsInFdo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/StoreMinibatchStatisticsInFdo.java new file mode 100644 index 00000000000..a3c05fd31fb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/StoreMinibatchStatisticsInFdo.java @@ -0,0 +1,152 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; + +/** + * The StoreMinibatchStatisticsInFdo operation + */ +@OpMetadata( + opType = StoreMinibatchStatisticsInFdo.OP_NAME, + inputsClass = StoreMinibatchStatisticsInFdo.Inputs.class +) +@Operator( + group = "tpu" +) +public final class StoreMinibatchStatisticsInFdo extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StoreMinibatchStatisticsInFdo"; + + public StoreMinibatchStatisticsInFdo(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new StoreMinibatchStatisticsInFdo operation. + * + * @param scope current scope + * @param programKey The programKey value + * @param maxIds The maxIds value + * @param maxUniques The maxUniques value + * @param sampleCount The value of the sampleCount attribute + * @param numReplica The value of the numReplica attribute + * @param featureWidth The value of the featureWidth attribute + * @param numScPerChip The value of the numScPerChip attribute + * @param tableName The value of the tableName attribute + * @param miniBatchSplits The value of the miniBatchSplits attribute + * @return a new instance of StoreMinibatchStatisticsInFdo + */ + @Endpoint( + describeByClass = true + ) + public static StoreMinibatchStatisticsInFdo create(Scope scope, Operand programKey, + Operand maxIds, Operand maxUniques, Long sampleCount, Long numReplica, + Long featureWidth, Long numScPerChip, String tableName, String miniBatchSplits) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "StoreMinibatchStatisticsInFdo"); + opBuilder.addInput(programKey.asOutput()); + opBuilder.addInput(maxIds.asOutput()); + opBuilder.addInput(maxUniques.asOutput()); + opBuilder.setAttr("sample_count", sampleCount); + opBuilder.setAttr("num_replica", numReplica); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("num_sc_per_chip", numScPerChip); + opBuilder.setAttr("table_name", tableName); + opBuilder.setAttr("mini_batch_splits", miniBatchSplits); + return new StoreMinibatchStatisticsInFdo(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = StoreMinibatchStatisticsInFdo.class + ) + public static class Inputs extends RawOpInputs { + /** + * The programKey input + */ + public final Operand programKey; + + /** + * The maxIds input + */ + public final Operand maxIds; + + /** + * The maxUniques input + */ + public final Operand maxUniques; + + /** + * The sampleCount attribute + */ + public final long sampleCount; + + /** + * The numReplica attribute + */ + public final long numReplica; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The numScPerChip attribute + */ + public final long numScPerChip; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The miniBatchSplits attribute + */ + public final String miniBatchSplits; + + public Inputs(GraphOperation op) { + super(new StoreMinibatchStatisticsInFdo(op), op, Arrays.asList("sample_count", "num_replica", "feature_width", "num_sc_per_chip", "table_name", "mini_batch_splits")); + int inputIndex = 0; + programKey = (Operand) op.input(inputIndex++); + maxIds = (Operand) op.input(inputIndex++); + maxUniques = (Operand) op.input(inputIndex++); + sampleCount = op.attributes().getAttrInt("sample_count"); + numReplica = op.attributes().getAttrInt("num_replica"); + featureWidth = op.attributes().getAttrInt("feature_width"); + numScPerChip = op.attributes().getAttrInt("num_sc_per_chip"); + tableName = op.attributes().getAttrString("table_name"); + miniBatchSplits = op.attributes().getAttrString("mini_batch_splits"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUAnnotateTensorsWithDynamicShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUAnnotateTensorsWithDynamicShape.java new file mode 100644 index 00000000000..a4dc34f7fc4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUAnnotateTensorsWithDynamicShape.java @@ -0,0 +1,121 @@ +/* Copyright 2018-2023 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.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The TPUAnnotateTensorsWithDynamicShape operation + */ +@OpMetadata( + opType = TPUAnnotateTensorsWithDynamicShape.OP_NAME, + inputsClass = TPUAnnotateTensorsWithDynamicShape.Inputs.class +) +@Operator( + group = "tpu" +) +public final class TPUAnnotateTensorsWithDynamicShape extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUAnnotateTensorsWithDynamicShape"; + + private List> tpuTensors; + + @SuppressWarnings("unchecked") + public TPUAnnotateTensorsWithDynamicShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int tpuTensorsLength = operation.outputListLength("tpu_tensors"); + tpuTensors = Arrays.asList(operation.outputList(outputIdx, tpuTensorsLength)); + outputIdx += tpuTensorsLength; + } + + /** + * Factory method to create a class wrapping a new TPUAnnotateTensorsWithDynamicShape operation. + * + * @param scope current scope + * @param tensors The tensors value + * @return a new instance of TPUAnnotateTensorsWithDynamicShape + */ + @Endpoint( + describeByClass = true + ) + public static TPUAnnotateTensorsWithDynamicShape create(Scope scope, + Iterable> tensors) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUAnnotateTensorsWithDynamicShape"); + opBuilder.addInputList(Operands.asOutputs(tensors)); + return new TPUAnnotateTensorsWithDynamicShape(opBuilder.build()); + } + + /** + * Gets tpuTensors. + * + * @return tpuTensors. + */ + public List> tpuTensors() { + return tpuTensors; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) tpuTensors.iterator(); + } + + @OpInputsMetadata( + outputsClass = TPUAnnotateTensorsWithDynamicShape.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensors input + */ + public final Iterable> tensors; + + /** + * The T attribute + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new TPUAnnotateTensorsWithDynamicShape(op), op, Arrays.asList("T")); + int inputIndex = 0; + int tensorsLength = op.inputListLength("tensors"); + tensors = Arrays.asList((Operand[]) op.inputList(inputIndex, tensorsLength)); + inputIndex += tensorsLength; + T = op.attributes().getAttrTypeList("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java index 7ad97d0b7eb..6e33eb5f4c0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** @@ -34,7 +40,14 @@ * * @deprecated use {@link org.tensorflow.op.tpu.CompilationResult} instead */ +@OpMetadata( + opType = TPUCompilationResult.OP_NAME, + inputsClass = TPUCompilationResult.Inputs.class +) @Deprecated +@Operator( + group = "tpu" +) public final class TPUCompilationResult extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +56,8 @@ public final class TPUCompilationResult extends RawOp implements Operand output; - private TPUCompilationResult(Operation operation) { - super(operation); + public TPUCompilationResult(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -76,4 +89,14 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TPUCompilationResult.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new TPUCompilationResult(op), op, Arrays.asList()); + int inputIndex = 0; + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCopyWithDynamicShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCopyWithDynamicShape.java new file mode 100644 index 00000000000..3e79b7672b5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCopyWithDynamicShape.java @@ -0,0 +1,133 @@ +/* Copyright 2018-2023 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.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * Op that copies host tensor to device with dynamic shape support. + * For internal use only. + */ +@OpMetadata( + opType = TPUCopyWithDynamicShape.OP_NAME, + inputsClass = TPUCopyWithDynamicShape.Inputs.class +) +@Operator( + group = "tpu" +) +public final class TPUCopyWithDynamicShape extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCopyWithDynamicShape"; + + private List> tpuTensors; + + @SuppressWarnings("unchecked") + public TPUCopyWithDynamicShape(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int tpuTensorsLength = operation.outputListLength("tpu_tensors"); + tpuTensors = Arrays.asList(operation.outputList(outputIdx, tpuTensorsLength)); + outputIdx += tpuTensorsLength; + } + + /** + * Factory method to create a class wrapping a new TPUCopyWithDynamicShape operation. + * + * @param scope current scope + * @param tensors The tensors value + * @param unpaddedSizes The unpaddedSizes value + * @return a new instance of TPUCopyWithDynamicShape + */ + @Endpoint( + describeByClass = true + ) + public static TPUCopyWithDynamicShape create(Scope scope, Iterable> tensors, + Iterable> unpaddedSizes) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUCopyWithDynamicShape"); + opBuilder.addInputList(Operands.asOutputs(tensors)); + opBuilder.addInputList(Operands.asOutputs(unpaddedSizes)); + return new TPUCopyWithDynamicShape(opBuilder.build()); + } + + /** + * Gets tpuTensors. + * + * @return tpuTensors. + */ + public List> tpuTensors() { + return tpuTensors; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) tpuTensors.iterator(); + } + + @OpInputsMetadata( + outputsClass = TPUCopyWithDynamicShape.class + ) + public static class Inputs extends RawOpInputs { + /** + * The tensors input + */ + public final Iterable> tensors; + + /** + * The unpaddedSizes input + */ + public final Iterable> unpaddedSizes; + + /** + * The T attribute + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new TPUCopyWithDynamicShape(op), op, Arrays.asList("T")); + int inputIndex = 0; + int tensorsLength = op.inputListLength("tensors"); + tensors = Arrays.asList((Operand[]) op.inputList(inputIndex, tensorsLength)); + inputIndex += tensorsLength; + int unpaddedSizesLength = op.inputListLength("unpadded_sizes"); + unpaddedSizes = Arrays.asList((Operand[]) op.inputList(inputIndex, unpaddedSizesLength)); + inputIndex += unpaddedSizesLength; + T = op.attributes().getAttrTypeList("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java new file mode 100644 index 00000000000..4b7fae6c11c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUDummyInput.java @@ -0,0 +1,114 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TNumber; + +/** + * Generates a zero-valued tensor for use as a dummy input to a TPU. + * For the internal use of the TF2XLA bridge in the XLA Broadcast pass. This op + */ +@OpMetadata( + opType = TPUDummyInput.OP_NAME, + inputsClass = TPUDummyInput.Inputs.class +) +public final class TPUDummyInput extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUDummyInput"; + + private Output output; + + public TPUDummyInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUDummyInput operation. + * + * @param scope current scope + * @param dtype The element type of the produced tensor. + * @param shape The shape of the produced tensor. + * @param data type for {@code TPUDummyInput} output and operands + * @return a new instance of TPUDummyInput + */ + @Endpoint( + describeByClass = true + ) + public static TPUDummyInput create(Scope scope, Class dtype, + Shape shape) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPUDummyInput"); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + opBuilder.setAttr("shape", shape); + return new TPUDummyInput<>(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + @OpInputsMetadata( + outputsClass = TPUDummyInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The element type of the produced tensor. + */ + public final DataType dtype; + + /** + * The shape of the produced tensor. + */ + public final Shape shape; + + public Inputs(GraphOperation op) { + super(new TPUDummyInput<>(op), op, Arrays.asList("dtype", "shape")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java index c97dd07cec4..29a1e429e53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** @@ -36,7 +42,14 @@ * * @deprecated use {@link org.tensorflow.op.tpu.EmbeddingActivations} instead */ +@OpMetadata( + opType = TPUEmbeddingActivations.OP_NAME, + inputsClass = TPUEmbeddingActivations.Inputs.class +) @Deprecated +@Operator( + group = "tpu" +) public final class TPUEmbeddingActivations extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -45,8 +58,8 @@ public final class TPUEmbeddingActivations extends RawOp implements Operand output; - private TPUEmbeddingActivations(Operation operation) { - super(operation); + public TPUEmbeddingActivations(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -89,4 +102,40 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TPUEmbeddingActivations.class + ) + public static class Inputs extends RawOpInputs { + /** + * A trainable variable, enabling optimizers to find this op. + */ + public final Operand embeddingVariable; + + /** + * The embedding activations Tensor to return. + */ + public final Operand slicedActivations; + + /** + * The id of the table in the embedding layer configuration from which + * these activations were computed. + */ + public final long tableId; + + /** + * Identifier of the set of embedding indices which produced these + * activations. + */ + public final long lookupId; + + public Inputs(GraphOperation op) { + super(new TPUEmbeddingActivations(op), op, Arrays.asList("table_id", "lookup_id")); + int inputIndex = 0; + embeddingVariable = (Operand) op.input(inputIndex++); + slicedActivations = (Operand) op.input(inputIndex++); + tableId = op.attributes().getAttrInt("table_id"); + lookupId = op.attributes().getAttrInt("lookup_id"); + } + } } 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 4a291f3ae50..968dde2b09a 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,11 +19,16 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; /** * Metadata indicating how the TPU computation should be replicated. @@ -31,15 +36,22 @@ * * @deprecated use {@link org.tensorflow.op.tpu.ReplicateMetadata} instead */ +@OpMetadata( + opType = TPUReplicateMetadata.OP_NAME, + inputsClass = TPUReplicateMetadata.Inputs.class +) @Deprecated +@Operator( + group = "tpu" +) public final class TPUReplicateMetadata extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "TPUReplicateMetadata"; - private TPUReplicateMetadata(Operation operation) { - super(operation); + public TPUReplicateMetadata(Operation operation) { + super(operation, OP_NAME); } /** @@ -104,6 +116,12 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options if (opts.useSpmdForXlaPartitioning != null) { opBuilder.setAttr("use_spmd_for_xla_partitioning", opts.useSpmdForXlaPartitioning); } + if (opts.useShardyPartitioner != null) { + opBuilder.setAttr("use_shardy_partitioner", opts.useShardyPartitioner); + } + if (opts.tpuCompileOptionsProto != null) { + opBuilder.setAttr("tpu_compile_options_proto", opts.tpuCompileOptionsProto); + } } } return new TPUReplicateMetadata(opBuilder.build()); @@ -155,7 +173,7 @@ public static Options deviceAssignment(List deviceAssignment) { * @param deviceAssignment The assignment of devices for the computation. * @return this Options instance. */ - public static Options deviceAssignment(Long[] deviceAssignment) { + public static Options deviceAssignment(Long... deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } @@ -175,7 +193,7 @@ public static Options computationShape(List computationShape) { * @param computationShape DEPRECATED. Use num_cores_per_replica instead. * @return this Options instance. */ - public static Options computationShape(Long[] computationShape) { + public static Options computationShape(Long... computationShape) { return new Options().computationShape(computationShape); } @@ -195,7 +213,7 @@ public static Options hostComputeCore(List hostComputeCore) { * @param hostComputeCore the hostComputeCore option * @return this Options instance. */ - public static Options hostComputeCore(String[] hostComputeCore) { + public static Options hostComputeCore(String... hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } @@ -215,7 +233,7 @@ public static Options paddingMap(List paddingMap) { * @param paddingMap the paddingMap option * @return this Options instance. */ - public static Options paddingMap(String[] paddingMap) { + public static Options paddingMap(String... paddingMap) { return new Options().paddingMap(paddingMap); } @@ -249,6 +267,26 @@ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitionin return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public static Options useShardyPartitioner(Boolean useShardyPartitioner) { + return new Options().useShardyPartitioner(useShardyPartitioner); + } + + /** + * Sets the tpuCompileOptionsProto option. + * + * @param tpuCompileOptionsProto the tpuCompileOptionsProto option + * @return this Options instance. + */ + public static Options tpuCompileOptionsProto(String tpuCompileOptionsProto) { + return new Options().tpuCompileOptionsProto(tpuCompileOptionsProto); + } + /** * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicateMetadata} */ @@ -273,6 +311,10 @@ public static class Options { private Boolean useSpmdForXlaPartitioning; + private Boolean useShardyPartitioner; + + private String tpuCompileOptionsProto; + private Options() { } @@ -429,5 +471,115 @@ public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; return this; } + + /** + * Sets the useShardyPartitioner option. + * + * @param useShardyPartitioner the useShardyPartitioner option + * @return this Options instance. + */ + public Options useShardyPartitioner(Boolean useShardyPartitioner) { + this.useShardyPartitioner = useShardyPartitioner; + return this; + } + + /** + * Sets the tpuCompileOptionsProto option. + * + * @param tpuCompileOptionsProto the tpuCompileOptionsProto option + * @return this Options instance. + */ + public Options tpuCompileOptionsProto(String tpuCompileOptionsProto) { + this.tpuCompileOptionsProto = tpuCompileOptionsProto; + return this; + } + } + + @OpInputsMetadata( + outputsClass = TPUReplicateMetadata.class + ) + public static class Inputs extends RawOpInputs { + /** + * Number of replicas of the computation + */ + public final long numReplicas; + + /** + * Number of cores per replica. Used for model parallelism. + */ + public final long numCoresPerReplica; + + /** + * TopologyProto indicating the topology of the TPU pod slice. + */ + public final String topology; + + /** + * Whether to place the computation on the TPU. + */ + public final boolean useTpu; + + /** + * The assignment of devices for the computation. + */ + public final long[] deviceAssignment; + + /** + * DEPRECATED. Use num_cores_per_replica instead. + */ + public final long[] computationShape; + + /** + * The hostComputeCore attribute + */ + public final String[] hostComputeCore; + + /** + * The paddingMap attribute + */ + public final String[] paddingMap; + + /** + * The stepMarkerLocation attribute + */ + public final String stepMarkerLocation; + + /** + * The allowSoftPlacement attribute + */ + public final boolean allowSoftPlacement; + + /** + * The useSpmdForXlaPartitioning attribute + */ + public final boolean useSpmdForXlaPartitioning; + + /** + * The useShardyPartitioner attribute + */ + public final boolean useShardyPartitioner; + + /** + * The tpuCompileOptionsProto attribute + */ + public final String tpuCompileOptionsProto; + + public Inputs(GraphOperation op) { + super(new TPUReplicateMetadata(op), op, Arrays.asList("num_replicas", "num_cores_per_replica", "topology", "use_tpu", "device_assignment", "computation_shape", "host_compute_core", "padding_map", "step_marker_location", "allow_soft_placement", "use_spmd_for_xla_partitioning", "use_shardy_partitioner", "tpu_compile_options_proto")); + int inputIndex = 0; + numReplicas = op.attributes().getAttrInt("num_replicas"); + numCoresPerReplica = op.attributes().getAttrInt("num_cores_per_replica"); + topology = op.attributes().getAttrString("topology"); + useTpu = op.attributes().getAttrBool("use_tpu"); + deviceAssignment = op.attributes().getAttrIntList("device_assignment"); + computationShape = op.attributes().getAttrIntList("computation_shape"); + hostComputeCore = op.attributes().getAttrStringList("host_compute_core"); + paddingMap = op.attributes().getAttrStringList("padding_map"); + stepMarkerLocation = op.attributes().getAttrString("step_marker_location"); + allowSoftPlacement = op.attributes().getAttrBool("allow_soft_placement"); + useSpmdForXlaPartitioning = op.attributes().getAttrBool("use_spmd_for_xla_partitioning"); + useShardyPartitioner = op.attributes().getAttrBool("use_shardy_partitioner"); + tpuCompileOptionsProto = op.attributes().getAttrString("tpu_compile_options_proto"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java index de437abaf8e..80ac7e3ea03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,11 +47,16 @@ * *

    The above computation has a replicated input of two replicas. * - * @param data type for {@code output} output - * * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedInput} instead */ +@OpMetadata( + opType = TPUReplicatedInput.OP_NAME, + inputsClass = TPUReplicatedInput.Inputs.class +) @Deprecated +@Operator( + group = "tpu" +) public final class TPUReplicatedInput extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -53,8 +65,8 @@ public final class TPUReplicatedInput extends RawOp implements private Output output; - private TPUReplicatedInput(Operation operation) { - super(operation); + public TPUReplicatedInput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -63,7 +75,7 @@ private TPUReplicatedInput(Operation operation) { * Factory method to create a class wrapping a new TPUReplicatedInput operation. * * @param scope current scope - * @param inputs the inputs value + * @param inputs The inputs value * @param options carries optional attribute values * @param data type for {@code TPUReplicatedInput} output and operands * @return a new instance of TPUReplicatedInput @@ -181,4 +193,46 @@ public Options isPacked(Boolean isPacked) { return this; } } + + @OpInputsMetadata( + outputsClass = TPUReplicatedInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The inputs input + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The isMirroredVariable attribute + */ + public final boolean isMirroredVariable; + + /** + * The index attribute + */ + public final long index; + + /** + * The isPacked attribute + */ + public final boolean isPacked; + + public Inputs(GraphOperation op) { + super(new TPUReplicatedInput<>(op), op, Arrays.asList("T", "is_mirrored_variable", "index", "is_packed")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + isMirroredVariable = op.attributes().getAttrBool("is_mirrored_variable"); + index = op.attributes().getAttrInt("index"); + isPacked = op.attributes().getAttrBool("is_packed"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java index 33a23fd27e9..dcc1b12b2b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,13 +20,19 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -40,11 +46,16 @@ * *

    The above computation has a replicated output of two replicas. * - * @param data type for {@code outputs} output - * * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedOutput} instead */ +@OpMetadata( + opType = TPUReplicatedOutput.OP_NAME, + inputsClass = TPUReplicatedOutput.Inputs.class +) @Deprecated +@Operator( + group = "tpu" +) public final class TPUReplicatedOutput extends RawOp implements Iterable> { /** * The name of this op, as known by TensorFlow core engine @@ -54,8 +65,8 @@ public final class TPUReplicatedOutput extends RawOp implements private List> outputs; @SuppressWarnings("unchecked") - private TPUReplicatedOutput(Operation operation) { - super(operation); + public TPUReplicatedOutput(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); @@ -66,8 +77,8 @@ private TPUReplicatedOutput(Operation operation) { * Factory method to create a class wrapping a new TPUReplicatedOutput operation. * * @param scope current scope - * @param input the input value - * @param numReplicas the value of the numReplicas property + * @param input The input value + * @param numReplicas The value of the numReplicas attribute * @param data type for {@code TPUReplicatedOutput} output and operands * @return a new instance of TPUReplicatedOutput */ @@ -96,4 +107,26 @@ public List> outputs() { public Iterator> iterator() { return (Iterator) outputs.iterator(); } + + @OpInputsMetadata( + outputsClass = TPUReplicatedOutput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TPUReplicatedOutput<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReshardVariables.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReshardVariables.java index 012917b3350..c1ddadbc8a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReshardVariables.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReshardVariables.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -35,23 +41,30 @@ * specifies the desired state, and format_state_var is the current state of the * variables. */ +@OpMetadata( + opType = TPUReshardVariables.OP_NAME, + inputsClass = TPUReshardVariables.Inputs.class +) +@Operator( + group = "tpu" +) public final class TPUReshardVariables extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "TPUReshardVariables"; - private TPUReshardVariables(Operation operation) { - super(operation); + public TPUReshardVariables(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new TPUReshardVariables operation. * * @param scope current scope - * @param vars the vars value - * @param newFormatKey the newFormatKey value - * @param formatStateVar the formatStateVar value + * @param vars The vars value + * @param newFormatKey The newFormatKey value + * @param formatStateVar The formatStateVar value * @return a new instance of TPUReshardVariables */ @Endpoint( @@ -65,4 +78,34 @@ public static TPUReshardVariables create(Scope scope, Iterable { + /** + * The vars input + */ + public final Iterable> vars; + + /** + * The newFormatKey input + */ + public final Operand newFormatKey; + + /** + * The formatStateVar input + */ + public final Operand formatStateVar; + + public Inputs(GraphOperation op) { + super(new TPUReshardVariables(op), op, Arrays.asList()); + int inputIndex = 0; + int varsLength = op.inputListLength("vars"); + vars = Arrays.asList((Operand[]) op.inputList(inputIndex, varsLength)); + inputIndex += varsLength; + newFormatKey = (Operand) op.input(inputIndex++); + formatStateVar = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPURoundRobin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPURoundRobin.java new file mode 100644 index 00000000000..482373f88fd --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPURoundRobin.java @@ -0,0 +1,101 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; + +/** + * Round-robin load balancing on TPU cores. + * A load balancing op that round-robins among TPU cores. + *

    This op round-robins between the integers in [0, NumTPUCoresVisiblePerHost]. It + * is useful for interfacing with TensorFlow ops that take as input a TPU core on + * which to execute computations, such as {@code TPUPartitionedCall}. + *

    device_ordinal: An integer in [0, NumTPUCoresVisiblePerHost]. + */ +@OpMetadata( + opType = TPURoundRobin.OP_NAME, + inputsClass = TPURoundRobin.Inputs.class +) +@Operator( + group = "tpu" +) +public final class TPURoundRobin extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPURoundRobin"; + + private Output deviceOrdinal; + + public TPURoundRobin(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + deviceOrdinal = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPURoundRobin operation. + * + * @param scope current scope + * @return a new instance of TPURoundRobin + */ + @Endpoint( + describeByClass = true + ) + public static TPURoundRobin create(Scope scope) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPURoundRobin"); + return new TPURoundRobin(opBuilder.build()); + } + + /** + * Gets deviceOrdinal. + * + * @return deviceOrdinal. + */ + public Output deviceOrdinal() { + return deviceOrdinal; + } + + @Override + public Output asOutput() { + return deviceOrdinal; + } + + @OpInputsMetadata( + outputsClass = TPURoundRobin.class + ) + public static class Inputs extends RawOpInputs { + public Inputs(GraphOperation op) { + super(new TPURoundRobin(op), op, Arrays.asList()); + int inputIndex = 0; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TpuHandleToProtoKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TpuHandleToProtoKey.java new file mode 100644 index 00000000000..af0b4306fac --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TpuHandleToProtoKey.java @@ -0,0 +1,111 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; + +/** + * Converts XRT's uid handles to TensorFlow-friendly input format. + * Converts a uid handle for a compiled program into a vector of proto keys. + *

    XRT compile ops return uids, and the TensorFlow execute op takes a proto + * key. This op enables a client to compile on TPU using XRT and execute using the + * standard TensorFlow execute op. + *

    'uid' is the input handle. + * 'proto_keys' is a vector of proto keys, one for each core program. + */ +@OpMetadata( + opType = TpuHandleToProtoKey.OP_NAME, + inputsClass = TpuHandleToProtoKey.Inputs.class +) +@Operator( + group = "tpu" +) +public final class TpuHandleToProtoKey extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TpuHandleToProtoKey"; + + private Output protoKeys; + + public TpuHandleToProtoKey(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + protoKeys = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TpuHandleToProtoKey operation. + * + * @param scope current scope + * @param uid The uid value + * @return a new instance of TpuHandleToProtoKey + */ + @Endpoint( + describeByClass = true + ) + public static TpuHandleToProtoKey create(Scope scope, Operand uid) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TpuHandleToProtoKey"); + opBuilder.addInput(uid.asOutput()); + return new TpuHandleToProtoKey(opBuilder.build()); + } + + /** + * Gets protoKeys. + * + * @return protoKeys. + */ + public Output protoKeys() { + return protoKeys; + } + + @Override + public Output asOutput() { + return protoKeys; + } + + @OpInputsMetadata( + outputsClass = TpuHandleToProtoKey.class + ) + public static class Inputs extends RawOpInputs { + /** + * The uid input + */ + public final Operand uid; + + public Inputs(GraphOperation op) { + super(new TpuHandleToProtoKey(op), op, Arrays.asList()); + int inputIndex = 0; + uid = (Operand) op.input(inputIndex++); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/UpdateTaskIdAndGlobalCoreArray.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/UpdateTaskIdAndGlobalCoreArray.java new file mode 100644 index 00000000000..1a0fb866178 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/UpdateTaskIdAndGlobalCoreArray.java @@ -0,0 +1,86 @@ +/* Copyright 2018-2023 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 org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TInt32; + +/** + * An op to update the task ID and global core array. + * This op is to update the task ID and global core array. + */ +@OpMetadata( + opType = UpdateTaskIdAndGlobalCoreArray.OP_NAME, + inputsClass = UpdateTaskIdAndGlobalCoreArray.Inputs.class +) +public final class UpdateTaskIdAndGlobalCoreArray extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UpdateTaskIdAndGlobalCoreArray"; + + public UpdateTaskIdAndGlobalCoreArray(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new UpdateTaskIdAndGlobalCoreArray operation. + * + * @param scope current scope + * @param tpuTaskIdToShardId An array of int32 that maps TPU task ID to shard ID. + * @return a new instance of UpdateTaskIdAndGlobalCoreArray + */ + @Endpoint( + describeByClass = true + ) + public static UpdateTaskIdAndGlobalCoreArray create(Scope scope, + Iterable> tpuTaskIdToShardId) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "UpdateTaskIdAndGlobalCoreArray"); + opBuilder.addInputList(Operands.asOutputs(tpuTaskIdToShardId)); + return new UpdateTaskIdAndGlobalCoreArray(opBuilder.build()); + } + + @OpInputsMetadata( + outputsClass = UpdateTaskIdAndGlobalCoreArray.class + ) + public static class Inputs extends RawOpInputs { + /** + * An array of int32 that maps TPU task ID to shard ID. + */ + public final Iterable> tpuTaskIdToShardId; + + public Inputs(GraphOperation op) { + super(new UpdateTaskIdAndGlobalCoreArray(op), op, Arrays.asList()); + int inputIndex = 0; + int tpuTaskIdToShardIdLength = op.inputListLength("tpu_task_id_to_shard_id"); + tpuTaskIdToShardId = Arrays.asList((Operand[]) op.inputList(inputIndex, tpuTaskIdToShardIdLength)); + inputIndex += tpuTaskIdToShardIdLength; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java index 76185847723..46a9eaba027 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** @@ -31,6 +37,13 @@ * Heartbeats may be sent periodically to indicate the coordinator is still active, * to retrieve the current worker status and to expedite shutdown when necessary. */ +@OpMetadata( + opType = WorkerHeartbeat.OP_NAME, + inputsClass = WorkerHeartbeat.Inputs.class +) +@Operator( + group = "tpu" +) public final class WorkerHeartbeat extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -39,8 +52,8 @@ public final class WorkerHeartbeat extends RawOp implements Operand { private Output response; - private WorkerHeartbeat(Operation operation) { - super(operation); + public WorkerHeartbeat(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; response = operation.output(outputIdx++); } @@ -74,4 +87,20 @@ public Output response() { public Output asOutput() { return response; } + + @OpInputsMetadata( + outputsClass = WorkerHeartbeat.class + ) + public static class Inputs extends RawOpInputs { + /** + * A string tensor containing a serialized WorkerHeartbeatRequest + */ + public final Operand request; + + public Inputs(GraphOperation op) { + super(new WorkerHeartbeat(op), op, Arrays.asList()); + int inputIndex = 0; + request = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java index 204dae5a267..269294305d5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -32,6 +38,10 @@ * Applies a gradient to a given accumulator. * Does not add if local_step is lesser than the accumulator's global_step. */ +@OpMetadata( + opType = AccumulatorApplyGradient.OP_NAME, + inputsClass = AccumulatorApplyGradient.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class AccumulatorApplyGradient extends RawOp { */ public static final String OP_NAME = "AccumulatorApplyGradient"; - private AccumulatorApplyGradient(Operation operation) { - super(operation); + public AccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); } /** @@ -65,4 +75,39 @@ public static AccumulatorApplyGradient create(Scope scope, Operand hand opBuilder.addInput(gradient.asOutput()); return new AccumulatorApplyGradient(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = AccumulatorApplyGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a accumulator. + */ + public final Operand handle; + + /** + * The local_step value at which the gradient was computed. + */ + public final Operand localStep; + + /** + * A tensor of the gradient to be accumulated. + */ + public final Operand gradient; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new AccumulatorApplyGradient(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + localStep = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java index 5b5b775ef9b..d35f19215d5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -31,6 +36,10 @@ /** * Returns the number of gradients aggregated in the given accumulators. */ +@OpMetadata( + opType = AccumulatorNumAccumulated.OP_NAME, + inputsClass = AccumulatorNumAccumulated.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +51,8 @@ public final class AccumulatorNumAccumulated extends RawOp implements Operand numAccumulated; - private AccumulatorNumAccumulated(Operation operation) { - super(operation); + public AccumulatorNumAccumulated(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; numAccumulated = operation.output(outputIdx++); } @@ -77,4 +86,20 @@ public Output numAccumulated() { public Output asOutput() { return numAccumulated; } + + @OpInputsMetadata( + outputsClass = AccumulatorNumAccumulated.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new AccumulatorNumAccumulated(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java index cca774e5106..b6a238ef6ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -32,6 +37,10 @@ * Logs warning if the accumulator's value is already higher than * new_global_step. */ +@OpMetadata( + opType = AccumulatorSetGlobalStep.OP_NAME, + inputsClass = AccumulatorSetGlobalStep.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +50,8 @@ public final class AccumulatorSetGlobalStep extends RawOp { */ public static final String OP_NAME = "AccumulatorSetGlobalStep"; - private AccumulatorSetGlobalStep(Operation operation) { - super(operation); + public AccumulatorSetGlobalStep(Operation operation) { + super(operation, OP_NAME); } /** @@ -63,4 +72,26 @@ public static AccumulatorSetGlobalStep create(Scope scope, Operand hand opBuilder.addInput(newGlobalStep.asOutput()); return new AccumulatorSetGlobalStep(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = AccumulatorSetGlobalStep.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + /** + * The new global_step value to set. + */ + public final Operand newGlobalStep; + + public Inputs(GraphOperation op) { + super(new AccumulatorSetGlobalStep(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + newGlobalStep = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java index e27b98bd50b..e7c94866732 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -37,9 +43,11 @@ * aggregated more than num_required gradients, it returns the average of * the accumulated gradients. Also automatically increments the recorded * global_step in the accumulator by 1, and resets the aggregate to 0. - * - * @param data type for {@code average} output */ +@OpMetadata( + opType = AccumulatorTakeGradient.OP_NAME, + inputsClass = AccumulatorTakeGradient.Inputs.class +) @Operator( group = "train" ) @@ -51,8 +59,8 @@ public final class AccumulatorTakeGradient extends RawOp implem private Output average; - private AccumulatorTakeGradient(Operation operation) { - super(operation); + public AccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; average = operation.output(outputIdx++); } @@ -93,4 +101,33 @@ public Output average() { public Output asOutput() { return average; } + + @OpInputsMetadata( + outputsClass = AccumulatorTakeGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + /** + * Number of gradients required before we return an aggregate. + */ + public final Operand numRequired; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new AccumulatorTakeGradient<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + numRequired = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java index 433c44bb92e..0bdb47444ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,9 +38,14 @@ * m_t <- beta1 * m_{t-1} + (1 - beta1) * g * v_t <- max(beta2 * v_{t-1}, abs(g)) * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAdaMax.OP_NAME, + inputsClass = ApplyAdaMax.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdaMax extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -42,8 +54,8 @@ public final class ApplyAdaMax extends RawOp implements Operand private Output out; - private ApplyAdaMax(Operation operation) { - super(operation); + public ApplyAdaMax(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -139,4 +151,82 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdaMax.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Should be from a Variable(). + */ + public final Operand v; + + /** + * Must be a scalar. + */ + public final Operand beta1Power; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta1; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta2; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyAdaMax<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + beta1Power = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java index f71e57defbd..7d53245fe2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,9 +39,11 @@ * update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAdadelta.OP_NAME, + inputsClass = ApplyAdadelta.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +55,8 @@ public final class ApplyAdadelta extends RawOp implements Opera private Output out; - private ApplyAdadelta(Operation operation) { - super(operation); + public ApplyAdadelta(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -138,4 +146,69 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdadelta.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand accumUpdate; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay factor. Must be a scalar. + */ + public final Operand rho; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var, accum and update_accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyAdadelta<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + accumUpdate = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java index b26331a94c9..0d243bfce4b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAdagrad.OP_NAME, + inputsClass = ApplyAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -45,8 +53,8 @@ public final class ApplyAdagrad extends RawOp implements Operan private Output out; - private ApplyAdagrad(Operation operation) { - super(operation); + public ApplyAdagrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -157,4 +165,58 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdagrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new ApplyAdagrad<>(op), op, Arrays.asList("T", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java index 978c8db8202..a2769eae2e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Update '*var' according to the proximal adagrad scheme. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAdagradDa.OP_NAME, + inputsClass = ApplyAdagradDa.Inputs.class +) @Operator( group = "train" ) @@ -44,8 +52,8 @@ public final class ApplyAdagradDa extends RawOp implements Oper private Output out; - private ApplyAdagradDa(Operation operation) { - super(operation); + public ApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -137,4 +145,75 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdagradDa.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand gradientAccumulator; + + /** + * Should be from a Variable(). + */ + public final Operand gradientSquaredAccumulator; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * Training step number. Must be a scalar. + */ + public final Operand globalStep; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyAdagradDa<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + gradientAccumulator = (Operand) op.input(inputIndex++); + gradientSquaredAccumulator = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + globalStep = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java index 615802c3be0..22d0edd340e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,34 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAdagradV2.OP_NAME, + inputsClass = ApplyAdagradV2.Inputs.class +) +@Operator( + group = "train" +) public final class ApplyAdagradV2 extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -41,8 +53,8 @@ public final class ApplyAdagradV2 extends RawOp implements Oper private Output out; - private ApplyAdagradV2(Operation operation) { - super(operation); + public ApplyAdagradV2(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -155,4 +167,64 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdagradV2.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new ApplyAdagradV2<>(op), op, Arrays.asList("T", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java index 5c47f6dbd56..8dbd525dc98 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,25 +17,33 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' according to the Adam algorithm. - * $$lr_t := \text{learning_rate} * \sqrt{1 - beta_2^t} / (1 - beta_1^t)$$ - * $$m_t := beta_1 * m_{t-1} + (1 - beta_1) * g$$ - * $$v_t := beta_2 * v_{t-1} + (1 - beta_2) * g * g$$ - * $$variable := variable - lr_t * m_t / (\sqrt{v_t} + \epsilon)$$ - * - * @param data type for {@code out} output + * $$\text{lr}t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta_2^t}}{1 - \beta_1^t}$$ + * $$m_t := \beta_1 \cdot m{t-1} + (1 - \beta_1) \cdot g$$ + * $$v_t := \beta_2 \cdot v_{t-1} + (1 - \beta_2) \cdot g^2$$ + * $$\text{var} := \begin{cases} \text{var} - (m_t \beta_1 + g \cdot (1 - \beta_1))\cdot\text{lr}_t/(\sqrt{v_t} + \epsilon), &\text{if use_nesterov}\\ \text{var} - m_t \cdot \text{lr}_t /(\sqrt{v_t} + \epsilon), &\text{otherwise} \end{cases}$$ */ +@OpMetadata( + opType = ApplyAdam.OP_NAME, + inputsClass = ApplyAdam.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +55,8 @@ public final class ApplyAdam extends RawOp implements Operand out; - private ApplyAdam(Operation operation) { - super(operation); + public ApplyAdam(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -172,4 +180,94 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAdam.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Should be from a Variable(). + */ + public final Operand v; + + /** + * Must be a scalar. + */ + public final Operand beta1Power; + + /** + * Must be a scalar. + */ + public final Operand beta2Power; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta1; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta2; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, uses the nesterov update. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ApplyAdam<>(op), op, Arrays.asList("T", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + beta1Power = (Operand) op.input(inputIndex++); + beta2Power = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java index e0e014d9438..69127231eb1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * m_t <- beta1 * m_{t-1} + (1 - beta1) * g * update <- (alpha + sign_decay * sign(g) *sign(m)) * g * variable <- variable - lr_t * update - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyAddSign.OP_NAME, + inputsClass = ApplyAddSign.Inputs.class +) @Operator( group = "train" ) @@ -46,8 +54,8 @@ public final class ApplyAddSign extends RawOp implements Operan private Output out; - private ApplyAddSign(Operation operation) { - super(operation); + public ApplyAddSign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -139,4 +147,70 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyAddSign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Must be a scalar. + */ + public final Operand alpha; + + /** + * Must be a scalar. + */ + public final Operand signDecay; + + /** + * Must be a scalar. + */ + public final Operand beta; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyAddSign<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + signDecay = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } 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 015487e6b0f..f7801bf277e 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -43,9 +49,11 @@ * ms <- rho * ms_{t-1} + (1-rho) * grad * grad * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) * var <- var - mom - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyCenteredRmsProp.OP_NAME, + inputsClass = ApplyCenteredRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -57,8 +65,8 @@ public final class ApplyCenteredRmsProp extends RawOp implement private Output out; - private ApplyCenteredRmsProp(Operation operation) { - super(operation); + public ApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -154,4 +162,82 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyCenteredRmsProp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand mg; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * Momentum Scale. Must be a scalar. + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyCenteredRmsProp<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + mg = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java index 2aa8c5146f0..cd010677d47 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,9 +42,11 @@ * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyFtrl.OP_NAME, + inputsClass = ApplyFtrl.Inputs.class +) @Operator( group = "train" ) @@ -50,8 +58,8 @@ public final class ApplyFtrl extends RawOp implements Operand out; - private ApplyFtrl(Operation operation) { - super(operation); + public ApplyFtrl(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private ApplyFtrl(Operation operation) { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ApplyFtrlV2} output and operands @@ -173,4 +181,88 @@ public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyFtrl.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand linear; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 shrinkage regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The l2Shrinkage input + */ + public final Operand l2Shrinkage; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lrPower; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The multiplyLinearByLr attribute + */ + public final boolean multiplyLinearByLr; + + public Inputs(GraphOperation op) { + super(new ApplyFtrl<>(op), op, Arrays.asList("T", "use_locking", "multiply_linear_by_lr")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + l2Shrinkage = (Operand) op.input(inputIndex++); + lrPower = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + multiplyLinearByLr = op.attributes().getAttrBool("multiply_linear_by_lr"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java index 116c546494b..5ebb7b31330 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,21 +17,29 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' by subtracting 'alpha' * 'delta' from it. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyGradientDescent.OP_NAME, + inputsClass = ApplyGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -43,8 +51,8 @@ public final class ApplyGradientDescent extends RawOp implement private Output out; - private ApplyGradientDescent(Operation operation) { - super(operation); + public ApplyGradientDescent(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -125,4 +133,45 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyGradientDescent.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * The change. + */ + public final Operand delta; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyGradientDescent<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java index 51e5ac6da61..1aa402b6783 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * Set use_nesterov = True if you want to use Nesterov momentum. *

    accum = accum * momentum + grad * var -= lr * accum - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyMomentum.OP_NAME, + inputsClass = ApplyMomentum.Inputs.class +) @Operator( group = "train" ) @@ -46,8 +54,8 @@ public final class ApplyMomentum extends RawOp implements Opera private Output out; - private ApplyMomentum(Operation operation) { - super(operation); + public ApplyMomentum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -164,4 +172,66 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyMomentum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ApplyMomentum<>(op), op, Arrays.asList("T", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java index 9990db09384..f298f853be2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * m_t <- beta1 * m_{t-1} + (1 - beta1) * g * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g * variable <- variable - lr_t * update - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyPowerSign.OP_NAME, + inputsClass = ApplyPowerSign.Inputs.class +) @Operator( group = "train" ) @@ -46,8 +54,8 @@ public final class ApplyPowerSign extends RawOp implements Oper private Output out; - private ApplyPowerSign(Operation operation) { - super(operation); + public ApplyPowerSign(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -139,4 +147,70 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyPowerSign.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Must be a scalar. + */ + public final Operand logbase; + + /** + * Must be a scalar. + */ + public final Operand signDecay; + + /** + * Must be a scalar. + */ + public final Operand beta; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyPowerSign<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + logbase = (Operand) op.input(inputIndex++); + signDecay = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java index 713ed8cbdca..a095146963b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,9 +38,11 @@ * accum += grad * grad * prox_v = var - lr * grad * (1 / sqrt(accum)) * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyProximalAdagrad.OP_NAME, + inputsClass = ApplyProximalAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -46,8 +54,8 @@ public final class ApplyProximalAdagrad extends RawOp implement private Output out; - private ApplyProximalAdagrad(Operation operation) { - super(operation); + public ApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -135,4 +143,63 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyProximalAdagrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyProximalAdagrad<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java index 65cce9b1594..ffd6ee70e68 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' as FOBOS algorithm with fixed learning rate. * prox_v = var - alpha * delta * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyProximalGradientDescent.OP_NAME, + inputsClass = ApplyProximalGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -45,8 +53,8 @@ public final class ApplyProximalGradientDescent extends RawOp i private Output out; - private ApplyProximalGradientDescent(Operation operation) { - super(operation); + public ApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -132,4 +140,57 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyProximalGradientDescent.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The change. + */ + public final Operand delta; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyProximalGradientDescent<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java index c64f1a76a37..fcfeb5b895a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,9 +43,11 @@ *

    ms <- rho * ms_{t-1} + (1-rho) * grad * grad * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) * var <- var - mom - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = ApplyRmsProp.OP_NAME, + inputsClass = ApplyRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -51,8 +59,8 @@ public final class ApplyRmsProp extends RawOp implements Operan private Output out; - private ApplyRmsProp(Operation operation) { - super(operation); + public ApplyRmsProp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -66,7 +74,7 @@ private ApplyRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attribute values @@ -146,4 +154,76 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ApplyRmsProp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ApplyRmsProp<>(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java index 0dbe8f569a1..17560573705 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -50,9 +56,11 @@ *

    NOTE: {@code train.BatchMatMul} supports broadcasting in the batch dimensions. More * about broadcasting * here . - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = BatchMatMul.OP_NAME, + inputsClass = BatchMatMul.Inputs.class +) @Operator( group = "train" ) @@ -64,8 +72,8 @@ public final class BatchMatMul extends RawOp implements Operand private Output output; - private BatchMatMul(Operation operation) { - super(operation); + public BatchMatMul(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -98,6 +106,12 @@ public static BatchMatMul create(Scope scope, Operand(opBuilder.build()); @@ -123,6 +137,26 @@ public static Options adjY(Boolean adjY) { return new Options().adjY(adjY); } + /** + * Sets the gradX option. + * + * @param gradX the gradX option + * @return this Options instance. + */ + public static Options gradX(Boolean gradX) { + return new Options().gradX(gradX); + } + + /** + * Sets the gradY option. + * + * @param gradY the gradY option + * @return this Options instance. + */ + public static Options gradY(Boolean gradY) { + return new Options().gradY(gradY); + } + /** * Gets output. * 3-D or higher with shape {@code [..., r_o, c_o]} @@ -145,6 +179,10 @@ public static class Options { private Boolean adjY; + private Boolean gradX; + + private Boolean gradY; + private Options() { } @@ -169,5 +207,91 @@ public Options adjY(Boolean adjY) { this.adjY = adjY; return this; } + + /** + * Sets the gradX option. + * + * @param gradX the gradX option + * @return this Options instance. + */ + public Options gradX(Boolean gradX) { + this.gradX = gradX; + return this; + } + + /** + * Sets the gradY option. + * + * @param gradY the gradY option + * @return this Options instance. + */ + public Options gradY(Boolean gradY) { + this.gradY = gradY; + return this; + } + } + + @OpInputsMetadata( + outputsClass = BatchMatMul.class + ) + public static class Inputs extends RawOpInputs> { + /** + * 2-D or higher with shape {@code [..., r_x, c_x]}. + */ + public final Operand x; + + /** + * 2-D or higher with shape {@code [..., r_y, c_y]}. + */ + public final Operand y; + + /** + * The Ta attribute + */ + public final DataType Ta; + + /** + * The Tb attribute + */ + public final DataType Tb; + + /** + * If not spcified, Tout is the same type to input type. + */ + public final DataType Tout; + + /** + * If {@code True}, adjoint the slices of {@code x}. Defaults to {@code False}. + */ + public final boolean adjX; + + /** + * If {@code True}, adjoint the slices of {@code y}. Defaults to {@code False}. + */ + public final boolean adjY; + + /** + * The gradX attribute + */ + public final boolean gradX; + + /** + * The gradY attribute + */ + public final boolean gradY; + + public Inputs(GraphOperation op) { + super(new BatchMatMul<>(op), op, Arrays.asList("Ta", "Tb", "Tout", "adj_x", "adj_y", "grad_x", "grad_y")); + int inputIndex = 0; + x = (Operand) op.input(inputIndex++); + y = (Operand) op.input(inputIndex++); + Ta = op.attributes().getAttrType("Ta"); + Tb = op.attributes().getAttrType("Tb"); + Tout = op.attributes().getAttrType("Tout"); + adjX = op.attributes().getAttrBool("adj_x"); + adjY = op.attributes().getAttrBool("adj_y"); + gradX = op.attributes().getAttrBool("grad_x"); + gradY = op.attributes().getAttrBool("grad_y"); + } } } 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 index 707132417e7..1e6930d5410 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Computes the static batch size of a dataset sans partial batches. */ +@OpMetadata( + opType = ComputeBatchSize.OP_NAME, + inputsClass = ComputeBatchSize.Inputs.class +) +@Operator( + group = "train" +) public final class ComputeBatchSize extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class ComputeBatchSize extends RawOp implements Operand { private Output batchSize; - private ComputeBatchSize(Operation operation) { - super(operation); + public ComputeBatchSize(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; batchSize = operation.output(outputIdx++); } @@ -48,7 +61,7 @@ private ComputeBatchSize(Operation operation) { * Factory method to create a class wrapping a new ComputeBatchSize operation. * * @param scope current scope - * @param inputDataset the inputDataset value + * @param inputDataset The inputDataset value * @return a new instance of ComputeBatchSize */ @Endpoint( @@ -73,4 +86,20 @@ public Output batchSize() { public Output asOutput() { return batchSize; } + + @OpInputsMetadata( + outputsClass = ComputeBatchSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The inputDataset input + */ + public final Operand inputDataset; + + public Inputs(GraphOperation op) { + super(new ComputeBatchSize(op), op, Arrays.asList()); + int inputIndex = 0; + inputDataset = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java index 96449ca58e3..14e9c6f238b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -39,6 +45,10 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ +@OpMetadata( + opType = ConditionalAccumulator.OP_NAME, + inputsClass = ConditionalAccumulator.Inputs.class +) @Operator( group = "train" ) @@ -50,8 +60,8 @@ public final class ConditionalAccumulator extends RawOp implements Operand handle; - private ConditionalAccumulator(Operation operation) { - super(operation); + public ConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -184,4 +194,46 @@ public Options reductionType(String reductionType) { return this; } } + + @OpInputsMetadata( + outputsClass = ConditionalAccumulator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of the value being accumulated. + */ + public final DataType dtype; + + /** + * The shape of the values, can be [], in which case shape is unknown. + */ + public final Shape shape; + + /** + * If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + */ + public final String sharedName; + + /** + * The reductionType attribute + */ + public final String reductionType; + + public Inputs(GraphOperation op) { + super(new ConditionalAccumulator(op), op, Arrays.asList("dtype", "shape", "container", "shared_name", "reduction_type")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + reductionType = op.attributes().getAttrString("reduction_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/DistributedSave.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/DistributedSave.java new file mode 100644 index 00000000000..5572cc4a03f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/DistributedSave.java @@ -0,0 +1,148 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * The DistributedSave operation + */ +@OpMetadata( + opType = DistributedSave.OP_NAME, + inputsClass = DistributedSave.Inputs.class +) +@Operator( + group = "train" +) +public final class DistributedSave extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DistributedSave"; + + public DistributedSave(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new DistributedSave operation. + * + * @param scope current scope + * @param dataset The dataset value + * @param directory The directory value + * @param address The address value + * @param options carries optional attribute values + * @return a new instance of DistributedSave + */ + @Endpoint( + describeByClass = true + ) + public static DistributedSave create(Scope scope, Operand dataset, + Operand directory, Operand address, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DistributedSave"); + opBuilder.addInput(dataset.asOutput()); + opBuilder.addInput(directory.asOutput()); + opBuilder.addInput(address.asOutput()); + if (options != null) { + for (Options opts : options) { + if (opts.metadata != null) { + opBuilder.setAttr("metadata", opts.metadata); + } + } + } + return new DistributedSave(opBuilder.build()); + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public static Options metadata(String metadata) { + return new Options().metadata(metadata); + } + + /** + * Optional attributes for {@link org.tensorflow.op.train.DistributedSave} + */ + public static class Options { + private String metadata; + + private Options() { + } + + /** + * Sets the metadata option. + * + * @param metadata the metadata option + * @return this Options instance. + */ + public Options metadata(String metadata) { + this.metadata = metadata; + return this; + } + } + + @OpInputsMetadata( + outputsClass = DistributedSave.class + ) + public static class Inputs extends RawOpInputs { + /** + * The dataset input + */ + public final Operand dataset; + + /** + * The directory input + */ + public final Operand directory; + + /** + * The address input + */ + public final Operand address; + + /** + * The metadata attribute + */ + public final String metadata; + + public Inputs(GraphOperation op) { + super(new DistributedSave(op), op, Arrays.asList("metadata")); + int inputIndex = 0; + dataset = (Operand) op.input(inputIndex++); + directory = (Operand) op.input(inputIndex++); + address = (Operand) op.input(inputIndex++); + metadata = op.attributes().getAttrString("metadata"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java index e6797a7111c..bf79c767b0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -56,6 +61,10 @@ * use the corresponding index_table_from_file() as the FeatureColumn framework * does (as opposed to tf.feature_to_id(), which uses a CuckooTable). */ +@OpMetadata( + opType = GenerateVocabRemapping.OP_NAME, + inputsClass = GenerateVocabRemapping.Inputs.class +) @Operator( group = "train" ) @@ -69,8 +78,8 @@ public final class GenerateVocabRemapping extends RawOp { private Output numPresent; - private GenerateVocabRemapping(Operation operation) { - super(operation); + public GenerateVocabRemapping(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; remapping = operation.output(outputIdx++); numPresent = operation.output(outputIdx++); @@ -159,4 +168,45 @@ public Options oldVocabSize(Long oldVocabSize) { return this; } } + + @OpInputsMetadata( + outputsClass = GenerateVocabRemapping.class + ) + public static class Inputs extends RawOpInputs { + /** + * Path to the new vocab file. + */ + public final Operand newVocabFile; + + /** + * Path to the old vocab file. + */ + public final Operand oldVocabFile; + + /** + * How many entries into the new vocab file to start reading. + */ + public final long newVocabOffset; + + /** + * Number of entries in the new vocab file to remap. + */ + public final long numNewVocab; + + /** + * Number of entries in the old vocab file to consider. If -1, + * use the entire old vocabulary. + */ + public final long oldVocabSize; + + public Inputs(GraphOperation op) { + super(new GenerateVocabRemapping(op), op, Arrays.asList("new_vocab_offset", "num_new_vocab", "old_vocab_size")); + int inputIndex = 0; + newVocabFile = (Operand) op.input(inputIndex++); + oldVocabFile = (Operand) op.input(inputIndex++); + newVocabOffset = op.attributes().getAttrInt("new_vocab_offset"); + numNewVocab = op.attributes().getAttrInt("num_new_vocab"); + oldVocabSize = op.attributes().getAttrInt("old_vocab_size"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java index 9172767def8..43b599a073f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,17 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; @@ -34,7 +39,14 @@ *

    If delete_old_dirs is true, attempts to delete recursively the dirname of each * path in the input checkpoint_prefixes. This is useful when those paths are non * user-facing temporary locations. + *

    If allow_missing_files is true, merges the checkpoint prefixes as long as + * at least one file exists. Otherwise, if no files exist, an error will be thrown. + * The default value for allow_missing_files is false. */ +@OpMetadata( + opType = MergeV2Checkpoints.OP_NAME, + inputsClass = MergeV2Checkpoints.Inputs.class +) @Operator( group = "train" ) @@ -44,8 +56,8 @@ public final class MergeV2Checkpoints extends RawOp { */ public static final String OP_NAME = "MergeV2Checkpoints"; - private MergeV2Checkpoints(Operation operation) { - super(operation); + public MergeV2Checkpoints(Operation operation) { + super(operation, OP_NAME); } /** @@ -71,6 +83,9 @@ public static MergeV2Checkpoints create(Scope scope, Operand checkpoint if (opts.deleteOldDirs != null) { opBuilder.setAttr("delete_old_dirs", opts.deleteOldDirs); } + if (opts.allowMissingFiles != null) { + opBuilder.setAttr("allow_missing_files", opts.allowMissingFiles); + } } } return new MergeV2Checkpoints(opBuilder.build()); @@ -86,12 +101,24 @@ public static Options deleteOldDirs(Boolean deleteOldDirs) { return new Options().deleteOldDirs(deleteOldDirs); } + /** + * Sets the allowMissingFiles option. + * + * @param allowMissingFiles see above. + * @return this Options instance. + */ + public static Options allowMissingFiles(Boolean allowMissingFiles) { + return new Options().allowMissingFiles(allowMissingFiles); + } + /** * Optional attributes for {@link org.tensorflow.op.train.MergeV2Checkpoints} */ public static class Options { private Boolean deleteOldDirs; + private Boolean allowMissingFiles; + private Options() { } @@ -105,5 +132,51 @@ public Options deleteOldDirs(Boolean deleteOldDirs) { this.deleteOldDirs = deleteOldDirs; return this; } + + /** + * Sets the allowMissingFiles option. + * + * @param allowMissingFiles see above. + * @return this Options instance. + */ + public Options allowMissingFiles(Boolean allowMissingFiles) { + this.allowMissingFiles = allowMissingFiles; + return this; + } + } + + @OpInputsMetadata( + outputsClass = MergeV2Checkpoints.class + ) + public static class Inputs extends RawOpInputs { + /** + * prefixes of V2 checkpoints to merge. + */ + public final Operand checkpointPrefixes; + + /** + * scalar. The desired final prefix. Allowed to be the same + * as one of the checkpoint_prefixes. + */ + public final Operand destinationPrefix; + + /** + * see above. + */ + public final boolean deleteOldDirs; + + /** + * see above. + */ + public final boolean allowMissingFiles; + + public Inputs(GraphOperation op) { + super(new MergeV2Checkpoints(op), op, Arrays.asList("delete_old_dirs", "allow_missing_files")); + int inputIndex = 0; + checkpointPrefixes = (Operand) op.input(inputIndex++); + destinationPrefix = (Operand) op.input(inputIndex++); + deleteOldDirs = op.attributes().getAttrBool("delete_old_dirs"); + allowMissingFiles = op.attributes().getAttrBool("allow_missing_files"); + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java index d41712ac70c..f012cdff257 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.train; +import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -31,6 +36,10 @@ /** * Training via negative sampling. */ +@OpMetadata( + opType = NegTrain.OP_NAME, + inputsClass = NegTrain.Inputs.class +) @Operator( group = "train" ) @@ -40,8 +49,8 @@ public final class NegTrain extends RawOp { */ public static final String OP_NAME = "NegTrain"; - private NegTrain(Operation operation) { - super(operation); + public NegTrain(Operation operation) { + super(operation, OP_NAME); } /** @@ -52,7 +61,7 @@ private NegTrain(Operation operation) { * @param wOut output word embedding. * @param examples A vector of word ids. * @param labels A vector of word ids. - * @param lr the lr value + * @param lr The lr value * @param vocabCount Count of words in the vocabulary. * @param numNegativeSamples Number of negative samples per example. * @return a new instance of NegTrain @@ -77,4 +86,56 @@ public static NegTrain create(Scope scope, Operand wIn, Operand { + /** + * input word embedding. + */ + public final Operand wIn; + + /** + * output word embedding. + */ + public final Operand wOut; + + /** + * A vector of word ids. + */ + public final Operand examples; + + /** + * A vector of word ids. + */ + public final Operand labels; + + /** + * The lr input + */ + public final Operand lr; + + /** + * Count of words in the vocabulary. + */ + public final long[] vocabCount; + + /** + * Number of negative samples per example. + */ + public final long numNegativeSamples; + + public Inputs(GraphOperation op) { + super(new NegTrain(op), op, Arrays.asList("vocab_count", "num_negative_samples")); + int inputIndex = 0; + wIn = (Operand) op.input(inputIndex++); + wOut = (Operand) op.input(inputIndex++); + examples = (Operand) op.input(inputIndex++); + labels = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + vocabCount = op.attributes().getAttrIntList("vocab_count"); + numNegativeSamples = op.attributes().getAttrInt("num_negative_samples"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java index 68e248aa696..c98b11d0050 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * because no gradient must ever be registered for this function. This * op exists to prevent subtle bugs from silently returning unimplemented * gradients in some corner cases. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = PreventGradient.OP_NAME, + inputsClass = PreventGradient.Inputs.class +) @Operator( group = "train" ) @@ -49,8 +57,8 @@ public final class PreventGradient extends RawOp implements Ope private Output output; - private PreventGradient(Operation operation) { - super(operation); + public PreventGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -127,4 +135,33 @@ public Options message(String message) { return this; } } + + @OpInputsMetadata( + outputsClass = PreventGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * any tensor. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Will be printed in the error when anyone tries to differentiate + * this operation. + */ + public final String message; + + public Inputs(GraphOperation op) { + super(new PreventGradient<>(op), op, Arrays.asList("T", "message")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + message = op.attributes().getAttrString("message"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java index 98f187541c9..a13e18fe22a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -30,14 +37,21 @@ * Applies a gradient to a given accumulator. * Does not add if local_step is lesser than the accumulator's global_step. */ +@OpMetadata( + opType = ResourceAccumulatorApplyGradient.OP_NAME, + inputsClass = ResourceAccumulatorApplyGradient.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceAccumulatorApplyGradient extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ResourceAccumulatorApplyGradient"; - private ResourceAccumulatorApplyGradient(Operation operation) { - super(operation); + public ResourceAccumulatorApplyGradient(Operation operation) { + super(operation, OP_NAME); } /** @@ -61,4 +75,39 @@ public static ResourceAccumulatorApplyGradient create(Scope scope, opBuilder.addInput(gradient.asOutput()); return new ResourceAccumulatorApplyGradient(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceAccumulatorApplyGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to a accumulator. + */ + public final Operand handle; + + /** + * The local_step value at which the gradient was computed. + */ + public final Operand localStep; + + /** + * A tensor of the gradient to be accumulated. + */ + public final Operand gradient; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new ResourceAccumulatorApplyGradient(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + localStep = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java index 9041826e913..639f54c9b2d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,32 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Returns the number of gradients aggregated in the given accumulators. */ +@OpMetadata( + opType = ResourceAccumulatorNumAccumulated.OP_NAME, + inputsClass = ResourceAccumulatorNumAccumulated.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceAccumulatorNumAccumulated extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -38,8 +51,8 @@ public final class ResourceAccumulatorNumAccumulated extends RawOp implements Op private Output numAccumulated; - private ResourceAccumulatorNumAccumulated(Operation operation) { - super(operation); + public ResourceAccumulatorNumAccumulated(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; numAccumulated = operation.output(outputIdx++); } @@ -74,4 +87,20 @@ public Output numAccumulated() { public Output asOutput() { return numAccumulated; } + + @OpInputsMetadata( + outputsClass = ResourceAccumulatorNumAccumulated.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + public Inputs(GraphOperation op) { + super(new ResourceAccumulatorNumAccumulated(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java index b634dca59b8..9b73fa3b03d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,18 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -31,14 +37,21 @@ * Logs warning if the accumulator's value is already higher than * new_global_step. */ +@OpMetadata( + opType = ResourceAccumulatorSetGlobalStep.OP_NAME, + inputsClass = ResourceAccumulatorSetGlobalStep.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceAccumulatorSetGlobalStep extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ResourceAccumulatorSetGlobalStep"; - private ResourceAccumulatorSetGlobalStep(Operation operation) { - super(operation); + public ResourceAccumulatorSetGlobalStep(Operation operation) { + super(operation, OP_NAME); } /** @@ -59,4 +72,26 @@ public static ResourceAccumulatorSetGlobalStep create(Scope scope, opBuilder.addInput(newGlobalStep.asOutput()); return new ResourceAccumulatorSetGlobalStep(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = ResourceAccumulatorSetGlobalStep.class + ) + public static class Inputs extends RawOpInputs { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + /** + * The new global_step value to set. + */ + public final Operand newGlobalStep; + + public Inputs(GraphOperation op) { + super(new ResourceAccumulatorSetGlobalStep(op), op, Arrays.asList()); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + newGlobalStep = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java index 867f0751001..843ecae89f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,21 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -35,9 +42,14 @@ * aggregated more than num_required gradients, it returns the average of * the accumulated gradients. Also automatically increments the recorded * global_step in the accumulator by 1, and resets the aggregate to 0. - * - * @param data type for {@code average} output */ +@OpMetadata( + opType = ResourceAccumulatorTakeGradient.OP_NAME, + inputsClass = ResourceAccumulatorTakeGradient.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceAccumulatorTakeGradient extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -46,8 +58,8 @@ public final class ResourceAccumulatorTakeGradient extends RawO private Output average; - private ResourceAccumulatorTakeGradient(Operation operation) { - super(operation); + public ResourceAccumulatorTakeGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; average = operation.output(outputIdx++); } @@ -88,4 +100,33 @@ public Output average() { public Output asOutput() { return average; } + + @OpInputsMetadata( + outputsClass = ResourceAccumulatorTakeGradient.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The handle to an accumulator. + */ + public final Operand handle; + + /** + * Number of gradients required before we return an aggregate. + */ + public final Operand numRequired; + + /** + * The data type of accumulated gradients. Needs to correspond to the type + * of the accumulator. + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new ResourceAccumulatorTakeGradient<>(op), op, Arrays.asList("dtype")); + int inputIndex = 0; + handle = (Operand) op.input(inputIndex++); + numRequired = (Operand) op.input(inputIndex++); + dtype = op.attributes().getAttrType("dtype"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java index fb5947e5ab7..470a8f8414c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,14 +38,21 @@ * v_t <- max(beta2 * v_{t-1}, abs(g)) * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) */ +@OpMetadata( + opType = ResourceApplyAdaMax.OP_NAME, + inputsClass = ResourceApplyAdaMax.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdaMax extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ResourceApplyAdaMax"; - private ResourceApplyAdaMax(Operation operation) { - super(operation); + public ResourceApplyAdaMax(Operation operation) { + super(operation, OP_NAME); } /** @@ -119,4 +133,82 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdaMax.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Should be from a Variable(). + */ + public final Operand v; + + /** + * Must be a scalar. + */ + public final Operand beta1Power; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta1; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta2; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdaMax(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + beta1Power = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java index f7f572719da..dc30c1ec5b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -33,6 +39,10 @@ * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; */ +@OpMetadata( + opType = ResourceApplyAdadelta.OP_NAME, + inputsClass = ResourceApplyAdadelta.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +52,8 @@ public final class ResourceApplyAdadelta extends RawOp { */ public static final String OP_NAME = "ResourceApplyAdadelta"; - private ResourceApplyAdadelta(Operation operation) { - super(operation); + public ResourceApplyAdadelta(Operation operation) { + super(operation, OP_NAME); } /** @@ -118,4 +128,69 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdadelta.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand accumUpdate; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay factor. Must be a scalar. + */ + public final Operand rho; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var, accum and update_accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdadelta(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + accumUpdate = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java index ca8682dc2b1..ac3806954e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -30,14 +37,21 @@ * accum += grad * grad * var -= lr * grad * (1 / (sqrt(accum) + epsilon)) */ +@OpMetadata( + opType = ResourceApplyAdagrad.OP_NAME, + inputsClass = ResourceApplyAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceApplyAdagrad extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ResourceApplyAdagradV2"; - private ResourceApplyAdagrad(Operation operation) { - super(operation); + public ResourceApplyAdagrad(Operation operation) { + super(operation, OP_NAME); } /** @@ -135,4 +149,64 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdagrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdagrad(op), op, Arrays.asList("T", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java index 5062953430b..c6570d399a8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Update '*var' according to the proximal adagrad scheme. */ +@OpMetadata( + opType = ResourceApplyAdagradDa.OP_NAME, + inputsClass = ResourceApplyAdagradDa.Inputs.class +) @Operator( group = "train" ) @@ -39,8 +49,8 @@ public final class ResourceApplyAdagradDa extends RawOp { */ public static final String OP_NAME = "ResourceApplyAdagradDA"; - private ResourceApplyAdagradDa(Operation operation) { - super(operation); + public ResourceApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); } /** @@ -117,4 +127,75 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdagradDa.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand gradientAccumulator; + + /** + * Should be from a Variable(). + */ + public final Operand gradientSquaredAccumulator; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * Training step number. Must be a scalar. + */ + public final Operand globalStep; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdagradDa(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + gradientAccumulator = (Operand) op.input(inputIndex++); + gradientSquaredAccumulator = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + globalStep = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java index eb4d8d0ffd2..72f1a536229 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,32 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' according to the Adam algorithm. - * $$\text{lr}t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ - * $$m_t := \beta_1 * m{t-1} + (1 - \beta_1) * g$$ - * $$v_t := \beta_2 * v_{t-1} + (1 - \beta_2) * g * g$$ - * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{v_t} + \epsilon)$$ + * $$\text{lr}t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta_2^t}}{1 - \beta_1^t}$$ + * $$m_t := \beta_1 \cdot m{t-1} + (1 - \beta_1) \cdot g$$ + * $$v_t := \beta_2 \cdot v_{t-1} + (1 - \beta_2) \cdot g^2$$ + * $$\text{var} := \begin{cases} \text{var} - (m_t \beta_1 + g \cdot (1 - \beta_1))\cdot\text{lr}_t/(\sqrt{v_t} + \epsilon), &\text{if use_nesterov}\\ \text{var} - m_t \cdot \text{lr}_t /(\sqrt{v_t} + \epsilon), &\text{otherwise} \end{cases}$$ */ +@OpMetadata( + opType = ResourceApplyAdam.OP_NAME, + inputsClass = ResourceApplyAdam.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +52,8 @@ public final class ResourceApplyAdam extends RawOp { */ public static final String OP_NAME = "ResourceApplyAdam"; - private ResourceApplyAdam(Operation operation) { - super(operation); + public ResourceApplyAdam(Operation operation) { + super(operation, OP_NAME); } /** @@ -152,4 +162,94 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdam.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Should be from a Variable(). + */ + public final Operand v; + + /** + * Must be a scalar. + */ + public final Operand beta1Power; + + /** + * Must be a scalar. + */ + public final Operand beta2Power; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta1; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta2; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, uses the nesterov update. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdam(op), op, Arrays.asList("T", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + beta1Power = (Operand) op.input(inputIndex++); + beta2Power = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java index be9f35d16ea..ae6100e8d6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -34,6 +40,10 @@ * $$\hat{v}t := max{\hat{v}{t-1}, v_t}$$ * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{\hat{v}_t} + \epsilon)$$ */ +@OpMetadata( + opType = ResourceApplyAdamWithAmsgrad.OP_NAME, + inputsClass = ResourceApplyAdamWithAmsgrad.Inputs.class +) @Operator( group = "train" ) @@ -43,8 +53,8 @@ public final class ResourceApplyAdamWithAmsgrad extends RawOp { */ public static final String OP_NAME = "ResourceApplyAdamWithAmsgrad"; - private ResourceApplyAdamWithAmsgrad(Operation operation) { - super(operation); + public ResourceApplyAdamWithAmsgrad(Operation operation) { + super(operation, OP_NAME); } /** @@ -129,4 +139,94 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAdamWithAmsgrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Should be from a Variable(). + */ + public final Operand v; + + /** + * Should be from a Variable(). + */ + public final Operand vhat; + + /** + * Must be a scalar. + */ + public final Operand beta1Power; + + /** + * Must be a scalar. + */ + public final Operand beta2Power; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta1; + + /** + * Momentum factor. Must be a scalar. + */ + public final Operand beta2; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAdamWithAmsgrad(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + v = (Operand) op.input(inputIndex++); + vhat = (Operand) op.input(inputIndex++); + beta1Power = (Operand) op.input(inputIndex++); + beta2Power = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java index 5a5d2fd2520..40d85ae0cf3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ * update <- (alpha + sign_decay * sign(g) *sign(m)) * g * variable <- variable - lr_t * update */ +@OpMetadata( + opType = ResourceApplyAddSign.OP_NAME, + inputsClass = ResourceApplyAddSign.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class ResourceApplyAddSign extends RawOp { */ public static final String OP_NAME = "ResourceApplyAddSign"; - private ResourceApplyAddSign(Operation operation) { - super(operation); + public ResourceApplyAddSign(Operation operation) { + super(operation, OP_NAME); } /** @@ -118,4 +128,70 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyAddSign.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Must be a scalar. + */ + public final Operand alpha; + + /** + * Must be a scalar. + */ + public final Operand signDecay; + + /** + * Must be a scalar. + */ + public final Operand beta; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyAddSign(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + signDecay = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } 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 d10936d4253..6cff8d24ef9 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -43,6 +49,10 @@ * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) * var <- var - mom */ +@OpMetadata( + opType = ResourceApplyCenteredRmsProp.OP_NAME, + inputsClass = ResourceApplyCenteredRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -52,8 +62,8 @@ public final class ResourceApplyCenteredRmsProp extends RawOp { */ public static final String OP_NAME = "ResourceApplyCenteredRMSProp"; - private ResourceApplyCenteredRmsProp(Operation operation) { - super(operation); + public ResourceApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); } /** @@ -134,4 +144,82 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyCenteredRmsProp.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand mg; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * Momentum Scale. Must be a scalar. + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyCenteredRmsProp(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + mg = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java index d082bbfc45d..8fdfa5ad729 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -36,6 +42,10 @@ * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ +@OpMetadata( + opType = ResourceApplyFtrl.OP_NAME, + inputsClass = ResourceApplyFtrl.Inputs.class +) @Operator( group = "train" ) @@ -45,8 +55,8 @@ public final class ResourceApplyFtrl extends RawOp { */ public static final String OP_NAME = "ResourceApplyFtrlV2"; - private ResourceApplyFtrl(Operation operation) { - super(operation); + public ResourceApplyFtrl(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,7 +70,7 @@ private ResourceApplyFtrl(Operation operation) { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ResourceApplyFtrlV2} output and operands @@ -153,4 +163,88 @@ public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyFtrl.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand linear; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 shrinkage regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The l2Shrinkage input + */ + public final Operand l2Shrinkage; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lrPower; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The multiplyLinearByLr attribute + */ + public final boolean multiplyLinearByLr; + + public Inputs(GraphOperation op) { + super(new ResourceApplyFtrl(op), op, Arrays.asList("T", "use_locking", "multiply_linear_by_lr")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + l2Shrinkage = (Operand) op.input(inputIndex++); + lrPower = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + multiplyLinearByLr = op.attributes().getAttrBool("multiply_linear_by_lr"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java index f772d2c6361..7dc413ab0f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,18 +17,28 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Update '*var' by subtracting 'alpha' * 'delta' from it. */ +@OpMetadata( + opType = ResourceApplyGradientDescent.OP_NAME, + inputsClass = ResourceApplyGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -38,8 +48,8 @@ public final class ResourceApplyGradientDescent extends RawOp { */ public static final String OP_NAME = "ResourceApplyGradientDescent"; - private ResourceApplyGradientDescent(Operation operation) { - super(operation); + public ResourceApplyGradientDescent(Operation operation) { + super(operation, OP_NAME); } /** @@ -104,4 +114,45 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyGradientDescent.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * The change. + */ + public final Operand delta; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyGradientDescent(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java index bb6a9f3169c..eed3d1d6c56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ *

    accum = accum * momentum - lr * grad * var += accum */ +@OpMetadata( + opType = ResourceApplyKerasMomentum.OP_NAME, + inputsClass = ResourceApplyKerasMomentum.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class ResourceApplyKerasMomentum extends RawOp { */ public static final String OP_NAME = "ResourceApplyKerasMomentum"; - private ResourceApplyKerasMomentum(Operation operation) { - super(operation); + public ResourceApplyKerasMomentum(Operation operation) { + super(operation, OP_NAME); } /** @@ -144,4 +154,66 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyKerasMomentum.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var + momentum * accum, so in the end, the var you get is actually + * var + momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ResourceApplyKerasMomentum(op), op, Arrays.asList("T", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java index f4a9058871a..87c929279cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ *

    accum = accum * momentum + grad * var -= lr * accum */ +@OpMetadata( + opType = ResourceApplyMomentum.OP_NAME, + inputsClass = ResourceApplyMomentum.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class ResourceApplyMomentum extends RawOp { */ public static final String OP_NAME = "ResourceApplyMomentum"; - private ResourceApplyMomentum(Operation operation) { - super(operation); + public ResourceApplyMomentum(Operation operation) { + super(operation, OP_NAME); } /** @@ -144,4 +154,66 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyMomentum.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ResourceApplyMomentum(op), op, Arrays.asList("T", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java index 397de82bac3..e5c619e6afd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g * variable <- variable - lr_t * update */ +@OpMetadata( + opType = ResourceApplyPowerSign.OP_NAME, + inputsClass = ResourceApplyPowerSign.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class ResourceApplyPowerSign extends RawOp { */ public static final String OP_NAME = "ResourceApplyPowerSign"; - private ResourceApplyPowerSign(Operation operation) { - super(operation); + public ResourceApplyPowerSign(Operation operation) { + super(operation, OP_NAME); } /** @@ -118,4 +128,70 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyPowerSign.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand m; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Must be a scalar. + */ + public final Operand logbase; + + /** + * Must be a scalar. + */ + public final Operand signDecay; + + /** + * Must be a scalar. + */ + public final Operand beta; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyPowerSign(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + m = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + logbase = (Operand) op.input(inputIndex++); + signDecay = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java index 177ee0b4ec7..55a81bb3607 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ * prox_v = var - lr * grad * (1 / sqrt(accum)) * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ +@OpMetadata( + opType = ResourceApplyProximalAdagrad.OP_NAME, + inputsClass = ResourceApplyProximalAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -41,8 +51,8 @@ public final class ResourceApplyProximalAdagrad extends RawOp { */ public static final String OP_NAME = "ResourceApplyProximalAdagrad"; - private ResourceApplyProximalAdagrad(Operation operation) { - super(operation); + public ResourceApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); } /** @@ -114,4 +124,63 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyProximalAdagrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyProximalAdagrad(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java index 4dd1fc9a361..0a6bebea532 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -31,6 +37,10 @@ * prox_v = var - alpha * delta * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ +@OpMetadata( + opType = ResourceApplyProximalGradientDescent.OP_NAME, + inputsClass = ResourceApplyProximalGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -40,8 +50,8 @@ public final class ResourceApplyProximalGradientDescent extends RawOp { */ public static final String OP_NAME = "ResourceApplyProximalGradientDescent"; - private ResourceApplyProximalGradientDescent(Operation operation) { - super(operation); + public ResourceApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); } /** @@ -111,4 +121,57 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyProximalGradientDescent.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The change. + */ + public final Operand delta; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyProximalGradientDescent(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + delta = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java index c6b569388ed..3d223d98904 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -37,6 +43,10 @@ * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) * var <- var - mom */ +@OpMetadata( + opType = ResourceApplyRmsProp.OP_NAME, + inputsClass = ResourceApplyRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -46,8 +56,8 @@ public final class ResourceApplyRmsProp extends RawOp { */ public static final String OP_NAME = "ResourceApplyRMSProp"; - private ResourceApplyRmsProp(Operation operation) { - super(operation); + public ResourceApplyRmsProp(Operation operation) { + super(operation, OP_NAME); } /** @@ -59,7 +69,7 @@ private ResourceApplyRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attribute values @@ -126,4 +136,76 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceApplyRmsProp.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * The T attribute + */ + public final DataType T; + + /** + * If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceApplyRmsProp(op), op, Arrays.asList("T", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java index 546a566f45a..93da410ed51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,8 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -39,6 +46,13 @@ * This is a resource version of ConditionalAccumulator that will work in TF2.0 * with tf.cond version 2. */ +@OpMetadata( + opType = ResourceConditionalAccumulator.OP_NAME, + inputsClass = ResourceConditionalAccumulator.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceConditionalAccumulator extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -48,8 +62,8 @@ public final class ResourceConditionalAccumulator extends RawOp implements Opera private Output handle; @SuppressWarnings("unchecked") - private ResourceConditionalAccumulator(Operation operation) { - super(operation); + public ResourceConditionalAccumulator(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; handle = operation.output(outputIdx++); } @@ -183,4 +197,46 @@ public Options reductionType(String reductionType) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceConditionalAccumulator.class + ) + public static class Inputs extends RawOpInputs { + /** + * The type of the value being accumulated. + */ + public final DataType dtype; + + /** + * The shape of the values, can be [], in which case shape is unknown. + */ + public final Shape shape; + + /** + * If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + */ + public final String container; + + /** + * If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + */ + public final String sharedName; + + /** + * The reductionType attribute + */ + public final String reductionType; + + public Inputs(GraphOperation op) { + super(new ResourceConditionalAccumulator(op), op, Arrays.asList("dtype", "shape", "container", "shared_name", "reduction_type")); + int inputIndex = 0; + dtype = op.attributes().getAttrType("dtype"); + shape = op.attributes().getAttrShape("shape"); + container = op.attributes().getAttrString("container"); + sharedName = op.attributes().getAttrString("shared_name"); + reductionType = op.attributes().getAttrString("reduction_type"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java index 816e18737ca..d74a6047bde 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,29 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * var: Should be from a Variable(). */ +@OpMetadata( + opType = ResourceSparseApplyAdadelta.OP_NAME, + inputsClass = ResourceSparseApplyAdadelta.Inputs.class +) @Operator( group = "train" ) @@ -39,15 +49,15 @@ public final class ResourceSparseApplyAdadelta extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyAdadelta"; - private ResourceSparseApplyAdadelta(Operation operation) { - super(operation); + public ResourceSparseApplyAdadelta(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new ResourceSparseApplyAdadelta operation. * * @param scope current scope - * @param var the var value + * @param var The var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -117,4 +127,81 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyAdadelta.class + ) + public static class Inputs extends RawOpInputs { + /** + * The var input + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * : Should be from a Variable(). + */ + public final Operand accumUpdate; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay factor. Must be a scalar. + */ + public final Operand rho; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyAdadelta(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + accumUpdate = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java index 733fc1f3f6b..1db5e0b46f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) */ +@OpMetadata( + opType = ResourceSparseApplyAdagrad.OP_NAME, + inputsClass = ResourceSparseApplyAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +52,8 @@ public final class ResourceSparseApplyAdagrad extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyAdagrad"; - private ResourceSparseApplyAdagrad(Operation operation) { - super(operation); + public ResourceSparseApplyAdagrad(Operation operation) { + super(operation, OP_NAME); } /** @@ -141,4 +151,70 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyAdagrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyAdagrad(op), op, Arrays.asList("T", "Tindices", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java index d2c3ea597e8..628f2798909 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -31,6 +37,10 @@ /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. */ +@OpMetadata( + opType = ResourceSparseApplyAdagradDa.OP_NAME, + inputsClass = ResourceSparseApplyAdagradDa.Inputs.class +) @Operator( group = "train" ) @@ -40,8 +50,8 @@ public final class ResourceSparseApplyAdagradDa extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyAdagradDA"; - private ResourceSparseApplyAdagradDa(Operation operation) { - super(operation); + public ResourceSparseApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); } /** @@ -121,4 +131,87 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyAdagradDa.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand gradientAccumulator; + + /** + * Should be from a Variable(). + */ + public final Operand gradientSquaredAccumulator; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * Training step number. Must be a scalar. + */ + public final Operand globalStep; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyAdagradDa(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + gradientAccumulator = (Operand) op.input(inputIndex++); + gradientSquaredAccumulator = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + globalStep = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java index a432cee80f3..a70242aa371 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,12 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,14 +39,21 @@ * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) */ +@OpMetadata( + opType = ResourceSparseApplyAdagradV2.OP_NAME, + inputsClass = ResourceSparseApplyAdagradV2.Inputs.class +) +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagradV2 extends RawOp { /** * The name of this op, as known by TensorFlow core engine */ public static final String OP_NAME = "ResourceSparseApplyAdagradV2"; - private ResourceSparseApplyAdagradV2(Operation operation) { - super(operation); + public ResourceSparseApplyAdagradV2(Operation operation) { + super(operation, OP_NAME); } /** @@ -139,4 +153,76 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyAdagradV2.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyAdagradV2(op), op, Arrays.asList("T", "Tindices", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java index 4a39342989e..663b7d92d41 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -43,6 +49,10 @@ * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) * var <- var - mom */ +@OpMetadata( + opType = ResourceSparseApplyCenteredRmsProp.OP_NAME, + inputsClass = ResourceSparseApplyCenteredRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -52,8 +62,8 @@ public final class ResourceSparseApplyCenteredRmsProp extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyCenteredRMSProp"; - private ResourceSparseApplyCenteredRmsProp(Operation operation) { - super(operation); + public ResourceSparseApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); } /** @@ -66,7 +76,7 @@ private ResourceSparseApplyCenteredRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -136,4 +146,94 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyCenteredRmsProp.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand mg; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var, ms and mom. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyCenteredRmsProp(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + mg = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java index d4ff9eceb67..66afa530112 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,6 +44,10 @@ * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ +@OpMetadata( + opType = ResourceSparseApplyFtrl.OP_NAME, + inputsClass = ResourceSparseApplyFtrl.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +57,8 @@ public final class ResourceSparseApplyFtrl extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyFtrlV2"; - private ResourceSparseApplyFtrl(Operation operation) { - super(operation); + public ResourceSparseApplyFtrl(Operation operation) { + super(operation, OP_NAME); } /** @@ -63,7 +73,7 @@ private ResourceSparseApplyFtrl(Operation operation) { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code ResourceSparseApplyFtrlV2} output and operands @@ -157,4 +167,100 @@ public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyFtrl.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand linear; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 shrinkage regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The l2Shrinkage input + */ + public final Operand l2Shrinkage; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lrPower; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The multiplyLinearByLr attribute + */ + public final boolean multiplyLinearByLr; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyFtrl(op), op, Arrays.asList("T", "Tindices", "use_locking", "multiply_linear_by_lr")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + l2Shrinkage = (Operand) op.input(inputIndex++); + lrPower = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + multiplyLinearByLr = op.attributes().getAttrBool("multiply_linear_by_lr"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java index 3359aeb3d8f..ace49acac19 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ *

    accum = accum * momentum - lr * grad * var += accum */ +@OpMetadata( + opType = ResourceSparseApplyKerasMomentum.OP_NAME, + inputsClass = ResourceSparseApplyKerasMomentum.Inputs.class +) @Operator( group = "train" ) @@ -43,8 +53,8 @@ public final class ResourceSparseApplyKerasMomentum extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyKerasMomentum"; - private ResourceSparseApplyKerasMomentum(Operation operation) { - super(operation); + public ResourceSparseApplyKerasMomentum(Operation operation) { + super(operation, OP_NAME); } /** @@ -148,4 +158,78 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyKerasMomentum.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var + momentum * accum, so in the end, the var you get is actually + * var + momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyKerasMomentum(op), op, Arrays.asList("T", "Tindices", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java index 37a53ca5174..2b67601db1b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,6 +40,10 @@ *

    accum = accum * momentum + grad * var -= lr * accum */ +@OpMetadata( + opType = ResourceSparseApplyMomentum.OP_NAME, + inputsClass = ResourceSparseApplyMomentum.Inputs.class +) @Operator( group = "train" ) @@ -43,8 +53,8 @@ public final class ResourceSparseApplyMomentum extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyMomentum"; - private ResourceSparseApplyMomentum(Operation operation) { - super(operation); + public ResourceSparseApplyMomentum(Operation operation) { + super(operation, OP_NAME); } /** @@ -148,4 +158,78 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyMomentum.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyMomentum(op), op, Arrays.asList("T", "Tindices", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java index 9beeb9b81d7..a45464b181f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,6 +41,10 @@ * prox_v -= lr * grad * (1 / sqrt(accum)) * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ +@OpMetadata( + opType = ResourceSparseApplyProximalAdagrad.OP_NAME, + inputsClass = ResourceSparseApplyProximalAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -44,8 +54,8 @@ public final class ResourceSparseApplyProximalAdagrad extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyProximalAdagrad"; - private ResourceSparseApplyProximalAdagrad(Operation operation) { - super(operation); + public ResourceSparseApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); } /** @@ -119,4 +129,75 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyProximalAdagrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyProximalAdagrad(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java index d7d2f5b85d1..6ceef378c26 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,6 +39,10 @@ * prox_v = var - alpha * grad * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ +@OpMetadata( + opType = ResourceSparseApplyProximalGradientDescent.OP_NAME, + inputsClass = ResourceSparseApplyProximalGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +52,8 @@ public final class ResourceSparseApplyProximalGradientDescent extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyProximalGradientDescent"; - private ResourceSparseApplyProximalGradientDescent(Operation operation) { - super(operation); + public ResourceSparseApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); } /** @@ -115,4 +125,69 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyProximalGradientDescent.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyProximalGradientDescent(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java index 0ff4e6f9003..47eb0edb8e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,6 +44,10 @@ * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) * var <- var - mom */ +@OpMetadata( + opType = ResourceSparseApplyRmsProp.OP_NAME, + inputsClass = ResourceSparseApplyRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +57,8 @@ public final class ResourceSparseApplyRmsProp extends RawOp { */ public static final String OP_NAME = "ResourceSparseApplyRMSProp"; - private ResourceSparseApplyRmsProp(Operation operation) { - super(operation); + public ResourceSparseApplyRmsProp(Operation operation) { + super(operation, OP_NAME); } /** @@ -60,7 +70,7 @@ private ResourceSparseApplyRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -129,4 +139,88 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = ResourceSparseApplyRmsProp.class + ) + public static class Inputs extends RawOpInputs { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var, ms and mom. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new ResourceSparseApplyRmsProp(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java index 40dd24048f0..aa4a6e8f8b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -20,15 +20,20 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -48,6 +53,10 @@ * strings and correspondingly well-formed. *

    Callers must ensure all the named tensors are indeed stored in the checkpoint. */ +@OpMetadata( + opType = Restore.OP_NAME, + inputsClass = Restore.Inputs.class +) @Operator( group = "train" ) @@ -60,8 +69,8 @@ public final class Restore extends RawOp implements Iterable> { private List> tensors; @SuppressWarnings("unchecked") - private Restore(Operation operation) { - super(operation); + public Restore(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int tensorsLength = operation.outputListLength("tensors"); tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength)); @@ -108,4 +117,40 @@ public List> tensors() { public Iterator> iterator() { return (Iterator) tensors.iterator(); } + + @OpInputsMetadata( + outputsClass = Restore.class + ) + public static class Inputs extends RawOpInputs { + /** + * Must have a single element. The prefix of a V2 checkpoint. + */ + public final Operand prefix; + + /** + * shape {N}. The names of the tensors to be restored. + */ + public final Operand tensorNames; + + /** + * shape {N}. The slice specs of the tensors to be restored. + * Empty strings indicate that they are non-partitioned tensors. + */ + public final Operand shapeAndSlices; + + /** + * shape {N}. The list of expected dtype for the tensors. Must match + * those stored in the checkpoint. + */ + public final DataType[] dtypes; + + public Inputs(GraphOperation op) { + super(new Restore(op), op, Arrays.asList("dtypes")); + int inputIndex = 0; + prefix = (Operand) op.input(inputIndex++); + tensorNames = (Operand) op.input(inputIndex++); + shapeAndSlices = (Operand) op.input(inputIndex++); + dtypes = op.attributes().getAttrTypeList("dtypes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java index 4bcd181e5f3..a33a34b3179 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,15 +17,21 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -36,9 +42,11 @@ * larger tensor and the slice that the restored tensor covers. *

    The {@code shape_and_slice} input has the same format as the * elements of the {@code shapes_and_slices} input of the {@code SaveSlices} op. - * - * @param data type for {@code tensor} output */ +@OpMetadata( + opType = RestoreSlice.OP_NAME, + inputsClass = RestoreSlice.Inputs.class +) @Operator( group = "train" ) @@ -50,8 +58,8 @@ public final class RestoreSlice extends RawOp implements Operan private Output tensor; - private RestoreSlice(Operation operation) { - super(operation); + public RestoreSlice(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; tensor = operation.output(outputIdx++); } @@ -138,4 +146,48 @@ public Options preferredShard(Long preferredShard) { return this; } } + + @OpInputsMetadata( + outputsClass = RestoreSlice.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Must have a single element. The pattern of the files from + * which we read the tensor. + */ + public final Operand filePattern; + + /** + * Must have a single element. The name of the tensor to be + * restored. + */ + public final Operand tensorName; + + /** + * Scalar. The shapes and slice specifications to use when + * restoring a tensors. + */ + public final Operand shapeAndSlice; + + /** + * The type of the tensor to be restored. + */ + public final DataType dt; + + /** + * Index of file to open first if multiple files match + * {@code file_pattern}. See the documentation for {@code Restore}. + */ + public final long preferredShard; + + public Inputs(GraphOperation op) { + super(new RestoreSlice<>(op), op, Arrays.asList("dt", "preferred_shard")); + int inputIndex = 0; + filePattern = (Operand) op.input(inputIndex++); + tensorName = (Operand) op.input(inputIndex++); + shapeAndSlice = (Operand) op.input(inputIndex++); + dt = op.attributes().getAttrType("dt"); + preferredShard = op.attributes().getAttrInt("preferred_shard"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java index 722c88f3eaa..edc0164f281 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; /** @@ -33,6 +39,10 @@ * specific slices of full tensors, "shape_and_slices" should be non-empty strings * and correspondingly well-formed. */ +@OpMetadata( + opType = Save.OP_NAME, + inputsClass = Save.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +52,8 @@ public final class Save extends RawOp { */ public static final String OP_NAME = "SaveV2"; - private Save(Operation operation) { - super(operation); + public Save(Operation operation) { + super(operation, OP_NAME); } /** @@ -70,4 +80,48 @@ public static Save create(Scope scope, Operand prefix, Operand opBuilder.addInputList(Operands.asOutputs(tensors)); return new Save(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = Save.class + ) + public static class Inputs extends RawOpInputs { + /** + * Must have a single element. The prefix of the V2 checkpoint to which we + * write the tensors. + */ + public final Operand prefix; + + /** + * shape {N}. The names of the tensors to be saved. + */ + public final Operand tensorNames; + + /** + * shape {N}. The slice specs of the tensors to be saved. + * Empty strings indicate that they are non-partitioned tensors. + */ + public final Operand shapeAndSlices; + + /** + * {@code N} tensors to save. + */ + public final Iterable> tensors; + + /** + * The dtypes attribute + */ + public final DataType[] dtypes; + + public Inputs(GraphOperation op) { + super(new Save(op), op, Arrays.asList("dtypes")); + int inputIndex = 0; + prefix = (Operand) op.input(inputIndex++); + tensorNames = (Operand) op.input(inputIndex++); + shapeAndSlices = (Operand) op.input(inputIndex++); + int tensorsLength = op.inputListLength("tensors"); + tensors = Arrays.asList((Operand[]) op.inputList(inputIndex, tensorsLength)); + inputIndex += tensorsLength; + dtypes = op.attributes().getAttrTypeList("dtypes"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java index 50223df730d..302d461cf8c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TString; /** @@ -50,6 +56,10 @@ * *

    See also {@code Save}. */ +@OpMetadata( + opType = SaveSlices.OP_NAME, + inputsClass = SaveSlices.Inputs.class +) @Operator( group = "train" ) @@ -59,8 +69,8 @@ public final class SaveSlices extends RawOp { */ public static final String OP_NAME = "SaveSlices"; - private SaveSlices(Operation operation) { - super(operation); + public SaveSlices(Operation operation) { + super(operation, OP_NAME); } /** @@ -87,4 +97,48 @@ public static SaveSlices create(Scope scope, Operand filename, opBuilder.addInputList(Operands.asOutputs(data)); return new SaveSlices(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = SaveSlices.class + ) + public static class Inputs extends RawOpInputs { + /** + * Must have a single element. The name of the file to which we write the + * tensor. + */ + public final Operand filename; + + /** + * Shape {@code [N]}. The names of the tensors to be saved. + */ + public final Operand tensorNames; + + /** + * Shape {@code [N]}. The shapes and slice specifications to use when + * saving the tensors. + */ + public final Operand shapesAndSlices; + + /** + * {@code N} tensors to save. + */ + public final Iterable> data; + + /** + * The T attribute + */ + public final DataType[] T; + + public Inputs(GraphOperation op) { + super(new SaveSlices(op), op, Arrays.asList("T")); + int inputIndex = 0; + filename = (Operand) op.input(inputIndex++); + tensorNames = (Operand) op.input(inputIndex++); + shapesAndSlices = (Operand) op.input(inputIndex++); + int dataLength = op.inputListLength("data"); + data = Arrays.asList((Operand[]) op.inputList(inputIndex, dataLength)); + inputIndex += dataLength; + T = op.attributes().getAttrTypeList("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java index fb20638e575..ab2a1878bb0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,18 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; @@ -31,6 +36,10 @@ /** * Computes fingerprints of the input strings. */ +@OpMetadata( + opType = SdcaFprint.OP_NAME, + inputsClass = SdcaFprint.Inputs.class +) @Operator( group = "train" ) @@ -42,8 +51,8 @@ public final class SdcaFprint extends RawOp implements Operand { private Output output; - private SdcaFprint(Operation operation) { - super(operation); + public SdcaFprint(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -78,4 +87,20 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = SdcaFprint.class + ) + public static class Inputs extends RawOpInputs { + /** + * vector of strings to compute fingerprints on. + */ + public final Operand input; + + public Inputs(GraphOperation op) { + super(new SdcaFprint(op), op, Arrays.asList()); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java index d8273b2b40d..e06ddf1dae1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -19,14 +19,19 @@ import java.util.Arrays; import java.util.List; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; @@ -46,6 +51,13 @@ *

    Stochastic Dual Coordinate Ascent with Adaptive Probabilities .
    * Dominik Csiba, Zheng Qu, Peter Richtarik. 2015 */ +@OpMetadata( + opType = SdcaOptimizer.OP_NAME, + inputsClass = SdcaOptimizer.Inputs.class +) +@Operator( + group = "train" +) public final class SdcaOptimizer extends RawOp { /** * The name of this op, as known by TensorFlow core engine @@ -59,8 +71,8 @@ public final class SdcaOptimizer extends RawOp { private List> outDeltaDenseWeights; @SuppressWarnings("unchecked") - private SdcaOptimizer(Operation operation) { - super(operation); + public SdcaOptimizer(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; outExampleStateData = operation.output(outputIdx++); int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); @@ -197,4 +209,132 @@ public Options adaptive(Boolean adaptive) { return this; } } + + @OpInputsMetadata( + outputsClass = SdcaOptimizer.class + ) + public static class Inputs extends RawOpInputs { + /** + * a list of vectors which contain example indices. + */ + public final Iterable> sparseExampleIndices; + + /** + * a list of vectors which contain feature indices. + */ + public final Iterable> sparseFeatureIndices; + + /** + * a list of vectors which contains feature value + * associated with each feature group. + */ + public final Iterable> sparseFeatureValues; + + /** + * a list of matrices which contains the dense feature values. + */ + public final Iterable> denseFeatures; + + /** + * a vector which contains the weight associated with each + * example. + */ + public final Operand exampleWeights; + + /** + * a vector which contains the label/target associated with each + * example. + */ + public final Operand exampleLabels; + + /** + * a list of vectors where each value is the indices which has + * corresponding weights in sparse_weights. This field maybe omitted for the + * dense approach. + */ + public final Iterable> sparseIndices; + + /** + * a list of vectors where each value is the weight associated with + * a sparse feature group. + */ + public final Iterable> sparseWeights; + + /** + * a list of vectors where the values are the weights associated + * with a dense feature group. + */ + public final Iterable> denseWeights; + + /** + * a list of vectors containing the example state data. + */ + public final Operand exampleStateData; + + /** + * Type of the primal loss. Currently SdcaSolver supports logistic, + * squared and hinge losses. + */ + public final String lossType; + + /** + * Whether to use Adaptive SDCA for the inner loop. + */ + public final boolean adaptive; + + /** + * Symmetric l1 regularization strength. + */ + public final float l1; + + /** + * Symmetric l2 regularization strength. + */ + public final float l2; + + /** + * Number of partitions of the global loss function. + */ + public final long numLossPartitions; + + /** + * Number of iterations per mini-batch. + */ + public final long numInnerIterations; + + public Inputs(GraphOperation op) { + super(new SdcaOptimizer(op), op, Arrays.asList("loss_type", "adaptive", "l1", "l2", "num_loss_partitions", "num_inner_iterations")); + int inputIndex = 0; + int sparseExampleIndicesLength = op.inputListLength("sparse_example_indices"); + sparseExampleIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseExampleIndicesLength)); + inputIndex += sparseExampleIndicesLength; + int sparseFeatureIndicesLength = op.inputListLength("sparse_feature_indices"); + sparseFeatureIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseFeatureIndicesLength)); + inputIndex += sparseFeatureIndicesLength; + int sparseFeatureValuesLength = op.inputListLength("sparse_feature_values"); + sparseFeatureValues = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseFeatureValuesLength)); + inputIndex += sparseFeatureValuesLength; + int denseFeaturesLength = op.inputListLength("dense_features"); + denseFeatures = Arrays.asList((Operand[]) op.inputList(inputIndex, denseFeaturesLength)); + inputIndex += denseFeaturesLength; + exampleWeights = (Operand) op.input(inputIndex++); + exampleLabels = (Operand) op.input(inputIndex++); + int sparseIndicesLength = op.inputListLength("sparse_indices"); + sparseIndices = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseIndicesLength)); + inputIndex += sparseIndicesLength; + int sparseWeightsLength = op.inputListLength("sparse_weights"); + sparseWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, sparseWeightsLength)); + inputIndex += sparseWeightsLength; + int denseWeightsLength = op.inputListLength("dense_weights"); + denseWeights = Arrays.asList((Operand[]) op.inputList(inputIndex, denseWeightsLength)); + inputIndex += denseWeightsLength; + exampleStateData = (Operand) op.input(inputIndex++); + lossType = op.attributes().getAttrString("loss_type"); + adaptive = op.attributes().getAttrBool("adaptive"); + l1 = op.attributes().getAttrFloat("l1"); + l2 = op.attributes().getAttrFloat("l2"); + numLossPartitions = op.attributes().getAttrInt("num_loss_partitions"); + numInnerIterations = op.attributes().getAttrInt("num_inner_iterations"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java index 5c30c4197ac..a0944f753ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,19 +17,28 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Applies L1 regularization shrink step on the parameters. */ +@OpMetadata( + opType = SdcaShrinkL1.OP_NAME, + inputsClass = SdcaShrinkL1.Inputs.class +) @Operator( group = "train" ) @@ -39,8 +48,8 @@ public final class SdcaShrinkL1 extends RawOp { */ public static final String OP_NAME = "SdcaShrinkL1"; - private SdcaShrinkL1(Operation operation) { - super(operation); + public SdcaShrinkL1(Operation operation) { + super(operation, OP_NAME); } /** @@ -64,4 +73,35 @@ public static SdcaShrinkL1 create(Scope scope, Iterable> weigh opBuilder.setAttr("l2", l2); return new SdcaShrinkL1(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = SdcaShrinkL1.class + ) + public static class Inputs extends RawOpInputs { + /** + * a list of vectors where each value is the weight associated with a + * feature group. + */ + public final Iterable> weights; + + /** + * Symmetric l1 regularization strength. + */ + public final float l1; + + /** + * Symmetric l2 regularization strength. Should be a positive float. + */ + public final float l2; + + public Inputs(GraphOperation op) { + super(new SdcaShrinkL1(op), op, Arrays.asList("l1", "l2")); + int inputIndex = 0; + int weightsLength = op.inputListLength("weights"); + weights = Arrays.asList((Operand[]) op.inputList(inputIndex, weightsLength)); + inputIndex += weightsLength; + l1 = op.attributes().getAttrFloat("l1"); + l2 = op.attributes().getAttrFloat("l2"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java index 067291732f4..8b12e83f51f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,22 +17,30 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * var: Should be from a Variable(). - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyAdadelta.OP_NAME, + inputsClass = SparseApplyAdadelta.Inputs.class +) @Operator( group = "train" ) @@ -44,8 +52,8 @@ public final class SparseApplyAdadelta extends RawOp implements private Output out; - private SparseApplyAdadelta(Operation operation) { - super(operation); + public SparseApplyAdadelta(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -54,7 +62,7 @@ private SparseApplyAdadelta(Operation operation) { * Factory method to create a class wrapping a new SparseApplyAdadelta operation. * * @param scope current scope - * @param var the var value + * @param var The var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -137,4 +145,81 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyAdadelta.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The var input + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * : Should be from a Variable(). + */ + public final Operand accumUpdate; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay factor. Must be a scalar. + */ + public final Operand rho; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyAdadelta<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + accumUpdate = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java index 871e70cec9d..fbda4c582a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -32,9 +39,14 @@ * That is for rows we have grad for, we update var and accum as follows: * $$accum += grad * grad$$ * $$var -= lr * grad * (1 / sqrt(accum))$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyAdagrad.OP_NAME, + inputsClass = SparseApplyAdagrad.Inputs.class +) +@Operator( + group = "train" +) public final class SparseApplyAdagrad extends RawOp implements Operand { /** * The name of this op, as known by TensorFlow core engine @@ -43,8 +55,8 @@ public final class SparseApplyAdagrad extends RawOp implements private Output out; - private SparseApplyAdagrad(Operation operation) { - super(operation); + public SparseApplyAdagrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -160,4 +172,76 @@ public Options updateSlots(Boolean updateSlots) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyAdagrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * Constant factor. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The updateSlots attribute + */ + public final boolean updateSlots; + + public Inputs(GraphOperation op) { + super(new SparseApplyAdagrad<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "update_slots")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + updateSlots = op.attributes().getAttrBool("update_slots"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java index f54420becc3..33cdae176f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,23 +17,31 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyAdagradDa.OP_NAME, + inputsClass = SparseApplyAdagradDa.Inputs.class +) @Operator( group = "train" ) @@ -45,8 +53,8 @@ public final class SparseApplyAdagradDa extends RawOp implement private Output out; - private SparseApplyAdagradDa(Operation operation) { - super(operation); + public SparseApplyAdagradDa(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -141,4 +149,87 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyAdagradDa.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand gradientAccumulator; + + /** + * Should be from a Variable(). + */ + public final Operand gradientSquaredAccumulator; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * Training step number. Must be a scalar. + */ + public final Operand globalStep; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyAdagradDa<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + gradientAccumulator = (Operand) op.input(inputIndex++); + gradientSquaredAccumulator = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + globalStep = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java index 931e987a908..cfbf01b8044 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -43,9 +49,11 @@ *

    $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ * $$var <- var - mom$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyCenteredRmsProp.OP_NAME, + inputsClass = SparseApplyCenteredRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -57,8 +65,8 @@ public final class SparseApplyCenteredRmsProp extends RawOp imp private Output out; - private SparseApplyCenteredRmsProp(Operation operation) { - super(operation); + public SparseApplyCenteredRmsProp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -73,7 +81,7 @@ private SparseApplyCenteredRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -157,4 +165,94 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyCenteredRmsProp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand mg; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var, ms and mom. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyCenteredRmsProp<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + mg = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java index 780d36208ff..72cce364480 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,9 +44,11 @@ * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyFtrl.OP_NAME, + inputsClass = SparseApplyFtrl.Inputs.class +) @Operator( group = "train" ) @@ -52,8 +60,8 @@ public final class SparseApplyFtrl extends RawOp implements Ope private Output out; - private SparseApplyFtrl(Operation operation) { - super(operation); + public SparseApplyFtrl(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -70,7 +78,7 @@ private SparseApplyFtrl(Operation operation) { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage the l2Shrinkage value + * @param l2Shrinkage The l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attribute values * @param data type for {@code SparseApplyFtrlV2} output and operands @@ -178,4 +186,100 @@ public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyFtrl.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Should be from a Variable(). + */ + public final Operand linear; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 shrinkage regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The l2Shrinkage input + */ + public final Operand l2Shrinkage; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lrPower; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * The multiplyLinearByLr attribute + */ + public final boolean multiplyLinearByLr; + + public Inputs(GraphOperation op) { + super(new SparseApplyFtrl<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "multiply_linear_by_lr")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + l2Shrinkage = (Operand) op.input(inputIndex++); + lrPower = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + multiplyLinearByLr = op.attributes().getAttrBool("multiply_linear_by_lr"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java index dc6cd3beee5..d2ae83d8c17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -34,9 +40,11 @@ *

    That is for rows we have grad for, we update var and accum as follows: *

    $$accum = accum * momentum + grad$$ * $$var -= lr * accum$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyMomentum.OP_NAME, + inputsClass = SparseApplyMomentum.Inputs.class +) @Operator( group = "train" ) @@ -48,8 +56,8 @@ public final class SparseApplyMomentum extends RawOp implements private Output out; - private SparseApplyMomentum(Operation operation) { - super(operation); + public SparseApplyMomentum(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -169,4 +177,78 @@ public Options useNesterov(Boolean useNesterov) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyMomentum.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * Momentum. Must be a scalar. + */ + public final Operand momentum; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + /** + * If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + */ + public final boolean useNesterov; + + public Inputs(GraphOperation op) { + super(new SparseApplyMomentum<>(op), op, Arrays.asList("T", "Tindices", "use_locking", "use_nesterov")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java index 68f56702597..70b28897f24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -35,9 +41,11 @@ * $$prox_v = var$$ * $$prox_v -= lr * grad * (1 / sqrt(accum))$$ * $$var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0}$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyProximalAdagrad.OP_NAME, + inputsClass = SparseApplyProximalAdagrad.Inputs.class +) @Operator( group = "train" ) @@ -49,8 +57,8 @@ public final class SparseApplyProximalAdagrad extends RawOp imp private Output out; - private SparseApplyProximalAdagrad(Operation operation) { - super(operation); + public SparseApplyProximalAdagrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -140,4 +148,75 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyProximalAdagrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand accum; + + /** + * Learning rate. Must be a scalar. + */ + public final Operand lr; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyProximalAdagrad<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + accum = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java index cae253e1891..3da972089e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * That is for rows we have grad for, we update var as follows: * $$prox_v = var - alpha * grad$$ * $$var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0}$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyProximalGradientDescent.OP_NAME, + inputsClass = SparseApplyProximalGradientDescent.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +55,8 @@ public final class SparseApplyProximalGradientDescent extends R private Output out; - private SparseApplyProximalGradientDescent(Operation operation) { - super(operation); + public SparseApplyProximalGradientDescent(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -136,4 +144,69 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyProximalGradientDescent.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand alpha; + + /** + * L1 regularization. Must be a scalar. + */ + public final Operand l1; + + /** + * L2 regularization. Must be a scalar. + */ + public final Operand l2; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var and accum. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyProximalGradientDescent<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + alpha = (Operand) op.input(inputIndex++); + l1 = (Operand) op.input(inputIndex++); + l2 = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java index 5e1fc582838..3c642ebcf81 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -38,9 +44,11 @@ *

    $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ * $$var <- var - mom$$ - * - * @param data type for {@code out} output */ +@OpMetadata( + opType = SparseApplyRmsProp.OP_NAME, + inputsClass = SparseApplyRmsProp.Inputs.class +) @Operator( group = "train" ) @@ -52,8 +60,8 @@ public final class SparseApplyRmsProp extends RawOp implements private Output out; - private SparseApplyRmsProp(Operation operation) { - super(operation); + public SparseApplyRmsProp(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; out = operation.output(outputIdx++); } @@ -67,7 +75,7 @@ private SparseApplyRmsProp(Operation operation) { * @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 the momentum value + * @param momentum The momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. @@ -149,4 +157,88 @@ public Options useLocking(Boolean useLocking) { return this; } } + + @OpInputsMetadata( + outputsClass = SparseApplyRmsProp.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Should be from a Variable(). + */ + public final Operand var; + + /** + * Should be from a Variable(). + */ + public final Operand ms; + + /** + * Should be from a Variable(). + */ + public final Operand mom; + + /** + * Scaling factor. Must be a scalar. + */ + public final Operand lr; + + /** + * Decay rate. Must be a scalar. + */ + public final Operand rho; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * Ridge term. Must be a scalar. + */ + public final Operand epsilon; + + /** + * The gradient. + */ + public final Operand grad; + + /** + * A vector of indices into the first dimension of var, ms and mom. + */ + public final Operand indices; + + /** + * The T attribute + */ + public final DataType T; + + /** + * The Tindices attribute + */ + public final DataType Tindices; + + /** + * If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + */ + public final boolean useLocking; + + public Inputs(GraphOperation op) { + super(new SparseApplyRmsProp<>(op), op, Arrays.asList("T", "Tindices", "use_locking")); + int inputIndex = 0; + var = (Operand) op.input(inputIndex++); + ms = (Operand) op.input(inputIndex++); + mom = (Operand) op.input(inputIndex++); + lr = (Operand) op.input(inputIndex++); + rho = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + grad = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + Tindices = op.attributes().getAttrType("Tindices"); + useLocking = op.attributes().getAttrBool("use_locking"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SymbolicGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SymbolicGradient.java index 0bd82ac6525..3feef3e7820 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SymbolicGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SymbolicGradient.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,20 +21,29 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * Computes the gradient function for function f via backpropagation. */ +@OpMetadata( + opType = SymbolicGradient.OP_NAME, + inputsClass = SymbolicGradient.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +56,8 @@ public final class SymbolicGradient extends RawOp implements Iterable> output; @SuppressWarnings("unchecked") - private SymbolicGradient(Operation operation) { - super(operation); + public SymbolicGradient(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputLength = operation.outputListLength("output"); output = Arrays.asList(operation.outputList(outputIdx, outputLength)); @@ -103,4 +112,34 @@ public List> output() { public Iterator> iterator() { return (Iterator) output.iterator(); } + + @OpInputsMetadata( + outputsClass = SymbolicGradient.class + ) + public static class Inputs extends RawOpInputs { + /** + * a list of input tensors of size N + M; + */ + public final Iterable> input; + + /** + * the type list for the input list. + */ + public final DataType[] Tin; + + /** + * the type list for the input list. + */ + public final DataType[] Tout; + + public Inputs(GraphOperation op) { + super(new SymbolicGradient(op), op, Arrays.asList("Tin", "Tout")); + int inputIndex = 0; + int inputLength = op.inputListLength("input"); + input = Arrays.asList((Operand[]) op.inputList(inputIndex, inputLength)); + inputIndex += inputLength; + Tin = op.attributes().getAttrTypeList("Tin"); + Tout = op.attributes().getAttrTypeList("Tout"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java index 9c18ef0054f..9e1b7e0fbb4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,14 +17,20 @@ package org.tensorflow.op.train; +import java.util.Arrays; +import org.tensorflow.GraphOperation; 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.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; @@ -33,9 +39,11 @@ * Since {@code Tile} takes an input and repeats the input {@code multiples} times * along each dimension, {@code train.TileGrad} takes in {@code multiples} and aggregates * each repeated tile of {@code input} into {@code output}. - * - * @param data type for {@code output} output */ +@OpMetadata( + opType = TileGrad.OP_NAME, + inputsClass = TileGrad.Inputs.class +) @Operator( group = "train" ) @@ -47,8 +55,8 @@ public final class TileGrad extends RawOp implements Operand private Output output; - private TileGrad(Operation operation) { - super(operation); + public TileGrad(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -57,8 +65,8 @@ private TileGrad(Operation operation) { * Factory method to create a class wrapping a new TileGrad operation. * * @param scope current scope - * @param input the input value - * @param multiples the multiples value + * @param input The input value + * @param multiples The multiples value * @param data type for {@code TileGrad} output and operands * @return a new instance of TileGrad */ @@ -86,4 +94,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = TileGrad.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The input input + */ + public final Operand input; + + /** + * The multiples input + */ + public final Operand multiples; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new TileGrad<>(op), op, Arrays.asList("T")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + multiples = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/AssignVariableConcatND.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/AssignVariableConcatND.java new file mode 100644 index 00000000000..c58943ff50d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/AssignVariableConcatND.java @@ -0,0 +1,228 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Concats input tensor across all dimensions. + * An op which merges slices the input tensor based on the given num_splits + * attribute, strips paddings optionally, and writes the merged tensor without + * paddings to the resource variable. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    + * [[0, 1],
    + *  [4, 5]]
    + * [[2, 3],
    + *  [6, 7]]
    + * [[8, 9],
    + *  [12, 13]]
    + * [[10, 11],
    + *  [14, 15]]
    + * 
    + *

    {@code num_splits}: + *

    + * [2, 2]
    + * 
    + *

    and {@code paddings}: + *

    + * [1, 1]
    + * 
    + *

    the expected {@code outputs} is: + *

    + * [[0, 1, 2],
    + *  [4, 5, 6],
    + *  [8, 9, 10]]
    + * 
    + */ +@OpMetadata( + opType = AssignVariableConcatND.OP_NAME, + inputsClass = AssignVariableConcatND.Inputs.class +) +@Operator( + group = "xla" +) +public final class AssignVariableConcatND extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignVariableXlaConcatND"; + + public AssignVariableConcatND(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new AssignVariableXlaConcatND operation. + * + * @param scope current scope + * @param resource Resource variable for concatenated input tensors across all dimensions. + * @param inputs Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + * @param numConcats Number of ways to merge per dimension. + * @param options carries optional attribute values + * @return a new instance of AssignVariableConcatND + */ + @Endpoint( + describeByClass = true + ) + public static AssignVariableConcatND create(Scope scope, Operand resource, + Iterable> inputs, List numConcats, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "AssignVariableConcatND"); + opBuilder.addInput(resource.asOutput()); + opBuilder.addInputList(Operands.asOutputs(inputs)); + long[] numConcatsArray = new long[numConcats.size()]; + for (int i = 0 ; i < numConcatsArray.length ; i++) { + numConcatsArray[i] = numConcats.get(i); + } + opBuilder.setAttr("num_concats", numConcatsArray); + if (options != null) { + for (Options opts : options) { + if (opts.paddings != null) { + long[] paddingsArray = new long[opts.paddings.size()]; + for (int i = 0 ; i < paddingsArray.length ; i++) { + paddingsArray[i] = opts.paddings.get(i); + } + opBuilder.setAttr("paddings", paddingsArray); + } + } + } + return new AssignVariableConcatND(opBuilder.build()); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public static Options paddings(List paddings) { + return new Options().paddings(paddings); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public static Options paddings(Long... paddings) { + return new Options().paddings(paddings); + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.AssignVariableConcatND} + */ + public static class Options { + private List paddings; + + private Options() { + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public Options paddings(List paddings) { + this.paddings = paddings; + return this; + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public Options paddings(Long... paddings) { + this.paddings = Arrays.asList(paddings); + return this; + } + } + + @OpInputsMetadata( + outputsClass = AssignVariableConcatND.class + ) + public static class Inputs extends RawOpInputs { + /** + * Resource variable for concatenated input tensors across all dimensions. + */ + public final Operand resource; + + /** + * Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Number of ways to merge per dimension. + */ + public final long[] numConcats; + + /** + * Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + */ + public final long[] paddings; + + public Inputs(GraphOperation op) { + super(new AssignVariableConcatND(op), op, Arrays.asList("T", "num_concats", "paddings")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + numConcats = op.attributes().getAttrIntList("num_concats"); + paddings = op.attributes().getAttrIntList("paddings"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java deleted file mode 100644 index d32efe74374..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java +++ /dev/null @@ -1,98 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Helper operator for performing XLA-style broadcasts - * Broadcasts {@code lhs} and {@code rhs} to the same rank, by adding size 1 dimensions to - * whichever of {@code lhs} and {@code rhs} has the lower rank, using XLA's broadcasting rules - * for binary operators. - * - * @param data type for {@code lhs_output} output - */ -@Operator( - group = "xla" -) -public final class BroadcastHelper extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaBroadcastHelper"; - - private Output lhsOutput; - - private Output rhsOutput; - - private BroadcastHelper(Operation operation) { - super(operation); - int outputIdx = 0; - lhsOutput = operation.output(outputIdx++); - rhsOutput = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaBroadcastHelper operation. - * - * @param scope current scope - * @param lhs the LHS input tensor - * @param rhs the RHS input tensor - * @param broadcastDims an XLA-style broadcast dimension specification - * @param data type for {@code XlaBroadcastHelper} output and operands - * @return a new instance of BroadcastHelper - */ - @Endpoint( - describeByClass = true - ) - public static BroadcastHelper create(Scope scope, Operand lhs, - Operand rhs, Operand broadcastDims) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "BroadcastHelper"); - opBuilder.addInput(lhs.asOutput()); - opBuilder.addInput(rhs.asOutput()); - opBuilder.addInput(broadcastDims.asOutput()); - return new BroadcastHelper<>(opBuilder.build()); - } - - /** - * Gets lhsOutput. - * the broadcasted LHS tensor - * @return lhsOutput. - */ - public Output lhsOutput() { - return lhsOutput; - } - - /** - * Gets rhsOutput. - * the broadcasted RHS tensor - * @return rhsOutput. - */ - public Output rhsOutput() { - return rhsOutput; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java deleted file mode 100644 index 4f316783fd9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java +++ /dev/null @@ -1,82 +0,0 @@ -/* 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.family.TType; - -/** - * Operator that connects the output of an XLA computation to other consumer graph nodes. - * - * @param data type for {@code outputs} output - */ -@Operator( - group = "xla" -) -public final class ClusterOutput extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaClusterOutput"; - - private Output outputs; - - private ClusterOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaClusterOutput operation. - * - * @param scope current scope - * @param input the input value - * @param data type for {@code XlaClusterOutput} output and operands - * @return a new instance of ClusterOutput - */ - @Endpoint( - describeByClass = true - ) - public static ClusterOutput create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ClusterOutput"); - opBuilder.addInput(input.asOutput()); - return new ClusterOutput<>(opBuilder.build()); - } - - /** - * Gets outputs. - * - * @return outputs. - */ - public Output outputs() { - return outputs; - } - - @Override - public Output asOutput() { - return outputs; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ConcatND.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ConcatND.java new file mode 100644 index 00000000000..5749305af89 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ConcatND.java @@ -0,0 +1,240 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Concats input tensor across all dimensions. + * An op which merges slices the input tensor based on the given num_splits + * attribute, strips paddings optionally, and returns the merged tensor without + * paddings. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    + * [[0, 1],
    + *  [4, 5]]
    + * [[2, 3],
    + *  [6, 7]]
    + * [[8, 9],
    + *  [12, 13]]
    + * [[10, 11],
    + *  [14, 15]]
    + * 
    + *

    {@code num_splits}: + *

    + * [2, 2]
    + * 
    + *

    and {@code paddings}: + *

    + * [1, 1]
    + * 
    + *

    the expected {@code outputs} is: + *

    + * [[0, 1, 2],
    + *  [4, 5, 6],
    + *  [8, 9, 10]]
    + * 
    + */ +@OpMetadata( + opType = ConcatND.OP_NAME, + inputsClass = ConcatND.Inputs.class +) +@Operator( + group = "xla" +) +public final class ConcatND extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaConcatND"; + + private Output output; + + public ConcatND(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaConcatND operation. + * + * @param scope current scope + * @param inputs Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + * @param numConcats Number of ways to merge per dimension. + * @param options carries optional attribute values + * @param data type for {@code XlaConcatND} output and operands + * @return a new instance of ConcatND + */ + @Endpoint( + describeByClass = true + ) + public static ConcatND create(Scope scope, Iterable> inputs, + List numConcats, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ConcatND"); + opBuilder.addInputList(Operands.asOutputs(inputs)); + long[] numConcatsArray = new long[numConcats.size()]; + for (int i = 0 ; i < numConcatsArray.length ; i++) { + numConcatsArray[i] = numConcats.get(i); + } + opBuilder.setAttr("num_concats", numConcatsArray); + if (options != null) { + for (Options opts : options) { + if (opts.paddings != null) { + long[] paddingsArray = new long[opts.paddings.size()]; + for (int i = 0 ; i < paddingsArray.length ; i++) { + paddingsArray[i] = opts.paddings.get(i); + } + opBuilder.setAttr("paddings", paddingsArray); + } + } + } + return new ConcatND<>(opBuilder.build()); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public static Options paddings(List paddings) { + return new Options().paddings(paddings); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public static Options paddings(Long... paddings) { + return new Options().paddings(paddings); + } + + /** + * Gets output. + * Output tensor formed from merging input slices based on num_concats defined. + * @return output. + */ + public Output output() { + return output; + } + + @Override + public Output asOutput() { + return output; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.ConcatND} + */ + public static class Options { + private List paddings; + + private Options() { + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public Options paddings(List paddings) { + this.paddings = paddings; + return this; + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + * @return this Options instance. + */ + public Options paddings(Long... paddings) { + this.paddings = Arrays.asList(paddings); + return this; + } + } + + @OpInputsMetadata( + outputsClass = ConcatND.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor slices in row-major order to merge across all dimensions. All + * inputs must have the same shape. + */ + public final Iterable> inputs; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Number of ways to merge per dimension. + */ + public final long[] numConcats; + + /** + * Optional list of right paddings per dimension to strip from the final merged + * tensor. These paddings must not exceed the dimension size of the merged result + * prior to stripping paddings. + */ + public final long[] paddings; + + public Inputs(GraphOperation op) { + super(new ConcatND<>(op), op, Arrays.asList("T", "num_concats", "paddings")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + T = op.attributes().getAttrType("T"); + numConcats = op.attributes().getAttrIntList("num_concats"); + paddings = op.attributes().getAttrIntList("paddings"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java deleted file mode 100644 index 3ff4fc14d66..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java +++ /dev/null @@ -1,109 +0,0 @@ -/* 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.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; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA ConvGeneralDilated operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution - * . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Conv extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaConvV2"; - - private Output output; - - private Conv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaConvV2 operation. - * - * @param scope current scope - * @param lhs the input tensor - * @param rhs the kernel tensor - * @param windowStrides the inter-window strides - * @param padding the padding to apply at the start and end of each input dimensions - * @param lhsDilation dilation to apply between input elements - * @param rhsDilation dilation to apply between kernel elements - * @param featureGroupCount number of feature groups for grouped convolution. - * @param dimensionNumbers a serialized xla::ConvolutionDimensionNumbers proto. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param preferredElementType The type of the tensor. - * @param data type for {@code XlaConvV2} output and operands - * @param data type for {@code XlaConvV2} output and operands - * @return a new instance of Conv - */ - @Endpoint( - describeByClass = true - ) - public static Conv create(Scope scope, - Operand lhs, Operand rhs, Operand windowStrides, - Operand padding, Operand lhsDilation, Operand rhsDilation, - Operand featureGroupCount, String dimensionNumbers, String precisionConfig, - Class preferredElementType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Conv"); - opBuilder.addInput(lhs.asOutput()); - opBuilder.addInput(rhs.asOutput()); - opBuilder.addInput(windowStrides.asOutput()); - opBuilder.addInput(padding.asOutput()); - opBuilder.addInput(lhsDilation.asOutput()); - opBuilder.addInput(rhsDilation.asOutput()); - opBuilder.addInput(featureGroupCount.asOutput()); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("precision_config", precisionConfig); - opBuilder.setAttr("preferred_element_type", Operands.toDataType(preferredElementType)); - return new Conv<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java deleted file mode 100644 index 40fb4ee2ecd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java +++ /dev/null @@ -1,93 +0,0 @@ -/* 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.TBfloat16; -import org.tensorflow.types.family.TType; - -/** - * Takes the packed uint32 input and unpacks the input to uint8 to do - * Dequantization on device. - */ -@Operator( - group = "xla" -) -public final class Dequantize extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaDequantize"; - - private Output output; - - private Dequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaDequantize operation. - * - * @param scope current scope - * @param input Input tensors whose types is uint32, shape is [d0, ..., dn]. - * @param minRange The minimum scalar value possibly produced for the input. - * @param maxRange The maximum scalar value possibly produced for the input. - * @param mode String to determine the dequantize mode in {"MIN_COMBINED", "MIN_FIRST", "SCALED"}. - * @param transposeOutput Boolean to determine if output is transposed. transpose_output - * is faster when input is large and rank of input is higher than 1. - * @return a new instance of Dequantize - */ - @Endpoint( - describeByClass = true - ) - public static Dequantize create(Scope scope, Operand input, Float minRange, - Float maxRange, String mode, Boolean transposeOutput) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dequantize"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("min_range", minRange); - opBuilder.setAttr("max_range", maxRange); - opBuilder.setAttr("mode", mode); - opBuilder.setAttr("transpose_output", transposeOutput); - return new Dequantize(opBuilder.build()); - } - - /** - * Gets output. - * Output tensors whose types is bloat16. If transpose_output is true, - * output shape is [dn * 4, dn-1, ..., d1, d0]. If transpose_output - * is false, output shape is [d0,..., dn * 4]. - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java deleted file mode 100644 index 86253843b77..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java +++ /dev/null @@ -1,95 +0,0 @@ -/* 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.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; - -/** - * Wraps the XLA DotGeneral operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral - * . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Dot extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaDotV2"; - - private Output output; - - private Dot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaDotV2 operation. - * - * @param scope current scope - * @param lhs the LHS tensor - * @param rhs the RHS tensor - * @param dimensionNumbers a serialized xla::DotDimensionNumbers proto. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param preferredElementType The type of the tensor. - * @param data type for {@code XlaDotV2} output and operands - * @return a new instance of Dot - */ - @Endpoint( - describeByClass = true - ) - public static Dot create(Scope scope, Operand lhs, - Operand rhs, String dimensionNumbers, String precisionConfig, - Class preferredElementType) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Dot"); - opBuilder.addInput(lhs.asOutput()); - opBuilder.addInput(rhs.asOutput()); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("precision_config", precisionConfig); - opBuilder.setAttr("preferred_element_type", Operands.toDataType(preferredElementType)); - return new Dot<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java deleted file mode 100644 index 93d22721098..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java +++ /dev/null @@ -1,99 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA DynamicSlice operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice - * . - *

    DynamicSlice extracts a sub-array from the input array at dynamic - * start_indices. The size of the slice in each dimension is passed in - * size_indices, which specify the end point of exclusive slice intervals in each - * dimension -- [start, start + size). The shape of start_indices must have rank 1, - * with dimension size equal to the rank of operand. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class DynamicSlice extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaDynamicSlice"; - - private Output output; - - private DynamicSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaDynamicSlice operation. - * - * @param scope current scope - * @param input A {@code Tensor} of type T. - * @param startIndices List of N integers containing the slice size for each - * dimension. Each value must be strictly greater than zero, and start + size - * must be less than or equal to the size of the dimension to avoid - * implementation defined behavior. - * @param sizeIndices the sizeIndices value - * @param data type for {@code XlaDynamicSlice} output and operands - * @param data type for {@code XlaDynamicSlice} output and operands - * @return a new instance of DynamicSlice - */ - @Endpoint( - describeByClass = true - ) - public static DynamicSlice create(Scope scope, - Operand input, Operand startIndices, Operand sizeIndices) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicSlice"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(startIndices.asOutput()); - opBuilder.addInput(sizeIndices.asOutput()); - return new DynamicSlice<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java deleted file mode 100644 index 0355ff82f53..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java +++ /dev/null @@ -1,96 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA DynamicUpdateSlice operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice - * . - *

    XlaDynamicUpdateSlice generates a result which is the value of the {@code input} - * operand, with a slice update overwritten at {@code indices}. The shape of {@code update} - * determines the shape of the sub-array of the result which is updated. The shape - * of indices must be rank == 1, with dimension size equal to the rank of {@code input}. - *

    Handling of out-of-bounds slice indices is implementation-defined. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class DynamicUpdateSlice extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaDynamicUpdateSlice"; - - private Output output; - - private DynamicUpdateSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaDynamicUpdateSlice operation. - * - * @param scope current scope - * @param input A {@code Tensor} of type T. - * @param update A {@code Tensor} of type T. Same rank as {@code input}. - * @param indices A vector of indices into {@code input}. Must have length equal to the rank of - * {@code input}. - * @param data type for {@code XlaDynamicUpdateSlice} output and operands - * @return a new instance of DynamicUpdateSlice - */ - @Endpoint( - describeByClass = true - ) - public static DynamicUpdateSlice create(Scope scope, Operand input, - Operand update, Operand indices) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "DynamicUpdateSlice"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(update.asOutput()); - opBuilder.addInput(indices.asOutput()); - return new DynamicUpdateSlice<>(opBuilder.build()); - } - - /** - * Gets output. - * A {@code Tensor} of type T. - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java deleted file mode 100644 index 304d7a3889b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java +++ /dev/null @@ -1,89 +0,0 @@ -/* 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.family.TType; - -/** - * An op which supports basic einsum op with 2 inputs and 1 output. - * This op has better TPU performance since it doesn't have explicitly reshape and - * transpose operations as tf.einsum does. - * - * @param data type for {@code product} output - */ -@Operator( - group = "xla" -) -public final class Einsum extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaEinsum"; - - private Output product; - - private Einsum(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaEinsum operation. - * - * @param scope current scope - * @param a the a value - * @param b the b value - * @param equation the value of the equation property - * @param data type for {@code XlaEinsum} output and operands - * @return a new instance of Einsum - */ - @Endpoint( - describeByClass = true - ) - public static Einsum create(Scope scope, Operand a, Operand b, - String equation) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Einsum"); - opBuilder.addInput(a.asOutput()); - opBuilder.addInput(b.asOutput()); - opBuilder.setAttr("equation", equation); - return new Einsum<>(opBuilder.build()); - } - - /** - * Gets product. - * - * @return product. - */ - public Output product() { - return product; - } - - @Override - public Output asOutput() { - return product; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java deleted file mode 100644 index e24dc9531ad..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java +++ /dev/null @@ -1,95 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA Gather operator documented at - * https://www.tensorflow.org/xla/operation_semantics#gather - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Gather extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaGather"; - - private Output output; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaGather operation. - * - * @param scope current scope - * @param operand The array we're gathering from. - * @param startIndices Array containing the starting indices of the slices we gather. - * @param sliceSizes slice_sizes[i] is the bounds for the slice on dimension i. - * @param dimensionNumbers A serialized xla::GatherDimensionNumbers proto. - * @param indicesAreSorted Boolean indicating if the indices are sorted. - * @param data type for {@code XlaGather} output and operands - * @param data type for {@code XlaGather} output and operands - * @return a new instance of Gather - */ - @Endpoint( - describeByClass = true - ) - public static Gather create(Scope scope, - Operand operand, Operand startIndices, Operand sliceSizes, String dimensionNumbers, - Boolean indicesAreSorted) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Gather"); - opBuilder.addInput(operand.asOutput()); - opBuilder.addInput(startIndices.asOutput()); - opBuilder.addInput(sliceSizes.asOutput()); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("indices_are_sorted", indicesAreSorted); - return new Gather<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/If.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/If.java deleted file mode 100644 index f12401bc398..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/If.java +++ /dev/null @@ -1,102 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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; - -/** - * output = cond ? then_branch(inputs) : else_branch(inputs). - */ -@Operator( - group = "xla" -) -public final class If extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaIf"; - - private List> output; - - @SuppressWarnings("unchecked") - private If(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } - - /** - * Factory method to create a class wrapping a new XlaIf operation. - * - * @param scope current scope - * @param cond A boolean scalar. - * @param inputs A list of input tensors. - * @param thenBranch A function takes 'inputs' and returns a list of tensors, - * whose types are the same as what else_branch returns. - * @param elseBranch A function takes 'inputs' and returns a list of tensors. - * whose types are the same as what then_branch returns. - * @param Tout the value of the Tout property - * @return a new instance of If - */ - @Endpoint( - describeByClass = true, - name = "ifOp" - ) - public static If create(Scope scope, Operand cond, Iterable> inputs, - ConcreteFunction thenBranch, ConcreteFunction elseBranch, List> Tout) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "If"); - opBuilder.addInput(cond.asOutput()); - opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder.setAttr("then_branch", thenBranch); - opBuilder.setAttr("else_branch", elseBranch); - opBuilder.setAttr("Tout", Operands.toDataTypes(Tout)); - return new If(opBuilder.build()); - } - - /** - * Gets output. - * A list of tensors returned by either then_branch(inputs) or - * else_branch(inputs). The input shapes of the then_branch and - * else_branch must match. - * @return output. - */ - public List> output() { - return output; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) output.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java deleted file mode 100644 index c2e896d70f8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java +++ /dev/null @@ -1,99 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code sorted_keys} output - * - * @param data type for {@code sorted_values} output - */ -@Operator( - group = "xla" -) -public final class KeyValueSort extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaKeyValueSort"; - - private Output sortedKeys; - - private Output sortedValues; - - private KeyValueSort(Operation operation) { - super(operation); - int outputIdx = 0; - sortedKeys = operation.output(outputIdx++); - sortedValues = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaKeyValueSort operation. - * - * @param scope current scope - * @param keys A {@code Tensor} of type K. - * @param values A {@code Tensor} of type V. - * @param data type for {@code XlaKeyValueSort} output and operands - * @param data type for {@code XlaKeyValueSort} output and operands - * @return a new instance of KeyValueSort - */ - @Endpoint( - describeByClass = true - ) - public static KeyValueSort create(Scope scope, - Operand keys, Operand values) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "KeyValueSort"); - opBuilder.addInput(keys.asOutput()); - opBuilder.addInput(values.asOutput()); - return new KeyValueSort<>(opBuilder.build()); - } - - /** - * Gets sortedKeys. - * A {@code Tensor} of type K. - * @return sortedKeys. - */ - public Output sortedKeys() { - return sortedKeys; - } - - /** - * Gets sortedValues. - * A {@code Tensor} of type V. - * @return sortedValues. - */ - public Output sortedValues() { - return sortedValues; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java deleted file mode 100644 index ef323534772..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java +++ /dev/null @@ -1,100 +0,0 @@ -/* 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.family.TNumber; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA Pad operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#pad - * . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Pad extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaPad"; - - private Output output; - - private Pad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaPad operation. - * - * @param scope current scope - * @param input A {@code Tensor} of type T. - * @param paddingValue A scalar {@code Tensor} of type T. - * @param paddingLow the padding to apply at the start of each input dimensions. Must - * be a compile-time constant 1D tensor of length equal to rank of input. - * @param paddingHigh the padding to apply at the end of each input dimension. Must - * be a compile-time constant 1D tensor of length equal to rank of input. - * @param paddingInterior the padding to apply between each input element. Must - * be a compile-time constant 1D tensor of length equal to rank of input, - * containing only non-negative values. - * @param data type for {@code XlaPad} output and operands - * @param data type for {@code XlaPad} output and operands - * @return a new instance of Pad - */ - @Endpoint( - describeByClass = true - ) - public static Pad create(Scope scope, Operand input, - Operand paddingValue, Operand paddingLow, Operand paddingHigh, - Operand paddingInterior) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Pad"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(paddingValue.asOutput()); - opBuilder.addInput(paddingLow.asOutput()); - opBuilder.addInput(paddingHigh.asOutput()); - opBuilder.addInput(paddingInterior.asOutput()); - return new Pad<>(opBuilder.build()); - } - - /** - * Gets output. - * A {@code Tensor} of type T. - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReadVariableSplitND.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReadVariableSplitND.java new file mode 100644 index 00000000000..9788f2927f0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReadVariableSplitND.java @@ -0,0 +1,243 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Splits resource variable input tensor across all dimensions. + * An op which splits the resource variable input tensor based on the given + * num_splits attribute, pads slices optionally, and returned the slices. Slices + * are returned in row-major order. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    + * [[0, 1, 2],
    + *  [3, 4, 5],
    + *  [6, 7, 8]]
    + * 
    + *

    {@code num_splits}: + *

    + * [2, 2]
    + * 
    + *

    and {@code paddings}: + *

    + * [1, 1]
    + * 
    + *

    the expected {@code outputs} is: + *

    + * [[0, 1],
    + *  [3, 4]]
    + * [[2, 0],
    + *  [5, 0]]
    + * [[6, 7],
    + *  [0, 0]]
    + * [[8, 0],
    + *  [0, 0]]
    + * 
    + */ +@OpMetadata( + opType = ReadVariableSplitND.OP_NAME, + inputsClass = ReadVariableSplitND.Inputs.class +) +@Operator( + group = "xla" +) +public final class ReadVariableSplitND extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReadVariableXlaSplitND"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public ReadVariableSplitND(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + + /** + * Factory method to create a class wrapping a new ReadVariableXlaSplitND operation. + * + * @param scope current scope + * @param resource Resource variable of input tensor to split across all dimensions. + * @param T The value of the T attribute + * @param N The value of the N attribute + * @param numSplits Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + * @param options carries optional attribute values + * @param data type for {@code ReadVariableXlaSplitND} output and operands + * @return a new instance of ReadVariableSplitND + */ + @Endpoint( + describeByClass = true + ) + public static ReadVariableSplitND create(Scope scope, + Operand resource, Class T, Long N, List numSplits, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReadVariableSplitND"); + opBuilder.addInput(resource.asOutput()); + opBuilder.setAttr("T", Operands.toDataType(T)); + opBuilder.setAttr("N", N); + long[] numSplitsArray = new long[numSplits.size()]; + for (int i = 0 ; i < numSplitsArray.length ; i++) { + numSplitsArray[i] = numSplits.get(i); + } + opBuilder.setAttr("num_splits", numSplitsArray); + if (options != null) { + for (Options opts : options) { + if (opts.paddings != null) { + long[] paddingsArray = new long[opts.paddings.size()]; + for (int i = 0 ; i < paddingsArray.length ; i++) { + paddingsArray[i] = opts.paddings.get(i); + } + opBuilder.setAttr("paddings", paddingsArray); + } + } + } + return new ReadVariableSplitND<>(opBuilder.build()); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public static Options paddings(List paddings) { + return new Options().paddings(paddings); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public static Options paddings(Long... paddings) { + return new Options().paddings(paddings); + } + + /** + * Gets outputs. + * Output slices based on input and num_splits defined, in row-major order. + * @return outputs. + */ + public List> outputs() { + return outputs; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outputs.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.ReadVariableSplitND} + */ + public static class Options { + private List paddings; + + private Options() { + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public Options paddings(List paddings) { + this.paddings = paddings; + return this; + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public Options paddings(Long... paddings) { + this.paddings = Arrays.asList(paddings); + return this; + } + } + + @OpInputsMetadata( + outputsClass = ReadVariableSplitND.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Resource variable of input tensor to split across all dimensions. + */ + public final Operand resource; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + */ + public final long[] numSplits; + + /** + * Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + */ + public final long[] paddings; + + public Inputs(GraphOperation op) { + super(new ReadVariableSplitND<>(op), op, Arrays.asList("T", "num_splits", "paddings")); + int inputIndex = 0; + resource = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + numSplits = op.attributes().getAttrIntList("num_splits"); + paddings = op.attributes().getAttrIntList("paddings"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java deleted file mode 100644 index a66c8d99037..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java +++ /dev/null @@ -1,91 +0,0 @@ -/* 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; - -/** - * Receives the named tensor from another XLA computation. Wraps the XLA Recv - * operator documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#recv . - * - * @param data type for {@code tensor} output - */ -@Operator( - group = "xla" -) -public final class Recv extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaRecv"; - - private Output tensor; - - private Recv(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaRecv operation. - * - * @param scope current scope - * @param dtype The type of the tensor. - * @param tensorName A string key that identifies the channel. - * @param shape The shape of the tensor. - * @param data type for {@code XlaRecv} output and operands - * @return a new instance of Recv - */ - @Endpoint( - describeByClass = true - ) - public static Recv create(Scope scope, Class dtype, String tensorName, - Shape shape) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Recv"); - opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - opBuilder.setAttr("tensor_name", tensorName); - opBuilder.setAttr("shape", shape); - return new Recv<>(opBuilder.build()); - } - - /** - * Gets tensor. - * The tensor to receive. - * @return tensor. - */ - public Output tensor() { - return tensor; - } - - @Override - public Output asOutput() { - return tensor; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Reduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Reduce.java deleted file mode 100644 index 2f96544c034..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Reduce.java +++ /dev/null @@ -1,96 +0,0 @@ -/* 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 java.util.List; -import org.tensorflow.ConcreteFunction; -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; - -/** - * Wraps the XLA Reduce operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#reduce . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Reduce extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaReduce"; - - private Output output; - - private Reduce(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaReduce operation. - * - * @param scope current scope - * @param input the input tensor - * @param initValue a scalar representing the initial value for the reduction - * @param dimensionsToReduce dimension numbers over which to reduce - * @param reducer a reducer function to apply - * @param data type for {@code XlaReduce} output and operands - * @return a new instance of Reduce - */ - @Endpoint( - describeByClass = true - ) - public static Reduce create(Scope scope, Operand input, - Operand initValue, List dimensionsToReduce, ConcreteFunction reducer) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Reduce"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(initValue.asOutput()); - long[] dimensionsToReduceArray = new long[dimensionsToReduce.size()]; - for (int i = 0 ; i < dimensionsToReduceArray.length ; i++) { - dimensionsToReduceArray[i] = dimensionsToReduce.get(i); - } - opBuilder.setAttr("dimensions_to_reduce", dimensionsToReduceArray); - opBuilder.setAttr("reducer", reducer); - return new Reduce<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReduceWindow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReduceWindow.java deleted file mode 100644 index a644b94382c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReduceWindow.java +++ /dev/null @@ -1,103 +0,0 @@ -/* 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.ConcreteFunction; -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; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA ReduceWindow operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#reducewindow . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class ReduceWindow extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaReduceWindow"; - - private Output output; - - private ReduceWindow(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaReduceWindow operation. - * - * @param scope current scope - * @param input the input tensor - * @param initValue a scalar representing the initial value for the reduction - * @param windowDimensions the shape of the window - * @param windowStrides the inter-window strides - * @param baseDilations the baseDilations value - * @param windowDilations the windowDilations value - * @param padding the padding to apply at the start and end of each input dimensions - * @param computation a reducer function to apply - * @param data type for {@code XlaReduceWindow} output and operands - * @param data type for {@code XlaReduceWindow} output and operands - * @return a new instance of ReduceWindow - */ - @Endpoint( - describeByClass = true - ) - public static ReduceWindow create(Scope scope, - Operand input, Operand initValue, Operand windowDimensions, Operand windowStrides, - Operand baseDilations, Operand windowDilations, Operand padding, - ConcreteFunction computation) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReduceWindow"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(initValue.asOutput()); - opBuilder.addInput(windowDimensions.asOutput()); - opBuilder.addInput(windowStrides.asOutput()); - opBuilder.addInput(baseDilations.asOutput()); - opBuilder.addInput(windowDilations.asOutput()); - opBuilder.addInput(padding.asOutput()); - opBuilder.setAttr("computation", computation); - return new ReduceWindow<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/RemoveDynamicDimensionSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/RemoveDynamicDimensionSize.java deleted file mode 100644 index 2aa9d0b3b48..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/RemoveDynamicDimensionSize.java +++ /dev/null @@ -1,90 +0,0 @@ -/* 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; -import org.tensorflow.types.family.TType; - -/** - * Inverse of XlaSetDynamicDimensionSize. Make an xla bounded - *
    - *     dynamic dimension into a static dimension. The bound of the size of
    - *     dimension `dim_index` becomes the static dimension size.
    - * 
    - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class RemoveDynamicDimensionSize extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaRemoveDynamicDimensionSize"; - - private Output output; - - private RemoveDynamicDimensionSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaRemoveDynamicDimensionSize operation. - * - * @param scope current scope - * @param input the input value - * @param dimIndex the dimIndex value - * @param data type for {@code XlaRemoveDynamicDimensionSize} output and operands - * @return a new instance of RemoveDynamicDimensionSize - */ - @Endpoint( - describeByClass = true - ) - public static RemoveDynamicDimensionSize create(Scope scope, - Operand input, Operand dimIndex) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "RemoveDynamicDimensionSize"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(dimIndex.asOutput()); - return new RemoveDynamicDimensionSize<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java deleted file mode 100644 index d6a886ea393..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java +++ /dev/null @@ -1,77 +0,0 @@ -/* 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; - -/** - * Replica ID. - */ -@Operator( - group = "xla" -) -public final class ReplicaId extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaReplicaId"; - - private Output id; - - private ReplicaId(Operation operation) { - super(operation); - int outputIdx = 0; - id = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaReplicaId operation. - * - * @param scope current scope - * @return a new instance of ReplicaId - */ - @Endpoint( - describeByClass = true - ) - public static ReplicaId create(Scope scope) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "ReplicaId"); - return new ReplicaId(opBuilder.build()); - } - - /** - * Gets id. - * - * @return id. - */ - public Output id() { - return id; - } - - @Override - public Output asOutput() { - return id; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Scatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Scatter.java deleted file mode 100644 index 36f7e495841..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Scatter.java +++ /dev/null @@ -1,99 +0,0 @@ -/* 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.ConcreteFunction; -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; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA Scatter operator documented at - * https://www.tensorflow.org/xla/operation_semantics#scatter. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Scatter extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaScatter"; - - private Output output; - - private Scatter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaScatter operation. - * - * @param scope current scope - * @param operand Array to be scattered into. - * @param scatterIndices Array containing the starting indices of the slices that must - * be scattered to. - * @param updates Array containing the values that must be used for scattering. - * @param updateComputation Computation to be used for combining the existing values in - * the input array and the updates during scatter. - * @param dimensionNumbers A serialized xla::ScatterDimensionNumbers proto. - * @param indicesAreSorted Boolean indicating if the indices are sorted. - * @param data type for {@code XlaScatter} output and operands - * @return a new instance of Scatter - */ - @Endpoint( - describeByClass = true - ) - public static Scatter create(Scope scope, Operand operand, - Operand scatterIndices, Operand updates, - ConcreteFunction updateComputation, String dimensionNumbers, Boolean indicesAreSorted) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Scatter"); - opBuilder.addInput(operand.asOutput()); - opBuilder.addInput(scatterIndices.asOutput()); - opBuilder.addInput(updates.asOutput()); - opBuilder.setAttr("update_computation", updateComputation); - opBuilder.setAttr("dimension_numbers", dimensionNumbers); - opBuilder.setAttr("indices_are_sorted", indicesAreSorted); - return new Scatter<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelectAndScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelectAndScatter.java deleted file mode 100644 index 8da8b04a540..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelectAndScatter.java +++ /dev/null @@ -1,103 +0,0 @@ -/* 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.ConcreteFunction; -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; -import org.tensorflow.types.family.TType; - -/** - * Wraps the XLA SelectAndScatter operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#selectandscatter - * . - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class SelectAndScatter extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSelectAndScatter"; - - private Output output; - - private SelectAndScatter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSelectAndScatter operation. - * - * @param scope current scope - * @param operand the input tensor - * @param windowDimensions the shape of the window - * @param windowStrides the inter-window strides - * @param padding the padding to apply at the start and end of each input dimensions - * @param source a tensor of values to scatter - * @param initValue a scalar representing the initial value for the output tensor - * @param select a selection function to apply - * @param scatter a scatter function to apply - * @param data type for {@code XlaSelectAndScatter} output and operands - * @param data type for {@code XlaSelectAndScatter} output and operands - * @return a new instance of SelectAndScatter - */ - @Endpoint( - describeByClass = true - ) - public static SelectAndScatter create(Scope scope, - Operand operand, Operand windowDimensions, Operand windowStrides, Operand padding, - Operand source, Operand initValue, ConcreteFunction select, ConcreteFunction scatter) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SelectAndScatter"); - opBuilder.addInput(operand.asOutput()); - opBuilder.addInput(windowDimensions.asOutput()); - opBuilder.addInput(windowStrides.asOutput()); - opBuilder.addInput(padding.asOutput()); - opBuilder.addInput(source.asOutput()); - opBuilder.addInput(initValue.asOutput()); - opBuilder.setAttr("select", select); - opBuilder.setAttr("scatter", scatter); - return new SelectAndScatter<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java deleted file mode 100644 index 144760c036a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java +++ /dev/null @@ -1,106 +0,0 @@ -/* 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.family.TType; - -/** - * Computes the eigen decomposition of a batch of self-adjoint matrices - * (Note: Only real inputs are supported). - *

    Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in - * tensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for - * i=0...N-1. - * - * @param data type for {@code w} output - */ -@Operator( - group = "xla" -) -public final class SelfAdjointEig extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSelfAdjointEig"; - - private Output w; - - private Output v; - - private SelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - w = operation.output(outputIdx++); - v = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSelfAdjointEig operation. - * - * @param scope current scope - * @param a the input tensor. - * @param lower a boolean specifies whether the calculation is done with the lower - * triangular part or the upper triangular part. - * @param maxIter maximum number of sweep update, i.e., the whole lower triangular - * part or upper triangular part based on parameter lower. Heuristically, it has - * been argued that approximately logN sweeps are needed in practice (Ref: Golub & - * van Loan "Matrix Computation"). - * @param epsilon the tolerance ratio. - * @param data type for {@code XlaSelfAdjointEig} output and operands - * @return a new instance of SelfAdjointEig - */ - @Endpoint( - describeByClass = true - ) - public static SelfAdjointEig create(Scope scope, Operand a, Boolean lower, - Long maxIter, Float epsilon) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SelfAdjointEig"); - opBuilder.addInput(a.asOutput()); - opBuilder.setAttr("lower", lower); - opBuilder.setAttr("max_iter", maxIter); - opBuilder.setAttr("epsilon", epsilon); - return new SelfAdjointEig<>(opBuilder.build()); - } - - /** - * Gets w. - * The eigenvalues in ascending order, each repeated according to its - * multiplicity. - * @return w. - */ - public Output w() { - return w; - } - - /** - * Gets v. - * The column v[..., :, i] is the normalized eigenvector corresponding to the - * eigenvalue w[..., i]. - * @return v. - */ - public Output v() { - return v; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java deleted file mode 100644 index a83150321d6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java +++ /dev/null @@ -1,64 +0,0 @@ -/* 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; - -/** - * Sends the named tensor to another XLA computation. Wraps the XLA Send operator - * documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#send . - */ -@Operator( - group = "xla" -) -public final class Send extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSend"; - - private Send(Operation operation) { - super(operation); - } - - /** - * Factory method to create a class wrapping a new XlaSend operation. - * - * @param scope current scope - * @param tensor The tensor to send. - * @param tensorName A string key that identifies the channel. - * @return a new instance of Send - */ - @Endpoint( - describeByClass = true - ) - public static Send create(Scope scope, Operand tensor, String tensorName) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Send"); - opBuilder.addInput(tensor.asOutput()); - opBuilder.setAttr("tensor_name", tensorName); - return new Send(opBuilder.build()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SetDynamicDimensionSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SetDynamicDimensionSize.java deleted file mode 100644 index 29f605bdc08..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SetDynamicDimensionSize.java +++ /dev/null @@ -1,92 +0,0 @@ -/* 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; -import org.tensorflow.types.family.TType; - -/** - * Make a static dimension into a xla bounded dynamic dimension. - *

    - *     The current static dimension size will become the bound and the second
    - *     operand becomes the dynamic size of the dimension.
    - * 
    - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class SetDynamicDimensionSize extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSetDynamicDimensionSize"; - - private Output output; - - private SetDynamicDimensionSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSetDynamicDimensionSize operation. - * - * @param scope current scope - * @param input the input value - * @param dimIndex the dimIndex value - * @param sizeOutput the sizeOutput value - * @param data type for {@code XlaSetDynamicDimensionSize} output and operands - * @return a new instance of SetDynamicDimensionSize - */ - @Endpoint( - describeByClass = true - ) - public static SetDynamicDimensionSize create(Scope scope, Operand input, - Operand dimIndex, Operand sizeOutput) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SetDynamicDimensionSize"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(dimIndex.asOutput()); - opBuilder.addInput(sizeOutput.asOutput()); - return new SetDynamicDimensionSize<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java deleted file mode 100644 index d0492f727e4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java +++ /dev/null @@ -1,122 +0,0 @@ -/* 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.family.TType; - -/** - * An op which shards the input based on the given sharding attribute. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Sharding extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSharding"; - - private Output output; - - private Sharding(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSharding operation. - * - * @param scope current scope - * @param input the input value - * @param options carries optional attribute values - * @param data type for {@code XlaSharding} output and operands - * @return a new instance of Sharding - */ - @Endpoint( - describeByClass = true - ) - public static Sharding create(Scope scope, Operand input, - Options... options) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sharding"); - opBuilder.addInput(input.asOutput()); - if (options != null) { - for (Options opts : options) { - if (opts.sharding != null) { - opBuilder.setAttr("sharding", opts.sharding); - } - } - } - return new Sharding<>(opBuilder.build()); - } - - /** - * Sets the sharding option. - * - * @param sharding the sharding option - * @return this Options instance. - */ - public static Options sharding(String sharding) { - return new Options().sharding(sharding); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } - - /** - * Optional attributes for {@link org.tensorflow.op.xla.Sharding} - */ - public static class Options { - private String sharding; - - private Options() { - } - - /** - * Sets the sharding option. - * - * @param sharding the sharding option - * @return this Options instance. - */ - public Options sharding(String sharding) { - this.sharding = sharding; - return this; - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java deleted file mode 100644 index fd61baf997a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java +++ /dev/null @@ -1,85 +0,0 @@ -/* 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.family.TType; - -/** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class Sort extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSort"; - - private Output output; - - private Sort(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSort operation. - * - * @param scope current scope - * @param input A {@code Tensor} of type T. - * @param data type for {@code XlaSort} output and operands - * @return a new instance of Sort - */ - @Endpoint( - describeByClass = true - ) - public static Sort create(Scope scope, Operand input) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Sort"); - opBuilder.addInput(input.asOutput()); - return new Sort<>(opBuilder.build()); - } - - /** - * Gets output. - * A {@code Tensor} of type T. - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SplitND.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SplitND.java new file mode 100644 index 00000000000..299b2f95437 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SplitND.java @@ -0,0 +1,239 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * Splits input tensor across all dimensions. + * An op which slices the input tensor based on the given num_splits attribute, + * pads slices optionally, and returned the slices. Slices are returned in + * row-major order. + *

    This op may be generated via the TPU bridge. + *

    For example, with {@code input} tensor: + *

    + * [[0, 1, 2],
    + *  [3, 4, 5],
    + *  [6, 7, 8]]
    + * 
    + *

    {@code num_splits}: + *

    + * [2, 2]
    + * 
    + *

    and {@code paddings}: + *

    + * [1, 1]
    + * 
    + *

    the expected {@code outputs} is: + *

    + * [[0, 1],
    + *  [3, 4]]
    + * [[2, 0],
    + *  [5, 0]]
    + * [[6, 7],
    + *  [0, 0]]
    + * [[8, 0],
    + *  [0, 0]]
    + * 
    + */ +@OpMetadata( + opType = SplitND.OP_NAME, + inputsClass = SplitND.Inputs.class +) +@Operator( + group = "xla" +) +public final class SplitND extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSplitND"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public SplitND(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + + /** + * Factory method to create a class wrapping a new XlaSplitND operation. + * + * @param scope current scope + * @param input Input tensor to split across all dimensions. + * @param N The value of the N attribute + * @param numSplits Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + * @param options carries optional attribute values + * @param data type for {@code XlaSplitND} output and operands + * @return a new instance of SplitND + */ + @Endpoint( + describeByClass = true + ) + public static SplitND create(Scope scope, Operand input, Long N, + List numSplits, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SplitND"); + opBuilder.addInput(input.asOutput()); + opBuilder.setAttr("N", N); + long[] numSplitsArray = new long[numSplits.size()]; + for (int i = 0 ; i < numSplitsArray.length ; i++) { + numSplitsArray[i] = numSplits.get(i); + } + opBuilder.setAttr("num_splits", numSplitsArray); + if (options != null) { + for (Options opts : options) { + if (opts.paddings != null) { + long[] paddingsArray = new long[opts.paddings.size()]; + for (int i = 0 ; i < paddingsArray.length ; i++) { + paddingsArray[i] = opts.paddings.get(i); + } + opBuilder.setAttr("paddings", paddingsArray); + } + } + } + return new SplitND<>(opBuilder.build()); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public static Options paddings(List paddings) { + return new Options().paddings(paddings); + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public static Options paddings(Long... paddings) { + return new Options().paddings(paddings); + } + + /** + * Gets outputs. + * Output slices based on input and num_splits defined, in row-major order. + * @return outputs. + */ + public List> outputs() { + return outputs; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outputs.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.SplitND} + */ + public static class Options { + private List paddings; + + private Options() { + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public Options paddings(List paddings) { + this.paddings = paddings; + return this; + } + + /** + * Sets the paddings option. + * + * @param paddings Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + * @return this Options instance. + */ + public Options paddings(Long... paddings) { + this.paddings = Arrays.asList(paddings); + return this; + } + } + + @OpInputsMetadata( + outputsClass = SplitND.class + ) + public static class Inputs extends RawOpInputs> { + /** + * Input tensor to split across all dimensions. + */ + public final Operand input; + + /** + * The T attribute + */ + public final DataType T; + + /** + * Number of ways to split per dimension. Shape dimensions must be evenly + * divisible. + */ + public final long[] numSplits; + + /** + * Optional list of right paddings per dimension of input tensor to apply before + * splitting. This can be used to make a dimension evenly divisible. + */ + public final long[] paddings; + + public Inputs(GraphOperation op) { + super(new SplitND<>(op), op, Arrays.asList("T", "num_splits", "paddings")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + T = op.attributes().getAttrType("T"); + numSplits = op.attributes().getAttrIntList("num_splits"); + paddings = op.attributes().getAttrIntList("paddings"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdFullToShardShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdFullToShardShape.java deleted file mode 100644 index c03b66f8d88..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdFullToShardShape.java +++ /dev/null @@ -1,89 +0,0 @@ -/* 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.family.TType; - -/** - * An op used by XLA SPMD partitioner to switch from automatic partitioning to - * manual partitioning. It annotates the input (full-shape, to be automatically - * partitioned) with the same sharding used by manual partitioning, and outputs a - * shard-shaped tensor to be consumed by later manually-partitioned ops. If the - * shape is not evenly partitionable, the padding region will be masked with 0s. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class SpmdFullToShardShape extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSpmdFullToShardShape"; - - private Output output; - - private SpmdFullToShardShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSpmdFullToShardShape operation. - * - * @param scope current scope - * @param input the input value - * @param manualSharding the value of the manualSharding property - * @param data type for {@code XlaSpmdFullToShardShape} output and operands - * @return a new instance of SpmdFullToShardShape - */ - @Endpoint( - describeByClass = true - ) - public static SpmdFullToShardShape create(Scope scope, Operand input, - String manualSharding) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SpmdFullToShardShape"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("manual_sharding", manualSharding); - return new SpmdFullToShardShape<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdShardToFullShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdShardToFullShape.java deleted file mode 100644 index 8e44eb9e374..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SpmdShardToFullShape.java +++ /dev/null @@ -1,91 +0,0 @@ -/* 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.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 used by XLA SPMD partitioner to switch from manual partitioning to - * automatic partitioning. It converts the shard-shaped, manually partitioned input - * into full-shaped tensor to be partitioned automatically with the same sharding - * used by manual partitioning. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class SpmdShardToFullShape extends RawOp implements Operand { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSpmdShardToFullShape"; - - private Output output; - - private SpmdShardToFullShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSpmdShardToFullShape operation. - * - * @param scope current scope - * @param input the input value - * @param manualSharding the value of the manualSharding property - * @param fullShape the value of the fullShape property - * @param data type for {@code XlaSpmdShardToFullShape} output and operands - * @return a new instance of SpmdShardToFullShape - */ - @Endpoint( - describeByClass = true - ) - public static SpmdShardToFullShape create(Scope scope, Operand input, - String manualSharding, Shape fullShape) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "SpmdShardToFullShape"); - opBuilder.addInput(input.asOutput()); - opBuilder.setAttr("manual_sharding", manualSharding); - opBuilder.setAttr("full_shape", fullShape); - return new SpmdShardToFullShape<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java deleted file mode 100644 index c979831e460..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java +++ /dev/null @@ -1,115 +0,0 @@ -/* 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.family.TType; - -/** - * Computes the eigen decomposition of a batch of self-adjoint matrices - * (Note: Only real inputs are supported). - *

    Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in - * tensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]). - * - * @param data type for {@code s} output - */ -@Operator( - group = "xla" -) -public final class Svd extends RawOp { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaSvd"; - - private Output s; - - private Output u; - - private Output v; - - private Svd(Operation operation) { - super(operation); - int outputIdx = 0; - s = operation.output(outputIdx++); - u = operation.output(outputIdx++); - v = operation.output(outputIdx++); - } - - /** - * Factory method to create a class wrapping a new XlaSvd operation. - * - * @param scope current scope - * @param a the input tensor. - * @param maxIter maximum number of sweep update, i.e., the whole lower triangular - * part or upper triangular part based on parameter lower. Heuristically, it has - * been argued that approximately log(min (M, N)) sweeps are needed in practice - * (Ref: Golub & van Loan "Matrix Computation"). - * @param epsilon the tolerance ratio. - * @param precisionConfig a serialized xla::PrecisionConfig proto. - * @param data type for {@code XlaSvd} output and operands - * @return a new instance of Svd - */ - @Endpoint( - describeByClass = true - ) - public static Svd create(Scope scope, Operand a, Long maxIter, - Float epsilon, String precisionConfig) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Svd"); - opBuilder.addInput(a.asOutput()); - opBuilder.setAttr("max_iter", maxIter); - opBuilder.setAttr("epsilon", epsilon); - opBuilder.setAttr("precision_config", precisionConfig); - return new Svd<>(opBuilder.build()); - } - - /** - * Gets s. - * Singular values. The values are sorted in reverse order of magnitude, so - * s[..., 0] is the largest value, s[..., 1] is the second largest, etc. - * @return s. - */ - public Output s() { - return s; - } - - /** - * Gets u. - * Left singular vectors. - * @return u. - */ - public Output u() { - return u; - } - - /** - * Gets v. - * Right singular vectors. - * @return v. - */ - public Output v() { - return v; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/While.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/While.java deleted file mode 100644 index 9e9ada04295..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/While.java +++ /dev/null @@ -1,101 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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; - -/** - * output = input; While (Cond(output)) { output = Body(output) } - */ -@Operator( - group = "xla" -) -public final class While extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaWhile"; - - private List> output; - - @SuppressWarnings("unchecked") - private While(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } - - /** - * Factory method to create a class wrapping a new XlaWhile operation. - * - * @param scope current scope - * @param input A list of input tensors whose types are T. - * @param cond A function takes 'input' and returns a tensor. If the tensor is - * a scalar of non-boolean, the scalar is converted to a boolean - * according to the following rule: if the scalar is a numerical - * value, non-zero means True and zero means False; if the scalar is - * a string, non-empty means True and empty means False. If the - * tensor is not a scalar, non-emptiness means True and False - * otherwise. - * @param body A function that takes a list of tensors and returns another - * list of tensors. Both lists have the same types as specified by T. - * @return a new instance of While - */ - @Endpoint( - describeByClass = true, - name = "whileOp" - ) - public static While create(Scope scope, Iterable> input, ConcreteFunction cond, - ConcreteFunction body) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "While"); - opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder.setAttr("cond", cond); - opBuilder.setAttr("body", body); - return new While(opBuilder.build()); - } - - /** - * Gets output. - * A list of output tensors whose types are T. - * @return output. - */ - public List> output() { - return output; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) output.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaHostCompute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaHostCompute.java index 6e8d38cd19a..0b25f9f064a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaHostCompute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaHostCompute.java @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -28,14 +29,22 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A pseudo-op to represent host-side computation in an XLA program. */ +@OpMetadata( + opType = XlaHostCompute.OP_NAME, + inputsClass = XlaHostCompute.Inputs.class +) @Operator( group = "xla" ) @@ -48,8 +57,8 @@ public final class XlaHostCompute extends RawOp implements Iterable> outputs; @SuppressWarnings("unchecked") - private XlaHostCompute(Operation operation) { - super(operation); + public XlaHostCompute(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; int outputsLength = operation.outputListLength("outputs"); outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); @@ -225,4 +234,77 @@ public Options tpuCore(Long tpuCore) { return this; } } + + @OpInputsMetadata( + outputsClass = XlaHostCompute.class + ) + public static class Inputs extends RawOpInputs { + /** + * A list of tensors that will be sent to the host. + */ + public final Iterable> inputs; + + /** + * The element types of each element in {@code inputs}. + */ + public final DataType[] Tinputs; + + /** + * The element types of each element in {@code outputs}. + */ + public final DataType[] Toutputs; + + /** + * A list of names of HostCompute computations that must be + * sequenced before this computation. + */ + public final String[] ancestors; + + /** + * If shape_inference_graph is empty, a list of the shapes of {@code outputs}. + */ + public final Shape[] shapes; + + /** + * A unique identifier for this region used to match up host transfers. + */ + public final String key; + + /** + * The sendKey attribute + */ + public final String sendKey; + + /** + * The recvKey attribute + */ + public final String recvKey; + + /** + * Estimated duration of the host computation in nanoseconds. + */ + public final long costEstimateNs; + + /** + * Default core to use for host to device transfers. + */ + public final long tpuCore; + + public Inputs(GraphOperation op) { + super(new XlaHostCompute(op), op, Arrays.asList("Tinputs", "Toutputs", "ancestors", "shapes", "key", "send_key", "recv_key", "cost_estimate_ns", "tpu_core")); + int inputIndex = 0; + int inputsLength = op.inputListLength("inputs"); + inputs = Arrays.asList((Operand[]) op.inputList(inputIndex, inputsLength)); + inputIndex += inputsLength; + Tinputs = op.attributes().getAttrTypeList("Tinputs"); + Toutputs = op.attributes().getAttrTypeList("Toutputs"); + ancestors = op.attributes().getAttrStringList("ancestors"); + shapes = op.attributes().getAttrShapeList("shapes"); + key = op.attributes().getAttrString("key"); + sendKey = op.attributes().getAttrString("send_key"); + recvKey = op.attributes().getAttrString("recv_key"); + costEstimateNs = op.attributes().getAttrInt("cost_estimate_ns"); + tpuCore = op.attributes().getAttrInt("tpu_core"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaLaunch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaLaunch.java deleted file mode 100644 index 6e83c779c1b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaLaunch.java +++ /dev/null @@ -1,98 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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; - -/** - * XLA Launch Op. For use by the XLA JIT only. - */ -@Operator( - group = "xla" -) -public final class XlaLaunch extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaLaunch"; - - private List> results; - - @SuppressWarnings("unchecked") - private XlaLaunch(Operation operation) { - super(operation); - int outputIdx = 0; - int resultsLength = operation.outputListLength("results"); - results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); - outputIdx += resultsLength; - } - - /** - * Factory method to create a class wrapping a new XlaLaunch operation. - * - * @param scope current scope - * @param constants the constants value - * @param args the args value - * @param resources the resources value - * @param Tresults the value of the Tresults property - * @param function the value of the function property - * @return a new instance of XlaLaunch - */ - @Endpoint( - describeByClass = true - ) - public static XlaLaunch create(Scope scope, Iterable> constants, - Iterable> args, Iterable> resources, - List> Tresults, ConcreteFunction function) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaLaunch"); - opBuilder.addInputList(Operands.asOutputs(constants)); - opBuilder.addInputList(Operands.asOutputs(args)); - opBuilder.addInputList(Operands.asOutputs(resources)); - opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); - opBuilder.setAttr("function", function); - return new XlaLaunch(opBuilder.build()); - } - - /** - * Gets results. - * - * @return results. - */ - public List> results() { - return results; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) results.iterator(); - } -} 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 index 06178290708..b05f7199f7a 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,6 +17,8 @@ package org.tensorflow.op.xla; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; @@ -24,9 +26,13 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -35,9 +41,11 @@ * 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 */ +@OpMetadata( + opType = XlaRecvFromHost.OP_NAME, + inputsClass = XlaRecvFromHost.Inputs.class +) @Operator( group = "xla" ) @@ -49,8 +57,8 @@ public final class XlaRecvFromHost extends RawOp implements Ope private Output output; - private XlaRecvFromHost(Operation operation) { - super(operation); + public XlaRecvFromHost(Operation operation) { + super(operation, OP_NAME); int outputIdx = 0; output = operation.output(outputIdx++); } @@ -59,9 +67,9 @@ private XlaRecvFromHost(Operation operation) { * Factory method to create a class wrapping a new XlaRecvFromHost operation. * * @param scope current scope - * @param Toutput the value of the Toutput property - * @param shape the value of the shape property - * @param key the value of the key property + * @param Toutput The value of the Toutput attribute + * @param shape The value of the shape attribute + * @param key The value of the key attribute * @param data type for {@code XlaRecvFromHost} output and operands * @return a new instance of XlaRecvFromHost */ @@ -90,4 +98,32 @@ public Output output() { public Output asOutput() { return output; } + + @OpInputsMetadata( + outputsClass = XlaRecvFromHost.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The Toutput attribute + */ + public final DataType Toutput; + + /** + * The shape attribute + */ + public final Shape shape; + + /** + * The key attribute + */ + public final String key; + + public Inputs(GraphOperation op) { + super(new XlaRecvFromHost<>(op), op, Arrays.asList("Toutput", "shape", "key")); + int inputIndex = 0; + Toutput = op.attributes().getAttrType("Toutput"); + shape = op.attributes().getAttrShape("shape"); + key = op.attributes().getAttrString("key"); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingActivations.java new file mode 100644 index 00000000000..b3499a237f0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingActivations.java @@ -0,0 +1,160 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; + +/** + * An op that receives embedding activations on the TPU. + * The TPU system performs the embedding lookups and aggregations. The results of + * these aggregations are visible to the Tensorflow Graph as the outputs of a + * XlaRecvTPUEmbeddingActivations Op. This op returns a list containing one + * Tensor of activations per table specified in the model. + */ +@OpMetadata( + opType = XlaRecvTPUEmbeddingActivations.OP_NAME, + inputsClass = XlaRecvTPUEmbeddingActivations.Inputs.class +) +public final class XlaRecvTPUEmbeddingActivations extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaRecvTPUEmbeddingActivationsV2"; + + private List> outputs; + + @SuppressWarnings("unchecked") + public XlaRecvTPUEmbeddingActivations(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + + /** + * Factory method to create a class wrapping a new XlaRecvTPUEmbeddingActivationsV2 operation. + * + * @param scope current scope + * @param deduplicationData A Tensor with type=DT_VARIANT containing the deduplication + * data. The tensor is an XLA nested tuple containing N elements (where N is + * the ratio of the number of embedding to tensor cores per TPU chip). Each + * element of the nested tuple is a tuple of rank 1 tensors. Each tensor either + * contains indices (DT_UINT32) for embedding lookup on the TensorCore or + * weights (DT_FLOAT) to apply to the output of the embedding lookup operation. + * @param numTables The number of output activation tensors. If feature descriptor is + * present in the tpu embedding config, it is equal to the number of features + * otherwise equal to number of embedding tables in the model. + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param embeddingPartitions Serialized EmbeddingPartitionsProto proto. + * @param hbmBuffersConfig Serialized HbmBuffersConfig proto. + * @param tpuTopology Serialized TpuTopologyArgsProto proto. + * @return a new instance of XlaRecvTPUEmbeddingActivations + */ + @Endpoint( + describeByClass = true + ) + public static XlaRecvTPUEmbeddingActivations create(Scope scope, + Operand deduplicationData, Long numTables, String config, + String embeddingPartitions, String hbmBuffersConfig, String tpuTopology) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaRecvTPUEmbeddingActivations"); + opBuilder.addInput(deduplicationData.asOutput()); + opBuilder.setAttr("num_tables", numTables); + opBuilder.setAttr("config", config); + opBuilder.setAttr("embedding_partitions", embeddingPartitions); + opBuilder.setAttr("hbm_buffers_config", hbmBuffersConfig); + opBuilder.setAttr("tpu_topology", tpuTopology); + return new XlaRecvTPUEmbeddingActivations(opBuilder.build()); + } + + /** + * Gets outputs. + * A TensorList of embedding activations containing one Tensor per + * embedding table in the model. + * @return outputs. + */ + public List> outputs() { + return outputs; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) outputs.iterator(); + } + + @OpInputsMetadata( + outputsClass = XlaRecvTPUEmbeddingActivations.class + ) + public static class Inputs extends RawOpInputs { + /** + * A Tensor with type=DT_VARIANT containing the deduplication + * data. The tensor is an XLA nested tuple containing N elements (where N is + * the ratio of the number of embedding to tensor cores per TPU chip). Each + * element of the nested tuple is a tuple of rank 1 tensors. Each tensor either + * contains indices (DT_UINT32) for embedding lookup on the TensorCore or + * weights (DT_FLOAT) to apply to the output of the embedding lookup operation. + */ + public final Operand deduplicationData; + + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + /** + * Serialized EmbeddingPartitionsProto proto. + */ + public final String embeddingPartitions; + + /** + * Serialized HbmBuffersConfig proto. + */ + public final String hbmBuffersConfig; + + /** + * Serialized TpuTopologyArgsProto proto. + */ + public final String tpuTopology; + + public Inputs(GraphOperation op) { + super(new XlaRecvTPUEmbeddingActivations(op), op, Arrays.asList("config", "embedding_partitions", "hbm_buffers_config", "tpu_topology")); + int inputIndex = 0; + deduplicationData = (Operand) op.input(inputIndex++); + config = op.attributes().getAttrString("config"); + embeddingPartitions = op.attributes().getAttrString("embedding_partitions"); + hbmBuffersConfig = op.attributes().getAttrString("hbm_buffers_config"); + tpuTopology = op.attributes().getAttrString("tpu_topology"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingDeduplicationData.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingDeduplicationData.java new file mode 100644 index 00000000000..a0c18fb338c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvTPUEmbeddingDeduplicationData.java @@ -0,0 +1,133 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.family.TType; + +/** + * Receives deduplication data (indices and weights) from the embedding core. + * The deduplication data is a Tensor with type=DT_VARIANT. The tensor itself is an + * XLA nested tuple containing N elements (where N is the ratio of the number of + * embedding to tensor cores per TPU chip). Each element of the nested tuple is a + * tuple of rank 1 tensors. Each tensor either contains indices (DT_UINT32) for + * embedding lookup on the TensorCore or weights (DT_FLOAT) to apply to the output + * of the embedding lookup operation. + */ +@OpMetadata( + opType = XlaRecvTPUEmbeddingDeduplicationData.OP_NAME, + inputsClass = XlaRecvTPUEmbeddingDeduplicationData.Inputs.class +) +public final class XlaRecvTPUEmbeddingDeduplicationData extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaRecvTPUEmbeddingDeduplicationDataV2"; + + private Output output; + + @SuppressWarnings("unchecked") + public XlaRecvTPUEmbeddingDeduplicationData(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaRecvTPUEmbeddingDeduplicationDataV2 operation. + * + * @param scope current scope + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param embeddingPartitions Serialized EmbeddingPartitionsProto proto. + * @param hbmBuffersConfig Serialized HbmBuffersConfig proto. + * @param tpuTopology Serialized TpuTopologyArgsProto proto. + * @return a new instance of XlaRecvTPUEmbeddingDeduplicationData + */ + @Endpoint( + describeByClass = true + ) + public static XlaRecvTPUEmbeddingDeduplicationData create(Scope scope, String config, + String embeddingPartitions, String hbmBuffersConfig, String tpuTopology) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaRecvTPUEmbeddingDeduplicationData"); + opBuilder.setAttr("config", config); + opBuilder.setAttr("embedding_partitions", embeddingPartitions); + opBuilder.setAttr("hbm_buffers_config", hbmBuffersConfig); + opBuilder.setAttr("tpu_topology", tpuTopology); + return new XlaRecvTPUEmbeddingDeduplicationData(opBuilder.build()); + } + + /** + * Gets output. + * + * @return output. + */ + public Output output() { + return output; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) output; + } + + @OpInputsMetadata( + outputsClass = XlaRecvTPUEmbeddingDeduplicationData.class + ) + public static class Inputs extends RawOpInputs { + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + /** + * Serialized EmbeddingPartitionsProto proto. + */ + public final String embeddingPartitions; + + /** + * Serialized HbmBuffersConfig proto. + */ + public final String hbmBuffersConfig; + + /** + * Serialized TpuTopologyArgsProto proto. + */ + public final String tpuTopology; + + public Inputs(GraphOperation op) { + super(new XlaRecvTPUEmbeddingDeduplicationData(op), op, Arrays.asList("config", "embedding_partitions", "hbm_buffers_config", "tpu_topology")); + int inputIndex = 0; + config = op.attributes().getAttrString("config"); + embeddingPartitions = op.attributes().getAttrString("embedding_partitions"); + hbmBuffersConfig = op.attributes().getAttrString("hbm_buffers_config"); + tpuTopology = op.attributes().getAttrString("tpu_topology"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendTPUEmbeddingGradients.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendTPUEmbeddingGradients.java new file mode 100644 index 00000000000..4483bc3a116 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendTPUEmbeddingGradients.java @@ -0,0 +1,198 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.op.Operands; +import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; + +/** + * An op that performs gradient updates of embedding tables. + * The gradients argument is a TensorList having the same length and shapes as the + * return value of XlaRecvTPUEmbeddingActivations, but contains gradients of the + * model's loss with respect to the embedding activations. The embedding tables are + * updated from these gradients via the optimizer specified in the + * TPUEmbeddingConfiguration proto given to tpu.initialize_system. + */ +@OpMetadata( + opType = XlaSendTPUEmbeddingGradients.OP_NAME, + inputsClass = XlaSendTPUEmbeddingGradients.Inputs.class +) +public final class XlaSendTPUEmbeddingGradients extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSendTPUEmbeddingGradientsV2"; + + public XlaSendTPUEmbeddingGradients(Operation operation) { + super(operation, OP_NAME); + } + + /** + * Factory method to create a class wrapping a new XlaSendTPUEmbeddingGradientsV2 operation. + * + * @param scope current scope + * @param gradients A TensorList of gradients with which to update embedding tables. + * @param learningRates A TensorList of learning rates used for updating the embedding + * tables via the optimizer. The length of the TensorList must be equal to the + * number of dynamic learning rate tags specified in the + * TPUEmbeddingConfiguration proto. + * @param deduplicationData A Tensor with type=DT_VARIANT containing the deduplication + * data. The tensor is an XLA nested tuple containing N elements (where N is + * the ratio of the number of embedding to tensor cores per TPU chip). Each + * element of the nested tuple is a tuple of rank 1 tensors. Each tensor either + * contains indices (DT_UINT32) for embedding lookup on the TensorCore or + * weights (DT_FLOAT) to apply to the output of the embedding lookup operation. + * @param config Serialized TPUEmbeddingConfiguration proto. + * @param embeddingPartitions Serialized EmbeddingPartitionsProto proto. + * @param hbmBuffersConfig Serialized HbmBuffersConfig proto. + * @param tpuTopology Serialized TpuTopologyArgsProto proto. + * @param options carries optional attribute values + * @return a new instance of XlaSendTPUEmbeddingGradients + */ + @Endpoint( + describeByClass = true + ) + public static XlaSendTPUEmbeddingGradients create(Scope scope, + Iterable> gradients, Iterable> learningRates, + Operand deduplicationData, String config, String embeddingPartitions, + String hbmBuffersConfig, String tpuTopology, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSendTPUEmbeddingGradients"); + opBuilder.addInputList(Operands.asOutputs(gradients)); + opBuilder.addInputList(Operands.asOutputs(learningRates)); + opBuilder.addInput(deduplicationData.asOutput()); + opBuilder.setAttr("config", config); + opBuilder.setAttr("embedding_partitions", embeddingPartitions); + opBuilder.setAttr("hbm_buffers_config", hbmBuffersConfig); + opBuilder.setAttr("tpu_topology", tpuTopology); + if (options != null) { + for (Options opts : options) { + if (opts.NumLearningRateTags != null) { + opBuilder.setAttr("NumLearningRateTags", opts.NumLearningRateTags); + } + } + } + return new XlaSendTPUEmbeddingGradients(opBuilder.build()); + } + + /** + * Sets the NumLearningRateTags option. + * + * @param NumLearningRateTags number of learning rate tags + * @return this Options instance. + */ + public static Options NumLearningRateTags(Long NumLearningRateTags) { + return new Options().NumLearningRateTags(NumLearningRateTags); + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSendTPUEmbeddingGradients} + */ + public static class Options { + private Long NumLearningRateTags; + + private Options() { + } + + /** + * Sets the NumLearningRateTags option. + * + * @param NumLearningRateTags number of learning rate tags + * @return this Options instance. + */ + public Options NumLearningRateTags(Long NumLearningRateTags) { + this.NumLearningRateTags = NumLearningRateTags; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSendTPUEmbeddingGradients.class + ) + public static class Inputs extends RawOpInputs { + /** + * A TensorList of gradients with which to update embedding tables. + */ + public final Iterable> gradients; + + /** + * A TensorList of learning rates used for updating the embedding + * tables via the optimizer. The length of the TensorList must be equal to the + * number of dynamic learning rate tags specified in the + * TPUEmbeddingConfiguration proto. + */ + public final Iterable> learningRates; + + /** + * A Tensor with type=DT_VARIANT containing the deduplication + * data. The tensor is an XLA nested tuple containing N elements (where N is + * the ratio of the number of embedding to tensor cores per TPU chip). Each + * element of the nested tuple is a tuple of rank 1 tensors. Each tensor either + * contains indices (DT_UINT32) for embedding lookup on the TensorCore or + * weights (DT_FLOAT) to apply to the output of the embedding lookup operation. + */ + public final Operand deduplicationData; + + /** + * Serialized TPUEmbeddingConfiguration proto. + */ + public final String config; + + /** + * Serialized EmbeddingPartitionsProto proto. + */ + public final String embeddingPartitions; + + /** + * Serialized HbmBuffersConfig proto. + */ + public final String hbmBuffersConfig; + + /** + * Serialized TpuTopologyArgsProto proto. + */ + public final String tpuTopology; + + public Inputs(GraphOperation op) { + super(new XlaSendTPUEmbeddingGradients(op), op, Arrays.asList("config", "embedding_partitions", "hbm_buffers_config", "tpu_topology")); + int inputIndex = 0; + int gradientsLength = op.inputListLength("gradients"); + gradients = Arrays.asList((Operand[]) op.inputList(inputIndex, gradientsLength)); + inputIndex += gradientsLength; + int learningRatesLength = op.inputListLength("learning_rates"); + learningRates = Arrays.asList((Operand[]) op.inputList(inputIndex, learningRatesLength)); + inputIndex += learningRatesLength; + deduplicationData = (Operand) op.input(inputIndex++); + config = op.attributes().getAttrString("config"); + embeddingPartitions = op.attributes().getAttrString("embedding_partitions"); + hbmBuffersConfig = op.attributes().getAttrString("hbm_buffers_config"); + tpuTopology = op.attributes().getAttrString("tpu_topology"); + } + } +} 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 index 25a9226f6ff..a5969402052 100644 --- 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 @@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2018-2023 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. @@ -17,13 +17,19 @@ package org.tensorflow.op.xla; +import java.util.Arrays; +import org.tensorflow.GraphOperation; import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; +import org.tensorflow.op.RawOpInputs; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -32,6 +38,10 @@ * Tinput: element type for input. * key: A unique identifier for this region used to match up host transfers. */ +@OpMetadata( + opType = XlaSendToHost.OP_NAME, + inputsClass = XlaSendToHost.Inputs.class +) @Operator( group = "xla" ) @@ -41,16 +51,16 @@ public final class XlaSendToHost extends RawOp { */ public static final String OP_NAME = "XlaSendToHost"; - private XlaSendToHost(Operation operation) { - super(operation); + public XlaSendToHost(Operation operation) { + super(operation, OP_NAME); } /** * Factory method to create a class wrapping a new XlaSendToHost operation. * * @param scope current scope - * @param input the input value - * @param key the value of the key property + * @param input The input value + * @param key The value of the key attribute * @return a new instance of XlaSendToHost */ @Endpoint( @@ -62,4 +72,32 @@ public static XlaSendToHost create(Scope scope, Operand input, opBuilder.setAttr("key", key); return new XlaSendToHost(opBuilder.build()); } + + @OpInputsMetadata( + outputsClass = XlaSendToHost.class + ) + public static class Inputs extends RawOpInputs { + /** + * The input input + */ + public final Operand input; + + /** + * The Tinput attribute + */ + public final DataType Tinput; + + /** + * The key attribute + */ + public final String key; + + public Inputs(GraphOperation op) { + super(new XlaSendToHost(op), op, Arrays.asList("Tinput", "key")); + int inputIndex = 0; + input = (Operand) op.input(inputIndex++); + Tinput = op.attributes().getAttrType("Tinput"); + key = op.attributes().getAttrString("key"); + } + } } 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 deleted file mode 100644 index 22ae3a04750..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java +++ /dev/null @@ -1,84 +0,0 @@ -/* 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 { - /** - * 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++); - } - - /** - * Factory method to create a class wrapping a new XlaSetBound operation. - * - * @param scope current scope - * @param input the input value - * @param bound the bound value - * @return a new instance of XlaSetBound - */ - @Endpoint( - describeByClass = true - ) - public static XlaSetBound create(Scope scope, Operand input, Operand bound) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSetBound"); - opBuilder.addInput(input.asOutput()); - opBuilder.addInput(bound.asOutput()); - return new XlaSetBound(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public Output output() { - return output; - } - - @Override - public Output asOutput() { - return output; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java new file mode 100644 index 00000000000..6dc42362b87 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseActivationsUnstack.java @@ -0,0 +1,163 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The XlaSparseActivationsUnstack operation + */ +@OpMetadata( + opType = XlaSparseActivationsUnstack.OP_NAME, + inputsClass = XlaSparseActivationsUnstack.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseActivationsUnstack extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseActivationsUnstack"; + + private List> unstackedActivations; + + @SuppressWarnings("unchecked") + public XlaSparseActivationsUnstack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int unstackedActivationsLength = operation.outputListLength("unstacked_activations"); + unstackedActivations = Arrays.asList((Output[]) operation.outputList(outputIdx, unstackedActivationsLength)); + outputIdx += unstackedActivationsLength; + } + + /** + * Factory method to create a class wrapping a new XlaSparseActivationsUnstack operation. + * + * @param scope current scope + * @param stackedActivations The stackedActivations value + * @param numTables The value of the numTables attribute + * @param sampleCounts The value of the sampleCounts attribute + * @param features The value of the features attribute + * @param interleaved The value of the interleaved attribute + * @param dtype The value of the dtype attribute + * @param data type for {@code XlaSparseActivationsUnstack} output and operands + * @return a new instance of XlaSparseActivationsUnstack + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseActivationsUnstack create(Scope scope, + Operand stackedActivations, Long numTables, List sampleCounts, + List features, Boolean interleaved, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseActivationsUnstack"); + opBuilder.addInput(stackedActivations.asOutput()); + opBuilder.setAttr("num_tables", numTables); + long[] sampleCountsArray = new long[sampleCounts.size()]; + for (int i = 0 ; i < sampleCountsArray.length ; i++) { + sampleCountsArray[i] = sampleCounts.get(i); + } + opBuilder.setAttr("sample_counts", sampleCountsArray); + long[] featuresArray = new long[features.size()]; + for (int i = 0 ; i < featuresArray.length ; i++) { + featuresArray[i] = features.get(i); + } + opBuilder.setAttr("features", featuresArray); + opBuilder.setAttr("interleaved", interleaved); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new XlaSparseActivationsUnstack<>(opBuilder.build()); + } + + /** + * Gets unstackedActivations. + * + * @return unstackedActivations. + */ + public List> unstackedActivations() { + return unstackedActivations; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) unstackedActivations.iterator(); + } + + @OpInputsMetadata( + outputsClass = XlaSparseActivationsUnstack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The stackedActivations input + */ + public final Operand stackedActivations; + + /** + * The sampleCounts attribute + */ + public final long[] sampleCounts; + + /** + * The features attribute + */ + public final long[] features; + + /** + * The interleaved attribute + */ + public final boolean interleaved; + + /** + * The inputDtype attribute + */ + public final DataType inputDtype; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new XlaSparseActivationsUnstack<>(op), op, Arrays.asList("sample_counts", "features", "interleaved", "input_dtype", "dtype")); + int inputIndex = 0; + stackedActivations = (Operand) op.input(inputIndex++); + sampleCounts = op.attributes().getAttrIntList("sample_counts"); + features = op.attributes().getAttrIntList("features"); + interleaved = op.attributes().getAttrBool("interleaved"); + inputDtype = op.attributes().getAttrType("input_dtype"); + dtype = op.attributes().getAttrType("dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagrad.java new file mode 100644 index 00000000000..f4e7db1771e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagrad.java @@ -0,0 +1,154 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseCoreAdagrad operation + */ +@OpMetadata( + opType = XlaSparseCoreAdagrad.OP_NAME, + inputsClass = XlaSparseCoreAdagrad.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseCoreAdagrad extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseCoreAdagrad"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + public XlaSparseCoreAdagrad(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseCoreAdagrad operation. + * + * @param scope current scope + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param accumulator The accumulator value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @return a new instance of XlaSparseCoreAdagrad + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseCoreAdagrad create(Scope scope, Operand indices, + Operand gradient, Operand learningRate, Operand accumulator, + Operand embeddingTable, Long featureWidth) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseCoreAdagrad"); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(gradient.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.setAttr("feature_width", featureWidth); + return new XlaSparseCoreAdagrad(opBuilder.build()); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + @OpInputsMetadata( + outputsClass = XlaSparseCoreAdagrad.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The gradient input + */ + public final Operand gradient; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + public Inputs(GraphOperation op) { + super(new XlaSparseCoreAdagrad(op), op, Arrays.asList("feature_width")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + featureWidth = op.attributes().getAttrInt("feature_width"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagradMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagradMomentum.java new file mode 100644 index 00000000000..d65be317989 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdagradMomentum.java @@ -0,0 +1,216 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseCoreAdagradMomentum operation + */ +@OpMetadata( + opType = XlaSparseCoreAdagradMomentum.OP_NAME, + inputsClass = XlaSparseCoreAdagradMomentum.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseCoreAdagradMomentum extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseCoreAdagradMomentum"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedMomentum; + + public XlaSparseCoreAdagradMomentum(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedMomentum = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseCoreAdagradMomentum operation. + * + * @param scope current scope + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param beta1 The beta1 value + * @param epsilon The epsilon value + * @param accumulator The accumulator value + * @param momentum The momentum value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @param useNesterov The value of the useNesterov attribute + * @param beta2 The value of the beta2 attribute + * @param exponent The value of the exponent attribute + * @return a new instance of XlaSparseCoreAdagradMomentum + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseCoreAdagradMomentum create(Scope scope, Operand indices, + Operand gradient, Operand learningRate, Operand beta1, + Operand epsilon, Operand accumulator, Operand momentum, + Operand embeddingTable, Long featureWidth, Boolean useNesterov, Float beta2, + Float exponent) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseCoreAdagradMomentum"); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(gradient.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(beta1.asOutput()); + opBuilder.addInput(epsilon.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(momentum.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("use_nesterov", useNesterov); + opBuilder.setAttr("beta_2", beta2); + opBuilder.setAttr("exponent", exponent); + return new XlaSparseCoreAdagradMomentum(opBuilder.build()); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedMomentum. + * + * @return updatedMomentum. + */ + public Output updatedMomentum() { + return updatedMomentum; + } + + @OpInputsMetadata( + outputsClass = XlaSparseCoreAdagradMomentum.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The gradient input + */ + public final Operand gradient; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The beta1 input + */ + public final Operand beta1; + + /** + * The epsilon input + */ + public final Operand epsilon; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The useNesterov attribute + */ + public final boolean useNesterov; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The exponent attribute + */ + public final float exponent; + + public Inputs(GraphOperation op) { + super(new XlaSparseCoreAdagradMomentum(op), op, Arrays.asList("feature_width", "use_nesterov", "beta_2", "exponent")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + featureWidth = op.attributes().getAttrInt("feature_width"); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + beta2 = op.attributes().getAttrFloat("beta_2"); + exponent = op.attributes().getAttrFloat("exponent"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdam.java new file mode 100644 index 00000000000..8ec32200fad --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreAdam.java @@ -0,0 +1,208 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseCoreAdam operation + */ +@OpMetadata( + opType = XlaSparseCoreAdam.OP_NAME, + inputsClass = XlaSparseCoreAdam.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseCoreAdam extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseCoreAdam"; + + private Output updatedEmbeddingTable; + + private Output updatedVelocity; + + private Output updatedMomentum; + + public XlaSparseCoreAdam(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedVelocity = operation.output(outputIdx++); + updatedMomentum = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseCoreAdam operation. + * + * @param scope current scope + * @param embeddingTable The embeddingTable value + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param momentum The momentum value + * @param velocity The velocity value + * @param beta1 The beta1 value + * @param beta2 The beta2 value + * @param epsilon The epsilon value + * @param featureWidth The value of the featureWidth attribute + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @return a new instance of XlaSparseCoreAdam + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseCoreAdam create(Scope scope, Operand embeddingTable, + Operand indices, Operand gradient, Operand learningRate, + Operand momentum, Operand velocity, Operand beta1, + Operand beta2, Operand epsilon, Long featureWidth, + Boolean useSumInsideSqrt) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseCoreAdam"); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(gradient.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(momentum.asOutput()); + opBuilder.addInput(velocity.asOutput()); + opBuilder.addInput(beta1.asOutput()); + opBuilder.addInput(beta2.asOutput()); + opBuilder.addInput(epsilon.asOutput()); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("use_sum_inside_sqrt", useSumInsideSqrt); + return new XlaSparseCoreAdam(opBuilder.build()); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedVelocity. + * + * @return updatedVelocity. + */ + public Output updatedVelocity() { + return updatedVelocity; + } + + /** + * Gets updatedMomentum. + * + * @return updatedMomentum. + */ + public Output updatedMomentum() { + return updatedMomentum; + } + + @OpInputsMetadata( + outputsClass = XlaSparseCoreAdam.class + ) + public static class Inputs extends RawOpInputs { + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The gradient input + */ + public final Operand gradient; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The momentum input + */ + public final Operand momentum; + + /** + * The velocity input + */ + public final Operand velocity; + + /** + * The beta1 input + */ + public final Operand beta1; + + /** + * The beta2 input + */ + public final Operand beta2; + + /** + * The epsilon input + */ + public final Operand epsilon; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The useSumInsideSqrt attribute + */ + public final boolean useSumInsideSqrt; + + public Inputs(GraphOperation op) { + super(new XlaSparseCoreAdam(op), op, Arrays.asList("feature_width", "use_sum_inside_sqrt")); + int inputIndex = 0; + embeddingTable = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + momentum = (Operand) op.input(inputIndex++); + velocity = (Operand) op.input(inputIndex++); + beta1 = (Operand) op.input(inputIndex++); + beta2 = (Operand) op.input(inputIndex++); + epsilon = (Operand) op.input(inputIndex++); + featureWidth = op.attributes().getAttrInt("feature_width"); + useSumInsideSqrt = op.attributes().getAttrBool("use_sum_inside_sqrt"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreFtrl.java new file mode 100644 index 00000000000..5ab961123b4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreFtrl.java @@ -0,0 +1,216 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseCoreFtrl operation + */ +@OpMetadata( + opType = XlaSparseCoreFtrl.OP_NAME, + inputsClass = XlaSparseCoreFtrl.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseCoreFtrl extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseCoreFtrl"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedLinear; + + public XlaSparseCoreFtrl(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedLinear = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseCoreFtrl operation. + * + * @param scope current scope + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param learningRate The learningRate value + * @param indices The indices value + * @param gradient The gradient value + * @param beta The beta value + * @param learningRatePower The learningRatePower value + * @param l2RegularizationStrength The l2RegularizationStrength value + * @param featureWidth The value of the featureWidth attribute + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @return a new instance of XlaSparseCoreFtrl + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseCoreFtrl create(Scope scope, Operand embeddingTable, + Operand accumulator, Operand linear, Operand learningRate, + Operand indices, Operand gradient, Operand beta, + Operand learningRatePower, Operand l2RegularizationStrength, + Long featureWidth, Boolean multiplyLinearByLearningRate, Float l1RegularizationStrength) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseCoreFtrl"); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(linear.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(gradient.asOutput()); + opBuilder.addInput(beta.asOutput()); + opBuilder.addInput(learningRatePower.asOutput()); + opBuilder.addInput(l2RegularizationStrength.asOutput()); + opBuilder.setAttr("feature_width", featureWidth); + opBuilder.setAttr("multiply_linear_by_learning_rate", multiplyLinearByLearningRate); + opBuilder.setAttr("l1_regularization_strength", l1RegularizationStrength); + return new XlaSparseCoreFtrl(opBuilder.build()); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedLinear. + * + * @return updatedLinear. + */ + public Output updatedLinear() { + return updatedLinear; + } + + @OpInputsMetadata( + outputsClass = XlaSparseCoreFtrl.class + ) + public static class Inputs extends RawOpInputs { + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The linear input + */ + public final Operand linear; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The indices input + */ + public final Operand indices; + + /** + * The gradient input + */ + public final Operand gradient; + + /** + * The beta input + */ + public final Operand beta; + + /** + * The learningRatePower input + */ + public final Operand learningRatePower; + + /** + * The l2RegularizationStrength input + */ + public final Operand l2RegularizationStrength; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + /** + * The multiplyLinearByLearningRate attribute + */ + public final boolean multiplyLinearByLearningRate; + + /** + * The l1RegularizationStrength attribute + */ + public final float l1RegularizationStrength; + + public Inputs(GraphOperation op) { + super(new XlaSparseCoreFtrl(op), op, Arrays.asList("feature_width", "multiply_linear_by_learning_rate", "l1_regularization_strength")); + int inputIndex = 0; + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + indices = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + beta = (Operand) op.input(inputIndex++); + learningRatePower = (Operand) op.input(inputIndex++); + l2RegularizationStrength = (Operand) op.input(inputIndex++); + featureWidth = op.attributes().getAttrInt("feature_width"); + multiplyLinearByLearningRate = op.attributes().getAttrBool("multiply_linear_by_learning_rate"); + l1RegularizationStrength = op.attributes().getAttrFloat("l1_regularization_strength"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreSgd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreSgd.java new file mode 100644 index 00000000000..70830868226 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseCoreSgd.java @@ -0,0 +1,139 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseCoreSgd operation + */ +@OpMetadata( + opType = XlaSparseCoreSgd.OP_NAME, + inputsClass = XlaSparseCoreSgd.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseCoreSgd extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseCoreSgd"; + + private Output updatedEmbeddingTable; + + public XlaSparseCoreSgd(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseCoreSgd operation. + * + * @param scope current scope + * @param indices The indices value + * @param gradient The gradient value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param featureWidth The value of the featureWidth attribute + * @return a new instance of XlaSparseCoreSgd + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseCoreSgd create(Scope scope, Operand indices, + Operand gradient, Operand learningRate, Operand embeddingTable, + Long featureWidth) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseCoreSgd"); + opBuilder.addInput(indices.asOutput()); + opBuilder.addInput(gradient.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.setAttr("feature_width", featureWidth); + return new XlaSparseCoreSgd(opBuilder.build()); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + @Override + public Output asOutput() { + return updatedEmbeddingTable; + } + + @OpInputsMetadata( + outputsClass = XlaSparseCoreSgd.class + ) + public static class Inputs extends RawOpInputs { + /** + * The indices input + */ + public final Operand indices; + + /** + * The gradient input + */ + public final Operand gradient; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The featureWidth attribute + */ + public final long featureWidth; + + public Inputs(GraphOperation op) { + super(new XlaSparseCoreSgd(op), op, Arrays.asList("feature_width")); + int inputIndex = 0; + indices = (Operand) op.input(inputIndex++); + gradient = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + featureWidth = op.attributes().getAttrInt("feature_width"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmul.java new file mode 100644 index 00000000000..0d3fab06b13 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmul.java @@ -0,0 +1,208 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; + +/** + * The XlaSparseDenseMatmul operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmul.OP_NAME, + inputsClass = XlaSparseDenseMatmul.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmul extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmul"; + + private Output activations; + + private Output rowPointers; + + private Output sortedEmbeddingIds; + + private Output sortedSampleIds; + + private Output sortedGains; + + public XlaSparseDenseMatmul(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + rowPointers = operation.output(outputIdx++); + sortedEmbeddingIds = operation.output(outputIdx++); + sortedSampleIds = operation.output(outputIdx++); + sortedGains = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmul operation. + * + * @param scope current scope + * @param rowIds The rowIds value + * @param colIds The colIds value + * @param values The values value + * @param offsets The offsets value + * @param embeddingTable The embeddingTable value + * @param maxIdsPerPartition The value of the maxIdsPerPartition attribute + * @param maxUniqueIdsPerPartition The value of the maxUniqueIdsPerPartition attribute + * @param inputSize The value of the inputSize attribute + * @return a new instance of XlaSparseDenseMatmul + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmul create(Scope scope, Operand rowIds, + Operand colIds, Operand values, Operand offsets, + Operand embeddingTable, Long maxIdsPerPartition, Long maxUniqueIdsPerPartition, + Long inputSize) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmul"); + opBuilder.addInput(rowIds.asOutput()); + opBuilder.addInput(colIds.asOutput()); + opBuilder.addInput(values.asOutput()); + opBuilder.addInput(offsets.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.setAttr("max_ids_per_partition", maxIdsPerPartition); + opBuilder.setAttr("max_unique_ids_per_partition", maxUniqueIdsPerPartition); + opBuilder.setAttr("input_size", inputSize); + return new XlaSparseDenseMatmul(opBuilder.build()); + } + + /** + * Gets activations. + * + * @return activations. + */ + public Output activations() { + return activations; + } + + /** + * Gets rowPointers. + * + * @return rowPointers. + */ + public Output rowPointers() { + return rowPointers; + } + + /** + * Gets sortedEmbeddingIds. + * + * @return sortedEmbeddingIds. + */ + public Output sortedEmbeddingIds() { + return sortedEmbeddingIds; + } + + /** + * Gets sortedSampleIds. + * + * @return sortedSampleIds. + */ + public Output sortedSampleIds() { + return sortedSampleIds; + } + + /** + * Gets sortedGains. + * + * @return sortedGains. + */ + public Output sortedGains() { + return sortedGains; + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmul.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowIds input + */ + public final Operand rowIds; + + /** + * The colIds input + */ + public final Operand colIds; + + /** + * The values input + */ + public final Operand values; + + /** + * The offsets input + */ + public final Operand offsets; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The maxIdsPerPartition attribute + */ + public final long maxIdsPerPartition; + + /** + * The maxUniqueIdsPerPartition attribute + */ + public final long maxUniqueIdsPerPartition; + + /** + * The inputSize attribute + */ + public final long inputSize; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmul(op), op, Arrays.asList("max_ids_per_partition", "max_unique_ids_per_partition", "input_size")); + int inputIndex = 0; + rowIds = (Operand) op.input(inputIndex++); + colIds = (Operand) op.input(inputIndex++); + values = (Operand) op.input(inputIndex++); + offsets = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + maxIdsPerPartition = op.attributes().getAttrInt("max_ids_per_partition"); + maxUniqueIdsPerPartition = op.attributes().getAttrInt("max_unique_ids_per_partition"); + inputSize = op.attributes().getAttrInt("input_size"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.java new file mode 100644 index 00000000000..0fd2a1347bc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.java @@ -0,0 +1,374 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedWeights; + + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradAndCsrInput(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.java new file mode 100644 index 00000000000..fd9039450b6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.java @@ -0,0 +1,437 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedMomenta; + + private Output updatedWeights; + + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput( + Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput create( + Scope scope, Operand rowPointers, Operand sortedSampleIds, + Operand sortedTokenIds, Operand sortedPosIds, Operand sortedGains, + Operand weights, Operand preservedValencies, + Operand preservedVectors, Operand preservedWeights, + Operand activationGradients, Operand learningRate, + Operand combinerWeightsLearningRate, Operand embeddingTable, + Operand accumulator, Operand momenta, Boolean useNesterov, Float exponent, + Float beta1, Float beta2, Float epsilon, Long maxValency, Long numWeights, + ConcreteFunction combinerTableVjpComputation, ConcreteFunction combinerWeightsVjpComputation, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.setAttr("use_nesterov", useNesterov); + opBuilder.setAttr("exponent", exponent); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The useNesterov attribute + */ + public final boolean useNesterov; + + /** + * The exponent attribute + */ + public final float exponent; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdagradMomentumAndCsrInput(op), op, Arrays.asList("use_nesterov", "exponent", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + exponent = op.attributes().getAttrFloat("exponent"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.java new file mode 100644 index 00000000000..2f8c1a3a7df --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.java @@ -0,0 +1,427 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedMomenta; + + private Output updatedVelocity; + + private Output updatedWeights; + + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + updatedVelocity = operation.output(outputIdx++); + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand momenta, Operand velocity, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.addInput(velocity.asOutput()); + opBuilder.setAttr("use_sum_inside_sqrt", useSumInsideSqrt); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Gets updatedVelocity. + * + * @return updatedVelocity. + */ + public Output updatedVelocity() { + return updatedVelocity; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The velocity input + */ + public final Operand velocity; + + /** + * The useSumInsideSqrt attribute + */ + public final boolean useSumInsideSqrt; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithAdamAndCsrInput(op), op, Arrays.asList("use_sum_inside_sqrt", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + velocity = (Operand) op.input(inputIndex++); + useSumInsideSqrt = op.attributes().getAttrBool("use_sum_inside_sqrt"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.java new file mode 100644 index 00000000000..b4bb94eb671 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.java @@ -0,0 +1,301 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput"; + + private List> updatedTables; + + private Output updatedWeights; + + @SuppressWarnings("unchecked") + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int updatedTablesLength = operation.outputListLength("updated_tables"); + updatedTables = Arrays.asList((Output[]) operation.outputList(outputIdx, updatedTablesLength)); + outputIdx += updatedTablesLength; + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param tables The tables value + * @param hyperparameters The hyperparameters value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param optimizerCustomComputation The value of the optimizerCustomComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Iterable> tables, Iterable> hyperparameters, + Operand combinerWeightsLearningRate, Long maxValency, Long numWeights, + ConcreteFunction combinerTableVjpComputation, ConcreteFunction combinerWeightsVjpComputation, + ConcreteFunction optimizerCustomComputation, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInputList(Operands.asOutputs(tables)); + opBuilder.addInputList(Operands.asOutputs(hyperparameters)); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("optimizer_custom_computation", optimizerCustomComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput(opBuilder.build()); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedTables. + * + * @return updatedTables. + */ + public List> updatedTables() { + return updatedTables; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput} + */ + public static class Options { + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The tables input + */ + public final Iterable> tables; + + /** + * The hyperparameters input + */ + public final Iterable> hyperparameters; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithCsrInput(op), op, Arrays.asList("max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + int tablesLength = op.inputListLength("tables"); + tables = Arrays.asList((Operand[]) op.inputList(inputIndex, tablesLength)); + inputIndex += tablesLength; + int hyperparametersLength = op.inputListLength("hyperparameters"); + hyperparameters = Arrays.asList((Operand[]) op.inputList(inputIndex, hyperparametersLength)); + inputIndex += hyperparametersLength; + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.java new file mode 100644 index 00000000000..f4230f5a56d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.java @@ -0,0 +1,436 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedLinear; + + private Output updatedWeights; + + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedLinear = operation.output(outputIdx++); + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Operand accumulator, Operand linear, + Boolean multiplyLinearByLearningRate, Float beta, Float learningRatePower, + Float l1RegularizationStrength, Float l2RegularizationStrength, Long maxValency, + Long numWeights, ConcreteFunction combinerTableVjpComputation, + ConcreteFunction combinerWeightsVjpComputation, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(linear.asOutput()); + opBuilder.setAttr("multiply_linear_by_learning_rate", multiplyLinearByLearningRate); + opBuilder.setAttr("beta", beta); + opBuilder.setAttr("learning_rate_power", learningRatePower); + opBuilder.setAttr("l1_regularization_strength", l1RegularizationStrength); + opBuilder.setAttr("l2_regularization_strength", l2RegularizationStrength); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedLinear. + * + * @return updatedLinear. + */ + public Output updatedLinear() { + return updatedLinear; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The linear input + */ + public final Operand linear; + + /** + * The multiplyLinearByLearningRate attribute + */ + public final boolean multiplyLinearByLearningRate; + + /** + * The beta attribute + */ + public final float beta; + + /** + * The learningRatePower attribute + */ + public final float learningRatePower; + + /** + * The l1RegularizationStrength attribute + */ + public final float l1RegularizationStrength; + + /** + * The l2RegularizationStrength attribute + */ + public final float l2RegularizationStrength; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithFtrlAndCsrInput(op), op, Arrays.asList("multiply_linear_by_learning_rate", "beta", "learning_rate_power", "l1_regularization_strength", "l2_regularization_strength", "clip_weight_min", "clip_weight_max", "max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + multiplyLinearByLearningRate = op.attributes().getAttrBool("multiply_linear_by_learning_rate"); + beta = op.attributes().getAttrFloat("beta"); + learningRatePower = op.attributes().getAttrFloat("learning_rate_power"); + l1RegularizationStrength = op.attributes().getAttrFloat("l1_regularization_strength"); + l2RegularizationStrength = op.attributes().getAttrFloat("l2_regularization_strength"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.java new file mode 100644 index 00000000000..1dfa617f3c9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.java @@ -0,0 +1,350 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.Inputs.class +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedWeights; + + public XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedWeights = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param weights The weights value + * @param preservedValencies The preservedValencies value + * @param preservedVectors The preservedVectors value + * @param preservedWeights The preservedWeights value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param combinerWeightsLearningRate The combinerWeightsLearningRate value + * @param embeddingTable The embeddingTable value + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerTableVjpComputation The value of the combinerTableVjpComputation attribute + * @param combinerWeightsVjpComputation The value of the combinerWeightsVjpComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand weights, + Operand preservedValencies, Operand preservedVectors, + Operand preservedWeights, Operand activationGradients, + Operand learningRate, Operand combinerWeightsLearningRate, + Operand embeddingTable, Long maxValency, Long numWeights, + ConcreteFunction combinerTableVjpComputation, ConcreteFunction combinerWeightsVjpComputation, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.addInput(preservedValencies.asOutput()); + opBuilder.addInput(preservedVectors.asOutput()); + opBuilder.addInput(preservedWeights.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(combinerWeightsLearningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_table_vjp_computation", combinerTableVjpComputation); + opBuilder.setAttr("combiner_weights_vjp_computation", combinerWeightsVjpComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedWeights. + * + * @return updatedWeights. + */ + public Output updatedWeights() { + return updatedWeights; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The preservedValencies input + */ + public final Operand preservedValencies; + + /** + * The preservedVectors input + */ + public final Operand preservedVectors; + + /** + * The preservedWeights input + */ + public final Operand preservedWeights; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The combinerWeightsLearningRate input + */ + public final Operand combinerWeightsLearningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcGradWithSgdAndCsrInput(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "max_valency", "num_weights", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + preservedValencies = (Operand) op.input(inputIndex++); + preservedVectors = (Operand) op.input(inputIndex++); + preservedWeights = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + combinerWeightsLearningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.java new file mode 100644 index 00000000000..37e9bbd0380 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.java @@ -0,0 +1,278 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.Inputs.class +) +public final class XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput"; + + private Output activations; + + private Output preservedValencies; + + private Output preservedVectors; + + public XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + preservedValencies = operation.output(outputIdx++); + preservedVectors = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedPosIds The sortedPosIds value + * @param sortedGains The sortedGains value + * @param embeddingTable The embeddingTable value + * @param weights The weights value + * @param inputSize The value of the inputSize attribute + * @param maxValency The value of the maxValency attribute + * @param numWeights The value of the numWeights attribute + * @param combinerComputation The value of the combinerComputation attribute + * @param quantizationConfigLow The value of the quantizationConfigLow attribute + * @param quantizationConfigHigh The value of the quantizationConfigHigh attribute + * @param quantizationConfigNumBuckets The value of the quantizationConfigNumBuckets attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedPosIds, Operand sortedGains, Operand embeddingTable, + Operand weights, Long inputSize, Long maxValency, Long numWeights, + ConcreteFunction combinerComputation, Float quantizationConfigLow, + Float quantizationConfigHigh, Long quantizationConfigNumBuckets, String tableName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedPosIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(weights.asOutput()); + opBuilder.setAttr("input_size", inputSize); + opBuilder.setAttr("max_valency", maxValency); + opBuilder.setAttr("num_weights", numWeights); + opBuilder.setAttr("combiner_computation", combinerComputation); + opBuilder.setAttr("quantization_config_low", quantizationConfigLow); + opBuilder.setAttr("quantization_config_high", quantizationConfigHigh); + opBuilder.setAttr("quantization_config_num_buckets", quantizationConfigNumBuckets); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput(opBuilder.build()); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets activations. + * + * @return activations. + */ + public Output activations() { + return activations; + } + + /** + * Gets preservedValencies. + * + * @return preservedValencies. + */ + public Output preservedValencies() { + return preservedValencies; + } + + /** + * Gets preservedVectors. + * + * @return preservedVectors. + */ + public Output preservedVectors() { + return preservedVectors; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput} + */ + public static class Options { + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedPosIds input + */ + public final Operand sortedPosIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The weights input + */ + public final Operand weights; + + /** + * The inputSize attribute + */ + public final long inputSize; + + /** + * The maxValency attribute + */ + public final long maxValency; + + /** + * The numWeights attribute + */ + public final long numWeights; + + /** + * The quantizationConfigLow attribute + */ + public final float quantizationConfigLow; + + /** + * The quantizationConfigHigh attribute + */ + public final float quantizationConfigHigh; + + /** + * The quantizationConfigNumBuckets attribute + */ + public final long quantizationConfigNumBuckets; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulCustomCombinerOnTcWithCsrInput(op), op, Arrays.asList("input_size", "max_valency", "num_weights", "quantization_config_low", "quantization_config_high", "quantization_config_num_buckets", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedPosIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + weights = (Operand) op.input(inputIndex++); + inputSize = op.attributes().getAttrInt("input_size"); + maxValency = op.attributes().getAttrInt("max_valency"); + numWeights = op.attributes().getAttrInt("num_weights"); + quantizationConfigLow = op.attributes().getAttrFloat("quantization_config_low"); + quantizationConfigHigh = op.attributes().getAttrFloat("quantization_config_high"); + quantizationConfigNumBuckets = op.attributes().getAttrInt("quantization_config_num_buckets"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndCsrInput.java new file mode 100644 index 00000000000..0f71b62bc15 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndCsrInput.java @@ -0,0 +1,298 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdagradAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdagradAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdagradAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulGradWithAdagradAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdagradAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + public XlaSparseDenseMatmulGradWithAdagradAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdagradAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdagradAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand numMinibatchesPerPhysicalSparseCore, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdagradAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdagradAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdagradAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdagradAndCsrInput(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.java new file mode 100644 index 00000000000..6a04212720a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.java @@ -0,0 +1,311 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + public XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand numMinibatchesPerPhysicalSparseCore, + Long maxIdsPerSparseCore, Long maxUniqueIdsPerSparseCore, String tableName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdagradAndStaticBufferSize(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.java new file mode 100644 index 00000000000..d9edff0a5ee --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.java @@ -0,0 +1,359 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedMomenta; + + public XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand momenta, + Operand numMinibatchesPerPhysicalSparseCore, Boolean useNesterov, Float exponent, + Float beta1, Float beta2, Float epsilon, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("use_nesterov", useNesterov); + opBuilder.setAttr("exponent", exponent); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The useNesterov attribute + */ + public final boolean useNesterov; + + /** + * The exponent attribute + */ + public final float exponent; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdagradMomentumAndCsrInput(op), op, Arrays.asList("use_nesterov", "exponent", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + exponent = op.attributes().getAttrFloat("exponent"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.java new file mode 100644 index 00000000000..285b2c84a1f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.java @@ -0,0 +1,372 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedMomenta; + + public XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param momenta The momenta value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useNesterov The value of the useNesterov attribute + * @param exponent The value of the exponent attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand momenta, + Operand numMinibatchesPerPhysicalSparseCore, Boolean useNesterov, Float exponent, + Float beta1, Float beta2, Float epsilon, Long maxIdsPerSparseCore, + Long maxUniqueIdsPerSparseCore, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("use_nesterov", useNesterov); + opBuilder.setAttr("exponent", exponent); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The useNesterov attribute + */ + public final boolean useNesterov; + + /** + * The exponent attribute + */ + public final float exponent; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdagradMomentumAndStaticBufferSize(op), op, Arrays.asList("use_nesterov", "exponent", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + useNesterov = op.attributes().getAttrBool("use_nesterov"); + exponent = op.attributes().getAttrFloat("exponent"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndCsrInput.java new file mode 100644 index 00000000000..d7a5b8e6765 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndCsrInput.java @@ -0,0 +1,351 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdamAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdamAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdamAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulGradWithAdamAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdamAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedMomenta; + + private Output updatedVelocity; + + public XlaSparseDenseMatmulGradWithAdamAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + updatedVelocity = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdamAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdamAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdamAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, Operand momenta, + Operand velocity, Operand numMinibatchesPerPhysicalSparseCore, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, String tableName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdamAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.addInput(velocity.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("use_sum_inside_sqrt", useSumInsideSqrt); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdamAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Gets updatedVelocity. + * + * @return updatedVelocity. + */ + public Output updatedVelocity() { + return updatedVelocity; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdamAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdamAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The velocity input + */ + public final Operand velocity; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The useSumInsideSqrt attribute + */ + public final boolean useSumInsideSqrt; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdamAndCsrInput(op), op, Arrays.asList("use_sum_inside_sqrt", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + velocity = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + useSumInsideSqrt = op.attributes().getAttrBool("use_sum_inside_sqrt"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.java new file mode 100644 index 00000000000..8f4ada3dd4a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.java @@ -0,0 +1,363 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize"; + + private Output updatedEmbeddingTable; + + private Output updatedMomenta; + + private Output updatedVelocity; + + public XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedMomenta = operation.output(outputIdx++); + updatedVelocity = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param momenta The momenta value + * @param velocity The velocity value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param useSumInsideSqrt The value of the useSumInsideSqrt attribute + * @param beta1 The value of the beta1 attribute + * @param beta2 The value of the beta2 attribute + * @param epsilon The value of the epsilon attribute + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, Operand momenta, + Operand velocity, Operand numMinibatchesPerPhysicalSparseCore, + Boolean useSumInsideSqrt, Float beta1, Float beta2, Float epsilon, Long maxIdsPerSparseCore, + Long maxUniqueIdsPerSparseCore, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(momenta.asOutput()); + opBuilder.addInput(velocity.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("use_sum_inside_sqrt", useSumInsideSqrt); + opBuilder.setAttr("beta1", beta1); + opBuilder.setAttr("beta2", beta2); + opBuilder.setAttr("epsilon", epsilon); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedMomenta. + * + * @return updatedMomenta. + */ + public Output updatedMomenta() { + return updatedMomenta; + } + + /** + * Gets updatedVelocity. + * + * @return updatedVelocity. + */ + public Output updatedVelocity() { + return updatedVelocity; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The momenta input + */ + public final Operand momenta; + + /** + * The velocity input + */ + public final Operand velocity; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The useSumInsideSqrt attribute + */ + public final boolean useSumInsideSqrt; + + /** + * The beta1 attribute + */ + public final float beta1; + + /** + * The beta2 attribute + */ + public final float beta2; + + /** + * The epsilon attribute + */ + public final float epsilon; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithAdamAndStaticBufferSize(op), op, Arrays.asList("use_sum_inside_sqrt", "beta1", "beta2", "epsilon", "clip_weight_min", "clip_weight_max", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + momenta = (Operand) op.input(inputIndex++); + velocity = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + useSumInsideSqrt = op.attributes().getAttrBool("use_sum_inside_sqrt"); + beta1 = op.attributes().getAttrFloat("beta1"); + beta2 = op.attributes().getAttrFloat("beta2"); + epsilon = op.attributes().getAttrFloat("epsilon"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithCsrInput.java new file mode 100644 index 00000000000..0af99ae8dbf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithCsrInput.java @@ -0,0 +1,238 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * The XlaSparseDenseMatmulGradWithCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithCsrInput.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithCsrInput extends RawOp implements Iterable> { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithCsrInput"; + + private List> updatedTables; + + @SuppressWarnings("unchecked") + public XlaSparseDenseMatmulGradWithCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + int updatedTablesLength = operation.outputListLength("updated_tables"); + updatedTables = Arrays.asList((Output[]) operation.outputList(outputIdx, updatedTablesLength)); + outputIdx += updatedTablesLength; + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param tables The tables value + * @param hyperparameters The hyperparameters value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param customComputation The value of the customComputation attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @param data type for {@code XlaSparseDenseMatmulGradWithCsrInput} output and operands + * @return a new instance of XlaSparseDenseMatmulGradWithCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Iterable> tables, Iterable> hyperparameters, + Operand numMinibatchesPerPhysicalSparseCore, ConcreteFunction customComputation, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInputList(Operands.asOutputs(tables)); + opBuilder.addInputList(Operands.asOutputs(hyperparameters)); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("custom_computation", customComputation); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithCsrInput<>(opBuilder.build()); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedTables. + * + * @return updatedTables. + */ + public List> updatedTables() { + return updatedTables; + } + + @Override + @SuppressWarnings({"rawtypes", "unchecked"}) + public Iterator> iterator() { + return (Iterator) updatedTables.iterator(); + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithCsrInput} + */ + public static class Options { + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithCsrInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The tables input + */ + public final Iterable> tables; + + /** + * The hyperparameters input + */ + public final Iterable> hyperparameters; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithCsrInput<>(op), op, Arrays.asList("table_name", "num_sparsecores_per_device", "T")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + int tablesLength = op.inputListLength("tables"); + tables = Arrays.asList((Operand[]) op.inputList(inputIndex, tablesLength)); + inputIndex += tablesLength; + int hyperparametersLength = op.inputListLength("hyperparameters"); + hyperparameters = Arrays.asList((Operand[]) op.inputList(inputIndex, hyperparametersLength)); + inputIndex += hyperparametersLength; + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndCsrInput.java new file mode 100644 index 00000000000..6dabad2682d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndCsrInput.java @@ -0,0 +1,360 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithFtrlAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithFtrlAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithFtrlAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulGradWithFtrlAndCsrInput extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithFtrlAndCsrInput"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedLinear; + + public XlaSparseDenseMatmulGradWithFtrlAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedLinear = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithFtrlAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithFtrlAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithFtrlAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand linear, + Operand numMinibatchesPerPhysicalSparseCore, Boolean multiplyLinearByLearningRate, + Float beta, Float learningRatePower, Float l1RegularizationStrength, + Float l2RegularizationStrength, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithFtrlAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(linear.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("multiply_linear_by_learning_rate", multiplyLinearByLearningRate); + opBuilder.setAttr("beta", beta); + opBuilder.setAttr("learning_rate_power", learningRatePower); + opBuilder.setAttr("l1_regularization_strength", l1RegularizationStrength); + opBuilder.setAttr("l2_regularization_strength", l2RegularizationStrength); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithFtrlAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedLinear. + * + * @return updatedLinear. + */ + public Output updatedLinear() { + return updatedLinear; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithFtrlAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithFtrlAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The linear input + */ + public final Operand linear; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The multiplyLinearByLearningRate attribute + */ + public final boolean multiplyLinearByLearningRate; + + /** + * The beta attribute + */ + public final float beta; + + /** + * The learningRatePower attribute + */ + public final float learningRatePower; + + /** + * The l1RegularizationStrength attribute + */ + public final float l1RegularizationStrength; + + /** + * The l2RegularizationStrength attribute + */ + public final float l2RegularizationStrength; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithFtrlAndCsrInput(op), op, Arrays.asList("multiply_linear_by_learning_rate", "beta", "learning_rate_power", "l1_regularization_strength", "l2_regularization_strength", "clip_weight_min", "clip_weight_max", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + multiplyLinearByLearningRate = op.attributes().getAttrBool("multiply_linear_by_learning_rate"); + beta = op.attributes().getAttrFloat("beta"); + learningRatePower = op.attributes().getAttrFloat("learning_rate_power"); + l1RegularizationStrength = op.attributes().getAttrFloat("l1_regularization_strength"); + l2RegularizationStrength = op.attributes().getAttrFloat("l2_regularization_strength"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.java new file mode 100644 index 00000000000..604416fd7d3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.java @@ -0,0 +1,373 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize"; + + private Output updatedEmbeddingTable; + + private Output updatedAccumulator; + + private Output updatedLinear; + + public XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + updatedAccumulator = operation.output(outputIdx++); + updatedLinear = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param accumulator The accumulator value + * @param linear The linear value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param multiplyLinearByLearningRate The value of the multiplyLinearByLearningRate attribute + * @param beta The value of the beta attribute + * @param learningRatePower The value of the learningRatePower attribute + * @param l1RegularizationStrength The value of the l1RegularizationStrength attribute + * @param l2RegularizationStrength The value of the l2RegularizationStrength attribute + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand accumulator, Operand linear, + Operand numMinibatchesPerPhysicalSparseCore, Boolean multiplyLinearByLearningRate, + Float beta, Float learningRatePower, Float l1RegularizationStrength, + Float l2RegularizationStrength, Long maxIdsPerSparseCore, Long maxUniqueIdsPerSparseCore, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(accumulator.asOutput()); + opBuilder.addInput(linear.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("multiply_linear_by_learning_rate", multiplyLinearByLearningRate); + opBuilder.setAttr("beta", beta); + opBuilder.setAttr("learning_rate_power", learningRatePower); + opBuilder.setAttr("l1_regularization_strength", l1RegularizationStrength); + opBuilder.setAttr("l2_regularization_strength", l2RegularizationStrength); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + /** + * Gets updatedAccumulator. + * + * @return updatedAccumulator. + */ + public Output updatedAccumulator() { + return updatedAccumulator; + } + + /** + * Gets updatedLinear. + * + * @return updatedLinear. + */ + public Output updatedLinear() { + return updatedLinear; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The accumulator input + */ + public final Operand accumulator; + + /** + * The linear input + */ + public final Operand linear; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The multiplyLinearByLearningRate attribute + */ + public final boolean multiplyLinearByLearningRate; + + /** + * The beta attribute + */ + public final float beta; + + /** + * The learningRatePower attribute + */ + public final float learningRatePower; + + /** + * The l1RegularizationStrength attribute + */ + public final float l1RegularizationStrength; + + /** + * The l2RegularizationStrength attribute + */ + public final float l2RegularizationStrength; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithFtrlAndStaticBufferSize(op), op, Arrays.asList("multiply_linear_by_learning_rate", "beta", "learning_rate_power", "l1_regularization_strength", "l2_regularization_strength", "clip_weight_min", "clip_weight_max", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + accumulator = (Operand) op.input(inputIndex++); + linear = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + multiplyLinearByLearningRate = op.attributes().getAttrBool("multiply_linear_by_learning_rate"); + beta = op.attributes().getAttrFloat("beta"); + learningRatePower = op.attributes().getAttrFloat("learning_rate_power"); + l1RegularizationStrength = op.attributes().getAttrFloat("l1_regularization_strength"); + l2RegularizationStrength = op.attributes().getAttrFloat("l2_regularization_strength"); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndCsrInput.java new file mode 100644 index 00000000000..5fdfa0a487d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndCsrInput.java @@ -0,0 +1,282 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithSgdAndCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithSgdAndCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithSgdAndCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulGradWithSgdAndCsrInput extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithSgdAndCsrInput"; + + private Output updatedEmbeddingTable; + + public XlaSparseDenseMatmulGradWithSgdAndCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithSgdAndCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithSgdAndCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithSgdAndCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithSgdAndCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithSgdAndCsrInput(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + @Override + public Output asOutput() { + return updatedEmbeddingTable; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithSgdAndCsrInput} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithSgdAndCsrInput.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithSgdAndCsrInput(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.java new file mode 100644 index 00000000000..5dadd3fdca1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.java @@ -0,0 +1,295 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize"; + + private Output updatedEmbeddingTable; + + public XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + updatedEmbeddingTable = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param activationGradients The activationGradients value + * @param learningRate The learningRate value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand activationGradients, + Operand learningRate, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, Long maxIdsPerSparseCore, + Long maxUniqueIdsPerSparseCore, String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(activationGradients.asOutput()); + opBuilder.addInput(learningRate.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.clipWeightMin != null) { + opBuilder.setAttr("clip_weight_min", opts.clipWeightMin); + } + if (opts.clipWeightMax != null) { + opBuilder.setAttr("clip_weight_max", opts.clipWeightMax); + } + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public static Options clipWeightMin(Float clipWeightMin) { + return new Options().clipWeightMin(clipWeightMin); + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public static Options clipWeightMax(Float clipWeightMax) { + return new Options().clipWeightMax(clipWeightMax); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets updatedEmbeddingTable. + * + * @return updatedEmbeddingTable. + */ + public Output updatedEmbeddingTable() { + return updatedEmbeddingTable; + } + + @Override + public Output asOutput() { + return updatedEmbeddingTable; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize} + */ + public static class Options { + private Float clipWeightMin; + + private Float clipWeightMax; + + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the clipWeightMin option. + * + * @param clipWeightMin the clipWeightMin option + * @return this Options instance. + */ + public Options clipWeightMin(Float clipWeightMin) { + this.clipWeightMin = clipWeightMin; + return this; + } + + /** + * Sets the clipWeightMax option. + * + * @param clipWeightMax the clipWeightMax option + * @return this Options instance. + */ + public Options clipWeightMax(Float clipWeightMax) { + this.clipWeightMax = clipWeightMax; + return this; + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The activationGradients input + */ + public final Operand activationGradients; + + /** + * The learningRate input + */ + public final Operand learningRate; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The clipWeightMin attribute + */ + public final float clipWeightMin; + + /** + * The clipWeightMax attribute + */ + public final float clipWeightMax; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulGradWithSgdAndStaticBufferSize(op), op, Arrays.asList("clip_weight_min", "clip_weight_max", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + activationGradients = (Operand) op.input(inputIndex++); + learningRate = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + clipWeightMin = op.attributes().getAttrFloat("clip_weight_min"); + clipWeightMax = op.attributes().getAttrFloat("clip_weight_max"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithCsrInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithCsrInput.java new file mode 100644 index 00000000000..a4893b0196c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithCsrInput.java @@ -0,0 +1,244 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; + +/** + * The XlaSparseDenseMatmulWithCsrInput operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulWithCsrInput.OP_NAME, + inputsClass = XlaSparseDenseMatmulWithCsrInput.Inputs.class +) +@Operator( + group = "xla" +) +public final class XlaSparseDenseMatmulWithCsrInput extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulWithCsrInput"; + + private Output activations; + + public XlaSparseDenseMatmulWithCsrInput(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulWithCsrInput operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param inputSize The value of the inputSize attribute + * @param quantizationConfigLow The value of the quantizationConfigLow attribute + * @param quantizationConfigHigh The value of the quantizationConfigHigh attribute + * @param quantizationConfigNumBuckets The value of the quantizationConfigNumBuckets attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @param data type for {@code XlaSparseDenseMatmulWithCsrInput} output and operands + * @return a new instance of XlaSparseDenseMatmulWithCsrInput + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulWithCsrInput create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, Long inputSize, + Float quantizationConfigLow, Float quantizationConfigHigh, Long quantizationConfigNumBuckets, + String tableName, Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulWithCsrInput"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("input_size", inputSize); + opBuilder.setAttr("quantization_config_low", quantizationConfigLow); + opBuilder.setAttr("quantization_config_high", quantizationConfigHigh); + opBuilder.setAttr("quantization_config_num_buckets", quantizationConfigNumBuckets); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulWithCsrInput<>(opBuilder.build()); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets activations. + * + * @return activations. + */ + public Output activations() { + return activations; + } + + @Override + public Output asOutput() { + return activations; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulWithCsrInput} + */ + public static class Options { + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulWithCsrInput.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The inputSize attribute + */ + public final long inputSize; + + /** + * The quantizationConfigLow attribute + */ + public final float quantizationConfigLow; + + /** + * The quantizationConfigHigh attribute + */ + public final float quantizationConfigHigh; + + /** + * The quantizationConfigNumBuckets attribute + */ + public final long quantizationConfigNumBuckets; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + /** + * The T attribute + */ + public final DataType T; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulWithCsrInput<>(op), op, Arrays.asList("input_size", "quantization_config_low", "quantization_config_high", "quantization_config_num_buckets", "table_name", "num_sparsecores_per_device", "T")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + inputSize = op.attributes().getAttrInt("input_size"); + quantizationConfigLow = op.attributes().getAttrFloat("quantization_config_low"); + quantizationConfigHigh = op.attributes().getAttrFloat("quantization_config_high"); + quantizationConfigNumBuckets = op.attributes().getAttrInt("quantization_config_num_buckets"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + T = op.attributes().getAttrType("T"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithStaticBufferSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithStaticBufferSize.java new file mode 100644 index 00000000000..d164df81749 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseDenseMatmulWithStaticBufferSize.java @@ -0,0 +1,248 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +/** + * The XlaSparseDenseMatmulWithStaticBufferSize operation + */ +@OpMetadata( + opType = XlaSparseDenseMatmulWithStaticBufferSize.OP_NAME, + inputsClass = XlaSparseDenseMatmulWithStaticBufferSize.Inputs.class +) +public final class XlaSparseDenseMatmulWithStaticBufferSize extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseDenseMatmulWithStaticBufferSize"; + + private Output activations; + + public XlaSparseDenseMatmulWithStaticBufferSize(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseDenseMatmulWithStaticBufferSize operation. + * + * @param scope current scope + * @param rowPointers The rowPointers value + * @param sortedSampleIds The sortedSampleIds value + * @param sortedTokenIds The sortedTokenIds value + * @param sortedGains The sortedGains value + * @param embeddingTable The embeddingTable value + * @param numMinibatchesPerPhysicalSparseCore The numMinibatchesPerPhysicalSparseCore value + * @param inputSize The value of the inputSize attribute + * @param quantizationConfigLow The value of the quantizationConfigLow attribute + * @param quantizationConfigHigh The value of the quantizationConfigHigh attribute + * @param quantizationConfigNumBuckets The value of the quantizationConfigNumBuckets attribute + * @param maxIdsPerSparseCore The value of the maxIdsPerSparseCore attribute + * @param maxUniqueIdsPerSparseCore The value of the maxUniqueIdsPerSparseCore attribute + * @param tableName The value of the tableName attribute + * @param options carries optional attribute values + * @return a new instance of XlaSparseDenseMatmulWithStaticBufferSize + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseDenseMatmulWithStaticBufferSize create(Scope scope, + Operand rowPointers, Operand sortedSampleIds, Operand sortedTokenIds, + Operand sortedGains, Operand embeddingTable, + Operand numMinibatchesPerPhysicalSparseCore, Long inputSize, + Float quantizationConfigLow, Float quantizationConfigHigh, Long quantizationConfigNumBuckets, + Long maxIdsPerSparseCore, Long maxUniqueIdsPerSparseCore, String tableName, + Options... options) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseDenseMatmulWithStaticBufferSize"); + opBuilder.addInput(rowPointers.asOutput()); + opBuilder.addInput(sortedSampleIds.asOutput()); + opBuilder.addInput(sortedTokenIds.asOutput()); + opBuilder.addInput(sortedGains.asOutput()); + opBuilder.addInput(embeddingTable.asOutput()); + opBuilder.addInput(numMinibatchesPerPhysicalSparseCore.asOutput()); + opBuilder.setAttr("input_size", inputSize); + opBuilder.setAttr("quantization_config_low", quantizationConfigLow); + opBuilder.setAttr("quantization_config_high", quantizationConfigHigh); + opBuilder.setAttr("quantization_config_num_buckets", quantizationConfigNumBuckets); + opBuilder.setAttr("max_ids_per_sparse_core", maxIdsPerSparseCore); + opBuilder.setAttr("max_unique_ids_per_sparse_core", maxUniqueIdsPerSparseCore); + opBuilder.setAttr("table_name", tableName); + if (options != null) { + for (Options opts : options) { + if (opts.numSparsecoresPerDevice != null) { + opBuilder.setAttr("num_sparsecores_per_device", opts.numSparsecoresPerDevice); + } + } + } + return new XlaSparseDenseMatmulWithStaticBufferSize(opBuilder.build()); + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public static Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + return new Options().numSparsecoresPerDevice(numSparsecoresPerDevice); + } + + /** + * Gets activations. + * + * @return activations. + */ + public Output activations() { + return activations; + } + + @Override + public Output asOutput() { + return activations; + } + + /** + * Optional attributes for {@link org.tensorflow.op.xla.XlaSparseDenseMatmulWithStaticBufferSize} + */ + public static class Options { + private Long numSparsecoresPerDevice; + + private Options() { + } + + /** + * Sets the numSparsecoresPerDevice option. + * + * @param numSparsecoresPerDevice the numSparsecoresPerDevice option + * @return this Options instance. + */ + public Options numSparsecoresPerDevice(Long numSparsecoresPerDevice) { + this.numSparsecoresPerDevice = numSparsecoresPerDevice; + return this; + } + } + + @OpInputsMetadata( + outputsClass = XlaSparseDenseMatmulWithStaticBufferSize.class + ) + public static class Inputs extends RawOpInputs { + /** + * The rowPointers input + */ + public final Operand rowPointers; + + /** + * The sortedSampleIds input + */ + public final Operand sortedSampleIds; + + /** + * The sortedTokenIds input + */ + public final Operand sortedTokenIds; + + /** + * The sortedGains input + */ + public final Operand sortedGains; + + /** + * The embeddingTable input + */ + public final Operand embeddingTable; + + /** + * The numMinibatchesPerPhysicalSparseCore input + */ + public final Operand numMinibatchesPerPhysicalSparseCore; + + /** + * The inputSize attribute + */ + public final long inputSize; + + /** + * The quantizationConfigLow attribute + */ + public final float quantizationConfigLow; + + /** + * The quantizationConfigHigh attribute + */ + public final float quantizationConfigHigh; + + /** + * The quantizationConfigNumBuckets attribute + */ + public final long quantizationConfigNumBuckets; + + /** + * The maxIdsPerSparseCore attribute + */ + public final long maxIdsPerSparseCore; + + /** + * The maxUniqueIdsPerSparseCore attribute + */ + public final long maxUniqueIdsPerSparseCore; + + /** + * The tableName attribute + */ + public final String tableName; + + /** + * The numSparsecoresPerDevice attribute + */ + public final long numSparsecoresPerDevice; + + public Inputs(GraphOperation op) { + super(new XlaSparseDenseMatmulWithStaticBufferSize(op), op, Arrays.asList("input_size", "quantization_config_low", "quantization_config_high", "quantization_config_num_buckets", "max_ids_per_sparse_core", "max_unique_ids_per_sparse_core", "table_name", "num_sparsecores_per_device")); + int inputIndex = 0; + rowPointers = (Operand) op.input(inputIndex++); + sortedSampleIds = (Operand) op.input(inputIndex++); + sortedTokenIds = (Operand) op.input(inputIndex++); + sortedGains = (Operand) op.input(inputIndex++); + embeddingTable = (Operand) op.input(inputIndex++); + numMinibatchesPerPhysicalSparseCore = (Operand) op.input(inputIndex++); + inputSize = op.attributes().getAttrInt("input_size"); + quantizationConfigLow = op.attributes().getAttrFloat("quantization_config_low"); + quantizationConfigHigh = op.attributes().getAttrFloat("quantization_config_high"); + quantizationConfigNumBuckets = op.attributes().getAttrInt("quantization_config_num_buckets"); + maxIdsPerSparseCore = op.attributes().getAttrInt("max_ids_per_sparse_core"); + maxUniqueIdsPerSparseCore = op.attributes().getAttrInt("max_unique_ids_per_sparse_core"); + tableName = op.attributes().getAttrString("table_name"); + numSparsecoresPerDevice = op.attributes().getAttrInt("num_sparsecores_per_device"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseGradientsStack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseGradientsStack.java new file mode 100644 index 00000000000..5042befbc66 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSparseGradientsStack.java @@ -0,0 +1,128 @@ +/* Copyright 2018-2023 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 java.util.Arrays; +import org.tensorflow.GraphOperation; +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.RawOpInputs; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.family.TType; + +/** + * The XlaSparseGradientsStack operation + */ +@OpMetadata( + opType = XlaSparseGradientsStack.OP_NAME, + inputsClass = XlaSparseGradientsStack.Inputs.class +) +public final class XlaSparseGradientsStack extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSparseGradientsStack"; + + private Output stackedGradients; + + public XlaSparseGradientsStack(Operation operation) { + super(operation, OP_NAME); + int outputIdx = 0; + stackedGradients = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSparseGradientsStack operation. + * + * @param scope current scope + * @param unstackedGradients The unstackedGradients value + * @param interleaved The value of the interleaved attribute + * @param dtype The value of the dtype attribute + * @param data type for {@code XlaSparseGradientsStack} output and operands + * @return a new instance of XlaSparseGradientsStack + */ + @Endpoint( + describeByClass = true + ) + public static XlaSparseGradientsStack create(Scope scope, + Iterable> unstackedGradients, Boolean interleaved, Class dtype) { + OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaSparseGradientsStack"); + opBuilder.addInputList(Operands.asOutputs(unstackedGradients)); + opBuilder.setAttr("interleaved", interleaved); + opBuilder.setAttr("dtype", Operands.toDataType(dtype)); + return new XlaSparseGradientsStack<>(opBuilder.build()); + } + + /** + * Gets stackedGradients. + * + * @return stackedGradients. + */ + public Output stackedGradients() { + return stackedGradients; + } + + @Override + public Output asOutput() { + return stackedGradients; + } + + @OpInputsMetadata( + outputsClass = XlaSparseGradientsStack.class + ) + public static class Inputs extends RawOpInputs> { + /** + * The unstackedGradients input + */ + public final Iterable> unstackedGradients; + + /** + * The interleaved attribute + */ + public final boolean interleaved; + + /** + * The inputDtype attribute + */ + public final DataType inputDtype; + + /** + * The dtype attribute + */ + public final DataType dtype; + + public Inputs(GraphOperation op) { + super(new XlaSparseGradientsStack<>(op), op, Arrays.asList("interleaved", "input_dtype", "dtype")); + int inputIndex = 0; + int unstackedGradientsLength = op.inputListLength("unstacked_gradients"); + unstackedGradients = Arrays.asList((Operand[]) op.inputList(inputIndex, unstackedGradientsLength)); + inputIndex += unstackedGradientsLength; + interleaved = op.attributes().getAttrBool("interleaved"); + inputDtype = op.attributes().getAttrType("input_dtype"); + dtype = op.attributes().getAttrType("dtype"); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicReduce.java deleted file mode 100644 index 2ac5ca797e5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicReduce.java +++ /dev/null @@ -1,105 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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; - -/** - * Wraps the variadic XLA Reduce operator. - * Semantics are documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#variadic_reduce. - * - * @param data type for {@code output} output - */ -@Operator( - group = "xla" -) -public final class XlaVariadicReduce extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaVariadicReduce"; - - private List> output; - - @SuppressWarnings("unchecked") - private XlaVariadicReduce(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } - - /** - * Factory method to create a class wrapping a new XlaVariadicReduce operation. - * - * @param scope current scope - * @param input the input tensor(s) - * @param initValue scalar initial value(s) for the reduction - * @param dimensionsToReduce dimension numbers over which to reduce - * @param reducer a reducer function to apply - * @param data type for {@code XlaVariadicReduce} output and operands - * @return a new instance of XlaVariadicReduce - */ - @Endpoint( - describeByClass = true - ) - public static XlaVariadicReduce create(Scope scope, - Iterable> input, Iterable> initValue, List dimensionsToReduce, - ConcreteFunction reducer) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaVariadicReduce"); - opBuilder.addInputList(Operands.asOutputs(input)); - opBuilder.addInputList(Operands.asOutputs(initValue)); - long[] dimensionsToReduceArray = new long[dimensionsToReduce.size()]; - for (int i = 0 ; i < dimensionsToReduceArray.length ; i++) { - dimensionsToReduceArray[i] = dimensionsToReduce.get(i); - } - opBuilder.setAttr("dimensions_to_reduce", dimensionsToReduceArray); - opBuilder.setAttr("reducer", reducer); - return new XlaVariadicReduce<>(opBuilder.build()); - } - - /** - * Gets output. - * - * @return output. - */ - public List> output() { - return output; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) output.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicSort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicSort.java deleted file mode 100644 index c4c8f9f7be4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaVariadicSort.java +++ /dev/null @@ -1,102 +0,0 @@ -/* 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 java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import org.tensorflow.ConcreteFunction; -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.TType; - -/** - * Wraps the XLA Sort operator, documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#sort - * . - *

    Sorts one or more tensors, with support for custom comparator, dimension, and - * is_stable attributes. - */ -@Operator( - group = "xla" -) -public final class XlaVariadicSort extends RawOp implements Iterable> { - /** - * The name of this op, as known by TensorFlow core engine - */ - public static final String OP_NAME = "XlaVariadicSort"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private XlaVariadicSort(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } - - /** - * Factory method to create a class wrapping a new XlaVariadicSort operation. - * - * @param scope current scope - * @param inputs A list of {@code Tensor} of identical shape but possibly different types. - * @param dimension The dimension along which to sort. Must be a compile-time constant. - * @param comparator A comparator function to apply to 2*N scalars and returning a - * boolean. N is the number of sort inputs. If you want to sort in ascending - * order then the comparator should perform a less-than comparison. - * @param isStable Whether to use stable sort. - * @return a new instance of XlaVariadicSort - */ - @Endpoint( - describeByClass = true - ) - public static XlaVariadicSort create(Scope scope, Iterable> inputs, - Operand dimension, ConcreteFunction comparator, Boolean isStable) { - OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "XlaVariadicSort"); - opBuilder.addInputList(Operands.asOutputs(inputs)); - opBuilder.addInput(dimension.asOutput()); - opBuilder.setAttr("comparator", comparator); - opBuilder.setAttr("is_stable", isStable); - return new XlaVariadicSort(opBuilder.build()); - } - - /** - * Gets outputs. - * A list of {@code Tensor} of same shape and types as the {@code input}. - * @return outputs. - */ - public List> outputs() { - return outputs; - } - - @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { - return (Iterator) outputs.iterator(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/AutoShardPolicy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/AutoShardPolicy.java deleted file mode 100644 index a45271b08eb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/AutoShardPolicy.java +++ /dev/null @@ -1,188 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - *

    - * Represents the type of auto-sharding we enable.
    - * 
    - * - * Protobuf enum {@code tensorflow.data.AutoShardPolicy} - */ -public enum AutoShardPolicy - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -   * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
    -   * 
    - * - * AUTO = 0; - */ - AUTO(0), - /** - *
    -   * FILE: Shards by input files (i.e. each worker will get a set of files to
    -   * process). When this option is selected, make sure that there is at least as
    -   * many files as workers. If there are fewer input files than workers, a
    -   * runtime error will be raised.
    -   * 
    - * - * FILE = 1; - */ - FILE(1), - /** - *
    -   * DATA: Shards by elements produced by the dataset. Each worker will process
    -   * the whole dataset and discard the portion that is not for itself. Note that
    -   * for this mode to correctly partitions the dataset elements, the dataset
    -   * needs to produce elements in a deterministic order.
    -   * 
    - * - * DATA = 2; - */ - DATA(2), - /** - *
    -   * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
    -   * as a placeholder to replace with `shard(num_workers, worker_index)`.
    -   * 
    - * - * HINT = 3; - */ - HINT(3), - /** - *
    -   * OFF: No sharding will be performed.
    -   * 
    - * - * OFF = -1; - */ - OFF(-1), - UNRECOGNIZED(-1), - ; - - /** - *
    -   * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
    -   * 
    - * - * AUTO = 0; - */ - public static final int AUTO_VALUE = 0; - /** - *
    -   * FILE: Shards by input files (i.e. each worker will get a set of files to
    -   * process). When this option is selected, make sure that there is at least as
    -   * many files as workers. If there are fewer input files than workers, a
    -   * runtime error will be raised.
    -   * 
    - * - * FILE = 1; - */ - public static final int FILE_VALUE = 1; - /** - *
    -   * DATA: Shards by elements produced by the dataset. Each worker will process
    -   * the whole dataset and discard the portion that is not for itself. Note that
    -   * for this mode to correctly partitions the dataset elements, the dataset
    -   * needs to produce elements in a deterministic order.
    -   * 
    - * - * DATA = 2; - */ - public static final int DATA_VALUE = 2; - /** - *
    -   * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
    -   * as a placeholder to replace with `shard(num_workers, worker_index)`.
    -   * 
    - * - * HINT = 3; - */ - public static final int HINT_VALUE = 3; - /** - *
    -   * OFF: No sharding will be performed.
    -   * 
    - * - * OFF = -1; - */ - public static final int OFF_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 AutoShardPolicy valueOf(int value) { - return forNumber(value); - } - - public static AutoShardPolicy forNumber(int value) { - switch (value) { - case 0: return AUTO; - case 1: return FILE; - case 2: return DATA; - case 3: return HINT; - case -1: return OFF; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - AutoShardPolicy> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AutoShardPolicy findValueByNumber(int number) { - return AutoShardPolicy.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.data.DatasetOptionsProtos.getDescriptor().getEnumTypes().get(0); - } - - private static final AutoShardPolicy[] VALUES = values(); - - public static AutoShardPolicy 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 AutoShardPolicy(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.data.AutoShardPolicy) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DatasetOptionsProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DatasetOptionsProtos.java deleted file mode 100644 index 51ede7436dd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DatasetOptionsProtos.java +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -public final class DatasetOptionsProtos { - private DatasetOptionsProtos() {} - 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_data_DistributeOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_OptimizationOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_ThreadingOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_Options_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_Options_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/framework/dataset_opti" + - "ons.proto\022\017tensorflow.data\"\177\n\021Distribute" + - "Options\022;\n\021auto_shard_policy\030\001 \001(\0162 .ten" + - "sorflow.data.AutoShardPolicy\022\025\n\013num_devi" + - "ces\030\002 \001(\005H\000B\026\n\024optional_num_devices\"\270\006\n\023" + - "OptimizationOptions\022%\n\033apply_default_opt" + - "imizations\030\001 \001(\010H\000\022\022\n\010autotune\030\002 \001(\010H\001\022\032" + - "\n\020autotune_buffers\030\003 \001(\010H\002\022\035\n\023autotune_c" + - "pu_budget\030\004 \001(\005H\003\022\035\n\023autotune_ram_budget" + - "\030\005 \001(\003H\004\022\027\n\rfilter_fusion\030\006 \001(\010H\005\022\036\n\024map" + - "_and_batch_fusion\030\t \001(\010H\006\022\037\n\025map_and_fil" + - "ter_fusion\030\n \001(\010H\007\022\024\n\nmap_fusion\030\013 \001(\010H\010" + - "\022\035\n\023map_parallelization\030\014 \001(\010H\t\022\032\n\020noop_" + - "elimination\030\016 \001(\010H\n\022\030\n\016parallel_batch\030\017 " + - "\001(\010H\013\022#\n\031shuffle_and_repeat_fusion\030\021 \001(\010" + - "H\014B&\n$optional_apply_default_optimizatio" + - "nsB\023\n\021optional_autotuneB\033\n\031optional_auto" + - "tune_buffersB\036\n\034optional_autotune_cpu_bu" + - "dgetB\036\n\034optional_autotune_ram_budgetB\030\n\026" + - "optional_filter_fusionB\037\n\035optional_map_a" + - "nd_batch_fusionB \n\036optional_map_and_filt" + - "er_fusionB\025\n\023optional_map_fusionB\036\n\034opti" + - "onal_map_parallelizationB\033\n\031optional_noo" + - "p_eliminationB\031\n\027optional_parallel_batch" + - "B$\n\"optional_shuffle_and_repeat_fusionJ\004" + - "\010\007\020\010J\004\010\010\020\tJ\004\010\r\020\016J\004\010\020\020\021\"\242\001\n\020ThreadingOpti" + - "ons\022\"\n\030max_intra_op_parallelism\030\001 \001(\005H\000\022" + - "!\n\027private_threadpool_size\030\002 \001(\005H\001B#\n!op" + - "tional_max_intra_op_parallelismB\"\n optio" + - "nal_private_threadpool_size\"\212\003\n\007Options\022" + - "\027\n\rdeterministic\030\001 \001(\010H\000\022>\n\022distribute_o" + - "ptions\030\002 \001(\0132\".tensorflow.data.Distribut" + - "eOptions\022B\n\024optimization_options\030\003 \001(\0132$" + - ".tensorflow.data.OptimizationOptions\022\017\n\005" + - "slack\030\004 \001(\010H\001\022<\n\021threading_options\030\005 \001(\013" + - "2!.tensorflow.data.ThreadingOptions\022E\n\025e" + - "xternal_state_policy\030\006 \001(\0162$.tensorflow." + - "data.ExternalStatePolicyH\002B\030\n\026optional_d" + - "eterministicB\020\n\016optional_slackB \n\036option" + - "al_external_state_policy*K\n\017AutoShardPol" + - "icy\022\010\n\004AUTO\020\000\022\010\n\004FILE\020\001\022\010\n\004DATA\020\002\022\010\n\004HIN" + - "T\020\003\022\020\n\003OFF\020\377\377\377\377\377\377\377\377\377\001*J\n\023ExternalStatePo" + - "licy\022\017\n\013POLICY_WARN\020\000\022\021\n\rPOLICY_IGNORE\020\001" + - "\022\017\n\013POLICY_FAIL\020\002B\213\001\n\031org.tensorflow.pro" + - "to.dataB\024DatasetOptionsProtosP\001ZVgithub." + - "com/tensorflow/tensorflow/tensorflow/go/" + - "core/framework/dataset_options_go_protob" + - "\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_data_DistributeOptions_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_DistributeOptions_descriptor, - new java.lang.String[] { "AutoShardPolicy", "NumDevices", "OptionalNumDevices", }); - internal_static_tensorflow_data_OptimizationOptions_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_OptimizationOptions_descriptor, - new java.lang.String[] { "ApplyDefaultOptimizations", "Autotune", "AutotuneBuffers", "AutotuneCpuBudget", "AutotuneRamBudget", "FilterFusion", "MapAndBatchFusion", "MapAndFilterFusion", "MapFusion", "MapParallelization", "NoopElimination", "ParallelBatch", "ShuffleAndRepeatFusion", "OptionalApplyDefaultOptimizations", "OptionalAutotune", "OptionalAutotuneBuffers", "OptionalAutotuneCpuBudget", "OptionalAutotuneRamBudget", "OptionalFilterFusion", "OptionalMapAndBatchFusion", "OptionalMapAndFilterFusion", "OptionalMapFusion", "OptionalMapParallelization", "OptionalNoopElimination", "OptionalParallelBatch", "OptionalShuffleAndRepeatFusion", }); - internal_static_tensorflow_data_ThreadingOptions_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_ThreadingOptions_descriptor, - new java.lang.String[] { "MaxIntraOpParallelism", "PrivateThreadpoolSize", "OptionalMaxIntraOpParallelism", "OptionalPrivateThreadpoolSize", }); - internal_static_tensorflow_data_Options_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_data_Options_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_Options_descriptor, - new java.lang.String[] { "Deterministic", "DistributeOptions", "OptimizationOptions", "Slack", "ThreadingOptions", "ExternalStatePolicy", "OptionalDeterministic", "OptionalSlack", "OptionalExternalStatePolicy", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptions.java deleted file mode 100644 index dba5ebe1b32..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptions.java +++ /dev/null @@ -1,642 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - * Protobuf type {@code tensorflow.data.DistributeOptions} - */ -public final class DistributeOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.DistributeOptions) - DistributeOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use DistributeOptions.newBuilder() to construct. - private DistributeOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DistributeOptions() { - autoShardPolicy_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DistributeOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DistributeOptions( - 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: { - int rawValue = input.readEnum(); - - autoShardPolicy_ = rawValue; - break; - } - case 16: { - optionalNumDevicesCase_ = 2; - optionalNumDevices_ = input.readInt32(); - 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.DatasetOptionsProtos.internal_static_tensorflow_data_DistributeOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.DistributeOptions.class, org.tensorflow.proto.data.DistributeOptions.Builder.class); - } - - private int optionalNumDevicesCase_ = 0; - private java.lang.Object optionalNumDevices_; - public enum OptionalNumDevicesCase - implements com.google.protobuf.Internal.EnumLite { - NUM_DEVICES(2), - OPTIONALNUMDEVICES_NOT_SET(0); - private final int value; - private OptionalNumDevicesCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalNumDevicesCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalNumDevicesCase forNumber(int value) { - switch (value) { - case 2: return NUM_DEVICES; - case 0: return OPTIONALNUMDEVICES_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalNumDevicesCase - getOptionalNumDevicesCase() { - return OptionalNumDevicesCase.forNumber( - optionalNumDevicesCase_); - } - - public static final int AUTO_SHARD_POLICY_FIELD_NUMBER = 1; - private int autoShardPolicy_; - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public int getAutoShardPolicyValue() { - return autoShardPolicy_; - } - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public org.tensorflow.proto.data.AutoShardPolicy getAutoShardPolicy() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.AutoShardPolicy result = org.tensorflow.proto.data.AutoShardPolicy.valueOf(autoShardPolicy_); - return result == null ? org.tensorflow.proto.data.AutoShardPolicy.UNRECOGNIZED : result; - } - - public static final int NUM_DEVICES_FIELD_NUMBER = 2; - /** - * int32 num_devices = 2; - */ - public int getNumDevices() { - if (optionalNumDevicesCase_ == 2) { - return (java.lang.Integer) optionalNumDevices_; - } - return 0; - } - - 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 (autoShardPolicy_ != org.tensorflow.proto.data.AutoShardPolicy.AUTO.getNumber()) { - output.writeEnum(1, autoShardPolicy_); - } - if (optionalNumDevicesCase_ == 2) { - output.writeInt32( - 2, (int)((java.lang.Integer) optionalNumDevices_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (autoShardPolicy_ != org.tensorflow.proto.data.AutoShardPolicy.AUTO.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, autoShardPolicy_); - } - if (optionalNumDevicesCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size( - 2, (int)((java.lang.Integer) optionalNumDevices_)); - } - 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.DistributeOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.data.DistributeOptions other = (org.tensorflow.proto.data.DistributeOptions) obj; - - if (autoShardPolicy_ != other.autoShardPolicy_) return false; - if (!getOptionalNumDevicesCase().equals(other.getOptionalNumDevicesCase())) return false; - switch (optionalNumDevicesCase_) { - case 2: - if (getNumDevices() - != other.getNumDevices()) return false; - break; - case 0: - default: - } - 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) + AUTO_SHARD_POLICY_FIELD_NUMBER; - hash = (53 * hash) + autoShardPolicy_; - switch (optionalNumDevicesCase_) { - case 2: - hash = (37 * hash) + NUM_DEVICES_FIELD_NUMBER; - hash = (53 * hash) + getNumDevices(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.DistributeOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.DistributeOptions 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.DistributeOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.DistributeOptions 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.DistributeOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.DistributeOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.DistributeOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.DistributeOptions 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.DistributeOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.DistributeOptions 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.DistributeOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.DistributeOptions 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.DistributeOptions 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.data.DistributeOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.DistributeOptions) - org.tensorflow.proto.data.DistributeOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_DistributeOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.DistributeOptions.class, org.tensorflow.proto.data.DistributeOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.data.DistributeOptions.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(); - autoShardPolicy_ = 0; - - optionalNumDevicesCase_ = 0; - optionalNumDevices_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_DistributeOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.DistributeOptions getDefaultInstanceForType() { - return org.tensorflow.proto.data.DistributeOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.DistributeOptions build() { - org.tensorflow.proto.data.DistributeOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.DistributeOptions buildPartial() { - org.tensorflow.proto.data.DistributeOptions result = new org.tensorflow.proto.data.DistributeOptions(this); - result.autoShardPolicy_ = autoShardPolicy_; - if (optionalNumDevicesCase_ == 2) { - result.optionalNumDevices_ = optionalNumDevices_; - } - result.optionalNumDevicesCase_ = optionalNumDevicesCase_; - 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.DistributeOptions) { - return mergeFrom((org.tensorflow.proto.data.DistributeOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.DistributeOptions other) { - if (other == org.tensorflow.proto.data.DistributeOptions.getDefaultInstance()) return this; - if (other.autoShardPolicy_ != 0) { - setAutoShardPolicyValue(other.getAutoShardPolicyValue()); - } - switch (other.getOptionalNumDevicesCase()) { - case NUM_DEVICES: { - setNumDevices(other.getNumDevices()); - break; - } - case OPTIONALNUMDEVICES_NOT_SET: { - break; - } - } - 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.DistributeOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.DistributeOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int optionalNumDevicesCase_ = 0; - private java.lang.Object optionalNumDevices_; - public OptionalNumDevicesCase - getOptionalNumDevicesCase() { - return OptionalNumDevicesCase.forNumber( - optionalNumDevicesCase_); - } - - public Builder clearOptionalNumDevices() { - optionalNumDevicesCase_ = 0; - optionalNumDevices_ = null; - onChanged(); - return this; - } - - - private int autoShardPolicy_ = 0; - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public int getAutoShardPolicyValue() { - return autoShardPolicy_; - } - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public Builder setAutoShardPolicyValue(int value) { - autoShardPolicy_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public org.tensorflow.proto.data.AutoShardPolicy getAutoShardPolicy() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.AutoShardPolicy result = org.tensorflow.proto.data.AutoShardPolicy.valueOf(autoShardPolicy_); - return result == null ? org.tensorflow.proto.data.AutoShardPolicy.UNRECOGNIZED : result; - } - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public Builder setAutoShardPolicy(org.tensorflow.proto.data.AutoShardPolicy value) { - if (value == null) { - throw new NullPointerException(); - } - - autoShardPolicy_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - public Builder clearAutoShardPolicy() { - - autoShardPolicy_ = 0; - onChanged(); - return this; - } - - /** - * int32 num_devices = 2; - */ - public int getNumDevices() { - if (optionalNumDevicesCase_ == 2) { - return (java.lang.Integer) optionalNumDevices_; - } - return 0; - } - /** - * int32 num_devices = 2; - */ - public Builder setNumDevices(int value) { - optionalNumDevicesCase_ = 2; - optionalNumDevices_ = value; - onChanged(); - return this; - } - /** - * int32 num_devices = 2; - */ - public Builder clearNumDevices() { - if (optionalNumDevicesCase_ == 2) { - optionalNumDevicesCase_ = 0; - optionalNumDevices_ = null; - 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.DistributeOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.DistributeOptions) - private static final org.tensorflow.proto.data.DistributeOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.DistributeOptions(); - } - - public static org.tensorflow.proto.data.DistributeOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DistributeOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DistributeOptions(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.DistributeOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptionsOrBuilder.java deleted file mode 100644 index 84cd08668e6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/DistributeOptionsOrBuilder.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -public interface DistributeOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.DistributeOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - int getAutoShardPolicyValue(); - /** - * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; - */ - org.tensorflow.proto.data.AutoShardPolicy getAutoShardPolicy(); - - /** - * int32 num_devices = 2; - */ - int getNumDevices(); - - public org.tensorflow.proto.data.DistributeOptions.OptionalNumDevicesCase getOptionalNumDevicesCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ExternalStatePolicy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ExternalStatePolicy.java deleted file mode 100644 index 2f7375ae00d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ExternalStatePolicy.java +++ /dev/null @@ -1,116 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - *
    - * Represents how to handle external state during serialization.
    - * 
    - * - * Protobuf enum {@code tensorflow.data.ExternalStatePolicy} - */ -public enum ExternalStatePolicy - implements com.google.protobuf.ProtocolMessageEnum { - /** - * POLICY_WARN = 0; - */ - POLICY_WARN(0), - /** - * POLICY_IGNORE = 1; - */ - POLICY_IGNORE(1), - /** - * POLICY_FAIL = 2; - */ - POLICY_FAIL(2), - UNRECOGNIZED(-1), - ; - - /** - * POLICY_WARN = 0; - */ - public static final int POLICY_WARN_VALUE = 0; - /** - * POLICY_IGNORE = 1; - */ - public static final int POLICY_IGNORE_VALUE = 1; - /** - * POLICY_FAIL = 2; - */ - public static final int POLICY_FAIL_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 ExternalStatePolicy valueOf(int value) { - return forNumber(value); - } - - public static ExternalStatePolicy forNumber(int value) { - switch (value) { - case 0: return POLICY_WARN; - case 1: return POLICY_IGNORE; - case 2: return POLICY_FAIL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ExternalStatePolicy> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ExternalStatePolicy findValueByNumber(int number) { - return ExternalStatePolicy.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.data.DatasetOptionsProtos.getDescriptor().getEnumTypes().get(1); - } - - private static final ExternalStatePolicy[] VALUES = values(); - - public static ExternalStatePolicy 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 ExternalStatePolicy(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.data.ExternalStatePolicy) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptions.java deleted file mode 100644 index eac7b3d4136..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptions.java +++ /dev/null @@ -1,2225 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - * Protobuf type {@code tensorflow.data.OptimizationOptions} - */ -public final class OptimizationOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.OptimizationOptions) - OptimizationOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use OptimizationOptions.newBuilder() to construct. - private OptimizationOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OptimizationOptions() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OptimizationOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OptimizationOptions( - 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: { - optionalApplyDefaultOptimizationsCase_ = 1; - optionalApplyDefaultOptimizations_ = input.readBool(); - break; - } - case 16: { - optionalAutotuneCase_ = 2; - optionalAutotune_ = input.readBool(); - break; - } - case 24: { - optionalAutotuneBuffersCase_ = 3; - optionalAutotuneBuffers_ = input.readBool(); - break; - } - case 32: { - optionalAutotuneCpuBudgetCase_ = 4; - optionalAutotuneCpuBudget_ = input.readInt32(); - break; - } - case 40: { - optionalAutotuneRamBudgetCase_ = 5; - optionalAutotuneRamBudget_ = input.readInt64(); - break; - } - case 48: { - optionalFilterFusionCase_ = 6; - optionalFilterFusion_ = input.readBool(); - break; - } - case 72: { - optionalMapAndBatchFusionCase_ = 9; - optionalMapAndBatchFusion_ = input.readBool(); - break; - } - case 80: { - optionalMapAndFilterFusionCase_ = 10; - optionalMapAndFilterFusion_ = input.readBool(); - break; - } - case 88: { - optionalMapFusionCase_ = 11; - optionalMapFusion_ = input.readBool(); - break; - } - case 96: { - optionalMapParallelizationCase_ = 12; - optionalMapParallelization_ = input.readBool(); - break; - } - case 112: { - optionalNoopEliminationCase_ = 14; - optionalNoopElimination_ = input.readBool(); - break; - } - case 120: { - optionalParallelBatchCase_ = 15; - optionalParallelBatch_ = input.readBool(); - break; - } - case 136: { - optionalShuffleAndRepeatFusionCase_ = 17; - optionalShuffleAndRepeatFusion_ = input.readBool(); - 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.DatasetOptionsProtos.internal_static_tensorflow_data_OptimizationOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.OptimizationOptions.class, org.tensorflow.proto.data.OptimizationOptions.Builder.class); - } - - private int optionalApplyDefaultOptimizationsCase_ = 0; - private java.lang.Object optionalApplyDefaultOptimizations_; - public enum OptionalApplyDefaultOptimizationsCase - implements com.google.protobuf.Internal.EnumLite { - APPLY_DEFAULT_OPTIMIZATIONS(1), - OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET(0); - private final int value; - private OptionalApplyDefaultOptimizationsCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalApplyDefaultOptimizationsCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalApplyDefaultOptimizationsCase forNumber(int value) { - switch (value) { - case 1: return APPLY_DEFAULT_OPTIMIZATIONS; - case 0: return OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalApplyDefaultOptimizationsCase - getOptionalApplyDefaultOptimizationsCase() { - return OptionalApplyDefaultOptimizationsCase.forNumber( - optionalApplyDefaultOptimizationsCase_); - } - - private int optionalAutotuneCase_ = 0; - private java.lang.Object optionalAutotune_; - public enum OptionalAutotuneCase - implements com.google.protobuf.Internal.EnumLite { - AUTOTUNE(2), - OPTIONALAUTOTUNE_NOT_SET(0); - private final int value; - private OptionalAutotuneCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalAutotuneCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalAutotuneCase forNumber(int value) { - switch (value) { - case 2: return AUTOTUNE; - case 0: return OPTIONALAUTOTUNE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalAutotuneCase - getOptionalAutotuneCase() { - return OptionalAutotuneCase.forNumber( - optionalAutotuneCase_); - } - - private int optionalAutotuneBuffersCase_ = 0; - private java.lang.Object optionalAutotuneBuffers_; - public enum OptionalAutotuneBuffersCase - implements com.google.protobuf.Internal.EnumLite { - AUTOTUNE_BUFFERS(3), - OPTIONALAUTOTUNEBUFFERS_NOT_SET(0); - private final int value; - private OptionalAutotuneBuffersCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalAutotuneBuffersCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalAutotuneBuffersCase forNumber(int value) { - switch (value) { - case 3: return AUTOTUNE_BUFFERS; - case 0: return OPTIONALAUTOTUNEBUFFERS_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalAutotuneBuffersCase - getOptionalAutotuneBuffersCase() { - return OptionalAutotuneBuffersCase.forNumber( - optionalAutotuneBuffersCase_); - } - - private int optionalAutotuneCpuBudgetCase_ = 0; - private java.lang.Object optionalAutotuneCpuBudget_; - public enum OptionalAutotuneCpuBudgetCase - implements com.google.protobuf.Internal.EnumLite { - AUTOTUNE_CPU_BUDGET(4), - OPTIONALAUTOTUNECPUBUDGET_NOT_SET(0); - private final int value; - private OptionalAutotuneCpuBudgetCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalAutotuneCpuBudgetCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalAutotuneCpuBudgetCase forNumber(int value) { - switch (value) { - case 4: return AUTOTUNE_CPU_BUDGET; - case 0: return OPTIONALAUTOTUNECPUBUDGET_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalAutotuneCpuBudgetCase - getOptionalAutotuneCpuBudgetCase() { - return OptionalAutotuneCpuBudgetCase.forNumber( - optionalAutotuneCpuBudgetCase_); - } - - private int optionalAutotuneRamBudgetCase_ = 0; - private java.lang.Object optionalAutotuneRamBudget_; - public enum OptionalAutotuneRamBudgetCase - implements com.google.protobuf.Internal.EnumLite { - AUTOTUNE_RAM_BUDGET(5), - OPTIONALAUTOTUNERAMBUDGET_NOT_SET(0); - private final int value; - private OptionalAutotuneRamBudgetCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalAutotuneRamBudgetCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalAutotuneRamBudgetCase forNumber(int value) { - switch (value) { - case 5: return AUTOTUNE_RAM_BUDGET; - case 0: return OPTIONALAUTOTUNERAMBUDGET_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalAutotuneRamBudgetCase - getOptionalAutotuneRamBudgetCase() { - return OptionalAutotuneRamBudgetCase.forNumber( - optionalAutotuneRamBudgetCase_); - } - - private int optionalFilterFusionCase_ = 0; - private java.lang.Object optionalFilterFusion_; - public enum OptionalFilterFusionCase - implements com.google.protobuf.Internal.EnumLite { - FILTER_FUSION(6), - OPTIONALFILTERFUSION_NOT_SET(0); - private final int value; - private OptionalFilterFusionCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalFilterFusionCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalFilterFusionCase forNumber(int value) { - switch (value) { - case 6: return FILTER_FUSION; - case 0: return OPTIONALFILTERFUSION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalFilterFusionCase - getOptionalFilterFusionCase() { - return OptionalFilterFusionCase.forNumber( - optionalFilterFusionCase_); - } - - private int optionalMapAndBatchFusionCase_ = 0; - private java.lang.Object optionalMapAndBatchFusion_; - public enum OptionalMapAndBatchFusionCase - implements com.google.protobuf.Internal.EnumLite { - MAP_AND_BATCH_FUSION(9), - OPTIONALMAPANDBATCHFUSION_NOT_SET(0); - private final int value; - private OptionalMapAndBatchFusionCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalMapAndBatchFusionCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalMapAndBatchFusionCase forNumber(int value) { - switch (value) { - case 9: return MAP_AND_BATCH_FUSION; - case 0: return OPTIONALMAPANDBATCHFUSION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalMapAndBatchFusionCase - getOptionalMapAndBatchFusionCase() { - return OptionalMapAndBatchFusionCase.forNumber( - optionalMapAndBatchFusionCase_); - } - - private int optionalMapAndFilterFusionCase_ = 0; - private java.lang.Object optionalMapAndFilterFusion_; - public enum OptionalMapAndFilterFusionCase - implements com.google.protobuf.Internal.EnumLite { - MAP_AND_FILTER_FUSION(10), - OPTIONALMAPANDFILTERFUSION_NOT_SET(0); - private final int value; - private OptionalMapAndFilterFusionCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalMapAndFilterFusionCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalMapAndFilterFusionCase forNumber(int value) { - switch (value) { - case 10: return MAP_AND_FILTER_FUSION; - case 0: return OPTIONALMAPANDFILTERFUSION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalMapAndFilterFusionCase - getOptionalMapAndFilterFusionCase() { - return OptionalMapAndFilterFusionCase.forNumber( - optionalMapAndFilterFusionCase_); - } - - private int optionalMapFusionCase_ = 0; - private java.lang.Object optionalMapFusion_; - public enum OptionalMapFusionCase - implements com.google.protobuf.Internal.EnumLite { - MAP_FUSION(11), - OPTIONALMAPFUSION_NOT_SET(0); - private final int value; - private OptionalMapFusionCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalMapFusionCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalMapFusionCase forNumber(int value) { - switch (value) { - case 11: return MAP_FUSION; - case 0: return OPTIONALMAPFUSION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalMapFusionCase - getOptionalMapFusionCase() { - return OptionalMapFusionCase.forNumber( - optionalMapFusionCase_); - } - - private int optionalMapParallelizationCase_ = 0; - private java.lang.Object optionalMapParallelization_; - public enum OptionalMapParallelizationCase - implements com.google.protobuf.Internal.EnumLite { - MAP_PARALLELIZATION(12), - OPTIONALMAPPARALLELIZATION_NOT_SET(0); - private final int value; - private OptionalMapParallelizationCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalMapParallelizationCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalMapParallelizationCase forNumber(int value) { - switch (value) { - case 12: return MAP_PARALLELIZATION; - case 0: return OPTIONALMAPPARALLELIZATION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalMapParallelizationCase - getOptionalMapParallelizationCase() { - return OptionalMapParallelizationCase.forNumber( - optionalMapParallelizationCase_); - } - - private int optionalNoopEliminationCase_ = 0; - private java.lang.Object optionalNoopElimination_; - public enum OptionalNoopEliminationCase - implements com.google.protobuf.Internal.EnumLite { - NOOP_ELIMINATION(14), - OPTIONALNOOPELIMINATION_NOT_SET(0); - private final int value; - private OptionalNoopEliminationCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalNoopEliminationCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalNoopEliminationCase forNumber(int value) { - switch (value) { - case 14: return NOOP_ELIMINATION; - case 0: return OPTIONALNOOPELIMINATION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalNoopEliminationCase - getOptionalNoopEliminationCase() { - return OptionalNoopEliminationCase.forNumber( - optionalNoopEliminationCase_); - } - - private int optionalParallelBatchCase_ = 0; - private java.lang.Object optionalParallelBatch_; - public enum OptionalParallelBatchCase - implements com.google.protobuf.Internal.EnumLite { - PARALLEL_BATCH(15), - OPTIONALPARALLELBATCH_NOT_SET(0); - private final int value; - private OptionalParallelBatchCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalParallelBatchCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalParallelBatchCase forNumber(int value) { - switch (value) { - case 15: return PARALLEL_BATCH; - case 0: return OPTIONALPARALLELBATCH_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalParallelBatchCase - getOptionalParallelBatchCase() { - return OptionalParallelBatchCase.forNumber( - optionalParallelBatchCase_); - } - - private int optionalShuffleAndRepeatFusionCase_ = 0; - private java.lang.Object optionalShuffleAndRepeatFusion_; - public enum OptionalShuffleAndRepeatFusionCase - implements com.google.protobuf.Internal.EnumLite { - SHUFFLE_AND_REPEAT_FUSION(17), - OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET(0); - private final int value; - private OptionalShuffleAndRepeatFusionCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalShuffleAndRepeatFusionCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalShuffleAndRepeatFusionCase forNumber(int value) { - switch (value) { - case 17: return SHUFFLE_AND_REPEAT_FUSION; - case 0: return OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalShuffleAndRepeatFusionCase - getOptionalShuffleAndRepeatFusionCase() { - return OptionalShuffleAndRepeatFusionCase.forNumber( - optionalShuffleAndRepeatFusionCase_); - } - - public static final int APPLY_DEFAULT_OPTIMIZATIONS_FIELD_NUMBER = 1; - /** - * bool apply_default_optimizations = 1; - */ - public boolean getApplyDefaultOptimizations() { - if (optionalApplyDefaultOptimizationsCase_ == 1) { - return (java.lang.Boolean) optionalApplyDefaultOptimizations_; - } - return false; - } - - public static final int AUTOTUNE_FIELD_NUMBER = 2; - /** - * bool autotune = 2; - */ - public boolean getAutotune() { - if (optionalAutotuneCase_ == 2) { - return (java.lang.Boolean) optionalAutotune_; - } - return false; - } - - public static final int AUTOTUNE_BUFFERS_FIELD_NUMBER = 3; - /** - * bool autotune_buffers = 3; - */ - public boolean getAutotuneBuffers() { - if (optionalAutotuneBuffersCase_ == 3) { - return (java.lang.Boolean) optionalAutotuneBuffers_; - } - return false; - } - - public static final int AUTOTUNE_CPU_BUDGET_FIELD_NUMBER = 4; - /** - * int32 autotune_cpu_budget = 4; - */ - public int getAutotuneCpuBudget() { - if (optionalAutotuneCpuBudgetCase_ == 4) { - return (java.lang.Integer) optionalAutotuneCpuBudget_; - } - return 0; - } - - public static final int AUTOTUNE_RAM_BUDGET_FIELD_NUMBER = 5; - /** - * int64 autotune_ram_budget = 5; - */ - public long getAutotuneRamBudget() { - if (optionalAutotuneRamBudgetCase_ == 5) { - return (java.lang.Long) optionalAutotuneRamBudget_; - } - return 0L; - } - - public static final int FILTER_FUSION_FIELD_NUMBER = 6; - /** - * bool filter_fusion = 6; - */ - public boolean getFilterFusion() { - if (optionalFilterFusionCase_ == 6) { - return (java.lang.Boolean) optionalFilterFusion_; - } - return false; - } - - public static final int MAP_AND_BATCH_FUSION_FIELD_NUMBER = 9; - /** - * bool map_and_batch_fusion = 9; - */ - public boolean getMapAndBatchFusion() { - if (optionalMapAndBatchFusionCase_ == 9) { - return (java.lang.Boolean) optionalMapAndBatchFusion_; - } - return false; - } - - public static final int MAP_AND_FILTER_FUSION_FIELD_NUMBER = 10; - /** - * bool map_and_filter_fusion = 10; - */ - public boolean getMapAndFilterFusion() { - if (optionalMapAndFilterFusionCase_ == 10) { - return (java.lang.Boolean) optionalMapAndFilterFusion_; - } - return false; - } - - public static final int MAP_FUSION_FIELD_NUMBER = 11; - /** - * bool map_fusion = 11; - */ - public boolean getMapFusion() { - if (optionalMapFusionCase_ == 11) { - return (java.lang.Boolean) optionalMapFusion_; - } - return false; - } - - public static final int MAP_PARALLELIZATION_FIELD_NUMBER = 12; - /** - * bool map_parallelization = 12; - */ - public boolean getMapParallelization() { - if (optionalMapParallelizationCase_ == 12) { - return (java.lang.Boolean) optionalMapParallelization_; - } - return false; - } - - public static final int NOOP_ELIMINATION_FIELD_NUMBER = 14; - /** - * bool noop_elimination = 14; - */ - public boolean getNoopElimination() { - if (optionalNoopEliminationCase_ == 14) { - return (java.lang.Boolean) optionalNoopElimination_; - } - return false; - } - - public static final int PARALLEL_BATCH_FIELD_NUMBER = 15; - /** - * bool parallel_batch = 15; - */ - public boolean getParallelBatch() { - if (optionalParallelBatchCase_ == 15) { - return (java.lang.Boolean) optionalParallelBatch_; - } - return false; - } - - public static final int SHUFFLE_AND_REPEAT_FUSION_FIELD_NUMBER = 17; - /** - * bool shuffle_and_repeat_fusion = 17; - */ - public boolean getShuffleAndRepeatFusion() { - if (optionalShuffleAndRepeatFusionCase_ == 17) { - return (java.lang.Boolean) optionalShuffleAndRepeatFusion_; - } - return false; - } - - 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 (optionalApplyDefaultOptimizationsCase_ == 1) { - output.writeBool( - 1, (boolean)((java.lang.Boolean) optionalApplyDefaultOptimizations_)); - } - if (optionalAutotuneCase_ == 2) { - output.writeBool( - 2, (boolean)((java.lang.Boolean) optionalAutotune_)); - } - if (optionalAutotuneBuffersCase_ == 3) { - output.writeBool( - 3, (boolean)((java.lang.Boolean) optionalAutotuneBuffers_)); - } - if (optionalAutotuneCpuBudgetCase_ == 4) { - output.writeInt32( - 4, (int)((java.lang.Integer) optionalAutotuneCpuBudget_)); - } - if (optionalAutotuneRamBudgetCase_ == 5) { - output.writeInt64( - 5, (long)((java.lang.Long) optionalAutotuneRamBudget_)); - } - if (optionalFilterFusionCase_ == 6) { - output.writeBool( - 6, (boolean)((java.lang.Boolean) optionalFilterFusion_)); - } - if (optionalMapAndBatchFusionCase_ == 9) { - output.writeBool( - 9, (boolean)((java.lang.Boolean) optionalMapAndBatchFusion_)); - } - if (optionalMapAndFilterFusionCase_ == 10) { - output.writeBool( - 10, (boolean)((java.lang.Boolean) optionalMapAndFilterFusion_)); - } - if (optionalMapFusionCase_ == 11) { - output.writeBool( - 11, (boolean)((java.lang.Boolean) optionalMapFusion_)); - } - if (optionalMapParallelizationCase_ == 12) { - output.writeBool( - 12, (boolean)((java.lang.Boolean) optionalMapParallelization_)); - } - if (optionalNoopEliminationCase_ == 14) { - output.writeBool( - 14, (boolean)((java.lang.Boolean) optionalNoopElimination_)); - } - if (optionalParallelBatchCase_ == 15) { - output.writeBool( - 15, (boolean)((java.lang.Boolean) optionalParallelBatch_)); - } - if (optionalShuffleAndRepeatFusionCase_ == 17) { - output.writeBool( - 17, (boolean)((java.lang.Boolean) optionalShuffleAndRepeatFusion_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (optionalApplyDefaultOptimizationsCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 1, (boolean)((java.lang.Boolean) optionalApplyDefaultOptimizations_)); - } - if (optionalAutotuneCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 2, (boolean)((java.lang.Boolean) optionalAutotune_)); - } - if (optionalAutotuneBuffersCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 3, (boolean)((java.lang.Boolean) optionalAutotuneBuffers_)); - } - if (optionalAutotuneCpuBudgetCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size( - 4, (int)((java.lang.Integer) optionalAutotuneCpuBudget_)); - } - if (optionalAutotuneRamBudgetCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 5, (long)((java.lang.Long) optionalAutotuneRamBudget_)); - } - if (optionalFilterFusionCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 6, (boolean)((java.lang.Boolean) optionalFilterFusion_)); - } - if (optionalMapAndBatchFusionCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 9, (boolean)((java.lang.Boolean) optionalMapAndBatchFusion_)); - } - if (optionalMapAndFilterFusionCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 10, (boolean)((java.lang.Boolean) optionalMapAndFilterFusion_)); - } - if (optionalMapFusionCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 11, (boolean)((java.lang.Boolean) optionalMapFusion_)); - } - if (optionalMapParallelizationCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 12, (boolean)((java.lang.Boolean) optionalMapParallelization_)); - } - if (optionalNoopEliminationCase_ == 14) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 14, (boolean)((java.lang.Boolean) optionalNoopElimination_)); - } - if (optionalParallelBatchCase_ == 15) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 15, (boolean)((java.lang.Boolean) optionalParallelBatch_)); - } - if (optionalShuffleAndRepeatFusionCase_ == 17) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 17, (boolean)((java.lang.Boolean) optionalShuffleAndRepeatFusion_)); - } - 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.OptimizationOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.data.OptimizationOptions other = (org.tensorflow.proto.data.OptimizationOptions) obj; - - if (!getOptionalApplyDefaultOptimizationsCase().equals(other.getOptionalApplyDefaultOptimizationsCase())) return false; - switch (optionalApplyDefaultOptimizationsCase_) { - case 1: - if (getApplyDefaultOptimizations() - != other.getApplyDefaultOptimizations()) return false; - break; - case 0: - default: - } - if (!getOptionalAutotuneCase().equals(other.getOptionalAutotuneCase())) return false; - switch (optionalAutotuneCase_) { - case 2: - if (getAutotune() - != other.getAutotune()) return false; - break; - case 0: - default: - } - if (!getOptionalAutotuneBuffersCase().equals(other.getOptionalAutotuneBuffersCase())) return false; - switch (optionalAutotuneBuffersCase_) { - case 3: - if (getAutotuneBuffers() - != other.getAutotuneBuffers()) return false; - break; - case 0: - default: - } - if (!getOptionalAutotuneCpuBudgetCase().equals(other.getOptionalAutotuneCpuBudgetCase())) return false; - switch (optionalAutotuneCpuBudgetCase_) { - case 4: - if (getAutotuneCpuBudget() - != other.getAutotuneCpuBudget()) return false; - break; - case 0: - default: - } - if (!getOptionalAutotuneRamBudgetCase().equals(other.getOptionalAutotuneRamBudgetCase())) return false; - switch (optionalAutotuneRamBudgetCase_) { - case 5: - if (getAutotuneRamBudget() - != other.getAutotuneRamBudget()) return false; - break; - case 0: - default: - } - if (!getOptionalFilterFusionCase().equals(other.getOptionalFilterFusionCase())) return false; - switch (optionalFilterFusionCase_) { - case 6: - if (getFilterFusion() - != other.getFilterFusion()) return false; - break; - case 0: - default: - } - if (!getOptionalMapAndBatchFusionCase().equals(other.getOptionalMapAndBatchFusionCase())) return false; - switch (optionalMapAndBatchFusionCase_) { - case 9: - if (getMapAndBatchFusion() - != other.getMapAndBatchFusion()) return false; - break; - case 0: - default: - } - if (!getOptionalMapAndFilterFusionCase().equals(other.getOptionalMapAndFilterFusionCase())) return false; - switch (optionalMapAndFilterFusionCase_) { - case 10: - if (getMapAndFilterFusion() - != other.getMapAndFilterFusion()) return false; - break; - case 0: - default: - } - if (!getOptionalMapFusionCase().equals(other.getOptionalMapFusionCase())) return false; - switch (optionalMapFusionCase_) { - case 11: - if (getMapFusion() - != other.getMapFusion()) return false; - break; - case 0: - default: - } - if (!getOptionalMapParallelizationCase().equals(other.getOptionalMapParallelizationCase())) return false; - switch (optionalMapParallelizationCase_) { - case 12: - if (getMapParallelization() - != other.getMapParallelization()) return false; - break; - case 0: - default: - } - if (!getOptionalNoopEliminationCase().equals(other.getOptionalNoopEliminationCase())) return false; - switch (optionalNoopEliminationCase_) { - case 14: - if (getNoopElimination() - != other.getNoopElimination()) return false; - break; - case 0: - default: - } - if (!getOptionalParallelBatchCase().equals(other.getOptionalParallelBatchCase())) return false; - switch (optionalParallelBatchCase_) { - case 15: - if (getParallelBatch() - != other.getParallelBatch()) return false; - break; - case 0: - default: - } - if (!getOptionalShuffleAndRepeatFusionCase().equals(other.getOptionalShuffleAndRepeatFusionCase())) return false; - switch (optionalShuffleAndRepeatFusionCase_) { - case 17: - if (getShuffleAndRepeatFusion() - != other.getShuffleAndRepeatFusion()) return false; - break; - case 0: - default: - } - 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(); - switch (optionalApplyDefaultOptimizationsCase_) { - case 1: - hash = (37 * hash) + APPLY_DEFAULT_OPTIMIZATIONS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getApplyDefaultOptimizations()); - break; - case 0: - default: - } - switch (optionalAutotuneCase_) { - case 2: - hash = (37 * hash) + AUTOTUNE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAutotune()); - break; - case 0: - default: - } - switch (optionalAutotuneBuffersCase_) { - case 3: - hash = (37 * hash) + AUTOTUNE_BUFFERS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAutotuneBuffers()); - break; - case 0: - default: - } - switch (optionalAutotuneCpuBudgetCase_) { - case 4: - hash = (37 * hash) + AUTOTUNE_CPU_BUDGET_FIELD_NUMBER; - hash = (53 * hash) + getAutotuneCpuBudget(); - break; - case 0: - default: - } - switch (optionalAutotuneRamBudgetCase_) { - case 5: - hash = (37 * hash) + AUTOTUNE_RAM_BUDGET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAutotuneRamBudget()); - break; - case 0: - default: - } - switch (optionalFilterFusionCase_) { - case 6: - hash = (37 * hash) + FILTER_FUSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFilterFusion()); - break; - case 0: - default: - } - switch (optionalMapAndBatchFusionCase_) { - case 9: - hash = (37 * hash) + MAP_AND_BATCH_FUSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMapAndBatchFusion()); - break; - case 0: - default: - } - switch (optionalMapAndFilterFusionCase_) { - case 10: - hash = (37 * hash) + MAP_AND_FILTER_FUSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMapAndFilterFusion()); - break; - case 0: - default: - } - switch (optionalMapFusionCase_) { - case 11: - hash = (37 * hash) + MAP_FUSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMapFusion()); - break; - case 0: - default: - } - switch (optionalMapParallelizationCase_) { - case 12: - hash = (37 * hash) + MAP_PARALLELIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getMapParallelization()); - break; - case 0: - default: - } - switch (optionalNoopEliminationCase_) { - case 14: - hash = (37 * hash) + NOOP_ELIMINATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNoopElimination()); - break; - case 0: - default: - } - switch (optionalParallelBatchCase_) { - case 15: - hash = (37 * hash) + PARALLEL_BATCH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getParallelBatch()); - break; - case 0: - default: - } - switch (optionalShuffleAndRepeatFusionCase_) { - case 17: - hash = (37 * hash) + SHUFFLE_AND_REPEAT_FUSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getShuffleAndRepeatFusion()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.OptimizationOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.OptimizationOptions 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.OptimizationOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.OptimizationOptions 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.OptimizationOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.OptimizationOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.OptimizationOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.OptimizationOptions 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.OptimizationOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.OptimizationOptions 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.OptimizationOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.OptimizationOptions 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.OptimizationOptions 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.data.OptimizationOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.OptimizationOptions) - org.tensorflow.proto.data.OptimizationOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_OptimizationOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.OptimizationOptions.class, org.tensorflow.proto.data.OptimizationOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.data.OptimizationOptions.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(); - optionalApplyDefaultOptimizationsCase_ = 0; - optionalApplyDefaultOptimizations_ = null; - optionalAutotuneCase_ = 0; - optionalAutotune_ = null; - optionalAutotuneBuffersCase_ = 0; - optionalAutotuneBuffers_ = null; - optionalAutotuneCpuBudgetCase_ = 0; - optionalAutotuneCpuBudget_ = null; - optionalAutotuneRamBudgetCase_ = 0; - optionalAutotuneRamBudget_ = null; - optionalFilterFusionCase_ = 0; - optionalFilterFusion_ = null; - optionalMapAndBatchFusionCase_ = 0; - optionalMapAndBatchFusion_ = null; - optionalMapAndFilterFusionCase_ = 0; - optionalMapAndFilterFusion_ = null; - optionalMapFusionCase_ = 0; - optionalMapFusion_ = null; - optionalMapParallelizationCase_ = 0; - optionalMapParallelization_ = null; - optionalNoopEliminationCase_ = 0; - optionalNoopElimination_ = null; - optionalParallelBatchCase_ = 0; - optionalParallelBatch_ = null; - optionalShuffleAndRepeatFusionCase_ = 0; - optionalShuffleAndRepeatFusion_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_OptimizationOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.OptimizationOptions getDefaultInstanceForType() { - return org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.OptimizationOptions build() { - org.tensorflow.proto.data.OptimizationOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.OptimizationOptions buildPartial() { - org.tensorflow.proto.data.OptimizationOptions result = new org.tensorflow.proto.data.OptimizationOptions(this); - if (optionalApplyDefaultOptimizationsCase_ == 1) { - result.optionalApplyDefaultOptimizations_ = optionalApplyDefaultOptimizations_; - } - if (optionalAutotuneCase_ == 2) { - result.optionalAutotune_ = optionalAutotune_; - } - if (optionalAutotuneBuffersCase_ == 3) { - result.optionalAutotuneBuffers_ = optionalAutotuneBuffers_; - } - if (optionalAutotuneCpuBudgetCase_ == 4) { - result.optionalAutotuneCpuBudget_ = optionalAutotuneCpuBudget_; - } - if (optionalAutotuneRamBudgetCase_ == 5) { - result.optionalAutotuneRamBudget_ = optionalAutotuneRamBudget_; - } - if (optionalFilterFusionCase_ == 6) { - result.optionalFilterFusion_ = optionalFilterFusion_; - } - if (optionalMapAndBatchFusionCase_ == 9) { - result.optionalMapAndBatchFusion_ = optionalMapAndBatchFusion_; - } - if (optionalMapAndFilterFusionCase_ == 10) { - result.optionalMapAndFilterFusion_ = optionalMapAndFilterFusion_; - } - if (optionalMapFusionCase_ == 11) { - result.optionalMapFusion_ = optionalMapFusion_; - } - if (optionalMapParallelizationCase_ == 12) { - result.optionalMapParallelization_ = optionalMapParallelization_; - } - if (optionalNoopEliminationCase_ == 14) { - result.optionalNoopElimination_ = optionalNoopElimination_; - } - if (optionalParallelBatchCase_ == 15) { - result.optionalParallelBatch_ = optionalParallelBatch_; - } - if (optionalShuffleAndRepeatFusionCase_ == 17) { - result.optionalShuffleAndRepeatFusion_ = optionalShuffleAndRepeatFusion_; - } - result.optionalApplyDefaultOptimizationsCase_ = optionalApplyDefaultOptimizationsCase_; - result.optionalAutotuneCase_ = optionalAutotuneCase_; - result.optionalAutotuneBuffersCase_ = optionalAutotuneBuffersCase_; - result.optionalAutotuneCpuBudgetCase_ = optionalAutotuneCpuBudgetCase_; - result.optionalAutotuneRamBudgetCase_ = optionalAutotuneRamBudgetCase_; - result.optionalFilterFusionCase_ = optionalFilterFusionCase_; - result.optionalMapAndBatchFusionCase_ = optionalMapAndBatchFusionCase_; - result.optionalMapAndFilterFusionCase_ = optionalMapAndFilterFusionCase_; - result.optionalMapFusionCase_ = optionalMapFusionCase_; - result.optionalMapParallelizationCase_ = optionalMapParallelizationCase_; - result.optionalNoopEliminationCase_ = optionalNoopEliminationCase_; - result.optionalParallelBatchCase_ = optionalParallelBatchCase_; - result.optionalShuffleAndRepeatFusionCase_ = optionalShuffleAndRepeatFusionCase_; - 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.OptimizationOptions) { - return mergeFrom((org.tensorflow.proto.data.OptimizationOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.OptimizationOptions other) { - if (other == org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance()) return this; - switch (other.getOptionalApplyDefaultOptimizationsCase()) { - case APPLY_DEFAULT_OPTIMIZATIONS: { - setApplyDefaultOptimizations(other.getApplyDefaultOptimizations()); - break; - } - case OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET: { - break; - } - } - switch (other.getOptionalAutotuneCase()) { - case AUTOTUNE: { - setAutotune(other.getAutotune()); - break; - } - case OPTIONALAUTOTUNE_NOT_SET: { - break; - } - } - switch (other.getOptionalAutotuneBuffersCase()) { - case AUTOTUNE_BUFFERS: { - setAutotuneBuffers(other.getAutotuneBuffers()); - break; - } - case OPTIONALAUTOTUNEBUFFERS_NOT_SET: { - break; - } - } - switch (other.getOptionalAutotuneCpuBudgetCase()) { - case AUTOTUNE_CPU_BUDGET: { - setAutotuneCpuBudget(other.getAutotuneCpuBudget()); - break; - } - case OPTIONALAUTOTUNECPUBUDGET_NOT_SET: { - break; - } - } - switch (other.getOptionalAutotuneRamBudgetCase()) { - case AUTOTUNE_RAM_BUDGET: { - setAutotuneRamBudget(other.getAutotuneRamBudget()); - break; - } - case OPTIONALAUTOTUNERAMBUDGET_NOT_SET: { - break; - } - } - switch (other.getOptionalFilterFusionCase()) { - case FILTER_FUSION: { - setFilterFusion(other.getFilterFusion()); - break; - } - case OPTIONALFILTERFUSION_NOT_SET: { - break; - } - } - switch (other.getOptionalMapAndBatchFusionCase()) { - case MAP_AND_BATCH_FUSION: { - setMapAndBatchFusion(other.getMapAndBatchFusion()); - break; - } - case OPTIONALMAPANDBATCHFUSION_NOT_SET: { - break; - } - } - switch (other.getOptionalMapAndFilterFusionCase()) { - case MAP_AND_FILTER_FUSION: { - setMapAndFilterFusion(other.getMapAndFilterFusion()); - break; - } - case OPTIONALMAPANDFILTERFUSION_NOT_SET: { - break; - } - } - switch (other.getOptionalMapFusionCase()) { - case MAP_FUSION: { - setMapFusion(other.getMapFusion()); - break; - } - case OPTIONALMAPFUSION_NOT_SET: { - break; - } - } - switch (other.getOptionalMapParallelizationCase()) { - case MAP_PARALLELIZATION: { - setMapParallelization(other.getMapParallelization()); - break; - } - case OPTIONALMAPPARALLELIZATION_NOT_SET: { - break; - } - } - switch (other.getOptionalNoopEliminationCase()) { - case NOOP_ELIMINATION: { - setNoopElimination(other.getNoopElimination()); - break; - } - case OPTIONALNOOPELIMINATION_NOT_SET: { - break; - } - } - switch (other.getOptionalParallelBatchCase()) { - case PARALLEL_BATCH: { - setParallelBatch(other.getParallelBatch()); - break; - } - case OPTIONALPARALLELBATCH_NOT_SET: { - break; - } - } - switch (other.getOptionalShuffleAndRepeatFusionCase()) { - case SHUFFLE_AND_REPEAT_FUSION: { - setShuffleAndRepeatFusion(other.getShuffleAndRepeatFusion()); - break; - } - case OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET: { - break; - } - } - 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.OptimizationOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.OptimizationOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int optionalApplyDefaultOptimizationsCase_ = 0; - private java.lang.Object optionalApplyDefaultOptimizations_; - public OptionalApplyDefaultOptimizationsCase - getOptionalApplyDefaultOptimizationsCase() { - return OptionalApplyDefaultOptimizationsCase.forNumber( - optionalApplyDefaultOptimizationsCase_); - } - - public Builder clearOptionalApplyDefaultOptimizations() { - optionalApplyDefaultOptimizationsCase_ = 0; - optionalApplyDefaultOptimizations_ = null; - onChanged(); - return this; - } - - private int optionalAutotuneCase_ = 0; - private java.lang.Object optionalAutotune_; - public OptionalAutotuneCase - getOptionalAutotuneCase() { - return OptionalAutotuneCase.forNumber( - optionalAutotuneCase_); - } - - public Builder clearOptionalAutotune() { - optionalAutotuneCase_ = 0; - optionalAutotune_ = null; - onChanged(); - return this; - } - - private int optionalAutotuneBuffersCase_ = 0; - private java.lang.Object optionalAutotuneBuffers_; - public OptionalAutotuneBuffersCase - getOptionalAutotuneBuffersCase() { - return OptionalAutotuneBuffersCase.forNumber( - optionalAutotuneBuffersCase_); - } - - public Builder clearOptionalAutotuneBuffers() { - optionalAutotuneBuffersCase_ = 0; - optionalAutotuneBuffers_ = null; - onChanged(); - return this; - } - - private int optionalAutotuneCpuBudgetCase_ = 0; - private java.lang.Object optionalAutotuneCpuBudget_; - public OptionalAutotuneCpuBudgetCase - getOptionalAutotuneCpuBudgetCase() { - return OptionalAutotuneCpuBudgetCase.forNumber( - optionalAutotuneCpuBudgetCase_); - } - - public Builder clearOptionalAutotuneCpuBudget() { - optionalAutotuneCpuBudgetCase_ = 0; - optionalAutotuneCpuBudget_ = null; - onChanged(); - return this; - } - - private int optionalAutotuneRamBudgetCase_ = 0; - private java.lang.Object optionalAutotuneRamBudget_; - public OptionalAutotuneRamBudgetCase - getOptionalAutotuneRamBudgetCase() { - return OptionalAutotuneRamBudgetCase.forNumber( - optionalAutotuneRamBudgetCase_); - } - - public Builder clearOptionalAutotuneRamBudget() { - optionalAutotuneRamBudgetCase_ = 0; - optionalAutotuneRamBudget_ = null; - onChanged(); - return this; - } - - private int optionalFilterFusionCase_ = 0; - private java.lang.Object optionalFilterFusion_; - public OptionalFilterFusionCase - getOptionalFilterFusionCase() { - return OptionalFilterFusionCase.forNumber( - optionalFilterFusionCase_); - } - - public Builder clearOptionalFilterFusion() { - optionalFilterFusionCase_ = 0; - optionalFilterFusion_ = null; - onChanged(); - return this; - } - - private int optionalMapAndBatchFusionCase_ = 0; - private java.lang.Object optionalMapAndBatchFusion_; - public OptionalMapAndBatchFusionCase - getOptionalMapAndBatchFusionCase() { - return OptionalMapAndBatchFusionCase.forNumber( - optionalMapAndBatchFusionCase_); - } - - public Builder clearOptionalMapAndBatchFusion() { - optionalMapAndBatchFusionCase_ = 0; - optionalMapAndBatchFusion_ = null; - onChanged(); - return this; - } - - private int optionalMapAndFilterFusionCase_ = 0; - private java.lang.Object optionalMapAndFilterFusion_; - public OptionalMapAndFilterFusionCase - getOptionalMapAndFilterFusionCase() { - return OptionalMapAndFilterFusionCase.forNumber( - optionalMapAndFilterFusionCase_); - } - - public Builder clearOptionalMapAndFilterFusion() { - optionalMapAndFilterFusionCase_ = 0; - optionalMapAndFilterFusion_ = null; - onChanged(); - return this; - } - - private int optionalMapFusionCase_ = 0; - private java.lang.Object optionalMapFusion_; - public OptionalMapFusionCase - getOptionalMapFusionCase() { - return OptionalMapFusionCase.forNumber( - optionalMapFusionCase_); - } - - public Builder clearOptionalMapFusion() { - optionalMapFusionCase_ = 0; - optionalMapFusion_ = null; - onChanged(); - return this; - } - - private int optionalMapParallelizationCase_ = 0; - private java.lang.Object optionalMapParallelization_; - public OptionalMapParallelizationCase - getOptionalMapParallelizationCase() { - return OptionalMapParallelizationCase.forNumber( - optionalMapParallelizationCase_); - } - - public Builder clearOptionalMapParallelization() { - optionalMapParallelizationCase_ = 0; - optionalMapParallelization_ = null; - onChanged(); - return this; - } - - private int optionalNoopEliminationCase_ = 0; - private java.lang.Object optionalNoopElimination_; - public OptionalNoopEliminationCase - getOptionalNoopEliminationCase() { - return OptionalNoopEliminationCase.forNumber( - optionalNoopEliminationCase_); - } - - public Builder clearOptionalNoopElimination() { - optionalNoopEliminationCase_ = 0; - optionalNoopElimination_ = null; - onChanged(); - return this; - } - - private int optionalParallelBatchCase_ = 0; - private java.lang.Object optionalParallelBatch_; - public OptionalParallelBatchCase - getOptionalParallelBatchCase() { - return OptionalParallelBatchCase.forNumber( - optionalParallelBatchCase_); - } - - public Builder clearOptionalParallelBatch() { - optionalParallelBatchCase_ = 0; - optionalParallelBatch_ = null; - onChanged(); - return this; - } - - private int optionalShuffleAndRepeatFusionCase_ = 0; - private java.lang.Object optionalShuffleAndRepeatFusion_; - public OptionalShuffleAndRepeatFusionCase - getOptionalShuffleAndRepeatFusionCase() { - return OptionalShuffleAndRepeatFusionCase.forNumber( - optionalShuffleAndRepeatFusionCase_); - } - - public Builder clearOptionalShuffleAndRepeatFusion() { - optionalShuffleAndRepeatFusionCase_ = 0; - optionalShuffleAndRepeatFusion_ = null; - onChanged(); - return this; - } - - - /** - * bool apply_default_optimizations = 1; - */ - public boolean getApplyDefaultOptimizations() { - if (optionalApplyDefaultOptimizationsCase_ == 1) { - return (java.lang.Boolean) optionalApplyDefaultOptimizations_; - } - return false; - } - /** - * bool apply_default_optimizations = 1; - */ - public Builder setApplyDefaultOptimizations(boolean value) { - optionalApplyDefaultOptimizationsCase_ = 1; - optionalApplyDefaultOptimizations_ = value; - onChanged(); - return this; - } - /** - * bool apply_default_optimizations = 1; - */ - public Builder clearApplyDefaultOptimizations() { - if (optionalApplyDefaultOptimizationsCase_ == 1) { - optionalApplyDefaultOptimizationsCase_ = 0; - optionalApplyDefaultOptimizations_ = null; - onChanged(); - } - return this; - } - - /** - * bool autotune = 2; - */ - public boolean getAutotune() { - if (optionalAutotuneCase_ == 2) { - return (java.lang.Boolean) optionalAutotune_; - } - return false; - } - /** - * bool autotune = 2; - */ - public Builder setAutotune(boolean value) { - optionalAutotuneCase_ = 2; - optionalAutotune_ = value; - onChanged(); - return this; - } - /** - * bool autotune = 2; - */ - public Builder clearAutotune() { - if (optionalAutotuneCase_ == 2) { - optionalAutotuneCase_ = 0; - optionalAutotune_ = null; - onChanged(); - } - return this; - } - - /** - * bool autotune_buffers = 3; - */ - public boolean getAutotuneBuffers() { - if (optionalAutotuneBuffersCase_ == 3) { - return (java.lang.Boolean) optionalAutotuneBuffers_; - } - return false; - } - /** - * bool autotune_buffers = 3; - */ - public Builder setAutotuneBuffers(boolean value) { - optionalAutotuneBuffersCase_ = 3; - optionalAutotuneBuffers_ = value; - onChanged(); - return this; - } - /** - * bool autotune_buffers = 3; - */ - public Builder clearAutotuneBuffers() { - if (optionalAutotuneBuffersCase_ == 3) { - optionalAutotuneBuffersCase_ = 0; - optionalAutotuneBuffers_ = null; - onChanged(); - } - return this; - } - - /** - * int32 autotune_cpu_budget = 4; - */ - public int getAutotuneCpuBudget() { - if (optionalAutotuneCpuBudgetCase_ == 4) { - return (java.lang.Integer) optionalAutotuneCpuBudget_; - } - return 0; - } - /** - * int32 autotune_cpu_budget = 4; - */ - public Builder setAutotuneCpuBudget(int value) { - optionalAutotuneCpuBudgetCase_ = 4; - optionalAutotuneCpuBudget_ = value; - onChanged(); - return this; - } - /** - * int32 autotune_cpu_budget = 4; - */ - public Builder clearAutotuneCpuBudget() { - if (optionalAutotuneCpuBudgetCase_ == 4) { - optionalAutotuneCpuBudgetCase_ = 0; - optionalAutotuneCpuBudget_ = null; - onChanged(); - } - return this; - } - - /** - * int64 autotune_ram_budget = 5; - */ - public long getAutotuneRamBudget() { - if (optionalAutotuneRamBudgetCase_ == 5) { - return (java.lang.Long) optionalAutotuneRamBudget_; - } - return 0L; - } - /** - * int64 autotune_ram_budget = 5; - */ - public Builder setAutotuneRamBudget(long value) { - optionalAutotuneRamBudgetCase_ = 5; - optionalAutotuneRamBudget_ = value; - onChanged(); - return this; - } - /** - * int64 autotune_ram_budget = 5; - */ - public Builder clearAutotuneRamBudget() { - if (optionalAutotuneRamBudgetCase_ == 5) { - optionalAutotuneRamBudgetCase_ = 0; - optionalAutotuneRamBudget_ = null; - onChanged(); - } - return this; - } - - /** - * bool filter_fusion = 6; - */ - public boolean getFilterFusion() { - if (optionalFilterFusionCase_ == 6) { - return (java.lang.Boolean) optionalFilterFusion_; - } - return false; - } - /** - * bool filter_fusion = 6; - */ - public Builder setFilterFusion(boolean value) { - optionalFilterFusionCase_ = 6; - optionalFilterFusion_ = value; - onChanged(); - return this; - } - /** - * bool filter_fusion = 6; - */ - public Builder clearFilterFusion() { - if (optionalFilterFusionCase_ == 6) { - optionalFilterFusionCase_ = 0; - optionalFilterFusion_ = null; - onChanged(); - } - return this; - } - - /** - * bool map_and_batch_fusion = 9; - */ - public boolean getMapAndBatchFusion() { - if (optionalMapAndBatchFusionCase_ == 9) { - return (java.lang.Boolean) optionalMapAndBatchFusion_; - } - return false; - } - /** - * bool map_and_batch_fusion = 9; - */ - public Builder setMapAndBatchFusion(boolean value) { - optionalMapAndBatchFusionCase_ = 9; - optionalMapAndBatchFusion_ = value; - onChanged(); - return this; - } - /** - * bool map_and_batch_fusion = 9; - */ - public Builder clearMapAndBatchFusion() { - if (optionalMapAndBatchFusionCase_ == 9) { - optionalMapAndBatchFusionCase_ = 0; - optionalMapAndBatchFusion_ = null; - onChanged(); - } - return this; - } - - /** - * bool map_and_filter_fusion = 10; - */ - public boolean getMapAndFilterFusion() { - if (optionalMapAndFilterFusionCase_ == 10) { - return (java.lang.Boolean) optionalMapAndFilterFusion_; - } - return false; - } - /** - * bool map_and_filter_fusion = 10; - */ - public Builder setMapAndFilterFusion(boolean value) { - optionalMapAndFilterFusionCase_ = 10; - optionalMapAndFilterFusion_ = value; - onChanged(); - return this; - } - /** - * bool map_and_filter_fusion = 10; - */ - public Builder clearMapAndFilterFusion() { - if (optionalMapAndFilterFusionCase_ == 10) { - optionalMapAndFilterFusionCase_ = 0; - optionalMapAndFilterFusion_ = null; - onChanged(); - } - return this; - } - - /** - * bool map_fusion = 11; - */ - public boolean getMapFusion() { - if (optionalMapFusionCase_ == 11) { - return (java.lang.Boolean) optionalMapFusion_; - } - return false; - } - /** - * bool map_fusion = 11; - */ - public Builder setMapFusion(boolean value) { - optionalMapFusionCase_ = 11; - optionalMapFusion_ = value; - onChanged(); - return this; - } - /** - * bool map_fusion = 11; - */ - public Builder clearMapFusion() { - if (optionalMapFusionCase_ == 11) { - optionalMapFusionCase_ = 0; - optionalMapFusion_ = null; - onChanged(); - } - return this; - } - - /** - * bool map_parallelization = 12; - */ - public boolean getMapParallelization() { - if (optionalMapParallelizationCase_ == 12) { - return (java.lang.Boolean) optionalMapParallelization_; - } - return false; - } - /** - * bool map_parallelization = 12; - */ - public Builder setMapParallelization(boolean value) { - optionalMapParallelizationCase_ = 12; - optionalMapParallelization_ = value; - onChanged(); - return this; - } - /** - * bool map_parallelization = 12; - */ - public Builder clearMapParallelization() { - if (optionalMapParallelizationCase_ == 12) { - optionalMapParallelizationCase_ = 0; - optionalMapParallelization_ = null; - onChanged(); - } - return this; - } - - /** - * bool noop_elimination = 14; - */ - public boolean getNoopElimination() { - if (optionalNoopEliminationCase_ == 14) { - return (java.lang.Boolean) optionalNoopElimination_; - } - return false; - } - /** - * bool noop_elimination = 14; - */ - public Builder setNoopElimination(boolean value) { - optionalNoopEliminationCase_ = 14; - optionalNoopElimination_ = value; - onChanged(); - return this; - } - /** - * bool noop_elimination = 14; - */ - public Builder clearNoopElimination() { - if (optionalNoopEliminationCase_ == 14) { - optionalNoopEliminationCase_ = 0; - optionalNoopElimination_ = null; - onChanged(); - } - return this; - } - - /** - * bool parallel_batch = 15; - */ - public boolean getParallelBatch() { - if (optionalParallelBatchCase_ == 15) { - return (java.lang.Boolean) optionalParallelBatch_; - } - return false; - } - /** - * bool parallel_batch = 15; - */ - public Builder setParallelBatch(boolean value) { - optionalParallelBatchCase_ = 15; - optionalParallelBatch_ = value; - onChanged(); - return this; - } - /** - * bool parallel_batch = 15; - */ - public Builder clearParallelBatch() { - if (optionalParallelBatchCase_ == 15) { - optionalParallelBatchCase_ = 0; - optionalParallelBatch_ = null; - onChanged(); - } - return this; - } - - /** - * bool shuffle_and_repeat_fusion = 17; - */ - public boolean getShuffleAndRepeatFusion() { - if (optionalShuffleAndRepeatFusionCase_ == 17) { - return (java.lang.Boolean) optionalShuffleAndRepeatFusion_; - } - return false; - } - /** - * bool shuffle_and_repeat_fusion = 17; - */ - public Builder setShuffleAndRepeatFusion(boolean value) { - optionalShuffleAndRepeatFusionCase_ = 17; - optionalShuffleAndRepeatFusion_ = value; - onChanged(); - return this; - } - /** - * bool shuffle_and_repeat_fusion = 17; - */ - public Builder clearShuffleAndRepeatFusion() { - if (optionalShuffleAndRepeatFusionCase_ == 17) { - optionalShuffleAndRepeatFusionCase_ = 0; - optionalShuffleAndRepeatFusion_ = null; - 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.OptimizationOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.OptimizationOptions) - private static final org.tensorflow.proto.data.OptimizationOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.OptimizationOptions(); - } - - public static org.tensorflow.proto.data.OptimizationOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OptimizationOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OptimizationOptions(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.OptimizationOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptionsOrBuilder.java deleted file mode 100644 index ac861c4710b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptimizationOptionsOrBuilder.java +++ /dev/null @@ -1,100 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -public interface OptimizationOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.OptimizationOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * bool apply_default_optimizations = 1; - */ - boolean getApplyDefaultOptimizations(); - - /** - * bool autotune = 2; - */ - boolean getAutotune(); - - /** - * bool autotune_buffers = 3; - */ - boolean getAutotuneBuffers(); - - /** - * int32 autotune_cpu_budget = 4; - */ - int getAutotuneCpuBudget(); - - /** - * int64 autotune_ram_budget = 5; - */ - long getAutotuneRamBudget(); - - /** - * bool filter_fusion = 6; - */ - boolean getFilterFusion(); - - /** - * bool map_and_batch_fusion = 9; - */ - boolean getMapAndBatchFusion(); - - /** - * bool map_and_filter_fusion = 10; - */ - boolean getMapAndFilterFusion(); - - /** - * bool map_fusion = 11; - */ - boolean getMapFusion(); - - /** - * bool map_parallelization = 12; - */ - boolean getMapParallelization(); - - /** - * bool noop_elimination = 14; - */ - boolean getNoopElimination(); - - /** - * bool parallel_batch = 15; - */ - boolean getParallelBatch(); - - /** - * bool shuffle_and_repeat_fusion = 17; - */ - boolean getShuffleAndRepeatFusion(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalApplyDefaultOptimizationsCase getOptionalApplyDefaultOptimizationsCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalAutotuneCase getOptionalAutotuneCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalAutotuneBuffersCase getOptionalAutotuneBuffersCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalAutotuneCpuBudgetCase getOptionalAutotuneCpuBudgetCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalAutotuneRamBudgetCase getOptionalAutotuneRamBudgetCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalFilterFusionCase getOptionalFilterFusionCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalMapAndBatchFusionCase getOptionalMapAndBatchFusionCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalMapAndFilterFusionCase getOptionalMapAndFilterFusionCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalMapFusionCase getOptionalMapFusionCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalMapParallelizationCase getOptionalMapParallelizationCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalNoopEliminationCase getOptionalNoopEliminationCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalParallelBatchCase getOptionalParallelBatchCase(); - - public org.tensorflow.proto.data.OptimizationOptions.OptionalShuffleAndRepeatFusionCase getOptionalShuffleAndRepeatFusionCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/Options.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/Options.java deleted file mode 100644 index b0b8481e67b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/Options.java +++ /dev/null @@ -1,1567 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - *
    - * Message stored with Dataset objects to control how datasets are processed and
    - * optimized.
    - * 
    - * - * Protobuf type {@code tensorflow.data.Options} - */ -public final class Options extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.Options) - OptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use Options.newBuilder() to construct. - private Options(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Options() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Options(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Options( - 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: { - optionalDeterministicCase_ = 1; - optionalDeterministic_ = input.readBool(); - break; - } - case 18: { - org.tensorflow.proto.data.DistributeOptions.Builder subBuilder = null; - if (distributeOptions_ != null) { - subBuilder = distributeOptions_.toBuilder(); - } - distributeOptions_ = input.readMessage(org.tensorflow.proto.data.DistributeOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(distributeOptions_); - distributeOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.data.OptimizationOptions.Builder subBuilder = null; - if (optimizationOptions_ != null) { - subBuilder = optimizationOptions_.toBuilder(); - } - optimizationOptions_ = input.readMessage(org.tensorflow.proto.data.OptimizationOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(optimizationOptions_); - optimizationOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 32: { - optionalSlackCase_ = 4; - optionalSlack_ = input.readBool(); - break; - } - case 42: { - org.tensorflow.proto.data.ThreadingOptions.Builder subBuilder = null; - if (threadingOptions_ != null) { - subBuilder = threadingOptions_.toBuilder(); - } - threadingOptions_ = input.readMessage(org.tensorflow.proto.data.ThreadingOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(threadingOptions_); - threadingOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 48: { - int rawValue = input.readEnum(); - optionalExternalStatePolicyCase_ = 6; - optionalExternalStatePolicy_ = rawValue; - 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.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.Options.class, org.tensorflow.proto.data.Options.Builder.class); - } - - private int optionalDeterministicCase_ = 0; - private java.lang.Object optionalDeterministic_; - public enum OptionalDeterministicCase - implements com.google.protobuf.Internal.EnumLite { - DETERMINISTIC(1), - OPTIONALDETERMINISTIC_NOT_SET(0); - private final int value; - private OptionalDeterministicCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalDeterministicCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalDeterministicCase forNumber(int value) { - switch (value) { - case 1: return DETERMINISTIC; - case 0: return OPTIONALDETERMINISTIC_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalDeterministicCase - getOptionalDeterministicCase() { - return OptionalDeterministicCase.forNumber( - optionalDeterministicCase_); - } - - private int optionalSlackCase_ = 0; - private java.lang.Object optionalSlack_; - public enum OptionalSlackCase - implements com.google.protobuf.Internal.EnumLite { - SLACK(4), - OPTIONALSLACK_NOT_SET(0); - private final int value; - private OptionalSlackCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalSlackCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalSlackCase forNumber(int value) { - switch (value) { - case 4: return SLACK; - case 0: return OPTIONALSLACK_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalSlackCase - getOptionalSlackCase() { - return OptionalSlackCase.forNumber( - optionalSlackCase_); - } - - private int optionalExternalStatePolicyCase_ = 0; - private java.lang.Object optionalExternalStatePolicy_; - public enum OptionalExternalStatePolicyCase - implements com.google.protobuf.Internal.EnumLite { - EXTERNAL_STATE_POLICY(6), - OPTIONALEXTERNALSTATEPOLICY_NOT_SET(0); - private final int value; - private OptionalExternalStatePolicyCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalExternalStatePolicyCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalExternalStatePolicyCase forNumber(int value) { - switch (value) { - case 6: return EXTERNAL_STATE_POLICY; - case 0: return OPTIONALEXTERNALSTATEPOLICY_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalExternalStatePolicyCase - getOptionalExternalStatePolicyCase() { - return OptionalExternalStatePolicyCase.forNumber( - optionalExternalStatePolicyCase_); - } - - public static final int DETERMINISTIC_FIELD_NUMBER = 1; - /** - * bool deterministic = 1; - */ - public boolean getDeterministic() { - if (optionalDeterministicCase_ == 1) { - return (java.lang.Boolean) optionalDeterministic_; - } - return false; - } - - public static final int DISTRIBUTE_OPTIONS_FIELD_NUMBER = 2; - private org.tensorflow.proto.data.DistributeOptions distributeOptions_; - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public boolean hasDistributeOptions() { - return distributeOptions_ != null; - } - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public org.tensorflow.proto.data.DistributeOptions getDistributeOptions() { - return distributeOptions_ == null ? org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_; - } - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public org.tensorflow.proto.data.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() { - return getDistributeOptions(); - } - - public static final int OPTIMIZATION_OPTIONS_FIELD_NUMBER = 3; - private org.tensorflow.proto.data.OptimizationOptions optimizationOptions_; - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public boolean hasOptimizationOptions() { - return optimizationOptions_ != null; - } - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public org.tensorflow.proto.data.OptimizationOptions getOptimizationOptions() { - return optimizationOptions_ == null ? org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_; - } - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public org.tensorflow.proto.data.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() { - return getOptimizationOptions(); - } - - public static final int SLACK_FIELD_NUMBER = 4; - /** - * bool slack = 4; - */ - public boolean getSlack() { - if (optionalSlackCase_ == 4) { - return (java.lang.Boolean) optionalSlack_; - } - return false; - } - - public static final int THREADING_OPTIONS_FIELD_NUMBER = 5; - private org.tensorflow.proto.data.ThreadingOptions threadingOptions_; - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public boolean hasThreadingOptions() { - return threadingOptions_ != null; - } - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public org.tensorflow.proto.data.ThreadingOptions getThreadingOptions() { - return threadingOptions_ == null ? org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_; - } - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public org.tensorflow.proto.data.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() { - return getThreadingOptions(); - } - - public static final int EXTERNAL_STATE_POLICY_FIELD_NUMBER = 6; - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public int getExternalStatePolicyValue() { - if (optionalExternalStatePolicyCase_ == 6) { - return (java.lang.Integer) optionalExternalStatePolicy_; - } - return 0; - } - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public org.tensorflow.proto.data.ExternalStatePolicy getExternalStatePolicy() { - if (optionalExternalStatePolicyCase_ == 6) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.ExternalStatePolicy result = org.tensorflow.proto.data.ExternalStatePolicy.valueOf( - (java.lang.Integer) optionalExternalStatePolicy_); - return result == null ? org.tensorflow.proto.data.ExternalStatePolicy.UNRECOGNIZED : result; - } - return org.tensorflow.proto.data.ExternalStatePolicy.POLICY_WARN; - } - - 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 (optionalDeterministicCase_ == 1) { - output.writeBool( - 1, (boolean)((java.lang.Boolean) optionalDeterministic_)); - } - if (distributeOptions_ != null) { - output.writeMessage(2, getDistributeOptions()); - } - if (optimizationOptions_ != null) { - output.writeMessage(3, getOptimizationOptions()); - } - if (optionalSlackCase_ == 4) { - output.writeBool( - 4, (boolean)((java.lang.Boolean) optionalSlack_)); - } - if (threadingOptions_ != null) { - output.writeMessage(5, getThreadingOptions()); - } - if (optionalExternalStatePolicyCase_ == 6) { - output.writeEnum(6, ((java.lang.Integer) optionalExternalStatePolicy_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (optionalDeterministicCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 1, (boolean)((java.lang.Boolean) optionalDeterministic_)); - } - if (distributeOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDistributeOptions()); - } - if (optimizationOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getOptimizationOptions()); - } - if (optionalSlackCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 4, (boolean)((java.lang.Boolean) optionalSlack_)); - } - if (threadingOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getThreadingOptions()); - } - if (optionalExternalStatePolicyCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, ((java.lang.Integer) optionalExternalStatePolicy_)); - } - 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.Options)) { - return super.equals(obj); - } - org.tensorflow.proto.data.Options other = (org.tensorflow.proto.data.Options) obj; - - if (hasDistributeOptions() != other.hasDistributeOptions()) return false; - if (hasDistributeOptions()) { - if (!getDistributeOptions() - .equals(other.getDistributeOptions())) return false; - } - if (hasOptimizationOptions() != other.hasOptimizationOptions()) return false; - if (hasOptimizationOptions()) { - if (!getOptimizationOptions() - .equals(other.getOptimizationOptions())) return false; - } - if (hasThreadingOptions() != other.hasThreadingOptions()) return false; - if (hasThreadingOptions()) { - if (!getThreadingOptions() - .equals(other.getThreadingOptions())) return false; - } - if (!getOptionalDeterministicCase().equals(other.getOptionalDeterministicCase())) return false; - switch (optionalDeterministicCase_) { - case 1: - if (getDeterministic() - != other.getDeterministic()) return false; - break; - case 0: - default: - } - if (!getOptionalSlackCase().equals(other.getOptionalSlackCase())) return false; - switch (optionalSlackCase_) { - case 4: - if (getSlack() - != other.getSlack()) return false; - break; - case 0: - default: - } - if (!getOptionalExternalStatePolicyCase().equals(other.getOptionalExternalStatePolicyCase())) return false; - switch (optionalExternalStatePolicyCase_) { - case 6: - if (getExternalStatePolicyValue() - != other.getExternalStatePolicyValue()) return false; - break; - case 0: - default: - } - 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 (hasDistributeOptions()) { - hash = (37 * hash) + DISTRIBUTE_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getDistributeOptions().hashCode(); - } - if (hasOptimizationOptions()) { - hash = (37 * hash) + OPTIMIZATION_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getOptimizationOptions().hashCode(); - } - if (hasThreadingOptions()) { - hash = (37 * hash) + THREADING_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getThreadingOptions().hashCode(); - } - switch (optionalDeterministicCase_) { - case 1: - hash = (37 * hash) + DETERMINISTIC_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDeterministic()); - break; - case 0: - default: - } - switch (optionalSlackCase_) { - case 4: - hash = (37 * hash) + SLACK_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSlack()); - break; - case 0: - default: - } - switch (optionalExternalStatePolicyCase_) { - case 6: - hash = (37 * hash) + EXTERNAL_STATE_POLICY_FIELD_NUMBER; - hash = (53 * hash) + getExternalStatePolicyValue(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.Options parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.Options 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.Options parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.Options 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.Options parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.Options parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.Options parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.Options 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.Options parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.Options 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.Options parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.Options 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.Options 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; - } - /** - *
    -   * Message stored with Dataset objects to control how datasets are processed and
    -   * optimized.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.Options} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.Options) - org.tensorflow.proto.data.OptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.Options.class, org.tensorflow.proto.data.Options.Builder.class); - } - - // Construct using org.tensorflow.proto.data.Options.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 (distributeOptionsBuilder_ == null) { - distributeOptions_ = null; - } else { - distributeOptions_ = null; - distributeOptionsBuilder_ = null; - } - if (optimizationOptionsBuilder_ == null) { - optimizationOptions_ = null; - } else { - optimizationOptions_ = null; - optimizationOptionsBuilder_ = null; - } - if (threadingOptionsBuilder_ == null) { - threadingOptions_ = null; - } else { - threadingOptions_ = null; - threadingOptionsBuilder_ = null; - } - optionalDeterministicCase_ = 0; - optionalDeterministic_ = null; - optionalSlackCase_ = 0; - optionalSlack_ = null; - optionalExternalStatePolicyCase_ = 0; - optionalExternalStatePolicy_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_Options_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.Options getDefaultInstanceForType() { - return org.tensorflow.proto.data.Options.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.Options build() { - org.tensorflow.proto.data.Options result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.Options buildPartial() { - org.tensorflow.proto.data.Options result = new org.tensorflow.proto.data.Options(this); - if (optionalDeterministicCase_ == 1) { - result.optionalDeterministic_ = optionalDeterministic_; - } - if (distributeOptionsBuilder_ == null) { - result.distributeOptions_ = distributeOptions_; - } else { - result.distributeOptions_ = distributeOptionsBuilder_.build(); - } - if (optimizationOptionsBuilder_ == null) { - result.optimizationOptions_ = optimizationOptions_; - } else { - result.optimizationOptions_ = optimizationOptionsBuilder_.build(); - } - if (optionalSlackCase_ == 4) { - result.optionalSlack_ = optionalSlack_; - } - if (threadingOptionsBuilder_ == null) { - result.threadingOptions_ = threadingOptions_; - } else { - result.threadingOptions_ = threadingOptionsBuilder_.build(); - } - if (optionalExternalStatePolicyCase_ == 6) { - result.optionalExternalStatePolicy_ = optionalExternalStatePolicy_; - } - result.optionalDeterministicCase_ = optionalDeterministicCase_; - result.optionalSlackCase_ = optionalSlackCase_; - result.optionalExternalStatePolicyCase_ = optionalExternalStatePolicyCase_; - 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.Options) { - return mergeFrom((org.tensorflow.proto.data.Options)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.Options other) { - if (other == org.tensorflow.proto.data.Options.getDefaultInstance()) return this; - if (other.hasDistributeOptions()) { - mergeDistributeOptions(other.getDistributeOptions()); - } - if (other.hasOptimizationOptions()) { - mergeOptimizationOptions(other.getOptimizationOptions()); - } - if (other.hasThreadingOptions()) { - mergeThreadingOptions(other.getThreadingOptions()); - } - switch (other.getOptionalDeterministicCase()) { - case DETERMINISTIC: { - setDeterministic(other.getDeterministic()); - break; - } - case OPTIONALDETERMINISTIC_NOT_SET: { - break; - } - } - switch (other.getOptionalSlackCase()) { - case SLACK: { - setSlack(other.getSlack()); - break; - } - case OPTIONALSLACK_NOT_SET: { - break; - } - } - switch (other.getOptionalExternalStatePolicyCase()) { - case EXTERNAL_STATE_POLICY: { - setExternalStatePolicyValue(other.getExternalStatePolicyValue()); - break; - } - case OPTIONALEXTERNALSTATEPOLICY_NOT_SET: { - break; - } - } - 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.Options parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.Options) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int optionalDeterministicCase_ = 0; - private java.lang.Object optionalDeterministic_; - public OptionalDeterministicCase - getOptionalDeterministicCase() { - return OptionalDeterministicCase.forNumber( - optionalDeterministicCase_); - } - - public Builder clearOptionalDeterministic() { - optionalDeterministicCase_ = 0; - optionalDeterministic_ = null; - onChanged(); - return this; - } - - private int optionalSlackCase_ = 0; - private java.lang.Object optionalSlack_; - public OptionalSlackCase - getOptionalSlackCase() { - return OptionalSlackCase.forNumber( - optionalSlackCase_); - } - - public Builder clearOptionalSlack() { - optionalSlackCase_ = 0; - optionalSlack_ = null; - onChanged(); - return this; - } - - private int optionalExternalStatePolicyCase_ = 0; - private java.lang.Object optionalExternalStatePolicy_; - public OptionalExternalStatePolicyCase - getOptionalExternalStatePolicyCase() { - return OptionalExternalStatePolicyCase.forNumber( - optionalExternalStatePolicyCase_); - } - - public Builder clearOptionalExternalStatePolicy() { - optionalExternalStatePolicyCase_ = 0; - optionalExternalStatePolicy_ = null; - onChanged(); - return this; - } - - - /** - * bool deterministic = 1; - */ - public boolean getDeterministic() { - if (optionalDeterministicCase_ == 1) { - return (java.lang.Boolean) optionalDeterministic_; - } - return false; - } - /** - * bool deterministic = 1; - */ - public Builder setDeterministic(boolean value) { - optionalDeterministicCase_ = 1; - optionalDeterministic_ = value; - onChanged(); - return this; - } - /** - * bool deterministic = 1; - */ - public Builder clearDeterministic() { - if (optionalDeterministicCase_ == 1) { - optionalDeterministicCase_ = 0; - optionalDeterministic_ = null; - onChanged(); - } - return this; - } - - private org.tensorflow.proto.data.DistributeOptions distributeOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder> distributeOptionsBuilder_; - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public boolean hasDistributeOptions() { - return distributeOptionsBuilder_ != null || distributeOptions_ != null; - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public org.tensorflow.proto.data.DistributeOptions getDistributeOptions() { - if (distributeOptionsBuilder_ == null) { - return distributeOptions_ == null ? org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_; - } else { - return distributeOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public Builder setDistributeOptions(org.tensorflow.proto.data.DistributeOptions value) { - if (distributeOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - distributeOptions_ = value; - onChanged(); - } else { - distributeOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public Builder setDistributeOptions( - org.tensorflow.proto.data.DistributeOptions.Builder builderForValue) { - if (distributeOptionsBuilder_ == null) { - distributeOptions_ = builderForValue.build(); - onChanged(); - } else { - distributeOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public Builder mergeDistributeOptions(org.tensorflow.proto.data.DistributeOptions value) { - if (distributeOptionsBuilder_ == null) { - if (distributeOptions_ != null) { - distributeOptions_ = - org.tensorflow.proto.data.DistributeOptions.newBuilder(distributeOptions_).mergeFrom(value).buildPartial(); - } else { - distributeOptions_ = value; - } - onChanged(); - } else { - distributeOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public Builder clearDistributeOptions() { - if (distributeOptionsBuilder_ == null) { - distributeOptions_ = null; - onChanged(); - } else { - distributeOptions_ = null; - distributeOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public org.tensorflow.proto.data.DistributeOptions.Builder getDistributeOptionsBuilder() { - - onChanged(); - return getDistributeOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - public org.tensorflow.proto.data.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() { - if (distributeOptionsBuilder_ != null) { - return distributeOptionsBuilder_.getMessageOrBuilder(); - } else { - return distributeOptions_ == null ? - org.tensorflow.proto.data.DistributeOptions.getDefaultInstance() : distributeOptions_; - } - } - /** - *
    -     * The distribution strategy options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder> - getDistributeOptionsFieldBuilder() { - if (distributeOptionsBuilder_ == null) { - distributeOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.DistributeOptions, org.tensorflow.proto.data.DistributeOptions.Builder, org.tensorflow.proto.data.DistributeOptionsOrBuilder>( - getDistributeOptions(), - getParentForChildren(), - isClean()); - distributeOptions_ = null; - } - return distributeOptionsBuilder_; - } - - private org.tensorflow.proto.data.OptimizationOptions optimizationOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder> optimizationOptionsBuilder_; - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public boolean hasOptimizationOptions() { - return optimizationOptionsBuilder_ != null || optimizationOptions_ != null; - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public org.tensorflow.proto.data.OptimizationOptions getOptimizationOptions() { - if (optimizationOptionsBuilder_ == null) { - return optimizationOptions_ == null ? org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_; - } else { - return optimizationOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public Builder setOptimizationOptions(org.tensorflow.proto.data.OptimizationOptions value) { - if (optimizationOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - optimizationOptions_ = value; - onChanged(); - } else { - optimizationOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public Builder setOptimizationOptions( - org.tensorflow.proto.data.OptimizationOptions.Builder builderForValue) { - if (optimizationOptionsBuilder_ == null) { - optimizationOptions_ = builderForValue.build(); - onChanged(); - } else { - optimizationOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public Builder mergeOptimizationOptions(org.tensorflow.proto.data.OptimizationOptions value) { - if (optimizationOptionsBuilder_ == null) { - if (optimizationOptions_ != null) { - optimizationOptions_ = - org.tensorflow.proto.data.OptimizationOptions.newBuilder(optimizationOptions_).mergeFrom(value).buildPartial(); - } else { - optimizationOptions_ = value; - } - onChanged(); - } else { - optimizationOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public Builder clearOptimizationOptions() { - if (optimizationOptionsBuilder_ == null) { - optimizationOptions_ = null; - onChanged(); - } else { - optimizationOptions_ = null; - optimizationOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public org.tensorflow.proto.data.OptimizationOptions.Builder getOptimizationOptionsBuilder() { - - onChanged(); - return getOptimizationOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - public org.tensorflow.proto.data.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() { - if (optimizationOptionsBuilder_ != null) { - return optimizationOptionsBuilder_.getMessageOrBuilder(); - } else { - return optimizationOptions_ == null ? - org.tensorflow.proto.data.OptimizationOptions.getDefaultInstance() : optimizationOptions_; - } - } - /** - *
    -     * The optimization options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder> - getOptimizationOptionsFieldBuilder() { - if (optimizationOptionsBuilder_ == null) { - optimizationOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.OptimizationOptions, org.tensorflow.proto.data.OptimizationOptions.Builder, org.tensorflow.proto.data.OptimizationOptionsOrBuilder>( - getOptimizationOptions(), - getParentForChildren(), - isClean()); - optimizationOptions_ = null; - } - return optimizationOptionsBuilder_; - } - - /** - * bool slack = 4; - */ - public boolean getSlack() { - if (optionalSlackCase_ == 4) { - return (java.lang.Boolean) optionalSlack_; - } - return false; - } - /** - * bool slack = 4; - */ - public Builder setSlack(boolean value) { - optionalSlackCase_ = 4; - optionalSlack_ = value; - onChanged(); - return this; - } - /** - * bool slack = 4; - */ - public Builder clearSlack() { - if (optionalSlackCase_ == 4) { - optionalSlackCase_ = 0; - optionalSlack_ = null; - onChanged(); - } - return this; - } - - private org.tensorflow.proto.data.ThreadingOptions threadingOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder> threadingOptionsBuilder_; - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public boolean hasThreadingOptions() { - return threadingOptionsBuilder_ != null || threadingOptions_ != null; - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public org.tensorflow.proto.data.ThreadingOptions getThreadingOptions() { - if (threadingOptionsBuilder_ == null) { - return threadingOptions_ == null ? org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_; - } else { - return threadingOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public Builder setThreadingOptions(org.tensorflow.proto.data.ThreadingOptions value) { - if (threadingOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - threadingOptions_ = value; - onChanged(); - } else { - threadingOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public Builder setThreadingOptions( - org.tensorflow.proto.data.ThreadingOptions.Builder builderForValue) { - if (threadingOptionsBuilder_ == null) { - threadingOptions_ = builderForValue.build(); - onChanged(); - } else { - threadingOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public Builder mergeThreadingOptions(org.tensorflow.proto.data.ThreadingOptions value) { - if (threadingOptionsBuilder_ == null) { - if (threadingOptions_ != null) { - threadingOptions_ = - org.tensorflow.proto.data.ThreadingOptions.newBuilder(threadingOptions_).mergeFrom(value).buildPartial(); - } else { - threadingOptions_ = value; - } - onChanged(); - } else { - threadingOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public Builder clearThreadingOptions() { - if (threadingOptionsBuilder_ == null) { - threadingOptions_ = null; - onChanged(); - } else { - threadingOptions_ = null; - threadingOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public org.tensorflow.proto.data.ThreadingOptions.Builder getThreadingOptionsBuilder() { - - onChanged(); - return getThreadingOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - public org.tensorflow.proto.data.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() { - if (threadingOptionsBuilder_ != null) { - return threadingOptionsBuilder_.getMessageOrBuilder(); - } else { - return threadingOptions_ == null ? - org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance() : threadingOptions_; - } - } - /** - *
    -     * The threading options associated with the dataset.
    -     * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder> - getThreadingOptionsFieldBuilder() { - if (threadingOptionsBuilder_ == null) { - threadingOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.ThreadingOptions, org.tensorflow.proto.data.ThreadingOptions.Builder, org.tensorflow.proto.data.ThreadingOptionsOrBuilder>( - getThreadingOptions(), - getParentForChildren(), - isClean()); - threadingOptions_ = null; - } - return threadingOptionsBuilder_; - } - - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public int getExternalStatePolicyValue() { - if (optionalExternalStatePolicyCase_ == 6) { - return ((java.lang.Integer) optionalExternalStatePolicy_).intValue(); - } - return 0; - } - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public Builder setExternalStatePolicyValue(int value) { - optionalExternalStatePolicyCase_ = 6; - optionalExternalStatePolicy_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public org.tensorflow.proto.data.ExternalStatePolicy getExternalStatePolicy() { - if (optionalExternalStatePolicyCase_ == 6) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.ExternalStatePolicy result = org.tensorflow.proto.data.ExternalStatePolicy.valueOf( - (java.lang.Integer) optionalExternalStatePolicy_); - return result == null ? org.tensorflow.proto.data.ExternalStatePolicy.UNRECOGNIZED : result; - } - return org.tensorflow.proto.data.ExternalStatePolicy.POLICY_WARN; - } - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public Builder setExternalStatePolicy(org.tensorflow.proto.data.ExternalStatePolicy value) { - if (value == null) { - throw new NullPointerException(); - } - optionalExternalStatePolicyCase_ = 6; - optionalExternalStatePolicy_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - public Builder clearExternalStatePolicy() { - if (optionalExternalStatePolicyCase_ == 6) { - optionalExternalStatePolicyCase_ = 0; - optionalExternalStatePolicy_ = null; - 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.Options) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.Options) - private static final org.tensorflow.proto.data.Options DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.Options(); - } - - public static org.tensorflow.proto.data.Options getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Options parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Options(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.Options getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptionsOrBuilder.java deleted file mode 100644 index b4f2077d1ca..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/OptionsOrBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -public interface OptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.Options) - com.google.protobuf.MessageOrBuilder { - - /** - * bool deterministic = 1; - */ - boolean getDeterministic(); - - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - boolean hasDistributeOptions(); - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - org.tensorflow.proto.data.DistributeOptions getDistributeOptions(); - /** - *
    -   * The distribution strategy options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.DistributeOptions distribute_options = 2; - */ - org.tensorflow.proto.data.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder(); - - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - boolean hasOptimizationOptions(); - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - org.tensorflow.proto.data.OptimizationOptions getOptimizationOptions(); - /** - *
    -   * The optimization options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.OptimizationOptions optimization_options = 3; - */ - org.tensorflow.proto.data.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder(); - - /** - * bool slack = 4; - */ - boolean getSlack(); - - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - boolean hasThreadingOptions(); - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - org.tensorflow.proto.data.ThreadingOptions getThreadingOptions(); - /** - *
    -   * The threading options associated with the dataset.
    -   * 
    - * - * .tensorflow.data.ThreadingOptions threading_options = 5; - */ - org.tensorflow.proto.data.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder(); - - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - int getExternalStatePolicyValue(); - /** - * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; - */ - org.tensorflow.proto.data.ExternalStatePolicy getExternalStatePolicy(); - - public org.tensorflow.proto.data.Options.OptionalDeterministicCase getOptionalDeterministicCase(); - - public org.tensorflow.proto.data.Options.OptionalSlackCase getOptionalSlackCase(); - - public org.tensorflow.proto.data.Options.OptionalExternalStatePolicyCase getOptionalExternalStatePolicyCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptions.java deleted file mode 100644 index eebc5aaf459..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptions.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -/** - * Protobuf type {@code tensorflow.data.ThreadingOptions} - */ -public final class ThreadingOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.ThreadingOptions) - ThreadingOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use ThreadingOptions.newBuilder() to construct. - private ThreadingOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ThreadingOptions() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ThreadingOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ThreadingOptions( - 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: { - optionalMaxIntraOpParallelismCase_ = 1; - optionalMaxIntraOpParallelism_ = input.readInt32(); - break; - } - case 16: { - optionalPrivateThreadpoolSizeCase_ = 2; - optionalPrivateThreadpoolSize_ = input.readInt32(); - 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.DatasetOptionsProtos.internal_static_tensorflow_data_ThreadingOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.ThreadingOptions.class, org.tensorflow.proto.data.ThreadingOptions.Builder.class); - } - - private int optionalMaxIntraOpParallelismCase_ = 0; - private java.lang.Object optionalMaxIntraOpParallelism_; - public enum OptionalMaxIntraOpParallelismCase - implements com.google.protobuf.Internal.EnumLite { - MAX_INTRA_OP_PARALLELISM(1), - OPTIONALMAXINTRAOPPARALLELISM_NOT_SET(0); - private final int value; - private OptionalMaxIntraOpParallelismCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalMaxIntraOpParallelismCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalMaxIntraOpParallelismCase forNumber(int value) { - switch (value) { - case 1: return MAX_INTRA_OP_PARALLELISM; - case 0: return OPTIONALMAXINTRAOPPARALLELISM_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalMaxIntraOpParallelismCase - getOptionalMaxIntraOpParallelismCase() { - return OptionalMaxIntraOpParallelismCase.forNumber( - optionalMaxIntraOpParallelismCase_); - } - - private int optionalPrivateThreadpoolSizeCase_ = 0; - private java.lang.Object optionalPrivateThreadpoolSize_; - public enum OptionalPrivateThreadpoolSizeCase - implements com.google.protobuf.Internal.EnumLite { - PRIVATE_THREADPOOL_SIZE(2), - OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET(0); - private final int value; - private OptionalPrivateThreadpoolSizeCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OptionalPrivateThreadpoolSizeCase valueOf(int value) { - return forNumber(value); - } - - public static OptionalPrivateThreadpoolSizeCase forNumber(int value) { - switch (value) { - case 2: return PRIVATE_THREADPOOL_SIZE; - case 0: return OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OptionalPrivateThreadpoolSizeCase - getOptionalPrivateThreadpoolSizeCase() { - return OptionalPrivateThreadpoolSizeCase.forNumber( - optionalPrivateThreadpoolSizeCase_); - } - - public static final int MAX_INTRA_OP_PARALLELISM_FIELD_NUMBER = 1; - /** - * int32 max_intra_op_parallelism = 1; - */ - public int getMaxIntraOpParallelism() { - if (optionalMaxIntraOpParallelismCase_ == 1) { - return (java.lang.Integer) optionalMaxIntraOpParallelism_; - } - return 0; - } - - public static final int PRIVATE_THREADPOOL_SIZE_FIELD_NUMBER = 2; - /** - * int32 private_threadpool_size = 2; - */ - public int getPrivateThreadpoolSize() { - if (optionalPrivateThreadpoolSizeCase_ == 2) { - return (java.lang.Integer) optionalPrivateThreadpoolSize_; - } - return 0; - } - - 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 (optionalMaxIntraOpParallelismCase_ == 1) { - output.writeInt32( - 1, (int)((java.lang.Integer) optionalMaxIntraOpParallelism_)); - } - if (optionalPrivateThreadpoolSizeCase_ == 2) { - output.writeInt32( - 2, (int)((java.lang.Integer) optionalPrivateThreadpoolSize_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (optionalMaxIntraOpParallelismCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size( - 1, (int)((java.lang.Integer) optionalMaxIntraOpParallelism_)); - } - if (optionalPrivateThreadpoolSizeCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size( - 2, (int)((java.lang.Integer) optionalPrivateThreadpoolSize_)); - } - 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.ThreadingOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.data.ThreadingOptions other = (org.tensorflow.proto.data.ThreadingOptions) obj; - - if (!getOptionalMaxIntraOpParallelismCase().equals(other.getOptionalMaxIntraOpParallelismCase())) return false; - switch (optionalMaxIntraOpParallelismCase_) { - case 1: - if (getMaxIntraOpParallelism() - != other.getMaxIntraOpParallelism()) return false; - break; - case 0: - default: - } - if (!getOptionalPrivateThreadpoolSizeCase().equals(other.getOptionalPrivateThreadpoolSizeCase())) return false; - switch (optionalPrivateThreadpoolSizeCase_) { - case 2: - if (getPrivateThreadpoolSize() - != other.getPrivateThreadpoolSize()) return false; - break; - case 0: - default: - } - 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(); - switch (optionalMaxIntraOpParallelismCase_) { - case 1: - hash = (37 * hash) + MAX_INTRA_OP_PARALLELISM_FIELD_NUMBER; - hash = (53 * hash) + getMaxIntraOpParallelism(); - break; - case 0: - default: - } - switch (optionalPrivateThreadpoolSizeCase_) { - case 2: - hash = (37 * hash) + PRIVATE_THREADPOOL_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPrivateThreadpoolSize(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.ThreadingOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.ThreadingOptions 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.ThreadingOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.ThreadingOptions 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.ThreadingOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.ThreadingOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.ThreadingOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.ThreadingOptions 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.ThreadingOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.ThreadingOptions 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.ThreadingOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.ThreadingOptions 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.ThreadingOptions 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.data.ThreadingOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.ThreadingOptions) - org.tensorflow.proto.data.ThreadingOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_ThreadingOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.ThreadingOptions.class, org.tensorflow.proto.data.ThreadingOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.data.ThreadingOptions.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(); - optionalMaxIntraOpParallelismCase_ = 0; - optionalMaxIntraOpParallelism_ = null; - optionalPrivateThreadpoolSizeCase_ = 0; - optionalPrivateThreadpoolSize_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.DatasetOptionsProtos.internal_static_tensorflow_data_ThreadingOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.ThreadingOptions getDefaultInstanceForType() { - return org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.ThreadingOptions build() { - org.tensorflow.proto.data.ThreadingOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.ThreadingOptions buildPartial() { - org.tensorflow.proto.data.ThreadingOptions result = new org.tensorflow.proto.data.ThreadingOptions(this); - if (optionalMaxIntraOpParallelismCase_ == 1) { - result.optionalMaxIntraOpParallelism_ = optionalMaxIntraOpParallelism_; - } - if (optionalPrivateThreadpoolSizeCase_ == 2) { - result.optionalPrivateThreadpoolSize_ = optionalPrivateThreadpoolSize_; - } - result.optionalMaxIntraOpParallelismCase_ = optionalMaxIntraOpParallelismCase_; - result.optionalPrivateThreadpoolSizeCase_ = optionalPrivateThreadpoolSizeCase_; - 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.ThreadingOptions) { - return mergeFrom((org.tensorflow.proto.data.ThreadingOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.ThreadingOptions other) { - if (other == org.tensorflow.proto.data.ThreadingOptions.getDefaultInstance()) return this; - switch (other.getOptionalMaxIntraOpParallelismCase()) { - case MAX_INTRA_OP_PARALLELISM: { - setMaxIntraOpParallelism(other.getMaxIntraOpParallelism()); - break; - } - case OPTIONALMAXINTRAOPPARALLELISM_NOT_SET: { - break; - } - } - switch (other.getOptionalPrivateThreadpoolSizeCase()) { - case PRIVATE_THREADPOOL_SIZE: { - setPrivateThreadpoolSize(other.getPrivateThreadpoolSize()); - break; - } - case OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET: { - break; - } - } - 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.ThreadingOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.ThreadingOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int optionalMaxIntraOpParallelismCase_ = 0; - private java.lang.Object optionalMaxIntraOpParallelism_; - public OptionalMaxIntraOpParallelismCase - getOptionalMaxIntraOpParallelismCase() { - return OptionalMaxIntraOpParallelismCase.forNumber( - optionalMaxIntraOpParallelismCase_); - } - - public Builder clearOptionalMaxIntraOpParallelism() { - optionalMaxIntraOpParallelismCase_ = 0; - optionalMaxIntraOpParallelism_ = null; - onChanged(); - return this; - } - - private int optionalPrivateThreadpoolSizeCase_ = 0; - private java.lang.Object optionalPrivateThreadpoolSize_; - public OptionalPrivateThreadpoolSizeCase - getOptionalPrivateThreadpoolSizeCase() { - return OptionalPrivateThreadpoolSizeCase.forNumber( - optionalPrivateThreadpoolSizeCase_); - } - - public Builder clearOptionalPrivateThreadpoolSize() { - optionalPrivateThreadpoolSizeCase_ = 0; - optionalPrivateThreadpoolSize_ = null; - onChanged(); - return this; - } - - - /** - * int32 max_intra_op_parallelism = 1; - */ - public int getMaxIntraOpParallelism() { - if (optionalMaxIntraOpParallelismCase_ == 1) { - return (java.lang.Integer) optionalMaxIntraOpParallelism_; - } - return 0; - } - /** - * int32 max_intra_op_parallelism = 1; - */ - public Builder setMaxIntraOpParallelism(int value) { - optionalMaxIntraOpParallelismCase_ = 1; - optionalMaxIntraOpParallelism_ = value; - onChanged(); - return this; - } - /** - * int32 max_intra_op_parallelism = 1; - */ - public Builder clearMaxIntraOpParallelism() { - if (optionalMaxIntraOpParallelismCase_ == 1) { - optionalMaxIntraOpParallelismCase_ = 0; - optionalMaxIntraOpParallelism_ = null; - onChanged(); - } - return this; - } - - /** - * int32 private_threadpool_size = 2; - */ - public int getPrivateThreadpoolSize() { - if (optionalPrivateThreadpoolSizeCase_ == 2) { - return (java.lang.Integer) optionalPrivateThreadpoolSize_; - } - return 0; - } - /** - * int32 private_threadpool_size = 2; - */ - public Builder setPrivateThreadpoolSize(int value) { - optionalPrivateThreadpoolSizeCase_ = 2; - optionalPrivateThreadpoolSize_ = value; - onChanged(); - return this; - } - /** - * int32 private_threadpool_size = 2; - */ - public Builder clearPrivateThreadpoolSize() { - if (optionalPrivateThreadpoolSizeCase_ == 2) { - optionalPrivateThreadpoolSizeCase_ = 0; - optionalPrivateThreadpoolSize_ = null; - 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.ThreadingOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.ThreadingOptions) - private static final org.tensorflow.proto.data.ThreadingOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.ThreadingOptions(); - } - - public static org.tensorflow.proto.data.ThreadingOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ThreadingOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ThreadingOptions(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.ThreadingOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptionsOrBuilder.java deleted file mode 100644 index 3a4d602db55..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/ThreadingOptionsOrBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/dataset_options.proto - -package org.tensorflow.proto.data; - -public interface ThreadingOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.ThreadingOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 max_intra_op_parallelism = 1; - */ - int getMaxIntraOpParallelism(); - - /** - * int32 private_threadpool_size = 2; - */ - int getPrivateThreadpoolSize(); - - public org.tensorflow.proto.data.ThreadingOptions.OptionalMaxIntraOpParallelismCase getOptionalMaxIntraOpParallelismCase(); - - public org.tensorflow.proto.data.ThreadingOptions.OptionalPrivateThreadpoolSizeCase getOptionalPrivateThreadpoolSizeCase(); -} 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 deleted file mode 100644 index 3b49f356e2a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java +++ /dev/null @@ -1,2884 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/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. A value of -1 indicates that jobs should never be garbage
    -     * collected.
    -     * 
    - * - * 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. A value of -1 indicates that jobs should never be garbage
    -     * collected.
    -     * 
    - * - * 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. A value of -1 indicates that jobs should never be garbage
    -       * collected.
    -       * 
    - * - * 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. A value of -1 indicates that jobs should never be garbage
    -       * collected.
    -       * 
    - * - * 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. A value of -1 indicates that jobs should never be garbage
    -       * collected.
    -       * 
    - * - * 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(); - - /** - *
    -     * The protocol for the worker to use when transferring data to clients.
    -     * 
    - * - * string data_transfer_protocol = 7; - */ - java.lang.String getDataTransferProtocol(); - /** - *
    -     * The protocol for the worker to use when transferring data to clients.
    -     * 
    - * - * string data_transfer_protocol = 7; - */ - com.google.protobuf.ByteString - getDataTransferProtocolBytes(); - - /** - *
    -     * The data transfer 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 data_transfer_address = 8; - */ - java.lang.String getDataTransferAddress(); - /** - *
    -     * The data transfer 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 data_transfer_address = 8; - */ - com.google.protobuf.ByteString - getDataTransferAddressBytes(); - - /** - *
    -     * When shutting down a worker, how long to wait for the gRPC server to
    -     * process the final requests. This is used to achieve clean shutdown in unit
    -     * tests.
    -     * 
    - * - * int64 shutdown_quiet_period_ms = 9; - */ - long getShutdownQuietPeriodMs(); - } - /** - *
    -   * 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_ = ""; - dataTransferProtocol_ = ""; - dataTransferAddress_ = ""; - } - - @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; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - dataTransferProtocol_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - dataTransferAddress_ = s; - break; - } - case 72: { - - shutdownQuietPeriodMs_ = 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_; - } - - public static final int DATA_TRANSFER_PROTOCOL_FIELD_NUMBER = 7; - private volatile java.lang.Object dataTransferProtocol_; - /** - *
    -     * The protocol for the worker to use when transferring data to clients.
    -     * 
    - * - * string data_transfer_protocol = 7; - */ - public java.lang.String getDataTransferProtocol() { - java.lang.Object ref = dataTransferProtocol_; - 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(); - dataTransferProtocol_ = s; - return s; - } - } - /** - *
    -     * The protocol for the worker to use when transferring data to clients.
    -     * 
    - * - * string data_transfer_protocol = 7; - */ - public com.google.protobuf.ByteString - getDataTransferProtocolBytes() { - java.lang.Object ref = dataTransferProtocol_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dataTransferProtocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DATA_TRANSFER_ADDRESS_FIELD_NUMBER = 8; - private volatile java.lang.Object dataTransferAddress_; - /** - *
    -     * The data transfer 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 data_transfer_address = 8; - */ - public java.lang.String getDataTransferAddress() { - java.lang.Object ref = dataTransferAddress_; - 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(); - dataTransferAddress_ = s; - return s; - } - } - /** - *
    -     * The data transfer 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 data_transfer_address = 8; - */ - public com.google.protobuf.ByteString - getDataTransferAddressBytes() { - java.lang.Object ref = dataTransferAddress_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dataTransferAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER = 9; - private long shutdownQuietPeriodMs_; - /** - *
    -     * When shutting down a worker, how long to wait for the gRPC server to
    -     * process the final requests. This is used to achieve clean shutdown in unit
    -     * tests.
    -     * 
    - * - * int64 shutdown_quiet_period_ms = 9; - */ - public long getShutdownQuietPeriodMs() { - return shutdownQuietPeriodMs_; - } - - 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_); - } - if (!getDataTransferProtocolBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, dataTransferProtocol_); - } - if (!getDataTransferAddressBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, dataTransferAddress_); - } - if (shutdownQuietPeriodMs_ != 0L) { - output.writeInt64(9, shutdownQuietPeriodMs_); - } - 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_); - } - if (!getDataTransferProtocolBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, dataTransferProtocol_); - } - if (!getDataTransferAddressBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, dataTransferAddress_); - } - if (shutdownQuietPeriodMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, shutdownQuietPeriodMs_); - } - 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 (!getDataTransferProtocol() - .equals(other.getDataTransferProtocol())) return false; - if (!getDataTransferAddress() - .equals(other.getDataTransferAddress())) return false; - if (getShutdownQuietPeriodMs() - != other.getShutdownQuietPeriodMs()) 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 = (37 * hash) + DATA_TRANSFER_PROTOCOL_FIELD_NUMBER; - hash = (53 * hash) + getDataTransferProtocol().hashCode(); - hash = (37 * hash) + DATA_TRANSFER_ADDRESS_FIELD_NUMBER; - hash = (53 * hash) + getDataTransferAddress().hashCode(); - hash = (37 * hash) + SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getShutdownQuietPeriodMs()); - 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; - - dataTransferProtocol_ = ""; - - dataTransferAddress_ = ""; - - shutdownQuietPeriodMs_ = 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_; - result.dataTransferProtocol_ = dataTransferProtocol_; - result.dataTransferAddress_ = dataTransferAddress_; - result.shutdownQuietPeriodMs_ = shutdownQuietPeriodMs_; - 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()); - } - if (!other.getDataTransferProtocol().isEmpty()) { - dataTransferProtocol_ = other.dataTransferProtocol_; - onChanged(); - } - if (!other.getDataTransferAddress().isEmpty()) { - dataTransferAddress_ = other.dataTransferAddress_; - onChanged(); - } - if (other.getShutdownQuietPeriodMs() != 0L) { - setShutdownQuietPeriodMs(other.getShutdownQuietPeriodMs()); - } - 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; - } - - private java.lang.Object dataTransferProtocol_ = ""; - /** - *
    -       * The protocol for the worker to use when transferring data to clients.
    -       * 
    - * - * string data_transfer_protocol = 7; - */ - public java.lang.String getDataTransferProtocol() { - java.lang.Object ref = dataTransferProtocol_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - dataTransferProtocol_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The protocol for the worker to use when transferring data to clients.
    -       * 
    - * - * string data_transfer_protocol = 7; - */ - public com.google.protobuf.ByteString - getDataTransferProtocolBytes() { - java.lang.Object ref = dataTransferProtocol_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dataTransferProtocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The protocol for the worker to use when transferring data to clients.
    -       * 
    - * - * string data_transfer_protocol = 7; - */ - public Builder setDataTransferProtocol( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - dataTransferProtocol_ = value; - onChanged(); - return this; - } - /** - *
    -       * The protocol for the worker to use when transferring data to clients.
    -       * 
    - * - * string data_transfer_protocol = 7; - */ - public Builder clearDataTransferProtocol() { - - dataTransferProtocol_ = getDefaultInstance().getDataTransferProtocol(); - onChanged(); - return this; - } - /** - *
    -       * The protocol for the worker to use when transferring data to clients.
    -       * 
    - * - * string data_transfer_protocol = 7; - */ - public Builder setDataTransferProtocolBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - dataTransferProtocol_ = value; - onChanged(); - return this; - } - - private java.lang.Object dataTransferAddress_ = ""; - /** - *
    -       * The data transfer 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 data_transfer_address = 8; - */ - public java.lang.String getDataTransferAddress() { - java.lang.Object ref = dataTransferAddress_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - dataTransferAddress_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The data transfer 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 data_transfer_address = 8; - */ - public com.google.protobuf.ByteString - getDataTransferAddressBytes() { - java.lang.Object ref = dataTransferAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dataTransferAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The data transfer 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 data_transfer_address = 8; - */ - public Builder setDataTransferAddress( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - dataTransferAddress_ = value; - onChanged(); - return this; - } - /** - *
    -       * The data transfer 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 data_transfer_address = 8; - */ - public Builder clearDataTransferAddress() { - - dataTransferAddress_ = getDefaultInstance().getDataTransferAddress(); - onChanged(); - return this; - } - /** - *
    -       * The data transfer 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 data_transfer_address = 8; - */ - public Builder setDataTransferAddressBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - dataTransferAddress_ = value; - onChanged(); - return this; - } - - private long shutdownQuietPeriodMs_ ; - /** - *
    -       * When shutting down a worker, how long to wait for the gRPC server to
    -       * process the final requests. This is used to achieve clean shutdown in unit
    -       * tests.
    -       * 
    - * - * int64 shutdown_quiet_period_ms = 9; - */ - public long getShutdownQuietPeriodMs() { - return shutdownQuietPeriodMs_; - } - /** - *
    -       * When shutting down a worker, how long to wait for the gRPC server to
    -       * process the final requests. This is used to achieve clean shutdown in unit
    -       * tests.
    -       * 
    - * - * int64 shutdown_quiet_period_ms = 9; - */ - public Builder setShutdownQuietPeriodMs(long value) { - - shutdownQuietPeriodMs_ = value; - onChanged(); - return this; - } - /** - *
    -       * When shutting down a worker, how long to wait for the gRPC server to
    -       * process the final requests. This is used to achieve clean shutdown in unit
    -       * tests.
    -       * 
    - * - * int64 shutdown_quiet_period_ms = 9; - */ - public Builder clearShutdownQuietPeriodMs() { - - shutdownQuietPeriodMs_ = 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/service_confi" + - "g.proto\022\034tensorflow.data.experimental\"\236\001" + - "\n\020DispatcherConfig\022\014\n\004port\030\001 \001(\003\022\020\n\010prot" + - "ocol\030\002 \001(\t\022\020\n\010work_dir\030\003 \001(\t\022\033\n\023fault_to" + - "lerant_mode\030\004 \001(\010\022 \n\030job_gc_check_interv" + - "al_ms\030\005 \001(\003\022\031\n\021job_gc_timeout_ms\030\006 \001(\003\"\201" + - "\002\n\014WorkerConfig\022\014\n\004port\030\001 \001(\003\022\020\n\010protoco" + - "l\030\002 \001(\t\022\032\n\022dispatcher_address\030\003 \001(\t\022\026\n\016w" + - "orker_address\030\004 \001(\t\022\035\n\025heartbeat_interva" + - "l_ms\030\005 \001(\003\022\035\n\025dispatcher_timeout_ms\030\006 \001(" + - "\003\022\036\n\026data_transfer_protocol\030\007 \001(\t\022\035\n\025dat" + - "a_transfer_address\030\010 \001(\t\022 \n\030shutdown_qui" + - "et_period_ms\030\t \001(\003B\177\n&org.tensorflow.pro" + - "to.data.experimentalZUgithub.com/tensorf" + - "low/tensorflow/tensorflow/go/core/protob" + - "uf/for_core_protos_go_protob\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", "DataTransferProtocol", "DataTransferAddress", "ShutdownQuietPeriodMs", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java deleted file mode 100644 index 1ad5e1b6c74..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecord.java +++ /dev/null @@ -1,1328 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -/** - *
    - * This stores the metadata information present in each snapshot record.
    - * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotMetadataRecord} - */ -public final class SnapshotMetadataRecord extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotMetadataRecord) - SnapshotMetadataRecordOrBuilder { -private static final long serialVersionUID = 0L; - // Use SnapshotMetadataRecord.newBuilder() to construct. - private SnapshotMetadataRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SnapshotMetadataRecord() { - graphHash_ = ""; - runId_ = ""; - dtype_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SnapshotMetadataRecord(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SnapshotMetadataRecord( - 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(); - - graphHash_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - runId_ = s; - break; - } - case 24: { - - creationTimestamp_ = input.readInt64(); - break; - } - case 32: { - - version_ = input.readInt64(); - break; - } - case 40: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dtype_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dtype_.add(rawValue); - break; - } - case 42: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dtype_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dtype_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - case 48: { - - numElements_ = input.readInt64(); - break; - } - case 8000: { - - finalized_ = input.readBool(); - 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)) { - dtype_ = java.util.Collections.unmodifiableList(dtype_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.Builder.class); - } - - public static final int GRAPH_HASH_FIELD_NUMBER = 1; - private volatile java.lang.Object graphHash_; - /** - *
    -   * Stores the fingerprint of the graph that describes the dataset that is
    -   * snapshotted.
    -   * 
    - * - * string graph_hash = 1; - */ - public java.lang.String getGraphHash() { - java.lang.Object ref = graphHash_; - 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(); - graphHash_ = s; - return s; - } - } - /** - *
    -   * Stores the fingerprint of the graph that describes the dataset that is
    -   * snapshotted.
    -   * 
    - * - * string graph_hash = 1; - */ - public com.google.protobuf.ByteString - getGraphHashBytes() { - java.lang.Object ref = graphHash_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphHash_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RUN_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object runId_; - /** - *
    -   * Run ID that this snapshot corresponds to.
    -   * 
    - * - * string run_id = 2; - */ - public java.lang.String getRunId() { - java.lang.Object ref = runId_; - 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(); - runId_ = s; - return s; - } - } - /** - *
    -   * Run ID that this snapshot corresponds to.
    -   * 
    - * - * string run_id = 2; - */ - public com.google.protobuf.ByteString - getRunIdBytes() { - java.lang.Object ref = runId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - runId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 3; - private long creationTimestamp_; - /** - *
    -   * Time when we started creating this snapshot.
    -   * 
    - * - * int64 creation_timestamp = 3; - */ - public long getCreationTimestamp() { - return creationTimestamp_; - } - - public static final int VERSION_FIELD_NUMBER = 4; - private long version_; - /** - *
    -   * Version of the snapshot data file format.
    -   * 
    - * - * int64 version = 4; - */ - public long getVersion() { - return version_; - } - - public static final int DTYPE_FIELD_NUMBER = 5; - private java.util.List dtype_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.DataType> dtype_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>() { - public org.tensorflow.proto.framework.DataType convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(from); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - }; - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public java.util.List getDtypeList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>(dtype_, dtype_converter_); - } - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public int getDtypeCount() { - return dtype_.size(); - } - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype(int index) { - return dtype_converter_.convert(dtype_.get(index)); - } - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public java.util.List - getDtypeValueList() { - return dtype_; - } - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue(int index) { - return dtype_.get(index); - } - private int dtypeMemoizedSerializedSize; - - public static final int NUM_ELEMENTS_FIELD_NUMBER = 6; - private long numElements_; - /** - *
    -   * The number of elements in the snapshot.
    -   * 
    - * - * int64 num_elements = 6; - */ - public long getNumElements() { - return numElements_; - } - - public static final int FINALIZED_FIELD_NUMBER = 1000; - private boolean finalized_; - /** - * bool finalized = 1000; - */ - public boolean getFinalized() { - return finalized_; - } - - 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 { - getSerializedSize(); - if (!getGraphHashBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, graphHash_); - } - if (!getRunIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runId_); - } - if (creationTimestamp_ != 0L) { - output.writeInt64(3, creationTimestamp_); - } - if (version_ != 0L) { - output.writeInt64(4, version_); - } - if (getDtypeList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(dtypeMemoizedSerializedSize); - } - for (int i = 0; i < dtype_.size(); i++) { - output.writeEnumNoTag(dtype_.get(i)); - } - if (numElements_ != 0L) { - output.writeInt64(6, numElements_); - } - if (finalized_ != false) { - output.writeBool(1000, finalized_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGraphHashBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, graphHash_); - } - if (!getRunIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runId_); - } - if (creationTimestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, creationTimestamp_); - } - if (version_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, version_); - } - { - int dataSize = 0; - for (int i = 0; i < dtype_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(dtype_.get(i)); - } - size += dataSize; - if (!getDtypeList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }dtypeMemoizedSerializedSize = dataSize; - } - if (numElements_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, numElements_); - } - if (finalized_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1000, finalized_); - } - 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.SnapshotMetadataRecord)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.SnapshotMetadataRecord other = (org.tensorflow.proto.data.experimental.SnapshotMetadataRecord) obj; - - if (!getGraphHash() - .equals(other.getGraphHash())) return false; - if (!getRunId() - .equals(other.getRunId())) return false; - if (getCreationTimestamp() - != other.getCreationTimestamp()) return false; - if (getVersion() - != other.getVersion()) return false; - if (!dtype_.equals(other.dtype_)) return false; - if (getNumElements() - != other.getNumElements()) return false; - if (getFinalized() - != other.getFinalized()) 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) + GRAPH_HASH_FIELD_NUMBER; - hash = (53 * hash) + getGraphHash().hashCode(); - hash = (37 * hash) + RUN_ID_FIELD_NUMBER; - hash = (53 * hash) + getRunId().hashCode(); - hash = (37 * hash) + CREATION_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getCreationTimestamp()); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getVersion()); - if (getDtypeCount() > 0) { - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_.hashCode(); - } - hash = (37 * hash) + NUM_ELEMENTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumElements()); - hash = (37 * hash) + FINALIZED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFinalized()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - 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.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.data.experimental.SnapshotMetadataRecord parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.data.experimental.SnapshotMetadataRecord parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.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.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.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.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.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.data.experimental.SnapshotMetadataRecord 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.SnapshotMetadataRecord 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; - } - /** - *
    -   * This stores the metadata information present in each snapshot record.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotMetadataRecord} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotMetadataRecord) - org.tensorflow.proto.data.experimental.SnapshotMetadataRecordOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.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(); - graphHash_ = ""; - - runId_ = ""; - - creationTimestamp_ = 0L; - - version_ = 0L; - - dtype_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - numElements_ = 0L; - - finalized_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.SnapshotMetadataRecord.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotMetadataRecord build() { - org.tensorflow.proto.data.experimental.SnapshotMetadataRecord result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - 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_; - result.creationTimestamp_ = creationTimestamp_; - result.version_ = version_; - if (((bitField0_ & 0x00000001) != 0)) { - dtype_ = java.util.Collections.unmodifiableList(dtype_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dtype_ = dtype_; - result.numElements_ = numElements_; - result.finalized_ = finalized_; - 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.SnapshotMetadataRecord) { - return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotMetadataRecord)other); - } else { - super.mergeFrom(other); - 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(); - } - if (!other.getRunId().isEmpty()) { - runId_ = other.runId_; - onChanged(); - } - if (other.getCreationTimestamp() != 0L) { - setCreationTimestamp(other.getCreationTimestamp()); - } - if (other.getVersion() != 0L) { - setVersion(other.getVersion()); - } - if (!other.dtype_.isEmpty()) { - if (dtype_.isEmpty()) { - dtype_ = other.dtype_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDtypeIsMutable(); - dtype_.addAll(other.dtype_); - } - onChanged(); - } - if (other.getNumElements() != 0L) { - setNumElements(other.getNumElements()); - } - if (other.getFinalized() != false) { - setFinalized(other.getFinalized()); - } - 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.SnapshotMetadataRecord parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotMetadataRecord) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object graphHash_ = ""; - /** - *
    -     * Stores the fingerprint of the graph that describes the dataset that is
    -     * snapshotted.
    -     * 
    - * - * string graph_hash = 1; - */ - public java.lang.String getGraphHash() { - java.lang.Object ref = graphHash_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphHash_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Stores the fingerprint of the graph that describes the dataset that is
    -     * snapshotted.
    -     * 
    - * - * string graph_hash = 1; - */ - public com.google.protobuf.ByteString - getGraphHashBytes() { - java.lang.Object ref = graphHash_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphHash_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Stores the fingerprint of the graph that describes the dataset that is
    -     * snapshotted.
    -     * 
    - * - * string graph_hash = 1; - */ - public Builder setGraphHash( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphHash_ = value; - onChanged(); - return this; - } - /** - *
    -     * Stores the fingerprint of the graph that describes the dataset that is
    -     * snapshotted.
    -     * 
    - * - * string graph_hash = 1; - */ - public Builder clearGraphHash() { - - graphHash_ = getDefaultInstance().getGraphHash(); - onChanged(); - return this; - } - /** - *
    -     * Stores the fingerprint of the graph that describes the dataset that is
    -     * snapshotted.
    -     * 
    - * - * string graph_hash = 1; - */ - public Builder setGraphHashBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphHash_ = value; - onChanged(); - return this; - } - - private java.lang.Object runId_ = ""; - /** - *
    -     * Run ID that this snapshot corresponds to.
    -     * 
    - * - * string run_id = 2; - */ - public java.lang.String getRunId() { - java.lang.Object ref = runId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - runId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Run ID that this snapshot corresponds to.
    -     * 
    - * - * string run_id = 2; - */ - public com.google.protobuf.ByteString - getRunIdBytes() { - java.lang.Object ref = runId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - runId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Run ID that this snapshot corresponds to.
    -     * 
    - * - * string run_id = 2; - */ - public Builder setRunId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - runId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Run ID that this snapshot corresponds to.
    -     * 
    - * - * string run_id = 2; - */ - public Builder clearRunId() { - - runId_ = getDefaultInstance().getRunId(); - onChanged(); - return this; - } - /** - *
    -     * Run ID that this snapshot corresponds to.
    -     * 
    - * - * string run_id = 2; - */ - public Builder setRunIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - runId_ = value; - onChanged(); - return this; - } - - private long creationTimestamp_ ; - /** - *
    -     * Time when we started creating this snapshot.
    -     * 
    - * - * int64 creation_timestamp = 3; - */ - public long getCreationTimestamp() { - return creationTimestamp_; - } - /** - *
    -     * Time when we started creating this snapshot.
    -     * 
    - * - * int64 creation_timestamp = 3; - */ - public Builder setCreationTimestamp(long value) { - - creationTimestamp_ = value; - onChanged(); - return this; - } - /** - *
    -     * Time when we started creating this snapshot.
    -     * 
    - * - * int64 creation_timestamp = 3; - */ - public Builder clearCreationTimestamp() { - - creationTimestamp_ = 0L; - onChanged(); - return this; - } - - private long version_ ; - /** - *
    -     * Version of the snapshot data file format.
    -     * 
    - * - * int64 version = 4; - */ - public long getVersion() { - return version_; - } - /** - *
    -     * Version of the snapshot data file format.
    -     * 
    - * - * int64 version = 4; - */ - public Builder setVersion(long value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * Version of the snapshot data file format.
    -     * 
    - * - * int64 version = 4; - */ - public Builder clearVersion() { - - version_ = 0L; - onChanged(); - return this; - } - - private java.util.List dtype_ = - java.util.Collections.emptyList(); - private void ensureDtypeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dtype_ = new java.util.ArrayList(dtype_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public java.util.List getDtypeList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>(dtype_, dtype_converter_); - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public int getDtypeCount() { - return dtype_.size(); - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype(int index) { - return dtype_converter_.convert(dtype_.get(index)); - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder setDtype( - int index, org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypeIsMutable(); - dtype_.set(index, value.getNumber()); - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder addDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypeIsMutable(); - dtype_.add(value.getNumber()); - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder addAllDtype( - java.lang.Iterable values) { - ensureDtypeIsMutable(); - for (org.tensorflow.proto.framework.DataType value : values) { - dtype_.add(value.getNumber()); - } - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder clearDtype() { - dtype_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public java.util.List - getDtypeValueList() { - return java.util.Collections.unmodifiableList(dtype_); - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue(int index) { - return dtype_.get(index); - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder setDtypeValue( - int index, int value) { - ensureDtypeIsMutable(); - dtype_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder addDtypeValue(int value) { - ensureDtypeIsMutable(); - dtype_.add(value); - onChanged(); - return this; - } - /** - *
    -     * A list of tensor dtype corresponding to each element of the snapshot.
    -     * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - public Builder addAllDtypeValue( - java.lang.Iterable values) { - ensureDtypeIsMutable(); - for (int value : values) { - dtype_.add(value); - } - onChanged(); - return this; - } - - private long numElements_ ; - /** - *
    -     * The number of elements in the snapshot.
    -     * 
    - * - * int64 num_elements = 6; - */ - public long getNumElements() { - return numElements_; - } - /** - *
    -     * The number of elements in the snapshot.
    -     * 
    - * - * int64 num_elements = 6; - */ - public Builder setNumElements(long value) { - - numElements_ = value; - onChanged(); - return this; - } - /** - *
    -     * The number of elements in the snapshot.
    -     * 
    - * - * int64 num_elements = 6; - */ - public Builder clearNumElements() { - - numElements_ = 0L; - onChanged(); - return this; - } - - private boolean finalized_ ; - /** - * bool finalized = 1000; - */ - public boolean getFinalized() { - return finalized_; - } - /** - * bool finalized = 1000; - */ - public Builder setFinalized(boolean value) { - - finalized_ = value; - onChanged(); - return this; - } - /** - * bool finalized = 1000; - */ - public Builder clearFinalized() { - - finalized_ = false; - 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.SnapshotMetadataRecord) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotMetadataRecord) - private static final org.tensorflow.proto.data.experimental.SnapshotMetadataRecord DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotMetadataRecord(); - } - - public static org.tensorflow.proto.data.experimental.SnapshotMetadataRecord getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SnapshotMetadataRecord parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SnapshotMetadataRecord(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.SnapshotMetadataRecord getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java deleted file mode 100644 index 5533ed93eb3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotMetadataRecordOrBuilder.java +++ /dev/null @@ -1,121 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -public interface SnapshotMetadataRecordOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotMetadataRecord) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Stores the fingerprint of the graph that describes the dataset that is
    -   * snapshotted.
    -   * 
    - * - * string graph_hash = 1; - */ - java.lang.String getGraphHash(); - /** - *
    -   * Stores the fingerprint of the graph that describes the dataset that is
    -   * snapshotted.
    -   * 
    - * - * string graph_hash = 1; - */ - com.google.protobuf.ByteString - getGraphHashBytes(); - - /** - *
    -   * Run ID that this snapshot corresponds to.
    -   * 
    - * - * string run_id = 2; - */ - java.lang.String getRunId(); - /** - *
    -   * Run ID that this snapshot corresponds to.
    -   * 
    - * - * string run_id = 2; - */ - com.google.protobuf.ByteString - getRunIdBytes(); - - /** - *
    -   * Time when we started creating this snapshot.
    -   * 
    - * - * int64 creation_timestamp = 3; - */ - long getCreationTimestamp(); - - /** - *
    -   * Version of the snapshot data file format.
    -   * 
    - * - * int64 version = 4; - */ - long getVersion(); - - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - java.util.List getDtypeList(); - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - int getDtypeCount(); - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - org.tensorflow.proto.framework.DataType getDtype(int index); - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - java.util.List - getDtypeValueList(); - /** - *
    -   * A list of tensor dtype corresponding to each element of the snapshot.
    -   * 
    - * - * repeated .tensorflow.DataType dtype = 5; - */ - int getDtypeValue(int index); - - /** - *
    -   * The number of elements in the snapshot.
    -   * 
    - * - * int64 num_elements = 6; - */ - long getNumElements(); - - /** - * bool finalized = 1000; - */ - boolean getFinalized(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java deleted file mode 100644 index 57577a9ad7d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotProtos.java +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -public final class SnapshotProtos { - private SnapshotProtos() {} - 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_data_experimental_SnapshotRecord_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_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/snapshot.prot" + - "o\022\034tensorflow.data.experimental\032&tensorf" + - "low/core/framework/tensor.proto\032,tensorf" + - "low/core/framework/tensor_shape.proto\032%t" + - "ensorflow/core/framework/types.proto\"9\n\016" + - "SnapshotRecord\022\'\n\006tensor\030\001 \003(\0132\027.tensorf" + - "low.TensorProto\"\270\001\n\026SnapshotMetadataReco" + - "rd\022\022\n\ngraph_hash\030\001 \001(\t\022\016\n\006run_id\030\002 \001(\t\022\032" + - "\n\022creation_timestamp\030\003 \001(\003\022\017\n\007version\030\004 " + - "\001(\003\022#\n\005dtype\030\005 \003(\0162\024.tensorflow.DataType" + - "\022\024\n\014num_elements\030\006 \001(\003\022\022\n\tfinalized\030\350\007 \001" + - "(\010\"_\n\016TensorMetadata\0222\n\014tensor_shape\030\002 \001" + - "(\0132\034.tensorflow.TensorShapeProto\022\031\n\021tens" + - "or_size_bytes\030\003 \001(\003\"_\n\026SnapshotTensorMet" + - "adata\022E\n\017tensor_metadata\030\001 \003(\0132,.tensorf" + - "low.data.experimental.TensorMetadataB\221\001\n" + - "&org.tensorflow.proto.data.experimentalB" + - "\016SnapshotProtosP\001ZUgithub.com/tensorflow" + - "/tensorflow/tensorflow/go/core/protobuf/" + - "for_core_protos_go_protob\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor, - new java.lang.String[] { "Tensor", }); - internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor, - new java.lang.String[] { "GraphHash", "RunId", "CreationTimestamp", "Version", "Dtype", "NumElements", "Finalized", }); - internal_static_tensorflow_data_experimental_TensorMetadata_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_TensorMetadata_descriptor, - new java.lang.String[] { "TensorShape", "TensorSizeBytes", }); - internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor, - new java.lang.String[] { "TensorMetadata", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java deleted file mode 100644 index e81a8b745f9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecord.java +++ /dev/null @@ -1,777 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.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.
    - * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotRecord} - */ -public final class SnapshotRecord extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotRecord) - SnapshotRecordOrBuilder { -private static final long serialVersionUID = 0L; - // Use SnapshotRecord.newBuilder() to construct. - private SnapshotRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SnapshotRecord() { - tensor_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SnapshotRecord(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SnapshotRecord( - 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)) { - tensor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensor_.add( - input.readMessage(org.tensorflow.proto.framework.TensorProto.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_ & 0x00000001) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.SnapshotRecord.class, org.tensorflow.proto.data.experimental.SnapshotRecord.Builder.class); - } - - public static final int TENSOR_FIELD_NUMBER = 1; - private java.util.List tensor_; - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public java.util.List getTensorList() { - return tensor_; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public java.util.List - getTensorOrBuilderList() { - return tensor_; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public int getTensorCount() { - return tensor_.size(); - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProto getTensor(int index) { - return tensor_.get(index); - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index) { - return tensor_.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 { - for (int i = 0; i < tensor_.size(); i++) { - output.writeMessage(1, tensor_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < tensor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, tensor_.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.data.experimental.SnapshotRecord)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.SnapshotRecord other = (org.tensorflow.proto.data.experimental.SnapshotRecord) obj; - - if (!getTensorList() - .equals(other.getTensorList())) 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 (getTensorCount() > 0) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensorList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - 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.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.data.experimental.SnapshotRecord parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.data.experimental.SnapshotRecord parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.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.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.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.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.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.data.experimental.SnapshotRecord 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.SnapshotRecord 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; - } - /** - *
    -   * 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.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotRecord} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotRecord) - org.tensorflow.proto.data.experimental.SnapshotRecordOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.SnapshotRecord.class, org.tensorflow.proto.data.experimental.SnapshotRecord.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.SnapshotRecord.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - tensorBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotRecord getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.SnapshotRecord.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotRecord build() { - org.tensorflow.proto.data.experimental.SnapshotRecord result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - 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)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.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.data.experimental.SnapshotRecord) { - return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotRecord)other); - } else { - super.mergeFrom(other); - 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()) { - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorIsMutable(); - tensor_.addAll(other.tensor_); - } - onChanged(); - } - } else { - if (!other.tensor_.isEmpty()) { - if (tensorBuilder_.isEmpty()) { - tensorBuilder_.dispose(); - tensorBuilder_ = null; - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000001); - tensorBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorFieldBuilder() : null; - } else { - tensorBuilder_.addAllMessages(other.tensor_); - } - } - } - 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.SnapshotRecord parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotRecord) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List tensor_ = - java.util.Collections.emptyList(); - private void ensureTensorIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensor_ = new java.util.ArrayList(tensor_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorBuilder_; - - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public java.util.List getTensorList() { - if (tensorBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensor_); - } else { - return tensorBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public int getTensorCount() { - if (tensorBuilder_ == null) { - return tensor_.size(); - } else { - return tensorBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProto getTensor(int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); - } else { - return tensorBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder setTensor( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.set(index, value); - onChanged(); - } else { - tensorBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder setTensor( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder addTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(value); - onChanged(); - } else { - tensorBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder addTensor( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(index, value); - onChanged(); - } else { - tensorBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder addTensor( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder addTensor( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder addAllTensor( - java.lang.Iterable values) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensor_); - onChanged(); - } else { - tensorBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - tensorBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public Builder removeTensor(int index) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.remove(index); - onChanged(); - } else { - tensorBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorBuilder( - int index) { - return getTensorFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); } else { - return tensorBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public java.util.List - getTensorOrBuilderList() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensor_); - } - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorBuilder() { - return getTensorFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorBuilder( - int index) { - return getTensorFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - public java.util.List - getTensorBuilderList() { - return getTensorFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - tensor_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - @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.SnapshotRecord) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotRecord) - private static final org.tensorflow.proto.data.experimental.SnapshotRecord DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotRecord(); - } - - public static org.tensorflow.proto.data.experimental.SnapshotRecord getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SnapshotRecord parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SnapshotRecord(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.SnapshotRecord getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java deleted file mode 100644 index c87321a9074..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotRecordOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -public interface SnapshotRecordOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotRecord) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - java.util.List - getTensorList(); - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - org.tensorflow.proto.framework.TensorProto getTensor(int index); - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - int getTensorCount(); - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - java.util.List - getTensorOrBuilderList(); - /** - * repeated .tensorflow.TensorProto tensor = 1; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java deleted file mode 100644 index e2ac61e4dcf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadata.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -/** - *
    - * Metadata for all the tensors in a Snapshot Record.
    - * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotTensorMetadata} - */ -public final class SnapshotTensorMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotTensorMetadata) - SnapshotTensorMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use SnapshotTensorMetadata.newBuilder() to construct. - private SnapshotTensorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SnapshotTensorMetadata() { - tensorMetadata_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SnapshotTensorMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SnapshotTensorMetadata( - 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)) { - tensorMetadata_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensorMetadata_.add( - input.readMessage(org.tensorflow.proto.data.experimental.TensorMetadata.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_ & 0x00000001) != 0)) { - tensorMetadata_ = java.util.Collections.unmodifiableList(tensorMetadata_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - 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_; - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public java.util.List getTensorMetadataList() { - return tensorMetadata_; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public java.util.List - getTensorMetadataOrBuilderList() { - return tensorMetadata_; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public int getTensorMetadataCount() { - return tensorMetadata_.size(); - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - 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.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder( - int index) { - return tensorMetadata_.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 { - for (int i = 0; i < tensorMetadata_.size(); i++) { - output.writeMessage(1, tensorMetadata_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < tensorMetadata_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, tensorMetadata_.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.data.experimental.SnapshotTensorMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.SnapshotTensorMetadata other = (org.tensorflow.proto.data.experimental.SnapshotTensorMetadata) obj; - - if (!getTensorMetadataList() - .equals(other.getTensorMetadataList())) 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 (getTensorMetadataCount() > 0) { - hash = (37 * hash) + TENSOR_METADATA_FIELD_NUMBER; - hash = (53 * hash) + getTensorMetadataList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - 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.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.data.experimental.SnapshotTensorMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.data.experimental.SnapshotTensorMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.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.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.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.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.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.data.experimental.SnapshotTensorMetadata 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.SnapshotTensorMetadata 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; - } - /** - *
    -   * Metadata for all the tensors in a Snapshot Record.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.experimental.SnapshotTensorMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotTensorMetadata) - org.tensorflow.proto.data.experimental.SnapshotTensorMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.class, org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorMetadataFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (tensorMetadataBuilder_ == null) { - tensorMetadata_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - tensorMetadataBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.SnapshotTensorMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.SnapshotTensorMetadata build() { - org.tensorflow.proto.data.experimental.SnapshotTensorMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - 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)) { - tensorMetadata_ = java.util.Collections.unmodifiableList(tensorMetadata_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensorMetadata_ = tensorMetadata_; - } else { - result.tensorMetadata_ = tensorMetadataBuilder_.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.data.experimental.SnapshotTensorMetadata) { - return mergeFrom((org.tensorflow.proto.data.experimental.SnapshotTensorMetadata)other); - } else { - super.mergeFrom(other); - 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()) { - tensorMetadata_ = other.tensorMetadata_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorMetadataIsMutable(); - tensorMetadata_.addAll(other.tensorMetadata_); - } - onChanged(); - } - } else { - if (!other.tensorMetadata_.isEmpty()) { - if (tensorMetadataBuilder_.isEmpty()) { - tensorMetadataBuilder_.dispose(); - tensorMetadataBuilder_ = null; - tensorMetadata_ = other.tensorMetadata_; - bitField0_ = (bitField0_ & ~0x00000001); - tensorMetadataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorMetadataFieldBuilder() : null; - } else { - tensorMetadataBuilder_.addAllMessages(other.tensorMetadata_); - } - } - } - 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.SnapshotTensorMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.SnapshotTensorMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List tensorMetadata_ = - java.util.Collections.emptyList(); - private void ensureTensorMetadataIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensorMetadata_ = new java.util.ArrayList(tensorMetadata_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - 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() { - if (tensorMetadataBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensorMetadata_); - } else { - return tensorMetadataBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public int getTensorMetadataCount() { - if (tensorMetadataBuilder_ == null) { - return tensorMetadata_.size(); - } else { - return tensorMetadataBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public org.tensorflow.proto.data.experimental.TensorMetadata getTensorMetadata(int index) { - if (tensorMetadataBuilder_ == null) { - return tensorMetadata_.get(index); - } else { - return tensorMetadataBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder setTensorMetadata( - int index, org.tensorflow.proto.data.experimental.TensorMetadata value) { - if (tensorMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorMetadataIsMutable(); - tensorMetadata_.set(index, value); - onChanged(); - } else { - tensorMetadataBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder setTensorMetadata( - int index, org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) { - if (tensorMetadataBuilder_ == null) { - ensureTensorMetadataIsMutable(); - tensorMetadata_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorMetadataBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder addTensorMetadata(org.tensorflow.proto.data.experimental.TensorMetadata value) { - if (tensorMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorMetadataIsMutable(); - tensorMetadata_.add(value); - onChanged(); - } else { - tensorMetadataBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder addTensorMetadata( - int index, org.tensorflow.proto.data.experimental.TensorMetadata value) { - if (tensorMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorMetadataIsMutable(); - tensorMetadata_.add(index, value); - onChanged(); - } else { - tensorMetadataBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder addTensorMetadata( - org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) { - if (tensorMetadataBuilder_ == null) { - ensureTensorMetadataIsMutable(); - tensorMetadata_.add(builderForValue.build()); - onChanged(); - } else { - tensorMetadataBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder addTensorMetadata( - int index, org.tensorflow.proto.data.experimental.TensorMetadata.Builder builderForValue) { - if (tensorMetadataBuilder_ == null) { - ensureTensorMetadataIsMutable(); - tensorMetadata_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorMetadataBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder addAllTensorMetadata( - java.lang.Iterable values) { - if (tensorMetadataBuilder_ == null) { - ensureTensorMetadataIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensorMetadata_); - onChanged(); - } else { - tensorMetadataBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder clearTensorMetadata() { - if (tensorMetadataBuilder_ == null) { - tensorMetadata_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - tensorMetadataBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public Builder removeTensorMetadata(int index) { - if (tensorMetadataBuilder_ == null) { - ensureTensorMetadataIsMutable(); - tensorMetadata_.remove(index); - onChanged(); - } else { - tensorMetadataBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - 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.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder( - int index) { - if (tensorMetadataBuilder_ == null) { - return tensorMetadata_.get(index); } else { - return tensorMetadataBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public java.util.List - getTensorMetadataOrBuilderList() { - if (tensorMetadataBuilder_ != null) { - return tensorMetadataBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensorMetadata_); - } - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public org.tensorflow.proto.data.experimental.TensorMetadata.Builder addTensorMetadataBuilder() { - return getTensorMetadataFieldBuilder().addBuilder( - org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance()); - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public org.tensorflow.proto.data.experimental.TensorMetadata.Builder addTensorMetadataBuilder( - int index) { - return getTensorMetadataFieldBuilder().addBuilder( - index, org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance()); - } - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - public java.util.List - getTensorMetadataBuilderList() { - return getTensorMetadataFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - 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.data.experimental.TensorMetadata, org.tensorflow.proto.data.experimental.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder>( - tensorMetadata_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tensorMetadata_ = null; - } - return tensorMetadataBuilder_; - } - @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.SnapshotTensorMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotTensorMetadata) - private static final org.tensorflow.proto.data.experimental.SnapshotTensorMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.SnapshotTensorMetadata(); - } - - public static org.tensorflow.proto.data.experimental.SnapshotTensorMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SnapshotTensorMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SnapshotTensorMetadata(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.SnapshotTensorMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java deleted file mode 100644 index d18a1149928..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/SnapshotTensorMetadataOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -public interface SnapshotTensorMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotTensorMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - java.util.List - getTensorMetadataList(); - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - org.tensorflow.proto.data.experimental.TensorMetadata getTensorMetadata(int index); - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - int getTensorMetadataCount(); - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - java.util.List - getTensorMetadataOrBuilderList(); - /** - * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; - */ - org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder getTensorMetadataOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java deleted file mode 100644 index b8b44dff6ed..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadata.java +++ /dev/null @@ -1,682 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -/** - *
    - * Metadata for a single tensor in the Snapshot Record.
    - * 
    - * - * Protobuf type {@code tensorflow.data.experimental.TensorMetadata} - */ -public final class TensorMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.TensorMetadata) - TensorMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorMetadata.newBuilder() to construct. - private TensorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorMetadata() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorMetadata( - 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 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (tensorShape_ != null) { - subBuilder = tensorShape_.toBuilder(); - } - tensorShape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorShape_); - tensorShape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - tensorSizeBytes_ = 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.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.TensorMetadata.class, org.tensorflow.proto.data.experimental.TensorMetadata.Builder.class); - } - - public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShape_ != null; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - return getTensorShape(); - } - - public static final int TENSOR_SIZE_BYTES_FIELD_NUMBER = 3; - private long tensorSizeBytes_; - /** - *
    -   * Number of uncompressed bytes used to store the tensor representation.
    -   * 
    - * - * int64 tensor_size_bytes = 3; - */ - public long getTensorSizeBytes() { - return tensorSizeBytes_; - } - - 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 (tensorShape_ != null) { - output.writeMessage(2, getTensorShape()); - } - if (tensorSizeBytes_ != 0L) { - output.writeInt64(3, tensorSizeBytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (tensorShape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTensorShape()); - } - if (tensorSizeBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, tensorSizeBytes_); - } - 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.TensorMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.data.experimental.TensorMetadata other = (org.tensorflow.proto.data.experimental.TensorMetadata) obj; - - if (hasTensorShape() != other.hasTensorShape()) return false; - if (hasTensorShape()) { - if (!getTensorShape() - .equals(other.getTensorShape())) return false; - } - if (getTensorSizeBytes() - != other.getTensorSizeBytes()) 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 (hasTensorShape()) { - hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getTensorShape().hashCode(); - } - hash = (37 * hash) + TENSOR_SIZE_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTensorSizeBytes()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - 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.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.data.experimental.TensorMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.data.experimental.TensorMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - 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.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.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.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.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.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.data.experimental.TensorMetadata 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.TensorMetadata 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; - } - /** - *
    -   * Metadata for a single tensor in the Snapshot Record.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.experimental.TensorMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.TensorMetadata) - org.tensorflow.proto.data.experimental.TensorMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - 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.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.experimental.TensorMetadata.class, org.tensorflow.proto.data.experimental.TensorMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.data.experimental.TensorMetadata.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 (tensorShapeBuilder_ == null) { - tensorShape_ = null; - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - tensorSizeBytes_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.experimental.SnapshotProtos.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.TensorMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.data.experimental.TensorMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.experimental.TensorMetadata build() { - org.tensorflow.proto.data.experimental.TensorMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - 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 { - result.tensorShape_ = tensorShapeBuilder_.build(); - } - result.tensorSizeBytes_ = tensorSizeBytes_; - 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.TensorMetadata) { - return mergeFrom((org.tensorflow.proto.data.experimental.TensorMetadata)other); - } else { - super.mergeFrom(other); - 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()); - } - if (other.getTensorSizeBytes() != 0L) { - setTensorSizeBytes(other.getTensorSizeBytes()); - } - 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.TensorMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.experimental.TensorMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> tensorShapeBuilder_; - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShapeBuilder_ != null || tensorShape_ != null; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - if (tensorShapeBuilder_ == null) { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } else { - return tensorShapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorShape_ = value; - onChanged(); - } else { - tensorShapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (tensorShapeBuilder_ == null) { - tensorShape_ = builderForValue.build(); - onChanged(); - } else { - tensorShapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder mergeTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (tensorShape_ != null) { - tensorShape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(tensorShape_).mergeFrom(value).buildPartial(); - } else { - tensorShape_ = value; - } - onChanged(); - } else { - tensorShapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder clearTensorShape() { - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - onChanged(); - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getTensorShapeBuilder() { - - onChanged(); - return getTensorShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - if (tensorShapeBuilder_ != null) { - return tensorShapeBuilder_.getMessageOrBuilder(); - } else { - return tensorShape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - } - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getTensorShapeFieldBuilder() { - if (tensorShapeBuilder_ == null) { - tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getTensorShape(), - getParentForChildren(), - isClean()); - tensorShape_ = null; - } - return tensorShapeBuilder_; - } - - private long tensorSizeBytes_ ; - /** - *
    -     * Number of uncompressed bytes used to store the tensor representation.
    -     * 
    - * - * int64 tensor_size_bytes = 3; - */ - public long getTensorSizeBytes() { - return tensorSizeBytes_; - } - /** - *
    -     * Number of uncompressed bytes used to store the tensor representation.
    -     * 
    - * - * int64 tensor_size_bytes = 3; - */ - public Builder setTensorSizeBytes(long value) { - - tensorSizeBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of uncompressed bytes used to store the tensor representation.
    -     * 
    - * - * int64 tensor_size_bytes = 3; - */ - public Builder clearTensorSizeBytes() { - - tensorSizeBytes_ = 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.TensorMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.TensorMetadata) - private static final org.tensorflow.proto.data.experimental.TensorMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.TensorMetadata(); - } - - public static org.tensorflow.proto.data.experimental.TensorMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorMetadata(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.TensorMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java deleted file mode 100644 index 3aadfb8de72..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/experimental/TensorMetadataOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/snapshot.proto - -package org.tensorflow.proto.data.experimental; - -public interface TensorMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.TensorMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - boolean hasTensorShape(); - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getTensorShape(); - /** - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); - - /** - *
    -   * Number of uncompressed bytes used to store the tensor representation.
    -   * 
    - * - * int64 tensor_size_bytes = 3; - */ - long getTensorSizeBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/AutotuneAlgorithm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/AutotuneAlgorithm.java deleted file mode 100644 index 773c76aff89..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/AutotuneAlgorithm.java +++ /dev/null @@ -1,107 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/model.proto - -package org.tensorflow.proto.data.model; - -/** - *
    - * Algorithm used for model autotuning optimization.
    - * 
    - * - * Protobuf enum {@code tensorflow.data.model.AutotuneAlgorithm} - */ -public enum AutotuneAlgorithm - implements com.google.protobuf.ProtocolMessageEnum { - /** - * HILL_CLIMB = 0; - */ - HILL_CLIMB(0), - /** - * GRADIENT_DESCENT = 1; - */ - GRADIENT_DESCENT(1), - UNRECOGNIZED(-1), - ; - - /** - * HILL_CLIMB = 0; - */ - public static final int HILL_CLIMB_VALUE = 0; - /** - * GRADIENT_DESCENT = 1; - */ - public static final int GRADIENT_DESCENT_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 AutotuneAlgorithm valueOf(int value) { - return forNumber(value); - } - - public static AutotuneAlgorithm forNumber(int value) { - switch (value) { - case 0: return HILL_CLIMB; - case 1: return GRADIENT_DESCENT; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - AutotuneAlgorithm> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AutotuneAlgorithm findValueByNumber(int number) { - return AutotuneAlgorithm.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.data.model.ModelProtos.getDescriptor().getEnumTypes().get(1); - } - - private static final AutotuneAlgorithm[] VALUES = values(); - - public static AutotuneAlgorithm 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 AutotuneAlgorithm(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.data.model.AutotuneAlgorithm) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProto.java deleted file mode 100644 index 21b0beecfb2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProto.java +++ /dev/null @@ -1,5592 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/model.proto - -package org.tensorflow.proto.data.model; - -/** - *
    - * Protocol buffer representing the data used by the autotuning modeling
    - * framework.
    - * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto} - */ -public final class ModelProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto) - ModelProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use ModelProto.newBuilder() to construct. - private ModelProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ModelProto() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ModelProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ModelProto( - 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: { - org.tensorflow.proto.data.model.ModelProto.Node.Builder subBuilder = null; - if (output_ != null) { - subBuilder = output_.toBuilder(); - } - output_ = input.readMessage(org.tensorflow.proto.data.model.ModelProto.Node.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(output_); - output_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - idCounter_ = input.readInt64(); - break; - } - case 24: { - - collectResourceUsage_ = input.readBool(); - break; - } - case 34: { - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder subBuilder = null; - if (optimizationParams_ != null) { - subBuilder = optimizationParams_.toBuilder(); - } - optimizationParams_ = input.readMessage(org.tensorflow.proto.data.model.ModelProto.OptimizationParams.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(optimizationParams_); - optimizationParams_ = subBuilder.buildPartial(); - } - - 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.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.class, org.tensorflow.proto.data.model.ModelProto.Builder.class); - } - - public interface NodeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.Node) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Unique node ID.
    -     * 
    - * - * int64 id = 1; - */ - long getId(); - - /** - *
    -     * Human-readable name of the node.
    -     * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -     * Human-readable name of the node.
    -     * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * An indication whether autotuning is enabled for this node.
    -     * 
    - * - * bool autotune = 3; - */ - boolean getAutotune(); - - /** - *
    -     * The number of bytes stored in this node's buffer.
    -     * 
    - * - * int64 buffered_bytes = 4; - */ - long getBufferedBytes(); - - /** - *
    -     * The number of elements stored in this node's buffer.
    -     * 
    - * - * int64 buffered_elements = 5; - */ - long getBufferedElements(); - - /** - *
    -     * The number of bytes consumed by the node.
    -     * 
    - * - * int64 bytes_consumed = 6; - */ - long getBytesConsumed(); - - /** - *
    -     * The number of bytes produced by the node.
    -     * 
    - * - * int64 bytes_produced = 7; - */ - long getBytesProduced(); - - /** - *
    -     * The number of elements produced by the node.
    -     * 
    - * - * int64 num_elements = 8; - */ - long getNumElements(); - - /** - *
    -     * The aggregate processing time spent in this node.
    -     * 
    - * - * int64 processing_time = 9; - */ - long getProcessingTime(); - - /** - *
    -     * An indication whether this node records metrics about produced and
    -     * consumed elements.
    -     * 
    - * - * bool record_metrics = 10; - */ - boolean getRecordMetrics(); - - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - java.util.List - getParametersList(); - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - org.tensorflow.proto.data.model.ModelProto.Node.Parameter getParameters(int index); - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - int getParametersCount(); - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - java.util.List - getParametersOrBuilderList(); - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( - int index); - - /** - *
    -     * Statistic of inputs processing time history.
    -     * 
    - * - * double input_processing_time_sum = 12; - */ - double getInputProcessingTimeSum(); - - /** - * int64 input_processing_time_count = 13; - */ - long getInputProcessingTimeCount(); - - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - java.util.List - getInputsList(); - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - org.tensorflow.proto.data.model.ModelProto.Node getInputs(int index); - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - int getInputsCount(); - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - java.util.List - getInputsOrBuilderList(); - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getInputsOrBuilder( - int index); - - /** - *
    -     * Class of this node.
    -     * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - int getNodeClassValue(); - /** - *
    -     * Class of this node.
    -     * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - org.tensorflow.proto.data.model.NodeClass getNodeClass(); - - /** - *
    -     * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    -     * ASYNC_KNOWN_RATIO nodes.
    -     * 
    - * - * double ratio = 16; - */ - double getRatio(); - - /** - *
    -     * Ratio identifies how many parallelism calls are introduced by one
    -     * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    -     * 
    - * - * double memory_ratio = 17; - */ - double getMemoryRatio(); - } - /** - *
    -   * General representation of a node in the model.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.Node} - */ - public static final class Node extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.Node) - NodeOrBuilder { - private static final long serialVersionUID = 0L; - // Use Node.newBuilder() to construct. - private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Node() { - name_ = ""; - parameters_ = java.util.Collections.emptyList(); - inputs_ = java.util.Collections.emptyList(); - nodeClass_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Node(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Node( - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 24: { - - autotune_ = input.readBool(); - break; - } - case 32: { - - bufferedBytes_ = input.readInt64(); - break; - } - case 40: { - - bufferedElements_ = input.readInt64(); - break; - } - case 48: { - - bytesConsumed_ = input.readInt64(); - break; - } - case 56: { - - bytesProduced_ = input.readInt64(); - break; - } - case 64: { - - numElements_ = input.readInt64(); - break; - } - case 72: { - - processingTime_ = input.readInt64(); - break; - } - case 80: { - - recordMetrics_ = input.readBool(); - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - parameters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - parameters_.add( - input.readMessage(org.tensorflow.proto.data.model.ModelProto.Node.Parameter.parser(), extensionRegistry)); - break; - } - case 97: { - - inputProcessingTimeSum_ = input.readDouble(); - break; - } - case 104: { - - inputProcessingTimeCount_ = input.readInt64(); - break; - } - case 114: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - inputs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - inputs_.add( - input.readMessage(org.tensorflow.proto.data.model.ModelProto.Node.parser(), extensionRegistry)); - break; - } - case 120: { - int rawValue = input.readEnum(); - - nodeClass_ = rawValue; - break; - } - case 129: { - - ratio_ = input.readDouble(); - break; - } - case 137: { - - memoryRatio_ = input.readDouble(); - 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)) { - parameters_ = java.util.Collections.unmodifiableList(parameters_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - inputs_ = java.util.Collections.unmodifiableList(inputs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.Node.class, org.tensorflow.proto.data.model.ModelProto.Node.Builder.class); - } - - public interface ParameterOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.Node.Parameter) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * Human-readable name of the parameter.
    -       * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -       * Human-readable name of the parameter.
    -       * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -       * Identifies the model value of the parameter. This can be different from
    -       * the actual value (e.g. during optimization search).
    -       * 
    - * - * double value = 2; - */ - double getValue(); - - /** - *
    -       * The actual value of the parameter.
    -       * 
    - * - * double state_value = 3; - */ - double getStateValue(); - - /** - *
    -       * Minimum value of the parameter.
    -       * 
    - * - * double min = 4; - */ - double getMin(); - - /** - *
    -       * Maximum value of the parameter.
    -       * 
    - * - * double max = 5; - */ - double getMax(); - - /** - *
    -       * Identifies whether the parameter should participate in autotuning.
    -       * 
    - * - * bool tunable = 6; - */ - boolean getTunable(); - } - /** - *
    -     * Represents a node parameter.
    -     * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.Node.Parameter} - */ - public static final class Parameter extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.Node.Parameter) - ParameterOrBuilder { - private static final long serialVersionUID = 0L; - // Use Parameter.newBuilder() to construct. - private Parameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Parameter() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Parameter(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Parameter( - 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 17: { - - value_ = input.readDouble(); - break; - } - case 25: { - - stateValue_ = input.readDouble(); - break; - } - case 33: { - - min_ = input.readDouble(); - break; - } - case 41: { - - max_ = input.readDouble(); - break; - } - case 48: { - - tunable_ = input.readBool(); - 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.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.Node.Parameter.class, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -       * Human-readable name of the parameter.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Human-readable name of the parameter.
    -       * 
    - * - * 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 VALUE_FIELD_NUMBER = 2; - private double value_; - /** - *
    -       * Identifies the model value of the parameter. This can be different from
    -       * the actual value (e.g. during optimization search).
    -       * 
    - * - * double value = 2; - */ - public double getValue() { - return value_; - } - - public static final int STATE_VALUE_FIELD_NUMBER = 3; - private double stateValue_; - /** - *
    -       * The actual value of the parameter.
    -       * 
    - * - * double state_value = 3; - */ - public double getStateValue() { - return stateValue_; - } - - public static final int MIN_FIELD_NUMBER = 4; - private double min_; - /** - *
    -       * Minimum value of the parameter.
    -       * 
    - * - * double min = 4; - */ - public double getMin() { - return min_; - } - - public static final int MAX_FIELD_NUMBER = 5; - private double max_; - /** - *
    -       * Maximum value of the parameter.
    -       * 
    - * - * double max = 5; - */ - public double getMax() { - return max_; - } - - public static final int TUNABLE_FIELD_NUMBER = 6; - private boolean tunable_; - /** - *
    -       * Identifies whether the parameter should participate in autotuning.
    -       * 
    - * - * bool tunable = 6; - */ - public boolean getTunable() { - return tunable_; - } - - 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 (value_ != 0D) { - output.writeDouble(2, value_); - } - if (stateValue_ != 0D) { - output.writeDouble(3, stateValue_); - } - if (min_ != 0D) { - output.writeDouble(4, min_); - } - if (max_ != 0D) { - output.writeDouble(5, max_); - } - if (tunable_ != false) { - output.writeBool(6, tunable_); - } - 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 (value_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, value_); - } - if (stateValue_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, stateValue_); - } - if (min_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, min_); - } - if (max_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(5, max_); - } - if (tunable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, tunable_); - } - 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.model.ModelProto.Node.Parameter)) { - return super.equals(obj); - } - org.tensorflow.proto.data.model.ModelProto.Node.Parameter other = (org.tensorflow.proto.data.model.ModelProto.Node.Parameter) obj; - - if (!getName() - .equals(other.getName())) return false; - if (java.lang.Double.doubleToLongBits(getValue()) - != java.lang.Double.doubleToLongBits( - other.getValue())) return false; - if (java.lang.Double.doubleToLongBits(getStateValue()) - != java.lang.Double.doubleToLongBits( - other.getStateValue())) return false; - if (java.lang.Double.doubleToLongBits(getMin()) - != java.lang.Double.doubleToLongBits( - other.getMin())) return false; - if (java.lang.Double.doubleToLongBits(getMax()) - != java.lang.Double.doubleToLongBits( - other.getMax())) return false; - if (getTunable() - != other.getTunable()) 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) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getValue())); - hash = (37 * hash) + STATE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getStateValue())); - hash = (37 * hash) + MIN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMin())); - hash = (37 * hash) + MAX_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMax())); - hash = (37 * hash) + TUNABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTunable()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter 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.model.ModelProto.Node.Parameter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter 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.model.ModelProto.Node.Parameter parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter 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.model.ModelProto.Node.Parameter parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter 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.model.ModelProto.Node.Parameter parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter 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.model.ModelProto.Node.Parameter 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; - } - /** - *
    -       * Represents a node parameter.
    -       * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.Node.Parameter} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.Node.Parameter) - org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.Node.Parameter.class, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder.class); - } - - // Construct using org.tensorflow.proto.data.model.ModelProto.Node.Parameter.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_ = ""; - - value_ = 0D; - - stateValue_ = 0D; - - min_ = 0D; - - max_ = 0D; - - tunable_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter getDefaultInstanceForType() { - return org.tensorflow.proto.data.model.ModelProto.Node.Parameter.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter build() { - org.tensorflow.proto.data.model.ModelProto.Node.Parameter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter buildPartial() { - org.tensorflow.proto.data.model.ModelProto.Node.Parameter result = new org.tensorflow.proto.data.model.ModelProto.Node.Parameter(this); - result.name_ = name_; - result.value_ = value_; - result.stateValue_ = stateValue_; - result.min_ = min_; - result.max_ = max_; - result.tunable_ = tunable_; - 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.model.ModelProto.Node.Parameter) { - return mergeFrom((org.tensorflow.proto.data.model.ModelProto.Node.Parameter)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.model.ModelProto.Node.Parameter other) { - if (other == org.tensorflow.proto.data.model.ModelProto.Node.Parameter.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getValue() != 0D) { - setValue(other.getValue()); - } - if (other.getStateValue() != 0D) { - setStateValue(other.getStateValue()); - } - if (other.getMin() != 0D) { - setMin(other.getMin()); - } - if (other.getMax() != 0D) { - setMax(other.getMax()); - } - if (other.getTunable() != false) { - setTunable(other.getTunable()); - } - 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.model.ModelProto.Node.Parameter parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.model.ModelProto.Node.Parameter) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -         * Human-readable name of the parameter.
    -         * 
    - * - * 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; - } - } - /** - *
    -         * Human-readable name of the parameter.
    -         * 
    - * - * 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; - } - } - /** - *
    -         * Human-readable name of the parameter.
    -         * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -         * Human-readable name of the parameter.
    -         * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -         * Human-readable name of the parameter.
    -         * 
    - * - * 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 double value_ ; - /** - *
    -         * Identifies the model value of the parameter. This can be different from
    -         * the actual value (e.g. during optimization search).
    -         * 
    - * - * double value = 2; - */ - public double getValue() { - return value_; - } - /** - *
    -         * Identifies the model value of the parameter. This can be different from
    -         * the actual value (e.g. during optimization search).
    -         * 
    - * - * double value = 2; - */ - public Builder setValue(double value) { - - value_ = value; - onChanged(); - return this; - } - /** - *
    -         * Identifies the model value of the parameter. This can be different from
    -         * the actual value (e.g. during optimization search).
    -         * 
    - * - * double value = 2; - */ - public Builder clearValue() { - - value_ = 0D; - onChanged(); - return this; - } - - private double stateValue_ ; - /** - *
    -         * The actual value of the parameter.
    -         * 
    - * - * double state_value = 3; - */ - public double getStateValue() { - return stateValue_; - } - /** - *
    -         * The actual value of the parameter.
    -         * 
    - * - * double state_value = 3; - */ - public Builder setStateValue(double value) { - - stateValue_ = value; - onChanged(); - return this; - } - /** - *
    -         * The actual value of the parameter.
    -         * 
    - * - * double state_value = 3; - */ - public Builder clearStateValue() { - - stateValue_ = 0D; - onChanged(); - return this; - } - - private double min_ ; - /** - *
    -         * Minimum value of the parameter.
    -         * 
    - * - * double min = 4; - */ - public double getMin() { - return min_; - } - /** - *
    -         * Minimum value of the parameter.
    -         * 
    - * - * double min = 4; - */ - public Builder setMin(double value) { - - min_ = value; - onChanged(); - return this; - } - /** - *
    -         * Minimum value of the parameter.
    -         * 
    - * - * double min = 4; - */ - public Builder clearMin() { - - min_ = 0D; - onChanged(); - return this; - } - - private double max_ ; - /** - *
    -         * Maximum value of the parameter.
    -         * 
    - * - * double max = 5; - */ - public double getMax() { - return max_; - } - /** - *
    -         * Maximum value of the parameter.
    -         * 
    - * - * double max = 5; - */ - public Builder setMax(double value) { - - max_ = value; - onChanged(); - return this; - } - /** - *
    -         * Maximum value of the parameter.
    -         * 
    - * - * double max = 5; - */ - public Builder clearMax() { - - max_ = 0D; - onChanged(); - return this; - } - - private boolean tunable_ ; - /** - *
    -         * Identifies whether the parameter should participate in autotuning.
    -         * 
    - * - * bool tunable = 6; - */ - public boolean getTunable() { - return tunable_; - } - /** - *
    -         * Identifies whether the parameter should participate in autotuning.
    -         * 
    - * - * bool tunable = 6; - */ - public Builder setTunable(boolean value) { - - tunable_ = value; - onChanged(); - return this; - } - /** - *
    -         * Identifies whether the parameter should participate in autotuning.
    -         * 
    - * - * bool tunable = 6; - */ - public Builder clearTunable() { - - tunable_ = false; - 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.model.ModelProto.Node.Parameter) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.Node.Parameter) - private static final org.tensorflow.proto.data.model.ModelProto.Node.Parameter DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.ModelProto.Node.Parameter(); - } - - public static org.tensorflow.proto.data.model.ModelProto.Node.Parameter getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Parameter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Parameter(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.model.ModelProto.Node.Parameter getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - *
    -     * Unique node ID.
    -     * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -     * Human-readable name of the node.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Human-readable name of the node.
    -     * 
    - * - * string name = 2; - */ - 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 AUTOTUNE_FIELD_NUMBER = 3; - private boolean autotune_; - /** - *
    -     * An indication whether autotuning is enabled for this node.
    -     * 
    - * - * bool autotune = 3; - */ - public boolean getAutotune() { - return autotune_; - } - - public static final int BUFFERED_BYTES_FIELD_NUMBER = 4; - private long bufferedBytes_; - /** - *
    -     * The number of bytes stored in this node's buffer.
    -     * 
    - * - * int64 buffered_bytes = 4; - */ - public long getBufferedBytes() { - return bufferedBytes_; - } - - public static final int BUFFERED_ELEMENTS_FIELD_NUMBER = 5; - private long bufferedElements_; - /** - *
    -     * The number of elements stored in this node's buffer.
    -     * 
    - * - * int64 buffered_elements = 5; - */ - public long getBufferedElements() { - return bufferedElements_; - } - - public static final int BYTES_CONSUMED_FIELD_NUMBER = 6; - private long bytesConsumed_; - /** - *
    -     * The number of bytes consumed by the node.
    -     * 
    - * - * int64 bytes_consumed = 6; - */ - public long getBytesConsumed() { - return bytesConsumed_; - } - - public static final int BYTES_PRODUCED_FIELD_NUMBER = 7; - private long bytesProduced_; - /** - *
    -     * The number of bytes produced by the node.
    -     * 
    - * - * int64 bytes_produced = 7; - */ - public long getBytesProduced() { - return bytesProduced_; - } - - public static final int NUM_ELEMENTS_FIELD_NUMBER = 8; - private long numElements_; - /** - *
    -     * The number of elements produced by the node.
    -     * 
    - * - * int64 num_elements = 8; - */ - public long getNumElements() { - return numElements_; - } - - public static final int PROCESSING_TIME_FIELD_NUMBER = 9; - private long processingTime_; - /** - *
    -     * The aggregate processing time spent in this node.
    -     * 
    - * - * int64 processing_time = 9; - */ - public long getProcessingTime() { - return processingTime_; - } - - public static final int RECORD_METRICS_FIELD_NUMBER = 10; - private boolean recordMetrics_; - /** - *
    -     * An indication whether this node records metrics about produced and
    -     * consumed elements.
    -     * 
    - * - * bool record_metrics = 10; - */ - public boolean getRecordMetrics() { - return recordMetrics_; - } - - public static final int PARAMETERS_FIELD_NUMBER = 11; - private java.util.List parameters_; - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public java.util.List getParametersList() { - return parameters_; - } - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public java.util.List - getParametersOrBuilderList() { - return parameters_; - } - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public int getParametersCount() { - return parameters_.size(); - } - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter getParameters(int index) { - return parameters_.get(index); - } - /** - *
    -     * Parameters of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( - int index) { - return parameters_.get(index); - } - - public static final int INPUT_PROCESSING_TIME_SUM_FIELD_NUMBER = 12; - private double inputProcessingTimeSum_; - /** - *
    -     * Statistic of inputs processing time history.
    -     * 
    - * - * double input_processing_time_sum = 12; - */ - public double getInputProcessingTimeSum() { - return inputProcessingTimeSum_; - } - - public static final int INPUT_PROCESSING_TIME_COUNT_FIELD_NUMBER = 13; - private long inputProcessingTimeCount_; - /** - * int64 input_processing_time_count = 13; - */ - public long getInputProcessingTimeCount() { - return inputProcessingTimeCount_; - } - - public static final int INPUTS_FIELD_NUMBER = 14; - private java.util.List inputs_; - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public java.util.List getInputsList() { - return inputs_; - } - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public java.util.List - getInputsOrBuilderList() { - return inputs_; - } - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public int getInputsCount() { - return inputs_.size(); - } - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.Node getInputs(int index) { - return inputs_.get(index); - } - /** - *
    -     * Inputs of this node.
    -     * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getInputsOrBuilder( - int index) { - return inputs_.get(index); - } - - public static final int NODE_CLASS_FIELD_NUMBER = 15; - private int nodeClass_; - /** - *
    -     * Class of this node.
    -     * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public int getNodeClassValue() { - return nodeClass_; - } - /** - *
    -     * Class of this node.
    -     * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public org.tensorflow.proto.data.model.NodeClass getNodeClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.model.NodeClass result = org.tensorflow.proto.data.model.NodeClass.valueOf(nodeClass_); - return result == null ? org.tensorflow.proto.data.model.NodeClass.UNRECOGNIZED : result; - } - - public static final int RATIO_FIELD_NUMBER = 16; - private double ratio_; - /** - *
    -     * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    -     * ASYNC_KNOWN_RATIO nodes.
    -     * 
    - * - * double ratio = 16; - */ - public double getRatio() { - return ratio_; - } - - public static final int MEMORY_RATIO_FIELD_NUMBER = 17; - private double memoryRatio_; - /** - *
    -     * Ratio identifies how many parallelism calls are introduced by one
    -     * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    -     * 
    - * - * double memory_ratio = 17; - */ - public double getMemoryRatio() { - return memoryRatio_; - } - - 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 (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (autotune_ != false) { - output.writeBool(3, autotune_); - } - if (bufferedBytes_ != 0L) { - output.writeInt64(4, bufferedBytes_); - } - if (bufferedElements_ != 0L) { - output.writeInt64(5, bufferedElements_); - } - if (bytesConsumed_ != 0L) { - output.writeInt64(6, bytesConsumed_); - } - if (bytesProduced_ != 0L) { - output.writeInt64(7, bytesProduced_); - } - if (numElements_ != 0L) { - output.writeInt64(8, numElements_); - } - if (processingTime_ != 0L) { - output.writeInt64(9, processingTime_); - } - if (recordMetrics_ != false) { - output.writeBool(10, recordMetrics_); - } - for (int i = 0; i < parameters_.size(); i++) { - output.writeMessage(11, parameters_.get(i)); - } - if (inputProcessingTimeSum_ != 0D) { - output.writeDouble(12, inputProcessingTimeSum_); - } - if (inputProcessingTimeCount_ != 0L) { - output.writeInt64(13, inputProcessingTimeCount_); - } - for (int i = 0; i < inputs_.size(); i++) { - output.writeMessage(14, inputs_.get(i)); - } - if (nodeClass_ != org.tensorflow.proto.data.model.NodeClass.UNKNOWN.getNumber()) { - output.writeEnum(15, nodeClass_); - } - if (ratio_ != 0D) { - output.writeDouble(16, ratio_); - } - if (memoryRatio_ != 0D) { - output.writeDouble(17, memoryRatio_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (autotune_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, autotune_); - } - if (bufferedBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, bufferedBytes_); - } - if (bufferedElements_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, bufferedElements_); - } - if (bytesConsumed_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, bytesConsumed_); - } - if (bytesProduced_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(7, bytesProduced_); - } - if (numElements_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(8, numElements_); - } - if (processingTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, processingTime_); - } - if (recordMetrics_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, recordMetrics_); - } - for (int i = 0; i < parameters_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, parameters_.get(i)); - } - if (inputProcessingTimeSum_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(12, inputProcessingTimeSum_); - } - if (inputProcessingTimeCount_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(13, inputProcessingTimeCount_); - } - for (int i = 0; i < inputs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, inputs_.get(i)); - } - if (nodeClass_ != org.tensorflow.proto.data.model.NodeClass.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(15, nodeClass_); - } - if (ratio_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(16, ratio_); - } - if (memoryRatio_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(17, memoryRatio_); - } - 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.model.ModelProto.Node)) { - return super.equals(obj); - } - org.tensorflow.proto.data.model.ModelProto.Node other = (org.tensorflow.proto.data.model.ModelProto.Node) obj; - - if (getId() - != other.getId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (getAutotune() - != other.getAutotune()) return false; - if (getBufferedBytes() - != other.getBufferedBytes()) return false; - if (getBufferedElements() - != other.getBufferedElements()) return false; - if (getBytesConsumed() - != other.getBytesConsumed()) return false; - if (getBytesProduced() - != other.getBytesProduced()) return false; - if (getNumElements() - != other.getNumElements()) return false; - if (getProcessingTime() - != other.getProcessingTime()) return false; - if (getRecordMetrics() - != other.getRecordMetrics()) return false; - if (!getParametersList() - .equals(other.getParametersList())) return false; - if (java.lang.Double.doubleToLongBits(getInputProcessingTimeSum()) - != java.lang.Double.doubleToLongBits( - other.getInputProcessingTimeSum())) return false; - if (getInputProcessingTimeCount() - != other.getInputProcessingTimeCount()) return false; - if (!getInputsList() - .equals(other.getInputsList())) return false; - if (nodeClass_ != other.nodeClass_) return false; - if (java.lang.Double.doubleToLongBits(getRatio()) - != java.lang.Double.doubleToLongBits( - other.getRatio())) return false; - if (java.lang.Double.doubleToLongBits(getMemoryRatio()) - != java.lang.Double.doubleToLongBits( - other.getMemoryRatio())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + AUTOTUNE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAutotune()); - hash = (37 * hash) + BUFFERED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBufferedBytes()); - hash = (37 * hash) + BUFFERED_ELEMENTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBufferedElements()); - hash = (37 * hash) + BYTES_CONSUMED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBytesConsumed()); - hash = (37 * hash) + BYTES_PRODUCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBytesProduced()); - hash = (37 * hash) + NUM_ELEMENTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumElements()); - hash = (37 * hash) + PROCESSING_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getProcessingTime()); - hash = (37 * hash) + RECORD_METRICS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getRecordMetrics()); - if (getParametersCount() > 0) { - hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; - hash = (53 * hash) + getParametersList().hashCode(); - } - hash = (37 * hash) + INPUT_PROCESSING_TIME_SUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getInputProcessingTimeSum())); - hash = (37 * hash) + INPUT_PROCESSING_TIME_COUNT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getInputProcessingTimeCount()); - if (getInputsCount() > 0) { - hash = (37 * hash) + INPUTS_FIELD_NUMBER; - hash = (53 * hash) + getInputsList().hashCode(); - } - hash = (37 * hash) + NODE_CLASS_FIELD_NUMBER; - hash = (53 * hash) + nodeClass_; - hash = (37 * hash) + RATIO_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getRatio())); - hash = (37 * hash) + MEMORY_RATIO_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMemoryRatio())); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.model.ModelProto.Node parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node 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.model.ModelProto.Node parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node 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.model.ModelProto.Node parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.Node parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.model.ModelProto.Node parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node 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.model.ModelProto.Node parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node 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.model.ModelProto.Node parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.Node 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.model.ModelProto.Node 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; - } - /** - *
    -     * General representation of a node in the model.
    -     * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.Node} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.Node) - org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.Node.class, org.tensorflow.proto.data.model.ModelProto.Node.Builder.class); - } - - // Construct using org.tensorflow.proto.data.model.ModelProto.Node.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getParametersFieldBuilder(); - getInputsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0L; - - name_ = ""; - - autotune_ = false; - - bufferedBytes_ = 0L; - - bufferedElements_ = 0L; - - bytesConsumed_ = 0L; - - bytesProduced_ = 0L; - - numElements_ = 0L; - - processingTime_ = 0L; - - recordMetrics_ = false; - - if (parametersBuilder_ == null) { - parameters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - parametersBuilder_.clear(); - } - inputProcessingTimeSum_ = 0D; - - inputProcessingTimeCount_ = 0L; - - if (inputsBuilder_ == null) { - inputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - inputsBuilder_.clear(); - } - nodeClass_ = 0; - - ratio_ = 0D; - - memoryRatio_ = 0D; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node getDefaultInstanceForType() { - return org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node build() { - org.tensorflow.proto.data.model.ModelProto.Node result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.Node buildPartial() { - org.tensorflow.proto.data.model.ModelProto.Node result = new org.tensorflow.proto.data.model.ModelProto.Node(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.name_ = name_; - result.autotune_ = autotune_; - result.bufferedBytes_ = bufferedBytes_; - result.bufferedElements_ = bufferedElements_; - result.bytesConsumed_ = bytesConsumed_; - result.bytesProduced_ = bytesProduced_; - result.numElements_ = numElements_; - result.processingTime_ = processingTime_; - result.recordMetrics_ = recordMetrics_; - if (parametersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - parameters_ = java.util.Collections.unmodifiableList(parameters_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.parameters_ = parameters_; - } else { - result.parameters_ = parametersBuilder_.build(); - } - result.inputProcessingTimeSum_ = inputProcessingTimeSum_; - result.inputProcessingTimeCount_ = inputProcessingTimeCount_; - if (inputsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - inputs_ = java.util.Collections.unmodifiableList(inputs_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.inputs_ = inputs_; - } else { - result.inputs_ = inputsBuilder_.build(); - } - result.nodeClass_ = nodeClass_; - result.ratio_ = ratio_; - result.memoryRatio_ = memoryRatio_; - 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.model.ModelProto.Node) { - return mergeFrom((org.tensorflow.proto.data.model.ModelProto.Node)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.model.ModelProto.Node other) { - if (other == org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getAutotune() != false) { - setAutotune(other.getAutotune()); - } - if (other.getBufferedBytes() != 0L) { - setBufferedBytes(other.getBufferedBytes()); - } - if (other.getBufferedElements() != 0L) { - setBufferedElements(other.getBufferedElements()); - } - if (other.getBytesConsumed() != 0L) { - setBytesConsumed(other.getBytesConsumed()); - } - if (other.getBytesProduced() != 0L) { - setBytesProduced(other.getBytesProduced()); - } - if (other.getNumElements() != 0L) { - setNumElements(other.getNumElements()); - } - if (other.getProcessingTime() != 0L) { - setProcessingTime(other.getProcessingTime()); - } - if (other.getRecordMetrics() != false) { - setRecordMetrics(other.getRecordMetrics()); - } - if (parametersBuilder_ == null) { - if (!other.parameters_.isEmpty()) { - if (parameters_.isEmpty()) { - parameters_ = other.parameters_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureParametersIsMutable(); - parameters_.addAll(other.parameters_); - } - onChanged(); - } - } else { - if (!other.parameters_.isEmpty()) { - if (parametersBuilder_.isEmpty()) { - parametersBuilder_.dispose(); - parametersBuilder_ = null; - parameters_ = other.parameters_; - bitField0_ = (bitField0_ & ~0x00000001); - parametersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getParametersFieldBuilder() : null; - } else { - parametersBuilder_.addAllMessages(other.parameters_); - } - } - } - if (other.getInputProcessingTimeSum() != 0D) { - setInputProcessingTimeSum(other.getInputProcessingTimeSum()); - } - if (other.getInputProcessingTimeCount() != 0L) { - setInputProcessingTimeCount(other.getInputProcessingTimeCount()); - } - if (inputsBuilder_ == null) { - if (!other.inputs_.isEmpty()) { - if (inputs_.isEmpty()) { - inputs_ = other.inputs_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInputsIsMutable(); - inputs_.addAll(other.inputs_); - } - onChanged(); - } - } else { - if (!other.inputs_.isEmpty()) { - if (inputsBuilder_.isEmpty()) { - inputsBuilder_.dispose(); - inputsBuilder_ = null; - inputs_ = other.inputs_; - bitField0_ = (bitField0_ & ~0x00000002); - inputsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInputsFieldBuilder() : null; - } else { - inputsBuilder_.addAllMessages(other.inputs_); - } - } - } - if (other.nodeClass_ != 0) { - setNodeClassValue(other.getNodeClassValue()); - } - if (other.getRatio() != 0D) { - setRatio(other.getRatio()); - } - if (other.getMemoryRatio() != 0D) { - setMemoryRatio(other.getMemoryRatio()); - } - 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.model.ModelProto.Node parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.model.ModelProto.Node) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long id_ ; - /** - *
    -       * Unique node ID.
    -       * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - /** - *
    -       * Unique node ID.
    -       * 
    - * - * int64 id = 1; - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
    -       * Unique node ID.
    -       * 
    - * - * int64 id = 1; - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -       * Human-readable name of the node.
    -       * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -       * Human-readable name of the node.
    -       * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -       * Human-readable name of the node.
    -       * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * Human-readable name of the node.
    -       * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Human-readable name of the node.
    -       * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private boolean autotune_ ; - /** - *
    -       * An indication whether autotuning is enabled for this node.
    -       * 
    - * - * bool autotune = 3; - */ - public boolean getAutotune() { - return autotune_; - } - /** - *
    -       * An indication whether autotuning is enabled for this node.
    -       * 
    - * - * bool autotune = 3; - */ - public Builder setAutotune(boolean value) { - - autotune_ = value; - onChanged(); - return this; - } - /** - *
    -       * An indication whether autotuning is enabled for this node.
    -       * 
    - * - * bool autotune = 3; - */ - public Builder clearAutotune() { - - autotune_ = false; - onChanged(); - return this; - } - - private long bufferedBytes_ ; - /** - *
    -       * The number of bytes stored in this node's buffer.
    -       * 
    - * - * int64 buffered_bytes = 4; - */ - public long getBufferedBytes() { - return bufferedBytes_; - } - /** - *
    -       * The number of bytes stored in this node's buffer.
    -       * 
    - * - * int64 buffered_bytes = 4; - */ - public Builder setBufferedBytes(long value) { - - bufferedBytes_ = value; - onChanged(); - return this; - } - /** - *
    -       * The number of bytes stored in this node's buffer.
    -       * 
    - * - * int64 buffered_bytes = 4; - */ - public Builder clearBufferedBytes() { - - bufferedBytes_ = 0L; - onChanged(); - return this; - } - - private long bufferedElements_ ; - /** - *
    -       * The number of elements stored in this node's buffer.
    -       * 
    - * - * int64 buffered_elements = 5; - */ - public long getBufferedElements() { - return bufferedElements_; - } - /** - *
    -       * The number of elements stored in this node's buffer.
    -       * 
    - * - * int64 buffered_elements = 5; - */ - public Builder setBufferedElements(long value) { - - bufferedElements_ = value; - onChanged(); - return this; - } - /** - *
    -       * The number of elements stored in this node's buffer.
    -       * 
    - * - * int64 buffered_elements = 5; - */ - public Builder clearBufferedElements() { - - bufferedElements_ = 0L; - onChanged(); - return this; - } - - private long bytesConsumed_ ; - /** - *
    -       * The number of bytes consumed by the node.
    -       * 
    - * - * int64 bytes_consumed = 6; - */ - public long getBytesConsumed() { - return bytesConsumed_; - } - /** - *
    -       * The number of bytes consumed by the node.
    -       * 
    - * - * int64 bytes_consumed = 6; - */ - public Builder setBytesConsumed(long value) { - - bytesConsumed_ = value; - onChanged(); - return this; - } - /** - *
    -       * The number of bytes consumed by the node.
    -       * 
    - * - * int64 bytes_consumed = 6; - */ - public Builder clearBytesConsumed() { - - bytesConsumed_ = 0L; - onChanged(); - return this; - } - - private long bytesProduced_ ; - /** - *
    -       * The number of bytes produced by the node.
    -       * 
    - * - * int64 bytes_produced = 7; - */ - public long getBytesProduced() { - return bytesProduced_; - } - /** - *
    -       * The number of bytes produced by the node.
    -       * 
    - * - * int64 bytes_produced = 7; - */ - public Builder setBytesProduced(long value) { - - bytesProduced_ = value; - onChanged(); - return this; - } - /** - *
    -       * The number of bytes produced by the node.
    -       * 
    - * - * int64 bytes_produced = 7; - */ - public Builder clearBytesProduced() { - - bytesProduced_ = 0L; - onChanged(); - return this; - } - - private long numElements_ ; - /** - *
    -       * The number of elements produced by the node.
    -       * 
    - * - * int64 num_elements = 8; - */ - public long getNumElements() { - return numElements_; - } - /** - *
    -       * The number of elements produced by the node.
    -       * 
    - * - * int64 num_elements = 8; - */ - public Builder setNumElements(long value) { - - numElements_ = value; - onChanged(); - return this; - } - /** - *
    -       * The number of elements produced by the node.
    -       * 
    - * - * int64 num_elements = 8; - */ - public Builder clearNumElements() { - - numElements_ = 0L; - onChanged(); - return this; - } - - private long processingTime_ ; - /** - *
    -       * The aggregate processing time spent in this node.
    -       * 
    - * - * int64 processing_time = 9; - */ - public long getProcessingTime() { - return processingTime_; - } - /** - *
    -       * The aggregate processing time spent in this node.
    -       * 
    - * - * int64 processing_time = 9; - */ - public Builder setProcessingTime(long value) { - - processingTime_ = value; - onChanged(); - return this; - } - /** - *
    -       * The aggregate processing time spent in this node.
    -       * 
    - * - * int64 processing_time = 9; - */ - public Builder clearProcessingTime() { - - processingTime_ = 0L; - onChanged(); - return this; - } - - private boolean recordMetrics_ ; - /** - *
    -       * An indication whether this node records metrics about produced and
    -       * consumed elements.
    -       * 
    - * - * bool record_metrics = 10; - */ - public boolean getRecordMetrics() { - return recordMetrics_; - } - /** - *
    -       * An indication whether this node records metrics about produced and
    -       * consumed elements.
    -       * 
    - * - * bool record_metrics = 10; - */ - public Builder setRecordMetrics(boolean value) { - - recordMetrics_ = value; - onChanged(); - return this; - } - /** - *
    -       * An indication whether this node records metrics about produced and
    -       * consumed elements.
    -       * 
    - * - * bool record_metrics = 10; - */ - public Builder clearRecordMetrics() { - - recordMetrics_ = false; - onChanged(); - return this; - } - - private java.util.List parameters_ = - java.util.Collections.emptyList(); - private void ensureParametersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - parameters_ = new java.util.ArrayList(parameters_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder> parametersBuilder_; - - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public java.util.List getParametersList() { - if (parametersBuilder_ == null) { - return java.util.Collections.unmodifiableList(parameters_); - } else { - return parametersBuilder_.getMessageList(); - } - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public int getParametersCount() { - if (parametersBuilder_ == null) { - return parameters_.size(); - } else { - return parametersBuilder_.getCount(); - } - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter getParameters(int index) { - if (parametersBuilder_ == null) { - return parameters_.get(index); - } else { - return parametersBuilder_.getMessage(index); - } - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder setParameters( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Parameter value) { - if (parametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureParametersIsMutable(); - parameters_.set(index, value); - onChanged(); - } else { - parametersBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder setParameters( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder builderForValue) { - if (parametersBuilder_ == null) { - ensureParametersIsMutable(); - parameters_.set(index, builderForValue.build()); - onChanged(); - } else { - parametersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder addParameters(org.tensorflow.proto.data.model.ModelProto.Node.Parameter value) { - if (parametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureParametersIsMutable(); - parameters_.add(value); - onChanged(); - } else { - parametersBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder addParameters( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Parameter value) { - if (parametersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureParametersIsMutable(); - parameters_.add(index, value); - onChanged(); - } else { - parametersBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder addParameters( - org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder builderForValue) { - if (parametersBuilder_ == null) { - ensureParametersIsMutable(); - parameters_.add(builderForValue.build()); - onChanged(); - } else { - parametersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder addParameters( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder builderForValue) { - if (parametersBuilder_ == null) { - ensureParametersIsMutable(); - parameters_.add(index, builderForValue.build()); - onChanged(); - } else { - parametersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder addAllParameters( - java.lang.Iterable values) { - if (parametersBuilder_ == null) { - ensureParametersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, parameters_); - onChanged(); - } else { - parametersBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder clearParameters() { - if (parametersBuilder_ == null) { - parameters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - parametersBuilder_.clear(); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public Builder removeParameters(int index) { - if (parametersBuilder_ == null) { - ensureParametersIsMutable(); - parameters_.remove(index); - onChanged(); - } else { - parametersBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder getParametersBuilder( - int index) { - return getParametersFieldBuilder().getBuilder(index); - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( - int index) { - if (parametersBuilder_ == null) { - return parameters_.get(index); } else { - return parametersBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public java.util.List - getParametersOrBuilderList() { - if (parametersBuilder_ != null) { - return parametersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(parameters_); - } - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder addParametersBuilder() { - return getParametersFieldBuilder().addBuilder( - org.tensorflow.proto.data.model.ModelProto.Node.Parameter.getDefaultInstance()); - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder addParametersBuilder( - int index) { - return getParametersFieldBuilder().addBuilder( - index, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.getDefaultInstance()); - } - /** - *
    -       * Parameters of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; - */ - public java.util.List - getParametersBuilderList() { - return getParametersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder> - getParametersFieldBuilder() { - if (parametersBuilder_ == null) { - parametersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.ModelProto.Node.ParameterOrBuilder>( - parameters_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - parameters_ = null; - } - return parametersBuilder_; - } - - private double inputProcessingTimeSum_ ; - /** - *
    -       * Statistic of inputs processing time history.
    -       * 
    - * - * double input_processing_time_sum = 12; - */ - public double getInputProcessingTimeSum() { - return inputProcessingTimeSum_; - } - /** - *
    -       * Statistic of inputs processing time history.
    -       * 
    - * - * double input_processing_time_sum = 12; - */ - public Builder setInputProcessingTimeSum(double value) { - - inputProcessingTimeSum_ = value; - onChanged(); - return this; - } - /** - *
    -       * Statistic of inputs processing time history.
    -       * 
    - * - * double input_processing_time_sum = 12; - */ - public Builder clearInputProcessingTimeSum() { - - inputProcessingTimeSum_ = 0D; - onChanged(); - return this; - } - - private long inputProcessingTimeCount_ ; - /** - * int64 input_processing_time_count = 13; - */ - public long getInputProcessingTimeCount() { - return inputProcessingTimeCount_; - } - /** - * int64 input_processing_time_count = 13; - */ - public Builder setInputProcessingTimeCount(long value) { - - inputProcessingTimeCount_ = value; - onChanged(); - return this; - } - /** - * int64 input_processing_time_count = 13; - */ - public Builder clearInputProcessingTimeCount() { - - inputProcessingTimeCount_ = 0L; - onChanged(); - return this; - } - - private java.util.List inputs_ = - java.util.Collections.emptyList(); - private void ensureInputsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - inputs_ = new java.util.ArrayList(inputs_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder> inputsBuilder_; - - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public java.util.List getInputsList() { - if (inputsBuilder_ == null) { - return java.util.Collections.unmodifiableList(inputs_); - } else { - return inputsBuilder_.getMessageList(); - } - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public int getInputsCount() { - if (inputsBuilder_ == null) { - return inputs_.size(); - } else { - return inputsBuilder_.getCount(); - } - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.Node getInputs(int index) { - if (inputsBuilder_ == null) { - return inputs_.get(index); - } else { - return inputsBuilder_.getMessage(index); - } - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder setInputs( - int index, org.tensorflow.proto.data.model.ModelProto.Node value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.set(index, value); - onChanged(); - } else { - inputsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder setInputs( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.set(index, builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder addInputs(org.tensorflow.proto.data.model.ModelProto.Node value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.add(value); - onChanged(); - } else { - inputsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder addInputs( - int index, org.tensorflow.proto.data.model.ModelProto.Node value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.add(index, value); - onChanged(); - } else { - inputsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder addInputs( - org.tensorflow.proto.data.model.ModelProto.Node.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.add(builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder addInputs( - int index, org.tensorflow.proto.data.model.ModelProto.Node.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.add(index, builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder addAllInputs( - java.lang.Iterable values) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputs_); - onChanged(); - } else { - inputsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder clearInputs() { - if (inputsBuilder_ == null) { - inputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - inputsBuilder_.clear(); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public Builder removeInputs(int index) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.remove(index); - onChanged(); - } else { - inputsBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Builder getInputsBuilder( - int index) { - return getInputsFieldBuilder().getBuilder(index); - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getInputsOrBuilder( - int index) { - if (inputsBuilder_ == null) { - return inputs_.get(index); } else { - return inputsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public java.util.List - getInputsOrBuilderList() { - if (inputsBuilder_ != null) { - return inputsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inputs_); - } - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Builder addInputsBuilder() { - return getInputsFieldBuilder().addBuilder( - org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance()); - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Builder addInputsBuilder( - int index) { - return getInputsFieldBuilder().addBuilder( - index, org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance()); - } - /** - *
    -       * Inputs of this node.
    -       * 
    - * - * repeated .tensorflow.data.model.ModelProto.Node inputs = 14; - */ - public java.util.List - getInputsBuilderList() { - return getInputsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder> - getInputsFieldBuilder() { - if (inputsBuilder_ == null) { - inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder>( - inputs_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - inputs_ = null; - } - return inputsBuilder_; - } - - private int nodeClass_ = 0; - /** - *
    -       * Class of this node.
    -       * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public int getNodeClassValue() { - return nodeClass_; - } - /** - *
    -       * Class of this node.
    -       * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public Builder setNodeClassValue(int value) { - nodeClass_ = value; - onChanged(); - return this; - } - /** - *
    -       * Class of this node.
    -       * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public org.tensorflow.proto.data.model.NodeClass getNodeClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.model.NodeClass result = org.tensorflow.proto.data.model.NodeClass.valueOf(nodeClass_); - return result == null ? org.tensorflow.proto.data.model.NodeClass.UNRECOGNIZED : result; - } - /** - *
    -       * Class of this node.
    -       * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public Builder setNodeClass(org.tensorflow.proto.data.model.NodeClass value) { - if (value == null) { - throw new NullPointerException(); - } - - nodeClass_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -       * Class of this node.
    -       * 
    - * - * .tensorflow.data.model.NodeClass node_class = 15; - */ - public Builder clearNodeClass() { - - nodeClass_ = 0; - onChanged(); - return this; - } - - private double ratio_ ; - /** - *
    -       * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    -       * ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double ratio = 16; - */ - public double getRatio() { - return ratio_; - } - /** - *
    -       * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    -       * ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double ratio = 16; - */ - public Builder setRatio(double value) { - - ratio_ = value; - onChanged(); - return this; - } - /** - *
    -       * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    -       * ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double ratio = 16; - */ - public Builder clearRatio() { - - ratio_ = 0D; - onChanged(); - return this; - } - - private double memoryRatio_ ; - /** - *
    -       * Ratio identifies how many parallelism calls are introduced by one
    -       * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double memory_ratio = 17; - */ - public double getMemoryRatio() { - return memoryRatio_; - } - /** - *
    -       * Ratio identifies how many parallelism calls are introduced by one
    -       * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double memory_ratio = 17; - */ - public Builder setMemoryRatio(double value) { - - memoryRatio_ = value; - onChanged(); - return this; - } - /** - *
    -       * Ratio identifies how many parallelism calls are introduced by one
    -       * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    -       * 
    - * - * double memory_ratio = 17; - */ - public Builder clearMemoryRatio() { - - memoryRatio_ = 0D; - 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.model.ModelProto.Node) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.Node) - private static final org.tensorflow.proto.data.model.ModelProto.Node DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.ModelProto.Node(); - } - - public static org.tensorflow.proto.data.model.ModelProto.Node getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Node parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Node(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.model.ModelProto.Node getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface OptimizationParamsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.OptimizationParams) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Algorithm used for autotuning optimization.
    -     * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - int getAlgorithmValue(); - /** - *
    -     * Algorithm used for autotuning optimization.
    -     * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - org.tensorflow.proto.data.model.AutotuneAlgorithm getAlgorithm(); - - /** - *
    -     * Number of available logical threads.
    -     * 
    - * - * int64 cpu_budget = 2; - */ - long getCpuBudget(); - - /** - *
    -     * Amount of available memory in bytes.
    -     * 
    - * - * int64 ram_budget = 3; - */ - long getRamBudget(); - - /** - *
    -     * Time between two consecutive `GetNext` calls to the iterator represented
    -     * by the output node.
    -     * 
    - * - * double model_input_time = 4; - */ - double getModelInputTime(); - } - /** - *
    -   * Contains parameters of the model autotuning optimization.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.OptimizationParams} - */ - public static final class OptimizationParams extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.OptimizationParams) - OptimizationParamsOrBuilder { - private static final long serialVersionUID = 0L; - // Use OptimizationParams.newBuilder() to construct. - private OptimizationParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OptimizationParams() { - algorithm_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OptimizationParams(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OptimizationParams( - 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: { - int rawValue = input.readEnum(); - - algorithm_ = rawValue; - break; - } - case 16: { - - cpuBudget_ = input.readInt64(); - break; - } - case 24: { - - ramBudget_ = input.readInt64(); - break; - } - case 33: { - - modelInputTime_ = input.readDouble(); - 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.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.class, org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder.class); - } - - public static final int ALGORITHM_FIELD_NUMBER = 1; - private int algorithm_; - /** - *
    -     * Algorithm used for autotuning optimization.
    -     * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public int getAlgorithmValue() { - return algorithm_; - } - /** - *
    -     * Algorithm used for autotuning optimization.
    -     * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public org.tensorflow.proto.data.model.AutotuneAlgorithm getAlgorithm() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.AutotuneAlgorithm.valueOf(algorithm_); - return result == null ? org.tensorflow.proto.data.model.AutotuneAlgorithm.UNRECOGNIZED : result; - } - - public static final int CPU_BUDGET_FIELD_NUMBER = 2; - private long cpuBudget_; - /** - *
    -     * Number of available logical threads.
    -     * 
    - * - * int64 cpu_budget = 2; - */ - public long getCpuBudget() { - return cpuBudget_; - } - - public static final int RAM_BUDGET_FIELD_NUMBER = 3; - private long ramBudget_; - /** - *
    -     * Amount of available memory in bytes.
    -     * 
    - * - * int64 ram_budget = 3; - */ - public long getRamBudget() { - return ramBudget_; - } - - public static final int MODEL_INPUT_TIME_FIELD_NUMBER = 4; - private double modelInputTime_; - /** - *
    -     * Time between two consecutive `GetNext` calls to the iterator represented
    -     * by the output node.
    -     * 
    - * - * double model_input_time = 4; - */ - public double getModelInputTime() { - return modelInputTime_; - } - - 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 (algorithm_ != org.tensorflow.proto.data.model.AutotuneAlgorithm.HILL_CLIMB.getNumber()) { - output.writeEnum(1, algorithm_); - } - if (cpuBudget_ != 0L) { - output.writeInt64(2, cpuBudget_); - } - if (ramBudget_ != 0L) { - output.writeInt64(3, ramBudget_); - } - if (modelInputTime_ != 0D) { - output.writeDouble(4, modelInputTime_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (algorithm_ != org.tensorflow.proto.data.model.AutotuneAlgorithm.HILL_CLIMB.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, algorithm_); - } - if (cpuBudget_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, cpuBudget_); - } - if (ramBudget_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, ramBudget_); - } - if (modelInputTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, modelInputTime_); - } - 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.model.ModelProto.OptimizationParams)) { - return super.equals(obj); - } - org.tensorflow.proto.data.model.ModelProto.OptimizationParams other = (org.tensorflow.proto.data.model.ModelProto.OptimizationParams) obj; - - if (algorithm_ != other.algorithm_) return false; - if (getCpuBudget() - != other.getCpuBudget()) return false; - if (getRamBudget() - != other.getRamBudget()) return false; - if (java.lang.Double.doubleToLongBits(getModelInputTime()) - != java.lang.Double.doubleToLongBits( - other.getModelInputTime())) 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) + ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + algorithm_; - hash = (37 * hash) + CPU_BUDGET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getCpuBudget()); - hash = (37 * hash) + RAM_BUDGET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRamBudget()); - hash = (37 * hash) + MODEL_INPUT_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getModelInputTime())); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams 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.model.ModelProto.OptimizationParams parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams 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.model.ModelProto.OptimizationParams parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams 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.model.ModelProto.OptimizationParams parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams 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.model.ModelProto.OptimizationParams parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams 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.model.ModelProto.OptimizationParams 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; - } - /** - *
    -     * Contains parameters of the model autotuning optimization.
    -     * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto.OptimizationParams} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.OptimizationParams) - org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.class, org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder.class); - } - - // Construct using org.tensorflow.proto.data.model.ModelProto.OptimizationParams.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(); - algorithm_ = 0; - - cpuBudget_ = 0L; - - ramBudget_ = 0L; - - modelInputTime_ = 0D; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams getDefaultInstanceForType() { - return org.tensorflow.proto.data.model.ModelProto.OptimizationParams.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams build() { - org.tensorflow.proto.data.model.ModelProto.OptimizationParams result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams buildPartial() { - org.tensorflow.proto.data.model.ModelProto.OptimizationParams result = new org.tensorflow.proto.data.model.ModelProto.OptimizationParams(this); - result.algorithm_ = algorithm_; - result.cpuBudget_ = cpuBudget_; - result.ramBudget_ = ramBudget_; - result.modelInputTime_ = modelInputTime_; - 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.model.ModelProto.OptimizationParams) { - return mergeFrom((org.tensorflow.proto.data.model.ModelProto.OptimizationParams)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.model.ModelProto.OptimizationParams other) { - if (other == org.tensorflow.proto.data.model.ModelProto.OptimizationParams.getDefaultInstance()) return this; - if (other.algorithm_ != 0) { - setAlgorithmValue(other.getAlgorithmValue()); - } - if (other.getCpuBudget() != 0L) { - setCpuBudget(other.getCpuBudget()); - } - if (other.getRamBudget() != 0L) { - setRamBudget(other.getRamBudget()); - } - if (other.getModelInputTime() != 0D) { - setModelInputTime(other.getModelInputTime()); - } - 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.model.ModelProto.OptimizationParams parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.model.ModelProto.OptimizationParams) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int algorithm_ = 0; - /** - *
    -       * Algorithm used for autotuning optimization.
    -       * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public int getAlgorithmValue() { - return algorithm_; - } - /** - *
    -       * Algorithm used for autotuning optimization.
    -       * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public Builder setAlgorithmValue(int value) { - algorithm_ = value; - onChanged(); - return this; - } - /** - *
    -       * Algorithm used for autotuning optimization.
    -       * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public org.tensorflow.proto.data.model.AutotuneAlgorithm getAlgorithm() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.data.model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.AutotuneAlgorithm.valueOf(algorithm_); - return result == null ? org.tensorflow.proto.data.model.AutotuneAlgorithm.UNRECOGNIZED : result; - } - /** - *
    -       * Algorithm used for autotuning optimization.
    -       * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public Builder setAlgorithm(org.tensorflow.proto.data.model.AutotuneAlgorithm value) { - if (value == null) { - throw new NullPointerException(); - } - - algorithm_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -       * Algorithm used for autotuning optimization.
    -       * 
    - * - * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; - */ - public Builder clearAlgorithm() { - - algorithm_ = 0; - onChanged(); - return this; - } - - private long cpuBudget_ ; - /** - *
    -       * Number of available logical threads.
    -       * 
    - * - * int64 cpu_budget = 2; - */ - public long getCpuBudget() { - return cpuBudget_; - } - /** - *
    -       * Number of available logical threads.
    -       * 
    - * - * int64 cpu_budget = 2; - */ - public Builder setCpuBudget(long value) { - - cpuBudget_ = value; - onChanged(); - return this; - } - /** - *
    -       * Number of available logical threads.
    -       * 
    - * - * int64 cpu_budget = 2; - */ - public Builder clearCpuBudget() { - - cpuBudget_ = 0L; - onChanged(); - return this; - } - - private long ramBudget_ ; - /** - *
    -       * Amount of available memory in bytes.
    -       * 
    - * - * int64 ram_budget = 3; - */ - public long getRamBudget() { - return ramBudget_; - } - /** - *
    -       * Amount of available memory in bytes.
    -       * 
    - * - * int64 ram_budget = 3; - */ - public Builder setRamBudget(long value) { - - ramBudget_ = value; - onChanged(); - return this; - } - /** - *
    -       * Amount of available memory in bytes.
    -       * 
    - * - * int64 ram_budget = 3; - */ - public Builder clearRamBudget() { - - ramBudget_ = 0L; - onChanged(); - return this; - } - - private double modelInputTime_ ; - /** - *
    -       * Time between two consecutive `GetNext` calls to the iterator represented
    -       * by the output node.
    -       * 
    - * - * double model_input_time = 4; - */ - public double getModelInputTime() { - return modelInputTime_; - } - /** - *
    -       * Time between two consecutive `GetNext` calls to the iterator represented
    -       * by the output node.
    -       * 
    - * - * double model_input_time = 4; - */ - public Builder setModelInputTime(double value) { - - modelInputTime_ = value; - onChanged(); - return this; - } - /** - *
    -       * Time between two consecutive `GetNext` calls to the iterator represented
    -       * by the output node.
    -       * 
    - * - * double model_input_time = 4; - */ - public Builder clearModelInputTime() { - - modelInputTime_ = 0D; - 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.model.ModelProto.OptimizationParams) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.OptimizationParams) - private static final org.tensorflow.proto.data.model.ModelProto.OptimizationParams DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.ModelProto.OptimizationParams(); - } - - public static org.tensorflow.proto.data.model.ModelProto.OptimizationParams getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OptimizationParams parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OptimizationParams(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.model.ModelProto.OptimizationParams getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int OUTPUT_FIELD_NUMBER = 1; - private org.tensorflow.proto.data.model.ModelProto.Node output_; - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public boolean hasOutput() { - return output_ != null; - } - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public org.tensorflow.proto.data.model.ModelProto.Node getOutput() { - return output_ == null ? org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance() : output_; - } - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getOutputOrBuilder() { - return getOutput(); - } - - public static final int ID_COUNTER_FIELD_NUMBER = 2; - private long idCounter_; - /** - *
    -   * Counter for node IDs of this model.
    -   * 
    - * - * int64 id_counter = 2; - */ - public long getIdCounter() { - return idCounter_; - } - - public static final int COLLECT_RESOURCE_USAGE_FIELD_NUMBER = 3; - private boolean collectResourceUsage_; - /** - *
    -   * Indicates whether the modeling framework should collect resource usage,
    -   * e.g. CPU, memory.
    -   * 
    - * - * bool collect_resource_usage = 3; - */ - public boolean getCollectResourceUsage() { - return collectResourceUsage_; - } - - public static final int OPTIMIZATION_PARAMS_FIELD_NUMBER = 4; - private org.tensorflow.proto.data.model.ModelProto.OptimizationParams optimizationParams_; - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public boolean hasOptimizationParams() { - return optimizationParams_ != null; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams getOptimizationParams() { - return optimizationParams_ == null ? org.tensorflow.proto.data.model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder() { - return getOptimizationParams(); - } - - 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 (output_ != null) { - output.writeMessage(1, getOutput()); - } - if (idCounter_ != 0L) { - output.writeInt64(2, idCounter_); - } - if (collectResourceUsage_ != false) { - output.writeBool(3, collectResourceUsage_); - } - if (optimizationParams_ != null) { - output.writeMessage(4, getOptimizationParams()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (output_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getOutput()); - } - if (idCounter_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, idCounter_); - } - if (collectResourceUsage_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, collectResourceUsage_); - } - if (optimizationParams_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getOptimizationParams()); - } - 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.model.ModelProto)) { - return super.equals(obj); - } - org.tensorflow.proto.data.model.ModelProto other = (org.tensorflow.proto.data.model.ModelProto) obj; - - if (hasOutput() != other.hasOutput()) return false; - if (hasOutput()) { - if (!getOutput() - .equals(other.getOutput())) return false; - } - if (getIdCounter() - != other.getIdCounter()) return false; - if (getCollectResourceUsage() - != other.getCollectResourceUsage()) return false; - if (hasOptimizationParams() != other.hasOptimizationParams()) return false; - if (hasOptimizationParams()) { - if (!getOptimizationParams() - .equals(other.getOptimizationParams())) 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 (hasOutput()) { - hash = (37 * hash) + OUTPUT_FIELD_NUMBER; - hash = (53 * hash) + getOutput().hashCode(); - } - hash = (37 * hash) + ID_COUNTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getIdCounter()); - hash = (37 * hash) + COLLECT_RESOURCE_USAGE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCollectResourceUsage()); - if (hasOptimizationParams()) { - hash = (37 * hash) + OPTIMIZATION_PARAMS_FIELD_NUMBER; - hash = (53 * hash) + getOptimizationParams().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.data.model.ModelProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto 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.model.ModelProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto 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.model.ModelProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.data.model.ModelProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.data.model.ModelProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto 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.model.ModelProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto 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.model.ModelProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.data.model.ModelProto 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.model.ModelProto 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; - } - /** - *
    -   * Protocol buffer representing the data used by the autotuning modeling
    -   * framework.
    -   * 
    - * - * Protobuf type {@code tensorflow.data.model.ModelProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto) - org.tensorflow.proto.data.model.ModelProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.data.model.ModelProto.class, org.tensorflow.proto.data.model.ModelProto.Builder.class); - } - - // Construct using org.tensorflow.proto.data.model.ModelProto.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 (outputBuilder_ == null) { - output_ = null; - } else { - output_ = null; - outputBuilder_ = null; - } - idCounter_ = 0L; - - collectResourceUsage_ = false; - - if (optimizationParamsBuilder_ == null) { - optimizationParams_ = null; - } else { - optimizationParams_ = null; - optimizationParamsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.data.model.ModelProtos.internal_static_tensorflow_data_model_ModelProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto getDefaultInstanceForType() { - return org.tensorflow.proto.data.model.ModelProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto build() { - org.tensorflow.proto.data.model.ModelProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.data.model.ModelProto buildPartial() { - org.tensorflow.proto.data.model.ModelProto result = new org.tensorflow.proto.data.model.ModelProto(this); - if (outputBuilder_ == null) { - result.output_ = output_; - } else { - result.output_ = outputBuilder_.build(); - } - result.idCounter_ = idCounter_; - result.collectResourceUsage_ = collectResourceUsage_; - if (optimizationParamsBuilder_ == null) { - result.optimizationParams_ = optimizationParams_; - } else { - result.optimizationParams_ = optimizationParamsBuilder_.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.data.model.ModelProto) { - return mergeFrom((org.tensorflow.proto.data.model.ModelProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.data.model.ModelProto other) { - if (other == org.tensorflow.proto.data.model.ModelProto.getDefaultInstance()) return this; - if (other.hasOutput()) { - mergeOutput(other.getOutput()); - } - if (other.getIdCounter() != 0L) { - setIdCounter(other.getIdCounter()); - } - if (other.getCollectResourceUsage() != false) { - setCollectResourceUsage(other.getCollectResourceUsage()); - } - if (other.hasOptimizationParams()) { - mergeOptimizationParams(other.getOptimizationParams()); - } - 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.model.ModelProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.data.model.ModelProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.data.model.ModelProto.Node output_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder> outputBuilder_; - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public boolean hasOutput() { - return outputBuilder_ != null || output_ != null; - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public org.tensorflow.proto.data.model.ModelProto.Node getOutput() { - if (outputBuilder_ == null) { - return output_ == null ? org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance() : output_; - } else { - return outputBuilder_.getMessage(); - } - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public Builder setOutput(org.tensorflow.proto.data.model.ModelProto.Node value) { - if (outputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - output_ = value; - onChanged(); - } else { - outputBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public Builder setOutput( - org.tensorflow.proto.data.model.ModelProto.Node.Builder builderForValue) { - if (outputBuilder_ == null) { - output_ = builderForValue.build(); - onChanged(); - } else { - outputBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public Builder mergeOutput(org.tensorflow.proto.data.model.ModelProto.Node value) { - if (outputBuilder_ == null) { - if (output_ != null) { - output_ = - org.tensorflow.proto.data.model.ModelProto.Node.newBuilder(output_).mergeFrom(value).buildPartial(); - } else { - output_ = value; - } - onChanged(); - } else { - outputBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public Builder clearOutput() { - if (outputBuilder_ == null) { - output_ = null; - onChanged(); - } else { - output_ = null; - outputBuilder_ = null; - } - - return this; - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public org.tensorflow.proto.data.model.ModelProto.Node.Builder getOutputBuilder() { - - onChanged(); - return getOutputFieldBuilder().getBuilder(); - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - public org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getOutputOrBuilder() { - if (outputBuilder_ != null) { - return outputBuilder_.getMessageOrBuilder(); - } else { - return output_ == null ? - org.tensorflow.proto.data.model.ModelProto.Node.getDefaultInstance() : output_; - } - } - /** - *
    -     * Output node of this model.
    -     * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder> - getOutputFieldBuilder() { - if (outputBuilder_ == null) { - outputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.Node, org.tensorflow.proto.data.model.ModelProto.Node.Builder, org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder>( - getOutput(), - getParentForChildren(), - isClean()); - output_ = null; - } - return outputBuilder_; - } - - private long idCounter_ ; - /** - *
    -     * Counter for node IDs of this model.
    -     * 
    - * - * int64 id_counter = 2; - */ - public long getIdCounter() { - return idCounter_; - } - /** - *
    -     * Counter for node IDs of this model.
    -     * 
    - * - * int64 id_counter = 2; - */ - public Builder setIdCounter(long value) { - - idCounter_ = value; - onChanged(); - return this; - } - /** - *
    -     * Counter for node IDs of this model.
    -     * 
    - * - * int64 id_counter = 2; - */ - public Builder clearIdCounter() { - - idCounter_ = 0L; - onChanged(); - return this; - } - - private boolean collectResourceUsage_ ; - /** - *
    -     * Indicates whether the modeling framework should collect resource usage,
    -     * e.g. CPU, memory.
    -     * 
    - * - * bool collect_resource_usage = 3; - */ - public boolean getCollectResourceUsage() { - return collectResourceUsage_; - } - /** - *
    -     * Indicates whether the modeling framework should collect resource usage,
    -     * e.g. CPU, memory.
    -     * 
    - * - * bool collect_resource_usage = 3; - */ - public Builder setCollectResourceUsage(boolean value) { - - collectResourceUsage_ = value; - onChanged(); - return this; - } - /** - *
    -     * Indicates whether the modeling framework should collect resource usage,
    -     * e.g. CPU, memory.
    -     * 
    - * - * bool collect_resource_usage = 3; - */ - public Builder clearCollectResourceUsage() { - - collectResourceUsage_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.data.model.ModelProto.OptimizationParams optimizationParams_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder> optimizationParamsBuilder_; - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public boolean hasOptimizationParams() { - return optimizationParamsBuilder_ != null || optimizationParams_ != null; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams getOptimizationParams() { - if (optimizationParamsBuilder_ == null) { - return optimizationParams_ == null ? org.tensorflow.proto.data.model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; - } else { - return optimizationParamsBuilder_.getMessage(); - } - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public Builder setOptimizationParams(org.tensorflow.proto.data.model.ModelProto.OptimizationParams value) { - if (optimizationParamsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - optimizationParams_ = value; - onChanged(); - } else { - optimizationParamsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public Builder setOptimizationParams( - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder builderForValue) { - if (optimizationParamsBuilder_ == null) { - optimizationParams_ = builderForValue.build(); - onChanged(); - } else { - optimizationParamsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public Builder mergeOptimizationParams(org.tensorflow.proto.data.model.ModelProto.OptimizationParams value) { - if (optimizationParamsBuilder_ == null) { - if (optimizationParams_ != null) { - optimizationParams_ = - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.newBuilder(optimizationParams_).mergeFrom(value).buildPartial(); - } else { - optimizationParams_ = value; - } - onChanged(); - } else { - optimizationParamsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public Builder clearOptimizationParams() { - if (optimizationParamsBuilder_ == null) { - optimizationParams_ = null; - onChanged(); - } else { - optimizationParams_ = null; - optimizationParamsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder getOptimizationParamsBuilder() { - - onChanged(); - return getOptimizationParamsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - public org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder() { - if (optimizationParamsBuilder_ != null) { - return optimizationParamsBuilder_.getMessageOrBuilder(); - } else { - return optimizationParams_ == null ? - org.tensorflow.proto.data.model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; - } - } - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder> - getOptimizationParamsFieldBuilder() { - if (optimizationParamsBuilder_ == null) { - optimizationParamsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.data.model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder>( - getOptimizationParams(), - getParentForChildren(), - isClean()); - optimizationParams_ = null; - } - return optimizationParamsBuilder_; - } - @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.model.ModelProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto) - private static final org.tensorflow.proto.data.model.ModelProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.ModelProto(); - } - - public static org.tensorflow.proto.data.model.ModelProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ModelProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ModelProto(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.model.ModelProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtoOrBuilder.java deleted file mode 100644 index 956471c72a0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtoOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/model.proto - -package org.tensorflow.proto.data.model; - -public interface ModelProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - boolean hasOutput(); - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - org.tensorflow.proto.data.model.ModelProto.Node getOutput(); - /** - *
    -   * Output node of this model.
    -   * 
    - * - * .tensorflow.data.model.ModelProto.Node output = 1; - */ - org.tensorflow.proto.data.model.ModelProto.NodeOrBuilder getOutputOrBuilder(); - - /** - *
    -   * Counter for node IDs of this model.
    -   * 
    - * - * int64 id_counter = 2; - */ - long getIdCounter(); - - /** - *
    -   * Indicates whether the modeling framework should collect resource usage,
    -   * e.g. CPU, memory.
    -   * 
    - * - * bool collect_resource_usage = 3; - */ - boolean getCollectResourceUsage(); - - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - boolean hasOptimizationParams(); - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - org.tensorflow.proto.data.model.ModelProto.OptimizationParams getOptimizationParams(); - /** - * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 4; - */ - org.tensorflow.proto.data.model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtos.java deleted file mode 100644 index b1bb7add402..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/ModelProtos.java +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/model.proto - -package org.tensorflow.proto.data.model; - -public final class ModelProtos { - private ModelProtos() {} - 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_data_model_ModelProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_model_ModelProto_Node_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_data_model_ModelProto_OptimizationParams_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/framework/model.proto\022" + - "\025tensorflow.data.model\"\313\007\n\nModelProto\0226\n" + - "\006output\030\001 \001(\0132&.tensorflow.data.model.Mo" + - "delProto.Node\022\022\n\nid_counter\030\002 \001(\003\022\036\n\026col" + - "lect_resource_usage\030\003 \001(\010\022Q\n\023optimizatio" + - "n_params\030\004 \001(\01324.tensorflow.data.model.M" + - "odelProto.OptimizationParams\032\347\004\n\004Node\022\n\n" + - "\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\020\n\010autotune\030\003 \001(" + - "\010\022\026\n\016buffered_bytes\030\004 \001(\003\022\031\n\021buffered_el" + - "ements\030\005 \001(\003\022\026\n\016bytes_consumed\030\006 \001(\003\022\026\n\016" + - "bytes_produced\030\007 \001(\003\022\024\n\014num_elements\030\010 \001" + - "(\003\022\027\n\017processing_time\030\t \001(\003\022\026\n\016record_me" + - "trics\030\n \001(\010\022D\n\nparameters\030\013 \003(\01320.tensor" + - "flow.data.model.ModelProto.Node.Paramete" + - "r\022!\n\031input_processing_time_sum\030\014 \001(\001\022#\n\033" + - "input_processing_time_count\030\r \001(\003\0226\n\006inp" + - "uts\030\016 \003(\0132&.tensorflow.data.model.ModelP" + - "roto.Node\0224\n\nnode_class\030\017 \001(\0162 .tensorfl" + - "ow.data.model.NodeClass\022\r\n\005ratio\030\020 \001(\001\022\024" + - "\n\014memory_ratio\030\021 \001(\001\032h\n\tParameter\022\014\n\004nam" + - "e\030\001 \001(\t\022\r\n\005value\030\002 \001(\001\022\023\n\013state_value\030\003 " + - "\001(\001\022\013\n\003min\030\004 \001(\001\022\013\n\003max\030\005 \001(\001\022\017\n\007tunable" + - "\030\006 \001(\010\032\223\001\n\022OptimizationParams\022;\n\talgorit" + - "hm\030\001 \001(\0162(.tensorflow.data.model.Autotun" + - "eAlgorithm\022\022\n\ncpu_budget\030\002 \001(\003\022\022\n\nram_bu" + - "dget\030\003 \001(\003\022\030\n\020model_input_time\030\004 \001(\001*\203\001\n" + - "\tNodeClass\022\013\n\007UNKNOWN\020\000\022\023\n\017INTERLEAVE_MA" + - "NY\020\001\022\031\n\025ASYNC_INTERLEAVE_MANY\020\002\022\017\n\013KNOWN" + - "_RATIO\020\003\022\025\n\021ASYNC_KNOWN_RATIO\020\004\022\021\n\rUNKNO" + - "WN_RATIO\020\005*9\n\021AutotuneAlgorithm\022\016\n\nHILL_" + - "CLIMB\020\000\022\024\n\020GRADIENT_DESCENT\020\001B\201\001\n\037org.te" + - "nsorflow.proto.data.modelB\013ModelProtosP\001" + - "ZLgithub.com/tensorflow/tensorflow/tenso" + - "rflow/go/core/framework/model_go_proto\370\001" + - "\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_data_model_ModelProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_model_ModelProto_descriptor, - new java.lang.String[] { "Output", "IdCounter", "CollectResourceUsage", "OptimizationParams", }); - internal_static_tensorflow_data_model_ModelProto_Node_descriptor = - internal_static_tensorflow_data_model_ModelProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_model_ModelProto_Node_descriptor, - new java.lang.String[] { "Id", "Name", "Autotune", "BufferedBytes", "BufferedElements", "BytesConsumed", "BytesProduced", "NumElements", "ProcessingTime", "RecordMetrics", "Parameters", "InputProcessingTimeSum", "InputProcessingTimeCount", "Inputs", "NodeClass", "Ratio", "MemoryRatio", }); - internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor = - internal_static_tensorflow_data_model_ModelProto_Node_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor, - new java.lang.String[] { "Name", "Value", "StateValue", "Min", "Max", "Tunable", }); - internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor = - internal_static_tensorflow_data_model_ModelProto_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor, - new java.lang.String[] { "Algorithm", "CpuBudget", "RamBudget", "ModelInputTime", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/NodeClass.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/NodeClass.java deleted file mode 100644 index 951013a27a7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/data/model/NodeClass.java +++ /dev/null @@ -1,143 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/model.proto - -package org.tensorflow.proto.data.model; - -/** - *
    - * Class of a node in the performance model.
    - * 
    - * - * Protobuf enum {@code tensorflow.data.model.NodeClass} - */ -public enum NodeClass - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - * INTERLEAVE_MANY = 1; - */ - INTERLEAVE_MANY(1), - /** - * ASYNC_INTERLEAVE_MANY = 2; - */ - ASYNC_INTERLEAVE_MANY(2), - /** - * KNOWN_RATIO = 3; - */ - KNOWN_RATIO(3), - /** - * ASYNC_KNOWN_RATIO = 4; - */ - ASYNC_KNOWN_RATIO(4), - /** - * UNKNOWN_RATIO = 5; - */ - UNKNOWN_RATIO(5), - UNRECOGNIZED(-1), - ; - - /** - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - * INTERLEAVE_MANY = 1; - */ - public static final int INTERLEAVE_MANY_VALUE = 1; - /** - * ASYNC_INTERLEAVE_MANY = 2; - */ - public static final int ASYNC_INTERLEAVE_MANY_VALUE = 2; - /** - * KNOWN_RATIO = 3; - */ - public static final int KNOWN_RATIO_VALUE = 3; - /** - * ASYNC_KNOWN_RATIO = 4; - */ - public static final int ASYNC_KNOWN_RATIO_VALUE = 4; - /** - * UNKNOWN_RATIO = 5; - */ - public static final int UNKNOWN_RATIO_VALUE = 5; - - - 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 NodeClass valueOf(int value) { - return forNumber(value); - } - - public static NodeClass forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 1: return INTERLEAVE_MANY; - case 2: return ASYNC_INTERLEAVE_MANY; - case 3: return KNOWN_RATIO; - case 4: return ASYNC_KNOWN_RATIO; - case 5: return UNKNOWN_RATIO; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - NodeClass> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public NodeClass findValueByNumber(int number) { - return NodeClass.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.data.model.ModelProtos.getDescriptor().getEnumTypes().get(0); - } - - private static final NodeClass[] VALUES = values(); - - public static NodeClass 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 NodeClass(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.data.model.NodeClass) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDef.java deleted file mode 100644 index f796e47d02f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDef.java +++ /dev/null @@ -1,865 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/cluster.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines a TensorFlow cluster as a set of jobs.
    - * 
    - * - * Protobuf type {@code tensorflow.ClusterDef} - */ -public final class ClusterDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ClusterDef) - ClusterDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use ClusterDef.newBuilder() to construct. - private ClusterDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ClusterDef() { - job_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ClusterDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClusterDef( - 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)) { - job_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - job_.add( - input.readMessage(org.tensorflow.proto.distruntime.JobDef.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_ & 0x00000001) != 0)) { - job_ = java.util.Collections.unmodifiableList(job_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_ClusterDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ClusterDef.class, org.tensorflow.proto.distruntime.ClusterDef.Builder.class); - } - - public static final int JOB_FIELD_NUMBER = 1; - private java.util.List job_; - /** - *
    -   * The jobs that comprise the cluster.
    -   * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public java.util.List getJobList() { - return job_; - } - /** - *
    -   * The jobs that comprise the cluster.
    -   * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public java.util.List - getJobOrBuilderList() { - return job_; - } - /** - *
    -   * The jobs that comprise the cluster.
    -   * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public int getJobCount() { - return job_.size(); - } - /** - *
    -   * The jobs that comprise the cluster.
    -   * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDef getJob(int index) { - return job_.get(index); - } - /** - *
    -   * The jobs that comprise the cluster.
    -   * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDefOrBuilder getJobOrBuilder( - int index) { - return job_.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 { - for (int i = 0; i < job_.size(); i++) { - output.writeMessage(1, job_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < job_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, job_.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.distruntime.ClusterDef)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.ClusterDef other = (org.tensorflow.proto.distruntime.ClusterDef) obj; - - if (!getJobList() - .equals(other.getJobList())) 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 (getJobCount() > 0) { - hash = (37 * hash) + JOB_FIELD_NUMBER; - hash = (53 * hash) + getJobList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.ClusterDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDef 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.distruntime.ClusterDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDef 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.distruntime.ClusterDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.ClusterDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDef 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.distruntime.ClusterDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDef 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.distruntime.ClusterDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDef 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.distruntime.ClusterDef 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; - } - /** - *
    -   * Defines a TensorFlow cluster as a set of jobs.
    -   * 
    - * - * Protobuf type {@code tensorflow.ClusterDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ClusterDef) - org.tensorflow.proto.distruntime.ClusterDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_ClusterDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ClusterDef.class, org.tensorflow.proto.distruntime.ClusterDef.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.ClusterDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getJobFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (jobBuilder_ == null) { - job_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - jobBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDef getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDef build() { - org.tensorflow.proto.distruntime.ClusterDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDef buildPartial() { - org.tensorflow.proto.distruntime.ClusterDef result = new org.tensorflow.proto.distruntime.ClusterDef(this); - int from_bitField0_ = bitField0_; - if (jobBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - job_ = java.util.Collections.unmodifiableList(job_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.job_ = job_; - } else { - result.job_ = jobBuilder_.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.distruntime.ClusterDef) { - return mergeFrom((org.tensorflow.proto.distruntime.ClusterDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.ClusterDef other) { - if (other == org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance()) return this; - if (jobBuilder_ == null) { - if (!other.job_.isEmpty()) { - if (job_.isEmpty()) { - job_ = other.job_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureJobIsMutable(); - job_.addAll(other.job_); - } - onChanged(); - } - } else { - if (!other.job_.isEmpty()) { - if (jobBuilder_.isEmpty()) { - jobBuilder_.dispose(); - jobBuilder_ = null; - job_ = other.job_; - bitField0_ = (bitField0_ & ~0x00000001); - jobBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getJobFieldBuilder() : null; - } else { - jobBuilder_.addAllMessages(other.job_); - } - } - } - 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.distruntime.ClusterDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.ClusterDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List job_ = - java.util.Collections.emptyList(); - private void ensureJobIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - job_ = new java.util.ArrayList(job_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDef, org.tensorflow.proto.distruntime.JobDef.Builder, org.tensorflow.proto.distruntime.JobDefOrBuilder> jobBuilder_; - - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public java.util.List getJobList() { - if (jobBuilder_ == null) { - return java.util.Collections.unmodifiableList(job_); - } else { - return jobBuilder_.getMessageList(); - } - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public int getJobCount() { - if (jobBuilder_ == null) { - return job_.size(); - } else { - return jobBuilder_.getCount(); - } - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDef getJob(int index) { - if (jobBuilder_ == null) { - return job_.get(index); - } else { - return jobBuilder_.getMessage(index); - } - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder setJob( - int index, org.tensorflow.proto.distruntime.JobDef value) { - if (jobBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobIsMutable(); - job_.set(index, value); - onChanged(); - } else { - jobBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder setJob( - int index, org.tensorflow.proto.distruntime.JobDef.Builder builderForValue) { - if (jobBuilder_ == null) { - ensureJobIsMutable(); - job_.set(index, builderForValue.build()); - onChanged(); - } else { - jobBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder addJob(org.tensorflow.proto.distruntime.JobDef value) { - if (jobBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobIsMutable(); - job_.add(value); - onChanged(); - } else { - jobBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder addJob( - int index, org.tensorflow.proto.distruntime.JobDef value) { - if (jobBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobIsMutable(); - job_.add(index, value); - onChanged(); - } else { - jobBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder addJob( - org.tensorflow.proto.distruntime.JobDef.Builder builderForValue) { - if (jobBuilder_ == null) { - ensureJobIsMutable(); - job_.add(builderForValue.build()); - onChanged(); - } else { - jobBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder addJob( - int index, org.tensorflow.proto.distruntime.JobDef.Builder builderForValue) { - if (jobBuilder_ == null) { - ensureJobIsMutable(); - job_.add(index, builderForValue.build()); - onChanged(); - } else { - jobBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder addAllJob( - java.lang.Iterable values) { - if (jobBuilder_ == null) { - ensureJobIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, job_); - onChanged(); - } else { - jobBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder clearJob() { - if (jobBuilder_ == null) { - job_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - jobBuilder_.clear(); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public Builder removeJob(int index) { - if (jobBuilder_ == null) { - ensureJobIsMutable(); - job_.remove(index); - onChanged(); - } else { - jobBuilder_.remove(index); - } - return this; - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDef.Builder getJobBuilder( - int index) { - return getJobFieldBuilder().getBuilder(index); - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDefOrBuilder getJobOrBuilder( - int index) { - if (jobBuilder_ == null) { - return job_.get(index); } else { - return jobBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public java.util.List - getJobOrBuilderList() { - if (jobBuilder_ != null) { - return jobBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(job_); - } - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDef.Builder addJobBuilder() { - return getJobFieldBuilder().addBuilder( - org.tensorflow.proto.distruntime.JobDef.getDefaultInstance()); - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public org.tensorflow.proto.distruntime.JobDef.Builder addJobBuilder( - int index) { - return getJobFieldBuilder().addBuilder( - index, org.tensorflow.proto.distruntime.JobDef.getDefaultInstance()); - } - /** - *
    -     * The jobs that comprise the cluster.
    -     * 
    - * - * repeated .tensorflow.JobDef job = 1; - */ - public java.util.List - getJobBuilderList() { - return getJobFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDef, org.tensorflow.proto.distruntime.JobDef.Builder, org.tensorflow.proto.distruntime.JobDefOrBuilder> - getJobFieldBuilder() { - if (jobBuilder_ == null) { - jobBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDef, org.tensorflow.proto.distruntime.JobDef.Builder, org.tensorflow.proto.distruntime.JobDefOrBuilder>( - job_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - job_ = null; - } - return jobBuilder_; - } - @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.ClusterDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ClusterDef) - private static final org.tensorflow.proto.distruntime.ClusterDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.ClusterDef(); - } - - public static org.tensorflow.proto.distruntime.ClusterDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClusterDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClusterDef(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.distruntime.ClusterDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFilters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFilters.java deleted file mode 100644 index f9684c7e0e8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFilters.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_filters.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines the device filters for jobs in a cluster.
    - * 
    - * - * Protobuf type {@code tensorflow.ClusterDeviceFilters} - */ -public final class ClusterDeviceFilters extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ClusterDeviceFilters) - ClusterDeviceFiltersOrBuilder { -private static final long serialVersionUID = 0L; - // Use ClusterDeviceFilters.newBuilder() to construct. - private ClusterDeviceFilters(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ClusterDeviceFilters() { - jobs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ClusterDeviceFilters(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClusterDeviceFilters( - 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)) { - jobs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - jobs_.add( - input.readMessage(org.tensorflow.proto.distruntime.JobDeviceFilters.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_ & 0x00000001) != 0)) { - jobs_ = java.util.Collections.unmodifiableList(jobs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ClusterDeviceFilters.class, org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder.class); - } - - public static final int JOBS_FIELD_NUMBER = 1; - private java.util.List jobs_; - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public java.util.List getJobsList() { - return jobs_; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public java.util.List - getJobsOrBuilderList() { - return jobs_; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public int getJobsCount() { - return jobs_.size(); - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFilters getJobs(int index) { - return jobs_.get(index); - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder getJobsOrBuilder( - int index) { - return jobs_.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 { - for (int i = 0; i < jobs_.size(); i++) { - output.writeMessage(1, jobs_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < jobs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, jobs_.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.distruntime.ClusterDeviceFilters)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.ClusterDeviceFilters other = (org.tensorflow.proto.distruntime.ClusterDeviceFilters) obj; - - if (!getJobsList() - .equals(other.getJobsList())) 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 (getJobsCount() > 0) { - hash = (37 * hash) + JOBS_FIELD_NUMBER; - hash = (53 * hash) + getJobsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters 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.distruntime.ClusterDeviceFilters parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters 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.distruntime.ClusterDeviceFilters parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters 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.distruntime.ClusterDeviceFilters parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters 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.distruntime.ClusterDeviceFilters parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters 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.distruntime.ClusterDeviceFilters 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; - } - /** - *
    -   * Defines the device filters for jobs in a cluster.
    -   * 
    - * - * Protobuf type {@code tensorflow.ClusterDeviceFilters} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ClusterDeviceFilters) - org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ClusterDeviceFilters.class, org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.ClusterDeviceFilters.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getJobsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (jobsBuilder_ == null) { - jobs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - jobsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDeviceFilters getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.ClusterDeviceFilters.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDeviceFilters build() { - org.tensorflow.proto.distruntime.ClusterDeviceFilters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ClusterDeviceFilters buildPartial() { - org.tensorflow.proto.distruntime.ClusterDeviceFilters result = new org.tensorflow.proto.distruntime.ClusterDeviceFilters(this); - int from_bitField0_ = bitField0_; - if (jobsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - jobs_ = java.util.Collections.unmodifiableList(jobs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.jobs_ = jobs_; - } else { - result.jobs_ = jobsBuilder_.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.distruntime.ClusterDeviceFilters) { - return mergeFrom((org.tensorflow.proto.distruntime.ClusterDeviceFilters)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.ClusterDeviceFilters other) { - if (other == org.tensorflow.proto.distruntime.ClusterDeviceFilters.getDefaultInstance()) return this; - if (jobsBuilder_ == null) { - if (!other.jobs_.isEmpty()) { - if (jobs_.isEmpty()) { - jobs_ = other.jobs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureJobsIsMutable(); - jobs_.addAll(other.jobs_); - } - onChanged(); - } - } else { - if (!other.jobs_.isEmpty()) { - if (jobsBuilder_.isEmpty()) { - jobsBuilder_.dispose(); - jobsBuilder_ = null; - jobs_ = other.jobs_; - bitField0_ = (bitField0_ & ~0x00000001); - jobsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getJobsFieldBuilder() : null; - } else { - jobsBuilder_.addAllMessages(other.jobs_); - } - } - } - 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.distruntime.ClusterDeviceFilters parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.ClusterDeviceFilters) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List jobs_ = - java.util.Collections.emptyList(); - private void ensureJobsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - jobs_ = new java.util.ArrayList(jobs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDeviceFilters, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder, org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder> jobsBuilder_; - - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public java.util.List getJobsList() { - if (jobsBuilder_ == null) { - return java.util.Collections.unmodifiableList(jobs_); - } else { - return jobsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public int getJobsCount() { - if (jobsBuilder_ == null) { - return jobs_.size(); - } else { - return jobsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFilters getJobs(int index) { - if (jobsBuilder_ == null) { - return jobs_.get(index); - } else { - return jobsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder setJobs( - int index, org.tensorflow.proto.distruntime.JobDeviceFilters value) { - if (jobsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobsIsMutable(); - jobs_.set(index, value); - onChanged(); - } else { - jobsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder setJobs( - int index, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder builderForValue) { - if (jobsBuilder_ == null) { - ensureJobsIsMutable(); - jobs_.set(index, builderForValue.build()); - onChanged(); - } else { - jobsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder addJobs(org.tensorflow.proto.distruntime.JobDeviceFilters value) { - if (jobsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobsIsMutable(); - jobs_.add(value); - onChanged(); - } else { - jobsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder addJobs( - int index, org.tensorflow.proto.distruntime.JobDeviceFilters value) { - if (jobsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureJobsIsMutable(); - jobs_.add(index, value); - onChanged(); - } else { - jobsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder addJobs( - org.tensorflow.proto.distruntime.JobDeviceFilters.Builder builderForValue) { - if (jobsBuilder_ == null) { - ensureJobsIsMutable(); - jobs_.add(builderForValue.build()); - onChanged(); - } else { - jobsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder addJobs( - int index, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder builderForValue) { - if (jobsBuilder_ == null) { - ensureJobsIsMutable(); - jobs_.add(index, builderForValue.build()); - onChanged(); - } else { - jobsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder addAllJobs( - java.lang.Iterable values) { - if (jobsBuilder_ == null) { - ensureJobsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, jobs_); - onChanged(); - } else { - jobsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder clearJobs() { - if (jobsBuilder_ == null) { - jobs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - jobsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public Builder removeJobs(int index) { - if (jobsBuilder_ == null) { - ensureJobsIsMutable(); - jobs_.remove(index); - onChanged(); - } else { - jobsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFilters.Builder getJobsBuilder( - int index) { - return getJobsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder getJobsOrBuilder( - int index) { - if (jobsBuilder_ == null) { - return jobs_.get(index); } else { - return jobsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public java.util.List - getJobsOrBuilderList() { - if (jobsBuilder_ != null) { - return jobsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(jobs_); - } - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFilters.Builder addJobsBuilder() { - return getJobsFieldBuilder().addBuilder( - org.tensorflow.proto.distruntime.JobDeviceFilters.getDefaultInstance()); - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public org.tensorflow.proto.distruntime.JobDeviceFilters.Builder addJobsBuilder( - int index) { - return getJobsFieldBuilder().addBuilder( - index, org.tensorflow.proto.distruntime.JobDeviceFilters.getDefaultInstance()); - } - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - public java.util.List - getJobsBuilderList() { - return getJobsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDeviceFilters, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder, org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder> - getJobsFieldBuilder() { - if (jobsBuilder_ == null) { - jobsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.distruntime.JobDeviceFilters, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder, org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder>( - jobs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - jobs_ = null; - } - return jobsBuilder_; - } - @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.ClusterDeviceFilters) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ClusterDeviceFilters) - private static final org.tensorflow.proto.distruntime.ClusterDeviceFilters DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.ClusterDeviceFilters(); - } - - public static org.tensorflow.proto.distruntime.ClusterDeviceFilters getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClusterDeviceFilters parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClusterDeviceFilters(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.distruntime.ClusterDeviceFilters getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFiltersOrBuilder.java deleted file mode 100644 index eaaf1635eec..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDeviceFiltersOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_filters.proto - -package org.tensorflow.proto.distruntime; - -public interface ClusterDeviceFiltersOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ClusterDeviceFilters) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - java.util.List - getJobsList(); - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - org.tensorflow.proto.distruntime.JobDeviceFilters getJobs(int index); - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - int getJobsCount(); - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - java.util.List - getJobsOrBuilderList(); - /** - * repeated .tensorflow.JobDeviceFilters jobs = 1; - */ - org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder getJobsOrBuilder( - int index); -} 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 deleted file mode 100644 index af37d726925..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterProtos.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/cluster.proto - -package org.tensorflow.proto.distruntime; - -public final class ClusterProtos { - private ClusterProtos() {} - 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_JobDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_JobDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_JobDef_TasksEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_JobDef_TasksEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ClusterDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ClusterDef_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/cluster.proto" + - "\022\ntensorflow\"r\n\006JobDef\022\014\n\004name\030\001 \001(\t\022,\n\005" + - "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\215\001\n org.tensorflow.proto" + - ".distruntimeB\rClusterProtosP\001ZUgithub.co" + - "m/tensorflow/tensorflow/tensorflow/go/co" + - "re/protobuf/for_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_JobDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_JobDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_JobDef_descriptor, - new java.lang.String[] { "Name", "Tasks", }); - internal_static_tensorflow_JobDef_TasksEntry_descriptor = - internal_static_tensorflow_JobDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_JobDef_TasksEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_JobDef_TasksEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_ClusterDef_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_ClusterDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ClusterDef_descriptor, - new java.lang.String[] { "Job", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDef.java deleted file mode 100644 index c6766412507..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDef.java +++ /dev/null @@ -1,935 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/cluster.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines a single job in a TensorFlow cluster.
    - * 
    - * - * Protobuf type {@code tensorflow.JobDef} - */ -public final class JobDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.JobDef) - JobDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use JobDef.newBuilder() to construct. - private JobDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JobDef() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JobDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JobDef( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tasks_ = com.google.protobuf.MapField.newMapField( - TasksDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - tasks__ = input.readMessage( - TasksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - tasks_.getMutableMap().put( - tasks__.getKey(), tasks__.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.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.JobDef.class, org.tensorflow.proto.distruntime.JobDef.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * The name of this job.
    -   * 
    - * - * 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 this job.
    -   * 
    - * - * 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 TASKS_FIELD_NUMBER = 2; - private static final class TasksDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_TasksEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.String> tasks_; - private com.google.protobuf.MapField - internalGetTasks() { - if (tasks_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TasksDefaultEntryHolder.defaultEntry); - } - return tasks_; - } - - public int getTasksCount() { - return internalGetTasks().getMap().size(); - } - /** - *
    -   * Mapping from task ID to "hostname:port" string.
    -   * If the `name` field contains "worker", and the `tasks` map contains a
    -   * mapping from 7 to "example.org:2222", then the device prefix
    -   * "/job:worker/task:7" will be assigned to "example.org:2222".
    -   * 
    - * - * map<int32, string> tasks = 2; - */ - - public boolean containsTasks( - int key) { - - return internalGetTasks().getMap().containsKey(key); - } - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTasks() { - return getTasksMap(); - } - /** - *
    -   * Mapping from task ID to "hostname:port" string.
    -   * If the `name` field contains "worker", and the `tasks` map contains a
    -   * mapping from 7 to "example.org:2222", then the device prefix
    -   * "/job:worker/task:7" will be assigned to "example.org:2222".
    -   * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.util.Map getTasksMap() { - return internalGetTasks().getMap(); - } - /** - *
    -   * Mapping from task ID to "hostname:port" string.
    -   * If the `name` field contains "worker", and the `tasks` map contains a
    -   * mapping from 7 to "example.org:2222", then the device prefix
    -   * "/job:worker/task:7" will be assigned to "example.org:2222".
    -   * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.lang.String getTasksOrDefault( - int key, - java.lang.String defaultValue) { - - java.util.Map map = - internalGetTasks().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Mapping from task ID to "hostname:port" string.
    -   * If the `name` field contains "worker", and the `tasks` map contains a
    -   * mapping from 7 to "example.org:2222", then the device prefix
    -   * "/job:worker/task:7" will be assigned to "example.org:2222".
    -   * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.lang.String getTasksOrThrow( - int key) { - - java.util.Map map = - internalGetTasks().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_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetTasks(), - TasksDefaultEntryHolder.defaultEntry, - 2); - 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_); - } - for (java.util.Map.Entry entry - : internalGetTasks().getMap().entrySet()) { - com.google.protobuf.MapEntry - tasks__ = TasksDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, tasks__); - } - 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.distruntime.JobDef)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.JobDef other = (org.tensorflow.proto.distruntime.JobDef) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!internalGetTasks().equals( - other.internalGetTasks())) 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(); - if (!internalGetTasks().getMap().isEmpty()) { - hash = (37 * hash) + TASKS_FIELD_NUMBER; - hash = (53 * hash) + internalGetTasks().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.JobDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDef 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.distruntime.JobDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDef 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.distruntime.JobDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.JobDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDef 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.distruntime.JobDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDef 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.distruntime.JobDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDef 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.distruntime.JobDef 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; - } - /** - *
    -   * Defines a single job in a TensorFlow cluster.
    -   * 
    - * - * Protobuf type {@code tensorflow.JobDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.JobDef) - org.tensorflow.proto.distruntime.JobDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.JobDef.class, org.tensorflow.proto.distruntime.JobDef.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.JobDef.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_ = ""; - - internalGetMutableTasks().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDef getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.JobDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDef build() { - org.tensorflow.proto.distruntime.JobDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDef buildPartial() { - org.tensorflow.proto.distruntime.JobDef result = new org.tensorflow.proto.distruntime.JobDef(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.tasks_ = internalGetTasks(); - result.tasks_.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.distruntime.JobDef) { - return mergeFrom((org.tensorflow.proto.distruntime.JobDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.JobDef other) { - if (other == org.tensorflow.proto.distruntime.JobDef.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - internalGetMutableTasks().mergeFrom( - other.internalGetTasks()); - 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.distruntime.JobDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.JobDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -     * The name of this job.
    -     * 
    - * - * 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 this job.
    -     * 
    - * - * 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 this job.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name of this job.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * The name of this job.
    -     * 
    - * - * 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 com.google.protobuf.MapField< - java.lang.Integer, java.lang.String> tasks_; - private com.google.protobuf.MapField - internalGetTasks() { - if (tasks_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TasksDefaultEntryHolder.defaultEntry); - } - return tasks_; - } - private com.google.protobuf.MapField - internalGetMutableTasks() { - onChanged();; - if (tasks_ == null) { - tasks_ = com.google.protobuf.MapField.newMapField( - TasksDefaultEntryHolder.defaultEntry); - } - if (!tasks_.isMutable()) { - tasks_ = tasks_.copy(); - } - return tasks_; - } - - public int getTasksCount() { - return internalGetTasks().getMap().size(); - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public boolean containsTasks( - int key) { - - return internalGetTasks().getMap().containsKey(key); - } - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTasks() { - return getTasksMap(); - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.util.Map getTasksMap() { - return internalGetTasks().getMap(); - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.lang.String getTasksOrDefault( - int key, - java.lang.String defaultValue) { - - java.util.Map map = - internalGetTasks().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public java.lang.String getTasksOrThrow( - int key) { - - java.util.Map map = - internalGetTasks().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearTasks() { - internalGetMutableTasks().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public Builder removeTasks( - int key) { - - internalGetMutableTasks().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableTasks() { - return internalGetMutableTasks().getMutableMap(); - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - public Builder putTasks( - int key, - java.lang.String value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableTasks().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Mapping from task ID to "hostname:port" string.
    -     * If the `name` field contains "worker", and the `tasks` map contains a
    -     * mapping from 7 to "example.org:2222", then the device prefix
    -     * "/job:worker/task:7" will be assigned to "example.org:2222".
    -     * 
    - * - * map<int32, string> tasks = 2; - */ - - public Builder putAllTasks( - java.util.Map values) { - internalGetMutableTasks().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.JobDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.JobDef) - private static final org.tensorflow.proto.distruntime.JobDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.JobDef(); - } - - public static org.tensorflow.proto.distruntime.JobDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JobDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JobDef(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.distruntime.JobDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFilters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFilters.java deleted file mode 100644 index bbc7a6542be..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFilters.java +++ /dev/null @@ -1,902 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_filters.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines the device filters for tasks in a job.
    - * 
    - * - * Protobuf type {@code tensorflow.JobDeviceFilters} - */ -public final class JobDeviceFilters extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.JobDeviceFilters) - JobDeviceFiltersOrBuilder { -private static final long serialVersionUID = 0L; - // Use JobDeviceFilters.newBuilder() to construct. - private JobDeviceFilters(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private JobDeviceFilters() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new JobDeviceFilters(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private JobDeviceFilters( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tasks_ = com.google.protobuf.MapField.newMapField( - TasksDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - tasks__ = input.readMessage( - TasksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - tasks_.getMutableMap().put( - tasks__.getKey(), tasks__.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.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.JobDeviceFilters.class, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * The name of this job.
    -   * 
    - * - * 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 this job.
    -   * 
    - * - * 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 TASKS_FIELD_NUMBER = 2; - private static final class TasksDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, org.tensorflow.proto.distruntime.TaskDeviceFilters> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_TasksEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT32, - 0, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.distruntime.TaskDeviceFilters.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.distruntime.TaskDeviceFilters> tasks_; - private com.google.protobuf.MapField - internalGetTasks() { - if (tasks_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TasksDefaultEntryHolder.defaultEntry); - } - return tasks_; - } - - public int getTasksCount() { - return internalGetTasks().getMap().size(); - } - /** - *
    -   * Mapping from task ID to task device filters.
    -   * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public boolean containsTasks( - int key) { - - return internalGetTasks().getMap().containsKey(key); - } - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTasks() { - return getTasksMap(); - } - /** - *
    -   * Mapping from task ID to task device filters.
    -   * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public java.util.Map getTasksMap() { - return internalGetTasks().getMap(); - } - /** - *
    -   * Mapping from task ID to task device filters.
    -   * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrDefault( - int key, - org.tensorflow.proto.distruntime.TaskDeviceFilters defaultValue) { - - java.util.Map map = - internalGetTasks().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Mapping from task ID to task device filters.
    -   * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrThrow( - int key) { - - java.util.Map map = - internalGetTasks().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_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetTasks(), - TasksDefaultEntryHolder.defaultEntry, - 2); - 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_); - } - for (java.util.Map.Entry entry - : internalGetTasks().getMap().entrySet()) { - com.google.protobuf.MapEntry - tasks__ = TasksDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, tasks__); - } - 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.distruntime.JobDeviceFilters)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.JobDeviceFilters other = (org.tensorflow.proto.distruntime.JobDeviceFilters) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!internalGetTasks().equals( - other.internalGetTasks())) 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(); - if (!internalGetTasks().getMap().isEmpty()) { - hash = (37 * hash) + TASKS_FIELD_NUMBER; - hash = (53 * hash) + internalGetTasks().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.JobDeviceFilters parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters 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.distruntime.JobDeviceFilters parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters 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.distruntime.JobDeviceFilters parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters 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.distruntime.JobDeviceFilters parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters 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.distruntime.JobDeviceFilters parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.JobDeviceFilters 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.distruntime.JobDeviceFilters 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; - } - /** - *
    -   * Defines the device filters for tasks in a job.
    -   * 
    - * - * Protobuf type {@code tensorflow.JobDeviceFilters} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.JobDeviceFilters) - org.tensorflow.proto.distruntime.JobDeviceFiltersOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableTasks(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.JobDeviceFilters.class, org.tensorflow.proto.distruntime.JobDeviceFilters.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.JobDeviceFilters.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_ = ""; - - internalGetMutableTasks().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDeviceFilters getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.JobDeviceFilters.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDeviceFilters build() { - org.tensorflow.proto.distruntime.JobDeviceFilters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.JobDeviceFilters buildPartial() { - org.tensorflow.proto.distruntime.JobDeviceFilters result = new org.tensorflow.proto.distruntime.JobDeviceFilters(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.tasks_ = internalGetTasks(); - result.tasks_.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.distruntime.JobDeviceFilters) { - return mergeFrom((org.tensorflow.proto.distruntime.JobDeviceFilters)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.JobDeviceFilters other) { - if (other == org.tensorflow.proto.distruntime.JobDeviceFilters.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - internalGetMutableTasks().mergeFrom( - other.internalGetTasks()); - 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.distruntime.JobDeviceFilters parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.JobDeviceFilters) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -     * The name of this job.
    -     * 
    - * - * 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 this job.
    -     * 
    - * - * 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 this job.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name of this job.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * The name of this job.
    -     * 
    - * - * 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 com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.distruntime.TaskDeviceFilters> tasks_; - private com.google.protobuf.MapField - internalGetTasks() { - if (tasks_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TasksDefaultEntryHolder.defaultEntry); - } - return tasks_; - } - private com.google.protobuf.MapField - internalGetMutableTasks() { - onChanged();; - if (tasks_ == null) { - tasks_ = com.google.protobuf.MapField.newMapField( - TasksDefaultEntryHolder.defaultEntry); - } - if (!tasks_.isMutable()) { - tasks_ = tasks_.copy(); - } - return tasks_; - } - - public int getTasksCount() { - return internalGetTasks().getMap().size(); - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public boolean containsTasks( - int key) { - - return internalGetTasks().getMap().containsKey(key); - } - /** - * Use {@link #getTasksMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTasks() { - return getTasksMap(); - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public java.util.Map getTasksMap() { - return internalGetTasks().getMap(); - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrDefault( - int key, - org.tensorflow.proto.distruntime.TaskDeviceFilters defaultValue) { - - java.util.Map map = - internalGetTasks().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrThrow( - int key) { - - java.util.Map map = - internalGetTasks().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearTasks() { - internalGetMutableTasks().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public Builder removeTasks( - int key) { - - internalGetMutableTasks().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableTasks() { - return internalGetMutableTasks().getMutableMap(); - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - public Builder putTasks( - int key, - org.tensorflow.proto.distruntime.TaskDeviceFilters value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableTasks().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Mapping from task ID to task device filters.
    -     * 
    - * - * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; - */ - - public Builder putAllTasks( - java.util.Map values) { - internalGetMutableTasks().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.JobDeviceFilters) - } - - // @@protoc_insertion_point(class_scope:tensorflow.JobDeviceFilters) - private static final org.tensorflow.proto.distruntime.JobDeviceFilters DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.JobDeviceFilters(); - } - - public static org.tensorflow.proto.distruntime.JobDeviceFilters getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public JobDeviceFilters parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new JobDeviceFilters(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.distruntime.JobDeviceFilters getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDef.java deleted file mode 100644 index 068264c171e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDef.java +++ /dev/null @@ -1,1611 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensorflow_server.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines the configuration of a single TensorFlow server.
    - * 
    - * - * Protobuf type {@code tensorflow.ServerDef} - */ -public final class ServerDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ServerDef) - ServerDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use ServerDef.newBuilder() to construct. - private ServerDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ServerDef() { - jobName_ = ""; - protocol_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ServerDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ServerDef( - 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: { - org.tensorflow.proto.distruntime.ClusterDef.Builder subBuilder = null; - if (cluster_ != null) { - subBuilder = cluster_.toBuilder(); - } - cluster_ = input.readMessage(org.tensorflow.proto.distruntime.ClusterDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(cluster_); - cluster_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - jobName_ = s; - break; - } - case 24: { - - taskIndex_ = input.readInt32(); - break; - } - case 34: { - org.tensorflow.proto.framework.ConfigProto.Builder subBuilder = null; - if (defaultSessionConfig_ != null) { - subBuilder = defaultSessionConfig_.toBuilder(); - } - defaultSessionConfig_ = input.readMessage(org.tensorflow.proto.framework.ConfigProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultSessionConfig_); - defaultSessionConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - protocol_ = s; - break; - } - case 48: { - - port_ = input.readInt32(); - break; - } - case 58: { - org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder subBuilder = null; - if (clusterDeviceFilters_ != null) { - subBuilder = clusterDeviceFilters_.toBuilder(); - } - clusterDeviceFilters_ = input.readMessage(org.tensorflow.proto.distruntime.ClusterDeviceFilters.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(clusterDeviceFilters_); - clusterDeviceFilters_ = subBuilder.buildPartial(); - } - - 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.distruntime.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ServerProtos.internal_static_tensorflow_ServerDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ServerDef.class, org.tensorflow.proto.distruntime.ServerDef.Builder.class); - } - - public static final int CLUSTER_FIELD_NUMBER = 1; - private org.tensorflow.proto.distruntime.ClusterDef cluster_; - /** - *
    -   * The cluster of which this server is a member.
    -   * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public boolean hasCluster() { - return cluster_ != null; - } - /** - *
    -   * The cluster of which this server is a member.
    -   * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public org.tensorflow.proto.distruntime.ClusterDef getCluster() { - return cluster_ == null ? org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : cluster_; - } - /** - *
    -   * The cluster of which this server is a member.
    -   * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterOrBuilder() { - return getCluster(); - } - - public static final int JOB_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object jobName_; - /** - *
    -   * The name of the job of which this server is a member.
    -   * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -   * that matches this name.
    -   * 
    - * - * string job_name = 2; - */ - public java.lang.String getJobName() { - java.lang.Object ref = jobName_; - 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(); - jobName_ = s; - return s; - } - } - /** - *
    -   * The name of the job of which this server is a member.
    -   * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -   * that matches this name.
    -   * 
    - * - * string job_name = 2; - */ - public com.google.protobuf.ByteString - getJobNameBytes() { - java.lang.Object ref = jobName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jobName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TASK_INDEX_FIELD_NUMBER = 3; - private int taskIndex_; - /** - *
    -   * The task index of this server in its job.
    -   * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    -   * and a mapping in its `tasks` field for this index.
    -   * 
    - * - * int32 task_index = 3; - */ - public int getTaskIndex() { - return taskIndex_; - } - - public static final int DEFAULT_SESSION_CONFIG_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.ConfigProto defaultSessionConfig_; - /** - *
    -   * The default configuration for sessions that run on this server.
    -   * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public boolean hasDefaultSessionConfig() { - return defaultSessionConfig_ != null; - } - /** - *
    -   * The default configuration for sessions that run on this server.
    -   * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public org.tensorflow.proto.framework.ConfigProto getDefaultSessionConfig() { - return defaultSessionConfig_ == null ? org.tensorflow.proto.framework.ConfigProto.getDefaultInstance() : defaultSessionConfig_; - } - /** - *
    -   * The default configuration for sessions that run on this server.
    -   * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public org.tensorflow.proto.framework.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder() { - return getDefaultSessionConfig(); - } - - public static final int PROTOCOL_FIELD_NUMBER = 5; - private volatile java.lang.Object protocol_; - /** - *
    -   * The protocol to be used by this server.
    -   * Acceptable values include: "grpc", "grpc+verbs".
    -   * 
    - * - * string protocol = 5; - */ - 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 to be used by this server.
    -   * Acceptable values include: "grpc", "grpc+verbs".
    -   * 
    - * - * string protocol = 5; - */ - 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 PORT_FIELD_NUMBER = 6; - private int port_; - /** - *
    -   * The server port. If not set, then we identify the port from the job_name.
    -   * 
    - * - * int32 port = 6; - */ - public int getPort() { - return port_; - } - - public static final int CLUSTER_DEVICE_FILTERS_FIELD_NUMBER = 7; - private org.tensorflow.proto.distruntime.ClusterDeviceFilters clusterDeviceFilters_; - /** - *
    -   * Device filters for remote tasks in the cluster.
    -   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -   * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public boolean hasClusterDeviceFilters() { - return clusterDeviceFilters_ != null; - } - /** - *
    -   * Device filters for remote tasks in the cluster.
    -   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -   * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public org.tensorflow.proto.distruntime.ClusterDeviceFilters getClusterDeviceFilters() { - return clusterDeviceFilters_ == null ? org.tensorflow.proto.distruntime.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; - } - /** - *
    -   * Device filters for remote tasks in the cluster.
    -   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -   * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder() { - return getClusterDeviceFilters(); - } - - 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 (cluster_ != null) { - output.writeMessage(1, getCluster()); - } - if (!getJobNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, jobName_); - } - if (taskIndex_ != 0) { - output.writeInt32(3, taskIndex_); - } - if (defaultSessionConfig_ != null) { - output.writeMessage(4, getDefaultSessionConfig()); - } - if (!getProtocolBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, protocol_); - } - if (port_ != 0) { - output.writeInt32(6, port_); - } - if (clusterDeviceFilters_ != null) { - output.writeMessage(7, getClusterDeviceFilters()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (cluster_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getCluster()); - } - if (!getJobNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, jobName_); - } - if (taskIndex_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, taskIndex_); - } - if (defaultSessionConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getDefaultSessionConfig()); - } - if (!getProtocolBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, protocol_); - } - if (port_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, port_); - } - if (clusterDeviceFilters_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getClusterDeviceFilters()); - } - 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.distruntime.ServerDef)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.ServerDef other = (org.tensorflow.proto.distruntime.ServerDef) obj; - - if (hasCluster() != other.hasCluster()) return false; - if (hasCluster()) { - if (!getCluster() - .equals(other.getCluster())) return false; - } - if (!getJobName() - .equals(other.getJobName())) return false; - if (getTaskIndex() - != other.getTaskIndex()) return false; - if (hasDefaultSessionConfig() != other.hasDefaultSessionConfig()) return false; - if (hasDefaultSessionConfig()) { - if (!getDefaultSessionConfig() - .equals(other.getDefaultSessionConfig())) return false; - } - if (!getProtocol() - .equals(other.getProtocol())) return false; - if (getPort() - != other.getPort()) return false; - if (hasClusterDeviceFilters() != other.hasClusterDeviceFilters()) return false; - if (hasClusterDeviceFilters()) { - if (!getClusterDeviceFilters() - .equals(other.getClusterDeviceFilters())) 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 (hasCluster()) { - hash = (37 * hash) + CLUSTER_FIELD_NUMBER; - hash = (53 * hash) + getCluster().hashCode(); - } - hash = (37 * hash) + JOB_NAME_FIELD_NUMBER; - hash = (53 * hash) + getJobName().hashCode(); - hash = (37 * hash) + TASK_INDEX_FIELD_NUMBER; - hash = (53 * hash) + getTaskIndex(); - if (hasDefaultSessionConfig()) { - hash = (37 * hash) + DEFAULT_SESSION_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDefaultSessionConfig().hashCode(); - } - hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; - hash = (53 * hash) + getProtocol().hashCode(); - hash = (37 * hash) + PORT_FIELD_NUMBER; - hash = (53 * hash) + getPort(); - if (hasClusterDeviceFilters()) { - hash = (37 * hash) + CLUSTER_DEVICE_FILTERS_FIELD_NUMBER; - hash = (53 * hash) + getClusterDeviceFilters().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.ServerDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ServerDef 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.distruntime.ServerDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ServerDef 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.distruntime.ServerDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.ServerDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.ServerDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ServerDef 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.distruntime.ServerDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ServerDef 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.distruntime.ServerDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.ServerDef 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.distruntime.ServerDef 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; - } - /** - *
    -   * Defines the configuration of a single TensorFlow server.
    -   * 
    - * - * Protobuf type {@code tensorflow.ServerDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ServerDef) - org.tensorflow.proto.distruntime.ServerDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.ServerProtos.internal_static_tensorflow_ServerDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.ServerDef.class, org.tensorflow.proto.distruntime.ServerDef.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.ServerDef.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 (clusterBuilder_ == null) { - cluster_ = null; - } else { - cluster_ = null; - clusterBuilder_ = null; - } - jobName_ = ""; - - taskIndex_ = 0; - - if (defaultSessionConfigBuilder_ == null) { - defaultSessionConfig_ = null; - } else { - defaultSessionConfig_ = null; - defaultSessionConfigBuilder_ = null; - } - protocol_ = ""; - - port_ = 0; - - if (clusterDeviceFiltersBuilder_ == null) { - clusterDeviceFilters_ = null; - } else { - clusterDeviceFilters_ = null; - clusterDeviceFiltersBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ServerDef getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.ServerDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ServerDef build() { - org.tensorflow.proto.distruntime.ServerDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.ServerDef buildPartial() { - org.tensorflow.proto.distruntime.ServerDef result = new org.tensorflow.proto.distruntime.ServerDef(this); - if (clusterBuilder_ == null) { - result.cluster_ = cluster_; - } else { - result.cluster_ = clusterBuilder_.build(); - } - result.jobName_ = jobName_; - result.taskIndex_ = taskIndex_; - if (defaultSessionConfigBuilder_ == null) { - result.defaultSessionConfig_ = defaultSessionConfig_; - } else { - result.defaultSessionConfig_ = defaultSessionConfigBuilder_.build(); - } - result.protocol_ = protocol_; - result.port_ = port_; - if (clusterDeviceFiltersBuilder_ == null) { - result.clusterDeviceFilters_ = clusterDeviceFilters_; - } else { - result.clusterDeviceFilters_ = clusterDeviceFiltersBuilder_.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.distruntime.ServerDef) { - return mergeFrom((org.tensorflow.proto.distruntime.ServerDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.ServerDef other) { - if (other == org.tensorflow.proto.distruntime.ServerDef.getDefaultInstance()) return this; - if (other.hasCluster()) { - mergeCluster(other.getCluster()); - } - if (!other.getJobName().isEmpty()) { - jobName_ = other.jobName_; - onChanged(); - } - if (other.getTaskIndex() != 0) { - setTaskIndex(other.getTaskIndex()); - } - if (other.hasDefaultSessionConfig()) { - mergeDefaultSessionConfig(other.getDefaultSessionConfig()); - } - if (!other.getProtocol().isEmpty()) { - protocol_ = other.protocol_; - onChanged(); - } - if (other.getPort() != 0) { - setPort(other.getPort()); - } - if (other.hasClusterDeviceFilters()) { - mergeClusterDeviceFilters(other.getClusterDeviceFilters()); - } - 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.distruntime.ServerDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.ServerDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.distruntime.ClusterDef cluster_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder> clusterBuilder_; - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public boolean hasCluster() { - return clusterBuilder_ != null || cluster_ != null; - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public org.tensorflow.proto.distruntime.ClusterDef getCluster() { - if (clusterBuilder_ == null) { - return cluster_ == null ? org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : cluster_; - } else { - return clusterBuilder_.getMessage(); - } - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public Builder setCluster(org.tensorflow.proto.distruntime.ClusterDef value) { - if (clusterBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - cluster_ = value; - onChanged(); - } else { - clusterBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public Builder setCluster( - org.tensorflow.proto.distruntime.ClusterDef.Builder builderForValue) { - if (clusterBuilder_ == null) { - cluster_ = builderForValue.build(); - onChanged(); - } else { - clusterBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public Builder mergeCluster(org.tensorflow.proto.distruntime.ClusterDef value) { - if (clusterBuilder_ == null) { - if (cluster_ != null) { - cluster_ = - org.tensorflow.proto.distruntime.ClusterDef.newBuilder(cluster_).mergeFrom(value).buildPartial(); - } else { - cluster_ = value; - } - onChanged(); - } else { - clusterBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public Builder clearCluster() { - if (clusterBuilder_ == null) { - cluster_ = null; - onChanged(); - } else { - cluster_ = null; - clusterBuilder_ = null; - } - - return this; - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public org.tensorflow.proto.distruntime.ClusterDef.Builder getClusterBuilder() { - - onChanged(); - return getClusterFieldBuilder().getBuilder(); - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - public org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterOrBuilder() { - if (clusterBuilder_ != null) { - return clusterBuilder_.getMessageOrBuilder(); - } else { - return cluster_ == null ? - org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : cluster_; - } - } - /** - *
    -     * The cluster of which this server is a member.
    -     * 
    - * - * .tensorflow.ClusterDef cluster = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder> - getClusterFieldBuilder() { - if (clusterBuilder_ == null) { - clusterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder>( - getCluster(), - getParentForChildren(), - isClean()); - cluster_ = null; - } - return clusterBuilder_; - } - - private java.lang.Object jobName_ = ""; - /** - *
    -     * The name of the job of which this server is a member.
    -     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -     * that matches this name.
    -     * 
    - * - * string job_name = 2; - */ - public java.lang.String getJobName() { - java.lang.Object ref = jobName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - jobName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The name of the job of which this server is a member.
    -     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -     * that matches this name.
    -     * 
    - * - * string job_name = 2; - */ - public com.google.protobuf.ByteString - getJobNameBytes() { - java.lang.Object ref = jobName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - jobName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The name of the job of which this server is a member.
    -     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -     * that matches this name.
    -     * 
    - * - * string job_name = 2; - */ - public Builder setJobName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - jobName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name of the job of which this server is a member.
    -     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -     * that matches this name.
    -     * 
    - * - * string job_name = 2; - */ - public Builder clearJobName() { - - jobName_ = getDefaultInstance().getJobName(); - onChanged(); - return this; - } - /** - *
    -     * The name of the job of which this server is a member.
    -     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    -     * that matches this name.
    -     * 
    - * - * string job_name = 2; - */ - public Builder setJobNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - jobName_ = value; - onChanged(); - return this; - } - - private int taskIndex_ ; - /** - *
    -     * The task index of this server in its job.
    -     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    -     * and a mapping in its `tasks` field for this index.
    -     * 
    - * - * int32 task_index = 3; - */ - public int getTaskIndex() { - return taskIndex_; - } - /** - *
    -     * The task index of this server in its job.
    -     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    -     * and a mapping in its `tasks` field for this index.
    -     * 
    - * - * int32 task_index = 3; - */ - public Builder setTaskIndex(int value) { - - taskIndex_ = value; - onChanged(); - return this; - } - /** - *
    -     * The task index of this server in its job.
    -     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    -     * and a mapping in its `tasks` field for this index.
    -     * 
    - * - * int32 task_index = 3; - */ - public Builder clearTaskIndex() { - - taskIndex_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.ConfigProto defaultSessionConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto, org.tensorflow.proto.framework.ConfigProto.Builder, org.tensorflow.proto.framework.ConfigProtoOrBuilder> defaultSessionConfigBuilder_; - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public boolean hasDefaultSessionConfig() { - return defaultSessionConfigBuilder_ != null || defaultSessionConfig_ != null; - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public org.tensorflow.proto.framework.ConfigProto getDefaultSessionConfig() { - if (defaultSessionConfigBuilder_ == null) { - return defaultSessionConfig_ == null ? org.tensorflow.proto.framework.ConfigProto.getDefaultInstance() : defaultSessionConfig_; - } else { - return defaultSessionConfigBuilder_.getMessage(); - } - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public Builder setDefaultSessionConfig(org.tensorflow.proto.framework.ConfigProto value) { - if (defaultSessionConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultSessionConfig_ = value; - onChanged(); - } else { - defaultSessionConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public Builder setDefaultSessionConfig( - org.tensorflow.proto.framework.ConfigProto.Builder builderForValue) { - if (defaultSessionConfigBuilder_ == null) { - defaultSessionConfig_ = builderForValue.build(); - onChanged(); - } else { - defaultSessionConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public Builder mergeDefaultSessionConfig(org.tensorflow.proto.framework.ConfigProto value) { - if (defaultSessionConfigBuilder_ == null) { - if (defaultSessionConfig_ != null) { - defaultSessionConfig_ = - org.tensorflow.proto.framework.ConfigProto.newBuilder(defaultSessionConfig_).mergeFrom(value).buildPartial(); - } else { - defaultSessionConfig_ = value; - } - onChanged(); - } else { - defaultSessionConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public Builder clearDefaultSessionConfig() { - if (defaultSessionConfigBuilder_ == null) { - defaultSessionConfig_ = null; - onChanged(); - } else { - defaultSessionConfig_ = null; - defaultSessionConfigBuilder_ = null; - } - - return this; - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public org.tensorflow.proto.framework.ConfigProto.Builder getDefaultSessionConfigBuilder() { - - onChanged(); - return getDefaultSessionConfigFieldBuilder().getBuilder(); - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - public org.tensorflow.proto.framework.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder() { - if (defaultSessionConfigBuilder_ != null) { - return defaultSessionConfigBuilder_.getMessageOrBuilder(); - } else { - return defaultSessionConfig_ == null ? - org.tensorflow.proto.framework.ConfigProto.getDefaultInstance() : defaultSessionConfig_; - } - } - /** - *
    -     * The default configuration for sessions that run on this server.
    -     * 
    - * - * .tensorflow.ConfigProto default_session_config = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto, org.tensorflow.proto.framework.ConfigProto.Builder, org.tensorflow.proto.framework.ConfigProtoOrBuilder> - getDefaultSessionConfigFieldBuilder() { - if (defaultSessionConfigBuilder_ == null) { - defaultSessionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto, org.tensorflow.proto.framework.ConfigProto.Builder, org.tensorflow.proto.framework.ConfigProtoOrBuilder>( - getDefaultSessionConfig(), - getParentForChildren(), - isClean()); - defaultSessionConfig_ = null; - } - return defaultSessionConfigBuilder_; - } - - private java.lang.Object protocol_ = ""; - /** - *
    -     * The protocol to be used by this server.
    -     * Acceptable values include: "grpc", "grpc+verbs".
    -     * 
    - * - * string protocol = 5; - */ - 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 to be used by this server.
    -     * Acceptable values include: "grpc", "grpc+verbs".
    -     * 
    - * - * string protocol = 5; - */ - 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 to be used by this server.
    -     * Acceptable values include: "grpc", "grpc+verbs".
    -     * 
    - * - * string protocol = 5; - */ - public Builder setProtocol( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - protocol_ = value; - onChanged(); - return this; - } - /** - *
    -     * The protocol to be used by this server.
    -     * Acceptable values include: "grpc", "grpc+verbs".
    -     * 
    - * - * string protocol = 5; - */ - public Builder clearProtocol() { - - protocol_ = getDefaultInstance().getProtocol(); - onChanged(); - return this; - } - /** - *
    -     * The protocol to be used by this server.
    -     * Acceptable values include: "grpc", "grpc+verbs".
    -     * 
    - * - * string protocol = 5; - */ - public Builder setProtocolBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - protocol_ = value; - onChanged(); - return this; - } - - private int port_ ; - /** - *
    -     * The server port. If not set, then we identify the port from the job_name.
    -     * 
    - * - * int32 port = 6; - */ - public int getPort() { - return port_; - } - /** - *
    -     * The server port. If not set, then we identify the port from the job_name.
    -     * 
    - * - * int32 port = 6; - */ - public Builder setPort(int value) { - - port_ = value; - onChanged(); - return this; - } - /** - *
    -     * The server port. If not set, then we identify the port from the job_name.
    -     * 
    - * - * int32 port = 6; - */ - public Builder clearPort() { - - port_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.distruntime.ClusterDeviceFilters clusterDeviceFilters_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDeviceFilters, org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder, org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder> clusterDeviceFiltersBuilder_; - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public boolean hasClusterDeviceFilters() { - return clusterDeviceFiltersBuilder_ != null || clusterDeviceFilters_ != null; - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public org.tensorflow.proto.distruntime.ClusterDeviceFilters getClusterDeviceFilters() { - if (clusterDeviceFiltersBuilder_ == null) { - return clusterDeviceFilters_ == null ? org.tensorflow.proto.distruntime.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; - } else { - return clusterDeviceFiltersBuilder_.getMessage(); - } - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public Builder setClusterDeviceFilters(org.tensorflow.proto.distruntime.ClusterDeviceFilters value) { - if (clusterDeviceFiltersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - clusterDeviceFilters_ = value; - onChanged(); - } else { - clusterDeviceFiltersBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public Builder setClusterDeviceFilters( - org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder builderForValue) { - if (clusterDeviceFiltersBuilder_ == null) { - clusterDeviceFilters_ = builderForValue.build(); - onChanged(); - } else { - clusterDeviceFiltersBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public Builder mergeClusterDeviceFilters(org.tensorflow.proto.distruntime.ClusterDeviceFilters value) { - if (clusterDeviceFiltersBuilder_ == null) { - if (clusterDeviceFilters_ != null) { - clusterDeviceFilters_ = - org.tensorflow.proto.distruntime.ClusterDeviceFilters.newBuilder(clusterDeviceFilters_).mergeFrom(value).buildPartial(); - } else { - clusterDeviceFilters_ = value; - } - onChanged(); - } else { - clusterDeviceFiltersBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public Builder clearClusterDeviceFilters() { - if (clusterDeviceFiltersBuilder_ == null) { - clusterDeviceFilters_ = null; - onChanged(); - } else { - clusterDeviceFilters_ = null; - clusterDeviceFiltersBuilder_ = null; - } - - return this; - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder getClusterDeviceFiltersBuilder() { - - onChanged(); - return getClusterDeviceFiltersFieldBuilder().getBuilder(); - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - public org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder() { - if (clusterDeviceFiltersBuilder_ != null) { - return clusterDeviceFiltersBuilder_.getMessageOrBuilder(); - } else { - return clusterDeviceFilters_ == null ? - org.tensorflow.proto.distruntime.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; - } - } - /** - *
    -     * Device filters for remote tasks in the cluster.
    -     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    -     * 
    - * - * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDeviceFilters, org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder, org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder> - getClusterDeviceFiltersFieldBuilder() { - if (clusterDeviceFiltersBuilder_ == null) { - clusterDeviceFiltersBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDeviceFilters, org.tensorflow.proto.distruntime.ClusterDeviceFilters.Builder, org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder>( - getClusterDeviceFilters(), - getParentForChildren(), - isClean()); - clusterDeviceFilters_ = null; - } - return clusterDeviceFiltersBuilder_; - } - @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.ServerDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ServerDef) - private static final org.tensorflow.proto.distruntime.ServerDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.ServerDef(); - } - - public static org.tensorflow.proto.distruntime.ServerDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ServerDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ServerDef(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.distruntime.ServerDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 57b4f858898..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerProtos.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensorflow_server.proto - -package org.tensorflow.proto.distruntime; - -public final class ServerProtos { - private ServerProtos() {} - 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_ServerDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ServerDef_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0tensorflow/core/protobuf/tensorflow_se" + - "rver.proto\022\ntensorflow\032&tensorflow/core/" + - "protobuf/cluster.proto\032%tensorflow/core/" + - "protobuf/config.proto\032-tensorflow/core/p" + - "rotobuf/device_filters.proto\"\365\001\n\tServerD" + - "ef\022\'\n\007cluster\030\001 \001(\0132\026.tensorflow.Cluster" + - "Def\022\020\n\010job_name\030\002 \001(\t\022\022\n\ntask_index\030\003 \001(" + - "\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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.distruntime.ClusterProtos.getDescriptor(), - org.tensorflow.proto.framework.ConfigProtos.getDescriptor(), - org.tensorflow.proto.distruntime.DeviceFiltersProtos.getDescriptor(), - }); - internal_static_tensorflow_ServerDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ServerDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ServerDef_descriptor, - new java.lang.String[] { "Cluster", "JobName", "TaskIndex", "DefaultSessionConfig", "Protocol", "Port", "ClusterDeviceFilters", }); - org.tensorflow.proto.distruntime.ClusterProtos.getDescriptor(); - org.tensorflow.proto.framework.ConfigProtos.getDescriptor(); - org.tensorflow.proto.distruntime.DeviceFiltersProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFilters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFilters.java deleted file mode 100644 index 50bc759c880..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFilters.java +++ /dev/null @@ -1,600 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_filters.proto - -package org.tensorflow.proto.distruntime; - -/** - *
    - * Defines the device filters for a remote task.
    - * 
    - * - * Protobuf type {@code tensorflow.TaskDeviceFilters} - */ -public final class TaskDeviceFilters extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TaskDeviceFilters) - TaskDeviceFiltersOrBuilder { -private static final long serialVersionUID = 0L; - // Use TaskDeviceFilters.newBuilder() to construct. - private TaskDeviceFilters(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TaskDeviceFilters() { - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TaskDeviceFilters(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TaskDeviceFilters( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceFilters_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceFilters_.add(s); - 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)) { - deviceFilters_ = deviceFilters_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.TaskDeviceFilters.class, org.tensorflow.proto.distruntime.TaskDeviceFilters.Builder.class); - } - - public static final int DEVICE_FILTERS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList deviceFilters_; - /** - * repeated string device_filters = 1; - */ - public com.google.protobuf.ProtocolStringList - getDeviceFiltersList() { - return deviceFilters_; - } - /** - * repeated string device_filters = 1; - */ - public int getDeviceFiltersCount() { - return deviceFilters_.size(); - } - /** - * repeated string device_filters = 1; - */ - public java.lang.String getDeviceFilters(int index) { - return deviceFilters_.get(index); - } - /** - * repeated string device_filters = 1; - */ - public com.google.protobuf.ByteString - getDeviceFiltersBytes(int index) { - return deviceFilters_.getByteString(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 { - for (int i = 0; i < deviceFilters_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deviceFilters_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < deviceFilters_.size(); i++) { - dataSize += computeStringSizeNoTag(deviceFilters_.getRaw(i)); - } - size += dataSize; - size += 1 * getDeviceFiltersList().size(); - } - 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.distruntime.TaskDeviceFilters)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.TaskDeviceFilters other = (org.tensorflow.proto.distruntime.TaskDeviceFilters) obj; - - if (!getDeviceFiltersList() - .equals(other.getDeviceFiltersList())) 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 (getDeviceFiltersCount() > 0) { - hash = (37 * hash) + DEVICE_FILTERS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceFiltersList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.TaskDeviceFilters parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters 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.distruntime.TaskDeviceFilters parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters 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.distruntime.TaskDeviceFilters parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters 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.distruntime.TaskDeviceFilters parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters 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.distruntime.TaskDeviceFilters parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TaskDeviceFilters 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.distruntime.TaskDeviceFilters 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; - } - /** - *
    -   * Defines the device filters for a remote task.
    -   * 
    - * - * Protobuf type {@code tensorflow.TaskDeviceFilters} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TaskDeviceFilters) - org.tensorflow.proto.distruntime.TaskDeviceFiltersOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.TaskDeviceFilters.class, org.tensorflow.proto.distruntime.TaskDeviceFilters.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.TaskDeviceFilters.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(); - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TaskDeviceFilters getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.TaskDeviceFilters.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TaskDeviceFilters build() { - org.tensorflow.proto.distruntime.TaskDeviceFilters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TaskDeviceFilters buildPartial() { - org.tensorflow.proto.distruntime.TaskDeviceFilters result = new org.tensorflow.proto.distruntime.TaskDeviceFilters(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - deviceFilters_ = deviceFilters_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceFilters_ = deviceFilters_; - 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.distruntime.TaskDeviceFilters) { - return mergeFrom((org.tensorflow.proto.distruntime.TaskDeviceFilters)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.TaskDeviceFilters other) { - if (other == org.tensorflow.proto.distruntime.TaskDeviceFilters.getDefaultInstance()) return this; - if (!other.deviceFilters_.isEmpty()) { - if (deviceFilters_.isEmpty()) { - deviceFilters_ = other.deviceFilters_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceFiltersIsMutable(); - deviceFilters_.addAll(other.deviceFilters_); - } - onChanged(); - } - 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.distruntime.TaskDeviceFilters parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.TaskDeviceFilters) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureDeviceFiltersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceFilters_ = new com.google.protobuf.LazyStringArrayList(deviceFilters_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string device_filters = 1; - */ - public com.google.protobuf.ProtocolStringList - getDeviceFiltersList() { - return deviceFilters_.getUnmodifiableView(); - } - /** - * repeated string device_filters = 1; - */ - public int getDeviceFiltersCount() { - return deviceFilters_.size(); - } - /** - * repeated string device_filters = 1; - */ - public java.lang.String getDeviceFilters(int index) { - return deviceFilters_.get(index); - } - /** - * repeated string device_filters = 1; - */ - public com.google.protobuf.ByteString - getDeviceFiltersBytes(int index) { - return deviceFilters_.getByteString(index); - } - /** - * repeated string device_filters = 1; - */ - public Builder setDeviceFilters( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceFiltersIsMutable(); - deviceFilters_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string device_filters = 1; - */ - public Builder addDeviceFilters( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceFiltersIsMutable(); - deviceFilters_.add(value); - onChanged(); - return this; - } - /** - * repeated string device_filters = 1; - */ - public Builder addAllDeviceFilters( - java.lang.Iterable values) { - ensureDeviceFiltersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceFilters_); - onChanged(); - return this; - } - /** - * repeated string device_filters = 1; - */ - public Builder clearDeviceFilters() { - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string device_filters = 1; - */ - public Builder addDeviceFiltersBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureDeviceFiltersIsMutable(); - deviceFilters_.add(value); - 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.TaskDeviceFilters) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TaskDeviceFilters) - private static final org.tensorflow.proto.distruntime.TaskDeviceFilters DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.TaskDeviceFilters(); - } - - public static org.tensorflow.proto.distruntime.TaskDeviceFilters getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TaskDeviceFilters parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TaskDeviceFilters(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.distruntime.TaskDeviceFilters getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFiltersOrBuilder.java deleted file mode 100644 index 2c359e1e049..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TaskDeviceFiltersOrBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_filters.proto - -package org.tensorflow.proto.distruntime; - -public interface TaskDeviceFiltersOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TaskDeviceFilters) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string device_filters = 1; - */ - java.util.List - getDeviceFiltersList(); - /** - * repeated string device_filters = 1; - */ - int getDeviceFiltersCount(); - /** - * repeated string device_filters = 1; - */ - java.lang.String getDeviceFilters(int index); - /** - * repeated string device_filters = 1; - */ - com.google.protobuf.ByteString - getDeviceFiltersBytes(int index); -} 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 deleted file mode 100644 index e5a8e2a11ed..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/TransportOptions.java +++ /dev/null @@ -1,635 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/transport_options.proto - -package org.tensorflow.proto.distruntime; - -public final class TransportOptions { - private TransportOptions() {} - 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 RecvBufRespExtraOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RecvBufRespExtra) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated bytes tensor_content = 1; - */ - java.util.List getTensorContentList(); - /** - * repeated bytes tensor_content = 1; - */ - int getTensorContentCount(); - /** - * repeated bytes tensor_content = 1; - */ - com.google.protobuf.ByteString getTensorContent(int index); - } - /** - *
    -   * Extra data needed on a non-RDMA RecvBufResponse.
    -   * 
    - * - * Protobuf type {@code tensorflow.RecvBufRespExtra} - */ - public static final class RecvBufRespExtra extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RecvBufRespExtra) - RecvBufRespExtraOrBuilder { - private static final long serialVersionUID = 0L; - // Use RecvBufRespExtra.newBuilder() to construct. - private RecvBufRespExtra(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecvBufRespExtra() { - tensorContent_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecvBufRespExtra(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecvBufRespExtra( - 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)) { - tensorContent_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensorContent_.add(input.readBytes()); - 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)) { - tensorContent_ = java.util.Collections.unmodifiableList(tensorContent_); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.class, org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.Builder.class); - } - - public static final int TENSOR_CONTENT_FIELD_NUMBER = 1; - private java.util.List tensorContent_; - /** - * repeated bytes tensor_content = 1; - */ - public java.util.List - getTensorContentList() { - return tensorContent_; - } - /** - * repeated bytes tensor_content = 1; - */ - public int getTensorContentCount() { - return tensorContent_.size(); - } - /** - * repeated bytes tensor_content = 1; - */ - public com.google.protobuf.ByteString getTensorContent(int index) { - return tensorContent_.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 { - for (int i = 0; i < tensorContent_.size(); i++) { - output.writeBytes(1, tensorContent_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < tensorContent_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(tensorContent_.get(i)); - } - size += dataSize; - size += 1 * getTensorContentList().size(); - } - 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.distruntime.TransportOptions.RecvBufRespExtra)) { - return super.equals(obj); - } - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra other = (org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra) obj; - - if (!getTensorContentList() - .equals(other.getTensorContentList())) 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 (getTensorContentCount() > 0) { - hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getTensorContentList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra 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.distruntime.TransportOptions.RecvBufRespExtra parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra 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.distruntime.TransportOptions.RecvBufRespExtra parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra 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.distruntime.TransportOptions.RecvBufRespExtra parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra 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.distruntime.TransportOptions.RecvBufRespExtra parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra 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.distruntime.TransportOptions.RecvBufRespExtra 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; - } - /** - *
    -     * Extra data needed on a non-RDMA RecvBufResponse.
    -     * 
    - * - * Protobuf type {@code tensorflow.RecvBufRespExtra} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RecvBufRespExtra) - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtraOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.distruntime.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.distruntime.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.class, org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.Builder.class); - } - - // Construct using org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.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(); - tensorContent_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.distruntime.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra getDefaultInstanceForType() { - return org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra build() { - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra buildPartial() { - org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra result = new org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - tensorContent_ = java.util.Collections.unmodifiableList(tensorContent_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensorContent_ = tensorContent_; - 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.distruntime.TransportOptions.RecvBufRespExtra) { - return mergeFrom((org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra other) { - if (other == org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra.getDefaultInstance()) return this; - if (!other.tensorContent_.isEmpty()) { - if (tensorContent_.isEmpty()) { - tensorContent_ = other.tensorContent_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorContentIsMutable(); - tensorContent_.addAll(other.tensorContent_); - } - onChanged(); - } - 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.distruntime.TransportOptions.RecvBufRespExtra parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List tensorContent_ = java.util.Collections.emptyList(); - private void ensureTensorContentIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensorContent_ = new java.util.ArrayList(tensorContent_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated bytes tensor_content = 1; - */ - public java.util.List - getTensorContentList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(tensorContent_) : tensorContent_; - } - /** - * repeated bytes tensor_content = 1; - */ - public int getTensorContentCount() { - return tensorContent_.size(); - } - /** - * repeated bytes tensor_content = 1; - */ - public com.google.protobuf.ByteString getTensorContent(int index) { - return tensorContent_.get(index); - } - /** - * repeated bytes tensor_content = 1; - */ - public Builder setTensorContent( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorContentIsMutable(); - tensorContent_.set(index, value); - onChanged(); - return this; - } - /** - * repeated bytes tensor_content = 1; - */ - public Builder addTensorContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorContentIsMutable(); - tensorContent_.add(value); - onChanged(); - return this; - } - /** - * repeated bytes tensor_content = 1; - */ - public Builder addAllTensorContent( - java.lang.Iterable values) { - ensureTensorContentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensorContent_); - onChanged(); - return this; - } - /** - * repeated bytes tensor_content = 1; - */ - public Builder clearTensorContent() { - tensorContent_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.RecvBufRespExtra) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RecvBufRespExtra) - private static final org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra(); - } - - public static org.tensorflow.proto.distruntime.TransportOptions.RecvBufRespExtra getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecvBufRespExtra parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecvBufRespExtra(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.distruntime.TransportOptions.RecvBufRespExtra getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RecvBufRespExtra_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0tensorflow/core/protobuf/transport_opt" + - "ions.proto\022\ntensorflow\"*\n\020RecvBufRespExt" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_RecvBufRespExtra_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RecvBufRespExtra_descriptor, - new java.lang.String[] { "TensorContent", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesList.java deleted file mode 100644 index e172470df1c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesList.java +++ /dev/null @@ -1,574 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - *
    - * LINT.IfChange
    - * Containers to hold repeated fundamental values.
    - * 
    - * - * Protobuf type {@code tensorflow.BytesList} - */ -public final class BytesList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BytesList) - BytesListOrBuilder { -private static final long serialVersionUID = 0L; - // Use BytesList.newBuilder() to construct. - private BytesList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BytesList() { - value_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BytesList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BytesList( - 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)) { - value_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - value_.add(input.readBytes()); - 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)) { - value_ = java.util.Collections.unmodifiableList(value_); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_BytesList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.BytesList.class, org.tensorflow.proto.example.BytesList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private java.util.List value_; - /** - * repeated bytes value = 1; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated bytes value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated bytes value = 1; - */ - public com.google.protobuf.ByteString getValue(int index) { - return value_.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 { - for (int i = 0; i < value_.size(); i++) { - output.writeBytes(1, value_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < value_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(value_.get(i)); - } - size += dataSize; - size += 1 * getValueList().size(); - } - 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.example.BytesList)) { - return super.equals(obj); - } - org.tensorflow.proto.example.BytesList other = (org.tensorflow.proto.example.BytesList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.BytesList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.BytesList 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.example.BytesList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.BytesList 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.example.BytesList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.BytesList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.BytesList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.BytesList 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.example.BytesList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.BytesList 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.example.BytesList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.BytesList 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.example.BytesList 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; - } - /** - *
    -   * LINT.IfChange
    -   * Containers to hold repeated fundamental values.
    -   * 
    - * - * Protobuf type {@code tensorflow.BytesList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BytesList) - org.tensorflow.proto.example.BytesListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_BytesList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.BytesList.class, org.tensorflow.proto.example.BytesList.Builder.class); - } - - // Construct using org.tensorflow.proto.example.BytesList.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(); - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.BytesList getDefaultInstanceForType() { - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.BytesList build() { - org.tensorflow.proto.example.BytesList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.BytesList buildPartial() { - org.tensorflow.proto.example.BytesList result = new org.tensorflow.proto.example.BytesList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_ = java.util.Collections.unmodifiableList(value_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.example.BytesList) { - return mergeFrom((org.tensorflow.proto.example.BytesList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.BytesList other) { - if (other == org.tensorflow.proto.example.BytesList.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.example.BytesList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.BytesList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List value_ = java.util.Collections.emptyList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = new java.util.ArrayList(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated bytes value = 1; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated bytes value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated bytes value = 1; - */ - public com.google.protobuf.ByteString getValue(int index) { - return value_.get(index); - } - /** - * repeated bytes value = 1; - */ - public Builder setValue( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.set(index, value); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder addValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.add(value); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder clearValue() { - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.BytesList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BytesList) - private static final org.tensorflow.proto.example.BytesList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.BytesList(); - } - - public static org.tensorflow.proto.example.BytesList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BytesList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BytesList(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.example.BytesList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesListOrBuilder.java deleted file mode 100644 index 11151e1a947..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/BytesListOrBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface BytesListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BytesList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated bytes value = 1; - */ - java.util.List getValueList(); - /** - * repeated bytes value = 1; - */ - int getValueCount(); - /** - * repeated bytes value = 1; - */ - com.google.protobuf.ByteString getValue(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Example.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Example.java deleted file mode 100644 index ea9d058e425..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Example.java +++ /dev/null @@ -1,600 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.Example} - */ -public final class Example extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Example) - ExampleOrBuilder { -private static final long serialVersionUID = 0L; - // Use Example.newBuilder() to construct. - private Example(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Example() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Example(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Example( - 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: { - org.tensorflow.proto.example.Features.Builder subBuilder = null; - if (features_ != null) { - subBuilder = features_.toBuilder(); - } - features_ = input.readMessage(org.tensorflow.proto.example.Features.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(features_); - features_ = subBuilder.buildPartial(); - } - - 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.example.ExampleProtos.internal_static_tensorflow_Example_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_Example_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Example.class, org.tensorflow.proto.example.Example.Builder.class); - } - - public static final int FEATURES_FIELD_NUMBER = 1; - private org.tensorflow.proto.example.Features features_; - /** - * .tensorflow.Features features = 1; - */ - public boolean hasFeatures() { - return features_ != null; - } - /** - * .tensorflow.Features features = 1; - */ - public org.tensorflow.proto.example.Features getFeatures() { - return features_ == null ? org.tensorflow.proto.example.Features.getDefaultInstance() : features_; - } - /** - * .tensorflow.Features features = 1; - */ - public org.tensorflow.proto.example.FeaturesOrBuilder getFeaturesOrBuilder() { - return getFeatures(); - } - - 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 (features_ != null) { - output.writeMessage(1, getFeatures()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (features_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getFeatures()); - } - 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.example.Example)) { - return super.equals(obj); - } - org.tensorflow.proto.example.Example other = (org.tensorflow.proto.example.Example) obj; - - if (hasFeatures() != other.hasFeatures()) return false; - if (hasFeatures()) { - if (!getFeatures() - .equals(other.getFeatures())) 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 (hasFeatures()) { - hash = (37 * hash) + FEATURES_FIELD_NUMBER; - hash = (53 * hash) + getFeatures().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.Example parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Example 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.example.Example parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Example 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.example.Example parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Example parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.Example parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Example 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.example.Example parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Example 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.example.Example parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Example 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.example.Example 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.Example} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Example) - org.tensorflow.proto.example.ExampleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_Example_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_Example_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Example.class, org.tensorflow.proto.example.Example.Builder.class); - } - - // Construct using org.tensorflow.proto.example.Example.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 (featuresBuilder_ == null) { - features_ = null; - } else { - features_ = null; - featuresBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_Example_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.Example getDefaultInstanceForType() { - return org.tensorflow.proto.example.Example.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.Example build() { - org.tensorflow.proto.example.Example result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.Example buildPartial() { - org.tensorflow.proto.example.Example result = new org.tensorflow.proto.example.Example(this); - if (featuresBuilder_ == null) { - result.features_ = features_; - } else { - result.features_ = featuresBuilder_.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.example.Example) { - return mergeFrom((org.tensorflow.proto.example.Example)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.Example other) { - if (other == org.tensorflow.proto.example.Example.getDefaultInstance()) return this; - if (other.hasFeatures()) { - mergeFeatures(other.getFeatures()); - } - 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.example.Example parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.Example) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.example.Features features_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder> featuresBuilder_; - /** - * .tensorflow.Features features = 1; - */ - public boolean hasFeatures() { - return featuresBuilder_ != null || features_ != null; - } - /** - * .tensorflow.Features features = 1; - */ - public org.tensorflow.proto.example.Features getFeatures() { - if (featuresBuilder_ == null) { - return features_ == null ? org.tensorflow.proto.example.Features.getDefaultInstance() : features_; - } else { - return featuresBuilder_.getMessage(); - } - } - /** - * .tensorflow.Features features = 1; - */ - public Builder setFeatures(org.tensorflow.proto.example.Features value) { - if (featuresBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - features_ = value; - onChanged(); - } else { - featuresBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.Features features = 1; - */ - public Builder setFeatures( - org.tensorflow.proto.example.Features.Builder builderForValue) { - if (featuresBuilder_ == null) { - features_ = builderForValue.build(); - onChanged(); - } else { - featuresBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.Features features = 1; - */ - public Builder mergeFeatures(org.tensorflow.proto.example.Features value) { - if (featuresBuilder_ == null) { - if (features_ != null) { - features_ = - org.tensorflow.proto.example.Features.newBuilder(features_).mergeFrom(value).buildPartial(); - } else { - features_ = value; - } - onChanged(); - } else { - featuresBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.Features features = 1; - */ - public Builder clearFeatures() { - if (featuresBuilder_ == null) { - features_ = null; - onChanged(); - } else { - features_ = null; - featuresBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.Features features = 1; - */ - public org.tensorflow.proto.example.Features.Builder getFeaturesBuilder() { - - onChanged(); - return getFeaturesFieldBuilder().getBuilder(); - } - /** - * .tensorflow.Features features = 1; - */ - public org.tensorflow.proto.example.FeaturesOrBuilder getFeaturesOrBuilder() { - if (featuresBuilder_ != null) { - return featuresBuilder_.getMessageOrBuilder(); - } else { - return features_ == null ? - org.tensorflow.proto.example.Features.getDefaultInstance() : features_; - } - } - /** - * .tensorflow.Features features = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder> - getFeaturesFieldBuilder() { - if (featuresBuilder_ == null) { - featuresBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder>( - getFeatures(), - getParentForChildren(), - isClean()); - features_ = null; - } - return featuresBuilder_; - } - @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.Example) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Example) - private static final org.tensorflow.proto.example.Example DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.Example(); - } - - public static org.tensorflow.proto.example.Example getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Example parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Example(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.example.Example getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleOrBuilder.java deleted file mode 100644 index 2026bc24075..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleOrBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example.proto - -package org.tensorflow.proto.example; - -public interface ExampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Example) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.Features features = 1; - */ - boolean hasFeatures(); - /** - * .tensorflow.Features features = 1; - */ - org.tensorflow.proto.example.Features getFeatures(); - /** - * .tensorflow.Features features = 1; - */ - org.tensorflow.proto.example.FeaturesOrBuilder getFeaturesOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfiguration.java deleted file mode 100644 index 4829d13d8ff..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfiguration.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.ExampleParserConfiguration} - */ -public final class ExampleParserConfiguration extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ExampleParserConfiguration) - ExampleParserConfigurationOrBuilder { -private static final long serialVersionUID = 0L; - // Use ExampleParserConfiguration.newBuilder() to construct. - private ExampleParserConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ExampleParserConfiguration() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ExampleParserConfiguration(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ExampleParserConfiguration( - 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)) { - featureMap_ = com.google.protobuf.MapField.newMapField( - FeatureMapDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - featureMap__ = input.readMessage( - FeatureMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - featureMap_.getMutableMap().put( - featureMap__.getKey(), featureMap__.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.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeatureMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.ExampleParserConfiguration.class, org.tensorflow.proto.example.ExampleParserConfiguration.Builder.class); - } - - public static final int FEATURE_MAP_FIELD_NUMBER = 1; - private static final class FeatureMapDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.example.FeatureConfiguration> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.example.FeatureConfiguration.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.FeatureConfiguration> featureMap_; - private com.google.protobuf.MapField - internalGetFeatureMap() { - if (featureMap_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureMapDefaultEntryHolder.defaultEntry); - } - return featureMap_; - } - - public int getFeatureMapCount() { - return internalGetFeatureMap().getMap().size(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public boolean containsFeatureMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeatureMap().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureMapMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeatureMap() { - return getFeatureMapMap(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public java.util.Map getFeatureMapMap() { - return internalGetFeatureMap().getMap(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureConfiguration defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureMap().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureMap().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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFeatureMap(), - FeatureMapDefaultEntryHolder.defaultEntry, - 1); - 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 - : internalGetFeatureMap().getMap().entrySet()) { - com.google.protobuf.MapEntry - featureMap__ = FeatureMapDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, featureMap__); - } - 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.example.ExampleParserConfiguration)) { - return super.equals(obj); - } - org.tensorflow.proto.example.ExampleParserConfiguration other = (org.tensorflow.proto.example.ExampleParserConfiguration) obj; - - if (!internalGetFeatureMap().equals( - other.internalGetFeatureMap())) 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 (!internalGetFeatureMap().getMap().isEmpty()) { - hash = (37 * hash) + FEATURE_MAP_FIELD_NUMBER; - hash = (53 * hash) + internalGetFeatureMap().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.ExampleParserConfiguration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration 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.example.ExampleParserConfiguration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration 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.example.ExampleParserConfiguration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration 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.example.ExampleParserConfiguration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration 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.example.ExampleParserConfiguration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.ExampleParserConfiguration 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.example.ExampleParserConfiguration 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.ExampleParserConfiguration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ExampleParserConfiguration) - org.tensorflow.proto.example.ExampleParserConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeatureMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableFeatureMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.ExampleParserConfiguration.class, org.tensorflow.proto.example.ExampleParserConfiguration.Builder.class); - } - - // Construct using org.tensorflow.proto.example.ExampleParserConfiguration.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(); - internalGetMutableFeatureMap().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.ExampleParserConfiguration getDefaultInstanceForType() { - return org.tensorflow.proto.example.ExampleParserConfiguration.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.ExampleParserConfiguration build() { - org.tensorflow.proto.example.ExampleParserConfiguration result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.ExampleParserConfiguration buildPartial() { - org.tensorflow.proto.example.ExampleParserConfiguration result = new org.tensorflow.proto.example.ExampleParserConfiguration(this); - int from_bitField0_ = bitField0_; - result.featureMap_ = internalGetFeatureMap(); - result.featureMap_.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.example.ExampleParserConfiguration) { - return mergeFrom((org.tensorflow.proto.example.ExampleParserConfiguration)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.ExampleParserConfiguration other) { - if (other == org.tensorflow.proto.example.ExampleParserConfiguration.getDefaultInstance()) return this; - internalGetMutableFeatureMap().mergeFrom( - other.internalGetFeatureMap()); - 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.example.ExampleParserConfiguration parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.ExampleParserConfiguration) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.FeatureConfiguration> featureMap_; - private com.google.protobuf.MapField - internalGetFeatureMap() { - if (featureMap_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureMapDefaultEntryHolder.defaultEntry); - } - return featureMap_; - } - private com.google.protobuf.MapField - internalGetMutableFeatureMap() { - onChanged();; - if (featureMap_ == null) { - featureMap_ = com.google.protobuf.MapField.newMapField( - FeatureMapDefaultEntryHolder.defaultEntry); - } - if (!featureMap_.isMutable()) { - featureMap_ = featureMap_.copy(); - } - return featureMap_; - } - - public int getFeatureMapCount() { - return internalGetFeatureMap().getMap().size(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public boolean containsFeatureMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeatureMap().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureMapMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeatureMap() { - return getFeatureMapMap(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public java.util.Map getFeatureMapMap() { - return internalGetFeatureMap().getMap(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureConfiguration defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureMap().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureMap().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFeatureMap() { - internalGetMutableFeatureMap().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public Builder removeFeatureMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeatureMap().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFeatureMap() { - return internalGetMutableFeatureMap().getMutableMap(); - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - public Builder putFeatureMap( - java.lang.String key, - org.tensorflow.proto.example.FeatureConfiguration value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeatureMap().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - public Builder putAllFeatureMap( - java.util.Map values) { - internalGetMutableFeatureMap().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.ExampleParserConfiguration) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ExampleParserConfiguration) - private static final org.tensorflow.proto.example.ExampleParserConfiguration DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.ExampleParserConfiguration(); - } - - public static org.tensorflow.proto.example.ExampleParserConfiguration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ExampleParserConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExampleParserConfiguration(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.example.ExampleParserConfiguration getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationOrBuilder.java deleted file mode 100644 index 33df2a31a5b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationOrBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -public interface ExampleParserConfigurationOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ExampleParserConfiguration) - com.google.protobuf.MessageOrBuilder { - - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - int getFeatureMapCount(); - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - boolean containsFeatureMap( - java.lang.String key); - /** - * Use {@link #getFeatureMapMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getFeatureMap(); - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - java.util.Map - getFeatureMapMap(); - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureConfiguration defaultValue); - /** - * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; - */ - - org.tensorflow.proto.example.FeatureConfiguration getFeatureMapOrThrow( - java.lang.String key); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleProtos.java deleted file mode 100644 index d5494a720c5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleProtos.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example.proto - -package org.tensorflow.proto.example; - -public final class ExampleProtos { - private ExampleProtos() {} - 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_Example_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Example_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SequenceExample_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SequenceExample_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/example/example.proto\022" + - "\ntensorflow\032%tensorflow/core/example/fea" + - "ture.proto\"1\n\007Example\022&\n\010features\030\001 \001(\0132" + - "\024.tensorflow.Features\"i\n\017SequenceExample" + - "\022%\n\007context\030\001 \001(\0132\024.tensorflow.Features\022" + - "/\n\rfeature_lists\030\002 \001(\0132\030.tensorflow.Feat" + - "ureListsB\207\001\n\034org.tensorflow.proto.exampl" + - "eB\rExampleProtosP\001ZSgithub.com/tensorflo" + - "w/tensorflow/tensorflow/go/core/example/" + - "example_protos_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.example.FeatureProtos.getDescriptor(), - }); - internal_static_tensorflow_Example_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_Example_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Example_descriptor, - new java.lang.String[] { "Features", }); - internal_static_tensorflow_SequenceExample_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_SequenceExample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SequenceExample_descriptor, - new java.lang.String[] { "Context", "FeatureLists", }); - org.tensorflow.proto.example.FeatureProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Feature.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Feature.java deleted file mode 100644 index a4aa0733f54..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Feature.java +++ /dev/null @@ -1,1105 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - *
    - * Containers for non-sequential data.
    - * 
    - * - * Protobuf type {@code tensorflow.Feature} - */ -public final class Feature extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Feature) - FeatureOrBuilder { -private static final long serialVersionUID = 0L; - // Use Feature.newBuilder() to construct. - private Feature(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Feature() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Feature(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Feature( - 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: { - org.tensorflow.proto.example.BytesList.Builder subBuilder = null; - if (kindCase_ == 1) { - subBuilder = ((org.tensorflow.proto.example.BytesList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.example.BytesList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.example.BytesList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 1; - break; - } - case 18: { - org.tensorflow.proto.example.FloatList.Builder subBuilder = null; - if (kindCase_ == 2) { - subBuilder = ((org.tensorflow.proto.example.FloatList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.example.FloatList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.example.FloatList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 2; - break; - } - case 26: { - org.tensorflow.proto.example.Int64List.Builder subBuilder = null; - if (kindCase_ == 3) { - subBuilder = ((org.tensorflow.proto.example.Int64List) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.example.Int64List.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.example.Int64List) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 3; - 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.example.FeatureProtos.internal_static_tensorflow_Feature_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Feature_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Feature.class, org.tensorflow.proto.example.Feature.Builder.class); - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - BYTES_LIST(1), - FLOAT_LIST(2), - INT64_LIST(3), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: return BYTES_LIST; - case 2: return FLOAT_LIST; - case 3: return INT64_LIST; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int BYTES_LIST_FIELD_NUMBER = 1; - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public boolean hasBytesList() { - return kindCase_ == 1; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public org.tensorflow.proto.example.BytesList getBytesList() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.example.BytesList) kind_; - } - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public org.tensorflow.proto.example.BytesListOrBuilder getBytesListOrBuilder() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.example.BytesList) kind_; - } - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - - public static final int FLOAT_LIST_FIELD_NUMBER = 2; - /** - * .tensorflow.FloatList float_list = 2; - */ - public boolean hasFloatList() { - return kindCase_ == 2; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public org.tensorflow.proto.example.FloatList getFloatList() { - if (kindCase_ == 2) { - return (org.tensorflow.proto.example.FloatList) kind_; - } - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public org.tensorflow.proto.example.FloatListOrBuilder getFloatListOrBuilder() { - if (kindCase_ == 2) { - return (org.tensorflow.proto.example.FloatList) kind_; - } - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - - public static final int INT64_LIST_FIELD_NUMBER = 3; - /** - * .tensorflow.Int64List int64_list = 3; - */ - public boolean hasInt64List() { - return kindCase_ == 3; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public org.tensorflow.proto.example.Int64List getInt64List() { - if (kindCase_ == 3) { - return (org.tensorflow.proto.example.Int64List) kind_; - } - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public org.tensorflow.proto.example.Int64ListOrBuilder getInt64ListOrBuilder() { - if (kindCase_ == 3) { - return (org.tensorflow.proto.example.Int64List) kind_; - } - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - - 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 (kindCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.example.BytesList) kind_); - } - if (kindCase_ == 2) { - output.writeMessage(2, (org.tensorflow.proto.example.FloatList) kind_); - } - if (kindCase_ == 3) { - output.writeMessage(3, (org.tensorflow.proto.example.Int64List) kind_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.example.BytesList) kind_); - } - if (kindCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (org.tensorflow.proto.example.FloatList) kind_); - } - if (kindCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (org.tensorflow.proto.example.Int64List) kind_); - } - 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.example.Feature)) { - return super.equals(obj); - } - org.tensorflow.proto.example.Feature other = (org.tensorflow.proto.example.Feature) obj; - - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 1: - if (!getBytesList() - .equals(other.getBytesList())) return false; - break; - case 2: - if (!getFloatList() - .equals(other.getFloatList())) return false; - break; - case 3: - if (!getInt64List() - .equals(other.getInt64List())) return false; - break; - case 0: - default: - } - 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(); - switch (kindCase_) { - case 1: - hash = (37 * hash) + BYTES_LIST_FIELD_NUMBER; - hash = (53 * hash) + getBytesList().hashCode(); - break; - case 2: - hash = (37 * hash) + FLOAT_LIST_FIELD_NUMBER; - hash = (53 * hash) + getFloatList().hashCode(); - break; - case 3: - hash = (37 * hash) + INT64_LIST_FIELD_NUMBER; - hash = (53 * hash) + getInt64List().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.Feature parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Feature 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.example.Feature parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Feature 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.example.Feature parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Feature parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.Feature parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Feature 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.example.Feature parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Feature 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.example.Feature parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Feature 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.example.Feature 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; - } - /** - *
    -   * Containers for non-sequential data.
    -   * 
    - * - * Protobuf type {@code tensorflow.Feature} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Feature) - org.tensorflow.proto.example.FeatureOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Feature_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Feature_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Feature.class, org.tensorflow.proto.example.Feature.Builder.class); - } - - // Construct using org.tensorflow.proto.example.Feature.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(); - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Feature_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.Feature getDefaultInstanceForType() { - return org.tensorflow.proto.example.Feature.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.Feature build() { - org.tensorflow.proto.example.Feature result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.Feature buildPartial() { - org.tensorflow.proto.example.Feature result = new org.tensorflow.proto.example.Feature(this); - if (kindCase_ == 1) { - if (bytesListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = bytesListBuilder_.build(); - } - } - if (kindCase_ == 2) { - if (floatListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = floatListBuilder_.build(); - } - } - if (kindCase_ == 3) { - if (int64ListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = int64ListBuilder_.build(); - } - } - result.kindCase_ = kindCase_; - 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.example.Feature) { - return mergeFrom((org.tensorflow.proto.example.Feature)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.Feature other) { - if (other == org.tensorflow.proto.example.Feature.getDefaultInstance()) return this; - switch (other.getKindCase()) { - case BYTES_LIST: { - mergeBytesList(other.getBytesList()); - break; - } - case FLOAT_LIST: { - mergeFloatList(other.getFloatList()); - break; - } - case INT64_LIST: { - mergeInt64List(other.getInt64List()); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.example.Feature parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.Feature) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.BytesList, org.tensorflow.proto.example.BytesList.Builder, org.tensorflow.proto.example.BytesListOrBuilder> bytesListBuilder_; - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public boolean hasBytesList() { - return kindCase_ == 1; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public org.tensorflow.proto.example.BytesList getBytesList() { - if (bytesListBuilder_ == null) { - if (kindCase_ == 1) { - return (org.tensorflow.proto.example.BytesList) kind_; - } - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } else { - if (kindCase_ == 1) { - return bytesListBuilder_.getMessage(); - } - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public Builder setBytesList(org.tensorflow.proto.example.BytesList value) { - if (bytesListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - bytesListBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public Builder setBytesList( - org.tensorflow.proto.example.BytesList.Builder builderForValue) { - if (bytesListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - bytesListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public Builder mergeBytesList(org.tensorflow.proto.example.BytesList value) { - if (bytesListBuilder_ == null) { - if (kindCase_ == 1 && - kind_ != org.tensorflow.proto.example.BytesList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.example.BytesList.newBuilder((org.tensorflow.proto.example.BytesList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 1) { - bytesListBuilder_.mergeFrom(value); - } - bytesListBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public Builder clearBytesList() { - if (bytesListBuilder_ == null) { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - } - bytesListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public org.tensorflow.proto.example.BytesList.Builder getBytesListBuilder() { - return getBytesListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - public org.tensorflow.proto.example.BytesListOrBuilder getBytesListOrBuilder() { - if ((kindCase_ == 1) && (bytesListBuilder_ != null)) { - return bytesListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 1) { - return (org.tensorflow.proto.example.BytesList) kind_; - } - return org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - } - /** - * .tensorflow.BytesList bytes_list = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.BytesList, org.tensorflow.proto.example.BytesList.Builder, org.tensorflow.proto.example.BytesListOrBuilder> - getBytesListFieldBuilder() { - if (bytesListBuilder_ == null) { - if (!(kindCase_ == 1)) { - kind_ = org.tensorflow.proto.example.BytesList.getDefaultInstance(); - } - bytesListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.BytesList, org.tensorflow.proto.example.BytesList.Builder, org.tensorflow.proto.example.BytesListOrBuilder>( - (org.tensorflow.proto.example.BytesList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 1; - onChanged();; - return bytesListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FloatList, org.tensorflow.proto.example.FloatList.Builder, org.tensorflow.proto.example.FloatListOrBuilder> floatListBuilder_; - /** - * .tensorflow.FloatList float_list = 2; - */ - public boolean hasFloatList() { - return kindCase_ == 2; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public org.tensorflow.proto.example.FloatList getFloatList() { - if (floatListBuilder_ == null) { - if (kindCase_ == 2) { - return (org.tensorflow.proto.example.FloatList) kind_; - } - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } else { - if (kindCase_ == 2) { - return floatListBuilder_.getMessage(); - } - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public Builder setFloatList(org.tensorflow.proto.example.FloatList value) { - if (floatListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - floatListBuilder_.setMessage(value); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public Builder setFloatList( - org.tensorflow.proto.example.FloatList.Builder builderForValue) { - if (floatListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - floatListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public Builder mergeFloatList(org.tensorflow.proto.example.FloatList value) { - if (floatListBuilder_ == null) { - if (kindCase_ == 2 && - kind_ != org.tensorflow.proto.example.FloatList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.example.FloatList.newBuilder((org.tensorflow.proto.example.FloatList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 2) { - floatListBuilder_.mergeFrom(value); - } - floatListBuilder_.setMessage(value); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public Builder clearFloatList() { - if (floatListBuilder_ == null) { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - } - floatListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public org.tensorflow.proto.example.FloatList.Builder getFloatListBuilder() { - return getFloatListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.FloatList float_list = 2; - */ - public org.tensorflow.proto.example.FloatListOrBuilder getFloatListOrBuilder() { - if ((kindCase_ == 2) && (floatListBuilder_ != null)) { - return floatListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 2) { - return (org.tensorflow.proto.example.FloatList) kind_; - } - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - } - /** - * .tensorflow.FloatList float_list = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FloatList, org.tensorflow.proto.example.FloatList.Builder, org.tensorflow.proto.example.FloatListOrBuilder> - getFloatListFieldBuilder() { - if (floatListBuilder_ == null) { - if (!(kindCase_ == 2)) { - kind_ = org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - floatListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FloatList, org.tensorflow.proto.example.FloatList.Builder, org.tensorflow.proto.example.FloatListOrBuilder>( - (org.tensorflow.proto.example.FloatList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 2; - onChanged();; - return floatListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Int64List, org.tensorflow.proto.example.Int64List.Builder, org.tensorflow.proto.example.Int64ListOrBuilder> int64ListBuilder_; - /** - * .tensorflow.Int64List int64_list = 3; - */ - public boolean hasInt64List() { - return kindCase_ == 3; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public org.tensorflow.proto.example.Int64List getInt64List() { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3) { - return (org.tensorflow.proto.example.Int64List) kind_; - } - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } else { - if (kindCase_ == 3) { - return int64ListBuilder_.getMessage(); - } - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public Builder setInt64List(org.tensorflow.proto.example.Int64List value) { - if (int64ListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - int64ListBuilder_.setMessage(value); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public Builder setInt64List( - org.tensorflow.proto.example.Int64List.Builder builderForValue) { - if (int64ListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - int64ListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public Builder mergeInt64List(org.tensorflow.proto.example.Int64List value) { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3 && - kind_ != org.tensorflow.proto.example.Int64List.getDefaultInstance()) { - kind_ = org.tensorflow.proto.example.Int64List.newBuilder((org.tensorflow.proto.example.Int64List) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 3) { - int64ListBuilder_.mergeFrom(value); - } - int64ListBuilder_.setMessage(value); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public Builder clearInt64List() { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 3) { - kindCase_ = 0; - kind_ = null; - } - int64ListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public org.tensorflow.proto.example.Int64List.Builder getInt64ListBuilder() { - return getInt64ListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - public org.tensorflow.proto.example.Int64ListOrBuilder getInt64ListOrBuilder() { - if ((kindCase_ == 3) && (int64ListBuilder_ != null)) { - return int64ListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 3) { - return (org.tensorflow.proto.example.Int64List) kind_; - } - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - } - /** - * .tensorflow.Int64List int64_list = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Int64List, org.tensorflow.proto.example.Int64List.Builder, org.tensorflow.proto.example.Int64ListOrBuilder> - getInt64ListFieldBuilder() { - if (int64ListBuilder_ == null) { - if (!(kindCase_ == 3)) { - kind_ = org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - int64ListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Int64List, org.tensorflow.proto.example.Int64List.Builder, org.tensorflow.proto.example.Int64ListOrBuilder>( - (org.tensorflow.proto.example.Int64List) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 3; - onChanged();; - return int64ListBuilder_; - } - @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.Feature) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Feature) - private static final org.tensorflow.proto.example.Feature DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.Feature(); - } - - public static org.tensorflow.proto.example.Feature getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Feature parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Feature(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.example.Feature getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfiguration.java deleted file mode 100644 index 6034a97c93e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfiguration.java +++ /dev/null @@ -1,893 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.FeatureConfiguration} - */ -public final class FeatureConfiguration extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FeatureConfiguration) - FeatureConfigurationOrBuilder { -private static final long serialVersionUID = 0L; - // Use FeatureConfiguration.newBuilder() to construct. - private FeatureConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FeatureConfiguration() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FeatureConfiguration(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FeatureConfiguration( - 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: { - org.tensorflow.proto.example.FixedLenFeatureProto.Builder subBuilder = null; - if (configCase_ == 1) { - subBuilder = ((org.tensorflow.proto.example.FixedLenFeatureProto) config_).toBuilder(); - } - config_ = - input.readMessage(org.tensorflow.proto.example.FixedLenFeatureProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.example.FixedLenFeatureProto) config_); - config_ = subBuilder.buildPartial(); - } - configCase_ = 1; - break; - } - case 18: { - org.tensorflow.proto.example.VarLenFeatureProto.Builder subBuilder = null; - if (configCase_ == 2) { - subBuilder = ((org.tensorflow.proto.example.VarLenFeatureProto) config_).toBuilder(); - } - config_ = - input.readMessage(org.tensorflow.proto.example.VarLenFeatureProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.example.VarLenFeatureProto) config_); - config_ = subBuilder.buildPartial(); - } - configCase_ = 2; - 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.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureConfiguration.class, org.tensorflow.proto.example.FeatureConfiguration.Builder.class); - } - - private int configCase_ = 0; - private java.lang.Object config_; - public enum ConfigCase - implements com.google.protobuf.Internal.EnumLite { - FIXED_LEN_FEATURE(1), - VAR_LEN_FEATURE(2), - CONFIG_NOT_SET(0); - private final int value; - private ConfigCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ConfigCase valueOf(int value) { - return forNumber(value); - } - - public static ConfigCase forNumber(int value) { - switch (value) { - case 1: return FIXED_LEN_FEATURE; - case 2: return VAR_LEN_FEATURE; - case 0: return CONFIG_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ConfigCase - getConfigCase() { - return ConfigCase.forNumber( - configCase_); - } - - public static final int FIXED_LEN_FEATURE_FIELD_NUMBER = 1; - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public boolean hasFixedLenFeature() { - return configCase_ == 1; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public org.tensorflow.proto.example.FixedLenFeatureProto getFixedLenFeature() { - if (configCase_ == 1) { - return (org.tensorflow.proto.example.FixedLenFeatureProto) config_; - } - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder() { - if (configCase_ == 1) { - return (org.tensorflow.proto.example.FixedLenFeatureProto) config_; - } - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - - public static final int VAR_LEN_FEATURE_FIELD_NUMBER = 2; - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public boolean hasVarLenFeature() { - return configCase_ == 2; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public org.tensorflow.proto.example.VarLenFeatureProto getVarLenFeature() { - if (configCase_ == 2) { - return (org.tensorflow.proto.example.VarLenFeatureProto) config_; - } - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder() { - if (configCase_ == 2) { - return (org.tensorflow.proto.example.VarLenFeatureProto) config_; - } - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - - 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 (configCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.example.FixedLenFeatureProto) config_); - } - if (configCase_ == 2) { - output.writeMessage(2, (org.tensorflow.proto.example.VarLenFeatureProto) config_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (configCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.example.FixedLenFeatureProto) config_); - } - if (configCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (org.tensorflow.proto.example.VarLenFeatureProto) config_); - } - 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.example.FeatureConfiguration)) { - return super.equals(obj); - } - org.tensorflow.proto.example.FeatureConfiguration other = (org.tensorflow.proto.example.FeatureConfiguration) obj; - - if (!getConfigCase().equals(other.getConfigCase())) return false; - switch (configCase_) { - case 1: - if (!getFixedLenFeature() - .equals(other.getFixedLenFeature())) return false; - break; - case 2: - if (!getVarLenFeature() - .equals(other.getVarLenFeature())) return false; - break; - case 0: - default: - } - 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(); - switch (configCase_) { - case 1: - hash = (37 * hash) + FIXED_LEN_FEATURE_FIELD_NUMBER; - hash = (53 * hash) + getFixedLenFeature().hashCode(); - break; - case 2: - hash = (37 * hash) + VAR_LEN_FEATURE_FIELD_NUMBER; - hash = (53 * hash) + getVarLenFeature().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.FeatureConfiguration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureConfiguration 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.example.FeatureConfiguration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureConfiguration 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.example.FeatureConfiguration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureConfiguration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.FeatureConfiguration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureConfiguration 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.example.FeatureConfiguration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureConfiguration 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.example.FeatureConfiguration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureConfiguration 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.example.FeatureConfiguration 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.FeatureConfiguration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FeatureConfiguration) - org.tensorflow.proto.example.FeatureConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureConfiguration.class, org.tensorflow.proto.example.FeatureConfiguration.Builder.class); - } - - // Construct using org.tensorflow.proto.example.FeatureConfiguration.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(); - configCase_ = 0; - config_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureConfiguration getDefaultInstanceForType() { - return org.tensorflow.proto.example.FeatureConfiguration.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureConfiguration build() { - org.tensorflow.proto.example.FeatureConfiguration result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureConfiguration buildPartial() { - org.tensorflow.proto.example.FeatureConfiguration result = new org.tensorflow.proto.example.FeatureConfiguration(this); - if (configCase_ == 1) { - if (fixedLenFeatureBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = fixedLenFeatureBuilder_.build(); - } - } - if (configCase_ == 2) { - if (varLenFeatureBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = varLenFeatureBuilder_.build(); - } - } - result.configCase_ = configCase_; - 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.example.FeatureConfiguration) { - return mergeFrom((org.tensorflow.proto.example.FeatureConfiguration)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.FeatureConfiguration other) { - if (other == org.tensorflow.proto.example.FeatureConfiguration.getDefaultInstance()) return this; - switch (other.getConfigCase()) { - case FIXED_LEN_FEATURE: { - mergeFixedLenFeature(other.getFixedLenFeature()); - break; - } - case VAR_LEN_FEATURE: { - mergeVarLenFeature(other.getVarLenFeature()); - break; - } - case CONFIG_NOT_SET: { - break; - } - } - 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.example.FeatureConfiguration parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.FeatureConfiguration) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int configCase_ = 0; - private java.lang.Object config_; - public ConfigCase - getConfigCase() { - return ConfigCase.forNumber( - configCase_); - } - - public Builder clearConfig() { - configCase_ = 0; - config_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FixedLenFeatureProto, org.tensorflow.proto.example.FixedLenFeatureProto.Builder, org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder> fixedLenFeatureBuilder_; - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public boolean hasFixedLenFeature() { - return configCase_ == 1; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public org.tensorflow.proto.example.FixedLenFeatureProto getFixedLenFeature() { - if (fixedLenFeatureBuilder_ == null) { - if (configCase_ == 1) { - return (org.tensorflow.proto.example.FixedLenFeatureProto) config_; - } - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } else { - if (configCase_ == 1) { - return fixedLenFeatureBuilder_.getMessage(); - } - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public Builder setFixedLenFeature(org.tensorflow.proto.example.FixedLenFeatureProto value) { - if (fixedLenFeatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - fixedLenFeatureBuilder_.setMessage(value); - } - configCase_ = 1; - return this; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public Builder setFixedLenFeature( - org.tensorflow.proto.example.FixedLenFeatureProto.Builder builderForValue) { - if (fixedLenFeatureBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - fixedLenFeatureBuilder_.setMessage(builderForValue.build()); - } - configCase_ = 1; - return this; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public Builder mergeFixedLenFeature(org.tensorflow.proto.example.FixedLenFeatureProto value) { - if (fixedLenFeatureBuilder_ == null) { - if (configCase_ == 1 && - config_ != org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance()) { - config_ = org.tensorflow.proto.example.FixedLenFeatureProto.newBuilder((org.tensorflow.proto.example.FixedLenFeatureProto) config_) - .mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - if (configCase_ == 1) { - fixedLenFeatureBuilder_.mergeFrom(value); - } - fixedLenFeatureBuilder_.setMessage(value); - } - configCase_ = 1; - return this; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public Builder clearFixedLenFeature() { - if (fixedLenFeatureBuilder_ == null) { - if (configCase_ == 1) { - configCase_ = 0; - config_ = null; - onChanged(); - } - } else { - if (configCase_ == 1) { - configCase_ = 0; - config_ = null; - } - fixedLenFeatureBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public org.tensorflow.proto.example.FixedLenFeatureProto.Builder getFixedLenFeatureBuilder() { - return getFixedLenFeatureFieldBuilder().getBuilder(); - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - public org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder() { - if ((configCase_ == 1) && (fixedLenFeatureBuilder_ != null)) { - return fixedLenFeatureBuilder_.getMessageOrBuilder(); - } else { - if (configCase_ == 1) { - return (org.tensorflow.proto.example.FixedLenFeatureProto) config_; - } - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - } - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FixedLenFeatureProto, org.tensorflow.proto.example.FixedLenFeatureProto.Builder, org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder> - getFixedLenFeatureFieldBuilder() { - if (fixedLenFeatureBuilder_ == null) { - if (!(configCase_ == 1)) { - config_ = org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - fixedLenFeatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FixedLenFeatureProto, org.tensorflow.proto.example.FixedLenFeatureProto.Builder, org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder>( - (org.tensorflow.proto.example.FixedLenFeatureProto) config_, - getParentForChildren(), - isClean()); - config_ = null; - } - configCase_ = 1; - onChanged();; - return fixedLenFeatureBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.VarLenFeatureProto, org.tensorflow.proto.example.VarLenFeatureProto.Builder, org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder> varLenFeatureBuilder_; - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public boolean hasVarLenFeature() { - return configCase_ == 2; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public org.tensorflow.proto.example.VarLenFeatureProto getVarLenFeature() { - if (varLenFeatureBuilder_ == null) { - if (configCase_ == 2) { - return (org.tensorflow.proto.example.VarLenFeatureProto) config_; - } - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } else { - if (configCase_ == 2) { - return varLenFeatureBuilder_.getMessage(); - } - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public Builder setVarLenFeature(org.tensorflow.proto.example.VarLenFeatureProto value) { - if (varLenFeatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - varLenFeatureBuilder_.setMessage(value); - } - configCase_ = 2; - return this; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public Builder setVarLenFeature( - org.tensorflow.proto.example.VarLenFeatureProto.Builder builderForValue) { - if (varLenFeatureBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - varLenFeatureBuilder_.setMessage(builderForValue.build()); - } - configCase_ = 2; - return this; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public Builder mergeVarLenFeature(org.tensorflow.proto.example.VarLenFeatureProto value) { - if (varLenFeatureBuilder_ == null) { - if (configCase_ == 2 && - config_ != org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance()) { - config_ = org.tensorflow.proto.example.VarLenFeatureProto.newBuilder((org.tensorflow.proto.example.VarLenFeatureProto) config_) - .mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - if (configCase_ == 2) { - varLenFeatureBuilder_.mergeFrom(value); - } - varLenFeatureBuilder_.setMessage(value); - } - configCase_ = 2; - return this; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public Builder clearVarLenFeature() { - if (varLenFeatureBuilder_ == null) { - if (configCase_ == 2) { - configCase_ = 0; - config_ = null; - onChanged(); - } - } else { - if (configCase_ == 2) { - configCase_ = 0; - config_ = null; - } - varLenFeatureBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public org.tensorflow.proto.example.VarLenFeatureProto.Builder getVarLenFeatureBuilder() { - return getVarLenFeatureFieldBuilder().getBuilder(); - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - public org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder() { - if ((configCase_ == 2) && (varLenFeatureBuilder_ != null)) { - return varLenFeatureBuilder_.getMessageOrBuilder(); - } else { - if (configCase_ == 2) { - return (org.tensorflow.proto.example.VarLenFeatureProto) config_; - } - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - } - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.VarLenFeatureProto, org.tensorflow.proto.example.VarLenFeatureProto.Builder, org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder> - getVarLenFeatureFieldBuilder() { - if (varLenFeatureBuilder_ == null) { - if (!(configCase_ == 2)) { - config_ = org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - varLenFeatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.VarLenFeatureProto, org.tensorflow.proto.example.VarLenFeatureProto.Builder, org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder>( - (org.tensorflow.proto.example.VarLenFeatureProto) config_, - getParentForChildren(), - isClean()); - config_ = null; - } - configCase_ = 2; - onChanged();; - return varLenFeatureBuilder_; - } - @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.FeatureConfiguration) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FeatureConfiguration) - private static final org.tensorflow.proto.example.FeatureConfiguration DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.FeatureConfiguration(); - } - - public static org.tensorflow.proto.example.FeatureConfiguration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FeatureConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FeatureConfiguration(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.example.FeatureConfiguration getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfigurationOrBuilder.java deleted file mode 100644 index 917025caa25..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureConfigurationOrBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -public interface FeatureConfigurationOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FeatureConfiguration) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - boolean hasFixedLenFeature(); - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - org.tensorflow.proto.example.FixedLenFeatureProto getFixedLenFeature(); - /** - * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; - */ - org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder(); - - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - boolean hasVarLenFeature(); - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - org.tensorflow.proto.example.VarLenFeatureProto getVarLenFeature(); - /** - * .tensorflow.VarLenFeatureProto var_len_feature = 2; - */ - org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder(); - - public org.tensorflow.proto.example.FeatureConfiguration.ConfigCase getConfigCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureList.java deleted file mode 100644 index 6aa9f29864a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureList.java +++ /dev/null @@ -1,781 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - *
    - * Containers for sequential data.
    - * A FeatureList contains lists of Features.  These may hold zero or more
    - * Feature values.
    - * FeatureLists are organized into categories by name.  The FeatureLists message
    - * contains the mapping from name to FeatureList.
    - * 
    - * - * Protobuf type {@code tensorflow.FeatureList} - */ -public final class FeatureList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FeatureList) - FeatureListOrBuilder { -private static final long serialVersionUID = 0L; - // Use FeatureList.newBuilder() to construct. - private FeatureList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FeatureList() { - feature_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FeatureList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FeatureList( - 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)) { - feature_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - feature_.add( - input.readMessage(org.tensorflow.proto.example.Feature.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_ & 0x00000001) != 0)) { - feature_ = java.util.Collections.unmodifiableList(feature_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureList.class, org.tensorflow.proto.example.FeatureList.Builder.class); - } - - public static final int FEATURE_FIELD_NUMBER = 1; - private java.util.List feature_; - /** - * repeated .tensorflow.Feature feature = 1; - */ - public java.util.List getFeatureList() { - return feature_; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public java.util.List - getFeatureOrBuilderList() { - return feature_; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public int getFeatureCount() { - return feature_.size(); - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.Feature getFeature(int index) { - return feature_.get(index); - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.FeatureOrBuilder getFeatureOrBuilder( - int index) { - return feature_.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 { - for (int i = 0; i < feature_.size(); i++) { - output.writeMessage(1, feature_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < feature_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, feature_.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.example.FeatureList)) { - return super.equals(obj); - } - org.tensorflow.proto.example.FeatureList other = (org.tensorflow.proto.example.FeatureList) obj; - - if (!getFeatureList() - .equals(other.getFeatureList())) 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 (getFeatureCount() > 0) { - hash = (37 * hash) + FEATURE_FIELD_NUMBER; - hash = (53 * hash) + getFeatureList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.FeatureList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureList 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.example.FeatureList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureList 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.example.FeatureList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.FeatureList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureList 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.example.FeatureList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureList 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.example.FeatureList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureList 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.example.FeatureList 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; - } - /** - *
    -   * Containers for sequential data.
    -   * A FeatureList contains lists of Features.  These may hold zero or more
    -   * Feature values.
    -   * FeatureLists are organized into categories by name.  The FeatureLists message
    -   * contains the mapping from name to FeatureList.
    -   * 
    - * - * Protobuf type {@code tensorflow.FeatureList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FeatureList) - org.tensorflow.proto.example.FeatureListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureList.class, org.tensorflow.proto.example.FeatureList.Builder.class); - } - - // Construct using org.tensorflow.proto.example.FeatureList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFeatureFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (featureBuilder_ == null) { - feature_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - featureBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureList getDefaultInstanceForType() { - return org.tensorflow.proto.example.FeatureList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureList build() { - org.tensorflow.proto.example.FeatureList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureList buildPartial() { - org.tensorflow.proto.example.FeatureList result = new org.tensorflow.proto.example.FeatureList(this); - int from_bitField0_ = bitField0_; - if (featureBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - feature_ = java.util.Collections.unmodifiableList(feature_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.feature_ = feature_; - } else { - result.feature_ = featureBuilder_.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.example.FeatureList) { - return mergeFrom((org.tensorflow.proto.example.FeatureList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.FeatureList other) { - if (other == org.tensorflow.proto.example.FeatureList.getDefaultInstance()) return this; - if (featureBuilder_ == null) { - if (!other.feature_.isEmpty()) { - if (feature_.isEmpty()) { - feature_ = other.feature_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFeatureIsMutable(); - feature_.addAll(other.feature_); - } - onChanged(); - } - } else { - if (!other.feature_.isEmpty()) { - if (featureBuilder_.isEmpty()) { - featureBuilder_.dispose(); - featureBuilder_ = null; - feature_ = other.feature_; - bitField0_ = (bitField0_ & ~0x00000001); - featureBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFeatureFieldBuilder() : null; - } else { - featureBuilder_.addAllMessages(other.feature_); - } - } - } - 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.example.FeatureList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.FeatureList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List feature_ = - java.util.Collections.emptyList(); - private void ensureFeatureIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - feature_ = new java.util.ArrayList(feature_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.example.Feature, org.tensorflow.proto.example.Feature.Builder, org.tensorflow.proto.example.FeatureOrBuilder> featureBuilder_; - - /** - * repeated .tensorflow.Feature feature = 1; - */ - public java.util.List getFeatureList() { - if (featureBuilder_ == null) { - return java.util.Collections.unmodifiableList(feature_); - } else { - return featureBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public int getFeatureCount() { - if (featureBuilder_ == null) { - return feature_.size(); - } else { - return featureBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.Feature getFeature(int index) { - if (featureBuilder_ == null) { - return feature_.get(index); - } else { - return featureBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder setFeature( - int index, org.tensorflow.proto.example.Feature value) { - if (featureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFeatureIsMutable(); - feature_.set(index, value); - onChanged(); - } else { - featureBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder setFeature( - int index, org.tensorflow.proto.example.Feature.Builder builderForValue) { - if (featureBuilder_ == null) { - ensureFeatureIsMutable(); - feature_.set(index, builderForValue.build()); - onChanged(); - } else { - featureBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder addFeature(org.tensorflow.proto.example.Feature value) { - if (featureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFeatureIsMutable(); - feature_.add(value); - onChanged(); - } else { - featureBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder addFeature( - int index, org.tensorflow.proto.example.Feature value) { - if (featureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFeatureIsMutable(); - feature_.add(index, value); - onChanged(); - } else { - featureBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder addFeature( - org.tensorflow.proto.example.Feature.Builder builderForValue) { - if (featureBuilder_ == null) { - ensureFeatureIsMutable(); - feature_.add(builderForValue.build()); - onChanged(); - } else { - featureBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder addFeature( - int index, org.tensorflow.proto.example.Feature.Builder builderForValue) { - if (featureBuilder_ == null) { - ensureFeatureIsMutable(); - feature_.add(index, builderForValue.build()); - onChanged(); - } else { - featureBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder addAllFeature( - java.lang.Iterable values) { - if (featureBuilder_ == null) { - ensureFeatureIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, feature_); - onChanged(); - } else { - featureBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder clearFeature() { - if (featureBuilder_ == null) { - feature_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - featureBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public Builder removeFeature(int index) { - if (featureBuilder_ == null) { - ensureFeatureIsMutable(); - feature_.remove(index); - onChanged(); - } else { - featureBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.Feature.Builder getFeatureBuilder( - int index) { - return getFeatureFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.FeatureOrBuilder getFeatureOrBuilder( - int index) { - if (featureBuilder_ == null) { - return feature_.get(index); } else { - return featureBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public java.util.List - getFeatureOrBuilderList() { - if (featureBuilder_ != null) { - return featureBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(feature_); - } - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.Feature.Builder addFeatureBuilder() { - return getFeatureFieldBuilder().addBuilder( - org.tensorflow.proto.example.Feature.getDefaultInstance()); - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public org.tensorflow.proto.example.Feature.Builder addFeatureBuilder( - int index) { - return getFeatureFieldBuilder().addBuilder( - index, org.tensorflow.proto.example.Feature.getDefaultInstance()); - } - /** - * repeated .tensorflow.Feature feature = 1; - */ - public java.util.List - getFeatureBuilderList() { - return getFeatureFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.example.Feature, org.tensorflow.proto.example.Feature.Builder, org.tensorflow.proto.example.FeatureOrBuilder> - getFeatureFieldBuilder() { - if (featureBuilder_ == null) { - featureBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.example.Feature, org.tensorflow.proto.example.Feature.Builder, org.tensorflow.proto.example.FeatureOrBuilder>( - feature_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - feature_ = null; - } - return featureBuilder_; - } - @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.FeatureList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FeatureList) - private static final org.tensorflow.proto.example.FeatureList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.FeatureList(); - } - - public static org.tensorflow.proto.example.FeatureList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FeatureList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FeatureList(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.example.FeatureList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListOrBuilder.java deleted file mode 100644 index 9302c3512db..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface FeatureListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FeatureList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.Feature feature = 1; - */ - java.util.List - getFeatureList(); - /** - * repeated .tensorflow.Feature feature = 1; - */ - org.tensorflow.proto.example.Feature getFeature(int index); - /** - * repeated .tensorflow.Feature feature = 1; - */ - int getFeatureCount(); - /** - * repeated .tensorflow.Feature feature = 1; - */ - java.util.List - getFeatureOrBuilderList(); - /** - * repeated .tensorflow.Feature feature = 1; - */ - org.tensorflow.proto.example.FeatureOrBuilder getFeatureOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureLists.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureLists.java deleted file mode 100644 index 4b10f2b7d90..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureLists.java +++ /dev/null @@ -1,739 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.FeatureLists} - */ -public final class FeatureLists extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FeatureLists) - FeatureListsOrBuilder { -private static final long serialVersionUID = 0L; - // Use FeatureLists.newBuilder() to construct. - private FeatureLists(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FeatureLists() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FeatureLists(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FeatureLists( - 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)) { - featureList_ = com.google.protobuf.MapField.newMapField( - FeatureListDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - featureList__ = input.readMessage( - FeatureListDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - featureList_.getMutableMap().put( - featureList__.getKey(), featureList__.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.example.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeatureList(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureLists_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureLists.class, org.tensorflow.proto.example.FeatureLists.Builder.class); - } - - public static final int FEATURE_LIST_FIELD_NUMBER = 1; - private static final class FeatureListDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.example.FeatureList> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.example.FeatureList.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.FeatureList> featureList_; - private com.google.protobuf.MapField - internalGetFeatureList() { - if (featureList_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureListDefaultEntryHolder.defaultEntry); - } - return featureList_; - } - - public int getFeatureListCount() { - return internalGetFeatureList().getMap().size(); - } - /** - *
    -   * Map from feature name to feature list.
    -   * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public boolean containsFeatureList( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeatureList().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureListMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeatureList() { - return getFeatureListMap(); - } - /** - *
    -   * Map from feature name to feature list.
    -   * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public java.util.Map getFeatureListMap() { - return internalGetFeatureList().getMap(); - } - /** - *
    -   * Map from feature name to feature list.
    -   * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public org.tensorflow.proto.example.FeatureList getFeatureListOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureList defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureList().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Map from feature name to feature list.
    -   * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public org.tensorflow.proto.example.FeatureList getFeatureListOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureList().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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFeatureList(), - FeatureListDefaultEntryHolder.defaultEntry, - 1); - 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 - : internalGetFeatureList().getMap().entrySet()) { - com.google.protobuf.MapEntry - featureList__ = FeatureListDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, featureList__); - } - 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.example.FeatureLists)) { - return super.equals(obj); - } - org.tensorflow.proto.example.FeatureLists other = (org.tensorflow.proto.example.FeatureLists) obj; - - if (!internalGetFeatureList().equals( - other.internalGetFeatureList())) 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 (!internalGetFeatureList().getMap().isEmpty()) { - hash = (37 * hash) + FEATURE_LIST_FIELD_NUMBER; - hash = (53 * hash) + internalGetFeatureList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.FeatureLists parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureLists 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.example.FeatureLists parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureLists 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.example.FeatureLists parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FeatureLists parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.FeatureLists parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureLists 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.example.FeatureLists parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureLists 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.example.FeatureLists parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FeatureLists 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.example.FeatureLists 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.FeatureLists} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FeatureLists) - org.tensorflow.proto.example.FeatureListsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeatureList(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableFeatureList(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureLists_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FeatureLists.class, org.tensorflow.proto.example.FeatureLists.Builder.class); - } - - // Construct using org.tensorflow.proto.example.FeatureLists.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(); - internalGetMutableFeatureList().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureLists getDefaultInstanceForType() { - return org.tensorflow.proto.example.FeatureLists.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureLists build() { - org.tensorflow.proto.example.FeatureLists result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.FeatureLists buildPartial() { - org.tensorflow.proto.example.FeatureLists result = new org.tensorflow.proto.example.FeatureLists(this); - int from_bitField0_ = bitField0_; - result.featureList_ = internalGetFeatureList(); - result.featureList_.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.example.FeatureLists) { - return mergeFrom((org.tensorflow.proto.example.FeatureLists)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.FeatureLists other) { - if (other == org.tensorflow.proto.example.FeatureLists.getDefaultInstance()) return this; - internalGetMutableFeatureList().mergeFrom( - other.internalGetFeatureList()); - 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.example.FeatureLists parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.FeatureLists) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.FeatureList> featureList_; - private com.google.protobuf.MapField - internalGetFeatureList() { - if (featureList_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureListDefaultEntryHolder.defaultEntry); - } - return featureList_; - } - private com.google.protobuf.MapField - internalGetMutableFeatureList() { - onChanged();; - if (featureList_ == null) { - featureList_ = com.google.protobuf.MapField.newMapField( - FeatureListDefaultEntryHolder.defaultEntry); - } - if (!featureList_.isMutable()) { - featureList_ = featureList_.copy(); - } - return featureList_; - } - - public int getFeatureListCount() { - return internalGetFeatureList().getMap().size(); - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public boolean containsFeatureList( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeatureList().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureListMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeatureList() { - return getFeatureListMap(); - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public java.util.Map getFeatureListMap() { - return internalGetFeatureList().getMap(); - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public org.tensorflow.proto.example.FeatureList getFeatureListOrDefault( - java.lang.String key, - org.tensorflow.proto.example.FeatureList defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureList().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public org.tensorflow.proto.example.FeatureList getFeatureListOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeatureList().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFeatureList() { - internalGetMutableFeatureList().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public Builder removeFeatureList( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeatureList().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFeatureList() { - return internalGetMutableFeatureList().getMutableMap(); - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - public Builder putFeatureList( - java.lang.String key, - org.tensorflow.proto.example.FeatureList value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeatureList().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Map from feature name to feature list.
    -     * 
    - * - * map<string, .tensorflow.FeatureList> feature_list = 1; - */ - - public Builder putAllFeatureList( - java.util.Map values) { - internalGetMutableFeatureList().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.FeatureLists) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FeatureLists) - private static final org.tensorflow.proto.example.FeatureLists DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.FeatureLists(); - } - - public static org.tensorflow.proto.example.FeatureLists getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FeatureLists parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FeatureLists(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.example.FeatureLists getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureOrBuilder.java deleted file mode 100644 index 92242bf9615..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface FeatureOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Feature) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.BytesList bytes_list = 1; - */ - boolean hasBytesList(); - /** - * .tensorflow.BytesList bytes_list = 1; - */ - org.tensorflow.proto.example.BytesList getBytesList(); - /** - * .tensorflow.BytesList bytes_list = 1; - */ - org.tensorflow.proto.example.BytesListOrBuilder getBytesListOrBuilder(); - - /** - * .tensorflow.FloatList float_list = 2; - */ - boolean hasFloatList(); - /** - * .tensorflow.FloatList float_list = 2; - */ - org.tensorflow.proto.example.FloatList getFloatList(); - /** - * .tensorflow.FloatList float_list = 2; - */ - org.tensorflow.proto.example.FloatListOrBuilder getFloatListOrBuilder(); - - /** - * .tensorflow.Int64List int64_list = 3; - */ - boolean hasInt64List(); - /** - * .tensorflow.Int64List int64_list = 3; - */ - org.tensorflow.proto.example.Int64List getInt64List(); - /** - * .tensorflow.Int64List int64_list = 3; - */ - org.tensorflow.proto.example.Int64ListOrBuilder getInt64ListOrBuilder(); - - public org.tensorflow.proto.example.Feature.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureProtos.java deleted file mode 100644 index a03e3fecc50..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureProtos.java +++ /dev/null @@ -1,153 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public final class FeatureProtos { - private FeatureProtos() {} - 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_BytesList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BytesList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_FloatList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FloatList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Int64List_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Int64List_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Feature_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Feature_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Features_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Features_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Features_FeatureEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Features_FeatureEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_FeatureList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FeatureList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_FeatureLists_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FeatureLists_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FeatureLists_FeatureListEntry_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/example/feature.proto\022" + - "\ntensorflow\"\032\n\tBytesList\022\r\n\005value\030\001 \003(\014\"" + - "\036\n\tFloatList\022\021\n\005value\030\001 \003(\002B\002\020\001\"\036\n\tInt64" + - "List\022\021\n\005value\030\001 \003(\003B\002\020\001\"\230\001\n\007Feature\022+\n\nb" + - "ytes_list\030\001 \001(\0132\025.tensorflow.BytesListH\000" + - "\022+\n\nfloat_list\030\002 \001(\0132\025.tensorflow.FloatL" + - "istH\000\022+\n\nint64_list\030\003 \001(\0132\025.tensorflow.I" + - "nt64ListH\000B\006\n\004kind\"\203\001\n\010Features\0222\n\007featu" + - "re\030\001 \003(\0132!.tensorflow.Features.FeatureEn" + - "try\032C\n\014FeatureEntry\022\013\n\003key\030\001 \001(\t\022\"\n\005valu" + - "e\030\002 \001(\0132\023.tensorflow.Feature:\0028\001\"3\n\013Feat" + - "ureList\022$\n\007feature\030\001 \003(\0132\023.tensorflow.Fe" + - "ature\"\234\001\n\014FeatureLists\022?\n\014feature_list\030\001" + - " \003(\0132).tensorflow.FeatureLists.FeatureLi" + - "stEntry\032K\n\020FeatureListEntry\022\013\n\003key\030\001 \001(\t" + - "\022&\n\005value\030\002 \001(\0132\027.tensorflow.FeatureList" + - ":\0028\001B\207\001\n\034org.tensorflow.proto.exampleB\rF" + - "eatureProtosP\001ZSgithub.com/tensorflow/te" + - "nsorflow/tensorflow/go/core/example/exam" + - "ple_protos_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_BytesList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_BytesList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BytesList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_FloatList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_FloatList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FloatList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_Int64List_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_Int64List_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Int64List_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_Feature_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_Feature_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Feature_descriptor, - new java.lang.String[] { "BytesList", "FloatList", "Int64List", "Kind", }); - internal_static_tensorflow_Features_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_Features_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Features_descriptor, - new java.lang.String[] { "Feature", }); - internal_static_tensorflow_Features_FeatureEntry_descriptor = - internal_static_tensorflow_Features_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_Features_FeatureEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Features_FeatureEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_FeatureList_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_FeatureList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FeatureList_descriptor, - new java.lang.String[] { "Feature", }); - internal_static_tensorflow_FeatureLists_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_FeatureLists_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FeatureLists_descriptor, - new java.lang.String[] { "FeatureList", }); - internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor = - internal_static_tensorflow_FeatureLists_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_FeatureLists_FeatureListEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FeatureLists_FeatureListEntry_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/example/Features.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Features.java deleted file mode 100644 index 0e47b04941f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Features.java +++ /dev/null @@ -1,739 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.Features} - */ -public final class Features extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Features) - FeaturesOrBuilder { -private static final long serialVersionUID = 0L; - // Use Features.newBuilder() to construct. - private Features(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Features() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Features(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Features( - 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)) { - feature_ = com.google.protobuf.MapField.newMapField( - FeatureDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - feature__ = input.readMessage( - FeatureDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - feature_.getMutableMap().put( - feature__.getKey(), feature__.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.example.FeatureProtos.internal_static_tensorflow_Features_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeature(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Features_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Features.class, org.tensorflow.proto.example.Features.Builder.class); - } - - public static final int FEATURE_FIELD_NUMBER = 1; - private static final class FeatureDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.example.Feature> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Features_FeatureEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.example.Feature.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.Feature> feature_; - private com.google.protobuf.MapField - internalGetFeature() { - if (feature_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureDefaultEntryHolder.defaultEntry); - } - return feature_; - } - - public int getFeatureCount() { - return internalGetFeature().getMap().size(); - } - /** - *
    -   * Map from feature name to feature.
    -   * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public boolean containsFeature( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeature().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeature() { - return getFeatureMap(); - } - /** - *
    -   * Map from feature name to feature.
    -   * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public java.util.Map getFeatureMap() { - return internalGetFeature().getMap(); - } - /** - *
    -   * Map from feature name to feature.
    -   * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public org.tensorflow.proto.example.Feature getFeatureOrDefault( - java.lang.String key, - org.tensorflow.proto.example.Feature defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeature().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Map from feature name to feature.
    -   * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public org.tensorflow.proto.example.Feature getFeatureOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeature().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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFeature(), - FeatureDefaultEntryHolder.defaultEntry, - 1); - 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 - : internalGetFeature().getMap().entrySet()) { - com.google.protobuf.MapEntry - feature__ = FeatureDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, feature__); - } - 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.example.Features)) { - return super.equals(obj); - } - org.tensorflow.proto.example.Features other = (org.tensorflow.proto.example.Features) obj; - - if (!internalGetFeature().equals( - other.internalGetFeature())) 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 (!internalGetFeature().getMap().isEmpty()) { - hash = (37 * hash) + FEATURE_FIELD_NUMBER; - hash = (53 * hash) + internalGetFeature().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.Features parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Features 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.example.Features parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Features 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.example.Features parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Features parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.Features parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Features 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.example.Features parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Features 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.example.Features parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Features 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.example.Features 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.Features} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Features) - org.tensorflow.proto.example.FeaturesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Features_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFeature(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableFeature(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Features_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Features.class, org.tensorflow.proto.example.Features.Builder.class); - } - - // Construct using org.tensorflow.proto.example.Features.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(); - internalGetMutableFeature().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Features_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.Features getDefaultInstanceForType() { - return org.tensorflow.proto.example.Features.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.Features build() { - org.tensorflow.proto.example.Features result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.Features buildPartial() { - org.tensorflow.proto.example.Features result = new org.tensorflow.proto.example.Features(this); - int from_bitField0_ = bitField0_; - result.feature_ = internalGetFeature(); - result.feature_.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.example.Features) { - return mergeFrom((org.tensorflow.proto.example.Features)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.Features other) { - if (other == org.tensorflow.proto.example.Features.getDefaultInstance()) return this; - internalGetMutableFeature().mergeFrom( - other.internalGetFeature()); - 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.example.Features parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.Features) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.example.Feature> feature_; - private com.google.protobuf.MapField - internalGetFeature() { - if (feature_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeatureDefaultEntryHolder.defaultEntry); - } - return feature_; - } - private com.google.protobuf.MapField - internalGetMutableFeature() { - onChanged();; - if (feature_ == null) { - feature_ = com.google.protobuf.MapField.newMapField( - FeatureDefaultEntryHolder.defaultEntry); - } - if (!feature_.isMutable()) { - feature_ = feature_.copy(); - } - return feature_; - } - - public int getFeatureCount() { - return internalGetFeature().getMap().size(); - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public boolean containsFeature( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeature().getMap().containsKey(key); - } - /** - * Use {@link #getFeatureMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeature() { - return getFeatureMap(); - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public java.util.Map getFeatureMap() { - return internalGetFeature().getMap(); - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public org.tensorflow.proto.example.Feature getFeatureOrDefault( - java.lang.String key, - org.tensorflow.proto.example.Feature defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeature().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public org.tensorflow.proto.example.Feature getFeatureOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeature().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFeature() { - internalGetMutableFeature().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public Builder removeFeature( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeature().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFeature() { - return internalGetMutableFeature().getMutableMap(); - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - public Builder putFeature( - java.lang.String key, - org.tensorflow.proto.example.Feature value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeature().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Map from feature name to feature.
    -     * 
    - * - * map<string, .tensorflow.Feature> feature = 1; - */ - - public Builder putAllFeature( - java.util.Map values) { - internalGetMutableFeature().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.Features) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Features) - private static final org.tensorflow.proto.example.Features DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.Features(); - } - - public static org.tensorflow.proto.example.Features getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Features parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Features(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.example.Features getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProto.java deleted file mode 100644 index 1f378121573..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProto.java +++ /dev/null @@ -1,993 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.FixedLenFeatureProto} - */ -public final class FixedLenFeatureProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FixedLenFeatureProto) - FixedLenFeatureProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use FixedLenFeatureProto.newBuilder() to construct. - private FixedLenFeatureProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FixedLenFeatureProto() { - dtype_ = 0; - valuesOutputTensorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FixedLenFeatureProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FixedLenFeatureProto( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (defaultValue_ != null) { - subBuilder = defaultValue_.toBuilder(); - } - defaultValue_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultValue_); - defaultValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - valuesOutputTensorName_ = s; - 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.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FixedLenFeatureProto.class, org.tensorflow.proto.example.FixedLenFeatureProto.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorProto defaultValue_; - /** - * .tensorflow.TensorProto default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValue_ != null; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public org.tensorflow.proto.framework.TensorProto getDefaultValue() { - return defaultValue_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : defaultValue_; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getDefaultValueOrBuilder() { - return getDefaultValue(); - } - - public static final int VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object valuesOutputTensorName_; - /** - * string values_output_tensor_name = 4; - */ - public java.lang.String getValuesOutputTensorName() { - java.lang.Object ref = valuesOutputTensorName_; - 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(); - valuesOutputTensorName_ = s; - return s; - } - } - /** - * string values_output_tensor_name = 4; - */ - public com.google.protobuf.ByteString - getValuesOutputTensorNameBytes() { - java.lang.Object ref = valuesOutputTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (defaultValue_ != null) { - output.writeMessage(3, getDefaultValue()); - } - if (!getValuesOutputTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, valuesOutputTensorName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (defaultValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDefaultValue()); - } - if (!getValuesOutputTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, valuesOutputTensorName_); - } - 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.example.FixedLenFeatureProto)) { - return super.equals(obj); - } - org.tensorflow.proto.example.FixedLenFeatureProto other = (org.tensorflow.proto.example.FixedLenFeatureProto) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (hasDefaultValue() != other.hasDefaultValue()) return false; - if (hasDefaultValue()) { - if (!getDefaultValue() - .equals(other.getDefaultValue())) return false; - } - if (!getValuesOutputTensorName() - .equals(other.getValuesOutputTensorName())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - if (hasDefaultValue()) { - hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultValue().hashCode(); - } - hash = (37 * hash) + VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getValuesOutputTensorName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.FixedLenFeatureProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto 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.example.FixedLenFeatureProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto 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.example.FixedLenFeatureProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto 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.example.FixedLenFeatureProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto 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.example.FixedLenFeatureProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FixedLenFeatureProto 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.example.FixedLenFeatureProto 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.FixedLenFeatureProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FixedLenFeatureProto) - org.tensorflow.proto.example.FixedLenFeatureProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FixedLenFeatureProto.class, org.tensorflow.proto.example.FixedLenFeatureProto.Builder.class); - } - - // Construct using org.tensorflow.proto.example.FixedLenFeatureProto.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(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - valuesOutputTensorName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.FixedLenFeatureProto getDefaultInstanceForType() { - return org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.FixedLenFeatureProto build() { - org.tensorflow.proto.example.FixedLenFeatureProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.FixedLenFeatureProto buildPartial() { - org.tensorflow.proto.example.FixedLenFeatureProto result = new org.tensorflow.proto.example.FixedLenFeatureProto(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - if (defaultValueBuilder_ == null) { - result.defaultValue_ = defaultValue_; - } else { - result.defaultValue_ = defaultValueBuilder_.build(); - } - result.valuesOutputTensorName_ = valuesOutputTensorName_; - 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.example.FixedLenFeatureProto) { - return mergeFrom((org.tensorflow.proto.example.FixedLenFeatureProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.FixedLenFeatureProto other) { - if (other == org.tensorflow.proto.example.FixedLenFeatureProto.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.hasDefaultValue()) { - mergeDefaultValue(other.getDefaultValue()); - } - if (!other.getValuesOutputTensorName().isEmpty()) { - valuesOutputTensorName_ = other.valuesOutputTensorName_; - onChanged(); - } - 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.example.FixedLenFeatureProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.FixedLenFeatureProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private org.tensorflow.proto.framework.TensorProto defaultValue_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> defaultValueBuilder_; - /** - * .tensorflow.TensorProto default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValueBuilder_ != null || defaultValue_ != null; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public org.tensorflow.proto.framework.TensorProto getDefaultValue() { - if (defaultValueBuilder_ == null) { - return defaultValue_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : defaultValue_; - } else { - return defaultValueBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public Builder setDefaultValue(org.tensorflow.proto.framework.TensorProto value) { - if (defaultValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultValue_ = value; - onChanged(); - } else { - defaultValueBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public Builder setDefaultValue( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (defaultValueBuilder_ == null) { - defaultValue_ = builderForValue.build(); - onChanged(); - } else { - defaultValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public Builder mergeDefaultValue(org.tensorflow.proto.framework.TensorProto value) { - if (defaultValueBuilder_ == null) { - if (defaultValue_ != null) { - defaultValue_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); - } else { - defaultValue_ = value; - } - onChanged(); - } else { - defaultValueBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public Builder clearDefaultValue() { - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - onChanged(); - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getDefaultValueBuilder() { - - onChanged(); - return getDefaultValueFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getDefaultValueOrBuilder() { - if (defaultValueBuilder_ != null) { - return defaultValueBuilder_.getMessageOrBuilder(); - } else { - return defaultValue_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : defaultValue_; - } - } - /** - * .tensorflow.TensorProto default_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getDefaultValueFieldBuilder() { - if (defaultValueBuilder_ == null) { - defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getDefaultValue(), - getParentForChildren(), - isClean()); - defaultValue_ = null; - } - return defaultValueBuilder_; - } - - private java.lang.Object valuesOutputTensorName_ = ""; - /** - * string values_output_tensor_name = 4; - */ - public java.lang.String getValuesOutputTensorName() { - java.lang.Object ref = valuesOutputTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - valuesOutputTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string values_output_tensor_name = 4; - */ - public com.google.protobuf.ByteString - getValuesOutputTensorNameBytes() { - java.lang.Object ref = valuesOutputTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string values_output_tensor_name = 4; - */ - public Builder setValuesOutputTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - valuesOutputTensorName_ = value; - onChanged(); - return this; - } - /** - * string values_output_tensor_name = 4; - */ - public Builder clearValuesOutputTensorName() { - - valuesOutputTensorName_ = getDefaultInstance().getValuesOutputTensorName(); - onChanged(); - return this; - } - /** - * string values_output_tensor_name = 4; - */ - public Builder setValuesOutputTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - valuesOutputTensorName_ = value; - 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.FixedLenFeatureProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FixedLenFeatureProto) - private static final org.tensorflow.proto.example.FixedLenFeatureProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.FixedLenFeatureProto(); - } - - public static org.tensorflow.proto.example.FixedLenFeatureProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FixedLenFeatureProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FixedLenFeatureProto(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.example.FixedLenFeatureProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProtoOrBuilder.java deleted file mode 100644 index 0008b29583f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FixedLenFeatureProtoOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -public interface FixedLenFeatureProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FixedLenFeatureProto) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * .tensorflow.TensorProto default_value = 3; - */ - boolean hasDefaultValue(); - /** - * .tensorflow.TensorProto default_value = 3; - */ - org.tensorflow.proto.framework.TensorProto getDefaultValue(); - /** - * .tensorflow.TensorProto default_value = 3; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getDefaultValueOrBuilder(); - - /** - * string values_output_tensor_name = 4; - */ - java.lang.String getValuesOutputTensorName(); - /** - * string values_output_tensor_name = 4; - */ - com.google.protobuf.ByteString - getValuesOutputTensorNameBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatList.java deleted file mode 100644 index efad9ee2fb6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatList.java +++ /dev/null @@ -1,579 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.FloatList} - */ -public final class FloatList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FloatList) - FloatListOrBuilder { -private static final long serialVersionUID = 0L; - // Use FloatList.newBuilder() to construct. - private FloatList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FloatList() { - value_ = emptyFloatList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FloatList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FloatList( - 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 13: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - value_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - value_.addFloat(input.readFloat()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - value_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - value_.addFloat(input.readFloat()); - } - input.popLimit(limit); - 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)) { - value_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FloatList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FloatList.class, org.tensorflow.proto.example.FloatList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.FloatList value_; - /** - * repeated float value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated float value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated float value = 1 [packed = true]; - */ - public float getValue(int index) { - return value_.getFloat(index); - } - private int valueMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (getValueList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(valueMemoizedSerializedSize); - } - for (int i = 0; i < value_.size(); i++) { - output.writeFloatNoTag(value_.getFloat(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * getValueList().size(); - size += dataSize; - if (!getValueList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - valueMemoizedSerializedSize = dataSize; - } - 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.example.FloatList)) { - return super.equals(obj); - } - org.tensorflow.proto.example.FloatList other = (org.tensorflow.proto.example.FloatList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.FloatList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FloatList 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.example.FloatList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FloatList 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.example.FloatList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.FloatList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.FloatList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FloatList 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.example.FloatList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FloatList 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.example.FloatList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.FloatList 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.example.FloatList 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.FloatList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FloatList) - org.tensorflow.proto.example.FloatListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FloatList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.FloatList.class, org.tensorflow.proto.example.FloatList.Builder.class); - } - - // Construct using org.tensorflow.proto.example.FloatList.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(); - value_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.FloatList getDefaultInstanceForType() { - return org.tensorflow.proto.example.FloatList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.FloatList build() { - org.tensorflow.proto.example.FloatList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.FloatList buildPartial() { - org.tensorflow.proto.example.FloatList result = new org.tensorflow.proto.example.FloatList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.example.FloatList) { - return mergeFrom((org.tensorflow.proto.example.FloatList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.FloatList other) { - if (other == org.tensorflow.proto.example.FloatList.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.example.FloatList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.FloatList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = mutableCopy(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated float value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated float value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated float value = 1 [packed = true]; - */ - public float getValue(int index) { - return value_.getFloat(index); - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder setValue( - int index, float value) { - ensureValueIsMutable(); - value_.setFloat(index, value); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder addValue(float value) { - ensureValueIsMutable(); - value_.addFloat(value); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder clearValue() { - value_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.FloatList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FloatList) - private static final org.tensorflow.proto.example.FloatList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.FloatList(); - } - - public static org.tensorflow.proto.example.FloatList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FloatList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FloatList(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.example.FloatList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatListOrBuilder.java deleted file mode 100644 index 65856cd5f4e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FloatListOrBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface FloatListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FloatList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated float value = 1 [packed = true]; - */ - java.util.List getValueList(); - /** - * repeated float value = 1 [packed = true]; - */ - int getValueCount(); - /** - * repeated float value = 1 [packed = true]; - */ - float getValue(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64List.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64List.java deleted file mode 100644 index 1cf4f104182..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64List.java +++ /dev/null @@ -1,582 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.Int64List} - */ -public final class Int64List extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Int64List) - Int64ListOrBuilder { -private static final long serialVersionUID = 0L; - // Use Int64List.newBuilder() to construct. - private Int64List(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Int64List() { - value_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Int64List(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Int64List( - 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: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - value_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - value_.addLong(input.readInt64()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - value_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - value_.addLong(input.readInt64()); - } - input.popLimit(limit); - 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)) { - value_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Int64List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Int64List.class, org.tensorflow.proto.example.Int64List.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.LongList value_; - /** - * repeated int64 value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public long getValue(int index) { - return value_.getLong(index); - } - private int valueMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (getValueList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(valueMemoizedSerializedSize); - } - for (int i = 0; i < value_.size(); i++) { - output.writeInt64NoTag(value_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < value_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(value_.getLong(i)); - } - size += dataSize; - if (!getValueList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - valueMemoizedSerializedSize = dataSize; - } - 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.example.Int64List)) { - return super.equals(obj); - } - org.tensorflow.proto.example.Int64List other = (org.tensorflow.proto.example.Int64List) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.Int64List parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Int64List 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.example.Int64List parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Int64List 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.example.Int64List parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.Int64List parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.Int64List parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Int64List 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.example.Int64List parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Int64List 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.example.Int64List parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.Int64List 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.example.Int64List 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.Int64List} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Int64List) - org.tensorflow.proto.example.Int64ListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Int64List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.Int64List.class, org.tensorflow.proto.example.Int64List.Builder.class); - } - - // Construct using org.tensorflow.proto.example.Int64List.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(); - value_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.Int64List getDefaultInstanceForType() { - return org.tensorflow.proto.example.Int64List.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.Int64List build() { - org.tensorflow.proto.example.Int64List result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.Int64List buildPartial() { - org.tensorflow.proto.example.Int64List result = new org.tensorflow.proto.example.Int64List(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.example.Int64List) { - return mergeFrom((org.tensorflow.proto.example.Int64List)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.Int64List other) { - if (other == org.tensorflow.proto.example.Int64List.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.example.Int64List parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.Int64List) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.LongList value_ = emptyLongList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = mutableCopy(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public long getValue(int index) { - return value_.getLong(index); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder setValue( - int index, long value) { - ensureValueIsMutable(); - value_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder addValue(long value) { - ensureValueIsMutable(); - value_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder clearValue() { - value_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.Int64List) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Int64List) - private static final org.tensorflow.proto.example.Int64List DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.Int64List(); - } - - public static org.tensorflow.proto.example.Int64List getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Int64List parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Int64List(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.example.Int64List getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64ListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64ListOrBuilder.java deleted file mode 100644 index 6ca9f168a7d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/Int64ListOrBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/feature.proto - -package org.tensorflow.proto.example; - -public interface Int64ListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Int64List) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated int64 value = 1 [packed = true]; - */ - java.util.List getValueList(); - /** - * repeated int64 value = 1 [packed = true]; - */ - int getValueCount(); - /** - * repeated int64 value = 1 [packed = true]; - */ - long getValue(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExample.java deleted file mode 100644 index b88e6f12e34..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExample.java +++ /dev/null @@ -1,781 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.SequenceExample} - */ -public final class SequenceExample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SequenceExample) - SequenceExampleOrBuilder { -private static final long serialVersionUID = 0L; - // Use SequenceExample.newBuilder() to construct. - private SequenceExample(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SequenceExample() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SequenceExample(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SequenceExample( - 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: { - org.tensorflow.proto.example.Features.Builder subBuilder = null; - if (context_ != null) { - subBuilder = context_.toBuilder(); - } - context_ = input.readMessage(org.tensorflow.proto.example.Features.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(context_); - context_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.tensorflow.proto.example.FeatureLists.Builder subBuilder = null; - if (featureLists_ != null) { - subBuilder = featureLists_.toBuilder(); - } - featureLists_ = input.readMessage(org.tensorflow.proto.example.FeatureLists.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(featureLists_); - featureLists_ = subBuilder.buildPartial(); - } - - 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.example.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_SequenceExample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.SequenceExample.class, org.tensorflow.proto.example.SequenceExample.Builder.class); - } - - public static final int CONTEXT_FIELD_NUMBER = 1; - private org.tensorflow.proto.example.Features context_; - /** - * .tensorflow.Features context = 1; - */ - public boolean hasContext() { - return context_ != null; - } - /** - * .tensorflow.Features context = 1; - */ - public org.tensorflow.proto.example.Features getContext() { - return context_ == null ? org.tensorflow.proto.example.Features.getDefaultInstance() : context_; - } - /** - * .tensorflow.Features context = 1; - */ - public org.tensorflow.proto.example.FeaturesOrBuilder getContextOrBuilder() { - return getContext(); - } - - public static final int FEATURE_LISTS_FIELD_NUMBER = 2; - private org.tensorflow.proto.example.FeatureLists featureLists_; - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public boolean hasFeatureLists() { - return featureLists_ != null; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public org.tensorflow.proto.example.FeatureLists getFeatureLists() { - return featureLists_ == null ? org.tensorflow.proto.example.FeatureLists.getDefaultInstance() : featureLists_; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public org.tensorflow.proto.example.FeatureListsOrBuilder getFeatureListsOrBuilder() { - return getFeatureLists(); - } - - 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 (context_ != null) { - output.writeMessage(1, getContext()); - } - if (featureLists_ != null) { - output.writeMessage(2, getFeatureLists()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (context_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContext()); - } - if (featureLists_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getFeatureLists()); - } - 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.example.SequenceExample)) { - return super.equals(obj); - } - org.tensorflow.proto.example.SequenceExample other = (org.tensorflow.proto.example.SequenceExample) obj; - - if (hasContext() != other.hasContext()) return false; - if (hasContext()) { - if (!getContext() - .equals(other.getContext())) return false; - } - if (hasFeatureLists() != other.hasFeatureLists()) return false; - if (hasFeatureLists()) { - if (!getFeatureLists() - .equals(other.getFeatureLists())) 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 (hasContext()) { - hash = (37 * hash) + CONTEXT_FIELD_NUMBER; - hash = (53 * hash) + getContext().hashCode(); - } - if (hasFeatureLists()) { - hash = (37 * hash) + FEATURE_LISTS_FIELD_NUMBER; - hash = (53 * hash) + getFeatureLists().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.SequenceExample parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.SequenceExample 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.example.SequenceExample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.SequenceExample 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.example.SequenceExample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.SequenceExample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.SequenceExample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.SequenceExample 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.example.SequenceExample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.SequenceExample 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.example.SequenceExample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.SequenceExample 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.example.SequenceExample 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.SequenceExample} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SequenceExample) - org.tensorflow.proto.example.SequenceExampleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_SequenceExample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.SequenceExample.class, org.tensorflow.proto.example.SequenceExample.Builder.class); - } - - // Construct using org.tensorflow.proto.example.SequenceExample.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 (contextBuilder_ == null) { - context_ = null; - } else { - context_ = null; - contextBuilder_ = null; - } - if (featureListsBuilder_ == null) { - featureLists_ = null; - } else { - featureLists_ = null; - featureListsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.SequenceExample getDefaultInstanceForType() { - return org.tensorflow.proto.example.SequenceExample.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.SequenceExample build() { - org.tensorflow.proto.example.SequenceExample result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.SequenceExample buildPartial() { - org.tensorflow.proto.example.SequenceExample result = new org.tensorflow.proto.example.SequenceExample(this); - if (contextBuilder_ == null) { - result.context_ = context_; - } else { - result.context_ = contextBuilder_.build(); - } - if (featureListsBuilder_ == null) { - result.featureLists_ = featureLists_; - } else { - result.featureLists_ = featureListsBuilder_.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.example.SequenceExample) { - return mergeFrom((org.tensorflow.proto.example.SequenceExample)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.SequenceExample other) { - if (other == org.tensorflow.proto.example.SequenceExample.getDefaultInstance()) return this; - if (other.hasContext()) { - mergeContext(other.getContext()); - } - if (other.hasFeatureLists()) { - mergeFeatureLists(other.getFeatureLists()); - } - 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.example.SequenceExample parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.SequenceExample) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.example.Features context_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder> contextBuilder_; - /** - * .tensorflow.Features context = 1; - */ - public boolean hasContext() { - return contextBuilder_ != null || context_ != null; - } - /** - * .tensorflow.Features context = 1; - */ - public org.tensorflow.proto.example.Features getContext() { - if (contextBuilder_ == null) { - return context_ == null ? org.tensorflow.proto.example.Features.getDefaultInstance() : context_; - } else { - return contextBuilder_.getMessage(); - } - } - /** - * .tensorflow.Features context = 1; - */ - public Builder setContext(org.tensorflow.proto.example.Features value) { - if (contextBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - context_ = value; - onChanged(); - } else { - contextBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.Features context = 1; - */ - public Builder setContext( - org.tensorflow.proto.example.Features.Builder builderForValue) { - if (contextBuilder_ == null) { - context_ = builderForValue.build(); - onChanged(); - } else { - contextBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.Features context = 1; - */ - public Builder mergeContext(org.tensorflow.proto.example.Features value) { - if (contextBuilder_ == null) { - if (context_ != null) { - context_ = - org.tensorflow.proto.example.Features.newBuilder(context_).mergeFrom(value).buildPartial(); - } else { - context_ = value; - } - onChanged(); - } else { - contextBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.Features context = 1; - */ - public Builder clearContext() { - if (contextBuilder_ == null) { - context_ = null; - onChanged(); - } else { - context_ = null; - contextBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.Features context = 1; - */ - public org.tensorflow.proto.example.Features.Builder getContextBuilder() { - - onChanged(); - return getContextFieldBuilder().getBuilder(); - } - /** - * .tensorflow.Features context = 1; - */ - public org.tensorflow.proto.example.FeaturesOrBuilder getContextOrBuilder() { - if (contextBuilder_ != null) { - return contextBuilder_.getMessageOrBuilder(); - } else { - return context_ == null ? - org.tensorflow.proto.example.Features.getDefaultInstance() : context_; - } - } - /** - * .tensorflow.Features context = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder> - getContextFieldBuilder() { - if (contextBuilder_ == null) { - contextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.Features, org.tensorflow.proto.example.Features.Builder, org.tensorflow.proto.example.FeaturesOrBuilder>( - getContext(), - getParentForChildren(), - isClean()); - context_ = null; - } - return contextBuilder_; - } - - private org.tensorflow.proto.example.FeatureLists featureLists_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FeatureLists, org.tensorflow.proto.example.FeatureLists.Builder, org.tensorflow.proto.example.FeatureListsOrBuilder> featureListsBuilder_; - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public boolean hasFeatureLists() { - return featureListsBuilder_ != null || featureLists_ != null; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public org.tensorflow.proto.example.FeatureLists getFeatureLists() { - if (featureListsBuilder_ == null) { - return featureLists_ == null ? org.tensorflow.proto.example.FeatureLists.getDefaultInstance() : featureLists_; - } else { - return featureListsBuilder_.getMessage(); - } - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public Builder setFeatureLists(org.tensorflow.proto.example.FeatureLists value) { - if (featureListsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - featureLists_ = value; - onChanged(); - } else { - featureListsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public Builder setFeatureLists( - org.tensorflow.proto.example.FeatureLists.Builder builderForValue) { - if (featureListsBuilder_ == null) { - featureLists_ = builderForValue.build(); - onChanged(); - } else { - featureListsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public Builder mergeFeatureLists(org.tensorflow.proto.example.FeatureLists value) { - if (featureListsBuilder_ == null) { - if (featureLists_ != null) { - featureLists_ = - org.tensorflow.proto.example.FeatureLists.newBuilder(featureLists_).mergeFrom(value).buildPartial(); - } else { - featureLists_ = value; - } - onChanged(); - } else { - featureListsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public Builder clearFeatureLists() { - if (featureListsBuilder_ == null) { - featureLists_ = null; - onChanged(); - } else { - featureLists_ = null; - featureListsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public org.tensorflow.proto.example.FeatureLists.Builder getFeatureListsBuilder() { - - onChanged(); - return getFeatureListsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - public org.tensorflow.proto.example.FeatureListsOrBuilder getFeatureListsOrBuilder() { - if (featureListsBuilder_ != null) { - return featureListsBuilder_.getMessageOrBuilder(); - } else { - return featureLists_ == null ? - org.tensorflow.proto.example.FeatureLists.getDefaultInstance() : featureLists_; - } - } - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FeatureLists, org.tensorflow.proto.example.FeatureLists.Builder, org.tensorflow.proto.example.FeatureListsOrBuilder> - getFeatureListsFieldBuilder() { - if (featureListsBuilder_ == null) { - featureListsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.example.FeatureLists, org.tensorflow.proto.example.FeatureLists.Builder, org.tensorflow.proto.example.FeatureListsOrBuilder>( - getFeatureLists(), - getParentForChildren(), - isClean()); - featureLists_ = null; - } - return featureListsBuilder_; - } - @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.SequenceExample) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SequenceExample) - private static final org.tensorflow.proto.example.SequenceExample DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.SequenceExample(); - } - - public static org.tensorflow.proto.example.SequenceExample getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SequenceExample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SequenceExample(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.example.SequenceExample getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExampleOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExampleOrBuilder.java deleted file mode 100644 index 9b849c8c3c2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/SequenceExampleOrBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example.proto - -package org.tensorflow.proto.example; - -public interface SequenceExampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SequenceExample) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.Features context = 1; - */ - boolean hasContext(); - /** - * .tensorflow.Features context = 1; - */ - org.tensorflow.proto.example.Features getContext(); - /** - * .tensorflow.Features context = 1; - */ - org.tensorflow.proto.example.FeaturesOrBuilder getContextOrBuilder(); - - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - boolean hasFeatureLists(); - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - org.tensorflow.proto.example.FeatureLists getFeatureLists(); - /** - * .tensorflow.FeatureLists feature_lists = 2; - */ - org.tensorflow.proto.example.FeatureListsOrBuilder getFeatureListsOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProto.java deleted file mode 100644 index 8edd05b1f24..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProto.java +++ /dev/null @@ -1,885 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -/** - * Protobuf type {@code tensorflow.VarLenFeatureProto} - */ -public final class VarLenFeatureProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VarLenFeatureProto) - VarLenFeatureProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use VarLenFeatureProto.newBuilder() to construct. - private VarLenFeatureProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VarLenFeatureProto() { - dtype_ = 0; - valuesOutputTensorName_ = ""; - indicesOutputTensorName_ = ""; - shapesOutputTensorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VarLenFeatureProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VarLenFeatureProto( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - valuesOutputTensorName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - indicesOutputTensorName_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - shapesOutputTensorName_ = s; - 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.example.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.VarLenFeatureProto.class, org.tensorflow.proto.example.VarLenFeatureProto.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object valuesOutputTensorName_; - /** - * string values_output_tensor_name = 2; - */ - public java.lang.String getValuesOutputTensorName() { - java.lang.Object ref = valuesOutputTensorName_; - 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(); - valuesOutputTensorName_ = s; - return s; - } - } - /** - * string values_output_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getValuesOutputTensorNameBytes() { - java.lang.Object ref = valuesOutputTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INDICES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object indicesOutputTensorName_; - /** - * string indices_output_tensor_name = 3; - */ - public java.lang.String getIndicesOutputTensorName() { - java.lang.Object ref = indicesOutputTensorName_; - 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(); - indicesOutputTensorName_ = s; - return s; - } - } - /** - * string indices_output_tensor_name = 3; - */ - public com.google.protobuf.ByteString - getIndicesOutputTensorNameBytes() { - java.lang.Object ref = indicesOutputTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - indicesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SHAPES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object shapesOutputTensorName_; - /** - * string shapes_output_tensor_name = 4; - */ - public java.lang.String getShapesOutputTensorName() { - java.lang.Object ref = shapesOutputTensorName_; - 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(); - shapesOutputTensorName_ = s; - return s; - } - } - /** - * string shapes_output_tensor_name = 4; - */ - public com.google.protobuf.ByteString - getShapesOutputTensorNameBytes() { - java.lang.Object ref = shapesOutputTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - shapesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (!getValuesOutputTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, valuesOutputTensorName_); - } - if (!getIndicesOutputTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, indicesOutputTensorName_); - } - if (!getShapesOutputTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, shapesOutputTensorName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (!getValuesOutputTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valuesOutputTensorName_); - } - if (!getIndicesOutputTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, indicesOutputTensorName_); - } - if (!getShapesOutputTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, shapesOutputTensorName_); - } - 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.example.VarLenFeatureProto)) { - return super.equals(obj); - } - org.tensorflow.proto.example.VarLenFeatureProto other = (org.tensorflow.proto.example.VarLenFeatureProto) obj; - - if (dtype_ != other.dtype_) return false; - if (!getValuesOutputTensorName() - .equals(other.getValuesOutputTensorName())) return false; - if (!getIndicesOutputTensorName() - .equals(other.getIndicesOutputTensorName())) return false; - if (!getShapesOutputTensorName() - .equals(other.getShapesOutputTensorName())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (37 * hash) + VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getValuesOutputTensorName().hashCode(); - hash = (37 * hash) + INDICES_OUTPUT_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getIndicesOutputTensorName().hashCode(); - hash = (37 * hash) + SHAPES_OUTPUT_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getShapesOutputTensorName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.example.VarLenFeatureProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.VarLenFeatureProto 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.example.VarLenFeatureProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.VarLenFeatureProto 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.example.VarLenFeatureProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.example.VarLenFeatureProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.example.VarLenFeatureProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.VarLenFeatureProto 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.example.VarLenFeatureProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.VarLenFeatureProto 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.example.VarLenFeatureProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.example.VarLenFeatureProto 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.example.VarLenFeatureProto 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.VarLenFeatureProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VarLenFeatureProto) - org.tensorflow.proto.example.VarLenFeatureProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.example.VarLenFeatureProto.class, org.tensorflow.proto.example.VarLenFeatureProto.Builder.class); - } - - // Construct using org.tensorflow.proto.example.VarLenFeatureProto.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(); - dtype_ = 0; - - valuesOutputTensorName_ = ""; - - indicesOutputTensorName_ = ""; - - shapesOutputTensorName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.example.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.example.VarLenFeatureProto getDefaultInstanceForType() { - return org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.example.VarLenFeatureProto build() { - org.tensorflow.proto.example.VarLenFeatureProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.example.VarLenFeatureProto buildPartial() { - org.tensorflow.proto.example.VarLenFeatureProto result = new org.tensorflow.proto.example.VarLenFeatureProto(this); - result.dtype_ = dtype_; - result.valuesOutputTensorName_ = valuesOutputTensorName_; - result.indicesOutputTensorName_ = indicesOutputTensorName_; - result.shapesOutputTensorName_ = shapesOutputTensorName_; - 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.example.VarLenFeatureProto) { - return mergeFrom((org.tensorflow.proto.example.VarLenFeatureProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.example.VarLenFeatureProto other) { - if (other == org.tensorflow.proto.example.VarLenFeatureProto.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (!other.getValuesOutputTensorName().isEmpty()) { - valuesOutputTensorName_ = other.valuesOutputTensorName_; - onChanged(); - } - if (!other.getIndicesOutputTensorName().isEmpty()) { - indicesOutputTensorName_ = other.indicesOutputTensorName_; - onChanged(); - } - if (!other.getShapesOutputTensorName().isEmpty()) { - shapesOutputTensorName_ = other.shapesOutputTensorName_; - onChanged(); - } - 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.example.VarLenFeatureProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.example.VarLenFeatureProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private java.lang.Object valuesOutputTensorName_ = ""; - /** - * string values_output_tensor_name = 2; - */ - public java.lang.String getValuesOutputTensorName() { - java.lang.Object ref = valuesOutputTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - valuesOutputTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string values_output_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getValuesOutputTensorNameBytes() { - java.lang.Object ref = valuesOutputTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string values_output_tensor_name = 2; - */ - public Builder setValuesOutputTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - valuesOutputTensorName_ = value; - onChanged(); - return this; - } - /** - * string values_output_tensor_name = 2; - */ - public Builder clearValuesOutputTensorName() { - - valuesOutputTensorName_ = getDefaultInstance().getValuesOutputTensorName(); - onChanged(); - return this; - } - /** - * string values_output_tensor_name = 2; - */ - public Builder setValuesOutputTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - valuesOutputTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object indicesOutputTensorName_ = ""; - /** - * string indices_output_tensor_name = 3; - */ - public java.lang.String getIndicesOutputTensorName() { - java.lang.Object ref = indicesOutputTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - indicesOutputTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string indices_output_tensor_name = 3; - */ - public com.google.protobuf.ByteString - getIndicesOutputTensorNameBytes() { - java.lang.Object ref = indicesOutputTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - indicesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string indices_output_tensor_name = 3; - */ - public Builder setIndicesOutputTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - indicesOutputTensorName_ = value; - onChanged(); - return this; - } - /** - * string indices_output_tensor_name = 3; - */ - public Builder clearIndicesOutputTensorName() { - - indicesOutputTensorName_ = getDefaultInstance().getIndicesOutputTensorName(); - onChanged(); - return this; - } - /** - * string indices_output_tensor_name = 3; - */ - public Builder setIndicesOutputTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - indicesOutputTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object shapesOutputTensorName_ = ""; - /** - * string shapes_output_tensor_name = 4; - */ - public java.lang.String getShapesOutputTensorName() { - java.lang.Object ref = shapesOutputTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - shapesOutputTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string shapes_output_tensor_name = 4; - */ - public com.google.protobuf.ByteString - getShapesOutputTensorNameBytes() { - java.lang.Object ref = shapesOutputTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - shapesOutputTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string shapes_output_tensor_name = 4; - */ - public Builder setShapesOutputTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - shapesOutputTensorName_ = value; - onChanged(); - return this; - } - /** - * string shapes_output_tensor_name = 4; - */ - public Builder clearShapesOutputTensorName() { - - shapesOutputTensorName_ = getDefaultInstance().getShapesOutputTensorName(); - onChanged(); - return this; - } - /** - * string shapes_output_tensor_name = 4; - */ - public Builder setShapesOutputTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - shapesOutputTensorName_ = value; - 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.VarLenFeatureProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VarLenFeatureProto) - private static final org.tensorflow.proto.example.VarLenFeatureProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.example.VarLenFeatureProto(); - } - - public static org.tensorflow.proto.example.VarLenFeatureProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VarLenFeatureProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VarLenFeatureProto(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.example.VarLenFeatureProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProtoOrBuilder.java deleted file mode 100644 index 820c2faa8f8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/VarLenFeatureProtoOrBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/example/example_parser_configuration.proto - -package org.tensorflow.proto.example; - -public interface VarLenFeatureProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.VarLenFeatureProto) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * string values_output_tensor_name = 2; - */ - java.lang.String getValuesOutputTensorName(); - /** - * string values_output_tensor_name = 2; - */ - com.google.protobuf.ByteString - getValuesOutputTensorNameBytes(); - - /** - * string indices_output_tensor_name = 3; - */ - java.lang.String getIndicesOutputTensorName(); - /** - * string indices_output_tensor_name = 3; - */ - com.google.protobuf.ByteString - getIndicesOutputTensorNameBytes(); - - /** - * string shapes_output_tensor_name = 4; - */ - java.lang.String getShapesOutputTensorName(); - /** - * string shapes_output_tensor_name = 4; - */ - com.google.protobuf.ByteString - getShapesOutputTensorNameBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescription.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescription.java deleted file mode 100644 index 2abffe7549a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescription.java +++ /dev/null @@ -1,944 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/allocation_description.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.AllocationDescription} - */ -public final class AllocationDescription extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AllocationDescription) - AllocationDescriptionOrBuilder { -private static final long serialVersionUID = 0L; - // Use AllocationDescription.newBuilder() to construct. - private AllocationDescription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AllocationDescription() { - allocatorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AllocationDescription(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AllocationDescription( - 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: { - - requestedBytes_ = input.readInt64(); - break; - } - case 16: { - - allocatedBytes_ = input.readInt64(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - allocatorName_ = s; - break; - } - case 32: { - - allocationId_ = input.readInt64(); - break; - } - case 40: { - - hasSingleReference_ = input.readBool(); - break; - } - case 48: { - - ptr_ = 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 { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocationDescription.class, org.tensorflow.proto.framework.AllocationDescription.Builder.class); - } - - public static final int REQUESTED_BYTES_FIELD_NUMBER = 1; - private long requestedBytes_; - /** - *
    -   * Total number of bytes requested
    -   * 
    - * - * int64 requested_bytes = 1; - */ - public long getRequestedBytes() { - return requestedBytes_; - } - - public static final int ALLOCATED_BYTES_FIELD_NUMBER = 2; - private long allocatedBytes_; - /** - *
    -   * Total number of bytes allocated if known
    -   * 
    - * - * int64 allocated_bytes = 2; - */ - public long getAllocatedBytes() { - return allocatedBytes_; - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object allocatorName_; - /** - *
    -   * Name of the allocator used
    -   * 
    - * - * string allocator_name = 3; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - *
    -   * Name of the allocator used
    -   * 
    - * - * string allocator_name = 3; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALLOCATION_ID_FIELD_NUMBER = 4; - private long allocationId_; - /** - *
    -   * Identifier of the allocated buffer if known
    -   * 
    - * - * int64 allocation_id = 4; - */ - public long getAllocationId() { - return allocationId_; - } - - public static final int HAS_SINGLE_REFERENCE_FIELD_NUMBER = 5; - private boolean hasSingleReference_; - /** - *
    -   * Set if this tensor only has one remaining reference
    -   * 
    - * - * bool has_single_reference = 5; - */ - public boolean getHasSingleReference() { - return hasSingleReference_; - } - - public static final int PTR_FIELD_NUMBER = 6; - private long ptr_; - /** - *
    -   * Address of the allocation.
    -   * 
    - * - * uint64 ptr = 6; - */ - public long getPtr() { - return ptr_; - } - - 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 (requestedBytes_ != 0L) { - output.writeInt64(1, requestedBytes_); - } - if (allocatedBytes_ != 0L) { - output.writeInt64(2, allocatedBytes_); - } - if (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, allocatorName_); - } - if (allocationId_ != 0L) { - output.writeInt64(4, allocationId_); - } - if (hasSingleReference_ != false) { - output.writeBool(5, hasSingleReference_); - } - if (ptr_ != 0L) { - output.writeUInt64(6, ptr_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (requestedBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, requestedBytes_); - } - if (allocatedBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, allocatedBytes_); - } - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, allocatorName_); - } - if (allocationId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, allocationId_); - } - if (hasSingleReference_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, hasSingleReference_); - } - if (ptr_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, ptr_); - } - 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.AllocationDescription)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AllocationDescription other = (org.tensorflow.proto.framework.AllocationDescription) obj; - - if (getRequestedBytes() - != other.getRequestedBytes()) return false; - if (getAllocatedBytes() - != other.getAllocatedBytes()) return false; - if (!getAllocatorName() - .equals(other.getAllocatorName())) return false; - if (getAllocationId() - != other.getAllocationId()) return false; - if (getHasSingleReference() - != other.getHasSingleReference()) return false; - if (getPtr() - != other.getPtr()) 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) + REQUESTED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRequestedBytes()); - hash = (37 * hash) + ALLOCATED_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocatedBytes()); - hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocationId()); - hash = (37 * hash) + HAS_SINGLE_REFERENCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getHasSingleReference()); - hash = (37 * hash) + PTR_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPtr()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AllocationDescription parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationDescription 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.AllocationDescription parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationDescription 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.AllocationDescription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationDescription parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AllocationDescription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationDescription 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.AllocationDescription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationDescription 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.AllocationDescription parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationDescription 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.AllocationDescription 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.AllocationDescription} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AllocationDescription) - org.tensorflow.proto.framework.AllocationDescriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocationDescription.class, org.tensorflow.proto.framework.AllocationDescription.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AllocationDescription.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(); - requestedBytes_ = 0L; - - allocatedBytes_ = 0L; - - allocatorName_ = ""; - - allocationId_ = 0L; - - hasSingleReference_ = false; - - ptr_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationDescription getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationDescription build() { - org.tensorflow.proto.framework.AllocationDescription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationDescription buildPartial() { - org.tensorflow.proto.framework.AllocationDescription result = new org.tensorflow.proto.framework.AllocationDescription(this); - result.requestedBytes_ = requestedBytes_; - result.allocatedBytes_ = allocatedBytes_; - result.allocatorName_ = allocatorName_; - result.allocationId_ = allocationId_; - result.hasSingleReference_ = hasSingleReference_; - result.ptr_ = ptr_; - 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.AllocationDescription) { - return mergeFrom((org.tensorflow.proto.framework.AllocationDescription)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AllocationDescription other) { - if (other == org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance()) return this; - if (other.getRequestedBytes() != 0L) { - setRequestedBytes(other.getRequestedBytes()); - } - if (other.getAllocatedBytes() != 0L) { - setAllocatedBytes(other.getAllocatedBytes()); - } - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - if (other.getAllocationId() != 0L) { - setAllocationId(other.getAllocationId()); - } - if (other.getHasSingleReference() != false) { - setHasSingleReference(other.getHasSingleReference()); - } - if (other.getPtr() != 0L) { - setPtr(other.getPtr()); - } - 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.AllocationDescription parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AllocationDescription) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long requestedBytes_ ; - /** - *
    -     * Total number of bytes requested
    -     * 
    - * - * int64 requested_bytes = 1; - */ - public long getRequestedBytes() { - return requestedBytes_; - } - /** - *
    -     * Total number of bytes requested
    -     * 
    - * - * int64 requested_bytes = 1; - */ - public Builder setRequestedBytes(long value) { - - requestedBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Total number of bytes requested
    -     * 
    - * - * int64 requested_bytes = 1; - */ - public Builder clearRequestedBytes() { - - requestedBytes_ = 0L; - onChanged(); - return this; - } - - private long allocatedBytes_ ; - /** - *
    -     * Total number of bytes allocated if known
    -     * 
    - * - * int64 allocated_bytes = 2; - */ - public long getAllocatedBytes() { - return allocatedBytes_; - } - /** - *
    -     * Total number of bytes allocated if known
    -     * 
    - * - * int64 allocated_bytes = 2; - */ - public Builder setAllocatedBytes(long value) { - - allocatedBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Total number of bytes allocated if known
    -     * 
    - * - * int64 allocated_bytes = 2; - */ - public Builder clearAllocatedBytes() { - - allocatedBytes_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object allocatorName_ = ""; - /** - *
    -     * Name of the allocator used
    -     * 
    - * - * string allocator_name = 3; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the allocator used
    -     * 
    - * - * string allocator_name = 3; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the allocator used
    -     * 
    - * - * string allocator_name = 3; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used
    -     * 
    - * - * string allocator_name = 3; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used
    -     * 
    - * - * string allocator_name = 3; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - onChanged(); - return this; - } - - private long allocationId_ ; - /** - *
    -     * Identifier of the allocated buffer if known
    -     * 
    - * - * int64 allocation_id = 4; - */ - public long getAllocationId() { - return allocationId_; - } - /** - *
    -     * Identifier of the allocated buffer if known
    -     * 
    - * - * int64 allocation_id = 4; - */ - public Builder setAllocationId(long value) { - - allocationId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Identifier of the allocated buffer if known
    -     * 
    - * - * int64 allocation_id = 4; - */ - public Builder clearAllocationId() { - - allocationId_ = 0L; - onChanged(); - return this; - } - - private boolean hasSingleReference_ ; - /** - *
    -     * Set if this tensor only has one remaining reference
    -     * 
    - * - * bool has_single_reference = 5; - */ - public boolean getHasSingleReference() { - return hasSingleReference_; - } - /** - *
    -     * Set if this tensor only has one remaining reference
    -     * 
    - * - * bool has_single_reference = 5; - */ - public Builder setHasSingleReference(boolean value) { - - hasSingleReference_ = value; - onChanged(); - return this; - } - /** - *
    -     * Set if this tensor only has one remaining reference
    -     * 
    - * - * bool has_single_reference = 5; - */ - public Builder clearHasSingleReference() { - - hasSingleReference_ = false; - onChanged(); - return this; - } - - private long ptr_ ; - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 6; - */ - public long getPtr() { - return ptr_; - } - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 6; - */ - public Builder setPtr(long value) { - - ptr_ = value; - onChanged(); - return this; - } - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 6; - */ - public Builder clearPtr() { - - ptr_ = 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.AllocationDescription) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AllocationDescription) - private static final org.tensorflow.proto.framework.AllocationDescription DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AllocationDescription(); - } - - public static org.tensorflow.proto.framework.AllocationDescription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AllocationDescription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AllocationDescription(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.AllocationDescription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionProtos.java deleted file mode 100644 index f3af7b380fc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionProtos.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/allocation_description.proto - -package org.tensorflow.proto.framework; - -public final class AllocationDescriptionProtos { - private AllocationDescriptionProtos() {} - 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_AllocationDescription_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AllocationDescription_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n6tensorflow/core/framework/allocation_d" + - "escription.proto\022\ntensorflow\"\243\001\n\025Allocat" + - "ionDescription\022\027\n\017requested_bytes\030\001 \001(\003\022" + - "\027\n\017allocated_bytes\030\002 \001(\003\022\026\n\016allocator_na" + - "me\030\003 \001(\t\022\025\n\rallocation_id\030\004 \001(\003\022\034\n\024has_s" + - "ingle_reference\030\005 \001(\010\022\013\n\003ptr\030\006 \001(\004B\241\001\n\036o" + - "rg.tensorflow.proto.frameworkB\033Allocatio" + - "nDescriptionProtosP\001Z]github.com/tensorf" + - "low/tensorflow/tensorflow/go/core/framew" + - "ork/allocation_description_go_proto\370\001\001b\006" + - "proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_AllocationDescription_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_AllocationDescription_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AllocationDescription_descriptor, - new java.lang.String[] { "RequestedBytes", "AllocatedBytes", "AllocatorName", "AllocationId", "HasSingleReference", "Ptr", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecord.java deleted file mode 100644 index 738f1117fbe..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecord.java +++ /dev/null @@ -1,575 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * An allocation/de-allocation operation performed by the allocator.
    - * 
    - * - * Protobuf type {@code tensorflow.AllocationRecord} - */ -public final class AllocationRecord extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AllocationRecord) - AllocationRecordOrBuilder { -private static final long serialVersionUID = 0L; - // Use AllocationRecord.newBuilder() to construct. - private AllocationRecord(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AllocationRecord() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AllocationRecord(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AllocationRecord( - 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: { - - allocMicros_ = input.readInt64(); - break; - } - case 16: { - - allocBytes_ = 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.framework.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocationRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocationRecord.class, org.tensorflow.proto.framework.AllocationRecord.Builder.class); - } - - public static final int ALLOC_MICROS_FIELD_NUMBER = 1; - private long allocMicros_; - /** - *
    -   * The timestamp of the operation.
    -   * 
    - * - * int64 alloc_micros = 1; - */ - public long getAllocMicros() { - return allocMicros_; - } - - public static final int ALLOC_BYTES_FIELD_NUMBER = 2; - private long allocBytes_; - /** - *
    -   * Number of bytes allocated, or de-allocated if negative.
    -   * 
    - * - * int64 alloc_bytes = 2; - */ - public long getAllocBytes() { - return allocBytes_; - } - - 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 (allocMicros_ != 0L) { - output.writeInt64(1, allocMicros_); - } - if (allocBytes_ != 0L) { - output.writeInt64(2, allocBytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (allocMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, allocMicros_); - } - if (allocBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, allocBytes_); - } - 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.AllocationRecord)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AllocationRecord other = (org.tensorflow.proto.framework.AllocationRecord) obj; - - if (getAllocMicros() - != other.getAllocMicros()) return false; - if (getAllocBytes() - != other.getAllocBytes()) 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) + ALLOC_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocMicros()); - hash = (37 * hash) + ALLOC_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocBytes()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AllocationRecord parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationRecord 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.AllocationRecord parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationRecord 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.AllocationRecord parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocationRecord parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AllocationRecord parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationRecord 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.AllocationRecord parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationRecord 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.AllocationRecord parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocationRecord 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.AllocationRecord 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; - } - /** - *
    -   * An allocation/de-allocation operation performed by the allocator.
    -   * 
    - * - * Protobuf type {@code tensorflow.AllocationRecord} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AllocationRecord) - org.tensorflow.proto.framework.AllocationRecordOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocationRecord_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocationRecord.class, org.tensorflow.proto.framework.AllocationRecord.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AllocationRecord.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(); - allocMicros_ = 0L; - - allocBytes_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationRecord getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationRecord build() { - org.tensorflow.proto.framework.AllocationRecord result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocationRecord buildPartial() { - org.tensorflow.proto.framework.AllocationRecord result = new org.tensorflow.proto.framework.AllocationRecord(this); - result.allocMicros_ = allocMicros_; - result.allocBytes_ = allocBytes_; - 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.AllocationRecord) { - return mergeFrom((org.tensorflow.proto.framework.AllocationRecord)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AllocationRecord other) { - if (other == org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance()) return this; - if (other.getAllocMicros() != 0L) { - setAllocMicros(other.getAllocMicros()); - } - if (other.getAllocBytes() != 0L) { - setAllocBytes(other.getAllocBytes()); - } - 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.AllocationRecord parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AllocationRecord) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long allocMicros_ ; - /** - *
    -     * The timestamp of the operation.
    -     * 
    - * - * int64 alloc_micros = 1; - */ - public long getAllocMicros() { - return allocMicros_; - } - /** - *
    -     * The timestamp of the operation.
    -     * 
    - * - * int64 alloc_micros = 1; - */ - public Builder setAllocMicros(long value) { - - allocMicros_ = value; - onChanged(); - return this; - } - /** - *
    -     * The timestamp of the operation.
    -     * 
    - * - * int64 alloc_micros = 1; - */ - public Builder clearAllocMicros() { - - allocMicros_ = 0L; - onChanged(); - return this; - } - - private long allocBytes_ ; - /** - *
    -     * Number of bytes allocated, or de-allocated if negative.
    -     * 
    - * - * int64 alloc_bytes = 2; - */ - public long getAllocBytes() { - return allocBytes_; - } - /** - *
    -     * Number of bytes allocated, or de-allocated if negative.
    -     * 
    - * - * int64 alloc_bytes = 2; - */ - public Builder setAllocBytes(long value) { - - allocBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of bytes allocated, or de-allocated if negative.
    -     * 
    - * - * int64 alloc_bytes = 2; - */ - public Builder clearAllocBytes() { - - allocBytes_ = 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.AllocationRecord) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AllocationRecord) - private static final org.tensorflow.proto.framework.AllocationRecord DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AllocationRecord(); - } - - public static org.tensorflow.proto.framework.AllocationRecord getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AllocationRecord parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AllocationRecord(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.AllocationRecord getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsed.java deleted file mode 100644 index 3cb33266367..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsed.java +++ /dev/null @@ -1,1268 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.AllocatorMemoryUsed} - */ -public final class AllocatorMemoryUsed extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AllocatorMemoryUsed) - AllocatorMemoryUsedOrBuilder { -private static final long serialVersionUID = 0L; - // Use AllocatorMemoryUsed.newBuilder() to construct. - private AllocatorMemoryUsed(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AllocatorMemoryUsed() { - allocatorName_ = ""; - allocationRecords_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AllocatorMemoryUsed(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AllocatorMemoryUsed( - 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(); - - allocatorName_ = s; - break; - } - case 16: { - - totalBytes_ = input.readInt64(); - break; - } - case 24: { - - peakBytes_ = input.readInt64(); - break; - } - case 32: { - - liveBytes_ = input.readInt64(); - break; - } - case 40: { - - allocatorBytesInUse_ = input.readInt64(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - allocationRecords_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - allocationRecords_.add( - input.readMessage(org.tensorflow.proto.framework.AllocationRecord.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_ & 0x00000001) != 0)) { - allocationRecords_ = java.util.Collections.unmodifiableList(allocationRecords_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocatorMemoryUsed.class, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder.class); - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object allocatorName_; - /** - * string allocator_name = 1; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - * string allocator_name = 1; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TOTAL_BYTES_FIELD_NUMBER = 2; - private long totalBytes_; - /** - *
    -   * These are per-node allocator memory stats.
    -   * 
    - * - * int64 total_bytes = 2; - */ - public long getTotalBytes() { - return totalBytes_; - } - - public static final int PEAK_BYTES_FIELD_NUMBER = 3; - private long peakBytes_; - /** - * int64 peak_bytes = 3; - */ - public long getPeakBytes() { - return peakBytes_; - } - - public static final int LIVE_BYTES_FIELD_NUMBER = 4; - private long liveBytes_; - /** - *
    -   * The bytes that are not deallocated.
    -   * 
    - * - * int64 live_bytes = 4; - */ - public long getLiveBytes() { - return liveBytes_; - } - - public static final int ALLOCATION_RECORDS_FIELD_NUMBER = 6; - private java.util.List allocationRecords_; - /** - *
    -   * The allocation and deallocation timeline.
    -   * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public java.util.List getAllocationRecordsList() { - return allocationRecords_; - } - /** - *
    -   * The allocation and deallocation timeline.
    -   * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public java.util.List - getAllocationRecordsOrBuilderList() { - return allocationRecords_; - } - /** - *
    -   * The allocation and deallocation timeline.
    -   * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public int getAllocationRecordsCount() { - return allocationRecords_.size(); - } - /** - *
    -   * The allocation and deallocation timeline.
    -   * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecord getAllocationRecords(int index) { - return allocationRecords_.get(index); - } - /** - *
    -   * The allocation and deallocation timeline.
    -   * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrBuilder( - int index) { - return allocationRecords_.get(index); - } - - public static final int ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER = 5; - private long allocatorBytesInUse_; - /** - *
    -   * These are snapshots of the overall allocator memory stats.
    -   * The number of live bytes currently allocated by the allocator.
    -   * 
    - * - * int64 allocator_bytes_in_use = 5; - */ - public long getAllocatorBytesInUse() { - return allocatorBytesInUse_; - } - - 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 (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allocatorName_); - } - if (totalBytes_ != 0L) { - output.writeInt64(2, totalBytes_); - } - if (peakBytes_ != 0L) { - output.writeInt64(3, peakBytes_); - } - if (liveBytes_ != 0L) { - output.writeInt64(4, liveBytes_); - } - if (allocatorBytesInUse_ != 0L) { - output.writeInt64(5, allocatorBytesInUse_); - } - for (int i = 0; i < allocationRecords_.size(); i++) { - output.writeMessage(6, allocationRecords_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, allocatorName_); - } - if (totalBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, totalBytes_); - } - if (peakBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, peakBytes_); - } - if (liveBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, liveBytes_); - } - if (allocatorBytesInUse_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, allocatorBytesInUse_); - } - for (int i = 0; i < allocationRecords_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, allocationRecords_.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.AllocatorMemoryUsed)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AllocatorMemoryUsed other = (org.tensorflow.proto.framework.AllocatorMemoryUsed) obj; - - if (!getAllocatorName() - .equals(other.getAllocatorName())) return false; - if (getTotalBytes() - != other.getTotalBytes()) return false; - if (getPeakBytes() - != other.getPeakBytes()) return false; - if (getLiveBytes() - != other.getLiveBytes()) return false; - if (!getAllocationRecordsList() - .equals(other.getAllocationRecordsList())) return false; - if (getAllocatorBytesInUse() - != other.getAllocatorBytesInUse()) 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) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - hash = (37 * hash) + TOTAL_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalBytes()); - hash = (37 * hash) + PEAK_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPeakBytes()); - hash = (37 * hash) + LIVE_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLiveBytes()); - if (getAllocationRecordsCount() > 0) { - hash = (37 * hash) + ALLOCATION_RECORDS_FIELD_NUMBER; - hash = (53 * hash) + getAllocationRecordsList().hashCode(); - } - hash = (37 * hash) + ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocatorBytesInUse()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AllocatorMemoryUsed parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AllocatorMemoryUsed 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.AllocatorMemoryUsed 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.AllocatorMemoryUsed} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AllocatorMemoryUsed) - org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AllocatorMemoryUsed.class, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AllocatorMemoryUsed.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAllocationRecordsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - allocatorName_ = ""; - - totalBytes_ = 0L; - - peakBytes_ = 0L; - - liveBytes_ = 0L; - - if (allocationRecordsBuilder_ == null) { - allocationRecords_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - allocationRecordsBuilder_.clear(); - } - allocatorBytesInUse_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocatorMemoryUsed getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AllocatorMemoryUsed.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocatorMemoryUsed build() { - org.tensorflow.proto.framework.AllocatorMemoryUsed result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AllocatorMemoryUsed buildPartial() { - org.tensorflow.proto.framework.AllocatorMemoryUsed result = new org.tensorflow.proto.framework.AllocatorMemoryUsed(this); - int from_bitField0_ = bitField0_; - result.allocatorName_ = allocatorName_; - result.totalBytes_ = totalBytes_; - result.peakBytes_ = peakBytes_; - result.liveBytes_ = liveBytes_; - if (allocationRecordsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - allocationRecords_ = java.util.Collections.unmodifiableList(allocationRecords_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.allocationRecords_ = allocationRecords_; - } else { - result.allocationRecords_ = allocationRecordsBuilder_.build(); - } - result.allocatorBytesInUse_ = allocatorBytesInUse_; - 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.AllocatorMemoryUsed) { - return mergeFrom((org.tensorflow.proto.framework.AllocatorMemoryUsed)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AllocatorMemoryUsed other) { - if (other == org.tensorflow.proto.framework.AllocatorMemoryUsed.getDefaultInstance()) return this; - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - if (other.getTotalBytes() != 0L) { - setTotalBytes(other.getTotalBytes()); - } - if (other.getPeakBytes() != 0L) { - setPeakBytes(other.getPeakBytes()); - } - if (other.getLiveBytes() != 0L) { - setLiveBytes(other.getLiveBytes()); - } - if (allocationRecordsBuilder_ == null) { - if (!other.allocationRecords_.isEmpty()) { - if (allocationRecords_.isEmpty()) { - allocationRecords_ = other.allocationRecords_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAllocationRecordsIsMutable(); - allocationRecords_.addAll(other.allocationRecords_); - } - onChanged(); - } - } else { - if (!other.allocationRecords_.isEmpty()) { - if (allocationRecordsBuilder_.isEmpty()) { - allocationRecordsBuilder_.dispose(); - allocationRecordsBuilder_ = null; - allocationRecords_ = other.allocationRecords_; - bitField0_ = (bitField0_ & ~0x00000001); - allocationRecordsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAllocationRecordsFieldBuilder() : null; - } else { - allocationRecordsBuilder_.addAllMessages(other.allocationRecords_); - } - } - } - if (other.getAllocatorBytesInUse() != 0L) { - setAllocatorBytesInUse(other.getAllocatorBytesInUse()); - } - 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.AllocatorMemoryUsed parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AllocatorMemoryUsed) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object allocatorName_ = ""; - /** - * string allocator_name = 1; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string allocator_name = 1; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string allocator_name = 1; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - * string allocator_name = 1; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - * string allocator_name = 1; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - onChanged(); - return this; - } - - private long totalBytes_ ; - /** - *
    -     * These are per-node allocator memory stats.
    -     * 
    - * - * int64 total_bytes = 2; - */ - public long getTotalBytes() { - return totalBytes_; - } - /** - *
    -     * These are per-node allocator memory stats.
    -     * 
    - * - * int64 total_bytes = 2; - */ - public Builder setTotalBytes(long value) { - - totalBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * These are per-node allocator memory stats.
    -     * 
    - * - * int64 total_bytes = 2; - */ - public Builder clearTotalBytes() { - - totalBytes_ = 0L; - onChanged(); - return this; - } - - private long peakBytes_ ; - /** - * int64 peak_bytes = 3; - */ - public long getPeakBytes() { - return peakBytes_; - } - /** - * int64 peak_bytes = 3; - */ - public Builder setPeakBytes(long value) { - - peakBytes_ = value; - onChanged(); - return this; - } - /** - * int64 peak_bytes = 3; - */ - public Builder clearPeakBytes() { - - peakBytes_ = 0L; - onChanged(); - return this; - } - - private long liveBytes_ ; - /** - *
    -     * The bytes that are not deallocated.
    -     * 
    - * - * int64 live_bytes = 4; - */ - public long getLiveBytes() { - return liveBytes_; - } - /** - *
    -     * The bytes that are not deallocated.
    -     * 
    - * - * int64 live_bytes = 4; - */ - public Builder setLiveBytes(long value) { - - liveBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * The bytes that are not deallocated.
    -     * 
    - * - * int64 live_bytes = 4; - */ - public Builder clearLiveBytes() { - - liveBytes_ = 0L; - onChanged(); - return this; - } - - private java.util.List allocationRecords_ = - java.util.Collections.emptyList(); - private void ensureAllocationRecordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - allocationRecords_ = new java.util.ArrayList(allocationRecords_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder> allocationRecordsBuilder_; - - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public java.util.List getAllocationRecordsList() { - if (allocationRecordsBuilder_ == null) { - return java.util.Collections.unmodifiableList(allocationRecords_); - } else { - return allocationRecordsBuilder_.getMessageList(); - } - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public int getAllocationRecordsCount() { - if (allocationRecordsBuilder_ == null) { - return allocationRecords_.size(); - } else { - return allocationRecordsBuilder_.getCount(); - } - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecord getAllocationRecords(int index) { - if (allocationRecordsBuilder_ == null) { - return allocationRecords_.get(index); - } else { - return allocationRecordsBuilder_.getMessage(index); - } - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder setAllocationRecords( - int index, org.tensorflow.proto.framework.AllocationRecord value) { - if (allocationRecordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAllocationRecordsIsMutable(); - allocationRecords_.set(index, value); - onChanged(); - } else { - allocationRecordsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder setAllocationRecords( - int index, org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) { - if (allocationRecordsBuilder_ == null) { - ensureAllocationRecordsIsMutable(); - allocationRecords_.set(index, builderForValue.build()); - onChanged(); - } else { - allocationRecordsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder addAllocationRecords(org.tensorflow.proto.framework.AllocationRecord value) { - if (allocationRecordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAllocationRecordsIsMutable(); - allocationRecords_.add(value); - onChanged(); - } else { - allocationRecordsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder addAllocationRecords( - int index, org.tensorflow.proto.framework.AllocationRecord value) { - if (allocationRecordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAllocationRecordsIsMutable(); - allocationRecords_.add(index, value); - onChanged(); - } else { - allocationRecordsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder addAllocationRecords( - org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) { - if (allocationRecordsBuilder_ == null) { - ensureAllocationRecordsIsMutable(); - allocationRecords_.add(builderForValue.build()); - onChanged(); - } else { - allocationRecordsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder addAllocationRecords( - int index, org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) { - if (allocationRecordsBuilder_ == null) { - ensureAllocationRecordsIsMutable(); - allocationRecords_.add(index, builderForValue.build()); - onChanged(); - } else { - allocationRecordsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder addAllAllocationRecords( - java.lang.Iterable values) { - if (allocationRecordsBuilder_ == null) { - ensureAllocationRecordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, allocationRecords_); - onChanged(); - } else { - allocationRecordsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder clearAllocationRecords() { - if (allocationRecordsBuilder_ == null) { - allocationRecords_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - allocationRecordsBuilder_.clear(); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public Builder removeAllocationRecords(int index) { - if (allocationRecordsBuilder_ == null) { - ensureAllocationRecordsIsMutable(); - allocationRecords_.remove(index); - onChanged(); - } else { - allocationRecordsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecord.Builder getAllocationRecordsBuilder( - int index) { - return getAllocationRecordsFieldBuilder().getBuilder(index); - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrBuilder( - int index) { - if (allocationRecordsBuilder_ == null) { - return allocationRecords_.get(index); } else { - return allocationRecordsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public java.util.List - getAllocationRecordsOrBuilderList() { - if (allocationRecordsBuilder_ != null) { - return allocationRecordsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(allocationRecords_); - } - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecord.Builder addAllocationRecordsBuilder() { - return getAllocationRecordsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance()); - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public org.tensorflow.proto.framework.AllocationRecord.Builder addAllocationRecordsBuilder( - int index) { - return getAllocationRecordsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance()); - } - /** - *
    -     * The allocation and deallocation timeline.
    -     * 
    - * - * repeated .tensorflow.AllocationRecord allocation_records = 6; - */ - public java.util.List - getAllocationRecordsBuilderList() { - return getAllocationRecordsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder> - getAllocationRecordsFieldBuilder() { - if (allocationRecordsBuilder_ == null) { - allocationRecordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder>( - allocationRecords_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - allocationRecords_ = null; - } - return allocationRecordsBuilder_; - } - - private long allocatorBytesInUse_ ; - /** - *
    -     * These are snapshots of the overall allocator memory stats.
    -     * The number of live bytes currently allocated by the allocator.
    -     * 
    - * - * int64 allocator_bytes_in_use = 5; - */ - public long getAllocatorBytesInUse() { - return allocatorBytesInUse_; - } - /** - *
    -     * These are snapshots of the overall allocator memory stats.
    -     * The number of live bytes currently allocated by the allocator.
    -     * 
    - * - * int64 allocator_bytes_in_use = 5; - */ - public Builder setAllocatorBytesInUse(long value) { - - allocatorBytesInUse_ = value; - onChanged(); - return this; - } - /** - *
    -     * These are snapshots of the overall allocator memory stats.
    -     * The number of live bytes currently allocated by the allocator.
    -     * 
    - * - * int64 allocator_bytes_in_use = 5; - */ - public Builder clearAllocatorBytesInUse() { - - allocatorBytesInUse_ = 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.AllocatorMemoryUsed) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AllocatorMemoryUsed) - private static final org.tensorflow.proto.framework.AllocatorMemoryUsed DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AllocatorMemoryUsed(); - } - - public static org.tensorflow.proto.framework.AllocatorMemoryUsed getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AllocatorMemoryUsed parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AllocatorMemoryUsed(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.AllocatorMemoryUsed getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDef.java deleted file mode 100644 index 99916fcf1f2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDef.java +++ /dev/null @@ -1,6303 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Used to specify and override the default API & behavior in the
    - * generated code for client languages, from what you would get from
    - * the OpDef alone. There will be a set of ApiDefs that are common
    - * to all client languages, and another set per client language.
    - * The per-client-language ApiDefs will inherit values from the
    - * common ApiDefs which it can either replace or modify.
    - * We separate the API definition from the OpDef so we can evolve the
    - * API while remaining backwards compatible when interpretting old
    - * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    - * ApiDefs message.
    - * WARNING: Be *very* careful changing the API for any existing op --
    - * you can change the semantics of existing code.  These changes may
    - * need to wait until a major release of TensorFlow to avoid breaking
    - * our compatibility promises.
    - * 
    - * - * Protobuf type {@code tensorflow.ApiDef} - */ -public final class ApiDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef) - ApiDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApiDef.newBuilder() to construct. - private ApiDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApiDef() { - graphOpName_ = ""; - deprecationMessage_ = ""; - visibility_ = 0; - endpoint_ = java.util.Collections.emptyList(); - inArg_ = java.util.Collections.emptyList(); - outArg_ = java.util.Collections.emptyList(); - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - attr_ = java.util.Collections.emptyList(); - summary_ = ""; - description_ = ""; - descriptionPrefix_ = ""; - descriptionSuffix_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApiDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApiDef( - 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(); - - graphOpName_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - visibility_ = rawValue; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - endpoint_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - endpoint_.add( - input.readMessage(org.tensorflow.proto.framework.ApiDef.Endpoint.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - inArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - inArg_.add( - input.readMessage(org.tensorflow.proto.framework.ApiDef.Arg.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - outArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - outArg_.add( - input.readMessage(org.tensorflow.proto.framework.ApiDef.Arg.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - attr_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - attr_.add( - input.readMessage(org.tensorflow.proto.framework.ApiDef.Attr.parser(), extensionRegistry)); - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - summary_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - - descriptionPrefix_ = s; - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - descriptionSuffix_ = s; - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - argOrder_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - argOrder_.add(s); - break; - } - case 98: { - java.lang.String s = input.readStringRequireUtf8(); - - deprecationMessage_ = s; - break; - } - case 104: { - - deprecationVersion_ = input.readInt32(); - 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)) { - endpoint_ = java.util.Collections.unmodifiableList(endpoint_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - inArg_ = java.util.Collections.unmodifiableList(inArg_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - outArg_ = java.util.Collections.unmodifiableList(outArg_); - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - argOrder_ = argOrder_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.class, org.tensorflow.proto.framework.ApiDef.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.ApiDef.Visibility} - */ - public enum Visibility - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * Normally this is "VISIBLE" unless you are inheriting a
    -     * different value from another ApiDef.
    -     * 
    - * - * DEFAULT_VISIBILITY = 0; - */ - DEFAULT_VISIBILITY(0), - /** - *
    -     * Publicly visible in the API.
    -     * 
    - * - * VISIBLE = 1; - */ - VISIBLE(1), - /** - *
    -     * Do not include this op in the generated API. If visibility is
    -     * set to 'SKIP', other fields are ignored for this op.
    -     * 
    - * - * SKIP = 2; - */ - SKIP(2), - /** - *
    -     * Hide this op by putting it into an internal namespace (or whatever
    -     * is appropriate in the target language).
    -     * 
    - * - * HIDDEN = 3; - */ - HIDDEN(3), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * Normally this is "VISIBLE" unless you are inheriting a
    -     * different value from another ApiDef.
    -     * 
    - * - * DEFAULT_VISIBILITY = 0; - */ - public static final int DEFAULT_VISIBILITY_VALUE = 0; - /** - *
    -     * Publicly visible in the API.
    -     * 
    - * - * VISIBLE = 1; - */ - public static final int VISIBLE_VALUE = 1; - /** - *
    -     * Do not include this op in the generated API. If visibility is
    -     * set to 'SKIP', other fields are ignored for this op.
    -     * 
    - * - * SKIP = 2; - */ - public static final int SKIP_VALUE = 2; - /** - *
    -     * Hide this op by putting it into an internal namespace (or whatever
    -     * is appropriate in the target language).
    -     * 
    - * - * HIDDEN = 3; - */ - public static final int HIDDEN_VALUE = 3; - - - 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 Visibility valueOf(int value) { - return forNumber(value); - } - - public static Visibility forNumber(int value) { - switch (value) { - case 0: return DEFAULT_VISIBILITY; - case 1: return VISIBLE; - case 2: return SKIP; - case 3: return HIDDEN; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Visibility> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Visibility findValueByNumber(int number) { - return Visibility.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.ApiDef.getDescriptor().getEnumTypes().get(0); - } - - private static final Visibility[] VALUES = values(); - - public static Visibility 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 Visibility(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.ApiDef.Visibility) - } - - public interface EndpointOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Endpoint) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Set if this endpoint is deprecated. If set to true, a message suggesting
    -     * to use a non-deprecated endpoint instead will be printed. If all
    -     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -     * 
    - * - * bool deprecated = 3; - */ - boolean getDeprecated(); - - /** - *
    -     * Major version when an endpoint will be deleted. For e.g. set this
    -     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 4; - */ - int getDeprecationVersion(); - } - /** - *
    -   * If you specify any endpoint, this will replace all of the
    -   * inherited endpoints.  The first endpoint should be the
    -   * "canonical" endpoint, and should not be deprecated (unless all
    -   * endpoints are deprecated).
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Endpoint} - */ - public static final class Endpoint extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Endpoint) - EndpointOrBuilder { - private static final long serialVersionUID = 0L; - // Use Endpoint.newBuilder() to construct. - private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Endpoint() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Endpoint(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Endpoint( - 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 24: { - - deprecated_ = input.readBool(); - break; - } - case 32: { - - deprecationVersion_ = input.readInt32(); - 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.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Endpoint.class, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * 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 DEPRECATED_FIELD_NUMBER = 3; - private boolean deprecated_; - /** - *
    -     * Set if this endpoint is deprecated. If set to true, a message suggesting
    -     * to use a non-deprecated endpoint instead will be printed. If all
    -     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -     * 
    - * - * bool deprecated = 3; - */ - public boolean getDeprecated() { - return deprecated_; - } - - public static final int DEPRECATION_VERSION_FIELD_NUMBER = 4; - private int deprecationVersion_; - /** - *
    -     * Major version when an endpoint will be deleted. For e.g. set this
    -     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 4; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - 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 (deprecated_ != false) { - output.writeBool(3, deprecated_); - } - if (deprecationVersion_ != 0) { - output.writeInt32(4, deprecationVersion_); - } - 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 (deprecated_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, deprecated_); - } - if (deprecationVersion_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, deprecationVersion_); - } - 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.ApiDef.Endpoint)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ApiDef.Endpoint other = (org.tensorflow.proto.framework.ApiDef.Endpoint) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getDeprecated() - != other.getDeprecated()) return false; - if (getDeprecationVersion() - != other.getDeprecationVersion()) 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) + DEPRECATED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDeprecated()); - hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationVersion(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ApiDef.Endpoint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint 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.ApiDef.Endpoint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint 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.ApiDef.Endpoint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint 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.ApiDef.Endpoint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint 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.ApiDef.Endpoint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Endpoint 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.ApiDef.Endpoint 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; - } - /** - *
    -     * If you specify any endpoint, this will replace all of the
    -     * inherited endpoints.  The first endpoint should be the
    -     * "canonical" endpoint, and should not be deprecated (unless all
    -     * endpoints are deprecated).
    -     * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Endpoint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Endpoint) - org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Endpoint.class, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Endpoint.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_ = ""; - - deprecated_ = false; - - deprecationVersion_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Endpoint getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ApiDef.Endpoint.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Endpoint build() { - org.tensorflow.proto.framework.ApiDef.Endpoint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Endpoint buildPartial() { - org.tensorflow.proto.framework.ApiDef.Endpoint result = new org.tensorflow.proto.framework.ApiDef.Endpoint(this); - result.name_ = name_; - result.deprecated_ = deprecated_; - result.deprecationVersion_ = deprecationVersion_; - 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.ApiDef.Endpoint) { - return mergeFrom((org.tensorflow.proto.framework.ApiDef.Endpoint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ApiDef.Endpoint other) { - if (other == org.tensorflow.proto.framework.ApiDef.Endpoint.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getDeprecated() != false) { - setDeprecated(other.getDeprecated()); - } - if (other.getDeprecationVersion() != 0) { - setDeprecationVersion(other.getDeprecationVersion()); - } - 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.ApiDef.Endpoint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ApiDef.Endpoint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * 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 boolean deprecated_ ; - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public boolean getDeprecated() { - return deprecated_; - } - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public Builder setDeprecated(boolean value) { - - deprecated_ = value; - onChanged(); - return this; - } - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public Builder clearDeprecated() { - - deprecated_ = false; - onChanged(); - return this; - } - - private int deprecationVersion_ ; - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public Builder setDeprecationVersion(int value) { - - deprecationVersion_ = value; - onChanged(); - return this; - } - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public Builder clearDeprecationVersion() { - - deprecationVersion_ = 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.ApiDef.Endpoint) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Endpoint) - private static final org.tensorflow.proto.framework.ApiDef.Endpoint DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ApiDef.Endpoint(); - } - - public static org.tensorflow.proto.framework.ApiDef.Endpoint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Endpoint parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Endpoint(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.ApiDef.Endpoint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ArgOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Arg) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - java.lang.String getRenameTo(); - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - com.google.protobuf.ByteString - getRenameToBytes(); - - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - java.lang.String getDescription(); - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - } - /** - * Protobuf type {@code tensorflow.ApiDef.Arg} - */ - public static final class Arg extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Arg) - ArgOrBuilder { - private static final long serialVersionUID = 0L; - // Use Arg.newBuilder() to construct. - private Arg(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Arg() { - name_ = ""; - renameTo_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Arg(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Arg( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - renameTo_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - 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.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Arg.class, org.tensorflow.proto.framework.ApiDef.Arg.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 RENAME_TO_FIELD_NUMBER = 2; - private volatile java.lang.Object renameTo_; - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public java.lang.String getRenameTo() { - java.lang.Object ref = renameTo_; - 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(); - renameTo_ = s; - return s; - } - } - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - java.lang.Object ref = renameTo_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getRenameToBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, renameTo_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - 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 (!getRenameToBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, renameTo_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - 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.ApiDef.Arg)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ApiDef.Arg other = (org.tensorflow.proto.framework.ApiDef.Arg) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getRenameTo() - .equals(other.getRenameTo())) return false; - if (!getDescription() - .equals(other.getDescription())) 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) + RENAME_TO_FIELD_NUMBER; - hash = (53 * hash) + getRenameTo().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ApiDef.Arg parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Arg 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.ApiDef.Arg parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Arg 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.ApiDef.Arg parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Arg parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ApiDef.Arg parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Arg 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.ApiDef.Arg parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Arg 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.ApiDef.Arg parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Arg 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.ApiDef.Arg 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.ApiDef.Arg} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Arg) - org.tensorflow.proto.framework.ApiDef.ArgOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Arg.class, org.tensorflow.proto.framework.ApiDef.Arg.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Arg.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_ = ""; - - renameTo_ = ""; - - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Arg getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Arg build() { - org.tensorflow.proto.framework.ApiDef.Arg result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Arg buildPartial() { - org.tensorflow.proto.framework.ApiDef.Arg result = new org.tensorflow.proto.framework.ApiDef.Arg(this); - result.name_ = name_; - result.renameTo_ = renameTo_; - result.description_ = description_; - 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.ApiDef.Arg) { - return mergeFrom((org.tensorflow.proto.framework.ApiDef.Arg)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ApiDef.Arg other) { - if (other == org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getRenameTo().isEmpty()) { - renameTo_ = other.renameTo_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - 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.ApiDef.Arg parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ApiDef.Arg) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 java.lang.Object renameTo_ = ""; - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public java.lang.String getRenameTo() { - java.lang.Object ref = renameTo_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - java.lang.Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameTo( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - renameTo_ = value; - onChanged(); - return this; - } - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder clearRenameTo() { - - renameTo_ = getDefaultInstance().getRenameTo(); - onChanged(); - return this; - } - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameToBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - renameTo_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - 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.ApiDef.Arg) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Arg) - private static final org.tensorflow.proto.framework.ApiDef.Arg DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ApiDef.Arg(); - } - - public static org.tensorflow.proto.framework.ApiDef.Arg getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Arg parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Arg(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.ApiDef.Arg getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AttrOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Attr) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - java.lang.String getRenameTo(); - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - com.google.protobuf.ByteString - getRenameToBytes(); - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - boolean hasDefaultValue(); - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - org.tensorflow.proto.framework.AttrValue getDefaultValue(); - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder(); - - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - java.lang.String getDescription(); - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - } - /** - *
    -   * Description of the graph-construction-time configuration of this
    -   * Op.  That is to say, this describes the attr fields that will
    -   * be specified in the NodeDef.
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Attr} - */ - public static final class Attr extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Attr) - AttrOrBuilder { - private static final long serialVersionUID = 0L; - // Use Attr.newBuilder() to construct. - private Attr(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Attr() { - name_ = ""; - renameTo_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Attr(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Attr( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - renameTo_ = s; - break; - } - case 26: { - org.tensorflow.proto.framework.AttrValue.Builder subBuilder = null; - if (defaultValue_ != null) { - subBuilder = defaultValue_.toBuilder(); - } - defaultValue_ = input.readMessage(org.tensorflow.proto.framework.AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultValue_); - defaultValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - 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.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Attr.class, org.tensorflow.proto.framework.ApiDef.Attr.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 RENAME_TO_FIELD_NUMBER = 2; - private volatile java.lang.Object renameTo_; - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public java.lang.String getRenameTo() { - java.lang.Object ref = renameTo_; - 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(); - renameTo_ = s; - return s; - } - } - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - java.lang.Object ref = renameTo_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.AttrValue defaultValue_; - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValue_ != null; - } - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue getDefaultValue() { - return defaultValue_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder() { - return getDefaultValue(); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 4; - private volatile java.lang.Object description_; - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getRenameToBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, renameTo_); - } - if (defaultValue_ != null) { - output.writeMessage(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); - } - 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 (!getRenameToBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, renameTo_); - } - if (defaultValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); - } - 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.ApiDef.Attr)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ApiDef.Attr other = (org.tensorflow.proto.framework.ApiDef.Attr) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getRenameTo() - .equals(other.getRenameTo())) return false; - if (hasDefaultValue() != other.hasDefaultValue()) return false; - if (hasDefaultValue()) { - if (!getDefaultValue() - .equals(other.getDefaultValue())) return false; - } - if (!getDescription() - .equals(other.getDescription())) 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) + RENAME_TO_FIELD_NUMBER; - hash = (53 * hash) + getRenameTo().hashCode(); - if (hasDefaultValue()) { - hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultValue().hashCode(); - } - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ApiDef.Attr parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Attr 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.ApiDef.Attr parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Attr 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.ApiDef.Attr parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef.Attr parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ApiDef.Attr parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Attr 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.ApiDef.Attr parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Attr 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.ApiDef.Attr parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef.Attr 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.ApiDef.Attr 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; - } - /** - *
    -     * Description of the graph-construction-time configuration of this
    -     * Op.  That is to say, this describes the attr fields that will
    -     * be specified in the NodeDef.
    -     * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Attr} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Attr) - org.tensorflow.proto.framework.ApiDef.AttrOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.Attr.class, org.tensorflow.proto.framework.ApiDef.Attr.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Attr.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_ = ""; - - renameTo_ = ""; - - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Attr getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ApiDef.Attr.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Attr build() { - org.tensorflow.proto.framework.ApiDef.Attr result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef.Attr buildPartial() { - org.tensorflow.proto.framework.ApiDef.Attr result = new org.tensorflow.proto.framework.ApiDef.Attr(this); - result.name_ = name_; - result.renameTo_ = renameTo_; - if (defaultValueBuilder_ == null) { - result.defaultValue_ = defaultValue_; - } else { - result.defaultValue_ = defaultValueBuilder_.build(); - } - result.description_ = description_; - 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.ApiDef.Attr) { - return mergeFrom((org.tensorflow.proto.framework.ApiDef.Attr)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ApiDef.Attr other) { - if (other == org.tensorflow.proto.framework.ApiDef.Attr.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getRenameTo().isEmpty()) { - renameTo_ = other.renameTo_; - onChanged(); - } - if (other.hasDefaultValue()) { - mergeDefaultValue(other.getDefaultValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - 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.ApiDef.Attr parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ApiDef.Attr) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 java.lang.Object renameTo_ = ""; - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public java.lang.String getRenameTo() { - java.lang.Object ref = renameTo_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - java.lang.Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameTo( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - renameTo_ = value; - onChanged(); - return this; - } - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder clearRenameTo() { - - renameTo_ = getDefaultInstance().getRenameTo(); - onChanged(); - return this; - } - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameToBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - renameTo_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.AttrValue defaultValue_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> defaultValueBuilder_; - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValueBuilder_ != null || defaultValue_ != null; - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue getDefaultValue() { - if (defaultValueBuilder_ == null) { - return defaultValue_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } else { - return defaultValueBuilder_.getMessage(); - } - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue(org.tensorflow.proto.framework.AttrValue value) { - if (defaultValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultValue_ = value; - onChanged(); - } else { - defaultValueBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue( - org.tensorflow.proto.framework.AttrValue.Builder builderForValue) { - if (defaultValueBuilder_ == null) { - defaultValue_ = builderForValue.build(); - onChanged(); - } else { - defaultValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder mergeDefaultValue(org.tensorflow.proto.framework.AttrValue value) { - if (defaultValueBuilder_ == null) { - if (defaultValue_ != null) { - defaultValue_ = - org.tensorflow.proto.framework.AttrValue.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); - } else { - defaultValue_ = value; - } - onChanged(); - } else { - defaultValueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder clearDefaultValue() { - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - onChanged(); - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - - return this; - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue.Builder getDefaultValueBuilder() { - - onChanged(); - return getDefaultValueFieldBuilder().getBuilder(); - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder() { - if (defaultValueBuilder_ != null) { - return defaultValueBuilder_.getMessageOrBuilder(); - } else { - return defaultValue_ == null ? - org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } - } - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> - getDefaultValueFieldBuilder() { - if (defaultValueBuilder_ == null) { - defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder>( - getDefaultValue(), - getParentForChildren(), - isClean()); - defaultValue_ = null; - } - return defaultValueBuilder_; - } - - private java.lang.Object description_ = ""; - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - 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.ApiDef.Attr) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Attr) - private static final org.tensorflow.proto.framework.ApiDef.Attr DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ApiDef.Attr(); - } - - public static org.tensorflow.proto.framework.ApiDef.Attr getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Attr parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Attr(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.ApiDef.Attr getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int GRAPH_OP_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object graphOpName_; - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - public java.lang.String getGraphOpName() { - java.lang.Object ref = graphOpName_; - 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(); - graphOpName_ = s; - return s; - } - } - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - public com.google.protobuf.ByteString - getGraphOpNameBytes() { - java.lang.Object ref = graphOpName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPRECATION_MESSAGE_FIELD_NUMBER = 12; - private volatile java.lang.Object deprecationMessage_; - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - public java.lang.String getDeprecationMessage() { - java.lang.Object ref = deprecationMessage_; - 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(); - deprecationMessage_ = s; - return s; - } - } - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - public com.google.protobuf.ByteString - getDeprecationMessageBytes() { - java.lang.Object ref = deprecationMessage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deprecationMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPRECATION_VERSION_FIELD_NUMBER = 13; - private int deprecationVersion_; - /** - *
    -   * Major version when the op will be deleted. For e.g. set this
    -   * value to 2 if op API should be removed in TensorFlow 2.0 and
    -   * deprecated in versions before that.
    -   * 
    - * - * int32 deprecation_version = 13; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - public static final int VISIBILITY_FIELD_NUMBER = 2; - private int visibility_; - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public int getVisibilityValue() { - return visibility_; - } - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public org.tensorflow.proto.framework.ApiDef.Visibility getVisibility() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.ApiDef.Visibility result = org.tensorflow.proto.framework.ApiDef.Visibility.valueOf(visibility_); - return result == null ? org.tensorflow.proto.framework.ApiDef.Visibility.UNRECOGNIZED : result; - } - - public static final int ENDPOINT_FIELD_NUMBER = 3; - private java.util.List endpoint_; - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List getEndpointList() { - return endpoint_; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointOrBuilderList() { - return endpoint_; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public int getEndpointCount() { - return endpoint_.size(); - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.Endpoint getEndpoint(int index) { - return endpoint_.get(index); - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder getEndpointOrBuilder( - int index) { - return endpoint_.get(index); - } - - public static final int IN_ARG_FIELD_NUMBER = 4; - private java.util.List inArg_; - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List getInArgList() { - return inArg_; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgOrBuilderList() { - return inArg_; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public int getInArgCount() { - return inArg_.size(); - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.Arg getInArg(int index) { - return inArg_.get(index); - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getInArgOrBuilder( - int index) { - return inArg_.get(index); - } - - public static final int OUT_ARG_FIELD_NUMBER = 5; - private java.util.List outArg_; - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List getOutArgList() { - return outArg_; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgOrBuilderList() { - return outArg_; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public int getOutArgCount() { - return outArg_.size(); - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.Arg getOutArg(int index) { - return outArg_.get(index); - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getOutArgOrBuilder( - int index) { - return outArg_.get(index); - } - - public static final int ARG_ORDER_FIELD_NUMBER = 11; - private com.google.protobuf.LazyStringList argOrder_; - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ProtocolStringList - getArgOrderList() { - return argOrder_; - } - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public int getArgOrderCount() { - return argOrder_.size(); - } - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public java.lang.String getArgOrder(int index) { - return argOrder_.get(index); - } - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ByteString - getArgOrderBytes(int index) { - return argOrder_.getByteString(index); - } - - public static final int ATTR_FIELD_NUMBER = 6; - private java.util.List attr_; - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List getAttrList() { - return attr_; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrOrBuilderList() { - return attr_; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public int getAttrCount() { - return attr_.size(); - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.Attr getAttr(int index) { - return attr_.get(index); - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.AttrOrBuilder getAttrOrBuilder( - int index) { - return attr_.get(index); - } - - public static final int SUMMARY_FIELD_NUMBER = 7; - private volatile java.lang.Object summary_; - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - 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(); - summary_ = s; - return s; - } - } - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 8; - private volatile java.lang.Object description_; - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_PREFIX_FIELD_NUMBER = 9; - private volatile java.lang.Object descriptionPrefix_; - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - public java.lang.String getDescriptionPrefix() { - java.lang.Object ref = descriptionPrefix_; - 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(); - descriptionPrefix_ = s; - return s; - } - } - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - public com.google.protobuf.ByteString - getDescriptionPrefixBytes() { - java.lang.Object ref = descriptionPrefix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - descriptionPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_SUFFIX_FIELD_NUMBER = 10; - private volatile java.lang.Object descriptionSuffix_; - /** - * string description_suffix = 10; - */ - public java.lang.String getDescriptionSuffix() { - java.lang.Object ref = descriptionSuffix_; - 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(); - descriptionSuffix_ = s; - return s; - } - } - /** - * string description_suffix = 10; - */ - public com.google.protobuf.ByteString - getDescriptionSuffixBytes() { - java.lang.Object ref = descriptionSuffix_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - descriptionSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getGraphOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, graphOpName_); - } - if (visibility_ != org.tensorflow.proto.framework.ApiDef.Visibility.DEFAULT_VISIBILITY.getNumber()) { - output.writeEnum(2, visibility_); - } - for (int i = 0; i < endpoint_.size(); i++) { - output.writeMessage(3, endpoint_.get(i)); - } - for (int i = 0; i < inArg_.size(); i++) { - output.writeMessage(4, inArg_.get(i)); - } - for (int i = 0; i < outArg_.size(); i++) { - output.writeMessage(5, outArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - output.writeMessage(6, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_); - } - if (!getDescriptionPrefixBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, descriptionPrefix_); - } - if (!getDescriptionSuffixBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, descriptionSuffix_); - } - for (int i = 0; i < argOrder_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, argOrder_.getRaw(i)); - } - if (!getDeprecationMessageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, deprecationMessage_); - } - if (deprecationVersion_ != 0) { - output.writeInt32(13, deprecationVersion_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGraphOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, graphOpName_); - } - if (visibility_ != org.tensorflow.proto.framework.ApiDef.Visibility.DEFAULT_VISIBILITY.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, visibility_); - } - for (int i = 0; i < endpoint_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, endpoint_.get(i)); - } - for (int i = 0; i < inArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, inArg_.get(i)); - } - for (int i = 0; i < outArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, outArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_); - } - if (!getDescriptionPrefixBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, descriptionPrefix_); - } - if (!getDescriptionSuffixBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, descriptionSuffix_); - } - { - int dataSize = 0; - for (int i = 0; i < argOrder_.size(); i++) { - dataSize += computeStringSizeNoTag(argOrder_.getRaw(i)); - } - size += dataSize; - size += 1 * getArgOrderList().size(); - } - if (!getDeprecationMessageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, deprecationMessage_); - } - if (deprecationVersion_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(13, deprecationVersion_); - } - 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.ApiDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ApiDef other = (org.tensorflow.proto.framework.ApiDef) obj; - - if (!getGraphOpName() - .equals(other.getGraphOpName())) return false; - if (!getDeprecationMessage() - .equals(other.getDeprecationMessage())) return false; - if (getDeprecationVersion() - != other.getDeprecationVersion()) return false; - if (visibility_ != other.visibility_) return false; - if (!getEndpointList() - .equals(other.getEndpointList())) return false; - if (!getInArgList() - .equals(other.getInArgList())) return false; - if (!getOutArgList() - .equals(other.getOutArgList())) return false; - if (!getArgOrderList() - .equals(other.getArgOrderList())) return false; - if (!getAttrList() - .equals(other.getAttrList())) return false; - if (!getSummary() - .equals(other.getSummary())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!getDescriptionPrefix() - .equals(other.getDescriptionPrefix())) return false; - if (!getDescriptionSuffix() - .equals(other.getDescriptionSuffix())) 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) + GRAPH_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphOpName().hashCode(); - hash = (37 * hash) + DEPRECATION_MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationMessage().hashCode(); - hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationVersion(); - hash = (37 * hash) + VISIBILITY_FIELD_NUMBER; - hash = (53 * hash) + visibility_; - if (getEndpointCount() > 0) { - hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; - hash = (53 * hash) + getEndpointList().hashCode(); - } - if (getInArgCount() > 0) { - hash = (37 * hash) + IN_ARG_FIELD_NUMBER; - hash = (53 * hash) + getInArgList().hashCode(); - } - if (getOutArgCount() > 0) { - hash = (37 * hash) + OUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getOutArgList().hashCode(); - } - if (getArgOrderCount() > 0) { - hash = (37 * hash) + ARG_ORDER_FIELD_NUMBER; - hash = (53 * hash) + getArgOrderList().hashCode(); - } - if (getAttrCount() > 0) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + getAttrList().hashCode(); - } - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + DESCRIPTION_PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getDescriptionPrefix().hashCode(); - hash = (37 * hash) + DESCRIPTION_SUFFIX_FIELD_NUMBER; - hash = (53 * hash) + getDescriptionSuffix().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ApiDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef 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.ApiDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef 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.ApiDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ApiDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef 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.ApiDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef 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.ApiDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDef 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.ApiDef 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; - } - /** - *
    -   * Used to specify and override the default API & behavior in the
    -   * generated code for client languages, from what you would get from
    -   * the OpDef alone. There will be a set of ApiDefs that are common
    -   * to all client languages, and another set per client language.
    -   * The per-client-language ApiDefs will inherit values from the
    -   * common ApiDefs which it can either replace or modify.
    -   * We separate the API definition from the OpDef so we can evolve the
    -   * API while remaining backwards compatible when interpretting old
    -   * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    -   * ApiDefs message.
    -   * WARNING: Be *very* careful changing the API for any existing op --
    -   * you can change the semantics of existing code.  These changes may
    -   * need to wait until a major release of TensorFlow to avoid breaking
    -   * our compatibility promises.
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef) - org.tensorflow.proto.framework.ApiDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDef.class, org.tensorflow.proto.framework.ApiDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEndpointFieldBuilder(); - getInArgFieldBuilder(); - getOutArgFieldBuilder(); - getAttrFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - graphOpName_ = ""; - - deprecationMessage_ = ""; - - deprecationVersion_ = 0; - - visibility_ = 0; - - if (endpointBuilder_ == null) { - endpoint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - endpointBuilder_.clear(); - } - if (inArgBuilder_ == null) { - inArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - inArgBuilder_.clear(); - } - if (outArgBuilder_ == null) { - outArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - outArgBuilder_.clear(); - } - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - attrBuilder_.clear(); - } - summary_ = ""; - - description_ = ""; - - descriptionPrefix_ = ""; - - descriptionSuffix_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ApiDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef build() { - org.tensorflow.proto.framework.ApiDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDef buildPartial() { - org.tensorflow.proto.framework.ApiDef result = new org.tensorflow.proto.framework.ApiDef(this); - int from_bitField0_ = bitField0_; - result.graphOpName_ = graphOpName_; - result.deprecationMessage_ = deprecationMessage_; - result.deprecationVersion_ = deprecationVersion_; - result.visibility_ = visibility_; - if (endpointBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - endpoint_ = java.util.Collections.unmodifiableList(endpoint_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.endpoint_ = endpoint_; - } else { - result.endpoint_ = endpointBuilder_.build(); - } - if (inArgBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - inArg_ = java.util.Collections.unmodifiableList(inArg_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.inArg_ = inArg_; - } else { - result.inArg_ = inArgBuilder_.build(); - } - if (outArgBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - outArg_ = java.util.Collections.unmodifiableList(outArg_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.outArg_ = outArg_; - } else { - result.outArg_ = outArgBuilder_.build(); - } - if (((bitField0_ & 0x00000008) != 0)) { - argOrder_ = argOrder_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.argOrder_ = argOrder_; - if (attrBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.attr_ = attr_; - } else { - result.attr_ = attrBuilder_.build(); - } - result.summary_ = summary_; - result.description_ = description_; - result.descriptionPrefix_ = descriptionPrefix_; - result.descriptionSuffix_ = descriptionSuffix_; - 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.ApiDef) { - return mergeFrom((org.tensorflow.proto.framework.ApiDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ApiDef other) { - if (other == org.tensorflow.proto.framework.ApiDef.getDefaultInstance()) return this; - if (!other.getGraphOpName().isEmpty()) { - graphOpName_ = other.graphOpName_; - onChanged(); - } - if (!other.getDeprecationMessage().isEmpty()) { - deprecationMessage_ = other.deprecationMessage_; - onChanged(); - } - if (other.getDeprecationVersion() != 0) { - setDeprecationVersion(other.getDeprecationVersion()); - } - if (other.visibility_ != 0) { - setVisibilityValue(other.getVisibilityValue()); - } - if (endpointBuilder_ == null) { - if (!other.endpoint_.isEmpty()) { - if (endpoint_.isEmpty()) { - endpoint_ = other.endpoint_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEndpointIsMutable(); - endpoint_.addAll(other.endpoint_); - } - onChanged(); - } - } else { - if (!other.endpoint_.isEmpty()) { - if (endpointBuilder_.isEmpty()) { - endpointBuilder_.dispose(); - endpointBuilder_ = null; - endpoint_ = other.endpoint_; - bitField0_ = (bitField0_ & ~0x00000001); - endpointBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEndpointFieldBuilder() : null; - } else { - endpointBuilder_.addAllMessages(other.endpoint_); - } - } - } - if (inArgBuilder_ == null) { - if (!other.inArg_.isEmpty()) { - if (inArg_.isEmpty()) { - inArg_ = other.inArg_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInArgIsMutable(); - inArg_.addAll(other.inArg_); - } - onChanged(); - } - } else { - if (!other.inArg_.isEmpty()) { - if (inArgBuilder_.isEmpty()) { - inArgBuilder_.dispose(); - inArgBuilder_ = null; - inArg_ = other.inArg_; - bitField0_ = (bitField0_ & ~0x00000002); - inArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInArgFieldBuilder() : null; - } else { - inArgBuilder_.addAllMessages(other.inArg_); - } - } - } - if (outArgBuilder_ == null) { - if (!other.outArg_.isEmpty()) { - if (outArg_.isEmpty()) { - outArg_ = other.outArg_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureOutArgIsMutable(); - outArg_.addAll(other.outArg_); - } - onChanged(); - } - } else { - if (!other.outArg_.isEmpty()) { - if (outArgBuilder_.isEmpty()) { - outArgBuilder_.dispose(); - outArgBuilder_ = null; - outArg_ = other.outArg_; - bitField0_ = (bitField0_ & ~0x00000004); - outArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutArgFieldBuilder() : null; - } else { - outArgBuilder_.addAllMessages(other.outArg_); - } - } - } - if (!other.argOrder_.isEmpty()) { - if (argOrder_.isEmpty()) { - argOrder_ = other.argOrder_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureArgOrderIsMutable(); - argOrder_.addAll(other.argOrder_); - } - onChanged(); - } - if (attrBuilder_ == null) { - if (!other.attr_.isEmpty()) { - if (attr_.isEmpty()) { - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureAttrIsMutable(); - attr_.addAll(other.attr_); - } - onChanged(); - } - } else { - if (!other.attr_.isEmpty()) { - if (attrBuilder_.isEmpty()) { - attrBuilder_.dispose(); - attrBuilder_ = null; - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000010); - attrBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttrFieldBuilder() : null; - } else { - attrBuilder_.addAllMessages(other.attr_); - } - } - } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (!other.getDescriptionPrefix().isEmpty()) { - descriptionPrefix_ = other.descriptionPrefix_; - onChanged(); - } - if (!other.getDescriptionSuffix().isEmpty()) { - descriptionSuffix_ = other.descriptionSuffix_; - onChanged(); - } - 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.ApiDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ApiDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object graphOpName_ = ""; - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public java.lang.String getGraphOpName() { - java.lang.Object ref = graphOpName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphOpName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public com.google.protobuf.ByteString - getGraphOpNameBytes() { - java.lang.Object ref = graphOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder setGraphOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphOpName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder clearGraphOpName() { - - graphOpName_ = getDefaultInstance().getGraphOpName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder setGraphOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphOpName_ = value; - onChanged(); - return this; - } - - private java.lang.Object deprecationMessage_ = ""; - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public java.lang.String getDeprecationMessage() { - java.lang.Object ref = deprecationMessage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deprecationMessage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public com.google.protobuf.ByteString - getDeprecationMessageBytes() { - java.lang.Object ref = deprecationMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deprecationMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder setDeprecationMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deprecationMessage_ = value; - onChanged(); - return this; - } - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder clearDeprecationMessage() { - - deprecationMessage_ = getDefaultInstance().getDeprecationMessage(); - onChanged(); - return this; - } - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder setDeprecationMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deprecationMessage_ = value; - onChanged(); - return this; - } - - private int deprecationVersion_ ; - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public Builder setDeprecationVersion(int value) { - - deprecationVersion_ = value; - onChanged(); - return this; - } - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public Builder clearDeprecationVersion() { - - deprecationVersion_ = 0; - onChanged(); - return this; - } - - private int visibility_ = 0; - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public int getVisibilityValue() { - return visibility_; - } - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder setVisibilityValue(int value) { - visibility_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public org.tensorflow.proto.framework.ApiDef.Visibility getVisibility() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.ApiDef.Visibility result = org.tensorflow.proto.framework.ApiDef.Visibility.valueOf(visibility_); - return result == null ? org.tensorflow.proto.framework.ApiDef.Visibility.UNRECOGNIZED : result; - } - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder setVisibility(org.tensorflow.proto.framework.ApiDef.Visibility value) { - if (value == null) { - throw new NullPointerException(); - } - - visibility_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder clearVisibility() { - - visibility_ = 0; - onChanged(); - return this; - } - - private java.util.List endpoint_ = - java.util.Collections.emptyList(); - private void ensureEndpointIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - endpoint_ = new java.util.ArrayList(endpoint_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Endpoint, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder, org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder> endpointBuilder_; - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List getEndpointList() { - if (endpointBuilder_ == null) { - return java.util.Collections.unmodifiableList(endpoint_); - } else { - return endpointBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public int getEndpointCount() { - if (endpointBuilder_ == null) { - return endpoint_.size(); - } else { - return endpointBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.Endpoint getEndpoint(int index) { - if (endpointBuilder_ == null) { - return endpoint_.get(index); - } else { - return endpointBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder setEndpoint( - int index, org.tensorflow.proto.framework.ApiDef.Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.set(index, value); - onChanged(); - } else { - endpointBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder setEndpoint( - int index, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.set(index, builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint(org.tensorflow.proto.framework.ApiDef.Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.add(value); - onChanged(); - } else { - endpointBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - int index, org.tensorflow.proto.framework.ApiDef.Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.add(index, value); - onChanged(); - } else { - endpointBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - org.tensorflow.proto.framework.ApiDef.Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.add(builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - int index, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.add(index, builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addAllEndpoint( - java.lang.Iterable values) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, endpoint_); - onChanged(); - } else { - endpointBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder clearEndpoint() { - if (endpointBuilder_ == null) { - endpoint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - endpointBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder removeEndpoint(int index) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.remove(index); - onChanged(); - } else { - endpointBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.Endpoint.Builder getEndpointBuilder( - int index) { - return getEndpointFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder getEndpointOrBuilder( - int index) { - if (endpointBuilder_ == null) { - return endpoint_.get(index); } else { - return endpointBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointOrBuilderList() { - if (endpointBuilder_ != null) { - return endpointBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(endpoint_); - } - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.Endpoint.Builder addEndpointBuilder() { - return getEndpointFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ApiDef.Endpoint.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public org.tensorflow.proto.framework.ApiDef.Endpoint.Builder addEndpointBuilder( - int index) { - return getEndpointFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ApiDef.Endpoint.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointBuilderList() { - return getEndpointFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Endpoint, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder, org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder> - getEndpointFieldBuilder() { - if (endpointBuilder_ == null) { - endpointBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Endpoint, org.tensorflow.proto.framework.ApiDef.Endpoint.Builder, org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder>( - endpoint_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - endpoint_ = null; - } - return endpointBuilder_; - } - - private java.util.List inArg_ = - java.util.Collections.emptyList(); - private void ensureInArgIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - inArg_ = new java.util.ArrayList(inArg_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder> inArgBuilder_; - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List getInArgList() { - if (inArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(inArg_); - } else { - return inArgBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public int getInArgCount() { - if (inArgBuilder_ == null) { - return inArg_.size(); - } else { - return inArgBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.Arg getInArg(int index) { - if (inArgBuilder_ == null) { - return inArg_.get(index); - } else { - return inArgBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder setInArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.set(index, value); - onChanged(); - } else { - inArgBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder setInArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.set(index, builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg(org.tensorflow.proto.framework.ApiDef.Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.add(value); - onChanged(); - } else { - inArgBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.add(index, value); - onChanged(); - } else { - inArgBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.add(builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.add(index, builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addAllInArg( - java.lang.Iterable values) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inArg_); - onChanged(); - } else { - inArgBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder clearInArg() { - if (inArgBuilder_ == null) { - inArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - inArgBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder removeInArg(int index) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.remove(index); - onChanged(); - } else { - inArgBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder getInArgBuilder( - int index) { - return getInArgFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getInArgOrBuilder( - int index) { - if (inArgBuilder_ == null) { - return inArg_.get(index); } else { - return inArgBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgOrBuilderList() { - if (inArgBuilder_ != null) { - return inArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inArg_); - } - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder addInArgBuilder() { - return getInArgFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder addInArgBuilder( - int index) { - return getInArgFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgBuilderList() { - return getInArgFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder> - getInArgFieldBuilder() { - if (inArgBuilder_ == null) { - inArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder>( - inArg_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - inArg_ = null; - } - return inArgBuilder_; - } - - private java.util.List outArg_ = - java.util.Collections.emptyList(); - private void ensureOutArgIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - outArg_ = new java.util.ArrayList(outArg_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder> outArgBuilder_; - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List getOutArgList() { - if (outArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(outArg_); - } else { - return outArgBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public int getOutArgCount() { - if (outArgBuilder_ == null) { - return outArg_.size(); - } else { - return outArgBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.Arg getOutArg(int index) { - if (outArgBuilder_ == null) { - return outArg_.get(index); - } else { - return outArgBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder setOutArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.set(index, value); - onChanged(); - } else { - outArgBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder setOutArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.set(index, builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg(org.tensorflow.proto.framework.ApiDef.Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.add(value); - onChanged(); - } else { - outArgBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.add(index, value); - onChanged(); - } else { - outArgBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.add(builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - int index, org.tensorflow.proto.framework.ApiDef.Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.add(index, builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addAllOutArg( - java.lang.Iterable values) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outArg_); - onChanged(); - } else { - outArgBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder clearOutArg() { - if (outArgBuilder_ == null) { - outArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - outArgBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder removeOutArg(int index) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.remove(index); - onChanged(); - } else { - outArgBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder getOutArgBuilder( - int index) { - return getOutArgFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getOutArgOrBuilder( - int index) { - if (outArgBuilder_ == null) { - return outArg_.get(index); } else { - return outArgBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgOrBuilderList() { - if (outArgBuilder_ != null) { - return outArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outArg_); - } - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder addOutArgBuilder() { - return getOutArgFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public org.tensorflow.proto.framework.ApiDef.Arg.Builder addOutArgBuilder( - int index) { - return getOutArgFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ApiDef.Arg.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgBuilderList() { - return getOutArgFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder> - getOutArgFieldBuilder() { - if (outArgBuilder_ == null) { - outArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Arg, org.tensorflow.proto.framework.ApiDef.Arg.Builder, org.tensorflow.proto.framework.ApiDef.ArgOrBuilder>( - outArg_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - outArg_ = null; - } - return outArgBuilder_; - } - - private com.google.protobuf.LazyStringList argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureArgOrderIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - argOrder_ = new com.google.protobuf.LazyStringArrayList(argOrder_); - bitField0_ |= 0x00000008; - } - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ProtocolStringList - getArgOrderList() { - return argOrder_.getUnmodifiableView(); - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public int getArgOrderCount() { - return argOrder_.size(); - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public java.lang.String getArgOrder(int index) { - return argOrder_.get(index); - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ByteString - getArgOrderBytes(int index) { - return argOrder_.getByteString(index); - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder setArgOrder( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgOrderIsMutable(); - argOrder_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addArgOrder( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgOrderIsMutable(); - argOrder_.add(value); - onChanged(); - return this; - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addAllArgOrder( - java.lang.Iterable values) { - ensureArgOrderIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, argOrder_); - onChanged(); - return this; - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder clearArgOrder() { - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addArgOrderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureArgOrderIsMutable(); - argOrder_.add(value); - onChanged(); - return this; - } - - private java.util.List attr_ = - java.util.Collections.emptyList(); - private void ensureAttrIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - attr_ = new java.util.ArrayList(attr_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Attr, org.tensorflow.proto.framework.ApiDef.Attr.Builder, org.tensorflow.proto.framework.ApiDef.AttrOrBuilder> attrBuilder_; - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List getAttrList() { - if (attrBuilder_ == null) { - return java.util.Collections.unmodifiableList(attr_); - } else { - return attrBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public int getAttrCount() { - if (attrBuilder_ == null) { - return attr_.size(); - } else { - return attrBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.Attr getAttr(int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder setAttr( - int index, org.tensorflow.proto.framework.ApiDef.Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.set(index, value); - onChanged(); - } else { - attrBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder setAttr( - int index, org.tensorflow.proto.framework.ApiDef.Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.set(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr(org.tensorflow.proto.framework.ApiDef.Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(value); - onChanged(); - } else { - attrBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - int index, org.tensorflow.proto.framework.ApiDef.Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(index, value); - onChanged(); - } else { - attrBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - org.tensorflow.proto.framework.ApiDef.Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - int index, org.tensorflow.proto.framework.ApiDef.Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAllAttr( - java.lang.Iterable values) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attr_); - onChanged(); - } else { - attrBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder clearAttr() { - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - attrBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder removeAttr(int index) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.remove(index); - onChanged(); - } else { - attrBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.Attr.Builder getAttrBuilder( - int index) { - return getAttrFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.AttrOrBuilder getAttrOrBuilder( - int index) { - if (attrBuilder_ == null) { - return attr_.get(index); } else { - return attrBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrOrBuilderList() { - if (attrBuilder_ != null) { - return attrBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attr_); - } - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.Attr.Builder addAttrBuilder() { - return getAttrFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ApiDef.Attr.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public org.tensorflow.proto.framework.ApiDef.Attr.Builder addAttrBuilder( - int index) { - return getAttrFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ApiDef.Attr.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrBuilderList() { - return getAttrFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Attr, org.tensorflow.proto.framework.ApiDef.Attr.Builder, org.tensorflow.proto.framework.ApiDef.AttrOrBuilder> - getAttrFieldBuilder() { - if (attrBuilder_ == null) { - attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef.Attr, org.tensorflow.proto.framework.ApiDef.Attr.Builder, org.tensorflow.proto.framework.ApiDef.AttrOrBuilder>( - attr_, - ((bitField0_ & 0x00000010) != 0), - getParentForChildren(), - isClean()); - attr_ = null; - } - return attrBuilder_; - } - - private java.lang.Object summary_ = ""; - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summary_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder setSummary( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - summary_ = value; - onChanged(); - return this; - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder clearSummary() { - - summary_ = getDefaultInstance().getSummary(); - onChanged(); - return this; - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder setSummaryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private java.lang.Object descriptionPrefix_ = ""; - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public java.lang.String getDescriptionPrefix() { - java.lang.Object ref = descriptionPrefix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - descriptionPrefix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public com.google.protobuf.ByteString - getDescriptionPrefixBytes() { - java.lang.Object ref = descriptionPrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - descriptionPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder setDescriptionPrefix( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - descriptionPrefix_ = value; - onChanged(); - return this; - } - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder clearDescriptionPrefix() { - - descriptionPrefix_ = getDefaultInstance().getDescriptionPrefix(); - onChanged(); - return this; - } - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder setDescriptionPrefixBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - descriptionPrefix_ = value; - onChanged(); - return this; - } - - private java.lang.Object descriptionSuffix_ = ""; - /** - * string description_suffix = 10; - */ - public java.lang.String getDescriptionSuffix() { - java.lang.Object ref = descriptionSuffix_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - descriptionSuffix_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string description_suffix = 10; - */ - public com.google.protobuf.ByteString - getDescriptionSuffixBytes() { - java.lang.Object ref = descriptionSuffix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - descriptionSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string description_suffix = 10; - */ - public Builder setDescriptionSuffix( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - descriptionSuffix_ = value; - onChanged(); - return this; - } - /** - * string description_suffix = 10; - */ - public Builder clearDescriptionSuffix() { - - descriptionSuffix_ = getDefaultInstance().getDescriptionSuffix(); - onChanged(); - return this; - } - /** - * string description_suffix = 10; - */ - public Builder setDescriptionSuffixBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - descriptionSuffix_ = value; - 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.ApiDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef) - private static final org.tensorflow.proto.framework.ApiDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ApiDef(); - } - - public static org.tensorflow.proto.framework.ApiDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApiDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApiDef(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.ApiDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java deleted file mode 100644 index 1a435d93fdb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java +++ /dev/null @@ -1,274 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -public interface ApiDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - java.lang.String getGraphOpName(); - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - com.google.protobuf.ByteString - getGraphOpNameBytes(); - - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - java.lang.String getDeprecationMessage(); - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - com.google.protobuf.ByteString - getDeprecationMessageBytes(); - - /** - *
    -   * Major version when the op will be deleted. For e.g. set this
    -   * value to 2 if op API should be removed in TensorFlow 2.0 and
    -   * deprecated in versions before that.
    -   * 
    - * - * int32 deprecation_version = 13; - */ - int getDeprecationVersion(); - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - int getVisibilityValue(); - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - org.tensorflow.proto.framework.ApiDef.Visibility getVisibility(); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - java.util.List - getEndpointList(); - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - org.tensorflow.proto.framework.ApiDef.Endpoint getEndpoint(int index); - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - int getEndpointCount(); - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - java.util.List - getEndpointOrBuilderList(); - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - org.tensorflow.proto.framework.ApiDef.EndpointOrBuilder getEndpointOrBuilder( - int index); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - java.util.List - getInArgList(); - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - org.tensorflow.proto.framework.ApiDef.Arg getInArg(int index); - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - int getInArgCount(); - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - java.util.List - getInArgOrBuilderList(); - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getInArgOrBuilder( - int index); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - java.util.List - getOutArgList(); - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - org.tensorflow.proto.framework.ApiDef.Arg getOutArg(int index); - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - int getOutArgCount(); - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - java.util.List - getOutArgOrBuilderList(); - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - org.tensorflow.proto.framework.ApiDef.ArgOrBuilder getOutArgOrBuilder( - int index); - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - java.util.List - getArgOrderList(); - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - int getArgOrderCount(); - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - java.lang.String getArgOrder(int index); - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - com.google.protobuf.ByteString - getArgOrderBytes(int index); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - java.util.List - getAttrList(); - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - org.tensorflow.proto.framework.ApiDef.Attr getAttr(int index); - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - int getAttrCount(); - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - java.util.List - getAttrOrBuilderList(); - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - org.tensorflow.proto.framework.ApiDef.AttrOrBuilder getAttrOrBuilder( - int index); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - java.lang.String getSummary(); - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - com.google.protobuf.ByteString - getSummaryBytes(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - java.lang.String getDescription(); - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - java.lang.String getDescriptionPrefix(); - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - com.google.protobuf.ByteString - getDescriptionPrefixBytes(); - - /** - * string description_suffix = 10; - */ - java.lang.String getDescriptionSuffix(); - /** - * string description_suffix = 10; - */ - com.google.protobuf.ByteString - getDescriptionSuffixBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefProtos.java deleted file mode 100644 index 6df5379d411..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefProtos.java +++ /dev/null @@ -1,117 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -public final class ApiDefProtos { - private ApiDefProtos() {} - 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_ApiDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Endpoint_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Arg_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Attr_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDefs_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDefs_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/framework/api_def.prot" + - "o\022\ntensorflow\032*tensorflow/core/framework" + - "/attr_value.proto\"\341\005\n\006ApiDef\022\025\n\rgraph_op" + - "_name\030\001 \001(\t\022\033\n\023deprecation_message\030\014 \001(\t" + - "\022\033\n\023deprecation_version\030\r \001(\005\0221\n\nvisibil" + - "ity\030\002 \001(\0162\035.tensorflow.ApiDef.Visibility" + - "\022-\n\010endpoint\030\003 \003(\0132\033.tensorflow.ApiDef.E" + - "ndpoint\022&\n\006in_arg\030\004 \003(\0132\026.tensorflow.Api" + - "Def.Arg\022\'\n\007out_arg\030\005 \003(\0132\026.tensorflow.Ap" + - "iDef.Arg\022\021\n\targ_order\030\013 \003(\t\022%\n\004attr\030\006 \003(" + - "\0132\027.tensorflow.ApiDef.Attr\022\017\n\007summary\030\007 " + - "\001(\t\022\023\n\013description\030\010 \001(\t\022\032\n\022description_" + - "prefix\030\t \001(\t\022\032\n\022description_suffix\030\n \001(\t" + - "\032I\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\022\n\ndeprecated" + - "\030\003 \001(\010\022\033\n\023deprecation_version\030\004 \001(\005\032;\n\003A" + - "rg\022\014\n\004name\030\001 \001(\t\022\021\n\trename_to\030\002 \001(\t\022\023\n\013d" + - "escription\030\003 \001(\t\032j\n\004Attr\022\014\n\004name\030\001 \001(\t\022\021" + - "\n\trename_to\030\002 \001(\t\022,\n\rdefault_value\030\003 \001(\013" + - "2\025.tensorflow.AttrValue\022\023\n\013description\030\004" + - " \001(\t\"G\n\nVisibility\022\026\n\022DEFAULT_VISIBILITY" + - "\020\000\022\013\n\007VISIBLE\020\001\022\010\n\004SKIP\020\002\022\n\n\006HIDDEN\020\003\")\n" + - "\007ApiDefs\022\036\n\002op\030\001 \003(\0132\022.tensorflow.ApiDef" + - "B\203\001\n\036org.tensorflow.proto.frameworkB\014Api" + - "DefProtosP\001ZNgithub.com/tensorflow/tenso" + - "rflow/tensorflow/go/core/framework/api_d" + - "ef_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - }); - internal_static_tensorflow_ApiDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ApiDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_descriptor, - new java.lang.String[] { "GraphOpName", "DeprecationMessage", "DeprecationVersion", "Visibility", "Endpoint", "InArg", "OutArg", "ArgOrder", "Attr", "Summary", "Description", "DescriptionPrefix", "DescriptionSuffix", }); - internal_static_tensorflow_ApiDef_Endpoint_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Endpoint_descriptor, - new java.lang.String[] { "Name", "Deprecated", "DeprecationVersion", }); - internal_static_tensorflow_ApiDef_Arg_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Arg_descriptor, - new java.lang.String[] { "Name", "RenameTo", "Description", }); - internal_static_tensorflow_ApiDef_Attr_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Attr_descriptor, - new java.lang.String[] { "Name", "RenameTo", "DefaultValue", "Description", }); - internal_static_tensorflow_ApiDefs_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_ApiDefs_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDefs_descriptor, - new java.lang.String[] { "Op", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefs.java deleted file mode 100644 index a4076265967..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefs.java +++ /dev/null @@ -1,765 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.ApiDefs} - */ -public final class ApiDefs extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDefs) - ApiDefsOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApiDefs.newBuilder() to construct. - private ApiDefs(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApiDefs() { - op_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApiDefs(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApiDefs( - 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)) { - op_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - op_.add( - input.readMessage(org.tensorflow.proto.framework.ApiDef.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_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDefs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDefs.class, org.tensorflow.proto.framework.ApiDefs.Builder.class); - } - - public static final int OP_FIELD_NUMBER = 1; - private java.util.List op_; - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public java.util.List getOpList() { - return op_; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - return op_; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public int getOpCount() { - return op_.size(); - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDef getOp(int index) { - return op_.get(index); - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDefOrBuilder getOpOrBuilder( - int index) { - return op_.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 { - for (int i = 0; i < op_.size(); i++) { - output.writeMessage(1, op_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < op_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, op_.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.ApiDefs)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ApiDefs other = (org.tensorflow.proto.framework.ApiDefs) obj; - - if (!getOpList() - .equals(other.getOpList())) 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 (getOpCount() > 0) { - hash = (37 * hash) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOpList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ApiDefs parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDefs 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.ApiDefs parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDefs 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.ApiDefs parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ApiDefs parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ApiDefs parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDefs 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.ApiDefs parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDefs 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.ApiDefs parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ApiDefs 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.ApiDefs 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.ApiDefs} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDefs) - org.tensorflow.proto.framework.ApiDefsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDefs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ApiDefs.class, org.tensorflow.proto.framework.ApiDefs.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDefs.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getOpFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - opBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDefs getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ApiDefs.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDefs build() { - org.tensorflow.proto.framework.ApiDefs result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ApiDefs buildPartial() { - org.tensorflow.proto.framework.ApiDefs result = new org.tensorflow.proto.framework.ApiDefs(this); - int from_bitField0_ = bitField0_; - if (opBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.op_ = op_; - } else { - result.op_ = opBuilder_.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.ApiDefs) { - return mergeFrom((org.tensorflow.proto.framework.ApiDefs)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ApiDefs other) { - if (other == org.tensorflow.proto.framework.ApiDefs.getDefaultInstance()) return this; - if (opBuilder_ == null) { - if (!other.op_.isEmpty()) { - if (op_.isEmpty()) { - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOpIsMutable(); - op_.addAll(other.op_); - } - onChanged(); - } - } else { - if (!other.op_.isEmpty()) { - if (opBuilder_.isEmpty()) { - opBuilder_.dispose(); - opBuilder_ = null; - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - opBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOpFieldBuilder() : null; - } else { - opBuilder_.addAllMessages(other.op_); - } - } - } - 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.ApiDefs parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ApiDefs) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List op_ = - java.util.Collections.emptyList(); - private void ensureOpIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - op_ = new java.util.ArrayList(op_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef, org.tensorflow.proto.framework.ApiDef.Builder, org.tensorflow.proto.framework.ApiDefOrBuilder> opBuilder_; - - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public java.util.List getOpList() { - if (opBuilder_ == null) { - return java.util.Collections.unmodifiableList(op_); - } else { - return opBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public int getOpCount() { - if (opBuilder_ == null) { - return op_.size(); - } else { - return opBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDef getOp(int index) { - if (opBuilder_ == null) { - return op_.get(index); - } else { - return opBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder setOp( - int index, org.tensorflow.proto.framework.ApiDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.set(index, value); - onChanged(); - } else { - opBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder setOp( - int index, org.tensorflow.proto.framework.ApiDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.set(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder addOp(org.tensorflow.proto.framework.ApiDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(value); - onChanged(); - } else { - opBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder addOp( - int index, org.tensorflow.proto.framework.ApiDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(index, value); - onChanged(); - } else { - opBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder addOp( - org.tensorflow.proto.framework.ApiDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder addOp( - int index, org.tensorflow.proto.framework.ApiDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder addAllOp( - java.lang.Iterable values) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, op_); - onChanged(); - } else { - opBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder clearOp() { - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - opBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public Builder removeOp(int index) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.remove(index); - onChanged(); - } else { - opBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDef.Builder getOpBuilder( - int index) { - return getOpFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDefOrBuilder getOpOrBuilder( - int index) { - if (opBuilder_ == null) { - return op_.get(index); } else { - return opBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - if (opBuilder_ != null) { - return opBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(op_); - } - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDef.Builder addOpBuilder() { - return getOpFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ApiDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public org.tensorflow.proto.framework.ApiDef.Builder addOpBuilder( - int index) { - return getOpFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ApiDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.ApiDef op = 1; - */ - public java.util.List - getOpBuilderList() { - return getOpFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef, org.tensorflow.proto.framework.ApiDef.Builder, org.tensorflow.proto.framework.ApiDefOrBuilder> - getOpFieldBuilder() { - if (opBuilder_ == null) { - opBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ApiDef, org.tensorflow.proto.framework.ApiDef.Builder, org.tensorflow.proto.framework.ApiDefOrBuilder>( - op_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - op_ = null; - } - return opBuilder_; - } - @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.ApiDefs) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDefs) - private static final org.tensorflow.proto.framework.ApiDefs DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ApiDefs(); - } - - public static org.tensorflow.proto.framework.ApiDefs getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApiDefs parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApiDefs(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.ApiDefs getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefsOrBuilder.java deleted file mode 100644 index e3ba64964e7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ApiDefsOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -public interface ApiDefsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDefs) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.ApiDef op = 1; - */ - java.util.List - getOpList(); - /** - * repeated .tensorflow.ApiDef op = 1; - */ - org.tensorflow.proto.framework.ApiDef getOp(int index); - /** - * repeated .tensorflow.ApiDef op = 1; - */ - int getOpCount(); - /** - * repeated .tensorflow.ApiDef op = 1; - */ - java.util.List - getOpOrBuilderList(); - /** - * repeated .tensorflow.ApiDef op = 1; - */ - org.tensorflow.proto.framework.ApiDefOrBuilder getOpOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDef.java deleted file mode 100644 index 2d4a4e4b828..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDef.java +++ /dev/null @@ -1,827 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * An asset file def for a single file or a set of sharded files with the same
    - * name.
    - * 
    - * - * Protobuf type {@code tensorflow.AssetFileDef} - */ -public final class AssetFileDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AssetFileDef) - AssetFileDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use AssetFileDef.newBuilder() to construct. - private AssetFileDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AssetFileDef() { - filename_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AssetFileDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AssetFileDef( - 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: { - org.tensorflow.proto.framework.TensorInfo.Builder subBuilder = null; - if (tensorInfo_ != null) { - subBuilder = tensorInfo_.toBuilder(); - } - tensorInfo_ = input.readMessage(org.tensorflow.proto.framework.TensorInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorInfo_); - tensorInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - filename_ = s; - 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.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AssetFileDef.class, org.tensorflow.proto.framework.AssetFileDef.Builder.class); - } - - public static final int TENSOR_INFO_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.TensorInfo tensorInfo_; - /** - *
    -   * The tensor to bind the asset filename to.
    -   * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public boolean hasTensorInfo() { - return tensorInfo_ != null; - } - /** - *
    -   * The tensor to bind the asset filename to.
    -   * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public org.tensorflow.proto.framework.TensorInfo getTensorInfo() { - return tensorInfo_ == null ? org.tensorflow.proto.framework.TensorInfo.getDefaultInstance() : tensorInfo_; - } - /** - *
    -   * The tensor to bind the asset filename to.
    -   * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public org.tensorflow.proto.framework.TensorInfoOrBuilder getTensorInfoOrBuilder() { - return getTensorInfo(); - } - - public static final int FILENAME_FIELD_NUMBER = 2; - private volatile java.lang.Object filename_; - /** - *
    -   * The filename within an assets directory. Note: does not include the path
    -   * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -   * would be "vocab.txt".
    -   * 
    - * - * string filename = 2; - */ - public java.lang.String getFilename() { - java.lang.Object ref = filename_; - 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(); - filename_ = s; - return s; - } - } - /** - *
    -   * The filename within an assets directory. Note: does not include the path
    -   * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -   * would be "vocab.txt".
    -   * 
    - * - * string filename = 2; - */ - public com.google.protobuf.ByteString - getFilenameBytes() { - java.lang.Object ref = filename_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filename_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (tensorInfo_ != null) { - output.writeMessage(1, getTensorInfo()); - } - if (!getFilenameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filename_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (tensorInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTensorInfo()); - } - if (!getFilenameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filename_); - } - 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.AssetFileDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AssetFileDef other = (org.tensorflow.proto.framework.AssetFileDef) obj; - - if (hasTensorInfo() != other.hasTensorInfo()) return false; - if (hasTensorInfo()) { - if (!getTensorInfo() - .equals(other.getTensorInfo())) return false; - } - if (!getFilename() - .equals(other.getFilename())) 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 (hasTensorInfo()) { - hash = (37 * hash) + TENSOR_INFO_FIELD_NUMBER; - hash = (53 * hash) + getTensorInfo().hashCode(); - } - hash = (37 * hash) + FILENAME_FIELD_NUMBER; - hash = (53 * hash) + getFilename().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AssetFileDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AssetFileDef 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.AssetFileDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AssetFileDef 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.AssetFileDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AssetFileDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AssetFileDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AssetFileDef 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.AssetFileDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AssetFileDef 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.AssetFileDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AssetFileDef 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.AssetFileDef 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; - } - /** - *
    -   * An asset file def for a single file or a set of sharded files with the same
    -   * name.
    -   * 
    - * - * Protobuf type {@code tensorflow.AssetFileDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AssetFileDef) - org.tensorflow.proto.framework.AssetFileDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AssetFileDef.class, org.tensorflow.proto.framework.AssetFileDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AssetFileDef.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 (tensorInfoBuilder_ == null) { - tensorInfo_ = null; - } else { - tensorInfo_ = null; - tensorInfoBuilder_ = null; - } - filename_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AssetFileDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AssetFileDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AssetFileDef build() { - org.tensorflow.proto.framework.AssetFileDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AssetFileDef buildPartial() { - org.tensorflow.proto.framework.AssetFileDef result = new org.tensorflow.proto.framework.AssetFileDef(this); - if (tensorInfoBuilder_ == null) { - result.tensorInfo_ = tensorInfo_; - } else { - result.tensorInfo_ = tensorInfoBuilder_.build(); - } - result.filename_ = filename_; - 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.AssetFileDef) { - return mergeFrom((org.tensorflow.proto.framework.AssetFileDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AssetFileDef other) { - if (other == org.tensorflow.proto.framework.AssetFileDef.getDefaultInstance()) return this; - if (other.hasTensorInfo()) { - mergeTensorInfo(other.getTensorInfo()); - } - if (!other.getFilename().isEmpty()) { - filename_ = other.filename_; - onChanged(); - } - 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.AssetFileDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AssetFileDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.framework.TensorInfo tensorInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder> tensorInfoBuilder_; - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public boolean hasTensorInfo() { - return tensorInfoBuilder_ != null || tensorInfo_ != null; - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public org.tensorflow.proto.framework.TensorInfo getTensorInfo() { - if (tensorInfoBuilder_ == null) { - return tensorInfo_ == null ? org.tensorflow.proto.framework.TensorInfo.getDefaultInstance() : tensorInfo_; - } else { - return tensorInfoBuilder_.getMessage(); - } - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public Builder setTensorInfo(org.tensorflow.proto.framework.TensorInfo value) { - if (tensorInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorInfo_ = value; - onChanged(); - } else { - tensorInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public Builder setTensorInfo( - org.tensorflow.proto.framework.TensorInfo.Builder builderForValue) { - if (tensorInfoBuilder_ == null) { - tensorInfo_ = builderForValue.build(); - onChanged(); - } else { - tensorInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public Builder mergeTensorInfo(org.tensorflow.proto.framework.TensorInfo value) { - if (tensorInfoBuilder_ == null) { - if (tensorInfo_ != null) { - tensorInfo_ = - org.tensorflow.proto.framework.TensorInfo.newBuilder(tensorInfo_).mergeFrom(value).buildPartial(); - } else { - tensorInfo_ = value; - } - onChanged(); - } else { - tensorInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public Builder clearTensorInfo() { - if (tensorInfoBuilder_ == null) { - tensorInfo_ = null; - onChanged(); - } else { - tensorInfo_ = null; - tensorInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public org.tensorflow.proto.framework.TensorInfo.Builder getTensorInfoBuilder() { - - onChanged(); - return getTensorInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - public org.tensorflow.proto.framework.TensorInfoOrBuilder getTensorInfoOrBuilder() { - if (tensorInfoBuilder_ != null) { - return tensorInfoBuilder_.getMessageOrBuilder(); - } else { - return tensorInfo_ == null ? - org.tensorflow.proto.framework.TensorInfo.getDefaultInstance() : tensorInfo_; - } - } - /** - *
    -     * The tensor to bind the asset filename to.
    -     * 
    - * - * .tensorflow.TensorInfo tensor_info = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder> - getTensorInfoFieldBuilder() { - if (tensorInfoBuilder_ == null) { - tensorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder>( - getTensorInfo(), - getParentForChildren(), - isClean()); - tensorInfo_ = null; - } - return tensorInfoBuilder_; - } - - private java.lang.Object filename_ = ""; - /** - *
    -     * The filename within an assets directory. Note: does not include the path
    -     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -     * would be "vocab.txt".
    -     * 
    - * - * string filename = 2; - */ - public java.lang.String getFilename() { - java.lang.Object ref = filename_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filename_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The filename within an assets directory. Note: does not include the path
    -     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -     * would be "vocab.txt".
    -     * 
    - * - * string filename = 2; - */ - public com.google.protobuf.ByteString - getFilenameBytes() { - java.lang.Object ref = filename_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filename_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The filename within an assets directory. Note: does not include the path
    -     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -     * would be "vocab.txt".
    -     * 
    - * - * string filename = 2; - */ - public Builder setFilename( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filename_ = value; - onChanged(); - return this; - } - /** - *
    -     * The filename within an assets directory. Note: does not include the path
    -     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -     * would be "vocab.txt".
    -     * 
    - * - * string filename = 2; - */ - public Builder clearFilename() { - - filename_ = getDefaultInstance().getFilename(); - onChanged(); - return this; - } - /** - *
    -     * The filename within an assets directory. Note: does not include the path
    -     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    -     * would be "vocab.txt".
    -     * 
    - * - * string filename = 2; - */ - public Builder setFilenameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filename_ = value; - 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.AssetFileDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AssetFileDef) - private static final org.tensorflow.proto.framework.AssetFileDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AssetFileDef(); - } - - public static org.tensorflow.proto.framework.AssetFileDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AssetFileDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AssetFileDef(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.AssetFileDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValue.java deleted file mode 100644 index f64f1a8b3ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValue.java +++ /dev/null @@ -1,5341 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing the value for an attr used to configure an Op.
    - * Comment indicates the corresponding attr type.  Only the field matching the
    - * attr type may be filled.
    - * 
    - * - * Protobuf type {@code tensorflow.AttrValue} - */ -public final class AttrValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AttrValue) - AttrValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use AttrValue.newBuilder() to construct. - private AttrValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AttrValue() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AttrValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AttrValue( - 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: { - org.tensorflow.proto.framework.AttrValue.ListValue.Builder subBuilder = null; - if (valueCase_ == 1) { - subBuilder = ((org.tensorflow.proto.framework.AttrValue.ListValue) value_).toBuilder(); - } - value_ = - input.readMessage(org.tensorflow.proto.framework.AttrValue.ListValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.AttrValue.ListValue) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 1; - break; - } - case 18: { - valueCase_ = 2; - value_ = input.readBytes(); - break; - } - case 24: { - valueCase_ = 3; - value_ = input.readInt64(); - break; - } - case 37: { - valueCase_ = 4; - value_ = input.readFloat(); - break; - } - case 40: { - valueCase_ = 5; - value_ = input.readBool(); - break; - } - case 48: { - int rawValue = input.readEnum(); - valueCase_ = 6; - value_ = rawValue; - break; - } - case 58: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (valueCase_ == 7) { - subBuilder = ((org.tensorflow.proto.framework.TensorShapeProto) value_).toBuilder(); - } - value_ = - input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorShapeProto) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 7; - break; - } - case 66: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (valueCase_ == 8) { - subBuilder = ((org.tensorflow.proto.framework.TensorProto) value_).toBuilder(); - } - value_ = - input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorProto) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 8; - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - valueCase_ = 9; - value_ = s; - break; - } - case 82: { - org.tensorflow.proto.framework.NameAttrList.Builder subBuilder = null; - if (valueCase_ == 10) { - subBuilder = ((org.tensorflow.proto.framework.NameAttrList) value_).toBuilder(); - } - value_ = - input.readMessage(org.tensorflow.proto.framework.NameAttrList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.NameAttrList) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 10; - 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.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AttrValue.class, org.tensorflow.proto.framework.AttrValue.Builder.class); - } - - public interface ListValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue.ListValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - java.util.List getSList(); - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - int getSCount(); - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - com.google.protobuf.ByteString getS(int index); - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - java.util.List getIList(); - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - int getICount(); - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - long getI(int index); - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - java.util.List getFList(); - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - int getFCount(); - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - float getF(int index); - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - java.util.List getBList(); - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - int getBCount(); - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - boolean getB(int index); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - java.util.List getTypeList(); - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - int getTypeCount(); - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - org.tensorflow.proto.framework.DataType getType(int index); - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - java.util.List - getTypeValueList(); - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - int getTypeValue(int index); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - java.util.List - getShapeList(); - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(int index); - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - int getShapeCount(); - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - java.util.List - getShapeOrBuilderList(); - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder( - int index); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - java.util.List - getTensorList(); - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - org.tensorflow.proto.framework.TensorProto getTensor(int index); - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - int getTensorCount(); - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - java.util.List - getTensorOrBuilderList(); - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - java.util.List - getFuncList(); - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - org.tensorflow.proto.framework.NameAttrList getFunc(int index); - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - int getFuncCount(); - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - java.util.List - getFuncOrBuilderList(); - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder( - int index); - } - /** - *
    -   * LINT.IfChange
    -   * 
    - * - * Protobuf type {@code tensorflow.AttrValue.ListValue} - */ - public static final class ListValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AttrValue.ListValue) - ListValueOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListValue.newBuilder() to construct. - private ListValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListValue() { - s_ = java.util.Collections.emptyList(); - i_ = emptyLongList(); - f_ = emptyFloatList(); - b_ = emptyBooleanList(); - type_ = java.util.Collections.emptyList(); - shape_ = java.util.Collections.emptyList(); - tensor_ = java.util.Collections.emptyList(); - func_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListValue( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - s_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - s_.add(input.readBytes()); - break; - } - case 24: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - i_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - i_.addLong(input.readInt64()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - i_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - i_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 37: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - f_ = newFloatList(); - mutable_bitField0_ |= 0x00000004; - } - f_.addFloat(input.readFloat()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - f_ = newFloatList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - f_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 40: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - b_ = newBooleanList(); - mutable_bitField0_ |= 0x00000008; - } - b_.addBoolean(input.readBool()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) { - b_ = newBooleanList(); - mutable_bitField0_ |= 0x00000008; - } - while (input.getBytesUntilLimit() > 0) { - b_.addBoolean(input.readBool()); - } - input.popLimit(limit); - break; - } - case 48: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - type_.add(rawValue); - break; - } - case 50: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - type_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - shape_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - shape_.add( - input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { - tensor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - tensor_.add( - input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { - func_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - func_.add( - input.readMessage(org.tensorflow.proto.framework.NameAttrList.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_ & 0x00000001) != 0)) { - s_ = java.util.Collections.unmodifiableList(s_); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - i_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - f_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - b_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = java.util.Collections.unmodifiableList(type_); - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - shape_ = java.util.Collections.unmodifiableList(shape_); - } - if (((mutable_bitField0_ & 0x00000040) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - } - if (((mutable_bitField0_ & 0x00000080) != 0)) { - func_ = java.util.Collections.unmodifiableList(func_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AttrValue.ListValue.class, org.tensorflow.proto.framework.AttrValue.ListValue.Builder.class); - } - - public static final int S_FIELD_NUMBER = 2; - private java.util.List s_; - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public java.util.List - getSList() { - return s_; - } - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public int getSCount() { - return s_.size(); - } - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public com.google.protobuf.ByteString getS(int index) { - return s_.get(index); - } - - public static final int I_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.LongList i_; - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public java.util.List - getIList() { - return i_; - } - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public int getICount() { - return i_.size(); - } - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public long getI(int index) { - return i_.getLong(index); - } - private int iMemoizedSerializedSize = -1; - - public static final int F_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.FloatList f_; - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public java.util.List - getFList() { - return f_; - } - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public int getFCount() { - return f_.size(); - } - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public float getF(int index) { - return f_.getFloat(index); - } - private int fMemoizedSerializedSize = -1; - - public static final int B_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.BooleanList b_; - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public java.util.List - getBList() { - return b_; - } - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public int getBCount() { - return b_.size(); - } - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public boolean getB(int index) { - return b_.getBoolean(index); - } - private int bMemoizedSerializedSize = -1; - - public static final int TYPE_FIELD_NUMBER = 6; - private java.util.List type_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.DataType> type_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>() { - public org.tensorflow.proto.framework.DataType convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(from); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - }; - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List getTypeList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>(type_, type_converter_); - } - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeCount() { - return type_.size(); - } - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public org.tensorflow.proto.framework.DataType getType(int index) { - return type_converter_.convert(type_.get(index)); - } - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List - getTypeValueList() { - return type_; - } - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeValue(int index) { - return type_.get(index); - } - private int typeMemoizedSerializedSize; - - public static final int SHAPE_FIELD_NUMBER = 7; - private java.util.List shape_; - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List getShapeList() { - return shape_; - } - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeOrBuilderList() { - return shape_; - } - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape(int index) { - return shape_.get(index); - } - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder( - int index) { - return shape_.get(index); - } - - public static final int TENSOR_FIELD_NUMBER = 8; - private java.util.List tensor_; - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List getTensorList() { - return tensor_; - } - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorOrBuilderList() { - return tensor_; - } - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public int getTensorCount() { - return tensor_.size(); - } - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto getTensor(int index) { - return tensor_.get(index); - } - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index) { - return tensor_.get(index); - } - - public static final int FUNC_FIELD_NUMBER = 9; - private java.util.List func_; - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List getFuncList() { - return func_; - } - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncOrBuilderList() { - return func_; - } - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public int getFuncCount() { - return func_.size(); - } - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrList getFunc(int index) { - return func_.get(index); - } - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder( - int index) { - return func_.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 { - getSerializedSize(); - for (int i = 0; i < s_.size(); i++) { - output.writeBytes(2, s_.get(i)); - } - if (getIList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(iMemoizedSerializedSize); - } - for (int i = 0; i < i_.size(); i++) { - output.writeInt64NoTag(i_.getLong(i)); - } - if (getFList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(fMemoizedSerializedSize); - } - for (int i = 0; i < f_.size(); i++) { - output.writeFloatNoTag(f_.getFloat(i)); - } - if (getBList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(bMemoizedSerializedSize); - } - for (int i = 0; i < b_.size(); i++) { - output.writeBoolNoTag(b_.getBoolean(i)); - } - if (getTypeList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(typeMemoizedSerializedSize); - } - for (int i = 0; i < type_.size(); i++) { - output.writeEnumNoTag(type_.get(i)); - } - for (int i = 0; i < shape_.size(); i++) { - output.writeMessage(7, shape_.get(i)); - } - for (int i = 0; i < tensor_.size(); i++) { - output.writeMessage(8, tensor_.get(i)); - } - for (int i = 0; i < func_.size(); i++) { - output.writeMessage(9, func_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < s_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(s_.get(i)); - } - size += dataSize; - size += 1 * getSList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < i_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(i_.getLong(i)); - } - size += dataSize; - if (!getIList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - iMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * getFList().size(); - size += dataSize; - if (!getFList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - fMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * getBList().size(); - size += dataSize; - if (!getBList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - bMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < type_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(type_.get(i)); - } - size += dataSize; - if (!getTypeList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }typeMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < shape_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, shape_.get(i)); - } - for (int i = 0; i < tensor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, tensor_.get(i)); - } - for (int i = 0; i < func_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, func_.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.AttrValue.ListValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AttrValue.ListValue other = (org.tensorflow.proto.framework.AttrValue.ListValue) obj; - - if (!getSList() - .equals(other.getSList())) return false; - if (!getIList() - .equals(other.getIList())) return false; - if (!getFList() - .equals(other.getFList())) return false; - if (!getBList() - .equals(other.getBList())) return false; - if (!type_.equals(other.type_)) return false; - if (!getShapeList() - .equals(other.getShapeList())) return false; - if (!getTensorList() - .equals(other.getTensorList())) return false; - if (!getFuncList() - .equals(other.getFuncList())) 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 (getSCount() > 0) { - hash = (37 * hash) + S_FIELD_NUMBER; - hash = (53 * hash) + getSList().hashCode(); - } - if (getICount() > 0) { - hash = (37 * hash) + I_FIELD_NUMBER; - hash = (53 * hash) + getIList().hashCode(); - } - if (getFCount() > 0) { - hash = (37 * hash) + F_FIELD_NUMBER; - hash = (53 * hash) + getFList().hashCode(); - } - if (getBCount() > 0) { - hash = (37 * hash) + B_FIELD_NUMBER; - hash = (53 * hash) + getBList().hashCode(); - } - if (getTypeCount() > 0) { - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_.hashCode(); - } - if (getShapeCount() > 0) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShapeList().hashCode(); - } - if (getTensorCount() > 0) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensorList().hashCode(); - } - if (getFuncCount() > 0) { - hash = (37 * hash) + FUNC_FIELD_NUMBER; - hash = (53 * hash) + getFuncList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AttrValue.ListValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue 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.AttrValue.ListValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue 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.AttrValue.ListValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue 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.AttrValue.ListValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue 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.AttrValue.ListValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue.ListValue 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.AttrValue.ListValue 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; - } - /** - *
    -     * LINT.IfChange
    -     * 
    - * - * Protobuf type {@code tensorflow.AttrValue.ListValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue.ListValue) - org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AttrValue.ListValue.class, org.tensorflow.proto.framework.AttrValue.ListValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AttrValue.ListValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getShapeFieldBuilder(); - getTensorFieldBuilder(); - getFuncFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - s_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - i_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - f_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000004); - b_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000008); - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - if (shapeBuilder_ == null) { - shape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - } else { - shapeBuilder_.clear(); - } - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - } else { - tensorBuilder_.clear(); - } - if (funcBuilder_ == null) { - func_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - } else { - funcBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue.ListValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue.ListValue build() { - org.tensorflow.proto.framework.AttrValue.ListValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue.ListValue buildPartial() { - org.tensorflow.proto.framework.AttrValue.ListValue result = new org.tensorflow.proto.framework.AttrValue.ListValue(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - s_ = java.util.Collections.unmodifiableList(s_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.s_ = s_; - if (((bitField0_ & 0x00000002) != 0)) { - i_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.i_ = i_; - if (((bitField0_ & 0x00000004) != 0)) { - f_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.f_ = f_; - if (((bitField0_ & 0x00000008) != 0)) { - b_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.b_ = b_; - if (((bitField0_ & 0x00000010) != 0)) { - type_ = java.util.Collections.unmodifiableList(type_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.type_ = type_; - if (shapeBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { - shape_ = java.util.Collections.unmodifiableList(shape_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - if (tensorBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.build(); - } - if (funcBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0)) { - func_ = java.util.Collections.unmodifiableList(func_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.func_ = func_; - } else { - result.func_ = funcBuilder_.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.AttrValue.ListValue) { - return mergeFrom((org.tensorflow.proto.framework.AttrValue.ListValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AttrValue.ListValue other) { - if (other == org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance()) return this; - if (!other.s_.isEmpty()) { - if (s_.isEmpty()) { - s_ = other.s_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSIsMutable(); - s_.addAll(other.s_); - } - onChanged(); - } - if (!other.i_.isEmpty()) { - if (i_.isEmpty()) { - i_ = other.i_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureIIsMutable(); - i_.addAll(other.i_); - } - onChanged(); - } - if (!other.f_.isEmpty()) { - if (f_.isEmpty()) { - f_ = other.f_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureFIsMutable(); - f_.addAll(other.f_); - } - onChanged(); - } - if (!other.b_.isEmpty()) { - if (b_.isEmpty()) { - b_ = other.b_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureBIsMutable(); - b_.addAll(other.b_); - } - onChanged(); - } - if (!other.type_.isEmpty()) { - if (type_.isEmpty()) { - type_ = other.type_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureTypeIsMutable(); - type_.addAll(other.type_); - } - onChanged(); - } - if (shapeBuilder_ == null) { - if (!other.shape_.isEmpty()) { - if (shape_.isEmpty()) { - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureShapeIsMutable(); - shape_.addAll(other.shape_); - } - onChanged(); - } - } else { - if (!other.shape_.isEmpty()) { - if (shapeBuilder_.isEmpty()) { - shapeBuilder_.dispose(); - shapeBuilder_ = null; - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000020); - shapeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getShapeFieldBuilder() : null; - } else { - shapeBuilder_.addAllMessages(other.shape_); - } - } - } - if (tensorBuilder_ == null) { - if (!other.tensor_.isEmpty()) { - if (tensor_.isEmpty()) { - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureTensorIsMutable(); - tensor_.addAll(other.tensor_); - } - onChanged(); - } - } else { - if (!other.tensor_.isEmpty()) { - if (tensorBuilder_.isEmpty()) { - tensorBuilder_.dispose(); - tensorBuilder_ = null; - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000040); - tensorBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorFieldBuilder() : null; - } else { - tensorBuilder_.addAllMessages(other.tensor_); - } - } - } - if (funcBuilder_ == null) { - if (!other.func_.isEmpty()) { - if (func_.isEmpty()) { - func_ = other.func_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureFuncIsMutable(); - func_.addAll(other.func_); - } - onChanged(); - } - } else { - if (!other.func_.isEmpty()) { - if (funcBuilder_.isEmpty()) { - funcBuilder_.dispose(); - funcBuilder_ = null; - func_ = other.func_; - bitField0_ = (bitField0_ & ~0x00000080); - funcBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFuncFieldBuilder() : null; - } else { - funcBuilder_.addAllMessages(other.func_); - } - } - } - 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.AttrValue.ListValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AttrValue.ListValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List s_ = java.util.Collections.emptyList(); - private void ensureSIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - s_ = new java.util.ArrayList(s_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public java.util.List - getSList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(s_) : s_; - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public int getSCount() { - return s_.size(); - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public com.google.protobuf.ByteString getS(int index) { - return s_.get(index); - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder setS( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSIsMutable(); - s_.set(index, value); - onChanged(); - return this; - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder addS(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSIsMutable(); - s_.add(value); - onChanged(); - return this; - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder addAllS( - java.lang.Iterable values) { - ensureSIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, s_); - onChanged(); - return this; - } - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder clearS() { - s_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList i_ = emptyLongList(); - private void ensureIIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - i_ = mutableCopy(i_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public java.util.List - getIList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(i_) : i_; - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public int getICount() { - return i_.size(); - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public long getI(int index) { - return i_.getLong(index); - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder setI( - int index, long value) { - ensureIIsMutable(); - i_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder addI(long value) { - ensureIIsMutable(); - i_.addLong(value); - onChanged(); - return this; - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder addAllI( - java.lang.Iterable values) { - ensureIIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, i_); - onChanged(); - return this; - } - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder clearI() { - i_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList f_ = emptyFloatList(); - private void ensureFIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - f_ = mutableCopy(f_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public java.util.List - getFList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(f_) : f_; - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public int getFCount() { - return f_.size(); - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public float getF(int index) { - return f_.getFloat(index); - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder setF( - int index, float value) { - ensureFIsMutable(); - f_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder addF(float value) { - ensureFIsMutable(); - f_.addFloat(value); - onChanged(); - return this; - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder addAllF( - java.lang.Iterable values) { - ensureFIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, f_); - onChanged(); - return this; - } - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder clearF() { - f_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.BooleanList b_ = emptyBooleanList(); - private void ensureBIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - b_ = mutableCopy(b_); - bitField0_ |= 0x00000008; - } - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public java.util.List - getBList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(b_) : b_; - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public int getBCount() { - return b_.size(); - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public boolean getB(int index) { - return b_.getBoolean(index); - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder setB( - int index, boolean value) { - ensureBIsMutable(); - b_.setBoolean(index, value); - onChanged(); - return this; - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder addB(boolean value) { - ensureBIsMutable(); - b_.addBoolean(value); - onChanged(); - return this; - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder addAllB( - java.lang.Iterable values) { - ensureBIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, b_); - onChanged(); - return this; - } - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder clearB() { - b_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - private java.util.List type_ = - java.util.Collections.emptyList(); - private void ensureTypeIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(type_); - bitField0_ |= 0x00000010; - } - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List getTypeList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.DataType>(type_, type_converter_); - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeCount() { - return type_.size(); - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public org.tensorflow.proto.framework.DataType getType(int index) { - return type_converter_.convert(type_.get(index)); - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder setType( - int index, org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.set(index, value.getNumber()); - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addType(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.add(value.getNumber()); - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addAllType( - java.lang.Iterable values) { - ensureTypeIsMutable(); - for (org.tensorflow.proto.framework.DataType value : values) { - type_.add(value.getNumber()); - } - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder clearType() { - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List - getTypeValueList() { - return java.util.Collections.unmodifiableList(type_); - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeValue(int index) { - return type_.get(index); - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder setTypeValue( - int index, int value) { - ensureTypeIsMutable(); - type_.set(index, value); - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addTypeValue(int value) { - ensureTypeIsMutable(); - type_.add(value); - onChanged(); - return this; - } - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addAllTypeValue( - java.lang.Iterable values) { - ensureTypeIsMutable(); - for (int value : values) { - type_.add(value); - } - onChanged(); - return this; - } - - private java.util.List shape_ = - java.util.Collections.emptyList(); - private void ensureShapeIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - shape_ = new java.util.ArrayList(shape_); - bitField0_ |= 0x00000020; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List getShapeList() { - if (shapeBuilder_ == null) { - return java.util.Collections.unmodifiableList(shape_); - } else { - return shapeBuilder_.getMessageList(); - } - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public int getShapeCount() { - if (shapeBuilder_ == null) { - return shape_.size(); - } else { - return shapeBuilder_.getCount(); - } - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape(int index) { - if (shapeBuilder_ == null) { - return shape_.get(index); - } else { - return shapeBuilder_.getMessage(index); - } - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - int index, org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.set(index, value); - onChanged(); - } else { - shapeBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - int index, org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.set(index, builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.add(value); - onChanged(); - } else { - shapeBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - int index, org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.add(index, value); - onChanged(); - } else { - shapeBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.add(builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - int index, org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.add(index, builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addAllShape( - java.lang.Iterable values) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, shape_); - onChanged(); - } else { - shapeBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - shapeBuilder_.clear(); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder removeShape(int index) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.remove(index); - onChanged(); - } else { - shapeBuilder_.remove(index); - } - return this; - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder( - int index) { - return getShapeFieldBuilder().getBuilder(index); - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder( - int index) { - if (shapeBuilder_ == null) { - return shape_.get(index); } else { - return shapeBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeOrBuilderList() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(shape_); - } - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder addShapeBuilder() { - return getShapeFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance()); - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder addShapeBuilder( - int index) { - return getShapeFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance()); - } - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeBuilderList() { - return getShapeFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - shape_, - ((bitField0_ & 0x00000020) != 0), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private java.util.List tensor_ = - java.util.Collections.emptyList(); - private void ensureTensorIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { - tensor_ = new java.util.ArrayList(tensor_); - bitField0_ |= 0x00000040; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorBuilder_; - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List getTensorList() { - if (tensorBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensor_); - } else { - return tensorBuilder_.getMessageList(); - } - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public int getTensorCount() { - if (tensorBuilder_ == null) { - return tensor_.size(); - } else { - return tensorBuilder_.getCount(); - } - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto getTensor(int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); - } else { - return tensorBuilder_.getMessage(index); - } - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.set(index, value); - onChanged(); - } else { - tensorBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(value); - onChanged(); - } else { - tensorBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(index, value); - onChanged(); - } else { - tensorBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addAllTensor( - java.lang.Iterable values) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensor_); - onChanged(); - } else { - tensorBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - } else { - tensorBuilder_.clear(); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder removeTensor(int index) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.remove(index); - onChanged(); - } else { - tensorBuilder_.remove(index); - } - return this; - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorBuilder( - int index) { - return getTensorFieldBuilder().getBuilder(index); - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder( - int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); } else { - return tensorBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorOrBuilderList() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensor_); - } - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorBuilder() { - return getTensorFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorBuilder( - int index) { - return getTensorFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorBuilderList() { - return getTensorFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - tensor_, - ((bitField0_ & 0x00000040) != 0), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - - private java.util.List func_ = - java.util.Collections.emptyList(); - private void ensureFuncIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { - func_ = new java.util.ArrayList(func_); - bitField0_ |= 0x00000080; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder> funcBuilder_; - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List getFuncList() { - if (funcBuilder_ == null) { - return java.util.Collections.unmodifiableList(func_); - } else { - return funcBuilder_.getMessageList(); - } - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public int getFuncCount() { - if (funcBuilder_ == null) { - return func_.size(); - } else { - return funcBuilder_.getCount(); - } - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrList getFunc(int index) { - if (funcBuilder_ == null) { - return func_.get(index); - } else { - return funcBuilder_.getMessage(index); - } - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder setFunc( - int index, org.tensorflow.proto.framework.NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.set(index, value); - onChanged(); - } else { - funcBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder setFunc( - int index, org.tensorflow.proto.framework.NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.set(index, builderForValue.build()); - onChanged(); - } else { - funcBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc(org.tensorflow.proto.framework.NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.add(value); - onChanged(); - } else { - funcBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - int index, org.tensorflow.proto.framework.NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.add(index, value); - onChanged(); - } else { - funcBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - org.tensorflow.proto.framework.NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.add(builderForValue.build()); - onChanged(); - } else { - funcBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - int index, org.tensorflow.proto.framework.NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.add(index, builderForValue.build()); - onChanged(); - } else { - funcBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addAllFunc( - java.lang.Iterable values) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, func_); - onChanged(); - } else { - funcBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder clearFunc() { - if (funcBuilder_ == null) { - func_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - } else { - funcBuilder_.clear(); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder removeFunc(int index) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.remove(index); - onChanged(); - } else { - funcBuilder_.remove(index); - } - return this; - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrList.Builder getFuncBuilder( - int index) { - return getFuncFieldBuilder().getBuilder(index); - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder( - int index) { - if (funcBuilder_ == null) { - return func_.get(index); } else { - return funcBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncOrBuilderList() { - if (funcBuilder_ != null) { - return funcBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(func_); - } - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrList.Builder addFuncBuilder() { - return getFuncFieldBuilder().addBuilder( - org.tensorflow.proto.framework.NameAttrList.getDefaultInstance()); - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public org.tensorflow.proto.framework.NameAttrList.Builder addFuncBuilder( - int index) { - return getFuncFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.NameAttrList.getDefaultInstance()); - } - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncBuilderList() { - return getFuncFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder> - getFuncFieldBuilder() { - if (funcBuilder_ == null) { - funcBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder>( - func_, - ((bitField0_ & 0x00000080) != 0), - getParentForChildren(), - isClean()); - func_ = null; - } - return funcBuilder_; - } - @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.AttrValue.ListValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AttrValue.ListValue) - private static final org.tensorflow.proto.framework.AttrValue.ListValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AttrValue.ListValue(); - } - - public static org.tensorflow.proto.framework.AttrValue.ListValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListValue(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.AttrValue.ListValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite { - S(2), - I(3), - F(4), - B(5), - TYPE(6), - SHAPE(7), - TENSOR(8), - LIST(1), - FUNC(10), - PLACEHOLDER(9), - VALUE_NOT_SET(0); - private final int value; - private ValueCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 2: return S; - case 3: return I; - case 4: return F; - case 5: return B; - case 6: return TYPE; - case 7: return SHAPE; - case 8: return TENSOR; - case 1: return LIST; - case 10: return FUNC; - case 9: return PLACEHOLDER; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int S_FIELD_NUMBER = 2; - /** - *
    -   * "string"
    -   * 
    - * - * bytes s = 2; - */ - public com.google.protobuf.ByteString getS() { - if (valueCase_ == 2) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int I_FIELD_NUMBER = 3; - /** - *
    -   * "int"
    -   * 
    - * - * int64 i = 3; - */ - public long getI() { - if (valueCase_ == 3) { - return (java.lang.Long) value_; - } - return 0L; - } - - public static final int F_FIELD_NUMBER = 4; - /** - *
    -   * "float"
    -   * 
    - * - * float f = 4; - */ - public float getF() { - if (valueCase_ == 4) { - return (java.lang.Float) value_; - } - return 0F; - } - - public static final int B_FIELD_NUMBER = 5; - /** - *
    -   * "bool"
    -   * 
    - * - * bool b = 5; - */ - public boolean getB() { - if (valueCase_ == 5) { - return (java.lang.Boolean) value_; - } - return false; - } - - public static final int TYPE_FIELD_NUMBER = 6; - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - public int getTypeValue() { - if (valueCase_ == 6) { - return (java.lang.Integer) value_; - } - return 0; - } - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - public org.tensorflow.proto.framework.DataType getType() { - if (valueCase_ == 6) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf( - (java.lang.Integer) value_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - return org.tensorflow.proto.framework.DataType.DT_INVALID; - } - - public static final int SHAPE_FIELD_NUMBER = 7; - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public boolean hasShape() { - return valueCase_ == 7; - } - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (valueCase_ == 7) { - return (org.tensorflow.proto.framework.TensorShapeProto) value_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (valueCase_ == 7) { - return (org.tensorflow.proto.framework.TensorShapeProto) value_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - - public static final int TENSOR_FIELD_NUMBER = 8; - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public boolean hasTensor() { - return valueCase_ == 8; - } - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto getTensor() { - if (valueCase_ == 8) { - return (org.tensorflow.proto.framework.TensorProto) value_; - } - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder() { - if (valueCase_ == 8) { - return (org.tensorflow.proto.framework.TensorProto) value_; - } - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - - public static final int LIST_FIELD_NUMBER = 1; - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public boolean hasList() { - return valueCase_ == 1; - } - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public org.tensorflow.proto.framework.AttrValue.ListValue getList() { - if (valueCase_ == 1) { - return (org.tensorflow.proto.framework.AttrValue.ListValue) value_; - } - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder getListOrBuilder() { - if (valueCase_ == 1) { - return (org.tensorflow.proto.framework.AttrValue.ListValue) value_; - } - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - - public static final int FUNC_FIELD_NUMBER = 10; - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public boolean hasFunc() { - return valueCase_ == 10; - } - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public org.tensorflow.proto.framework.NameAttrList getFunc() { - if (valueCase_ == 10) { - return (org.tensorflow.proto.framework.NameAttrList) value_; - } - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder() { - if (valueCase_ == 10) { - return (org.tensorflow.proto.framework.NameAttrList) value_; - } - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - - public static final int PLACEHOLDER_FIELD_NUMBER = 9; - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - public java.lang.String getPlaceholder() { - java.lang.Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - 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(); - if (valueCase_ == 9) { - value_ = s; - } - return s; - } - } - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - public com.google.protobuf.ByteString - getPlaceholderBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 9) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (valueCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.framework.AttrValue.ListValue) value_); - } - if (valueCase_ == 2) { - output.writeBytes( - 2, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 3) { - output.writeInt64( - 3, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 4) { - output.writeFloat( - 4, (float)((java.lang.Float) value_)); - } - if (valueCase_ == 5) { - output.writeBool( - 5, (boolean)((java.lang.Boolean) value_)); - } - if (valueCase_ == 6) { - output.writeEnum(6, ((java.lang.Integer) value_)); - } - if (valueCase_ == 7) { - output.writeMessage(7, (org.tensorflow.proto.framework.TensorShapeProto) value_); - } - if (valueCase_ == 8) { - output.writeMessage(8, (org.tensorflow.proto.framework.TensorProto) value_); - } - if (valueCase_ == 9) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, value_); - } - if (valueCase_ == 10) { - output.writeMessage(10, (org.tensorflow.proto.framework.NameAttrList) value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (valueCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.framework.AttrValue.ListValue) value_); - } - if (valueCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 2, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 3, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize( - 4, (float)((java.lang.Float) value_)); - } - if (valueCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 5, (boolean)((java.lang.Boolean) value_)); - } - if (valueCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, ((java.lang.Integer) value_)); - } - if (valueCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (org.tensorflow.proto.framework.TensorShapeProto) value_); - } - if (valueCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (org.tensorflow.proto.framework.TensorProto) value_); - } - if (valueCase_ == 9) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, value_); - } - if (valueCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (org.tensorflow.proto.framework.NameAttrList) value_); - } - 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.AttrValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AttrValue other = (org.tensorflow.proto.framework.AttrValue) obj; - - if (!getValueCase().equals(other.getValueCase())) return false; - switch (valueCase_) { - case 2: - if (!getS() - .equals(other.getS())) return false; - break; - case 3: - if (getI() - != other.getI()) return false; - break; - case 4: - if (java.lang.Float.floatToIntBits(getF()) - != java.lang.Float.floatToIntBits( - other.getF())) return false; - break; - case 5: - if (getB() - != other.getB()) return false; - break; - case 6: - if (getTypeValue() - != other.getTypeValue()) return false; - break; - case 7: - if (!getShape() - .equals(other.getShape())) return false; - break; - case 8: - if (!getTensor() - .equals(other.getTensor())) return false; - break; - case 1: - if (!getList() - .equals(other.getList())) return false; - break; - case 10: - if (!getFunc() - .equals(other.getFunc())) return false; - break; - case 9: - if (!getPlaceholder() - .equals(other.getPlaceholder())) return false; - break; - case 0: - default: - } - 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(); - switch (valueCase_) { - case 2: - hash = (37 * hash) + S_FIELD_NUMBER; - hash = (53 * hash) + getS().hashCode(); - break; - case 3: - hash = (37 * hash) + I_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getI()); - break; - case 4: - hash = (37 * hash) + F_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getF()); - break; - case 5: - hash = (37 * hash) + B_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getB()); - break; - case 6: - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getTypeValue(); - break; - case 7: - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - break; - case 8: - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensor().hashCode(); - break; - case 1: - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getList().hashCode(); - break; - case 10: - hash = (37 * hash) + FUNC_FIELD_NUMBER; - hash = (53 * hash) + getFunc().hashCode(); - break; - case 9: - hash = (37 * hash) + PLACEHOLDER_FIELD_NUMBER; - hash = (53 * hash) + getPlaceholder().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AttrValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue 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.AttrValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue 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.AttrValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AttrValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AttrValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue 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.AttrValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue 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.AttrValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AttrValue 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.AttrValue 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; - } - /** - *
    -   * Protocol buffer representing the value for an attr used to configure an Op.
    -   * Comment indicates the corresponding attr type.  Only the field matching the
    -   * attr type may be filled.
    -   * 
    - * - * Protobuf type {@code tensorflow.AttrValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue) - org.tensorflow.proto.framework.AttrValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AttrValue.class, org.tensorflow.proto.framework.AttrValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AttrValue.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(); - valueCase_ = 0; - value_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AttrValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue build() { - org.tensorflow.proto.framework.AttrValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AttrValue buildPartial() { - org.tensorflow.proto.framework.AttrValue result = new org.tensorflow.proto.framework.AttrValue(this); - if (valueCase_ == 2) { - result.value_ = value_; - } - if (valueCase_ == 3) { - result.value_ = value_; - } - if (valueCase_ == 4) { - result.value_ = value_; - } - if (valueCase_ == 5) { - result.value_ = value_; - } - if (valueCase_ == 6) { - result.value_ = value_; - } - if (valueCase_ == 7) { - if (shapeBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = shapeBuilder_.build(); - } - } - if (valueCase_ == 8) { - if (tensorBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = tensorBuilder_.build(); - } - } - if (valueCase_ == 1) { - if (listBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = listBuilder_.build(); - } - } - if (valueCase_ == 10) { - if (funcBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = funcBuilder_.build(); - } - } - if (valueCase_ == 9) { - result.value_ = value_; - } - result.valueCase_ = valueCase_; - 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.AttrValue) { - return mergeFrom((org.tensorflow.proto.framework.AttrValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AttrValue other) { - if (other == org.tensorflow.proto.framework.AttrValue.getDefaultInstance()) return this; - switch (other.getValueCase()) { - case S: { - setS(other.getS()); - break; - } - case I: { - setI(other.getI()); - break; - } - case F: { - setF(other.getF()); - break; - } - case B: { - setB(other.getB()); - break; - } - case TYPE: { - setTypeValue(other.getTypeValue()); - break; - } - case SHAPE: { - mergeShape(other.getShape()); - break; - } - case TENSOR: { - mergeTensor(other.getTensor()); - break; - } - case LIST: { - mergeList(other.getList()); - break; - } - case FUNC: { - mergeFunc(other.getFunc()); - break; - } - case PLACEHOLDER: { - valueCase_ = 9; - value_ = other.value_; - onChanged(); - break; - } - case VALUE_NOT_SET: { - break; - } - } - 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.AttrValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AttrValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int valueCase_ = 0; - private java.lang.Object value_; - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public com.google.protobuf.ByteString getS() { - if (valueCase_ == 2) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public Builder setS(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 2; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public Builder clearS() { - if (valueCase_ == 2) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public long getI() { - if (valueCase_ == 3) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public Builder setI(long value) { - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public Builder clearI() { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public float getF() { - if (valueCase_ == 4) { - return (java.lang.Float) value_; - } - return 0F; - } - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public Builder setF(float value) { - valueCase_ = 4; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public Builder clearF() { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public boolean getB() { - if (valueCase_ == 5) { - return (java.lang.Boolean) value_; - } - return false; - } - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public Builder setB(boolean value) { - valueCase_ = 5; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public Builder clearB() { - if (valueCase_ == 5) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public int getTypeValue() { - if (valueCase_ == 6) { - return ((java.lang.Integer) value_).intValue(); - } - return 0; - } - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder setTypeValue(int value) { - valueCase_ = 6; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public org.tensorflow.proto.framework.DataType getType() { - if (valueCase_ == 6) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf( - (java.lang.Integer) value_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - return org.tensorflow.proto.framework.DataType.DT_INVALID; - } - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder setType(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 6; - value_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder clearType() { - if (valueCase_ == 6) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public boolean hasShape() { - return valueCase_ == 7; - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - if (valueCase_ == 7) { - return (org.tensorflow.proto.framework.TensorShapeProto) value_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } else { - if (valueCase_ == 7) { - return shapeBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 7; - return this; - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (valueCase_ == 7 && - value_ != org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance()) { - value_ = org.tensorflow.proto.framework.TensorShapeProto.newBuilder((org.tensorflow.proto.framework.TensorShapeProto) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 7) { - shapeBuilder_.mergeFrom(value); - } - shapeBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - } - shapeBuilder_.clear(); - } - return this; - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - return getShapeFieldBuilder().getBuilder(); - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if ((valueCase_ == 7) && (shapeBuilder_ != null)) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 7) { - return (org.tensorflow.proto.framework.TensorShapeProto) value_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - } - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - if (!(valueCase_ == 7)) { - value_ = org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - (org.tensorflow.proto.framework.TensorShapeProto) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 7; - onChanged();; - return shapeBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorBuilder_; - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public boolean hasTensor() { - return valueCase_ == 8; - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto getTensor() { - if (tensorBuilder_ == null) { - if (valueCase_ == 8) { - return (org.tensorflow.proto.framework.TensorProto) value_; - } - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } else { - if (valueCase_ == 8) { - return tensorBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - tensorBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - tensorBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 8; - return this; - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder mergeTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (valueCase_ == 8 && - value_ != org.tensorflow.proto.framework.TensorProto.getDefaultInstance()) { - value_ = org.tensorflow.proto.framework.TensorProto.newBuilder((org.tensorflow.proto.framework.TensorProto) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 8) { - tensorBuilder_.mergeFrom(value); - } - tensorBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - } - tensorBuilder_.clear(); - } - return this; - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorBuilder() { - return getTensorFieldBuilder().getBuilder(); - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder() { - if ((valueCase_ == 8) && (tensorBuilder_ != null)) { - return tensorBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 8) { - return (org.tensorflow.proto.framework.TensorProto) value_; - } - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - } - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - if (!(valueCase_ == 8)) { - value_ = org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - (org.tensorflow.proto.framework.TensorProto) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 8; - onChanged();; - return tensorBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue.ListValue, org.tensorflow.proto.framework.AttrValue.ListValue.Builder, org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder> listBuilder_; - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public boolean hasList() { - return valueCase_ == 1; - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public org.tensorflow.proto.framework.AttrValue.ListValue getList() { - if (listBuilder_ == null) { - if (valueCase_ == 1) { - return (org.tensorflow.proto.framework.AttrValue.ListValue) value_; - } - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } else { - if (valueCase_ == 1) { - return listBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder setList(org.tensorflow.proto.framework.AttrValue.ListValue value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - listBuilder_.setMessage(value); - } - valueCase_ = 1; - return this; - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder setList( - org.tensorflow.proto.framework.AttrValue.ListValue.Builder builderForValue) { - if (listBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - listBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 1; - return this; - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder mergeList(org.tensorflow.proto.framework.AttrValue.ListValue value) { - if (listBuilder_ == null) { - if (valueCase_ == 1 && - value_ != org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance()) { - value_ = org.tensorflow.proto.framework.AttrValue.ListValue.newBuilder((org.tensorflow.proto.framework.AttrValue.ListValue) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 1) { - listBuilder_.mergeFrom(value); - } - listBuilder_.setMessage(value); - } - valueCase_ = 1; - return this; - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder clearList() { - if (listBuilder_ == null) { - if (valueCase_ == 1) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 1) { - valueCase_ = 0; - value_ = null; - } - listBuilder_.clear(); - } - return this; - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public org.tensorflow.proto.framework.AttrValue.ListValue.Builder getListBuilder() { - return getListFieldBuilder().getBuilder(); - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder getListOrBuilder() { - if ((valueCase_ == 1) && (listBuilder_ != null)) { - return listBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 1) { - return (org.tensorflow.proto.framework.AttrValue.ListValue) value_; - } - return org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - } - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue.ListValue, org.tensorflow.proto.framework.AttrValue.ListValue.Builder, org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - if (!(valueCase_ == 1)) { - value_ = org.tensorflow.proto.framework.AttrValue.ListValue.getDefaultInstance(); - } - listBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue.ListValue, org.tensorflow.proto.framework.AttrValue.ListValue.Builder, org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder>( - (org.tensorflow.proto.framework.AttrValue.ListValue) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 1; - onChanged();; - return listBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder> funcBuilder_; - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public boolean hasFunc() { - return valueCase_ == 10; - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public org.tensorflow.proto.framework.NameAttrList getFunc() { - if (funcBuilder_ == null) { - if (valueCase_ == 10) { - return (org.tensorflow.proto.framework.NameAttrList) value_; - } - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } else { - if (valueCase_ == 10) { - return funcBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder setFunc(org.tensorflow.proto.framework.NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - funcBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder setFunc( - org.tensorflow.proto.framework.NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - funcBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 10; - return this; - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder mergeFunc(org.tensorflow.proto.framework.NameAttrList value) { - if (funcBuilder_ == null) { - if (valueCase_ == 10 && - value_ != org.tensorflow.proto.framework.NameAttrList.getDefaultInstance()) { - value_ = org.tensorflow.proto.framework.NameAttrList.newBuilder((org.tensorflow.proto.framework.NameAttrList) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 10) { - funcBuilder_.mergeFrom(value); - } - funcBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder clearFunc() { - if (funcBuilder_ == null) { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - } - funcBuilder_.clear(); - } - return this; - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public org.tensorflow.proto.framework.NameAttrList.Builder getFuncBuilder() { - return getFuncFieldBuilder().getBuilder(); - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder() { - if ((valueCase_ == 10) && (funcBuilder_ != null)) { - return funcBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 10) { - return (org.tensorflow.proto.framework.NameAttrList) value_; - } - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - } - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder> - getFuncFieldBuilder() { - if (funcBuilder_ == null) { - if (!(valueCase_ == 10)) { - value_ = org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - funcBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NameAttrList, org.tensorflow.proto.framework.NameAttrList.Builder, org.tensorflow.proto.framework.NameAttrListOrBuilder>( - (org.tensorflow.proto.framework.NameAttrList) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 10; - onChanged();; - return funcBuilder_; - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public java.lang.String getPlaceholder() { - java.lang.Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 9) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public com.google.protobuf.ByteString - getPlaceholderBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 9) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder setPlaceholder( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 9; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder clearPlaceholder() { - if (valueCase_ == 9) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder setPlaceholderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - valueCase_ = 9; - value_ = value; - 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.AttrValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AttrValue) - private static final org.tensorflow.proto.framework.AttrValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AttrValue(); - } - - public static org.tensorflow.proto.framework.AttrValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AttrValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttrValue(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.AttrValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java deleted file mode 100644 index f2624691edf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java +++ /dev/null @@ -1,203 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public interface AttrValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * "string"
    -   * 
    - * - * bytes s = 2; - */ - com.google.protobuf.ByteString getS(); - - /** - *
    -   * "int"
    -   * 
    - * - * int64 i = 3; - */ - long getI(); - - /** - *
    -   * "float"
    -   * 
    - * - * float f = 4; - */ - float getF(); - - /** - *
    -   * "bool"
    -   * 
    - * - * bool b = 5; - */ - boolean getB(); - - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - int getTypeValue(); - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - org.tensorflow.proto.framework.DataType getType(); - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - boolean hasShape(); - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - boolean hasTensor(); - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - org.tensorflow.proto.framework.TensorProto getTensor(); - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder(); - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - boolean hasList(); - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - org.tensorflow.proto.framework.AttrValue.ListValue getList(); - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - org.tensorflow.proto.framework.AttrValue.ListValueOrBuilder getListOrBuilder(); - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - boolean hasFunc(); - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - org.tensorflow.proto.framework.NameAttrList getFunc(); - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - org.tensorflow.proto.framework.NameAttrListOrBuilder getFuncOrBuilder(); - - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - java.lang.String getPlaceholder(); - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - com.google.protobuf.ByteString - getPlaceholderBytes(); - - public org.tensorflow.proto.framework.AttrValue.ValueCase getValueCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueProtos.java deleted file mode 100644 index 2df18dbc3d0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AttrValueProtos.java +++ /dev/null @@ -1,110 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public final class AttrValueProtos { - private AttrValueProtos() {} - 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_AttrValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AttrValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_AttrValue_ListValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NameAttrList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NameAttrList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NameAttrList_AttrEntry_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/framework/attr_value.p" + - "roto\022\ntensorflow\032&tensorflow/core/framew" + - "ork/tensor.proto\032,tensorflow/core/framew" + - "ork/tensor_shape.proto\032%tensorflow/core/" + - "framework/types.proto\"\246\004\n\tAttrValue\022\013\n\001s" + - "\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030" + - "\005 \001(\010H\000\022$\n\004type\030\006 \001(\0162\024.tensorflow.DataT" + - "ypeH\000\022-\n\005shape\030\007 \001(\0132\034.tensorflow.Tensor" + - "ShapeProtoH\000\022)\n\006tensor\030\010 \001(\0132\027.tensorflo" + - "w.TensorProtoH\000\022/\n\004list\030\001 \001(\0132\037.tensorfl" + - "ow.AttrValue.ListValueH\000\022(\n\004func\030\n \001(\0132\030" + - ".tensorflow.NameAttrListH\000\022\025\n\013placeholde" + - "r\030\t \001(\tH\000\032\351\001\n\tListValue\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030" + - "\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022" + - "&\n\004type\030\006 \003(\0162\024.tensorflow.DataTypeB\002\020\001\022" + - "+\n\005shape\030\007 \003(\0132\034.tensorflow.TensorShapeP" + - "roto\022\'\n\006tensor\030\010 \003(\0132\027.tensorflow.Tensor" + - "Proto\022&\n\004func\030\t \003(\0132\030.tensorflow.NameAtt" + - "rListB\007\n\005value\"\222\001\n\014NameAttrList\022\014\n\004name\030" + - "\001 \001(\t\0220\n\004attr\030\002 \003(\0132\".tensorflow.NameAtt" + - "rList.AttrEntry\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(" + - "\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrValue:" + - "\0028\001B\211\001\n\036org.tensorflow.proto.frameworkB\017" + - "AttrValueProtosP\001ZQgithub.com/tensorflow" + - "/tensorflow/tensorflow/go/core/framework" + - "/attr_value_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_AttrValue_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_AttrValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AttrValue_descriptor, - new java.lang.String[] { "S", "I", "F", "B", "Type", "Shape", "Tensor", "List", "Func", "Placeholder", "Value", }); - internal_static_tensorflow_AttrValue_ListValue_descriptor = - internal_static_tensorflow_AttrValue_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AttrValue_ListValue_descriptor, - new java.lang.String[] { "S", "I", "F", "B", "Type", "Shape", "Tensor", "Func", }); - internal_static_tensorflow_NameAttrList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_NameAttrList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NameAttrList_descriptor, - new java.lang.String[] { "Name", "Attr", }); - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor = - internal_static_tensorflow_NameAttrList_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_NameAttrList_AttrEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptions.java deleted file mode 100644 index cbb6bde48fe..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptions.java +++ /dev/null @@ -1,534 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.AutoParallelOptions} - */ -public final class AutoParallelOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AutoParallelOptions) - AutoParallelOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use AutoParallelOptions.newBuilder() to construct. - private AutoParallelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AutoParallelOptions() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AutoParallelOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AutoParallelOptions( - 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: { - - enable_ = input.readBool(); - break; - } - case 16: { - - numReplicas_ = input.readInt32(); - 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.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AutoParallelOptions.class, org.tensorflow.proto.framework.AutoParallelOptions.Builder.class); - } - - public static final int ENABLE_FIELD_NUMBER = 1; - private boolean enable_; - /** - * bool enable = 1; - */ - public boolean getEnable() { - return enable_; - } - - public static final int NUM_REPLICAS_FIELD_NUMBER = 2; - private int numReplicas_; - /** - * int32 num_replicas = 2; - */ - public int getNumReplicas() { - return numReplicas_; - } - - 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 (enable_ != false) { - output.writeBool(1, enable_); - } - if (numReplicas_ != 0) { - output.writeInt32(2, numReplicas_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enable_); - } - if (numReplicas_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, numReplicas_); - } - 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.AutoParallelOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.AutoParallelOptions other = (org.tensorflow.proto.framework.AutoParallelOptions) obj; - - if (getEnable() - != other.getEnable()) return false; - if (getNumReplicas() - != other.getNumReplicas()) 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) + ENABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnable()); - hash = (37 * hash) + NUM_REPLICAS_FIELD_NUMBER; - hash = (53 * hash) + getNumReplicas(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.AutoParallelOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AutoParallelOptions 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.AutoParallelOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AutoParallelOptions 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.AutoParallelOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.AutoParallelOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.AutoParallelOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AutoParallelOptions 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.AutoParallelOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AutoParallelOptions 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.AutoParallelOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.AutoParallelOptions 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.AutoParallelOptions 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.AutoParallelOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AutoParallelOptions) - org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.AutoParallelOptions.class, org.tensorflow.proto.framework.AutoParallelOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AutoParallelOptions.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(); - enable_ = false; - - numReplicas_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AutoParallelOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.AutoParallelOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.AutoParallelOptions build() { - org.tensorflow.proto.framework.AutoParallelOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.AutoParallelOptions buildPartial() { - org.tensorflow.proto.framework.AutoParallelOptions result = new org.tensorflow.proto.framework.AutoParallelOptions(this); - result.enable_ = enable_; - result.numReplicas_ = numReplicas_; - 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.AutoParallelOptions) { - return mergeFrom((org.tensorflow.proto.framework.AutoParallelOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.AutoParallelOptions other) { - if (other == org.tensorflow.proto.framework.AutoParallelOptions.getDefaultInstance()) return this; - if (other.getEnable() != false) { - setEnable(other.getEnable()); - } - if (other.getNumReplicas() != 0) { - setNumReplicas(other.getNumReplicas()); - } - 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.AutoParallelOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.AutoParallelOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enable_ ; - /** - * bool enable = 1; - */ - public boolean getEnable() { - return enable_; - } - /** - * bool enable = 1; - */ - public Builder setEnable(boolean value) { - - enable_ = value; - onChanged(); - return this; - } - /** - * bool enable = 1; - */ - public Builder clearEnable() { - - enable_ = false; - onChanged(); - return this; - } - - private int numReplicas_ ; - /** - * int32 num_replicas = 2; - */ - public int getNumReplicas() { - return numReplicas_; - } - /** - * int32 num_replicas = 2; - */ - public Builder setNumReplicas(int value) { - - numReplicas_ = value; - onChanged(); - return this; - } - /** - * int32 num_replicas = 2; - */ - public Builder clearNumReplicas() { - - numReplicas_ = 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.AutoParallelOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AutoParallelOptions) - private static final org.tensorflow.proto.framework.AutoParallelOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.AutoParallelOptions(); - } - - public static org.tensorflow.proto.framework.AutoParallelOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AutoParallelOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AutoParallelOptions(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.AutoParallelOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptionsOrBuilder.java deleted file mode 100644 index 0b954c6477c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AutoParallelOptionsOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -public interface AutoParallelOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.AutoParallelOptions) - com.google.protobuf.MessageOrBuilder { - - /** - * bool enable = 1; - */ - boolean getEnable(); - - /** - * int32 num_replicas = 2; - */ - int getNumReplicas(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProto.java deleted file mode 100644 index 2c21852a18c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProto.java +++ /dev/null @@ -1,1182 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A protobuf to represent tf.BoundedTensorSpec.
    - * 
    - * - * Protobuf type {@code tensorflow.BoundedTensorSpecProto} - */ -public final class BoundedTensorSpecProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BoundedTensorSpecProto) - BoundedTensorSpecProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use BoundedTensorSpecProto.newBuilder() to construct. - private BoundedTensorSpecProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BoundedTensorSpecProto() { - name_ = ""; - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BoundedTensorSpecProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BoundedTensorSpecProto( - 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 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 34: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (minimum_ != null) { - subBuilder = minimum_.toBuilder(); - } - minimum_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(minimum_); - minimum_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (maximum_ != null) { - subBuilder = maximum_.toBuilder(); - } - maximum_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(maximum_); - maximum_ = subBuilder.buildPartial(); - } - - 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.StructProtos.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.BoundedTensorSpecProto.class, org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int DTYPE_FIELD_NUMBER = 3; - private int dtype_; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int MINIMUM_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.TensorProto minimum_; - /** - * .tensorflow.TensorProto minimum = 4; - */ - public boolean hasMinimum() { - return minimum_ != null; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public org.tensorflow.proto.framework.TensorProto getMinimum() { - return minimum_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : minimum_; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getMinimumOrBuilder() { - return getMinimum(); - } - - public static final int MAXIMUM_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.TensorProto maximum_; - /** - * .tensorflow.TensorProto maximum = 5; - */ - public boolean hasMaximum() { - return maximum_ != null; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public org.tensorflow.proto.framework.TensorProto getMaximum() { - return maximum_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : maximum_; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getMaximumOrBuilder() { - return getMaximum(); - } - - 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 (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, dtype_); - } - if (minimum_ != null) { - output.writeMessage(4, getMinimum()); - } - if (maximum_ != null) { - output.writeMessage(5, getMaximum()); - } - 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 (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, dtype_); - } - if (minimum_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getMinimum()); - } - if (maximum_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getMaximum()); - } - 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.BoundedTensorSpecProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.BoundedTensorSpecProto other = (org.tensorflow.proto.framework.BoundedTensorSpecProto) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (dtype_ != other.dtype_) return false; - if (hasMinimum() != other.hasMinimum()) return false; - if (hasMinimum()) { - if (!getMinimum() - .equals(other.getMinimum())) return false; - } - if (hasMaximum() != other.hasMaximum()) return false; - if (hasMaximum()) { - if (!getMaximum() - .equals(other.getMaximum())) 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(); - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasMinimum()) { - hash = (37 * hash) + MINIMUM_FIELD_NUMBER; - hash = (53 * hash) + getMinimum().hashCode(); - } - if (hasMaximum()) { - hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; - hash = (53 * hash) + getMaximum().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.BoundedTensorSpecProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto 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.BoundedTensorSpecProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto 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.BoundedTensorSpecProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto 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.BoundedTensorSpecProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto 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.BoundedTensorSpecProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.BoundedTensorSpecProto 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.BoundedTensorSpecProto 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 protobuf to represent tf.BoundedTensorSpec.
    -   * 
    - * - * Protobuf type {@code tensorflow.BoundedTensorSpecProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BoundedTensorSpecProto) - org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.BoundedTensorSpecProto.class, org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.BoundedTensorSpecProto.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_ = ""; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - dtype_ = 0; - - if (minimumBuilder_ == null) { - minimum_ = null; - } else { - minimum_ = null; - minimumBuilder_ = null; - } - if (maximumBuilder_ == null) { - maximum_ = null; - } else { - maximum_ = null; - maximumBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.BoundedTensorSpecProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.BoundedTensorSpecProto build() { - org.tensorflow.proto.framework.BoundedTensorSpecProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.BoundedTensorSpecProto buildPartial() { - org.tensorflow.proto.framework.BoundedTensorSpecProto result = new org.tensorflow.proto.framework.BoundedTensorSpecProto(this); - result.name_ = name_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.dtype_ = dtype_; - if (minimumBuilder_ == null) { - result.minimum_ = minimum_; - } else { - result.minimum_ = minimumBuilder_.build(); - } - if (maximumBuilder_ == null) { - result.maximum_ = maximum_; - } else { - result.maximum_ = maximumBuilder_.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.BoundedTensorSpecProto) { - return mergeFrom((org.tensorflow.proto.framework.BoundedTensorSpecProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.BoundedTensorSpecProto other) { - if (other == org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasMinimum()) { - mergeMinimum(other.getMinimum()); - } - if (other.hasMaximum()) { - mergeMaximum(other.getMaximum()); - } - 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.BoundedTensorSpecProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.BoundedTensorSpecProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorProto minimum_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> minimumBuilder_; - /** - * .tensorflow.TensorProto minimum = 4; - */ - public boolean hasMinimum() { - return minimumBuilder_ != null || minimum_ != null; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public org.tensorflow.proto.framework.TensorProto getMinimum() { - if (minimumBuilder_ == null) { - return minimum_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : minimum_; - } else { - return minimumBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public Builder setMinimum(org.tensorflow.proto.framework.TensorProto value) { - if (minimumBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - minimum_ = value; - onChanged(); - } else { - minimumBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public Builder setMinimum( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (minimumBuilder_ == null) { - minimum_ = builderForValue.build(); - onChanged(); - } else { - minimumBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public Builder mergeMinimum(org.tensorflow.proto.framework.TensorProto value) { - if (minimumBuilder_ == null) { - if (minimum_ != null) { - minimum_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(minimum_).mergeFrom(value).buildPartial(); - } else { - minimum_ = value; - } - onChanged(); - } else { - minimumBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public Builder clearMinimum() { - if (minimumBuilder_ == null) { - minimum_ = null; - onChanged(); - } else { - minimum_ = null; - minimumBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getMinimumBuilder() { - - onChanged(); - return getMinimumFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getMinimumOrBuilder() { - if (minimumBuilder_ != null) { - return minimumBuilder_.getMessageOrBuilder(); - } else { - return minimum_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : minimum_; - } - } - /** - * .tensorflow.TensorProto minimum = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getMinimumFieldBuilder() { - if (minimumBuilder_ == null) { - minimumBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getMinimum(), - getParentForChildren(), - isClean()); - minimum_ = null; - } - return minimumBuilder_; - } - - private org.tensorflow.proto.framework.TensorProto maximum_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> maximumBuilder_; - /** - * .tensorflow.TensorProto maximum = 5; - */ - public boolean hasMaximum() { - return maximumBuilder_ != null || maximum_ != null; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public org.tensorflow.proto.framework.TensorProto getMaximum() { - if (maximumBuilder_ == null) { - return maximum_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : maximum_; - } else { - return maximumBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public Builder setMaximum(org.tensorflow.proto.framework.TensorProto value) { - if (maximumBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - maximum_ = value; - onChanged(); - } else { - maximumBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public Builder setMaximum( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (maximumBuilder_ == null) { - maximum_ = builderForValue.build(); - onChanged(); - } else { - maximumBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public Builder mergeMaximum(org.tensorflow.proto.framework.TensorProto value) { - if (maximumBuilder_ == null) { - if (maximum_ != null) { - maximum_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(maximum_).mergeFrom(value).buildPartial(); - } else { - maximum_ = value; - } - onChanged(); - } else { - maximumBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public Builder clearMaximum() { - if (maximumBuilder_ == null) { - maximum_ = null; - onChanged(); - } else { - maximum_ = null; - maximumBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getMaximumBuilder() { - - onChanged(); - return getMaximumFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getMaximumOrBuilder() { - if (maximumBuilder_ != null) { - return maximumBuilder_.getMessageOrBuilder(); - } else { - return maximum_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : maximum_; - } - } - /** - * .tensorflow.TensorProto maximum = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getMaximumFieldBuilder() { - if (maximumBuilder_ == null) { - maximumBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getMaximum(), - getParentForChildren(), - isClean()); - maximum_ = null; - } - return maximumBuilder_; - } - @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.BoundedTensorSpecProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BoundedTensorSpecProto) - private static final org.tensorflow.proto.framework.BoundedTensorSpecProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.BoundedTensorSpecProto(); - } - - public static org.tensorflow.proto.framework.BoundedTensorSpecProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BoundedTensorSpecProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BoundedTensorSpecProto(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.BoundedTensorSpecProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProtoOrBuilder.java deleted file mode 100644 index d4b34e04e02..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/BoundedTensorSpecProtoOrBuilder.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface BoundedTensorSpecProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BoundedTensorSpecProto) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * .tensorflow.DataType dtype = 3; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 3; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorProto minimum = 4; - */ - boolean hasMinimum(); - /** - * .tensorflow.TensorProto minimum = 4; - */ - org.tensorflow.proto.framework.TensorProto getMinimum(); - /** - * .tensorflow.TensorProto minimum = 4; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getMinimumOrBuilder(); - - /** - * .tensorflow.TensorProto maximum = 5; - */ - boolean hasMaximum(); - /** - * .tensorflow.TensorProto maximum = 5; - */ - org.tensorflow.proto.framework.TensorProto getMaximum(); - /** - * .tensorflow.TensorProto maximum = 5; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getMaximumOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptions.java deleted file mode 100644 index 1128fdc60f8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptions.java +++ /dev/null @@ -1,2902 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Defines a subgraph in another `GraphDef` as a set of feed points and nodes
    - * to be fetched or executed.
    - * Compare with the arguments to `Session::Run()`.
    - * 
    - * - * Protobuf type {@code tensorflow.CallableOptions} - */ -public final class CallableOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CallableOptions) - CallableOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use CallableOptions.newBuilder() to construct. - private CallableOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CallableOptions() { - feed_ = com.google.protobuf.LazyStringArrayList.EMPTY; - fetch_ = com.google.protobuf.LazyStringArrayList.EMPTY; - target_ = com.google.protobuf.LazyStringArrayList.EMPTY; - tensorConnection_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CallableOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CallableOptions( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - feed_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - feed_.add(s); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - fetch_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - fetch_.add(s); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - target_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - target_.add(s); - break; - } - case 34: { - org.tensorflow.proto.framework.RunOptions.Builder subBuilder = null; - if (runOptions_ != null) { - subBuilder = runOptions_.toBuilder(); - } - runOptions_ = input.readMessage(org.tensorflow.proto.framework.RunOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(runOptions_); - runOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - tensorConnection_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - tensorConnection_.add( - input.readMessage(org.tensorflow.proto.framework.TensorConnection.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - feedDevices_ = com.google.protobuf.MapField.newMapField( - FeedDevicesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000010; - } - com.google.protobuf.MapEntry - feedDevices__ = input.readMessage( - FeedDevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - feedDevices_.getMutableMap().put( - feedDevices__.getKey(), feedDevices__.getValue()); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - fetchDevices_ = com.google.protobuf.MapField.newMapField( - FetchDevicesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000020; - } - com.google.protobuf.MapEntry - fetchDevices__ = input.readMessage( - FetchDevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - fetchDevices_.getMutableMap().put( - fetchDevices__.getKey(), fetchDevices__.getValue()); - break; - } - case 64: { - - fetchSkipSync_ = input.readBool(); - 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)) { - feed_ = feed_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - fetch_ = fetch_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - target_ = target_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - tensorConnection_ = java.util.Collections.unmodifiableList(tensorConnection_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetFeedDevices(); - case 7: - return internalGetFetchDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CallableOptions.class, org.tensorflow.proto.framework.CallableOptions.Builder.class); - } - - public static final int FEED_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList feed_; - /** - *
    -   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -   * 
    - * - * repeated string feed = 1; - */ - public com.google.protobuf.ProtocolStringList - getFeedList() { - return feed_; - } - /** - *
    -   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -   * 
    - * - * repeated string feed = 1; - */ - public int getFeedCount() { - return feed_.size(); - } - /** - *
    -   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -   * 
    - * - * repeated string feed = 1; - */ - public java.lang.String getFeed(int index) { - return feed_.get(index); - } - /** - *
    -   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -   * 
    - * - * repeated string feed = 1; - */ - public com.google.protobuf.ByteString - getFeedBytes(int index) { - return feed_.getByteString(index); - } - - public static final int FETCH_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList fetch_; - /** - *
    -   * Fetches. A list of tensor names. The caller of the callable expects a
    -   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -   * order of specified fetches does not change the execution order.
    -   * 
    - * - * repeated string fetch = 2; - */ - public com.google.protobuf.ProtocolStringList - getFetchList() { - return fetch_; - } - /** - *
    -   * Fetches. A list of tensor names. The caller of the callable expects a
    -   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -   * order of specified fetches does not change the execution order.
    -   * 
    - * - * repeated string fetch = 2; - */ - public int getFetchCount() { - return fetch_.size(); - } - /** - *
    -   * Fetches. A list of tensor names. The caller of the callable expects a
    -   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -   * order of specified fetches does not change the execution order.
    -   * 
    - * - * repeated string fetch = 2; - */ - public java.lang.String getFetch(int index) { - return fetch_.get(index); - } - /** - *
    -   * Fetches. A list of tensor names. The caller of the callable expects a
    -   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -   * order of specified fetches does not change the execution order.
    -   * 
    - * - * repeated string fetch = 2; - */ - public com.google.protobuf.ByteString - getFetchBytes(int index) { - return fetch_.getByteString(index); - } - - public static final int TARGET_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList target_; - /** - *
    -   * Target Nodes. A list of node names. The named nodes will be run by the
    -   * callable but their outputs will not be returned.
    -   * 
    - * - * repeated string target = 3; - */ - public com.google.protobuf.ProtocolStringList - getTargetList() { - return target_; - } - /** - *
    -   * Target Nodes. A list of node names. The named nodes will be run by the
    -   * callable but their outputs will not be returned.
    -   * 
    - * - * repeated string target = 3; - */ - public int getTargetCount() { - return target_.size(); - } - /** - *
    -   * Target Nodes. A list of node names. The named nodes will be run by the
    -   * callable but their outputs will not be returned.
    -   * 
    - * - * repeated string target = 3; - */ - public java.lang.String getTarget(int index) { - return target_.get(index); - } - /** - *
    -   * Target Nodes. A list of node names. The named nodes will be run by the
    -   * callable but their outputs will not be returned.
    -   * 
    - * - * repeated string target = 3; - */ - public com.google.protobuf.ByteString - getTargetBytes(int index) { - return target_.getByteString(index); - } - - public static final int RUN_OPTIONS_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.RunOptions runOptions_; - /** - *
    -   * Options that will be applied to each run.
    -   * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public boolean hasRunOptions() { - return runOptions_ != null; - } - /** - *
    -   * Options that will be applied to each run.
    -   * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public org.tensorflow.proto.framework.RunOptions getRunOptions() { - return runOptions_ == null ? org.tensorflow.proto.framework.RunOptions.getDefaultInstance() : runOptions_; - } - /** - *
    -   * Options that will be applied to each run.
    -   * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public org.tensorflow.proto.framework.RunOptionsOrBuilder getRunOptionsOrBuilder() { - return getRunOptions(); - } - - public static final int TENSOR_CONNECTION_FIELD_NUMBER = 5; - private java.util.List tensorConnection_; - /** - *
    -   * Tensors to be connected in the callable. Each TensorConnection denotes
    -   * a pair of tensors in the graph, between which an edge will be created
    -   * in the callable.
    -   * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public java.util.List getTensorConnectionList() { - return tensorConnection_; - } - /** - *
    -   * Tensors to be connected in the callable. Each TensorConnection denotes
    -   * a pair of tensors in the graph, between which an edge will be created
    -   * in the callable.
    -   * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public java.util.List - getTensorConnectionOrBuilderList() { - return tensorConnection_; - } - /** - *
    -   * Tensors to be connected in the callable. Each TensorConnection denotes
    -   * a pair of tensors in the graph, between which an edge will be created
    -   * in the callable.
    -   * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public int getTensorConnectionCount() { - return tensorConnection_.size(); - } - /** - *
    -   * Tensors to be connected in the callable. Each TensorConnection denotes
    -   * a pair of tensors in the graph, between which an edge will be created
    -   * in the callable.
    -   * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnection getTensorConnection(int index) { - return tensorConnection_.get(index); - } - /** - *
    -   * Tensors to be connected in the callable. Each TensorConnection denotes
    -   * a pair of tensors in the graph, between which an edge will be created
    -   * in the callable.
    -   * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnectionOrBuilder getTensorConnectionOrBuilder( - int index) { - return tensorConnection_.get(index); - } - - public static final int FEED_DEVICES_FIELD_NUMBER = 6; - private static final class FeedDevicesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> feedDevices_; - private com.google.protobuf.MapField - internalGetFeedDevices() { - if (feedDevices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeedDevicesDefaultEntryHolder.defaultEntry); - } - return feedDevices_; - } - - public int getFeedDevicesCount() { - return internalGetFeedDevices().getMap().size(); - } - /** - *
    -   * The Tensor objects fed in the callable and fetched from the callable
    -   * are expected to be backed by host (CPU) memory by default.
    -   * The options below allow changing that - feeding tensors backed by
    -   * device memory, or returning tensors that are backed by device memory.
    -   * The maps below map the name of a feed/fetch tensor (which appears in
    -   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -   * owning the memory backing the contents of the tensor.
    -   * For example, creating a callable with the following options:
    -   * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    -   * }
    -   * means that the Callable expects:
    -   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -   * - The second argument ("b:0") is a Tensor backed by host memory.
    -   * and of its return values:
    -   * - The first output ("x:0") will be backed by host memory.
    -   * - The second output ("y:0") will be backed by GPU memory.
    -   * FEEDS:
    -   * It is the responsibility of the caller to ensure that the memory of the fed
    -   * tensors will be correctly initialized and synchronized before it is
    -   * accessed by operations executed during the call to Session::RunCallable().
    -   * This is typically ensured by using the TensorFlow memory allocators
    -   * (Device::GetAllocator()) to create the Tensor to be fed.
    -   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -   * operation that produced the contents of the tensor has completed, i.e., the
    -   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -   * cuStreamSynchronize()).
    -   * 
    - * - * map<string, string> feed_devices = 6; - */ - - public boolean containsFeedDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeedDevices().getMap().containsKey(key); - } - /** - * Use {@link #getFeedDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeedDevices() { - return getFeedDevicesMap(); - } - /** - *
    -   * The Tensor objects fed in the callable and fetched from the callable
    -   * are expected to be backed by host (CPU) memory by default.
    -   * The options below allow changing that - feeding tensors backed by
    -   * device memory, or returning tensors that are backed by device memory.
    -   * The maps below map the name of a feed/fetch tensor (which appears in
    -   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -   * owning the memory backing the contents of the tensor.
    -   * For example, creating a callable with the following options:
    -   * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    -   * }
    -   * means that the Callable expects:
    -   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -   * - The second argument ("b:0") is a Tensor backed by host memory.
    -   * and of its return values:
    -   * - The first output ("x:0") will be backed by host memory.
    -   * - The second output ("y:0") will be backed by GPU memory.
    -   * FEEDS:
    -   * It is the responsibility of the caller to ensure that the memory of the fed
    -   * tensors will be correctly initialized and synchronized before it is
    -   * accessed by operations executed during the call to Session::RunCallable().
    -   * This is typically ensured by using the TensorFlow memory allocators
    -   * (Device::GetAllocator()) to create the Tensor to be fed.
    -   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -   * operation that produced the contents of the tensor has completed, i.e., the
    -   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -   * cuStreamSynchronize()).
    -   * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.util.Map getFeedDevicesMap() { - return internalGetFeedDevices().getMap(); - } - /** - *
    -   * The Tensor objects fed in the callable and fetched from the callable
    -   * are expected to be backed by host (CPU) memory by default.
    -   * The options below allow changing that - feeding tensors backed by
    -   * device memory, or returning tensors that are backed by device memory.
    -   * The maps below map the name of a feed/fetch tensor (which appears in
    -   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -   * owning the memory backing the contents of the tensor.
    -   * For example, creating a callable with the following options:
    -   * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    -   * }
    -   * means that the Callable expects:
    -   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -   * - The second argument ("b:0") is a Tensor backed by host memory.
    -   * and of its return values:
    -   * - The first output ("x:0") will be backed by host memory.
    -   * - The second output ("y:0") will be backed by GPU memory.
    -   * FEEDS:
    -   * It is the responsibility of the caller to ensure that the memory of the fed
    -   * tensors will be correctly initialized and synchronized before it is
    -   * accessed by operations executed during the call to Session::RunCallable().
    -   * This is typically ensured by using the TensorFlow memory allocators
    -   * (Device::GetAllocator()) to create the Tensor to be fed.
    -   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -   * operation that produced the contents of the tensor has completed, i.e., the
    -   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -   * cuStreamSynchronize()).
    -   * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.lang.String getFeedDevicesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeedDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * The Tensor objects fed in the callable and fetched from the callable
    -   * are expected to be backed by host (CPU) memory by default.
    -   * The options below allow changing that - feeding tensors backed by
    -   * device memory, or returning tensors that are backed by device memory.
    -   * The maps below map the name of a feed/fetch tensor (which appears in
    -   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -   * owning the memory backing the contents of the tensor.
    -   * For example, creating a callable with the following options:
    -   * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    -   * }
    -   * means that the Callable expects:
    -   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -   * - The second argument ("b:0") is a Tensor backed by host memory.
    -   * and of its return values:
    -   * - The first output ("x:0") will be backed by host memory.
    -   * - The second output ("y:0") will be backed by GPU memory.
    -   * FEEDS:
    -   * It is the responsibility of the caller to ensure that the memory of the fed
    -   * tensors will be correctly initialized and synchronized before it is
    -   * accessed by operations executed during the call to Session::RunCallable().
    -   * This is typically ensured by using the TensorFlow memory allocators
    -   * (Device::GetAllocator()) to create the Tensor to be fed.
    -   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -   * operation that produced the contents of the tensor has completed, i.e., the
    -   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -   * cuStreamSynchronize()).
    -   * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.lang.String getFeedDevicesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeedDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int FETCH_DEVICES_FIELD_NUMBER = 7; - private static final class FetchDevicesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> fetchDevices_; - private com.google.protobuf.MapField - internalGetFetchDevices() { - if (fetchDevices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FetchDevicesDefaultEntryHolder.defaultEntry); - } - return fetchDevices_; - } - - public int getFetchDevicesCount() { - return internalGetFetchDevices().getMap().size(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public boolean containsFetchDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFetchDevices().getMap().containsKey(key); - } - /** - * Use {@link #getFetchDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFetchDevices() { - return getFetchDevicesMap(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.util.Map getFetchDevicesMap() { - return internalGetFetchDevices().getMap(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.lang.String getFetchDevicesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFetchDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.lang.String getFetchDevicesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFetchDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int FETCH_SKIP_SYNC_FIELD_NUMBER = 8; - private boolean fetchSkipSync_; - /** - *
    -   * By default, RunCallable() will synchronize the GPU stream before returning
    -   * fetched tensors on a GPU device, to ensure that the values in those tensors
    -   * have been produced. This simplifies interacting with the tensors, but
    -   * potentially incurs a performance hit.
    -   * If this options is set to true, the caller is responsible for ensuring
    -   * that the values in the fetched tensors have been produced before they are
    -   * used. The caller can do this by invoking `Device::Sync()` on the underlying
    -   * device(s), or by feeding the tensors back to the same Session using
    -   * `feed_devices` with the same corresponding device name.
    -   * 
    - * - * bool fetch_skip_sync = 8; - */ - public boolean getFetchSkipSync() { - return fetchSkipSync_; - } - - 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 { - for (int i = 0; i < feed_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, feed_.getRaw(i)); - } - for (int i = 0; i < fetch_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fetch_.getRaw(i)); - } - for (int i = 0; i < target_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_.getRaw(i)); - } - if (runOptions_ != null) { - output.writeMessage(4, getRunOptions()); - } - for (int i = 0; i < tensorConnection_.size(); i++) { - output.writeMessage(5, tensorConnection_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFeedDevices(), - FeedDevicesDefaultEntryHolder.defaultEntry, - 6); - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFetchDevices(), - FetchDevicesDefaultEntryHolder.defaultEntry, - 7); - if (fetchSkipSync_ != false) { - output.writeBool(8, fetchSkipSync_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < feed_.size(); i++) { - dataSize += computeStringSizeNoTag(feed_.getRaw(i)); - } - size += dataSize; - size += 1 * getFeedList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < fetch_.size(); i++) { - dataSize += computeStringSizeNoTag(fetch_.getRaw(i)); - } - size += dataSize; - size += 1 * getFetchList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < target_.size(); i++) { - dataSize += computeStringSizeNoTag(target_.getRaw(i)); - } - size += dataSize; - size += 1 * getTargetList().size(); - } - if (runOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getRunOptions()); - } - for (int i = 0; i < tensorConnection_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, tensorConnection_.get(i)); - } - for (java.util.Map.Entry entry - : internalGetFeedDevices().getMap().entrySet()) { - com.google.protobuf.MapEntry - feedDevices__ = FeedDevicesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, feedDevices__); - } - for (java.util.Map.Entry entry - : internalGetFetchDevices().getMap().entrySet()) { - com.google.protobuf.MapEntry - fetchDevices__ = FetchDevicesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, fetchDevices__); - } - if (fetchSkipSync_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, fetchSkipSync_); - } - 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.CallableOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CallableOptions other = (org.tensorflow.proto.framework.CallableOptions) obj; - - if (!getFeedList() - .equals(other.getFeedList())) return false; - if (!getFetchList() - .equals(other.getFetchList())) return false; - if (!getTargetList() - .equals(other.getTargetList())) return false; - if (hasRunOptions() != other.hasRunOptions()) return false; - if (hasRunOptions()) { - if (!getRunOptions() - .equals(other.getRunOptions())) return false; - } - if (!getTensorConnectionList() - .equals(other.getTensorConnectionList())) return false; - if (!internalGetFeedDevices().equals( - other.internalGetFeedDevices())) return false; - if (!internalGetFetchDevices().equals( - other.internalGetFetchDevices())) return false; - if (getFetchSkipSync() - != other.getFetchSkipSync()) 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 (getFeedCount() > 0) { - hash = (37 * hash) + FEED_FIELD_NUMBER; - hash = (53 * hash) + getFeedList().hashCode(); - } - if (getFetchCount() > 0) { - hash = (37 * hash) + FETCH_FIELD_NUMBER; - hash = (53 * hash) + getFetchList().hashCode(); - } - if (getTargetCount() > 0) { - hash = (37 * hash) + TARGET_FIELD_NUMBER; - hash = (53 * hash) + getTargetList().hashCode(); - } - if (hasRunOptions()) { - hash = (37 * hash) + RUN_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getRunOptions().hashCode(); - } - if (getTensorConnectionCount() > 0) { - hash = (37 * hash) + TENSOR_CONNECTION_FIELD_NUMBER; - hash = (53 * hash) + getTensorConnectionList().hashCode(); - } - if (!internalGetFeedDevices().getMap().isEmpty()) { - hash = (37 * hash) + FEED_DEVICES_FIELD_NUMBER; - hash = (53 * hash) + internalGetFeedDevices().hashCode(); - } - if (!internalGetFetchDevices().getMap().isEmpty()) { - hash = (37 * hash) + FETCH_DEVICES_FIELD_NUMBER; - hash = (53 * hash) + internalGetFetchDevices().hashCode(); - } - hash = (37 * hash) + FETCH_SKIP_SYNC_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFetchSkipSync()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CallableOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CallableOptions 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.CallableOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CallableOptions 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.CallableOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CallableOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CallableOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CallableOptions 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.CallableOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CallableOptions 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.CallableOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CallableOptions 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.CallableOptions 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; - } - /** - *
    -   * Defines a subgraph in another `GraphDef` as a set of feed points and nodes
    -   * to be fetched or executed.
    -   * Compare with the arguments to `Session::Run()`.
    -   * 
    - * - * Protobuf type {@code tensorflow.CallableOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CallableOptions) - org.tensorflow.proto.framework.CallableOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetFeedDevices(); - case 7: - return internalGetFetchDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 6: - return internalGetMutableFeedDevices(); - case 7: - return internalGetMutableFetchDevices(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CallableOptions.class, org.tensorflow.proto.framework.CallableOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CallableOptions.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorConnectionFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - feed_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - fetch_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - target_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - if (runOptionsBuilder_ == null) { - runOptions_ = null; - } else { - runOptions_ = null; - runOptionsBuilder_ = null; - } - if (tensorConnectionBuilder_ == null) { - tensorConnection_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - tensorConnectionBuilder_.clear(); - } - internalGetMutableFeedDevices().clear(); - internalGetMutableFetchDevices().clear(); - fetchSkipSync_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CallableOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CallableOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CallableOptions build() { - org.tensorflow.proto.framework.CallableOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CallableOptions buildPartial() { - org.tensorflow.proto.framework.CallableOptions result = new org.tensorflow.proto.framework.CallableOptions(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - feed_ = feed_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.feed_ = feed_; - if (((bitField0_ & 0x00000002) != 0)) { - fetch_ = fetch_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.fetch_ = fetch_; - if (((bitField0_ & 0x00000004) != 0)) { - target_ = target_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.target_ = target_; - if (runOptionsBuilder_ == null) { - result.runOptions_ = runOptions_; - } else { - result.runOptions_ = runOptionsBuilder_.build(); - } - if (tensorConnectionBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - tensorConnection_ = java.util.Collections.unmodifiableList(tensorConnection_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.tensorConnection_ = tensorConnection_; - } else { - result.tensorConnection_ = tensorConnectionBuilder_.build(); - } - result.feedDevices_ = internalGetFeedDevices(); - result.feedDevices_.makeImmutable(); - result.fetchDevices_ = internalGetFetchDevices(); - result.fetchDevices_.makeImmutable(); - result.fetchSkipSync_ = fetchSkipSync_; - 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.CallableOptions) { - return mergeFrom((org.tensorflow.proto.framework.CallableOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CallableOptions other) { - if (other == org.tensorflow.proto.framework.CallableOptions.getDefaultInstance()) return this; - if (!other.feed_.isEmpty()) { - if (feed_.isEmpty()) { - feed_ = other.feed_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFeedIsMutable(); - feed_.addAll(other.feed_); - } - onChanged(); - } - if (!other.fetch_.isEmpty()) { - if (fetch_.isEmpty()) { - fetch_ = other.fetch_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureFetchIsMutable(); - fetch_.addAll(other.fetch_); - } - onChanged(); - } - if (!other.target_.isEmpty()) { - if (target_.isEmpty()) { - target_ = other.target_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTargetIsMutable(); - target_.addAll(other.target_); - } - onChanged(); - } - if (other.hasRunOptions()) { - mergeRunOptions(other.getRunOptions()); - } - if (tensorConnectionBuilder_ == null) { - if (!other.tensorConnection_.isEmpty()) { - if (tensorConnection_.isEmpty()) { - tensorConnection_ = other.tensorConnection_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureTensorConnectionIsMutable(); - tensorConnection_.addAll(other.tensorConnection_); - } - onChanged(); - } - } else { - if (!other.tensorConnection_.isEmpty()) { - if (tensorConnectionBuilder_.isEmpty()) { - tensorConnectionBuilder_.dispose(); - tensorConnectionBuilder_ = null; - tensorConnection_ = other.tensorConnection_; - bitField0_ = (bitField0_ & ~0x00000008); - tensorConnectionBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorConnectionFieldBuilder() : null; - } else { - tensorConnectionBuilder_.addAllMessages(other.tensorConnection_); - } - } - } - internalGetMutableFeedDevices().mergeFrom( - other.internalGetFeedDevices()); - internalGetMutableFetchDevices().mergeFrom( - other.internalGetFetchDevices()); - if (other.getFetchSkipSync() != false) { - setFetchSkipSync(other.getFetchSkipSync()); - } - 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.CallableOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CallableOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList feed_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureFeedIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - feed_ = new com.google.protobuf.LazyStringArrayList(feed_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public com.google.protobuf.ProtocolStringList - getFeedList() { - return feed_.getUnmodifiableView(); - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public int getFeedCount() { - return feed_.size(); - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public java.lang.String getFeed(int index) { - return feed_.get(index); - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public com.google.protobuf.ByteString - getFeedBytes(int index) { - return feed_.getByteString(index); - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public Builder setFeed( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFeedIsMutable(); - feed_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public Builder addFeed( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFeedIsMutable(); - feed_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public Builder addAllFeed( - java.lang.Iterable values) { - ensureFeedIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, feed_); - onChanged(); - return this; - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public Builder clearFeed() { - feed_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    -     * 
    - * - * repeated string feed = 1; - */ - public Builder addFeedBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureFeedIsMutable(); - feed_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList fetch_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureFetchIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - fetch_ = new com.google.protobuf.LazyStringArrayList(fetch_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public com.google.protobuf.ProtocolStringList - getFetchList() { - return fetch_.getUnmodifiableView(); - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public int getFetchCount() { - return fetch_.size(); - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public java.lang.String getFetch(int index) { - return fetch_.get(index); - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public com.google.protobuf.ByteString - getFetchBytes(int index) { - return fetch_.getByteString(index); - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public Builder setFetch( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFetchIsMutable(); - fetch_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public Builder addFetch( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFetchIsMutable(); - fetch_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public Builder addAllFetch( - java.lang.Iterable values) { - ensureFetchIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fetch_); - onChanged(); - return this; - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public Builder clearFetch() { - fetch_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * Fetches. A list of tensor names. The caller of the callable expects a
    -     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    -     * order of specified fetches does not change the execution order.
    -     * 
    - * - * repeated string fetch = 2; - */ - public Builder addFetchBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureFetchIsMutable(); - fetch_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList target_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureTargetIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - target_ = new com.google.protobuf.LazyStringArrayList(target_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public com.google.protobuf.ProtocolStringList - getTargetList() { - return target_.getUnmodifiableView(); - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public int getTargetCount() { - return target_.size(); - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public java.lang.String getTarget(int index) { - return target_.get(index); - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public com.google.protobuf.ByteString - getTargetBytes(int index) { - return target_.getByteString(index); - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public Builder setTarget( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTargetIsMutable(); - target_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public Builder addTarget( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTargetIsMutable(); - target_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public Builder addAllTarget( - java.lang.Iterable values) { - ensureTargetIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, target_); - onChanged(); - return this; - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public Builder clearTarget() { - target_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - *
    -     * Target Nodes. A list of node names. The named nodes will be run by the
    -     * callable but their outputs will not be returned.
    -     * 
    - * - * repeated string target = 3; - */ - public Builder addTargetBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTargetIsMutable(); - target_.add(value); - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.RunOptions runOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions, org.tensorflow.proto.framework.RunOptions.Builder, org.tensorflow.proto.framework.RunOptionsOrBuilder> runOptionsBuilder_; - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public boolean hasRunOptions() { - return runOptionsBuilder_ != null || runOptions_ != null; - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public org.tensorflow.proto.framework.RunOptions getRunOptions() { - if (runOptionsBuilder_ == null) { - return runOptions_ == null ? org.tensorflow.proto.framework.RunOptions.getDefaultInstance() : runOptions_; - } else { - return runOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public Builder setRunOptions(org.tensorflow.proto.framework.RunOptions value) { - if (runOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - runOptions_ = value; - onChanged(); - } else { - runOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public Builder setRunOptions( - org.tensorflow.proto.framework.RunOptions.Builder builderForValue) { - if (runOptionsBuilder_ == null) { - runOptions_ = builderForValue.build(); - onChanged(); - } else { - runOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public Builder mergeRunOptions(org.tensorflow.proto.framework.RunOptions value) { - if (runOptionsBuilder_ == null) { - if (runOptions_ != null) { - runOptions_ = - org.tensorflow.proto.framework.RunOptions.newBuilder(runOptions_).mergeFrom(value).buildPartial(); - } else { - runOptions_ = value; - } - onChanged(); - } else { - runOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public Builder clearRunOptions() { - if (runOptionsBuilder_ == null) { - runOptions_ = null; - onChanged(); - } else { - runOptions_ = null; - runOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public org.tensorflow.proto.framework.RunOptions.Builder getRunOptionsBuilder() { - - onChanged(); - return getRunOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - public org.tensorflow.proto.framework.RunOptionsOrBuilder getRunOptionsOrBuilder() { - if (runOptionsBuilder_ != null) { - return runOptionsBuilder_.getMessageOrBuilder(); - } else { - return runOptions_ == null ? - org.tensorflow.proto.framework.RunOptions.getDefaultInstance() : runOptions_; - } - } - /** - *
    -     * Options that will be applied to each run.
    -     * 
    - * - * .tensorflow.RunOptions run_options = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions, org.tensorflow.proto.framework.RunOptions.Builder, org.tensorflow.proto.framework.RunOptionsOrBuilder> - getRunOptionsFieldBuilder() { - if (runOptionsBuilder_ == null) { - runOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions, org.tensorflow.proto.framework.RunOptions.Builder, org.tensorflow.proto.framework.RunOptionsOrBuilder>( - getRunOptions(), - getParentForChildren(), - isClean()); - runOptions_ = null; - } - return runOptionsBuilder_; - } - - private java.util.List tensorConnection_ = - java.util.Collections.emptyList(); - private void ensureTensorConnectionIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - tensorConnection_ = new java.util.ArrayList(tensorConnection_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorConnection, org.tensorflow.proto.framework.TensorConnection.Builder, org.tensorflow.proto.framework.TensorConnectionOrBuilder> tensorConnectionBuilder_; - - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public java.util.List getTensorConnectionList() { - if (tensorConnectionBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensorConnection_); - } else { - return tensorConnectionBuilder_.getMessageList(); - } - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public int getTensorConnectionCount() { - if (tensorConnectionBuilder_ == null) { - return tensorConnection_.size(); - } else { - return tensorConnectionBuilder_.getCount(); - } - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnection getTensorConnection(int index) { - if (tensorConnectionBuilder_ == null) { - return tensorConnection_.get(index); - } else { - return tensorConnectionBuilder_.getMessage(index); - } - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder setTensorConnection( - int index, org.tensorflow.proto.framework.TensorConnection value) { - if (tensorConnectionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorConnectionIsMutable(); - tensorConnection_.set(index, value); - onChanged(); - } else { - tensorConnectionBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder setTensorConnection( - int index, org.tensorflow.proto.framework.TensorConnection.Builder builderForValue) { - if (tensorConnectionBuilder_ == null) { - ensureTensorConnectionIsMutable(); - tensorConnection_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorConnectionBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder addTensorConnection(org.tensorflow.proto.framework.TensorConnection value) { - if (tensorConnectionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorConnectionIsMutable(); - tensorConnection_.add(value); - onChanged(); - } else { - tensorConnectionBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder addTensorConnection( - int index, org.tensorflow.proto.framework.TensorConnection value) { - if (tensorConnectionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorConnectionIsMutable(); - tensorConnection_.add(index, value); - onChanged(); - } else { - tensorConnectionBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder addTensorConnection( - org.tensorflow.proto.framework.TensorConnection.Builder builderForValue) { - if (tensorConnectionBuilder_ == null) { - ensureTensorConnectionIsMutable(); - tensorConnection_.add(builderForValue.build()); - onChanged(); - } else { - tensorConnectionBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder addTensorConnection( - int index, org.tensorflow.proto.framework.TensorConnection.Builder builderForValue) { - if (tensorConnectionBuilder_ == null) { - ensureTensorConnectionIsMutable(); - tensorConnection_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorConnectionBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder addAllTensorConnection( - java.lang.Iterable values) { - if (tensorConnectionBuilder_ == null) { - ensureTensorConnectionIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensorConnection_); - onChanged(); - } else { - tensorConnectionBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder clearTensorConnection() { - if (tensorConnectionBuilder_ == null) { - tensorConnection_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - tensorConnectionBuilder_.clear(); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public Builder removeTensorConnection(int index) { - if (tensorConnectionBuilder_ == null) { - ensureTensorConnectionIsMutable(); - tensorConnection_.remove(index); - onChanged(); - } else { - tensorConnectionBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnection.Builder getTensorConnectionBuilder( - int index) { - return getTensorConnectionFieldBuilder().getBuilder(index); - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnectionOrBuilder getTensorConnectionOrBuilder( - int index) { - if (tensorConnectionBuilder_ == null) { - return tensorConnection_.get(index); } else { - return tensorConnectionBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public java.util.List - getTensorConnectionOrBuilderList() { - if (tensorConnectionBuilder_ != null) { - return tensorConnectionBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensorConnection_); - } - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnection.Builder addTensorConnectionBuilder() { - return getTensorConnectionFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorConnection.getDefaultInstance()); - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public org.tensorflow.proto.framework.TensorConnection.Builder addTensorConnectionBuilder( - int index) { - return getTensorConnectionFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorConnection.getDefaultInstance()); - } - /** - *
    -     * Tensors to be connected in the callable. Each TensorConnection denotes
    -     * a pair of tensors in the graph, between which an edge will be created
    -     * in the callable.
    -     * 
    - * - * repeated .tensorflow.TensorConnection tensor_connection = 5; - */ - public java.util.List - getTensorConnectionBuilderList() { - return getTensorConnectionFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorConnection, org.tensorflow.proto.framework.TensorConnection.Builder, org.tensorflow.proto.framework.TensorConnectionOrBuilder> - getTensorConnectionFieldBuilder() { - if (tensorConnectionBuilder_ == null) { - tensorConnectionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorConnection, org.tensorflow.proto.framework.TensorConnection.Builder, org.tensorflow.proto.framework.TensorConnectionOrBuilder>( - tensorConnection_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - tensorConnection_ = null; - } - return tensorConnectionBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> feedDevices_; - private com.google.protobuf.MapField - internalGetFeedDevices() { - if (feedDevices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FeedDevicesDefaultEntryHolder.defaultEntry); - } - return feedDevices_; - } - private com.google.protobuf.MapField - internalGetMutableFeedDevices() { - onChanged();; - if (feedDevices_ == null) { - feedDevices_ = com.google.protobuf.MapField.newMapField( - FeedDevicesDefaultEntryHolder.defaultEntry); - } - if (!feedDevices_.isMutable()) { - feedDevices_ = feedDevices_.copy(); - } - return feedDevices_; - } - - public int getFeedDevicesCount() { - return internalGetFeedDevices().getMap().size(); - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public boolean containsFeedDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFeedDevices().getMap().containsKey(key); - } - /** - * Use {@link #getFeedDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFeedDevices() { - return getFeedDevicesMap(); - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.util.Map getFeedDevicesMap() { - return internalGetFeedDevices().getMap(); - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.lang.String getFeedDevicesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeedDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public java.lang.String getFeedDevicesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFeedDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFeedDevices() { - internalGetMutableFeedDevices().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public Builder removeFeedDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeedDevices().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFeedDevices() { - return internalGetMutableFeedDevices().getMutableMap(); - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - public Builder putFeedDevices( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFeedDevices().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * The Tensor objects fed in the callable and fetched from the callable
    -     * are expected to be backed by host (CPU) memory by default.
    -     * The options below allow changing that - feeding tensors backed by
    -     * device memory, or returning tensors that are backed by device memory.
    -     * The maps below map the name of a feed/fetch tensor (which appears in
    -     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    -     * owning the memory backing the contents of the tensor.
    -     * For example, creating a callable with the following options:
    -     * CallableOptions {
    -     *   feed: "a:0"
    -     *   feed: "b:0"
    -     *   fetch: "x:0"
    -     *   fetch: "y:0"
    -     *   feed_devices: {
    -     *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *   }
    -     *   fetch_devices: {
    -     *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -     *  }
    -     * }
    -     * means that the Callable expects:
    -     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    -     * - The second argument ("b:0") is a Tensor backed by host memory.
    -     * and of its return values:
    -     * - The first output ("x:0") will be backed by host memory.
    -     * - The second output ("y:0") will be backed by GPU memory.
    -     * FEEDS:
    -     * It is the responsibility of the caller to ensure that the memory of the fed
    -     * tensors will be correctly initialized and synchronized before it is
    -     * accessed by operations executed during the call to Session::RunCallable().
    -     * This is typically ensured by using the TensorFlow memory allocators
    -     * (Device::GetAllocator()) to create the Tensor to be fed.
    -     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    -     * operation that produced the contents of the tensor has completed, i.e., the
    -     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    -     * cuStreamSynchronize()).
    -     * 
    - * - * map<string, string> feed_devices = 6; - */ - - public Builder putAllFeedDevices( - java.util.Map values) { - internalGetMutableFeedDevices().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> fetchDevices_; - private com.google.protobuf.MapField - internalGetFetchDevices() { - if (fetchDevices_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FetchDevicesDefaultEntryHolder.defaultEntry); - } - return fetchDevices_; - } - private com.google.protobuf.MapField - internalGetMutableFetchDevices() { - onChanged();; - if (fetchDevices_ == null) { - fetchDevices_ = com.google.protobuf.MapField.newMapField( - FetchDevicesDefaultEntryHolder.defaultEntry); - } - if (!fetchDevices_.isMutable()) { - fetchDevices_ = fetchDevices_.copy(); - } - return fetchDevices_; - } - - public int getFetchDevicesCount() { - return internalGetFetchDevices().getMap().size(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public boolean containsFetchDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFetchDevices().getMap().containsKey(key); - } - /** - * Use {@link #getFetchDevicesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFetchDevices() { - return getFetchDevicesMap(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.util.Map getFetchDevicesMap() { - return internalGetFetchDevices().getMap(); - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.lang.String getFetchDevicesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFetchDevices().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> fetch_devices = 7; - */ - - public java.lang.String getFetchDevicesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFetchDevices().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFetchDevices() { - internalGetMutableFetchDevices().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> fetch_devices = 7; - */ - - public Builder removeFetchDevices( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFetchDevices().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFetchDevices() { - return internalGetMutableFetchDevices().getMutableMap(); - } - /** - * map<string, string> fetch_devices = 7; - */ - public Builder putFetchDevices( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFetchDevices().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> fetch_devices = 7; - */ - - public Builder putAllFetchDevices( - java.util.Map values) { - internalGetMutableFetchDevices().getMutableMap() - .putAll(values); - return this; - } - - private boolean fetchSkipSync_ ; - /** - *
    -     * By default, RunCallable() will synchronize the GPU stream before returning
    -     * fetched tensors on a GPU device, to ensure that the values in those tensors
    -     * have been produced. This simplifies interacting with the tensors, but
    -     * potentially incurs a performance hit.
    -     * If this options is set to true, the caller is responsible for ensuring
    -     * that the values in the fetched tensors have been produced before they are
    -     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    -     * device(s), or by feeding the tensors back to the same Session using
    -     * `feed_devices` with the same corresponding device name.
    -     * 
    - * - * bool fetch_skip_sync = 8; - */ - public boolean getFetchSkipSync() { - return fetchSkipSync_; - } - /** - *
    -     * By default, RunCallable() will synchronize the GPU stream before returning
    -     * fetched tensors on a GPU device, to ensure that the values in those tensors
    -     * have been produced. This simplifies interacting with the tensors, but
    -     * potentially incurs a performance hit.
    -     * If this options is set to true, the caller is responsible for ensuring
    -     * that the values in the fetched tensors have been produced before they are
    -     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    -     * device(s), or by feeding the tensors back to the same Session using
    -     * `feed_devices` with the same corresponding device name.
    -     * 
    - * - * bool fetch_skip_sync = 8; - */ - public Builder setFetchSkipSync(boolean value) { - - fetchSkipSync_ = value; - onChanged(); - return this; - } - /** - *
    -     * By default, RunCallable() will synchronize the GPU stream before returning
    -     * fetched tensors on a GPU device, to ensure that the values in those tensors
    -     * have been produced. This simplifies interacting with the tensors, but
    -     * potentially incurs a performance hit.
    -     * If this options is set to true, the caller is responsible for ensuring
    -     * that the values in the fetched tensors have been produced before they are
    -     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    -     * device(s), or by feeding the tensors back to the same Session using
    -     * `feed_devices` with the same corresponding device name.
    -     * 
    - * - * bool fetch_skip_sync = 8; - */ - public Builder clearFetchSkipSync() { - - fetchSkipSync_ = false; - 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.CallableOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CallableOptions) - private static final org.tensorflow.proto.framework.CallableOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CallableOptions(); - } - - public static org.tensorflow.proto.framework.CallableOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CallableOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CallableOptions(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.CallableOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensor.java deleted file mode 100644 index 1208e25ad7b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensor.java +++ /dev/null @@ -1,729 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.CapturedTensor} - */ -public final class CapturedTensor extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CapturedTensor) - CapturedTensorOrBuilder { -private static final long serialVersionUID = 0L; - // Use CapturedTensor.newBuilder() to construct. - private CapturedTensor(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CapturedTensor() { - name_ = ""; - concreteFunction_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CapturedTensor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CapturedTensor( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - concreteFunction_ = s; - 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.SavedObjectGraphProtos.internal_static_tensorflow_CapturedTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_CapturedTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CapturedTensor.class, org.tensorflow.proto.framework.CapturedTensor.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Name of captured tensor
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Name of captured tensor
    -   * 
    - * - * 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 CONCRETE_FUNCTION_FIELD_NUMBER = 2; - private volatile java.lang.Object concreteFunction_; - /** - *
    -   * Name of concrete function which contains the computed graph tensor.
    -   * 
    - * - * string concrete_function = 2; - */ - public java.lang.String getConcreteFunction() { - java.lang.Object ref = concreteFunction_; - 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(); - concreteFunction_ = s; - return s; - } - } - /** - *
    -   * Name of concrete function which contains the computed graph tensor.
    -   * 
    - * - * string concrete_function = 2; - */ - public com.google.protobuf.ByteString - getConcreteFunctionBytes() { - java.lang.Object ref = concreteFunction_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - concreteFunction_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getConcreteFunctionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, concreteFunction_); - } - 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 (!getConcreteFunctionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, concreteFunction_); - } - 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.CapturedTensor)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CapturedTensor other = (org.tensorflow.proto.framework.CapturedTensor) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getConcreteFunction() - .equals(other.getConcreteFunction())) 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) + CONCRETE_FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getConcreteFunction().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CapturedTensor parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CapturedTensor 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.CapturedTensor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CapturedTensor 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.CapturedTensor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CapturedTensor parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CapturedTensor parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CapturedTensor 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.CapturedTensor parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CapturedTensor 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.CapturedTensor parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CapturedTensor 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.CapturedTensor 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.CapturedTensor} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CapturedTensor) - org.tensorflow.proto.framework.CapturedTensorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_CapturedTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_CapturedTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CapturedTensor.class, org.tensorflow.proto.framework.CapturedTensor.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CapturedTensor.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_ = ""; - - concreteFunction_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_CapturedTensor_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CapturedTensor getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CapturedTensor build() { - org.tensorflow.proto.framework.CapturedTensor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CapturedTensor buildPartial() { - org.tensorflow.proto.framework.CapturedTensor result = new org.tensorflow.proto.framework.CapturedTensor(this); - result.name_ = name_; - result.concreteFunction_ = concreteFunction_; - 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.CapturedTensor) { - return mergeFrom((org.tensorflow.proto.framework.CapturedTensor)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CapturedTensor other) { - if (other == org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getConcreteFunction().isEmpty()) { - concreteFunction_ = other.concreteFunction_; - onChanged(); - } - 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.CapturedTensor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CapturedTensor) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of captured tensor
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of captured tensor
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of captured tensor
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of captured tensor
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of captured tensor
    -     * 
    - * - * 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 java.lang.Object concreteFunction_ = ""; - /** - *
    -     * Name of concrete function which contains the computed graph tensor.
    -     * 
    - * - * string concrete_function = 2; - */ - public java.lang.String getConcreteFunction() { - java.lang.Object ref = concreteFunction_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - concreteFunction_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of concrete function which contains the computed graph tensor.
    -     * 
    - * - * string concrete_function = 2; - */ - public com.google.protobuf.ByteString - getConcreteFunctionBytes() { - java.lang.Object ref = concreteFunction_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - concreteFunction_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of concrete function which contains the computed graph tensor.
    -     * 
    - * - * string concrete_function = 2; - */ - public Builder setConcreteFunction( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - concreteFunction_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of concrete function which contains the computed graph tensor.
    -     * 
    - * - * string concrete_function = 2; - */ - public Builder clearConcreteFunction() { - - concreteFunction_ = getDefaultInstance().getConcreteFunction(); - onChanged(); - return this; - } - /** - *
    -     * Name of concrete function which contains the computed graph tensor.
    -     * 
    - * - * string concrete_function = 2; - */ - public Builder setConcreteFunctionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - concreteFunction_ = value; - 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.CapturedTensor) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CapturedTensor) - private static final org.tensorflow.proto.framework.CapturedTensor DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CapturedTensor(); - } - - public static org.tensorflow.proto.framework.CapturedTensor getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CapturedTensor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CapturedTensor(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.CapturedTensor getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensorOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensorOrBuilder.java deleted file mode 100644 index 0efef800399..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CapturedTensorOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface CapturedTensorOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CapturedTensor) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of captured tensor
    -   * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -   * Name of captured tensor
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Name of concrete function which contains the computed graph tensor.
    -   * 
    - * - * string concrete_function = 2; - */ - java.lang.String getConcreteFunction(); - /** - *
    -   * Name of concrete function which contains the computed graph tensor.
    -   * 
    - * - * string concrete_function = 2; - */ - com.google.protobuf.ByteString - getConcreteFunctionBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDef.java deleted file mode 100644 index f3094be10f6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDef.java +++ /dev/null @@ -1,4858 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * CollectionDef should cover most collections.
    - * To add a user-defined collection, do one of the following:
    - * 1. For simple data types, such as string, int, float:
    - *      tf.add_to_collection("your_collection_name", your_simple_value)
    - *    strings will be stored as bytes_list.
    - * 2. For Protobuf types, there are three ways to add them:
    - *    1) tf.add_to_collection("your_collection_name",
    - *         your_proto.SerializeToString())
    - *       collection_def {
    - *         key: "user_defined_bytes_collection"
    - *         value {
    - *           bytes_list {
    - *             value: "queue_name: \"test_queue\"\n"
    - *           }
    - *         }
    - *       }
    - *  or
    - *    2) tf.add_to_collection("your_collection_name", str(your_proto))
    - *       collection_def {
    - *         key: "user_defined_string_collection"
    - *         value {
    - *          bytes_list {
    - *             value: "\n\ntest_queue"
    - *           }
    - *         }
    - *       }
    - *  or
    - *    3) any_buf = any_pb2.Any()
    - *       tf.add_to_collection("your_collection_name",
    - *         any_buf.Pack(your_proto))
    - *       collection_def {
    - *         key: "user_defined_any_collection"
    - *         value {
    - *           any_list {
    - *             value {
    - *               type_url: "type.googleapis.com/tensorflow.QueueRunnerDef"
    - *               value: "\n\ntest_queue"
    - *             }
    - *           }
    - *         }
    - *       }
    - * 3. For Python objects, implement to_proto() and from_proto(), and register
    - *    them in the following manner:
    - *    ops.register_proto_function("your_collection_name",
    - *                                proto_type,
    - *                                to_proto=YourPythonObject.to_proto,
    - *                                from_proto=YourPythonObject.from_proto)
    - *    These functions will be invoked to serialize and de-serialize the
    - *    collection. For example,
    - *    ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES,
    - *                                proto_type=variable_pb2.VariableDef,
    - *                                to_proto=Variable.to_proto,
    - *                                from_proto=Variable.from_proto)
    - * 
    - * - * Protobuf type {@code tensorflow.CollectionDef} - */ -public final class CollectionDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef) - CollectionDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use CollectionDef.newBuilder() to construct. - private CollectionDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CollectionDef() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CollectionDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CollectionDef( - 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: { - org.tensorflow.proto.framework.CollectionDef.NodeList.Builder subBuilder = null; - if (kindCase_ == 1) { - subBuilder = ((org.tensorflow.proto.framework.CollectionDef.NodeList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CollectionDef.NodeList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CollectionDef.NodeList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 1; - break; - } - case 18: { - org.tensorflow.proto.framework.CollectionDef.BytesList.Builder subBuilder = null; - if (kindCase_ == 2) { - subBuilder = ((org.tensorflow.proto.framework.CollectionDef.BytesList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CollectionDef.BytesList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CollectionDef.BytesList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 2; - break; - } - case 26: { - org.tensorflow.proto.framework.CollectionDef.Int64List.Builder subBuilder = null; - if (kindCase_ == 3) { - subBuilder = ((org.tensorflow.proto.framework.CollectionDef.Int64List) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CollectionDef.Int64List.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CollectionDef.Int64List) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 3; - break; - } - case 34: { - org.tensorflow.proto.framework.CollectionDef.FloatList.Builder subBuilder = null; - if (kindCase_ == 4) { - subBuilder = ((org.tensorflow.proto.framework.CollectionDef.FloatList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CollectionDef.FloatList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CollectionDef.FloatList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 4; - break; - } - case 42: { - org.tensorflow.proto.framework.CollectionDef.AnyList.Builder subBuilder = null; - if (kindCase_ == 5) { - subBuilder = ((org.tensorflow.proto.framework.CollectionDef.AnyList) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CollectionDef.AnyList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CollectionDef.AnyList) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 5; - 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.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.class, org.tensorflow.proto.framework.CollectionDef.Builder.class); - } - - public interface NodeListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.NodeList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string value = 1; - */ - java.util.List - getValueList(); - /** - * repeated string value = 1; - */ - int getValueCount(); - /** - * repeated string value = 1; - */ - java.lang.String getValue(int index); - /** - * repeated string value = 1; - */ - com.google.protobuf.ByteString - getValueBytes(int index); - } - /** - *
    -   * NodeList is used for collecting nodes in graph. For example
    -   * collection_def {
    -   *   key: "summaries"
    -   *   value {
    -   *     node_list {
    -   *       value: "input_producer/ScalarSummary:0"
    -   *       value: "shuffle_batch/ScalarSummary:0"
    -   *       value: "ImageSummary:0"
    -   *     }
    -   *   }
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.NodeList} - */ - public static final class NodeList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.NodeList) - NodeListOrBuilder { - private static final long serialVersionUID = 0L; - // Use NodeList.newBuilder() to construct. - private NodeList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NodeList() { - value_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NodeList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NodeList( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - value_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - value_.add(s); - 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)) { - value_ = value_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.NodeList.class, org.tensorflow.proto.framework.CollectionDef.NodeList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList value_; - /** - * repeated string value = 1; - */ - public com.google.protobuf.ProtocolStringList - getValueList() { - return value_; - } - /** - * repeated string value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated string value = 1; - */ - public java.lang.String getValue(int index) { - return value_.get(index); - } - /** - * repeated string value = 1; - */ - public com.google.protobuf.ByteString - getValueBytes(int index) { - return value_.getByteString(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 { - for (int i = 0; i < value_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < value_.size(); i++) { - dataSize += computeStringSizeNoTag(value_.getRaw(i)); - } - size += dataSize; - size += 1 * getValueList().size(); - } - 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.CollectionDef.NodeList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef.NodeList other = (org.tensorflow.proto.framework.CollectionDef.NodeList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef.NodeList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList 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.CollectionDef.NodeList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList 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.CollectionDef.NodeList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList 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.CollectionDef.NodeList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList 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.CollectionDef.NodeList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.NodeList 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.CollectionDef.NodeList 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; - } - /** - *
    -     * NodeList is used for collecting nodes in graph. For example
    -     * collection_def {
    -     *   key: "summaries"
    -     *   value {
    -     *     node_list {
    -     *       value: "input_producer/ScalarSummary:0"
    -     *       value: "shuffle_batch/ScalarSummary:0"
    -     *       value: "ImageSummary:0"
    -     *     }
    -     *   }
    -     * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.NodeList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.NodeList) - org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.NodeList.class, org.tensorflow.proto.framework.CollectionDef.NodeList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.NodeList.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(); - value_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.NodeList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.NodeList build() { - org.tensorflow.proto.framework.CollectionDef.NodeList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.NodeList buildPartial() { - org.tensorflow.proto.framework.CollectionDef.NodeList result = new org.tensorflow.proto.framework.CollectionDef.NodeList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_ = value_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.CollectionDef.NodeList) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef.NodeList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef.NodeList other) { - if (other == org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.CollectionDef.NodeList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef.NodeList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList value_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = new com.google.protobuf.LazyStringArrayList(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string value = 1; - */ - public com.google.protobuf.ProtocolStringList - getValueList() { - return value_.getUnmodifiableView(); - } - /** - * repeated string value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated string value = 1; - */ - public java.lang.String getValue(int index) { - return value_.get(index); - } - /** - * repeated string value = 1; - */ - public com.google.protobuf.ByteString - getValueBytes(int index) { - return value_.getByteString(index); - } - /** - * repeated string value = 1; - */ - public Builder setValue( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string value = 1; - */ - public Builder addValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.add(value); - onChanged(); - return this; - } - /** - * repeated string value = 1; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated string value = 1; - */ - public Builder clearValue() { - value_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string value = 1; - */ - public Builder addValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureValueIsMutable(); - value_.add(value); - 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.CollectionDef.NodeList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.NodeList) - private static final org.tensorflow.proto.framework.CollectionDef.NodeList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef.NodeList(); - } - - public static org.tensorflow.proto.framework.CollectionDef.NodeList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NodeList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NodeList(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.CollectionDef.NodeList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface BytesListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.BytesList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated bytes value = 1; - */ - java.util.List getValueList(); - /** - * repeated bytes value = 1; - */ - int getValueCount(); - /** - * repeated bytes value = 1; - */ - com.google.protobuf.ByteString getValue(int index); - } - /** - *
    -   * BytesList is used for collecting strings and serialized protobufs. For
    -   * example:
    -   * collection_def {
    -   *   key: "trainable_variables"
    -   *   value {
    -   *     bytes_list {
    -   *       value: "\n\017conv1/weights:0\022\024conv1/weights/Assign
    -   *              \032\024conv1/weights/read:0"
    -   *       value: "\n\016conv1/biases:0\022\023conv1/biases/Assign\032
    -   *              \023conv1/biases/read:0"
    -   *     }
    -   *   }
    -   * }
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.BytesList} - */ - public static final class BytesList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.BytesList) - BytesListOrBuilder { - private static final long serialVersionUID = 0L; - // Use BytesList.newBuilder() to construct. - private BytesList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BytesList() { - value_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BytesList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BytesList( - 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)) { - value_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - value_.add(input.readBytes()); - 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)) { - value_ = java.util.Collections.unmodifiableList(value_); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.BytesList.class, org.tensorflow.proto.framework.CollectionDef.BytesList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private java.util.List value_; - /** - * repeated bytes value = 1; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated bytes value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated bytes value = 1; - */ - public com.google.protobuf.ByteString getValue(int index) { - return value_.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 { - for (int i = 0; i < value_.size(); i++) { - output.writeBytes(1, value_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < value_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(value_.get(i)); - } - size += dataSize; - size += 1 * getValueList().size(); - } - 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.CollectionDef.BytesList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef.BytesList other = (org.tensorflow.proto.framework.CollectionDef.BytesList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef.BytesList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList 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.CollectionDef.BytesList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList 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.CollectionDef.BytesList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList 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.CollectionDef.BytesList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList 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.CollectionDef.BytesList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.BytesList 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.CollectionDef.BytesList 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; - } - /** - *
    -     * BytesList is used for collecting strings and serialized protobufs. For
    -     * example:
    -     * collection_def {
    -     *   key: "trainable_variables"
    -     *   value {
    -     *     bytes_list {
    -     *       value: "\n\017conv1/weights:0\022\024conv1/weights/Assign
    -     *              \032\024conv1/weights/read:0"
    -     *       value: "\n\016conv1/biases:0\022\023conv1/biases/Assign\032
    -     *              \023conv1/biases/read:0"
    -     *     }
    -     *   }
    -     * }
    -     * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.BytesList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.BytesList) - org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.BytesList.class, org.tensorflow.proto.framework.CollectionDef.BytesList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.BytesList.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(); - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.BytesList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.BytesList build() { - org.tensorflow.proto.framework.CollectionDef.BytesList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.BytesList buildPartial() { - org.tensorflow.proto.framework.CollectionDef.BytesList result = new org.tensorflow.proto.framework.CollectionDef.BytesList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_ = java.util.Collections.unmodifiableList(value_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.CollectionDef.BytesList) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef.BytesList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef.BytesList other) { - if (other == org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.CollectionDef.BytesList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef.BytesList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List value_ = java.util.Collections.emptyList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = new java.util.ArrayList(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated bytes value = 1; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated bytes value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated bytes value = 1; - */ - public com.google.protobuf.ByteString getValue(int index) { - return value_.get(index); - } - /** - * repeated bytes value = 1; - */ - public Builder setValue( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.set(index, value); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder addValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.add(value); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated bytes value = 1; - */ - public Builder clearValue() { - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.CollectionDef.BytesList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.BytesList) - private static final org.tensorflow.proto.framework.CollectionDef.BytesList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef.BytesList(); - } - - public static org.tensorflow.proto.framework.CollectionDef.BytesList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BytesList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BytesList(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.CollectionDef.BytesList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface Int64ListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.Int64List) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated int64 value = 1 [packed = true]; - */ - java.util.List getValueList(); - /** - * repeated int64 value = 1 [packed = true]; - */ - int getValueCount(); - /** - * repeated int64 value = 1 [packed = true]; - */ - long getValue(int index); - } - /** - *
    -   * Int64List is used for collecting int, int64 and long values.
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.Int64List} - */ - public static final class Int64List extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.Int64List) - Int64ListOrBuilder { - private static final long serialVersionUID = 0L; - // Use Int64List.newBuilder() to construct. - private Int64List(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Int64List() { - value_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Int64List(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Int64List( - 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: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - value_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - value_.addLong(input.readInt64()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - value_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - value_.addLong(input.readInt64()); - } - input.popLimit(limit); - 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)) { - value_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.Int64List.class, org.tensorflow.proto.framework.CollectionDef.Int64List.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.LongList value_; - /** - * repeated int64 value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public long getValue(int index) { - return value_.getLong(index); - } - private int valueMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (getValueList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(valueMemoizedSerializedSize); - } - for (int i = 0; i < value_.size(); i++) { - output.writeInt64NoTag(value_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < value_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(value_.getLong(i)); - } - size += dataSize; - if (!getValueList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - valueMemoizedSerializedSize = dataSize; - } - 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.CollectionDef.Int64List)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef.Int64List other = (org.tensorflow.proto.framework.CollectionDef.Int64List) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef.Int64List parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List 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.CollectionDef.Int64List parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List 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.CollectionDef.Int64List parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List 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.CollectionDef.Int64List parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List 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.CollectionDef.Int64List parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.Int64List 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.CollectionDef.Int64List 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; - } - /** - *
    -     * Int64List is used for collecting int, int64 and long values.
    -     * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.Int64List} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.Int64List) - org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.Int64List.class, org.tensorflow.proto.framework.CollectionDef.Int64List.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.Int64List.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(); - value_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.Int64List getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.Int64List build() { - org.tensorflow.proto.framework.CollectionDef.Int64List result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.Int64List buildPartial() { - org.tensorflow.proto.framework.CollectionDef.Int64List result = new org.tensorflow.proto.framework.CollectionDef.Int64List(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.CollectionDef.Int64List) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef.Int64List)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef.Int64List other) { - if (other == org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.CollectionDef.Int64List parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef.Int64List) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.LongList value_ = emptyLongList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = mutableCopy(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public long getValue(int index) { - return value_.getLong(index); - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder setValue( - int index, long value) { - ensureValueIsMutable(); - value_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder addValue(long value) { - ensureValueIsMutable(); - value_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated int64 value = 1 [packed = true]; - */ - public Builder clearValue() { - value_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.CollectionDef.Int64List) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.Int64List) - private static final org.tensorflow.proto.framework.CollectionDef.Int64List DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef.Int64List(); - } - - public static org.tensorflow.proto.framework.CollectionDef.Int64List getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Int64List parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Int64List(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.CollectionDef.Int64List getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface FloatListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.FloatList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated float value = 1 [packed = true]; - */ - java.util.List getValueList(); - /** - * repeated float value = 1 [packed = true]; - */ - int getValueCount(); - /** - * repeated float value = 1 [packed = true]; - */ - float getValue(int index); - } - /** - *
    -   * FloatList is used for collecting float values.
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.FloatList} - */ - public static final class FloatList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.FloatList) - FloatListOrBuilder { - private static final long serialVersionUID = 0L; - // Use FloatList.newBuilder() to construct. - private FloatList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FloatList() { - value_ = emptyFloatList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FloatList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FloatList( - 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 13: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - value_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - value_.addFloat(input.readFloat()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - value_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - value_.addFloat(input.readFloat()); - } - input.popLimit(limit); - 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)) { - value_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.FloatList.class, org.tensorflow.proto.framework.CollectionDef.FloatList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.FloatList value_; - /** - * repeated float value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return value_; - } - /** - * repeated float value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated float value = 1 [packed = true]; - */ - public float getValue(int index) { - return value_.getFloat(index); - } - private int valueMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (getValueList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(valueMemoizedSerializedSize); - } - for (int i = 0; i < value_.size(); i++) { - output.writeFloatNoTag(value_.getFloat(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * getValueList().size(); - size += dataSize; - if (!getValueList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - valueMemoizedSerializedSize = dataSize; - } - 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.CollectionDef.FloatList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef.FloatList other = (org.tensorflow.proto.framework.CollectionDef.FloatList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef.FloatList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList 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.CollectionDef.FloatList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList 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.CollectionDef.FloatList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList 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.CollectionDef.FloatList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList 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.CollectionDef.FloatList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.FloatList 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.CollectionDef.FloatList 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; - } - /** - *
    -     * FloatList is used for collecting float values.
    -     * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.FloatList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.FloatList) - org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.FloatList.class, org.tensorflow.proto.framework.CollectionDef.FloatList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.FloatList.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(); - value_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.FloatList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.FloatList build() { - org.tensorflow.proto.framework.CollectionDef.FloatList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.FloatList buildPartial() { - org.tensorflow.proto.framework.CollectionDef.FloatList result = new org.tensorflow.proto.framework.CollectionDef.FloatList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - value_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - 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.CollectionDef.FloatList) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef.FloatList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef.FloatList other) { - if (other == org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance()) return this; - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - 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.CollectionDef.FloatList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef.FloatList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = mutableCopy(value_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated float value = 1 [packed = true]; - */ - public java.util.List - getValueList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(value_) : value_; - } - /** - * repeated float value = 1 [packed = true]; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated float value = 1 [packed = true]; - */ - public float getValue(int index) { - return value_.getFloat(index); - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder setValue( - int index, float value) { - ensureValueIsMutable(); - value_.setFloat(index, value); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder addValue(float value) { - ensureValueIsMutable(); - value_.addFloat(value); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder addAllValue( - java.lang.Iterable values) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - return this; - } - /** - * repeated float value = 1 [packed = true]; - */ - public Builder clearValue() { - value_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.CollectionDef.FloatList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.FloatList) - private static final org.tensorflow.proto.framework.CollectionDef.FloatList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef.FloatList(); - } - - public static org.tensorflow.proto.framework.CollectionDef.FloatList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FloatList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FloatList(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.CollectionDef.FloatList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AnyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.AnyList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.protobuf.Any value = 1; - */ - java.util.List - getValueList(); - /** - * repeated .google.protobuf.Any value = 1; - */ - com.google.protobuf.Any getValue(int index); - /** - * repeated .google.protobuf.Any value = 1; - */ - int getValueCount(); - /** - * repeated .google.protobuf.Any value = 1; - */ - java.util.List - getValueOrBuilderList(); - /** - * repeated .google.protobuf.Any value = 1; - */ - com.google.protobuf.AnyOrBuilder getValueOrBuilder( - int index); - } - /** - *
    -   * AnyList is used for collecting Any protos.
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.AnyList} - */ - public static final class AnyList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.AnyList) - AnyListOrBuilder { - private static final long serialVersionUID = 0L; - // Use AnyList.newBuilder() to construct. - private AnyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AnyList() { - value_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AnyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AnyList( - 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)) { - value_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - value_.add( - input.readMessage(com.google.protobuf.Any.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_ & 0x00000001) != 0)) { - value_ = java.util.Collections.unmodifiableList(value_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.AnyList.class, org.tensorflow.proto.framework.CollectionDef.AnyList.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private java.util.List value_; - /** - * repeated .google.protobuf.Any value = 1; - */ - public java.util.List getValueList() { - return value_; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public java.util.List - getValueOrBuilderList() { - return value_; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public int getValueCount() { - return value_.size(); - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.Any getValue(int index) { - return value_.get(index); - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.AnyOrBuilder getValueOrBuilder( - int index) { - return value_.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 { - for (int i = 0; i < value_.size(); i++) { - output.writeMessage(1, value_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < value_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, value_.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.CollectionDef.AnyList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef.AnyList other = (org.tensorflow.proto.framework.CollectionDef.AnyList) obj; - - if (!getValueList() - .equals(other.getValueList())) 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 (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef.AnyList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList 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.CollectionDef.AnyList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList 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.CollectionDef.AnyList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList 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.CollectionDef.AnyList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList 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.CollectionDef.AnyList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef.AnyList 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.CollectionDef.AnyList 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; - } - /** - *
    -     * AnyList is used for collecting Any protos.
    -     * 
    - * - * Protobuf type {@code tensorflow.CollectionDef.AnyList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.AnyList) - org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.AnyList.class, org.tensorflow.proto.framework.CollectionDef.AnyList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.AnyList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getValueFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (valueBuilder_ == null) { - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - valueBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.AnyList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.AnyList build() { - org.tensorflow.proto.framework.CollectionDef.AnyList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef.AnyList buildPartial() { - org.tensorflow.proto.framework.CollectionDef.AnyList result = new org.tensorflow.proto.framework.CollectionDef.AnyList(this); - int from_bitField0_ = bitField0_; - if (valueBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - value_ = java.util.Collections.unmodifiableList(value_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.value_ = value_; - } else { - result.value_ = valueBuilder_.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.CollectionDef.AnyList) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef.AnyList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef.AnyList other) { - if (other == org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance()) return this; - if (valueBuilder_ == null) { - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - } else { - if (!other.value_.isEmpty()) { - if (valueBuilder_.isEmpty()) { - valueBuilder_.dispose(); - valueBuilder_ = null; - value_ = other.value_; - bitField0_ = (bitField0_ & ~0x00000001); - valueBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getValueFieldBuilder() : null; - } else { - valueBuilder_.addAllMessages(other.value_); - } - } - } - 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.CollectionDef.AnyList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef.AnyList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List value_ = - java.util.Collections.emptyList(); - private void ensureValueIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - value_ = new java.util.ArrayList(value_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> valueBuilder_; - - /** - * repeated .google.protobuf.Any value = 1; - */ - public java.util.List getValueList() { - if (valueBuilder_ == null) { - return java.util.Collections.unmodifiableList(value_); - } else { - return valueBuilder_.getMessageList(); - } - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public int getValueCount() { - if (valueBuilder_ == null) { - return value_.size(); - } else { - return valueBuilder_.getCount(); - } - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.Any getValue(int index) { - if (valueBuilder_ == null) { - return value_.get(index); - } else { - return valueBuilder_.getMessage(index); - } - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder setValue( - int index, com.google.protobuf.Any value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.set(index, value); - onChanged(); - } else { - valueBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder setValue( - int index, com.google.protobuf.Any.Builder builderForValue) { - if (valueBuilder_ == null) { - ensureValueIsMutable(); - value_.set(index, builderForValue.build()); - onChanged(); - } else { - valueBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder addValue(com.google.protobuf.Any value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.add(value); - onChanged(); - } else { - valueBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder addValue( - int index, com.google.protobuf.Any value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValueIsMutable(); - value_.add(index, value); - onChanged(); - } else { - valueBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder addValue( - com.google.protobuf.Any.Builder builderForValue) { - if (valueBuilder_ == null) { - ensureValueIsMutable(); - value_.add(builderForValue.build()); - onChanged(); - } else { - valueBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder addValue( - int index, com.google.protobuf.Any.Builder builderForValue) { - if (valueBuilder_ == null) { - ensureValueIsMutable(); - value_.add(index, builderForValue.build()); - onChanged(); - } else { - valueBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder addAllValue( - java.lang.Iterable values) { - if (valueBuilder_ == null) { - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, value_); - onChanged(); - } else { - valueBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder clearValue() { - if (valueBuilder_ == null) { - value_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - valueBuilder_.clear(); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public Builder removeValue(int index) { - if (valueBuilder_ == null) { - ensureValueIsMutable(); - value_.remove(index); - onChanged(); - } else { - valueBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.Any.Builder getValueBuilder( - int index) { - return getValueFieldBuilder().getBuilder(index); - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.AnyOrBuilder getValueOrBuilder( - int index) { - if (valueBuilder_ == null) { - return value_.get(index); } else { - return valueBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public java.util.List - getValueOrBuilderList() { - if (valueBuilder_ != null) { - return valueBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(value_); - } - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.Any.Builder addValueBuilder() { - return getValueFieldBuilder().addBuilder( - com.google.protobuf.Any.getDefaultInstance()); - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public com.google.protobuf.Any.Builder addValueBuilder( - int index) { - return getValueFieldBuilder().addBuilder( - index, com.google.protobuf.Any.getDefaultInstance()); - } - /** - * repeated .google.protobuf.Any value = 1; - */ - public java.util.List - getValueBuilderList() { - return getValueFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getValueFieldBuilder() { - if (valueBuilder_ == null) { - valueBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - value_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - value_ = null; - } - return valueBuilder_; - } - @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.CollectionDef.AnyList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.AnyList) - private static final org.tensorflow.proto.framework.CollectionDef.AnyList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef.AnyList(); - } - - public static org.tensorflow.proto.framework.CollectionDef.AnyList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AnyList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AnyList(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.CollectionDef.AnyList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - NODE_LIST(1), - BYTES_LIST(2), - INT64_LIST(3), - FLOAT_LIST(4), - ANY_LIST(5), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: return NODE_LIST; - case 2: return BYTES_LIST; - case 3: return INT64_LIST; - case 4: return FLOAT_LIST; - case 5: return ANY_LIST; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int NODE_LIST_FIELD_NUMBER = 1; - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public boolean hasNodeList() { - return kindCase_ == 1; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public org.tensorflow.proto.framework.CollectionDef.NodeList getNodeList() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder getNodeListOrBuilder() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - - public static final int BYTES_LIST_FIELD_NUMBER = 2; - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public boolean hasBytesList() { - return kindCase_ == 2; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public org.tensorflow.proto.framework.CollectionDef.BytesList getBytesList() { - if (kindCase_ == 2) { - return (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder getBytesListOrBuilder() { - if (kindCase_ == 2) { - return (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - - public static final int INT64_LIST_FIELD_NUMBER = 3; - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public boolean hasInt64List() { - return kindCase_ == 3; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public org.tensorflow.proto.framework.CollectionDef.Int64List getInt64List() { - if (kindCase_ == 3) { - return (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder() { - if (kindCase_ == 3) { - return (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - - public static final int FLOAT_LIST_FIELD_NUMBER = 4; - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public boolean hasFloatList() { - return kindCase_ == 4; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public org.tensorflow.proto.framework.CollectionDef.FloatList getFloatList() { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder getFloatListOrBuilder() { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - - public static final int ANY_LIST_FIELD_NUMBER = 5; - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public boolean hasAnyList() { - return kindCase_ == 5; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public org.tensorflow.proto.framework.CollectionDef.AnyList getAnyList() { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder getAnyListOrBuilder() { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - - 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 (kindCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_); - } - if (kindCase_ == 2) { - output.writeMessage(2, (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_); - } - if (kindCase_ == 3) { - output.writeMessage(3, (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_); - } - if (kindCase_ == 4) { - output.writeMessage(4, (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_); - } - if (kindCase_ == 5) { - output.writeMessage(5, (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_); - } - if (kindCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_); - } - if (kindCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_); - } - if (kindCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_); - } - if (kindCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_); - } - 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.CollectionDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CollectionDef other = (org.tensorflow.proto.framework.CollectionDef) obj; - - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 1: - if (!getNodeList() - .equals(other.getNodeList())) return false; - break; - case 2: - if (!getBytesList() - .equals(other.getBytesList())) return false; - break; - case 3: - if (!getInt64List() - .equals(other.getInt64List())) return false; - break; - case 4: - if (!getFloatList() - .equals(other.getFloatList())) return false; - break; - case 5: - if (!getAnyList() - .equals(other.getAnyList())) return false; - break; - case 0: - default: - } - 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(); - switch (kindCase_) { - case 1: - hash = (37 * hash) + NODE_LIST_FIELD_NUMBER; - hash = (53 * hash) + getNodeList().hashCode(); - break; - case 2: - hash = (37 * hash) + BYTES_LIST_FIELD_NUMBER; - hash = (53 * hash) + getBytesList().hashCode(); - break; - case 3: - hash = (37 * hash) + INT64_LIST_FIELD_NUMBER; - hash = (53 * hash) + getInt64List().hashCode(); - break; - case 4: - hash = (37 * hash) + FLOAT_LIST_FIELD_NUMBER; - hash = (53 * hash) + getFloatList().hashCode(); - break; - case 5: - hash = (37 * hash) + ANY_LIST_FIELD_NUMBER; - hash = (53 * hash) + getAnyList().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CollectionDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef 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.CollectionDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef 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.CollectionDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CollectionDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CollectionDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef 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.CollectionDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef 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.CollectionDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CollectionDef 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.CollectionDef 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; - } - /** - *
    -   * CollectionDef should cover most collections.
    -   * To add a user-defined collection, do one of the following:
    -   * 1. For simple data types, such as string, int, float:
    -   *      tf.add_to_collection("your_collection_name", your_simple_value)
    -   *    strings will be stored as bytes_list.
    -   * 2. For Protobuf types, there are three ways to add them:
    -   *    1) tf.add_to_collection("your_collection_name",
    -   *         your_proto.SerializeToString())
    -   *       collection_def {
    -   *         key: "user_defined_bytes_collection"
    -   *         value {
    -   *           bytes_list {
    -   *             value: "queue_name: \"test_queue\"\n"
    -   *           }
    -   *         }
    -   *       }
    -   *  or
    -   *    2) tf.add_to_collection("your_collection_name", str(your_proto))
    -   *       collection_def {
    -   *         key: "user_defined_string_collection"
    -   *         value {
    -   *          bytes_list {
    -   *             value: "\n\ntest_queue"
    -   *           }
    -   *         }
    -   *       }
    -   *  or
    -   *    3) any_buf = any_pb2.Any()
    -   *       tf.add_to_collection("your_collection_name",
    -   *         any_buf.Pack(your_proto))
    -   *       collection_def {
    -   *         key: "user_defined_any_collection"
    -   *         value {
    -   *           any_list {
    -   *             value {
    -   *               type_url: "type.googleapis.com/tensorflow.QueueRunnerDef"
    -   *               value: "\n\ntest_queue"
    -   *             }
    -   *           }
    -   *         }
    -   *       }
    -   * 3. For Python objects, implement to_proto() and from_proto(), and register
    -   *    them in the following manner:
    -   *    ops.register_proto_function("your_collection_name",
    -   *                                proto_type,
    -   *                                to_proto=YourPythonObject.to_proto,
    -   *                                from_proto=YourPythonObject.from_proto)
    -   *    These functions will be invoked to serialize and de-serialize the
    -   *    collection. For example,
    -   *    ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES,
    -   *                                proto_type=variable_pb2.VariableDef,
    -   *                                to_proto=Variable.to_proto,
    -   *                                from_proto=Variable.from_proto)
    -   * 
    - * - * Protobuf type {@code tensorflow.CollectionDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef) - org.tensorflow.proto.framework.CollectionDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CollectionDef.class, org.tensorflow.proto.framework.CollectionDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CollectionDef.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(); - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CollectionDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef build() { - org.tensorflow.proto.framework.CollectionDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CollectionDef buildPartial() { - org.tensorflow.proto.framework.CollectionDef result = new org.tensorflow.proto.framework.CollectionDef(this); - if (kindCase_ == 1) { - if (nodeListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = nodeListBuilder_.build(); - } - } - if (kindCase_ == 2) { - if (bytesListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = bytesListBuilder_.build(); - } - } - if (kindCase_ == 3) { - if (int64ListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = int64ListBuilder_.build(); - } - } - if (kindCase_ == 4) { - if (floatListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = floatListBuilder_.build(); - } - } - if (kindCase_ == 5) { - if (anyListBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = anyListBuilder_.build(); - } - } - result.kindCase_ = kindCase_; - 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.CollectionDef) { - return mergeFrom((org.tensorflow.proto.framework.CollectionDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CollectionDef other) { - if (other == org.tensorflow.proto.framework.CollectionDef.getDefaultInstance()) return this; - switch (other.getKindCase()) { - case NODE_LIST: { - mergeNodeList(other.getNodeList()); - break; - } - case BYTES_LIST: { - mergeBytesList(other.getBytesList()); - break; - } - case INT64_LIST: { - mergeInt64List(other.getInt64List()); - break; - } - case FLOAT_LIST: { - mergeFloatList(other.getFloatList()); - break; - } - case ANY_LIST: { - mergeAnyList(other.getAnyList()); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.CollectionDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CollectionDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.NodeList, org.tensorflow.proto.framework.CollectionDef.NodeList.Builder, org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder> nodeListBuilder_; - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public boolean hasNodeList() { - return kindCase_ == 1; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public org.tensorflow.proto.framework.CollectionDef.NodeList getNodeList() { - if (nodeListBuilder_ == null) { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } else { - if (kindCase_ == 1) { - return nodeListBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public Builder setNodeList(org.tensorflow.proto.framework.CollectionDef.NodeList value) { - if (nodeListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - nodeListBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public Builder setNodeList( - org.tensorflow.proto.framework.CollectionDef.NodeList.Builder builderForValue) { - if (nodeListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - nodeListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public Builder mergeNodeList(org.tensorflow.proto.framework.CollectionDef.NodeList value) { - if (nodeListBuilder_ == null) { - if (kindCase_ == 1 && - kind_ != org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CollectionDef.NodeList.newBuilder((org.tensorflow.proto.framework.CollectionDef.NodeList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 1) { - nodeListBuilder_.mergeFrom(value); - } - nodeListBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public Builder clearNodeList() { - if (nodeListBuilder_ == null) { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - } - nodeListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public org.tensorflow.proto.framework.CollectionDef.NodeList.Builder getNodeListBuilder() { - return getNodeListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - public org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder getNodeListOrBuilder() { - if ((kindCase_ == 1) && (nodeListBuilder_ != null)) { - return nodeListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.NodeList, org.tensorflow.proto.framework.CollectionDef.NodeList.Builder, org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder> - getNodeListFieldBuilder() { - if (nodeListBuilder_ == null) { - if (!(kindCase_ == 1)) { - kind_ = org.tensorflow.proto.framework.CollectionDef.NodeList.getDefaultInstance(); - } - nodeListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.NodeList, org.tensorflow.proto.framework.CollectionDef.NodeList.Builder, org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder>( - (org.tensorflow.proto.framework.CollectionDef.NodeList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 1; - onChanged();; - return nodeListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.BytesList, org.tensorflow.proto.framework.CollectionDef.BytesList.Builder, org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder> bytesListBuilder_; - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public boolean hasBytesList() { - return kindCase_ == 2; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public org.tensorflow.proto.framework.CollectionDef.BytesList getBytesList() { - if (bytesListBuilder_ == null) { - if (kindCase_ == 2) { - return (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } else { - if (kindCase_ == 2) { - return bytesListBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public Builder setBytesList(org.tensorflow.proto.framework.CollectionDef.BytesList value) { - if (bytesListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - bytesListBuilder_.setMessage(value); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public Builder setBytesList( - org.tensorflow.proto.framework.CollectionDef.BytesList.Builder builderForValue) { - if (bytesListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - bytesListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public Builder mergeBytesList(org.tensorflow.proto.framework.CollectionDef.BytesList value) { - if (bytesListBuilder_ == null) { - if (kindCase_ == 2 && - kind_ != org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CollectionDef.BytesList.newBuilder((org.tensorflow.proto.framework.CollectionDef.BytesList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 2) { - bytesListBuilder_.mergeFrom(value); - } - bytesListBuilder_.setMessage(value); - } - kindCase_ = 2; - return this; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public Builder clearBytesList() { - if (bytesListBuilder_ == null) { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - } - bytesListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public org.tensorflow.proto.framework.CollectionDef.BytesList.Builder getBytesListBuilder() { - return getBytesListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - public org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder getBytesListOrBuilder() { - if ((kindCase_ == 2) && (bytesListBuilder_ != null)) { - return bytesListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 2) { - return (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.BytesList, org.tensorflow.proto.framework.CollectionDef.BytesList.Builder, org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder> - getBytesListFieldBuilder() { - if (bytesListBuilder_ == null) { - if (!(kindCase_ == 2)) { - kind_ = org.tensorflow.proto.framework.CollectionDef.BytesList.getDefaultInstance(); - } - bytesListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.BytesList, org.tensorflow.proto.framework.CollectionDef.BytesList.Builder, org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder>( - (org.tensorflow.proto.framework.CollectionDef.BytesList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 2; - onChanged();; - return bytesListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.Int64List, org.tensorflow.proto.framework.CollectionDef.Int64List.Builder, org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder> int64ListBuilder_; - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public boolean hasInt64List() { - return kindCase_ == 3; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public org.tensorflow.proto.framework.CollectionDef.Int64List getInt64List() { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3) { - return (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } else { - if (kindCase_ == 3) { - return int64ListBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public Builder setInt64List(org.tensorflow.proto.framework.CollectionDef.Int64List value) { - if (int64ListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - int64ListBuilder_.setMessage(value); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public Builder setInt64List( - org.tensorflow.proto.framework.CollectionDef.Int64List.Builder builderForValue) { - if (int64ListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - int64ListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public Builder mergeInt64List(org.tensorflow.proto.framework.CollectionDef.Int64List value) { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3 && - kind_ != org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CollectionDef.Int64List.newBuilder((org.tensorflow.proto.framework.CollectionDef.Int64List) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 3) { - int64ListBuilder_.mergeFrom(value); - } - int64ListBuilder_.setMessage(value); - } - kindCase_ = 3; - return this; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public Builder clearInt64List() { - if (int64ListBuilder_ == null) { - if (kindCase_ == 3) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 3) { - kindCase_ = 0; - kind_ = null; - } - int64ListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public org.tensorflow.proto.framework.CollectionDef.Int64List.Builder getInt64ListBuilder() { - return getInt64ListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - public org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder() { - if ((kindCase_ == 3) && (int64ListBuilder_ != null)) { - return int64ListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 3) { - return (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.Int64List, org.tensorflow.proto.framework.CollectionDef.Int64List.Builder, org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder> - getInt64ListFieldBuilder() { - if (int64ListBuilder_ == null) { - if (!(kindCase_ == 3)) { - kind_ = org.tensorflow.proto.framework.CollectionDef.Int64List.getDefaultInstance(); - } - int64ListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.Int64List, org.tensorflow.proto.framework.CollectionDef.Int64List.Builder, org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder>( - (org.tensorflow.proto.framework.CollectionDef.Int64List) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 3; - onChanged();; - return int64ListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.FloatList, org.tensorflow.proto.framework.CollectionDef.FloatList.Builder, org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder> floatListBuilder_; - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public boolean hasFloatList() { - return kindCase_ == 4; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public org.tensorflow.proto.framework.CollectionDef.FloatList getFloatList() { - if (floatListBuilder_ == null) { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } else { - if (kindCase_ == 4) { - return floatListBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public Builder setFloatList(org.tensorflow.proto.framework.CollectionDef.FloatList value) { - if (floatListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - floatListBuilder_.setMessage(value); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public Builder setFloatList( - org.tensorflow.proto.framework.CollectionDef.FloatList.Builder builderForValue) { - if (floatListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - floatListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public Builder mergeFloatList(org.tensorflow.proto.framework.CollectionDef.FloatList value) { - if (floatListBuilder_ == null) { - if (kindCase_ == 4 && - kind_ != org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CollectionDef.FloatList.newBuilder((org.tensorflow.proto.framework.CollectionDef.FloatList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 4) { - floatListBuilder_.mergeFrom(value); - } - floatListBuilder_.setMessage(value); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public Builder clearFloatList() { - if (floatListBuilder_ == null) { - if (kindCase_ == 4) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 4) { - kindCase_ = 0; - kind_ = null; - } - floatListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public org.tensorflow.proto.framework.CollectionDef.FloatList.Builder getFloatListBuilder() { - return getFloatListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - public org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder getFloatListOrBuilder() { - if ((kindCase_ == 4) && (floatListBuilder_ != null)) { - return floatListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.FloatList, org.tensorflow.proto.framework.CollectionDef.FloatList.Builder, org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder> - getFloatListFieldBuilder() { - if (floatListBuilder_ == null) { - if (!(kindCase_ == 4)) { - kind_ = org.tensorflow.proto.framework.CollectionDef.FloatList.getDefaultInstance(); - } - floatListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.FloatList, org.tensorflow.proto.framework.CollectionDef.FloatList.Builder, org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder>( - (org.tensorflow.proto.framework.CollectionDef.FloatList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 4; - onChanged();; - return floatListBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.AnyList, org.tensorflow.proto.framework.CollectionDef.AnyList.Builder, org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder> anyListBuilder_; - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public boolean hasAnyList() { - return kindCase_ == 5; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public org.tensorflow.proto.framework.CollectionDef.AnyList getAnyList() { - if (anyListBuilder_ == null) { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } else { - if (kindCase_ == 5) { - return anyListBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public Builder setAnyList(org.tensorflow.proto.framework.CollectionDef.AnyList value) { - if (anyListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - anyListBuilder_.setMessage(value); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public Builder setAnyList( - org.tensorflow.proto.framework.CollectionDef.AnyList.Builder builderForValue) { - if (anyListBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - anyListBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public Builder mergeAnyList(org.tensorflow.proto.framework.CollectionDef.AnyList value) { - if (anyListBuilder_ == null) { - if (kindCase_ == 5 && - kind_ != org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CollectionDef.AnyList.newBuilder((org.tensorflow.proto.framework.CollectionDef.AnyList) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 5) { - anyListBuilder_.mergeFrom(value); - } - anyListBuilder_.setMessage(value); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public Builder clearAnyList() { - if (anyListBuilder_ == null) { - if (kindCase_ == 5) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 5) { - kindCase_ = 0; - kind_ = null; - } - anyListBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public org.tensorflow.proto.framework.CollectionDef.AnyList.Builder getAnyListBuilder() { - return getAnyListFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - public org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder getAnyListOrBuilder() { - if ((kindCase_ == 5) && (anyListBuilder_ != null)) { - return anyListBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_; - } - return org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - } - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.AnyList, org.tensorflow.proto.framework.CollectionDef.AnyList.Builder, org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder> - getAnyListFieldBuilder() { - if (anyListBuilder_ == null) { - if (!(kindCase_ == 5)) { - kind_ = org.tensorflow.proto.framework.CollectionDef.AnyList.getDefaultInstance(); - } - anyListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CollectionDef.AnyList, org.tensorflow.proto.framework.CollectionDef.AnyList.Builder, org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder>( - (org.tensorflow.proto.framework.CollectionDef.AnyList) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 5; - onChanged();; - return anyListBuilder_; - } - @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.CollectionDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef) - private static final org.tensorflow.proto.framework.CollectionDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CollectionDef(); - } - - public static org.tensorflow.proto.framework.CollectionDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CollectionDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CollectionDef(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.CollectionDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDefOrBuilder.java deleted file mode 100644 index f3d5fc7ce61..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CollectionDefOrBuilder.java +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -public interface CollectionDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - boolean hasNodeList(); - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - org.tensorflow.proto.framework.CollectionDef.NodeList getNodeList(); - /** - * .tensorflow.CollectionDef.NodeList node_list = 1; - */ - org.tensorflow.proto.framework.CollectionDef.NodeListOrBuilder getNodeListOrBuilder(); - - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - boolean hasBytesList(); - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - org.tensorflow.proto.framework.CollectionDef.BytesList getBytesList(); - /** - * .tensorflow.CollectionDef.BytesList bytes_list = 2; - */ - org.tensorflow.proto.framework.CollectionDef.BytesListOrBuilder getBytesListOrBuilder(); - - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - boolean hasInt64List(); - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - org.tensorflow.proto.framework.CollectionDef.Int64List getInt64List(); - /** - * .tensorflow.CollectionDef.Int64List int64_list = 3; - */ - org.tensorflow.proto.framework.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder(); - - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - boolean hasFloatList(); - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - org.tensorflow.proto.framework.CollectionDef.FloatList getFloatList(); - /** - * .tensorflow.CollectionDef.FloatList float_list = 4; - */ - org.tensorflow.proto.framework.CollectionDef.FloatListOrBuilder getFloatListOrBuilder(); - - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - boolean hasAnyList(); - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - org.tensorflow.proto.framework.CollectionDef.AnyList getAnyList(); - /** - * .tensorflow.CollectionDef.AnyList any_list = 5; - */ - org.tensorflow.proto.framework.CollectionDef.AnyListOrBuilder getAnyListOrBuilder(); - - public org.tensorflow.proto.framework.CollectionDef.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CompositeTensorVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CompositeTensorVariant.java deleted file mode 100644 index 2ccec36143b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CompositeTensorVariant.java +++ /dev/null @@ -1,682 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/composite_tensor_variant.proto - -package org.tensorflow.proto.framework; - -public final class CompositeTensorVariant { - private CompositeTensorVariant() {} - 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 CompositeTensorVariantMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CompositeTensorVariantMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - boolean hasTypeSpecProto(); - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - org.tensorflow.proto.framework.TypeSpecProto getTypeSpecProto(); - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder(); - } - /** - *
    -   * Metadata for CompositeTensorVariant, used when serializing as Variant.
    -   * We define a new message here (rather than directly using TypeSpecProto for
    -   * the metadata string) to retain flexibility to change the metadata encoding
    -   * to support additional features.
    -   * 
    - * - * Protobuf type {@code tensorflow.CompositeTensorVariantMetadata} - */ - public static final class CompositeTensorVariantMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CompositeTensorVariantMetadata) - CompositeTensorVariantMetadataOrBuilder { - private static final long serialVersionUID = 0L; - // Use CompositeTensorVariantMetadata.newBuilder() to construct. - private CompositeTensorVariantMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CompositeTensorVariantMetadata() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CompositeTensorVariantMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CompositeTensorVariantMetadata( - 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: { - org.tensorflow.proto.framework.TypeSpecProto.Builder subBuilder = null; - if (typeSpecProto_ != null) { - subBuilder = typeSpecProto_.toBuilder(); - } - typeSpecProto_ = input.readMessage(org.tensorflow.proto.framework.TypeSpecProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeSpecProto_); - typeSpecProto_ = subBuilder.buildPartial(); - } - - 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.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.class, org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.Builder.class); - } - - public static final int TYPE_SPEC_PROTO_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.TypeSpecProto typeSpecProto_; - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public boolean hasTypeSpecProto() { - return typeSpecProto_ != null; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpecProto() { - return typeSpecProto_ == null ? org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpecProto_; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder() { - return getTypeSpecProto(); - } - - 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 (typeSpecProto_ != null) { - output.writeMessage(1, getTypeSpecProto()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeSpecProto_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTypeSpecProto()); - } - 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.CompositeTensorVariant.CompositeTensorVariantMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata other = (org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata) obj; - - if (hasTypeSpecProto() != other.hasTypeSpecProto()) return false; - if (hasTypeSpecProto()) { - if (!getTypeSpecProto() - .equals(other.getTypeSpecProto())) 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 (hasTypeSpecProto()) { - hash = (37 * hash) + TYPE_SPEC_PROTO_FIELD_NUMBER; - hash = (53 * hash) + getTypeSpecProto().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata 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; - } - /** - *
    -     * Metadata for CompositeTensorVariant, used when serializing as Variant.
    -     * We define a new message here (rather than directly using TypeSpecProto for
    -     * the metadata string) to retain flexibility to change the metadata encoding
    -     * to support additional features.
    -     * 
    - * - * Protobuf type {@code tensorflow.CompositeTensorVariantMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CompositeTensorVariantMetadata) - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.class, org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.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 (typeSpecProtoBuilder_ == null) { - typeSpecProto_ = null; - } else { - typeSpecProto_ = null; - typeSpecProtoBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata build() { - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata buildPartial() { - org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata result = new org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata(this); - if (typeSpecProtoBuilder_ == null) { - result.typeSpecProto_ = typeSpecProto_; - } else { - result.typeSpecProto_ = typeSpecProtoBuilder_.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.CompositeTensorVariant.CompositeTensorVariantMetadata) { - return mergeFrom((org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata other) { - if (other == org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata.getDefaultInstance()) return this; - if (other.hasTypeSpecProto()) { - mergeTypeSpecProto(other.getTypeSpecProto()); - } - 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.CompositeTensorVariant.CompositeTensorVariantMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.framework.TypeSpecProto typeSpecProto_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> typeSpecProtoBuilder_; - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public boolean hasTypeSpecProto() { - return typeSpecProtoBuilder_ != null || typeSpecProto_ != null; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpecProto() { - if (typeSpecProtoBuilder_ == null) { - return typeSpecProto_ == null ? org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpecProto_; - } else { - return typeSpecProtoBuilder_.getMessage(); - } - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public Builder setTypeSpecProto(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecProtoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - typeSpecProto_ = value; - onChanged(); - } else { - typeSpecProtoBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public Builder setTypeSpecProto( - org.tensorflow.proto.framework.TypeSpecProto.Builder builderForValue) { - if (typeSpecProtoBuilder_ == null) { - typeSpecProto_ = builderForValue.build(); - onChanged(); - } else { - typeSpecProtoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public Builder mergeTypeSpecProto(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecProtoBuilder_ == null) { - if (typeSpecProto_ != null) { - typeSpecProto_ = - org.tensorflow.proto.framework.TypeSpecProto.newBuilder(typeSpecProto_).mergeFrom(value).buildPartial(); - } else { - typeSpecProto_ = value; - } - onChanged(); - } else { - typeSpecProtoBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public Builder clearTypeSpecProto() { - if (typeSpecProtoBuilder_ == null) { - typeSpecProto_ = null; - onChanged(); - } else { - typeSpecProto_ = null; - typeSpecProtoBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto.Builder getTypeSpecProtoBuilder() { - - onChanged(); - return getTypeSpecProtoFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder() { - if (typeSpecProtoBuilder_ != null) { - return typeSpecProtoBuilder_.getMessageOrBuilder(); - } else { - return typeSpecProto_ == null ? - org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpecProto_; - } - } - /** - * .tensorflow.TypeSpecProto type_spec_proto = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> - getTypeSpecProtoFieldBuilder() { - if (typeSpecProtoBuilder_ == null) { - typeSpecProtoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder>( - getTypeSpecProto(), - getParentForChildren(), - isClean()); - typeSpecProto_ = null; - } - return typeSpecProtoBuilder_; - } - @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.CompositeTensorVariantMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CompositeTensorVariantMetadata) - private static final org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata(); - } - - public static org.tensorflow.proto.framework.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CompositeTensorVariantMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CompositeTensorVariantMetadata(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.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n7tensorflow/core/protobuf/composite_ten" + - "sor_variant.proto\022\ntensorflow\032%tensorflo" + - "w/core/protobuf/struct.proto\"T\n\036Composit" + - "eTensorVariantMetadata\0222\n\017type_spec_prot" + - "o\030\001 \001(\0132\031.tensorflow.TypeSpecProtoBw\n\036or" + - "g.tensorflow.proto.frameworkZUgithub.com" + - "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/protobuf/for_core_protos_go_protob\006pro" + - "to3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.StructProtos.getDescriptor(), - }); - internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor, - new java.lang.String[] { "TypeSpecProto", }); - org.tensorflow.proto.framework.StructProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDef.java deleted file mode 100644 index 3ab6d340e10..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDef.java +++ /dev/null @@ -1,1632 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/control_flow.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a CondContext object.
    - * 
    - * - * Protobuf type {@code tensorflow.CondContextDef} - */ -public final class CondContextDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CondContextDef) - CondContextDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use CondContextDef.newBuilder() to construct. - private CondContextDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CondContextDef() { - contextName_ = ""; - predName_ = ""; - pivotName_ = ""; - nestedContexts_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CondContextDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CondContextDef( - 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(); - - contextName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - predName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pivotName_ = s; - break; - } - case 32: { - - branch_ = input.readInt32(); - break; - } - case 42: { - org.tensorflow.proto.framework.ValuesDef.Builder subBuilder = null; - if (valuesDef_ != null) { - subBuilder = valuesDef_.toBuilder(); - } - valuesDef_ = input.readMessage(org.tensorflow.proto.framework.ValuesDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(valuesDef_); - valuesDef_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - nestedContexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nestedContexts_.add( - input.readMessage(org.tensorflow.proto.framework.ControlFlowContextDef.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_ & 0x00000001) != 0)) { - nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_CondContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CondContextDef.class, org.tensorflow.proto.framework.CondContextDef.Builder.class); - } - - public static final int CONTEXT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object contextName_; - /** - *
    -   * Name of the context.
    -   * 
    - * - * string context_name = 1; - */ - public java.lang.String getContextName() { - java.lang.Object ref = contextName_; - 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(); - contextName_ = s; - return s; - } - } - /** - *
    -   * Name of the context.
    -   * 
    - * - * string context_name = 1; - */ - public com.google.protobuf.ByteString - getContextNameBytes() { - java.lang.Object ref = contextName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contextName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRED_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object predName_; - /** - *
    -   * Name of the pred tensor.
    -   * 
    - * - * string pred_name = 2; - */ - public java.lang.String getPredName() { - java.lang.Object ref = predName_; - 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(); - predName_ = s; - return s; - } - } - /** - *
    -   * Name of the pred tensor.
    -   * 
    - * - * string pred_name = 2; - */ - public com.google.protobuf.ByteString - getPredNameBytes() { - java.lang.Object ref = predName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - predName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PIVOT_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object pivotName_; - /** - *
    -   * Name of the pivot tensor.
    -   * 
    - * - * string pivot_name = 3; - */ - public java.lang.String getPivotName() { - java.lang.Object ref = pivotName_; - 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(); - pivotName_ = s; - return s; - } - } - /** - *
    -   * Name of the pivot tensor.
    -   * 
    - * - * string pivot_name = 3; - */ - public com.google.protobuf.ByteString - getPivotNameBytes() { - java.lang.Object ref = pivotName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BRANCH_FIELD_NUMBER = 4; - private int branch_; - /** - *
    -   * Branch prediction. 0 or 1.
    -   * 
    - * - * int32 branch = 4; - */ - public int getBranch() { - return branch_; - } - - public static final int VALUES_DEF_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.ValuesDef valuesDef_; - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public boolean hasValuesDef() { - return valuesDef_ != null; - } - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public org.tensorflow.proto.framework.ValuesDef getValuesDef() { - return valuesDef_ == null ? org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder() { - return getValuesDef(); - } - - public static final int NESTED_CONTEXTS_FIELD_NUMBER = 6; - private java.util.List nestedContexts_; - /** - *
    -   * Contexts contained inside this context (e.g. nested conds).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public java.util.List getNestedContextsList() { - return nestedContexts_; - } - /** - *
    -   * Contexts contained inside this context (e.g. nested conds).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public java.util.List - getNestedContextsOrBuilderList() { - return nestedContexts_; - } - /** - *
    -   * Contexts contained inside this context (e.g. nested conds).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public int getNestedContextsCount() { - return nestedContexts_.size(); - } - /** - *
    -   * Contexts contained inside this context (e.g. nested conds).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index) { - return nestedContexts_.get(index); - } - /** - *
    -   * Contexts contained inside this context (e.g. nested conds).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( - int index) { - return nestedContexts_.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 { - if (!getContextNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contextName_); - } - if (!getPredNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, predName_); - } - if (!getPivotNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pivotName_); - } - if (branch_ != 0) { - output.writeInt32(4, branch_); - } - if (valuesDef_ != null) { - output.writeMessage(5, getValuesDef()); - } - for (int i = 0; i < nestedContexts_.size(); i++) { - output.writeMessage(6, nestedContexts_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getContextNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contextName_); - } - if (!getPredNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, predName_); - } - if (!getPivotNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pivotName_); - } - if (branch_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, branch_); - } - if (valuesDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getValuesDef()); - } - for (int i = 0; i < nestedContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, nestedContexts_.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.CondContextDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CondContextDef other = (org.tensorflow.proto.framework.CondContextDef) obj; - - if (!getContextName() - .equals(other.getContextName())) return false; - if (!getPredName() - .equals(other.getPredName())) return false; - if (!getPivotName() - .equals(other.getPivotName())) return false; - if (getBranch() - != other.getBranch()) return false; - if (hasValuesDef() != other.hasValuesDef()) return false; - if (hasValuesDef()) { - if (!getValuesDef() - .equals(other.getValuesDef())) return false; - } - if (!getNestedContextsList() - .equals(other.getNestedContextsList())) 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) + CONTEXT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getContextName().hashCode(); - hash = (37 * hash) + PRED_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPredName().hashCode(); - hash = (37 * hash) + PIVOT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPivotName().hashCode(); - hash = (37 * hash) + BRANCH_FIELD_NUMBER; - hash = (53 * hash) + getBranch(); - if (hasValuesDef()) { - hash = (37 * hash) + VALUES_DEF_FIELD_NUMBER; - hash = (53 * hash) + getValuesDef().hashCode(); - } - if (getNestedContextsCount() > 0) { - hash = (37 * hash) + NESTED_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getNestedContextsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CondContextDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CondContextDef 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.CondContextDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CondContextDef 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.CondContextDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CondContextDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CondContextDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CondContextDef 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.CondContextDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CondContextDef 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.CondContextDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CondContextDef 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.CondContextDef 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; - } - /** - *
    -   * Protocol buffer representing a CondContext object.
    -   * 
    - * - * Protobuf type {@code tensorflow.CondContextDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CondContextDef) - org.tensorflow.proto.framework.CondContextDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_CondContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CondContextDef.class, org.tensorflow.proto.framework.CondContextDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CondContextDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNestedContextsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - contextName_ = ""; - - predName_ = ""; - - pivotName_ = ""; - - branch_ = 0; - - if (valuesDefBuilder_ == null) { - valuesDef_ = null; - } else { - valuesDef_ = null; - valuesDefBuilder_ = null; - } - if (nestedContextsBuilder_ == null) { - nestedContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nestedContextsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CondContextDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CondContextDef build() { - org.tensorflow.proto.framework.CondContextDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CondContextDef buildPartial() { - org.tensorflow.proto.framework.CondContextDef result = new org.tensorflow.proto.framework.CondContextDef(this); - int from_bitField0_ = bitField0_; - result.contextName_ = contextName_; - result.predName_ = predName_; - result.pivotName_ = pivotName_; - result.branch_ = branch_; - if (valuesDefBuilder_ == null) { - result.valuesDef_ = valuesDef_; - } else { - result.valuesDef_ = valuesDefBuilder_.build(); - } - if (nestedContextsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nestedContexts_ = nestedContexts_; - } else { - result.nestedContexts_ = nestedContextsBuilder_.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.CondContextDef) { - return mergeFrom((org.tensorflow.proto.framework.CondContextDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CondContextDef other) { - if (other == org.tensorflow.proto.framework.CondContextDef.getDefaultInstance()) return this; - if (!other.getContextName().isEmpty()) { - contextName_ = other.contextName_; - onChanged(); - } - if (!other.getPredName().isEmpty()) { - predName_ = other.predName_; - onChanged(); - } - if (!other.getPivotName().isEmpty()) { - pivotName_ = other.pivotName_; - onChanged(); - } - if (other.getBranch() != 0) { - setBranch(other.getBranch()); - } - if (other.hasValuesDef()) { - mergeValuesDef(other.getValuesDef()); - } - if (nestedContextsBuilder_ == null) { - if (!other.nestedContexts_.isEmpty()) { - if (nestedContexts_.isEmpty()) { - nestedContexts_ = other.nestedContexts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNestedContextsIsMutable(); - nestedContexts_.addAll(other.nestedContexts_); - } - onChanged(); - } - } else { - if (!other.nestedContexts_.isEmpty()) { - if (nestedContextsBuilder_.isEmpty()) { - nestedContextsBuilder_.dispose(); - nestedContextsBuilder_ = null; - nestedContexts_ = other.nestedContexts_; - bitField0_ = (bitField0_ & ~0x00000001); - nestedContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNestedContextsFieldBuilder() : null; - } else { - nestedContextsBuilder_.addAllMessages(other.nestedContexts_); - } - } - } - 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.CondContextDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CondContextDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object contextName_ = ""; - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public java.lang.String getContextName() { - java.lang.Object ref = contextName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contextName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public com.google.protobuf.ByteString - getContextNameBytes() { - java.lang.Object ref = contextName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contextName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder setContextName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contextName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder clearContextName() { - - contextName_ = getDefaultInstance().getContextName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder setContextNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contextName_ = value; - onChanged(); - return this; - } - - private java.lang.Object predName_ = ""; - /** - *
    -     * Name of the pred tensor.
    -     * 
    - * - * string pred_name = 2; - */ - public java.lang.String getPredName() { - java.lang.Object ref = predName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - predName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the pred tensor.
    -     * 
    - * - * string pred_name = 2; - */ - public com.google.protobuf.ByteString - getPredNameBytes() { - java.lang.Object ref = predName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - predName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the pred tensor.
    -     * 
    - * - * string pred_name = 2; - */ - public Builder setPredName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - predName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the pred tensor.
    -     * 
    - * - * string pred_name = 2; - */ - public Builder clearPredName() { - - predName_ = getDefaultInstance().getPredName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the pred tensor.
    -     * 
    - * - * string pred_name = 2; - */ - public Builder setPredNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - predName_ = value; - onChanged(); - return this; - } - - private java.lang.Object pivotName_ = ""; - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 3; - */ - public java.lang.String getPivotName() { - java.lang.Object ref = pivotName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pivotName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 3; - */ - public com.google.protobuf.ByteString - getPivotNameBytes() { - java.lang.Object ref = pivotName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 3; - */ - public Builder setPivotName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pivotName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 3; - */ - public Builder clearPivotName() { - - pivotName_ = getDefaultInstance().getPivotName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 3; - */ - public Builder setPivotNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pivotName_ = value; - onChanged(); - return this; - } - - private int branch_ ; - /** - *
    -     * Branch prediction. 0 or 1.
    -     * 
    - * - * int32 branch = 4; - */ - public int getBranch() { - return branch_; - } - /** - *
    -     * Branch prediction. 0 or 1.
    -     * 
    - * - * int32 branch = 4; - */ - public Builder setBranch(int value) { - - branch_ = value; - onChanged(); - return this; - } - /** - *
    -     * Branch prediction. 0 or 1.
    -     * 
    - * - * int32 branch = 4; - */ - public Builder clearBranch() { - - branch_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.ValuesDef valuesDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder> valuesDefBuilder_; - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public boolean hasValuesDef() { - return valuesDefBuilder_ != null || valuesDef_ != null; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public org.tensorflow.proto.framework.ValuesDef getValuesDef() { - if (valuesDefBuilder_ == null) { - return valuesDef_ == null ? org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } else { - return valuesDefBuilder_.getMessage(); - } - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public Builder setValuesDef(org.tensorflow.proto.framework.ValuesDef value) { - if (valuesDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - valuesDef_ = value; - onChanged(); - } else { - valuesDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public Builder setValuesDef( - org.tensorflow.proto.framework.ValuesDef.Builder builderForValue) { - if (valuesDefBuilder_ == null) { - valuesDef_ = builderForValue.build(); - onChanged(); - } else { - valuesDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public Builder mergeValuesDef(org.tensorflow.proto.framework.ValuesDef value) { - if (valuesDefBuilder_ == null) { - if (valuesDef_ != null) { - valuesDef_ = - org.tensorflow.proto.framework.ValuesDef.newBuilder(valuesDef_).mergeFrom(value).buildPartial(); - } else { - valuesDef_ = value; - } - onChanged(); - } else { - valuesDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public Builder clearValuesDef() { - if (valuesDefBuilder_ == null) { - valuesDef_ = null; - onChanged(); - } else { - valuesDef_ = null; - valuesDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public org.tensorflow.proto.framework.ValuesDef.Builder getValuesDefBuilder() { - - onChanged(); - return getValuesDefFieldBuilder().getBuilder(); - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - public org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder() { - if (valuesDefBuilder_ != null) { - return valuesDefBuilder_.getMessageOrBuilder(); - } else { - return valuesDef_ == null ? - org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder> - getValuesDefFieldBuilder() { - if (valuesDefBuilder_ == null) { - valuesDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder>( - getValuesDef(), - getParentForChildren(), - isClean()); - valuesDef_ = null; - } - return valuesDefBuilder_; - } - - private java.util.List nestedContexts_ = - java.util.Collections.emptyList(); - private void ensureNestedContextsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nestedContexts_ = new java.util.ArrayList(nestedContexts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder> nestedContextsBuilder_; - - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public java.util.List getNestedContextsList() { - if (nestedContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(nestedContexts_); - } else { - return nestedContextsBuilder_.getMessageList(); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public int getNestedContextsCount() { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.size(); - } else { - return nestedContextsBuilder_.getCount(); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index) { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.get(index); - } else { - return nestedContextsBuilder_.getMessage(index); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder setNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.set(index, value); - onChanged(); - } else { - nestedContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder setNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder addNestedContexts(org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.add(value); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder addNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.add(index, value); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder addNestedContexts( - org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.add(builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder addNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder addAllNestedContexts( - java.lang.Iterable values) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nestedContexts_); - onChanged(); - } else { - nestedContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder clearNestedContexts() { - if (nestedContextsBuilder_ == null) { - nestedContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nestedContextsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public Builder removeNestedContexts(int index) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.remove(index); - onChanged(); - } else { - nestedContextsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder getNestedContextsBuilder( - int index) { - return getNestedContextsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( - int index) { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.get(index); } else { - return nestedContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public java.util.List - getNestedContextsOrBuilderList() { - if (nestedContextsBuilder_ != null) { - return nestedContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nestedContexts_); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder addNestedContextsBuilder() { - return getNestedContextsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance()); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder addNestedContextsBuilder( - int index) { - return getNestedContextsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance()); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested conds).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; - */ - public java.util.List - getNestedContextsBuilderList() { - return getNestedContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder> - getNestedContextsFieldBuilder() { - if (nestedContextsBuilder_ == null) { - nestedContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder>( - nestedContexts_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nestedContexts_ = null; - } - return nestedContextsBuilder_; - } - @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.CondContextDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CondContextDef) - private static final org.tensorflow.proto.framework.CondContextDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CondContextDef(); - } - - public static org.tensorflow.proto.framework.CondContextDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CondContextDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CondContextDef(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.CondContextDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 989d2bbeeb3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProto.java +++ /dev/null @@ -1,6772 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Session configuration parameters.
    - * The system picks appropriate values for fields that are not set.
    - * 
    - * - * Protobuf type {@code tensorflow.ConfigProto} - */ -public final class ConfigProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ConfigProto) - ConfigProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use ConfigProto.newBuilder() to construct. - private ConfigProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ConfigProto() { - sessionInterOpThreadPool_ = java.util.Collections.emptyList(); - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ConfigProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ConfigProto( - 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)) { - deviceCount_ = com.google.protobuf.MapField.newMapField( - DeviceCountDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - deviceCount__ = input.readMessage( - DeviceCountDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - deviceCount_.getMutableMap().put( - deviceCount__.getKey(), deviceCount__.getValue()); - break; - } - case 16: { - - intraOpParallelismThreads_ = input.readInt32(); - break; - } - case 24: { - - placementPeriod_ = input.readInt32(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - deviceFilters_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - deviceFilters_.add(s); - break; - } - case 40: { - - interOpParallelismThreads_ = input.readInt32(); - break; - } - case 50: { - org.tensorflow.proto.framework.GPUOptions.Builder subBuilder = null; - if (gpuOptions_ != null) { - subBuilder = gpuOptions_.toBuilder(); - } - gpuOptions_ = input.readMessage(org.tensorflow.proto.framework.GPUOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(gpuOptions_); - gpuOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 56: { - - allowSoftPlacement_ = input.readBool(); - break; - } - case 64: { - - logDevicePlacement_ = input.readBool(); - break; - } - case 72: { - - usePerSessionThreads_ = input.readBool(); - break; - } - case 82: { - org.tensorflow.proto.framework.GraphOptions.Builder subBuilder = null; - if (graphOptions_ != null) { - subBuilder = graphOptions_.toBuilder(); - } - graphOptions_ = input.readMessage(org.tensorflow.proto.framework.GraphOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(graphOptions_); - graphOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 88: { - - operationTimeoutInMs_ = input.readInt64(); - break; - } - case 98: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - sessionInterOpThreadPool_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - sessionInterOpThreadPool_.add( - input.readMessage(org.tensorflow.proto.framework.ThreadPoolOptionProto.parser(), extensionRegistry)); - break; - } - case 106: { - org.tensorflow.proto.framework.RPCOptions.Builder subBuilder = null; - if (rpcOptions_ != null) { - subBuilder = rpcOptions_.toBuilder(); - } - rpcOptions_ = input.readMessage(org.tensorflow.proto.framework.RPCOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rpcOptions_); - rpcOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 114: { - org.tensorflow.proto.distruntime.ClusterDef.Builder subBuilder = null; - if (clusterDef_ != null) { - subBuilder = clusterDef_.toBuilder(); - } - clusterDef_ = input.readMessage(org.tensorflow.proto.distruntime.ClusterDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(clusterDef_); - clusterDef_ = subBuilder.buildPartial(); - } - - break; - } - case 120: { - - isolateSessionState_ = input.readBool(); - break; - } - case 130: { - org.tensorflow.proto.framework.ConfigProto.Experimental.Builder subBuilder = null; - if (experimental_ != null) { - subBuilder = experimental_.toBuilder(); - } - experimental_ = input.readMessage(org.tensorflow.proto.framework.ConfigProto.Experimental.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(experimental_); - experimental_ = subBuilder.buildPartial(); - } - - break; - } - case 136: { - - shareClusterDevicesInSession_ = input.readBool(); - 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_ & 0x00000004) != 0)) { - deviceFilters_ = deviceFilters_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - sessionInterOpThreadPool_ = java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetDeviceCount(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ConfigProto.class, org.tensorflow.proto.framework.ConfigProto.Builder.class); - } - - public interface ExperimentalOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ConfigProto.Experimental) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Task name for group resolution.
    -     * 
    - * - * string collective_group_leader = 1; - */ - java.lang.String getCollectiveGroupLeader(); - /** - *
    -     * Task name for group resolution.
    -     * 
    - * - * string collective_group_leader = 1; - */ - com.google.protobuf.ByteString - getCollectiveGroupLeaderBytes(); - - /** - *
    -     * Which executor to use, the default executor will be used
    -     * if it is an empty string or "DEFAULT"
    -     * 
    - * - * string executor_type = 3; - */ - java.lang.String getExecutorType(); - /** - *
    -     * Which executor to use, the default executor will be used
    -     * if it is an empty string or "DEFAULT"
    -     * 
    - * - * string executor_type = 3; - */ - com.google.protobuf.ByteString - getExecutorTypeBytes(); - - /** - *
    -     * Guidance to formatting of large RecvBuf fields for transfer.
    -     * Any positive value sets the max chunk size.  0 defaults to 4096.
    -     * Any negative value indicates no max, i.e. one chunk only.
    -     * 
    - * - * int32 recv_buf_max_chunk = 4; - */ - int getRecvBufMaxChunk(); - - /** - *
    -     * If true, and supported by the platform, the runtime will attempt to
    -     * use NUMA affinity where applicable.  One consequence will be the
    -     * existence of as many CPU devices as there are available NUMA nodes.
    -     * 
    - * - * bool use_numa_affinity = 5; - */ - boolean getUseNumaAffinity(); - - /** - *
    -     * If true, make collective op execution order sequential and deterministic
    -     * for potentially concurrent collective instances.
    -     * 
    - * - * bool collective_deterministic_sequential_execution = 6; - */ - boolean getCollectiveDeterministicSequentialExecution(); - - /** - *
    -     * If true, use NCCL for CollectiveOps.  This feature is highly
    -     * experimental.
    -     * 
    - * - * bool collective_nccl = 7; - */ - boolean getCollectiveNccl(); - - /** - *
    -     * In the following, session state means the value of a variable, elements
    -     * in a hash table, or any other resource, accessible by worker sessions
    -     * held by a TF server.
    -     * When ClusterSpec propagation is enabled, the value of
    -     * isolate_session_state is ignored when deciding whether to share session
    -     * states in a TF server (for backwards compatibility reasons).
    -     * - If share_session_state_in_clusterspec_propagation is true, the session
    -     * states are shared.
    -     * - If share_session_state_in_clusterspec_propagation is false, session
    -     * states are isolated.
    -     * When clusterspec propagation is not used, the value of
    -     * share_session_state_in_clusterspec_propagation is ignored when deciding
    -     * whether to share session states in a TF server.
    -     * - If isolate_session_state is true, session states are isolated.
    -     * - If isolate_session_state is false, session states are shared.
    -     * TODO(b/129330037): Add a single API that consistently treats
    -     * isolate_session_state and ClusterSpec propagation.
    -     * 
    - * - * bool share_session_state_in_clusterspec_propagation = 8; - */ - boolean getShareSessionStateInClusterspecPropagation(); - - /** - *
    -     * If using a direct session, disable spinning while waiting for work in
    -     * the thread pool. This may result in higher latency for completing ops,
    -     * but in the case where there is a lot of spinning may result in lower
    -     * CPU usage.
    -     * 
    - * - * bool disable_thread_spinning = 9; - */ - boolean getDisableThreadSpinning(); - - /** - *
    -     * This was promoted to a non-experimental API. Please use
    -     * ConfigProto.share_cluster_devices_in_session instead.
    -     * 
    - * - * bool share_cluster_devices_in_session = 10; - */ - boolean getShareClusterDevicesInSession(); - - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - boolean hasSessionMetadata(); - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - org.tensorflow.proto.framework.SessionMetadata getSessionMetadata(); - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - org.tensorflow.proto.framework.SessionMetadataOrBuilder getSessionMetadataOrBuilder(); - - /** - *
    -     * If true, the session may treat the graph as being static for optimization
    -     * purposes.
    -     * If this option is set to true when a session is created, the full
    -     * GraphDef must be passed in a single call to Session::Create(), and
    -     * Session::Extend() may not be supported.
    -     * 
    - * - * bool optimize_for_static_graph = 12; - */ - boolean getOptimizeForStaticGraph(); - - /** - *
    -     * 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.
    -     * If this option is set to true when a session is created, MLIR is used to
    -     * perform the set of graph transformations to put the graph in a form that
    -     * can be executed with delegation of some computations to an accelerator.
    -     * This builds on the model of XLA where a subset of the graph is
    -     * encapsulated and attached to a "compile" operation, whose result is fed
    -     * to an "execute" operation. The kernel for these operations is responsible
    -     * to lower the encapsulated graph to a particular device.
    -     * 
    - * - * bool enable_mlir_bridge = 13; - */ - 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.
    -     * This will become a part of standard Tensorflow graph optimization
    -     * pipeline, currently this is only used for gradual migration and testing
    -     * new passes that are replacing existing optimizations in Grappler.
    -     * 
    - * - * bool enable_mlir_graph_optimization = 16; - */ - boolean getEnableMlirGraphOptimization(); - - /** - *
    -     * If true, the session will not store an additional copy of the graph for
    -     * each subgraph.
    -     * If this option is set to true when a session is created, the
    -     * `RunOptions.output_partition_graphs` options must not be set.
    -     * 
    - * - * bool disable_output_partition_graphs = 14; - */ - boolean getDisableOutputPartitionGraphs(); - - /** - *
    -     * Minimum number of batches run through the XLA graph before XLA fusion
    -     * autotuner is enabled. Default value of zero disables the autotuner.
    -     * The XLA fusion autotuner can improve performance by executing a heuristic
    -     * search on the compiler parameters.
    -     * 
    - * - * int64 xla_fusion_autotuner_thresh = 15; - */ - long getXlaFusionAutotunerThresh(); - - /** - *
    -     * Whether runtime execution uses TFRT.
    -     * 
    - * - * bool use_tfrt = 18; - */ - boolean getUseTfrt(); - - /** - *
    -     * Distributed coordination service to be enabled if set.
    -     * Currently only effective in multi-client setup.
    -     * 
    - * - * string coordination_service = 19; - */ - java.lang.String getCoordinationService(); - /** - *
    -     * Distributed coordination service to be enabled if set.
    -     * Currently only effective in multi-client setup.
    -     * 
    - * - * string coordination_service = 19; - */ - com.google.protobuf.ByteString - getCoordinationServiceBytes(); - - /** - *
    -     * Whether the remote devices in the cluster should be fetched during setup
    -     * of multi-client cluster. If enabled, the workers will run an extra device
    -     * information exchange step during startup and the workers' EagerContexts
    -     * will become aware of remote devices in the cluster as well.
    -     * 
    - * - * bool fetch_remote_devices_in_multi_client = 20; - */ - boolean getFetchRemoteDevicesInMultiClient(); - } - /** - *
    -   * Everything inside Experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * Protobuf type {@code tensorflow.ConfigProto.Experimental} - */ - public static final class Experimental extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ConfigProto.Experimental) - ExperimentalOrBuilder { - private static final long serialVersionUID = 0L; - // Use Experimental.newBuilder() to construct. - private Experimental(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Experimental() { - collectiveGroupLeader_ = ""; - executorType_ = ""; - mlirBridgeRollout_ = 0; - coordinationService_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Experimental(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Experimental( - 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(); - - collectiveGroupLeader_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - executorType_ = s; - break; - } - case 32: { - - recvBufMaxChunk_ = input.readInt32(); - break; - } - case 40: { - - useNumaAffinity_ = input.readBool(); - break; - } - case 48: { - - collectiveDeterministicSequentialExecution_ = input.readBool(); - break; - } - case 56: { - - collectiveNccl_ = input.readBool(); - break; - } - case 64: { - - shareSessionStateInClusterspecPropagation_ = input.readBool(); - break; - } - case 72: { - - disableThreadSpinning_ = input.readBool(); - break; - } - case 80: { - - shareClusterDevicesInSession_ = input.readBool(); - break; - } - case 90: { - org.tensorflow.proto.framework.SessionMetadata.Builder subBuilder = null; - if (sessionMetadata_ != null) { - subBuilder = sessionMetadata_.toBuilder(); - } - sessionMetadata_ = input.readMessage(org.tensorflow.proto.framework.SessionMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sessionMetadata_); - sessionMetadata_ = subBuilder.buildPartial(); - } - - break; - } - case 96: { - - optimizeForStaticGraph_ = input.readBool(); - break; - } - case 104: { - - enableMlirBridge_ = input.readBool(); - break; - } - case 112: { - - disableOutputPartitionGraphs_ = input.readBool(); - break; - } - case 120: { - - xlaFusionAutotunerThresh_ = input.readInt64(); - break; - } - case 128: { - - enableMlirGraphOptimization_ = input.readBool(); - break; - } - case 136: { - int rawValue = input.readEnum(); - - mlirBridgeRollout_ = rawValue; - break; - } - case 144: { - - useTfrt_ = input.readBool(); - break; - } - case 154: { - java.lang.String s = input.readStringRequireUtf8(); - - coordinationService_ = s; - break; - } - case 160: { - - fetchRemoteDevicesInMultiClient_ = input.readBool(); - 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.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - 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), - /** - *
    -       * Enable the MLIR bridge on a per graph basis based on an analysis of
    -       * the features used in the graph. If the features used by the graph are
    -       * supported by the MLIR bridge, the MLIR bridge will be used to run the
    -       * graph.
    -       * 
    - * - * MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED = 3; - */ - MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED(3), - /** - *
    -       * Enable the MLIR bridge in a fallback mode on a per graph basis based
    -       * on an analysis of the features used in the graph.
    -       * Running the MLIR bridge in the fallback mode means that it is
    -       * executed and it commits all the changes to the TF graph in case
    -       * of success. And it does not in case of failures and let the old bridge
    -       * to process the TF graph.
    -       * 
    - * - * MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED = 4; - */ - MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED(4), - 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; - /** - *
    -       * Enable the MLIR bridge on a per graph basis based on an analysis of
    -       * the features used in the graph. If the features used by the graph are
    -       * supported by the MLIR bridge, the MLIR bridge will be used to run the
    -       * graph.
    -       * 
    - * - * MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED = 3; - */ - public static final int MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED_VALUE = 3; - /** - *
    -       * Enable the MLIR bridge in a fallback mode on a per graph basis based
    -       * on an analysis of the features used in the graph.
    -       * Running the MLIR bridge in the fallback mode means that it is
    -       * executed and it commits all the changes to the TF graph in case
    -       * of success. And it does not in case of failures and let the old bridge
    -       * to process the TF graph.
    -       * 
    - * - * MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED = 4; - */ - public static final int MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED_VALUE = 4; - - - 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; - case 3: return MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLED; - case 4: return MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FALLBACK_ENABLED; - 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_; - /** - *
    -     * Task name for group resolution.
    -     * 
    - * - * string collective_group_leader = 1; - */ - public java.lang.String getCollectiveGroupLeader() { - java.lang.Object ref = collectiveGroupLeader_; - 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(); - collectiveGroupLeader_ = s; - return s; - } - } - /** - *
    -     * Task name for group resolution.
    -     * 
    - * - * string collective_group_leader = 1; - */ - public com.google.protobuf.ByteString - getCollectiveGroupLeaderBytes() { - java.lang.Object ref = collectiveGroupLeader_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - collectiveGroupLeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EXECUTOR_TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object executorType_; - /** - *
    -     * Which executor to use, the default executor will be used
    -     * if it is an empty string or "DEFAULT"
    -     * 
    - * - * string executor_type = 3; - */ - public java.lang.String getExecutorType() { - java.lang.Object ref = executorType_; - 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(); - executorType_ = s; - return s; - } - } - /** - *
    -     * Which executor to use, the default executor will be used
    -     * if it is an empty string or "DEFAULT"
    -     * 
    - * - * string executor_type = 3; - */ - public com.google.protobuf.ByteString - getExecutorTypeBytes() { - java.lang.Object ref = executorType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - executorType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RECV_BUF_MAX_CHUNK_FIELD_NUMBER = 4; - private int recvBufMaxChunk_; - /** - *
    -     * Guidance to formatting of large RecvBuf fields for transfer.
    -     * Any positive value sets the max chunk size.  0 defaults to 4096.
    -     * Any negative value indicates no max, i.e. one chunk only.
    -     * 
    - * - * int32 recv_buf_max_chunk = 4; - */ - public int getRecvBufMaxChunk() { - return recvBufMaxChunk_; - } - - public static final int USE_NUMA_AFFINITY_FIELD_NUMBER = 5; - private boolean useNumaAffinity_; - /** - *
    -     * If true, and supported by the platform, the runtime will attempt to
    -     * use NUMA affinity where applicable.  One consequence will be the
    -     * existence of as many CPU devices as there are available NUMA nodes.
    -     * 
    - * - * bool use_numa_affinity = 5; - */ - public boolean getUseNumaAffinity() { - return useNumaAffinity_; - } - - public static final int COLLECTIVE_DETERMINISTIC_SEQUENTIAL_EXECUTION_FIELD_NUMBER = 6; - private boolean collectiveDeterministicSequentialExecution_; - /** - *
    -     * If true, make collective op execution order sequential and deterministic
    -     * for potentially concurrent collective instances.
    -     * 
    - * - * bool collective_deterministic_sequential_execution = 6; - */ - public boolean getCollectiveDeterministicSequentialExecution() { - return collectiveDeterministicSequentialExecution_; - } - - public static final int COLLECTIVE_NCCL_FIELD_NUMBER = 7; - private boolean collectiveNccl_; - /** - *
    -     * If true, use NCCL for CollectiveOps.  This feature is highly
    -     * experimental.
    -     * 
    - * - * bool collective_nccl = 7; - */ - public boolean getCollectiveNccl() { - return collectiveNccl_; - } - - public static final int SHARE_SESSION_STATE_IN_CLUSTERSPEC_PROPAGATION_FIELD_NUMBER = 8; - private boolean shareSessionStateInClusterspecPropagation_; - /** - *
    -     * In the following, session state means the value of a variable, elements
    -     * in a hash table, or any other resource, accessible by worker sessions
    -     * held by a TF server.
    -     * When ClusterSpec propagation is enabled, the value of
    -     * isolate_session_state is ignored when deciding whether to share session
    -     * states in a TF server (for backwards compatibility reasons).
    -     * - If share_session_state_in_clusterspec_propagation is true, the session
    -     * states are shared.
    -     * - If share_session_state_in_clusterspec_propagation is false, session
    -     * states are isolated.
    -     * When clusterspec propagation is not used, the value of
    -     * share_session_state_in_clusterspec_propagation is ignored when deciding
    -     * whether to share session states in a TF server.
    -     * - If isolate_session_state is true, session states are isolated.
    -     * - If isolate_session_state is false, session states are shared.
    -     * TODO(b/129330037): Add a single API that consistently treats
    -     * isolate_session_state and ClusterSpec propagation.
    -     * 
    - * - * bool share_session_state_in_clusterspec_propagation = 8; - */ - public boolean getShareSessionStateInClusterspecPropagation() { - return shareSessionStateInClusterspecPropagation_; - } - - public static final int DISABLE_THREAD_SPINNING_FIELD_NUMBER = 9; - private boolean disableThreadSpinning_; - /** - *
    -     * If using a direct session, disable spinning while waiting for work in
    -     * the thread pool. This may result in higher latency for completing ops,
    -     * but in the case where there is a lot of spinning may result in lower
    -     * CPU usage.
    -     * 
    - * - * bool disable_thread_spinning = 9; - */ - public boolean getDisableThreadSpinning() { - return disableThreadSpinning_; - } - - public static final int SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER = 10; - private boolean shareClusterDevicesInSession_; - /** - *
    -     * This was promoted to a non-experimental API. Please use
    -     * ConfigProto.share_cluster_devices_in_session instead.
    -     * 
    - * - * bool share_cluster_devices_in_session = 10; - */ - public boolean getShareClusterDevicesInSession() { - return shareClusterDevicesInSession_; - } - - public static final int SESSION_METADATA_FIELD_NUMBER = 11; - private org.tensorflow.proto.framework.SessionMetadata sessionMetadata_; - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public boolean hasSessionMetadata() { - return sessionMetadata_ != null; - } - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public org.tensorflow.proto.framework.SessionMetadata getSessionMetadata() { - return sessionMetadata_ == null ? org.tensorflow.proto.framework.SessionMetadata.getDefaultInstance() : sessionMetadata_; - } - /** - *
    -     * Metadata about the session.
    -     * If set, this can be used by the runtime and the Ops for debugging,
    -     * monitoring, etc.
    -     * NOTE: This is currently used and propagated only by the direct session.
    -     * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public org.tensorflow.proto.framework.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { - return getSessionMetadata(); - } - - public static final int OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER = 12; - private boolean optimizeForStaticGraph_; - /** - *
    -     * If true, the session may treat the graph as being static for optimization
    -     * purposes.
    -     * If this option is set to true when a session is created, the full
    -     * GraphDef must be passed in a single call to Session::Create(), and
    -     * Session::Extend() may not be supported.
    -     * 
    - * - * bool optimize_for_static_graph = 12; - */ - public boolean getOptimizeForStaticGraph() { - return optimizeForStaticGraph_; - } - - public static final int ENABLE_MLIR_BRIDGE_FIELD_NUMBER = 13; - 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.
    -     * If this option is set to true when a session is created, MLIR is used to
    -     * perform the set of graph transformations to put the graph in a form that
    -     * can be executed with delegation of some computations to an accelerator.
    -     * This builds on the model of XLA where a subset of the graph is
    -     * encapsulated and attached to a "compile" operation, whose result is fed
    -     * to an "execute" operation. The kernel for these operations is responsible
    -     * to lower the encapsulated graph to a particular device.
    -     * 
    - * - * bool enable_mlir_bridge = 13; - */ - 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_; - /** - *
    -     * Whether to enable the MLIR-based Graph optimizations.
    -     * This will become a part of standard Tensorflow graph optimization
    -     * pipeline, currently this is only used for gradual migration and testing
    -     * new passes that are replacing existing optimizations in Grappler.
    -     * 
    - * - * bool enable_mlir_graph_optimization = 16; - */ - public boolean getEnableMlirGraphOptimization() { - return enableMlirGraphOptimization_; - } - - public static final int DISABLE_OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER = 14; - private boolean disableOutputPartitionGraphs_; - /** - *
    -     * If true, the session will not store an additional copy of the graph for
    -     * each subgraph.
    -     * If this option is set to true when a session is created, the
    -     * `RunOptions.output_partition_graphs` options must not be set.
    -     * 
    - * - * bool disable_output_partition_graphs = 14; - */ - public boolean getDisableOutputPartitionGraphs() { - return disableOutputPartitionGraphs_; - } - - public static final int XLA_FUSION_AUTOTUNER_THRESH_FIELD_NUMBER = 15; - private long xlaFusionAutotunerThresh_; - /** - *
    -     * Minimum number of batches run through the XLA graph before XLA fusion
    -     * autotuner is enabled. Default value of zero disables the autotuner.
    -     * The XLA fusion autotuner can improve performance by executing a heuristic
    -     * search on the compiler parameters.
    -     * 
    - * - * int64 xla_fusion_autotuner_thresh = 15; - */ - public long getXlaFusionAutotunerThresh() { - return xlaFusionAutotunerThresh_; - } - - public static final int USE_TFRT_FIELD_NUMBER = 18; - private boolean useTfrt_; - /** - *
    -     * Whether runtime execution uses TFRT.
    -     * 
    - * - * bool use_tfrt = 18; - */ - public boolean getUseTfrt() { - return useTfrt_; - } - - public static final int COORDINATION_SERVICE_FIELD_NUMBER = 19; - private volatile java.lang.Object coordinationService_; - /** - *
    -     * Distributed coordination service to be enabled if set.
    -     * Currently only effective in multi-client setup.
    -     * 
    - * - * string coordination_service = 19; - */ - public java.lang.String getCoordinationService() { - java.lang.Object ref = coordinationService_; - 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(); - coordinationService_ = s; - return s; - } - } - /** - *
    -     * Distributed coordination service to be enabled if set.
    -     * Currently only effective in multi-client setup.
    -     * 
    - * - * string coordination_service = 19; - */ - public com.google.protobuf.ByteString - getCoordinationServiceBytes() { - java.lang.Object ref = coordinationService_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - coordinationService_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FETCH_REMOTE_DEVICES_IN_MULTI_CLIENT_FIELD_NUMBER = 20; - private boolean fetchRemoteDevicesInMultiClient_; - /** - *
    -     * Whether the remote devices in the cluster should be fetched during setup
    -     * of multi-client cluster. If enabled, the workers will run an extra device
    -     * information exchange step during startup and the workers' EagerContexts
    -     * will become aware of remote devices in the cluster as well.
    -     * 
    - * - * bool fetch_remote_devices_in_multi_client = 20; - */ - public boolean getFetchRemoteDevicesInMultiClient() { - return fetchRemoteDevicesInMultiClient_; - } - - 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 (!getCollectiveGroupLeaderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, collectiveGroupLeader_); - } - if (!getExecutorTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, executorType_); - } - if (recvBufMaxChunk_ != 0) { - output.writeInt32(4, recvBufMaxChunk_); - } - if (useNumaAffinity_ != false) { - output.writeBool(5, useNumaAffinity_); - } - if (collectiveDeterministicSequentialExecution_ != false) { - output.writeBool(6, collectiveDeterministicSequentialExecution_); - } - if (collectiveNccl_ != false) { - output.writeBool(7, collectiveNccl_); - } - if (shareSessionStateInClusterspecPropagation_ != false) { - output.writeBool(8, shareSessionStateInClusterspecPropagation_); - } - if (disableThreadSpinning_ != false) { - output.writeBool(9, disableThreadSpinning_); - } - if (shareClusterDevicesInSession_ != false) { - output.writeBool(10, shareClusterDevicesInSession_); - } - if (sessionMetadata_ != null) { - output.writeMessage(11, getSessionMetadata()); - } - if (optimizeForStaticGraph_ != false) { - output.writeBool(12, optimizeForStaticGraph_); - } - if (enableMlirBridge_ != false) { - output.writeBool(13, enableMlirBridge_); - } - if (disableOutputPartitionGraphs_ != false) { - output.writeBool(14, disableOutputPartitionGraphs_); - } - if (xlaFusionAutotunerThresh_ != 0L) { - output.writeInt64(15, xlaFusionAutotunerThresh_); - } - 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_); - } - if (useTfrt_ != false) { - output.writeBool(18, useTfrt_); - } - if (!getCoordinationServiceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 19, coordinationService_); - } - if (fetchRemoteDevicesInMultiClient_ != false) { - output.writeBool(20, fetchRemoteDevicesInMultiClient_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCollectiveGroupLeaderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, collectiveGroupLeader_); - } - if (!getExecutorTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, executorType_); - } - if (recvBufMaxChunk_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, recvBufMaxChunk_); - } - if (useNumaAffinity_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, useNumaAffinity_); - } - if (collectiveDeterministicSequentialExecution_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, collectiveDeterministicSequentialExecution_); - } - if (collectiveNccl_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, collectiveNccl_); - } - if (shareSessionStateInClusterspecPropagation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, shareSessionStateInClusterspecPropagation_); - } - if (disableThreadSpinning_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, disableThreadSpinning_); - } - if (shareClusterDevicesInSession_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(10, shareClusterDevicesInSession_); - } - if (sessionMetadata_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, getSessionMetadata()); - } - if (optimizeForStaticGraph_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(12, optimizeForStaticGraph_); - } - if (enableMlirBridge_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(13, enableMlirBridge_); - } - if (disableOutputPartitionGraphs_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(14, disableOutputPartitionGraphs_); - } - if (xlaFusionAutotunerThresh_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(15, xlaFusionAutotunerThresh_); - } - if (enableMlirGraphOptimization_ != false) { - 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_); - } - if (useTfrt_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(18, useTfrt_); - } - if (!getCoordinationServiceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, coordinationService_); - } - if (fetchRemoteDevicesInMultiClient_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(20, fetchRemoteDevicesInMultiClient_); - } - 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.ConfigProto.Experimental)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ConfigProto.Experimental other = (org.tensorflow.proto.framework.ConfigProto.Experimental) obj; - - if (!getCollectiveGroupLeader() - .equals(other.getCollectiveGroupLeader())) return false; - if (!getExecutorType() - .equals(other.getExecutorType())) return false; - if (getRecvBufMaxChunk() - != other.getRecvBufMaxChunk()) return false; - if (getUseNumaAffinity() - != other.getUseNumaAffinity()) return false; - if (getCollectiveDeterministicSequentialExecution() - != other.getCollectiveDeterministicSequentialExecution()) return false; - if (getCollectiveNccl() - != other.getCollectiveNccl()) return false; - if (getShareSessionStateInClusterspecPropagation() - != other.getShareSessionStateInClusterspecPropagation()) return false; - if (getDisableThreadSpinning() - != other.getDisableThreadSpinning()) return false; - if (getShareClusterDevicesInSession() - != other.getShareClusterDevicesInSession()) return false; - if (hasSessionMetadata() != other.hasSessionMetadata()) return false; - if (hasSessionMetadata()) { - if (!getSessionMetadata() - .equals(other.getSessionMetadata())) return false; - } - if (getOptimizeForStaticGraph() - != other.getOptimizeForStaticGraph()) return false; - if (getEnableMlirBridge() - != other.getEnableMlirBridge()) return false; - if (mlirBridgeRollout_ != other.mlirBridgeRollout_) return false; - if (getEnableMlirGraphOptimization() - != other.getEnableMlirGraphOptimization()) return false; - if (getDisableOutputPartitionGraphs() - != other.getDisableOutputPartitionGraphs()) return false; - if (getXlaFusionAutotunerThresh() - != other.getXlaFusionAutotunerThresh()) return false; - if (getUseTfrt() - != other.getUseTfrt()) return false; - if (!getCoordinationService() - .equals(other.getCoordinationService())) return false; - if (getFetchRemoteDevicesInMultiClient() - != other.getFetchRemoteDevicesInMultiClient()) 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) + COLLECTIVE_GROUP_LEADER_FIELD_NUMBER; - hash = (53 * hash) + getCollectiveGroupLeader().hashCode(); - hash = (37 * hash) + EXECUTOR_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getExecutorType().hashCode(); - hash = (37 * hash) + RECV_BUF_MAX_CHUNK_FIELD_NUMBER; - hash = (53 * hash) + getRecvBufMaxChunk(); - hash = (37 * hash) + USE_NUMA_AFFINITY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseNumaAffinity()); - hash = (37 * hash) + COLLECTIVE_DETERMINISTIC_SEQUENTIAL_EXECUTION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCollectiveDeterministicSequentialExecution()); - hash = (37 * hash) + COLLECTIVE_NCCL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCollectiveNccl()); - hash = (37 * hash) + SHARE_SESSION_STATE_IN_CLUSTERSPEC_PROPAGATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getShareSessionStateInClusterspecPropagation()); - hash = (37 * hash) + DISABLE_THREAD_SPINNING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableThreadSpinning()); - hash = (37 * hash) + SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getShareClusterDevicesInSession()); - if (hasSessionMetadata()) { - hash = (37 * hash) + SESSION_METADATA_FIELD_NUMBER; - hash = (53 * hash) + getSessionMetadata().hashCode(); - } - hash = (37 * hash) + OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getOptimizeForStaticGraph()); - 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()); - hash = (37 * hash) + DISABLE_OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableOutputPartitionGraphs()); - hash = (37 * hash) + XLA_FUSION_AUTOTUNER_THRESH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getXlaFusionAutotunerThresh()); - hash = (37 * hash) + USE_TFRT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseTfrt()); - hash = (37 * hash) + COORDINATION_SERVICE_FIELD_NUMBER; - hash = (53 * hash) + getCoordinationService().hashCode(); - hash = (37 * hash) + FETCH_REMOTE_DEVICES_IN_MULTI_CLIENT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFetchRemoteDevicesInMultiClient()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ConfigProto.Experimental parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental 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.ConfigProto.Experimental parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental 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.ConfigProto.Experimental parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental 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.ConfigProto.Experimental parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental 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.ConfigProto.Experimental parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto.Experimental 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.ConfigProto.Experimental 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; - } - /** - *
    -     * Everything inside Experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * Protobuf type {@code tensorflow.ConfigProto.Experimental} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ConfigProto.Experimental) - org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ConfigProto.Experimental.class, org.tensorflow.proto.framework.ConfigProto.Experimental.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ConfigProto.Experimental.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(); - collectiveGroupLeader_ = ""; - - executorType_ = ""; - - recvBufMaxChunk_ = 0; - - useNumaAffinity_ = false; - - collectiveDeterministicSequentialExecution_ = false; - - collectiveNccl_ = false; - - shareSessionStateInClusterspecPropagation_ = false; - - disableThreadSpinning_ = false; - - shareClusterDevicesInSession_ = false; - - if (sessionMetadataBuilder_ == null) { - sessionMetadata_ = null; - } else { - sessionMetadata_ = null; - sessionMetadataBuilder_ = null; - } - optimizeForStaticGraph_ = false; - - enableMlirBridge_ = false; - - mlirBridgeRollout_ = 0; - - enableMlirGraphOptimization_ = false; - - disableOutputPartitionGraphs_ = false; - - xlaFusionAutotunerThresh_ = 0L; - - useTfrt_ = false; - - coordinationService_ = ""; - - fetchRemoteDevicesInMultiClient_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto.Experimental getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ConfigProto.Experimental.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto.Experimental build() { - org.tensorflow.proto.framework.ConfigProto.Experimental result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto.Experimental buildPartial() { - org.tensorflow.proto.framework.ConfigProto.Experimental result = new org.tensorflow.proto.framework.ConfigProto.Experimental(this); - result.collectiveGroupLeader_ = collectiveGroupLeader_; - result.executorType_ = executorType_; - result.recvBufMaxChunk_ = recvBufMaxChunk_; - result.useNumaAffinity_ = useNumaAffinity_; - result.collectiveDeterministicSequentialExecution_ = collectiveDeterministicSequentialExecution_; - result.collectiveNccl_ = collectiveNccl_; - result.shareSessionStateInClusterspecPropagation_ = shareSessionStateInClusterspecPropagation_; - result.disableThreadSpinning_ = disableThreadSpinning_; - result.shareClusterDevicesInSession_ = shareClusterDevicesInSession_; - if (sessionMetadataBuilder_ == null) { - result.sessionMetadata_ = sessionMetadata_; - } else { - result.sessionMetadata_ = sessionMetadataBuilder_.build(); - } - result.optimizeForStaticGraph_ = optimizeForStaticGraph_; - result.enableMlirBridge_ = enableMlirBridge_; - result.mlirBridgeRollout_ = mlirBridgeRollout_; - result.enableMlirGraphOptimization_ = enableMlirGraphOptimization_; - result.disableOutputPartitionGraphs_ = disableOutputPartitionGraphs_; - result.xlaFusionAutotunerThresh_ = xlaFusionAutotunerThresh_; - result.useTfrt_ = useTfrt_; - result.coordinationService_ = coordinationService_; - result.fetchRemoteDevicesInMultiClient_ = fetchRemoteDevicesInMultiClient_; - 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.ConfigProto.Experimental) { - return mergeFrom((org.tensorflow.proto.framework.ConfigProto.Experimental)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ConfigProto.Experimental other) { - if (other == org.tensorflow.proto.framework.ConfigProto.Experimental.getDefaultInstance()) return this; - if (!other.getCollectiveGroupLeader().isEmpty()) { - collectiveGroupLeader_ = other.collectiveGroupLeader_; - onChanged(); - } - if (!other.getExecutorType().isEmpty()) { - executorType_ = other.executorType_; - onChanged(); - } - if (other.getRecvBufMaxChunk() != 0) { - setRecvBufMaxChunk(other.getRecvBufMaxChunk()); - } - if (other.getUseNumaAffinity() != false) { - setUseNumaAffinity(other.getUseNumaAffinity()); - } - if (other.getCollectiveDeterministicSequentialExecution() != false) { - setCollectiveDeterministicSequentialExecution(other.getCollectiveDeterministicSequentialExecution()); - } - if (other.getCollectiveNccl() != false) { - setCollectiveNccl(other.getCollectiveNccl()); - } - if (other.getShareSessionStateInClusterspecPropagation() != false) { - setShareSessionStateInClusterspecPropagation(other.getShareSessionStateInClusterspecPropagation()); - } - if (other.getDisableThreadSpinning() != false) { - setDisableThreadSpinning(other.getDisableThreadSpinning()); - } - if (other.getShareClusterDevicesInSession() != false) { - setShareClusterDevicesInSession(other.getShareClusterDevicesInSession()); - } - if (other.hasSessionMetadata()) { - mergeSessionMetadata(other.getSessionMetadata()); - } - if (other.getOptimizeForStaticGraph() != false) { - setOptimizeForStaticGraph(other.getOptimizeForStaticGraph()); - } - if (other.getEnableMlirBridge() != false) { - setEnableMlirBridge(other.getEnableMlirBridge()); - } - if (other.mlirBridgeRollout_ != 0) { - setMlirBridgeRolloutValue(other.getMlirBridgeRolloutValue()); - } - if (other.getEnableMlirGraphOptimization() != false) { - setEnableMlirGraphOptimization(other.getEnableMlirGraphOptimization()); - } - if (other.getDisableOutputPartitionGraphs() != false) { - setDisableOutputPartitionGraphs(other.getDisableOutputPartitionGraphs()); - } - if (other.getXlaFusionAutotunerThresh() != 0L) { - setXlaFusionAutotunerThresh(other.getXlaFusionAutotunerThresh()); - } - if (other.getUseTfrt() != false) { - setUseTfrt(other.getUseTfrt()); - } - if (!other.getCoordinationService().isEmpty()) { - coordinationService_ = other.coordinationService_; - onChanged(); - } - if (other.getFetchRemoteDevicesInMultiClient() != false) { - setFetchRemoteDevicesInMultiClient(other.getFetchRemoteDevicesInMultiClient()); - } - 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.ConfigProto.Experimental parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ConfigProto.Experimental) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object collectiveGroupLeader_ = ""; - /** - *
    -       * Task name for group resolution.
    -       * 
    - * - * string collective_group_leader = 1; - */ - public java.lang.String getCollectiveGroupLeader() { - java.lang.Object ref = collectiveGroupLeader_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - collectiveGroupLeader_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Task name for group resolution.
    -       * 
    - * - * string collective_group_leader = 1; - */ - public com.google.protobuf.ByteString - getCollectiveGroupLeaderBytes() { - java.lang.Object ref = collectiveGroupLeader_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - collectiveGroupLeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Task name for group resolution.
    -       * 
    - * - * string collective_group_leader = 1; - */ - public Builder setCollectiveGroupLeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - collectiveGroupLeader_ = value; - onChanged(); - return this; - } - /** - *
    -       * Task name for group resolution.
    -       * 
    - * - * string collective_group_leader = 1; - */ - public Builder clearCollectiveGroupLeader() { - - collectiveGroupLeader_ = getDefaultInstance().getCollectiveGroupLeader(); - onChanged(); - return this; - } - /** - *
    -       * Task name for group resolution.
    -       * 
    - * - * string collective_group_leader = 1; - */ - public Builder setCollectiveGroupLeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - collectiveGroupLeader_ = value; - onChanged(); - return this; - } - - private java.lang.Object executorType_ = ""; - /** - *
    -       * Which executor to use, the default executor will be used
    -       * if it is an empty string or "DEFAULT"
    -       * 
    - * - * string executor_type = 3; - */ - public java.lang.String getExecutorType() { - java.lang.Object ref = executorType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - executorType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Which executor to use, the default executor will be used
    -       * if it is an empty string or "DEFAULT"
    -       * 
    - * - * string executor_type = 3; - */ - public com.google.protobuf.ByteString - getExecutorTypeBytes() { - java.lang.Object ref = executorType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - executorType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Which executor to use, the default executor will be used
    -       * if it is an empty string or "DEFAULT"
    -       * 
    - * - * string executor_type = 3; - */ - public Builder setExecutorType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - executorType_ = value; - onChanged(); - return this; - } - /** - *
    -       * Which executor to use, the default executor will be used
    -       * if it is an empty string or "DEFAULT"
    -       * 
    - * - * string executor_type = 3; - */ - public Builder clearExecutorType() { - - executorType_ = getDefaultInstance().getExecutorType(); - onChanged(); - return this; - } - /** - *
    -       * Which executor to use, the default executor will be used
    -       * if it is an empty string or "DEFAULT"
    -       * 
    - * - * string executor_type = 3; - */ - public Builder setExecutorTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - executorType_ = value; - onChanged(); - return this; - } - - private int recvBufMaxChunk_ ; - /** - *
    -       * Guidance to formatting of large RecvBuf fields for transfer.
    -       * Any positive value sets the max chunk size.  0 defaults to 4096.
    -       * Any negative value indicates no max, i.e. one chunk only.
    -       * 
    - * - * int32 recv_buf_max_chunk = 4; - */ - public int getRecvBufMaxChunk() { - return recvBufMaxChunk_; - } - /** - *
    -       * Guidance to formatting of large RecvBuf fields for transfer.
    -       * Any positive value sets the max chunk size.  0 defaults to 4096.
    -       * Any negative value indicates no max, i.e. one chunk only.
    -       * 
    - * - * int32 recv_buf_max_chunk = 4; - */ - public Builder setRecvBufMaxChunk(int value) { - - recvBufMaxChunk_ = value; - onChanged(); - return this; - } - /** - *
    -       * Guidance to formatting of large RecvBuf fields for transfer.
    -       * Any positive value sets the max chunk size.  0 defaults to 4096.
    -       * Any negative value indicates no max, i.e. one chunk only.
    -       * 
    - * - * int32 recv_buf_max_chunk = 4; - */ - public Builder clearRecvBufMaxChunk() { - - recvBufMaxChunk_ = 0; - onChanged(); - return this; - } - - private boolean useNumaAffinity_ ; - /** - *
    -       * If true, and supported by the platform, the runtime will attempt to
    -       * use NUMA affinity where applicable.  One consequence will be the
    -       * existence of as many CPU devices as there are available NUMA nodes.
    -       * 
    - * - * bool use_numa_affinity = 5; - */ - public boolean getUseNumaAffinity() { - return useNumaAffinity_; - } - /** - *
    -       * If true, and supported by the platform, the runtime will attempt to
    -       * use NUMA affinity where applicable.  One consequence will be the
    -       * existence of as many CPU devices as there are available NUMA nodes.
    -       * 
    - * - * bool use_numa_affinity = 5; - */ - public Builder setUseNumaAffinity(boolean value) { - - useNumaAffinity_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, and supported by the platform, the runtime will attempt to
    -       * use NUMA affinity where applicable.  One consequence will be the
    -       * existence of as many CPU devices as there are available NUMA nodes.
    -       * 
    - * - * bool use_numa_affinity = 5; - */ - public Builder clearUseNumaAffinity() { - - useNumaAffinity_ = false; - onChanged(); - return this; - } - - private boolean collectiveDeterministicSequentialExecution_ ; - /** - *
    -       * If true, make collective op execution order sequential and deterministic
    -       * for potentially concurrent collective instances.
    -       * 
    - * - * bool collective_deterministic_sequential_execution = 6; - */ - public boolean getCollectiveDeterministicSequentialExecution() { - return collectiveDeterministicSequentialExecution_; - } - /** - *
    -       * If true, make collective op execution order sequential and deterministic
    -       * for potentially concurrent collective instances.
    -       * 
    - * - * bool collective_deterministic_sequential_execution = 6; - */ - public Builder setCollectiveDeterministicSequentialExecution(boolean value) { - - collectiveDeterministicSequentialExecution_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, make collective op execution order sequential and deterministic
    -       * for potentially concurrent collective instances.
    -       * 
    - * - * bool collective_deterministic_sequential_execution = 6; - */ - public Builder clearCollectiveDeterministicSequentialExecution() { - - collectiveDeterministicSequentialExecution_ = false; - onChanged(); - return this; - } - - private boolean collectiveNccl_ ; - /** - *
    -       * If true, use NCCL for CollectiveOps.  This feature is highly
    -       * experimental.
    -       * 
    - * - * bool collective_nccl = 7; - */ - public boolean getCollectiveNccl() { - return collectiveNccl_; - } - /** - *
    -       * If true, use NCCL for CollectiveOps.  This feature is highly
    -       * experimental.
    -       * 
    - * - * bool collective_nccl = 7; - */ - public Builder setCollectiveNccl(boolean value) { - - collectiveNccl_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, use NCCL for CollectiveOps.  This feature is highly
    -       * experimental.
    -       * 
    - * - * bool collective_nccl = 7; - */ - public Builder clearCollectiveNccl() { - - collectiveNccl_ = false; - onChanged(); - return this; - } - - private boolean shareSessionStateInClusterspecPropagation_ ; - /** - *
    -       * In the following, session state means the value of a variable, elements
    -       * in a hash table, or any other resource, accessible by worker sessions
    -       * held by a TF server.
    -       * When ClusterSpec propagation is enabled, the value of
    -       * isolate_session_state is ignored when deciding whether to share session
    -       * states in a TF server (for backwards compatibility reasons).
    -       * - If share_session_state_in_clusterspec_propagation is true, the session
    -       * states are shared.
    -       * - If share_session_state_in_clusterspec_propagation is false, session
    -       * states are isolated.
    -       * When clusterspec propagation is not used, the value of
    -       * share_session_state_in_clusterspec_propagation is ignored when deciding
    -       * whether to share session states in a TF server.
    -       * - If isolate_session_state is true, session states are isolated.
    -       * - If isolate_session_state is false, session states are shared.
    -       * TODO(b/129330037): Add a single API that consistently treats
    -       * isolate_session_state and ClusterSpec propagation.
    -       * 
    - * - * bool share_session_state_in_clusterspec_propagation = 8; - */ - public boolean getShareSessionStateInClusterspecPropagation() { - return shareSessionStateInClusterspecPropagation_; - } - /** - *
    -       * In the following, session state means the value of a variable, elements
    -       * in a hash table, or any other resource, accessible by worker sessions
    -       * held by a TF server.
    -       * When ClusterSpec propagation is enabled, the value of
    -       * isolate_session_state is ignored when deciding whether to share session
    -       * states in a TF server (for backwards compatibility reasons).
    -       * - If share_session_state_in_clusterspec_propagation is true, the session
    -       * states are shared.
    -       * - If share_session_state_in_clusterspec_propagation is false, session
    -       * states are isolated.
    -       * When clusterspec propagation is not used, the value of
    -       * share_session_state_in_clusterspec_propagation is ignored when deciding
    -       * whether to share session states in a TF server.
    -       * - If isolate_session_state is true, session states are isolated.
    -       * - If isolate_session_state is false, session states are shared.
    -       * TODO(b/129330037): Add a single API that consistently treats
    -       * isolate_session_state and ClusterSpec propagation.
    -       * 
    - * - * bool share_session_state_in_clusterspec_propagation = 8; - */ - public Builder setShareSessionStateInClusterspecPropagation(boolean value) { - - shareSessionStateInClusterspecPropagation_ = value; - onChanged(); - return this; - } - /** - *
    -       * In the following, session state means the value of a variable, elements
    -       * in a hash table, or any other resource, accessible by worker sessions
    -       * held by a TF server.
    -       * When ClusterSpec propagation is enabled, the value of
    -       * isolate_session_state is ignored when deciding whether to share session
    -       * states in a TF server (for backwards compatibility reasons).
    -       * - If share_session_state_in_clusterspec_propagation is true, the session
    -       * states are shared.
    -       * - If share_session_state_in_clusterspec_propagation is false, session
    -       * states are isolated.
    -       * When clusterspec propagation is not used, the value of
    -       * share_session_state_in_clusterspec_propagation is ignored when deciding
    -       * whether to share session states in a TF server.
    -       * - If isolate_session_state is true, session states are isolated.
    -       * - If isolate_session_state is false, session states are shared.
    -       * TODO(b/129330037): Add a single API that consistently treats
    -       * isolate_session_state and ClusterSpec propagation.
    -       * 
    - * - * bool share_session_state_in_clusterspec_propagation = 8; - */ - public Builder clearShareSessionStateInClusterspecPropagation() { - - shareSessionStateInClusterspecPropagation_ = false; - onChanged(); - return this; - } - - private boolean disableThreadSpinning_ ; - /** - *
    -       * If using a direct session, disable spinning while waiting for work in
    -       * the thread pool. This may result in higher latency for completing ops,
    -       * but in the case where there is a lot of spinning may result in lower
    -       * CPU usage.
    -       * 
    - * - * bool disable_thread_spinning = 9; - */ - public boolean getDisableThreadSpinning() { - return disableThreadSpinning_; - } - /** - *
    -       * If using a direct session, disable spinning while waiting for work in
    -       * the thread pool. This may result in higher latency for completing ops,
    -       * but in the case where there is a lot of spinning may result in lower
    -       * CPU usage.
    -       * 
    - * - * bool disable_thread_spinning = 9; - */ - public Builder setDisableThreadSpinning(boolean value) { - - disableThreadSpinning_ = value; - onChanged(); - return this; - } - /** - *
    -       * If using a direct session, disable spinning while waiting for work in
    -       * the thread pool. This may result in higher latency for completing ops,
    -       * but in the case where there is a lot of spinning may result in lower
    -       * CPU usage.
    -       * 
    - * - * bool disable_thread_spinning = 9; - */ - public Builder clearDisableThreadSpinning() { - - disableThreadSpinning_ = false; - onChanged(); - return this; - } - - private boolean shareClusterDevicesInSession_ ; - /** - *
    -       * This was promoted to a non-experimental API. Please use
    -       * ConfigProto.share_cluster_devices_in_session instead.
    -       * 
    - * - * bool share_cluster_devices_in_session = 10; - */ - public boolean getShareClusterDevicesInSession() { - return shareClusterDevicesInSession_; - } - /** - *
    -       * This was promoted to a non-experimental API. Please use
    -       * ConfigProto.share_cluster_devices_in_session instead.
    -       * 
    - * - * bool share_cluster_devices_in_session = 10; - */ - public Builder setShareClusterDevicesInSession(boolean value) { - - shareClusterDevicesInSession_ = value; - onChanged(); - return this; - } - /** - *
    -       * This was promoted to a non-experimental API. Please use
    -       * ConfigProto.share_cluster_devices_in_session instead.
    -       * 
    - * - * bool share_cluster_devices_in_session = 10; - */ - public Builder clearShareClusterDevicesInSession() { - - shareClusterDevicesInSession_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.SessionMetadata sessionMetadata_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionMetadata, org.tensorflow.proto.framework.SessionMetadata.Builder, org.tensorflow.proto.framework.SessionMetadataOrBuilder> sessionMetadataBuilder_; - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public boolean hasSessionMetadata() { - return sessionMetadataBuilder_ != null || sessionMetadata_ != null; - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public org.tensorflow.proto.framework.SessionMetadata getSessionMetadata() { - if (sessionMetadataBuilder_ == null) { - return sessionMetadata_ == null ? org.tensorflow.proto.framework.SessionMetadata.getDefaultInstance() : sessionMetadata_; - } else { - return sessionMetadataBuilder_.getMessage(); - } - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public Builder setSessionMetadata(org.tensorflow.proto.framework.SessionMetadata value) { - if (sessionMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sessionMetadata_ = value; - onChanged(); - } else { - sessionMetadataBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public Builder setSessionMetadata( - org.tensorflow.proto.framework.SessionMetadata.Builder builderForValue) { - if (sessionMetadataBuilder_ == null) { - sessionMetadata_ = builderForValue.build(); - onChanged(); - } else { - sessionMetadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public Builder mergeSessionMetadata(org.tensorflow.proto.framework.SessionMetadata value) { - if (sessionMetadataBuilder_ == null) { - if (sessionMetadata_ != null) { - sessionMetadata_ = - org.tensorflow.proto.framework.SessionMetadata.newBuilder(sessionMetadata_).mergeFrom(value).buildPartial(); - } else { - sessionMetadata_ = value; - } - onChanged(); - } else { - sessionMetadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public Builder clearSessionMetadata() { - if (sessionMetadataBuilder_ == null) { - sessionMetadata_ = null; - onChanged(); - } else { - sessionMetadata_ = null; - sessionMetadataBuilder_ = null; - } - - return this; - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public org.tensorflow.proto.framework.SessionMetadata.Builder getSessionMetadataBuilder() { - - onChanged(); - return getSessionMetadataFieldBuilder().getBuilder(); - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - public org.tensorflow.proto.framework.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { - if (sessionMetadataBuilder_ != null) { - return sessionMetadataBuilder_.getMessageOrBuilder(); - } else { - return sessionMetadata_ == null ? - org.tensorflow.proto.framework.SessionMetadata.getDefaultInstance() : sessionMetadata_; - } - } - /** - *
    -       * Metadata about the session.
    -       * If set, this can be used by the runtime and the Ops for debugging,
    -       * monitoring, etc.
    -       * NOTE: This is currently used and propagated only by the direct session.
    -       * 
    - * - * .tensorflow.SessionMetadata session_metadata = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionMetadata, org.tensorflow.proto.framework.SessionMetadata.Builder, org.tensorflow.proto.framework.SessionMetadataOrBuilder> - getSessionMetadataFieldBuilder() { - if (sessionMetadataBuilder_ == null) { - sessionMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionMetadata, org.tensorflow.proto.framework.SessionMetadata.Builder, org.tensorflow.proto.framework.SessionMetadataOrBuilder>( - getSessionMetadata(), - getParentForChildren(), - isClean()); - sessionMetadata_ = null; - } - return sessionMetadataBuilder_; - } - - private boolean optimizeForStaticGraph_ ; - /** - *
    -       * If true, the session may treat the graph as being static for optimization
    -       * purposes.
    -       * If this option is set to true when a session is created, the full
    -       * GraphDef must be passed in a single call to Session::Create(), and
    -       * Session::Extend() may not be supported.
    -       * 
    - * - * bool optimize_for_static_graph = 12; - */ - public boolean getOptimizeForStaticGraph() { - return optimizeForStaticGraph_; - } - /** - *
    -       * If true, the session may treat the graph as being static for optimization
    -       * purposes.
    -       * If this option is set to true when a session is created, the full
    -       * GraphDef must be passed in a single call to Session::Create(), and
    -       * Session::Extend() may not be supported.
    -       * 
    - * - * bool optimize_for_static_graph = 12; - */ - public Builder setOptimizeForStaticGraph(boolean value) { - - optimizeForStaticGraph_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, the session may treat the graph as being static for optimization
    -       * purposes.
    -       * If this option is set to true when a session is created, the full
    -       * GraphDef must be passed in a single call to Session::Create(), and
    -       * Session::Extend() may not be supported.
    -       * 
    - * - * bool optimize_for_static_graph = 12; - */ - public Builder clearOptimizeForStaticGraph() { - - optimizeForStaticGraph_ = false; - onChanged(); - return this; - } - - 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.
    -       * If this option is set to true when a session is created, MLIR is used to
    -       * perform the set of graph transformations to put the graph in a form that
    -       * can be executed with delegation of some computations to an accelerator.
    -       * This builds on the model of XLA where a subset of the graph is
    -       * encapsulated and attached to a "compile" operation, whose result is fed
    -       * to an "execute" operation. The kernel for these operations is responsible
    -       * to lower the encapsulated graph to a particular device.
    -       * 
    - * - * bool enable_mlir_bridge = 13; - */ - public boolean getEnableMlirBridge() { - return 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.
    -       * If this option is set to true when a session is created, MLIR is used to
    -       * perform the set of graph transformations to put the graph in a form that
    -       * can be executed with delegation of some computations to an accelerator.
    -       * This builds on the model of XLA where a subset of the graph is
    -       * encapsulated and attached to a "compile" operation, whose result is fed
    -       * to an "execute" operation. The kernel for these operations is responsible
    -       * to lower the encapsulated graph to a particular device.
    -       * 
    - * - * bool enable_mlir_bridge = 13; - */ - public Builder setEnableMlirBridge(boolean value) { - - enableMlirBridge_ = value; - onChanged(); - return this; - } - /** - *
    -       * 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.
    -       * If this option is set to true when a session is created, MLIR is used to
    -       * perform the set of graph transformations to put the graph in a form that
    -       * can be executed with delegation of some computations to an accelerator.
    -       * This builds on the model of XLA where a subset of the graph is
    -       * encapsulated and attached to a "compile" operation, whose result is fed
    -       * to an "execute" operation. The kernel for these operations is responsible
    -       * to lower the encapsulated graph to a particular device.
    -       * 
    - * - * bool enable_mlir_bridge = 13; - */ - public Builder clearEnableMlirBridge() { - - enableMlirBridge_ = false; - onChanged(); - 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_ ; - /** - *
    -       * Whether to enable the MLIR-based Graph optimizations.
    -       * This will become a part of standard Tensorflow graph optimization
    -       * pipeline, currently this is only used for gradual migration and testing
    -       * new passes that are replacing existing optimizations in Grappler.
    -       * 
    - * - * bool enable_mlir_graph_optimization = 16; - */ - public boolean getEnableMlirGraphOptimization() { - return enableMlirGraphOptimization_; - } - /** - *
    -       * Whether to enable the MLIR-based Graph optimizations.
    -       * This will become a part of standard Tensorflow graph optimization
    -       * pipeline, currently this is only used for gradual migration and testing
    -       * new passes that are replacing existing optimizations in Grappler.
    -       * 
    - * - * bool enable_mlir_graph_optimization = 16; - */ - public Builder setEnableMlirGraphOptimization(boolean value) { - - enableMlirGraphOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -       * Whether to enable the MLIR-based Graph optimizations.
    -       * This will become a part of standard Tensorflow graph optimization
    -       * pipeline, currently this is only used for gradual migration and testing
    -       * new passes that are replacing existing optimizations in Grappler.
    -       * 
    - * - * bool enable_mlir_graph_optimization = 16; - */ - public Builder clearEnableMlirGraphOptimization() { - - enableMlirGraphOptimization_ = false; - onChanged(); - return this; - } - - private boolean disableOutputPartitionGraphs_ ; - /** - *
    -       * If true, the session will not store an additional copy of the graph for
    -       * each subgraph.
    -       * If this option is set to true when a session is created, the
    -       * `RunOptions.output_partition_graphs` options must not be set.
    -       * 
    - * - * bool disable_output_partition_graphs = 14; - */ - public boolean getDisableOutputPartitionGraphs() { - return disableOutputPartitionGraphs_; - } - /** - *
    -       * If true, the session will not store an additional copy of the graph for
    -       * each subgraph.
    -       * If this option is set to true when a session is created, the
    -       * `RunOptions.output_partition_graphs` options must not be set.
    -       * 
    - * - * bool disable_output_partition_graphs = 14; - */ - public Builder setDisableOutputPartitionGraphs(boolean value) { - - disableOutputPartitionGraphs_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, the session will not store an additional copy of the graph for
    -       * each subgraph.
    -       * If this option is set to true when a session is created, the
    -       * `RunOptions.output_partition_graphs` options must not be set.
    -       * 
    - * - * bool disable_output_partition_graphs = 14; - */ - public Builder clearDisableOutputPartitionGraphs() { - - disableOutputPartitionGraphs_ = false; - onChanged(); - return this; - } - - private long xlaFusionAutotunerThresh_ ; - /** - *
    -       * Minimum number of batches run through the XLA graph before XLA fusion
    -       * autotuner is enabled. Default value of zero disables the autotuner.
    -       * The XLA fusion autotuner can improve performance by executing a heuristic
    -       * search on the compiler parameters.
    -       * 
    - * - * int64 xla_fusion_autotuner_thresh = 15; - */ - public long getXlaFusionAutotunerThresh() { - return xlaFusionAutotunerThresh_; - } - /** - *
    -       * Minimum number of batches run through the XLA graph before XLA fusion
    -       * autotuner is enabled. Default value of zero disables the autotuner.
    -       * The XLA fusion autotuner can improve performance by executing a heuristic
    -       * search on the compiler parameters.
    -       * 
    - * - * int64 xla_fusion_autotuner_thresh = 15; - */ - public Builder setXlaFusionAutotunerThresh(long value) { - - xlaFusionAutotunerThresh_ = value; - onChanged(); - return this; - } - /** - *
    -       * Minimum number of batches run through the XLA graph before XLA fusion
    -       * autotuner is enabled. Default value of zero disables the autotuner.
    -       * The XLA fusion autotuner can improve performance by executing a heuristic
    -       * search on the compiler parameters.
    -       * 
    - * - * int64 xla_fusion_autotuner_thresh = 15; - */ - public Builder clearXlaFusionAutotunerThresh() { - - xlaFusionAutotunerThresh_ = 0L; - onChanged(); - return this; - } - - private boolean useTfrt_ ; - /** - *
    -       * Whether runtime execution uses TFRT.
    -       * 
    - * - * bool use_tfrt = 18; - */ - public boolean getUseTfrt() { - return useTfrt_; - } - /** - *
    -       * Whether runtime execution uses TFRT.
    -       * 
    - * - * bool use_tfrt = 18; - */ - public Builder setUseTfrt(boolean value) { - - useTfrt_ = value; - onChanged(); - return this; - } - /** - *
    -       * Whether runtime execution uses TFRT.
    -       * 
    - * - * bool use_tfrt = 18; - */ - public Builder clearUseTfrt() { - - useTfrt_ = false; - onChanged(); - return this; - } - - private java.lang.Object coordinationService_ = ""; - /** - *
    -       * Distributed coordination service to be enabled if set.
    -       * Currently only effective in multi-client setup.
    -       * 
    - * - * string coordination_service = 19; - */ - public java.lang.String getCoordinationService() { - java.lang.Object ref = coordinationService_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - coordinationService_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Distributed coordination service to be enabled if set.
    -       * Currently only effective in multi-client setup.
    -       * 
    - * - * string coordination_service = 19; - */ - public com.google.protobuf.ByteString - getCoordinationServiceBytes() { - java.lang.Object ref = coordinationService_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - coordinationService_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Distributed coordination service to be enabled if set.
    -       * Currently only effective in multi-client setup.
    -       * 
    - * - * string coordination_service = 19; - */ - public Builder setCoordinationService( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - coordinationService_ = value; - onChanged(); - return this; - } - /** - *
    -       * Distributed coordination service to be enabled if set.
    -       * Currently only effective in multi-client setup.
    -       * 
    - * - * string coordination_service = 19; - */ - public Builder clearCoordinationService() { - - coordinationService_ = getDefaultInstance().getCoordinationService(); - onChanged(); - return this; - } - /** - *
    -       * Distributed coordination service to be enabled if set.
    -       * Currently only effective in multi-client setup.
    -       * 
    - * - * string coordination_service = 19; - */ - public Builder setCoordinationServiceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - coordinationService_ = value; - onChanged(); - return this; - } - - private boolean fetchRemoteDevicesInMultiClient_ ; - /** - *
    -       * Whether the remote devices in the cluster should be fetched during setup
    -       * of multi-client cluster. If enabled, the workers will run an extra device
    -       * information exchange step during startup and the workers' EagerContexts
    -       * will become aware of remote devices in the cluster as well.
    -       * 
    - * - * bool fetch_remote_devices_in_multi_client = 20; - */ - public boolean getFetchRemoteDevicesInMultiClient() { - return fetchRemoteDevicesInMultiClient_; - } - /** - *
    -       * Whether the remote devices in the cluster should be fetched during setup
    -       * of multi-client cluster. If enabled, the workers will run an extra device
    -       * information exchange step during startup and the workers' EagerContexts
    -       * will become aware of remote devices in the cluster as well.
    -       * 
    - * - * bool fetch_remote_devices_in_multi_client = 20; - */ - public Builder setFetchRemoteDevicesInMultiClient(boolean value) { - - fetchRemoteDevicesInMultiClient_ = value; - onChanged(); - return this; - } - /** - *
    -       * Whether the remote devices in the cluster should be fetched during setup
    -       * of multi-client cluster. If enabled, the workers will run an extra device
    -       * information exchange step during startup and the workers' EagerContexts
    -       * will become aware of remote devices in the cluster as well.
    -       * 
    - * - * bool fetch_remote_devices_in_multi_client = 20; - */ - public Builder clearFetchRemoteDevicesInMultiClient() { - - fetchRemoteDevicesInMultiClient_ = false; - 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.ConfigProto.Experimental) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ConfigProto.Experimental) - private static final org.tensorflow.proto.framework.ConfigProto.Experimental DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ConfigProto.Experimental(); - } - - public static org.tensorflow.proto.framework.ConfigProto.Experimental getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Experimental parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Experimental(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.ConfigProto.Experimental getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int DEVICE_COUNT_FIELD_NUMBER = 1; - private static final class DeviceCountDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.Integer> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.INT32, - 0); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.Integer> deviceCount_; - private com.google.protobuf.MapField - internalGetDeviceCount() { - if (deviceCount_ == null) { - return com.google.protobuf.MapField.emptyMapField( - DeviceCountDefaultEntryHolder.defaultEntry); - } - return deviceCount_; - } - - public int getDeviceCountCount() { - return internalGetDeviceCount().getMap().size(); - } - /** - *
    -   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -   * number of devices of that type to use.  If a particular device
    -   * type is not found in the map, the system picks an appropriate
    -   * number.
    -   * 
    - * - * map<string, int32> device_count = 1; - */ - - public boolean containsDeviceCount( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetDeviceCount().getMap().containsKey(key); - } - /** - * Use {@link #getDeviceCountMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getDeviceCount() { - return getDeviceCountMap(); - } - /** - *
    -   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -   * number of devices of that type to use.  If a particular device
    -   * type is not found in the map, the system picks an appropriate
    -   * number.
    -   * 
    - * - * map<string, int32> device_count = 1; - */ - - public java.util.Map getDeviceCountMap() { - return internalGetDeviceCount().getMap(); - } - /** - *
    -   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -   * number of devices of that type to use.  If a particular device
    -   * type is not found in the map, the system picks an appropriate
    -   * number.
    -   * 
    - * - * map<string, int32> device_count = 1; - */ - - public int getDeviceCountOrDefault( - java.lang.String key, - int defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetDeviceCount().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -   * number of devices of that type to use.  If a particular device
    -   * type is not found in the map, the system picks an appropriate
    -   * number.
    -   * 
    - * - * map<string, int32> device_count = 1; - */ - - public int getDeviceCountOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetDeviceCount().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int INTRA_OP_PARALLELISM_THREADS_FIELD_NUMBER = 2; - private int intraOpParallelismThreads_; - /** - *
    -   * The execution of an individual op (for some op types) can be
    -   * parallelized on a pool of intra_op_parallelism_threads.
    -   * 0 means the system picks an appropriate number.
    -   * If you create an ordinary session, e.g., from Python or C++,
    -   * then there is exactly one intra op thread pool per process.
    -   * The first session created determines the number of threads in this pool.
    -   * All subsequent sessions reuse/share this one global pool.
    -   * There are notable exceptions to the default behavior described above:
    -   * 1. There is an environment variable  for overriding this thread pool,
    -   *    named TF_OVERRIDE_GLOBAL_THREADPOOL.
    -   * 2. When connecting to a server, such as a remote `tf.train.Server`
    -   *    instance, then this option will be ignored altogether.
    -   * 
    - * - * int32 intra_op_parallelism_threads = 2; - */ - public int getIntraOpParallelismThreads() { - return intraOpParallelismThreads_; - } - - public static final int INTER_OP_PARALLELISM_THREADS_FIELD_NUMBER = 5; - private int interOpParallelismThreads_; - /** - *
    -   * Nodes that perform blocking operations are enqueued on a pool of
    -   * inter_op_parallelism_threads available in each process.
    -   * 0 means the system picks an appropriate number.
    -   * Negative means all operations are performed in caller's thread.
    -   * Note that the first Session created in the process sets the
    -   * number of threads for all future sessions unless use_per_session_threads is
    -   * true or session_inter_op_thread_pool is configured.
    -   * 
    - * - * int32 inter_op_parallelism_threads = 5; - */ - public int getInterOpParallelismThreads() { - return interOpParallelismThreads_; - } - - public static final int USE_PER_SESSION_THREADS_FIELD_NUMBER = 9; - private boolean usePerSessionThreads_; - /** - *
    -   * If true, use a new set of threads for this session rather than the global
    -   * pool of threads. Only supported by direct sessions.
    -   * If false, use the global threads created by the first session, or the
    -   * per-session thread pools configured by session_inter_op_thread_pool.
    -   * This option is deprecated. The same effect can be achieved by setting
    -   * session_inter_op_thread_pool to have one element, whose num_threads equals
    -   * inter_op_parallelism_threads.
    -   * 
    - * - * bool use_per_session_threads = 9; - */ - public boolean getUsePerSessionThreads() { - return usePerSessionThreads_; - } - - public static final int SESSION_INTER_OP_THREAD_POOL_FIELD_NUMBER = 12; - private java.util.List sessionInterOpThreadPool_; - /** - *
    -   * This option is experimental - it may be replaced with a different mechanism
    -   * in the future.
    -   * Configures session thread pools. If this is configured, then RunOptions for
    -   * a Run call can select the thread pool to use.
    -   * The intended use is for when some session invocations need to run in a
    -   * background pool limited to a small number of threads:
    -   * - For example, a session may be configured to have one large pool (for
    -   * regular compute) and one small pool (for periodic, low priority work);
    -   * using the small pool is currently the mechanism for limiting the inter-op
    -   * parallelism of the low priority work.  Note that it does not limit the
    -   * parallelism of work spawned by a single op kernel implementation.
    -   * - Using this setting is normally not needed in training, but may help some
    -   * serving use cases.
    -   * - It is also generally recommended to set the global_name field of this
    -   * proto, to avoid creating multiple large pools. It is typically better to
    -   * run the non-low-priority work, even across sessions, in a single large
    -   * pool.
    -   * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public java.util.List getSessionInterOpThreadPoolList() { - return sessionInterOpThreadPool_; - } - /** - *
    -   * This option is experimental - it may be replaced with a different mechanism
    -   * in the future.
    -   * Configures session thread pools. If this is configured, then RunOptions for
    -   * a Run call can select the thread pool to use.
    -   * The intended use is for when some session invocations need to run in a
    -   * background pool limited to a small number of threads:
    -   * - For example, a session may be configured to have one large pool (for
    -   * regular compute) and one small pool (for periodic, low priority work);
    -   * using the small pool is currently the mechanism for limiting the inter-op
    -   * parallelism of the low priority work.  Note that it does not limit the
    -   * parallelism of work spawned by a single op kernel implementation.
    -   * - Using this setting is normally not needed in training, but may help some
    -   * serving use cases.
    -   * - It is also generally recommended to set the global_name field of this
    -   * proto, to avoid creating multiple large pools. It is typically better to
    -   * run the non-low-priority work, even across sessions, in a single large
    -   * pool.
    -   * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public java.util.List - getSessionInterOpThreadPoolOrBuilderList() { - return sessionInterOpThreadPool_; - } - /** - *
    -   * This option is experimental - it may be replaced with a different mechanism
    -   * in the future.
    -   * Configures session thread pools. If this is configured, then RunOptions for
    -   * a Run call can select the thread pool to use.
    -   * The intended use is for when some session invocations need to run in a
    -   * background pool limited to a small number of threads:
    -   * - For example, a session may be configured to have one large pool (for
    -   * regular compute) and one small pool (for periodic, low priority work);
    -   * using the small pool is currently the mechanism for limiting the inter-op
    -   * parallelism of the low priority work.  Note that it does not limit the
    -   * parallelism of work spawned by a single op kernel implementation.
    -   * - Using this setting is normally not needed in training, but may help some
    -   * serving use cases.
    -   * - It is also generally recommended to set the global_name field of this
    -   * proto, to avoid creating multiple large pools. It is typically better to
    -   * run the non-low-priority work, even across sessions, in a single large
    -   * pool.
    -   * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public int getSessionInterOpThreadPoolCount() { - return sessionInterOpThreadPool_.size(); - } - /** - *
    -   * This option is experimental - it may be replaced with a different mechanism
    -   * in the future.
    -   * Configures session thread pools. If this is configured, then RunOptions for
    -   * a Run call can select the thread pool to use.
    -   * The intended use is for when some session invocations need to run in a
    -   * background pool limited to a small number of threads:
    -   * - For example, a session may be configured to have one large pool (for
    -   * regular compute) and one small pool (for periodic, low priority work);
    -   * using the small pool is currently the mechanism for limiting the inter-op
    -   * parallelism of the low priority work.  Note that it does not limit the
    -   * parallelism of work spawned by a single op kernel implementation.
    -   * - Using this setting is normally not needed in training, but may help some
    -   * serving use cases.
    -   * - It is also generally recommended to set the global_name field of this
    -   * proto, to avoid creating multiple large pools. It is typically better to
    -   * run the non-low-priority work, even across sessions, in a single large
    -   * pool.
    -   * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProto getSessionInterOpThreadPool(int index) { - return sessionInterOpThreadPool_.get(index); - } - /** - *
    -   * This option is experimental - it may be replaced with a different mechanism
    -   * in the future.
    -   * Configures session thread pools. If this is configured, then RunOptions for
    -   * a Run call can select the thread pool to use.
    -   * The intended use is for when some session invocations need to run in a
    -   * background pool limited to a small number of threads:
    -   * - For example, a session may be configured to have one large pool (for
    -   * regular compute) and one small pool (for periodic, low priority work);
    -   * using the small pool is currently the mechanism for limiting the inter-op
    -   * parallelism of the low priority work.  Note that it does not limit the
    -   * parallelism of work spawned by a single op kernel implementation.
    -   * - Using this setting is normally not needed in training, but may help some
    -   * serving use cases.
    -   * - It is also generally recommended to set the global_name field of this
    -   * proto, to avoid creating multiple large pools. It is typically better to
    -   * run the non-low-priority work, even across sessions, in a single large
    -   * pool.
    -   * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder( - int index) { - return sessionInterOpThreadPool_.get(index); - } - - public static final int PLACEMENT_PERIOD_FIELD_NUMBER = 3; - private int placementPeriod_; - /** - *
    -   * Assignment of Nodes to Devices is recomputed every placement_period
    -   * steps until the system warms up (at which point the recomputation
    -   * typically slows down automatically).
    -   * 
    - * - * int32 placement_period = 3; - */ - public int getPlacementPeriod() { - return placementPeriod_; - } - - public static final int DEVICE_FILTERS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList deviceFilters_; - /** - *
    -   * When any filters are present sessions will ignore all devices which do not
    -   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -   * "/job:worker/replica:3", etc.
    -   * 
    - * - * repeated string device_filters = 4; - */ - public com.google.protobuf.ProtocolStringList - getDeviceFiltersList() { - return deviceFilters_; - } - /** - *
    -   * When any filters are present sessions will ignore all devices which do not
    -   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -   * "/job:worker/replica:3", etc.
    -   * 
    - * - * repeated string device_filters = 4; - */ - public int getDeviceFiltersCount() { - return deviceFilters_.size(); - } - /** - *
    -   * When any filters are present sessions will ignore all devices which do not
    -   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -   * "/job:worker/replica:3", etc.
    -   * 
    - * - * repeated string device_filters = 4; - */ - public java.lang.String getDeviceFilters(int index) { - return deviceFilters_.get(index); - } - /** - *
    -   * When any filters are present sessions will ignore all devices which do not
    -   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -   * "/job:worker/replica:3", etc.
    -   * 
    - * - * repeated string device_filters = 4; - */ - public com.google.protobuf.ByteString - getDeviceFiltersBytes(int index) { - return deviceFilters_.getByteString(index); - } - - public static final int GPU_OPTIONS_FIELD_NUMBER = 6; - private org.tensorflow.proto.framework.GPUOptions gpuOptions_; - /** - *
    -   * Options that apply to all GPUs.
    -   * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public boolean hasGpuOptions() { - return gpuOptions_ != null; - } - /** - *
    -   * Options that apply to all GPUs.
    -   * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public org.tensorflow.proto.framework.GPUOptions getGpuOptions() { - return gpuOptions_ == null ? org.tensorflow.proto.framework.GPUOptions.getDefaultInstance() : gpuOptions_; - } - /** - *
    -   * Options that apply to all GPUs.
    -   * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public org.tensorflow.proto.framework.GPUOptionsOrBuilder getGpuOptionsOrBuilder() { - return getGpuOptions(); - } - - public static final int ALLOW_SOFT_PLACEMENT_FIELD_NUMBER = 7; - private boolean allowSoftPlacement_; - /** - *
    -   * Whether soft placement is allowed. If allow_soft_placement is true,
    -   * an op will be placed on CPU if
    -   *   1. there's no GPU implementation for the OP
    -   * or
    -   *   2. no GPU devices are known or registered
    -   * or
    -   *   3. need to co-locate with reftype input(s) which are from CPU.
    -   * 
    - * - * bool allow_soft_placement = 7; - */ - public boolean getAllowSoftPlacement() { - return allowSoftPlacement_; - } - - public static final int LOG_DEVICE_PLACEMENT_FIELD_NUMBER = 8; - private boolean logDevicePlacement_; - /** - *
    -   * Whether device placements should be logged.
    -   * 
    - * - * bool log_device_placement = 8; - */ - public boolean getLogDevicePlacement() { - return logDevicePlacement_; - } - - public static final int GRAPH_OPTIONS_FIELD_NUMBER = 10; - private org.tensorflow.proto.framework.GraphOptions graphOptions_; - /** - *
    -   * Options that apply to all graphs.
    -   * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public boolean hasGraphOptions() { - return graphOptions_ != null; - } - /** - *
    -   * Options that apply to all graphs.
    -   * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public org.tensorflow.proto.framework.GraphOptions getGraphOptions() { - return graphOptions_ == null ? org.tensorflow.proto.framework.GraphOptions.getDefaultInstance() : graphOptions_; - } - /** - *
    -   * Options that apply to all graphs.
    -   * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public org.tensorflow.proto.framework.GraphOptionsOrBuilder getGraphOptionsOrBuilder() { - return getGraphOptions(); - } - - public static final int OPERATION_TIMEOUT_IN_MS_FIELD_NUMBER = 11; - private long operationTimeoutInMs_; - /** - *
    -   * Global timeout for all blocking operations in this session.  If non-zero,
    -   * and not overridden on a per-operation basis, this value will be used as the
    -   * deadline for all blocking operations.
    -   * 
    - * - * int64 operation_timeout_in_ms = 11; - */ - public long getOperationTimeoutInMs() { - return operationTimeoutInMs_; - } - - public static final int RPC_OPTIONS_FIELD_NUMBER = 13; - private org.tensorflow.proto.framework.RPCOptions rpcOptions_; - /** - *
    -   * Options that apply when this session uses the distributed runtime.
    -   * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public boolean hasRpcOptions() { - return rpcOptions_ != null; - } - /** - *
    -   * Options that apply when this session uses the distributed runtime.
    -   * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public org.tensorflow.proto.framework.RPCOptions getRpcOptions() { - return rpcOptions_ == null ? org.tensorflow.proto.framework.RPCOptions.getDefaultInstance() : rpcOptions_; - } - /** - *
    -   * Options that apply when this session uses the distributed runtime.
    -   * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public org.tensorflow.proto.framework.RPCOptionsOrBuilder getRpcOptionsOrBuilder() { - return getRpcOptions(); - } - - public static final int CLUSTER_DEF_FIELD_NUMBER = 14; - private org.tensorflow.proto.distruntime.ClusterDef clusterDef_; - /** - *
    -   * Optional list of all workers to use in this session.
    -   * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public boolean hasClusterDef() { - return clusterDef_ != null; - } - /** - *
    -   * Optional list of all workers to use in this session.
    -   * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public org.tensorflow.proto.distruntime.ClusterDef getClusterDef() { - return clusterDef_ == null ? org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : clusterDef_; - } - /** - *
    -   * Optional list of all workers to use in this session.
    -   * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterDefOrBuilder() { - return getClusterDef(); - } - - public static final int ISOLATE_SESSION_STATE_FIELD_NUMBER = 15; - private boolean isolateSessionState_; - /** - *
    -   * If true, any resources such as Variables used in the session will not be
    -   * shared with other sessions. However, when clusterspec propagation is
    -   * enabled, this field is ignored and sessions are always isolated.
    -   * 
    - * - * bool isolate_session_state = 15; - */ - public boolean getIsolateSessionState() { - return isolateSessionState_; - } - - public static final int SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER = 17; - private boolean shareClusterDevicesInSession_; - /** - *
    -   * When true, WorkerSessions are created with device attributes from the
    -   * full cluster.
    -   * This is helpful when a worker wants to partition a graph
    -   * (for example during a PartitionedCallOp).
    -   * 
    - * - * bool share_cluster_devices_in_session = 17; - */ - public boolean getShareClusterDevicesInSession() { - return shareClusterDevicesInSession_; - } - - public static final int EXPERIMENTAL_FIELD_NUMBER = 16; - private org.tensorflow.proto.framework.ConfigProto.Experimental experimental_; - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public boolean hasExperimental() { - return experimental_ != null; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public org.tensorflow.proto.framework.ConfigProto.Experimental getExperimental() { - return experimental_ == null ? org.tensorflow.proto.framework.ConfigProto.Experimental.getDefaultInstance() : experimental_; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder() { - return getExperimental(); - } - - 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 - .serializeStringMapTo( - output, - internalGetDeviceCount(), - DeviceCountDefaultEntryHolder.defaultEntry, - 1); - if (intraOpParallelismThreads_ != 0) { - output.writeInt32(2, intraOpParallelismThreads_); - } - if (placementPeriod_ != 0) { - output.writeInt32(3, placementPeriod_); - } - for (int i = 0; i < deviceFilters_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, deviceFilters_.getRaw(i)); - } - if (interOpParallelismThreads_ != 0) { - output.writeInt32(5, interOpParallelismThreads_); - } - if (gpuOptions_ != null) { - output.writeMessage(6, getGpuOptions()); - } - if (allowSoftPlacement_ != false) { - output.writeBool(7, allowSoftPlacement_); - } - if (logDevicePlacement_ != false) { - output.writeBool(8, logDevicePlacement_); - } - if (usePerSessionThreads_ != false) { - output.writeBool(9, usePerSessionThreads_); - } - if (graphOptions_ != null) { - output.writeMessage(10, getGraphOptions()); - } - if (operationTimeoutInMs_ != 0L) { - output.writeInt64(11, operationTimeoutInMs_); - } - for (int i = 0; i < sessionInterOpThreadPool_.size(); i++) { - output.writeMessage(12, sessionInterOpThreadPool_.get(i)); - } - if (rpcOptions_ != null) { - output.writeMessage(13, getRpcOptions()); - } - if (clusterDef_ != null) { - output.writeMessage(14, getClusterDef()); - } - if (isolateSessionState_ != false) { - output.writeBool(15, isolateSessionState_); - } - if (experimental_ != null) { - output.writeMessage(16, getExperimental()); - } - if (shareClusterDevicesInSession_ != false) { - output.writeBool(17, shareClusterDevicesInSession_); - } - 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 - : internalGetDeviceCount().getMap().entrySet()) { - com.google.protobuf.MapEntry - deviceCount__ = DeviceCountDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, deviceCount__); - } - if (intraOpParallelismThreads_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, intraOpParallelismThreads_); - } - if (placementPeriod_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, placementPeriod_); - } - { - int dataSize = 0; - for (int i = 0; i < deviceFilters_.size(); i++) { - dataSize += computeStringSizeNoTag(deviceFilters_.getRaw(i)); - } - size += dataSize; - size += 1 * getDeviceFiltersList().size(); - } - if (interOpParallelismThreads_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, interOpParallelismThreads_); - } - if (gpuOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getGpuOptions()); - } - if (allowSoftPlacement_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, allowSoftPlacement_); - } - if (logDevicePlacement_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, logDevicePlacement_); - } - if (usePerSessionThreads_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, usePerSessionThreads_); - } - if (graphOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, getGraphOptions()); - } - if (operationTimeoutInMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(11, operationTimeoutInMs_); - } - for (int i = 0; i < sessionInterOpThreadPool_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, sessionInterOpThreadPool_.get(i)); - } - if (rpcOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, getRpcOptions()); - } - if (clusterDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, getClusterDef()); - } - if (isolateSessionState_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(15, isolateSessionState_); - } - if (experimental_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, getExperimental()); - } - if (shareClusterDevicesInSession_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(17, shareClusterDevicesInSession_); - } - 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.ConfigProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ConfigProto other = (org.tensorflow.proto.framework.ConfigProto) obj; - - if (!internalGetDeviceCount().equals( - other.internalGetDeviceCount())) return false; - if (getIntraOpParallelismThreads() - != other.getIntraOpParallelismThreads()) return false; - if (getInterOpParallelismThreads() - != other.getInterOpParallelismThreads()) return false; - if (getUsePerSessionThreads() - != other.getUsePerSessionThreads()) return false; - if (!getSessionInterOpThreadPoolList() - .equals(other.getSessionInterOpThreadPoolList())) return false; - if (getPlacementPeriod() - != other.getPlacementPeriod()) return false; - if (!getDeviceFiltersList() - .equals(other.getDeviceFiltersList())) return false; - if (hasGpuOptions() != other.hasGpuOptions()) return false; - if (hasGpuOptions()) { - if (!getGpuOptions() - .equals(other.getGpuOptions())) return false; - } - if (getAllowSoftPlacement() - != other.getAllowSoftPlacement()) return false; - if (getLogDevicePlacement() - != other.getLogDevicePlacement()) return false; - if (hasGraphOptions() != other.hasGraphOptions()) return false; - if (hasGraphOptions()) { - if (!getGraphOptions() - .equals(other.getGraphOptions())) return false; - } - if (getOperationTimeoutInMs() - != other.getOperationTimeoutInMs()) return false; - if (hasRpcOptions() != other.hasRpcOptions()) return false; - if (hasRpcOptions()) { - if (!getRpcOptions() - .equals(other.getRpcOptions())) return false; - } - if (hasClusterDef() != other.hasClusterDef()) return false; - if (hasClusterDef()) { - if (!getClusterDef() - .equals(other.getClusterDef())) return false; - } - if (getIsolateSessionState() - != other.getIsolateSessionState()) return false; - if (getShareClusterDevicesInSession() - != other.getShareClusterDevicesInSession()) return false; - if (hasExperimental() != other.hasExperimental()) return false; - if (hasExperimental()) { - if (!getExperimental() - .equals(other.getExperimental())) 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 (!internalGetDeviceCount().getMap().isEmpty()) { - hash = (37 * hash) + DEVICE_COUNT_FIELD_NUMBER; - hash = (53 * hash) + internalGetDeviceCount().hashCode(); - } - hash = (37 * hash) + INTRA_OP_PARALLELISM_THREADS_FIELD_NUMBER; - hash = (53 * hash) + getIntraOpParallelismThreads(); - hash = (37 * hash) + INTER_OP_PARALLELISM_THREADS_FIELD_NUMBER; - hash = (53 * hash) + getInterOpParallelismThreads(); - hash = (37 * hash) + USE_PER_SESSION_THREADS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUsePerSessionThreads()); - if (getSessionInterOpThreadPoolCount() > 0) { - hash = (37 * hash) + SESSION_INTER_OP_THREAD_POOL_FIELD_NUMBER; - hash = (53 * hash) + getSessionInterOpThreadPoolList().hashCode(); - } - hash = (37 * hash) + PLACEMENT_PERIOD_FIELD_NUMBER; - hash = (53 * hash) + getPlacementPeriod(); - if (getDeviceFiltersCount() > 0) { - hash = (37 * hash) + DEVICE_FILTERS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceFiltersList().hashCode(); - } - if (hasGpuOptions()) { - hash = (37 * hash) + GPU_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getGpuOptions().hashCode(); - } - hash = (37 * hash) + ALLOW_SOFT_PLACEMENT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAllowSoftPlacement()); - hash = (37 * hash) + LOG_DEVICE_PLACEMENT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getLogDevicePlacement()); - if (hasGraphOptions()) { - hash = (37 * hash) + GRAPH_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getGraphOptions().hashCode(); - } - hash = (37 * hash) + OPERATION_TIMEOUT_IN_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOperationTimeoutInMs()); - if (hasRpcOptions()) { - hash = (37 * hash) + RPC_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getRpcOptions().hashCode(); - } - if (hasClusterDef()) { - hash = (37 * hash) + CLUSTER_DEF_FIELD_NUMBER; - hash = (53 * hash) + getClusterDef().hashCode(); - } - hash = (37 * hash) + ISOLATE_SESSION_STATE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsolateSessionState()); - hash = (37 * hash) + SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getShareClusterDevicesInSession()); - if (hasExperimental()) { - hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; - hash = (53 * hash) + getExperimental().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ConfigProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto 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.ConfigProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto 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.ConfigProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ConfigProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ConfigProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto 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.ConfigProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto 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.ConfigProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ConfigProto 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.ConfigProto 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; - } - /** - *
    -   * Session configuration parameters.
    -   * The system picks appropriate values for fields that are not set.
    -   * 
    - * - * Protobuf type {@code tensorflow.ConfigProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ConfigProto) - org.tensorflow.proto.framework.ConfigProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetDeviceCount(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableDeviceCount(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ConfigProto.class, org.tensorflow.proto.framework.ConfigProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ConfigProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSessionInterOpThreadPoolFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - internalGetMutableDeviceCount().clear(); - intraOpParallelismThreads_ = 0; - - interOpParallelismThreads_ = 0; - - usePerSessionThreads_ = false; - - if (sessionInterOpThreadPoolBuilder_ == null) { - sessionInterOpThreadPool_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - sessionInterOpThreadPoolBuilder_.clear(); - } - placementPeriod_ = 0; - - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - if (gpuOptionsBuilder_ == null) { - gpuOptions_ = null; - } else { - gpuOptions_ = null; - gpuOptionsBuilder_ = null; - } - allowSoftPlacement_ = false; - - logDevicePlacement_ = false; - - if (graphOptionsBuilder_ == null) { - graphOptions_ = null; - } else { - graphOptions_ = null; - graphOptionsBuilder_ = null; - } - operationTimeoutInMs_ = 0L; - - if (rpcOptionsBuilder_ == null) { - rpcOptions_ = null; - } else { - rpcOptions_ = null; - rpcOptionsBuilder_ = null; - } - if (clusterDefBuilder_ == null) { - clusterDef_ = null; - } else { - clusterDef_ = null; - clusterDefBuilder_ = null; - } - isolateSessionState_ = false; - - shareClusterDevicesInSession_ = false; - - if (experimentalBuilder_ == null) { - experimental_ = null; - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ConfigProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto build() { - org.tensorflow.proto.framework.ConfigProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ConfigProto buildPartial() { - org.tensorflow.proto.framework.ConfigProto result = new org.tensorflow.proto.framework.ConfigProto(this); - int from_bitField0_ = bitField0_; - result.deviceCount_ = internalGetDeviceCount(); - result.deviceCount_.makeImmutable(); - result.intraOpParallelismThreads_ = intraOpParallelismThreads_; - result.interOpParallelismThreads_ = interOpParallelismThreads_; - result.usePerSessionThreads_ = usePerSessionThreads_; - if (sessionInterOpThreadPoolBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - sessionInterOpThreadPool_ = java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.sessionInterOpThreadPool_ = sessionInterOpThreadPool_; - } else { - result.sessionInterOpThreadPool_ = sessionInterOpThreadPoolBuilder_.build(); - } - result.placementPeriod_ = placementPeriod_; - if (((bitField0_ & 0x00000004) != 0)) { - deviceFilters_ = deviceFilters_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.deviceFilters_ = deviceFilters_; - if (gpuOptionsBuilder_ == null) { - result.gpuOptions_ = gpuOptions_; - } else { - result.gpuOptions_ = gpuOptionsBuilder_.build(); - } - result.allowSoftPlacement_ = allowSoftPlacement_; - result.logDevicePlacement_ = logDevicePlacement_; - if (graphOptionsBuilder_ == null) { - result.graphOptions_ = graphOptions_; - } else { - result.graphOptions_ = graphOptionsBuilder_.build(); - } - result.operationTimeoutInMs_ = operationTimeoutInMs_; - if (rpcOptionsBuilder_ == null) { - result.rpcOptions_ = rpcOptions_; - } else { - result.rpcOptions_ = rpcOptionsBuilder_.build(); - } - if (clusterDefBuilder_ == null) { - result.clusterDef_ = clusterDef_; - } else { - result.clusterDef_ = clusterDefBuilder_.build(); - } - result.isolateSessionState_ = isolateSessionState_; - result.shareClusterDevicesInSession_ = shareClusterDevicesInSession_; - if (experimentalBuilder_ == null) { - result.experimental_ = experimental_; - } else { - result.experimental_ = experimentalBuilder_.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.ConfigProto) { - return mergeFrom((org.tensorflow.proto.framework.ConfigProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ConfigProto other) { - if (other == org.tensorflow.proto.framework.ConfigProto.getDefaultInstance()) return this; - internalGetMutableDeviceCount().mergeFrom( - other.internalGetDeviceCount()); - if (other.getIntraOpParallelismThreads() != 0) { - setIntraOpParallelismThreads(other.getIntraOpParallelismThreads()); - } - if (other.getInterOpParallelismThreads() != 0) { - setInterOpParallelismThreads(other.getInterOpParallelismThreads()); - } - if (other.getUsePerSessionThreads() != false) { - setUsePerSessionThreads(other.getUsePerSessionThreads()); - } - if (sessionInterOpThreadPoolBuilder_ == null) { - if (!other.sessionInterOpThreadPool_.isEmpty()) { - if (sessionInterOpThreadPool_.isEmpty()) { - sessionInterOpThreadPool_ = other.sessionInterOpThreadPool_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.addAll(other.sessionInterOpThreadPool_); - } - onChanged(); - } - } else { - if (!other.sessionInterOpThreadPool_.isEmpty()) { - if (sessionInterOpThreadPoolBuilder_.isEmpty()) { - sessionInterOpThreadPoolBuilder_.dispose(); - sessionInterOpThreadPoolBuilder_ = null; - sessionInterOpThreadPool_ = other.sessionInterOpThreadPool_; - bitField0_ = (bitField0_ & ~0x00000002); - sessionInterOpThreadPoolBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSessionInterOpThreadPoolFieldBuilder() : null; - } else { - sessionInterOpThreadPoolBuilder_.addAllMessages(other.sessionInterOpThreadPool_); - } - } - } - if (other.getPlacementPeriod() != 0) { - setPlacementPeriod(other.getPlacementPeriod()); - } - if (!other.deviceFilters_.isEmpty()) { - if (deviceFilters_.isEmpty()) { - deviceFilters_ = other.deviceFilters_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureDeviceFiltersIsMutable(); - deviceFilters_.addAll(other.deviceFilters_); - } - onChanged(); - } - if (other.hasGpuOptions()) { - mergeGpuOptions(other.getGpuOptions()); - } - if (other.getAllowSoftPlacement() != false) { - setAllowSoftPlacement(other.getAllowSoftPlacement()); - } - if (other.getLogDevicePlacement() != false) { - setLogDevicePlacement(other.getLogDevicePlacement()); - } - if (other.hasGraphOptions()) { - mergeGraphOptions(other.getGraphOptions()); - } - if (other.getOperationTimeoutInMs() != 0L) { - setOperationTimeoutInMs(other.getOperationTimeoutInMs()); - } - if (other.hasRpcOptions()) { - mergeRpcOptions(other.getRpcOptions()); - } - if (other.hasClusterDef()) { - mergeClusterDef(other.getClusterDef()); - } - if (other.getIsolateSessionState() != false) { - setIsolateSessionState(other.getIsolateSessionState()); - } - if (other.getShareClusterDevicesInSession() != false) { - setShareClusterDevicesInSession(other.getShareClusterDevicesInSession()); - } - if (other.hasExperimental()) { - mergeExperimental(other.getExperimental()); - } - 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.ConfigProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ConfigProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, java.lang.Integer> deviceCount_; - private com.google.protobuf.MapField - internalGetDeviceCount() { - if (deviceCount_ == null) { - return com.google.protobuf.MapField.emptyMapField( - DeviceCountDefaultEntryHolder.defaultEntry); - } - return deviceCount_; - } - private com.google.protobuf.MapField - internalGetMutableDeviceCount() { - onChanged();; - if (deviceCount_ == null) { - deviceCount_ = com.google.protobuf.MapField.newMapField( - DeviceCountDefaultEntryHolder.defaultEntry); - } - if (!deviceCount_.isMutable()) { - deviceCount_ = deviceCount_.copy(); - } - return deviceCount_; - } - - public int getDeviceCountCount() { - return internalGetDeviceCount().getMap().size(); - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public boolean containsDeviceCount( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetDeviceCount().getMap().containsKey(key); - } - /** - * Use {@link #getDeviceCountMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getDeviceCount() { - return getDeviceCountMap(); - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public java.util.Map getDeviceCountMap() { - return internalGetDeviceCount().getMap(); - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public int getDeviceCountOrDefault( - java.lang.String key, - int defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetDeviceCount().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public int getDeviceCountOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetDeviceCount().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearDeviceCount() { - internalGetMutableDeviceCount().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public Builder removeDeviceCount( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableDeviceCount().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableDeviceCount() { - return internalGetMutableDeviceCount().getMutableMap(); - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - public Builder putDeviceCount( - java.lang.String key, - int value) { - if (key == null) { throw new java.lang.NullPointerException(); } - - internalGetMutableDeviceCount().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    -     * number of devices of that type to use.  If a particular device
    -     * type is not found in the map, the system picks an appropriate
    -     * number.
    -     * 
    - * - * map<string, int32> device_count = 1; - */ - - public Builder putAllDeviceCount( - java.util.Map values) { - internalGetMutableDeviceCount().getMutableMap() - .putAll(values); - return this; - } - - private int intraOpParallelismThreads_ ; - /** - *
    -     * The execution of an individual op (for some op types) can be
    -     * parallelized on a pool of intra_op_parallelism_threads.
    -     * 0 means the system picks an appropriate number.
    -     * If you create an ordinary session, e.g., from Python or C++,
    -     * then there is exactly one intra op thread pool per process.
    -     * The first session created determines the number of threads in this pool.
    -     * All subsequent sessions reuse/share this one global pool.
    -     * There are notable exceptions to the default behavior described above:
    -     * 1. There is an environment variable  for overriding this thread pool,
    -     *    named TF_OVERRIDE_GLOBAL_THREADPOOL.
    -     * 2. When connecting to a server, such as a remote `tf.train.Server`
    -     *    instance, then this option will be ignored altogether.
    -     * 
    - * - * int32 intra_op_parallelism_threads = 2; - */ - public int getIntraOpParallelismThreads() { - return intraOpParallelismThreads_; - } - /** - *
    -     * The execution of an individual op (for some op types) can be
    -     * parallelized on a pool of intra_op_parallelism_threads.
    -     * 0 means the system picks an appropriate number.
    -     * If you create an ordinary session, e.g., from Python or C++,
    -     * then there is exactly one intra op thread pool per process.
    -     * The first session created determines the number of threads in this pool.
    -     * All subsequent sessions reuse/share this one global pool.
    -     * There are notable exceptions to the default behavior described above:
    -     * 1. There is an environment variable  for overriding this thread pool,
    -     *    named TF_OVERRIDE_GLOBAL_THREADPOOL.
    -     * 2. When connecting to a server, such as a remote `tf.train.Server`
    -     *    instance, then this option will be ignored altogether.
    -     * 
    - * - * int32 intra_op_parallelism_threads = 2; - */ - public Builder setIntraOpParallelismThreads(int value) { - - intraOpParallelismThreads_ = value; - onChanged(); - return this; - } - /** - *
    -     * The execution of an individual op (for some op types) can be
    -     * parallelized on a pool of intra_op_parallelism_threads.
    -     * 0 means the system picks an appropriate number.
    -     * If you create an ordinary session, e.g., from Python or C++,
    -     * then there is exactly one intra op thread pool per process.
    -     * The first session created determines the number of threads in this pool.
    -     * All subsequent sessions reuse/share this one global pool.
    -     * There are notable exceptions to the default behavior described above:
    -     * 1. There is an environment variable  for overriding this thread pool,
    -     *    named TF_OVERRIDE_GLOBAL_THREADPOOL.
    -     * 2. When connecting to a server, such as a remote `tf.train.Server`
    -     *    instance, then this option will be ignored altogether.
    -     * 
    - * - * int32 intra_op_parallelism_threads = 2; - */ - public Builder clearIntraOpParallelismThreads() { - - intraOpParallelismThreads_ = 0; - onChanged(); - return this; - } - - private int interOpParallelismThreads_ ; - /** - *
    -     * Nodes that perform blocking operations are enqueued on a pool of
    -     * inter_op_parallelism_threads available in each process.
    -     * 0 means the system picks an appropriate number.
    -     * Negative means all operations are performed in caller's thread.
    -     * Note that the first Session created in the process sets the
    -     * number of threads for all future sessions unless use_per_session_threads is
    -     * true or session_inter_op_thread_pool is configured.
    -     * 
    - * - * int32 inter_op_parallelism_threads = 5; - */ - public int getInterOpParallelismThreads() { - return interOpParallelismThreads_; - } - /** - *
    -     * Nodes that perform blocking operations are enqueued on a pool of
    -     * inter_op_parallelism_threads available in each process.
    -     * 0 means the system picks an appropriate number.
    -     * Negative means all operations are performed in caller's thread.
    -     * Note that the first Session created in the process sets the
    -     * number of threads for all future sessions unless use_per_session_threads is
    -     * true or session_inter_op_thread_pool is configured.
    -     * 
    - * - * int32 inter_op_parallelism_threads = 5; - */ - public Builder setInterOpParallelismThreads(int value) { - - interOpParallelismThreads_ = value; - onChanged(); - return this; - } - /** - *
    -     * Nodes that perform blocking operations are enqueued on a pool of
    -     * inter_op_parallelism_threads available in each process.
    -     * 0 means the system picks an appropriate number.
    -     * Negative means all operations are performed in caller's thread.
    -     * Note that the first Session created in the process sets the
    -     * number of threads for all future sessions unless use_per_session_threads is
    -     * true or session_inter_op_thread_pool is configured.
    -     * 
    - * - * int32 inter_op_parallelism_threads = 5; - */ - public Builder clearInterOpParallelismThreads() { - - interOpParallelismThreads_ = 0; - onChanged(); - return this; - } - - private boolean usePerSessionThreads_ ; - /** - *
    -     * If true, use a new set of threads for this session rather than the global
    -     * pool of threads. Only supported by direct sessions.
    -     * If false, use the global threads created by the first session, or the
    -     * per-session thread pools configured by session_inter_op_thread_pool.
    -     * This option is deprecated. The same effect can be achieved by setting
    -     * session_inter_op_thread_pool to have one element, whose num_threads equals
    -     * inter_op_parallelism_threads.
    -     * 
    - * - * bool use_per_session_threads = 9; - */ - public boolean getUsePerSessionThreads() { - return usePerSessionThreads_; - } - /** - *
    -     * If true, use a new set of threads for this session rather than the global
    -     * pool of threads. Only supported by direct sessions.
    -     * If false, use the global threads created by the first session, or the
    -     * per-session thread pools configured by session_inter_op_thread_pool.
    -     * This option is deprecated. The same effect can be achieved by setting
    -     * session_inter_op_thread_pool to have one element, whose num_threads equals
    -     * inter_op_parallelism_threads.
    -     * 
    - * - * bool use_per_session_threads = 9; - */ - public Builder setUsePerSessionThreads(boolean value) { - - usePerSessionThreads_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, use a new set of threads for this session rather than the global
    -     * pool of threads. Only supported by direct sessions.
    -     * If false, use the global threads created by the first session, or the
    -     * per-session thread pools configured by session_inter_op_thread_pool.
    -     * This option is deprecated. The same effect can be achieved by setting
    -     * session_inter_op_thread_pool to have one element, whose num_threads equals
    -     * inter_op_parallelism_threads.
    -     * 
    - * - * bool use_per_session_threads = 9; - */ - public Builder clearUsePerSessionThreads() { - - usePerSessionThreads_ = false; - onChanged(); - return this; - } - - private java.util.List sessionInterOpThreadPool_ = - java.util.Collections.emptyList(); - private void ensureSessionInterOpThreadPoolIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - sessionInterOpThreadPool_ = new java.util.ArrayList(sessionInterOpThreadPool_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ThreadPoolOptionProto, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder, org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder> sessionInterOpThreadPoolBuilder_; - - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public java.util.List getSessionInterOpThreadPoolList() { - if (sessionInterOpThreadPoolBuilder_ == null) { - return java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); - } else { - return sessionInterOpThreadPoolBuilder_.getMessageList(); - } - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public int getSessionInterOpThreadPoolCount() { - if (sessionInterOpThreadPoolBuilder_ == null) { - return sessionInterOpThreadPool_.size(); - } else { - return sessionInterOpThreadPoolBuilder_.getCount(); - } - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProto getSessionInterOpThreadPool(int index) { - if (sessionInterOpThreadPoolBuilder_ == null) { - return sessionInterOpThreadPool_.get(index); - } else { - return sessionInterOpThreadPoolBuilder_.getMessage(index); - } - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder setSessionInterOpThreadPool( - int index, org.tensorflow.proto.framework.ThreadPoolOptionProto value) { - if (sessionInterOpThreadPoolBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.set(index, value); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder setSessionInterOpThreadPool( - int index, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder builderForValue) { - if (sessionInterOpThreadPoolBuilder_ == null) { - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.set(index, builderForValue.build()); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder addSessionInterOpThreadPool(org.tensorflow.proto.framework.ThreadPoolOptionProto value) { - if (sessionInterOpThreadPoolBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.add(value); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder addSessionInterOpThreadPool( - int index, org.tensorflow.proto.framework.ThreadPoolOptionProto value) { - if (sessionInterOpThreadPoolBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.add(index, value); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder addSessionInterOpThreadPool( - org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder builderForValue) { - if (sessionInterOpThreadPoolBuilder_ == null) { - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.add(builderForValue.build()); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder addSessionInterOpThreadPool( - int index, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder builderForValue) { - if (sessionInterOpThreadPoolBuilder_ == null) { - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.add(index, builderForValue.build()); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder addAllSessionInterOpThreadPool( - java.lang.Iterable values) { - if (sessionInterOpThreadPoolBuilder_ == null) { - ensureSessionInterOpThreadPoolIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, sessionInterOpThreadPool_); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder clearSessionInterOpThreadPool() { - if (sessionInterOpThreadPoolBuilder_ == null) { - sessionInterOpThreadPool_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.clear(); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public Builder removeSessionInterOpThreadPool(int index) { - if (sessionInterOpThreadPoolBuilder_ == null) { - ensureSessionInterOpThreadPoolIsMutable(); - sessionInterOpThreadPool_.remove(index); - onChanged(); - } else { - sessionInterOpThreadPoolBuilder_.remove(index); - } - return this; - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder getSessionInterOpThreadPoolBuilder( - int index) { - return getSessionInterOpThreadPoolFieldBuilder().getBuilder(index); - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder( - int index) { - if (sessionInterOpThreadPoolBuilder_ == null) { - return sessionInterOpThreadPool_.get(index); } else { - return sessionInterOpThreadPoolBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public java.util.List - getSessionInterOpThreadPoolOrBuilderList() { - if (sessionInterOpThreadPoolBuilder_ != null) { - return sessionInterOpThreadPoolBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); - } - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder addSessionInterOpThreadPoolBuilder() { - return getSessionInterOpThreadPoolFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ThreadPoolOptionProto.getDefaultInstance()); - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder addSessionInterOpThreadPoolBuilder( - int index) { - return getSessionInterOpThreadPoolFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ThreadPoolOptionProto.getDefaultInstance()); - } - /** - *
    -     * This option is experimental - it may be replaced with a different mechanism
    -     * in the future.
    -     * Configures session thread pools. If this is configured, then RunOptions for
    -     * a Run call can select the thread pool to use.
    -     * The intended use is for when some session invocations need to run in a
    -     * background pool limited to a small number of threads:
    -     * - For example, a session may be configured to have one large pool (for
    -     * regular compute) and one small pool (for periodic, low priority work);
    -     * using the small pool is currently the mechanism for limiting the inter-op
    -     * parallelism of the low priority work.  Note that it does not limit the
    -     * parallelism of work spawned by a single op kernel implementation.
    -     * - Using this setting is normally not needed in training, but may help some
    -     * serving use cases.
    -     * - It is also generally recommended to set the global_name field of this
    -     * proto, to avoid creating multiple large pools. It is typically better to
    -     * run the non-low-priority work, even across sessions, in a single large
    -     * pool.
    -     * 
    - * - * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; - */ - public java.util.List - getSessionInterOpThreadPoolBuilderList() { - return getSessionInterOpThreadPoolFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ThreadPoolOptionProto, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder, org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder> - getSessionInterOpThreadPoolFieldBuilder() { - if (sessionInterOpThreadPoolBuilder_ == null) { - sessionInterOpThreadPoolBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ThreadPoolOptionProto, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder, org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder>( - sessionInterOpThreadPool_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - sessionInterOpThreadPool_ = null; - } - return sessionInterOpThreadPoolBuilder_; - } - - private int placementPeriod_ ; - /** - *
    -     * Assignment of Nodes to Devices is recomputed every placement_period
    -     * steps until the system warms up (at which point the recomputation
    -     * typically slows down automatically).
    -     * 
    - * - * int32 placement_period = 3; - */ - public int getPlacementPeriod() { - return placementPeriod_; - } - /** - *
    -     * Assignment of Nodes to Devices is recomputed every placement_period
    -     * steps until the system warms up (at which point the recomputation
    -     * typically slows down automatically).
    -     * 
    - * - * int32 placement_period = 3; - */ - public Builder setPlacementPeriod(int value) { - - placementPeriod_ = value; - onChanged(); - return this; - } - /** - *
    -     * Assignment of Nodes to Devices is recomputed every placement_period
    -     * steps until the system warms up (at which point the recomputation
    -     * typically slows down automatically).
    -     * 
    - * - * int32 placement_period = 3; - */ - public Builder clearPlacementPeriod() { - - placementPeriod_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureDeviceFiltersIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - deviceFilters_ = new com.google.protobuf.LazyStringArrayList(deviceFilters_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public com.google.protobuf.ProtocolStringList - getDeviceFiltersList() { - return deviceFilters_.getUnmodifiableView(); - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public int getDeviceFiltersCount() { - return deviceFilters_.size(); - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public java.lang.String getDeviceFilters(int index) { - return deviceFilters_.get(index); - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public com.google.protobuf.ByteString - getDeviceFiltersBytes(int index) { - return deviceFilters_.getByteString(index); - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public Builder setDeviceFilters( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceFiltersIsMutable(); - deviceFilters_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public Builder addDeviceFilters( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceFiltersIsMutable(); - deviceFilters_.add(value); - onChanged(); - return this; - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public Builder addAllDeviceFilters( - java.lang.Iterable values) { - ensureDeviceFiltersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceFilters_); - onChanged(); - return this; - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public Builder clearDeviceFilters() { - deviceFilters_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - *
    -     * When any filters are present sessions will ignore all devices which do not
    -     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    -     * "/job:worker/replica:3", etc.
    -     * 
    - * - * repeated string device_filters = 4; - */ - public Builder addDeviceFiltersBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureDeviceFiltersIsMutable(); - deviceFilters_.add(value); - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.GPUOptions gpuOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions, org.tensorflow.proto.framework.GPUOptions.Builder, org.tensorflow.proto.framework.GPUOptionsOrBuilder> gpuOptionsBuilder_; - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public boolean hasGpuOptions() { - return gpuOptionsBuilder_ != null || gpuOptions_ != null; - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public org.tensorflow.proto.framework.GPUOptions getGpuOptions() { - if (gpuOptionsBuilder_ == null) { - return gpuOptions_ == null ? org.tensorflow.proto.framework.GPUOptions.getDefaultInstance() : gpuOptions_; - } else { - return gpuOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public Builder setGpuOptions(org.tensorflow.proto.framework.GPUOptions value) { - if (gpuOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - gpuOptions_ = value; - onChanged(); - } else { - gpuOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public Builder setGpuOptions( - org.tensorflow.proto.framework.GPUOptions.Builder builderForValue) { - if (gpuOptionsBuilder_ == null) { - gpuOptions_ = builderForValue.build(); - onChanged(); - } else { - gpuOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public Builder mergeGpuOptions(org.tensorflow.proto.framework.GPUOptions value) { - if (gpuOptionsBuilder_ == null) { - if (gpuOptions_ != null) { - gpuOptions_ = - org.tensorflow.proto.framework.GPUOptions.newBuilder(gpuOptions_).mergeFrom(value).buildPartial(); - } else { - gpuOptions_ = value; - } - onChanged(); - } else { - gpuOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public Builder clearGpuOptions() { - if (gpuOptionsBuilder_ == null) { - gpuOptions_ = null; - onChanged(); - } else { - gpuOptions_ = null; - gpuOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public org.tensorflow.proto.framework.GPUOptions.Builder getGpuOptionsBuilder() { - - onChanged(); - return getGpuOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - public org.tensorflow.proto.framework.GPUOptionsOrBuilder getGpuOptionsOrBuilder() { - if (gpuOptionsBuilder_ != null) { - return gpuOptionsBuilder_.getMessageOrBuilder(); - } else { - return gpuOptions_ == null ? - org.tensorflow.proto.framework.GPUOptions.getDefaultInstance() : gpuOptions_; - } - } - /** - *
    -     * Options that apply to all GPUs.
    -     * 
    - * - * .tensorflow.GPUOptions gpu_options = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions, org.tensorflow.proto.framework.GPUOptions.Builder, org.tensorflow.proto.framework.GPUOptionsOrBuilder> - getGpuOptionsFieldBuilder() { - if (gpuOptionsBuilder_ == null) { - gpuOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions, org.tensorflow.proto.framework.GPUOptions.Builder, org.tensorflow.proto.framework.GPUOptionsOrBuilder>( - getGpuOptions(), - getParentForChildren(), - isClean()); - gpuOptions_ = null; - } - return gpuOptionsBuilder_; - } - - private boolean allowSoftPlacement_ ; - /** - *
    -     * Whether soft placement is allowed. If allow_soft_placement is true,
    -     * an op will be placed on CPU if
    -     *   1. there's no GPU implementation for the OP
    -     * or
    -     *   2. no GPU devices are known or registered
    -     * or
    -     *   3. need to co-locate with reftype input(s) which are from CPU.
    -     * 
    - * - * bool allow_soft_placement = 7; - */ - public boolean getAllowSoftPlacement() { - return allowSoftPlacement_; - } - /** - *
    -     * Whether soft placement is allowed. If allow_soft_placement is true,
    -     * an op will be placed on CPU if
    -     *   1. there's no GPU implementation for the OP
    -     * or
    -     *   2. no GPU devices are known or registered
    -     * or
    -     *   3. need to co-locate with reftype input(s) which are from CPU.
    -     * 
    - * - * bool allow_soft_placement = 7; - */ - public Builder setAllowSoftPlacement(boolean value) { - - allowSoftPlacement_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether soft placement is allowed. If allow_soft_placement is true,
    -     * an op will be placed on CPU if
    -     *   1. there's no GPU implementation for the OP
    -     * or
    -     *   2. no GPU devices are known or registered
    -     * or
    -     *   3. need to co-locate with reftype input(s) which are from CPU.
    -     * 
    - * - * bool allow_soft_placement = 7; - */ - public Builder clearAllowSoftPlacement() { - - allowSoftPlacement_ = false; - onChanged(); - return this; - } - - private boolean logDevicePlacement_ ; - /** - *
    -     * Whether device placements should be logged.
    -     * 
    - * - * bool log_device_placement = 8; - */ - public boolean getLogDevicePlacement() { - return logDevicePlacement_; - } - /** - *
    -     * Whether device placements should be logged.
    -     * 
    - * - * bool log_device_placement = 8; - */ - public Builder setLogDevicePlacement(boolean value) { - - logDevicePlacement_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether device placements should be logged.
    -     * 
    - * - * bool log_device_placement = 8; - */ - public Builder clearLogDevicePlacement() { - - logDevicePlacement_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.GraphOptions graphOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphOptions, org.tensorflow.proto.framework.GraphOptions.Builder, org.tensorflow.proto.framework.GraphOptionsOrBuilder> graphOptionsBuilder_; - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public boolean hasGraphOptions() { - return graphOptionsBuilder_ != null || graphOptions_ != null; - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public org.tensorflow.proto.framework.GraphOptions getGraphOptions() { - if (graphOptionsBuilder_ == null) { - return graphOptions_ == null ? org.tensorflow.proto.framework.GraphOptions.getDefaultInstance() : graphOptions_; - } else { - return graphOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public Builder setGraphOptions(org.tensorflow.proto.framework.GraphOptions value) { - if (graphOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - graphOptions_ = value; - onChanged(); - } else { - graphOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public Builder setGraphOptions( - org.tensorflow.proto.framework.GraphOptions.Builder builderForValue) { - if (graphOptionsBuilder_ == null) { - graphOptions_ = builderForValue.build(); - onChanged(); - } else { - graphOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public Builder mergeGraphOptions(org.tensorflow.proto.framework.GraphOptions value) { - if (graphOptionsBuilder_ == null) { - if (graphOptions_ != null) { - graphOptions_ = - org.tensorflow.proto.framework.GraphOptions.newBuilder(graphOptions_).mergeFrom(value).buildPartial(); - } else { - graphOptions_ = value; - } - onChanged(); - } else { - graphOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public Builder clearGraphOptions() { - if (graphOptionsBuilder_ == null) { - graphOptions_ = null; - onChanged(); - } else { - graphOptions_ = null; - graphOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public org.tensorflow.proto.framework.GraphOptions.Builder getGraphOptionsBuilder() { - - onChanged(); - return getGraphOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - public org.tensorflow.proto.framework.GraphOptionsOrBuilder getGraphOptionsOrBuilder() { - if (graphOptionsBuilder_ != null) { - return graphOptionsBuilder_.getMessageOrBuilder(); - } else { - return graphOptions_ == null ? - org.tensorflow.proto.framework.GraphOptions.getDefaultInstance() : graphOptions_; - } - } - /** - *
    -     * Options that apply to all graphs.
    -     * 
    - * - * .tensorflow.GraphOptions graph_options = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphOptions, org.tensorflow.proto.framework.GraphOptions.Builder, org.tensorflow.proto.framework.GraphOptionsOrBuilder> - getGraphOptionsFieldBuilder() { - if (graphOptionsBuilder_ == null) { - graphOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphOptions, org.tensorflow.proto.framework.GraphOptions.Builder, org.tensorflow.proto.framework.GraphOptionsOrBuilder>( - getGraphOptions(), - getParentForChildren(), - isClean()); - graphOptions_ = null; - } - return graphOptionsBuilder_; - } - - private long operationTimeoutInMs_ ; - /** - *
    -     * Global timeout for all blocking operations in this session.  If non-zero,
    -     * and not overridden on a per-operation basis, this value will be used as the
    -     * deadline for all blocking operations.
    -     * 
    - * - * int64 operation_timeout_in_ms = 11; - */ - public long getOperationTimeoutInMs() { - return operationTimeoutInMs_; - } - /** - *
    -     * Global timeout for all blocking operations in this session.  If non-zero,
    -     * and not overridden on a per-operation basis, this value will be used as the
    -     * deadline for all blocking operations.
    -     * 
    - * - * int64 operation_timeout_in_ms = 11; - */ - public Builder setOperationTimeoutInMs(long value) { - - operationTimeoutInMs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Global timeout for all blocking operations in this session.  If non-zero,
    -     * and not overridden on a per-operation basis, this value will be used as the
    -     * deadline for all blocking operations.
    -     * 
    - * - * int64 operation_timeout_in_ms = 11; - */ - public Builder clearOperationTimeoutInMs() { - - operationTimeoutInMs_ = 0L; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.RPCOptions rpcOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RPCOptions, org.tensorflow.proto.framework.RPCOptions.Builder, org.tensorflow.proto.framework.RPCOptionsOrBuilder> rpcOptionsBuilder_; - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public boolean hasRpcOptions() { - return rpcOptionsBuilder_ != null || rpcOptions_ != null; - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public org.tensorflow.proto.framework.RPCOptions getRpcOptions() { - if (rpcOptionsBuilder_ == null) { - return rpcOptions_ == null ? org.tensorflow.proto.framework.RPCOptions.getDefaultInstance() : rpcOptions_; - } else { - return rpcOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public Builder setRpcOptions(org.tensorflow.proto.framework.RPCOptions value) { - if (rpcOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - rpcOptions_ = value; - onChanged(); - } else { - rpcOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public Builder setRpcOptions( - org.tensorflow.proto.framework.RPCOptions.Builder builderForValue) { - if (rpcOptionsBuilder_ == null) { - rpcOptions_ = builderForValue.build(); - onChanged(); - } else { - rpcOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public Builder mergeRpcOptions(org.tensorflow.proto.framework.RPCOptions value) { - if (rpcOptionsBuilder_ == null) { - if (rpcOptions_ != null) { - rpcOptions_ = - org.tensorflow.proto.framework.RPCOptions.newBuilder(rpcOptions_).mergeFrom(value).buildPartial(); - } else { - rpcOptions_ = value; - } - onChanged(); - } else { - rpcOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public Builder clearRpcOptions() { - if (rpcOptionsBuilder_ == null) { - rpcOptions_ = null; - onChanged(); - } else { - rpcOptions_ = null; - rpcOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public org.tensorflow.proto.framework.RPCOptions.Builder getRpcOptionsBuilder() { - - onChanged(); - return getRpcOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - public org.tensorflow.proto.framework.RPCOptionsOrBuilder getRpcOptionsOrBuilder() { - if (rpcOptionsBuilder_ != null) { - return rpcOptionsBuilder_.getMessageOrBuilder(); - } else { - return rpcOptions_ == null ? - org.tensorflow.proto.framework.RPCOptions.getDefaultInstance() : rpcOptions_; - } - } - /** - *
    -     * Options that apply when this session uses the distributed runtime.
    -     * 
    - * - * .tensorflow.RPCOptions rpc_options = 13; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RPCOptions, org.tensorflow.proto.framework.RPCOptions.Builder, org.tensorflow.proto.framework.RPCOptionsOrBuilder> - getRpcOptionsFieldBuilder() { - if (rpcOptionsBuilder_ == null) { - rpcOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RPCOptions, org.tensorflow.proto.framework.RPCOptions.Builder, org.tensorflow.proto.framework.RPCOptionsOrBuilder>( - getRpcOptions(), - getParentForChildren(), - isClean()); - rpcOptions_ = null; - } - return rpcOptionsBuilder_; - } - - private org.tensorflow.proto.distruntime.ClusterDef clusterDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder> clusterDefBuilder_; - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public boolean hasClusterDef() { - return clusterDefBuilder_ != null || clusterDef_ != null; - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public org.tensorflow.proto.distruntime.ClusterDef getClusterDef() { - if (clusterDefBuilder_ == null) { - return clusterDef_ == null ? org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : clusterDef_; - } else { - return clusterDefBuilder_.getMessage(); - } - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public Builder setClusterDef(org.tensorflow.proto.distruntime.ClusterDef value) { - if (clusterDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - clusterDef_ = value; - onChanged(); - } else { - clusterDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public Builder setClusterDef( - org.tensorflow.proto.distruntime.ClusterDef.Builder builderForValue) { - if (clusterDefBuilder_ == null) { - clusterDef_ = builderForValue.build(); - onChanged(); - } else { - clusterDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public Builder mergeClusterDef(org.tensorflow.proto.distruntime.ClusterDef value) { - if (clusterDefBuilder_ == null) { - if (clusterDef_ != null) { - clusterDef_ = - org.tensorflow.proto.distruntime.ClusterDef.newBuilder(clusterDef_).mergeFrom(value).buildPartial(); - } else { - clusterDef_ = value; - } - onChanged(); - } else { - clusterDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public Builder clearClusterDef() { - if (clusterDefBuilder_ == null) { - clusterDef_ = null; - onChanged(); - } else { - clusterDef_ = null; - clusterDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public org.tensorflow.proto.distruntime.ClusterDef.Builder getClusterDefBuilder() { - - onChanged(); - return getClusterDefFieldBuilder().getBuilder(); - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - public org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterDefOrBuilder() { - if (clusterDefBuilder_ != null) { - return clusterDefBuilder_.getMessageOrBuilder(); - } else { - return clusterDef_ == null ? - org.tensorflow.proto.distruntime.ClusterDef.getDefaultInstance() : clusterDef_; - } - } - /** - *
    -     * Optional list of all workers to use in this session.
    -     * 
    - * - * .tensorflow.ClusterDef cluster_def = 14; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder> - getClusterDefFieldBuilder() { - if (clusterDefBuilder_ == null) { - clusterDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.distruntime.ClusterDef, org.tensorflow.proto.distruntime.ClusterDef.Builder, org.tensorflow.proto.distruntime.ClusterDefOrBuilder>( - getClusterDef(), - getParentForChildren(), - isClean()); - clusterDef_ = null; - } - return clusterDefBuilder_; - } - - private boolean isolateSessionState_ ; - /** - *
    -     * If true, any resources such as Variables used in the session will not be
    -     * shared with other sessions. However, when clusterspec propagation is
    -     * enabled, this field is ignored and sessions are always isolated.
    -     * 
    - * - * bool isolate_session_state = 15; - */ - public boolean getIsolateSessionState() { - return isolateSessionState_; - } - /** - *
    -     * If true, any resources such as Variables used in the session will not be
    -     * shared with other sessions. However, when clusterspec propagation is
    -     * enabled, this field is ignored and sessions are always isolated.
    -     * 
    - * - * bool isolate_session_state = 15; - */ - public Builder setIsolateSessionState(boolean value) { - - isolateSessionState_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, any resources such as Variables used in the session will not be
    -     * shared with other sessions. However, when clusterspec propagation is
    -     * enabled, this field is ignored and sessions are always isolated.
    -     * 
    - * - * bool isolate_session_state = 15; - */ - public Builder clearIsolateSessionState() { - - isolateSessionState_ = false; - onChanged(); - return this; - } - - private boolean shareClusterDevicesInSession_ ; - /** - *
    -     * When true, WorkerSessions are created with device attributes from the
    -     * full cluster.
    -     * This is helpful when a worker wants to partition a graph
    -     * (for example during a PartitionedCallOp).
    -     * 
    - * - * bool share_cluster_devices_in_session = 17; - */ - public boolean getShareClusterDevicesInSession() { - return shareClusterDevicesInSession_; - } - /** - *
    -     * When true, WorkerSessions are created with device attributes from the
    -     * full cluster.
    -     * This is helpful when a worker wants to partition a graph
    -     * (for example during a PartitionedCallOp).
    -     * 
    - * - * bool share_cluster_devices_in_session = 17; - */ - public Builder setShareClusterDevicesInSession(boolean value) { - - shareClusterDevicesInSession_ = value; - onChanged(); - return this; - } - /** - *
    -     * When true, WorkerSessions are created with device attributes from the
    -     * full cluster.
    -     * This is helpful when a worker wants to partition a graph
    -     * (for example during a PartitionedCallOp).
    -     * 
    - * - * bool share_cluster_devices_in_session = 17; - */ - public Builder clearShareClusterDevicesInSession() { - - shareClusterDevicesInSession_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.ConfigProto.Experimental experimental_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto.Experimental, org.tensorflow.proto.framework.ConfigProto.Experimental.Builder, org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder> experimentalBuilder_; - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public boolean hasExperimental() { - return experimentalBuilder_ != null || experimental_ != null; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public org.tensorflow.proto.framework.ConfigProto.Experimental getExperimental() { - if (experimentalBuilder_ == null) { - return experimental_ == null ? org.tensorflow.proto.framework.ConfigProto.Experimental.getDefaultInstance() : experimental_; - } else { - return experimentalBuilder_.getMessage(); - } - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public Builder setExperimental(org.tensorflow.proto.framework.ConfigProto.Experimental value) { - if (experimentalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - experimental_ = value; - onChanged(); - } else { - experimentalBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public Builder setExperimental( - org.tensorflow.proto.framework.ConfigProto.Experimental.Builder builderForValue) { - if (experimentalBuilder_ == null) { - experimental_ = builderForValue.build(); - onChanged(); - } else { - experimentalBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public Builder mergeExperimental(org.tensorflow.proto.framework.ConfigProto.Experimental value) { - if (experimentalBuilder_ == null) { - if (experimental_ != null) { - experimental_ = - org.tensorflow.proto.framework.ConfigProto.Experimental.newBuilder(experimental_).mergeFrom(value).buildPartial(); - } else { - experimental_ = value; - } - onChanged(); - } else { - experimentalBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public Builder clearExperimental() { - if (experimentalBuilder_ == null) { - experimental_ = null; - onChanged(); - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public org.tensorflow.proto.framework.ConfigProto.Experimental.Builder getExperimentalBuilder() { - - onChanged(); - return getExperimentalFieldBuilder().getBuilder(); - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - public org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder() { - if (experimentalBuilder_ != null) { - return experimentalBuilder_.getMessageOrBuilder(); - } else { - return experimental_ == null ? - org.tensorflow.proto.framework.ConfigProto.Experimental.getDefaultInstance() : experimental_; - } - } - /** - * .tensorflow.ConfigProto.Experimental experimental = 16; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto.Experimental, org.tensorflow.proto.framework.ConfigProto.Experimental.Builder, org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder> - getExperimentalFieldBuilder() { - if (experimentalBuilder_ == null) { - experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ConfigProto.Experimental, org.tensorflow.proto.framework.ConfigProto.Experimental.Builder, org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder>( - getExperimental(), - getParentForChildren(), - isClean()); - experimental_ = null; - } - return experimentalBuilder_; - } - @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.ConfigProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ConfigProto) - private static final org.tensorflow.proto.framework.ConfigProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ConfigProto(); - } - - public static org.tensorflow.proto.framework.ConfigProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConfigProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConfigProto(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.ConfigProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index c0bcb9ba644..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtos.java +++ /dev/null @@ -1,406 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public final class ConfigProtos { - private ConfigProtos() {} - 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_GPUOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GPUOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GPUOptions_Experimental_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OptimizerOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OptimizerOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ThreadPoolOptionProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RPCOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RPCOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SessionMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SessionMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ConfigProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ConfigProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ConfigProto_DeviceCountEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ConfigProto_Experimental_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunOptions_Experimental_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorConnection_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorConnection_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CallableOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CallableOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CallableOptions_FeedDevicesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CallableOptions_FetchDevicesEntry_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/config.proto\022" + - "\ntensorflow\032*tensorflow/core/framework/c" + - "ost_graph.proto\032%tensorflow/core/framewo" + - "rk/graph.proto\032*tensorflow/core/framewor" + - "k/step_stats.proto\032&tensorflow/core/prot" + - "obuf/cluster.proto\032$tensorflow/core/prot" + - "obuf/debug.proto\032.tensorflow/core/protob" + - "uf/rewriter_config.proto\"\221\006\n\nGPUOptions\022" + - "\'\n\037per_process_gpu_memory_fraction\030\001 \001(\001" + - "\022\024\n\014allow_growth\030\004 \001(\010\022\026\n\016allocator_type" + - "\030\002 \001(\t\022\037\n\027deferred_deletion_bytes\030\003 \001(\003\022" + - "\033\n\023visible_device_list\030\005 \001(\t\022\"\n\032polling_" + - "active_delay_usecs\030\006 \001(\005\022$\n\034polling_inac" + - "tive_delay_msecs\030\007 \001(\005\022\034\n\024force_gpu_comp" + - "atible\030\010 \001(\010\0229\n\014experimental\030\t \001(\0132#.ten" + - "sorflow.GPUOptions.Experimental\032\312\003\n\014Expe" + - "rimental\022K\n\017virtual_devices\030\001 \003(\01322.tens" + - "orflow.GPUOptions.Experimental.VirtualDe" + - "vices\022\032\n\022use_unified_memory\030\002 \001(\010\022#\n\033num" + - "_dev_to_dev_copy_streams\030\003 \001(\005\022\035\n\025collec" + - "tive_ring_order\030\004 \001(\t\022\035\n\025timestamped_all" + - "ocator\030\005 \001(\010\022#\n\033kernel_tracker_max_inter" + - "val\030\007 \001(\005\022 \n\030kernel_tracker_max_bytes\030\010 " + - "\001(\005\022\"\n\032kernel_tracker_max_pending\030\t \001(\005\022" + - "\'\n\037internal_fragmentation_fraction\030\n \001(\001" + - "\022\035\n\025use_cuda_malloc_async\030\013 \001(\010\032;\n\016Virtu" + - "alDevices\022\027\n\017memory_limit_mb\030\001 \003(\002\022\020\n\010pr" + - "iority\030\002 \003(\005\"\205\003\n\020OptimizerOptions\022+\n#do_" + - "common_subexpression_elimination\030\001 \001(\010\022\033" + - "\n\023do_constant_folding\030\002 \001(\010\022$\n\034max_folde" + - "d_constant_in_bytes\030\006 \001(\003\022\034\n\024do_function" + - "_inlining\030\004 \001(\010\0225\n\topt_level\030\003 \001(\0162\".ten" + - "sorflow.OptimizerOptions.Level\022E\n\020global" + - "_jit_level\030\005 \001(\0162+.tensorflow.OptimizerO" + - "ptions.GlobalJitLevel\" \n\005Level\022\006\n\002L1\020\000\022\017" + - "\n\002L0\020\377\377\377\377\377\377\377\377\377\001\"C\n\016GlobalJitLevel\022\013\n\007DEF" + - "AULT\020\000\022\020\n\003OFF\020\377\377\377\377\377\377\377\377\377\001\022\010\n\004ON_1\020\001\022\010\n\004ON" + - "_2\020\002\"\356\002\n\014GraphOptions\022\036\n\026enable_recv_sch" + - "eduling\030\002 \001(\010\0227\n\021optimizer_options\030\003 \001(\013" + - "2\034.tensorflow.OptimizerOptions\022\030\n\020build_" + - "cost_model\030\004 \001(\003\022\036\n\026build_cost_model_aft" + - "er\030\t \001(\003\022\024\n\014infer_shapes\030\005 \001(\010\022\032\n\022place_" + - "pruned_graph\030\006 \001(\010\022 \n\030enable_bfloat16_se" + - "ndrecv\030\007 \001(\010\022\025\n\rtimeline_step\030\010 \001(\005\0223\n\017r" + - "ewrite_options\030\n \001(\0132\032.tensorflow.Rewrit" + - "erConfigJ\004\010\001\020\002R%skip_common_subexpressio" + - "n_elimination\"A\n\025ThreadPoolOptionProto\022\023" + - "\n\013num_threads\030\001 \001(\005\022\023\n\013global_name\030\002 \001(\t" + - "\"\325\001\n\nRPCOptions\022$\n\034use_rpc_for_inprocess" + - "_master\030\001 \001(\010\022\035\n\025compression_algorithm\030\002" + - " \001(\t\022\031\n\021compression_level\030\003 \001(\005\022\032\n\022cache" + - "_rpc_response\030\004 \001(\010\022*\n\"disable_session_c" + - "onnection_sharing\030\005 \001(\010\022\037\n\027num_channels_" + - "per_target\030\006 \001(\005\"0\n\017SessionMetadata\022\014\n\004n" + - "ame\030\001 \001(\t\022\017\n\007version\030\002 \001(\003\"\330\r\n\013ConfigPro" + - "to\022>\n\014device_count\030\001 \003(\0132(.tensorflow.Co" + - "nfigProto.DeviceCountEntry\022$\n\034intra_op_p" + - "arallelism_threads\030\002 \001(\005\022$\n\034inter_op_par" + - "allelism_threads\030\005 \001(\005\022\037\n\027use_per_sessio" + - "n_threads\030\t \001(\010\022G\n\034session_inter_op_thre" + - "ad_pool\030\014 \003(\0132!.tensorflow.ThreadPoolOpt" + - "ionProto\022\030\n\020placement_period\030\003 \001(\005\022\026\n\016de" + - "vice_filters\030\004 \003(\t\022+\n\013gpu_options\030\006 \001(\0132" + - "\026.tensorflow.GPUOptions\022\034\n\024allow_soft_pl" + - "acement\030\007 \001(\010\022\034\n\024log_device_placement\030\010 " + - "\001(\010\022/\n\rgraph_options\030\n \001(\0132\030.tensorflow." + - "GraphOptions\022\037\n\027operation_timeout_in_ms\030" + - "\013 \001(\003\022+\n\013rpc_options\030\r \001(\0132\026.tensorflow." + - "RPCOptions\022+\n\013cluster_def\030\016 \001(\0132\026.tensor" + - "flow.ClusterDef\022\035\n\025isolate_session_state" + - "\030\017 \001(\010\022(\n share_cluster_devices_in_sessi" + - "on\030\021 \001(\010\022:\n\014experimental\030\020 \001(\0132$.tensorf" + - "low.ConfigProto.Experimental\0322\n\020DeviceCo" + - "untEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\005:\0028\001" + - "\032\322\007\n\014Experimental\022\037\n\027collective_group_le" + - "ader\030\001 \001(\t\022\025\n\rexecutor_type\030\003 \001(\t\022\032\n\022rec" + - "v_buf_max_chunk\030\004 \001(\005\022\031\n\021use_numa_affini" + - "ty\030\005 \001(\010\0225\n-collective_deterministic_seq" + - "uential_execution\030\006 \001(\010\022\027\n\017collective_nc" + - "cl\030\007 \001(\010\0226\n.share_session_state_in_clust" + - "erspec_propagation\030\010 \001(\010\022\037\n\027disable_thre" + - "ad_spinning\030\t \001(\010\022(\n share_cluster_devic" + - "es_in_session\030\n \001(\010\0225\n\020session_metadata\030" + - "\013 \001(\0132\033.tensorflow.SessionMetadata\022!\n\031op" + - "timize_for_static_graph\030\014 \001(\010\022\032\n\022enable_" + - "mlir_bridge\030\r \001(\010\022S\n\023mlir_bridge_rollout" + - "\030\021 \001(\01626.tensorflow.ConfigProto.Experime" + - "ntal.MlirBridgeRollout\022&\n\036enable_mlir_gr" + - "aph_optimization\030\020 \001(\010\022\'\n\037disable_output" + - "_partition_graphs\030\016 \001(\010\022#\n\033xla_fusion_au" + - "totuner_thresh\030\017 \001(\003\022\020\n\010use_tfrt\030\022 \001(\010\022\034" + - "\n\024coordination_service\030\023 \001(\t\022,\n$fetch_re" + - "mote_devices_in_multi_client\030\024 \001(\010\"\332\001\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" + - "\022)\n%MLIR_BRIDGE_ROLLOUT_SAFE_MODE_ENABLE" + - "D\020\003\0222\n.MLIR_BRIDGE_ROLLOUT_SAFE_MODE_FAL" + - "LBACK_ENABLED\020\004J\004\010\002\020\003\"\341\004\n\nRunOptions\0226\n\013" + - "trace_level\030\001 \001(\0162!.tensorflow.RunOption" + - "s.TraceLevel\022\025\n\rtimeout_in_ms\030\002 \001(\003\022\034\n\024i" + - "nter_op_thread_pool\030\003 \001(\005\022\037\n\027output_part" + - "ition_graphs\030\005 \001(\010\022/\n\rdebug_options\030\006 \001(" + - "\0132\030.tensorflow.DebugOptions\022*\n\"report_te" + - "nsor_allocations_upon_oom\030\007 \001(\010\0229\n\014exper" + - "imental\030\010 \001(\0132#.tensorflow.RunOptions.Ex" + - "perimental\032\322\001\n\014Experimental\022\034\n\024collectiv" + - "e_graph_key\030\001 \001(\003\022\034\n\024use_run_handler_poo" + - "l\030\002 \001(\010\022[\n\030run_handler_pool_options\030\003 \001(" + - "\01329.tensorflow.RunOptions.Experimental.R" + - "unHandlerPoolOptions\032)\n\025RunHandlerPoolOp" + - "tions\022\020\n\010priority\030\001 \001(\003\"R\n\nTraceLevel\022\014\n" + - "\010NO_TRACE\020\000\022\022\n\016SOFTWARE_TRACE\020\001\022\022\n\016HARDW" + - "ARE_TRACE\020\002\022\016\n\nFULL_TRACE\020\003J\004\010\004\020\005\"\207\003\n\013Ru" + - "nMetadata\022)\n\nstep_stats\030\001 \001(\0132\025.tensorfl" + - "ow.StepStats\022,\n\ncost_graph\030\002 \001(\0132\030.tenso" + - "rflow.CostGraphDef\022.\n\020partition_graphs\030\003" + - " \003(\0132\024.tensorflow.GraphDef\022?\n\017function_g" + - "raphs\030\004 \003(\0132&.tensorflow.RunMetadata.Fun" + - "ctionGraphs\032\255\001\n\016FunctionGraphs\022.\n\020partit" + - "ion_graphs\030\001 \003(\0132\024.tensorflow.GraphDef\0224" + - "\n\026pre_optimization_graph\030\002 \001(\0132\024.tensorf" + - "low.GraphDef\0225\n\027post_optimization_graph\030" + - "\003 \001(\0132\024.tensorflow.GraphDef\":\n\020TensorCon" + - "nection\022\023\n\013from_tensor\030\001 \001(\t\022\021\n\tto_tenso" + - "r\030\002 \001(\t\"\260\003\n\017CallableOptions\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_connection\030\005 \003(\0132\034.tensorflow.Te" + - "nsorConnection\022B\n\014feed_devices\030\006 \003(\0132,.t" + - "ensorflow.CallableOptions.FeedDevicesEnt" + - "ry\022D\n\rfetch_devices\030\007 \003(\0132-.tensorflow.C" + - "allableOptions.FetchDevicesEntry\022\027\n\017fetc" + - "h_skip_sync\030\010 \001(\010\0322\n\020FeedDevicesEntry\022\013\n" + - "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0323\n\021FetchDe" + - "vicesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" + - "8\001B\212\001\n\036org.tensorflow.proto.frameworkB\014C" + - "onfigProtosP\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.CostGraphProtos.getDescriptor(), - org.tensorflow.proto.framework.GraphProtos.getDescriptor(), - org.tensorflow.proto.framework.StepStatsProtos.getDescriptor(), - org.tensorflow.proto.distruntime.ClusterProtos.getDescriptor(), - org.tensorflow.proto.framework.DebugProtos.getDescriptor(), - org.tensorflow.proto.framework.RewriterConfigProtos.getDescriptor(), - }); - internal_static_tensorflow_GPUOptions_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_GPUOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GPUOptions_descriptor, - new java.lang.String[] { "PerProcessGpuMemoryFraction", "AllowGrowth", "AllocatorType", "DeferredDeletionBytes", "VisibleDeviceList", "PollingActiveDelayUsecs", "PollingInactiveDelayMsecs", "ForceGpuCompatible", "Experimental", }); - internal_static_tensorflow_GPUOptions_Experimental_descriptor = - internal_static_tensorflow_GPUOptions_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GPUOptions_Experimental_descriptor, - new java.lang.String[] { "VirtualDevices", "UseUnifiedMemory", "NumDevToDevCopyStreams", "CollectiveRingOrder", "TimestampedAllocator", "KernelTrackerMaxInterval", "KernelTrackerMaxBytes", "KernelTrackerMaxPending", "InternalFragmentationFraction", "UseCudaMallocAsync", }); - internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor = - internal_static_tensorflow_GPUOptions_Experimental_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor, - new java.lang.String[] { "MemoryLimitMb", "Priority", }); - internal_static_tensorflow_OptimizerOptions_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_OptimizerOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OptimizerOptions_descriptor, - new java.lang.String[] { "DoCommonSubexpressionElimination", "DoConstantFolding", "MaxFoldedConstantInBytes", "DoFunctionInlining", "OptLevel", "GlobalJitLevel", }); - internal_static_tensorflow_GraphOptions_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_GraphOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphOptions_descriptor, - new java.lang.String[] { "EnableRecvScheduling", "OptimizerOptions", "BuildCostModel", "BuildCostModelAfter", "InferShapes", "PlacePrunedGraph", "EnableBfloat16Sendrecv", "TimelineStep", "RewriteOptions", }); - internal_static_tensorflow_ThreadPoolOptionProto_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ThreadPoolOptionProto_descriptor, - new java.lang.String[] { "NumThreads", "GlobalName", }); - internal_static_tensorflow_RPCOptions_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_RPCOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RPCOptions_descriptor, - new java.lang.String[] { "UseRpcForInprocessMaster", "CompressionAlgorithm", "CompressionLevel", "CacheRpcResponse", "DisableSessionConnectionSharing", "NumChannelsPerTarget", }); - internal_static_tensorflow_SessionMetadata_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_SessionMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SessionMetadata_descriptor, - new java.lang.String[] { "Name", "Version", }); - internal_static_tensorflow_ConfigProto_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_ConfigProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ConfigProto_descriptor, - new java.lang.String[] { "DeviceCount", "IntraOpParallelismThreads", "InterOpParallelismThreads", "UsePerSessionThreads", "SessionInterOpThreadPool", "PlacementPeriod", "DeviceFilters", "GpuOptions", "AllowSoftPlacement", "LogDevicePlacement", "GraphOptions", "OperationTimeoutInMs", "RpcOptions", "ClusterDef", "IsolateSessionState", "ShareClusterDevicesInSession", "Experimental", }); - internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor = - internal_static_tensorflow_ConfigProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_ConfigProto_DeviceCountEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_ConfigProto_Experimental_descriptor = - internal_static_tensorflow_ConfigProto_descriptor.getNestedTypes().get(1); - 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", "MlirBridgeRollout", "EnableMlirGraphOptimization", "DisableOutputPartitionGraphs", "XlaFusionAutotunerThresh", "UseTfrt", "CoordinationService", "FetchRemoteDevicesInMultiClient", }); - internal_static_tensorflow_RunOptions_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_RunOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunOptions_descriptor, - new java.lang.String[] { "TraceLevel", "TimeoutInMs", "InterOpThreadPool", "OutputPartitionGraphs", "DebugOptions", "ReportTensorAllocationsUponOom", "Experimental", }); - internal_static_tensorflow_RunOptions_Experimental_descriptor = - internal_static_tensorflow_RunOptions_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunOptions_Experimental_descriptor, - new java.lang.String[] { "CollectiveGraphKey", "UseRunHandlerPool", "RunHandlerPoolOptions", }); - internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor = - internal_static_tensorflow_RunOptions_Experimental_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor, - new java.lang.String[] { "Priority", }); - internal_static_tensorflow_RunMetadata_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_tensorflow_RunMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunMetadata_descriptor, - new java.lang.String[] { "StepStats", "CostGraph", "PartitionGraphs", "FunctionGraphs", }); - internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor = - internal_static_tensorflow_RunMetadata_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor, - new java.lang.String[] { "PartitionGraphs", "PreOptimizationGraph", "PostOptimizationGraph", }); - internal_static_tensorflow_TensorConnection_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_tensorflow_TensorConnection_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorConnection_descriptor, - new java.lang.String[] { "FromTensor", "ToTensor", }); - internal_static_tensorflow_CallableOptions_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_tensorflow_CallableOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CallableOptions_descriptor, - new java.lang.String[] { "Feed", "Fetch", "Target", "RunOptions", "TensorConnection", "FeedDevices", "FetchDevices", "FetchSkipSync", }); - internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor = - internal_static_tensorflow_CallableOptions_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_CallableOptions_FeedDevicesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor = - internal_static_tensorflow_CallableOptions_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_CallableOptions_FetchDevicesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.tensorflow.proto.framework.CostGraphProtos.getDescriptor(); - org.tensorflow.proto.framework.GraphProtos.getDescriptor(); - org.tensorflow.proto.framework.StepStatsProtos.getDescriptor(); - org.tensorflow.proto.distruntime.ClusterProtos.getDescriptor(); - org.tensorflow.proto.framework.DebugProtos.getDescriptor(); - org.tensorflow.proto.framework.RewriterConfigProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDef.java deleted file mode 100644 index 48b3b2cd638..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDef.java +++ /dev/null @@ -1,903 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/control_flow.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Container for any kind of control flow context. Any other control flow
    - * contexts that are added below should also be added here.
    - * 
    - * - * Protobuf type {@code tensorflow.ControlFlowContextDef} - */ -public final class ControlFlowContextDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ControlFlowContextDef) - ControlFlowContextDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use ControlFlowContextDef.newBuilder() to construct. - private ControlFlowContextDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ControlFlowContextDef() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ControlFlowContextDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ControlFlowContextDef( - 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: { - org.tensorflow.proto.framework.CondContextDef.Builder subBuilder = null; - if (ctxtCase_ == 1) { - subBuilder = ((org.tensorflow.proto.framework.CondContextDef) ctxt_).toBuilder(); - } - ctxt_ = - input.readMessage(org.tensorflow.proto.framework.CondContextDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CondContextDef) ctxt_); - ctxt_ = subBuilder.buildPartial(); - } - ctxtCase_ = 1; - break; - } - case 18: { - org.tensorflow.proto.framework.WhileContextDef.Builder subBuilder = null; - if (ctxtCase_ == 2) { - subBuilder = ((org.tensorflow.proto.framework.WhileContextDef) ctxt_).toBuilder(); - } - ctxt_ = - input.readMessage(org.tensorflow.proto.framework.WhileContextDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.WhileContextDef) ctxt_); - ctxt_ = subBuilder.buildPartial(); - } - ctxtCase_ = 2; - 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.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ControlFlowContextDef.class, org.tensorflow.proto.framework.ControlFlowContextDef.Builder.class); - } - - private int ctxtCase_ = 0; - private java.lang.Object ctxt_; - public enum CtxtCase - implements com.google.protobuf.Internal.EnumLite { - COND_CTXT(1), - WHILE_CTXT(2), - CTXT_NOT_SET(0); - private final int value; - private CtxtCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static CtxtCase valueOf(int value) { - return forNumber(value); - } - - public static CtxtCase forNumber(int value) { - switch (value) { - case 1: return COND_CTXT; - case 2: return WHILE_CTXT; - case 0: return CTXT_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public CtxtCase - getCtxtCase() { - return CtxtCase.forNumber( - ctxtCase_); - } - - public static final int COND_CTXT_FIELD_NUMBER = 1; - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public boolean hasCondCtxt() { - return ctxtCase_ == 1; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public org.tensorflow.proto.framework.CondContextDef getCondCtxt() { - if (ctxtCase_ == 1) { - return (org.tensorflow.proto.framework.CondContextDef) ctxt_; - } - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public org.tensorflow.proto.framework.CondContextDefOrBuilder getCondCtxtOrBuilder() { - if (ctxtCase_ == 1) { - return (org.tensorflow.proto.framework.CondContextDef) ctxt_; - } - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - - public static final int WHILE_CTXT_FIELD_NUMBER = 2; - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public boolean hasWhileCtxt() { - return ctxtCase_ == 2; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public org.tensorflow.proto.framework.WhileContextDef getWhileCtxt() { - if (ctxtCase_ == 2) { - return (org.tensorflow.proto.framework.WhileContextDef) ctxt_; - } - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public org.tensorflow.proto.framework.WhileContextDefOrBuilder getWhileCtxtOrBuilder() { - if (ctxtCase_ == 2) { - return (org.tensorflow.proto.framework.WhileContextDef) ctxt_; - } - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - - 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 (ctxtCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.framework.CondContextDef) ctxt_); - } - if (ctxtCase_ == 2) { - output.writeMessage(2, (org.tensorflow.proto.framework.WhileContextDef) ctxt_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (ctxtCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.framework.CondContextDef) ctxt_); - } - if (ctxtCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (org.tensorflow.proto.framework.WhileContextDef) ctxt_); - } - 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.ControlFlowContextDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ControlFlowContextDef other = (org.tensorflow.proto.framework.ControlFlowContextDef) obj; - - if (!getCtxtCase().equals(other.getCtxtCase())) return false; - switch (ctxtCase_) { - case 1: - if (!getCondCtxt() - .equals(other.getCondCtxt())) return false; - break; - case 2: - if (!getWhileCtxt() - .equals(other.getWhileCtxt())) return false; - break; - case 0: - default: - } - 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(); - switch (ctxtCase_) { - case 1: - hash = (37 * hash) + COND_CTXT_FIELD_NUMBER; - hash = (53 * hash) + getCondCtxt().hashCode(); - break; - case 2: - hash = (37 * hash) + WHILE_CTXT_FIELD_NUMBER; - hash = (53 * hash) + getWhileCtxt().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ControlFlowContextDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef 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.ControlFlowContextDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef 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.ControlFlowContextDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef 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.ControlFlowContextDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef 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.ControlFlowContextDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ControlFlowContextDef 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.ControlFlowContextDef 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; - } - /** - *
    -   * Container for any kind of control flow context. Any other control flow
    -   * contexts that are added below should also be added here.
    -   * 
    - * - * Protobuf type {@code tensorflow.ControlFlowContextDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ControlFlowContextDef) - org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ControlFlowContextDef.class, org.tensorflow.proto.framework.ControlFlowContextDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ControlFlowContextDef.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(); - ctxtCase_ = 0; - ctxt_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ControlFlowContextDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ControlFlowContextDef build() { - org.tensorflow.proto.framework.ControlFlowContextDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ControlFlowContextDef buildPartial() { - org.tensorflow.proto.framework.ControlFlowContextDef result = new org.tensorflow.proto.framework.ControlFlowContextDef(this); - if (ctxtCase_ == 1) { - if (condCtxtBuilder_ == null) { - result.ctxt_ = ctxt_; - } else { - result.ctxt_ = condCtxtBuilder_.build(); - } - } - if (ctxtCase_ == 2) { - if (whileCtxtBuilder_ == null) { - result.ctxt_ = ctxt_; - } else { - result.ctxt_ = whileCtxtBuilder_.build(); - } - } - result.ctxtCase_ = ctxtCase_; - 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.ControlFlowContextDef) { - return mergeFrom((org.tensorflow.proto.framework.ControlFlowContextDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ControlFlowContextDef other) { - if (other == org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance()) return this; - switch (other.getCtxtCase()) { - case COND_CTXT: { - mergeCondCtxt(other.getCondCtxt()); - break; - } - case WHILE_CTXT: { - mergeWhileCtxt(other.getWhileCtxt()); - break; - } - case CTXT_NOT_SET: { - break; - } - } - 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.ControlFlowContextDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ControlFlowContextDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int ctxtCase_ = 0; - private java.lang.Object ctxt_; - public CtxtCase - getCtxtCase() { - return CtxtCase.forNumber( - ctxtCase_); - } - - public Builder clearCtxt() { - ctxtCase_ = 0; - ctxt_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CondContextDef, org.tensorflow.proto.framework.CondContextDef.Builder, org.tensorflow.proto.framework.CondContextDefOrBuilder> condCtxtBuilder_; - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public boolean hasCondCtxt() { - return ctxtCase_ == 1; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public org.tensorflow.proto.framework.CondContextDef getCondCtxt() { - if (condCtxtBuilder_ == null) { - if (ctxtCase_ == 1) { - return (org.tensorflow.proto.framework.CondContextDef) ctxt_; - } - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } else { - if (ctxtCase_ == 1) { - return condCtxtBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public Builder setCondCtxt(org.tensorflow.proto.framework.CondContextDef value) { - if (condCtxtBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ctxt_ = value; - onChanged(); - } else { - condCtxtBuilder_.setMessage(value); - } - ctxtCase_ = 1; - return this; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public Builder setCondCtxt( - org.tensorflow.proto.framework.CondContextDef.Builder builderForValue) { - if (condCtxtBuilder_ == null) { - ctxt_ = builderForValue.build(); - onChanged(); - } else { - condCtxtBuilder_.setMessage(builderForValue.build()); - } - ctxtCase_ = 1; - return this; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public Builder mergeCondCtxt(org.tensorflow.proto.framework.CondContextDef value) { - if (condCtxtBuilder_ == null) { - if (ctxtCase_ == 1 && - ctxt_ != org.tensorflow.proto.framework.CondContextDef.getDefaultInstance()) { - ctxt_ = org.tensorflow.proto.framework.CondContextDef.newBuilder((org.tensorflow.proto.framework.CondContextDef) ctxt_) - .mergeFrom(value).buildPartial(); - } else { - ctxt_ = value; - } - onChanged(); - } else { - if (ctxtCase_ == 1) { - condCtxtBuilder_.mergeFrom(value); - } - condCtxtBuilder_.setMessage(value); - } - ctxtCase_ = 1; - return this; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public Builder clearCondCtxt() { - if (condCtxtBuilder_ == null) { - if (ctxtCase_ == 1) { - ctxtCase_ = 0; - ctxt_ = null; - onChanged(); - } - } else { - if (ctxtCase_ == 1) { - ctxtCase_ = 0; - ctxt_ = null; - } - condCtxtBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public org.tensorflow.proto.framework.CondContextDef.Builder getCondCtxtBuilder() { - return getCondCtxtFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - public org.tensorflow.proto.framework.CondContextDefOrBuilder getCondCtxtOrBuilder() { - if ((ctxtCase_ == 1) && (condCtxtBuilder_ != null)) { - return condCtxtBuilder_.getMessageOrBuilder(); - } else { - if (ctxtCase_ == 1) { - return (org.tensorflow.proto.framework.CondContextDef) ctxt_; - } - return org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - } - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CondContextDef, org.tensorflow.proto.framework.CondContextDef.Builder, org.tensorflow.proto.framework.CondContextDefOrBuilder> - getCondCtxtFieldBuilder() { - if (condCtxtBuilder_ == null) { - if (!(ctxtCase_ == 1)) { - ctxt_ = org.tensorflow.proto.framework.CondContextDef.getDefaultInstance(); - } - condCtxtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CondContextDef, org.tensorflow.proto.framework.CondContextDef.Builder, org.tensorflow.proto.framework.CondContextDefOrBuilder>( - (org.tensorflow.proto.framework.CondContextDef) ctxt_, - getParentForChildren(), - isClean()); - ctxt_ = null; - } - ctxtCase_ = 1; - onChanged();; - return condCtxtBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.WhileContextDef, org.tensorflow.proto.framework.WhileContextDef.Builder, org.tensorflow.proto.framework.WhileContextDefOrBuilder> whileCtxtBuilder_; - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public boolean hasWhileCtxt() { - return ctxtCase_ == 2; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public org.tensorflow.proto.framework.WhileContextDef getWhileCtxt() { - if (whileCtxtBuilder_ == null) { - if (ctxtCase_ == 2) { - return (org.tensorflow.proto.framework.WhileContextDef) ctxt_; - } - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } else { - if (ctxtCase_ == 2) { - return whileCtxtBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public Builder setWhileCtxt(org.tensorflow.proto.framework.WhileContextDef value) { - if (whileCtxtBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ctxt_ = value; - onChanged(); - } else { - whileCtxtBuilder_.setMessage(value); - } - ctxtCase_ = 2; - return this; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public Builder setWhileCtxt( - org.tensorflow.proto.framework.WhileContextDef.Builder builderForValue) { - if (whileCtxtBuilder_ == null) { - ctxt_ = builderForValue.build(); - onChanged(); - } else { - whileCtxtBuilder_.setMessage(builderForValue.build()); - } - ctxtCase_ = 2; - return this; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public Builder mergeWhileCtxt(org.tensorflow.proto.framework.WhileContextDef value) { - if (whileCtxtBuilder_ == null) { - if (ctxtCase_ == 2 && - ctxt_ != org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance()) { - ctxt_ = org.tensorflow.proto.framework.WhileContextDef.newBuilder((org.tensorflow.proto.framework.WhileContextDef) ctxt_) - .mergeFrom(value).buildPartial(); - } else { - ctxt_ = value; - } - onChanged(); - } else { - if (ctxtCase_ == 2) { - whileCtxtBuilder_.mergeFrom(value); - } - whileCtxtBuilder_.setMessage(value); - } - ctxtCase_ = 2; - return this; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public Builder clearWhileCtxt() { - if (whileCtxtBuilder_ == null) { - if (ctxtCase_ == 2) { - ctxtCase_ = 0; - ctxt_ = null; - onChanged(); - } - } else { - if (ctxtCase_ == 2) { - ctxtCase_ = 0; - ctxt_ = null; - } - whileCtxtBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public org.tensorflow.proto.framework.WhileContextDef.Builder getWhileCtxtBuilder() { - return getWhileCtxtFieldBuilder().getBuilder(); - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - public org.tensorflow.proto.framework.WhileContextDefOrBuilder getWhileCtxtOrBuilder() { - if ((ctxtCase_ == 2) && (whileCtxtBuilder_ != null)) { - return whileCtxtBuilder_.getMessageOrBuilder(); - } else { - if (ctxtCase_ == 2) { - return (org.tensorflow.proto.framework.WhileContextDef) ctxt_; - } - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - } - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.WhileContextDef, org.tensorflow.proto.framework.WhileContextDef.Builder, org.tensorflow.proto.framework.WhileContextDefOrBuilder> - getWhileCtxtFieldBuilder() { - if (whileCtxtBuilder_ == null) { - if (!(ctxtCase_ == 2)) { - ctxt_ = org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - whileCtxtBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.WhileContextDef, org.tensorflow.proto.framework.WhileContextDef.Builder, org.tensorflow.proto.framework.WhileContextDefOrBuilder>( - (org.tensorflow.proto.framework.WhileContextDef) ctxt_, - getParentForChildren(), - isClean()); - ctxt_ = null; - } - ctxtCase_ = 2; - onChanged();; - return whileCtxtBuilder_; - } - @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.ControlFlowContextDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ControlFlowContextDef) - private static final org.tensorflow.proto.framework.ControlFlowContextDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ControlFlowContextDef(); - } - - public static org.tensorflow.proto.framework.ControlFlowContextDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ControlFlowContextDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ControlFlowContextDef(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.ControlFlowContextDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDefOrBuilder.java deleted file mode 100644 index b4482047fd9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowContextDefOrBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/control_flow.proto - -package org.tensorflow.proto.framework; - -public interface ControlFlowContextDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ControlFlowContextDef) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - boolean hasCondCtxt(); - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - org.tensorflow.proto.framework.CondContextDef getCondCtxt(); - /** - * .tensorflow.CondContextDef cond_ctxt = 1; - */ - org.tensorflow.proto.framework.CondContextDefOrBuilder getCondCtxtOrBuilder(); - - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - boolean hasWhileCtxt(); - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - org.tensorflow.proto.framework.WhileContextDef getWhileCtxt(); - /** - * .tensorflow.WhileContextDef while_ctxt = 2; - */ - org.tensorflow.proto.framework.WhileContextDefOrBuilder getWhileCtxtOrBuilder(); - - public org.tensorflow.proto.framework.ControlFlowContextDef.CtxtCase getCtxtCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDef.java deleted file mode 100644 index c06cd1761fa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDef.java +++ /dev/null @@ -1,5817 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/cost_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.CostGraphDef} - */ -public final class CostGraphDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef) - CostGraphDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use CostGraphDef.newBuilder() to construct. - private CostGraphDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CostGraphDef() { - node_ = java.util.Collections.emptyList(); - cost_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CostGraphDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CostGraphDef( - 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)) { - node_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - node_.add( - input.readMessage(org.tensorflow.proto.framework.CostGraphDef.Node.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - cost_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - cost_.add( - input.readMessage(org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.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_ & 0x00000001) != 0)) { - node_ = java.util.Collections.unmodifiableList(node_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - cost_ = java.util.Collections.unmodifiableList(cost_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.class, org.tensorflow.proto.framework.CostGraphDef.Builder.class); - } - - public interface NodeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The name of the node. Names are globally unique.
    -     * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -     * The name of the node. Names are globally unique.
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * The device of the node. Can be empty if the node is mapped to the
    -     * default partition or partitioning hasn't been run yet.
    -     * 
    - * - * string device = 2; - */ - java.lang.String getDevice(); - /** - *
    -     * The device of the node. Can be empty if the node is mapped to the
    -     * default partition or partitioning hasn't been run yet.
    -     * 
    - * - * string device = 2; - */ - com.google.protobuf.ByteString - getDeviceBytes(); - - /** - *
    -     * The id of the node. Node ids are only unique inside a partition.
    -     * 
    - * - * int32 id = 3; - */ - int getId(); - - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - java.util.List - getInputInfoList(); - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo getInputInfo(int index); - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - int getInputInfoCount(); - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - java.util.List - getInputInfoOrBuilderList(); - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( - int index); - - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - java.util.List - getOutputInfoList(); - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo getOutputInfo(int index); - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - int getOutputInfoCount(); - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - java.util.List - getOutputInfoOrBuilderList(); - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( - int index); - - /** - *
    -     * Temporary memory used by this node.
    -     * 
    - * - * int64 temporary_memory_size = 6; - */ - long getTemporaryMemorySize(); - - /** - *
    -     * Persistent memory used by this node.
    -     * 
    - * - * int64 persistent_memory_size = 12; - */ - long getPersistentMemorySize(); - - /** - * int64 host_temp_memory_size = 10 [deprecated = true]; - */ - @java.lang.Deprecated long getHostTempMemorySize(); - - /** - * int64 device_temp_memory_size = 11 [deprecated = true]; - */ - @java.lang.Deprecated long getDeviceTempMemorySize(); - - /** - * int64 device_persistent_memory_size = 16 [deprecated = true]; - */ - @java.lang.Deprecated long getDevicePersistentMemorySize(); - - /** - *
    -     * Estimate of the computational cost of this node, in microseconds.
    -     * 
    - * - * int64 compute_cost = 9; - */ - long getComputeCost(); - - /** - *
    -     * Analytical estimate of the computational cost of this node, in
    -     * microseconds.
    -     * 
    - * - * int64 compute_time = 14; - */ - long getComputeTime(); - - /** - *
    -     * Analytical estimate of the memory access cost of this node, in
    -     * microseconds.
    -     * 
    - * - * int64 memory_time = 15; - */ - long getMemoryTime(); - - /** - *
    -     * If true, the output is permanent: it can't be discarded, because this
    -     * node is part of the "final output". Nodes may depend on final nodes.
    -     * 
    - * - * bool is_final = 7; - */ - boolean getIsFinal(); - - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - java.util.List getControlInputList(); - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - int getControlInputCount(); - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - int getControlInput(int index); - - /** - *
    -     * Are the costs inaccurate?
    -     * 
    - * - * bool inaccurate = 17; - */ - boolean getInaccurate(); - } - /** - * Protobuf type {@code tensorflow.CostGraphDef.Node} - */ - public static final class Node extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node) - NodeOrBuilder { - private static final long serialVersionUID = 0L; - // Use Node.newBuilder() to construct. - private Node(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Node() { - name_ = ""; - device_ = ""; - inputInfo_ = java.util.Collections.emptyList(); - outputInfo_ = java.util.Collections.emptyList(); - controlInput_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Node(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Node( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - device_ = s; - break; - } - case 24: { - - id_ = input.readInt32(); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - inputInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - inputInfo_.add( - input.readMessage(org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - outputInfo_.add( - input.readMessage(org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.parser(), extensionRegistry)); - break; - } - case 48: { - - temporaryMemorySize_ = input.readInt64(); - break; - } - case 56: { - - isFinal_ = input.readBool(); - break; - } - case 64: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - controlInput_ = newIntList(); - mutable_bitField0_ |= 0x00000004; - } - controlInput_.addInt(input.readInt32()); - break; - } - case 66: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - controlInput_ = newIntList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - controlInput_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 72: { - - computeCost_ = input.readInt64(); - break; - } - case 80: { - - hostTempMemorySize_ = input.readInt64(); - break; - } - case 88: { - - deviceTempMemorySize_ = input.readInt64(); - break; - } - case 96: { - - persistentMemorySize_ = input.readInt64(); - break; - } - case 112: { - - computeTime_ = input.readInt64(); - break; - } - case 120: { - - memoryTime_ = input.readInt64(); - break; - } - case 128: { - - devicePersistentMemorySize_ = input.readInt64(); - break; - } - case 136: { - - inaccurate_ = input.readBool(); - 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)) { - inputInfo_ = java.util.Collections.unmodifiableList(inputInfo_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - outputInfo_ = java.util.Collections.unmodifiableList(outputInfo_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - controlInput_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.class, org.tensorflow.proto.framework.CostGraphDef.Node.Builder.class); - } - - public interface InputInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node.InputInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 preceding_node = 1; - */ - int getPrecedingNode(); - - /** - * int32 preceding_port = 2; - */ - int getPrecedingPort(); - } - /** - *
    -     * Inputs of this node. They must be executed before this node can be
    -     * executed. An input is a particular output of another node, specified
    -     * by the node id and the output index.
    -     * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.Node.InputInfo} - */ - public static final class InputInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node.InputInfo) - InputInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use InputInfo.newBuilder() to construct. - private InputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private InputInfo() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new InputInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private InputInfo( - 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: { - - precedingNode_ = input.readInt32(); - break; - } - case 16: { - - precedingPort_ = input.readInt32(); - 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.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.class, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder.class); - } - - public static final int PRECEDING_NODE_FIELD_NUMBER = 1; - private int precedingNode_; - /** - * int32 preceding_node = 1; - */ - public int getPrecedingNode() { - return precedingNode_; - } - - public static final int PRECEDING_PORT_FIELD_NUMBER = 2; - private int precedingPort_; - /** - * int32 preceding_port = 2; - */ - public int getPrecedingPort() { - return precedingPort_; - } - - 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 (precedingNode_ != 0) { - output.writeInt32(1, precedingNode_); - } - if (precedingPort_ != 0) { - output.writeInt32(2, precedingPort_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (precedingNode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, precedingNode_); - } - if (precedingPort_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, precedingPort_); - } - 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.CostGraphDef.Node.InputInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo other = (org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo) obj; - - if (getPrecedingNode() - != other.getPrecedingNode()) return false; - if (getPrecedingPort() - != other.getPrecedingPort()) 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) + PRECEDING_NODE_FIELD_NUMBER; - hash = (53 * hash) + getPrecedingNode(); - hash = (37 * hash) + PRECEDING_PORT_FIELD_NUMBER; - hash = (53 * hash) + getPrecedingPort(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo 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; - } - /** - *
    -       * Inputs of this node. They must be executed before this node can be
    -       * executed. An input is a particular output of another node, specified
    -       * by the node id and the output index.
    -       * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.Node.InputInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node.InputInfo) - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.class, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.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(); - precedingNode_ = 0; - - precedingPort_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo build() { - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo buildPartial() { - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo result = new org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo(this); - result.precedingNode_ = precedingNode_; - result.precedingPort_ = precedingPort_; - 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.CostGraphDef.Node.InputInfo) { - return mergeFrom((org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo other) { - if (other == org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.getDefaultInstance()) return this; - if (other.getPrecedingNode() != 0) { - setPrecedingNode(other.getPrecedingNode()); - } - if (other.getPrecedingPort() != 0) { - setPrecedingPort(other.getPrecedingPort()); - } - 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.CostGraphDef.Node.InputInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int precedingNode_ ; - /** - * int32 preceding_node = 1; - */ - public int getPrecedingNode() { - return precedingNode_; - } - /** - * int32 preceding_node = 1; - */ - public Builder setPrecedingNode(int value) { - - precedingNode_ = value; - onChanged(); - return this; - } - /** - * int32 preceding_node = 1; - */ - public Builder clearPrecedingNode() { - - precedingNode_ = 0; - onChanged(); - return this; - } - - private int precedingPort_ ; - /** - * int32 preceding_port = 2; - */ - public int getPrecedingPort() { - return precedingPort_; - } - /** - * int32 preceding_port = 2; - */ - public Builder setPrecedingPort(int value) { - - precedingPort_ = value; - onChanged(); - return this; - } - /** - * int32 preceding_port = 2; - */ - public Builder clearPrecedingPort() { - - precedingPort_ = 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.CostGraphDef.Node.InputInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.InputInfo) - private static final org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo(); - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public InputInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new InputInfo(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.CostGraphDef.Node.InputInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface OutputInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node.OutputInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 size = 1; - */ - long getSize(); - - /** - *
    -       * If >= 0, the output is an alias of an input. Note that an alias input
    -       * may itself be an alias. The algorithm will therefore need to follow
    -       * those pointers.
    -       * 
    - * - * int64 alias_input_port = 2; - */ - long getAliasInputPort(); - - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * .tensorflow.DataType dtype = 4; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 4; - */ - org.tensorflow.proto.framework.DataType getDtype(); - } - /** - *
    -     * Outputs of this node.
    -     * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.Node.OutputInfo} - */ - public static final class OutputInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node.OutputInfo) - OutputInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use OutputInfo.newBuilder() to construct. - private OutputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OutputInfo() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OutputInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OutputInfo( - 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: { - - size_ = input.readInt64(); - break; - } - case 16: { - - aliasInputPort_ = input.readInt64(); - break; - } - case 26: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 32: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - 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.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.class, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder.class); - } - - public static final int SIZE_FIELD_NUMBER = 1; - private long size_; - /** - * int64 size = 1; - */ - public long getSize() { - return size_; - } - - public static final int ALIAS_INPUT_PORT_FIELD_NUMBER = 2; - private long aliasInputPort_; - /** - *
    -       * If >= 0, the output is an alias of an input. Note that an alias input
    -       * may itself be an alias. The algorithm will therefore need to follow
    -       * those pointers.
    -       * 
    - * - * int64 alias_input_port = 2; - */ - public long getAliasInputPort() { - return aliasInputPort_; - } - - public static final int SHAPE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int DTYPE_FIELD_NUMBER = 4; - private int dtype_; - /** - * .tensorflow.DataType dtype = 4; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 4; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - 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 (size_ != 0L) { - output.writeInt64(1, size_); - } - if (aliasInputPort_ != 0L) { - output.writeInt64(2, aliasInputPort_); - } - if (shape_ != null) { - output.writeMessage(3, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(4, dtype_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, size_); - } - if (aliasInputPort_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, aliasInputPort_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, dtype_); - } - 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.CostGraphDef.Node.OutputInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo other = (org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo) obj; - - if (getSize() - != other.getSize()) return false; - if (getAliasInputPort() - != other.getAliasInputPort()) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (dtype_ != other.dtype_) 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) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (37 * hash) + ALIAS_INPUT_PORT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAliasInputPort()); - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo 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; - } - /** - *
    -       * Outputs of this node.
    -       * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.Node.OutputInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node.OutputInfo) - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.class, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.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(); - size_ = 0L; - - aliasInputPort_ = 0L; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - dtype_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo build() { - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo buildPartial() { - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo result = new org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo(this); - result.size_ = size_; - result.aliasInputPort_ = aliasInputPort_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.dtype_ = dtype_; - 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.CostGraphDef.Node.OutputInfo) { - return mergeFrom((org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo other) { - if (other == org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.getDefaultInstance()) return this; - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (other.getAliasInputPort() != 0L) { - setAliasInputPort(other.getAliasInputPort()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - 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.CostGraphDef.Node.OutputInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long size_ ; - /** - * int64 size = 1; - */ - public long getSize() { - return size_; - } - /** - * int64 size = 1; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - * int64 size = 1; - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private long aliasInputPort_ ; - /** - *
    -         * If >= 0, the output is an alias of an input. Note that an alias input
    -         * may itself be an alias. The algorithm will therefore need to follow
    -         * those pointers.
    -         * 
    - * - * int64 alias_input_port = 2; - */ - public long getAliasInputPort() { - return aliasInputPort_; - } - /** - *
    -         * If >= 0, the output is an alias of an input. Note that an alias input
    -         * may itself be an alias. The algorithm will therefore need to follow
    -         * those pointers.
    -         * 
    - * - * int64 alias_input_port = 2; - */ - public Builder setAliasInputPort(long value) { - - aliasInputPort_ = value; - onChanged(); - return this; - } - /** - *
    -         * If >= 0, the output is an alias of an input. Note that an alias input
    -         * may itself be an alias. The algorithm will therefore need to follow
    -         * those pointers.
    -         * 
    - * - * int64 alias_input_port = 2; - */ - public Builder clearAliasInputPort() { - - aliasInputPort_ = 0L; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 4; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 4; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 4; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 4; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 4; - */ - public Builder clearDtype() { - - dtype_ = 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.CostGraphDef.Node.OutputInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.OutputInfo) - private static final org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo(); - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OutputInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OutputInfo(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.CostGraphDef.Node.OutputInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -     * The name of the node. Names are globally unique.
    -     * 
    - * - * 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 node. Names are globally unique.
    -     * 
    - * - * 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_FIELD_NUMBER = 2; - private volatile java.lang.Object device_; - /** - *
    -     * The device of the node. Can be empty if the node is mapped to the
    -     * default partition or partitioning hasn't been run yet.
    -     * 
    - * - * string device = 2; - */ - 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; - } - } - /** - *
    -     * The device of the node. Can be empty if the node is mapped to the
    -     * default partition or partitioning hasn't been run yet.
    -     * 
    - * - * string device = 2; - */ - 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 ID_FIELD_NUMBER = 3; - private int id_; - /** - *
    -     * The id of the node. Node ids are only unique inside a partition.
    -     * 
    - * - * int32 id = 3; - */ - public int getId() { - return id_; - } - - public static final int INPUT_INFO_FIELD_NUMBER = 4; - private java.util.List inputInfo_; - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public java.util.List getInputInfoList() { - return inputInfo_; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public java.util.List - getInputInfoOrBuilderList() { - return inputInfo_; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public int getInputInfoCount() { - return inputInfo_.size(); - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo getInputInfo(int index) { - return inputInfo_.get(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( - int index) { - return inputInfo_.get(index); - } - - public static final int OUTPUT_INFO_FIELD_NUMBER = 5; - private java.util.List outputInfo_; - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public java.util.List getOutputInfoList() { - return outputInfo_; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public java.util.List - getOutputInfoOrBuilderList() { - return outputInfo_; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public int getOutputInfoCount() { - return outputInfo_.size(); - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo getOutputInfo(int index) { - return outputInfo_.get(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( - int index) { - return outputInfo_.get(index); - } - - public static final int TEMPORARY_MEMORY_SIZE_FIELD_NUMBER = 6; - private long temporaryMemorySize_; - /** - *
    -     * Temporary memory used by this node.
    -     * 
    - * - * int64 temporary_memory_size = 6; - */ - public long getTemporaryMemorySize() { - return temporaryMemorySize_; - } - - public static final int PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 12; - private long persistentMemorySize_; - /** - *
    -     * Persistent memory used by this node.
    -     * 
    - * - * int64 persistent_memory_size = 12; - */ - public long getPersistentMemorySize() { - return persistentMemorySize_; - } - - public static final int HOST_TEMP_MEMORY_SIZE_FIELD_NUMBER = 10; - private long hostTempMemorySize_; - /** - * int64 host_temp_memory_size = 10 [deprecated = true]; - */ - @java.lang.Deprecated public long getHostTempMemorySize() { - return hostTempMemorySize_; - } - - public static final int DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER = 11; - private long deviceTempMemorySize_; - /** - * int64 device_temp_memory_size = 11 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemorySize() { - return deviceTempMemorySize_; - } - - public static final int DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 16; - private long devicePersistentMemorySize_; - /** - * int64 device_persistent_memory_size = 16 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemorySize() { - return devicePersistentMemorySize_; - } - - public static final int COMPUTE_COST_FIELD_NUMBER = 9; - private long computeCost_; - /** - *
    -     * Estimate of the computational cost of this node, in microseconds.
    -     * 
    - * - * int64 compute_cost = 9; - */ - public long getComputeCost() { - return computeCost_; - } - - public static final int COMPUTE_TIME_FIELD_NUMBER = 14; - private long computeTime_; - /** - *
    -     * Analytical estimate of the computational cost of this node, in
    -     * microseconds.
    -     * 
    - * - * int64 compute_time = 14; - */ - public long getComputeTime() { - return computeTime_; - } - - public static final int MEMORY_TIME_FIELD_NUMBER = 15; - private long memoryTime_; - /** - *
    -     * Analytical estimate of the memory access cost of this node, in
    -     * microseconds.
    -     * 
    - * - * int64 memory_time = 15; - */ - public long getMemoryTime() { - return memoryTime_; - } - - public static final int IS_FINAL_FIELD_NUMBER = 7; - private boolean isFinal_; - /** - *
    -     * If true, the output is permanent: it can't be discarded, because this
    -     * node is part of the "final output". Nodes may depend on final nodes.
    -     * 
    - * - * bool is_final = 7; - */ - public boolean getIsFinal() { - return isFinal_; - } - - public static final int CONTROL_INPUT_FIELD_NUMBER = 8; - private com.google.protobuf.Internal.IntList controlInput_; - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - public java.util.List - getControlInputList() { - return controlInput_; - } - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - public int getControlInputCount() { - return controlInput_.size(); - } - /** - *
    -     * Ids of the control inputs for this node.
    -     * 
    - * - * repeated int32 control_input = 8; - */ - public int getControlInput(int index) { - return controlInput_.getInt(index); - } - private int controlInputMemoizedSerializedSize = -1; - - public static final int INACCURATE_FIELD_NUMBER = 17; - private boolean inaccurate_; - /** - *
    -     * Are the costs inaccurate?
    -     * 
    - * - * bool inaccurate = 17; - */ - public boolean getInaccurate() { - return inaccurate_; - } - - 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 { - getSerializedSize(); - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, device_); - } - if (id_ != 0) { - output.writeInt32(3, id_); - } - for (int i = 0; i < inputInfo_.size(); i++) { - output.writeMessage(4, inputInfo_.get(i)); - } - for (int i = 0; i < outputInfo_.size(); i++) { - output.writeMessage(5, outputInfo_.get(i)); - } - if (temporaryMemorySize_ != 0L) { - output.writeInt64(6, temporaryMemorySize_); - } - if (isFinal_ != false) { - output.writeBool(7, isFinal_); - } - if (getControlInputList().size() > 0) { - output.writeUInt32NoTag(66); - output.writeUInt32NoTag(controlInputMemoizedSerializedSize); - } - for (int i = 0; i < controlInput_.size(); i++) { - output.writeInt32NoTag(controlInput_.getInt(i)); - } - if (computeCost_ != 0L) { - output.writeInt64(9, computeCost_); - } - if (hostTempMemorySize_ != 0L) { - output.writeInt64(10, hostTempMemorySize_); - } - if (deviceTempMemorySize_ != 0L) { - output.writeInt64(11, deviceTempMemorySize_); - } - if (persistentMemorySize_ != 0L) { - output.writeInt64(12, persistentMemorySize_); - } - if (computeTime_ != 0L) { - output.writeInt64(14, computeTime_); - } - if (memoryTime_ != 0L) { - output.writeInt64(15, memoryTime_); - } - if (devicePersistentMemorySize_ != 0L) { - output.writeInt64(16, devicePersistentMemorySize_); - } - if (inaccurate_ != false) { - output.writeBool(17, inaccurate_); - } - 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 (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, device_); - } - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, id_); - } - for (int i = 0; i < inputInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, inputInfo_.get(i)); - } - for (int i = 0; i < outputInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, outputInfo_.get(i)); - } - if (temporaryMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, temporaryMemorySize_); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, isFinal_); - } - { - int dataSize = 0; - for (int i = 0; i < controlInput_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(controlInput_.getInt(i)); - } - size += dataSize; - if (!getControlInputList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - controlInputMemoizedSerializedSize = dataSize; - } - if (computeCost_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, computeCost_); - } - if (hostTempMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, hostTempMemorySize_); - } - if (deviceTempMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(11, deviceTempMemorySize_); - } - if (persistentMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(12, persistentMemorySize_); - } - if (computeTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(14, computeTime_); - } - if (memoryTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(15, memoryTime_); - } - if (devicePersistentMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(16, devicePersistentMemorySize_); - } - if (inaccurate_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(17, inaccurate_); - } - 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.CostGraphDef.Node)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CostGraphDef.Node other = (org.tensorflow.proto.framework.CostGraphDef.Node) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDevice() - .equals(other.getDevice())) return false; - if (getId() - != other.getId()) return false; - if (!getInputInfoList() - .equals(other.getInputInfoList())) return false; - if (!getOutputInfoList() - .equals(other.getOutputInfoList())) return false; - if (getTemporaryMemorySize() - != other.getTemporaryMemorySize()) return false; - if (getPersistentMemorySize() - != other.getPersistentMemorySize()) return false; - if (getHostTempMemorySize() - != other.getHostTempMemorySize()) return false; - if (getDeviceTempMemorySize() - != other.getDeviceTempMemorySize()) return false; - if (getDevicePersistentMemorySize() - != other.getDevicePersistentMemorySize()) return false; - if (getComputeCost() - != other.getComputeCost()) return false; - if (getComputeTime() - != other.getComputeTime()) return false; - if (getMemoryTime() - != other.getMemoryTime()) return false; - if (getIsFinal() - != other.getIsFinal()) return false; - if (!getControlInputList() - .equals(other.getControlInputList())) return false; - if (getInaccurate() - != other.getInaccurate()) 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_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - if (getInputInfoCount() > 0) { - hash = (37 * hash) + INPUT_INFO_FIELD_NUMBER; - hash = (53 * hash) + getInputInfoList().hashCode(); - } - if (getOutputInfoCount() > 0) { - hash = (37 * hash) + OUTPUT_INFO_FIELD_NUMBER; - hash = (53 * hash) + getOutputInfoList().hashCode(); - } - hash = (37 * hash) + TEMPORARY_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTemporaryMemorySize()); - hash = (37 * hash) + PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPersistentMemorySize()); - hash = (37 * hash) + HOST_TEMP_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getHostTempMemorySize()); - hash = (37 * hash) + DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDeviceTempMemorySize()); - hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDevicePersistentMemorySize()); - hash = (37 * hash) + COMPUTE_COST_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getComputeCost()); - hash = (37 * hash) + COMPUTE_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getComputeTime()); - hash = (37 * hash) + MEMORY_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMemoryTime()); - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsFinal()); - if (getControlInputCount() > 0) { - hash = (37 * hash) + CONTROL_INPUT_FIELD_NUMBER; - hash = (53 * hash) + getControlInputList().hashCode(); - } - hash = (37 * hash) + INACCURATE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getInaccurate()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node 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.CostGraphDef.Node parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node 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.CostGraphDef.Node parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node 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.CostGraphDef.Node parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node 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.CostGraphDef.Node parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.Node 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.CostGraphDef.Node 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.CostGraphDef.Node} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node) - org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.Node.class, org.tensorflow.proto.framework.CostGraphDef.Node.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CostGraphDef.Node.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInputInfoFieldBuilder(); - getOutputInfoFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - device_ = ""; - - id_ = 0; - - if (inputInfoBuilder_ == null) { - inputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - inputInfoBuilder_.clear(); - } - if (outputInfoBuilder_ == null) { - outputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - outputInfoBuilder_.clear(); - } - temporaryMemorySize_ = 0L; - - persistentMemorySize_ = 0L; - - hostTempMemorySize_ = 0L; - - deviceTempMemorySize_ = 0L; - - devicePersistentMemorySize_ = 0L; - - computeCost_ = 0L; - - computeTime_ = 0L; - - memoryTime_ = 0L; - - isFinal_ = false; - - controlInput_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000004); - inaccurate_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CostGraphDef.Node.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node build() { - org.tensorflow.proto.framework.CostGraphDef.Node result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.Node buildPartial() { - org.tensorflow.proto.framework.CostGraphDef.Node result = new org.tensorflow.proto.framework.CostGraphDef.Node(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.device_ = device_; - result.id_ = id_; - if (inputInfoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - inputInfo_ = java.util.Collections.unmodifiableList(inputInfo_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.inputInfo_ = inputInfo_; - } else { - result.inputInfo_ = inputInfoBuilder_.build(); - } - if (outputInfoBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - outputInfo_ = java.util.Collections.unmodifiableList(outputInfo_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.outputInfo_ = outputInfo_; - } else { - result.outputInfo_ = outputInfoBuilder_.build(); - } - result.temporaryMemorySize_ = temporaryMemorySize_; - result.persistentMemorySize_ = persistentMemorySize_; - result.hostTempMemorySize_ = hostTempMemorySize_; - result.deviceTempMemorySize_ = deviceTempMemorySize_; - result.devicePersistentMemorySize_ = devicePersistentMemorySize_; - result.computeCost_ = computeCost_; - result.computeTime_ = computeTime_; - result.memoryTime_ = memoryTime_; - result.isFinal_ = isFinal_; - if (((bitField0_ & 0x00000004) != 0)) { - controlInput_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.controlInput_ = controlInput_; - result.inaccurate_ = inaccurate_; - 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.CostGraphDef.Node) { - return mergeFrom((org.tensorflow.proto.framework.CostGraphDef.Node)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CostGraphDef.Node other) { - if (other == org.tensorflow.proto.framework.CostGraphDef.Node.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - if (other.getId() != 0) { - setId(other.getId()); - } - if (inputInfoBuilder_ == null) { - if (!other.inputInfo_.isEmpty()) { - if (inputInfo_.isEmpty()) { - inputInfo_ = other.inputInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputInfoIsMutable(); - inputInfo_.addAll(other.inputInfo_); - } - onChanged(); - } - } else { - if (!other.inputInfo_.isEmpty()) { - if (inputInfoBuilder_.isEmpty()) { - inputInfoBuilder_.dispose(); - inputInfoBuilder_ = null; - inputInfo_ = other.inputInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - inputInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInputInfoFieldBuilder() : null; - } else { - inputInfoBuilder_.addAllMessages(other.inputInfo_); - } - } - } - if (outputInfoBuilder_ == null) { - if (!other.outputInfo_.isEmpty()) { - if (outputInfo_.isEmpty()) { - outputInfo_ = other.outputInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputInfoIsMutable(); - outputInfo_.addAll(other.outputInfo_); - } - onChanged(); - } - } else { - if (!other.outputInfo_.isEmpty()) { - if (outputInfoBuilder_.isEmpty()) { - outputInfoBuilder_.dispose(); - outputInfoBuilder_ = null; - outputInfo_ = other.outputInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - outputInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutputInfoFieldBuilder() : null; - } else { - outputInfoBuilder_.addAllMessages(other.outputInfo_); - } - } - } - if (other.getTemporaryMemorySize() != 0L) { - setTemporaryMemorySize(other.getTemporaryMemorySize()); - } - if (other.getPersistentMemorySize() != 0L) { - setPersistentMemorySize(other.getPersistentMemorySize()); - } - if (other.getHostTempMemorySize() != 0L) { - setHostTempMemorySize(other.getHostTempMemorySize()); - } - if (other.getDeviceTempMemorySize() != 0L) { - setDeviceTempMemorySize(other.getDeviceTempMemorySize()); - } - if (other.getDevicePersistentMemorySize() != 0L) { - setDevicePersistentMemorySize(other.getDevicePersistentMemorySize()); - } - if (other.getComputeCost() != 0L) { - setComputeCost(other.getComputeCost()); - } - if (other.getComputeTime() != 0L) { - setComputeTime(other.getComputeTime()); - } - if (other.getMemoryTime() != 0L) { - setMemoryTime(other.getMemoryTime()); - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (!other.controlInput_.isEmpty()) { - if (controlInput_.isEmpty()) { - controlInput_ = other.controlInput_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureControlInputIsMutable(); - controlInput_.addAll(other.controlInput_); - } - onChanged(); - } - if (other.getInaccurate() != false) { - setInaccurate(other.getInaccurate()); - } - 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.CostGraphDef.Node parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CostGraphDef.Node) 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 node. Names are globally unique.
    -       * 
    - * - * 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 node. Names are globally unique.
    -       * 
    - * - * 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 node. Names are globally unique.
    -       * 
    - * - * 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 node. Names are globally unique.
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * The name of the node. Names are globally unique.
    -       * 
    - * - * 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 java.lang.Object device_ = ""; - /** - *
    -       * The device of the node. Can be empty if the node is mapped to the
    -       * default partition or partitioning hasn't been run yet.
    -       * 
    - * - * string device = 2; - */ - 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; - } - } - /** - *
    -       * The device of the node. Can be empty if the node is mapped to the
    -       * default partition or partitioning hasn't been run yet.
    -       * 
    - * - * string device = 2; - */ - 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; - } - } - /** - *
    -       * The device of the node. Can be empty if the node is mapped to the
    -       * default partition or partitioning hasn't been run yet.
    -       * 
    - * - * string device = 2; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - *
    -       * The device of the node. Can be empty if the node is mapped to the
    -       * default partition or partitioning hasn't been run yet.
    -       * 
    - * - * string device = 2; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -       * The device of the node. Can be empty if the node is mapped to the
    -       * default partition or partitioning hasn't been run yet.
    -       * 
    - * - * string device = 2; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - onChanged(); - return this; - } - - private int id_ ; - /** - *
    -       * The id of the node. Node ids are only unique inside a partition.
    -       * 
    - * - * int32 id = 3; - */ - public int getId() { - return id_; - } - /** - *
    -       * The id of the node. Node ids are only unique inside a partition.
    -       * 
    - * - * int32 id = 3; - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
    -       * The id of the node. Node ids are only unique inside a partition.
    -       * 
    - * - * int32 id = 3; - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private java.util.List inputInfo_ = - java.util.Collections.emptyList(); - private void ensureInputInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - inputInfo_ = new java.util.ArrayList(inputInfo_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder> inputInfoBuilder_; - - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public java.util.List getInputInfoList() { - if (inputInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(inputInfo_); - } else { - return inputInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public int getInputInfoCount() { - if (inputInfoBuilder_ == null) { - return inputInfo_.size(); - } else { - return inputInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo getInputInfo(int index) { - if (inputInfoBuilder_ == null) { - return inputInfo_.get(index); - } else { - return inputInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder setInputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo value) { - if (inputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputInfoIsMutable(); - inputInfo_.set(index, value); - onChanged(); - } else { - inputInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder setInputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder builderForValue) { - if (inputInfoBuilder_ == null) { - ensureInputInfoIsMutable(); - inputInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - inputInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder addInputInfo(org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo value) { - if (inputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputInfoIsMutable(); - inputInfo_.add(value); - onChanged(); - } else { - inputInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder addInputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo value) { - if (inputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputInfoIsMutable(); - inputInfo_.add(index, value); - onChanged(); - } else { - inputInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder addInputInfo( - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder builderForValue) { - if (inputInfoBuilder_ == null) { - ensureInputInfoIsMutable(); - inputInfo_.add(builderForValue.build()); - onChanged(); - } else { - inputInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder addInputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder builderForValue) { - if (inputInfoBuilder_ == null) { - ensureInputInfoIsMutable(); - inputInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - inputInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder addAllInputInfo( - java.lang.Iterable values) { - if (inputInfoBuilder_ == null) { - ensureInputInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputInfo_); - onChanged(); - } else { - inputInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder clearInputInfo() { - if (inputInfoBuilder_ == null) { - inputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - inputInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public Builder removeInputInfo(int index) { - if (inputInfoBuilder_ == null) { - ensureInputInfoIsMutable(); - inputInfo_.remove(index); - onChanged(); - } else { - inputInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder getInputInfoBuilder( - int index) { - return getInputInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( - int index) { - if (inputInfoBuilder_ == null) { - return inputInfo_.get(index); } else { - return inputInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public java.util.List - getInputInfoOrBuilderList() { - if (inputInfoBuilder_ != null) { - return inputInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inputInfo_); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder addInputInfoBuilder() { - return getInputInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder addInputInfoBuilder( - int index) { - return getInputInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; - */ - public java.util.List - getInputInfoBuilderList() { - return getInputInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder> - getInputInfoFieldBuilder() { - if (inputInfoBuilder_ == null) { - inputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.InputInfoOrBuilder>( - inputInfo_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - inputInfo_ = null; - } - return inputInfoBuilder_; - } - - private java.util.List outputInfo_ = - java.util.Collections.emptyList(); - private void ensureOutputInfoIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - outputInfo_ = new java.util.ArrayList(outputInfo_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder> outputInfoBuilder_; - - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public java.util.List getOutputInfoList() { - if (outputInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(outputInfo_); - } else { - return outputInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public int getOutputInfoCount() { - if (outputInfoBuilder_ == null) { - return outputInfo_.size(); - } else { - return outputInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo getOutputInfo(int index) { - if (outputInfoBuilder_ == null) { - return outputInfo_.get(index); - } else { - return outputInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder setOutputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo value) { - if (outputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputInfoIsMutable(); - outputInfo_.set(index, value); - onChanged(); - } else { - outputInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder setOutputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder builderForValue) { - if (outputInfoBuilder_ == null) { - ensureOutputInfoIsMutable(); - outputInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - outputInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder addOutputInfo(org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo value) { - if (outputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputInfoIsMutable(); - outputInfo_.add(value); - onChanged(); - } else { - outputInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder addOutputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo value) { - if (outputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputInfoIsMutable(); - outputInfo_.add(index, value); - onChanged(); - } else { - outputInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder addOutputInfo( - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder builderForValue) { - if (outputInfoBuilder_ == null) { - ensureOutputInfoIsMutable(); - outputInfo_.add(builderForValue.build()); - onChanged(); - } else { - outputInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder addOutputInfo( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder builderForValue) { - if (outputInfoBuilder_ == null) { - ensureOutputInfoIsMutable(); - outputInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - outputInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder addAllOutputInfo( - java.lang.Iterable values) { - if (outputInfoBuilder_ == null) { - ensureOutputInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputInfo_); - onChanged(); - } else { - outputInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder clearOutputInfo() { - if (outputInfoBuilder_ == null) { - outputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - outputInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public Builder removeOutputInfo(int index) { - if (outputInfoBuilder_ == null) { - ensureOutputInfoIsMutable(); - outputInfo_.remove(index); - onChanged(); - } else { - outputInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder getOutputInfoBuilder( - int index) { - return getOutputInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( - int index) { - if (outputInfoBuilder_ == null) { - return outputInfo_.get(index); } else { - return outputInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public java.util.List - getOutputInfoOrBuilderList() { - if (outputInfoBuilder_ != null) { - return outputInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outputInfo_); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder addOutputInfoBuilder() { - return getOutputInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder addOutputInfoBuilder( - int index) { - return getOutputInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; - */ - public java.util.List - getOutputInfoBuilderList() { - return getOutputInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder> - getOutputInfoFieldBuilder() { - if (outputInfoBuilder_ == null) { - outputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.framework.CostGraphDef.Node.OutputInfoOrBuilder>( - outputInfo_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - outputInfo_ = null; - } - return outputInfoBuilder_; - } - - private long temporaryMemorySize_ ; - /** - *
    -       * Temporary memory used by this node.
    -       * 
    - * - * int64 temporary_memory_size = 6; - */ - public long getTemporaryMemorySize() { - return temporaryMemorySize_; - } - /** - *
    -       * Temporary memory used by this node.
    -       * 
    - * - * int64 temporary_memory_size = 6; - */ - public Builder setTemporaryMemorySize(long value) { - - temporaryMemorySize_ = value; - onChanged(); - return this; - } - /** - *
    -       * Temporary memory used by this node.
    -       * 
    - * - * int64 temporary_memory_size = 6; - */ - public Builder clearTemporaryMemorySize() { - - temporaryMemorySize_ = 0L; - onChanged(); - return this; - } - - private long persistentMemorySize_ ; - /** - *
    -       * Persistent memory used by this node.
    -       * 
    - * - * int64 persistent_memory_size = 12; - */ - public long getPersistentMemorySize() { - return persistentMemorySize_; - } - /** - *
    -       * Persistent memory used by this node.
    -       * 
    - * - * int64 persistent_memory_size = 12; - */ - public Builder setPersistentMemorySize(long value) { - - persistentMemorySize_ = value; - onChanged(); - return this; - } - /** - *
    -       * Persistent memory used by this node.
    -       * 
    - * - * int64 persistent_memory_size = 12; - */ - public Builder clearPersistentMemorySize() { - - persistentMemorySize_ = 0L; - onChanged(); - return this; - } - - private long hostTempMemorySize_ ; - /** - * int64 host_temp_memory_size = 10 [deprecated = true]; - */ - @java.lang.Deprecated public long getHostTempMemorySize() { - return hostTempMemorySize_; - } - /** - * int64 host_temp_memory_size = 10 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setHostTempMemorySize(long value) { - - hostTempMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 host_temp_memory_size = 10 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearHostTempMemorySize() { - - hostTempMemorySize_ = 0L; - onChanged(); - return this; - } - - private long deviceTempMemorySize_ ; - /** - * int64 device_temp_memory_size = 11 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemorySize() { - return deviceTempMemorySize_; - } - /** - * int64 device_temp_memory_size = 11 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDeviceTempMemorySize(long value) { - - deviceTempMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 device_temp_memory_size = 11 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDeviceTempMemorySize() { - - deviceTempMemorySize_ = 0L; - onChanged(); - return this; - } - - private long devicePersistentMemorySize_ ; - /** - * int64 device_persistent_memory_size = 16 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemorySize() { - return devicePersistentMemorySize_; - } - /** - * int64 device_persistent_memory_size = 16 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDevicePersistentMemorySize(long value) { - - devicePersistentMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 device_persistent_memory_size = 16 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDevicePersistentMemorySize() { - - devicePersistentMemorySize_ = 0L; - onChanged(); - return this; - } - - private long computeCost_ ; - /** - *
    -       * Estimate of the computational cost of this node, in microseconds.
    -       * 
    - * - * int64 compute_cost = 9; - */ - public long getComputeCost() { - return computeCost_; - } - /** - *
    -       * Estimate of the computational cost of this node, in microseconds.
    -       * 
    - * - * int64 compute_cost = 9; - */ - public Builder setComputeCost(long value) { - - computeCost_ = value; - onChanged(); - return this; - } - /** - *
    -       * Estimate of the computational cost of this node, in microseconds.
    -       * 
    - * - * int64 compute_cost = 9; - */ - public Builder clearComputeCost() { - - computeCost_ = 0L; - onChanged(); - return this; - } - - private long computeTime_ ; - /** - *
    -       * Analytical estimate of the computational cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 compute_time = 14; - */ - public long getComputeTime() { - return computeTime_; - } - /** - *
    -       * Analytical estimate of the computational cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 compute_time = 14; - */ - public Builder setComputeTime(long value) { - - computeTime_ = value; - onChanged(); - return this; - } - /** - *
    -       * Analytical estimate of the computational cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 compute_time = 14; - */ - public Builder clearComputeTime() { - - computeTime_ = 0L; - onChanged(); - return this; - } - - private long memoryTime_ ; - /** - *
    -       * Analytical estimate of the memory access cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 memory_time = 15; - */ - public long getMemoryTime() { - return memoryTime_; - } - /** - *
    -       * Analytical estimate of the memory access cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 memory_time = 15; - */ - public Builder setMemoryTime(long value) { - - memoryTime_ = value; - onChanged(); - return this; - } - /** - *
    -       * Analytical estimate of the memory access cost of this node, in
    -       * microseconds.
    -       * 
    - * - * int64 memory_time = 15; - */ - public Builder clearMemoryTime() { - - memoryTime_ = 0L; - onChanged(); - return this; - } - - private boolean isFinal_ ; - /** - *
    -       * If true, the output is permanent: it can't be discarded, because this
    -       * node is part of the "final output". Nodes may depend on final nodes.
    -       * 
    - * - * bool is_final = 7; - */ - public boolean getIsFinal() { - return isFinal_; - } - /** - *
    -       * If true, the output is permanent: it can't be discarded, because this
    -       * node is part of the "final output". Nodes may depend on final nodes.
    -       * 
    - * - * bool is_final = 7; - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, the output is permanent: it can't be discarded, because this
    -       * node is part of the "final output". Nodes may depend on final nodes.
    -       * 
    - * - * bool is_final = 7; - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList controlInput_ = emptyIntList(); - private void ensureControlInputIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - controlInput_ = mutableCopy(controlInput_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public java.util.List - getControlInputList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(controlInput_) : controlInput_; - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public int getControlInputCount() { - return controlInput_.size(); - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public int getControlInput(int index) { - return controlInput_.getInt(index); - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public Builder setControlInput( - int index, int value) { - ensureControlInputIsMutable(); - controlInput_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public Builder addControlInput(int value) { - ensureControlInputIsMutable(); - controlInput_.addInt(value); - onChanged(); - return this; - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public Builder addAllControlInput( - java.lang.Iterable values) { - ensureControlInputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, controlInput_); - onChanged(); - return this; - } - /** - *
    -       * Ids of the control inputs for this node.
    -       * 
    - * - * repeated int32 control_input = 8; - */ - public Builder clearControlInput() { - controlInput_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private boolean inaccurate_ ; - /** - *
    -       * Are the costs inaccurate?
    -       * 
    - * - * bool inaccurate = 17; - */ - public boolean getInaccurate() { - return inaccurate_; - } - /** - *
    -       * Are the costs inaccurate?
    -       * 
    - * - * bool inaccurate = 17; - */ - public Builder setInaccurate(boolean value) { - - inaccurate_ = value; - onChanged(); - return this; - } - /** - *
    -       * Are the costs inaccurate?
    -       * 
    - * - * bool inaccurate = 17; - */ - public Builder clearInaccurate() { - - inaccurate_ = false; - 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.CostGraphDef.Node) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node) - private static final org.tensorflow.proto.framework.CostGraphDef.Node DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CostGraphDef.Node(); - } - - public static org.tensorflow.proto.framework.CostGraphDef.Node getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Node parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Node(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.CostGraphDef.Node getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AggregatedCostOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.AggregatedCost) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Aggregated cost value.
    -     * 
    - * - * float cost = 1; - */ - float getCost(); - - /** - *
    -     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -     * 
    - * - * string dimension = 2; - */ - java.lang.String getDimension(); - /** - *
    -     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -     * 
    - * - * string dimension = 2; - */ - com.google.protobuf.ByteString - getDimensionBytes(); - } - /** - *
    -   * Total cost of this graph, typically used for balancing decisions.
    -   * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.AggregatedCost} - */ - public static final class AggregatedCost extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.AggregatedCost) - AggregatedCostOrBuilder { - private static final long serialVersionUID = 0L; - // Use AggregatedCost.newBuilder() to construct. - private AggregatedCost(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AggregatedCost() { - dimension_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AggregatedCost(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AggregatedCost( - 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 13: { - - cost_ = input.readFloat(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - dimension_ = s; - 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.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.class, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder.class); - } - - public static final int COST_FIELD_NUMBER = 1; - private float cost_; - /** - *
    -     * Aggregated cost value.
    -     * 
    - * - * float cost = 1; - */ - public float getCost() { - return cost_; - } - - public static final int DIMENSION_FIELD_NUMBER = 2; - private volatile java.lang.Object dimension_; - /** - *
    -     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -     * 
    - * - * string dimension = 2; - */ - public java.lang.String getDimension() { - java.lang.Object ref = dimension_; - 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(); - dimension_ = s; - return s; - } - } - /** - *
    -     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -     * 
    - * - * string dimension = 2; - */ - public com.google.protobuf.ByteString - getDimensionBytes() { - java.lang.Object ref = dimension_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dimension_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (cost_ != 0F) { - output.writeFloat(1, cost_); - } - if (!getDimensionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dimension_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (cost_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(1, cost_); - } - if (!getDimensionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dimension_); - } - 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.CostGraphDef.AggregatedCost)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost other = (org.tensorflow.proto.framework.CostGraphDef.AggregatedCost) obj; - - if (java.lang.Float.floatToIntBits(getCost()) - != java.lang.Float.floatToIntBits( - other.getCost())) return false; - if (!getDimension() - .equals(other.getDimension())) 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) + COST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getCost()); - hash = (37 * hash) + DIMENSION_FIELD_NUMBER; - hash = (53 * hash) + getDimension().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost 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; - } - /** - *
    -     * Total cost of this graph, typically used for balancing decisions.
    -     * 
    - * - * Protobuf type {@code tensorflow.CostGraphDef.AggregatedCost} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.AggregatedCost) - org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.class, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.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(); - cost_ = 0F; - - dimension_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost build() { - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost buildPartial() { - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost result = new org.tensorflow.proto.framework.CostGraphDef.AggregatedCost(this); - result.cost_ = cost_; - result.dimension_ = dimension_; - 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.CostGraphDef.AggregatedCost) { - return mergeFrom((org.tensorflow.proto.framework.CostGraphDef.AggregatedCost)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CostGraphDef.AggregatedCost other) { - if (other == org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.getDefaultInstance()) return this; - if (other.getCost() != 0F) { - setCost(other.getCost()); - } - if (!other.getDimension().isEmpty()) { - dimension_ = other.dimension_; - onChanged(); - } - 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.CostGraphDef.AggregatedCost parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CostGraphDef.AggregatedCost) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private float cost_ ; - /** - *
    -       * Aggregated cost value.
    -       * 
    - * - * float cost = 1; - */ - public float getCost() { - return cost_; - } - /** - *
    -       * Aggregated cost value.
    -       * 
    - * - * float cost = 1; - */ - public Builder setCost(float value) { - - cost_ = value; - onChanged(); - return this; - } - /** - *
    -       * Aggregated cost value.
    -       * 
    - * - * float cost = 1; - */ - public Builder clearCost() { - - cost_ = 0F; - onChanged(); - return this; - } - - private java.lang.Object dimension_ = ""; - /** - *
    -       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -       * 
    - * - * string dimension = 2; - */ - public java.lang.String getDimension() { - java.lang.Object ref = dimension_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - dimension_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -       * 
    - * - * string dimension = 2; - */ - public com.google.protobuf.ByteString - getDimensionBytes() { - java.lang.Object ref = dimension_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dimension_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -       * 
    - * - * string dimension = 2; - */ - public Builder setDimension( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - dimension_ = value; - onChanged(); - return this; - } - /** - *
    -       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -       * 
    - * - * string dimension = 2; - */ - public Builder clearDimension() { - - dimension_ = getDefaultInstance().getDimension(); - onChanged(); - return this; - } - /** - *
    -       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    -       * 
    - * - * string dimension = 2; - */ - public Builder setDimensionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - dimension_ = value; - 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.CostGraphDef.AggregatedCost) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.AggregatedCost) - private static final org.tensorflow.proto.framework.CostGraphDef.AggregatedCost DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CostGraphDef.AggregatedCost(); - } - - public static org.tensorflow.proto.framework.CostGraphDef.AggregatedCost getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AggregatedCost parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AggregatedCost(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.CostGraphDef.AggregatedCost getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NODE_FIELD_NUMBER = 1; - private java.util.List node_; - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public java.util.List getNodeList() { - return node_; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public java.util.List - getNodeOrBuilderList() { - return node_; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public int getNodeCount() { - return node_.size(); - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node getNode(int index) { - return node_.get(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder getNodeOrBuilder( - int index) { - return node_.get(index); - } - - public static final int COST_FIELD_NUMBER = 2; - private java.util.List cost_; - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public java.util.List getCostList() { - return cost_; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public java.util.List - getCostOrBuilderList() { - return cost_; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public int getCostCount() { - return cost_.size(); - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost getCost(int index) { - return cost_.get(index); - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( - int index) { - return cost_.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 { - for (int i = 0; i < node_.size(); i++) { - output.writeMessage(1, node_.get(i)); - } - for (int i = 0; i < cost_.size(); i++) { - output.writeMessage(2, cost_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < node_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, node_.get(i)); - } - for (int i = 0; i < cost_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, cost_.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.CostGraphDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.CostGraphDef other = (org.tensorflow.proto.framework.CostGraphDef) obj; - - if (!getNodeList() - .equals(other.getNodeList())) return false; - if (!getCostList() - .equals(other.getCostList())) 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 (getNodeCount() > 0) { - hash = (37 * hash) + NODE_FIELD_NUMBER; - hash = (53 * hash) + getNodeList().hashCode(); - } - if (getCostCount() > 0) { - hash = (37 * hash) + COST_FIELD_NUMBER; - hash = (53 * hash) + getCostList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.CostGraphDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef 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.CostGraphDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef 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.CostGraphDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.CostGraphDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.CostGraphDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef 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.CostGraphDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef 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.CostGraphDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.CostGraphDef 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.CostGraphDef 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.CostGraphDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef) - org.tensorflow.proto.framework.CostGraphDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.CostGraphDef.class, org.tensorflow.proto.framework.CostGraphDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.CostGraphDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeFieldBuilder(); - getCostFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (nodeBuilder_ == null) { - node_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodeBuilder_.clear(); - } - if (costBuilder_ == null) { - cost_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - costBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.CostGraphDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef build() { - org.tensorflow.proto.framework.CostGraphDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.CostGraphDef buildPartial() { - org.tensorflow.proto.framework.CostGraphDef result = new org.tensorflow.proto.framework.CostGraphDef(this); - int from_bitField0_ = bitField0_; - if (nodeBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - node_ = java.util.Collections.unmodifiableList(node_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.node_ = node_; - } else { - result.node_ = nodeBuilder_.build(); - } - if (costBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - cost_ = java.util.Collections.unmodifiableList(cost_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.cost_ = cost_; - } else { - result.cost_ = costBuilder_.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.CostGraphDef) { - return mergeFrom((org.tensorflow.proto.framework.CostGraphDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.CostGraphDef other) { - if (other == org.tensorflow.proto.framework.CostGraphDef.getDefaultInstance()) return this; - if (nodeBuilder_ == null) { - if (!other.node_.isEmpty()) { - if (node_.isEmpty()) { - node_ = other.node_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodeIsMutable(); - node_.addAll(other.node_); - } - onChanged(); - } - } else { - if (!other.node_.isEmpty()) { - if (nodeBuilder_.isEmpty()) { - nodeBuilder_.dispose(); - nodeBuilder_ = null; - node_ = other.node_; - bitField0_ = (bitField0_ & ~0x00000001); - nodeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeFieldBuilder() : null; - } else { - nodeBuilder_.addAllMessages(other.node_); - } - } - } - if (costBuilder_ == null) { - if (!other.cost_.isEmpty()) { - if (cost_.isEmpty()) { - cost_ = other.cost_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureCostIsMutable(); - cost_.addAll(other.cost_); - } - onChanged(); - } - } else { - if (!other.cost_.isEmpty()) { - if (costBuilder_.isEmpty()) { - costBuilder_.dispose(); - costBuilder_ = null; - cost_ = other.cost_; - bitField0_ = (bitField0_ & ~0x00000002); - costBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCostFieldBuilder() : null; - } else { - costBuilder_.addAllMessages(other.cost_); - } - } - } - 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.CostGraphDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.CostGraphDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List node_ = - java.util.Collections.emptyList(); - private void ensureNodeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - node_ = new java.util.ArrayList(node_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node, org.tensorflow.proto.framework.CostGraphDef.Node.Builder, org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder> nodeBuilder_; - - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public java.util.List getNodeList() { - if (nodeBuilder_ == null) { - return java.util.Collections.unmodifiableList(node_); - } else { - return nodeBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public int getNodeCount() { - if (nodeBuilder_ == null) { - return node_.size(); - } else { - return nodeBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node getNode(int index) { - if (nodeBuilder_ == null) { - return node_.get(index); - } else { - return nodeBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder setNode( - int index, org.tensorflow.proto.framework.CostGraphDef.Node value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.set(index, value); - onChanged(); - } else { - nodeBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder setNode( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder addNode(org.tensorflow.proto.framework.CostGraphDef.Node value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.add(value); - onChanged(); - } else { - nodeBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder addNode( - int index, org.tensorflow.proto.framework.CostGraphDef.Node value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.add(index, value); - onChanged(); - } else { - nodeBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder addNode( - org.tensorflow.proto.framework.CostGraphDef.Node.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.add(builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder addNode( - int index, org.tensorflow.proto.framework.CostGraphDef.Node.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder addAllNode( - java.lang.Iterable values) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, node_); - onChanged(); - } else { - nodeBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder clearNode() { - if (nodeBuilder_ == null) { - node_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodeBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public Builder removeNode(int index) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.remove(index); - onChanged(); - } else { - nodeBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.Builder getNodeBuilder( - int index) { - return getNodeFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder getNodeOrBuilder( - int index) { - if (nodeBuilder_ == null) { - return node_.get(index); } else { - return nodeBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public java.util.List - getNodeOrBuilderList() { - if (nodeBuilder_ != null) { - return nodeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(node_); - } - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.Builder addNodeBuilder() { - return getNodeFieldBuilder().addBuilder( - org.tensorflow.proto.framework.CostGraphDef.Node.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public org.tensorflow.proto.framework.CostGraphDef.Node.Builder addNodeBuilder( - int index) { - return getNodeFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.CostGraphDef.Node.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - public java.util.List - getNodeBuilderList() { - return getNodeFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node, org.tensorflow.proto.framework.CostGraphDef.Node.Builder, org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder> - getNodeFieldBuilder() { - if (nodeBuilder_ == null) { - nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.Node, org.tensorflow.proto.framework.CostGraphDef.Node.Builder, org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder>( - node_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - node_ = null; - } - return nodeBuilder_; - } - - private java.util.List cost_ = - java.util.Collections.emptyList(); - private void ensureCostIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - cost_ = new java.util.ArrayList(cost_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder> costBuilder_; - - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public java.util.List getCostList() { - if (costBuilder_ == null) { - return java.util.Collections.unmodifiableList(cost_); - } else { - return costBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public int getCostCount() { - if (costBuilder_ == null) { - return cost_.size(); - } else { - return costBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost getCost(int index) { - if (costBuilder_ == null) { - return cost_.get(index); - } else { - return costBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder setCost( - int index, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost value) { - if (costBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCostIsMutable(); - cost_.set(index, value); - onChanged(); - } else { - costBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder setCost( - int index, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder builderForValue) { - if (costBuilder_ == null) { - ensureCostIsMutable(); - cost_.set(index, builderForValue.build()); - onChanged(); - } else { - costBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder addCost(org.tensorflow.proto.framework.CostGraphDef.AggregatedCost value) { - if (costBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCostIsMutable(); - cost_.add(value); - onChanged(); - } else { - costBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder addCost( - int index, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost value) { - if (costBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCostIsMutable(); - cost_.add(index, value); - onChanged(); - } else { - costBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder addCost( - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder builderForValue) { - if (costBuilder_ == null) { - ensureCostIsMutable(); - cost_.add(builderForValue.build()); - onChanged(); - } else { - costBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder addCost( - int index, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder builderForValue) { - if (costBuilder_ == null) { - ensureCostIsMutable(); - cost_.add(index, builderForValue.build()); - onChanged(); - } else { - costBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder addAllCost( - java.lang.Iterable values) { - if (costBuilder_ == null) { - ensureCostIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, cost_); - onChanged(); - } else { - costBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder clearCost() { - if (costBuilder_ == null) { - cost_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - costBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public Builder removeCost(int index) { - if (costBuilder_ == null) { - ensureCostIsMutable(); - cost_.remove(index); - onChanged(); - } else { - costBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder getCostBuilder( - int index) { - return getCostFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( - int index) { - if (costBuilder_ == null) { - return cost_.get(index); } else { - return costBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public java.util.List - getCostOrBuilderList() { - if (costBuilder_ != null) { - return costBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(cost_); - } - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder addCostBuilder() { - return getCostFieldBuilder().addBuilder( - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder addCostBuilder( - int index) { - return getCostFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.getDefaultInstance()); - } - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - public java.util.List - getCostBuilderList() { - return getCostFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder> - getCostFieldBuilder() { - if (costBuilder_ == null) { - costBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost, org.tensorflow.proto.framework.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder>( - cost_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - cost_ = null; - } - return costBuilder_; - } - @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.CostGraphDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef) - private static final org.tensorflow.proto.framework.CostGraphDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.CostGraphDef(); - } - - public static org.tensorflow.proto.framework.CostGraphDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CostGraphDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CostGraphDef(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.CostGraphDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDefOrBuilder.java deleted file mode 100644 index 7d8046a5e27..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphDefOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/cost_graph.proto - -package org.tensorflow.proto.framework; - -public interface CostGraphDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - java.util.List - getNodeList(); - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - org.tensorflow.proto.framework.CostGraphDef.Node getNode(int index); - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - int getNodeCount(); - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - java.util.List - getNodeOrBuilderList(); - /** - * repeated .tensorflow.CostGraphDef.Node node = 1; - */ - org.tensorflow.proto.framework.CostGraphDef.NodeOrBuilder getNodeOrBuilder( - int index); - - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - java.util.List - getCostList(); - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - org.tensorflow.proto.framework.CostGraphDef.AggregatedCost getCost(int index); - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - int getCostCount(); - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - java.util.List - getCostOrBuilderList(); - /** - * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; - */ - org.tensorflow.proto.framework.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataType.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataType.java deleted file mode 100644 index 6b836c8353a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataType.java +++ /dev/null @@ -1,615 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/types.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * (== suppress_warning documentation-presence ==)
    - * LINT.IfChange
    - * 
    - * - * Protobuf enum {@code tensorflow.DataType} - */ -public enum DataType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -   * Not a legal value for DataType.  Used to indicate a DataType field
    -   * has not been set.
    -   * 
    - * - * DT_INVALID = 0; - */ - DT_INVALID(0), - /** - *
    -   * Data types that all computation devices are expected to be
    -   * capable to support.
    -   * 
    - * - * DT_FLOAT = 1; - */ - DT_FLOAT(1), - /** - * DT_DOUBLE = 2; - */ - DT_DOUBLE(2), - /** - * DT_INT32 = 3; - */ - DT_INT32(3), - /** - * DT_UINT8 = 4; - */ - DT_UINT8(4), - /** - * DT_INT16 = 5; - */ - DT_INT16(5), - /** - * DT_INT8 = 6; - */ - DT_INT8(6), - /** - * DT_STRING = 7; - */ - DT_STRING(7), - /** - *
    -   * Single-precision complex
    -   * 
    - * - * DT_COMPLEX64 = 8; - */ - DT_COMPLEX64(8), - /** - * DT_INT64 = 9; - */ - DT_INT64(9), - /** - * DT_BOOL = 10; - */ - DT_BOOL(10), - /** - *
    -   * Quantized int8
    -   * 
    - * - * DT_QINT8 = 11; - */ - DT_QINT8(11), - /** - *
    -   * Quantized uint8
    -   * 
    - * - * DT_QUINT8 = 12; - */ - DT_QUINT8(12), - /** - *
    -   * Quantized int32
    -   * 
    - * - * DT_QINT32 = 13; - */ - DT_QINT32(13), - /** - *
    -   * Float32 truncated to 16 bits.  Only for cast ops.
    -   * 
    - * - * DT_BFLOAT16 = 14; - */ - DT_BFLOAT16(14), - /** - *
    -   * Quantized int16
    -   * 
    - * - * DT_QINT16 = 15; - */ - DT_QINT16(15), - /** - *
    -   * Quantized uint16
    -   * 
    - * - * DT_QUINT16 = 16; - */ - DT_QUINT16(16), - /** - * DT_UINT16 = 17; - */ - DT_UINT16(17), - /** - *
    -   * Double-precision complex
    -   * 
    - * - * DT_COMPLEX128 = 18; - */ - DT_COMPLEX128(18), - /** - * DT_HALF = 19; - */ - DT_HALF(19), - /** - * DT_RESOURCE = 20; - */ - DT_RESOURCE(20), - /** - *
    -   * Arbitrary C++ data types
    -   * 
    - * - * DT_VARIANT = 21; - */ - DT_VARIANT(21), - /** - * DT_UINT32 = 22; - */ - DT_UINT32(22), - /** - * DT_UINT64 = 23; - */ - DT_UINT64(23), - /** - *
    -   * Do not use!  These are only for parameters.  Every enum above
    -   * should have a corresponding value below (verified by types_test).
    -   * 
    - * - * DT_FLOAT_REF = 101; - */ - DT_FLOAT_REF(101), - /** - * DT_DOUBLE_REF = 102; - */ - DT_DOUBLE_REF(102), - /** - * DT_INT32_REF = 103; - */ - DT_INT32_REF(103), - /** - * DT_UINT8_REF = 104; - */ - DT_UINT8_REF(104), - /** - * DT_INT16_REF = 105; - */ - DT_INT16_REF(105), - /** - * DT_INT8_REF = 106; - */ - DT_INT8_REF(106), - /** - * DT_STRING_REF = 107; - */ - DT_STRING_REF(107), - /** - * DT_COMPLEX64_REF = 108; - */ - DT_COMPLEX64_REF(108), - /** - * DT_INT64_REF = 109; - */ - DT_INT64_REF(109), - /** - * DT_BOOL_REF = 110; - */ - DT_BOOL_REF(110), - /** - * DT_QINT8_REF = 111; - */ - DT_QINT8_REF(111), - /** - * DT_QUINT8_REF = 112; - */ - DT_QUINT8_REF(112), - /** - * DT_QINT32_REF = 113; - */ - DT_QINT32_REF(113), - /** - * DT_BFLOAT16_REF = 114; - */ - DT_BFLOAT16_REF(114), - /** - * DT_QINT16_REF = 115; - */ - DT_QINT16_REF(115), - /** - * DT_QUINT16_REF = 116; - */ - DT_QUINT16_REF(116), - /** - * DT_UINT16_REF = 117; - */ - DT_UINT16_REF(117), - /** - * DT_COMPLEX128_REF = 118; - */ - DT_COMPLEX128_REF(118), - /** - * DT_HALF_REF = 119; - */ - DT_HALF_REF(119), - /** - * DT_RESOURCE_REF = 120; - */ - DT_RESOURCE_REF(120), - /** - * DT_VARIANT_REF = 121; - */ - DT_VARIANT_REF(121), - /** - * DT_UINT32_REF = 122; - */ - DT_UINT32_REF(122), - /** - * DT_UINT64_REF = 123; - */ - DT_UINT64_REF(123), - UNRECOGNIZED(-1), - ; - - /** - *
    -   * Not a legal value for DataType.  Used to indicate a DataType field
    -   * has not been set.
    -   * 
    - * - * DT_INVALID = 0; - */ - public static final int DT_INVALID_VALUE = 0; - /** - *
    -   * Data types that all computation devices are expected to be
    -   * capable to support.
    -   * 
    - * - * DT_FLOAT = 1; - */ - public static final int DT_FLOAT_VALUE = 1; - /** - * DT_DOUBLE = 2; - */ - public static final int DT_DOUBLE_VALUE = 2; - /** - * DT_INT32 = 3; - */ - public static final int DT_INT32_VALUE = 3; - /** - * DT_UINT8 = 4; - */ - public static final int DT_UINT8_VALUE = 4; - /** - * DT_INT16 = 5; - */ - public static final int DT_INT16_VALUE = 5; - /** - * DT_INT8 = 6; - */ - public static final int DT_INT8_VALUE = 6; - /** - * DT_STRING = 7; - */ - public static final int DT_STRING_VALUE = 7; - /** - *
    -   * Single-precision complex
    -   * 
    - * - * DT_COMPLEX64 = 8; - */ - public static final int DT_COMPLEX64_VALUE = 8; - /** - * DT_INT64 = 9; - */ - public static final int DT_INT64_VALUE = 9; - /** - * DT_BOOL = 10; - */ - public static final int DT_BOOL_VALUE = 10; - /** - *
    -   * Quantized int8
    -   * 
    - * - * DT_QINT8 = 11; - */ - public static final int DT_QINT8_VALUE = 11; - /** - *
    -   * Quantized uint8
    -   * 
    - * - * DT_QUINT8 = 12; - */ - public static final int DT_QUINT8_VALUE = 12; - /** - *
    -   * Quantized int32
    -   * 
    - * - * DT_QINT32 = 13; - */ - public static final int DT_QINT32_VALUE = 13; - /** - *
    -   * Float32 truncated to 16 bits.  Only for cast ops.
    -   * 
    - * - * DT_BFLOAT16 = 14; - */ - public static final int DT_BFLOAT16_VALUE = 14; - /** - *
    -   * Quantized int16
    -   * 
    - * - * DT_QINT16 = 15; - */ - public static final int DT_QINT16_VALUE = 15; - /** - *
    -   * Quantized uint16
    -   * 
    - * - * DT_QUINT16 = 16; - */ - public static final int DT_QUINT16_VALUE = 16; - /** - * DT_UINT16 = 17; - */ - public static final int DT_UINT16_VALUE = 17; - /** - *
    -   * Double-precision complex
    -   * 
    - * - * DT_COMPLEX128 = 18; - */ - public static final int DT_COMPLEX128_VALUE = 18; - /** - * DT_HALF = 19; - */ - public static final int DT_HALF_VALUE = 19; - /** - * DT_RESOURCE = 20; - */ - public static final int DT_RESOURCE_VALUE = 20; - /** - *
    -   * Arbitrary C++ data types
    -   * 
    - * - * DT_VARIANT = 21; - */ - public static final int DT_VARIANT_VALUE = 21; - /** - * DT_UINT32 = 22; - */ - public static final int DT_UINT32_VALUE = 22; - /** - * DT_UINT64 = 23; - */ - public static final int DT_UINT64_VALUE = 23; - /** - *
    -   * Do not use!  These are only for parameters.  Every enum above
    -   * should have a corresponding value below (verified by types_test).
    -   * 
    - * - * DT_FLOAT_REF = 101; - */ - public static final int DT_FLOAT_REF_VALUE = 101; - /** - * DT_DOUBLE_REF = 102; - */ - public static final int DT_DOUBLE_REF_VALUE = 102; - /** - * DT_INT32_REF = 103; - */ - public static final int DT_INT32_REF_VALUE = 103; - /** - * DT_UINT8_REF = 104; - */ - public static final int DT_UINT8_REF_VALUE = 104; - /** - * DT_INT16_REF = 105; - */ - public static final int DT_INT16_REF_VALUE = 105; - /** - * DT_INT8_REF = 106; - */ - public static final int DT_INT8_REF_VALUE = 106; - /** - * DT_STRING_REF = 107; - */ - public static final int DT_STRING_REF_VALUE = 107; - /** - * DT_COMPLEX64_REF = 108; - */ - public static final int DT_COMPLEX64_REF_VALUE = 108; - /** - * DT_INT64_REF = 109; - */ - public static final int DT_INT64_REF_VALUE = 109; - /** - * DT_BOOL_REF = 110; - */ - public static final int DT_BOOL_REF_VALUE = 110; - /** - * DT_QINT8_REF = 111; - */ - public static final int DT_QINT8_REF_VALUE = 111; - /** - * DT_QUINT8_REF = 112; - */ - public static final int DT_QUINT8_REF_VALUE = 112; - /** - * DT_QINT32_REF = 113; - */ - public static final int DT_QINT32_REF_VALUE = 113; - /** - * DT_BFLOAT16_REF = 114; - */ - public static final int DT_BFLOAT16_REF_VALUE = 114; - /** - * DT_QINT16_REF = 115; - */ - public static final int DT_QINT16_REF_VALUE = 115; - /** - * DT_QUINT16_REF = 116; - */ - public static final int DT_QUINT16_REF_VALUE = 116; - /** - * DT_UINT16_REF = 117; - */ - public static final int DT_UINT16_REF_VALUE = 117; - /** - * DT_COMPLEX128_REF = 118; - */ - public static final int DT_COMPLEX128_REF_VALUE = 118; - /** - * DT_HALF_REF = 119; - */ - public static final int DT_HALF_REF_VALUE = 119; - /** - * DT_RESOURCE_REF = 120; - */ - public static final int DT_RESOURCE_REF_VALUE = 120; - /** - * DT_VARIANT_REF = 121; - */ - public static final int DT_VARIANT_REF_VALUE = 121; - /** - * DT_UINT32_REF = 122; - */ - public static final int DT_UINT32_REF_VALUE = 122; - /** - * DT_UINT64_REF = 123; - */ - public static final int DT_UINT64_REF_VALUE = 123; - - - 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 DataType valueOf(int value) { - return forNumber(value); - } - - public static DataType forNumber(int value) { - switch (value) { - case 0: return DT_INVALID; - case 1: return DT_FLOAT; - case 2: return DT_DOUBLE; - case 3: return DT_INT32; - case 4: return DT_UINT8; - case 5: return DT_INT16; - case 6: return DT_INT8; - case 7: return DT_STRING; - case 8: return DT_COMPLEX64; - case 9: return DT_INT64; - case 10: return DT_BOOL; - case 11: return DT_QINT8; - case 12: return DT_QUINT8; - case 13: return DT_QINT32; - case 14: return DT_BFLOAT16; - case 15: return DT_QINT16; - case 16: return DT_QUINT16; - case 17: return DT_UINT16; - case 18: return DT_COMPLEX128; - case 19: return DT_HALF; - case 20: return DT_RESOURCE; - case 21: return DT_VARIANT; - case 22: return DT_UINT32; - case 23: return DT_UINT64; - case 101: return DT_FLOAT_REF; - case 102: return DT_DOUBLE_REF; - case 103: return DT_INT32_REF; - case 104: return DT_UINT8_REF; - case 105: return DT_INT16_REF; - case 106: return DT_INT8_REF; - case 107: return DT_STRING_REF; - case 108: return DT_COMPLEX64_REF; - case 109: return DT_INT64_REF; - case 110: return DT_BOOL_REF; - case 111: return DT_QINT8_REF; - case 112: return DT_QUINT8_REF; - case 113: return DT_QINT32_REF; - case 114: return DT_BFLOAT16_REF; - case 115: return DT_QINT16_REF; - case 116: return DT_QUINT16_REF; - case 117: return DT_UINT16_REF; - case 118: return DT_COMPLEX128_REF; - case 119: return DT_HALF_REF; - case 120: return DT_RESOURCE_REF; - case 121: return DT_VARIANT_REF; - case 122: return DT_UINT32_REF; - case 123: return DT_UINT64_REF; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - DataType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public DataType findValueByNumber(int number) { - return DataType.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(0); - } - - private static final DataType[] VALUES = values(); - - public static DataType 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 DataType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.DataType) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptions.java deleted file mode 100644 index 73b4e10af4e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptions.java +++ /dev/null @@ -1,1033 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Options for initializing DebuggerState in TensorFlow Debugger (tfdbg).
    - * 
    - * - * Protobuf type {@code tensorflow.DebugOptions} - */ -public final class DebugOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebugOptions) - DebugOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebugOptions.newBuilder() to construct. - private DebugOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebugOptions() { - debugTensorWatchOpts_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebugOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebugOptions( - 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 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - debugTensorWatchOpts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - debugTensorWatchOpts_.add( - input.readMessage(org.tensorflow.proto.framework.DebugTensorWatch.parser(), extensionRegistry)); - break; - } - case 80: { - - globalStep_ = input.readInt64(); - break; - } - case 88: { - - resetDiskByteUsage_ = input.readBool(); - 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)) { - debugTensorWatchOpts_ = java.util.Collections.unmodifiableList(debugTensorWatchOpts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebugOptions.class, org.tensorflow.proto.framework.DebugOptions.Builder.class); - } - - public static final int DEBUG_TENSOR_WATCH_OPTS_FIELD_NUMBER = 4; - private java.util.List debugTensorWatchOpts_; - /** - *
    -   * Debugging options
    -   * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public java.util.List getDebugTensorWatchOptsList() { - return debugTensorWatchOpts_; - } - /** - *
    -   * Debugging options
    -   * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public java.util.List - getDebugTensorWatchOptsOrBuilderList() { - return debugTensorWatchOpts_; - } - /** - *
    -   * Debugging options
    -   * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public int getDebugTensorWatchOptsCount() { - return debugTensorWatchOpts_.size(); - } - /** - *
    -   * Debugging options
    -   * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatch getDebugTensorWatchOpts(int index) { - return debugTensorWatchOpts_.get(index); - } - /** - *
    -   * Debugging options
    -   * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder( - int index) { - return debugTensorWatchOpts_.get(index); - } - - public static final int GLOBAL_STEP_FIELD_NUMBER = 10; - private long globalStep_; - /** - *
    -   * Caller-specified global step count.
    -   * Note that this is distinct from the session run count and the executor
    -   * step count.
    -   * 
    - * - * int64 global_step = 10; - */ - public long getGlobalStep() { - return globalStep_; - } - - public static final int RESET_DISK_BYTE_USAGE_FIELD_NUMBER = 11; - private boolean resetDiskByteUsage_; - /** - *
    -   * Whether the total disk usage of tfdbg is to be reset to zero
    -   * in this Session.run call. This is used by wrappers and hooks
    -   * such as the local CLI ones to indicate that the dumped tensors
    -   * are cleaned up from the disk after each Session.run.
    -   * 
    - * - * bool reset_disk_byte_usage = 11; - */ - public boolean getResetDiskByteUsage() { - return resetDiskByteUsage_; - } - - 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 { - for (int i = 0; i < debugTensorWatchOpts_.size(); i++) { - output.writeMessage(4, debugTensorWatchOpts_.get(i)); - } - if (globalStep_ != 0L) { - output.writeInt64(10, globalStep_); - } - if (resetDiskByteUsage_ != false) { - output.writeBool(11, resetDiskByteUsage_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < debugTensorWatchOpts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, debugTensorWatchOpts_.get(i)); - } - if (globalStep_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, globalStep_); - } - if (resetDiskByteUsage_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(11, resetDiskByteUsage_); - } - 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.DebugOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DebugOptions other = (org.tensorflow.proto.framework.DebugOptions) obj; - - if (!getDebugTensorWatchOptsList() - .equals(other.getDebugTensorWatchOptsList())) return false; - if (getGlobalStep() - != other.getGlobalStep()) return false; - if (getResetDiskByteUsage() - != other.getResetDiskByteUsage()) 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 (getDebugTensorWatchOptsCount() > 0) { - hash = (37 * hash) + DEBUG_TENSOR_WATCH_OPTS_FIELD_NUMBER; - hash = (53 * hash) + getDebugTensorWatchOptsList().hashCode(); - } - hash = (37 * hash) + GLOBAL_STEP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getGlobalStep()); - hash = (37 * hash) + RESET_DISK_BYTE_USAGE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getResetDiskByteUsage()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DebugOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugOptions 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.DebugOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugOptions 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.DebugOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DebugOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugOptions 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.DebugOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugOptions 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.DebugOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugOptions 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.DebugOptions 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 initializing DebuggerState in TensorFlow Debugger (tfdbg).
    -   * 
    - * - * Protobuf type {@code tensorflow.DebugOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebugOptions) - org.tensorflow.proto.framework.DebugOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebugOptions.class, org.tensorflow.proto.framework.DebugOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DebugOptions.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDebugTensorWatchOptsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (debugTensorWatchOptsBuilder_ == null) { - debugTensorWatchOpts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - debugTensorWatchOptsBuilder_.clear(); - } - globalStep_ = 0L; - - resetDiskByteUsage_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DebugOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugOptions build() { - org.tensorflow.proto.framework.DebugOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugOptions buildPartial() { - org.tensorflow.proto.framework.DebugOptions result = new org.tensorflow.proto.framework.DebugOptions(this); - int from_bitField0_ = bitField0_; - if (debugTensorWatchOptsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - debugTensorWatchOpts_ = java.util.Collections.unmodifiableList(debugTensorWatchOpts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.debugTensorWatchOpts_ = debugTensorWatchOpts_; - } else { - result.debugTensorWatchOpts_ = debugTensorWatchOptsBuilder_.build(); - } - result.globalStep_ = globalStep_; - result.resetDiskByteUsage_ = resetDiskByteUsage_; - 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.DebugOptions) { - return mergeFrom((org.tensorflow.proto.framework.DebugOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DebugOptions other) { - if (other == org.tensorflow.proto.framework.DebugOptions.getDefaultInstance()) return this; - if (debugTensorWatchOptsBuilder_ == null) { - if (!other.debugTensorWatchOpts_.isEmpty()) { - if (debugTensorWatchOpts_.isEmpty()) { - debugTensorWatchOpts_ = other.debugTensorWatchOpts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.addAll(other.debugTensorWatchOpts_); - } - onChanged(); - } - } else { - if (!other.debugTensorWatchOpts_.isEmpty()) { - if (debugTensorWatchOptsBuilder_.isEmpty()) { - debugTensorWatchOptsBuilder_.dispose(); - debugTensorWatchOptsBuilder_ = null; - debugTensorWatchOpts_ = other.debugTensorWatchOpts_; - bitField0_ = (bitField0_ & ~0x00000001); - debugTensorWatchOptsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDebugTensorWatchOptsFieldBuilder() : null; - } else { - debugTensorWatchOptsBuilder_.addAllMessages(other.debugTensorWatchOpts_); - } - } - } - if (other.getGlobalStep() != 0L) { - setGlobalStep(other.getGlobalStep()); - } - if (other.getResetDiskByteUsage() != false) { - setResetDiskByteUsage(other.getResetDiskByteUsage()); - } - 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.DebugOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DebugOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List debugTensorWatchOpts_ = - java.util.Collections.emptyList(); - private void ensureDebugTensorWatchOptsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - debugTensorWatchOpts_ = new java.util.ArrayList(debugTensorWatchOpts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebugTensorWatch, org.tensorflow.proto.framework.DebugTensorWatch.Builder, org.tensorflow.proto.framework.DebugTensorWatchOrBuilder> debugTensorWatchOptsBuilder_; - - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public java.util.List getDebugTensorWatchOptsList() { - if (debugTensorWatchOptsBuilder_ == null) { - return java.util.Collections.unmodifiableList(debugTensorWatchOpts_); - } else { - return debugTensorWatchOptsBuilder_.getMessageList(); - } - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public int getDebugTensorWatchOptsCount() { - if (debugTensorWatchOptsBuilder_ == null) { - return debugTensorWatchOpts_.size(); - } else { - return debugTensorWatchOptsBuilder_.getCount(); - } - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatch getDebugTensorWatchOpts(int index) { - if (debugTensorWatchOptsBuilder_ == null) { - return debugTensorWatchOpts_.get(index); - } else { - return debugTensorWatchOptsBuilder_.getMessage(index); - } - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder setDebugTensorWatchOpts( - int index, org.tensorflow.proto.framework.DebugTensorWatch value) { - if (debugTensorWatchOptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.set(index, value); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder setDebugTensorWatchOpts( - int index, org.tensorflow.proto.framework.DebugTensorWatch.Builder builderForValue) { - if (debugTensorWatchOptsBuilder_ == null) { - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.set(index, builderForValue.build()); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder addDebugTensorWatchOpts(org.tensorflow.proto.framework.DebugTensorWatch value) { - if (debugTensorWatchOptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.add(value); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder addDebugTensorWatchOpts( - int index, org.tensorflow.proto.framework.DebugTensorWatch value) { - if (debugTensorWatchOptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.add(index, value); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder addDebugTensorWatchOpts( - org.tensorflow.proto.framework.DebugTensorWatch.Builder builderForValue) { - if (debugTensorWatchOptsBuilder_ == null) { - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.add(builderForValue.build()); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder addDebugTensorWatchOpts( - int index, org.tensorflow.proto.framework.DebugTensorWatch.Builder builderForValue) { - if (debugTensorWatchOptsBuilder_ == null) { - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.add(index, builderForValue.build()); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder addAllDebugTensorWatchOpts( - java.lang.Iterable values) { - if (debugTensorWatchOptsBuilder_ == null) { - ensureDebugTensorWatchOptsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, debugTensorWatchOpts_); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder clearDebugTensorWatchOpts() { - if (debugTensorWatchOptsBuilder_ == null) { - debugTensorWatchOpts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public Builder removeDebugTensorWatchOpts(int index) { - if (debugTensorWatchOptsBuilder_ == null) { - ensureDebugTensorWatchOptsIsMutable(); - debugTensorWatchOpts_.remove(index); - onChanged(); - } else { - debugTensorWatchOptsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatch.Builder getDebugTensorWatchOptsBuilder( - int index) { - return getDebugTensorWatchOptsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder( - int index) { - if (debugTensorWatchOptsBuilder_ == null) { - return debugTensorWatchOpts_.get(index); } else { - return debugTensorWatchOptsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public java.util.List - getDebugTensorWatchOptsOrBuilderList() { - if (debugTensorWatchOptsBuilder_ != null) { - return debugTensorWatchOptsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(debugTensorWatchOpts_); - } - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatch.Builder addDebugTensorWatchOptsBuilder() { - return getDebugTensorWatchOptsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.DebugTensorWatch.getDefaultInstance()); - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public org.tensorflow.proto.framework.DebugTensorWatch.Builder addDebugTensorWatchOptsBuilder( - int index) { - return getDebugTensorWatchOptsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.DebugTensorWatch.getDefaultInstance()); - } - /** - *
    -     * Debugging options
    -     * 
    - * - * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; - */ - public java.util.List - getDebugTensorWatchOptsBuilderList() { - return getDebugTensorWatchOptsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebugTensorWatch, org.tensorflow.proto.framework.DebugTensorWatch.Builder, org.tensorflow.proto.framework.DebugTensorWatchOrBuilder> - getDebugTensorWatchOptsFieldBuilder() { - if (debugTensorWatchOptsBuilder_ == null) { - debugTensorWatchOptsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebugTensorWatch, org.tensorflow.proto.framework.DebugTensorWatch.Builder, org.tensorflow.proto.framework.DebugTensorWatchOrBuilder>( - debugTensorWatchOpts_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - debugTensorWatchOpts_ = null; - } - return debugTensorWatchOptsBuilder_; - } - - private long globalStep_ ; - /** - *
    -     * Caller-specified global step count.
    -     * Note that this is distinct from the session run count and the executor
    -     * step count.
    -     * 
    - * - * int64 global_step = 10; - */ - public long getGlobalStep() { - return globalStep_; - } - /** - *
    -     * Caller-specified global step count.
    -     * Note that this is distinct from the session run count and the executor
    -     * step count.
    -     * 
    - * - * int64 global_step = 10; - */ - public Builder setGlobalStep(long value) { - - globalStep_ = value; - onChanged(); - return this; - } - /** - *
    -     * Caller-specified global step count.
    -     * Note that this is distinct from the session run count and the executor
    -     * step count.
    -     * 
    - * - * int64 global_step = 10; - */ - public Builder clearGlobalStep() { - - globalStep_ = 0L; - onChanged(); - return this; - } - - private boolean resetDiskByteUsage_ ; - /** - *
    -     * Whether the total disk usage of tfdbg is to be reset to zero
    -     * in this Session.run call. This is used by wrappers and hooks
    -     * such as the local CLI ones to indicate that the dumped tensors
    -     * are cleaned up from the disk after each Session.run.
    -     * 
    - * - * bool reset_disk_byte_usage = 11; - */ - public boolean getResetDiskByteUsage() { - return resetDiskByteUsage_; - } - /** - *
    -     * Whether the total disk usage of tfdbg is to be reset to zero
    -     * in this Session.run call. This is used by wrappers and hooks
    -     * such as the local CLI ones to indicate that the dumped tensors
    -     * are cleaned up from the disk after each Session.run.
    -     * 
    - * - * bool reset_disk_byte_usage = 11; - */ - public Builder setResetDiskByteUsage(boolean value) { - - resetDiskByteUsage_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether the total disk usage of tfdbg is to be reset to zero
    -     * in this Session.run call. This is used by wrappers and hooks
    -     * such as the local CLI ones to indicate that the dumped tensors
    -     * are cleaned up from the disk after each Session.run.
    -     * 
    - * - * bool reset_disk_byte_usage = 11; - */ - public Builder clearResetDiskByteUsage() { - - resetDiskByteUsage_ = false; - 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.DebugOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebugOptions) - private static final org.tensorflow.proto.framework.DebugOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DebugOptions(); - } - - public static org.tensorflow.proto.framework.DebugOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebugOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebugOptions(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.DebugOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatch.java deleted file mode 100644 index 6536f3402fc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatch.java +++ /dev/null @@ -1,1444 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Option for watching a node in TensorFlow Debugger (tfdbg).
    - * 
    - * - * Protobuf type {@code tensorflow.DebugTensorWatch} - */ -public final class DebugTensorWatch extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebugTensorWatch) - DebugTensorWatchOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebugTensorWatch.newBuilder() to construct. - private DebugTensorWatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebugTensorWatch() { - nodeName_ = ""; - debugOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - debugUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebugTensorWatch(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebugTensorWatch( - 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(); - - nodeName_ = s; - break; - } - case 16: { - - outputSlot_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - debugOps_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - debugOps_.add(s); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - debugUrls_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - debugUrls_.add(s); - break; - } - case 40: { - - tolerateDebugOpCreationFailures_ = input.readBool(); - 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)) { - debugOps_ = debugOps_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - debugUrls_ = debugUrls_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebugTensorWatch.class, org.tensorflow.proto.framework.DebugTensorWatch.Builder.class); - } - - public static final int NODE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object nodeName_; - /** - *
    -   * Name of the node to watch.
    -   * Use "*" for wildcard. But note: currently, regex is not supported in
    -   * general.
    -   * 
    - * - * string node_name = 1; - */ - public java.lang.String getNodeName() { - java.lang.Object ref = nodeName_; - 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(); - nodeName_ = s; - return s; - } - } - /** - *
    -   * Name of the node to watch.
    -   * Use "*" for wildcard. But note: currently, regex is not supported in
    -   * general.
    -   * 
    - * - * string node_name = 1; - */ - public com.google.protobuf.ByteString - getNodeNameBytes() { - java.lang.Object ref = nodeName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OUTPUT_SLOT_FIELD_NUMBER = 2; - private int outputSlot_; - /** - *
    -   * Output slot to watch.
    -   * The semantics of output_slot == -1 is that all outputs of the node
    -   * will be watched (i.e., a wildcard).
    -   * Other negative values of output_slot are invalid and will lead to
    -   * errors currently.
    -   * 
    - * - * int32 output_slot = 2; - */ - public int getOutputSlot() { - return outputSlot_; - } - - public static final int DEBUG_OPS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList debugOps_; - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - public com.google.protobuf.ProtocolStringList - getDebugOpsList() { - return debugOps_; - } - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - public int getDebugOpsCount() { - return debugOps_.size(); - } - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - public java.lang.String getDebugOps(int index) { - return debugOps_.get(index); - } - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - public com.google.protobuf.ByteString - getDebugOpsBytes(int index) { - return debugOps_.getByteString(index); - } - - public static final int DEBUG_URLS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList debugUrls_; - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - public com.google.protobuf.ProtocolStringList - getDebugUrlsList() { - return debugUrls_; - } - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - public int getDebugUrlsCount() { - return debugUrls_.size(); - } - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - public java.lang.String getDebugUrls(int index) { - return debugUrls_.get(index); - } - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - public com.google.protobuf.ByteString - getDebugUrlsBytes(int index) { - return debugUrls_.getByteString(index); - } - - public static final int TOLERATE_DEBUG_OP_CREATION_FAILURES_FIELD_NUMBER = 5; - private boolean tolerateDebugOpCreationFailures_; - /** - *
    -   * Do not error out if debug op creation fails (e.g., due to dtype
    -   * incompatibility). Instead, just log the failure.
    -   * 
    - * - * bool tolerate_debug_op_creation_failures = 5; - */ - public boolean getTolerateDebugOpCreationFailures() { - return tolerateDebugOpCreationFailures_; - } - - 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 (!getNodeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nodeName_); - } - if (outputSlot_ != 0) { - output.writeInt32(2, outputSlot_); - } - for (int i = 0; i < debugOps_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, debugOps_.getRaw(i)); - } - for (int i = 0; i < debugUrls_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, debugUrls_.getRaw(i)); - } - if (tolerateDebugOpCreationFailures_ != false) { - output.writeBool(5, tolerateDebugOpCreationFailures_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNodeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nodeName_); - } - if (outputSlot_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, outputSlot_); - } - { - int dataSize = 0; - for (int i = 0; i < debugOps_.size(); i++) { - dataSize += computeStringSizeNoTag(debugOps_.getRaw(i)); - } - size += dataSize; - size += 1 * getDebugOpsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < debugUrls_.size(); i++) { - dataSize += computeStringSizeNoTag(debugUrls_.getRaw(i)); - } - size += dataSize; - size += 1 * getDebugUrlsList().size(); - } - if (tolerateDebugOpCreationFailures_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, tolerateDebugOpCreationFailures_); - } - 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.DebugTensorWatch)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DebugTensorWatch other = (org.tensorflow.proto.framework.DebugTensorWatch) obj; - - if (!getNodeName() - .equals(other.getNodeName())) return false; - if (getOutputSlot() - != other.getOutputSlot()) return false; - if (!getDebugOpsList() - .equals(other.getDebugOpsList())) return false; - if (!getDebugUrlsList() - .equals(other.getDebugUrlsList())) return false; - if (getTolerateDebugOpCreationFailures() - != other.getTolerateDebugOpCreationFailures()) 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) + NODE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getNodeName().hashCode(); - hash = (37 * hash) + OUTPUT_SLOT_FIELD_NUMBER; - hash = (53 * hash) + getOutputSlot(); - if (getDebugOpsCount() > 0) { - hash = (37 * hash) + DEBUG_OPS_FIELD_NUMBER; - hash = (53 * hash) + getDebugOpsList().hashCode(); - } - if (getDebugUrlsCount() > 0) { - hash = (37 * hash) + DEBUG_URLS_FIELD_NUMBER; - hash = (53 * hash) + getDebugUrlsList().hashCode(); - } - hash = (37 * hash) + TOLERATE_DEBUG_OP_CREATION_FAILURES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTolerateDebugOpCreationFailures()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DebugTensorWatch parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugTensorWatch 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.DebugTensorWatch parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugTensorWatch 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.DebugTensorWatch parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebugTensorWatch parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DebugTensorWatch parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugTensorWatch 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.DebugTensorWatch parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugTensorWatch 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.DebugTensorWatch parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebugTensorWatch 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.DebugTensorWatch 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; - } - /** - *
    -   * Option for watching a node in TensorFlow Debugger (tfdbg).
    -   * 
    - * - * Protobuf type {@code tensorflow.DebugTensorWatch} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebugTensorWatch) - org.tensorflow.proto.framework.DebugTensorWatchOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebugTensorWatch.class, org.tensorflow.proto.framework.DebugTensorWatch.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DebugTensorWatch.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(); - nodeName_ = ""; - - outputSlot_ = 0; - - debugOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - debugUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - tolerateDebugOpCreationFailures_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugTensorWatch getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DebugTensorWatch.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugTensorWatch build() { - org.tensorflow.proto.framework.DebugTensorWatch result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebugTensorWatch buildPartial() { - org.tensorflow.proto.framework.DebugTensorWatch result = new org.tensorflow.proto.framework.DebugTensorWatch(this); - int from_bitField0_ = bitField0_; - result.nodeName_ = nodeName_; - result.outputSlot_ = outputSlot_; - if (((bitField0_ & 0x00000001) != 0)) { - debugOps_ = debugOps_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.debugOps_ = debugOps_; - if (((bitField0_ & 0x00000002) != 0)) { - debugUrls_ = debugUrls_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.debugUrls_ = debugUrls_; - result.tolerateDebugOpCreationFailures_ = tolerateDebugOpCreationFailures_; - 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.DebugTensorWatch) { - return mergeFrom((org.tensorflow.proto.framework.DebugTensorWatch)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DebugTensorWatch other) { - if (other == org.tensorflow.proto.framework.DebugTensorWatch.getDefaultInstance()) return this; - if (!other.getNodeName().isEmpty()) { - nodeName_ = other.nodeName_; - onChanged(); - } - if (other.getOutputSlot() != 0) { - setOutputSlot(other.getOutputSlot()); - } - if (!other.debugOps_.isEmpty()) { - if (debugOps_.isEmpty()) { - debugOps_ = other.debugOps_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDebugOpsIsMutable(); - debugOps_.addAll(other.debugOps_); - } - onChanged(); - } - if (!other.debugUrls_.isEmpty()) { - if (debugUrls_.isEmpty()) { - debugUrls_ = other.debugUrls_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDebugUrlsIsMutable(); - debugUrls_.addAll(other.debugUrls_); - } - onChanged(); - } - if (other.getTolerateDebugOpCreationFailures() != false) { - setTolerateDebugOpCreationFailures(other.getTolerateDebugOpCreationFailures()); - } - 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.DebugTensorWatch parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DebugTensorWatch) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object nodeName_ = ""; - /** - *
    -     * Name of the node to watch.
    -     * Use "*" for wildcard. But note: currently, regex is not supported in
    -     * general.
    -     * 
    - * - * string node_name = 1; - */ - public java.lang.String getNodeName() { - java.lang.Object ref = nodeName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nodeName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the node to watch.
    -     * Use "*" for wildcard. But note: currently, regex is not supported in
    -     * general.
    -     * 
    - * - * string node_name = 1; - */ - public com.google.protobuf.ByteString - getNodeNameBytes() { - java.lang.Object ref = nodeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the node to watch.
    -     * Use "*" for wildcard. But note: currently, regex is not supported in
    -     * general.
    -     * 
    - * - * string node_name = 1; - */ - public Builder setNodeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nodeName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the node to watch.
    -     * Use "*" for wildcard. But note: currently, regex is not supported in
    -     * general.
    -     * 
    - * - * string node_name = 1; - */ - public Builder clearNodeName() { - - nodeName_ = getDefaultInstance().getNodeName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the node to watch.
    -     * Use "*" for wildcard. But note: currently, regex is not supported in
    -     * general.
    -     * 
    - * - * string node_name = 1; - */ - public Builder setNodeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nodeName_ = value; - onChanged(); - return this; - } - - private int outputSlot_ ; - /** - *
    -     * Output slot to watch.
    -     * The semantics of output_slot == -1 is that all outputs of the node
    -     * will be watched (i.e., a wildcard).
    -     * Other negative values of output_slot are invalid and will lead to
    -     * errors currently.
    -     * 
    - * - * int32 output_slot = 2; - */ - public int getOutputSlot() { - return outputSlot_; - } - /** - *
    -     * Output slot to watch.
    -     * The semantics of output_slot == -1 is that all outputs of the node
    -     * will be watched (i.e., a wildcard).
    -     * Other negative values of output_slot are invalid and will lead to
    -     * errors currently.
    -     * 
    - * - * int32 output_slot = 2; - */ - public Builder setOutputSlot(int value) { - - outputSlot_ = value; - onChanged(); - return this; - } - /** - *
    -     * Output slot to watch.
    -     * The semantics of output_slot == -1 is that all outputs of the node
    -     * will be watched (i.e., a wildcard).
    -     * Other negative values of output_slot are invalid and will lead to
    -     * errors currently.
    -     * 
    - * - * int32 output_slot = 2; - */ - public Builder clearOutputSlot() { - - outputSlot_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList debugOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureDebugOpsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - debugOps_ = new com.google.protobuf.LazyStringArrayList(debugOps_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public com.google.protobuf.ProtocolStringList - getDebugOpsList() { - return debugOps_.getUnmodifiableView(); - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public int getDebugOpsCount() { - return debugOps_.size(); - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public java.lang.String getDebugOps(int index) { - return debugOps_.get(index); - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public com.google.protobuf.ByteString - getDebugOpsBytes(int index) { - return debugOps_.getByteString(index); - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public Builder setDebugOps( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugOpsIsMutable(); - debugOps_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public Builder addDebugOps( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugOpsIsMutable(); - debugOps_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public Builder addAllDebugOps( - java.lang.Iterable values) { - ensureDebugOpsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, debugOps_); - onChanged(); - return this; - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public Builder clearDebugOps() { - debugOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Name(s) of the debugging op(s).
    -     * One or more than one probes on a tensor.
    -     * e.g., {"DebugIdentity", "DebugNanCount"}
    -     * 
    - * - * repeated string debug_ops = 3; - */ - public Builder addDebugOpsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureDebugOpsIsMutable(); - debugOps_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList debugUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureDebugUrlsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - debugUrls_ = new com.google.protobuf.LazyStringArrayList(debugUrls_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public com.google.protobuf.ProtocolStringList - getDebugUrlsList() { - return debugUrls_.getUnmodifiableView(); - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public int getDebugUrlsCount() { - return debugUrls_.size(); - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public java.lang.String getDebugUrls(int index) { - return debugUrls_.get(index); - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public com.google.protobuf.ByteString - getDebugUrlsBytes(int index) { - return debugUrls_.getByteString(index); - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public Builder setDebugUrls( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugUrlsIsMutable(); - debugUrls_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public Builder addDebugUrls( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDebugUrlsIsMutable(); - debugUrls_.add(value); - onChanged(); - return this; - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public Builder addAllDebugUrls( - java.lang.Iterable values) { - ensureDebugUrlsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, debugUrls_); - onChanged(); - return this; - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public Builder clearDebugUrls() { - debugUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * URL(s) for debug targets(s).
    -     * Supported URL formats are:
    -     *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -     *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -     *     already exist.
    -     *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -     *     service running at localhost:11011 with the event.
    -     *   - memcbk:///event_key: Routes tensors to clients using the
    -     *     callback registered with the DebugCallbackRegistry for event_key.
    -     * Each debug op listed in debug_ops will publish its output tensor (debug
    -     * signal) to all URLs in debug_urls.
    -     * N.B. Session::Run() supports concurrent invocations of the same inputs
    -     * (feed keys), outputs and target nodes. If such concurrent invocations
    -     * are to be debugged, the callers of Session::Run() must use distinct
    -     * debug_urls to make sure that the streamed or dumped events do not overlap
    -     * among the invocations.
    -     * TODO(cais): More visible documentation of this in g3docs.
    -     * 
    - * - * repeated string debug_urls = 4; - */ - public Builder addDebugUrlsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureDebugUrlsIsMutable(); - debugUrls_.add(value); - onChanged(); - return this; - } - - private boolean tolerateDebugOpCreationFailures_ ; - /** - *
    -     * Do not error out if debug op creation fails (e.g., due to dtype
    -     * incompatibility). Instead, just log the failure.
    -     * 
    - * - * bool tolerate_debug_op_creation_failures = 5; - */ - public boolean getTolerateDebugOpCreationFailures() { - return tolerateDebugOpCreationFailures_; - } - /** - *
    -     * Do not error out if debug op creation fails (e.g., due to dtype
    -     * incompatibility). Instead, just log the failure.
    -     * 
    - * - * bool tolerate_debug_op_creation_failures = 5; - */ - public Builder setTolerateDebugOpCreationFailures(boolean value) { - - tolerateDebugOpCreationFailures_ = value; - onChanged(); - return this; - } - /** - *
    -     * Do not error out if debug op creation fails (e.g., due to dtype
    -     * incompatibility). Instead, just log the failure.
    -     * 
    - * - * bool tolerate_debug_op_creation_failures = 5; - */ - public Builder clearTolerateDebugOpCreationFailures() { - - tolerateDebugOpCreationFailures_ = false; - 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.DebugTensorWatch) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebugTensorWatch) - private static final org.tensorflow.proto.framework.DebugTensorWatch DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DebugTensorWatch(); - } - - public static org.tensorflow.proto.framework.DebugTensorWatch getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebugTensorWatch parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebugTensorWatch(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.DebugTensorWatch getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatchOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatchOrBuilder.java deleted file mode 100644 index cce3536c5d1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugTensorWatchOrBuilder.java +++ /dev/null @@ -1,196 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -public interface DebugTensorWatchOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DebugTensorWatch) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the node to watch.
    -   * Use "*" for wildcard. But note: currently, regex is not supported in
    -   * general.
    -   * 
    - * - * string node_name = 1; - */ - java.lang.String getNodeName(); - /** - *
    -   * Name of the node to watch.
    -   * Use "*" for wildcard. But note: currently, regex is not supported in
    -   * general.
    -   * 
    - * - * string node_name = 1; - */ - com.google.protobuf.ByteString - getNodeNameBytes(); - - /** - *
    -   * Output slot to watch.
    -   * The semantics of output_slot == -1 is that all outputs of the node
    -   * will be watched (i.e., a wildcard).
    -   * Other negative values of output_slot are invalid and will lead to
    -   * errors currently.
    -   * 
    - * - * int32 output_slot = 2; - */ - int getOutputSlot(); - - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - java.util.List - getDebugOpsList(); - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - int getDebugOpsCount(); - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - java.lang.String getDebugOps(int index); - /** - *
    -   * Name(s) of the debugging op(s).
    -   * One or more than one probes on a tensor.
    -   * e.g., {"DebugIdentity", "DebugNanCount"}
    -   * 
    - * - * repeated string debug_ops = 3; - */ - com.google.protobuf.ByteString - getDebugOpsBytes(int index); - - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - java.util.List - getDebugUrlsList(); - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - int getDebugUrlsCount(); - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - java.lang.String getDebugUrls(int index); - /** - *
    -   * URL(s) for debug targets(s).
    -   * Supported URL formats are:
    -   *   - file:///foo/tfdbg_dump: Writes out Event content to file
    -   *     /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    -   *     already exist.
    -   *   - grpc://localhost:11011: Sends an RPC request to an EventListener
    -   *     service running at localhost:11011 with the event.
    -   *   - memcbk:///event_key: Routes tensors to clients using the
    -   *     callback registered with the DebugCallbackRegistry for event_key.
    -   * Each debug op listed in debug_ops will publish its output tensor (debug
    -   * signal) to all URLs in debug_urls.
    -   * N.B. Session::Run() supports concurrent invocations of the same inputs
    -   * (feed keys), outputs and target nodes. If such concurrent invocations
    -   * are to be debugged, the callers of Session::Run() must use distinct
    -   * debug_urls to make sure that the streamed or dumped events do not overlap
    -   * among the invocations.
    -   * TODO(cais): More visible documentation of this in g3docs.
    -   * 
    - * - * repeated string debug_urls = 4; - */ - com.google.protobuf.ByteString - getDebugUrlsBytes(int index); - - /** - *
    -   * Do not error out if debug op creation fails (e.g., due to dtype
    -   * incompatibility). Instead, just log the failure.
    -   * 
    - * - * bool tolerate_debug_op_creation_failures = 5; - */ - boolean getTolerateDebugOpCreationFailures(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFile.java deleted file mode 100644 index d0752d9022b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFile.java +++ /dev/null @@ -1,1102 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DebuggedSourceFile} - */ -public final class DebuggedSourceFile extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebuggedSourceFile) - DebuggedSourceFileOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebuggedSourceFile.newBuilder() to construct. - private DebuggedSourceFile(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebuggedSourceFile() { - host_ = ""; - filePath_ = ""; - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebuggedSourceFile(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebuggedSourceFile( - 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(); - - host_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - filePath_ = s; - break; - } - case 24: { - - lastModified_ = input.readInt64(); - break; - } - case 32: { - - bytes_ = input.readInt64(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - lines_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - lines_.add(s); - 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)) { - lines_ = lines_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebuggedSourceFile.class, org.tensorflow.proto.framework.DebuggedSourceFile.Builder.class); - } - - public static final int HOST_FIELD_NUMBER = 1; - private volatile java.lang.Object host_; - /** - *
    -   * The host name on which a source code file is located.
    -   * 
    - * - * string host = 1; - */ - public java.lang.String getHost() { - java.lang.Object ref = host_; - 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(); - host_ = s; - return s; - } - } - /** - *
    -   * The host name on which a source code file is located.
    -   * 
    - * - * string host = 1; - */ - public com.google.protobuf.ByteString - getHostBytes() { - java.lang.Object ref = host_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - host_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILE_PATH_FIELD_NUMBER = 2; - private volatile java.lang.Object filePath_; - /** - *
    -   * Path to the source code file.
    -   * 
    - * - * string file_path = 2; - */ - public java.lang.String getFilePath() { - java.lang.Object ref = filePath_; - 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(); - filePath_ = s; - return s; - } - } - /** - *
    -   * Path to the source code file.
    -   * 
    - * - * string file_path = 2; - */ - public com.google.protobuf.ByteString - getFilePathBytes() { - java.lang.Object ref = filePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LAST_MODIFIED_FIELD_NUMBER = 3; - private long lastModified_; - /** - *
    -   * The timestamp at which the source code file is last modified.
    -   * 
    - * - * int64 last_modified = 3; - */ - public long getLastModified() { - return lastModified_; - } - - public static final int BYTES_FIELD_NUMBER = 4; - private long bytes_; - /** - *
    -   * Byte size of the file.
    -   * 
    - * - * int64 bytes = 4; - */ - public long getBytes() { - return bytes_; - } - - public static final int LINES_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList lines_; - /** - *
    -   * Line-by-line content of the source code file.
    -   * 
    - * - * repeated string lines = 5; - */ - public com.google.protobuf.ProtocolStringList - getLinesList() { - return lines_; - } - /** - *
    -   * Line-by-line content of the source code file.
    -   * 
    - * - * repeated string lines = 5; - */ - public int getLinesCount() { - return lines_.size(); - } - /** - *
    -   * Line-by-line content of the source code file.
    -   * 
    - * - * repeated string lines = 5; - */ - public java.lang.String getLines(int index) { - return lines_.get(index); - } - /** - *
    -   * Line-by-line content of the source code file.
    -   * 
    - * - * repeated string lines = 5; - */ - public com.google.protobuf.ByteString - getLinesBytes(int index) { - return lines_.getByteString(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 { - if (!getHostBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, host_); - } - if (!getFilePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filePath_); - } - if (lastModified_ != 0L) { - output.writeInt64(3, lastModified_); - } - if (bytes_ != 0L) { - output.writeInt64(4, bytes_); - } - for (int i = 0; i < lines_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, lines_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHostBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, host_); - } - if (!getFilePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filePath_); - } - if (lastModified_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, lastModified_); - } - if (bytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, bytes_); - } - { - int dataSize = 0; - for (int i = 0; i < lines_.size(); i++) { - dataSize += computeStringSizeNoTag(lines_.getRaw(i)); - } - size += dataSize; - size += 1 * getLinesList().size(); - } - 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.DebuggedSourceFile)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DebuggedSourceFile other = (org.tensorflow.proto.framework.DebuggedSourceFile) obj; - - if (!getHost() - .equals(other.getHost())) return false; - if (!getFilePath() - .equals(other.getFilePath())) return false; - if (getLastModified() - != other.getLastModified()) return false; - if (getBytes() - != other.getBytes()) return false; - if (!getLinesList() - .equals(other.getLinesList())) 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) + HOST_FIELD_NUMBER; - hash = (53 * hash) + getHost().hashCode(); - hash = (37 * hash) + FILE_PATH_FIELD_NUMBER; - hash = (53 * hash) + getFilePath().hashCode(); - hash = (37 * hash) + LAST_MODIFIED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLastModified()); - hash = (37 * hash) + BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBytes()); - if (getLinesCount() > 0) { - hash = (37 * hash) + LINES_FIELD_NUMBER; - hash = (53 * hash) + getLinesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DebuggedSourceFile parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile 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.DebuggedSourceFile parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile 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.DebuggedSourceFile parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile 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.DebuggedSourceFile parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile 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.DebuggedSourceFile parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFile 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.DebuggedSourceFile 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.DebuggedSourceFile} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedSourceFile) - org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebuggedSourceFile.class, org.tensorflow.proto.framework.DebuggedSourceFile.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DebuggedSourceFile.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(); - host_ = ""; - - filePath_ = ""; - - lastModified_ = 0L; - - bytes_ = 0L; - - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFile getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DebuggedSourceFile.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFile build() { - org.tensorflow.proto.framework.DebuggedSourceFile result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFile buildPartial() { - org.tensorflow.proto.framework.DebuggedSourceFile result = new org.tensorflow.proto.framework.DebuggedSourceFile(this); - int from_bitField0_ = bitField0_; - result.host_ = host_; - result.filePath_ = filePath_; - result.lastModified_ = lastModified_; - result.bytes_ = bytes_; - if (((bitField0_ & 0x00000001) != 0)) { - lines_ = lines_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.lines_ = lines_; - 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.DebuggedSourceFile) { - return mergeFrom((org.tensorflow.proto.framework.DebuggedSourceFile)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DebuggedSourceFile other) { - if (other == org.tensorflow.proto.framework.DebuggedSourceFile.getDefaultInstance()) return this; - if (!other.getHost().isEmpty()) { - host_ = other.host_; - onChanged(); - } - if (!other.getFilePath().isEmpty()) { - filePath_ = other.filePath_; - onChanged(); - } - if (other.getLastModified() != 0L) { - setLastModified(other.getLastModified()); - } - if (other.getBytes() != 0L) { - setBytes(other.getBytes()); - } - if (!other.lines_.isEmpty()) { - if (lines_.isEmpty()) { - lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureLinesIsMutable(); - lines_.addAll(other.lines_); - } - onChanged(); - } - 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.DebuggedSourceFile parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DebuggedSourceFile) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object host_ = ""; - /** - *
    -     * The host name on which a source code file is located.
    -     * 
    - * - * string host = 1; - */ - public java.lang.String getHost() { - java.lang.Object ref = host_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - host_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The host name on which a source code file is located.
    -     * 
    - * - * string host = 1; - */ - public com.google.protobuf.ByteString - getHostBytes() { - java.lang.Object ref = host_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - host_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The host name on which a source code file is located.
    -     * 
    - * - * string host = 1; - */ - public Builder setHost( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - host_ = value; - onChanged(); - return this; - } - /** - *
    -     * The host name on which a source code file is located.
    -     * 
    - * - * string host = 1; - */ - public Builder clearHost() { - - host_ = getDefaultInstance().getHost(); - onChanged(); - return this; - } - /** - *
    -     * The host name on which a source code file is located.
    -     * 
    - * - * string host = 1; - */ - public Builder setHostBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - host_ = value; - onChanged(); - return this; - } - - private java.lang.Object filePath_ = ""; - /** - *
    -     * Path to the source code file.
    -     * 
    - * - * string file_path = 2; - */ - public java.lang.String getFilePath() { - java.lang.Object ref = filePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Path to the source code file.
    -     * 
    - * - * string file_path = 2; - */ - public com.google.protobuf.ByteString - getFilePathBytes() { - java.lang.Object ref = filePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Path to the source code file.
    -     * 
    - * - * string file_path = 2; - */ - public Builder setFilePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filePath_ = value; - onChanged(); - return this; - } - /** - *
    -     * Path to the source code file.
    -     * 
    - * - * string file_path = 2; - */ - public Builder clearFilePath() { - - filePath_ = getDefaultInstance().getFilePath(); - onChanged(); - return this; - } - /** - *
    -     * Path to the source code file.
    -     * 
    - * - * string file_path = 2; - */ - public Builder setFilePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filePath_ = value; - onChanged(); - return this; - } - - private long lastModified_ ; - /** - *
    -     * The timestamp at which the source code file is last modified.
    -     * 
    - * - * int64 last_modified = 3; - */ - public long getLastModified() { - return lastModified_; - } - /** - *
    -     * The timestamp at which the source code file is last modified.
    -     * 
    - * - * int64 last_modified = 3; - */ - public Builder setLastModified(long value) { - - lastModified_ = value; - onChanged(); - return this; - } - /** - *
    -     * The timestamp at which the source code file is last modified.
    -     * 
    - * - * int64 last_modified = 3; - */ - public Builder clearLastModified() { - - lastModified_ = 0L; - onChanged(); - return this; - } - - private long bytes_ ; - /** - *
    -     * Byte size of the file.
    -     * 
    - * - * int64 bytes = 4; - */ - public long getBytes() { - return bytes_; - } - /** - *
    -     * Byte size of the file.
    -     * 
    - * - * int64 bytes = 4; - */ - public Builder setBytes(long value) { - - bytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Byte size of the file.
    -     * 
    - * - * int64 bytes = 4; - */ - public Builder clearBytes() { - - bytes_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureLinesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - lines_ = new com.google.protobuf.LazyStringArrayList(lines_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public com.google.protobuf.ProtocolStringList - getLinesList() { - return lines_.getUnmodifiableView(); - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public int getLinesCount() { - return lines_.size(); - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public java.lang.String getLines(int index) { - return lines_.get(index); - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public com.google.protobuf.ByteString - getLinesBytes(int index) { - return lines_.getByteString(index); - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public Builder setLines( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public Builder addLines( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public Builder addAllLines( - java.lang.Iterable values) { - ensureLinesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, lines_); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public Builder clearLines() { - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the source code file.
    -     * 
    - * - * repeated string lines = 5; - */ - public Builder addLinesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureLinesIsMutable(); - lines_.add(value); - 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.DebuggedSourceFile) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebuggedSourceFile) - private static final org.tensorflow.proto.framework.DebuggedSourceFile DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DebuggedSourceFile(); - } - - public static org.tensorflow.proto.framework.DebuggedSourceFile getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebuggedSourceFile parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebuggedSourceFile(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.DebuggedSourceFile getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFiles.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFiles.java deleted file mode 100644 index c5d014b4bb6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFiles.java +++ /dev/null @@ -1,857 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DebuggedSourceFiles} - */ -public final class DebuggedSourceFiles extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebuggedSourceFiles) - DebuggedSourceFilesOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebuggedSourceFiles.newBuilder() to construct. - private DebuggedSourceFiles(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebuggedSourceFiles() { - sourceFiles_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebuggedSourceFiles(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebuggedSourceFiles( - 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)) { - sourceFiles_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sourceFiles_.add( - input.readMessage(org.tensorflow.proto.framework.DebuggedSourceFile.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_ & 0x00000001) != 0)) { - sourceFiles_ = java.util.Collections.unmodifiableList(sourceFiles_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebuggedSourceFiles.class, org.tensorflow.proto.framework.DebuggedSourceFiles.Builder.class); - } - - public static final int SOURCE_FILES_FIELD_NUMBER = 1; - private java.util.List sourceFiles_; - /** - *
    -   * A collection of source code files.
    -   * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public java.util.List getSourceFilesList() { - return sourceFiles_; - } - /** - *
    -   * A collection of source code files.
    -   * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public java.util.List - getSourceFilesOrBuilderList() { - return sourceFiles_; - } - /** - *
    -   * A collection of source code files.
    -   * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public int getSourceFilesCount() { - return sourceFiles_.size(); - } - /** - *
    -   * A collection of source code files.
    -   * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFile getSourceFiles(int index) { - return sourceFiles_.get(index); - } - /** - *
    -   * A collection of source code files.
    -   * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder( - int index) { - return sourceFiles_.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 { - for (int i = 0; i < sourceFiles_.size(); i++) { - output.writeMessage(1, sourceFiles_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < sourceFiles_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, sourceFiles_.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.DebuggedSourceFiles)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DebuggedSourceFiles other = (org.tensorflow.proto.framework.DebuggedSourceFiles) obj; - - if (!getSourceFilesList() - .equals(other.getSourceFilesList())) 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 (getSourceFilesCount() > 0) { - hash = (37 * hash) + SOURCE_FILES_FIELD_NUMBER; - hash = (53 * hash) + getSourceFilesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DebuggedSourceFiles parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles 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.DebuggedSourceFiles parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles 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.DebuggedSourceFiles parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles 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.DebuggedSourceFiles parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles 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.DebuggedSourceFiles parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DebuggedSourceFiles 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.DebuggedSourceFiles 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.DebuggedSourceFiles} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedSourceFiles) - org.tensorflow.proto.framework.DebuggedSourceFilesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DebuggedSourceFiles.class, org.tensorflow.proto.framework.DebuggedSourceFiles.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DebuggedSourceFiles.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSourceFilesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (sourceFilesBuilder_ == null) { - sourceFiles_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - sourceFilesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFiles getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DebuggedSourceFiles.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFiles build() { - org.tensorflow.proto.framework.DebuggedSourceFiles result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DebuggedSourceFiles buildPartial() { - org.tensorflow.proto.framework.DebuggedSourceFiles result = new org.tensorflow.proto.framework.DebuggedSourceFiles(this); - int from_bitField0_ = bitField0_; - if (sourceFilesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sourceFiles_ = java.util.Collections.unmodifiableList(sourceFiles_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sourceFiles_ = sourceFiles_; - } else { - result.sourceFiles_ = sourceFilesBuilder_.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.DebuggedSourceFiles) { - return mergeFrom((org.tensorflow.proto.framework.DebuggedSourceFiles)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DebuggedSourceFiles other) { - if (other == org.tensorflow.proto.framework.DebuggedSourceFiles.getDefaultInstance()) return this; - if (sourceFilesBuilder_ == null) { - if (!other.sourceFiles_.isEmpty()) { - if (sourceFiles_.isEmpty()) { - sourceFiles_ = other.sourceFiles_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSourceFilesIsMutable(); - sourceFiles_.addAll(other.sourceFiles_); - } - onChanged(); - } - } else { - if (!other.sourceFiles_.isEmpty()) { - if (sourceFilesBuilder_.isEmpty()) { - sourceFilesBuilder_.dispose(); - sourceFilesBuilder_ = null; - sourceFiles_ = other.sourceFiles_; - bitField0_ = (bitField0_ & ~0x00000001); - sourceFilesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSourceFilesFieldBuilder() : null; - } else { - sourceFilesBuilder_.addAllMessages(other.sourceFiles_); - } - } - } - 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.DebuggedSourceFiles parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DebuggedSourceFiles) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List sourceFiles_ = - java.util.Collections.emptyList(); - private void ensureSourceFilesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sourceFiles_ = new java.util.ArrayList(sourceFiles_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebuggedSourceFile, org.tensorflow.proto.framework.DebuggedSourceFile.Builder, org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder> sourceFilesBuilder_; - - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public java.util.List getSourceFilesList() { - if (sourceFilesBuilder_ == null) { - return java.util.Collections.unmodifiableList(sourceFiles_); - } else { - return sourceFilesBuilder_.getMessageList(); - } - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public int getSourceFilesCount() { - if (sourceFilesBuilder_ == null) { - return sourceFiles_.size(); - } else { - return sourceFilesBuilder_.getCount(); - } - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFile getSourceFiles(int index) { - if (sourceFilesBuilder_ == null) { - return sourceFiles_.get(index); - } else { - return sourceFilesBuilder_.getMessage(index); - } - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder setSourceFiles( - int index, org.tensorflow.proto.framework.DebuggedSourceFile value) { - if (sourceFilesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceFilesIsMutable(); - sourceFiles_.set(index, value); - onChanged(); - } else { - sourceFilesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder setSourceFiles( - int index, org.tensorflow.proto.framework.DebuggedSourceFile.Builder builderForValue) { - if (sourceFilesBuilder_ == null) { - ensureSourceFilesIsMutable(); - sourceFiles_.set(index, builderForValue.build()); - onChanged(); - } else { - sourceFilesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder addSourceFiles(org.tensorflow.proto.framework.DebuggedSourceFile value) { - if (sourceFilesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceFilesIsMutable(); - sourceFiles_.add(value); - onChanged(); - } else { - sourceFilesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder addSourceFiles( - int index, org.tensorflow.proto.framework.DebuggedSourceFile value) { - if (sourceFilesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSourceFilesIsMutable(); - sourceFiles_.add(index, value); - onChanged(); - } else { - sourceFilesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder addSourceFiles( - org.tensorflow.proto.framework.DebuggedSourceFile.Builder builderForValue) { - if (sourceFilesBuilder_ == null) { - ensureSourceFilesIsMutable(); - sourceFiles_.add(builderForValue.build()); - onChanged(); - } else { - sourceFilesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder addSourceFiles( - int index, org.tensorflow.proto.framework.DebuggedSourceFile.Builder builderForValue) { - if (sourceFilesBuilder_ == null) { - ensureSourceFilesIsMutable(); - sourceFiles_.add(index, builderForValue.build()); - onChanged(); - } else { - sourceFilesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder addAllSourceFiles( - java.lang.Iterable values) { - if (sourceFilesBuilder_ == null) { - ensureSourceFilesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, sourceFiles_); - onChanged(); - } else { - sourceFilesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder clearSourceFiles() { - if (sourceFilesBuilder_ == null) { - sourceFiles_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sourceFilesBuilder_.clear(); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public Builder removeSourceFiles(int index) { - if (sourceFilesBuilder_ == null) { - ensureSourceFilesIsMutable(); - sourceFiles_.remove(index); - onChanged(); - } else { - sourceFilesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFile.Builder getSourceFilesBuilder( - int index) { - return getSourceFilesFieldBuilder().getBuilder(index); - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder( - int index) { - if (sourceFilesBuilder_ == null) { - return sourceFiles_.get(index); } else { - return sourceFilesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public java.util.List - getSourceFilesOrBuilderList() { - if (sourceFilesBuilder_ != null) { - return sourceFilesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sourceFiles_); - } - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFile.Builder addSourceFilesBuilder() { - return getSourceFilesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.DebuggedSourceFile.getDefaultInstance()); - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public org.tensorflow.proto.framework.DebuggedSourceFile.Builder addSourceFilesBuilder( - int index) { - return getSourceFilesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.DebuggedSourceFile.getDefaultInstance()); - } - /** - *
    -     * A collection of source code files.
    -     * 
    - * - * repeated .tensorflow.DebuggedSourceFile source_files = 1; - */ - public java.util.List - getSourceFilesBuilderList() { - return getSourceFilesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebuggedSourceFile, org.tensorflow.proto.framework.DebuggedSourceFile.Builder, org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder> - getSourceFilesFieldBuilder() { - if (sourceFilesBuilder_ == null) { - sourceFilesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DebuggedSourceFile, org.tensorflow.proto.framework.DebuggedSourceFile.Builder, org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder>( - sourceFiles_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - sourceFiles_ = null; - } - return sourceFilesBuilder_; - } - @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.DebuggedSourceFiles) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebuggedSourceFiles) - private static final org.tensorflow.proto.framework.DebuggedSourceFiles DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DebuggedSourceFiles(); - } - - public static org.tensorflow.proto.framework.DebuggedSourceFiles getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebuggedSourceFiles parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebuggedSourceFiles(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.DebuggedSourceFiles getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributes.java deleted file mode 100644 index 3da166dfbfd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributes.java +++ /dev/null @@ -1,1277 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DeviceAttributes} - */ -public final class DeviceAttributes extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DeviceAttributes) - DeviceAttributesOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeviceAttributes.newBuilder() to construct. - private DeviceAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeviceAttributes() { - name_ = ""; - deviceType_ = ""; - physicalDeviceDesc_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeviceAttributes(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeviceAttributes( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceType_ = s; - break; - } - case 32: { - - memoryLimit_ = input.readInt64(); - break; - } - case 42: { - org.tensorflow.proto.framework.DeviceLocality.Builder subBuilder = null; - if (locality_ != null) { - subBuilder = locality_.toBuilder(); - } - locality_ = input.readMessage(org.tensorflow.proto.framework.DeviceLocality.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(locality_); - locality_ = subBuilder.buildPartial(); - } - - break; - } - case 49: { - - incarnation_ = input.readFixed64(); - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - physicalDeviceDesc_ = s; - 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.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceAttributes.class, org.tensorflow.proto.framework.DeviceAttributes.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Fully specified name of the device within a cluster.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Fully specified name of the device within a cluster.
    -   * 
    - * - * 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_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object deviceType_; - /** - *
    -   * String representation of device_type.
    -   * 
    - * - * string device_type = 2; - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - 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(); - deviceType_ = s; - return s; - } - } - /** - *
    -   * String representation of device_type.
    -   * 
    - * - * string device_type = 2; - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MEMORY_LIMIT_FIELD_NUMBER = 4; - private long memoryLimit_; - /** - *
    -   * Memory capacity of device in bytes.
    -   * 
    - * - * int64 memory_limit = 4; - */ - public long getMemoryLimit() { - return memoryLimit_; - } - - public static final int LOCALITY_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.DeviceLocality locality_; - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public boolean hasLocality() { - return locality_ != null; - } - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public org.tensorflow.proto.framework.DeviceLocality getLocality() { - return locality_ == null ? org.tensorflow.proto.framework.DeviceLocality.getDefaultInstance() : locality_; - } - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public org.tensorflow.proto.framework.DeviceLocalityOrBuilder getLocalityOrBuilder() { - return getLocality(); - } - - public static final int INCARNATION_FIELD_NUMBER = 6; - private long incarnation_; - /** - *
    -   * A device is assigned a global unique number each time it is
    -   * initialized. "incarnation" should never be 0.
    -   * 
    - * - * fixed64 incarnation = 6; - */ - public long getIncarnation() { - return incarnation_; - } - - public static final int PHYSICAL_DEVICE_DESC_FIELD_NUMBER = 7; - private volatile java.lang.Object physicalDeviceDesc_; - /** - *
    -   * String representation of the physical device that this device maps to.
    -   * 
    - * - * string physical_device_desc = 7; - */ - public java.lang.String getPhysicalDeviceDesc() { - java.lang.Object ref = physicalDeviceDesc_; - 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(); - physicalDeviceDesc_ = s; - return s; - } - } - /** - *
    -   * String representation of the physical device that this device maps to.
    -   * 
    - * - * string physical_device_desc = 7; - */ - public com.google.protobuf.ByteString - getPhysicalDeviceDescBytes() { - java.lang.Object ref = physicalDeviceDesc_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - physicalDeviceDesc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getDeviceTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); - } - if (memoryLimit_ != 0L) { - output.writeInt64(4, memoryLimit_); - } - if (locality_ != null) { - output.writeMessage(5, getLocality()); - } - if (incarnation_ != 0L) { - output.writeFixed64(6, incarnation_); - } - if (!getPhysicalDeviceDescBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, physicalDeviceDesc_); - } - 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 (!getDeviceTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); - } - if (memoryLimit_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, memoryLimit_); - } - if (locality_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getLocality()); - } - if (incarnation_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeFixed64Size(6, incarnation_); - } - if (!getPhysicalDeviceDescBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, physicalDeviceDesc_); - } - 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.DeviceAttributes)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DeviceAttributes other = (org.tensorflow.proto.framework.DeviceAttributes) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDeviceType() - .equals(other.getDeviceType())) return false; - if (getMemoryLimit() - != other.getMemoryLimit()) return false; - if (hasLocality() != other.hasLocality()) return false; - if (hasLocality()) { - if (!getLocality() - .equals(other.getLocality())) return false; - } - if (getIncarnation() - != other.getIncarnation()) return false; - if (!getPhysicalDeviceDesc() - .equals(other.getPhysicalDeviceDesc())) 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_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getDeviceType().hashCode(); - hash = (37 * hash) + MEMORY_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMemoryLimit()); - if (hasLocality()) { - hash = (37 * hash) + LOCALITY_FIELD_NUMBER; - hash = (53 * hash) + getLocality().hashCode(); - } - hash = (37 * hash) + INCARNATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getIncarnation()); - hash = (37 * hash) + PHYSICAL_DEVICE_DESC_FIELD_NUMBER; - hash = (53 * hash) + getPhysicalDeviceDesc().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DeviceAttributes parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceAttributes 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.DeviceAttributes parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceAttributes 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.DeviceAttributes parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceAttributes parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DeviceAttributes parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceAttributes 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.DeviceAttributes parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceAttributes 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.DeviceAttributes parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceAttributes 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.DeviceAttributes 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.DeviceAttributes} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DeviceAttributes) - org.tensorflow.proto.framework.DeviceAttributesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceAttributes.class, org.tensorflow.proto.framework.DeviceAttributes.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DeviceAttributes.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_ = ""; - - deviceType_ = ""; - - memoryLimit_ = 0L; - - if (localityBuilder_ == null) { - locality_ = null; - } else { - locality_ = null; - localityBuilder_ = null; - } - incarnation_ = 0L; - - physicalDeviceDesc_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceAttributes getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DeviceAttributes.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceAttributes build() { - org.tensorflow.proto.framework.DeviceAttributes result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceAttributes buildPartial() { - org.tensorflow.proto.framework.DeviceAttributes result = new org.tensorflow.proto.framework.DeviceAttributes(this); - result.name_ = name_; - result.deviceType_ = deviceType_; - result.memoryLimit_ = memoryLimit_; - if (localityBuilder_ == null) { - result.locality_ = locality_; - } else { - result.locality_ = localityBuilder_.build(); - } - result.incarnation_ = incarnation_; - result.physicalDeviceDesc_ = physicalDeviceDesc_; - 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.DeviceAttributes) { - return mergeFrom((org.tensorflow.proto.framework.DeviceAttributes)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DeviceAttributes other) { - if (other == org.tensorflow.proto.framework.DeviceAttributes.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDeviceType().isEmpty()) { - deviceType_ = other.deviceType_; - onChanged(); - } - if (other.getMemoryLimit() != 0L) { - setMemoryLimit(other.getMemoryLimit()); - } - if (other.hasLocality()) { - mergeLocality(other.getLocality()); - } - if (other.getIncarnation() != 0L) { - setIncarnation(other.getIncarnation()); - } - if (!other.getPhysicalDeviceDesc().isEmpty()) { - physicalDeviceDesc_ = other.physicalDeviceDesc_; - onChanged(); - } - 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.DeviceAttributes parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DeviceAttributes) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Fully specified name of the device within a cluster.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Fully specified name of the device within a cluster.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Fully specified name of the device within a cluster.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Fully specified name of the device within a cluster.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Fully specified name of the device within a cluster.
    -     * 
    - * - * 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 java.lang.Object deviceType_ = ""; - /** - *
    -     * String representation of device_type.
    -     * 
    - * - * string device_type = 2; - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * String representation of device_type.
    -     * 
    - * - * string device_type = 2; - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * String representation of device_type.
    -     * 
    - * - * string device_type = 2; - */ - public Builder setDeviceType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceType_ = value; - onChanged(); - return this; - } - /** - *
    -     * String representation of device_type.
    -     * 
    - * - * string device_type = 2; - */ - public Builder clearDeviceType() { - - deviceType_ = getDefaultInstance().getDeviceType(); - onChanged(); - return this; - } - /** - *
    -     * String representation of device_type.
    -     * 
    - * - * string device_type = 2; - */ - public Builder setDeviceTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceType_ = value; - onChanged(); - return this; - } - - private long memoryLimit_ ; - /** - *
    -     * Memory capacity of device in bytes.
    -     * 
    - * - * int64 memory_limit = 4; - */ - public long getMemoryLimit() { - return memoryLimit_; - } - /** - *
    -     * Memory capacity of device in bytes.
    -     * 
    - * - * int64 memory_limit = 4; - */ - public Builder setMemoryLimit(long value) { - - memoryLimit_ = value; - onChanged(); - return this; - } - /** - *
    -     * Memory capacity of device in bytes.
    -     * 
    - * - * int64 memory_limit = 4; - */ - public Builder clearMemoryLimit() { - - memoryLimit_ = 0L; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.DeviceLocality locality_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceLocality, org.tensorflow.proto.framework.DeviceLocality.Builder, org.tensorflow.proto.framework.DeviceLocalityOrBuilder> localityBuilder_; - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public boolean hasLocality() { - return localityBuilder_ != null || locality_ != null; - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public org.tensorflow.proto.framework.DeviceLocality getLocality() { - if (localityBuilder_ == null) { - return locality_ == null ? org.tensorflow.proto.framework.DeviceLocality.getDefaultInstance() : locality_; - } else { - return localityBuilder_.getMessage(); - } - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public Builder setLocality(org.tensorflow.proto.framework.DeviceLocality value) { - if (localityBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - locality_ = value; - onChanged(); - } else { - localityBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public Builder setLocality( - org.tensorflow.proto.framework.DeviceLocality.Builder builderForValue) { - if (localityBuilder_ == null) { - locality_ = builderForValue.build(); - onChanged(); - } else { - localityBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public Builder mergeLocality(org.tensorflow.proto.framework.DeviceLocality value) { - if (localityBuilder_ == null) { - if (locality_ != null) { - locality_ = - org.tensorflow.proto.framework.DeviceLocality.newBuilder(locality_).mergeFrom(value).buildPartial(); - } else { - locality_ = value; - } - onChanged(); - } else { - localityBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public Builder clearLocality() { - if (localityBuilder_ == null) { - locality_ = null; - onChanged(); - } else { - locality_ = null; - localityBuilder_ = null; - } - - return this; - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public org.tensorflow.proto.framework.DeviceLocality.Builder getLocalityBuilder() { - - onChanged(); - return getLocalityFieldBuilder().getBuilder(); - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - public org.tensorflow.proto.framework.DeviceLocalityOrBuilder getLocalityOrBuilder() { - if (localityBuilder_ != null) { - return localityBuilder_.getMessageOrBuilder(); - } else { - return locality_ == null ? - org.tensorflow.proto.framework.DeviceLocality.getDefaultInstance() : locality_; - } - } - /** - *
    -     * Platform-specific data about device that may be useful
    -     * for supporting efficient data transfers.
    -     * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceLocality, org.tensorflow.proto.framework.DeviceLocality.Builder, org.tensorflow.proto.framework.DeviceLocalityOrBuilder> - getLocalityFieldBuilder() { - if (localityBuilder_ == null) { - localityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceLocality, org.tensorflow.proto.framework.DeviceLocality.Builder, org.tensorflow.proto.framework.DeviceLocalityOrBuilder>( - getLocality(), - getParentForChildren(), - isClean()); - locality_ = null; - } - return localityBuilder_; - } - - private long incarnation_ ; - /** - *
    -     * A device is assigned a global unique number each time it is
    -     * initialized. "incarnation" should never be 0.
    -     * 
    - * - * fixed64 incarnation = 6; - */ - public long getIncarnation() { - return incarnation_; - } - /** - *
    -     * A device is assigned a global unique number each time it is
    -     * initialized. "incarnation" should never be 0.
    -     * 
    - * - * fixed64 incarnation = 6; - */ - public Builder setIncarnation(long value) { - - incarnation_ = value; - onChanged(); - return this; - } - /** - *
    -     * A device is assigned a global unique number each time it is
    -     * initialized. "incarnation" should never be 0.
    -     * 
    - * - * fixed64 incarnation = 6; - */ - public Builder clearIncarnation() { - - incarnation_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object physicalDeviceDesc_ = ""; - /** - *
    -     * String representation of the physical device that this device maps to.
    -     * 
    - * - * string physical_device_desc = 7; - */ - public java.lang.String getPhysicalDeviceDesc() { - java.lang.Object ref = physicalDeviceDesc_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - physicalDeviceDesc_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * String representation of the physical device that this device maps to.
    -     * 
    - * - * string physical_device_desc = 7; - */ - public com.google.protobuf.ByteString - getPhysicalDeviceDescBytes() { - java.lang.Object ref = physicalDeviceDesc_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - physicalDeviceDesc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * String representation of the physical device that this device maps to.
    -     * 
    - * - * string physical_device_desc = 7; - */ - public Builder setPhysicalDeviceDesc( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - physicalDeviceDesc_ = value; - onChanged(); - return this; - } - /** - *
    -     * String representation of the physical device that this device maps to.
    -     * 
    - * - * string physical_device_desc = 7; - */ - public Builder clearPhysicalDeviceDesc() { - - physicalDeviceDesc_ = getDefaultInstance().getPhysicalDeviceDesc(); - onChanged(); - return this; - } - /** - *
    -     * String representation of the physical device that this device maps to.
    -     * 
    - * - * string physical_device_desc = 7; - */ - public Builder setPhysicalDeviceDescBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - physicalDeviceDesc_ = value; - 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.DeviceAttributes) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DeviceAttributes) - private static final org.tensorflow.proto.framework.DeviceAttributes DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DeviceAttributes(); - } - - public static org.tensorflow.proto.framework.DeviceAttributes getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeviceAttributes parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceAttributes(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.DeviceAttributes getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesOrBuilder.java deleted file mode 100644 index bb8c806b325..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesOrBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -public interface DeviceAttributesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DeviceAttributes) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Fully specified name of the device within a cluster.
    -   * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -   * Fully specified name of the device within a cluster.
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * String representation of device_type.
    -   * 
    - * - * string device_type = 2; - */ - java.lang.String getDeviceType(); - /** - *
    -   * String representation of device_type.
    -   * 
    - * - * string device_type = 2; - */ - com.google.protobuf.ByteString - getDeviceTypeBytes(); - - /** - *
    -   * Memory capacity of device in bytes.
    -   * 
    - * - * int64 memory_limit = 4; - */ - long getMemoryLimit(); - - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - boolean hasLocality(); - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - org.tensorflow.proto.framework.DeviceLocality getLocality(); - /** - *
    -   * Platform-specific data about device that may be useful
    -   * for supporting efficient data transfers.
    -   * 
    - * - * .tensorflow.DeviceLocality locality = 5; - */ - org.tensorflow.proto.framework.DeviceLocalityOrBuilder getLocalityOrBuilder(); - - /** - *
    -   * A device is assigned a global unique number each time it is
    -   * initialized. "incarnation" should never be 0.
    -   * 
    - * - * fixed64 incarnation = 6; - */ - long getIncarnation(); - - /** - *
    -   * String representation of the physical device that this device maps to.
    -   * 
    - * - * string physical_device_desc = 7; - */ - java.lang.String getPhysicalDeviceDesc(); - /** - *
    -   * String representation of the physical device that this device maps to.
    -   * 
    - * - * string physical_device_desc = 7; - */ - com.google.protobuf.ByteString - getPhysicalDeviceDescBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesProtos.java deleted file mode 100644 index f9e2dac8a67..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceAttributesProtos.java +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -public final class DeviceAttributesProtos { - private DeviceAttributesProtos() {} - 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_InterconnectLink_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_InterconnectLink_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_LocalLinks_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_LocalLinks_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DeviceLocality_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DeviceLocality_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DeviceAttributes_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DeviceAttributes_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n1tensorflow/core/framework/device_attri" + - "butes.proto\022\ntensorflow\"E\n\020InterconnectL" + - "ink\022\021\n\tdevice_id\030\001 \001(\005\022\014\n\004type\030\002 \001(\t\022\020\n\010" + - "strength\030\003 \001(\005\"8\n\nLocalLinks\022*\n\004link\030\001 \003" + - "(\0132\034.tensorflow.InterconnectLink\"Z\n\016Devi" + - "ceLocality\022\016\n\006bus_id\030\001 \001(\005\022\021\n\tnuma_node\030" + - "\002 \001(\005\022%\n\005links\030\003 \001(\0132\026.tensorflow.LocalL" + - "inks\"\254\001\n\020DeviceAttributes\022\014\n\004name\030\001 \001(\t\022" + - "\023\n\013device_type\030\002 \001(\t\022\024\n\014memory_limit\030\004 \001" + - "(\003\022,\n\010locality\030\005 \001(\0132\032.tensorflow.Device" + - "Locality\022\023\n\013incarnation\030\006 \001(\006\022\034\n\024physica" + - "l_device_desc\030\007 \001(\tB\227\001\n\036org.tensorflow.p" + - "roto.frameworkB\026DeviceAttributesProtosP\001" + - "ZXgithub.com/tensorflow/tensorflow/tenso" + - "rflow/go/core/framework/device_attribute" + - "s_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_InterconnectLink_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_InterconnectLink_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_InterconnectLink_descriptor, - new java.lang.String[] { "DeviceId", "Type", "Strength", }); - internal_static_tensorflow_LocalLinks_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_LocalLinks_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_LocalLinks_descriptor, - new java.lang.String[] { "Link", }); - internal_static_tensorflow_DeviceLocality_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_DeviceLocality_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DeviceLocality_descriptor, - new java.lang.String[] { "BusId", "NumaNode", "Links", }); - internal_static_tensorflow_DeviceAttributes_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_DeviceAttributes_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DeviceAttributes_descriptor, - new java.lang.String[] { "Name", "DeviceType", "MemoryLimit", "Locality", "Incarnation", "PhysicalDeviceDesc", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocality.java deleted file mode 100644 index 25d5784a00d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocality.java +++ /dev/null @@ -1,798 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DeviceLocality} - */ -public final class DeviceLocality extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DeviceLocality) - DeviceLocalityOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeviceLocality.newBuilder() to construct. - private DeviceLocality(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeviceLocality() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeviceLocality(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeviceLocality( - 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: { - - busId_ = input.readInt32(); - break; - } - case 16: { - - numaNode_ = input.readInt32(); - break; - } - case 26: { - org.tensorflow.proto.framework.LocalLinks.Builder subBuilder = null; - if (links_ != null) { - subBuilder = links_.toBuilder(); - } - links_ = input.readMessage(org.tensorflow.proto.framework.LocalLinks.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(links_); - links_ = subBuilder.buildPartial(); - } - - 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.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceLocality.class, org.tensorflow.proto.framework.DeviceLocality.Builder.class); - } - - public static final int BUS_ID_FIELD_NUMBER = 1; - private int busId_; - /** - *
    -   * Optional bus locality of device.  Default value of 0 means
    -   * no specific locality.  Specific localities are indexed from 1.
    -   * 
    - * - * int32 bus_id = 1; - */ - public int getBusId() { - return busId_; - } - - public static final int NUMA_NODE_FIELD_NUMBER = 2; - private int numaNode_; - /** - *
    -   * Optional NUMA locality of device.
    -   * 
    - * - * int32 numa_node = 2; - */ - public int getNumaNode() { - return numaNode_; - } - - public static final int LINKS_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.LocalLinks links_; - /** - *
    -   * Optional local interconnect links to other devices.
    -   * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public boolean hasLinks() { - return links_ != null; - } - /** - *
    -   * Optional local interconnect links to other devices.
    -   * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public org.tensorflow.proto.framework.LocalLinks getLinks() { - return links_ == null ? org.tensorflow.proto.framework.LocalLinks.getDefaultInstance() : links_; - } - /** - *
    -   * Optional local interconnect links to other devices.
    -   * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public org.tensorflow.proto.framework.LocalLinksOrBuilder getLinksOrBuilder() { - return getLinks(); - } - - 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 (busId_ != 0) { - output.writeInt32(1, busId_); - } - if (numaNode_ != 0) { - output.writeInt32(2, numaNode_); - } - if (links_ != null) { - output.writeMessage(3, getLinks()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (busId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, busId_); - } - if (numaNode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, numaNode_); - } - if (links_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getLinks()); - } - 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.DeviceLocality)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DeviceLocality other = (org.tensorflow.proto.framework.DeviceLocality) obj; - - if (getBusId() - != other.getBusId()) return false; - if (getNumaNode() - != other.getNumaNode()) return false; - if (hasLinks() != other.hasLinks()) return false; - if (hasLinks()) { - if (!getLinks() - .equals(other.getLinks())) 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) + BUS_ID_FIELD_NUMBER; - hash = (53 * hash) + getBusId(); - hash = (37 * hash) + NUMA_NODE_FIELD_NUMBER; - hash = (53 * hash) + getNumaNode(); - if (hasLinks()) { - hash = (37 * hash) + LINKS_FIELD_NUMBER; - hash = (53 * hash) + getLinks().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DeviceLocality parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceLocality 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.DeviceLocality parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceLocality 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.DeviceLocality parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceLocality parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DeviceLocality parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceLocality 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.DeviceLocality parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceLocality 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.DeviceLocality parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceLocality 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.DeviceLocality 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.DeviceLocality} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DeviceLocality) - org.tensorflow.proto.framework.DeviceLocalityOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceLocality.class, org.tensorflow.proto.framework.DeviceLocality.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DeviceLocality.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(); - busId_ = 0; - - numaNode_ = 0; - - if (linksBuilder_ == null) { - links_ = null; - } else { - links_ = null; - linksBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceLocality getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DeviceLocality.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceLocality build() { - org.tensorflow.proto.framework.DeviceLocality result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceLocality buildPartial() { - org.tensorflow.proto.framework.DeviceLocality result = new org.tensorflow.proto.framework.DeviceLocality(this); - result.busId_ = busId_; - result.numaNode_ = numaNode_; - if (linksBuilder_ == null) { - result.links_ = links_; - } else { - result.links_ = linksBuilder_.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.DeviceLocality) { - return mergeFrom((org.tensorflow.proto.framework.DeviceLocality)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DeviceLocality other) { - if (other == org.tensorflow.proto.framework.DeviceLocality.getDefaultInstance()) return this; - if (other.getBusId() != 0) { - setBusId(other.getBusId()); - } - if (other.getNumaNode() != 0) { - setNumaNode(other.getNumaNode()); - } - if (other.hasLinks()) { - mergeLinks(other.getLinks()); - } - 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.DeviceLocality parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DeviceLocality) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int busId_ ; - /** - *
    -     * Optional bus locality of device.  Default value of 0 means
    -     * no specific locality.  Specific localities are indexed from 1.
    -     * 
    - * - * int32 bus_id = 1; - */ - public int getBusId() { - return busId_; - } - /** - *
    -     * Optional bus locality of device.  Default value of 0 means
    -     * no specific locality.  Specific localities are indexed from 1.
    -     * 
    - * - * int32 bus_id = 1; - */ - public Builder setBusId(int value) { - - busId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optional bus locality of device.  Default value of 0 means
    -     * no specific locality.  Specific localities are indexed from 1.
    -     * 
    - * - * int32 bus_id = 1; - */ - public Builder clearBusId() { - - busId_ = 0; - onChanged(); - return this; - } - - private int numaNode_ ; - /** - *
    -     * Optional NUMA locality of device.
    -     * 
    - * - * int32 numa_node = 2; - */ - public int getNumaNode() { - return numaNode_; - } - /** - *
    -     * Optional NUMA locality of device.
    -     * 
    - * - * int32 numa_node = 2; - */ - public Builder setNumaNode(int value) { - - numaNode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optional NUMA locality of device.
    -     * 
    - * - * int32 numa_node = 2; - */ - public Builder clearNumaNode() { - - numaNode_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.LocalLinks links_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LocalLinks, org.tensorflow.proto.framework.LocalLinks.Builder, org.tensorflow.proto.framework.LocalLinksOrBuilder> linksBuilder_; - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public boolean hasLinks() { - return linksBuilder_ != null || links_ != null; - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public org.tensorflow.proto.framework.LocalLinks getLinks() { - if (linksBuilder_ == null) { - return links_ == null ? org.tensorflow.proto.framework.LocalLinks.getDefaultInstance() : links_; - } else { - return linksBuilder_.getMessage(); - } - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public Builder setLinks(org.tensorflow.proto.framework.LocalLinks value) { - if (linksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - links_ = value; - onChanged(); - } else { - linksBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public Builder setLinks( - org.tensorflow.proto.framework.LocalLinks.Builder builderForValue) { - if (linksBuilder_ == null) { - links_ = builderForValue.build(); - onChanged(); - } else { - linksBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public Builder mergeLinks(org.tensorflow.proto.framework.LocalLinks value) { - if (linksBuilder_ == null) { - if (links_ != null) { - links_ = - org.tensorflow.proto.framework.LocalLinks.newBuilder(links_).mergeFrom(value).buildPartial(); - } else { - links_ = value; - } - onChanged(); - } else { - linksBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public Builder clearLinks() { - if (linksBuilder_ == null) { - links_ = null; - onChanged(); - } else { - links_ = null; - linksBuilder_ = null; - } - - return this; - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public org.tensorflow.proto.framework.LocalLinks.Builder getLinksBuilder() { - - onChanged(); - return getLinksFieldBuilder().getBuilder(); - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - public org.tensorflow.proto.framework.LocalLinksOrBuilder getLinksOrBuilder() { - if (linksBuilder_ != null) { - return linksBuilder_.getMessageOrBuilder(); - } else { - return links_ == null ? - org.tensorflow.proto.framework.LocalLinks.getDefaultInstance() : links_; - } - } - /** - *
    -     * Optional local interconnect links to other devices.
    -     * 
    - * - * .tensorflow.LocalLinks links = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LocalLinks, org.tensorflow.proto.framework.LocalLinks.Builder, org.tensorflow.proto.framework.LocalLinksOrBuilder> - getLinksFieldBuilder() { - if (linksBuilder_ == null) { - linksBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LocalLinks, org.tensorflow.proto.framework.LocalLinks.Builder, org.tensorflow.proto.framework.LocalLinksOrBuilder>( - getLinks(), - getParentForChildren(), - isClean()); - links_ = null; - } - return linksBuilder_; - } - @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.DeviceLocality) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DeviceLocality) - private static final org.tensorflow.proto.framework.DeviceLocality DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DeviceLocality(); - } - - public static org.tensorflow.proto.framework.DeviceLocality getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeviceLocality parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceLocality(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.DeviceLocality getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceProperties.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceProperties.java deleted file mode 100644 index a6e16b28d1f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceProperties.java +++ /dev/null @@ -1,1885 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_properties.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DeviceProperties} - */ -public final class DeviceProperties extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DeviceProperties) - DevicePropertiesOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeviceProperties.newBuilder() to construct. - private DeviceProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeviceProperties() { - type_ = ""; - vendor_ = ""; - model_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeviceProperties(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeviceProperties( - 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(); - - type_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - vendor_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - case 32: { - - frequency_ = input.readInt64(); - break; - } - case 40: { - - numCores_ = input.readInt64(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - environment_ = com.google.protobuf.MapField.newMapField( - EnvironmentDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - environment__ = input.readMessage( - EnvironmentDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - environment_.getMutableMap().put( - environment__.getKey(), environment__.getValue()); - break; - } - case 56: { - - numRegisters_ = input.readInt64(); - break; - } - case 64: { - - l1CacheSize_ = input.readInt64(); - break; - } - case 72: { - - l2CacheSize_ = input.readInt64(); - break; - } - case 80: { - - l3CacheSize_ = input.readInt64(); - break; - } - case 88: { - - sharedMemorySizePerMultiprocessor_ = input.readInt64(); - break; - } - case 96: { - - memorySize_ = input.readInt64(); - break; - } - case 104: { - - bandwidth_ = 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.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetEnvironment(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceProperties.class, org.tensorflow.proto.framework.DeviceProperties.Builder.class); - } - - public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; - /** - *
    -   * Device type (CPU, GPU, ...)
    -   * 
    - * - * string type = 1; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - 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(); - type_ = s; - return s; - } - } - /** - *
    -   * Device type (CPU, GPU, ...)
    -   * 
    - * - * string type = 1; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VENDOR_FIELD_NUMBER = 2; - private volatile java.lang.Object vendor_; - /** - *
    -   * Vendor (Intel, nvidia, ...)
    -   * 
    - * - * string vendor = 2; - */ - public java.lang.String getVendor() { - java.lang.Object ref = vendor_; - 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(); - vendor_ = s; - return s; - } - } - /** - *
    -   * Vendor (Intel, nvidia, ...)
    -   * 
    - * - * string vendor = 2; - */ - public com.google.protobuf.ByteString - getVendorBytes() { - java.lang.Object ref = vendor_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - vendor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MODEL_FIELD_NUMBER = 3; - private volatile java.lang.Object model_; - /** - *
    -   * Model (Haswell, K40, ...)
    -   * 
    - * - * string model = 3; - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - 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(); - model_ = s; - return s; - } - } - /** - *
    -   * Model (Haswell, K40, ...)
    -   * 
    - * - * string model = 3; - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FREQUENCY_FIELD_NUMBER = 4; - private long frequency_; - /** - *
    -   * Core Frequency in Mhz
    -   * 
    - * - * int64 frequency = 4; - */ - public long getFrequency() { - return frequency_; - } - - public static final int NUM_CORES_FIELD_NUMBER = 5; - private long numCores_; - /** - *
    -   * Number of cores
    -   * 
    - * - * int64 num_cores = 5; - */ - public long getNumCores() { - return numCores_; - } - - public static final int ENVIRONMENT_FIELD_NUMBER = 6; - private static final class EnvironmentDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> environment_; - private com.google.protobuf.MapField - internalGetEnvironment() { - if (environment_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EnvironmentDefaultEntryHolder.defaultEntry); - } - return environment_; - } - - public int getEnvironmentCount() { - return internalGetEnvironment().getMap().size(); - } - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - public boolean containsEnvironment( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetEnvironment().getMap().containsKey(key); - } - /** - * Use {@link #getEnvironmentMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEnvironment() { - return getEnvironmentMap(); - } - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - public java.util.Map getEnvironmentMap() { - return internalGetEnvironment().getMap(); - } - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - public java.lang.String getEnvironmentOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvironment().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - public java.lang.String getEnvironmentOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvironment().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int NUM_REGISTERS_FIELD_NUMBER = 7; - private long numRegisters_; - /** - *
    -   * Number of registers per core.
    -   * 
    - * - * int64 num_registers = 7; - */ - public long getNumRegisters() { - return numRegisters_; - } - - public static final int L1_CACHE_SIZE_FIELD_NUMBER = 8; - private long l1CacheSize_; - /** - *
    -   * L1 cache size in bytes
    -   * 
    - * - * int64 l1_cache_size = 8; - */ - public long getL1CacheSize() { - return l1CacheSize_; - } - - public static final int L2_CACHE_SIZE_FIELD_NUMBER = 9; - private long l2CacheSize_; - /** - *
    -   * L2 cache size in bytes
    -   * 
    - * - * int64 l2_cache_size = 9; - */ - public long getL2CacheSize() { - return l2CacheSize_; - } - - public static final int L3_CACHE_SIZE_FIELD_NUMBER = 10; - private long l3CacheSize_; - /** - *
    -   * L3 cache size in bytes
    -   * 
    - * - * int64 l3_cache_size = 10; - */ - public long getL3CacheSize() { - return l3CacheSize_; - } - - public static final int SHARED_MEMORY_SIZE_PER_MULTIPROCESSOR_FIELD_NUMBER = 11; - private long sharedMemorySizePerMultiprocessor_; - /** - *
    -   * Shared memory size per multiprocessor in bytes. This field is
    -   * applicable to GPUs only.
    -   * 
    - * - * int64 shared_memory_size_per_multiprocessor = 11; - */ - public long getSharedMemorySizePerMultiprocessor() { - return sharedMemorySizePerMultiprocessor_; - } - - public static final int MEMORY_SIZE_FIELD_NUMBER = 12; - private long memorySize_; - /** - *
    -   * Memory size in bytes
    -   * 
    - * - * int64 memory_size = 12; - */ - public long getMemorySize() { - return memorySize_; - } - - public static final int BANDWIDTH_FIELD_NUMBER = 13; - private long bandwidth_; - /** - *
    -   * Memory bandwidth in KB/s
    -   * 
    - * - * int64 bandwidth = 13; - */ - public long getBandwidth() { - return bandwidth_; - } - - 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 (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); - } - if (!getVendorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, vendor_); - } - if (!getModelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); - } - if (frequency_ != 0L) { - output.writeInt64(4, frequency_); - } - if (numCores_ != 0L) { - output.writeInt64(5, numCores_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetEnvironment(), - EnvironmentDefaultEntryHolder.defaultEntry, - 6); - if (numRegisters_ != 0L) { - output.writeInt64(7, numRegisters_); - } - if (l1CacheSize_ != 0L) { - output.writeInt64(8, l1CacheSize_); - } - if (l2CacheSize_ != 0L) { - output.writeInt64(9, l2CacheSize_); - } - if (l3CacheSize_ != 0L) { - output.writeInt64(10, l3CacheSize_); - } - if (sharedMemorySizePerMultiprocessor_ != 0L) { - output.writeInt64(11, sharedMemorySizePerMultiprocessor_); - } - if (memorySize_ != 0L) { - output.writeInt64(12, memorySize_); - } - if (bandwidth_ != 0L) { - output.writeInt64(13, bandwidth_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); - } - if (!getVendorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, vendor_); - } - if (!getModelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); - } - if (frequency_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, frequency_); - } - if (numCores_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, numCores_); - } - for (java.util.Map.Entry entry - : internalGetEnvironment().getMap().entrySet()) { - com.google.protobuf.MapEntry - environment__ = EnvironmentDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, environment__); - } - if (numRegisters_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(7, numRegisters_); - } - if (l1CacheSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(8, l1CacheSize_); - } - if (l2CacheSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, l2CacheSize_); - } - if (l3CacheSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, l3CacheSize_); - } - if (sharedMemorySizePerMultiprocessor_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(11, sharedMemorySizePerMultiprocessor_); - } - if (memorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(12, memorySize_); - } - if (bandwidth_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(13, bandwidth_); - } - 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.DeviceProperties)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DeviceProperties other = (org.tensorflow.proto.framework.DeviceProperties) obj; - - if (!getType() - .equals(other.getType())) return false; - if (!getVendor() - .equals(other.getVendor())) return false; - if (!getModel() - .equals(other.getModel())) return false; - if (getFrequency() - != other.getFrequency()) return false; - if (getNumCores() - != other.getNumCores()) return false; - if (!internalGetEnvironment().equals( - other.internalGetEnvironment())) return false; - if (getNumRegisters() - != other.getNumRegisters()) return false; - if (getL1CacheSize() - != other.getL1CacheSize()) return false; - if (getL2CacheSize() - != other.getL2CacheSize()) return false; - if (getL3CacheSize() - != other.getL3CacheSize()) return false; - if (getSharedMemorySizePerMultiprocessor() - != other.getSharedMemorySizePerMultiprocessor()) return false; - if (getMemorySize() - != other.getMemorySize()) return false; - if (getBandwidth() - != other.getBandwidth()) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + VENDOR_FIELD_NUMBER; - hash = (53 * hash) + getVendor().hashCode(); - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFrequency()); - hash = (37 * hash) + NUM_CORES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumCores()); - if (!internalGetEnvironment().getMap().isEmpty()) { - hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; - hash = (53 * hash) + internalGetEnvironment().hashCode(); - } - hash = (37 * hash) + NUM_REGISTERS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumRegisters()); - hash = (37 * hash) + L1_CACHE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getL1CacheSize()); - hash = (37 * hash) + L2_CACHE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getL2CacheSize()); - hash = (37 * hash) + L3_CACHE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getL3CacheSize()); - hash = (37 * hash) + SHARED_MEMORY_SIZE_PER_MULTIPROCESSOR_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSharedMemorySizePerMultiprocessor()); - hash = (37 * hash) + MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMemorySize()); - hash = (37 * hash) + BANDWIDTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBandwidth()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DeviceProperties parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceProperties 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.DeviceProperties parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceProperties 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.DeviceProperties parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceProperties parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DeviceProperties parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceProperties 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.DeviceProperties parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceProperties 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.DeviceProperties parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceProperties 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.DeviceProperties 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.DeviceProperties} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DeviceProperties) - org.tensorflow.proto.framework.DevicePropertiesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetEnvironment(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 6: - return internalGetMutableEnvironment(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceProperties.class, org.tensorflow.proto.framework.DeviceProperties.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DeviceProperties.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(); - type_ = ""; - - vendor_ = ""; - - model_ = ""; - - frequency_ = 0L; - - numCores_ = 0L; - - internalGetMutableEnvironment().clear(); - numRegisters_ = 0L; - - l1CacheSize_ = 0L; - - l2CacheSize_ = 0L; - - l3CacheSize_ = 0L; - - sharedMemorySizePerMultiprocessor_ = 0L; - - memorySize_ = 0L; - - bandwidth_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceProperties getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceProperties build() { - org.tensorflow.proto.framework.DeviceProperties result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceProperties buildPartial() { - org.tensorflow.proto.framework.DeviceProperties result = new org.tensorflow.proto.framework.DeviceProperties(this); - int from_bitField0_ = bitField0_; - result.type_ = type_; - result.vendor_ = vendor_; - result.model_ = model_; - result.frequency_ = frequency_; - result.numCores_ = numCores_; - result.environment_ = internalGetEnvironment(); - result.environment_.makeImmutable(); - result.numRegisters_ = numRegisters_; - result.l1CacheSize_ = l1CacheSize_; - result.l2CacheSize_ = l2CacheSize_; - result.l3CacheSize_ = l3CacheSize_; - result.sharedMemorySizePerMultiprocessor_ = sharedMemorySizePerMultiprocessor_; - result.memorySize_ = memorySize_; - result.bandwidth_ = bandwidth_; - 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.DeviceProperties) { - return mergeFrom((org.tensorflow.proto.framework.DeviceProperties)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DeviceProperties other) { - if (other == org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance()) return this; - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (!other.getVendor().isEmpty()) { - vendor_ = other.vendor_; - onChanged(); - } - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (other.getFrequency() != 0L) { - setFrequency(other.getFrequency()); - } - if (other.getNumCores() != 0L) { - setNumCores(other.getNumCores()); - } - internalGetMutableEnvironment().mergeFrom( - other.internalGetEnvironment()); - if (other.getNumRegisters() != 0L) { - setNumRegisters(other.getNumRegisters()); - } - if (other.getL1CacheSize() != 0L) { - setL1CacheSize(other.getL1CacheSize()); - } - if (other.getL2CacheSize() != 0L) { - setL2CacheSize(other.getL2CacheSize()); - } - if (other.getL3CacheSize() != 0L) { - setL3CacheSize(other.getL3CacheSize()); - } - if (other.getSharedMemorySizePerMultiprocessor() != 0L) { - setSharedMemorySizePerMultiprocessor(other.getSharedMemorySizePerMultiprocessor()); - } - if (other.getMemorySize() != 0L) { - setMemorySize(other.getMemorySize()); - } - if (other.getBandwidth() != 0L) { - setBandwidth(other.getBandwidth()); - } - 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.DeviceProperties parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DeviceProperties) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object type_ = ""; - /** - *
    -     * Device type (CPU, GPU, ...)
    -     * 
    - * - * string type = 1; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Device type (CPU, GPU, ...)
    -     * 
    - * - * string type = 1; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Device type (CPU, GPU, ...)
    -     * 
    - * - * string type = 1; - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device type (CPU, GPU, ...)
    -     * 
    - * - * string type = 1; - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
    -     * Device type (CPU, GPU, ...)
    -     * 
    - * - * string type = 1; - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private java.lang.Object vendor_ = ""; - /** - *
    -     * Vendor (Intel, nvidia, ...)
    -     * 
    - * - * string vendor = 2; - */ - public java.lang.String getVendor() { - java.lang.Object ref = vendor_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - vendor_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Vendor (Intel, nvidia, ...)
    -     * 
    - * - * string vendor = 2; - */ - public com.google.protobuf.ByteString - getVendorBytes() { - java.lang.Object ref = vendor_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - vendor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Vendor (Intel, nvidia, ...)
    -     * 
    - * - * string vendor = 2; - */ - public Builder setVendor( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - vendor_ = value; - onChanged(); - return this; - } - /** - *
    -     * Vendor (Intel, nvidia, ...)
    -     * 
    - * - * string vendor = 2; - */ - public Builder clearVendor() { - - vendor_ = getDefaultInstance().getVendor(); - onChanged(); - return this; - } - /** - *
    -     * Vendor (Intel, nvidia, ...)
    -     * 
    - * - * string vendor = 2; - */ - public Builder setVendorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - vendor_ = value; - onChanged(); - return this; - } - - private java.lang.Object model_ = ""; - /** - *
    -     * Model (Haswell, K40, ...)
    -     * 
    - * - * string model = 3; - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Model (Haswell, K40, ...)
    -     * 
    - * - * string model = 3; - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Model (Haswell, K40, ...)
    -     * 
    - * - * string model = 3; - */ - public Builder setModel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - *
    -     * Model (Haswell, K40, ...)
    -     * 
    - * - * string model = 3; - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - *
    -     * Model (Haswell, K40, ...)
    -     * 
    - * - * string model = 3; - */ - public Builder setModelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private long frequency_ ; - /** - *
    -     * Core Frequency in Mhz
    -     * 
    - * - * int64 frequency = 4; - */ - public long getFrequency() { - return frequency_; - } - /** - *
    -     * Core Frequency in Mhz
    -     * 
    - * - * int64 frequency = 4; - */ - public Builder setFrequency(long value) { - - frequency_ = value; - onChanged(); - return this; - } - /** - *
    -     * Core Frequency in Mhz
    -     * 
    - * - * int64 frequency = 4; - */ - public Builder clearFrequency() { - - frequency_ = 0L; - onChanged(); - return this; - } - - private long numCores_ ; - /** - *
    -     * Number of cores
    -     * 
    - * - * int64 num_cores = 5; - */ - public long getNumCores() { - return numCores_; - } - /** - *
    -     * Number of cores
    -     * 
    - * - * int64 num_cores = 5; - */ - public Builder setNumCores(long value) { - - numCores_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of cores
    -     * 
    - * - * int64 num_cores = 5; - */ - public Builder clearNumCores() { - - numCores_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> environment_; - private com.google.protobuf.MapField - internalGetEnvironment() { - if (environment_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EnvironmentDefaultEntryHolder.defaultEntry); - } - return environment_; - } - private com.google.protobuf.MapField - internalGetMutableEnvironment() { - onChanged();; - if (environment_ == null) { - environment_ = com.google.protobuf.MapField.newMapField( - EnvironmentDefaultEntryHolder.defaultEntry); - } - if (!environment_.isMutable()) { - environment_ = environment_.copy(); - } - return environment_; - } - - public int getEnvironmentCount() { - return internalGetEnvironment().getMap().size(); - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public boolean containsEnvironment( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetEnvironment().getMap().containsKey(key); - } - /** - * Use {@link #getEnvironmentMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEnvironment() { - return getEnvironmentMap(); - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public java.util.Map getEnvironmentMap() { - return internalGetEnvironment().getMap(); - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public java.lang.String getEnvironmentOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvironment().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public java.lang.String getEnvironmentOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvironment().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearEnvironment() { - internalGetMutableEnvironment().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public Builder removeEnvironment( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableEnvironment().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableEnvironment() { - return internalGetMutableEnvironment().getMutableMap(); - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - public Builder putEnvironment( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableEnvironment().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -     * cudnn 5.1)
    -     * 
    - * - * map<string, string> environment = 6; - */ - - public Builder putAllEnvironment( - java.util.Map values) { - internalGetMutableEnvironment().getMutableMap() - .putAll(values); - return this; - } - - private long numRegisters_ ; - /** - *
    -     * Number of registers per core.
    -     * 
    - * - * int64 num_registers = 7; - */ - public long getNumRegisters() { - return numRegisters_; - } - /** - *
    -     * Number of registers per core.
    -     * 
    - * - * int64 num_registers = 7; - */ - public Builder setNumRegisters(long value) { - - numRegisters_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of registers per core.
    -     * 
    - * - * int64 num_registers = 7; - */ - public Builder clearNumRegisters() { - - numRegisters_ = 0L; - onChanged(); - return this; - } - - private long l1CacheSize_ ; - /** - *
    -     * L1 cache size in bytes
    -     * 
    - * - * int64 l1_cache_size = 8; - */ - public long getL1CacheSize() { - return l1CacheSize_; - } - /** - *
    -     * L1 cache size in bytes
    -     * 
    - * - * int64 l1_cache_size = 8; - */ - public Builder setL1CacheSize(long value) { - - l1CacheSize_ = value; - onChanged(); - return this; - } - /** - *
    -     * L1 cache size in bytes
    -     * 
    - * - * int64 l1_cache_size = 8; - */ - public Builder clearL1CacheSize() { - - l1CacheSize_ = 0L; - onChanged(); - return this; - } - - private long l2CacheSize_ ; - /** - *
    -     * L2 cache size in bytes
    -     * 
    - * - * int64 l2_cache_size = 9; - */ - public long getL2CacheSize() { - return l2CacheSize_; - } - /** - *
    -     * L2 cache size in bytes
    -     * 
    - * - * int64 l2_cache_size = 9; - */ - public Builder setL2CacheSize(long value) { - - l2CacheSize_ = value; - onChanged(); - return this; - } - /** - *
    -     * L2 cache size in bytes
    -     * 
    - * - * int64 l2_cache_size = 9; - */ - public Builder clearL2CacheSize() { - - l2CacheSize_ = 0L; - onChanged(); - return this; - } - - private long l3CacheSize_ ; - /** - *
    -     * L3 cache size in bytes
    -     * 
    - * - * int64 l3_cache_size = 10; - */ - public long getL3CacheSize() { - return l3CacheSize_; - } - /** - *
    -     * L3 cache size in bytes
    -     * 
    - * - * int64 l3_cache_size = 10; - */ - public Builder setL3CacheSize(long value) { - - l3CacheSize_ = value; - onChanged(); - return this; - } - /** - *
    -     * L3 cache size in bytes
    -     * 
    - * - * int64 l3_cache_size = 10; - */ - public Builder clearL3CacheSize() { - - l3CacheSize_ = 0L; - onChanged(); - return this; - } - - private long sharedMemorySizePerMultiprocessor_ ; - /** - *
    -     * Shared memory size per multiprocessor in bytes. This field is
    -     * applicable to GPUs only.
    -     * 
    - * - * int64 shared_memory_size_per_multiprocessor = 11; - */ - public long getSharedMemorySizePerMultiprocessor() { - return sharedMemorySizePerMultiprocessor_; - } - /** - *
    -     * Shared memory size per multiprocessor in bytes. This field is
    -     * applicable to GPUs only.
    -     * 
    - * - * int64 shared_memory_size_per_multiprocessor = 11; - */ - public Builder setSharedMemorySizePerMultiprocessor(long value) { - - sharedMemorySizePerMultiprocessor_ = value; - onChanged(); - return this; - } - /** - *
    -     * Shared memory size per multiprocessor in bytes. This field is
    -     * applicable to GPUs only.
    -     * 
    - * - * int64 shared_memory_size_per_multiprocessor = 11; - */ - public Builder clearSharedMemorySizePerMultiprocessor() { - - sharedMemorySizePerMultiprocessor_ = 0L; - onChanged(); - return this; - } - - private long memorySize_ ; - /** - *
    -     * Memory size in bytes
    -     * 
    - * - * int64 memory_size = 12; - */ - public long getMemorySize() { - return memorySize_; - } - /** - *
    -     * Memory size in bytes
    -     * 
    - * - * int64 memory_size = 12; - */ - public Builder setMemorySize(long value) { - - memorySize_ = value; - onChanged(); - return this; - } - /** - *
    -     * Memory size in bytes
    -     * 
    - * - * int64 memory_size = 12; - */ - public Builder clearMemorySize() { - - memorySize_ = 0L; - onChanged(); - return this; - } - - private long bandwidth_ ; - /** - *
    -     * Memory bandwidth in KB/s
    -     * 
    - * - * int64 bandwidth = 13; - */ - public long getBandwidth() { - return bandwidth_; - } - /** - *
    -     * Memory bandwidth in KB/s
    -     * 
    - * - * int64 bandwidth = 13; - */ - public Builder setBandwidth(long value) { - - bandwidth_ = value; - onChanged(); - return this; - } - /** - *
    -     * Memory bandwidth in KB/s
    -     * 
    - * - * int64 bandwidth = 13; - */ - public Builder clearBandwidth() { - - bandwidth_ = 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.DeviceProperties) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DeviceProperties) - private static final org.tensorflow.proto.framework.DeviceProperties DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DeviceProperties(); - } - - public static org.tensorflow.proto.framework.DeviceProperties getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeviceProperties parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceProperties(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.DeviceProperties getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesOrBuilder.java deleted file mode 100644 index 675627a60fa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesOrBuilder.java +++ /dev/null @@ -1,204 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_properties.proto - -package org.tensorflow.proto.framework; - -public interface DevicePropertiesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DeviceProperties) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Device type (CPU, GPU, ...)
    -   * 
    - * - * string type = 1; - */ - java.lang.String getType(); - /** - *
    -   * Device type (CPU, GPU, ...)
    -   * 
    - * - * string type = 1; - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
    -   * Vendor (Intel, nvidia, ...)
    -   * 
    - * - * string vendor = 2; - */ - java.lang.String getVendor(); - /** - *
    -   * Vendor (Intel, nvidia, ...)
    -   * 
    - * - * string vendor = 2; - */ - com.google.protobuf.ByteString - getVendorBytes(); - - /** - *
    -   * Model (Haswell, K40, ...)
    -   * 
    - * - * string model = 3; - */ - java.lang.String getModel(); - /** - *
    -   * Model (Haswell, K40, ...)
    -   * 
    - * - * string model = 3; - */ - com.google.protobuf.ByteString - getModelBytes(); - - /** - *
    -   * Core Frequency in Mhz
    -   * 
    - * - * int64 frequency = 4; - */ - long getFrequency(); - - /** - *
    -   * Number of cores
    -   * 
    - * - * int64 num_cores = 5; - */ - long getNumCores(); - - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - int getEnvironmentCount(); - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - boolean containsEnvironment( - java.lang.String key); - /** - * Use {@link #getEnvironmentMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getEnvironment(); - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - java.util.Map - getEnvironmentMap(); - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - java.lang.String getEnvironmentOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
    -   * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    -   * cudnn 5.1)
    -   * 
    - * - * map<string, string> environment = 6; - */ - - java.lang.String getEnvironmentOrThrow( - java.lang.String key); - - /** - *
    -   * Number of registers per core.
    -   * 
    - * - * int64 num_registers = 7; - */ - long getNumRegisters(); - - /** - *
    -   * L1 cache size in bytes
    -   * 
    - * - * int64 l1_cache_size = 8; - */ - long getL1CacheSize(); - - /** - *
    -   * L2 cache size in bytes
    -   * 
    - * - * int64 l2_cache_size = 9; - */ - long getL2CacheSize(); - - /** - *
    -   * L3 cache size in bytes
    -   * 
    - * - * int64 l3_cache_size = 10; - */ - long getL3CacheSize(); - - /** - *
    -   * Shared memory size per multiprocessor in bytes. This field is
    -   * applicable to GPUs only.
    -   * 
    - * - * int64 shared_memory_size_per_multiprocessor = 11; - */ - long getSharedMemorySizePerMultiprocessor(); - - /** - *
    -   * Memory size in bytes
    -   * 
    - * - * int64 memory_size = 12; - */ - long getMemorySize(); - - /** - *
    -   * Memory bandwidth in KB/s
    -   * 
    - * - * int64 bandwidth = 13; - */ - long getBandwidth(); -} 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 deleted file mode 100644 index 6bb89de6ab8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DevicePropertiesProtos.java +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_properties.proto - -package org.tensorflow.proto.framework; - -public final class DevicePropertiesProtos { - private DevicePropertiesProtos() {} - 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_DeviceProperties_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DeviceProperties_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DeviceProperties_EnvironmentEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NamedDevice_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NamedDevice_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0tensorflow/core/protobuf/device_proper" + - "ties.proto\022\ntensorflow\"\220\003\n\020DevicePropert" + - "ies\022\014\n\004type\030\001 \001(\t\022\016\n\006vendor\030\002 \001(\t\022\r\n\005mod" + - "el\030\003 \001(\t\022\021\n\tfrequency\030\004 \001(\003\022\021\n\tnum_cores" + - "\030\005 \001(\003\022B\n\013environment\030\006 \003(\0132-.tensorflow" + - ".DeviceProperties.EnvironmentEntry\022\025\n\rnu" + - "m_registers\030\007 \001(\003\022\025\n\rl1_cache_size\030\010 \001(\003" + - "\022\025\n\rl2_cache_size\030\t \001(\003\022\025\n\rl3_cache_size" + - "\030\n \001(\003\022-\n%shared_memory_size_per_multipr" + - "ocessor\030\013 \001(\003\022\023\n\013memory_size\030\014 \001(\003\022\021\n\tba" + - "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\224\001\n\036org.tensorf" + - "low.proto.frameworkB\026DevicePropertiesPro" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_DeviceProperties_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_DeviceProperties_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DeviceProperties_descriptor, - new java.lang.String[] { "Type", "Vendor", "Model", "Frequency", "NumCores", "Environment", "NumRegisters", "L1CacheSize", "L2CacheSize", "L3CacheSize", "SharedMemorySizePerMultiprocessor", "MemorySize", "Bandwidth", }); - internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor = - internal_static_tensorflow_DeviceProperties_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_DeviceProperties_EnvironmentEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_NamedDevice_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_NamedDevice_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NamedDevice_descriptor, - new java.lang.String[] { "Name", "Properties", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStats.java deleted file mode 100644 index 8da65e2b3d5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStats.java +++ /dev/null @@ -1,1209 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.DeviceStepStats} - */ -public final class DeviceStepStats extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DeviceStepStats) - DeviceStepStatsOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeviceStepStats.newBuilder() to construct. - private DeviceStepStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeviceStepStats() { - device_ = ""; - nodeStats_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeviceStepStats(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeviceStepStats( - 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(); - - device_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - nodeStats_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nodeStats_.add( - input.readMessage(org.tensorflow.proto.framework.NodeExecStats.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - threadNames_ = com.google.protobuf.MapField.newMapField( - ThreadNamesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - threadNames__ = input.readMessage( - ThreadNamesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - threadNames_.getMutableMap().put( - threadNames__.getKey(), threadNames__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - nodeStats_ = java.util.Collections.unmodifiableList(nodeStats_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetThreadNames(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceStepStats.class, org.tensorflow.proto.framework.DeviceStepStats.Builder.class); - } - - public static final int DEVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object device_; - /** - * string device = 1; - */ - 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 = 1; - */ - 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 NODE_STATS_FIELD_NUMBER = 2; - private java.util.List nodeStats_; - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public java.util.List getNodeStatsList() { - return nodeStats_; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public java.util.List - getNodeStatsOrBuilderList() { - return nodeStats_; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public int getNodeStatsCount() { - return nodeStats_.size(); - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStats getNodeStats(int index) { - return nodeStats_.get(index); - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStatsOrBuilder getNodeStatsOrBuilder( - int index) { - return nodeStats_.get(index); - } - - public static final int THREAD_NAMES_FIELD_NUMBER = 3; - private static final class ThreadNamesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0, - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.String> threadNames_; - private com.google.protobuf.MapField - internalGetThreadNames() { - if (threadNames_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ThreadNamesDefaultEntryHolder.defaultEntry); - } - return threadNames_; - } - - public int getThreadNamesCount() { - return internalGetThreadNames().getMap().size(); - } - /** - *
    -   * Its key is thread id.
    -   * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public boolean containsThreadNames( - int key) { - - return internalGetThreadNames().getMap().containsKey(key); - } - /** - * Use {@link #getThreadNamesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getThreadNames() { - return getThreadNamesMap(); - } - /** - *
    -   * Its key is thread id.
    -   * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.util.Map getThreadNamesMap() { - return internalGetThreadNames().getMap(); - } - /** - *
    -   * Its key is thread id.
    -   * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.lang.String getThreadNamesOrDefault( - int key, - java.lang.String defaultValue) { - - java.util.Map map = - internalGetThreadNames().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Its key is thread id.
    -   * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.lang.String getThreadNamesOrThrow( - int key) { - - java.util.Map map = - internalGetThreadNames().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 (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_); - } - for (int i = 0; i < nodeStats_.size(); i++) { - output.writeMessage(2, nodeStats_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetThreadNames(), - ThreadNamesDefaultEntryHolder.defaultEntry, - 3); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_); - } - for (int i = 0; i < nodeStats_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, nodeStats_.get(i)); - } - for (java.util.Map.Entry entry - : internalGetThreadNames().getMap().entrySet()) { - com.google.protobuf.MapEntry - threadNames__ = ThreadNamesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, threadNames__); - } - 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.DeviceStepStats)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DeviceStepStats other = (org.tensorflow.proto.framework.DeviceStepStats) obj; - - if (!getDevice() - .equals(other.getDevice())) return false; - if (!getNodeStatsList() - .equals(other.getNodeStatsList())) return false; - if (!internalGetThreadNames().equals( - other.internalGetThreadNames())) 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_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - if (getNodeStatsCount() > 0) { - hash = (37 * hash) + NODE_STATS_FIELD_NUMBER; - hash = (53 * hash) + getNodeStatsList().hashCode(); - } - if (!internalGetThreadNames().getMap().isEmpty()) { - hash = (37 * hash) + THREAD_NAMES_FIELD_NUMBER; - hash = (53 * hash) + internalGetThreadNames().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DeviceStepStats parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceStepStats 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.DeviceStepStats parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceStepStats 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.DeviceStepStats parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DeviceStepStats parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DeviceStepStats parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceStepStats 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.DeviceStepStats parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceStepStats 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.DeviceStepStats parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DeviceStepStats 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.DeviceStepStats 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.DeviceStepStats} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DeviceStepStats) - org.tensorflow.proto.framework.DeviceStepStatsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 3: - return internalGetThreadNames(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 3: - return internalGetMutableThreadNames(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DeviceStepStats.class, org.tensorflow.proto.framework.DeviceStepStats.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DeviceStepStats.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeStatsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - device_ = ""; - - if (nodeStatsBuilder_ == null) { - nodeStats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodeStatsBuilder_.clear(); - } - internalGetMutableThreadNames().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceStepStats getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DeviceStepStats.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceStepStats build() { - org.tensorflow.proto.framework.DeviceStepStats result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DeviceStepStats buildPartial() { - org.tensorflow.proto.framework.DeviceStepStats result = new org.tensorflow.proto.framework.DeviceStepStats(this); - int from_bitField0_ = bitField0_; - result.device_ = device_; - if (nodeStatsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nodeStats_ = java.util.Collections.unmodifiableList(nodeStats_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nodeStats_ = nodeStats_; - } else { - result.nodeStats_ = nodeStatsBuilder_.build(); - } - result.threadNames_ = internalGetThreadNames(); - result.threadNames_.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.DeviceStepStats) { - return mergeFrom((org.tensorflow.proto.framework.DeviceStepStats)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DeviceStepStats other) { - if (other == org.tensorflow.proto.framework.DeviceStepStats.getDefaultInstance()) return this; - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - if (nodeStatsBuilder_ == null) { - if (!other.nodeStats_.isEmpty()) { - if (nodeStats_.isEmpty()) { - nodeStats_ = other.nodeStats_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodeStatsIsMutable(); - nodeStats_.addAll(other.nodeStats_); - } - onChanged(); - } - } else { - if (!other.nodeStats_.isEmpty()) { - if (nodeStatsBuilder_.isEmpty()) { - nodeStatsBuilder_.dispose(); - nodeStatsBuilder_ = null; - nodeStats_ = other.nodeStats_; - bitField0_ = (bitField0_ & ~0x00000001); - nodeStatsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeStatsFieldBuilder() : null; - } else { - nodeStatsBuilder_.addAllMessages(other.nodeStats_); - } - } - } - internalGetMutableThreadNames().mergeFrom( - other.internalGetThreadNames()); - 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.DeviceStepStats parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DeviceStepStats) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object device_ = ""; - /** - * string device = 1; - */ - 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 = 1; - */ - 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 = 1; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - * string device = 1; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - * string device = 1; - */ - 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 nodeStats_ = - java.util.Collections.emptyList(); - private void ensureNodeStatsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nodeStats_ = new java.util.ArrayList(nodeStats_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder> nodeStatsBuilder_; - - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public java.util.List getNodeStatsList() { - if (nodeStatsBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeStats_); - } else { - return nodeStatsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public int getNodeStatsCount() { - if (nodeStatsBuilder_ == null) { - return nodeStats_.size(); - } else { - return nodeStatsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStats getNodeStats(int index) { - if (nodeStatsBuilder_ == null) { - return nodeStats_.get(index); - } else { - return nodeStatsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder setNodeStats( - int index, org.tensorflow.proto.framework.NodeExecStats value) { - if (nodeStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeStatsIsMutable(); - nodeStats_.set(index, value); - onChanged(); - } else { - nodeStatsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder setNodeStats( - int index, org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) { - if (nodeStatsBuilder_ == null) { - ensureNodeStatsIsMutable(); - nodeStats_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeStatsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder addNodeStats(org.tensorflow.proto.framework.NodeExecStats value) { - if (nodeStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeStatsIsMutable(); - nodeStats_.add(value); - onChanged(); - } else { - nodeStatsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder addNodeStats( - int index, org.tensorflow.proto.framework.NodeExecStats value) { - if (nodeStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeStatsIsMutable(); - nodeStats_.add(index, value); - onChanged(); - } else { - nodeStatsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder addNodeStats( - org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) { - if (nodeStatsBuilder_ == null) { - ensureNodeStatsIsMutable(); - nodeStats_.add(builderForValue.build()); - onChanged(); - } else { - nodeStatsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder addNodeStats( - int index, org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) { - if (nodeStatsBuilder_ == null) { - ensureNodeStatsIsMutable(); - nodeStats_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeStatsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder addAllNodeStats( - java.lang.Iterable values) { - if (nodeStatsBuilder_ == null) { - ensureNodeStatsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeStats_); - onChanged(); - } else { - nodeStatsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder clearNodeStats() { - if (nodeStatsBuilder_ == null) { - nodeStats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodeStatsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public Builder removeNodeStats(int index) { - if (nodeStatsBuilder_ == null) { - ensureNodeStatsIsMutable(); - nodeStats_.remove(index); - onChanged(); - } else { - nodeStatsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStats.Builder getNodeStatsBuilder( - int index) { - return getNodeStatsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStatsOrBuilder getNodeStatsOrBuilder( - int index) { - if (nodeStatsBuilder_ == null) { - return nodeStats_.get(index); } else { - return nodeStatsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public java.util.List - getNodeStatsOrBuilderList() { - if (nodeStatsBuilder_ != null) { - return nodeStatsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeStats_); - } - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStats.Builder addNodeStatsBuilder() { - return getNodeStatsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public org.tensorflow.proto.framework.NodeExecStats.Builder addNodeStatsBuilder( - int index) { - return getNodeStatsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeExecStats node_stats = 2; - */ - public java.util.List - getNodeStatsBuilderList() { - return getNodeStatsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder> - getNodeStatsFieldBuilder() { - if (nodeStatsBuilder_ == null) { - nodeStatsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder>( - nodeStats_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nodeStats_ = null; - } - return nodeStatsBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.String> threadNames_; - private com.google.protobuf.MapField - internalGetThreadNames() { - if (threadNames_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ThreadNamesDefaultEntryHolder.defaultEntry); - } - return threadNames_; - } - private com.google.protobuf.MapField - internalGetMutableThreadNames() { - onChanged();; - if (threadNames_ == null) { - threadNames_ = com.google.protobuf.MapField.newMapField( - ThreadNamesDefaultEntryHolder.defaultEntry); - } - if (!threadNames_.isMutable()) { - threadNames_ = threadNames_.copy(); - } - return threadNames_; - } - - public int getThreadNamesCount() { - return internalGetThreadNames().getMap().size(); - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public boolean containsThreadNames( - int key) { - - return internalGetThreadNames().getMap().containsKey(key); - } - /** - * Use {@link #getThreadNamesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getThreadNames() { - return getThreadNamesMap(); - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.util.Map getThreadNamesMap() { - return internalGetThreadNames().getMap(); - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.lang.String getThreadNamesOrDefault( - int key, - java.lang.String defaultValue) { - - java.util.Map map = - internalGetThreadNames().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public java.lang.String getThreadNamesOrThrow( - int key) { - - java.util.Map map = - internalGetThreadNames().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearThreadNames() { - internalGetMutableThreadNames().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public Builder removeThreadNames( - int key) { - - internalGetMutableThreadNames().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableThreadNames() { - return internalGetMutableThreadNames().getMutableMap(); - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - public Builder putThreadNames( - int key, - java.lang.String value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableThreadNames().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Its key is thread id.
    -     * 
    - * - * map<uint32, string> thread_names = 3; - */ - - public Builder putAllThreadNames( - java.util.Map values) { - internalGetMutableThreadNames().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.DeviceStepStats) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DeviceStepStats) - private static final org.tensorflow.proto.framework.DeviceStepStats DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DeviceStepStats(); - } - - public static org.tensorflow.proto.framework.DeviceStepStats getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeviceStepStats parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceStepStats(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.DeviceStepStats getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValue.java deleted file mode 100644 index e8e6321372f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValue.java +++ /dev/null @@ -1,705 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a Python dict keyed by `str`.
    - * The comment on Unicode from Value.string_value applies analogously.
    - * 
    - * - * Protobuf type {@code tensorflow.DictValue} - */ -public final class DictValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DictValue) - DictValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use DictValue.newBuilder() to construct. - private DictValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DictValue() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DictValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DictValue( - 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)) { - fields_ = com.google.protobuf.MapField.newMapField( - FieldsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - fields__ = input.readMessage( - FieldsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - fields_.getMutableMap().put( - fields__.getKey(), fields__.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.StructProtos.internal_static_tensorflow_DictValue_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFields(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_DictValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DictValue.class, org.tensorflow.proto.framework.DictValue.Builder.class); - } - - public static final int FIELDS_FIELD_NUMBER = 1; - private static final class FieldsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.StructuredValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_DictValue_FieldsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.StructuredValue> fields_; - private com.google.protobuf.MapField - internalGetFields() { - if (fields_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FieldsDefaultEntryHolder.defaultEntry); - } - return fields_; - } - - public int getFieldsCount() { - return internalGetFields().getMap().size(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public boolean containsFields( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFields().getMap().containsKey(key); - } - /** - * Use {@link #getFieldsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFields() { - return getFieldsMap(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public java.util.Map getFieldsMap() { - return internalGetFields().getMap(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public org.tensorflow.proto.framework.StructuredValue getFieldsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.StructuredValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFields().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public org.tensorflow.proto.framework.StructuredValue getFieldsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFields().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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFields(), - FieldsDefaultEntryHolder.defaultEntry, - 1); - 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 - : internalGetFields().getMap().entrySet()) { - com.google.protobuf.MapEntry - fields__ = FieldsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, fields__); - } - 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.DictValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.DictValue other = (org.tensorflow.proto.framework.DictValue) obj; - - if (!internalGetFields().equals( - other.internalGetFields())) 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 (!internalGetFields().getMap().isEmpty()) { - hash = (37 * hash) + FIELDS_FIELD_NUMBER; - hash = (53 * hash) + internalGetFields().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.DictValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DictValue 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.DictValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DictValue 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.DictValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.DictValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.DictValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DictValue 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.DictValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DictValue 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.DictValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.DictValue 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.DictValue 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; - } - /** - *
    -   * Represents a Python dict keyed by `str`.
    -   * The comment on Unicode from Value.string_value applies analogously.
    -   * 
    - * - * Protobuf type {@code tensorflow.DictValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DictValue) - org.tensorflow.proto.framework.DictValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_DictValue_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetFields(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableFields(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_DictValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.DictValue.class, org.tensorflow.proto.framework.DictValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.DictValue.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(); - internalGetMutableFields().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_DictValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DictValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.DictValue build() { - org.tensorflow.proto.framework.DictValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.DictValue buildPartial() { - org.tensorflow.proto.framework.DictValue result = new org.tensorflow.proto.framework.DictValue(this); - int from_bitField0_ = bitField0_; - result.fields_ = internalGetFields(); - result.fields_.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.DictValue) { - return mergeFrom((org.tensorflow.proto.framework.DictValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.DictValue other) { - if (other == org.tensorflow.proto.framework.DictValue.getDefaultInstance()) return this; - internalGetMutableFields().mergeFrom( - other.internalGetFields()); - 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.DictValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.DictValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.StructuredValue> fields_; - private com.google.protobuf.MapField - internalGetFields() { - if (fields_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FieldsDefaultEntryHolder.defaultEntry); - } - return fields_; - } - private com.google.protobuf.MapField - internalGetMutableFields() { - onChanged();; - if (fields_ == null) { - fields_ = com.google.protobuf.MapField.newMapField( - FieldsDefaultEntryHolder.defaultEntry); - } - if (!fields_.isMutable()) { - fields_ = fields_.copy(); - } - return fields_; - } - - public int getFieldsCount() { - return internalGetFields().getMap().size(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public boolean containsFields( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFields().getMap().containsKey(key); - } - /** - * Use {@link #getFieldsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFields() { - return getFieldsMap(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public java.util.Map getFieldsMap() { - return internalGetFields().getMap(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public org.tensorflow.proto.framework.StructuredValue getFieldsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.StructuredValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFields().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public org.tensorflow.proto.framework.StructuredValue getFieldsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFields().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFields() { - internalGetMutableFields().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public Builder removeFields( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFields().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFields() { - return internalGetMutableFields().getMutableMap(); - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - public Builder putFields( - java.lang.String key, - org.tensorflow.proto.framework.StructuredValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFields().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - public Builder putAllFields( - java.util.Map values) { - internalGetMutableFields().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.DictValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DictValue) - private static final org.tensorflow.proto.framework.DictValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.DictValue(); - } - - public static org.tensorflow.proto.framework.DictValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DictValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DictValue(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.DictValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValueOrBuilder.java deleted file mode 100644 index 527fdffc935..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DictValueOrBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface DictValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DictValue) - com.google.protobuf.MessageOrBuilder { - - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - int getFieldsCount(); - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - boolean containsFields( - java.lang.String key); - /** - * Use {@link #getFieldsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getFields(); - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - java.util.Map - getFieldsMap(); - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - org.tensorflow.proto.framework.StructuredValue getFieldsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.StructuredValue defaultValue); - /** - * map<string, .tensorflow.StructuredValue> fields = 1; - */ - - org.tensorflow.proto.framework.StructuredValue getFieldsOrThrow( - java.lang.String key); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodes.java deleted file mode 100644 index 113b8465373..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodes.java +++ /dev/null @@ -1,40 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/lib/core/error_codes.proto - -package org.tensorflow.proto.framework; - -public final class ErrorCodes { - private ErrorCodes() {} - 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 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/lib/core/error_codes.p" + - "roto\032*tensorflow/core/protobuf/error_cod" + - "es.protoB \n\036org.tensorflow.proto.framewo" + - "rkP\000b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.ErrorCodesProtos.getDescriptor(), - }); - org.tensorflow.proto.framework.ErrorCodesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} 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 deleted file mode 100644 index 62a883df465..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ErrorCodesProtos.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/error_codes.proto - -package org.tensorflow.proto.framework; - -public final class ErrorCodesProtos { - private ErrorCodesProtos() {} - 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 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/error_codes.p" + - "roto\022\020tensorflow.error*\204\003\n\004Code\022\006\n\002OK\020\000\022" + - "\r\n\tCANCELLED\020\001\022\013\n\007UNKNOWN\020\002\022\024\n\020INVALID_A" + - "RGUMENT\020\003\022\025\n\021DEADLINE_EXCEEDED\020\004\022\r\n\tNOT_" + - "FOUND\020\005\022\022\n\016ALREADY_EXISTS\020\006\022\025\n\021PERMISSIO" + - "N_DENIED\020\007\022\023\n\017UNAUTHENTICATED\020\020\022\026\n\022RESOU" + - "RCE_EXHAUSTED\020\010\022\027\n\023FAILED_PRECONDITION\020\t" + - "\022\013\n\007ABORTED\020\n\022\020\n\014OUT_OF_RANGE\020\013\022\021\n\rUNIMP" + - "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\216\001\n\036org.tensorflow.proto.f" + - "rameworkB\020ErrorCodesProtosP\001ZUgithub.com" + - "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/protobuf/for_core_protos_go_proto\370\001\001b\006" + - "proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDef.java deleted file mode 100644 index f075850d17f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDef.java +++ /dev/null @@ -1,1126 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/full_type.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Highly experimental and very likely to change.
    - * This encoding uses tags instead of dedicated messages for regularity. In
    - * particular the encoding imposes no restrictions on what the parameters of any
    - * type should be, which in particular needs to be true for type symbols.
    - * 
    - * - * Protobuf type {@code tensorflow.FullTypeDef} - */ -public final class FullTypeDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FullTypeDef) - FullTypeDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use FullTypeDef.newBuilder() to construct. - private FullTypeDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FullTypeDef() { - typeId_ = 0; - args_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FullTypeDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FullTypeDef( - 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: { - int rawValue = input.readEnum(); - - typeId_ = rawValue; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - args_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - args_.add( - input.readMessage(org.tensorflow.proto.framework.FullTypeDef.parser(), extensionRegistry)); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - attrCase_ = 3; - attr_ = s; - 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)) { - args_ = java.util.Collections.unmodifiableList(args_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FullTypeProtos.internal_static_tensorflow_FullTypeDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FullTypeDef.class, org.tensorflow.proto.framework.FullTypeDef.Builder.class); - } - - private int attrCase_ = 0; - private java.lang.Object attr_; - public enum AttrCase - implements com.google.protobuf.Internal.EnumLite { - S(3), - ATTR_NOT_SET(0); - private final int value; - private AttrCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AttrCase valueOf(int value) { - return forNumber(value); - } - - public static AttrCase forNumber(int value) { - switch (value) { - case 3: return S; - case 0: return ATTR_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public AttrCase - getAttrCase() { - return AttrCase.forNumber( - attrCase_); - } - - public static final int TYPE_ID_FIELD_NUMBER = 1; - private int typeId_; - /** - *
    -   * The principal type represented by this object. This may be a concrete type
    -   * (Tensor, Dataset) a type variable (used for dependent types) a type
    -   * symbol (Any, Union). See FullTypeId for details.
    -   * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public int getTypeIdValue() { - return typeId_; - } - /** - *
    -   * The principal type represented by this object. This may be a concrete type
    -   * (Tensor, Dataset) a type variable (used for dependent types) a type
    -   * symbol (Any, Union). See FullTypeId for details.
    -   * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public org.tensorflow.proto.framework.FullTypeId getTypeId() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FullTypeId result = org.tensorflow.proto.framework.FullTypeId.valueOf(typeId_); - return result == null ? org.tensorflow.proto.framework.FullTypeId.UNRECOGNIZED : result; - } - - public static final int ARGS_FIELD_NUMBER = 2; - private java.util.List args_; - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public java.util.List getArgsList() { - return args_; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public java.util.List - getArgsOrBuilderList() { - return args_; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public int getArgsCount() { - return args_.size(); - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDef getArgs(int index) { - return args_.get(index); - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDefOrBuilder getArgsOrBuilder( - int index) { - return args_.get(index); - } - - public static final int S_FIELD_NUMBER = 3; - /** - * string s = 3; - */ - public java.lang.String getS() { - java.lang.Object ref = ""; - if (attrCase_ == 3) { - ref = attr_; - } - 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(); - if (attrCase_ == 3) { - attr_ = s; - } - return s; - } - } - /** - * string s = 3; - */ - public com.google.protobuf.ByteString - getSBytes() { - java.lang.Object ref = ""; - if (attrCase_ == 3) { - ref = attr_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (attrCase_ == 3) { - attr_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (typeId_ != org.tensorflow.proto.framework.FullTypeId.TFT_UNSET.getNumber()) { - output.writeEnum(1, typeId_); - } - for (int i = 0; i < args_.size(); i++) { - output.writeMessage(2, args_.get(i)); - } - if (attrCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, attr_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeId_ != org.tensorflow.proto.framework.FullTypeId.TFT_UNSET.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, typeId_); - } - for (int i = 0; i < args_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, args_.get(i)); - } - if (attrCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, attr_); - } - 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.FullTypeDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.FullTypeDef other = (org.tensorflow.proto.framework.FullTypeDef) obj; - - if (typeId_ != other.typeId_) return false; - if (!getArgsList() - .equals(other.getArgsList())) return false; - if (!getAttrCase().equals(other.getAttrCase())) return false; - switch (attrCase_) { - case 3: - if (!getS() - .equals(other.getS())) return false; - break; - case 0: - default: - } - 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) + TYPE_ID_FIELD_NUMBER; - hash = (53 * hash) + typeId_; - if (getArgsCount() > 0) { - hash = (37 * hash) + ARGS_FIELD_NUMBER; - hash = (53 * hash) + getArgsList().hashCode(); - } - switch (attrCase_) { - case 3: - hash = (37 * hash) + S_FIELD_NUMBER; - hash = (53 * hash) + getS().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.FullTypeDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FullTypeDef 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.FullTypeDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FullTypeDef 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.FullTypeDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FullTypeDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.FullTypeDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FullTypeDef 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.FullTypeDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FullTypeDef 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.FullTypeDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FullTypeDef 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.FullTypeDef 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; - } - /** - *
    -   * Highly experimental and very likely to change.
    -   * This encoding uses tags instead of dedicated messages for regularity. In
    -   * particular the encoding imposes no restrictions on what the parameters of any
    -   * type should be, which in particular needs to be true for type symbols.
    -   * 
    - * - * Protobuf type {@code tensorflow.FullTypeDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FullTypeDef) - org.tensorflow.proto.framework.FullTypeDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FullTypeProtos.internal_static_tensorflow_FullTypeDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FullTypeDef.class, org.tensorflow.proto.framework.FullTypeDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.FullTypeDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getArgsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - typeId_ = 0; - - if (argsBuilder_ == null) { - args_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - argsBuilder_.clear(); - } - attrCase_ = 0; - attr_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FullTypeDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.FullTypeDef build() { - org.tensorflow.proto.framework.FullTypeDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FullTypeDef buildPartial() { - org.tensorflow.proto.framework.FullTypeDef result = new org.tensorflow.proto.framework.FullTypeDef(this); - int from_bitField0_ = bitField0_; - result.typeId_ = typeId_; - if (argsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - args_ = java.util.Collections.unmodifiableList(args_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.args_ = args_; - } else { - result.args_ = argsBuilder_.build(); - } - if (attrCase_ == 3) { - result.attr_ = attr_; - } - result.attrCase_ = attrCase_; - 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.FullTypeDef) { - return mergeFrom((org.tensorflow.proto.framework.FullTypeDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.FullTypeDef other) { - if (other == org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance()) return this; - if (other.typeId_ != 0) { - setTypeIdValue(other.getTypeIdValue()); - } - if (argsBuilder_ == null) { - if (!other.args_.isEmpty()) { - if (args_.isEmpty()) { - args_ = other.args_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureArgsIsMutable(); - args_.addAll(other.args_); - } - onChanged(); - } - } else { - if (!other.args_.isEmpty()) { - if (argsBuilder_.isEmpty()) { - argsBuilder_.dispose(); - argsBuilder_ = null; - args_ = other.args_; - bitField0_ = (bitField0_ & ~0x00000001); - argsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getArgsFieldBuilder() : null; - } else { - argsBuilder_.addAllMessages(other.args_); - } - } - } - switch (other.getAttrCase()) { - case S: { - attrCase_ = 3; - attr_ = other.attr_; - onChanged(); - break; - } - case ATTR_NOT_SET: { - break; - } - } - 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.FullTypeDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.FullTypeDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int attrCase_ = 0; - private java.lang.Object attr_; - public AttrCase - getAttrCase() { - return AttrCase.forNumber( - attrCase_); - } - - public Builder clearAttr() { - attrCase_ = 0; - attr_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private int typeId_ = 0; - /** - *
    -     * The principal type represented by this object. This may be a concrete type
    -     * (Tensor, Dataset) a type variable (used for dependent types) a type
    -     * symbol (Any, Union). See FullTypeId for details.
    -     * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public int getTypeIdValue() { - return typeId_; - } - /** - *
    -     * The principal type represented by this object. This may be a concrete type
    -     * (Tensor, Dataset) a type variable (used for dependent types) a type
    -     * symbol (Any, Union). See FullTypeId for details.
    -     * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public Builder setTypeIdValue(int value) { - typeId_ = value; - onChanged(); - return this; - } - /** - *
    -     * The principal type represented by this object. This may be a concrete type
    -     * (Tensor, Dataset) a type variable (used for dependent types) a type
    -     * symbol (Any, Union). See FullTypeId for details.
    -     * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public org.tensorflow.proto.framework.FullTypeId getTypeId() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FullTypeId result = org.tensorflow.proto.framework.FullTypeId.valueOf(typeId_); - return result == null ? org.tensorflow.proto.framework.FullTypeId.UNRECOGNIZED : result; - } - /** - *
    -     * The principal type represented by this object. This may be a concrete type
    -     * (Tensor, Dataset) a type variable (used for dependent types) a type
    -     * symbol (Any, Union). See FullTypeId for details.
    -     * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public Builder setTypeId(org.tensorflow.proto.framework.FullTypeId value) { - if (value == null) { - throw new NullPointerException(); - } - - typeId_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * The principal type represented by this object. This may be a concrete type
    -     * (Tensor, Dataset) a type variable (used for dependent types) a type
    -     * symbol (Any, Union). See FullTypeId for details.
    -     * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - public Builder clearTypeId() { - - typeId_ = 0; - onChanged(); - return this; - } - - private java.util.List args_ = - java.util.Collections.emptyList(); - private void ensureArgsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - args_ = new java.util.ArrayList(args_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder> argsBuilder_; - - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public java.util.List getArgsList() { - if (argsBuilder_ == null) { - return java.util.Collections.unmodifiableList(args_); - } else { - return argsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public int getArgsCount() { - if (argsBuilder_ == null) { - return args_.size(); - } else { - return argsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDef getArgs(int index) { - if (argsBuilder_ == null) { - return args_.get(index); - } else { - return argsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder setArgs( - int index, org.tensorflow.proto.framework.FullTypeDef value) { - if (argsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgsIsMutable(); - args_.set(index, value); - onChanged(); - } else { - argsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder setArgs( - int index, org.tensorflow.proto.framework.FullTypeDef.Builder builderForValue) { - if (argsBuilder_ == null) { - ensureArgsIsMutable(); - args_.set(index, builderForValue.build()); - onChanged(); - } else { - argsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder addArgs(org.tensorflow.proto.framework.FullTypeDef value) { - if (argsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgsIsMutable(); - args_.add(value); - onChanged(); - } else { - argsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder addArgs( - int index, org.tensorflow.proto.framework.FullTypeDef value) { - if (argsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgsIsMutable(); - args_.add(index, value); - onChanged(); - } else { - argsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder addArgs( - org.tensorflow.proto.framework.FullTypeDef.Builder builderForValue) { - if (argsBuilder_ == null) { - ensureArgsIsMutable(); - args_.add(builderForValue.build()); - onChanged(); - } else { - argsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder addArgs( - int index, org.tensorflow.proto.framework.FullTypeDef.Builder builderForValue) { - if (argsBuilder_ == null) { - ensureArgsIsMutable(); - args_.add(index, builderForValue.build()); - onChanged(); - } else { - argsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder addAllArgs( - java.lang.Iterable values) { - if (argsBuilder_ == null) { - ensureArgsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, args_); - onChanged(); - } else { - argsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder clearArgs() { - if (argsBuilder_ == null) { - args_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - argsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public Builder removeArgs(int index) { - if (argsBuilder_ == null) { - ensureArgsIsMutable(); - args_.remove(index); - onChanged(); - } else { - argsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDef.Builder getArgsBuilder( - int index) { - return getArgsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDefOrBuilder getArgsOrBuilder( - int index) { - if (argsBuilder_ == null) { - return args_.get(index); } else { - return argsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public java.util.List - getArgsOrBuilderList() { - if (argsBuilder_ != null) { - return argsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(args_); - } - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDef.Builder addArgsBuilder() { - return getArgsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public org.tensorflow.proto.framework.FullTypeDef.Builder addArgsBuilder( - int index) { - return getArgsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - public java.util.List - getArgsBuilderList() { - return getArgsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder> - getArgsFieldBuilder() { - if (argsBuilder_ == null) { - argsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder>( - args_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - args_ = null; - } - return argsBuilder_; - } - - /** - * string s = 3; - */ - public java.lang.String getS() { - java.lang.Object ref = ""; - if (attrCase_ == 3) { - ref = attr_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (attrCase_ == 3) { - attr_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string s = 3; - */ - public com.google.protobuf.ByteString - getSBytes() { - java.lang.Object ref = ""; - if (attrCase_ == 3) { - ref = attr_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (attrCase_ == 3) { - attr_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string s = 3; - */ - public Builder setS( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - attrCase_ = 3; - attr_ = value; - onChanged(); - return this; - } - /** - * string s = 3; - */ - public Builder clearS() { - if (attrCase_ == 3) { - attrCase_ = 0; - attr_ = null; - onChanged(); - } - return this; - } - /** - * string s = 3; - */ - public Builder setSBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - attrCase_ = 3; - attr_ = value; - 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.FullTypeDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FullTypeDef) - private static final org.tensorflow.proto.framework.FullTypeDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.FullTypeDef(); - } - - public static org.tensorflow.proto.framework.FullTypeDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FullTypeDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FullTypeDef(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.FullTypeDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDefOrBuilder.java deleted file mode 100644 index 3d0e8acddc2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeDefOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/full_type.proto - -package org.tensorflow.proto.framework; - -public interface FullTypeDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FullTypeDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The principal type represented by this object. This may be a concrete type
    -   * (Tensor, Dataset) a type variable (used for dependent types) a type
    -   * symbol (Any, Union). See FullTypeId for details.
    -   * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - int getTypeIdValue(); - /** - *
    -   * The principal type represented by this object. This may be a concrete type
    -   * (Tensor, Dataset) a type variable (used for dependent types) a type
    -   * symbol (Any, Union). See FullTypeId for details.
    -   * 
    - * - * .tensorflow.FullTypeId type_id = 1; - */ - org.tensorflow.proto.framework.FullTypeId getTypeId(); - - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - java.util.List - getArgsList(); - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - org.tensorflow.proto.framework.FullTypeDef getArgs(int index); - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - int getArgsCount(); - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - java.util.List - getArgsOrBuilderList(); - /** - * repeated .tensorflow.FullTypeDef args = 2; - */ - org.tensorflow.proto.framework.FullTypeDefOrBuilder getArgsOrBuilder( - int index); - - /** - * string s = 3; - */ - java.lang.String getS(); - /** - * string s = 3; - */ - com.google.protobuf.ByteString - getSBytes(); - - public org.tensorflow.proto.framework.FullTypeDef.AttrCase getAttrCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeId.java deleted file mode 100644 index 5dec66a39a0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeId.java +++ /dev/null @@ -1,598 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/full_type.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Experimental. Represents the complete type information of a TensorFlow value.
    - * 
    - * - * Protobuf enum {@code tensorflow.FullTypeId} - */ -public enum FullTypeId - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -   * The default represents an uninitialized values.
    -   * 
    - * - * TFT_UNSET = 0; - */ - TFT_UNSET(0), - /** - *
    -   * Type variables may serve as placeholder for any other type ID in type
    -   * templates.
    -   * Examples:
    -   *   TFT_DATASET[TFT_VAR["T"]] is a Dataset returning a type indicated by "T".
    -   *   TFT_TENSOR[TFT_VAR["T"]] is a Tensor of n element type indicated by "T".
    -   *   TFT_TENSOR[TFT_VAR["T"]], TFT_TENSOR[TFT_VAR["T"]] are two tensors of
    -   *     identical element types.
    -   *   TFT_TENSOR[TFT_VAR["P"]], TFT_TENSOR[TFT_VAR["Q"]] are two tensors of
    -   *     potentially different element types.
    -   * 
    - * - * TFT_VAR = 1; - */ - TFT_VAR(1), - /** - *
    -   * Wildcard type. Describes a parameter of unknown type. In TensorFlow, that
    -   * can mean either a "Top" type (accepts any type), or a dynamically typed
    -   * object whose type is unknown in context.
    -   * Important: "unknown" does not necessarily mean undeterminable!
    -   * 
    - * - * TFT_ANY = 2; - */ - TFT_ANY(2), - /** - *
    -   * The algebraic product type. This is an algebraic type that may be used just
    -   * for logical grouping. Not to confused with TFT_TUPLE which describes a
    -   * concrete object of several elements.
    -   * Example:
    -   *   TFT_DATASET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]]]
    -   *     is a Dataset producing two tensors, an integer one and a float one.
    -   * 
    - * - * TFT_PRODUCT = 3; - */ - TFT_PRODUCT(3), - /** - *
    -   * Callable types describe functions and ops.
    -   * Parametrization:
    -   *   TFT_CALLABLE[<arg type>, <return type>]
    -   *   * <arg_type> is the type of the arguments; TFT_PRODUCT represents
    -   *   multiple
    -   *     arguments.
    -   *   * <return_type> is the return type; TFT_PRODUCT represents multiple
    -   *     return values (that means that callables returning multiple things
    -   *     don't necessarily return a single tuple).
    -   * Example:
    -   *   TFT_CALLABLE[
    -   *     TFT_ANY,
    -   *     TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]],
    -   *   ]
    -   *     is a callable with unspecified (for now) input arguments, and
    -   *     two return values of type tensor.
    -   * 
    - * - * TFT_CALLABLE = 100; - */ - TFT_CALLABLE(100), - /** - *
    -   * The usual Tensor. This is a parametric type.
    -   * Parametrization:
    -   *   TFT_TENSOR[<element type>, <shape type>]
    -   *   * <element_type> is currently limited to one of the element types
    -   *     defined below.
    -   *   * <shape_type> is not yet defined, and may only be TFT_UNKNOWN for now.
    -   * A TFT_SHAPE type will be defined in the future.
    -   * Example:
    -   *   TFT_TENSOR[TFT_INT32, TFT_UNKNOWN]
    -   *     is a Tensor of int32 element type and unknown shape.
    -   * TODO(mdan): Define TFT_SHAPE and add more examples.
    -   * 
    - * - * TFT_TENSOR = 1000; - */ - TFT_TENSOR(1000), - /** - *
    -   * Array (or tensorflow::TensorList in the variant type registry).
    -   * Note: this is not to be confused with the deprecated `TensorArray*` ops
    -   * which are not supported by FullType.
    -   * This type represents a random-access list whose elements can be
    -   * described by a single type. Although immutable, Array is expected to
    -   * support efficient mutation semantics (i.e. element update) in the
    -   * user-facing API.
    -   * The element type may be generic or even TFT_ANY for a heterogenous list.
    -   * Parametrization:
    -   *   TFT_ARRAY[<element type>]
    -   *   * <element_type> may be any concrete type.
    -   * Examples:
    -   *   TFT_ARRAY[TFT_TENSOR[TFT_INT32]] is a TensorArray holding int32 Tensors
    -   *     of any shape.
    -   *   TFT_ARRAY[TFT_TENSOR[TFT_UNKNOWN]] is a TensorArray holding Tensors of
    -   *     mixed element types.
    -   *   TFT_ARRAY[TFT_UNKNOWN] is a TensorArray holding any element type.
    -   *   TFT_ARRAY[] is equivalent to TFT_ARRAY[TFT_UNKNOWN].
    -   *   TFT_ARRAY[TFT_ARRAY[]] is an array or arrays (of unknown types).
    -   * 
    - * - * TFT_ARRAY = 1001; - */ - TFT_ARRAY(1001), - /** - *
    -   * Optional (or tensorflow::OptionalVariant in the variant type registry).
    -   * This type represents a value that may either hold an element of a single
    -   * specified type, or nothing at all.
    -   * Parametrization:
    -   *   TFT_OPTIONAL[<element type>]
    -   *   * <element_type> may be any concrete type.
    -   * Examples:
    -   *   TFT_OPTIONAL[TFT_TENSOR[TFT_INT32]] is an Optional holding an int32
    -   *     Tensor of any shape.
    -   * 
    - * - * TFT_OPTIONAL = 1002; - */ - TFT_OPTIONAL(1002), - /** - *
    -   * Datasets created by tf.data ops and APIs. Datasets have generator/iterable
    -   * semantics, that is, one can construct an iterator from them. Like
    -   * Array, they are considered to return elements that can be described
    -   * by a single type. Unlike Array, they do not support random access or
    -   * mutation, and can potentially produce an infinite number of elements.
    -   * A datasets can produce logical structures (e.g. multiple elements). This
    -   * is expressed using TFT_PRODUCT.
    -   * Parametrization: TFT_ARRAY[<element type>].
    -   * <element_type> may be a concrete type or a type symbol. It represents the
    -   *   data type of the elements produced by the dataset.
    -   * Examples:
    -   *   TFT_DATSET[TFT_TENSOR[TFT_INT32]] is a Dataset producing single int32
    -   *     Tensors of unknown shape.
    -   *   TFT_DATSET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT32]] is
    -   *   a
    -   *     Dataset producing pairs of Tensors, one integer and one float.
    -   * Note: The high ID number is to prepare for the eventuality that Datasets
    -   * will be supported by user types in the future.
    -   * 
    - * - * TFT_DATASET = 10102; - */ - TFT_DATASET(10102), - /** - *
    -   * The bool element type.
    -   * TODO(mdan): Quantized types, legacy representations (e.g. ref)
    -   * 
    - * - * TFT_BOOL = 200; - */ - TFT_BOOL(200), - /** - *
    -   * Integer element types.
    -   * 
    - * - * TFT_UINT8 = 201; - */ - TFT_UINT8(201), - /** - * TFT_UINT16 = 202; - */ - TFT_UINT16(202), - /** - * TFT_UINT32 = 203; - */ - TFT_UINT32(203), - /** - * TFT_UINT64 = 204; - */ - TFT_UINT64(204), - /** - * TFT_INT8 = 205; - */ - TFT_INT8(205), - /** - * TFT_INT16 = 206; - */ - TFT_INT16(206), - /** - * TFT_INT32 = 207; - */ - TFT_INT32(207), - /** - * TFT_INT64 = 208; - */ - TFT_INT64(208), - /** - *
    -   * Floating-point element types.
    -   * 
    - * - * TFT_HALF = 209; - */ - TFT_HALF(209), - /** - * TFT_FLOAT = 210; - */ - TFT_FLOAT(210), - /** - * TFT_DOUBLE = 211; - */ - TFT_DOUBLE(211), - /** - * TFT_BFLOAT16 = 215; - */ - TFT_BFLOAT16(215), - /** - *
    -   * Complex element types.
    -   * TODO(mdan): Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
    -   * 
    - * - * TFT_COMPLEX64 = 212; - */ - TFT_COMPLEX64(212), - /** - * TFT_COMPLEX128 = 213; - */ - TFT_COMPLEX128(213), - /** - *
    -   * The string element type.
    -   * 
    - * - * TFT_STRING = 214; - */ - TFT_STRING(214), - UNRECOGNIZED(-1), - ; - - /** - *
    -   * The default represents an uninitialized values.
    -   * 
    - * - * TFT_UNSET = 0; - */ - public static final int TFT_UNSET_VALUE = 0; - /** - *
    -   * Type variables may serve as placeholder for any other type ID in type
    -   * templates.
    -   * Examples:
    -   *   TFT_DATASET[TFT_VAR["T"]] is a Dataset returning a type indicated by "T".
    -   *   TFT_TENSOR[TFT_VAR["T"]] is a Tensor of n element type indicated by "T".
    -   *   TFT_TENSOR[TFT_VAR["T"]], TFT_TENSOR[TFT_VAR["T"]] are two tensors of
    -   *     identical element types.
    -   *   TFT_TENSOR[TFT_VAR["P"]], TFT_TENSOR[TFT_VAR["Q"]] are two tensors of
    -   *     potentially different element types.
    -   * 
    - * - * TFT_VAR = 1; - */ - public static final int TFT_VAR_VALUE = 1; - /** - *
    -   * Wildcard type. Describes a parameter of unknown type. In TensorFlow, that
    -   * can mean either a "Top" type (accepts any type), or a dynamically typed
    -   * object whose type is unknown in context.
    -   * Important: "unknown" does not necessarily mean undeterminable!
    -   * 
    - * - * TFT_ANY = 2; - */ - public static final int TFT_ANY_VALUE = 2; - /** - *
    -   * The algebraic product type. This is an algebraic type that may be used just
    -   * for logical grouping. Not to confused with TFT_TUPLE which describes a
    -   * concrete object of several elements.
    -   * Example:
    -   *   TFT_DATASET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]]]
    -   *     is a Dataset producing two tensors, an integer one and a float one.
    -   * 
    - * - * TFT_PRODUCT = 3; - */ - public static final int TFT_PRODUCT_VALUE = 3; - /** - *
    -   * Callable types describe functions and ops.
    -   * Parametrization:
    -   *   TFT_CALLABLE[<arg type>, <return type>]
    -   *   * <arg_type> is the type of the arguments; TFT_PRODUCT represents
    -   *   multiple
    -   *     arguments.
    -   *   * <return_type> is the return type; TFT_PRODUCT represents multiple
    -   *     return values (that means that callables returning multiple things
    -   *     don't necessarily return a single tuple).
    -   * Example:
    -   *   TFT_CALLABLE[
    -   *     TFT_ANY,
    -   *     TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]],
    -   *   ]
    -   *     is a callable with unspecified (for now) input arguments, and
    -   *     two return values of type tensor.
    -   * 
    - * - * TFT_CALLABLE = 100; - */ - public static final int TFT_CALLABLE_VALUE = 100; - /** - *
    -   * The usual Tensor. This is a parametric type.
    -   * Parametrization:
    -   *   TFT_TENSOR[<element type>, <shape type>]
    -   *   * <element_type> is currently limited to one of the element types
    -   *     defined below.
    -   *   * <shape_type> is not yet defined, and may only be TFT_UNKNOWN for now.
    -   * A TFT_SHAPE type will be defined in the future.
    -   * Example:
    -   *   TFT_TENSOR[TFT_INT32, TFT_UNKNOWN]
    -   *     is a Tensor of int32 element type and unknown shape.
    -   * TODO(mdan): Define TFT_SHAPE and add more examples.
    -   * 
    - * - * TFT_TENSOR = 1000; - */ - public static final int TFT_TENSOR_VALUE = 1000; - /** - *
    -   * Array (or tensorflow::TensorList in the variant type registry).
    -   * Note: this is not to be confused with the deprecated `TensorArray*` ops
    -   * which are not supported by FullType.
    -   * This type represents a random-access list whose elements can be
    -   * described by a single type. Although immutable, Array is expected to
    -   * support efficient mutation semantics (i.e. element update) in the
    -   * user-facing API.
    -   * The element type may be generic or even TFT_ANY for a heterogenous list.
    -   * Parametrization:
    -   *   TFT_ARRAY[<element type>]
    -   *   * <element_type> may be any concrete type.
    -   * Examples:
    -   *   TFT_ARRAY[TFT_TENSOR[TFT_INT32]] is a TensorArray holding int32 Tensors
    -   *     of any shape.
    -   *   TFT_ARRAY[TFT_TENSOR[TFT_UNKNOWN]] is a TensorArray holding Tensors of
    -   *     mixed element types.
    -   *   TFT_ARRAY[TFT_UNKNOWN] is a TensorArray holding any element type.
    -   *   TFT_ARRAY[] is equivalent to TFT_ARRAY[TFT_UNKNOWN].
    -   *   TFT_ARRAY[TFT_ARRAY[]] is an array or arrays (of unknown types).
    -   * 
    - * - * TFT_ARRAY = 1001; - */ - public static final int TFT_ARRAY_VALUE = 1001; - /** - *
    -   * Optional (or tensorflow::OptionalVariant in the variant type registry).
    -   * This type represents a value that may either hold an element of a single
    -   * specified type, or nothing at all.
    -   * Parametrization:
    -   *   TFT_OPTIONAL[<element type>]
    -   *   * <element_type> may be any concrete type.
    -   * Examples:
    -   *   TFT_OPTIONAL[TFT_TENSOR[TFT_INT32]] is an Optional holding an int32
    -   *     Tensor of any shape.
    -   * 
    - * - * TFT_OPTIONAL = 1002; - */ - public static final int TFT_OPTIONAL_VALUE = 1002; - /** - *
    -   * Datasets created by tf.data ops and APIs. Datasets have generator/iterable
    -   * semantics, that is, one can construct an iterator from them. Like
    -   * Array, they are considered to return elements that can be described
    -   * by a single type. Unlike Array, they do not support random access or
    -   * mutation, and can potentially produce an infinite number of elements.
    -   * A datasets can produce logical structures (e.g. multiple elements). This
    -   * is expressed using TFT_PRODUCT.
    -   * Parametrization: TFT_ARRAY[<element type>].
    -   * <element_type> may be a concrete type or a type symbol. It represents the
    -   *   data type of the elements produced by the dataset.
    -   * Examples:
    -   *   TFT_DATSET[TFT_TENSOR[TFT_INT32]] is a Dataset producing single int32
    -   *     Tensors of unknown shape.
    -   *   TFT_DATSET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT32]] is
    -   *   a
    -   *     Dataset producing pairs of Tensors, one integer and one float.
    -   * Note: The high ID number is to prepare for the eventuality that Datasets
    -   * will be supported by user types in the future.
    -   * 
    - * - * TFT_DATASET = 10102; - */ - public static final int TFT_DATASET_VALUE = 10102; - /** - *
    -   * The bool element type.
    -   * TODO(mdan): Quantized types, legacy representations (e.g. ref)
    -   * 
    - * - * TFT_BOOL = 200; - */ - public static final int TFT_BOOL_VALUE = 200; - /** - *
    -   * Integer element types.
    -   * 
    - * - * TFT_UINT8 = 201; - */ - public static final int TFT_UINT8_VALUE = 201; - /** - * TFT_UINT16 = 202; - */ - public static final int TFT_UINT16_VALUE = 202; - /** - * TFT_UINT32 = 203; - */ - public static final int TFT_UINT32_VALUE = 203; - /** - * TFT_UINT64 = 204; - */ - public static final int TFT_UINT64_VALUE = 204; - /** - * TFT_INT8 = 205; - */ - public static final int TFT_INT8_VALUE = 205; - /** - * TFT_INT16 = 206; - */ - public static final int TFT_INT16_VALUE = 206; - /** - * TFT_INT32 = 207; - */ - public static final int TFT_INT32_VALUE = 207; - /** - * TFT_INT64 = 208; - */ - public static final int TFT_INT64_VALUE = 208; - /** - *
    -   * Floating-point element types.
    -   * 
    - * - * TFT_HALF = 209; - */ - public static final int TFT_HALF_VALUE = 209; - /** - * TFT_FLOAT = 210; - */ - public static final int TFT_FLOAT_VALUE = 210; - /** - * TFT_DOUBLE = 211; - */ - public static final int TFT_DOUBLE_VALUE = 211; - /** - * TFT_BFLOAT16 = 215; - */ - public static final int TFT_BFLOAT16_VALUE = 215; - /** - *
    -   * Complex element types.
    -   * TODO(mdan): Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
    -   * 
    - * - * TFT_COMPLEX64 = 212; - */ - public static final int TFT_COMPLEX64_VALUE = 212; - /** - * TFT_COMPLEX128 = 213; - */ - public static final int TFT_COMPLEX128_VALUE = 213; - /** - *
    -   * The string element type.
    -   * 
    - * - * TFT_STRING = 214; - */ - public static final int TFT_STRING_VALUE = 214; - - - 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 FullTypeId valueOf(int value) { - return forNumber(value); - } - - public static FullTypeId forNumber(int value) { - switch (value) { - case 0: return TFT_UNSET; - case 1: return TFT_VAR; - case 2: return TFT_ANY; - case 3: return TFT_PRODUCT; - case 100: return TFT_CALLABLE; - case 1000: return TFT_TENSOR; - case 1001: return TFT_ARRAY; - case 1002: return TFT_OPTIONAL; - case 10102: return TFT_DATASET; - case 200: return TFT_BOOL; - case 201: return TFT_UINT8; - case 202: return TFT_UINT16; - case 203: return TFT_UINT32; - case 204: return TFT_UINT64; - case 205: return TFT_INT8; - case 206: return TFT_INT16; - case 207: return TFT_INT32; - case 208: return TFT_INT64; - case 209: return TFT_HALF; - case 210: return TFT_FLOAT; - case 211: return TFT_DOUBLE; - case 215: return TFT_BFLOAT16; - case 212: return TFT_COMPLEX64; - case 213: return TFT_COMPLEX128; - case 214: return TFT_STRING; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - FullTypeId> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public FullTypeId findValueByNumber(int number) { - return FullTypeId.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.FullTypeProtos.getDescriptor().getEnumTypes().get(0); - } - - private static final FullTypeId[] VALUES = values(); - - public static FullTypeId 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 FullTypeId(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.FullTypeId) -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeProtos.java deleted file mode 100644 index 99f7eecbb7a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FullTypeProtos.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/full_type.proto - -package org.tensorflow.proto.framework; - -public final class FullTypeProtos { - private FullTypeProtos() {} - 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_FullTypeDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FullTypeDef_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/framework/full_type.pr" + - "oto\022\ntensorflow\"r\n\013FullTypeDef\022\'\n\007type_i" + - "d\030\001 \001(\0162\026.tensorflow.FullTypeId\022%\n\004args\030" + - "\002 \003(\0132\027.tensorflow.FullTypeDef\022\013\n\001s\030\003 \001(" + - "\tH\000B\006\n\004attr*\254\003\n\nFullTypeId\022\r\n\tTFT_UNSET\020" + - "\000\022\013\n\007TFT_VAR\020\001\022\013\n\007TFT_ANY\020\002\022\017\n\013TFT_PRODU" + - "CT\020\003\022\020\n\014TFT_CALLABLE\020d\022\017\n\nTFT_TENSOR\020\350\007\022" + - "\016\n\tTFT_ARRAY\020\351\007\022\021\n\014TFT_OPTIONAL\020\352\007\022\020\n\013TF" + - "T_DATASET\020\366N\022\r\n\010TFT_BOOL\020\310\001\022\016\n\tTFT_UINT8" + - "\020\311\001\022\017\n\nTFT_UINT16\020\312\001\022\017\n\nTFT_UINT32\020\313\001\022\017\n" + - "\nTFT_UINT64\020\314\001\022\r\n\010TFT_INT8\020\315\001\022\016\n\tTFT_INT" + - "16\020\316\001\022\016\n\tTFT_INT32\020\317\001\022\016\n\tTFT_INT64\020\320\001\022\r\n" + - "\010TFT_HALF\020\321\001\022\016\n\tTFT_FLOAT\020\322\001\022\017\n\nTFT_DOUB" + - "LE\020\323\001\022\021\n\014TFT_BFLOAT16\020\327\001\022\022\n\rTFT_COMPLEX6" + - "4\020\324\001\022\023\n\016TFT_COMPLEX128\020\325\001\022\017\n\nTFT_STRING\020" + - "\326\001B\203\001\n\036org.tensorflow.proto.frameworkB\016F" + - "ullTypeProtosP\001ZLgithub.com/tensorflow/t" + - "ensorflow/tensorflow/go/core/framework/t" + - "ypes_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_FullTypeDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_FullTypeDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FullTypeDef_descriptor, - new java.lang.String[] { "TypeId", "Args", "S", "Attr", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDef.java deleted file mode 100644 index 3437857d610..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDef.java +++ /dev/null @@ -1,3415 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A function can be instantiated when the runtime can bind every attr
    - * with a value. When a GraphDef has a call to a function, it must
    - * have binding for every attr defined in the signature.
    - * TODO(zhifengc):
    - *   * device spec, etc.
    - * 
    - * - * Protobuf type {@code tensorflow.FunctionDef} - */ -public final class FunctionDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FunctionDef) - FunctionDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use FunctionDef.newBuilder() to construct. - private FunctionDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FunctionDef() { - nodeDef_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FunctionDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FunctionDef( - 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.framework.OpDef.Builder subBuilder = null; - if (signature_ != null) { - subBuilder = signature_.toBuilder(); - } - signature_ = input.readMessage(org.tensorflow.proto.framework.OpDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(signature_); - signature_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - nodeDef_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - nodeDef_.add( - input.readMessage(org.tensorflow.proto.framework.NodeDef.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - ret_ = com.google.protobuf.MapField.newMapField( - RetDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000010; - } - com.google.protobuf.MapEntry - ret__ = input.readMessage( - RetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - ret_.getMutableMap().put( - ret__.getKey(), ret__.getValue()); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.getValue()); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - controlRet_ = com.google.protobuf.MapField.newMapField( - ControlRetDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000020; - } - com.google.protobuf.MapEntry - controlRet__ = input.readMessage( - ControlRetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - controlRet_.getMutableMap().put( - controlRet__.getKey(), controlRet__.getValue()); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - argAttr_ = com.google.protobuf.MapField.newMapField( - ArgAttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - argAttr__ = input.readMessage( - ArgAttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - argAttr_.getMutableMap().put( - argAttr__.getKey(), argAttr__.getValue()); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - resourceArgUniqueId_ = com.google.protobuf.MapField.newMapField( - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000004; - } - com.google.protobuf.MapEntry - resourceArgUniqueId__ = input.readMessage( - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - resourceArgUniqueId_.getMutableMap().put( - resourceArgUniqueId__.getKey(), resourceArgUniqueId__.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 { - if (((mutable_bitField0_ & 0x00000008) != 0)) { - nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttr(); - case 7: - return internalGetArgAttr(); - case 8: - return internalGetResourceArgUniqueId(); - case 4: - return internalGetRet(); - case 6: - return internalGetControlRet(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDef.class, org.tensorflow.proto.framework.FunctionDef.Builder.class); - } - - public interface ArgAttrsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FunctionDef.ArgAttrs) - com.google.protobuf.MessageOrBuilder { - - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - int getAttrCount(); - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - boolean containsAttr( - java.lang.String key); - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttr(); - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - java.util.Map - getAttrMap(); - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue); - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key); - } - /** - *
    -   * Attributes for function arguments. These attributes are the same set of
    -   * valid attributes as to _Arg nodes.
    -   * 
    - * - * Protobuf type {@code tensorflow.FunctionDef.ArgAttrs} - */ - public static final class ArgAttrs extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FunctionDef.ArgAttrs) - ArgAttrsOrBuilder { - private static final long serialVersionUID = 0L; - // Use ArgAttrs.newBuilder() to construct. - private ArgAttrs(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ArgAttrs() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ArgAttrs(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ArgAttrs( - 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)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.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.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDef.ArgAttrs.class, org.tensorflow.proto.framework.FunctionDef.ArgAttrs.Builder.class); - } - - public static final int ATTR_FIELD_NUMBER = 1; - private static final class AttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 1); - 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 - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, attr__); - } - 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.FunctionDef.ArgAttrs)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.FunctionDef.ArgAttrs other = (org.tensorflow.proto.framework.FunctionDef.ArgAttrs) obj; - - if (!internalGetAttr().equals( - other.internalGetAttr())) 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 (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs 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; - } - /** - *
    -     * Attributes for function arguments. These attributes are the same set of
    -     * valid attributes as to _Arg nodes.
    -     * 
    - * - * Protobuf type {@code tensorflow.FunctionDef.ArgAttrs} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDef.ArgAttrs) - org.tensorflow.proto.framework.FunctionDef.ArgAttrsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDef.ArgAttrs.class, org.tensorflow.proto.framework.FunctionDef.ArgAttrs.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.FunctionDef.ArgAttrs.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(); - internalGetMutableAttr().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs getDefaultInstanceForType() { - return org.tensorflow.proto.framework.FunctionDef.ArgAttrs.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs build() { - org.tensorflow.proto.framework.FunctionDef.ArgAttrs result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs buildPartial() { - org.tensorflow.proto.framework.FunctionDef.ArgAttrs result = new org.tensorflow.proto.framework.FunctionDef.ArgAttrs(this); - int from_bitField0_ = bitField0_; - result.attr_ = internalGetAttr(); - result.attr_.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.FunctionDef.ArgAttrs) { - return mergeFrom((org.tensorflow.proto.framework.FunctionDef.ArgAttrs)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.FunctionDef.ArgAttrs other) { - if (other == org.tensorflow.proto.framework.FunctionDef.ArgAttrs.getDefaultInstance()) return this; - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - 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.FunctionDef.ArgAttrs parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.FunctionDef.ArgAttrs) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged();; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public Builder removeAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - public Builder putAttr( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.AttrValue> attr = 1; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().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.FunctionDef.ArgAttrs) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef.ArgAttrs) - private static final org.tensorflow.proto.framework.FunctionDef.ArgAttrs DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.FunctionDef.ArgAttrs(); - } - - public static org.tensorflow.proto.framework.FunctionDef.ArgAttrs getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ArgAttrs parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ArgAttrs(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.FunctionDef.ArgAttrs getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int SIGNATURE_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.OpDef signature_; - /** - *
    -   * The definition of the function's name, arguments, return values,
    -   * attrs etc.
    -   * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public boolean hasSignature() { - return signature_ != null; - } - /** - *
    -   * The definition of the function's name, arguments, return values,
    -   * attrs etc.
    -   * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public org.tensorflow.proto.framework.OpDef getSignature() { - return signature_ == null ? org.tensorflow.proto.framework.OpDef.getDefaultInstance() : signature_; - } - /** - *
    -   * The definition of the function's name, arguments, return values,
    -   * attrs etc.
    -   * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public org.tensorflow.proto.framework.OpDefOrBuilder getSignatureOrBuilder() { - return getSignature(); - } - - public static final int ATTR_FIELD_NUMBER = 5; - private static final class AttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -   * Attributes specific to this function definition.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -   * Attributes specific to this function definition.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -   * Attributes specific to this function definition.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Attributes specific to this function definition.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int ARG_ATTR_FIELD_NUMBER = 7; - private static final class ArgAttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, org.tensorflow.proto.framework.FunctionDef.ArgAttrs> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.FunctionDef.ArgAttrs.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.FunctionDef.ArgAttrs> argAttr_; - private com.google.protobuf.MapField - internalGetArgAttr() { - if (argAttr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ArgAttrDefaultEntryHolder.defaultEntry); - } - return argAttr_; - } - - public int getArgAttrCount() { - return internalGetArgAttr().getMap().size(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public boolean containsArgAttr( - int key) { - - return internalGetArgAttr().getMap().containsKey(key); - } - /** - * Use {@link #getArgAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getArgAttr() { - return getArgAttrMap(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public java.util.Map getArgAttrMap() { - return internalGetArgAttr().getMap(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrDefault( - int key, - org.tensorflow.proto.framework.FunctionDef.ArgAttrs defaultValue) { - - java.util.Map map = - internalGetArgAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrThrow( - int key) { - - java.util.Map map = - internalGetArgAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int RESOURCE_ARG_UNIQUE_ID_FIELD_NUMBER = 8; - private static final class ResourceArgUniqueIdDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Integer, java.lang.Integer> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0, - com.google.protobuf.WireFormat.FieldType.UINT32, - 0); - } - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Integer> resourceArgUniqueId_; - private com.google.protobuf.MapField - internalGetResourceArgUniqueId() { - if (resourceArgUniqueId_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); - } - return resourceArgUniqueId_; - } - - public int getResourceArgUniqueIdCount() { - return internalGetResourceArgUniqueId().getMap().size(); - } - /** - *
    -   * Unique IDs for each resource argument, used to track aliasing resources. If
    -   * Argument A and Argument B alias each other, then
    -   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -   * If this field is empty, none of the arguments could alias; otherwise, every
    -   * resource argument should have an entry in this field.
    -   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -   * "_resource_arg_unique_id" attribute.
    -   * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public boolean containsResourceArgUniqueId( - int key) { - - return internalGetResourceArgUniqueId().getMap().containsKey(key); - } - /** - * Use {@link #getResourceArgUniqueIdMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getResourceArgUniqueId() { - return getResourceArgUniqueIdMap(); - } - /** - *
    -   * Unique IDs for each resource argument, used to track aliasing resources. If
    -   * Argument A and Argument B alias each other, then
    -   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -   * If this field is empty, none of the arguments could alias; otherwise, every
    -   * resource argument should have an entry in this field.
    -   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -   * "_resource_arg_unique_id" attribute.
    -   * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public java.util.Map getResourceArgUniqueIdMap() { - return internalGetResourceArgUniqueId().getMap(); - } - /** - *
    -   * Unique IDs for each resource argument, used to track aliasing resources. If
    -   * Argument A and Argument B alias each other, then
    -   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -   * If this field is empty, none of the arguments could alias; otherwise, every
    -   * resource argument should have an entry in this field.
    -   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -   * "_resource_arg_unique_id" attribute.
    -   * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public int getResourceArgUniqueIdOrDefault( - int key, - int defaultValue) { - - java.util.Map map = - internalGetResourceArgUniqueId().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Unique IDs for each resource argument, used to track aliasing resources. If
    -   * Argument A and Argument B alias each other, then
    -   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -   * If this field is empty, none of the arguments could alias; otherwise, every
    -   * resource argument should have an entry in this field.
    -   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -   * "_resource_arg_unique_id" attribute.
    -   * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public int getResourceArgUniqueIdOrThrow( - int key) { - - java.util.Map map = - internalGetResourceArgUniqueId().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int NODE_DEF_FIELD_NUMBER = 3; - private java.util.List nodeDef_; - /** - *
    -   * By convention, "op" in node_def is resolved by consulting with a
    -   * user-defined library first. If not resolved, "func" is assumed to
    -   * be a builtin op.
    -   * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public java.util.List getNodeDefList() { - return nodeDef_; - } - /** - *
    -   * By convention, "op" in node_def is resolved by consulting with a
    -   * user-defined library first. If not resolved, "func" is assumed to
    -   * be a builtin op.
    -   * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public java.util.List - getNodeDefOrBuilderList() { - return nodeDef_; - } - /** - *
    -   * By convention, "op" in node_def is resolved by consulting with a
    -   * user-defined library first. If not resolved, "func" is assumed to
    -   * be a builtin op.
    -   * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public int getNodeDefCount() { - return nodeDef_.size(); - } - /** - *
    -   * By convention, "op" in node_def is resolved by consulting with a
    -   * user-defined library first. If not resolved, "func" is assumed to
    -   * be a builtin op.
    -   * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDef getNodeDef(int index) { - return nodeDef_.get(index); - } - /** - *
    -   * By convention, "op" in node_def is resolved by consulting with a
    -   * user-defined library first. If not resolved, "func" is assumed to
    -   * be a builtin op.
    -   * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDefOrBuilder getNodeDefOrBuilder( - int index) { - return nodeDef_.get(index); - } - - public static final int RET_FIELD_NUMBER = 4; - private static final class RetDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_RetEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> ret_; - private com.google.protobuf.MapField - internalGetRet() { - if (ret_ == null) { - return com.google.protobuf.MapField.emptyMapField( - RetDefaultEntryHolder.defaultEntry); - } - return ret_; - } - - public int getRetCount() { - return internalGetRet().getMap().size(); - } - /** - *
    -   * A mapping from the output arg names from `signature` to the
    -   * outputs from `node_def` that should be returned by the function.
    -   * 
    - * - * map<string, string> ret = 4; - */ - - public boolean containsRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetRet().getMap().containsKey(key); - } - /** - * Use {@link #getRetMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getRet() { - return getRetMap(); - } - /** - *
    -   * A mapping from the output arg names from `signature` to the
    -   * outputs from `node_def` that should be returned by the function.
    -   * 
    - * - * map<string, string> ret = 4; - */ - - public java.util.Map getRetMap() { - return internalGetRet().getMap(); - } - /** - *
    -   * A mapping from the output arg names from `signature` to the
    -   * outputs from `node_def` that should be returned by the function.
    -   * 
    - * - * map<string, string> ret = 4; - */ - - public java.lang.String getRetOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRet().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * A mapping from the output arg names from `signature` to the
    -   * outputs from `node_def` that should be returned by the function.
    -   * 
    - * - * map<string, string> ret = 4; - */ - - public java.lang.String getRetOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRet().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int CONTROL_RET_FIELD_NUMBER = 6; - private static final class ControlRetDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_ControlRetEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> controlRet_; - private com.google.protobuf.MapField - internalGetControlRet() { - if (controlRet_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ControlRetDefaultEntryHolder.defaultEntry); - } - return controlRet_; - } - - public int getControlRetCount() { - return internalGetControlRet().getMap().size(); - } - /** - *
    -   * A mapping from control output names from `signature` to node names in
    -   * `node_def` which should be control outputs of this function.
    -   * 
    - * - * map<string, string> control_ret = 6; - */ - - public boolean containsControlRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetControlRet().getMap().containsKey(key); - } - /** - * Use {@link #getControlRetMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getControlRet() { - return getControlRetMap(); - } - /** - *
    -   * A mapping from control output names from `signature` to node names in
    -   * `node_def` which should be control outputs of this function.
    -   * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.util.Map getControlRetMap() { - return internalGetControlRet().getMap(); - } - /** - *
    -   * A mapping from control output names from `signature` to node names in
    -   * `node_def` which should be control outputs of this function.
    -   * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.lang.String getControlRetOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetControlRet().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * A mapping from control output names from `signature` to node names in
    -   * `node_def` which should be control outputs of this function.
    -   * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.lang.String getControlRetOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetControlRet().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 (signature_ != null) { - output.writeMessage(1, getSignature()); - } - for (int i = 0; i < nodeDef_.size(); i++) { - output.writeMessage(3, nodeDef_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetRet(), - RetDefaultEntryHolder.defaultEntry, - 4); - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 5); - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetControlRet(), - ControlRetDefaultEntryHolder.defaultEntry, - 6); - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetArgAttr(), - ArgAttrDefaultEntryHolder.defaultEntry, - 7); - com.google.protobuf.GeneratedMessageV3 - .serializeIntegerMapTo( - output, - internalGetResourceArgUniqueId(), - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry, - 8); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (signature_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getSignature()); - } - for (int i = 0; i < nodeDef_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, nodeDef_.get(i)); - } - for (java.util.Map.Entry entry - : internalGetRet().getMap().entrySet()) { - com.google.protobuf.MapEntry - ret__ = RetDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, ret__); - } - for (java.util.Map.Entry entry - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, attr__); - } - for (java.util.Map.Entry entry - : internalGetControlRet().getMap().entrySet()) { - com.google.protobuf.MapEntry - controlRet__ = ControlRetDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, controlRet__); - } - for (java.util.Map.Entry entry - : internalGetArgAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - argAttr__ = ArgAttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, argAttr__); - } - for (java.util.Map.Entry entry - : internalGetResourceArgUniqueId().getMap().entrySet()) { - com.google.protobuf.MapEntry - resourceArgUniqueId__ = ResourceArgUniqueIdDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, resourceArgUniqueId__); - } - 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.FunctionDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.FunctionDef other = (org.tensorflow.proto.framework.FunctionDef) obj; - - if (hasSignature() != other.hasSignature()) return false; - if (hasSignature()) { - if (!getSignature() - .equals(other.getSignature())) return false; - } - if (!internalGetAttr().equals( - other.internalGetAttr())) return false; - if (!internalGetArgAttr().equals( - other.internalGetArgAttr())) return false; - if (!internalGetResourceArgUniqueId().equals( - other.internalGetResourceArgUniqueId())) return false; - if (!getNodeDefList() - .equals(other.getNodeDefList())) return false; - if (!internalGetRet().equals( - other.internalGetRet())) return false; - if (!internalGetControlRet().equals( - other.internalGetControlRet())) 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 (hasSignature()) { - hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; - hash = (53 * hash) + getSignature().hashCode(); - } - if (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - if (!internalGetArgAttr().getMap().isEmpty()) { - hash = (37 * hash) + ARG_ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetArgAttr().hashCode(); - } - if (!internalGetResourceArgUniqueId().getMap().isEmpty()) { - hash = (37 * hash) + RESOURCE_ARG_UNIQUE_ID_FIELD_NUMBER; - hash = (53 * hash) + internalGetResourceArgUniqueId().hashCode(); - } - if (getNodeDefCount() > 0) { - hash = (37 * hash) + NODE_DEF_FIELD_NUMBER; - hash = (53 * hash) + getNodeDefList().hashCode(); - } - if (!internalGetRet().getMap().isEmpty()) { - hash = (37 * hash) + RET_FIELD_NUMBER; - hash = (53 * hash) + internalGetRet().hashCode(); - } - if (!internalGetControlRet().getMap().isEmpty()) { - hash = (37 * hash) + CONTROL_RET_FIELD_NUMBER; - hash = (53 * hash) + internalGetControlRet().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.FunctionDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef 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.FunctionDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef 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.FunctionDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.FunctionDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef 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.FunctionDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef 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.FunctionDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDef 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.FunctionDef 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 function can be instantiated when the runtime can bind every attr
    -   * with a value. When a GraphDef has a call to a function, it must
    -   * have binding for every attr defined in the signature.
    -   * TODO(zhifengc):
    -   *   * device spec, etc.
    -   * 
    - * - * Protobuf type {@code tensorflow.FunctionDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDef) - org.tensorflow.proto.framework.FunctionDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttr(); - case 7: - return internalGetArgAttr(); - case 8: - return internalGetResourceArgUniqueId(); - case 4: - return internalGetRet(); - case 6: - return internalGetControlRet(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 5: - return internalGetMutableAttr(); - case 7: - return internalGetMutableArgAttr(); - case 8: - return internalGetMutableResourceArgUniqueId(); - case 4: - return internalGetMutableRet(); - case 6: - return internalGetMutableControlRet(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDef.class, org.tensorflow.proto.framework.FunctionDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.FunctionDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeDefFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (signatureBuilder_ == null) { - signature_ = null; - } else { - signature_ = null; - signatureBuilder_ = null; - } - internalGetMutableAttr().clear(); - internalGetMutableArgAttr().clear(); - internalGetMutableResourceArgUniqueId().clear(); - if (nodeDefBuilder_ == null) { - nodeDef_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - nodeDefBuilder_.clear(); - } - internalGetMutableRet().clear(); - internalGetMutableControlRet().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.FunctionDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef build() { - org.tensorflow.proto.framework.FunctionDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDef buildPartial() { - org.tensorflow.proto.framework.FunctionDef result = new org.tensorflow.proto.framework.FunctionDef(this); - int from_bitField0_ = bitField0_; - if (signatureBuilder_ == null) { - result.signature_ = signature_; - } else { - result.signature_ = signatureBuilder_.build(); - } - result.attr_ = internalGetAttr(); - result.attr_.makeImmutable(); - result.argAttr_ = internalGetArgAttr(); - result.argAttr_.makeImmutable(); - result.resourceArgUniqueId_ = internalGetResourceArgUniqueId(); - result.resourceArgUniqueId_.makeImmutable(); - if (nodeDefBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.nodeDef_ = nodeDef_; - } else { - result.nodeDef_ = nodeDefBuilder_.build(); - } - result.ret_ = internalGetRet(); - result.ret_.makeImmutable(); - result.controlRet_ = internalGetControlRet(); - result.controlRet_.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.FunctionDef) { - return mergeFrom((org.tensorflow.proto.framework.FunctionDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.FunctionDef other) { - if (other == org.tensorflow.proto.framework.FunctionDef.getDefaultInstance()) return this; - if (other.hasSignature()) { - mergeSignature(other.getSignature()); - } - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - internalGetMutableArgAttr().mergeFrom( - other.internalGetArgAttr()); - internalGetMutableResourceArgUniqueId().mergeFrom( - other.internalGetResourceArgUniqueId()); - if (nodeDefBuilder_ == null) { - if (!other.nodeDef_.isEmpty()) { - if (nodeDef_.isEmpty()) { - nodeDef_ = other.nodeDef_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureNodeDefIsMutable(); - nodeDef_.addAll(other.nodeDef_); - } - onChanged(); - } - } else { - if (!other.nodeDef_.isEmpty()) { - if (nodeDefBuilder_.isEmpty()) { - nodeDefBuilder_.dispose(); - nodeDefBuilder_ = null; - nodeDef_ = other.nodeDef_; - bitField0_ = (bitField0_ & ~0x00000008); - nodeDefBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeDefFieldBuilder() : null; - } else { - nodeDefBuilder_.addAllMessages(other.nodeDef_); - } - } - } - internalGetMutableRet().mergeFrom( - other.internalGetRet()); - internalGetMutableControlRet().mergeFrom( - other.internalGetControlRet()); - 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.FunctionDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.FunctionDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.tensorflow.proto.framework.OpDef signature_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder> signatureBuilder_; - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public boolean hasSignature() { - return signatureBuilder_ != null || signature_ != null; - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public org.tensorflow.proto.framework.OpDef getSignature() { - if (signatureBuilder_ == null) { - return signature_ == null ? org.tensorflow.proto.framework.OpDef.getDefaultInstance() : signature_; - } else { - return signatureBuilder_.getMessage(); - } - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public Builder setSignature(org.tensorflow.proto.framework.OpDef value) { - if (signatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - signature_ = value; - onChanged(); - } else { - signatureBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public Builder setSignature( - org.tensorflow.proto.framework.OpDef.Builder builderForValue) { - if (signatureBuilder_ == null) { - signature_ = builderForValue.build(); - onChanged(); - } else { - signatureBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public Builder mergeSignature(org.tensorflow.proto.framework.OpDef value) { - if (signatureBuilder_ == null) { - if (signature_ != null) { - signature_ = - org.tensorflow.proto.framework.OpDef.newBuilder(signature_).mergeFrom(value).buildPartial(); - } else { - signature_ = value; - } - onChanged(); - } else { - signatureBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public Builder clearSignature() { - if (signatureBuilder_ == null) { - signature_ = null; - onChanged(); - } else { - signature_ = null; - signatureBuilder_ = null; - } - - return this; - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public org.tensorflow.proto.framework.OpDef.Builder getSignatureBuilder() { - - onChanged(); - return getSignatureFieldBuilder().getBuilder(); - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - public org.tensorflow.proto.framework.OpDefOrBuilder getSignatureOrBuilder() { - if (signatureBuilder_ != null) { - return signatureBuilder_.getMessageOrBuilder(); - } else { - return signature_ == null ? - org.tensorflow.proto.framework.OpDef.getDefaultInstance() : signature_; - } - } - /** - *
    -     * The definition of the function's name, arguments, return values,
    -     * attrs etc.
    -     * 
    - * - * .tensorflow.OpDef signature = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder> - getSignatureFieldBuilder() { - if (signatureBuilder_ == null) { - signatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder>( - getSignature(), - getParentForChildren(), - isClean()); - signature_ = null; - } - return signatureBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged();; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public Builder removeAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - public Builder putAttr( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Attributes specific to this function definition.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.Integer, org.tensorflow.proto.framework.FunctionDef.ArgAttrs> argAttr_; - private com.google.protobuf.MapField - internalGetArgAttr() { - if (argAttr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ArgAttrDefaultEntryHolder.defaultEntry); - } - return argAttr_; - } - private com.google.protobuf.MapField - internalGetMutableArgAttr() { - onChanged();; - if (argAttr_ == null) { - argAttr_ = com.google.protobuf.MapField.newMapField( - ArgAttrDefaultEntryHolder.defaultEntry); - } - if (!argAttr_.isMutable()) { - argAttr_ = argAttr_.copy(); - } - return argAttr_; - } - - public int getArgAttrCount() { - return internalGetArgAttr().getMap().size(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public boolean containsArgAttr( - int key) { - - return internalGetArgAttr().getMap().containsKey(key); - } - /** - * Use {@link #getArgAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getArgAttr() { - return getArgAttrMap(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public java.util.Map getArgAttrMap() { - return internalGetArgAttr().getMap(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrDefault( - int key, - org.tensorflow.proto.framework.FunctionDef.ArgAttrs defaultValue) { - - java.util.Map map = - internalGetArgAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrThrow( - int key) { - - java.util.Map map = - internalGetArgAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearArgAttr() { - internalGetMutableArgAttr().getMutableMap() - .clear(); - return this; - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public Builder removeArgAttr( - int key) { - - internalGetMutableArgAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableArgAttr() { - return internalGetMutableArgAttr().getMutableMap(); - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - public Builder putArgAttr( - int key, - org.tensorflow.proto.framework.FunctionDef.ArgAttrs value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableArgAttr().getMutableMap() - .put(key, value); - return this; - } - /** - * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; - */ - - public Builder putAllArgAttr( - java.util.Map values) { - internalGetMutableArgAttr().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.Integer, java.lang.Integer> resourceArgUniqueId_; - private com.google.protobuf.MapField - internalGetResourceArgUniqueId() { - if (resourceArgUniqueId_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); - } - return resourceArgUniqueId_; - } - private com.google.protobuf.MapField - internalGetMutableResourceArgUniqueId() { - onChanged();; - if (resourceArgUniqueId_ == null) { - resourceArgUniqueId_ = com.google.protobuf.MapField.newMapField( - ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); - } - if (!resourceArgUniqueId_.isMutable()) { - resourceArgUniqueId_ = resourceArgUniqueId_.copy(); - } - return resourceArgUniqueId_; - } - - public int getResourceArgUniqueIdCount() { - return internalGetResourceArgUniqueId().getMap().size(); - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public boolean containsResourceArgUniqueId( - int key) { - - return internalGetResourceArgUniqueId().getMap().containsKey(key); - } - /** - * Use {@link #getResourceArgUniqueIdMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getResourceArgUniqueId() { - return getResourceArgUniqueIdMap(); - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public java.util.Map getResourceArgUniqueIdMap() { - return internalGetResourceArgUniqueId().getMap(); - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public int getResourceArgUniqueIdOrDefault( - int key, - int defaultValue) { - - java.util.Map map = - internalGetResourceArgUniqueId().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public int getResourceArgUniqueIdOrThrow( - int key) { - - java.util.Map map = - internalGetResourceArgUniqueId().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearResourceArgUniqueId() { - internalGetMutableResourceArgUniqueId().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public Builder removeResourceArgUniqueId( - int key) { - - internalGetMutableResourceArgUniqueId().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableResourceArgUniqueId() { - return internalGetMutableResourceArgUniqueId().getMutableMap(); - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - public Builder putResourceArgUniqueId( - int key, - int value) { - - - internalGetMutableResourceArgUniqueId().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Unique IDs for each resource argument, used to track aliasing resources. If
    -     * Argument A and Argument B alias each other, then
    -     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    -     * If this field is empty, none of the arguments could alias; otherwise, every
    -     * resource argument should have an entry in this field.
    -     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    -     * "_resource_arg_unique_id" attribute.
    -     * 
    - * - * map<uint32, uint32> resource_arg_unique_id = 8; - */ - - public Builder putAllResourceArgUniqueId( - java.util.Map values) { - internalGetMutableResourceArgUniqueId().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List nodeDef_ = - java.util.Collections.emptyList(); - private void ensureNodeDefIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - nodeDef_ = new java.util.ArrayList(nodeDef_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder> nodeDefBuilder_; - - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public java.util.List getNodeDefList() { - if (nodeDefBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeDef_); - } else { - return nodeDefBuilder_.getMessageList(); - } - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public int getNodeDefCount() { - if (nodeDefBuilder_ == null) { - return nodeDef_.size(); - } else { - return nodeDefBuilder_.getCount(); - } - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDef getNodeDef(int index) { - if (nodeDefBuilder_ == null) { - return nodeDef_.get(index); - } else { - return nodeDefBuilder_.getMessage(index); - } - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder setNodeDef( - int index, org.tensorflow.proto.framework.NodeDef value) { - if (nodeDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeDefIsMutable(); - nodeDef_.set(index, value); - onChanged(); - } else { - nodeDefBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder setNodeDef( - int index, org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeDefBuilder_ == null) { - ensureNodeDefIsMutable(); - nodeDef_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeDefBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder addNodeDef(org.tensorflow.proto.framework.NodeDef value) { - if (nodeDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeDefIsMutable(); - nodeDef_.add(value); - onChanged(); - } else { - nodeDefBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder addNodeDef( - int index, org.tensorflow.proto.framework.NodeDef value) { - if (nodeDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeDefIsMutable(); - nodeDef_.add(index, value); - onChanged(); - } else { - nodeDefBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder addNodeDef( - org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeDefBuilder_ == null) { - ensureNodeDefIsMutable(); - nodeDef_.add(builderForValue.build()); - onChanged(); - } else { - nodeDefBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder addNodeDef( - int index, org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeDefBuilder_ == null) { - ensureNodeDefIsMutable(); - nodeDef_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeDefBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder addAllNodeDef( - java.lang.Iterable values) { - if (nodeDefBuilder_ == null) { - ensureNodeDefIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeDef_); - onChanged(); - } else { - nodeDefBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder clearNodeDef() { - if (nodeDefBuilder_ == null) { - nodeDef_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - nodeDefBuilder_.clear(); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public Builder removeNodeDef(int index) { - if (nodeDefBuilder_ == null) { - ensureNodeDefIsMutable(); - nodeDef_.remove(index); - onChanged(); - } else { - nodeDefBuilder_.remove(index); - } - return this; - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDef.Builder getNodeDefBuilder( - int index) { - return getNodeDefFieldBuilder().getBuilder(index); - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDefOrBuilder getNodeDefOrBuilder( - int index) { - if (nodeDefBuilder_ == null) { - return nodeDef_.get(index); } else { - return nodeDefBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public java.util.List - getNodeDefOrBuilderList() { - if (nodeDefBuilder_ != null) { - return nodeDefBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeDef_); - } - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDef.Builder addNodeDefBuilder() { - return getNodeDefFieldBuilder().addBuilder( - org.tensorflow.proto.framework.NodeDef.getDefaultInstance()); - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public org.tensorflow.proto.framework.NodeDef.Builder addNodeDefBuilder( - int index) { - return getNodeDefFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.NodeDef.getDefaultInstance()); - } - /** - *
    -     * By convention, "op" in node_def is resolved by consulting with a
    -     * user-defined library first. If not resolved, "func" is assumed to
    -     * be a builtin op.
    -     * 
    - * - * repeated .tensorflow.NodeDef node_def = 3; - */ - public java.util.List - getNodeDefBuilderList() { - return getNodeDefFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder> - getNodeDefFieldBuilder() { - if (nodeDefBuilder_ == null) { - nodeDefBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder>( - nodeDef_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - nodeDef_ = null; - } - return nodeDefBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> ret_; - private com.google.protobuf.MapField - internalGetRet() { - if (ret_ == null) { - return com.google.protobuf.MapField.emptyMapField( - RetDefaultEntryHolder.defaultEntry); - } - return ret_; - } - private com.google.protobuf.MapField - internalGetMutableRet() { - onChanged();; - if (ret_ == null) { - ret_ = com.google.protobuf.MapField.newMapField( - RetDefaultEntryHolder.defaultEntry); - } - if (!ret_.isMutable()) { - ret_ = ret_.copy(); - } - return ret_; - } - - public int getRetCount() { - return internalGetRet().getMap().size(); - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public boolean containsRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetRet().getMap().containsKey(key); - } - /** - * Use {@link #getRetMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getRet() { - return getRetMap(); - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public java.util.Map getRetMap() { - return internalGetRet().getMap(); - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public java.lang.String getRetOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRet().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public java.lang.String getRetOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetRet().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearRet() { - internalGetMutableRet().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public Builder removeRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableRet().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableRet() { - return internalGetMutableRet().getMutableMap(); - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - public Builder putRet( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableRet().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * A mapping from the output arg names from `signature` to the
    -     * outputs from `node_def` that should be returned by the function.
    -     * 
    - * - * map<string, string> ret = 4; - */ - - public Builder putAllRet( - java.util.Map values) { - internalGetMutableRet().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> controlRet_; - private com.google.protobuf.MapField - internalGetControlRet() { - if (controlRet_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ControlRetDefaultEntryHolder.defaultEntry); - } - return controlRet_; - } - private com.google.protobuf.MapField - internalGetMutableControlRet() { - onChanged();; - if (controlRet_ == null) { - controlRet_ = com.google.protobuf.MapField.newMapField( - ControlRetDefaultEntryHolder.defaultEntry); - } - if (!controlRet_.isMutable()) { - controlRet_ = controlRet_.copy(); - } - return controlRet_; - } - - public int getControlRetCount() { - return internalGetControlRet().getMap().size(); - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public boolean containsControlRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetControlRet().getMap().containsKey(key); - } - /** - * Use {@link #getControlRetMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getControlRet() { - return getControlRetMap(); - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.util.Map getControlRetMap() { - return internalGetControlRet().getMap(); - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.lang.String getControlRetOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetControlRet().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public java.lang.String getControlRetOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetControlRet().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearControlRet() { - internalGetMutableControlRet().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public Builder removeControlRet( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableControlRet().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableControlRet() { - return internalGetMutableControlRet().getMutableMap(); - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - public Builder putControlRet( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableControlRet().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * A mapping from control output names from `signature` to node names in
    -     * `node_def` which should be control outputs of this function.
    -     * 
    - * - * map<string, string> control_ret = 6; - */ - - public Builder putAllControlRet( - java.util.Map values) { - internalGetMutableControlRet().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.FunctionDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef) - private static final org.tensorflow.proto.framework.FunctionDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.FunctionDef(); - } - - public static org.tensorflow.proto.framework.FunctionDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FunctionDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FunctionDef(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.FunctionDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibrary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibrary.java deleted file mode 100644 index 7619ea1b885..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibrary.java +++ /dev/null @@ -1,1459 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A library is a set of named functions.
    - * 
    - * - * Protobuf type {@code tensorflow.FunctionDefLibrary} - */ -public final class FunctionDefLibrary extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FunctionDefLibrary) - FunctionDefLibraryOrBuilder { -private static final long serialVersionUID = 0L; - // Use FunctionDefLibrary.newBuilder() to construct. - private FunctionDefLibrary(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FunctionDefLibrary() { - function_ = java.util.Collections.emptyList(); - gradient_ = java.util.Collections.emptyList(); - registeredGradients_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FunctionDefLibrary(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FunctionDefLibrary( - 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)) { - function_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - function_.add( - input.readMessage(org.tensorflow.proto.framework.FunctionDef.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - gradient_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - gradient_.add( - input.readMessage(org.tensorflow.proto.framework.GradientDef.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - registeredGradients_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - registeredGradients_.add( - input.readMessage(org.tensorflow.proto.framework.RegisteredGradient.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_ & 0x00000001) != 0)) { - function_ = java.util.Collections.unmodifiableList(function_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - gradient_ = java.util.Collections.unmodifiableList(gradient_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - registeredGradients_ = java.util.Collections.unmodifiableList(registeredGradients_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDefLibrary.class, org.tensorflow.proto.framework.FunctionDefLibrary.Builder.class); - } - - public static final int FUNCTION_FIELD_NUMBER = 1; - private java.util.List function_; - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public java.util.List getFunctionList() { - return function_; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public java.util.List - getFunctionOrBuilderList() { - return function_; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public int getFunctionCount() { - return function_.size(); - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDef getFunction(int index) { - return function_.get(index); - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDefOrBuilder getFunctionOrBuilder( - int index) { - return function_.get(index); - } - - public static final int GRADIENT_FIELD_NUMBER = 2; - private java.util.List gradient_; - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public java.util.List getGradientList() { - return gradient_; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public java.util.List - getGradientOrBuilderList() { - return gradient_; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public int getGradientCount() { - return gradient_.size(); - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDef getGradient(int index) { - return gradient_.get(index); - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDefOrBuilder getGradientOrBuilder( - int index) { - return gradient_.get(index); - } - - public static final int REGISTERED_GRADIENTS_FIELD_NUMBER = 3; - private java.util.List registeredGradients_; - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public java.util.List getRegisteredGradientsList() { - return registeredGradients_; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public java.util.List - getRegisteredGradientsOrBuilderList() { - return registeredGradients_; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public int getRegisteredGradientsCount() { - return registeredGradients_.size(); - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradient getRegisteredGradients(int index) { - return registeredGradients_.get(index); - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( - int index) { - return registeredGradients_.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 { - for (int i = 0; i < function_.size(); i++) { - output.writeMessage(1, function_.get(i)); - } - for (int i = 0; i < gradient_.size(); i++) { - output.writeMessage(2, gradient_.get(i)); - } - for (int i = 0; i < registeredGradients_.size(); i++) { - output.writeMessage(3, registeredGradients_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < function_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, function_.get(i)); - } - for (int i = 0; i < gradient_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, gradient_.get(i)); - } - for (int i = 0; i < registeredGradients_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, registeredGradients_.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.FunctionDefLibrary)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.FunctionDefLibrary other = (org.tensorflow.proto.framework.FunctionDefLibrary) obj; - - if (!getFunctionList() - .equals(other.getFunctionList())) return false; - if (!getGradientList() - .equals(other.getGradientList())) return false; - if (!getRegisteredGradientsList() - .equals(other.getRegisteredGradientsList())) 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 (getFunctionCount() > 0) { - hash = (37 * hash) + FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getFunctionList().hashCode(); - } - if (getGradientCount() > 0) { - hash = (37 * hash) + GRADIENT_FIELD_NUMBER; - hash = (53 * hash) + getGradientList().hashCode(); - } - if (getRegisteredGradientsCount() > 0) { - hash = (37 * hash) + REGISTERED_GRADIENTS_FIELD_NUMBER; - hash = (53 * hash) + getRegisteredGradientsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.FunctionDefLibrary parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary 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.FunctionDefLibrary parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary 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.FunctionDefLibrary parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary 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.FunctionDefLibrary parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary 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.FunctionDefLibrary parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionDefLibrary 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.FunctionDefLibrary 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 library is a set of named functions.
    -   * 
    - * - * Protobuf type {@code tensorflow.FunctionDefLibrary} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDefLibrary) - org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionDefLibrary.class, org.tensorflow.proto.framework.FunctionDefLibrary.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.FunctionDefLibrary.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFunctionFieldBuilder(); - getGradientFieldBuilder(); - getRegisteredGradientsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (functionBuilder_ == null) { - function_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - functionBuilder_.clear(); - } - if (gradientBuilder_ == null) { - gradient_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - gradientBuilder_.clear(); - } - if (registeredGradientsBuilder_ == null) { - registeredGradients_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - registeredGradientsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDefLibrary getDefaultInstanceForType() { - return org.tensorflow.proto.framework.FunctionDefLibrary.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDefLibrary build() { - org.tensorflow.proto.framework.FunctionDefLibrary result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionDefLibrary buildPartial() { - org.tensorflow.proto.framework.FunctionDefLibrary result = new org.tensorflow.proto.framework.FunctionDefLibrary(this); - int from_bitField0_ = bitField0_; - if (functionBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - function_ = java.util.Collections.unmodifiableList(function_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.function_ = function_; - } else { - result.function_ = functionBuilder_.build(); - } - if (gradientBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - gradient_ = java.util.Collections.unmodifiableList(gradient_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.gradient_ = gradient_; - } else { - result.gradient_ = gradientBuilder_.build(); - } - if (registeredGradientsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - registeredGradients_ = java.util.Collections.unmodifiableList(registeredGradients_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.registeredGradients_ = registeredGradients_; - } else { - result.registeredGradients_ = registeredGradientsBuilder_.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.FunctionDefLibrary) { - return mergeFrom((org.tensorflow.proto.framework.FunctionDefLibrary)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.FunctionDefLibrary other) { - if (other == org.tensorflow.proto.framework.FunctionDefLibrary.getDefaultInstance()) return this; - if (functionBuilder_ == null) { - if (!other.function_.isEmpty()) { - if (function_.isEmpty()) { - function_ = other.function_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFunctionIsMutable(); - function_.addAll(other.function_); - } - onChanged(); - } - } else { - if (!other.function_.isEmpty()) { - if (functionBuilder_.isEmpty()) { - functionBuilder_.dispose(); - functionBuilder_ = null; - function_ = other.function_; - bitField0_ = (bitField0_ & ~0x00000001); - functionBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFunctionFieldBuilder() : null; - } else { - functionBuilder_.addAllMessages(other.function_); - } - } - } - if (gradientBuilder_ == null) { - if (!other.gradient_.isEmpty()) { - if (gradient_.isEmpty()) { - gradient_ = other.gradient_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureGradientIsMutable(); - gradient_.addAll(other.gradient_); - } - onChanged(); - } - } else { - if (!other.gradient_.isEmpty()) { - if (gradientBuilder_.isEmpty()) { - gradientBuilder_.dispose(); - gradientBuilder_ = null; - gradient_ = other.gradient_; - bitField0_ = (bitField0_ & ~0x00000002); - gradientBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGradientFieldBuilder() : null; - } else { - gradientBuilder_.addAllMessages(other.gradient_); - } - } - } - if (registeredGradientsBuilder_ == null) { - if (!other.registeredGradients_.isEmpty()) { - if (registeredGradients_.isEmpty()) { - registeredGradients_ = other.registeredGradients_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureRegisteredGradientsIsMutable(); - registeredGradients_.addAll(other.registeredGradients_); - } - onChanged(); - } - } else { - if (!other.registeredGradients_.isEmpty()) { - if (registeredGradientsBuilder_.isEmpty()) { - registeredGradientsBuilder_.dispose(); - registeredGradientsBuilder_ = null; - registeredGradients_ = other.registeredGradients_; - bitField0_ = (bitField0_ & ~0x00000004); - registeredGradientsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getRegisteredGradientsFieldBuilder() : null; - } else { - registeredGradientsBuilder_.addAllMessages(other.registeredGradients_); - } - } - } - 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.FunctionDefLibrary parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.FunctionDefLibrary) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List function_ = - java.util.Collections.emptyList(); - private void ensureFunctionIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - function_ = new java.util.ArrayList(function_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDef, org.tensorflow.proto.framework.FunctionDef.Builder, org.tensorflow.proto.framework.FunctionDefOrBuilder> functionBuilder_; - - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public java.util.List getFunctionList() { - if (functionBuilder_ == null) { - return java.util.Collections.unmodifiableList(function_); - } else { - return functionBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public int getFunctionCount() { - if (functionBuilder_ == null) { - return function_.size(); - } else { - return functionBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDef getFunction(int index) { - if (functionBuilder_ == null) { - return function_.get(index); - } else { - return functionBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder setFunction( - int index, org.tensorflow.proto.framework.FunctionDef value) { - if (functionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.set(index, value); - onChanged(); - } else { - functionBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder setFunction( - int index, org.tensorflow.proto.framework.FunctionDef.Builder builderForValue) { - if (functionBuilder_ == null) { - ensureFunctionIsMutable(); - function_.set(index, builderForValue.build()); - onChanged(); - } else { - functionBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder addFunction(org.tensorflow.proto.framework.FunctionDef value) { - if (functionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.add(value); - onChanged(); - } else { - functionBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder addFunction( - int index, org.tensorflow.proto.framework.FunctionDef value) { - if (functionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionIsMutable(); - function_.add(index, value); - onChanged(); - } else { - functionBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder addFunction( - org.tensorflow.proto.framework.FunctionDef.Builder builderForValue) { - if (functionBuilder_ == null) { - ensureFunctionIsMutable(); - function_.add(builderForValue.build()); - onChanged(); - } else { - functionBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder addFunction( - int index, org.tensorflow.proto.framework.FunctionDef.Builder builderForValue) { - if (functionBuilder_ == null) { - ensureFunctionIsMutable(); - function_.add(index, builderForValue.build()); - onChanged(); - } else { - functionBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder addAllFunction( - java.lang.Iterable values) { - if (functionBuilder_ == null) { - ensureFunctionIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, function_); - onChanged(); - } else { - functionBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder clearFunction() { - if (functionBuilder_ == null) { - function_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - functionBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public Builder removeFunction(int index) { - if (functionBuilder_ == null) { - ensureFunctionIsMutable(); - function_.remove(index); - onChanged(); - } else { - functionBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDef.Builder getFunctionBuilder( - int index) { - return getFunctionFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDefOrBuilder getFunctionOrBuilder( - int index) { - if (functionBuilder_ == null) { - return function_.get(index); } else { - return functionBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public java.util.List - getFunctionOrBuilderList() { - if (functionBuilder_ != null) { - return functionBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(function_); - } - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDef.Builder addFunctionBuilder() { - return getFunctionFieldBuilder().addBuilder( - org.tensorflow.proto.framework.FunctionDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public org.tensorflow.proto.framework.FunctionDef.Builder addFunctionBuilder( - int index) { - return getFunctionFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.FunctionDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - public java.util.List - getFunctionBuilderList() { - return getFunctionFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDef, org.tensorflow.proto.framework.FunctionDef.Builder, org.tensorflow.proto.framework.FunctionDefOrBuilder> - getFunctionFieldBuilder() { - if (functionBuilder_ == null) { - functionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDef, org.tensorflow.proto.framework.FunctionDef.Builder, org.tensorflow.proto.framework.FunctionDefOrBuilder>( - function_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - function_ = null; - } - return functionBuilder_; - } - - private java.util.List gradient_ = - java.util.Collections.emptyList(); - private void ensureGradientIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - gradient_ = new java.util.ArrayList(gradient_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GradientDef, org.tensorflow.proto.framework.GradientDef.Builder, org.tensorflow.proto.framework.GradientDefOrBuilder> gradientBuilder_; - - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public java.util.List getGradientList() { - if (gradientBuilder_ == null) { - return java.util.Collections.unmodifiableList(gradient_); - } else { - return gradientBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public int getGradientCount() { - if (gradientBuilder_ == null) { - return gradient_.size(); - } else { - return gradientBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDef getGradient(int index) { - if (gradientBuilder_ == null) { - return gradient_.get(index); - } else { - return gradientBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder setGradient( - int index, org.tensorflow.proto.framework.GradientDef value) { - if (gradientBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGradientIsMutable(); - gradient_.set(index, value); - onChanged(); - } else { - gradientBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder setGradient( - int index, org.tensorflow.proto.framework.GradientDef.Builder builderForValue) { - if (gradientBuilder_ == null) { - ensureGradientIsMutable(); - gradient_.set(index, builderForValue.build()); - onChanged(); - } else { - gradientBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder addGradient(org.tensorflow.proto.framework.GradientDef value) { - if (gradientBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGradientIsMutable(); - gradient_.add(value); - onChanged(); - } else { - gradientBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder addGradient( - int index, org.tensorflow.proto.framework.GradientDef value) { - if (gradientBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGradientIsMutable(); - gradient_.add(index, value); - onChanged(); - } else { - gradientBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder addGradient( - org.tensorflow.proto.framework.GradientDef.Builder builderForValue) { - if (gradientBuilder_ == null) { - ensureGradientIsMutable(); - gradient_.add(builderForValue.build()); - onChanged(); - } else { - gradientBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder addGradient( - int index, org.tensorflow.proto.framework.GradientDef.Builder builderForValue) { - if (gradientBuilder_ == null) { - ensureGradientIsMutable(); - gradient_.add(index, builderForValue.build()); - onChanged(); - } else { - gradientBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder addAllGradient( - java.lang.Iterable values) { - if (gradientBuilder_ == null) { - ensureGradientIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, gradient_); - onChanged(); - } else { - gradientBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder clearGradient() { - if (gradientBuilder_ == null) { - gradient_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - gradientBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public Builder removeGradient(int index) { - if (gradientBuilder_ == null) { - ensureGradientIsMutable(); - gradient_.remove(index); - onChanged(); - } else { - gradientBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDef.Builder getGradientBuilder( - int index) { - return getGradientFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDefOrBuilder getGradientOrBuilder( - int index) { - if (gradientBuilder_ == null) { - return gradient_.get(index); } else { - return gradientBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public java.util.List - getGradientOrBuilderList() { - if (gradientBuilder_ != null) { - return gradientBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(gradient_); - } - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDef.Builder addGradientBuilder() { - return getGradientFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GradientDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public org.tensorflow.proto.framework.GradientDef.Builder addGradientBuilder( - int index) { - return getGradientFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GradientDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - public java.util.List - getGradientBuilderList() { - return getGradientFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GradientDef, org.tensorflow.proto.framework.GradientDef.Builder, org.tensorflow.proto.framework.GradientDefOrBuilder> - getGradientFieldBuilder() { - if (gradientBuilder_ == null) { - gradientBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GradientDef, org.tensorflow.proto.framework.GradientDef.Builder, org.tensorflow.proto.framework.GradientDefOrBuilder>( - gradient_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - gradient_ = null; - } - return gradientBuilder_; - } - - private java.util.List registeredGradients_ = - java.util.Collections.emptyList(); - private void ensureRegisteredGradientsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - registeredGradients_ = new java.util.ArrayList(registeredGradients_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RegisteredGradient, org.tensorflow.proto.framework.RegisteredGradient.Builder, org.tensorflow.proto.framework.RegisteredGradientOrBuilder> registeredGradientsBuilder_; - - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public java.util.List getRegisteredGradientsList() { - if (registeredGradientsBuilder_ == null) { - return java.util.Collections.unmodifiableList(registeredGradients_); - } else { - return registeredGradientsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public int getRegisteredGradientsCount() { - if (registeredGradientsBuilder_ == null) { - return registeredGradients_.size(); - } else { - return registeredGradientsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradient getRegisteredGradients(int index) { - if (registeredGradientsBuilder_ == null) { - return registeredGradients_.get(index); - } else { - return registeredGradientsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder setRegisteredGradients( - int index, org.tensorflow.proto.framework.RegisteredGradient value) { - if (registeredGradientsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRegisteredGradientsIsMutable(); - registeredGradients_.set(index, value); - onChanged(); - } else { - registeredGradientsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder setRegisteredGradients( - int index, org.tensorflow.proto.framework.RegisteredGradient.Builder builderForValue) { - if (registeredGradientsBuilder_ == null) { - ensureRegisteredGradientsIsMutable(); - registeredGradients_.set(index, builderForValue.build()); - onChanged(); - } else { - registeredGradientsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder addRegisteredGradients(org.tensorflow.proto.framework.RegisteredGradient value) { - if (registeredGradientsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRegisteredGradientsIsMutable(); - registeredGradients_.add(value); - onChanged(); - } else { - registeredGradientsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder addRegisteredGradients( - int index, org.tensorflow.proto.framework.RegisteredGradient value) { - if (registeredGradientsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRegisteredGradientsIsMutable(); - registeredGradients_.add(index, value); - onChanged(); - } else { - registeredGradientsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder addRegisteredGradients( - org.tensorflow.proto.framework.RegisteredGradient.Builder builderForValue) { - if (registeredGradientsBuilder_ == null) { - ensureRegisteredGradientsIsMutable(); - registeredGradients_.add(builderForValue.build()); - onChanged(); - } else { - registeredGradientsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder addRegisteredGradients( - int index, org.tensorflow.proto.framework.RegisteredGradient.Builder builderForValue) { - if (registeredGradientsBuilder_ == null) { - ensureRegisteredGradientsIsMutable(); - registeredGradients_.add(index, builderForValue.build()); - onChanged(); - } else { - registeredGradientsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder addAllRegisteredGradients( - java.lang.Iterable values) { - if (registeredGradientsBuilder_ == null) { - ensureRegisteredGradientsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, registeredGradients_); - onChanged(); - } else { - registeredGradientsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder clearRegisteredGradients() { - if (registeredGradientsBuilder_ == null) { - registeredGradients_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - registeredGradientsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public Builder removeRegisteredGradients(int index) { - if (registeredGradientsBuilder_ == null) { - ensureRegisteredGradientsIsMutable(); - registeredGradients_.remove(index); - onChanged(); - } else { - registeredGradientsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradient.Builder getRegisteredGradientsBuilder( - int index) { - return getRegisteredGradientsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( - int index) { - if (registeredGradientsBuilder_ == null) { - return registeredGradients_.get(index); } else { - return registeredGradientsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public java.util.List - getRegisteredGradientsOrBuilderList() { - if (registeredGradientsBuilder_ != null) { - return registeredGradientsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(registeredGradients_); - } - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradient.Builder addRegisteredGradientsBuilder() { - return getRegisteredGradientsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.RegisteredGradient.getDefaultInstance()); - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public org.tensorflow.proto.framework.RegisteredGradient.Builder addRegisteredGradientsBuilder( - int index) { - return getRegisteredGradientsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.RegisteredGradient.getDefaultInstance()); - } - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - public java.util.List - getRegisteredGradientsBuilderList() { - return getRegisteredGradientsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RegisteredGradient, org.tensorflow.proto.framework.RegisteredGradient.Builder, org.tensorflow.proto.framework.RegisteredGradientOrBuilder> - getRegisteredGradientsFieldBuilder() { - if (registeredGradientsBuilder_ == null) { - registeredGradientsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RegisteredGradient, org.tensorflow.proto.framework.RegisteredGradient.Builder, org.tensorflow.proto.framework.RegisteredGradientOrBuilder>( - registeredGradients_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - registeredGradients_ = null; - } - return registeredGradientsBuilder_; - } - @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.FunctionDefLibrary) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FunctionDefLibrary) - private static final org.tensorflow.proto.framework.FunctionDefLibrary DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.FunctionDefLibrary(); - } - - public static org.tensorflow.proto.framework.FunctionDefLibrary getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FunctionDefLibrary parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FunctionDefLibrary(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.FunctionDefLibrary getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibraryOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibraryOrBuilder.java deleted file mode 100644 index 5a8d9c6ae5e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefLibraryOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -public interface FunctionDefLibraryOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FunctionDefLibrary) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - java.util.List - getFunctionList(); - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - org.tensorflow.proto.framework.FunctionDef getFunction(int index); - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - int getFunctionCount(); - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - java.util.List - getFunctionOrBuilderList(); - /** - * repeated .tensorflow.FunctionDef function = 1; - */ - org.tensorflow.proto.framework.FunctionDefOrBuilder getFunctionOrBuilder( - int index); - - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - java.util.List - getGradientList(); - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - org.tensorflow.proto.framework.GradientDef getGradient(int index); - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - int getGradientCount(); - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - java.util.List - getGradientOrBuilderList(); - /** - * repeated .tensorflow.GradientDef gradient = 2; - */ - org.tensorflow.proto.framework.GradientDefOrBuilder getGradientOrBuilder( - int index); - - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - java.util.List - getRegisteredGradientsList(); - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - org.tensorflow.proto.framework.RegisteredGradient getRegisteredGradients(int index); - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - int getRegisteredGradientsCount(); - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - java.util.List - getRegisteredGradientsOrBuilderList(); - /** - * repeated .tensorflow.RegisteredGradient registered_gradients = 3; - */ - org.tensorflow.proto.framework.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( - int index); -} 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 deleted file mode 100644 index d71706dad58..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpec.java +++ /dev/null @@ -1,1162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents `FunctionSpec` used in `Function`. This represents a
    - * function that has been wrapped as a TensorFlow `Function`.
    - * 
    - * - * Protobuf type {@code tensorflow.FunctionSpec} - */ -public final class FunctionSpec extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.FunctionSpec) - FunctionSpecOrBuilder { -private static final long serialVersionUID = 0L; - // Use FunctionSpec.newBuilder() to construct. - private FunctionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FunctionSpec() { - jitCompile_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FunctionSpec(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FunctionSpec( - 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: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (fullargspec_ != null) { - subBuilder = fullargspec_.toBuilder(); - } - fullargspec_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fullargspec_); - fullargspec_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - isMethod_ = input.readBool(); - break; - } - case 42: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (inputSignature_ != null) { - subBuilder = inputSignature_.toBuilder(); - } - inputSignature_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(inputSignature_); - inputSignature_ = subBuilder.buildPartial(); - } - - break; - } - case 48: { - int rawValue = input.readEnum(); - - jitCompile_ = rawValue; - 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.SavedObjectGraphProtos.internal_static_tensorflow_FunctionSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_FunctionSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - 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.JitCompile} - */ - public enum JitCompile - 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 JitCompile valueOf(int value) { - return forNumber(value); - } - - public static JitCompile 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< - JitCompile> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public JitCompile findValueByNumber(int number) { - return JitCompile.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 JitCompile[] VALUES = values(); - - public static JitCompile 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 JitCompile(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.FunctionSpec.JitCompile) - } - - public static final int FULLARGSPEC_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.StructuredValue fullargspec_; - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public boolean hasFullargspec() { - return fullargspec_ != null; - } - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getFullargspec() { - return fullargspec_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : fullargspec_; - } - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getFullargspecOrBuilder() { - return getFullargspec(); - } - - public static final int IS_METHOD_FIELD_NUMBER = 2; - private boolean isMethod_; - /** - *
    -   * Whether this represents a class method.
    -   * 
    - * - * bool is_method = 2; - */ - public boolean getIsMethod() { - return isMethod_; - } - - public static final int INPUT_SIGNATURE_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.StructuredValue inputSignature_; - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public boolean hasInputSignature() { - return inputSignature_ != null; - } - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public org.tensorflow.proto.framework.StructuredValue getInputSignature() { - return inputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : inputSignature_; - } - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignatureOrBuilder() { - return getInputSignature(); - } - - public static final int JIT_COMPILE_FIELD_NUMBER = 6; - private int jitCompile_; - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public int getJitCompileValue() { - return jitCompile_; - } - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public org.tensorflow.proto.framework.FunctionSpec.JitCompile getJitCompile() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FunctionSpec.JitCompile result = org.tensorflow.proto.framework.FunctionSpec.JitCompile.valueOf(jitCompile_); - return result == null ? org.tensorflow.proto.framework.FunctionSpec.JitCompile.UNRECOGNIZED : result; - } - - 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 (fullargspec_ != null) { - output.writeMessage(1, getFullargspec()); - } - if (isMethod_ != false) { - output.writeBool(2, isMethod_); - } - if (inputSignature_ != null) { - output.writeMessage(5, getInputSignature()); - } - if (jitCompile_ != org.tensorflow.proto.framework.FunctionSpec.JitCompile.DEFAULT.getNumber()) { - output.writeEnum(6, jitCompile_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (fullargspec_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getFullargspec()); - } - if (isMethod_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, isMethod_); - } - if (inputSignature_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getInputSignature()); - } - if (jitCompile_ != org.tensorflow.proto.framework.FunctionSpec.JitCompile.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, jitCompile_); - } - 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.FunctionSpec)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.FunctionSpec other = (org.tensorflow.proto.framework.FunctionSpec) obj; - - if (hasFullargspec() != other.hasFullargspec()) return false; - if (hasFullargspec()) { - if (!getFullargspec() - .equals(other.getFullargspec())) return false; - } - if (getIsMethod() - != other.getIsMethod()) return false; - if (hasInputSignature() != other.hasInputSignature()) return false; - if (hasInputSignature()) { - if (!getInputSignature() - .equals(other.getInputSignature())) return false; - } - if (jitCompile_ != other.jitCompile_) 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 (hasFullargspec()) { - hash = (37 * hash) + FULLARGSPEC_FIELD_NUMBER; - hash = (53 * hash) + getFullargspec().hashCode(); - } - hash = (37 * hash) + IS_METHOD_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsMethod()); - if (hasInputSignature()) { - hash = (37 * hash) + INPUT_SIGNATURE_FIELD_NUMBER; - hash = (53 * hash) + getInputSignature().hashCode(); - } - hash = (37 * hash) + JIT_COMPILE_FIELD_NUMBER; - hash = (53 * hash) + jitCompile_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.FunctionSpec parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionSpec 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.FunctionSpec parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionSpec 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.FunctionSpec parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.FunctionSpec parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.FunctionSpec parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionSpec 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.FunctionSpec parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionSpec 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.FunctionSpec parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.FunctionSpec 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.FunctionSpec 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; - } - /** - *
    -   * Represents `FunctionSpec` used in `Function`. This represents a
    -   * function that has been wrapped as a TensorFlow `Function`.
    -   * 
    - * - * Protobuf type {@code tensorflow.FunctionSpec} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.FunctionSpec) - org.tensorflow.proto.framework.FunctionSpecOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_FunctionSpec_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_FunctionSpec_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.FunctionSpec.class, org.tensorflow.proto.framework.FunctionSpec.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.FunctionSpec.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 (fullargspecBuilder_ == null) { - fullargspec_ = null; - } else { - fullargspec_ = null; - fullargspecBuilder_ = null; - } - isMethod_ = false; - - if (inputSignatureBuilder_ == null) { - inputSignature_ = null; - } else { - inputSignature_ = null; - inputSignatureBuilder_ = null; - } - jitCompile_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_FunctionSpec_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionSpec getDefaultInstanceForType() { - return org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionSpec build() { - org.tensorflow.proto.framework.FunctionSpec result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.FunctionSpec buildPartial() { - org.tensorflow.proto.framework.FunctionSpec result = new org.tensorflow.proto.framework.FunctionSpec(this); - if (fullargspecBuilder_ == null) { - result.fullargspec_ = fullargspec_; - } else { - result.fullargspec_ = fullargspecBuilder_.build(); - } - result.isMethod_ = isMethod_; - if (inputSignatureBuilder_ == null) { - result.inputSignature_ = inputSignature_; - } else { - result.inputSignature_ = inputSignatureBuilder_.build(); - } - result.jitCompile_ = jitCompile_; - 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.FunctionSpec) { - return mergeFrom((org.tensorflow.proto.framework.FunctionSpec)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.FunctionSpec other) { - if (other == org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance()) return this; - if (other.hasFullargspec()) { - mergeFullargspec(other.getFullargspec()); - } - if (other.getIsMethod() != false) { - setIsMethod(other.getIsMethod()); - } - if (other.hasInputSignature()) { - mergeInputSignature(other.getInputSignature()); - } - if (other.jitCompile_ != 0) { - setJitCompileValue(other.getJitCompileValue()); - } - 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.FunctionSpec parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.FunctionSpec) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.framework.StructuredValue fullargspec_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> fullargspecBuilder_; - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public boolean hasFullargspec() { - return fullargspecBuilder_ != null || fullargspec_ != null; - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getFullargspec() { - if (fullargspecBuilder_ == null) { - return fullargspec_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : fullargspec_; - } else { - return fullargspecBuilder_.getMessage(); - } - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public Builder setFullargspec(org.tensorflow.proto.framework.StructuredValue value) { - if (fullargspecBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - fullargspec_ = value; - onChanged(); - } else { - fullargspecBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public Builder setFullargspec( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (fullargspecBuilder_ == null) { - fullargspec_ = builderForValue.build(); - onChanged(); - } else { - fullargspecBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public Builder mergeFullargspec(org.tensorflow.proto.framework.StructuredValue value) { - if (fullargspecBuilder_ == null) { - if (fullargspec_ != null) { - fullargspec_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(fullargspec_).mergeFrom(value).buildPartial(); - } else { - fullargspec_ = value; - } - onChanged(); - } else { - fullargspecBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public Builder clearFullargspec() { - if (fullargspecBuilder_ == null) { - fullargspec_ = null; - onChanged(); - } else { - fullargspec_ = null; - fullargspecBuilder_ = null; - } - - return this; - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getFullargspecBuilder() { - - onChanged(); - return getFullargspecFieldBuilder().getBuilder(); - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getFullargspecOrBuilder() { - if (fullargspecBuilder_ != null) { - return fullargspecBuilder_.getMessageOrBuilder(); - } else { - return fullargspec_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : fullargspec_; - } - } - /** - *
    -     * Full arg spec from inspect.getfullargspec().
    -     * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getFullargspecFieldBuilder() { - if (fullargspecBuilder_ == null) { - fullargspecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getFullargspec(), - getParentForChildren(), - isClean()); - fullargspec_ = null; - } - return fullargspecBuilder_; - } - - private boolean isMethod_ ; - /** - *
    -     * Whether this represents a class method.
    -     * 
    - * - * bool is_method = 2; - */ - public boolean getIsMethod() { - return isMethod_; - } - /** - *
    -     * Whether this represents a class method.
    -     * 
    - * - * bool is_method = 2; - */ - public Builder setIsMethod(boolean value) { - - isMethod_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether this represents a class method.
    -     * 
    - * - * bool is_method = 2; - */ - public Builder clearIsMethod() { - - isMethod_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.StructuredValue inputSignature_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> inputSignatureBuilder_; - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public boolean hasInputSignature() { - return inputSignatureBuilder_ != null || inputSignature_ != null; - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public org.tensorflow.proto.framework.StructuredValue getInputSignature() { - if (inputSignatureBuilder_ == null) { - return inputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : inputSignature_; - } else { - return inputSignatureBuilder_.getMessage(); - } - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public Builder setInputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (inputSignatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - inputSignature_ = value; - onChanged(); - } else { - inputSignatureBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public Builder setInputSignature( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (inputSignatureBuilder_ == null) { - inputSignature_ = builderForValue.build(); - onChanged(); - } else { - inputSignatureBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public Builder mergeInputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (inputSignatureBuilder_ == null) { - if (inputSignature_ != null) { - inputSignature_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(inputSignature_).mergeFrom(value).buildPartial(); - } else { - inputSignature_ = value; - } - onChanged(); - } else { - inputSignatureBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public Builder clearInputSignature() { - if (inputSignatureBuilder_ == null) { - inputSignature_ = null; - onChanged(); - } else { - inputSignature_ = null; - inputSignatureBuilder_ = null; - } - - return this; - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getInputSignatureBuilder() { - - onChanged(); - return getInputSignatureFieldBuilder().getBuilder(); - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignatureOrBuilder() { - if (inputSignatureBuilder_ != null) { - return inputSignatureBuilder_.getMessageOrBuilder(); - } else { - return inputSignature_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : inputSignature_; - } - } - /** - *
    -     * The input signature, if specified.
    -     * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getInputSignatureFieldBuilder() { - if (inputSignatureBuilder_ == null) { - inputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getInputSignature(), - getParentForChildren(), - isClean()); - inputSignature_ = null; - } - return inputSignatureBuilder_; - } - - private int jitCompile_ = 0; - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public int getJitCompileValue() { - return jitCompile_; - } - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public Builder setJitCompileValue(int value) { - jitCompile_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public org.tensorflow.proto.framework.FunctionSpec.JitCompile getJitCompile() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.FunctionSpec.JitCompile result = org.tensorflow.proto.framework.FunctionSpec.JitCompile.valueOf(jitCompile_); - return result == null ? org.tensorflow.proto.framework.FunctionSpec.JitCompile.UNRECOGNIZED : result; - } - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public Builder setJitCompile(org.tensorflow.proto.framework.FunctionSpec.JitCompile value) { - if (value == null) { - throw new NullPointerException(); - } - - jitCompile_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - public Builder clearJitCompile() { - - jitCompile_ = 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.FunctionSpec) - } - - // @@protoc_insertion_point(class_scope:tensorflow.FunctionSpec) - private static final org.tensorflow.proto.framework.FunctionSpec DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.FunctionSpec(); - } - - public static org.tensorflow.proto.framework.FunctionSpec getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FunctionSpec parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FunctionSpec(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.FunctionSpec getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 8f2536c86b9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionSpecOrBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface FunctionSpecOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.FunctionSpec) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - boolean hasFullargspec(); - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - org.tensorflow.proto.framework.StructuredValue getFullargspec(); - /** - *
    -   * Full arg spec from inspect.getfullargspec().
    -   * 
    - * - * .tensorflow.StructuredValue fullargspec = 1; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getFullargspecOrBuilder(); - - /** - *
    -   * Whether this represents a class method.
    -   * 
    - * - * bool is_method = 2; - */ - boolean getIsMethod(); - - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - boolean hasInputSignature(); - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - org.tensorflow.proto.framework.StructuredValue getInputSignature(); - /** - *
    -   * The input signature, if specified.
    -   * 
    - * - * .tensorflow.StructuredValue input_signature = 5; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getInputSignatureOrBuilder(); - - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - int getJitCompileValue(); - /** - * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; - */ - org.tensorflow.proto.framework.FunctionSpec.JitCompile getJitCompile(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java deleted file mode 100644 index dab612abaa5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptions.java +++ /dev/null @@ -1,5268 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GPUOptions} - */ -public final class GPUOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions) - GPUOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use GPUOptions.newBuilder() to construct. - private GPUOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GPUOptions() { - allocatorType_ = ""; - visibleDeviceList_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GPUOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GPUOptions( - 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 9: { - - perProcessGpuMemoryFraction_ = input.readDouble(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - allocatorType_ = s; - break; - } - case 24: { - - deferredDeletionBytes_ = input.readInt64(); - break; - } - case 32: { - - allowGrowth_ = input.readBool(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - visibleDeviceList_ = s; - break; - } - case 48: { - - pollingActiveDelayUsecs_ = input.readInt32(); - break; - } - case 56: { - - pollingInactiveDelayMsecs_ = input.readInt32(); - break; - } - case 64: { - - forceGpuCompatible_ = input.readBool(); - break; - } - case 74: { - org.tensorflow.proto.framework.GPUOptions.Experimental.Builder subBuilder = null; - if (experimental_ != null) { - subBuilder = experimental_.toBuilder(); - } - experimental_ = input.readMessage(org.tensorflow.proto.framework.GPUOptions.Experimental.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(experimental_); - experimental_ = subBuilder.buildPartial(); - } - - 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.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.class, org.tensorflow.proto.framework.GPUOptions.Builder.class); - } - - public interface ExperimentalOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions.Experimental) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - java.util.List - getVirtualDevicesList(); - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index); - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - int getVirtualDevicesCount(); - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - java.util.List - getVirtualDevicesOrBuilderList(); - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( - int index); - - /** - *
    -     * If true, uses CUDA unified memory for memory allocations. If
    -     * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    -     * memory is used regardless of the value for this field. See comments for
    -     * per_process_gpu_memory_fraction field for more details and requirements
    -     * of the unified memory. This option is useful to oversubscribe memory if
    -     * multiple processes are sharing a single GPU while individually using less
    -     * than 1.0 per process memory fraction.
    -     * 
    - * - * bool use_unified_memory = 2; - */ - boolean getUseUnifiedMemory(); - - /** - *
    -     * If > 1, the number of device-to-device copy streams to create
    -     * for each GPUDevice.  Default value is 0, which is automatically
    -     * converted to 1.
    -     * 
    - * - * int32 num_dev_to_dev_copy_streams = 3; - */ - int getNumDevToDevCopyStreams(); - - /** - *
    -     * If non-empty, defines a good GPU ring order on a single worker based on
    -     * device interconnect.  This assumes that all workers have the same GPU
    -     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -     * This ring order is used by the RingReducer implementation of
    -     * CollectiveReduce, and serves as an override to automatic ring order
    -     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -     * 
    - * - * string collective_ring_order = 4; - */ - java.lang.String getCollectiveRingOrder(); - /** - *
    -     * If non-empty, defines a good GPU ring order on a single worker based on
    -     * device interconnect.  This assumes that all workers have the same GPU
    -     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -     * This ring order is used by the RingReducer implementation of
    -     * CollectiveReduce, and serves as an override to automatic ring order
    -     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -     * 
    - * - * string collective_ring_order = 4; - */ - com.google.protobuf.ByteString - getCollectiveRingOrderBytes(); - - /** - *
    -     * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    -     * keep track of when GPU memory is freed and when kernels actually
    -     * complete so that we can know when a nominally free memory chunk
    -     * is really not subject to pending use.
    -     * 
    - * - * bool timestamped_allocator = 5; - */ - boolean getTimestampedAllocator(); - - /** - *
    -     * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    -     * Note that timestamped_allocator is only effective if some tracking is
    -     * specified.
    -     * If kernel_tracker_max_interval = n > 0, then a tracking event
    -     * is inserted after every n kernels without an event.
    -     * 
    - * - * int32 kernel_tracker_max_interval = 7; - */ - int getKernelTrackerMaxInterval(); - - /** - *
    -     * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    -     * inserted after every series of kernels allocating a sum of
    -     * memory >= n.  If one kernel allocates b * n bytes, then one
    -     * event will be inserted after it, but it will count as b against
    -     * the pending limit.
    -     * 
    - * - * int32 kernel_tracker_max_bytes = 8; - */ - int getKernelTrackerMaxBytes(); - - /** - *
    -     * If kernel_tracker_max_pending > 0 then no more than this many
    -     * tracking events can be outstanding at a time.  An attempt to
    -     * launch an additional kernel will stall until an event
    -     * completes.
    -     * 
    - * - * int32 kernel_tracker_max_pending = 9; - */ - int getKernelTrackerMaxPending(); - - /** - *
    -     * BFC Allocator can return an allocated chunk of memory upto 2x the
    -     * requested size. For virtual devices with tight memory constraints, and
    -     * proportionately large allocation requests, this can lead to a significant
    -     * reduction in available memory. The threshold below controls when a chunk
    -     * should be split if the chunk size exceeds requested memory size. It is
    -     * expressed as a fraction of total available memory for the tf device. For
    -     * example setting it to 0.05 would imply a chunk needs to be split if its
    -     * size exceeds the requested memory by 5% of the total virtual device/gpu
    -     * memory size.
    -     * 
    - * - * double internal_fragmentation_fraction = 10; - */ - double getInternalFragmentationFraction(); - - /** - *
    -     * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    -     * 
    - * - * bool use_cuda_malloc_async = 11; - */ - boolean getUseCudaMallocAsync(); - } - /** - * Protobuf type {@code tensorflow.GPUOptions.Experimental} - */ - public static final class Experimental extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions.Experimental) - ExperimentalOrBuilder { - private static final long serialVersionUID = 0L; - // Use Experimental.newBuilder() to construct. - private Experimental(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Experimental() { - virtualDevices_ = java.util.Collections.emptyList(); - collectiveRingOrder_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Experimental(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Experimental( - 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)) { - virtualDevices_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - virtualDevices_.add( - input.readMessage(org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.parser(), extensionRegistry)); - break; - } - case 16: { - - useUnifiedMemory_ = input.readBool(); - break; - } - case 24: { - - numDevToDevCopyStreams_ = input.readInt32(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - collectiveRingOrder_ = s; - break; - } - case 40: { - - timestampedAllocator_ = input.readBool(); - break; - } - case 56: { - - kernelTrackerMaxInterval_ = input.readInt32(); - break; - } - case 64: { - - kernelTrackerMaxBytes_ = input.readInt32(); - break; - } - case 72: { - - kernelTrackerMaxPending_ = input.readInt32(); - break; - } - case 81: { - - internalFragmentationFraction_ = input.readDouble(); - break; - } - case 88: { - - useCudaMallocAsync_ = input.readBool(); - 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)) { - virtualDevices_ = java.util.Collections.unmodifiableList(virtualDevices_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.Experimental.class, org.tensorflow.proto.framework.GPUOptions.Experimental.Builder.class); - } - - public interface VirtualDevicesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions.Experimental.VirtualDevices) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - java.util.List getMemoryLimitMbList(); - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - int getMemoryLimitMbCount(); - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - float getMemoryLimitMb(int index); - - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - java.util.List getPriorityList(); - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - int getPriorityCount(); - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - int getPriority(int index); - } - /** - *
    -     * Configuration for breaking down a visible GPU into multiple "virtual"
    -     * devices.
    -     * 
    - * - * Protobuf type {@code tensorflow.GPUOptions.Experimental.VirtualDevices} - */ - public static final class VirtualDevices extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions.Experimental.VirtualDevices) - VirtualDevicesOrBuilder { - private static final long serialVersionUID = 0L; - // Use VirtualDevices.newBuilder() to construct. - private VirtualDevices(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VirtualDevices() { - memoryLimitMb_ = emptyFloatList(); - priority_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VirtualDevices(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VirtualDevices( - 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 13: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - memoryLimitMb_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - memoryLimitMb_.addFloat(input.readFloat()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - memoryLimitMb_ = newFloatList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - memoryLimitMb_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - priority_ = newIntList(); - mutable_bitField0_ |= 0x00000002; - } - priority_.addInt(input.readInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - priority_ = newIntList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - priority_.addInt(input.readInt32()); - } - input.popLimit(limit); - 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)) { - memoryLimitMb_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - priority_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.class, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder.class); - } - - public static final int MEMORY_LIMIT_MB_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.FloatList memoryLimitMb_; - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - public java.util.List - getMemoryLimitMbList() { - return memoryLimitMb_; - } - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - public int getMemoryLimitMbCount() { - return memoryLimitMb_.size(); - } - /** - *
    -       * Per "virtual" device memory limit, in MB. The number of elements in
    -       * the list is the number of virtual devices to create on the
    -       * corresponding visible GPU (see "virtual_devices" below).
    -       * If empty, it will create single virtual device taking all available
    -       * memory from the device.
    -       * For the concept of "visible" and "virtual" GPU, see the comments for
    -       * "visible_device_list" above for more information.
    -       * 
    - * - * repeated float memory_limit_mb = 1; - */ - public float getMemoryLimitMb(int index) { - return memoryLimitMb_.getFloat(index); - } - private int memoryLimitMbMemoizedSerializedSize = -1; - - public static final int PRIORITY_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.IntList priority_; - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - public java.util.List - getPriorityList() { - return priority_; - } - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - public int getPriorityCount() { - return priority_.size(); - } - /** - *
    -       * Priority values to use with the virtual devices. Use the cuda function
    -       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -       * priority.
    -       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -       * least priority and -1 for greatest priority.
    -       * If this field is not specified, then the virtual devices will be
    -       * created with the default. If this field has values set, then the size
    -       * of this must match with the above memory_limit_mb.
    -       * 
    - * - * repeated int32 priority = 2; - */ - public int getPriority(int index) { - return priority_.getInt(index); - } - private int priorityMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (getMemoryLimitMbList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(memoryLimitMbMemoizedSerializedSize); - } - for (int i = 0; i < memoryLimitMb_.size(); i++) { - output.writeFloatNoTag(memoryLimitMb_.getFloat(i)); - } - if (getPriorityList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(priorityMemoizedSerializedSize); - } - for (int i = 0; i < priority_.size(); i++) { - output.writeInt32NoTag(priority_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * getMemoryLimitMbList().size(); - size += dataSize; - if (!getMemoryLimitMbList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - memoryLimitMbMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < priority_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(priority_.getInt(i)); - } - size += dataSize; - if (!getPriorityList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - priorityMemoizedSerializedSize = dataSize; - } - 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.GPUOptions.Experimental.VirtualDevices)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices other = (org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices) obj; - - if (!getMemoryLimitMbList() - .equals(other.getMemoryLimitMbList())) return false; - if (!getPriorityList() - .equals(other.getPriorityList())) 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 (getMemoryLimitMbCount() > 0) { - hash = (37 * hash) + MEMORY_LIMIT_MB_FIELD_NUMBER; - hash = (53 * hash) + getMemoryLimitMbList().hashCode(); - } - if (getPriorityCount() > 0) { - hash = (37 * hash) + PRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPriorityList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices 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 breaking down a visible GPU into multiple "virtual"
    -       * devices.
    -       * 
    - * - * Protobuf type {@code tensorflow.GPUOptions.Experimental.VirtualDevices} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions.Experimental.VirtualDevices) - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.class, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.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(); - memoryLimitMb_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - priority_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices build() { - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices buildPartial() { - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices result = new org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - memoryLimitMb_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.memoryLimitMb_ = memoryLimitMb_; - if (((bitField0_ & 0x00000002) != 0)) { - priority_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.priority_ = priority_; - 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.GPUOptions.Experimental.VirtualDevices) { - return mergeFrom((org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices other) { - if (other == org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()) return this; - if (!other.memoryLimitMb_.isEmpty()) { - if (memoryLimitMb_.isEmpty()) { - memoryLimitMb_ = other.memoryLimitMb_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMemoryLimitMbIsMutable(); - memoryLimitMb_.addAll(other.memoryLimitMb_); - } - onChanged(); - } - if (!other.priority_.isEmpty()) { - if (priority_.isEmpty()) { - priority_ = other.priority_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePriorityIsMutable(); - priority_.addAll(other.priority_); - } - onChanged(); - } - 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.GPUOptions.Experimental.VirtualDevices parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.FloatList memoryLimitMb_ = emptyFloatList(); - private void ensureMemoryLimitMbIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - memoryLimitMb_ = mutableCopy(memoryLimitMb_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public java.util.List - getMemoryLimitMbList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(memoryLimitMb_) : memoryLimitMb_; - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public int getMemoryLimitMbCount() { - return memoryLimitMb_.size(); - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public float getMemoryLimitMb(int index) { - return memoryLimitMb_.getFloat(index); - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public Builder setMemoryLimitMb( - int index, float value) { - ensureMemoryLimitMbIsMutable(); - memoryLimitMb_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public Builder addMemoryLimitMb(float value) { - ensureMemoryLimitMbIsMutable(); - memoryLimitMb_.addFloat(value); - onChanged(); - return this; - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public Builder addAllMemoryLimitMb( - java.lang.Iterable values) { - ensureMemoryLimitMbIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, memoryLimitMb_); - onChanged(); - return this; - } - /** - *
    -         * Per "virtual" device memory limit, in MB. The number of elements in
    -         * the list is the number of virtual devices to create on the
    -         * corresponding visible GPU (see "virtual_devices" below).
    -         * If empty, it will create single virtual device taking all available
    -         * memory from the device.
    -         * For the concept of "visible" and "virtual" GPU, see the comments for
    -         * "visible_device_list" above for more information.
    -         * 
    - * - * repeated float memory_limit_mb = 1; - */ - public Builder clearMemoryLimitMb() { - memoryLimitMb_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList priority_ = emptyIntList(); - private void ensurePriorityIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - priority_ = mutableCopy(priority_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public java.util.List - getPriorityList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(priority_) : priority_; - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public int getPriorityCount() { - return priority_.size(); - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public int getPriority(int index) { - return priority_.getInt(index); - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public Builder setPriority( - int index, int value) { - ensurePriorityIsMutable(); - priority_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public Builder addPriority(int value) { - ensurePriorityIsMutable(); - priority_.addInt(value); - onChanged(); - return this; - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public Builder addAllPriority( - java.lang.Iterable values) { - ensurePriorityIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, priority_); - onChanged(); - return this; - } - /** - *
    -         * Priority values to use with the virtual devices. Use the cuda function
    -         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    -         * priority.
    -         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    -         * least priority and -1 for greatest priority.
    -         * If this field is not specified, then the virtual devices will be
    -         * created with the default. If this field has values set, then the size
    -         * of this must match with the above memory_limit_mb.
    -         * 
    - * - * repeated int32 priority = 2; - */ - public Builder clearPriority() { - priority_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - 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.GPUOptions.Experimental.VirtualDevices) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions.Experimental.VirtualDevices) - private static final org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices(); - } - - public static org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VirtualDevices parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VirtualDevices(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.GPUOptions.Experimental.VirtualDevices getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int VIRTUAL_DEVICES_FIELD_NUMBER = 1; - private java.util.List virtualDevices_; - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public java.util.List getVirtualDevicesList() { - return virtualDevices_; - } - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public java.util.List - getVirtualDevicesOrBuilderList() { - return virtualDevices_; - } - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public int getVirtualDevicesCount() { - return virtualDevices_.size(); - } - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index) { - return virtualDevices_.get(index); - } - /** - *
    -     * The multi virtual device settings. If empty (not set), it will create
    -     * single virtual device on each visible GPU, according to the settings
    -     * in "visible_device_list" above. Otherwise, the number of elements in the
    -     * list must be the same as the number of visible GPUs (after
    -     * "visible_device_list" filtering if it is set), and the string represented
    -     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -     * devices and have the <id> field assigned sequentially starting from 0,
    -     * according to the order they appear in this list and the "memory_limit"
    -     * list inside each element. For example,
    -     *   visible_device_list = "1,0"
    -     *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -     *   virtual_devices {}
    -     * will create three virtual devices as:
    -     *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -     *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -     *   /device:GPU:2 -> visible GPU 0 with all available memory
    -     * NOTE:
    -     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -     *    at the same time.
    -     * 2. Currently this setting is per-process, not per-session. Using
    -     *    different settings in different sessions within same process will
    -     *    result in undefined behavior.
    -     * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( - int index) { - return virtualDevices_.get(index); - } - - public static final int USE_UNIFIED_MEMORY_FIELD_NUMBER = 2; - private boolean useUnifiedMemory_; - /** - *
    -     * If true, uses CUDA unified memory for memory allocations. If
    -     * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    -     * memory is used regardless of the value for this field. See comments for
    -     * per_process_gpu_memory_fraction field for more details and requirements
    -     * of the unified memory. This option is useful to oversubscribe memory if
    -     * multiple processes are sharing a single GPU while individually using less
    -     * than 1.0 per process memory fraction.
    -     * 
    - * - * bool use_unified_memory = 2; - */ - public boolean getUseUnifiedMemory() { - return useUnifiedMemory_; - } - - public static final int NUM_DEV_TO_DEV_COPY_STREAMS_FIELD_NUMBER = 3; - private int numDevToDevCopyStreams_; - /** - *
    -     * If > 1, the number of device-to-device copy streams to create
    -     * for each GPUDevice.  Default value is 0, which is automatically
    -     * converted to 1.
    -     * 
    - * - * int32 num_dev_to_dev_copy_streams = 3; - */ - public int getNumDevToDevCopyStreams() { - return numDevToDevCopyStreams_; - } - - public static final int COLLECTIVE_RING_ORDER_FIELD_NUMBER = 4; - private volatile java.lang.Object collectiveRingOrder_; - /** - *
    -     * If non-empty, defines a good GPU ring order on a single worker based on
    -     * device interconnect.  This assumes that all workers have the same GPU
    -     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -     * This ring order is used by the RingReducer implementation of
    -     * CollectiveReduce, and serves as an override to automatic ring order
    -     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -     * 
    - * - * string collective_ring_order = 4; - */ - public java.lang.String getCollectiveRingOrder() { - java.lang.Object ref = collectiveRingOrder_; - 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(); - collectiveRingOrder_ = s; - return s; - } - } - /** - *
    -     * If non-empty, defines a good GPU ring order on a single worker based on
    -     * device interconnect.  This assumes that all workers have the same GPU
    -     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -     * This ring order is used by the RingReducer implementation of
    -     * CollectiveReduce, and serves as an override to automatic ring order
    -     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -     * 
    - * - * string collective_ring_order = 4; - */ - public com.google.protobuf.ByteString - getCollectiveRingOrderBytes() { - java.lang.Object ref = collectiveRingOrder_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - collectiveRingOrder_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMPED_ALLOCATOR_FIELD_NUMBER = 5; - private boolean timestampedAllocator_; - /** - *
    -     * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    -     * keep track of when GPU memory is freed and when kernels actually
    -     * complete so that we can know when a nominally free memory chunk
    -     * is really not subject to pending use.
    -     * 
    - * - * bool timestamped_allocator = 5; - */ - public boolean getTimestampedAllocator() { - return timestampedAllocator_; - } - - public static final int KERNEL_TRACKER_MAX_INTERVAL_FIELD_NUMBER = 7; - private int kernelTrackerMaxInterval_; - /** - *
    -     * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    -     * Note that timestamped_allocator is only effective if some tracking is
    -     * specified.
    -     * If kernel_tracker_max_interval = n > 0, then a tracking event
    -     * is inserted after every n kernels without an event.
    -     * 
    - * - * int32 kernel_tracker_max_interval = 7; - */ - public int getKernelTrackerMaxInterval() { - return kernelTrackerMaxInterval_; - } - - public static final int KERNEL_TRACKER_MAX_BYTES_FIELD_NUMBER = 8; - private int kernelTrackerMaxBytes_; - /** - *
    -     * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    -     * inserted after every series of kernels allocating a sum of
    -     * memory >= n.  If one kernel allocates b * n bytes, then one
    -     * event will be inserted after it, but it will count as b against
    -     * the pending limit.
    -     * 
    - * - * int32 kernel_tracker_max_bytes = 8; - */ - public int getKernelTrackerMaxBytes() { - return kernelTrackerMaxBytes_; - } - - public static final int KERNEL_TRACKER_MAX_PENDING_FIELD_NUMBER = 9; - private int kernelTrackerMaxPending_; - /** - *
    -     * If kernel_tracker_max_pending > 0 then no more than this many
    -     * tracking events can be outstanding at a time.  An attempt to
    -     * launch an additional kernel will stall until an event
    -     * completes.
    -     * 
    - * - * int32 kernel_tracker_max_pending = 9; - */ - public int getKernelTrackerMaxPending() { - return kernelTrackerMaxPending_; - } - - public static final int INTERNAL_FRAGMENTATION_FRACTION_FIELD_NUMBER = 10; - private double internalFragmentationFraction_; - /** - *
    -     * BFC Allocator can return an allocated chunk of memory upto 2x the
    -     * requested size. For virtual devices with tight memory constraints, and
    -     * proportionately large allocation requests, this can lead to a significant
    -     * reduction in available memory. The threshold below controls when a chunk
    -     * should be split if the chunk size exceeds requested memory size. It is
    -     * expressed as a fraction of total available memory for the tf device. For
    -     * example setting it to 0.05 would imply a chunk needs to be split if its
    -     * size exceeds the requested memory by 5% of the total virtual device/gpu
    -     * memory size.
    -     * 
    - * - * double internal_fragmentation_fraction = 10; - */ - public double getInternalFragmentationFraction() { - return internalFragmentationFraction_; - } - - public static final int USE_CUDA_MALLOC_ASYNC_FIELD_NUMBER = 11; - private boolean useCudaMallocAsync_; - /** - *
    -     * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    -     * 
    - * - * bool use_cuda_malloc_async = 11; - */ - public boolean getUseCudaMallocAsync() { - return useCudaMallocAsync_; - } - - 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 { - for (int i = 0; i < virtualDevices_.size(); i++) { - output.writeMessage(1, virtualDevices_.get(i)); - } - if (useUnifiedMemory_ != false) { - output.writeBool(2, useUnifiedMemory_); - } - if (numDevToDevCopyStreams_ != 0) { - output.writeInt32(3, numDevToDevCopyStreams_); - } - if (!getCollectiveRingOrderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, collectiveRingOrder_); - } - if (timestampedAllocator_ != false) { - output.writeBool(5, timestampedAllocator_); - } - if (kernelTrackerMaxInterval_ != 0) { - output.writeInt32(7, kernelTrackerMaxInterval_); - } - if (kernelTrackerMaxBytes_ != 0) { - output.writeInt32(8, kernelTrackerMaxBytes_); - } - if (kernelTrackerMaxPending_ != 0) { - output.writeInt32(9, kernelTrackerMaxPending_); - } - if (internalFragmentationFraction_ != 0D) { - output.writeDouble(10, internalFragmentationFraction_); - } - if (useCudaMallocAsync_ != false) { - output.writeBool(11, useCudaMallocAsync_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < virtualDevices_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, virtualDevices_.get(i)); - } - if (useUnifiedMemory_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, useUnifiedMemory_); - } - if (numDevToDevCopyStreams_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, numDevToDevCopyStreams_); - } - if (!getCollectiveRingOrderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, collectiveRingOrder_); - } - if (timestampedAllocator_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, timestampedAllocator_); - } - if (kernelTrackerMaxInterval_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, kernelTrackerMaxInterval_); - } - if (kernelTrackerMaxBytes_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, kernelTrackerMaxBytes_); - } - if (kernelTrackerMaxPending_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(9, kernelTrackerMaxPending_); - } - if (internalFragmentationFraction_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(10, internalFragmentationFraction_); - } - if (useCudaMallocAsync_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(11, useCudaMallocAsync_); - } - 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.GPUOptions.Experimental)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GPUOptions.Experimental other = (org.tensorflow.proto.framework.GPUOptions.Experimental) obj; - - if (!getVirtualDevicesList() - .equals(other.getVirtualDevicesList())) return false; - if (getUseUnifiedMemory() - != other.getUseUnifiedMemory()) return false; - if (getNumDevToDevCopyStreams() - != other.getNumDevToDevCopyStreams()) return false; - if (!getCollectiveRingOrder() - .equals(other.getCollectiveRingOrder())) return false; - if (getTimestampedAllocator() - != other.getTimestampedAllocator()) return false; - if (getKernelTrackerMaxInterval() - != other.getKernelTrackerMaxInterval()) return false; - if (getKernelTrackerMaxBytes() - != other.getKernelTrackerMaxBytes()) return false; - if (getKernelTrackerMaxPending() - != other.getKernelTrackerMaxPending()) return false; - if (java.lang.Double.doubleToLongBits(getInternalFragmentationFraction()) - != java.lang.Double.doubleToLongBits( - other.getInternalFragmentationFraction())) return false; - if (getUseCudaMallocAsync() - != other.getUseCudaMallocAsync()) 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 (getVirtualDevicesCount() > 0) { - hash = (37 * hash) + VIRTUAL_DEVICES_FIELD_NUMBER; - hash = (53 * hash) + getVirtualDevicesList().hashCode(); - } - hash = (37 * hash) + USE_UNIFIED_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseUnifiedMemory()); - hash = (37 * hash) + NUM_DEV_TO_DEV_COPY_STREAMS_FIELD_NUMBER; - hash = (53 * hash) + getNumDevToDevCopyStreams(); - hash = (37 * hash) + COLLECTIVE_RING_ORDER_FIELD_NUMBER; - hash = (53 * hash) + getCollectiveRingOrder().hashCode(); - hash = (37 * hash) + TIMESTAMPED_ALLOCATOR_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTimestampedAllocator()); - hash = (37 * hash) + KERNEL_TRACKER_MAX_INTERVAL_FIELD_NUMBER; - hash = (53 * hash) + getKernelTrackerMaxInterval(); - hash = (37 * hash) + KERNEL_TRACKER_MAX_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getKernelTrackerMaxBytes(); - hash = (37 * hash) + KERNEL_TRACKER_MAX_PENDING_FIELD_NUMBER; - hash = (53 * hash) + getKernelTrackerMaxPending(); - hash = (37 * hash) + INTERNAL_FRAGMENTATION_FRACTION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getInternalFragmentationFraction())); - hash = (37 * hash) + USE_CUDA_MALLOC_ASYNC_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseCudaMallocAsync()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GPUOptions.Experimental parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental 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.GPUOptions.Experimental parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental 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.GPUOptions.Experimental parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental 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.GPUOptions.Experimental parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental 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.GPUOptions.Experimental parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions.Experimental 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.GPUOptions.Experimental 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.GPUOptions.Experimental} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions.Experimental) - org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.Experimental.class, org.tensorflow.proto.framework.GPUOptions.Experimental.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GPUOptions.Experimental.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getVirtualDevicesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (virtualDevicesBuilder_ == null) { - virtualDevices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - virtualDevicesBuilder_.clear(); - } - useUnifiedMemory_ = false; - - numDevToDevCopyStreams_ = 0; - - collectiveRingOrder_ = ""; - - timestampedAllocator_ = false; - - kernelTrackerMaxInterval_ = 0; - - kernelTrackerMaxBytes_ = 0; - - kernelTrackerMaxPending_ = 0; - - internalFragmentationFraction_ = 0D; - - useCudaMallocAsync_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GPUOptions.Experimental.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental build() { - org.tensorflow.proto.framework.GPUOptions.Experimental result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions.Experimental buildPartial() { - org.tensorflow.proto.framework.GPUOptions.Experimental result = new org.tensorflow.proto.framework.GPUOptions.Experimental(this); - int from_bitField0_ = bitField0_; - if (virtualDevicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - virtualDevices_ = java.util.Collections.unmodifiableList(virtualDevices_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.virtualDevices_ = virtualDevices_; - } else { - result.virtualDevices_ = virtualDevicesBuilder_.build(); - } - result.useUnifiedMemory_ = useUnifiedMemory_; - result.numDevToDevCopyStreams_ = numDevToDevCopyStreams_; - result.collectiveRingOrder_ = collectiveRingOrder_; - result.timestampedAllocator_ = timestampedAllocator_; - result.kernelTrackerMaxInterval_ = kernelTrackerMaxInterval_; - result.kernelTrackerMaxBytes_ = kernelTrackerMaxBytes_; - result.kernelTrackerMaxPending_ = kernelTrackerMaxPending_; - result.internalFragmentationFraction_ = internalFragmentationFraction_; - result.useCudaMallocAsync_ = useCudaMallocAsync_; - 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.GPUOptions.Experimental) { - return mergeFrom((org.tensorflow.proto.framework.GPUOptions.Experimental)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GPUOptions.Experimental other) { - if (other == org.tensorflow.proto.framework.GPUOptions.Experimental.getDefaultInstance()) return this; - if (virtualDevicesBuilder_ == null) { - if (!other.virtualDevices_.isEmpty()) { - if (virtualDevices_.isEmpty()) { - virtualDevices_ = other.virtualDevices_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureVirtualDevicesIsMutable(); - virtualDevices_.addAll(other.virtualDevices_); - } - onChanged(); - } - } else { - if (!other.virtualDevices_.isEmpty()) { - if (virtualDevicesBuilder_.isEmpty()) { - virtualDevicesBuilder_.dispose(); - virtualDevicesBuilder_ = null; - virtualDevices_ = other.virtualDevices_; - bitField0_ = (bitField0_ & ~0x00000001); - virtualDevicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getVirtualDevicesFieldBuilder() : null; - } else { - virtualDevicesBuilder_.addAllMessages(other.virtualDevices_); - } - } - } - if (other.getUseUnifiedMemory() != false) { - setUseUnifiedMemory(other.getUseUnifiedMemory()); - } - if (other.getNumDevToDevCopyStreams() != 0) { - setNumDevToDevCopyStreams(other.getNumDevToDevCopyStreams()); - } - if (!other.getCollectiveRingOrder().isEmpty()) { - collectiveRingOrder_ = other.collectiveRingOrder_; - onChanged(); - } - if (other.getTimestampedAllocator() != false) { - setTimestampedAllocator(other.getTimestampedAllocator()); - } - if (other.getKernelTrackerMaxInterval() != 0) { - setKernelTrackerMaxInterval(other.getKernelTrackerMaxInterval()); - } - if (other.getKernelTrackerMaxBytes() != 0) { - setKernelTrackerMaxBytes(other.getKernelTrackerMaxBytes()); - } - if (other.getKernelTrackerMaxPending() != 0) { - setKernelTrackerMaxPending(other.getKernelTrackerMaxPending()); - } - if (other.getInternalFragmentationFraction() != 0D) { - setInternalFragmentationFraction(other.getInternalFragmentationFraction()); - } - if (other.getUseCudaMallocAsync() != false) { - setUseCudaMallocAsync(other.getUseCudaMallocAsync()); - } - 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.GPUOptions.Experimental parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GPUOptions.Experimental) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List virtualDevices_ = - java.util.Collections.emptyList(); - private void ensureVirtualDevicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - virtualDevices_ = new java.util.ArrayList(virtualDevices_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder> virtualDevicesBuilder_; - - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public java.util.List getVirtualDevicesList() { - if (virtualDevicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(virtualDevices_); - } else { - return virtualDevicesBuilder_.getMessageList(); - } - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public int getVirtualDevicesCount() { - if (virtualDevicesBuilder_ == null) { - return virtualDevices_.size(); - } else { - return virtualDevicesBuilder_.getCount(); - } - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index) { - if (virtualDevicesBuilder_ == null) { - return virtualDevices_.get(index); - } else { - return virtualDevicesBuilder_.getMessage(index); - } - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder setVirtualDevices( - int index, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices value) { - if (virtualDevicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVirtualDevicesIsMutable(); - virtualDevices_.set(index, value); - onChanged(); - } else { - virtualDevicesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder setVirtualDevices( - int index, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { - if (virtualDevicesBuilder_ == null) { - ensureVirtualDevicesIsMutable(); - virtualDevices_.set(index, builderForValue.build()); - onChanged(); - } else { - virtualDevicesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder addVirtualDevices(org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices value) { - if (virtualDevicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVirtualDevicesIsMutable(); - virtualDevices_.add(value); - onChanged(); - } else { - virtualDevicesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder addVirtualDevices( - int index, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices value) { - if (virtualDevicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVirtualDevicesIsMutable(); - virtualDevices_.add(index, value); - onChanged(); - } else { - virtualDevicesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder addVirtualDevices( - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { - if (virtualDevicesBuilder_ == null) { - ensureVirtualDevicesIsMutable(); - virtualDevices_.add(builderForValue.build()); - onChanged(); - } else { - virtualDevicesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder addVirtualDevices( - int index, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { - if (virtualDevicesBuilder_ == null) { - ensureVirtualDevicesIsMutable(); - virtualDevices_.add(index, builderForValue.build()); - onChanged(); - } else { - virtualDevicesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder addAllVirtualDevices( - java.lang.Iterable values) { - if (virtualDevicesBuilder_ == null) { - ensureVirtualDevicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, virtualDevices_); - onChanged(); - } else { - virtualDevicesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder clearVirtualDevices() { - if (virtualDevicesBuilder_ == null) { - virtualDevices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - virtualDevicesBuilder_.clear(); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public Builder removeVirtualDevices(int index) { - if (virtualDevicesBuilder_ == null) { - ensureVirtualDevicesIsMutable(); - virtualDevices_.remove(index); - onChanged(); - } else { - virtualDevicesBuilder_.remove(index); - } - return this; - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder getVirtualDevicesBuilder( - int index) { - return getVirtualDevicesFieldBuilder().getBuilder(index); - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( - int index) { - if (virtualDevicesBuilder_ == null) { - return virtualDevices_.get(index); } else { - return virtualDevicesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public java.util.List - getVirtualDevicesOrBuilderList() { - if (virtualDevicesBuilder_ != null) { - return virtualDevicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(virtualDevices_); - } - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder addVirtualDevicesBuilder() { - return getVirtualDevicesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()); - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder addVirtualDevicesBuilder( - int index) { - return getVirtualDevicesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()); - } - /** - *
    -       * The multi virtual device settings. If empty (not set), it will create
    -       * single virtual device on each visible GPU, according to the settings
    -       * in "visible_device_list" above. Otherwise, the number of elements in the
    -       * list must be the same as the number of visible GPUs (after
    -       * "visible_device_list" filtering if it is set), and the string represented
    -       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    -       * devices and have the <id> field assigned sequentially starting from 0,
    -       * according to the order they appear in this list and the "memory_limit"
    -       * list inside each element. For example,
    -       *   visible_device_list = "1,0"
    -       *   virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    -       *   virtual_devices {}
    -       * will create three virtual devices as:
    -       *   /device:GPU:0 -> visible GPU 1 with 1GB memory
    -       *   /device:GPU:1 -> visible GPU 1 with 2GB memory
    -       *   /device:GPU:2 -> visible GPU 0 with all available memory
    -       * NOTE:
    -       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    -       *    at the same time.
    -       * 2. Currently this setting is per-process, not per-session. Using
    -       *    different settings in different sessions within same process will
    -       *    result in undefined behavior.
    -       * 
    - * - * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; - */ - public java.util.List - getVirtualDevicesBuilderList() { - return getVirtualDevicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder> - getVirtualDevicesFieldBuilder() { - if (virtualDevicesBuilder_ == null) { - virtualDevicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.framework.GPUOptions.Experimental.VirtualDevicesOrBuilder>( - virtualDevices_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - virtualDevices_ = null; - } - return virtualDevicesBuilder_; - } - - private boolean useUnifiedMemory_ ; - /** - *
    -       * If true, uses CUDA unified memory for memory allocations. If
    -       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    -       * memory is used regardless of the value for this field. See comments for
    -       * per_process_gpu_memory_fraction field for more details and requirements
    -       * of the unified memory. This option is useful to oversubscribe memory if
    -       * multiple processes are sharing a single GPU while individually using less
    -       * than 1.0 per process memory fraction.
    -       * 
    - * - * bool use_unified_memory = 2; - */ - public boolean getUseUnifiedMemory() { - return useUnifiedMemory_; - } - /** - *
    -       * If true, uses CUDA unified memory for memory allocations. If
    -       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    -       * memory is used regardless of the value for this field. See comments for
    -       * per_process_gpu_memory_fraction field for more details and requirements
    -       * of the unified memory. This option is useful to oversubscribe memory if
    -       * multiple processes are sharing a single GPU while individually using less
    -       * than 1.0 per process memory fraction.
    -       * 
    - * - * bool use_unified_memory = 2; - */ - public Builder setUseUnifiedMemory(boolean value) { - - useUnifiedMemory_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, uses CUDA unified memory for memory allocations. If
    -       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    -       * memory is used regardless of the value for this field. See comments for
    -       * per_process_gpu_memory_fraction field for more details and requirements
    -       * of the unified memory. This option is useful to oversubscribe memory if
    -       * multiple processes are sharing a single GPU while individually using less
    -       * than 1.0 per process memory fraction.
    -       * 
    - * - * bool use_unified_memory = 2; - */ - public Builder clearUseUnifiedMemory() { - - useUnifiedMemory_ = false; - onChanged(); - return this; - } - - private int numDevToDevCopyStreams_ ; - /** - *
    -       * If > 1, the number of device-to-device copy streams to create
    -       * for each GPUDevice.  Default value is 0, which is automatically
    -       * converted to 1.
    -       * 
    - * - * int32 num_dev_to_dev_copy_streams = 3; - */ - public int getNumDevToDevCopyStreams() { - return numDevToDevCopyStreams_; - } - /** - *
    -       * If > 1, the number of device-to-device copy streams to create
    -       * for each GPUDevice.  Default value is 0, which is automatically
    -       * converted to 1.
    -       * 
    - * - * int32 num_dev_to_dev_copy_streams = 3; - */ - public Builder setNumDevToDevCopyStreams(int value) { - - numDevToDevCopyStreams_ = value; - onChanged(); - return this; - } - /** - *
    -       * If > 1, the number of device-to-device copy streams to create
    -       * for each GPUDevice.  Default value is 0, which is automatically
    -       * converted to 1.
    -       * 
    - * - * int32 num_dev_to_dev_copy_streams = 3; - */ - public Builder clearNumDevToDevCopyStreams() { - - numDevToDevCopyStreams_ = 0; - onChanged(); - return this; - } - - private java.lang.Object collectiveRingOrder_ = ""; - /** - *
    -       * If non-empty, defines a good GPU ring order on a single worker based on
    -       * device interconnect.  This assumes that all workers have the same GPU
    -       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -       * This ring order is used by the RingReducer implementation of
    -       * CollectiveReduce, and serves as an override to automatic ring order
    -       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -       * 
    - * - * string collective_ring_order = 4; - */ - public java.lang.String getCollectiveRingOrder() { - java.lang.Object ref = collectiveRingOrder_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - collectiveRingOrder_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * If non-empty, defines a good GPU ring order on a single worker based on
    -       * device interconnect.  This assumes that all workers have the same GPU
    -       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -       * This ring order is used by the RingReducer implementation of
    -       * CollectiveReduce, and serves as an override to automatic ring order
    -       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -       * 
    - * - * string collective_ring_order = 4; - */ - public com.google.protobuf.ByteString - getCollectiveRingOrderBytes() { - java.lang.Object ref = collectiveRingOrder_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - collectiveRingOrder_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * If non-empty, defines a good GPU ring order on a single worker based on
    -       * device interconnect.  This assumes that all workers have the same GPU
    -       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -       * This ring order is used by the RingReducer implementation of
    -       * CollectiveReduce, and serves as an override to automatic ring order
    -       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -       * 
    - * - * string collective_ring_order = 4; - */ - public Builder setCollectiveRingOrder( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - collectiveRingOrder_ = value; - onChanged(); - return this; - } - /** - *
    -       * If non-empty, defines a good GPU ring order on a single worker based on
    -       * device interconnect.  This assumes that all workers have the same GPU
    -       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -       * This ring order is used by the RingReducer implementation of
    -       * CollectiveReduce, and serves as an override to automatic ring order
    -       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -       * 
    - * - * string collective_ring_order = 4; - */ - public Builder clearCollectiveRingOrder() { - - collectiveRingOrder_ = getDefaultInstance().getCollectiveRingOrder(); - onChanged(); - return this; - } - /** - *
    -       * If non-empty, defines a good GPU ring order on a single worker based on
    -       * device interconnect.  This assumes that all workers have the same GPU
    -       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    -       * This ring order is used by the RingReducer implementation of
    -       * CollectiveReduce, and serves as an override to automatic ring order
    -       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    -       * 
    - * - * string collective_ring_order = 4; - */ - public Builder setCollectiveRingOrderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - collectiveRingOrder_ = value; - onChanged(); - return this; - } - - private boolean timestampedAllocator_ ; - /** - *
    -       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    -       * keep track of when GPU memory is freed and when kernels actually
    -       * complete so that we can know when a nominally free memory chunk
    -       * is really not subject to pending use.
    -       * 
    - * - * bool timestamped_allocator = 5; - */ - public boolean getTimestampedAllocator() { - return timestampedAllocator_; - } - /** - *
    -       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    -       * keep track of when GPU memory is freed and when kernels actually
    -       * complete so that we can know when a nominally free memory chunk
    -       * is really not subject to pending use.
    -       * 
    - * - * bool timestamped_allocator = 5; - */ - public Builder setTimestampedAllocator(boolean value) { - - timestampedAllocator_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    -       * keep track of when GPU memory is freed and when kernels actually
    -       * complete so that we can know when a nominally free memory chunk
    -       * is really not subject to pending use.
    -       * 
    - * - * bool timestamped_allocator = 5; - */ - public Builder clearTimestampedAllocator() { - - timestampedAllocator_ = false; - onChanged(); - return this; - } - - private int kernelTrackerMaxInterval_ ; - /** - *
    -       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    -       * Note that timestamped_allocator is only effective if some tracking is
    -       * specified.
    -       * If kernel_tracker_max_interval = n > 0, then a tracking event
    -       * is inserted after every n kernels without an event.
    -       * 
    - * - * int32 kernel_tracker_max_interval = 7; - */ - public int getKernelTrackerMaxInterval() { - return kernelTrackerMaxInterval_; - } - /** - *
    -       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    -       * Note that timestamped_allocator is only effective if some tracking is
    -       * specified.
    -       * If kernel_tracker_max_interval = n > 0, then a tracking event
    -       * is inserted after every n kernels without an event.
    -       * 
    - * - * int32 kernel_tracker_max_interval = 7; - */ - public Builder setKernelTrackerMaxInterval(int value) { - - kernelTrackerMaxInterval_ = value; - onChanged(); - return this; - } - /** - *
    -       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    -       * Note that timestamped_allocator is only effective if some tracking is
    -       * specified.
    -       * If kernel_tracker_max_interval = n > 0, then a tracking event
    -       * is inserted after every n kernels without an event.
    -       * 
    - * - * int32 kernel_tracker_max_interval = 7; - */ - public Builder clearKernelTrackerMaxInterval() { - - kernelTrackerMaxInterval_ = 0; - onChanged(); - return this; - } - - private int kernelTrackerMaxBytes_ ; - /** - *
    -       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    -       * inserted after every series of kernels allocating a sum of
    -       * memory >= n.  If one kernel allocates b * n bytes, then one
    -       * event will be inserted after it, but it will count as b against
    -       * the pending limit.
    -       * 
    - * - * int32 kernel_tracker_max_bytes = 8; - */ - public int getKernelTrackerMaxBytes() { - return kernelTrackerMaxBytes_; - } - /** - *
    -       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    -       * inserted after every series of kernels allocating a sum of
    -       * memory >= n.  If one kernel allocates b * n bytes, then one
    -       * event will be inserted after it, but it will count as b against
    -       * the pending limit.
    -       * 
    - * - * int32 kernel_tracker_max_bytes = 8; - */ - public Builder setKernelTrackerMaxBytes(int value) { - - kernelTrackerMaxBytes_ = value; - onChanged(); - return this; - } - /** - *
    -       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    -       * inserted after every series of kernels allocating a sum of
    -       * memory >= n.  If one kernel allocates b * n bytes, then one
    -       * event will be inserted after it, but it will count as b against
    -       * the pending limit.
    -       * 
    - * - * int32 kernel_tracker_max_bytes = 8; - */ - public Builder clearKernelTrackerMaxBytes() { - - kernelTrackerMaxBytes_ = 0; - onChanged(); - return this; - } - - private int kernelTrackerMaxPending_ ; - /** - *
    -       * If kernel_tracker_max_pending > 0 then no more than this many
    -       * tracking events can be outstanding at a time.  An attempt to
    -       * launch an additional kernel will stall until an event
    -       * completes.
    -       * 
    - * - * int32 kernel_tracker_max_pending = 9; - */ - public int getKernelTrackerMaxPending() { - return kernelTrackerMaxPending_; - } - /** - *
    -       * If kernel_tracker_max_pending > 0 then no more than this many
    -       * tracking events can be outstanding at a time.  An attempt to
    -       * launch an additional kernel will stall until an event
    -       * completes.
    -       * 
    - * - * int32 kernel_tracker_max_pending = 9; - */ - public Builder setKernelTrackerMaxPending(int value) { - - kernelTrackerMaxPending_ = value; - onChanged(); - return this; - } - /** - *
    -       * If kernel_tracker_max_pending > 0 then no more than this many
    -       * tracking events can be outstanding at a time.  An attempt to
    -       * launch an additional kernel will stall until an event
    -       * completes.
    -       * 
    - * - * int32 kernel_tracker_max_pending = 9; - */ - public Builder clearKernelTrackerMaxPending() { - - kernelTrackerMaxPending_ = 0; - onChanged(); - return this; - } - - private double internalFragmentationFraction_ ; - /** - *
    -       * BFC Allocator can return an allocated chunk of memory upto 2x the
    -       * requested size. For virtual devices with tight memory constraints, and
    -       * proportionately large allocation requests, this can lead to a significant
    -       * reduction in available memory. The threshold below controls when a chunk
    -       * should be split if the chunk size exceeds requested memory size. It is
    -       * expressed as a fraction of total available memory for the tf device. For
    -       * example setting it to 0.05 would imply a chunk needs to be split if its
    -       * size exceeds the requested memory by 5% of the total virtual device/gpu
    -       * memory size.
    -       * 
    - * - * double internal_fragmentation_fraction = 10; - */ - public double getInternalFragmentationFraction() { - return internalFragmentationFraction_; - } - /** - *
    -       * BFC Allocator can return an allocated chunk of memory upto 2x the
    -       * requested size. For virtual devices with tight memory constraints, and
    -       * proportionately large allocation requests, this can lead to a significant
    -       * reduction in available memory. The threshold below controls when a chunk
    -       * should be split if the chunk size exceeds requested memory size. It is
    -       * expressed as a fraction of total available memory for the tf device. For
    -       * example setting it to 0.05 would imply a chunk needs to be split if its
    -       * size exceeds the requested memory by 5% of the total virtual device/gpu
    -       * memory size.
    -       * 
    - * - * double internal_fragmentation_fraction = 10; - */ - public Builder setInternalFragmentationFraction(double value) { - - internalFragmentationFraction_ = value; - onChanged(); - return this; - } - /** - *
    -       * BFC Allocator can return an allocated chunk of memory upto 2x the
    -       * requested size. For virtual devices with tight memory constraints, and
    -       * proportionately large allocation requests, this can lead to a significant
    -       * reduction in available memory. The threshold below controls when a chunk
    -       * should be split if the chunk size exceeds requested memory size. It is
    -       * expressed as a fraction of total available memory for the tf device. For
    -       * example setting it to 0.05 would imply a chunk needs to be split if its
    -       * size exceeds the requested memory by 5% of the total virtual device/gpu
    -       * memory size.
    -       * 
    - * - * double internal_fragmentation_fraction = 10; - */ - public Builder clearInternalFragmentationFraction() { - - internalFragmentationFraction_ = 0D; - onChanged(); - return this; - } - - private boolean useCudaMallocAsync_ ; - /** - *
    -       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    -       * 
    - * - * bool use_cuda_malloc_async = 11; - */ - public boolean getUseCudaMallocAsync() { - return useCudaMallocAsync_; - } - /** - *
    -       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    -       * 
    - * - * bool use_cuda_malloc_async = 11; - */ - public Builder setUseCudaMallocAsync(boolean value) { - - useCudaMallocAsync_ = value; - onChanged(); - return this; - } - /** - *
    -       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    -       * 
    - * - * bool use_cuda_malloc_async = 11; - */ - public Builder clearUseCudaMallocAsync() { - - useCudaMallocAsync_ = false; - 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.GPUOptions.Experimental) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions.Experimental) - private static final org.tensorflow.proto.framework.GPUOptions.Experimental DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GPUOptions.Experimental(); - } - - public static org.tensorflow.proto.framework.GPUOptions.Experimental getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Experimental parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Experimental(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.GPUOptions.Experimental getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int PER_PROCESS_GPU_MEMORY_FRACTION_FIELD_NUMBER = 1; - private double perProcessGpuMemoryFraction_; - /** - *
    -   * Fraction of the available GPU memory to allocate for each process.
    -   * 1 means to allocate all of the GPU memory, 0.5 means the process
    -   * allocates up to ~50% of the available GPU memory.
    -   * GPU memory is pre-allocated unless the allow_growth option is enabled.
    -   * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    -   * the amount of memory available on the GPU device by using host memory as a
    -   * swap space. Accessing memory not available on the device will be
    -   * significantly slower as that would require memory transfer between the host
    -   * and the device. Options to reduce the memory requirement should be
    -   * considered before enabling this option as this may come with a negative
    -   * performance impact. Oversubscription using the unified memory requires
    -   * Pascal class or newer GPUs and it is currently only supported on the Linux
    -   * operating system. See
    -   * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    -   * for the detailed requirements.
    -   * 
    - * - * double per_process_gpu_memory_fraction = 1; - */ - public double getPerProcessGpuMemoryFraction() { - return perProcessGpuMemoryFraction_; - } - - public static final int ALLOW_GROWTH_FIELD_NUMBER = 4; - private boolean allowGrowth_; - /** - *
    -   * If true, the allocator does not pre-allocate the entire specified
    -   * GPU memory region, instead starting small and growing as needed.
    -   * 
    - * - * bool allow_growth = 4; - */ - public boolean getAllowGrowth() { - return allowGrowth_; - } - - public static final int ALLOCATOR_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object allocatorType_; - /** - *
    -   * The type of GPU allocation strategy to use.
    -   * Allowed values:
    -   * "": The empty string (default) uses a system-chosen default
    -   *     which may change over time.
    -   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -   *        version of dlmalloc.
    -   * 
    - * - * string allocator_type = 2; - */ - public java.lang.String getAllocatorType() { - java.lang.Object ref = allocatorType_; - 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(); - allocatorType_ = s; - return s; - } - } - /** - *
    -   * The type of GPU allocation strategy to use.
    -   * Allowed values:
    -   * "": The empty string (default) uses a system-chosen default
    -   *     which may change over time.
    -   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -   *        version of dlmalloc.
    -   * 
    - * - * string allocator_type = 2; - */ - public com.google.protobuf.ByteString - getAllocatorTypeBytes() { - java.lang.Object ref = allocatorType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFERRED_DELETION_BYTES_FIELD_NUMBER = 3; - private long deferredDeletionBytes_; - /** - *
    -   * Delay deletion of up to this many bytes to reduce the number of
    -   * interactions with gpu driver code.  If 0, the system chooses
    -   * a reasonable default (several MBs).
    -   * 
    - * - * int64 deferred_deletion_bytes = 3; - */ - public long getDeferredDeletionBytes() { - return deferredDeletionBytes_; - } - - public static final int VISIBLE_DEVICE_LIST_FIELD_NUMBER = 5; - private volatile java.lang.Object visibleDeviceList_; - /** - *
    -   * A comma-separated list of GPU ids that determines the 'visible'
    -   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -   * can see 8 GPU devices in the process, and one wanted to map
    -   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -   * then one would specify this field as "5,3".  This field is similar in
    -   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -   * it applies to the visible GPU devices in the process.
    -   * NOTE:
    -   * 1. The GPU driver provides the process with the visible GPUs
    -   *    in an order which is not guaranteed to have any correlation to
    -   *    the *physical* GPU id in the machine.  This field is used for
    -   *    remapping "visible" to "virtual", which means this operates only
    -   *    after the process starts.  Users are required to use vendor
    -   *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -   *    physical to visible device mapping prior to invoking TensorFlow.
    -   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -   *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -   *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -   *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -   *    for more information.
    -   * 
    - * - * string visible_device_list = 5; - */ - public java.lang.String getVisibleDeviceList() { - java.lang.Object ref = visibleDeviceList_; - 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(); - visibleDeviceList_ = s; - return s; - } - } - /** - *
    -   * A comma-separated list of GPU ids that determines the 'visible'
    -   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -   * can see 8 GPU devices in the process, and one wanted to map
    -   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -   * then one would specify this field as "5,3".  This field is similar in
    -   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -   * it applies to the visible GPU devices in the process.
    -   * NOTE:
    -   * 1. The GPU driver provides the process with the visible GPUs
    -   *    in an order which is not guaranteed to have any correlation to
    -   *    the *physical* GPU id in the machine.  This field is used for
    -   *    remapping "visible" to "virtual", which means this operates only
    -   *    after the process starts.  Users are required to use vendor
    -   *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -   *    physical to visible device mapping prior to invoking TensorFlow.
    -   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -   *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -   *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -   *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -   *    for more information.
    -   * 
    - * - * string visible_device_list = 5; - */ - public com.google.protobuf.ByteString - getVisibleDeviceListBytes() { - java.lang.Object ref = visibleDeviceList_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - visibleDeviceList_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POLLING_ACTIVE_DELAY_USECS_FIELD_NUMBER = 6; - private int pollingActiveDelayUsecs_; - /** - *
    -   * In the event polling loop sleep this many microseconds between
    -   * PollEvents calls, when the queue is not empty.  If value is not
    -   * set or set to 0, gets set to a non-zero default.
    -   * 
    - * - * int32 polling_active_delay_usecs = 6; - */ - public int getPollingActiveDelayUsecs() { - return pollingActiveDelayUsecs_; - } - - public static final int POLLING_INACTIVE_DELAY_MSECS_FIELD_NUMBER = 7; - private int pollingInactiveDelayMsecs_; - /** - *
    -   * This field is deprecated and ignored.
    -   * 
    - * - * int32 polling_inactive_delay_msecs = 7; - */ - public int getPollingInactiveDelayMsecs() { - return pollingInactiveDelayMsecs_; - } - - public static final int FORCE_GPU_COMPATIBLE_FIELD_NUMBER = 8; - private boolean forceGpuCompatible_; - /** - *
    -   * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    -   * enabling this option forces all CPU tensors to be allocated with Cuda
    -   * pinned memory. Normally, TensorFlow will infer which tensors should be
    -   * allocated as the pinned memory. But in case where the inference is
    -   * incomplete, this option can significantly speed up the cross-device memory
    -   * copy performance as long as it fits the memory.
    -   * Note that this option is not something that should be
    -   * enabled by default for unknown or very large models, since all Cuda pinned
    -   * memory is unpageable, having too much pinned memory might negatively impact
    -   * the overall host system performance.
    -   * 
    - * - * bool force_gpu_compatible = 8; - */ - public boolean getForceGpuCompatible() { - return forceGpuCompatible_; - } - - public static final int EXPERIMENTAL_FIELD_NUMBER = 9; - private org.tensorflow.proto.framework.GPUOptions.Experimental experimental_; - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public boolean hasExperimental() { - return experimental_ != null; - } - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental getExperimental() { - return experimental_ == null ? org.tensorflow.proto.framework.GPUOptions.Experimental.getDefaultInstance() : experimental_; - } - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { - return getExperimental(); - } - - 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 (perProcessGpuMemoryFraction_ != 0D) { - output.writeDouble(1, perProcessGpuMemoryFraction_); - } - if (!getAllocatorTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allocatorType_); - } - if (deferredDeletionBytes_ != 0L) { - output.writeInt64(3, deferredDeletionBytes_); - } - if (allowGrowth_ != false) { - output.writeBool(4, allowGrowth_); - } - if (!getVisibleDeviceListBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, visibleDeviceList_); - } - if (pollingActiveDelayUsecs_ != 0) { - output.writeInt32(6, pollingActiveDelayUsecs_); - } - if (pollingInactiveDelayMsecs_ != 0) { - output.writeInt32(7, pollingInactiveDelayMsecs_); - } - if (forceGpuCompatible_ != false) { - output.writeBool(8, forceGpuCompatible_); - } - if (experimental_ != null) { - output.writeMessage(9, getExperimental()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (perProcessGpuMemoryFraction_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, perProcessGpuMemoryFraction_); - } - if (!getAllocatorTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, allocatorType_); - } - if (deferredDeletionBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, deferredDeletionBytes_); - } - if (allowGrowth_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, allowGrowth_); - } - if (!getVisibleDeviceListBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, visibleDeviceList_); - } - if (pollingActiveDelayUsecs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, pollingActiveDelayUsecs_); - } - if (pollingInactiveDelayMsecs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, pollingInactiveDelayMsecs_); - } - if (forceGpuCompatible_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, forceGpuCompatible_); - } - if (experimental_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getExperimental()); - } - 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.GPUOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GPUOptions other = (org.tensorflow.proto.framework.GPUOptions) obj; - - if (java.lang.Double.doubleToLongBits(getPerProcessGpuMemoryFraction()) - != java.lang.Double.doubleToLongBits( - other.getPerProcessGpuMemoryFraction())) return false; - if (getAllowGrowth() - != other.getAllowGrowth()) return false; - if (!getAllocatorType() - .equals(other.getAllocatorType())) return false; - if (getDeferredDeletionBytes() - != other.getDeferredDeletionBytes()) return false; - if (!getVisibleDeviceList() - .equals(other.getVisibleDeviceList())) return false; - if (getPollingActiveDelayUsecs() - != other.getPollingActiveDelayUsecs()) return false; - if (getPollingInactiveDelayMsecs() - != other.getPollingInactiveDelayMsecs()) return false; - if (getForceGpuCompatible() - != other.getForceGpuCompatible()) return false; - if (hasExperimental() != other.hasExperimental()) return false; - if (hasExperimental()) { - if (!getExperimental() - .equals(other.getExperimental())) 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) + PER_PROCESS_GPU_MEMORY_FRACTION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getPerProcessGpuMemoryFraction())); - hash = (37 * hash) + ALLOW_GROWTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAllowGrowth()); - hash = (37 * hash) + ALLOCATOR_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorType().hashCode(); - hash = (37 * hash) + DEFERRED_DELETION_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDeferredDeletionBytes()); - hash = (37 * hash) + VISIBLE_DEVICE_LIST_FIELD_NUMBER; - hash = (53 * hash) + getVisibleDeviceList().hashCode(); - hash = (37 * hash) + POLLING_ACTIVE_DELAY_USECS_FIELD_NUMBER; - hash = (53 * hash) + getPollingActiveDelayUsecs(); - hash = (37 * hash) + POLLING_INACTIVE_DELAY_MSECS_FIELD_NUMBER; - hash = (53 * hash) + getPollingInactiveDelayMsecs(); - hash = (37 * hash) + FORCE_GPU_COMPATIBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getForceGpuCompatible()); - if (hasExperimental()) { - hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; - hash = (53 * hash) + getExperimental().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GPUOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions 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.GPUOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions 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.GPUOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GPUOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GPUOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions 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.GPUOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions 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.GPUOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GPUOptions 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.GPUOptions 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.GPUOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions) - org.tensorflow.proto.framework.GPUOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GPUOptions.class, org.tensorflow.proto.framework.GPUOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GPUOptions.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(); - perProcessGpuMemoryFraction_ = 0D; - - allowGrowth_ = false; - - allocatorType_ = ""; - - deferredDeletionBytes_ = 0L; - - visibleDeviceList_ = ""; - - pollingActiveDelayUsecs_ = 0; - - pollingInactiveDelayMsecs_ = 0; - - forceGpuCompatible_ = false; - - if (experimentalBuilder_ == null) { - experimental_ = null; - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GPUOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions build() { - org.tensorflow.proto.framework.GPUOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GPUOptions buildPartial() { - org.tensorflow.proto.framework.GPUOptions result = new org.tensorflow.proto.framework.GPUOptions(this); - result.perProcessGpuMemoryFraction_ = perProcessGpuMemoryFraction_; - result.allowGrowth_ = allowGrowth_; - result.allocatorType_ = allocatorType_; - result.deferredDeletionBytes_ = deferredDeletionBytes_; - result.visibleDeviceList_ = visibleDeviceList_; - result.pollingActiveDelayUsecs_ = pollingActiveDelayUsecs_; - result.pollingInactiveDelayMsecs_ = pollingInactiveDelayMsecs_; - result.forceGpuCompatible_ = forceGpuCompatible_; - if (experimentalBuilder_ == null) { - result.experimental_ = experimental_; - } else { - result.experimental_ = experimentalBuilder_.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.GPUOptions) { - return mergeFrom((org.tensorflow.proto.framework.GPUOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GPUOptions other) { - if (other == org.tensorflow.proto.framework.GPUOptions.getDefaultInstance()) return this; - if (other.getPerProcessGpuMemoryFraction() != 0D) { - setPerProcessGpuMemoryFraction(other.getPerProcessGpuMemoryFraction()); - } - if (other.getAllowGrowth() != false) { - setAllowGrowth(other.getAllowGrowth()); - } - if (!other.getAllocatorType().isEmpty()) { - allocatorType_ = other.allocatorType_; - onChanged(); - } - if (other.getDeferredDeletionBytes() != 0L) { - setDeferredDeletionBytes(other.getDeferredDeletionBytes()); - } - if (!other.getVisibleDeviceList().isEmpty()) { - visibleDeviceList_ = other.visibleDeviceList_; - onChanged(); - } - if (other.getPollingActiveDelayUsecs() != 0) { - setPollingActiveDelayUsecs(other.getPollingActiveDelayUsecs()); - } - if (other.getPollingInactiveDelayMsecs() != 0) { - setPollingInactiveDelayMsecs(other.getPollingInactiveDelayMsecs()); - } - if (other.getForceGpuCompatible() != false) { - setForceGpuCompatible(other.getForceGpuCompatible()); - } - if (other.hasExperimental()) { - mergeExperimental(other.getExperimental()); - } - 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.GPUOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GPUOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private double perProcessGpuMemoryFraction_ ; - /** - *
    -     * Fraction of the available GPU memory to allocate for each process.
    -     * 1 means to allocate all of the GPU memory, 0.5 means the process
    -     * allocates up to ~50% of the available GPU memory.
    -     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    -     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    -     * the amount of memory available on the GPU device by using host memory as a
    -     * swap space. Accessing memory not available on the device will be
    -     * significantly slower as that would require memory transfer between the host
    -     * and the device. Options to reduce the memory requirement should be
    -     * considered before enabling this option as this may come with a negative
    -     * performance impact. Oversubscription using the unified memory requires
    -     * Pascal class or newer GPUs and it is currently only supported on the Linux
    -     * operating system. See
    -     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    -     * for the detailed requirements.
    -     * 
    - * - * double per_process_gpu_memory_fraction = 1; - */ - public double getPerProcessGpuMemoryFraction() { - return perProcessGpuMemoryFraction_; - } - /** - *
    -     * Fraction of the available GPU memory to allocate for each process.
    -     * 1 means to allocate all of the GPU memory, 0.5 means the process
    -     * allocates up to ~50% of the available GPU memory.
    -     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    -     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    -     * the amount of memory available on the GPU device by using host memory as a
    -     * swap space. Accessing memory not available on the device will be
    -     * significantly slower as that would require memory transfer between the host
    -     * and the device. Options to reduce the memory requirement should be
    -     * considered before enabling this option as this may come with a negative
    -     * performance impact. Oversubscription using the unified memory requires
    -     * Pascal class or newer GPUs and it is currently only supported on the Linux
    -     * operating system. See
    -     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    -     * for the detailed requirements.
    -     * 
    - * - * double per_process_gpu_memory_fraction = 1; - */ - public Builder setPerProcessGpuMemoryFraction(double value) { - - perProcessGpuMemoryFraction_ = value; - onChanged(); - return this; - } - /** - *
    -     * Fraction of the available GPU memory to allocate for each process.
    -     * 1 means to allocate all of the GPU memory, 0.5 means the process
    -     * allocates up to ~50% of the available GPU memory.
    -     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    -     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    -     * the amount of memory available on the GPU device by using host memory as a
    -     * swap space. Accessing memory not available on the device will be
    -     * significantly slower as that would require memory transfer between the host
    -     * and the device. Options to reduce the memory requirement should be
    -     * considered before enabling this option as this may come with a negative
    -     * performance impact. Oversubscription using the unified memory requires
    -     * Pascal class or newer GPUs and it is currently only supported on the Linux
    -     * operating system. See
    -     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    -     * for the detailed requirements.
    -     * 
    - * - * double per_process_gpu_memory_fraction = 1; - */ - public Builder clearPerProcessGpuMemoryFraction() { - - perProcessGpuMemoryFraction_ = 0D; - onChanged(); - return this; - } - - private boolean allowGrowth_ ; - /** - *
    -     * If true, the allocator does not pre-allocate the entire specified
    -     * GPU memory region, instead starting small and growing as needed.
    -     * 
    - * - * bool allow_growth = 4; - */ - public boolean getAllowGrowth() { - return allowGrowth_; - } - /** - *
    -     * If true, the allocator does not pre-allocate the entire specified
    -     * GPU memory region, instead starting small and growing as needed.
    -     * 
    - * - * bool allow_growth = 4; - */ - public Builder setAllowGrowth(boolean value) { - - allowGrowth_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, the allocator does not pre-allocate the entire specified
    -     * GPU memory region, instead starting small and growing as needed.
    -     * 
    - * - * bool allow_growth = 4; - */ - public Builder clearAllowGrowth() { - - allowGrowth_ = false; - onChanged(); - return this; - } - - private java.lang.Object allocatorType_ = ""; - /** - *
    -     * The type of GPU allocation strategy to use.
    -     * Allowed values:
    -     * "": The empty string (default) uses a system-chosen default
    -     *     which may change over time.
    -     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -     *        version of dlmalloc.
    -     * 
    - * - * string allocator_type = 2; - */ - public java.lang.String getAllocatorType() { - java.lang.Object ref = allocatorType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The type of GPU allocation strategy to use.
    -     * Allowed values:
    -     * "": The empty string (default) uses a system-chosen default
    -     *     which may change over time.
    -     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -     *        version of dlmalloc.
    -     * 
    - * - * string allocator_type = 2; - */ - public com.google.protobuf.ByteString - getAllocatorTypeBytes() { - java.lang.Object ref = allocatorType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The type of GPU allocation strategy to use.
    -     * Allowed values:
    -     * "": The empty string (default) uses a system-chosen default
    -     *     which may change over time.
    -     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -     *        version of dlmalloc.
    -     * 
    - * - * string allocator_type = 2; - */ - public Builder setAllocatorType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorType_ = value; - onChanged(); - return this; - } - /** - *
    -     * The type of GPU allocation strategy to use.
    -     * Allowed values:
    -     * "": The empty string (default) uses a system-chosen default
    -     *     which may change over time.
    -     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -     *        version of dlmalloc.
    -     * 
    - * - * string allocator_type = 2; - */ - public Builder clearAllocatorType() { - - allocatorType_ = getDefaultInstance().getAllocatorType(); - onChanged(); - return this; - } - /** - *
    -     * The type of GPU allocation strategy to use.
    -     * Allowed values:
    -     * "": The empty string (default) uses a system-chosen default
    -     *     which may change over time.
    -     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -     *        version of dlmalloc.
    -     * 
    - * - * string allocator_type = 2; - */ - public Builder setAllocatorTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorType_ = value; - onChanged(); - return this; - } - - private long deferredDeletionBytes_ ; - /** - *
    -     * Delay deletion of up to this many bytes to reduce the number of
    -     * interactions with gpu driver code.  If 0, the system chooses
    -     * a reasonable default (several MBs).
    -     * 
    - * - * int64 deferred_deletion_bytes = 3; - */ - public long getDeferredDeletionBytes() { - return deferredDeletionBytes_; - } - /** - *
    -     * Delay deletion of up to this many bytes to reduce the number of
    -     * interactions with gpu driver code.  If 0, the system chooses
    -     * a reasonable default (several MBs).
    -     * 
    - * - * int64 deferred_deletion_bytes = 3; - */ - public Builder setDeferredDeletionBytes(long value) { - - deferredDeletionBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Delay deletion of up to this many bytes to reduce the number of
    -     * interactions with gpu driver code.  If 0, the system chooses
    -     * a reasonable default (several MBs).
    -     * 
    - * - * int64 deferred_deletion_bytes = 3; - */ - public Builder clearDeferredDeletionBytes() { - - deferredDeletionBytes_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object visibleDeviceList_ = ""; - /** - *
    -     * A comma-separated list of GPU ids that determines the 'visible'
    -     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -     * can see 8 GPU devices in the process, and one wanted to map
    -     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -     * then one would specify this field as "5,3".  This field is similar in
    -     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -     * it applies to the visible GPU devices in the process.
    -     * NOTE:
    -     * 1. The GPU driver provides the process with the visible GPUs
    -     *    in an order which is not guaranteed to have any correlation to
    -     *    the *physical* GPU id in the machine.  This field is used for
    -     *    remapping "visible" to "virtual", which means this operates only
    -     *    after the process starts.  Users are required to use vendor
    -     *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -     *    physical to visible device mapping prior to invoking TensorFlow.
    -     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -     *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -     *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -     *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -     *    for more information.
    -     * 
    - * - * string visible_device_list = 5; - */ - public java.lang.String getVisibleDeviceList() { - java.lang.Object ref = visibleDeviceList_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - visibleDeviceList_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A comma-separated list of GPU ids that determines the 'visible'
    -     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -     * can see 8 GPU devices in the process, and one wanted to map
    -     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -     * then one would specify this field as "5,3".  This field is similar in
    -     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -     * it applies to the visible GPU devices in the process.
    -     * NOTE:
    -     * 1. The GPU driver provides the process with the visible GPUs
    -     *    in an order which is not guaranteed to have any correlation to
    -     *    the *physical* GPU id in the machine.  This field is used for
    -     *    remapping "visible" to "virtual", which means this operates only
    -     *    after the process starts.  Users are required to use vendor
    -     *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -     *    physical to visible device mapping prior to invoking TensorFlow.
    -     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -     *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -     *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -     *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -     *    for more information.
    -     * 
    - * - * string visible_device_list = 5; - */ - public com.google.protobuf.ByteString - getVisibleDeviceListBytes() { - java.lang.Object ref = visibleDeviceList_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - visibleDeviceList_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A comma-separated list of GPU ids that determines the 'visible'
    -     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -     * can see 8 GPU devices in the process, and one wanted to map
    -     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -     * then one would specify this field as "5,3".  This field is similar in
    -     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -     * it applies to the visible GPU devices in the process.
    -     * NOTE:
    -     * 1. The GPU driver provides the process with the visible GPUs
    -     *    in an order which is not guaranteed to have any correlation to
    -     *    the *physical* GPU id in the machine.  This field is used for
    -     *    remapping "visible" to "virtual", which means this operates only
    -     *    after the process starts.  Users are required to use vendor
    -     *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -     *    physical to visible device mapping prior to invoking TensorFlow.
    -     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -     *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -     *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -     *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -     *    for more information.
    -     * 
    - * - * string visible_device_list = 5; - */ - public Builder setVisibleDeviceList( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - visibleDeviceList_ = value; - onChanged(); - return this; - } - /** - *
    -     * A comma-separated list of GPU ids that determines the 'visible'
    -     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -     * can see 8 GPU devices in the process, and one wanted to map
    -     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -     * then one would specify this field as "5,3".  This field is similar in
    -     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -     * it applies to the visible GPU devices in the process.
    -     * NOTE:
    -     * 1. The GPU driver provides the process with the visible GPUs
    -     *    in an order which is not guaranteed to have any correlation to
    -     *    the *physical* GPU id in the machine.  This field is used for
    -     *    remapping "visible" to "virtual", which means this operates only
    -     *    after the process starts.  Users are required to use vendor
    -     *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -     *    physical to visible device mapping prior to invoking TensorFlow.
    -     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -     *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -     *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -     *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -     *    for more information.
    -     * 
    - * - * string visible_device_list = 5; - */ - public Builder clearVisibleDeviceList() { - - visibleDeviceList_ = getDefaultInstance().getVisibleDeviceList(); - onChanged(); - return this; - } - /** - *
    -     * A comma-separated list of GPU ids that determines the 'visible'
    -     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -     * can see 8 GPU devices in the process, and one wanted to map
    -     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -     * then one would specify this field as "5,3".  This field is similar in
    -     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -     * it applies to the visible GPU devices in the process.
    -     * NOTE:
    -     * 1. The GPU driver provides the process with the visible GPUs
    -     *    in an order which is not guaranteed to have any correlation to
    -     *    the *physical* GPU id in the machine.  This field is used for
    -     *    remapping "visible" to "virtual", which means this operates only
    -     *    after the process starts.  Users are required to use vendor
    -     *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -     *    physical to visible device mapping prior to invoking TensorFlow.
    -     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -     *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -     *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -     *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -     *    for more information.
    -     * 
    - * - * string visible_device_list = 5; - */ - public Builder setVisibleDeviceListBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - visibleDeviceList_ = value; - onChanged(); - return this; - } - - private int pollingActiveDelayUsecs_ ; - /** - *
    -     * In the event polling loop sleep this many microseconds between
    -     * PollEvents calls, when the queue is not empty.  If value is not
    -     * set or set to 0, gets set to a non-zero default.
    -     * 
    - * - * int32 polling_active_delay_usecs = 6; - */ - public int getPollingActiveDelayUsecs() { - return pollingActiveDelayUsecs_; - } - /** - *
    -     * In the event polling loop sleep this many microseconds between
    -     * PollEvents calls, when the queue is not empty.  If value is not
    -     * set or set to 0, gets set to a non-zero default.
    -     * 
    - * - * int32 polling_active_delay_usecs = 6; - */ - public Builder setPollingActiveDelayUsecs(int value) { - - pollingActiveDelayUsecs_ = value; - onChanged(); - return this; - } - /** - *
    -     * In the event polling loop sleep this many microseconds between
    -     * PollEvents calls, when the queue is not empty.  If value is not
    -     * set or set to 0, gets set to a non-zero default.
    -     * 
    - * - * int32 polling_active_delay_usecs = 6; - */ - public Builder clearPollingActiveDelayUsecs() { - - pollingActiveDelayUsecs_ = 0; - onChanged(); - return this; - } - - private int pollingInactiveDelayMsecs_ ; - /** - *
    -     * This field is deprecated and ignored.
    -     * 
    - * - * int32 polling_inactive_delay_msecs = 7; - */ - public int getPollingInactiveDelayMsecs() { - return pollingInactiveDelayMsecs_; - } - /** - *
    -     * This field is deprecated and ignored.
    -     * 
    - * - * int32 polling_inactive_delay_msecs = 7; - */ - public Builder setPollingInactiveDelayMsecs(int value) { - - pollingInactiveDelayMsecs_ = value; - onChanged(); - return this; - } - /** - *
    -     * This field is deprecated and ignored.
    -     * 
    - * - * int32 polling_inactive_delay_msecs = 7; - */ - public Builder clearPollingInactiveDelayMsecs() { - - pollingInactiveDelayMsecs_ = 0; - onChanged(); - return this; - } - - private boolean forceGpuCompatible_ ; - /** - *
    -     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    -     * enabling this option forces all CPU tensors to be allocated with Cuda
    -     * pinned memory. Normally, TensorFlow will infer which tensors should be
    -     * allocated as the pinned memory. But in case where the inference is
    -     * incomplete, this option can significantly speed up the cross-device memory
    -     * copy performance as long as it fits the memory.
    -     * Note that this option is not something that should be
    -     * enabled by default for unknown or very large models, since all Cuda pinned
    -     * memory is unpageable, having too much pinned memory might negatively impact
    -     * the overall host system performance.
    -     * 
    - * - * bool force_gpu_compatible = 8; - */ - public boolean getForceGpuCompatible() { - return forceGpuCompatible_; - } - /** - *
    -     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    -     * enabling this option forces all CPU tensors to be allocated with Cuda
    -     * pinned memory. Normally, TensorFlow will infer which tensors should be
    -     * allocated as the pinned memory. But in case where the inference is
    -     * incomplete, this option can significantly speed up the cross-device memory
    -     * copy performance as long as it fits the memory.
    -     * Note that this option is not something that should be
    -     * enabled by default for unknown or very large models, since all Cuda pinned
    -     * memory is unpageable, having too much pinned memory might negatively impact
    -     * the overall host system performance.
    -     * 
    - * - * bool force_gpu_compatible = 8; - */ - public Builder setForceGpuCompatible(boolean value) { - - forceGpuCompatible_ = value; - onChanged(); - return this; - } - /** - *
    -     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    -     * enabling this option forces all CPU tensors to be allocated with Cuda
    -     * pinned memory. Normally, TensorFlow will infer which tensors should be
    -     * allocated as the pinned memory. But in case where the inference is
    -     * incomplete, this option can significantly speed up the cross-device memory
    -     * copy performance as long as it fits the memory.
    -     * Note that this option is not something that should be
    -     * enabled by default for unknown or very large models, since all Cuda pinned
    -     * memory is unpageable, having too much pinned memory might negatively impact
    -     * the overall host system performance.
    -     * 
    - * - * bool force_gpu_compatible = 8; - */ - public Builder clearForceGpuCompatible() { - - forceGpuCompatible_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.GPUOptions.Experimental experimental_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental, org.tensorflow.proto.framework.GPUOptions.Experimental.Builder, org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder> experimentalBuilder_; - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public boolean hasExperimental() { - return experimentalBuilder_ != null || experimental_ != null; - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental getExperimental() { - if (experimentalBuilder_ == null) { - return experimental_ == null ? org.tensorflow.proto.framework.GPUOptions.Experimental.getDefaultInstance() : experimental_; - } else { - return experimentalBuilder_.getMessage(); - } - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public Builder setExperimental(org.tensorflow.proto.framework.GPUOptions.Experimental value) { - if (experimentalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - experimental_ = value; - onChanged(); - } else { - experimentalBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public Builder setExperimental( - org.tensorflow.proto.framework.GPUOptions.Experimental.Builder builderForValue) { - if (experimentalBuilder_ == null) { - experimental_ = builderForValue.build(); - onChanged(); - } else { - experimentalBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public Builder mergeExperimental(org.tensorflow.proto.framework.GPUOptions.Experimental value) { - if (experimentalBuilder_ == null) { - if (experimental_ != null) { - experimental_ = - org.tensorflow.proto.framework.GPUOptions.Experimental.newBuilder(experimental_).mergeFrom(value).buildPartial(); - } else { - experimental_ = value; - } - onChanged(); - } else { - experimentalBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public Builder clearExperimental() { - if (experimentalBuilder_ == null) { - experimental_ = null; - onChanged(); - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - - return this; - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public org.tensorflow.proto.framework.GPUOptions.Experimental.Builder getExperimentalBuilder() { - - onChanged(); - return getExperimentalFieldBuilder().getBuilder(); - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - public org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { - if (experimentalBuilder_ != null) { - return experimentalBuilder_.getMessageOrBuilder(); - } else { - return experimental_ == null ? - org.tensorflow.proto.framework.GPUOptions.Experimental.getDefaultInstance() : experimental_; - } - } - /** - *
    -     * Everything inside experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental, org.tensorflow.proto.framework.GPUOptions.Experimental.Builder, org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder> - getExperimentalFieldBuilder() { - if (experimentalBuilder_ == null) { - experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GPUOptions.Experimental, org.tensorflow.proto.framework.GPUOptions.Experimental.Builder, org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder>( - getExperimental(), - getParentForChildren(), - isClean()); - experimental_ = null; - } - return experimentalBuilder_; - } - @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.GPUOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions) - private static final org.tensorflow.proto.framework.GPUOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GPUOptions(); - } - - public static org.tensorflow.proto.framework.GPUOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GPUOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GPUOptions(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.GPUOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptionsOrBuilder.java deleted file mode 100644 index 6f11472d49a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GPUOptionsOrBuilder.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface GPUOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Fraction of the available GPU memory to allocate for each process.
    -   * 1 means to allocate all of the GPU memory, 0.5 means the process
    -   * allocates up to ~50% of the available GPU memory.
    -   * GPU memory is pre-allocated unless the allow_growth option is enabled.
    -   * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    -   * the amount of memory available on the GPU device by using host memory as a
    -   * swap space. Accessing memory not available on the device will be
    -   * significantly slower as that would require memory transfer between the host
    -   * and the device. Options to reduce the memory requirement should be
    -   * considered before enabling this option as this may come with a negative
    -   * performance impact. Oversubscription using the unified memory requires
    -   * Pascal class or newer GPUs and it is currently only supported on the Linux
    -   * operating system. See
    -   * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    -   * for the detailed requirements.
    -   * 
    - * - * double per_process_gpu_memory_fraction = 1; - */ - double getPerProcessGpuMemoryFraction(); - - /** - *
    -   * If true, the allocator does not pre-allocate the entire specified
    -   * GPU memory region, instead starting small and growing as needed.
    -   * 
    - * - * bool allow_growth = 4; - */ - boolean getAllowGrowth(); - - /** - *
    -   * The type of GPU allocation strategy to use.
    -   * Allowed values:
    -   * "": The empty string (default) uses a system-chosen default
    -   *     which may change over time.
    -   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -   *        version of dlmalloc.
    -   * 
    - * - * string allocator_type = 2; - */ - java.lang.String getAllocatorType(); - /** - *
    -   * The type of GPU allocation strategy to use.
    -   * Allowed values:
    -   * "": The empty string (default) uses a system-chosen default
    -   *     which may change over time.
    -   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    -   *        version of dlmalloc.
    -   * 
    - * - * string allocator_type = 2; - */ - com.google.protobuf.ByteString - getAllocatorTypeBytes(); - - /** - *
    -   * Delay deletion of up to this many bytes to reduce the number of
    -   * interactions with gpu driver code.  If 0, the system chooses
    -   * a reasonable default (several MBs).
    -   * 
    - * - * int64 deferred_deletion_bytes = 3; - */ - long getDeferredDeletionBytes(); - - /** - *
    -   * A comma-separated list of GPU ids that determines the 'visible'
    -   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -   * can see 8 GPU devices in the process, and one wanted to map
    -   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -   * then one would specify this field as "5,3".  This field is similar in
    -   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -   * it applies to the visible GPU devices in the process.
    -   * NOTE:
    -   * 1. The GPU driver provides the process with the visible GPUs
    -   *    in an order which is not guaranteed to have any correlation to
    -   *    the *physical* GPU id in the machine.  This field is used for
    -   *    remapping "visible" to "virtual", which means this operates only
    -   *    after the process starts.  Users are required to use vendor
    -   *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -   *    physical to visible device mapping prior to invoking TensorFlow.
    -   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -   *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -   *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -   *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -   *    for more information.
    -   * 
    - * - * string visible_device_list = 5; - */ - java.lang.String getVisibleDeviceList(); - /** - *
    -   * A comma-separated list of GPU ids that determines the 'visible'
    -   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    -   * can see 8 GPU devices in the process, and one wanted to map
    -   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    -   * then one would specify this field as "5,3".  This field is similar in
    -   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    -   * it applies to the visible GPU devices in the process.
    -   * NOTE:
    -   * 1. The GPU driver provides the process with the visible GPUs
    -   *    in an order which is not guaranteed to have any correlation to
    -   *    the *physical* GPU id in the machine.  This field is used for
    -   *    remapping "visible" to "virtual", which means this operates only
    -   *    after the process starts.  Users are required to use vendor
    -   *    specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    -   *    physical to visible device mapping prior to invoking TensorFlow.
    -   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    -   *    and the 'virtual' ids of GPU devices (i.e. the ids in the device
    -   *    name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    -   *    refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    -   *    for more information.
    -   * 
    - * - * string visible_device_list = 5; - */ - com.google.protobuf.ByteString - getVisibleDeviceListBytes(); - - /** - *
    -   * In the event polling loop sleep this many microseconds between
    -   * PollEvents calls, when the queue is not empty.  If value is not
    -   * set or set to 0, gets set to a non-zero default.
    -   * 
    - * - * int32 polling_active_delay_usecs = 6; - */ - int getPollingActiveDelayUsecs(); - - /** - *
    -   * This field is deprecated and ignored.
    -   * 
    - * - * int32 polling_inactive_delay_msecs = 7; - */ - int getPollingInactiveDelayMsecs(); - - /** - *
    -   * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    -   * enabling this option forces all CPU tensors to be allocated with Cuda
    -   * pinned memory. Normally, TensorFlow will infer which tensors should be
    -   * allocated as the pinned memory. But in case where the inference is
    -   * incomplete, this option can significantly speed up the cross-device memory
    -   * copy performance as long as it fits the memory.
    -   * Note that this option is not something that should be
    -   * enabled by default for unknown or very large models, since all Cuda pinned
    -   * memory is unpageable, having too much pinned memory might negatively impact
    -   * the overall host system performance.
    -   * 
    - * - * bool force_gpu_compatible = 8; - */ - boolean getForceGpuCompatible(); - - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - boolean hasExperimental(); - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - org.tensorflow.proto.framework.GPUOptions.Experimental getExperimental(); - /** - *
    -   * Everything inside experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * .tensorflow.GPUOptions.Experimental experimental = 9; - */ - org.tensorflow.proto.framework.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDef.java deleted file mode 100644 index fe1126cb2ef..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDef.java +++ /dev/null @@ -1,765 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * GradientDef defines the gradient function of a function defined in
    - * a function library.
    - * A gradient function g (specified by gradient_func) for a function f
    - * (specified by function_name) must follow the following:
    - * The function 'f' must be a numerical function which takes N inputs
    - * and produces M outputs. Its gradient function 'g', which is a
    - * function taking N + M inputs and produces N outputs.
    - * I.e. if we have
    - *    (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
    - * then, g is
    - *    (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
    - *                                      dL/dy1, dL/dy2, ..., dL/dy_M),
    - * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
    - * loss function). dL/dx_i is the partial derivative of L with respect
    - * to x_i.
    - * 
    - * - * Protobuf type {@code tensorflow.GradientDef} - */ -public final class GradientDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GradientDef) - GradientDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use GradientDef.newBuilder() to construct. - private GradientDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GradientDef() { - functionName_ = ""; - gradientFunc_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GradientDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GradientDef( - 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(); - - functionName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - gradientFunc_ = s; - 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.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_GradientDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GradientDef.class, org.tensorflow.proto.framework.GradientDef.Builder.class); - } - - public static final int FUNCTION_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object functionName_; - /** - *
    -   * The function name.
    -   * 
    - * - * string function_name = 1; - */ - public java.lang.String getFunctionName() { - java.lang.Object ref = functionName_; - 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(); - functionName_ = s; - return s; - } - } - /** - *
    -   * The function name.
    -   * 
    - * - * string function_name = 1; - */ - public com.google.protobuf.ByteString - getFunctionNameBytes() { - java.lang.Object ref = functionName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - functionName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRADIENT_FUNC_FIELD_NUMBER = 2; - private volatile java.lang.Object gradientFunc_; - /** - *
    -   * The gradient function's name.
    -   * 
    - * - * string gradient_func = 2; - */ - public java.lang.String getGradientFunc() { - java.lang.Object ref = gradientFunc_; - 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(); - gradientFunc_ = s; - return s; - } - } - /** - *
    -   * The gradient function's name.
    -   * 
    - * - * string gradient_func = 2; - */ - public com.google.protobuf.ByteString - getGradientFuncBytes() { - java.lang.Object ref = gradientFunc_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gradientFunc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getFunctionNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, functionName_); - } - if (!getGradientFuncBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gradientFunc_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getFunctionNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, functionName_); - } - if (!getGradientFuncBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gradientFunc_); - } - 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.GradientDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GradientDef other = (org.tensorflow.proto.framework.GradientDef) obj; - - if (!getFunctionName() - .equals(other.getFunctionName())) return false; - if (!getGradientFunc() - .equals(other.getGradientFunc())) 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) + FUNCTION_NAME_FIELD_NUMBER; - hash = (53 * hash) + getFunctionName().hashCode(); - hash = (37 * hash) + GRADIENT_FUNC_FIELD_NUMBER; - hash = (53 * hash) + getGradientFunc().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GradientDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GradientDef 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.GradientDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GradientDef 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.GradientDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GradientDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GradientDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GradientDef 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.GradientDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GradientDef 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.GradientDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GradientDef 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.GradientDef 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; - } - /** - *
    -   * GradientDef defines the gradient function of a function defined in
    -   * a function library.
    -   * A gradient function g (specified by gradient_func) for a function f
    -   * (specified by function_name) must follow the following:
    -   * The function 'f' must be a numerical function which takes N inputs
    -   * and produces M outputs. Its gradient function 'g', which is a
    -   * function taking N + M inputs and produces N outputs.
    -   * I.e. if we have
    -   *    (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
    -   * then, g is
    -   *    (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
    -   *                                      dL/dy1, dL/dy2, ..., dL/dy_M),
    -   * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
    -   * loss function). dL/dx_i is the partial derivative of L with respect
    -   * to x_i.
    -   * 
    - * - * Protobuf type {@code tensorflow.GradientDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GradientDef) - org.tensorflow.proto.framework.GradientDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_GradientDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GradientDef.class, org.tensorflow.proto.framework.GradientDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GradientDef.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(); - functionName_ = ""; - - gradientFunc_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GradientDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GradientDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GradientDef build() { - org.tensorflow.proto.framework.GradientDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GradientDef buildPartial() { - org.tensorflow.proto.framework.GradientDef result = new org.tensorflow.proto.framework.GradientDef(this); - result.functionName_ = functionName_; - result.gradientFunc_ = gradientFunc_; - 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.GradientDef) { - return mergeFrom((org.tensorflow.proto.framework.GradientDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GradientDef other) { - if (other == org.tensorflow.proto.framework.GradientDef.getDefaultInstance()) return this; - if (!other.getFunctionName().isEmpty()) { - functionName_ = other.functionName_; - onChanged(); - } - if (!other.getGradientFunc().isEmpty()) { - gradientFunc_ = other.gradientFunc_; - onChanged(); - } - 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.GradientDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GradientDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object functionName_ = ""; - /** - *
    -     * The function name.
    -     * 
    - * - * string function_name = 1; - */ - public java.lang.String getFunctionName() { - java.lang.Object ref = functionName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - functionName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The function name.
    -     * 
    - * - * string function_name = 1; - */ - public com.google.protobuf.ByteString - getFunctionNameBytes() { - java.lang.Object ref = functionName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - functionName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The function name.
    -     * 
    - * - * string function_name = 1; - */ - public Builder setFunctionName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - functionName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The function name.
    -     * 
    - * - * string function_name = 1; - */ - public Builder clearFunctionName() { - - functionName_ = getDefaultInstance().getFunctionName(); - onChanged(); - return this; - } - /** - *
    -     * The function name.
    -     * 
    - * - * string function_name = 1; - */ - public Builder setFunctionNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - functionName_ = value; - onChanged(); - return this; - } - - private java.lang.Object gradientFunc_ = ""; - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 2; - */ - public java.lang.String getGradientFunc() { - java.lang.Object ref = gradientFunc_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gradientFunc_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 2; - */ - public com.google.protobuf.ByteString - getGradientFuncBytes() { - java.lang.Object ref = gradientFunc_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gradientFunc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 2; - */ - public Builder setGradientFunc( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gradientFunc_ = value; - onChanged(); - return this; - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 2; - */ - public Builder clearGradientFunc() { - - gradientFunc_ = getDefaultInstance().getGradientFunc(); - onChanged(); - return this; - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 2; - */ - public Builder setGradientFuncBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gradientFunc_ = value; - 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.GradientDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GradientDef) - private static final org.tensorflow.proto.framework.GradientDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GradientDef(); - } - - public static org.tensorflow.proto.framework.GradientDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GradientDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GradientDef(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.GradientDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfo.java deleted file mode 100644 index 165c76f3ce7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfo.java +++ /dev/null @@ -1,3004 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/graph_debug_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphDebugInfo} - */ -public final class GraphDebugInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo) - GraphDebugInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphDebugInfo.newBuilder() to construct. - private GraphDebugInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphDebugInfo() { - files_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphDebugInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphDebugInfo( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - files_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - files_.add(s); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - traces_ = com.google.protobuf.MapField.newMapField( - TracesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - traces__ = input.readMessage( - TracesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - traces_.getMutableMap().put( - traces__.getKey(), traces__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - files_ = files_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTraces(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.class, org.tensorflow.proto.framework.GraphDebugInfo.Builder.class); - } - - public interface FileLineColOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo.FileLineCol) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * File name index, which can be used to retrieve the file name string from
    -     * `files`. The value should be between 0 and (len(files)-1)
    -     * 
    - * - * int32 file_index = 1; - */ - int getFileIndex(); - - /** - *
    -     * Line number in the file.
    -     * 
    - * - * int32 line = 2; - */ - int getLine(); - - /** - *
    -     * Col number in the file line.
    -     * 
    - * - * int32 col = 3; - */ - int getCol(); - - /** - *
    -     * Name of function contains the file line.
    -     * 
    - * - * string func = 4; - */ - java.lang.String getFunc(); - /** - *
    -     * Name of function contains the file line.
    -     * 
    - * - * string func = 4; - */ - com.google.protobuf.ByteString - getFuncBytes(); - - /** - *
    -     * Source code contained in this file line.
    -     * 
    - * - * string code = 5; - */ - java.lang.String getCode(); - /** - *
    -     * Source code contained in this file line.
    -     * 
    - * - * string code = 5; - */ - com.google.protobuf.ByteString - getCodeBytes(); - } - /** - *
    -   * This represents a file/line location in the source code.
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphDebugInfo.FileLineCol} - */ - public static final class FileLineCol extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo.FileLineCol) - FileLineColOrBuilder { - private static final long serialVersionUID = 0L; - // Use FileLineCol.newBuilder() to construct. - private FileLineCol(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FileLineCol() { - func_ = ""; - code_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FileLineCol(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FileLineCol( - 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: { - - fileIndex_ = input.readInt32(); - break; - } - case 16: { - - line_ = input.readInt32(); - break; - } - case 24: { - - col_ = input.readInt32(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - func_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - code_ = s; - 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.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.class, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder.class); - } - - public static final int FILE_INDEX_FIELD_NUMBER = 1; - private int fileIndex_; - /** - *
    -     * File name index, which can be used to retrieve the file name string from
    -     * `files`. The value should be between 0 and (len(files)-1)
    -     * 
    - * - * int32 file_index = 1; - */ - public int getFileIndex() { - return fileIndex_; - } - - public static final int LINE_FIELD_NUMBER = 2; - private int line_; - /** - *
    -     * Line number in the file.
    -     * 
    - * - * int32 line = 2; - */ - public int getLine() { - return line_; - } - - public static final int COL_FIELD_NUMBER = 3; - private int col_; - /** - *
    -     * Col number in the file line.
    -     * 
    - * - * int32 col = 3; - */ - public int getCol() { - return col_; - } - - public static final int FUNC_FIELD_NUMBER = 4; - private volatile java.lang.Object func_; - /** - *
    -     * Name of function contains the file line.
    -     * 
    - * - * string func = 4; - */ - public java.lang.String getFunc() { - java.lang.Object ref = func_; - 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(); - func_ = s; - return s; - } - } - /** - *
    -     * Name of function contains the file line.
    -     * 
    - * - * string func = 4; - */ - public com.google.protobuf.ByteString - getFuncBytes() { - java.lang.Object ref = func_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - func_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CODE_FIELD_NUMBER = 5; - private volatile java.lang.Object code_; - /** - *
    -     * Source code contained in this file line.
    -     * 
    - * - * string code = 5; - */ - public java.lang.String getCode() { - java.lang.Object ref = code_; - 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(); - code_ = s; - return s; - } - } - /** - *
    -     * Source code contained in this file line.
    -     * 
    - * - * string code = 5; - */ - public com.google.protobuf.ByteString - getCodeBytes() { - java.lang.Object ref = code_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - code_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (fileIndex_ != 0) { - output.writeInt32(1, fileIndex_); - } - if (line_ != 0) { - output.writeInt32(2, line_); - } - if (col_ != 0) { - output.writeInt32(3, col_); - } - if (!getFuncBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, func_); - } - if (!getCodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, code_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (fileIndex_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, fileIndex_); - } - if (line_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, line_); - } - if (col_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, col_); - } - if (!getFuncBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, func_); - } - if (!getCodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, code_); - } - 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.GraphDebugInfo.FileLineCol)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol other = (org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol) obj; - - if (getFileIndex() - != other.getFileIndex()) return false; - if (getLine() - != other.getLine()) return false; - if (getCol() - != other.getCol()) return false; - if (!getFunc() - .equals(other.getFunc())) return false; - if (!getCode() - .equals(other.getCode())) 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) + FILE_INDEX_FIELD_NUMBER; - hash = (53 * hash) + getFileIndex(); - hash = (37 * hash) + LINE_FIELD_NUMBER; - hash = (53 * hash) + getLine(); - hash = (37 * hash) + COL_FIELD_NUMBER; - hash = (53 * hash) + getCol(); - hash = (37 * hash) + FUNC_FIELD_NUMBER; - hash = (53 * hash) + getFunc().hashCode(); - hash = (37 * hash) + CODE_FIELD_NUMBER; - hash = (53 * hash) + getCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol 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; - } - /** - *
    -     * This represents a file/line location in the source code.
    -     * 
    - * - * Protobuf type {@code tensorflow.GraphDebugInfo.FileLineCol} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo.FileLineCol) - org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.class, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.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(); - fileIndex_ = 0; - - line_ = 0; - - col_ = 0; - - func_ = ""; - - code_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol build() { - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol buildPartial() { - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol result = new org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol(this); - result.fileIndex_ = fileIndex_; - result.line_ = line_; - result.col_ = col_; - result.func_ = func_; - result.code_ = code_; - 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.GraphDebugInfo.FileLineCol) { - return mergeFrom((org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol other) { - if (other == org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance()) return this; - if (other.getFileIndex() != 0) { - setFileIndex(other.getFileIndex()); - } - if (other.getLine() != 0) { - setLine(other.getLine()); - } - if (other.getCol() != 0) { - setCol(other.getCol()); - } - if (!other.getFunc().isEmpty()) { - func_ = other.func_; - onChanged(); - } - if (!other.getCode().isEmpty()) { - code_ = other.code_; - onChanged(); - } - 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.GraphDebugInfo.FileLineCol parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int fileIndex_ ; - /** - *
    -       * File name index, which can be used to retrieve the file name string from
    -       * `files`. The value should be between 0 and (len(files)-1)
    -       * 
    - * - * int32 file_index = 1; - */ - public int getFileIndex() { - return fileIndex_; - } - /** - *
    -       * File name index, which can be used to retrieve the file name string from
    -       * `files`. The value should be between 0 and (len(files)-1)
    -       * 
    - * - * int32 file_index = 1; - */ - public Builder setFileIndex(int value) { - - fileIndex_ = value; - onChanged(); - return this; - } - /** - *
    -       * File name index, which can be used to retrieve the file name string from
    -       * `files`. The value should be between 0 and (len(files)-1)
    -       * 
    - * - * int32 file_index = 1; - */ - public Builder clearFileIndex() { - - fileIndex_ = 0; - onChanged(); - return this; - } - - private int line_ ; - /** - *
    -       * Line number in the file.
    -       * 
    - * - * int32 line = 2; - */ - public int getLine() { - return line_; - } - /** - *
    -       * Line number in the file.
    -       * 
    - * - * int32 line = 2; - */ - public Builder setLine(int value) { - - line_ = value; - onChanged(); - return this; - } - /** - *
    -       * Line number in the file.
    -       * 
    - * - * int32 line = 2; - */ - public Builder clearLine() { - - line_ = 0; - onChanged(); - return this; - } - - private int col_ ; - /** - *
    -       * Col number in the file line.
    -       * 
    - * - * int32 col = 3; - */ - public int getCol() { - return col_; - } - /** - *
    -       * Col number in the file line.
    -       * 
    - * - * int32 col = 3; - */ - public Builder setCol(int value) { - - col_ = value; - onChanged(); - return this; - } - /** - *
    -       * Col number in the file line.
    -       * 
    - * - * int32 col = 3; - */ - public Builder clearCol() { - - col_ = 0; - onChanged(); - return this; - } - - private java.lang.Object func_ = ""; - /** - *
    -       * Name of function contains the file line.
    -       * 
    - * - * string func = 4; - */ - public java.lang.String getFunc() { - java.lang.Object ref = func_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - func_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Name of function contains the file line.
    -       * 
    - * - * string func = 4; - */ - public com.google.protobuf.ByteString - getFuncBytes() { - java.lang.Object ref = func_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - func_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Name of function contains the file line.
    -       * 
    - * - * string func = 4; - */ - public Builder setFunc( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - func_ = value; - onChanged(); - return this; - } - /** - *
    -       * Name of function contains the file line.
    -       * 
    - * - * string func = 4; - */ - public Builder clearFunc() { - - func_ = getDefaultInstance().getFunc(); - onChanged(); - return this; - } - /** - *
    -       * Name of function contains the file line.
    -       * 
    - * - * string func = 4; - */ - public Builder setFuncBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - func_ = value; - onChanged(); - return this; - } - - private java.lang.Object code_ = ""; - /** - *
    -       * Source code contained in this file line.
    -       * 
    - * - * string code = 5; - */ - public java.lang.String getCode() { - java.lang.Object ref = code_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - code_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Source code contained in this file line.
    -       * 
    - * - * string code = 5; - */ - public com.google.protobuf.ByteString - getCodeBytes() { - java.lang.Object ref = code_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - code_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Source code contained in this file line.
    -       * 
    - * - * string code = 5; - */ - public Builder setCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - code_ = value; - onChanged(); - return this; - } - /** - *
    -       * Source code contained in this file line.
    -       * 
    - * - * string code = 5; - */ - public Builder clearCode() { - - code_ = getDefaultInstance().getCode(); - onChanged(); - return this; - } - /** - *
    -       * Source code contained in this file line.
    -       * 
    - * - * string code = 5; - */ - public Builder setCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - code_ = value; - 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.GraphDebugInfo.FileLineCol) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo.FileLineCol) - private static final org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol(); - } - - public static org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FileLineCol parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FileLineCol(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.GraphDebugInfo.FileLineCol getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface StackTraceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo.StackTrace) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - java.util.List - getFileLineColsList(); - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCols(int index); - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - int getFileLineColsCount(); - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - java.util.List - getFileLineColsOrBuilderList(); - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( - int index); - } - /** - *
    -   * This represents a stack trace which is a ordered list of `FileLineCol`.
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphDebugInfo.StackTrace} - */ - public static final class StackTrace extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo.StackTrace) - StackTraceOrBuilder { - private static final long serialVersionUID = 0L; - // Use StackTrace.newBuilder() to construct. - private StackTrace(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StackTrace() { - fileLineCols_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StackTrace(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StackTrace( - 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)) { - fileLineCols_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - fileLineCols_.add( - input.readMessage(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.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_ & 0x00000001) != 0)) { - fileLineCols_ = java.util.Collections.unmodifiableList(fileLineCols_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.class, org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.Builder.class); - } - - public static final int FILE_LINE_COLS_FIELD_NUMBER = 1; - private java.util.List fileLineCols_; - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public java.util.List getFileLineColsList() { - return fileLineCols_; - } - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public java.util.List - getFileLineColsOrBuilderList() { - return fileLineCols_; - } - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public int getFileLineColsCount() { - return fileLineCols_.size(); - } - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCols(int index) { - return fileLineCols_.get(index); - } - /** - *
    -     * Each line in the stack trace.
    -     * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( - int index) { - return fileLineCols_.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 { - for (int i = 0; i < fileLineCols_.size(); i++) { - output.writeMessage(1, fileLineCols_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < fileLineCols_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, fileLineCols_.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.GraphDebugInfo.StackTrace)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace other = (org.tensorflow.proto.framework.GraphDebugInfo.StackTrace) obj; - - if (!getFileLineColsList() - .equals(other.getFileLineColsList())) 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 (getFileLineColsCount() > 0) { - hash = (37 * hash) + FILE_LINE_COLS_FIELD_NUMBER; - hash = (53 * hash) + getFileLineColsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace 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; - } - /** - *
    -     * This represents a stack trace which is a ordered list of `FileLineCol`.
    -     * 
    - * - * Protobuf type {@code tensorflow.GraphDebugInfo.StackTrace} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo.StackTrace) - org.tensorflow.proto.framework.GraphDebugInfo.StackTraceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.class, org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFileLineColsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (fileLineColsBuilder_ == null) { - fileLineCols_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - fileLineColsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace build() { - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace buildPartial() { - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace result = new org.tensorflow.proto.framework.GraphDebugInfo.StackTrace(this); - int from_bitField0_ = bitField0_; - if (fileLineColsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - fileLineCols_ = java.util.Collections.unmodifiableList(fileLineCols_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.fileLineCols_ = fileLineCols_; - } else { - result.fileLineCols_ = fileLineColsBuilder_.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.GraphDebugInfo.StackTrace) { - return mergeFrom((org.tensorflow.proto.framework.GraphDebugInfo.StackTrace)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphDebugInfo.StackTrace other) { - if (other == org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.getDefaultInstance()) return this; - if (fileLineColsBuilder_ == null) { - if (!other.fileLineCols_.isEmpty()) { - if (fileLineCols_.isEmpty()) { - fileLineCols_ = other.fileLineCols_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFileLineColsIsMutable(); - fileLineCols_.addAll(other.fileLineCols_); - } - onChanged(); - } - } else { - if (!other.fileLineCols_.isEmpty()) { - if (fileLineColsBuilder_.isEmpty()) { - fileLineColsBuilder_.dispose(); - fileLineColsBuilder_ = null; - fileLineCols_ = other.fileLineCols_; - bitField0_ = (bitField0_ & ~0x00000001); - fileLineColsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFileLineColsFieldBuilder() : null; - } else { - fileLineColsBuilder_.addAllMessages(other.fileLineCols_); - } - } - } - 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.GraphDebugInfo.StackTrace parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphDebugInfo.StackTrace) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List fileLineCols_ = - java.util.Collections.emptyList(); - private void ensureFileLineColsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - fileLineCols_ = new java.util.ArrayList(fileLineCols_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder> fileLineColsBuilder_; - - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public java.util.List getFileLineColsList() { - if (fileLineColsBuilder_ == null) { - return java.util.Collections.unmodifiableList(fileLineCols_); - } else { - return fileLineColsBuilder_.getMessageList(); - } - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public int getFileLineColsCount() { - if (fileLineColsBuilder_ == null) { - return fileLineCols_.size(); - } else { - return fileLineColsBuilder_.getCount(); - } - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCols(int index) { - if (fileLineColsBuilder_ == null) { - return fileLineCols_.get(index); - } else { - return fileLineColsBuilder_.getMessage(index); - } - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder setFileLineCols( - int index, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol value) { - if (fileLineColsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFileLineColsIsMutable(); - fileLineCols_.set(index, value); - onChanged(); - } else { - fileLineColsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder setFileLineCols( - int index, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder builderForValue) { - if (fileLineColsBuilder_ == null) { - ensureFileLineColsIsMutable(); - fileLineCols_.set(index, builderForValue.build()); - onChanged(); - } else { - fileLineColsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder addFileLineCols(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol value) { - if (fileLineColsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFileLineColsIsMutable(); - fileLineCols_.add(value); - onChanged(); - } else { - fileLineColsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder addFileLineCols( - int index, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol value) { - if (fileLineColsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFileLineColsIsMutable(); - fileLineCols_.add(index, value); - onChanged(); - } else { - fileLineColsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder addFileLineCols( - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder builderForValue) { - if (fileLineColsBuilder_ == null) { - ensureFileLineColsIsMutable(); - fileLineCols_.add(builderForValue.build()); - onChanged(); - } else { - fileLineColsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder addFileLineCols( - int index, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder builderForValue) { - if (fileLineColsBuilder_ == null) { - ensureFileLineColsIsMutable(); - fileLineCols_.add(index, builderForValue.build()); - onChanged(); - } else { - fileLineColsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder addAllFileLineCols( - java.lang.Iterable values) { - if (fileLineColsBuilder_ == null) { - ensureFileLineColsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fileLineCols_); - onChanged(); - } else { - fileLineColsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder clearFileLineCols() { - if (fileLineColsBuilder_ == null) { - fileLineCols_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - fileLineColsBuilder_.clear(); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public Builder removeFileLineCols(int index) { - if (fileLineColsBuilder_ == null) { - ensureFileLineColsIsMutable(); - fileLineCols_.remove(index); - onChanged(); - } else { - fileLineColsBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder getFileLineColsBuilder( - int index) { - return getFileLineColsFieldBuilder().getBuilder(index); - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( - int index) { - if (fileLineColsBuilder_ == null) { - return fileLineCols_.get(index); } else { - return fileLineColsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public java.util.List - getFileLineColsOrBuilderList() { - if (fileLineColsBuilder_ != null) { - return fileLineColsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(fileLineCols_); - } - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder addFileLineColsBuilder() { - return getFileLineColsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance()); - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder addFileLineColsBuilder( - int index) { - return getFileLineColsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance()); - } - /** - *
    -       * Each line in the stack trace.
    -       * 
    - * - * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; - */ - public java.util.List - getFileLineColsBuilderList() { - return getFileLineColsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder> - getFileLineColsFieldBuilder() { - if (fileLineColsBuilder_ == null) { - fileLineColsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder>( - fileLineCols_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - fileLineCols_ = null; - } - return fileLineColsBuilder_; - } - @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.GraphDebugInfo.StackTrace) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo.StackTrace) - private static final org.tensorflow.proto.framework.GraphDebugInfo.StackTrace DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphDebugInfo.StackTrace(); - } - - public static org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StackTrace parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StackTrace(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.GraphDebugInfo.StackTrace getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int FILES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList files_; - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - public com.google.protobuf.ProtocolStringList - getFilesList() { - return files_; - } - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - public int getFilesCount() { - return files_.size(); - } - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - public java.lang.String getFiles(int index) { - return files_.get(index); - } - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - public com.google.protobuf.ByteString - getFilesBytes(int index) { - return files_.getByteString(index); - } - - public static final int TRACES_FIELD_NUMBER = 2; - private static final class TracesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.GraphDebugInfo.StackTrace> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.GraphDebugInfo.StackTrace> traces_; - private com.google.protobuf.MapField - internalGetTraces() { - if (traces_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TracesDefaultEntryHolder.defaultEntry); - } - return traces_; - } - - public int getTracesCount() { - return internalGetTraces().getMap().size(); - } - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public boolean containsTraces( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetTraces().getMap().containsKey(key); - } - /** - * Use {@link #getTracesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTraces() { - return getTracesMap(); - } - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public java.util.Map getTracesMap() { - return internalGetTraces().getMap(); - } - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetTraces().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetTraces().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 { - for (int i = 0; i < files_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, files_.getRaw(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetTraces(), - TracesDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < files_.size(); i++) { - dataSize += computeStringSizeNoTag(files_.getRaw(i)); - } - size += dataSize; - size += 1 * getFilesList().size(); - } - for (java.util.Map.Entry entry - : internalGetTraces().getMap().entrySet()) { - com.google.protobuf.MapEntry - traces__ = TracesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, traces__); - } - 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.GraphDebugInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphDebugInfo other = (org.tensorflow.proto.framework.GraphDebugInfo) obj; - - if (!getFilesList() - .equals(other.getFilesList())) return false; - if (!internalGetTraces().equals( - other.internalGetTraces())) 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 (getFilesCount() > 0) { - hash = (37 * hash) + FILES_FIELD_NUMBER; - hash = (53 * hash) + getFilesList().hashCode(); - } - if (!internalGetTraces().getMap().isEmpty()) { - hash = (37 * hash) + TRACES_FIELD_NUMBER; - hash = (53 * hash) + internalGetTraces().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphDebugInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo 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.GraphDebugInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo 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.GraphDebugInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDebugInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphDebugInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo 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.GraphDebugInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo 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.GraphDebugInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDebugInfo 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.GraphDebugInfo 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.GraphDebugInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo) - org.tensorflow.proto.framework.GraphDebugInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetTraces(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableTraces(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDebugInfo.class, org.tensorflow.proto.framework.GraphDebugInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphDebugInfo.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(); - files_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableTraces().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphDebugInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo build() { - org.tensorflow.proto.framework.GraphDebugInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDebugInfo buildPartial() { - org.tensorflow.proto.framework.GraphDebugInfo result = new org.tensorflow.proto.framework.GraphDebugInfo(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - files_ = files_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.files_ = files_; - result.traces_ = internalGetTraces(); - result.traces_.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.GraphDebugInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphDebugInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphDebugInfo other) { - if (other == org.tensorflow.proto.framework.GraphDebugInfo.getDefaultInstance()) return this; - if (!other.files_.isEmpty()) { - if (files_.isEmpty()) { - files_ = other.files_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFilesIsMutable(); - files_.addAll(other.files_); - } - onChanged(); - } - internalGetMutableTraces().mergeFrom( - other.internalGetTraces()); - 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.GraphDebugInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphDebugInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList files_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureFilesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - files_ = new com.google.protobuf.LazyStringArrayList(files_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public com.google.protobuf.ProtocolStringList - getFilesList() { - return files_.getUnmodifiableView(); - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public int getFilesCount() { - return files_.size(); - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public java.lang.String getFiles(int index) { - return files_.get(index); - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public com.google.protobuf.ByteString - getFilesBytes(int index) { - return files_.getByteString(index); - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public Builder setFiles( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFilesIsMutable(); - files_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public Builder addFiles( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFilesIsMutable(); - files_.add(value); - onChanged(); - return this; - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public Builder addAllFiles( - java.lang.Iterable values) { - ensureFilesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, files_); - onChanged(); - return this; - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public Builder clearFiles() { - files_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * This stores all the source code file names and can be indexed by the
    -     * `file_index`.
    -     * 
    - * - * repeated string files = 1; - */ - public Builder addFilesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureFilesIsMutable(); - files_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.GraphDebugInfo.StackTrace> traces_; - private com.google.protobuf.MapField - internalGetTraces() { - if (traces_ == null) { - return com.google.protobuf.MapField.emptyMapField( - TracesDefaultEntryHolder.defaultEntry); - } - return traces_; - } - private com.google.protobuf.MapField - internalGetMutableTraces() { - onChanged();; - if (traces_ == null) { - traces_ = com.google.protobuf.MapField.newMapField( - TracesDefaultEntryHolder.defaultEntry); - } - if (!traces_.isMutable()) { - traces_ = traces_.copy(); - } - return traces_; - } - - public int getTracesCount() { - return internalGetTraces().getMap().size(); - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public boolean containsTraces( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetTraces().getMap().containsKey(key); - } - /** - * Use {@link #getTracesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getTraces() { - return getTracesMap(); - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public java.util.Map getTracesMap() { - return internalGetTraces().getMap(); - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetTraces().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetTraces().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearTraces() { - internalGetMutableTraces().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public Builder removeTraces( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableTraces().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableTraces() { - return internalGetMutableTraces().getMutableMap(); - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - public Builder putTraces( - java.lang.String key, - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableTraces().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * This maps a node name to a stack trace in the source code.
    -     * The map key is a mangling of the containing function and op name with
    -     * syntax:
    -     *   op.name '@' func_name
    -     * For ops in the top-level graph, the func_name is the empty string.
    -     * Note that op names are restricted to a small number of characters which
    -     * exclude '@', making it impossible to collide keys of this form. Function
    -     * names accept a much wider set of characters.
    -     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -     * func_name), but this is not supported with protocol buffers.
    -     * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - public Builder putAllTraces( - java.util.Map values) { - internalGetMutableTraces().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.GraphDebugInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo) - private static final org.tensorflow.proto.framework.GraphDebugInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphDebugInfo(); - } - - public static org.tensorflow.proto.framework.GraphDebugInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphDebugInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphDebugInfo(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.GraphDebugInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoOrBuilder.java deleted file mode 100644 index 86c48de7b70..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoOrBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/graph_debug_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphDebugInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - java.util.List - getFilesList(); - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - int getFilesCount(); - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - java.lang.String getFiles(int index); - /** - *
    -   * This stores all the source code file names and can be indexed by the
    -   * `file_index`.
    -   * 
    - * - * repeated string files = 1; - */ - com.google.protobuf.ByteString - getFilesBytes(int index); - - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - int getTracesCount(); - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - boolean containsTraces( - java.lang.String key); - /** - * Use {@link #getTracesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getTraces(); - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - java.util.Map - getTracesMap(); - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace defaultValue); - /** - *
    -   * This maps a node name to a stack trace in the source code.
    -   * The map key is a mangling of the containing function and op name with
    -   * syntax:
    -   *   op.name '@' func_name
    -   * For ops in the top-level graph, the func_name is the empty string.
    -   * Note that op names are restricted to a small number of characters which
    -   * exclude '@', making it impossible to collide keys of this form. Function
    -   * names accept a much wider set of characters.
    -   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    -   * func_name), but this is not supported with protocol buffers.
    -   * 
    - * - * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; - */ - - org.tensorflow.proto.framework.GraphDebugInfo.StackTrace getTracesOrThrow( - java.lang.String key); -} 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 deleted file mode 100644 index 109ab5e8322..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDebugInfoProtos.java +++ /dev/null @@ -1,93 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/graph_debug_info.proto - -package org.tensorflow.proto.framework; - -public final class GraphDebugInfoProtos { - private GraphDebugInfoProtos() {} - 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_GraphDebugInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphDebugInfo_TracesEntry_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/graph_debug_i" + - "nfo.proto\022\ntensorflow\"\325\002\n\016GraphDebugInfo" + - "\022\r\n\005files\030\001 \003(\t\0226\n\006traces\030\002 \003(\0132&.tensor" + - "flow.GraphDebugInfo.TracesEntry\032X\n\013FileL" + - "ineCol\022\022\n\nfile_index\030\001 \001(\005\022\014\n\004line\030\002 \001(\005" + - "\022\013\n\003col\030\003 \001(\005\022\014\n\004func\030\004 \001(\t\022\014\n\004code\030\005 \001(" + - "\t\032L\n\nStackTrace\022>\n\016file_line_cols\030\001 \003(\0132" + - "&.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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_GraphDebugInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphDebugInfo_descriptor, - new java.lang.String[] { "Files", "Traces", }); - internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor = - internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor, - new java.lang.String[] { "FileIndex", "Line", "Col", "Func", "Code", }); - internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor = - internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor, - new java.lang.String[] { "FileLineCols", }); - internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor = - internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_GraphDebugInfo_TracesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphDebugInfo_TracesEntry_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/GraphDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDef.java deleted file mode 100644 index 0d67353ab03..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDef.java +++ /dev/null @@ -1,1576 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents the graph of operations
    - * 
    - * - * Protobuf type {@code tensorflow.GraphDef} - */ -public final class GraphDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphDef) - GraphDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphDef.newBuilder() to construct. - private GraphDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphDef() { - node_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphDef( - 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)) { - node_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - node_.add( - input.readMessage(org.tensorflow.proto.framework.NodeDef.parser(), extensionRegistry)); - break; - } - case 18: { - org.tensorflow.proto.framework.FunctionDefLibrary.Builder subBuilder = null; - if (library_ != null) { - subBuilder = library_.toBuilder(); - } - library_ = input.readMessage(org.tensorflow.proto.framework.FunctionDefLibrary.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(library_); - library_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - version_ = input.readInt32(); - break; - } - case 34: { - org.tensorflow.proto.framework.VersionDef.Builder subBuilder = null; - if (versions_ != null) { - subBuilder = versions_.toBuilder(); - } - versions_ = input.readMessage(org.tensorflow.proto.framework.VersionDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(versions_); - versions_ = subBuilder.buildPartial(); - } - - 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)) { - node_ = java.util.Collections.unmodifiableList(node_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphProtos.internal_static_tensorflow_GraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDef.class, org.tensorflow.proto.framework.GraphDef.Builder.class); - } - - public static final int NODE_FIELD_NUMBER = 1; - private java.util.List node_; - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public java.util.List getNodeList() { - return node_; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public java.util.List - getNodeOrBuilderList() { - return node_; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public int getNodeCount() { - return node_.size(); - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDef getNode(int index) { - return node_.get(index); - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDefOrBuilder getNodeOrBuilder( - int index) { - return node_.get(index); - } - - public static final int VERSIONS_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.VersionDef versions_; - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public boolean hasVersions() { - return versions_ != null; - } - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public org.tensorflow.proto.framework.VersionDef getVersions() { - return versions_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder() { - return getVersions(); - } - - public static final int VERSION_FIELD_NUMBER = 3; - private int version_; - /** - *
    -   * Deprecated single version field; use versions above instead.  Since all
    -   * GraphDef changes before "versions" was introduced were forward
    -   * compatible, this field is entirely ignored.
    -   * 
    - * - * int32 version = 3 [deprecated = true]; - */ - @java.lang.Deprecated public int getVersion() { - return version_; - } - - public static final int LIBRARY_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.FunctionDefLibrary library_; - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public boolean hasLibrary() { - return library_ != null; - } - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public org.tensorflow.proto.framework.FunctionDefLibrary getLibrary() { - return library_ == null ? org.tensorflow.proto.framework.FunctionDefLibrary.getDefaultInstance() : library_; - } - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder getLibraryOrBuilder() { - return getLibrary(); - } - - 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 { - for (int i = 0; i < node_.size(); i++) { - output.writeMessage(1, node_.get(i)); - } - if (library_ != null) { - output.writeMessage(2, getLibrary()); - } - if (version_ != 0) { - output.writeInt32(3, version_); - } - if (versions_ != null) { - output.writeMessage(4, getVersions()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < node_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, node_.get(i)); - } - if (library_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getLibrary()); - } - if (version_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, version_); - } - if (versions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getVersions()); - } - 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.GraphDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphDef other = (org.tensorflow.proto.framework.GraphDef) obj; - - if (!getNodeList() - .equals(other.getNodeList())) return false; - if (hasVersions() != other.hasVersions()) return false; - if (hasVersions()) { - if (!getVersions() - .equals(other.getVersions())) return false; - } - if (getVersion() - != other.getVersion()) return false; - if (hasLibrary() != other.hasLibrary()) return false; - if (hasLibrary()) { - if (!getLibrary() - .equals(other.getLibrary())) 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 (getNodeCount() > 0) { - hash = (37 * hash) + NODE_FIELD_NUMBER; - hash = (53 * hash) + getNodeList().hashCode(); - } - if (hasVersions()) { - hash = (37 * hash) + VERSIONS_FIELD_NUMBER; - hash = (53 * hash) + getVersions().hashCode(); - } - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); - if (hasLibrary()) { - hash = (37 * hash) + LIBRARY_FIELD_NUMBER; - hash = (53 * hash) + getLibrary().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDef 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.GraphDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDef 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.GraphDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDef 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.GraphDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDef 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.GraphDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphDef 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.GraphDef 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; - } - /** - *
    -   * Represents the graph of operations
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphDef) - org.tensorflow.proto.framework.GraphDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphProtos.internal_static_tensorflow_GraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphDef.class, org.tensorflow.proto.framework.GraphDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (nodeBuilder_ == null) { - node_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodeBuilder_.clear(); - } - if (versionsBuilder_ == null) { - versions_ = null; - } else { - versions_ = null; - versionsBuilder_ = null; - } - version_ = 0; - - if (libraryBuilder_ == null) { - library_ = null; - } else { - library_ = null; - libraryBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDef build() { - org.tensorflow.proto.framework.GraphDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphDef buildPartial() { - org.tensorflow.proto.framework.GraphDef result = new org.tensorflow.proto.framework.GraphDef(this); - int from_bitField0_ = bitField0_; - if (nodeBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - node_ = java.util.Collections.unmodifiableList(node_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.node_ = node_; - } else { - result.node_ = nodeBuilder_.build(); - } - if (versionsBuilder_ == null) { - result.versions_ = versions_; - } else { - result.versions_ = versionsBuilder_.build(); - } - result.version_ = version_; - if (libraryBuilder_ == null) { - result.library_ = library_; - } else { - result.library_ = libraryBuilder_.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.GraphDef) { - return mergeFrom((org.tensorflow.proto.framework.GraphDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphDef other) { - if (other == org.tensorflow.proto.framework.GraphDef.getDefaultInstance()) return this; - if (nodeBuilder_ == null) { - if (!other.node_.isEmpty()) { - if (node_.isEmpty()) { - node_ = other.node_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodeIsMutable(); - node_.addAll(other.node_); - } - onChanged(); - } - } else { - if (!other.node_.isEmpty()) { - if (nodeBuilder_.isEmpty()) { - nodeBuilder_.dispose(); - nodeBuilder_ = null; - node_ = other.node_; - bitField0_ = (bitField0_ & ~0x00000001); - nodeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeFieldBuilder() : null; - } else { - nodeBuilder_.addAllMessages(other.node_); - } - } - } - if (other.hasVersions()) { - mergeVersions(other.getVersions()); - } - if (other.getVersion() != 0) { - setVersion(other.getVersion()); - } - if (other.hasLibrary()) { - mergeLibrary(other.getLibrary()); - } - 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.GraphDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List node_ = - java.util.Collections.emptyList(); - private void ensureNodeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - node_ = new java.util.ArrayList(node_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder> nodeBuilder_; - - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public java.util.List getNodeList() { - if (nodeBuilder_ == null) { - return java.util.Collections.unmodifiableList(node_); - } else { - return nodeBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public int getNodeCount() { - if (nodeBuilder_ == null) { - return node_.size(); - } else { - return nodeBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDef getNode(int index) { - if (nodeBuilder_ == null) { - return node_.get(index); - } else { - return nodeBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder setNode( - int index, org.tensorflow.proto.framework.NodeDef value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.set(index, value); - onChanged(); - } else { - nodeBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder setNode( - int index, org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder addNode(org.tensorflow.proto.framework.NodeDef value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.add(value); - onChanged(); - } else { - nodeBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder addNode( - int index, org.tensorflow.proto.framework.NodeDef value) { - if (nodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeIsMutable(); - node_.add(index, value); - onChanged(); - } else { - nodeBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder addNode( - org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.add(builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder addNode( - int index, org.tensorflow.proto.framework.NodeDef.Builder builderForValue) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder addAllNode( - java.lang.Iterable values) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, node_); - onChanged(); - } else { - nodeBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder clearNode() { - if (nodeBuilder_ == null) { - node_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodeBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public Builder removeNode(int index) { - if (nodeBuilder_ == null) { - ensureNodeIsMutable(); - node_.remove(index); - onChanged(); - } else { - nodeBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDef.Builder getNodeBuilder( - int index) { - return getNodeFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDefOrBuilder getNodeOrBuilder( - int index) { - if (nodeBuilder_ == null) { - return node_.get(index); } else { - return nodeBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public java.util.List - getNodeOrBuilderList() { - if (nodeBuilder_ != null) { - return nodeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(node_); - } - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDef.Builder addNodeBuilder() { - return getNodeFieldBuilder().addBuilder( - org.tensorflow.proto.framework.NodeDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public org.tensorflow.proto.framework.NodeDef.Builder addNodeBuilder( - int index) { - return getNodeFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.NodeDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeDef node = 1; - */ - public java.util.List - getNodeBuilderList() { - return getNodeFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder> - getNodeFieldBuilder() { - if (nodeBuilder_ == null) { - nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef, org.tensorflow.proto.framework.NodeDef.Builder, org.tensorflow.proto.framework.NodeDefOrBuilder>( - node_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - node_ = null; - } - return nodeBuilder_; - } - - private org.tensorflow.proto.framework.VersionDef versions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> versionsBuilder_; - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public boolean hasVersions() { - return versionsBuilder_ != null || versions_ != null; - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public org.tensorflow.proto.framework.VersionDef getVersions() { - if (versionsBuilder_ == null) { - return versions_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } else { - return versionsBuilder_.getMessage(); - } - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public Builder setVersions(org.tensorflow.proto.framework.VersionDef value) { - if (versionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - versions_ = value; - onChanged(); - } else { - versionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public Builder setVersions( - org.tensorflow.proto.framework.VersionDef.Builder builderForValue) { - if (versionsBuilder_ == null) { - versions_ = builderForValue.build(); - onChanged(); - } else { - versionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public Builder mergeVersions(org.tensorflow.proto.framework.VersionDef value) { - if (versionsBuilder_ == null) { - if (versions_ != null) { - versions_ = - org.tensorflow.proto.framework.VersionDef.newBuilder(versions_).mergeFrom(value).buildPartial(); - } else { - versions_ = value; - } - onChanged(); - } else { - versionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public Builder clearVersions() { - if (versionsBuilder_ == null) { - versions_ = null; - onChanged(); - } else { - versions_ = null; - versionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public org.tensorflow.proto.framework.VersionDef.Builder getVersionsBuilder() { - - onChanged(); - return getVersionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder() { - if (versionsBuilder_ != null) { - return versionsBuilder_.getMessageOrBuilder(); - } else { - return versions_ == null ? - org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } - } - /** - *
    -     * Compatibility versions of the graph.  See core/public/version.h for version
    -     * history.  The GraphDef version is distinct from the TensorFlow version, and
    -     * each release of TensorFlow will support a range of GraphDef versions.
    -     * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> - getVersionsFieldBuilder() { - if (versionsBuilder_ == null) { - versionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder>( - getVersions(), - getParentForChildren(), - isClean()); - versions_ = null; - } - return versionsBuilder_; - } - - private int version_ ; - /** - *
    -     * Deprecated single version field; use versions above instead.  Since all
    -     * GraphDef changes before "versions" was introduced were forward
    -     * compatible, this field is entirely ignored.
    -     * 
    - * - * int32 version = 3 [deprecated = true]; - */ - @java.lang.Deprecated public int getVersion() { - return version_; - } - /** - *
    -     * Deprecated single version field; use versions above instead.  Since all
    -     * GraphDef changes before "versions" was introduced were forward
    -     * compatible, this field is entirely ignored.
    -     * 
    - * - * int32 version = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setVersion(int value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * Deprecated single version field; use versions above instead.  Since all
    -     * GraphDef changes before "versions" was introduced were forward
    -     * compatible, this field is entirely ignored.
    -     * 
    - * - * int32 version = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearVersion() { - - version_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.FunctionDefLibrary library_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDefLibrary, org.tensorflow.proto.framework.FunctionDefLibrary.Builder, org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder> libraryBuilder_; - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public boolean hasLibrary() { - return libraryBuilder_ != null || library_ != null; - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public org.tensorflow.proto.framework.FunctionDefLibrary getLibrary() { - if (libraryBuilder_ == null) { - return library_ == null ? org.tensorflow.proto.framework.FunctionDefLibrary.getDefaultInstance() : library_; - } else { - return libraryBuilder_.getMessage(); - } - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public Builder setLibrary(org.tensorflow.proto.framework.FunctionDefLibrary value) { - if (libraryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - library_ = value; - onChanged(); - } else { - libraryBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public Builder setLibrary( - org.tensorflow.proto.framework.FunctionDefLibrary.Builder builderForValue) { - if (libraryBuilder_ == null) { - library_ = builderForValue.build(); - onChanged(); - } else { - libraryBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public Builder mergeLibrary(org.tensorflow.proto.framework.FunctionDefLibrary value) { - if (libraryBuilder_ == null) { - if (library_ != null) { - library_ = - org.tensorflow.proto.framework.FunctionDefLibrary.newBuilder(library_).mergeFrom(value).buildPartial(); - } else { - library_ = value; - } - onChanged(); - } else { - libraryBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public Builder clearLibrary() { - if (libraryBuilder_ == null) { - library_ = null; - onChanged(); - } else { - library_ = null; - libraryBuilder_ = null; - } - - return this; - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public org.tensorflow.proto.framework.FunctionDefLibrary.Builder getLibraryBuilder() { - - onChanged(); - return getLibraryFieldBuilder().getBuilder(); - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - public org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder getLibraryOrBuilder() { - if (libraryBuilder_ != null) { - return libraryBuilder_.getMessageOrBuilder(); - } else { - return library_ == null ? - org.tensorflow.proto.framework.FunctionDefLibrary.getDefaultInstance() : library_; - } - } - /** - *
    -     * "library" provides user-defined functions.
    -     * Naming:
    -     *   * library.function.name are in a flat namespace.
    -     *     NOTE: We may need to change it to be hierarchical to support
    -     *     different orgs. E.g.,
    -     *     { "/google/nn", { ... }},
    -     *     { "/google/vision", { ... }}
    -     *     { "/org_foo/module_bar", { ... }}
    -     *     map<string, FunctionDefLib> named_lib;
    -     *   * If node[i].op is the name of one function in "library",
    -     *     node[i] is deemed as a function call. Otherwise, node[i].op
    -     *     must be a primitive operation supported by the runtime.
    -     * Function call semantics:
    -     *   * The callee may start execution as soon as some of its inputs
    -     *     are ready. The caller may want to use Tuple() mechanism to
    -     *     ensure all inputs are ready in the same time.
    -     *   * The consumer of return values may start executing as soon as
    -     *     the return values the consumer depends on are ready.  The
    -     *     consumer may want to use Tuple() mechanism to ensure the
    -     *     consumer does not start until all return values of the callee
    -     *     function are ready.
    -     * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDefLibrary, org.tensorflow.proto.framework.FunctionDefLibrary.Builder, org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder> - getLibraryFieldBuilder() { - if (libraryBuilder_ == null) { - libraryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FunctionDefLibrary, org.tensorflow.proto.framework.FunctionDefLibrary.Builder, org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder>( - getLibrary(), - getParentForChildren(), - isClean()); - library_ = null; - } - return libraryBuilder_; - } - @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.GraphDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphDef) - private static final org.tensorflow.proto.framework.GraphDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphDef(); - } - - public static org.tensorflow.proto.framework.GraphDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphDef(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.GraphDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDefOrBuilder.java deleted file mode 100644 index 9aa0a0deb22..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphDefOrBuilder.java +++ /dev/null @@ -1,160 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph.proto - -package org.tensorflow.proto.framework; - -public interface GraphDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphDef) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.NodeDef node = 1; - */ - java.util.List - getNodeList(); - /** - * repeated .tensorflow.NodeDef node = 1; - */ - org.tensorflow.proto.framework.NodeDef getNode(int index); - /** - * repeated .tensorflow.NodeDef node = 1; - */ - int getNodeCount(); - /** - * repeated .tensorflow.NodeDef node = 1; - */ - java.util.List - getNodeOrBuilderList(); - /** - * repeated .tensorflow.NodeDef node = 1; - */ - org.tensorflow.proto.framework.NodeDefOrBuilder getNodeOrBuilder( - int index); - - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - boolean hasVersions(); - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - org.tensorflow.proto.framework.VersionDef getVersions(); - /** - *
    -   * Compatibility versions of the graph.  See core/public/version.h for version
    -   * history.  The GraphDef version is distinct from the TensorFlow version, and
    -   * each release of TensorFlow will support a range of GraphDef versions.
    -   * 
    - * - * .tensorflow.VersionDef versions = 4; - */ - org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder(); - - /** - *
    -   * Deprecated single version field; use versions above instead.  Since all
    -   * GraphDef changes before "versions" was introduced were forward
    -   * compatible, this field is entirely ignored.
    -   * 
    - * - * int32 version = 3 [deprecated = true]; - */ - @java.lang.Deprecated int getVersion(); - - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - boolean hasLibrary(); - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - org.tensorflow.proto.framework.FunctionDefLibrary getLibrary(); - /** - *
    -   * "library" provides user-defined functions.
    -   * Naming:
    -   *   * library.function.name are in a flat namespace.
    -   *     NOTE: We may need to change it to be hierarchical to support
    -   *     different orgs. E.g.,
    -   *     { "/google/nn", { ... }},
    -   *     { "/google/vision", { ... }}
    -   *     { "/org_foo/module_bar", { ... }}
    -   *     map<string, FunctionDefLib> named_lib;
    -   *   * If node[i].op is the name of one function in "library",
    -   *     node[i] is deemed as a function call. Otherwise, node[i].op
    -   *     must be a primitive operation supported by the runtime.
    -   * Function call semantics:
    -   *   * The callee may start execution as soon as some of its inputs
    -   *     are ready. The caller may want to use Tuple() mechanism to
    -   *     ensure all inputs are ready in the same time.
    -   *   * The consumer of return values may start executing as soon as
    -   *     the return values the consumer depends on are ready.  The
    -   *     consumer may want to use Tuple() mechanism to ensure the
    -   *     consumer does not start until all return values of the callee
    -   *     function are ready.
    -   * 
    - * - * .tensorflow.FunctionDefLibrary library = 2; - */ - org.tensorflow.proto.framework.FunctionDefLibraryOrBuilder getLibraryOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptions.java deleted file mode 100644 index 5916d82ca1c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptions.java +++ /dev/null @@ -1,1462 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphOptions} - */ -public final class GraphOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphOptions) - GraphOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphOptions.newBuilder() to construct. - private GraphOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphOptions() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphOptions( - 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 16: { - - enableRecvScheduling_ = input.readBool(); - break; - } - case 26: { - org.tensorflow.proto.framework.OptimizerOptions.Builder subBuilder = null; - if (optimizerOptions_ != null) { - subBuilder = optimizerOptions_.toBuilder(); - } - optimizerOptions_ = input.readMessage(org.tensorflow.proto.framework.OptimizerOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(optimizerOptions_); - optimizerOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 32: { - - buildCostModel_ = input.readInt64(); - break; - } - case 40: { - - inferShapes_ = input.readBool(); - break; - } - case 48: { - - placePrunedGraph_ = input.readBool(); - break; - } - case 56: { - - enableBfloat16Sendrecv_ = input.readBool(); - break; - } - case 64: { - - timelineStep_ = input.readInt32(); - break; - } - case 72: { - - buildCostModelAfter_ = input.readInt64(); - break; - } - case 82: { - org.tensorflow.proto.framework.RewriterConfig.Builder subBuilder = null; - if (rewriteOptions_ != null) { - subBuilder = rewriteOptions_.toBuilder(); - } - rewriteOptions_ = input.readMessage(org.tensorflow.proto.framework.RewriterConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rewriteOptions_); - rewriteOptions_ = subBuilder.buildPartial(); - } - - 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.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphOptions.class, org.tensorflow.proto.framework.GraphOptions.Builder.class); - } - - public static final int ENABLE_RECV_SCHEDULING_FIELD_NUMBER = 2; - private boolean enableRecvScheduling_; - /** - *
    -   * If true, use control flow to schedule the activation of Recv nodes.
    -   * (Currently ignored.)
    -   * 
    - * - * bool enable_recv_scheduling = 2; - */ - public boolean getEnableRecvScheduling() { - return enableRecvScheduling_; - } - - public static final int OPTIMIZER_OPTIONS_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.OptimizerOptions optimizerOptions_; - /** - *
    -   * Options controlling how graph is optimized.
    -   * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public boolean hasOptimizerOptions() { - return optimizerOptions_ != null; - } - /** - *
    -   * Options controlling how graph is optimized.
    -   * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptions getOptimizerOptions() { - return optimizerOptions_ == null ? org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_; - } - /** - *
    -   * Options controlling how graph is optimized.
    -   * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() { - return getOptimizerOptions(); - } - - public static final int BUILD_COST_MODEL_FIELD_NUMBER = 4; - private long buildCostModel_; - /** - *
    -   * The number of steps to run before returning a cost model detailing
    -   * the memory usage and performance of each node of the graph. 0 means
    -   * no cost model.
    -   * 
    - * - * int64 build_cost_model = 4; - */ - public long getBuildCostModel() { - return buildCostModel_; - } - - public static final int BUILD_COST_MODEL_AFTER_FIELD_NUMBER = 9; - private long buildCostModelAfter_; - /** - *
    -   * The number of steps to skip before collecting statistics for the
    -   * cost model.
    -   * 
    - * - * int64 build_cost_model_after = 9; - */ - public long getBuildCostModelAfter() { - return buildCostModelAfter_; - } - - public static final int INFER_SHAPES_FIELD_NUMBER = 5; - private boolean inferShapes_; - /** - *
    -   * Annotate each Node with Op output shape data, to the extent it can
    -   * be statically inferred.
    -   * 
    - * - * bool infer_shapes = 5; - */ - public boolean getInferShapes() { - return inferShapes_; - } - - public static final int PLACE_PRUNED_GRAPH_FIELD_NUMBER = 6; - private boolean placePrunedGraph_; - /** - *
    -   * Only place the subgraphs that are run, rather than the entire graph.
    -   * This is useful for interactive graph building, where one might
    -   * produce graphs that cannot be placed during the debugging
    -   * process.  In particular, it allows the client to continue work in
    -   * a session after adding a node to a graph whose placement
    -   * constraints are unsatisfiable.
    -   * 
    - * - * bool place_pruned_graph = 6; - */ - public boolean getPlacePrunedGraph() { - return placePrunedGraph_; - } - - public static final int ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER = 7; - private boolean enableBfloat16Sendrecv_; - /** - *
    -   * If true, transfer float values between processes as bfloat16.
    -   * 
    - * - * bool enable_bfloat16_sendrecv = 7; - */ - public boolean getEnableBfloat16Sendrecv() { - return enableBfloat16Sendrecv_; - } - - public static final int TIMELINE_STEP_FIELD_NUMBER = 8; - private int timelineStep_; - /** - *
    -   * If > 0, record a timeline every this many steps.
    -   * EXPERIMENTAL: This currently has no effect in MasterSession.
    -   * 
    - * - * int32 timeline_step = 8; - */ - public int getTimelineStep() { - return timelineStep_; - } - - public static final int REWRITE_OPTIONS_FIELD_NUMBER = 10; - private org.tensorflow.proto.framework.RewriterConfig rewriteOptions_; - /** - *
    -   * Options that control the type and amount of graph rewriting.
    -   * Not currently configurable via the public Python API (i.e. there is no API
    -   * stability guarantee if you import RewriterConfig explicitly).
    -   * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public boolean hasRewriteOptions() { - return rewriteOptions_ != null; - } - /** - *
    -   * Options that control the type and amount of graph rewriting.
    -   * Not currently configurable via the public Python API (i.e. there is no API
    -   * stability guarantee if you import RewriterConfig explicitly).
    -   * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public org.tensorflow.proto.framework.RewriterConfig getRewriteOptions() { - return rewriteOptions_ == null ? org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_; - } - /** - *
    -   * Options that control the type and amount of graph rewriting.
    -   * Not currently configurable via the public Python API (i.e. there is no API
    -   * stability guarantee if you import RewriterConfig explicitly).
    -   * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public org.tensorflow.proto.framework.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() { - return getRewriteOptions(); - } - - 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 (enableRecvScheduling_ != false) { - output.writeBool(2, enableRecvScheduling_); - } - if (optimizerOptions_ != null) { - output.writeMessage(3, getOptimizerOptions()); - } - if (buildCostModel_ != 0L) { - output.writeInt64(4, buildCostModel_); - } - if (inferShapes_ != false) { - output.writeBool(5, inferShapes_); - } - if (placePrunedGraph_ != false) { - output.writeBool(6, placePrunedGraph_); - } - if (enableBfloat16Sendrecv_ != false) { - output.writeBool(7, enableBfloat16Sendrecv_); - } - if (timelineStep_ != 0) { - output.writeInt32(8, timelineStep_); - } - if (buildCostModelAfter_ != 0L) { - output.writeInt64(9, buildCostModelAfter_); - } - if (rewriteOptions_ != null) { - output.writeMessage(10, getRewriteOptions()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableRecvScheduling_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, enableRecvScheduling_); - } - if (optimizerOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getOptimizerOptions()); - } - if (buildCostModel_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, buildCostModel_); - } - if (inferShapes_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, inferShapes_); - } - if (placePrunedGraph_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(6, placePrunedGraph_); - } - if (enableBfloat16Sendrecv_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, enableBfloat16Sendrecv_); - } - if (timelineStep_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(8, timelineStep_); - } - if (buildCostModelAfter_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, buildCostModelAfter_); - } - if (rewriteOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, getRewriteOptions()); - } - 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.GraphOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphOptions other = (org.tensorflow.proto.framework.GraphOptions) obj; - - if (getEnableRecvScheduling() - != other.getEnableRecvScheduling()) return false; - if (hasOptimizerOptions() != other.hasOptimizerOptions()) return false; - if (hasOptimizerOptions()) { - if (!getOptimizerOptions() - .equals(other.getOptimizerOptions())) return false; - } - if (getBuildCostModel() - != other.getBuildCostModel()) return false; - if (getBuildCostModelAfter() - != other.getBuildCostModelAfter()) return false; - if (getInferShapes() - != other.getInferShapes()) return false; - if (getPlacePrunedGraph() - != other.getPlacePrunedGraph()) return false; - if (getEnableBfloat16Sendrecv() - != other.getEnableBfloat16Sendrecv()) return false; - if (getTimelineStep() - != other.getTimelineStep()) return false; - if (hasRewriteOptions() != other.hasRewriteOptions()) return false; - if (hasRewriteOptions()) { - if (!getRewriteOptions() - .equals(other.getRewriteOptions())) 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) + ENABLE_RECV_SCHEDULING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableRecvScheduling()); - if (hasOptimizerOptions()) { - hash = (37 * hash) + OPTIMIZER_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getOptimizerOptions().hashCode(); - } - hash = (37 * hash) + BUILD_COST_MODEL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBuildCostModel()); - hash = (37 * hash) + BUILD_COST_MODEL_AFTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBuildCostModelAfter()); - hash = (37 * hash) + INFER_SHAPES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getInferShapes()); - hash = (37 * hash) + PLACE_PRUNED_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getPlacePrunedGraph()); - hash = (37 * hash) + ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableBfloat16Sendrecv()); - hash = (37 * hash) + TIMELINE_STEP_FIELD_NUMBER; - hash = (53 * hash) + getTimelineStep(); - if (hasRewriteOptions()) { - hash = (37 * hash) + REWRITE_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getRewriteOptions().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphOptions 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.GraphOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphOptions 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.GraphOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphOptions 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.GraphOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphOptions 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.GraphOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphOptions 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.GraphOptions 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.GraphOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphOptions) - org.tensorflow.proto.framework.GraphOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphOptions.class, org.tensorflow.proto.framework.GraphOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphOptions.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(); - enableRecvScheduling_ = false; - - if (optimizerOptionsBuilder_ == null) { - optimizerOptions_ = null; - } else { - optimizerOptions_ = null; - optimizerOptionsBuilder_ = null; - } - buildCostModel_ = 0L; - - buildCostModelAfter_ = 0L; - - inferShapes_ = false; - - placePrunedGraph_ = false; - - enableBfloat16Sendrecv_ = false; - - timelineStep_ = 0; - - if (rewriteOptionsBuilder_ == null) { - rewriteOptions_ = null; - } else { - rewriteOptions_ = null; - rewriteOptionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphOptions build() { - org.tensorflow.proto.framework.GraphOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphOptions buildPartial() { - org.tensorflow.proto.framework.GraphOptions result = new org.tensorflow.proto.framework.GraphOptions(this); - result.enableRecvScheduling_ = enableRecvScheduling_; - if (optimizerOptionsBuilder_ == null) { - result.optimizerOptions_ = optimizerOptions_; - } else { - result.optimizerOptions_ = optimizerOptionsBuilder_.build(); - } - result.buildCostModel_ = buildCostModel_; - result.buildCostModelAfter_ = buildCostModelAfter_; - result.inferShapes_ = inferShapes_; - result.placePrunedGraph_ = placePrunedGraph_; - result.enableBfloat16Sendrecv_ = enableBfloat16Sendrecv_; - result.timelineStep_ = timelineStep_; - if (rewriteOptionsBuilder_ == null) { - result.rewriteOptions_ = rewriteOptions_; - } else { - result.rewriteOptions_ = rewriteOptionsBuilder_.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.GraphOptions) { - return mergeFrom((org.tensorflow.proto.framework.GraphOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphOptions other) { - if (other == org.tensorflow.proto.framework.GraphOptions.getDefaultInstance()) return this; - if (other.getEnableRecvScheduling() != false) { - setEnableRecvScheduling(other.getEnableRecvScheduling()); - } - if (other.hasOptimizerOptions()) { - mergeOptimizerOptions(other.getOptimizerOptions()); - } - if (other.getBuildCostModel() != 0L) { - setBuildCostModel(other.getBuildCostModel()); - } - if (other.getBuildCostModelAfter() != 0L) { - setBuildCostModelAfter(other.getBuildCostModelAfter()); - } - if (other.getInferShapes() != false) { - setInferShapes(other.getInferShapes()); - } - if (other.getPlacePrunedGraph() != false) { - setPlacePrunedGraph(other.getPlacePrunedGraph()); - } - if (other.getEnableBfloat16Sendrecv() != false) { - setEnableBfloat16Sendrecv(other.getEnableBfloat16Sendrecv()); - } - if (other.getTimelineStep() != 0) { - setTimelineStep(other.getTimelineStep()); - } - if (other.hasRewriteOptions()) { - mergeRewriteOptions(other.getRewriteOptions()); - } - 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.GraphOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableRecvScheduling_ ; - /** - *
    -     * If true, use control flow to schedule the activation of Recv nodes.
    -     * (Currently ignored.)
    -     * 
    - * - * bool enable_recv_scheduling = 2; - */ - public boolean getEnableRecvScheduling() { - return enableRecvScheduling_; - } - /** - *
    -     * If true, use control flow to schedule the activation of Recv nodes.
    -     * (Currently ignored.)
    -     * 
    - * - * bool enable_recv_scheduling = 2; - */ - public Builder setEnableRecvScheduling(boolean value) { - - enableRecvScheduling_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, use control flow to schedule the activation of Recv nodes.
    -     * (Currently ignored.)
    -     * 
    - * - * bool enable_recv_scheduling = 2; - */ - public Builder clearEnableRecvScheduling() { - - enableRecvScheduling_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.OptimizerOptions optimizerOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder> optimizerOptionsBuilder_; - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public boolean hasOptimizerOptions() { - return optimizerOptionsBuilder_ != null || optimizerOptions_ != null; - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptions getOptimizerOptions() { - if (optimizerOptionsBuilder_ == null) { - return optimizerOptions_ == null ? org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_; - } else { - return optimizerOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public Builder setOptimizerOptions(org.tensorflow.proto.framework.OptimizerOptions value) { - if (optimizerOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - optimizerOptions_ = value; - onChanged(); - } else { - optimizerOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public Builder setOptimizerOptions( - org.tensorflow.proto.framework.OptimizerOptions.Builder builderForValue) { - if (optimizerOptionsBuilder_ == null) { - optimizerOptions_ = builderForValue.build(); - onChanged(); - } else { - optimizerOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public Builder mergeOptimizerOptions(org.tensorflow.proto.framework.OptimizerOptions value) { - if (optimizerOptionsBuilder_ == null) { - if (optimizerOptions_ != null) { - optimizerOptions_ = - org.tensorflow.proto.framework.OptimizerOptions.newBuilder(optimizerOptions_).mergeFrom(value).buildPartial(); - } else { - optimizerOptions_ = value; - } - onChanged(); - } else { - optimizerOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public Builder clearOptimizerOptions() { - if (optimizerOptionsBuilder_ == null) { - optimizerOptions_ = null; - onChanged(); - } else { - optimizerOptions_ = null; - optimizerOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptions.Builder getOptimizerOptionsBuilder() { - - onChanged(); - return getOptimizerOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() { - if (optimizerOptionsBuilder_ != null) { - return optimizerOptionsBuilder_.getMessageOrBuilder(); - } else { - return optimizerOptions_ == null ? - org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_; - } - } - /** - *
    -     * Options controlling how graph is optimized.
    -     * 
    - * - * .tensorflow.OptimizerOptions optimizer_options = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder> - getOptimizerOptionsFieldBuilder() { - if (optimizerOptionsBuilder_ == null) { - optimizerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder>( - getOptimizerOptions(), - getParentForChildren(), - isClean()); - optimizerOptions_ = null; - } - return optimizerOptionsBuilder_; - } - - private long buildCostModel_ ; - /** - *
    -     * The number of steps to run before returning a cost model detailing
    -     * the memory usage and performance of each node of the graph. 0 means
    -     * no cost model.
    -     * 
    - * - * int64 build_cost_model = 4; - */ - public long getBuildCostModel() { - return buildCostModel_; - } - /** - *
    -     * The number of steps to run before returning a cost model detailing
    -     * the memory usage and performance of each node of the graph. 0 means
    -     * no cost model.
    -     * 
    - * - * int64 build_cost_model = 4; - */ - public Builder setBuildCostModel(long value) { - - buildCostModel_ = value; - onChanged(); - return this; - } - /** - *
    -     * The number of steps to run before returning a cost model detailing
    -     * the memory usage and performance of each node of the graph. 0 means
    -     * no cost model.
    -     * 
    - * - * int64 build_cost_model = 4; - */ - public Builder clearBuildCostModel() { - - buildCostModel_ = 0L; - onChanged(); - return this; - } - - private long buildCostModelAfter_ ; - /** - *
    -     * The number of steps to skip before collecting statistics for the
    -     * cost model.
    -     * 
    - * - * int64 build_cost_model_after = 9; - */ - public long getBuildCostModelAfter() { - return buildCostModelAfter_; - } - /** - *
    -     * The number of steps to skip before collecting statistics for the
    -     * cost model.
    -     * 
    - * - * int64 build_cost_model_after = 9; - */ - public Builder setBuildCostModelAfter(long value) { - - buildCostModelAfter_ = value; - onChanged(); - return this; - } - /** - *
    -     * The number of steps to skip before collecting statistics for the
    -     * cost model.
    -     * 
    - * - * int64 build_cost_model_after = 9; - */ - public Builder clearBuildCostModelAfter() { - - buildCostModelAfter_ = 0L; - onChanged(); - return this; - } - - private boolean inferShapes_ ; - /** - *
    -     * Annotate each Node with Op output shape data, to the extent it can
    -     * be statically inferred.
    -     * 
    - * - * bool infer_shapes = 5; - */ - public boolean getInferShapes() { - return inferShapes_; - } - /** - *
    -     * Annotate each Node with Op output shape data, to the extent it can
    -     * be statically inferred.
    -     * 
    - * - * bool infer_shapes = 5; - */ - public Builder setInferShapes(boolean value) { - - inferShapes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Annotate each Node with Op output shape data, to the extent it can
    -     * be statically inferred.
    -     * 
    - * - * bool infer_shapes = 5; - */ - public Builder clearInferShapes() { - - inferShapes_ = false; - onChanged(); - return this; - } - - private boolean placePrunedGraph_ ; - /** - *
    -     * Only place the subgraphs that are run, rather than the entire graph.
    -     * This is useful for interactive graph building, where one might
    -     * produce graphs that cannot be placed during the debugging
    -     * process.  In particular, it allows the client to continue work in
    -     * a session after adding a node to a graph whose placement
    -     * constraints are unsatisfiable.
    -     * 
    - * - * bool place_pruned_graph = 6; - */ - public boolean getPlacePrunedGraph() { - return placePrunedGraph_; - } - /** - *
    -     * Only place the subgraphs that are run, rather than the entire graph.
    -     * This is useful for interactive graph building, where one might
    -     * produce graphs that cannot be placed during the debugging
    -     * process.  In particular, it allows the client to continue work in
    -     * a session after adding a node to a graph whose placement
    -     * constraints are unsatisfiable.
    -     * 
    - * - * bool place_pruned_graph = 6; - */ - public Builder setPlacePrunedGraph(boolean value) { - - placePrunedGraph_ = value; - onChanged(); - return this; - } - /** - *
    -     * Only place the subgraphs that are run, rather than the entire graph.
    -     * This is useful for interactive graph building, where one might
    -     * produce graphs that cannot be placed during the debugging
    -     * process.  In particular, it allows the client to continue work in
    -     * a session after adding a node to a graph whose placement
    -     * constraints are unsatisfiable.
    -     * 
    - * - * bool place_pruned_graph = 6; - */ - public Builder clearPlacePrunedGraph() { - - placePrunedGraph_ = false; - onChanged(); - return this; - } - - private boolean enableBfloat16Sendrecv_ ; - /** - *
    -     * If true, transfer float values between processes as bfloat16.
    -     * 
    - * - * bool enable_bfloat16_sendrecv = 7; - */ - public boolean getEnableBfloat16Sendrecv() { - return enableBfloat16Sendrecv_; - } - /** - *
    -     * If true, transfer float values between processes as bfloat16.
    -     * 
    - * - * bool enable_bfloat16_sendrecv = 7; - */ - public Builder setEnableBfloat16Sendrecv(boolean value) { - - enableBfloat16Sendrecv_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, transfer float values between processes as bfloat16.
    -     * 
    - * - * bool enable_bfloat16_sendrecv = 7; - */ - public Builder clearEnableBfloat16Sendrecv() { - - enableBfloat16Sendrecv_ = false; - onChanged(); - return this; - } - - private int timelineStep_ ; - /** - *
    -     * If > 0, record a timeline every this many steps.
    -     * EXPERIMENTAL: This currently has no effect in MasterSession.
    -     * 
    - * - * int32 timeline_step = 8; - */ - public int getTimelineStep() { - return timelineStep_; - } - /** - *
    -     * If > 0, record a timeline every this many steps.
    -     * EXPERIMENTAL: This currently has no effect in MasterSession.
    -     * 
    - * - * int32 timeline_step = 8; - */ - public Builder setTimelineStep(int value) { - - timelineStep_ = value; - onChanged(); - return this; - } - /** - *
    -     * If > 0, record a timeline every this many steps.
    -     * EXPERIMENTAL: This currently has no effect in MasterSession.
    -     * 
    - * - * int32 timeline_step = 8; - */ - public Builder clearTimelineStep() { - - timelineStep_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.RewriterConfig rewriteOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder> rewriteOptionsBuilder_; - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public boolean hasRewriteOptions() { - return rewriteOptionsBuilder_ != null || rewriteOptions_ != null; - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public org.tensorflow.proto.framework.RewriterConfig getRewriteOptions() { - if (rewriteOptionsBuilder_ == null) { - return rewriteOptions_ == null ? org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_; - } else { - return rewriteOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public Builder setRewriteOptions(org.tensorflow.proto.framework.RewriterConfig value) { - if (rewriteOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - rewriteOptions_ = value; - onChanged(); - } else { - rewriteOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public Builder setRewriteOptions( - org.tensorflow.proto.framework.RewriterConfig.Builder builderForValue) { - if (rewriteOptionsBuilder_ == null) { - rewriteOptions_ = builderForValue.build(); - onChanged(); - } else { - rewriteOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public Builder mergeRewriteOptions(org.tensorflow.proto.framework.RewriterConfig value) { - if (rewriteOptionsBuilder_ == null) { - if (rewriteOptions_ != null) { - rewriteOptions_ = - org.tensorflow.proto.framework.RewriterConfig.newBuilder(rewriteOptions_).mergeFrom(value).buildPartial(); - } else { - rewriteOptions_ = value; - } - onChanged(); - } else { - rewriteOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public Builder clearRewriteOptions() { - if (rewriteOptionsBuilder_ == null) { - rewriteOptions_ = null; - onChanged(); - } else { - rewriteOptions_ = null; - rewriteOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public org.tensorflow.proto.framework.RewriterConfig.Builder getRewriteOptionsBuilder() { - - onChanged(); - return getRewriteOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - public org.tensorflow.proto.framework.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() { - if (rewriteOptionsBuilder_ != null) { - return rewriteOptionsBuilder_.getMessageOrBuilder(); - } else { - return rewriteOptions_ == null ? - org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_; - } - } - /** - *
    -     * Options that control the type and amount of graph rewriting.
    -     * Not currently configurable via the public Python API (i.e. there is no API
    -     * stability guarantee if you import RewriterConfig explicitly).
    -     * 
    - * - * .tensorflow.RewriterConfig rewrite_options = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder> - getRewriteOptionsFieldBuilder() { - if (rewriteOptionsBuilder_ == null) { - rewriteOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder>( - getRewriteOptions(), - getParentForChildren(), - isClean()); - rewriteOptions_ = null; - } - return rewriteOptionsBuilder_; - } - @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.GraphOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphOptions) - private static final org.tensorflow.proto.framework.GraphOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphOptions(); - } - - public static org.tensorflow.proto.framework.GraphOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphOptions(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.GraphOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphProtos.java deleted file mode 100644 index 43eba4ee9bd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphProtos.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph.proto - -package org.tensorflow.proto.framework; - -public final class GraphProtos { - private GraphProtos() {} - 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_GraphDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphDef_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/framework/graph.proto\022" + - "\ntensorflow\032(tensorflow/core/framework/f" + - "unction.proto\032(tensorflow/core/framework" + - "/node_def.proto\032(tensorflow/core/framewo" + - "rk/versions.proto\"\235\001\n\010GraphDef\022!\n\004node\030\001" + - " \003(\0132\023.tensorflow.NodeDef\022(\n\010versions\030\004 " + - "\001(\0132\026.tensorflow.VersionDef\022\023\n\007version\030\003" + - " \001(\005B\002\030\001\022/\n\007library\030\002 \001(\0132\036.tensorflow.F" + - "unctionDefLibraryB\200\001\n\036org.tensorflow.pro" + - "to.frameworkB\013GraphProtosP\001ZLgithub.com/" + - "tensorflow/tensorflow/tensorflow/go/core" + - "/framework/graph_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.FunctionProtos.getDescriptor(), - org.tensorflow.proto.framework.NodeProto.getDescriptor(), - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(), - }); - internal_static_tensorflow_GraphDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_GraphDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphDef_descriptor, - new java.lang.String[] { "Node", "Versions", "Version", "Library", }); - org.tensorflow.proto.framework.FunctionProtos.getDescriptor(); - org.tensorflow.proto.framework.NodeProto.getDescriptor(); - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfo.java deleted file mode 100644 index a1564a2090a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfo.java +++ /dev/null @@ -1,912 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferConstNodeInfo} - */ -public final class GraphTransferConstNodeInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferConstNodeInfo) - GraphTransferConstNodeInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferConstNodeInfo.newBuilder() to construct. - private GraphTransferConstNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferConstNodeInfo() { - name_ = ""; - shape_ = emptyLongList(); - data_ = com.google.protobuf.ByteString.EMPTY; - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferConstNodeInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferConstNodeInfo( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 24: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - shape_.addLong(input.readInt64()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - shape_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 34: { - - data_ = input.readBytes(); - break; - } - case 40: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - 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)) { - shape_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferConstNodeInfo.class, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 NODE_ID_FIELD_NUMBER = 2; - private int nodeId_; - /** - * int32 node_id = 2; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int SHAPE_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.LongList shape_; - /** - * repeated int64 shape = 3; - */ - public java.util.List - getShapeList() { - return shape_; - } - /** - * repeated int64 shape = 3; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 3; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - private int shapeMemoizedSerializedSize = -1; - - public static final int DATA_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString data_; - /** - * bytes data = 4; - */ - public com.google.protobuf.ByteString getData() { - return data_; - } - - public static final int DTYPE_FIELD_NUMBER = 5; - private int dtype_; - /** - * .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - 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 { - getSerializedSize(); - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (nodeId_ != 0) { - output.writeInt32(2, nodeId_); - } - if (getShapeList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(shapeMemoizedSerializedSize); - } - for (int i = 0; i < shape_.size(); i++) { - output.writeInt64NoTag(shape_.getLong(i)); - } - if (!data_.isEmpty()) { - output.writeBytes(4, data_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(5, dtype_); - } - 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 (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, nodeId_); - } - { - int dataSize = 0; - for (int i = 0; i < shape_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(shape_.getLong(i)); - } - size += dataSize; - if (!getShapeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - shapeMemoizedSerializedSize = dataSize; - } - if (!data_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, data_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, dtype_); - } - 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.GraphTransferConstNodeInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferConstNodeInfo other = (org.tensorflow.proto.framework.GraphTransferConstNodeInfo) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getNodeId() - != other.getNodeId()) return false; - if (!getShapeList() - .equals(other.getShapeList())) return false; - if (!getData() - .equals(other.getData())) return false; - if (dtype_ != other.dtype_) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - if (getShapeCount() > 0) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShapeList().hashCode(); - } - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getData().hashCode(); - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferConstNodeInfo) - org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferConstNodeInfo.class, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferConstNodeInfo.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_ = ""; - - nodeId_ = 0; - - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - data_ = com.google.protobuf.ByteString.EMPTY; - - dtype_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferConstNodeInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo build() { - org.tensorflow.proto.framework.GraphTransferConstNodeInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferConstNodeInfo result = new org.tensorflow.proto.framework.GraphTransferConstNodeInfo(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.nodeId_ = nodeId_; - if (((bitField0_ & 0x00000001) != 0)) { - shape_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.shape_ = shape_; - result.data_ = data_; - result.dtype_ = dtype_; - 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.GraphTransferConstNodeInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferConstNodeInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferConstNodeInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferConstNodeInfo.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (!other.shape_.isEmpty()) { - if (shape_.isEmpty()) { - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureShapeIsMutable(); - shape_.addAll(other.shape_); - } - onChanged(); - } - if (other.getData() != com.google.protobuf.ByteString.EMPTY) { - setData(other.getData()); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - 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.GraphTransferConstNodeInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferConstNodeInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 nodeId_ ; - /** - * int32 node_id = 2; - */ - public int getNodeId() { - return nodeId_; - } - /** - * int32 node_id = 2; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - * int32 node_id = 2; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList shape_ = emptyLongList(); - private void ensureShapeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - shape_ = mutableCopy(shape_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 shape = 3; - */ - public java.util.List - getShapeList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(shape_) : shape_; - } - /** - * repeated int64 shape = 3; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 3; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - /** - * repeated int64 shape = 3; - */ - public Builder setShape( - int index, long value) { - ensureShapeIsMutable(); - shape_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 3; - */ - public Builder addShape(long value) { - ensureShapeIsMutable(); - shape_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 3; - */ - public Builder addAllShape( - java.lang.Iterable values) { - ensureShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, shape_); - onChanged(); - return this; - } - /** - * repeated int64 shape = 3; - */ - public Builder clearShape() { - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes data = 4; - */ - public com.google.protobuf.ByteString getData() { - return data_; - } - /** - * bytes data = 4; - */ - public Builder setData(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - data_ = value; - onChanged(); - return this; - } - /** - * bytes data = 4; - */ - public Builder clearData() { - - data_ = getDefaultInstance().getData(); - onChanged(); - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 5; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 5; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 5; - */ - public Builder clearDtype() { - - dtype_ = 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.GraphTransferConstNodeInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferConstNodeInfo) - private static final org.tensorflow.proto.framework.GraphTransferConstNodeInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferConstNodeInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferConstNodeInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferConstNodeInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferConstNodeInfo(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.GraphTransferConstNodeInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfoOrBuilder.java deleted file mode 100644 index ec0b9e60f90..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferConstNodeInfoOrBuilder.java +++ /dev/null @@ -1,51 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferConstNodeInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferConstNodeInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * int32 node_id = 2; - */ - int getNodeId(); - - /** - * repeated int64 shape = 3; - */ - java.util.List getShapeList(); - /** - * repeated int64 shape = 3; - */ - int getShapeCount(); - /** - * repeated int64 shape = 3; - */ - long getShape(int index); - - /** - * bytes data = 4; - */ - com.google.protobuf.ByteString getData(); - - /** - * .tensorflow.DataType dtype = 5; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 5; - */ - org.tensorflow.proto.framework.DataType getDtype(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfo.java deleted file mode 100644 index b4d12c201b5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfo.java +++ /dev/null @@ -1,794 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferGraphInputNodeInfo} - */ -public final class GraphTransferGraphInputNodeInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferGraphInputNodeInfo) - GraphTransferGraphInputNodeInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferGraphInputNodeInfo.newBuilder() to construct. - private GraphTransferGraphInputNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferGraphInputNodeInfo() { - name_ = ""; - shape_ = emptyLongList(); - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferGraphInputNodeInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferGraphInputNodeInfo( - 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: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - shape_.addLong(input.readInt64()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - shape_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 24: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - 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)) { - shape_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.class, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 SHAPE_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.LongList shape_; - /** - * repeated int64 shape = 2; - */ - public java.util.List - getShapeList() { - return shape_; - } - /** - * repeated int64 shape = 2; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 2; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - private int shapeMemoizedSerializedSize = -1; - - public static final int DTYPE_FIELD_NUMBER = 3; - private int dtype_; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - 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 { - getSerializedSize(); - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (getShapeList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(shapeMemoizedSerializedSize); - } - for (int i = 0; i < shape_.size(); i++) { - output.writeInt64NoTag(shape_.getLong(i)); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, dtype_); - } - 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_); - } - { - int dataSize = 0; - for (int i = 0; i < shape_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(shape_.getLong(i)); - } - size += dataSize; - if (!getShapeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - shapeMemoizedSerializedSize = dataSize; - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, dtype_); - } - 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.GraphTransferGraphInputNodeInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo other = (org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getShapeList() - .equals(other.getShapeList())) return false; - if (dtype_ != other.dtype_) 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(); - if (getShapeCount() > 0) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShapeList().hashCode(); - } - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferGraphInputNodeInfo) - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.class, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.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_ = ""; - - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - dtype_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo build() { - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo result = new org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (((bitField0_ & 0x00000001) != 0)) { - shape_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.shape_ = shape_; - result.dtype_ = dtype_; - 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.GraphTransferGraphInputNodeInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.shape_.isEmpty()) { - if (shape_.isEmpty()) { - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureShapeIsMutable(); - shape_.addAll(other.shape_); - } - onChanged(); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - 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.GraphTransferGraphInputNodeInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 com.google.protobuf.Internal.LongList shape_ = emptyLongList(); - private void ensureShapeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - shape_ = mutableCopy(shape_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 shape = 2; - */ - public java.util.List - getShapeList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(shape_) : shape_; - } - /** - * repeated int64 shape = 2; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 2; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - /** - * repeated int64 shape = 2; - */ - public Builder setShape( - int index, long value) { - ensureShapeIsMutable(); - shape_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder addShape(long value) { - ensureShapeIsMutable(); - shape_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder addAllShape( - java.lang.Iterable values) { - ensureShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, shape_); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder clearShape() { - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder clearDtype() { - - dtype_ = 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.GraphTransferGraphInputNodeInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferGraphInputNodeInfo) - private static final org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferGraphInputNodeInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferGraphInputNodeInfo(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.GraphTransferGraphInputNodeInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfoOrBuilder.java deleted file mode 100644 index c121353b111..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphInputNodeInfoOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferGraphInputNodeInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferGraphInputNodeInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated int64 shape = 2; - */ - java.util.List getShapeList(); - /** - * repeated int64 shape = 2; - */ - int getShapeCount(); - /** - * repeated int64 shape = 2; - */ - long getShape(int index); - - /** - * .tensorflow.DataType dtype = 3; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 3; - */ - org.tensorflow.proto.framework.DataType getDtype(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfo.java deleted file mode 100644 index 78bf270776e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfo.java +++ /dev/null @@ -1,794 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferGraphOutputNodeInfo} - */ -public final class GraphTransferGraphOutputNodeInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferGraphOutputNodeInfo) - GraphTransferGraphOutputNodeInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferGraphOutputNodeInfo.newBuilder() to construct. - private GraphTransferGraphOutputNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferGraphOutputNodeInfo() { - name_ = ""; - shape_ = emptyLongList(); - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferGraphOutputNodeInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferGraphOutputNodeInfo( - 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: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - shape_.addLong(input.readInt64()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - shape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - shape_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 24: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - 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)) { - shape_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.class, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 SHAPE_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.LongList shape_; - /** - * repeated int64 shape = 2; - */ - public java.util.List - getShapeList() { - return shape_; - } - /** - * repeated int64 shape = 2; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 2; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - private int shapeMemoizedSerializedSize = -1; - - public static final int DTYPE_FIELD_NUMBER = 3; - private int dtype_; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - 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 { - getSerializedSize(); - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (getShapeList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(shapeMemoizedSerializedSize); - } - for (int i = 0; i < shape_.size(); i++) { - output.writeInt64NoTag(shape_.getLong(i)); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, dtype_); - } - 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_); - } - { - int dataSize = 0; - for (int i = 0; i < shape_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(shape_.getLong(i)); - } - size += dataSize; - if (!getShapeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - shapeMemoizedSerializedSize = dataSize; - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, dtype_); - } - 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.GraphTransferGraphOutputNodeInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo other = (org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getShapeList() - .equals(other.getShapeList())) return false; - if (dtype_ != other.dtype_) 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(); - if (getShapeCount() > 0) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShapeList().hashCode(); - } - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferGraphOutputNodeInfo) - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.class, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.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_ = ""; - - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - dtype_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo build() { - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo result = new org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (((bitField0_ & 0x00000001) != 0)) { - shape_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.shape_ = shape_; - result.dtype_ = dtype_; - 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.GraphTransferGraphOutputNodeInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.shape_.isEmpty()) { - if (shape_.isEmpty()) { - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureShapeIsMutable(); - shape_.addAll(other.shape_); - } - onChanged(); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - 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.GraphTransferGraphOutputNodeInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 com.google.protobuf.Internal.LongList shape_ = emptyLongList(); - private void ensureShapeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - shape_ = mutableCopy(shape_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 shape = 2; - */ - public java.util.List - getShapeList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(shape_) : shape_; - } - /** - * repeated int64 shape = 2; - */ - public int getShapeCount() { - return shape_.size(); - } - /** - * repeated int64 shape = 2; - */ - public long getShape(int index) { - return shape_.getLong(index); - } - /** - * repeated int64 shape = 2; - */ - public Builder setShape( - int index, long value) { - ensureShapeIsMutable(); - shape_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder addShape(long value) { - ensureShapeIsMutable(); - shape_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder addAllShape( - java.lang.Iterable values) { - ensureShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, shape_); - onChanged(); - return this; - } - /** - * repeated int64 shape = 2; - */ - public Builder clearShape() { - shape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder clearDtype() { - - dtype_ = 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.GraphTransferGraphOutputNodeInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferGraphOutputNodeInfo) - private static final org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferGraphOutputNodeInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferGraphOutputNodeInfo(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.GraphTransferGraphOutputNodeInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfoOrBuilder.java deleted file mode 100644 index 3fcf3f3ae7e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferGraphOutputNodeInfoOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferGraphOutputNodeInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferGraphOutputNodeInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated int64 shape = 2; - */ - java.util.List getShapeList(); - /** - * repeated int64 shape = 2; - */ - int getShapeCount(); - /** - * repeated int64 shape = 2; - */ - long getShape(int index); - - /** - * .tensorflow.DataType dtype = 3; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 3; - */ - org.tensorflow.proto.framework.DataType getDtype(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfo.java deleted file mode 100644 index f9d53390a8b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfo.java +++ /dev/null @@ -1,2795 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a handle to a tensorflow resource. Handles are
    - * not valid across executions, but can be serialized back and forth from within
    - * a single run.
    - * 
    - * - * Protobuf type {@code tensorflow.GraphTransferInfo} - */ -public final class GraphTransferInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferInfo) - GraphTransferInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferInfo.newBuilder() to construct. - private GraphTransferInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferInfo() { - nodeInfo_ = java.util.Collections.emptyList(); - constNodeInfo_ = java.util.Collections.emptyList(); - nodeInputInfo_ = java.util.Collections.emptyList(); - nodeOutputInfo_ = java.util.Collections.emptyList(); - graphInputNodeInfo_ = java.util.Collections.emptyList(); - graphOutputNodeInfo_ = java.util.Collections.emptyList(); - destination_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferInfo( - 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)) { - nodeInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nodeInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferNodeInfo.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - constNodeInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - constNodeInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferConstNodeInfo.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - nodeInputInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - nodeInputInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferNodeInputInfo.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - nodeOutputInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - nodeOutputInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - graphInputNodeInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - graphInputNodeInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - graphOutputNodeInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - graphOutputNodeInfo_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.parser(), extensionRegistry)); - break; - } - case 56: { - int rawValue = input.readEnum(); - - destination_ = rawValue; - 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)) { - nodeInfo_ = java.util.Collections.unmodifiableList(nodeInfo_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - constNodeInfo_ = java.util.Collections.unmodifiableList(constNodeInfo_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - nodeInputInfo_ = java.util.Collections.unmodifiableList(nodeInputInfo_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - nodeOutputInfo_ = java.util.Collections.unmodifiableList(nodeOutputInfo_); - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - graphInputNodeInfo_ = java.util.Collections.unmodifiableList(graphInputNodeInfo_); - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - graphOutputNodeInfo_ = java.util.Collections.unmodifiableList(graphOutputNodeInfo_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferInfo.class, org.tensorflow.proto.framework.GraphTransferInfo.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.GraphTransferInfo.Destination} - */ - public enum Destination - implements com.google.protobuf.ProtocolMessageEnum { - /** - * NOP = 0; - */ - NOP(0), - /** - * HEXAGON = 1; - */ - HEXAGON(1), - UNRECOGNIZED(-1), - ; - - /** - * NOP = 0; - */ - public static final int NOP_VALUE = 0; - /** - * HEXAGON = 1; - */ - public static final int HEXAGON_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 Destination valueOf(int value) { - return forNumber(value); - } - - public static Destination forNumber(int value) { - switch (value) { - case 0: return NOP; - case 1: return HEXAGON; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Destination> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Destination findValueByNumber(int number) { - return Destination.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.GraphTransferInfo.getDescriptor().getEnumTypes().get(0); - } - - private static final Destination[] VALUES = values(); - - public static Destination 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 Destination(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.GraphTransferInfo.Destination) - } - - public static final int NODE_INFO_FIELD_NUMBER = 1; - private java.util.List nodeInfo_; - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public java.util.List getNodeInfoList() { - return nodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public java.util.List - getNodeInfoOrBuilderList() { - return nodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public int getNodeInfoCount() { - return nodeInfo_.size(); - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfo getNodeInfo(int index) { - return nodeInfo_.get(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( - int index) { - return nodeInfo_.get(index); - } - - public static final int CONST_NODE_INFO_FIELD_NUMBER = 2; - private java.util.List constNodeInfo_; - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public java.util.List getConstNodeInfoList() { - return constNodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public java.util.List - getConstNodeInfoOrBuilderList() { - return constNodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public int getConstNodeInfoCount() { - return constNodeInfo_.size(); - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo getConstNodeInfo(int index) { - return constNodeInfo_.get(index); - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( - int index) { - return constNodeInfo_.get(index); - } - - public static final int NODE_INPUT_INFO_FIELD_NUMBER = 3; - private java.util.List nodeInputInfo_; - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public java.util.List getNodeInputInfoList() { - return nodeInputInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public java.util.List - getNodeInputInfoOrBuilderList() { - return nodeInputInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public int getNodeInputInfoCount() { - return nodeInputInfo_.size(); - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo getNodeInputInfo(int index) { - return nodeInputInfo_.get(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( - int index) { - return nodeInputInfo_.get(index); - } - - public static final int NODE_OUTPUT_INFO_FIELD_NUMBER = 4; - private java.util.List nodeOutputInfo_; - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public java.util.List getNodeOutputInfoList() { - return nodeOutputInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public java.util.List - getNodeOutputInfoOrBuilderList() { - return nodeOutputInfo_; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public int getNodeOutputInfoCount() { - return nodeOutputInfo_.size(); - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo getNodeOutputInfo(int index) { - return nodeOutputInfo_.get(index); - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( - int index) { - return nodeOutputInfo_.get(index); - } - - public static final int GRAPH_INPUT_NODE_INFO_FIELD_NUMBER = 5; - private java.util.List graphInputNodeInfo_; - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public java.util.List getGraphInputNodeInfoList() { - return graphInputNodeInfo_; - } - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public java.util.List - getGraphInputNodeInfoOrBuilderList() { - return graphInputNodeInfo_; - } - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public int getGraphInputNodeInfoCount() { - return graphInputNodeInfo_.size(); - } - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index) { - return graphInputNodeInfo_.get(index); - } - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( - int index) { - return graphInputNodeInfo_.get(index); - } - - public static final int GRAPH_OUTPUT_NODE_INFO_FIELD_NUMBER = 6; - private java.util.List graphOutputNodeInfo_; - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public java.util.List getGraphOutputNodeInfoList() { - return graphOutputNodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public java.util.List - getGraphOutputNodeInfoOrBuilderList() { - return graphOutputNodeInfo_; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public int getGraphOutputNodeInfoCount() { - return graphOutputNodeInfo_.size(); - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index) { - return graphOutputNodeInfo_.get(index); - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( - int index) { - return graphOutputNodeInfo_.get(index); - } - - public static final int DESTINATION_FIELD_NUMBER = 7; - private int destination_; - /** - *
    -   * Destination of graph transfer
    -   * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public int getDestinationValue() { - return destination_; - } - /** - *
    -   * Destination of graph transfer
    -   * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public org.tensorflow.proto.framework.GraphTransferInfo.Destination getDestination() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.GraphTransferInfo.Destination result = org.tensorflow.proto.framework.GraphTransferInfo.Destination.valueOf(destination_); - return result == null ? org.tensorflow.proto.framework.GraphTransferInfo.Destination.UNRECOGNIZED : result; - } - - 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 { - for (int i = 0; i < nodeInfo_.size(); i++) { - output.writeMessage(1, nodeInfo_.get(i)); - } - for (int i = 0; i < constNodeInfo_.size(); i++) { - output.writeMessage(2, constNodeInfo_.get(i)); - } - for (int i = 0; i < nodeInputInfo_.size(); i++) { - output.writeMessage(3, nodeInputInfo_.get(i)); - } - for (int i = 0; i < nodeOutputInfo_.size(); i++) { - output.writeMessage(4, nodeOutputInfo_.get(i)); - } - for (int i = 0; i < graphInputNodeInfo_.size(); i++) { - output.writeMessage(5, graphInputNodeInfo_.get(i)); - } - for (int i = 0; i < graphOutputNodeInfo_.size(); i++) { - output.writeMessage(6, graphOutputNodeInfo_.get(i)); - } - if (destination_ != org.tensorflow.proto.framework.GraphTransferInfo.Destination.NOP.getNumber()) { - output.writeEnum(7, destination_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < nodeInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, nodeInfo_.get(i)); - } - for (int i = 0; i < constNodeInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, constNodeInfo_.get(i)); - } - for (int i = 0; i < nodeInputInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, nodeInputInfo_.get(i)); - } - for (int i = 0; i < nodeOutputInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, nodeOutputInfo_.get(i)); - } - for (int i = 0; i < graphInputNodeInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, graphInputNodeInfo_.get(i)); - } - for (int i = 0; i < graphOutputNodeInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, graphOutputNodeInfo_.get(i)); - } - if (destination_ != org.tensorflow.proto.framework.GraphTransferInfo.Destination.NOP.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, destination_); - } - 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.GraphTransferInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferInfo other = (org.tensorflow.proto.framework.GraphTransferInfo) obj; - - if (!getNodeInfoList() - .equals(other.getNodeInfoList())) return false; - if (!getConstNodeInfoList() - .equals(other.getConstNodeInfoList())) return false; - if (!getNodeInputInfoList() - .equals(other.getNodeInputInfoList())) return false; - if (!getNodeOutputInfoList() - .equals(other.getNodeOutputInfoList())) return false; - if (!getGraphInputNodeInfoList() - .equals(other.getGraphInputNodeInfoList())) return false; - if (!getGraphOutputNodeInfoList() - .equals(other.getGraphOutputNodeInfoList())) return false; - if (destination_ != other.destination_) 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 (getNodeInfoCount() > 0) { - hash = (37 * hash) + NODE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getNodeInfoList().hashCode(); - } - if (getConstNodeInfoCount() > 0) { - hash = (37 * hash) + CONST_NODE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getConstNodeInfoList().hashCode(); - } - if (getNodeInputInfoCount() > 0) { - hash = (37 * hash) + NODE_INPUT_INFO_FIELD_NUMBER; - hash = (53 * hash) + getNodeInputInfoList().hashCode(); - } - if (getNodeOutputInfoCount() > 0) { - hash = (37 * hash) + NODE_OUTPUT_INFO_FIELD_NUMBER; - hash = (53 * hash) + getNodeOutputInfoList().hashCode(); - } - if (getGraphInputNodeInfoCount() > 0) { - hash = (37 * hash) + GRAPH_INPUT_NODE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getGraphInputNodeInfoList().hashCode(); - } - if (getGraphOutputNodeInfoCount() > 0) { - hash = (37 * hash) + GRAPH_OUTPUT_NODE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getGraphOutputNodeInfoList().hashCode(); - } - hash = (37 * hash) + DESTINATION_FIELD_NUMBER; - hash = (53 * hash) + destination_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferInfo 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.GraphTransferInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferInfo 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.GraphTransferInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferInfo 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.GraphTransferInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferInfo 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.GraphTransferInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferInfo 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.GraphTransferInfo 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; - } - /** - *
    -   * Protocol buffer representing a handle to a tensorflow resource. Handles are
    -   * not valid across executions, but can be serialized back and forth from within
    -   * a single run.
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphTransferInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferInfo) - org.tensorflow.proto.framework.GraphTransferInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferInfo.class, org.tensorflow.proto.framework.GraphTransferInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeInfoFieldBuilder(); - getConstNodeInfoFieldBuilder(); - getNodeInputInfoFieldBuilder(); - getNodeOutputInfoFieldBuilder(); - getGraphInputNodeInfoFieldBuilder(); - getGraphOutputNodeInfoFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (nodeInfoBuilder_ == null) { - nodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodeInfoBuilder_.clear(); - } - if (constNodeInfoBuilder_ == null) { - constNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - constNodeInfoBuilder_.clear(); - } - if (nodeInputInfoBuilder_ == null) { - nodeInputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - nodeInputInfoBuilder_.clear(); - } - if (nodeOutputInfoBuilder_ == null) { - nodeOutputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - nodeOutputInfoBuilder_.clear(); - } - if (graphInputNodeInfoBuilder_ == null) { - graphInputNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - graphInputNodeInfoBuilder_.clear(); - } - if (graphOutputNodeInfoBuilder_ == null) { - graphOutputNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - } else { - graphOutputNodeInfoBuilder_.clear(); - } - destination_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferInfo build() { - org.tensorflow.proto.framework.GraphTransferInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferInfo result = new org.tensorflow.proto.framework.GraphTransferInfo(this); - int from_bitField0_ = bitField0_; - if (nodeInfoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nodeInfo_ = java.util.Collections.unmodifiableList(nodeInfo_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nodeInfo_ = nodeInfo_; - } else { - result.nodeInfo_ = nodeInfoBuilder_.build(); - } - if (constNodeInfoBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - constNodeInfo_ = java.util.Collections.unmodifiableList(constNodeInfo_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.constNodeInfo_ = constNodeInfo_; - } else { - result.constNodeInfo_ = constNodeInfoBuilder_.build(); - } - if (nodeInputInfoBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - nodeInputInfo_ = java.util.Collections.unmodifiableList(nodeInputInfo_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.nodeInputInfo_ = nodeInputInfo_; - } else { - result.nodeInputInfo_ = nodeInputInfoBuilder_.build(); - } - if (nodeOutputInfoBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - nodeOutputInfo_ = java.util.Collections.unmodifiableList(nodeOutputInfo_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.nodeOutputInfo_ = nodeOutputInfo_; - } else { - result.nodeOutputInfo_ = nodeOutputInfoBuilder_.build(); - } - if (graphInputNodeInfoBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { - graphInputNodeInfo_ = java.util.Collections.unmodifiableList(graphInputNodeInfo_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.graphInputNodeInfo_ = graphInputNodeInfo_; - } else { - result.graphInputNodeInfo_ = graphInputNodeInfoBuilder_.build(); - } - if (graphOutputNodeInfoBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { - graphOutputNodeInfo_ = java.util.Collections.unmodifiableList(graphOutputNodeInfo_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.graphOutputNodeInfo_ = graphOutputNodeInfo_; - } else { - result.graphOutputNodeInfo_ = graphOutputNodeInfoBuilder_.build(); - } - result.destination_ = destination_; - 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.GraphTransferInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferInfo.getDefaultInstance()) return this; - if (nodeInfoBuilder_ == null) { - if (!other.nodeInfo_.isEmpty()) { - if (nodeInfo_.isEmpty()) { - nodeInfo_ = other.nodeInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodeInfoIsMutable(); - nodeInfo_.addAll(other.nodeInfo_); - } - onChanged(); - } - } else { - if (!other.nodeInfo_.isEmpty()) { - if (nodeInfoBuilder_.isEmpty()) { - nodeInfoBuilder_.dispose(); - nodeInfoBuilder_ = null; - nodeInfo_ = other.nodeInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - nodeInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeInfoFieldBuilder() : null; - } else { - nodeInfoBuilder_.addAllMessages(other.nodeInfo_); - } - } - } - if (constNodeInfoBuilder_ == null) { - if (!other.constNodeInfo_.isEmpty()) { - if (constNodeInfo_.isEmpty()) { - constNodeInfo_ = other.constNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureConstNodeInfoIsMutable(); - constNodeInfo_.addAll(other.constNodeInfo_); - } - onChanged(); - } - } else { - if (!other.constNodeInfo_.isEmpty()) { - if (constNodeInfoBuilder_.isEmpty()) { - constNodeInfoBuilder_.dispose(); - constNodeInfoBuilder_ = null; - constNodeInfo_ = other.constNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - constNodeInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConstNodeInfoFieldBuilder() : null; - } else { - constNodeInfoBuilder_.addAllMessages(other.constNodeInfo_); - } - } - } - if (nodeInputInfoBuilder_ == null) { - if (!other.nodeInputInfo_.isEmpty()) { - if (nodeInputInfo_.isEmpty()) { - nodeInputInfo_ = other.nodeInputInfo_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.addAll(other.nodeInputInfo_); - } - onChanged(); - } - } else { - if (!other.nodeInputInfo_.isEmpty()) { - if (nodeInputInfoBuilder_.isEmpty()) { - nodeInputInfoBuilder_.dispose(); - nodeInputInfoBuilder_ = null; - nodeInputInfo_ = other.nodeInputInfo_; - bitField0_ = (bitField0_ & ~0x00000004); - nodeInputInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeInputInfoFieldBuilder() : null; - } else { - nodeInputInfoBuilder_.addAllMessages(other.nodeInputInfo_); - } - } - } - if (nodeOutputInfoBuilder_ == null) { - if (!other.nodeOutputInfo_.isEmpty()) { - if (nodeOutputInfo_.isEmpty()) { - nodeOutputInfo_ = other.nodeOutputInfo_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.addAll(other.nodeOutputInfo_); - } - onChanged(); - } - } else { - if (!other.nodeOutputInfo_.isEmpty()) { - if (nodeOutputInfoBuilder_.isEmpty()) { - nodeOutputInfoBuilder_.dispose(); - nodeOutputInfoBuilder_ = null; - nodeOutputInfo_ = other.nodeOutputInfo_; - bitField0_ = (bitField0_ & ~0x00000008); - nodeOutputInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeOutputInfoFieldBuilder() : null; - } else { - nodeOutputInfoBuilder_.addAllMessages(other.nodeOutputInfo_); - } - } - } - if (graphInputNodeInfoBuilder_ == null) { - if (!other.graphInputNodeInfo_.isEmpty()) { - if (graphInputNodeInfo_.isEmpty()) { - graphInputNodeInfo_ = other.graphInputNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.addAll(other.graphInputNodeInfo_); - } - onChanged(); - } - } else { - if (!other.graphInputNodeInfo_.isEmpty()) { - if (graphInputNodeInfoBuilder_.isEmpty()) { - graphInputNodeInfoBuilder_.dispose(); - graphInputNodeInfoBuilder_ = null; - graphInputNodeInfo_ = other.graphInputNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000010); - graphInputNodeInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGraphInputNodeInfoFieldBuilder() : null; - } else { - graphInputNodeInfoBuilder_.addAllMessages(other.graphInputNodeInfo_); - } - } - } - if (graphOutputNodeInfoBuilder_ == null) { - if (!other.graphOutputNodeInfo_.isEmpty()) { - if (graphOutputNodeInfo_.isEmpty()) { - graphOutputNodeInfo_ = other.graphOutputNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.addAll(other.graphOutputNodeInfo_); - } - onChanged(); - } - } else { - if (!other.graphOutputNodeInfo_.isEmpty()) { - if (graphOutputNodeInfoBuilder_.isEmpty()) { - graphOutputNodeInfoBuilder_.dispose(); - graphOutputNodeInfoBuilder_ = null; - graphOutputNodeInfo_ = other.graphOutputNodeInfo_; - bitField0_ = (bitField0_ & ~0x00000020); - graphOutputNodeInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGraphOutputNodeInfoFieldBuilder() : null; - } else { - graphOutputNodeInfoBuilder_.addAllMessages(other.graphOutputNodeInfo_); - } - } - } - if (other.destination_ != 0) { - setDestinationValue(other.getDestinationValue()); - } - 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.GraphTransferInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List nodeInfo_ = - java.util.Collections.emptyList(); - private void ensureNodeInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nodeInfo_ = new java.util.ArrayList(nodeInfo_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInfo, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder> nodeInfoBuilder_; - - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public java.util.List getNodeInfoList() { - if (nodeInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeInfo_); - } else { - return nodeInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public int getNodeInfoCount() { - if (nodeInfoBuilder_ == null) { - return nodeInfo_.size(); - } else { - return nodeInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfo getNodeInfo(int index) { - if (nodeInfoBuilder_ == null) { - return nodeInfo_.get(index); - } else { - return nodeInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder setNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInfo value) { - if (nodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInfoIsMutable(); - nodeInfo_.set(index, value); - onChanged(); - } else { - nodeInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder setNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder builderForValue) { - if (nodeInfoBuilder_ == null) { - ensureNodeInfoIsMutable(); - nodeInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder addNodeInfo(org.tensorflow.proto.framework.GraphTransferNodeInfo value) { - if (nodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInfoIsMutable(); - nodeInfo_.add(value); - onChanged(); - } else { - nodeInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder addNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInfo value) { - if (nodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInfoIsMutable(); - nodeInfo_.add(index, value); - onChanged(); - } else { - nodeInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder addNodeInfo( - org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder builderForValue) { - if (nodeInfoBuilder_ == null) { - ensureNodeInfoIsMutable(); - nodeInfo_.add(builderForValue.build()); - onChanged(); - } else { - nodeInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder addNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder builderForValue) { - if (nodeInfoBuilder_ == null) { - ensureNodeInfoIsMutable(); - nodeInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder addAllNodeInfo( - java.lang.Iterable values) { - if (nodeInfoBuilder_ == null) { - ensureNodeInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeInfo_); - onChanged(); - } else { - nodeInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder clearNodeInfo() { - if (nodeInfoBuilder_ == null) { - nodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodeInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public Builder removeNodeInfo(int index) { - if (nodeInfoBuilder_ == null) { - ensureNodeInfoIsMutable(); - nodeInfo_.remove(index); - onChanged(); - } else { - nodeInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder getNodeInfoBuilder( - int index) { - return getNodeInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( - int index) { - if (nodeInfoBuilder_ == null) { - return nodeInfo_.get(index); } else { - return nodeInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public java.util.List - getNodeInfoOrBuilderList() { - if (nodeInfoBuilder_ != null) { - return nodeInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeInfo_); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder addNodeInfoBuilder() { - return getNodeInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder addNodeInfoBuilder( - int index) { - return getNodeInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - public java.util.List - getNodeInfoBuilderList() { - return getNodeInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInfo, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder> - getNodeInfoFieldBuilder() { - if (nodeInfoBuilder_ == null) { - nodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInfo, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder>( - nodeInfo_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nodeInfo_ = null; - } - return nodeInfoBuilder_; - } - - private java.util.List constNodeInfo_ = - java.util.Collections.emptyList(); - private void ensureConstNodeInfoIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - constNodeInfo_ = new java.util.ArrayList(constNodeInfo_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferConstNodeInfo, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder> constNodeInfoBuilder_; - - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public java.util.List getConstNodeInfoList() { - if (constNodeInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(constNodeInfo_); - } else { - return constNodeInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public int getConstNodeInfoCount() { - if (constNodeInfoBuilder_ == null) { - return constNodeInfo_.size(); - } else { - return constNodeInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo getConstNodeInfo(int index) { - if (constNodeInfoBuilder_ == null) { - return constNodeInfo_.get(index); - } else { - return constNodeInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder setConstNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferConstNodeInfo value) { - if (constNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstNodeInfoIsMutable(); - constNodeInfo_.set(index, value); - onChanged(); - } else { - constNodeInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder setConstNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder builderForValue) { - if (constNodeInfoBuilder_ == null) { - ensureConstNodeInfoIsMutable(); - constNodeInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - constNodeInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder addConstNodeInfo(org.tensorflow.proto.framework.GraphTransferConstNodeInfo value) { - if (constNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstNodeInfoIsMutable(); - constNodeInfo_.add(value); - onChanged(); - } else { - constNodeInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder addConstNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferConstNodeInfo value) { - if (constNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstNodeInfoIsMutable(); - constNodeInfo_.add(index, value); - onChanged(); - } else { - constNodeInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder addConstNodeInfo( - org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder builderForValue) { - if (constNodeInfoBuilder_ == null) { - ensureConstNodeInfoIsMutable(); - constNodeInfo_.add(builderForValue.build()); - onChanged(); - } else { - constNodeInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder addConstNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder builderForValue) { - if (constNodeInfoBuilder_ == null) { - ensureConstNodeInfoIsMutable(); - constNodeInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - constNodeInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder addAllConstNodeInfo( - java.lang.Iterable values) { - if (constNodeInfoBuilder_ == null) { - ensureConstNodeInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, constNodeInfo_); - onChanged(); - } else { - constNodeInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder clearConstNodeInfo() { - if (constNodeInfoBuilder_ == null) { - constNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - constNodeInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public Builder removeConstNodeInfo(int index) { - if (constNodeInfoBuilder_ == null) { - ensureConstNodeInfoIsMutable(); - constNodeInfo_.remove(index); - onChanged(); - } else { - constNodeInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder getConstNodeInfoBuilder( - int index) { - return getConstNodeInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( - int index) { - if (constNodeInfoBuilder_ == null) { - return constNodeInfo_.get(index); } else { - return constNodeInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public java.util.List - getConstNodeInfoOrBuilderList() { - if (constNodeInfoBuilder_ != null) { - return constNodeInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(constNodeInfo_); - } - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder addConstNodeInfoBuilder() { - return getConstNodeInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferConstNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder addConstNodeInfoBuilder( - int index) { - return getConstNodeInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - public java.util.List - getConstNodeInfoBuilderList() { - return getConstNodeInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferConstNodeInfo, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder> - getConstNodeInfoFieldBuilder() { - if (constNodeInfoBuilder_ == null) { - constNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferConstNodeInfo, org.tensorflow.proto.framework.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder>( - constNodeInfo_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - constNodeInfo_ = null; - } - return constNodeInfoBuilder_; - } - - private java.util.List nodeInputInfo_ = - java.util.Collections.emptyList(); - private void ensureNodeInputInfoIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - nodeInputInfo_ = new java.util.ArrayList(nodeInputInfo_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInputInfo, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder> nodeInputInfoBuilder_; - - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public java.util.List getNodeInputInfoList() { - if (nodeInputInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeInputInfo_); - } else { - return nodeInputInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public int getNodeInputInfoCount() { - if (nodeInputInfoBuilder_ == null) { - return nodeInputInfo_.size(); - } else { - return nodeInputInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo getNodeInputInfo(int index) { - if (nodeInputInfoBuilder_ == null) { - return nodeInputInfo_.get(index); - } else { - return nodeInputInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder setNodeInputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInputInfo value) { - if (nodeInputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.set(index, value); - onChanged(); - } else { - nodeInputInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder setNodeInputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder builderForValue) { - if (nodeInputInfoBuilder_ == null) { - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeInputInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder addNodeInputInfo(org.tensorflow.proto.framework.GraphTransferNodeInputInfo value) { - if (nodeInputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.add(value); - onChanged(); - } else { - nodeInputInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder addNodeInputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInputInfo value) { - if (nodeInputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.add(index, value); - onChanged(); - } else { - nodeInputInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder addNodeInputInfo( - org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder builderForValue) { - if (nodeInputInfoBuilder_ == null) { - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.add(builderForValue.build()); - onChanged(); - } else { - nodeInputInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder addNodeInputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder builderForValue) { - if (nodeInputInfoBuilder_ == null) { - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeInputInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder addAllNodeInputInfo( - java.lang.Iterable values) { - if (nodeInputInfoBuilder_ == null) { - ensureNodeInputInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeInputInfo_); - onChanged(); - } else { - nodeInputInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder clearNodeInputInfo() { - if (nodeInputInfoBuilder_ == null) { - nodeInputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - nodeInputInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public Builder removeNodeInputInfo(int index) { - if (nodeInputInfoBuilder_ == null) { - ensureNodeInputInfoIsMutable(); - nodeInputInfo_.remove(index); - onChanged(); - } else { - nodeInputInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder getNodeInputInfoBuilder( - int index) { - return getNodeInputInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( - int index) { - if (nodeInputInfoBuilder_ == null) { - return nodeInputInfo_.get(index); } else { - return nodeInputInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public java.util.List - getNodeInputInfoOrBuilderList() { - if (nodeInputInfoBuilder_ != null) { - return nodeInputInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeInputInfo_); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder addNodeInputInfoBuilder() { - return getNodeInputInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferNodeInputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder addNodeInputInfoBuilder( - int index) { - return getNodeInputInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - public java.util.List - getNodeInputInfoBuilderList() { - return getNodeInputInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInputInfo, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder> - getNodeInputInfoFieldBuilder() { - if (nodeInputInfoBuilder_ == null) { - nodeInputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInputInfo, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder>( - nodeInputInfo_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - nodeInputInfo_ = null; - } - return nodeInputInfoBuilder_; - } - - private java.util.List nodeOutputInfo_ = - java.util.Collections.emptyList(); - private void ensureNodeOutputInfoIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - nodeOutputInfo_ = new java.util.ArrayList(nodeOutputInfo_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder> nodeOutputInfoBuilder_; - - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public java.util.List getNodeOutputInfoList() { - if (nodeOutputInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeOutputInfo_); - } else { - return nodeOutputInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public int getNodeOutputInfoCount() { - if (nodeOutputInfoBuilder_ == null) { - return nodeOutputInfo_.size(); - } else { - return nodeOutputInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo getNodeOutputInfo(int index) { - if (nodeOutputInfoBuilder_ == null) { - return nodeOutputInfo_.get(index); - } else { - return nodeOutputInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder setNodeOutputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo value) { - if (nodeOutputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.set(index, value); - onChanged(); - } else { - nodeOutputInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder setNodeOutputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder builderForValue) { - if (nodeOutputInfoBuilder_ == null) { - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeOutputInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder addNodeOutputInfo(org.tensorflow.proto.framework.GraphTransferNodeOutputInfo value) { - if (nodeOutputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.add(value); - onChanged(); - } else { - nodeOutputInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder addNodeOutputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo value) { - if (nodeOutputInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.add(index, value); - onChanged(); - } else { - nodeOutputInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder addNodeOutputInfo( - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder builderForValue) { - if (nodeOutputInfoBuilder_ == null) { - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.add(builderForValue.build()); - onChanged(); - } else { - nodeOutputInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder addNodeOutputInfo( - int index, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder builderForValue) { - if (nodeOutputInfoBuilder_ == null) { - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeOutputInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder addAllNodeOutputInfo( - java.lang.Iterable values) { - if (nodeOutputInfoBuilder_ == null) { - ensureNodeOutputInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeOutputInfo_); - onChanged(); - } else { - nodeOutputInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder clearNodeOutputInfo() { - if (nodeOutputInfoBuilder_ == null) { - nodeOutputInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - nodeOutputInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public Builder removeNodeOutputInfo(int index) { - if (nodeOutputInfoBuilder_ == null) { - ensureNodeOutputInfoIsMutable(); - nodeOutputInfo_.remove(index); - onChanged(); - } else { - nodeOutputInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder getNodeOutputInfoBuilder( - int index) { - return getNodeOutputInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( - int index) { - if (nodeOutputInfoBuilder_ == null) { - return nodeOutputInfo_.get(index); } else { - return nodeOutputInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public java.util.List - getNodeOutputInfoOrBuilderList() { - if (nodeOutputInfoBuilder_ != null) { - return nodeOutputInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeOutputInfo_); - } - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder addNodeOutputInfoBuilder() { - return getNodeOutputInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder addNodeOutputInfoBuilder( - int index) { - return getNodeOutputInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - public java.util.List - getNodeOutputInfoBuilderList() { - return getNodeOutputInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder> - getNodeOutputInfoFieldBuilder() { - if (nodeOutputInfoBuilder_ == null) { - nodeOutputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder>( - nodeOutputInfo_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - nodeOutputInfo_ = null; - } - return nodeOutputInfoBuilder_; - } - - private java.util.List graphInputNodeInfo_ = - java.util.Collections.emptyList(); - private void ensureGraphInputNodeInfoIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - graphInputNodeInfo_ = new java.util.ArrayList(graphInputNodeInfo_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder> graphInputNodeInfoBuilder_; - - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public java.util.List getGraphInputNodeInfoList() { - if (graphInputNodeInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(graphInputNodeInfo_); - } else { - return graphInputNodeInfoBuilder_.getMessageList(); - } - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public int getGraphInputNodeInfoCount() { - if (graphInputNodeInfoBuilder_ == null) { - return graphInputNodeInfo_.size(); - } else { - return graphInputNodeInfoBuilder_.getCount(); - } - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index) { - if (graphInputNodeInfoBuilder_ == null) { - return graphInputNodeInfo_.get(index); - } else { - return graphInputNodeInfoBuilder_.getMessage(index); - } - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder setGraphInputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo value) { - if (graphInputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.set(index, value); - onChanged(); - } else { - graphInputNodeInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder setGraphInputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder builderForValue) { - if (graphInputNodeInfoBuilder_ == null) { - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - graphInputNodeInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder addGraphInputNodeInfo(org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo value) { - if (graphInputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.add(value); - onChanged(); - } else { - graphInputNodeInfoBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder addGraphInputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo value) { - if (graphInputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.add(index, value); - onChanged(); - } else { - graphInputNodeInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder addGraphInputNodeInfo( - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder builderForValue) { - if (graphInputNodeInfoBuilder_ == null) { - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.add(builderForValue.build()); - onChanged(); - } else { - graphInputNodeInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder addGraphInputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder builderForValue) { - if (graphInputNodeInfoBuilder_ == null) { - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - graphInputNodeInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder addAllGraphInputNodeInfo( - java.lang.Iterable values) { - if (graphInputNodeInfoBuilder_ == null) { - ensureGraphInputNodeInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, graphInputNodeInfo_); - onChanged(); - } else { - graphInputNodeInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder clearGraphInputNodeInfo() { - if (graphInputNodeInfoBuilder_ == null) { - graphInputNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - graphInputNodeInfoBuilder_.clear(); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public Builder removeGraphInputNodeInfo(int index) { - if (graphInputNodeInfoBuilder_ == null) { - ensureGraphInputNodeInfoIsMutable(); - graphInputNodeInfo_.remove(index); - onChanged(); - } else { - graphInputNodeInfoBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder getGraphInputNodeInfoBuilder( - int index) { - return getGraphInputNodeInfoFieldBuilder().getBuilder(index); - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( - int index) { - if (graphInputNodeInfoBuilder_ == null) { - return graphInputNodeInfo_.get(index); } else { - return graphInputNodeInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public java.util.List - getGraphInputNodeInfoOrBuilderList() { - if (graphInputNodeInfoBuilder_ != null) { - return graphInputNodeInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(graphInputNodeInfo_); - } - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder addGraphInputNodeInfoBuilder() { - return getGraphInputNodeInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.getDefaultInstance()); - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder addGraphInputNodeInfoBuilder( - int index) { - return getGraphInputNodeInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.getDefaultInstance()); - } - /** - *
    -     * Input Node parameters of transferred graph
    -     * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - public java.util.List - getGraphInputNodeInfoBuilderList() { - return getGraphInputNodeInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder> - getGraphInputNodeInfoFieldBuilder() { - if (graphInputNodeInfoBuilder_ == null) { - graphInputNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder>( - graphInputNodeInfo_, - ((bitField0_ & 0x00000010) != 0), - getParentForChildren(), - isClean()); - graphInputNodeInfo_ = null; - } - return graphInputNodeInfoBuilder_; - } - - private java.util.List graphOutputNodeInfo_ = - java.util.Collections.emptyList(); - private void ensureGraphOutputNodeInfoIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - graphOutputNodeInfo_ = new java.util.ArrayList(graphOutputNodeInfo_); - bitField0_ |= 0x00000020; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder> graphOutputNodeInfoBuilder_; - - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public java.util.List getGraphOutputNodeInfoList() { - if (graphOutputNodeInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(graphOutputNodeInfo_); - } else { - return graphOutputNodeInfoBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public int getGraphOutputNodeInfoCount() { - if (graphOutputNodeInfoBuilder_ == null) { - return graphOutputNodeInfo_.size(); - } else { - return graphOutputNodeInfoBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index) { - if (graphOutputNodeInfoBuilder_ == null) { - return graphOutputNodeInfo_.get(index); - } else { - return graphOutputNodeInfoBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder setGraphOutputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo value) { - if (graphOutputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.set(index, value); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder setGraphOutputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { - if (graphOutputNodeInfoBuilder_ == null) { - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder addGraphOutputNodeInfo(org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo value) { - if (graphOutputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.add(value); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder addGraphOutputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo value) { - if (graphOutputNodeInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.add(index, value); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder addGraphOutputNodeInfo( - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { - if (graphOutputNodeInfoBuilder_ == null) { - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.add(builderForValue.build()); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder addGraphOutputNodeInfo( - int index, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { - if (graphOutputNodeInfoBuilder_ == null) { - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder addAllGraphOutputNodeInfo( - java.lang.Iterable values) { - if (graphOutputNodeInfoBuilder_ == null) { - ensureGraphOutputNodeInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, graphOutputNodeInfo_); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder clearGraphOutputNodeInfo() { - if (graphOutputNodeInfoBuilder_ == null) { - graphOutputNodeInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public Builder removeGraphOutputNodeInfo(int index) { - if (graphOutputNodeInfoBuilder_ == null) { - ensureGraphOutputNodeInfoIsMutable(); - graphOutputNodeInfo_.remove(index); - onChanged(); - } else { - graphOutputNodeInfoBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder getGraphOutputNodeInfoBuilder( - int index) { - return getGraphOutputNodeInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( - int index) { - if (graphOutputNodeInfoBuilder_ == null) { - return graphOutputNodeInfo_.get(index); } else { - return graphOutputNodeInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public java.util.List - getGraphOutputNodeInfoOrBuilderList() { - if (graphOutputNodeInfoBuilder_ != null) { - return graphOutputNodeInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(graphOutputNodeInfo_); - } - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder addGraphOutputNodeInfoBuilder() { - return getGraphOutputNodeInfoFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder addGraphOutputNodeInfoBuilder( - int index) { - return getGraphOutputNodeInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - public java.util.List - getGraphOutputNodeInfoBuilderList() { - return getGraphOutputNodeInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder> - getGraphOutputNodeInfoFieldBuilder() { - if (graphOutputNodeInfoBuilder_ == null) { - graphOutputNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder>( - graphOutputNodeInfo_, - ((bitField0_ & 0x00000020) != 0), - getParentForChildren(), - isClean()); - graphOutputNodeInfo_ = null; - } - return graphOutputNodeInfoBuilder_; - } - - private int destination_ = 0; - /** - *
    -     * Destination of graph transfer
    -     * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public int getDestinationValue() { - return destination_; - } - /** - *
    -     * Destination of graph transfer
    -     * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public Builder setDestinationValue(int value) { - destination_ = value; - onChanged(); - return this; - } - /** - *
    -     * Destination of graph transfer
    -     * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public org.tensorflow.proto.framework.GraphTransferInfo.Destination getDestination() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.GraphTransferInfo.Destination result = org.tensorflow.proto.framework.GraphTransferInfo.Destination.valueOf(destination_); - return result == null ? org.tensorflow.proto.framework.GraphTransferInfo.Destination.UNRECOGNIZED : result; - } - /** - *
    -     * Destination of graph transfer
    -     * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public Builder setDestination(org.tensorflow.proto.framework.GraphTransferInfo.Destination value) { - if (value == null) { - throw new NullPointerException(); - } - - destination_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Destination of graph transfer
    -     * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - public Builder clearDestination() { - - destination_ = 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.GraphTransferInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferInfo) - private static final org.tensorflow.proto.framework.GraphTransferInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferInfo(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.GraphTransferInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoOrBuilder.java deleted file mode 100644 index d999e1d9d48..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoOrBuilder.java +++ /dev/null @@ -1,190 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - java.util.List - getNodeInfoList(); - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - org.tensorflow.proto.framework.GraphTransferNodeInfo getNodeInfo(int index); - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - int getNodeInfoCount(); - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - java.util.List - getNodeInfoOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; - */ - org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( - int index); - - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - java.util.List - getConstNodeInfoList(); - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - org.tensorflow.proto.framework.GraphTransferConstNodeInfo getConstNodeInfo(int index); - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - int getConstNodeInfoCount(); - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - java.util.List - getConstNodeInfoOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; - */ - org.tensorflow.proto.framework.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( - int index); - - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - java.util.List - getNodeInputInfoList(); - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - org.tensorflow.proto.framework.GraphTransferNodeInputInfo getNodeInputInfo(int index); - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - int getNodeInputInfoCount(); - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - java.util.List - getNodeInputInfoOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; - */ - org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( - int index); - - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - java.util.List - getNodeOutputInfoList(); - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo getNodeOutputInfo(int index); - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - int getNodeOutputInfoCount(); - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - java.util.List - getNodeOutputInfoOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; - */ - org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( - int index); - - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - java.util.List - getGraphInputNodeInfoList(); - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index); - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - int getGraphInputNodeInfoCount(); - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - java.util.List - getGraphInputNodeInfoOrBuilderList(); - /** - *
    -   * Input Node parameters of transferred graph
    -   * 
    - * - * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; - */ - org.tensorflow.proto.framework.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( - int index); - - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - java.util.List - getGraphOutputNodeInfoList(); - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index); - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - int getGraphOutputNodeInfoCount(); - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - java.util.List - getGraphOutputNodeInfoOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; - */ - org.tensorflow.proto.framework.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( - int index); - - /** - *
    -   * Destination of graph transfer
    -   * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - int getDestinationValue(); - /** - *
    -   * Destination of graph transfer
    -   * 
    - * - * .tensorflow.GraphTransferInfo.Destination destination = 7; - */ - org.tensorflow.proto.framework.GraphTransferInfo.Destination getDestination(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfo.java deleted file mode 100644 index d144359008c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfo.java +++ /dev/null @@ -1,958 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferNodeInfo} - */ -public final class GraphTransferNodeInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInfo) - GraphTransferNodeInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferNodeInfo.newBuilder() to construct. - private GraphTransferNodeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferNodeInfo() { - name_ = ""; - typeName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferNodeInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferNodeInfo( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - typeName_ = s; - break; - } - case 32: { - - socOpId_ = input.readInt32(); - break; - } - case 40: { - - paddingId_ = input.readInt32(); - break; - } - case 48: { - - inputCount_ = input.readInt32(); - break; - } - case 56: { - - outputCount_ = input.readInt32(); - 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.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInfo.class, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 NODE_ID_FIELD_NUMBER = 2; - private int nodeId_; - /** - * int32 node_id = 2; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int TYPE_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object typeName_; - /** - * string type_name = 3; - */ - public java.lang.String getTypeName() { - java.lang.Object ref = typeName_; - 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(); - typeName_ = s; - return s; - } - } - /** - * string type_name = 3; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - java.lang.Object ref = typeName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SOC_OP_ID_FIELD_NUMBER = 4; - private int socOpId_; - /** - * int32 soc_op_id = 4; - */ - public int getSocOpId() { - return socOpId_; - } - - public static final int PADDING_ID_FIELD_NUMBER = 5; - private int paddingId_; - /** - * int32 padding_id = 5; - */ - public int getPaddingId() { - return paddingId_; - } - - public static final int INPUT_COUNT_FIELD_NUMBER = 6; - private int inputCount_; - /** - * int32 input_count = 6; - */ - public int getInputCount() { - return inputCount_; - } - - public static final int OUTPUT_COUNT_FIELD_NUMBER = 7; - private int outputCount_; - /** - * int32 output_count = 7; - */ - public int getOutputCount() { - return outputCount_; - } - - 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 (nodeId_ != 0) { - output.writeInt32(2, nodeId_); - } - if (!getTypeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, typeName_); - } - if (socOpId_ != 0) { - output.writeInt32(4, socOpId_); - } - if (paddingId_ != 0) { - output.writeInt32(5, paddingId_); - } - if (inputCount_ != 0) { - output.writeInt32(6, inputCount_); - } - if (outputCount_ != 0) { - output.writeInt32(7, outputCount_); - } - 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 (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, nodeId_); - } - if (!getTypeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, typeName_); - } - if (socOpId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, socOpId_); - } - if (paddingId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, paddingId_); - } - if (inputCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, inputCount_); - } - if (outputCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, outputCount_); - } - 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.GraphTransferNodeInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferNodeInfo other = (org.tensorflow.proto.framework.GraphTransferNodeInfo) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getNodeId() - != other.getNodeId()) return false; - if (!getTypeName() - .equals(other.getTypeName())) return false; - if (getSocOpId() - != other.getSocOpId()) return false; - if (getPaddingId() - != other.getPaddingId()) return false; - if (getInputCount() - != other.getInputCount()) return false; - if (getOutputCount() - != other.getOutputCount()) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - hash = (37 * hash) + TYPE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getTypeName().hashCode(); - hash = (37 * hash) + SOC_OP_ID_FIELD_NUMBER; - hash = (53 * hash) + getSocOpId(); - hash = (37 * hash) + PADDING_ID_FIELD_NUMBER; - hash = (53 * hash) + getPaddingId(); - hash = (37 * hash) + INPUT_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getInputCount(); - hash = (37 * hash) + OUTPUT_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getOutputCount(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInfo 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.GraphTransferNodeInfo 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.GraphTransferNodeInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInfo) - org.tensorflow.proto.framework.GraphTransferNodeInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInfo.class, org.tensorflow.proto.framework.GraphTransferNodeInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferNodeInfo.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_ = ""; - - nodeId_ = 0; - - typeName_ = ""; - - socOpId_ = 0; - - paddingId_ = 0; - - inputCount_ = 0; - - outputCount_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferNodeInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInfo build() { - org.tensorflow.proto.framework.GraphTransferNodeInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferNodeInfo result = new org.tensorflow.proto.framework.GraphTransferNodeInfo(this); - result.name_ = name_; - result.nodeId_ = nodeId_; - result.typeName_ = typeName_; - result.socOpId_ = socOpId_; - result.paddingId_ = paddingId_; - result.inputCount_ = inputCount_; - result.outputCount_ = outputCount_; - 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.GraphTransferNodeInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferNodeInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferNodeInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferNodeInfo.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (!other.getTypeName().isEmpty()) { - typeName_ = other.typeName_; - onChanged(); - } - if (other.getSocOpId() != 0) { - setSocOpId(other.getSocOpId()); - } - if (other.getPaddingId() != 0) { - setPaddingId(other.getPaddingId()); - } - if (other.getInputCount() != 0) { - setInputCount(other.getInputCount()); - } - if (other.getOutputCount() != 0) { - setOutputCount(other.getOutputCount()); - } - 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.GraphTransferNodeInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferNodeInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 nodeId_ ; - /** - * int32 node_id = 2; - */ - public int getNodeId() { - return nodeId_; - } - /** - * int32 node_id = 2; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - * int32 node_id = 2; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object typeName_ = ""; - /** - * string type_name = 3; - */ - public java.lang.String getTypeName() { - java.lang.Object ref = typeName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type_name = 3; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - java.lang.Object ref = typeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type_name = 3; - */ - public Builder setTypeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeName_ = value; - onChanged(); - return this; - } - /** - * string type_name = 3; - */ - public Builder clearTypeName() { - - typeName_ = getDefaultInstance().getTypeName(); - onChanged(); - return this; - } - /** - * string type_name = 3; - */ - public Builder setTypeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeName_ = value; - onChanged(); - return this; - } - - private int socOpId_ ; - /** - * int32 soc_op_id = 4; - */ - public int getSocOpId() { - return socOpId_; - } - /** - * int32 soc_op_id = 4; - */ - public Builder setSocOpId(int value) { - - socOpId_ = value; - onChanged(); - return this; - } - /** - * int32 soc_op_id = 4; - */ - public Builder clearSocOpId() { - - socOpId_ = 0; - onChanged(); - return this; - } - - private int paddingId_ ; - /** - * int32 padding_id = 5; - */ - public int getPaddingId() { - return paddingId_; - } - /** - * int32 padding_id = 5; - */ - public Builder setPaddingId(int value) { - - paddingId_ = value; - onChanged(); - return this; - } - /** - * int32 padding_id = 5; - */ - public Builder clearPaddingId() { - - paddingId_ = 0; - onChanged(); - return this; - } - - private int inputCount_ ; - /** - * int32 input_count = 6; - */ - public int getInputCount() { - return inputCount_; - } - /** - * int32 input_count = 6; - */ - public Builder setInputCount(int value) { - - inputCount_ = value; - onChanged(); - return this; - } - /** - * int32 input_count = 6; - */ - public Builder clearInputCount() { - - inputCount_ = 0; - onChanged(); - return this; - } - - private int outputCount_ ; - /** - * int32 output_count = 7; - */ - public int getOutputCount() { - return outputCount_; - } - /** - * int32 output_count = 7; - */ - public Builder setOutputCount(int value) { - - outputCount_ = value; - onChanged(); - return this; - } - /** - * int32 output_count = 7; - */ - public Builder clearOutputCount() { - - outputCount_ = 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.GraphTransferNodeInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInfo) - private static final org.tensorflow.proto.framework.GraphTransferNodeInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferNodeInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferNodeInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferNodeInfo(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.GraphTransferNodeInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfoOrBuilder.java deleted file mode 100644 index 98656c6ee2c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInfoOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferNodeInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * int32 node_id = 2; - */ - int getNodeId(); - - /** - * string type_name = 3; - */ - java.lang.String getTypeName(); - /** - * string type_name = 3; - */ - com.google.protobuf.ByteString - getTypeNameBytes(); - - /** - * int32 soc_op_id = 4; - */ - int getSocOpId(); - - /** - * int32 padding_id = 5; - */ - int getPaddingId(); - - /** - * int32 input_count = 6; - */ - int getInputCount(); - - /** - * int32 output_count = 7; - */ - int getOutputCount(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInput.java deleted file mode 100644 index 77ad6b87dc8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInput.java +++ /dev/null @@ -1,533 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferNodeInput} - */ -public final class GraphTransferNodeInput extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInput) - GraphTransferNodeInputOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferNodeInput.newBuilder() to construct. - private GraphTransferNodeInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferNodeInput() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferNodeInput(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferNodeInput( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 16: { - - outputPort_ = input.readInt32(); - 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.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInput.class, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder.class); - } - - public static final int NODE_ID_FIELD_NUMBER = 1; - private int nodeId_; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int OUTPUT_PORT_FIELD_NUMBER = 2; - private int outputPort_; - /** - * int32 output_port = 2; - */ - public int getOutputPort() { - return outputPort_; - } - - 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 (nodeId_ != 0) { - output.writeInt32(1, nodeId_); - } - if (outputPort_ != 0) { - output.writeInt32(2, outputPort_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, nodeId_); - } - if (outputPort_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, outputPort_); - } - 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.GraphTransferNodeInput)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferNodeInput other = (org.tensorflow.proto.framework.GraphTransferNodeInput) obj; - - if (getNodeId() - != other.getNodeId()) return false; - if (getOutputPort() - != other.getOutputPort()) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - hash = (37 * hash) + OUTPUT_PORT_FIELD_NUMBER; - hash = (53 * hash) + getOutputPort(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInput parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput 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.GraphTransferNodeInput parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput 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.GraphTransferNodeInput parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput 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.GraphTransferNodeInput parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput 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.GraphTransferNodeInput parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInput 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.GraphTransferNodeInput 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.GraphTransferNodeInput} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInput) - org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInput.class, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferNodeInput.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(); - nodeId_ = 0; - - outputPort_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInput getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferNodeInput.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInput build() { - org.tensorflow.proto.framework.GraphTransferNodeInput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInput buildPartial() { - org.tensorflow.proto.framework.GraphTransferNodeInput result = new org.tensorflow.proto.framework.GraphTransferNodeInput(this); - result.nodeId_ = nodeId_; - result.outputPort_ = outputPort_; - 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.GraphTransferNodeInput) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferNodeInput)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferNodeInput other) { - if (other == org.tensorflow.proto.framework.GraphTransferNodeInput.getDefaultInstance()) return this; - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (other.getOutputPort() != 0) { - setOutputPort(other.getOutputPort()); - } - 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.GraphTransferNodeInput parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferNodeInput) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int nodeId_ ; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - /** - * int32 node_id = 1; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - * int32 node_id = 1; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private int outputPort_ ; - /** - * int32 output_port = 2; - */ - public int getOutputPort() { - return outputPort_; - } - /** - * int32 output_port = 2; - */ - public Builder setOutputPort(int value) { - - outputPort_ = value; - onChanged(); - return this; - } - /** - * int32 output_port = 2; - */ - public Builder clearOutputPort() { - - outputPort_ = 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.GraphTransferNodeInput) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInput) - private static final org.tensorflow.proto.framework.GraphTransferNodeInput DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferNodeInput(); - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInput getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferNodeInput parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferNodeInput(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.GraphTransferNodeInput getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfo.java deleted file mode 100644 index 71d0552eacd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfo.java +++ /dev/null @@ -1,822 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferNodeInputInfo} - */ -public final class GraphTransferNodeInputInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInputInfo) - GraphTransferNodeInputInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferNodeInputInfo.newBuilder() to construct. - private GraphTransferNodeInputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferNodeInputInfo() { - nodeInput_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferNodeInputInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferNodeInputInfo( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - nodeInput_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nodeInput_.add( - input.readMessage(org.tensorflow.proto.framework.GraphTransferNodeInput.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_ & 0x00000001) != 0)) { - nodeInput_ = java.util.Collections.unmodifiableList(nodeInput_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInputInfo.class, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder.class); - } - - public static final int NODE_ID_FIELD_NUMBER = 1; - private int nodeId_; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int NODE_INPUT_FIELD_NUMBER = 2; - private java.util.List nodeInput_; - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public java.util.List getNodeInputList() { - return nodeInput_; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public java.util.List - getNodeInputOrBuilderList() { - return nodeInput_; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public int getNodeInputCount() { - return nodeInput_.size(); - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInput getNodeInput(int index) { - return nodeInput_.get(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( - int index) { - return nodeInput_.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 { - if (nodeId_ != 0) { - output.writeInt32(1, nodeId_); - } - for (int i = 0; i < nodeInput_.size(); i++) { - output.writeMessage(2, nodeInput_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, nodeId_); - } - for (int i = 0; i < nodeInput_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, nodeInput_.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.GraphTransferNodeInputInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferNodeInputInfo other = (org.tensorflow.proto.framework.GraphTransferNodeInputInfo) obj; - - if (getNodeId() - != other.getNodeId()) return false; - if (!getNodeInputList() - .equals(other.getNodeInputList())) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - if (getNodeInputCount() > 0) { - hash = (37 * hash) + NODE_INPUT_FIELD_NUMBER; - hash = (53 * hash) + getNodeInputList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInputInfo) - org.tensorflow.proto.framework.GraphTransferNodeInputInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeInputInfo.class, org.tensorflow.proto.framework.GraphTransferNodeInputInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferNodeInputInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodeInputFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - nodeId_ = 0; - - if (nodeInputBuilder_ == null) { - nodeInput_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodeInputBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferNodeInputInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo build() { - org.tensorflow.proto.framework.GraphTransferNodeInputInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeInputInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferNodeInputInfo result = new org.tensorflow.proto.framework.GraphTransferNodeInputInfo(this); - int from_bitField0_ = bitField0_; - result.nodeId_ = nodeId_; - if (nodeInputBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nodeInput_ = java.util.Collections.unmodifiableList(nodeInput_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nodeInput_ = nodeInput_; - } else { - result.nodeInput_ = nodeInputBuilder_.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.GraphTransferNodeInputInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferNodeInputInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferNodeInputInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferNodeInputInfo.getDefaultInstance()) return this; - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (nodeInputBuilder_ == null) { - if (!other.nodeInput_.isEmpty()) { - if (nodeInput_.isEmpty()) { - nodeInput_ = other.nodeInput_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodeInputIsMutable(); - nodeInput_.addAll(other.nodeInput_); - } - onChanged(); - } - } else { - if (!other.nodeInput_.isEmpty()) { - if (nodeInputBuilder_.isEmpty()) { - nodeInputBuilder_.dispose(); - nodeInputBuilder_ = null; - nodeInput_ = other.nodeInput_; - bitField0_ = (bitField0_ & ~0x00000001); - nodeInputBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodeInputFieldBuilder() : null; - } else { - nodeInputBuilder_.addAllMessages(other.nodeInput_); - } - } - } - 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.GraphTransferNodeInputInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferNodeInputInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int nodeId_ ; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - /** - * int32 node_id = 1; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - * int32 node_id = 1; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private java.util.List nodeInput_ = - java.util.Collections.emptyList(); - private void ensureNodeInputIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nodeInput_ = new java.util.ArrayList(nodeInput_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInput, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder> nodeInputBuilder_; - - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public java.util.List getNodeInputList() { - if (nodeInputBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodeInput_); - } else { - return nodeInputBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public int getNodeInputCount() { - if (nodeInputBuilder_ == null) { - return nodeInput_.size(); - } else { - return nodeInputBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInput getNodeInput(int index) { - if (nodeInputBuilder_ == null) { - return nodeInput_.get(index); - } else { - return nodeInputBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder setNodeInput( - int index, org.tensorflow.proto.framework.GraphTransferNodeInput value) { - if (nodeInputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputIsMutable(); - nodeInput_.set(index, value); - onChanged(); - } else { - nodeInputBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder setNodeInput( - int index, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder builderForValue) { - if (nodeInputBuilder_ == null) { - ensureNodeInputIsMutable(); - nodeInput_.set(index, builderForValue.build()); - onChanged(); - } else { - nodeInputBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder addNodeInput(org.tensorflow.proto.framework.GraphTransferNodeInput value) { - if (nodeInputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputIsMutable(); - nodeInput_.add(value); - onChanged(); - } else { - nodeInputBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder addNodeInput( - int index, org.tensorflow.proto.framework.GraphTransferNodeInput value) { - if (nodeInputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodeInputIsMutable(); - nodeInput_.add(index, value); - onChanged(); - } else { - nodeInputBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder addNodeInput( - org.tensorflow.proto.framework.GraphTransferNodeInput.Builder builderForValue) { - if (nodeInputBuilder_ == null) { - ensureNodeInputIsMutable(); - nodeInput_.add(builderForValue.build()); - onChanged(); - } else { - nodeInputBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder addNodeInput( - int index, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder builderForValue) { - if (nodeInputBuilder_ == null) { - ensureNodeInputIsMutable(); - nodeInput_.add(index, builderForValue.build()); - onChanged(); - } else { - nodeInputBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder addAllNodeInput( - java.lang.Iterable values) { - if (nodeInputBuilder_ == null) { - ensureNodeInputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodeInput_); - onChanged(); - } else { - nodeInputBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder clearNodeInput() { - if (nodeInputBuilder_ == null) { - nodeInput_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodeInputBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public Builder removeNodeInput(int index) { - if (nodeInputBuilder_ == null) { - ensureNodeInputIsMutable(); - nodeInput_.remove(index); - onChanged(); - } else { - nodeInputBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInput.Builder getNodeInputBuilder( - int index) { - return getNodeInputFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( - int index) { - if (nodeInputBuilder_ == null) { - return nodeInput_.get(index); } else { - return nodeInputBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public java.util.List - getNodeInputOrBuilderList() { - if (nodeInputBuilder_ != null) { - return nodeInputBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodeInput_); - } - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInput.Builder addNodeInputBuilder() { - return getNodeInputFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphTransferNodeInput.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public org.tensorflow.proto.framework.GraphTransferNodeInput.Builder addNodeInputBuilder( - int index) { - return getNodeInputFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphTransferNodeInput.getDefaultInstance()); - } - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - public java.util.List - getNodeInputBuilderList() { - return getNodeInputFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInput, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder> - getNodeInputFieldBuilder() { - if (nodeInputBuilder_ == null) { - nodeInputBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphTransferNodeInput, org.tensorflow.proto.framework.GraphTransferNodeInput.Builder, org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder>( - nodeInput_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nodeInput_ = null; - } - return nodeInputBuilder_; - } - @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.GraphTransferNodeInputInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInputInfo) - private static final org.tensorflow.proto.framework.GraphTransferNodeInputInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferNodeInputInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferNodeInputInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferNodeInputInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferNodeInputInfo(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.GraphTransferNodeInputInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfoOrBuilder.java deleted file mode 100644 index 552a182d67b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputInfoOrBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferNodeInputInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInputInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 node_id = 1; - */ - int getNodeId(); - - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - java.util.List - getNodeInputList(); - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - org.tensorflow.proto.framework.GraphTransferNodeInput getNodeInput(int index); - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - int getNodeInputCount(); - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - java.util.List - getNodeInputOrBuilderList(); - /** - * repeated .tensorflow.GraphTransferNodeInput node_input = 2; - */ - org.tensorflow.proto.framework.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfo.java deleted file mode 100644 index c39062bebdb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfo.java +++ /dev/null @@ -1,639 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.GraphTransferNodeOutputInfo} - */ -public final class GraphTransferNodeOutputInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeOutputInfo) - GraphTransferNodeOutputInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphTransferNodeOutputInfo.newBuilder() to construct. - private GraphTransferNodeOutputInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphTransferNodeOutputInfo() { - maxByteSize_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphTransferNodeOutputInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphTransferNodeOutputInfo( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - maxByteSize_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - maxByteSize_.addInt(input.readInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - maxByteSize_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - maxByteSize_.addInt(input.readInt32()); - } - input.popLimit(limit); - 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)) { - maxByteSize_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.class, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder.class); - } - - public static final int NODE_ID_FIELD_NUMBER = 1; - private int nodeId_; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int MAX_BYTE_SIZE_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.IntList maxByteSize_; - /** - * repeated int32 max_byte_size = 2; - */ - public java.util.List - getMaxByteSizeList() { - return maxByteSize_; - } - /** - * repeated int32 max_byte_size = 2; - */ - public int getMaxByteSizeCount() { - return maxByteSize_.size(); - } - /** - * repeated int32 max_byte_size = 2; - */ - public int getMaxByteSize(int index) { - return maxByteSize_.getInt(index); - } - private int maxByteSizeMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (nodeId_ != 0) { - output.writeInt32(1, nodeId_); - } - if (getMaxByteSizeList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(maxByteSizeMemoizedSerializedSize); - } - for (int i = 0; i < maxByteSize_.size(); i++) { - output.writeInt32NoTag(maxByteSize_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, nodeId_); - } - { - int dataSize = 0; - for (int i = 0; i < maxByteSize_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(maxByteSize_.getInt(i)); - } - size += dataSize; - if (!getMaxByteSizeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - maxByteSizeMemoizedSerializedSize = dataSize; - } - 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.GraphTransferNodeOutputInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo other = (org.tensorflow.proto.framework.GraphTransferNodeOutputInfo) obj; - - if (getNodeId() - != other.getNodeId()) return false; - if (!getMaxByteSizeList() - .equals(other.getMaxByteSizeList())) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - if (getMaxByteSizeCount() > 0) { - hash = (37 * hash) + MAX_BYTE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getMaxByteSizeList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeOutputInfo) - org.tensorflow.proto.framework.GraphTransferNodeOutputInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.class, org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.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(); - nodeId_ = 0; - - maxByteSize_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo build() { - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.GraphTransferNodeOutputInfo buildPartial() { - org.tensorflow.proto.framework.GraphTransferNodeOutputInfo result = new org.tensorflow.proto.framework.GraphTransferNodeOutputInfo(this); - int from_bitField0_ = bitField0_; - result.nodeId_ = nodeId_; - if (((bitField0_ & 0x00000001) != 0)) { - maxByteSize_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.maxByteSize_ = maxByteSize_; - 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.GraphTransferNodeOutputInfo) { - return mergeFrom((org.tensorflow.proto.framework.GraphTransferNodeOutputInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.GraphTransferNodeOutputInfo other) { - if (other == org.tensorflow.proto.framework.GraphTransferNodeOutputInfo.getDefaultInstance()) return this; - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (!other.maxByteSize_.isEmpty()) { - if (maxByteSize_.isEmpty()) { - maxByteSize_ = other.maxByteSize_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMaxByteSizeIsMutable(); - maxByteSize_.addAll(other.maxByteSize_); - } - onChanged(); - } - 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.GraphTransferNodeOutputInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.GraphTransferNodeOutputInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int nodeId_ ; - /** - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - /** - * int32 node_id = 1; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - * int32 node_id = 1; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList maxByteSize_ = emptyIntList(); - private void ensureMaxByteSizeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - maxByteSize_ = mutableCopy(maxByteSize_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int32 max_byte_size = 2; - */ - public java.util.List - getMaxByteSizeList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(maxByteSize_) : maxByteSize_; - } - /** - * repeated int32 max_byte_size = 2; - */ - public int getMaxByteSizeCount() { - return maxByteSize_.size(); - } - /** - * repeated int32 max_byte_size = 2; - */ - public int getMaxByteSize(int index) { - return maxByteSize_.getInt(index); - } - /** - * repeated int32 max_byte_size = 2; - */ - public Builder setMaxByteSize( - int index, int value) { - ensureMaxByteSizeIsMutable(); - maxByteSize_.setInt(index, value); - onChanged(); - return this; - } - /** - * repeated int32 max_byte_size = 2; - */ - public Builder addMaxByteSize(int value) { - ensureMaxByteSizeIsMutable(); - maxByteSize_.addInt(value); - onChanged(); - return this; - } - /** - * repeated int32 max_byte_size = 2; - */ - public Builder addAllMaxByteSize( - java.lang.Iterable values) { - ensureMaxByteSizeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, maxByteSize_); - onChanged(); - return this; - } - /** - * repeated int32 max_byte_size = 2; - */ - public Builder clearMaxByteSize() { - maxByteSize_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.GraphTransferNodeOutputInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeOutputInfo) - private static final org.tensorflow.proto.framework.GraphTransferNodeOutputInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphTransferNodeOutputInfo(); - } - - public static org.tensorflow.proto.framework.GraphTransferNodeOutputInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphTransferNodeOutputInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphTransferNodeOutputInfo(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.GraphTransferNodeOutputInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfoOrBuilder.java deleted file mode 100644 index 7721bc2dc6a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeOutputInfoOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/graph_transfer_info.proto - -package org.tensorflow.proto.framework; - -public interface GraphTransferNodeOutputInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeOutputInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 node_id = 1; - */ - int getNodeId(); - - /** - * repeated int32 max_byte_size = 2; - */ - java.util.List getMaxByteSizeList(); - /** - * repeated int32 max_byte_size = 2; - */ - int getMaxByteSizeCount(); - /** - * repeated int32 max_byte_size = 2; - */ - int getMaxByteSize(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProto.java deleted file mode 100644 index e5e19354670..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProto.java +++ /dev/null @@ -1,1120 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Serialization format for histogram module in
    - * core/lib/histogram/histogram.h
    - * 
    - * - * Protobuf type {@code tensorflow.HistogramProto} - */ -public final class HistogramProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.HistogramProto) - HistogramProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use HistogramProto.newBuilder() to construct. - private HistogramProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private HistogramProto() { - bucketLimit_ = emptyDoubleList(); - bucket_ = emptyDoubleList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new HistogramProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private HistogramProto( - 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 9: { - - min_ = input.readDouble(); - break; - } - case 17: { - - max_ = input.readDouble(); - break; - } - case 25: { - - num_ = input.readDouble(); - break; - } - case 33: { - - sum_ = input.readDouble(); - break; - } - case 41: { - - sumSquares_ = input.readDouble(); - break; - } - case 49: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - bucketLimit_ = newDoubleList(); - mutable_bitField0_ |= 0x00000001; - } - bucketLimit_.addDouble(input.readDouble()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - bucketLimit_ = newDoubleList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - bucketLimit_.addDouble(input.readDouble()); - } - input.popLimit(limit); - break; - } - case 57: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - bucket_ = newDoubleList(); - mutable_bitField0_ |= 0x00000002; - } - bucket_.addDouble(input.readDouble()); - break; - } - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - bucket_ = newDoubleList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - bucket_.addDouble(input.readDouble()); - } - input.popLimit(limit); - 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)) { - bucketLimit_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - bucket_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_HistogramProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_HistogramProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.HistogramProto.class, org.tensorflow.proto.framework.HistogramProto.Builder.class); - } - - public static final int MIN_FIELD_NUMBER = 1; - private double min_; - /** - * double min = 1; - */ - public double getMin() { - return min_; - } - - public static final int MAX_FIELD_NUMBER = 2; - private double max_; - /** - * double max = 2; - */ - public double getMax() { - return max_; - } - - public static final int NUM_FIELD_NUMBER = 3; - private double num_; - /** - * double num = 3; - */ - public double getNum() { - return num_; - } - - public static final int SUM_FIELD_NUMBER = 4; - private double sum_; - /** - * double sum = 4; - */ - public double getSum() { - return sum_; - } - - public static final int SUM_SQUARES_FIELD_NUMBER = 5; - private double sumSquares_; - /** - * double sum_squares = 5; - */ - public double getSumSquares() { - return sumSquares_; - } - - public static final int BUCKET_LIMIT_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.DoubleList bucketLimit_; - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public java.util.List - getBucketLimitList() { - return bucketLimit_; - } - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public int getBucketLimitCount() { - return bucketLimit_.size(); - } - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public double getBucketLimit(int index) { - return bucketLimit_.getDouble(index); - } - private int bucketLimitMemoizedSerializedSize = -1; - - public static final int BUCKET_FIELD_NUMBER = 7; - private com.google.protobuf.Internal.DoubleList bucket_; - /** - * repeated double bucket = 7 [packed = true]; - */ - public java.util.List - getBucketList() { - return bucket_; - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public int getBucketCount() { - return bucket_.size(); - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public double getBucket(int index) { - return bucket_.getDouble(index); - } - private int bucketMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (min_ != 0D) { - output.writeDouble(1, min_); - } - if (max_ != 0D) { - output.writeDouble(2, max_); - } - if (num_ != 0D) { - output.writeDouble(3, num_); - } - if (sum_ != 0D) { - output.writeDouble(4, sum_); - } - if (sumSquares_ != 0D) { - output.writeDouble(5, sumSquares_); - } - if (getBucketLimitList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(bucketLimitMemoizedSerializedSize); - } - for (int i = 0; i < bucketLimit_.size(); i++) { - output.writeDoubleNoTag(bucketLimit_.getDouble(i)); - } - if (getBucketList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(bucketMemoizedSerializedSize); - } - for (int i = 0; i < bucket_.size(); i++) { - output.writeDoubleNoTag(bucket_.getDouble(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (min_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, min_); - } - if (max_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, max_); - } - if (num_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, num_); - } - if (sum_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, sum_); - } - if (sumSquares_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(5, sumSquares_); - } - { - int dataSize = 0; - dataSize = 8 * getBucketLimitList().size(); - size += dataSize; - if (!getBucketLimitList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - bucketLimitMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * getBucketList().size(); - size += dataSize; - if (!getBucketList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - bucketMemoizedSerializedSize = dataSize; - } - 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.HistogramProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.HistogramProto other = (org.tensorflow.proto.framework.HistogramProto) obj; - - if (java.lang.Double.doubleToLongBits(getMin()) - != java.lang.Double.doubleToLongBits( - other.getMin())) return false; - if (java.lang.Double.doubleToLongBits(getMax()) - != java.lang.Double.doubleToLongBits( - other.getMax())) return false; - if (java.lang.Double.doubleToLongBits(getNum()) - != java.lang.Double.doubleToLongBits( - other.getNum())) return false; - if (java.lang.Double.doubleToLongBits(getSum()) - != java.lang.Double.doubleToLongBits( - other.getSum())) return false; - if (java.lang.Double.doubleToLongBits(getSumSquares()) - != java.lang.Double.doubleToLongBits( - other.getSumSquares())) return false; - if (!getBucketLimitList() - .equals(other.getBucketLimitList())) return false; - if (!getBucketList() - .equals(other.getBucketList())) 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) + MIN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMin())); - hash = (37 * hash) + MAX_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMax())); - hash = (37 * hash) + NUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getNum())); - hash = (37 * hash) + SUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getSum())); - hash = (37 * hash) + SUM_SQUARES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getSumSquares())); - if (getBucketLimitCount() > 0) { - hash = (37 * hash) + BUCKET_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + getBucketLimitList().hashCode(); - } - if (getBucketCount() > 0) { - hash = (37 * hash) + BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getBucketList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.HistogramProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.HistogramProto 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.HistogramProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.HistogramProto 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.HistogramProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.HistogramProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.HistogramProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.HistogramProto 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.HistogramProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.HistogramProto 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.HistogramProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.HistogramProto 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.HistogramProto 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; - } - /** - *
    -   * Serialization format for histogram module in
    -   * core/lib/histogram/histogram.h
    -   * 
    - * - * Protobuf type {@code tensorflow.HistogramProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.HistogramProto) - org.tensorflow.proto.framework.HistogramProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_HistogramProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_HistogramProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.HistogramProto.class, org.tensorflow.proto.framework.HistogramProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.HistogramProto.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(); - min_ = 0D; - - max_ = 0D; - - num_ = 0D; - - sum_ = 0D; - - sumSquares_ = 0D; - - bucketLimit_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000001); - bucket_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_HistogramProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.HistogramProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.HistogramProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.HistogramProto build() { - org.tensorflow.proto.framework.HistogramProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.HistogramProto buildPartial() { - org.tensorflow.proto.framework.HistogramProto result = new org.tensorflow.proto.framework.HistogramProto(this); - int from_bitField0_ = bitField0_; - result.min_ = min_; - result.max_ = max_; - result.num_ = num_; - result.sum_ = sum_; - result.sumSquares_ = sumSquares_; - if (((bitField0_ & 0x00000001) != 0)) { - bucketLimit_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.bucketLimit_ = bucketLimit_; - if (((bitField0_ & 0x00000002) != 0)) { - bucket_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.bucket_ = bucket_; - 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.HistogramProto) { - return mergeFrom((org.tensorflow.proto.framework.HistogramProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.HistogramProto other) { - if (other == org.tensorflow.proto.framework.HistogramProto.getDefaultInstance()) return this; - if (other.getMin() != 0D) { - setMin(other.getMin()); - } - if (other.getMax() != 0D) { - setMax(other.getMax()); - } - if (other.getNum() != 0D) { - setNum(other.getNum()); - } - if (other.getSum() != 0D) { - setSum(other.getSum()); - } - if (other.getSumSquares() != 0D) { - setSumSquares(other.getSumSquares()); - } - if (!other.bucketLimit_.isEmpty()) { - if (bucketLimit_.isEmpty()) { - bucketLimit_ = other.bucketLimit_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBucketLimitIsMutable(); - bucketLimit_.addAll(other.bucketLimit_); - } - onChanged(); - } - if (!other.bucket_.isEmpty()) { - if (bucket_.isEmpty()) { - bucket_ = other.bucket_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureBucketIsMutable(); - bucket_.addAll(other.bucket_); - } - onChanged(); - } - 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.HistogramProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.HistogramProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private double min_ ; - /** - * double min = 1; - */ - public double getMin() { - return min_; - } - /** - * double min = 1; - */ - public Builder setMin(double value) { - - min_ = value; - onChanged(); - return this; - } - /** - * double min = 1; - */ - public Builder clearMin() { - - min_ = 0D; - onChanged(); - return this; - } - - private double max_ ; - /** - * double max = 2; - */ - public double getMax() { - return max_; - } - /** - * double max = 2; - */ - public Builder setMax(double value) { - - max_ = value; - onChanged(); - return this; - } - /** - * double max = 2; - */ - public Builder clearMax() { - - max_ = 0D; - onChanged(); - return this; - } - - private double num_ ; - /** - * double num = 3; - */ - public double getNum() { - return num_; - } - /** - * double num = 3; - */ - public Builder setNum(double value) { - - num_ = value; - onChanged(); - return this; - } - /** - * double num = 3; - */ - public Builder clearNum() { - - num_ = 0D; - onChanged(); - return this; - } - - private double sum_ ; - /** - * double sum = 4; - */ - public double getSum() { - return sum_; - } - /** - * double sum = 4; - */ - public Builder setSum(double value) { - - sum_ = value; - onChanged(); - return this; - } - /** - * double sum = 4; - */ - public Builder clearSum() { - - sum_ = 0D; - onChanged(); - return this; - } - - private double sumSquares_ ; - /** - * double sum_squares = 5; - */ - public double getSumSquares() { - return sumSquares_; - } - /** - * double sum_squares = 5; - */ - public Builder setSumSquares(double value) { - - sumSquares_ = value; - onChanged(); - return this; - } - /** - * double sum_squares = 5; - */ - public Builder clearSumSquares() { - - sumSquares_ = 0D; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList bucketLimit_ = emptyDoubleList(); - private void ensureBucketLimitIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - bucketLimit_ = mutableCopy(bucketLimit_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public java.util.List - getBucketLimitList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(bucketLimit_) : bucketLimit_; - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public int getBucketLimitCount() { - return bucketLimit_.size(); - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public double getBucketLimit(int index) { - return bucketLimit_.getDouble(index); - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public Builder setBucketLimit( - int index, double value) { - ensureBucketLimitIsMutable(); - bucketLimit_.setDouble(index, value); - onChanged(); - return this; - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public Builder addBucketLimit(double value) { - ensureBucketLimitIsMutable(); - bucketLimit_.addDouble(value); - onChanged(); - return this; - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public Builder addAllBucketLimit( - java.lang.Iterable values) { - ensureBucketLimitIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, bucketLimit_); - onChanged(); - return this; - } - /** - *
    -     * Parallel arrays encoding the bucket boundaries and the bucket values.
    -     * bucket(i) is the count for the bucket i.  The range for
    -     * a bucket is:
    -     *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -     *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -     * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - public Builder clearBucketLimit() { - bucketLimit_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList bucket_ = emptyDoubleList(); - private void ensureBucketIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - bucket_ = mutableCopy(bucket_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public java.util.List - getBucketList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(bucket_) : bucket_; - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public int getBucketCount() { - return bucket_.size(); - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public double getBucket(int index) { - return bucket_.getDouble(index); - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public Builder setBucket( - int index, double value) { - ensureBucketIsMutable(); - bucket_.setDouble(index, value); - onChanged(); - return this; - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public Builder addBucket(double value) { - ensureBucketIsMutable(); - bucket_.addDouble(value); - onChanged(); - return this; - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public Builder addAllBucket( - java.lang.Iterable values) { - ensureBucketIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, bucket_); - onChanged(); - return this; - } - /** - * repeated double bucket = 7 [packed = true]; - */ - public Builder clearBucket() { - bucket_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000002); - 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.HistogramProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.HistogramProto) - private static final org.tensorflow.proto.framework.HistogramProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.HistogramProto(); - } - - public static org.tensorflow.proto.framework.HistogramProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public HistogramProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HistogramProto(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.HistogramProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProtoOrBuilder.java deleted file mode 100644 index d76afe24d19..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/HistogramProtoOrBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -public interface HistogramProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.HistogramProto) - com.google.protobuf.MessageOrBuilder { - - /** - * double min = 1; - */ - double getMin(); - - /** - * double max = 2; - */ - double getMax(); - - /** - * double num = 3; - */ - double getNum(); - - /** - * double sum = 4; - */ - double getSum(); - - /** - * double sum_squares = 5; - */ - double getSumSquares(); - - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - java.util.List getBucketLimitList(); - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - int getBucketLimitCount(); - /** - *
    -   * Parallel arrays encoding the bucket boundaries and the bucket values.
    -   * bucket(i) is the count for the bucket i.  The range for
    -   * a bucket is:
    -   *   i == 0:  -DBL_MAX .. bucket_limit(0)
    -   *   i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    -   * 
    - * - * repeated double bucket_limit = 6 [packed = true]; - */ - double getBucketLimit(int index); - - /** - * repeated double bucket = 7 [packed = true]; - */ - java.util.List getBucketList(); - /** - * repeated double bucket = 7 [packed = true]; - */ - int getBucketCount(); - /** - * repeated double bucket = 7 [packed = true]; - */ - double getBucket(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLink.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLink.java deleted file mode 100644 index 89fbd7a8dec..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLink.java +++ /dev/null @@ -1,660 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.InterconnectLink} - */ -public final class InterconnectLink extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.InterconnectLink) - InterconnectLinkOrBuilder { -private static final long serialVersionUID = 0L; - // Use InterconnectLink.newBuilder() to construct. - private InterconnectLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private InterconnectLink() { - type_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new InterconnectLink(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private InterconnectLink( - 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: { - - deviceId_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 24: { - - strength_ = input.readInt32(); - 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.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.InterconnectLink.class, org.tensorflow.proto.framework.InterconnectLink.Builder.class); - } - - public static final int DEVICE_ID_FIELD_NUMBER = 1; - private int deviceId_; - /** - * int32 device_id = 1; - */ - public int getDeviceId() { - return deviceId_; - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - 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(); - type_ = s; - return s; - } - } - /** - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STRENGTH_FIELD_NUMBER = 3; - private int strength_; - /** - * int32 strength = 3; - */ - public int getStrength() { - return strength_; - } - - 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.writeInt32(1, deviceId_); - } - if (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (strength_ != 0) { - output.writeInt32(3, strength_); - } - 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 - .computeInt32Size(1, deviceId_); - } - if (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (strength_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, strength_); - } - 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.InterconnectLink)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.InterconnectLink other = (org.tensorflow.proto.framework.InterconnectLink) obj; - - if (getDeviceId() - != other.getDeviceId()) return false; - if (!getType() - .equals(other.getType())) return false; - if (getStrength() - != other.getStrength()) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + STRENGTH_FIELD_NUMBER; - hash = (53 * hash) + getStrength(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.InterconnectLink parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.InterconnectLink 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.InterconnectLink parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.InterconnectLink 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.InterconnectLink parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.InterconnectLink parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.InterconnectLink parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.InterconnectLink 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.InterconnectLink parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.InterconnectLink 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.InterconnectLink parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.InterconnectLink 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.InterconnectLink 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.InterconnectLink} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.InterconnectLink) - org.tensorflow.proto.framework.InterconnectLinkOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.InterconnectLink.class, org.tensorflow.proto.framework.InterconnectLink.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.InterconnectLink.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; - - type_ = ""; - - strength_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.InterconnectLink getDefaultInstanceForType() { - return org.tensorflow.proto.framework.InterconnectLink.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.InterconnectLink build() { - org.tensorflow.proto.framework.InterconnectLink result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.InterconnectLink buildPartial() { - org.tensorflow.proto.framework.InterconnectLink result = new org.tensorflow.proto.framework.InterconnectLink(this); - result.deviceId_ = deviceId_; - result.type_ = type_; - result.strength_ = strength_; - 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.InterconnectLink) { - return mergeFrom((org.tensorflow.proto.framework.InterconnectLink)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.InterconnectLink other) { - if (other == org.tensorflow.proto.framework.InterconnectLink.getDefaultInstance()) return this; - if (other.getDeviceId() != 0) { - setDeviceId(other.getDeviceId()); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.getStrength() != 0) { - setStrength(other.getStrength()); - } - 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.InterconnectLink parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.InterconnectLink) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int deviceId_ ; - /** - * int32 device_id = 1; - */ - public int getDeviceId() { - return deviceId_; - } - /** - * int32 device_id = 1; - */ - public Builder setDeviceId(int value) { - - deviceId_ = value; - onChanged(); - return this; - } - /** - * int32 device_id = 1; - */ - public Builder clearDeviceId() { - - deviceId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object type_ = ""; - /** - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string type = 2; - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - * string type = 2; - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - * string type = 2; - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private int strength_ ; - /** - * int32 strength = 3; - */ - public int getStrength() { - return strength_; - } - /** - * int32 strength = 3; - */ - public Builder setStrength(int value) { - - strength_ = value; - onChanged(); - return this; - } - /** - * int32 strength = 3; - */ - public Builder clearStrength() { - - strength_ = 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.InterconnectLink) - } - - // @@protoc_insertion_point(class_scope:tensorflow.InterconnectLink) - private static final org.tensorflow.proto.framework.InterconnectLink DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.InterconnectLink(); - } - - public static org.tensorflow.proto.framework.InterconnectLink getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public InterconnectLink parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new InterconnectLink(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.InterconnectLink getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDef.java deleted file mode 100644 index 76637537c9e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDef.java +++ /dev/null @@ -1,2420 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/kernel_def.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.KernelDef} - */ -public final class KernelDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.KernelDef) - KernelDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use KernelDef.newBuilder() to construct. - private KernelDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private KernelDef() { - op_ = ""; - deviceType_ = ""; - constraint_ = java.util.Collections.emptyList(); - hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY; - label_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new KernelDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private KernelDef( - 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(); - - op_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceType_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - constraint_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - constraint_.add( - input.readMessage(org.tensorflow.proto.framework.KernelDef.AttrConstraint.parser(), extensionRegistry)); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - hostMemoryArg_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - hostMemoryArg_.add(s); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - label_ = s; - break; - } - case 48: { - - priority_ = input.readInt32(); - 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)) { - constraint_ = java.util.Collections.unmodifiableList(constraint_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - hostMemoryArg_ = hostMemoryArg_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelDef.class, org.tensorflow.proto.framework.KernelDef.Builder.class); - } - - public interface AttrConstraintOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.KernelDef.AttrConstraint) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Name of an attr from the Op.
    -     * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -     * Name of an attr from the Op.
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - boolean hasAllowedValues(); - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - org.tensorflow.proto.framework.AttrValue getAllowedValues(); - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder(); - } - /** - * Protobuf type {@code tensorflow.KernelDef.AttrConstraint} - */ - public static final class AttrConstraint extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.KernelDef.AttrConstraint) - AttrConstraintOrBuilder { - private static final long serialVersionUID = 0L; - // Use AttrConstraint.newBuilder() to construct. - private AttrConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AttrConstraint() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AttrConstraint(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AttrConstraint( - 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 18: { - org.tensorflow.proto.framework.AttrValue.Builder subBuilder = null; - if (allowedValues_ != null) { - subBuilder = allowedValues_.toBuilder(); - } - allowedValues_ = input.readMessage(org.tensorflow.proto.framework.AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(allowedValues_); - allowedValues_ = subBuilder.buildPartial(); - } - - 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.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelDef.AttrConstraint.class, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -     * Name of an attr from the Op.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of an attr from the Op.
    -     * 
    - * - * 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 ALLOWED_VALUES_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.AttrValue allowedValues_; - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public boolean hasAllowedValues() { - return allowedValues_ != null; - } - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public org.tensorflow.proto.framework.AttrValue getAllowedValues() { - return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } - /** - *
    -     * A list of values that this kernel supports for this attr.
    -     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() { - return getAllowedValues(); - } - - 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 (allowedValues_ != null) { - output.writeMessage(2, getAllowedValues()); - } - 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 (allowedValues_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAllowedValues()); - } - 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.KernelDef.AttrConstraint)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.KernelDef.AttrConstraint other = (org.tensorflow.proto.framework.KernelDef.AttrConstraint) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasAllowedValues() != other.hasAllowedValues()) return false; - if (hasAllowedValues()) { - if (!getAllowedValues() - .equals(other.getAllowedValues())) 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(); - if (hasAllowedValues()) { - hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; - hash = (53 * hash) + getAllowedValues().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef.AttrConstraint) - org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelDef.AttrConstraint.class, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.KernelDef.AttrConstraint.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_ = ""; - - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef.AttrConstraint getDefaultInstanceForType() { - return org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef.AttrConstraint build() { - org.tensorflow.proto.framework.KernelDef.AttrConstraint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef.AttrConstraint buildPartial() { - org.tensorflow.proto.framework.KernelDef.AttrConstraint result = new org.tensorflow.proto.framework.KernelDef.AttrConstraint(this); - result.name_ = name_; - if (allowedValuesBuilder_ == null) { - result.allowedValues_ = allowedValues_; - } else { - result.allowedValues_ = allowedValuesBuilder_.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.KernelDef.AttrConstraint) { - return mergeFrom((org.tensorflow.proto.framework.KernelDef.AttrConstraint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.KernelDef.AttrConstraint other) { - if (other == org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasAllowedValues()) { - mergeAllowedValues(other.getAllowedValues()); - } - 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.KernelDef.AttrConstraint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.KernelDef.AttrConstraint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -       * Name of an attr from the Op.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name of an attr from the Op.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name of an attr from the Op.
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * Name of an attr from the Op.
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Name of an attr from the Op.
    -       * 
    - * - * 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 org.tensorflow.proto.framework.AttrValue allowedValues_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> allowedValuesBuilder_; - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public boolean hasAllowedValues() { - return allowedValuesBuilder_ != null || allowedValues_ != null; - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public org.tensorflow.proto.framework.AttrValue getAllowedValues() { - if (allowedValuesBuilder_ == null) { - return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } else { - return allowedValuesBuilder_.getMessage(); - } - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public Builder setAllowedValues(org.tensorflow.proto.framework.AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - allowedValues_ = value; - onChanged(); - } else { - allowedValuesBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public Builder setAllowedValues( - org.tensorflow.proto.framework.AttrValue.Builder builderForValue) { - if (allowedValuesBuilder_ == null) { - allowedValues_ = builderForValue.build(); - onChanged(); - } else { - allowedValuesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public Builder mergeAllowedValues(org.tensorflow.proto.framework.AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (allowedValues_ != null) { - allowedValues_ = - org.tensorflow.proto.framework.AttrValue.newBuilder(allowedValues_).mergeFrom(value).buildPartial(); - } else { - allowedValues_ = value; - } - onChanged(); - } else { - allowedValuesBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public Builder clearAllowedValues() { - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - onChanged(); - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - - return this; - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public org.tensorflow.proto.framework.AttrValue.Builder getAllowedValuesBuilder() { - - onChanged(); - return getAllowedValuesFieldBuilder().getBuilder(); - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() { - if (allowedValuesBuilder_ != null) { - return allowedValuesBuilder_.getMessageOrBuilder(); - } else { - return allowedValues_ == null ? - org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } - } - /** - *
    -       * A list of values that this kernel supports for this attr.
    -       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> - getAllowedValuesFieldBuilder() { - if (allowedValuesBuilder_ == null) { - allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder>( - getAllowedValues(), - getParentForChildren(), - isClean()); - allowedValues_ = null; - } - return allowedValuesBuilder_; - } - @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.KernelDef.AttrConstraint) - } - - // @@protoc_insertion_point(class_scope:tensorflow.KernelDef.AttrConstraint) - private static final org.tensorflow.proto.framework.KernelDef.AttrConstraint DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.KernelDef.AttrConstraint(); - } - - public static org.tensorflow.proto.framework.KernelDef.AttrConstraint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AttrConstraint parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttrConstraint(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.KernelDef.AttrConstraint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int OP_FIELD_NUMBER = 1; - private volatile java.lang.Object op_; - /** - *
    -   * Must match the name of an Op.
    -   * 
    - * - * string op = 1; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - 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(); - op_ = s; - return s; - } - } - /** - *
    -   * Must match the name of an Op.
    -   * 
    - * - * string op = 1; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object deviceType_; - /** - *
    -   * Type of device this kernel runs on.
    -   * 
    - * - * string device_type = 2; - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - 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(); - deviceType_ = s; - return s; - } - } - /** - *
    -   * Type of device this kernel runs on.
    -   * 
    - * - * string device_type = 2; - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONSTRAINT_FIELD_NUMBER = 3; - private java.util.List constraint_; - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public java.util.List getConstraintList() { - return constraint_; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public java.util.List - getConstraintOrBuilderList() { - return constraint_; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public int getConstraintCount() { - return constraint_.size(); - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraint getConstraint(int index) { - return constraint_.get(index); - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( - int index) { - return constraint_.get(index); - } - - public static final int HOST_MEMORY_ARG_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList hostMemoryArg_; - /** - *
    -   * Names of the Op's input_/output_args that reside in host memory
    -   * instead of device memory.
    -   * 
    - * - * repeated string host_memory_arg = 4; - */ - public com.google.protobuf.ProtocolStringList - getHostMemoryArgList() { - return hostMemoryArg_; - } - /** - *
    -   * Names of the Op's input_/output_args that reside in host memory
    -   * instead of device memory.
    -   * 
    - * - * repeated string host_memory_arg = 4; - */ - public int getHostMemoryArgCount() { - return hostMemoryArg_.size(); - } - /** - *
    -   * Names of the Op's input_/output_args that reside in host memory
    -   * instead of device memory.
    -   * 
    - * - * repeated string host_memory_arg = 4; - */ - public java.lang.String getHostMemoryArg(int index) { - return hostMemoryArg_.get(index); - } - /** - *
    -   * Names of the Op's input_/output_args that reside in host memory
    -   * instead of device memory.
    -   * 
    - * - * repeated string host_memory_arg = 4; - */ - public com.google.protobuf.ByteString - getHostMemoryArgBytes(int index) { - return hostMemoryArg_.getByteString(index); - } - - public static final int LABEL_FIELD_NUMBER = 5; - private volatile java.lang.Object label_; - /** - *
    -   * This allows experimental kernels to be registered for an op that
    -   * won't be used unless the user specifies a "_kernel" attr with
    -   * value matching this.
    -   * 
    - * - * string label = 5; - */ - public java.lang.String getLabel() { - java.lang.Object ref = label_; - 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(); - label_ = s; - return s; - } - } - /** - *
    -   * This allows experimental kernels to be registered for an op that
    -   * won't be used unless the user specifies a "_kernel" attr with
    -   * value matching this.
    -   * 
    - * - * string label = 5; - */ - public com.google.protobuf.ByteString - getLabelBytes() { - java.lang.Object ref = label_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - label_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRIORITY_FIELD_NUMBER = 6; - private int priority_; - /** - *
    -   * Prioritization of kernel amongst different devices. By default we assume
    -   * priority is 0. The higher the priority the better. By default (i.e. if
    -   * this is not set), we prefer GPU kernels over CPU.
    -   * 
    - * - * int32 priority = 6; - */ - public int getPriority() { - return priority_; - } - - 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 (!getOpBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, op_); - } - if (!getDeviceTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); - } - for (int i = 0; i < constraint_.size(); i++) { - output.writeMessage(3, constraint_.get(i)); - } - for (int i = 0; i < hostMemoryArg_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hostMemoryArg_.getRaw(i)); - } - if (!getLabelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, label_); - } - if (priority_ != 0) { - output.writeInt32(6, priority_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getOpBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, op_); - } - if (!getDeviceTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); - } - for (int i = 0; i < constraint_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, constraint_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < hostMemoryArg_.size(); i++) { - dataSize += computeStringSizeNoTag(hostMemoryArg_.getRaw(i)); - } - size += dataSize; - size += 1 * getHostMemoryArgList().size(); - } - if (!getLabelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, label_); - } - if (priority_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, priority_); - } - 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.KernelDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.KernelDef other = (org.tensorflow.proto.framework.KernelDef) obj; - - if (!getOp() - .equals(other.getOp())) return false; - if (!getDeviceType() - .equals(other.getDeviceType())) return false; - if (!getConstraintList() - .equals(other.getConstraintList())) return false; - if (!getHostMemoryArgList() - .equals(other.getHostMemoryArgList())) return false; - if (!getLabel() - .equals(other.getLabel())) return false; - if (getPriority() - != other.getPriority()) 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) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOp().hashCode(); - hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getDeviceType().hashCode(); - if (getConstraintCount() > 0) { - hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER; - hash = (53 * hash) + getConstraintList().hashCode(); - } - if (getHostMemoryArgCount() > 0) { - hash = (37 * hash) + HOST_MEMORY_ARG_FIELD_NUMBER; - hash = (53 * hash) + getHostMemoryArgList().hashCode(); - } - hash = (37 * hash) + LABEL_FIELD_NUMBER; - hash = (53 * hash) + getLabel().hashCode(); - hash = (37 * hash) + PRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPriority(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.KernelDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef 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.KernelDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef 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.KernelDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.KernelDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef 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.KernelDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef 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.KernelDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelDef 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.KernelDef 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.KernelDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef) - org.tensorflow.proto.framework.KernelDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelDef.class, org.tensorflow.proto.framework.KernelDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.KernelDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getConstraintFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - op_ = ""; - - deviceType_ = ""; - - if (constraintBuilder_ == null) { - constraint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - constraintBuilder_.clear(); - } - hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - label_ = ""; - - priority_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.KernelDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef build() { - org.tensorflow.proto.framework.KernelDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelDef buildPartial() { - org.tensorflow.proto.framework.KernelDef result = new org.tensorflow.proto.framework.KernelDef(this); - int from_bitField0_ = bitField0_; - result.op_ = op_; - result.deviceType_ = deviceType_; - if (constraintBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - constraint_ = java.util.Collections.unmodifiableList(constraint_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.constraint_ = constraint_; - } else { - result.constraint_ = constraintBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - hostMemoryArg_ = hostMemoryArg_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.hostMemoryArg_ = hostMemoryArg_; - result.label_ = label_; - result.priority_ = priority_; - 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.KernelDef) { - return mergeFrom((org.tensorflow.proto.framework.KernelDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.KernelDef other) { - if (other == org.tensorflow.proto.framework.KernelDef.getDefaultInstance()) return this; - if (!other.getOp().isEmpty()) { - op_ = other.op_; - onChanged(); - } - if (!other.getDeviceType().isEmpty()) { - deviceType_ = other.deviceType_; - onChanged(); - } - if (constraintBuilder_ == null) { - if (!other.constraint_.isEmpty()) { - if (constraint_.isEmpty()) { - constraint_ = other.constraint_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConstraintIsMutable(); - constraint_.addAll(other.constraint_); - } - onChanged(); - } - } else { - if (!other.constraint_.isEmpty()) { - if (constraintBuilder_.isEmpty()) { - constraintBuilder_.dispose(); - constraintBuilder_ = null; - constraint_ = other.constraint_; - bitField0_ = (bitField0_ & ~0x00000001); - constraintBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConstraintFieldBuilder() : null; - } else { - constraintBuilder_.addAllMessages(other.constraint_); - } - } - } - if (!other.hostMemoryArg_.isEmpty()) { - if (hostMemoryArg_.isEmpty()) { - hostMemoryArg_ = other.hostMemoryArg_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureHostMemoryArgIsMutable(); - hostMemoryArg_.addAll(other.hostMemoryArg_); - } - onChanged(); - } - if (!other.getLabel().isEmpty()) { - label_ = other.label_; - onChanged(); - } - if (other.getPriority() != 0) { - setPriority(other.getPriority()); - } - 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.KernelDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.KernelDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object op_ = ""; - /** - *
    -     * Must match the name of an Op.
    -     * 
    - * - * string op = 1; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - op_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Must match the name of an Op.
    -     * 
    - * - * string op = 1; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Must match the name of an Op.
    -     * 
    - * - * string op = 1; - */ - public Builder setOp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - op_ = value; - onChanged(); - return this; - } - /** - *
    -     * Must match the name of an Op.
    -     * 
    - * - * string op = 1; - */ - public Builder clearOp() { - - op_ = getDefaultInstance().getOp(); - onChanged(); - return this; - } - /** - *
    -     * Must match the name of an Op.
    -     * 
    - * - * string op = 1; - */ - public Builder setOpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - op_ = value; - onChanged(); - return this; - } - - private java.lang.Object deviceType_ = ""; - /** - *
    -     * Type of device this kernel runs on.
    -     * 
    - * - * string device_type = 2; - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Type of device this kernel runs on.
    -     * 
    - * - * string device_type = 2; - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Type of device this kernel runs on.
    -     * 
    - * - * string device_type = 2; - */ - public Builder setDeviceType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceType_ = value; - onChanged(); - return this; - } - /** - *
    -     * Type of device this kernel runs on.
    -     * 
    - * - * string device_type = 2; - */ - public Builder clearDeviceType() { - - deviceType_ = getDefaultInstance().getDeviceType(); - onChanged(); - return this; - } - /** - *
    -     * Type of device this kernel runs on.
    -     * 
    - * - * string device_type = 2; - */ - public Builder setDeviceTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceType_ = value; - onChanged(); - return this; - } - - private java.util.List constraint_ = - java.util.Collections.emptyList(); - private void ensureConstraintIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - constraint_ = new java.util.ArrayList(constraint_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> constraintBuilder_; - - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public java.util.List getConstraintList() { - if (constraintBuilder_ == null) { - return java.util.Collections.unmodifiableList(constraint_); - } else { - return constraintBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public int getConstraintCount() { - if (constraintBuilder_ == null) { - return constraint_.size(); - } else { - return constraintBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraint getConstraint(int index) { - if (constraintBuilder_ == null) { - return constraint_.get(index); - } else { - return constraintBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder setConstraint( - int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint value) { - if (constraintBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstraintIsMutable(); - constraint_.set(index, value); - onChanged(); - } else { - constraintBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder setConstraint( - int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) { - if (constraintBuilder_ == null) { - ensureConstraintIsMutable(); - constraint_.set(index, builderForValue.build()); - onChanged(); - } else { - constraintBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder addConstraint(org.tensorflow.proto.framework.KernelDef.AttrConstraint value) { - if (constraintBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstraintIsMutable(); - constraint_.add(value); - onChanged(); - } else { - constraintBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder addConstraint( - int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint value) { - if (constraintBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConstraintIsMutable(); - constraint_.add(index, value); - onChanged(); - } else { - constraintBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder addConstraint( - org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) { - if (constraintBuilder_ == null) { - ensureConstraintIsMutable(); - constraint_.add(builderForValue.build()); - onChanged(); - } else { - constraintBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder addConstraint( - int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) { - if (constraintBuilder_ == null) { - ensureConstraintIsMutable(); - constraint_.add(index, builderForValue.build()); - onChanged(); - } else { - constraintBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder addAllConstraint( - java.lang.Iterable values) { - if (constraintBuilder_ == null) { - ensureConstraintIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, constraint_); - onChanged(); - } else { - constraintBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder clearConstraint() { - if (constraintBuilder_ == null) { - constraint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - constraintBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public Builder removeConstraint(int index) { - if (constraintBuilder_ == null) { - ensureConstraintIsMutable(); - constraint_.remove(index); - onChanged(); - } else { - constraintBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder getConstraintBuilder( - int index) { - return getConstraintFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( - int index) { - if (constraintBuilder_ == null) { - return constraint_.get(index); } else { - return constraintBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public java.util.List - getConstraintOrBuilderList() { - if (constraintBuilder_ != null) { - return constraintBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(constraint_); - } - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder addConstraintBuilder() { - return getConstraintFieldBuilder().addBuilder( - org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance()); - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder addConstraintBuilder( - int index) { - return getConstraintFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance()); - } - /** - * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; - */ - public java.util.List - getConstraintBuilderList() { - return getConstraintFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> - getConstraintFieldBuilder() { - if (constraintBuilder_ == null) { - constraintBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder>( - constraint_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - constraint_ = null; - } - return constraintBuilder_; - } - - private com.google.protobuf.LazyStringList hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureHostMemoryArgIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - hostMemoryArg_ = new com.google.protobuf.LazyStringArrayList(hostMemoryArg_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public com.google.protobuf.ProtocolStringList - getHostMemoryArgList() { - return hostMemoryArg_.getUnmodifiableView(); - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public int getHostMemoryArgCount() { - return hostMemoryArg_.size(); - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public java.lang.String getHostMemoryArg(int index) { - return hostMemoryArg_.get(index); - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public com.google.protobuf.ByteString - getHostMemoryArgBytes(int index) { - return hostMemoryArg_.getByteString(index); - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public Builder setHostMemoryArg( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHostMemoryArgIsMutable(); - hostMemoryArg_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public Builder addHostMemoryArg( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHostMemoryArgIsMutable(); - hostMemoryArg_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public Builder addAllHostMemoryArg( - java.lang.Iterable values) { - ensureHostMemoryArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, hostMemoryArg_); - onChanged(); - return this; - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public Builder clearHostMemoryArg() { - hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * Names of the Op's input_/output_args that reside in host memory
    -     * instead of device memory.
    -     * 
    - * - * repeated string host_memory_arg = 4; - */ - public Builder addHostMemoryArgBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureHostMemoryArgIsMutable(); - hostMemoryArg_.add(value); - onChanged(); - return this; - } - - private java.lang.Object label_ = ""; - /** - *
    -     * This allows experimental kernels to be registered for an op that
    -     * won't be used unless the user specifies a "_kernel" attr with
    -     * value matching this.
    -     * 
    - * - * string label = 5; - */ - public java.lang.String getLabel() { - java.lang.Object ref = label_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - label_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * This allows experimental kernels to be registered for an op that
    -     * won't be used unless the user specifies a "_kernel" attr with
    -     * value matching this.
    -     * 
    - * - * string label = 5; - */ - public com.google.protobuf.ByteString - getLabelBytes() { - java.lang.Object ref = label_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - label_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * This allows experimental kernels to be registered for an op that
    -     * won't be used unless the user specifies a "_kernel" attr with
    -     * value matching this.
    -     * 
    - * - * string label = 5; - */ - public Builder setLabel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - label_ = value; - onChanged(); - return this; - } - /** - *
    -     * This allows experimental kernels to be registered for an op that
    -     * won't be used unless the user specifies a "_kernel" attr with
    -     * value matching this.
    -     * 
    - * - * string label = 5; - */ - public Builder clearLabel() { - - label_ = getDefaultInstance().getLabel(); - onChanged(); - return this; - } - /** - *
    -     * This allows experimental kernels to be registered for an op that
    -     * won't be used unless the user specifies a "_kernel" attr with
    -     * value matching this.
    -     * 
    - * - * string label = 5; - */ - public Builder setLabelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - label_ = value; - onChanged(); - return this; - } - - private int priority_ ; - /** - *
    -     * Prioritization of kernel amongst different devices. By default we assume
    -     * priority is 0. The higher the priority the better. By default (i.e. if
    -     * this is not set), we prefer GPU kernels over CPU.
    -     * 
    - * - * int32 priority = 6; - */ - public int getPriority() { - return priority_; - } - /** - *
    -     * Prioritization of kernel amongst different devices. By default we assume
    -     * priority is 0. The higher the priority the better. By default (i.e. if
    -     * this is not set), we prefer GPU kernels over CPU.
    -     * 
    - * - * int32 priority = 6; - */ - public Builder setPriority(int value) { - - priority_ = value; - onChanged(); - return this; - } - /** - *
    -     * Prioritization of kernel amongst different devices. By default we assume
    -     * priority is 0. The higher the priority the better. By default (i.e. if
    -     * this is not set), we prefer GPU kernels over CPU.
    -     * 
    - * - * int32 priority = 6; - */ - public Builder clearPriority() { - - priority_ = 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.KernelDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.KernelDef) - private static final org.tensorflow.proto.framework.KernelDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.KernelDef(); - } - - public static org.tensorflow.proto.framework.KernelDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public KernelDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new KernelDef(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.KernelDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefProtos.java deleted file mode 100644 index 50b235b600f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefProtos.java +++ /dev/null @@ -1,83 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/kernel_def.proto - -package org.tensorflow.proto.framework; - -public final class KernelDefProtos { - private KernelDefProtos() {} - 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_KernelDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_KernelDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_KernelList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_KernelList_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/framework/kernel_def.p" + - "roto\022\ntensorflow\032*tensorflow/core/framew" + - "ork/attr_value.proto\"\357\001\n\tKernelDef\022\n\n\002op" + - "\030\001 \001(\t\022\023\n\013device_type\030\002 \001(\t\0228\n\nconstrain" + - "t\030\003 \003(\0132$.tensorflow.KernelDef.AttrConst" + - "raint\022\027\n\017host_memory_arg\030\004 \003(\t\022\r\n\005label\030" + - "\005 \001(\t\022\020\n\010priority\030\006 \001(\005\032M\n\016AttrConstrain" + - "t\022\014\n\004name\030\001 \001(\t\022-\n\016allowed_values\030\002 \001(\0132" + - "\025.tensorflow.AttrValue\"3\n\nKernelList\022%\n\006" + - "kernel\030\001 \003(\0132\025.tensorflow.KernelDefB\211\001\n\036" + - "org.tensorflow.proto.frameworkB\017KernelDe" + - "fProtosP\001ZQgithub.com/tensorflow/tensorf" + - "low/tensorflow/go/core/framework/kernel_" + - "def_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - }); - internal_static_tensorflow_KernelDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_KernelDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_KernelDef_descriptor, - new java.lang.String[] { "Op", "DeviceType", "Constraint", "HostMemoryArg", "Label", "Priority", }); - internal_static_tensorflow_KernelDef_AttrConstraint_descriptor = - internal_static_tensorflow_KernelDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_KernelDef_AttrConstraint_descriptor, - new java.lang.String[] { "Name", "AllowedValues", }); - internal_static_tensorflow_KernelList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_KernelList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_KernelList_descriptor, - new java.lang.String[] { "Kernel", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelList.java deleted file mode 100644 index 06c6e5a22f2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelList.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/kernel_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A collection of KernelDefs
    - * 
    - * - * Protobuf type {@code tensorflow.KernelList} - */ -public final class KernelList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.KernelList) - KernelListOrBuilder { -private static final long serialVersionUID = 0L; - // Use KernelList.newBuilder() to construct. - private KernelList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private KernelList() { - kernel_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new KernelList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private KernelList( - 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)) { - kernel_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - kernel_.add( - input.readMessage(org.tensorflow.proto.framework.KernelDef.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_ & 0x00000001) != 0)) { - kernel_ = java.util.Collections.unmodifiableList(kernel_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelList.class, org.tensorflow.proto.framework.KernelList.Builder.class); - } - - public static final int KERNEL_FIELD_NUMBER = 1; - private java.util.List kernel_; - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public java.util.List getKernelList() { - return kernel_; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public java.util.List - getKernelOrBuilderList() { - return kernel_; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public int getKernelCount() { - return kernel_.size(); - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDef getKernel(int index) { - return kernel_.get(index); - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDefOrBuilder getKernelOrBuilder( - int index) { - return kernel_.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 { - for (int i = 0; i < kernel_.size(); i++) { - output.writeMessage(1, kernel_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < kernel_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, kernel_.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.KernelList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.KernelList other = (org.tensorflow.proto.framework.KernelList) obj; - - if (!getKernelList() - .equals(other.getKernelList())) 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 (getKernelCount() > 0) { - hash = (37 * hash) + KERNEL_FIELD_NUMBER; - hash = (53 * hash) + getKernelList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.KernelList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelList 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.KernelList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelList 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.KernelList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.KernelList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.KernelList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelList 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.KernelList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelList 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.KernelList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.KernelList 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.KernelList 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 collection of KernelDefs
    -   * 
    - * - * Protobuf type {@code tensorflow.KernelList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.KernelList) - org.tensorflow.proto.framework.KernelListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.KernelList.class, org.tensorflow.proto.framework.KernelList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.KernelList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getKernelFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (kernelBuilder_ == null) { - kernel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - kernelBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.KernelList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelList build() { - org.tensorflow.proto.framework.KernelList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.KernelList buildPartial() { - org.tensorflow.proto.framework.KernelList result = new org.tensorflow.proto.framework.KernelList(this); - int from_bitField0_ = bitField0_; - if (kernelBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - kernel_ = java.util.Collections.unmodifiableList(kernel_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.kernel_ = kernel_; - } else { - result.kernel_ = kernelBuilder_.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.KernelList) { - return mergeFrom((org.tensorflow.proto.framework.KernelList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.KernelList other) { - if (other == org.tensorflow.proto.framework.KernelList.getDefaultInstance()) return this; - if (kernelBuilder_ == null) { - if (!other.kernel_.isEmpty()) { - if (kernel_.isEmpty()) { - kernel_ = other.kernel_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureKernelIsMutable(); - kernel_.addAll(other.kernel_); - } - onChanged(); - } - } else { - if (!other.kernel_.isEmpty()) { - if (kernelBuilder_.isEmpty()) { - kernelBuilder_.dispose(); - kernelBuilder_ = null; - kernel_ = other.kernel_; - bitField0_ = (bitField0_ & ~0x00000001); - kernelBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getKernelFieldBuilder() : null; - } else { - kernelBuilder_.addAllMessages(other.kernel_); - } - } - } - 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.KernelList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.KernelList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List kernel_ = - java.util.Collections.emptyList(); - private void ensureKernelIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - kernel_ = new java.util.ArrayList(kernel_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef, org.tensorflow.proto.framework.KernelDef.Builder, org.tensorflow.proto.framework.KernelDefOrBuilder> kernelBuilder_; - - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public java.util.List getKernelList() { - if (kernelBuilder_ == null) { - return java.util.Collections.unmodifiableList(kernel_); - } else { - return kernelBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public int getKernelCount() { - if (kernelBuilder_ == null) { - return kernel_.size(); - } else { - return kernelBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDef getKernel(int index) { - if (kernelBuilder_ == null) { - return kernel_.get(index); - } else { - return kernelBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder setKernel( - int index, org.tensorflow.proto.framework.KernelDef value) { - if (kernelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKernelIsMutable(); - kernel_.set(index, value); - onChanged(); - } else { - kernelBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder setKernel( - int index, org.tensorflow.proto.framework.KernelDef.Builder builderForValue) { - if (kernelBuilder_ == null) { - ensureKernelIsMutable(); - kernel_.set(index, builderForValue.build()); - onChanged(); - } else { - kernelBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder addKernel(org.tensorflow.proto.framework.KernelDef value) { - if (kernelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKernelIsMutable(); - kernel_.add(value); - onChanged(); - } else { - kernelBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder addKernel( - int index, org.tensorflow.proto.framework.KernelDef value) { - if (kernelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureKernelIsMutable(); - kernel_.add(index, value); - onChanged(); - } else { - kernelBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder addKernel( - org.tensorflow.proto.framework.KernelDef.Builder builderForValue) { - if (kernelBuilder_ == null) { - ensureKernelIsMutable(); - kernel_.add(builderForValue.build()); - onChanged(); - } else { - kernelBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder addKernel( - int index, org.tensorflow.proto.framework.KernelDef.Builder builderForValue) { - if (kernelBuilder_ == null) { - ensureKernelIsMutable(); - kernel_.add(index, builderForValue.build()); - onChanged(); - } else { - kernelBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder addAllKernel( - java.lang.Iterable values) { - if (kernelBuilder_ == null) { - ensureKernelIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, kernel_); - onChanged(); - } else { - kernelBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder clearKernel() { - if (kernelBuilder_ == null) { - kernel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - kernelBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public Builder removeKernel(int index) { - if (kernelBuilder_ == null) { - ensureKernelIsMutable(); - kernel_.remove(index); - onChanged(); - } else { - kernelBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDef.Builder getKernelBuilder( - int index) { - return getKernelFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDefOrBuilder getKernelOrBuilder( - int index) { - if (kernelBuilder_ == null) { - return kernel_.get(index); } else { - return kernelBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public java.util.List - getKernelOrBuilderList() { - if (kernelBuilder_ != null) { - return kernelBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(kernel_); - } - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDef.Builder addKernelBuilder() { - return getKernelFieldBuilder().addBuilder( - org.tensorflow.proto.framework.KernelDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public org.tensorflow.proto.framework.KernelDef.Builder addKernelBuilder( - int index) { - return getKernelFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.KernelDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - public java.util.List - getKernelBuilderList() { - return getKernelFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef, org.tensorflow.proto.framework.KernelDef.Builder, org.tensorflow.proto.framework.KernelDefOrBuilder> - getKernelFieldBuilder() { - if (kernelBuilder_ == null) { - kernelBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.KernelDef, org.tensorflow.proto.framework.KernelDef.Builder, org.tensorflow.proto.framework.KernelDefOrBuilder>( - kernel_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - kernel_ = null; - } - return kernelBuilder_; - } - @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.KernelList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.KernelList) - private static final org.tensorflow.proto.framework.KernelList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.KernelList(); - } - - public static org.tensorflow.proto.framework.KernelList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public KernelList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new KernelList(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.KernelList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelListOrBuilder.java deleted file mode 100644 index 31c95b5de9d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/kernel_def.proto - -package org.tensorflow.proto.framework; - -public interface KernelListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.KernelList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - java.util.List - getKernelList(); - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - org.tensorflow.proto.framework.KernelDef getKernel(int index); - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - int getKernelCount(); - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - java.util.List - getKernelOrBuilderList(); - /** - * repeated .tensorflow.KernelDef kernel = 1; - */ - org.tensorflow.proto.framework.KernelDefOrBuilder getKernelOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValue.java deleted file mode 100644 index 56101ea237c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValue.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a Python list.
    - * 
    - * - * Protobuf type {@code tensorflow.ListValue} - */ -public final class ListValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ListValue) - ListValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListValue.newBuilder() to construct. - private ListValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListValue() { - values_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListValue( - 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)) { - values_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - values_.add( - input.readMessage(org.tensorflow.proto.framework.StructuredValue.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_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ListValue.class, org.tensorflow.proto.framework.ListValue.Builder.class); - } - - public static final int VALUES_FIELD_NUMBER = 1; - private java.util.List values_; - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List getValuesList() { - return values_; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesOrBuilderList() { - return values_; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public int getValuesCount() { - return values_.size(); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getValues(int index) { - return values_.get(index); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index) { - return values_.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 { - for (int i = 0; i < values_.size(); i++) { - output.writeMessage(1, values_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < values_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, values_.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.ListValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ListValue other = (org.tensorflow.proto.framework.ListValue) obj; - - if (!getValuesList() - .equals(other.getValuesList())) 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 (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ListValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ListValue 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.ListValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ListValue 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.ListValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ListValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ListValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ListValue 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.ListValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ListValue 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.ListValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ListValue 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.ListValue 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; - } - /** - *
    -   * Represents a Python list.
    -   * 
    - * - * Protobuf type {@code tensorflow.ListValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ListValue) - org.tensorflow.proto.framework.ListValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ListValue.class, org.tensorflow.proto.framework.ListValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ListValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getValuesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - valuesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_ListValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ListValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ListValue build() { - org.tensorflow.proto.framework.ListValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ListValue buildPartial() { - org.tensorflow.proto.framework.ListValue result = new org.tensorflow.proto.framework.ListValue(this); - int from_bitField0_ = bitField0_; - if (valuesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.values_ = values_; - } else { - result.values_ = valuesBuilder_.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.ListValue) { - return mergeFrom((org.tensorflow.proto.framework.ListValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ListValue other) { - if (other == org.tensorflow.proto.framework.ListValue.getDefaultInstance()) return this; - if (valuesBuilder_ == null) { - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - } else { - if (!other.values_.isEmpty()) { - if (valuesBuilder_.isEmpty()) { - valuesBuilder_.dispose(); - valuesBuilder_ = null; - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - valuesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getValuesFieldBuilder() : null; - } else { - valuesBuilder_.addAllMessages(other.values_); - } - } - } - 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.ListValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ListValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List values_ = - java.util.Collections.emptyList(); - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - values_ = new java.util.ArrayList(values_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> valuesBuilder_; - - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List getValuesList() { - if (valuesBuilder_ == null) { - return java.util.Collections.unmodifiableList(values_); - } else { - return valuesBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public int getValuesCount() { - if (valuesBuilder_ == null) { - return values_.size(); - } else { - return valuesBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getValues(int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - } else { - valuesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.set(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues(org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - } else { - valuesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(index, value); - onChanged(); - } else { - valuesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addAllValues( - java.lang.Iterable values) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - } else { - valuesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder clearValues() { - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - valuesBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder removeValues(int index) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.remove(index); - onChanged(); - } else { - valuesBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getValuesBuilder( - int index) { - return getValuesFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index) { - if (valuesBuilder_ == null) { - return values_.get(index); } else { - return valuesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesOrBuilderList() { - if (valuesBuilder_ != null) { - return valuesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(values_); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder addValuesBuilder() { - return getValuesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder addValuesBuilder( - int index) { - return getValuesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesBuilderList() { - return getValuesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getValuesFieldBuilder() { - if (valuesBuilder_ == null) { - valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - values_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - values_ = null; - } - return valuesBuilder_; - } - @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.ListValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ListValue) - private static final org.tensorflow.proto.framework.ListValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ListValue(); - } - - public static org.tensorflow.proto.framework.ListValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListValue(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.ListValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValueOrBuilder.java deleted file mode 100644 index e4b2d7076d9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ListValueOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface ListValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ListValue) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - java.util.List - getValuesList(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - org.tensorflow.proto.framework.StructuredValue getValues(int index); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - int getValuesCount(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - java.util.List - getValuesOrBuilderList(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinks.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinks.java deleted file mode 100644 index 2219a69600d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinks.java +++ /dev/null @@ -1,765 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.LocalLinks} - */ -public final class LocalLinks extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.LocalLinks) - LocalLinksOrBuilder { -private static final long serialVersionUID = 0L; - // Use LocalLinks.newBuilder() to construct. - private LocalLinks(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LocalLinks() { - link_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LocalLinks(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LocalLinks( - 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)) { - link_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - link_.add( - input.readMessage(org.tensorflow.proto.framework.InterconnectLink.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_ & 0x00000001) != 0)) { - link_ = java.util.Collections.unmodifiableList(link_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.LocalLinks.class, org.tensorflow.proto.framework.LocalLinks.Builder.class); - } - - public static final int LINK_FIELD_NUMBER = 1; - private java.util.List link_; - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public java.util.List getLinkList() { - return link_; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public java.util.List - getLinkOrBuilderList() { - return link_; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public int getLinkCount() { - return link_.size(); - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLink getLink(int index) { - return link_.get(index); - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLinkOrBuilder getLinkOrBuilder( - int index) { - return link_.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 { - for (int i = 0; i < link_.size(); i++) { - output.writeMessage(1, link_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < link_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, link_.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.LocalLinks)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.LocalLinks other = (org.tensorflow.proto.framework.LocalLinks) obj; - - if (!getLinkList() - .equals(other.getLinkList())) 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 (getLinkCount() > 0) { - hash = (37 * hash) + LINK_FIELD_NUMBER; - hash = (53 * hash) + getLinkList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.LocalLinks parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LocalLinks 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.LocalLinks parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LocalLinks 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.LocalLinks parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LocalLinks parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.LocalLinks parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LocalLinks 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.LocalLinks parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LocalLinks 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.LocalLinks parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LocalLinks 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.LocalLinks 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.LocalLinks} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.LocalLinks) - org.tensorflow.proto.framework.LocalLinksOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.LocalLinks.class, org.tensorflow.proto.framework.LocalLinks.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.LocalLinks.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getLinkFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (linkBuilder_ == null) { - link_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - linkBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.LocalLinks getDefaultInstanceForType() { - return org.tensorflow.proto.framework.LocalLinks.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.LocalLinks build() { - org.tensorflow.proto.framework.LocalLinks result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.LocalLinks buildPartial() { - org.tensorflow.proto.framework.LocalLinks result = new org.tensorflow.proto.framework.LocalLinks(this); - int from_bitField0_ = bitField0_; - if (linkBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - link_ = java.util.Collections.unmodifiableList(link_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.link_ = link_; - } else { - result.link_ = linkBuilder_.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.LocalLinks) { - return mergeFrom((org.tensorflow.proto.framework.LocalLinks)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.LocalLinks other) { - if (other == org.tensorflow.proto.framework.LocalLinks.getDefaultInstance()) return this; - if (linkBuilder_ == null) { - if (!other.link_.isEmpty()) { - if (link_.isEmpty()) { - link_ = other.link_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureLinkIsMutable(); - link_.addAll(other.link_); - } - onChanged(); - } - } else { - if (!other.link_.isEmpty()) { - if (linkBuilder_.isEmpty()) { - linkBuilder_.dispose(); - linkBuilder_ = null; - link_ = other.link_; - bitField0_ = (bitField0_ & ~0x00000001); - linkBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkFieldBuilder() : null; - } else { - linkBuilder_.addAllMessages(other.link_); - } - } - } - 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.LocalLinks parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.LocalLinks) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List link_ = - java.util.Collections.emptyList(); - private void ensureLinkIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - link_ = new java.util.ArrayList(link_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.InterconnectLink, org.tensorflow.proto.framework.InterconnectLink.Builder, org.tensorflow.proto.framework.InterconnectLinkOrBuilder> linkBuilder_; - - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public java.util.List getLinkList() { - if (linkBuilder_ == null) { - return java.util.Collections.unmodifiableList(link_); - } else { - return linkBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public int getLinkCount() { - if (linkBuilder_ == null) { - return link_.size(); - } else { - return linkBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLink getLink(int index) { - if (linkBuilder_ == null) { - return link_.get(index); - } else { - return linkBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder setLink( - int index, org.tensorflow.proto.framework.InterconnectLink value) { - if (linkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinkIsMutable(); - link_.set(index, value); - onChanged(); - } else { - linkBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder setLink( - int index, org.tensorflow.proto.framework.InterconnectLink.Builder builderForValue) { - if (linkBuilder_ == null) { - ensureLinkIsMutable(); - link_.set(index, builderForValue.build()); - onChanged(); - } else { - linkBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder addLink(org.tensorflow.proto.framework.InterconnectLink value) { - if (linkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinkIsMutable(); - link_.add(value); - onChanged(); - } else { - linkBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder addLink( - int index, org.tensorflow.proto.framework.InterconnectLink value) { - if (linkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinkIsMutable(); - link_.add(index, value); - onChanged(); - } else { - linkBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder addLink( - org.tensorflow.proto.framework.InterconnectLink.Builder builderForValue) { - if (linkBuilder_ == null) { - ensureLinkIsMutable(); - link_.add(builderForValue.build()); - onChanged(); - } else { - linkBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder addLink( - int index, org.tensorflow.proto.framework.InterconnectLink.Builder builderForValue) { - if (linkBuilder_ == null) { - ensureLinkIsMutable(); - link_.add(index, builderForValue.build()); - onChanged(); - } else { - linkBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder addAllLink( - java.lang.Iterable values) { - if (linkBuilder_ == null) { - ensureLinkIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, link_); - onChanged(); - } else { - linkBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder clearLink() { - if (linkBuilder_ == null) { - link_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - linkBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public Builder removeLink(int index) { - if (linkBuilder_ == null) { - ensureLinkIsMutable(); - link_.remove(index); - onChanged(); - } else { - linkBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLink.Builder getLinkBuilder( - int index) { - return getLinkFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLinkOrBuilder getLinkOrBuilder( - int index) { - if (linkBuilder_ == null) { - return link_.get(index); } else { - return linkBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public java.util.List - getLinkOrBuilderList() { - if (linkBuilder_ != null) { - return linkBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(link_); - } - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLink.Builder addLinkBuilder() { - return getLinkFieldBuilder().addBuilder( - org.tensorflow.proto.framework.InterconnectLink.getDefaultInstance()); - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public org.tensorflow.proto.framework.InterconnectLink.Builder addLinkBuilder( - int index) { - return getLinkFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.InterconnectLink.getDefaultInstance()); - } - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - public java.util.List - getLinkBuilderList() { - return getLinkFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.InterconnectLink, org.tensorflow.proto.framework.InterconnectLink.Builder, org.tensorflow.proto.framework.InterconnectLinkOrBuilder> - getLinkFieldBuilder() { - if (linkBuilder_ == null) { - linkBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.InterconnectLink, org.tensorflow.proto.framework.InterconnectLink.Builder, org.tensorflow.proto.framework.InterconnectLinkOrBuilder>( - link_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - link_ = null; - } - return linkBuilder_; - } - @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.LocalLinks) - } - - // @@protoc_insertion_point(class_scope:tensorflow.LocalLinks) - private static final org.tensorflow.proto.framework.LocalLinks DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.LocalLinks(); - } - - public static org.tensorflow.proto.framework.LocalLinks getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LocalLinks parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LocalLinks(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.LocalLinks getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinksOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinksOrBuilder.java deleted file mode 100644 index e1cd5854d3b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LocalLinksOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/device_attributes.proto - -package org.tensorflow.proto.framework; - -public interface LocalLinksOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.LocalLinks) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - java.util.List - getLinkList(); - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - org.tensorflow.proto.framework.InterconnectLink getLink(int index); - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - int getLinkCount(); - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - java.util.List - getLinkOrBuilderList(); - /** - * repeated .tensorflow.InterconnectLink link = 1; - */ - org.tensorflow.proto.framework.InterconnectLinkOrBuilder getLinkOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistribution.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistribution.java deleted file mode 100644 index 3164a04e0b7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistribution.java +++ /dev/null @@ -1,537 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.LogNormalDistribution} - */ -public final class LogNormalDistribution extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.LogNormalDistribution) - LogNormalDistributionOrBuilder { -private static final long serialVersionUID = 0L; - // Use LogNormalDistribution.newBuilder() to construct. - private LogNormalDistribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LogNormalDistribution() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LogNormalDistribution(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LogNormalDistribution( - 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 9: { - - mu_ = input.readDouble(); - break; - } - case 17: { - - sigma_ = input.readDouble(); - 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.OpPerformanceDataProtos.internal_static_tensorflow_LogNormalDistribution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.LogNormalDistribution.class, org.tensorflow.proto.framework.LogNormalDistribution.Builder.class); - } - - public static final int MU_FIELD_NUMBER = 1; - private double mu_; - /** - * double mu = 1; - */ - public double getMu() { - return mu_; - } - - public static final int SIGMA_FIELD_NUMBER = 2; - private double sigma_; - /** - * double sigma = 2; - */ - public double getSigma() { - return sigma_; - } - - 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 (mu_ != 0D) { - output.writeDouble(1, mu_); - } - if (sigma_ != 0D) { - output.writeDouble(2, sigma_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (mu_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, mu_); - } - if (sigma_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, sigma_); - } - 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.LogNormalDistribution)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.LogNormalDistribution other = (org.tensorflow.proto.framework.LogNormalDistribution) obj; - - if (java.lang.Double.doubleToLongBits(getMu()) - != java.lang.Double.doubleToLongBits( - other.getMu())) return false; - if (java.lang.Double.doubleToLongBits(getSigma()) - != java.lang.Double.doubleToLongBits( - other.getSigma())) 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) + MU_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMu())); - hash = (37 * hash) + SIGMA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getSigma())); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.LogNormalDistribution parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LogNormalDistribution 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.LogNormalDistribution parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LogNormalDistribution 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.LogNormalDistribution parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.LogNormalDistribution parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.LogNormalDistribution parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LogNormalDistribution 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.LogNormalDistribution parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LogNormalDistribution 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.LogNormalDistribution parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.LogNormalDistribution 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.LogNormalDistribution 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.LogNormalDistribution} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.LogNormalDistribution) - org.tensorflow.proto.framework.LogNormalDistributionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_LogNormalDistribution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.LogNormalDistribution.class, org.tensorflow.proto.framework.LogNormalDistribution.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.LogNormalDistribution.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(); - mu_ = 0D; - - sigma_ = 0D; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_LogNormalDistribution_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.LogNormalDistribution getDefaultInstanceForType() { - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.LogNormalDistribution build() { - org.tensorflow.proto.framework.LogNormalDistribution result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.LogNormalDistribution buildPartial() { - org.tensorflow.proto.framework.LogNormalDistribution result = new org.tensorflow.proto.framework.LogNormalDistribution(this); - result.mu_ = mu_; - result.sigma_ = sigma_; - 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.LogNormalDistribution) { - return mergeFrom((org.tensorflow.proto.framework.LogNormalDistribution)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.LogNormalDistribution other) { - if (other == org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance()) return this; - if (other.getMu() != 0D) { - setMu(other.getMu()); - } - if (other.getSigma() != 0D) { - setSigma(other.getSigma()); - } - 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.LogNormalDistribution parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.LogNormalDistribution) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private double mu_ ; - /** - * double mu = 1; - */ - public double getMu() { - return mu_; - } - /** - * double mu = 1; - */ - public Builder setMu(double value) { - - mu_ = value; - onChanged(); - return this; - } - /** - * double mu = 1; - */ - public Builder clearMu() { - - mu_ = 0D; - onChanged(); - return this; - } - - private double sigma_ ; - /** - * double sigma = 2; - */ - public double getSigma() { - return sigma_; - } - /** - * double sigma = 2; - */ - public Builder setSigma(double value) { - - sigma_ = value; - onChanged(); - return this; - } - /** - * double sigma = 2; - */ - public Builder clearSigma() { - - sigma_ = 0D; - 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.LogNormalDistribution) - } - - // @@protoc_insertion_point(class_scope:tensorflow.LogNormalDistribution) - private static final org.tensorflow.proto.framework.LogNormalDistribution DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.LogNormalDistribution(); - } - - public static org.tensorflow.proto.framework.LogNormalDistribution getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LogNormalDistribution parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LogNormalDistribution(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.LogNormalDistribution getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistributionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistributionOrBuilder.java deleted file mode 100644 index 367b5827180..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogNormalDistributionOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface LogNormalDistributionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.LogNormalDistribution) - com.google.protobuf.MessageOrBuilder { - - /** - * double mu = 1; - */ - double getMu(); - - /** - * double sigma = 2; - */ - double getSigma(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocation.java deleted file mode 100644 index db40403eba4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocation.java +++ /dev/null @@ -1,1029 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogRawAllocation} - */ -public final class MemoryLogRawAllocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogRawAllocation) - MemoryLogRawAllocationOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogRawAllocation.newBuilder() to construct. - private MemoryLogRawAllocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogRawAllocation() { - operation_ = ""; - allocatorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogRawAllocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogRawAllocation( - 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: { - - stepId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - operation_ = s; - break; - } - case 24: { - - numBytes_ = input.readInt64(); - break; - } - case 32: { - - ptr_ = input.readUInt64(); - break; - } - case 40: { - - allocationId_ = input.readInt64(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - allocatorName_ = s; - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogRawAllocation.class, org.tensorflow.proto.framework.MemoryLogRawAllocation.Builder.class); - } - - public static final int STEP_ID_FIELD_NUMBER = 1; - private long stepId_; - /** - *
    -   * Process-unique step id.
    -   * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - - public static final int OPERATION_FIELD_NUMBER = 2; - private volatile java.lang.Object operation_; - /** - *
    -   * Name of the operation making the allocation.
    -   * 
    - * - * string operation = 2; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - 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(); - operation_ = s; - return s; - } - } - /** - *
    -   * Name of the operation making the allocation.
    -   * 
    - * - * string operation = 2; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NUM_BYTES_FIELD_NUMBER = 3; - private long numBytes_; - /** - *
    -   * Number of bytes in the allocation.
    -   * 
    - * - * int64 num_bytes = 3; - */ - public long getNumBytes() { - return numBytes_; - } - - public static final int PTR_FIELD_NUMBER = 4; - private long ptr_; - /** - *
    -   * Address of the allocation.
    -   * 
    - * - * uint64 ptr = 4; - */ - public long getPtr() { - return ptr_; - } - - public static final int ALLOCATION_ID_FIELD_NUMBER = 5; - private long allocationId_; - /** - *
    -   * Id of the tensor buffer being allocated, used to match to a
    -   * corresponding deallocation.
    -   * 
    - * - * int64 allocation_id = 5; - */ - public long getAllocationId() { - return allocationId_; - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object allocatorName_; - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 6; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 6; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (stepId_ != 0L) { - output.writeInt64(1, stepId_); - } - if (!getOperationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, operation_); - } - if (numBytes_ != 0L) { - output.writeInt64(3, numBytes_); - } - if (ptr_ != 0L) { - output.writeUInt64(4, ptr_); - } - if (allocationId_ != 0L) { - output.writeInt64(5, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, allocatorName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, stepId_); - } - if (!getOperationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, operation_); - } - if (numBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, numBytes_); - } - if (ptr_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, ptr_); - } - if (allocationId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, allocatorName_); - } - 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.MemoryLogRawAllocation)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogRawAllocation other = (org.tensorflow.proto.framework.MemoryLogRawAllocation) obj; - - if (getStepId() - != other.getStepId()) return false; - if (!getOperation() - .equals(other.getOperation())) return false; - if (getNumBytes() - != other.getNumBytes()) return false; - if (getPtr() - != other.getPtr()) return false; - if (getAllocationId() - != other.getAllocationId()) return false; - if (!getAllocatorName() - .equals(other.getAllocatorName())) 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) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (37 * hash) + OPERATION_FIELD_NUMBER; - hash = (53 * hash) + getOperation().hashCode(); - hash = (37 * hash) + NUM_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumBytes()); - hash = (37 * hash) + PTR_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPtr()); - hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocationId()); - hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogRawAllocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawAllocation 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.MemoryLogRawAllocation 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.MemoryLogRawAllocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogRawAllocation) - org.tensorflow.proto.framework.MemoryLogRawAllocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogRawAllocation.class, org.tensorflow.proto.framework.MemoryLogRawAllocation.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogRawAllocation.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(); - stepId_ = 0L; - - operation_ = ""; - - numBytes_ = 0L; - - ptr_ = 0L; - - allocationId_ = 0L; - - allocatorName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawAllocation getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogRawAllocation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawAllocation build() { - org.tensorflow.proto.framework.MemoryLogRawAllocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawAllocation buildPartial() { - org.tensorflow.proto.framework.MemoryLogRawAllocation result = new org.tensorflow.proto.framework.MemoryLogRawAllocation(this); - result.stepId_ = stepId_; - result.operation_ = operation_; - result.numBytes_ = numBytes_; - result.ptr_ = ptr_; - result.allocationId_ = allocationId_; - result.allocatorName_ = allocatorName_; - 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.MemoryLogRawAllocation) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogRawAllocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogRawAllocation other) { - if (other == org.tensorflow.proto.framework.MemoryLogRawAllocation.getDefaultInstance()) return this; - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - if (!other.getOperation().isEmpty()) { - operation_ = other.operation_; - onChanged(); - } - if (other.getNumBytes() != 0L) { - setNumBytes(other.getNumBytes()); - } - if (other.getPtr() != 0L) { - setPtr(other.getPtr()); - } - if (other.getAllocationId() != 0L) { - setAllocationId(other.getAllocationId()); - } - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - 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.MemoryLogRawAllocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogRawAllocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long stepId_ ; - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder clearStepId() { - - stepId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object operation_ = ""; - /** - *
    -     * Name of the operation making the allocation.
    -     * 
    - * - * string operation = 2; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - operation_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the operation making the allocation.
    -     * 
    - * - * string operation = 2; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the operation making the allocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder setOperation( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - operation_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the operation making the allocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder clearOperation() { - - operation_ = getDefaultInstance().getOperation(); - onChanged(); - return this; - } - /** - *
    -     * Name of the operation making the allocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder setOperationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - operation_ = value; - onChanged(); - return this; - } - - private long numBytes_ ; - /** - *
    -     * Number of bytes in the allocation.
    -     * 
    - * - * int64 num_bytes = 3; - */ - public long getNumBytes() { - return numBytes_; - } - /** - *
    -     * Number of bytes in the allocation.
    -     * 
    - * - * int64 num_bytes = 3; - */ - public Builder setNumBytes(long value) { - - numBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of bytes in the allocation.
    -     * 
    - * - * int64 num_bytes = 3; - */ - public Builder clearNumBytes() { - - numBytes_ = 0L; - onChanged(); - return this; - } - - private long ptr_ ; - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 4; - */ - public long getPtr() { - return ptr_; - } - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 4; - */ - public Builder setPtr(long value) { - - ptr_ = value; - onChanged(); - return this; - } - /** - *
    -     * Address of the allocation.
    -     * 
    - * - * uint64 ptr = 4; - */ - public Builder clearPtr() { - - ptr_ = 0L; - onChanged(); - return this; - } - - private long allocationId_ ; - /** - *
    -     * Id of the tensor buffer being allocated, used to match to a
    -     * corresponding deallocation.
    -     * 
    - * - * int64 allocation_id = 5; - */ - public long getAllocationId() { - return allocationId_; - } - /** - *
    -     * Id of the tensor buffer being allocated, used to match to a
    -     * corresponding deallocation.
    -     * 
    - * - * int64 allocation_id = 5; - */ - public Builder setAllocationId(long value) { - - allocationId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Id of the tensor buffer being allocated, used to match to a
    -     * corresponding deallocation.
    -     * 
    - * - * int64 allocation_id = 5; - */ - public Builder clearAllocationId() { - - allocationId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object allocatorName_ = ""; - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 6; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 6; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 6; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 6; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 6; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - 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.MemoryLogRawAllocation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogRawAllocation) - private static final org.tensorflow.proto.framework.MemoryLogRawAllocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogRawAllocation(); - } - - public static org.tensorflow.proto.framework.MemoryLogRawAllocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogRawAllocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogRawAllocation(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.MemoryLogRawAllocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocation.java deleted file mode 100644 index ae8c55fcf31..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocation.java +++ /dev/null @@ -1,959 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogRawDeallocation} - */ -public final class MemoryLogRawDeallocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogRawDeallocation) - MemoryLogRawDeallocationOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogRawDeallocation.newBuilder() to construct. - private MemoryLogRawDeallocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogRawDeallocation() { - operation_ = ""; - allocatorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogRawDeallocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogRawDeallocation( - 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: { - - stepId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - operation_ = s; - break; - } - case 24: { - - allocationId_ = input.readInt64(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - allocatorName_ = s; - break; - } - case 40: { - - deferred_ = input.readBool(); - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogRawDeallocation.class, org.tensorflow.proto.framework.MemoryLogRawDeallocation.Builder.class); - } - - public static final int STEP_ID_FIELD_NUMBER = 1; - private long stepId_; - /** - *
    -   * Process-unique step id.
    -   * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - - public static final int OPERATION_FIELD_NUMBER = 2; - private volatile java.lang.Object operation_; - /** - *
    -   * Name of the operation making the deallocation.
    -   * 
    - * - * string operation = 2; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - 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(); - operation_ = s; - return s; - } - } - /** - *
    -   * Name of the operation making the deallocation.
    -   * 
    - * - * string operation = 2; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALLOCATION_ID_FIELD_NUMBER = 3; - private long allocationId_; - /** - *
    -   * Id of the tensor buffer being deallocated, used to match to a
    -   * corresponding allocation.
    -   * 
    - * - * int64 allocation_id = 3; - */ - public long getAllocationId() { - return allocationId_; - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object allocatorName_; - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 4; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 4; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFERRED_FIELD_NUMBER = 5; - private boolean deferred_; - /** - *
    -   * True if the deallocation is queued and will be performed later,
    -   * e.g. for GPU lazy freeing of buffers.
    -   * 
    - * - * bool deferred = 5; - */ - public boolean getDeferred() { - return deferred_; - } - - 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 (stepId_ != 0L) { - output.writeInt64(1, stepId_); - } - if (!getOperationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, operation_); - } - if (allocationId_ != 0L) { - output.writeInt64(3, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, allocatorName_); - } - if (deferred_ != false) { - output.writeBool(5, deferred_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, stepId_); - } - if (!getOperationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, operation_); - } - if (allocationId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, allocatorName_); - } - if (deferred_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, deferred_); - } - 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.MemoryLogRawDeallocation)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogRawDeallocation other = (org.tensorflow.proto.framework.MemoryLogRawDeallocation) obj; - - if (getStepId() - != other.getStepId()) return false; - if (!getOperation() - .equals(other.getOperation())) return false; - if (getAllocationId() - != other.getAllocationId()) return false; - if (!getAllocatorName() - .equals(other.getAllocatorName())) return false; - if (getDeferred() - != other.getDeferred()) 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) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (37 * hash) + OPERATION_FIELD_NUMBER; - hash = (53 * hash) + getOperation().hashCode(); - hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocationId()); - hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - hash = (37 * hash) + DEFERRED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDeferred()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogRawDeallocation) - org.tensorflow.proto.framework.MemoryLogRawDeallocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogRawDeallocation.class, org.tensorflow.proto.framework.MemoryLogRawDeallocation.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogRawDeallocation.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(); - stepId_ = 0L; - - operation_ = ""; - - allocationId_ = 0L; - - allocatorName_ = ""; - - deferred_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawDeallocation getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogRawDeallocation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawDeallocation build() { - org.tensorflow.proto.framework.MemoryLogRawDeallocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogRawDeallocation buildPartial() { - org.tensorflow.proto.framework.MemoryLogRawDeallocation result = new org.tensorflow.proto.framework.MemoryLogRawDeallocation(this); - result.stepId_ = stepId_; - result.operation_ = operation_; - result.allocationId_ = allocationId_; - result.allocatorName_ = allocatorName_; - result.deferred_ = deferred_; - 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.MemoryLogRawDeallocation) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogRawDeallocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogRawDeallocation other) { - if (other == org.tensorflow.proto.framework.MemoryLogRawDeallocation.getDefaultInstance()) return this; - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - if (!other.getOperation().isEmpty()) { - operation_ = other.operation_; - onChanged(); - } - if (other.getAllocationId() != 0L) { - setAllocationId(other.getAllocationId()); - } - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - if (other.getDeferred() != false) { - setDeferred(other.getDeferred()); - } - 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.MemoryLogRawDeallocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogRawDeallocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long stepId_ ; - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder clearStepId() { - - stepId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object operation_ = ""; - /** - *
    -     * Name of the operation making the deallocation.
    -     * 
    - * - * string operation = 2; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - operation_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the operation making the deallocation.
    -     * 
    - * - * string operation = 2; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the operation making the deallocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder setOperation( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - operation_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the operation making the deallocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder clearOperation() { - - operation_ = getDefaultInstance().getOperation(); - onChanged(); - return this; - } - /** - *
    -     * Name of the operation making the deallocation.
    -     * 
    - * - * string operation = 2; - */ - public Builder setOperationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - operation_ = value; - onChanged(); - return this; - } - - private long allocationId_ ; - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 3; - */ - public long getAllocationId() { - return allocationId_; - } - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 3; - */ - public Builder setAllocationId(long value) { - - allocationId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 3; - */ - public Builder clearAllocationId() { - - allocationId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object allocatorName_ = ""; - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 4; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 4; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 4; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 4; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 4; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - onChanged(); - return this; - } - - private boolean deferred_ ; - /** - *
    -     * True if the deallocation is queued and will be performed later,
    -     * e.g. for GPU lazy freeing of buffers.
    -     * 
    - * - * bool deferred = 5; - */ - public boolean getDeferred() { - return deferred_; - } - /** - *
    -     * True if the deallocation is queued and will be performed later,
    -     * e.g. for GPU lazy freeing of buffers.
    -     * 
    - * - * bool deferred = 5; - */ - public Builder setDeferred(boolean value) { - - deferred_ = value; - onChanged(); - return this; - } - /** - *
    -     * True if the deallocation is queued and will be performed later,
    -     * e.g. for GPU lazy freeing of buffers.
    -     * 
    - * - * bool deferred = 5; - */ - public Builder clearDeferred() { - - deferred_ = false; - 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.MemoryLogRawDeallocation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogRawDeallocation) - private static final org.tensorflow.proto.framework.MemoryLogRawDeallocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogRawDeallocation(); - } - - public static org.tensorflow.proto.framework.MemoryLogRawDeallocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogRawDeallocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogRawDeallocation(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.MemoryLogRawDeallocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStep.java deleted file mode 100644 index 73d400a36e0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStep.java +++ /dev/null @@ -1,648 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogStep} - */ -public final class MemoryLogStep extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogStep) - MemoryLogStepOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogStep.newBuilder() to construct. - private MemoryLogStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogStep() { - handle_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogStep(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogStep( - 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: { - - stepId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - handle_ = s; - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogStep.class, org.tensorflow.proto.framework.MemoryLogStep.Builder.class); - } - - public static final int STEP_ID_FIELD_NUMBER = 1; - private long stepId_; - /** - *
    -   * Process-unique step id.
    -   * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - - public static final int HANDLE_FIELD_NUMBER = 2; - private volatile java.lang.Object handle_; - /** - *
    -   * Handle describing the feeds and fetches of the step.
    -   * 
    - * - * string handle = 2; - */ - public java.lang.String getHandle() { - java.lang.Object ref = handle_; - 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(); - handle_ = s; - return s; - } - } - /** - *
    -   * Handle describing the feeds and fetches of the step.
    -   * 
    - * - * string handle = 2; - */ - public com.google.protobuf.ByteString - getHandleBytes() { - java.lang.Object ref = handle_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - handle_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (stepId_ != 0L) { - output.writeInt64(1, stepId_); - } - if (!getHandleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, handle_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, stepId_); - } - if (!getHandleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, handle_); - } - 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.MemoryLogStep)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogStep other = (org.tensorflow.proto.framework.MemoryLogStep) obj; - - if (getStepId() - != other.getStepId()) return false; - if (!getHandle() - .equals(other.getHandle())) 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) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (37 * hash) + HANDLE_FIELD_NUMBER; - hash = (53 * hash) + getHandle().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogStep parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogStep 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.MemoryLogStep parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogStep 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.MemoryLogStep parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogStep parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogStep parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogStep 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.MemoryLogStep parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogStep 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.MemoryLogStep parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogStep 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.MemoryLogStep 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.MemoryLogStep} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogStep) - org.tensorflow.proto.framework.MemoryLogStepOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogStep.class, org.tensorflow.proto.framework.MemoryLogStep.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogStep.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(); - stepId_ = 0L; - - handle_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogStep getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogStep.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogStep build() { - org.tensorflow.proto.framework.MemoryLogStep result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogStep buildPartial() { - org.tensorflow.proto.framework.MemoryLogStep result = new org.tensorflow.proto.framework.MemoryLogStep(this); - result.stepId_ = stepId_; - result.handle_ = handle_; - 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.MemoryLogStep) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogStep)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogStep other) { - if (other == org.tensorflow.proto.framework.MemoryLogStep.getDefaultInstance()) return this; - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - if (!other.getHandle().isEmpty()) { - handle_ = other.handle_; - onChanged(); - } - 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.MemoryLogStep parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogStep) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long stepId_ ; - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder clearStepId() { - - stepId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object handle_ = ""; - /** - *
    -     * Handle describing the feeds and fetches of the step.
    -     * 
    - * - * string handle = 2; - */ - public java.lang.String getHandle() { - java.lang.Object ref = handle_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - handle_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Handle describing the feeds and fetches of the step.
    -     * 
    - * - * string handle = 2; - */ - public com.google.protobuf.ByteString - getHandleBytes() { - java.lang.Object ref = handle_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - handle_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Handle describing the feeds and fetches of the step.
    -     * 
    - * - * string handle = 2; - */ - public Builder setHandle( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - handle_ = value; - onChanged(); - return this; - } - /** - *
    -     * Handle describing the feeds and fetches of the step.
    -     * 
    - * - * string handle = 2; - */ - public Builder clearHandle() { - - handle_ = getDefaultInstance().getHandle(); - onChanged(); - return this; - } - /** - *
    -     * Handle describing the feeds and fetches of the step.
    -     * 
    - * - * string handle = 2; - */ - public Builder setHandleBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - handle_ = value; - 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.MemoryLogStep) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogStep) - private static final org.tensorflow.proto.framework.MemoryLogStep DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogStep(); - } - - public static org.tensorflow.proto.framework.MemoryLogStep getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogStep parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogStep(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.MemoryLogStep getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocation.java deleted file mode 100644 index bf59aacf6ed..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocation.java +++ /dev/null @@ -1,884 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogTensorAllocation} - */ -public final class MemoryLogTensorAllocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorAllocation) - MemoryLogTensorAllocationOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogTensorAllocation.newBuilder() to construct. - private MemoryLogTensorAllocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogTensorAllocation() { - kernelName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogTensorAllocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogTensorAllocation( - 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: { - - stepId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - kernelName_ = s; - break; - } - case 26: { - org.tensorflow.proto.framework.TensorDescription.Builder subBuilder = null; - if (tensor_ != null) { - subBuilder = tensor_.toBuilder(); - } - tensor_ = input.readMessage(org.tensorflow.proto.framework.TensorDescription.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensor_); - tensor_ = subBuilder.buildPartial(); - } - - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorAllocation.class, org.tensorflow.proto.framework.MemoryLogTensorAllocation.Builder.class); - } - - public static final int STEP_ID_FIELD_NUMBER = 1; - private long stepId_; - /** - *
    -   * Process-unique step id.
    -   * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - - public static final int KERNEL_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object kernelName_; - /** - *
    -   * Name of the kernel making the allocation as set in GraphDef,
    -   * e.g., "affine2/weights/Assign".
    -   * 
    - * - * string kernel_name = 2; - */ - public java.lang.String getKernelName() { - java.lang.Object ref = kernelName_; - 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(); - kernelName_ = s; - return s; - } - } - /** - *
    -   * Name of the kernel making the allocation as set in GraphDef,
    -   * e.g., "affine2/weights/Assign".
    -   * 
    - * - * string kernel_name = 2; - */ - public com.google.protobuf.ByteString - getKernelNameBytes() { - java.lang.Object ref = kernelName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kernelName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TENSOR_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorDescription tensor_; - /** - *
    -   * Allocated tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public boolean hasTensor() { - return tensor_ != null; - } - /** - *
    -   * Allocated tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public org.tensorflow.proto.framework.TensorDescription getTensor() { - return tensor_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } - /** - *
    -   * Allocated tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder() { - return getTensor(); - } - - 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 (stepId_ != 0L) { - output.writeInt64(1, stepId_); - } - if (!getKernelNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kernelName_); - } - if (tensor_ != null) { - output.writeMessage(3, getTensor()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, stepId_); - } - if (!getKernelNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kernelName_); - } - if (tensor_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTensor()); - } - 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.MemoryLogTensorAllocation)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogTensorAllocation other = (org.tensorflow.proto.framework.MemoryLogTensorAllocation) obj; - - if (getStepId() - != other.getStepId()) return false; - if (!getKernelName() - .equals(other.getKernelName())) return false; - if (hasTensor() != other.hasTensor()) return false; - if (hasTensor()) { - if (!getTensor() - .equals(other.getTensor())) 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) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (37 * hash) + KERNEL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getKernelName().hashCode(); - if (hasTensor()) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensor().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorAllocation) - org.tensorflow.proto.framework.MemoryLogTensorAllocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorAllocation.class, org.tensorflow.proto.framework.MemoryLogTensorAllocation.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogTensorAllocation.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(); - stepId_ = 0L; - - kernelName_ = ""; - - if (tensorBuilder_ == null) { - tensor_ = null; - } else { - tensor_ = null; - tensorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorAllocation getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogTensorAllocation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorAllocation build() { - org.tensorflow.proto.framework.MemoryLogTensorAllocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorAllocation buildPartial() { - org.tensorflow.proto.framework.MemoryLogTensorAllocation result = new org.tensorflow.proto.framework.MemoryLogTensorAllocation(this); - result.stepId_ = stepId_; - result.kernelName_ = kernelName_; - if (tensorBuilder_ == null) { - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.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.MemoryLogTensorAllocation) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogTensorAllocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogTensorAllocation other) { - if (other == org.tensorflow.proto.framework.MemoryLogTensorAllocation.getDefaultInstance()) return this; - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - if (!other.getKernelName().isEmpty()) { - kernelName_ = other.kernelName_; - onChanged(); - } - if (other.hasTensor()) { - mergeTensor(other.getTensor()); - } - 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.MemoryLogTensorAllocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogTensorAllocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long stepId_ ; - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder clearStepId() { - - stepId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object kernelName_ = ""; - /** - *
    -     * Name of the kernel making the allocation as set in GraphDef,
    -     * e.g., "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public java.lang.String getKernelName() { - java.lang.Object ref = kernelName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kernelName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the kernel making the allocation as set in GraphDef,
    -     * e.g., "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public com.google.protobuf.ByteString - getKernelNameBytes() { - java.lang.Object ref = kernelName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kernelName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the kernel making the allocation as set in GraphDef,
    -     * e.g., "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder setKernelName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - kernelName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the kernel making the allocation as set in GraphDef,
    -     * e.g., "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder clearKernelName() { - - kernelName_ = getDefaultInstance().getKernelName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the kernel making the allocation as set in GraphDef,
    -     * e.g., "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder setKernelNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - kernelName_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorDescription tensor_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> tensorBuilder_; - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public boolean hasTensor() { - return tensorBuilder_ != null || tensor_ != null; - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public org.tensorflow.proto.framework.TensorDescription getTensor() { - if (tensorBuilder_ == null) { - return tensor_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } else { - return tensorBuilder_.getMessage(); - } - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public Builder setTensor(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensor_ = value; - onChanged(); - } else { - tensorBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public Builder setTensor( - org.tensorflow.proto.framework.TensorDescription.Builder builderForValue) { - if (tensorBuilder_ == null) { - tensor_ = builderForValue.build(); - onChanged(); - } else { - tensorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public Builder mergeTensor(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorBuilder_ == null) { - if (tensor_ != null) { - tensor_ = - org.tensorflow.proto.framework.TensorDescription.newBuilder(tensor_).mergeFrom(value).buildPartial(); - } else { - tensor_ = value; - } - onChanged(); - } else { - tensorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = null; - onChanged(); - } else { - tensor_ = null; - tensorBuilder_ = null; - } - - return this; - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public org.tensorflow.proto.framework.TensorDescription.Builder getTensorBuilder() { - - onChanged(); - return getTensorFieldBuilder().getBuilder(); - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilder(); - } else { - return tensor_ == null ? - org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } - } - /** - *
    -     * Allocated tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder>( - getTensor(), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - @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.MemoryLogTensorAllocation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorAllocation) - private static final org.tensorflow.proto.framework.MemoryLogTensorAllocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogTensorAllocation(); - } - - public static org.tensorflow.proto.framework.MemoryLogTensorAllocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogTensorAllocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogTensorAllocation(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.MemoryLogTensorAllocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocation.java deleted file mode 100644 index f0061b53c50..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocation.java +++ /dev/null @@ -1,652 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogTensorDeallocation} - */ -public final class MemoryLogTensorDeallocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorDeallocation) - MemoryLogTensorDeallocationOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogTensorDeallocation.newBuilder() to construct. - private MemoryLogTensorDeallocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogTensorDeallocation() { - allocatorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogTensorDeallocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogTensorDeallocation( - 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: { - - allocationId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - allocatorName_ = s; - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorDeallocation.class, org.tensorflow.proto.framework.MemoryLogTensorDeallocation.Builder.class); - } - - public static final int ALLOCATION_ID_FIELD_NUMBER = 1; - private long allocationId_; - /** - *
    -   * Id of the tensor buffer being deallocated, used to match to a
    -   * corresponding allocation.
    -   * 
    - * - * int64 allocation_id = 1; - */ - public long getAllocationId() { - return allocationId_; - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object allocatorName_; - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 2; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - *
    -   * Name of the allocator used.
    -   * 
    - * - * string allocator_name = 2; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (allocationId_ != 0L) { - output.writeInt64(1, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, allocatorName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (allocationId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, allocationId_); - } - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, allocatorName_); - } - 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.MemoryLogTensorDeallocation)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogTensorDeallocation other = (org.tensorflow.proto.framework.MemoryLogTensorDeallocation) obj; - - if (getAllocationId() - != other.getAllocationId()) return false; - if (!getAllocatorName() - .equals(other.getAllocatorName())) 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) + ALLOCATION_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllocationId()); - hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorDeallocation) - org.tensorflow.proto.framework.MemoryLogTensorDeallocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorDeallocation.class, org.tensorflow.proto.framework.MemoryLogTensorDeallocation.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogTensorDeallocation.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(); - allocationId_ = 0L; - - allocatorName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorDeallocation getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogTensorDeallocation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorDeallocation build() { - org.tensorflow.proto.framework.MemoryLogTensorDeallocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorDeallocation buildPartial() { - org.tensorflow.proto.framework.MemoryLogTensorDeallocation result = new org.tensorflow.proto.framework.MemoryLogTensorDeallocation(this); - result.allocationId_ = allocationId_; - result.allocatorName_ = allocatorName_; - 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.MemoryLogTensorDeallocation) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogTensorDeallocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogTensorDeallocation other) { - if (other == org.tensorflow.proto.framework.MemoryLogTensorDeallocation.getDefaultInstance()) return this; - if (other.getAllocationId() != 0L) { - setAllocationId(other.getAllocationId()); - } - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - 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.MemoryLogTensorDeallocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogTensorDeallocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long allocationId_ ; - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 1; - */ - public long getAllocationId() { - return allocationId_; - } - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 1; - */ - public Builder setAllocationId(long value) { - - allocationId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Id of the tensor buffer being deallocated, used to match to a
    -     * corresponding allocation.
    -     * 
    - * - * int64 allocation_id = 1; - */ - public Builder clearAllocationId() { - - allocationId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object allocatorName_ = ""; - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 2; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 2; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 2; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 2; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the allocator used.
    -     * 
    - * - * string allocator_name = 2; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - 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.MemoryLogTensorDeallocation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorDeallocation) - private static final org.tensorflow.proto.framework.MemoryLogTensorDeallocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogTensorDeallocation(); - } - - public static org.tensorflow.proto.framework.MemoryLogTensorDeallocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogTensorDeallocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogTensorDeallocation(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.MemoryLogTensorDeallocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutput.java deleted file mode 100644 index a8aaf7dc7d9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutput.java +++ /dev/null @@ -1,957 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/log_memory.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.MemoryLogTensorOutput} - */ -public final class MemoryLogTensorOutput extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorOutput) - MemoryLogTensorOutputOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryLogTensorOutput.newBuilder() to construct. - private MemoryLogTensorOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryLogTensorOutput() { - kernelName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryLogTensorOutput(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryLogTensorOutput( - 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: { - - stepId_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - kernelName_ = s; - break; - } - case 24: { - - index_ = input.readInt32(); - break; - } - case 34: { - org.tensorflow.proto.framework.TensorDescription.Builder subBuilder = null; - if (tensor_ != null) { - subBuilder = tensor_.toBuilder(); - } - tensor_ = input.readMessage(org.tensorflow.proto.framework.TensorDescription.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensor_); - tensor_ = subBuilder.buildPartial(); - } - - 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.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorOutput.class, org.tensorflow.proto.framework.MemoryLogTensorOutput.Builder.class); - } - - public static final int STEP_ID_FIELD_NUMBER = 1; - private long stepId_; - /** - *
    -   * Process-unique step id.
    -   * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - - public static final int KERNEL_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object kernelName_; - /** - *
    -   * Name of the kernel producing an output as set in GraphDef, e.g.,
    -   * "affine2/weights/Assign".
    -   * 
    - * - * string kernel_name = 2; - */ - public java.lang.String getKernelName() { - java.lang.Object ref = kernelName_; - 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(); - kernelName_ = s; - return s; - } - } - /** - *
    -   * Name of the kernel producing an output as set in GraphDef, e.g.,
    -   * "affine2/weights/Assign".
    -   * 
    - * - * string kernel_name = 2; - */ - public com.google.protobuf.ByteString - getKernelNameBytes() { - java.lang.Object ref = kernelName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kernelName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INDEX_FIELD_NUMBER = 3; - private int index_; - /** - *
    -   * Index of the output being set.
    -   * 
    - * - * int32 index = 3; - */ - public int getIndex() { - return index_; - } - - public static final int TENSOR_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.TensorDescription tensor_; - /** - *
    -   * Output tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public boolean hasTensor() { - return tensor_ != null; - } - /** - *
    -   * Output tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public org.tensorflow.proto.framework.TensorDescription getTensor() { - return tensor_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } - /** - *
    -   * Output tensor details.
    -   * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder() { - return getTensor(); - } - - 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 (stepId_ != 0L) { - output.writeInt64(1, stepId_); - } - if (!getKernelNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kernelName_); - } - if (index_ != 0) { - output.writeInt32(3, index_); - } - if (tensor_ != null) { - output.writeMessage(4, getTensor()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, stepId_); - } - if (!getKernelNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kernelName_); - } - if (index_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, index_); - } - if (tensor_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getTensor()); - } - 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.MemoryLogTensorOutput)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryLogTensorOutput other = (org.tensorflow.proto.framework.MemoryLogTensorOutput) obj; - - if (getStepId() - != other.getStepId()) return false; - if (!getKernelName() - .equals(other.getKernelName())) return false; - if (getIndex() - != other.getIndex()) return false; - if (hasTensor() != other.hasTensor()) return false; - if (hasTensor()) { - if (!getTensor() - .equals(other.getTensor())) 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) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (37 * hash) + KERNEL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getKernelName().hashCode(); - hash = (37 * hash) + INDEX_FIELD_NUMBER; - hash = (53 * hash) + getIndex(); - if (hasTensor()) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensor().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryLogTensorOutput parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryLogTensorOutput 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.MemoryLogTensorOutput 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.MemoryLogTensorOutput} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorOutput) - org.tensorflow.proto.framework.MemoryLogTensorOutputOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryLogTensorOutput.class, org.tensorflow.proto.framework.MemoryLogTensorOutput.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryLogTensorOutput.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(); - stepId_ = 0L; - - kernelName_ = ""; - - index_ = 0; - - if (tensorBuilder_ == null) { - tensor_ = null; - } else { - tensor_ = null; - tensorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorOutput getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryLogTensorOutput.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorOutput build() { - org.tensorflow.proto.framework.MemoryLogTensorOutput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryLogTensorOutput buildPartial() { - org.tensorflow.proto.framework.MemoryLogTensorOutput result = new org.tensorflow.proto.framework.MemoryLogTensorOutput(this); - result.stepId_ = stepId_; - result.kernelName_ = kernelName_; - result.index_ = index_; - if (tensorBuilder_ == null) { - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.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.MemoryLogTensorOutput) { - return mergeFrom((org.tensorflow.proto.framework.MemoryLogTensorOutput)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryLogTensorOutput other) { - if (other == org.tensorflow.proto.framework.MemoryLogTensorOutput.getDefaultInstance()) return this; - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - if (!other.getKernelName().isEmpty()) { - kernelName_ = other.kernelName_; - onChanged(); - } - if (other.getIndex() != 0) { - setIndex(other.getIndex()); - } - if (other.hasTensor()) { - mergeTensor(other.getTensor()); - } - 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.MemoryLogTensorOutput parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryLogTensorOutput) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long stepId_ ; - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public long getStepId() { - return stepId_; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Process-unique step id.
    -     * 
    - * - * int64 step_id = 1; - */ - public Builder clearStepId() { - - stepId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object kernelName_ = ""; - /** - *
    -     * Name of the kernel producing an output as set in GraphDef, e.g.,
    -     * "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public java.lang.String getKernelName() { - java.lang.Object ref = kernelName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kernelName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the kernel producing an output as set in GraphDef, e.g.,
    -     * "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public com.google.protobuf.ByteString - getKernelNameBytes() { - java.lang.Object ref = kernelName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kernelName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the kernel producing an output as set in GraphDef, e.g.,
    -     * "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder setKernelName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - kernelName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the kernel producing an output as set in GraphDef, e.g.,
    -     * "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder clearKernelName() { - - kernelName_ = getDefaultInstance().getKernelName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the kernel producing an output as set in GraphDef, e.g.,
    -     * "affine2/weights/Assign".
    -     * 
    - * - * string kernel_name = 2; - */ - public Builder setKernelNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - kernelName_ = value; - onChanged(); - return this; - } - - private int index_ ; - /** - *
    -     * Index of the output being set.
    -     * 
    - * - * int32 index = 3; - */ - public int getIndex() { - return index_; - } - /** - *
    -     * Index of the output being set.
    -     * 
    - * - * int32 index = 3; - */ - public Builder setIndex(int value) { - - index_ = value; - onChanged(); - return this; - } - /** - *
    -     * Index of the output being set.
    -     * 
    - * - * int32 index = 3; - */ - public Builder clearIndex() { - - index_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorDescription tensor_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> tensorBuilder_; - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public boolean hasTensor() { - return tensorBuilder_ != null || tensor_ != null; - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public org.tensorflow.proto.framework.TensorDescription getTensor() { - if (tensorBuilder_ == null) { - return tensor_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } else { - return tensorBuilder_.getMessage(); - } - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public Builder setTensor(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensor_ = value; - onChanged(); - } else { - tensorBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public Builder setTensor( - org.tensorflow.proto.framework.TensorDescription.Builder builderForValue) { - if (tensorBuilder_ == null) { - tensor_ = builderForValue.build(); - onChanged(); - } else { - tensorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public Builder mergeTensor(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorBuilder_ == null) { - if (tensor_ != null) { - tensor_ = - org.tensorflow.proto.framework.TensorDescription.newBuilder(tensor_).mergeFrom(value).buildPartial(); - } else { - tensor_ = value; - } - onChanged(); - } else { - tensorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = null; - onChanged(); - } else { - tensor_ = null; - tensorBuilder_ = null; - } - - return this; - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public org.tensorflow.proto.framework.TensorDescription.Builder getTensorBuilder() { - - onChanged(); - return getTensorFieldBuilder().getBuilder(); - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilder(); - } else { - return tensor_ == null ? - org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensor_; - } - } - /** - *
    -     * Output tensor details.
    -     * 
    - * - * .tensorflow.TensorDescription tensor = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder>( - getTensor(), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - @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.MemoryLogTensorOutput) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorOutput) - private static final org.tensorflow.proto.framework.MemoryLogTensorOutput DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryLogTensorOutput(); - } - - public static org.tensorflow.proto.framework.MemoryLogTensorOutput getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryLogTensorOutput parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryLogTensorOutput(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.MemoryLogTensorOutput getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStats.java deleted file mode 100644 index e351d0be2b0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStats.java +++ /dev/null @@ -1,981 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * For memory tracking.
    - * 
    - * - * Protobuf type {@code tensorflow.MemoryStats} - */ -public final class MemoryStats extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryStats) - MemoryStatsOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryStats.newBuilder() to construct. - private MemoryStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryStats() { - persistentTensorAllocIds_ = emptyLongList(); - devicePersistentTensorAllocIds_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryStats(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryStats( - 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: { - - tempMemorySize_ = input.readInt64(); - break; - } - case 16: { - - deviceTempMemorySize_ = input.readInt64(); - break; - } - case 24: { - - persistentMemorySize_ = input.readInt64(); - break; - } - case 32: { - - devicePersistentMemorySize_ = input.readInt64(); - break; - } - case 40: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - persistentTensorAllocIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - persistentTensorAllocIds_.addLong(input.readInt64()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - persistentTensorAllocIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - persistentTensorAllocIds_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 48: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - devicePersistentTensorAllocIds_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - devicePersistentTensorAllocIds_.addLong(input.readInt64()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - devicePersistentTensorAllocIds_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - devicePersistentTensorAllocIds_.addLong(input.readInt64()); - } - input.popLimit(limit); - 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)) { - persistentTensorAllocIds_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - devicePersistentTensorAllocIds_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_MemoryStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryStats.class, org.tensorflow.proto.framework.MemoryStats.Builder.class); - } - - public static final int TEMP_MEMORY_SIZE_FIELD_NUMBER = 1; - private long tempMemorySize_; - /** - * int64 temp_memory_size = 1; - */ - public long getTempMemorySize() { - return tempMemorySize_; - } - - public static final int PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 3; - private long persistentMemorySize_; - /** - * int64 persistent_memory_size = 3; - */ - public long getPersistentMemorySize() { - return persistentMemorySize_; - } - - public static final int PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.LongList persistentTensorAllocIds_; - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public java.util.List - getPersistentTensorAllocIdsList() { - return persistentTensorAllocIds_; - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public int getPersistentTensorAllocIdsCount() { - return persistentTensorAllocIds_.size(); - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public long getPersistentTensorAllocIds(int index) { - return persistentTensorAllocIds_.getLong(index); - } - private int persistentTensorAllocIdsMemoizedSerializedSize = -1; - - public static final int DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER = 2; - private long deviceTempMemorySize_; - /** - * int64 device_temp_memory_size = 2 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemorySize() { - return deviceTempMemorySize_; - } - - public static final int DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 4; - private long devicePersistentMemorySize_; - /** - * int64 device_persistent_memory_size = 4 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemorySize() { - return devicePersistentMemorySize_; - } - - public static final int DEVICE_PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.LongList devicePersistentTensorAllocIds_; - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public java.util.List - getDevicePersistentTensorAllocIdsList() { - return devicePersistentTensorAllocIds_; - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public int getDevicePersistentTensorAllocIdsCount() { - return devicePersistentTensorAllocIds_.size(); - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentTensorAllocIds(int index) { - return devicePersistentTensorAllocIds_.getLong(index); - } - private int devicePersistentTensorAllocIdsMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (tempMemorySize_ != 0L) { - output.writeInt64(1, tempMemorySize_); - } - if (deviceTempMemorySize_ != 0L) { - output.writeInt64(2, deviceTempMemorySize_); - } - if (persistentMemorySize_ != 0L) { - output.writeInt64(3, persistentMemorySize_); - } - if (devicePersistentMemorySize_ != 0L) { - output.writeInt64(4, devicePersistentMemorySize_); - } - if (getPersistentTensorAllocIdsList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(persistentTensorAllocIdsMemoizedSerializedSize); - } - for (int i = 0; i < persistentTensorAllocIds_.size(); i++) { - output.writeInt64NoTag(persistentTensorAllocIds_.getLong(i)); - } - if (getDevicePersistentTensorAllocIdsList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(devicePersistentTensorAllocIdsMemoizedSerializedSize); - } - for (int i = 0; i < devicePersistentTensorAllocIds_.size(); i++) { - output.writeInt64NoTag(devicePersistentTensorAllocIds_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (tempMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, tempMemorySize_); - } - if (deviceTempMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, deviceTempMemorySize_); - } - if (persistentMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, persistentMemorySize_); - } - if (devicePersistentMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, devicePersistentMemorySize_); - } - { - int dataSize = 0; - for (int i = 0; i < persistentTensorAllocIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(persistentTensorAllocIds_.getLong(i)); - } - size += dataSize; - if (!getPersistentTensorAllocIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - persistentTensorAllocIdsMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < devicePersistentTensorAllocIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(devicePersistentTensorAllocIds_.getLong(i)); - } - size += dataSize; - if (!getDevicePersistentTensorAllocIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - devicePersistentTensorAllocIdsMemoizedSerializedSize = dataSize; - } - 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.MemoryStats)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MemoryStats other = (org.tensorflow.proto.framework.MemoryStats) obj; - - if (getTempMemorySize() - != other.getTempMemorySize()) return false; - if (getPersistentMemorySize() - != other.getPersistentMemorySize()) return false; - if (!getPersistentTensorAllocIdsList() - .equals(other.getPersistentTensorAllocIdsList())) return false; - if (getDeviceTempMemorySize() - != other.getDeviceTempMemorySize()) return false; - if (getDevicePersistentMemorySize() - != other.getDevicePersistentMemorySize()) return false; - if (!getDevicePersistentTensorAllocIdsList() - .equals(other.getDevicePersistentTensorAllocIdsList())) 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) + TEMP_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTempMemorySize()); - hash = (37 * hash) + PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPersistentMemorySize()); - if (getPersistentTensorAllocIdsCount() > 0) { - hash = (37 * hash) + PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER; - hash = (53 * hash) + getPersistentTensorAllocIdsList().hashCode(); - } - hash = (37 * hash) + DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDeviceTempMemorySize()); - hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDevicePersistentMemorySize()); - if (getDevicePersistentTensorAllocIdsCount() > 0) { - hash = (37 * hash) + DEVICE_PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER; - hash = (53 * hash) + getDevicePersistentTensorAllocIdsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MemoryStats parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryStats 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.MemoryStats parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryStats 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.MemoryStats parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MemoryStats parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MemoryStats parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryStats 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.MemoryStats parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryStats 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.MemoryStats parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MemoryStats 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.MemoryStats 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; - } - /** - *
    -   * For memory tracking.
    -   * 
    - * - * Protobuf type {@code tensorflow.MemoryStats} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryStats) - org.tensorflow.proto.framework.MemoryStatsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_MemoryStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MemoryStats.class, org.tensorflow.proto.framework.MemoryStats.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MemoryStats.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(); - tempMemorySize_ = 0L; - - persistentMemorySize_ = 0L; - - persistentTensorAllocIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - deviceTempMemorySize_ = 0L; - - devicePersistentMemorySize_ = 0L; - - devicePersistentTensorAllocIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryStats getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MemoryStats.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryStats build() { - org.tensorflow.proto.framework.MemoryStats result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MemoryStats buildPartial() { - org.tensorflow.proto.framework.MemoryStats result = new org.tensorflow.proto.framework.MemoryStats(this); - int from_bitField0_ = bitField0_; - result.tempMemorySize_ = tempMemorySize_; - result.persistentMemorySize_ = persistentMemorySize_; - if (((bitField0_ & 0x00000001) != 0)) { - persistentTensorAllocIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.persistentTensorAllocIds_ = persistentTensorAllocIds_; - result.deviceTempMemorySize_ = deviceTempMemorySize_; - result.devicePersistentMemorySize_ = devicePersistentMemorySize_; - if (((bitField0_ & 0x00000002) != 0)) { - devicePersistentTensorAllocIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.devicePersistentTensorAllocIds_ = devicePersistentTensorAllocIds_; - 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.MemoryStats) { - return mergeFrom((org.tensorflow.proto.framework.MemoryStats)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MemoryStats other) { - if (other == org.tensorflow.proto.framework.MemoryStats.getDefaultInstance()) return this; - if (other.getTempMemorySize() != 0L) { - setTempMemorySize(other.getTempMemorySize()); - } - if (other.getPersistentMemorySize() != 0L) { - setPersistentMemorySize(other.getPersistentMemorySize()); - } - if (!other.persistentTensorAllocIds_.isEmpty()) { - if (persistentTensorAllocIds_.isEmpty()) { - persistentTensorAllocIds_ = other.persistentTensorAllocIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePersistentTensorAllocIdsIsMutable(); - persistentTensorAllocIds_.addAll(other.persistentTensorAllocIds_); - } - onChanged(); - } - if (other.getDeviceTempMemorySize() != 0L) { - setDeviceTempMemorySize(other.getDeviceTempMemorySize()); - } - if (other.getDevicePersistentMemorySize() != 0L) { - setDevicePersistentMemorySize(other.getDevicePersistentMemorySize()); - } - if (!other.devicePersistentTensorAllocIds_.isEmpty()) { - if (devicePersistentTensorAllocIds_.isEmpty()) { - devicePersistentTensorAllocIds_ = other.devicePersistentTensorAllocIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDevicePersistentTensorAllocIdsIsMutable(); - devicePersistentTensorAllocIds_.addAll(other.devicePersistentTensorAllocIds_); - } - onChanged(); - } - 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.MemoryStats parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MemoryStats) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long tempMemorySize_ ; - /** - * int64 temp_memory_size = 1; - */ - public long getTempMemorySize() { - return tempMemorySize_; - } - /** - * int64 temp_memory_size = 1; - */ - public Builder setTempMemorySize(long value) { - - tempMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 temp_memory_size = 1; - */ - public Builder clearTempMemorySize() { - - tempMemorySize_ = 0L; - onChanged(); - return this; - } - - private long persistentMemorySize_ ; - /** - * int64 persistent_memory_size = 3; - */ - public long getPersistentMemorySize() { - return persistentMemorySize_; - } - /** - * int64 persistent_memory_size = 3; - */ - public Builder setPersistentMemorySize(long value) { - - persistentMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 persistent_memory_size = 3; - */ - public Builder clearPersistentMemorySize() { - - persistentMemorySize_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList persistentTensorAllocIds_ = emptyLongList(); - private void ensurePersistentTensorAllocIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - persistentTensorAllocIds_ = mutableCopy(persistentTensorAllocIds_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public java.util.List - getPersistentTensorAllocIdsList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(persistentTensorAllocIds_) : persistentTensorAllocIds_; - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public int getPersistentTensorAllocIdsCount() { - return persistentTensorAllocIds_.size(); - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public long getPersistentTensorAllocIds(int index) { - return persistentTensorAllocIds_.getLong(index); - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public Builder setPersistentTensorAllocIds( - int index, long value) { - ensurePersistentTensorAllocIdsIsMutable(); - persistentTensorAllocIds_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public Builder addPersistentTensorAllocIds(long value) { - ensurePersistentTensorAllocIdsIsMutable(); - persistentTensorAllocIds_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public Builder addAllPersistentTensorAllocIds( - java.lang.Iterable values) { - ensurePersistentTensorAllocIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, persistentTensorAllocIds_); - onChanged(); - return this; - } - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - public Builder clearPersistentTensorAllocIds() { - persistentTensorAllocIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private long deviceTempMemorySize_ ; - /** - * int64 device_temp_memory_size = 2 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemorySize() { - return deviceTempMemorySize_; - } - /** - * int64 device_temp_memory_size = 2 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDeviceTempMemorySize(long value) { - - deviceTempMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 device_temp_memory_size = 2 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDeviceTempMemorySize() { - - deviceTempMemorySize_ = 0L; - onChanged(); - return this; - } - - private long devicePersistentMemorySize_ ; - /** - * int64 device_persistent_memory_size = 4 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemorySize() { - return devicePersistentMemorySize_; - } - /** - * int64 device_persistent_memory_size = 4 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDevicePersistentMemorySize(long value) { - - devicePersistentMemorySize_ = value; - onChanged(); - return this; - } - /** - * int64 device_persistent_memory_size = 4 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDevicePersistentMemorySize() { - - devicePersistentMemorySize_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList devicePersistentTensorAllocIds_ = emptyLongList(); - private void ensureDevicePersistentTensorAllocIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - devicePersistentTensorAllocIds_ = mutableCopy(devicePersistentTensorAllocIds_); - bitField0_ |= 0x00000002; - } - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public java.util.List - getDevicePersistentTensorAllocIdsList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(devicePersistentTensorAllocIds_) : devicePersistentTensorAllocIds_; - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public int getDevicePersistentTensorAllocIdsCount() { - return devicePersistentTensorAllocIds_.size(); - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentTensorAllocIds(int index) { - return devicePersistentTensorAllocIds_.getLong(index); - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDevicePersistentTensorAllocIds( - int index, long value) { - ensureDevicePersistentTensorAllocIdsIsMutable(); - devicePersistentTensorAllocIds_.setLong(index, value); - onChanged(); - return this; - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder addDevicePersistentTensorAllocIds(long value) { - ensureDevicePersistentTensorAllocIdsIsMutable(); - devicePersistentTensorAllocIds_.addLong(value); - onChanged(); - return this; - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder addAllDevicePersistentTensorAllocIds( - java.lang.Iterable values) { - ensureDevicePersistentTensorAllocIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, devicePersistentTensorAllocIds_); - onChanged(); - return this; - } - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDevicePersistentTensorAllocIds() { - devicePersistentTensorAllocIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - 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.MemoryStats) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryStats) - private static final org.tensorflow.proto.framework.MemoryStats DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MemoryStats(); - } - - public static org.tensorflow.proto.framework.MemoryStats getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryStats parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryStats(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.MemoryStats getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStatsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStatsOrBuilder.java deleted file mode 100644 index db3c896352c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryStatsOrBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -public interface MemoryStatsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemoryStats) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 temp_memory_size = 1; - */ - long getTempMemorySize(); - - /** - * int64 persistent_memory_size = 3; - */ - long getPersistentMemorySize(); - - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - java.util.List getPersistentTensorAllocIdsList(); - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - int getPersistentTensorAllocIdsCount(); - /** - * repeated int64 persistent_tensor_alloc_ids = 5; - */ - long getPersistentTensorAllocIds(int index); - - /** - * int64 device_temp_memory_size = 2 [deprecated = true]; - */ - @java.lang.Deprecated long getDeviceTempMemorySize(); - - /** - * int64 device_persistent_memory_size = 4 [deprecated = true]; - */ - @java.lang.Deprecated long getDevicePersistentMemorySize(); - - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated java.util.List getDevicePersistentTensorAllocIdsList(); - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated int getDevicePersistentTensorAllocIdsCount(); - /** - * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; - */ - @java.lang.Deprecated long getDevicePersistentTensorAllocIds(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDef.java deleted file mode 100644 index b071cf84bf8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDef.java +++ /dev/null @@ -1,4702 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * NOTE: This protocol buffer is evolving, and will go through revisions in the
    - * coming months.
    - * Protocol buffer containing the following which are necessary to restart
    - * training, run inference. It can be used to serialize/de-serialize memory
    - * objects necessary for running computation in a graph when crossing the
    - * process boundary. It can be used for long term storage of graphs,
    - * cross-language execution of graphs, etc.
    - *   MetaInfoDef
    - *   GraphDef
    - *   SaverDef
    - *   CollectionDef
    - *   TensorInfo
    - *   SignatureDef
    - * 
    - * - * Protobuf type {@code tensorflow.MetaGraphDef} - */ -public final class MetaGraphDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MetaGraphDef) - MetaGraphDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use MetaGraphDef.newBuilder() to construct. - private MetaGraphDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MetaGraphDef() { - assetFileDef_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MetaGraphDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MetaGraphDef( - 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.framework.MetaGraphDef.MetaInfoDef.Builder subBuilder = null; - if (metaInfoDef_ != null) { - subBuilder = metaInfoDef_.toBuilder(); - } - metaInfoDef_ = input.readMessage(org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metaInfoDef_); - metaInfoDef_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.tensorflow.proto.framework.GraphDef.Builder subBuilder = null; - if (graphDef_ != null) { - subBuilder = graphDef_.toBuilder(); - } - graphDef_ = input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(graphDef_); - graphDef_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.util.SaverDef.Builder subBuilder = null; - if (saverDef_ != null) { - subBuilder = saverDef_.toBuilder(); - } - saverDef_ = input.readMessage(org.tensorflow.proto.util.SaverDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(saverDef_); - saverDef_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - collectionDef_ = com.google.protobuf.MapField.newMapField( - CollectionDefDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - collectionDef__ = input.readMessage( - CollectionDefDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - collectionDef_.getMutableMap().put( - collectionDef__.getKey(), collectionDef__.getValue()); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - signatureDef_ = com.google.protobuf.MapField.newMapField( - SignatureDefDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - signatureDef__ = input.readMessage( - SignatureDefDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - signatureDef_.getMutableMap().put( - signatureDef__.getKey(), signatureDef__.getValue()); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - assetFileDef_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - assetFileDef_.add( - input.readMessage(org.tensorflow.proto.framework.AssetFileDef.parser(), extensionRegistry)); - break; - } - case 58: { - org.tensorflow.proto.framework.SavedObjectGraph.Builder subBuilder = null; - if (objectGraphDef_ != null) { - subBuilder = objectGraphDef_.toBuilder(); - } - objectGraphDef_ = input.readMessage(org.tensorflow.proto.framework.SavedObjectGraph.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(objectGraphDef_); - objectGraphDef_ = subBuilder.buildPartial(); - } - - 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_ & 0x00000004) != 0)) { - assetFileDef_ = java.util.Collections.unmodifiableList(assetFileDef_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetCollectionDef(); - case 5: - return internalGetSignatureDef(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MetaGraphDef.class, org.tensorflow.proto.framework.MetaGraphDef.Builder.class); - } - - public interface MetaInfoDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MetaGraphDef.MetaInfoDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * User specified Version string. Can be the name of the model and revision,
    -     * steps this model has been trained to, etc.
    -     * 
    - * - * string meta_graph_version = 1; - */ - java.lang.String getMetaGraphVersion(); - /** - *
    -     * User specified Version string. Can be the name of the model and revision,
    -     * steps this model has been trained to, etc.
    -     * 
    - * - * string meta_graph_version = 1; - */ - com.google.protobuf.ByteString - getMetaGraphVersionBytes(); - - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - boolean hasStrippedOpList(); - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - org.tensorflow.proto.framework.OpList getStrippedOpList(); - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - org.tensorflow.proto.framework.OpListOrBuilder getStrippedOpListOrBuilder(); - - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - boolean hasAnyInfo(); - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - com.google.protobuf.Any getAnyInfo(); - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder(); - - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - java.util.List - getTagsList(); - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - int getTagsCount(); - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - java.lang.String getTags(int index); - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - com.google.protobuf.ByteString - getTagsBytes(int index); - - /** - *
    -     * The __version__ string of the tensorflow build used to write this graph.
    -     * This will be populated by the framework, which will overwrite any user
    -     * supplied value.
    -     * 
    - * - * string tensorflow_version = 5; - */ - java.lang.String getTensorflowVersion(); - /** - *
    -     * The __version__ string of the tensorflow build used to write this graph.
    -     * This will be populated by the framework, which will overwrite any user
    -     * supplied value.
    -     * 
    - * - * string tensorflow_version = 5; - */ - com.google.protobuf.ByteString - getTensorflowVersionBytes(); - - /** - *
    -     * The __git_version__ string of the tensorflow build used to write this
    -     * graph. This will be populated by the framework, which will overwrite any
    -     * user supplied value.
    -     * 
    - * - * string tensorflow_git_version = 6; - */ - java.lang.String getTensorflowGitVersion(); - /** - *
    -     * The __git_version__ string of the tensorflow build used to write this
    -     * graph. This will be populated by the framework, which will overwrite any
    -     * user supplied value.
    -     * 
    - * - * string tensorflow_git_version = 6; - */ - com.google.protobuf.ByteString - getTensorflowGitVersionBytes(); - - /** - *
    -     * A flag to denote whether default-valued attrs have been stripped from
    -     * the nodes in this graph_def.
    -     * 
    - * - * bool stripped_default_attrs = 7; - */ - boolean getStrippedDefaultAttrs(); - - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - int getFunctionAliasesCount(); - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - boolean containsFunctionAliases( - java.lang.String key); - /** - * Use {@link #getFunctionAliasesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getFunctionAliases(); - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - java.util.Map - getFunctionAliasesMap(); - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - java.lang.String getFunctionAliasesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - java.lang.String getFunctionAliasesOrThrow( - java.lang.String key); - } - /** - *
    -   * Meta information regarding the graph to be exported.  To be used by users
    -   * of this protocol buffer to encode information regarding their meta graph.
    -   * 
    - * - * Protobuf type {@code tensorflow.MetaGraphDef.MetaInfoDef} - */ - public static final class MetaInfoDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MetaGraphDef.MetaInfoDef) - MetaInfoDefOrBuilder { - private static final long serialVersionUID = 0L; - // Use MetaInfoDef.newBuilder() to construct. - private MetaInfoDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MetaInfoDef() { - metaGraphVersion_ = ""; - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - tensorflowVersion_ = ""; - tensorflowGitVersion_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MetaInfoDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MetaInfoDef( - 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(); - - metaGraphVersion_ = s; - break; - } - case 18: { - org.tensorflow.proto.framework.OpList.Builder subBuilder = null; - if (strippedOpList_ != null) { - subBuilder = strippedOpList_.toBuilder(); - } - strippedOpList_ = input.readMessage(org.tensorflow.proto.framework.OpList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(strippedOpList_); - strippedOpList_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - com.google.protobuf.Any.Builder subBuilder = null; - if (anyInfo_ != null) { - subBuilder = anyInfo_.toBuilder(); - } - anyInfo_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(anyInfo_); - anyInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tags_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tags_.add(s); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - tensorflowVersion_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - tensorflowGitVersion_ = s; - break; - } - case 56: { - - strippedDefaultAttrs_ = input.readBool(); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - functionAliases_ = com.google.protobuf.MapField.newMapField( - FunctionAliasesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - functionAliases__ = input.readMessage( - FunctionAliasesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - functionAliases_.getMutableMap().put( - functionAliases__.getKey(), functionAliases__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - tags_ = tags_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetFunctionAliases(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.class, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder.class); - } - - public static final int META_GRAPH_VERSION_FIELD_NUMBER = 1; - private volatile java.lang.Object metaGraphVersion_; - /** - *
    -     * User specified Version string. Can be the name of the model and revision,
    -     * steps this model has been trained to, etc.
    -     * 
    - * - * string meta_graph_version = 1; - */ - public java.lang.String getMetaGraphVersion() { - java.lang.Object ref = metaGraphVersion_; - 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(); - metaGraphVersion_ = s; - return s; - } - } - /** - *
    -     * User specified Version string. Can be the name of the model and revision,
    -     * steps this model has been trained to, etc.
    -     * 
    - * - * string meta_graph_version = 1; - */ - public com.google.protobuf.ByteString - getMetaGraphVersionBytes() { - java.lang.Object ref = metaGraphVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metaGraphVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STRIPPED_OP_LIST_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.OpList strippedOpList_; - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public boolean hasStrippedOpList() { - return strippedOpList_ != null; - } - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public org.tensorflow.proto.framework.OpList getStrippedOpList() { - return strippedOpList_ == null ? org.tensorflow.proto.framework.OpList.getDefaultInstance() : strippedOpList_; - } - /** - *
    -     * A copy of the OpDefs used by the producer of this graph_def.
    -     * Descriptions and Ops not used in graph_def are stripped out.
    -     * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public org.tensorflow.proto.framework.OpListOrBuilder getStrippedOpListOrBuilder() { - return getStrippedOpList(); - } - - public static final int ANY_INFO_FIELD_NUMBER = 3; - private com.google.protobuf.Any anyInfo_; - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public boolean hasAnyInfo() { - return anyInfo_ != null; - } - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public com.google.protobuf.Any getAnyInfo() { - return anyInfo_ == null ? com.google.protobuf.Any.getDefaultInstance() : anyInfo_; - } - /** - *
    -     * A serialized protobuf. Can be the time this meta graph is created, or
    -     * modified, or name of the model.
    -     * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder() { - return getAnyInfo(); - } - - public static final int TAGS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList tags_; - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - public com.google.protobuf.ProtocolStringList - getTagsList() { - return tags_; - } - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - public int getTagsCount() { - return tags_.size(); - } - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - public java.lang.String getTags(int index) { - return tags_.get(index); - } - /** - *
    -     * User supplied tag(s) on the meta_graph and included graph_def.
    -     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -     * Examples: "train", "serve", "gpu", "tpu", etc.
    -     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -     * specific use-case or runtime environment.
    -     * 
    - * - * repeated string tags = 4; - */ - public com.google.protobuf.ByteString - getTagsBytes(int index) { - return tags_.getByteString(index); - } - - public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 5; - private volatile java.lang.Object tensorflowVersion_; - /** - *
    -     * The __version__ string of the tensorflow build used to write this graph.
    -     * This will be populated by the framework, which will overwrite any user
    -     * supplied value.
    -     * 
    - * - * string tensorflow_version = 5; - */ - public java.lang.String getTensorflowVersion() { - java.lang.Object ref = tensorflowVersion_; - 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(); - tensorflowVersion_ = s; - return s; - } - } - /** - *
    -     * The __version__ string of the tensorflow build used to write this graph.
    -     * This will be populated by the framework, which will overwrite any user
    -     * supplied value.
    -     * 
    - * - * string tensorflow_version = 5; - */ - public com.google.protobuf.ByteString - getTensorflowVersionBytes() { - java.lang.Object ref = tensorflowVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TENSORFLOW_GIT_VERSION_FIELD_NUMBER = 6; - private volatile java.lang.Object tensorflowGitVersion_; - /** - *
    -     * The __git_version__ string of the tensorflow build used to write this
    -     * graph. This will be populated by the framework, which will overwrite any
    -     * user supplied value.
    -     * 
    - * - * string tensorflow_git_version = 6; - */ - public java.lang.String getTensorflowGitVersion() { - java.lang.Object ref = tensorflowGitVersion_; - 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(); - tensorflowGitVersion_ = s; - return s; - } - } - /** - *
    -     * The __git_version__ string of the tensorflow build used to write this
    -     * graph. This will be populated by the framework, which will overwrite any
    -     * user supplied value.
    -     * 
    - * - * string tensorflow_git_version = 6; - */ - public com.google.protobuf.ByteString - getTensorflowGitVersionBytes() { - java.lang.Object ref = tensorflowGitVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowGitVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STRIPPED_DEFAULT_ATTRS_FIELD_NUMBER = 7; - private boolean strippedDefaultAttrs_; - /** - *
    -     * A flag to denote whether default-valued attrs have been stripped from
    -     * the nodes in this graph_def.
    -     * 
    - * - * bool stripped_default_attrs = 7; - */ - public boolean getStrippedDefaultAttrs() { - return strippedDefaultAttrs_; - } - - public static final int FUNCTION_ALIASES_FIELD_NUMBER = 8; - private static final class FunctionAliasesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> functionAliases_; - private com.google.protobuf.MapField - internalGetFunctionAliases() { - if (functionAliases_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FunctionAliasesDefaultEntryHolder.defaultEntry); - } - return functionAliases_; - } - - public int getFunctionAliasesCount() { - return internalGetFunctionAliases().getMap().size(); - } - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - public boolean containsFunctionAliases( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFunctionAliases().getMap().containsKey(key); - } - /** - * Use {@link #getFunctionAliasesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFunctionAliases() { - return getFunctionAliasesMap(); - } - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.util.Map getFunctionAliasesMap() { - return internalGetFunctionAliases().getMap(); - } - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.lang.String getFunctionAliasesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFunctionAliases().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * FunctionDef name to aliases mapping.
    -     * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.lang.String getFunctionAliasesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFunctionAliases().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 (!getMetaGraphVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metaGraphVersion_); - } - if (strippedOpList_ != null) { - output.writeMessage(2, getStrippedOpList()); - } - if (anyInfo_ != null) { - output.writeMessage(3, getAnyInfo()); - } - for (int i = 0; i < tags_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tags_.getRaw(i)); - } - if (!getTensorflowVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, tensorflowVersion_); - } - if (!getTensorflowGitVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, tensorflowGitVersion_); - } - if (strippedDefaultAttrs_ != false) { - output.writeBool(7, strippedDefaultAttrs_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetFunctionAliases(), - FunctionAliasesDefaultEntryHolder.defaultEntry, - 8); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getMetaGraphVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metaGraphVersion_); - } - if (strippedOpList_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getStrippedOpList()); - } - if (anyInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getAnyInfo()); - } - { - int dataSize = 0; - for (int i = 0; i < tags_.size(); i++) { - dataSize += computeStringSizeNoTag(tags_.getRaw(i)); - } - size += dataSize; - size += 1 * getTagsList().size(); - } - if (!getTensorflowVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, tensorflowVersion_); - } - if (!getTensorflowGitVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, tensorflowGitVersion_); - } - if (strippedDefaultAttrs_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, strippedDefaultAttrs_); - } - for (java.util.Map.Entry entry - : internalGetFunctionAliases().getMap().entrySet()) { - com.google.protobuf.MapEntry - functionAliases__ = FunctionAliasesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, functionAliases__); - } - 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.MetaGraphDef.MetaInfoDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef other = (org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef) obj; - - if (!getMetaGraphVersion() - .equals(other.getMetaGraphVersion())) return false; - if (hasStrippedOpList() != other.hasStrippedOpList()) return false; - if (hasStrippedOpList()) { - if (!getStrippedOpList() - .equals(other.getStrippedOpList())) return false; - } - if (hasAnyInfo() != other.hasAnyInfo()) return false; - if (hasAnyInfo()) { - if (!getAnyInfo() - .equals(other.getAnyInfo())) return false; - } - if (!getTagsList() - .equals(other.getTagsList())) return false; - if (!getTensorflowVersion() - .equals(other.getTensorflowVersion())) return false; - if (!getTensorflowGitVersion() - .equals(other.getTensorflowGitVersion())) return false; - if (getStrippedDefaultAttrs() - != other.getStrippedDefaultAttrs()) return false; - if (!internalGetFunctionAliases().equals( - other.internalGetFunctionAliases())) 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) + META_GRAPH_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getMetaGraphVersion().hashCode(); - if (hasStrippedOpList()) { - hash = (37 * hash) + STRIPPED_OP_LIST_FIELD_NUMBER; - hash = (53 * hash) + getStrippedOpList().hashCode(); - } - if (hasAnyInfo()) { - hash = (37 * hash) + ANY_INFO_FIELD_NUMBER; - hash = (53 * hash) + getAnyInfo().hashCode(); - } - if (getTagsCount() > 0) { - hash = (37 * hash) + TAGS_FIELD_NUMBER; - hash = (53 * hash) + getTagsList().hashCode(); - } - hash = (37 * hash) + TENSORFLOW_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getTensorflowVersion().hashCode(); - hash = (37 * hash) + TENSORFLOW_GIT_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getTensorflowGitVersion().hashCode(); - hash = (37 * hash) + STRIPPED_DEFAULT_ATTRS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStrippedDefaultAttrs()); - if (!internalGetFunctionAliases().getMap().isEmpty()) { - hash = (37 * hash) + FUNCTION_ALIASES_FIELD_NUMBER; - hash = (53 * hash) + internalGetFunctionAliases().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef 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; - } - /** - *
    -     * Meta information regarding the graph to be exported.  To be used by users
    -     * of this protocol buffer to encode information regarding their meta graph.
    -     * 
    - * - * Protobuf type {@code tensorflow.MetaGraphDef.MetaInfoDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MetaGraphDef.MetaInfoDef) - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetFunctionAliases(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 8: - return internalGetMutableFunctionAliases(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.class, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.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(); - metaGraphVersion_ = ""; - - if (strippedOpListBuilder_ == null) { - strippedOpList_ = null; - } else { - strippedOpList_ = null; - strippedOpListBuilder_ = null; - } - if (anyInfoBuilder_ == null) { - anyInfo_ = null; - } else { - anyInfo_ = null; - anyInfoBuilder_ = null; - } - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - tensorflowVersion_ = ""; - - tensorflowGitVersion_ = ""; - - strippedDefaultAttrs_ = false; - - internalGetMutableFunctionAliases().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef build() { - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef buildPartial() { - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef result = new org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef(this); - int from_bitField0_ = bitField0_; - result.metaGraphVersion_ = metaGraphVersion_; - if (strippedOpListBuilder_ == null) { - result.strippedOpList_ = strippedOpList_; - } else { - result.strippedOpList_ = strippedOpListBuilder_.build(); - } - if (anyInfoBuilder_ == null) { - result.anyInfo_ = anyInfo_; - } else { - result.anyInfo_ = anyInfoBuilder_.build(); - } - if (((bitField0_ & 0x00000001) != 0)) { - tags_ = tags_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tags_ = tags_; - result.tensorflowVersion_ = tensorflowVersion_; - result.tensorflowGitVersion_ = tensorflowGitVersion_; - result.strippedDefaultAttrs_ = strippedDefaultAttrs_; - result.functionAliases_ = internalGetFunctionAliases(); - result.functionAliases_.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.MetaGraphDef.MetaInfoDef) { - return mergeFrom((org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef other) { - if (other == org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.getDefaultInstance()) return this; - if (!other.getMetaGraphVersion().isEmpty()) { - metaGraphVersion_ = other.metaGraphVersion_; - onChanged(); - } - if (other.hasStrippedOpList()) { - mergeStrippedOpList(other.getStrippedOpList()); - } - if (other.hasAnyInfo()) { - mergeAnyInfo(other.getAnyInfo()); - } - if (!other.tags_.isEmpty()) { - if (tags_.isEmpty()) { - tags_ = other.tags_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTagsIsMutable(); - tags_.addAll(other.tags_); - } - onChanged(); - } - if (!other.getTensorflowVersion().isEmpty()) { - tensorflowVersion_ = other.tensorflowVersion_; - onChanged(); - } - if (!other.getTensorflowGitVersion().isEmpty()) { - tensorflowGitVersion_ = other.tensorflowGitVersion_; - onChanged(); - } - if (other.getStrippedDefaultAttrs() != false) { - setStrippedDefaultAttrs(other.getStrippedDefaultAttrs()); - } - internalGetMutableFunctionAliases().mergeFrom( - other.internalGetFunctionAliases()); - 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.MetaGraphDef.MetaInfoDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object metaGraphVersion_ = ""; - /** - *
    -       * User specified Version string. Can be the name of the model and revision,
    -       * steps this model has been trained to, etc.
    -       * 
    - * - * string meta_graph_version = 1; - */ - public java.lang.String getMetaGraphVersion() { - java.lang.Object ref = metaGraphVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metaGraphVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * User specified Version string. Can be the name of the model and revision,
    -       * steps this model has been trained to, etc.
    -       * 
    - * - * string meta_graph_version = 1; - */ - public com.google.protobuf.ByteString - getMetaGraphVersionBytes() { - java.lang.Object ref = metaGraphVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metaGraphVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * User specified Version string. Can be the name of the model and revision,
    -       * steps this model has been trained to, etc.
    -       * 
    - * - * string meta_graph_version = 1; - */ - public Builder setMetaGraphVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metaGraphVersion_ = value; - onChanged(); - return this; - } - /** - *
    -       * User specified Version string. Can be the name of the model and revision,
    -       * steps this model has been trained to, etc.
    -       * 
    - * - * string meta_graph_version = 1; - */ - public Builder clearMetaGraphVersion() { - - metaGraphVersion_ = getDefaultInstance().getMetaGraphVersion(); - onChanged(); - return this; - } - /** - *
    -       * User specified Version string. Can be the name of the model and revision,
    -       * steps this model has been trained to, etc.
    -       * 
    - * - * string meta_graph_version = 1; - */ - public Builder setMetaGraphVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metaGraphVersion_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.OpList strippedOpList_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpList, org.tensorflow.proto.framework.OpList.Builder, org.tensorflow.proto.framework.OpListOrBuilder> strippedOpListBuilder_; - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public boolean hasStrippedOpList() { - return strippedOpListBuilder_ != null || strippedOpList_ != null; - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public org.tensorflow.proto.framework.OpList getStrippedOpList() { - if (strippedOpListBuilder_ == null) { - return strippedOpList_ == null ? org.tensorflow.proto.framework.OpList.getDefaultInstance() : strippedOpList_; - } else { - return strippedOpListBuilder_.getMessage(); - } - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public Builder setStrippedOpList(org.tensorflow.proto.framework.OpList value) { - if (strippedOpListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - strippedOpList_ = value; - onChanged(); - } else { - strippedOpListBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public Builder setStrippedOpList( - org.tensorflow.proto.framework.OpList.Builder builderForValue) { - if (strippedOpListBuilder_ == null) { - strippedOpList_ = builderForValue.build(); - onChanged(); - } else { - strippedOpListBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public Builder mergeStrippedOpList(org.tensorflow.proto.framework.OpList value) { - if (strippedOpListBuilder_ == null) { - if (strippedOpList_ != null) { - strippedOpList_ = - org.tensorflow.proto.framework.OpList.newBuilder(strippedOpList_).mergeFrom(value).buildPartial(); - } else { - strippedOpList_ = value; - } - onChanged(); - } else { - strippedOpListBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public Builder clearStrippedOpList() { - if (strippedOpListBuilder_ == null) { - strippedOpList_ = null; - onChanged(); - } else { - strippedOpList_ = null; - strippedOpListBuilder_ = null; - } - - return this; - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public org.tensorflow.proto.framework.OpList.Builder getStrippedOpListBuilder() { - - onChanged(); - return getStrippedOpListFieldBuilder().getBuilder(); - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - public org.tensorflow.proto.framework.OpListOrBuilder getStrippedOpListOrBuilder() { - if (strippedOpListBuilder_ != null) { - return strippedOpListBuilder_.getMessageOrBuilder(); - } else { - return strippedOpList_ == null ? - org.tensorflow.proto.framework.OpList.getDefaultInstance() : strippedOpList_; - } - } - /** - *
    -       * A copy of the OpDefs used by the producer of this graph_def.
    -       * Descriptions and Ops not used in graph_def are stripped out.
    -       * 
    - * - * .tensorflow.OpList stripped_op_list = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpList, org.tensorflow.proto.framework.OpList.Builder, org.tensorflow.proto.framework.OpListOrBuilder> - getStrippedOpListFieldBuilder() { - if (strippedOpListBuilder_ == null) { - strippedOpListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpList, org.tensorflow.proto.framework.OpList.Builder, org.tensorflow.proto.framework.OpListOrBuilder>( - getStrippedOpList(), - getParentForChildren(), - isClean()); - strippedOpList_ = null; - } - return strippedOpListBuilder_; - } - - private com.google.protobuf.Any anyInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> anyInfoBuilder_; - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public boolean hasAnyInfo() { - return anyInfoBuilder_ != null || anyInfo_ != null; - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public com.google.protobuf.Any getAnyInfo() { - if (anyInfoBuilder_ == null) { - return anyInfo_ == null ? com.google.protobuf.Any.getDefaultInstance() : anyInfo_; - } else { - return anyInfoBuilder_.getMessage(); - } - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public Builder setAnyInfo(com.google.protobuf.Any value) { - if (anyInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - anyInfo_ = value; - onChanged(); - } else { - anyInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public Builder setAnyInfo( - com.google.protobuf.Any.Builder builderForValue) { - if (anyInfoBuilder_ == null) { - anyInfo_ = builderForValue.build(); - onChanged(); - } else { - anyInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public Builder mergeAnyInfo(com.google.protobuf.Any value) { - if (anyInfoBuilder_ == null) { - if (anyInfo_ != null) { - anyInfo_ = - com.google.protobuf.Any.newBuilder(anyInfo_).mergeFrom(value).buildPartial(); - } else { - anyInfo_ = value; - } - onChanged(); - } else { - anyInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public Builder clearAnyInfo() { - if (anyInfoBuilder_ == null) { - anyInfo_ = null; - onChanged(); - } else { - anyInfo_ = null; - anyInfoBuilder_ = null; - } - - return this; - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public com.google.protobuf.Any.Builder getAnyInfoBuilder() { - - onChanged(); - return getAnyInfoFieldBuilder().getBuilder(); - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - public com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder() { - if (anyInfoBuilder_ != null) { - return anyInfoBuilder_.getMessageOrBuilder(); - } else { - return anyInfo_ == null ? - com.google.protobuf.Any.getDefaultInstance() : anyInfo_; - } - } - /** - *
    -       * A serialized protobuf. Can be the time this meta graph is created, or
    -       * modified, or name of the model.
    -       * 
    - * - * .google.protobuf.Any any_info = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getAnyInfoFieldBuilder() { - if (anyInfoBuilder_ == null) { - anyInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - getAnyInfo(), - getParentForChildren(), - isClean()); - anyInfo_ = null; - } - return anyInfoBuilder_; - } - - private com.google.protobuf.LazyStringList tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureTagsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tags_ = new com.google.protobuf.LazyStringArrayList(tags_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public com.google.protobuf.ProtocolStringList - getTagsList() { - return tags_.getUnmodifiableView(); - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public int getTagsCount() { - return tags_.size(); - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public java.lang.String getTags(int index) { - return tags_.get(index); - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public com.google.protobuf.ByteString - getTagsBytes(int index) { - return tags_.getByteString(index); - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public Builder setTags( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTagsIsMutable(); - tags_.set(index, value); - onChanged(); - return this; - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public Builder addTags( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTagsIsMutable(); - tags_.add(value); - onChanged(); - return this; - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public Builder addAllTags( - java.lang.Iterable values) { - ensureTagsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tags_); - onChanged(); - return this; - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public Builder clearTags() { - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -       * User supplied tag(s) on the meta_graph and included graph_def.
    -       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    -       * Examples: "train", "serve", "gpu", "tpu", etc.
    -       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    -       * specific use-case or runtime environment.
    -       * 
    - * - * repeated string tags = 4; - */ - public Builder addTagsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTagsIsMutable(); - tags_.add(value); - onChanged(); - return this; - } - - private java.lang.Object tensorflowVersion_ = ""; - /** - *
    -       * The __version__ string of the tensorflow build used to write this graph.
    -       * This will be populated by the framework, which will overwrite any user
    -       * supplied value.
    -       * 
    - * - * string tensorflow_version = 5; - */ - public java.lang.String getTensorflowVersion() { - java.lang.Object ref = tensorflowVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tensorflowVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The __version__ string of the tensorflow build used to write this graph.
    -       * This will be populated by the framework, which will overwrite any user
    -       * supplied value.
    -       * 
    - * - * string tensorflow_version = 5; - */ - public com.google.protobuf.ByteString - getTensorflowVersionBytes() { - java.lang.Object ref = tensorflowVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The __version__ string of the tensorflow build used to write this graph.
    -       * This will be populated by the framework, which will overwrite any user
    -       * supplied value.
    -       * 
    - * - * string tensorflow_version = 5; - */ - public Builder setTensorflowVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorflowVersion_ = value; - onChanged(); - return this; - } - /** - *
    -       * The __version__ string of the tensorflow build used to write this graph.
    -       * This will be populated by the framework, which will overwrite any user
    -       * supplied value.
    -       * 
    - * - * string tensorflow_version = 5; - */ - public Builder clearTensorflowVersion() { - - tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); - onChanged(); - return this; - } - /** - *
    -       * The __version__ string of the tensorflow build used to write this graph.
    -       * This will be populated by the framework, which will overwrite any user
    -       * supplied value.
    -       * 
    - * - * string tensorflow_version = 5; - */ - public Builder setTensorflowVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tensorflowVersion_ = value; - onChanged(); - return this; - } - - private java.lang.Object tensorflowGitVersion_ = ""; - /** - *
    -       * The __git_version__ string of the tensorflow build used to write this
    -       * graph. This will be populated by the framework, which will overwrite any
    -       * user supplied value.
    -       * 
    - * - * string tensorflow_git_version = 6; - */ - public java.lang.String getTensorflowGitVersion() { - java.lang.Object ref = tensorflowGitVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tensorflowGitVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The __git_version__ string of the tensorflow build used to write this
    -       * graph. This will be populated by the framework, which will overwrite any
    -       * user supplied value.
    -       * 
    - * - * string tensorflow_git_version = 6; - */ - public com.google.protobuf.ByteString - getTensorflowGitVersionBytes() { - java.lang.Object ref = tensorflowGitVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowGitVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The __git_version__ string of the tensorflow build used to write this
    -       * graph. This will be populated by the framework, which will overwrite any
    -       * user supplied value.
    -       * 
    - * - * string tensorflow_git_version = 6; - */ - public Builder setTensorflowGitVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorflowGitVersion_ = value; - onChanged(); - return this; - } - /** - *
    -       * The __git_version__ string of the tensorflow build used to write this
    -       * graph. This will be populated by the framework, which will overwrite any
    -       * user supplied value.
    -       * 
    - * - * string tensorflow_git_version = 6; - */ - public Builder clearTensorflowGitVersion() { - - tensorflowGitVersion_ = getDefaultInstance().getTensorflowGitVersion(); - onChanged(); - return this; - } - /** - *
    -       * The __git_version__ string of the tensorflow build used to write this
    -       * graph. This will be populated by the framework, which will overwrite any
    -       * user supplied value.
    -       * 
    - * - * string tensorflow_git_version = 6; - */ - public Builder setTensorflowGitVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tensorflowGitVersion_ = value; - onChanged(); - return this; - } - - private boolean strippedDefaultAttrs_ ; - /** - *
    -       * A flag to denote whether default-valued attrs have been stripped from
    -       * the nodes in this graph_def.
    -       * 
    - * - * bool stripped_default_attrs = 7; - */ - public boolean getStrippedDefaultAttrs() { - return strippedDefaultAttrs_; - } - /** - *
    -       * A flag to denote whether default-valued attrs have been stripped from
    -       * the nodes in this graph_def.
    -       * 
    - * - * bool stripped_default_attrs = 7; - */ - public Builder setStrippedDefaultAttrs(boolean value) { - - strippedDefaultAttrs_ = value; - onChanged(); - return this; - } - /** - *
    -       * A flag to denote whether default-valued attrs have been stripped from
    -       * the nodes in this graph_def.
    -       * 
    - * - * bool stripped_default_attrs = 7; - */ - public Builder clearStrippedDefaultAttrs() { - - strippedDefaultAttrs_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> functionAliases_; - private com.google.protobuf.MapField - internalGetFunctionAliases() { - if (functionAliases_ == null) { - return com.google.protobuf.MapField.emptyMapField( - FunctionAliasesDefaultEntryHolder.defaultEntry); - } - return functionAliases_; - } - private com.google.protobuf.MapField - internalGetMutableFunctionAliases() { - onChanged();; - if (functionAliases_ == null) { - functionAliases_ = com.google.protobuf.MapField.newMapField( - FunctionAliasesDefaultEntryHolder.defaultEntry); - } - if (!functionAliases_.isMutable()) { - functionAliases_ = functionAliases_.copy(); - } - return functionAliases_; - } - - public int getFunctionAliasesCount() { - return internalGetFunctionAliases().getMap().size(); - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public boolean containsFunctionAliases( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetFunctionAliases().getMap().containsKey(key); - } - /** - * Use {@link #getFunctionAliasesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getFunctionAliases() { - return getFunctionAliasesMap(); - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.util.Map getFunctionAliasesMap() { - return internalGetFunctionAliases().getMap(); - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.lang.String getFunctionAliasesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFunctionAliases().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public java.lang.String getFunctionAliasesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetFunctionAliases().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearFunctionAliases() { - internalGetMutableFunctionAliases().getMutableMap() - .clear(); - return this; - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public Builder removeFunctionAliases( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFunctionAliases().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableFunctionAliases() { - return internalGetMutableFunctionAliases().getMutableMap(); - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - public Builder putFunctionAliases( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableFunctionAliases().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -       * FunctionDef name to aliases mapping.
    -       * 
    - * - * map<string, string> function_aliases = 8; - */ - - public Builder putAllFunctionAliases( - java.util.Map values) { - internalGetMutableFunctionAliases().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.MetaGraphDef.MetaInfoDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MetaGraphDef.MetaInfoDef) - private static final org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef(); - } - - public static org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MetaInfoDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MetaInfoDef(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.MetaGraphDef.MetaInfoDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int META_INFO_DEF_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef metaInfoDef_; - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public boolean hasMetaInfoDef() { - return metaInfoDef_ != null; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef getMetaInfoDef() { - return metaInfoDef_ == null ? org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder() { - return getMetaInfoDef(); - } - - public static final int GRAPH_DEF_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.GraphDef graphDef_; - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public boolean hasGraphDef() { - return graphDef_ != null; - } - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public org.tensorflow.proto.framework.GraphDef getGraphDef() { - return graphDef_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : graphDef_; - } - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getGraphDefOrBuilder() { - return getGraphDef(); - } - - public static final int SAVER_DEF_FIELD_NUMBER = 3; - private org.tensorflow.proto.util.SaverDef saverDef_; - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public boolean hasSaverDef() { - return saverDef_ != null; - } - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public org.tensorflow.proto.util.SaverDef getSaverDef() { - return saverDef_ == null ? org.tensorflow.proto.util.SaverDef.getDefaultInstance() : saverDef_; - } - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public org.tensorflow.proto.util.SaverDefOrBuilder getSaverDefOrBuilder() { - return getSaverDef(); - } - - public static final int COLLECTION_DEF_FIELD_NUMBER = 4; - private static final class CollectionDefDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.CollectionDef> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.CollectionDef.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.CollectionDef> collectionDef_; - private com.google.protobuf.MapField - internalGetCollectionDef() { - if (collectionDef_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CollectionDefDefaultEntryHolder.defaultEntry); - } - return collectionDef_; - } - - public int getCollectionDefCount() { - return internalGetCollectionDef().getMap().size(); - } - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public boolean containsCollectionDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCollectionDef().getMap().containsKey(key); - } - /** - * Use {@link #getCollectionDefMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getCollectionDef() { - return getCollectionDefMap(); - } - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public java.util.Map getCollectionDefMap() { - return internalGetCollectionDef().getMap(); - } - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public org.tensorflow.proto.framework.CollectionDef getCollectionDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.CollectionDef defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCollectionDef().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public org.tensorflow.proto.framework.CollectionDef getCollectionDefOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCollectionDef().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int SIGNATURE_DEF_FIELD_NUMBER = 5; - private static final class SignatureDefDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.SignatureDef> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.SignatureDef.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SignatureDef> signatureDef_; - private com.google.protobuf.MapField - internalGetSignatureDef() { - if (signatureDef_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SignatureDefDefaultEntryHolder.defaultEntry); - } - return signatureDef_; - } - - public int getSignatureDefCount() { - return internalGetSignatureDef().getMap().size(); - } - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public boolean containsSignatureDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetSignatureDef().getMap().containsKey(key); - } - /** - * Use {@link #getSignatureDefMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getSignatureDef() { - return getSignatureDefMap(); - } - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public java.util.Map getSignatureDefMap() { - return internalGetSignatureDef().getMap(); - } - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public org.tensorflow.proto.framework.SignatureDef getSignatureDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SignatureDef defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSignatureDef().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public org.tensorflow.proto.framework.SignatureDef getSignatureDefOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSignatureDef().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int ASSET_FILE_DEF_FIELD_NUMBER = 6; - private java.util.List assetFileDef_; - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public java.util.List getAssetFileDefList() { - return assetFileDef_; - } - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public java.util.List - getAssetFileDefOrBuilderList() { - return assetFileDef_; - } - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public int getAssetFileDefCount() { - return assetFileDef_.size(); - } - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDef getAssetFileDef(int index) { - return assetFileDef_.get(index); - } - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDefOrBuilder getAssetFileDefOrBuilder( - int index) { - return assetFileDef_.get(index); - } - - public static final int OBJECT_GRAPH_DEF_FIELD_NUMBER = 7; - private org.tensorflow.proto.framework.SavedObjectGraph objectGraphDef_; - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public boolean hasObjectGraphDef() { - return objectGraphDef_ != null; - } - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public org.tensorflow.proto.framework.SavedObjectGraph getObjectGraphDef() { - return objectGraphDef_ == null ? org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; - } - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public org.tensorflow.proto.framework.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder() { - return getObjectGraphDef(); - } - - 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 (metaInfoDef_ != null) { - output.writeMessage(1, getMetaInfoDef()); - } - if (graphDef_ != null) { - output.writeMessage(2, getGraphDef()); - } - if (saverDef_ != null) { - output.writeMessage(3, getSaverDef()); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetCollectionDef(), - CollectionDefDefaultEntryHolder.defaultEntry, - 4); - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetSignatureDef(), - SignatureDefDefaultEntryHolder.defaultEntry, - 5); - for (int i = 0; i < assetFileDef_.size(); i++) { - output.writeMessage(6, assetFileDef_.get(i)); - } - if (objectGraphDef_ != null) { - output.writeMessage(7, getObjectGraphDef()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (metaInfoDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getMetaInfoDef()); - } - if (graphDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getGraphDef()); - } - if (saverDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getSaverDef()); - } - for (java.util.Map.Entry entry - : internalGetCollectionDef().getMap().entrySet()) { - com.google.protobuf.MapEntry - collectionDef__ = CollectionDefDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, collectionDef__); - } - for (java.util.Map.Entry entry - : internalGetSignatureDef().getMap().entrySet()) { - com.google.protobuf.MapEntry - signatureDef__ = SignatureDefDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, signatureDef__); - } - for (int i = 0; i < assetFileDef_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, assetFileDef_.get(i)); - } - if (objectGraphDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getObjectGraphDef()); - } - 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.MetaGraphDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.MetaGraphDef other = (org.tensorflow.proto.framework.MetaGraphDef) obj; - - if (hasMetaInfoDef() != other.hasMetaInfoDef()) return false; - if (hasMetaInfoDef()) { - if (!getMetaInfoDef() - .equals(other.getMetaInfoDef())) return false; - } - if (hasGraphDef() != other.hasGraphDef()) return false; - if (hasGraphDef()) { - if (!getGraphDef() - .equals(other.getGraphDef())) return false; - } - if (hasSaverDef() != other.hasSaverDef()) return false; - if (hasSaverDef()) { - if (!getSaverDef() - .equals(other.getSaverDef())) return false; - } - if (!internalGetCollectionDef().equals( - other.internalGetCollectionDef())) return false; - if (!internalGetSignatureDef().equals( - other.internalGetSignatureDef())) return false; - if (!getAssetFileDefList() - .equals(other.getAssetFileDefList())) return false; - if (hasObjectGraphDef() != other.hasObjectGraphDef()) return false; - if (hasObjectGraphDef()) { - if (!getObjectGraphDef() - .equals(other.getObjectGraphDef())) 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 (hasMetaInfoDef()) { - hash = (37 * hash) + META_INFO_DEF_FIELD_NUMBER; - hash = (53 * hash) + getMetaInfoDef().hashCode(); - } - if (hasGraphDef()) { - hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getGraphDef().hashCode(); - } - if (hasSaverDef()) { - hash = (37 * hash) + SAVER_DEF_FIELD_NUMBER; - hash = (53 * hash) + getSaverDef().hashCode(); - } - if (!internalGetCollectionDef().getMap().isEmpty()) { - hash = (37 * hash) + COLLECTION_DEF_FIELD_NUMBER; - hash = (53 * hash) + internalGetCollectionDef().hashCode(); - } - if (!internalGetSignatureDef().getMap().isEmpty()) { - hash = (37 * hash) + SIGNATURE_DEF_FIELD_NUMBER; - hash = (53 * hash) + internalGetSignatureDef().hashCode(); - } - if (getAssetFileDefCount() > 0) { - hash = (37 * hash) + ASSET_FILE_DEF_FIELD_NUMBER; - hash = (53 * hash) + getAssetFileDefList().hashCode(); - } - if (hasObjectGraphDef()) { - hash = (37 * hash) + OBJECT_GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getObjectGraphDef().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.MetaGraphDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef 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.MetaGraphDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef 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.MetaGraphDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.MetaGraphDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.MetaGraphDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef 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.MetaGraphDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef 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.MetaGraphDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.MetaGraphDef 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.MetaGraphDef 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; - } - /** - *
    -   * NOTE: This protocol buffer is evolving, and will go through revisions in the
    -   * coming months.
    -   * Protocol buffer containing the following which are necessary to restart
    -   * training, run inference. It can be used to serialize/de-serialize memory
    -   * objects necessary for running computation in a graph when crossing the
    -   * process boundary. It can be used for long term storage of graphs,
    -   * cross-language execution of graphs, etc.
    -   *   MetaInfoDef
    -   *   GraphDef
    -   *   SaverDef
    -   *   CollectionDef
    -   *   TensorInfo
    -   *   SignatureDef
    -   * 
    - * - * Protobuf type {@code tensorflow.MetaGraphDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MetaGraphDef) - org.tensorflow.proto.framework.MetaGraphDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetCollectionDef(); - case 5: - return internalGetSignatureDef(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 4: - return internalGetMutableCollectionDef(); - case 5: - return internalGetMutableSignatureDef(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.MetaGraphDef.class, org.tensorflow.proto.framework.MetaGraphDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.MetaGraphDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAssetFileDefFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (metaInfoDefBuilder_ == null) { - metaInfoDef_ = null; - } else { - metaInfoDef_ = null; - metaInfoDefBuilder_ = null; - } - if (graphDefBuilder_ == null) { - graphDef_ = null; - } else { - graphDef_ = null; - graphDefBuilder_ = null; - } - if (saverDefBuilder_ == null) { - saverDef_ = null; - } else { - saverDef_ = null; - saverDefBuilder_ = null; - } - internalGetMutableCollectionDef().clear(); - internalGetMutableSignatureDef().clear(); - if (assetFileDefBuilder_ == null) { - assetFileDef_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - assetFileDefBuilder_.clear(); - } - if (objectGraphDefBuilder_ == null) { - objectGraphDef_ = null; - } else { - objectGraphDef_ = null; - objectGraphDefBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.MetaGraphDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef build() { - org.tensorflow.proto.framework.MetaGraphDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.MetaGraphDef buildPartial() { - org.tensorflow.proto.framework.MetaGraphDef result = new org.tensorflow.proto.framework.MetaGraphDef(this); - int from_bitField0_ = bitField0_; - if (metaInfoDefBuilder_ == null) { - result.metaInfoDef_ = metaInfoDef_; - } else { - result.metaInfoDef_ = metaInfoDefBuilder_.build(); - } - if (graphDefBuilder_ == null) { - result.graphDef_ = graphDef_; - } else { - result.graphDef_ = graphDefBuilder_.build(); - } - if (saverDefBuilder_ == null) { - result.saverDef_ = saverDef_; - } else { - result.saverDef_ = saverDefBuilder_.build(); - } - result.collectionDef_ = internalGetCollectionDef(); - result.collectionDef_.makeImmutable(); - result.signatureDef_ = internalGetSignatureDef(); - result.signatureDef_.makeImmutable(); - if (assetFileDefBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - assetFileDef_ = java.util.Collections.unmodifiableList(assetFileDef_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.assetFileDef_ = assetFileDef_; - } else { - result.assetFileDef_ = assetFileDefBuilder_.build(); - } - if (objectGraphDefBuilder_ == null) { - result.objectGraphDef_ = objectGraphDef_; - } else { - result.objectGraphDef_ = objectGraphDefBuilder_.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.MetaGraphDef) { - return mergeFrom((org.tensorflow.proto.framework.MetaGraphDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.MetaGraphDef other) { - if (other == org.tensorflow.proto.framework.MetaGraphDef.getDefaultInstance()) return this; - if (other.hasMetaInfoDef()) { - mergeMetaInfoDef(other.getMetaInfoDef()); - } - if (other.hasGraphDef()) { - mergeGraphDef(other.getGraphDef()); - } - if (other.hasSaverDef()) { - mergeSaverDef(other.getSaverDef()); - } - internalGetMutableCollectionDef().mergeFrom( - other.internalGetCollectionDef()); - internalGetMutableSignatureDef().mergeFrom( - other.internalGetSignatureDef()); - if (assetFileDefBuilder_ == null) { - if (!other.assetFileDef_.isEmpty()) { - if (assetFileDef_.isEmpty()) { - assetFileDef_ = other.assetFileDef_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureAssetFileDefIsMutable(); - assetFileDef_.addAll(other.assetFileDef_); - } - onChanged(); - } - } else { - if (!other.assetFileDef_.isEmpty()) { - if (assetFileDefBuilder_.isEmpty()) { - assetFileDefBuilder_.dispose(); - assetFileDefBuilder_ = null; - assetFileDef_ = other.assetFileDef_; - bitField0_ = (bitField0_ & ~0x00000004); - assetFileDefBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAssetFileDefFieldBuilder() : null; - } else { - assetFileDefBuilder_.addAllMessages(other.assetFileDef_); - } - } - } - if (other.hasObjectGraphDef()) { - mergeObjectGraphDef(other.getObjectGraphDef()); - } - 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.MetaGraphDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.MetaGraphDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef metaInfoDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder> metaInfoDefBuilder_; - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public boolean hasMetaInfoDef() { - return metaInfoDefBuilder_ != null || metaInfoDef_ != null; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef getMetaInfoDef() { - if (metaInfoDefBuilder_ == null) { - return metaInfoDef_ == null ? org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; - } else { - return metaInfoDefBuilder_.getMessage(); - } - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public Builder setMetaInfoDef(org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef value) { - if (metaInfoDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metaInfoDef_ = value; - onChanged(); - } else { - metaInfoDefBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public Builder setMetaInfoDef( - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder builderForValue) { - if (metaInfoDefBuilder_ == null) { - metaInfoDef_ = builderForValue.build(); - onChanged(); - } else { - metaInfoDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public Builder mergeMetaInfoDef(org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef value) { - if (metaInfoDefBuilder_ == null) { - if (metaInfoDef_ != null) { - metaInfoDef_ = - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.newBuilder(metaInfoDef_).mergeFrom(value).buildPartial(); - } else { - metaInfoDef_ = value; - } - onChanged(); - } else { - metaInfoDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public Builder clearMetaInfoDef() { - if (metaInfoDefBuilder_ == null) { - metaInfoDef_ = null; - onChanged(); - } else { - metaInfoDef_ = null; - metaInfoDefBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder getMetaInfoDefBuilder() { - - onChanged(); - return getMetaInfoDefFieldBuilder().getBuilder(); - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - public org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder() { - if (metaInfoDefBuilder_ != null) { - return metaInfoDefBuilder_.getMessageOrBuilder(); - } else { - return metaInfoDef_ == null ? - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; - } - } - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder> - getMetaInfoDefFieldBuilder() { - if (metaInfoDefBuilder_ == null) { - metaInfoDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder>( - getMetaInfoDef(), - getParentForChildren(), - isClean()); - metaInfoDef_ = null; - } - return metaInfoDefBuilder_; - } - - private org.tensorflow.proto.framework.GraphDef graphDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> graphDefBuilder_; - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public boolean hasGraphDef() { - return graphDefBuilder_ != null || graphDef_ != null; - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public org.tensorflow.proto.framework.GraphDef getGraphDef() { - if (graphDefBuilder_ == null) { - return graphDef_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : graphDef_; - } else { - return graphDefBuilder_.getMessage(); - } - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public Builder setGraphDef(org.tensorflow.proto.framework.GraphDef value) { - if (graphDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - graphDef_ = value; - onChanged(); - } else { - graphDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public Builder setGraphDef( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (graphDefBuilder_ == null) { - graphDef_ = builderForValue.build(); - onChanged(); - } else { - graphDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public Builder mergeGraphDef(org.tensorflow.proto.framework.GraphDef value) { - if (graphDefBuilder_ == null) { - if (graphDef_ != null) { - graphDef_ = - org.tensorflow.proto.framework.GraphDef.newBuilder(graphDef_).mergeFrom(value).buildPartial(); - } else { - graphDef_ = value; - } - onChanged(); - } else { - graphDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public Builder clearGraphDef() { - if (graphDefBuilder_ == null) { - graphDef_ = null; - onChanged(); - } else { - graphDef_ = null; - graphDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getGraphDefBuilder() { - - onChanged(); - return getGraphDefFieldBuilder().getBuilder(); - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getGraphDefOrBuilder() { - if (graphDefBuilder_ != null) { - return graphDefBuilder_.getMessageOrBuilder(); - } else { - return graphDef_ == null ? - org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : graphDef_; - } - } - /** - *
    -     * GraphDef.
    -     * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getGraphDefFieldBuilder() { - if (graphDefBuilder_ == null) { - graphDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - getGraphDef(), - getParentForChildren(), - isClean()); - graphDef_ = null; - } - return graphDefBuilder_; - } - - private org.tensorflow.proto.util.SaverDef saverDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SaverDef, org.tensorflow.proto.util.SaverDef.Builder, org.tensorflow.proto.util.SaverDefOrBuilder> saverDefBuilder_; - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public boolean hasSaverDef() { - return saverDefBuilder_ != null || saverDef_ != null; - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public org.tensorflow.proto.util.SaverDef getSaverDef() { - if (saverDefBuilder_ == null) { - return saverDef_ == null ? org.tensorflow.proto.util.SaverDef.getDefaultInstance() : saverDef_; - } else { - return saverDefBuilder_.getMessage(); - } - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public Builder setSaverDef(org.tensorflow.proto.util.SaverDef value) { - if (saverDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - saverDef_ = value; - onChanged(); - } else { - saverDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public Builder setSaverDef( - org.tensorflow.proto.util.SaverDef.Builder builderForValue) { - if (saverDefBuilder_ == null) { - saverDef_ = builderForValue.build(); - onChanged(); - } else { - saverDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public Builder mergeSaverDef(org.tensorflow.proto.util.SaverDef value) { - if (saverDefBuilder_ == null) { - if (saverDef_ != null) { - saverDef_ = - org.tensorflow.proto.util.SaverDef.newBuilder(saverDef_).mergeFrom(value).buildPartial(); - } else { - saverDef_ = value; - } - onChanged(); - } else { - saverDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public Builder clearSaverDef() { - if (saverDefBuilder_ == null) { - saverDef_ = null; - onChanged(); - } else { - saverDef_ = null; - saverDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public org.tensorflow.proto.util.SaverDef.Builder getSaverDefBuilder() { - - onChanged(); - return getSaverDefFieldBuilder().getBuilder(); - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - public org.tensorflow.proto.util.SaverDefOrBuilder getSaverDefOrBuilder() { - if (saverDefBuilder_ != null) { - return saverDefBuilder_.getMessageOrBuilder(); - } else { - return saverDef_ == null ? - org.tensorflow.proto.util.SaverDef.getDefaultInstance() : saverDef_; - } - } - /** - *
    -     * SaverDef.
    -     * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SaverDef, org.tensorflow.proto.util.SaverDef.Builder, org.tensorflow.proto.util.SaverDefOrBuilder> - getSaverDefFieldBuilder() { - if (saverDefBuilder_ == null) { - saverDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SaverDef, org.tensorflow.proto.util.SaverDef.Builder, org.tensorflow.proto.util.SaverDefOrBuilder>( - getSaverDef(), - getParentForChildren(), - isClean()); - saverDef_ = null; - } - return saverDefBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.CollectionDef> collectionDef_; - private com.google.protobuf.MapField - internalGetCollectionDef() { - if (collectionDef_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CollectionDefDefaultEntryHolder.defaultEntry); - } - return collectionDef_; - } - private com.google.protobuf.MapField - internalGetMutableCollectionDef() { - onChanged();; - if (collectionDef_ == null) { - collectionDef_ = com.google.protobuf.MapField.newMapField( - CollectionDefDefaultEntryHolder.defaultEntry); - } - if (!collectionDef_.isMutable()) { - collectionDef_ = collectionDef_.copy(); - } - return collectionDef_; - } - - public int getCollectionDefCount() { - return internalGetCollectionDef().getMap().size(); - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public boolean containsCollectionDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCollectionDef().getMap().containsKey(key); - } - /** - * Use {@link #getCollectionDefMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getCollectionDef() { - return getCollectionDefMap(); - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public java.util.Map getCollectionDefMap() { - return internalGetCollectionDef().getMap(); - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public org.tensorflow.proto.framework.CollectionDef getCollectionDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.CollectionDef defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCollectionDef().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public org.tensorflow.proto.framework.CollectionDef getCollectionDefOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCollectionDef().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearCollectionDef() { - internalGetMutableCollectionDef().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public Builder removeCollectionDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCollectionDef().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableCollectionDef() { - return internalGetMutableCollectionDef().getMutableMap(); - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - public Builder putCollectionDef( - java.lang.String key, - org.tensorflow.proto.framework.CollectionDef value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCollectionDef().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * collection_def: Map from collection name to collections.
    -     * See CollectionDef section for details.
    -     * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - public Builder putAllCollectionDef( - java.util.Map values) { - internalGetMutableCollectionDef().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SignatureDef> signatureDef_; - private com.google.protobuf.MapField - internalGetSignatureDef() { - if (signatureDef_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SignatureDefDefaultEntryHolder.defaultEntry); - } - return signatureDef_; - } - private com.google.protobuf.MapField - internalGetMutableSignatureDef() { - onChanged();; - if (signatureDef_ == null) { - signatureDef_ = com.google.protobuf.MapField.newMapField( - SignatureDefDefaultEntryHolder.defaultEntry); - } - if (!signatureDef_.isMutable()) { - signatureDef_ = signatureDef_.copy(); - } - return signatureDef_; - } - - public int getSignatureDefCount() { - return internalGetSignatureDef().getMap().size(); - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public boolean containsSignatureDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetSignatureDef().getMap().containsKey(key); - } - /** - * Use {@link #getSignatureDefMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getSignatureDef() { - return getSignatureDefMap(); - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public java.util.Map getSignatureDefMap() { - return internalGetSignatureDef().getMap(); - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public org.tensorflow.proto.framework.SignatureDef getSignatureDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SignatureDef defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSignatureDef().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public org.tensorflow.proto.framework.SignatureDef getSignatureDefOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSignatureDef().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearSignatureDef() { - internalGetMutableSignatureDef().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public Builder removeSignatureDef( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableSignatureDef().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableSignatureDef() { - return internalGetMutableSignatureDef().getMutableMap(); - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - public Builder putSignatureDef( - java.lang.String key, - org.tensorflow.proto.framework.SignatureDef value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableSignatureDef().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * signature_def: Map from user supplied key for a signature to a single
    -     * SignatureDef.
    -     * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - public Builder putAllSignatureDef( - java.util.Map values) { - internalGetMutableSignatureDef().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List assetFileDef_ = - java.util.Collections.emptyList(); - private void ensureAssetFileDefIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - assetFileDef_ = new java.util.ArrayList(assetFileDef_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AssetFileDef, org.tensorflow.proto.framework.AssetFileDef.Builder, org.tensorflow.proto.framework.AssetFileDefOrBuilder> assetFileDefBuilder_; - - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public java.util.List getAssetFileDefList() { - if (assetFileDefBuilder_ == null) { - return java.util.Collections.unmodifiableList(assetFileDef_); - } else { - return assetFileDefBuilder_.getMessageList(); - } - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public int getAssetFileDefCount() { - if (assetFileDefBuilder_ == null) { - return assetFileDef_.size(); - } else { - return assetFileDefBuilder_.getCount(); - } - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDef getAssetFileDef(int index) { - if (assetFileDefBuilder_ == null) { - return assetFileDef_.get(index); - } else { - return assetFileDefBuilder_.getMessage(index); - } - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder setAssetFileDef( - int index, org.tensorflow.proto.framework.AssetFileDef value) { - if (assetFileDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAssetFileDefIsMutable(); - assetFileDef_.set(index, value); - onChanged(); - } else { - assetFileDefBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder setAssetFileDef( - int index, org.tensorflow.proto.framework.AssetFileDef.Builder builderForValue) { - if (assetFileDefBuilder_ == null) { - ensureAssetFileDefIsMutable(); - assetFileDef_.set(index, builderForValue.build()); - onChanged(); - } else { - assetFileDefBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder addAssetFileDef(org.tensorflow.proto.framework.AssetFileDef value) { - if (assetFileDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAssetFileDefIsMutable(); - assetFileDef_.add(value); - onChanged(); - } else { - assetFileDefBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder addAssetFileDef( - int index, org.tensorflow.proto.framework.AssetFileDef value) { - if (assetFileDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAssetFileDefIsMutable(); - assetFileDef_.add(index, value); - onChanged(); - } else { - assetFileDefBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder addAssetFileDef( - org.tensorflow.proto.framework.AssetFileDef.Builder builderForValue) { - if (assetFileDefBuilder_ == null) { - ensureAssetFileDefIsMutable(); - assetFileDef_.add(builderForValue.build()); - onChanged(); - } else { - assetFileDefBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder addAssetFileDef( - int index, org.tensorflow.proto.framework.AssetFileDef.Builder builderForValue) { - if (assetFileDefBuilder_ == null) { - ensureAssetFileDefIsMutable(); - assetFileDef_.add(index, builderForValue.build()); - onChanged(); - } else { - assetFileDefBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder addAllAssetFileDef( - java.lang.Iterable values) { - if (assetFileDefBuilder_ == null) { - ensureAssetFileDefIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, assetFileDef_); - onChanged(); - } else { - assetFileDefBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder clearAssetFileDef() { - if (assetFileDefBuilder_ == null) { - assetFileDef_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - assetFileDefBuilder_.clear(); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public Builder removeAssetFileDef(int index) { - if (assetFileDefBuilder_ == null) { - ensureAssetFileDefIsMutable(); - assetFileDef_.remove(index); - onChanged(); - } else { - assetFileDefBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDef.Builder getAssetFileDefBuilder( - int index) { - return getAssetFileDefFieldBuilder().getBuilder(index); - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDefOrBuilder getAssetFileDefOrBuilder( - int index) { - if (assetFileDefBuilder_ == null) { - return assetFileDef_.get(index); } else { - return assetFileDefBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public java.util.List - getAssetFileDefOrBuilderList() { - if (assetFileDefBuilder_ != null) { - return assetFileDefBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(assetFileDef_); - } - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDef.Builder addAssetFileDefBuilder() { - return getAssetFileDefFieldBuilder().addBuilder( - org.tensorflow.proto.framework.AssetFileDef.getDefaultInstance()); - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public org.tensorflow.proto.framework.AssetFileDef.Builder addAssetFileDefBuilder( - int index) { - return getAssetFileDefFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.AssetFileDef.getDefaultInstance()); - } - /** - *
    -     * Asset file def to be used with the defined graph.
    -     * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - public java.util.List - getAssetFileDefBuilderList() { - return getAssetFileDefFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AssetFileDef, org.tensorflow.proto.framework.AssetFileDef.Builder, org.tensorflow.proto.framework.AssetFileDefOrBuilder> - getAssetFileDefFieldBuilder() { - if (assetFileDefBuilder_ == null) { - assetFileDefBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AssetFileDef, org.tensorflow.proto.framework.AssetFileDef.Builder, org.tensorflow.proto.framework.AssetFileDefOrBuilder>( - assetFileDef_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - assetFileDef_ = null; - } - return assetFileDefBuilder_; - } - - private org.tensorflow.proto.framework.SavedObjectGraph objectGraphDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedObjectGraph, org.tensorflow.proto.framework.SavedObjectGraph.Builder, org.tensorflow.proto.framework.SavedObjectGraphOrBuilder> objectGraphDefBuilder_; - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public boolean hasObjectGraphDef() { - return objectGraphDefBuilder_ != null || objectGraphDef_ != null; - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public org.tensorflow.proto.framework.SavedObjectGraph getObjectGraphDef() { - if (objectGraphDefBuilder_ == null) { - return objectGraphDef_ == null ? org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; - } else { - return objectGraphDefBuilder_.getMessage(); - } - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public Builder setObjectGraphDef(org.tensorflow.proto.framework.SavedObjectGraph value) { - if (objectGraphDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - objectGraphDef_ = value; - onChanged(); - } else { - objectGraphDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public Builder setObjectGraphDef( - org.tensorflow.proto.framework.SavedObjectGraph.Builder builderForValue) { - if (objectGraphDefBuilder_ == null) { - objectGraphDef_ = builderForValue.build(); - onChanged(); - } else { - objectGraphDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public Builder mergeObjectGraphDef(org.tensorflow.proto.framework.SavedObjectGraph value) { - if (objectGraphDefBuilder_ == null) { - if (objectGraphDef_ != null) { - objectGraphDef_ = - org.tensorflow.proto.framework.SavedObjectGraph.newBuilder(objectGraphDef_).mergeFrom(value).buildPartial(); - } else { - objectGraphDef_ = value; - } - onChanged(); - } else { - objectGraphDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public Builder clearObjectGraphDef() { - if (objectGraphDefBuilder_ == null) { - objectGraphDef_ = null; - onChanged(); - } else { - objectGraphDef_ = null; - objectGraphDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public org.tensorflow.proto.framework.SavedObjectGraph.Builder getObjectGraphDefBuilder() { - - onChanged(); - return getObjectGraphDefFieldBuilder().getBuilder(); - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - public org.tensorflow.proto.framework.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder() { - if (objectGraphDefBuilder_ != null) { - return objectGraphDefBuilder_.getMessageOrBuilder(); - } else { - return objectGraphDef_ == null ? - org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; - } - } - /** - *
    -     * Extra information about the structure of functions and stateful objects.
    -     * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedObjectGraph, org.tensorflow.proto.framework.SavedObjectGraph.Builder, org.tensorflow.proto.framework.SavedObjectGraphOrBuilder> - getObjectGraphDefFieldBuilder() { - if (objectGraphDefBuilder_ == null) { - objectGraphDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedObjectGraph, org.tensorflow.proto.framework.SavedObjectGraph.Builder, org.tensorflow.proto.framework.SavedObjectGraphOrBuilder>( - getObjectGraphDef(), - getParentForChildren(), - isClean()); - objectGraphDef_ = null; - } - return objectGraphDefBuilder_; - } - @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.MetaGraphDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MetaGraphDef) - private static final org.tensorflow.proto.framework.MetaGraphDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.MetaGraphDef(); - } - - public static org.tensorflow.proto.framework.MetaGraphDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MetaGraphDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MetaGraphDef(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.MetaGraphDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDefOrBuilder.java deleted file mode 100644 index ca9cf06f97b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphDefOrBuilder.java +++ /dev/null @@ -1,259 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -public interface MetaGraphDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MetaGraphDef) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - boolean hasMetaInfoDef(); - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef getMetaInfoDef(); - /** - * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; - */ - org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder(); - - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - boolean hasGraphDef(); - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - org.tensorflow.proto.framework.GraphDef getGraphDef(); - /** - *
    -   * GraphDef.
    -   * 
    - * - * .tensorflow.GraphDef graph_def = 2; - */ - org.tensorflow.proto.framework.GraphDefOrBuilder getGraphDefOrBuilder(); - - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - boolean hasSaverDef(); - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - org.tensorflow.proto.util.SaverDef getSaverDef(); - /** - *
    -   * SaverDef.
    -   * 
    - * - * .tensorflow.SaverDef saver_def = 3; - */ - org.tensorflow.proto.util.SaverDefOrBuilder getSaverDefOrBuilder(); - - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - int getCollectionDefCount(); - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - boolean containsCollectionDef( - java.lang.String key); - /** - * Use {@link #getCollectionDefMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getCollectionDef(); - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - java.util.Map - getCollectionDefMap(); - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - org.tensorflow.proto.framework.CollectionDef getCollectionDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.CollectionDef defaultValue); - /** - *
    -   * collection_def: Map from collection name to collections.
    -   * See CollectionDef section for details.
    -   * 
    - * - * map<string, .tensorflow.CollectionDef> collection_def = 4; - */ - - org.tensorflow.proto.framework.CollectionDef getCollectionDefOrThrow( - java.lang.String key); - - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - int getSignatureDefCount(); - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - boolean containsSignatureDef( - java.lang.String key); - /** - * Use {@link #getSignatureDefMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getSignatureDef(); - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - java.util.Map - getSignatureDefMap(); - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - org.tensorflow.proto.framework.SignatureDef getSignatureDefOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SignatureDef defaultValue); - /** - *
    -   * signature_def: Map from user supplied key for a signature to a single
    -   * SignatureDef.
    -   * 
    - * - * map<string, .tensorflow.SignatureDef> signature_def = 5; - */ - - org.tensorflow.proto.framework.SignatureDef getSignatureDefOrThrow( - java.lang.String key); - - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - java.util.List - getAssetFileDefList(); - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - org.tensorflow.proto.framework.AssetFileDef getAssetFileDef(int index); - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - int getAssetFileDefCount(); - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - java.util.List - getAssetFileDefOrBuilderList(); - /** - *
    -   * Asset file def to be used with the defined graph.
    -   * 
    - * - * repeated .tensorflow.AssetFileDef asset_file_def = 6; - */ - org.tensorflow.proto.framework.AssetFileDefOrBuilder getAssetFileDefOrBuilder( - int index); - - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - boolean hasObjectGraphDef(); - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - org.tensorflow.proto.framework.SavedObjectGraph getObjectGraphDef(); - /** - *
    -   * Extra information about the structure of functions and stateful objects.
    -   * 
    - * - * .tensorflow.SavedObjectGraph object_graph_def = 7; - */ - org.tensorflow.proto.framework.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder(); -} 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 deleted file mode 100644 index ceaa684bfbb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MetaGraphProtos.java +++ /dev/null @@ -1,318 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -public final class MetaGraphProtos { - private MetaGraphProtos() {} - 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_MetaGraphDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetaGraphDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_NodeList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_BytesList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_Int64List_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_FloatList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CollectionDef_AnyList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorInfo_CooSparse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SignatureDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SignatureDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SignatureDef_InputsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SignatureDef_InputsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SignatureDef_OutputsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_AssetFileDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AssetFileDef_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/meta_graph.pr" + - "oto\022\ntensorflow\032\031google/protobuf/any.pro" + - "to\032%tensorflow/core/framework/graph.prot" + - "o\032&tensorflow/core/framework/op_def.prot" + - "o\032,tensorflow/core/framework/tensor_shap" + - "e.proto\032%tensorflow/core/framework/types" + - ".proto\0321tensorflow/core/protobuf/saved_o" + - "bject_graph.proto\032$tensorflow/core/proto" + - "buf/saver.proto\032%tensorflow/core/protobu" + - "f/struct.proto\"\250\007\n\014MetaGraphDef\022;\n\rmeta_" + - "info_def\030\001 \001(\0132$.tensorflow.MetaGraphDef" + - ".MetaInfoDef\022\'\n\tgraph_def\030\002 \001(\0132\024.tensor" + - "flow.GraphDef\022\'\n\tsaver_def\030\003 \001(\0132\024.tenso" + - "rflow.SaverDef\022C\n\016collection_def\030\004 \003(\0132+" + - ".tensorflow.MetaGraphDef.CollectionDefEn" + - "try\022A\n\rsignature_def\030\005 \003(\0132*.tensorflow." + - "MetaGraphDef.SignatureDefEntry\0220\n\016asset_" + - "file_def\030\006 \003(\0132\030.tensorflow.AssetFileDef" + - "\0226\n\020object_graph_def\030\007 \001(\0132\034.tensorflow." + - "SavedObjectGraph\032\366\002\n\013MetaInfoDef\022\032\n\022meta" + - "_graph_version\030\001 \001(\t\022,\n\020stripped_op_list" + - "\030\002 \001(\0132\022.tensorflow.OpList\022&\n\010any_info\030\003" + - " \001(\0132\024.google.protobuf.Any\022\014\n\004tags\030\004 \003(\t" + - "\022\032\n\022tensorflow_version\030\005 \001(\t\022\036\n\026tensorfl" + - "ow_git_version\030\006 \001(\t\022\036\n\026stripped_default" + - "_attrs\030\007 \001(\010\022S\n\020function_aliases\030\010 \003(\01329" + - ".tensorflow.MetaGraphDef.MetaInfoDef.Fun" + - "ctionAliasesEntry\0326\n\024FunctionAliasesEntr" + - "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032O\n\022Col" + - "lectionDefEntry\022\013\n\003key\030\001 \001(\t\022(\n\005value\030\002 " + - "\001(\0132\031.tensorflow.CollectionDef:\0028\001\032M\n\021Si" + - "gnatureDefEntry\022\013\n\003key\030\001 \001(\t\022\'\n\005value\030\002 " + - "\001(\0132\030.tensorflow.SignatureDef:\0028\001\"\337\003\n\rCo" + - "llectionDef\0227\n\tnode_list\030\001 \001(\0132\".tensorf" + - "low.CollectionDef.NodeListH\000\0229\n\nbytes_li" + - "st\030\002 \001(\0132#.tensorflow.CollectionDef.Byte" + - "sListH\000\0229\n\nint64_list\030\003 \001(\0132#.tensorflow" + - ".CollectionDef.Int64ListH\000\0229\n\nfloat_list" + - "\030\004 \001(\0132#.tensorflow.CollectionDef.FloatL" + - "istH\000\0225\n\010any_list\030\005 \001(\0132!.tensorflow.Col" + - "lectionDef.AnyListH\000\032\031\n\010NodeList\022\r\n\005valu" + - "e\030\001 \003(\t\032\032\n\tBytesList\022\r\n\005value\030\001 \003(\014\032\036\n\tI" + - "nt64List\022\021\n\005value\030\001 \003(\003B\002\020\001\032\036\n\tFloatList" + - "\022\021\n\005value\030\001 \003(\002B\002\020\001\032.\n\007AnyList\022#\n\005value\030" + - "\001 \003(\0132\024.google.protobuf.AnyB\006\n\004kind\"\321\003\n\n" + - "TensorInfo\022\016\n\004name\030\001 \001(\tH\000\0226\n\ncoo_sparse" + - "\030\004 \001(\0132 .tensorflow.TensorInfo.CooSparse" + - "H\000\022B\n\020composite_tensor\030\005 \001(\0132&.tensorflo" + - "w.TensorInfo.CompositeTensorH\000\022#\n\005dtype\030" + - "\002 \001(\0162\024.tensorflow.DataType\0222\n\014tensor_sh" + - "ape\030\003 \001(\0132\034.tensorflow.TensorShapeProto\032" + - "e\n\tCooSparse\022\032\n\022values_tensor_name\030\001 \001(\t" + - "\022\033\n\023indices_tensor_name\030\002 \001(\t\022\037\n\027dense_s" + - "hape_tensor_name\030\003 \001(\t\032k\n\017CompositeTenso" + - "r\022,\n\ttype_spec\030\001 \001(\0132\031.tensorflow.TypeSp" + - "ecProto\022*\n\ncomponents\030\002 \003(\0132\026.tensorflow" + - ".TensorInfoB\n\n\010encoding\"\240\002\n\014SignatureDef" + - "\0224\n\006inputs\030\001 \003(\0132$.tensorflow.SignatureD" + - "ef.InputsEntry\0226\n\007outputs\030\002 \003(\0132%.tensor" + - "flow.SignatureDef.OutputsEntry\022\023\n\013method" + - "_name\030\003 \001(\t\032E\n\013InputsEntry\022\013\n\003key\030\001 \001(\t\022" + - "%\n\005value\030\002 \001(\0132\026.tensorflow.TensorInfo:\002" + - "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\215\001\n\036or" + - "g.tensorflow.proto.frameworkB\017MetaGraphP" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.AnyProto.getDescriptor(), - org.tensorflow.proto.framework.GraphProtos.getDescriptor(), - org.tensorflow.proto.framework.OpDefProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - org.tensorflow.proto.framework.SavedObjectGraphProtos.getDescriptor(), - org.tensorflow.proto.util.SaverProtos.getDescriptor(), - org.tensorflow.proto.framework.StructProtos.getDescriptor(), - }); - internal_static_tensorflow_MetaGraphDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_MetaGraphDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetaGraphDef_descriptor, - new java.lang.String[] { "MetaInfoDef", "GraphDef", "SaverDef", "CollectionDef", "SignatureDef", "AssetFileDef", "ObjectGraphDef", }); - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor = - internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor, - new java.lang.String[] { "MetaGraphVersion", "StrippedOpList", "AnyInfo", "Tags", "TensorflowVersion", "TensorflowGitVersion", "StrippedDefaultAttrs", "FunctionAliases", }); - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor = - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor = - internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor = - internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_CollectionDef_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_CollectionDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_descriptor, - new java.lang.String[] { "NodeList", "BytesList", "Int64List", "FloatList", "AnyList", "Kind", }); - internal_static_tensorflow_CollectionDef_NodeList_descriptor = - internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_NodeList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_CollectionDef_BytesList_descriptor = - internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_BytesList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_CollectionDef_Int64List_descriptor = - internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_Int64List_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_CollectionDef_FloatList_descriptor = - internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(3); - internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_FloatList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_CollectionDef_AnyList_descriptor = - internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(4); - internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CollectionDef_AnyList_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_TensorInfo_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_TensorInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorInfo_descriptor, - new java.lang.String[] { "Name", "CooSparse", "CompositeTensor", "Dtype", "TensorShape", "Encoding", }); - internal_static_tensorflow_TensorInfo_CooSparse_descriptor = - internal_static_tensorflow_TensorInfo_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorInfo_CooSparse_descriptor, - new java.lang.String[] { "ValuesTensorName", "IndicesTensorName", "DenseShapeTensorName", }); - internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor = - internal_static_tensorflow_TensorInfo_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor, - new java.lang.String[] { "TypeSpec", "Components", }); - internal_static_tensorflow_SignatureDef_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_SignatureDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SignatureDef_descriptor, - new java.lang.String[] { "Inputs", "Outputs", "MethodName", }); - internal_static_tensorflow_SignatureDef_InputsEntry_descriptor = - internal_static_tensorflow_SignatureDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_SignatureDef_InputsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SignatureDef_InputsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor = - internal_static_tensorflow_SignatureDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_SignatureDef_OutputsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_AssetFileDef_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_AssetFileDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AssetFileDef_descriptor, - new java.lang.String[] { "TensorInfo", "Filename", }); - com.google.protobuf.AnyProto.getDescriptor(); - org.tensorflow.proto.framework.GraphProtos.getDescriptor(); - org.tensorflow.proto.framework.OpDefProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - org.tensorflow.proto.framework.SavedObjectGraphProtos.getDescriptor(); - org.tensorflow.proto.util.SaverProtos.getDescriptor(); - org.tensorflow.proto.framework.StructProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrList.java deleted file mode 100644 index a17b31f8aa1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrList.java +++ /dev/null @@ -1,832 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A list of attr names and their values. The whole list is attached
    - * with a string name.  E.g., MatMul[T=float].
    - * 
    - * - * Protobuf type {@code tensorflow.NameAttrList} - */ -public final class NameAttrList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NameAttrList) - NameAttrListOrBuilder { -private static final long serialVersionUID = 0L; - // Use NameAttrList.newBuilder() to construct. - private NameAttrList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NameAttrList() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NameAttrList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NameAttrList( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.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.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NameAttrList.class, org.tensorflow.proto.framework.NameAttrList.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 ATTR_FIELD_NUMBER = 2; - private static final class AttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().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_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 2); - 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_); - } - for (java.util.Map.Entry entry - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, attr__); - } - 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.NameAttrList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NameAttrList other = (org.tensorflow.proto.framework.NameAttrList) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!internalGetAttr().equals( - other.internalGetAttr())) 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(); - if (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NameAttrList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NameAttrList 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.NameAttrList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NameAttrList 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.NameAttrList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NameAttrList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NameAttrList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NameAttrList 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.NameAttrList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NameAttrList 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.NameAttrList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NameAttrList 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.NameAttrList 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 list of attr names and their values. The whole list is attached
    -   * with a string name.  E.g., MatMul[T=float].
    -   * 
    - * - * Protobuf type {@code tensorflow.NameAttrList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NameAttrList) - org.tensorflow.proto.framework.NameAttrListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NameAttrList.class, org.tensorflow.proto.framework.NameAttrList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NameAttrList.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_ = ""; - - internalGetMutableAttr().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NameAttrList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NameAttrList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NameAttrList build() { - org.tensorflow.proto.framework.NameAttrList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NameAttrList buildPartial() { - org.tensorflow.proto.framework.NameAttrList result = new org.tensorflow.proto.framework.NameAttrList(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.attr_ = internalGetAttr(); - result.attr_.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.NameAttrList) { - return mergeFrom((org.tensorflow.proto.framework.NameAttrList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NameAttrList other) { - if (other == org.tensorflow.proto.framework.NameAttrList.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - 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.NameAttrList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NameAttrList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged();; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder removeAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - public Builder putAttr( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().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.NameAttrList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NameAttrList) - private static final org.tensorflow.proto.framework.NameAttrList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NameAttrList(); - } - - public static org.tensorflow.proto.framework.NameAttrList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NameAttrList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NameAttrList(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.NameAttrList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java deleted file mode 100644 index 293b4278408..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public interface NameAttrListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NameAttrList) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - int getAttrCount(); - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - boolean containsAttr( - java.lang.String key); - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttr(); - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - java.util.Map - getAttrMap(); - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue); - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDevice.java deleted file mode 100644 index 02a1dc9f6c7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDevice.java +++ /dev/null @@ -1,727 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_properties.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.NamedDevice} - */ -public final class NamedDevice extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NamedDevice) - NamedDeviceOrBuilder { -private static final long serialVersionUID = 0L; - // Use NamedDevice.newBuilder() to construct. - private NamedDevice(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NamedDevice() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NamedDevice(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NamedDevice( - 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 18: { - org.tensorflow.proto.framework.DeviceProperties.Builder subBuilder = null; - if (properties_ != null) { - subBuilder = properties_.toBuilder(); - } - properties_ = input.readMessage(org.tensorflow.proto.framework.DeviceProperties.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(properties_); - properties_ = subBuilder.buildPartial(); - } - - 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.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedDevice.class, org.tensorflow.proto.framework.NamedDevice.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 PROPERTIES_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.DeviceProperties properties_; - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public boolean hasProperties() { - return properties_ != null; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public org.tensorflow.proto.framework.DeviceProperties getProperties() { - return properties_ == null ? org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : properties_; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public org.tensorflow.proto.framework.DevicePropertiesOrBuilder getPropertiesOrBuilder() { - return getProperties(); - } - - 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 (properties_ != null) { - output.writeMessage(2, getProperties()); - } - 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 (properties_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getProperties()); - } - 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.NamedDevice)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NamedDevice other = (org.tensorflow.proto.framework.NamedDevice) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasProperties() != other.hasProperties()) return false; - if (hasProperties()) { - if (!getProperties() - .equals(other.getProperties())) 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(); - if (hasProperties()) { - hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + getProperties().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NamedDevice parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedDevice 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.NamedDevice parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedDevice 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.NamedDevice parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedDevice parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NamedDevice parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedDevice 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.NamedDevice parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedDevice 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.NamedDevice parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedDevice 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.NamedDevice 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.NamedDevice} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NamedDevice) - org.tensorflow.proto.framework.NamedDeviceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedDevice.class, org.tensorflow.proto.framework.NamedDevice.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NamedDevice.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_ = ""; - - if (propertiesBuilder_ == null) { - properties_ = null; - } else { - properties_ = null; - propertiesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedDevice getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NamedDevice.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedDevice build() { - org.tensorflow.proto.framework.NamedDevice result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedDevice buildPartial() { - org.tensorflow.proto.framework.NamedDevice result = new org.tensorflow.proto.framework.NamedDevice(this); - result.name_ = name_; - if (propertiesBuilder_ == null) { - result.properties_ = properties_; - } else { - result.properties_ = propertiesBuilder_.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.NamedDevice) { - return mergeFrom((org.tensorflow.proto.framework.NamedDevice)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NamedDevice other) { - if (other == org.tensorflow.proto.framework.NamedDevice.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasProperties()) { - mergeProperties(other.getProperties()); - } - 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.NamedDevice parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NamedDevice) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 org.tensorflow.proto.framework.DeviceProperties properties_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder> propertiesBuilder_; - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public boolean hasProperties() { - return propertiesBuilder_ != null || properties_ != null; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public org.tensorflow.proto.framework.DeviceProperties getProperties() { - if (propertiesBuilder_ == null) { - return properties_ == null ? org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : properties_; - } else { - return propertiesBuilder_.getMessage(); - } - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public Builder setProperties(org.tensorflow.proto.framework.DeviceProperties value) { - if (propertiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - properties_ = value; - onChanged(); - } else { - propertiesBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public Builder setProperties( - org.tensorflow.proto.framework.DeviceProperties.Builder builderForValue) { - if (propertiesBuilder_ == null) { - properties_ = builderForValue.build(); - onChanged(); - } else { - propertiesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public Builder mergeProperties(org.tensorflow.proto.framework.DeviceProperties value) { - if (propertiesBuilder_ == null) { - if (properties_ != null) { - properties_ = - org.tensorflow.proto.framework.DeviceProperties.newBuilder(properties_).mergeFrom(value).buildPartial(); - } else { - properties_ = value; - } - onChanged(); - } else { - propertiesBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public Builder clearProperties() { - if (propertiesBuilder_ == null) { - properties_ = null; - onChanged(); - } else { - properties_ = null; - propertiesBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public org.tensorflow.proto.framework.DeviceProperties.Builder getPropertiesBuilder() { - - onChanged(); - return getPropertiesFieldBuilder().getBuilder(); - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - public org.tensorflow.proto.framework.DevicePropertiesOrBuilder getPropertiesOrBuilder() { - if (propertiesBuilder_ != null) { - return propertiesBuilder_.getMessageOrBuilder(); - } else { - return properties_ == null ? - org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : properties_; - } - } - /** - * .tensorflow.DeviceProperties properties = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder> - getPropertiesFieldBuilder() { - if (propertiesBuilder_ == null) { - propertiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder>( - getProperties(), - getParentForChildren(), - isClean()); - properties_ = null; - } - return propertiesBuilder_; - } - @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.NamedDevice) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NamedDevice) - private static final org.tensorflow.proto.framework.NamedDevice DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NamedDevice(); - } - - public static org.tensorflow.proto.framework.NamedDevice getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NamedDevice parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NamedDevice(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.NamedDevice getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDeviceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDeviceOrBuilder.java deleted file mode 100644 index 52eed19dd38..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedDeviceOrBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/device_properties.proto - -package org.tensorflow.proto.framework; - -public interface NamedDeviceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NamedDevice) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * .tensorflow.DeviceProperties properties = 2; - */ - boolean hasProperties(); - /** - * .tensorflow.DeviceProperties properties = 2; - */ - org.tensorflow.proto.framework.DeviceProperties getProperties(); - /** - * .tensorflow.DeviceProperties properties = 2; - */ - org.tensorflow.proto.framework.DevicePropertiesOrBuilder getPropertiesOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProto.java deleted file mode 100644 index c5b5514e2e3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProto.java +++ /dev/null @@ -1,859 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/named_tensor.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A pair of tensor name and tensor values.
    - * 
    - * - * Protobuf type {@code tensorflow.NamedTensorProto} - */ -public final class NamedTensorProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NamedTensorProto) - NamedTensorProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use NamedTensorProto.newBuilder() to construct. - private NamedTensorProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NamedTensorProto() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NamedTensorProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NamedTensorProto( - 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 18: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (tensor_ != null) { - subBuilder = tensor_.toBuilder(); - } - tensor_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensor_); - tensor_ = subBuilder.buildPartial(); - } - - 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.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedTensorProto.class, org.tensorflow.proto.framework.NamedTensorProto.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * 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 TENSOR_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorProto tensor_; - /** - *
    -   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -   * directly using the protobuf field accessors.
    -   * The client specifies whether the returned tensor values should be
    -   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -   * compact form in tensor.tensor_content.
    -   * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public boolean hasTensor() { - return tensor_ != null; - } - /** - *
    -   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -   * directly using the protobuf field accessors.
    -   * The client specifies whether the returned tensor values should be
    -   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -   * compact form in tensor.tensor_content.
    -   * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public org.tensorflow.proto.framework.TensorProto getTensor() { - return tensor_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensor_; - } - /** - *
    -   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -   * directly using the protobuf field accessors.
    -   * The client specifies whether the returned tensor values should be
    -   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -   * compact form in tensor.tensor_content.
    -   * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder() { - return getTensor(); - } - - 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 (tensor_ != null) { - output.writeMessage(2, getTensor()); - } - 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 (tensor_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTensor()); - } - 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.NamedTensorProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NamedTensorProto other = (org.tensorflow.proto.framework.NamedTensorProto) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasTensor() != other.hasTensor()) return false; - if (hasTensor()) { - if (!getTensor() - .equals(other.getTensor())) 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(); - if (hasTensor()) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensor().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NamedTensorProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTensorProto 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.NamedTensorProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTensorProto 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.NamedTensorProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTensorProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NamedTensorProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTensorProto 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.NamedTensorProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTensorProto 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.NamedTensorProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTensorProto 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.NamedTensorProto 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 pair of tensor name and tensor values.
    -   * 
    - * - * Protobuf type {@code tensorflow.NamedTensorProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NamedTensorProto) - org.tensorflow.proto.framework.NamedTensorProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedTensorProto.class, org.tensorflow.proto.framework.NamedTensorProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NamedTensorProto.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_ = ""; - - if (tensorBuilder_ == null) { - tensor_ = null; - } else { - tensor_ = null; - tensorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTensorProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NamedTensorProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTensorProto build() { - org.tensorflow.proto.framework.NamedTensorProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTensorProto buildPartial() { - org.tensorflow.proto.framework.NamedTensorProto result = new org.tensorflow.proto.framework.NamedTensorProto(this); - result.name_ = name_; - if (tensorBuilder_ == null) { - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.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.NamedTensorProto) { - return mergeFrom((org.tensorflow.proto.framework.NamedTensorProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NamedTensorProto other) { - if (other == org.tensorflow.proto.framework.NamedTensorProto.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasTensor()) { - mergeTensor(other.getTensor()); - } - 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.NamedTensorProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NamedTensorProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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 org.tensorflow.proto.framework.TensorProto tensor_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorBuilder_; - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public boolean hasTensor() { - return tensorBuilder_ != null || tensor_ != null; - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public org.tensorflow.proto.framework.TensorProto getTensor() { - if (tensorBuilder_ == null) { - return tensor_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensor_; - } else { - return tensorBuilder_.getMessage(); - } - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public Builder setTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensor_ = value; - onChanged(); - } else { - tensorBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public Builder setTensor( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - tensor_ = builderForValue.build(); - onChanged(); - } else { - tensorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public Builder mergeTensor(org.tensorflow.proto.framework.TensorProto value) { - if (tensorBuilder_ == null) { - if (tensor_ != null) { - tensor_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(tensor_).mergeFrom(value).buildPartial(); - } else { - tensor_ = value; - } - onChanged(); - } else { - tensorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = null; - onChanged(); - } else { - tensor_ = null; - tensorBuilder_ = null; - } - - return this; - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorBuilder() { - - onChanged(); - return getTensorFieldBuilder().getBuilder(); - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilder(); - } else { - return tensor_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensor_; - } - } - /** - *
    -     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    -     * directly using the protobuf field accessors.
    -     * The client specifies whether the returned tensor values should be
    -     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    -     * compact form in tensor.tensor_content.
    -     * 
    - * - * .tensorflow.TensorProto tensor = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getTensor(), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - @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.NamedTensorProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NamedTensorProto) - private static final org.tensorflow.proto.framework.NamedTensorProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NamedTensorProto(); - } - - public static org.tensorflow.proto.framework.NamedTensorProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NamedTensorProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NamedTensorProto(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.NamedTensorProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 1edec7d7488..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtos.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/named_tensor.proto - -package org.tensorflow.proto.framework; - -public final class NamedTensorProtos { - private NamedTensorProtos() {} - 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_NamedTensorProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NamedTensorProto_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/named_tensor." + - "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\217\001\n\036org.tensorflow.proto.fr" + - "ameworkB\021NamedTensorProtosP\001ZUgithub.com" + - "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/protobuf/for_core_protos_go_proto\370\001\001b\006" + - "proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - }); - internal_static_tensorflow_NamedTensorProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_NamedTensorProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NamedTensorProto_descriptor, - new java.lang.String[] { "Name", "Tensor", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValue.java deleted file mode 100644 index e1adfe3a508..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValue.java +++ /dev/null @@ -1,900 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents Python's namedtuple.
    - * 
    - * - * Protobuf type {@code tensorflow.NamedTupleValue} - */ -public final class NamedTupleValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NamedTupleValue) - NamedTupleValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use NamedTupleValue.newBuilder() to construct. - private NamedTupleValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NamedTupleValue() { - name_ = ""; - values_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NamedTupleValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NamedTupleValue( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - values_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - values_.add( - input.readMessage(org.tensorflow.proto.framework.PairValue.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_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NamedTupleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NamedTupleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedTupleValue.class, org.tensorflow.proto.framework.NamedTupleValue.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 VALUES_FIELD_NUMBER = 2; - private java.util.List values_; - /** - * repeated .tensorflow.PairValue values = 2; - */ - public java.util.List getValuesList() { - return values_; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public java.util.List - getValuesOrBuilderList() { - return values_; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public int getValuesCount() { - return values_.size(); - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValue getValues(int index) { - return values_.get(index); - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValueOrBuilder getValuesOrBuilder( - int index) { - return values_.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 { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < values_.size(); i++) { - output.writeMessage(2, values_.get(i)); - } - 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_); - } - for (int i = 0; i < values_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, values_.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.NamedTupleValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NamedTupleValue other = (org.tensorflow.proto.framework.NamedTupleValue) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getValuesList() - .equals(other.getValuesList())) 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(); - if (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NamedTupleValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTupleValue 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.NamedTupleValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTupleValue 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.NamedTupleValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NamedTupleValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NamedTupleValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTupleValue 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.NamedTupleValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTupleValue 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.NamedTupleValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NamedTupleValue 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.NamedTupleValue 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; - } - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * Protobuf type {@code tensorflow.NamedTupleValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NamedTupleValue) - org.tensorflow.proto.framework.NamedTupleValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NamedTupleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NamedTupleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NamedTupleValue.class, org.tensorflow.proto.framework.NamedTupleValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NamedTupleValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getValuesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - valuesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NamedTupleValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTupleValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTupleValue build() { - org.tensorflow.proto.framework.NamedTupleValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NamedTupleValue buildPartial() { - org.tensorflow.proto.framework.NamedTupleValue result = new org.tensorflow.proto.framework.NamedTupleValue(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (valuesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.values_ = values_; - } else { - result.values_ = valuesBuilder_.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.NamedTupleValue) { - return mergeFrom((org.tensorflow.proto.framework.NamedTupleValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NamedTupleValue other) { - if (other == org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (valuesBuilder_ == null) { - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - } else { - if (!other.values_.isEmpty()) { - if (valuesBuilder_.isEmpty()) { - valuesBuilder_.dispose(); - valuesBuilder_ = null; - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - valuesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getValuesFieldBuilder() : null; - } else { - valuesBuilder_.addAllMessages(other.values_); - } - } - } - 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.NamedTupleValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NamedTupleValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 java.util.List values_ = - java.util.Collections.emptyList(); - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - values_ = new java.util.ArrayList(values_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.PairValue, org.tensorflow.proto.framework.PairValue.Builder, org.tensorflow.proto.framework.PairValueOrBuilder> valuesBuilder_; - - /** - * repeated .tensorflow.PairValue values = 2; - */ - public java.util.List getValuesList() { - if (valuesBuilder_ == null) { - return java.util.Collections.unmodifiableList(values_); - } else { - return valuesBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public int getValuesCount() { - if (valuesBuilder_ == null) { - return values_.size(); - } else { - return valuesBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValue getValues(int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.PairValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - } else { - valuesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.PairValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.set(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder addValues(org.tensorflow.proto.framework.PairValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - } else { - valuesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.PairValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(index, value); - onChanged(); - } else { - valuesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder addValues( - org.tensorflow.proto.framework.PairValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.PairValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder addAllValues( - java.lang.Iterable values) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - } else { - valuesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder clearValues() { - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - valuesBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public Builder removeValues(int index) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.remove(index); - onChanged(); - } else { - valuesBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValue.Builder getValuesBuilder( - int index) { - return getValuesFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValueOrBuilder getValuesOrBuilder( - int index) { - if (valuesBuilder_ == null) { - return values_.get(index); } else { - return valuesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public java.util.List - getValuesOrBuilderList() { - if (valuesBuilder_ != null) { - return valuesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(values_); - } - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValue.Builder addValuesBuilder() { - return getValuesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.PairValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public org.tensorflow.proto.framework.PairValue.Builder addValuesBuilder( - int index) { - return getValuesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.PairValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.PairValue values = 2; - */ - public java.util.List - getValuesBuilderList() { - return getValuesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.PairValue, org.tensorflow.proto.framework.PairValue.Builder, org.tensorflow.proto.framework.PairValueOrBuilder> - getValuesFieldBuilder() { - if (valuesBuilder_ == null) { - valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.PairValue, org.tensorflow.proto.framework.PairValue.Builder, org.tensorflow.proto.framework.PairValueOrBuilder>( - values_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - values_ = null; - } - return valuesBuilder_; - } - @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.NamedTupleValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NamedTupleValue) - private static final org.tensorflow.proto.framework.NamedTupleValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NamedTupleValue(); - } - - public static org.tensorflow.proto.framework.NamedTupleValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NamedTupleValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NamedTupleValue(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.NamedTupleValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValueOrBuilder.java deleted file mode 100644 index 6829f4aa2ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTupleValueOrBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface NamedTupleValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NamedTupleValue) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated .tensorflow.PairValue values = 2; - */ - java.util.List - getValuesList(); - /** - * repeated .tensorflow.PairValue values = 2; - */ - org.tensorflow.proto.framework.PairValue getValues(int index); - /** - * repeated .tensorflow.PairValue values = 2; - */ - int getValuesCount(); - /** - * repeated .tensorflow.PairValue values = 2; - */ - java.util.List - getValuesOrBuilderList(); - /** - * repeated .tensorflow.PairValue values = 2; - */ - org.tensorflow.proto.framework.PairValueOrBuilder getValuesOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDef.java deleted file mode 100644 index 9bfd5c5c1f3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDef.java +++ /dev/null @@ -1,3076 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/node_def.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.NodeDef} - */ -public final class NodeDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NodeDef) - NodeDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use NodeDef.newBuilder() to construct. - private NodeDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NodeDef() { - name_ = ""; - op_ = ""; - input_ = com.google.protobuf.LazyStringArrayList.EMPTY; - device_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NodeDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NodeDef( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - op_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - input_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - input_.add(s); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - device_ = s; - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.getValue()); - break; - } - case 50: { - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder subBuilder = null; - if (experimentalDebugInfo_ != null) { - subBuilder = experimentalDebugInfo_.toBuilder(); - } - experimentalDebugInfo_ = input.readMessage(org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(experimentalDebugInfo_); - experimentalDebugInfo_ = subBuilder.buildPartial(); - } - - 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)) { - input_ = input_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeDef.class, org.tensorflow.proto.framework.NodeDef.Builder.class); - } - - public interface ExperimentalDebugInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NodeDef.ExperimentalDebugInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - java.util.List - getOriginalNodeNamesList(); - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - int getOriginalNodeNamesCount(); - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - java.lang.String getOriginalNodeNames(int index); - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - com.google.protobuf.ByteString - getOriginalNodeNamesBytes(int index); - - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - java.util.List - getOriginalFuncNamesList(); - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - int getOriginalFuncNamesCount(); - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - java.lang.String getOriginalFuncNames(int index); - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - com.google.protobuf.ByteString - getOriginalFuncNamesBytes(int index); - } - /** - * Protobuf type {@code tensorflow.NodeDef.ExperimentalDebugInfo} - */ - public static final class ExperimentalDebugInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NodeDef.ExperimentalDebugInfo) - ExperimentalDebugInfoOrBuilder { - private static final long serialVersionUID = 0L; - // Use ExperimentalDebugInfo.newBuilder() to construct. - private ExperimentalDebugInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ExperimentalDebugInfo() { - originalNodeNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - originalFuncNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ExperimentalDebugInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ExperimentalDebugInfo( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - originalNodeNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - originalNodeNames_.add(s); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - originalFuncNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - originalFuncNames_.add(s); - 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)) { - originalNodeNames_ = originalNodeNames_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - originalFuncNames_ = originalFuncNames_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.class, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder.class); - } - - public static final int ORIGINAL_NODE_NAMES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList originalNodeNames_; - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - public com.google.protobuf.ProtocolStringList - getOriginalNodeNamesList() { - return originalNodeNames_; - } - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - public int getOriginalNodeNamesCount() { - return originalNodeNames_.size(); - } - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - public java.lang.String getOriginalNodeNames(int index) { - return originalNodeNames_.get(index); - } - /** - *
    -     * Opaque string inserted into error messages created by the runtime.
    -     * This is intended to store the list of names of the nodes from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -     * be {A, B}. This information can be used to map errors originating at the
    -     * current node to some top level source code.
    -     * 
    - * - * repeated string original_node_names = 1; - */ - public com.google.protobuf.ByteString - getOriginalNodeNamesBytes(int index) { - return originalNodeNames_.getByteString(index); - } - - public static final int ORIGINAL_FUNC_NAMES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList originalFuncNames_; - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - public com.google.protobuf.ProtocolStringList - getOriginalFuncNamesList() { - return originalFuncNames_; - } - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - public int getOriginalFuncNamesCount() { - return originalFuncNames_.size(); - } - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - public java.lang.String getOriginalFuncNames(int index) { - return originalFuncNames_.get(index); - } - /** - *
    -     * This is intended to store the list of names of the functions from the
    -     * original graph that this node was derived. For example if this node, say
    -     * C, was result of a fusion of node A in function FA and node B in function
    -     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -     * level graph, the `original_func` is empty. This information, with the
    -     * `original_node_names` can be used to map errors originating at the
    -     * current ndoe to some top level source code.
    -     * 
    - * - * repeated string original_func_names = 2; - */ - public com.google.protobuf.ByteString - getOriginalFuncNamesBytes(int index) { - return originalFuncNames_.getByteString(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 { - for (int i = 0; i < originalNodeNames_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, originalNodeNames_.getRaw(i)); - } - for (int i = 0; i < originalFuncNames_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, originalFuncNames_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < originalNodeNames_.size(); i++) { - dataSize += computeStringSizeNoTag(originalNodeNames_.getRaw(i)); - } - size += dataSize; - size += 1 * getOriginalNodeNamesList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < originalFuncNames_.size(); i++) { - dataSize += computeStringSizeNoTag(originalFuncNames_.getRaw(i)); - } - size += dataSize; - size += 1 * getOriginalFuncNamesList().size(); - } - 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.NodeDef.ExperimentalDebugInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo other = (org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo) obj; - - if (!getOriginalNodeNamesList() - .equals(other.getOriginalNodeNamesList())) return false; - if (!getOriginalFuncNamesList() - .equals(other.getOriginalFuncNamesList())) 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 (getOriginalNodeNamesCount() > 0) { - hash = (37 * hash) + ORIGINAL_NODE_NAMES_FIELD_NUMBER; - hash = (53 * hash) + getOriginalNodeNamesList().hashCode(); - } - if (getOriginalFuncNamesCount() > 0) { - hash = (37 * hash) + ORIGINAL_FUNC_NAMES_FIELD_NUMBER; - hash = (53 * hash) + getOriginalFuncNamesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NodeDef.ExperimentalDebugInfo) - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.class, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.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(); - originalNodeNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - originalFuncNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo build() { - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo buildPartial() { - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo result = new org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - originalNodeNames_ = originalNodeNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.originalNodeNames_ = originalNodeNames_; - if (((bitField0_ & 0x00000002) != 0)) { - originalFuncNames_ = originalFuncNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.originalFuncNames_ = originalFuncNames_; - 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.NodeDef.ExperimentalDebugInfo) { - return mergeFrom((org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo other) { - if (other == org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.getDefaultInstance()) return this; - if (!other.originalNodeNames_.isEmpty()) { - if (originalNodeNames_.isEmpty()) { - originalNodeNames_ = other.originalNodeNames_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOriginalNodeNamesIsMutable(); - originalNodeNames_.addAll(other.originalNodeNames_); - } - onChanged(); - } - if (!other.originalFuncNames_.isEmpty()) { - if (originalFuncNames_.isEmpty()) { - originalFuncNames_ = other.originalFuncNames_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOriginalFuncNamesIsMutable(); - originalFuncNames_.addAll(other.originalFuncNames_); - } - onChanged(); - } - 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.NodeDef.ExperimentalDebugInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList originalNodeNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureOriginalNodeNamesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - originalNodeNames_ = new com.google.protobuf.LazyStringArrayList(originalNodeNames_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public com.google.protobuf.ProtocolStringList - getOriginalNodeNamesList() { - return originalNodeNames_.getUnmodifiableView(); - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public int getOriginalNodeNamesCount() { - return originalNodeNames_.size(); - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public java.lang.String getOriginalNodeNames(int index) { - return originalNodeNames_.get(index); - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public com.google.protobuf.ByteString - getOriginalNodeNamesBytes(int index) { - return originalNodeNames_.getByteString(index); - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public Builder setOriginalNodeNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginalNodeNamesIsMutable(); - originalNodeNames_.set(index, value); - onChanged(); - return this; - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public Builder addOriginalNodeNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginalNodeNamesIsMutable(); - originalNodeNames_.add(value); - onChanged(); - return this; - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public Builder addAllOriginalNodeNames( - java.lang.Iterable values) { - ensureOriginalNodeNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, originalNodeNames_); - onChanged(); - return this; - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public Builder clearOriginalNodeNames() { - originalNodeNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -       * Opaque string inserted into error messages created by the runtime.
    -       * This is intended to store the list of names of the nodes from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    -       * be {A, B}. This information can be used to map errors originating at the
    -       * current node to some top level source code.
    -       * 
    - * - * repeated string original_node_names = 1; - */ - public Builder addOriginalNodeNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureOriginalNodeNamesIsMutable(); - originalNodeNames_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList originalFuncNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureOriginalFuncNamesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - originalFuncNames_ = new com.google.protobuf.LazyStringArrayList(originalFuncNames_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public com.google.protobuf.ProtocolStringList - getOriginalFuncNamesList() { - return originalFuncNames_.getUnmodifiableView(); - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public int getOriginalFuncNamesCount() { - return originalFuncNames_.size(); - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public java.lang.String getOriginalFuncNames(int index) { - return originalFuncNames_.get(index); - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public com.google.protobuf.ByteString - getOriginalFuncNamesBytes(int index) { - return originalFuncNames_.getByteString(index); - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public Builder setOriginalFuncNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginalFuncNamesIsMutable(); - originalFuncNames_.set(index, value); - onChanged(); - return this; - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public Builder addOriginalFuncNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOriginalFuncNamesIsMutable(); - originalFuncNames_.add(value); - onChanged(); - return this; - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public Builder addAllOriginalFuncNames( - java.lang.Iterable values) { - ensureOriginalFuncNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, originalFuncNames_); - onChanged(); - return this; - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public Builder clearOriginalFuncNames() { - originalFuncNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -       * This is intended to store the list of names of the functions from the
    -       * original graph that this node was derived. For example if this node, say
    -       * C, was result of a fusion of node A in function FA and node B in function
    -       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    -       * level graph, the `original_func` is empty. This information, with the
    -       * `original_node_names` can be used to map errors originating at the
    -       * current ndoe to some top level source code.
    -       * 
    - * - * repeated string original_func_names = 2; - */ - public Builder addOriginalFuncNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureOriginalFuncNamesIsMutable(); - originalFuncNames_.add(value); - 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.NodeDef.ExperimentalDebugInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NodeDef.ExperimentalDebugInfo) - private static final org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo(); - } - - public static org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ExperimentalDebugInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExperimentalDebugInfo(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.NodeDef.ExperimentalDebugInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * The name given to this operator. Used for naming inputs,
    -   * logging, visualization, etc.  Unique within a single GraphDef.
    -   * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -   * 
    - * - * 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 given to this operator. Used for naming inputs,
    -   * logging, visualization, etc.  Unique within a single GraphDef.
    -   * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -   * 
    - * - * 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 OP_FIELD_NUMBER = 2; - private volatile java.lang.Object op_; - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * Op names starting with an underscore are reserved for internal use.
    -   * 
    - * - * string op = 2; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - 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(); - op_ = s; - return s; - } - } - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * Op names starting with an underscore are reserved for internal use.
    -   * 
    - * - * string op = 2; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INPUT_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList input_; - /** - *
    -   * Each input is "node:src_output" with "node" being a string name and
    -   * "src_output" indicating which output tensor to use from "node". If
    -   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -   * may optionally be followed by control inputs that have the format
    -   * "^node".
    -   * 
    - * - * repeated string input = 3; - */ - public com.google.protobuf.ProtocolStringList - getInputList() { - return input_; - } - /** - *
    -   * Each input is "node:src_output" with "node" being a string name and
    -   * "src_output" indicating which output tensor to use from "node". If
    -   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -   * may optionally be followed by control inputs that have the format
    -   * "^node".
    -   * 
    - * - * repeated string input = 3; - */ - public int getInputCount() { - return input_.size(); - } - /** - *
    -   * Each input is "node:src_output" with "node" being a string name and
    -   * "src_output" indicating which output tensor to use from "node". If
    -   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -   * may optionally be followed by control inputs that have the format
    -   * "^node".
    -   * 
    - * - * repeated string input = 3; - */ - public java.lang.String getInput(int index) { - return input_.get(index); - } - /** - *
    -   * Each input is "node:src_output" with "node" being a string name and
    -   * "src_output" indicating which output tensor to use from "node". If
    -   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -   * may optionally be followed by control inputs that have the format
    -   * "^node".
    -   * 
    - * - * repeated string input = 3; - */ - public com.google.protobuf.ByteString - getInputBytes(int index) { - return input_.getByteString(index); - } - - public static final int DEVICE_FIELD_NUMBER = 4; - private volatile java.lang.Object device_; - /** - *
    -   * A (possibly partial) specification for the device on which this
    -   * node should be placed.
    -   * The expected syntax for this string is as follows:
    -   * DEVICE_SPEC ::= PARTIAL_SPEC
    -   * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -   * CONSTRAINT ::= ("job:" JOB_NAME)
    -   *              | ("replica:" [1-9][0-9]*)
    -   *              | ("task:" [1-9][0-9]*)
    -   *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -   * Valid values for this string include:
    -   * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -   * * "/job:worker/device:GPU:3"                   (partial specification)
    -   * * ""                                    (no specification)
    -   * If the constraints do not resolve to a single device (or if this
    -   * field is empty or not present), the runtime will attempt to
    -   * choose a device automatically.
    -   * 
    - * - * string device = 4; - */ - 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; - } - } - /** - *
    -   * A (possibly partial) specification for the device on which this
    -   * node should be placed.
    -   * The expected syntax for this string is as follows:
    -   * DEVICE_SPEC ::= PARTIAL_SPEC
    -   * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -   * CONSTRAINT ::= ("job:" JOB_NAME)
    -   *              | ("replica:" [1-9][0-9]*)
    -   *              | ("task:" [1-9][0-9]*)
    -   *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -   * Valid values for this string include:
    -   * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -   * * "/job:worker/device:GPU:3"                   (partial specification)
    -   * * ""                                    (no specification)
    -   * If the constraints do not resolve to a single device (or if this
    -   * field is empty or not present), the runtime will attempt to
    -   * choose a device automatically.
    -   * 
    - * - * string device = 4; - */ - 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 ATTR_FIELD_NUMBER = 5; - private static final class AttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -   * Operation-specific graph-construction-time configuration.
    -   * Note that this should include all attrs defined in the
    -   * corresponding OpDef, including those with a value matching
    -   * the default -- this allows the default to change and makes
    -   * NodeDefs easier to interpret on their own.  However, if
    -   * an attr with a default is not specified in this list, the
    -   * default will be used.
    -   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -   * one of the names from the corresponding OpDef's attr field).
    -   * The values must have a type matching the corresponding OpDef
    -   * attr's type field.
    -   * TODO(josh11b): Add some examples here showing best practices.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -   * Operation-specific graph-construction-time configuration.
    -   * Note that this should include all attrs defined in the
    -   * corresponding OpDef, including those with a value matching
    -   * the default -- this allows the default to change and makes
    -   * NodeDefs easier to interpret on their own.  However, if
    -   * an attr with a default is not specified in this list, the
    -   * default will be used.
    -   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -   * one of the names from the corresponding OpDef's attr field).
    -   * The values must have a type matching the corresponding OpDef
    -   * attr's type field.
    -   * TODO(josh11b): Add some examples here showing best practices.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -   * Operation-specific graph-construction-time configuration.
    -   * Note that this should include all attrs defined in the
    -   * corresponding OpDef, including those with a value matching
    -   * the default -- this allows the default to change and makes
    -   * NodeDefs easier to interpret on their own.  However, if
    -   * an attr with a default is not specified in this list, the
    -   * default will be used.
    -   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -   * one of the names from the corresponding OpDef's attr field).
    -   * The values must have a type matching the corresponding OpDef
    -   * attr's type field.
    -   * TODO(josh11b): Add some examples here showing best practices.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Operation-specific graph-construction-time configuration.
    -   * Note that this should include all attrs defined in the
    -   * corresponding OpDef, including those with a value matching
    -   * the default -- this allows the default to change and makes
    -   * NodeDefs easier to interpret on their own.  However, if
    -   * an attr with a default is not specified in this list, the
    -   * default will be used.
    -   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -   * one of the names from the corresponding OpDef's attr field).
    -   * The values must have a type matching the corresponding OpDef
    -   * attr's type field.
    -   * TODO(josh11b): Add some examples here showing best practices.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int EXPERIMENTAL_DEBUG_INFO_FIELD_NUMBER = 6; - private org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo experimentalDebugInfo_; - /** - *
    -   * This stores debug information associated with the node.
    -   * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public boolean hasExperimentalDebugInfo() { - return experimentalDebugInfo_ != null; - } - /** - *
    -   * This stores debug information associated with the node.
    -   * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo() { - return experimentalDebugInfo_ == null ? org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; - } - /** - *
    -   * This stores debug information associated with the node.
    -   * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder() { - return getExperimentalDebugInfo(); - } - - 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 (!getOpBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, op_); - } - for (int i = 0; i < input_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, input_.getRaw(i)); - } - if (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, device_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 5); - if (experimentalDebugInfo_ != null) { - output.writeMessage(6, getExperimentalDebugInfo()); - } - 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 (!getOpBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, op_); - } - { - int dataSize = 0; - for (int i = 0; i < input_.size(); i++) { - dataSize += computeStringSizeNoTag(input_.getRaw(i)); - } - size += dataSize; - size += 1 * getInputList().size(); - } - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, device_); - } - for (java.util.Map.Entry entry - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, attr__); - } - if (experimentalDebugInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getExperimentalDebugInfo()); - } - 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.NodeDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NodeDef other = (org.tensorflow.proto.framework.NodeDef) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getOp() - .equals(other.getOp())) return false; - if (!getInputList() - .equals(other.getInputList())) return false; - if (!getDevice() - .equals(other.getDevice())) return false; - if (!internalGetAttr().equals( - other.internalGetAttr())) return false; - if (hasExperimentalDebugInfo() != other.hasExperimentalDebugInfo()) return false; - if (hasExperimentalDebugInfo()) { - if (!getExperimentalDebugInfo() - .equals(other.getExperimentalDebugInfo())) 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) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOp().hashCode(); - if (getInputCount() > 0) { - hash = (37 * hash) + INPUT_FIELD_NUMBER; - hash = (53 * hash) + getInputList().hashCode(); - } - hash = (37 * hash) + DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - if (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - if (hasExperimentalDebugInfo()) { - hash = (37 * hash) + EXPERIMENTAL_DEBUG_INFO_FIELD_NUMBER; - hash = (53 * hash) + getExperimentalDebugInfo().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NodeDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef 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.NodeDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef 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.NodeDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NodeDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef 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.NodeDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef 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.NodeDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeDef 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.NodeDef 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.NodeDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NodeDef) - org.tensorflow.proto.framework.NodeDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 5: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 5: - return internalGetMutableAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeDef.class, org.tensorflow.proto.framework.NodeDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NodeDef.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_ = ""; - - op_ = ""; - - input_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - device_ = ""; - - internalGetMutableAttr().clear(); - if (experimentalDebugInfoBuilder_ == null) { - experimentalDebugInfo_ = null; - } else { - experimentalDebugInfo_ = null; - experimentalDebugInfoBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.NodeProto.internal_static_tensorflow_NodeDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NodeDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef build() { - org.tensorflow.proto.framework.NodeDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeDef buildPartial() { - org.tensorflow.proto.framework.NodeDef result = new org.tensorflow.proto.framework.NodeDef(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.op_ = op_; - if (((bitField0_ & 0x00000001) != 0)) { - input_ = input_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.input_ = input_; - result.device_ = device_; - result.attr_ = internalGetAttr(); - result.attr_.makeImmutable(); - if (experimentalDebugInfoBuilder_ == null) { - result.experimentalDebugInfo_ = experimentalDebugInfo_; - } else { - result.experimentalDebugInfo_ = experimentalDebugInfoBuilder_.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.NodeDef) { - return mergeFrom((org.tensorflow.proto.framework.NodeDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NodeDef other) { - if (other == org.tensorflow.proto.framework.NodeDef.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getOp().isEmpty()) { - op_ = other.op_; - onChanged(); - } - if (!other.input_.isEmpty()) { - if (input_.isEmpty()) { - input_ = other.input_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputIsMutable(); - input_.addAll(other.input_); - } - onChanged(); - } - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - if (other.hasExperimentalDebugInfo()) { - mergeExperimentalDebugInfo(other.getExperimentalDebugInfo()); - } - 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.NodeDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NodeDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -     * The name given to this operator. Used for naming inputs,
    -     * logging, visualization, etc.  Unique within a single GraphDef.
    -     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -     * 
    - * - * 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 given to this operator. Used for naming inputs,
    -     * logging, visualization, etc.  Unique within a single GraphDef.
    -     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -     * 
    - * - * 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 given to this operator. Used for naming inputs,
    -     * logging, visualization, etc.  Unique within a single GraphDef.
    -     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name given to this operator. Used for naming inputs,
    -     * logging, visualization, etc.  Unique within a single GraphDef.
    -     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * The name given to this operator. Used for naming inputs,
    -     * logging, visualization, etc.  Unique within a single GraphDef.
    -     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    -     * 
    - * - * 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 java.lang.Object op_ = ""; - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * Op names starting with an underscore are reserved for internal use.
    -     * 
    - * - * string op = 2; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - op_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * Op names starting with an underscore are reserved for internal use.
    -     * 
    - * - * string op = 2; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * Op names starting with an underscore are reserved for internal use.
    -     * 
    - * - * string op = 2; - */ - public Builder setOp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - op_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * Op names starting with an underscore are reserved for internal use.
    -     * 
    - * - * string op = 2; - */ - public Builder clearOp() { - - op_ = getDefaultInstance().getOp(); - onChanged(); - return this; - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * Op names starting with an underscore are reserved for internal use.
    -     * 
    - * - * string op = 2; - */ - public Builder setOpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - op_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList input_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureInputIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - input_ = new com.google.protobuf.LazyStringArrayList(input_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public com.google.protobuf.ProtocolStringList - getInputList() { - return input_.getUnmodifiableView(); - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public int getInputCount() { - return input_.size(); - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public java.lang.String getInput(int index) { - return input_.get(index); - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public com.google.protobuf.ByteString - getInputBytes(int index) { - return input_.getByteString(index); - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public Builder setInput( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputIsMutable(); - input_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public Builder addInput( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputIsMutable(); - input_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public Builder addAllInput( - java.lang.Iterable values) { - ensureInputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, input_); - onChanged(); - return this; - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public Builder clearInput() { - input_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Each input is "node:src_output" with "node" being a string name and
    -     * "src_output" indicating which output tensor to use from "node". If
    -     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    -     * may optionally be followed by control inputs that have the format
    -     * "^node".
    -     * 
    - * - * repeated string input = 3; - */ - public Builder addInputBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInputIsMutable(); - input_.add(value); - onChanged(); - return this; - } - - private java.lang.Object device_ = ""; - /** - *
    -     * A (possibly partial) specification for the device on which this
    -     * node should be placed.
    -     * The expected syntax for this string is as follows:
    -     * DEVICE_SPEC ::= PARTIAL_SPEC
    -     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -     * CONSTRAINT ::= ("job:" JOB_NAME)
    -     *              | ("replica:" [1-9][0-9]*)
    -     *              | ("task:" [1-9][0-9]*)
    -     *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -     * Valid values for this string include:
    -     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -     * * "/job:worker/device:GPU:3"                   (partial specification)
    -     * * ""                                    (no specification)
    -     * If the constraints do not resolve to a single device (or if this
    -     * field is empty or not present), the runtime will attempt to
    -     * choose a device automatically.
    -     * 
    - * - * string device = 4; - */ - 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; - } - } - /** - *
    -     * A (possibly partial) specification for the device on which this
    -     * node should be placed.
    -     * The expected syntax for this string is as follows:
    -     * DEVICE_SPEC ::= PARTIAL_SPEC
    -     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -     * CONSTRAINT ::= ("job:" JOB_NAME)
    -     *              | ("replica:" [1-9][0-9]*)
    -     *              | ("task:" [1-9][0-9]*)
    -     *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -     * Valid values for this string include:
    -     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -     * * "/job:worker/device:GPU:3"                   (partial specification)
    -     * * ""                                    (no specification)
    -     * If the constraints do not resolve to a single device (or if this
    -     * field is empty or not present), the runtime will attempt to
    -     * choose a device automatically.
    -     * 
    - * - * string device = 4; - */ - 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; - } - } - /** - *
    -     * A (possibly partial) specification for the device on which this
    -     * node should be placed.
    -     * The expected syntax for this string is as follows:
    -     * DEVICE_SPEC ::= PARTIAL_SPEC
    -     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -     * CONSTRAINT ::= ("job:" JOB_NAME)
    -     *              | ("replica:" [1-9][0-9]*)
    -     *              | ("task:" [1-9][0-9]*)
    -     *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -     * Valid values for this string include:
    -     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -     * * "/job:worker/device:GPU:3"                   (partial specification)
    -     * * ""                                    (no specification)
    -     * If the constraints do not resolve to a single device (or if this
    -     * field is empty or not present), the runtime will attempt to
    -     * choose a device automatically.
    -     * 
    - * - * string device = 4; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - *
    -     * A (possibly partial) specification for the device on which this
    -     * node should be placed.
    -     * The expected syntax for this string is as follows:
    -     * DEVICE_SPEC ::= PARTIAL_SPEC
    -     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -     * CONSTRAINT ::= ("job:" JOB_NAME)
    -     *              | ("replica:" [1-9][0-9]*)
    -     *              | ("task:" [1-9][0-9]*)
    -     *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -     * Valid values for this string include:
    -     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -     * * "/job:worker/device:GPU:3"                   (partial specification)
    -     * * ""                                    (no specification)
    -     * If the constraints do not resolve to a single device (or if this
    -     * field is empty or not present), the runtime will attempt to
    -     * choose a device automatically.
    -     * 
    - * - * string device = 4; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -     * A (possibly partial) specification for the device on which this
    -     * node should be placed.
    -     * The expected syntax for this string is as follows:
    -     * DEVICE_SPEC ::= PARTIAL_SPEC
    -     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    -     * CONSTRAINT ::= ("job:" JOB_NAME)
    -     *              | ("replica:" [1-9][0-9]*)
    -     *              | ("task:" [1-9][0-9]*)
    -     *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    -     * Valid values for this string include:
    -     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    -     * * "/job:worker/device:GPU:3"                   (partial specification)
    -     * * ""                                    (no specification)
    -     * If the constraints do not resolve to a single device (or if this
    -     * field is empty or not present), the runtime will attempt to
    -     * choose a device automatically.
    -     * 
    - * - * string device = 4; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged();; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public Builder removeAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - public Builder putAttr( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Operation-specific graph-construction-time configuration.
    -     * Note that this should include all attrs defined in the
    -     * corresponding OpDef, including those with a value matching
    -     * the default -- this allows the default to change and makes
    -     * NodeDefs easier to interpret on their own.  However, if
    -     * an attr with a default is not specified in this list, the
    -     * default will be used.
    -     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    -     * one of the names from the corresponding OpDef's attr field).
    -     * The values must have a type matching the corresponding OpDef
    -     * attr's type field.
    -     * TODO(josh11b): Add some examples here showing best practices.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 5; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().getMutableMap() - .putAll(values); - return this; - } - - private org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo experimentalDebugInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder> experimentalDebugInfoBuilder_; - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public boolean hasExperimentalDebugInfo() { - return experimentalDebugInfoBuilder_ != null || experimentalDebugInfo_ != null; - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo() { - if (experimentalDebugInfoBuilder_ == null) { - return experimentalDebugInfo_ == null ? org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; - } else { - return experimentalDebugInfoBuilder_.getMessage(); - } - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public Builder setExperimentalDebugInfo(org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo value) { - if (experimentalDebugInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - experimentalDebugInfo_ = value; - onChanged(); - } else { - experimentalDebugInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public Builder setExperimentalDebugInfo( - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder builderForValue) { - if (experimentalDebugInfoBuilder_ == null) { - experimentalDebugInfo_ = builderForValue.build(); - onChanged(); - } else { - experimentalDebugInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public Builder mergeExperimentalDebugInfo(org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo value) { - if (experimentalDebugInfoBuilder_ == null) { - if (experimentalDebugInfo_ != null) { - experimentalDebugInfo_ = - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.newBuilder(experimentalDebugInfo_).mergeFrom(value).buildPartial(); - } else { - experimentalDebugInfo_ = value; - } - onChanged(); - } else { - experimentalDebugInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public Builder clearExperimentalDebugInfo() { - if (experimentalDebugInfoBuilder_ == null) { - experimentalDebugInfo_ = null; - onChanged(); - } else { - experimentalDebugInfo_ = null; - experimentalDebugInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder getExperimentalDebugInfoBuilder() { - - onChanged(); - return getExperimentalDebugInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - public org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder() { - if (experimentalDebugInfoBuilder_ != null) { - return experimentalDebugInfoBuilder_.getMessageOrBuilder(); - } else { - return experimentalDebugInfo_ == null ? - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; - } - } - /** - *
    -     * This stores debug information associated with the node.
    -     * 
    - * - * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder> - getExperimentalDebugInfoFieldBuilder() { - if (experimentalDebugInfoBuilder_ == null) { - experimentalDebugInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder>( - getExperimentalDebugInfo(), - getParentForChildren(), - isClean()); - experimentalDebugInfo_ = null; - } - return experimentalDebugInfoBuilder_; - } - @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.NodeDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NodeDef) - private static final org.tensorflow.proto.framework.NodeDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NodeDef(); - } - - public static org.tensorflow.proto.framework.NodeDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NodeDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NodeDef(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.NodeDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStats.java deleted file mode 100644 index 93e1e3df32c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStats.java +++ /dev/null @@ -1,2580 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Time/size stats recorded for a single execution of a graph node.
    - * 
    - * - * Protobuf type {@code tensorflow.NodeExecStats} - */ -public final class NodeExecStats extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NodeExecStats) - NodeExecStatsOrBuilder { -private static final long serialVersionUID = 0L; - // Use NodeExecStats.newBuilder() to construct. - private NodeExecStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NodeExecStats() { - nodeName_ = ""; - memory_ = java.util.Collections.emptyList(); - output_ = java.util.Collections.emptyList(); - timelineLabel_ = ""; - referencedTensor_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NodeExecStats(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NodeExecStats( - 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(); - - nodeName_ = s; - break; - } - case 16: { - - allStartMicros_ = input.readInt64(); - break; - } - case 24: { - - opStartRelMicros_ = input.readInt64(); - break; - } - case 32: { - - opEndRelMicros_ = input.readInt64(); - break; - } - case 40: { - - allEndRelMicros_ = input.readInt64(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - memory_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - memory_.add( - input.readMessage(org.tensorflow.proto.framework.AllocatorMemoryUsed.parser(), extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - output_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - output_.add( - input.readMessage(org.tensorflow.proto.framework.NodeOutput.parser(), extensionRegistry)); - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - timelineLabel_ = s; - break; - } - case 72: { - - scheduledMicros_ = input.readInt64(); - break; - } - case 80: { - - threadId_ = input.readUInt32(); - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - referencedTensor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - referencedTensor_.add( - input.readMessage(org.tensorflow.proto.framework.AllocationDescription.parser(), extensionRegistry)); - break; - } - case 98: { - org.tensorflow.proto.framework.MemoryStats.Builder subBuilder = null; - if (memoryStats_ != null) { - subBuilder = memoryStats_.toBuilder(); - } - memoryStats_ = input.readMessage(org.tensorflow.proto.framework.MemoryStats.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(memoryStats_); - memoryStats_ = subBuilder.buildPartial(); - } - - break; - } - case 104: { - - allStartNanos_ = input.readInt64(); - break; - } - case 112: { - - opStartRelNanos_ = input.readInt64(); - break; - } - case 120: { - - opEndRelNanos_ = input.readInt64(); - break; - } - case 128: { - - allEndRelNanos_ = input.readInt64(); - break; - } - case 136: { - - scheduledNanos_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - memory_ = java.util.Collections.unmodifiableList(memory_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - output_ = java.util.Collections.unmodifiableList(output_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - referencedTensor_ = java.util.Collections.unmodifiableList(referencedTensor_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeExecStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeExecStats.class, org.tensorflow.proto.framework.NodeExecStats.Builder.class); - } - - public static final int NODE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object nodeName_; - /** - *
    -   * TODO(tucker): Use some more compact form of node identity than
    -   * the full string name.  Either all processes should agree on a
    -   * global id (cost_id?) for each node, or we should use a hash of
    -   * the name.
    -   * 
    - * - * string node_name = 1; - */ - public java.lang.String getNodeName() { - java.lang.Object ref = nodeName_; - 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(); - nodeName_ = s; - return s; - } - } - /** - *
    -   * TODO(tucker): Use some more compact form of node identity than
    -   * the full string name.  Either all processes should agree on a
    -   * global id (cost_id?) for each node, or we should use a hash of
    -   * the name.
    -   * 
    - * - * string node_name = 1; - */ - public com.google.protobuf.ByteString - getNodeNameBytes() { - java.lang.Object ref = nodeName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALL_START_MICROS_FIELD_NUMBER = 2; - private long allStartMicros_; - /** - * int64 all_start_micros = 2; - */ - public long getAllStartMicros() { - return allStartMicros_; - } - - public static final int OP_START_REL_MICROS_FIELD_NUMBER = 3; - private long opStartRelMicros_; - /** - * int64 op_start_rel_micros = 3; - */ - public long getOpStartRelMicros() { - return opStartRelMicros_; - } - - public static final int OP_END_REL_MICROS_FIELD_NUMBER = 4; - private long opEndRelMicros_; - /** - * int64 op_end_rel_micros = 4; - */ - public long getOpEndRelMicros() { - return opEndRelMicros_; - } - - public static final int ALL_END_REL_MICROS_FIELD_NUMBER = 5; - private long allEndRelMicros_; - /** - * int64 all_end_rel_micros = 5; - */ - public long getAllEndRelMicros() { - return allEndRelMicros_; - } - - public static final int MEMORY_FIELD_NUMBER = 6; - private java.util.List memory_; - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public java.util.List getMemoryList() { - return memory_; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public java.util.List - getMemoryOrBuilderList() { - return memory_; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public int getMemoryCount() { - return memory_.size(); - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsed getMemory(int index) { - return memory_.get(index); - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( - int index) { - return memory_.get(index); - } - - public static final int OUTPUT_FIELD_NUMBER = 7; - private java.util.List output_; - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public java.util.List getOutputList() { - return output_; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public java.util.List - getOutputOrBuilderList() { - return output_; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public int getOutputCount() { - return output_.size(); - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutput getOutput(int index) { - return output_.get(index); - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutputOrBuilder getOutputOrBuilder( - int index) { - return output_.get(index); - } - - public static final int TIMELINE_LABEL_FIELD_NUMBER = 8; - private volatile java.lang.Object timelineLabel_; - /** - * string timeline_label = 8; - */ - public java.lang.String getTimelineLabel() { - java.lang.Object ref = timelineLabel_; - 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(); - timelineLabel_ = s; - return s; - } - } - /** - * string timeline_label = 8; - */ - public com.google.protobuf.ByteString - getTimelineLabelBytes() { - java.lang.Object ref = timelineLabel_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - timelineLabel_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SCHEDULED_MICROS_FIELD_NUMBER = 9; - private long scheduledMicros_; - /** - * int64 scheduled_micros = 9; - */ - public long getScheduledMicros() { - return scheduledMicros_; - } - - public static final int THREAD_ID_FIELD_NUMBER = 10; - private int threadId_; - /** - * uint32 thread_id = 10; - */ - public int getThreadId() { - return threadId_; - } - - public static final int REFERENCED_TENSOR_FIELD_NUMBER = 11; - private java.util.List referencedTensor_; - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public java.util.List getReferencedTensorList() { - return referencedTensor_; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public java.util.List - getReferencedTensorOrBuilderList() { - return referencedTensor_; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public int getReferencedTensorCount() { - return referencedTensor_.size(); - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescription getReferencedTensor(int index) { - return referencedTensor_.get(index); - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( - int index) { - return referencedTensor_.get(index); - } - - public static final int MEMORY_STATS_FIELD_NUMBER = 12; - private org.tensorflow.proto.framework.MemoryStats memoryStats_; - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public boolean hasMemoryStats() { - return memoryStats_ != null; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public org.tensorflow.proto.framework.MemoryStats getMemoryStats() { - return memoryStats_ == null ? org.tensorflow.proto.framework.MemoryStats.getDefaultInstance() : memoryStats_; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public org.tensorflow.proto.framework.MemoryStatsOrBuilder getMemoryStatsOrBuilder() { - return getMemoryStats(); - } - - public static final int ALL_START_NANOS_FIELD_NUMBER = 13; - private long allStartNanos_; - /** - * int64 all_start_nanos = 13; - */ - public long getAllStartNanos() { - return allStartNanos_; - } - - public static final int OP_START_REL_NANOS_FIELD_NUMBER = 14; - private long opStartRelNanos_; - /** - * int64 op_start_rel_nanos = 14; - */ - public long getOpStartRelNanos() { - return opStartRelNanos_; - } - - public static final int OP_END_REL_NANOS_FIELD_NUMBER = 15; - private long opEndRelNanos_; - /** - * int64 op_end_rel_nanos = 15; - */ - public long getOpEndRelNanos() { - return opEndRelNanos_; - } - - public static final int ALL_END_REL_NANOS_FIELD_NUMBER = 16; - private long allEndRelNanos_; - /** - * int64 all_end_rel_nanos = 16; - */ - public long getAllEndRelNanos() { - return allEndRelNanos_; - } - - public static final int SCHEDULED_NANOS_FIELD_NUMBER = 17; - private long scheduledNanos_; - /** - * int64 scheduled_nanos = 17; - */ - public long getScheduledNanos() { - return scheduledNanos_; - } - - 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 (!getNodeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nodeName_); - } - if (allStartMicros_ != 0L) { - output.writeInt64(2, allStartMicros_); - } - if (opStartRelMicros_ != 0L) { - output.writeInt64(3, opStartRelMicros_); - } - if (opEndRelMicros_ != 0L) { - output.writeInt64(4, opEndRelMicros_); - } - if (allEndRelMicros_ != 0L) { - output.writeInt64(5, allEndRelMicros_); - } - for (int i = 0; i < memory_.size(); i++) { - output.writeMessage(6, memory_.get(i)); - } - for (int i = 0; i < output_.size(); i++) { - output.writeMessage(7, output_.get(i)); - } - if (!getTimelineLabelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, timelineLabel_); - } - if (scheduledMicros_ != 0L) { - output.writeInt64(9, scheduledMicros_); - } - if (threadId_ != 0) { - output.writeUInt32(10, threadId_); - } - for (int i = 0; i < referencedTensor_.size(); i++) { - output.writeMessage(11, referencedTensor_.get(i)); - } - if (memoryStats_ != null) { - output.writeMessage(12, getMemoryStats()); - } - if (allStartNanos_ != 0L) { - output.writeInt64(13, allStartNanos_); - } - if (opStartRelNanos_ != 0L) { - output.writeInt64(14, opStartRelNanos_); - } - if (opEndRelNanos_ != 0L) { - output.writeInt64(15, opEndRelNanos_); - } - if (allEndRelNanos_ != 0L) { - output.writeInt64(16, allEndRelNanos_); - } - if (scheduledNanos_ != 0L) { - output.writeInt64(17, scheduledNanos_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNodeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nodeName_); - } - if (allStartMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, allStartMicros_); - } - if (opStartRelMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, opStartRelMicros_); - } - if (opEndRelMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, opEndRelMicros_); - } - if (allEndRelMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, allEndRelMicros_); - } - for (int i = 0; i < memory_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, memory_.get(i)); - } - for (int i = 0; i < output_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, output_.get(i)); - } - if (!getTimelineLabelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, timelineLabel_); - } - if (scheduledMicros_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, scheduledMicros_); - } - if (threadId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(10, threadId_); - } - for (int i = 0; i < referencedTensor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, referencedTensor_.get(i)); - } - if (memoryStats_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, getMemoryStats()); - } - if (allStartNanos_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(13, allStartNanos_); - } - if (opStartRelNanos_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(14, opStartRelNanos_); - } - if (opEndRelNanos_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(15, opEndRelNanos_); - } - if (allEndRelNanos_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(16, allEndRelNanos_); - } - if (scheduledNanos_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(17, scheduledNanos_); - } - 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.NodeExecStats)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NodeExecStats other = (org.tensorflow.proto.framework.NodeExecStats) obj; - - if (!getNodeName() - .equals(other.getNodeName())) return false; - if (getAllStartMicros() - != other.getAllStartMicros()) return false; - if (getOpStartRelMicros() - != other.getOpStartRelMicros()) return false; - if (getOpEndRelMicros() - != other.getOpEndRelMicros()) return false; - if (getAllEndRelMicros() - != other.getAllEndRelMicros()) return false; - if (!getMemoryList() - .equals(other.getMemoryList())) return false; - if (!getOutputList() - .equals(other.getOutputList())) return false; - if (!getTimelineLabel() - .equals(other.getTimelineLabel())) return false; - if (getScheduledMicros() - != other.getScheduledMicros()) return false; - if (getThreadId() - != other.getThreadId()) return false; - if (!getReferencedTensorList() - .equals(other.getReferencedTensorList())) return false; - if (hasMemoryStats() != other.hasMemoryStats()) return false; - if (hasMemoryStats()) { - if (!getMemoryStats() - .equals(other.getMemoryStats())) return false; - } - if (getAllStartNanos() - != other.getAllStartNanos()) return false; - if (getOpStartRelNanos() - != other.getOpStartRelNanos()) return false; - if (getOpEndRelNanos() - != other.getOpEndRelNanos()) return false; - if (getAllEndRelNanos() - != other.getAllEndRelNanos()) return false; - if (getScheduledNanos() - != other.getScheduledNanos()) 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) + NODE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getNodeName().hashCode(); - hash = (37 * hash) + ALL_START_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllStartMicros()); - hash = (37 * hash) + OP_START_REL_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOpStartRelMicros()); - hash = (37 * hash) + OP_END_REL_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOpEndRelMicros()); - hash = (37 * hash) + ALL_END_REL_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllEndRelMicros()); - if (getMemoryCount() > 0) { - hash = (37 * hash) + MEMORY_FIELD_NUMBER; - hash = (53 * hash) + getMemoryList().hashCode(); - } - if (getOutputCount() > 0) { - hash = (37 * hash) + OUTPUT_FIELD_NUMBER; - hash = (53 * hash) + getOutputList().hashCode(); - } - hash = (37 * hash) + TIMELINE_LABEL_FIELD_NUMBER; - hash = (53 * hash) + getTimelineLabel().hashCode(); - hash = (37 * hash) + SCHEDULED_MICROS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getScheduledMicros()); - hash = (37 * hash) + THREAD_ID_FIELD_NUMBER; - hash = (53 * hash) + getThreadId(); - if (getReferencedTensorCount() > 0) { - hash = (37 * hash) + REFERENCED_TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getReferencedTensorList().hashCode(); - } - if (hasMemoryStats()) { - hash = (37 * hash) + MEMORY_STATS_FIELD_NUMBER; - hash = (53 * hash) + getMemoryStats().hashCode(); - } - hash = (37 * hash) + ALL_START_NANOS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllStartNanos()); - hash = (37 * hash) + OP_START_REL_NANOS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOpStartRelNanos()); - hash = (37 * hash) + OP_END_REL_NANOS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOpEndRelNanos()); - hash = (37 * hash) + ALL_END_REL_NANOS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAllEndRelNanos()); - hash = (37 * hash) + SCHEDULED_NANOS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getScheduledNanos()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NodeExecStats parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeExecStats 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.NodeExecStats parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeExecStats 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.NodeExecStats parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeExecStats parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NodeExecStats parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeExecStats 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.NodeExecStats parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeExecStats 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.NodeExecStats parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeExecStats 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.NodeExecStats 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; - } - /** - *
    -   * Time/size stats recorded for a single execution of a graph node.
    -   * 
    - * - * Protobuf type {@code tensorflow.NodeExecStats} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NodeExecStats) - org.tensorflow.proto.framework.NodeExecStatsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeExecStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeExecStats.class, org.tensorflow.proto.framework.NodeExecStats.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NodeExecStats.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getMemoryFieldBuilder(); - getOutputFieldBuilder(); - getReferencedTensorFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - nodeName_ = ""; - - allStartMicros_ = 0L; - - opStartRelMicros_ = 0L; - - opEndRelMicros_ = 0L; - - allEndRelMicros_ = 0L; - - if (memoryBuilder_ == null) { - memory_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - memoryBuilder_.clear(); - } - if (outputBuilder_ == null) { - output_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - outputBuilder_.clear(); - } - timelineLabel_ = ""; - - scheduledMicros_ = 0L; - - threadId_ = 0; - - if (referencedTensorBuilder_ == null) { - referencedTensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - referencedTensorBuilder_.clear(); - } - if (memoryStatsBuilder_ == null) { - memoryStats_ = null; - } else { - memoryStats_ = null; - memoryStatsBuilder_ = null; - } - allStartNanos_ = 0L; - - opStartRelNanos_ = 0L; - - opEndRelNanos_ = 0L; - - allEndRelNanos_ = 0L; - - scheduledNanos_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeExecStats getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeExecStats build() { - org.tensorflow.proto.framework.NodeExecStats result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeExecStats buildPartial() { - org.tensorflow.proto.framework.NodeExecStats result = new org.tensorflow.proto.framework.NodeExecStats(this); - int from_bitField0_ = bitField0_; - result.nodeName_ = nodeName_; - result.allStartMicros_ = allStartMicros_; - result.opStartRelMicros_ = opStartRelMicros_; - result.opEndRelMicros_ = opEndRelMicros_; - result.allEndRelMicros_ = allEndRelMicros_; - if (memoryBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - memory_ = java.util.Collections.unmodifiableList(memory_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.memory_ = memory_; - } else { - result.memory_ = memoryBuilder_.build(); - } - if (outputBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - output_ = java.util.Collections.unmodifiableList(output_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.output_ = output_; - } else { - result.output_ = outputBuilder_.build(); - } - result.timelineLabel_ = timelineLabel_; - result.scheduledMicros_ = scheduledMicros_; - result.threadId_ = threadId_; - if (referencedTensorBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - referencedTensor_ = java.util.Collections.unmodifiableList(referencedTensor_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.referencedTensor_ = referencedTensor_; - } else { - result.referencedTensor_ = referencedTensorBuilder_.build(); - } - if (memoryStatsBuilder_ == null) { - result.memoryStats_ = memoryStats_; - } else { - result.memoryStats_ = memoryStatsBuilder_.build(); - } - result.allStartNanos_ = allStartNanos_; - result.opStartRelNanos_ = opStartRelNanos_; - result.opEndRelNanos_ = opEndRelNanos_; - result.allEndRelNanos_ = allEndRelNanos_; - result.scheduledNanos_ = scheduledNanos_; - 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.NodeExecStats) { - return mergeFrom((org.tensorflow.proto.framework.NodeExecStats)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NodeExecStats other) { - if (other == org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance()) return this; - if (!other.getNodeName().isEmpty()) { - nodeName_ = other.nodeName_; - onChanged(); - } - if (other.getAllStartMicros() != 0L) { - setAllStartMicros(other.getAllStartMicros()); - } - if (other.getOpStartRelMicros() != 0L) { - setOpStartRelMicros(other.getOpStartRelMicros()); - } - if (other.getOpEndRelMicros() != 0L) { - setOpEndRelMicros(other.getOpEndRelMicros()); - } - if (other.getAllEndRelMicros() != 0L) { - setAllEndRelMicros(other.getAllEndRelMicros()); - } - if (memoryBuilder_ == null) { - if (!other.memory_.isEmpty()) { - if (memory_.isEmpty()) { - memory_ = other.memory_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMemoryIsMutable(); - memory_.addAll(other.memory_); - } - onChanged(); - } - } else { - if (!other.memory_.isEmpty()) { - if (memoryBuilder_.isEmpty()) { - memoryBuilder_.dispose(); - memoryBuilder_ = null; - memory_ = other.memory_; - bitField0_ = (bitField0_ & ~0x00000001); - memoryBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getMemoryFieldBuilder() : null; - } else { - memoryBuilder_.addAllMessages(other.memory_); - } - } - } - if (outputBuilder_ == null) { - if (!other.output_.isEmpty()) { - if (output_.isEmpty()) { - output_ = other.output_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputIsMutable(); - output_.addAll(other.output_); - } - onChanged(); - } - } else { - if (!other.output_.isEmpty()) { - if (outputBuilder_.isEmpty()) { - outputBuilder_.dispose(); - outputBuilder_ = null; - output_ = other.output_; - bitField0_ = (bitField0_ & ~0x00000002); - outputBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutputFieldBuilder() : null; - } else { - outputBuilder_.addAllMessages(other.output_); - } - } - } - if (!other.getTimelineLabel().isEmpty()) { - timelineLabel_ = other.timelineLabel_; - onChanged(); - } - if (other.getScheduledMicros() != 0L) { - setScheduledMicros(other.getScheduledMicros()); - } - if (other.getThreadId() != 0) { - setThreadId(other.getThreadId()); - } - if (referencedTensorBuilder_ == null) { - if (!other.referencedTensor_.isEmpty()) { - if (referencedTensor_.isEmpty()) { - referencedTensor_ = other.referencedTensor_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureReferencedTensorIsMutable(); - referencedTensor_.addAll(other.referencedTensor_); - } - onChanged(); - } - } else { - if (!other.referencedTensor_.isEmpty()) { - if (referencedTensorBuilder_.isEmpty()) { - referencedTensorBuilder_.dispose(); - referencedTensorBuilder_ = null; - referencedTensor_ = other.referencedTensor_; - bitField0_ = (bitField0_ & ~0x00000004); - referencedTensorBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getReferencedTensorFieldBuilder() : null; - } else { - referencedTensorBuilder_.addAllMessages(other.referencedTensor_); - } - } - } - if (other.hasMemoryStats()) { - mergeMemoryStats(other.getMemoryStats()); - } - if (other.getAllStartNanos() != 0L) { - setAllStartNanos(other.getAllStartNanos()); - } - if (other.getOpStartRelNanos() != 0L) { - setOpStartRelNanos(other.getOpStartRelNanos()); - } - if (other.getOpEndRelNanos() != 0L) { - setOpEndRelNanos(other.getOpEndRelNanos()); - } - if (other.getAllEndRelNanos() != 0L) { - setAllEndRelNanos(other.getAllEndRelNanos()); - } - if (other.getScheduledNanos() != 0L) { - setScheduledNanos(other.getScheduledNanos()); - } - 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.NodeExecStats parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NodeExecStats) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object nodeName_ = ""; - /** - *
    -     * TODO(tucker): Use some more compact form of node identity than
    -     * the full string name.  Either all processes should agree on a
    -     * global id (cost_id?) for each node, or we should use a hash of
    -     * the name.
    -     * 
    - * - * string node_name = 1; - */ - public java.lang.String getNodeName() { - java.lang.Object ref = nodeName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nodeName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * TODO(tucker): Use some more compact form of node identity than
    -     * the full string name.  Either all processes should agree on a
    -     * global id (cost_id?) for each node, or we should use a hash of
    -     * the name.
    -     * 
    - * - * string node_name = 1; - */ - public com.google.protobuf.ByteString - getNodeNameBytes() { - java.lang.Object ref = nodeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nodeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * TODO(tucker): Use some more compact form of node identity than
    -     * the full string name.  Either all processes should agree on a
    -     * global id (cost_id?) for each node, or we should use a hash of
    -     * the name.
    -     * 
    - * - * string node_name = 1; - */ - public Builder setNodeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nodeName_ = value; - onChanged(); - return this; - } - /** - *
    -     * TODO(tucker): Use some more compact form of node identity than
    -     * the full string name.  Either all processes should agree on a
    -     * global id (cost_id?) for each node, or we should use a hash of
    -     * the name.
    -     * 
    - * - * string node_name = 1; - */ - public Builder clearNodeName() { - - nodeName_ = getDefaultInstance().getNodeName(); - onChanged(); - return this; - } - /** - *
    -     * TODO(tucker): Use some more compact form of node identity than
    -     * the full string name.  Either all processes should agree on a
    -     * global id (cost_id?) for each node, or we should use a hash of
    -     * the name.
    -     * 
    - * - * string node_name = 1; - */ - public Builder setNodeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nodeName_ = value; - onChanged(); - return this; - } - - private long allStartMicros_ ; - /** - * int64 all_start_micros = 2; - */ - public long getAllStartMicros() { - return allStartMicros_; - } - /** - * int64 all_start_micros = 2; - */ - public Builder setAllStartMicros(long value) { - - allStartMicros_ = value; - onChanged(); - return this; - } - /** - * int64 all_start_micros = 2; - */ - public Builder clearAllStartMicros() { - - allStartMicros_ = 0L; - onChanged(); - return this; - } - - private long opStartRelMicros_ ; - /** - * int64 op_start_rel_micros = 3; - */ - public long getOpStartRelMicros() { - return opStartRelMicros_; - } - /** - * int64 op_start_rel_micros = 3; - */ - public Builder setOpStartRelMicros(long value) { - - opStartRelMicros_ = value; - onChanged(); - return this; - } - /** - * int64 op_start_rel_micros = 3; - */ - public Builder clearOpStartRelMicros() { - - opStartRelMicros_ = 0L; - onChanged(); - return this; - } - - private long opEndRelMicros_ ; - /** - * int64 op_end_rel_micros = 4; - */ - public long getOpEndRelMicros() { - return opEndRelMicros_; - } - /** - * int64 op_end_rel_micros = 4; - */ - public Builder setOpEndRelMicros(long value) { - - opEndRelMicros_ = value; - onChanged(); - return this; - } - /** - * int64 op_end_rel_micros = 4; - */ - public Builder clearOpEndRelMicros() { - - opEndRelMicros_ = 0L; - onChanged(); - return this; - } - - private long allEndRelMicros_ ; - /** - * int64 all_end_rel_micros = 5; - */ - public long getAllEndRelMicros() { - return allEndRelMicros_; - } - /** - * int64 all_end_rel_micros = 5; - */ - public Builder setAllEndRelMicros(long value) { - - allEndRelMicros_ = value; - onChanged(); - return this; - } - /** - * int64 all_end_rel_micros = 5; - */ - public Builder clearAllEndRelMicros() { - - allEndRelMicros_ = 0L; - onChanged(); - return this; - } - - private java.util.List memory_ = - java.util.Collections.emptyList(); - private void ensureMemoryIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - memory_ = new java.util.ArrayList(memory_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocatorMemoryUsed, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder, org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder> memoryBuilder_; - - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public java.util.List getMemoryList() { - if (memoryBuilder_ == null) { - return java.util.Collections.unmodifiableList(memory_); - } else { - return memoryBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public int getMemoryCount() { - if (memoryBuilder_ == null) { - return memory_.size(); - } else { - return memoryBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsed getMemory(int index) { - if (memoryBuilder_ == null) { - return memory_.get(index); - } else { - return memoryBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder setMemory( - int index, org.tensorflow.proto.framework.AllocatorMemoryUsed value) { - if (memoryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMemoryIsMutable(); - memory_.set(index, value); - onChanged(); - } else { - memoryBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder setMemory( - int index, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder builderForValue) { - if (memoryBuilder_ == null) { - ensureMemoryIsMutable(); - memory_.set(index, builderForValue.build()); - onChanged(); - } else { - memoryBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder addMemory(org.tensorflow.proto.framework.AllocatorMemoryUsed value) { - if (memoryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMemoryIsMutable(); - memory_.add(value); - onChanged(); - } else { - memoryBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder addMemory( - int index, org.tensorflow.proto.framework.AllocatorMemoryUsed value) { - if (memoryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMemoryIsMutable(); - memory_.add(index, value); - onChanged(); - } else { - memoryBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder addMemory( - org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder builderForValue) { - if (memoryBuilder_ == null) { - ensureMemoryIsMutable(); - memory_.add(builderForValue.build()); - onChanged(); - } else { - memoryBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder addMemory( - int index, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder builderForValue) { - if (memoryBuilder_ == null) { - ensureMemoryIsMutable(); - memory_.add(index, builderForValue.build()); - onChanged(); - } else { - memoryBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder addAllMemory( - java.lang.Iterable values) { - if (memoryBuilder_ == null) { - ensureMemoryIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, memory_); - onChanged(); - } else { - memoryBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder clearMemory() { - if (memoryBuilder_ == null) { - memory_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - memoryBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public Builder removeMemory(int index) { - if (memoryBuilder_ == null) { - ensureMemoryIsMutable(); - memory_.remove(index); - onChanged(); - } else { - memoryBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder getMemoryBuilder( - int index) { - return getMemoryFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( - int index) { - if (memoryBuilder_ == null) { - return memory_.get(index); } else { - return memoryBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public java.util.List - getMemoryOrBuilderList() { - if (memoryBuilder_ != null) { - return memoryBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(memory_); - } - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder addMemoryBuilder() { - return getMemoryFieldBuilder().addBuilder( - org.tensorflow.proto.framework.AllocatorMemoryUsed.getDefaultInstance()); - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder addMemoryBuilder( - int index) { - return getMemoryFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.AllocatorMemoryUsed.getDefaultInstance()); - } - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - public java.util.List - getMemoryBuilderList() { - return getMemoryFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocatorMemoryUsed, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder, org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder> - getMemoryFieldBuilder() { - if (memoryBuilder_ == null) { - memoryBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocatorMemoryUsed, org.tensorflow.proto.framework.AllocatorMemoryUsed.Builder, org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder>( - memory_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - memory_ = null; - } - return memoryBuilder_; - } - - private java.util.List output_ = - java.util.Collections.emptyList(); - private void ensureOutputIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - output_ = new java.util.ArrayList(output_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeOutput, org.tensorflow.proto.framework.NodeOutput.Builder, org.tensorflow.proto.framework.NodeOutputOrBuilder> outputBuilder_; - - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public java.util.List getOutputList() { - if (outputBuilder_ == null) { - return java.util.Collections.unmodifiableList(output_); - } else { - return outputBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public int getOutputCount() { - if (outputBuilder_ == null) { - return output_.size(); - } else { - return outputBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutput getOutput(int index) { - if (outputBuilder_ == null) { - return output_.get(index); - } else { - return outputBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder setOutput( - int index, org.tensorflow.proto.framework.NodeOutput value) { - if (outputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputIsMutable(); - output_.set(index, value); - onChanged(); - } else { - outputBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder setOutput( - int index, org.tensorflow.proto.framework.NodeOutput.Builder builderForValue) { - if (outputBuilder_ == null) { - ensureOutputIsMutable(); - output_.set(index, builderForValue.build()); - onChanged(); - } else { - outputBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder addOutput(org.tensorflow.proto.framework.NodeOutput value) { - if (outputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputIsMutable(); - output_.add(value); - onChanged(); - } else { - outputBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder addOutput( - int index, org.tensorflow.proto.framework.NodeOutput value) { - if (outputBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputIsMutable(); - output_.add(index, value); - onChanged(); - } else { - outputBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder addOutput( - org.tensorflow.proto.framework.NodeOutput.Builder builderForValue) { - if (outputBuilder_ == null) { - ensureOutputIsMutable(); - output_.add(builderForValue.build()); - onChanged(); - } else { - outputBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder addOutput( - int index, org.tensorflow.proto.framework.NodeOutput.Builder builderForValue) { - if (outputBuilder_ == null) { - ensureOutputIsMutable(); - output_.add(index, builderForValue.build()); - onChanged(); - } else { - outputBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder addAllOutput( - java.lang.Iterable values) { - if (outputBuilder_ == null) { - ensureOutputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, output_); - onChanged(); - } else { - outputBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder clearOutput() { - if (outputBuilder_ == null) { - output_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - outputBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public Builder removeOutput(int index) { - if (outputBuilder_ == null) { - ensureOutputIsMutable(); - output_.remove(index); - onChanged(); - } else { - outputBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutput.Builder getOutputBuilder( - int index) { - return getOutputFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutputOrBuilder getOutputOrBuilder( - int index) { - if (outputBuilder_ == null) { - return output_.get(index); } else { - return outputBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public java.util.List - getOutputOrBuilderList() { - if (outputBuilder_ != null) { - return outputBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(output_); - } - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutput.Builder addOutputBuilder() { - return getOutputFieldBuilder().addBuilder( - org.tensorflow.proto.framework.NodeOutput.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public org.tensorflow.proto.framework.NodeOutput.Builder addOutputBuilder( - int index) { - return getOutputFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.NodeOutput.getDefaultInstance()); - } - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - public java.util.List - getOutputBuilderList() { - return getOutputFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeOutput, org.tensorflow.proto.framework.NodeOutput.Builder, org.tensorflow.proto.framework.NodeOutputOrBuilder> - getOutputFieldBuilder() { - if (outputBuilder_ == null) { - outputBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.NodeOutput, org.tensorflow.proto.framework.NodeOutput.Builder, org.tensorflow.proto.framework.NodeOutputOrBuilder>( - output_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - output_ = null; - } - return outputBuilder_; - } - - private java.lang.Object timelineLabel_ = ""; - /** - * string timeline_label = 8; - */ - public java.lang.String getTimelineLabel() { - java.lang.Object ref = timelineLabel_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - timelineLabel_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string timeline_label = 8; - */ - public com.google.protobuf.ByteString - getTimelineLabelBytes() { - java.lang.Object ref = timelineLabel_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - timelineLabel_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string timeline_label = 8; - */ - public Builder setTimelineLabel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - timelineLabel_ = value; - onChanged(); - return this; - } - /** - * string timeline_label = 8; - */ - public Builder clearTimelineLabel() { - - timelineLabel_ = getDefaultInstance().getTimelineLabel(); - onChanged(); - return this; - } - /** - * string timeline_label = 8; - */ - public Builder setTimelineLabelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - timelineLabel_ = value; - onChanged(); - return this; - } - - private long scheduledMicros_ ; - /** - * int64 scheduled_micros = 9; - */ - public long getScheduledMicros() { - return scheduledMicros_; - } - /** - * int64 scheduled_micros = 9; - */ - public Builder setScheduledMicros(long value) { - - scheduledMicros_ = value; - onChanged(); - return this; - } - /** - * int64 scheduled_micros = 9; - */ - public Builder clearScheduledMicros() { - - scheduledMicros_ = 0L; - onChanged(); - return this; - } - - private int threadId_ ; - /** - * uint32 thread_id = 10; - */ - public int getThreadId() { - return threadId_; - } - /** - * uint32 thread_id = 10; - */ - public Builder setThreadId(int value) { - - threadId_ = value; - onChanged(); - return this; - } - /** - * uint32 thread_id = 10; - */ - public Builder clearThreadId() { - - threadId_ = 0; - onChanged(); - return this; - } - - private java.util.List referencedTensor_ = - java.util.Collections.emptyList(); - private void ensureReferencedTensorIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - referencedTensor_ = new java.util.ArrayList(referencedTensor_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder> referencedTensorBuilder_; - - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public java.util.List getReferencedTensorList() { - if (referencedTensorBuilder_ == null) { - return java.util.Collections.unmodifiableList(referencedTensor_); - } else { - return referencedTensorBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public int getReferencedTensorCount() { - if (referencedTensorBuilder_ == null) { - return referencedTensor_.size(); - } else { - return referencedTensorBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescription getReferencedTensor(int index) { - if (referencedTensorBuilder_ == null) { - return referencedTensor_.get(index); - } else { - return referencedTensorBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder setReferencedTensor( - int index, org.tensorflow.proto.framework.AllocationDescription value) { - if (referencedTensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReferencedTensorIsMutable(); - referencedTensor_.set(index, value); - onChanged(); - } else { - referencedTensorBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder setReferencedTensor( - int index, org.tensorflow.proto.framework.AllocationDescription.Builder builderForValue) { - if (referencedTensorBuilder_ == null) { - ensureReferencedTensorIsMutable(); - referencedTensor_.set(index, builderForValue.build()); - onChanged(); - } else { - referencedTensorBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder addReferencedTensor(org.tensorflow.proto.framework.AllocationDescription value) { - if (referencedTensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReferencedTensorIsMutable(); - referencedTensor_.add(value); - onChanged(); - } else { - referencedTensorBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder addReferencedTensor( - int index, org.tensorflow.proto.framework.AllocationDescription value) { - if (referencedTensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureReferencedTensorIsMutable(); - referencedTensor_.add(index, value); - onChanged(); - } else { - referencedTensorBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder addReferencedTensor( - org.tensorflow.proto.framework.AllocationDescription.Builder builderForValue) { - if (referencedTensorBuilder_ == null) { - ensureReferencedTensorIsMutable(); - referencedTensor_.add(builderForValue.build()); - onChanged(); - } else { - referencedTensorBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder addReferencedTensor( - int index, org.tensorflow.proto.framework.AllocationDescription.Builder builderForValue) { - if (referencedTensorBuilder_ == null) { - ensureReferencedTensorIsMutable(); - referencedTensor_.add(index, builderForValue.build()); - onChanged(); - } else { - referencedTensorBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder addAllReferencedTensor( - java.lang.Iterable values) { - if (referencedTensorBuilder_ == null) { - ensureReferencedTensorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, referencedTensor_); - onChanged(); - } else { - referencedTensorBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder clearReferencedTensor() { - if (referencedTensorBuilder_ == null) { - referencedTensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - referencedTensorBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public Builder removeReferencedTensor(int index) { - if (referencedTensorBuilder_ == null) { - ensureReferencedTensorIsMutable(); - referencedTensor_.remove(index); - onChanged(); - } else { - referencedTensorBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescription.Builder getReferencedTensorBuilder( - int index) { - return getReferencedTensorFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( - int index) { - if (referencedTensorBuilder_ == null) { - return referencedTensor_.get(index); } else { - return referencedTensorBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public java.util.List - getReferencedTensorOrBuilderList() { - if (referencedTensorBuilder_ != null) { - return referencedTensorBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(referencedTensor_); - } - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescription.Builder addReferencedTensorBuilder() { - return getReferencedTensorFieldBuilder().addBuilder( - org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance()); - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public org.tensorflow.proto.framework.AllocationDescription.Builder addReferencedTensorBuilder( - int index) { - return getReferencedTensorFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance()); - } - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - public java.util.List - getReferencedTensorBuilderList() { - return getReferencedTensorFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder> - getReferencedTensorFieldBuilder() { - if (referencedTensorBuilder_ == null) { - referencedTensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder>( - referencedTensor_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - referencedTensor_ = null; - } - return referencedTensorBuilder_; - } - - private org.tensorflow.proto.framework.MemoryStats memoryStats_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MemoryStats, org.tensorflow.proto.framework.MemoryStats.Builder, org.tensorflow.proto.framework.MemoryStatsOrBuilder> memoryStatsBuilder_; - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public boolean hasMemoryStats() { - return memoryStatsBuilder_ != null || memoryStats_ != null; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public org.tensorflow.proto.framework.MemoryStats getMemoryStats() { - if (memoryStatsBuilder_ == null) { - return memoryStats_ == null ? org.tensorflow.proto.framework.MemoryStats.getDefaultInstance() : memoryStats_; - } else { - return memoryStatsBuilder_.getMessage(); - } - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public Builder setMemoryStats(org.tensorflow.proto.framework.MemoryStats value) { - if (memoryStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - memoryStats_ = value; - onChanged(); - } else { - memoryStatsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public Builder setMemoryStats( - org.tensorflow.proto.framework.MemoryStats.Builder builderForValue) { - if (memoryStatsBuilder_ == null) { - memoryStats_ = builderForValue.build(); - onChanged(); - } else { - memoryStatsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public Builder mergeMemoryStats(org.tensorflow.proto.framework.MemoryStats value) { - if (memoryStatsBuilder_ == null) { - if (memoryStats_ != null) { - memoryStats_ = - org.tensorflow.proto.framework.MemoryStats.newBuilder(memoryStats_).mergeFrom(value).buildPartial(); - } else { - memoryStats_ = value; - } - onChanged(); - } else { - memoryStatsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public Builder clearMemoryStats() { - if (memoryStatsBuilder_ == null) { - memoryStats_ = null; - onChanged(); - } else { - memoryStats_ = null; - memoryStatsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public org.tensorflow.proto.framework.MemoryStats.Builder getMemoryStatsBuilder() { - - onChanged(); - return getMemoryStatsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - public org.tensorflow.proto.framework.MemoryStatsOrBuilder getMemoryStatsOrBuilder() { - if (memoryStatsBuilder_ != null) { - return memoryStatsBuilder_.getMessageOrBuilder(); - } else { - return memoryStats_ == null ? - org.tensorflow.proto.framework.MemoryStats.getDefaultInstance() : memoryStats_; - } - } - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MemoryStats, org.tensorflow.proto.framework.MemoryStats.Builder, org.tensorflow.proto.framework.MemoryStatsOrBuilder> - getMemoryStatsFieldBuilder() { - if (memoryStatsBuilder_ == null) { - memoryStatsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.MemoryStats, org.tensorflow.proto.framework.MemoryStats.Builder, org.tensorflow.proto.framework.MemoryStatsOrBuilder>( - getMemoryStats(), - getParentForChildren(), - isClean()); - memoryStats_ = null; - } - return memoryStatsBuilder_; - } - - private long allStartNanos_ ; - /** - * int64 all_start_nanos = 13; - */ - public long getAllStartNanos() { - return allStartNanos_; - } - /** - * int64 all_start_nanos = 13; - */ - public Builder setAllStartNanos(long value) { - - allStartNanos_ = value; - onChanged(); - return this; - } - /** - * int64 all_start_nanos = 13; - */ - public Builder clearAllStartNanos() { - - allStartNanos_ = 0L; - onChanged(); - return this; - } - - private long opStartRelNanos_ ; - /** - * int64 op_start_rel_nanos = 14; - */ - public long getOpStartRelNanos() { - return opStartRelNanos_; - } - /** - * int64 op_start_rel_nanos = 14; - */ - public Builder setOpStartRelNanos(long value) { - - opStartRelNanos_ = value; - onChanged(); - return this; - } - /** - * int64 op_start_rel_nanos = 14; - */ - public Builder clearOpStartRelNanos() { - - opStartRelNanos_ = 0L; - onChanged(); - return this; - } - - private long opEndRelNanos_ ; - /** - * int64 op_end_rel_nanos = 15; - */ - public long getOpEndRelNanos() { - return opEndRelNanos_; - } - /** - * int64 op_end_rel_nanos = 15; - */ - public Builder setOpEndRelNanos(long value) { - - opEndRelNanos_ = value; - onChanged(); - return this; - } - /** - * int64 op_end_rel_nanos = 15; - */ - public Builder clearOpEndRelNanos() { - - opEndRelNanos_ = 0L; - onChanged(); - return this; - } - - private long allEndRelNanos_ ; - /** - * int64 all_end_rel_nanos = 16; - */ - public long getAllEndRelNanos() { - return allEndRelNanos_; - } - /** - * int64 all_end_rel_nanos = 16; - */ - public Builder setAllEndRelNanos(long value) { - - allEndRelNanos_ = value; - onChanged(); - return this; - } - /** - * int64 all_end_rel_nanos = 16; - */ - public Builder clearAllEndRelNanos() { - - allEndRelNanos_ = 0L; - onChanged(); - return this; - } - - private long scheduledNanos_ ; - /** - * int64 scheduled_nanos = 17; - */ - public long getScheduledNanos() { - return scheduledNanos_; - } - /** - * int64 scheduled_nanos = 17; - */ - public Builder setScheduledNanos(long value) { - - scheduledNanos_ = value; - onChanged(); - return this; - } - /** - * int64 scheduled_nanos = 17; - */ - public Builder clearScheduledNanos() { - - scheduledNanos_ = 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.NodeExecStats) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NodeExecStats) - private static final org.tensorflow.proto.framework.NodeExecStats DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NodeExecStats(); - } - - public static org.tensorflow.proto.framework.NodeExecStats getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NodeExecStats parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NodeExecStats(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.NodeExecStats getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStatsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStatsOrBuilder.java deleted file mode 100644 index 60be2e49270..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeExecStatsOrBuilder.java +++ /dev/null @@ -1,183 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -public interface NodeExecStatsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NodeExecStats) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * TODO(tucker): Use some more compact form of node identity than
    -   * the full string name.  Either all processes should agree on a
    -   * global id (cost_id?) for each node, or we should use a hash of
    -   * the name.
    -   * 
    - * - * string node_name = 1; - */ - java.lang.String getNodeName(); - /** - *
    -   * TODO(tucker): Use some more compact form of node identity than
    -   * the full string name.  Either all processes should agree on a
    -   * global id (cost_id?) for each node, or we should use a hash of
    -   * the name.
    -   * 
    - * - * string node_name = 1; - */ - com.google.protobuf.ByteString - getNodeNameBytes(); - - /** - * int64 all_start_micros = 2; - */ - long getAllStartMicros(); - - /** - * int64 op_start_rel_micros = 3; - */ - long getOpStartRelMicros(); - - /** - * int64 op_end_rel_micros = 4; - */ - long getOpEndRelMicros(); - - /** - * int64 all_end_rel_micros = 5; - */ - long getAllEndRelMicros(); - - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - java.util.List - getMemoryList(); - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - org.tensorflow.proto.framework.AllocatorMemoryUsed getMemory(int index); - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - int getMemoryCount(); - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - java.util.List - getMemoryOrBuilderList(); - /** - * repeated .tensorflow.AllocatorMemoryUsed memory = 6; - */ - org.tensorflow.proto.framework.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( - int index); - - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - java.util.List - getOutputList(); - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - org.tensorflow.proto.framework.NodeOutput getOutput(int index); - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - int getOutputCount(); - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - java.util.List - getOutputOrBuilderList(); - /** - * repeated .tensorflow.NodeOutput output = 7; - */ - org.tensorflow.proto.framework.NodeOutputOrBuilder getOutputOrBuilder( - int index); - - /** - * string timeline_label = 8; - */ - java.lang.String getTimelineLabel(); - /** - * string timeline_label = 8; - */ - com.google.protobuf.ByteString - getTimelineLabelBytes(); - - /** - * int64 scheduled_micros = 9; - */ - long getScheduledMicros(); - - /** - * uint32 thread_id = 10; - */ - int getThreadId(); - - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - java.util.List - getReferencedTensorList(); - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - org.tensorflow.proto.framework.AllocationDescription getReferencedTensor(int index); - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - int getReferencedTensorCount(); - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - java.util.List - getReferencedTensorOrBuilderList(); - /** - * repeated .tensorflow.AllocationDescription referenced_tensor = 11; - */ - org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( - int index); - - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - boolean hasMemoryStats(); - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - org.tensorflow.proto.framework.MemoryStats getMemoryStats(); - /** - * .tensorflow.MemoryStats memory_stats = 12; - */ - org.tensorflow.proto.framework.MemoryStatsOrBuilder getMemoryStatsOrBuilder(); - - /** - * int64 all_start_nanos = 13; - */ - long getAllStartNanos(); - - /** - * int64 op_start_rel_nanos = 14; - */ - long getOpStartRelNanos(); - - /** - * int64 op_end_rel_nanos = 15; - */ - long getOpEndRelNanos(); - - /** - * int64 all_end_rel_nanos = 16; - */ - long getAllEndRelNanos(); - - /** - * int64 scheduled_nanos = 17; - */ - long getScheduledNanos(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutput.java deleted file mode 100644 index c6e38aaec46..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutput.java +++ /dev/null @@ -1,665 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Output sizes recorded for a single execution of a graph node.
    - * 
    - * - * Protobuf type {@code tensorflow.NodeOutput} - */ -public final class NodeOutput extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NodeOutput) - NodeOutputOrBuilder { -private static final long serialVersionUID = 0L; - // Use NodeOutput.newBuilder() to construct. - private NodeOutput(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NodeOutput() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NodeOutput(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NodeOutput( - 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: { - - slot_ = input.readInt32(); - break; - } - case 26: { - org.tensorflow.proto.framework.TensorDescription.Builder subBuilder = null; - if (tensorDescription_ != null) { - subBuilder = tensorDescription_.toBuilder(); - } - tensorDescription_ = input.readMessage(org.tensorflow.proto.framework.TensorDescription.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorDescription_); - tensorDescription_ = subBuilder.buildPartial(); - } - - 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.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeOutput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeOutput.class, org.tensorflow.proto.framework.NodeOutput.Builder.class); - } - - public static final int SLOT_FIELD_NUMBER = 1; - private int slot_; - /** - * int32 slot = 1; - */ - public int getSlot() { - return slot_; - } - - public static final int TENSOR_DESCRIPTION_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorDescription tensorDescription_; - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public boolean hasTensorDescription() { - return tensorDescription_ != null; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public org.tensorflow.proto.framework.TensorDescription getTensorDescription() { - return tensorDescription_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensorDescription_; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder() { - return getTensorDescription(); - } - - 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 (slot_ != 0) { - output.writeInt32(1, slot_); - } - if (tensorDescription_ != null) { - output.writeMessage(3, getTensorDescription()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (slot_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, slot_); - } - if (tensorDescription_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTensorDescription()); - } - 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.NodeOutput)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NodeOutput other = (org.tensorflow.proto.framework.NodeOutput) obj; - - if (getSlot() - != other.getSlot()) return false; - if (hasTensorDescription() != other.hasTensorDescription()) return false; - if (hasTensorDescription()) { - if (!getTensorDescription() - .equals(other.getTensorDescription())) 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) + SLOT_FIELD_NUMBER; - hash = (53 * hash) + getSlot(); - if (hasTensorDescription()) { - hash = (37 * hash) + TENSOR_DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getTensorDescription().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NodeOutput parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeOutput 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.NodeOutput parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeOutput 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.NodeOutput parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NodeOutput parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NodeOutput parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeOutput 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.NodeOutput parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeOutput 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.NodeOutput parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NodeOutput 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.NodeOutput 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; - } - /** - *
    -   * Output sizes recorded for a single execution of a graph node.
    -   * 
    - * - * Protobuf type {@code tensorflow.NodeOutput} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NodeOutput) - org.tensorflow.proto.framework.NodeOutputOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeOutput_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NodeOutput.class, org.tensorflow.proto.framework.NodeOutput.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NodeOutput.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(); - slot_ = 0; - - if (tensorDescriptionBuilder_ == null) { - tensorDescription_ = null; - } else { - tensorDescription_ = null; - tensorDescriptionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeOutput getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NodeOutput.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeOutput build() { - org.tensorflow.proto.framework.NodeOutput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NodeOutput buildPartial() { - org.tensorflow.proto.framework.NodeOutput result = new org.tensorflow.proto.framework.NodeOutput(this); - result.slot_ = slot_; - if (tensorDescriptionBuilder_ == null) { - result.tensorDescription_ = tensorDescription_; - } else { - result.tensorDescription_ = tensorDescriptionBuilder_.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.NodeOutput) { - return mergeFrom((org.tensorflow.proto.framework.NodeOutput)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NodeOutput other) { - if (other == org.tensorflow.proto.framework.NodeOutput.getDefaultInstance()) return this; - if (other.getSlot() != 0) { - setSlot(other.getSlot()); - } - if (other.hasTensorDescription()) { - mergeTensorDescription(other.getTensorDescription()); - } - 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.NodeOutput parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NodeOutput) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int slot_ ; - /** - * int32 slot = 1; - */ - public int getSlot() { - return slot_; - } - /** - * int32 slot = 1; - */ - public Builder setSlot(int value) { - - slot_ = value; - onChanged(); - return this; - } - /** - * int32 slot = 1; - */ - public Builder clearSlot() { - - slot_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorDescription tensorDescription_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> tensorDescriptionBuilder_; - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public boolean hasTensorDescription() { - return tensorDescriptionBuilder_ != null || tensorDescription_ != null; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public org.tensorflow.proto.framework.TensorDescription getTensorDescription() { - if (tensorDescriptionBuilder_ == null) { - return tensorDescription_ == null ? org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensorDescription_; - } else { - return tensorDescriptionBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public Builder setTensorDescription(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorDescriptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorDescription_ = value; - onChanged(); - } else { - tensorDescriptionBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public Builder setTensorDescription( - org.tensorflow.proto.framework.TensorDescription.Builder builderForValue) { - if (tensorDescriptionBuilder_ == null) { - tensorDescription_ = builderForValue.build(); - onChanged(); - } else { - tensorDescriptionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public Builder mergeTensorDescription(org.tensorflow.proto.framework.TensorDescription value) { - if (tensorDescriptionBuilder_ == null) { - if (tensorDescription_ != null) { - tensorDescription_ = - org.tensorflow.proto.framework.TensorDescription.newBuilder(tensorDescription_).mergeFrom(value).buildPartial(); - } else { - tensorDescription_ = value; - } - onChanged(); - } else { - tensorDescriptionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public Builder clearTensorDescription() { - if (tensorDescriptionBuilder_ == null) { - tensorDescription_ = null; - onChanged(); - } else { - tensorDescription_ = null; - tensorDescriptionBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public org.tensorflow.proto.framework.TensorDescription.Builder getTensorDescriptionBuilder() { - - onChanged(); - return getTensorDescriptionFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - public org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder() { - if (tensorDescriptionBuilder_ != null) { - return tensorDescriptionBuilder_.getMessageOrBuilder(); - } else { - return tensorDescription_ == null ? - org.tensorflow.proto.framework.TensorDescription.getDefaultInstance() : tensorDescription_; - } - } - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder> - getTensorDescriptionFieldBuilder() { - if (tensorDescriptionBuilder_ == null) { - tensorDescriptionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorDescription, org.tensorflow.proto.framework.TensorDescription.Builder, org.tensorflow.proto.framework.TensorDescriptionOrBuilder>( - getTensorDescription(), - getParentForChildren(), - isClean()); - tensorDescription_ = null; - } - return tensorDescriptionBuilder_; - } - @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.NodeOutput) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NodeOutput) - private static final org.tensorflow.proto.framework.NodeOutput DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NodeOutput(); - } - - public static org.tensorflow.proto.framework.NodeOutput getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NodeOutput parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NodeOutput(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.NodeOutput getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutputOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutputOrBuilder.java deleted file mode 100644 index 940f8defed7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeOutputOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -public interface NodeOutputOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NodeOutput) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 slot = 1; - */ - int getSlot(); - - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - boolean hasTensorDescription(); - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - org.tensorflow.proto.framework.TensorDescription getTensorDescription(); - /** - * .tensorflow.TensorDescription tensor_description = 3; - */ - org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeProto.java deleted file mode 100644 index ef4be3729ea..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeProto.java +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/node_def.proto - -package org.tensorflow.proto.framework; - -public final class NodeProto { - private NodeProto() {} - 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_NodeDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NodeDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NodeDef_AttrEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NodeDef_AttrEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_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/framework/node_def.pro" + - "to\022\ntensorflow\032*tensorflow/core/framewor" + - "k/attr_value.proto\"\322\002\n\007NodeDef\022\014\n\004name\030\001" + - " \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006devic" + - "e\030\004 \001(\t\022+\n\004attr\030\005 \003(\0132\035.tensorflow.NodeD" + - "ef.AttrEntry\022J\n\027experimental_debug_info\030" + - "\006 \001(\0132).tensorflow.NodeDef.ExperimentalD" + - "ebugInfo\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022$\n\005va" + - "lue\030\002 \001(\0132\025.tensorflow.AttrValue:\0028\001\032Q\n\025" + - "ExperimentalDebugInfo\022\033\n\023original_node_n" + - "ames\030\001 \003(\t\022\033\n\023original_func_names\030\002 \003(\tB" + - "\201\001\n\036org.tensorflow.proto.frameworkB\tNode" + - "ProtoP\001ZOgithub.com/tensorflow/tensorflo" + - "w/tensorflow/go/core/framework/node_def_" + - "go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - }); - internal_static_tensorflow_NodeDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_NodeDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NodeDef_descriptor, - new java.lang.String[] { "Name", "Op", "Input", "Device", "Attr", "ExperimentalDebugInfo", }); - internal_static_tensorflow_NodeDef_AttrEntry_descriptor = - internal_static_tensorflow_NodeDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_NodeDef_AttrEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NodeDef_AttrEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor = - internal_static_tensorflow_NodeDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor, - new java.lang.String[] { "OriginalNodeNames", "OriginalFuncNames", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValue.java deleted file mode 100644 index 7aaba25f2d2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValue.java +++ /dev/null @@ -1,427 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents None.
    - * 
    - * - * Protobuf type {@code tensorflow.NoneValue} - */ -public final class NoneValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NoneValue) - NoneValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use NoneValue.newBuilder() to construct. - private NoneValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NoneValue() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NoneValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NoneValue( - 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; - 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.StructProtos.internal_static_tensorflow_NoneValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NoneValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NoneValue.class, org.tensorflow.proto.framework.NoneValue.Builder.class); - } - - 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 { - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - 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.NoneValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NoneValue other = (org.tensorflow.proto.framework.NoneValue) obj; - - 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 = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NoneValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NoneValue 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.NoneValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NoneValue 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.NoneValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NoneValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NoneValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NoneValue 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.NoneValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NoneValue 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.NoneValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NoneValue 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.NoneValue 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; - } - /** - *
    -   * Represents None.
    -   * 
    - * - * Protobuf type {@code tensorflow.NoneValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NoneValue) - org.tensorflow.proto.framework.NoneValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NoneValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NoneValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NoneValue.class, org.tensorflow.proto.framework.NoneValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NoneValue.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(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_NoneValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NoneValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NoneValue build() { - org.tensorflow.proto.framework.NoneValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NoneValue buildPartial() { - org.tensorflow.proto.framework.NoneValue result = new org.tensorflow.proto.framework.NoneValue(this); - 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.NoneValue) { - return mergeFrom((org.tensorflow.proto.framework.NoneValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NoneValue other) { - if (other == org.tensorflow.proto.framework.NoneValue.getDefaultInstance()) return this; - 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.NoneValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NoneValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - 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.NoneValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NoneValue) - private static final org.tensorflow.proto.framework.NoneValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NoneValue(); - } - - public static org.tensorflow.proto.framework.NoneValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NoneValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NoneValue(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.NoneValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValueOrBuilder.java deleted file mode 100644 index 3d720d0c269..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NoneValueOrBuilder.java +++ /dev/null @@ -1,9 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface NoneValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NoneValue) - com.google.protobuf.MessageOrBuilder { -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistribution.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistribution.java deleted file mode 100644 index 976cb57df20..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistribution.java +++ /dev/null @@ -1,537 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.NormalDistribution} - */ -public final class NormalDistribution extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NormalDistribution) - NormalDistributionOrBuilder { -private static final long serialVersionUID = 0L; - // Use NormalDistribution.newBuilder() to construct. - private NormalDistribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NormalDistribution() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new NormalDistribution(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NormalDistribution( - 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 9: { - - mu_ = input.readDouble(); - break; - } - case 17: { - - sigma_ = input.readDouble(); - 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.OpPerformanceDataProtos.internal_static_tensorflow_NormalDistribution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_NormalDistribution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NormalDistribution.class, org.tensorflow.proto.framework.NormalDistribution.Builder.class); - } - - public static final int MU_FIELD_NUMBER = 1; - private double mu_; - /** - * double mu = 1; - */ - public double getMu() { - return mu_; - } - - public static final int SIGMA_FIELD_NUMBER = 2; - private double sigma_; - /** - * double sigma = 2; - */ - public double getSigma() { - return sigma_; - } - - 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 (mu_ != 0D) { - output.writeDouble(1, mu_); - } - if (sigma_ != 0D) { - output.writeDouble(2, sigma_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (mu_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, mu_); - } - if (sigma_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, sigma_); - } - 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.NormalDistribution)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.NormalDistribution other = (org.tensorflow.proto.framework.NormalDistribution) obj; - - if (java.lang.Double.doubleToLongBits(getMu()) - != java.lang.Double.doubleToLongBits( - other.getMu())) return false; - if (java.lang.Double.doubleToLongBits(getSigma()) - != java.lang.Double.doubleToLongBits( - other.getSigma())) 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) + MU_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMu())); - hash = (37 * hash) + SIGMA_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getSigma())); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.NormalDistribution parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NormalDistribution 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.NormalDistribution parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NormalDistribution 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.NormalDistribution parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.NormalDistribution parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.NormalDistribution parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NormalDistribution 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.NormalDistribution parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NormalDistribution 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.NormalDistribution parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.NormalDistribution 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.NormalDistribution 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.NormalDistribution} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NormalDistribution) - org.tensorflow.proto.framework.NormalDistributionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_NormalDistribution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_NormalDistribution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.NormalDistribution.class, org.tensorflow.proto.framework.NormalDistribution.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NormalDistribution.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(); - mu_ = 0D; - - sigma_ = 0D; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_NormalDistribution_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NormalDistribution getDefaultInstanceForType() { - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.NormalDistribution build() { - org.tensorflow.proto.framework.NormalDistribution result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.NormalDistribution buildPartial() { - org.tensorflow.proto.framework.NormalDistribution result = new org.tensorflow.proto.framework.NormalDistribution(this); - result.mu_ = mu_; - result.sigma_ = sigma_; - 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.NormalDistribution) { - return mergeFrom((org.tensorflow.proto.framework.NormalDistribution)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.NormalDistribution other) { - if (other == org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance()) return this; - if (other.getMu() != 0D) { - setMu(other.getMu()); - } - if (other.getSigma() != 0D) { - setSigma(other.getSigma()); - } - 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.NormalDistribution parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.NormalDistribution) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private double mu_ ; - /** - * double mu = 1; - */ - public double getMu() { - return mu_; - } - /** - * double mu = 1; - */ - public Builder setMu(double value) { - - mu_ = value; - onChanged(); - return this; - } - /** - * double mu = 1; - */ - public Builder clearMu() { - - mu_ = 0D; - onChanged(); - return this; - } - - private double sigma_ ; - /** - * double sigma = 2; - */ - public double getSigma() { - return sigma_; - } - /** - * double sigma = 2; - */ - public Builder setSigma(double value) { - - sigma_ = value; - onChanged(); - return this; - } - /** - * double sigma = 2; - */ - public Builder clearSigma() { - - sigma_ = 0D; - 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.NormalDistribution) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NormalDistribution) - private static final org.tensorflow.proto.framework.NormalDistribution DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.NormalDistribution(); - } - - public static org.tensorflow.proto.framework.NormalDistribution getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public NormalDistribution parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NormalDistribution(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.NormalDistribution getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistributionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistributionOrBuilder.java deleted file mode 100644 index 4b2c75b1f24..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NormalDistributionOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface NormalDistributionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NormalDistribution) - com.google.protobuf.MessageOrBuilder { - - /** - * double mu = 1; - */ - double getMu(); - - /** - * double sigma = 2; - */ - double getSigma(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDef.java deleted file mode 100644 index ce9b08d33be..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDef.java +++ /dev/null @@ -1,7207 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    - * using the "op" field which should match the name of a OpDef.
    - * LINT.IfChange
    - * 
    - * - * Protobuf type {@code tensorflow.OpDef} - */ -public final class OpDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef) - OpDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpDef.newBuilder() to construct. - private OpDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpDef() { - name_ = ""; - inputArg_ = java.util.Collections.emptyList(); - outputArg_ = java.util.Collections.emptyList(); - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - attr_ = java.util.Collections.emptyList(); - summary_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpDef( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - inputArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - inputArg_.add( - input.readMessage(org.tensorflow.proto.framework.OpDef.ArgDef.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - outputArg_.add( - input.readMessage(org.tensorflow.proto.framework.OpDef.ArgDef.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - attr_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - attr_.add( - input.readMessage(org.tensorflow.proto.framework.OpDef.AttrDef.parser(), extensionRegistry)); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - summary_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 66: { - org.tensorflow.proto.framework.OpDeprecation.Builder subBuilder = null; - if (deprecation_ != null) { - subBuilder = deprecation_.toBuilder(); - } - deprecation_ = input.readMessage(org.tensorflow.proto.framework.OpDeprecation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deprecation_); - deprecation_ = subBuilder.buildPartial(); - } - - break; - } - case 128: { - - isAggregate_ = input.readBool(); - break; - } - case 136: { - - isStateful_ = input.readBool(); - break; - } - case 144: { - - isCommutative_ = input.readBool(); - break; - } - case 152: { - - allowsUninitializedInput_ = input.readBool(); - break; - } - case 162: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - controlOutput_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - controlOutput_.add(s); - break; - } - case 168: { - - isDistributedCommunication_ = input.readBool(); - 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)) { - inputArg_ = java.util.Collections.unmodifiableList(inputArg_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - outputArg_ = java.util.Collections.unmodifiableList(outputArg_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - controlOutput_ = controlOutput_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.class, org.tensorflow.proto.framework.OpDef.Builder.class); - } - - public interface ArgDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.ArgDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - java.lang.String getDescription(); - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - int getTypeValue(); - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - org.tensorflow.proto.framework.DataType getType(); - - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - java.lang.String getTypeAttr(); - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - com.google.protobuf.ByteString - getTypeAttrBytes(); - - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - java.lang.String getNumberAttr(); - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - com.google.protobuf.ByteString - getNumberAttrBytes(); - - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - java.lang.String getTypeListAttr(); - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - com.google.protobuf.ByteString - getTypeListAttrBytes(); - - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - java.util.List - getHandleDataList(); - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getHandleData(int index); - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - int getHandleDataCount(); - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - java.util.List - getHandleDataOrBuilderList(); - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( - int index); - - /** - *
    -     * For inputs: if true, the inputs are required to be refs.
    -     *   By default, inputs can be either refs or non-refs.
    -     * For outputs: if true, outputs are refs, otherwise they are not.
    -     * 
    - * - * bool is_ref = 16; - */ - boolean getIsRef(); - - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - boolean hasExperimentalFullType(); - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - org.tensorflow.proto.framework.FullTypeDef getExperimentalFullType(); - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - org.tensorflow.proto.framework.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder(); - } - /** - *
    -   * For describing inputs and outputs.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef.ArgDef} - */ - public static final class ArgDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef.ArgDef) - ArgDefOrBuilder { - private static final long serialVersionUID = 0L; - // Use ArgDef.newBuilder() to construct. - private ArgDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ArgDef() { - name_ = ""; - description_ = ""; - type_ = 0; - typeAttr_ = ""; - numberAttr_ = ""; - typeListAttr_ = ""; - handleData_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ArgDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ArgDef( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 24: { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - typeAttr_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - numberAttr_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - typeListAttr_ = s; - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - handleData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - handleData_.add( - input.readMessage(org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.parser(), extensionRegistry)); - break; - } - case 128: { - - isRef_ = input.readBool(); - break; - } - case 138: { - org.tensorflow.proto.framework.FullTypeDef.Builder subBuilder = null; - if (experimentalFullType_ != null) { - subBuilder = experimentalFullType_.toBuilder(); - } - experimentalFullType_ = input.readMessage(org.tensorflow.proto.framework.FullTypeDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(experimentalFullType_); - experimentalFullType_ = subBuilder.buildPartial(); - } - - 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)) { - handleData_ = java.util.Collections.unmodifiableList(handleData_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.ArgDef.class, org.tensorflow.proto.framework.OpDef.ArgDef.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * 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 DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 3; - private int type_; - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public org.tensorflow.proto.framework.DataType getType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(type_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int TYPE_ATTR_FIELD_NUMBER = 4; - private volatile java.lang.Object typeAttr_; - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - public java.lang.String getTypeAttr() { - java.lang.Object ref = typeAttr_; - 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(); - typeAttr_ = s; - return s; - } - } - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - public com.google.protobuf.ByteString - getTypeAttrBytes() { - java.lang.Object ref = typeAttr_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NUMBER_ATTR_FIELD_NUMBER = 5; - private volatile java.lang.Object numberAttr_; - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - public java.lang.String getNumberAttr() { - java.lang.Object ref = numberAttr_; - 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(); - numberAttr_ = s; - return s; - } - } - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - public com.google.protobuf.ByteString - getNumberAttrBytes() { - java.lang.Object ref = numberAttr_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - numberAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_LIST_ATTR_FIELD_NUMBER = 6; - private volatile java.lang.Object typeListAttr_; - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - public java.lang.String getTypeListAttr() { - java.lang.Object ref = typeListAttr_; - 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(); - typeListAttr_ = s; - return s; - } - } - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - public com.google.protobuf.ByteString - getTypeListAttrBytes() { - java.lang.Object ref = typeListAttr_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeListAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HANDLE_DATA_FIELD_NUMBER = 7; - private java.util.List handleData_; - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public java.util.List getHandleDataList() { - return handleData_; - } - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public java.util.List - getHandleDataOrBuilderList() { - return handleData_; - } - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public int getHandleDataCount() { - return handleData_.size(); - } - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getHandleData(int index) { - return handleData_.get(index); - } - /** - *
    -     * The handle data for resource inputs.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( - int index) { - return handleData_.get(index); - } - - public static final int IS_REF_FIELD_NUMBER = 16; - private boolean isRef_; - /** - *
    -     * For inputs: if true, the inputs are required to be refs.
    -     *   By default, inputs can be either refs or non-refs.
    -     * For outputs: if true, outputs are refs, otherwise they are not.
    -     * 
    - * - * bool is_ref = 16; - */ - public boolean getIsRef() { - return isRef_; - } - - public static final int EXPERIMENTAL_FULL_TYPE_FIELD_NUMBER = 17; - private org.tensorflow.proto.framework.FullTypeDef experimentalFullType_; - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public boolean hasExperimentalFullType() { - return experimentalFullType_ != null; - } - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public org.tensorflow.proto.framework.FullTypeDef getExperimentalFullType() { - return experimentalFullType_ == null ? org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance() : experimentalFullType_; - } - /** - *
    -     * Experimental. Full type declaration for this argument.
    -     * The full type specification combines type, type_attr, type_list_attr,
    -     * etc. into a unified representation.
    -     * This declaration may contain non-concrete types (for example,
    -     * Tensor<TypeVar<'T'>> is a valid type declaration.
    -     * Note: this is a transient field. The long-term aim is to represent the
    -     * entire OpDef as a single type: a callable. In that context, this field is
    -     * just the type of a single argument.
    -     * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public org.tensorflow.proto.framework.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder() { - return getExperimentalFullType(); - } - - 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 (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); - } - if (type_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, type_); - } - if (!getTypeAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, typeAttr_); - } - if (!getNumberAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, numberAttr_); - } - if (!getTypeListAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, typeListAttr_); - } - for (int i = 0; i < handleData_.size(); i++) { - output.writeMessage(7, handleData_.get(i)); - } - if (isRef_ != false) { - output.writeBool(16, isRef_); - } - if (experimentalFullType_ != null) { - output.writeMessage(17, getExperimentalFullType()); - } - 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 (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); - } - if (type_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, type_); - } - if (!getTypeAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, typeAttr_); - } - if (!getNumberAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, numberAttr_); - } - if (!getTypeListAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, typeListAttr_); - } - for (int i = 0; i < handleData_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, handleData_.get(i)); - } - if (isRef_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, isRef_); - } - if (experimentalFullType_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(17, getExperimentalFullType()); - } - 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.OpDef.ArgDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpDef.ArgDef other = (org.tensorflow.proto.framework.OpDef.ArgDef) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (type_ != other.type_) return false; - if (!getTypeAttr() - .equals(other.getTypeAttr())) return false; - if (!getNumberAttr() - .equals(other.getNumberAttr())) return false; - if (!getTypeListAttr() - .equals(other.getTypeListAttr())) return false; - if (!getHandleDataList() - .equals(other.getHandleDataList())) return false; - if (getIsRef() - != other.getIsRef()) return false; - if (hasExperimentalFullType() != other.hasExperimentalFullType()) return false; - if (hasExperimentalFullType()) { - if (!getExperimentalFullType() - .equals(other.getExperimentalFullType())) 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) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + TYPE_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getTypeAttr().hashCode(); - hash = (37 * hash) + NUMBER_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getNumberAttr().hashCode(); - hash = (37 * hash) + TYPE_LIST_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getTypeListAttr().hashCode(); - if (getHandleDataCount() > 0) { - hash = (37 * hash) + HANDLE_DATA_FIELD_NUMBER; - hash = (53 * hash) + getHandleDataList().hashCode(); - } - hash = (37 * hash) + IS_REF_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsRef()); - if (hasExperimentalFullType()) { - hash = (37 * hash) + EXPERIMENTAL_FULL_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getExperimentalFullType().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpDef.ArgDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef 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.OpDef.ArgDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef 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.OpDef.ArgDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef 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.OpDef.ArgDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef 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.OpDef.ArgDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.ArgDef 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.OpDef.ArgDef 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; - } - /** - *
    -     * For describing inputs and outputs.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpDef.ArgDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.ArgDef) - org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.ArgDef.class, org.tensorflow.proto.framework.OpDef.ArgDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.ArgDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getHandleDataFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - type_ = 0; - - typeAttr_ = ""; - - numberAttr_ = ""; - - typeListAttr_ = ""; - - if (handleDataBuilder_ == null) { - handleData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - handleDataBuilder_.clear(); - } - isRef_ = false; - - if (experimentalFullTypeBuilder_ == null) { - experimentalFullType_ = null; - } else { - experimentalFullType_ = null; - experimentalFullTypeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.ArgDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.ArgDef build() { - org.tensorflow.proto.framework.OpDef.ArgDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.ArgDef buildPartial() { - org.tensorflow.proto.framework.OpDef.ArgDef result = new org.tensorflow.proto.framework.OpDef.ArgDef(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.description_ = description_; - result.type_ = type_; - result.typeAttr_ = typeAttr_; - result.numberAttr_ = numberAttr_; - result.typeListAttr_ = typeListAttr_; - if (handleDataBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - handleData_ = java.util.Collections.unmodifiableList(handleData_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.handleData_ = handleData_; - } else { - result.handleData_ = handleDataBuilder_.build(); - } - result.isRef_ = isRef_; - if (experimentalFullTypeBuilder_ == null) { - result.experimentalFullType_ = experimentalFullType_; - } else { - result.experimentalFullType_ = experimentalFullTypeBuilder_.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.OpDef.ArgDef) { - return mergeFrom((org.tensorflow.proto.framework.OpDef.ArgDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpDef.ArgDef other) { - if (other == org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (!other.getTypeAttr().isEmpty()) { - typeAttr_ = other.typeAttr_; - onChanged(); - } - if (!other.getNumberAttr().isEmpty()) { - numberAttr_ = other.numberAttr_; - onChanged(); - } - if (!other.getTypeListAttr().isEmpty()) { - typeListAttr_ = other.typeListAttr_; - onChanged(); - } - if (handleDataBuilder_ == null) { - if (!other.handleData_.isEmpty()) { - if (handleData_.isEmpty()) { - handleData_ = other.handleData_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureHandleDataIsMutable(); - handleData_.addAll(other.handleData_); - } - onChanged(); - } - } else { - if (!other.handleData_.isEmpty()) { - if (handleDataBuilder_.isEmpty()) { - handleDataBuilder_.dispose(); - handleDataBuilder_ = null; - handleData_ = other.handleData_; - bitField0_ = (bitField0_ & ~0x00000001); - handleDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getHandleDataFieldBuilder() : null; - } else { - handleDataBuilder_.addAllMessages(other.handleData_); - } - } - } - if (other.getIsRef() != false) { - setIsRef(other.getIsRef()); - } - if (other.hasExperimentalFullType()) { - mergeExperimentalFullType(other.getExperimentalFullType()); - } - 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.OpDef.ArgDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpDef.ArgDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * 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; - } - } - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * 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 java.lang.Object description_ = ""; - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private int type_ = 0; - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setTypeValue(int value) { - type_ = value; - onChanged(); - return this; - } - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public org.tensorflow.proto.framework.DataType getType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(type_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setType(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private java.lang.Object typeAttr_ = ""; - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public java.lang.String getTypeAttr() { - java.lang.Object ref = typeAttr_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeAttr_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public com.google.protobuf.ByteString - getTypeAttrBytes() { - java.lang.Object ref = typeAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder setTypeAttr( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeAttr_ = value; - onChanged(); - return this; - } - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder clearTypeAttr() { - - typeAttr_ = getDefaultInstance().getTypeAttr(); - onChanged(); - return this; - } - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder setTypeAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeAttr_ = value; - onChanged(); - return this; - } - - private java.lang.Object numberAttr_ = ""; - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public java.lang.String getNumberAttr() { - java.lang.Object ref = numberAttr_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - numberAttr_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public com.google.protobuf.ByteString - getNumberAttrBytes() { - java.lang.Object ref = numberAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - numberAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder setNumberAttr( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - numberAttr_ = value; - onChanged(); - return this; - } - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder clearNumberAttr() { - - numberAttr_ = getDefaultInstance().getNumberAttr(); - onChanged(); - return this; - } - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder setNumberAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - numberAttr_ = value; - onChanged(); - return this; - } - - private java.lang.Object typeListAttr_ = ""; - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public java.lang.String getTypeListAttr() { - java.lang.Object ref = typeListAttr_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeListAttr_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public com.google.protobuf.ByteString - getTypeListAttrBytes() { - java.lang.Object ref = typeListAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeListAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder setTypeListAttr( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeListAttr_ = value; - onChanged(); - return this; - } - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder clearTypeListAttr() { - - typeListAttr_ = getDefaultInstance().getTypeListAttr(); - onChanged(); - return this; - } - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder setTypeListAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeListAttr_ = value; - onChanged(); - return this; - } - - private java.util.List handleData_ = - java.util.Collections.emptyList(); - private void ensureHandleDataIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - handleData_ = new java.util.ArrayList(handleData_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder> handleDataBuilder_; - - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public java.util.List getHandleDataList() { - if (handleDataBuilder_ == null) { - return java.util.Collections.unmodifiableList(handleData_); - } else { - return handleDataBuilder_.getMessageList(); - } - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public int getHandleDataCount() { - if (handleDataBuilder_ == null) { - return handleData_.size(); - } else { - return handleDataBuilder_.getCount(); - } - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getHandleData(int index) { - if (handleDataBuilder_ == null) { - return handleData_.get(index); - } else { - return handleDataBuilder_.getMessage(index); - } - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder setHandleData( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (handleDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHandleDataIsMutable(); - handleData_.set(index, value); - onChanged(); - } else { - handleDataBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder setHandleData( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (handleDataBuilder_ == null) { - ensureHandleDataIsMutable(); - handleData_.set(index, builderForValue.build()); - onChanged(); - } else { - handleDataBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder addHandleData(org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (handleDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHandleDataIsMutable(); - handleData_.add(value); - onChanged(); - } else { - handleDataBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder addHandleData( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (handleDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureHandleDataIsMutable(); - handleData_.add(index, value); - onChanged(); - } else { - handleDataBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder addHandleData( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (handleDataBuilder_ == null) { - ensureHandleDataIsMutable(); - handleData_.add(builderForValue.build()); - onChanged(); - } else { - handleDataBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder addHandleData( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (handleDataBuilder_ == null) { - ensureHandleDataIsMutable(); - handleData_.add(index, builderForValue.build()); - onChanged(); - } else { - handleDataBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder addAllHandleData( - java.lang.Iterable values) { - if (handleDataBuilder_ == null) { - ensureHandleDataIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, handleData_); - onChanged(); - } else { - handleDataBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder clearHandleData() { - if (handleDataBuilder_ == null) { - handleData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - handleDataBuilder_.clear(); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public Builder removeHandleData(int index) { - if (handleDataBuilder_ == null) { - ensureHandleDataIsMutable(); - handleData_.remove(index); - onChanged(); - } else { - handleDataBuilder_.remove(index); - } - return this; - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder getHandleDataBuilder( - int index) { - return getHandleDataFieldBuilder().getBuilder(index); - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( - int index) { - if (handleDataBuilder_ == null) { - return handleData_.get(index); } else { - return handleDataBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public java.util.List - getHandleDataOrBuilderList() { - if (handleDataBuilder_ != null) { - return handleDataBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(handleData_); - } - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder addHandleDataBuilder() { - return getHandleDataFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder addHandleDataBuilder( - int index) { - return getHandleDataFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); - } - /** - *
    -       * The handle data for resource inputs.
    -       * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; - */ - public java.util.List - getHandleDataBuilderList() { - return getHandleDataFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder> - getHandleDataFieldBuilder() { - if (handleDataBuilder_ == null) { - handleDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder>( - handleData_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - handleData_ = null; - } - return handleDataBuilder_; - } - - private boolean isRef_ ; - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public boolean getIsRef() { - return isRef_; - } - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public Builder setIsRef(boolean value) { - - isRef_ = value; - onChanged(); - return this; - } - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public Builder clearIsRef() { - - isRef_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.FullTypeDef experimentalFullType_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder> experimentalFullTypeBuilder_; - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public boolean hasExperimentalFullType() { - return experimentalFullTypeBuilder_ != null || experimentalFullType_ != null; - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public org.tensorflow.proto.framework.FullTypeDef getExperimentalFullType() { - if (experimentalFullTypeBuilder_ == null) { - return experimentalFullType_ == null ? org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance() : experimentalFullType_; - } else { - return experimentalFullTypeBuilder_.getMessage(); - } - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public Builder setExperimentalFullType(org.tensorflow.proto.framework.FullTypeDef value) { - if (experimentalFullTypeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - experimentalFullType_ = value; - onChanged(); - } else { - experimentalFullTypeBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public Builder setExperimentalFullType( - org.tensorflow.proto.framework.FullTypeDef.Builder builderForValue) { - if (experimentalFullTypeBuilder_ == null) { - experimentalFullType_ = builderForValue.build(); - onChanged(); - } else { - experimentalFullTypeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public Builder mergeExperimentalFullType(org.tensorflow.proto.framework.FullTypeDef value) { - if (experimentalFullTypeBuilder_ == null) { - if (experimentalFullType_ != null) { - experimentalFullType_ = - org.tensorflow.proto.framework.FullTypeDef.newBuilder(experimentalFullType_).mergeFrom(value).buildPartial(); - } else { - experimentalFullType_ = value; - } - onChanged(); - } else { - experimentalFullTypeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public Builder clearExperimentalFullType() { - if (experimentalFullTypeBuilder_ == null) { - experimentalFullType_ = null; - onChanged(); - } else { - experimentalFullType_ = null; - experimentalFullTypeBuilder_ = null; - } - - return this; - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public org.tensorflow.proto.framework.FullTypeDef.Builder getExperimentalFullTypeBuilder() { - - onChanged(); - return getExperimentalFullTypeFieldBuilder().getBuilder(); - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - public org.tensorflow.proto.framework.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder() { - if (experimentalFullTypeBuilder_ != null) { - return experimentalFullTypeBuilder_.getMessageOrBuilder(); - } else { - return experimentalFullType_ == null ? - org.tensorflow.proto.framework.FullTypeDef.getDefaultInstance() : experimentalFullType_; - } - } - /** - *
    -       * Experimental. Full type declaration for this argument.
    -       * The full type specification combines type, type_attr, type_list_attr,
    -       * etc. into a unified representation.
    -       * This declaration may contain non-concrete types (for example,
    -       * Tensor<TypeVar<'T'>> is a valid type declaration.
    -       * Note: this is a transient field. The long-term aim is to represent the
    -       * entire OpDef as a single type: a callable. In that context, this field is
    -       * just the type of a single argument.
    -       * 
    - * - * .tensorflow.FullTypeDef experimental_full_type = 17; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder> - getExperimentalFullTypeFieldBuilder() { - if (experimentalFullTypeBuilder_ == null) { - experimentalFullTypeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.FullTypeDef, org.tensorflow.proto.framework.FullTypeDef.Builder, org.tensorflow.proto.framework.FullTypeDefOrBuilder>( - getExperimentalFullType(), - getParentForChildren(), - isClean()); - experimentalFullType_ = null; - } - return experimentalFullTypeBuilder_; - } - @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.OpDef.ArgDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef.ArgDef) - private static final org.tensorflow.proto.framework.OpDef.ArgDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpDef.ArgDef(); - } - - public static org.tensorflow.proto.framework.OpDef.ArgDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ArgDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ArgDef(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.OpDef.ArgDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AttrDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.AttrDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - java.lang.String getType(); - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - boolean hasDefaultValue(); - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - org.tensorflow.proto.framework.AttrValue getDefaultValue(); - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder(); - - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - java.lang.String getDescription(); - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -     * For type == "int", this is a minimum value.  For "list(___)"
    -     * types, this is the minimum length.
    -     * 
    - * - * bool has_minimum = 5; - */ - boolean getHasMinimum(); - - /** - * int64 minimum = 6; - */ - long getMinimum(); - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - boolean hasAllowedValues(); - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - org.tensorflow.proto.framework.AttrValue getAllowedValues(); - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder(); - } - /** - *
    -   * Description of the graph-construction-time configuration of this
    -   * Op.  That is to say, this describes the attr fields that will
    -   * be specified in the NodeDef.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef.AttrDef} - */ - public static final class AttrDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef.AttrDef) - AttrDefOrBuilder { - private static final long serialVersionUID = 0L; - // Use AttrDef.newBuilder() to construct. - private AttrDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AttrDef() { - name_ = ""; - type_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AttrDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AttrDef( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 26: { - org.tensorflow.proto.framework.AttrValue.Builder subBuilder = null; - if (defaultValue_ != null) { - subBuilder = defaultValue_.toBuilder(); - } - defaultValue_ = input.readMessage(org.tensorflow.proto.framework.AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultValue_); - defaultValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 40: { - - hasMinimum_ = input.readBool(); - break; - } - case 48: { - - minimum_ = input.readInt64(); - break; - } - case 58: { - org.tensorflow.proto.framework.AttrValue.Builder subBuilder = null; - if (allowedValues_ != null) { - subBuilder = allowedValues_.toBuilder(); - } - allowedValues_ = input.readMessage(org.tensorflow.proto.framework.AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(allowedValues_); - allowedValues_ = subBuilder.buildPartial(); - } - - 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.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.AttrDef.class, org.tensorflow.proto.framework.OpDef.AttrDef.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * 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; - } - } - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * 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 TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - 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(); - type_ = s; - return s; - } - } - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.AttrValue defaultValue_; - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValue_ != null; - } - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue getDefaultValue() { - return defaultValue_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder() { - return getDefaultValue(); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 4; - private volatile java.lang.Object description_; - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HAS_MINIMUM_FIELD_NUMBER = 5; - private boolean hasMinimum_; - /** - *
    -     * For type == "int", this is a minimum value.  For "list(___)"
    -     * types, this is the minimum length.
    -     * 
    - * - * bool has_minimum = 5; - */ - public boolean getHasMinimum() { - return hasMinimum_; - } - - public static final int MINIMUM_FIELD_NUMBER = 6; - private long minimum_; - /** - * int64 minimum = 6; - */ - public long getMinimum() { - return minimum_; - } - - public static final int ALLOWED_VALUES_FIELD_NUMBER = 7; - private org.tensorflow.proto.framework.AttrValue allowedValues_; - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public boolean hasAllowedValues() { - return allowedValues_ != null; - } - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public org.tensorflow.proto.framework.AttrValue getAllowedValues() { - return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() { - return getAllowedValues(); - } - - 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 (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (defaultValue_ != null) { - output.writeMessage(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); - } - if (hasMinimum_ != false) { - output.writeBool(5, hasMinimum_); - } - if (minimum_ != 0L) { - output.writeInt64(6, minimum_); - } - if (allowedValues_ != null) { - output.writeMessage(7, getAllowedValues()); - } - 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 (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (defaultValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); - } - if (hasMinimum_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, hasMinimum_); - } - if (minimum_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, minimum_); - } - if (allowedValues_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getAllowedValues()); - } - 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.OpDef.AttrDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpDef.AttrDef other = (org.tensorflow.proto.framework.OpDef.AttrDef) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getType() - .equals(other.getType())) return false; - if (hasDefaultValue() != other.hasDefaultValue()) return false; - if (hasDefaultValue()) { - if (!getDefaultValue() - .equals(other.getDefaultValue())) return false; - } - if (!getDescription() - .equals(other.getDescription())) return false; - if (getHasMinimum() - != other.getHasMinimum()) return false; - if (getMinimum() - != other.getMinimum()) return false; - if (hasAllowedValues() != other.hasAllowedValues()) return false; - if (hasAllowedValues()) { - if (!getAllowedValues() - .equals(other.getAllowedValues())) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - if (hasDefaultValue()) { - hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultValue().hashCode(); - } - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + HAS_MINIMUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getHasMinimum()); - hash = (37 * hash) + MINIMUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMinimum()); - if (hasAllowedValues()) { - hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; - hash = (53 * hash) + getAllowedValues().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpDef.AttrDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef 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.OpDef.AttrDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef 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.OpDef.AttrDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef 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.OpDef.AttrDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef 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.OpDef.AttrDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef.AttrDef 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.OpDef.AttrDef 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; - } - /** - *
    -     * Description of the graph-construction-time configuration of this
    -     * Op.  That is to say, this describes the attr fields that will
    -     * be specified in the NodeDef.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpDef.AttrDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.AttrDef) - org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.AttrDef.class, org.tensorflow.proto.framework.OpDef.AttrDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.AttrDef.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_ = ""; - - type_ = ""; - - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - description_ = ""; - - hasMinimum_ = false; - - minimum_ = 0L; - - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.AttrDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpDef.AttrDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.AttrDef build() { - org.tensorflow.proto.framework.OpDef.AttrDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef.AttrDef buildPartial() { - org.tensorflow.proto.framework.OpDef.AttrDef result = new org.tensorflow.proto.framework.OpDef.AttrDef(this); - result.name_ = name_; - result.type_ = type_; - if (defaultValueBuilder_ == null) { - result.defaultValue_ = defaultValue_; - } else { - result.defaultValue_ = defaultValueBuilder_.build(); - } - result.description_ = description_; - result.hasMinimum_ = hasMinimum_; - result.minimum_ = minimum_; - if (allowedValuesBuilder_ == null) { - result.allowedValues_ = allowedValues_; - } else { - result.allowedValues_ = allowedValuesBuilder_.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.OpDef.AttrDef) { - return mergeFrom((org.tensorflow.proto.framework.OpDef.AttrDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpDef.AttrDef other) { - if (other == org.tensorflow.proto.framework.OpDef.AttrDef.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.hasDefaultValue()) { - mergeDefaultValue(other.getDefaultValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.getHasMinimum() != false) { - setHasMinimum(other.getHasMinimum()); - } - if (other.getMinimum() != 0L) { - setMinimum(other.getMinimum()); - } - if (other.hasAllowedValues()) { - mergeAllowedValues(other.getAllowedValues()); - } - 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.OpDef.AttrDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpDef.AttrDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * 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; - } - } - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * 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; - } - } - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * 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 java.lang.Object type_ = ""; - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.AttrValue defaultValue_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> defaultValueBuilder_; - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValueBuilder_ != null || defaultValue_ != null; - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue getDefaultValue() { - if (defaultValueBuilder_ == null) { - return defaultValue_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } else { - return defaultValueBuilder_.getMessage(); - } - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue(org.tensorflow.proto.framework.AttrValue value) { - if (defaultValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultValue_ = value; - onChanged(); - } else { - defaultValueBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue( - org.tensorflow.proto.framework.AttrValue.Builder builderForValue) { - if (defaultValueBuilder_ == null) { - defaultValue_ = builderForValue.build(); - onChanged(); - } else { - defaultValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder mergeDefaultValue(org.tensorflow.proto.framework.AttrValue value) { - if (defaultValueBuilder_ == null) { - if (defaultValue_ != null) { - defaultValue_ = - org.tensorflow.proto.framework.AttrValue.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); - } else { - defaultValue_ = value; - } - onChanged(); - } else { - defaultValueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder clearDefaultValue() { - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - onChanged(); - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - - return this; - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValue.Builder getDefaultValueBuilder() { - - onChanged(); - return getDefaultValueFieldBuilder().getBuilder(); - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getDefaultValueOrBuilder() { - if (defaultValueBuilder_ != null) { - return defaultValueBuilder_.getMessageOrBuilder(); - } else { - return defaultValue_ == null ? - org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : defaultValue_; - } - } - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> - getDefaultValueFieldBuilder() { - if (defaultValueBuilder_ == null) { - defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder>( - getDefaultValue(), - getParentForChildren(), - isClean()); - defaultValue_ = null; - } - return defaultValueBuilder_; - } - - private java.lang.Object description_ = ""; - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private boolean hasMinimum_ ; - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public boolean getHasMinimum() { - return hasMinimum_; - } - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public Builder setHasMinimum(boolean value) { - - hasMinimum_ = value; - onChanged(); - return this; - } - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public Builder clearHasMinimum() { - - hasMinimum_ = false; - onChanged(); - return this; - } - - private long minimum_ ; - /** - * int64 minimum = 6; - */ - public long getMinimum() { - return minimum_; - } - /** - * int64 minimum = 6; - */ - public Builder setMinimum(long value) { - - minimum_ = value; - onChanged(); - return this; - } - /** - * int64 minimum = 6; - */ - public Builder clearMinimum() { - - minimum_ = 0L; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.AttrValue allowedValues_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> allowedValuesBuilder_; - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public boolean hasAllowedValues() { - return allowedValuesBuilder_ != null || allowedValues_ != null; - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public org.tensorflow.proto.framework.AttrValue getAllowedValues() { - if (allowedValuesBuilder_ == null) { - return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } else { - return allowedValuesBuilder_.getMessage(); - } - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder setAllowedValues(org.tensorflow.proto.framework.AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - allowedValues_ = value; - onChanged(); - } else { - allowedValuesBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder setAllowedValues( - org.tensorflow.proto.framework.AttrValue.Builder builderForValue) { - if (allowedValuesBuilder_ == null) { - allowedValues_ = builderForValue.build(); - onChanged(); - } else { - allowedValuesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder mergeAllowedValues(org.tensorflow.proto.framework.AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (allowedValues_ != null) { - allowedValues_ = - org.tensorflow.proto.framework.AttrValue.newBuilder(allowedValues_).mergeFrom(value).buildPartial(); - } else { - allowedValues_ = value; - } - onChanged(); - } else { - allowedValuesBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder clearAllowedValues() { - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - onChanged(); - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - - return this; - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public org.tensorflow.proto.framework.AttrValue.Builder getAllowedValuesBuilder() { - - onChanged(); - return getAllowedValuesFieldBuilder().getBuilder(); - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() { - if (allowedValuesBuilder_ != null) { - return allowedValuesBuilder_.getMessageOrBuilder(); - } else { - return allowedValues_ == null ? - org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_; - } - } - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> - getAllowedValuesFieldBuilder() { - if (allowedValuesBuilder_ == null) { - allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder>( - getAllowedValues(), - getParentForChildren(), - isClean()); - allowedValues_ = null; - } - return allowedValuesBuilder_; - } - @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.OpDef.AttrDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef.AttrDef) - private static final org.tensorflow.proto.framework.OpDef.AttrDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpDef.AttrDef(); - } - - public static org.tensorflow.proto.framework.OpDef.AttrDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AttrDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttrDef(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.OpDef.AttrDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * 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 INPUT_ARG_FIELD_NUMBER = 2; - private java.util.List inputArg_; - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List getInputArgList() { - return inputArg_; - } - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgOrBuilderList() { - return inputArg_; - } - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public int getInputArgCount() { - return inputArg_.size(); - } - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef getInputArg(int index) { - return inputArg_.get(index); - } - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getInputArgOrBuilder( - int index) { - return inputArg_.get(index); - } - - public static final int OUTPUT_ARG_FIELD_NUMBER = 3; - private java.util.List outputArg_; - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List getOutputArgList() { - return outputArg_; - } - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgOrBuilderList() { - return outputArg_; - } - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public int getOutputArgCount() { - return outputArg_.size(); - } - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef getOutputArg(int index) { - return outputArg_.get(index); - } - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( - int index) { - return outputArg_.get(index); - } - - public static final int CONTROL_OUTPUT_FIELD_NUMBER = 20; - private com.google.protobuf.LazyStringList controlOutput_; - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ProtocolStringList - getControlOutputList() { - return controlOutput_; - } - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public int getControlOutputCount() { - return controlOutput_.size(); - } - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public java.lang.String getControlOutput(int index) { - return controlOutput_.get(index); - } - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ByteString - getControlOutputBytes(int index) { - return controlOutput_.getByteString(index); - } - - public static final int ATTR_FIELD_NUMBER = 4; - private java.util.List attr_; - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List getAttrList() { - return attr_; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrOrBuilderList() { - return attr_; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public int getAttrCount() { - return attr_.size(); - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDef getAttr(int index) { - return attr_.get(index); - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder getAttrOrBuilder( - int index) { - return attr_.get(index); - } - - public static final int DEPRECATION_FIELD_NUMBER = 8; - private org.tensorflow.proto.framework.OpDeprecation deprecation_; - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public boolean hasDeprecation() { - return deprecation_ != null; - } - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public org.tensorflow.proto.framework.OpDeprecation getDeprecation() { - return deprecation_ == null ? org.tensorflow.proto.framework.OpDeprecation.getDefaultInstance() : deprecation_; - } - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public org.tensorflow.proto.framework.OpDeprecationOrBuilder getDeprecationOrBuilder() { - return getDeprecation(); - } - - public static final int SUMMARY_FIELD_NUMBER = 5; - private volatile java.lang.Object summary_; - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - 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(); - summary_ = s; - return s; - } - } - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 6; - private volatile java.lang.Object description_; - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IS_COMMUTATIVE_FIELD_NUMBER = 18; - private boolean isCommutative_; - /** - *
    -   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -   * 
    - * - * bool is_commutative = 18; - */ - public boolean getIsCommutative() { - return isCommutative_; - } - - public static final int IS_AGGREGATE_FIELD_NUMBER = 16; - private boolean isAggregate_; - /** - *
    -   * If is_aggregate is true, then this operation accepts N >= 2
    -   * inputs and produces 1 output all of the same type.  Should be
    -   * associative and commutative, and produce output with the same
    -   * shape as the input.  The optimizer may replace an aggregate op
    -   * taking input from multiple devices with a tree of aggregate ops
    -   * that aggregate locally within each device (and possibly within
    -   * groups of nearby devices) before communicating.
    -   * TODO(josh11b): Implement that optimization.
    -   * 
    - * - * bool is_aggregate = 16; - */ - public boolean getIsAggregate() { - return isAggregate_; - } - - public static final int IS_STATEFUL_FIELD_NUMBER = 17; - private boolean isStateful_; - /** - *
    -   * Ops are marked as stateful if their behavior depends on some state beyond
    -   * their input tensors (e.g. variable reading op) or if they have
    -   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -   * must always produce the same output for the same input and have
    -   * no side-effects.
    -   * By default Ops may be moved between devices.  Stateful ops should
    -   * either not be moved, or should only be moved if that state can also
    -   * be moved (e.g. via some sort of save / restore).
    -   * Stateful ops are guaranteed to never be optimized away by Common
    -   * Subexpression Elimination (CSE).
    -   * 
    - * - * bool is_stateful = 17; - */ - public boolean getIsStateful() { - return isStateful_; - } - - public static final int ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER = 19; - private boolean allowsUninitializedInput_; - /** - *
    -   * By default, all inputs to an Op must be initialized Tensors.  Ops
    -   * that may initialize tensors for the first time should set this
    -   * field to true, to allow the Op to take an uninitialized Tensor as
    -   * input.
    -   * 
    - * - * bool allows_uninitialized_input = 19; - */ - public boolean getAllowsUninitializedInput() { - return allowsUninitializedInput_; - } - - public static final int IS_DISTRIBUTED_COMMUNICATION_FIELD_NUMBER = 21; - private boolean isDistributedCommunication_; - /** - *
    -   * Indicates whether the op implementation uses distributed communication.
    -   * If True, the op is allowed to return errors for network disconnection and
    -   * trigger TF network failure handling logics.
    -   * 
    - * - * bool is_distributed_communication = 21; - */ - public boolean getIsDistributedCommunication() { - return isDistributedCommunication_; - } - - 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_); - } - for (int i = 0; i < inputArg_.size(); i++) { - output.writeMessage(2, inputArg_.get(i)); - } - for (int i = 0; i < outputArg_.size(); i++) { - output.writeMessage(3, outputArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - output.writeMessage(4, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); - } - if (deprecation_ != null) { - output.writeMessage(8, getDeprecation()); - } - if (isAggregate_ != false) { - output.writeBool(16, isAggregate_); - } - if (isStateful_ != false) { - output.writeBool(17, isStateful_); - } - if (isCommutative_ != false) { - output.writeBool(18, isCommutative_); - } - if (allowsUninitializedInput_ != false) { - output.writeBool(19, allowsUninitializedInput_); - } - for (int i = 0; i < controlOutput_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 20, controlOutput_.getRaw(i)); - } - if (isDistributedCommunication_ != false) { - output.writeBool(21, isDistributedCommunication_); - } - 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_); - } - for (int i = 0; i < inputArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, inputArg_.get(i)); - } - for (int i = 0; i < outputArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, outputArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); - } - if (deprecation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getDeprecation()); - } - if (isAggregate_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, isAggregate_); - } - if (isStateful_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(17, isStateful_); - } - if (isCommutative_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(18, isCommutative_); - } - if (allowsUninitializedInput_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(19, allowsUninitializedInput_); - } - { - int dataSize = 0; - for (int i = 0; i < controlOutput_.size(); i++) { - dataSize += computeStringSizeNoTag(controlOutput_.getRaw(i)); - } - size += dataSize; - size += 2 * getControlOutputList().size(); - } - if (isDistributedCommunication_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(21, isDistributedCommunication_); - } - 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.OpDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpDef other = (org.tensorflow.proto.framework.OpDef) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getInputArgList() - .equals(other.getInputArgList())) return false; - if (!getOutputArgList() - .equals(other.getOutputArgList())) return false; - if (!getControlOutputList() - .equals(other.getControlOutputList())) return false; - if (!getAttrList() - .equals(other.getAttrList())) return false; - if (hasDeprecation() != other.hasDeprecation()) return false; - if (hasDeprecation()) { - if (!getDeprecation() - .equals(other.getDeprecation())) return false; - } - if (!getSummary() - .equals(other.getSummary())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (getIsCommutative() - != other.getIsCommutative()) return false; - if (getIsAggregate() - != other.getIsAggregate()) return false; - if (getIsStateful() - != other.getIsStateful()) return false; - if (getAllowsUninitializedInput() - != other.getAllowsUninitializedInput()) return false; - if (getIsDistributedCommunication() - != other.getIsDistributedCommunication()) 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(); - if (getInputArgCount() > 0) { - hash = (37 * hash) + INPUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getInputArgList().hashCode(); - } - if (getOutputArgCount() > 0) { - hash = (37 * hash) + OUTPUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getOutputArgList().hashCode(); - } - if (getControlOutputCount() > 0) { - hash = (37 * hash) + CONTROL_OUTPUT_FIELD_NUMBER; - hash = (53 * hash) + getControlOutputList().hashCode(); - } - if (getAttrCount() > 0) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + getAttrList().hashCode(); - } - if (hasDeprecation()) { - hash = (37 * hash) + DEPRECATION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecation().hashCode(); - } - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + IS_COMMUTATIVE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsCommutative()); - hash = (37 * hash) + IS_AGGREGATE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsAggregate()); - hash = (37 * hash) + IS_STATEFUL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsStateful()); - hash = (37 * hash) + ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAllowsUninitializedInput()); - hash = (37 * hash) + IS_DISTRIBUTED_COMMUNICATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsDistributedCommunication()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef 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.OpDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef 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.OpDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef 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.OpDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef 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.OpDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDef 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.OpDef 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; - } - /** - *
    -   * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    -   * using the "op" field which should match the name of a OpDef.
    -   * LINT.IfChange
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef) - org.tensorflow.proto.framework.OpDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDef.class, org.tensorflow.proto.framework.OpDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInputArgFieldBuilder(); - getOutputArgFieldBuilder(); - getAttrFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (inputArgBuilder_ == null) { - inputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - inputArgBuilder_.clear(); - } - if (outputArgBuilder_ == null) { - outputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - outputArgBuilder_.clear(); - } - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - attrBuilder_.clear(); - } - if (deprecationBuilder_ == null) { - deprecation_ = null; - } else { - deprecation_ = null; - deprecationBuilder_ = null; - } - summary_ = ""; - - description_ = ""; - - isCommutative_ = false; - - isAggregate_ = false; - - isStateful_ = false; - - allowsUninitializedInput_ = false; - - isDistributedCommunication_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef build() { - org.tensorflow.proto.framework.OpDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDef buildPartial() { - org.tensorflow.proto.framework.OpDef result = new org.tensorflow.proto.framework.OpDef(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (inputArgBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - inputArg_ = java.util.Collections.unmodifiableList(inputArg_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.inputArg_ = inputArg_; - } else { - result.inputArg_ = inputArgBuilder_.build(); - } - if (outputArgBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - outputArg_ = java.util.Collections.unmodifiableList(outputArg_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.outputArg_ = outputArg_; - } else { - result.outputArg_ = outputArgBuilder_.build(); - } - if (((bitField0_ & 0x00000004) != 0)) { - controlOutput_ = controlOutput_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.controlOutput_ = controlOutput_; - if (attrBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.attr_ = attr_; - } else { - result.attr_ = attrBuilder_.build(); - } - if (deprecationBuilder_ == null) { - result.deprecation_ = deprecation_; - } else { - result.deprecation_ = deprecationBuilder_.build(); - } - result.summary_ = summary_; - result.description_ = description_; - result.isCommutative_ = isCommutative_; - result.isAggregate_ = isAggregate_; - result.isStateful_ = isStateful_; - result.allowsUninitializedInput_ = allowsUninitializedInput_; - result.isDistributedCommunication_ = isDistributedCommunication_; - 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.OpDef) { - return mergeFrom((org.tensorflow.proto.framework.OpDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpDef other) { - if (other == org.tensorflow.proto.framework.OpDef.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (inputArgBuilder_ == null) { - if (!other.inputArg_.isEmpty()) { - if (inputArg_.isEmpty()) { - inputArg_ = other.inputArg_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputArgIsMutable(); - inputArg_.addAll(other.inputArg_); - } - onChanged(); - } - } else { - if (!other.inputArg_.isEmpty()) { - if (inputArgBuilder_.isEmpty()) { - inputArgBuilder_.dispose(); - inputArgBuilder_ = null; - inputArg_ = other.inputArg_; - bitField0_ = (bitField0_ & ~0x00000001); - inputArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInputArgFieldBuilder() : null; - } else { - inputArgBuilder_.addAllMessages(other.inputArg_); - } - } - } - if (outputArgBuilder_ == null) { - if (!other.outputArg_.isEmpty()) { - if (outputArg_.isEmpty()) { - outputArg_ = other.outputArg_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputArgIsMutable(); - outputArg_.addAll(other.outputArg_); - } - onChanged(); - } - } else { - if (!other.outputArg_.isEmpty()) { - if (outputArgBuilder_.isEmpty()) { - outputArgBuilder_.dispose(); - outputArgBuilder_ = null; - outputArg_ = other.outputArg_; - bitField0_ = (bitField0_ & ~0x00000002); - outputArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutputArgFieldBuilder() : null; - } else { - outputArgBuilder_.addAllMessages(other.outputArg_); - } - } - } - if (!other.controlOutput_.isEmpty()) { - if (controlOutput_.isEmpty()) { - controlOutput_ = other.controlOutput_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureControlOutputIsMutable(); - controlOutput_.addAll(other.controlOutput_); - } - onChanged(); - } - if (attrBuilder_ == null) { - if (!other.attr_.isEmpty()) { - if (attr_.isEmpty()) { - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureAttrIsMutable(); - attr_.addAll(other.attr_); - } - onChanged(); - } - } else { - if (!other.attr_.isEmpty()) { - if (attrBuilder_.isEmpty()) { - attrBuilder_.dispose(); - attrBuilder_ = null; - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000008); - attrBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttrFieldBuilder() : null; - } else { - attrBuilder_.addAllMessages(other.attr_); - } - } - } - if (other.hasDeprecation()) { - mergeDeprecation(other.getDeprecation()); - } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.getIsCommutative() != false) { - setIsCommutative(other.getIsCommutative()); - } - if (other.getIsAggregate() != false) { - setIsAggregate(other.getIsAggregate()); - } - if (other.getIsStateful() != false) { - setIsStateful(other.getIsStateful()); - } - if (other.getAllowsUninitializedInput() != false) { - setAllowsUninitializedInput(other.getAllowsUninitializedInput()); - } - if (other.getIsDistributedCommunication() != false) { - setIsDistributedCommunication(other.getIsDistributedCommunication()); - } - 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.OpDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * 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 java.util.List inputArg_ = - java.util.Collections.emptyList(); - private void ensureInputArgIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - inputArg_ = new java.util.ArrayList(inputArg_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder> inputArgBuilder_; - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List getInputArgList() { - if (inputArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(inputArg_); - } else { - return inputArgBuilder_.getMessageList(); - } - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public int getInputArgCount() { - if (inputArgBuilder_ == null) { - return inputArg_.size(); - } else { - return inputArgBuilder_.getCount(); - } - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef getInputArg(int index) { - if (inputArgBuilder_ == null) { - return inputArg_.get(index); - } else { - return inputArgBuilder_.getMessage(index); - } - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder setInputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.set(index, value); - onChanged(); - } else { - inputArgBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder setInputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.set(index, builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg(org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.add(value); - onChanged(); - } else { - inputArgBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.add(index, value); - onChanged(); - } else { - inputArgBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.add(builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.add(index, builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addAllInputArg( - java.lang.Iterable values) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputArg_); - onChanged(); - } else { - inputArgBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder clearInputArg() { - if (inputArgBuilder_ == null) { - inputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - inputArgBuilder_.clear(); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder removeInputArg(int index) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.remove(index); - onChanged(); - } else { - inputArgBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder getInputArgBuilder( - int index) { - return getInputArgFieldBuilder().getBuilder(index); - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getInputArgOrBuilder( - int index) { - if (inputArgBuilder_ == null) { - return inputArg_.get(index); } else { - return inputArgBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgOrBuilderList() { - if (inputArgBuilder_ != null) { - return inputArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inputArg_); - } - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder addInputArgBuilder() { - return getInputArgFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance()); - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder addInputArgBuilder( - int index) { - return getInputArgFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance()); - } - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgBuilderList() { - return getInputArgFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder> - getInputArgFieldBuilder() { - if (inputArgBuilder_ == null) { - inputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder>( - inputArg_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - inputArg_ = null; - } - return inputArgBuilder_; - } - - private java.util.List outputArg_ = - java.util.Collections.emptyList(); - private void ensureOutputArgIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - outputArg_ = new java.util.ArrayList(outputArg_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder> outputArgBuilder_; - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List getOutputArgList() { - if (outputArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(outputArg_); - } else { - return outputArgBuilder_.getMessageList(); - } - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public int getOutputArgCount() { - if (outputArgBuilder_ == null) { - return outputArg_.size(); - } else { - return outputArgBuilder_.getCount(); - } - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef getOutputArg(int index) { - if (outputArgBuilder_ == null) { - return outputArg_.get(index); - } else { - return outputArgBuilder_.getMessage(index); - } - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder setOutputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.set(index, value); - onChanged(); - } else { - outputArgBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder setOutputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.set(index, builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg(org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.add(value); - onChanged(); - } else { - outputArgBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.add(index, value); - onChanged(); - } else { - outputArgBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.add(builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - int index, org.tensorflow.proto.framework.OpDef.ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.add(index, builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addAllOutputArg( - java.lang.Iterable values) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputArg_); - onChanged(); - } else { - outputArgBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder clearOutputArg() { - if (outputArgBuilder_ == null) { - outputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - outputArgBuilder_.clear(); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder removeOutputArg(int index) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.remove(index); - onChanged(); - } else { - outputArgBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder getOutputArgBuilder( - int index) { - return getOutputArgFieldBuilder().getBuilder(index); - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( - int index) { - if (outputArgBuilder_ == null) { - return outputArg_.get(index); } else { - return outputArgBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgOrBuilderList() { - if (outputArgBuilder_ != null) { - return outputArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outputArg_); - } - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder addOutputArgBuilder() { - return getOutputArgFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance()); - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public org.tensorflow.proto.framework.OpDef.ArgDef.Builder addOutputArgBuilder( - int index) { - return getOutputArgFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpDef.ArgDef.getDefaultInstance()); - } - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgBuilderList() { - return getOutputArgFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder> - getOutputArgFieldBuilder() { - if (outputArgBuilder_ == null) { - outputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.ArgDef, org.tensorflow.proto.framework.OpDef.ArgDef.Builder, org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder>( - outputArg_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - outputArg_ = null; - } - return outputArgBuilder_; - } - - private com.google.protobuf.LazyStringList controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureControlOutputIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - controlOutput_ = new com.google.protobuf.LazyStringArrayList(controlOutput_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ProtocolStringList - getControlOutputList() { - return controlOutput_.getUnmodifiableView(); - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public int getControlOutputCount() { - return controlOutput_.size(); - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public java.lang.String getControlOutput(int index) { - return controlOutput_.get(index); - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ByteString - getControlOutputBytes(int index) { - return controlOutput_.getByteString(index); - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder setControlOutput( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureControlOutputIsMutable(); - controlOutput_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addControlOutput( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureControlOutputIsMutable(); - controlOutput_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addAllControlOutput( - java.lang.Iterable values) { - ensureControlOutputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, controlOutput_); - onChanged(); - return this; - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder clearControlOutput() { - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addControlOutputBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureControlOutputIsMutable(); - controlOutput_.add(value); - onChanged(); - return this; - } - - private java.util.List attr_ = - java.util.Collections.emptyList(); - private void ensureAttrIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - attr_ = new java.util.ArrayList(attr_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.AttrDef, org.tensorflow.proto.framework.OpDef.AttrDef.Builder, org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder> attrBuilder_; - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List getAttrList() { - if (attrBuilder_ == null) { - return java.util.Collections.unmodifiableList(attr_); - } else { - return attrBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public int getAttrCount() { - if (attrBuilder_ == null) { - return attr_.size(); - } else { - return attrBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDef getAttr(int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder setAttr( - int index, org.tensorflow.proto.framework.OpDef.AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.set(index, value); - onChanged(); - } else { - attrBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder setAttr( - int index, org.tensorflow.proto.framework.OpDef.AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.set(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr(org.tensorflow.proto.framework.OpDef.AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(value); - onChanged(); - } else { - attrBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - int index, org.tensorflow.proto.framework.OpDef.AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(index, value); - onChanged(); - } else { - attrBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - org.tensorflow.proto.framework.OpDef.AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - int index, org.tensorflow.proto.framework.OpDef.AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAllAttr( - java.lang.Iterable values) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attr_); - onChanged(); - } else { - attrBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder clearAttr() { - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - attrBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder removeAttr(int index) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.remove(index); - onChanged(); - } else { - attrBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDef.Builder getAttrBuilder( - int index) { - return getAttrFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder getAttrOrBuilder( - int index) { - if (attrBuilder_ == null) { - return attr_.get(index); } else { - return attrBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrOrBuilderList() { - if (attrBuilder_ != null) { - return attrBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attr_); - } - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDef.Builder addAttrBuilder() { - return getAttrFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpDef.AttrDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public org.tensorflow.proto.framework.OpDef.AttrDef.Builder addAttrBuilder( - int index) { - return getAttrFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpDef.AttrDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrBuilderList() { - return getAttrFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.AttrDef, org.tensorflow.proto.framework.OpDef.AttrDef.Builder, org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder> - getAttrFieldBuilder() { - if (attrBuilder_ == null) { - attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef.AttrDef, org.tensorflow.proto.framework.OpDef.AttrDef.Builder, org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder>( - attr_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - attr_ = null; - } - return attrBuilder_; - } - - private org.tensorflow.proto.framework.OpDeprecation deprecation_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDeprecation, org.tensorflow.proto.framework.OpDeprecation.Builder, org.tensorflow.proto.framework.OpDeprecationOrBuilder> deprecationBuilder_; - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public boolean hasDeprecation() { - return deprecationBuilder_ != null || deprecation_ != null; - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public org.tensorflow.proto.framework.OpDeprecation getDeprecation() { - if (deprecationBuilder_ == null) { - return deprecation_ == null ? org.tensorflow.proto.framework.OpDeprecation.getDefaultInstance() : deprecation_; - } else { - return deprecationBuilder_.getMessage(); - } - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder setDeprecation(org.tensorflow.proto.framework.OpDeprecation value) { - if (deprecationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deprecation_ = value; - onChanged(); - } else { - deprecationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder setDeprecation( - org.tensorflow.proto.framework.OpDeprecation.Builder builderForValue) { - if (deprecationBuilder_ == null) { - deprecation_ = builderForValue.build(); - onChanged(); - } else { - deprecationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder mergeDeprecation(org.tensorflow.proto.framework.OpDeprecation value) { - if (deprecationBuilder_ == null) { - if (deprecation_ != null) { - deprecation_ = - org.tensorflow.proto.framework.OpDeprecation.newBuilder(deprecation_).mergeFrom(value).buildPartial(); - } else { - deprecation_ = value; - } - onChanged(); - } else { - deprecationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder clearDeprecation() { - if (deprecationBuilder_ == null) { - deprecation_ = null; - onChanged(); - } else { - deprecation_ = null; - deprecationBuilder_ = null; - } - - return this; - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public org.tensorflow.proto.framework.OpDeprecation.Builder getDeprecationBuilder() { - - onChanged(); - return getDeprecationFieldBuilder().getBuilder(); - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public org.tensorflow.proto.framework.OpDeprecationOrBuilder getDeprecationOrBuilder() { - if (deprecationBuilder_ != null) { - return deprecationBuilder_.getMessageOrBuilder(); - } else { - return deprecation_ == null ? - org.tensorflow.proto.framework.OpDeprecation.getDefaultInstance() : deprecation_; - } - } - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDeprecation, org.tensorflow.proto.framework.OpDeprecation.Builder, org.tensorflow.proto.framework.OpDeprecationOrBuilder> - getDeprecationFieldBuilder() { - if (deprecationBuilder_ == null) { - deprecationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpDeprecation, org.tensorflow.proto.framework.OpDeprecation.Builder, org.tensorflow.proto.framework.OpDeprecationOrBuilder>( - getDeprecation(), - getParentForChildren(), - isClean()); - deprecation_ = null; - } - return deprecationBuilder_; - } - - private java.lang.Object summary_ = ""; - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summary_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder setSummary( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - summary_ = value; - onChanged(); - return this; - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder clearSummary() { - - summary_ = getDefaultInstance().getSummary(); - onChanged(); - return this; - } - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder setSummaryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private boolean isCommutative_ ; - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public boolean getIsCommutative() { - return isCommutative_; - } - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public Builder setIsCommutative(boolean value) { - - isCommutative_ = value; - onChanged(); - return this; - } - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public Builder clearIsCommutative() { - - isCommutative_ = false; - onChanged(); - return this; - } - - private boolean isAggregate_ ; - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public boolean getIsAggregate() { - return isAggregate_; - } - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public Builder setIsAggregate(boolean value) { - - isAggregate_ = value; - onChanged(); - return this; - } - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public Builder clearIsAggregate() { - - isAggregate_ = false; - onChanged(); - return this; - } - - private boolean isStateful_ ; - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public boolean getIsStateful() { - return isStateful_; - } - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public Builder setIsStateful(boolean value) { - - isStateful_ = value; - onChanged(); - return this; - } - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public Builder clearIsStateful() { - - isStateful_ = false; - onChanged(); - return this; - } - - private boolean allowsUninitializedInput_ ; - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public boolean getAllowsUninitializedInput() { - return allowsUninitializedInput_; - } - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public Builder setAllowsUninitializedInput(boolean value) { - - allowsUninitializedInput_ = value; - onChanged(); - return this; - } - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public Builder clearAllowsUninitializedInput() { - - allowsUninitializedInput_ = false; - onChanged(); - return this; - } - - private boolean isDistributedCommunication_ ; - /** - *
    -     * Indicates whether the op implementation uses distributed communication.
    -     * If True, the op is allowed to return errors for network disconnection and
    -     * trigger TF network failure handling logics.
    -     * 
    - * - * bool is_distributed_communication = 21; - */ - public boolean getIsDistributedCommunication() { - return isDistributedCommunication_; - } - /** - *
    -     * Indicates whether the op implementation uses distributed communication.
    -     * If True, the op is allowed to return errors for network disconnection and
    -     * trigger TF network failure handling logics.
    -     * 
    - * - * bool is_distributed_communication = 21; - */ - public Builder setIsDistributedCommunication(boolean value) { - - isDistributedCommunication_ = value; - onChanged(); - return this; - } - /** - *
    -     * Indicates whether the op implementation uses distributed communication.
    -     * If True, the op is allowed to return errors for network disconnection and
    -     * trigger TF network failure handling logics.
    -     * 
    - * - * bool is_distributed_communication = 21; - */ - public Builder clearIsDistributedCommunication() { - - isDistributedCommunication_ = false; - 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.OpDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef) - private static final org.tensorflow.proto.framework.OpDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpDef(); - } - - public static org.tensorflow.proto.framework.OpDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpDef(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.OpDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefOrBuilder.java deleted file mode 100644 index 1e986459b37..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefOrBuilder.java +++ /dev/null @@ -1,307 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - java.util.List - getInputArgList(); - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - org.tensorflow.proto.framework.OpDef.ArgDef getInputArg(int index); - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - int getInputArgCount(); - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - java.util.List - getInputArgOrBuilderList(); - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getInputArgOrBuilder( - int index); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - java.util.List - getOutputArgList(); - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - org.tensorflow.proto.framework.OpDef.ArgDef getOutputArg(int index); - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - int getOutputArgCount(); - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - java.util.List - getOutputArgOrBuilderList(); - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - org.tensorflow.proto.framework.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( - int index); - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - java.util.List - getControlOutputList(); - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - int getControlOutputCount(); - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - java.lang.String getControlOutput(int index); - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - com.google.protobuf.ByteString - getControlOutputBytes(int index); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - java.util.List - getAttrList(); - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - org.tensorflow.proto.framework.OpDef.AttrDef getAttr(int index); - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - int getAttrCount(); - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - java.util.List - getAttrOrBuilderList(); - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - org.tensorflow.proto.framework.OpDef.AttrDefOrBuilder getAttrOrBuilder( - int index); - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - boolean hasDeprecation(); - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - org.tensorflow.proto.framework.OpDeprecation getDeprecation(); - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - org.tensorflow.proto.framework.OpDeprecationOrBuilder getDeprecationOrBuilder(); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - java.lang.String getSummary(); - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - com.google.protobuf.ByteString - getSummaryBytes(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - java.lang.String getDescription(); - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -   * 
    - * - * bool is_commutative = 18; - */ - boolean getIsCommutative(); - - /** - *
    -   * If is_aggregate is true, then this operation accepts N >= 2
    -   * inputs and produces 1 output all of the same type.  Should be
    -   * associative and commutative, and produce output with the same
    -   * shape as the input.  The optimizer may replace an aggregate op
    -   * taking input from multiple devices with a tree of aggregate ops
    -   * that aggregate locally within each device (and possibly within
    -   * groups of nearby devices) before communicating.
    -   * TODO(josh11b): Implement that optimization.
    -   * 
    - * - * bool is_aggregate = 16; - */ - boolean getIsAggregate(); - - /** - *
    -   * Ops are marked as stateful if their behavior depends on some state beyond
    -   * their input tensors (e.g. variable reading op) or if they have
    -   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -   * must always produce the same output for the same input and have
    -   * no side-effects.
    -   * By default Ops may be moved between devices.  Stateful ops should
    -   * either not be moved, or should only be moved if that state can also
    -   * be moved (e.g. via some sort of save / restore).
    -   * Stateful ops are guaranteed to never be optimized away by Common
    -   * Subexpression Elimination (CSE).
    -   * 
    - * - * bool is_stateful = 17; - */ - boolean getIsStateful(); - - /** - *
    -   * By default, all inputs to an Op must be initialized Tensors.  Ops
    -   * that may initialize tensors for the first time should set this
    -   * field to true, to allow the Op to take an uninitialized Tensor as
    -   * input.
    -   * 
    - * - * bool allows_uninitialized_input = 19; - */ - boolean getAllowsUninitializedInput(); - - /** - *
    -   * Indicates whether the op implementation uses distributed communication.
    -   * If True, the op is allowed to return errors for network disconnection and
    -   * trigger TF network failure handling logics.
    -   * 
    - * - * bool is_distributed_communication = 21; - */ - boolean getIsDistributedCommunication(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefProtos.java deleted file mode 100644 index 9fe8b27832c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDefProtos.java +++ /dev/null @@ -1,131 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public final class OpDefProtos { - private OpDefProtos() {} - 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_OpDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDef_ArgDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDef_AttrDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDeprecation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDeprecation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpList_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/framework/op_def.proto" + - "\022\ntensorflow\032*tensorflow/core/framework/" + - "attr_value.proto\032)tensorflow/core/framew" + - "ork/full_type.proto\032/tensorflow/core/fra" + - "mework/resource_handle.proto\032%tensorflow" + - "/core/framework/types.proto\"\363\006\n\005OpDef\022\014\n" + - "\004name\030\001 \001(\t\022+\n\tinput_arg\030\002 \003(\0132\030.tensorf" + - "low.OpDef.ArgDef\022,\n\noutput_arg\030\003 \003(\0132\030.t" + - "ensorflow.OpDef.ArgDef\022\026\n\016control_output" + - "\030\024 \003(\t\022\'\n\004attr\030\004 \003(\0132\031.tensorflow.OpDef." + - "AttrDef\022.\n\013deprecation\030\010 \001(\0132\031.tensorflo" + - "w.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023\n\013desc" + - "ription\030\006 \001(\t\022\026\n\016is_commutative\030\022 \001(\010\022\024\n" + - "\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful\030\021 \001(\010" + - "\022\"\n\032allows_uninitialized_input\030\023 \001(\010\022$\n\034" + - "is_distributed_communication\030\025 \001(\010\032\234\002\n\006A" + - "rgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 \001(\t" + - "\022\"\n\004type\030\003 \001(\0162\024.tensorflow.DataType\022\021\n\t" + - "type_attr\030\004 \001(\t\022\023\n\013number_attr\030\005 \001(\t\022\026\n\016" + - "type_list_attr\030\006 \001(\t\022B\n\013handle_data\030\007 \003(" + - "\0132-.tensorflow.ResourceHandleProto.Dtype" + - "AndShape\022\016\n\006is_ref\030\020 \001(\010\0227\n\026experimental" + - "_full_type\030\021 \001(\0132\027.tensorflow.FullTypeDe" + - "f\032\275\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(" + - "\t\022,\n\rdefault_value\030\003 \001(\0132\025.tensorflow.At" + - "trValue\022\023\n\013description\030\004 \001(\t\022\023\n\013has_mini" + - "mum\030\005 \001(\010\022\017\n\007minimum\030\006 \001(\003\022-\n\016allowed_va" + - "lues\030\007 \001(\0132\025.tensorflow.AttrValue\"5\n\rOpD" + - "eprecation\022\017\n\007version\030\001 \001(\005\022\023\n\013explanati" + - "on\030\002 \001(\t\"\'\n\006OpList\022\035\n\002op\030\001 \003(\0132\021.tensorf" + - "low.OpDefB\201\001\n\036org.tensorflow.proto.frame" + - "workB\013OpDefProtosP\001ZMgithub.com/tensorfl" + - "ow/tensorflow/tensorflow/go/core/framewo" + - "rk/op_def_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - org.tensorflow.proto.framework.FullTypeProtos.getDescriptor(), - org.tensorflow.proto.framework.ResourceHandle.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_OpDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_OpDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_descriptor, - new java.lang.String[] { "Name", "InputArg", "OutputArg", "ControlOutput", "Attr", "Deprecation", "Summary", "Description", "IsCommutative", "IsAggregate", "IsStateful", "AllowsUninitializedInput", "IsDistributedCommunication", }); - internal_static_tensorflow_OpDef_ArgDef_descriptor = - internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_ArgDef_descriptor, - new java.lang.String[] { "Name", "Description", "Type", "TypeAttr", "NumberAttr", "TypeListAttr", "HandleData", "IsRef", "ExperimentalFullType", }); - internal_static_tensorflow_OpDef_AttrDef_descriptor = - internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_AttrDef_descriptor, - new java.lang.String[] { "Name", "Type", "DefaultValue", "Description", "HasMinimum", "Minimum", "AllowedValues", }); - internal_static_tensorflow_OpDeprecation_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_OpDeprecation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDeprecation_descriptor, - new java.lang.String[] { "Version", "Explanation", }); - internal_static_tensorflow_OpList_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_OpList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpList_descriptor, - new java.lang.String[] { "Op", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - org.tensorflow.proto.framework.FullTypeProtos.getDescriptor(); - org.tensorflow.proto.framework.ResourceHandle.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecation.java deleted file mode 100644 index f33a34c9052..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecation.java +++ /dev/null @@ -1,655 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Information about version-dependent deprecation of an op
    - * 
    - * - * Protobuf type {@code tensorflow.OpDeprecation} - */ -public final class OpDeprecation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDeprecation) - OpDeprecationOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpDeprecation.newBuilder() to construct. - private OpDeprecation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpDeprecation() { - explanation_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpDeprecation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpDeprecation( - 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: { - - version_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - explanation_ = s; - 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.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDeprecation.class, org.tensorflow.proto.framework.OpDeprecation.Builder.class); - } - - public static final int VERSION_FIELD_NUMBER = 1; - private int version_; - /** - *
    -   * First GraphDef version at which the op is disallowed.
    -   * 
    - * - * int32 version = 1; - */ - public int getVersion() { - return version_; - } - - public static final int EXPLANATION_FIELD_NUMBER = 2; - private volatile java.lang.Object explanation_; - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - public java.lang.String getExplanation() { - java.lang.Object ref = explanation_; - 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(); - explanation_ = s; - return s; - } - } - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - public com.google.protobuf.ByteString - getExplanationBytes() { - java.lang.Object ref = explanation_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - explanation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (version_ != 0) { - output.writeInt32(1, version_); - } - if (!getExplanationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, explanation_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (version_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, version_); - } - if (!getExplanationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, explanation_); - } - 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.OpDeprecation)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpDeprecation other = (org.tensorflow.proto.framework.OpDeprecation) obj; - - if (getVersion() - != other.getVersion()) return false; - if (!getExplanation() - .equals(other.getExplanation())) 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) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); - hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; - hash = (53 * hash) + getExplanation().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpDeprecation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDeprecation 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.OpDeprecation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDeprecation 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.OpDeprecation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpDeprecation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpDeprecation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDeprecation 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.OpDeprecation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDeprecation 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.OpDeprecation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpDeprecation 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.OpDeprecation 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; - } - /** - *
    -   * Information about version-dependent deprecation of an op
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDeprecation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDeprecation) - org.tensorflow.proto.framework.OpDeprecationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpDeprecation.class, org.tensorflow.proto.framework.OpDeprecation.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDeprecation.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(); - version_ = 0; - - explanation_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDeprecation getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpDeprecation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDeprecation build() { - org.tensorflow.proto.framework.OpDeprecation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpDeprecation buildPartial() { - org.tensorflow.proto.framework.OpDeprecation result = new org.tensorflow.proto.framework.OpDeprecation(this); - result.version_ = version_; - result.explanation_ = explanation_; - 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.OpDeprecation) { - return mergeFrom((org.tensorflow.proto.framework.OpDeprecation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpDeprecation other) { - if (other == org.tensorflow.proto.framework.OpDeprecation.getDefaultInstance()) return this; - if (other.getVersion() != 0) { - setVersion(other.getVersion()); - } - if (!other.getExplanation().isEmpty()) { - explanation_ = other.explanation_; - onChanged(); - } - 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.OpDeprecation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpDeprecation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int version_ ; - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public int getVersion() { - return version_; - } - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public Builder setVersion(int value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public Builder clearVersion() { - - version_ = 0; - onChanged(); - return this; - } - - private java.lang.Object explanation_ = ""; - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public java.lang.String getExplanation() { - java.lang.Object ref = explanation_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - explanation_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public com.google.protobuf.ByteString - getExplanationBytes() { - java.lang.Object ref = explanation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - explanation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder setExplanation( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - explanation_ = value; - onChanged(); - return this; - } - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder clearExplanation() { - - explanation_ = getDefaultInstance().getExplanation(); - onChanged(); - return this; - } - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder setExplanationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - explanation_ = value; - 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.OpDeprecation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDeprecation) - private static final org.tensorflow.proto.framework.OpDeprecation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpDeprecation(); - } - - public static org.tensorflow.proto.framework.OpDeprecation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpDeprecation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpDeprecation(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.OpDeprecation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java deleted file mode 100644 index 3248db05508..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpDeprecationOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDeprecation) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * First GraphDef version at which the op is disallowed.
    -   * 
    - * - * int32 version = 1; - */ - int getVersion(); - - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - java.lang.String getExplanation(); - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - com.google.protobuf.ByteString - getExplanationBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfo.java deleted file mode 100644 index 860edaad590..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfo.java +++ /dev/null @@ -1,3048 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Description of an operation as well as the parameters expected to impact its
    - * performance.
    - * 
    - * - * Protobuf type {@code tensorflow.OpInfo} - */ -public final class OpInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpInfo) - OpInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpInfo.newBuilder() to construct. - private OpInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpInfo() { - op_ = ""; - inputs_ = java.util.Collections.emptyList(); - outputs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpInfo( - 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(); - - op_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.getValue()); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - inputs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - inputs_.add( - input.readMessage(org.tensorflow.proto.framework.OpInfo.TensorProperties.parser(), extensionRegistry)); - break; - } - case 34: { - org.tensorflow.proto.framework.DeviceProperties.Builder subBuilder = null; - if (device_ != null) { - subBuilder = device_.toBuilder(); - } - device_ = input.readMessage(org.tensorflow.proto.framework.DeviceProperties.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(device_); - device_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - outputs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - outputs_.add( - input.readMessage(org.tensorflow.proto.framework.OpInfo.TensorProperties.parser(), extensionRegistry)); - break; - } - case 50: { - org.tensorflow.proto.framework.SessionInfo.Builder subBuilder = null; - if (sessionInfo_ != null) { - subBuilder = sessionInfo_.toBuilder(); - } - sessionInfo_ = input.readMessage(org.tensorflow.proto.framework.SessionInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sessionInfo_); - sessionInfo_ = subBuilder.buildPartial(); - } - - 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)) { - inputs_ = java.util.Collections.unmodifiableList(inputs_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - outputs_ = java.util.Collections.unmodifiableList(outputs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpInfo.class, org.tensorflow.proto.framework.OpInfo.Builder.class); - } - - public interface TensorPropertiesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpInfo.TensorProperties) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * .tensorflow.TensorProto value = 3; - */ - boolean hasValue(); - /** - * .tensorflow.TensorProto value = 3; - */ - org.tensorflow.proto.framework.TensorProto getValue(); - /** - * .tensorflow.TensorProto value = 3; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getValueOrBuilder(); - } - /** - *
    -   * Input data types, shapes and values if known.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpInfo.TensorProperties} - */ - public static final class TensorProperties extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpInfo.TensorProperties) - TensorPropertiesOrBuilder { - private static final long serialVersionUID = 0L; - // Use TensorProperties.newBuilder() to construct. - private TensorProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorProperties() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorProperties(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorProperties( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (value_ != null) { - subBuilder = value_.toBuilder(); - } - value_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(value_); - value_ = subBuilder.buildPartial(); - } - - 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.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpInfo.TensorProperties.class, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int VALUE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorProto value_; - /** - * .tensorflow.TensorProto value = 3; - */ - public boolean hasValue() { - return value_ != null; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public org.tensorflow.proto.framework.TensorProto getValue() { - return value_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : value_; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getValueOrBuilder() { - return getValue(); - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (value_ != null) { - output.writeMessage(3, getValue()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (value_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getValue()); - } - 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.OpInfo.TensorProperties)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpInfo.TensorProperties other = (org.tensorflow.proto.framework.OpInfo.TensorProperties) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (hasValue() != other.hasValue()) return false; - if (hasValue()) { - if (!getValue() - .equals(other.getValue())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - if (hasValue()) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpInfo.TensorProperties parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties 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.OpInfo.TensorProperties parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties 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.OpInfo.TensorProperties parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties 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.OpInfo.TensorProperties parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties 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.OpInfo.TensorProperties parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo.TensorProperties 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.OpInfo.TensorProperties 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; - } - /** - *
    -     * Input data types, shapes and values if known.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpInfo.TensorProperties} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpInfo.TensorProperties) - org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpInfo.TensorProperties.class, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpInfo.TensorProperties.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(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - if (valueBuilder_ == null) { - value_ = null; - } else { - value_ = null; - valueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo.TensorProperties getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo.TensorProperties build() { - org.tensorflow.proto.framework.OpInfo.TensorProperties result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo.TensorProperties buildPartial() { - org.tensorflow.proto.framework.OpInfo.TensorProperties result = new org.tensorflow.proto.framework.OpInfo.TensorProperties(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - if (valueBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = valueBuilder_.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.OpInfo.TensorProperties) { - return mergeFrom((org.tensorflow.proto.framework.OpInfo.TensorProperties)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpInfo.TensorProperties other) { - if (other == org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.hasValue()) { - mergeValue(other.getValue()); - } - 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.OpInfo.TensorProperties parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpInfo.TensorProperties) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private org.tensorflow.proto.framework.TensorProto value_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> valueBuilder_; - /** - * .tensorflow.TensorProto value = 3; - */ - public boolean hasValue() { - return valueBuilder_ != null || value_ != null; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public org.tensorflow.proto.framework.TensorProto getValue() { - if (valueBuilder_ == null) { - return value_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : value_; - } else { - return valueBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorProto value = 3; - */ - public Builder setValue(org.tensorflow.proto.framework.TensorProto value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - valueBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public Builder setValue( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (valueBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - valueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public Builder mergeValue(org.tensorflow.proto.framework.TensorProto value) { - if (valueBuilder_ == null) { - if (value_ != null) { - value_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(value_).mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - valueBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public Builder clearValue() { - if (valueBuilder_ == null) { - value_ = null; - onChanged(); - } else { - value_ = null; - valueBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorProto value = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getValueBuilder() { - - onChanged(); - return getValueFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorProto value = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getValueOrBuilder() { - if (valueBuilder_ != null) { - return valueBuilder_.getMessageOrBuilder(); - } else { - return value_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : value_; - } - } - /** - * .tensorflow.TensorProto value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getValueFieldBuilder() { - if (valueBuilder_ == null) { - valueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getValue(), - getParentForChildren(), - isClean()); - value_ = null; - } - return valueBuilder_; - } - @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.OpInfo.TensorProperties) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpInfo.TensorProperties) - private static final org.tensorflow.proto.framework.OpInfo.TensorProperties DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpInfo.TensorProperties(); - } - - public static org.tensorflow.proto.framework.OpInfo.TensorProperties getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorProperties parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorProperties(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.OpInfo.TensorProperties getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int OP_FIELD_NUMBER = 1; - private volatile java.lang.Object op_; - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * 
    - * - * string op = 1; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - 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(); - op_ = s; - return s; - } - } - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * 
    - * - * string op = 1; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTR_FIELD_NUMBER = 2; - private static final class AttrDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int INPUTS_FIELD_NUMBER = 3; - private java.util.List inputs_; - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public java.util.List getInputsList() { - return inputs_; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public java.util.List - getInputsOrBuilderList() { - return inputs_; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public int getInputsCount() { - return inputs_.size(); - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties getInputs(int index) { - return inputs_.get(index); - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( - int index) { - return inputs_.get(index); - } - - public static final int OUTPUTS_FIELD_NUMBER = 5; - private java.util.List outputs_; - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public java.util.List getOutputsList() { - return outputs_; - } - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public java.util.List - getOutputsOrBuilderList() { - return outputs_; - } - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public int getOutputsCount() { - return outputs_.size(); - } - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties getOutputs(int index) { - return outputs_.get(index); - } - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( - int index) { - return outputs_.get(index); - } - - public static final int DEVICE_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.DeviceProperties device_; - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public boolean hasDevice() { - return device_ != null; - } - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public org.tensorflow.proto.framework.DeviceProperties getDevice() { - return device_ == null ? org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : device_; - } - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public org.tensorflow.proto.framework.DevicePropertiesOrBuilder getDeviceOrBuilder() { - return getDevice(); - } - - public static final int SESSION_INFO_FIELD_NUMBER = 6; - private org.tensorflow.proto.framework.SessionInfo sessionInfo_; - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public boolean hasSessionInfo() { - return sessionInfo_ != null; - } - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public org.tensorflow.proto.framework.SessionInfo getSessionInfo() { - return sessionInfo_ == null ? org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder() { - return getSessionInfo(); - } - - 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 (!getOpBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, op_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 2); - for (int i = 0; i < inputs_.size(); i++) { - output.writeMessage(3, inputs_.get(i)); - } - if (device_ != null) { - output.writeMessage(4, getDevice()); - } - for (int i = 0; i < outputs_.size(); i++) { - output.writeMessage(5, outputs_.get(i)); - } - if (sessionInfo_ != null) { - output.writeMessage(6, getSessionInfo()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getOpBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, op_); - } - for (java.util.Map.Entry entry - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, attr__); - } - for (int i = 0; i < inputs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, inputs_.get(i)); - } - if (device_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getDevice()); - } - for (int i = 0; i < outputs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, outputs_.get(i)); - } - if (sessionInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getSessionInfo()); - } - 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.OpInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpInfo other = (org.tensorflow.proto.framework.OpInfo) obj; - - if (!getOp() - .equals(other.getOp())) return false; - if (!internalGetAttr().equals( - other.internalGetAttr())) return false; - if (!getInputsList() - .equals(other.getInputsList())) return false; - if (!getOutputsList() - .equals(other.getOutputsList())) return false; - if (hasDevice() != other.hasDevice()) return false; - if (hasDevice()) { - if (!getDevice() - .equals(other.getDevice())) return false; - } - if (hasSessionInfo() != other.hasSessionInfo()) return false; - if (hasSessionInfo()) { - if (!getSessionInfo() - .equals(other.getSessionInfo())) 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) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOp().hashCode(); - if (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - if (getInputsCount() > 0) { - hash = (37 * hash) + INPUTS_FIELD_NUMBER; - hash = (53 * hash) + getInputsList().hashCode(); - } - if (getOutputsCount() > 0) { - hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; - hash = (53 * hash) + getOutputsList().hashCode(); - } - if (hasDevice()) { - hash = (37 * hash) + DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - } - if (hasSessionInfo()) { - hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; - hash = (53 * hash) + getSessionInfo().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo 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.OpInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo 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.OpInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo 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.OpInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo 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.OpInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpInfo 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.OpInfo 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; - } - /** - *
    -   * Description of an operation as well as the parameters expected to impact its
    -   * performance.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpInfo) - org.tensorflow.proto.framework.OpInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpInfo.class, org.tensorflow.proto.framework.OpInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInputsFieldBuilder(); - getOutputsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - op_ = ""; - - internalGetMutableAttr().clear(); - if (inputsBuilder_ == null) { - inputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - inputsBuilder_.clear(); - } - if (outputsBuilder_ == null) { - outputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - outputsBuilder_.clear(); - } - if (deviceBuilder_ == null) { - device_ = null; - } else { - device_ = null; - deviceBuilder_ = null; - } - if (sessionInfoBuilder_ == null) { - sessionInfo_ = null; - } else { - sessionInfo_ = null; - sessionInfoBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo build() { - org.tensorflow.proto.framework.OpInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpInfo buildPartial() { - org.tensorflow.proto.framework.OpInfo result = new org.tensorflow.proto.framework.OpInfo(this); - int from_bitField0_ = bitField0_; - result.op_ = op_; - result.attr_ = internalGetAttr(); - result.attr_.makeImmutable(); - if (inputsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - inputs_ = java.util.Collections.unmodifiableList(inputs_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.inputs_ = inputs_; - } else { - result.inputs_ = inputsBuilder_.build(); - } - if (outputsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - outputs_ = java.util.Collections.unmodifiableList(outputs_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.outputs_ = outputs_; - } else { - result.outputs_ = outputsBuilder_.build(); - } - if (deviceBuilder_ == null) { - result.device_ = device_; - } else { - result.device_ = deviceBuilder_.build(); - } - if (sessionInfoBuilder_ == null) { - result.sessionInfo_ = sessionInfo_; - } else { - result.sessionInfo_ = sessionInfoBuilder_.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.OpInfo) { - return mergeFrom((org.tensorflow.proto.framework.OpInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpInfo other) { - if (other == org.tensorflow.proto.framework.OpInfo.getDefaultInstance()) return this; - if (!other.getOp().isEmpty()) { - op_ = other.op_; - onChanged(); - } - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - if (inputsBuilder_ == null) { - if (!other.inputs_.isEmpty()) { - if (inputs_.isEmpty()) { - inputs_ = other.inputs_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInputsIsMutable(); - inputs_.addAll(other.inputs_); - } - onChanged(); - } - } else { - if (!other.inputs_.isEmpty()) { - if (inputsBuilder_.isEmpty()) { - inputsBuilder_.dispose(); - inputsBuilder_ = null; - inputs_ = other.inputs_; - bitField0_ = (bitField0_ & ~0x00000002); - inputsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInputsFieldBuilder() : null; - } else { - inputsBuilder_.addAllMessages(other.inputs_); - } - } - } - if (outputsBuilder_ == null) { - if (!other.outputs_.isEmpty()) { - if (outputs_.isEmpty()) { - outputs_ = other.outputs_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureOutputsIsMutable(); - outputs_.addAll(other.outputs_); - } - onChanged(); - } - } else { - if (!other.outputs_.isEmpty()) { - if (outputsBuilder_.isEmpty()) { - outputsBuilder_.dispose(); - outputsBuilder_ = null; - outputs_ = other.outputs_; - bitField0_ = (bitField0_ & ~0x00000004); - outputsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutputsFieldBuilder() : null; - } else { - outputsBuilder_.addAllMessages(other.outputs_); - } - } - } - if (other.hasDevice()) { - mergeDevice(other.getDevice()); - } - if (other.hasSessionInfo()) { - mergeSessionInfo(other.getSessionInfo()); - } - 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.OpInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object op_ = ""; - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * 
    - * - * string op = 1; - */ - public java.lang.String getOp() { - java.lang.Object ref = op_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - op_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * 
    - * - * string op = 1; - */ - public com.google.protobuf.ByteString - getOpBytes() { - java.lang.Object ref = op_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - op_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * 
    - * - * string op = 1; - */ - public Builder setOp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - op_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * 
    - * - * string op = 1; - */ - public Builder clearOp() { - - op_ = getDefaultInstance().getOp(); - onChanged(); - return this; - } - /** - *
    -     * The operation name.  There may be custom parameters in attrs.
    -     * 
    - * - * string op = 1; - */ - public Builder setOpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - op_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> attr_; - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged();; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttr().getMap().containsKey(key); - } - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder removeAttr( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - public Builder putAttr( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Custom parameters impacting the behavior of the op.
    -     * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List inputs_ = - java.util.Collections.emptyList(); - private void ensureInputsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - inputs_ = new java.util.ArrayList(inputs_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder> inputsBuilder_; - - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public java.util.List getInputsList() { - if (inputsBuilder_ == null) { - return java.util.Collections.unmodifiableList(inputs_); - } else { - return inputsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public int getInputsCount() { - if (inputsBuilder_ == null) { - return inputs_.size(); - } else { - return inputsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties getInputs(int index) { - if (inputsBuilder_ == null) { - return inputs_.get(index); - } else { - return inputsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder setInputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.set(index, value); - onChanged(); - } else { - inputsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder setInputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.set(index, builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder addInputs(org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.add(value); - onChanged(); - } else { - inputsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder addInputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (inputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputsIsMutable(); - inputs_.add(index, value); - onChanged(); - } else { - inputsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder addInputs( - org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.add(builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder addInputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.add(index, builderForValue.build()); - onChanged(); - } else { - inputsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder addAllInputs( - java.lang.Iterable values) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputs_); - onChanged(); - } else { - inputsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder clearInputs() { - if (inputsBuilder_ == null) { - inputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - inputsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public Builder removeInputs(int index) { - if (inputsBuilder_ == null) { - ensureInputsIsMutable(); - inputs_.remove(index); - onChanged(); - } else { - inputsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder getInputsBuilder( - int index) { - return getInputsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( - int index) { - if (inputsBuilder_ == null) { - return inputs_.get(index); } else { - return inputsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public java.util.List - getInputsOrBuilderList() { - if (inputsBuilder_ != null) { - return inputsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inputs_); - } - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder addInputsBuilder() { - return getInputsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder addInputsBuilder( - int index) { - return getInputsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - public java.util.List - getInputsBuilderList() { - return getInputsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder> - getInputsFieldBuilder() { - if (inputsBuilder_ == null) { - inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder>( - inputs_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - inputs_ = null; - } - return inputsBuilder_; - } - - private java.util.List outputs_ = - java.util.Collections.emptyList(); - private void ensureOutputsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - outputs_ = new java.util.ArrayList(outputs_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder> outputsBuilder_; - - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public java.util.List getOutputsList() { - if (outputsBuilder_ == null) { - return java.util.Collections.unmodifiableList(outputs_); - } else { - return outputsBuilder_.getMessageList(); - } - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public int getOutputsCount() { - if (outputsBuilder_ == null) { - return outputs_.size(); - } else { - return outputsBuilder_.getCount(); - } - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties getOutputs(int index) { - if (outputsBuilder_ == null) { - return outputs_.get(index); - } else { - return outputsBuilder_.getMessage(index); - } - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder setOutputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (outputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.set(index, value); - onChanged(); - } else { - outputsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder setOutputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (outputsBuilder_ == null) { - ensureOutputsIsMutable(); - outputs_.set(index, builderForValue.build()); - onChanged(); - } else { - outputsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder addOutputs(org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (outputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.add(value); - onChanged(); - } else { - outputsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder addOutputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties value) { - if (outputsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputsIsMutable(); - outputs_.add(index, value); - onChanged(); - } else { - outputsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder addOutputs( - org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (outputsBuilder_ == null) { - ensureOutputsIsMutable(); - outputs_.add(builderForValue.build()); - onChanged(); - } else { - outputsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder addOutputs( - int index, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder builderForValue) { - if (outputsBuilder_ == null) { - ensureOutputsIsMutable(); - outputs_.add(index, builderForValue.build()); - onChanged(); - } else { - outputsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder addAllOutputs( - java.lang.Iterable values) { - if (outputsBuilder_ == null) { - ensureOutputsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputs_); - onChanged(); - } else { - outputsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder clearOutputs() { - if (outputsBuilder_ == null) { - outputs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - outputsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public Builder removeOutputs(int index) { - if (outputsBuilder_ == null) { - ensureOutputsIsMutable(); - outputs_.remove(index); - onChanged(); - } else { - outputsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder getOutputsBuilder( - int index) { - return getOutputsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( - int index) { - if (outputsBuilder_ == null) { - return outputs_.get(index); } else { - return outputsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public java.util.List - getOutputsOrBuilderList() { - if (outputsBuilder_ != null) { - return outputsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outputs_); - } - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder addOutputsBuilder() { - return getOutputsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance()); - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder addOutputsBuilder( - int index) { - return getOutputsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpInfo.TensorProperties.getDefaultInstance()); - } - /** - *
    -     * Optional description of the op outputs
    -     * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - public java.util.List - getOutputsBuilderList() { - return getOutputsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder> - getOutputsFieldBuilder() { - if (outputsBuilder_ == null) { - outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo.TensorProperties, org.tensorflow.proto.framework.OpInfo.TensorProperties.Builder, org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder>( - outputs_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - outputs_ = null; - } - return outputsBuilder_; - } - - private org.tensorflow.proto.framework.DeviceProperties device_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder> deviceBuilder_; - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public boolean hasDevice() { - return deviceBuilder_ != null || device_ != null; - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public org.tensorflow.proto.framework.DeviceProperties getDevice() { - if (deviceBuilder_ == null) { - return device_ == null ? org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : device_; - } else { - return deviceBuilder_.getMessage(); - } - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public Builder setDevice(org.tensorflow.proto.framework.DeviceProperties value) { - if (deviceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - device_ = value; - onChanged(); - } else { - deviceBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public Builder setDevice( - org.tensorflow.proto.framework.DeviceProperties.Builder builderForValue) { - if (deviceBuilder_ == null) { - device_ = builderForValue.build(); - onChanged(); - } else { - deviceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public Builder mergeDevice(org.tensorflow.proto.framework.DeviceProperties value) { - if (deviceBuilder_ == null) { - if (device_ != null) { - device_ = - org.tensorflow.proto.framework.DeviceProperties.newBuilder(device_).mergeFrom(value).buildPartial(); - } else { - device_ = value; - } - onChanged(); - } else { - deviceBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public Builder clearDevice() { - if (deviceBuilder_ == null) { - device_ = null; - onChanged(); - } else { - device_ = null; - deviceBuilder_ = null; - } - - return this; - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public org.tensorflow.proto.framework.DeviceProperties.Builder getDeviceBuilder() { - - onChanged(); - return getDeviceFieldBuilder().getBuilder(); - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - public org.tensorflow.proto.framework.DevicePropertiesOrBuilder getDeviceOrBuilder() { - if (deviceBuilder_ != null) { - return deviceBuilder_.getMessageOrBuilder(); - } else { - return device_ == null ? - org.tensorflow.proto.framework.DeviceProperties.getDefaultInstance() : device_; - } - } - /** - *
    -     * Device on which the operation is run.
    -     * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder> - getDeviceFieldBuilder() { - if (deviceBuilder_ == null) { - deviceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DeviceProperties, org.tensorflow.proto.framework.DeviceProperties.Builder, org.tensorflow.proto.framework.DevicePropertiesOrBuilder>( - getDevice(), - getParentForChildren(), - isClean()); - device_ = null; - } - return deviceBuilder_; - } - - private org.tensorflow.proto.framework.SessionInfo sessionInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder> sessionInfoBuilder_; - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public boolean hasSessionInfo() { - return sessionInfoBuilder_ != null || sessionInfo_ != null; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public org.tensorflow.proto.framework.SessionInfo getSessionInfo() { - if (sessionInfoBuilder_ == null) { - return sessionInfo_ == null ? org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } else { - return sessionInfoBuilder_.getMessage(); - } - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public Builder setSessionInfo(org.tensorflow.proto.framework.SessionInfo value) { - if (sessionInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sessionInfo_ = value; - onChanged(); - } else { - sessionInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public Builder setSessionInfo( - org.tensorflow.proto.framework.SessionInfo.Builder builderForValue) { - if (sessionInfoBuilder_ == null) { - sessionInfo_ = builderForValue.build(); - onChanged(); - } else { - sessionInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public Builder mergeSessionInfo(org.tensorflow.proto.framework.SessionInfo value) { - if (sessionInfoBuilder_ == null) { - if (sessionInfo_ != null) { - sessionInfo_ = - org.tensorflow.proto.framework.SessionInfo.newBuilder(sessionInfo_).mergeFrom(value).buildPartial(); - } else { - sessionInfo_ = value; - } - onChanged(); - } else { - sessionInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public Builder clearSessionInfo() { - if (sessionInfoBuilder_ == null) { - sessionInfo_ = null; - onChanged(); - } else { - sessionInfo_ = null; - sessionInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public org.tensorflow.proto.framework.SessionInfo.Builder getSessionInfoBuilder() { - - onChanged(); - return getSessionInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - public org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder() { - if (sessionInfoBuilder_ != null) { - return sessionInfoBuilder_.getMessageOrBuilder(); - } else { - return sessionInfo_ == null ? - org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder> - getSessionInfoFieldBuilder() { - if (sessionInfoBuilder_ == null) { - sessionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder>( - getSessionInfo(), - getParentForChildren(), - isClean()); - sessionInfo_ = null; - } - return sessionInfoBuilder_; - } - @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.OpInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpInfo) - private static final org.tensorflow.proto.framework.OpInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpInfo(); - } - - public static org.tensorflow.proto.framework.OpInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpInfo(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.OpInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfoOrBuilder.java deleted file mode 100644 index 675799794a4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpInfoOrBuilder.java +++ /dev/null @@ -1,199 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface OpInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * 
    - * - * string op = 1; - */ - java.lang.String getOp(); - /** - *
    -   * The operation name.  There may be custom parameters in attrs.
    -   * 
    - * - * string op = 1; - */ - com.google.protobuf.ByteString - getOpBytes(); - - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - int getAttrCount(); - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - boolean containsAttr( - java.lang.String key); - /** - * Use {@link #getAttrMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttr(); - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - java.util.Map - getAttrMap(); - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue); - /** - *
    -   * Custom parameters impacting the behavior of the op.
    -   * 
    - * - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - org.tensorflow.proto.framework.AttrValue getAttrOrThrow( - java.lang.String key); - - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - java.util.List - getInputsList(); - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - org.tensorflow.proto.framework.OpInfo.TensorProperties getInputs(int index); - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - int getInputsCount(); - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - java.util.List - getInputsOrBuilderList(); - /** - * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; - */ - org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( - int index); - - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - java.util.List - getOutputsList(); - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - org.tensorflow.proto.framework.OpInfo.TensorProperties getOutputs(int index); - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - int getOutputsCount(); - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - java.util.List - getOutputsOrBuilderList(); - /** - *
    -   * Optional description of the op outputs
    -   * 
    - * - * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; - */ - org.tensorflow.proto.framework.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( - int index); - - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - boolean hasDevice(); - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - org.tensorflow.proto.framework.DeviceProperties getDevice(); - /** - *
    -   * Device on which the operation is run.
    -   * 
    - * - * .tensorflow.DeviceProperties device = 4; - */ - org.tensorflow.proto.framework.DevicePropertiesOrBuilder getDeviceOrBuilder(); - - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - boolean hasSessionInfo(); - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - org.tensorflow.proto.framework.SessionInfo getSessionInfo(); - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 6; - */ - org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpList.java deleted file mode 100644 index 1be81195b29..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpList.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A collection of OpDefs
    - * 
    - * - * Protobuf type {@code tensorflow.OpList} - */ -public final class OpList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpList) - OpListOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpList.newBuilder() to construct. - private OpList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpList() { - op_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpList( - 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)) { - op_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - op_.add( - input.readMessage(org.tensorflow.proto.framework.OpDef.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_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpList.class, org.tensorflow.proto.framework.OpList.Builder.class); - } - - public static final int OP_FIELD_NUMBER = 1; - private java.util.List op_; - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List getOpList() { - return op_; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - return op_; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public int getOpCount() { - return op_.size(); - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDef getOp(int index) { - return op_.get(index); - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDefOrBuilder getOpOrBuilder( - int index) { - return op_.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 { - for (int i = 0; i < op_.size(); i++) { - output.writeMessage(1, op_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < op_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, op_.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.OpList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpList other = (org.tensorflow.proto.framework.OpList) obj; - - if (!getOpList() - .equals(other.getOpList())) 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 (getOpCount() > 0) { - hash = (37 * hash) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOpList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpList 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.OpList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpList 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.OpList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpList 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.OpList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpList 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.OpList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpList 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.OpList 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 collection of OpDefs
    -   * 
    - * - * Protobuf type {@code tensorflow.OpList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpList) - org.tensorflow.proto.framework.OpListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpList.class, org.tensorflow.proto.framework.OpList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getOpFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - opBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpList build() { - org.tensorflow.proto.framework.OpList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpList buildPartial() { - org.tensorflow.proto.framework.OpList result = new org.tensorflow.proto.framework.OpList(this); - int from_bitField0_ = bitField0_; - if (opBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.op_ = op_; - } else { - result.op_ = opBuilder_.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.OpList) { - return mergeFrom((org.tensorflow.proto.framework.OpList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpList other) { - if (other == org.tensorflow.proto.framework.OpList.getDefaultInstance()) return this; - if (opBuilder_ == null) { - if (!other.op_.isEmpty()) { - if (op_.isEmpty()) { - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOpIsMutable(); - op_.addAll(other.op_); - } - onChanged(); - } - } else { - if (!other.op_.isEmpty()) { - if (opBuilder_.isEmpty()) { - opBuilder_.dispose(); - opBuilder_ = null; - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - opBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOpFieldBuilder() : null; - } else { - opBuilder_.addAllMessages(other.op_); - } - } - } - 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.OpList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List op_ = - java.util.Collections.emptyList(); - private void ensureOpIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - op_ = new java.util.ArrayList(op_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder> opBuilder_; - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List getOpList() { - if (opBuilder_ == null) { - return java.util.Collections.unmodifiableList(op_); - } else { - return opBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public int getOpCount() { - if (opBuilder_ == null) { - return op_.size(); - } else { - return opBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDef getOp(int index) { - if (opBuilder_ == null) { - return op_.get(index); - } else { - return opBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder setOp( - int index, org.tensorflow.proto.framework.OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.set(index, value); - onChanged(); - } else { - opBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder setOp( - int index, org.tensorflow.proto.framework.OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.set(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp(org.tensorflow.proto.framework.OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(value); - onChanged(); - } else { - opBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - int index, org.tensorflow.proto.framework.OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(index, value); - onChanged(); - } else { - opBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - org.tensorflow.proto.framework.OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - int index, org.tensorflow.proto.framework.OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addAllOp( - java.lang.Iterable values) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, op_); - onChanged(); - } else { - opBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder clearOp() { - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - opBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder removeOp(int index) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.remove(index); - onChanged(); - } else { - opBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDef.Builder getOpBuilder( - int index) { - return getOpFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDefOrBuilder getOpOrBuilder( - int index) { - if (opBuilder_ == null) { - return op_.get(index); } else { - return opBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - if (opBuilder_ != null) { - return opBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(op_); - } - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDef.Builder addOpBuilder() { - return getOpFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public org.tensorflow.proto.framework.OpDef.Builder addOpBuilder( - int index) { - return getOpFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpDef.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpBuilderList() { - return getOpFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder> - getOpFieldBuilder() { - if (opBuilder_ == null) { - opBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpDef, org.tensorflow.proto.framework.OpDef.Builder, org.tensorflow.proto.framework.OpDefOrBuilder>( - op_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - op_ = null; - } - return opBuilder_; - } - @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.OpList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpList) - private static final org.tensorflow.proto.framework.OpList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpList(); - } - - public static org.tensorflow.proto.framework.OpList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpList(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.OpList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpListOrBuilder.java deleted file mode 100644 index a3fc1fa9856..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.OpDef op = 1; - */ - java.util.List - getOpList(); - /** - * repeated .tensorflow.OpDef op = 1; - */ - org.tensorflow.proto.framework.OpDef getOp(int index); - /** - * repeated .tensorflow.OpDef op = 1; - */ - int getOpCount(); - /** - * repeated .tensorflow.OpDef op = 1; - */ - java.util.List - getOpOrBuilderList(); - /** - * repeated .tensorflow.OpDef op = 1; - */ - org.tensorflow.proto.framework.OpDefOrBuilder getOpOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformance.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformance.java deleted file mode 100644 index 0f25f95dff9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformance.java +++ /dev/null @@ -1,3074 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Performance data for tensorflow operations
    - * 
    - * - * Protobuf type {@code tensorflow.OpPerformance} - */ -public final class OpPerformance extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpPerformance) - OpPerformanceOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpPerformance.newBuilder() to construct. - private OpPerformance(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpPerformance() { - node_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpPerformance(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpPerformance( - 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: { - org.tensorflow.proto.framework.OpInfo.Builder subBuilder = null; - if (op_ != null) { - subBuilder = op_.toBuilder(); - } - op_ = input.readMessage(org.tensorflow.proto.framework.OpInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(op_); - op_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - temporaryMemorySize_ = input.readInt64(); - break; - } - case 24: { - - computeCost_ = input.readInt64(); - break; - } - case 33: { - - computeEfficiency_ = input.readDouble(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - node_ = s; - break; - } - case 48: { - - computeTime_ = input.readInt64(); - break; - } - case 56: { - - memoryTime_ = input.readInt64(); - break; - } - case 65: { - - memoryEfficiency_ = input.readDouble(); - break; - } - case 74: { - org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder subBuilder = null; - if (opMemory_ != null) { - subBuilder = opMemory_.toBuilder(); - } - opMemory_ = input.readMessage(org.tensorflow.proto.framework.OpPerformance.OpMemory.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(opMemory_); - opMemory_ = subBuilder.buildPartial(); - } - - break; - } - case 82: { - org.tensorflow.proto.framework.NormalDistribution.Builder subBuilder = null; - if (executionTimeCase_ == 10) { - subBuilder = ((org.tensorflow.proto.framework.NormalDistribution) executionTime_).toBuilder(); - } - executionTime_ = - input.readMessage(org.tensorflow.proto.framework.NormalDistribution.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.NormalDistribution) executionTime_); - executionTime_ = subBuilder.buildPartial(); - } - executionTimeCase_ = 10; - break; - } - case 90: { - org.tensorflow.proto.framework.LogNormalDistribution.Builder subBuilder = null; - if (executionTimeCase_ == 11) { - subBuilder = ((org.tensorflow.proto.framework.LogNormalDistribution) executionTime_).toBuilder(); - } - executionTime_ = - input.readMessage(org.tensorflow.proto.framework.LogNormalDistribution.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.LogNormalDistribution) executionTime_); - executionTime_ = subBuilder.buildPartial(); - } - executionTimeCase_ = 11; - break; - } - case 98: { - org.tensorflow.proto.framework.SessionInfo.Builder subBuilder = null; - if (sessionInfo_ != null) { - subBuilder = sessionInfo_.toBuilder(); - } - sessionInfo_ = input.readMessage(org.tensorflow.proto.framework.SessionInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sessionInfo_); - sessionInfo_ = subBuilder.buildPartial(); - } - - 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.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformance.class, org.tensorflow.proto.framework.OpPerformance.Builder.class); - } - - public interface OpMemoryOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformance.OpMemory) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - java.util.List getOutputMemoryList(); - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - int getOutputMemoryCount(); - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - long getOutputMemory(int index); - - /** - *
    -     * Temp and persistent memory allocated by this node.
    -     * 
    - * - * int64 temp_memory = 2; - */ - long getTempMemory(); - - /** - * int64 persistent_memory = 4; - */ - long getPersistentMemory(); - - /** - * int64 device_temp_memory = 3 [deprecated = true]; - */ - @java.lang.Deprecated long getDeviceTempMemory(); - - /** - * int64 device_persistent_memory = 5 [deprecated = true]; - */ - @java.lang.Deprecated long getDevicePersistentMemory(); - } - /** - *
    -   * Memory usage data for a tensorflow operation.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpPerformance.OpMemory} - */ - public static final class OpMemory extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpPerformance.OpMemory) - OpMemoryOrBuilder { - private static final long serialVersionUID = 0L; - // Use OpMemory.newBuilder() to construct. - private OpMemory(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpMemory() { - outputMemory_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpMemory(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpMemory( - 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: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - outputMemory_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - outputMemory_.addLong(input.readInt64()); - break; - } - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - outputMemory_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - outputMemory_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 16: { - - tempMemory_ = input.readInt64(); - break; - } - case 24: { - - deviceTempMemory_ = input.readInt64(); - break; - } - case 32: { - - persistentMemory_ = input.readInt64(); - break; - } - case 40: { - - devicePersistentMemory_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - outputMemory_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformance.OpMemory.class, org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder.class); - } - - public static final int OUTPUT_MEMORY_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.LongList outputMemory_; - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - public java.util.List - getOutputMemoryList() { - return outputMemory_; - } - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - public int getOutputMemoryCount() { - return outputMemory_.size(); - } - /** - *
    -     * The output information may have memory usage and output shapes.
    -     * 
    - * - * repeated int64 output_memory = 1; - */ - public long getOutputMemory(int index) { - return outputMemory_.getLong(index); - } - private int outputMemoryMemoizedSerializedSize = -1; - - public static final int TEMP_MEMORY_FIELD_NUMBER = 2; - private long tempMemory_; - /** - *
    -     * Temp and persistent memory allocated by this node.
    -     * 
    - * - * int64 temp_memory = 2; - */ - public long getTempMemory() { - return tempMemory_; - } - - public static final int PERSISTENT_MEMORY_FIELD_NUMBER = 4; - private long persistentMemory_; - /** - * int64 persistent_memory = 4; - */ - public long getPersistentMemory() { - return persistentMemory_; - } - - public static final int DEVICE_TEMP_MEMORY_FIELD_NUMBER = 3; - private long deviceTempMemory_; - /** - * int64 device_temp_memory = 3 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemory() { - return deviceTempMemory_; - } - - public static final int DEVICE_PERSISTENT_MEMORY_FIELD_NUMBER = 5; - private long devicePersistentMemory_; - /** - * int64 device_persistent_memory = 5 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemory() { - return devicePersistentMemory_; - } - - 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 { - getSerializedSize(); - if (getOutputMemoryList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(outputMemoryMemoizedSerializedSize); - } - for (int i = 0; i < outputMemory_.size(); i++) { - output.writeInt64NoTag(outputMemory_.getLong(i)); - } - if (tempMemory_ != 0L) { - output.writeInt64(2, tempMemory_); - } - if (deviceTempMemory_ != 0L) { - output.writeInt64(3, deviceTempMemory_); - } - if (persistentMemory_ != 0L) { - output.writeInt64(4, persistentMemory_); - } - if (devicePersistentMemory_ != 0L) { - output.writeInt64(5, devicePersistentMemory_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < outputMemory_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(outputMemory_.getLong(i)); - } - size += dataSize; - if (!getOutputMemoryList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - outputMemoryMemoizedSerializedSize = dataSize; - } - if (tempMemory_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, tempMemory_); - } - if (deviceTempMemory_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, deviceTempMemory_); - } - if (persistentMemory_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, persistentMemory_); - } - if (devicePersistentMemory_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, devicePersistentMemory_); - } - 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.OpPerformance.OpMemory)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpPerformance.OpMemory other = (org.tensorflow.proto.framework.OpPerformance.OpMemory) obj; - - if (!getOutputMemoryList() - .equals(other.getOutputMemoryList())) return false; - if (getTempMemory() - != other.getTempMemory()) return false; - if (getPersistentMemory() - != other.getPersistentMemory()) return false; - if (getDeviceTempMemory() - != other.getDeviceTempMemory()) return false; - if (getDevicePersistentMemory() - != other.getDevicePersistentMemory()) 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 (getOutputMemoryCount() > 0) { - hash = (37 * hash) + OUTPUT_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + getOutputMemoryList().hashCode(); - } - hash = (37 * hash) + TEMP_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTempMemory()); - hash = (37 * hash) + PERSISTENT_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPersistentMemory()); - hash = (37 * hash) + DEVICE_TEMP_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDeviceTempMemory()); - hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDevicePersistentMemory()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpPerformance.OpMemory parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory 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.OpPerformance.OpMemory parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory 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.OpPerformance.OpMemory parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory 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.OpPerformance.OpMemory parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory 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.OpPerformance.OpMemory parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance.OpMemory 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.OpPerformance.OpMemory 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; - } - /** - *
    -     * Memory usage data for a tensorflow operation.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpPerformance.OpMemory} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformance.OpMemory) - org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformance.OpMemory.class, org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpPerformance.OpMemory.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(); - outputMemory_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - tempMemory_ = 0L; - - persistentMemory_ = 0L; - - deviceTempMemory_ = 0L; - - devicePersistentMemory_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance.OpMemory getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpPerformance.OpMemory.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance.OpMemory build() { - org.tensorflow.proto.framework.OpPerformance.OpMemory result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance.OpMemory buildPartial() { - org.tensorflow.proto.framework.OpPerformance.OpMemory result = new org.tensorflow.proto.framework.OpPerformance.OpMemory(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - outputMemory_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.outputMemory_ = outputMemory_; - result.tempMemory_ = tempMemory_; - result.persistentMemory_ = persistentMemory_; - result.deviceTempMemory_ = deviceTempMemory_; - result.devicePersistentMemory_ = devicePersistentMemory_; - 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.OpPerformance.OpMemory) { - return mergeFrom((org.tensorflow.proto.framework.OpPerformance.OpMemory)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpPerformance.OpMemory other) { - if (other == org.tensorflow.proto.framework.OpPerformance.OpMemory.getDefaultInstance()) return this; - if (!other.outputMemory_.isEmpty()) { - if (outputMemory_.isEmpty()) { - outputMemory_ = other.outputMemory_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOutputMemoryIsMutable(); - outputMemory_.addAll(other.outputMemory_); - } - onChanged(); - } - if (other.getTempMemory() != 0L) { - setTempMemory(other.getTempMemory()); - } - if (other.getPersistentMemory() != 0L) { - setPersistentMemory(other.getPersistentMemory()); - } - if (other.getDeviceTempMemory() != 0L) { - setDeviceTempMemory(other.getDeviceTempMemory()); - } - if (other.getDevicePersistentMemory() != 0L) { - setDevicePersistentMemory(other.getDevicePersistentMemory()); - } - 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.OpPerformance.OpMemory parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpPerformance.OpMemory) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.LongList outputMemory_ = emptyLongList(); - private void ensureOutputMemoryIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - outputMemory_ = mutableCopy(outputMemory_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public java.util.List - getOutputMemoryList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(outputMemory_) : outputMemory_; - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public int getOutputMemoryCount() { - return outputMemory_.size(); - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public long getOutputMemory(int index) { - return outputMemory_.getLong(index); - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public Builder setOutputMemory( - int index, long value) { - ensureOutputMemoryIsMutable(); - outputMemory_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public Builder addOutputMemory(long value) { - ensureOutputMemoryIsMutable(); - outputMemory_.addLong(value); - onChanged(); - return this; - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public Builder addAllOutputMemory( - java.lang.Iterable values) { - ensureOutputMemoryIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputMemory_); - onChanged(); - return this; - } - /** - *
    -       * The output information may have memory usage and output shapes.
    -       * 
    - * - * repeated int64 output_memory = 1; - */ - public Builder clearOutputMemory() { - outputMemory_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private long tempMemory_ ; - /** - *
    -       * Temp and persistent memory allocated by this node.
    -       * 
    - * - * int64 temp_memory = 2; - */ - public long getTempMemory() { - return tempMemory_; - } - /** - *
    -       * Temp and persistent memory allocated by this node.
    -       * 
    - * - * int64 temp_memory = 2; - */ - public Builder setTempMemory(long value) { - - tempMemory_ = value; - onChanged(); - return this; - } - /** - *
    -       * Temp and persistent memory allocated by this node.
    -       * 
    - * - * int64 temp_memory = 2; - */ - public Builder clearTempMemory() { - - tempMemory_ = 0L; - onChanged(); - return this; - } - - private long persistentMemory_ ; - /** - * int64 persistent_memory = 4; - */ - public long getPersistentMemory() { - return persistentMemory_; - } - /** - * int64 persistent_memory = 4; - */ - public Builder setPersistentMemory(long value) { - - persistentMemory_ = value; - onChanged(); - return this; - } - /** - * int64 persistent_memory = 4; - */ - public Builder clearPersistentMemory() { - - persistentMemory_ = 0L; - onChanged(); - return this; - } - - private long deviceTempMemory_ ; - /** - * int64 device_temp_memory = 3 [deprecated = true]; - */ - @java.lang.Deprecated public long getDeviceTempMemory() { - return deviceTempMemory_; - } - /** - * int64 device_temp_memory = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDeviceTempMemory(long value) { - - deviceTempMemory_ = value; - onChanged(); - return this; - } - /** - * int64 device_temp_memory = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDeviceTempMemory() { - - deviceTempMemory_ = 0L; - onChanged(); - return this; - } - - private long devicePersistentMemory_ ; - /** - * int64 device_persistent_memory = 5 [deprecated = true]; - */ - @java.lang.Deprecated public long getDevicePersistentMemory() { - return devicePersistentMemory_; - } - /** - * int64 device_persistent_memory = 5 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setDevicePersistentMemory(long value) { - - devicePersistentMemory_ = value; - onChanged(); - return this; - } - /** - * int64 device_persistent_memory = 5 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearDevicePersistentMemory() { - - devicePersistentMemory_ = 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.OpPerformance.OpMemory) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpPerformance.OpMemory) - private static final org.tensorflow.proto.framework.OpPerformance.OpMemory DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpPerformance.OpMemory(); - } - - public static org.tensorflow.proto.framework.OpPerformance.OpMemory getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpMemory parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpMemory(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.OpPerformance.OpMemory getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int executionTimeCase_ = 0; - private java.lang.Object executionTime_; - public enum ExecutionTimeCase - implements com.google.protobuf.Internal.EnumLite { - EXECUTION_TIME_NORMAL(10), - EXECUTION_TIME_LOG_NORMAL(11), - EXECUTIONTIME_NOT_SET(0); - private final int value; - private ExecutionTimeCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ExecutionTimeCase valueOf(int value) { - return forNumber(value); - } - - public static ExecutionTimeCase forNumber(int value) { - switch (value) { - case 10: return EXECUTION_TIME_NORMAL; - case 11: return EXECUTION_TIME_LOG_NORMAL; - case 0: return EXECUTIONTIME_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ExecutionTimeCase - getExecutionTimeCase() { - return ExecutionTimeCase.forNumber( - executionTimeCase_); - } - - public static final int OP_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.OpInfo op_; - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public boolean hasOp() { - return op_ != null; - } - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public org.tensorflow.proto.framework.OpInfo getOp() { - return op_ == null ? org.tensorflow.proto.framework.OpInfo.getDefaultInstance() : op_; - } - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public org.tensorflow.proto.framework.OpInfoOrBuilder getOpOrBuilder() { - return getOp(); - } - - public static final int SESSION_INFO_FIELD_NUMBER = 12; - private org.tensorflow.proto.framework.SessionInfo sessionInfo_; - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public boolean hasSessionInfo() { - return sessionInfo_ != null; - } - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.framework.SessionInfo getSessionInfo() { - return sessionInfo_ == null ? org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder() { - return getSessionInfo(); - } - - public static final int NODE_FIELD_NUMBER = 5; - private volatile java.lang.Object node_; - /** - *
    -   * The node name (optional). Makes it easier to associate the performance data
    -   * with a specific graph node.
    -   * 
    - * - * string node = 5; - */ - public java.lang.String getNode() { - java.lang.Object ref = node_; - 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(); - node_ = s; - return s; - } - } - /** - *
    -   * The node name (optional). Makes it easier to associate the performance data
    -   * with a specific graph node.
    -   * 
    - * - * string node = 5; - */ - public com.google.protobuf.ByteString - getNodeBytes() { - java.lang.Object ref = node_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - node_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TEMPORARY_MEMORY_SIZE_FIELD_NUMBER = 2; - private long temporaryMemorySize_; - /** - *
    -   * Temporary memory used by this node (in bytes).
    -   * 
    - * - * int64 temporary_memory_size = 2; - */ - public long getTemporaryMemorySize() { - return temporaryMemorySize_; - } - - public static final int COMPUTE_COST_FIELD_NUMBER = 3; - private long computeCost_; - /** - *
    -   * Time it takes to run the op (in nanoseconds).
    -   * 
    - * - * int64 compute_cost = 3; - */ - public long getComputeCost() { - return computeCost_; - } - - public static final int COMPUTE_TIME_FIELD_NUMBER = 6; - private long computeTime_; - /** - *
    -   * Analytical compute cost (in nanoseconds).
    -   * 
    - * - * int64 compute_time = 6; - */ - public long getComputeTime() { - return computeTime_; - } - - public static final int MEMORY_TIME_FIELD_NUMBER = 7; - private long memoryTime_; - /** - *
    -   * Analytical memory access cost (in nanoseconds).
    -   * 
    - * - * int64 memory_time = 7; - */ - public long getMemoryTime() { - return memoryTime_; - } - - public static final int COMPUTE_EFFICIENCY_FIELD_NUMBER = 4; - private double computeEfficiency_; - /** - *
    -   * Percentage of theoretical compute performance.
    -   * 
    - * - * double compute_efficiency = 4; - */ - public double getComputeEfficiency() { - return computeEfficiency_; - } - - public static final int MEMORY_EFFICIENCY_FIELD_NUMBER = 8; - private double memoryEfficiency_; - /** - *
    -   * Percentage of theoretical memory performance.
    -   * 
    - * - * double memory_efficiency = 8; - */ - public double getMemoryEfficiency() { - return memoryEfficiency_; - } - - public static final int EXECUTION_TIME_NORMAL_FIELD_NUMBER = 10; - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public boolean hasExecutionTimeNormal() { - return executionTimeCase_ == 10; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public org.tensorflow.proto.framework.NormalDistribution getExecutionTimeNormal() { - if (executionTimeCase_ == 10) { - return (org.tensorflow.proto.framework.NormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public org.tensorflow.proto.framework.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder() { - if (executionTimeCase_ == 10) { - return (org.tensorflow.proto.framework.NormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - - public static final int EXECUTION_TIME_LOG_NORMAL_FIELD_NUMBER = 11; - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public boolean hasExecutionTimeLogNormal() { - return executionTimeCase_ == 11; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public org.tensorflow.proto.framework.LogNormalDistribution getExecutionTimeLogNormal() { - if (executionTimeCase_ == 11) { - return (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public org.tensorflow.proto.framework.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder() { - if (executionTimeCase_ == 11) { - return (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - - public static final int OP_MEMORY_FIELD_NUMBER = 9; - private org.tensorflow.proto.framework.OpPerformance.OpMemory opMemory_; - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public boolean hasOpMemory() { - return opMemory_ != null; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public org.tensorflow.proto.framework.OpPerformance.OpMemory getOpMemory() { - return opMemory_ == null ? org.tensorflow.proto.framework.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder() { - return getOpMemory(); - } - - 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 (op_ != null) { - output.writeMessage(1, getOp()); - } - if (temporaryMemorySize_ != 0L) { - output.writeInt64(2, temporaryMemorySize_); - } - if (computeCost_ != 0L) { - output.writeInt64(3, computeCost_); - } - if (computeEfficiency_ != 0D) { - output.writeDouble(4, computeEfficiency_); - } - if (!getNodeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, node_); - } - if (computeTime_ != 0L) { - output.writeInt64(6, computeTime_); - } - if (memoryTime_ != 0L) { - output.writeInt64(7, memoryTime_); - } - if (memoryEfficiency_ != 0D) { - output.writeDouble(8, memoryEfficiency_); - } - if (opMemory_ != null) { - output.writeMessage(9, getOpMemory()); - } - if (executionTimeCase_ == 10) { - output.writeMessage(10, (org.tensorflow.proto.framework.NormalDistribution) executionTime_); - } - if (executionTimeCase_ == 11) { - output.writeMessage(11, (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_); - } - if (sessionInfo_ != null) { - output.writeMessage(12, getSessionInfo()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (op_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getOp()); - } - if (temporaryMemorySize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, temporaryMemorySize_); - } - if (computeCost_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, computeCost_); - } - if (computeEfficiency_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, computeEfficiency_); - } - if (!getNodeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, node_); - } - if (computeTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, computeTime_); - } - if (memoryTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(7, memoryTime_); - } - if (memoryEfficiency_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(8, memoryEfficiency_); - } - if (opMemory_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getOpMemory()); - } - if (executionTimeCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (org.tensorflow.proto.framework.NormalDistribution) executionTime_); - } - if (executionTimeCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_); - } - if (sessionInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, getSessionInfo()); - } - 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.OpPerformance)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpPerformance other = (org.tensorflow.proto.framework.OpPerformance) obj; - - if (hasOp() != other.hasOp()) return false; - if (hasOp()) { - if (!getOp() - .equals(other.getOp())) return false; - } - if (hasSessionInfo() != other.hasSessionInfo()) return false; - if (hasSessionInfo()) { - if (!getSessionInfo() - .equals(other.getSessionInfo())) return false; - } - if (!getNode() - .equals(other.getNode())) return false; - if (getTemporaryMemorySize() - != other.getTemporaryMemorySize()) return false; - if (getComputeCost() - != other.getComputeCost()) return false; - if (getComputeTime() - != other.getComputeTime()) return false; - if (getMemoryTime() - != other.getMemoryTime()) return false; - if (java.lang.Double.doubleToLongBits(getComputeEfficiency()) - != java.lang.Double.doubleToLongBits( - other.getComputeEfficiency())) return false; - if (java.lang.Double.doubleToLongBits(getMemoryEfficiency()) - != java.lang.Double.doubleToLongBits( - other.getMemoryEfficiency())) return false; - if (hasOpMemory() != other.hasOpMemory()) return false; - if (hasOpMemory()) { - if (!getOpMemory() - .equals(other.getOpMemory())) return false; - } - if (!getExecutionTimeCase().equals(other.getExecutionTimeCase())) return false; - switch (executionTimeCase_) { - case 10: - if (!getExecutionTimeNormal() - .equals(other.getExecutionTimeNormal())) return false; - break; - case 11: - if (!getExecutionTimeLogNormal() - .equals(other.getExecutionTimeLogNormal())) return false; - break; - case 0: - default: - } - 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 (hasOp()) { - hash = (37 * hash) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOp().hashCode(); - } - if (hasSessionInfo()) { - hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; - hash = (53 * hash) + getSessionInfo().hashCode(); - } - hash = (37 * hash) + NODE_FIELD_NUMBER; - hash = (53 * hash) + getNode().hashCode(); - hash = (37 * hash) + TEMPORARY_MEMORY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTemporaryMemorySize()); - hash = (37 * hash) + COMPUTE_COST_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getComputeCost()); - hash = (37 * hash) + COMPUTE_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getComputeTime()); - hash = (37 * hash) + MEMORY_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMemoryTime()); - hash = (37 * hash) + COMPUTE_EFFICIENCY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getComputeEfficiency())); - hash = (37 * hash) + MEMORY_EFFICIENCY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMemoryEfficiency())); - if (hasOpMemory()) { - hash = (37 * hash) + OP_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + getOpMemory().hashCode(); - } - switch (executionTimeCase_) { - case 10: - hash = (37 * hash) + EXECUTION_TIME_NORMAL_FIELD_NUMBER; - hash = (53 * hash) + getExecutionTimeNormal().hashCode(); - break; - case 11: - hash = (37 * hash) + EXECUTION_TIME_LOG_NORMAL_FIELD_NUMBER; - hash = (53 * hash) + getExecutionTimeLogNormal().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpPerformance parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance 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.OpPerformance parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance 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.OpPerformance parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformance parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpPerformance parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance 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.OpPerformance parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance 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.OpPerformance parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformance 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.OpPerformance 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; - } - /** - *
    -   * Performance data for tensorflow operations
    -   * 
    - * - * Protobuf type {@code tensorflow.OpPerformance} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformance) - org.tensorflow.proto.framework.OpPerformanceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformance.class, org.tensorflow.proto.framework.OpPerformance.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpPerformance.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 (opBuilder_ == null) { - op_ = null; - } else { - op_ = null; - opBuilder_ = null; - } - if (sessionInfoBuilder_ == null) { - sessionInfo_ = null; - } else { - sessionInfo_ = null; - sessionInfoBuilder_ = null; - } - node_ = ""; - - temporaryMemorySize_ = 0L; - - computeCost_ = 0L; - - computeTime_ = 0L; - - memoryTime_ = 0L; - - computeEfficiency_ = 0D; - - memoryEfficiency_ = 0D; - - if (opMemoryBuilder_ == null) { - opMemory_ = null; - } else { - opMemory_ = null; - opMemoryBuilder_ = null; - } - executionTimeCase_ = 0; - executionTime_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformance_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpPerformance.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance build() { - org.tensorflow.proto.framework.OpPerformance result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformance buildPartial() { - org.tensorflow.proto.framework.OpPerformance result = new org.tensorflow.proto.framework.OpPerformance(this); - if (opBuilder_ == null) { - result.op_ = op_; - } else { - result.op_ = opBuilder_.build(); - } - if (sessionInfoBuilder_ == null) { - result.sessionInfo_ = sessionInfo_; - } else { - result.sessionInfo_ = sessionInfoBuilder_.build(); - } - result.node_ = node_; - result.temporaryMemorySize_ = temporaryMemorySize_; - result.computeCost_ = computeCost_; - result.computeTime_ = computeTime_; - result.memoryTime_ = memoryTime_; - result.computeEfficiency_ = computeEfficiency_; - result.memoryEfficiency_ = memoryEfficiency_; - if (executionTimeCase_ == 10) { - if (executionTimeNormalBuilder_ == null) { - result.executionTime_ = executionTime_; - } else { - result.executionTime_ = executionTimeNormalBuilder_.build(); - } - } - if (executionTimeCase_ == 11) { - if (executionTimeLogNormalBuilder_ == null) { - result.executionTime_ = executionTime_; - } else { - result.executionTime_ = executionTimeLogNormalBuilder_.build(); - } - } - if (opMemoryBuilder_ == null) { - result.opMemory_ = opMemory_; - } else { - result.opMemory_ = opMemoryBuilder_.build(); - } - result.executionTimeCase_ = executionTimeCase_; - 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.OpPerformance) { - return mergeFrom((org.tensorflow.proto.framework.OpPerformance)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpPerformance other) { - if (other == org.tensorflow.proto.framework.OpPerformance.getDefaultInstance()) return this; - if (other.hasOp()) { - mergeOp(other.getOp()); - } - if (other.hasSessionInfo()) { - mergeSessionInfo(other.getSessionInfo()); - } - if (!other.getNode().isEmpty()) { - node_ = other.node_; - onChanged(); - } - if (other.getTemporaryMemorySize() != 0L) { - setTemporaryMemorySize(other.getTemporaryMemorySize()); - } - if (other.getComputeCost() != 0L) { - setComputeCost(other.getComputeCost()); - } - if (other.getComputeTime() != 0L) { - setComputeTime(other.getComputeTime()); - } - if (other.getMemoryTime() != 0L) { - setMemoryTime(other.getMemoryTime()); - } - if (other.getComputeEfficiency() != 0D) { - setComputeEfficiency(other.getComputeEfficiency()); - } - if (other.getMemoryEfficiency() != 0D) { - setMemoryEfficiency(other.getMemoryEfficiency()); - } - if (other.hasOpMemory()) { - mergeOpMemory(other.getOpMemory()); - } - switch (other.getExecutionTimeCase()) { - case EXECUTION_TIME_NORMAL: { - mergeExecutionTimeNormal(other.getExecutionTimeNormal()); - break; - } - case EXECUTION_TIME_LOG_NORMAL: { - mergeExecutionTimeLogNormal(other.getExecutionTimeLogNormal()); - break; - } - case EXECUTIONTIME_NOT_SET: { - break; - } - } - 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.OpPerformance parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpPerformance) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int executionTimeCase_ = 0; - private java.lang.Object executionTime_; - public ExecutionTimeCase - getExecutionTimeCase() { - return ExecutionTimeCase.forNumber( - executionTimeCase_); - } - - public Builder clearExecutionTime() { - executionTimeCase_ = 0; - executionTime_ = null; - onChanged(); - return this; - } - - - private org.tensorflow.proto.framework.OpInfo op_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo, org.tensorflow.proto.framework.OpInfo.Builder, org.tensorflow.proto.framework.OpInfoOrBuilder> opBuilder_; - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public boolean hasOp() { - return opBuilder_ != null || op_ != null; - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public org.tensorflow.proto.framework.OpInfo getOp() { - if (opBuilder_ == null) { - return op_ == null ? org.tensorflow.proto.framework.OpInfo.getDefaultInstance() : op_; - } else { - return opBuilder_.getMessage(); - } - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public Builder setOp(org.tensorflow.proto.framework.OpInfo value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - op_ = value; - onChanged(); - } else { - opBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public Builder setOp( - org.tensorflow.proto.framework.OpInfo.Builder builderForValue) { - if (opBuilder_ == null) { - op_ = builderForValue.build(); - onChanged(); - } else { - opBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public Builder mergeOp(org.tensorflow.proto.framework.OpInfo value) { - if (opBuilder_ == null) { - if (op_ != null) { - op_ = - org.tensorflow.proto.framework.OpInfo.newBuilder(op_).mergeFrom(value).buildPartial(); - } else { - op_ = value; - } - onChanged(); - } else { - opBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public Builder clearOp() { - if (opBuilder_ == null) { - op_ = null; - onChanged(); - } else { - op_ = null; - opBuilder_ = null; - } - - return this; - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public org.tensorflow.proto.framework.OpInfo.Builder getOpBuilder() { - - onChanged(); - return getOpFieldBuilder().getBuilder(); - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - public org.tensorflow.proto.framework.OpInfoOrBuilder getOpOrBuilder() { - if (opBuilder_ != null) { - return opBuilder_.getMessageOrBuilder(); - } else { - return op_ == null ? - org.tensorflow.proto.framework.OpInfo.getDefaultInstance() : op_; - } - } - /** - *
    -     * The op
    -     * 
    - * - * .tensorflow.OpInfo op = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo, org.tensorflow.proto.framework.OpInfo.Builder, org.tensorflow.proto.framework.OpInfoOrBuilder> - getOpFieldBuilder() { - if (opBuilder_ == null) { - opBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpInfo, org.tensorflow.proto.framework.OpInfo.Builder, org.tensorflow.proto.framework.OpInfoOrBuilder>( - getOp(), - getParentForChildren(), - isClean()); - op_ = null; - } - return opBuilder_; - } - - private org.tensorflow.proto.framework.SessionInfo sessionInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder> sessionInfoBuilder_; - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public boolean hasSessionInfo() { - return sessionInfoBuilder_ != null || sessionInfo_ != null; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.framework.SessionInfo getSessionInfo() { - if (sessionInfoBuilder_ == null) { - return sessionInfo_ == null ? org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } else { - return sessionInfoBuilder_.getMessage(); - } - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setSessionInfo(org.tensorflow.proto.framework.SessionInfo value) { - if (sessionInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sessionInfo_ = value; - onChanged(); - } else { - sessionInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setSessionInfo( - org.tensorflow.proto.framework.SessionInfo.Builder builderForValue) { - if (sessionInfoBuilder_ == null) { - sessionInfo_ = builderForValue.build(); - onChanged(); - } else { - sessionInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public Builder mergeSessionInfo(org.tensorflow.proto.framework.SessionInfo value) { - if (sessionInfoBuilder_ == null) { - if (sessionInfo_ != null) { - sessionInfo_ = - org.tensorflow.proto.framework.SessionInfo.newBuilder(sessionInfo_).mergeFrom(value).buildPartial(); - } else { - sessionInfo_ = value; - } - onChanged(); - } else { - sessionInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearSessionInfo() { - if (sessionInfoBuilder_ == null) { - sessionInfo_ = null; - onChanged(); - } else { - sessionInfo_ = null; - sessionInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.framework.SessionInfo.Builder getSessionInfoBuilder() { - - onChanged(); - return getSessionInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder() { - if (sessionInfoBuilder_ != null) { - return sessionInfoBuilder_.getMessageOrBuilder(); - } else { - return sessionInfo_ == null ? - org.tensorflow.proto.framework.SessionInfo.getDefaultInstance() : sessionInfo_; - } - } - /** - *
    -     * Information about the session configs.
    -     * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder> - getSessionInfoFieldBuilder() { - if (sessionInfoBuilder_ == null) { - sessionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SessionInfo, org.tensorflow.proto.framework.SessionInfo.Builder, org.tensorflow.proto.framework.SessionInfoOrBuilder>( - getSessionInfo(), - getParentForChildren(), - isClean()); - sessionInfo_ = null; - } - return sessionInfoBuilder_; - } - - private java.lang.Object node_ = ""; - /** - *
    -     * The node name (optional). Makes it easier to associate the performance data
    -     * with a specific graph node.
    -     * 
    - * - * string node = 5; - */ - public java.lang.String getNode() { - java.lang.Object ref = node_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - node_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The node name (optional). Makes it easier to associate the performance data
    -     * with a specific graph node.
    -     * 
    - * - * string node = 5; - */ - public com.google.protobuf.ByteString - getNodeBytes() { - java.lang.Object ref = node_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - node_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The node name (optional). Makes it easier to associate the performance data
    -     * with a specific graph node.
    -     * 
    - * - * string node = 5; - */ - public Builder setNode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - node_ = value; - onChanged(); - return this; - } - /** - *
    -     * The node name (optional). Makes it easier to associate the performance data
    -     * with a specific graph node.
    -     * 
    - * - * string node = 5; - */ - public Builder clearNode() { - - node_ = getDefaultInstance().getNode(); - onChanged(); - return this; - } - /** - *
    -     * The node name (optional). Makes it easier to associate the performance data
    -     * with a specific graph node.
    -     * 
    - * - * string node = 5; - */ - public Builder setNodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - node_ = value; - onChanged(); - return this; - } - - private long temporaryMemorySize_ ; - /** - *
    -     * Temporary memory used by this node (in bytes).
    -     * 
    - * - * int64 temporary_memory_size = 2; - */ - public long getTemporaryMemorySize() { - return temporaryMemorySize_; - } - /** - *
    -     * Temporary memory used by this node (in bytes).
    -     * 
    - * - * int64 temporary_memory_size = 2; - */ - public Builder setTemporaryMemorySize(long value) { - - temporaryMemorySize_ = value; - onChanged(); - return this; - } - /** - *
    -     * Temporary memory used by this node (in bytes).
    -     * 
    - * - * int64 temporary_memory_size = 2; - */ - public Builder clearTemporaryMemorySize() { - - temporaryMemorySize_ = 0L; - onChanged(); - return this; - } - - private long computeCost_ ; - /** - *
    -     * Time it takes to run the op (in nanoseconds).
    -     * 
    - * - * int64 compute_cost = 3; - */ - public long getComputeCost() { - return computeCost_; - } - /** - *
    -     * Time it takes to run the op (in nanoseconds).
    -     * 
    - * - * int64 compute_cost = 3; - */ - public Builder setComputeCost(long value) { - - computeCost_ = value; - onChanged(); - return this; - } - /** - *
    -     * Time it takes to run the op (in nanoseconds).
    -     * 
    - * - * int64 compute_cost = 3; - */ - public Builder clearComputeCost() { - - computeCost_ = 0L; - onChanged(); - return this; - } - - private long computeTime_ ; - /** - *
    -     * Analytical compute cost (in nanoseconds).
    -     * 
    - * - * int64 compute_time = 6; - */ - public long getComputeTime() { - return computeTime_; - } - /** - *
    -     * Analytical compute cost (in nanoseconds).
    -     * 
    - * - * int64 compute_time = 6; - */ - public Builder setComputeTime(long value) { - - computeTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Analytical compute cost (in nanoseconds).
    -     * 
    - * - * int64 compute_time = 6; - */ - public Builder clearComputeTime() { - - computeTime_ = 0L; - onChanged(); - return this; - } - - private long memoryTime_ ; - /** - *
    -     * Analytical memory access cost (in nanoseconds).
    -     * 
    - * - * int64 memory_time = 7; - */ - public long getMemoryTime() { - return memoryTime_; - } - /** - *
    -     * Analytical memory access cost (in nanoseconds).
    -     * 
    - * - * int64 memory_time = 7; - */ - public Builder setMemoryTime(long value) { - - memoryTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Analytical memory access cost (in nanoseconds).
    -     * 
    - * - * int64 memory_time = 7; - */ - public Builder clearMemoryTime() { - - memoryTime_ = 0L; - onChanged(); - return this; - } - - private double computeEfficiency_ ; - /** - *
    -     * Percentage of theoretical compute performance.
    -     * 
    - * - * double compute_efficiency = 4; - */ - public double getComputeEfficiency() { - return computeEfficiency_; - } - /** - *
    -     * Percentage of theoretical compute performance.
    -     * 
    - * - * double compute_efficiency = 4; - */ - public Builder setComputeEfficiency(double value) { - - computeEfficiency_ = value; - onChanged(); - return this; - } - /** - *
    -     * Percentage of theoretical compute performance.
    -     * 
    - * - * double compute_efficiency = 4; - */ - public Builder clearComputeEfficiency() { - - computeEfficiency_ = 0D; - onChanged(); - return this; - } - - private double memoryEfficiency_ ; - /** - *
    -     * Percentage of theoretical memory performance.
    -     * 
    - * - * double memory_efficiency = 8; - */ - public double getMemoryEfficiency() { - return memoryEfficiency_; - } - /** - *
    -     * Percentage of theoretical memory performance.
    -     * 
    - * - * double memory_efficiency = 8; - */ - public Builder setMemoryEfficiency(double value) { - - memoryEfficiency_ = value; - onChanged(); - return this; - } - /** - *
    -     * Percentage of theoretical memory performance.
    -     * 
    - * - * double memory_efficiency = 8; - */ - public Builder clearMemoryEfficiency() { - - memoryEfficiency_ = 0D; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NormalDistribution, org.tensorflow.proto.framework.NormalDistribution.Builder, org.tensorflow.proto.framework.NormalDistributionOrBuilder> executionTimeNormalBuilder_; - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public boolean hasExecutionTimeNormal() { - return executionTimeCase_ == 10; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public org.tensorflow.proto.framework.NormalDistribution getExecutionTimeNormal() { - if (executionTimeNormalBuilder_ == null) { - if (executionTimeCase_ == 10) { - return (org.tensorflow.proto.framework.NormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } else { - if (executionTimeCase_ == 10) { - return executionTimeNormalBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public Builder setExecutionTimeNormal(org.tensorflow.proto.framework.NormalDistribution value) { - if (executionTimeNormalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - executionTime_ = value; - onChanged(); - } else { - executionTimeNormalBuilder_.setMessage(value); - } - executionTimeCase_ = 10; - return this; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public Builder setExecutionTimeNormal( - org.tensorflow.proto.framework.NormalDistribution.Builder builderForValue) { - if (executionTimeNormalBuilder_ == null) { - executionTime_ = builderForValue.build(); - onChanged(); - } else { - executionTimeNormalBuilder_.setMessage(builderForValue.build()); - } - executionTimeCase_ = 10; - return this; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public Builder mergeExecutionTimeNormal(org.tensorflow.proto.framework.NormalDistribution value) { - if (executionTimeNormalBuilder_ == null) { - if (executionTimeCase_ == 10 && - executionTime_ != org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance()) { - executionTime_ = org.tensorflow.proto.framework.NormalDistribution.newBuilder((org.tensorflow.proto.framework.NormalDistribution) executionTime_) - .mergeFrom(value).buildPartial(); - } else { - executionTime_ = value; - } - onChanged(); - } else { - if (executionTimeCase_ == 10) { - executionTimeNormalBuilder_.mergeFrom(value); - } - executionTimeNormalBuilder_.setMessage(value); - } - executionTimeCase_ = 10; - return this; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public Builder clearExecutionTimeNormal() { - if (executionTimeNormalBuilder_ == null) { - if (executionTimeCase_ == 10) { - executionTimeCase_ = 0; - executionTime_ = null; - onChanged(); - } - } else { - if (executionTimeCase_ == 10) { - executionTimeCase_ = 0; - executionTime_ = null; - } - executionTimeNormalBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public org.tensorflow.proto.framework.NormalDistribution.Builder getExecutionTimeNormalBuilder() { - return getExecutionTimeNormalFieldBuilder().getBuilder(); - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - public org.tensorflow.proto.framework.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder() { - if ((executionTimeCase_ == 10) && (executionTimeNormalBuilder_ != null)) { - return executionTimeNormalBuilder_.getMessageOrBuilder(); - } else { - if (executionTimeCase_ == 10) { - return (org.tensorflow.proto.framework.NormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - } - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NormalDistribution, org.tensorflow.proto.framework.NormalDistribution.Builder, org.tensorflow.proto.framework.NormalDistributionOrBuilder> - getExecutionTimeNormalFieldBuilder() { - if (executionTimeNormalBuilder_ == null) { - if (!(executionTimeCase_ == 10)) { - executionTime_ = org.tensorflow.proto.framework.NormalDistribution.getDefaultInstance(); - } - executionTimeNormalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NormalDistribution, org.tensorflow.proto.framework.NormalDistribution.Builder, org.tensorflow.proto.framework.NormalDistributionOrBuilder>( - (org.tensorflow.proto.framework.NormalDistribution) executionTime_, - getParentForChildren(), - isClean()); - executionTime_ = null; - } - executionTimeCase_ = 10; - onChanged();; - return executionTimeNormalBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LogNormalDistribution, org.tensorflow.proto.framework.LogNormalDistribution.Builder, org.tensorflow.proto.framework.LogNormalDistributionOrBuilder> executionTimeLogNormalBuilder_; - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public boolean hasExecutionTimeLogNormal() { - return executionTimeCase_ == 11; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public org.tensorflow.proto.framework.LogNormalDistribution getExecutionTimeLogNormal() { - if (executionTimeLogNormalBuilder_ == null) { - if (executionTimeCase_ == 11) { - return (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } else { - if (executionTimeCase_ == 11) { - return executionTimeLogNormalBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public Builder setExecutionTimeLogNormal(org.tensorflow.proto.framework.LogNormalDistribution value) { - if (executionTimeLogNormalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - executionTime_ = value; - onChanged(); - } else { - executionTimeLogNormalBuilder_.setMessage(value); - } - executionTimeCase_ = 11; - return this; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public Builder setExecutionTimeLogNormal( - org.tensorflow.proto.framework.LogNormalDistribution.Builder builderForValue) { - if (executionTimeLogNormalBuilder_ == null) { - executionTime_ = builderForValue.build(); - onChanged(); - } else { - executionTimeLogNormalBuilder_.setMessage(builderForValue.build()); - } - executionTimeCase_ = 11; - return this; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public Builder mergeExecutionTimeLogNormal(org.tensorflow.proto.framework.LogNormalDistribution value) { - if (executionTimeLogNormalBuilder_ == null) { - if (executionTimeCase_ == 11 && - executionTime_ != org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance()) { - executionTime_ = org.tensorflow.proto.framework.LogNormalDistribution.newBuilder((org.tensorflow.proto.framework.LogNormalDistribution) executionTime_) - .mergeFrom(value).buildPartial(); - } else { - executionTime_ = value; - } - onChanged(); - } else { - if (executionTimeCase_ == 11) { - executionTimeLogNormalBuilder_.mergeFrom(value); - } - executionTimeLogNormalBuilder_.setMessage(value); - } - executionTimeCase_ = 11; - return this; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public Builder clearExecutionTimeLogNormal() { - if (executionTimeLogNormalBuilder_ == null) { - if (executionTimeCase_ == 11) { - executionTimeCase_ = 0; - executionTime_ = null; - onChanged(); - } - } else { - if (executionTimeCase_ == 11) { - executionTimeCase_ = 0; - executionTime_ = null; - } - executionTimeLogNormalBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public org.tensorflow.proto.framework.LogNormalDistribution.Builder getExecutionTimeLogNormalBuilder() { - return getExecutionTimeLogNormalFieldBuilder().getBuilder(); - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - public org.tensorflow.proto.framework.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder() { - if ((executionTimeCase_ == 11) && (executionTimeLogNormalBuilder_ != null)) { - return executionTimeLogNormalBuilder_.getMessageOrBuilder(); - } else { - if (executionTimeCase_ == 11) { - return (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_; - } - return org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - } - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LogNormalDistribution, org.tensorflow.proto.framework.LogNormalDistribution.Builder, org.tensorflow.proto.framework.LogNormalDistributionOrBuilder> - getExecutionTimeLogNormalFieldBuilder() { - if (executionTimeLogNormalBuilder_ == null) { - if (!(executionTimeCase_ == 11)) { - executionTime_ = org.tensorflow.proto.framework.LogNormalDistribution.getDefaultInstance(); - } - executionTimeLogNormalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.LogNormalDistribution, org.tensorflow.proto.framework.LogNormalDistribution.Builder, org.tensorflow.proto.framework.LogNormalDistributionOrBuilder>( - (org.tensorflow.proto.framework.LogNormalDistribution) executionTime_, - getParentForChildren(), - isClean()); - executionTime_ = null; - } - executionTimeCase_ = 11; - onChanged();; - return executionTimeLogNormalBuilder_; - } - - private org.tensorflow.proto.framework.OpPerformance.OpMemory opMemory_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance.OpMemory, org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder, org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder> opMemoryBuilder_; - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public boolean hasOpMemory() { - return opMemoryBuilder_ != null || opMemory_ != null; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public org.tensorflow.proto.framework.OpPerformance.OpMemory getOpMemory() { - if (opMemoryBuilder_ == null) { - return opMemory_ == null ? org.tensorflow.proto.framework.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; - } else { - return opMemoryBuilder_.getMessage(); - } - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public Builder setOpMemory(org.tensorflow.proto.framework.OpPerformance.OpMemory value) { - if (opMemoryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - opMemory_ = value; - onChanged(); - } else { - opMemoryBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public Builder setOpMemory( - org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder builderForValue) { - if (opMemoryBuilder_ == null) { - opMemory_ = builderForValue.build(); - onChanged(); - } else { - opMemoryBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public Builder mergeOpMemory(org.tensorflow.proto.framework.OpPerformance.OpMemory value) { - if (opMemoryBuilder_ == null) { - if (opMemory_ != null) { - opMemory_ = - org.tensorflow.proto.framework.OpPerformance.OpMemory.newBuilder(opMemory_).mergeFrom(value).buildPartial(); - } else { - opMemory_ = value; - } - onChanged(); - } else { - opMemoryBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public Builder clearOpMemory() { - if (opMemoryBuilder_ == null) { - opMemory_ = null; - onChanged(); - } else { - opMemory_ = null; - opMemoryBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder getOpMemoryBuilder() { - - onChanged(); - return getOpMemoryFieldBuilder().getBuilder(); - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - public org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder() { - if (opMemoryBuilder_ != null) { - return opMemoryBuilder_.getMessageOrBuilder(); - } else { - return opMemory_ == null ? - org.tensorflow.proto.framework.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; - } - } - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance.OpMemory, org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder, org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder> - getOpMemoryFieldBuilder() { - if (opMemoryBuilder_ == null) { - opMemoryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance.OpMemory, org.tensorflow.proto.framework.OpPerformance.OpMemory.Builder, org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder>( - getOpMemory(), - getParentForChildren(), - isClean()); - opMemory_ = null; - } - return opMemoryBuilder_; - } - @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.OpPerformance) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpPerformance) - private static final org.tensorflow.proto.framework.OpPerformance DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpPerformance(); - } - - public static org.tensorflow.proto.framework.OpPerformance getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpPerformance parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpPerformance(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.OpPerformance getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceDataProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceDataProtos.java deleted file mode 100644 index 4c3fcec5afa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceDataProtos.java +++ /dev/null @@ -1,186 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public final class OpPerformanceDataProtos { - private OpPerformanceDataProtos() {} - 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_SessionInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SessionInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpInfo_AttrEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpInfo_AttrEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpInfo_TensorProperties_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NormalDistribution_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NormalDistribution_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_LogNormalDistribution_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpPerformance_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpPerformance_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpPerformance_OpMemory_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpPerformanceList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpPerformanceList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n8tensorflow/core/grappler/costs/op_perf" + - "ormance_data.proto\022\ntensorflow\032&tensorfl" + - "ow/core/framework/tensor.proto\032,tensorfl" + - "ow/core/framework/tensor_shape.proto\032%te" + - "nsorflow/core/framework/types.proto\032*ten" + - "sorflow/core/framework/attr_value.proto\032" + - "0tensorflow/core/protobuf/device_propert" + - "ies.proto\"+\n\013SessionInfo\022\034\n\024intra_op_par" + - "allelism\030\001 \001(\003\"\333\003\n\006OpInfo\022\n\n\002op\030\001 \001(\t\022*\n" + - "\004attr\030\002 \003(\0132\034.tensorflow.OpInfo.AttrEntr" + - "y\0223\n\006inputs\030\003 \003(\0132#.tensorflow.OpInfo.Te" + - "nsorProperties\0224\n\007outputs\030\005 \003(\0132#.tensor" + - "flow.OpInfo.TensorProperties\022,\n\006device\030\004" + - " \001(\0132\034.tensorflow.DeviceProperties\022-\n\014se" + - "ssion_info\030\006 \001(\0132\027.tensorflow.SessionInf" + - "o\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001" + - "(\0132\025.tensorflow.AttrValue:\0028\001\032\214\001\n\020Tensor" + - "Properties\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.D" + - "ataType\022+\n\005shape\030\002 \001(\0132\034.tensorflow.Tens" + - "orShapeProto\022&\n\005value\030\003 \001(\0132\027.tensorflow" + - ".TensorProto\"/\n\022NormalDistribution\022\n\n\002mu" + - "\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"2\n\025LogNormalDistri" + - "bution\022\n\n\002mu\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"\363\004\n\rOp" + - "Performance\022\036\n\002op\030\001 \001(\0132\022.tensorflow.OpI" + - "nfo\0221\n\014session_info\030\014 \001(\0132\027.tensorflow.S" + - "essionInfoB\002\030\001\022\014\n\004node\030\005 \001(\t\022\035\n\025temporar" + - "y_memory_size\030\002 \001(\003\022\024\n\014compute_cost\030\003 \001(" + - "\003\022\024\n\014compute_time\030\006 \001(\003\022\023\n\013memory_time\030\007" + - " \001(\003\022\032\n\022compute_efficiency\030\004 \001(\001\022\031\n\021memo" + - "ry_efficiency\030\010 \001(\001\022?\n\025execution_time_no" + - "rmal\030\n \001(\0132\036.tensorflow.NormalDistributi" + - "onH\000\022F\n\031execution_time_log_normal\030\013 \001(\0132" + - "!.tensorflow.LogNormalDistributionH\000\0225\n\t" + - "op_memory\030\t \001(\0132\".tensorflow.OpPerforman" + - "ce.OpMemory\032\227\001\n\010OpMemory\022\025\n\routput_memor" + - "y\030\001 \003(\003\022\023\n\013temp_memory\030\002 \001(\003\022\031\n\021persiste" + - "nt_memory\030\004 \001(\003\022\036\n\022device_temp_memory\030\003 " + - "\001(\003B\002\030\001\022$\n\030device_persistent_memory\030\005 \001(" + - "\003B\002\030\001B\020\n\016execution_time\"F\n\021OpPerformance" + - "List\0221\n\016op_performance\030\001 \003(\0132\031.tensorflo" + - "w.OpPerformanceB>\n\036org.tensorflow.proto." + - "frameworkB\027OpPerformanceDataProtosP\001\370\001\001b" + - "\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - org.tensorflow.proto.framework.DevicePropertiesProtos.getDescriptor(), - }); - internal_static_tensorflow_SessionInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SessionInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SessionInfo_descriptor, - new java.lang.String[] { "IntraOpParallelism", }); - internal_static_tensorflow_OpInfo_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_OpInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpInfo_descriptor, - new java.lang.String[] { "Op", "Attr", "Inputs", "Outputs", "Device", "SessionInfo", }); - internal_static_tensorflow_OpInfo_AttrEntry_descriptor = - internal_static_tensorflow_OpInfo_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_OpInfo_AttrEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpInfo_AttrEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_OpInfo_TensorProperties_descriptor = - internal_static_tensorflow_OpInfo_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpInfo_TensorProperties_descriptor, - new java.lang.String[] { "Dtype", "Shape", "Value", }); - internal_static_tensorflow_NormalDistribution_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_NormalDistribution_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NormalDistribution_descriptor, - new java.lang.String[] { "Mu", "Sigma", }); - internal_static_tensorflow_LogNormalDistribution_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_LogNormalDistribution_descriptor, - new java.lang.String[] { "Mu", "Sigma", }); - internal_static_tensorflow_OpPerformance_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_OpPerformance_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpPerformance_descriptor, - new java.lang.String[] { "Op", "SessionInfo", "Node", "TemporaryMemorySize", "ComputeCost", "ComputeTime", "MemoryTime", "ComputeEfficiency", "MemoryEfficiency", "ExecutionTimeNormal", "ExecutionTimeLogNormal", "OpMemory", "ExecutionTime", }); - internal_static_tensorflow_OpPerformance_OpMemory_descriptor = - internal_static_tensorflow_OpPerformance_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpPerformance_OpMemory_descriptor, - new java.lang.String[] { "OutputMemory", "TempMemory", "PersistentMemory", "DeviceTempMemory", "DevicePersistentMemory", }); - internal_static_tensorflow_OpPerformanceList_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_OpPerformanceList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpPerformanceList_descriptor, - new java.lang.String[] { "OpPerformance", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - org.tensorflow.proto.framework.DevicePropertiesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceList.java deleted file mode 100644 index 0b09d450f2d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceList.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A collection of OpPerformance data points.
    - * 
    - * - * Protobuf type {@code tensorflow.OpPerformanceList} - */ -public final class OpPerformanceList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpPerformanceList) - OpPerformanceListOrBuilder { -private static final long serialVersionUID = 0L; - // Use OpPerformanceList.newBuilder() to construct. - private OpPerformanceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OpPerformanceList() { - opPerformance_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OpPerformanceList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OpPerformanceList( - 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)) { - opPerformance_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - opPerformance_.add( - input.readMessage(org.tensorflow.proto.framework.OpPerformance.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_ & 0x00000001) != 0)) { - opPerformance_ = java.util.Collections.unmodifiableList(opPerformance_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformanceList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformanceList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformanceList.class, org.tensorflow.proto.framework.OpPerformanceList.Builder.class); - } - - public static final int OP_PERFORMANCE_FIELD_NUMBER = 1; - private java.util.List opPerformance_; - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public java.util.List getOpPerformanceList() { - return opPerformance_; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public java.util.List - getOpPerformanceOrBuilderList() { - return opPerformance_; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public int getOpPerformanceCount() { - return opPerformance_.size(); - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformance getOpPerformance(int index) { - return opPerformance_.get(index); - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformanceOrBuilder getOpPerformanceOrBuilder( - int index) { - return opPerformance_.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 { - for (int i = 0; i < opPerformance_.size(); i++) { - output.writeMessage(1, opPerformance_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < opPerformance_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, opPerformance_.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.OpPerformanceList)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OpPerformanceList other = (org.tensorflow.proto.framework.OpPerformanceList) obj; - - if (!getOpPerformanceList() - .equals(other.getOpPerformanceList())) 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 (getOpPerformanceCount() > 0) { - hash = (37 * hash) + OP_PERFORMANCE_FIELD_NUMBER; - hash = (53 * hash) + getOpPerformanceList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OpPerformanceList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformanceList 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.OpPerformanceList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformanceList 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.OpPerformanceList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OpPerformanceList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OpPerformanceList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformanceList 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.OpPerformanceList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformanceList 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.OpPerformanceList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OpPerformanceList 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.OpPerformanceList 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 collection of OpPerformance data points.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpPerformanceList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformanceList) - org.tensorflow.proto.framework.OpPerformanceListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformanceList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformanceList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OpPerformanceList.class, org.tensorflow.proto.framework.OpPerformanceList.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpPerformanceList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getOpPerformanceFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (opPerformanceBuilder_ == null) { - opPerformance_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - opPerformanceBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_OpPerformanceList_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformanceList getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OpPerformanceList.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformanceList build() { - org.tensorflow.proto.framework.OpPerformanceList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OpPerformanceList buildPartial() { - org.tensorflow.proto.framework.OpPerformanceList result = new org.tensorflow.proto.framework.OpPerformanceList(this); - int from_bitField0_ = bitField0_; - if (opPerformanceBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - opPerformance_ = java.util.Collections.unmodifiableList(opPerformance_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.opPerformance_ = opPerformance_; - } else { - result.opPerformance_ = opPerformanceBuilder_.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.OpPerformanceList) { - return mergeFrom((org.tensorflow.proto.framework.OpPerformanceList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OpPerformanceList other) { - if (other == org.tensorflow.proto.framework.OpPerformanceList.getDefaultInstance()) return this; - if (opPerformanceBuilder_ == null) { - if (!other.opPerformance_.isEmpty()) { - if (opPerformance_.isEmpty()) { - opPerformance_ = other.opPerformance_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOpPerformanceIsMutable(); - opPerformance_.addAll(other.opPerformance_); - } - onChanged(); - } - } else { - if (!other.opPerformance_.isEmpty()) { - if (opPerformanceBuilder_.isEmpty()) { - opPerformanceBuilder_.dispose(); - opPerformanceBuilder_ = null; - opPerformance_ = other.opPerformance_; - bitField0_ = (bitField0_ & ~0x00000001); - opPerformanceBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOpPerformanceFieldBuilder() : null; - } else { - opPerformanceBuilder_.addAllMessages(other.opPerformance_); - } - } - } - 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.OpPerformanceList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OpPerformanceList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List opPerformance_ = - java.util.Collections.emptyList(); - private void ensureOpPerformanceIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - opPerformance_ = new java.util.ArrayList(opPerformance_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance, org.tensorflow.proto.framework.OpPerformance.Builder, org.tensorflow.proto.framework.OpPerformanceOrBuilder> opPerformanceBuilder_; - - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public java.util.List getOpPerformanceList() { - if (opPerformanceBuilder_ == null) { - return java.util.Collections.unmodifiableList(opPerformance_); - } else { - return opPerformanceBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public int getOpPerformanceCount() { - if (opPerformanceBuilder_ == null) { - return opPerformance_.size(); - } else { - return opPerformanceBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformance getOpPerformance(int index) { - if (opPerformanceBuilder_ == null) { - return opPerformance_.get(index); - } else { - return opPerformanceBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder setOpPerformance( - int index, org.tensorflow.proto.framework.OpPerformance value) { - if (opPerformanceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpPerformanceIsMutable(); - opPerformance_.set(index, value); - onChanged(); - } else { - opPerformanceBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder setOpPerformance( - int index, org.tensorflow.proto.framework.OpPerformance.Builder builderForValue) { - if (opPerformanceBuilder_ == null) { - ensureOpPerformanceIsMutable(); - opPerformance_.set(index, builderForValue.build()); - onChanged(); - } else { - opPerformanceBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder addOpPerformance(org.tensorflow.proto.framework.OpPerformance value) { - if (opPerformanceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpPerformanceIsMutable(); - opPerformance_.add(value); - onChanged(); - } else { - opPerformanceBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder addOpPerformance( - int index, org.tensorflow.proto.framework.OpPerformance value) { - if (opPerformanceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpPerformanceIsMutable(); - opPerformance_.add(index, value); - onChanged(); - } else { - opPerformanceBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder addOpPerformance( - org.tensorflow.proto.framework.OpPerformance.Builder builderForValue) { - if (opPerformanceBuilder_ == null) { - ensureOpPerformanceIsMutable(); - opPerformance_.add(builderForValue.build()); - onChanged(); - } else { - opPerformanceBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder addOpPerformance( - int index, org.tensorflow.proto.framework.OpPerformance.Builder builderForValue) { - if (opPerformanceBuilder_ == null) { - ensureOpPerformanceIsMutable(); - opPerformance_.add(index, builderForValue.build()); - onChanged(); - } else { - opPerformanceBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder addAllOpPerformance( - java.lang.Iterable values) { - if (opPerformanceBuilder_ == null) { - ensureOpPerformanceIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, opPerformance_); - onChanged(); - } else { - opPerformanceBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder clearOpPerformance() { - if (opPerformanceBuilder_ == null) { - opPerformance_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - opPerformanceBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public Builder removeOpPerformance(int index) { - if (opPerformanceBuilder_ == null) { - ensureOpPerformanceIsMutable(); - opPerformance_.remove(index); - onChanged(); - } else { - opPerformanceBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformance.Builder getOpPerformanceBuilder( - int index) { - return getOpPerformanceFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformanceOrBuilder getOpPerformanceOrBuilder( - int index) { - if (opPerformanceBuilder_ == null) { - return opPerformance_.get(index); } else { - return opPerformanceBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public java.util.List - getOpPerformanceOrBuilderList() { - if (opPerformanceBuilder_ != null) { - return opPerformanceBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(opPerformance_); - } - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformance.Builder addOpPerformanceBuilder() { - return getOpPerformanceFieldBuilder().addBuilder( - org.tensorflow.proto.framework.OpPerformance.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public org.tensorflow.proto.framework.OpPerformance.Builder addOpPerformanceBuilder( - int index) { - return getOpPerformanceFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.OpPerformance.getDefaultInstance()); - } - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - public java.util.List - getOpPerformanceBuilderList() { - return getOpPerformanceFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance, org.tensorflow.proto.framework.OpPerformance.Builder, org.tensorflow.proto.framework.OpPerformanceOrBuilder> - getOpPerformanceFieldBuilder() { - if (opPerformanceBuilder_ == null) { - opPerformanceBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.OpPerformance, org.tensorflow.proto.framework.OpPerformance.Builder, org.tensorflow.proto.framework.OpPerformanceOrBuilder>( - opPerformance_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - opPerformance_ = null; - } - return opPerformanceBuilder_; - } - @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.OpPerformanceList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpPerformanceList) - private static final org.tensorflow.proto.framework.OpPerformanceList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OpPerformanceList(); - } - - public static org.tensorflow.proto.framework.OpPerformanceList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OpPerformanceList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpPerformanceList(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.OpPerformanceList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceListOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceListOrBuilder.java deleted file mode 100644 index 9944ba70599..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface OpPerformanceListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformanceList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - java.util.List - getOpPerformanceList(); - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - org.tensorflow.proto.framework.OpPerformance getOpPerformance(int index); - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - int getOpPerformanceCount(); - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - java.util.List - getOpPerformanceOrBuilderList(); - /** - * repeated .tensorflow.OpPerformance op_performance = 1; - */ - org.tensorflow.proto.framework.OpPerformanceOrBuilder getOpPerformanceOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceOrBuilder.java deleted file mode 100644 index 513d2706c18..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OpPerformanceOrBuilder.java +++ /dev/null @@ -1,174 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface OpPerformanceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformance) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - boolean hasOp(); - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - org.tensorflow.proto.framework.OpInfo getOp(); - /** - *
    -   * The op
    -   * 
    - * - * .tensorflow.OpInfo op = 1; - */ - org.tensorflow.proto.framework.OpInfoOrBuilder getOpOrBuilder(); - - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated boolean hasSessionInfo(); - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated org.tensorflow.proto.framework.SessionInfo getSessionInfo(); - /** - *
    -   * Information about the session configs.
    -   * 
    - * - * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; - */ - @java.lang.Deprecated org.tensorflow.proto.framework.SessionInfoOrBuilder getSessionInfoOrBuilder(); - - /** - *
    -   * The node name (optional). Makes it easier to associate the performance data
    -   * with a specific graph node.
    -   * 
    - * - * string node = 5; - */ - java.lang.String getNode(); - /** - *
    -   * The node name (optional). Makes it easier to associate the performance data
    -   * with a specific graph node.
    -   * 
    - * - * string node = 5; - */ - com.google.protobuf.ByteString - getNodeBytes(); - - /** - *
    -   * Temporary memory used by this node (in bytes).
    -   * 
    - * - * int64 temporary_memory_size = 2; - */ - long getTemporaryMemorySize(); - - /** - *
    -   * Time it takes to run the op (in nanoseconds).
    -   * 
    - * - * int64 compute_cost = 3; - */ - long getComputeCost(); - - /** - *
    -   * Analytical compute cost (in nanoseconds).
    -   * 
    - * - * int64 compute_time = 6; - */ - long getComputeTime(); - - /** - *
    -   * Analytical memory access cost (in nanoseconds).
    -   * 
    - * - * int64 memory_time = 7; - */ - long getMemoryTime(); - - /** - *
    -   * Percentage of theoretical compute performance.
    -   * 
    - * - * double compute_efficiency = 4; - */ - double getComputeEfficiency(); - - /** - *
    -   * Percentage of theoretical memory performance.
    -   * 
    - * - * double memory_efficiency = 8; - */ - double getMemoryEfficiency(); - - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - boolean hasExecutionTimeNormal(); - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - org.tensorflow.proto.framework.NormalDistribution getExecutionTimeNormal(); - /** - * .tensorflow.NormalDistribution execution_time_normal = 10; - */ - org.tensorflow.proto.framework.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder(); - - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - boolean hasExecutionTimeLogNormal(); - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - org.tensorflow.proto.framework.LogNormalDistribution getExecutionTimeLogNormal(); - /** - * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; - */ - org.tensorflow.proto.framework.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder(); - - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - boolean hasOpMemory(); - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - org.tensorflow.proto.framework.OpPerformance.OpMemory getOpMemory(); - /** - * .tensorflow.OpPerformance.OpMemory op_memory = 9; - */ - org.tensorflow.proto.framework.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder(); - - public org.tensorflow.proto.framework.OpPerformance.ExecutionTimeCase getExecutionTimeCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptions.java deleted file mode 100644 index 3888c9c9ee6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptions.java +++ /dev/null @@ -1,1230 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Options passed to the graph optimizer
    - * 
    - * - * Protobuf type {@code tensorflow.OptimizerOptions} - */ -public final class OptimizerOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OptimizerOptions) - OptimizerOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use OptimizerOptions.newBuilder() to construct. - private OptimizerOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OptimizerOptions() { - optLevel_ = 0; - globalJitLevel_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OptimizerOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OptimizerOptions( - 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: { - - doCommonSubexpressionElimination_ = input.readBool(); - break; - } - case 16: { - - doConstantFolding_ = input.readBool(); - break; - } - case 24: { - int rawValue = input.readEnum(); - - optLevel_ = rawValue; - break; - } - case 32: { - - doFunctionInlining_ = input.readBool(); - break; - } - case 40: { - int rawValue = input.readEnum(); - - globalJitLevel_ = rawValue; - break; - } - case 48: { - - maxFoldedConstantInBytes_ = 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.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OptimizerOptions.class, org.tensorflow.proto.framework.OptimizerOptions.Builder.class); - } - - /** - *
    -   * Optimization level
    -   * 
    - * - * Protobuf enum {@code tensorflow.OptimizerOptions.Level} - */ - public enum Level - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * L1 is the default level.
    -     * Optimization performed at L1 :
    -     * 1. Common subexpression elimination
    -     * 2. Constant folding
    -     * 
    - * - * L1 = 0; - */ - L1(0), - /** - *
    -     * No optimizations
    -     * 
    - * - * L0 = -1; - */ - L0(-1), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * L1 is the default level.
    -     * Optimization performed at L1 :
    -     * 1. Common subexpression elimination
    -     * 2. Constant folding
    -     * 
    - * - * L1 = 0; - */ - public static final int L1_VALUE = 0; - /** - *
    -     * No optimizations
    -     * 
    - * - * L0 = -1; - */ - public static final int L0_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 Level valueOf(int value) { - return forNumber(value); - } - - public static Level forNumber(int value) { - switch (value) { - case 0: return L1; - case -1: return L0; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Level> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Level findValueByNumber(int number) { - return Level.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.OptimizerOptions.getDescriptor().getEnumTypes().get(0); - } - - private static final Level[] VALUES = values(); - - public static Level 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 Level(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.Level) - } - - /** - *
    -   * Control the use of the compiler/jit.  Experimental.
    -   * 
    - * - * Protobuf enum {@code tensorflow.OptimizerOptions.GlobalJitLevel} - */ - public enum GlobalJitLevel - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * Default setting ("off" now, but later expected to be "on")
    -     * 
    - * - * DEFAULT = 0; - */ - DEFAULT(0), - /** - * OFF = -1; - */ - OFF(-1), - /** - *
    -     * The following settings turn on compilation, with higher values being
    -     * more aggressive.  Higher values may reduce opportunities for parallelism
    -     * and may use more memory.  (At present, there is no distinction, but this
    -     * is expected to change.)
    -     * 
    - * - * ON_1 = 1; - */ - ON_1(1), - /** - * ON_2 = 2; - */ - ON_2(2), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * Default setting ("off" now, but later expected to be "on")
    -     * 
    - * - * DEFAULT = 0; - */ - public static final int DEFAULT_VALUE = 0; - /** - * OFF = -1; - */ - public static final int OFF_VALUE = -1; - /** - *
    -     * The following settings turn on compilation, with higher values being
    -     * more aggressive.  Higher values may reduce opportunities for parallelism
    -     * and may use more memory.  (At present, there is no distinction, but this
    -     * is expected to change.)
    -     * 
    - * - * ON_1 = 1; - */ - public static final int ON_1_VALUE = 1; - /** - * ON_2 = 2; - */ - public static final int ON_2_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 GlobalJitLevel valueOf(int value) { - return forNumber(value); - } - - public static GlobalJitLevel forNumber(int value) { - switch (value) { - case 0: return DEFAULT; - case -1: return OFF; - case 1: return ON_1; - case 2: return ON_2; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - GlobalJitLevel> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public GlobalJitLevel findValueByNumber(int number) { - return GlobalJitLevel.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.OptimizerOptions.getDescriptor().getEnumTypes().get(1); - } - - private static final GlobalJitLevel[] VALUES = values(); - - public static GlobalJitLevel 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 GlobalJitLevel(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.GlobalJitLevel) - } - - public static final int DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER = 1; - private boolean doCommonSubexpressionElimination_; - /** - *
    -   * If true, optimize the graph using common subexpression elimination.
    -   * Note: the optimization Level L1 will override this setting to true. So in
    -   * order to disable common subexpression elimination the opt_level has to be
    -   * set to L0.
    -   * 
    - * - * bool do_common_subexpression_elimination = 1; - */ - public boolean getDoCommonSubexpressionElimination() { - return doCommonSubexpressionElimination_; - } - - public static final int DO_CONSTANT_FOLDING_FIELD_NUMBER = 2; - private boolean doConstantFolding_; - /** - *
    -   * If true, perform constant folding optimization on the graph.
    -   * Note: the optimization Level L1 will override this setting to true. So in
    -   * order to disable constant folding the opt_level has to be set to L0.
    -   * 
    - * - * bool do_constant_folding = 2; - */ - public boolean getDoConstantFolding() { - return doConstantFolding_; - } - - public static final int MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER = 6; - private long maxFoldedConstantInBytes_; - /** - *
    -   * Constant folding optimization replaces tensors whose values can be
    -   * predetermined, with constant nodes. To avoid inserting too large constants,
    -   * the size of each constant created can be limited. If this value is zero, a
    -   * default limit of 10 MiB will be applied. If constant folding optimization
    -   * is disabled, this value is ignored.
    -   * 
    - * - * int64 max_folded_constant_in_bytes = 6; - */ - public long getMaxFoldedConstantInBytes() { - return maxFoldedConstantInBytes_; - } - - public static final int DO_FUNCTION_INLINING_FIELD_NUMBER = 4; - private boolean doFunctionInlining_; - /** - *
    -   * If true, perform function inlining on the graph.
    -   * 
    - * - * bool do_function_inlining = 4; - */ - public boolean getDoFunctionInlining() { - return doFunctionInlining_; - } - - public static final int OPT_LEVEL_FIELD_NUMBER = 3; - private int optLevel_; - /** - *
    -   * Overall optimization level. The actual optimizations applied will be the
    -   * logical OR of the flags that this level implies and any flags already set.
    -   * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public int getOptLevelValue() { - return optLevel_; - } - /** - *
    -   * Overall optimization level. The actual optimizations applied will be the
    -   * logical OR of the flags that this level implies and any flags already set.
    -   * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptions.Level getOptLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.OptimizerOptions.Level result = org.tensorflow.proto.framework.OptimizerOptions.Level.valueOf(optLevel_); - return result == null ? org.tensorflow.proto.framework.OptimizerOptions.Level.UNRECOGNIZED : result; - } - - public static final int GLOBAL_JIT_LEVEL_FIELD_NUMBER = 5; - private int globalJitLevel_; - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public int getGlobalJitLevelValue() { - return globalJitLevel_; - } - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel result = org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.valueOf(globalJitLevel_); - return result == null ? org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result; - } - - 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 (doCommonSubexpressionElimination_ != false) { - output.writeBool(1, doCommonSubexpressionElimination_); - } - if (doConstantFolding_ != false) { - output.writeBool(2, doConstantFolding_); - } - if (optLevel_ != org.tensorflow.proto.framework.OptimizerOptions.Level.L1.getNumber()) { - output.writeEnum(3, optLevel_); - } - if (doFunctionInlining_ != false) { - output.writeBool(4, doFunctionInlining_); - } - if (globalJitLevel_ != org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) { - output.writeEnum(5, globalJitLevel_); - } - if (maxFoldedConstantInBytes_ != 0L) { - output.writeInt64(6, maxFoldedConstantInBytes_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (doCommonSubexpressionElimination_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, doCommonSubexpressionElimination_); - } - if (doConstantFolding_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, doConstantFolding_); - } - if (optLevel_ != org.tensorflow.proto.framework.OptimizerOptions.Level.L1.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, optLevel_); - } - if (doFunctionInlining_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, doFunctionInlining_); - } - if (globalJitLevel_ != org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, globalJitLevel_); - } - if (maxFoldedConstantInBytes_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, maxFoldedConstantInBytes_); - } - 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.OptimizerOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.OptimizerOptions other = (org.tensorflow.proto.framework.OptimizerOptions) obj; - - if (getDoCommonSubexpressionElimination() - != other.getDoCommonSubexpressionElimination()) return false; - if (getDoConstantFolding() - != other.getDoConstantFolding()) return false; - if (getMaxFoldedConstantInBytes() - != other.getMaxFoldedConstantInBytes()) return false; - if (getDoFunctionInlining() - != other.getDoFunctionInlining()) return false; - if (optLevel_ != other.optLevel_) return false; - if (globalJitLevel_ != other.globalJitLevel_) 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) + DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDoCommonSubexpressionElimination()); - hash = (37 * hash) + DO_CONSTANT_FOLDING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDoConstantFolding()); - hash = (37 * hash) + MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMaxFoldedConstantInBytes()); - hash = (37 * hash) + DO_FUNCTION_INLINING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDoFunctionInlining()); - hash = (37 * hash) + OPT_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + optLevel_; - hash = (37 * hash) + GLOBAL_JIT_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + globalJitLevel_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.OptimizerOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OptimizerOptions 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.OptimizerOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OptimizerOptions 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.OptimizerOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.OptimizerOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.OptimizerOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OptimizerOptions 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.OptimizerOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OptimizerOptions 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.OptimizerOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.OptimizerOptions 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.OptimizerOptions 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 passed to the graph optimizer
    -   * 
    - * - * Protobuf type {@code tensorflow.OptimizerOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OptimizerOptions) - org.tensorflow.proto.framework.OptimizerOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.OptimizerOptions.class, org.tensorflow.proto.framework.OptimizerOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OptimizerOptions.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(); - doCommonSubexpressionElimination_ = false; - - doConstantFolding_ = false; - - maxFoldedConstantInBytes_ = 0L; - - doFunctionInlining_ = false; - - optLevel_ = 0; - - globalJitLevel_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OptimizerOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.OptimizerOptions build() { - org.tensorflow.proto.framework.OptimizerOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.OptimizerOptions buildPartial() { - org.tensorflow.proto.framework.OptimizerOptions result = new org.tensorflow.proto.framework.OptimizerOptions(this); - result.doCommonSubexpressionElimination_ = doCommonSubexpressionElimination_; - result.doConstantFolding_ = doConstantFolding_; - result.maxFoldedConstantInBytes_ = maxFoldedConstantInBytes_; - result.doFunctionInlining_ = doFunctionInlining_; - result.optLevel_ = optLevel_; - result.globalJitLevel_ = globalJitLevel_; - 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.OptimizerOptions) { - return mergeFrom((org.tensorflow.proto.framework.OptimizerOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.OptimizerOptions other) { - if (other == org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance()) return this; - if (other.getDoCommonSubexpressionElimination() != false) { - setDoCommonSubexpressionElimination(other.getDoCommonSubexpressionElimination()); - } - if (other.getDoConstantFolding() != false) { - setDoConstantFolding(other.getDoConstantFolding()); - } - if (other.getMaxFoldedConstantInBytes() != 0L) { - setMaxFoldedConstantInBytes(other.getMaxFoldedConstantInBytes()); - } - if (other.getDoFunctionInlining() != false) { - setDoFunctionInlining(other.getDoFunctionInlining()); - } - if (other.optLevel_ != 0) { - setOptLevelValue(other.getOptLevelValue()); - } - if (other.globalJitLevel_ != 0) { - setGlobalJitLevelValue(other.getGlobalJitLevelValue()); - } - 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.OptimizerOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.OptimizerOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean doCommonSubexpressionElimination_ ; - /** - *
    -     * If true, optimize the graph using common subexpression elimination.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable common subexpression elimination the opt_level has to be
    -     * set to L0.
    -     * 
    - * - * bool do_common_subexpression_elimination = 1; - */ - public boolean getDoCommonSubexpressionElimination() { - return doCommonSubexpressionElimination_; - } - /** - *
    -     * If true, optimize the graph using common subexpression elimination.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable common subexpression elimination the opt_level has to be
    -     * set to L0.
    -     * 
    - * - * bool do_common_subexpression_elimination = 1; - */ - public Builder setDoCommonSubexpressionElimination(boolean value) { - - doCommonSubexpressionElimination_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, optimize the graph using common subexpression elimination.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable common subexpression elimination the opt_level has to be
    -     * set to L0.
    -     * 
    - * - * bool do_common_subexpression_elimination = 1; - */ - public Builder clearDoCommonSubexpressionElimination() { - - doCommonSubexpressionElimination_ = false; - onChanged(); - return this; - } - - private boolean doConstantFolding_ ; - /** - *
    -     * If true, perform constant folding optimization on the graph.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable constant folding the opt_level has to be set to L0.
    -     * 
    - * - * bool do_constant_folding = 2; - */ - public boolean getDoConstantFolding() { - return doConstantFolding_; - } - /** - *
    -     * If true, perform constant folding optimization on the graph.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable constant folding the opt_level has to be set to L0.
    -     * 
    - * - * bool do_constant_folding = 2; - */ - public Builder setDoConstantFolding(boolean value) { - - doConstantFolding_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, perform constant folding optimization on the graph.
    -     * Note: the optimization Level L1 will override this setting to true. So in
    -     * order to disable constant folding the opt_level has to be set to L0.
    -     * 
    - * - * bool do_constant_folding = 2; - */ - public Builder clearDoConstantFolding() { - - doConstantFolding_ = false; - onChanged(); - return this; - } - - private long maxFoldedConstantInBytes_ ; - /** - *
    -     * Constant folding optimization replaces tensors whose values can be
    -     * predetermined, with constant nodes. To avoid inserting too large constants,
    -     * the size of each constant created can be limited. If this value is zero, a
    -     * default limit of 10 MiB will be applied. If constant folding optimization
    -     * is disabled, this value is ignored.
    -     * 
    - * - * int64 max_folded_constant_in_bytes = 6; - */ - public long getMaxFoldedConstantInBytes() { - return maxFoldedConstantInBytes_; - } - /** - *
    -     * Constant folding optimization replaces tensors whose values can be
    -     * predetermined, with constant nodes. To avoid inserting too large constants,
    -     * the size of each constant created can be limited. If this value is zero, a
    -     * default limit of 10 MiB will be applied. If constant folding optimization
    -     * is disabled, this value is ignored.
    -     * 
    - * - * int64 max_folded_constant_in_bytes = 6; - */ - public Builder setMaxFoldedConstantInBytes(long value) { - - maxFoldedConstantInBytes_ = value; - onChanged(); - return this; - } - /** - *
    -     * Constant folding optimization replaces tensors whose values can be
    -     * predetermined, with constant nodes. To avoid inserting too large constants,
    -     * the size of each constant created can be limited. If this value is zero, a
    -     * default limit of 10 MiB will be applied. If constant folding optimization
    -     * is disabled, this value is ignored.
    -     * 
    - * - * int64 max_folded_constant_in_bytes = 6; - */ - public Builder clearMaxFoldedConstantInBytes() { - - maxFoldedConstantInBytes_ = 0L; - onChanged(); - return this; - } - - private boolean doFunctionInlining_ ; - /** - *
    -     * If true, perform function inlining on the graph.
    -     * 
    - * - * bool do_function_inlining = 4; - */ - public boolean getDoFunctionInlining() { - return doFunctionInlining_; - } - /** - *
    -     * If true, perform function inlining on the graph.
    -     * 
    - * - * bool do_function_inlining = 4; - */ - public Builder setDoFunctionInlining(boolean value) { - - doFunctionInlining_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, perform function inlining on the graph.
    -     * 
    - * - * bool do_function_inlining = 4; - */ - public Builder clearDoFunctionInlining() { - - doFunctionInlining_ = false; - onChanged(); - return this; - } - - private int optLevel_ = 0; - /** - *
    -     * Overall optimization level. The actual optimizations applied will be the
    -     * logical OR of the flags that this level implies and any flags already set.
    -     * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public int getOptLevelValue() { - return optLevel_; - } - /** - *
    -     * Overall optimization level. The actual optimizations applied will be the
    -     * logical OR of the flags that this level implies and any flags already set.
    -     * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public Builder setOptLevelValue(int value) { - optLevel_ = value; - onChanged(); - return this; - } - /** - *
    -     * Overall optimization level. The actual optimizations applied will be the
    -     * logical OR of the flags that this level implies and any flags already set.
    -     * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public org.tensorflow.proto.framework.OptimizerOptions.Level getOptLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.OptimizerOptions.Level result = org.tensorflow.proto.framework.OptimizerOptions.Level.valueOf(optLevel_); - return result == null ? org.tensorflow.proto.framework.OptimizerOptions.Level.UNRECOGNIZED : result; - } - /** - *
    -     * Overall optimization level. The actual optimizations applied will be the
    -     * logical OR of the flags that this level implies and any flags already set.
    -     * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public Builder setOptLevel(org.tensorflow.proto.framework.OptimizerOptions.Level value) { - if (value == null) { - throw new NullPointerException(); - } - - optLevel_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Overall optimization level. The actual optimizations applied will be the
    -     * logical OR of the flags that this level implies and any flags already set.
    -     * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - public Builder clearOptLevel() { - - optLevel_ = 0; - onChanged(); - return this; - } - - private int globalJitLevel_ = 0; - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public int getGlobalJitLevelValue() { - return globalJitLevel_; - } - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public Builder setGlobalJitLevelValue(int value) { - globalJitLevel_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel result = org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.valueOf(globalJitLevel_); - return result == null ? org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result; - } - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public Builder setGlobalJitLevel(org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel value) { - if (value == null) { - throw new NullPointerException(); - } - - globalJitLevel_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - public Builder clearGlobalJitLevel() { - - globalJitLevel_ = 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.OptimizerOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OptimizerOptions) - private static final org.tensorflow.proto.framework.OptimizerOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.OptimizerOptions(); - } - - public static org.tensorflow.proto.framework.OptimizerOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OptimizerOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OptimizerOptions(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.OptimizerOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptionsOrBuilder.java deleted file mode 100644 index 0b2916cedad..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/OptimizerOptionsOrBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface OptimizerOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OptimizerOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * If true, optimize the graph using common subexpression elimination.
    -   * Note: the optimization Level L1 will override this setting to true. So in
    -   * order to disable common subexpression elimination the opt_level has to be
    -   * set to L0.
    -   * 
    - * - * bool do_common_subexpression_elimination = 1; - */ - boolean getDoCommonSubexpressionElimination(); - - /** - *
    -   * If true, perform constant folding optimization on the graph.
    -   * Note: the optimization Level L1 will override this setting to true. So in
    -   * order to disable constant folding the opt_level has to be set to L0.
    -   * 
    - * - * bool do_constant_folding = 2; - */ - boolean getDoConstantFolding(); - - /** - *
    -   * Constant folding optimization replaces tensors whose values can be
    -   * predetermined, with constant nodes. To avoid inserting too large constants,
    -   * the size of each constant created can be limited. If this value is zero, a
    -   * default limit of 10 MiB will be applied. If constant folding optimization
    -   * is disabled, this value is ignored.
    -   * 
    - * - * int64 max_folded_constant_in_bytes = 6; - */ - long getMaxFoldedConstantInBytes(); - - /** - *
    -   * If true, perform function inlining on the graph.
    -   * 
    - * - * bool do_function_inlining = 4; - */ - boolean getDoFunctionInlining(); - - /** - *
    -   * Overall optimization level. The actual optimizations applied will be the
    -   * logical OR of the flags that this level implies and any flags already set.
    -   * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - int getOptLevelValue(); - /** - *
    -   * Overall optimization level. The actual optimizations applied will be the
    -   * logical OR of the flags that this level implies and any flags already set.
    -   * 
    - * - * .tensorflow.OptimizerOptions.Level opt_level = 3; - */ - org.tensorflow.proto.framework.OptimizerOptions.Level getOptLevel(); - - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - int getGlobalJitLevelValue(); - /** - * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; - */ - org.tensorflow.proto.framework.OptimizerOptions.GlobalJitLevel getGlobalJitLevel(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValue.java deleted file mode 100644 index f9972971b17..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValue.java +++ /dev/null @@ -1,735 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a (key, value) pair.
    - * 
    - * - * Protobuf type {@code tensorflow.PairValue} - */ -public final class PairValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.PairValue) - PairValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use PairValue.newBuilder() to construct. - private PairValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PairValue() { - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PairValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PairValue( - 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(); - - key_ = s; - break; - } - case 18: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (value_ != null) { - subBuilder = value_.toBuilder(); - } - value_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(value_); - value_ = subBuilder.buildPartial(); - } - - 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.StructProtos.internal_static_tensorflow_PairValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_PairValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.PairValue.class, org.tensorflow.proto.framework.PairValue.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; - /** - * string key = 1; - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - 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(); - key_ = s; - return s; - } - } - /** - * string key = 1; - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.StructuredValue value_; - /** - * .tensorflow.StructuredValue value = 2; - */ - public boolean hasValue() { - return value_ != null; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public org.tensorflow.proto.framework.StructuredValue getValue() { - return value_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : value_; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValueOrBuilder() { - return getValue(); - } - - 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 (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); - } - if (value_ != null) { - output.writeMessage(2, getValue()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); - } - if (value_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getValue()); - } - 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.PairValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.PairValue other = (org.tensorflow.proto.framework.PairValue) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (hasValue() != other.hasValue()) return false; - if (hasValue()) { - if (!getValue() - .equals(other.getValue())) 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) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - if (hasValue()) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.PairValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.PairValue 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.PairValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.PairValue 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.PairValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.PairValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.PairValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.PairValue 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.PairValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.PairValue 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.PairValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.PairValue 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.PairValue 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; - } - /** - *
    -   * Represents a (key, value) pair.
    -   * 
    - * - * Protobuf type {@code tensorflow.PairValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.PairValue) - org.tensorflow.proto.framework.PairValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_PairValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_PairValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.PairValue.class, org.tensorflow.proto.framework.PairValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.PairValue.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(); - key_ = ""; - - if (valueBuilder_ == null) { - value_ = null; - } else { - value_ = null; - valueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_PairValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.PairValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.PairValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.PairValue build() { - org.tensorflow.proto.framework.PairValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.PairValue buildPartial() { - org.tensorflow.proto.framework.PairValue result = new org.tensorflow.proto.framework.PairValue(this); - result.key_ = key_; - if (valueBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = valueBuilder_.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.PairValue) { - return mergeFrom((org.tensorflow.proto.framework.PairValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.PairValue other) { - if (other == org.tensorflow.proto.framework.PairValue.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.hasValue()) { - mergeValue(other.getValue()); - } - 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.PairValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.PairValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 1; - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 1; - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 1; - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 1; - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 1; - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.StructuredValue value_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> valueBuilder_; - /** - * .tensorflow.StructuredValue value = 2; - */ - public boolean hasValue() { - return valueBuilder_ != null || value_ != null; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public org.tensorflow.proto.framework.StructuredValue getValue() { - if (valueBuilder_ == null) { - return value_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : value_; - } else { - return valueBuilder_.getMessage(); - } - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public Builder setValue(org.tensorflow.proto.framework.StructuredValue value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - valueBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public Builder setValue( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valueBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - valueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public Builder mergeValue(org.tensorflow.proto.framework.StructuredValue value) { - if (valueBuilder_ == null) { - if (value_ != null) { - value_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(value_).mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - valueBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public Builder clearValue() { - if (valueBuilder_ == null) { - value_ = null; - onChanged(); - } else { - value_ = null; - valueBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getValueBuilder() { - - onChanged(); - return getValueFieldBuilder().getBuilder(); - } - /** - * .tensorflow.StructuredValue value = 2; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValueOrBuilder() { - if (valueBuilder_ != null) { - return valueBuilder_.getMessageOrBuilder(); - } else { - return value_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : value_; - } - } - /** - * .tensorflow.StructuredValue value = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getValueFieldBuilder() { - if (valueBuilder_ == null) { - valueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getValue(), - getParentForChildren(), - isClean()); - value_ = null; - } - return valueBuilder_; - } - @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.PairValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.PairValue) - private static final org.tensorflow.proto.framework.PairValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.PairValue(); - } - - public static org.tensorflow.proto.framework.PairValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PairValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PairValue(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.PairValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValueOrBuilder.java deleted file mode 100644 index 0e35d82c1af..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/PairValueOrBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface PairValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.PairValue) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 1; - */ - java.lang.String getKey(); - /** - * string key = 1; - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * .tensorflow.StructuredValue value = 2; - */ - boolean hasValue(); - /** - * .tensorflow.StructuredValue value = 2; - */ - org.tensorflow.proto.framework.StructuredValue getValue(); - /** - * .tensorflow.StructuredValue value = 2; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getValueOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDef.java deleted file mode 100644 index 8ca69c8f7f2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDef.java +++ /dev/null @@ -1,1435 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/queue_runner.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a QueueRunner.
    - * 
    - * - * Protobuf type {@code tensorflow.QueueRunnerDef} - */ -public final class QueueRunnerDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.QueueRunnerDef) - QueueRunnerDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use QueueRunnerDef.newBuilder() to construct. - private QueueRunnerDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueueRunnerDef() { - queueName_ = ""; - enqueueOpName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - closeOpName_ = ""; - cancelOpName_ = ""; - queueClosedExceptionTypes_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueueRunnerDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueueRunnerDef( - 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(); - - queueName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - enqueueOpName_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - enqueueOpName_.add(s); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - closeOpName_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - cancelOpName_ = s; - break; - } - case 40: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - queueClosedExceptionTypes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - queueClosedExceptionTypes_.add(rawValue); - break; - } - case 42: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - queueClosedExceptionTypes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - queueClosedExceptionTypes_.add(rawValue); - } - input.popLimit(oldLimit); - 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)) { - enqueueOpName_ = enqueueOpName_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - queueClosedExceptionTypes_ = java.util.Collections.unmodifiableList(queueClosedExceptionTypes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.QueueRunnerDef.class, org.tensorflow.proto.framework.QueueRunnerDef.Builder.class); - } - - public static final int QUEUE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object queueName_; - /** - *
    -   * Queue name.
    -   * 
    - * - * string queue_name = 1; - */ - public java.lang.String getQueueName() { - java.lang.Object ref = queueName_; - 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(); - queueName_ = s; - return s; - } - } - /** - *
    -   * Queue name.
    -   * 
    - * - * string queue_name = 1; - */ - public com.google.protobuf.ByteString - getQueueNameBytes() { - java.lang.Object ref = queueName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - queueName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENQUEUE_OP_NAME_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList enqueueOpName_; - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - public com.google.protobuf.ProtocolStringList - getEnqueueOpNameList() { - return enqueueOpName_; - } - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - public int getEnqueueOpNameCount() { - return enqueueOpName_.size(); - } - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - public java.lang.String getEnqueueOpName(int index) { - return enqueueOpName_.get(index); - } - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - public com.google.protobuf.ByteString - getEnqueueOpNameBytes(int index) { - return enqueueOpName_.getByteString(index); - } - - public static final int CLOSE_OP_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object closeOpName_; - /** - *
    -   * The operation to run to close the queue.
    -   * 
    - * - * string close_op_name = 3; - */ - public java.lang.String getCloseOpName() { - java.lang.Object ref = closeOpName_; - 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(); - closeOpName_ = s; - return s; - } - } - /** - *
    -   * The operation to run to close the queue.
    -   * 
    - * - * string close_op_name = 3; - */ - public com.google.protobuf.ByteString - getCloseOpNameBytes() { - java.lang.Object ref = closeOpName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - closeOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CANCEL_OP_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object cancelOpName_; - /** - *
    -   * The operation to run to cancel the queue.
    -   * 
    - * - * string cancel_op_name = 4; - */ - public java.lang.String getCancelOpName() { - java.lang.Object ref = cancelOpName_; - 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(); - cancelOpName_ = s; - return s; - } - } - /** - *
    -   * The operation to run to cancel the queue.
    -   * 
    - * - * string cancel_op_name = 4; - */ - public com.google.protobuf.ByteString - getCancelOpNameBytes() { - java.lang.Object ref = cancelOpName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cancelOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int QUEUE_CLOSED_EXCEPTION_TYPES_FIELD_NUMBER = 5; - private java.util.List queueClosedExceptionTypes_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.Code> queueClosedExceptionTypes_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, org.tensorflow.proto.framework.Code>() { - public org.tensorflow.proto.framework.Code convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.Code result = org.tensorflow.proto.framework.Code.valueOf(from); - return result == null ? org.tensorflow.proto.framework.Code.UNRECOGNIZED : result; - } - }; - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public java.util.List getQueueClosedExceptionTypesList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.Code>(queueClosedExceptionTypes_, queueClosedExceptionTypes_converter_); - } - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public int getQueueClosedExceptionTypesCount() { - return queueClosedExceptionTypes_.size(); - } - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public org.tensorflow.proto.framework.Code getQueueClosedExceptionTypes(int index) { - return queueClosedExceptionTypes_converter_.convert(queueClosedExceptionTypes_.get(index)); - } - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public java.util.List - getQueueClosedExceptionTypesValueList() { - return queueClosedExceptionTypes_; - } - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public int getQueueClosedExceptionTypesValue(int index) { - return queueClosedExceptionTypes_.get(index); - } - private int queueClosedExceptionTypesMemoizedSerializedSize; - - 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 { - getSerializedSize(); - if (!getQueueNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queueName_); - } - for (int i = 0; i < enqueueOpName_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, enqueueOpName_.getRaw(i)); - } - if (!getCloseOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, closeOpName_); - } - if (!getCancelOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, cancelOpName_); - } - if (getQueueClosedExceptionTypesList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(queueClosedExceptionTypesMemoizedSerializedSize); - } - for (int i = 0; i < queueClosedExceptionTypes_.size(); i++) { - output.writeEnumNoTag(queueClosedExceptionTypes_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getQueueNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queueName_); - } - { - int dataSize = 0; - for (int i = 0; i < enqueueOpName_.size(); i++) { - dataSize += computeStringSizeNoTag(enqueueOpName_.getRaw(i)); - } - size += dataSize; - size += 1 * getEnqueueOpNameList().size(); - } - if (!getCloseOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, closeOpName_); - } - if (!getCancelOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, cancelOpName_); - } - { - int dataSize = 0; - for (int i = 0; i < queueClosedExceptionTypes_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(queueClosedExceptionTypes_.get(i)); - } - size += dataSize; - if (!getQueueClosedExceptionTypesList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }queueClosedExceptionTypesMemoizedSerializedSize = dataSize; - } - 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.QueueRunnerDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.QueueRunnerDef other = (org.tensorflow.proto.framework.QueueRunnerDef) obj; - - if (!getQueueName() - .equals(other.getQueueName())) return false; - if (!getEnqueueOpNameList() - .equals(other.getEnqueueOpNameList())) return false; - if (!getCloseOpName() - .equals(other.getCloseOpName())) return false; - if (!getCancelOpName() - .equals(other.getCancelOpName())) return false; - if (!queueClosedExceptionTypes_.equals(other.queueClosedExceptionTypes_)) 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) + QUEUE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getQueueName().hashCode(); - if (getEnqueueOpNameCount() > 0) { - hash = (37 * hash) + ENQUEUE_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getEnqueueOpNameList().hashCode(); - } - hash = (37 * hash) + CLOSE_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getCloseOpName().hashCode(); - hash = (37 * hash) + CANCEL_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getCancelOpName().hashCode(); - if (getQueueClosedExceptionTypesCount() > 0) { - hash = (37 * hash) + QUEUE_CLOSED_EXCEPTION_TYPES_FIELD_NUMBER; - hash = (53 * hash) + queueClosedExceptionTypes_.hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.QueueRunnerDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.QueueRunnerDef 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.QueueRunnerDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.QueueRunnerDef 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.QueueRunnerDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.QueueRunnerDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.QueueRunnerDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.QueueRunnerDef 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.QueueRunnerDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.QueueRunnerDef 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.QueueRunnerDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.QueueRunnerDef 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.QueueRunnerDef 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; - } - /** - *
    -   * Protocol buffer representing a QueueRunner.
    -   * 
    - * - * Protobuf type {@code tensorflow.QueueRunnerDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.QueueRunnerDef) - org.tensorflow.proto.framework.QueueRunnerDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.QueueRunnerDef.class, org.tensorflow.proto.framework.QueueRunnerDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.QueueRunnerDef.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(); - queueName_ = ""; - - enqueueOpName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - closeOpName_ = ""; - - cancelOpName_ = ""; - - queueClosedExceptionTypes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.QueueRunnerDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.QueueRunnerDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.QueueRunnerDef build() { - org.tensorflow.proto.framework.QueueRunnerDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.QueueRunnerDef buildPartial() { - org.tensorflow.proto.framework.QueueRunnerDef result = new org.tensorflow.proto.framework.QueueRunnerDef(this); - int from_bitField0_ = bitField0_; - result.queueName_ = queueName_; - if (((bitField0_ & 0x00000001) != 0)) { - enqueueOpName_ = enqueueOpName_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.enqueueOpName_ = enqueueOpName_; - result.closeOpName_ = closeOpName_; - result.cancelOpName_ = cancelOpName_; - if (((bitField0_ & 0x00000002) != 0)) { - queueClosedExceptionTypes_ = java.util.Collections.unmodifiableList(queueClosedExceptionTypes_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.queueClosedExceptionTypes_ = queueClosedExceptionTypes_; - 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.QueueRunnerDef) { - return mergeFrom((org.tensorflow.proto.framework.QueueRunnerDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.QueueRunnerDef other) { - if (other == org.tensorflow.proto.framework.QueueRunnerDef.getDefaultInstance()) return this; - if (!other.getQueueName().isEmpty()) { - queueName_ = other.queueName_; - onChanged(); - } - if (!other.enqueueOpName_.isEmpty()) { - if (enqueueOpName_.isEmpty()) { - enqueueOpName_ = other.enqueueOpName_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEnqueueOpNameIsMutable(); - enqueueOpName_.addAll(other.enqueueOpName_); - } - onChanged(); - } - if (!other.getCloseOpName().isEmpty()) { - closeOpName_ = other.closeOpName_; - onChanged(); - } - if (!other.getCancelOpName().isEmpty()) { - cancelOpName_ = other.cancelOpName_; - onChanged(); - } - if (!other.queueClosedExceptionTypes_.isEmpty()) { - if (queueClosedExceptionTypes_.isEmpty()) { - queueClosedExceptionTypes_ = other.queueClosedExceptionTypes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureQueueClosedExceptionTypesIsMutable(); - queueClosedExceptionTypes_.addAll(other.queueClosedExceptionTypes_); - } - onChanged(); - } - 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.QueueRunnerDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.QueueRunnerDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object queueName_ = ""; - /** - *
    -     * Queue name.
    -     * 
    - * - * string queue_name = 1; - */ - public java.lang.String getQueueName() { - java.lang.Object ref = queueName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - queueName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Queue name.
    -     * 
    - * - * string queue_name = 1; - */ - public com.google.protobuf.ByteString - getQueueNameBytes() { - java.lang.Object ref = queueName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - queueName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Queue name.
    -     * 
    - * - * string queue_name = 1; - */ - public Builder setQueueName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - queueName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Queue name.
    -     * 
    - * - * string queue_name = 1; - */ - public Builder clearQueueName() { - - queueName_ = getDefaultInstance().getQueueName(); - onChanged(); - return this; - } - /** - *
    -     * Queue name.
    -     * 
    - * - * string queue_name = 1; - */ - public Builder setQueueNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - queueName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList enqueueOpName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureEnqueueOpNameIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - enqueueOpName_ = new com.google.protobuf.LazyStringArrayList(enqueueOpName_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public com.google.protobuf.ProtocolStringList - getEnqueueOpNameList() { - return enqueueOpName_.getUnmodifiableView(); - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public int getEnqueueOpNameCount() { - return enqueueOpName_.size(); - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public java.lang.String getEnqueueOpName(int index) { - return enqueueOpName_.get(index); - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public com.google.protobuf.ByteString - getEnqueueOpNameBytes(int index) { - return enqueueOpName_.getByteString(index); - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public Builder setEnqueueOpName( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnqueueOpNameIsMutable(); - enqueueOpName_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public Builder addEnqueueOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnqueueOpNameIsMutable(); - enqueueOpName_.add(value); - onChanged(); - return this; - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public Builder addAllEnqueueOpName( - java.lang.Iterable values) { - ensureEnqueueOpNameIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, enqueueOpName_); - onChanged(); - return this; - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public Builder clearEnqueueOpName() { - enqueueOpName_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * A list of enqueue operations.
    -     * 
    - * - * repeated string enqueue_op_name = 2; - */ - public Builder addEnqueueOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureEnqueueOpNameIsMutable(); - enqueueOpName_.add(value); - onChanged(); - return this; - } - - private java.lang.Object closeOpName_ = ""; - /** - *
    -     * The operation to run to close the queue.
    -     * 
    - * - * string close_op_name = 3; - */ - public java.lang.String getCloseOpName() { - java.lang.Object ref = closeOpName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - closeOpName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation to run to close the queue.
    -     * 
    - * - * string close_op_name = 3; - */ - public com.google.protobuf.ByteString - getCloseOpNameBytes() { - java.lang.Object ref = closeOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - closeOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation to run to close the queue.
    -     * 
    - * - * string close_op_name = 3; - */ - public Builder setCloseOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - closeOpName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation to run to close the queue.
    -     * 
    - * - * string close_op_name = 3; - */ - public Builder clearCloseOpName() { - - closeOpName_ = getDefaultInstance().getCloseOpName(); - onChanged(); - return this; - } - /** - *
    -     * The operation to run to close the queue.
    -     * 
    - * - * string close_op_name = 3; - */ - public Builder setCloseOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - closeOpName_ = value; - onChanged(); - return this; - } - - private java.lang.Object cancelOpName_ = ""; - /** - *
    -     * The operation to run to cancel the queue.
    -     * 
    - * - * string cancel_op_name = 4; - */ - public java.lang.String getCancelOpName() { - java.lang.Object ref = cancelOpName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - cancelOpName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation to run to cancel the queue.
    -     * 
    - * - * string cancel_op_name = 4; - */ - public com.google.protobuf.ByteString - getCancelOpNameBytes() { - java.lang.Object ref = cancelOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cancelOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation to run to cancel the queue.
    -     * 
    - * - * string cancel_op_name = 4; - */ - public Builder setCancelOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - cancelOpName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation to run to cancel the queue.
    -     * 
    - * - * string cancel_op_name = 4; - */ - public Builder clearCancelOpName() { - - cancelOpName_ = getDefaultInstance().getCancelOpName(); - onChanged(); - return this; - } - /** - *
    -     * The operation to run to cancel the queue.
    -     * 
    - * - * string cancel_op_name = 4; - */ - public Builder setCancelOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - cancelOpName_ = value; - onChanged(); - return this; - } - - private java.util.List queueClosedExceptionTypes_ = - java.util.Collections.emptyList(); - private void ensureQueueClosedExceptionTypesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - queueClosedExceptionTypes_ = new java.util.ArrayList(queueClosedExceptionTypes_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public java.util.List getQueueClosedExceptionTypesList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, org.tensorflow.proto.framework.Code>(queueClosedExceptionTypes_, queueClosedExceptionTypes_converter_); - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public int getQueueClosedExceptionTypesCount() { - return queueClosedExceptionTypes_.size(); - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public org.tensorflow.proto.framework.Code getQueueClosedExceptionTypes(int index) { - return queueClosedExceptionTypes_converter_.convert(queueClosedExceptionTypes_.get(index)); - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder setQueueClosedExceptionTypes( - int index, org.tensorflow.proto.framework.Code value) { - if (value == null) { - throw new NullPointerException(); - } - ensureQueueClosedExceptionTypesIsMutable(); - queueClosedExceptionTypes_.set(index, value.getNumber()); - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder addQueueClosedExceptionTypes(org.tensorflow.proto.framework.Code value) { - if (value == null) { - throw new NullPointerException(); - } - ensureQueueClosedExceptionTypesIsMutable(); - queueClosedExceptionTypes_.add(value.getNumber()); - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder addAllQueueClosedExceptionTypes( - java.lang.Iterable values) { - ensureQueueClosedExceptionTypesIsMutable(); - for (org.tensorflow.proto.framework.Code value : values) { - queueClosedExceptionTypes_.add(value.getNumber()); - } - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder clearQueueClosedExceptionTypes() { - queueClosedExceptionTypes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public java.util.List - getQueueClosedExceptionTypesValueList() { - return java.util.Collections.unmodifiableList(queueClosedExceptionTypes_); - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public int getQueueClosedExceptionTypesValue(int index) { - return queueClosedExceptionTypes_.get(index); - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder setQueueClosedExceptionTypesValue( - int index, int value) { - ensureQueueClosedExceptionTypesIsMutable(); - queueClosedExceptionTypes_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder addQueueClosedExceptionTypesValue(int value) { - ensureQueueClosedExceptionTypesIsMutable(); - queueClosedExceptionTypes_.add(value); - onChanged(); - return this; - } - /** - *
    -     * A list of exception types considered to signal a safely closed queue
    -     * if raised during enqueue operations.
    -     * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - public Builder addAllQueueClosedExceptionTypesValue( - java.lang.Iterable values) { - ensureQueueClosedExceptionTypesIsMutable(); - for (int value : values) { - queueClosedExceptionTypes_.add(value); - } - 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.QueueRunnerDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.QueueRunnerDef) - private static final org.tensorflow.proto.framework.QueueRunnerDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.QueueRunnerDef(); - } - - public static org.tensorflow.proto.framework.QueueRunnerDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueueRunnerDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueueRunnerDef(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.QueueRunnerDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDefOrBuilder.java deleted file mode 100644 index 61a20e767a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerDefOrBuilder.java +++ /dev/null @@ -1,145 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/queue_runner.proto - -package org.tensorflow.proto.framework; - -public interface QueueRunnerDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.QueueRunnerDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Queue name.
    -   * 
    - * - * string queue_name = 1; - */ - java.lang.String getQueueName(); - /** - *
    -   * Queue name.
    -   * 
    - * - * string queue_name = 1; - */ - com.google.protobuf.ByteString - getQueueNameBytes(); - - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - java.util.List - getEnqueueOpNameList(); - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - int getEnqueueOpNameCount(); - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - java.lang.String getEnqueueOpName(int index); - /** - *
    -   * A list of enqueue operations.
    -   * 
    - * - * repeated string enqueue_op_name = 2; - */ - com.google.protobuf.ByteString - getEnqueueOpNameBytes(int index); - - /** - *
    -   * The operation to run to close the queue.
    -   * 
    - * - * string close_op_name = 3; - */ - java.lang.String getCloseOpName(); - /** - *
    -   * The operation to run to close the queue.
    -   * 
    - * - * string close_op_name = 3; - */ - com.google.protobuf.ByteString - getCloseOpNameBytes(); - - /** - *
    -   * The operation to run to cancel the queue.
    -   * 
    - * - * string cancel_op_name = 4; - */ - java.lang.String getCancelOpName(); - /** - *
    -   * The operation to run to cancel the queue.
    -   * 
    - * - * string cancel_op_name = 4; - */ - com.google.protobuf.ByteString - getCancelOpNameBytes(); - - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - java.util.List getQueueClosedExceptionTypesList(); - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - int getQueueClosedExceptionTypesCount(); - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - org.tensorflow.proto.framework.Code getQueueClosedExceptionTypes(int index); - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - java.util.List - getQueueClosedExceptionTypesValueList(); - /** - *
    -   * A list of exception types considered to signal a safely closed queue
    -   * if raised during enqueue operations.
    -   * 
    - * - * repeated .tensorflow.error.Code queue_closed_exception_types = 5; - */ - int getQueueClosedExceptionTypesValue(int index); -} 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 deleted file mode 100644 index bebb320cc0f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/QueueRunnerProtos.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/queue_runner.proto - -package org.tensorflow.proto.framework; - -public final class QueueRunnerProtos { - private QueueRunnerProtos() {} - 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_QueueRunnerDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_QueueRunnerDef_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/queue_runner." + - "proto\022\ntensorflow\032*tensorflow/core/proto" + - "buf/error_codes.proto\"\252\001\n\016QueueRunnerDef" + - "\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\217\001\n\036o" + - "rg.tensorflow.proto.frameworkB\021QueueRunn" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.ErrorCodesProtos.getDescriptor(), - }); - internal_static_tensorflow_QueueRunnerDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_QueueRunnerDef_descriptor, - new java.lang.String[] { "QueueName", "EnqueueOpName", "CloseOpName", "CancelOpName", "QueueClosedExceptionTypes", }); - org.tensorflow.proto.framework.ErrorCodesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptions.java deleted file mode 100644 index 10aae53345a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptions.java +++ /dev/null @@ -1,998 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.RPCOptions} - */ -public final class RPCOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RPCOptions) - RPCOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use RPCOptions.newBuilder() to construct. - private RPCOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RPCOptions() { - compressionAlgorithm_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RPCOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RPCOptions( - 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: { - - useRpcForInprocessMaster_ = input.readBool(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - compressionAlgorithm_ = s; - break; - } - case 24: { - - compressionLevel_ = input.readInt32(); - break; - } - case 32: { - - cacheRpcResponse_ = input.readBool(); - break; - } - case 40: { - - disableSessionConnectionSharing_ = input.readBool(); - break; - } - case 48: { - - numChannelsPerTarget_ = input.readInt32(); - 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.ConfigProtos.internal_static_tensorflow_RPCOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RPCOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RPCOptions.class, org.tensorflow.proto.framework.RPCOptions.Builder.class); - } - - public static final int USE_RPC_FOR_INPROCESS_MASTER_FIELD_NUMBER = 1; - private boolean useRpcForInprocessMaster_; - /** - *
    -   * If true, always use RPC to contact the session target.
    -   * If false (the default option), TensorFlow may use an optimized
    -   * transport for client-master communication that avoids the RPC
    -   * stack. This option is primarily for used testing the RPC stack.
    -   * 
    - * - * bool use_rpc_for_inprocess_master = 1; - */ - public boolean getUseRpcForInprocessMaster() { - return useRpcForInprocessMaster_; - } - - public static final int COMPRESSION_ALGORITHM_FIELD_NUMBER = 2; - private volatile java.lang.Object compressionAlgorithm_; - /** - *
    -   * The compression algorithm to be used. One of "deflate", "gzip".
    -   * 
    - * - * string compression_algorithm = 2; - */ - public java.lang.String getCompressionAlgorithm() { - java.lang.Object ref = compressionAlgorithm_; - 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(); - compressionAlgorithm_ = s; - return s; - } - } - /** - *
    -   * The compression algorithm to be used. One of "deflate", "gzip".
    -   * 
    - * - * string compression_algorithm = 2; - */ - public com.google.protobuf.ByteString - getCompressionAlgorithmBytes() { - java.lang.Object ref = compressionAlgorithm_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - compressionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COMPRESSION_LEVEL_FIELD_NUMBER = 3; - private int compressionLevel_; - /** - *
    -   * If compression_algorithm is set, the compression level to be used.
    -   * From 0 (no compression), up to 3.
    -   * 
    - * - * int32 compression_level = 3; - */ - public int getCompressionLevel() { - return compressionLevel_; - } - - public static final int CACHE_RPC_RESPONSE_FIELD_NUMBER = 4; - private boolean cacheRpcResponse_; - /** - *
    -   * Setting cache_rpc_response to true will enable sender side caching of
    -   * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    -   * requests . This is only necessary when the network fabric is experiencing a
    -   * significant error rate.  Without it we'll fail a step on an network error,
    -   * while with it we'll be able to complete long steps (like complex
    -   * initializations) in the face of some network errors during RecvTensor.
    -   * 
    - * - * bool cache_rpc_response = 4; - */ - public boolean getCacheRpcResponse() { - return cacheRpcResponse_; - } - - public static final int DISABLE_SESSION_CONNECTION_SHARING_FIELD_NUMBER = 5; - private boolean disableSessionConnectionSharing_; - /** - *
    -   * Disables TCP connection sharing when opening a new RPC channel.
    -   * 
    - * - * bool disable_session_connection_sharing = 5; - */ - public boolean getDisableSessionConnectionSharing() { - return disableSessionConnectionSharing_; - } - - public static final int NUM_CHANNELS_PER_TARGET_FIELD_NUMBER = 6; - private int numChannelsPerTarget_; - /** - *
    -   * Setting num_channels_per_target > 0 allows uses of multiple channels to
    -   * communicate to the same target. This can be used to improve the aggregate
    -   * throughput on high speed links (e.g 100G) where single connection is not
    -   * sufficient to maximize link utilization. Note that a single RPC only goes
    -   * on a single channel, this only helps in situations where there are multiple
    -   * transfers to the same target overlapping in time.
    -   * 
    - * - * int32 num_channels_per_target = 6; - */ - public int getNumChannelsPerTarget() { - return numChannelsPerTarget_; - } - - 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 (useRpcForInprocessMaster_ != false) { - output.writeBool(1, useRpcForInprocessMaster_); - } - if (!getCompressionAlgorithmBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, compressionAlgorithm_); - } - if (compressionLevel_ != 0) { - output.writeInt32(3, compressionLevel_); - } - if (cacheRpcResponse_ != false) { - output.writeBool(4, cacheRpcResponse_); - } - if (disableSessionConnectionSharing_ != false) { - output.writeBool(5, disableSessionConnectionSharing_); - } - if (numChannelsPerTarget_ != 0) { - output.writeInt32(6, numChannelsPerTarget_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (useRpcForInprocessMaster_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, useRpcForInprocessMaster_); - } - if (!getCompressionAlgorithmBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, compressionAlgorithm_); - } - if (compressionLevel_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, compressionLevel_); - } - if (cacheRpcResponse_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, cacheRpcResponse_); - } - if (disableSessionConnectionSharing_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, disableSessionConnectionSharing_); - } - if (numChannelsPerTarget_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, numChannelsPerTarget_); - } - 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.RPCOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RPCOptions other = (org.tensorflow.proto.framework.RPCOptions) obj; - - if (getUseRpcForInprocessMaster() - != other.getUseRpcForInprocessMaster()) return false; - if (!getCompressionAlgorithm() - .equals(other.getCompressionAlgorithm())) return false; - if (getCompressionLevel() - != other.getCompressionLevel()) return false; - if (getCacheRpcResponse() - != other.getCacheRpcResponse()) return false; - if (getDisableSessionConnectionSharing() - != other.getDisableSessionConnectionSharing()) return false; - if (getNumChannelsPerTarget() - != other.getNumChannelsPerTarget()) 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) + USE_RPC_FOR_INPROCESS_MASTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseRpcForInprocessMaster()); - hash = (37 * hash) + COMPRESSION_ALGORITHM_FIELD_NUMBER; - hash = (53 * hash) + getCompressionAlgorithm().hashCode(); - hash = (37 * hash) + COMPRESSION_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + getCompressionLevel(); - hash = (37 * hash) + CACHE_RPC_RESPONSE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCacheRpcResponse()); - hash = (37 * hash) + DISABLE_SESSION_CONNECTION_SHARING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableSessionConnectionSharing()); - hash = (37 * hash) + NUM_CHANNELS_PER_TARGET_FIELD_NUMBER; - hash = (53 * hash) + getNumChannelsPerTarget(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RPCOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RPCOptions 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.RPCOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RPCOptions 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.RPCOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RPCOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RPCOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RPCOptions 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.RPCOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RPCOptions 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.RPCOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RPCOptions 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.RPCOptions 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.RPCOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RPCOptions) - org.tensorflow.proto.framework.RPCOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RPCOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RPCOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RPCOptions.class, org.tensorflow.proto.framework.RPCOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RPCOptions.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(); - useRpcForInprocessMaster_ = false; - - compressionAlgorithm_ = ""; - - compressionLevel_ = 0; - - cacheRpcResponse_ = false; - - disableSessionConnectionSharing_ = false; - - numChannelsPerTarget_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RPCOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RPCOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RPCOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RPCOptions build() { - org.tensorflow.proto.framework.RPCOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RPCOptions buildPartial() { - org.tensorflow.proto.framework.RPCOptions result = new org.tensorflow.proto.framework.RPCOptions(this); - result.useRpcForInprocessMaster_ = useRpcForInprocessMaster_; - result.compressionAlgorithm_ = compressionAlgorithm_; - result.compressionLevel_ = compressionLevel_; - result.cacheRpcResponse_ = cacheRpcResponse_; - result.disableSessionConnectionSharing_ = disableSessionConnectionSharing_; - result.numChannelsPerTarget_ = numChannelsPerTarget_; - 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.RPCOptions) { - return mergeFrom((org.tensorflow.proto.framework.RPCOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RPCOptions other) { - if (other == org.tensorflow.proto.framework.RPCOptions.getDefaultInstance()) return this; - if (other.getUseRpcForInprocessMaster() != false) { - setUseRpcForInprocessMaster(other.getUseRpcForInprocessMaster()); - } - if (!other.getCompressionAlgorithm().isEmpty()) { - compressionAlgorithm_ = other.compressionAlgorithm_; - onChanged(); - } - if (other.getCompressionLevel() != 0) { - setCompressionLevel(other.getCompressionLevel()); - } - if (other.getCacheRpcResponse() != false) { - setCacheRpcResponse(other.getCacheRpcResponse()); - } - if (other.getDisableSessionConnectionSharing() != false) { - setDisableSessionConnectionSharing(other.getDisableSessionConnectionSharing()); - } - if (other.getNumChannelsPerTarget() != 0) { - setNumChannelsPerTarget(other.getNumChannelsPerTarget()); - } - 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.RPCOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RPCOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean useRpcForInprocessMaster_ ; - /** - *
    -     * If true, always use RPC to contact the session target.
    -     * If false (the default option), TensorFlow may use an optimized
    -     * transport for client-master communication that avoids the RPC
    -     * stack. This option is primarily for used testing the RPC stack.
    -     * 
    - * - * bool use_rpc_for_inprocess_master = 1; - */ - public boolean getUseRpcForInprocessMaster() { - return useRpcForInprocessMaster_; - } - /** - *
    -     * If true, always use RPC to contact the session target.
    -     * If false (the default option), TensorFlow may use an optimized
    -     * transport for client-master communication that avoids the RPC
    -     * stack. This option is primarily for used testing the RPC stack.
    -     * 
    - * - * bool use_rpc_for_inprocess_master = 1; - */ - public Builder setUseRpcForInprocessMaster(boolean value) { - - useRpcForInprocessMaster_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, always use RPC to contact the session target.
    -     * If false (the default option), TensorFlow may use an optimized
    -     * transport for client-master communication that avoids the RPC
    -     * stack. This option is primarily for used testing the RPC stack.
    -     * 
    - * - * bool use_rpc_for_inprocess_master = 1; - */ - public Builder clearUseRpcForInprocessMaster() { - - useRpcForInprocessMaster_ = false; - onChanged(); - return this; - } - - private java.lang.Object compressionAlgorithm_ = ""; - /** - *
    -     * The compression algorithm to be used. One of "deflate", "gzip".
    -     * 
    - * - * string compression_algorithm = 2; - */ - public java.lang.String getCompressionAlgorithm() { - java.lang.Object ref = compressionAlgorithm_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - compressionAlgorithm_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The compression algorithm to be used. One of "deflate", "gzip".
    -     * 
    - * - * string compression_algorithm = 2; - */ - public com.google.protobuf.ByteString - getCompressionAlgorithmBytes() { - java.lang.Object ref = compressionAlgorithm_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - compressionAlgorithm_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The compression algorithm to be used. One of "deflate", "gzip".
    -     * 
    - * - * string compression_algorithm = 2; - */ - public Builder setCompressionAlgorithm( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - compressionAlgorithm_ = value; - onChanged(); - return this; - } - /** - *
    -     * The compression algorithm to be used. One of "deflate", "gzip".
    -     * 
    - * - * string compression_algorithm = 2; - */ - public Builder clearCompressionAlgorithm() { - - compressionAlgorithm_ = getDefaultInstance().getCompressionAlgorithm(); - onChanged(); - return this; - } - /** - *
    -     * The compression algorithm to be used. One of "deflate", "gzip".
    -     * 
    - * - * string compression_algorithm = 2; - */ - public Builder setCompressionAlgorithmBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - compressionAlgorithm_ = value; - onChanged(); - return this; - } - - private int compressionLevel_ ; - /** - *
    -     * If compression_algorithm is set, the compression level to be used.
    -     * From 0 (no compression), up to 3.
    -     * 
    - * - * int32 compression_level = 3; - */ - public int getCompressionLevel() { - return compressionLevel_; - } - /** - *
    -     * If compression_algorithm is set, the compression level to be used.
    -     * From 0 (no compression), up to 3.
    -     * 
    - * - * int32 compression_level = 3; - */ - public Builder setCompressionLevel(int value) { - - compressionLevel_ = value; - onChanged(); - return this; - } - /** - *
    -     * If compression_algorithm is set, the compression level to be used.
    -     * From 0 (no compression), up to 3.
    -     * 
    - * - * int32 compression_level = 3; - */ - public Builder clearCompressionLevel() { - - compressionLevel_ = 0; - onChanged(); - return this; - } - - private boolean cacheRpcResponse_ ; - /** - *
    -     * Setting cache_rpc_response to true will enable sender side caching of
    -     * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    -     * requests . This is only necessary when the network fabric is experiencing a
    -     * significant error rate.  Without it we'll fail a step on an network error,
    -     * while with it we'll be able to complete long steps (like complex
    -     * initializations) in the face of some network errors during RecvTensor.
    -     * 
    - * - * bool cache_rpc_response = 4; - */ - public boolean getCacheRpcResponse() { - return cacheRpcResponse_; - } - /** - *
    -     * Setting cache_rpc_response to true will enable sender side caching of
    -     * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    -     * requests . This is only necessary when the network fabric is experiencing a
    -     * significant error rate.  Without it we'll fail a step on an network error,
    -     * while with it we'll be able to complete long steps (like complex
    -     * initializations) in the face of some network errors during RecvTensor.
    -     * 
    - * - * bool cache_rpc_response = 4; - */ - public Builder setCacheRpcResponse(boolean value) { - - cacheRpcResponse_ = value; - onChanged(); - return this; - } - /** - *
    -     * Setting cache_rpc_response to true will enable sender side caching of
    -     * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    -     * requests . This is only necessary when the network fabric is experiencing a
    -     * significant error rate.  Without it we'll fail a step on an network error,
    -     * while with it we'll be able to complete long steps (like complex
    -     * initializations) in the face of some network errors during RecvTensor.
    -     * 
    - * - * bool cache_rpc_response = 4; - */ - public Builder clearCacheRpcResponse() { - - cacheRpcResponse_ = false; - onChanged(); - return this; - } - - private boolean disableSessionConnectionSharing_ ; - /** - *
    -     * Disables TCP connection sharing when opening a new RPC channel.
    -     * 
    - * - * bool disable_session_connection_sharing = 5; - */ - public boolean getDisableSessionConnectionSharing() { - return disableSessionConnectionSharing_; - } - /** - *
    -     * Disables TCP connection sharing when opening a new RPC channel.
    -     * 
    - * - * bool disable_session_connection_sharing = 5; - */ - public Builder setDisableSessionConnectionSharing(boolean value) { - - disableSessionConnectionSharing_ = value; - onChanged(); - return this; - } - /** - *
    -     * Disables TCP connection sharing when opening a new RPC channel.
    -     * 
    - * - * bool disable_session_connection_sharing = 5; - */ - public Builder clearDisableSessionConnectionSharing() { - - disableSessionConnectionSharing_ = false; - onChanged(); - return this; - } - - private int numChannelsPerTarget_ ; - /** - *
    -     * Setting num_channels_per_target > 0 allows uses of multiple channels to
    -     * communicate to the same target. This can be used to improve the aggregate
    -     * throughput on high speed links (e.g 100G) where single connection is not
    -     * sufficient to maximize link utilization. Note that a single RPC only goes
    -     * on a single channel, this only helps in situations where there are multiple
    -     * transfers to the same target overlapping in time.
    -     * 
    - * - * int32 num_channels_per_target = 6; - */ - public int getNumChannelsPerTarget() { - return numChannelsPerTarget_; - } - /** - *
    -     * Setting num_channels_per_target > 0 allows uses of multiple channels to
    -     * communicate to the same target. This can be used to improve the aggregate
    -     * throughput on high speed links (e.g 100G) where single connection is not
    -     * sufficient to maximize link utilization. Note that a single RPC only goes
    -     * on a single channel, this only helps in situations where there are multiple
    -     * transfers to the same target overlapping in time.
    -     * 
    - * - * int32 num_channels_per_target = 6; - */ - public Builder setNumChannelsPerTarget(int value) { - - numChannelsPerTarget_ = value; - onChanged(); - return this; - } - /** - *
    -     * Setting num_channels_per_target > 0 allows uses of multiple channels to
    -     * communicate to the same target. This can be used to improve the aggregate
    -     * throughput on high speed links (e.g 100G) where single connection is not
    -     * sufficient to maximize link utilization. Note that a single RPC only goes
    -     * on a single channel, this only helps in situations where there are multiple
    -     * transfers to the same target overlapping in time.
    -     * 
    - * - * int32 num_channels_per_target = 6; - */ - public Builder clearNumChannelsPerTarget() { - - numChannelsPerTarget_ = 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.RPCOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RPCOptions) - private static final org.tensorflow.proto.framework.RPCOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RPCOptions(); - } - - public static org.tensorflow.proto.framework.RPCOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RPCOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RPCOptions(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.RPCOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptionsOrBuilder.java deleted file mode 100644 index f1309265632..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RPCOptionsOrBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface RPCOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RPCOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * If true, always use RPC to contact the session target.
    -   * If false (the default option), TensorFlow may use an optimized
    -   * transport for client-master communication that avoids the RPC
    -   * stack. This option is primarily for used testing the RPC stack.
    -   * 
    - * - * bool use_rpc_for_inprocess_master = 1; - */ - boolean getUseRpcForInprocessMaster(); - - /** - *
    -   * The compression algorithm to be used. One of "deflate", "gzip".
    -   * 
    - * - * string compression_algorithm = 2; - */ - java.lang.String getCompressionAlgorithm(); - /** - *
    -   * The compression algorithm to be used. One of "deflate", "gzip".
    -   * 
    - * - * string compression_algorithm = 2; - */ - com.google.protobuf.ByteString - getCompressionAlgorithmBytes(); - - /** - *
    -   * If compression_algorithm is set, the compression level to be used.
    -   * From 0 (no compression), up to 3.
    -   * 
    - * - * int32 compression_level = 3; - */ - int getCompressionLevel(); - - /** - *
    -   * Setting cache_rpc_response to true will enable sender side caching of
    -   * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    -   * requests . This is only necessary when the network fabric is experiencing a
    -   * significant error rate.  Without it we'll fail a step on an network error,
    -   * while with it we'll be able to complete long steps (like complex
    -   * initializations) in the face of some network errors during RecvTensor.
    -   * 
    - * - * bool cache_rpc_response = 4; - */ - boolean getCacheRpcResponse(); - - /** - *
    -   * Disables TCP connection sharing when opening a new RPC channel.
    -   * 
    - * - * bool disable_session_connection_sharing = 5; - */ - boolean getDisableSessionConnectionSharing(); - - /** - *
    -   * Setting num_channels_per_target > 0 allows uses of multiple channels to
    -   * communicate to the same target. This can be used to improve the aggregate
    -   * throughput on high speed links (e.g 100G) where single connection is not
    -   * sufficient to maximize link utilization. Note that a single RPC only goes
    -   * on a single channel, this only helps in situations where there are multiple
    -   * transfers to the same target overlapping in time.
    -   * 
    - * - * int32 num_channels_per_target = 6; - */ - int getNumChannelsPerTarget(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseProtos.java deleted file mode 100644 index 3c4e600440b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseProtos.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/reader_base.proto - -package org.tensorflow.proto.framework; - -public final class ReaderBaseProtos { - private ReaderBaseProtos() {} - 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_ReaderBaseState_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ReaderBaseState_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/framework/reader_base." + - "proto\022\ntensorflow\"r\n\017ReaderBaseState\022\024\n\014" + - "work_started\030\001 \001(\003\022\025\n\rwork_finished\030\002 \001(" + - "\003\022\034\n\024num_records_produced\030\003 \001(\003\022\024\n\014curre" + - "nt_work\030\004 \001(\014B\213\001\n\036org.tensorflow.proto.f" + - "rameworkB\020ReaderBaseProtosP\001ZRgithub.com" + - "/tensorflow/tensorflow/tensorflow/go/cor" + - "e/framework/reader_base_go_proto\370\001\001b\006pro" + - "to3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_ReaderBaseState_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ReaderBaseState_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ReaderBaseState_descriptor, - new java.lang.String[] { "WorkStarted", "WorkFinished", "NumRecordsProduced", "CurrentWork", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseState.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseState.java deleted file mode 100644 index 4602bd786a5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseState.java +++ /dev/null @@ -1,664 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/reader_base.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * For serializing and restoring the state of ReaderBase, see
    - * reader_base.h for details.
    - * 
    - * - * Protobuf type {@code tensorflow.ReaderBaseState} - */ -public final class ReaderBaseState extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ReaderBaseState) - ReaderBaseStateOrBuilder { -private static final long serialVersionUID = 0L; - // Use ReaderBaseState.newBuilder() to construct. - private ReaderBaseState(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReaderBaseState() { - currentWork_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ReaderBaseState(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ReaderBaseState( - 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: { - - workStarted_ = input.readInt64(); - break; - } - case 16: { - - workFinished_ = input.readInt64(); - break; - } - case 24: { - - numRecordsProduced_ = input.readInt64(); - break; - } - case 34: { - - currentWork_ = input.readBytes(); - 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.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ReaderBaseState.class, org.tensorflow.proto.framework.ReaderBaseState.Builder.class); - } - - public static final int WORK_STARTED_FIELD_NUMBER = 1; - private long workStarted_; - /** - * int64 work_started = 1; - */ - public long getWorkStarted() { - return workStarted_; - } - - public static final int WORK_FINISHED_FIELD_NUMBER = 2; - private long workFinished_; - /** - * int64 work_finished = 2; - */ - public long getWorkFinished() { - return workFinished_; - } - - public static final int NUM_RECORDS_PRODUCED_FIELD_NUMBER = 3; - private long numRecordsProduced_; - /** - * int64 num_records_produced = 3; - */ - public long getNumRecordsProduced() { - return numRecordsProduced_; - } - - public static final int CURRENT_WORK_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString currentWork_; - /** - * bytes current_work = 4; - */ - public com.google.protobuf.ByteString getCurrentWork() { - return currentWork_; - } - - 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 (workStarted_ != 0L) { - output.writeInt64(1, workStarted_); - } - if (workFinished_ != 0L) { - output.writeInt64(2, workFinished_); - } - if (numRecordsProduced_ != 0L) { - output.writeInt64(3, numRecordsProduced_); - } - if (!currentWork_.isEmpty()) { - output.writeBytes(4, currentWork_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (workStarted_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, workStarted_); - } - if (workFinished_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, workFinished_); - } - if (numRecordsProduced_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, numRecordsProduced_); - } - if (!currentWork_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, currentWork_); - } - 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.ReaderBaseState)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ReaderBaseState other = (org.tensorflow.proto.framework.ReaderBaseState) obj; - - if (getWorkStarted() - != other.getWorkStarted()) return false; - if (getWorkFinished() - != other.getWorkFinished()) return false; - if (getNumRecordsProduced() - != other.getNumRecordsProduced()) return false; - if (!getCurrentWork() - .equals(other.getCurrentWork())) 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) + WORK_STARTED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getWorkStarted()); - hash = (37 * hash) + WORK_FINISHED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getWorkFinished()); - hash = (37 * hash) + NUM_RECORDS_PRODUCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumRecordsProduced()); - hash = (37 * hash) + CURRENT_WORK_FIELD_NUMBER; - hash = (53 * hash) + getCurrentWork().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ReaderBaseState parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ReaderBaseState 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.ReaderBaseState parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ReaderBaseState 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.ReaderBaseState parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ReaderBaseState parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ReaderBaseState parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ReaderBaseState 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.ReaderBaseState parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ReaderBaseState 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.ReaderBaseState parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ReaderBaseState 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.ReaderBaseState 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; - } - /** - *
    -   * For serializing and restoring the state of ReaderBase, see
    -   * reader_base.h for details.
    -   * 
    - * - * Protobuf type {@code tensorflow.ReaderBaseState} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ReaderBaseState) - org.tensorflow.proto.framework.ReaderBaseStateOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ReaderBaseState.class, org.tensorflow.proto.framework.ReaderBaseState.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ReaderBaseState.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(); - workStarted_ = 0L; - - workFinished_ = 0L; - - numRecordsProduced_ = 0L; - - currentWork_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ReaderBaseState getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ReaderBaseState.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ReaderBaseState build() { - org.tensorflow.proto.framework.ReaderBaseState result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ReaderBaseState buildPartial() { - org.tensorflow.proto.framework.ReaderBaseState result = new org.tensorflow.proto.framework.ReaderBaseState(this); - result.workStarted_ = workStarted_; - result.workFinished_ = workFinished_; - result.numRecordsProduced_ = numRecordsProduced_; - result.currentWork_ = currentWork_; - 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.ReaderBaseState) { - return mergeFrom((org.tensorflow.proto.framework.ReaderBaseState)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ReaderBaseState other) { - if (other == org.tensorflow.proto.framework.ReaderBaseState.getDefaultInstance()) return this; - if (other.getWorkStarted() != 0L) { - setWorkStarted(other.getWorkStarted()); - } - if (other.getWorkFinished() != 0L) { - setWorkFinished(other.getWorkFinished()); - } - if (other.getNumRecordsProduced() != 0L) { - setNumRecordsProduced(other.getNumRecordsProduced()); - } - if (other.getCurrentWork() != com.google.protobuf.ByteString.EMPTY) { - setCurrentWork(other.getCurrentWork()); - } - 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.ReaderBaseState parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ReaderBaseState) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long workStarted_ ; - /** - * int64 work_started = 1; - */ - public long getWorkStarted() { - return workStarted_; - } - /** - * int64 work_started = 1; - */ - public Builder setWorkStarted(long value) { - - workStarted_ = value; - onChanged(); - return this; - } - /** - * int64 work_started = 1; - */ - public Builder clearWorkStarted() { - - workStarted_ = 0L; - onChanged(); - return this; - } - - private long workFinished_ ; - /** - * int64 work_finished = 2; - */ - public long getWorkFinished() { - return workFinished_; - } - /** - * int64 work_finished = 2; - */ - public Builder setWorkFinished(long value) { - - workFinished_ = value; - onChanged(); - return this; - } - /** - * int64 work_finished = 2; - */ - public Builder clearWorkFinished() { - - workFinished_ = 0L; - onChanged(); - return this; - } - - private long numRecordsProduced_ ; - /** - * int64 num_records_produced = 3; - */ - public long getNumRecordsProduced() { - return numRecordsProduced_; - } - /** - * int64 num_records_produced = 3; - */ - public Builder setNumRecordsProduced(long value) { - - numRecordsProduced_ = value; - onChanged(); - return this; - } - /** - * int64 num_records_produced = 3; - */ - public Builder clearNumRecordsProduced() { - - numRecordsProduced_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString currentWork_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes current_work = 4; - */ - public com.google.protobuf.ByteString getCurrentWork() { - return currentWork_; - } - /** - * bytes current_work = 4; - */ - public Builder setCurrentWork(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - currentWork_ = value; - onChanged(); - return this; - } - /** - * bytes current_work = 4; - */ - public Builder clearCurrentWork() { - - currentWork_ = getDefaultInstance().getCurrentWork(); - 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.ReaderBaseState) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ReaderBaseState) - private static final org.tensorflow.proto.framework.ReaderBaseState DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ReaderBaseState(); - } - - public static org.tensorflow.proto.framework.ReaderBaseState getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReaderBaseState parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReaderBaseState(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.ReaderBaseState getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseStateOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseStateOrBuilder.java deleted file mode 100644 index 72f0c6c0922..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ReaderBaseStateOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/reader_base.proto - -package org.tensorflow.proto.framework; - -public interface ReaderBaseStateOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ReaderBaseState) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 work_started = 1; - */ - long getWorkStarted(); - - /** - * int64 work_finished = 2; - */ - long getWorkFinished(); - - /** - * int64 num_records_produced = 3; - */ - long getNumRecordsProduced(); - - /** - * bytes current_work = 4; - */ - com.google.protobuf.ByteString getCurrentWork(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradient.java deleted file mode 100644 index edb975087bf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradient.java +++ /dev/null @@ -1,743 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/function.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * RegisteredGradient stores a gradient function that is registered in the
    - * gradients library and used in the ops of a function in the function library.
    - * Unlike GradientDef, these gradients are identified by op type, and not
    - * directly linked to any function.
    - * 
    - * - * Protobuf type {@code tensorflow.RegisteredGradient} - */ -public final class RegisteredGradient extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RegisteredGradient) - RegisteredGradientOrBuilder { -private static final long serialVersionUID = 0L; - // Use RegisteredGradient.newBuilder() to construct. - private RegisteredGradient(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RegisteredGradient() { - gradientFunc_ = ""; - registeredOpType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RegisteredGradient(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RegisteredGradient( - 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(); - - gradientFunc_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - registeredOpType_ = s; - 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.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_RegisteredGradient_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RegisteredGradient.class, org.tensorflow.proto.framework.RegisteredGradient.Builder.class); - } - - public static final int GRADIENT_FUNC_FIELD_NUMBER = 1; - private volatile java.lang.Object gradientFunc_; - /** - *
    -   * The gradient function's name.
    -   * 
    - * - * string gradient_func = 1; - */ - public java.lang.String getGradientFunc() { - java.lang.Object ref = gradientFunc_; - 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(); - gradientFunc_ = s; - return s; - } - } - /** - *
    -   * The gradient function's name.
    -   * 
    - * - * string gradient_func = 1; - */ - public com.google.protobuf.ByteString - getGradientFuncBytes() { - java.lang.Object ref = gradientFunc_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gradientFunc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REGISTERED_OP_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object registeredOpType_; - /** - *
    -   * The gradient function's registered op type.
    -   * 
    - * - * string registered_op_type = 2; - */ - public java.lang.String getRegisteredOpType() { - java.lang.Object ref = registeredOpType_; - 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(); - registeredOpType_ = s; - return s; - } - } - /** - *
    -   * The gradient function's registered op type.
    -   * 
    - * - * string registered_op_type = 2; - */ - public com.google.protobuf.ByteString - getRegisteredOpTypeBytes() { - java.lang.Object ref = registeredOpType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - registeredOpType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getGradientFuncBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, gradientFunc_); - } - if (!getRegisteredOpTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, registeredOpType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGradientFuncBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, gradientFunc_); - } - if (!getRegisteredOpTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, registeredOpType_); - } - 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.RegisteredGradient)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RegisteredGradient other = (org.tensorflow.proto.framework.RegisteredGradient) obj; - - if (!getGradientFunc() - .equals(other.getGradientFunc())) return false; - if (!getRegisteredOpType() - .equals(other.getRegisteredOpType())) 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) + GRADIENT_FUNC_FIELD_NUMBER; - hash = (53 * hash) + getGradientFunc().hashCode(); - hash = (37 * hash) + REGISTERED_OP_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getRegisteredOpType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RegisteredGradient parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RegisteredGradient 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.RegisteredGradient parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RegisteredGradient 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.RegisteredGradient parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RegisteredGradient parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RegisteredGradient parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RegisteredGradient 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.RegisteredGradient parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RegisteredGradient 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.RegisteredGradient parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RegisteredGradient 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.RegisteredGradient 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; - } - /** - *
    -   * RegisteredGradient stores a gradient function that is registered in the
    -   * gradients library and used in the ops of a function in the function library.
    -   * Unlike GradientDef, these gradients are identified by op type, and not
    -   * directly linked to any function.
    -   * 
    - * - * Protobuf type {@code tensorflow.RegisteredGradient} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RegisteredGradient) - org.tensorflow.proto.framework.RegisteredGradientOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_RegisteredGradient_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RegisteredGradient.class, org.tensorflow.proto.framework.RegisteredGradient.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RegisteredGradient.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(); - gradientFunc_ = ""; - - registeredOpType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RegisteredGradient getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RegisteredGradient.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RegisteredGradient build() { - org.tensorflow.proto.framework.RegisteredGradient result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RegisteredGradient buildPartial() { - org.tensorflow.proto.framework.RegisteredGradient result = new org.tensorflow.proto.framework.RegisteredGradient(this); - result.gradientFunc_ = gradientFunc_; - result.registeredOpType_ = registeredOpType_; - 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.RegisteredGradient) { - return mergeFrom((org.tensorflow.proto.framework.RegisteredGradient)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RegisteredGradient other) { - if (other == org.tensorflow.proto.framework.RegisteredGradient.getDefaultInstance()) return this; - if (!other.getGradientFunc().isEmpty()) { - gradientFunc_ = other.gradientFunc_; - onChanged(); - } - if (!other.getRegisteredOpType().isEmpty()) { - registeredOpType_ = other.registeredOpType_; - onChanged(); - } - 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.RegisteredGradient parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RegisteredGradient) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object gradientFunc_ = ""; - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 1; - */ - public java.lang.String getGradientFunc() { - java.lang.Object ref = gradientFunc_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - gradientFunc_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 1; - */ - public com.google.protobuf.ByteString - getGradientFuncBytes() { - java.lang.Object ref = gradientFunc_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - gradientFunc_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 1; - */ - public Builder setGradientFunc( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - gradientFunc_ = value; - onChanged(); - return this; - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 1; - */ - public Builder clearGradientFunc() { - - gradientFunc_ = getDefaultInstance().getGradientFunc(); - onChanged(); - return this; - } - /** - *
    -     * The gradient function's name.
    -     * 
    - * - * string gradient_func = 1; - */ - public Builder setGradientFuncBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - gradientFunc_ = value; - onChanged(); - return this; - } - - private java.lang.Object registeredOpType_ = ""; - /** - *
    -     * The gradient function's registered op type.
    -     * 
    - * - * string registered_op_type = 2; - */ - public java.lang.String getRegisteredOpType() { - java.lang.Object ref = registeredOpType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - registeredOpType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The gradient function's registered op type.
    -     * 
    - * - * string registered_op_type = 2; - */ - public com.google.protobuf.ByteString - getRegisteredOpTypeBytes() { - java.lang.Object ref = registeredOpType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - registeredOpType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The gradient function's registered op type.
    -     * 
    - * - * string registered_op_type = 2; - */ - public Builder setRegisteredOpType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - registeredOpType_ = value; - onChanged(); - return this; - } - /** - *
    -     * The gradient function's registered op type.
    -     * 
    - * - * string registered_op_type = 2; - */ - public Builder clearRegisteredOpType() { - - registeredOpType_ = getDefaultInstance().getRegisteredOpType(); - onChanged(); - return this; - } - /** - *
    -     * The gradient function's registered op type.
    -     * 
    - * - * string registered_op_type = 2; - */ - public Builder setRegisteredOpTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - registeredOpType_ = value; - 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.RegisteredGradient) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RegisteredGradient) - private static final org.tensorflow.proto.framework.RegisteredGradient DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RegisteredGradient(); - } - - public static org.tensorflow.proto.framework.RegisteredGradient getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RegisteredGradient parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RegisteredGradient(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.RegisteredGradient getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandle.java deleted file mode 100644 index 85a3d489f33..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandle.java +++ /dev/null @@ -1,1441 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/remote_tensor_handle.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.eager.RemoteTensorHandle} - */ -public final class RemoteTensorHandle extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.eager.RemoteTensorHandle) - RemoteTensorHandleOrBuilder { -private static final long serialVersionUID = 0L; - // Use RemoteTensorHandle.newBuilder() to construct. - private RemoteTensorHandle(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RemoteTensorHandle() { - device_ = ""; - opDevice_ = ""; - dtype_ = 0; - resourceDtypesAndShapes_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RemoteTensorHandle(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RemoteTensorHandle( - 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: { - - opId_ = input.readInt64(); - break; - } - case 16: { - - outputNum_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - device_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - opDevice_ = s; - break; - } - case 40: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resourceDtypesAndShapes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - resourceDtypesAndShapes_.add( - input.readMessage(org.tensorflow.proto.framework.ResourceDtypeAndShape.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_ & 0x00000001) != 0)) { - resourceDtypesAndShapes_ = java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteTensorHandle.class, org.tensorflow.proto.framework.RemoteTensorHandle.Builder.class); - } - - public static final int OP_ID_FIELD_NUMBER = 1; - private long opId_; - /** - *
    -   * The ID of the operation that produced this tensor.
    -   * 
    - * - * int64 op_id = 1; - */ - public long getOpId() { - return opId_; - } - - public static final int OUTPUT_NUM_FIELD_NUMBER = 2; - private int outputNum_; - /** - *
    -   * The index into the outputs of the operation that produced this tensor.
    -   * 
    - * - * int32 output_num = 2; - */ - public int getOutputNum() { - return outputNum_; - } - - public static final int DEVICE_FIELD_NUMBER = 3; - private volatile java.lang.Object device_; - /** - *
    -   * Device where the tensor is located. Cannot be empty.
    -   * For multi-device functions, it's the default device passed to placer.
    -   * 
    - * - * string device = 3; - */ - 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; - } - } - /** - *
    -   * Device where the tensor is located. Cannot be empty.
    -   * For multi-device functions, it's the default device passed to placer.
    -   * 
    - * - * string device = 3; - */ - 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 OP_DEVICE_FIELD_NUMBER = 4; - private volatile java.lang.Object opDevice_; - /** - *
    -   * Device of the operation producing this tensor. Can be empty if the
    -   * operation producing this tensor is a multi-device function.
    -   * 
    - * - * string op_device = 4; - */ - public java.lang.String getOpDevice() { - java.lang.Object ref = opDevice_; - 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(); - opDevice_ = s; - return s; - } - } - /** - *
    -   * Device of the operation producing this tensor. Can be empty if the
    -   * operation producing this tensor is a multi-device function.
    -   * 
    - * - * string op_device = 4; - */ - public com.google.protobuf.ByteString - getOpDeviceBytes() { - java.lang.Object ref = opDevice_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opDevice_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DTYPE_FIELD_NUMBER = 5; - private int dtype_; - /** - *
    -   * Tensor type.
    -   * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -   * Tensor type.
    -   * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int RESOURCE_DTYPES_AND_SHAPES_FIELD_NUMBER = 6; - private java.util.List resourceDtypesAndShapes_; - /** - *
    -   * Optional data types and shapes of a remote resource variable.
    -   * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public java.util.List getResourceDtypesAndShapesList() { - return resourceDtypesAndShapes_; - } - /** - *
    -   * Optional data types and shapes of a remote resource variable.
    -   * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public java.util.List - getResourceDtypesAndShapesOrBuilderList() { - return resourceDtypesAndShapes_; - } - /** - *
    -   * Optional data types and shapes of a remote resource variable.
    -   * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public int getResourceDtypesAndShapesCount() { - return resourceDtypesAndShapes_.size(); - } - /** - *
    -   * Optional data types and shapes of a remote resource variable.
    -   * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShape getResourceDtypesAndShapes(int index) { - return resourceDtypesAndShapes_.get(index); - } - /** - *
    -   * Optional data types and shapes of a remote resource variable.
    -   * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder( - int index) { - return resourceDtypesAndShapes_.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 { - if (opId_ != 0L) { - output.writeInt64(1, opId_); - } - if (outputNum_ != 0) { - output.writeInt32(2, outputNum_); - } - if (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, device_); - } - if (!getOpDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, opDevice_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(5, dtype_); - } - for (int i = 0; i < resourceDtypesAndShapes_.size(); i++) { - output.writeMessage(6, resourceDtypesAndShapes_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (opId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, opId_); - } - if (outputNum_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, outputNum_); - } - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, device_); - } - if (!getOpDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, opDevice_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, dtype_); - } - for (int i = 0; i < resourceDtypesAndShapes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, resourceDtypesAndShapes_.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.RemoteTensorHandle)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RemoteTensorHandle other = (org.tensorflow.proto.framework.RemoteTensorHandle) obj; - - if (getOpId() - != other.getOpId()) return false; - if (getOutputNum() - != other.getOutputNum()) return false; - if (!getDevice() - .equals(other.getDevice())) return false; - if (!getOpDevice() - .equals(other.getOpDevice())) return false; - if (dtype_ != other.dtype_) return false; - if (!getResourceDtypesAndShapesList() - .equals(other.getResourceDtypesAndShapesList())) 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) + OP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOpId()); - hash = (37 * hash) + OUTPUT_NUM_FIELD_NUMBER; - hash = (53 * hash) + getOutputNum(); - hash = (37 * hash) + DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - hash = (37 * hash) + OP_DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getOpDevice().hashCode(); - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (getResourceDtypesAndShapesCount() > 0) { - hash = (37 * hash) + RESOURCE_DTYPES_AND_SHAPES_FIELD_NUMBER; - hash = (53 * hash) + getResourceDtypesAndShapesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RemoteTensorHandle parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle 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.RemoteTensorHandle parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle 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.RemoteTensorHandle parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle 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.RemoteTensorHandle parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle 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.RemoteTensorHandle parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RemoteTensorHandle 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.RemoteTensorHandle 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.eager.RemoteTensorHandle} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.eager.RemoteTensorHandle) - org.tensorflow.proto.framework.RemoteTensorHandleOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RemoteTensorHandle.class, org.tensorflow.proto.framework.RemoteTensorHandle.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RemoteTensorHandle.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResourceDtypesAndShapesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - opId_ = 0L; - - outputNum_ = 0; - - device_ = ""; - - opDevice_ = ""; - - dtype_ = 0; - - if (resourceDtypesAndShapesBuilder_ == null) { - resourceDtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resourceDtypesAndShapesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteTensorHandle getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RemoteTensorHandle.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteTensorHandle build() { - org.tensorflow.proto.framework.RemoteTensorHandle result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RemoteTensorHandle buildPartial() { - org.tensorflow.proto.framework.RemoteTensorHandle result = new org.tensorflow.proto.framework.RemoteTensorHandle(this); - int from_bitField0_ = bitField0_; - result.opId_ = opId_; - result.outputNum_ = outputNum_; - result.device_ = device_; - result.opDevice_ = opDevice_; - result.dtype_ = dtype_; - if (resourceDtypesAndShapesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - resourceDtypesAndShapes_ = java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.resourceDtypesAndShapes_ = resourceDtypesAndShapes_; - } else { - result.resourceDtypesAndShapes_ = resourceDtypesAndShapesBuilder_.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.RemoteTensorHandle) { - return mergeFrom((org.tensorflow.proto.framework.RemoteTensorHandle)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RemoteTensorHandle other) { - if (other == org.tensorflow.proto.framework.RemoteTensorHandle.getDefaultInstance()) return this; - if (other.getOpId() != 0L) { - setOpId(other.getOpId()); - } - if (other.getOutputNum() != 0) { - setOutputNum(other.getOutputNum()); - } - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - if (!other.getOpDevice().isEmpty()) { - opDevice_ = other.opDevice_; - onChanged(); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (resourceDtypesAndShapesBuilder_ == null) { - if (!other.resourceDtypesAndShapes_.isEmpty()) { - if (resourceDtypesAndShapes_.isEmpty()) { - resourceDtypesAndShapes_ = other.resourceDtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.addAll(other.resourceDtypesAndShapes_); - } - onChanged(); - } - } else { - if (!other.resourceDtypesAndShapes_.isEmpty()) { - if (resourceDtypesAndShapesBuilder_.isEmpty()) { - resourceDtypesAndShapesBuilder_.dispose(); - resourceDtypesAndShapesBuilder_ = null; - resourceDtypesAndShapes_ = other.resourceDtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - resourceDtypesAndShapesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResourceDtypesAndShapesFieldBuilder() : null; - } else { - resourceDtypesAndShapesBuilder_.addAllMessages(other.resourceDtypesAndShapes_); - } - } - } - 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.RemoteTensorHandle parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RemoteTensorHandle) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long opId_ ; - /** - *
    -     * The ID of the operation that produced this tensor.
    -     * 
    - * - * int64 op_id = 1; - */ - public long getOpId() { - return opId_; - } - /** - *
    -     * The ID of the operation that produced this tensor.
    -     * 
    - * - * int64 op_id = 1; - */ - public Builder setOpId(long value) { - - opId_ = value; - onChanged(); - return this; - } - /** - *
    -     * The ID of the operation that produced this tensor.
    -     * 
    - * - * int64 op_id = 1; - */ - public Builder clearOpId() { - - opId_ = 0L; - onChanged(); - return this; - } - - private int outputNum_ ; - /** - *
    -     * The index into the outputs of the operation that produced this tensor.
    -     * 
    - * - * int32 output_num = 2; - */ - public int getOutputNum() { - return outputNum_; - } - /** - *
    -     * The index into the outputs of the operation that produced this tensor.
    -     * 
    - * - * int32 output_num = 2; - */ - public Builder setOutputNum(int value) { - - outputNum_ = value; - onChanged(); - return this; - } - /** - *
    -     * The index into the outputs of the operation that produced this tensor.
    -     * 
    - * - * int32 output_num = 2; - */ - public Builder clearOutputNum() { - - outputNum_ = 0; - onChanged(); - return this; - } - - private java.lang.Object device_ = ""; - /** - *
    -     * Device where the tensor is located. Cannot be empty.
    -     * For multi-device functions, it's the default device passed to placer.
    -     * 
    - * - * string device = 3; - */ - 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; - } - } - /** - *
    -     * Device where the tensor is located. Cannot be empty.
    -     * For multi-device functions, it's the default device passed to placer.
    -     * 
    - * - * string device = 3; - */ - 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; - } - } - /** - *
    -     * Device where the tensor is located. Cannot be empty.
    -     * For multi-device functions, it's the default device passed to placer.
    -     * 
    - * - * string device = 3; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device where the tensor is located. Cannot be empty.
    -     * For multi-device functions, it's the default device passed to placer.
    -     * 
    - * - * string device = 3; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -     * Device where the tensor is located. Cannot be empty.
    -     * For multi-device functions, it's the default device passed to placer.
    -     * 
    - * - * string device = 3; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - onChanged(); - return this; - } - - private java.lang.Object opDevice_ = ""; - /** - *
    -     * Device of the operation producing this tensor. Can be empty if the
    -     * operation producing this tensor is a multi-device function.
    -     * 
    - * - * string op_device = 4; - */ - public java.lang.String getOpDevice() { - java.lang.Object ref = opDevice_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opDevice_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Device of the operation producing this tensor. Can be empty if the
    -     * operation producing this tensor is a multi-device function.
    -     * 
    - * - * string op_device = 4; - */ - public com.google.protobuf.ByteString - getOpDeviceBytes() { - java.lang.Object ref = opDevice_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opDevice_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Device of the operation producing this tensor. Can be empty if the
    -     * operation producing this tensor is a multi-device function.
    -     * 
    - * - * string op_device = 4; - */ - public Builder setOpDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opDevice_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device of the operation producing this tensor. Can be empty if the
    -     * operation producing this tensor is a multi-device function.
    -     * 
    - * - * string op_device = 4; - */ - public Builder clearOpDevice() { - - opDevice_ = getDefaultInstance().getOpDevice(); - onChanged(); - return this; - } - /** - *
    -     * Device of the operation producing this tensor. Can be empty if the
    -     * operation producing this tensor is a multi-device function.
    -     * 
    - * - * string op_device = 4; - */ - public Builder setOpDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opDevice_ = value; - onChanged(); - return this; - } - - private int dtype_ = 0; - /** - *
    -     * Tensor type.
    -     * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -     * Tensor type.
    -     * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - *
    -     * Tensor type.
    -     * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - *
    -     * Tensor type.
    -     * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Tensor type.
    -     * 
    - * - * .tensorflow.DataType dtype = 5; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private java.util.List resourceDtypesAndShapes_ = - java.util.Collections.emptyList(); - private void ensureResourceDtypesAndShapesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - resourceDtypesAndShapes_ = new java.util.ArrayList(resourceDtypesAndShapes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceDtypeAndShape, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder> resourceDtypesAndShapesBuilder_; - - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public java.util.List getResourceDtypesAndShapesList() { - if (resourceDtypesAndShapesBuilder_ == null) { - return java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); - } else { - return resourceDtypesAndShapesBuilder_.getMessageList(); - } - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public int getResourceDtypesAndShapesCount() { - if (resourceDtypesAndShapesBuilder_ == null) { - return resourceDtypesAndShapes_.size(); - } else { - return resourceDtypesAndShapesBuilder_.getCount(); - } - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShape getResourceDtypesAndShapes(int index) { - if (resourceDtypesAndShapesBuilder_ == null) { - return resourceDtypesAndShapes_.get(index); - } else { - return resourceDtypesAndShapesBuilder_.getMessage(index); - } - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder setResourceDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceDtypeAndShape value) { - if (resourceDtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.set(index, value); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder setResourceDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder builderForValue) { - if (resourceDtypesAndShapesBuilder_ == null) { - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.set(index, builderForValue.build()); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder addResourceDtypesAndShapes(org.tensorflow.proto.framework.ResourceDtypeAndShape value) { - if (resourceDtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.add(value); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder addResourceDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceDtypeAndShape value) { - if (resourceDtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.add(index, value); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder addResourceDtypesAndShapes( - org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder builderForValue) { - if (resourceDtypesAndShapesBuilder_ == null) { - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.add(builderForValue.build()); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder addResourceDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder builderForValue) { - if (resourceDtypesAndShapesBuilder_ == null) { - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.add(index, builderForValue.build()); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder addAllResourceDtypesAndShapes( - java.lang.Iterable values) { - if (resourceDtypesAndShapesBuilder_ == null) { - ensureResourceDtypesAndShapesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resourceDtypesAndShapes_); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder clearResourceDtypesAndShapes() { - if (resourceDtypesAndShapesBuilder_ == null) { - resourceDtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public Builder removeResourceDtypesAndShapes(int index) { - if (resourceDtypesAndShapesBuilder_ == null) { - ensureResourceDtypesAndShapesIsMutable(); - resourceDtypesAndShapes_.remove(index); - onChanged(); - } else { - resourceDtypesAndShapesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder getResourceDtypesAndShapesBuilder( - int index) { - return getResourceDtypesAndShapesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder( - int index) { - if (resourceDtypesAndShapesBuilder_ == null) { - return resourceDtypesAndShapes_.get(index); } else { - return resourceDtypesAndShapesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public java.util.List - getResourceDtypesAndShapesOrBuilderList() { - if (resourceDtypesAndShapesBuilder_ != null) { - return resourceDtypesAndShapesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); - } - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder addResourceDtypesAndShapesBuilder() { - return getResourceDtypesAndShapesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ResourceDtypeAndShape.getDefaultInstance()); - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder addResourceDtypesAndShapesBuilder( - int index) { - return getResourceDtypesAndShapesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ResourceDtypeAndShape.getDefaultInstance()); - } - /** - *
    -     * Optional data types and shapes of a remote resource variable.
    -     * 
    - * - * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; - */ - public java.util.List - getResourceDtypesAndShapesBuilderList() { - return getResourceDtypesAndShapesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceDtypeAndShape, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder> - getResourceDtypesAndShapesFieldBuilder() { - if (resourceDtypesAndShapesBuilder_ == null) { - resourceDtypesAndShapesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceDtypeAndShape, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder>( - resourceDtypesAndShapes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - resourceDtypesAndShapes_ = null; - } - return resourceDtypesAndShapesBuilder_; - } - @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.eager.RemoteTensorHandle) - } - - // @@protoc_insertion_point(class_scope:tensorflow.eager.RemoteTensorHandle) - private static final org.tensorflow.proto.framework.RemoteTensorHandle DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RemoteTensorHandle(); - } - - public static org.tensorflow.proto.framework.RemoteTensorHandle getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RemoteTensorHandle parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RemoteTensorHandle(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.RemoteTensorHandle getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 71335e14bde..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleProtos.java +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/remote_tensor_handle.proto - -package org.tensorflow.proto.framework; - -public final class RemoteTensorHandleProtos { - private RemoteTensorHandleProtos() {} - 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_eager_ResourceDtypeAndShape_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n3tensorflow/core/protobuf/remote_tensor" + - "_handle.proto\022\020tensorflow.eager\032,tensorf" + - "low/core/framework/tensor_shape.proto\032%t" + - "ensorflow/core/framework/types.proto\"i\n\025" + - "ResourceDtypeAndShape\022#\n\005dtype\030\001 \001(\0162\024.t" + - "ensorflow.DataType\022+\n\005shape\030\002 \001(\0132\034.tens" + - "orflow.TensorShapeProto\"\314\001\n\022RemoteTensor" + - "Handle\022\r\n\005op_id\030\001 \001(\003\022\022\n\noutput_num\030\002 \001(" + - "\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\226\001\n\036org.t" + - "ensorflow.proto.frameworkB\030RemoteTensorH" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor, - new java.lang.String[] { "Dtype", "Shape", }); - internal_static_tensorflow_eager_RemoteTensorHandle_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_eager_RemoteTensorHandle_descriptor, - new java.lang.String[] { "OpId", "OutputNum", "Device", "OpDevice", "Dtype", "ResourceDtypesAndShapes", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShape.java deleted file mode 100644 index 2586a7e626a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShape.java +++ /dev/null @@ -1,685 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/remote_tensor_handle.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.eager.ResourceDtypeAndShape} - */ -public final class ResourceDtypeAndShape extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.eager.ResourceDtypeAndShape) - ResourceDtypeAndShapeOrBuilder { -private static final long serialVersionUID = 0L; - // Use ResourceDtypeAndShape.newBuilder() to construct. - private ResourceDtypeAndShape(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ResourceDtypeAndShape() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ResourceDtypeAndShape(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ResourceDtypeAndShape( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - 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.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceDtypeAndShape.class, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - 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.ResourceDtypeAndShape)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ResourceDtypeAndShape other = (org.tensorflow.proto.framework.ResourceDtypeAndShape) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ResourceDtypeAndShape parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape 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.ResourceDtypeAndShape parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape 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.ResourceDtypeAndShape parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape 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.ResourceDtypeAndShape parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape 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.ResourceDtypeAndShape parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceDtypeAndShape 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.ResourceDtypeAndShape 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.eager.ResourceDtypeAndShape} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.eager.ResourceDtypeAndShape) - org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceDtypeAndShape.class, org.tensorflow.proto.framework.ResourceDtypeAndShape.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ResourceDtypeAndShape.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(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceDtypeAndShape getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ResourceDtypeAndShape.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceDtypeAndShape build() { - org.tensorflow.proto.framework.ResourceDtypeAndShape result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceDtypeAndShape buildPartial() { - org.tensorflow.proto.framework.ResourceDtypeAndShape result = new org.tensorflow.proto.framework.ResourceDtypeAndShape(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.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.ResourceDtypeAndShape) { - return mergeFrom((org.tensorflow.proto.framework.ResourceDtypeAndShape)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ResourceDtypeAndShape other) { - if (other == org.tensorflow.proto.framework.ResourceDtypeAndShape.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - 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.ResourceDtypeAndShape parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ResourceDtypeAndShape) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - @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.eager.ResourceDtypeAndShape) - } - - // @@protoc_insertion_point(class_scope:tensorflow.eager.ResourceDtypeAndShape) - private static final org.tensorflow.proto.framework.ResourceDtypeAndShape DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ResourceDtypeAndShape(); - } - - public static org.tensorflow.proto.framework.ResourceDtypeAndShape getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ResourceDtypeAndShape parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceDtypeAndShape(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.ResourceDtypeAndShape getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShapeOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShapeOrBuilder.java deleted file mode 100644 index 67ab4da1b8d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceDtypeAndShapeOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/remote_tensor_handle.proto - -package org.tensorflow.proto.framework; - -public interface ResourceDtypeAndShapeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.eager.ResourceDtypeAndShape) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandle.java deleted file mode 100644 index 5a96505f0eb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandle.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -public final class ResourceHandle { - private ResourceHandle() {} - 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_ResourceHandleProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_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/framework/resource_han" + - "dle.proto\022\ntensorflow\032,tensorflow/core/f" + - "ramework/tensor_shape.proto\032%tensorflow/" + - "core/framework/types.proto\"\245\002\n\023ResourceH" + - "andleProto\022\016\n\006device\030\001 \001(\t\022\021\n\tcontainer\030" + - "\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\021\n\thash_code\030\004 \001(\004\022\027" + - "\n\017maybe_type_name\030\005 \001(\t\022H\n\021dtypes_and_sh" + - "apes\030\006 \003(\0132-.tensorflow.ResourceHandlePr" + - "oto.DtypeAndShape\032a\n\rDtypeAndShape\022#\n\005dt" + - "ype\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005shape" + - "\030\002 \001(\0132\034.tensorflow.TensorShapeProtoJ\004\010\007" + - "\020\010B\215\001\n\036org.tensorflow.proto.frameworkB\016R" + - "esourceHandleP\001ZVgithub.com/tensorflow/t" + - "ensorflow/tensorflow/go/core/framework/r" + - "esource_handle_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_ResourceHandleProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ResourceHandleProto_descriptor, - new java.lang.String[] { "Device", "Container", "Name", "HashCode", "MaybeTypeName", "DtypesAndShapes", }); - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor = - internal_static_tensorflow_ResourceHandleProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor, - new java.lang.String[] { "Dtype", "Shape", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProto.java deleted file mode 100644 index 3d31206b794..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProto.java +++ /dev/null @@ -1,2288 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a handle to a tensorflow resource. Handles are
    - * not valid across executions, but can be serialized back and forth from within
    - * a single run.
    - * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto} - */ -public final class ResourceHandleProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto) - ResourceHandleProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use ResourceHandleProto.newBuilder() to construct. - private ResourceHandleProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ResourceHandleProto() { - device_ = ""; - container_ = ""; - name_ = ""; - maybeTypeName_ = ""; - dtypesAndShapes_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ResourceHandleProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ResourceHandleProto( - 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(); - - device_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - container_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 32: { - - hashCode_ = input.readUInt64(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - maybeTypeName_ = s; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dtypesAndShapes_.add( - input.readMessage(org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.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_ & 0x00000001) != 0)) { - dtypesAndShapes_ = java.util.Collections.unmodifiableList(dtypesAndShapes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceHandleProto.class, org.tensorflow.proto.framework.ResourceHandleProto.Builder.class); - } - - public interface DtypeAndShapeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto.DtypeAndShape) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - } - /** - *
    -   * Protocol buffer representing a pair of (data type, tensor shape).
    -   * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} - */ - public static final class DtypeAndShape extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto.DtypeAndShape) - DtypeAndShapeOrBuilder { - private static final long serialVersionUID = 0L; - // Use DtypeAndShape.newBuilder() to construct. - private DtypeAndShape(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DtypeAndShape() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DtypeAndShape(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DtypeAndShape( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - 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.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.class, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - 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.ResourceHandleProto.DtypeAndShape)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape other = (org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape 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; - } - /** - *
    -     * Protocol buffer representing a pair of (data type, tensor shape).
    -     * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto.DtypeAndShape) - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.class, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.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(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape build() { - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape buildPartial() { - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape result = new org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.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.ResourceHandleProto.DtypeAndShape) { - return mergeFrom((org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape other) { - if (other == org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - 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.ResourceHandleProto.DtypeAndShape parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - @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.ResourceHandleProto.DtypeAndShape) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto.DtypeAndShape) - private static final org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape(); - } - - public static org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DtypeAndShape parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DtypeAndShape(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.ResourceHandleProto.DtypeAndShape getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int DEVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object device_; - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - 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 CONTAINER_FIELD_NUMBER = 2; - private volatile java.lang.Object container_; - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - public java.lang.String getContainer() { - java.lang.Object ref = container_; - 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(); - container_ = s; - return s; - } - } - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - public com.google.protobuf.ByteString - getContainerBytes() { - java.lang.Object ref = container_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - container_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * 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 HASH_CODE_FIELD_NUMBER = 4; - private long hashCode_; - /** - *
    -   * Hash code for the type of the resource. Is only valid in the same device
    -   * and in the same execution.
    -   * 
    - * - * uint64 hash_code = 4; - */ - public long getHashCode() { - return hashCode_; - } - - public static final int MAYBE_TYPE_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object maybeTypeName_; - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - public java.lang.String getMaybeTypeName() { - java.lang.Object ref = maybeTypeName_; - 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(); - maybeTypeName_ = s; - return s; - } - } - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - public com.google.protobuf.ByteString - getMaybeTypeNameBytes() { - java.lang.Object ref = maybeTypeName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - maybeTypeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DTYPES_AND_SHAPES_FIELD_NUMBER = 6; - private java.util.List dtypesAndShapes_; - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List getDtypesAndShapesList() { - return dtypesAndShapes_; - } - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesOrBuilderList() { - return dtypesAndShapes_; - } - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public int getDtypesAndShapesCount() { - return dtypesAndShapes_.size(); - } - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index) { - return dtypesAndShapes_.get(index); - } - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index) { - return dtypesAndShapes_.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 { - if (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_); - } - if (!getContainerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, container_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (hashCode_ != 0L) { - output.writeUInt64(4, hashCode_); - } - if (!getMaybeTypeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, maybeTypeName_); - } - for (int i = 0; i < dtypesAndShapes_.size(); i++) { - output.writeMessage(6, dtypesAndShapes_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_); - } - if (!getContainerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, container_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (hashCode_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, hashCode_); - } - if (!getMaybeTypeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, maybeTypeName_); - } - for (int i = 0; i < dtypesAndShapes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, dtypesAndShapes_.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.ResourceHandleProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ResourceHandleProto other = (org.tensorflow.proto.framework.ResourceHandleProto) obj; - - if (!getDevice() - .equals(other.getDevice())) return false; - if (!getContainer() - .equals(other.getContainer())) return false; - if (!getName() - .equals(other.getName())) return false; - if (getHashCode() - != other.getHashCode()) return false; - if (!getMaybeTypeName() - .equals(other.getMaybeTypeName())) return false; - if (!getDtypesAndShapesList() - .equals(other.getDtypesAndShapesList())) 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_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - hash = (37 * hash) + CONTAINER_FIELD_NUMBER; - hash = (53 * hash) + getContainer().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + HASH_CODE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getHashCode()); - hash = (37 * hash) + MAYBE_TYPE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getMaybeTypeName().hashCode(); - if (getDtypesAndShapesCount() > 0) { - hash = (37 * hash) + DTYPES_AND_SHAPES_FIELD_NUMBER; - hash = (53 * hash) + getDtypesAndShapesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ResourceHandleProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto 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.ResourceHandleProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto 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.ResourceHandleProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ResourceHandleProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ResourceHandleProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto 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.ResourceHandleProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto 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.ResourceHandleProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ResourceHandleProto 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.ResourceHandleProto 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; - } - /** - *
    -   * Protocol buffer representing a handle to a tensorflow resource. Handles are
    -   * not valid across executions, but can be serialized back and forth from within
    -   * a single run.
    -   * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto) - org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ResourceHandleProto.class, org.tensorflow.proto.framework.ResourceHandleProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ResourceHandleProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDtypesAndShapesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - device_ = ""; - - container_ = ""; - - name_ = ""; - - hashCode_ = 0L; - - maybeTypeName_ = ""; - - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - dtypesAndShapesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ResourceHandleProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto build() { - org.tensorflow.proto.framework.ResourceHandleProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ResourceHandleProto buildPartial() { - org.tensorflow.proto.framework.ResourceHandleProto result = new org.tensorflow.proto.framework.ResourceHandleProto(this); - int from_bitField0_ = bitField0_; - result.device_ = device_; - result.container_ = container_; - result.name_ = name_; - result.hashCode_ = hashCode_; - result.maybeTypeName_ = maybeTypeName_; - if (dtypesAndShapesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = java.util.Collections.unmodifiableList(dtypesAndShapes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dtypesAndShapes_ = dtypesAndShapes_; - } else { - result.dtypesAndShapes_ = dtypesAndShapesBuilder_.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.ResourceHandleProto) { - return mergeFrom((org.tensorflow.proto.framework.ResourceHandleProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ResourceHandleProto other) { - if (other == org.tensorflow.proto.framework.ResourceHandleProto.getDefaultInstance()) return this; - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - if (!other.getContainer().isEmpty()) { - container_ = other.container_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getHashCode() != 0L) { - setHashCode(other.getHashCode()); - } - if (!other.getMaybeTypeName().isEmpty()) { - maybeTypeName_ = other.maybeTypeName_; - onChanged(); - } - if (dtypesAndShapesBuilder_ == null) { - if (!other.dtypesAndShapes_.isEmpty()) { - if (dtypesAndShapes_.isEmpty()) { - dtypesAndShapes_ = other.dtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.addAll(other.dtypesAndShapes_); - } - onChanged(); - } - } else { - if (!other.dtypesAndShapes_.isEmpty()) { - if (dtypesAndShapesBuilder_.isEmpty()) { - dtypesAndShapesBuilder_.dispose(); - dtypesAndShapesBuilder_ = null; - dtypesAndShapes_ = other.dtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - dtypesAndShapesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDtypesAndShapesFieldBuilder() : null; - } else { - dtypesAndShapesBuilder_.addAllMessages(other.dtypesAndShapes_); - } - } - } - 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.ResourceHandleProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ResourceHandleProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object device_ = ""; - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - onChanged(); - return this; - } - - private java.lang.Object container_ = ""; - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public java.lang.String getContainer() { - java.lang.Object ref = container_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - container_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public com.google.protobuf.ByteString - getContainerBytes() { - java.lang.Object ref = container_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - container_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder setContainer( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - container_ = value; - onChanged(); - return this; - } - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder clearContainer() { - - container_ = getDefaultInstance().getContainer(); - onChanged(); - return this; - } - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder setContainerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - container_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * 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 hashCode_ ; - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public long getHashCode() { - return hashCode_; - } - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public Builder setHashCode(long value) { - - hashCode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public Builder clearHashCode() { - - hashCode_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object maybeTypeName_ = ""; - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public java.lang.String getMaybeTypeName() { - java.lang.Object ref = maybeTypeName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - maybeTypeName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public com.google.protobuf.ByteString - getMaybeTypeNameBytes() { - java.lang.Object ref = maybeTypeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - maybeTypeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder setMaybeTypeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - maybeTypeName_ = value; - onChanged(); - return this; - } - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder clearMaybeTypeName() { - - maybeTypeName_ = getDefaultInstance().getMaybeTypeName(); - onChanged(); - return this; - } - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder setMaybeTypeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - maybeTypeName_ = value; - onChanged(); - return this; - } - - private java.util.List dtypesAndShapes_ = - java.util.Collections.emptyList(); - private void ensureDtypesAndShapesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = new java.util.ArrayList(dtypesAndShapes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder> dtypesAndShapesBuilder_; - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List getDtypesAndShapesList() { - if (dtypesAndShapesBuilder_ == null) { - return java.util.Collections.unmodifiableList(dtypesAndShapes_); - } else { - return dtypesAndShapesBuilder_.getMessageList(); - } - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public int getDtypesAndShapesCount() { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.size(); - } else { - return dtypesAndShapesBuilder_.getCount(); - } - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index) { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.get(index); - } else { - return dtypesAndShapesBuilder_.getMessage(index); - } - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder setDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.set(index, value); - onChanged(); - } else { - dtypesAndShapesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder setDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.set(index, builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes(org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(value); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(index, value); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - int index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(index, builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addAllDtypesAndShapes( - java.lang.Iterable values) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dtypesAndShapes_); - onChanged(); - } else { - dtypesAndShapesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder clearDtypesAndShapes() { - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - dtypesAndShapesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder removeDtypesAndShapes(int index) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.remove(index); - onChanged(); - } else { - dtypesAndShapesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder getDtypesAndShapesBuilder( - int index) { - return getDtypesAndShapesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index) { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.get(index); } else { - return dtypesAndShapesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesOrBuilderList() { - if (dtypesAndShapesBuilder_ != null) { - return dtypesAndShapesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(dtypesAndShapes_); - } - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder addDtypesAndShapesBuilder() { - return getDtypesAndShapesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder addDtypesAndShapesBuilder( - int index) { - return getDtypesAndShapesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesBuilderList() { - return getDtypesAndShapesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder> - getDtypesAndShapesFieldBuilder() { - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder>( - dtypesAndShapes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - dtypesAndShapes_ = null; - } - return dtypesAndShapesBuilder_; - } - @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.ResourceHandleProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto) - private static final org.tensorflow.proto.framework.ResourceHandleProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ResourceHandleProto(); - } - - public static org.tensorflow.proto.framework.ResourceHandleProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ResourceHandleProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceHandleProto(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.ResourceHandleProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java deleted file mode 100644 index 461b2de1dba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java +++ /dev/null @@ -1,137 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -public interface ResourceHandleProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - java.lang.String getDevice(); - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - com.google.protobuf.ByteString - getDeviceBytes(); - - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - java.lang.String getContainer(); - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - com.google.protobuf.ByteString - getContainerBytes(); - - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - java.lang.String getName(); - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Hash code for the type of the resource. Is only valid in the same device
    -   * and in the same execution.
    -   * 
    - * - * uint64 hash_code = 4; - */ - long getHashCode(); - - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - java.lang.String getMaybeTypeName(); - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - com.google.protobuf.ByteString - getMaybeTypeNameBytes(); - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - java.util.List - getDtypesAndShapesList(); - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index); - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - int getDtypesAndShapesCount(); - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - java.util.List - getDtypesAndShapesOrBuilderList(); - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index); -} 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 deleted file mode 100644 index 54860b767d8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfig.java +++ /dev/null @@ -1,6573 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Graph rewriting is experimental and subject to change, not covered by any
    - * API stability guarantees.
    - * 
    - * - * Protobuf type {@code tensorflow.RewriterConfig} - */ -public final class RewriterConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig) - RewriterConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use RewriterConfig.newBuilder() to construct. - private RewriterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RewriterConfig() { - cpuLayoutConversion_ = 0; - layoutOptimizer_ = 0; - constantFolding_ = 0; - shapeOptimization_ = 0; - remapping_ = 0; - commonSubgraphElimination_ = 0; - arithmeticOptimization_ = 0; - dependencyOptimization_ = 0; - loopOptimization_ = 0; - functionOptimization_ = 0; - debugStripper_ = 0; - scopedAllocatorOptimization_ = 0; - pinToHostOptimization_ = 0; - implementationSelector_ = 0; - autoMixedPrecision_ = 0; - autoMixedPrecisionMkl_ = 0; - usePluginOptimizers_ = 0; - metaOptimizerIterations_ = 0; - memoryOptimization_ = 0; - memoryOptimizerTargetNodeNameScope_ = ""; - optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - customOptimizers_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RewriterConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RewriterConfig( - 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: { - int rawValue = input.readEnum(); - - layoutOptimizer_ = rawValue; - break; - } - case 16: { - - disableModelPruning_ = input.readBool(); - break; - } - case 24: { - int rawValue = input.readEnum(); - - constantFolding_ = rawValue; - break; - } - case 32: { - int rawValue = input.readEnum(); - - memoryOptimization_ = rawValue; - break; - } - case 42: { - org.tensorflow.proto.framework.AutoParallelOptions.Builder subBuilder = null; - if (autoParallel_ != null) { - subBuilder = autoParallel_.toBuilder(); - } - autoParallel_ = input.readMessage(org.tensorflow.proto.framework.AutoParallelOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(autoParallel_); - autoParallel_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - memoryOptimizerTargetNodeNameScope_ = s; - break; - } - case 56: { - int rawValue = input.readEnum(); - - arithmeticOptimization_ = rawValue; - break; - } - case 64: { - int rawValue = input.readEnum(); - - dependencyOptimization_ = rawValue; - break; - } - case 72: { - int rawValue = input.readEnum(); - - loopOptimization_ = rawValue; - break; - } - case 80: { - int rawValue = input.readEnum(); - - functionOptimization_ = rawValue; - break; - } - case 88: { - int rawValue = input.readEnum(); - - debugStripper_ = rawValue; - break; - } - case 96: { - int rawValue = input.readEnum(); - - metaOptimizerIterations_ = rawValue; - break; - } - case 104: { - int rawValue = input.readEnum(); - - shapeOptimization_ = rawValue; - break; - } - case 112: { - int rawValue = input.readEnum(); - - remapping_ = rawValue; - break; - } - case 120: { - int rawValue = input.readEnum(); - - scopedAllocatorOptimization_ = rawValue; - break; - } - case 130: { - org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder subBuilder = null; - if (scopedAllocatorOpts_ != null) { - subBuilder = scopedAllocatorOpts_.toBuilder(); - } - scopedAllocatorOpts_ = input.readMessage(org.tensorflow.proto.framework.ScopedAllocatorOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(scopedAllocatorOpts_); - scopedAllocatorOpts_ = subBuilder.buildPartial(); - } - - break; - } - case 136: { - - minGraphNodes_ = input.readInt32(); - break; - } - case 144: { - int rawValue = input.readEnum(); - - pinToHostOptimization_ = rawValue; - break; - } - case 152: { - - disableMetaOptimizer_ = input.readBool(); - break; - } - case 160: { - - metaOptimizerTimeoutMs_ = input.readInt64(); - break; - } - case 168: { - - failOnOptimizerErrors_ = input.readBool(); - break; - } - case 176: { - int rawValue = input.readEnum(); - - implementationSelector_ = rawValue; - break; - } - case 184: { - int rawValue = input.readEnum(); - - autoMixedPrecision_ = rawValue; - break; - } - case 192: { - int rawValue = input.readEnum(); - - commonSubgraphElimination_ = rawValue; - break; - } - case 200: { - int rawValue = input.readEnum(); - - autoMixedPrecisionMkl_ = rawValue; - break; - } - case 208: { - - experimentalDisableCompressedTensorOptimization_ = input.readBool(); - break; - } - case 216: { - - experimentalDisableFoldingQuantizationEmulation_ = input.readBool(); - break; - } - case 224: { - int rawValue = input.readEnum(); - - usePluginOptimizers_ = rawValue; - break; - } - case 400: { - int rawValue = input.readEnum(); - - cpuLayoutConversion_ = rawValue; - break; - } - case 802: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - optimizers_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - optimizers_.add(s); - break; - } - case 1602: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - customOptimizers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - customOptimizers_.add( - input.readMessage(org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.parser(), extensionRegistry)); - break; - } - case 2402: { - org.tensorflow.proto.framework.VerifierConfig.Builder subBuilder = null; - if (interOptimizerVerifierConfig_ != null) { - subBuilder = interOptimizerVerifierConfig_.toBuilder(); - } - interOptimizerVerifierConfig_ = input.readMessage(org.tensorflow.proto.framework.VerifierConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(interOptimizerVerifierConfig_); - interOptimizerVerifierConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 2410: { - org.tensorflow.proto.framework.VerifierConfig.Builder subBuilder = null; - if (postOptimizationVerifierConfig_ != null) { - subBuilder = postOptimizationVerifierConfig_.toBuilder(); - } - postOptimizationVerifierConfig_ = input.readMessage(org.tensorflow.proto.framework.VerifierConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(postOptimizationVerifierConfig_); - postOptimizationVerifierConfig_ = subBuilder.buildPartial(); - } - - 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)) { - optimizers_ = optimizers_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - customOptimizers_ = java.util.Collections.unmodifiableList(customOptimizers_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RewriterConfig.class, org.tensorflow.proto.framework.RewriterConfig.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.RewriterConfig.Toggle} - */ - public enum Toggle - implements com.google.protobuf.ProtocolMessageEnum { - /** - * DEFAULT = 0; - */ - DEFAULT(0), - /** - * ON = 1; - */ - ON(1), - /** - * OFF = 2; - */ - OFF(2), - /** - *
    -     * Enable some aggressive optimizations that use assumptions that TF graphs
    -     * may break. For example, assume the shape of a placeholder matches its
    -     * actual feed.
    -     * 
    - * - * AGGRESSIVE = 3; - */ - AGGRESSIVE(3), - 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; - /** - *
    -     * Enable some aggressive optimizations that use assumptions that TF graphs
    -     * may break. For example, assume the shape of a placeholder matches its
    -     * actual feed.
    -     * 
    - * - * AGGRESSIVE = 3; - */ - public static final int AGGRESSIVE_VALUE = 3; - - - 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 Toggle valueOf(int value) { - return forNumber(value); - } - - public static Toggle forNumber(int value) { - switch (value) { - case 0: return DEFAULT; - case 1: return ON; - case 2: return OFF; - case 3: return AGGRESSIVE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Toggle> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Toggle findValueByNumber(int number) { - return Toggle.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(0); - } - - private static final Toggle[] VALUES = values(); - - public static Toggle 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 Toggle(int value) { - this.value = 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
    -   * run them twice.
    -   * 
    - * - * Protobuf enum {@code tensorflow.RewriterConfig.NumIterationsType} - */ - public enum NumIterationsType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * DEFAULT_NUM_ITERS = 0; - */ - DEFAULT_NUM_ITERS(0), - /** - * ONE = 1; - */ - ONE(1), - /** - * TWO = 2; - */ - TWO(2), - UNRECOGNIZED(-1), - ; - - /** - * DEFAULT_NUM_ITERS = 0; - */ - public static final int DEFAULT_NUM_ITERS_VALUE = 0; - /** - * ONE = 1; - */ - public static final int ONE_VALUE = 1; - /** - * TWO = 2; - */ - public static final int TWO_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 NumIterationsType valueOf(int value) { - return forNumber(value); - } - - public static NumIterationsType forNumber(int value) { - switch (value) { - case 0: return DEFAULT_NUM_ITERS; - case 1: return ONE; - case 2: return TWO; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - NumIterationsType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public NumIterationsType findValueByNumber(int number) { - return NumIterationsType.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(2); - } - - private static final NumIterationsType[] VALUES = values(); - - public static NumIterationsType 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 NumIterationsType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.NumIterationsType) - } - - /** - * Protobuf enum {@code tensorflow.RewriterConfig.MemOptType} - */ - public enum MemOptType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * The default setting (SCHEDULING and SWAPPING HEURISTICS only)
    -     * 
    - * - * DEFAULT_MEM_OPT = 0; - */ - DEFAULT_MEM_OPT(0), - /** - *
    -     * Disabled in the meta-optimizer.
    -     * 
    - * - * NO_MEM_OPT = 1; - */ - NO_MEM_OPT(1), - /** - *
    -     * Driven by manual op-level annotations.
    -     * 
    - * - * MANUAL = 2; - */ - MANUAL(2), - /** - *
    -     * Swapping heuristic will move a tensor from the GPU to the CPU and move
    -     * it back when needed to reduce peak memory usage.
    -     * 
    - * - * SWAPPING_HEURISTICS = 4; - */ - SWAPPING_HEURISTICS(4), - /** - *
    -     * Recomputation heuristics will recompute ops (such as Relu activation)
    -     * during backprop instead of storing them, reducing peak memory usage.
    -     * 
    - * - * RECOMPUTATION_HEURISTICS = 5; - */ - RECOMPUTATION_HEURISTICS(5), - /** - *
    -     * Scheduling will split big ops such as AddN and try to enforce a schedule
    -     * of the new computations that decreases peak memory usage.
    -     * 
    - * - * SCHEDULING_HEURISTICS = 6; - */ - SCHEDULING_HEURISTICS(6), - /** - *
    -     * Use any combination of swapping and recomputation heuristics.
    -     * 
    - * - * HEURISTICS = 3; - */ - HEURISTICS(3), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * The default setting (SCHEDULING and SWAPPING HEURISTICS only)
    -     * 
    - * - * DEFAULT_MEM_OPT = 0; - */ - public static final int DEFAULT_MEM_OPT_VALUE = 0; - /** - *
    -     * Disabled in the meta-optimizer.
    -     * 
    - * - * NO_MEM_OPT = 1; - */ - public static final int NO_MEM_OPT_VALUE = 1; - /** - *
    -     * Driven by manual op-level annotations.
    -     * 
    - * - * MANUAL = 2; - */ - public static final int MANUAL_VALUE = 2; - /** - *
    -     * Swapping heuristic will move a tensor from the GPU to the CPU and move
    -     * it back when needed to reduce peak memory usage.
    -     * 
    - * - * SWAPPING_HEURISTICS = 4; - */ - public static final int SWAPPING_HEURISTICS_VALUE = 4; - /** - *
    -     * Recomputation heuristics will recompute ops (such as Relu activation)
    -     * during backprop instead of storing them, reducing peak memory usage.
    -     * 
    - * - * RECOMPUTATION_HEURISTICS = 5; - */ - public static final int RECOMPUTATION_HEURISTICS_VALUE = 5; - /** - *
    -     * Scheduling will split big ops such as AddN and try to enforce a schedule
    -     * of the new computations that decreases peak memory usage.
    -     * 
    - * - * SCHEDULING_HEURISTICS = 6; - */ - public static final int SCHEDULING_HEURISTICS_VALUE = 6; - /** - *
    -     * Use any combination of swapping and recomputation heuristics.
    -     * 
    - * - * HEURISTICS = 3; - */ - public static final int HEURISTICS_VALUE = 3; - - - 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 MemOptType valueOf(int value) { - return forNumber(value); - } - - public static MemOptType forNumber(int value) { - switch (value) { - case 0: return DEFAULT_MEM_OPT; - case 1: return NO_MEM_OPT; - case 2: return MANUAL; - case 4: return SWAPPING_HEURISTICS; - case 5: return RECOMPUTATION_HEURISTICS; - case 6: return SCHEDULING_HEURISTICS; - case 3: return HEURISTICS; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MemOptType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MemOptType findValueByNumber(int number) { - return MemOptType.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(3); - } - - private static final MemOptType[] VALUES = values(); - - public static MemOptType 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 MemOptType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.MemOptType) - } - - public interface CustomGraphOptimizerOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RewriterConfig.CustomGraphOptimizer) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - int getParameterMapCount(); - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - boolean containsParameterMap( - java.lang.String key); - /** - * Use {@link #getParameterMapMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getParameterMap(); - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - java.util.Map - getParameterMapMap(); - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - org.tensorflow.proto.framework.AttrValue getParameterMapOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue); - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - org.tensorflow.proto.framework.AttrValue getParameterMapOrThrow( - java.lang.String key); - } - /** - *
    -   * Message to describe custom graph optimizer and its parameters
    -   * 
    - * - * Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer} - */ - public static final class CustomGraphOptimizer extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig.CustomGraphOptimizer) - CustomGraphOptimizerOrBuilder { - private static final long serialVersionUID = 0L; - // Use CustomGraphOptimizer.newBuilder() to construct. - private CustomGraphOptimizer(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CustomGraphOptimizer() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CustomGraphOptimizer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CustomGraphOptimizer( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - parameterMap_ = com.google.protobuf.MapField.newMapField( - ParameterMapDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - parameterMap__ = input.readMessage( - ParameterMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - parameterMap_.getMutableMap().put( - parameterMap__.getKey(), parameterMap__.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.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetParameterMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 PARAMETER_MAP_FIELD_NUMBER = 2; - private static final class ParameterMapDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.AttrValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> parameterMap_; - private com.google.protobuf.MapField - internalGetParameterMap() { - if (parameterMap_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ParameterMapDefaultEntryHolder.defaultEntry); - } - return parameterMap_; - } - - public int getParameterMapCount() { - return internalGetParameterMap().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public boolean containsParameterMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetParameterMap().getMap().containsKey(key); - } - /** - * Use {@link #getParameterMapMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getParameterMap() { - return getParameterMapMap(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public java.util.Map getParameterMapMap() { - return internalGetParameterMap().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getParameterMapOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameterMap().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getParameterMapOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameterMap().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_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetParameterMap(), - ParameterMapDefaultEntryHolder.defaultEntry, - 2); - 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_); - } - for (java.util.Map.Entry entry - : internalGetParameterMap().getMap().entrySet()) { - com.google.protobuf.MapEntry - parameterMap__ = ParameterMapDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, parameterMap__); - } - 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.RewriterConfig.CustomGraphOptimizer)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer other = (org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!internalGetParameterMap().equals( - other.internalGetParameterMap())) 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(); - if (!internalGetParameterMap().getMap().isEmpty()) { - hash = (37 * hash) + PARAMETER_MAP_FIELD_NUMBER; - hash = (53 * hash) + internalGetParameterMap().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer 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; - } - /** - *
    -     * Message to describe custom graph optimizer and its parameters
    -     * 
    - * - * Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig.CustomGraphOptimizer) - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetParameterMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableParameterMap(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.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_ = ""; - - internalGetMutableParameterMap().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer build() { - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer buildPartial() { - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer result = new org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.parameterMap_ = internalGetParameterMap(); - result.parameterMap_.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.RewriterConfig.CustomGraphOptimizer) { - return mergeFrom((org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer other) { - if (other == org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - internalGetMutableParameterMap().mergeFrom( - other.internalGetParameterMap()); - 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.RewriterConfig.CustomGraphOptimizer parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.AttrValue> parameterMap_; - private com.google.protobuf.MapField - internalGetParameterMap() { - if (parameterMap_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ParameterMapDefaultEntryHolder.defaultEntry); - } - return parameterMap_; - } - private com.google.protobuf.MapField - internalGetMutableParameterMap() { - onChanged();; - if (parameterMap_ == null) { - parameterMap_ = com.google.protobuf.MapField.newMapField( - ParameterMapDefaultEntryHolder.defaultEntry); - } - if (!parameterMap_.isMutable()) { - parameterMap_ = parameterMap_.copy(); - } - return parameterMap_; - } - - public int getParameterMapCount() { - return internalGetParameterMap().getMap().size(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public boolean containsParameterMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetParameterMap().getMap().containsKey(key); - } - /** - * Use {@link #getParameterMapMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getParameterMap() { - return getParameterMapMap(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public java.util.Map getParameterMapMap() { - return internalGetParameterMap().getMap(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getParameterMapOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameterMap().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public org.tensorflow.proto.framework.AttrValue getParameterMapOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetParameterMap().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearParameterMap() { - internalGetMutableParameterMap().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public Builder removeParameterMap( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableParameterMap().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableParameterMap() { - return internalGetMutableParameterMap().getMutableMap(); - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - public Builder putParameterMap( - java.lang.String key, - org.tensorflow.proto.framework.AttrValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableParameterMap().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.AttrValue> parameter_map = 2; - */ - - public Builder putAllParameterMap( - java.util.Map values) { - internalGetMutableParameterMap().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.RewriterConfig.CustomGraphOptimizer) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig.CustomGraphOptimizer) - private static final org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer(); - } - - public static org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomGraphOptimizer parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomGraphOptimizer(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.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - 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_; - /** - *
    -   * Optimize tensor layouts (default is ON)
    -   * e.g. This will try to use NCHW layout on GPU which is faster.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public int getLayoutOptimizerValue() { - return layoutOptimizer_; - } - /** - *
    -   * Optimize tensor layouts (default is ON)
    -   * e.g. This will try to use NCHW layout on GPU which is faster.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getLayoutOptimizer() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(layoutOptimizer_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int CONSTANT_FOLDING_FIELD_NUMBER = 3; - private int constantFolding_; - /** - *
    -   * Fold constants (default is ON)
    -   * Statically infer the value of tensors when possible, and materialize the
    -   * result using constants.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public int getConstantFoldingValue() { - return constantFolding_; - } - /** - *
    -   * Fold constants (default is ON)
    -   * Statically infer the value of tensors when possible, and materialize the
    -   * result using constants.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getConstantFolding() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(constantFolding_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int SHAPE_OPTIMIZATION_FIELD_NUMBER = 13; - private int shapeOptimization_; - /** - *
    -   * Shape optimizations (default is ON)
    -   * Simplify computations made on shapes.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public int getShapeOptimizationValue() { - return shapeOptimization_; - } - /** - *
    -   * Shape optimizations (default is ON)
    -   * Simplify computations made on shapes.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getShapeOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(shapeOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int REMAPPING_FIELD_NUMBER = 14; - private int remapping_; - /** - *
    -   * Remapping (default is ON)
    -   * Remap subgraphs onto more efficient implementations.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public int getRemappingValue() { - return remapping_; - } - /** - *
    -   * Remapping (default is ON)
    -   * Remap subgraphs onto more efficient implementations.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getRemapping() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(remapping_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int COMMON_SUBGRAPH_ELIMINATION_FIELD_NUMBER = 24; - private int commonSubgraphElimination_; - /** - *
    -   * Common subgraph elimination (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public int getCommonSubgraphEliminationValue() { - return commonSubgraphElimination_; - } - /** - *
    -   * Common subgraph elimination (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getCommonSubgraphElimination() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(commonSubgraphElimination_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int ARITHMETIC_OPTIMIZATION_FIELD_NUMBER = 7; - private int arithmeticOptimization_; - /** - *
    -   * Arithmetic optimizations (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public int getArithmeticOptimizationValue() { - return arithmeticOptimization_; - } - /** - *
    -   * Arithmetic optimizations (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getArithmeticOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(arithmeticOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int DEPENDENCY_OPTIMIZATION_FIELD_NUMBER = 8; - private int dependencyOptimization_; - /** - *
    -   * Control dependency optimizations (default is ON).
    -   * Remove redundant control dependencies, which may enable other optimization.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public int getDependencyOptimizationValue() { - return dependencyOptimization_; - } - /** - *
    -   * Control dependency optimizations (default is ON).
    -   * Remove redundant control dependencies, which may enable other optimization.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getDependencyOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(dependencyOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int LOOP_OPTIMIZATION_FIELD_NUMBER = 9; - private int loopOptimization_; - /** - *
    -   * Loop optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public int getLoopOptimizationValue() { - return loopOptimization_; - } - /** - *
    -   * Loop optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getLoopOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(loopOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int FUNCTION_OPTIMIZATION_FIELD_NUMBER = 10; - private int functionOptimization_; - /** - *
    -   * Function optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public int getFunctionOptimizationValue() { - return functionOptimization_; - } - /** - *
    -   * Function optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getFunctionOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(functionOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int DEBUG_STRIPPER_FIELD_NUMBER = 11; - private int debugStripper_; - /** - *
    -   * Strips debug-related nodes from the graph (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public int getDebugStripperValue() { - return debugStripper_; - } - /** - *
    -   * Strips debug-related nodes from the graph (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getDebugStripper() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(debugStripper_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int DISABLE_MODEL_PRUNING_FIELD_NUMBER = 2; - private boolean disableModelPruning_; - /** - *
    -   * If true, don't remove unnecessary ops from the graph
    -   * 
    - * - * bool disable_model_pruning = 2; - */ - public boolean getDisableModelPruning() { - return disableModelPruning_; - } - - public static final int SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER = 15; - private int scopedAllocatorOptimization_; - /** - *
    -   * Try to allocate some independent Op outputs contiguously in order to
    -   * merge or eliminate downstream Ops (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public int getScopedAllocatorOptimizationValue() { - return scopedAllocatorOptimization_; - } - /** - *
    -   * Try to allocate some independent Op outputs contiguously in order to
    -   * merge or eliminate downstream Ops (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getScopedAllocatorOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(scopedAllocatorOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER = 18; - private int pinToHostOptimization_; - /** - *
    -   * Force small ops onto the CPU (default is OFF).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public int getPinToHostOptimizationValue() { - return pinToHostOptimization_; - } - /** - *
    -   * Force small ops onto the CPU (default is OFF).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getPinToHostOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(pinToHostOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int IMPLEMENTATION_SELECTOR_FIELD_NUMBER = 22; - private int implementationSelector_; - /** - *
    -   * Enable the swap of kernel implementations based on the device placement
    -   * (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public int getImplementationSelectorValue() { - return implementationSelector_; - } - /** - *
    -   * Enable the swap of kernel implementations based on the device placement
    -   * (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getImplementationSelector() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(implementationSelector_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int AUTO_MIXED_PRECISION_FIELD_NUMBER = 23; - private int autoMixedPrecision_; - /** - *
    -   * Optimize data types for CUDA (default is OFF).
    -   * This will try to use float16 on GPU which is faster.
    -   * Note that this can change the numerical stability of the graph and may
    -   * require the use of loss scaling to maintain model convergence.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public int getAutoMixedPrecisionValue() { - return autoMixedPrecision_; - } - /** - *
    -   * Optimize data types for CUDA (default is OFF).
    -   * This will try to use float16 on GPU which is faster.
    -   * Note that this can change the numerical stability of the graph and may
    -   * require the use of loss scaling to maintain model convergence.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecision() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(autoMixedPrecision_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int AUTO_MIXED_PRECISION_MKL_FIELD_NUMBER = 25; - private int autoMixedPrecisionMkl_; - /** - *
    -   * Optimize data types for MKL (default is OFF).
    -   * This will try to use bfloat16 on CPUs, which is faster.
    -   * Note that this can change the numerical stability of the graph.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public int getAutoMixedPrecisionMklValue() { - return autoMixedPrecisionMkl_; - } - /** - *
    -   * Optimize data types for MKL (default is OFF).
    -   * This will try to use bfloat16 on CPUs, which is faster.
    -   * Note that this can change the numerical stability of the graph.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecisionMkl() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(autoMixedPrecisionMkl_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int DISABLE_META_OPTIMIZER_FIELD_NUMBER = 19; - private boolean disableMetaOptimizer_; - /** - *
    -   * Disable the entire meta optimizer (off by default).
    -   * 
    - * - * bool disable_meta_optimizer = 19; - */ - public boolean getDisableMetaOptimizer() { - return disableMetaOptimizer_; - } - - public static final int USE_PLUGIN_OPTIMIZERS_FIELD_NUMBER = 28; - private int usePluginOptimizers_; - /** - *
    -   * Optimizers registered by plugin (default is ON)
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public int getUsePluginOptimizersValue() { - return usePluginOptimizers_; - } - /** - *
    -   * Optimizers registered by plugin (default is ON)
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getUsePluginOptimizers() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(usePluginOptimizers_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - - public static final int META_OPTIMIZER_ITERATIONS_FIELD_NUMBER = 12; - private int metaOptimizerIterations_; - /** - *
    -   * Controls how many times we run the optimizers in meta optimizer (default
    -   * is once).
    -   * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public int getMetaOptimizerIterationsValue() { - return metaOptimizerIterations_; - } - /** - *
    -   * Controls how many times we run the optimizers in meta optimizer (default
    -   * is once).
    -   * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public org.tensorflow.proto.framework.RewriterConfig.NumIterationsType getMetaOptimizerIterations() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.NumIterationsType result = org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.valueOf(metaOptimizerIterations_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.UNRECOGNIZED : result; - } - - public static final int MIN_GRAPH_NODES_FIELD_NUMBER = 17; - private int minGraphNodes_; - /** - *
    -   * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    -   * optimization is skipped.
    -   * 0 means the system picks an appropriate number.
    -   * < 0 means do not skip optimization.
    -   * 
    - * - * int32 min_graph_nodes = 17; - */ - 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 EXPERIMENTAL_DISABLE_FOLDING_QUANTIZATION_EMULATION_FIELD_NUMBER = 27; - private boolean experimentalDisableFoldingQuantizationEmulation_; - /** - *
    -   * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    -   * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    -   * have to extract quantization configs (e.g. min/max range, number of bits,
    -   * and per-channel) from the quantization emulation ops. Note that this flag
    -   * is experimental and may be removed in the future. See b/174138564 for more
    -   * details.
    -   * 
    - * - * bool experimental_disable_folding_quantization_emulation = 27; - */ - public boolean getExperimentalDisableFoldingQuantizationEmulation() { - return experimentalDisableFoldingQuantizationEmulation_; - } - - public static final int MEMORY_OPTIMIZATION_FIELD_NUMBER = 4; - private int memoryOptimization_; - /** - *
    -   * Configures memory optimization passes through the meta-optimizer. Has no
    -   * effect on manually requested memory optimization passes in the optimizers
    -   * field.
    -   * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public int getMemoryOptimizationValue() { - return memoryOptimization_; - } - /** - *
    -   * Configures memory optimization passes through the meta-optimizer. Has no
    -   * effect on manually requested memory optimization passes in the optimizers
    -   * field.
    -   * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public org.tensorflow.proto.framework.RewriterConfig.MemOptType getMemoryOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.MemOptType result = org.tensorflow.proto.framework.RewriterConfig.MemOptType.valueOf(memoryOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.MemOptType.UNRECOGNIZED : result; - } - - public static final int MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER = 6; - private volatile java.lang.Object memoryOptimizerTargetNodeNameScope_; - /** - *
    -   * A node name scope for node names which are valid outputs of recomputations.
    -   * Inputs to nodes that match this scope may be recomputed (subject either to
    -   * manual annotation of those input nodes or to manual annotation and
    -   * heuristics depending on memory_optimization), but the nodes themselves will
    -   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -   * can appear not just as a top-level scope. For example, if the value is
    -   * "gradients/", the default, it will match node name "gradients/foo",
    -   * "foo/gradients/bar", but not "foo_gradients/"
    -   * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public java.lang.String getMemoryOptimizerTargetNodeNameScope() { - java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; - 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(); - memoryOptimizerTargetNodeNameScope_ = s; - return s; - } - } - /** - *
    -   * A node name scope for node names which are valid outputs of recomputations.
    -   * Inputs to nodes that match this scope may be recomputed (subject either to
    -   * manual annotation of those input nodes or to manual annotation and
    -   * heuristics depending on memory_optimization), but the nodes themselves will
    -   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -   * can appear not just as a top-level scope. For example, if the value is
    -   * "gradients/", the default, it will match node name "gradients/foo",
    -   * "foo/gradients/bar", but not "foo_gradients/"
    -   * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public com.google.protobuf.ByteString - getMemoryOptimizerTargetNodeNameScopeBytes() { - java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - memoryOptimizerTargetNodeNameScope_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int META_OPTIMIZER_TIMEOUT_MS_FIELD_NUMBER = 20; - private long metaOptimizerTimeoutMs_; - /** - *
    -   * Maximum number of milliseconds to spend optimizing a single graph before
    -   * timing out. If less than or equal to 0 (default value) the optimizer will
    -   * never time out.
    -   * 
    - * - * int64 meta_optimizer_timeout_ms = 20; - */ - public long getMetaOptimizerTimeoutMs() { - return metaOptimizerTimeoutMs_; - } - - public static final int AUTO_PARALLEL_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.AutoParallelOptions autoParallel_; - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public boolean hasAutoParallel() { - return autoParallel_ != null; - } - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public org.tensorflow.proto.framework.AutoParallelOptions getAutoParallel() { - return autoParallel_ == null ? org.tensorflow.proto.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_; - } - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() { - return getAutoParallel(); - } - - public static final int FAIL_ON_OPTIMIZER_ERRORS_FIELD_NUMBER = 21; - private boolean failOnOptimizerErrors_; - /** - *
    -   * If true, any optimization pass failing will cause the MetaOptimizer to
    -   * stop with an error. By default - or when set to false, failing passes are
    -   * skipped silently.
    -   * 
    - * - * bool fail_on_optimizer_errors = 21; - */ - public boolean getFailOnOptimizerErrors() { - return failOnOptimizerErrors_; - } - - public static final int SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER = 16; - private org.tensorflow.proto.framework.ScopedAllocatorOptions scopedAllocatorOpts_; - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public boolean hasScopedAllocatorOpts() { - return scopedAllocatorOpts_ != null; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public org.tensorflow.proto.framework.ScopedAllocatorOptions getScopedAllocatorOpts() { - return scopedAllocatorOpts_ == null ? org.tensorflow.proto.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() { - return getScopedAllocatorOpts(); - } - - public static final int OPTIMIZERS_FIELD_NUMBER = 100; - private com.google.protobuf.LazyStringList optimizers_; - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - public com.google.protobuf.ProtocolStringList - getOptimizersList() { - return optimizers_; - } - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - public int getOptimizersCount() { - return optimizers_.size(); - } - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - public java.lang.String getOptimizers(int index) { - return optimizers_.get(index); - } - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - public com.google.protobuf.ByteString - getOptimizersBytes(int index) { - return optimizers_.getByteString(index); - } - - public static final int CUSTOM_OPTIMIZERS_FIELD_NUMBER = 200; - private java.util.List customOptimizers_; - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public java.util.List getCustomOptimizersList() { - return customOptimizers_; - } - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public java.util.List - getCustomOptimizersOrBuilderList() { - return customOptimizers_; - } - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public int getCustomOptimizersCount() { - return customOptimizers_.size(); - } - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) { - return customOptimizers_.get(index); - } - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( - int index) { - return customOptimizers_.get(index); - } - - public static final int INTER_OPTIMIZER_VERIFIER_CONFIG_FIELD_NUMBER = 300; - private org.tensorflow.proto.framework.VerifierConfig interOptimizerVerifierConfig_; - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public boolean hasInterOptimizerVerifierConfig() { - return interOptimizerVerifierConfig_ != null; - } - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public org.tensorflow.proto.framework.VerifierConfig getInterOptimizerVerifierConfig() { - return interOptimizerVerifierConfig_ == null ? org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; - } - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public org.tensorflow.proto.framework.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder() { - return getInterOptimizerVerifierConfig(); - } - - public static final int POST_OPTIMIZATION_VERIFIER_CONFIG_FIELD_NUMBER = 301; - private org.tensorflow.proto.framework.VerifierConfig postOptimizationVerifierConfig_; - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public boolean hasPostOptimizationVerifierConfig() { - return postOptimizationVerifierConfig_ != null; - } - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public org.tensorflow.proto.framework.VerifierConfig getPostOptimizationVerifierConfig() { - return postOptimizationVerifierConfig_ == null ? org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; - } - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public org.tensorflow.proto.framework.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder() { - return getPostOptimizationVerifierConfig(); - } - - 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 (layoutOptimizer_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(1, layoutOptimizer_); - } - if (disableModelPruning_ != false) { - output.writeBool(2, disableModelPruning_); - } - if (constantFolding_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(3, constantFolding_); - } - if (memoryOptimization_ != org.tensorflow.proto.framework.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) { - output.writeEnum(4, memoryOptimization_); - } - if (autoParallel_ != null) { - output.writeMessage(5, getAutoParallel()); - } - if (!getMemoryOptimizerTargetNodeNameScopeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, memoryOptimizerTargetNodeNameScope_); - } - if (arithmeticOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(7, arithmeticOptimization_); - } - if (dependencyOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(8, dependencyOptimization_); - } - if (loopOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(9, loopOptimization_); - } - if (functionOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(10, functionOptimization_); - } - if (debugStripper_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(11, debugStripper_); - } - if (metaOptimizerIterations_ != org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) { - output.writeEnum(12, metaOptimizerIterations_); - } - if (shapeOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(13, shapeOptimization_); - } - if (remapping_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(14, remapping_); - } - if (scopedAllocatorOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(15, scopedAllocatorOptimization_); - } - if (scopedAllocatorOpts_ != null) { - output.writeMessage(16, getScopedAllocatorOpts()); - } - if (minGraphNodes_ != 0) { - output.writeInt32(17, minGraphNodes_); - } - if (pinToHostOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(18, pinToHostOptimization_); - } - if (disableMetaOptimizer_ != false) { - output.writeBool(19, disableMetaOptimizer_); - } - if (metaOptimizerTimeoutMs_ != 0L) { - output.writeInt64(20, metaOptimizerTimeoutMs_); - } - if (failOnOptimizerErrors_ != false) { - output.writeBool(21, failOnOptimizerErrors_); - } - if (implementationSelector_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(22, implementationSelector_); - } - if (autoMixedPrecision_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(23, autoMixedPrecision_); - } - if (commonSubgraphElimination_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(24, commonSubgraphElimination_); - } - if (autoMixedPrecisionMkl_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(25, autoMixedPrecisionMkl_); - } - if (experimentalDisableCompressedTensorOptimization_ != false) { - output.writeBool(26, experimentalDisableCompressedTensorOptimization_); - } - if (experimentalDisableFoldingQuantizationEmulation_ != false) { - output.writeBool(27, experimentalDisableFoldingQuantizationEmulation_); - } - if (usePluginOptimizers_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(28, usePluginOptimizers_); - } - 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)); - } - for (int i = 0; i < customOptimizers_.size(); i++) { - output.writeMessage(200, customOptimizers_.get(i)); - } - if (interOptimizerVerifierConfig_ != null) { - output.writeMessage(300, getInterOptimizerVerifierConfig()); - } - if (postOptimizationVerifierConfig_ != null) { - output.writeMessage(301, getPostOptimizationVerifierConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (layoutOptimizer_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, layoutOptimizer_); - } - if (disableModelPruning_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, disableModelPruning_); - } - if (constantFolding_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, constantFolding_); - } - if (memoryOptimization_ != org.tensorflow.proto.framework.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, memoryOptimization_); - } - if (autoParallel_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getAutoParallel()); - } - if (!getMemoryOptimizerTargetNodeNameScopeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, memoryOptimizerTargetNodeNameScope_); - } - if (arithmeticOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, arithmeticOptimization_); - } - if (dependencyOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(8, dependencyOptimization_); - } - if (loopOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(9, loopOptimization_); - } - if (functionOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(10, functionOptimization_); - } - if (debugStripper_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, debugStripper_); - } - if (metaOptimizerIterations_ != org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(12, metaOptimizerIterations_); - } - if (shapeOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(13, shapeOptimization_); - } - if (remapping_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(14, remapping_); - } - if (scopedAllocatorOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(15, scopedAllocatorOptimization_); - } - if (scopedAllocatorOpts_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, getScopedAllocatorOpts()); - } - if (minGraphNodes_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(17, minGraphNodes_); - } - if (pinToHostOptimization_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(18, pinToHostOptimization_); - } - if (disableMetaOptimizer_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(19, disableMetaOptimizer_); - } - if (metaOptimizerTimeoutMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(20, metaOptimizerTimeoutMs_); - } - if (failOnOptimizerErrors_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(21, failOnOptimizerErrors_); - } - if (implementationSelector_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(22, implementationSelector_); - } - if (autoMixedPrecision_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(23, autoMixedPrecision_); - } - if (commonSubgraphElimination_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(24, commonSubgraphElimination_); - } - if (autoMixedPrecisionMkl_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(25, autoMixedPrecisionMkl_); - } - if (experimentalDisableCompressedTensorOptimization_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(26, experimentalDisableCompressedTensorOptimization_); - } - if (experimentalDisableFoldingQuantizationEmulation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(27, experimentalDisableFoldingQuantizationEmulation_); - } - if (usePluginOptimizers_ != org.tensorflow.proto.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(28, usePluginOptimizers_); - } - 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++) { - dataSize += computeStringSizeNoTag(optimizers_.getRaw(i)); - } - size += dataSize; - size += 2 * getOptimizersList().size(); - } - for (int i = 0; i < customOptimizers_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(200, customOptimizers_.get(i)); - } - if (interOptimizerVerifierConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(300, getInterOptimizerVerifierConfig()); - } - if (postOptimizationVerifierConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(301, getPostOptimizationVerifierConfig()); - } - 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.RewriterConfig)) { - return super.equals(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; - if (remapping_ != other.remapping_) return false; - if (commonSubgraphElimination_ != other.commonSubgraphElimination_) return false; - if (arithmeticOptimization_ != other.arithmeticOptimization_) return false; - if (dependencyOptimization_ != other.dependencyOptimization_) return false; - if (loopOptimization_ != other.loopOptimization_) return false; - if (functionOptimization_ != other.functionOptimization_) return false; - if (debugStripper_ != other.debugStripper_) return false; - if (getDisableModelPruning() - != other.getDisableModelPruning()) return false; - if (scopedAllocatorOptimization_ != other.scopedAllocatorOptimization_) return false; - if (pinToHostOptimization_ != other.pinToHostOptimization_) return false; - if (implementationSelector_ != other.implementationSelector_) return false; - if (autoMixedPrecision_ != other.autoMixedPrecision_) return false; - if (autoMixedPrecisionMkl_ != other.autoMixedPrecisionMkl_) return false; - if (getDisableMetaOptimizer() - != other.getDisableMetaOptimizer()) return false; - if (usePluginOptimizers_ != other.usePluginOptimizers_) return false; - if (metaOptimizerIterations_ != other.metaOptimizerIterations_) return false; - if (getMinGraphNodes() - != other.getMinGraphNodes()) return false; - if (getExperimentalDisableCompressedTensorOptimization() - != other.getExperimentalDisableCompressedTensorOptimization()) return false; - if (getExperimentalDisableFoldingQuantizationEmulation() - != other.getExperimentalDisableFoldingQuantizationEmulation()) return false; - if (memoryOptimization_ != other.memoryOptimization_) return false; - if (!getMemoryOptimizerTargetNodeNameScope() - .equals(other.getMemoryOptimizerTargetNodeNameScope())) return false; - if (getMetaOptimizerTimeoutMs() - != other.getMetaOptimizerTimeoutMs()) return false; - if (hasAutoParallel() != other.hasAutoParallel()) return false; - if (hasAutoParallel()) { - if (!getAutoParallel() - .equals(other.getAutoParallel())) return false; - } - if (getFailOnOptimizerErrors() - != other.getFailOnOptimizerErrors()) return false; - if (hasScopedAllocatorOpts() != other.hasScopedAllocatorOpts()) return false; - if (hasScopedAllocatorOpts()) { - if (!getScopedAllocatorOpts() - .equals(other.getScopedAllocatorOpts())) return false; - } - if (!getOptimizersList() - .equals(other.getOptimizersList())) return false; - if (!getCustomOptimizersList() - .equals(other.getCustomOptimizersList())) return false; - if (hasInterOptimizerVerifierConfig() != other.hasInterOptimizerVerifierConfig()) return false; - if (hasInterOptimizerVerifierConfig()) { - if (!getInterOptimizerVerifierConfig() - .equals(other.getInterOptimizerVerifierConfig())) return false; - } - if (hasPostOptimizationVerifierConfig() != other.hasPostOptimizationVerifierConfig()) return false; - if (hasPostOptimizationVerifierConfig()) { - if (!getPostOptimizationVerifierConfig() - .equals(other.getPostOptimizationVerifierConfig())) 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) + 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; - hash = (53 * hash) + constantFolding_; - hash = (37 * hash) + SHAPE_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + shapeOptimization_; - hash = (37 * hash) + REMAPPING_FIELD_NUMBER; - hash = (53 * hash) + remapping_; - hash = (37 * hash) + COMMON_SUBGRAPH_ELIMINATION_FIELD_NUMBER; - hash = (53 * hash) + commonSubgraphElimination_; - hash = (37 * hash) + ARITHMETIC_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + arithmeticOptimization_; - hash = (37 * hash) + DEPENDENCY_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + dependencyOptimization_; - hash = (37 * hash) + LOOP_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + loopOptimization_; - hash = (37 * hash) + FUNCTION_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + functionOptimization_; - hash = (37 * hash) + DEBUG_STRIPPER_FIELD_NUMBER; - hash = (53 * hash) + debugStripper_; - hash = (37 * hash) + DISABLE_MODEL_PRUNING_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableModelPruning()); - hash = (37 * hash) + SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + scopedAllocatorOptimization_; - hash = (37 * hash) + PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + pinToHostOptimization_; - hash = (37 * hash) + IMPLEMENTATION_SELECTOR_FIELD_NUMBER; - hash = (53 * hash) + implementationSelector_; - hash = (37 * hash) + AUTO_MIXED_PRECISION_FIELD_NUMBER; - hash = (53 * hash) + autoMixedPrecision_; - hash = (37 * hash) + AUTO_MIXED_PRECISION_MKL_FIELD_NUMBER; - hash = (53 * hash) + autoMixedPrecisionMkl_; - hash = (37 * hash) + DISABLE_META_OPTIMIZER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDisableMetaOptimizer()); - hash = (37 * hash) + USE_PLUGIN_OPTIMIZERS_FIELD_NUMBER; - hash = (53 * hash) + usePluginOptimizers_; - hash = (37 * hash) + META_OPTIMIZER_ITERATIONS_FIELD_NUMBER; - 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) + EXPERIMENTAL_DISABLE_FOLDING_QUANTIZATION_EMULATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getExperimentalDisableFoldingQuantizationEmulation()); - hash = (37 * hash) + MEMORY_OPTIMIZATION_FIELD_NUMBER; - hash = (53 * hash) + memoryOptimization_; - hash = (37 * hash) + MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER; - hash = (53 * hash) + getMemoryOptimizerTargetNodeNameScope().hashCode(); - hash = (37 * hash) + META_OPTIMIZER_TIMEOUT_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMetaOptimizerTimeoutMs()); - if (hasAutoParallel()) { - hash = (37 * hash) + AUTO_PARALLEL_FIELD_NUMBER; - hash = (53 * hash) + getAutoParallel().hashCode(); - } - hash = (37 * hash) + FAIL_ON_OPTIMIZER_ERRORS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFailOnOptimizerErrors()); - if (hasScopedAllocatorOpts()) { - hash = (37 * hash) + SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER; - hash = (53 * hash) + getScopedAllocatorOpts().hashCode(); - } - if (getOptimizersCount() > 0) { - hash = (37 * hash) + OPTIMIZERS_FIELD_NUMBER; - hash = (53 * hash) + getOptimizersList().hashCode(); - } - if (getCustomOptimizersCount() > 0) { - hash = (37 * hash) + CUSTOM_OPTIMIZERS_FIELD_NUMBER; - hash = (53 * hash) + getCustomOptimizersList().hashCode(); - } - if (hasInterOptimizerVerifierConfig()) { - hash = (37 * hash) + INTER_OPTIMIZER_VERIFIER_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getInterOptimizerVerifierConfig().hashCode(); - } - if (hasPostOptimizationVerifierConfig()) { - hash = (37 * hash) + POST_OPTIMIZATION_VERIFIER_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getPostOptimizationVerifierConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RewriterConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig 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.RewriterConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig 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.RewriterConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RewriterConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RewriterConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig 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.RewriterConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig 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.RewriterConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RewriterConfig 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.RewriterConfig 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; - } - /** - *
    -   * Graph rewriting is experimental and subject to change, not covered by any
    -   * API stability guarantees.
    -   * 
    - * - * Protobuf type {@code tensorflow.RewriterConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig) - org.tensorflow.proto.framework.RewriterConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RewriterConfig.class, org.tensorflow.proto.framework.RewriterConfig.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RewriterConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getCustomOptimizersFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - cpuLayoutConversion_ = 0; - - layoutOptimizer_ = 0; - - constantFolding_ = 0; - - shapeOptimization_ = 0; - - remapping_ = 0; - - commonSubgraphElimination_ = 0; - - arithmeticOptimization_ = 0; - - dependencyOptimization_ = 0; - - loopOptimization_ = 0; - - functionOptimization_ = 0; - - debugStripper_ = 0; - - disableModelPruning_ = false; - - scopedAllocatorOptimization_ = 0; - - pinToHostOptimization_ = 0; - - implementationSelector_ = 0; - - autoMixedPrecision_ = 0; - - autoMixedPrecisionMkl_ = 0; - - disableMetaOptimizer_ = false; - - usePluginOptimizers_ = 0; - - metaOptimizerIterations_ = 0; - - minGraphNodes_ = 0; - - experimentalDisableCompressedTensorOptimization_ = false; - - experimentalDisableFoldingQuantizationEmulation_ = false; - - memoryOptimization_ = 0; - - memoryOptimizerTargetNodeNameScope_ = ""; - - metaOptimizerTimeoutMs_ = 0L; - - if (autoParallelBuilder_ == null) { - autoParallel_ = null; - } else { - autoParallel_ = null; - autoParallelBuilder_ = null; - } - failOnOptimizerErrors_ = false; - - if (scopedAllocatorOptsBuilder_ == null) { - scopedAllocatorOpts_ = null; - } else { - scopedAllocatorOpts_ = null; - scopedAllocatorOptsBuilder_ = null; - } - optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - if (customOptimizersBuilder_ == null) { - customOptimizers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - customOptimizersBuilder_.clear(); - } - if (interOptimizerVerifierConfigBuilder_ == null) { - interOptimizerVerifierConfig_ = null; - } else { - interOptimizerVerifierConfig_ = null; - interOptimizerVerifierConfigBuilder_ = null; - } - if (postOptimizationVerifierConfigBuilder_ == null) { - postOptimizationVerifierConfig_ = null; - } else { - postOptimizationVerifierConfig_ = null; - postOptimizationVerifierConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RewriterConfig getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RewriterConfig build() { - org.tensorflow.proto.framework.RewriterConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - 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_; - result.remapping_ = remapping_; - result.commonSubgraphElimination_ = commonSubgraphElimination_; - result.arithmeticOptimization_ = arithmeticOptimization_; - result.dependencyOptimization_ = dependencyOptimization_; - result.loopOptimization_ = loopOptimization_; - result.functionOptimization_ = functionOptimization_; - result.debugStripper_ = debugStripper_; - result.disableModelPruning_ = disableModelPruning_; - result.scopedAllocatorOptimization_ = scopedAllocatorOptimization_; - result.pinToHostOptimization_ = pinToHostOptimization_; - result.implementationSelector_ = implementationSelector_; - result.autoMixedPrecision_ = autoMixedPrecision_; - result.autoMixedPrecisionMkl_ = autoMixedPrecisionMkl_; - result.disableMetaOptimizer_ = disableMetaOptimizer_; - result.usePluginOptimizers_ = usePluginOptimizers_; - result.metaOptimizerIterations_ = metaOptimizerIterations_; - result.minGraphNodes_ = minGraphNodes_; - result.experimentalDisableCompressedTensorOptimization_ = experimentalDisableCompressedTensorOptimization_; - result.experimentalDisableFoldingQuantizationEmulation_ = experimentalDisableFoldingQuantizationEmulation_; - result.memoryOptimization_ = memoryOptimization_; - result.memoryOptimizerTargetNodeNameScope_ = memoryOptimizerTargetNodeNameScope_; - result.metaOptimizerTimeoutMs_ = metaOptimizerTimeoutMs_; - if (autoParallelBuilder_ == null) { - result.autoParallel_ = autoParallel_; - } else { - result.autoParallel_ = autoParallelBuilder_.build(); - } - result.failOnOptimizerErrors_ = failOnOptimizerErrors_; - if (scopedAllocatorOptsBuilder_ == null) { - result.scopedAllocatorOpts_ = scopedAllocatorOpts_; - } else { - result.scopedAllocatorOpts_ = scopedAllocatorOptsBuilder_.build(); - } - if (((bitField0_ & 0x00000001) != 0)) { - optimizers_ = optimizers_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.optimizers_ = optimizers_; - if (customOptimizersBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - customOptimizers_ = java.util.Collections.unmodifiableList(customOptimizers_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.customOptimizers_ = customOptimizers_; - } else { - result.customOptimizers_ = customOptimizersBuilder_.build(); - } - if (interOptimizerVerifierConfigBuilder_ == null) { - result.interOptimizerVerifierConfig_ = interOptimizerVerifierConfig_; - } else { - result.interOptimizerVerifierConfig_ = interOptimizerVerifierConfigBuilder_.build(); - } - if (postOptimizationVerifierConfigBuilder_ == null) { - result.postOptimizationVerifierConfig_ = postOptimizationVerifierConfig_; - } else { - result.postOptimizationVerifierConfig_ = postOptimizationVerifierConfigBuilder_.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.RewriterConfig) { - return mergeFrom((org.tensorflow.proto.framework.RewriterConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - 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()); - } - if (other.constantFolding_ != 0) { - setConstantFoldingValue(other.getConstantFoldingValue()); - } - if (other.shapeOptimization_ != 0) { - setShapeOptimizationValue(other.getShapeOptimizationValue()); - } - if (other.remapping_ != 0) { - setRemappingValue(other.getRemappingValue()); - } - if (other.commonSubgraphElimination_ != 0) { - setCommonSubgraphEliminationValue(other.getCommonSubgraphEliminationValue()); - } - if (other.arithmeticOptimization_ != 0) { - setArithmeticOptimizationValue(other.getArithmeticOptimizationValue()); - } - if (other.dependencyOptimization_ != 0) { - setDependencyOptimizationValue(other.getDependencyOptimizationValue()); - } - if (other.loopOptimization_ != 0) { - setLoopOptimizationValue(other.getLoopOptimizationValue()); - } - if (other.functionOptimization_ != 0) { - setFunctionOptimizationValue(other.getFunctionOptimizationValue()); - } - if (other.debugStripper_ != 0) { - setDebugStripperValue(other.getDebugStripperValue()); - } - if (other.getDisableModelPruning() != false) { - setDisableModelPruning(other.getDisableModelPruning()); - } - if (other.scopedAllocatorOptimization_ != 0) { - setScopedAllocatorOptimizationValue(other.getScopedAllocatorOptimizationValue()); - } - if (other.pinToHostOptimization_ != 0) { - setPinToHostOptimizationValue(other.getPinToHostOptimizationValue()); - } - if (other.implementationSelector_ != 0) { - setImplementationSelectorValue(other.getImplementationSelectorValue()); - } - if (other.autoMixedPrecision_ != 0) { - setAutoMixedPrecisionValue(other.getAutoMixedPrecisionValue()); - } - if (other.autoMixedPrecisionMkl_ != 0) { - setAutoMixedPrecisionMklValue(other.getAutoMixedPrecisionMklValue()); - } - if (other.getDisableMetaOptimizer() != false) { - setDisableMetaOptimizer(other.getDisableMetaOptimizer()); - } - if (other.usePluginOptimizers_ != 0) { - setUsePluginOptimizersValue(other.getUsePluginOptimizersValue()); - } - if (other.metaOptimizerIterations_ != 0) { - setMetaOptimizerIterationsValue(other.getMetaOptimizerIterationsValue()); - } - if (other.getMinGraphNodes() != 0) { - setMinGraphNodes(other.getMinGraphNodes()); - } - if (other.getExperimentalDisableCompressedTensorOptimization() != false) { - setExperimentalDisableCompressedTensorOptimization(other.getExperimentalDisableCompressedTensorOptimization()); - } - if (other.getExperimentalDisableFoldingQuantizationEmulation() != false) { - setExperimentalDisableFoldingQuantizationEmulation(other.getExperimentalDisableFoldingQuantizationEmulation()); - } - if (other.memoryOptimization_ != 0) { - setMemoryOptimizationValue(other.getMemoryOptimizationValue()); - } - if (!other.getMemoryOptimizerTargetNodeNameScope().isEmpty()) { - memoryOptimizerTargetNodeNameScope_ = other.memoryOptimizerTargetNodeNameScope_; - onChanged(); - } - if (other.getMetaOptimizerTimeoutMs() != 0L) { - setMetaOptimizerTimeoutMs(other.getMetaOptimizerTimeoutMs()); - } - if (other.hasAutoParallel()) { - mergeAutoParallel(other.getAutoParallel()); - } - if (other.getFailOnOptimizerErrors() != false) { - setFailOnOptimizerErrors(other.getFailOnOptimizerErrors()); - } - if (other.hasScopedAllocatorOpts()) { - mergeScopedAllocatorOpts(other.getScopedAllocatorOpts()); - } - if (!other.optimizers_.isEmpty()) { - if (optimizers_.isEmpty()) { - optimizers_ = other.optimizers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOptimizersIsMutable(); - optimizers_.addAll(other.optimizers_); - } - onChanged(); - } - if (customOptimizersBuilder_ == null) { - if (!other.customOptimizers_.isEmpty()) { - if (customOptimizers_.isEmpty()) { - customOptimizers_ = other.customOptimizers_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureCustomOptimizersIsMutable(); - customOptimizers_.addAll(other.customOptimizers_); - } - onChanged(); - } - } else { - if (!other.customOptimizers_.isEmpty()) { - if (customOptimizersBuilder_.isEmpty()) { - customOptimizersBuilder_.dispose(); - customOptimizersBuilder_ = null; - customOptimizers_ = other.customOptimizers_; - bitField0_ = (bitField0_ & ~0x00000002); - customOptimizersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCustomOptimizersFieldBuilder() : null; - } else { - customOptimizersBuilder_.addAllMessages(other.customOptimizers_); - } - } - } - if (other.hasInterOptimizerVerifierConfig()) { - mergeInterOptimizerVerifierConfig(other.getInterOptimizerVerifierConfig()); - } - if (other.hasPostOptimizationVerifierConfig()) { - mergePostOptimizationVerifierConfig(other.getPostOptimizationVerifierConfig()); - } - 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.RewriterConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RewriterConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - 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; - /** - *
    -     * Optimize tensor layouts (default is ON)
    -     * e.g. This will try to use NCHW layout on GPU which is faster.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public int getLayoutOptimizerValue() { - return layoutOptimizer_; - } - /** - *
    -     * Optimize tensor layouts (default is ON)
    -     * e.g. This will try to use NCHW layout on GPU which is faster.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public Builder setLayoutOptimizerValue(int value) { - layoutOptimizer_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optimize tensor layouts (default is ON)
    -     * e.g. This will try to use NCHW layout on GPU which is faster.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getLayoutOptimizer() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(layoutOptimizer_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Optimize tensor layouts (default is ON)
    -     * e.g. This will try to use NCHW layout on GPU which is faster.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public Builder setLayoutOptimizer(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - layoutOptimizer_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Optimize tensor layouts (default is ON)
    -     * e.g. This will try to use NCHW layout on GPU which is faster.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - public Builder clearLayoutOptimizer() { - - layoutOptimizer_ = 0; - onChanged(); - return this; - } - - private int constantFolding_ = 0; - /** - *
    -     * Fold constants (default is ON)
    -     * Statically infer the value of tensors when possible, and materialize the
    -     * result using constants.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public int getConstantFoldingValue() { - return constantFolding_; - } - /** - *
    -     * Fold constants (default is ON)
    -     * Statically infer the value of tensors when possible, and materialize the
    -     * result using constants.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public Builder setConstantFoldingValue(int value) { - constantFolding_ = value; - onChanged(); - return this; - } - /** - *
    -     * Fold constants (default is ON)
    -     * Statically infer the value of tensors when possible, and materialize the
    -     * result using constants.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getConstantFolding() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(constantFolding_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Fold constants (default is ON)
    -     * Statically infer the value of tensors when possible, and materialize the
    -     * result using constants.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public Builder setConstantFolding(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - constantFolding_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Fold constants (default is ON)
    -     * Statically infer the value of tensors when possible, and materialize the
    -     * result using constants.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - public Builder clearConstantFolding() { - - constantFolding_ = 0; - onChanged(); - return this; - } - - private int shapeOptimization_ = 0; - /** - *
    -     * Shape optimizations (default is ON)
    -     * Simplify computations made on shapes.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public int getShapeOptimizationValue() { - return shapeOptimization_; - } - /** - *
    -     * Shape optimizations (default is ON)
    -     * Simplify computations made on shapes.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public Builder setShapeOptimizationValue(int value) { - shapeOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Shape optimizations (default is ON)
    -     * Simplify computations made on shapes.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getShapeOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(shapeOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Shape optimizations (default is ON)
    -     * Simplify computations made on shapes.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public Builder setShapeOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - shapeOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Shape optimizations (default is ON)
    -     * Simplify computations made on shapes.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - public Builder clearShapeOptimization() { - - shapeOptimization_ = 0; - onChanged(); - return this; - } - - private int remapping_ = 0; - /** - *
    -     * Remapping (default is ON)
    -     * Remap subgraphs onto more efficient implementations.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public int getRemappingValue() { - return remapping_; - } - /** - *
    -     * Remapping (default is ON)
    -     * Remap subgraphs onto more efficient implementations.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public Builder setRemappingValue(int value) { - remapping_ = value; - onChanged(); - return this; - } - /** - *
    -     * Remapping (default is ON)
    -     * Remap subgraphs onto more efficient implementations.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getRemapping() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(remapping_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Remapping (default is ON)
    -     * Remap subgraphs onto more efficient implementations.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public Builder setRemapping(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - remapping_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Remapping (default is ON)
    -     * Remap subgraphs onto more efficient implementations.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - public Builder clearRemapping() { - - remapping_ = 0; - onChanged(); - return this; - } - - private int commonSubgraphElimination_ = 0; - /** - *
    -     * Common subgraph elimination (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public int getCommonSubgraphEliminationValue() { - return commonSubgraphElimination_; - } - /** - *
    -     * Common subgraph elimination (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public Builder setCommonSubgraphEliminationValue(int value) { - commonSubgraphElimination_ = value; - onChanged(); - return this; - } - /** - *
    -     * Common subgraph elimination (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getCommonSubgraphElimination() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(commonSubgraphElimination_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Common subgraph elimination (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public Builder setCommonSubgraphElimination(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - commonSubgraphElimination_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Common subgraph elimination (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - public Builder clearCommonSubgraphElimination() { - - commonSubgraphElimination_ = 0; - onChanged(); - return this; - } - - private int arithmeticOptimization_ = 0; - /** - *
    -     * Arithmetic optimizations (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public int getArithmeticOptimizationValue() { - return arithmeticOptimization_; - } - /** - *
    -     * Arithmetic optimizations (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public Builder setArithmeticOptimizationValue(int value) { - arithmeticOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Arithmetic optimizations (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getArithmeticOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(arithmeticOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Arithmetic optimizations (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public Builder setArithmeticOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - arithmeticOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Arithmetic optimizations (default is ON)
    -     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - public Builder clearArithmeticOptimization() { - - arithmeticOptimization_ = 0; - onChanged(); - return this; - } - - private int dependencyOptimization_ = 0; - /** - *
    -     * Control dependency optimizations (default is ON).
    -     * Remove redundant control dependencies, which may enable other optimization.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public int getDependencyOptimizationValue() { - return dependencyOptimization_; - } - /** - *
    -     * Control dependency optimizations (default is ON).
    -     * Remove redundant control dependencies, which may enable other optimization.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public Builder setDependencyOptimizationValue(int value) { - dependencyOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Control dependency optimizations (default is ON).
    -     * Remove redundant control dependencies, which may enable other optimization.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getDependencyOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(dependencyOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Control dependency optimizations (default is ON).
    -     * Remove redundant control dependencies, which may enable other optimization.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public Builder setDependencyOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - dependencyOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Control dependency optimizations (default is ON).
    -     * Remove redundant control dependencies, which may enable other optimization.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - public Builder clearDependencyOptimization() { - - dependencyOptimization_ = 0; - onChanged(); - return this; - } - - private int loopOptimization_ = 0; - /** - *
    -     * Loop optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public int getLoopOptimizationValue() { - return loopOptimization_; - } - /** - *
    -     * Loop optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public Builder setLoopOptimizationValue(int value) { - loopOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Loop optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getLoopOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(loopOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Loop optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public Builder setLoopOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - loopOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Loop optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - public Builder clearLoopOptimization() { - - loopOptimization_ = 0; - onChanged(); - return this; - } - - private int functionOptimization_ = 0; - /** - *
    -     * Function optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public int getFunctionOptimizationValue() { - return functionOptimization_; - } - /** - *
    -     * Function optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public Builder setFunctionOptimizationValue(int value) { - functionOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Function optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getFunctionOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(functionOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Function optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public Builder setFunctionOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - functionOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Function optimizations (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - public Builder clearFunctionOptimization() { - - functionOptimization_ = 0; - onChanged(); - return this; - } - - private int debugStripper_ = 0; - /** - *
    -     * Strips debug-related nodes from the graph (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public int getDebugStripperValue() { - return debugStripper_; - } - /** - *
    -     * Strips debug-related nodes from the graph (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public Builder setDebugStripperValue(int value) { - debugStripper_ = value; - onChanged(); - return this; - } - /** - *
    -     * Strips debug-related nodes from the graph (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getDebugStripper() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(debugStripper_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Strips debug-related nodes from the graph (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public Builder setDebugStripper(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - debugStripper_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Strips debug-related nodes from the graph (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - public Builder clearDebugStripper() { - - debugStripper_ = 0; - onChanged(); - return this; - } - - private boolean disableModelPruning_ ; - /** - *
    -     * If true, don't remove unnecessary ops from the graph
    -     * 
    - * - * bool disable_model_pruning = 2; - */ - public boolean getDisableModelPruning() { - return disableModelPruning_; - } - /** - *
    -     * If true, don't remove unnecessary ops from the graph
    -     * 
    - * - * bool disable_model_pruning = 2; - */ - public Builder setDisableModelPruning(boolean value) { - - disableModelPruning_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, don't remove unnecessary ops from the graph
    -     * 
    - * - * bool disable_model_pruning = 2; - */ - public Builder clearDisableModelPruning() { - - disableModelPruning_ = false; - onChanged(); - return this; - } - - private int scopedAllocatorOptimization_ = 0; - /** - *
    -     * Try to allocate some independent Op outputs contiguously in order to
    -     * merge or eliminate downstream Ops (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public int getScopedAllocatorOptimizationValue() { - return scopedAllocatorOptimization_; - } - /** - *
    -     * Try to allocate some independent Op outputs contiguously in order to
    -     * merge or eliminate downstream Ops (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public Builder setScopedAllocatorOptimizationValue(int value) { - scopedAllocatorOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Try to allocate some independent Op outputs contiguously in order to
    -     * merge or eliminate downstream Ops (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getScopedAllocatorOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(scopedAllocatorOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Try to allocate some independent Op outputs contiguously in order to
    -     * merge or eliminate downstream Ops (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public Builder setScopedAllocatorOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - scopedAllocatorOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Try to allocate some independent Op outputs contiguously in order to
    -     * merge or eliminate downstream Ops (off by default).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - public Builder clearScopedAllocatorOptimization() { - - scopedAllocatorOptimization_ = 0; - onChanged(); - return this; - } - - private int pinToHostOptimization_ = 0; - /** - *
    -     * Force small ops onto the CPU (default is OFF).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public int getPinToHostOptimizationValue() { - return pinToHostOptimization_; - } - /** - *
    -     * Force small ops onto the CPU (default is OFF).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public Builder setPinToHostOptimizationValue(int value) { - pinToHostOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Force small ops onto the CPU (default is OFF).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getPinToHostOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(pinToHostOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Force small ops onto the CPU (default is OFF).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public Builder setPinToHostOptimization(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - pinToHostOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Force small ops onto the CPU (default is OFF).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - public Builder clearPinToHostOptimization() { - - pinToHostOptimization_ = 0; - onChanged(); - return this; - } - - private int implementationSelector_ = 0; - /** - *
    -     * Enable the swap of kernel implementations based on the device placement
    -     * (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public int getImplementationSelectorValue() { - return implementationSelector_; - } - /** - *
    -     * Enable the swap of kernel implementations based on the device placement
    -     * (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public Builder setImplementationSelectorValue(int value) { - implementationSelector_ = value; - onChanged(); - return this; - } - /** - *
    -     * Enable the swap of kernel implementations based on the device placement
    -     * (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getImplementationSelector() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(implementationSelector_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Enable the swap of kernel implementations based on the device placement
    -     * (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public Builder setImplementationSelector(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - implementationSelector_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Enable the swap of kernel implementations based on the device placement
    -     * (default is ON).
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - public Builder clearImplementationSelector() { - - implementationSelector_ = 0; - onChanged(); - return this; - } - - private int autoMixedPrecision_ = 0; - /** - *
    -     * Optimize data types for CUDA (default is OFF).
    -     * This will try to use float16 on GPU which is faster.
    -     * Note that this can change the numerical stability of the graph and may
    -     * require the use of loss scaling to maintain model convergence.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public int getAutoMixedPrecisionValue() { - return autoMixedPrecision_; - } - /** - *
    -     * Optimize data types for CUDA (default is OFF).
    -     * This will try to use float16 on GPU which is faster.
    -     * Note that this can change the numerical stability of the graph and may
    -     * require the use of loss scaling to maintain model convergence.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public Builder setAutoMixedPrecisionValue(int value) { - autoMixedPrecision_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optimize data types for CUDA (default is OFF).
    -     * This will try to use float16 on GPU which is faster.
    -     * Note that this can change the numerical stability of the graph and may
    -     * require the use of loss scaling to maintain model convergence.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecision() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(autoMixedPrecision_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Optimize data types for CUDA (default is OFF).
    -     * This will try to use float16 on GPU which is faster.
    -     * Note that this can change the numerical stability of the graph and may
    -     * require the use of loss scaling to maintain model convergence.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public Builder setAutoMixedPrecision(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - autoMixedPrecision_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Optimize data types for CUDA (default is OFF).
    -     * This will try to use float16 on GPU which is faster.
    -     * Note that this can change the numerical stability of the graph and may
    -     * require the use of loss scaling to maintain model convergence.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - public Builder clearAutoMixedPrecision() { - - autoMixedPrecision_ = 0; - onChanged(); - return this; - } - - private int autoMixedPrecisionMkl_ = 0; - /** - *
    -     * Optimize data types for MKL (default is OFF).
    -     * This will try to use bfloat16 on CPUs, which is faster.
    -     * Note that this can change the numerical stability of the graph.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public int getAutoMixedPrecisionMklValue() { - return autoMixedPrecisionMkl_; - } - /** - *
    -     * Optimize data types for MKL (default is OFF).
    -     * This will try to use bfloat16 on CPUs, which is faster.
    -     * Note that this can change the numerical stability of the graph.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public Builder setAutoMixedPrecisionMklValue(int value) { - autoMixedPrecisionMkl_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optimize data types for MKL (default is OFF).
    -     * This will try to use bfloat16 on CPUs, which is faster.
    -     * Note that this can change the numerical stability of the graph.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecisionMkl() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(autoMixedPrecisionMkl_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Optimize data types for MKL (default is OFF).
    -     * This will try to use bfloat16 on CPUs, which is faster.
    -     * Note that this can change the numerical stability of the graph.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public Builder setAutoMixedPrecisionMkl(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - autoMixedPrecisionMkl_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Optimize data types for MKL (default is OFF).
    -     * This will try to use bfloat16 on CPUs, which is faster.
    -     * Note that this can change the numerical stability of the graph.
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - public Builder clearAutoMixedPrecisionMkl() { - - autoMixedPrecisionMkl_ = 0; - onChanged(); - return this; - } - - private boolean disableMetaOptimizer_ ; - /** - *
    -     * Disable the entire meta optimizer (off by default).
    -     * 
    - * - * bool disable_meta_optimizer = 19; - */ - public boolean getDisableMetaOptimizer() { - return disableMetaOptimizer_; - } - /** - *
    -     * Disable the entire meta optimizer (off by default).
    -     * 
    - * - * bool disable_meta_optimizer = 19; - */ - public Builder setDisableMetaOptimizer(boolean value) { - - disableMetaOptimizer_ = value; - onChanged(); - return this; - } - /** - *
    -     * Disable the entire meta optimizer (off by default).
    -     * 
    - * - * bool disable_meta_optimizer = 19; - */ - public Builder clearDisableMetaOptimizer() { - - disableMetaOptimizer_ = false; - onChanged(); - return this; - } - - private int usePluginOptimizers_ = 0; - /** - *
    -     * Optimizers registered by plugin (default is ON)
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public int getUsePluginOptimizersValue() { - return usePluginOptimizers_; - } - /** - *
    -     * Optimizers registered by plugin (default is ON)
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public Builder setUsePluginOptimizersValue(int value) { - usePluginOptimizers_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optimizers registered by plugin (default is ON)
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public org.tensorflow.proto.framework.RewriterConfig.Toggle getUsePluginOptimizers() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.Toggle result = org.tensorflow.proto.framework.RewriterConfig.Toggle.valueOf(usePluginOptimizers_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Optimizers registered by plugin (default is ON)
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public Builder setUsePluginOptimizers(org.tensorflow.proto.framework.RewriterConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - usePluginOptimizers_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Optimizers registered by plugin (default is ON)
    -     * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - public Builder clearUsePluginOptimizers() { - - usePluginOptimizers_ = 0; - onChanged(); - return this; - } - - private int metaOptimizerIterations_ = 0; - /** - *
    -     * Controls how many times we run the optimizers in meta optimizer (default
    -     * is once).
    -     * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public int getMetaOptimizerIterationsValue() { - return metaOptimizerIterations_; - } - /** - *
    -     * Controls how many times we run the optimizers in meta optimizer (default
    -     * is once).
    -     * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public Builder setMetaOptimizerIterationsValue(int value) { - metaOptimizerIterations_ = value; - onChanged(); - return this; - } - /** - *
    -     * Controls how many times we run the optimizers in meta optimizer (default
    -     * is once).
    -     * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public org.tensorflow.proto.framework.RewriterConfig.NumIterationsType getMetaOptimizerIterations() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.NumIterationsType result = org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.valueOf(metaOptimizerIterations_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.NumIterationsType.UNRECOGNIZED : result; - } - /** - *
    -     * Controls how many times we run the optimizers in meta optimizer (default
    -     * is once).
    -     * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public Builder setMetaOptimizerIterations(org.tensorflow.proto.framework.RewriterConfig.NumIterationsType value) { - if (value == null) { - throw new NullPointerException(); - } - - metaOptimizerIterations_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Controls how many times we run the optimizers in meta optimizer (default
    -     * is once).
    -     * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - public Builder clearMetaOptimizerIterations() { - - metaOptimizerIterations_ = 0; - onChanged(); - return this; - } - - private int minGraphNodes_ ; - /** - *
    -     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    -     * optimization is skipped.
    -     * 0 means the system picks an appropriate number.
    -     * < 0 means do not skip optimization.
    -     * 
    - * - * int32 min_graph_nodes = 17; - */ - public int getMinGraphNodes() { - return minGraphNodes_; - } - /** - *
    -     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    -     * optimization is skipped.
    -     * 0 means the system picks an appropriate number.
    -     * < 0 means do not skip optimization.
    -     * 
    - * - * int32 min_graph_nodes = 17; - */ - public Builder setMinGraphNodes(int value) { - - minGraphNodes_ = value; - onChanged(); - return this; - } - /** - *
    -     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    -     * optimization is skipped.
    -     * 0 means the system picks an appropriate number.
    -     * < 0 means do not skip optimization.
    -     * 
    - * - * int32 min_graph_nodes = 17; - */ - public Builder clearMinGraphNodes() { - - minGraphNodes_ = 0; - onChanged(); - 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 boolean experimentalDisableFoldingQuantizationEmulation_ ; - /** - *
    -     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    -     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    -     * have to extract quantization configs (e.g. min/max range, number of bits,
    -     * and per-channel) from the quantization emulation ops. Note that this flag
    -     * is experimental and may be removed in the future. See b/174138564 for more
    -     * details.
    -     * 
    - * - * bool experimental_disable_folding_quantization_emulation = 27; - */ - public boolean getExperimentalDisableFoldingQuantizationEmulation() { - return experimentalDisableFoldingQuantizationEmulation_; - } - /** - *
    -     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    -     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    -     * have to extract quantization configs (e.g. min/max range, number of bits,
    -     * and per-channel) from the quantization emulation ops. Note that this flag
    -     * is experimental and may be removed in the future. See b/174138564 for more
    -     * details.
    -     * 
    - * - * bool experimental_disable_folding_quantization_emulation = 27; - */ - public Builder setExperimentalDisableFoldingQuantizationEmulation(boolean value) { - - experimentalDisableFoldingQuantizationEmulation_ = value; - onChanged(); - return this; - } - /** - *
    -     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    -     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    -     * have to extract quantization configs (e.g. min/max range, number of bits,
    -     * and per-channel) from the quantization emulation ops. Note that this flag
    -     * is experimental and may be removed in the future. See b/174138564 for more
    -     * details.
    -     * 
    - * - * bool experimental_disable_folding_quantization_emulation = 27; - */ - public Builder clearExperimentalDisableFoldingQuantizationEmulation() { - - experimentalDisableFoldingQuantizationEmulation_ = false; - onChanged(); - return this; - } - - private int memoryOptimization_ = 0; - /** - *
    -     * Configures memory optimization passes through the meta-optimizer. Has no
    -     * effect on manually requested memory optimization passes in the optimizers
    -     * field.
    -     * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public int getMemoryOptimizationValue() { - return memoryOptimization_; - } - /** - *
    -     * Configures memory optimization passes through the meta-optimizer. Has no
    -     * effect on manually requested memory optimization passes in the optimizers
    -     * field.
    -     * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public Builder setMemoryOptimizationValue(int value) { - memoryOptimization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Configures memory optimization passes through the meta-optimizer. Has no
    -     * effect on manually requested memory optimization passes in the optimizers
    -     * field.
    -     * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public org.tensorflow.proto.framework.RewriterConfig.MemOptType getMemoryOptimization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RewriterConfig.MemOptType result = org.tensorflow.proto.framework.RewriterConfig.MemOptType.valueOf(memoryOptimization_); - return result == null ? org.tensorflow.proto.framework.RewriterConfig.MemOptType.UNRECOGNIZED : result; - } - /** - *
    -     * Configures memory optimization passes through the meta-optimizer. Has no
    -     * effect on manually requested memory optimization passes in the optimizers
    -     * field.
    -     * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public Builder setMemoryOptimization(org.tensorflow.proto.framework.RewriterConfig.MemOptType value) { - if (value == null) { - throw new NullPointerException(); - } - - memoryOptimization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Configures memory optimization passes through the meta-optimizer. Has no
    -     * effect on manually requested memory optimization passes in the optimizers
    -     * field.
    -     * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - public Builder clearMemoryOptimization() { - - memoryOptimization_ = 0; - onChanged(); - return this; - } - - private java.lang.Object memoryOptimizerTargetNodeNameScope_ = ""; - /** - *
    -     * A node name scope for node names which are valid outputs of recomputations.
    -     * Inputs to nodes that match this scope may be recomputed (subject either to
    -     * manual annotation of those input nodes or to manual annotation and
    -     * heuristics depending on memory_optimization), but the nodes themselves will
    -     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -     * can appear not just as a top-level scope. For example, if the value is
    -     * "gradients/", the default, it will match node name "gradients/foo",
    -     * "foo/gradients/bar", but not "foo_gradients/"
    -     * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public java.lang.String getMemoryOptimizerTargetNodeNameScope() { - java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - memoryOptimizerTargetNodeNameScope_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A node name scope for node names which are valid outputs of recomputations.
    -     * Inputs to nodes that match this scope may be recomputed (subject either to
    -     * manual annotation of those input nodes or to manual annotation and
    -     * heuristics depending on memory_optimization), but the nodes themselves will
    -     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -     * can appear not just as a top-level scope. For example, if the value is
    -     * "gradients/", the default, it will match node name "gradients/foo",
    -     * "foo/gradients/bar", but not "foo_gradients/"
    -     * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public com.google.protobuf.ByteString - getMemoryOptimizerTargetNodeNameScopeBytes() { - java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - memoryOptimizerTargetNodeNameScope_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A node name scope for node names which are valid outputs of recomputations.
    -     * Inputs to nodes that match this scope may be recomputed (subject either to
    -     * manual annotation of those input nodes or to manual annotation and
    -     * heuristics depending on memory_optimization), but the nodes themselves will
    -     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -     * can appear not just as a top-level scope. For example, if the value is
    -     * "gradients/", the default, it will match node name "gradients/foo",
    -     * "foo/gradients/bar", but not "foo_gradients/"
    -     * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public Builder setMemoryOptimizerTargetNodeNameScope( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - memoryOptimizerTargetNodeNameScope_ = value; - onChanged(); - return this; - } - /** - *
    -     * A node name scope for node names which are valid outputs of recomputations.
    -     * Inputs to nodes that match this scope may be recomputed (subject either to
    -     * manual annotation of those input nodes or to manual annotation and
    -     * heuristics depending on memory_optimization), but the nodes themselves will
    -     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -     * can appear not just as a top-level scope. For example, if the value is
    -     * "gradients/", the default, it will match node name "gradients/foo",
    -     * "foo/gradients/bar", but not "foo_gradients/"
    -     * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public Builder clearMemoryOptimizerTargetNodeNameScope() { - - memoryOptimizerTargetNodeNameScope_ = getDefaultInstance().getMemoryOptimizerTargetNodeNameScope(); - onChanged(); - return this; - } - /** - *
    -     * A node name scope for node names which are valid outputs of recomputations.
    -     * Inputs to nodes that match this scope may be recomputed (subject either to
    -     * manual annotation of those input nodes or to manual annotation and
    -     * heuristics depending on memory_optimization), but the nodes themselves will
    -     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -     * can appear not just as a top-level scope. For example, if the value is
    -     * "gradients/", the default, it will match node name "gradients/foo",
    -     * "foo/gradients/bar", but not "foo_gradients/"
    -     * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - public Builder setMemoryOptimizerTargetNodeNameScopeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - memoryOptimizerTargetNodeNameScope_ = value; - onChanged(); - return this; - } - - private long metaOptimizerTimeoutMs_ ; - /** - *
    -     * Maximum number of milliseconds to spend optimizing a single graph before
    -     * timing out. If less than or equal to 0 (default value) the optimizer will
    -     * never time out.
    -     * 
    - * - * int64 meta_optimizer_timeout_ms = 20; - */ - public long getMetaOptimizerTimeoutMs() { - return metaOptimizerTimeoutMs_; - } - /** - *
    -     * Maximum number of milliseconds to spend optimizing a single graph before
    -     * timing out. If less than or equal to 0 (default value) the optimizer will
    -     * never time out.
    -     * 
    - * - * int64 meta_optimizer_timeout_ms = 20; - */ - public Builder setMetaOptimizerTimeoutMs(long value) { - - metaOptimizerTimeoutMs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Maximum number of milliseconds to spend optimizing a single graph before
    -     * timing out. If less than or equal to 0 (default value) the optimizer will
    -     * never time out.
    -     * 
    - * - * int64 meta_optimizer_timeout_ms = 20; - */ - public Builder clearMetaOptimizerTimeoutMs() { - - metaOptimizerTimeoutMs_ = 0L; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.AutoParallelOptions autoParallel_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AutoParallelOptions, org.tensorflow.proto.framework.AutoParallelOptions.Builder, org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder> autoParallelBuilder_; - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public boolean hasAutoParallel() { - return autoParallelBuilder_ != null || autoParallel_ != null; - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public org.tensorflow.proto.framework.AutoParallelOptions getAutoParallel() { - if (autoParallelBuilder_ == null) { - return autoParallel_ == null ? org.tensorflow.proto.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_; - } else { - return autoParallelBuilder_.getMessage(); - } - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public Builder setAutoParallel(org.tensorflow.proto.framework.AutoParallelOptions value) { - if (autoParallelBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - autoParallel_ = value; - onChanged(); - } else { - autoParallelBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public Builder setAutoParallel( - org.tensorflow.proto.framework.AutoParallelOptions.Builder builderForValue) { - if (autoParallelBuilder_ == null) { - autoParallel_ = builderForValue.build(); - onChanged(); - } else { - autoParallelBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public Builder mergeAutoParallel(org.tensorflow.proto.framework.AutoParallelOptions value) { - if (autoParallelBuilder_ == null) { - if (autoParallel_ != null) { - autoParallel_ = - org.tensorflow.proto.framework.AutoParallelOptions.newBuilder(autoParallel_).mergeFrom(value).buildPartial(); - } else { - autoParallel_ = value; - } - onChanged(); - } else { - autoParallelBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public Builder clearAutoParallel() { - if (autoParallelBuilder_ == null) { - autoParallel_ = null; - onChanged(); - } else { - autoParallel_ = null; - autoParallelBuilder_ = null; - } - - return this; - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public org.tensorflow.proto.framework.AutoParallelOptions.Builder getAutoParallelBuilder() { - - onChanged(); - return getAutoParallelFieldBuilder().getBuilder(); - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - public org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() { - if (autoParallelBuilder_ != null) { - return autoParallelBuilder_.getMessageOrBuilder(); - } else { - return autoParallel_ == null ? - org.tensorflow.proto.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_; - } - } - /** - *
    -     * Configures AutoParallel optimization passes either through the
    -     * meta-optimizer or when manually specified through the optimizers field.
    -     * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AutoParallelOptions, org.tensorflow.proto.framework.AutoParallelOptions.Builder, org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder> - getAutoParallelFieldBuilder() { - if (autoParallelBuilder_ == null) { - autoParallelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AutoParallelOptions, org.tensorflow.proto.framework.AutoParallelOptions.Builder, org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder>( - getAutoParallel(), - getParentForChildren(), - isClean()); - autoParallel_ = null; - } - return autoParallelBuilder_; - } - - private boolean failOnOptimizerErrors_ ; - /** - *
    -     * If true, any optimization pass failing will cause the MetaOptimizer to
    -     * stop with an error. By default - or when set to false, failing passes are
    -     * skipped silently.
    -     * 
    - * - * bool fail_on_optimizer_errors = 21; - */ - public boolean getFailOnOptimizerErrors() { - return failOnOptimizerErrors_; - } - /** - *
    -     * If true, any optimization pass failing will cause the MetaOptimizer to
    -     * stop with an error. By default - or when set to false, failing passes are
    -     * skipped silently.
    -     * 
    - * - * bool fail_on_optimizer_errors = 21; - */ - public Builder setFailOnOptimizerErrors(boolean value) { - - failOnOptimizerErrors_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, any optimization pass failing will cause the MetaOptimizer to
    -     * stop with an error. By default - or when set to false, failing passes are
    -     * skipped silently.
    -     * 
    - * - * bool fail_on_optimizer_errors = 21; - */ - public Builder clearFailOnOptimizerErrors() { - - failOnOptimizerErrors_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.ScopedAllocatorOptions scopedAllocatorOpts_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ScopedAllocatorOptions, org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder, org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder> scopedAllocatorOptsBuilder_; - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public boolean hasScopedAllocatorOpts() { - return scopedAllocatorOptsBuilder_ != null || scopedAllocatorOpts_ != null; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public org.tensorflow.proto.framework.ScopedAllocatorOptions getScopedAllocatorOpts() { - if (scopedAllocatorOptsBuilder_ == null) { - return scopedAllocatorOpts_ == null ? org.tensorflow.proto.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; - } else { - return scopedAllocatorOptsBuilder_.getMessage(); - } - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public Builder setScopedAllocatorOpts(org.tensorflow.proto.framework.ScopedAllocatorOptions value) { - if (scopedAllocatorOptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - scopedAllocatorOpts_ = value; - onChanged(); - } else { - scopedAllocatorOptsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public Builder setScopedAllocatorOpts( - org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder builderForValue) { - if (scopedAllocatorOptsBuilder_ == null) { - scopedAllocatorOpts_ = builderForValue.build(); - onChanged(); - } else { - scopedAllocatorOptsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public Builder mergeScopedAllocatorOpts(org.tensorflow.proto.framework.ScopedAllocatorOptions value) { - if (scopedAllocatorOptsBuilder_ == null) { - if (scopedAllocatorOpts_ != null) { - scopedAllocatorOpts_ = - org.tensorflow.proto.framework.ScopedAllocatorOptions.newBuilder(scopedAllocatorOpts_).mergeFrom(value).buildPartial(); - } else { - scopedAllocatorOpts_ = value; - } - onChanged(); - } else { - scopedAllocatorOptsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public Builder clearScopedAllocatorOpts() { - if (scopedAllocatorOptsBuilder_ == null) { - scopedAllocatorOpts_ = null; - onChanged(); - } else { - scopedAllocatorOpts_ = null; - scopedAllocatorOptsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder getScopedAllocatorOptsBuilder() { - - onChanged(); - return getScopedAllocatorOptsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - public org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() { - if (scopedAllocatorOptsBuilder_ != null) { - return scopedAllocatorOptsBuilder_.getMessageOrBuilder(); - } else { - return scopedAllocatorOpts_ == null ? - org.tensorflow.proto.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; - } - } - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ScopedAllocatorOptions, org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder, org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder> - getScopedAllocatorOptsFieldBuilder() { - if (scopedAllocatorOptsBuilder_ == null) { - scopedAllocatorOptsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ScopedAllocatorOptions, org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder, org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder>( - getScopedAllocatorOpts(), - getParentForChildren(), - isClean()); - scopedAllocatorOpts_ = null; - } - return scopedAllocatorOptsBuilder_; - } - - private com.google.protobuf.LazyStringList optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureOptimizersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - optimizers_ = new com.google.protobuf.LazyStringArrayList(optimizers_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public com.google.protobuf.ProtocolStringList - getOptimizersList() { - return optimizers_.getUnmodifiableView(); - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public int getOptimizersCount() { - return optimizers_.size(); - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public java.lang.String getOptimizers(int index) { - return optimizers_.get(index); - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public com.google.protobuf.ByteString - getOptimizersBytes(int index) { - return optimizers_.getByteString(index); - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public Builder setOptimizers( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptimizersIsMutable(); - optimizers_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public Builder addOptimizers( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptimizersIsMutable(); - optimizers_.add(value); - onChanged(); - return this; - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public Builder addAllOptimizers( - java.lang.Iterable values) { - ensureOptimizersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, optimizers_); - onChanged(); - return this; - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public Builder clearOptimizers() { - optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * If non-empty, will use this as an alternative way to specify a list of
    -     * optimizations to turn on and the order of the optimizations (replacing the
    -     * meta-optimizer).
    -     * Of the RewriterConfig options, only the AutoParallel configuration options
    -     * (the auto_parallel field) apply to manually requested optimization passes
    -     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -     * not configurable (in contrast to memory optimization passes through the
    -     * meta-optimizer) and act only on manual op annotations.
    -     * Custom optimizers (see custom_optimizers) that are not part of this
    -     * schedule will be run after - in the order that they were specified.
    -     * 
    - * - * repeated string optimizers = 100; - */ - public Builder addOptimizersBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureOptimizersIsMutable(); - optimizers_.add(value); - onChanged(); - return this; - } - - private java.util.List customOptimizers_ = - java.util.Collections.emptyList(); - private void ensureCustomOptimizersIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - customOptimizers_ = new java.util.ArrayList(customOptimizers_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder> customOptimizersBuilder_; - - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public java.util.List getCustomOptimizersList() { - if (customOptimizersBuilder_ == null) { - return java.util.Collections.unmodifiableList(customOptimizers_); - } else { - return customOptimizersBuilder_.getMessageList(); - } - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public int getCustomOptimizersCount() { - if (customOptimizersBuilder_ == null) { - return customOptimizers_.size(); - } else { - return customOptimizersBuilder_.getCount(); - } - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) { - if (customOptimizersBuilder_ == null) { - return customOptimizers_.get(index); - } else { - return customOptimizersBuilder_.getMessage(index); - } - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder setCustomOptimizers( - int index, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer value) { - if (customOptimizersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomOptimizersIsMutable(); - customOptimizers_.set(index, value); - onChanged(); - } else { - customOptimizersBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder setCustomOptimizers( - int index, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { - if (customOptimizersBuilder_ == null) { - ensureCustomOptimizersIsMutable(); - customOptimizers_.set(index, builderForValue.build()); - onChanged(); - } else { - customOptimizersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder addCustomOptimizers(org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer value) { - if (customOptimizersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomOptimizersIsMutable(); - customOptimizers_.add(value); - onChanged(); - } else { - customOptimizersBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder addCustomOptimizers( - int index, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer value) { - if (customOptimizersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomOptimizersIsMutable(); - customOptimizers_.add(index, value); - onChanged(); - } else { - customOptimizersBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder addCustomOptimizers( - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { - if (customOptimizersBuilder_ == null) { - ensureCustomOptimizersIsMutable(); - customOptimizers_.add(builderForValue.build()); - onChanged(); - } else { - customOptimizersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder addCustomOptimizers( - int index, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { - if (customOptimizersBuilder_ == null) { - ensureCustomOptimizersIsMutable(); - customOptimizers_.add(index, builderForValue.build()); - onChanged(); - } else { - customOptimizersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder addAllCustomOptimizers( - java.lang.Iterable values) { - if (customOptimizersBuilder_ == null) { - ensureCustomOptimizersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, customOptimizers_); - onChanged(); - } else { - customOptimizersBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder clearCustomOptimizers() { - if (customOptimizersBuilder_ == null) { - customOptimizers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - customOptimizersBuilder_.clear(); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public Builder removeCustomOptimizers(int index) { - if (customOptimizersBuilder_ == null) { - ensureCustomOptimizersIsMutable(); - customOptimizers_.remove(index); - onChanged(); - } else { - customOptimizersBuilder_.remove(index); - } - return this; - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder getCustomOptimizersBuilder( - int index) { - return getCustomOptimizersFieldBuilder().getBuilder(index); - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( - int index) { - if (customOptimizersBuilder_ == null) { - return customOptimizers_.get(index); } else { - return customOptimizersBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public java.util.List - getCustomOptimizersOrBuilderList() { - if (customOptimizersBuilder_ != null) { - return customOptimizersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customOptimizers_); - } - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder() { - return getCustomOptimizersFieldBuilder().addBuilder( - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()); - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder( - int index) { - return getCustomOptimizersFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()); - } - /** - *
    -     * list of CustomGraphOptimizers to apply.
    -     * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - public java.util.List - getCustomOptimizersBuilderList() { - return getCustomOptimizersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder> - getCustomOptimizersFieldBuilder() { - if (customOptimizersBuilder_ == null) { - customOptimizersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder>( - customOptimizers_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - customOptimizers_ = null; - } - return customOptimizersBuilder_; - } - - private org.tensorflow.proto.framework.VerifierConfig interOptimizerVerifierConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder> interOptimizerVerifierConfigBuilder_; - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public boolean hasInterOptimizerVerifierConfig() { - return interOptimizerVerifierConfigBuilder_ != null || interOptimizerVerifierConfig_ != null; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public org.tensorflow.proto.framework.VerifierConfig getInterOptimizerVerifierConfig() { - if (interOptimizerVerifierConfigBuilder_ == null) { - return interOptimizerVerifierConfig_ == null ? org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; - } else { - return interOptimizerVerifierConfigBuilder_.getMessage(); - } - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public Builder setInterOptimizerVerifierConfig(org.tensorflow.proto.framework.VerifierConfig value) { - if (interOptimizerVerifierConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - interOptimizerVerifierConfig_ = value; - onChanged(); - } else { - interOptimizerVerifierConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public Builder setInterOptimizerVerifierConfig( - org.tensorflow.proto.framework.VerifierConfig.Builder builderForValue) { - if (interOptimizerVerifierConfigBuilder_ == null) { - interOptimizerVerifierConfig_ = builderForValue.build(); - onChanged(); - } else { - interOptimizerVerifierConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public Builder mergeInterOptimizerVerifierConfig(org.tensorflow.proto.framework.VerifierConfig value) { - if (interOptimizerVerifierConfigBuilder_ == null) { - if (interOptimizerVerifierConfig_ != null) { - interOptimizerVerifierConfig_ = - org.tensorflow.proto.framework.VerifierConfig.newBuilder(interOptimizerVerifierConfig_).mergeFrom(value).buildPartial(); - } else { - interOptimizerVerifierConfig_ = value; - } - onChanged(); - } else { - interOptimizerVerifierConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public Builder clearInterOptimizerVerifierConfig() { - if (interOptimizerVerifierConfigBuilder_ == null) { - interOptimizerVerifierConfig_ = null; - onChanged(); - } else { - interOptimizerVerifierConfig_ = null; - interOptimizerVerifierConfigBuilder_ = null; - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public org.tensorflow.proto.framework.VerifierConfig.Builder getInterOptimizerVerifierConfigBuilder() { - - onChanged(); - return getInterOptimizerVerifierConfigFieldBuilder().getBuilder(); - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - public org.tensorflow.proto.framework.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder() { - if (interOptimizerVerifierConfigBuilder_ != null) { - return interOptimizerVerifierConfigBuilder_.getMessageOrBuilder(); - } else { - return interOptimizerVerifierConfig_ == null ? - org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; - } - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run after every optimizer.
    -     * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder> - getInterOptimizerVerifierConfigFieldBuilder() { - if (interOptimizerVerifierConfigBuilder_ == null) { - interOptimizerVerifierConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder>( - getInterOptimizerVerifierConfig(), - getParentForChildren(), - isClean()); - interOptimizerVerifierConfig_ = null; - } - return interOptimizerVerifierConfigBuilder_; - } - - private org.tensorflow.proto.framework.VerifierConfig postOptimizationVerifierConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder> postOptimizationVerifierConfigBuilder_; - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public boolean hasPostOptimizationVerifierConfig() { - return postOptimizationVerifierConfigBuilder_ != null || postOptimizationVerifierConfig_ != null; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public org.tensorflow.proto.framework.VerifierConfig getPostOptimizationVerifierConfig() { - if (postOptimizationVerifierConfigBuilder_ == null) { - return postOptimizationVerifierConfig_ == null ? org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; - } else { - return postOptimizationVerifierConfigBuilder_.getMessage(); - } - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public Builder setPostOptimizationVerifierConfig(org.tensorflow.proto.framework.VerifierConfig value) { - if (postOptimizationVerifierConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - postOptimizationVerifierConfig_ = value; - onChanged(); - } else { - postOptimizationVerifierConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public Builder setPostOptimizationVerifierConfig( - org.tensorflow.proto.framework.VerifierConfig.Builder builderForValue) { - if (postOptimizationVerifierConfigBuilder_ == null) { - postOptimizationVerifierConfig_ = builderForValue.build(); - onChanged(); - } else { - postOptimizationVerifierConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public Builder mergePostOptimizationVerifierConfig(org.tensorflow.proto.framework.VerifierConfig value) { - if (postOptimizationVerifierConfigBuilder_ == null) { - if (postOptimizationVerifierConfig_ != null) { - postOptimizationVerifierConfig_ = - org.tensorflow.proto.framework.VerifierConfig.newBuilder(postOptimizationVerifierConfig_).mergeFrom(value).buildPartial(); - } else { - postOptimizationVerifierConfig_ = value; - } - onChanged(); - } else { - postOptimizationVerifierConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public Builder clearPostOptimizationVerifierConfig() { - if (postOptimizationVerifierConfigBuilder_ == null) { - postOptimizationVerifierConfig_ = null; - onChanged(); - } else { - postOptimizationVerifierConfig_ = null; - postOptimizationVerifierConfigBuilder_ = null; - } - - return this; - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public org.tensorflow.proto.framework.VerifierConfig.Builder getPostOptimizationVerifierConfigBuilder() { - - onChanged(); - return getPostOptimizationVerifierConfigFieldBuilder().getBuilder(); - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - public org.tensorflow.proto.framework.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder() { - if (postOptimizationVerifierConfigBuilder_ != null) { - return postOptimizationVerifierConfigBuilder_.getMessageOrBuilder(); - } else { - return postOptimizationVerifierConfig_ == null ? - org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; - } - } - /** - *
    -     * VerifierConfig specifying the verifiers to be run at the end, after all
    -     * optimizers have run.
    -     * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder> - getPostOptimizationVerifierConfigFieldBuilder() { - if (postOptimizationVerifierConfigBuilder_ == null) { - postOptimizationVerifierConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VerifierConfig, org.tensorflow.proto.framework.VerifierConfig.Builder, org.tensorflow.proto.framework.VerifierConfigOrBuilder>( - getPostOptimizationVerifierConfig(), - getParentForChildren(), - isClean()); - postOptimizationVerifierConfig_ = null; - } - return postOptimizationVerifierConfigBuilder_; - } - @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.RewriterConfig) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig) - private static final org.tensorflow.proto.framework.RewriterConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RewriterConfig(); - } - - public static org.tensorflow.proto.framework.RewriterConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RewriterConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RewriterConfig(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.RewriterConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index eb2a9061177..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigOrBuilder.java +++ /dev/null @@ -1,685 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -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)
    -   * e.g. This will try to use NCHW layout on GPU which is faster.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - int getLayoutOptimizerValue(); - /** - *
    -   * Optimize tensor layouts (default is ON)
    -   * e.g. This will try to use NCHW layout on GPU which is faster.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getLayoutOptimizer(); - - /** - *
    -   * Fold constants (default is ON)
    -   * Statically infer the value of tensors when possible, and materialize the
    -   * result using constants.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - int getConstantFoldingValue(); - /** - *
    -   * Fold constants (default is ON)
    -   * Statically infer the value of tensors when possible, and materialize the
    -   * result using constants.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle constant_folding = 3; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getConstantFolding(); - - /** - *
    -   * Shape optimizations (default is ON)
    -   * Simplify computations made on shapes.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - int getShapeOptimizationValue(); - /** - *
    -   * Shape optimizations (default is ON)
    -   * Simplify computations made on shapes.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getShapeOptimization(); - - /** - *
    -   * Remapping (default is ON)
    -   * Remap subgraphs onto more efficient implementations.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - int getRemappingValue(); - /** - *
    -   * Remapping (default is ON)
    -   * Remap subgraphs onto more efficient implementations.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle remapping = 14; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getRemapping(); - - /** - *
    -   * Common subgraph elimination (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - int getCommonSubgraphEliminationValue(); - /** - *
    -   * Common subgraph elimination (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getCommonSubgraphElimination(); - - /** - *
    -   * Arithmetic optimizations (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - int getArithmeticOptimizationValue(); - /** - *
    -   * Arithmetic optimizations (default is ON)
    -   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getArithmeticOptimization(); - - /** - *
    -   * Control dependency optimizations (default is ON).
    -   * Remove redundant control dependencies, which may enable other optimization.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - int getDependencyOptimizationValue(); - /** - *
    -   * Control dependency optimizations (default is ON).
    -   * Remove redundant control dependencies, which may enable other optimization.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getDependencyOptimization(); - - /** - *
    -   * Loop optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - int getLoopOptimizationValue(); - /** - *
    -   * Loop optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getLoopOptimization(); - - /** - *
    -   * Function optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - int getFunctionOptimizationValue(); - /** - *
    -   * Function optimizations (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle function_optimization = 10; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getFunctionOptimization(); - - /** - *
    -   * Strips debug-related nodes from the graph (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - int getDebugStripperValue(); - /** - *
    -   * Strips debug-related nodes from the graph (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getDebugStripper(); - - /** - *
    -   * If true, don't remove unnecessary ops from the graph
    -   * 
    - * - * bool disable_model_pruning = 2; - */ - boolean getDisableModelPruning(); - - /** - *
    -   * Try to allocate some independent Op outputs contiguously in order to
    -   * merge or eliminate downstream Ops (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - int getScopedAllocatorOptimizationValue(); - /** - *
    -   * Try to allocate some independent Op outputs contiguously in order to
    -   * merge or eliminate downstream Ops (off by default).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getScopedAllocatorOptimization(); - - /** - *
    -   * Force small ops onto the CPU (default is OFF).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - int getPinToHostOptimizationValue(); - /** - *
    -   * Force small ops onto the CPU (default is OFF).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getPinToHostOptimization(); - - /** - *
    -   * Enable the swap of kernel implementations based on the device placement
    -   * (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - int getImplementationSelectorValue(); - /** - *
    -   * Enable the swap of kernel implementations based on the device placement
    -   * (default is ON).
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getImplementationSelector(); - - /** - *
    -   * Optimize data types for CUDA (default is OFF).
    -   * This will try to use float16 on GPU which is faster.
    -   * Note that this can change the numerical stability of the graph and may
    -   * require the use of loss scaling to maintain model convergence.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - int getAutoMixedPrecisionValue(); - /** - *
    -   * Optimize data types for CUDA (default is OFF).
    -   * This will try to use float16 on GPU which is faster.
    -   * Note that this can change the numerical stability of the graph and may
    -   * require the use of loss scaling to maintain model convergence.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecision(); - - /** - *
    -   * Optimize data types for MKL (default is OFF).
    -   * This will try to use bfloat16 on CPUs, which is faster.
    -   * Note that this can change the numerical stability of the graph.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - int getAutoMixedPrecisionMklValue(); - /** - *
    -   * Optimize data types for MKL (default is OFF).
    -   * This will try to use bfloat16 on CPUs, which is faster.
    -   * Note that this can change the numerical stability of the graph.
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getAutoMixedPrecisionMkl(); - - /** - *
    -   * Disable the entire meta optimizer (off by default).
    -   * 
    - * - * bool disable_meta_optimizer = 19; - */ - boolean getDisableMetaOptimizer(); - - /** - *
    -   * Optimizers registered by plugin (default is ON)
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - int getUsePluginOptimizersValue(); - /** - *
    -   * Optimizers registered by plugin (default is ON)
    -   * 
    - * - * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; - */ - org.tensorflow.proto.framework.RewriterConfig.Toggle getUsePluginOptimizers(); - - /** - *
    -   * Controls how many times we run the optimizers in meta optimizer (default
    -   * is once).
    -   * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - int getMetaOptimizerIterationsValue(); - /** - *
    -   * Controls how many times we run the optimizers in meta optimizer (default
    -   * is once).
    -   * 
    - * - * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; - */ - org.tensorflow.proto.framework.RewriterConfig.NumIterationsType getMetaOptimizerIterations(); - - /** - *
    -   * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    -   * optimization is skipped.
    -   * 0 means the system picks an appropriate number.
    -   * < 0 means do not skip optimization.
    -   * 
    - * - * int32 min_graph_nodes = 17; - */ - 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(); - - /** - *
    -   * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    -   * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    -   * have to extract quantization configs (e.g. min/max range, number of bits,
    -   * and per-channel) from the quantization emulation ops. Note that this flag
    -   * is experimental and may be removed in the future. See b/174138564 for more
    -   * details.
    -   * 
    - * - * bool experimental_disable_folding_quantization_emulation = 27; - */ - boolean getExperimentalDisableFoldingQuantizationEmulation(); - - /** - *
    -   * Configures memory optimization passes through the meta-optimizer. Has no
    -   * effect on manually requested memory optimization passes in the optimizers
    -   * field.
    -   * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - int getMemoryOptimizationValue(); - /** - *
    -   * Configures memory optimization passes through the meta-optimizer. Has no
    -   * effect on manually requested memory optimization passes in the optimizers
    -   * field.
    -   * 
    - * - * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; - */ - org.tensorflow.proto.framework.RewriterConfig.MemOptType getMemoryOptimization(); - - /** - *
    -   * A node name scope for node names which are valid outputs of recomputations.
    -   * Inputs to nodes that match this scope may be recomputed (subject either to
    -   * manual annotation of those input nodes or to manual annotation and
    -   * heuristics depending on memory_optimization), but the nodes themselves will
    -   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -   * can appear not just as a top-level scope. For example, if the value is
    -   * "gradients/", the default, it will match node name "gradients/foo",
    -   * "foo/gradients/bar", but not "foo_gradients/"
    -   * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - java.lang.String getMemoryOptimizerTargetNodeNameScope(); - /** - *
    -   * A node name scope for node names which are valid outputs of recomputations.
    -   * Inputs to nodes that match this scope may be recomputed (subject either to
    -   * manual annotation of those input nodes or to manual annotation and
    -   * heuristics depending on memory_optimization), but the nodes themselves will
    -   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    -   * can appear not just as a top-level scope. For example, if the value is
    -   * "gradients/", the default, it will match node name "gradients/foo",
    -   * "foo/gradients/bar", but not "foo_gradients/"
    -   * 
    - * - * string memory_optimizer_target_node_name_scope = 6; - */ - com.google.protobuf.ByteString - getMemoryOptimizerTargetNodeNameScopeBytes(); - - /** - *
    -   * Maximum number of milliseconds to spend optimizing a single graph before
    -   * timing out. If less than or equal to 0 (default value) the optimizer will
    -   * never time out.
    -   * 
    - * - * int64 meta_optimizer_timeout_ms = 20; - */ - long getMetaOptimizerTimeoutMs(); - - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - boolean hasAutoParallel(); - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - org.tensorflow.proto.framework.AutoParallelOptions getAutoParallel(); - /** - *
    -   * Configures AutoParallel optimization passes either through the
    -   * meta-optimizer or when manually specified through the optimizers field.
    -   * 
    - * - * .tensorflow.AutoParallelOptions auto_parallel = 5; - */ - org.tensorflow.proto.framework.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder(); - - /** - *
    -   * If true, any optimization pass failing will cause the MetaOptimizer to
    -   * stop with an error. By default - or when set to false, failing passes are
    -   * skipped silently.
    -   * 
    - * - * bool fail_on_optimizer_errors = 21; - */ - boolean getFailOnOptimizerErrors(); - - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - boolean hasScopedAllocatorOpts(); - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - org.tensorflow.proto.framework.ScopedAllocatorOptions getScopedAllocatorOpts(); - /** - * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; - */ - org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder(); - - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - java.util.List - getOptimizersList(); - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - int getOptimizersCount(); - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - java.lang.String getOptimizers(int index); - /** - *
    -   * If non-empty, will use this as an alternative way to specify a list of
    -   * optimizations to turn on and the order of the optimizations (replacing the
    -   * meta-optimizer).
    -   * Of the RewriterConfig options, only the AutoParallel configuration options
    -   * (the auto_parallel field) apply to manually requested optimization passes
    -   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    -   * not configurable (in contrast to memory optimization passes through the
    -   * meta-optimizer) and act only on manual op annotations.
    -   * Custom optimizers (see custom_optimizers) that are not part of this
    -   * schedule will be run after - in the order that they were specified.
    -   * 
    - * - * repeated string optimizers = 100; - */ - com.google.protobuf.ByteString - getOptimizersBytes(int index); - - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - java.util.List - getCustomOptimizersList(); - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index); - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - int getCustomOptimizersCount(); - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - java.util.List - getCustomOptimizersOrBuilderList(); - /** - *
    -   * list of CustomGraphOptimizers to apply.
    -   * 
    - * - * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; - */ - org.tensorflow.proto.framework.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( - int index); - - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - boolean hasInterOptimizerVerifierConfig(); - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - org.tensorflow.proto.framework.VerifierConfig getInterOptimizerVerifierConfig(); - /** - *
    -   * VerifierConfig specifying the verifiers to be run after every optimizer.
    -   * 
    - * - * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; - */ - org.tensorflow.proto.framework.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder(); - - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - boolean hasPostOptimizationVerifierConfig(); - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - org.tensorflow.proto.framework.VerifierConfig getPostOptimizationVerifierConfig(); - /** - *
    -   * VerifierConfig specifying the verifiers to be run at the end, after all
    -   * optimizers have run.
    -   * 
    - * - * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; - */ - org.tensorflow.proto.framework.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder(); -} 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 deleted file mode 100644 index 513dd4d850d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RewriterConfigProtos.java +++ /dev/null @@ -1,167 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -public final class RewriterConfigProtos { - private RewriterConfigProtos() {} - 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_AutoParallelOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ScopedAllocatorOptions_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RewriterConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RewriterConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_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/rewriter_conf" + - "ig.proto\022\ntensorflow\032*tensorflow/core/fr" + - "amework/attr_value.proto\032.tensorflow/cor" + - "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\"\341\023\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\022@\n\025use_plug" + - "in_optimizers\030\034 \001(\0162!.tensorflow.Rewrite" + - "rConfig.Toggle\022O\n\031meta_optimizer_iterati" + - "ons\030\014 \001(\0162,.tensorflow.RewriterConfig.Nu" + - "mIterationsType\022\027\n\017min_graph_nodes\030\021 \001(\005" + - "\022;\n3experimental_disable_compressed_tens" + - "or_optimization\030\032 \001(\010\022;\n3experimental_di" + - "sable_folding_quantization_emulation\030\033 \001" + - "(\010\022B\n\023memory_optimization\030\004 \001(\0162%.tensor" + - "flow.RewriterConfig.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\rau" + - "to_parallel\030\005 \001(\0132\037.tensorflow.AutoParal" + - "lelOptions\022 \n\030fail_on_optimizer_errors\030\025" + - " \001(\010\022A\n\025scoped_allocator_opts\030\020 \001(\0132\".te" + - "nsorflow.ScopedAllocatorOptions\022\022\n\noptim" + - "izers\030d \003(\t\022K\n\021custom_optimizers\030\310\001 \003(\0132" + - "/.tensorflow.RewriterConfig.CustomGraphO" + - "ptimizer\022D\n\037inter_optimizer_verifier_con" + - "fig\030\254\002 \001(\0132\032.tensorflow.VerifierConfig\022F" + - "\n!post_optimization_verifier_config\030\255\002 \001" + - "(\0132\032.tensorflow.VerifierConfig\032\312\001\n\024Custo" + - "mGraphOptimizer\022\014\n\004name\030\001 \001(\t\022X\n\rparamet" + - "er_map\030\002 \003(\0132A.tensorflow.RewriterConfig" + - ".CustomGraphOptimizer.ParameterMapEntry\032" + - "J\n\021ParameterMapEntry\022\013\n\003key\030\001 \001(\t\022$\n\005val" + - "ue\030\002 \001(\0132\025.tensorflow.AttrValue:\0028\001\"6\n\006T" + - "oggle\022\013\n\007DEFAULT\020\000\022\006\n\002ON\020\001\022\007\n\003OFF\020\002\022\016\n\nA" + - "GGRESSIVE\020\003\"I\n\tCpuLayout\022\030\n\024NO_CONVERSIO" + - "N_ON_CPU\020\000\022\020\n\014NCHW_TO_NHWC\020\001\022\020\n\014NHWC_TO_" + - "NCHW\020\002\"<\n\021NumIterationsType\022\025\n\021DEFAULT_N" + - "UM_ITERS\020\000\022\007\n\003ONE\020\001\022\007\n\003TWO\020\002\"\237\001\n\nMemOptT" + - "ype\022\023\n\017DEFAULT_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" + - "\030RECOMPUTATION_HEURISTICS\020\005\022\031\n\025SCHEDULIN" + - "G_HEURISTICS\020\006\022\016\n\nHEURISTICS\020\003B\222\001\n\036org.t" + - "ensorflow.proto.frameworkB\024RewriterConfi" + - "gProtosP\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(), - org.tensorflow.proto.framework.VerifierConfigProtos.getDescriptor(), - }); - internal_static_tensorflow_AutoParallelOptions_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AutoParallelOptions_descriptor, - new java.lang.String[] { "Enable", "NumReplicas", }); - internal_static_tensorflow_ScopedAllocatorOptions_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ScopedAllocatorOptions_descriptor, - new java.lang.String[] { "EnableOp", }); - internal_static_tensorflow_RewriterConfig_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_RewriterConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RewriterConfig_descriptor, - new java.lang.String[] { "CpuLayoutConversion", "LayoutOptimizer", "ConstantFolding", "ShapeOptimization", "Remapping", "CommonSubgraphElimination", "ArithmeticOptimization", "DependencyOptimization", "LoopOptimization", "FunctionOptimization", "DebugStripper", "DisableModelPruning", "ScopedAllocatorOptimization", "PinToHostOptimization", "ImplementationSelector", "AutoMixedPrecision", "AutoMixedPrecisionMkl", "DisableMetaOptimizer", "UsePluginOptimizers", "MetaOptimizerIterations", "MinGraphNodes", "ExperimentalDisableCompressedTensorOptimization", "ExperimentalDisableFoldingQuantizationEmulation", "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 - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor, - new java.lang.String[] { "Name", "ParameterMap", }); - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor = - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(); - org.tensorflow.proto.framework.VerifierConfigProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadata.java deleted file mode 100644 index 47f4aa27082..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadata.java +++ /dev/null @@ -1,3277 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Metadata output (i.e., non-Tensor) for a single Run() call.
    - * 
    - * - * Protobuf type {@code tensorflow.RunMetadata} - */ -public final class RunMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunMetadata) - RunMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use RunMetadata.newBuilder() to construct. - private RunMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RunMetadata() { - partitionGraphs_ = java.util.Collections.emptyList(); - functionGraphs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RunMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RunMetadata( - 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.framework.StepStats.Builder subBuilder = null; - if (stepStats_ != null) { - subBuilder = stepStats_.toBuilder(); - } - stepStats_ = input.readMessage(org.tensorflow.proto.framework.StepStats.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(stepStats_); - stepStats_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.tensorflow.proto.framework.CostGraphDef.Builder subBuilder = null; - if (costGraph_ != null) { - subBuilder = costGraph_.toBuilder(); - } - costGraph_ = input.readMessage(org.tensorflow.proto.framework.CostGraphDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(costGraph_); - costGraph_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - partitionGraphs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - partitionGraphs_.add( - input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - functionGraphs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - functionGraphs_.add( - input.readMessage(org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.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_ & 0x00000001) != 0)) { - partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - functionGraphs_ = java.util.Collections.unmodifiableList(functionGraphs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunMetadata.class, org.tensorflow.proto.framework.RunMetadata.Builder.class); - } - - public interface FunctionGraphsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RunMetadata.FunctionGraphs) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - java.util.List - getPartitionGraphsList(); - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index); - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - int getPartitionGraphsCount(); - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - java.util.List - getPartitionGraphsOrBuilderList(); - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder( - int index); - - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - boolean hasPreOptimizationGraph(); - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - org.tensorflow.proto.framework.GraphDef getPreOptimizationGraph(); - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - org.tensorflow.proto.framework.GraphDefOrBuilder getPreOptimizationGraphOrBuilder(); - - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - boolean hasPostOptimizationGraph(); - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - org.tensorflow.proto.framework.GraphDef getPostOptimizationGraph(); - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - org.tensorflow.proto.framework.GraphDefOrBuilder getPostOptimizationGraphOrBuilder(); - } - /** - * Protobuf type {@code tensorflow.RunMetadata.FunctionGraphs} - */ - public static final class FunctionGraphs extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunMetadata.FunctionGraphs) - FunctionGraphsOrBuilder { - private static final long serialVersionUID = 0L; - // Use FunctionGraphs.newBuilder() to construct. - private FunctionGraphs(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private FunctionGraphs() { - partitionGraphs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new FunctionGraphs(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private FunctionGraphs( - 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)) { - partitionGraphs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - partitionGraphs_.add( - input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry)); - break; - } - case 18: { - org.tensorflow.proto.framework.GraphDef.Builder subBuilder = null; - if (preOptimizationGraph_ != null) { - subBuilder = preOptimizationGraph_.toBuilder(); - } - preOptimizationGraph_ = input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(preOptimizationGraph_); - preOptimizationGraph_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.framework.GraphDef.Builder subBuilder = null; - if (postOptimizationGraph_ != null) { - subBuilder = postOptimizationGraph_.toBuilder(); - } - postOptimizationGraph_ = input.readMessage(org.tensorflow.proto.framework.GraphDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(postOptimizationGraph_); - postOptimizationGraph_ = subBuilder.buildPartial(); - } - - 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)) { - partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.class, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder.class); - } - - public static final int PARTITION_GRAPHS_FIELD_NUMBER = 1; - private java.util.List partitionGraphs_; - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public java.util.List getPartitionGraphsList() { - return partitionGraphs_; - } - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public java.util.List - getPartitionGraphsOrBuilderList() { - return partitionGraphs_; - } - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public int getPartitionGraphsCount() { - return partitionGraphs_.size(); - } - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index) { - return partitionGraphs_.get(index); - } - /** - *
    -     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder( - int index) { - return partitionGraphs_.get(index); - } - - public static final int PRE_OPTIMIZATION_GRAPH_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.GraphDef preOptimizationGraph_; - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public boolean hasPreOptimizationGraph() { - return preOptimizationGraph_ != null; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public org.tensorflow.proto.framework.GraphDef getPreOptimizationGraph() { - return preOptimizationGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : preOptimizationGraph_; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPreOptimizationGraphOrBuilder() { - return getPreOptimizationGraph(); - } - - public static final int POST_OPTIMIZATION_GRAPH_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.GraphDef postOptimizationGraph_; - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public boolean hasPostOptimizationGraph() { - return postOptimizationGraph_ != null; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public org.tensorflow.proto.framework.GraphDef getPostOptimizationGraph() { - return postOptimizationGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : postOptimizationGraph_; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPostOptimizationGraphOrBuilder() { - return getPostOptimizationGraph(); - } - - 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 { - for (int i = 0; i < partitionGraphs_.size(); i++) { - output.writeMessage(1, partitionGraphs_.get(i)); - } - if (preOptimizationGraph_ != null) { - output.writeMessage(2, getPreOptimizationGraph()); - } - if (postOptimizationGraph_ != null) { - output.writeMessage(3, getPostOptimizationGraph()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < partitionGraphs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, partitionGraphs_.get(i)); - } - if (preOptimizationGraph_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPreOptimizationGraph()); - } - if (postOptimizationGraph_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPostOptimizationGraph()); - } - 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.RunMetadata.FunctionGraphs)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs other = (org.tensorflow.proto.framework.RunMetadata.FunctionGraphs) obj; - - if (!getPartitionGraphsList() - .equals(other.getPartitionGraphsList())) return false; - if (hasPreOptimizationGraph() != other.hasPreOptimizationGraph()) return false; - if (hasPreOptimizationGraph()) { - if (!getPreOptimizationGraph() - .equals(other.getPreOptimizationGraph())) return false; - } - if (hasPostOptimizationGraph() != other.hasPostOptimizationGraph()) return false; - if (hasPostOptimizationGraph()) { - if (!getPostOptimizationGraph() - .equals(other.getPostOptimizationGraph())) 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 (getPartitionGraphsCount() > 0) { - hash = (37 * hash) + PARTITION_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + getPartitionGraphsList().hashCode(); - } - if (hasPreOptimizationGraph()) { - hash = (37 * hash) + PRE_OPTIMIZATION_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + getPreOptimizationGraph().hashCode(); - } - if (hasPostOptimizationGraph()) { - hash = (37 * hash) + POST_OPTIMIZATION_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + getPostOptimizationGraph().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunMetadata.FunctionGraphs) - org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.class, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPartitionGraphsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (partitionGraphsBuilder_ == null) { - partitionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - partitionGraphsBuilder_.clear(); - } - if (preOptimizationGraphBuilder_ == null) { - preOptimizationGraph_ = null; - } else { - preOptimizationGraph_ = null; - preOptimizationGraphBuilder_ = null; - } - if (postOptimizationGraphBuilder_ == null) { - postOptimizationGraph_ = null; - } else { - postOptimizationGraph_ = null; - postOptimizationGraphBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs build() { - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs buildPartial() { - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs result = new org.tensorflow.proto.framework.RunMetadata.FunctionGraphs(this); - int from_bitField0_ = bitField0_; - if (partitionGraphsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.partitionGraphs_ = partitionGraphs_; - } else { - result.partitionGraphs_ = partitionGraphsBuilder_.build(); - } - if (preOptimizationGraphBuilder_ == null) { - result.preOptimizationGraph_ = preOptimizationGraph_; - } else { - result.preOptimizationGraph_ = preOptimizationGraphBuilder_.build(); - } - if (postOptimizationGraphBuilder_ == null) { - result.postOptimizationGraph_ = postOptimizationGraph_; - } else { - result.postOptimizationGraph_ = postOptimizationGraphBuilder_.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.RunMetadata.FunctionGraphs) { - return mergeFrom((org.tensorflow.proto.framework.RunMetadata.FunctionGraphs)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RunMetadata.FunctionGraphs other) { - if (other == org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.getDefaultInstance()) return this; - if (partitionGraphsBuilder_ == null) { - if (!other.partitionGraphs_.isEmpty()) { - if (partitionGraphs_.isEmpty()) { - partitionGraphs_ = other.partitionGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.addAll(other.partitionGraphs_); - } - onChanged(); - } - } else { - if (!other.partitionGraphs_.isEmpty()) { - if (partitionGraphsBuilder_.isEmpty()) { - partitionGraphsBuilder_.dispose(); - partitionGraphsBuilder_ = null; - partitionGraphs_ = other.partitionGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - partitionGraphsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPartitionGraphsFieldBuilder() : null; - } else { - partitionGraphsBuilder_.addAllMessages(other.partitionGraphs_); - } - } - } - if (other.hasPreOptimizationGraph()) { - mergePreOptimizationGraph(other.getPreOptimizationGraph()); - } - if (other.hasPostOptimizationGraph()) { - mergePostOptimizationGraph(other.getPostOptimizationGraph()); - } - 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.RunMetadata.FunctionGraphs parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RunMetadata.FunctionGraphs) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List partitionGraphs_ = - java.util.Collections.emptyList(); - private void ensurePartitionGraphsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - partitionGraphs_ = new java.util.ArrayList(partitionGraphs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> partitionGraphsBuilder_; - - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public java.util.List getPartitionGraphsList() { - if (partitionGraphsBuilder_ == null) { - return java.util.Collections.unmodifiableList(partitionGraphs_); - } else { - return partitionGraphsBuilder_.getMessageList(); - } - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public int getPartitionGraphsCount() { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.size(); - } else { - return partitionGraphsBuilder_.getCount(); - } - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index) { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.get(index); - } else { - return partitionGraphsBuilder_.getMessage(index); - } - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder setPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.set(index, value); - onChanged(); - } else { - partitionGraphsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder setPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.set(index, builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder addPartitionGraphs(org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(value); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder addPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(index, value); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder addPartitionGraphs( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder addPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(index, builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder addAllPartitionGraphs( - java.lang.Iterable values) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, partitionGraphs_); - onChanged(); - } else { - partitionGraphsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder clearPartitionGraphs() { - if (partitionGraphsBuilder_ == null) { - partitionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - partitionGraphsBuilder_.clear(); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public Builder removePartitionGraphs(int index) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.remove(index); - onChanged(); - } else { - partitionGraphsBuilder_.remove(index); - } - return this; - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getPartitionGraphsBuilder( - int index) { - return getPartitionGraphsFieldBuilder().getBuilder(index); - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder( - int index) { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.get(index); } else { - return partitionGraphsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public java.util.List - getPartitionGraphsOrBuilderList() { - if (partitionGraphsBuilder_ != null) { - return partitionGraphsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(partitionGraphs_); - } - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDef.Builder addPartitionGraphsBuilder() { - return getPartitionGraphsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphDef.getDefaultInstance()); - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public org.tensorflow.proto.framework.GraphDef.Builder addPartitionGraphsBuilder( - int index) { - return getPartitionGraphsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphDef.getDefaultInstance()); - } - /** - *
    -       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    -       * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 1; - */ - public java.util.List - getPartitionGraphsBuilderList() { - return getPartitionGraphsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getPartitionGraphsFieldBuilder() { - if (partitionGraphsBuilder_ == null) { - partitionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - partitionGraphs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - partitionGraphs_ = null; - } - return partitionGraphsBuilder_; - } - - private org.tensorflow.proto.framework.GraphDef preOptimizationGraph_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> preOptimizationGraphBuilder_; - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public boolean hasPreOptimizationGraph() { - return preOptimizationGraphBuilder_ != null || preOptimizationGraph_ != null; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public org.tensorflow.proto.framework.GraphDef getPreOptimizationGraph() { - if (preOptimizationGraphBuilder_ == null) { - return preOptimizationGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : preOptimizationGraph_; - } else { - return preOptimizationGraphBuilder_.getMessage(); - } - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public Builder setPreOptimizationGraph(org.tensorflow.proto.framework.GraphDef value) { - if (preOptimizationGraphBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - preOptimizationGraph_ = value; - onChanged(); - } else { - preOptimizationGraphBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public Builder setPreOptimizationGraph( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (preOptimizationGraphBuilder_ == null) { - preOptimizationGraph_ = builderForValue.build(); - onChanged(); - } else { - preOptimizationGraphBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public Builder mergePreOptimizationGraph(org.tensorflow.proto.framework.GraphDef value) { - if (preOptimizationGraphBuilder_ == null) { - if (preOptimizationGraph_ != null) { - preOptimizationGraph_ = - org.tensorflow.proto.framework.GraphDef.newBuilder(preOptimizationGraph_).mergeFrom(value).buildPartial(); - } else { - preOptimizationGraph_ = value; - } - onChanged(); - } else { - preOptimizationGraphBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public Builder clearPreOptimizationGraph() { - if (preOptimizationGraphBuilder_ == null) { - preOptimizationGraph_ = null; - onChanged(); - } else { - preOptimizationGraph_ = null; - preOptimizationGraphBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getPreOptimizationGraphBuilder() { - - onChanged(); - return getPreOptimizationGraphFieldBuilder().getBuilder(); - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPreOptimizationGraphOrBuilder() { - if (preOptimizationGraphBuilder_ != null) { - return preOptimizationGraphBuilder_.getMessageOrBuilder(); - } else { - return preOptimizationGraph_ == null ? - org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : preOptimizationGraph_; - } - } - /** - * .tensorflow.GraphDef pre_optimization_graph = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getPreOptimizationGraphFieldBuilder() { - if (preOptimizationGraphBuilder_ == null) { - preOptimizationGraphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - getPreOptimizationGraph(), - getParentForChildren(), - isClean()); - preOptimizationGraph_ = null; - } - return preOptimizationGraphBuilder_; - } - - private org.tensorflow.proto.framework.GraphDef postOptimizationGraph_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> postOptimizationGraphBuilder_; - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public boolean hasPostOptimizationGraph() { - return postOptimizationGraphBuilder_ != null || postOptimizationGraph_ != null; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public org.tensorflow.proto.framework.GraphDef getPostOptimizationGraph() { - if (postOptimizationGraphBuilder_ == null) { - return postOptimizationGraph_ == null ? org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : postOptimizationGraph_; - } else { - return postOptimizationGraphBuilder_.getMessage(); - } - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public Builder setPostOptimizationGraph(org.tensorflow.proto.framework.GraphDef value) { - if (postOptimizationGraphBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - postOptimizationGraph_ = value; - onChanged(); - } else { - postOptimizationGraphBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public Builder setPostOptimizationGraph( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (postOptimizationGraphBuilder_ == null) { - postOptimizationGraph_ = builderForValue.build(); - onChanged(); - } else { - postOptimizationGraphBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public Builder mergePostOptimizationGraph(org.tensorflow.proto.framework.GraphDef value) { - if (postOptimizationGraphBuilder_ == null) { - if (postOptimizationGraph_ != null) { - postOptimizationGraph_ = - org.tensorflow.proto.framework.GraphDef.newBuilder(postOptimizationGraph_).mergeFrom(value).buildPartial(); - } else { - postOptimizationGraph_ = value; - } - onChanged(); - } else { - postOptimizationGraphBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public Builder clearPostOptimizationGraph() { - if (postOptimizationGraphBuilder_ == null) { - postOptimizationGraph_ = null; - onChanged(); - } else { - postOptimizationGraph_ = null; - postOptimizationGraphBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getPostOptimizationGraphBuilder() { - - onChanged(); - return getPostOptimizationGraphFieldBuilder().getBuilder(); - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPostOptimizationGraphOrBuilder() { - if (postOptimizationGraphBuilder_ != null) { - return postOptimizationGraphBuilder_.getMessageOrBuilder(); - } else { - return postOptimizationGraph_ == null ? - org.tensorflow.proto.framework.GraphDef.getDefaultInstance() : postOptimizationGraph_; - } - } - /** - * .tensorflow.GraphDef post_optimization_graph = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getPostOptimizationGraphFieldBuilder() { - if (postOptimizationGraphBuilder_ == null) { - postOptimizationGraphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - getPostOptimizationGraph(), - getParentForChildren(), - isClean()); - postOptimizationGraph_ = null; - } - return postOptimizationGraphBuilder_; - } - @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.RunMetadata.FunctionGraphs) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunMetadata.FunctionGraphs) - private static final org.tensorflow.proto.framework.RunMetadata.FunctionGraphs DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RunMetadata.FunctionGraphs(); - } - - public static org.tensorflow.proto.framework.RunMetadata.FunctionGraphs getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FunctionGraphs parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new FunctionGraphs(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.RunMetadata.FunctionGraphs getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int STEP_STATS_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.StepStats stepStats_; - /** - *
    -   * Statistics traced for this step. Populated if tracing is turned on via the
    -   * "RunOptions" proto.
    -   * EXPERIMENTAL: The format and set of events may change in future versions.
    -   * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public boolean hasStepStats() { - return stepStats_ != null; - } - /** - *
    -   * Statistics traced for this step. Populated if tracing is turned on via the
    -   * "RunOptions" proto.
    -   * EXPERIMENTAL: The format and set of events may change in future versions.
    -   * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public org.tensorflow.proto.framework.StepStats getStepStats() { - return stepStats_ == null ? org.tensorflow.proto.framework.StepStats.getDefaultInstance() : stepStats_; - } - /** - *
    -   * Statistics traced for this step. Populated if tracing is turned on via the
    -   * "RunOptions" proto.
    -   * EXPERIMENTAL: The format and set of events may change in future versions.
    -   * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public org.tensorflow.proto.framework.StepStatsOrBuilder getStepStatsOrBuilder() { - return getStepStats(); - } - - public static final int COST_GRAPH_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.CostGraphDef costGraph_; - /** - *
    -   * The cost graph for the computation defined by the run call.
    -   * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public boolean hasCostGraph() { - return costGraph_ != null; - } - /** - *
    -   * The cost graph for the computation defined by the run call.
    -   * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef getCostGraph() { - return costGraph_ == null ? org.tensorflow.proto.framework.CostGraphDef.getDefaultInstance() : costGraph_; - } - /** - *
    -   * The cost graph for the computation defined by the run call.
    -   * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public org.tensorflow.proto.framework.CostGraphDefOrBuilder getCostGraphOrBuilder() { - return getCostGraph(); - } - - public static final int PARTITION_GRAPHS_FIELD_NUMBER = 3; - private java.util.List partitionGraphs_; - /** - *
    -   * Graphs of the partitions executed by executors.
    -   * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public java.util.List getPartitionGraphsList() { - return partitionGraphs_; - } - /** - *
    -   * Graphs of the partitions executed by executors.
    -   * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public java.util.List - getPartitionGraphsOrBuilderList() { - return partitionGraphs_; - } - /** - *
    -   * Graphs of the partitions executed by executors.
    -   * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public int getPartitionGraphsCount() { - return partitionGraphs_.size(); - } - /** - *
    -   * Graphs of the partitions executed by executors.
    -   * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index) { - return partitionGraphs_.get(index); - } - /** - *
    -   * Graphs of the partitions executed by executors.
    -   * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder( - int index) { - return partitionGraphs_.get(index); - } - - public static final int FUNCTION_GRAPHS_FIELD_NUMBER = 4; - private java.util.List functionGraphs_; - /** - *
    -   * This is only populated for graphs that are run as functions in TensorFlow
    -   * V2. There will be an entry below for each function that is traced.
    -   * The main use cases of the post_optimization_graph and the partition_graphs
    -   * is to give the caller insight into the graphs that were actually run by the
    -   * runtime. Additional information (such as those in step_stats) will match
    -   * these graphs.
    -   * We also include the pre_optimization_graph since it is usually easier to
    -   * read, and is helpful in situations where the caller wants to get a high
    -   * level idea of what the built graph looks like (since the various graph
    -   * optimization passes might change the structure of the graph significantly).
    -   * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public java.util.List getFunctionGraphsList() { - return functionGraphs_; - } - /** - *
    -   * This is only populated for graphs that are run as functions in TensorFlow
    -   * V2. There will be an entry below for each function that is traced.
    -   * The main use cases of the post_optimization_graph and the partition_graphs
    -   * is to give the caller insight into the graphs that were actually run by the
    -   * runtime. Additional information (such as those in step_stats) will match
    -   * these graphs.
    -   * We also include the pre_optimization_graph since it is usually easier to
    -   * read, and is helpful in situations where the caller wants to get a high
    -   * level idea of what the built graph looks like (since the various graph
    -   * optimization passes might change the structure of the graph significantly).
    -   * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public java.util.List - getFunctionGraphsOrBuilderList() { - return functionGraphs_; - } - /** - *
    -   * This is only populated for graphs that are run as functions in TensorFlow
    -   * V2. There will be an entry below for each function that is traced.
    -   * The main use cases of the post_optimization_graph and the partition_graphs
    -   * is to give the caller insight into the graphs that were actually run by the
    -   * runtime. Additional information (such as those in step_stats) will match
    -   * these graphs.
    -   * We also include the pre_optimization_graph since it is usually easier to
    -   * read, and is helpful in situations where the caller wants to get a high
    -   * level idea of what the built graph looks like (since the various graph
    -   * optimization passes might change the structure of the graph significantly).
    -   * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public int getFunctionGraphsCount() { - return functionGraphs_.size(); - } - /** - *
    -   * This is only populated for graphs that are run as functions in TensorFlow
    -   * V2. There will be an entry below for each function that is traced.
    -   * The main use cases of the post_optimization_graph and the partition_graphs
    -   * is to give the caller insight into the graphs that were actually run by the
    -   * runtime. Additional information (such as those in step_stats) will match
    -   * these graphs.
    -   * We also include the pre_optimization_graph since it is usually easier to
    -   * read, and is helpful in situations where the caller wants to get a high
    -   * level idea of what the built graph looks like (since the various graph
    -   * optimization passes might change the structure of the graph significantly).
    -   * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs getFunctionGraphs(int index) { - return functionGraphs_.get(index); - } - /** - *
    -   * This is only populated for graphs that are run as functions in TensorFlow
    -   * V2. There will be an entry below for each function that is traced.
    -   * The main use cases of the post_optimization_graph and the partition_graphs
    -   * is to give the caller insight into the graphs that were actually run by the
    -   * runtime. Additional information (such as those in step_stats) will match
    -   * these graphs.
    -   * We also include the pre_optimization_graph since it is usually easier to
    -   * read, and is helpful in situations where the caller wants to get a high
    -   * level idea of what the built graph looks like (since the various graph
    -   * optimization passes might change the structure of the graph significantly).
    -   * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder( - int index) { - return functionGraphs_.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 { - if (stepStats_ != null) { - output.writeMessage(1, getStepStats()); - } - if (costGraph_ != null) { - output.writeMessage(2, getCostGraph()); - } - for (int i = 0; i < partitionGraphs_.size(); i++) { - output.writeMessage(3, partitionGraphs_.get(i)); - } - for (int i = 0; i < functionGraphs_.size(); i++) { - output.writeMessage(4, functionGraphs_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (stepStats_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getStepStats()); - } - if (costGraph_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getCostGraph()); - } - for (int i = 0; i < partitionGraphs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, partitionGraphs_.get(i)); - } - for (int i = 0; i < functionGraphs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, functionGraphs_.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.RunMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RunMetadata other = (org.tensorflow.proto.framework.RunMetadata) obj; - - if (hasStepStats() != other.hasStepStats()) return false; - if (hasStepStats()) { - if (!getStepStats() - .equals(other.getStepStats())) return false; - } - if (hasCostGraph() != other.hasCostGraph()) return false; - if (hasCostGraph()) { - if (!getCostGraph() - .equals(other.getCostGraph())) return false; - } - if (!getPartitionGraphsList() - .equals(other.getPartitionGraphsList())) return false; - if (!getFunctionGraphsList() - .equals(other.getFunctionGraphsList())) 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 (hasStepStats()) { - hash = (37 * hash) + STEP_STATS_FIELD_NUMBER; - hash = (53 * hash) + getStepStats().hashCode(); - } - if (hasCostGraph()) { - hash = (37 * hash) + COST_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + getCostGraph().hashCode(); - } - if (getPartitionGraphsCount() > 0) { - hash = (37 * hash) + PARTITION_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + getPartitionGraphsList().hashCode(); - } - if (getFunctionGraphsCount() > 0) { - hash = (37 * hash) + FUNCTION_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + getFunctionGraphsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RunMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata 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.RunMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata 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.RunMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RunMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata 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.RunMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata 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.RunMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunMetadata 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.RunMetadata 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; - } - /** - *
    -   * Metadata output (i.e., non-Tensor) for a single Run() call.
    -   * 
    - * - * Protobuf type {@code tensorflow.RunMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunMetadata) - org.tensorflow.proto.framework.RunMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunMetadata.class, org.tensorflow.proto.framework.RunMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RunMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPartitionGraphsFieldBuilder(); - getFunctionGraphsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (stepStatsBuilder_ == null) { - stepStats_ = null; - } else { - stepStats_ = null; - stepStatsBuilder_ = null; - } - if (costGraphBuilder_ == null) { - costGraph_ = null; - } else { - costGraph_ = null; - costGraphBuilder_ = null; - } - if (partitionGraphsBuilder_ == null) { - partitionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - partitionGraphsBuilder_.clear(); - } - if (functionGraphsBuilder_ == null) { - functionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - functionGraphsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RunMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata build() { - org.tensorflow.proto.framework.RunMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunMetadata buildPartial() { - org.tensorflow.proto.framework.RunMetadata result = new org.tensorflow.proto.framework.RunMetadata(this); - int from_bitField0_ = bitField0_; - if (stepStatsBuilder_ == null) { - result.stepStats_ = stepStats_; - } else { - result.stepStats_ = stepStatsBuilder_.build(); - } - if (costGraphBuilder_ == null) { - result.costGraph_ = costGraph_; - } else { - result.costGraph_ = costGraphBuilder_.build(); - } - if (partitionGraphsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.partitionGraphs_ = partitionGraphs_; - } else { - result.partitionGraphs_ = partitionGraphsBuilder_.build(); - } - if (functionGraphsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - functionGraphs_ = java.util.Collections.unmodifiableList(functionGraphs_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.functionGraphs_ = functionGraphs_; - } else { - result.functionGraphs_ = functionGraphsBuilder_.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.RunMetadata) { - return mergeFrom((org.tensorflow.proto.framework.RunMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RunMetadata other) { - if (other == org.tensorflow.proto.framework.RunMetadata.getDefaultInstance()) return this; - if (other.hasStepStats()) { - mergeStepStats(other.getStepStats()); - } - if (other.hasCostGraph()) { - mergeCostGraph(other.getCostGraph()); - } - if (partitionGraphsBuilder_ == null) { - if (!other.partitionGraphs_.isEmpty()) { - if (partitionGraphs_.isEmpty()) { - partitionGraphs_ = other.partitionGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.addAll(other.partitionGraphs_); - } - onChanged(); - } - } else { - if (!other.partitionGraphs_.isEmpty()) { - if (partitionGraphsBuilder_.isEmpty()) { - partitionGraphsBuilder_.dispose(); - partitionGraphsBuilder_ = null; - partitionGraphs_ = other.partitionGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - partitionGraphsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPartitionGraphsFieldBuilder() : null; - } else { - partitionGraphsBuilder_.addAllMessages(other.partitionGraphs_); - } - } - } - if (functionGraphsBuilder_ == null) { - if (!other.functionGraphs_.isEmpty()) { - if (functionGraphs_.isEmpty()) { - functionGraphs_ = other.functionGraphs_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureFunctionGraphsIsMutable(); - functionGraphs_.addAll(other.functionGraphs_); - } - onChanged(); - } - } else { - if (!other.functionGraphs_.isEmpty()) { - if (functionGraphsBuilder_.isEmpty()) { - functionGraphsBuilder_.dispose(); - functionGraphsBuilder_ = null; - functionGraphs_ = other.functionGraphs_; - bitField0_ = (bitField0_ & ~0x00000002); - functionGraphsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFunctionGraphsFieldBuilder() : null; - } else { - functionGraphsBuilder_.addAllMessages(other.functionGraphs_); - } - } - } - 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.RunMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RunMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.tensorflow.proto.framework.StepStats stepStats_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StepStats, org.tensorflow.proto.framework.StepStats.Builder, org.tensorflow.proto.framework.StepStatsOrBuilder> stepStatsBuilder_; - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public boolean hasStepStats() { - return stepStatsBuilder_ != null || stepStats_ != null; - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public org.tensorflow.proto.framework.StepStats getStepStats() { - if (stepStatsBuilder_ == null) { - return stepStats_ == null ? org.tensorflow.proto.framework.StepStats.getDefaultInstance() : stepStats_; - } else { - return stepStatsBuilder_.getMessage(); - } - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public Builder setStepStats(org.tensorflow.proto.framework.StepStats value) { - if (stepStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - stepStats_ = value; - onChanged(); - } else { - stepStatsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public Builder setStepStats( - org.tensorflow.proto.framework.StepStats.Builder builderForValue) { - if (stepStatsBuilder_ == null) { - stepStats_ = builderForValue.build(); - onChanged(); - } else { - stepStatsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public Builder mergeStepStats(org.tensorflow.proto.framework.StepStats value) { - if (stepStatsBuilder_ == null) { - if (stepStats_ != null) { - stepStats_ = - org.tensorflow.proto.framework.StepStats.newBuilder(stepStats_).mergeFrom(value).buildPartial(); - } else { - stepStats_ = value; - } - onChanged(); - } else { - stepStatsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public Builder clearStepStats() { - if (stepStatsBuilder_ == null) { - stepStats_ = null; - onChanged(); - } else { - stepStats_ = null; - stepStatsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public org.tensorflow.proto.framework.StepStats.Builder getStepStatsBuilder() { - - onChanged(); - return getStepStatsFieldBuilder().getBuilder(); - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - public org.tensorflow.proto.framework.StepStatsOrBuilder getStepStatsOrBuilder() { - if (stepStatsBuilder_ != null) { - return stepStatsBuilder_.getMessageOrBuilder(); - } else { - return stepStats_ == null ? - org.tensorflow.proto.framework.StepStats.getDefaultInstance() : stepStats_; - } - } - /** - *
    -     * Statistics traced for this step. Populated if tracing is turned on via the
    -     * "RunOptions" proto.
    -     * EXPERIMENTAL: The format and set of events may change in future versions.
    -     * 
    - * - * .tensorflow.StepStats step_stats = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StepStats, org.tensorflow.proto.framework.StepStats.Builder, org.tensorflow.proto.framework.StepStatsOrBuilder> - getStepStatsFieldBuilder() { - if (stepStatsBuilder_ == null) { - stepStatsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StepStats, org.tensorflow.proto.framework.StepStats.Builder, org.tensorflow.proto.framework.StepStatsOrBuilder>( - getStepStats(), - getParentForChildren(), - isClean()); - stepStats_ = null; - } - return stepStatsBuilder_; - } - - private org.tensorflow.proto.framework.CostGraphDef costGraph_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef, org.tensorflow.proto.framework.CostGraphDef.Builder, org.tensorflow.proto.framework.CostGraphDefOrBuilder> costGraphBuilder_; - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public boolean hasCostGraph() { - return costGraphBuilder_ != null || costGraph_ != null; - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef getCostGraph() { - if (costGraphBuilder_ == null) { - return costGraph_ == null ? org.tensorflow.proto.framework.CostGraphDef.getDefaultInstance() : costGraph_; - } else { - return costGraphBuilder_.getMessage(); - } - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public Builder setCostGraph(org.tensorflow.proto.framework.CostGraphDef value) { - if (costGraphBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - costGraph_ = value; - onChanged(); - } else { - costGraphBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public Builder setCostGraph( - org.tensorflow.proto.framework.CostGraphDef.Builder builderForValue) { - if (costGraphBuilder_ == null) { - costGraph_ = builderForValue.build(); - onChanged(); - } else { - costGraphBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public Builder mergeCostGraph(org.tensorflow.proto.framework.CostGraphDef value) { - if (costGraphBuilder_ == null) { - if (costGraph_ != null) { - costGraph_ = - org.tensorflow.proto.framework.CostGraphDef.newBuilder(costGraph_).mergeFrom(value).buildPartial(); - } else { - costGraph_ = value; - } - onChanged(); - } else { - costGraphBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public Builder clearCostGraph() { - if (costGraphBuilder_ == null) { - costGraph_ = null; - onChanged(); - } else { - costGraph_ = null; - costGraphBuilder_ = null; - } - - return this; - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public org.tensorflow.proto.framework.CostGraphDef.Builder getCostGraphBuilder() { - - onChanged(); - return getCostGraphFieldBuilder().getBuilder(); - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - public org.tensorflow.proto.framework.CostGraphDefOrBuilder getCostGraphOrBuilder() { - if (costGraphBuilder_ != null) { - return costGraphBuilder_.getMessageOrBuilder(); - } else { - return costGraph_ == null ? - org.tensorflow.proto.framework.CostGraphDef.getDefaultInstance() : costGraph_; - } - } - /** - *
    -     * The cost graph for the computation defined by the run call.
    -     * 
    - * - * .tensorflow.CostGraphDef cost_graph = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef, org.tensorflow.proto.framework.CostGraphDef.Builder, org.tensorflow.proto.framework.CostGraphDefOrBuilder> - getCostGraphFieldBuilder() { - if (costGraphBuilder_ == null) { - costGraphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CostGraphDef, org.tensorflow.proto.framework.CostGraphDef.Builder, org.tensorflow.proto.framework.CostGraphDefOrBuilder>( - getCostGraph(), - getParentForChildren(), - isClean()); - costGraph_ = null; - } - return costGraphBuilder_; - } - - private java.util.List partitionGraphs_ = - java.util.Collections.emptyList(); - private void ensurePartitionGraphsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - partitionGraphs_ = new java.util.ArrayList(partitionGraphs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> partitionGraphsBuilder_; - - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public java.util.List getPartitionGraphsList() { - if (partitionGraphsBuilder_ == null) { - return java.util.Collections.unmodifiableList(partitionGraphs_); - } else { - return partitionGraphsBuilder_.getMessageList(); - } - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public int getPartitionGraphsCount() { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.size(); - } else { - return partitionGraphsBuilder_.getCount(); - } - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index) { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.get(index); - } else { - return partitionGraphsBuilder_.getMessage(index); - } - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder setPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.set(index, value); - onChanged(); - } else { - partitionGraphsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder setPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.set(index, builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder addPartitionGraphs(org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(value); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder addPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef value) { - if (partitionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(index, value); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder addPartitionGraphs( - org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder addPartitionGraphs( - int index, org.tensorflow.proto.framework.GraphDef.Builder builderForValue) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.add(index, builderForValue.build()); - onChanged(); - } else { - partitionGraphsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder addAllPartitionGraphs( - java.lang.Iterable values) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, partitionGraphs_); - onChanged(); - } else { - partitionGraphsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder clearPartitionGraphs() { - if (partitionGraphsBuilder_ == null) { - partitionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - partitionGraphsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public Builder removePartitionGraphs(int index) { - if (partitionGraphsBuilder_ == null) { - ensurePartitionGraphsIsMutable(); - partitionGraphs_.remove(index); - onChanged(); - } else { - partitionGraphsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDef.Builder getPartitionGraphsBuilder( - int index) { - return getPartitionGraphsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder( - int index) { - if (partitionGraphsBuilder_ == null) { - return partitionGraphs_.get(index); } else { - return partitionGraphsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public java.util.List - getPartitionGraphsOrBuilderList() { - if (partitionGraphsBuilder_ != null) { - return partitionGraphsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(partitionGraphs_); - } - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDef.Builder addPartitionGraphsBuilder() { - return getPartitionGraphsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.GraphDef.getDefaultInstance()); - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public org.tensorflow.proto.framework.GraphDef.Builder addPartitionGraphsBuilder( - int index) { - return getPartitionGraphsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.GraphDef.getDefaultInstance()); - } - /** - *
    -     * Graphs of the partitions executed by executors.
    -     * 
    - * - * repeated .tensorflow.GraphDef partition_graphs = 3; - */ - public java.util.List - getPartitionGraphsBuilderList() { - return getPartitionGraphsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder> - getPartitionGraphsFieldBuilder() { - if (partitionGraphsBuilder_ == null) { - partitionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.GraphDef, org.tensorflow.proto.framework.GraphDef.Builder, org.tensorflow.proto.framework.GraphDefOrBuilder>( - partitionGraphs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - partitionGraphs_ = null; - } - return partitionGraphsBuilder_; - } - - private java.util.List functionGraphs_ = - java.util.Collections.emptyList(); - private void ensureFunctionGraphsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - functionGraphs_ = new java.util.ArrayList(functionGraphs_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder> functionGraphsBuilder_; - - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public java.util.List getFunctionGraphsList() { - if (functionGraphsBuilder_ == null) { - return java.util.Collections.unmodifiableList(functionGraphs_); - } else { - return functionGraphsBuilder_.getMessageList(); - } - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public int getFunctionGraphsCount() { - if (functionGraphsBuilder_ == null) { - return functionGraphs_.size(); - } else { - return functionGraphsBuilder_.getCount(); - } - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs getFunctionGraphs(int index) { - if (functionGraphsBuilder_ == null) { - return functionGraphs_.get(index); - } else { - return functionGraphsBuilder_.getMessage(index); - } - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder setFunctionGraphs( - int index, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs value) { - if (functionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionGraphsIsMutable(); - functionGraphs_.set(index, value); - onChanged(); - } else { - functionGraphsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder setFunctionGraphs( - int index, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder builderForValue) { - if (functionGraphsBuilder_ == null) { - ensureFunctionGraphsIsMutable(); - functionGraphs_.set(index, builderForValue.build()); - onChanged(); - } else { - functionGraphsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder addFunctionGraphs(org.tensorflow.proto.framework.RunMetadata.FunctionGraphs value) { - if (functionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionGraphsIsMutable(); - functionGraphs_.add(value); - onChanged(); - } else { - functionGraphsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder addFunctionGraphs( - int index, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs value) { - if (functionGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFunctionGraphsIsMutable(); - functionGraphs_.add(index, value); - onChanged(); - } else { - functionGraphsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder addFunctionGraphs( - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder builderForValue) { - if (functionGraphsBuilder_ == null) { - ensureFunctionGraphsIsMutable(); - functionGraphs_.add(builderForValue.build()); - onChanged(); - } else { - functionGraphsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder addFunctionGraphs( - int index, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder builderForValue) { - if (functionGraphsBuilder_ == null) { - ensureFunctionGraphsIsMutable(); - functionGraphs_.add(index, builderForValue.build()); - onChanged(); - } else { - functionGraphsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder addAllFunctionGraphs( - java.lang.Iterable values) { - if (functionGraphsBuilder_ == null) { - ensureFunctionGraphsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, functionGraphs_); - onChanged(); - } else { - functionGraphsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder clearFunctionGraphs() { - if (functionGraphsBuilder_ == null) { - functionGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - functionGraphsBuilder_.clear(); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public Builder removeFunctionGraphs(int index) { - if (functionGraphsBuilder_ == null) { - ensureFunctionGraphsIsMutable(); - functionGraphs_.remove(index); - onChanged(); - } else { - functionGraphsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder getFunctionGraphsBuilder( - int index) { - return getFunctionGraphsFieldBuilder().getBuilder(index); - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder( - int index) { - if (functionGraphsBuilder_ == null) { - return functionGraphs_.get(index); } else { - return functionGraphsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public java.util.List - getFunctionGraphsOrBuilderList() { - if (functionGraphsBuilder_ != null) { - return functionGraphsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(functionGraphs_); - } - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder addFunctionGraphsBuilder() { - return getFunctionGraphsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.getDefaultInstance()); - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder addFunctionGraphsBuilder( - int index) { - return getFunctionGraphsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.getDefaultInstance()); - } - /** - *
    -     * This is only populated for graphs that are run as functions in TensorFlow
    -     * V2. There will be an entry below for each function that is traced.
    -     * The main use cases of the post_optimization_graph and the partition_graphs
    -     * is to give the caller insight into the graphs that were actually run by the
    -     * runtime. Additional information (such as those in step_stats) will match
    -     * these graphs.
    -     * We also include the pre_optimization_graph since it is usually easier to
    -     * read, and is helpful in situations where the caller wants to get a high
    -     * level idea of what the built graph looks like (since the various graph
    -     * optimization passes might change the structure of the graph significantly).
    -     * 
    - * - * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; - */ - public java.util.List - getFunctionGraphsBuilderList() { - return getFunctionGraphsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder> - getFunctionGraphsFieldBuilder() { - if (functionGraphsBuilder_ == null) { - functionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.RunMetadata.FunctionGraphs, org.tensorflow.proto.framework.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder>( - functionGraphs_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - functionGraphs_ = null; - } - return functionGraphsBuilder_; - } - @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.RunMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunMetadata) - private static final org.tensorflow.proto.framework.RunMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RunMetadata(); - } - - public static org.tensorflow.proto.framework.RunMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RunMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RunMetadata(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.RunMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptions.java deleted file mode 100644 index 9ccdb06d2b6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptions.java +++ /dev/null @@ -1,2708 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Options for a single Run() call.
    - * 
    - * - * Protobuf type {@code tensorflow.RunOptions} - */ -public final class RunOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunOptions) - RunOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use RunOptions.newBuilder() to construct. - private RunOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RunOptions() { - traceLevel_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RunOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RunOptions( - 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: { - int rawValue = input.readEnum(); - - traceLevel_ = rawValue; - break; - } - case 16: { - - timeoutInMs_ = input.readInt64(); - break; - } - case 24: { - - interOpThreadPool_ = input.readInt32(); - break; - } - case 40: { - - outputPartitionGraphs_ = input.readBool(); - break; - } - case 50: { - org.tensorflow.proto.framework.DebugOptions.Builder subBuilder = null; - if (debugOptions_ != null) { - subBuilder = debugOptions_.toBuilder(); - } - debugOptions_ = input.readMessage(org.tensorflow.proto.framework.DebugOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(debugOptions_); - debugOptions_ = subBuilder.buildPartial(); - } - - break; - } - case 56: { - - reportTensorAllocationsUponOom_ = input.readBool(); - break; - } - case 66: { - org.tensorflow.proto.framework.RunOptions.Experimental.Builder subBuilder = null; - if (experimental_ != null) { - subBuilder = experimental_.toBuilder(); - } - experimental_ = input.readMessage(org.tensorflow.proto.framework.RunOptions.Experimental.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(experimental_); - experimental_ = subBuilder.buildPartial(); - } - - 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.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.class, org.tensorflow.proto.framework.RunOptions.Builder.class); - } - - /** - *
    -   * TODO(pbar) Turn this into a TraceOptions proto which allows
    -   * tracing to be controlled in a more orthogonal manner?
    -   * 
    - * - * Protobuf enum {@code tensorflow.RunOptions.TraceLevel} - */ - public enum TraceLevel - implements com.google.protobuf.ProtocolMessageEnum { - /** - * NO_TRACE = 0; - */ - NO_TRACE(0), - /** - * SOFTWARE_TRACE = 1; - */ - SOFTWARE_TRACE(1), - /** - * HARDWARE_TRACE = 2; - */ - HARDWARE_TRACE(2), - /** - * FULL_TRACE = 3; - */ - FULL_TRACE(3), - UNRECOGNIZED(-1), - ; - - /** - * NO_TRACE = 0; - */ - public static final int NO_TRACE_VALUE = 0; - /** - * SOFTWARE_TRACE = 1; - */ - public static final int SOFTWARE_TRACE_VALUE = 1; - /** - * HARDWARE_TRACE = 2; - */ - public static final int HARDWARE_TRACE_VALUE = 2; - /** - * FULL_TRACE = 3; - */ - public static final int FULL_TRACE_VALUE = 3; - - - 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 TraceLevel valueOf(int value) { - return forNumber(value); - } - - public static TraceLevel forNumber(int value) { - switch (value) { - case 0: return NO_TRACE; - case 1: return SOFTWARE_TRACE; - case 2: return HARDWARE_TRACE; - case 3: return FULL_TRACE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - TraceLevel> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public TraceLevel findValueByNumber(int number) { - return TraceLevel.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.RunOptions.getDescriptor().getEnumTypes().get(0); - } - - private static final TraceLevel[] VALUES = values(); - - public static TraceLevel 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 TraceLevel(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.RunOptions.TraceLevel) - } - - public interface ExperimentalOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions.Experimental) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * If non-zero, declares that this graph is going to use collective
    -     * ops and must synchronize step_ids with any other graph with this
    -     * same group_key value (in a distributed computation where tasks
    -     * run disjoint graphs).
    -     * 
    - * - * int64 collective_graph_key = 1; - */ - long getCollectiveGraphKey(); - - /** - *
    -     * If true, then operations (using the inter-op pool) across all
    -     * session::run() calls will be centrally scheduled, optimizing for (median
    -     * and tail) latency.
    -     * Consider using this option for CPU-bound workloads like inference.
    -     * 
    - * - * bool use_run_handler_pool = 2; - */ - boolean getUseRunHandlerPool(); - - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - boolean hasRunHandlerPoolOptions(); - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions(); - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder(); - } - /** - *
    -   * Everything inside Experimental is subject to change and is not subject
    -   * to API stability guarantees in
    -   * https://www.tensorflow.org/guide/version_compat.
    -   * 
    - * - * Protobuf type {@code tensorflow.RunOptions.Experimental} - */ - public static final class Experimental extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunOptions.Experimental) - ExperimentalOrBuilder { - private static final long serialVersionUID = 0L; - // Use Experimental.newBuilder() to construct. - private Experimental(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Experimental() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Experimental(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Experimental( - 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: { - - collectiveGraphKey_ = input.readInt64(); - break; - } - case 16: { - - useRunHandlerPool_ = input.readBool(); - break; - } - case 26: { - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder subBuilder = null; - if (runHandlerPoolOptions_ != null) { - subBuilder = runHandlerPoolOptions_.toBuilder(); - } - runHandlerPoolOptions_ = input.readMessage(org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(runHandlerPoolOptions_); - runHandlerPoolOptions_ = subBuilder.buildPartial(); - } - - 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.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.Experimental.class, org.tensorflow.proto.framework.RunOptions.Experimental.Builder.class); - } - - public interface RunHandlerPoolOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * Priority of the request. The run handler thread pool will schedule ops
    -       * based on the priority number. The larger number means higher priority.
    -       * 
    - * - * int64 priority = 1; - */ - long getPriority(); - } - /** - *
    -     * Options for run handler thread pool.
    -     * 
    - * - * Protobuf type {@code tensorflow.RunOptions.Experimental.RunHandlerPoolOptions} - */ - public static final class RunHandlerPoolOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) - RunHandlerPoolOptionsOrBuilder { - private static final long serialVersionUID = 0L; - // Use RunHandlerPoolOptions.newBuilder() to construct. - private RunHandlerPoolOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RunHandlerPoolOptions() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RunHandlerPoolOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RunHandlerPoolOptions( - 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: { - - priority_ = 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.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.class, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder.class); - } - - public static final int PRIORITY_FIELD_NUMBER = 1; - private long priority_; - /** - *
    -       * Priority of the request. The run handler thread pool will schedule ops
    -       * based on the priority number. The larger number means higher priority.
    -       * 
    - * - * int64 priority = 1; - */ - public long getPriority() { - return priority_; - } - - 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 (priority_ != 0L) { - output.writeInt64(1, priority_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (priority_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, priority_); - } - 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.RunOptions.Experimental.RunHandlerPoolOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions other = (org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions) obj; - - if (getPriority() - != other.getPriority()) 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) + PRIORITY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPriority()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions 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 run handler thread pool.
    -       * 
    - * - * Protobuf type {@code tensorflow.RunOptions.Experimental.RunHandlerPoolOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.class, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.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(); - priority_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions build() { - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions buildPartial() { - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions result = new org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions(this); - result.priority_ = priority_; - 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.RunOptions.Experimental.RunHandlerPoolOptions) { - return mergeFrom((org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions other) { - if (other == org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance()) return this; - if (other.getPriority() != 0L) { - setPriority(other.getPriority()); - } - 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.RunOptions.Experimental.RunHandlerPoolOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long priority_ ; - /** - *
    -         * Priority of the request. The run handler thread pool will schedule ops
    -         * based on the priority number. The larger number means higher priority.
    -         * 
    - * - * int64 priority = 1; - */ - public long getPriority() { - return priority_; - } - /** - *
    -         * Priority of the request. The run handler thread pool will schedule ops
    -         * based on the priority number. The larger number means higher priority.
    -         * 
    - * - * int64 priority = 1; - */ - public Builder setPriority(long value) { - - priority_ = value; - onChanged(); - return this; - } - /** - *
    -         * Priority of the request. The run handler thread pool will schedule ops
    -         * based on the priority number. The larger number means higher priority.
    -         * 
    - * - * int64 priority = 1; - */ - public Builder clearPriority() { - - priority_ = 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.RunOptions.Experimental.RunHandlerPoolOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) - private static final org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions(); - } - - public static org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RunHandlerPoolOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RunHandlerPoolOptions(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.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int COLLECTIVE_GRAPH_KEY_FIELD_NUMBER = 1; - private long collectiveGraphKey_; - /** - *
    -     * If non-zero, declares that this graph is going to use collective
    -     * ops and must synchronize step_ids with any other graph with this
    -     * same group_key value (in a distributed computation where tasks
    -     * run disjoint graphs).
    -     * 
    - * - * int64 collective_graph_key = 1; - */ - public long getCollectiveGraphKey() { - return collectiveGraphKey_; - } - - public static final int USE_RUN_HANDLER_POOL_FIELD_NUMBER = 2; - private boolean useRunHandlerPool_; - /** - *
    -     * If true, then operations (using the inter-op pool) across all
    -     * session::run() calls will be centrally scheduled, optimizing for (median
    -     * and tail) latency.
    -     * Consider using this option for CPU-bound workloads like inference.
    -     * 
    - * - * bool use_run_handler_pool = 2; - */ - public boolean getUseRunHandlerPool() { - return useRunHandlerPool_; - } - - public static final int RUN_HANDLER_POOL_OPTIONS_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions runHandlerPoolOptions_; - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public boolean hasRunHandlerPoolOptions() { - return runHandlerPoolOptions_ != null; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions() { - return runHandlerPoolOptions_ == null ? org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder() { - return getRunHandlerPoolOptions(); - } - - 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 (collectiveGraphKey_ != 0L) { - output.writeInt64(1, collectiveGraphKey_); - } - if (useRunHandlerPool_ != false) { - output.writeBool(2, useRunHandlerPool_); - } - if (runHandlerPoolOptions_ != null) { - output.writeMessage(3, getRunHandlerPoolOptions()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (collectiveGraphKey_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, collectiveGraphKey_); - } - if (useRunHandlerPool_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, useRunHandlerPool_); - } - if (runHandlerPoolOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getRunHandlerPoolOptions()); - } - 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.RunOptions.Experimental)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RunOptions.Experimental other = (org.tensorflow.proto.framework.RunOptions.Experimental) obj; - - if (getCollectiveGraphKey() - != other.getCollectiveGraphKey()) return false; - if (getUseRunHandlerPool() - != other.getUseRunHandlerPool()) return false; - if (hasRunHandlerPoolOptions() != other.hasRunHandlerPoolOptions()) return false; - if (hasRunHandlerPoolOptions()) { - if (!getRunHandlerPoolOptions() - .equals(other.getRunHandlerPoolOptions())) 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) + COLLECTIVE_GRAPH_KEY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getCollectiveGraphKey()); - hash = (37 * hash) + USE_RUN_HANDLER_POOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseRunHandlerPool()); - if (hasRunHandlerPoolOptions()) { - hash = (37 * hash) + RUN_HANDLER_POOL_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getRunHandlerPoolOptions().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RunOptions.Experimental parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental 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.RunOptions.Experimental parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental 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.RunOptions.Experimental parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental 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.RunOptions.Experimental parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental 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.RunOptions.Experimental parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions.Experimental 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.RunOptions.Experimental 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; - } - /** - *
    -     * Everything inside Experimental is subject to change and is not subject
    -     * to API stability guarantees in
    -     * https://www.tensorflow.org/guide/version_compat.
    -     * 
    - * - * Protobuf type {@code tensorflow.RunOptions.Experimental} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions.Experimental) - org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.Experimental.class, org.tensorflow.proto.framework.RunOptions.Experimental.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RunOptions.Experimental.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(); - collectiveGraphKey_ = 0L; - - useRunHandlerPool_ = false; - - if (runHandlerPoolOptionsBuilder_ == null) { - runHandlerPoolOptions_ = null; - } else { - runHandlerPoolOptions_ = null; - runHandlerPoolOptionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RunOptions.Experimental.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental build() { - org.tensorflow.proto.framework.RunOptions.Experimental result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions.Experimental buildPartial() { - org.tensorflow.proto.framework.RunOptions.Experimental result = new org.tensorflow.proto.framework.RunOptions.Experimental(this); - result.collectiveGraphKey_ = collectiveGraphKey_; - result.useRunHandlerPool_ = useRunHandlerPool_; - if (runHandlerPoolOptionsBuilder_ == null) { - result.runHandlerPoolOptions_ = runHandlerPoolOptions_; - } else { - result.runHandlerPoolOptions_ = runHandlerPoolOptionsBuilder_.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.RunOptions.Experimental) { - return mergeFrom((org.tensorflow.proto.framework.RunOptions.Experimental)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RunOptions.Experimental other) { - if (other == org.tensorflow.proto.framework.RunOptions.Experimental.getDefaultInstance()) return this; - if (other.getCollectiveGraphKey() != 0L) { - setCollectiveGraphKey(other.getCollectiveGraphKey()); - } - if (other.getUseRunHandlerPool() != false) { - setUseRunHandlerPool(other.getUseRunHandlerPool()); - } - if (other.hasRunHandlerPoolOptions()) { - mergeRunHandlerPoolOptions(other.getRunHandlerPoolOptions()); - } - 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.RunOptions.Experimental parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RunOptions.Experimental) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long collectiveGraphKey_ ; - /** - *
    -       * If non-zero, declares that this graph is going to use collective
    -       * ops and must synchronize step_ids with any other graph with this
    -       * same group_key value (in a distributed computation where tasks
    -       * run disjoint graphs).
    -       * 
    - * - * int64 collective_graph_key = 1; - */ - public long getCollectiveGraphKey() { - return collectiveGraphKey_; - } - /** - *
    -       * If non-zero, declares that this graph is going to use collective
    -       * ops and must synchronize step_ids with any other graph with this
    -       * same group_key value (in a distributed computation where tasks
    -       * run disjoint graphs).
    -       * 
    - * - * int64 collective_graph_key = 1; - */ - public Builder setCollectiveGraphKey(long value) { - - collectiveGraphKey_ = value; - onChanged(); - return this; - } - /** - *
    -       * If non-zero, declares that this graph is going to use collective
    -       * ops and must synchronize step_ids with any other graph with this
    -       * same group_key value (in a distributed computation where tasks
    -       * run disjoint graphs).
    -       * 
    - * - * int64 collective_graph_key = 1; - */ - public Builder clearCollectiveGraphKey() { - - collectiveGraphKey_ = 0L; - onChanged(); - return this; - } - - private boolean useRunHandlerPool_ ; - /** - *
    -       * If true, then operations (using the inter-op pool) across all
    -       * session::run() calls will be centrally scheduled, optimizing for (median
    -       * and tail) latency.
    -       * Consider using this option for CPU-bound workloads like inference.
    -       * 
    - * - * bool use_run_handler_pool = 2; - */ - public boolean getUseRunHandlerPool() { - return useRunHandlerPool_; - } - /** - *
    -       * If true, then operations (using the inter-op pool) across all
    -       * session::run() calls will be centrally scheduled, optimizing for (median
    -       * and tail) latency.
    -       * Consider using this option for CPU-bound workloads like inference.
    -       * 
    - * - * bool use_run_handler_pool = 2; - */ - public Builder setUseRunHandlerPool(boolean value) { - - useRunHandlerPool_ = value; - onChanged(); - return this; - } - /** - *
    -       * If true, then operations (using the inter-op pool) across all
    -       * session::run() calls will be centrally scheduled, optimizing for (median
    -       * and tail) latency.
    -       * Consider using this option for CPU-bound workloads like inference.
    -       * 
    - * - * bool use_run_handler_pool = 2; - */ - public Builder clearUseRunHandlerPool() { - - useRunHandlerPool_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions runHandlerPoolOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder> runHandlerPoolOptionsBuilder_; - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public boolean hasRunHandlerPoolOptions() { - return runHandlerPoolOptionsBuilder_ != null || runHandlerPoolOptions_ != null; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions() { - if (runHandlerPoolOptionsBuilder_ == null) { - return runHandlerPoolOptions_ == null ? org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; - } else { - return runHandlerPoolOptionsBuilder_.getMessage(); - } - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public Builder setRunHandlerPoolOptions(org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions value) { - if (runHandlerPoolOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - runHandlerPoolOptions_ = value; - onChanged(); - } else { - runHandlerPoolOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public Builder setRunHandlerPoolOptions( - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder builderForValue) { - if (runHandlerPoolOptionsBuilder_ == null) { - runHandlerPoolOptions_ = builderForValue.build(); - onChanged(); - } else { - runHandlerPoolOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public Builder mergeRunHandlerPoolOptions(org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions value) { - if (runHandlerPoolOptionsBuilder_ == null) { - if (runHandlerPoolOptions_ != null) { - runHandlerPoolOptions_ = - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.newBuilder(runHandlerPoolOptions_).mergeFrom(value).buildPartial(); - } else { - runHandlerPoolOptions_ = value; - } - onChanged(); - } else { - runHandlerPoolOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public Builder clearRunHandlerPoolOptions() { - if (runHandlerPoolOptionsBuilder_ == null) { - runHandlerPoolOptions_ = null; - onChanged(); - } else { - runHandlerPoolOptions_ = null; - runHandlerPoolOptionsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder getRunHandlerPoolOptionsBuilder() { - - onChanged(); - return getRunHandlerPoolOptionsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder() { - if (runHandlerPoolOptionsBuilder_ != null) { - return runHandlerPoolOptionsBuilder_.getMessageOrBuilder(); - } else { - return runHandlerPoolOptions_ == null ? - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; - } - } - /** - * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder> - getRunHandlerPoolOptionsFieldBuilder() { - if (runHandlerPoolOptionsBuilder_ == null) { - runHandlerPoolOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.framework.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder>( - getRunHandlerPoolOptions(), - getParentForChildren(), - isClean()); - runHandlerPoolOptions_ = null; - } - return runHandlerPoolOptionsBuilder_; - } - @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.RunOptions.Experimental) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunOptions.Experimental) - private static final org.tensorflow.proto.framework.RunOptions.Experimental DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RunOptions.Experimental(); - } - - public static org.tensorflow.proto.framework.RunOptions.Experimental getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Experimental parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Experimental(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.RunOptions.Experimental getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int TRACE_LEVEL_FIELD_NUMBER = 1; - private int traceLevel_; - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public int getTraceLevelValue() { - return traceLevel_; - } - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public org.tensorflow.proto.framework.RunOptions.TraceLevel getTraceLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RunOptions.TraceLevel result = org.tensorflow.proto.framework.RunOptions.TraceLevel.valueOf(traceLevel_); - return result == null ? org.tensorflow.proto.framework.RunOptions.TraceLevel.UNRECOGNIZED : result; - } - - public static final int TIMEOUT_IN_MS_FIELD_NUMBER = 2; - private long timeoutInMs_; - /** - *
    -   * Time to wait for operation to complete in milliseconds.
    -   * 
    - * - * int64 timeout_in_ms = 2; - */ - public long getTimeoutInMs() { - return timeoutInMs_; - } - - public static final int INTER_OP_THREAD_POOL_FIELD_NUMBER = 3; - private int interOpThreadPool_; - /** - *
    -   * The thread pool to use, if session_inter_op_thread_pool is configured.
    -   * To use the caller thread set this to -1 - this uses the caller thread
    -   * to execute Session::Run() and thus avoids a context switch. Using the
    -   * caller thread to execute Session::Run() should be done ONLY for simple
    -   * graphs, where the overhead of an additional context switch is
    -   * comparable with the overhead of Session::Run().
    -   * 
    - * - * int32 inter_op_thread_pool = 3; - */ - public int getInterOpThreadPool() { - return interOpThreadPool_; - } - - public static final int OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER = 5; - private boolean outputPartitionGraphs_; - /** - *
    -   * Whether the partition graph(s) executed by the executor(s) should be
    -   * outputted via RunMetadata.
    -   * 
    - * - * bool output_partition_graphs = 5; - */ - public boolean getOutputPartitionGraphs() { - return outputPartitionGraphs_; - } - - public static final int DEBUG_OPTIONS_FIELD_NUMBER = 6; - private org.tensorflow.proto.framework.DebugOptions debugOptions_; - /** - *
    -   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -   * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public boolean hasDebugOptions() { - return debugOptions_ != null; - } - /** - *
    -   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -   * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public org.tensorflow.proto.framework.DebugOptions getDebugOptions() { - return debugOptions_ == null ? org.tensorflow.proto.framework.DebugOptions.getDefaultInstance() : debugOptions_; - } - /** - *
    -   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -   * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public org.tensorflow.proto.framework.DebugOptionsOrBuilder getDebugOptionsOrBuilder() { - return getDebugOptions(); - } - - public static final int REPORT_TENSOR_ALLOCATIONS_UPON_OOM_FIELD_NUMBER = 7; - private boolean reportTensorAllocationsUponOom_; - /** - *
    -   * When enabled, causes tensor allocation information to be included in
    -   * the error message when the Run() call fails because the allocator ran
    -   * out of memory (OOM).
    -   * Enabling this option can slow down the Run() call.
    -   * 
    - * - * bool report_tensor_allocations_upon_oom = 7; - */ - public boolean getReportTensorAllocationsUponOom() { - return reportTensorAllocationsUponOom_; - } - - public static final int EXPERIMENTAL_FIELD_NUMBER = 8; - private org.tensorflow.proto.framework.RunOptions.Experimental experimental_; - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public boolean hasExperimental() { - return experimental_ != null; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental getExperimental() { - return experimental_ == null ? org.tensorflow.proto.framework.RunOptions.Experimental.getDefaultInstance() : experimental_; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { - return getExperimental(); - } - - 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 (traceLevel_ != org.tensorflow.proto.framework.RunOptions.TraceLevel.NO_TRACE.getNumber()) { - output.writeEnum(1, traceLevel_); - } - if (timeoutInMs_ != 0L) { - output.writeInt64(2, timeoutInMs_); - } - if (interOpThreadPool_ != 0) { - output.writeInt32(3, interOpThreadPool_); - } - if (outputPartitionGraphs_ != false) { - output.writeBool(5, outputPartitionGraphs_); - } - if (debugOptions_ != null) { - output.writeMessage(6, getDebugOptions()); - } - if (reportTensorAllocationsUponOom_ != false) { - output.writeBool(7, reportTensorAllocationsUponOom_); - } - if (experimental_ != null) { - output.writeMessage(8, getExperimental()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (traceLevel_ != org.tensorflow.proto.framework.RunOptions.TraceLevel.NO_TRACE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, traceLevel_); - } - if (timeoutInMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, timeoutInMs_); - } - if (interOpThreadPool_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, interOpThreadPool_); - } - if (outputPartitionGraphs_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, outputPartitionGraphs_); - } - if (debugOptions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getDebugOptions()); - } - if (reportTensorAllocationsUponOom_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, reportTensorAllocationsUponOom_); - } - if (experimental_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getExperimental()); - } - 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.RunOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.RunOptions other = (org.tensorflow.proto.framework.RunOptions) obj; - - if (traceLevel_ != other.traceLevel_) return false; - if (getTimeoutInMs() - != other.getTimeoutInMs()) return false; - if (getInterOpThreadPool() - != other.getInterOpThreadPool()) return false; - if (getOutputPartitionGraphs() - != other.getOutputPartitionGraphs()) return false; - if (hasDebugOptions() != other.hasDebugOptions()) return false; - if (hasDebugOptions()) { - if (!getDebugOptions() - .equals(other.getDebugOptions())) return false; - } - if (getReportTensorAllocationsUponOom() - != other.getReportTensorAllocationsUponOom()) return false; - if (hasExperimental() != other.hasExperimental()) return false; - if (hasExperimental()) { - if (!getExperimental() - .equals(other.getExperimental())) 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) + TRACE_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + traceLevel_; - hash = (37 * hash) + TIMEOUT_IN_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimeoutInMs()); - hash = (37 * hash) + INTER_OP_THREAD_POOL_FIELD_NUMBER; - hash = (53 * hash) + getInterOpThreadPool(); - hash = (37 * hash) + OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getOutputPartitionGraphs()); - if (hasDebugOptions()) { - hash = (37 * hash) + DEBUG_OPTIONS_FIELD_NUMBER; - hash = (53 * hash) + getDebugOptions().hashCode(); - } - hash = (37 * hash) + REPORT_TENSOR_ALLOCATIONS_UPON_OOM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getReportTensorAllocationsUponOom()); - if (hasExperimental()) { - hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; - hash = (53 * hash) + getExperimental().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.RunOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions 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.RunOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions 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.RunOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.RunOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.RunOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions 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.RunOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions 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.RunOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.RunOptions 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.RunOptions 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 a single Run() call.
    -   * 
    - * - * Protobuf type {@code tensorflow.RunOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions) - org.tensorflow.proto.framework.RunOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.RunOptions.class, org.tensorflow.proto.framework.RunOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.RunOptions.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(); - traceLevel_ = 0; - - timeoutInMs_ = 0L; - - interOpThreadPool_ = 0; - - outputPartitionGraphs_ = false; - - if (debugOptionsBuilder_ == null) { - debugOptions_ = null; - } else { - debugOptions_ = null; - debugOptionsBuilder_ = null; - } - reportTensorAllocationsUponOom_ = false; - - if (experimentalBuilder_ == null) { - experimental_ = null; - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.RunOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions build() { - org.tensorflow.proto.framework.RunOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.RunOptions buildPartial() { - org.tensorflow.proto.framework.RunOptions result = new org.tensorflow.proto.framework.RunOptions(this); - result.traceLevel_ = traceLevel_; - result.timeoutInMs_ = timeoutInMs_; - result.interOpThreadPool_ = interOpThreadPool_; - result.outputPartitionGraphs_ = outputPartitionGraphs_; - if (debugOptionsBuilder_ == null) { - result.debugOptions_ = debugOptions_; - } else { - result.debugOptions_ = debugOptionsBuilder_.build(); - } - result.reportTensorAllocationsUponOom_ = reportTensorAllocationsUponOom_; - if (experimentalBuilder_ == null) { - result.experimental_ = experimental_; - } else { - result.experimental_ = experimentalBuilder_.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.RunOptions) { - return mergeFrom((org.tensorflow.proto.framework.RunOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.RunOptions other) { - if (other == org.tensorflow.proto.framework.RunOptions.getDefaultInstance()) return this; - if (other.traceLevel_ != 0) { - setTraceLevelValue(other.getTraceLevelValue()); - } - if (other.getTimeoutInMs() != 0L) { - setTimeoutInMs(other.getTimeoutInMs()); - } - if (other.getInterOpThreadPool() != 0) { - setInterOpThreadPool(other.getInterOpThreadPool()); - } - if (other.getOutputPartitionGraphs() != false) { - setOutputPartitionGraphs(other.getOutputPartitionGraphs()); - } - if (other.hasDebugOptions()) { - mergeDebugOptions(other.getDebugOptions()); - } - if (other.getReportTensorAllocationsUponOom() != false) { - setReportTensorAllocationsUponOom(other.getReportTensorAllocationsUponOom()); - } - if (other.hasExperimental()) { - mergeExperimental(other.getExperimental()); - } - 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.RunOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.RunOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int traceLevel_ = 0; - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public int getTraceLevelValue() { - return traceLevel_; - } - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public Builder setTraceLevelValue(int value) { - traceLevel_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public org.tensorflow.proto.framework.RunOptions.TraceLevel getTraceLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.RunOptions.TraceLevel result = org.tensorflow.proto.framework.RunOptions.TraceLevel.valueOf(traceLevel_); - return result == null ? org.tensorflow.proto.framework.RunOptions.TraceLevel.UNRECOGNIZED : result; - } - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public Builder setTraceLevel(org.tensorflow.proto.framework.RunOptions.TraceLevel value) { - if (value == null) { - throw new NullPointerException(); - } - - traceLevel_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.RunOptions.TraceLevel trace_level = 1; - */ - public Builder clearTraceLevel() { - - traceLevel_ = 0; - onChanged(); - return this; - } - - private long timeoutInMs_ ; - /** - *
    -     * Time to wait for operation to complete in milliseconds.
    -     * 
    - * - * int64 timeout_in_ms = 2; - */ - public long getTimeoutInMs() { - return timeoutInMs_; - } - /** - *
    -     * Time to wait for operation to complete in milliseconds.
    -     * 
    - * - * int64 timeout_in_ms = 2; - */ - public Builder setTimeoutInMs(long value) { - - timeoutInMs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Time to wait for operation to complete in milliseconds.
    -     * 
    - * - * int64 timeout_in_ms = 2; - */ - public Builder clearTimeoutInMs() { - - timeoutInMs_ = 0L; - onChanged(); - return this; - } - - private int interOpThreadPool_ ; - /** - *
    -     * The thread pool to use, if session_inter_op_thread_pool is configured.
    -     * To use the caller thread set this to -1 - this uses the caller thread
    -     * to execute Session::Run() and thus avoids a context switch. Using the
    -     * caller thread to execute Session::Run() should be done ONLY for simple
    -     * graphs, where the overhead of an additional context switch is
    -     * comparable with the overhead of Session::Run().
    -     * 
    - * - * int32 inter_op_thread_pool = 3; - */ - public int getInterOpThreadPool() { - return interOpThreadPool_; - } - /** - *
    -     * The thread pool to use, if session_inter_op_thread_pool is configured.
    -     * To use the caller thread set this to -1 - this uses the caller thread
    -     * to execute Session::Run() and thus avoids a context switch. Using the
    -     * caller thread to execute Session::Run() should be done ONLY for simple
    -     * graphs, where the overhead of an additional context switch is
    -     * comparable with the overhead of Session::Run().
    -     * 
    - * - * int32 inter_op_thread_pool = 3; - */ - public Builder setInterOpThreadPool(int value) { - - interOpThreadPool_ = value; - onChanged(); - return this; - } - /** - *
    -     * The thread pool to use, if session_inter_op_thread_pool is configured.
    -     * To use the caller thread set this to -1 - this uses the caller thread
    -     * to execute Session::Run() and thus avoids a context switch. Using the
    -     * caller thread to execute Session::Run() should be done ONLY for simple
    -     * graphs, where the overhead of an additional context switch is
    -     * comparable with the overhead of Session::Run().
    -     * 
    - * - * int32 inter_op_thread_pool = 3; - */ - public Builder clearInterOpThreadPool() { - - interOpThreadPool_ = 0; - onChanged(); - return this; - } - - private boolean outputPartitionGraphs_ ; - /** - *
    -     * Whether the partition graph(s) executed by the executor(s) should be
    -     * outputted via RunMetadata.
    -     * 
    - * - * bool output_partition_graphs = 5; - */ - public boolean getOutputPartitionGraphs() { - return outputPartitionGraphs_; - } - /** - *
    -     * Whether the partition graph(s) executed by the executor(s) should be
    -     * outputted via RunMetadata.
    -     * 
    - * - * bool output_partition_graphs = 5; - */ - public Builder setOutputPartitionGraphs(boolean value) { - - outputPartitionGraphs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether the partition graph(s) executed by the executor(s) should be
    -     * outputted via RunMetadata.
    -     * 
    - * - * bool output_partition_graphs = 5; - */ - public Builder clearOutputPartitionGraphs() { - - outputPartitionGraphs_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.DebugOptions debugOptions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DebugOptions, org.tensorflow.proto.framework.DebugOptions.Builder, org.tensorflow.proto.framework.DebugOptionsOrBuilder> debugOptionsBuilder_; - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public boolean hasDebugOptions() { - return debugOptionsBuilder_ != null || debugOptions_ != null; - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public org.tensorflow.proto.framework.DebugOptions getDebugOptions() { - if (debugOptionsBuilder_ == null) { - return debugOptions_ == null ? org.tensorflow.proto.framework.DebugOptions.getDefaultInstance() : debugOptions_; - } else { - return debugOptionsBuilder_.getMessage(); - } - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public Builder setDebugOptions(org.tensorflow.proto.framework.DebugOptions value) { - if (debugOptionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - debugOptions_ = value; - onChanged(); - } else { - debugOptionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public Builder setDebugOptions( - org.tensorflow.proto.framework.DebugOptions.Builder builderForValue) { - if (debugOptionsBuilder_ == null) { - debugOptions_ = builderForValue.build(); - onChanged(); - } else { - debugOptionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public Builder mergeDebugOptions(org.tensorflow.proto.framework.DebugOptions value) { - if (debugOptionsBuilder_ == null) { - if (debugOptions_ != null) { - debugOptions_ = - org.tensorflow.proto.framework.DebugOptions.newBuilder(debugOptions_).mergeFrom(value).buildPartial(); - } else { - debugOptions_ = value; - } - onChanged(); - } else { - debugOptionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public Builder clearDebugOptions() { - if (debugOptionsBuilder_ == null) { - debugOptions_ = null; - onChanged(); - } else { - debugOptions_ = null; - debugOptionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public org.tensorflow.proto.framework.DebugOptions.Builder getDebugOptionsBuilder() { - - onChanged(); - return getDebugOptionsFieldBuilder().getBuilder(); - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - public org.tensorflow.proto.framework.DebugOptionsOrBuilder getDebugOptionsOrBuilder() { - if (debugOptionsBuilder_ != null) { - return debugOptionsBuilder_.getMessageOrBuilder(); - } else { - return debugOptions_ == null ? - org.tensorflow.proto.framework.DebugOptions.getDefaultInstance() : debugOptions_; - } - } - /** - *
    -     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    -     * 
    - * - * .tensorflow.DebugOptions debug_options = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DebugOptions, org.tensorflow.proto.framework.DebugOptions.Builder, org.tensorflow.proto.framework.DebugOptionsOrBuilder> - getDebugOptionsFieldBuilder() { - if (debugOptionsBuilder_ == null) { - debugOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DebugOptions, org.tensorflow.proto.framework.DebugOptions.Builder, org.tensorflow.proto.framework.DebugOptionsOrBuilder>( - getDebugOptions(), - getParentForChildren(), - isClean()); - debugOptions_ = null; - } - return debugOptionsBuilder_; - } - - private boolean reportTensorAllocationsUponOom_ ; - /** - *
    -     * When enabled, causes tensor allocation information to be included in
    -     * the error message when the Run() call fails because the allocator ran
    -     * out of memory (OOM).
    -     * Enabling this option can slow down the Run() call.
    -     * 
    - * - * bool report_tensor_allocations_upon_oom = 7; - */ - public boolean getReportTensorAllocationsUponOom() { - return reportTensorAllocationsUponOom_; - } - /** - *
    -     * When enabled, causes tensor allocation information to be included in
    -     * the error message when the Run() call fails because the allocator ran
    -     * out of memory (OOM).
    -     * Enabling this option can slow down the Run() call.
    -     * 
    - * - * bool report_tensor_allocations_upon_oom = 7; - */ - public Builder setReportTensorAllocationsUponOom(boolean value) { - - reportTensorAllocationsUponOom_ = value; - onChanged(); - return this; - } - /** - *
    -     * When enabled, causes tensor allocation information to be included in
    -     * the error message when the Run() call fails because the allocator ran
    -     * out of memory (OOM).
    -     * Enabling this option can slow down the Run() call.
    -     * 
    - * - * bool report_tensor_allocations_upon_oom = 7; - */ - public Builder clearReportTensorAllocationsUponOom() { - - reportTensorAllocationsUponOom_ = false; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.RunOptions.Experimental experimental_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental, org.tensorflow.proto.framework.RunOptions.Experimental.Builder, org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder> experimentalBuilder_; - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public boolean hasExperimental() { - return experimentalBuilder_ != null || experimental_ != null; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental getExperimental() { - if (experimentalBuilder_ == null) { - return experimental_ == null ? org.tensorflow.proto.framework.RunOptions.Experimental.getDefaultInstance() : experimental_; - } else { - return experimentalBuilder_.getMessage(); - } - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public Builder setExperimental(org.tensorflow.proto.framework.RunOptions.Experimental value) { - if (experimentalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - experimental_ = value; - onChanged(); - } else { - experimentalBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public Builder setExperimental( - org.tensorflow.proto.framework.RunOptions.Experimental.Builder builderForValue) { - if (experimentalBuilder_ == null) { - experimental_ = builderForValue.build(); - onChanged(); - } else { - experimentalBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public Builder mergeExperimental(org.tensorflow.proto.framework.RunOptions.Experimental value) { - if (experimentalBuilder_ == null) { - if (experimental_ != null) { - experimental_ = - org.tensorflow.proto.framework.RunOptions.Experimental.newBuilder(experimental_).mergeFrom(value).buildPartial(); - } else { - experimental_ = value; - } - onChanged(); - } else { - experimentalBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public Builder clearExperimental() { - if (experimentalBuilder_ == null) { - experimental_ = null; - onChanged(); - } else { - experimental_ = null; - experimentalBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public org.tensorflow.proto.framework.RunOptions.Experimental.Builder getExperimentalBuilder() { - - onChanged(); - return getExperimentalFieldBuilder().getBuilder(); - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - public org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { - if (experimentalBuilder_ != null) { - return experimentalBuilder_.getMessageOrBuilder(); - } else { - return experimental_ == null ? - org.tensorflow.proto.framework.RunOptions.Experimental.getDefaultInstance() : experimental_; - } - } - /** - * .tensorflow.RunOptions.Experimental experimental = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental, org.tensorflow.proto.framework.RunOptions.Experimental.Builder, org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder> - getExperimentalFieldBuilder() { - if (experimentalBuilder_ == null) { - experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.RunOptions.Experimental, org.tensorflow.proto.framework.RunOptions.Experimental.Builder, org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder>( - getExperimental(), - getParentForChildren(), - isClean()); - experimental_ = null; - } - return experimentalBuilder_; - } - @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.RunOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunOptions) - private static final org.tensorflow.proto.framework.RunOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.RunOptions(); - } - - public static org.tensorflow.proto.framework.RunOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RunOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RunOptions(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.RunOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDef.java deleted file mode 100644 index 3cf8b1b4b12..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDef.java +++ /dev/null @@ -1,1175 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/variable.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SaveSliceInfoDef} - */ -public final class SaveSliceInfoDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SaveSliceInfoDef) - SaveSliceInfoDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use SaveSliceInfoDef.newBuilder() to construct. - private SaveSliceInfoDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SaveSliceInfoDef() { - fullName_ = ""; - fullShape_ = emptyLongList(); - varOffset_ = emptyLongList(); - varShape_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SaveSliceInfoDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SaveSliceInfoDef( - 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(); - - fullName_ = s; - break; - } - case 16: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - fullShape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - fullShape_.addLong(input.readInt64()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - fullShape_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - fullShape_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 24: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - varOffset_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - varOffset_.addLong(input.readInt64()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - varOffset_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - varOffset_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 32: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - varShape_ = newLongList(); - mutable_bitField0_ |= 0x00000004; - } - varShape_.addLong(input.readInt64()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - varShape_ = newLongList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - varShape_.addLong(input.readInt64()); - } - input.popLimit(limit); - 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)) { - fullShape_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - varOffset_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - varShape_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SaveSliceInfoDef.class, org.tensorflow.proto.framework.SaveSliceInfoDef.Builder.class); - } - - public static final int FULL_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object fullName_; - /** - *
    -   * Name of the full variable of which this is a slice.
    -   * 
    - * - * string full_name = 1; - */ - public java.lang.String getFullName() { - java.lang.Object ref = fullName_; - 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(); - fullName_ = s; - return s; - } - } - /** - *
    -   * Name of the full variable of which this is a slice.
    -   * 
    - * - * string full_name = 1; - */ - public com.google.protobuf.ByteString - getFullNameBytes() { - java.lang.Object ref = fullName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fullName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FULL_SHAPE_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.LongList fullShape_; - /** - *
    -   * Shape of the full variable.
    -   * 
    - * - * repeated int64 full_shape = 2; - */ - public java.util.List - getFullShapeList() { - return fullShape_; - } - /** - *
    -   * Shape of the full variable.
    -   * 
    - * - * repeated int64 full_shape = 2; - */ - public int getFullShapeCount() { - return fullShape_.size(); - } - /** - *
    -   * Shape of the full variable.
    -   * 
    - * - * repeated int64 full_shape = 2; - */ - public long getFullShape(int index) { - return fullShape_.getLong(index); - } - private int fullShapeMemoizedSerializedSize = -1; - - public static final int VAR_OFFSET_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.LongList varOffset_; - /** - *
    -   * Offset of this variable into the full variable.
    -   * 
    - * - * repeated int64 var_offset = 3; - */ - public java.util.List - getVarOffsetList() { - return varOffset_; - } - /** - *
    -   * Offset of this variable into the full variable.
    -   * 
    - * - * repeated int64 var_offset = 3; - */ - public int getVarOffsetCount() { - return varOffset_.size(); - } - /** - *
    -   * Offset of this variable into the full variable.
    -   * 
    - * - * repeated int64 var_offset = 3; - */ - public long getVarOffset(int index) { - return varOffset_.getLong(index); - } - private int varOffsetMemoizedSerializedSize = -1; - - public static final int VAR_SHAPE_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.LongList varShape_; - /** - *
    -   * Shape of this variable.
    -   * 
    - * - * repeated int64 var_shape = 4; - */ - public java.util.List - getVarShapeList() { - return varShape_; - } - /** - *
    -   * Shape of this variable.
    -   * 
    - * - * repeated int64 var_shape = 4; - */ - public int getVarShapeCount() { - return varShape_.size(); - } - /** - *
    -   * Shape of this variable.
    -   * 
    - * - * repeated int64 var_shape = 4; - */ - public long getVarShape(int index) { - return varShape_.getLong(index); - } - private int varShapeMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (!getFullNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fullName_); - } - if (getFullShapeList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(fullShapeMemoizedSerializedSize); - } - for (int i = 0; i < fullShape_.size(); i++) { - output.writeInt64NoTag(fullShape_.getLong(i)); - } - if (getVarOffsetList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(varOffsetMemoizedSerializedSize); - } - for (int i = 0; i < varOffset_.size(); i++) { - output.writeInt64NoTag(varOffset_.getLong(i)); - } - if (getVarShapeList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(varShapeMemoizedSerializedSize); - } - for (int i = 0; i < varShape_.size(); i++) { - output.writeInt64NoTag(varShape_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getFullNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fullName_); - } - { - int dataSize = 0; - for (int i = 0; i < fullShape_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(fullShape_.getLong(i)); - } - size += dataSize; - if (!getFullShapeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - fullShapeMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < varOffset_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(varOffset_.getLong(i)); - } - size += dataSize; - if (!getVarOffsetList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - varOffsetMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < varShape_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(varShape_.getLong(i)); - } - size += dataSize; - if (!getVarShapeList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - varShapeMemoizedSerializedSize = dataSize; - } - 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.SaveSliceInfoDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SaveSliceInfoDef other = (org.tensorflow.proto.framework.SaveSliceInfoDef) obj; - - if (!getFullName() - .equals(other.getFullName())) return false; - if (!getFullShapeList() - .equals(other.getFullShapeList())) return false; - if (!getVarOffsetList() - .equals(other.getVarOffsetList())) return false; - if (!getVarShapeList() - .equals(other.getVarShapeList())) 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) + FULL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getFullName().hashCode(); - if (getFullShapeCount() > 0) { - hash = (37 * hash) + FULL_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getFullShapeList().hashCode(); - } - if (getVarOffsetCount() > 0) { - hash = (37 * hash) + VAR_OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getVarOffsetList().hashCode(); - } - if (getVarShapeCount() > 0) { - hash = (37 * hash) + VAR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getVarShapeList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SaveSliceInfoDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef 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.SaveSliceInfoDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef 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.SaveSliceInfoDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef 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.SaveSliceInfoDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef 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.SaveSliceInfoDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveSliceInfoDef 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.SaveSliceInfoDef 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.SaveSliceInfoDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SaveSliceInfoDef) - org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SaveSliceInfoDef.class, org.tensorflow.proto.framework.SaveSliceInfoDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SaveSliceInfoDef.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(); - fullName_ = ""; - - fullShape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - varOffset_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - varShape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveSliceInfoDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SaveSliceInfoDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveSliceInfoDef build() { - org.tensorflow.proto.framework.SaveSliceInfoDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveSliceInfoDef buildPartial() { - org.tensorflow.proto.framework.SaveSliceInfoDef result = new org.tensorflow.proto.framework.SaveSliceInfoDef(this); - int from_bitField0_ = bitField0_; - result.fullName_ = fullName_; - if (((bitField0_ & 0x00000001) != 0)) { - fullShape_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.fullShape_ = fullShape_; - if (((bitField0_ & 0x00000002) != 0)) { - varOffset_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.varOffset_ = varOffset_; - if (((bitField0_ & 0x00000004) != 0)) { - varShape_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.varShape_ = varShape_; - 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.SaveSliceInfoDef) { - return mergeFrom((org.tensorflow.proto.framework.SaveSliceInfoDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SaveSliceInfoDef other) { - if (other == org.tensorflow.proto.framework.SaveSliceInfoDef.getDefaultInstance()) return this; - if (!other.getFullName().isEmpty()) { - fullName_ = other.fullName_; - onChanged(); - } - if (!other.fullShape_.isEmpty()) { - if (fullShape_.isEmpty()) { - fullShape_ = other.fullShape_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFullShapeIsMutable(); - fullShape_.addAll(other.fullShape_); - } - onChanged(); - } - if (!other.varOffset_.isEmpty()) { - if (varOffset_.isEmpty()) { - varOffset_ = other.varOffset_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureVarOffsetIsMutable(); - varOffset_.addAll(other.varOffset_); - } - onChanged(); - } - if (!other.varShape_.isEmpty()) { - if (varShape_.isEmpty()) { - varShape_ = other.varShape_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureVarShapeIsMutable(); - varShape_.addAll(other.varShape_); - } - onChanged(); - } - 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.SaveSliceInfoDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SaveSliceInfoDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object fullName_ = ""; - /** - *
    -     * Name of the full variable of which this is a slice.
    -     * 
    - * - * string full_name = 1; - */ - public java.lang.String getFullName() { - java.lang.Object ref = fullName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fullName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the full variable of which this is a slice.
    -     * 
    - * - * string full_name = 1; - */ - public com.google.protobuf.ByteString - getFullNameBytes() { - java.lang.Object ref = fullName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fullName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the full variable of which this is a slice.
    -     * 
    - * - * string full_name = 1; - */ - public Builder setFullName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fullName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the full variable of which this is a slice.
    -     * 
    - * - * string full_name = 1; - */ - public Builder clearFullName() { - - fullName_ = getDefaultInstance().getFullName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the full variable of which this is a slice.
    -     * 
    - * - * string full_name = 1; - */ - public Builder setFullNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fullName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList fullShape_ = emptyLongList(); - private void ensureFullShapeIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - fullShape_ = mutableCopy(fullShape_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public java.util.List - getFullShapeList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(fullShape_) : fullShape_; - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public int getFullShapeCount() { - return fullShape_.size(); - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public long getFullShape(int index) { - return fullShape_.getLong(index); - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public Builder setFullShape( - int index, long value) { - ensureFullShapeIsMutable(); - fullShape_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public Builder addFullShape(long value) { - ensureFullShapeIsMutable(); - fullShape_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public Builder addAllFullShape( - java.lang.Iterable values) { - ensureFullShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fullShape_); - onChanged(); - return this; - } - /** - *
    -     * Shape of the full variable.
    -     * 
    - * - * repeated int64 full_shape = 2; - */ - public Builder clearFullShape() { - fullShape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList varOffset_ = emptyLongList(); - private void ensureVarOffsetIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - varOffset_ = mutableCopy(varOffset_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public java.util.List - getVarOffsetList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(varOffset_) : varOffset_; - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public int getVarOffsetCount() { - return varOffset_.size(); - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public long getVarOffset(int index) { - return varOffset_.getLong(index); - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public Builder setVarOffset( - int index, long value) { - ensureVarOffsetIsMutable(); - varOffset_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public Builder addVarOffset(long value) { - ensureVarOffsetIsMutable(); - varOffset_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public Builder addAllVarOffset( - java.lang.Iterable values) { - ensureVarOffsetIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, varOffset_); - onChanged(); - return this; - } - /** - *
    -     * Offset of this variable into the full variable.
    -     * 
    - * - * repeated int64 var_offset = 3; - */ - public Builder clearVarOffset() { - varOffset_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList varShape_ = emptyLongList(); - private void ensureVarShapeIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - varShape_ = mutableCopy(varShape_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public java.util.List - getVarShapeList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(varShape_) : varShape_; - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public int getVarShapeCount() { - return varShape_.size(); - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public long getVarShape(int index) { - return varShape_.getLong(index); - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public Builder setVarShape( - int index, long value) { - ensureVarShapeIsMutable(); - varShape_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public Builder addVarShape(long value) { - ensureVarShapeIsMutable(); - varShape_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public Builder addAllVarShape( - java.lang.Iterable values) { - ensureVarShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, varShape_); - onChanged(); - return this; - } - /** - *
    -     * Shape of this variable.
    -     * 
    - * - * repeated int64 var_shape = 4; - */ - public Builder clearVarShape() { - varShape_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000004); - 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.SaveSliceInfoDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SaveSliceInfoDef) - private static final org.tensorflow.proto.framework.SaveSliceInfoDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SaveSliceInfoDef(); - } - - public static org.tensorflow.proto.framework.SaveSliceInfoDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SaveSliceInfoDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SaveSliceInfoDef(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.SaveSliceInfoDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObject.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObject.java deleted file mode 100644 index c2b8ae241d9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObject.java +++ /dev/null @@ -1,549 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SaveableObject} - */ -public final class SaveableObject extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SaveableObject) - SaveableObjectOrBuilder { -private static final long serialVersionUID = 0L; - // Use SaveableObject.newBuilder() to construct. - private SaveableObject(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SaveableObject() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SaveableObject(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SaveableObject( - 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 16: { - - saveFunction_ = input.readInt32(); - break; - } - case 24: { - - restoreFunction_ = input.readInt32(); - 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.SavedObjectGraphProtos.internal_static_tensorflow_SaveableObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SaveableObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SaveableObject.class, org.tensorflow.proto.framework.SaveableObject.Builder.class); - } - - public static final int SAVE_FUNCTION_FIELD_NUMBER = 2; - private int saveFunction_; - /** - *
    -   * Node ids of concrete functions for saving and loading from a checkpoint.
    -   * 
    - * - * int32 save_function = 2; - */ - public int getSaveFunction() { - return saveFunction_; - } - - public static final int RESTORE_FUNCTION_FIELD_NUMBER = 3; - private int restoreFunction_; - /** - * int32 restore_function = 3; - */ - public int getRestoreFunction() { - return restoreFunction_; - } - - 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 (saveFunction_ != 0) { - output.writeInt32(2, saveFunction_); - } - if (restoreFunction_ != 0) { - output.writeInt32(3, restoreFunction_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (saveFunction_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, saveFunction_); - } - if (restoreFunction_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, restoreFunction_); - } - 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.SaveableObject)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SaveableObject other = (org.tensorflow.proto.framework.SaveableObject) obj; - - if (getSaveFunction() - != other.getSaveFunction()) return false; - if (getRestoreFunction() - != other.getRestoreFunction()) 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) + SAVE_FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getSaveFunction(); - hash = (37 * hash) + RESTORE_FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getRestoreFunction(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SaveableObject parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveableObject 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.SaveableObject parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveableObject 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.SaveableObject parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SaveableObject parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SaveableObject parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveableObject 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.SaveableObject parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveableObject 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.SaveableObject parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SaveableObject 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.SaveableObject 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.SaveableObject} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SaveableObject) - org.tensorflow.proto.framework.SaveableObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SaveableObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SaveableObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SaveableObject.class, org.tensorflow.proto.framework.SaveableObject.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SaveableObject.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(); - saveFunction_ = 0; - - restoreFunction_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SaveableObject_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveableObject getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SaveableObject.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveableObject build() { - org.tensorflow.proto.framework.SaveableObject result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SaveableObject buildPartial() { - org.tensorflow.proto.framework.SaveableObject result = new org.tensorflow.proto.framework.SaveableObject(this); - result.saveFunction_ = saveFunction_; - result.restoreFunction_ = restoreFunction_; - 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.SaveableObject) { - return mergeFrom((org.tensorflow.proto.framework.SaveableObject)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SaveableObject other) { - if (other == org.tensorflow.proto.framework.SaveableObject.getDefaultInstance()) return this; - if (other.getSaveFunction() != 0) { - setSaveFunction(other.getSaveFunction()); - } - if (other.getRestoreFunction() != 0) { - setRestoreFunction(other.getRestoreFunction()); - } - 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.SaveableObject parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SaveableObject) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int saveFunction_ ; - /** - *
    -     * Node ids of concrete functions for saving and loading from a checkpoint.
    -     * 
    - * - * int32 save_function = 2; - */ - public int getSaveFunction() { - return saveFunction_; - } - /** - *
    -     * Node ids of concrete functions for saving and loading from a checkpoint.
    -     * 
    - * - * int32 save_function = 2; - */ - public Builder setSaveFunction(int value) { - - saveFunction_ = value; - onChanged(); - return this; - } - /** - *
    -     * Node ids of concrete functions for saving and loading from a checkpoint.
    -     * 
    - * - * int32 save_function = 2; - */ - public Builder clearSaveFunction() { - - saveFunction_ = 0; - onChanged(); - return this; - } - - private int restoreFunction_ ; - /** - * int32 restore_function = 3; - */ - public int getRestoreFunction() { - return restoreFunction_; - } - /** - * int32 restore_function = 3; - */ - public Builder setRestoreFunction(int value) { - - restoreFunction_ = value; - onChanged(); - return this; - } - /** - * int32 restore_function = 3; - */ - public Builder clearRestoreFunction() { - - restoreFunction_ = 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.SaveableObject) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SaveableObject) - private static final org.tensorflow.proto.framework.SaveableObject DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SaveableObject(); - } - - public static org.tensorflow.proto.framework.SaveableObject getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SaveableObject parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SaveableObject(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.SaveableObject getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObjectOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObjectOrBuilder.java deleted file mode 100644 index 896dcfa8b34..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveableObjectOrBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SaveableObjectOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SaveableObject) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Node ids of concrete functions for saving and loading from a checkpoint.
    -   * 
    - * - * int32 save_function = 2; - */ - int getSaveFunction(); - - /** - * int32 restore_function = 3; - */ - int getRestoreFunction(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAsset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAsset.java deleted file mode 100644 index 2558719f7c3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAsset.java +++ /dev/null @@ -1,514 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A SavedAsset points to an asset in the MetaGraph.
    - * When bound to a function this object evaluates to a tensor with the absolute
    - * filename. Users should not depend on a particular part of the filename to
    - * remain stable (e.g. basename could be changed).
    - * 
    - * - * Protobuf type {@code tensorflow.SavedAsset} - */ -public final class SavedAsset extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedAsset) - SavedAssetOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedAsset.newBuilder() to construct. - private SavedAsset(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedAsset() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedAsset(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedAsset( - 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: { - - assetFileDefIndex_ = input.readInt32(); - 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.SavedObjectGraphProtos.internal_static_tensorflow_SavedAsset_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedAsset_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedAsset.class, org.tensorflow.proto.framework.SavedAsset.Builder.class); - } - - public static final int ASSET_FILE_DEF_INDEX_FIELD_NUMBER = 1; - private int assetFileDefIndex_; - /** - *
    -   * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    -   * Only the field `AssetFileDef.filename` is used. Other fields, such as
    -   * `AssetFileDef.tensor_info`, MUST be ignored.
    -   * 
    - * - * int32 asset_file_def_index = 1; - */ - public int getAssetFileDefIndex() { - return assetFileDefIndex_; - } - - 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 (assetFileDefIndex_ != 0) { - output.writeInt32(1, assetFileDefIndex_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (assetFileDefIndex_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, assetFileDefIndex_); - } - 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.SavedAsset)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedAsset other = (org.tensorflow.proto.framework.SavedAsset) obj; - - if (getAssetFileDefIndex() - != other.getAssetFileDefIndex()) 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) + ASSET_FILE_DEF_INDEX_FIELD_NUMBER; - hash = (53 * hash) + getAssetFileDefIndex(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedAsset parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedAsset 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.SavedAsset parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedAsset 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.SavedAsset parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedAsset parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedAsset parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedAsset 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.SavedAsset parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedAsset 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.SavedAsset parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedAsset 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.SavedAsset 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 SavedAsset points to an asset in the MetaGraph.
    -   * When bound to a function this object evaluates to a tensor with the absolute
    -   * filename. Users should not depend on a particular part of the filename to
    -   * remain stable (e.g. basename could be changed).
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedAsset} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedAsset) - org.tensorflow.proto.framework.SavedAssetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedAsset_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedAsset_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedAsset.class, org.tensorflow.proto.framework.SavedAsset.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedAsset.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(); - assetFileDefIndex_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedAsset_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedAsset getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedAsset build() { - org.tensorflow.proto.framework.SavedAsset result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedAsset buildPartial() { - org.tensorflow.proto.framework.SavedAsset result = new org.tensorflow.proto.framework.SavedAsset(this); - result.assetFileDefIndex_ = assetFileDefIndex_; - 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.SavedAsset) { - return mergeFrom((org.tensorflow.proto.framework.SavedAsset)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedAsset other) { - if (other == org.tensorflow.proto.framework.SavedAsset.getDefaultInstance()) return this; - if (other.getAssetFileDefIndex() != 0) { - setAssetFileDefIndex(other.getAssetFileDefIndex()); - } - 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.SavedAsset parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedAsset) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int assetFileDefIndex_ ; - /** - *
    -     * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    -     * Only the field `AssetFileDef.filename` is used. Other fields, such as
    -     * `AssetFileDef.tensor_info`, MUST be ignored.
    -     * 
    - * - * int32 asset_file_def_index = 1; - */ - public int getAssetFileDefIndex() { - return assetFileDefIndex_; - } - /** - *
    -     * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    -     * Only the field `AssetFileDef.filename` is used. Other fields, such as
    -     * `AssetFileDef.tensor_info`, MUST be ignored.
    -     * 
    - * - * int32 asset_file_def_index = 1; - */ - public Builder setAssetFileDefIndex(int value) { - - assetFileDefIndex_ = value; - onChanged(); - return this; - } - /** - *
    -     * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    -     * Only the field `AssetFileDef.filename` is used. Other fields, such as
    -     * `AssetFileDef.tensor_info`, MUST be ignored.
    -     * 
    - * - * int32 asset_file_def_index = 1; - */ - public Builder clearAssetFileDefIndex() { - - assetFileDefIndex_ = 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.SavedAsset) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedAsset) - private static final org.tensorflow.proto.framework.SavedAsset DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedAsset(); - } - - public static org.tensorflow.proto.framework.SavedAsset getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedAsset parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedAsset(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.SavedAsset getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAssetOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAssetOrBuilder.java deleted file mode 100644 index a12a5ff6ad0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedAssetOrBuilder.java +++ /dev/null @@ -1,20 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedAssetOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedAsset) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    -   * Only the field `AssetFileDef.filename` is used. Other fields, such as
    -   * `AssetFileDef.tensor_info`, MUST be ignored.
    -   * 
    - * - * int32 asset_file_def_index = 1; - */ - int getAssetFileDefIndex(); -} 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 deleted file mode 100644 index 84ac9936dcd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunction.java +++ /dev/null @@ -1,1162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SavedBareConcreteFunction} - */ -public final class SavedBareConcreteFunction extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedBareConcreteFunction) - SavedBareConcreteFunctionOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedBareConcreteFunction.newBuilder() to construct. - private SavedBareConcreteFunction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedBareConcreteFunction() { - concreteFunctionName_ = ""; - argumentKeywords_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedBareConcreteFunction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedBareConcreteFunction( - 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(); - - concreteFunctionName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - argumentKeywords_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - argumentKeywords_.add(s); - break; - } - case 24: { - - 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)) { - 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)) { - argumentKeywords_ = argumentKeywords_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedBareConcreteFunction.class, org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder.class); - } - - public static final int CONCRETE_FUNCTION_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object concreteFunctionName_; - /** - *
    -   * Identifies a SavedConcreteFunction.
    -   * 
    - * - * string concrete_function_name = 1; - */ - public java.lang.String getConcreteFunctionName() { - java.lang.Object ref = concreteFunctionName_; - 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(); - concreteFunctionName_ = s; - return s; - } - } - /** - *
    -   * Identifies a SavedConcreteFunction.
    -   * 
    - * - * string concrete_function_name = 1; - */ - public com.google.protobuf.ByteString - getConcreteFunctionNameBytes() { - java.lang.Object ref = concreteFunctionName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - concreteFunctionName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ARGUMENT_KEYWORDS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList argumentKeywords_; - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - public com.google.protobuf.ProtocolStringList - getArgumentKeywordsList() { - return argumentKeywords_; - } - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - public int getArgumentKeywordsCount() { - return argumentKeywords_.size(); - } - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - public java.lang.String getArgumentKeywords(int index) { - return argumentKeywords_.get(index); - } - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - public com.google.protobuf.ByteString - getArgumentKeywordsBytes(int index) { - return argumentKeywords_.getByteString(index); - } - - public static final int ALLOWED_POSITIONAL_ARGUMENTS_FIELD_NUMBER = 3; - private long allowedPositionalArguments_; - /** - *
    -   * The prefix of `argument_keywords` which may be identified by position.
    -   * 
    - * - * int64 allowed_positional_arguments = 3; - */ - 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() { - 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 (!getConcreteFunctionNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, concreteFunctionName_); - } - for (int i = 0; i < argumentKeywords_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, argumentKeywords_.getRaw(i)); - } - if (allowedPositionalArguments_ != 0L) { - output.writeInt64(3, allowedPositionalArguments_); - } - if (functionSpec_ != null) { - output.writeMessage(4, getFunctionSpec()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getConcreteFunctionNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, concreteFunctionName_); - } - { - int dataSize = 0; - for (int i = 0; i < argumentKeywords_.size(); i++) { - dataSize += computeStringSizeNoTag(argumentKeywords_.getRaw(i)); - } - size += dataSize; - size += 1 * getArgumentKeywordsList().size(); - } - if (allowedPositionalArguments_ != 0L) { - 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; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.SavedBareConcreteFunction)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedBareConcreteFunction other = (org.tensorflow.proto.framework.SavedBareConcreteFunction) obj; - - if (!getConcreteFunctionName() - .equals(other.getConcreteFunctionName())) return false; - if (!getArgumentKeywordsList() - .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; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONCRETE_FUNCTION_NAME_FIELD_NUMBER; - hash = (53 * hash) + getConcreteFunctionName().hashCode(); - if (getArgumentKeywordsCount() > 0) { - hash = (37 * hash) + ARGUMENT_KEYWORDS_FIELD_NUMBER; - hash = (53 * hash) + getArgumentKeywordsList().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; - } - - public static org.tensorflow.proto.framework.SavedBareConcreteFunction parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction 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.SavedBareConcreteFunction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction 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.SavedBareConcreteFunction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction 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.SavedBareConcreteFunction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction 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.SavedBareConcreteFunction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedBareConcreteFunction 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.SavedBareConcreteFunction 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.SavedBareConcreteFunction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedBareConcreteFunction) - org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedBareConcreteFunction.class, org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedBareConcreteFunction.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(); - concreteFunctionName_ = ""; - - argumentKeywords_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - allowedPositionalArguments_ = 0L; - - if (functionSpecBuilder_ == null) { - functionSpec_ = null; - } else { - functionSpec_ = null; - functionSpecBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedBareConcreteFunction getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedBareConcreteFunction build() { - org.tensorflow.proto.framework.SavedBareConcreteFunction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedBareConcreteFunction buildPartial() { - org.tensorflow.proto.framework.SavedBareConcreteFunction result = new org.tensorflow.proto.framework.SavedBareConcreteFunction(this); - int from_bitField0_ = bitField0_; - result.concreteFunctionName_ = concreteFunctionName_; - if (((bitField0_ & 0x00000001) != 0)) { - argumentKeywords_ = argumentKeywords_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.argumentKeywords_ = argumentKeywords_; - result.allowedPositionalArguments_ = allowedPositionalArguments_; - if (functionSpecBuilder_ == null) { - result.functionSpec_ = functionSpec_; - } else { - result.functionSpec_ = functionSpecBuilder_.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.SavedBareConcreteFunction) { - return mergeFrom((org.tensorflow.proto.framework.SavedBareConcreteFunction)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedBareConcreteFunction other) { - if (other == org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance()) return this; - if (!other.getConcreteFunctionName().isEmpty()) { - concreteFunctionName_ = other.concreteFunctionName_; - onChanged(); - } - if (!other.argumentKeywords_.isEmpty()) { - if (argumentKeywords_.isEmpty()) { - argumentKeywords_ = other.argumentKeywords_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureArgumentKeywordsIsMutable(); - argumentKeywords_.addAll(other.argumentKeywords_); - } - onChanged(); - } - if (other.getAllowedPositionalArguments() != 0L) { - setAllowedPositionalArguments(other.getAllowedPositionalArguments()); - } - if (other.hasFunctionSpec()) { - mergeFunctionSpec(other.getFunctionSpec()); - } - 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.SavedBareConcreteFunction parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedBareConcreteFunction) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object concreteFunctionName_ = ""; - /** - *
    -     * Identifies a SavedConcreteFunction.
    -     * 
    - * - * string concrete_function_name = 1; - */ - public java.lang.String getConcreteFunctionName() { - java.lang.Object ref = concreteFunctionName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - concreteFunctionName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Identifies a SavedConcreteFunction.
    -     * 
    - * - * string concrete_function_name = 1; - */ - public com.google.protobuf.ByteString - getConcreteFunctionNameBytes() { - java.lang.Object ref = concreteFunctionName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - concreteFunctionName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Identifies a SavedConcreteFunction.
    -     * 
    - * - * string concrete_function_name = 1; - */ - public Builder setConcreteFunctionName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - concreteFunctionName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Identifies a SavedConcreteFunction.
    -     * 
    - * - * string concrete_function_name = 1; - */ - public Builder clearConcreteFunctionName() { - - concreteFunctionName_ = getDefaultInstance().getConcreteFunctionName(); - onChanged(); - return this; - } - /** - *
    -     * Identifies a SavedConcreteFunction.
    -     * 
    - * - * string concrete_function_name = 1; - */ - public Builder setConcreteFunctionNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - concreteFunctionName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList argumentKeywords_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureArgumentKeywordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - argumentKeywords_ = new com.google.protobuf.LazyStringArrayList(argumentKeywords_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public com.google.protobuf.ProtocolStringList - getArgumentKeywordsList() { - return argumentKeywords_.getUnmodifiableView(); - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public int getArgumentKeywordsCount() { - return argumentKeywords_.size(); - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public java.lang.String getArgumentKeywords(int index) { - return argumentKeywords_.get(index); - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public com.google.protobuf.ByteString - getArgumentKeywordsBytes(int index) { - return argumentKeywords_.getByteString(index); - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public Builder setArgumentKeywords( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentKeywordsIsMutable(); - argumentKeywords_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public Builder addArgumentKeywords( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentKeywordsIsMutable(); - argumentKeywords_.add(value); - onChanged(); - return this; - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public Builder addAllArgumentKeywords( - java.lang.Iterable values) { - ensureArgumentKeywordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, argumentKeywords_); - onChanged(); - return this; - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public Builder clearArgumentKeywords() { - argumentKeywords_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * A sequence of unique strings, one per Tensor argument.
    -     * 
    - * - * repeated string argument_keywords = 2; - */ - public Builder addArgumentKeywordsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureArgumentKeywordsIsMutable(); - argumentKeywords_.add(value); - onChanged(); - return this; - } - - private long allowedPositionalArguments_ ; - /** - *
    -     * The prefix of `argument_keywords` which may be identified by position.
    -     * 
    - * - * int64 allowed_positional_arguments = 3; - */ - public long getAllowedPositionalArguments() { - return allowedPositionalArguments_; - } - /** - *
    -     * The prefix of `argument_keywords` which may be identified by position.
    -     * 
    - * - * int64 allowed_positional_arguments = 3; - */ - public Builder setAllowedPositionalArguments(long value) { - - allowedPositionalArguments_ = value; - onChanged(); - return this; - } - /** - *
    -     * The prefix of `argument_keywords` which may be identified by position.
    -     * 
    - * - * int64 allowed_positional_arguments = 3; - */ - public Builder clearAllowedPositionalArguments() { - - allowedPositionalArguments_ = 0L; - 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) { - 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.SavedBareConcreteFunction) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedBareConcreteFunction) - private static final org.tensorflow.proto.framework.SavedBareConcreteFunction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedBareConcreteFunction(); - } - - public static org.tensorflow.proto.framework.SavedBareConcreteFunction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedBareConcreteFunction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedBareConcreteFunction(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.SavedBareConcreteFunction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 8cb7224059b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedBareConcreteFunctionOrBuilder.java +++ /dev/null @@ -1,111 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedBareConcreteFunctionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedBareConcreteFunction) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Identifies a SavedConcreteFunction.
    -   * 
    - * - * string concrete_function_name = 1; - */ - java.lang.String getConcreteFunctionName(); - /** - *
    -   * Identifies a SavedConcreteFunction.
    -   * 
    - * - * string concrete_function_name = 1; - */ - com.google.protobuf.ByteString - getConcreteFunctionNameBytes(); - - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - java.util.List - getArgumentKeywordsList(); - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - int getArgumentKeywordsCount(); - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - java.lang.String getArgumentKeywords(int index); - /** - *
    -   * A sequence of unique strings, one per Tensor argument.
    -   * 
    - * - * repeated string argument_keywords = 2; - */ - com.google.protobuf.ByteString - getArgumentKeywordsBytes(int index); - - /** - *
    -   * The prefix of `argument_keywords` which may be identified by position.
    -   * 
    - * - * 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/SavedConcreteFunction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunction.java deleted file mode 100644 index 12db201a9b8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunction.java +++ /dev/null @@ -1,1086 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Stores low-level information about a concrete function. Referenced in either
    - * a SavedFunction or a SavedBareConcreteFunction.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedConcreteFunction} - */ -public final class SavedConcreteFunction extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedConcreteFunction) - SavedConcreteFunctionOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedConcreteFunction.newBuilder() to construct. - private SavedConcreteFunction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedConcreteFunction() { - boundInputs_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedConcreteFunction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedConcreteFunction( - 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 16: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - boundInputs_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - boundInputs_.addInt(input.readInt32()); - break; - } - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - boundInputs_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - boundInputs_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 26: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (canonicalizedInputSignature_ != null) { - subBuilder = canonicalizedInputSignature_.toBuilder(); - } - canonicalizedInputSignature_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(canonicalizedInputSignature_); - canonicalizedInputSignature_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (outputSignature_ != null) { - subBuilder = outputSignature_.toBuilder(); - } - outputSignature_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputSignature_); - outputSignature_ = subBuilder.buildPartial(); - } - - 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)) { - boundInputs_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConcreteFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedConcreteFunction.class, org.tensorflow.proto.framework.SavedConcreteFunction.Builder.class); - } - - public static final int BOUND_INPUTS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.IntList boundInputs_; - /** - * repeated int32 bound_inputs = 2; - */ - public java.util.List - getBoundInputsList() { - return boundInputs_; - } - /** - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputsCount() { - return boundInputs_.size(); - } - /** - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputs(int index) { - return boundInputs_.getInt(index); - } - private int boundInputsMemoizedSerializedSize = -1; - - public static final int CANONICALIZED_INPUT_SIGNATURE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.StructuredValue canonicalizedInputSignature_; - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public boolean hasCanonicalizedInputSignature() { - return canonicalizedInputSignature_ != null; - } - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public org.tensorflow.proto.framework.StructuredValue getCanonicalizedInputSignature() { - return canonicalizedInputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; - } - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder() { - return getCanonicalizedInputSignature(); - } - - public static final int OUTPUT_SIGNATURE_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.StructuredValue outputSignature_; - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public boolean hasOutputSignature() { - return outputSignature_ != null; - } - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public org.tensorflow.proto.framework.StructuredValue getOutputSignature() { - return outputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : outputSignature_; - } - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getOutputSignatureOrBuilder() { - return getOutputSignature(); - } - - 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 { - getSerializedSize(); - if (getBoundInputsList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(boundInputsMemoizedSerializedSize); - } - for (int i = 0; i < boundInputs_.size(); i++) { - output.writeInt32NoTag(boundInputs_.getInt(i)); - } - if (canonicalizedInputSignature_ != null) { - output.writeMessage(3, getCanonicalizedInputSignature()); - } - if (outputSignature_ != null) { - output.writeMessage(4, getOutputSignature()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < boundInputs_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(boundInputs_.getInt(i)); - } - size += dataSize; - if (!getBoundInputsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - boundInputsMemoizedSerializedSize = dataSize; - } - if (canonicalizedInputSignature_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getCanonicalizedInputSignature()); - } - if (outputSignature_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getOutputSignature()); - } - 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.SavedConcreteFunction)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedConcreteFunction other = (org.tensorflow.proto.framework.SavedConcreteFunction) obj; - - if (!getBoundInputsList() - .equals(other.getBoundInputsList())) return false; - if (hasCanonicalizedInputSignature() != other.hasCanonicalizedInputSignature()) return false; - if (hasCanonicalizedInputSignature()) { - if (!getCanonicalizedInputSignature() - .equals(other.getCanonicalizedInputSignature())) return false; - } - if (hasOutputSignature() != other.hasOutputSignature()) return false; - if (hasOutputSignature()) { - if (!getOutputSignature() - .equals(other.getOutputSignature())) 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 (getBoundInputsCount() > 0) { - hash = (37 * hash) + BOUND_INPUTS_FIELD_NUMBER; - hash = (53 * hash) + getBoundInputsList().hashCode(); - } - if (hasCanonicalizedInputSignature()) { - hash = (37 * hash) + CANONICALIZED_INPUT_SIGNATURE_FIELD_NUMBER; - hash = (53 * hash) + getCanonicalizedInputSignature().hashCode(); - } - if (hasOutputSignature()) { - hash = (37 * hash) + OUTPUT_SIGNATURE_FIELD_NUMBER; - hash = (53 * hash) + getOutputSignature().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedConcreteFunction parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction 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.SavedConcreteFunction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction 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.SavedConcreteFunction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction 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.SavedConcreteFunction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction 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.SavedConcreteFunction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConcreteFunction 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.SavedConcreteFunction 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; - } - /** - *
    -   * Stores low-level information about a concrete function. Referenced in either
    -   * a SavedFunction or a SavedBareConcreteFunction.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedConcreteFunction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedConcreteFunction) - org.tensorflow.proto.framework.SavedConcreteFunctionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConcreteFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedConcreteFunction.class, org.tensorflow.proto.framework.SavedConcreteFunction.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedConcreteFunction.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(); - boundInputs_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - if (canonicalizedInputSignatureBuilder_ == null) { - canonicalizedInputSignature_ = null; - } else { - canonicalizedInputSignature_ = null; - canonicalizedInputSignatureBuilder_ = null; - } - if (outputSignatureBuilder_ == null) { - outputSignature_ = null; - } else { - outputSignature_ = null; - outputSignatureBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConcreteFunction_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConcreteFunction getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedConcreteFunction.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConcreteFunction build() { - org.tensorflow.proto.framework.SavedConcreteFunction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConcreteFunction buildPartial() { - org.tensorflow.proto.framework.SavedConcreteFunction result = new org.tensorflow.proto.framework.SavedConcreteFunction(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - boundInputs_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.boundInputs_ = boundInputs_; - if (canonicalizedInputSignatureBuilder_ == null) { - result.canonicalizedInputSignature_ = canonicalizedInputSignature_; - } else { - result.canonicalizedInputSignature_ = canonicalizedInputSignatureBuilder_.build(); - } - if (outputSignatureBuilder_ == null) { - result.outputSignature_ = outputSignature_; - } else { - result.outputSignature_ = outputSignatureBuilder_.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.SavedConcreteFunction) { - return mergeFrom((org.tensorflow.proto.framework.SavedConcreteFunction)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedConcreteFunction other) { - if (other == org.tensorflow.proto.framework.SavedConcreteFunction.getDefaultInstance()) return this; - if (!other.boundInputs_.isEmpty()) { - if (boundInputs_.isEmpty()) { - boundInputs_ = other.boundInputs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBoundInputsIsMutable(); - boundInputs_.addAll(other.boundInputs_); - } - onChanged(); - } - if (other.hasCanonicalizedInputSignature()) { - mergeCanonicalizedInputSignature(other.getCanonicalizedInputSignature()); - } - if (other.hasOutputSignature()) { - mergeOutputSignature(other.getOutputSignature()); - } - 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.SavedConcreteFunction parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedConcreteFunction) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Internal.IntList boundInputs_ = emptyIntList(); - private void ensureBoundInputsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - boundInputs_ = mutableCopy(boundInputs_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated int32 bound_inputs = 2; - */ - public java.util.List - getBoundInputsList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(boundInputs_) : boundInputs_; - } - /** - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputsCount() { - return boundInputs_.size(); - } - /** - * repeated int32 bound_inputs = 2; - */ - public int getBoundInputs(int index) { - return boundInputs_.getInt(index); - } - /** - * repeated int32 bound_inputs = 2; - */ - public Builder setBoundInputs( - int index, int value) { - ensureBoundInputsIsMutable(); - boundInputs_.setInt(index, value); - onChanged(); - return this; - } - /** - * repeated int32 bound_inputs = 2; - */ - public Builder addBoundInputs(int value) { - ensureBoundInputsIsMutable(); - boundInputs_.addInt(value); - onChanged(); - return this; - } - /** - * repeated int32 bound_inputs = 2; - */ - public Builder addAllBoundInputs( - java.lang.Iterable values) { - ensureBoundInputsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, boundInputs_); - onChanged(); - return this; - } - /** - * repeated int32 bound_inputs = 2; - */ - public Builder clearBoundInputs() { - boundInputs_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.StructuredValue canonicalizedInputSignature_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> canonicalizedInputSignatureBuilder_; - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public boolean hasCanonicalizedInputSignature() { - return canonicalizedInputSignatureBuilder_ != null || canonicalizedInputSignature_ != null; - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public org.tensorflow.proto.framework.StructuredValue getCanonicalizedInputSignature() { - if (canonicalizedInputSignatureBuilder_ == null) { - return canonicalizedInputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; - } else { - return canonicalizedInputSignatureBuilder_.getMessage(); - } - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public Builder setCanonicalizedInputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (canonicalizedInputSignatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - canonicalizedInputSignature_ = value; - onChanged(); - } else { - canonicalizedInputSignatureBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public Builder setCanonicalizedInputSignature( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (canonicalizedInputSignatureBuilder_ == null) { - canonicalizedInputSignature_ = builderForValue.build(); - onChanged(); - } else { - canonicalizedInputSignatureBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public Builder mergeCanonicalizedInputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (canonicalizedInputSignatureBuilder_ == null) { - if (canonicalizedInputSignature_ != null) { - canonicalizedInputSignature_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(canonicalizedInputSignature_).mergeFrom(value).buildPartial(); - } else { - canonicalizedInputSignature_ = value; - } - onChanged(); - } else { - canonicalizedInputSignatureBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public Builder clearCanonicalizedInputSignature() { - if (canonicalizedInputSignatureBuilder_ == null) { - canonicalizedInputSignature_ = null; - onChanged(); - } else { - canonicalizedInputSignature_ = null; - canonicalizedInputSignatureBuilder_ = null; - } - - return this; - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getCanonicalizedInputSignatureBuilder() { - - onChanged(); - return getCanonicalizedInputSignatureFieldBuilder().getBuilder(); - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder() { - if (canonicalizedInputSignatureBuilder_ != null) { - return canonicalizedInputSignatureBuilder_.getMessageOrBuilder(); - } else { - return canonicalizedInputSignature_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; - } - } - /** - *
    -     * Input in canonicalized form that was received to create this concrete
    -     * function.
    -     * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getCanonicalizedInputSignatureFieldBuilder() { - if (canonicalizedInputSignatureBuilder_ == null) { - canonicalizedInputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getCanonicalizedInputSignature(), - getParentForChildren(), - isClean()); - canonicalizedInputSignature_ = null; - } - return canonicalizedInputSignatureBuilder_; - } - - private org.tensorflow.proto.framework.StructuredValue outputSignature_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> outputSignatureBuilder_; - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public boolean hasOutputSignature() { - return outputSignatureBuilder_ != null || outputSignature_ != null; - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public org.tensorflow.proto.framework.StructuredValue getOutputSignature() { - if (outputSignatureBuilder_ == null) { - return outputSignature_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : outputSignature_; - } else { - return outputSignatureBuilder_.getMessage(); - } - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public Builder setOutputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (outputSignatureBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputSignature_ = value; - onChanged(); - } else { - outputSignatureBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public Builder setOutputSignature( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (outputSignatureBuilder_ == null) { - outputSignature_ = builderForValue.build(); - onChanged(); - } else { - outputSignatureBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public Builder mergeOutputSignature(org.tensorflow.proto.framework.StructuredValue value) { - if (outputSignatureBuilder_ == null) { - if (outputSignature_ != null) { - outputSignature_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(outputSignature_).mergeFrom(value).buildPartial(); - } else { - outputSignature_ = value; - } - onChanged(); - } else { - outputSignatureBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public Builder clearOutputSignature() { - if (outputSignatureBuilder_ == null) { - outputSignature_ = null; - onChanged(); - } else { - outputSignature_ = null; - outputSignatureBuilder_ = null; - } - - return this; - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getOutputSignatureBuilder() { - - onChanged(); - return getOutputSignatureFieldBuilder().getBuilder(); - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getOutputSignatureOrBuilder() { - if (outputSignatureBuilder_ != null) { - return outputSignatureBuilder_.getMessageOrBuilder(); - } else { - return outputSignature_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : outputSignature_; - } - } - /** - *
    -     * Output that was the return value of this function after replacing all
    -     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -     * be used to reconstruct the full structure from pure tensors.
    -     * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getOutputSignatureFieldBuilder() { - if (outputSignatureBuilder_ == null) { - outputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getOutputSignature(), - getParentForChildren(), - isClean()); - outputSignature_ = null; - } - return outputSignatureBuilder_; - } - @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.SavedConcreteFunction) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedConcreteFunction) - private static final org.tensorflow.proto.framework.SavedConcreteFunction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedConcreteFunction(); - } - - public static org.tensorflow.proto.framework.SavedConcreteFunction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedConcreteFunction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedConcreteFunction(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.SavedConcreteFunction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunctionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunctionOrBuilder.java deleted file mode 100644 index 69a21056bac..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConcreteFunctionOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedConcreteFunctionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedConcreteFunction) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated int32 bound_inputs = 2; - */ - java.util.List getBoundInputsList(); - /** - * repeated int32 bound_inputs = 2; - */ - int getBoundInputsCount(); - /** - * repeated int32 bound_inputs = 2; - */ - int getBoundInputs(int index); - - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - boolean hasCanonicalizedInputSignature(); - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - org.tensorflow.proto.framework.StructuredValue getCanonicalizedInputSignature(); - /** - *
    -   * Input in canonicalized form that was received to create this concrete
    -   * function.
    -   * 
    - * - * .tensorflow.StructuredValue canonicalized_input_signature = 3; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder(); - - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - boolean hasOutputSignature(); - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - org.tensorflow.proto.framework.StructuredValue getOutputSignature(); - /** - *
    -   * Output that was the return value of this function after replacing all
    -   * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    -   * be used to reconstruct the full structure from pure tensors.
    -   * 
    - * - * .tensorflow.StructuredValue output_signature = 4; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getOutputSignatureOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstant.java deleted file mode 100644 index 4ba709c9c98..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstant.java +++ /dev/null @@ -1,574 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SavedConstant} - */ -public final class SavedConstant extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedConstant) - SavedConstantOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedConstant.newBuilder() to construct. - private SavedConstant(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedConstant() { - operation_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedConstant(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedConstant( - 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(); - - operation_ = s; - 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.SavedObjectGraphProtos.internal_static_tensorflow_SavedConstant_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConstant_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedConstant.class, org.tensorflow.proto.framework.SavedConstant.Builder.class); - } - - public static final int OPERATION_FIELD_NUMBER = 1; - private volatile java.lang.Object operation_; - /** - *
    -   * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -   * 
    - * - * string operation = 1; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - 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(); - operation_ = s; - return s; - } - } - /** - *
    -   * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -   * 
    - * - * string operation = 1; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getOperationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operation_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getOperationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operation_); - } - 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.SavedConstant)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedConstant other = (org.tensorflow.proto.framework.SavedConstant) obj; - - if (!getOperation() - .equals(other.getOperation())) 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) + OPERATION_FIELD_NUMBER; - hash = (53 * hash) + getOperation().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedConstant parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConstant 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.SavedConstant parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConstant 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.SavedConstant parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedConstant parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedConstant parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConstant 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.SavedConstant parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConstant 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.SavedConstant parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedConstant 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.SavedConstant 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.SavedConstant} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedConstant) - org.tensorflow.proto.framework.SavedConstantOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConstant_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConstant_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedConstant.class, org.tensorflow.proto.framework.SavedConstant.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedConstant.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(); - operation_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedConstant_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConstant getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConstant build() { - org.tensorflow.proto.framework.SavedConstant result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedConstant buildPartial() { - org.tensorflow.proto.framework.SavedConstant result = new org.tensorflow.proto.framework.SavedConstant(this); - result.operation_ = operation_; - 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.SavedConstant) { - return mergeFrom((org.tensorflow.proto.framework.SavedConstant)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedConstant other) { - if (other == org.tensorflow.proto.framework.SavedConstant.getDefaultInstance()) return this; - if (!other.getOperation().isEmpty()) { - operation_ = other.operation_; - onChanged(); - } - 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.SavedConstant parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedConstant) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object operation_ = ""; - /** - *
    -     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -     * 
    - * - * string operation = 1; - */ - public java.lang.String getOperation() { - java.lang.Object ref = operation_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - operation_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -     * 
    - * - * string operation = 1; - */ - public com.google.protobuf.ByteString - getOperationBytes() { - java.lang.Object ref = operation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - operation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -     * 
    - * - * string operation = 1; - */ - public Builder setOperation( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - operation_ = value; - onChanged(); - return this; - } - /** - *
    -     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -     * 
    - * - * string operation = 1; - */ - public Builder clearOperation() { - - operation_ = getDefaultInstance().getOperation(); - onChanged(); - return this; - } - /** - *
    -     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -     * 
    - * - * string operation = 1; - */ - public Builder setOperationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - operation_ = value; - 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.SavedConstant) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedConstant) - private static final org.tensorflow.proto.framework.SavedConstant DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedConstant(); - } - - public static org.tensorflow.proto.framework.SavedConstant getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedConstant parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedConstant(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.SavedConstant getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstantOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstantOrBuilder.java deleted file mode 100644 index ed435bc83ba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedConstantOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedConstantOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedConstant) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -   * 
    - * - * string operation = 1; - */ - java.lang.String getOperation(); - /** - *
    -   * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    -   * 
    - * - * string operation = 1; - */ - com.google.protobuf.ByteString - getOperationBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunction.java deleted file mode 100644 index d873063784e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunction.java +++ /dev/null @@ -1,781 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A function with multiple signatures, possibly with non-Tensor arguments.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedFunction} - */ -public final class SavedFunction extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedFunction) - SavedFunctionOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedFunction.newBuilder() to construct. - private SavedFunction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedFunction() { - concreteFunctions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedFunction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedFunction( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - concreteFunctions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - concreteFunctions_.add(s); - break; - } - case 18: { - 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)) { - 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)) { - concreteFunctions_ = concreteFunctions_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedFunction.class, org.tensorflow.proto.framework.SavedFunction.Builder.class); - } - - public static final int CONCRETE_FUNCTIONS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList concreteFunctions_; - /** - * repeated string concrete_functions = 1; - */ - public com.google.protobuf.ProtocolStringList - getConcreteFunctionsList() { - return concreteFunctions_; - } - /** - * repeated string concrete_functions = 1; - */ - public int getConcreteFunctionsCount() { - return concreteFunctions_.size(); - } - /** - * repeated string concrete_functions = 1; - */ - public java.lang.String getConcreteFunctions(int index) { - return concreteFunctions_.get(index); - } - /** - * repeated string concrete_functions = 1; - */ - public com.google.protobuf.ByteString - getConcreteFunctionsBytes(int index) { - return concreteFunctions_.getByteString(index); - } - - public static final int FUNCTION_SPEC_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.FunctionSpec functionSpec_; - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public boolean hasFunctionSpec() { - return functionSpec_ != null; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public org.tensorflow.proto.framework.FunctionSpec getFunctionSpec() { - return functionSpec_ == null ? org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { - return getFunctionSpec(); - } - - 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 { - for (int i = 0; i < concreteFunctions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, concreteFunctions_.getRaw(i)); - } - if (functionSpec_ != null) { - output.writeMessage(2, getFunctionSpec()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < concreteFunctions_.size(); i++) { - dataSize += computeStringSizeNoTag(concreteFunctions_.getRaw(i)); - } - size += dataSize; - size += 1 * getConcreteFunctionsList().size(); - } - if (functionSpec_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getFunctionSpec()); - } - 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.SavedFunction)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedFunction other = (org.tensorflow.proto.framework.SavedFunction) obj; - - if (!getConcreteFunctionsList() - .equals(other.getConcreteFunctionsList())) 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; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getConcreteFunctionsCount() > 0) { - hash = (37 * hash) + CONCRETE_FUNCTIONS_FIELD_NUMBER; - hash = (53 * hash) + getConcreteFunctionsList().hashCode(); - } - if (hasFunctionSpec()) { - hash = (37 * hash) + FUNCTION_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getFunctionSpec().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedFunction parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedFunction 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.SavedFunction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedFunction 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.SavedFunction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedFunction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedFunction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedFunction 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.SavedFunction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedFunction 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.SavedFunction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedFunction 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.SavedFunction 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 function with multiple signatures, possibly with non-Tensor arguments.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedFunction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedFunction) - org.tensorflow.proto.framework.SavedFunctionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedFunction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedFunction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedFunction.class, org.tensorflow.proto.framework.SavedFunction.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedFunction.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(); - concreteFunctions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - if (functionSpecBuilder_ == null) { - functionSpec_ = null; - } else { - functionSpec_ = null; - functionSpecBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedFunction_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedFunction getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedFunction build() { - org.tensorflow.proto.framework.SavedFunction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedFunction buildPartial() { - org.tensorflow.proto.framework.SavedFunction result = new org.tensorflow.proto.framework.SavedFunction(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - concreteFunctions_ = concreteFunctions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.concreteFunctions_ = concreteFunctions_; - if (functionSpecBuilder_ == null) { - result.functionSpec_ = functionSpec_; - } else { - result.functionSpec_ = functionSpecBuilder_.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.SavedFunction) { - return mergeFrom((org.tensorflow.proto.framework.SavedFunction)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedFunction other) { - if (other == org.tensorflow.proto.framework.SavedFunction.getDefaultInstance()) return this; - if (!other.concreteFunctions_.isEmpty()) { - if (concreteFunctions_.isEmpty()) { - concreteFunctions_ = other.concreteFunctions_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConcreteFunctionsIsMutable(); - concreteFunctions_.addAll(other.concreteFunctions_); - } - onChanged(); - } - if (other.hasFunctionSpec()) { - mergeFunctionSpec(other.getFunctionSpec()); - } - 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.SavedFunction parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedFunction) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList concreteFunctions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureConcreteFunctionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - concreteFunctions_ = new com.google.protobuf.LazyStringArrayList(concreteFunctions_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string concrete_functions = 1; - */ - public com.google.protobuf.ProtocolStringList - getConcreteFunctionsList() { - return concreteFunctions_.getUnmodifiableView(); - } - /** - * repeated string concrete_functions = 1; - */ - public int getConcreteFunctionsCount() { - return concreteFunctions_.size(); - } - /** - * repeated string concrete_functions = 1; - */ - public java.lang.String getConcreteFunctions(int index) { - return concreteFunctions_.get(index); - } - /** - * repeated string concrete_functions = 1; - */ - public com.google.protobuf.ByteString - getConcreteFunctionsBytes(int index) { - return concreteFunctions_.getByteString(index); - } - /** - * repeated string concrete_functions = 1; - */ - public Builder setConcreteFunctions( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureConcreteFunctionsIsMutable(); - concreteFunctions_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string concrete_functions = 1; - */ - public Builder addConcreteFunctions( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureConcreteFunctionsIsMutable(); - concreteFunctions_.add(value); - onChanged(); - return this; - } - /** - * repeated string concrete_functions = 1; - */ - public Builder addAllConcreteFunctions( - java.lang.Iterable values) { - ensureConcreteFunctionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, concreteFunctions_); - onChanged(); - return this; - } - /** - * repeated string concrete_functions = 1; - */ - public Builder clearConcreteFunctions() { - concreteFunctions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string concrete_functions = 1; - */ - public Builder addConcreteFunctionsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureConcreteFunctionsIsMutable(); - concreteFunctions_.add(value); - 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_; - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public boolean hasFunctionSpec() { - return functionSpecBuilder_ != null || functionSpec_ != null; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public org.tensorflow.proto.framework.FunctionSpec getFunctionSpec() { - if (functionSpecBuilder_ == null) { - return functionSpec_ == null ? org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; - } else { - return functionSpecBuilder_.getMessage(); - } - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - 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; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public Builder setFunctionSpec( - org.tensorflow.proto.framework.FunctionSpec.Builder builderForValue) { - if (functionSpecBuilder_ == null) { - functionSpec_ = builderForValue.build(); - onChanged(); - } else { - functionSpecBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - 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; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public Builder clearFunctionSpec() { - if (functionSpecBuilder_ == null) { - functionSpec_ = null; - onChanged(); - } else { - functionSpec_ = null; - functionSpecBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public org.tensorflow.proto.framework.FunctionSpec.Builder getFunctionSpecBuilder() { - - onChanged(); - return getFunctionSpecFieldBuilder().getBuilder(); - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - public org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { - if (functionSpecBuilder_ != null) { - return functionSpecBuilder_.getMessageOrBuilder(); - } else { - return functionSpec_ == null ? - org.tensorflow.proto.framework.FunctionSpec.getDefaultInstance() : functionSpec_; - } - } - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - 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) { - 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.SavedFunction) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedFunction) - private static final org.tensorflow.proto.framework.SavedFunction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedFunction(); - } - - public static org.tensorflow.proto.framework.SavedFunction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedFunction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedFunction(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.SavedFunction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunctionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunctionOrBuilder.java deleted file mode 100644 index 19b27a54fb3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedFunctionOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedFunctionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedFunction) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string concrete_functions = 1; - */ - java.util.List - getConcreteFunctionsList(); - /** - * repeated string concrete_functions = 1; - */ - int getConcreteFunctionsCount(); - /** - * repeated string concrete_functions = 1; - */ - java.lang.String getConcreteFunctions(int index); - /** - * repeated string concrete_functions = 1; - */ - com.google.protobuf.ByteString - getConcreteFunctionsBytes(int index); - - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - boolean hasFunctionSpec(); - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - org.tensorflow.proto.framework.FunctionSpec getFunctionSpec(); - /** - * .tensorflow.FunctionSpec function_spec = 2; - */ - org.tensorflow.proto.framework.FunctionSpecOrBuilder getFunctionSpecOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModel.java deleted file mode 100644 index ac25416e31a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModel.java +++ /dev/null @@ -1,949 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_model.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * SavedModel is the high level serialization format for TensorFlow Models.
    - * See [todo: doc links, similar to session_bundle] for more information.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedModel} - */ -public final class SavedModel extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedModel) - SavedModelOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedModel.newBuilder() to construct. - private SavedModel(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedModel() { - metaGraphs_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedModel(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedModel( - 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: { - - savedModelSchemaVersion_ = input.readInt64(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - metaGraphs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - metaGraphs_.add( - input.readMessage(org.tensorflow.proto.framework.MetaGraphDef.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_ & 0x00000001) != 0)) { - metaGraphs_ = java.util.Collections.unmodifiableList(metaGraphs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedModelProtos.internal_static_tensorflow_SavedModel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedModel.class, org.tensorflow.proto.framework.SavedModel.Builder.class); - } - - public static final int SAVED_MODEL_SCHEMA_VERSION_FIELD_NUMBER = 1; - private long savedModelSchemaVersion_; - /** - *
    -   * The schema version of the SavedModel instance. Used for versioning when
    -   * making future changes to the specification/implementation. Initial value
    -   * at release will be 1.
    -   * 
    - * - * int64 saved_model_schema_version = 1; - */ - public long getSavedModelSchemaVersion() { - return savedModelSchemaVersion_; - } - - public static final int META_GRAPHS_FIELD_NUMBER = 2; - private java.util.List metaGraphs_; - /** - *
    -   * One or more MetaGraphs.
    -   * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public java.util.List getMetaGraphsList() { - return metaGraphs_; - } - /** - *
    -   * One or more MetaGraphs.
    -   * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public java.util.List - getMetaGraphsOrBuilderList() { - return metaGraphs_; - } - /** - *
    -   * One or more MetaGraphs.
    -   * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public int getMetaGraphsCount() { - return metaGraphs_.size(); - } - /** - *
    -   * One or more MetaGraphs.
    -   * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDef getMetaGraphs(int index) { - return metaGraphs_.get(index); - } - /** - *
    -   * One or more MetaGraphs.
    -   * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDefOrBuilder getMetaGraphsOrBuilder( - int index) { - return metaGraphs_.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 { - if (savedModelSchemaVersion_ != 0L) { - output.writeInt64(1, savedModelSchemaVersion_); - } - for (int i = 0; i < metaGraphs_.size(); i++) { - output.writeMessage(2, metaGraphs_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (savedModelSchemaVersion_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, savedModelSchemaVersion_); - } - for (int i = 0; i < metaGraphs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, metaGraphs_.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.SavedModel)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedModel other = (org.tensorflow.proto.framework.SavedModel) obj; - - if (getSavedModelSchemaVersion() - != other.getSavedModelSchemaVersion()) return false; - if (!getMetaGraphsList() - .equals(other.getMetaGraphsList())) 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) + SAVED_MODEL_SCHEMA_VERSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSavedModelSchemaVersion()); - if (getMetaGraphsCount() > 0) { - hash = (37 * hash) + META_GRAPHS_FIELD_NUMBER; - hash = (53 * hash) + getMetaGraphsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedModel parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedModel 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.SavedModel parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedModel 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.SavedModel parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedModel parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedModel parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedModel 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.SavedModel parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedModel 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.SavedModel parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedModel 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.SavedModel 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; - } - /** - *
    -   * SavedModel is the high level serialization format for TensorFlow Models.
    -   * See [todo: doc links, similar to session_bundle] for more information.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedModel} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedModel) - org.tensorflow.proto.framework.SavedModelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedModelProtos.internal_static_tensorflow_SavedModel_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedModel.class, org.tensorflow.proto.framework.SavedModel.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedModel.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getMetaGraphsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - savedModelSchemaVersion_ = 0L; - - if (metaGraphsBuilder_ == null) { - metaGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - metaGraphsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedModel getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedModel.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedModel build() { - org.tensorflow.proto.framework.SavedModel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedModel buildPartial() { - org.tensorflow.proto.framework.SavedModel result = new org.tensorflow.proto.framework.SavedModel(this); - int from_bitField0_ = bitField0_; - result.savedModelSchemaVersion_ = savedModelSchemaVersion_; - if (metaGraphsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - metaGraphs_ = java.util.Collections.unmodifiableList(metaGraphs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.metaGraphs_ = metaGraphs_; - } else { - result.metaGraphs_ = metaGraphsBuilder_.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.SavedModel) { - return mergeFrom((org.tensorflow.proto.framework.SavedModel)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedModel other) { - if (other == org.tensorflow.proto.framework.SavedModel.getDefaultInstance()) return this; - if (other.getSavedModelSchemaVersion() != 0L) { - setSavedModelSchemaVersion(other.getSavedModelSchemaVersion()); - } - if (metaGraphsBuilder_ == null) { - if (!other.metaGraphs_.isEmpty()) { - if (metaGraphs_.isEmpty()) { - metaGraphs_ = other.metaGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureMetaGraphsIsMutable(); - metaGraphs_.addAll(other.metaGraphs_); - } - onChanged(); - } - } else { - if (!other.metaGraphs_.isEmpty()) { - if (metaGraphsBuilder_.isEmpty()) { - metaGraphsBuilder_.dispose(); - metaGraphsBuilder_ = null; - metaGraphs_ = other.metaGraphs_; - bitField0_ = (bitField0_ & ~0x00000001); - metaGraphsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getMetaGraphsFieldBuilder() : null; - } else { - metaGraphsBuilder_.addAllMessages(other.metaGraphs_); - } - } - } - 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.SavedModel parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedModel) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long savedModelSchemaVersion_ ; - /** - *
    -     * The schema version of the SavedModel instance. Used for versioning when
    -     * making future changes to the specification/implementation. Initial value
    -     * at release will be 1.
    -     * 
    - * - * int64 saved_model_schema_version = 1; - */ - public long getSavedModelSchemaVersion() { - return savedModelSchemaVersion_; - } - /** - *
    -     * The schema version of the SavedModel instance. Used for versioning when
    -     * making future changes to the specification/implementation. Initial value
    -     * at release will be 1.
    -     * 
    - * - * int64 saved_model_schema_version = 1; - */ - public Builder setSavedModelSchemaVersion(long value) { - - savedModelSchemaVersion_ = value; - onChanged(); - return this; - } - /** - *
    -     * The schema version of the SavedModel instance. Used for versioning when
    -     * making future changes to the specification/implementation. Initial value
    -     * at release will be 1.
    -     * 
    - * - * int64 saved_model_schema_version = 1; - */ - public Builder clearSavedModelSchemaVersion() { - - savedModelSchemaVersion_ = 0L; - onChanged(); - return this; - } - - private java.util.List metaGraphs_ = - java.util.Collections.emptyList(); - private void ensureMetaGraphsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - metaGraphs_ = new java.util.ArrayList(metaGraphs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef, org.tensorflow.proto.framework.MetaGraphDef.Builder, org.tensorflow.proto.framework.MetaGraphDefOrBuilder> metaGraphsBuilder_; - - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public java.util.List getMetaGraphsList() { - if (metaGraphsBuilder_ == null) { - return java.util.Collections.unmodifiableList(metaGraphs_); - } else { - return metaGraphsBuilder_.getMessageList(); - } - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public int getMetaGraphsCount() { - if (metaGraphsBuilder_ == null) { - return metaGraphs_.size(); - } else { - return metaGraphsBuilder_.getCount(); - } - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDef getMetaGraphs(int index) { - if (metaGraphsBuilder_ == null) { - return metaGraphs_.get(index); - } else { - return metaGraphsBuilder_.getMessage(index); - } - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder setMetaGraphs( - int index, org.tensorflow.proto.framework.MetaGraphDef value) { - if (metaGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetaGraphsIsMutable(); - metaGraphs_.set(index, value); - onChanged(); - } else { - metaGraphsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder setMetaGraphs( - int index, org.tensorflow.proto.framework.MetaGraphDef.Builder builderForValue) { - if (metaGraphsBuilder_ == null) { - ensureMetaGraphsIsMutable(); - metaGraphs_.set(index, builderForValue.build()); - onChanged(); - } else { - metaGraphsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder addMetaGraphs(org.tensorflow.proto.framework.MetaGraphDef value) { - if (metaGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetaGraphsIsMutable(); - metaGraphs_.add(value); - onChanged(); - } else { - metaGraphsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder addMetaGraphs( - int index, org.tensorflow.proto.framework.MetaGraphDef value) { - if (metaGraphsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetaGraphsIsMutable(); - metaGraphs_.add(index, value); - onChanged(); - } else { - metaGraphsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder addMetaGraphs( - org.tensorflow.proto.framework.MetaGraphDef.Builder builderForValue) { - if (metaGraphsBuilder_ == null) { - ensureMetaGraphsIsMutable(); - metaGraphs_.add(builderForValue.build()); - onChanged(); - } else { - metaGraphsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder addMetaGraphs( - int index, org.tensorflow.proto.framework.MetaGraphDef.Builder builderForValue) { - if (metaGraphsBuilder_ == null) { - ensureMetaGraphsIsMutable(); - metaGraphs_.add(index, builderForValue.build()); - onChanged(); - } else { - metaGraphsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder addAllMetaGraphs( - java.lang.Iterable values) { - if (metaGraphsBuilder_ == null) { - ensureMetaGraphsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, metaGraphs_); - onChanged(); - } else { - metaGraphsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder clearMetaGraphs() { - if (metaGraphsBuilder_ == null) { - metaGraphs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - metaGraphsBuilder_.clear(); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public Builder removeMetaGraphs(int index) { - if (metaGraphsBuilder_ == null) { - ensureMetaGraphsIsMutable(); - metaGraphs_.remove(index); - onChanged(); - } else { - metaGraphsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDef.Builder getMetaGraphsBuilder( - int index) { - return getMetaGraphsFieldBuilder().getBuilder(index); - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDefOrBuilder getMetaGraphsOrBuilder( - int index) { - if (metaGraphsBuilder_ == null) { - return metaGraphs_.get(index); } else { - return metaGraphsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public java.util.List - getMetaGraphsOrBuilderList() { - if (metaGraphsBuilder_ != null) { - return metaGraphsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(metaGraphs_); - } - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDef.Builder addMetaGraphsBuilder() { - return getMetaGraphsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.MetaGraphDef.getDefaultInstance()); - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public org.tensorflow.proto.framework.MetaGraphDef.Builder addMetaGraphsBuilder( - int index) { - return getMetaGraphsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.MetaGraphDef.getDefaultInstance()); - } - /** - *
    -     * One or more MetaGraphs.
    -     * 
    - * - * repeated .tensorflow.MetaGraphDef meta_graphs = 2; - */ - public java.util.List - getMetaGraphsBuilderList() { - return getMetaGraphsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef, org.tensorflow.proto.framework.MetaGraphDef.Builder, org.tensorflow.proto.framework.MetaGraphDefOrBuilder> - getMetaGraphsFieldBuilder() { - if (metaGraphsBuilder_ == null) { - metaGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.MetaGraphDef, org.tensorflow.proto.framework.MetaGraphDef.Builder, org.tensorflow.proto.framework.MetaGraphDefOrBuilder>( - metaGraphs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - metaGraphs_ = null; - } - return metaGraphsBuilder_; - } - @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.SavedModel) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedModel) - private static final org.tensorflow.proto.framework.SavedModel DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedModel(); - } - - public static org.tensorflow.proto.framework.SavedModel getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedModel parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedModel(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.SavedModel getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 9067e27030c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelProtos.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_model.proto - -package org.tensorflow.proto.framework; - -public final class SavedModelProtos { - private SavedModelProtos() {} - 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_SavedModel_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedModel_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/saved_model.p" + - "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\216\001\n" + - "\036org.tensorflow.proto.frameworkB\020SavedMo" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.MetaGraphProtos.getDescriptor(), - }); - internal_static_tensorflow_SavedModel_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SavedModel_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedModel_descriptor, - new java.lang.String[] { "SavedModelSchemaVersion", "MetaGraphs", }); - org.tensorflow.proto.framework.MetaGraphProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObject.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObject.java deleted file mode 100644 index 4f585ec9839..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObject.java +++ /dev/null @@ -1,3378 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SavedObject} - */ -public final class SavedObject extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedObject) - SavedObjectOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedObject.newBuilder() to construct. - private SavedObject(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedObject() { - children_ = java.util.Collections.emptyList(); - slotVariables_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedObject(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedObject( - 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)) { - children_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - children_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - slotVariables_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - slotVariables_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.parser(), extensionRegistry)); - break; - } - case 34: { - org.tensorflow.proto.framework.SavedUserObject.Builder subBuilder = null; - if (kindCase_ == 4) { - subBuilder = ((org.tensorflow.proto.framework.SavedUserObject) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedUserObject.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedUserObject) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 4; - break; - } - case 42: { - org.tensorflow.proto.framework.SavedAsset.Builder subBuilder = null; - if (kindCase_ == 5) { - subBuilder = ((org.tensorflow.proto.framework.SavedAsset) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedAsset.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedAsset) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 5; - break; - } - case 50: { - org.tensorflow.proto.framework.SavedFunction.Builder subBuilder = null; - if (kindCase_ == 6) { - subBuilder = ((org.tensorflow.proto.framework.SavedFunction) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedFunction.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedFunction) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 6; - break; - } - case 58: { - org.tensorflow.proto.framework.SavedVariable.Builder subBuilder = null; - if (kindCase_ == 7) { - subBuilder = ((org.tensorflow.proto.framework.SavedVariable) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedVariable.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedVariable) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 7; - break; - } - case 66: { - org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder subBuilder = null; - if (kindCase_ == 8) { - subBuilder = ((org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedBareConcreteFunction.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 8; - break; - } - case 74: { - org.tensorflow.proto.framework.SavedConstant.Builder subBuilder = null; - if (kindCase_ == 9) { - subBuilder = ((org.tensorflow.proto.framework.SavedConstant) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedConstant.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedConstant) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 9; - break; - } - case 82: { - org.tensorflow.proto.framework.SavedResource.Builder subBuilder = null; - if (kindCase_ == 10) { - subBuilder = ((org.tensorflow.proto.framework.SavedResource) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.SavedResource.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.SavedResource) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 10; - break; - } - case 90: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - saveableObjects_ = com.google.protobuf.MapField.newMapField( - SaveableObjectsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000004; - } - com.google.protobuf.MapEntry - saveableObjects__ = input.readMessage( - SaveableObjectsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - saveableObjects_.getMutableMap().put( - saveableObjects__.getKey(), saveableObjects__.getValue()); - break; - } - case 98: { - org.tensorflow.proto.framework.CapturedTensor.Builder subBuilder = null; - if (kindCase_ == 12) { - subBuilder = ((org.tensorflow.proto.framework.CapturedTensor) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.CapturedTensor.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.CapturedTensor) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 12; - 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)) { - children_ = java.util.Collections.unmodifiableList(children_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetSaveableObjects(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedObject.class, org.tensorflow.proto.framework.SavedObject.Builder.class); - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - USER_OBJECT(4), - ASSET(5), - FUNCTION(6), - VARIABLE(7), - BARE_CONCRETE_FUNCTION(8), - CONSTANT(9), - RESOURCE(10), - CAPTURED_TENSOR(12), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 4: return USER_OBJECT; - case 5: return ASSET; - case 6: return FUNCTION; - case 7: return VARIABLE; - case 8: return BARE_CONCRETE_FUNCTION; - case 9: return CONSTANT; - case 10: return RESOURCE; - case 12: return CAPTURED_TENSOR; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int CHILDREN_FIELD_NUMBER = 1; - private java.util.List children_; - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List getChildrenList() { - return children_; - } - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenOrBuilderList() { - return children_; - } - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public int getChildrenCount() { - return children_.size(); - } - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { - return children_.get(index); - } - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index) { - return children_.get(index); - } - - public static final int SLOT_VARIABLES_FIELD_NUMBER = 3; - private java.util.List slotVariables_; - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List getSlotVariablesList() { - return slotVariables_; - } - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesOrBuilderList() { - return slotVariables_; - } - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public int getSlotVariablesCount() { - return slotVariables_.size(); - } - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { - return slotVariables_.get(index); - } - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index) { - return slotVariables_.get(index); - } - - public static final int USER_OBJECT_FIELD_NUMBER = 4; - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public boolean hasUserObject() { - return kindCase_ == 4; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public org.tensorflow.proto.framework.SavedUserObject getUserObject() { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.SavedUserObject) kind_; - } - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public org.tensorflow.proto.framework.SavedUserObjectOrBuilder getUserObjectOrBuilder() { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.SavedUserObject) kind_; - } - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - - public static final int ASSET_FIELD_NUMBER = 5; - /** - * .tensorflow.SavedAsset asset = 5; - */ - public boolean hasAsset() { - return kindCase_ == 5; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public org.tensorflow.proto.framework.SavedAsset getAsset() { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.SavedAsset) kind_; - } - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public org.tensorflow.proto.framework.SavedAssetOrBuilder getAssetOrBuilder() { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.SavedAsset) kind_; - } - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - - public static final int FUNCTION_FIELD_NUMBER = 6; - /** - * .tensorflow.SavedFunction function = 6; - */ - public boolean hasFunction() { - return kindCase_ == 6; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public org.tensorflow.proto.framework.SavedFunction getFunction() { - if (kindCase_ == 6) { - return (org.tensorflow.proto.framework.SavedFunction) kind_; - } - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public org.tensorflow.proto.framework.SavedFunctionOrBuilder getFunctionOrBuilder() { - if (kindCase_ == 6) { - return (org.tensorflow.proto.framework.SavedFunction) kind_; - } - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - - public static final int VARIABLE_FIELD_NUMBER = 7; - /** - * .tensorflow.SavedVariable variable = 7; - */ - public boolean hasVariable() { - return kindCase_ == 7; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public org.tensorflow.proto.framework.SavedVariable getVariable() { - if (kindCase_ == 7) { - return (org.tensorflow.proto.framework.SavedVariable) kind_; - } - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public org.tensorflow.proto.framework.SavedVariableOrBuilder getVariableOrBuilder() { - if (kindCase_ == 7) { - return (org.tensorflow.proto.framework.SavedVariable) kind_; - } - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - - public static final int BARE_CONCRETE_FUNCTION_FIELD_NUMBER = 8; - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public boolean hasBareConcreteFunction() { - return kindCase_ == 8; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public org.tensorflow.proto.framework.SavedBareConcreteFunction getBareConcreteFunction() { - if (kindCase_ == 8) { - return (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_; - } - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder() { - if (kindCase_ == 8) { - return (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_; - } - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - - public static final int CONSTANT_FIELD_NUMBER = 9; - /** - * .tensorflow.SavedConstant constant = 9; - */ - public boolean hasConstant() { - return kindCase_ == 9; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public org.tensorflow.proto.framework.SavedConstant getConstant() { - if (kindCase_ == 9) { - return (org.tensorflow.proto.framework.SavedConstant) kind_; - } - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public org.tensorflow.proto.framework.SavedConstantOrBuilder getConstantOrBuilder() { - if (kindCase_ == 9) { - return (org.tensorflow.proto.framework.SavedConstant) kind_; - } - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - - public static final int RESOURCE_FIELD_NUMBER = 10; - /** - * .tensorflow.SavedResource resource = 10; - */ - public boolean hasResource() { - return kindCase_ == 10; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public org.tensorflow.proto.framework.SavedResource getResource() { - if (kindCase_ == 10) { - return (org.tensorflow.proto.framework.SavedResource) kind_; - } - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public org.tensorflow.proto.framework.SavedResourceOrBuilder getResourceOrBuilder() { - if (kindCase_ == 10) { - return (org.tensorflow.proto.framework.SavedResource) kind_; - } - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - - public static final int CAPTURED_TENSOR_FIELD_NUMBER = 12; - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public boolean hasCapturedTensor() { - return kindCase_ == 12; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public org.tensorflow.proto.framework.CapturedTensor getCapturedTensor() { - if (kindCase_ == 12) { - return (org.tensorflow.proto.framework.CapturedTensor) kind_; - } - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public org.tensorflow.proto.framework.CapturedTensorOrBuilder getCapturedTensorOrBuilder() { - if (kindCase_ == 12) { - return (org.tensorflow.proto.framework.CapturedTensor) kind_; - } - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - - public static final int SAVEABLE_OBJECTS_FIELD_NUMBER = 11; - private static final class SaveableObjectsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.SaveableObject> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.SaveableObject.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SaveableObject> saveableObjects_; - private com.google.protobuf.MapField - internalGetSaveableObjects() { - if (saveableObjects_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SaveableObjectsDefaultEntryHolder.defaultEntry); - } - return saveableObjects_; - } - - public int getSaveableObjectsCount() { - return internalGetSaveableObjects().getMap().size(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public boolean containsSaveableObjects( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetSaveableObjects().getMap().containsKey(key); - } - /** - * Use {@link #getSaveableObjectsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getSaveableObjects() { - return getSaveableObjectsMap(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public java.util.Map getSaveableObjectsMap() { - return internalGetSaveableObjects().getMap(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SaveableObject defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSaveableObjects().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSaveableObjects().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 { - for (int i = 0; i < children_.size(); i++) { - output.writeMessage(1, children_.get(i)); - } - for (int i = 0; i < slotVariables_.size(); i++) { - output.writeMessage(3, slotVariables_.get(i)); - } - if (kindCase_ == 4) { - output.writeMessage(4, (org.tensorflow.proto.framework.SavedUserObject) kind_); - } - if (kindCase_ == 5) { - output.writeMessage(5, (org.tensorflow.proto.framework.SavedAsset) kind_); - } - if (kindCase_ == 6) { - output.writeMessage(6, (org.tensorflow.proto.framework.SavedFunction) kind_); - } - if (kindCase_ == 7) { - output.writeMessage(7, (org.tensorflow.proto.framework.SavedVariable) kind_); - } - if (kindCase_ == 8) { - output.writeMessage(8, (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_); - } - if (kindCase_ == 9) { - output.writeMessage(9, (org.tensorflow.proto.framework.SavedConstant) kind_); - } - if (kindCase_ == 10) { - output.writeMessage(10, (org.tensorflow.proto.framework.SavedResource) kind_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetSaveableObjects(), - SaveableObjectsDefaultEntryHolder.defaultEntry, - 11); - if (kindCase_ == 12) { - output.writeMessage(12, (org.tensorflow.proto.framework.CapturedTensor) kind_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < children_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, children_.get(i)); - } - for (int i = 0; i < slotVariables_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, slotVariables_.get(i)); - } - if (kindCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (org.tensorflow.proto.framework.SavedUserObject) kind_); - } - if (kindCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (org.tensorflow.proto.framework.SavedAsset) kind_); - } - if (kindCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (org.tensorflow.proto.framework.SavedFunction) kind_); - } - if (kindCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (org.tensorflow.proto.framework.SavedVariable) kind_); - } - if (kindCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_); - } - if (kindCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, (org.tensorflow.proto.framework.SavedConstant) kind_); - } - if (kindCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (org.tensorflow.proto.framework.SavedResource) kind_); - } - for (java.util.Map.Entry entry - : internalGetSaveableObjects().getMap().entrySet()) { - com.google.protobuf.MapEntry - saveableObjects__ = SaveableObjectsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, saveableObjects__); - } - if (kindCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, (org.tensorflow.proto.framework.CapturedTensor) kind_); - } - 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.SavedObject)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedObject other = (org.tensorflow.proto.framework.SavedObject) obj; - - if (!getChildrenList() - .equals(other.getChildrenList())) return false; - if (!getSlotVariablesList() - .equals(other.getSlotVariablesList())) return false; - if (!internalGetSaveableObjects().equals( - other.internalGetSaveableObjects())) return false; - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 4: - if (!getUserObject() - .equals(other.getUserObject())) return false; - break; - case 5: - if (!getAsset() - .equals(other.getAsset())) return false; - break; - case 6: - if (!getFunction() - .equals(other.getFunction())) return false; - break; - case 7: - if (!getVariable() - .equals(other.getVariable())) return false; - break; - case 8: - if (!getBareConcreteFunction() - .equals(other.getBareConcreteFunction())) return false; - break; - case 9: - if (!getConstant() - .equals(other.getConstant())) return false; - break; - case 10: - if (!getResource() - .equals(other.getResource())) return false; - break; - case 12: - if (!getCapturedTensor() - .equals(other.getCapturedTensor())) return false; - break; - case 0: - default: - } - 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 (getChildrenCount() > 0) { - hash = (37 * hash) + CHILDREN_FIELD_NUMBER; - hash = (53 * hash) + getChildrenList().hashCode(); - } - if (getSlotVariablesCount() > 0) { - hash = (37 * hash) + SLOT_VARIABLES_FIELD_NUMBER; - hash = (53 * hash) + getSlotVariablesList().hashCode(); - } - if (!internalGetSaveableObjects().getMap().isEmpty()) { - hash = (37 * hash) + SAVEABLE_OBJECTS_FIELD_NUMBER; - hash = (53 * hash) + internalGetSaveableObjects().hashCode(); - } - switch (kindCase_) { - case 4: - hash = (37 * hash) + USER_OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getUserObject().hashCode(); - break; - case 5: - hash = (37 * hash) + ASSET_FIELD_NUMBER; - hash = (53 * hash) + getAsset().hashCode(); - break; - case 6: - hash = (37 * hash) + FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getFunction().hashCode(); - break; - case 7: - hash = (37 * hash) + VARIABLE_FIELD_NUMBER; - hash = (53 * hash) + getVariable().hashCode(); - break; - case 8: - hash = (37 * hash) + BARE_CONCRETE_FUNCTION_FIELD_NUMBER; - hash = (53 * hash) + getBareConcreteFunction().hashCode(); - break; - case 9: - hash = (37 * hash) + CONSTANT_FIELD_NUMBER; - hash = (53 * hash) + getConstant().hashCode(); - break; - case 10: - hash = (37 * hash) + RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + getResource().hashCode(); - break; - case 12: - hash = (37 * hash) + CAPTURED_TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getCapturedTensor().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedObject parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObject 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.SavedObject parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObject 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.SavedObject parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObject parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedObject parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObject 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.SavedObject parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObject 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.SavedObject parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObject 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.SavedObject 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.SavedObject} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedObject) - org.tensorflow.proto.framework.SavedObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 11: - return internalGetSaveableObjects(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 11: - return internalGetMutableSaveableObjects(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedObject.class, org.tensorflow.proto.framework.SavedObject.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedObject.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getChildrenFieldBuilder(); - getSlotVariablesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - childrenBuilder_.clear(); - } - if (slotVariablesBuilder_ == null) { - slotVariables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - slotVariablesBuilder_.clear(); - } - internalGetMutableSaveableObjects().clear(); - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObject_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObject getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedObject.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObject build() { - org.tensorflow.proto.framework.SavedObject result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObject buildPartial() { - org.tensorflow.proto.framework.SavedObject result = new org.tensorflow.proto.framework.SavedObject(this); - int from_bitField0_ = bitField0_; - if (childrenBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - children_ = java.util.Collections.unmodifiableList(children_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.children_ = children_; - } else { - result.children_ = childrenBuilder_.build(); - } - if (slotVariablesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.slotVariables_ = slotVariables_; - } else { - result.slotVariables_ = slotVariablesBuilder_.build(); - } - if (kindCase_ == 4) { - if (userObjectBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = userObjectBuilder_.build(); - } - } - if (kindCase_ == 5) { - if (assetBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = assetBuilder_.build(); - } - } - if (kindCase_ == 6) { - if (functionBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = functionBuilder_.build(); - } - } - if (kindCase_ == 7) { - if (variableBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = variableBuilder_.build(); - } - } - if (kindCase_ == 8) { - if (bareConcreteFunctionBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = bareConcreteFunctionBuilder_.build(); - } - } - if (kindCase_ == 9) { - if (constantBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = constantBuilder_.build(); - } - } - if (kindCase_ == 10) { - if (resourceBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = resourceBuilder_.build(); - } - } - if (kindCase_ == 12) { - if (capturedTensorBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = capturedTensorBuilder_.build(); - } - } - result.saveableObjects_ = internalGetSaveableObjects(); - result.saveableObjects_.makeImmutable(); - result.kindCase_ = kindCase_; - 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.SavedObject) { - return mergeFrom((org.tensorflow.proto.framework.SavedObject)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedObject other) { - if (other == org.tensorflow.proto.framework.SavedObject.getDefaultInstance()) return this; - if (childrenBuilder_ == null) { - if (!other.children_.isEmpty()) { - if (children_.isEmpty()) { - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureChildrenIsMutable(); - children_.addAll(other.children_); - } - onChanged(); - } - } else { - if (!other.children_.isEmpty()) { - if (childrenBuilder_.isEmpty()) { - childrenBuilder_.dispose(); - childrenBuilder_ = null; - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000001); - childrenBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getChildrenFieldBuilder() : null; - } else { - childrenBuilder_.addAllMessages(other.children_); - } - } - } - if (slotVariablesBuilder_ == null) { - if (!other.slotVariables_.isEmpty()) { - if (slotVariables_.isEmpty()) { - slotVariables_ = other.slotVariables_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSlotVariablesIsMutable(); - slotVariables_.addAll(other.slotVariables_); - } - onChanged(); - } - } else { - if (!other.slotVariables_.isEmpty()) { - if (slotVariablesBuilder_.isEmpty()) { - slotVariablesBuilder_.dispose(); - slotVariablesBuilder_ = null; - slotVariables_ = other.slotVariables_; - bitField0_ = (bitField0_ & ~0x00000002); - slotVariablesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSlotVariablesFieldBuilder() : null; - } else { - slotVariablesBuilder_.addAllMessages(other.slotVariables_); - } - } - } - internalGetMutableSaveableObjects().mergeFrom( - other.internalGetSaveableObjects()); - switch (other.getKindCase()) { - case USER_OBJECT: { - mergeUserObject(other.getUserObject()); - break; - } - case ASSET: { - mergeAsset(other.getAsset()); - break; - } - case FUNCTION: { - mergeFunction(other.getFunction()); - break; - } - case VARIABLE: { - mergeVariable(other.getVariable()); - break; - } - case BARE_CONCRETE_FUNCTION: { - mergeBareConcreteFunction(other.getBareConcreteFunction()); - break; - } - case CONSTANT: { - mergeConstant(other.getConstant()); - break; - } - case RESOURCE: { - mergeResource(other.getResource()); - break; - } - case CAPTURED_TENSOR: { - mergeCapturedTensor(other.getCapturedTensor()); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.SavedObject parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedObject) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private java.util.List children_ = - java.util.Collections.emptyList(); - private void ensureChildrenIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - children_ = new java.util.ArrayList(children_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> childrenBuilder_; - - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List getChildrenList() { - if (childrenBuilder_ == null) { - return java.util.Collections.unmodifiableList(children_); - } else { - return childrenBuilder_.getMessageList(); - } - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public int getChildrenCount() { - if (childrenBuilder_ == null) { - return children_.size(); - } else { - return childrenBuilder_.getCount(); - } - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { - if (childrenBuilder_ == null) { - return children_.get(index); - } else { - return childrenBuilder_.getMessage(index); - } - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder setChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.set(index, value); - onChanged(); - } else { - childrenBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder setChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.set(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(value); - onChanged(); - } else { - childrenBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(index, value); - onChanged(); - } else { - childrenBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addAllChildren( - java.lang.Iterable values) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, children_); - onChanged(); - } else { - childrenBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder clearChildren() { - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - childrenBuilder_.clear(); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder removeChildren(int index) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.remove(index); - onChanged(); - } else { - childrenBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder getChildrenBuilder( - int index) { - return getChildrenFieldBuilder().getBuilder(index); - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index) { - if (childrenBuilder_ == null) { - return children_.get(index); } else { - return childrenBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenOrBuilderList() { - if (childrenBuilder_ != null) { - return childrenBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(children_); - } - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder() { - return getChildrenFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder( - int index) { - return getChildrenFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); - } - /** - *
    -     * Objects which this object depends on: named edges in the dependency
    -     * graph.
    -     * Note: currently only valid if kind == "user_object" or "resource".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenBuilderList() { - return getChildrenFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> - getChildrenFieldBuilder() { - if (childrenBuilder_ == null) { - childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder>( - children_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - children_ = null; - } - return childrenBuilder_; - } - - private java.util.List slotVariables_ = - java.util.Collections.emptyList(); - private void ensureSlotVariablesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - slotVariables_ = new java.util.ArrayList(slotVariables_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> slotVariablesBuilder_; - - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List getSlotVariablesList() { - if (slotVariablesBuilder_ == null) { - return java.util.Collections.unmodifiableList(slotVariables_); - } else { - return slotVariablesBuilder_.getMessageList(); - } - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public int getSlotVariablesCount() { - if (slotVariablesBuilder_ == null) { - return slotVariables_.size(); - } else { - return slotVariablesBuilder_.getCount(); - } - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { - if (slotVariablesBuilder_ == null) { - return slotVariables_.get(index); - } else { - return slotVariablesBuilder_.getMessage(index); - } - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder setSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.set(index, value); - onChanged(); - } else { - slotVariablesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder setSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.set(index, builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.add(value); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.add(index, value); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.add(builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.add(index, builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addAllSlotVariables( - java.lang.Iterable values) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, slotVariables_); - onChanged(); - } else { - slotVariablesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder clearSlotVariables() { - if (slotVariablesBuilder_ == null) { - slotVariables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - slotVariablesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder removeSlotVariables(int index) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.remove(index); - onChanged(); - } else { - slotVariablesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder getSlotVariablesBuilder( - int index) { - return getSlotVariablesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index) { - if (slotVariablesBuilder_ == null) { - return slotVariables_.get(index); } else { - return slotVariablesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesOrBuilderList() { - if (slotVariablesBuilder_ != null) { - return slotVariablesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(slotVariables_); - } - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder() { - return getSlotVariablesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder( - int index) { - return getSlotVariablesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); - } - /** - *
    -     * Slot variables owned by this object. This describes the three-way
    -     * (optimizer, variable, slot variable) relationship; none of the three
    -     * depend on the others directly.
    -     * Note: currently only valid if kind == "user_object".
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesBuilderList() { - return getSlotVariablesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> - getSlotVariablesFieldBuilder() { - if (slotVariablesBuilder_ == null) { - slotVariablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder>( - slotVariables_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - slotVariables_ = null; - } - return slotVariablesBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedUserObject, org.tensorflow.proto.framework.SavedUserObject.Builder, org.tensorflow.proto.framework.SavedUserObjectOrBuilder> userObjectBuilder_; - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public boolean hasUserObject() { - return kindCase_ == 4; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public org.tensorflow.proto.framework.SavedUserObject getUserObject() { - if (userObjectBuilder_ == null) { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.SavedUserObject) kind_; - } - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } else { - if (kindCase_ == 4) { - return userObjectBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public Builder setUserObject(org.tensorflow.proto.framework.SavedUserObject value) { - if (userObjectBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - userObjectBuilder_.setMessage(value); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public Builder setUserObject( - org.tensorflow.proto.framework.SavedUserObject.Builder builderForValue) { - if (userObjectBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - userObjectBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public Builder mergeUserObject(org.tensorflow.proto.framework.SavedUserObject value) { - if (userObjectBuilder_ == null) { - if (kindCase_ == 4 && - kind_ != org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedUserObject.newBuilder((org.tensorflow.proto.framework.SavedUserObject) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 4) { - userObjectBuilder_.mergeFrom(value); - } - userObjectBuilder_.setMessage(value); - } - kindCase_ = 4; - return this; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public Builder clearUserObject() { - if (userObjectBuilder_ == null) { - if (kindCase_ == 4) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 4) { - kindCase_ = 0; - kind_ = null; - } - userObjectBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public org.tensorflow.proto.framework.SavedUserObject.Builder getUserObjectBuilder() { - return getUserObjectFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - public org.tensorflow.proto.framework.SavedUserObjectOrBuilder getUserObjectOrBuilder() { - if ((kindCase_ == 4) && (userObjectBuilder_ != null)) { - return userObjectBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 4) { - return (org.tensorflow.proto.framework.SavedUserObject) kind_; - } - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedUserObject, org.tensorflow.proto.framework.SavedUserObject.Builder, org.tensorflow.proto.framework.SavedUserObjectOrBuilder> - getUserObjectFieldBuilder() { - if (userObjectBuilder_ == null) { - if (!(kindCase_ == 4)) { - kind_ = org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - userObjectBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedUserObject, org.tensorflow.proto.framework.SavedUserObject.Builder, org.tensorflow.proto.framework.SavedUserObjectOrBuilder>( - (org.tensorflow.proto.framework.SavedUserObject) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 4; - onChanged();; - return userObjectBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedAsset, org.tensorflow.proto.framework.SavedAsset.Builder, org.tensorflow.proto.framework.SavedAssetOrBuilder> assetBuilder_; - /** - * .tensorflow.SavedAsset asset = 5; - */ - public boolean hasAsset() { - return kindCase_ == 5; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public org.tensorflow.proto.framework.SavedAsset getAsset() { - if (assetBuilder_ == null) { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.SavedAsset) kind_; - } - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } else { - if (kindCase_ == 5) { - return assetBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public Builder setAsset(org.tensorflow.proto.framework.SavedAsset value) { - if (assetBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - assetBuilder_.setMessage(value); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public Builder setAsset( - org.tensorflow.proto.framework.SavedAsset.Builder builderForValue) { - if (assetBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - assetBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public Builder mergeAsset(org.tensorflow.proto.framework.SavedAsset value) { - if (assetBuilder_ == null) { - if (kindCase_ == 5 && - kind_ != org.tensorflow.proto.framework.SavedAsset.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedAsset.newBuilder((org.tensorflow.proto.framework.SavedAsset) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 5) { - assetBuilder_.mergeFrom(value); - } - assetBuilder_.setMessage(value); - } - kindCase_ = 5; - return this; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public Builder clearAsset() { - if (assetBuilder_ == null) { - if (kindCase_ == 5) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 5) { - kindCase_ = 0; - kind_ = null; - } - assetBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public org.tensorflow.proto.framework.SavedAsset.Builder getAssetBuilder() { - return getAssetFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - public org.tensorflow.proto.framework.SavedAssetOrBuilder getAssetOrBuilder() { - if ((kindCase_ == 5) && (assetBuilder_ != null)) { - return assetBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 5) { - return (org.tensorflow.proto.framework.SavedAsset) kind_; - } - return org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedAsset asset = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedAsset, org.tensorflow.proto.framework.SavedAsset.Builder, org.tensorflow.proto.framework.SavedAssetOrBuilder> - getAssetFieldBuilder() { - if (assetBuilder_ == null) { - if (!(kindCase_ == 5)) { - kind_ = org.tensorflow.proto.framework.SavedAsset.getDefaultInstance(); - } - assetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedAsset, org.tensorflow.proto.framework.SavedAsset.Builder, org.tensorflow.proto.framework.SavedAssetOrBuilder>( - (org.tensorflow.proto.framework.SavedAsset) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 5; - onChanged();; - return assetBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedFunction, org.tensorflow.proto.framework.SavedFunction.Builder, org.tensorflow.proto.framework.SavedFunctionOrBuilder> functionBuilder_; - /** - * .tensorflow.SavedFunction function = 6; - */ - public boolean hasFunction() { - return kindCase_ == 6; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public org.tensorflow.proto.framework.SavedFunction getFunction() { - if (functionBuilder_ == null) { - if (kindCase_ == 6) { - return (org.tensorflow.proto.framework.SavedFunction) kind_; - } - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } else { - if (kindCase_ == 6) { - return functionBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public Builder setFunction(org.tensorflow.proto.framework.SavedFunction value) { - if (functionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - functionBuilder_.setMessage(value); - } - kindCase_ = 6; - return this; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public Builder setFunction( - org.tensorflow.proto.framework.SavedFunction.Builder builderForValue) { - if (functionBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - functionBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 6; - return this; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public Builder mergeFunction(org.tensorflow.proto.framework.SavedFunction value) { - if (functionBuilder_ == null) { - if (kindCase_ == 6 && - kind_ != org.tensorflow.proto.framework.SavedFunction.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedFunction.newBuilder((org.tensorflow.proto.framework.SavedFunction) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 6) { - functionBuilder_.mergeFrom(value); - } - functionBuilder_.setMessage(value); - } - kindCase_ = 6; - return this; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public Builder clearFunction() { - if (functionBuilder_ == null) { - if (kindCase_ == 6) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 6) { - kindCase_ = 0; - kind_ = null; - } - functionBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public org.tensorflow.proto.framework.SavedFunction.Builder getFunctionBuilder() { - return getFunctionFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedFunction function = 6; - */ - public org.tensorflow.proto.framework.SavedFunctionOrBuilder getFunctionOrBuilder() { - if ((kindCase_ == 6) && (functionBuilder_ != null)) { - return functionBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 6) { - return (org.tensorflow.proto.framework.SavedFunction) kind_; - } - return org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedFunction function = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedFunction, org.tensorflow.proto.framework.SavedFunction.Builder, org.tensorflow.proto.framework.SavedFunctionOrBuilder> - getFunctionFieldBuilder() { - if (functionBuilder_ == null) { - if (!(kindCase_ == 6)) { - kind_ = org.tensorflow.proto.framework.SavedFunction.getDefaultInstance(); - } - functionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedFunction, org.tensorflow.proto.framework.SavedFunction.Builder, org.tensorflow.proto.framework.SavedFunctionOrBuilder>( - (org.tensorflow.proto.framework.SavedFunction) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 6; - onChanged();; - return functionBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder> variableBuilder_; - /** - * .tensorflow.SavedVariable variable = 7; - */ - public boolean hasVariable() { - return kindCase_ == 7; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public org.tensorflow.proto.framework.SavedVariable getVariable() { - if (variableBuilder_ == null) { - if (kindCase_ == 7) { - return (org.tensorflow.proto.framework.SavedVariable) kind_; - } - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } else { - if (kindCase_ == 7) { - return variableBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public Builder setVariable(org.tensorflow.proto.framework.SavedVariable value) { - if (variableBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - variableBuilder_.setMessage(value); - } - kindCase_ = 7; - return this; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public Builder setVariable( - org.tensorflow.proto.framework.SavedVariable.Builder builderForValue) { - if (variableBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - variableBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 7; - return this; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public Builder mergeVariable(org.tensorflow.proto.framework.SavedVariable value) { - if (variableBuilder_ == null) { - if (kindCase_ == 7 && - kind_ != org.tensorflow.proto.framework.SavedVariable.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedVariable.newBuilder((org.tensorflow.proto.framework.SavedVariable) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 7) { - variableBuilder_.mergeFrom(value); - } - variableBuilder_.setMessage(value); - } - kindCase_ = 7; - return this; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public Builder clearVariable() { - if (variableBuilder_ == null) { - if (kindCase_ == 7) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 7) { - kindCase_ = 0; - kind_ = null; - } - variableBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public org.tensorflow.proto.framework.SavedVariable.Builder getVariableBuilder() { - return getVariableFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - public org.tensorflow.proto.framework.SavedVariableOrBuilder getVariableOrBuilder() { - if ((kindCase_ == 7) && (variableBuilder_ != null)) { - return variableBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 7) { - return (org.tensorflow.proto.framework.SavedVariable) kind_; - } - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedVariable variable = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder> - getVariableFieldBuilder() { - if (variableBuilder_ == null) { - if (!(kindCase_ == 7)) { - kind_ = org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - variableBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedVariable, org.tensorflow.proto.framework.SavedVariable.Builder, org.tensorflow.proto.framework.SavedVariableOrBuilder>( - (org.tensorflow.proto.framework.SavedVariable) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 7; - onChanged();; - return variableBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedBareConcreteFunction, org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder, org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder> bareConcreteFunctionBuilder_; - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public boolean hasBareConcreteFunction() { - return kindCase_ == 8; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public org.tensorflow.proto.framework.SavedBareConcreteFunction getBareConcreteFunction() { - if (bareConcreteFunctionBuilder_ == null) { - if (kindCase_ == 8) { - return (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_; - } - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } else { - if (kindCase_ == 8) { - return bareConcreteFunctionBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public Builder setBareConcreteFunction(org.tensorflow.proto.framework.SavedBareConcreteFunction value) { - if (bareConcreteFunctionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - bareConcreteFunctionBuilder_.setMessage(value); - } - kindCase_ = 8; - return this; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public Builder setBareConcreteFunction( - org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder builderForValue) { - if (bareConcreteFunctionBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - bareConcreteFunctionBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 8; - return this; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public Builder mergeBareConcreteFunction(org.tensorflow.proto.framework.SavedBareConcreteFunction value) { - if (bareConcreteFunctionBuilder_ == null) { - if (kindCase_ == 8 && - kind_ != org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedBareConcreteFunction.newBuilder((org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 8) { - bareConcreteFunctionBuilder_.mergeFrom(value); - } - bareConcreteFunctionBuilder_.setMessage(value); - } - kindCase_ = 8; - return this; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public Builder clearBareConcreteFunction() { - if (bareConcreteFunctionBuilder_ == null) { - if (kindCase_ == 8) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 8) { - kindCase_ = 0; - kind_ = null; - } - bareConcreteFunctionBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder getBareConcreteFunctionBuilder() { - return getBareConcreteFunctionFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - public org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder() { - if ((kindCase_ == 8) && (bareConcreteFunctionBuilder_ != null)) { - return bareConcreteFunctionBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 8) { - return (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_; - } - return org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedBareConcreteFunction, org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder, org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder> - getBareConcreteFunctionFieldBuilder() { - if (bareConcreteFunctionBuilder_ == null) { - if (!(kindCase_ == 8)) { - kind_ = org.tensorflow.proto.framework.SavedBareConcreteFunction.getDefaultInstance(); - } - bareConcreteFunctionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedBareConcreteFunction, org.tensorflow.proto.framework.SavedBareConcreteFunction.Builder, org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder>( - (org.tensorflow.proto.framework.SavedBareConcreteFunction) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 8; - onChanged();; - return bareConcreteFunctionBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedConstant, org.tensorflow.proto.framework.SavedConstant.Builder, org.tensorflow.proto.framework.SavedConstantOrBuilder> constantBuilder_; - /** - * .tensorflow.SavedConstant constant = 9; - */ - public boolean hasConstant() { - return kindCase_ == 9; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public org.tensorflow.proto.framework.SavedConstant getConstant() { - if (constantBuilder_ == null) { - if (kindCase_ == 9) { - return (org.tensorflow.proto.framework.SavedConstant) kind_; - } - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } else { - if (kindCase_ == 9) { - return constantBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public Builder setConstant(org.tensorflow.proto.framework.SavedConstant value) { - if (constantBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - constantBuilder_.setMessage(value); - } - kindCase_ = 9; - return this; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public Builder setConstant( - org.tensorflow.proto.framework.SavedConstant.Builder builderForValue) { - if (constantBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - constantBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 9; - return this; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public Builder mergeConstant(org.tensorflow.proto.framework.SavedConstant value) { - if (constantBuilder_ == null) { - if (kindCase_ == 9 && - kind_ != org.tensorflow.proto.framework.SavedConstant.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedConstant.newBuilder((org.tensorflow.proto.framework.SavedConstant) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 9) { - constantBuilder_.mergeFrom(value); - } - constantBuilder_.setMessage(value); - } - kindCase_ = 9; - return this; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public Builder clearConstant() { - if (constantBuilder_ == null) { - if (kindCase_ == 9) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 9) { - kindCase_ = 0; - kind_ = null; - } - constantBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public org.tensorflow.proto.framework.SavedConstant.Builder getConstantBuilder() { - return getConstantFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - public org.tensorflow.proto.framework.SavedConstantOrBuilder getConstantOrBuilder() { - if ((kindCase_ == 9) && (constantBuilder_ != null)) { - return constantBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 9) { - return (org.tensorflow.proto.framework.SavedConstant) kind_; - } - return org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedConstant constant = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedConstant, org.tensorflow.proto.framework.SavedConstant.Builder, org.tensorflow.proto.framework.SavedConstantOrBuilder> - getConstantFieldBuilder() { - if (constantBuilder_ == null) { - if (!(kindCase_ == 9)) { - kind_ = org.tensorflow.proto.framework.SavedConstant.getDefaultInstance(); - } - constantBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedConstant, org.tensorflow.proto.framework.SavedConstant.Builder, org.tensorflow.proto.framework.SavedConstantOrBuilder>( - (org.tensorflow.proto.framework.SavedConstant) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 9; - onChanged();; - return constantBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedResource, org.tensorflow.proto.framework.SavedResource.Builder, org.tensorflow.proto.framework.SavedResourceOrBuilder> resourceBuilder_; - /** - * .tensorflow.SavedResource resource = 10; - */ - public boolean hasResource() { - return kindCase_ == 10; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public org.tensorflow.proto.framework.SavedResource getResource() { - if (resourceBuilder_ == null) { - if (kindCase_ == 10) { - return (org.tensorflow.proto.framework.SavedResource) kind_; - } - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } else { - if (kindCase_ == 10) { - return resourceBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public Builder setResource(org.tensorflow.proto.framework.SavedResource value) { - if (resourceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - resourceBuilder_.setMessage(value); - } - kindCase_ = 10; - return this; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public Builder setResource( - org.tensorflow.proto.framework.SavedResource.Builder builderForValue) { - if (resourceBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - resourceBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 10; - return this; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public Builder mergeResource(org.tensorflow.proto.framework.SavedResource value) { - if (resourceBuilder_ == null) { - if (kindCase_ == 10 && - kind_ != org.tensorflow.proto.framework.SavedResource.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.SavedResource.newBuilder((org.tensorflow.proto.framework.SavedResource) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 10) { - resourceBuilder_.mergeFrom(value); - } - resourceBuilder_.setMessage(value); - } - kindCase_ = 10; - return this; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public Builder clearResource() { - if (resourceBuilder_ == null) { - if (kindCase_ == 10) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 10) { - kindCase_ = 0; - kind_ = null; - } - resourceBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public org.tensorflow.proto.framework.SavedResource.Builder getResourceBuilder() { - return getResourceFieldBuilder().getBuilder(); - } - /** - * .tensorflow.SavedResource resource = 10; - */ - public org.tensorflow.proto.framework.SavedResourceOrBuilder getResourceOrBuilder() { - if ((kindCase_ == 10) && (resourceBuilder_ != null)) { - return resourceBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 10) { - return (org.tensorflow.proto.framework.SavedResource) kind_; - } - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - } - /** - * .tensorflow.SavedResource resource = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedResource, org.tensorflow.proto.framework.SavedResource.Builder, org.tensorflow.proto.framework.SavedResourceOrBuilder> - getResourceFieldBuilder() { - if (resourceBuilder_ == null) { - if (!(kindCase_ == 10)) { - kind_ = org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SavedResource, org.tensorflow.proto.framework.SavedResource.Builder, org.tensorflow.proto.framework.SavedResourceOrBuilder>( - (org.tensorflow.proto.framework.SavedResource) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 10; - onChanged();; - return resourceBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CapturedTensor, org.tensorflow.proto.framework.CapturedTensor.Builder, org.tensorflow.proto.framework.CapturedTensorOrBuilder> capturedTensorBuilder_; - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public boolean hasCapturedTensor() { - return kindCase_ == 12; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public org.tensorflow.proto.framework.CapturedTensor getCapturedTensor() { - if (capturedTensorBuilder_ == null) { - if (kindCase_ == 12) { - return (org.tensorflow.proto.framework.CapturedTensor) kind_; - } - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } else { - if (kindCase_ == 12) { - return capturedTensorBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public Builder setCapturedTensor(org.tensorflow.proto.framework.CapturedTensor value) { - if (capturedTensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - capturedTensorBuilder_.setMessage(value); - } - kindCase_ = 12; - return this; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public Builder setCapturedTensor( - org.tensorflow.proto.framework.CapturedTensor.Builder builderForValue) { - if (capturedTensorBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - capturedTensorBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 12; - return this; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public Builder mergeCapturedTensor(org.tensorflow.proto.framework.CapturedTensor value) { - if (capturedTensorBuilder_ == null) { - if (kindCase_ == 12 && - kind_ != org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.CapturedTensor.newBuilder((org.tensorflow.proto.framework.CapturedTensor) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 12) { - capturedTensorBuilder_.mergeFrom(value); - } - capturedTensorBuilder_.setMessage(value); - } - kindCase_ = 12; - return this; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public Builder clearCapturedTensor() { - if (capturedTensorBuilder_ == null) { - if (kindCase_ == 12) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 12) { - kindCase_ = 0; - kind_ = null; - } - capturedTensorBuilder_.clear(); - } - return this; - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public org.tensorflow.proto.framework.CapturedTensor.Builder getCapturedTensorBuilder() { - return getCapturedTensorFieldBuilder().getBuilder(); - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - public org.tensorflow.proto.framework.CapturedTensorOrBuilder getCapturedTensorOrBuilder() { - if ((kindCase_ == 12) && (capturedTensorBuilder_ != null)) { - return capturedTensorBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 12) { - return (org.tensorflow.proto.framework.CapturedTensor) kind_; - } - return org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - } - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CapturedTensor, org.tensorflow.proto.framework.CapturedTensor.Builder, org.tensorflow.proto.framework.CapturedTensorOrBuilder> - getCapturedTensorFieldBuilder() { - if (capturedTensorBuilder_ == null) { - if (!(kindCase_ == 12)) { - kind_ = org.tensorflow.proto.framework.CapturedTensor.getDefaultInstance(); - } - capturedTensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.CapturedTensor, org.tensorflow.proto.framework.CapturedTensor.Builder, org.tensorflow.proto.framework.CapturedTensorOrBuilder>( - (org.tensorflow.proto.framework.CapturedTensor) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 12; - onChanged();; - return capturedTensorBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SaveableObject> saveableObjects_; - private com.google.protobuf.MapField - internalGetSaveableObjects() { - if (saveableObjects_ == null) { - return com.google.protobuf.MapField.emptyMapField( - SaveableObjectsDefaultEntryHolder.defaultEntry); - } - return saveableObjects_; - } - private com.google.protobuf.MapField - internalGetMutableSaveableObjects() { - onChanged();; - if (saveableObjects_ == null) { - saveableObjects_ = com.google.protobuf.MapField.newMapField( - SaveableObjectsDefaultEntryHolder.defaultEntry); - } - if (!saveableObjects_.isMutable()) { - saveableObjects_ = saveableObjects_.copy(); - } - return saveableObjects_; - } - - public int getSaveableObjectsCount() { - return internalGetSaveableObjects().getMap().size(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public boolean containsSaveableObjects( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetSaveableObjects().getMap().containsKey(key); - } - /** - * Use {@link #getSaveableObjectsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getSaveableObjects() { - return getSaveableObjectsMap(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public java.util.Map getSaveableObjectsMap() { - return internalGetSaveableObjects().getMap(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SaveableObject defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSaveableObjects().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetSaveableObjects().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearSaveableObjects() { - internalGetMutableSaveableObjects().getMutableMap() - .clear(); - return this; - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public Builder removeSaveableObjects( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableSaveableObjects().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableSaveableObjects() { - return internalGetMutableSaveableObjects().getMutableMap(); - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - public Builder putSaveableObjects( - java.lang.String key, - org.tensorflow.proto.framework.SaveableObject value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableSaveableObjects().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - public Builder putAllSaveableObjects( - java.util.Map values) { - internalGetMutableSaveableObjects().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.SavedObject) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedObject) - private static final org.tensorflow.proto.framework.SavedObject DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedObject(); - } - - public static org.tensorflow.proto.framework.SavedObject getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedObject parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedObject(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.SavedObject getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraph.java deleted file mode 100644 index 40a1e497db4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraph.java +++ /dev/null @@ -1,1231 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.SavedObjectGraph} - */ -public final class SavedObjectGraph extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedObjectGraph) - SavedObjectGraphOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedObjectGraph.newBuilder() to construct. - private SavedObjectGraph(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedObjectGraph() { - nodes_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedObjectGraph(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedObjectGraph( - 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)) { - nodes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nodes_.add( - input.readMessage(org.tensorflow.proto.framework.SavedObject.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - concreteFunctions_ = com.google.protobuf.MapField.newMapField( - ConcreteFunctionsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - concreteFunctions__ = input.readMessage( - ConcreteFunctionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - concreteFunctions_.getMutableMap().put( - concreteFunctions__.getKey(), concreteFunctions__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - nodes_ = java.util.Collections.unmodifiableList(nodes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetConcreteFunctions(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedObjectGraph.class, org.tensorflow.proto.framework.SavedObjectGraph.Builder.class); - } - - public static final int NODES_FIELD_NUMBER = 1; - private java.util.List nodes_; - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public java.util.List getNodesList() { - return nodes_; - } - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public java.util.List - getNodesOrBuilderList() { - return nodes_; - } - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public int getNodesCount() { - return nodes_.size(); - } - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObject getNodes(int index) { - return nodes_.get(index); - } - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObjectOrBuilder getNodesOrBuilder( - int index) { - return nodes_.get(index); - } - - public static final int CONCRETE_FUNCTIONS_FIELD_NUMBER = 2; - private static final class ConcreteFunctionsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.SavedConcreteFunction.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> concreteFunctions_; - private com.google.protobuf.MapField - internalGetConcreteFunctions() { - if (concreteFunctions_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConcreteFunctionsDefaultEntryHolder.defaultEntry); - } - return concreteFunctions_; - } - - public int getConcreteFunctionsCount() { - return internalGetConcreteFunctions().getMap().size(); - } - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public boolean containsConcreteFunctions( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConcreteFunctions().getMap().containsKey(key); - } - /** - * Use {@link #getConcreteFunctionsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getConcreteFunctions() { - return getConcreteFunctionsMap(); - } - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public java.util.Map getConcreteFunctionsMap() { - return internalGetConcreteFunctions().getMap(); - } - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SavedConcreteFunction defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConcreteFunctions().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConcreteFunctions().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 { - for (int i = 0; i < nodes_.size(); i++) { - output.writeMessage(1, nodes_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetConcreteFunctions(), - ConcreteFunctionsDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < nodes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, nodes_.get(i)); - } - for (java.util.Map.Entry entry - : internalGetConcreteFunctions().getMap().entrySet()) { - com.google.protobuf.MapEntry - concreteFunctions__ = ConcreteFunctionsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, concreteFunctions__); - } - 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.SavedObjectGraph)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedObjectGraph other = (org.tensorflow.proto.framework.SavedObjectGraph) obj; - - if (!getNodesList() - .equals(other.getNodesList())) return false; - if (!internalGetConcreteFunctions().equals( - other.internalGetConcreteFunctions())) 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 (getNodesCount() > 0) { - hash = (37 * hash) + NODES_FIELD_NUMBER; - hash = (53 * hash) + getNodesList().hashCode(); - } - if (!internalGetConcreteFunctions().getMap().isEmpty()) { - hash = (37 * hash) + CONCRETE_FUNCTIONS_FIELD_NUMBER; - hash = (53 * hash) + internalGetConcreteFunctions().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedObjectGraph parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObjectGraph 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.SavedObjectGraph parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObjectGraph 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.SavedObjectGraph parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedObjectGraph parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedObjectGraph parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObjectGraph 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.SavedObjectGraph parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObjectGraph 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.SavedObjectGraph parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedObjectGraph 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.SavedObjectGraph 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.SavedObjectGraph} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedObjectGraph) - org.tensorflow.proto.framework.SavedObjectGraphOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetConcreteFunctions(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableConcreteFunctions(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedObjectGraph.class, org.tensorflow.proto.framework.SavedObjectGraph.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedObjectGraph.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (nodesBuilder_ == null) { - nodes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodesBuilder_.clear(); - } - internalGetMutableConcreteFunctions().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedObjectGraph_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObjectGraph getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObjectGraph build() { - org.tensorflow.proto.framework.SavedObjectGraph result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedObjectGraph buildPartial() { - org.tensorflow.proto.framework.SavedObjectGraph result = new org.tensorflow.proto.framework.SavedObjectGraph(this); - int from_bitField0_ = bitField0_; - if (nodesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nodes_ = java.util.Collections.unmodifiableList(nodes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nodes_ = nodes_; - } else { - result.nodes_ = nodesBuilder_.build(); - } - result.concreteFunctions_ = internalGetConcreteFunctions(); - result.concreteFunctions_.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.SavedObjectGraph) { - return mergeFrom((org.tensorflow.proto.framework.SavedObjectGraph)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedObjectGraph other) { - if (other == org.tensorflow.proto.framework.SavedObjectGraph.getDefaultInstance()) return this; - if (nodesBuilder_ == null) { - if (!other.nodes_.isEmpty()) { - if (nodes_.isEmpty()) { - nodes_ = other.nodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodesIsMutable(); - nodes_.addAll(other.nodes_); - } - onChanged(); - } - } else { - if (!other.nodes_.isEmpty()) { - if (nodesBuilder_.isEmpty()) { - nodesBuilder_.dispose(); - nodesBuilder_ = null; - nodes_ = other.nodes_; - bitField0_ = (bitField0_ & ~0x00000001); - nodesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodesFieldBuilder() : null; - } else { - nodesBuilder_.addAllMessages(other.nodes_); - } - } - } - internalGetMutableConcreteFunctions().mergeFrom( - other.internalGetConcreteFunctions()); - 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.SavedObjectGraph parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedObjectGraph) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List nodes_ = - java.util.Collections.emptyList(); - private void ensureNodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nodes_ = new java.util.ArrayList(nodes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder> nodesBuilder_; - - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public java.util.List getNodesList() { - if (nodesBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodes_); - } else { - return nodesBuilder_.getMessageList(); - } - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public int getNodesCount() { - if (nodesBuilder_ == null) { - return nodes_.size(); - } else { - return nodesBuilder_.getCount(); - } - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObject getNodes(int index) { - if (nodesBuilder_ == null) { - return nodes_.get(index); - } else { - return nodesBuilder_.getMessage(index); - } - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder setNodes( - int index, org.tensorflow.proto.framework.SavedObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.set(index, value); - onChanged(); - } else { - nodesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder setNodes( - int index, org.tensorflow.proto.framework.SavedObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.set(index, builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder addNodes(org.tensorflow.proto.framework.SavedObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.add(value); - onChanged(); - } else { - nodesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder addNodes( - int index, org.tensorflow.proto.framework.SavedObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.add(index, value); - onChanged(); - } else { - nodesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder addNodes( - org.tensorflow.proto.framework.SavedObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.add(builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder addNodes( - int index, org.tensorflow.proto.framework.SavedObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.add(index, builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder addAllNodes( - java.lang.Iterable values) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodes_); - onChanged(); - } else { - nodesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder clearNodes() { - if (nodesBuilder_ == null) { - nodes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public Builder removeNodes(int index) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.remove(index); - onChanged(); - } else { - nodesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObject.Builder getNodesBuilder( - int index) { - return getNodesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObjectOrBuilder getNodesOrBuilder( - int index) { - if (nodesBuilder_ == null) { - return nodes_.get(index); } else { - return nodesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public java.util.List - getNodesOrBuilderList() { - if (nodesBuilder_ != null) { - return nodesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodes_); - } - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObject.Builder addNodesBuilder() { - return getNodesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.SavedObject.getDefaultInstance()); - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public org.tensorflow.proto.framework.SavedObject.Builder addNodesBuilder( - int index) { - return getNodesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.SavedObject.getDefaultInstance()); - } - /** - *
    -     * Flattened list of objects in the object graph.
    -     * The position of the object in this list indicates its id.
    -     * Nodes[0] is considered the root node.
    -     * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - public java.util.List - getNodesBuilderList() { - return getNodesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder> - getNodesFieldBuilder() { - if (nodesBuilder_ == null) { - nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.SavedObject, org.tensorflow.proto.framework.SavedObject.Builder, org.tensorflow.proto.framework.SavedObjectOrBuilder>( - nodes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nodes_ = null; - } - return nodesBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.SavedConcreteFunction> concreteFunctions_; - private com.google.protobuf.MapField - internalGetConcreteFunctions() { - if (concreteFunctions_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ConcreteFunctionsDefaultEntryHolder.defaultEntry); - } - return concreteFunctions_; - } - private com.google.protobuf.MapField - internalGetMutableConcreteFunctions() { - onChanged();; - if (concreteFunctions_ == null) { - concreteFunctions_ = com.google.protobuf.MapField.newMapField( - ConcreteFunctionsDefaultEntryHolder.defaultEntry); - } - if (!concreteFunctions_.isMutable()) { - concreteFunctions_ = concreteFunctions_.copy(); - } - return concreteFunctions_; - } - - public int getConcreteFunctionsCount() { - return internalGetConcreteFunctions().getMap().size(); - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public boolean containsConcreteFunctions( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetConcreteFunctions().getMap().containsKey(key); - } - /** - * Use {@link #getConcreteFunctionsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getConcreteFunctions() { - return getConcreteFunctionsMap(); - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public java.util.Map getConcreteFunctionsMap() { - return internalGetConcreteFunctions().getMap(); - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SavedConcreteFunction defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConcreteFunctions().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetConcreteFunctions().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearConcreteFunctions() { - internalGetMutableConcreteFunctions().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public Builder removeConcreteFunctions( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConcreteFunctions().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableConcreteFunctions() { - return internalGetMutableConcreteFunctions().getMutableMap(); - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - public Builder putConcreteFunctions( - java.lang.String key, - org.tensorflow.proto.framework.SavedConcreteFunction value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableConcreteFunctions().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Information about captures and output structures in concrete functions.
    -     * Referenced from SavedBareConcreteFunction and SavedFunction.
    -     * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - public Builder putAllConcreteFunctions( - java.util.Map values) { - internalGetMutableConcreteFunctions().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.SavedObjectGraph) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedObjectGraph) - private static final org.tensorflow.proto.framework.SavedObjectGraph DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedObjectGraph(); - } - - public static org.tensorflow.proto.framework.SavedObjectGraph getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedObjectGraph parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedObjectGraph(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.SavedObjectGraph getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphOrBuilder.java deleted file mode 100644 index 3d80fbc1306..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphOrBuilder.java +++ /dev/null @@ -1,122 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedObjectGraphOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedObjectGraph) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - java.util.List - getNodesList(); - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - org.tensorflow.proto.framework.SavedObject getNodes(int index); - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - int getNodesCount(); - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - java.util.List - getNodesOrBuilderList(); - /** - *
    -   * Flattened list of objects in the object graph.
    -   * The position of the object in this list indicates its id.
    -   * Nodes[0] is considered the root node.
    -   * 
    - * - * repeated .tensorflow.SavedObject nodes = 1; - */ - org.tensorflow.proto.framework.SavedObjectOrBuilder getNodesOrBuilder( - int index); - - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - int getConcreteFunctionsCount(); - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - boolean containsConcreteFunctions( - java.lang.String key); - /** - * Use {@link #getConcreteFunctionsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getConcreteFunctions(); - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - java.util.Map - getConcreteFunctionsMap(); - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SavedConcreteFunction defaultValue); - /** - *
    -   * Information about captures and output structures in concrete functions.
    -   * Referenced from SavedBareConcreteFunction and SavedFunction.
    -   * 
    - * - * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; - */ - - org.tensorflow.proto.framework.SavedConcreteFunction getConcreteFunctionsOrThrow( - java.lang.String key); -} 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 deleted file mode 100644 index d9cbd0a8f02..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectGraphProtos.java +++ /dev/null @@ -1,284 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public final class SavedObjectGraphProtos { - private SavedObjectGraphProtos() {} - 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_SavedObjectGraph_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedObject_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedObject_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedObject_SaveableObjectsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedUserObject_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedUserObject_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedAsset_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedAsset_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedFunction_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedFunction_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CapturedTensor_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CapturedTensor_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedConcreteFunction_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedBareConcreteFunction_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedConstant_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedConstant_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedVariable_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedVariable_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_FunctionSpec_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_FunctionSpec_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedResource_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedResource_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SaveableObject_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SaveableObject_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n1tensorflow/core/protobuf/saved_object_" + - "graph.proto\022\ntensorflow\032,tensorflow/core" + - "/framework/tensor_shape.proto\032%tensorflo" + - "w/core/framework/types.proto\032(tensorflow" + - "/core/framework/variable.proto\032(tensorfl" + - "ow/core/framework/versions.proto\032%tensor" + - "flow/core/protobuf/struct.proto\0325tensorf" + - "low/core/protobuf/trackable_object_graph" + - ".proto\"\350\001\n\020SavedObjectGraph\022&\n\005nodes\030\001 \003" + - "(\0132\027.tensorflow.SavedObject\022O\n\022concrete_" + - "functions\030\002 \003(\01323.tensorflow.SavedObject" + - "Graph.ConcreteFunctionsEntry\032[\n\026Concrete" + - "FunctionsEntry\022\013\n\003key\030\001 \001(\t\0220\n\005value\030\002 \001" + - "(\0132!.tensorflow.SavedConcreteFunction:\0028" + - "\001\"\220\006\n\013SavedObject\022R\n\010children\030\001 \003(\0132@.te" + - "nsorflow.TrackableObjectGraph.TrackableO" + - "bject.ObjectReference\022^\n\016slot_variables\030" + - "\003 \003(\0132F.tensorflow.TrackableObjectGraph." + - "TrackableObject.SlotVariableReference\0222\n" + - "\013user_object\030\004 \001(\0132\033.tensorflow.SavedUse" + - "rObjectH\000\022\'\n\005asset\030\005 \001(\0132\026.tensorflow.Sa" + - "vedAssetH\000\022-\n\010function\030\006 \001(\0132\031.tensorflo" + - "w.SavedFunctionH\000\022-\n\010variable\030\007 \001(\0132\031.te" + - "nsorflow.SavedVariableH\000\022G\n\026bare_concret" + - "e_function\030\010 \001(\0132%.tensorflow.SavedBareC" + - "oncreteFunctionH\000\022-\n\010constant\030\t \001(\0132\031.te" + - "nsorflow.SavedConstantH\000\022-\n\010resource\030\n \001" + - "(\0132\031.tensorflow.SavedResourceH\000\0225\n\017captu" + - "red_tensor\030\014 \001(\0132\032.tensorflow.CapturedTe" + - "nsorH\000\022F\n\020saveable_objects\030\013 \003(\0132,.tenso" + - "rflow.SavedObject.SaveableObjectsEntry\032R" + - "\n\024SaveableObjectsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005v" + - "alue\030\002 \001(\0132\032.tensorflow.SaveableObject:\002" + - "8\001B\006\n\004kindJ\004\010\002\020\003R\nattributes\"d\n\017SavedUse" + - "rObject\022\022\n\nidentifier\030\001 \001(\t\022\'\n\007version\030\002" + - " \001(\0132\026.tensorflow.VersionDef\022\024\n\010metadata" + - "\030\003 \001(\tB\002\030\001\"*\n\nSavedAsset\022\034\n\024asset_file_d" + - "ef_index\030\001 \001(\005\"\\\n\rSavedFunction\022\032\n\022concr" + - "ete_functions\030\001 \003(\t\022/\n\rfunction_spec\030\002 \001" + - "(\0132\030.tensorflow.FunctionSpec\"9\n\016Captured" + - "Tensor\022\014\n\004name\030\001 \001(\t\022\031\n\021concrete_functio" + - "n\030\002 \001(\t\"\250\001\n\025SavedConcreteFunction\022\024\n\014bou" + - "nd_inputs\030\002 \003(\005\022B\n\035canonicalized_input_s" + - "ignature\030\003 \001(\0132\033.tensorflow.StructuredVa" + - "lue\0225\n\020output_signature\030\004 \001(\0132\033.tensorfl" + - "ow.StructuredValue\"\255\001\n\031SavedBareConcrete" + - "Function\022\036\n\026concrete_function_name\030\001 \001(\t" + - "\022\031\n\021argument_keywords\030\002 \003(\t\022$\n\034allowed_p" + - "ositional_arguments\030\003 \001(\003\022/\n\rfunction_sp" + - "ec\030\004 \001(\0132\030.tensorflow.FunctionSpec\"\"\n\rSa" + - "vedConstant\022\021\n\toperation\030\001 \001(\t\"\327\002\n\rSaved" + - "Variable\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.Dat" + - "aType\022+\n\005shape\030\002 \001(\0132\034.tensorflow.Tensor" + - "ShapeProto\022\021\n\ttrainable\030\003 \001(\010\022<\n\017synchro" + - "nization\030\004 \001(\0162#.tensorflow.VariableSync" + - "hronization\0224\n\013aggregation\030\005 \001(\0162\037.tenso" + - "rflow.VariableAggregation\022\014\n\004name\030\006 \001(\t\022" + - "\016\n\006device\030\007 \001(\t\022O\n,experimental_distribu" + - "ted_variable_components\030\010 \003(\0132\031.tensorfl" + - "ow.SavedVariable\"\373\001\n\014FunctionSpec\0220\n\013ful" + - "largspec\030\001 \001(\0132\033.tensorflow.StructuredVa" + - "lue\022\021\n\tis_method\030\002 \001(\010\0224\n\017input_signatur" + - "e\030\005 \001(\0132\033.tensorflow.StructuredValue\0228\n\013" + - "jit_compile\030\006 \001(\0162#.tensorflow.FunctionS" + - "pec.JitCompile\"*\n\nJitCompile\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\rSavedR" + - "esource\022\016\n\006device\030\001 \001(\t\"A\n\016SaveableObjec" + - "t\022\025\n\rsave_function\030\002 \001(\005\022\030\n\020restore_func" + - "tion\030\003 \001(\005B\224\001\n\036org.tensorflow.proto.fram" + - "eworkB\026SavedObjectGraphProtosP\001ZUgithub." + - "com/tensorflow/tensorflow/tensorflow/go/" + - "core/protobuf/for_core_protos_go_proto\370\001" + - "\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - org.tensorflow.proto.framework.VariableProtos.getDescriptor(), - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(), - org.tensorflow.proto.framework.StructProtos.getDescriptor(), - org.tensorflow.proto.framework.TrackableObjectGraphProtos.getDescriptor(), - }); - internal_static_tensorflow_SavedObjectGraph_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedObjectGraph_descriptor, - new java.lang.String[] { "Nodes", "ConcreteFunctions", }); - internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor = - internal_static_tensorflow_SavedObjectGraph_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_SavedObject_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_SavedObject_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedObject_descriptor, - new java.lang.String[] { "Children", "SlotVariables", "UserObject", "Asset", "Function", "Variable", "BareConcreteFunction", "Constant", "Resource", "CapturedTensor", "SaveableObjects", "Kind", }); - internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor = - internal_static_tensorflow_SavedObject_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_SavedObject_SaveableObjectsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_SavedUserObject_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_SavedUserObject_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedUserObject_descriptor, - new java.lang.String[] { "Identifier", "Version", "Metadata", }); - internal_static_tensorflow_SavedAsset_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_SavedAsset_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedAsset_descriptor, - new java.lang.String[] { "AssetFileDefIndex", }); - internal_static_tensorflow_SavedFunction_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_SavedFunction_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedFunction_descriptor, - new java.lang.String[] { "ConcreteFunctions", "FunctionSpec", }); - internal_static_tensorflow_CapturedTensor_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_CapturedTensor_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CapturedTensor_descriptor, - new java.lang.String[] { "Name", "ConcreteFunction", }); - internal_static_tensorflow_SavedConcreteFunction_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedConcreteFunction_descriptor, - new java.lang.String[] { "BoundInputs", "CanonicalizedInputSignature", "OutputSignature", }); - internal_static_tensorflow_SavedBareConcreteFunction_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedBareConcreteFunction_descriptor, - new java.lang.String[] { "ConcreteFunctionName", "ArgumentKeywords", "AllowedPositionalArguments", "FunctionSpec", }); - internal_static_tensorflow_SavedConstant_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_tensorflow_SavedConstant_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedConstant_descriptor, - new java.lang.String[] { "Operation", }); - internal_static_tensorflow_SavedVariable_descriptor = - getDescriptor().getMessageTypes().get(9); - 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", "Device", "ExperimentalDistributedVariableComponents", }); - internal_static_tensorflow_FunctionSpec_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_tensorflow_FunctionSpec_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_FunctionSpec_descriptor, - new java.lang.String[] { "Fullargspec", "IsMethod", "InputSignature", "JitCompile", }); - internal_static_tensorflow_SavedResource_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_tensorflow_SavedResource_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedResource_descriptor, - new java.lang.String[] { "Device", }); - internal_static_tensorflow_SaveableObject_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_tensorflow_SaveableObject_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SaveableObject_descriptor, - new java.lang.String[] { "SaveFunction", "RestoreFunction", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - org.tensorflow.proto.framework.VariableProtos.getDescriptor(); - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(); - org.tensorflow.proto.framework.StructProtos.getDescriptor(); - org.tensorflow.proto.framework.TrackableObjectGraphProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectOrBuilder.java deleted file mode 100644 index 7a7ebf1b810..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedObjectOrBuilder.java +++ /dev/null @@ -1,262 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedObjectOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedObject) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - java.util.List - getChildrenList(); - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index); - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - int getChildrenCount(); - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - java.util.List - getChildrenOrBuilderList(); - /** - *
    -   * Objects which this object depends on: named edges in the dependency
    -   * graph.
    -   * Note: currently only valid if kind == "user_object" or "resource".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index); - - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - java.util.List - getSlotVariablesList(); - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index); - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - int getSlotVariablesCount(); - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - java.util.List - getSlotVariablesOrBuilderList(); - /** - *
    -   * Slot variables owned by this object. This describes the three-way
    -   * (optimizer, variable, slot variable) relationship; none of the three
    -   * depend on the others directly.
    -   * Note: currently only valid if kind == "user_object".
    -   * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index); - - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - boolean hasUserObject(); - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - org.tensorflow.proto.framework.SavedUserObject getUserObject(); - /** - * .tensorflow.SavedUserObject user_object = 4; - */ - org.tensorflow.proto.framework.SavedUserObjectOrBuilder getUserObjectOrBuilder(); - - /** - * .tensorflow.SavedAsset asset = 5; - */ - boolean hasAsset(); - /** - * .tensorflow.SavedAsset asset = 5; - */ - org.tensorflow.proto.framework.SavedAsset getAsset(); - /** - * .tensorflow.SavedAsset asset = 5; - */ - org.tensorflow.proto.framework.SavedAssetOrBuilder getAssetOrBuilder(); - - /** - * .tensorflow.SavedFunction function = 6; - */ - boolean hasFunction(); - /** - * .tensorflow.SavedFunction function = 6; - */ - org.tensorflow.proto.framework.SavedFunction getFunction(); - /** - * .tensorflow.SavedFunction function = 6; - */ - org.tensorflow.proto.framework.SavedFunctionOrBuilder getFunctionOrBuilder(); - - /** - * .tensorflow.SavedVariable variable = 7; - */ - boolean hasVariable(); - /** - * .tensorflow.SavedVariable variable = 7; - */ - org.tensorflow.proto.framework.SavedVariable getVariable(); - /** - * .tensorflow.SavedVariable variable = 7; - */ - org.tensorflow.proto.framework.SavedVariableOrBuilder getVariableOrBuilder(); - - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - boolean hasBareConcreteFunction(); - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - org.tensorflow.proto.framework.SavedBareConcreteFunction getBareConcreteFunction(); - /** - * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; - */ - org.tensorflow.proto.framework.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder(); - - /** - * .tensorflow.SavedConstant constant = 9; - */ - boolean hasConstant(); - /** - * .tensorflow.SavedConstant constant = 9; - */ - org.tensorflow.proto.framework.SavedConstant getConstant(); - /** - * .tensorflow.SavedConstant constant = 9; - */ - org.tensorflow.proto.framework.SavedConstantOrBuilder getConstantOrBuilder(); - - /** - * .tensorflow.SavedResource resource = 10; - */ - boolean hasResource(); - /** - * .tensorflow.SavedResource resource = 10; - */ - org.tensorflow.proto.framework.SavedResource getResource(); - /** - * .tensorflow.SavedResource resource = 10; - */ - org.tensorflow.proto.framework.SavedResourceOrBuilder getResourceOrBuilder(); - - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - boolean hasCapturedTensor(); - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - org.tensorflow.proto.framework.CapturedTensor getCapturedTensor(); - /** - * .tensorflow.CapturedTensor captured_tensor = 12; - */ - org.tensorflow.proto.framework.CapturedTensorOrBuilder getCapturedTensorOrBuilder(); - - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - int getSaveableObjectsCount(); - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - boolean containsSaveableObjects( - java.lang.String key); - /** - * Use {@link #getSaveableObjectsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getSaveableObjects(); - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - java.util.Map - getSaveableObjectsMap(); - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.SaveableObject defaultValue); - /** - * map<string, .tensorflow.SaveableObject> saveable_objects = 11; - */ - - org.tensorflow.proto.framework.SaveableObject getSaveableObjectsOrThrow( - java.lang.String key); - - public org.tensorflow.proto.framework.SavedObject.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResource.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResource.java deleted file mode 100644 index b45f7ff73a9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResource.java +++ /dev/null @@ -1,600 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A SavedResource represents a TF object that holds state during its lifetime.
    - * An object of this type can have a reference to a:
    - * create_resource() and an initialize() function.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedResource} - */ -public final class SavedResource extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedResource) - SavedResourceOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedResource.newBuilder() to construct. - private SavedResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedResource() { - device_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedResource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedResource( - 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(); - - device_ = s; - 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.SavedObjectGraphProtos.internal_static_tensorflow_SavedResource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedResource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedResource.class, org.tensorflow.proto.framework.SavedResource.Builder.class); - } - - public static final int DEVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object device_; - /** - *
    -   * A device specification indicating a required placement for the resource
    -   * creation function, e.g. "CPU". An empty string allows the user to select a
    -   * device.
    -   * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -   * A device specification indicating a required placement for the resource
    -   * creation function, e.g. "CPU". An empty string allows the user to select a
    -   * device.
    -   * 
    - * - * string device = 1; - */ - 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; - } - } - - 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 (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_); - } - 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.SavedResource)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedResource other = (org.tensorflow.proto.framework.SavedResource) obj; - - if (!getDevice() - .equals(other.getDevice())) 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_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedResource parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedResource 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.SavedResource parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedResource 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.SavedResource parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedResource parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedResource parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedResource 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.SavedResource parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedResource 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.SavedResource parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedResource 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.SavedResource 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 SavedResource represents a TF object that holds state during its lifetime.
    -   * An object of this type can have a reference to a:
    -   * create_resource() and an initialize() function.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedResource} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedResource) - org.tensorflow.proto.framework.SavedResourceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedResource_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedResource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedResource.class, org.tensorflow.proto.framework.SavedResource.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedResource.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(); - device_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedResource_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedResource getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedResource.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedResource build() { - org.tensorflow.proto.framework.SavedResource result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedResource buildPartial() { - org.tensorflow.proto.framework.SavedResource result = new org.tensorflow.proto.framework.SavedResource(this); - result.device_ = device_; - 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.SavedResource) { - return mergeFrom((org.tensorflow.proto.framework.SavedResource)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedResource other) { - if (other == org.tensorflow.proto.framework.SavedResource.getDefaultInstance()) return this; - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - 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.SavedResource parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedResource) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object device_ = ""; - /** - *
    -     * A device specification indicating a required placement for the resource
    -     * creation function, e.g. "CPU". An empty string allows the user to select a
    -     * device.
    -     * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -     * A device specification indicating a required placement for the resource
    -     * creation function, e.g. "CPU". An empty string allows the user to select a
    -     * device.
    -     * 
    - * - * string device = 1; - */ - 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; - } - } - /** - *
    -     * A device specification indicating a required placement for the resource
    -     * creation function, e.g. "CPU". An empty string allows the user to select a
    -     * device.
    -     * 
    - * - * string device = 1; - */ - public Builder setDevice( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - /** - *
    -     * A device specification indicating a required placement for the resource
    -     * creation function, e.g. "CPU". An empty string allows the user to select a
    -     * device.
    -     * 
    - * - * string device = 1; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -     * A device specification indicating a required placement for the resource
    -     * creation function, e.g. "CPU". An empty string allows the user to select a
    -     * device.
    -     * 
    - * - * string device = 1; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - 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.SavedResource) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedResource) - private static final org.tensorflow.proto.framework.SavedResource DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedResource(); - } - - public static org.tensorflow.proto.framework.SavedResource getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedResource parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedResource(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.SavedResource getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResourceOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResourceOrBuilder.java deleted file mode 100644 index 5d78c2eea9b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedResourceOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedResourceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedResource) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * A device specification indicating a required placement for the resource
    -   * creation function, e.g. "CPU". An empty string allows the user to select a
    -   * device.
    -   * 
    - * - * string device = 1; - */ - java.lang.String getDevice(); - /** - *
    -   * A device specification indicating a required placement for the resource
    -   * creation function, e.g. "CPU". An empty string allows the user to select a
    -   * device.
    -   * 
    - * - * string device = 1; - */ - com.google.protobuf.ByteString - getDeviceBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObject.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObject.java deleted file mode 100644 index 3a9b3868396..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObject.java +++ /dev/null @@ -1,995 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A SavedUserObject is an object (in the object-oriented language of the
    - * TensorFlow program) of some user- or framework-defined class other than
    - * those handled specifically by the other kinds of SavedObjects.
    - * This object cannot be evaluated as a tensor, and therefore cannot be bound
    - * to an input of a function.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedUserObject} - */ -public final class SavedUserObject extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedUserObject) - SavedUserObjectOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedUserObject.newBuilder() to construct. - private SavedUserObject(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedUserObject() { - identifier_ = ""; - metadata_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedUserObject(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedUserObject( - 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(); - - identifier_ = s; - break; - } - case 18: { - org.tensorflow.proto.framework.VersionDef.Builder subBuilder = null; - if (version_ != null) { - subBuilder = version_.toBuilder(); - } - version_ = input.readMessage(org.tensorflow.proto.framework.VersionDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(version_); - version_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - metadata_ = s; - 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.SavedObjectGraphProtos.internal_static_tensorflow_SavedUserObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedUserObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedUserObject.class, org.tensorflow.proto.framework.SavedUserObject.Builder.class); - } - - public static final int IDENTIFIER_FIELD_NUMBER = 1; - private volatile java.lang.Object identifier_; - /** - *
    -   * Corresponds to a registration of the type to use in the loading program.
    -   * 
    - * - * string identifier = 1; - */ - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - 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(); - identifier_ = s; - return s; - } - } - /** - *
    -   * Corresponds to a registration of the type to use in the loading program.
    -   * 
    - * - * string identifier = 1; - */ - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSION_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.VersionDef version_; - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public boolean hasVersion() { - return version_ != null; - } - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public org.tensorflow.proto.framework.VersionDef getVersion() { - return version_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder() { - return getVersion(); - } - - public static final int METADATA_FIELD_NUMBER = 3; - private volatile java.lang.Object metadata_; - /** - *
    -   * Metadata for deserializing this object.
    -   * Deprecated! At the time of deprecation, Keras was the only user of this
    -   * field, and its saving and loading code will be updated shortly.
    -   * Please save your application-specific metadata to a separate file.
    -   * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public java.lang.String getMetadata() { - java.lang.Object ref = metadata_; - 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(); - metadata_ = s; - return s; - } - } - /** - *
    -   * Metadata for deserializing this object.
    -   * Deprecated! At the time of deprecation, Keras was the only user of this
    -   * field, and its saving and loading code will be updated shortly.
    -   * Please save your application-specific metadata to a separate file.
    -   * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public com.google.protobuf.ByteString - getMetadataBytes() { - java.lang.Object ref = metadata_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metadata_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identifier_); - } - if (version_ != null) { - output.writeMessage(2, getVersion()); - } - if (!getMetadataBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, metadata_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identifier_); - } - if (version_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getVersion()); - } - if (!getMetadataBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, metadata_); - } - 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.SavedUserObject)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedUserObject other = (org.tensorflow.proto.framework.SavedUserObject) obj; - - if (!getIdentifier() - .equals(other.getIdentifier())) return false; - if (hasVersion() != other.hasVersion()) return false; - if (hasVersion()) { - if (!getVersion() - .equals(other.getVersion())) return false; - } - if (!getMetadata() - .equals(other.getMetadata())) 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) + IDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getIdentifier().hashCode(); - if (hasVersion()) { - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - } - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SavedUserObject parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedUserObject 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.SavedUserObject parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedUserObject 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.SavedUserObject parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedUserObject parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedUserObject parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedUserObject 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.SavedUserObject parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedUserObject 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.SavedUserObject parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedUserObject 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.SavedUserObject 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 SavedUserObject is an object (in the object-oriented language of the
    -   * TensorFlow program) of some user- or framework-defined class other than
    -   * those handled specifically by the other kinds of SavedObjects.
    -   * This object cannot be evaluated as a tensor, and therefore cannot be bound
    -   * to an input of a function.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedUserObject} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedUserObject) - org.tensorflow.proto.framework.SavedUserObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedUserObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedUserObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedUserObject.class, org.tensorflow.proto.framework.SavedUserObject.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedUserObject.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(); - identifier_ = ""; - - if (versionBuilder_ == null) { - version_ = null; - } else { - version_ = null; - versionBuilder_ = null; - } - metadata_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedUserObject_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedUserObject getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedUserObject build() { - org.tensorflow.proto.framework.SavedUserObject result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedUserObject buildPartial() { - org.tensorflow.proto.framework.SavedUserObject result = new org.tensorflow.proto.framework.SavedUserObject(this); - result.identifier_ = identifier_; - if (versionBuilder_ == null) { - result.version_ = version_; - } else { - result.version_ = versionBuilder_.build(); - } - result.metadata_ = metadata_; - 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.SavedUserObject) { - return mergeFrom((org.tensorflow.proto.framework.SavedUserObject)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedUserObject other) { - if (other == org.tensorflow.proto.framework.SavedUserObject.getDefaultInstance()) return this; - if (!other.getIdentifier().isEmpty()) { - identifier_ = other.identifier_; - onChanged(); - } - if (other.hasVersion()) { - mergeVersion(other.getVersion()); - } - if (!other.getMetadata().isEmpty()) { - metadata_ = other.metadata_; - onChanged(); - } - 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.SavedUserObject parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedUserObject) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object identifier_ = ""; - /** - *
    -     * Corresponds to a registration of the type to use in the loading program.
    -     * 
    - * - * string identifier = 1; - */ - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - identifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Corresponds to a registration of the type to use in the loading program.
    -     * 
    - * - * string identifier = 1; - */ - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Corresponds to a registration of the type to use in the loading program.
    -     * 
    - * - * string identifier = 1; - */ - public Builder setIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - identifier_ = value; - onChanged(); - return this; - } - /** - *
    -     * Corresponds to a registration of the type to use in the loading program.
    -     * 
    - * - * string identifier = 1; - */ - public Builder clearIdentifier() { - - identifier_ = getDefaultInstance().getIdentifier(); - onChanged(); - return this; - } - /** - *
    -     * Corresponds to a registration of the type to use in the loading program.
    -     * 
    - * - * string identifier = 1; - */ - public Builder setIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - identifier_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.VersionDef version_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> versionBuilder_; - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public boolean hasVersion() { - return versionBuilder_ != null || version_ != null; - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public org.tensorflow.proto.framework.VersionDef getVersion() { - if (versionBuilder_ == null) { - return version_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } else { - return versionBuilder_.getMessage(); - } - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public Builder setVersion(org.tensorflow.proto.framework.VersionDef value) { - if (versionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - version_ = value; - onChanged(); - } else { - versionBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public Builder setVersion( - org.tensorflow.proto.framework.VersionDef.Builder builderForValue) { - if (versionBuilder_ == null) { - version_ = builderForValue.build(); - onChanged(); - } else { - versionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public Builder mergeVersion(org.tensorflow.proto.framework.VersionDef value) { - if (versionBuilder_ == null) { - if (version_ != null) { - version_ = - org.tensorflow.proto.framework.VersionDef.newBuilder(version_).mergeFrom(value).buildPartial(); - } else { - version_ = value; - } - onChanged(); - } else { - versionBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public Builder clearVersion() { - if (versionBuilder_ == null) { - version_ = null; - onChanged(); - } else { - version_ = null; - versionBuilder_ = null; - } - - return this; - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public org.tensorflow.proto.framework.VersionDef.Builder getVersionBuilder() { - - onChanged(); - return getVersionFieldBuilder().getBuilder(); - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder() { - if (versionBuilder_ != null) { - return versionBuilder_.getMessageOrBuilder(); - } else { - return version_ == null ? - org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } - } - /** - *
    -     * Version information from the producer of this SavedUserObject.
    -     * 
    - * - * .tensorflow.VersionDef version = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> - getVersionFieldBuilder() { - if (versionBuilder_ == null) { - versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder>( - getVersion(), - getParentForChildren(), - isClean()); - version_ = null; - } - return versionBuilder_; - } - - private java.lang.Object metadata_ = ""; - /** - *
    -     * Metadata for deserializing this object.
    -     * Deprecated! At the time of deprecation, Keras was the only user of this
    -     * field, and its saving and loading code will be updated shortly.
    -     * Please save your application-specific metadata to a separate file.
    -     * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public java.lang.String getMetadata() { - java.lang.Object ref = metadata_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - metadata_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Metadata for deserializing this object.
    -     * Deprecated! At the time of deprecation, Keras was the only user of this
    -     * field, and its saving and loading code will be updated shortly.
    -     * Please save your application-specific metadata to a separate file.
    -     * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public com.google.protobuf.ByteString - getMetadataBytes() { - java.lang.Object ref = metadata_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - metadata_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Metadata for deserializing this object.
    -     * Deprecated! At the time of deprecation, Keras was the only user of this
    -     * field, and its saving and loading code will be updated shortly.
    -     * Please save your application-specific metadata to a separate file.
    -     * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setMetadata( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - metadata_ = value; - onChanged(); - return this; - } - /** - *
    -     * Metadata for deserializing this object.
    -     * Deprecated! At the time of deprecation, Keras was the only user of this
    -     * field, and its saving and loading code will be updated shortly.
    -     * Please save your application-specific metadata to a separate file.
    -     * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearMetadata() { - - metadata_ = getDefaultInstance().getMetadata(); - onChanged(); - return this; - } - /** - *
    -     * Metadata for deserializing this object.
    -     * Deprecated! At the time of deprecation, Keras was the only user of this
    -     * field, and its saving and loading code will be updated shortly.
    -     * Please save your application-specific metadata to a separate file.
    -     * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setMetadataBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metadata_ = value; - 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.SavedUserObject) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedUserObject) - private static final org.tensorflow.proto.framework.SavedUserObject DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedUserObject(); - } - - public static org.tensorflow.proto.framework.SavedUserObject getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedUserObject parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedUserObject(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.SavedUserObject getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObjectOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObjectOrBuilder.java deleted file mode 100644 index 71af4c08b68..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedUserObjectOrBuilder.java +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedUserObjectOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedUserObject) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Corresponds to a registration of the type to use in the loading program.
    -   * 
    - * - * string identifier = 1; - */ - java.lang.String getIdentifier(); - /** - *
    -   * Corresponds to a registration of the type to use in the loading program.
    -   * 
    - * - * string identifier = 1; - */ - com.google.protobuf.ByteString - getIdentifierBytes(); - - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - boolean hasVersion(); - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - org.tensorflow.proto.framework.VersionDef getVersion(); - /** - *
    -   * Version information from the producer of this SavedUserObject.
    -   * 
    - * - * .tensorflow.VersionDef version = 2; - */ - org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder(); - - /** - *
    -   * Metadata for deserializing this object.
    -   * Deprecated! At the time of deprecation, Keras was the only user of this
    -   * field, and its saving and loading code will be updated shortly.
    -   * Please save your application-specific metadata to a separate file.
    -   * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated java.lang.String getMetadata(); - /** - *
    -   * Metadata for deserializing this object.
    -   * Deprecated! At the time of deprecation, Keras was the only user of this
    -   * field, and its saving and loading code will be updated shortly.
    -   * Please save your application-specific metadata to a separate file.
    -   * 
    - * - * string metadata = 3 [deprecated = true]; - */ - @java.lang.Deprecated com.google.protobuf.ByteString - getMetadataBytes(); -} 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 deleted file mode 100644 index d42893242d7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariable.java +++ /dev/null @@ -1,1684 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a Variable that is initialized by loading the contents from the
    - * checkpoint.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedVariable} - */ -public final class SavedVariable extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedVariable) - SavedVariableOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedVariable.newBuilder() to construct. - private SavedVariable(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedVariable() { - dtype_ = 0; - synchronization_ = 0; - aggregation_ = 0; - name_ = ""; - device_ = ""; - experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedVariable(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedVariable( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - trainable_ = input.readBool(); - break; - } - case 32: { - int rawValue = input.readEnum(); - - synchronization_ = rawValue; - break; - } - case 40: { - int rawValue = input.readEnum(); - - aggregation_ = rawValue; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - 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)) { - 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)) { - experimentalDistributedVariableComponents_ = java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedVariable_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedVariable_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedVariable.class, org.tensorflow.proto.framework.SavedVariable.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int TRAINABLE_FIELD_NUMBER = 3; - private boolean trainable_; - /** - * bool trainable = 3; - */ - public boolean getTrainable() { - return trainable_; - } - - public static final int SYNCHRONIZATION_FIELD_NUMBER = 4; - private int synchronization_; - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public int getSynchronizationValue() { - return synchronization_; - } - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public org.tensorflow.proto.framework.VariableSynchronization getSynchronization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableSynchronization result = org.tensorflow.proto.framework.VariableSynchronization.valueOf(synchronization_); - return result == null ? org.tensorflow.proto.framework.VariableSynchronization.UNRECOGNIZED : result; - } - - public static final int AGGREGATION_FIELD_NUMBER = 5; - private int aggregation_; - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public int getAggregationValue() { - return aggregation_; - } - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public org.tensorflow.proto.framework.VariableAggregation getAggregation() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableAggregation result = org.tensorflow.proto.framework.VariableAggregation.valueOf(aggregation_); - return result == null ? org.tensorflow.proto.framework.VariableAggregation.UNRECOGNIZED : result; - } - - public static final int NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object name_; - /** - * string name = 6; - */ - 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; - } - } - /** - * string name = 6; - */ - 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_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() { - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (trainable_ != false) { - output.writeBool(3, trainable_); - } - if (synchronization_ != org.tensorflow.proto.framework.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { - output.writeEnum(4, synchronization_); - } - if (aggregation_ != org.tensorflow.proto.framework.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { - output.writeEnum(5, aggregation_); - } - 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); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (trainable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, trainable_); - } - if (synchronization_ != org.tensorflow.proto.framework.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, synchronization_); - } - if (aggregation_ != org.tensorflow.proto.framework.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, aggregation_); - } - 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; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.framework.SavedVariable)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SavedVariable other = (org.tensorflow.proto.framework.SavedVariable) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (getTrainable() - != other.getTrainable()) return false; - if (synchronization_ != other.synchronization_) return false; - 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; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + TRAINABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTrainable()); - hash = (37 * hash) + SYNCHRONIZATION_FIELD_NUMBER; - hash = (53 * hash) + synchronization_; - hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; - 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; - } - - public static org.tensorflow.proto.framework.SavedVariable parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedVariable 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.SavedVariable parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedVariable 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.SavedVariable parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SavedVariable parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SavedVariable parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedVariable 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.SavedVariable parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedVariable 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.SavedVariable parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SavedVariable 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.SavedVariable 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; - } - /** - *
    -   * Represents a Variable that is initialized by loading the contents from the
    -   * checkpoint.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedVariable} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedVariable) - org.tensorflow.proto.framework.SavedVariableOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedVariable_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedVariable_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SavedVariable.class, org.tensorflow.proto.framework.SavedVariable.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SavedVariable.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getExperimentalDistributedVariableComponentsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - trainable_ = false; - - synchronization_ = 0; - - aggregation_ = 0; - - name_ = ""; - - device_ = ""; - - if (experimentalDistributedVariableComponentsBuilder_ == null) { - experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - experimentalDistributedVariableComponentsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SavedObjectGraphProtos.internal_static_tensorflow_SavedVariable_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedVariable getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SavedVariable.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SavedVariable build() { - org.tensorflow.proto.framework.SavedVariable result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @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_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.trainable_ = trainable_; - 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; - } - - @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.SavedVariable) { - return mergeFrom((org.tensorflow.proto.framework.SavedVariable)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SavedVariable other) { - if (other == org.tensorflow.proto.framework.SavedVariable.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.getTrainable() != false) { - setTrainable(other.getTrainable()); - } - if (other.synchronization_ != 0) { - setSynchronizationValue(other.getSynchronizationValue()); - } - if (other.aggregation_ != 0) { - setAggregationValue(other.getAggregationValue()); - } - if (!other.getName().isEmpty()) { - 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; - } - - @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.SavedVariable parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SavedVariable) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private boolean trainable_ ; - /** - * bool trainable = 3; - */ - public boolean getTrainable() { - return trainable_; - } - /** - * bool trainable = 3; - */ - public Builder setTrainable(boolean value) { - - trainable_ = value; - onChanged(); - return this; - } - /** - * bool trainable = 3; - */ - public Builder clearTrainable() { - - trainable_ = false; - onChanged(); - return this; - } - - private int synchronization_ = 0; - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public int getSynchronizationValue() { - return synchronization_; - } - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public Builder setSynchronizationValue(int value) { - synchronization_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public org.tensorflow.proto.framework.VariableSynchronization getSynchronization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableSynchronization result = org.tensorflow.proto.framework.VariableSynchronization.valueOf(synchronization_); - return result == null ? org.tensorflow.proto.framework.VariableSynchronization.UNRECOGNIZED : result; - } - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public Builder setSynchronization(org.tensorflow.proto.framework.VariableSynchronization value) { - if (value == null) { - throw new NullPointerException(); - } - - synchronization_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - public Builder clearSynchronization() { - - synchronization_ = 0; - onChanged(); - return this; - } - - private int aggregation_ = 0; - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public int getAggregationValue() { - return aggregation_; - } - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public Builder setAggregationValue(int value) { - aggregation_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public org.tensorflow.proto.framework.VariableAggregation getAggregation() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableAggregation result = org.tensorflow.proto.framework.VariableAggregation.valueOf(aggregation_); - return result == null ? org.tensorflow.proto.framework.VariableAggregation.UNRECOGNIZED : result; - } - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public Builder setAggregation(org.tensorflow.proto.framework.VariableAggregation value) { - if (value == null) { - throw new NullPointerException(); - } - - aggregation_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - public Builder clearAggregation() { - - aggregation_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 6; - */ - 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; - } - } - /** - * string name = 6; - */ - 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; - } - } - /** - * string name = 6; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 6; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 6; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - 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) { - 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.SavedVariable) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedVariable) - private static final org.tensorflow.proto.framework.SavedVariable DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SavedVariable(); - } - - public static org.tensorflow.proto.framework.SavedVariable getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedVariable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedVariable(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.SavedVariable getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index b16be7224e4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedVariableOrBuilder.java +++ /dev/null @@ -1,133 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saved_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface SavedVariableOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedVariable) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * bool trainable = 3; - */ - boolean getTrainable(); - - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - int getSynchronizationValue(); - /** - * .tensorflow.VariableSynchronization synchronization = 4; - */ - org.tensorflow.proto.framework.VariableSynchronization getSynchronization(); - - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - int getAggregationValue(); - /** - * .tensorflow.VariableAggregation aggregation = 5; - */ - org.tensorflow.proto.framework.VariableAggregation getAggregation(); - - /** - * string name = 6; - */ - java.lang.String getName(); - /** - * string name = 6; - */ - 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/ScopedAllocatorOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ScopedAllocatorOptions.java deleted file mode 100644 index 37bf6f9c4d1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ScopedAllocatorOptions.java +++ /dev/null @@ -1,644 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.ScopedAllocatorOptions} - */ -public final class ScopedAllocatorOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ScopedAllocatorOptions) - ScopedAllocatorOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use ScopedAllocatorOptions.newBuilder() to construct. - private ScopedAllocatorOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ScopedAllocatorOptions() { - enableOp_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ScopedAllocatorOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ScopedAllocatorOptions( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - enableOp_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - enableOp_.add(s); - 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)) { - enableOp_ = enableOp_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ScopedAllocatorOptions.class, org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder.class); - } - - public static final int ENABLE_OP_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList enableOp_; - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - public com.google.protobuf.ProtocolStringList - getEnableOpList() { - return enableOp_; - } - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - public int getEnableOpCount() { - return enableOp_.size(); - } - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - public java.lang.String getEnableOp(int index) { - return enableOp_.get(index); - } - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - public com.google.protobuf.ByteString - getEnableOpBytes(int index) { - return enableOp_.getByteString(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 { - for (int i = 0; i < enableOp_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, enableOp_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < enableOp_.size(); i++) { - dataSize += computeStringSizeNoTag(enableOp_.getRaw(i)); - } - size += dataSize; - size += 1 * getEnableOpList().size(); - } - 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.ScopedAllocatorOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ScopedAllocatorOptions other = (org.tensorflow.proto.framework.ScopedAllocatorOptions) obj; - - if (!getEnableOpList() - .equals(other.getEnableOpList())) 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 (getEnableOpCount() > 0) { - hash = (37 * hash) + ENABLE_OP_FIELD_NUMBER; - hash = (53 * hash) + getEnableOpList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ScopedAllocatorOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ScopedAllocatorOptions 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.ScopedAllocatorOptions 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.ScopedAllocatorOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ScopedAllocatorOptions) - org.tensorflow.proto.framework.ScopedAllocatorOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ScopedAllocatorOptions.class, org.tensorflow.proto.framework.ScopedAllocatorOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ScopedAllocatorOptions.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(); - enableOp_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ScopedAllocatorOptions getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ScopedAllocatorOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ScopedAllocatorOptions build() { - org.tensorflow.proto.framework.ScopedAllocatorOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ScopedAllocatorOptions buildPartial() { - org.tensorflow.proto.framework.ScopedAllocatorOptions result = new org.tensorflow.proto.framework.ScopedAllocatorOptions(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - enableOp_ = enableOp_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.enableOp_ = enableOp_; - 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.ScopedAllocatorOptions) { - return mergeFrom((org.tensorflow.proto.framework.ScopedAllocatorOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ScopedAllocatorOptions other) { - if (other == org.tensorflow.proto.framework.ScopedAllocatorOptions.getDefaultInstance()) return this; - if (!other.enableOp_.isEmpty()) { - if (enableOp_.isEmpty()) { - enableOp_ = other.enableOp_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEnableOpIsMutable(); - enableOp_.addAll(other.enableOp_); - } - onChanged(); - } - 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.ScopedAllocatorOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ScopedAllocatorOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList enableOp_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureEnableOpIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - enableOp_ = new com.google.protobuf.LazyStringArrayList(enableOp_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public com.google.protobuf.ProtocolStringList - getEnableOpList() { - return enableOp_.getUnmodifiableView(); - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public int getEnableOpCount() { - return enableOp_.size(); - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public java.lang.String getEnableOp(int index) { - return enableOp_.get(index); - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public com.google.protobuf.ByteString - getEnableOpBytes(int index) { - return enableOp_.getByteString(index); - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public Builder setEnableOp( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnableOpIsMutable(); - enableOp_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public Builder addEnableOp( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnableOpIsMutable(); - enableOp_.add(value); - onChanged(); - return this; - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public Builder addAllEnableOp( - java.lang.Iterable values) { - ensureEnableOpIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, enableOp_); - onChanged(); - return this; - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public Builder clearEnableOp() { - enableOp_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * If present, only perform optimization for these ops.
    -     * 
    - * - * repeated string enable_op = 1; - */ - public Builder addEnableOpBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureEnableOpIsMutable(); - enableOp_.add(value); - 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.ScopedAllocatorOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ScopedAllocatorOptions) - private static final org.tensorflow.proto.framework.ScopedAllocatorOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ScopedAllocatorOptions(); - } - - public static org.tensorflow.proto.framework.ScopedAllocatorOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ScopedAllocatorOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ScopedAllocatorOptions(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.ScopedAllocatorOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ScopedAllocatorOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ScopedAllocatorOptionsOrBuilder.java deleted file mode 100644 index df536ed18a9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ScopedAllocatorOptionsOrBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/rewriter_config.proto - -package org.tensorflow.proto.framework; - -public interface ScopedAllocatorOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ScopedAllocatorOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - java.util.List - getEnableOpList(); - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - int getEnableOpCount(); - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - java.lang.String getEnableOp(int index); - /** - *
    -   * If present, only perform optimization for these ops.
    -   * 
    - * - * repeated string enable_op = 1; - */ - com.google.protobuf.ByteString - getEnableOpBytes(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfo.java deleted file mode 100644 index f44e0f0e52d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfo.java +++ /dev/null @@ -1,485 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Description of the session when an op is run.
    - * 
    - * - * Protobuf type {@code tensorflow.SessionInfo} - */ -public final class SessionInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SessionInfo) - SessionInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use SessionInfo.newBuilder() to construct. - private SessionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SessionInfo() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SessionInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SessionInfo( - 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: { - - intraOpParallelism_ = 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.framework.OpPerformanceDataProtos.internal_static_tensorflow_SessionInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_SessionInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SessionInfo.class, org.tensorflow.proto.framework.SessionInfo.Builder.class); - } - - public static final int INTRA_OP_PARALLELISM_FIELD_NUMBER = 1; - private long intraOpParallelism_; - /** - * int64 intra_op_parallelism = 1; - */ - public long getIntraOpParallelism() { - return intraOpParallelism_; - } - - 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 (intraOpParallelism_ != 0L) { - output.writeInt64(1, intraOpParallelism_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (intraOpParallelism_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, intraOpParallelism_); - } - 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.SessionInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SessionInfo other = (org.tensorflow.proto.framework.SessionInfo) obj; - - if (getIntraOpParallelism() - != other.getIntraOpParallelism()) 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) + INTRA_OP_PARALLELISM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getIntraOpParallelism()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SessionInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionInfo 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.SessionInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionInfo 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.SessionInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SessionInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionInfo 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.SessionInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionInfo 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.SessionInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionInfo 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.SessionInfo 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; - } - /** - *
    -   * Description of the session when an op is run.
    -   * 
    - * - * Protobuf type {@code tensorflow.SessionInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SessionInfo) - org.tensorflow.proto.framework.SessionInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_SessionInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_SessionInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SessionInfo.class, org.tensorflow.proto.framework.SessionInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SessionInfo.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(); - intraOpParallelism_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.OpPerformanceDataProtos.internal_static_tensorflow_SessionInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SessionInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionInfo build() { - org.tensorflow.proto.framework.SessionInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionInfo buildPartial() { - org.tensorflow.proto.framework.SessionInfo result = new org.tensorflow.proto.framework.SessionInfo(this); - result.intraOpParallelism_ = intraOpParallelism_; - 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.SessionInfo) { - return mergeFrom((org.tensorflow.proto.framework.SessionInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SessionInfo other) { - if (other == org.tensorflow.proto.framework.SessionInfo.getDefaultInstance()) return this; - if (other.getIntraOpParallelism() != 0L) { - setIntraOpParallelism(other.getIntraOpParallelism()); - } - 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.SessionInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SessionInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long intraOpParallelism_ ; - /** - * int64 intra_op_parallelism = 1; - */ - public long getIntraOpParallelism() { - return intraOpParallelism_; - } - /** - * int64 intra_op_parallelism = 1; - */ - public Builder setIntraOpParallelism(long value) { - - intraOpParallelism_ = value; - onChanged(); - return this; - } - /** - * int64 intra_op_parallelism = 1; - */ - public Builder clearIntraOpParallelism() { - - intraOpParallelism_ = 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.SessionInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SessionInfo) - private static final org.tensorflow.proto.framework.SessionInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SessionInfo(); - } - - public static org.tensorflow.proto.framework.SessionInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SessionInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SessionInfo(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.SessionInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfoOrBuilder.java deleted file mode 100644 index 43181b82317..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionInfoOrBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/grappler/costs/op_performance_data.proto - -package org.tensorflow.proto.framework; - -public interface SessionInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SessionInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 intra_op_parallelism = 1; - */ - long getIntraOpParallelism(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadata.java deleted file mode 100644 index a825437b468..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadata.java +++ /dev/null @@ -1,636 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Metadata about the session.
    - * This can be used by the runtime and the Ops for debugging, monitoring, etc.
    - * The (name, version) tuple is expected to be a unique identifier for
    - * sessions within the same process.
    - * NOTE: This is currently used and propagated only by the direct session.
    - * 
    - * - * Protobuf type {@code tensorflow.SessionMetadata} - */ -public final class SessionMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SessionMetadata) - SessionMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use SessionMetadata.newBuilder() to construct. - private SessionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SessionMetadata() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SessionMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SessionMetadata( - 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: { - - version_ = 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.framework.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_SessionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SessionMetadata.class, org.tensorflow.proto.framework.SessionMetadata.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 VERSION_FIELD_NUMBER = 2; - private long version_; - /** - *
    -   * The version is optional. If set, needs to be >= 0.
    -   * 
    - * - * int64 version = 2; - */ - public long getVersion() { - return version_; - } - - 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 (version_ != 0L) { - output.writeInt64(2, version_); - } - 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 (version_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, version_); - } - 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.SessionMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SessionMetadata other = (org.tensorflow.proto.framework.SessionMetadata) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getVersion() - != other.getVersion()) 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) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getVersion()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SessionMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionMetadata 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.SessionMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionMetadata 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.SessionMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SessionMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SessionMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionMetadata 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.SessionMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionMetadata 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.SessionMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SessionMetadata 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.SessionMetadata 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; - } - /** - *
    -   * Metadata about the session.
    -   * This can be used by the runtime and the Ops for debugging, monitoring, etc.
    -   * The (name, version) tuple is expected to be a unique identifier for
    -   * sessions within the same process.
    -   * NOTE: This is currently used and propagated only by the direct session.
    -   * 
    - * - * Protobuf type {@code tensorflow.SessionMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SessionMetadata) - org.tensorflow.proto.framework.SessionMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_SessionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SessionMetadata.class, org.tensorflow.proto.framework.SessionMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SessionMetadata.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_ = ""; - - version_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SessionMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionMetadata build() { - org.tensorflow.proto.framework.SessionMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SessionMetadata buildPartial() { - org.tensorflow.proto.framework.SessionMetadata result = new org.tensorflow.proto.framework.SessionMetadata(this); - result.name_ = name_; - result.version_ = version_; - 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.SessionMetadata) { - return mergeFrom((org.tensorflow.proto.framework.SessionMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SessionMetadata other) { - if (other == org.tensorflow.proto.framework.SessionMetadata.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getVersion() != 0L) { - setVersion(other.getVersion()); - } - 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.SessionMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SessionMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 long version_ ; - /** - *
    -     * The version is optional. If set, needs to be >= 0.
    -     * 
    - * - * int64 version = 2; - */ - public long getVersion() { - return version_; - } - /** - *
    -     * The version is optional. If set, needs to be >= 0.
    -     * 
    - * - * int64 version = 2; - */ - public Builder setVersion(long value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * The version is optional. If set, needs to be >= 0.
    -     * 
    - * - * int64 version = 2; - */ - public Builder clearVersion() { - - version_ = 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.SessionMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SessionMetadata) - private static final org.tensorflow.proto.framework.SessionMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SessionMetadata(); - } - - public static org.tensorflow.proto.framework.SessionMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SessionMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SessionMetadata(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.SessionMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDef.java deleted file mode 100644 index 73e8cf42672..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDef.java +++ /dev/null @@ -1,1339 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * SignatureDef defines the signature of a computation supported by a TensorFlow
    - * graph.
    - * For example, a model with two loss computations, sharing a single input,
    - * might have the following signature_def map, in a MetaGraphDef message.
    - * Note that across the two SignatureDefs "loss_A" and "loss_B", the input key,
    - * output key, and method_name are identical, and will be used by system(s) that
    - * implement or rely upon this particular loss method. The output tensor names
    - * differ, demonstrating how different outputs can exist for the same method.
    - * signature_def {
    - *   key: "loss_A"
    - *   value {
    - *     inputs {
    - *       key: "input"
    - *       value {
    - *         name: "input:0"
    - *         dtype: DT_STRING
    - *         tensor_shape: ...
    - *       }
    - *     }
    - *     outputs {
    - *       key: "loss_output"
    - *       value {
    - *         name: "loss_output_A:0"
    - *         dtype: DT_FLOAT
    - *         tensor_shape: ...
    - *       }
    - *     }
    - *     method_name: "some/package/compute_loss"
    - *   }
    - *   ...
    - * }
    - * signature_def {
    - *   key: "loss_B"
    - *   value {
    - *     inputs {
    - *       key: "input"
    - *       value {
    - *         name: "input:0"
    - *         dtype: DT_STRING
    - *         tensor_shape: ...
    - *       }
    - *     }
    - *     outputs {
    - *       key: "loss_output"
    - *       value {
    - *         name: "loss_output_B:0"
    - *         dtype: DT_FLOAT
    - *         tensor_shape: ...
    - *       }
    - *     }
    - *     method_name: "some/package/compute_loss"
    - *   }
    - *   ...
    - * }
    - * 
    - * - * Protobuf type {@code tensorflow.SignatureDef} - */ -public final class SignatureDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SignatureDef) - SignatureDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use SignatureDef.newBuilder() to construct. - private SignatureDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SignatureDef() { - methodName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SignatureDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SignatureDef( - 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)) { - inputs_ = com.google.protobuf.MapField.newMapField( - InputsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - inputs__ = input.readMessage( - InputsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - inputs_.getMutableMap().put( - inputs__.getKey(), inputs__.getValue()); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputs_ = com.google.protobuf.MapField.newMapField( - OutputsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - outputs__ = input.readMessage( - OutputsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - outputs_.getMutableMap().put( - outputs__.getKey(), outputs__.getValue()); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - methodName_ = s; - 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.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetInputs(); - case 2: - return internalGetOutputs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SignatureDef.class, org.tensorflow.proto.framework.SignatureDef.Builder.class); - } - - public static final int INPUTS_FIELD_NUMBER = 1; - private static final class InputsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_InputsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.TensorInfo.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> inputs_; - private com.google.protobuf.MapField - internalGetInputs() { - if (inputs_ == null) { - return com.google.protobuf.MapField.emptyMapField( - InputsDefaultEntryHolder.defaultEntry); - } - return inputs_; - } - - public int getInputsCount() { - return internalGetInputs().getMap().size(); - } - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public boolean containsInputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetInputs().getMap().containsKey(key); - } - /** - * Use {@link #getInputsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getInputs() { - return getInputsMap(); - } - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public java.util.Map getInputsMap() { - return internalGetInputs().getMap(); - } - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public org.tensorflow.proto.framework.TensorInfo getInputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetInputs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public org.tensorflow.proto.framework.TensorInfo getInputsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetInputs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int OUTPUTS_FIELD_NUMBER = 2; - private static final class OutputsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.framework.TensorInfo.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> outputs_; - private com.google.protobuf.MapField - internalGetOutputs() { - if (outputs_ == null) { - return com.google.protobuf.MapField.emptyMapField( - OutputsDefaultEntryHolder.defaultEntry); - } - return outputs_; - } - - public int getOutputsCount() { - return internalGetOutputs().getMap().size(); - } - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public boolean containsOutputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetOutputs().getMap().containsKey(key); - } - /** - * Use {@link #getOutputsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getOutputs() { - return getOutputsMap(); - } - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public java.util.Map getOutputsMap() { - return internalGetOutputs().getMap(); - } - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public org.tensorflow.proto.framework.TensorInfo getOutputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetOutputs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public org.tensorflow.proto.framework.TensorInfo getOutputsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetOutputs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int METHOD_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object methodName_; - /** - *
    -   * Extensible method_name information enabling third-party users to mark a
    -   * SignatureDef as supporting a particular method. This enables producers and
    -   * consumers of SignatureDefs, e.g. a model definition library and a serving
    -   * library to have a clear hand-off regarding the semantics of a computation.
    -   * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -   * method_name. This is commonly used to support multi-headed computation,
    -   * where a single graph computation may return multiple results.
    -   * 
    - * - * string method_name = 3; - */ - public java.lang.String getMethodName() { - java.lang.Object ref = methodName_; - 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(); - methodName_ = s; - return s; - } - } - /** - *
    -   * Extensible method_name information enabling third-party users to mark a
    -   * SignatureDef as supporting a particular method. This enables producers and
    -   * consumers of SignatureDefs, e.g. a model definition library and a serving
    -   * library to have a clear hand-off regarding the semantics of a computation.
    -   * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -   * method_name. This is commonly used to support multi-headed computation,
    -   * where a single graph computation may return multiple results.
    -   * 
    - * - * string method_name = 3; - */ - public com.google.protobuf.ByteString - getMethodNameBytes() { - java.lang.Object ref = methodName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - methodName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 - .serializeStringMapTo( - output, - internalGetInputs(), - InputsDefaultEntryHolder.defaultEntry, - 1); - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetOutputs(), - OutputsDefaultEntryHolder.defaultEntry, - 2); - if (!getMethodNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, methodName_); - } - 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 - : internalGetInputs().getMap().entrySet()) { - com.google.protobuf.MapEntry - inputs__ = InputsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, inputs__); - } - for (java.util.Map.Entry entry - : internalGetOutputs().getMap().entrySet()) { - com.google.protobuf.MapEntry - outputs__ = OutputsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, outputs__); - } - if (!getMethodNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, methodName_); - } - 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.SignatureDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SignatureDef other = (org.tensorflow.proto.framework.SignatureDef) obj; - - if (!internalGetInputs().equals( - other.internalGetInputs())) return false; - if (!internalGetOutputs().equals( - other.internalGetOutputs())) return false; - if (!getMethodName() - .equals(other.getMethodName())) 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 (!internalGetInputs().getMap().isEmpty()) { - hash = (37 * hash) + INPUTS_FIELD_NUMBER; - hash = (53 * hash) + internalGetInputs().hashCode(); - } - if (!internalGetOutputs().getMap().isEmpty()) { - hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; - hash = (53 * hash) + internalGetOutputs().hashCode(); - } - hash = (37 * hash) + METHOD_NAME_FIELD_NUMBER; - hash = (53 * hash) + getMethodName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SignatureDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SignatureDef 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.SignatureDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SignatureDef 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.SignatureDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SignatureDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SignatureDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SignatureDef 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.SignatureDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SignatureDef 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.SignatureDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SignatureDef 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.SignatureDef 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; - } - /** - *
    -   * SignatureDef defines the signature of a computation supported by a TensorFlow
    -   * graph.
    -   * For example, a model with two loss computations, sharing a single input,
    -   * might have the following signature_def map, in a MetaGraphDef message.
    -   * Note that across the two SignatureDefs "loss_A" and "loss_B", the input key,
    -   * output key, and method_name are identical, and will be used by system(s) that
    -   * implement or rely upon this particular loss method. The output tensor names
    -   * differ, demonstrating how different outputs can exist for the same method.
    -   * signature_def {
    -   *   key: "loss_A"
    -   *   value {
    -   *     inputs {
    -   *       key: "input"
    -   *       value {
    -   *         name: "input:0"
    -   *         dtype: DT_STRING
    -   *         tensor_shape: ...
    -   *       }
    -   *     }
    -   *     outputs {
    -   *       key: "loss_output"
    -   *       value {
    -   *         name: "loss_output_A:0"
    -   *         dtype: DT_FLOAT
    -   *         tensor_shape: ...
    -   *       }
    -   *     }
    -   *     method_name: "some/package/compute_loss"
    -   *   }
    -   *   ...
    -   * }
    -   * signature_def {
    -   *   key: "loss_B"
    -   *   value {
    -   *     inputs {
    -   *       key: "input"
    -   *       value {
    -   *         name: "input:0"
    -   *         dtype: DT_STRING
    -   *         tensor_shape: ...
    -   *       }
    -   *     }
    -   *     outputs {
    -   *       key: "loss_output"
    -   *       value {
    -   *         name: "loss_output_B:0"
    -   *         dtype: DT_FLOAT
    -   *         tensor_shape: ...
    -   *       }
    -   *     }
    -   *     method_name: "some/package/compute_loss"
    -   *   }
    -   *   ...
    -   * }
    -   * 
    - * - * Protobuf type {@code tensorflow.SignatureDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SignatureDef) - org.tensorflow.proto.framework.SignatureDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetInputs(); - case 2: - return internalGetOutputs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableInputs(); - case 2: - return internalGetMutableOutputs(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SignatureDef.class, org.tensorflow.proto.framework.SignatureDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SignatureDef.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(); - internalGetMutableInputs().clear(); - internalGetMutableOutputs().clear(); - methodName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SignatureDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SignatureDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SignatureDef build() { - org.tensorflow.proto.framework.SignatureDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SignatureDef buildPartial() { - org.tensorflow.proto.framework.SignatureDef result = new org.tensorflow.proto.framework.SignatureDef(this); - int from_bitField0_ = bitField0_; - result.inputs_ = internalGetInputs(); - result.inputs_.makeImmutable(); - result.outputs_ = internalGetOutputs(); - result.outputs_.makeImmutable(); - result.methodName_ = methodName_; - 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.SignatureDef) { - return mergeFrom((org.tensorflow.proto.framework.SignatureDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SignatureDef other) { - if (other == org.tensorflow.proto.framework.SignatureDef.getDefaultInstance()) return this; - internalGetMutableInputs().mergeFrom( - other.internalGetInputs()); - internalGetMutableOutputs().mergeFrom( - other.internalGetOutputs()); - if (!other.getMethodName().isEmpty()) { - methodName_ = other.methodName_; - onChanged(); - } - 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.SignatureDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SignatureDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> inputs_; - private com.google.protobuf.MapField - internalGetInputs() { - if (inputs_ == null) { - return com.google.protobuf.MapField.emptyMapField( - InputsDefaultEntryHolder.defaultEntry); - } - return inputs_; - } - private com.google.protobuf.MapField - internalGetMutableInputs() { - onChanged();; - if (inputs_ == null) { - inputs_ = com.google.protobuf.MapField.newMapField( - InputsDefaultEntryHolder.defaultEntry); - } - if (!inputs_.isMutable()) { - inputs_ = inputs_.copy(); - } - return inputs_; - } - - public int getInputsCount() { - return internalGetInputs().getMap().size(); - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public boolean containsInputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetInputs().getMap().containsKey(key); - } - /** - * Use {@link #getInputsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getInputs() { - return getInputsMap(); - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public java.util.Map getInputsMap() { - return internalGetInputs().getMap(); - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public org.tensorflow.proto.framework.TensorInfo getInputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetInputs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public org.tensorflow.proto.framework.TensorInfo getInputsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetInputs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearInputs() { - internalGetMutableInputs().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public Builder removeInputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableInputs().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableInputs() { - return internalGetMutableInputs().getMutableMap(); - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - public Builder putInputs( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableInputs().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Named input parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - public Builder putAllInputs( - java.util.Map values) { - internalGetMutableInputs().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.framework.TensorInfo> outputs_; - private com.google.protobuf.MapField - internalGetOutputs() { - if (outputs_ == null) { - return com.google.protobuf.MapField.emptyMapField( - OutputsDefaultEntryHolder.defaultEntry); - } - return outputs_; - } - private com.google.protobuf.MapField - internalGetMutableOutputs() { - onChanged();; - if (outputs_ == null) { - outputs_ = com.google.protobuf.MapField.newMapField( - OutputsDefaultEntryHolder.defaultEntry); - } - if (!outputs_.isMutable()) { - outputs_ = outputs_.copy(); - } - return outputs_; - } - - public int getOutputsCount() { - return internalGetOutputs().getMap().size(); - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public boolean containsOutputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetOutputs().getMap().containsKey(key); - } - /** - * Use {@link #getOutputsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getOutputs() { - return getOutputsMap(); - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public java.util.Map getOutputsMap() { - return internalGetOutputs().getMap(); - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public org.tensorflow.proto.framework.TensorInfo getOutputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetOutputs().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public org.tensorflow.proto.framework.TensorInfo getOutputsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetOutputs().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearOutputs() { - internalGetMutableOutputs().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public Builder removeOutputs( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableOutputs().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableOutputs() { - return internalGetMutableOutputs().getMutableMap(); - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - public Builder putOutputs( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableOutputs().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Named output parameters.
    -     * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - public Builder putAllOutputs( - java.util.Map values) { - internalGetMutableOutputs().getMutableMap() - .putAll(values); - return this; - } - - private java.lang.Object methodName_ = ""; - /** - *
    -     * Extensible method_name information enabling third-party users to mark a
    -     * SignatureDef as supporting a particular method. This enables producers and
    -     * consumers of SignatureDefs, e.g. a model definition library and a serving
    -     * library to have a clear hand-off regarding the semantics of a computation.
    -     * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -     * method_name. This is commonly used to support multi-headed computation,
    -     * where a single graph computation may return multiple results.
    -     * 
    - * - * string method_name = 3; - */ - public java.lang.String getMethodName() { - java.lang.Object ref = methodName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - methodName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Extensible method_name information enabling third-party users to mark a
    -     * SignatureDef as supporting a particular method. This enables producers and
    -     * consumers of SignatureDefs, e.g. a model definition library and a serving
    -     * library to have a clear hand-off regarding the semantics of a computation.
    -     * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -     * method_name. This is commonly used to support multi-headed computation,
    -     * where a single graph computation may return multiple results.
    -     * 
    - * - * string method_name = 3; - */ - public com.google.protobuf.ByteString - getMethodNameBytes() { - java.lang.Object ref = methodName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - methodName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Extensible method_name information enabling third-party users to mark a
    -     * SignatureDef as supporting a particular method. This enables producers and
    -     * consumers of SignatureDefs, e.g. a model definition library and a serving
    -     * library to have a clear hand-off regarding the semantics of a computation.
    -     * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -     * method_name. This is commonly used to support multi-headed computation,
    -     * where a single graph computation may return multiple results.
    -     * 
    - * - * string method_name = 3; - */ - public Builder setMethodName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - methodName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Extensible method_name information enabling third-party users to mark a
    -     * SignatureDef as supporting a particular method. This enables producers and
    -     * consumers of SignatureDefs, e.g. a model definition library and a serving
    -     * library to have a clear hand-off regarding the semantics of a computation.
    -     * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -     * method_name. This is commonly used to support multi-headed computation,
    -     * where a single graph computation may return multiple results.
    -     * 
    - * - * string method_name = 3; - */ - public Builder clearMethodName() { - - methodName_ = getDefaultInstance().getMethodName(); - onChanged(); - return this; - } - /** - *
    -     * Extensible method_name information enabling third-party users to mark a
    -     * SignatureDef as supporting a particular method. This enables producers and
    -     * consumers of SignatureDefs, e.g. a model definition library and a serving
    -     * library to have a clear hand-off regarding the semantics of a computation.
    -     * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -     * method_name. This is commonly used to support multi-headed computation,
    -     * where a single graph computation may return multiple results.
    -     * 
    - * - * string method_name = 3; - */ - public Builder setMethodNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - methodName_ = value; - 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.SignatureDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SignatureDef) - private static final org.tensorflow.proto.framework.SignatureDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SignatureDef(); - } - - public static org.tensorflow.proto.framework.SignatureDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SignatureDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SignatureDef(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.SignatureDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDefOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDefOrBuilder.java deleted file mode 100644 index e9234adf5f7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SignatureDefOrBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -public interface SignatureDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SignatureDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - int getInputsCount(); - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - boolean containsInputs( - java.lang.String key); - /** - * Use {@link #getInputsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getInputs(); - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - java.util.Map - getInputsMap(); - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - org.tensorflow.proto.framework.TensorInfo getInputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue); - /** - *
    -   * Named input parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> inputs = 1; - */ - - org.tensorflow.proto.framework.TensorInfo getInputsOrThrow( - java.lang.String key); - - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - int getOutputsCount(); - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - boolean containsOutputs( - java.lang.String key); - /** - * Use {@link #getOutputsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getOutputs(); - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - java.util.Map - getOutputsMap(); - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - org.tensorflow.proto.framework.TensorInfo getOutputsOrDefault( - java.lang.String key, - org.tensorflow.proto.framework.TensorInfo defaultValue); - /** - *
    -   * Named output parameters.
    -   * 
    - * - * map<string, .tensorflow.TensorInfo> outputs = 2; - */ - - org.tensorflow.proto.framework.TensorInfo getOutputsOrThrow( - java.lang.String key); - - /** - *
    -   * Extensible method_name information enabling third-party users to mark a
    -   * SignatureDef as supporting a particular method. This enables producers and
    -   * consumers of SignatureDefs, e.g. a model definition library and a serving
    -   * library to have a clear hand-off regarding the semantics of a computation.
    -   * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -   * method_name. This is commonly used to support multi-headed computation,
    -   * where a single graph computation may return multiple results.
    -   * 
    - * - * string method_name = 3; - */ - java.lang.String getMethodName(); - /** - *
    -   * Extensible method_name information enabling third-party users to mark a
    -   * SignatureDef as supporting a particular method. This enables producers and
    -   * consumers of SignatureDefs, e.g. a model definition library and a serving
    -   * library to have a clear hand-off regarding the semantics of a computation.
    -   * Note that multiple SignatureDefs in a single MetaGraphDef may have the same
    -   * method_name. This is commonly used to support multi-headed computation,
    -   * where a single graph computation may return multiple results.
    -   * 
    - * - * string method_name = 3; - */ - com.google.protobuf.ByteString - getMethodNameBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStats.java deleted file mode 100644 index 01a979698bd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStats.java +++ /dev/null @@ -1,765 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.StepStats} - */ -public final class StepStats extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.StepStats) - StepStatsOrBuilder { -private static final long serialVersionUID = 0L; - // Use StepStats.newBuilder() to construct. - private StepStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StepStats() { - devStats_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StepStats(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StepStats( - 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)) { - devStats_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - devStats_.add( - input.readMessage(org.tensorflow.proto.framework.DeviceStepStats.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_ & 0x00000001) != 0)) { - devStats_ = java.util.Collections.unmodifiableList(devStats_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_StepStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.StepStats.class, org.tensorflow.proto.framework.StepStats.Builder.class); - } - - public static final int DEV_STATS_FIELD_NUMBER = 1; - private java.util.List devStats_; - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public java.util.List getDevStatsList() { - return devStats_; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public java.util.List - getDevStatsOrBuilderList() { - return devStats_; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public int getDevStatsCount() { - return devStats_.size(); - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStats getDevStats(int index) { - return devStats_.get(index); - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStatsOrBuilder getDevStatsOrBuilder( - int index) { - return devStats_.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 { - for (int i = 0; i < devStats_.size(); i++) { - output.writeMessage(1, devStats_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < devStats_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, devStats_.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.StepStats)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.StepStats other = (org.tensorflow.proto.framework.StepStats) obj; - - if (!getDevStatsList() - .equals(other.getDevStatsList())) 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 (getDevStatsCount() > 0) { - hash = (37 * hash) + DEV_STATS_FIELD_NUMBER; - hash = (53 * hash) + getDevStatsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.StepStats parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StepStats 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.StepStats parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StepStats 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.StepStats parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StepStats parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.StepStats parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StepStats 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.StepStats parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StepStats 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.StepStats parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StepStats 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.StepStats 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.StepStats} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.StepStats) - org.tensorflow.proto.framework.StepStatsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_StepStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.StepStats.class, org.tensorflow.proto.framework.StepStats.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.StepStats.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDevStatsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (devStatsBuilder_ == null) { - devStats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - devStatsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.StepStats getDefaultInstanceForType() { - return org.tensorflow.proto.framework.StepStats.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.StepStats build() { - org.tensorflow.proto.framework.StepStats result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.StepStats buildPartial() { - org.tensorflow.proto.framework.StepStats result = new org.tensorflow.proto.framework.StepStats(this); - int from_bitField0_ = bitField0_; - if (devStatsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - devStats_ = java.util.Collections.unmodifiableList(devStats_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.devStats_ = devStats_; - } else { - result.devStats_ = devStatsBuilder_.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.StepStats) { - return mergeFrom((org.tensorflow.proto.framework.StepStats)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.StepStats other) { - if (other == org.tensorflow.proto.framework.StepStats.getDefaultInstance()) return this; - if (devStatsBuilder_ == null) { - if (!other.devStats_.isEmpty()) { - if (devStats_.isEmpty()) { - devStats_ = other.devStats_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDevStatsIsMutable(); - devStats_.addAll(other.devStats_); - } - onChanged(); - } - } else { - if (!other.devStats_.isEmpty()) { - if (devStatsBuilder_.isEmpty()) { - devStatsBuilder_.dispose(); - devStatsBuilder_ = null; - devStats_ = other.devStats_; - bitField0_ = (bitField0_ & ~0x00000001); - devStatsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDevStatsFieldBuilder() : null; - } else { - devStatsBuilder_.addAllMessages(other.devStats_); - } - } - } - 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.StepStats parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.StepStats) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List devStats_ = - java.util.Collections.emptyList(); - private void ensureDevStatsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - devStats_ = new java.util.ArrayList(devStats_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DeviceStepStats, org.tensorflow.proto.framework.DeviceStepStats.Builder, org.tensorflow.proto.framework.DeviceStepStatsOrBuilder> devStatsBuilder_; - - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public java.util.List getDevStatsList() { - if (devStatsBuilder_ == null) { - return java.util.Collections.unmodifiableList(devStats_); - } else { - return devStatsBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public int getDevStatsCount() { - if (devStatsBuilder_ == null) { - return devStats_.size(); - } else { - return devStatsBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStats getDevStats(int index) { - if (devStatsBuilder_ == null) { - return devStats_.get(index); - } else { - return devStatsBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder setDevStats( - int index, org.tensorflow.proto.framework.DeviceStepStats value) { - if (devStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevStatsIsMutable(); - devStats_.set(index, value); - onChanged(); - } else { - devStatsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder setDevStats( - int index, org.tensorflow.proto.framework.DeviceStepStats.Builder builderForValue) { - if (devStatsBuilder_ == null) { - ensureDevStatsIsMutable(); - devStats_.set(index, builderForValue.build()); - onChanged(); - } else { - devStatsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder addDevStats(org.tensorflow.proto.framework.DeviceStepStats value) { - if (devStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevStatsIsMutable(); - devStats_.add(value); - onChanged(); - } else { - devStatsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder addDevStats( - int index, org.tensorflow.proto.framework.DeviceStepStats value) { - if (devStatsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevStatsIsMutable(); - devStats_.add(index, value); - onChanged(); - } else { - devStatsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder addDevStats( - org.tensorflow.proto.framework.DeviceStepStats.Builder builderForValue) { - if (devStatsBuilder_ == null) { - ensureDevStatsIsMutable(); - devStats_.add(builderForValue.build()); - onChanged(); - } else { - devStatsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder addDevStats( - int index, org.tensorflow.proto.framework.DeviceStepStats.Builder builderForValue) { - if (devStatsBuilder_ == null) { - ensureDevStatsIsMutable(); - devStats_.add(index, builderForValue.build()); - onChanged(); - } else { - devStatsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder addAllDevStats( - java.lang.Iterable values) { - if (devStatsBuilder_ == null) { - ensureDevStatsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, devStats_); - onChanged(); - } else { - devStatsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder clearDevStats() { - if (devStatsBuilder_ == null) { - devStats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - devStatsBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public Builder removeDevStats(int index) { - if (devStatsBuilder_ == null) { - ensureDevStatsIsMutable(); - devStats_.remove(index); - onChanged(); - } else { - devStatsBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStats.Builder getDevStatsBuilder( - int index) { - return getDevStatsFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStatsOrBuilder getDevStatsOrBuilder( - int index) { - if (devStatsBuilder_ == null) { - return devStats_.get(index); } else { - return devStatsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public java.util.List - getDevStatsOrBuilderList() { - if (devStatsBuilder_ != null) { - return devStatsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(devStats_); - } - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStats.Builder addDevStatsBuilder() { - return getDevStatsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.DeviceStepStats.getDefaultInstance()); - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public org.tensorflow.proto.framework.DeviceStepStats.Builder addDevStatsBuilder( - int index) { - return getDevStatsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.DeviceStepStats.getDefaultInstance()); - } - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - public java.util.List - getDevStatsBuilderList() { - return getDevStatsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DeviceStepStats, org.tensorflow.proto.framework.DeviceStepStats.Builder, org.tensorflow.proto.framework.DeviceStepStatsOrBuilder> - getDevStatsFieldBuilder() { - if (devStatsBuilder_ == null) { - devStatsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.DeviceStepStats, org.tensorflow.proto.framework.DeviceStepStats.Builder, org.tensorflow.proto.framework.DeviceStepStatsOrBuilder>( - devStats_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - devStats_ = null; - } - return devStatsBuilder_; - } - @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.StepStats) - } - - // @@protoc_insertion_point(class_scope:tensorflow.StepStats) - private static final org.tensorflow.proto.framework.StepStats DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.StepStats(); - } - - public static org.tensorflow.proto.framework.StepStats getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StepStats parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StepStats(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.StepStats getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsOrBuilder.java deleted file mode 100644 index bb7cdf41046..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/step_stats.proto - -package org.tensorflow.proto.framework; - -public interface StepStatsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.StepStats) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - java.util.List - getDevStatsList(); - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - org.tensorflow.proto.framework.DeviceStepStats getDevStats(int index); - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - int getDevStatsCount(); - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - java.util.List - getDevStatsOrBuilderList(); - /** - * repeated .tensorflow.DeviceStepStats dev_stats = 1; - */ - org.tensorflow.proto.framework.DeviceStepStatsOrBuilder getDevStatsOrBuilder( - int index); -} 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 deleted file mode 100644 index 7f3f81e4d34..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructProtos.java +++ /dev/null @@ -1,216 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public final class StructProtos { - private StructProtos() {} - 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_StructuredValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_StructuredValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NoneValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NoneValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ListValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ListValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TupleValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TupleValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DictValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DictValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DictValue_FieldsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DictValue_FieldsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_PairValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_PairValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NamedTupleValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NamedTupleValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorSpecProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorSpecProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BoundedTensorSpecProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TypeSpecProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TypeSpecProto_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/struct.proto\022" + - "\ntensorflow\032&tensorflow/core/framework/t" + - "ensor.proto\032,tensorflow/core/framework/t" + - "ensor_shape.proto\032%tensorflow/core/frame" + - "work/types.proto\"\220\005\n\017StructuredValue\022+\n\n" + - "none_value\030\001 \001(\0132\025.tensorflow.NoneValueH" + - "\000\022\027\n\rfloat64_value\030\013 \001(\001H\000\022\025\n\013int64_valu" + - "e\030\014 \001(\022H\000\022\026\n\014string_value\030\r \001(\tH\000\022\024\n\nboo" + - "l_value\030\016 \001(\010H\000\022:\n\022tensor_shape_value\030\037 " + - "\001(\0132\034.tensorflow.TensorShapeProtoH\000\0222\n\022t" + - "ensor_dtype_value\030 \001(\0162\024.tensorflow.Dat" + - "aTypeH\000\0228\n\021tensor_spec_value\030! \001(\0132\033.ten" + - "sorflow.TensorSpecProtoH\000\0224\n\017type_spec_v" + - "alue\030\" \001(\0132\031.tensorflow.TypeSpecProtoH\000\022" + - "G\n\031bounded_tensor_spec_value\030# \001(\0132\".ten" + - "sorflow.BoundedTensorSpecProtoH\000\022+\n\nlist" + - "_value\0303 \001(\0132\025.tensorflow.ListValueH\000\022-\n" + - "\013tuple_value\0304 \001(\0132\026.tensorflow.TupleVal" + - "ueH\000\022+\n\ndict_value\0305 \001(\0132\025.tensorflow.Di" + - "ctValueH\000\0228\n\021named_tuple_value\0306 \001(\0132\033.t" + - "ensorflow.NamedTupleValueH\000B\006\n\004kind\"\013\n\tN" + - "oneValue\"8\n\tListValue\022+\n\006values\030\001 \003(\0132\033." + - "tensorflow.StructuredValue\"9\n\nTupleValue" + - "\022+\n\006values\030\001 \003(\0132\033.tensorflow.Structured" + - "Value\"\212\001\n\tDictValue\0221\n\006fields\030\001 \003(\0132!.te" + - "nsorflow.DictValue.FieldsEntry\032J\n\013Fields" + - "Entry\022\013\n\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.tens" + - "orflow.StructuredValue:\0028\001\"D\n\tPairValue\022" + - "\013\n\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.tensorflow" + - ".StructuredValue\"F\n\017NamedTupleValue\022\014\n\004n" + - "ame\030\001 \001(\t\022%\n\006values\030\002 \003(\0132\025.tensorflow.P" + - "airValue\"q\n\017TensorSpecProto\022\014\n\004name\030\001 \001(" + - "\t\022+\n\005shape\030\002 \001(\0132\034.tensorflow.TensorShap" + - "eProto\022#\n\005dtype\030\003 \001(\0162\024.tensorflow.DataT" + - "ype\"\314\001\n\026BoundedTensorSpecProto\022\014\n\004name\030\001" + - " \001(\t\022+\n\005shape\030\002 \001(\0132\034.tensorflow.TensorS" + - "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\"\333\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\"\270\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\n\022\030\n\024REGIS" + - "TERED_TYPE_SPEC\020\014\022\027\n\023EXTENSION_TYPE_SPEC" + - "\020\r\"\004\010\013\020\013B\207\001\n\036org.tensorflow.proto.framew" + - "orkB\014StructProtosP\001ZUgithub.com/tensorfl" + - "ow/tensorflow/tensorflow/go/core/protobu" + - "f/for_core_protos_go_protob\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_StructuredValue_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_StructuredValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_StructuredValue_descriptor, - new java.lang.String[] { "NoneValue", "Float64Value", "Int64Value", "StringValue", "BoolValue", "TensorShapeValue", "TensorDtypeValue", "TensorSpecValue", "TypeSpecValue", "BoundedTensorSpecValue", "ListValue", "TupleValue", "DictValue", "NamedTupleValue", "Kind", }); - internal_static_tensorflow_NoneValue_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_NoneValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NoneValue_descriptor, - new java.lang.String[] { }); - internal_static_tensorflow_ListValue_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_ListValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ListValue_descriptor, - new java.lang.String[] { "Values", }); - internal_static_tensorflow_TupleValue_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_TupleValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TupleValue_descriptor, - new java.lang.String[] { "Values", }); - internal_static_tensorflow_DictValue_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_DictValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DictValue_descriptor, - new java.lang.String[] { "Fields", }); - internal_static_tensorflow_DictValue_FieldsEntry_descriptor = - internal_static_tensorflow_DictValue_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_DictValue_FieldsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DictValue_FieldsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_PairValue_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_PairValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_PairValue_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_NamedTupleValue_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_NamedTupleValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NamedTupleValue_descriptor, - new java.lang.String[] { "Name", "Values", }); - internal_static_tensorflow_TensorSpecProto_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_TensorSpecProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorSpecProto_descriptor, - new java.lang.String[] { "Name", "Shape", "Dtype", }); - internal_static_tensorflow_BoundedTensorSpecProto_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BoundedTensorSpecProto_descriptor, - new java.lang.String[] { "Name", "Shape", "Dtype", "Minimum", "Maximum", }); - internal_static_tensorflow_TypeSpecProto_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_tensorflow_TypeSpecProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TypeSpecProto_descriptor, - new java.lang.String[] { "TypeSpecClass", "TypeState", "TypeSpecClassName", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValue.java deleted file mode 100644 index 327e919c2ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValue.java +++ /dev/null @@ -1,3423 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * `StructuredValue` represents a dynamically typed value representing various
    - * data structures that are inspired by Python data structures typically used in
    - * TensorFlow functions as inputs and outputs.
    - * For example when saving a Layer there may be a `training` argument. If the
    - * user passes a boolean True/False, that switches between two concrete
    - * TensorFlow functions. In order to switch between them in the same way after
    - * loading the SavedModel, we need to represent "True" and "False".
    - * A more advanced example might be a function which takes a list of
    - * dictionaries mapping from strings to Tensors. In order to map from
    - * user-specified arguments `[{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]`
    - * after load to the right saved TensorFlow function, we need to represent the
    - * nested structure and the strings, recording that we have a trace for anything
    - * matching `[{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([],
    - * tf.float64)}]` as an example.
    - * Likewise functions may return nested structures of Tensors, for example
    - * returning a dictionary mapping from strings to Tensors. In order for the
    - * loaded function to return the same structure we need to serialize it.
    - * This is an ergonomic aid for working with loaded SavedModels, not a promise
    - * to serialize all possible function signatures. For example we do not expect
    - * to pickle generic Python objects, and ideally we'd stay language-agnostic.
    - * 
    - * - * Protobuf type {@code tensorflow.StructuredValue} - */ -public final class StructuredValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.StructuredValue) - StructuredValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use StructuredValue.newBuilder() to construct. - private StructuredValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StructuredValue() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StructuredValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StructuredValue( - 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: { - org.tensorflow.proto.framework.NoneValue.Builder subBuilder = null; - if (kindCase_ == 1) { - subBuilder = ((org.tensorflow.proto.framework.NoneValue) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.NoneValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.NoneValue) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 1; - break; - } - case 89: { - kindCase_ = 11; - kind_ = input.readDouble(); - break; - } - case 96: { - kindCase_ = 12; - kind_ = input.readSInt64(); - break; - } - case 106: { - java.lang.String s = input.readStringRequireUtf8(); - kindCase_ = 13; - kind_ = s; - break; - } - case 112: { - kindCase_ = 14; - kind_ = input.readBool(); - break; - } - case 250: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (kindCase_ == 31) { - subBuilder = ((org.tensorflow.proto.framework.TensorShapeProto) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorShapeProto) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 31; - break; - } - case 256: { - int rawValue = input.readEnum(); - kindCase_ = 32; - kind_ = rawValue; - break; - } - case 266: { - org.tensorflow.proto.framework.TensorSpecProto.Builder subBuilder = null; - if (kindCase_ == 33) { - subBuilder = ((org.tensorflow.proto.framework.TensorSpecProto) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.TensorSpecProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorSpecProto) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 33; - break; - } - case 274: { - org.tensorflow.proto.framework.TypeSpecProto.Builder subBuilder = null; - if (kindCase_ == 34) { - subBuilder = ((org.tensorflow.proto.framework.TypeSpecProto) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.TypeSpecProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TypeSpecProto) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 34; - break; - } - case 282: { - org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder subBuilder = null; - if (kindCase_ == 35) { - subBuilder = ((org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.BoundedTensorSpecProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 35; - break; - } - case 410: { - org.tensorflow.proto.framework.ListValue.Builder subBuilder = null; - if (kindCase_ == 51) { - subBuilder = ((org.tensorflow.proto.framework.ListValue) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.ListValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.ListValue) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 51; - break; - } - case 418: { - org.tensorflow.proto.framework.TupleValue.Builder subBuilder = null; - if (kindCase_ == 52) { - subBuilder = ((org.tensorflow.proto.framework.TupleValue) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.TupleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TupleValue) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 52; - break; - } - case 426: { - org.tensorflow.proto.framework.DictValue.Builder subBuilder = null; - if (kindCase_ == 53) { - subBuilder = ((org.tensorflow.proto.framework.DictValue) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.DictValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.DictValue) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 53; - break; - } - case 434: { - org.tensorflow.proto.framework.NamedTupleValue.Builder subBuilder = null; - if (kindCase_ == 54) { - subBuilder = ((org.tensorflow.proto.framework.NamedTupleValue) kind_).toBuilder(); - } - kind_ = - input.readMessage(org.tensorflow.proto.framework.NamedTupleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.NamedTupleValue) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 54; - 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.StructProtos.internal_static_tensorflow_StructuredValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_StructuredValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.StructuredValue.class, org.tensorflow.proto.framework.StructuredValue.Builder.class); - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - NONE_VALUE(1), - FLOAT64_VALUE(11), - INT64_VALUE(12), - STRING_VALUE(13), - BOOL_VALUE(14), - TENSOR_SHAPE_VALUE(31), - TENSOR_DTYPE_VALUE(32), - TENSOR_SPEC_VALUE(33), - TYPE_SPEC_VALUE(34), - BOUNDED_TENSOR_SPEC_VALUE(35), - LIST_VALUE(51), - TUPLE_VALUE(52), - DICT_VALUE(53), - NAMED_TUPLE_VALUE(54), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: return NONE_VALUE; - case 11: return FLOAT64_VALUE; - case 12: return INT64_VALUE; - case 13: return STRING_VALUE; - case 14: return BOOL_VALUE; - case 31: return TENSOR_SHAPE_VALUE; - case 32: return TENSOR_DTYPE_VALUE; - case 33: return TENSOR_SPEC_VALUE; - case 34: return TYPE_SPEC_VALUE; - case 35: return BOUNDED_TENSOR_SPEC_VALUE; - case 51: return LIST_VALUE; - case 52: return TUPLE_VALUE; - case 53: return DICT_VALUE; - case 54: return NAMED_TUPLE_VALUE; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int NONE_VALUE_FIELD_NUMBER = 1; - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public boolean hasNoneValue() { - return kindCase_ == 1; - } - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public org.tensorflow.proto.framework.NoneValue getNoneValue() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.NoneValue) kind_; - } - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public org.tensorflow.proto.framework.NoneValueOrBuilder getNoneValueOrBuilder() { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.NoneValue) kind_; - } - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - - public static final int FLOAT64_VALUE_FIELD_NUMBER = 11; - /** - *
    -   * Represents a double-precision floating-point value (a Python `float`).
    -   * 
    - * - * double float64_value = 11; - */ - public double getFloat64Value() { - if (kindCase_ == 11) { - return (java.lang.Double) kind_; - } - return 0D; - } - - public static final int INT64_VALUE_FIELD_NUMBER = 12; - /** - *
    -   * Represents a signed integer value, limited to 64 bits.
    -   * Larger values from Python's arbitrary-precision integers are unsupported.
    -   * 
    - * - * sint64 int64_value = 12; - */ - public long getInt64Value() { - if (kindCase_ == 12) { - return (java.lang.Long) kind_; - } - return 0L; - } - - public static final int STRING_VALUE_FIELD_NUMBER = 13; - /** - *
    -   * Represents a string of Unicode characters stored in a Python `str`.
    -   * In Python 3, this is exactly what type `str` is.
    -   * In Python 2, this is the UTF-8 encoding of the characters.
    -   * For strings with ASCII characters only (as often used in TensorFlow code)
    -   * there is effectively no difference between the language versions.
    -   * The obsolescent `unicode` type of Python 2 is not supported here.
    -   * 
    - * - * string string_value = 13; - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (kindCase_ == 13) { - ref = kind_; - } - 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(); - if (kindCase_ == 13) { - kind_ = s; - } - return s; - } - } - /** - *
    -   * Represents a string of Unicode characters stored in a Python `str`.
    -   * In Python 3, this is exactly what type `str` is.
    -   * In Python 2, this is the UTF-8 encoding of the characters.
    -   * For strings with ASCII characters only (as often used in TensorFlow code)
    -   * there is effectively no difference between the language versions.
    -   * The obsolescent `unicode` type of Python 2 is not supported here.
    -   * 
    - * - * string string_value = 13; - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 13) { - ref = kind_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 13) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BOOL_VALUE_FIELD_NUMBER = 14; - /** - *
    -   * Represents a boolean value.
    -   * 
    - * - * bool bool_value = 14; - */ - public boolean getBoolValue() { - if (kindCase_ == 14) { - return (java.lang.Boolean) kind_; - } - return false; - } - - public static final int TENSOR_SHAPE_VALUE_FIELD_NUMBER = 31; - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public boolean hasTensorShapeValue() { - return kindCase_ == 31; - } - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShapeValue() { - if (kindCase_ == 31) { - return (org.tensorflow.proto.framework.TensorShapeProto) kind_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder() { - if (kindCase_ == 31) { - return (org.tensorflow.proto.framework.TensorShapeProto) kind_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - - public static final int TENSOR_DTYPE_VALUE_FIELD_NUMBER = 32; - /** - *
    -   * Represents an enum value for dtype.
    -   * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public int getTensorDtypeValueValue() { - if (kindCase_ == 32) { - return (java.lang.Integer) kind_; - } - return 0; - } - /** - *
    -   * Represents an enum value for dtype.
    -   * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public org.tensorflow.proto.framework.DataType getTensorDtypeValue() { - if (kindCase_ == 32) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf( - (java.lang.Integer) kind_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - return org.tensorflow.proto.framework.DataType.DT_INVALID; - } - - public static final int TENSOR_SPEC_VALUE_FIELD_NUMBER = 33; - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public boolean hasTensorSpecValue() { - return kindCase_ == 33; - } - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public org.tensorflow.proto.framework.TensorSpecProto getTensorSpecValue() { - if (kindCase_ == 33) { - return (org.tensorflow.proto.framework.TensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public org.tensorflow.proto.framework.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder() { - if (kindCase_ == 33) { - return (org.tensorflow.proto.framework.TensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - - public static final int TYPE_SPEC_VALUE_FIELD_NUMBER = 34; - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public boolean hasTypeSpecValue() { - return kindCase_ == 34; - } - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpecValue() { - if (kindCase_ == 34) { - return (org.tensorflow.proto.framework.TypeSpecProto) kind_; - } - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder() { - if (kindCase_ == 34) { - return (org.tensorflow.proto.framework.TypeSpecProto) kind_; - } - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - - public static final int BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER = 35; - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public boolean hasBoundedTensorSpecValue() { - return kindCase_ == 35; - } - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public org.tensorflow.proto.framework.BoundedTensorSpecProto getBoundedTensorSpecValue() { - if (kindCase_ == 35) { - return (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder() { - if (kindCase_ == 35) { - return (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - - public static final int LIST_VALUE_FIELD_NUMBER = 51; - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public boolean hasListValue() { - return kindCase_ == 51; - } - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public org.tensorflow.proto.framework.ListValue getListValue() { - if (kindCase_ == 51) { - return (org.tensorflow.proto.framework.ListValue) kind_; - } - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public org.tensorflow.proto.framework.ListValueOrBuilder getListValueOrBuilder() { - if (kindCase_ == 51) { - return (org.tensorflow.proto.framework.ListValue) kind_; - } - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - - public static final int TUPLE_VALUE_FIELD_NUMBER = 52; - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public boolean hasTupleValue() { - return kindCase_ == 52; - } - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public org.tensorflow.proto.framework.TupleValue getTupleValue() { - if (kindCase_ == 52) { - return (org.tensorflow.proto.framework.TupleValue) kind_; - } - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public org.tensorflow.proto.framework.TupleValueOrBuilder getTupleValueOrBuilder() { - if (kindCase_ == 52) { - return (org.tensorflow.proto.framework.TupleValue) kind_; - } - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - - public static final int DICT_VALUE_FIELD_NUMBER = 53; - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public boolean hasDictValue() { - return kindCase_ == 53; - } - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public org.tensorflow.proto.framework.DictValue getDictValue() { - if (kindCase_ == 53) { - return (org.tensorflow.proto.framework.DictValue) kind_; - } - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public org.tensorflow.proto.framework.DictValueOrBuilder getDictValueOrBuilder() { - if (kindCase_ == 53) { - return (org.tensorflow.proto.framework.DictValue) kind_; - } - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - - public static final int NAMED_TUPLE_VALUE_FIELD_NUMBER = 54; - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public boolean hasNamedTupleValue() { - return kindCase_ == 54; - } - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public org.tensorflow.proto.framework.NamedTupleValue getNamedTupleValue() { - if (kindCase_ == 54) { - return (org.tensorflow.proto.framework.NamedTupleValue) kind_; - } - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public org.tensorflow.proto.framework.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder() { - if (kindCase_ == 54) { - return (org.tensorflow.proto.framework.NamedTupleValue) kind_; - } - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - - 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 (kindCase_ == 1) { - output.writeMessage(1, (org.tensorflow.proto.framework.NoneValue) kind_); - } - if (kindCase_ == 11) { - output.writeDouble( - 11, (double)((java.lang.Double) kind_)); - } - if (kindCase_ == 12) { - output.writeSInt64( - 12, (long)((java.lang.Long) kind_)); - } - if (kindCase_ == 13) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, kind_); - } - if (kindCase_ == 14) { - output.writeBool( - 14, (boolean)((java.lang.Boolean) kind_)); - } - if (kindCase_ == 31) { - output.writeMessage(31, (org.tensorflow.proto.framework.TensorShapeProto) kind_); - } - if (kindCase_ == 32) { - output.writeEnum(32, ((java.lang.Integer) kind_)); - } - if (kindCase_ == 33) { - output.writeMessage(33, (org.tensorflow.proto.framework.TensorSpecProto) kind_); - } - if (kindCase_ == 34) { - output.writeMessage(34, (org.tensorflow.proto.framework.TypeSpecProto) kind_); - } - if (kindCase_ == 35) { - output.writeMessage(35, (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_); - } - if (kindCase_ == 51) { - output.writeMessage(51, (org.tensorflow.proto.framework.ListValue) kind_); - } - if (kindCase_ == 52) { - output.writeMessage(52, (org.tensorflow.proto.framework.TupleValue) kind_); - } - if (kindCase_ == 53) { - output.writeMessage(53, (org.tensorflow.proto.framework.DictValue) kind_); - } - if (kindCase_ == 54) { - output.writeMessage(54, (org.tensorflow.proto.framework.NamedTupleValue) kind_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (org.tensorflow.proto.framework.NoneValue) kind_); - } - if (kindCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize( - 11, (double)((java.lang.Double) kind_)); - } - if (kindCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeSInt64Size( - 12, (long)((java.lang.Long) kind_)); - } - if (kindCase_ == 13) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, kind_); - } - if (kindCase_ == 14) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 14, (boolean)((java.lang.Boolean) kind_)); - } - if (kindCase_ == 31) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(31, (org.tensorflow.proto.framework.TensorShapeProto) kind_); - } - if (kindCase_ == 32) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(32, ((java.lang.Integer) kind_)); - } - if (kindCase_ == 33) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(33, (org.tensorflow.proto.framework.TensorSpecProto) kind_); - } - if (kindCase_ == 34) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(34, (org.tensorflow.proto.framework.TypeSpecProto) kind_); - } - if (kindCase_ == 35) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(35, (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_); - } - if (kindCase_ == 51) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(51, (org.tensorflow.proto.framework.ListValue) kind_); - } - if (kindCase_ == 52) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(52, (org.tensorflow.proto.framework.TupleValue) kind_); - } - if (kindCase_ == 53) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(53, (org.tensorflow.proto.framework.DictValue) kind_); - } - if (kindCase_ == 54) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(54, (org.tensorflow.proto.framework.NamedTupleValue) kind_); - } - 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.StructuredValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.StructuredValue other = (org.tensorflow.proto.framework.StructuredValue) obj; - - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 1: - if (!getNoneValue() - .equals(other.getNoneValue())) return false; - break; - case 11: - if (java.lang.Double.doubleToLongBits(getFloat64Value()) - != java.lang.Double.doubleToLongBits( - other.getFloat64Value())) return false; - break; - case 12: - if (getInt64Value() - != other.getInt64Value()) return false; - break; - case 13: - if (!getStringValue() - .equals(other.getStringValue())) return false; - break; - case 14: - if (getBoolValue() - != other.getBoolValue()) return false; - break; - case 31: - if (!getTensorShapeValue() - .equals(other.getTensorShapeValue())) return false; - break; - case 32: - if (getTensorDtypeValueValue() - != other.getTensorDtypeValueValue()) return false; - break; - case 33: - if (!getTensorSpecValue() - .equals(other.getTensorSpecValue())) return false; - break; - case 34: - if (!getTypeSpecValue() - .equals(other.getTypeSpecValue())) return false; - break; - case 35: - if (!getBoundedTensorSpecValue() - .equals(other.getBoundedTensorSpecValue())) return false; - break; - case 51: - if (!getListValue() - .equals(other.getListValue())) return false; - break; - case 52: - if (!getTupleValue() - .equals(other.getTupleValue())) return false; - break; - case 53: - if (!getDictValue() - .equals(other.getDictValue())) return false; - break; - case 54: - if (!getNamedTupleValue() - .equals(other.getNamedTupleValue())) return false; - break; - case 0: - default: - } - 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(); - switch (kindCase_) { - case 1: - hash = (37 * hash) + NONE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getNoneValue().hashCode(); - break; - case 11: - hash = (37 * hash) + FLOAT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getFloat64Value())); - break; - case 12: - hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getInt64Value()); - break; - case 13: - hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStringValue().hashCode(); - break; - case 14: - hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getBoolValue()); - break; - case 31: - hash = (37 * hash) + TENSOR_SHAPE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getTensorShapeValue().hashCode(); - break; - case 32: - hash = (37 * hash) + TENSOR_DTYPE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getTensorDtypeValueValue(); - break; - case 33: - hash = (37 * hash) + TENSOR_SPEC_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getTensorSpecValue().hashCode(); - break; - case 34: - hash = (37 * hash) + TYPE_SPEC_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getTypeSpecValue().hashCode(); - break; - case 35: - hash = (37 * hash) + BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getBoundedTensorSpecValue().hashCode(); - break; - case 51: - hash = (37 * hash) + LIST_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getListValue().hashCode(); - break; - case 52: - hash = (37 * hash) + TUPLE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getTupleValue().hashCode(); - break; - case 53: - hash = (37 * hash) + DICT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDictValue().hashCode(); - break; - case 54: - hash = (37 * hash) + NAMED_TUPLE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getNamedTupleValue().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.StructuredValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StructuredValue 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.StructuredValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StructuredValue 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.StructuredValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.StructuredValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.StructuredValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StructuredValue 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.StructuredValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StructuredValue 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.StructuredValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.StructuredValue 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.StructuredValue 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; - } - /** - *
    -   * `StructuredValue` represents a dynamically typed value representing various
    -   * data structures that are inspired by Python data structures typically used in
    -   * TensorFlow functions as inputs and outputs.
    -   * For example when saving a Layer there may be a `training` argument. If the
    -   * user passes a boolean True/False, that switches between two concrete
    -   * TensorFlow functions. In order to switch between them in the same way after
    -   * loading the SavedModel, we need to represent "True" and "False".
    -   * A more advanced example might be a function which takes a list of
    -   * dictionaries mapping from strings to Tensors. In order to map from
    -   * user-specified arguments `[{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]`
    -   * after load to the right saved TensorFlow function, we need to represent the
    -   * nested structure and the strings, recording that we have a trace for anything
    -   * matching `[{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([],
    -   * tf.float64)}]` as an example.
    -   * Likewise functions may return nested structures of Tensors, for example
    -   * returning a dictionary mapping from strings to Tensors. In order for the
    -   * loaded function to return the same structure we need to serialize it.
    -   * This is an ergonomic aid for working with loaded SavedModels, not a promise
    -   * to serialize all possible function signatures. For example we do not expect
    -   * to pickle generic Python objects, and ideally we'd stay language-agnostic.
    -   * 
    - * - * Protobuf type {@code tensorflow.StructuredValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.StructuredValue) - org.tensorflow.proto.framework.StructuredValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_StructuredValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_StructuredValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.StructuredValue.class, org.tensorflow.proto.framework.StructuredValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.StructuredValue.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(); - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_StructuredValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.StructuredValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.StructuredValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.StructuredValue build() { - org.tensorflow.proto.framework.StructuredValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.StructuredValue buildPartial() { - org.tensorflow.proto.framework.StructuredValue result = new org.tensorflow.proto.framework.StructuredValue(this); - if (kindCase_ == 1) { - if (noneValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = noneValueBuilder_.build(); - } - } - if (kindCase_ == 11) { - result.kind_ = kind_; - } - if (kindCase_ == 12) { - result.kind_ = kind_; - } - if (kindCase_ == 13) { - result.kind_ = kind_; - } - if (kindCase_ == 14) { - result.kind_ = kind_; - } - if (kindCase_ == 31) { - if (tensorShapeValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = tensorShapeValueBuilder_.build(); - } - } - if (kindCase_ == 32) { - result.kind_ = kind_; - } - if (kindCase_ == 33) { - if (tensorSpecValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = tensorSpecValueBuilder_.build(); - } - } - if (kindCase_ == 34) { - if (typeSpecValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = typeSpecValueBuilder_.build(); - } - } - if (kindCase_ == 35) { - if (boundedTensorSpecValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = boundedTensorSpecValueBuilder_.build(); - } - } - if (kindCase_ == 51) { - if (listValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = listValueBuilder_.build(); - } - } - if (kindCase_ == 52) { - if (tupleValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = tupleValueBuilder_.build(); - } - } - if (kindCase_ == 53) { - if (dictValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = dictValueBuilder_.build(); - } - } - if (kindCase_ == 54) { - if (namedTupleValueBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = namedTupleValueBuilder_.build(); - } - } - result.kindCase_ = kindCase_; - 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.StructuredValue) { - return mergeFrom((org.tensorflow.proto.framework.StructuredValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.StructuredValue other) { - if (other == org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()) return this; - switch (other.getKindCase()) { - case NONE_VALUE: { - mergeNoneValue(other.getNoneValue()); - break; - } - case FLOAT64_VALUE: { - setFloat64Value(other.getFloat64Value()); - break; - } - case INT64_VALUE: { - setInt64Value(other.getInt64Value()); - break; - } - case STRING_VALUE: { - kindCase_ = 13; - kind_ = other.kind_; - onChanged(); - break; - } - case BOOL_VALUE: { - setBoolValue(other.getBoolValue()); - break; - } - case TENSOR_SHAPE_VALUE: { - mergeTensorShapeValue(other.getTensorShapeValue()); - break; - } - case TENSOR_DTYPE_VALUE: { - setTensorDtypeValueValue(other.getTensorDtypeValueValue()); - break; - } - case TENSOR_SPEC_VALUE: { - mergeTensorSpecValue(other.getTensorSpecValue()); - break; - } - case TYPE_SPEC_VALUE: { - mergeTypeSpecValue(other.getTypeSpecValue()); - break; - } - case BOUNDED_TENSOR_SPEC_VALUE: { - mergeBoundedTensorSpecValue(other.getBoundedTensorSpecValue()); - break; - } - case LIST_VALUE: { - mergeListValue(other.getListValue()); - break; - } - case TUPLE_VALUE: { - mergeTupleValue(other.getTupleValue()); - break; - } - case DICT_VALUE: { - mergeDictValue(other.getDictValue()); - break; - } - case NAMED_TUPLE_VALUE: { - mergeNamedTupleValue(other.getNamedTupleValue()); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.StructuredValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.StructuredValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NoneValue, org.tensorflow.proto.framework.NoneValue.Builder, org.tensorflow.proto.framework.NoneValueOrBuilder> noneValueBuilder_; - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public boolean hasNoneValue() { - return kindCase_ == 1; - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public org.tensorflow.proto.framework.NoneValue getNoneValue() { - if (noneValueBuilder_ == null) { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.NoneValue) kind_; - } - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } else { - if (kindCase_ == 1) { - return noneValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public Builder setNoneValue(org.tensorflow.proto.framework.NoneValue value) { - if (noneValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - noneValueBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public Builder setNoneValue( - org.tensorflow.proto.framework.NoneValue.Builder builderForValue) { - if (noneValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - noneValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 1; - return this; - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public Builder mergeNoneValue(org.tensorflow.proto.framework.NoneValue value) { - if (noneValueBuilder_ == null) { - if (kindCase_ == 1 && - kind_ != org.tensorflow.proto.framework.NoneValue.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.NoneValue.newBuilder((org.tensorflow.proto.framework.NoneValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 1) { - noneValueBuilder_.mergeFrom(value); - } - noneValueBuilder_.setMessage(value); - } - kindCase_ = 1; - return this; - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public Builder clearNoneValue() { - if (noneValueBuilder_ == null) { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - } - noneValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public org.tensorflow.proto.framework.NoneValue.Builder getNoneValueBuilder() { - return getNoneValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - public org.tensorflow.proto.framework.NoneValueOrBuilder getNoneValueOrBuilder() { - if ((kindCase_ == 1) && (noneValueBuilder_ != null)) { - return noneValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 1) { - return (org.tensorflow.proto.framework.NoneValue) kind_; - } - return org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents None.
    -     * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NoneValue, org.tensorflow.proto.framework.NoneValue.Builder, org.tensorflow.proto.framework.NoneValueOrBuilder> - getNoneValueFieldBuilder() { - if (noneValueBuilder_ == null) { - if (!(kindCase_ == 1)) { - kind_ = org.tensorflow.proto.framework.NoneValue.getDefaultInstance(); - } - noneValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NoneValue, org.tensorflow.proto.framework.NoneValue.Builder, org.tensorflow.proto.framework.NoneValueOrBuilder>( - (org.tensorflow.proto.framework.NoneValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 1; - onChanged();; - return noneValueBuilder_; - } - - /** - *
    -     * Represents a double-precision floating-point value (a Python `float`).
    -     * 
    - * - * double float64_value = 11; - */ - public double getFloat64Value() { - if (kindCase_ == 11) { - return (java.lang.Double) kind_; - } - return 0D; - } - /** - *
    -     * Represents a double-precision floating-point value (a Python `float`).
    -     * 
    - * - * double float64_value = 11; - */ - public Builder setFloat64Value(double value) { - kindCase_ = 11; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Represents a double-precision floating-point value (a Python `float`).
    -     * 
    - * - * double float64_value = 11; - */ - public Builder clearFloat64Value() { - if (kindCase_ == 11) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * Represents a signed integer value, limited to 64 bits.
    -     * Larger values from Python's arbitrary-precision integers are unsupported.
    -     * 
    - * - * sint64 int64_value = 12; - */ - public long getInt64Value() { - if (kindCase_ == 12) { - return (java.lang.Long) kind_; - } - return 0L; - } - /** - *
    -     * Represents a signed integer value, limited to 64 bits.
    -     * Larger values from Python's arbitrary-precision integers are unsupported.
    -     * 
    - * - * sint64 int64_value = 12; - */ - public Builder setInt64Value(long value) { - kindCase_ = 12; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Represents a signed integer value, limited to 64 bits.
    -     * Larger values from Python's arbitrary-precision integers are unsupported.
    -     * 
    - * - * sint64 int64_value = 12; - */ - public Builder clearInt64Value() { - if (kindCase_ == 12) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * Represents a string of Unicode characters stored in a Python `str`.
    -     * In Python 3, this is exactly what type `str` is.
    -     * In Python 2, this is the UTF-8 encoding of the characters.
    -     * For strings with ASCII characters only (as often used in TensorFlow code)
    -     * there is effectively no difference between the language versions.
    -     * The obsolescent `unicode` type of Python 2 is not supported here.
    -     * 
    - * - * string string_value = 13; - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (kindCase_ == 13) { - ref = kind_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (kindCase_ == 13) { - kind_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Represents a string of Unicode characters stored in a Python `str`.
    -     * In Python 3, this is exactly what type `str` is.
    -     * In Python 2, this is the UTF-8 encoding of the characters.
    -     * For strings with ASCII characters only (as often used in TensorFlow code)
    -     * there is effectively no difference between the language versions.
    -     * The obsolescent `unicode` type of Python 2 is not supported here.
    -     * 
    - * - * string string_value = 13; - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 13) { - ref = kind_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 13) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Represents a string of Unicode characters stored in a Python `str`.
    -     * In Python 3, this is exactly what type `str` is.
    -     * In Python 2, this is the UTF-8 encoding of the characters.
    -     * For strings with ASCII characters only (as often used in TensorFlow code)
    -     * there is effectively no difference between the language versions.
    -     * The obsolescent `unicode` type of Python 2 is not supported here.
    -     * 
    - * - * string string_value = 13; - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 13; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Represents a string of Unicode characters stored in a Python `str`.
    -     * In Python 3, this is exactly what type `str` is.
    -     * In Python 2, this is the UTF-8 encoding of the characters.
    -     * For strings with ASCII characters only (as often used in TensorFlow code)
    -     * there is effectively no difference between the language versions.
    -     * The obsolescent `unicode` type of Python 2 is not supported here.
    -     * 
    - * - * string string_value = 13; - */ - public Builder clearStringValue() { - if (kindCase_ == 13) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - /** - *
    -     * Represents a string of Unicode characters stored in a Python `str`.
    -     * In Python 3, this is exactly what type `str` is.
    -     * In Python 2, this is the UTF-8 encoding of the characters.
    -     * For strings with ASCII characters only (as often used in TensorFlow code)
    -     * there is effectively no difference between the language versions.
    -     * The obsolescent `unicode` type of Python 2 is not supported here.
    -     * 
    - * - * string string_value = 13; - */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kindCase_ = 13; - kind_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Represents a boolean value.
    -     * 
    - * - * bool bool_value = 14; - */ - public boolean getBoolValue() { - if (kindCase_ == 14) { - return (java.lang.Boolean) kind_; - } - return false; - } - /** - *
    -     * Represents a boolean value.
    -     * 
    - * - * bool bool_value = 14; - */ - public Builder setBoolValue(boolean value) { - kindCase_ = 14; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Represents a boolean value.
    -     * 
    - * - * bool bool_value = 14; - */ - public Builder clearBoolValue() { - if (kindCase_ == 14) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> tensorShapeValueBuilder_; - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public boolean hasTensorShapeValue() { - return kindCase_ == 31; - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShapeValue() { - if (tensorShapeValueBuilder_ == null) { - if (kindCase_ == 31) { - return (org.tensorflow.proto.framework.TensorShapeProto) kind_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } else { - if (kindCase_ == 31) { - return tensorShapeValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public Builder setTensorShapeValue(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - tensorShapeValueBuilder_.setMessage(value); - } - kindCase_ = 31; - return this; - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public Builder setTensorShapeValue( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (tensorShapeValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - tensorShapeValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 31; - return this; - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public Builder mergeTensorShapeValue(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeValueBuilder_ == null) { - if (kindCase_ == 31 && - kind_ != org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.TensorShapeProto.newBuilder((org.tensorflow.proto.framework.TensorShapeProto) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 31) { - tensorShapeValueBuilder_.mergeFrom(value); - } - tensorShapeValueBuilder_.setMessage(value); - } - kindCase_ = 31; - return this; - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public Builder clearTensorShapeValue() { - if (tensorShapeValueBuilder_ == null) { - if (kindCase_ == 31) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 31) { - kindCase_ = 0; - kind_ = null; - } - tensorShapeValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getTensorShapeValueBuilder() { - return getTensorShapeValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder() { - if ((kindCase_ == 31) && (tensorShapeValueBuilder_ != null)) { - return tensorShapeValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 31) { - return (org.tensorflow.proto.framework.TensorShapeProto) kind_; - } - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a TensorShape.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getTensorShapeValueFieldBuilder() { - if (tensorShapeValueBuilder_ == null) { - if (!(kindCase_ == 31)) { - kind_ = org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - tensorShapeValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - (org.tensorflow.proto.framework.TensorShapeProto) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 31; - onChanged();; - return tensorShapeValueBuilder_; - } - - /** - *
    -     * Represents an enum value for dtype.
    -     * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public int getTensorDtypeValueValue() { - if (kindCase_ == 32) { - return ((java.lang.Integer) kind_).intValue(); - } - return 0; - } - /** - *
    -     * Represents an enum value for dtype.
    -     * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public Builder setTensorDtypeValueValue(int value) { - kindCase_ = 32; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Represents an enum value for dtype.
    -     * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public org.tensorflow.proto.framework.DataType getTensorDtypeValue() { - if (kindCase_ == 32) { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf( - (java.lang.Integer) kind_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - return org.tensorflow.proto.framework.DataType.DT_INVALID; - } - /** - *
    -     * Represents an enum value for dtype.
    -     * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public Builder setTensorDtypeValue(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 32; - kind_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Represents an enum value for dtype.
    -     * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - public Builder clearTensorDtypeValue() { - if (kindCase_ == 32) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSpecProto, org.tensorflow.proto.framework.TensorSpecProto.Builder, org.tensorflow.proto.framework.TensorSpecProtoOrBuilder> tensorSpecValueBuilder_; - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public boolean hasTensorSpecValue() { - return kindCase_ == 33; - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public org.tensorflow.proto.framework.TensorSpecProto getTensorSpecValue() { - if (tensorSpecValueBuilder_ == null) { - if (kindCase_ == 33) { - return (org.tensorflow.proto.framework.TensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } else { - if (kindCase_ == 33) { - return tensorSpecValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public Builder setTensorSpecValue(org.tensorflow.proto.framework.TensorSpecProto value) { - if (tensorSpecValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - tensorSpecValueBuilder_.setMessage(value); - } - kindCase_ = 33; - return this; - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public Builder setTensorSpecValue( - org.tensorflow.proto.framework.TensorSpecProto.Builder builderForValue) { - if (tensorSpecValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - tensorSpecValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 33; - return this; - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public Builder mergeTensorSpecValue(org.tensorflow.proto.framework.TensorSpecProto value) { - if (tensorSpecValueBuilder_ == null) { - if (kindCase_ == 33 && - kind_ != org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.TensorSpecProto.newBuilder((org.tensorflow.proto.framework.TensorSpecProto) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 33) { - tensorSpecValueBuilder_.mergeFrom(value); - } - tensorSpecValueBuilder_.setMessage(value); - } - kindCase_ = 33; - return this; - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public Builder clearTensorSpecValue() { - if (tensorSpecValueBuilder_ == null) { - if (kindCase_ == 33) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 33) { - kindCase_ = 0; - kind_ = null; - } - tensorSpecValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public org.tensorflow.proto.framework.TensorSpecProto.Builder getTensorSpecValueBuilder() { - return getTensorSpecValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - public org.tensorflow.proto.framework.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder() { - if ((kindCase_ == 33) && (tensorSpecValueBuilder_ != null)) { - return tensorSpecValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 33) { - return (org.tensorflow.proto.framework.TensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.TensorSpec.
    -     * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSpecProto, org.tensorflow.proto.framework.TensorSpecProto.Builder, org.tensorflow.proto.framework.TensorSpecProtoOrBuilder> - getTensorSpecValueFieldBuilder() { - if (tensorSpecValueBuilder_ == null) { - if (!(kindCase_ == 33)) { - kind_ = org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - tensorSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSpecProto, org.tensorflow.proto.framework.TensorSpecProto.Builder, org.tensorflow.proto.framework.TensorSpecProtoOrBuilder>( - (org.tensorflow.proto.framework.TensorSpecProto) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 33; - onChanged();; - return tensorSpecValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> typeSpecValueBuilder_; - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public boolean hasTypeSpecValue() { - return kindCase_ == 34; - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpecValue() { - if (typeSpecValueBuilder_ == null) { - if (kindCase_ == 34) { - return (org.tensorflow.proto.framework.TypeSpecProto) kind_; - } - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } else { - if (kindCase_ == 34) { - return typeSpecValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public Builder setTypeSpecValue(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - typeSpecValueBuilder_.setMessage(value); - } - kindCase_ = 34; - return this; - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public Builder setTypeSpecValue( - org.tensorflow.proto.framework.TypeSpecProto.Builder builderForValue) { - if (typeSpecValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - typeSpecValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 34; - return this; - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public Builder mergeTypeSpecValue(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecValueBuilder_ == null) { - if (kindCase_ == 34 && - kind_ != org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.TypeSpecProto.newBuilder((org.tensorflow.proto.framework.TypeSpecProto) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 34) { - typeSpecValueBuilder_.mergeFrom(value); - } - typeSpecValueBuilder_.setMessage(value); - } - kindCase_ = 34; - return this; - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public Builder clearTypeSpecValue() { - if (typeSpecValueBuilder_ == null) { - if (kindCase_ == 34) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 34) { - kindCase_ = 0; - kind_ = null; - } - typeSpecValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public org.tensorflow.proto.framework.TypeSpecProto.Builder getTypeSpecValueBuilder() { - return getTypeSpecValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder() { - if ((kindCase_ == 34) && (typeSpecValueBuilder_ != null)) { - return typeSpecValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 34) { - return (org.tensorflow.proto.framework.TypeSpecProto) kind_; - } - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.TypeSpec.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> - getTypeSpecValueFieldBuilder() { - if (typeSpecValueBuilder_ == null) { - if (!(kindCase_ == 34)) { - kind_ = org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - typeSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder>( - (org.tensorflow.proto.framework.TypeSpecProto) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 34; - onChanged();; - return typeSpecValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.BoundedTensorSpecProto, org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder, org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder> boundedTensorSpecValueBuilder_; - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public boolean hasBoundedTensorSpecValue() { - return kindCase_ == 35; - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public org.tensorflow.proto.framework.BoundedTensorSpecProto getBoundedTensorSpecValue() { - if (boundedTensorSpecValueBuilder_ == null) { - if (kindCase_ == 35) { - return (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } else { - if (kindCase_ == 35) { - return boundedTensorSpecValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public Builder setBoundedTensorSpecValue(org.tensorflow.proto.framework.BoundedTensorSpecProto value) { - if (boundedTensorSpecValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - boundedTensorSpecValueBuilder_.setMessage(value); - } - kindCase_ = 35; - return this; - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public Builder setBoundedTensorSpecValue( - org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder builderForValue) { - if (boundedTensorSpecValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - boundedTensorSpecValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 35; - return this; - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public Builder mergeBoundedTensorSpecValue(org.tensorflow.proto.framework.BoundedTensorSpecProto value) { - if (boundedTensorSpecValueBuilder_ == null) { - if (kindCase_ == 35 && - kind_ != org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.BoundedTensorSpecProto.newBuilder((org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 35) { - boundedTensorSpecValueBuilder_.mergeFrom(value); - } - boundedTensorSpecValueBuilder_.setMessage(value); - } - kindCase_ = 35; - return this; - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public Builder clearBoundedTensorSpecValue() { - if (boundedTensorSpecValueBuilder_ == null) { - if (kindCase_ == 35) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 35) { - kindCase_ = 0; - kind_ = null; - } - boundedTensorSpecValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder getBoundedTensorSpecValueBuilder() { - return getBoundedTensorSpecValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - public org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder() { - if ((kindCase_ == 35) && (boundedTensorSpecValueBuilder_ != null)) { - return boundedTensorSpecValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 35) { - return (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_; - } - return org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - } - /** - *
    -     * Represents a value for tf.BoundedTensorSpec.
    -     * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.BoundedTensorSpecProto, org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder, org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder> - getBoundedTensorSpecValueFieldBuilder() { - if (boundedTensorSpecValueBuilder_ == null) { - if (!(kindCase_ == 35)) { - kind_ = org.tensorflow.proto.framework.BoundedTensorSpecProto.getDefaultInstance(); - } - boundedTensorSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.BoundedTensorSpecProto, org.tensorflow.proto.framework.BoundedTensorSpecProto.Builder, org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder>( - (org.tensorflow.proto.framework.BoundedTensorSpecProto) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 35; - onChanged();; - return boundedTensorSpecValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ListValue, org.tensorflow.proto.framework.ListValue.Builder, org.tensorflow.proto.framework.ListValueOrBuilder> listValueBuilder_; - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public boolean hasListValue() { - return kindCase_ == 51; - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public org.tensorflow.proto.framework.ListValue getListValue() { - if (listValueBuilder_ == null) { - if (kindCase_ == 51) { - return (org.tensorflow.proto.framework.ListValue) kind_; - } - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } else { - if (kindCase_ == 51) { - return listValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public Builder setListValue(org.tensorflow.proto.framework.ListValue value) { - if (listValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - listValueBuilder_.setMessage(value); - } - kindCase_ = 51; - return this; - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public Builder setListValue( - org.tensorflow.proto.framework.ListValue.Builder builderForValue) { - if (listValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - listValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 51; - return this; - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public Builder mergeListValue(org.tensorflow.proto.framework.ListValue value) { - if (listValueBuilder_ == null) { - if (kindCase_ == 51 && - kind_ != org.tensorflow.proto.framework.ListValue.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.ListValue.newBuilder((org.tensorflow.proto.framework.ListValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 51) { - listValueBuilder_.mergeFrom(value); - } - listValueBuilder_.setMessage(value); - } - kindCase_ = 51; - return this; - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public Builder clearListValue() { - if (listValueBuilder_ == null) { - if (kindCase_ == 51) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 51) { - kindCase_ = 0; - kind_ = null; - } - listValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public org.tensorflow.proto.framework.ListValue.Builder getListValueBuilder() { - return getListValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - public org.tensorflow.proto.framework.ListValueOrBuilder getListValueOrBuilder() { - if ((kindCase_ == 51) && (listValueBuilder_ != null)) { - return listValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 51) { - return (org.tensorflow.proto.framework.ListValue) kind_; - } - return org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a list of `Value`.
    -     * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ListValue, org.tensorflow.proto.framework.ListValue.Builder, org.tensorflow.proto.framework.ListValueOrBuilder> - getListValueFieldBuilder() { - if (listValueBuilder_ == null) { - if (!(kindCase_ == 51)) { - kind_ = org.tensorflow.proto.framework.ListValue.getDefaultInstance(); - } - listValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ListValue, org.tensorflow.proto.framework.ListValue.Builder, org.tensorflow.proto.framework.ListValueOrBuilder>( - (org.tensorflow.proto.framework.ListValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 51; - onChanged();; - return listValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TupleValue, org.tensorflow.proto.framework.TupleValue.Builder, org.tensorflow.proto.framework.TupleValueOrBuilder> tupleValueBuilder_; - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public boolean hasTupleValue() { - return kindCase_ == 52; - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public org.tensorflow.proto.framework.TupleValue getTupleValue() { - if (tupleValueBuilder_ == null) { - if (kindCase_ == 52) { - return (org.tensorflow.proto.framework.TupleValue) kind_; - } - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } else { - if (kindCase_ == 52) { - return tupleValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public Builder setTupleValue(org.tensorflow.proto.framework.TupleValue value) { - if (tupleValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - tupleValueBuilder_.setMessage(value); - } - kindCase_ = 52; - return this; - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public Builder setTupleValue( - org.tensorflow.proto.framework.TupleValue.Builder builderForValue) { - if (tupleValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - tupleValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 52; - return this; - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public Builder mergeTupleValue(org.tensorflow.proto.framework.TupleValue value) { - if (tupleValueBuilder_ == null) { - if (kindCase_ == 52 && - kind_ != org.tensorflow.proto.framework.TupleValue.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.TupleValue.newBuilder((org.tensorflow.proto.framework.TupleValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 52) { - tupleValueBuilder_.mergeFrom(value); - } - tupleValueBuilder_.setMessage(value); - } - kindCase_ = 52; - return this; - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public Builder clearTupleValue() { - if (tupleValueBuilder_ == null) { - if (kindCase_ == 52) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 52) { - kindCase_ = 0; - kind_ = null; - } - tupleValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public org.tensorflow.proto.framework.TupleValue.Builder getTupleValueBuilder() { - return getTupleValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - public org.tensorflow.proto.framework.TupleValueOrBuilder getTupleValueOrBuilder() { - if ((kindCase_ == 52) && (tupleValueBuilder_ != null)) { - return tupleValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 52) { - return (org.tensorflow.proto.framework.TupleValue) kind_; - } - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a tuple of `Value`.
    -     * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TupleValue, org.tensorflow.proto.framework.TupleValue.Builder, org.tensorflow.proto.framework.TupleValueOrBuilder> - getTupleValueFieldBuilder() { - if (tupleValueBuilder_ == null) { - if (!(kindCase_ == 52)) { - kind_ = org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - tupleValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TupleValue, org.tensorflow.proto.framework.TupleValue.Builder, org.tensorflow.proto.framework.TupleValueOrBuilder>( - (org.tensorflow.proto.framework.TupleValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 52; - onChanged();; - return tupleValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DictValue, org.tensorflow.proto.framework.DictValue.Builder, org.tensorflow.proto.framework.DictValueOrBuilder> dictValueBuilder_; - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public boolean hasDictValue() { - return kindCase_ == 53; - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public org.tensorflow.proto.framework.DictValue getDictValue() { - if (dictValueBuilder_ == null) { - if (kindCase_ == 53) { - return (org.tensorflow.proto.framework.DictValue) kind_; - } - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } else { - if (kindCase_ == 53) { - return dictValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public Builder setDictValue(org.tensorflow.proto.framework.DictValue value) { - if (dictValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - dictValueBuilder_.setMessage(value); - } - kindCase_ = 53; - return this; - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public Builder setDictValue( - org.tensorflow.proto.framework.DictValue.Builder builderForValue) { - if (dictValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - dictValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 53; - return this; - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public Builder mergeDictValue(org.tensorflow.proto.framework.DictValue value) { - if (dictValueBuilder_ == null) { - if (kindCase_ == 53 && - kind_ != org.tensorflow.proto.framework.DictValue.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.DictValue.newBuilder((org.tensorflow.proto.framework.DictValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 53) { - dictValueBuilder_.mergeFrom(value); - } - dictValueBuilder_.setMessage(value); - } - kindCase_ = 53; - return this; - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public Builder clearDictValue() { - if (dictValueBuilder_ == null) { - if (kindCase_ == 53) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 53) { - kindCase_ = 0; - kind_ = null; - } - dictValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public org.tensorflow.proto.framework.DictValue.Builder getDictValueBuilder() { - return getDictValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - public org.tensorflow.proto.framework.DictValueOrBuilder getDictValueOrBuilder() { - if ((kindCase_ == 53) && (dictValueBuilder_ != null)) { - return dictValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 53) { - return (org.tensorflow.proto.framework.DictValue) kind_; - } - return org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents a dict `Value`.
    -     * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DictValue, org.tensorflow.proto.framework.DictValue.Builder, org.tensorflow.proto.framework.DictValueOrBuilder> - getDictValueFieldBuilder() { - if (dictValueBuilder_ == null) { - if (!(kindCase_ == 53)) { - kind_ = org.tensorflow.proto.framework.DictValue.getDefaultInstance(); - } - dictValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.DictValue, org.tensorflow.proto.framework.DictValue.Builder, org.tensorflow.proto.framework.DictValueOrBuilder>( - (org.tensorflow.proto.framework.DictValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 53; - onChanged();; - return dictValueBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NamedTupleValue, org.tensorflow.proto.framework.NamedTupleValue.Builder, org.tensorflow.proto.framework.NamedTupleValueOrBuilder> namedTupleValueBuilder_; - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public boolean hasNamedTupleValue() { - return kindCase_ == 54; - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public org.tensorflow.proto.framework.NamedTupleValue getNamedTupleValue() { - if (namedTupleValueBuilder_ == null) { - if (kindCase_ == 54) { - return (org.tensorflow.proto.framework.NamedTupleValue) kind_; - } - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } else { - if (kindCase_ == 54) { - return namedTupleValueBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public Builder setNamedTupleValue(org.tensorflow.proto.framework.NamedTupleValue value) { - if (namedTupleValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - namedTupleValueBuilder_.setMessage(value); - } - kindCase_ = 54; - return this; - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public Builder setNamedTupleValue( - org.tensorflow.proto.framework.NamedTupleValue.Builder builderForValue) { - if (namedTupleValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - namedTupleValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 54; - return this; - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public Builder mergeNamedTupleValue(org.tensorflow.proto.framework.NamedTupleValue value) { - if (namedTupleValueBuilder_ == null) { - if (kindCase_ == 54 && - kind_ != org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance()) { - kind_ = org.tensorflow.proto.framework.NamedTupleValue.newBuilder((org.tensorflow.proto.framework.NamedTupleValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 54) { - namedTupleValueBuilder_.mergeFrom(value); - } - namedTupleValueBuilder_.setMessage(value); - } - kindCase_ = 54; - return this; - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public Builder clearNamedTupleValue() { - if (namedTupleValueBuilder_ == null) { - if (kindCase_ == 54) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 54) { - kindCase_ = 0; - kind_ = null; - } - namedTupleValueBuilder_.clear(); - } - return this; - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public org.tensorflow.proto.framework.NamedTupleValue.Builder getNamedTupleValueBuilder() { - return getNamedTupleValueFieldBuilder().getBuilder(); - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - public org.tensorflow.proto.framework.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder() { - if ((kindCase_ == 54) && (namedTupleValueBuilder_ != null)) { - return namedTupleValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 54) { - return (org.tensorflow.proto.framework.NamedTupleValue) kind_; - } - return org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - } - /** - *
    -     * Represents Python's namedtuple.
    -     * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NamedTupleValue, org.tensorflow.proto.framework.NamedTupleValue.Builder, org.tensorflow.proto.framework.NamedTupleValueOrBuilder> - getNamedTupleValueFieldBuilder() { - if (namedTupleValueBuilder_ == null) { - if (!(kindCase_ == 54)) { - kind_ = org.tensorflow.proto.framework.NamedTupleValue.getDefaultInstance(); - } - namedTupleValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.NamedTupleValue, org.tensorflow.proto.framework.NamedTupleValue.Builder, org.tensorflow.proto.framework.NamedTupleValueOrBuilder>( - (org.tensorflow.proto.framework.NamedTupleValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 54; - onChanged();; - return namedTupleValueBuilder_; - } - @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.StructuredValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.StructuredValue) - private static final org.tensorflow.proto.framework.StructuredValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.StructuredValue(); - } - - public static org.tensorflow.proto.framework.StructuredValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StructuredValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StructuredValue(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.StructuredValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValueOrBuilder.java deleted file mode 100644 index 3ffb498eb22..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StructuredValueOrBuilder.java +++ /dev/null @@ -1,309 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface StructuredValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.StructuredValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - boolean hasNoneValue(); - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - org.tensorflow.proto.framework.NoneValue getNoneValue(); - /** - *
    -   * Represents None.
    -   * 
    - * - * .tensorflow.NoneValue none_value = 1; - */ - org.tensorflow.proto.framework.NoneValueOrBuilder getNoneValueOrBuilder(); - - /** - *
    -   * Represents a double-precision floating-point value (a Python `float`).
    -   * 
    - * - * double float64_value = 11; - */ - double getFloat64Value(); - - /** - *
    -   * Represents a signed integer value, limited to 64 bits.
    -   * Larger values from Python's arbitrary-precision integers are unsupported.
    -   * 
    - * - * sint64 int64_value = 12; - */ - long getInt64Value(); - - /** - *
    -   * Represents a string of Unicode characters stored in a Python `str`.
    -   * In Python 3, this is exactly what type `str` is.
    -   * In Python 2, this is the UTF-8 encoding of the characters.
    -   * For strings with ASCII characters only (as often used in TensorFlow code)
    -   * there is effectively no difference between the language versions.
    -   * The obsolescent `unicode` type of Python 2 is not supported here.
    -   * 
    - * - * string string_value = 13; - */ - java.lang.String getStringValue(); - /** - *
    -   * Represents a string of Unicode characters stored in a Python `str`.
    -   * In Python 3, this is exactly what type `str` is.
    -   * In Python 2, this is the UTF-8 encoding of the characters.
    -   * For strings with ASCII characters only (as often used in TensorFlow code)
    -   * there is effectively no difference between the language versions.
    -   * The obsolescent `unicode` type of Python 2 is not supported here.
    -   * 
    - * - * string string_value = 13; - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - /** - *
    -   * Represents a boolean value.
    -   * 
    - * - * bool bool_value = 14; - */ - boolean getBoolValue(); - - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - boolean hasTensorShapeValue(); - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - org.tensorflow.proto.framework.TensorShapeProto getTensorShapeValue(); - /** - *
    -   * Represents a TensorShape.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape_value = 31; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder(); - - /** - *
    -   * Represents an enum value for dtype.
    -   * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - int getTensorDtypeValueValue(); - /** - *
    -   * Represents an enum value for dtype.
    -   * 
    - * - * .tensorflow.DataType tensor_dtype_value = 32; - */ - org.tensorflow.proto.framework.DataType getTensorDtypeValue(); - - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - boolean hasTensorSpecValue(); - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - org.tensorflow.proto.framework.TensorSpecProto getTensorSpecValue(); - /** - *
    -   * Represents a value for tf.TensorSpec.
    -   * 
    - * - * .tensorflow.TensorSpecProto tensor_spec_value = 33; - */ - org.tensorflow.proto.framework.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder(); - - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - boolean hasTypeSpecValue(); - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - org.tensorflow.proto.framework.TypeSpecProto getTypeSpecValue(); - /** - *
    -   * Represents a value for tf.TypeSpec.
    -   * 
    - * - * .tensorflow.TypeSpecProto type_spec_value = 34; - */ - org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder(); - - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - boolean hasBoundedTensorSpecValue(); - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - org.tensorflow.proto.framework.BoundedTensorSpecProto getBoundedTensorSpecValue(); - /** - *
    -   * Represents a value for tf.BoundedTensorSpec.
    -   * 
    - * - * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; - */ - org.tensorflow.proto.framework.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder(); - - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - boolean hasListValue(); - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - org.tensorflow.proto.framework.ListValue getListValue(); - /** - *
    -   * Represents a list of `Value`.
    -   * 
    - * - * .tensorflow.ListValue list_value = 51; - */ - org.tensorflow.proto.framework.ListValueOrBuilder getListValueOrBuilder(); - - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - boolean hasTupleValue(); - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - org.tensorflow.proto.framework.TupleValue getTupleValue(); - /** - *
    -   * Represents a tuple of `Value`.
    -   * 
    - * - * .tensorflow.TupleValue tuple_value = 52; - */ - org.tensorflow.proto.framework.TupleValueOrBuilder getTupleValueOrBuilder(); - - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - boolean hasDictValue(); - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - org.tensorflow.proto.framework.DictValue getDictValue(); - /** - *
    -   * Represents a dict `Value`.
    -   * 
    - * - * .tensorflow.DictValue dict_value = 53; - */ - org.tensorflow.proto.framework.DictValueOrBuilder getDictValueOrBuilder(); - - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - boolean hasNamedTupleValue(); - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - org.tensorflow.proto.framework.NamedTupleValue getNamedTupleValue(); - /** - *
    -   * Represents Python's namedtuple.
    -   * 
    - * - * .tensorflow.NamedTupleValue named_tuple_value = 54; - */ - org.tensorflow.proto.framework.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder(); - - public org.tensorflow.proto.framework.StructuredValue.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Summary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Summary.java deleted file mode 100644 index 19c5c6664a3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Summary.java +++ /dev/null @@ -1,4725 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A Summary is a set of named values to be displayed by the
    - * visualizer.
    - * Summaries are produced regularly during training, as controlled by
    - * the "summary_interval_secs" attribute of the training operation.
    - * Summaries are also produced at the end of an evaluation.
    - * 
    - * - * Protobuf type {@code tensorflow.Summary} - */ -public final class Summary extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Summary) - SummaryOrBuilder { -private static final long serialVersionUID = 0L; - // Use Summary.newBuilder() to construct. - private Summary(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Summary() { - value_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Summary(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Summary( - 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)) { - value_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - value_.add( - input.readMessage(org.tensorflow.proto.framework.Summary.Value.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_ & 0x00000001) != 0)) { - value_ = java.util.Collections.unmodifiableList(value_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Summary.class, org.tensorflow.proto.framework.Summary.Builder.class); - } - - public interface ImageOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Summary.Image) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Dimensions of the image.
    -     * 
    - * - * int32 height = 1; - */ - int getHeight(); - - /** - * int32 width = 2; - */ - int getWidth(); - - /** - *
    -     * Valid colorspace values are
    -     *   1 - grayscale
    -     *   2 - grayscale + alpha
    -     *   3 - RGB
    -     *   4 - RGBA
    -     *   5 - DIGITAL_YUV
    -     *   6 - BGRA
    -     * 
    - * - * int32 colorspace = 3; - */ - int getColorspace(); - - /** - *
    -     * Image data in encoded format.  All image formats supported by
    -     * image_codec::CoderUtil can be stored here.
    -     * 
    - * - * bytes encoded_image_string = 4; - */ - com.google.protobuf.ByteString getEncodedImageString(); - } - /** - * Protobuf type {@code tensorflow.Summary.Image} - */ - public static final class Image extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Summary.Image) - ImageOrBuilder { - private static final long serialVersionUID = 0L; - // Use Image.newBuilder() to construct. - private Image(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Image() { - encodedImageString_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Image(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Image( - 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: { - - height_ = input.readInt32(); - break; - } - case 16: { - - width_ = input.readInt32(); - break; - } - case 24: { - - colorspace_ = input.readInt32(); - break; - } - case 34: { - - encodedImageString_ = input.readBytes(); - 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.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Image_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Summary.Image.class, org.tensorflow.proto.framework.Summary.Image.Builder.class); - } - - public static final int HEIGHT_FIELD_NUMBER = 1; - private int height_; - /** - *
    -     * Dimensions of the image.
    -     * 
    - * - * int32 height = 1; - */ - public int getHeight() { - return height_; - } - - public static final int WIDTH_FIELD_NUMBER = 2; - private int width_; - /** - * int32 width = 2; - */ - public int getWidth() { - return width_; - } - - public static final int COLORSPACE_FIELD_NUMBER = 3; - private int colorspace_; - /** - *
    -     * Valid colorspace values are
    -     *   1 - grayscale
    -     *   2 - grayscale + alpha
    -     *   3 - RGB
    -     *   4 - RGBA
    -     *   5 - DIGITAL_YUV
    -     *   6 - BGRA
    -     * 
    - * - * int32 colorspace = 3; - */ - public int getColorspace() { - return colorspace_; - } - - public static final int ENCODED_IMAGE_STRING_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString encodedImageString_; - /** - *
    -     * Image data in encoded format.  All image formats supported by
    -     * image_codec::CoderUtil can be stored here.
    -     * 
    - * - * bytes encoded_image_string = 4; - */ - public com.google.protobuf.ByteString getEncodedImageString() { - return encodedImageString_; - } - - 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 (height_ != 0) { - output.writeInt32(1, height_); - } - if (width_ != 0) { - output.writeInt32(2, width_); - } - if (colorspace_ != 0) { - output.writeInt32(3, colorspace_); - } - if (!encodedImageString_.isEmpty()) { - output.writeBytes(4, encodedImageString_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (height_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, height_); - } - if (width_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, width_); - } - if (colorspace_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, colorspace_); - } - if (!encodedImageString_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, encodedImageString_); - } - 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.Summary.Image)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.Summary.Image other = (org.tensorflow.proto.framework.Summary.Image) obj; - - if (getHeight() - != other.getHeight()) return false; - if (getWidth() - != other.getWidth()) return false; - if (getColorspace() - != other.getColorspace()) return false; - if (!getEncodedImageString() - .equals(other.getEncodedImageString())) 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) + HEIGHT_FIELD_NUMBER; - hash = (53 * hash) + getHeight(); - hash = (37 * hash) + WIDTH_FIELD_NUMBER; - hash = (53 * hash) + getWidth(); - hash = (37 * hash) + COLORSPACE_FIELD_NUMBER; - hash = (53 * hash) + getColorspace(); - hash = (37 * hash) + ENCODED_IMAGE_STRING_FIELD_NUMBER; - hash = (53 * hash) + getEncodedImageString().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.Summary.Image parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Image 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.Summary.Image parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Image 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.Summary.Image parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Image parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Summary.Image parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Image 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.Summary.Image parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Image 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.Summary.Image parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Image 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.Summary.Image 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.Summary.Image} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Summary.Image) - org.tensorflow.proto.framework.Summary.ImageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Image_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Summary.Image.class, org.tensorflow.proto.framework.Summary.Image.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.Summary.Image.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(); - height_ = 0; - - width_ = 0; - - colorspace_ = 0; - - encodedImageString_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Image getDefaultInstanceForType() { - return org.tensorflow.proto.framework.Summary.Image.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Image build() { - org.tensorflow.proto.framework.Summary.Image result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Image buildPartial() { - org.tensorflow.proto.framework.Summary.Image result = new org.tensorflow.proto.framework.Summary.Image(this); - result.height_ = height_; - result.width_ = width_; - result.colorspace_ = colorspace_; - result.encodedImageString_ = encodedImageString_; - 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.Summary.Image) { - return mergeFrom((org.tensorflow.proto.framework.Summary.Image)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.Summary.Image other) { - if (other == org.tensorflow.proto.framework.Summary.Image.getDefaultInstance()) return this; - if (other.getHeight() != 0) { - setHeight(other.getHeight()); - } - if (other.getWidth() != 0) { - setWidth(other.getWidth()); - } - if (other.getColorspace() != 0) { - setColorspace(other.getColorspace()); - } - if (other.getEncodedImageString() != com.google.protobuf.ByteString.EMPTY) { - setEncodedImageString(other.getEncodedImageString()); - } - 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.Summary.Image parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.Summary.Image) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int height_ ; - /** - *
    -       * Dimensions of the image.
    -       * 
    - * - * int32 height = 1; - */ - public int getHeight() { - return height_; - } - /** - *
    -       * Dimensions of the image.
    -       * 
    - * - * int32 height = 1; - */ - public Builder setHeight(int value) { - - height_ = value; - onChanged(); - return this; - } - /** - *
    -       * Dimensions of the image.
    -       * 
    - * - * int32 height = 1; - */ - public Builder clearHeight() { - - height_ = 0; - onChanged(); - return this; - } - - private int width_ ; - /** - * int32 width = 2; - */ - public int getWidth() { - return width_; - } - /** - * int32 width = 2; - */ - public Builder setWidth(int value) { - - width_ = value; - onChanged(); - return this; - } - /** - * int32 width = 2; - */ - public Builder clearWidth() { - - width_ = 0; - onChanged(); - return this; - } - - private int colorspace_ ; - /** - *
    -       * Valid colorspace values are
    -       *   1 - grayscale
    -       *   2 - grayscale + alpha
    -       *   3 - RGB
    -       *   4 - RGBA
    -       *   5 - DIGITAL_YUV
    -       *   6 - BGRA
    -       * 
    - * - * int32 colorspace = 3; - */ - public int getColorspace() { - return colorspace_; - } - /** - *
    -       * Valid colorspace values are
    -       *   1 - grayscale
    -       *   2 - grayscale + alpha
    -       *   3 - RGB
    -       *   4 - RGBA
    -       *   5 - DIGITAL_YUV
    -       *   6 - BGRA
    -       * 
    - * - * int32 colorspace = 3; - */ - public Builder setColorspace(int value) { - - colorspace_ = value; - onChanged(); - return this; - } - /** - *
    -       * Valid colorspace values are
    -       *   1 - grayscale
    -       *   2 - grayscale + alpha
    -       *   3 - RGB
    -       *   4 - RGBA
    -       *   5 - DIGITAL_YUV
    -       *   6 - BGRA
    -       * 
    - * - * int32 colorspace = 3; - */ - public Builder clearColorspace() { - - colorspace_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString encodedImageString_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -       * Image data in encoded format.  All image formats supported by
    -       * image_codec::CoderUtil can be stored here.
    -       * 
    - * - * bytes encoded_image_string = 4; - */ - public com.google.protobuf.ByteString getEncodedImageString() { - return encodedImageString_; - } - /** - *
    -       * Image data in encoded format.  All image formats supported by
    -       * image_codec::CoderUtil can be stored here.
    -       * 
    - * - * bytes encoded_image_string = 4; - */ - public Builder setEncodedImageString(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - encodedImageString_ = value; - onChanged(); - return this; - } - /** - *
    -       * Image data in encoded format.  All image formats supported by
    -       * image_codec::CoderUtil can be stored here.
    -       * 
    - * - * bytes encoded_image_string = 4; - */ - public Builder clearEncodedImageString() { - - encodedImageString_ = getDefaultInstance().getEncodedImageString(); - 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.Summary.Image) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Summary.Image) - private static final org.tensorflow.proto.framework.Summary.Image DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.Summary.Image(); - } - - public static org.tensorflow.proto.framework.Summary.Image getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Image parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Image(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.Summary.Image getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AudioOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Summary.Audio) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Sample rate of the audio in Hz.
    -     * 
    - * - * float sample_rate = 1; - */ - float getSampleRate(); - - /** - *
    -     * Number of channels of audio.
    -     * 
    - * - * int64 num_channels = 2; - */ - long getNumChannels(); - - /** - *
    -     * Length of the audio in frames (samples per channel).
    -     * 
    - * - * int64 length_frames = 3; - */ - long getLengthFrames(); - - /** - *
    -     * Encoded audio data and its associated RFC 2045 content type (e.g.
    -     * "audio/wav").
    -     * 
    - * - * bytes encoded_audio_string = 4; - */ - com.google.protobuf.ByteString getEncodedAudioString(); - - /** - * string content_type = 5; - */ - java.lang.String getContentType(); - /** - * string content_type = 5; - */ - com.google.protobuf.ByteString - getContentTypeBytes(); - } - /** - * Protobuf type {@code tensorflow.Summary.Audio} - */ - public static final class Audio extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Summary.Audio) - AudioOrBuilder { - private static final long serialVersionUID = 0L; - // Use Audio.newBuilder() to construct. - private Audio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Audio() { - encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; - contentType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Audio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Audio( - 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 13: { - - sampleRate_ = input.readFloat(); - break; - } - case 16: { - - numChannels_ = input.readInt64(); - break; - } - case 24: { - - lengthFrames_ = input.readInt64(); - break; - } - case 34: { - - encodedAudioString_ = input.readBytes(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - contentType_ = s; - 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.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Audio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Summary.Audio.class, org.tensorflow.proto.framework.Summary.Audio.Builder.class); - } - - public static final int SAMPLE_RATE_FIELD_NUMBER = 1; - private float sampleRate_; - /** - *
    -     * Sample rate of the audio in Hz.
    -     * 
    - * - * float sample_rate = 1; - */ - public float getSampleRate() { - return sampleRate_; - } - - public static final int NUM_CHANNELS_FIELD_NUMBER = 2; - private long numChannels_; - /** - *
    -     * Number of channels of audio.
    -     * 
    - * - * int64 num_channels = 2; - */ - public long getNumChannels() { - return numChannels_; - } - - public static final int LENGTH_FRAMES_FIELD_NUMBER = 3; - private long lengthFrames_; - /** - *
    -     * Length of the audio in frames (samples per channel).
    -     * 
    - * - * int64 length_frames = 3; - */ - public long getLengthFrames() { - return lengthFrames_; - } - - public static final int ENCODED_AUDIO_STRING_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString encodedAudioString_; - /** - *
    -     * Encoded audio data and its associated RFC 2045 content type (e.g.
    -     * "audio/wav").
    -     * 
    - * - * bytes encoded_audio_string = 4; - */ - public com.google.protobuf.ByteString getEncodedAudioString() { - return encodedAudioString_; - } - - public static final int CONTENT_TYPE_FIELD_NUMBER = 5; - private volatile java.lang.Object contentType_; - /** - * string content_type = 5; - */ - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - 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(); - contentType_ = s; - return s; - } - } - /** - * string content_type = 5; - */ - public com.google.protobuf.ByteString - getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (sampleRate_ != 0F) { - output.writeFloat(1, sampleRate_); - } - if (numChannels_ != 0L) { - output.writeInt64(2, numChannels_); - } - if (lengthFrames_ != 0L) { - output.writeInt64(3, lengthFrames_); - } - if (!encodedAudioString_.isEmpty()) { - output.writeBytes(4, encodedAudioString_); - } - if (!getContentTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contentType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (sampleRate_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(1, sampleRate_); - } - if (numChannels_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, numChannels_); - } - if (lengthFrames_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, lengthFrames_); - } - if (!encodedAudioString_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, encodedAudioString_); - } - if (!getContentTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, contentType_); - } - 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.Summary.Audio)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.Summary.Audio other = (org.tensorflow.proto.framework.Summary.Audio) obj; - - if (java.lang.Float.floatToIntBits(getSampleRate()) - != java.lang.Float.floatToIntBits( - other.getSampleRate())) return false; - if (getNumChannels() - != other.getNumChannels()) return false; - if (getLengthFrames() - != other.getLengthFrames()) return false; - if (!getEncodedAudioString() - .equals(other.getEncodedAudioString())) return false; - if (!getContentType() - .equals(other.getContentType())) 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) + SAMPLE_RATE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getSampleRate()); - hash = (37 * hash) + NUM_CHANNELS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumChannels()); - hash = (37 * hash) + LENGTH_FRAMES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLengthFrames()); - hash = (37 * hash) + ENCODED_AUDIO_STRING_FIELD_NUMBER; - hash = (53 * hash) + getEncodedAudioString().hashCode(); - hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getContentType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.Summary.Audio parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Audio 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.Summary.Audio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Audio 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.Summary.Audio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.Summary.Audio parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.Summary.Audio parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Audio 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.Summary.Audio parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Audio 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.Summary.Audio parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.Summary.Audio 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.Summary.Audio 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.Summary.Audio} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Summary.Audio) - org.tensorflow.proto.framework.Summary.AudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Audio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.Summary.Audio.class, org.tensorflow.proto.framework.Summary.Audio.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.Summary.Audio.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(); - sampleRate_ = 0F; - - numChannels_ = 0L; - - lengthFrames_ = 0L; - - encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; - - contentType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Audio getDefaultInstanceForType() { - return org.tensorflow.proto.framework.Summary.Audio.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Audio build() { - org.tensorflow.proto.framework.Summary.Audio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.Summary.Audio buildPartial() { - org.tensorflow.proto.framework.Summary.Audio result = new org.tensorflow.proto.framework.Summary.Audio(this); - result.sampleRate_ = sampleRate_; - result.numChannels_ = numChannels_; - result.lengthFrames_ = lengthFrames_; - result.encodedAudioString_ = encodedAudioString_; - result.contentType_ = contentType_; - 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.Summary.Audio) { - return mergeFrom((org.tensorflow.proto.framework.Summary.Audio)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.Summary.Audio other) { - if (other == org.tensorflow.proto.framework.Summary.Audio.getDefaultInstance()) return this; - if (other.getSampleRate() != 0F) { - setSampleRate(other.getSampleRate()); - } - if (other.getNumChannels() != 0L) { - setNumChannels(other.getNumChannels()); - } - if (other.getLengthFrames() != 0L) { - setLengthFrames(other.getLengthFrames()); - } - if (other.getEncodedAudioString() != com.google.protobuf.ByteString.EMPTY) { - setEncodedAudioString(other.getEncodedAudioString()); - } - if (!other.getContentType().isEmpty()) { - contentType_ = other.contentType_; - onChanged(); - } - 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.Summary.Audio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.Summary.Audio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private float sampleRate_ ; - /** - *
    -       * Sample rate of the audio in Hz.
    -       * 
    - * - * float sample_rate = 1; - */ - public float getSampleRate() { - return sampleRate_; - } - /** - *
    -       * Sample rate of the audio in Hz.
    -       * 
    - * - * float sample_rate = 1; - */ - public Builder setSampleRate(float value) { - - sampleRate_ = value; - onChanged(); - return this; - } - /** - *
    -       * Sample rate of the audio in Hz.
    -       * 
    - * - * float sample_rate = 1; - */ - public Builder clearSampleRate() { - - sampleRate_ = 0F; - onChanged(); - return this; - } - - private long numChannels_ ; - /** - *
    -       * Number of channels of audio.
    -       * 
    - * - * int64 num_channels = 2; - */ - public long getNumChannels() { - return numChannels_; - } - /** - *
    -       * Number of channels of audio.
    -       * 
    - * - * int64 num_channels = 2; - */ - public Builder setNumChannels(long value) { - - numChannels_ = value; - onChanged(); - return this; - } - /** - *
    -       * Number of channels of audio.
    -       * 
    - * - * int64 num_channels = 2; - */ - public Builder clearNumChannels() { - - numChannels_ = 0L; - onChanged(); - return this; - } - - private long lengthFrames_ ; - /** - *
    -       * Length of the audio in frames (samples per channel).
    -       * 
    - * - * int64 length_frames = 3; - */ - public long getLengthFrames() { - return lengthFrames_; - } - /** - *
    -       * Length of the audio in frames (samples per channel).
    -       * 
    - * - * int64 length_frames = 3; - */ - public Builder setLengthFrames(long value) { - - lengthFrames_ = value; - onChanged(); - return this; - } - /** - *
    -       * Length of the audio in frames (samples per channel).
    -       * 
    - * - * int64 length_frames = 3; - */ - public Builder clearLengthFrames() { - - lengthFrames_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -       * Encoded audio data and its associated RFC 2045 content type (e.g.
    -       * "audio/wav").
    -       * 
    - * - * bytes encoded_audio_string = 4; - */ - public com.google.protobuf.ByteString getEncodedAudioString() { - return encodedAudioString_; - } - /** - *
    -       * Encoded audio data and its associated RFC 2045 content type (e.g.
    -       * "audio/wav").
    -       * 
    - * - * bytes encoded_audio_string = 4; - */ - public Builder setEncodedAudioString(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - encodedAudioString_ = value; - onChanged(); - return this; - } - /** - *
    -       * Encoded audio data and its associated RFC 2045 content type (e.g.
    -       * "audio/wav").
    -       * 
    - * - * bytes encoded_audio_string = 4; - */ - public Builder clearEncodedAudioString() { - - encodedAudioString_ = getDefaultInstance().getEncodedAudioString(); - onChanged(); - return this; - } - - private java.lang.Object contentType_ = ""; - /** - * string content_type = 5; - */ - public java.lang.String getContentType() { - java.lang.Object ref = contentType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contentType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string content_type = 5; - */ - public com.google.protobuf.ByteString - getContentTypeBytes() { - java.lang.Object ref = contentType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contentType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string content_type = 5; - */ - public Builder setContentType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contentType_ = value; - onChanged(); - return this; - } - /** - * string content_type = 5; - */ - public Builder clearContentType() { - - contentType_ = getDefaultInstance().getContentType(); - onChanged(); - return this; - } - /** - * string content_type = 5; - */ - public Builder setContentTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contentType_ = value; - 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.Summary.Audio) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Summary.Audio) - private static final org.tensorflow.proto.framework.Summary.Audio DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.Summary.Audio(); - } - - public static org.tensorflow.proto.framework.Summary.Audio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser
    - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Summary parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Summary(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.Summary getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryDescription.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryDescription.java deleted file mode 100644 index 1543fd841d1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryDescription.java +++ /dev/null @@ -1,589 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Metadata associated with a series of Summary data
    - * 
    - * - * Protobuf type {@code tensorflow.SummaryDescription} - */ -public final class SummaryDescription extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SummaryDescription) - SummaryDescriptionOrBuilder { -private static final long serialVersionUID = 0L; - // Use SummaryDescription.newBuilder() to construct. - private SummaryDescription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SummaryDescription() { - typeHint_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SummaryDescription(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SummaryDescription( - 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(); - - typeHint_ = s; - 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.SummaryProtos.internal_static_tensorflow_SummaryDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryDescription.class, org.tensorflow.proto.framework.SummaryDescription.Builder.class); - } - - public static final int TYPE_HINT_FIELD_NUMBER = 1; - private volatile java.lang.Object typeHint_; - /** - *
    -   * Hint on how plugins should process the data in this series.
    -   * Supported values include "scalar", "histogram", "image", "audio"
    -   * 
    - * - * string type_hint = 1; - */ - public java.lang.String getTypeHint() { - java.lang.Object ref = typeHint_; - 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(); - typeHint_ = s; - return s; - } - } - /** - *
    -   * Hint on how plugins should process the data in this series.
    -   * Supported values include "scalar", "histogram", "image", "audio"
    -   * 
    - * - * string type_hint = 1; - */ - public com.google.protobuf.ByteString - getTypeHintBytes() { - java.lang.Object ref = typeHint_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeHint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getTypeHintBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, typeHint_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeHintBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, typeHint_); - } - 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.SummaryDescription)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SummaryDescription other = (org.tensorflow.proto.framework.SummaryDescription) obj; - - if (!getTypeHint() - .equals(other.getTypeHint())) 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) + TYPE_HINT_FIELD_NUMBER; - hash = (53 * hash) + getTypeHint().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SummaryDescription parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryDescription 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.SummaryDescription parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryDescription 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.SummaryDescription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryDescription parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SummaryDescription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryDescription 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.SummaryDescription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryDescription 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.SummaryDescription parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryDescription 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.SummaryDescription 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; - } - /** - *
    -   * Metadata associated with a series of Summary data
    -   * 
    - * - * Protobuf type {@code tensorflow.SummaryDescription} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SummaryDescription) - org.tensorflow.proto.framework.SummaryDescriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryDescription.class, org.tensorflow.proto.framework.SummaryDescription.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SummaryDescription.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(); - typeHint_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryDescription_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryDescription getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SummaryDescription.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryDescription build() { - org.tensorflow.proto.framework.SummaryDescription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryDescription buildPartial() { - org.tensorflow.proto.framework.SummaryDescription result = new org.tensorflow.proto.framework.SummaryDescription(this); - result.typeHint_ = typeHint_; - 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.SummaryDescription) { - return mergeFrom((org.tensorflow.proto.framework.SummaryDescription)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SummaryDescription other) { - if (other == org.tensorflow.proto.framework.SummaryDescription.getDefaultInstance()) return this; - if (!other.getTypeHint().isEmpty()) { - typeHint_ = other.typeHint_; - onChanged(); - } - 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.SummaryDescription parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SummaryDescription) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object typeHint_ = ""; - /** - *
    -     * Hint on how plugins should process the data in this series.
    -     * Supported values include "scalar", "histogram", "image", "audio"
    -     * 
    - * - * string type_hint = 1; - */ - public java.lang.String getTypeHint() { - java.lang.Object ref = typeHint_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeHint_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Hint on how plugins should process the data in this series.
    -     * Supported values include "scalar", "histogram", "image", "audio"
    -     * 
    - * - * string type_hint = 1; - */ - public com.google.protobuf.ByteString - getTypeHintBytes() { - java.lang.Object ref = typeHint_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeHint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Hint on how plugins should process the data in this series.
    -     * Supported values include "scalar", "histogram", "image", "audio"
    -     * 
    - * - * string type_hint = 1; - */ - public Builder setTypeHint( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeHint_ = value; - onChanged(); - return this; - } - /** - *
    -     * Hint on how plugins should process the data in this series.
    -     * Supported values include "scalar", "histogram", "image", "audio"
    -     * 
    - * - * string type_hint = 1; - */ - public Builder clearTypeHint() { - - typeHint_ = getDefaultInstance().getTypeHint(); - onChanged(); - return this; - } - /** - *
    -     * Hint on how plugins should process the data in this series.
    -     * Supported values include "scalar", "histogram", "image", "audio"
    -     * 
    - * - * string type_hint = 1; - */ - public Builder setTypeHintBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeHint_ = value; - 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.SummaryDescription) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SummaryDescription) - private static final org.tensorflow.proto.framework.SummaryDescription DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SummaryDescription(); - } - - public static org.tensorflow.proto.framework.SummaryDescription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SummaryDescription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SummaryDescription(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.SummaryDescription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadata.java deleted file mode 100644 index 969ed4d6d71..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadata.java +++ /dev/null @@ -1,1784 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A SummaryMetadata encapsulates information on which plugins are able to make
    - * use of a certain summary value.
    - * 
    - * - * Protobuf type {@code tensorflow.SummaryMetadata} - */ -public final class SummaryMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SummaryMetadata) - SummaryMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use SummaryMetadata.newBuilder() to construct. - private SummaryMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SummaryMetadata() { - displayName_ = ""; - summaryDescription_ = ""; - dataClass_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SummaryMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SummaryMetadata( - 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: { - org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder subBuilder = null; - if (pluginData_ != null) { - subBuilder = pluginData_.toBuilder(); - } - pluginData_ = input.readMessage(org.tensorflow.proto.framework.SummaryMetadata.PluginData.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(pluginData_); - pluginData_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - summaryDescription_ = s; - break; - } - case 32: { - int rawValue = input.readEnum(); - - dataClass_ = rawValue; - 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.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryMetadata.class, org.tensorflow.proto.framework.SummaryMetadata.Builder.class); - } - - public interface PluginDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SummaryMetadata.PluginData) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The name of the plugin this data pertains to.
    -     * 
    - * - * string plugin_name = 1; - */ - java.lang.String getPluginName(); - /** - *
    -     * The name of the plugin this data pertains to.
    -     * 
    - * - * string plugin_name = 1; - */ - com.google.protobuf.ByteString - getPluginNameBytes(); - - /** - *
    -     * The content to store for the plugin. The best practice is for this to be
    -     * a binary serialized protocol buffer.
    -     * 
    - * - * bytes content = 2; - */ - com.google.protobuf.ByteString getContent(); - } - /** - * Protobuf type {@code tensorflow.SummaryMetadata.PluginData} - */ - public static final class PluginData extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SummaryMetadata.PluginData) - PluginDataOrBuilder { - private static final long serialVersionUID = 0L; - // Use PluginData.newBuilder() to construct. - private PluginData(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PluginData() { - pluginName_ = ""; - content_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PluginData(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PluginData( - 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(); - - pluginName_ = s; - break; - } - case 18: { - - content_ = input.readBytes(); - 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.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryMetadata.PluginData.class, org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder.class); - } - - public static final int PLUGIN_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object pluginName_; - /** - *
    -     * The name of the plugin this data pertains to.
    -     * 
    - * - * string plugin_name = 1; - */ - public java.lang.String getPluginName() { - java.lang.Object ref = pluginName_; - 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(); - pluginName_ = s; - return s; - } - } - /** - *
    -     * The name of the plugin this data pertains to.
    -     * 
    - * - * string plugin_name = 1; - */ - public com.google.protobuf.ByteString - getPluginNameBytes() { - java.lang.Object ref = pluginName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pluginName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTENT_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString content_; - /** - *
    -     * The content to store for the plugin. The best practice is for this to be
    -     * a binary serialized protocol buffer.
    -     * 
    - * - * bytes content = 2; - */ - public com.google.protobuf.ByteString getContent() { - return content_; - } - - 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 (!getPluginNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pluginName_); - } - if (!content_.isEmpty()) { - output.writeBytes(2, content_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPluginNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pluginName_); - } - if (!content_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, content_); - } - 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.SummaryMetadata.PluginData)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SummaryMetadata.PluginData other = (org.tensorflow.proto.framework.SummaryMetadata.PluginData) obj; - - if (!getPluginName() - .equals(other.getPluginName())) return false; - if (!getContent() - .equals(other.getContent())) 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) + PLUGIN_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPluginName().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SummaryMetadata.PluginData) - org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryMetadata.PluginData.class, org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SummaryMetadata.PluginData.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(); - pluginName_ = ""; - - content_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata.PluginData getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SummaryMetadata.PluginData.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata.PluginData build() { - org.tensorflow.proto.framework.SummaryMetadata.PluginData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata.PluginData buildPartial() { - org.tensorflow.proto.framework.SummaryMetadata.PluginData result = new org.tensorflow.proto.framework.SummaryMetadata.PluginData(this); - result.pluginName_ = pluginName_; - result.content_ = content_; - 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.SummaryMetadata.PluginData) { - return mergeFrom((org.tensorflow.proto.framework.SummaryMetadata.PluginData)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SummaryMetadata.PluginData other) { - if (other == org.tensorflow.proto.framework.SummaryMetadata.PluginData.getDefaultInstance()) return this; - if (!other.getPluginName().isEmpty()) { - pluginName_ = other.pluginName_; - onChanged(); - } - if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { - setContent(other.getContent()); - } - 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.SummaryMetadata.PluginData parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SummaryMetadata.PluginData) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object pluginName_ = ""; - /** - *
    -       * The name of the plugin this data pertains to.
    -       * 
    - * - * string plugin_name = 1; - */ - public java.lang.String getPluginName() { - java.lang.Object ref = pluginName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pluginName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The name of the plugin this data pertains to.
    -       * 
    - * - * string plugin_name = 1; - */ - public com.google.protobuf.ByteString - getPluginNameBytes() { - java.lang.Object ref = pluginName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pluginName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The name of the plugin this data pertains to.
    -       * 
    - * - * string plugin_name = 1; - */ - public Builder setPluginName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pluginName_ = value; - onChanged(); - return this; - } - /** - *
    -       * The name of the plugin this data pertains to.
    -       * 
    - * - * string plugin_name = 1; - */ - public Builder clearPluginName() { - - pluginName_ = getDefaultInstance().getPluginName(); - onChanged(); - return this; - } - /** - *
    -       * The name of the plugin this data pertains to.
    -       * 
    - * - * string plugin_name = 1; - */ - public Builder setPluginNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pluginName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -       * The content to store for the plugin. The best practice is for this to be
    -       * a binary serialized protocol buffer.
    -       * 
    - * - * bytes content = 2; - */ - public com.google.protobuf.ByteString getContent() { - return content_; - } - /** - *
    -       * The content to store for the plugin. The best practice is for this to be
    -       * a binary serialized protocol buffer.
    -       * 
    - * - * bytes content = 2; - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
    -       * The content to store for the plugin. The best practice is for this to be
    -       * a binary serialized protocol buffer.
    -       * 
    - * - * bytes content = 2; - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - 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.SummaryMetadata.PluginData) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SummaryMetadata.PluginData) - private static final org.tensorflow.proto.framework.SummaryMetadata.PluginData DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SummaryMetadata.PluginData(); - } - - public static org.tensorflow.proto.framework.SummaryMetadata.PluginData getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PluginData parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PluginData(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.SummaryMetadata.PluginData getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int PLUGIN_DATA_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.SummaryMetadata.PluginData pluginData_; - /** - *
    -   * Data that associates a summary with a certain plugin.
    -   * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public boolean hasPluginData() { - return pluginData_ != null; - } - /** - *
    -   * Data that associates a summary with a certain plugin.
    -   * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public org.tensorflow.proto.framework.SummaryMetadata.PluginData getPluginData() { - return pluginData_ == null ? org.tensorflow.proto.framework.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; - } - /** - *
    -   * Data that associates a summary with a certain plugin.
    -   * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder() { - return getPluginData(); - } - - public static final int DISPLAY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; - /** - *
    -   * Display name for viewing in TensorBoard.
    -   * 
    - * - * string display_name = 2; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - 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(); - displayName_ = s; - return s; - } - } - /** - *
    -   * Display name for viewing in TensorBoard.
    -   * 
    - * - * string display_name = 2; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUMMARY_DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object summaryDescription_; - /** - *
    -   * Longform readable description of the summary sequence. Markdown supported.
    -   * 
    - * - * string summary_description = 3; - */ - public java.lang.String getSummaryDescription() { - java.lang.Object ref = summaryDescription_; - 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(); - summaryDescription_ = s; - return s; - } - } - /** - *
    -   * Longform readable description of the summary sequence. Markdown supported.
    -   * 
    - * - * string summary_description = 3; - */ - public com.google.protobuf.ByteString - getSummaryDescriptionBytes() { - java.lang.Object ref = summaryDescription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summaryDescription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DATA_CLASS_FIELD_NUMBER = 4; - private int dataClass_; - /** - *
    -   * Class of data stored in this time series. Required for compatibility with
    -   * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -   * imposes constraints on the dtype and shape of the corresponding tensor
    -   * values. See `DataClass` docs for details.
    -   * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public int getDataClassValue() { - return dataClass_; - } - /** - *
    -   * Class of data stored in this time series. Required for compatibility with
    -   * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -   * imposes constraints on the dtype and shape of the corresponding tensor
    -   * values. See `DataClass` docs for details.
    -   * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public org.tensorflow.proto.framework.DataClass getDataClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataClass result = org.tensorflow.proto.framework.DataClass.valueOf(dataClass_); - return result == null ? org.tensorflow.proto.framework.DataClass.UNRECOGNIZED : result; - } - - 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 (pluginData_ != null) { - output.writeMessage(1, getPluginData()); - } - if (!getDisplayNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!getSummaryDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, summaryDescription_); - } - if (dataClass_ != org.tensorflow.proto.framework.DataClass.DATA_CLASS_UNKNOWN.getNumber()) { - output.writeEnum(4, dataClass_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (pluginData_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPluginData()); - } - if (!getDisplayNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!getSummaryDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, summaryDescription_); - } - if (dataClass_ != org.tensorflow.proto.framework.DataClass.DATA_CLASS_UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, dataClass_); - } - 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.SummaryMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.SummaryMetadata other = (org.tensorflow.proto.framework.SummaryMetadata) obj; - - if (hasPluginData() != other.hasPluginData()) return false; - if (hasPluginData()) { - if (!getPluginData() - .equals(other.getPluginData())) return false; - } - if (!getDisplayName() - .equals(other.getDisplayName())) return false; - if (!getSummaryDescription() - .equals(other.getSummaryDescription())) return false; - if (dataClass_ != other.dataClass_) 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 (hasPluginData()) { - hash = (37 * hash) + PLUGIN_DATA_FIELD_NUMBER; - hash = (53 * hash) + getPluginData().hashCode(); - } - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + SUMMARY_DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getSummaryDescription().hashCode(); - hash = (37 * hash) + DATA_CLASS_FIELD_NUMBER; - hash = (53 * hash) + dataClass_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.SummaryMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata 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.SummaryMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata 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.SummaryMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.SummaryMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.SummaryMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata 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.SummaryMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata 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.SummaryMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.SummaryMetadata 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.SummaryMetadata 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 SummaryMetadata encapsulates information on which plugins are able to make
    -   * use of a certain summary value.
    -   * 
    - * - * Protobuf type {@code tensorflow.SummaryMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SummaryMetadata) - org.tensorflow.proto.framework.SummaryMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.SummaryMetadata.class, org.tensorflow.proto.framework.SummaryMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.SummaryMetadata.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 (pluginDataBuilder_ == null) { - pluginData_ = null; - } else { - pluginData_ = null; - pluginDataBuilder_ = null; - } - displayName_ = ""; - - summaryDescription_ = ""; - - dataClass_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.framework.SummaryMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata build() { - org.tensorflow.proto.framework.SummaryMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.SummaryMetadata buildPartial() { - org.tensorflow.proto.framework.SummaryMetadata result = new org.tensorflow.proto.framework.SummaryMetadata(this); - if (pluginDataBuilder_ == null) { - result.pluginData_ = pluginData_; - } else { - result.pluginData_ = pluginDataBuilder_.build(); - } - result.displayName_ = displayName_; - result.summaryDescription_ = summaryDescription_; - result.dataClass_ = dataClass_; - 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.SummaryMetadata) { - return mergeFrom((org.tensorflow.proto.framework.SummaryMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.SummaryMetadata other) { - if (other == org.tensorflow.proto.framework.SummaryMetadata.getDefaultInstance()) return this; - if (other.hasPluginData()) { - mergePluginData(other.getPluginData()); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - if (!other.getSummaryDescription().isEmpty()) { - summaryDescription_ = other.summaryDescription_; - onChanged(); - } - if (other.dataClass_ != 0) { - setDataClassValue(other.getDataClassValue()); - } - 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.SummaryMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.SummaryMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.framework.SummaryMetadata.PluginData pluginData_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SummaryMetadata.PluginData, org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder> pluginDataBuilder_; - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public boolean hasPluginData() { - return pluginDataBuilder_ != null || pluginData_ != null; - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public org.tensorflow.proto.framework.SummaryMetadata.PluginData getPluginData() { - if (pluginDataBuilder_ == null) { - return pluginData_ == null ? org.tensorflow.proto.framework.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; - } else { - return pluginDataBuilder_.getMessage(); - } - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public Builder setPluginData(org.tensorflow.proto.framework.SummaryMetadata.PluginData value) { - if (pluginDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - pluginData_ = value; - onChanged(); - } else { - pluginDataBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public Builder setPluginData( - org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder builderForValue) { - if (pluginDataBuilder_ == null) { - pluginData_ = builderForValue.build(); - onChanged(); - } else { - pluginDataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public Builder mergePluginData(org.tensorflow.proto.framework.SummaryMetadata.PluginData value) { - if (pluginDataBuilder_ == null) { - if (pluginData_ != null) { - pluginData_ = - org.tensorflow.proto.framework.SummaryMetadata.PluginData.newBuilder(pluginData_).mergeFrom(value).buildPartial(); - } else { - pluginData_ = value; - } - onChanged(); - } else { - pluginDataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public Builder clearPluginData() { - if (pluginDataBuilder_ == null) { - pluginData_ = null; - onChanged(); - } else { - pluginData_ = null; - pluginDataBuilder_ = null; - } - - return this; - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder getPluginDataBuilder() { - - onChanged(); - return getPluginDataFieldBuilder().getBuilder(); - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - public org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder() { - if (pluginDataBuilder_ != null) { - return pluginDataBuilder_.getMessageOrBuilder(); - } else { - return pluginData_ == null ? - org.tensorflow.proto.framework.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; - } - } - /** - *
    -     * Data that associates a summary with a certain plugin.
    -     * 
    - * - * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SummaryMetadata.PluginData, org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder> - getPluginDataFieldBuilder() { - if (pluginDataBuilder_ == null) { - pluginDataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SummaryMetadata.PluginData, org.tensorflow.proto.framework.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder>( - getPluginData(), - getParentForChildren(), - isClean()); - pluginData_ = null; - } - return pluginDataBuilder_; - } - - private java.lang.Object displayName_ = ""; - /** - *
    -     * Display name for viewing in TensorBoard.
    -     * 
    - * - * string display_name = 2; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Display name for viewing in TensorBoard.
    -     * 
    - * - * string display_name = 2; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Display name for viewing in TensorBoard.
    -     * 
    - * - * string display_name = 2; - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Display name for viewing in TensorBoard.
    -     * 
    - * - * string display_name = 2; - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - *
    -     * Display name for viewing in TensorBoard.
    -     * 
    - * - * string display_name = 2; - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private java.lang.Object summaryDescription_ = ""; - /** - *
    -     * Longform readable description of the summary sequence. Markdown supported.
    -     * 
    - * - * string summary_description = 3; - */ - public java.lang.String getSummaryDescription() { - java.lang.Object ref = summaryDescription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summaryDescription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Longform readable description of the summary sequence. Markdown supported.
    -     * 
    - * - * string summary_description = 3; - */ - public com.google.protobuf.ByteString - getSummaryDescriptionBytes() { - java.lang.Object ref = summaryDescription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - summaryDescription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Longform readable description of the summary sequence. Markdown supported.
    -     * 
    - * - * string summary_description = 3; - */ - public Builder setSummaryDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - summaryDescription_ = value; - onChanged(); - return this; - } - /** - *
    -     * Longform readable description of the summary sequence. Markdown supported.
    -     * 
    - * - * string summary_description = 3; - */ - public Builder clearSummaryDescription() { - - summaryDescription_ = getDefaultInstance().getSummaryDescription(); - onChanged(); - return this; - } - /** - *
    -     * Longform readable description of the summary sequence. Markdown supported.
    -     * 
    - * - * string summary_description = 3; - */ - public Builder setSummaryDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summaryDescription_ = value; - onChanged(); - return this; - } - - private int dataClass_ = 0; - /** - *
    -     * Class of data stored in this time series. Required for compatibility with
    -     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -     * imposes constraints on the dtype and shape of the corresponding tensor
    -     * values. See `DataClass` docs for details.
    -     * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public int getDataClassValue() { - return dataClass_; - } - /** - *
    -     * Class of data stored in this time series. Required for compatibility with
    -     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -     * imposes constraints on the dtype and shape of the corresponding tensor
    -     * values. See `DataClass` docs for details.
    -     * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public Builder setDataClassValue(int value) { - dataClass_ = value; - onChanged(); - return this; - } - /** - *
    -     * Class of data stored in this time series. Required for compatibility with
    -     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -     * imposes constraints on the dtype and shape of the corresponding tensor
    -     * values. See `DataClass` docs for details.
    -     * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public org.tensorflow.proto.framework.DataClass getDataClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataClass result = org.tensorflow.proto.framework.DataClass.valueOf(dataClass_); - return result == null ? org.tensorflow.proto.framework.DataClass.UNRECOGNIZED : result; - } - /** - *
    -     * Class of data stored in this time series. Required for compatibility with
    -     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -     * imposes constraints on the dtype and shape of the corresponding tensor
    -     * values. See `DataClass` docs for details.
    -     * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public Builder setDataClass(org.tensorflow.proto.framework.DataClass value) { - if (value == null) { - throw new NullPointerException(); - } - - dataClass_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Class of data stored in this time series. Required for compatibility with
    -     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    -     * imposes constraints on the dtype and shape of the corresponding tensor
    -     * values. See `DataClass` docs for details.
    -     * 
    - * - * .tensorflow.DataClass data_class = 4; - */ - public Builder clearDataClass() { - - dataClass_ = 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.SummaryMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SummaryMetadata) - private static final org.tensorflow.proto.framework.SummaryMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.SummaryMetadata(); - } - - public static org.tensorflow.proto.framework.SummaryMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SummaryMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SummaryMetadata(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.SummaryMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryProtos.java deleted file mode 100644 index 8e0373a5f18..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryProtos.java +++ /dev/null @@ -1,159 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/summary.proto - -package org.tensorflow.proto.framework; - -public final class SummaryProtos { - private SummaryProtos() {} - 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_SummaryDescription_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SummaryDescription_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_HistogramProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_HistogramProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SummaryMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SummaryMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Summary_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Summary_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Summary_Image_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Summary_Image_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Summary_Audio_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Summary_Audio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Summary_Value_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Summary_Value_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/framework/summary.prot" + - "o\022\ntensorflow\032&tensorflow/core/framework" + - "/tensor.proto\"\'\n\022SummaryDescription\022\021\n\tt" + - "ype_hint\030\001 \001(\t\"\207\001\n\016HistogramProto\022\013\n\003min" + - "\030\001 \001(\001\022\013\n\003max\030\002 \001(\001\022\013\n\003num\030\003 \001(\001\022\013\n\003sum\030" + - "\004 \001(\001\022\023\n\013sum_squares\030\005 \001(\001\022\030\n\014bucket_lim" + - "it\030\006 \003(\001B\002\020\001\022\022\n\006bucket\030\007 \003(\001B\002\020\001\"\340\001\n\017Sum" + - "maryMetadata\022;\n\013plugin_data\030\001 \001(\0132&.tens" + - "orflow.SummaryMetadata.PluginData\022\024\n\014dis" + - "play_name\030\002 \001(\t\022\033\n\023summary_description\030\003" + - " \001(\t\022)\n\ndata_class\030\004 \001(\0162\025.tensorflow.Da" + - "taClass\0322\n\nPluginData\022\023\n\013plugin_name\030\001 \001" + - "(\t\022\017\n\007content\030\002 \001(\014\"\336\004\n\007Summary\022(\n\005value" + - "\030\001 \003(\0132\031.tensorflow.Summary.Value\032X\n\005Ima" + - "ge\022\016\n\006height\030\001 \001(\005\022\r\n\005width\030\002 \001(\005\022\022\n\ncol" + - "orspace\030\003 \001(\005\022\034\n\024encoded_image_string\030\004 " + - "\001(\014\032}\n\005Audio\022\023\n\013sample_rate\030\001 \001(\002\022\024\n\014num" + - "_channels\030\002 \001(\003\022\025\n\rlength_frames\030\003 \001(\003\022\034" + - "\n\024encoded_audio_string\030\004 \001(\014\022\024\n\014content_" + - "type\030\005 \001(\t\032\317\002\n\005Value\022\021\n\tnode_name\030\007 \001(\t\022" + - "\013\n\003tag\030\001 \001(\t\022-\n\010metadata\030\t \001(\0132\033.tensorf" + - "low.SummaryMetadata\022\026\n\014simple_value\030\002 \001(" + - "\002H\000\022&\n\034obsolete_old_style_histogram\030\003 \001(" + - "\014H\000\022*\n\005image\030\004 \001(\0132\031.tensorflow.Summary." + - "ImageH\000\022+\n\005histo\030\005 \001(\0132\032.tensorflow.Hist" + - "ogramProtoH\000\022*\n\005audio\030\006 \001(\0132\031.tensorflow" + - ".Summary.AudioH\000\022)\n\006tensor\030\010 \001(\0132\027.tenso" + - "rflow.TensorProtoH\000B\007\n\005value*o\n\tDataClas" + - "s\022\026\n\022DATA_CLASS_UNKNOWN\020\000\022\025\n\021DATA_CLASS_" + - "SCALAR\020\001\022\025\n\021DATA_CLASS_TENSOR\020\002\022\034\n\030DATA_" + - "CLASS_BLOB_SEQUENCE\020\003B\204\001\n\036org.tensorflow" + - ".proto.frameworkB\rSummaryProtosP\001ZNgithu" + - "b.com/tensorflow/tensorflow/tensorflow/g" + - "o/core/framework/summary_go_proto\370\001\001b\006pr" + - "oto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - }); - internal_static_tensorflow_SummaryDescription_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SummaryDescription_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SummaryDescription_descriptor, - new java.lang.String[] { "TypeHint", }); - internal_static_tensorflow_HistogramProto_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_HistogramProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_HistogramProto_descriptor, - new java.lang.String[] { "Min", "Max", "Num", "Sum", "SumSquares", "BucketLimit", "Bucket", }); - internal_static_tensorflow_SummaryMetadata_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_SummaryMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SummaryMetadata_descriptor, - new java.lang.String[] { "PluginData", "DisplayName", "SummaryDescription", "DataClass", }); - internal_static_tensorflow_SummaryMetadata_PluginData_descriptor = - internal_static_tensorflow_SummaryMetadata_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SummaryMetadata_PluginData_descriptor, - new java.lang.String[] { "PluginName", "Content", }); - internal_static_tensorflow_Summary_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_Summary_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Summary_descriptor, - new java.lang.String[] { "Value", }); - internal_static_tensorflow_Summary_Image_descriptor = - internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_Summary_Image_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Summary_Image_descriptor, - new java.lang.String[] { "Height", "Width", "Colorspace", "EncodedImageString", }); - internal_static_tensorflow_Summary_Audio_descriptor = - internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_Summary_Audio_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Summary_Audio_descriptor, - new java.lang.String[] { "SampleRate", "NumChannels", "LengthFrames", "EncodedAudioString", "ContentType", }); - internal_static_tensorflow_Summary_Value_descriptor = - internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_Summary_Value_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Summary_Value_descriptor, - new java.lang.String[] { "NodeName", "Tag", "Metadata", "SimpleValue", "ObsoleteOldStyleHistogram", "Image", "Histo", "Audio", "Tensor", "Value", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnection.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnection.java deleted file mode 100644 index 5be946ae717..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnection.java +++ /dev/null @@ -1,751 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Defines a connection between two tensors in a `GraphDef`.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorConnection} - */ -public final class TensorConnection extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorConnection) - TensorConnectionOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorConnection.newBuilder() to construct. - private TensorConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorConnection() { - fromTensor_ = ""; - toTensor_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorConnection(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorConnection( - 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(); - - fromTensor_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - toTensor_ = s; - 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.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_TensorConnection_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorConnection.class, org.tensorflow.proto.framework.TensorConnection.Builder.class); - } - - public static final int FROM_TENSOR_FIELD_NUMBER = 1; - private volatile java.lang.Object fromTensor_; - /** - *
    -   * A tensor name. The value of this tensor will be substituted for
    -   * the tensor named in `to_tensor`.
    -   * 
    - * - * string from_tensor = 1; - */ - public java.lang.String getFromTensor() { - java.lang.Object ref = fromTensor_; - 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(); - fromTensor_ = s; - return s; - } - } - /** - *
    -   * A tensor name. The value of this tensor will be substituted for
    -   * the tensor named in `to_tensor`.
    -   * 
    - * - * string from_tensor = 1; - */ - public com.google.protobuf.ByteString - getFromTensorBytes() { - java.lang.Object ref = fromTensor_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fromTensor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TO_TENSOR_FIELD_NUMBER = 2; - private volatile java.lang.Object toTensor_; - /** - *
    -   * A tensor name. The value of this tensor will be bound to the
    -   * value of the tensor named in `from_tensor`.
    -   * 
    - * - * string to_tensor = 2; - */ - public java.lang.String getToTensor() { - java.lang.Object ref = toTensor_; - 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(); - toTensor_ = s; - return s; - } - } - /** - *
    -   * A tensor name. The value of this tensor will be bound to the
    -   * value of the tensor named in `from_tensor`.
    -   * 
    - * - * string to_tensor = 2; - */ - public com.google.protobuf.ByteString - getToTensorBytes() { - java.lang.Object ref = toTensor_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - toTensor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getFromTensorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fromTensor_); - } - if (!getToTensorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, toTensor_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getFromTensorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fromTensor_); - } - if (!getToTensorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, toTensor_); - } - 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.TensorConnection)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorConnection other = (org.tensorflow.proto.framework.TensorConnection) obj; - - if (!getFromTensor() - .equals(other.getFromTensor())) return false; - if (!getToTensor() - .equals(other.getToTensor())) 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) + FROM_TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getFromTensor().hashCode(); - hash = (37 * hash) + TO_TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getToTensor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorConnection parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorConnection 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.TensorConnection parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorConnection 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.TensorConnection parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorConnection parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorConnection parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorConnection 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.TensorConnection parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorConnection 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.TensorConnection parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorConnection 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.TensorConnection 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; - } - /** - *
    -   * Defines a connection between two tensors in a `GraphDef`.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorConnection} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorConnection) - org.tensorflow.proto.framework.TensorConnectionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_TensorConnection_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorConnection.class, org.tensorflow.proto.framework.TensorConnection.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorConnection.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(); - fromTensor_ = ""; - - toTensor_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorConnection getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorConnection.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorConnection build() { - org.tensorflow.proto.framework.TensorConnection result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorConnection buildPartial() { - org.tensorflow.proto.framework.TensorConnection result = new org.tensorflow.proto.framework.TensorConnection(this); - result.fromTensor_ = fromTensor_; - result.toTensor_ = toTensor_; - 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.TensorConnection) { - return mergeFrom((org.tensorflow.proto.framework.TensorConnection)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorConnection other) { - if (other == org.tensorflow.proto.framework.TensorConnection.getDefaultInstance()) return this; - if (!other.getFromTensor().isEmpty()) { - fromTensor_ = other.fromTensor_; - onChanged(); - } - if (!other.getToTensor().isEmpty()) { - toTensor_ = other.toTensor_; - onChanged(); - } - 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.TensorConnection parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorConnection) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object fromTensor_ = ""; - /** - *
    -     * A tensor name. The value of this tensor will be substituted for
    -     * the tensor named in `to_tensor`.
    -     * 
    - * - * string from_tensor = 1; - */ - public java.lang.String getFromTensor() { - java.lang.Object ref = fromTensor_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fromTensor_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A tensor name. The value of this tensor will be substituted for
    -     * the tensor named in `to_tensor`.
    -     * 
    - * - * string from_tensor = 1; - */ - public com.google.protobuf.ByteString - getFromTensorBytes() { - java.lang.Object ref = fromTensor_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fromTensor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A tensor name. The value of this tensor will be substituted for
    -     * the tensor named in `to_tensor`.
    -     * 
    - * - * string from_tensor = 1; - */ - public Builder setFromTensor( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fromTensor_ = value; - onChanged(); - return this; - } - /** - *
    -     * A tensor name. The value of this tensor will be substituted for
    -     * the tensor named in `to_tensor`.
    -     * 
    - * - * string from_tensor = 1; - */ - public Builder clearFromTensor() { - - fromTensor_ = getDefaultInstance().getFromTensor(); - onChanged(); - return this; - } - /** - *
    -     * A tensor name. The value of this tensor will be substituted for
    -     * the tensor named in `to_tensor`.
    -     * 
    - * - * string from_tensor = 1; - */ - public Builder setFromTensorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fromTensor_ = value; - onChanged(); - return this; - } - - private java.lang.Object toTensor_ = ""; - /** - *
    -     * A tensor name. The value of this tensor will be bound to the
    -     * value of the tensor named in `from_tensor`.
    -     * 
    - * - * string to_tensor = 2; - */ - public java.lang.String getToTensor() { - java.lang.Object ref = toTensor_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - toTensor_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A tensor name. The value of this tensor will be bound to the
    -     * value of the tensor named in `from_tensor`.
    -     * 
    - * - * string to_tensor = 2; - */ - public com.google.protobuf.ByteString - getToTensorBytes() { - java.lang.Object ref = toTensor_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - toTensor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A tensor name. The value of this tensor will be bound to the
    -     * value of the tensor named in `from_tensor`.
    -     * 
    - * - * string to_tensor = 2; - */ - public Builder setToTensor( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - toTensor_ = value; - onChanged(); - return this; - } - /** - *
    -     * A tensor name. The value of this tensor will be bound to the
    -     * value of the tensor named in `from_tensor`.
    -     * 
    - * - * string to_tensor = 2; - */ - public Builder clearToTensor() { - - toTensor_ = getDefaultInstance().getToTensor(); - onChanged(); - return this; - } - /** - *
    -     * A tensor name. The value of this tensor will be bound to the
    -     * value of the tensor named in `from_tensor`.
    -     * 
    - * - * string to_tensor = 2; - */ - public Builder setToTensorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - toTensor_ = value; - 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.TensorConnection) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorConnection) - private static final org.tensorflow.proto.framework.TensorConnection DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorConnection(); - } - - public static org.tensorflow.proto.framework.TensorConnection getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorConnection parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorConnection(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.TensorConnection getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescription.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescription.java deleted file mode 100644 index 7a79838fb16..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescription.java +++ /dev/null @@ -1,990 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_description.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.TensorDescription} - */ -public final class TensorDescription extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorDescription) - TensorDescriptionOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorDescription.newBuilder() to construct. - private TensorDescription(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorDescription() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorDescription(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorDescription( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.tensorflow.proto.framework.AllocationDescription.Builder subBuilder = null; - if (allocationDescription_ != null) { - subBuilder = allocationDescription_.toBuilder(); - } - allocationDescription_ = input.readMessage(org.tensorflow.proto.framework.AllocationDescription.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(allocationDescription_); - allocationDescription_ = subBuilder.buildPartial(); - } - - 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.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorDescription.class, org.tensorflow.proto.framework.TensorDescription.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - *
    -   * Data type of tensor elements
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -   * Data type of tensor elements
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int ALLOCATION_DESCRIPTION_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.AllocationDescription allocationDescription_; - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public boolean hasAllocationDescription() { - return allocationDescription_ != null; - } - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public org.tensorflow.proto.framework.AllocationDescription getAllocationDescription() { - return allocationDescription_ == null ? org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance() : allocationDescription_; - } - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder() { - return getAllocationDescription(); - } - - 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 (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (allocationDescription_ != null) { - output.writeMessage(4, getAllocationDescription()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (allocationDescription_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getAllocationDescription()); - } - 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.TensorDescription)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorDescription other = (org.tensorflow.proto.framework.TensorDescription) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (hasAllocationDescription() != other.hasAllocationDescription()) return false; - if (hasAllocationDescription()) { - if (!getAllocationDescription() - .equals(other.getAllocationDescription())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - if (hasAllocationDescription()) { - hash = (37 * hash) + ALLOCATION_DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getAllocationDescription().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorDescription parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorDescription 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.TensorDescription parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorDescription 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.TensorDescription parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorDescription parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorDescription parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorDescription 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.TensorDescription parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorDescription 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.TensorDescription parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorDescription 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.TensorDescription 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.TensorDescription} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorDescription) - org.tensorflow.proto.framework.TensorDescriptionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorDescription.class, org.tensorflow.proto.framework.TensorDescription.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorDescription.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(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - if (allocationDescriptionBuilder_ == null) { - allocationDescription_ = null; - } else { - allocationDescription_ = null; - allocationDescriptionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorDescription getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorDescription.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorDescription build() { - org.tensorflow.proto.framework.TensorDescription result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorDescription buildPartial() { - org.tensorflow.proto.framework.TensorDescription result = new org.tensorflow.proto.framework.TensorDescription(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - if (allocationDescriptionBuilder_ == null) { - result.allocationDescription_ = allocationDescription_; - } else { - result.allocationDescription_ = allocationDescriptionBuilder_.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.TensorDescription) { - return mergeFrom((org.tensorflow.proto.framework.TensorDescription)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorDescription other) { - if (other == org.tensorflow.proto.framework.TensorDescription.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.hasAllocationDescription()) { - mergeAllocationDescription(other.getAllocationDescription()); - } - 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.TensorDescription parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorDescription) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - *
    -     * Data type of tensor elements
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -     * Data type of tensor elements
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - *
    -     * Data type of tensor elements
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - *
    -     * Data type of tensor elements
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Data type of tensor elements
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - *
    -     * Shape of the tensor.
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private org.tensorflow.proto.framework.AllocationDescription allocationDescription_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder> allocationDescriptionBuilder_; - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public boolean hasAllocationDescription() { - return allocationDescriptionBuilder_ != null || allocationDescription_ != null; - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public org.tensorflow.proto.framework.AllocationDescription getAllocationDescription() { - if (allocationDescriptionBuilder_ == null) { - return allocationDescription_ == null ? org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance() : allocationDescription_; - } else { - return allocationDescriptionBuilder_.getMessage(); - } - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public Builder setAllocationDescription(org.tensorflow.proto.framework.AllocationDescription value) { - if (allocationDescriptionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - allocationDescription_ = value; - onChanged(); - } else { - allocationDescriptionBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public Builder setAllocationDescription( - org.tensorflow.proto.framework.AllocationDescription.Builder builderForValue) { - if (allocationDescriptionBuilder_ == null) { - allocationDescription_ = builderForValue.build(); - onChanged(); - } else { - allocationDescriptionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public Builder mergeAllocationDescription(org.tensorflow.proto.framework.AllocationDescription value) { - if (allocationDescriptionBuilder_ == null) { - if (allocationDescription_ != null) { - allocationDescription_ = - org.tensorflow.proto.framework.AllocationDescription.newBuilder(allocationDescription_).mergeFrom(value).buildPartial(); - } else { - allocationDescription_ = value; - } - onChanged(); - } else { - allocationDescriptionBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public Builder clearAllocationDescription() { - if (allocationDescriptionBuilder_ == null) { - allocationDescription_ = null; - onChanged(); - } else { - allocationDescription_ = null; - allocationDescriptionBuilder_ = null; - } - - return this; - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public org.tensorflow.proto.framework.AllocationDescription.Builder getAllocationDescriptionBuilder() { - - onChanged(); - return getAllocationDescriptionFieldBuilder().getBuilder(); - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - public org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder() { - if (allocationDescriptionBuilder_ != null) { - return allocationDescriptionBuilder_.getMessageOrBuilder(); - } else { - return allocationDescription_ == null ? - org.tensorflow.proto.framework.AllocationDescription.getDefaultInstance() : allocationDescription_; - } - } - /** - *
    -     * Information about the size and allocator used for the data
    -     * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder> - getAllocationDescriptionFieldBuilder() { - if (allocationDescriptionBuilder_ == null) { - allocationDescriptionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.AllocationDescription, org.tensorflow.proto.framework.AllocationDescription.Builder, org.tensorflow.proto.framework.AllocationDescriptionOrBuilder>( - getAllocationDescription(), - getParentForChildren(), - isClean()); - allocationDescription_ = null; - } - return allocationDescriptionBuilder_; - } - @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.TensorDescription) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorDescription) - private static final org.tensorflow.proto.framework.TensorDescription DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorDescription(); - } - - public static org.tensorflow.proto.framework.TensorDescription getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorDescription parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorDescription(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.TensorDescription getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionOrBuilder.java deleted file mode 100644 index e10f0e90d6b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionOrBuilder.java +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_description.proto - -package org.tensorflow.proto.framework; - -public interface TensorDescriptionOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorDescription) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Data type of tensor elements
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - *
    -   * Data type of tensor elements
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - *
    -   * Shape of the tensor.
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - boolean hasAllocationDescription(); - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - org.tensorflow.proto.framework.AllocationDescription getAllocationDescription(); - /** - *
    -   * Information about the size and allocator used for the data
    -   * 
    - * - * .tensorflow.AllocationDescription allocation_description = 4; - */ - org.tensorflow.proto.framework.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionProtos.java deleted file mode 100644 index 840b3c4068d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorDescriptionProtos.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_description.proto - -package org.tensorflow.proto.framework; - -public final class TensorDescriptionProtos { - private TensorDescriptionProtos() {} - 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_TensorDescription_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorDescription_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n2tensorflow/core/framework/tensor_descr" + - "iption.proto\022\ntensorflow\0326tensorflow/cor" + - "e/framework/allocation_description.proto" + - "\032,tensorflow/core/framework/tensor_shape" + - ".proto\032%tensorflow/core/framework/types." + - "proto\"\250\001\n\021TensorDescription\022#\n\005dtype\030\001 \001" + - "(\0162\024.tensorflow.DataType\022+\n\005shape\030\002 \001(\0132" + - "\034.tensorflow.TensorShapeProto\022A\n\026allocat" + - "ion_description\030\004 \001(\0132!.tensorflow.Alloc" + - "ationDescriptionB\231\001\n\036org.tensorflow.prot" + - "o.frameworkB\027TensorDescriptionProtosP\001ZY" + - "github.com/tensorflow/tensorflow/tensorf" + - "low/go/core/framework/tensor_description" + - "_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AllocationDescriptionProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_TensorDescription_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorDescription_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorDescription_descriptor, - new java.lang.String[] { "Dtype", "Shape", "AllocationDescription", }); - org.tensorflow.proto.framework.AllocationDescriptionProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfo.java deleted file mode 100644 index 4e873da94be..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfo.java +++ /dev/null @@ -1,3680 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Information about a Tensor necessary for feeding or retrieval.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorInfo} - */ -public final class TensorInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo) - TensorInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorInfo.newBuilder() to construct. - private TensorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorInfo() { - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorInfo( - 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(); - encodingCase_ = 1; - encoding_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 26: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (tensorShape_ != null) { - subBuilder = tensorShape_.toBuilder(); - } - tensorShape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorShape_); - tensorShape_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder subBuilder = null; - if (encodingCase_ == 4) { - subBuilder = ((org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_).toBuilder(); - } - encoding_ = - input.readMessage(org.tensorflow.proto.framework.TensorInfo.CooSparse.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_); - encoding_ = subBuilder.buildPartial(); - } - encodingCase_ = 4; - break; - } - case 42: { - org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder subBuilder = null; - if (encodingCase_ == 5) { - subBuilder = ((org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_).toBuilder(); - } - encoding_ = - input.readMessage(org.tensorflow.proto.framework.TensorInfo.CompositeTensor.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_); - encoding_ = subBuilder.buildPartial(); - } - encodingCase_ = 5; - 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.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.class, org.tensorflow.proto.framework.TensorInfo.Builder.class); - } - - public interface CooSparseOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo.CooSparse) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -     * 
    - * - * string values_tensor_name = 1; - */ - java.lang.String getValuesTensorName(); - /** - *
    -     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -     * 
    - * - * string values_tensor_name = 1; - */ - com.google.protobuf.ByteString - getValuesTensorNameBytes(); - - /** - *
    -     * The indices Tensor must have dtype int64 and shape [?, ?].
    -     * 
    - * - * string indices_tensor_name = 2; - */ - java.lang.String getIndicesTensorName(); - /** - *
    -     * The indices Tensor must have dtype int64 and shape [?, ?].
    -     * 
    - * - * string indices_tensor_name = 2; - */ - com.google.protobuf.ByteString - getIndicesTensorNameBytes(); - - /** - *
    -     * The dynamic logical shape represented by the SparseTensor is recorded in
    -     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -     * 
    - * - * string dense_shape_tensor_name = 3; - */ - java.lang.String getDenseShapeTensorName(); - /** - *
    -     * The dynamic logical shape represented by the SparseTensor is recorded in
    -     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -     * 
    - * - * string dense_shape_tensor_name = 3; - */ - com.google.protobuf.ByteString - getDenseShapeTensorNameBytes(); - } - /** - *
    -   * For sparse tensors, The COO encoding stores a triple of values, indices,
    -   * and shape.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorInfo.CooSparse} - */ - public static final class CooSparse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo.CooSparse) - CooSparseOrBuilder { - private static final long serialVersionUID = 0L; - // Use CooSparse.newBuilder() to construct. - private CooSparse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CooSparse() { - valuesTensorName_ = ""; - indicesTensorName_ = ""; - denseShapeTensorName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CooSparse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CooSparse( - 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(); - - valuesTensorName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - indicesTensorName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - denseShapeTensorName_ = s; - 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.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.CooSparse.class, org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder.class); - } - - public static final int VALUES_TENSOR_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object valuesTensorName_; - /** - *
    -     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -     * 
    - * - * string values_tensor_name = 1; - */ - public java.lang.String getValuesTensorName() { - java.lang.Object ref = valuesTensorName_; - 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(); - valuesTensorName_ = s; - return s; - } - } - /** - *
    -     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -     * 
    - * - * string values_tensor_name = 1; - */ - public com.google.protobuf.ByteString - getValuesTensorNameBytes() { - java.lang.Object ref = valuesTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INDICES_TENSOR_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object indicesTensorName_; - /** - *
    -     * The indices Tensor must have dtype int64 and shape [?, ?].
    -     * 
    - * - * string indices_tensor_name = 2; - */ - public java.lang.String getIndicesTensorName() { - java.lang.Object ref = indicesTensorName_; - 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(); - indicesTensorName_ = s; - return s; - } - } - /** - *
    -     * The indices Tensor must have dtype int64 and shape [?, ?].
    -     * 
    - * - * string indices_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getIndicesTensorNameBytes() { - java.lang.Object ref = indicesTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - indicesTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object denseShapeTensorName_; - /** - *
    -     * The dynamic logical shape represented by the SparseTensor is recorded in
    -     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -     * 
    - * - * string dense_shape_tensor_name = 3; - */ - public java.lang.String getDenseShapeTensorName() { - java.lang.Object ref = denseShapeTensorName_; - 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(); - denseShapeTensorName_ = s; - return s; - } - } - /** - *
    -     * The dynamic logical shape represented by the SparseTensor is recorded in
    -     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -     * 
    - * - * string dense_shape_tensor_name = 3; - */ - public com.google.protobuf.ByteString - getDenseShapeTensorNameBytes() { - java.lang.Object ref = denseShapeTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - denseShapeTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getValuesTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, valuesTensorName_); - } - if (!getIndicesTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, indicesTensorName_); - } - if (!getDenseShapeTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, denseShapeTensorName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getValuesTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, valuesTensorName_); - } - if (!getIndicesTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, indicesTensorName_); - } - if (!getDenseShapeTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, denseShapeTensorName_); - } - 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.TensorInfo.CooSparse)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorInfo.CooSparse other = (org.tensorflow.proto.framework.TensorInfo.CooSparse) obj; - - if (!getValuesTensorName() - .equals(other.getValuesTensorName())) return false; - if (!getIndicesTensorName() - .equals(other.getIndicesTensorName())) return false; - if (!getDenseShapeTensorName() - .equals(other.getDenseShapeTensorName())) 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) + VALUES_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getValuesTensorName().hashCode(); - hash = (37 * hash) + INDICES_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getIndicesTensorName().hashCode(); - hash = (37 * hash) + DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDenseShapeTensorName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorInfo.CooSparse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CooSparse 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.TensorInfo.CooSparse 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; - } - /** - *
    -     * For sparse tensors, The COO encoding stores a triple of values, indices,
    -     * and shape.
    -     * 
    - * - * Protobuf type {@code tensorflow.TensorInfo.CooSparse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo.CooSparse) - org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.CooSparse.class, org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorInfo.CooSparse.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(); - valuesTensorName_ = ""; - - indicesTensorName_ = ""; - - denseShapeTensorName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CooSparse getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CooSparse build() { - org.tensorflow.proto.framework.TensorInfo.CooSparse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CooSparse buildPartial() { - org.tensorflow.proto.framework.TensorInfo.CooSparse result = new org.tensorflow.proto.framework.TensorInfo.CooSparse(this); - result.valuesTensorName_ = valuesTensorName_; - result.indicesTensorName_ = indicesTensorName_; - result.denseShapeTensorName_ = denseShapeTensorName_; - 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.TensorInfo.CooSparse) { - return mergeFrom((org.tensorflow.proto.framework.TensorInfo.CooSparse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorInfo.CooSparse other) { - if (other == org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance()) return this; - if (!other.getValuesTensorName().isEmpty()) { - valuesTensorName_ = other.valuesTensorName_; - onChanged(); - } - if (!other.getIndicesTensorName().isEmpty()) { - indicesTensorName_ = other.indicesTensorName_; - onChanged(); - } - if (!other.getDenseShapeTensorName().isEmpty()) { - denseShapeTensorName_ = other.denseShapeTensorName_; - onChanged(); - } - 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.TensorInfo.CooSparse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorInfo.CooSparse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object valuesTensorName_ = ""; - /** - *
    -       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -       * 
    - * - * string values_tensor_name = 1; - */ - public java.lang.String getValuesTensorName() { - java.lang.Object ref = valuesTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - valuesTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -       * 
    - * - * string values_tensor_name = 1; - */ - public com.google.protobuf.ByteString - getValuesTensorNameBytes() { - java.lang.Object ref = valuesTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - valuesTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -       * 
    - * - * string values_tensor_name = 1; - */ - public Builder setValuesTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - valuesTensorName_ = value; - onChanged(); - return this; - } - /** - *
    -       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -       * 
    - * - * string values_tensor_name = 1; - */ - public Builder clearValuesTensorName() { - - valuesTensorName_ = getDefaultInstance().getValuesTensorName(); - onChanged(); - return this; - } - /** - *
    -       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    -       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    -       * 
    - * - * string values_tensor_name = 1; - */ - public Builder setValuesTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - valuesTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object indicesTensorName_ = ""; - /** - *
    -       * The indices Tensor must have dtype int64 and shape [?, ?].
    -       * 
    - * - * string indices_tensor_name = 2; - */ - public java.lang.String getIndicesTensorName() { - java.lang.Object ref = indicesTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - indicesTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The indices Tensor must have dtype int64 and shape [?, ?].
    -       * 
    - * - * string indices_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getIndicesTensorNameBytes() { - java.lang.Object ref = indicesTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - indicesTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The indices Tensor must have dtype int64 and shape [?, ?].
    -       * 
    - * - * string indices_tensor_name = 2; - */ - public Builder setIndicesTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - indicesTensorName_ = value; - onChanged(); - return this; - } - /** - *
    -       * The indices Tensor must have dtype int64 and shape [?, ?].
    -       * 
    - * - * string indices_tensor_name = 2; - */ - public Builder clearIndicesTensorName() { - - indicesTensorName_ = getDefaultInstance().getIndicesTensorName(); - onChanged(); - return this; - } - /** - *
    -       * The indices Tensor must have dtype int64 and shape [?, ?].
    -       * 
    - * - * string indices_tensor_name = 2; - */ - public Builder setIndicesTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - indicesTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object denseShapeTensorName_ = ""; - /** - *
    -       * The dynamic logical shape represented by the SparseTensor is recorded in
    -       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -       * 
    - * - * string dense_shape_tensor_name = 3; - */ - public java.lang.String getDenseShapeTensorName() { - java.lang.Object ref = denseShapeTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - denseShapeTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -       * The dynamic logical shape represented by the SparseTensor is recorded in
    -       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -       * 
    - * - * string dense_shape_tensor_name = 3; - */ - public com.google.protobuf.ByteString - getDenseShapeTensorNameBytes() { - java.lang.Object ref = denseShapeTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - denseShapeTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -       * The dynamic logical shape represented by the SparseTensor is recorded in
    -       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -       * 
    - * - * string dense_shape_tensor_name = 3; - */ - public Builder setDenseShapeTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - denseShapeTensorName_ = value; - onChanged(); - return this; - } - /** - *
    -       * The dynamic logical shape represented by the SparseTensor is recorded in
    -       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -       * 
    - * - * string dense_shape_tensor_name = 3; - */ - public Builder clearDenseShapeTensorName() { - - denseShapeTensorName_ = getDefaultInstance().getDenseShapeTensorName(); - onChanged(); - return this; - } - /** - *
    -       * The dynamic logical shape represented by the SparseTensor is recorded in
    -       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    -       * 
    - * - * string dense_shape_tensor_name = 3; - */ - public Builder setDenseShapeTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - denseShapeTensorName_ = value; - 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.TensorInfo.CooSparse) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo.CooSparse) - private static final org.tensorflow.proto.framework.TensorInfo.CooSparse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorInfo.CooSparse(); - } - - public static org.tensorflow.proto.framework.TensorInfo.CooSparse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CooSparse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CooSparse(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.TensorInfo.CooSparse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface CompositeTensorOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo.CompositeTensor) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - boolean hasTypeSpec(); - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - org.tensorflow.proto.framework.TypeSpecProto getTypeSpec(); - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecOrBuilder(); - - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - java.util.List - getComponentsList(); - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - org.tensorflow.proto.framework.TensorInfo getComponents(int index); - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - int getComponentsCount(); - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - java.util.List - getComponentsOrBuilderList(); - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - org.tensorflow.proto.framework.TensorInfoOrBuilder getComponentsOrBuilder( - int index); - } - /** - *
    -   * Generic encoding for composite tensors.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorInfo.CompositeTensor} - */ - public static final class CompositeTensor extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo.CompositeTensor) - CompositeTensorOrBuilder { - private static final long serialVersionUID = 0L; - // Use CompositeTensor.newBuilder() to construct. - private CompositeTensor(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CompositeTensor() { - components_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CompositeTensor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CompositeTensor( - 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.framework.TypeSpecProto.Builder subBuilder = null; - if (typeSpec_ != null) { - subBuilder = typeSpec_.toBuilder(); - } - typeSpec_ = input.readMessage(org.tensorflow.proto.framework.TypeSpecProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeSpec_); - typeSpec_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - components_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - components_.add( - input.readMessage(org.tensorflow.proto.framework.TensorInfo.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_ & 0x00000001) != 0)) { - components_ = java.util.Collections.unmodifiableList(components_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.CompositeTensor.class, org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder.class); - } - - public static final int TYPE_SPEC_FIELD_NUMBER = 1; - private org.tensorflow.proto.framework.TypeSpecProto typeSpec_; - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public boolean hasTypeSpec() { - return typeSpec_ != null; - } - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpec() { - return typeSpec_ == null ? org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpec_; - } - /** - *
    -     * The serialized TypeSpec for the composite tensor.
    -     * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecOrBuilder() { - return getTypeSpec(); - } - - public static final int COMPONENTS_FIELD_NUMBER = 2; - private java.util.List components_; - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public java.util.List getComponentsList() { - return components_; - } - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public java.util.List - getComponentsOrBuilderList() { - return components_; - } - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public int getComponentsCount() { - return components_.size(); - } - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfo getComponents(int index) { - return components_.get(index); - } - /** - *
    -     * A TensorInfo for each flattened component tensor.
    -     * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfoOrBuilder getComponentsOrBuilder( - int index) { - return components_.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 { - if (typeSpec_ != null) { - output.writeMessage(1, getTypeSpec()); - } - for (int i = 0; i < components_.size(); i++) { - output.writeMessage(2, components_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeSpec_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTypeSpec()); - } - for (int i = 0; i < components_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, components_.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.TensorInfo.CompositeTensor)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorInfo.CompositeTensor other = (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) obj; - - if (hasTypeSpec() != other.hasTypeSpec()) return false; - if (hasTypeSpec()) { - if (!getTypeSpec() - .equals(other.getTypeSpec())) return false; - } - if (!getComponentsList() - .equals(other.getComponentsList())) 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 (hasTypeSpec()) { - hash = (37 * hash) + TYPE_SPEC_FIELD_NUMBER; - hash = (53 * hash) + getTypeSpec().hashCode(); - } - if (getComponentsCount() > 0) { - hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; - hash = (53 * hash) + getComponentsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor 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; - } - /** - *
    -     * Generic encoding for composite tensors.
    -     * 
    - * - * Protobuf type {@code tensorflow.TensorInfo.CompositeTensor} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo.CompositeTensor) - org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.CompositeTensor.class, org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorInfo.CompositeTensor.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getComponentsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (typeSpecBuilder_ == null) { - typeSpec_ = null; - } else { - typeSpec_ = null; - typeSpecBuilder_ = null; - } - if (componentsBuilder_ == null) { - components_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - componentsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor build() { - org.tensorflow.proto.framework.TensorInfo.CompositeTensor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor buildPartial() { - org.tensorflow.proto.framework.TensorInfo.CompositeTensor result = new org.tensorflow.proto.framework.TensorInfo.CompositeTensor(this); - int from_bitField0_ = bitField0_; - if (typeSpecBuilder_ == null) { - result.typeSpec_ = typeSpec_; - } else { - result.typeSpec_ = typeSpecBuilder_.build(); - } - if (componentsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - components_ = java.util.Collections.unmodifiableList(components_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.components_ = components_; - } else { - result.components_ = componentsBuilder_.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.TensorInfo.CompositeTensor) { - return mergeFrom((org.tensorflow.proto.framework.TensorInfo.CompositeTensor)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorInfo.CompositeTensor other) { - if (other == org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance()) return this; - if (other.hasTypeSpec()) { - mergeTypeSpec(other.getTypeSpec()); - } - if (componentsBuilder_ == null) { - if (!other.components_.isEmpty()) { - if (components_.isEmpty()) { - components_ = other.components_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureComponentsIsMutable(); - components_.addAll(other.components_); - } - onChanged(); - } - } else { - if (!other.components_.isEmpty()) { - if (componentsBuilder_.isEmpty()) { - componentsBuilder_.dispose(); - componentsBuilder_ = null; - components_ = other.components_; - bitField0_ = (bitField0_ & ~0x00000001); - componentsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getComponentsFieldBuilder() : null; - } else { - componentsBuilder_.addAllMessages(other.components_); - } - } - } - 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.TensorInfo.CompositeTensor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private org.tensorflow.proto.framework.TypeSpecProto typeSpec_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> typeSpecBuilder_; - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public boolean hasTypeSpec() { - return typeSpecBuilder_ != null || typeSpec_ != null; - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto getTypeSpec() { - if (typeSpecBuilder_ == null) { - return typeSpec_ == null ? org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpec_; - } else { - return typeSpecBuilder_.getMessage(); - } - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public Builder setTypeSpec(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - typeSpec_ = value; - onChanged(); - } else { - typeSpecBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public Builder setTypeSpec( - org.tensorflow.proto.framework.TypeSpecProto.Builder builderForValue) { - if (typeSpecBuilder_ == null) { - typeSpec_ = builderForValue.build(); - onChanged(); - } else { - typeSpecBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public Builder mergeTypeSpec(org.tensorflow.proto.framework.TypeSpecProto value) { - if (typeSpecBuilder_ == null) { - if (typeSpec_ != null) { - typeSpec_ = - org.tensorflow.proto.framework.TypeSpecProto.newBuilder(typeSpec_).mergeFrom(value).buildPartial(); - } else { - typeSpec_ = value; - } - onChanged(); - } else { - typeSpecBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public Builder clearTypeSpec() { - if (typeSpecBuilder_ == null) { - typeSpec_ = null; - onChanged(); - } else { - typeSpec_ = null; - typeSpecBuilder_ = null; - } - - return this; - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto.Builder getTypeSpecBuilder() { - - onChanged(); - return getTypeSpecFieldBuilder().getBuilder(); - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProtoOrBuilder getTypeSpecOrBuilder() { - if (typeSpecBuilder_ != null) { - return typeSpecBuilder_.getMessageOrBuilder(); - } else { - return typeSpec_ == null ? - org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance() : typeSpec_; - } - } - /** - *
    -       * The serialized TypeSpec for the composite tensor.
    -       * 
    - * - * .tensorflow.TypeSpecProto type_spec = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder> - getTypeSpecFieldBuilder() { - if (typeSpecBuilder_ == null) { - typeSpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TypeSpecProto, org.tensorflow.proto.framework.TypeSpecProto.Builder, org.tensorflow.proto.framework.TypeSpecProtoOrBuilder>( - getTypeSpec(), - getParentForChildren(), - isClean()); - typeSpec_ = null; - } - return typeSpecBuilder_; - } - - private java.util.List components_ = - java.util.Collections.emptyList(); - private void ensureComponentsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - components_ = new java.util.ArrayList(components_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder> componentsBuilder_; - - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public java.util.List getComponentsList() { - if (componentsBuilder_ == null) { - return java.util.Collections.unmodifiableList(components_); - } else { - return componentsBuilder_.getMessageList(); - } - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public int getComponentsCount() { - if (componentsBuilder_ == null) { - return components_.size(); - } else { - return componentsBuilder_.getCount(); - } - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfo getComponents(int index) { - if (componentsBuilder_ == null) { - return components_.get(index); - } else { - return componentsBuilder_.getMessage(index); - } - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder setComponents( - int index, org.tensorflow.proto.framework.TensorInfo value) { - if (componentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureComponentsIsMutable(); - components_.set(index, value); - onChanged(); - } else { - componentsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder setComponents( - int index, org.tensorflow.proto.framework.TensorInfo.Builder builderForValue) { - if (componentsBuilder_ == null) { - ensureComponentsIsMutable(); - components_.set(index, builderForValue.build()); - onChanged(); - } else { - componentsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder addComponents(org.tensorflow.proto.framework.TensorInfo value) { - if (componentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureComponentsIsMutable(); - components_.add(value); - onChanged(); - } else { - componentsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder addComponents( - int index, org.tensorflow.proto.framework.TensorInfo value) { - if (componentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureComponentsIsMutable(); - components_.add(index, value); - onChanged(); - } else { - componentsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder addComponents( - org.tensorflow.proto.framework.TensorInfo.Builder builderForValue) { - if (componentsBuilder_ == null) { - ensureComponentsIsMutable(); - components_.add(builderForValue.build()); - onChanged(); - } else { - componentsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder addComponents( - int index, org.tensorflow.proto.framework.TensorInfo.Builder builderForValue) { - if (componentsBuilder_ == null) { - ensureComponentsIsMutable(); - components_.add(index, builderForValue.build()); - onChanged(); - } else { - componentsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder addAllComponents( - java.lang.Iterable values) { - if (componentsBuilder_ == null) { - ensureComponentsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, components_); - onChanged(); - } else { - componentsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder clearComponents() { - if (componentsBuilder_ == null) { - components_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - componentsBuilder_.clear(); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public Builder removeComponents(int index) { - if (componentsBuilder_ == null) { - ensureComponentsIsMutable(); - components_.remove(index); - onChanged(); - } else { - componentsBuilder_.remove(index); - } - return this; - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfo.Builder getComponentsBuilder( - int index) { - return getComponentsFieldBuilder().getBuilder(index); - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfoOrBuilder getComponentsOrBuilder( - int index) { - if (componentsBuilder_ == null) { - return components_.get(index); } else { - return componentsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public java.util.List - getComponentsOrBuilderList() { - if (componentsBuilder_ != null) { - return componentsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(components_); - } - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfo.Builder addComponentsBuilder() { - return getComponentsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorInfo.getDefaultInstance()); - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public org.tensorflow.proto.framework.TensorInfo.Builder addComponentsBuilder( - int index) { - return getComponentsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorInfo.getDefaultInstance()); - } - /** - *
    -       * A TensorInfo for each flattened component tensor.
    -       * 
    - * - * repeated .tensorflow.TensorInfo components = 2; - */ - public java.util.List - getComponentsBuilderList() { - return getComponentsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder> - getComponentsFieldBuilder() { - if (componentsBuilder_ == null) { - componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo, org.tensorflow.proto.framework.TensorInfo.Builder, org.tensorflow.proto.framework.TensorInfoOrBuilder>( - components_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - components_ = null; - } - return componentsBuilder_; - } - @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.TensorInfo.CompositeTensor) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo.CompositeTensor) - private static final org.tensorflow.proto.framework.TensorInfo.CompositeTensor DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorInfo.CompositeTensor(); - } - - public static org.tensorflow.proto.framework.TensorInfo.CompositeTensor getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CompositeTensor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CompositeTensor(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.TensorInfo.CompositeTensor getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int encodingCase_ = 0; - private java.lang.Object encoding_; - public enum EncodingCase - implements com.google.protobuf.Internal.EnumLite { - NAME(1), - COO_SPARSE(4), - COMPOSITE_TENSOR(5), - ENCODING_NOT_SET(0); - private final int value; - private EncodingCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static EncodingCase valueOf(int value) { - return forNumber(value); - } - - public static EncodingCase forNumber(int value) { - switch (value) { - case 1: return NAME; - case 4: return COO_SPARSE; - case 5: return COMPOSITE_TENSOR; - case 0: return ENCODING_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public EncodingCase - getEncodingCase() { - return EncodingCase.forNumber( - encodingCase_); - } - - public static final int NAME_FIELD_NUMBER = 1; - /** - *
    -   * For dense `Tensor`s, the name of the tensor in the graph.
    -   * 
    - * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = ""; - if (encodingCase_ == 1) { - ref = encoding_; - } - 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(); - if (encodingCase_ == 1) { - encoding_ = s; - } - return s; - } - } - /** - *
    -   * For dense `Tensor`s, the name of the tensor in the graph.
    -   * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = ""; - if (encodingCase_ == 1) { - ref = encoding_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (encodingCase_ == 1) { - encoding_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COO_SPARSE_FIELD_NUMBER = 4; - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public boolean hasCooSparse() { - return encodingCase_ == 4; - } - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public org.tensorflow.proto.framework.TensorInfo.CooSparse getCooSparse() { - if (encodingCase_ == 4) { - return (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder() { - if (encodingCase_ == 4) { - return (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - - public static final int COMPOSITE_TENSOR_FIELD_NUMBER = 5; - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public boolean hasCompositeTensor() { - return encodingCase_ == 5; - } - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor getCompositeTensor() { - if (encodingCase_ == 5) { - return (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder() { - if (encodingCase_ == 5) { - return (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - - public static final int DTYPE_FIELD_NUMBER = 2; - private int dtype_; - /** - * .tensorflow.DataType dtype = 2; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 2; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int TENSOR_SHAPE_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public boolean hasTensorShape() { - return tensorShape_ != null; - } - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - return getTensorShape(); - } - - 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 (encodingCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encoding_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(2, dtype_); - } - if (tensorShape_ != null) { - output.writeMessage(3, getTensorShape()); - } - if (encodingCase_ == 4) { - output.writeMessage(4, (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_); - } - if (encodingCase_ == 5) { - output.writeMessage(5, (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encodingCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encoding_); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, dtype_); - } - if (tensorShape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTensorShape()); - } - if (encodingCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_); - } - if (encodingCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_); - } - 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.TensorInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorInfo other = (org.tensorflow.proto.framework.TensorInfo) obj; - - if (dtype_ != other.dtype_) return false; - if (hasTensorShape() != other.hasTensorShape()) return false; - if (hasTensorShape()) { - if (!getTensorShape() - .equals(other.getTensorShape())) return false; - } - if (!getEncodingCase().equals(other.getEncodingCase())) return false; - switch (encodingCase_) { - case 1: - if (!getName() - .equals(other.getName())) return false; - break; - case 4: - if (!getCooSparse() - .equals(other.getCooSparse())) return false; - break; - case 5: - if (!getCompositeTensor() - .equals(other.getCompositeTensor())) return false; - break; - case 0: - default: - } - 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasTensorShape()) { - hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getTensorShape().hashCode(); - } - switch (encodingCase_) { - case 1: - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - break; - case 4: - hash = (37 * hash) + COO_SPARSE_FIELD_NUMBER; - hash = (53 * hash) + getCooSparse().hashCode(); - break; - case 5: - hash = (37 * hash) + COMPOSITE_TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getCompositeTensor().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo 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.TensorInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo 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.TensorInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo 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.TensorInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo 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.TensorInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorInfo 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.TensorInfo 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; - } - /** - *
    -   * Information about a Tensor necessary for feeding or retrieval.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo) - org.tensorflow.proto.framework.TensorInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorInfo.class, org.tensorflow.proto.framework.TensorInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorInfo.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(); - dtype_ = 0; - - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - encodingCase_ = 0; - encoding_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo build() { - org.tensorflow.proto.framework.TensorInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorInfo buildPartial() { - org.tensorflow.proto.framework.TensorInfo result = new org.tensorflow.proto.framework.TensorInfo(this); - if (encodingCase_ == 1) { - result.encoding_ = encoding_; - } - if (encodingCase_ == 4) { - if (cooSparseBuilder_ == null) { - result.encoding_ = encoding_; - } else { - result.encoding_ = cooSparseBuilder_.build(); - } - } - if (encodingCase_ == 5) { - if (compositeTensorBuilder_ == null) { - result.encoding_ = encoding_; - } else { - result.encoding_ = compositeTensorBuilder_.build(); - } - } - result.dtype_ = dtype_; - if (tensorShapeBuilder_ == null) { - result.tensorShape_ = tensorShape_; - } else { - result.tensorShape_ = tensorShapeBuilder_.build(); - } - result.encodingCase_ = encodingCase_; - 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.TensorInfo) { - return mergeFrom((org.tensorflow.proto.framework.TensorInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorInfo other) { - if (other == org.tensorflow.proto.framework.TensorInfo.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasTensorShape()) { - mergeTensorShape(other.getTensorShape()); - } - switch (other.getEncodingCase()) { - case NAME: { - encodingCase_ = 1; - encoding_ = other.encoding_; - onChanged(); - break; - } - case COO_SPARSE: { - mergeCooSparse(other.getCooSparse()); - break; - } - case COMPOSITE_TENSOR: { - mergeCompositeTensor(other.getCompositeTensor()); - break; - } - case ENCODING_NOT_SET: { - break; - } - } - 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.TensorInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int encodingCase_ = 0; - private java.lang.Object encoding_; - public EncodingCase - getEncodingCase() { - return EncodingCase.forNumber( - encodingCase_); - } - - public Builder clearEncoding() { - encodingCase_ = 0; - encoding_ = null; - onChanged(); - return this; - } - - - /** - *
    -     * For dense `Tensor`s, the name of the tensor in the graph.
    -     * 
    - * - * string name = 1; - */ - public java.lang.String getName() { - java.lang.Object ref = ""; - if (encodingCase_ == 1) { - ref = encoding_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (encodingCase_ == 1) { - encoding_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * For dense `Tensor`s, the name of the tensor in the graph.
    -     * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = ""; - if (encodingCase_ == 1) { - ref = encoding_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (encodingCase_ == 1) { - encoding_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * For dense `Tensor`s, the name of the tensor in the graph.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - encodingCase_ = 1; - encoding_ = value; - onChanged(); - return this; - } - /** - *
    -     * For dense `Tensor`s, the name of the tensor in the graph.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - if (encodingCase_ == 1) { - encodingCase_ = 0; - encoding_ = null; - onChanged(); - } - return this; - } - /** - *
    -     * For dense `Tensor`s, the name of the tensor in the graph.
    -     * 
    - * - * string name = 1; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - encodingCase_ = 1; - encoding_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CooSparse, org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder, org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder> cooSparseBuilder_; - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public boolean hasCooSparse() { - return encodingCase_ == 4; - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public org.tensorflow.proto.framework.TensorInfo.CooSparse getCooSparse() { - if (cooSparseBuilder_ == null) { - if (encodingCase_ == 4) { - return (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } else { - if (encodingCase_ == 4) { - return cooSparseBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public Builder setCooSparse(org.tensorflow.proto.framework.TensorInfo.CooSparse value) { - if (cooSparseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - encoding_ = value; - onChanged(); - } else { - cooSparseBuilder_.setMessage(value); - } - encodingCase_ = 4; - return this; - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public Builder setCooSparse( - org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder builderForValue) { - if (cooSparseBuilder_ == null) { - encoding_ = builderForValue.build(); - onChanged(); - } else { - cooSparseBuilder_.setMessage(builderForValue.build()); - } - encodingCase_ = 4; - return this; - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public Builder mergeCooSparse(org.tensorflow.proto.framework.TensorInfo.CooSparse value) { - if (cooSparseBuilder_ == null) { - if (encodingCase_ == 4 && - encoding_ != org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance()) { - encoding_ = org.tensorflow.proto.framework.TensorInfo.CooSparse.newBuilder((org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_) - .mergeFrom(value).buildPartial(); - } else { - encoding_ = value; - } - onChanged(); - } else { - if (encodingCase_ == 4) { - cooSparseBuilder_.mergeFrom(value); - } - cooSparseBuilder_.setMessage(value); - } - encodingCase_ = 4; - return this; - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public Builder clearCooSparse() { - if (cooSparseBuilder_ == null) { - if (encodingCase_ == 4) { - encodingCase_ = 0; - encoding_ = null; - onChanged(); - } - } else { - if (encodingCase_ == 4) { - encodingCase_ = 0; - encoding_ = null; - } - cooSparseBuilder_.clear(); - } - return this; - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder getCooSparseBuilder() { - return getCooSparseFieldBuilder().getBuilder(); - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - public org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder() { - if ((encodingCase_ == 4) && (cooSparseBuilder_ != null)) { - return cooSparseBuilder_.getMessageOrBuilder(); - } else { - if (encodingCase_ == 4) { - return (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - } - /** - *
    -     * There are many possible encodings of sparse matrices
    -     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -     * uses only the COO encoding.  This is supported and documented in the
    -     * SparseTensor Python class.
    -     * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CooSparse, org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder, org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder> - getCooSparseFieldBuilder() { - if (cooSparseBuilder_ == null) { - if (!(encodingCase_ == 4)) { - encoding_ = org.tensorflow.proto.framework.TensorInfo.CooSparse.getDefaultInstance(); - } - cooSparseBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CooSparse, org.tensorflow.proto.framework.TensorInfo.CooSparse.Builder, org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder>( - (org.tensorflow.proto.framework.TensorInfo.CooSparse) encoding_, - getParentForChildren(), - isClean()); - encoding_ = null; - } - encodingCase_ = 4; - onChanged();; - return cooSparseBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CompositeTensor, org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder> compositeTensorBuilder_; - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public boolean hasCompositeTensor() { - return encodingCase_ == 5; - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor getCompositeTensor() { - if (compositeTensorBuilder_ == null) { - if (encodingCase_ == 5) { - return (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } else { - if (encodingCase_ == 5) { - return compositeTensorBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public Builder setCompositeTensor(org.tensorflow.proto.framework.TensorInfo.CompositeTensor value) { - if (compositeTensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - encoding_ = value; - onChanged(); - } else { - compositeTensorBuilder_.setMessage(value); - } - encodingCase_ = 5; - return this; - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public Builder setCompositeTensor( - org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder builderForValue) { - if (compositeTensorBuilder_ == null) { - encoding_ = builderForValue.build(); - onChanged(); - } else { - compositeTensorBuilder_.setMessage(builderForValue.build()); - } - encodingCase_ = 5; - return this; - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public Builder mergeCompositeTensor(org.tensorflow.proto.framework.TensorInfo.CompositeTensor value) { - if (compositeTensorBuilder_ == null) { - if (encodingCase_ == 5 && - encoding_ != org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance()) { - encoding_ = org.tensorflow.proto.framework.TensorInfo.CompositeTensor.newBuilder((org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_) - .mergeFrom(value).buildPartial(); - } else { - encoding_ = value; - } - onChanged(); - } else { - if (encodingCase_ == 5) { - compositeTensorBuilder_.mergeFrom(value); - } - compositeTensorBuilder_.setMessage(value); - } - encodingCase_ = 5; - return this; - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public Builder clearCompositeTensor() { - if (compositeTensorBuilder_ == null) { - if (encodingCase_ == 5) { - encodingCase_ = 0; - encoding_ = null; - onChanged(); - } - } else { - if (encodingCase_ == 5) { - encodingCase_ = 0; - encoding_ = null; - } - compositeTensorBuilder_.clear(); - } - return this; - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder getCompositeTensorBuilder() { - return getCompositeTensorFieldBuilder().getBuilder(); - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - public org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder() { - if ((encodingCase_ == 5) && (compositeTensorBuilder_ != null)) { - return compositeTensorBuilder_.getMessageOrBuilder(); - } else { - if (encodingCase_ == 5) { - return (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_; - } - return org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - } - /** - *
    -     * Generic encoding for CompositeTensors.
    -     * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CompositeTensor, org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder> - getCompositeTensorFieldBuilder() { - if (compositeTensorBuilder_ == null) { - if (!(encodingCase_ == 5)) { - encoding_ = org.tensorflow.proto.framework.TensorInfo.CompositeTensor.getDefaultInstance(); - } - compositeTensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorInfo.CompositeTensor, org.tensorflow.proto.framework.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder>( - (org.tensorflow.proto.framework.TensorInfo.CompositeTensor) encoding_, - getParentForChildren(), - isClean()); - encoding_ = null; - } - encodingCase_ = 5; - onChanged();; - return compositeTensorBuilder_; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 2; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 2; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 2; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 2; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 2; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> tensorShapeBuilder_; - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public boolean hasTensorShape() { - return tensorShapeBuilder_ != null || tensorShape_ != null; - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - if (tensorShapeBuilder_ == null) { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } else { - return tensorShapeBuilder_.getMessage(); - } - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public Builder setTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorShape_ = value; - onChanged(); - } else { - tensorShapeBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public Builder setTensorShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (tensorShapeBuilder_ == null) { - tensorShape_ = builderForValue.build(); - onChanged(); - } else { - tensorShapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public Builder mergeTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (tensorShape_ != null) { - tensorShape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(tensorShape_).mergeFrom(value).buildPartial(); - } else { - tensorShape_ = value; - } - onChanged(); - } else { - tensorShapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public Builder clearTensorShape() { - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - onChanged(); - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - - return this; - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getTensorShapeBuilder() { - - onChanged(); - return getTensorShapeFieldBuilder().getBuilder(); - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - if (tensorShapeBuilder_ != null) { - return tensorShapeBuilder_.getMessageOrBuilder(); - } else { - return tensorShape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - } - /** - *
    -     * The static shape should be recorded here, to the extent that it can
    -     * be known in advance.  In the case of a SparseTensor, this field describes
    -     * the logical shape of the represented tensor (aka dense_shape).
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getTensorShapeFieldBuilder() { - if (tensorShapeBuilder_ == null) { - tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getTensorShape(), - getParentForChildren(), - isClean()); - tensorShape_ = null; - } - return tensorShapeBuilder_; - } - @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.TensorInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo) - private static final org.tensorflow.proto.framework.TensorInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorInfo(); - } - - public static org.tensorflow.proto.framework.TensorInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorInfo(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.TensorInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfoOrBuilder.java deleted file mode 100644 index d30570a1969..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorInfoOrBuilder.java +++ /dev/null @@ -1,128 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/meta_graph.proto - -package org.tensorflow.proto.framework; - -public interface TensorInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * For dense `Tensor`s, the name of the tensor in the graph.
    -   * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -   * For dense `Tensor`s, the name of the tensor in the graph.
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - boolean hasCooSparse(); - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - org.tensorflow.proto.framework.TensorInfo.CooSparse getCooSparse(); - /** - *
    -   * There are many possible encodings of sparse matrices
    -   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    -   * uses only the COO encoding.  This is supported and documented in the
    -   * SparseTensor Python class.
    -   * 
    - * - * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; - */ - org.tensorflow.proto.framework.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder(); - - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - boolean hasCompositeTensor(); - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - org.tensorflow.proto.framework.TensorInfo.CompositeTensor getCompositeTensor(); - /** - *
    -   * Generic encoding for CompositeTensors.
    -   * 
    - * - * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; - */ - org.tensorflow.proto.framework.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder(); - - /** - * .tensorflow.DataType dtype = 2; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 2; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - boolean hasTensorShape(); - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - org.tensorflow.proto.framework.TensorShapeProto getTensorShape(); - /** - *
    -   * The static shape should be recorded here, to the extent that it can
    -   * be known in advance.  In the case of a SparseTensor, this field describes
    -   * the logical shape of the represented tensor (aka dense_shape).
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 3; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); - - public org.tensorflow.proto.framework.TensorInfo.EncodingCase getEncodingCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProto.java deleted file mode 100644 index 97e7d1653f9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProto.java +++ /dev/null @@ -1,3980 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a tensor.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorProto} - */ -public final class TensorProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorProto) - TensorProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorProto.newBuilder() to construct. - private TensorProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorProto() { - dtype_ = 0; - tensorContent_ = com.google.protobuf.ByteString.EMPTY; - halfVal_ = emptyIntList(); - floatVal_ = emptyFloatList(); - doubleVal_ = emptyDoubleList(); - intVal_ = emptyIntList(); - stringVal_ = java.util.Collections.emptyList(); - scomplexVal_ = emptyFloatList(); - int64Val_ = emptyLongList(); - boolVal_ = emptyBooleanList(); - dcomplexVal_ = emptyDoubleList(); - resourceHandleVal_ = java.util.Collections.emptyList(); - variantVal_ = java.util.Collections.emptyList(); - uint32Val_ = emptyIntList(); - uint64Val_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorProto( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (tensorShape_ != null) { - subBuilder = tensorShape_.toBuilder(); - } - tensorShape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorShape_); - tensorShape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - versionNumber_ = input.readInt32(); - break; - } - case 34: { - - tensorContent_ = input.readBytes(); - break; - } - case 45: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - floatVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000002; - } - floatVal_.addFloat(input.readFloat()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - floatVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - floatVal_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 49: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - doubleVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000004; - } - doubleVal_.addDouble(input.readDouble()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - doubleVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - doubleVal_.addDouble(input.readDouble()); - } - input.popLimit(limit); - break; - } - case 56: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - intVal_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - intVal_.addInt(input.readInt32()); - break; - } - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) { - intVal_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - while (input.getBytesUntilLimit() > 0) { - intVal_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - stringVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - stringVal_.add(input.readBytes()); - break; - } - case 77: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - scomplexVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000020; - } - scomplexVal_.addFloat(input.readFloat()); - break; - } - case 74: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000020) != 0) && input.getBytesUntilLimit() > 0) { - scomplexVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000020; - } - while (input.getBytesUntilLimit() > 0) { - scomplexVal_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 80: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { - int64Val_ = newLongList(); - mutable_bitField0_ |= 0x00000040; - } - int64Val_.addLong(input.readInt64()); - break; - } - case 82: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000040) != 0) && input.getBytesUntilLimit() > 0) { - int64Val_ = newLongList(); - mutable_bitField0_ |= 0x00000040; - } - while (input.getBytesUntilLimit() > 0) { - int64Val_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 88: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { - boolVal_ = newBooleanList(); - mutable_bitField0_ |= 0x00000080; - } - boolVal_.addBoolean(input.readBool()); - break; - } - case 90: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000080) != 0) && input.getBytesUntilLimit() > 0) { - boolVal_ = newBooleanList(); - mutable_bitField0_ |= 0x00000080; - } - while (input.getBytesUntilLimit() > 0) { - boolVal_.addBoolean(input.readBool()); - } - input.popLimit(limit); - break; - } - case 97: { - if (!((mutable_bitField0_ & 0x00000100) != 0)) { - dcomplexVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000100; - } - dcomplexVal_.addDouble(input.readDouble()); - break; - } - case 98: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000100) != 0) && input.getBytesUntilLimit() > 0) { - dcomplexVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000100; - } - while (input.getBytesUntilLimit() > 0) { - dcomplexVal_.addDouble(input.readDouble()); - } - input.popLimit(limit); - break; - } - case 104: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - halfVal_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - halfVal_.addInt(input.readInt32()); - break; - } - case 106: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - halfVal_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - halfVal_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 114: { - if (!((mutable_bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000200; - } - resourceHandleVal_.add( - input.readMessage(org.tensorflow.proto.framework.ResourceHandleProto.parser(), extensionRegistry)); - break; - } - case 122: { - if (!((mutable_bitField0_ & 0x00000400) != 0)) { - variantVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - variantVal_.add( - input.readMessage(org.tensorflow.proto.framework.VariantTensorDataProto.parser(), extensionRegistry)); - break; - } - case 128: { - if (!((mutable_bitField0_ & 0x00000800) != 0)) { - uint32Val_ = newIntList(); - mutable_bitField0_ |= 0x00000800; - } - uint32Val_.addInt(input.readUInt32()); - break; - } - case 130: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000800) != 0) && input.getBytesUntilLimit() > 0) { - uint32Val_ = newIntList(); - mutable_bitField0_ |= 0x00000800; - } - while (input.getBytesUntilLimit() > 0) { - uint32Val_.addInt(input.readUInt32()); - } - input.popLimit(limit); - break; - } - case 136: { - if (!((mutable_bitField0_ & 0x00001000) != 0)) { - uint64Val_ = newLongList(); - mutable_bitField0_ |= 0x00001000; - } - uint64Val_.addLong(input.readUInt64()); - break; - } - case 138: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00001000) != 0) && input.getBytesUntilLimit() > 0) { - uint64Val_ = newLongList(); - mutable_bitField0_ |= 0x00001000; - } - while (input.getBytesUntilLimit() > 0) { - uint64Val_.addLong(input.readUInt64()); - } - input.popLimit(limit); - 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)) { - floatVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - doubleVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - intVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - stringVal_ = java.util.Collections.unmodifiableList(stringVal_); // C - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - scomplexVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000040) != 0)) { - int64Val_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000080) != 0)) { - boolVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000100) != 0)) { - dcomplexVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - halfVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = java.util.Collections.unmodifiableList(resourceHandleVal_); - } - if (((mutable_bitField0_ & 0x00000400) != 0)) { - variantVal_ = java.util.Collections.unmodifiableList(variantVal_); - } - if (((mutable_bitField0_ & 0x00000800) != 0)) { - uint32Val_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00001000) != 0)) { - uint64Val_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorProto.class, org.tensorflow.proto.framework.TensorProto.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShape_ != null; - } - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - return getTensorShape(); - } - - public static final int VERSION_NUMBER_FIELD_NUMBER = 3; - private int versionNumber_; - /** - *
    -   * Version number.
    -   * In version 0, if the "repeated xxx" representations contain only one
    -   * element, that element is repeated to fill the shape.  This makes it easy
    -   * to represent a constant Tensor with a single value.
    -   * 
    - * - * int32 version_number = 3; - */ - public int getVersionNumber() { - return versionNumber_; - } - - public static final int TENSOR_CONTENT_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString tensorContent_; - /** - *
    -   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -   * can be used for all tensor types. The purpose of this representation is to
    -   * reduce serialization overhead during RPC call by avoiding serialization of
    -   * many repeated small items.
    -   * 
    - * - * bytes tensor_content = 4; - */ - public com.google.protobuf.ByteString getTensorContent() { - return tensorContent_; - } - - public static final int HALF_VAL_FIELD_NUMBER = 13; - private com.google.protobuf.Internal.IntList halfVal_; - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public java.util.List - getHalfValList() { - return halfVal_; - } - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfValCount() { - return halfVal_.size(); - } - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfVal(int index) { - return halfVal_.getInt(index); - } - private int halfValMemoizedSerializedSize = -1; - - public static final int FLOAT_VAL_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.FloatList floatVal_; - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public java.util.List - getFloatValList() { - return floatVal_; - } - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public int getFloatValCount() { - return floatVal_.size(); - } - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public float getFloatVal(int index) { - return floatVal_.getFloat(index); - } - private int floatValMemoizedSerializedSize = -1; - - public static final int DOUBLE_VAL_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.DoubleList doubleVal_; - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public java.util.List - getDoubleValList() { - return doubleVal_; - } - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public int getDoubleValCount() { - return doubleVal_.size(); - } - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public double getDoubleVal(int index) { - return doubleVal_.getDouble(index); - } - private int doubleValMemoizedSerializedSize = -1; - - public static final int INT_VAL_FIELD_NUMBER = 7; - private com.google.protobuf.Internal.IntList intVal_; - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public java.util.List - getIntValList() { - return intVal_; - } - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntValCount() { - return intVal_.size(); - } - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntVal(int index) { - return intVal_.getInt(index); - } - private int intValMemoizedSerializedSize = -1; - - public static final int STRING_VAL_FIELD_NUMBER = 8; - private java.util.List stringVal_; - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public java.util.List - getStringValList() { - return stringVal_; - } - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public int getStringValCount() { - return stringVal_.size(); - } - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public com.google.protobuf.ByteString getStringVal(int index) { - return stringVal_.get(index); - } - - public static final int SCOMPLEX_VAL_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.FloatList scomplexVal_; - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public java.util.List - getScomplexValList() { - return scomplexVal_; - } - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public int getScomplexValCount() { - return scomplexVal_.size(); - } - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public float getScomplexVal(int index) { - return scomplexVal_.getFloat(index); - } - private int scomplexValMemoizedSerializedSize = -1; - - public static final int INT64_VAL_FIELD_NUMBER = 10; - private com.google.protobuf.Internal.LongList int64Val_; - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public java.util.List - getInt64ValList() { - return int64Val_; - } - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public int getInt64ValCount() { - return int64Val_.size(); - } - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public long getInt64Val(int index) { - return int64Val_.getLong(index); - } - private int int64ValMemoizedSerializedSize = -1; - - public static final int BOOL_VAL_FIELD_NUMBER = 11; - private com.google.protobuf.Internal.BooleanList boolVal_; - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public java.util.List - getBoolValList() { - return boolVal_; - } - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public int getBoolValCount() { - return boolVal_.size(); - } - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public boolean getBoolVal(int index) { - return boolVal_.getBoolean(index); - } - private int boolValMemoizedSerializedSize = -1; - - public static final int DCOMPLEX_VAL_FIELD_NUMBER = 12; - private com.google.protobuf.Internal.DoubleList dcomplexVal_; - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public java.util.List - getDcomplexValList() { - return dcomplexVal_; - } - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public int getDcomplexValCount() { - return dcomplexVal_.size(); - } - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public double getDcomplexVal(int index) { - return dcomplexVal_.getDouble(index); - } - private int dcomplexValMemoizedSerializedSize = -1; - - public static final int RESOURCE_HANDLE_VAL_FIELD_NUMBER = 14; - private java.util.List resourceHandleVal_; - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List getResourceHandleValList() { - return resourceHandleVal_; - } - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValOrBuilderList() { - return resourceHandleVal_; - } - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public int getResourceHandleValCount() { - return resourceHandleVal_.size(); - } - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProto getResourceHandleVal(int index) { - return resourceHandleVal_.get(index); - } - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index) { - return resourceHandleVal_.get(index); - } - - public static final int VARIANT_VAL_FIELD_NUMBER = 15; - private java.util.List variantVal_; - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List getVariantValList() { - return variantVal_; - } - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValOrBuilderList() { - return variantVal_; - } - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public int getVariantValCount() { - return variantVal_.size(); - } - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProto getVariantVal(int index) { - return variantVal_.get(index); - } - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index) { - return variantVal_.get(index); - } - - public static final int UINT32_VAL_FIELD_NUMBER = 16; - private com.google.protobuf.Internal.IntList uint32Val_; - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public java.util.List - getUint32ValList() { - return uint32Val_; - } - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32ValCount() { - return uint32Val_.size(); - } - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32Val(int index) { - return uint32Val_.getInt(index); - } - private int uint32ValMemoizedSerializedSize = -1; - - public static final int UINT64_VAL_FIELD_NUMBER = 17; - private com.google.protobuf.Internal.LongList uint64Val_; - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public java.util.List - getUint64ValList() { - return uint64Val_; - } - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public int getUint64ValCount() { - return uint64Val_.size(); - } - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public long getUint64Val(int index) { - return uint64Val_.getLong(index); - } - private int uint64ValMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (tensorShape_ != null) { - output.writeMessage(2, getTensorShape()); - } - if (versionNumber_ != 0) { - output.writeInt32(3, versionNumber_); - } - if (!tensorContent_.isEmpty()) { - output.writeBytes(4, tensorContent_); - } - if (getFloatValList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(floatValMemoizedSerializedSize); - } - for (int i = 0; i < floatVal_.size(); i++) { - output.writeFloatNoTag(floatVal_.getFloat(i)); - } - if (getDoubleValList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(doubleValMemoizedSerializedSize); - } - for (int i = 0; i < doubleVal_.size(); i++) { - output.writeDoubleNoTag(doubleVal_.getDouble(i)); - } - if (getIntValList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(intValMemoizedSerializedSize); - } - for (int i = 0; i < intVal_.size(); i++) { - output.writeInt32NoTag(intVal_.getInt(i)); - } - for (int i = 0; i < stringVal_.size(); i++) { - output.writeBytes(8, stringVal_.get(i)); - } - if (getScomplexValList().size() > 0) { - output.writeUInt32NoTag(74); - output.writeUInt32NoTag(scomplexValMemoizedSerializedSize); - } - for (int i = 0; i < scomplexVal_.size(); i++) { - output.writeFloatNoTag(scomplexVal_.getFloat(i)); - } - if (getInt64ValList().size() > 0) { - output.writeUInt32NoTag(82); - output.writeUInt32NoTag(int64ValMemoizedSerializedSize); - } - for (int i = 0; i < int64Val_.size(); i++) { - output.writeInt64NoTag(int64Val_.getLong(i)); - } - if (getBoolValList().size() > 0) { - output.writeUInt32NoTag(90); - output.writeUInt32NoTag(boolValMemoizedSerializedSize); - } - for (int i = 0; i < boolVal_.size(); i++) { - output.writeBoolNoTag(boolVal_.getBoolean(i)); - } - if (getDcomplexValList().size() > 0) { - output.writeUInt32NoTag(98); - output.writeUInt32NoTag(dcomplexValMemoizedSerializedSize); - } - for (int i = 0; i < dcomplexVal_.size(); i++) { - output.writeDoubleNoTag(dcomplexVal_.getDouble(i)); - } - if (getHalfValList().size() > 0) { - output.writeUInt32NoTag(106); - output.writeUInt32NoTag(halfValMemoizedSerializedSize); - } - for (int i = 0; i < halfVal_.size(); i++) { - output.writeInt32NoTag(halfVal_.getInt(i)); - } - for (int i = 0; i < resourceHandleVal_.size(); i++) { - output.writeMessage(14, resourceHandleVal_.get(i)); - } - for (int i = 0; i < variantVal_.size(); i++) { - output.writeMessage(15, variantVal_.get(i)); - } - if (getUint32ValList().size() > 0) { - output.writeUInt32NoTag(130); - output.writeUInt32NoTag(uint32ValMemoizedSerializedSize); - } - for (int i = 0; i < uint32Val_.size(); i++) { - output.writeUInt32NoTag(uint32Val_.getInt(i)); - } - if (getUint64ValList().size() > 0) { - output.writeUInt32NoTag(138); - output.writeUInt32NoTag(uint64ValMemoizedSerializedSize); - } - for (int i = 0; i < uint64Val_.size(); i++) { - output.writeUInt64NoTag(uint64Val_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (tensorShape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTensorShape()); - } - if (versionNumber_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, versionNumber_); - } - if (!tensorContent_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, tensorContent_); - } - { - int dataSize = 0; - dataSize = 4 * getFloatValList().size(); - size += dataSize; - if (!getFloatValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - floatValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * getDoubleValList().size(); - size += dataSize; - if (!getDoubleValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - doubleValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < intVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(intVal_.getInt(i)); - } - size += dataSize; - if (!getIntValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - intValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < stringVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(stringVal_.get(i)); - } - size += dataSize; - size += 1 * getStringValList().size(); - } - { - int dataSize = 0; - dataSize = 4 * getScomplexValList().size(); - size += dataSize; - if (!getScomplexValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - scomplexValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < int64Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(int64Val_.getLong(i)); - } - size += dataSize; - if (!getInt64ValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - int64ValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * getBoolValList().size(); - size += dataSize; - if (!getBoolValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - boolValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * getDcomplexValList().size(); - size += dataSize; - if (!getDcomplexValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - dcomplexValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < halfVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(halfVal_.getInt(i)); - } - size += dataSize; - if (!getHalfValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - halfValMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < resourceHandleVal_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, resourceHandleVal_.get(i)); - } - for (int i = 0; i < variantVal_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(15, variantVal_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < uint32Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(uint32Val_.getInt(i)); - } - size += dataSize; - if (!getUint32ValList().isEmpty()) { - size += 2; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - uint32ValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < uint64Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt64SizeNoTag(uint64Val_.getLong(i)); - } - size += dataSize; - if (!getUint64ValList().isEmpty()) { - size += 2; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - uint64ValMemoizedSerializedSize = dataSize; - } - 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.TensorProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorProto other = (org.tensorflow.proto.framework.TensorProto) obj; - - if (dtype_ != other.dtype_) return false; - if (hasTensorShape() != other.hasTensorShape()) return false; - if (hasTensorShape()) { - if (!getTensorShape() - .equals(other.getTensorShape())) return false; - } - if (getVersionNumber() - != other.getVersionNumber()) return false; - if (!getTensorContent() - .equals(other.getTensorContent())) return false; - if (!getHalfValList() - .equals(other.getHalfValList())) return false; - if (!getFloatValList() - .equals(other.getFloatValList())) return false; - if (!getDoubleValList() - .equals(other.getDoubleValList())) return false; - if (!getIntValList() - .equals(other.getIntValList())) return false; - if (!getStringValList() - .equals(other.getStringValList())) return false; - if (!getScomplexValList() - .equals(other.getScomplexValList())) return false; - if (!getInt64ValList() - .equals(other.getInt64ValList())) return false; - if (!getBoolValList() - .equals(other.getBoolValList())) return false; - if (!getDcomplexValList() - .equals(other.getDcomplexValList())) return false; - if (!getResourceHandleValList() - .equals(other.getResourceHandleValList())) return false; - if (!getVariantValList() - .equals(other.getVariantValList())) return false; - if (!getUint32ValList() - .equals(other.getUint32ValList())) return false; - if (!getUint64ValList() - .equals(other.getUint64ValList())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasTensorShape()) { - hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getTensorShape().hashCode(); - } - hash = (37 * hash) + VERSION_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getVersionNumber(); - hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getTensorContent().hashCode(); - if (getHalfValCount() > 0) { - hash = (37 * hash) + HALF_VAL_FIELD_NUMBER; - hash = (53 * hash) + getHalfValList().hashCode(); - } - if (getFloatValCount() > 0) { - hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getFloatValList().hashCode(); - } - if (getDoubleValCount() > 0) { - hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; - hash = (53 * hash) + getDoubleValList().hashCode(); - } - if (getIntValCount() > 0) { - hash = (37 * hash) + INT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getIntValList().hashCode(); - } - if (getStringValCount() > 0) { - hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; - hash = (53 * hash) + getStringValList().hashCode(); - } - if (getScomplexValCount() > 0) { - hash = (37 * hash) + SCOMPLEX_VAL_FIELD_NUMBER; - hash = (53 * hash) + getScomplexValList().hashCode(); - } - if (getInt64ValCount() > 0) { - hash = (37 * hash) + INT64_VAL_FIELD_NUMBER; - hash = (53 * hash) + getInt64ValList().hashCode(); - } - if (getBoolValCount() > 0) { - hash = (37 * hash) + BOOL_VAL_FIELD_NUMBER; - hash = (53 * hash) + getBoolValList().hashCode(); - } - if (getDcomplexValCount() > 0) { - hash = (37 * hash) + DCOMPLEX_VAL_FIELD_NUMBER; - hash = (53 * hash) + getDcomplexValList().hashCode(); - } - if (getResourceHandleValCount() > 0) { - hash = (37 * hash) + RESOURCE_HANDLE_VAL_FIELD_NUMBER; - hash = (53 * hash) + getResourceHandleValList().hashCode(); - } - if (getVariantValCount() > 0) { - hash = (37 * hash) + VARIANT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getVariantValList().hashCode(); - } - if (getUint32ValCount() > 0) { - hash = (37 * hash) + UINT32_VAL_FIELD_NUMBER; - hash = (53 * hash) + getUint32ValList().hashCode(); - } - if (getUint64ValCount() > 0) { - hash = (37 * hash) + UINT64_VAL_FIELD_NUMBER; - hash = (53 * hash) + getUint64ValList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorProto 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.TensorProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorProto 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.TensorProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorProto 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.TensorProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorProto 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.TensorProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorProto 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.TensorProto 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; - } - /** - *
    -   * Protocol buffer representing a tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorProto) - org.tensorflow.proto.framework.TensorProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorProto.class, org.tensorflow.proto.framework.TensorProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResourceHandleValFieldBuilder(); - getVariantValFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - dtype_ = 0; - - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - versionNumber_ = 0; - - tensorContent_ = com.google.protobuf.ByteString.EMPTY; - - halfVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - floatVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000002); - doubleVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000004); - intVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - stringVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - scomplexVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000020); - int64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000040); - boolVal_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000080); - dcomplexVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000100); - if (resourceHandleValBuilder_ == null) { - resourceHandleVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - } else { - resourceHandleValBuilder_.clear(); - } - if (variantValBuilder_ == null) { - variantVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - } else { - variantValBuilder_.clear(); - } - uint32Val_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000800); - uint64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00001000); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorProto build() { - org.tensorflow.proto.framework.TensorProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorProto buildPartial() { - org.tensorflow.proto.framework.TensorProto result = new org.tensorflow.proto.framework.TensorProto(this); - int from_bitField0_ = bitField0_; - result.dtype_ = dtype_; - if (tensorShapeBuilder_ == null) { - result.tensorShape_ = tensorShape_; - } else { - result.tensorShape_ = tensorShapeBuilder_.build(); - } - result.versionNumber_ = versionNumber_; - result.tensorContent_ = tensorContent_; - if (((bitField0_ & 0x00000001) != 0)) { - halfVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.halfVal_ = halfVal_; - if (((bitField0_ & 0x00000002) != 0)) { - floatVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.floatVal_ = floatVal_; - if (((bitField0_ & 0x00000004) != 0)) { - doubleVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.doubleVal_ = doubleVal_; - if (((bitField0_ & 0x00000008) != 0)) { - intVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.intVal_ = intVal_; - if (((bitField0_ & 0x00000010) != 0)) { - stringVal_ = java.util.Collections.unmodifiableList(stringVal_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.stringVal_ = stringVal_; - if (((bitField0_ & 0x00000020) != 0)) { - scomplexVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.scomplexVal_ = scomplexVal_; - if (((bitField0_ & 0x00000040) != 0)) { - int64Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.int64Val_ = int64Val_; - if (((bitField0_ & 0x00000080) != 0)) { - boolVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.boolVal_ = boolVal_; - if (((bitField0_ & 0x00000100) != 0)) { - dcomplexVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.dcomplexVal_ = dcomplexVal_; - if (resourceHandleValBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = java.util.Collections.unmodifiableList(resourceHandleVal_); - bitField0_ = (bitField0_ & ~0x00000200); - } - result.resourceHandleVal_ = resourceHandleVal_; - } else { - result.resourceHandleVal_ = resourceHandleValBuilder_.build(); - } - if (variantValBuilder_ == null) { - if (((bitField0_ & 0x00000400) != 0)) { - variantVal_ = java.util.Collections.unmodifiableList(variantVal_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.variantVal_ = variantVal_; - } else { - result.variantVal_ = variantValBuilder_.build(); - } - if (((bitField0_ & 0x00000800) != 0)) { - uint32Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.uint32Val_ = uint32Val_; - if (((bitField0_ & 0x00001000) != 0)) { - uint64Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.uint64Val_ = uint64Val_; - 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.TensorProto) { - return mergeFrom((org.tensorflow.proto.framework.TensorProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorProto other) { - if (other == org.tensorflow.proto.framework.TensorProto.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasTensorShape()) { - mergeTensorShape(other.getTensorShape()); - } - if (other.getVersionNumber() != 0) { - setVersionNumber(other.getVersionNumber()); - } - if (other.getTensorContent() != com.google.protobuf.ByteString.EMPTY) { - setTensorContent(other.getTensorContent()); - } - if (!other.halfVal_.isEmpty()) { - if (halfVal_.isEmpty()) { - halfVal_ = other.halfVal_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureHalfValIsMutable(); - halfVal_.addAll(other.halfVal_); - } - onChanged(); - } - if (!other.floatVal_.isEmpty()) { - if (floatVal_.isEmpty()) { - floatVal_ = other.floatVal_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureFloatValIsMutable(); - floatVal_.addAll(other.floatVal_); - } - onChanged(); - } - if (!other.doubleVal_.isEmpty()) { - if (doubleVal_.isEmpty()) { - doubleVal_ = other.doubleVal_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureDoubleValIsMutable(); - doubleVal_.addAll(other.doubleVal_); - } - onChanged(); - } - if (!other.intVal_.isEmpty()) { - if (intVal_.isEmpty()) { - intVal_ = other.intVal_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureIntValIsMutable(); - intVal_.addAll(other.intVal_); - } - onChanged(); - } - if (!other.stringVal_.isEmpty()) { - if (stringVal_.isEmpty()) { - stringVal_ = other.stringVal_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureStringValIsMutable(); - stringVal_.addAll(other.stringVal_); - } - onChanged(); - } - if (!other.scomplexVal_.isEmpty()) { - if (scomplexVal_.isEmpty()) { - scomplexVal_ = other.scomplexVal_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureScomplexValIsMutable(); - scomplexVal_.addAll(other.scomplexVal_); - } - onChanged(); - } - if (!other.int64Val_.isEmpty()) { - if (int64Val_.isEmpty()) { - int64Val_ = other.int64Val_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureInt64ValIsMutable(); - int64Val_.addAll(other.int64Val_); - } - onChanged(); - } - if (!other.boolVal_.isEmpty()) { - if (boolVal_.isEmpty()) { - boolVal_ = other.boolVal_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureBoolValIsMutable(); - boolVal_.addAll(other.boolVal_); - } - onChanged(); - } - if (!other.dcomplexVal_.isEmpty()) { - if (dcomplexVal_.isEmpty()) { - dcomplexVal_ = other.dcomplexVal_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureDcomplexValIsMutable(); - dcomplexVal_.addAll(other.dcomplexVal_); - } - onChanged(); - } - if (resourceHandleValBuilder_ == null) { - if (!other.resourceHandleVal_.isEmpty()) { - if (resourceHandleVal_.isEmpty()) { - resourceHandleVal_ = other.resourceHandleVal_; - bitField0_ = (bitField0_ & ~0x00000200); - } else { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.addAll(other.resourceHandleVal_); - } - onChanged(); - } - } else { - if (!other.resourceHandleVal_.isEmpty()) { - if (resourceHandleValBuilder_.isEmpty()) { - resourceHandleValBuilder_.dispose(); - resourceHandleValBuilder_ = null; - resourceHandleVal_ = other.resourceHandleVal_; - bitField0_ = (bitField0_ & ~0x00000200); - resourceHandleValBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResourceHandleValFieldBuilder() : null; - } else { - resourceHandleValBuilder_.addAllMessages(other.resourceHandleVal_); - } - } - } - if (variantValBuilder_ == null) { - if (!other.variantVal_.isEmpty()) { - if (variantVal_.isEmpty()) { - variantVal_ = other.variantVal_; - bitField0_ = (bitField0_ & ~0x00000400); - } else { - ensureVariantValIsMutable(); - variantVal_.addAll(other.variantVal_); - } - onChanged(); - } - } else { - if (!other.variantVal_.isEmpty()) { - if (variantValBuilder_.isEmpty()) { - variantValBuilder_.dispose(); - variantValBuilder_ = null; - variantVal_ = other.variantVal_; - bitField0_ = (bitField0_ & ~0x00000400); - variantValBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getVariantValFieldBuilder() : null; - } else { - variantValBuilder_.addAllMessages(other.variantVal_); - } - } - } - if (!other.uint32Val_.isEmpty()) { - if (uint32Val_.isEmpty()) { - uint32Val_ = other.uint32Val_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureUint32ValIsMutable(); - uint32Val_.addAll(other.uint32Val_); - } - onChanged(); - } - if (!other.uint64Val_.isEmpty()) { - if (uint64Val_.isEmpty()) { - uint64Val_ = other.uint64Val_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureUint64ValIsMutable(); - uint64Val_.addAll(other.uint64Val_); - } - onChanged(); - } - 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.TensorProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto tensorShape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> tensorShapeBuilder_; - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShapeBuilder_ != null || tensorShape_ != null; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getTensorShape() { - if (tensorShapeBuilder_ == null) { - return tensorShape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } else { - return tensorShapeBuilder_.getMessage(); - } - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorShape_ = value; - onChanged(); - } else { - tensorShapeBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (tensorShapeBuilder_ == null) { - tensorShape_ = builderForValue.build(); - onChanged(); - } else { - tensorShapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder mergeTensorShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (tensorShape_ != null) { - tensorShape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(tensorShape_).mergeFrom(value).buildPartial(); - } else { - tensorShape_ = value; - } - onChanged(); - } else { - tensorShapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder clearTensorShape() { - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - onChanged(); - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - - return this; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getTensorShapeBuilder() { - - onChanged(); - return getTensorShapeFieldBuilder().getBuilder(); - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - if (tensorShapeBuilder_ != null) { - return tensorShapeBuilder_.getMessageOrBuilder(); - } else { - return tensorShape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : tensorShape_; - } - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getTensorShapeFieldBuilder() { - if (tensorShapeBuilder_ == null) { - tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getTensorShape(), - getParentForChildren(), - isClean()); - tensorShape_ = null; - } - return tensorShapeBuilder_; - } - - private int versionNumber_ ; - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public int getVersionNumber() { - return versionNumber_; - } - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public Builder setVersionNumber(int value) { - - versionNumber_ = value; - onChanged(); - return this; - } - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public Builder clearVersionNumber() { - - versionNumber_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString tensorContent_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public com.google.protobuf.ByteString getTensorContent() { - return tensorContent_; - } - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public Builder setTensorContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorContent_ = value; - onChanged(); - return this; - } - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public Builder clearTensorContent() { - - tensorContent_ = getDefaultInstance().getTensorContent(); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList halfVal_ = emptyIntList(); - private void ensureHalfValIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - halfVal_ = mutableCopy(halfVal_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public java.util.List - getHalfValList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(halfVal_) : halfVal_; - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfValCount() { - return halfVal_.size(); - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfVal(int index) { - return halfVal_.getInt(index); - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder setHalfVal( - int index, int value) { - ensureHalfValIsMutable(); - halfVal_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder addHalfVal(int value) { - ensureHalfValIsMutable(); - halfVal_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder addAllHalfVal( - java.lang.Iterable values) { - ensureHalfValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, halfVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder clearHalfVal() { - halfVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList floatVal_ = emptyFloatList(); - private void ensureFloatValIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - floatVal_ = mutableCopy(floatVal_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public java.util.List - getFloatValList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(floatVal_) : floatVal_; - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public int getFloatValCount() { - return floatVal_.size(); - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public float getFloatVal(int index) { - return floatVal_.getFloat(index); - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder setFloatVal( - int index, float value) { - ensureFloatValIsMutable(); - floatVal_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder addFloatVal(float value) { - ensureFloatValIsMutable(); - floatVal_.addFloat(value); - onChanged(); - return this; - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder addAllFloatVal( - java.lang.Iterable values) { - ensureFloatValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, floatVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder clearFloatVal() { - floatVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList doubleVal_ = emptyDoubleList(); - private void ensureDoubleValIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - doubleVal_ = mutableCopy(doubleVal_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public java.util.List - getDoubleValList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(doubleVal_) : doubleVal_; - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public int getDoubleValCount() { - return doubleVal_.size(); - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public double getDoubleVal(int index) { - return doubleVal_.getDouble(index); - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder setDoubleVal( - int index, double value) { - ensureDoubleValIsMutable(); - doubleVal_.setDouble(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder addDoubleVal(double value) { - ensureDoubleValIsMutable(); - doubleVal_.addDouble(value); - onChanged(); - return this; - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder addAllDoubleVal( - java.lang.Iterable values) { - ensureDoubleValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, doubleVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder clearDoubleVal() { - doubleVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList intVal_ = emptyIntList(); - private void ensureIntValIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - intVal_ = mutableCopy(intVal_); - bitField0_ |= 0x00000008; - } - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public java.util.List - getIntValList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(intVal_) : intVal_; - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntValCount() { - return intVal_.size(); - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntVal(int index) { - return intVal_.getInt(index); - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder setIntVal( - int index, int value) { - ensureIntValIsMutable(); - intVal_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder addIntVal(int value) { - ensureIntValIsMutable(); - intVal_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder addAllIntVal( - java.lang.Iterable values) { - ensureIntValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, intVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder clearIntVal() { - intVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - private java.util.List stringVal_ = java.util.Collections.emptyList(); - private void ensureStringValIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - stringVal_ = new java.util.ArrayList(stringVal_); - bitField0_ |= 0x00000010; - } - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public java.util.List - getStringValList() { - return ((bitField0_ & 0x00000010) != 0) ? - java.util.Collections.unmodifiableList(stringVal_) : stringVal_; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public int getStringValCount() { - return stringVal_.size(); - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public com.google.protobuf.ByteString getStringVal(int index) { - return stringVal_.get(index); - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder setStringVal( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringValIsMutable(); - stringVal_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder addStringVal(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringValIsMutable(); - stringVal_.add(value); - onChanged(); - return this; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder addAllStringVal( - java.lang.Iterable values) { - ensureStringValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, stringVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder clearStringVal() { - stringVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList scomplexVal_ = emptyFloatList(); - private void ensureScomplexValIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - scomplexVal_ = mutableCopy(scomplexVal_); - bitField0_ |= 0x00000020; - } - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public java.util.List - getScomplexValList() { - return ((bitField0_ & 0x00000020) != 0) ? - java.util.Collections.unmodifiableList(scomplexVal_) : scomplexVal_; - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public int getScomplexValCount() { - return scomplexVal_.size(); - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public float getScomplexVal(int index) { - return scomplexVal_.getFloat(index); - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder setScomplexVal( - int index, float value) { - ensureScomplexValIsMutable(); - scomplexVal_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder addScomplexVal(float value) { - ensureScomplexValIsMutable(); - scomplexVal_.addFloat(value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder addAllScomplexVal( - java.lang.Iterable values) { - ensureScomplexValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, scomplexVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder clearScomplexVal() { - scomplexVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList int64Val_ = emptyLongList(); - private void ensureInt64ValIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { - int64Val_ = mutableCopy(int64Val_); - bitField0_ |= 0x00000040; - } - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public java.util.List - getInt64ValList() { - return ((bitField0_ & 0x00000040) != 0) ? - java.util.Collections.unmodifiableList(int64Val_) : int64Val_; - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public int getInt64ValCount() { - return int64Val_.size(); - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public long getInt64Val(int index) { - return int64Val_.getLong(index); - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder setInt64Val( - int index, long value) { - ensureInt64ValIsMutable(); - int64Val_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder addInt64Val(long value) { - ensureInt64ValIsMutable(); - int64Val_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder addAllInt64Val( - java.lang.Iterable values) { - ensureInt64ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, int64Val_); - onChanged(); - return this; - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder clearInt64Val() { - int64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.BooleanList boolVal_ = emptyBooleanList(); - private void ensureBoolValIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { - boolVal_ = mutableCopy(boolVal_); - bitField0_ |= 0x00000080; - } - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public java.util.List - getBoolValList() { - return ((bitField0_ & 0x00000080) != 0) ? - java.util.Collections.unmodifiableList(boolVal_) : boolVal_; - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public int getBoolValCount() { - return boolVal_.size(); - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public boolean getBoolVal(int index) { - return boolVal_.getBoolean(index); - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder setBoolVal( - int index, boolean value) { - ensureBoolValIsMutable(); - boolVal_.setBoolean(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder addBoolVal(boolean value) { - ensureBoolValIsMutable(); - boolVal_.addBoolean(value); - onChanged(); - return this; - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder addAllBoolVal( - java.lang.Iterable values) { - ensureBoolValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, boolVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder clearBoolVal() { - boolVal_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList dcomplexVal_ = emptyDoubleList(); - private void ensureDcomplexValIsMutable() { - if (!((bitField0_ & 0x00000100) != 0)) { - dcomplexVal_ = mutableCopy(dcomplexVal_); - bitField0_ |= 0x00000100; - } - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public java.util.List - getDcomplexValList() { - return ((bitField0_ & 0x00000100) != 0) ? - java.util.Collections.unmodifiableList(dcomplexVal_) : dcomplexVal_; - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public int getDcomplexValCount() { - return dcomplexVal_.size(); - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public double getDcomplexVal(int index) { - return dcomplexVal_.getDouble(index); - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder setDcomplexVal( - int index, double value) { - ensureDcomplexValIsMutable(); - dcomplexVal_.setDouble(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder addDcomplexVal(double value) { - ensureDcomplexValIsMutable(); - dcomplexVal_.addDouble(value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder addAllDcomplexVal( - java.lang.Iterable values) { - ensureDcomplexValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dcomplexVal_); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder clearDcomplexVal() { - dcomplexVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000100); - onChanged(); - return this; - } - - private java.util.List resourceHandleVal_ = - java.util.Collections.emptyList(); - private void ensureResourceHandleValIsMutable() { - if (!((bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = new java.util.ArrayList(resourceHandleVal_); - bitField0_ |= 0x00000200; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto, org.tensorflow.proto.framework.ResourceHandleProto.Builder, org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder> resourceHandleValBuilder_; - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List getResourceHandleValList() { - if (resourceHandleValBuilder_ == null) { - return java.util.Collections.unmodifiableList(resourceHandleVal_); - } else { - return resourceHandleValBuilder_.getMessageList(); - } - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public int getResourceHandleValCount() { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.size(); - } else { - return resourceHandleValBuilder_.getCount(); - } - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProto getResourceHandleVal(int index) { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.get(index); - } else { - return resourceHandleValBuilder_.getMessage(index); - } - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder setResourceHandleVal( - int index, org.tensorflow.proto.framework.ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.set(index, value); - onChanged(); - } else { - resourceHandleValBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder setResourceHandleVal( - int index, org.tensorflow.proto.framework.ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.set(index, builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal(org.tensorflow.proto.framework.ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(value); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - int index, org.tensorflow.proto.framework.ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(index, value); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - org.tensorflow.proto.framework.ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - int index, org.tensorflow.proto.framework.ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(index, builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addAllResourceHandleVal( - java.lang.Iterable values) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resourceHandleVal_); - onChanged(); - } else { - resourceHandleValBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder clearResourceHandleVal() { - if (resourceHandleValBuilder_ == null) { - resourceHandleVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - onChanged(); - } else { - resourceHandleValBuilder_.clear(); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder removeResourceHandleVal(int index) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.remove(index); - onChanged(); - } else { - resourceHandleValBuilder_.remove(index); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.Builder getResourceHandleValBuilder( - int index) { - return getResourceHandleValFieldBuilder().getBuilder(index); - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index) { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.get(index); } else { - return resourceHandleValBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValOrBuilderList() { - if (resourceHandleValBuilder_ != null) { - return resourceHandleValBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resourceHandleVal_); - } - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.Builder addResourceHandleValBuilder() { - return getResourceHandleValFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ResourceHandleProto.getDefaultInstance()); - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public org.tensorflow.proto.framework.ResourceHandleProto.Builder addResourceHandleValBuilder( - int index) { - return getResourceHandleValFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ResourceHandleProto.getDefaultInstance()); - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValBuilderList() { - return getResourceHandleValFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto, org.tensorflow.proto.framework.ResourceHandleProto.Builder, org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder> - getResourceHandleValFieldBuilder() { - if (resourceHandleValBuilder_ == null) { - resourceHandleValBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ResourceHandleProto, org.tensorflow.proto.framework.ResourceHandleProto.Builder, org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder>( - resourceHandleVal_, - ((bitField0_ & 0x00000200) != 0), - getParentForChildren(), - isClean()); - resourceHandleVal_ = null; - } - return resourceHandleValBuilder_; - } - - private java.util.List variantVal_ = - java.util.Collections.emptyList(); - private void ensureVariantValIsMutable() { - if (!((bitField0_ & 0x00000400) != 0)) { - variantVal_ = new java.util.ArrayList(variantVal_); - bitField0_ |= 0x00000400; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.VariantTensorDataProto, org.tensorflow.proto.framework.VariantTensorDataProto.Builder, org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder> variantValBuilder_; - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List getVariantValList() { - if (variantValBuilder_ == null) { - return java.util.Collections.unmodifiableList(variantVal_); - } else { - return variantValBuilder_.getMessageList(); - } - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public int getVariantValCount() { - if (variantValBuilder_ == null) { - return variantVal_.size(); - } else { - return variantValBuilder_.getCount(); - } - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProto getVariantVal(int index) { - if (variantValBuilder_ == null) { - return variantVal_.get(index); - } else { - return variantValBuilder_.getMessage(index); - } - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder setVariantVal( - int index, org.tensorflow.proto.framework.VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.set(index, value); - onChanged(); - } else { - variantValBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder setVariantVal( - int index, org.tensorflow.proto.framework.VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.set(index, builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal(org.tensorflow.proto.framework.VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.add(value); - onChanged(); - } else { - variantValBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - int index, org.tensorflow.proto.framework.VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.add(index, value); - onChanged(); - } else { - variantValBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - org.tensorflow.proto.framework.VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.add(builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - int index, org.tensorflow.proto.framework.VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.add(index, builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addAllVariantVal( - java.lang.Iterable values) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, variantVal_); - onChanged(); - } else { - variantValBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder clearVariantVal() { - if (variantValBuilder_ == null) { - variantVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - onChanged(); - } else { - variantValBuilder_.clear(); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder removeVariantVal(int index) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.remove(index); - onChanged(); - } else { - variantValBuilder_.remove(index); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProto.Builder getVariantValBuilder( - int index) { - return getVariantValFieldBuilder().getBuilder(index); - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index) { - if (variantValBuilder_ == null) { - return variantVal_.get(index); } else { - return variantValBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValOrBuilderList() { - if (variantValBuilder_ != null) { - return variantValBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(variantVal_); - } - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProto.Builder addVariantValBuilder() { - return getVariantValFieldBuilder().addBuilder( - org.tensorflow.proto.framework.VariantTensorDataProto.getDefaultInstance()); - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public org.tensorflow.proto.framework.VariantTensorDataProto.Builder addVariantValBuilder( - int index) { - return getVariantValFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.VariantTensorDataProto.getDefaultInstance()); - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValBuilderList() { - return getVariantValFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.VariantTensorDataProto, org.tensorflow.proto.framework.VariantTensorDataProto.Builder, org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder> - getVariantValFieldBuilder() { - if (variantValBuilder_ == null) { - variantValBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.VariantTensorDataProto, org.tensorflow.proto.framework.VariantTensorDataProto.Builder, org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder>( - variantVal_, - ((bitField0_ & 0x00000400) != 0), - getParentForChildren(), - isClean()); - variantVal_ = null; - } - return variantValBuilder_; - } - - private com.google.protobuf.Internal.IntList uint32Val_ = emptyIntList(); - private void ensureUint32ValIsMutable() { - if (!((bitField0_ & 0x00000800) != 0)) { - uint32Val_ = mutableCopy(uint32Val_); - bitField0_ |= 0x00000800; - } - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public java.util.List - getUint32ValList() { - return ((bitField0_ & 0x00000800) != 0) ? - java.util.Collections.unmodifiableList(uint32Val_) : uint32Val_; - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32ValCount() { - return uint32Val_.size(); - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32Val(int index) { - return uint32Val_.getInt(index); - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder setUint32Val( - int index, int value) { - ensureUint32ValIsMutable(); - uint32Val_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder addUint32Val(int value) { - ensureUint32ValIsMutable(); - uint32Val_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder addAllUint32Val( - java.lang.Iterable values) { - ensureUint32ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, uint32Val_); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder clearUint32Val() { - uint32Val_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000800); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList uint64Val_ = emptyLongList(); - private void ensureUint64ValIsMutable() { - if (!((bitField0_ & 0x00001000) != 0)) { - uint64Val_ = mutableCopy(uint64Val_); - bitField0_ |= 0x00001000; - } - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public java.util.List - getUint64ValList() { - return ((bitField0_ & 0x00001000) != 0) ? - java.util.Collections.unmodifiableList(uint64Val_) : uint64Val_; - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public int getUint64ValCount() { - return uint64Val_.size(); - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public long getUint64Val(int index) { - return uint64Val_.getLong(index); - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder setUint64Val( - int index, long value) { - ensureUint64ValIsMutable(); - uint64Val_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder addUint64Val(long value) { - ensureUint64ValIsMutable(); - uint64Val_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder addAllUint64Val( - java.lang.Iterable values) { - ensureUint64ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, uint64Val_); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder clearUint64Val() { - uint64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00001000); - 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.TensorProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorProto) - private static final org.tensorflow.proto.framework.TensorProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorProto(); - } - - public static org.tensorflow.proto.framework.TensorProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorProto(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.TensorProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java deleted file mode 100644 index 7ffbb5d3a3d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java +++ /dev/null @@ -1,440 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public interface TensorProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorProto) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - boolean hasTensorShape(); - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getTensorShape(); - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); - - /** - *
    -   * Version number.
    -   * In version 0, if the "repeated xxx" representations contain only one
    -   * element, that element is repeated to fill the shape.  This makes it easy
    -   * to represent a constant Tensor with a single value.
    -   * 
    - * - * int32 version_number = 3; - */ - int getVersionNumber(); - - /** - *
    -   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -   * can be used for all tensor types. The purpose of this representation is to
    -   * reduce serialization overhead during RPC call by avoiding serialization of
    -   * many repeated small items.
    -   * 
    - * - * bytes tensor_content = 4; - */ - com.google.protobuf.ByteString getTensorContent(); - - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - java.util.List getHalfValList(); - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - int getHalfValCount(); - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - int getHalfVal(int index); - - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - java.util.List getFloatValList(); - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - int getFloatValCount(); - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - float getFloatVal(int index); - - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - java.util.List getDoubleValList(); - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - int getDoubleValCount(); - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - double getDoubleVal(int index); - - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - java.util.List getIntValList(); - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - int getIntValCount(); - /** - *
    -   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - int getIntVal(int index); - - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - java.util.List getStringValList(); - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - int getStringValCount(); - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - com.google.protobuf.ByteString getStringVal(int index); - - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - java.util.List getScomplexValList(); - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - int getScomplexValCount(); - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - float getScomplexVal(int index); - - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - java.util.List getInt64ValList(); - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - int getInt64ValCount(); - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - long getInt64Val(int index); - - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - java.util.List getBoolValList(); - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - int getBoolValCount(); - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - boolean getBoolVal(int index); - - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - java.util.List getDcomplexValList(); - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - int getDcomplexValCount(); - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - double getDcomplexVal(int index); - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - java.util.List - getResourceHandleValList(); - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - org.tensorflow.proto.framework.ResourceHandleProto getResourceHandleVal(int index); - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - int getResourceHandleValCount(); - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - java.util.List - getResourceHandleValOrBuilderList(); - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - org.tensorflow.proto.framework.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index); - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - java.util.List - getVariantValList(); - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - org.tensorflow.proto.framework.VariantTensorDataProto getVariantVal(int index); - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - int getVariantValCount(); - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - java.util.List - getVariantValOrBuilderList(); - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index); - - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - java.util.List getUint32ValList(); - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - int getUint32ValCount(); - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - int getUint32Val(int index); - - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - java.util.List getUint64ValList(); - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - int getUint64ValCount(); - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - long getUint64Val(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtos.java deleted file mode 100644 index 02a9fdadd6e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorProtos.java +++ /dev/null @@ -1,86 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public final class TensorProtos { - private TensorProtos() {} - 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_TensorProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_VariantTensorDataProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_VariantTensorDataProto_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/framework/tensor.proto" + - "\022\ntensorflow\032/tensorflow/core/framework/" + - "resource_handle.proto\032,tensorflow/core/f" + - "ramework/tensor_shape.proto\032%tensorflow/" + - "core/framework/types.proto\"\214\004\n\013TensorPro" + - "to\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.DataType\022" + - "2\n\014tensor_shape\030\002 \001(\0132\034.tensorflow.Tenso" + - "rShapeProto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016t" + - "ensor_content\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020" + - "\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006" + - " \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_" + - "val\030\010 \003(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\ti" + - "nt64_val\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001" + - "\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001\022<\n\023resource_h" + - "andle_val\030\016 \003(\0132\037.tensorflow.ResourceHan" + - "dleProto\0227\n\013variant_val\030\017 \003(\0132\".tensorfl" + - "ow.VariantTensorDataProto\022\026\n\nuint32_val\030" + - "\020 \003(\rB\002\020\001\022\026\n\nuint64_val\030\021 \003(\004B\002\020\001\"g\n\026Var" + - "iantTensorDataProto\022\021\n\ttype_name\030\001 \001(\t\022\020" + - "\n\010metadata\030\002 \001(\014\022(\n\007tensors\030\003 \003(\0132\027.tens" + - "orflow.TensorProtoB\202\001\n\036org.tensorflow.pr" + - "oto.frameworkB\014TensorProtosP\001ZMgithub.co" + - "m/tensorflow/tensorflow/tensorflow/go/co" + - "re/framework/tensor_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.ResourceHandle.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_TensorProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorProto_descriptor, - new java.lang.String[] { "Dtype", "TensorShape", "VersionNumber", "TensorContent", "HalfVal", "FloatVal", "DoubleVal", "IntVal", "StringVal", "ScomplexVal", "Int64Val", "BoolVal", "DcomplexVal", "ResourceHandleVal", "VariantVal", "Uint32Val", "Uint64Val", }); - internal_static_tensorflow_VariantTensorDataProto_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_VariantTensorDataProto_descriptor, - new java.lang.String[] { "TypeName", "Metadata", "Tensors", }); - org.tensorflow.proto.framework.ResourceHandle.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProto.java deleted file mode 100644 index 1d0d543c656..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProto.java +++ /dev/null @@ -1,1852 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Dimensions of a tensor.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto} - */ -public final class TensorShapeProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto) - TensorShapeProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorShapeProto.newBuilder() to construct. - private TensorShapeProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorShapeProto() { - dim_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorShapeProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorShapeProto( - 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dim_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dim_.add( - input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.Dim.parser(), extensionRegistry)); - break; - } - case 24: { - - unknownRank_ = input.readBool(); - 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)) { - dim_ = java.util.Collections.unmodifiableList(dim_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorShapeProto.class, org.tensorflow.proto.framework.TensorShapeProto.Builder.class); - } - - public interface DimOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto.Dim) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Size of the tensor in that dimension.
    -     * This value must be >= -1, but values of -1 are reserved for "unknown"
    -     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -     * that work with TensorShapeProto may fail at runtime when deserializing
    -     * a TensorShapeProto containing a dim value of -1.
    -     * 
    - * - * int64 size = 1; - */ - long getSize(); - - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - *
    -   * One dimension of the tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto.Dim} - */ - public static final class Dim extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto.Dim) - DimOrBuilder { - private static final long serialVersionUID = 0L; - // Use Dim.newBuilder() to construct. - private Dim(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Dim() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Dim(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Dim( - 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: { - - size_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - 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.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorShapeProto.Dim.class, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder.class); - } - - public static final int SIZE_FIELD_NUMBER = 1; - private long size_; - /** - *
    -     * Size of the tensor in that dimension.
    -     * This value must be >= -1, but values of -1 are reserved for "unknown"
    -     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -     * that work with TensorShapeProto may fail at runtime when deserializing
    -     * a TensorShapeProto containing a dim value of -1.
    -     * 
    - * - * int64 size = 1; - */ - public long getSize() { - return size_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - - 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 (size_ != 0L) { - output.writeInt64(1, size_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, size_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - 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.TensorShapeProto.Dim)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorShapeProto.Dim other = (org.tensorflow.proto.framework.TensorShapeProto.Dim) obj; - - if (getSize() - != other.getSize()) return false; - if (!getName() - .equals(other.getName())) 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) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorShapeProto.Dim parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto.Dim 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.TensorShapeProto.Dim 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; - } - /** - *
    -     * One dimension of the tensor.
    -     * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto.Dim} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto.Dim) - org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorShapeProto.Dim.class, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorShapeProto.Dim.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(); - size_ = 0L; - - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto.Dim getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorShapeProto.Dim.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto.Dim build() { - org.tensorflow.proto.framework.TensorShapeProto.Dim result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto.Dim buildPartial() { - org.tensorflow.proto.framework.TensorShapeProto.Dim result = new org.tensorflow.proto.framework.TensorShapeProto.Dim(this); - result.size_ = size_; - result.name_ = name_; - 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.TensorShapeProto.Dim) { - return mergeFrom((org.tensorflow.proto.framework.TensorShapeProto.Dim)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorShapeProto.Dim other) { - if (other == org.tensorflow.proto.framework.TensorShapeProto.Dim.getDefaultInstance()) return this; - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - 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.TensorShapeProto.Dim parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorShapeProto.Dim) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long size_ ; - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public long getSize() { - return size_; - } - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - 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.TensorShapeProto.Dim) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto.Dim) - private static final org.tensorflow.proto.framework.TensorShapeProto.Dim DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorShapeProto.Dim(); - } - - public static org.tensorflow.proto.framework.TensorShapeProto.Dim getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Dim parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Dim(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.TensorShapeProto.Dim getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int DIM_FIELD_NUMBER = 2; - private java.util.List dim_; - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List getDimList() { - return dim_; - } - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimOrBuilderList() { - return dim_; - } - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public int getDimCount() { - return dim_.size(); - } - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Dim getDim(int index) { - return dim_.get(index); - } - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder getDimOrBuilder( - int index) { - return dim_.get(index); - } - - public static final int UNKNOWN_RANK_FIELD_NUMBER = 3; - private boolean unknownRank_; - /** - *
    -   * If true, the number of dimensions in the shape is unknown.
    -   * If true, "dim.size()" must be 0.
    -   * 
    - * - * bool unknown_rank = 3; - */ - public boolean getUnknownRank() { - return unknownRank_; - } - - 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 { - for (int i = 0; i < dim_.size(); i++) { - output.writeMessage(2, dim_.get(i)); - } - if (unknownRank_ != false) { - output.writeBool(3, unknownRank_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < dim_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, dim_.get(i)); - } - if (unknownRank_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, unknownRank_); - } - 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.TensorShapeProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorShapeProto other = (org.tensorflow.proto.framework.TensorShapeProto) obj; - - if (!getDimList() - .equals(other.getDimList())) return false; - if (getUnknownRank() - != other.getUnknownRank()) 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 (getDimCount() > 0) { - hash = (37 * hash) + DIM_FIELD_NUMBER; - hash = (53 * hash) + getDimList().hashCode(); - } - hash = (37 * hash) + UNKNOWN_RANK_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUnknownRank()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorShapeProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto 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.TensorShapeProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto 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.TensorShapeProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorShapeProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorShapeProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto 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.TensorShapeProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto 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.TensorShapeProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorShapeProto 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.TensorShapeProto 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; - } - /** - *
    -   * Dimensions of a tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto) - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorShapeProto.class, org.tensorflow.proto.framework.TensorShapeProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorShapeProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDimFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (dimBuilder_ == null) { - dim_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - dimBuilder_.clear(); - } - unknownRank_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto build() { - org.tensorflow.proto.framework.TensorShapeProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorShapeProto buildPartial() { - org.tensorflow.proto.framework.TensorShapeProto result = new org.tensorflow.proto.framework.TensorShapeProto(this); - int from_bitField0_ = bitField0_; - if (dimBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - dim_ = java.util.Collections.unmodifiableList(dim_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dim_ = dim_; - } else { - result.dim_ = dimBuilder_.build(); - } - result.unknownRank_ = unknownRank_; - 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.TensorShapeProto) { - return mergeFrom((org.tensorflow.proto.framework.TensorShapeProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorShapeProto other) { - if (other == org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance()) return this; - if (dimBuilder_ == null) { - if (!other.dim_.isEmpty()) { - if (dim_.isEmpty()) { - dim_ = other.dim_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDimIsMutable(); - dim_.addAll(other.dim_); - } - onChanged(); - } - } else { - if (!other.dim_.isEmpty()) { - if (dimBuilder_.isEmpty()) { - dimBuilder_.dispose(); - dimBuilder_ = null; - dim_ = other.dim_; - bitField0_ = (bitField0_ & ~0x00000001); - dimBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDimFieldBuilder() : null; - } else { - dimBuilder_.addAllMessages(other.dim_); - } - } - } - if (other.getUnknownRank() != false) { - setUnknownRank(other.getUnknownRank()); - } - 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.TensorShapeProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorShapeProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List dim_ = - java.util.Collections.emptyList(); - private void ensureDimIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dim_ = new java.util.ArrayList(dim_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto.Dim, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder, org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder> dimBuilder_; - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List getDimList() { - if (dimBuilder_ == null) { - return java.util.Collections.unmodifiableList(dim_); - } else { - return dimBuilder_.getMessageList(); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public int getDimCount() { - if (dimBuilder_ == null) { - return dim_.size(); - } else { - return dimBuilder_.getCount(); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Dim getDim(int index) { - if (dimBuilder_ == null) { - return dim_.get(index); - } else { - return dimBuilder_.getMessage(index); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder setDim( - int index, org.tensorflow.proto.framework.TensorShapeProto.Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.set(index, value); - onChanged(); - } else { - dimBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder setDim( - int index, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.set(index, builderForValue.build()); - onChanged(); - } else { - dimBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim(org.tensorflow.proto.framework.TensorShapeProto.Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.add(value); - onChanged(); - } else { - dimBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - int index, org.tensorflow.proto.framework.TensorShapeProto.Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.add(index, value); - onChanged(); - } else { - dimBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.add(builderForValue.build()); - onChanged(); - } else { - dimBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - int index, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.add(index, builderForValue.build()); - onChanged(); - } else { - dimBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addAllDim( - java.lang.Iterable values) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dim_); - onChanged(); - } else { - dimBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder clearDim() { - if (dimBuilder_ == null) { - dim_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - dimBuilder_.clear(); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder removeDim(int index) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.remove(index); - onChanged(); - } else { - dimBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder getDimBuilder( - int index) { - return getDimFieldBuilder().getBuilder(index); - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder getDimOrBuilder( - int index) { - if (dimBuilder_ == null) { - return dim_.get(index); } else { - return dimBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimOrBuilderList() { - if (dimBuilder_ != null) { - return dimBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(dim_); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder addDimBuilder() { - return getDimFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorShapeProto.Dim.getDefaultInstance()); - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder addDimBuilder( - int index) { - return getDimFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorShapeProto.Dim.getDefaultInstance()); - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimBuilderList() { - return getDimFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto.Dim, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder, org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder> - getDimFieldBuilder() { - if (dimBuilder_ == null) { - dimBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto.Dim, org.tensorflow.proto.framework.TensorShapeProto.Dim.Builder, org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder>( - dim_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - dim_ = null; - } - return dimBuilder_; - } - - private boolean unknownRank_ ; - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public boolean getUnknownRank() { - return unknownRank_; - } - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public Builder setUnknownRank(boolean value) { - - unknownRank_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public Builder clearUnknownRank() { - - unknownRank_ = false; - 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.TensorShapeProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto) - private static final org.tensorflow.proto.framework.TensorShapeProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorShapeProto(); - } - - public static org.tensorflow.proto.framework.TensorShapeProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorShapeProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorShapeProto(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.TensorShapeProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java deleted file mode 100644 index 7835368954b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -public interface TensorShapeProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - java.util.List - getDimList(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto.Dim getDim(int index); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - int getDimCount(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - java.util.List - getDimOrBuilderList(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto.DimOrBuilder getDimOrBuilder( - int index); - - /** - *
    -   * If true, the number of dimensions in the shape is unknown.
    -   * If true, "dim.size()" must be 0.
    -   * 
    - * - * bool unknown_rank = 3; - */ - boolean getUnknownRank(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtos.java deleted file mode 100644 index e8214c97ec1..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorShapeProtos.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -public final class TensorShapeProtos { - private TensorShapeProtos() {} - 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_TensorShapeProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorShapeProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorShapeProto_Dim_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/framework/tensor_shape" + - ".proto\022\ntensorflow\"z\n\020TensorShapeProto\022-" + - "\n\003dim\030\002 \003(\0132 .tensorflow.TensorShapeProt" + - "o.Dim\022\024\n\014unknown_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004si" + - "ze\030\001 \001(\003\022\014\n\004name\030\002 \001(\tB\215\001\n\036org.tensorflo" + - "w.proto.frameworkB\021TensorShapeProtosP\001ZS" + - "github.com/tensorflow/tensorflow/tensorf" + - "low/go/core/framework/tensor_shape_go_pr" + - "oto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_TensorShapeProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorShapeProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorShapeProto_descriptor, - new java.lang.String[] { "Dim", "UnknownRank", }); - internal_static_tensorflow_TensorShapeProto_Dim_descriptor = - internal_static_tensorflow_TensorShapeProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorShapeProto_Dim_descriptor, - new java.lang.String[] { "Size", "Name", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProto.java deleted file mode 100644 index f1f7b1cf89d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProto.java +++ /dev/null @@ -1,1589 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_slice.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Can only be interpreted if you know the corresponding TensorShape.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorSliceProto} - */ -public final class TensorSliceProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorSliceProto) - TensorSliceProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorSliceProto.newBuilder() to construct. - private TensorSliceProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorSliceProto() { - extent_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorSliceProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorSliceProto( - 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)) { - extent_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - extent_.add( - input.readMessage(org.tensorflow.proto.framework.TensorSliceProto.Extent.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_ & 0x00000001) != 0)) { - extent_ = java.util.Collections.unmodifiableList(extent_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSliceProto.class, org.tensorflow.proto.framework.TensorSliceProto.Builder.class); - } - - public interface ExtentOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorSliceProto.Extent) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Start index of the slice, starting at 0.
    -     * 
    - * - * int64 start = 1; - */ - long getStart(); - - /** - * int64 length = 2; - */ - long getLength(); - - public org.tensorflow.proto.framework.TensorSliceProto.Extent.HasLengthCase getHasLengthCase(); - } - /** - *
    -   * Extent of the slice in one dimension.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorSliceProto.Extent} - */ - public static final class Extent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorSliceProto.Extent) - ExtentOrBuilder { - private static final long serialVersionUID = 0L; - // Use Extent.newBuilder() to construct. - private Extent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Extent() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Extent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Extent( - 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: { - - start_ = input.readInt64(); - break; - } - case 16: { - hasLengthCase_ = 2; - hasLength_ = 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.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSliceProto.Extent.class, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder.class); - } - - private int hasLengthCase_ = 0; - private java.lang.Object hasLength_; - public enum HasLengthCase - implements com.google.protobuf.Internal.EnumLite { - LENGTH(2), - HASLENGTH_NOT_SET(0); - private final int value; - private HasLengthCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static HasLengthCase valueOf(int value) { - return forNumber(value); - } - - public static HasLengthCase forNumber(int value) { - switch (value) { - case 2: return LENGTH; - case 0: return HASLENGTH_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public HasLengthCase - getHasLengthCase() { - return HasLengthCase.forNumber( - hasLengthCase_); - } - - public static final int START_FIELD_NUMBER = 1; - private long start_; - /** - *
    -     * Start index of the slice, starting at 0.
    -     * 
    - * - * int64 start = 1; - */ - public long getStart() { - return start_; - } - - public static final int LENGTH_FIELD_NUMBER = 2; - /** - * int64 length = 2; - */ - public long getLength() { - if (hasLengthCase_ == 2) { - return (java.lang.Long) hasLength_; - } - return 0L; - } - - 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 (start_ != 0L) { - output.writeInt64(1, start_); - } - if (hasLengthCase_ == 2) { - output.writeInt64( - 2, (long)((java.lang.Long) hasLength_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (start_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, start_); - } - if (hasLengthCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 2, (long)((java.lang.Long) hasLength_)); - } - 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.TensorSliceProto.Extent)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorSliceProto.Extent other = (org.tensorflow.proto.framework.TensorSliceProto.Extent) obj; - - if (getStart() - != other.getStart()) return false; - if (!getHasLengthCase().equals(other.getHasLengthCase())) return false; - switch (hasLengthCase_) { - case 2: - if (getLength() - != other.getLength()) return false; - break; - case 0: - default: - } - 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) + START_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStart()); - switch (hasLengthCase_) { - case 2: - hash = (37 * hash) + LENGTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLength()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorSliceProto.Extent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto.Extent 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.TensorSliceProto.Extent 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; - } - /** - *
    -     * Extent of the slice in one dimension.
    -     * 
    - * - * Protobuf type {@code tensorflow.TensorSliceProto.Extent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorSliceProto.Extent) - org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSliceProto.Extent.class, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorSliceProto.Extent.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(); - start_ = 0L; - - hasLengthCase_ = 0; - hasLength_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto.Extent getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorSliceProto.Extent.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto.Extent build() { - org.tensorflow.proto.framework.TensorSliceProto.Extent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto.Extent buildPartial() { - org.tensorflow.proto.framework.TensorSliceProto.Extent result = new org.tensorflow.proto.framework.TensorSliceProto.Extent(this); - result.start_ = start_; - if (hasLengthCase_ == 2) { - result.hasLength_ = hasLength_; - } - result.hasLengthCase_ = hasLengthCase_; - 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.TensorSliceProto.Extent) { - return mergeFrom((org.tensorflow.proto.framework.TensorSliceProto.Extent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorSliceProto.Extent other) { - if (other == org.tensorflow.proto.framework.TensorSliceProto.Extent.getDefaultInstance()) return this; - if (other.getStart() != 0L) { - setStart(other.getStart()); - } - switch (other.getHasLengthCase()) { - case LENGTH: { - setLength(other.getLength()); - break; - } - case HASLENGTH_NOT_SET: { - break; - } - } - 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.TensorSliceProto.Extent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorSliceProto.Extent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int hasLengthCase_ = 0; - private java.lang.Object hasLength_; - public HasLengthCase - getHasLengthCase() { - return HasLengthCase.forNumber( - hasLengthCase_); - } - - public Builder clearHasLength() { - hasLengthCase_ = 0; - hasLength_ = null; - onChanged(); - return this; - } - - - private long start_ ; - /** - *
    -       * Start index of the slice, starting at 0.
    -       * 
    - * - * int64 start = 1; - */ - public long getStart() { - return start_; - } - /** - *
    -       * Start index of the slice, starting at 0.
    -       * 
    - * - * int64 start = 1; - */ - public Builder setStart(long value) { - - start_ = value; - onChanged(); - return this; - } - /** - *
    -       * Start index of the slice, starting at 0.
    -       * 
    - * - * int64 start = 1; - */ - public Builder clearStart() { - - start_ = 0L; - onChanged(); - return this; - } - - /** - * int64 length = 2; - */ - public long getLength() { - if (hasLengthCase_ == 2) { - return (java.lang.Long) hasLength_; - } - return 0L; - } - /** - * int64 length = 2; - */ - public Builder setLength(long value) { - hasLengthCase_ = 2; - hasLength_ = value; - onChanged(); - return this; - } - /** - * int64 length = 2; - */ - public Builder clearLength() { - if (hasLengthCase_ == 2) { - hasLengthCase_ = 0; - hasLength_ = null; - 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.TensorSliceProto.Extent) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorSliceProto.Extent) - private static final org.tensorflow.proto.framework.TensorSliceProto.Extent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorSliceProto.Extent(); - } - - public static org.tensorflow.proto.framework.TensorSliceProto.Extent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Extent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Extent(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.TensorSliceProto.Extent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int EXTENT_FIELD_NUMBER = 1; - private java.util.List extent_; - /** - *
    -   * Extent of the slice in all tensor dimensions.
    -   * Must have one entry for each of the dimension of the tensor that this
    -   * slice belongs to.  The order of sizes is the same as the order of
    -   * dimensions in the TensorShape.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public java.util.List getExtentList() { - return extent_; - } - /** - *
    -   * Extent of the slice in all tensor dimensions.
    -   * Must have one entry for each of the dimension of the tensor that this
    -   * slice belongs to.  The order of sizes is the same as the order of
    -   * dimensions in the TensorShape.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public java.util.List - getExtentOrBuilderList() { - return extent_; - } - /** - *
    -   * Extent of the slice in all tensor dimensions.
    -   * Must have one entry for each of the dimension of the tensor that this
    -   * slice belongs to.  The order of sizes is the same as the order of
    -   * dimensions in the TensorShape.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public int getExtentCount() { - return extent_.size(); - } - /** - *
    -   * Extent of the slice in all tensor dimensions.
    -   * Must have one entry for each of the dimension of the tensor that this
    -   * slice belongs to.  The order of sizes is the same as the order of
    -   * dimensions in the TensorShape.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Extent getExtent(int index) { - return extent_.get(index); - } - /** - *
    -   * Extent of the slice in all tensor dimensions.
    -   * Must have one entry for each of the dimension of the tensor that this
    -   * slice belongs to.  The order of sizes is the same as the order of
    -   * dimensions in the TensorShape.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder( - int index) { - return extent_.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 { - for (int i = 0; i < extent_.size(); i++) { - output.writeMessage(1, extent_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < extent_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, extent_.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.TensorSliceProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorSliceProto other = (org.tensorflow.proto.framework.TensorSliceProto) obj; - - if (!getExtentList() - .equals(other.getExtentList())) 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 (getExtentCount() > 0) { - hash = (37 * hash) + EXTENT_FIELD_NUMBER; - hash = (53 * hash) + getExtentList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorSliceProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto 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.TensorSliceProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto 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.TensorSliceProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSliceProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorSliceProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto 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.TensorSliceProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto 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.TensorSliceProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSliceProto 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.TensorSliceProto 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; - } - /** - *
    -   * Can only be interpreted if you know the corresponding TensorShape.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorSliceProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorSliceProto) - org.tensorflow.proto.framework.TensorSliceProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSliceProto.class, org.tensorflow.proto.framework.TensorSliceProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorSliceProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getExtentFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (extentBuilder_ == null) { - extent_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - extentBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto build() { - org.tensorflow.proto.framework.TensorSliceProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSliceProto buildPartial() { - org.tensorflow.proto.framework.TensorSliceProto result = new org.tensorflow.proto.framework.TensorSliceProto(this); - int from_bitField0_ = bitField0_; - if (extentBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - extent_ = java.util.Collections.unmodifiableList(extent_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.extent_ = extent_; - } else { - result.extent_ = extentBuilder_.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.TensorSliceProto) { - return mergeFrom((org.tensorflow.proto.framework.TensorSliceProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorSliceProto other) { - if (other == org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance()) return this; - if (extentBuilder_ == null) { - if (!other.extent_.isEmpty()) { - if (extent_.isEmpty()) { - extent_ = other.extent_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureExtentIsMutable(); - extent_.addAll(other.extent_); - } - onChanged(); - } - } else { - if (!other.extent_.isEmpty()) { - if (extentBuilder_.isEmpty()) { - extentBuilder_.dispose(); - extentBuilder_ = null; - extent_ = other.extent_; - bitField0_ = (bitField0_ & ~0x00000001); - extentBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getExtentFieldBuilder() : null; - } else { - extentBuilder_.addAllMessages(other.extent_); - } - } - } - 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.TensorSliceProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorSliceProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List extent_ = - java.util.Collections.emptyList(); - private void ensureExtentIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - extent_ = new java.util.ArrayList(extent_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto.Extent, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder, org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder> extentBuilder_; - - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public java.util.List getExtentList() { - if (extentBuilder_ == null) { - return java.util.Collections.unmodifiableList(extent_); - } else { - return extentBuilder_.getMessageList(); - } - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public int getExtentCount() { - if (extentBuilder_ == null) { - return extent_.size(); - } else { - return extentBuilder_.getCount(); - } - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Extent getExtent(int index) { - if (extentBuilder_ == null) { - return extent_.get(index); - } else { - return extentBuilder_.getMessage(index); - } - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder setExtent( - int index, org.tensorflow.proto.framework.TensorSliceProto.Extent value) { - if (extentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExtentIsMutable(); - extent_.set(index, value); - onChanged(); - } else { - extentBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder setExtent( - int index, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder builderForValue) { - if (extentBuilder_ == null) { - ensureExtentIsMutable(); - extent_.set(index, builderForValue.build()); - onChanged(); - } else { - extentBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder addExtent(org.tensorflow.proto.framework.TensorSliceProto.Extent value) { - if (extentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExtentIsMutable(); - extent_.add(value); - onChanged(); - } else { - extentBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder addExtent( - int index, org.tensorflow.proto.framework.TensorSliceProto.Extent value) { - if (extentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureExtentIsMutable(); - extent_.add(index, value); - onChanged(); - } else { - extentBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder addExtent( - org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder builderForValue) { - if (extentBuilder_ == null) { - ensureExtentIsMutable(); - extent_.add(builderForValue.build()); - onChanged(); - } else { - extentBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder addExtent( - int index, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder builderForValue) { - if (extentBuilder_ == null) { - ensureExtentIsMutable(); - extent_.add(index, builderForValue.build()); - onChanged(); - } else { - extentBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder addAllExtent( - java.lang.Iterable values) { - if (extentBuilder_ == null) { - ensureExtentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, extent_); - onChanged(); - } else { - extentBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder clearExtent() { - if (extentBuilder_ == null) { - extent_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - extentBuilder_.clear(); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public Builder removeExtent(int index) { - if (extentBuilder_ == null) { - ensureExtentIsMutable(); - extent_.remove(index); - onChanged(); - } else { - extentBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder getExtentBuilder( - int index) { - return getExtentFieldBuilder().getBuilder(index); - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder( - int index) { - if (extentBuilder_ == null) { - return extent_.get(index); } else { - return extentBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public java.util.List - getExtentOrBuilderList() { - if (extentBuilder_ != null) { - return extentBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(extent_); - } - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder addExtentBuilder() { - return getExtentFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorSliceProto.Extent.getDefaultInstance()); - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder addExtentBuilder( - int index) { - return getExtentFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorSliceProto.Extent.getDefaultInstance()); - } - /** - *
    -     * Extent of the slice in all tensor dimensions.
    -     * Must have one entry for each of the dimension of the tensor that this
    -     * slice belongs to.  The order of sizes is the same as the order of
    -     * dimensions in the TensorShape.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto.Extent extent = 1; - */ - public java.util.List - getExtentBuilderList() { - return getExtentFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto.Extent, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder, org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder> - getExtentFieldBuilder() { - if (extentBuilder_ == null) { - extentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto.Extent, org.tensorflow.proto.framework.TensorSliceProto.Extent.Builder, org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder>( - extent_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - extent_ = null; - } - return extentBuilder_; - } - @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.TensorSliceProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorSliceProto) - private static final org.tensorflow.proto.framework.TensorSliceProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorSliceProto(); - } - - public static org.tensorflow.proto.framework.TensorSliceProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorSliceProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorSliceProto(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.TensorSliceProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtos.java deleted file mode 100644 index 8a3b4497177..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtos.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_slice.proto - -package org.tensorflow.proto.framework; - -public final class TensorSliceProtos { - private TensorSliceProtos() {} - 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_TensorSliceProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorSliceProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorSliceProto_Extent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorSliceProto_Extent_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/framework/tensor_slice" + - ".proto\022\ntensorflow\"\200\001\n\020TensorSliceProto\022" + - "3\n\006extent\030\001 \003(\0132#.tensorflow.TensorSlice" + - "Proto.Extent\0327\n\006Extent\022\r\n\005start\030\001 \001(\003\022\020\n" + - "\006length\030\002 \001(\003H\000B\014\n\nhas_lengthB\215\001\n\036org.te" + - "nsorflow.proto.frameworkB\021TensorSlicePro" + - "tosP\001ZSgithub.com/tensorflow/tensorflow/" + - "tensorflow/go/core/framework/tensor_slic" + - "e_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_TensorSliceProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorSliceProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorSliceProto_descriptor, - new java.lang.String[] { "Extent", }); - internal_static_tensorflow_TensorSliceProto_Extent_descriptor = - internal_static_tensorflow_TensorSliceProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorSliceProto_Extent_descriptor, - new java.lang.String[] { "Start", "Length", "HasLength", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProto.java deleted file mode 100644 index 1dadc728091..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProto.java +++ /dev/null @@ -1,820 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A protobuf to represent tf.TensorSpec.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorSpecProto} - */ -public final class TensorSpecProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorSpecProto) - TensorSpecProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorSpecProto.newBuilder() to construct. - private TensorSpecProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorSpecProto() { - name_ = ""; - dtype_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TensorSpecProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorSpecProto( - 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 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - 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.StructProtos.internal_static_tensorflow_TensorSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TensorSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSpecProto.class, org.tensorflow.proto.framework.TensorSpecProto.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int DTYPE_FIELD_NUMBER = 3; - private int dtype_; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - 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 (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, dtype_); - } - 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 (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, dtype_); - } - 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.TensorSpecProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TensorSpecProto other = (org.tensorflow.proto.framework.TensorSpecProto) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (dtype_ != other.dtype_) 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(); - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TensorSpecProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSpecProto 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.TensorSpecProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSpecProto 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.TensorSpecProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TensorSpecProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TensorSpecProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSpecProto 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.TensorSpecProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSpecProto 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.TensorSpecProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TensorSpecProto 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.TensorSpecProto 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 protobuf to represent tf.TensorSpec.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorSpecProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorSpecProto) - org.tensorflow.proto.framework.TensorSpecProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TensorSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TensorSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TensorSpecProto.class, org.tensorflow.proto.framework.TensorSpecProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorSpecProto.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_ = ""; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - dtype_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TensorSpecProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSpecProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSpecProto build() { - org.tensorflow.proto.framework.TensorSpecProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TensorSpecProto buildPartial() { - org.tensorflow.proto.framework.TensorSpecProto result = new org.tensorflow.proto.framework.TensorSpecProto(this); - result.name_ = name_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.dtype_ = dtype_; - 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.TensorSpecProto) { - return mergeFrom((org.tensorflow.proto.framework.TensorSpecProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TensorSpecProto other) { - if (other == org.tensorflow.proto.framework.TensorSpecProto.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - 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.TensorSpecProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TensorSpecProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 3; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.DataType dtype = 3; - */ - public Builder clearDtype() { - - dtype_ = 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.TensorSpecProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorSpecProto) - private static final org.tensorflow.proto.framework.TensorSpecProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TensorSpecProto(); - } - - public static org.tensorflow.proto.framework.TensorSpecProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TensorSpecProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorSpecProto(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.TensorSpecProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProtoOrBuilder.java deleted file mode 100644 index f9f8ec12d9d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSpecProtoOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface TensorSpecProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorSpecProto) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - java.lang.String getName(); - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - * .tensorflow.DataType dtype = 3; - */ - int getDtypeValue(); - /** - * .tensorflow.DataType dtype = 3; - */ - org.tensorflow.proto.framework.DataType getDtype(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProto.java deleted file mode 100644 index 9894b24788e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProto.java +++ /dev/null @@ -1,739 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.ThreadPoolOptionProto} - */ -public final class ThreadPoolOptionProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ThreadPoolOptionProto) - ThreadPoolOptionProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use ThreadPoolOptionProto.newBuilder() to construct. - private ThreadPoolOptionProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ThreadPoolOptionProto() { - globalName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ThreadPoolOptionProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ThreadPoolOptionProto( - 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: { - - numThreads_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - globalName_ = s; - 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.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ThreadPoolOptionProto.class, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder.class); - } - - public static final int NUM_THREADS_FIELD_NUMBER = 1; - private int numThreads_; - /** - *
    -   * The number of threads in the pool.
    -   * 0 means the system picks a value based on where this option proto is used
    -   * (see the declaration of the specific field for more info).
    -   * 
    - * - * int32 num_threads = 1; - */ - public int getNumThreads() { - return numThreads_; - } - - public static final int GLOBAL_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object globalName_; - /** - *
    -   * The global name of the threadpool.
    -   * If empty, then the threadpool is made and used according to the scope it's
    -   * in - e.g., for a session threadpool, it is used by that session only.
    -   * If non-empty, then:
    -   * - a global threadpool associated with this name is looked
    -   *   up or created. This allows, for example, sharing one threadpool across
    -   *   many sessions (e.g., like the default behavior, if
    -   *   inter_op_parallelism_threads is not configured), but still partitioning
    -   *   into a large and small pool.
    -   * - if the threadpool for this global_name already exists, then it is an
    -   *   error if the existing pool was created using a different num_threads
    -   *   value as is specified on this call.
    -   * - threadpools created this way are never garbage collected.
    -   * 
    - * - * string global_name = 2; - */ - public java.lang.String getGlobalName() { - java.lang.Object ref = globalName_; - 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(); - globalName_ = s; - return s; - } - } - /** - *
    -   * The global name of the threadpool.
    -   * If empty, then the threadpool is made and used according to the scope it's
    -   * in - e.g., for a session threadpool, it is used by that session only.
    -   * If non-empty, then:
    -   * - a global threadpool associated with this name is looked
    -   *   up or created. This allows, for example, sharing one threadpool across
    -   *   many sessions (e.g., like the default behavior, if
    -   *   inter_op_parallelism_threads is not configured), but still partitioning
    -   *   into a large and small pool.
    -   * - if the threadpool for this global_name already exists, then it is an
    -   *   error if the existing pool was created using a different num_threads
    -   *   value as is specified on this call.
    -   * - threadpools created this way are never garbage collected.
    -   * 
    - * - * string global_name = 2; - */ - public com.google.protobuf.ByteString - getGlobalNameBytes() { - java.lang.Object ref = globalName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - globalName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (numThreads_ != 0) { - output.writeInt32(1, numThreads_); - } - if (!getGlobalNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, globalName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (numThreads_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, numThreads_); - } - if (!getGlobalNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, globalName_); - } - 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.ThreadPoolOptionProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ThreadPoolOptionProto other = (org.tensorflow.proto.framework.ThreadPoolOptionProto) obj; - - if (getNumThreads() - != other.getNumThreads()) return false; - if (!getGlobalName() - .equals(other.getGlobalName())) 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) + NUM_THREADS_FIELD_NUMBER; - hash = (53 * hash) + getNumThreads(); - hash = (37 * hash) + GLOBAL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGlobalName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ThreadPoolOptionProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ThreadPoolOptionProto 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.ThreadPoolOptionProto 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.ThreadPoolOptionProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ThreadPoolOptionProto) - org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ThreadPoolOptionProto.class, org.tensorflow.proto.framework.ThreadPoolOptionProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ThreadPoolOptionProto.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(); - numThreads_ = 0; - - globalName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ThreadPoolOptionProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ThreadPoolOptionProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ThreadPoolOptionProto build() { - org.tensorflow.proto.framework.ThreadPoolOptionProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ThreadPoolOptionProto buildPartial() { - org.tensorflow.proto.framework.ThreadPoolOptionProto result = new org.tensorflow.proto.framework.ThreadPoolOptionProto(this); - result.numThreads_ = numThreads_; - result.globalName_ = globalName_; - 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.ThreadPoolOptionProto) { - return mergeFrom((org.tensorflow.proto.framework.ThreadPoolOptionProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ThreadPoolOptionProto other) { - if (other == org.tensorflow.proto.framework.ThreadPoolOptionProto.getDefaultInstance()) return this; - if (other.getNumThreads() != 0) { - setNumThreads(other.getNumThreads()); - } - if (!other.getGlobalName().isEmpty()) { - globalName_ = other.globalName_; - onChanged(); - } - 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.ThreadPoolOptionProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ThreadPoolOptionProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int numThreads_ ; - /** - *
    -     * The number of threads in the pool.
    -     * 0 means the system picks a value based on where this option proto is used
    -     * (see the declaration of the specific field for more info).
    -     * 
    - * - * int32 num_threads = 1; - */ - public int getNumThreads() { - return numThreads_; - } - /** - *
    -     * The number of threads in the pool.
    -     * 0 means the system picks a value based on where this option proto is used
    -     * (see the declaration of the specific field for more info).
    -     * 
    - * - * int32 num_threads = 1; - */ - public Builder setNumThreads(int value) { - - numThreads_ = value; - onChanged(); - return this; - } - /** - *
    -     * The number of threads in the pool.
    -     * 0 means the system picks a value based on where this option proto is used
    -     * (see the declaration of the specific field for more info).
    -     * 
    - * - * int32 num_threads = 1; - */ - public Builder clearNumThreads() { - - numThreads_ = 0; - onChanged(); - return this; - } - - private java.lang.Object globalName_ = ""; - /** - *
    -     * The global name of the threadpool.
    -     * If empty, then the threadpool is made and used according to the scope it's
    -     * in - e.g., for a session threadpool, it is used by that session only.
    -     * If non-empty, then:
    -     * - a global threadpool associated with this name is looked
    -     *   up or created. This allows, for example, sharing one threadpool across
    -     *   many sessions (e.g., like the default behavior, if
    -     *   inter_op_parallelism_threads is not configured), but still partitioning
    -     *   into a large and small pool.
    -     * - if the threadpool for this global_name already exists, then it is an
    -     *   error if the existing pool was created using a different num_threads
    -     *   value as is specified on this call.
    -     * - threadpools created this way are never garbage collected.
    -     * 
    - * - * string global_name = 2; - */ - public java.lang.String getGlobalName() { - java.lang.Object ref = globalName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - globalName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The global name of the threadpool.
    -     * If empty, then the threadpool is made and used according to the scope it's
    -     * in - e.g., for a session threadpool, it is used by that session only.
    -     * If non-empty, then:
    -     * - a global threadpool associated with this name is looked
    -     *   up or created. This allows, for example, sharing one threadpool across
    -     *   many sessions (e.g., like the default behavior, if
    -     *   inter_op_parallelism_threads is not configured), but still partitioning
    -     *   into a large and small pool.
    -     * - if the threadpool for this global_name already exists, then it is an
    -     *   error if the existing pool was created using a different num_threads
    -     *   value as is specified on this call.
    -     * - threadpools created this way are never garbage collected.
    -     * 
    - * - * string global_name = 2; - */ - public com.google.protobuf.ByteString - getGlobalNameBytes() { - java.lang.Object ref = globalName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - globalName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The global name of the threadpool.
    -     * If empty, then the threadpool is made and used according to the scope it's
    -     * in - e.g., for a session threadpool, it is used by that session only.
    -     * If non-empty, then:
    -     * - a global threadpool associated with this name is looked
    -     *   up or created. This allows, for example, sharing one threadpool across
    -     *   many sessions (e.g., like the default behavior, if
    -     *   inter_op_parallelism_threads is not configured), but still partitioning
    -     *   into a large and small pool.
    -     * - if the threadpool for this global_name already exists, then it is an
    -     *   error if the existing pool was created using a different num_threads
    -     *   value as is specified on this call.
    -     * - threadpools created this way are never garbage collected.
    -     * 
    - * - * string global_name = 2; - */ - public Builder setGlobalName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - globalName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The global name of the threadpool.
    -     * If empty, then the threadpool is made and used according to the scope it's
    -     * in - e.g., for a session threadpool, it is used by that session only.
    -     * If non-empty, then:
    -     * - a global threadpool associated with this name is looked
    -     *   up or created. This allows, for example, sharing one threadpool across
    -     *   many sessions (e.g., like the default behavior, if
    -     *   inter_op_parallelism_threads is not configured), but still partitioning
    -     *   into a large and small pool.
    -     * - if the threadpool for this global_name already exists, then it is an
    -     *   error if the existing pool was created using a different num_threads
    -     *   value as is specified on this call.
    -     * - threadpools created this way are never garbage collected.
    -     * 
    - * - * string global_name = 2; - */ - public Builder clearGlobalName() { - - globalName_ = getDefaultInstance().getGlobalName(); - onChanged(); - return this; - } - /** - *
    -     * The global name of the threadpool.
    -     * If empty, then the threadpool is made and used according to the scope it's
    -     * in - e.g., for a session threadpool, it is used by that session only.
    -     * If non-empty, then:
    -     * - a global threadpool associated with this name is looked
    -     *   up or created. This allows, for example, sharing one threadpool across
    -     *   many sessions (e.g., like the default behavior, if
    -     *   inter_op_parallelism_threads is not configured), but still partitioning
    -     *   into a large and small pool.
    -     * - if the threadpool for this global_name already exists, then it is an
    -     *   error if the existing pool was created using a different num_threads
    -     *   value as is specified on this call.
    -     * - threadpools created this way are never garbage collected.
    -     * 
    - * - * string global_name = 2; - */ - public Builder setGlobalNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - globalName_ = value; - 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.ThreadPoolOptionProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ThreadPoolOptionProto) - private static final org.tensorflow.proto.framework.ThreadPoolOptionProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ThreadPoolOptionProto(); - } - - public static org.tensorflow.proto.framework.ThreadPoolOptionProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ThreadPoolOptionProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ThreadPoolOptionProto(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.ThreadPoolOptionProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProtoOrBuilder.java deleted file mode 100644 index d1d3d837519..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ThreadPoolOptionProtoOrBuilder.java +++ /dev/null @@ -1,62 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/config.proto - -package org.tensorflow.proto.framework; - -public interface ThreadPoolOptionProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ThreadPoolOptionProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The number of threads in the pool.
    -   * 0 means the system picks a value based on where this option proto is used
    -   * (see the declaration of the specific field for more info).
    -   * 
    - * - * int32 num_threads = 1; - */ - int getNumThreads(); - - /** - *
    -   * The global name of the threadpool.
    -   * If empty, then the threadpool is made and used according to the scope it's
    -   * in - e.g., for a session threadpool, it is used by that session only.
    -   * If non-empty, then:
    -   * - a global threadpool associated with this name is looked
    -   *   up or created. This allows, for example, sharing one threadpool across
    -   *   many sessions (e.g., like the default behavior, if
    -   *   inter_op_parallelism_threads is not configured), but still partitioning
    -   *   into a large and small pool.
    -   * - if the threadpool for this global_name already exists, then it is an
    -   *   error if the existing pool was created using a different num_threads
    -   *   value as is specified on this call.
    -   * - threadpools created this way are never garbage collected.
    -   * 
    - * - * string global_name = 2; - */ - java.lang.String getGlobalName(); - /** - *
    -   * The global name of the threadpool.
    -   * If empty, then the threadpool is made and used according to the scope it's
    -   * in - e.g., for a session threadpool, it is used by that session only.
    -   * If non-empty, then:
    -   * - a global threadpool associated with this name is looked
    -   *   up or created. This allows, for example, sharing one threadpool across
    -   *   many sessions (e.g., like the default behavior, if
    -   *   inter_op_parallelism_threads is not configured), but still partitioning
    -   *   into a large and small pool.
    -   * - if the threadpool for this global_name already exists, then it is an
    -   *   error if the existing pool was created using a different num_threads
    -   *   value as is specified on this call.
    -   * - threadpools created this way are never garbage collected.
    -   * 
    - * - * string global_name = 2; - */ - com.google.protobuf.ByteString - getGlobalNameBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraph.java deleted file mode 100644 index 5d516f926dc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraph.java +++ /dev/null @@ -1,5141 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trackable_object_graph.proto - -package org.tensorflow.proto.framework; - -/** - * Protobuf type {@code tensorflow.TrackableObjectGraph} - */ -public final class TrackableObjectGraph extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph) - TrackableObjectGraphOrBuilder { -private static final long serialVersionUID = 0L; - // Use TrackableObjectGraph.newBuilder() to construct. - private TrackableObjectGraph(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TrackableObjectGraph() { - nodes_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TrackableObjectGraph(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TrackableObjectGraph( - 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)) { - nodes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - nodes_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.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_ & 0x00000001) != 0)) { - nodes_ = java.util.Collections.unmodifiableList(nodes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.class, org.tensorflow.proto.framework.TrackableObjectGraph.Builder.class); - } - - public interface TrackableObjectOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - java.util.List - getChildrenList(); - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index); - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - int getChildrenCount(); - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - java.util.List - getChildrenOrBuilderList(); - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index); - - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - java.util.List - getAttributesList(); - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index); - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - int getAttributesCount(); - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - java.util.List - getAttributesOrBuilderList(); - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( - int index); - - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - java.util.List - getSlotVariablesList(); - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index); - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - int getSlotVariablesCount(); - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - java.util.List - getSlotVariablesOrBuilderList(); - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index); - } - /** - * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject} - */ - public static final class TrackableObject extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject) - TrackableObjectOrBuilder { - private static final long serialVersionUID = 0L; - // Use TrackableObject.newBuilder() to construct. - private TrackableObject(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TrackableObject() { - children_ = java.util.Collections.emptyList(); - attributes_ = java.util.Collections.emptyList(); - slotVariables_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TrackableObject(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TrackableObject( - 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)) { - children_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - children_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.parser(), extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - attributes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - attributes_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - slotVariables_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - slotVariables_.add( - input.readMessage(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.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_ & 0x00000001) != 0)) { - children_ = java.util.Collections.unmodifiableList(children_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - attributes_ = java.util.Collections.unmodifiableList(attributes_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder.class); - } - - public interface ObjectReferenceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the object
    -       * being referenced.
    -       * 
    - * - * int32 node_id = 1; - */ - int getNodeId(); - - /** - *
    -       * A user-provided name for the edge.
    -       * 
    - * - * string local_name = 2; - */ - java.lang.String getLocalName(); - /** - *
    -       * A user-provided name for the edge.
    -       * 
    - * - * string local_name = 2; - */ - com.google.protobuf.ByteString - getLocalNameBytes(); - } - /** - * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference} - */ - public static final class ObjectReference extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) - ObjectReferenceOrBuilder { - private static final long serialVersionUID = 0L; - // Use ObjectReference.newBuilder() to construct. - private ObjectReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ObjectReference() { - localName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ObjectReference(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ObjectReference( - 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: { - - nodeId_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - localName_ = s; - 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.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder.class); - } - - public static final int NODE_ID_FIELD_NUMBER = 1; - private int nodeId_; - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the object
    -       * being referenced.
    -       * 
    - * - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - - public static final int LOCAL_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object localName_; - /** - *
    -       * A user-provided name for the edge.
    -       * 
    - * - * string local_name = 2; - */ - public java.lang.String getLocalName() { - java.lang.Object ref = localName_; - 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(); - localName_ = s; - return s; - } - } - /** - *
    -       * A user-provided name for the edge.
    -       * 
    - * - * string local_name = 2; - */ - public com.google.protobuf.ByteString - getLocalNameBytes() { - java.lang.Object ref = localName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - localName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (nodeId_ != 0) { - output.writeInt32(1, nodeId_); - } - if (!getLocalNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, localName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (nodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, nodeId_); - } - if (!getLocalNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, localName_); - } - 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.TrackableObjectGraph.TrackableObject.ObjectReference)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference other = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference) obj; - - if (getNodeId() - != other.getNodeId()) return false; - if (!getLocalName() - .equals(other.getLocalName())) 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) + NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getNodeId(); - hash = (37 * hash) + LOCAL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getLocalName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraph.TrackableObject.ObjectReference} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.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(); - nodeId_ = 0; - - localName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference build() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference buildPartial() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference result = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference(this); - result.nodeId_ = nodeId_; - result.localName_ = localName_; - 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.TrackableObjectGraph.TrackableObject.ObjectReference) { - return mergeFrom((org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference other) { - if (other == org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()) return this; - if (other.getNodeId() != 0) { - setNodeId(other.getNodeId()); - } - if (!other.getLocalName().isEmpty()) { - localName_ = other.localName_; - onChanged(); - } - 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.TrackableObjectGraph.TrackableObject.ObjectReference parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int nodeId_ ; - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the object
    -         * being referenced.
    -         * 
    - * - * int32 node_id = 1; - */ - public int getNodeId() { - return nodeId_; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the object
    -         * being referenced.
    -         * 
    - * - * int32 node_id = 1; - */ - public Builder setNodeId(int value) { - - nodeId_ = value; - onChanged(); - return this; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the object
    -         * being referenced.
    -         * 
    - * - * int32 node_id = 1; - */ - public Builder clearNodeId() { - - nodeId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object localName_ = ""; - /** - *
    -         * A user-provided name for the edge.
    -         * 
    - * - * string local_name = 2; - */ - public java.lang.String getLocalName() { - java.lang.Object ref = localName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - localName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -         * A user-provided name for the edge.
    -         * 
    - * - * string local_name = 2; - */ - public com.google.protobuf.ByteString - getLocalNameBytes() { - java.lang.Object ref = localName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - localName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -         * A user-provided name for the edge.
    -         * 
    - * - * string local_name = 2; - */ - public Builder setLocalName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - localName_ = value; - onChanged(); - return this; - } - /** - *
    -         * A user-provided name for the edge.
    -         * 
    - * - * string local_name = 2; - */ - public Builder clearLocalName() { - - localName_ = getDefaultInstance().getLocalName(); - onChanged(); - return this; - } - /** - *
    -         * A user-provided name for the edge.
    -         * 
    - * - * string local_name = 2; - */ - public Builder setLocalNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - localName_ = value; - 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.TrackableObjectGraph.TrackableObject.ObjectReference) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) - private static final org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference(); - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ObjectReference parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ObjectReference(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.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface SerializedTensorOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * A name for the Tensor. Simple variables have only one
    -       * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -       * be restored on object creation as an optimization.
    -       * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -       * A name for the Tensor. Simple variables have only one
    -       * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -       * be restored on object creation as an optimization.
    -       * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -       * The full name of the variable/tensor, if applicable. Used to allow
    -       * name-based loading of checkpoints which were saved using an
    -       * object-based API. Should match the checkpoint key which would have been
    -       * assigned by tf.train.Saver.
    -       * 
    - * - * string full_name = 2; - */ - java.lang.String getFullName(); - /** - *
    -       * The full name of the variable/tensor, if applicable. Used to allow
    -       * name-based loading of checkpoints which were saved using an
    -       * object-based API. Should match the checkpoint key which would have been
    -       * assigned by tf.train.Saver.
    -       * 
    - * - * string full_name = 2; - */ - com.google.protobuf.ByteString - getFullNameBytes(); - - /** - *
    -       * The generated name of the Tensor in the checkpoint.
    -       * 
    - * - * string checkpoint_key = 3; - */ - java.lang.String getCheckpointKey(); - /** - *
    -       * The generated name of the Tensor in the checkpoint.
    -       * 
    - * - * string checkpoint_key = 3; - */ - com.google.protobuf.ByteString - getCheckpointKeyBytes(); - - /** - *
    -       * Whether checkpoints should be considered as matching even without this
    -       * value restored. Used for non-critical values which don't affect the
    -       * TensorFlow graph, such as layer configurations.
    -       * 
    - * - * bool optional_restore = 4; - */ - boolean getOptionalRestore(); - } - /** - * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor} - */ - public static final class SerializedTensor extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) - SerializedTensorOrBuilder { - private static final long serialVersionUID = 0L; - // Use SerializedTensor.newBuilder() to construct. - private SerializedTensor(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SerializedTensor() { - name_ = ""; - fullName_ = ""; - checkpointKey_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SerializedTensor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SerializedTensor( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - fullName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - checkpointKey_ = s; - break; - } - case 32: { - - optionalRestore_ = input.readBool(); - 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.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -       * A name for the Tensor. Simple variables have only one
    -       * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -       * be restored on object creation as an optimization.
    -       * 
    - * - * 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; - } - } - /** - *
    -       * A name for the Tensor. Simple variables have only one
    -       * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -       * be restored on object creation as an optimization.
    -       * 
    - * - * 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 FULL_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object fullName_; - /** - *
    -       * The full name of the variable/tensor, if applicable. Used to allow
    -       * name-based loading of checkpoints which were saved using an
    -       * object-based API. Should match the checkpoint key which would have been
    -       * assigned by tf.train.Saver.
    -       * 
    - * - * string full_name = 2; - */ - public java.lang.String getFullName() { - java.lang.Object ref = fullName_; - 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(); - fullName_ = s; - return s; - } - } - /** - *
    -       * The full name of the variable/tensor, if applicable. Used to allow
    -       * name-based loading of checkpoints which were saved using an
    -       * object-based API. Should match the checkpoint key which would have been
    -       * assigned by tf.train.Saver.
    -       * 
    - * - * string full_name = 2; - */ - public com.google.protobuf.ByteString - getFullNameBytes() { - java.lang.Object ref = fullName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fullName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CHECKPOINT_KEY_FIELD_NUMBER = 3; - private volatile java.lang.Object checkpointKey_; - /** - *
    -       * The generated name of the Tensor in the checkpoint.
    -       * 
    - * - * string checkpoint_key = 3; - */ - public java.lang.String getCheckpointKey() { - java.lang.Object ref = checkpointKey_; - 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(); - checkpointKey_ = s; - return s; - } - } - /** - *
    -       * The generated name of the Tensor in the checkpoint.
    -       * 
    - * - * string checkpoint_key = 3; - */ - public com.google.protobuf.ByteString - getCheckpointKeyBytes() { - java.lang.Object ref = checkpointKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - checkpointKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OPTIONAL_RESTORE_FIELD_NUMBER = 4; - private boolean optionalRestore_; - /** - *
    -       * Whether checkpoints should be considered as matching even without this
    -       * value restored. Used for non-critical values which don't affect the
    -       * TensorFlow graph, such as layer configurations.
    -       * 
    - * - * bool optional_restore = 4; - */ - public boolean getOptionalRestore() { - return optionalRestore_; - } - - 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 (!getFullNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fullName_); - } - if (!getCheckpointKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, checkpointKey_); - } - if (optionalRestore_ != false) { - output.writeBool(4, optionalRestore_); - } - 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 (!getFullNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fullName_); - } - if (!getCheckpointKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, checkpointKey_); - } - if (optionalRestore_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, optionalRestore_); - } - 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.TrackableObjectGraph.TrackableObject.SerializedTensor)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor other = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getFullName() - .equals(other.getFullName())) return false; - if (!getCheckpointKey() - .equals(other.getCheckpointKey())) return false; - if (getOptionalRestore() - != other.getOptionalRestore()) 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) + FULL_NAME_FIELD_NUMBER; - hash = (53 * hash) + getFullName().hashCode(); - hash = (37 * hash) + CHECKPOINT_KEY_FIELD_NUMBER; - hash = (53 * hash) + getCheckpointKey().hashCode(); - hash = (37 * hash) + OPTIONAL_RESTORE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getOptionalRestore()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraph.TrackableObject.SerializedTensor} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.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_ = ""; - - fullName_ = ""; - - checkpointKey_ = ""; - - optionalRestore_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor build() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor buildPartial() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor result = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor(this); - result.name_ = name_; - result.fullName_ = fullName_; - result.checkpointKey_ = checkpointKey_; - result.optionalRestore_ = optionalRestore_; - 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.TrackableObjectGraph.TrackableObject.SerializedTensor) { - return mergeFrom((org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor other) { - if (other == org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getFullName().isEmpty()) { - fullName_ = other.fullName_; - onChanged(); - } - if (!other.getCheckpointKey().isEmpty()) { - checkpointKey_ = other.checkpointKey_; - onChanged(); - } - if (other.getOptionalRestore() != false) { - setOptionalRestore(other.getOptionalRestore()); - } - 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.TrackableObjectGraph.TrackableObject.SerializedTensor parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -         * A name for the Tensor. Simple variables have only one
    -         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -         * be restored on object creation as an optimization.
    -         * 
    - * - * 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; - } - } - /** - *
    -         * A name for the Tensor. Simple variables have only one
    -         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -         * be restored on object creation as an optimization.
    -         * 
    - * - * 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; - } - } - /** - *
    -         * A name for the Tensor. Simple variables have only one
    -         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -         * be restored on object creation as an optimization.
    -         * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -         * A name for the Tensor. Simple variables have only one
    -         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -         * be restored on object creation as an optimization.
    -         * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -         * A name for the Tensor. Simple variables have only one
    -         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    -         * be restored on object creation as an optimization.
    -         * 
    - * - * 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 java.lang.Object fullName_ = ""; - /** - *
    -         * The full name of the variable/tensor, if applicable. Used to allow
    -         * name-based loading of checkpoints which were saved using an
    -         * object-based API. Should match the checkpoint key which would have been
    -         * assigned by tf.train.Saver.
    -         * 
    - * - * string full_name = 2; - */ - public java.lang.String getFullName() { - java.lang.Object ref = fullName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fullName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -         * The full name of the variable/tensor, if applicable. Used to allow
    -         * name-based loading of checkpoints which were saved using an
    -         * object-based API. Should match the checkpoint key which would have been
    -         * assigned by tf.train.Saver.
    -         * 
    - * - * string full_name = 2; - */ - public com.google.protobuf.ByteString - getFullNameBytes() { - java.lang.Object ref = fullName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fullName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -         * The full name of the variable/tensor, if applicable. Used to allow
    -         * name-based loading of checkpoints which were saved using an
    -         * object-based API. Should match the checkpoint key which would have been
    -         * assigned by tf.train.Saver.
    -         * 
    - * - * string full_name = 2; - */ - public Builder setFullName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fullName_ = value; - onChanged(); - return this; - } - /** - *
    -         * The full name of the variable/tensor, if applicable. Used to allow
    -         * name-based loading of checkpoints which were saved using an
    -         * object-based API. Should match the checkpoint key which would have been
    -         * assigned by tf.train.Saver.
    -         * 
    - * - * string full_name = 2; - */ - public Builder clearFullName() { - - fullName_ = getDefaultInstance().getFullName(); - onChanged(); - return this; - } - /** - *
    -         * The full name of the variable/tensor, if applicable. Used to allow
    -         * name-based loading of checkpoints which were saved using an
    -         * object-based API. Should match the checkpoint key which would have been
    -         * assigned by tf.train.Saver.
    -         * 
    - * - * string full_name = 2; - */ - public Builder setFullNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fullName_ = value; - onChanged(); - return this; - } - - private java.lang.Object checkpointKey_ = ""; - /** - *
    -         * The generated name of the Tensor in the checkpoint.
    -         * 
    - * - * string checkpoint_key = 3; - */ - public java.lang.String getCheckpointKey() { - java.lang.Object ref = checkpointKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - checkpointKey_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -         * The generated name of the Tensor in the checkpoint.
    -         * 
    - * - * string checkpoint_key = 3; - */ - public com.google.protobuf.ByteString - getCheckpointKeyBytes() { - java.lang.Object ref = checkpointKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - checkpointKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -         * The generated name of the Tensor in the checkpoint.
    -         * 
    - * - * string checkpoint_key = 3; - */ - public Builder setCheckpointKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - checkpointKey_ = value; - onChanged(); - return this; - } - /** - *
    -         * The generated name of the Tensor in the checkpoint.
    -         * 
    - * - * string checkpoint_key = 3; - */ - public Builder clearCheckpointKey() { - - checkpointKey_ = getDefaultInstance().getCheckpointKey(); - onChanged(); - return this; - } - /** - *
    -         * The generated name of the Tensor in the checkpoint.
    -         * 
    - * - * string checkpoint_key = 3; - */ - public Builder setCheckpointKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - checkpointKey_ = value; - onChanged(); - return this; - } - - private boolean optionalRestore_ ; - /** - *
    -         * Whether checkpoints should be considered as matching even without this
    -         * value restored. Used for non-critical values which don't affect the
    -         * TensorFlow graph, such as layer configurations.
    -         * 
    - * - * bool optional_restore = 4; - */ - public boolean getOptionalRestore() { - return optionalRestore_; - } - /** - *
    -         * Whether checkpoints should be considered as matching even without this
    -         * value restored. Used for non-critical values which don't affect the
    -         * TensorFlow graph, such as layer configurations.
    -         * 
    - * - * bool optional_restore = 4; - */ - public Builder setOptionalRestore(boolean value) { - - optionalRestore_ = value; - onChanged(); - return this; - } - /** - *
    -         * Whether checkpoints should be considered as matching even without this
    -         * value restored. Used for non-critical values which don't affect the
    -         * TensorFlow graph, such as layer configurations.
    -         * 
    - * - * bool optional_restore = 4; - */ - public Builder clearOptionalRestore() { - - optionalRestore_ = false; - 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.TrackableObjectGraph.TrackableObject.SerializedTensor) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) - private static final org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor(); - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SerializedTensor parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SerializedTensor(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.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface SlotVariableReferenceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the
    -       * variable object this slot was created for.
    -       * 
    - * - * int32 original_variable_node_id = 1; - */ - int getOriginalVariableNodeId(); - - /** - *
    -       * The name of the slot (e.g. "m"/"v").
    -       * 
    - * - * string slot_name = 2; - */ - java.lang.String getSlotName(); - /** - *
    -       * The name of the slot (e.g. "m"/"v").
    -       * 
    - * - * string slot_name = 2; - */ - com.google.protobuf.ByteString - getSlotNameBytes(); - - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the
    -       * `Object` with the value of the slot variable.
    -       * 
    - * - * int32 slot_variable_node_id = 3; - */ - int getSlotVariableNodeId(); - } - /** - * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference} - */ - public static final class SlotVariableReference extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) - SlotVariableReferenceOrBuilder { - private static final long serialVersionUID = 0L; - // Use SlotVariableReference.newBuilder() to construct. - private SlotVariableReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SlotVariableReference() { - slotName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SlotVariableReference(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SlotVariableReference( - 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: { - - originalVariableNodeId_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - slotName_ = s; - break; - } - case 24: { - - slotVariableNodeId_ = input.readInt32(); - 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.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder.class); - } - - public static final int ORIGINAL_VARIABLE_NODE_ID_FIELD_NUMBER = 1; - private int originalVariableNodeId_; - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the
    -       * variable object this slot was created for.
    -       * 
    - * - * int32 original_variable_node_id = 1; - */ - public int getOriginalVariableNodeId() { - return originalVariableNodeId_; - } - - public static final int SLOT_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object slotName_; - /** - *
    -       * The name of the slot (e.g. "m"/"v").
    -       * 
    - * - * string slot_name = 2; - */ - public java.lang.String getSlotName() { - java.lang.Object ref = slotName_; - 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(); - slotName_ = s; - return s; - } - } - /** - *
    -       * The name of the slot (e.g. "m"/"v").
    -       * 
    - * - * string slot_name = 2; - */ - public com.google.protobuf.ByteString - getSlotNameBytes() { - java.lang.Object ref = slotName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - slotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SLOT_VARIABLE_NODE_ID_FIELD_NUMBER = 3; - private int slotVariableNodeId_; - /** - *
    -       * An index into `TrackableObjectGraph.nodes`, indicating the
    -       * `Object` with the value of the slot variable.
    -       * 
    - * - * int32 slot_variable_node_id = 3; - */ - public int getSlotVariableNodeId() { - return slotVariableNodeId_; - } - - 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 (originalVariableNodeId_ != 0) { - output.writeInt32(1, originalVariableNodeId_); - } - if (!getSlotNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, slotName_); - } - if (slotVariableNodeId_ != 0) { - output.writeInt32(3, slotVariableNodeId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (originalVariableNodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, originalVariableNodeId_); - } - if (!getSlotNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, slotName_); - } - if (slotVariableNodeId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, slotVariableNodeId_); - } - 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.TrackableObjectGraph.TrackableObject.SlotVariableReference)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference other = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference) obj; - - if (getOriginalVariableNodeId() - != other.getOriginalVariableNodeId()) return false; - if (!getSlotName() - .equals(other.getSlotName())) return false; - if (getSlotVariableNodeId() - != other.getSlotVariableNodeId()) 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) + ORIGINAL_VARIABLE_NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getOriginalVariableNodeId(); - hash = (37 * hash) + SLOT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getSlotName().hashCode(); - hash = (37 * hash) + SLOT_VARIABLE_NODE_ID_FIELD_NUMBER; - hash = (53 * hash) + getSlotVariableNodeId(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraph.TrackableObject.SlotVariableReference} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.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(); - originalVariableNodeId_ = 0; - - slotName_ = ""; - - slotVariableNodeId_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference build() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference buildPartial() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference result = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference(this); - result.originalVariableNodeId_ = originalVariableNodeId_; - result.slotName_ = slotName_; - result.slotVariableNodeId_ = slotVariableNodeId_; - 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.TrackableObjectGraph.TrackableObject.SlotVariableReference) { - return mergeFrom((org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference other) { - if (other == org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()) return this; - if (other.getOriginalVariableNodeId() != 0) { - setOriginalVariableNodeId(other.getOriginalVariableNodeId()); - } - if (!other.getSlotName().isEmpty()) { - slotName_ = other.slotName_; - onChanged(); - } - if (other.getSlotVariableNodeId() != 0) { - setSlotVariableNodeId(other.getSlotVariableNodeId()); - } - 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.TrackableObjectGraph.TrackableObject.SlotVariableReference parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int originalVariableNodeId_ ; - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * variable object this slot was created for.
    -         * 
    - * - * int32 original_variable_node_id = 1; - */ - public int getOriginalVariableNodeId() { - return originalVariableNodeId_; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * variable object this slot was created for.
    -         * 
    - * - * int32 original_variable_node_id = 1; - */ - public Builder setOriginalVariableNodeId(int value) { - - originalVariableNodeId_ = value; - onChanged(); - return this; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * variable object this slot was created for.
    -         * 
    - * - * int32 original_variable_node_id = 1; - */ - public Builder clearOriginalVariableNodeId() { - - originalVariableNodeId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object slotName_ = ""; - /** - *
    -         * The name of the slot (e.g. "m"/"v").
    -         * 
    - * - * string slot_name = 2; - */ - public java.lang.String getSlotName() { - java.lang.Object ref = slotName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - slotName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -         * The name of the slot (e.g. "m"/"v").
    -         * 
    - * - * string slot_name = 2; - */ - public com.google.protobuf.ByteString - getSlotNameBytes() { - java.lang.Object ref = slotName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - slotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -         * The name of the slot (e.g. "m"/"v").
    -         * 
    - * - * string slot_name = 2; - */ - public Builder setSlotName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - slotName_ = value; - onChanged(); - return this; - } - /** - *
    -         * The name of the slot (e.g. "m"/"v").
    -         * 
    - * - * string slot_name = 2; - */ - public Builder clearSlotName() { - - slotName_ = getDefaultInstance().getSlotName(); - onChanged(); - return this; - } - /** - *
    -         * The name of the slot (e.g. "m"/"v").
    -         * 
    - * - * string slot_name = 2; - */ - public Builder setSlotNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - slotName_ = value; - onChanged(); - return this; - } - - private int slotVariableNodeId_ ; - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * `Object` with the value of the slot variable.
    -         * 
    - * - * int32 slot_variable_node_id = 3; - */ - public int getSlotVariableNodeId() { - return slotVariableNodeId_; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * `Object` with the value of the slot variable.
    -         * 
    - * - * int32 slot_variable_node_id = 3; - */ - public Builder setSlotVariableNodeId(int value) { - - slotVariableNodeId_ = value; - onChanged(); - return this; - } - /** - *
    -         * An index into `TrackableObjectGraph.nodes`, indicating the
    -         * `Object` with the value of the slot variable.
    -         * 
    - * - * int32 slot_variable_node_id = 3; - */ - public Builder clearSlotVariableNodeId() { - - slotVariableNodeId_ = 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.TrackableObjectGraph.TrackableObject.SlotVariableReference) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) - private static final org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference(); - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SlotVariableReference parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SlotVariableReference(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.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int CHILDREN_FIELD_NUMBER = 1; - private java.util.List children_; - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List getChildrenList() { - return children_; - } - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenOrBuilderList() { - return children_; - } - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public int getChildrenCount() { - return children_.size(); - } - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { - return children_.get(index); - } - /** - *
    -     * Objects which this object depends on.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index) { - return children_.get(index); - } - - public static final int ATTRIBUTES_FIELD_NUMBER = 2; - private java.util.List attributes_; - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public java.util.List getAttributesList() { - return attributes_; - } - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public java.util.List - getAttributesOrBuilderList() { - return attributes_; - } - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public int getAttributesCount() { - return attributes_.size(); - } - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index) { - return attributes_.get(index); - } - /** - *
    -     * Serialized data specific to this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( - int index) { - return attributes_.get(index); - } - - public static final int SLOT_VARIABLES_FIELD_NUMBER = 3; - private java.util.List slotVariables_; - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List getSlotVariablesList() { - return slotVariables_; - } - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesOrBuilderList() { - return slotVariables_; - } - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public int getSlotVariablesCount() { - return slotVariables_.size(); - } - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { - return slotVariables_.get(index); - } - /** - *
    -     * Slot variables owned by this object.
    -     * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index) { - return slotVariables_.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 { - for (int i = 0; i < children_.size(); i++) { - output.writeMessage(1, children_.get(i)); - } - for (int i = 0; i < attributes_.size(); i++) { - output.writeMessage(2, attributes_.get(i)); - } - for (int i = 0; i < slotVariables_.size(); i++) { - output.writeMessage(3, slotVariables_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < children_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, children_.get(i)); - } - for (int i = 0; i < attributes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, attributes_.get(i)); - } - for (int i = 0; i < slotVariables_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, slotVariables_.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.TrackableObjectGraph.TrackableObject)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject other = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject) obj; - - if (!getChildrenList() - .equals(other.getChildrenList())) return false; - if (!getAttributesList() - .equals(other.getAttributesList())) return false; - if (!getSlotVariablesList() - .equals(other.getSlotVariablesList())) 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 (getChildrenCount() > 0) { - hash = (37 * hash) + CHILDREN_FIELD_NUMBER; - hash = (53 * hash) + getChildrenList().hashCode(); - } - if (getAttributesCount() > 0) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + getAttributesList().hashCode(); - } - if (getSlotVariablesCount() > 0) { - hash = (37 * hash) + SLOT_VARIABLES_FIELD_NUMBER; - hash = (53 * hash) + getSlotVariablesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraph.TrackableObject} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject) - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.class, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getChildrenFieldBuilder(); - getAttributesFieldBuilder(); - getSlotVariablesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - childrenBuilder_.clear(); - } - if (attributesBuilder_ == null) { - attributes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - attributesBuilder_.clear(); - } - if (slotVariablesBuilder_ == null) { - slotVariables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - slotVariablesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject build() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject buildPartial() { - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject result = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject(this); - int from_bitField0_ = bitField0_; - if (childrenBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - children_ = java.util.Collections.unmodifiableList(children_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.children_ = children_; - } else { - result.children_ = childrenBuilder_.build(); - } - if (attributesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - attributes_ = java.util.Collections.unmodifiableList(attributes_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.attributes_ = attributes_; - } else { - result.attributes_ = attributesBuilder_.build(); - } - if (slotVariablesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.slotVariables_ = slotVariables_; - } else { - result.slotVariables_ = slotVariablesBuilder_.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.TrackableObjectGraph.TrackableObject) { - return mergeFrom((org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject other) { - if (other == org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.getDefaultInstance()) return this; - if (childrenBuilder_ == null) { - if (!other.children_.isEmpty()) { - if (children_.isEmpty()) { - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureChildrenIsMutable(); - children_.addAll(other.children_); - } - onChanged(); - } - } else { - if (!other.children_.isEmpty()) { - if (childrenBuilder_.isEmpty()) { - childrenBuilder_.dispose(); - childrenBuilder_ = null; - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000001); - childrenBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getChildrenFieldBuilder() : null; - } else { - childrenBuilder_.addAllMessages(other.children_); - } - } - } - if (attributesBuilder_ == null) { - if (!other.attributes_.isEmpty()) { - if (attributes_.isEmpty()) { - attributes_ = other.attributes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAttributesIsMutable(); - attributes_.addAll(other.attributes_); - } - onChanged(); - } - } else { - if (!other.attributes_.isEmpty()) { - if (attributesBuilder_.isEmpty()) { - attributesBuilder_.dispose(); - attributesBuilder_ = null; - attributes_ = other.attributes_; - bitField0_ = (bitField0_ & ~0x00000002); - attributesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttributesFieldBuilder() : null; - } else { - attributesBuilder_.addAllMessages(other.attributes_); - } - } - } - if (slotVariablesBuilder_ == null) { - if (!other.slotVariables_.isEmpty()) { - if (slotVariables_.isEmpty()) { - slotVariables_ = other.slotVariables_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureSlotVariablesIsMutable(); - slotVariables_.addAll(other.slotVariables_); - } - onChanged(); - } - } else { - if (!other.slotVariables_.isEmpty()) { - if (slotVariablesBuilder_.isEmpty()) { - slotVariablesBuilder_.dispose(); - slotVariablesBuilder_ = null; - slotVariables_ = other.slotVariables_; - bitField0_ = (bitField0_ & ~0x00000004); - slotVariablesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSlotVariablesFieldBuilder() : null; - } else { - slotVariablesBuilder_.addAllMessages(other.slotVariables_); - } - } - } - 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.TrackableObjectGraph.TrackableObject parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List children_ = - java.util.Collections.emptyList(); - private void ensureChildrenIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - children_ = new java.util.ArrayList(children_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> childrenBuilder_; - - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List getChildrenList() { - if (childrenBuilder_ == null) { - return java.util.Collections.unmodifiableList(children_); - } else { - return childrenBuilder_.getMessageList(); - } - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public int getChildrenCount() { - if (childrenBuilder_ == null) { - return children_.size(); - } else { - return childrenBuilder_.getCount(); - } - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { - if (childrenBuilder_ == null) { - return children_.get(index); - } else { - return childrenBuilder_.getMessage(index); - } - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder setChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.set(index, value); - onChanged(); - } else { - childrenBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder setChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.set(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(value); - onChanged(); - } else { - childrenBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference value) { - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(index, value); - onChanged(); - } else { - childrenBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addChildren( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder addAllChildren( - java.lang.Iterable values) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, children_); - onChanged(); - } else { - childrenBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder clearChildren() { - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - childrenBuilder_.clear(); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public Builder removeChildren(int index) { - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.remove(index); - onChanged(); - } else { - childrenBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder getChildrenBuilder( - int index) { - return getChildrenFieldBuilder().getBuilder(index); - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( - int index) { - if (childrenBuilder_ == null) { - return children_.get(index); } else { - return childrenBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenOrBuilderList() { - if (childrenBuilder_ != null) { - return childrenBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(children_); - } - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder() { - return getChildrenFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder( - int index) { - return getChildrenFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); - } - /** - *
    -       * Objects which this object depends on.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; - */ - public java.util.List - getChildrenBuilderList() { - return getChildrenFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> - getChildrenFieldBuilder() { - if (childrenBuilder_ == null) { - childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder>( - children_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - children_ = null; - } - return childrenBuilder_; - } - - private java.util.List attributes_ = - java.util.Collections.emptyList(); - private void ensureAttributesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - attributes_ = new java.util.ArrayList(attributes_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder> attributesBuilder_; - - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public java.util.List getAttributesList() { - if (attributesBuilder_ == null) { - return java.util.Collections.unmodifiableList(attributes_); - } else { - return attributesBuilder_.getMessageList(); - } - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public int getAttributesCount() { - if (attributesBuilder_ == null) { - return attributes_.size(); - } else { - return attributesBuilder_.getCount(); - } - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index) { - if (attributesBuilder_ == null) { - return attributes_.get(index); - } else { - return attributesBuilder_.getMessage(index); - } - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder setAttributes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor value) { - if (attributesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttributesIsMutable(); - attributes_.set(index, value); - onChanged(); - } else { - attributesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder setAttributes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { - if (attributesBuilder_ == null) { - ensureAttributesIsMutable(); - attributes_.set(index, builderForValue.build()); - onChanged(); - } else { - attributesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder addAttributes(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor value) { - if (attributesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttributesIsMutable(); - attributes_.add(value); - onChanged(); - } else { - attributesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder addAttributes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor value) { - if (attributesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttributesIsMutable(); - attributes_.add(index, value); - onChanged(); - } else { - attributesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder addAttributes( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { - if (attributesBuilder_ == null) { - ensureAttributesIsMutable(); - attributes_.add(builderForValue.build()); - onChanged(); - } else { - attributesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder addAttributes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { - if (attributesBuilder_ == null) { - ensureAttributesIsMutable(); - attributes_.add(index, builderForValue.build()); - onChanged(); - } else { - attributesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder addAllAttributes( - java.lang.Iterable values) { - if (attributesBuilder_ == null) { - ensureAttributesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attributes_); - onChanged(); - } else { - attributesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder clearAttributes() { - if (attributesBuilder_ == null) { - attributes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - attributesBuilder_.clear(); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public Builder removeAttributes(int index) { - if (attributesBuilder_ == null) { - ensureAttributesIsMutable(); - attributes_.remove(index); - onChanged(); - } else { - attributesBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder getAttributesBuilder( - int index) { - return getAttributesFieldBuilder().getBuilder(index); - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( - int index) { - if (attributesBuilder_ == null) { - return attributes_.get(index); } else { - return attributesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public java.util.List - getAttributesOrBuilderList() { - if (attributesBuilder_ != null) { - return attributesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attributes_); - } - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder addAttributesBuilder() { - return getAttributesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()); - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder addAttributesBuilder( - int index) { - return getAttributesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()); - } - /** - *
    -       * Serialized data specific to this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; - */ - public java.util.List - getAttributesBuilderList() { - return getAttributesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder> - getAttributesFieldBuilder() { - if (attributesBuilder_ == null) { - attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder>( - attributes_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - attributes_ = null; - } - return attributesBuilder_; - } - - private java.util.List slotVariables_ = - java.util.Collections.emptyList(); - private void ensureSlotVariablesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - slotVariables_ = new java.util.ArrayList(slotVariables_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> slotVariablesBuilder_; - - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List getSlotVariablesList() { - if (slotVariablesBuilder_ == null) { - return java.util.Collections.unmodifiableList(slotVariables_); - } else { - return slotVariablesBuilder_.getMessageList(); - } - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public int getSlotVariablesCount() { - if (slotVariablesBuilder_ == null) { - return slotVariables_.size(); - } else { - return slotVariablesBuilder_.getCount(); - } - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { - if (slotVariablesBuilder_ == null) { - return slotVariables_.get(index); - } else { - return slotVariablesBuilder_.getMessage(index); - } - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder setSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.set(index, value); - onChanged(); - } else { - slotVariablesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder setSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.set(index, builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.add(value); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { - if (slotVariablesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlotVariablesIsMutable(); - slotVariables_.add(index, value); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.add(builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addSlotVariables( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.add(index, builderForValue.build()); - onChanged(); - } else { - slotVariablesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder addAllSlotVariables( - java.lang.Iterable values) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, slotVariables_); - onChanged(); - } else { - slotVariablesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder clearSlotVariables() { - if (slotVariablesBuilder_ == null) { - slotVariables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - slotVariablesBuilder_.clear(); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public Builder removeSlotVariables(int index) { - if (slotVariablesBuilder_ == null) { - ensureSlotVariablesIsMutable(); - slotVariables_.remove(index); - onChanged(); - } else { - slotVariablesBuilder_.remove(index); - } - return this; - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder getSlotVariablesBuilder( - int index) { - return getSlotVariablesFieldBuilder().getBuilder(index); - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( - int index) { - if (slotVariablesBuilder_ == null) { - return slotVariables_.get(index); } else { - return slotVariablesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesOrBuilderList() { - if (slotVariablesBuilder_ != null) { - return slotVariablesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(slotVariables_); - } - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder() { - return getSlotVariablesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder( - int index) { - return getSlotVariablesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); - } - /** - *
    -       * Slot variables owned by this object.
    -       * 
    - * - * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; - */ - public java.util.List - getSlotVariablesBuilderList() { - return getSlotVariablesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> - getSlotVariablesFieldBuilder() { - if (slotVariablesBuilder_ == null) { - slotVariablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder>( - slotVariables_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - slotVariables_ = null; - } - return slotVariablesBuilder_; - } - @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.TrackableObjectGraph.TrackableObject) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject) - private static final org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject(); - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TrackableObject parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TrackableObject(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.TrackableObjectGraph.TrackableObject getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NODES_FIELD_NUMBER = 1; - private java.util.List nodes_; - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public java.util.List getNodesList() { - return nodes_; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public java.util.List - getNodesOrBuilderList() { - return nodes_; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public int getNodesCount() { - return nodes_.size(); - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject getNodes(int index) { - return nodes_.get(index); - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( - int index) { - return nodes_.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 { - for (int i = 0; i < nodes_.size(); i++) { - output.writeMessage(1, nodes_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < nodes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, nodes_.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.TrackableObjectGraph)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TrackableObjectGraph other = (org.tensorflow.proto.framework.TrackableObjectGraph) obj; - - if (!getNodesList() - .equals(other.getNodesList())) 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 (getNodesCount() > 0) { - hash = (37 * hash) + NODES_FIELD_NUMBER; - hash = (53 * hash) + getNodesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph 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.TrackableObjectGraph parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph 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.TrackableObjectGraph parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph 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.TrackableObjectGraph parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph 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.TrackableObjectGraph parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TrackableObjectGraph 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.TrackableObjectGraph 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.TrackableObjectGraph} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph) - org.tensorflow.proto.framework.TrackableObjectGraphOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TrackableObjectGraph.class, org.tensorflow.proto.framework.TrackableObjectGraph.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TrackableObjectGraph.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNodesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (nodesBuilder_ == null) { - nodes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - nodesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TrackableObjectGraphProtos.internal_static_tensorflow_TrackableObjectGraph_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TrackableObjectGraph.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph build() { - org.tensorflow.proto.framework.TrackableObjectGraph result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TrackableObjectGraph buildPartial() { - org.tensorflow.proto.framework.TrackableObjectGraph result = new org.tensorflow.proto.framework.TrackableObjectGraph(this); - int from_bitField0_ = bitField0_; - if (nodesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - nodes_ = java.util.Collections.unmodifiableList(nodes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.nodes_ = nodes_; - } else { - result.nodes_ = nodesBuilder_.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.TrackableObjectGraph) { - return mergeFrom((org.tensorflow.proto.framework.TrackableObjectGraph)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TrackableObjectGraph other) { - if (other == org.tensorflow.proto.framework.TrackableObjectGraph.getDefaultInstance()) return this; - if (nodesBuilder_ == null) { - if (!other.nodes_.isEmpty()) { - if (nodes_.isEmpty()) { - nodes_ = other.nodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNodesIsMutable(); - nodes_.addAll(other.nodes_); - } - onChanged(); - } - } else { - if (!other.nodes_.isEmpty()) { - if (nodesBuilder_.isEmpty()) { - nodesBuilder_.dispose(); - nodesBuilder_ = null; - nodes_ = other.nodes_; - bitField0_ = (bitField0_ & ~0x00000001); - nodesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNodesFieldBuilder() : null; - } else { - nodesBuilder_.addAllMessages(other.nodes_); - } - } - } - 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.TrackableObjectGraph parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TrackableObjectGraph) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List nodes_ = - java.util.Collections.emptyList(); - private void ensureNodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - nodes_ = new java.util.ArrayList(nodes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder> nodesBuilder_; - - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public java.util.List getNodesList() { - if (nodesBuilder_ == null) { - return java.util.Collections.unmodifiableList(nodes_); - } else { - return nodesBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public int getNodesCount() { - if (nodesBuilder_ == null) { - return nodes_.size(); - } else { - return nodesBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject getNodes(int index) { - if (nodesBuilder_ == null) { - return nodes_.get(index); - } else { - return nodesBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder setNodes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.set(index, value); - onChanged(); - } else { - nodesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder setNodes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.set(index, builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder addNodes(org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.add(value); - onChanged(); - } else { - nodesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder addNodes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject value) { - if (nodesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNodesIsMutable(); - nodes_.add(index, value); - onChanged(); - } else { - nodesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder addNodes( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.add(builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder addNodes( - int index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder builderForValue) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.add(index, builderForValue.build()); - onChanged(); - } else { - nodesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder addAllNodes( - java.lang.Iterable values) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nodes_); - onChanged(); - } else { - nodesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder clearNodes() { - if (nodesBuilder_ == null) { - nodes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - nodesBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public Builder removeNodes(int index) { - if (nodesBuilder_ == null) { - ensureNodesIsMutable(); - nodes_.remove(index); - onChanged(); - } else { - nodesBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder getNodesBuilder( - int index) { - return getNodesFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( - int index) { - if (nodesBuilder_ == null) { - return nodes_.get(index); } else { - return nodesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public java.util.List - getNodesOrBuilderList() { - if (nodesBuilder_ != null) { - return nodesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nodes_); - } - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder addNodesBuilder() { - return getNodesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.getDefaultInstance()); - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder addNodesBuilder( - int index) { - return getNodesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.getDefaultInstance()); - } - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - public java.util.List - getNodesBuilderList() { - return getNodesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder> - getNodesFieldBuilder() { - if (nodesBuilder_ == null) { - nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder>( - nodes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - nodes_ = null; - } - return nodesBuilder_; - } - @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.TrackableObjectGraph) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph) - private static final org.tensorflow.proto.framework.TrackableObjectGraph DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TrackableObjectGraph(); - } - - public static org.tensorflow.proto.framework.TrackableObjectGraph getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TrackableObjectGraph parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TrackableObjectGraph(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.TrackableObjectGraph getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphOrBuilder.java deleted file mode 100644 index b099d054d9a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trackable_object_graph.proto - -package org.tensorflow.proto.framework; - -public interface TrackableObjectGraphOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - java.util.List - getNodesList(); - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObject getNodes(int index); - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - int getNodesCount(); - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - java.util.List - getNodesOrBuilderList(); - /** - * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; - */ - org.tensorflow.proto.framework.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( - 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 deleted file mode 100644 index 6bde2fbe86e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TrackableObjectGraphProtos.java +++ /dev/null @@ -1,111 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/trackable_object_graph.proto - -package org.tensorflow.proto.framework; - -public final class TrackableObjectGraphProtos { - private TrackableObjectGraphProtos() {} - 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_TrackableObjectGraph_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n5tensorflow/core/protobuf/trackable_obj" + - "ect_graph.proto\022\ntensorflow\"\203\005\n\024Trackabl" + - "eObjectGraph\022?\n\005nodes\030\001 \003(\01320.tensorflow" + - ".TrackableObjectGraph.TrackableObject\032\251\004" + - "\n\017TrackableObject\022R\n\010children\030\001 \003(\0132@.te" + - "nsorflow.TrackableObjectGraph.TrackableO" + - "bject.ObjectReference\022U\n\nattributes\030\002 \003(" + - "\0132A.tensorflow.TrackableObjectGraph.Trac" + - "kableObject.SerializedTensor\022^\n\016slot_var" + - "iables\030\003 \003(\0132F.tensorflow.TrackableObjec" + - "tGraph.TrackableObject.SlotVariableRefer" + - "ence\0326\n\017ObjectReference\022\017\n\007node_id\030\001 \001(\005" + - "\022\022\n\nlocal_name\030\002 \001(\t\032e\n\020SerializedTensor" + - "\022\014\n\004name\030\001 \001(\t\022\021\n\tfull_name\030\002 \001(\t\022\026\n\016che" + - "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\230\001\n\036or" + - "g.tensorflow.proto.frameworkB\032TrackableO" + - "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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_TrackableObjectGraph_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TrackableObjectGraph_descriptor, - new java.lang.String[] { "Nodes", }); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor = - internal_static_tensorflow_TrackableObjectGraph_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor, - new java.lang.String[] { "Children", "Attributes", "SlotVariables", }); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor = - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor, - new java.lang.String[] { "NodeId", "LocalName", }); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor = - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor, - new java.lang.String[] { "Name", "FullName", "CheckpointKey", "OptionalRestore", }); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor = - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor, - new java.lang.String[] { "OriginalVariableNodeId", "SlotName", "SlotVariableNodeId", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValue.java deleted file mode 100644 index 68f4c9d8d0b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValue.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a Python tuple.
    - * 
    - * - * Protobuf type {@code tensorflow.TupleValue} - */ -public final class TupleValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TupleValue) - TupleValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use TupleValue.newBuilder() to construct. - private TupleValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TupleValue() { - values_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TupleValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TupleValue( - 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)) { - values_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - values_.add( - input.readMessage(org.tensorflow.proto.framework.StructuredValue.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_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TupleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TupleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TupleValue.class, org.tensorflow.proto.framework.TupleValue.Builder.class); - } - - public static final int VALUES_FIELD_NUMBER = 1; - private java.util.List values_; - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List getValuesList() { - return values_; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesOrBuilderList() { - return values_; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public int getValuesCount() { - return values_.size(); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getValues(int index) { - return values_.get(index); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index) { - return values_.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 { - for (int i = 0; i < values_.size(); i++) { - output.writeMessage(1, values_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < values_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, values_.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.TupleValue)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TupleValue other = (org.tensorflow.proto.framework.TupleValue) obj; - - if (!getValuesList() - .equals(other.getValuesList())) 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 (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TupleValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TupleValue 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.TupleValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TupleValue 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.TupleValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TupleValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TupleValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TupleValue 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.TupleValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TupleValue 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.TupleValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TupleValue 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.TupleValue 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; - } - /** - *
    -   * Represents a Python tuple.
    -   * 
    - * - * Protobuf type {@code tensorflow.TupleValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TupleValue) - org.tensorflow.proto.framework.TupleValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TupleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TupleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TupleValue.class, org.tensorflow.proto.framework.TupleValue.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TupleValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getValuesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - valuesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TupleValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TupleValue getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TupleValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TupleValue build() { - org.tensorflow.proto.framework.TupleValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TupleValue buildPartial() { - org.tensorflow.proto.framework.TupleValue result = new org.tensorflow.proto.framework.TupleValue(this); - int from_bitField0_ = bitField0_; - if (valuesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.values_ = values_; - } else { - result.values_ = valuesBuilder_.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.TupleValue) { - return mergeFrom((org.tensorflow.proto.framework.TupleValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TupleValue other) { - if (other == org.tensorflow.proto.framework.TupleValue.getDefaultInstance()) return this; - if (valuesBuilder_ == null) { - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - } else { - if (!other.values_.isEmpty()) { - if (valuesBuilder_.isEmpty()) { - valuesBuilder_.dispose(); - valuesBuilder_ = null; - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - valuesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getValuesFieldBuilder() : null; - } else { - valuesBuilder_.addAllMessages(other.values_); - } - } - } - 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.TupleValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TupleValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List values_ = - java.util.Collections.emptyList(); - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - values_ = new java.util.ArrayList(values_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> valuesBuilder_; - - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List getValuesList() { - if (valuesBuilder_ == null) { - return java.util.Collections.unmodifiableList(values_); - } else { - return valuesBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public int getValuesCount() { - if (valuesBuilder_ == null) { - return values_.size(); - } else { - return valuesBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue getValues(int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - } else { - valuesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder setValues( - int index, org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.set(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues(org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - } else { - valuesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.StructuredValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(index, value); - onChanged(); - } else { - valuesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addValues( - int index, org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder addAllValues( - java.lang.Iterable values) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - } else { - valuesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder clearValues() { - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - valuesBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public Builder removeValues(int index) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.remove(index); - onChanged(); - } else { - valuesBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getValuesBuilder( - int index) { - return getValuesFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index) { - if (valuesBuilder_ == null) { - return values_.get(index); } else { - return valuesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesOrBuilderList() { - if (valuesBuilder_ != null) { - return valuesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(values_); - } - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder addValuesBuilder() { - return getValuesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder addValuesBuilder( - int index) { - return getValuesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.StructuredValue.getDefaultInstance()); - } - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - public java.util.List - getValuesBuilderList() { - return getValuesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getValuesFieldBuilder() { - if (valuesBuilder_ == null) { - valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - values_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - values_ = null; - } - return valuesBuilder_; - } - @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.TupleValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TupleValue) - private static final org.tensorflow.proto.framework.TupleValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TupleValue(); - } - - public static org.tensorflow.proto.framework.TupleValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TupleValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TupleValue(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.TupleValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValueOrBuilder.java deleted file mode 100644 index aea74c1d73b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TupleValueOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface TupleValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TupleValue) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - java.util.List - getValuesList(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - org.tensorflow.proto.framework.StructuredValue getValues(int index); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - int getValuesCount(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - java.util.List - getValuesOrBuilderList(); - /** - * repeated .tensorflow.StructuredValue values = 1; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getValuesOrBuilder( - int index); -} 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 deleted file mode 100644 index 5701328f21f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProto.java +++ /dev/null @@ -1,1238 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Represents a tf.TypeSpec
    - * 
    - * - * Protobuf type {@code tensorflow.TypeSpecProto} - */ -public final class TypeSpecProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TypeSpecProto) - TypeSpecProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TypeSpecProto.newBuilder() to construct. - private TypeSpecProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TypeSpecProto() { - typeSpecClass_ = 0; - typeSpecClassName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TypeSpecProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TypeSpecProto( - 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: { - int rawValue = input.readEnum(); - - typeSpecClass_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.StructuredValue.Builder subBuilder = null; - if (typeState_ != null) { - subBuilder = typeState_.toBuilder(); - } - typeState_ = input.readMessage(org.tensorflow.proto.framework.StructuredValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(typeState_); - typeState_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - typeSpecClassName_ = s; - 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.StructProtos.internal_static_tensorflow_TypeSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TypeSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TypeSpecProto.class, org.tensorflow.proto.framework.TypeSpecProto.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.TypeSpecProto.TypeSpecClass} - */ - public enum TypeSpecClass - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - *
    -     * tf.SparseTensorSpec
    -     * 
    - * - * SPARSE_TENSOR_SPEC = 1; - */ - SPARSE_TENSOR_SPEC(1), - /** - *
    -     * tf.IndexedSlicesSpec
    -     * 
    - * - * INDEXED_SLICES_SPEC = 2; - */ - INDEXED_SLICES_SPEC(2), - /** - *
    -     * tf.RaggedTensorSpec
    -     * 
    - * - * RAGGED_TENSOR_SPEC = 3; - */ - RAGGED_TENSOR_SPEC(3), - /** - *
    -     * tf.TensorArraySpec
    -     * 
    - * - * TENSOR_ARRAY_SPEC = 4; - */ - TENSOR_ARRAY_SPEC(4), - /** - *
    -     * tf.data.DatasetSpec
    -     * 
    - * - * DATA_DATASET_SPEC = 5; - */ - DATA_DATASET_SPEC(5), - /** - *
    -     * IteratorSpec from data/ops/iterator_ops.py
    -     * 
    - * - * DATA_ITERATOR_SPEC = 6; - */ - DATA_ITERATOR_SPEC(6), - /** - *
    -     * tf.OptionalSpec
    -     * 
    - * - * OPTIONAL_SPEC = 7; - */ - OPTIONAL_SPEC(7), - /** - *
    -     * PerReplicaSpec from distribute/values.py
    -     * 
    - * - * PER_REPLICA_SPEC = 8; - */ - PER_REPLICA_SPEC(8), - /** - *
    -     * tf.VariableSpec
    -     * 
    - * - * VARIABLE_SPEC = 9; - */ - VARIABLE_SPEC(9), - /** - *
    -     * RowPartitionSpec from ragged/row_partition.py
    -     * 
    - * - * ROW_PARTITION_SPEC = 10; - */ - ROW_PARTITION_SPEC(10), - /** - *
    -     * The type registered as type_spec_class_name.
    -     * 
    - * - * REGISTERED_TYPE_SPEC = 12; - */ - REGISTERED_TYPE_SPEC(12), - /** - *
    -     * Subclasses of tf.ExtensionType
    -     * 
    - * - * EXTENSION_TYPE_SPEC = 13; - */ - EXTENSION_TYPE_SPEC(13), - UNRECOGNIZED(-1), - ; - - /** - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - *
    -     * tf.SparseTensorSpec
    -     * 
    - * - * SPARSE_TENSOR_SPEC = 1; - */ - public static final int SPARSE_TENSOR_SPEC_VALUE = 1; - /** - *
    -     * tf.IndexedSlicesSpec
    -     * 
    - * - * INDEXED_SLICES_SPEC = 2; - */ - public static final int INDEXED_SLICES_SPEC_VALUE = 2; - /** - *
    -     * tf.RaggedTensorSpec
    -     * 
    - * - * RAGGED_TENSOR_SPEC = 3; - */ - public static final int RAGGED_TENSOR_SPEC_VALUE = 3; - /** - *
    -     * tf.TensorArraySpec
    -     * 
    - * - * TENSOR_ARRAY_SPEC = 4; - */ - public static final int TENSOR_ARRAY_SPEC_VALUE = 4; - /** - *
    -     * tf.data.DatasetSpec
    -     * 
    - * - * DATA_DATASET_SPEC = 5; - */ - public static final int DATA_DATASET_SPEC_VALUE = 5; - /** - *
    -     * IteratorSpec from data/ops/iterator_ops.py
    -     * 
    - * - * DATA_ITERATOR_SPEC = 6; - */ - public static final int DATA_ITERATOR_SPEC_VALUE = 6; - /** - *
    -     * tf.OptionalSpec
    -     * 
    - * - * OPTIONAL_SPEC = 7; - */ - public static final int OPTIONAL_SPEC_VALUE = 7; - /** - *
    -     * PerReplicaSpec from distribute/values.py
    -     * 
    - * - * PER_REPLICA_SPEC = 8; - */ - public static final int PER_REPLICA_SPEC_VALUE = 8; - /** - *
    -     * tf.VariableSpec
    -     * 
    - * - * VARIABLE_SPEC = 9; - */ - public static final int VARIABLE_SPEC_VALUE = 9; - /** - *
    -     * RowPartitionSpec from ragged/row_partition.py
    -     * 
    - * - * ROW_PARTITION_SPEC = 10; - */ - public static final int ROW_PARTITION_SPEC_VALUE = 10; - /** - *
    -     * The type registered as type_spec_class_name.
    -     * 
    - * - * REGISTERED_TYPE_SPEC = 12; - */ - public static final int REGISTERED_TYPE_SPEC_VALUE = 12; - /** - *
    -     * Subclasses of tf.ExtensionType
    -     * 
    - * - * EXTENSION_TYPE_SPEC = 13; - */ - public static final int EXTENSION_TYPE_SPEC_VALUE = 13; - - - 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 TypeSpecClass valueOf(int value) { - return forNumber(value); - } - - public static TypeSpecClass forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 1: return SPARSE_TENSOR_SPEC; - case 2: return INDEXED_SLICES_SPEC; - case 3: return RAGGED_TENSOR_SPEC; - case 4: return TENSOR_ARRAY_SPEC; - case 5: return DATA_DATASET_SPEC; - case 6: return DATA_ITERATOR_SPEC; - case 7: return OPTIONAL_SPEC; - case 8: return PER_REPLICA_SPEC; - case 9: return VARIABLE_SPEC; - case 10: return ROW_PARTITION_SPEC; - case 12: return REGISTERED_TYPE_SPEC; - case 13: return EXTENSION_TYPE_SPEC; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - TypeSpecClass> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public TypeSpecClass findValueByNumber(int number) { - return TypeSpecClass.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.TypeSpecProto.getDescriptor().getEnumTypes().get(0); - } - - private static final TypeSpecClass[] VALUES = values(); - - public static TypeSpecClass 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 TypeSpecClass(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.TypeSpecProto.TypeSpecClass) - } - - public static final int TYPE_SPEC_CLASS_FIELD_NUMBER = 1; - private int typeSpecClass_; - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public int getTypeSpecClassValue() { - return typeSpecClass_; - } - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass getTypeSpecClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass result = org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.valueOf(typeSpecClass_); - return result == null ? org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.UNRECOGNIZED : result; - } - - public static final int TYPE_STATE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.StructuredValue typeState_; - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public boolean hasTypeState() { - return typeState_ != null; - } - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public org.tensorflow.proto.framework.StructuredValue getTypeState() { - return typeState_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : typeState_; - } - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getTypeStateOrBuilder() { - return getTypeState(); - } - - public static final int TYPE_SPEC_CLASS_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object typeSpecClassName_; - /** - *
    -   * The name of the TypeSpec class.
    -   *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -   *    the one registered under this name. For types registered outside
    -   *    core TensorFlow by an add-on library, that library must be loaded
    -   *    before this value can be deserialized by StructureCoder.
    -   *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -   *    redundant with the type_spec_class enum, and is only used for error
    -   *    reporting in older binaries that do not know the tupe_spec_class enum.
    -   * 
    - * - * string type_spec_class_name = 3; - */ - public java.lang.String getTypeSpecClassName() { - java.lang.Object ref = typeSpecClassName_; - 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(); - typeSpecClassName_ = s; - return s; - } - } - /** - *
    -   * The name of the TypeSpec class.
    -   *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -   *    the one registered under this name. For types registered outside
    -   *    core TensorFlow by an add-on library, that library must be loaded
    -   *    before this value can be deserialized by StructureCoder.
    -   *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -   *    redundant with the type_spec_class enum, and is only used for error
    -   *    reporting in older binaries that do not know the tupe_spec_class enum.
    -   * 
    - * - * string type_spec_class_name = 3; - */ - public com.google.protobuf.ByteString - getTypeSpecClassNameBytes() { - java.lang.Object ref = typeSpecClassName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeSpecClassName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (typeSpecClass_ != org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.UNKNOWN.getNumber()) { - output.writeEnum(1, typeSpecClass_); - } - if (typeState_ != null) { - output.writeMessage(2, getTypeState()); - } - if (!getTypeSpecClassNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, typeSpecClassName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeSpecClass_ != org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, typeSpecClass_); - } - if (typeState_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTypeState()); - } - if (!getTypeSpecClassNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, typeSpecClassName_); - } - 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.TypeSpecProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.TypeSpecProto other = (org.tensorflow.proto.framework.TypeSpecProto) obj; - - if (typeSpecClass_ != other.typeSpecClass_) return false; - if (hasTypeState() != other.hasTypeState()) return false; - if (hasTypeState()) { - if (!getTypeState() - .equals(other.getTypeState())) return false; - } - if (!getTypeSpecClassName() - .equals(other.getTypeSpecClassName())) 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) + TYPE_SPEC_CLASS_FIELD_NUMBER; - hash = (53 * hash) + typeSpecClass_; - if (hasTypeState()) { - hash = (37 * hash) + TYPE_STATE_FIELD_NUMBER; - hash = (53 * hash) + getTypeState().hashCode(); - } - hash = (37 * hash) + TYPE_SPEC_CLASS_NAME_FIELD_NUMBER; - hash = (53 * hash) + getTypeSpecClassName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.TypeSpecProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TypeSpecProto 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.TypeSpecProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TypeSpecProto 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.TypeSpecProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.TypeSpecProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.TypeSpecProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TypeSpecProto 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.TypeSpecProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TypeSpecProto 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.TypeSpecProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.TypeSpecProto 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.TypeSpecProto 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; - } - /** - *
    -   * Represents a tf.TypeSpec
    -   * 
    - * - * Protobuf type {@code tensorflow.TypeSpecProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TypeSpecProto) - org.tensorflow.proto.framework.TypeSpecProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TypeSpecProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TypeSpecProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.TypeSpecProto.class, org.tensorflow.proto.framework.TypeSpecProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TypeSpecProto.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(); - typeSpecClass_ = 0; - - if (typeStateBuilder_ == null) { - typeState_ = null; - } else { - typeState_ = null; - typeStateBuilder_ = null; - } - typeSpecClassName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.StructProtos.internal_static_tensorflow_TypeSpecProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TypeSpecProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.TypeSpecProto build() { - org.tensorflow.proto.framework.TypeSpecProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.TypeSpecProto buildPartial() { - org.tensorflow.proto.framework.TypeSpecProto result = new org.tensorflow.proto.framework.TypeSpecProto(this); - result.typeSpecClass_ = typeSpecClass_; - if (typeStateBuilder_ == null) { - result.typeState_ = typeState_; - } else { - result.typeState_ = typeStateBuilder_.build(); - } - result.typeSpecClassName_ = typeSpecClassName_; - 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.TypeSpecProto) { - return mergeFrom((org.tensorflow.proto.framework.TypeSpecProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.TypeSpecProto other) { - if (other == org.tensorflow.proto.framework.TypeSpecProto.getDefaultInstance()) return this; - if (other.typeSpecClass_ != 0) { - setTypeSpecClassValue(other.getTypeSpecClassValue()); - } - if (other.hasTypeState()) { - mergeTypeState(other.getTypeState()); - } - if (!other.getTypeSpecClassName().isEmpty()) { - typeSpecClassName_ = other.typeSpecClassName_; - onChanged(); - } - 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.TypeSpecProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.TypeSpecProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int typeSpecClass_ = 0; - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public int getTypeSpecClassValue() { - return typeSpecClass_; - } - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public Builder setTypeSpecClassValue(int value) { - typeSpecClass_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass getTypeSpecClass() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass result = org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.valueOf(typeSpecClass_); - return result == null ? org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass.UNRECOGNIZED : result; - } - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public Builder setTypeSpecClass(org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass value) { - if (value == null) { - throw new NullPointerException(); - } - - typeSpecClass_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - public Builder clearTypeSpecClass() { - - typeSpecClass_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.StructuredValue typeState_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> typeStateBuilder_; - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public boolean hasTypeState() { - return typeStateBuilder_ != null || typeState_ != null; - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public org.tensorflow.proto.framework.StructuredValue getTypeState() { - if (typeStateBuilder_ == null) { - return typeState_ == null ? org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : typeState_; - } else { - return typeStateBuilder_.getMessage(); - } - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public Builder setTypeState(org.tensorflow.proto.framework.StructuredValue value) { - if (typeStateBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - typeState_ = value; - onChanged(); - } else { - typeStateBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public Builder setTypeState( - org.tensorflow.proto.framework.StructuredValue.Builder builderForValue) { - if (typeStateBuilder_ == null) { - typeState_ = builderForValue.build(); - onChanged(); - } else { - typeStateBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public Builder mergeTypeState(org.tensorflow.proto.framework.StructuredValue value) { - if (typeStateBuilder_ == null) { - if (typeState_ != null) { - typeState_ = - org.tensorflow.proto.framework.StructuredValue.newBuilder(typeState_).mergeFrom(value).buildPartial(); - } else { - typeState_ = value; - } - onChanged(); - } else { - typeStateBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public Builder clearTypeState() { - if (typeStateBuilder_ == null) { - typeState_ = null; - onChanged(); - } else { - typeState_ = null; - typeStateBuilder_ = null; - } - - return this; - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public org.tensorflow.proto.framework.StructuredValue.Builder getTypeStateBuilder() { - - onChanged(); - return getTypeStateFieldBuilder().getBuilder(); - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - public org.tensorflow.proto.framework.StructuredValueOrBuilder getTypeStateOrBuilder() { - if (typeStateBuilder_ != null) { - return typeStateBuilder_.getMessageOrBuilder(); - } else { - return typeState_ == null ? - org.tensorflow.proto.framework.StructuredValue.getDefaultInstance() : typeState_; - } - } - /** - *
    -     * The value returned by TypeSpec._serialize().
    -     * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder> - getTypeStateFieldBuilder() { - if (typeStateBuilder_ == null) { - typeStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.StructuredValue, org.tensorflow.proto.framework.StructuredValue.Builder, org.tensorflow.proto.framework.StructuredValueOrBuilder>( - getTypeState(), - getParentForChildren(), - isClean()); - typeState_ = null; - } - return typeStateBuilder_; - } - - private java.lang.Object typeSpecClassName_ = ""; - /** - *
    -     * The name of the TypeSpec class.
    -     *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -     *    the one registered under this name. For types registered outside
    -     *    core TensorFlow by an add-on library, that library must be loaded
    -     *    before this value can be deserialized by StructureCoder.
    -     *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -     *    redundant with the type_spec_class enum, and is only used for error
    -     *    reporting in older binaries that do not know the tupe_spec_class enum.
    -     * 
    - * - * string type_spec_class_name = 3; - */ - public java.lang.String getTypeSpecClassName() { - java.lang.Object ref = typeSpecClassName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeSpecClassName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The name of the TypeSpec class.
    -     *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -     *    the one registered under this name. For types registered outside
    -     *    core TensorFlow by an add-on library, that library must be loaded
    -     *    before this value can be deserialized by StructureCoder.
    -     *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -     *    redundant with the type_spec_class enum, and is only used for error
    -     *    reporting in older binaries that do not know the tupe_spec_class enum.
    -     * 
    - * - * string type_spec_class_name = 3; - */ - public com.google.protobuf.ByteString - getTypeSpecClassNameBytes() { - java.lang.Object ref = typeSpecClassName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeSpecClassName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The name of the TypeSpec class.
    -     *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -     *    the one registered under this name. For types registered outside
    -     *    core TensorFlow by an add-on library, that library must be loaded
    -     *    before this value can be deserialized by StructureCoder.
    -     *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -     *    redundant with the type_spec_class enum, and is only used for error
    -     *    reporting in older binaries that do not know the tupe_spec_class enum.
    -     * 
    - * - * string type_spec_class_name = 3; - */ - public Builder setTypeSpecClassName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeSpecClassName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name of the TypeSpec class.
    -     *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -     *    the one registered under this name. For types registered outside
    -     *    core TensorFlow by an add-on library, that library must be loaded
    -     *    before this value can be deserialized by StructureCoder.
    -     *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -     *    redundant with the type_spec_class enum, and is only used for error
    -     *    reporting in older binaries that do not know the tupe_spec_class enum.
    -     * 
    - * - * string type_spec_class_name = 3; - */ - public Builder clearTypeSpecClassName() { - - typeSpecClassName_ = getDefaultInstance().getTypeSpecClassName(); - onChanged(); - return this; - } - /** - *
    -     * The name of the TypeSpec class.
    -     *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -     *    the one registered under this name. For types registered outside
    -     *    core TensorFlow by an add-on library, that library must be loaded
    -     *    before this value can be deserialized by StructureCoder.
    -     *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -     *    redundant with the type_spec_class enum, and is only used for error
    -     *    reporting in older binaries that do not know the tupe_spec_class enum.
    -     * 
    - * - * string type_spec_class_name = 3; - */ - public Builder setTypeSpecClassNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeSpecClassName_ = value; - 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.TypeSpecProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TypeSpecProto) - private static final org.tensorflow.proto.framework.TypeSpecProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.TypeSpecProto(); - } - - public static org.tensorflow.proto.framework.TypeSpecProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TypeSpecProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TypeSpecProto(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.TypeSpecProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProtoOrBuilder.java deleted file mode 100644 index 758545623cd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypeSpecProtoOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/struct.proto - -package org.tensorflow.proto.framework; - -public interface TypeSpecProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TypeSpecProto) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - int getTypeSpecClassValue(); - /** - * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; - */ - org.tensorflow.proto.framework.TypeSpecProto.TypeSpecClass getTypeSpecClass(); - - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - boolean hasTypeState(); - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - org.tensorflow.proto.framework.StructuredValue getTypeState(); - /** - *
    -   * The value returned by TypeSpec._serialize().
    -   * 
    - * - * .tensorflow.StructuredValue type_state = 2; - */ - org.tensorflow.proto.framework.StructuredValueOrBuilder getTypeStateOrBuilder(); - - /** - *
    -   * The name of the TypeSpec class.
    -   *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -   *    the one registered under this name. For types registered outside
    -   *    core TensorFlow by an add-on library, that library must be loaded
    -   *    before this value can be deserialized by StructureCoder.
    -   *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -   *    redundant with the type_spec_class enum, and is only used for error
    -   *    reporting in older binaries that do not know the tupe_spec_class enum.
    -   * 
    - * - * string type_spec_class_name = 3; - */ - java.lang.String getTypeSpecClassName(); - /** - *
    -   * The name of the TypeSpec class.
    -   *  * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    -   *    the one registered under this name. For types registered outside
    -   *    core TensorFlow by an add-on library, that library must be loaded
    -   *    before this value can be deserialized by StructureCoder.
    -   *  * If type_spec_class specifies a particular TypeSpec class, this field is
    -   *    redundant with the type_spec_class enum, and is only used for error
    -   *    reporting in older binaries that do not know the tupe_spec_class enum.
    -   * 
    - * - * string type_spec_class_name = 3; - */ - com.google.protobuf.ByteString - getTypeSpecClassNameBytes(); -} 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 deleted file mode 100644 index 9c343efcb7c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TypesProtos.java +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/types.proto - -package org.tensorflow.proto.framework; - -public final class TypesProtos { - private TypesProtos() {} - 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 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/framework/types.proto\022" + - "\ntensorflow*\252\006\n\010DataType\022\016\n\nDT_INVALID\020\000" + - "\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT_DOUBLE\020\002\022\014\n\010DT_INT3" + - "2\020\003\022\014\n\010DT_UINT8\020\004\022\014\n\010DT_INT16\020\005\022\013\n\007DT_IN" + - "T8\020\006\022\r\n\tDT_STRING\020\007\022\020\n\014DT_COMPLEX64\020\010\022\014\n" + - "\010DT_INT64\020\t\022\013\n\007DT_BOOL\020\n\022\014\n\010DT_QINT8\020\013\022\r" + - "\n\tDT_QUINT8\020\014\022\r\n\tDT_QINT32\020\r\022\017\n\013DT_BFLOA" + - "T16\020\016\022\r\n\tDT_QINT16\020\017\022\016\n\nDT_QUINT16\020\020\022\r\n\t" + - "DT_UINT16\020\021\022\021\n\rDT_COMPLEX128\020\022\022\013\n\007DT_HAL" + - "F\020\023\022\017\n\013DT_RESOURCE\020\024\022\016\n\nDT_VARIANT\020\025\022\r\n\t" + - "DT_UINT32\020\026\022\r\n\tDT_UINT64\020\027\022\020\n\014DT_FLOAT_R" + - "EF\020e\022\021\n\rDT_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020" + - "g\022\020\n\014DT_UINT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n" + - "\013DT_INT8_REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_" + - "COMPLEX64_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_" + - "BOOL_REF\020n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT" + - "8_REF\020p\022\021\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT1" + - "6_REF\020r\022\021\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16" + - "_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" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDef.java deleted file mode 100644 index d6819b5bbfa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDef.java +++ /dev/null @@ -1,969 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/control_flow.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing the values in ControlFlowContext.
    - * 
    - * - * Protobuf type {@code tensorflow.ValuesDef} - */ -public final class ValuesDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ValuesDef) - ValuesDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use ValuesDef.newBuilder() to construct. - private ValuesDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ValuesDef() { - values_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ValuesDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ValuesDef( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - values_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - values_.add(s); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - externalValues_ = com.google.protobuf.MapField.newMapField( - ExternalValuesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - externalValues__ = input.readMessage( - ExternalValuesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - externalValues_.getMutableMap().put( - externalValues__.getKey(), externalValues__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - values_ = values_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetExternalValues(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ValuesDef.class, org.tensorflow.proto.framework.ValuesDef.Builder.class); - } - - public static final int VALUES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList values_; - /** - *
    -   * Value names that have been seen in this context.
    -   * 
    - * - * repeated string values = 1; - */ - public com.google.protobuf.ProtocolStringList - getValuesList() { - return values_; - } - /** - *
    -   * Value names that have been seen in this context.
    -   * 
    - * - * repeated string values = 1; - */ - public int getValuesCount() { - return values_.size(); - } - /** - *
    -   * Value names that have been seen in this context.
    -   * 
    - * - * repeated string values = 1; - */ - public java.lang.String getValues(int index) { - return values_.get(index); - } - /** - *
    -   * Value names that have been seen in this context.
    -   * 
    - * - * repeated string values = 1; - */ - public com.google.protobuf.ByteString - getValuesBytes(int index) { - return values_.getByteString(index); - } - - public static final int EXTERNAL_VALUES_FIELD_NUMBER = 2; - private static final class ExternalValuesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_ExternalValuesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> externalValues_; - private com.google.protobuf.MapField - internalGetExternalValues() { - if (externalValues_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExternalValuesDefaultEntryHolder.defaultEntry); - } - return externalValues_; - } - - public int getExternalValuesCount() { - return internalGetExternalValues().getMap().size(); - } - /** - *
    -   * Value names referenced by but external to this context.
    -   * 
    - * - * map<string, string> external_values = 2; - */ - - public boolean containsExternalValues( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExternalValues().getMap().containsKey(key); - } - /** - * Use {@link #getExternalValuesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getExternalValues() { - return getExternalValuesMap(); - } - /** - *
    -   * Value names referenced by but external to this context.
    -   * 
    - * - * map<string, string> external_values = 2; - */ - - public java.util.Map getExternalValuesMap() { - return internalGetExternalValues().getMap(); - } - /** - *
    -   * Value names referenced by but external to this context.
    -   * 
    - * - * map<string, string> external_values = 2; - */ - - public java.lang.String getExternalValuesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExternalValues().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Value names referenced by but external to this context.
    -   * 
    - * - * map<string, string> external_values = 2; - */ - - public java.lang.String getExternalValuesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExternalValues().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 { - for (int i = 0; i < values_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, values_.getRaw(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetExternalValues(), - ExternalValuesDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < values_.size(); i++) { - dataSize += computeStringSizeNoTag(values_.getRaw(i)); - } - size += dataSize; - size += 1 * getValuesList().size(); - } - for (java.util.Map.Entry entry - : internalGetExternalValues().getMap().entrySet()) { - com.google.protobuf.MapEntry - externalValues__ = ExternalValuesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, externalValues__); - } - 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.ValuesDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.ValuesDef other = (org.tensorflow.proto.framework.ValuesDef) obj; - - if (!getValuesList() - .equals(other.getValuesList())) return false; - if (!internalGetExternalValues().equals( - other.internalGetExternalValues())) 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 (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - if (!internalGetExternalValues().getMap().isEmpty()) { - hash = (37 * hash) + EXTERNAL_VALUES_FIELD_NUMBER; - hash = (53 * hash) + internalGetExternalValues().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.ValuesDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ValuesDef 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.ValuesDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ValuesDef 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.ValuesDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.ValuesDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.ValuesDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ValuesDef 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.ValuesDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ValuesDef 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.ValuesDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.ValuesDef 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.ValuesDef 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; - } - /** - *
    -   * Protocol buffer representing the values in ControlFlowContext.
    -   * 
    - * - * Protobuf type {@code tensorflow.ValuesDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ValuesDef) - org.tensorflow.proto.framework.ValuesDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetExternalValues(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableExternalValues(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.ValuesDef.class, org.tensorflow.proto.framework.ValuesDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ValuesDef.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(); - values_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableExternalValues().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ValuesDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.ValuesDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.ValuesDef build() { - org.tensorflow.proto.framework.ValuesDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.ValuesDef buildPartial() { - org.tensorflow.proto.framework.ValuesDef result = new org.tensorflow.proto.framework.ValuesDef(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - values_ = values_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.values_ = values_; - result.externalValues_ = internalGetExternalValues(); - result.externalValues_.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.ValuesDef) { - return mergeFrom((org.tensorflow.proto.framework.ValuesDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.ValuesDef other) { - if (other == org.tensorflow.proto.framework.ValuesDef.getDefaultInstance()) return this; - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - internalGetMutableExternalValues().mergeFrom( - other.internalGetExternalValues()); - 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.ValuesDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.ValuesDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList values_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - values_ = new com.google.protobuf.LazyStringArrayList(values_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public com.google.protobuf.ProtocolStringList - getValuesList() { - return values_.getUnmodifiableView(); - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public int getValuesCount() { - return values_.size(); - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public java.lang.String getValues(int index) { - return values_.get(index); - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public com.google.protobuf.ByteString - getValuesBytes(int index) { - return values_.getByteString(index); - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public Builder setValues( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public Builder addValues( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public Builder addAllValues( - java.lang.Iterable values) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - return this; - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public Builder clearValues() { - values_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Value names that have been seen in this context.
    -     * 
    - * - * repeated string values = 1; - */ - public Builder addValuesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> externalValues_; - private com.google.protobuf.MapField - internalGetExternalValues() { - if (externalValues_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExternalValuesDefaultEntryHolder.defaultEntry); - } - return externalValues_; - } - private com.google.protobuf.MapField - internalGetMutableExternalValues() { - onChanged();; - if (externalValues_ == null) { - externalValues_ = com.google.protobuf.MapField.newMapField( - ExternalValuesDefaultEntryHolder.defaultEntry); - } - if (!externalValues_.isMutable()) { - externalValues_ = externalValues_.copy(); - } - return externalValues_; - } - - public int getExternalValuesCount() { - return internalGetExternalValues().getMap().size(); - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public boolean containsExternalValues( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExternalValues().getMap().containsKey(key); - } - /** - * Use {@link #getExternalValuesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getExternalValues() { - return getExternalValuesMap(); - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public java.util.Map getExternalValuesMap() { - return internalGetExternalValues().getMap(); - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public java.lang.String getExternalValuesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExternalValues().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public java.lang.String getExternalValuesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExternalValues().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearExternalValues() { - internalGetMutableExternalValues().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public Builder removeExternalValues( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExternalValues().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableExternalValues() { - return internalGetMutableExternalValues().getMutableMap(); - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - public Builder putExternalValues( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExternalValues().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Value names referenced by but external to this context.
    -     * 
    - * - * map<string, string> external_values = 2; - */ - - public Builder putAllExternalValues( - java.util.Map values) { - internalGetMutableExternalValues().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.ValuesDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ValuesDef) - private static final org.tensorflow.proto.framework.ValuesDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.ValuesDef(); - } - - public static org.tensorflow.proto.framework.ValuesDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ValuesDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ValuesDef(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.ValuesDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDef.java deleted file mode 100644 index e0ecee5dc06..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDef.java +++ /dev/null @@ -1,1650 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/variable.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a Variable.
    - * 
    - * - * Protobuf type {@code tensorflow.VariableDef} - */ -public final class VariableDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VariableDef) - VariableDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use VariableDef.newBuilder() to construct. - private VariableDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VariableDef() { - variableName_ = ""; - initialValueName_ = ""; - initializerName_ = ""; - snapshotName_ = ""; - synchronization_ = 0; - aggregation_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VariableDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VariableDef( - 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(); - - variableName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - initializerName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - snapshotName_ = s; - break; - } - case 34: { - org.tensorflow.proto.framework.SaveSliceInfoDef.Builder subBuilder = null; - if (saveSliceInfoDef_ != null) { - subBuilder = saveSliceInfoDef_.toBuilder(); - } - saveSliceInfoDef_ = input.readMessage(org.tensorflow.proto.framework.SaveSliceInfoDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(saveSliceInfoDef_); - saveSliceInfoDef_ = subBuilder.buildPartial(); - } - - break; - } - case 40: { - - isResource_ = input.readBool(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - initialValueName_ = s; - break; - } - case 56: { - - trainable_ = input.readBool(); - break; - } - case 64: { - int rawValue = input.readEnum(); - - synchronization_ = rawValue; - break; - } - case 72: { - int rawValue = input.readEnum(); - - aggregation_ = rawValue; - 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.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_VariableDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VariableDef.class, org.tensorflow.proto.framework.VariableDef.Builder.class); - } - - public static final int VARIABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object variableName_; - /** - *
    -   * Name of the variable tensor.
    -   * 
    - * - * string variable_name = 1; - */ - public java.lang.String getVariableName() { - java.lang.Object ref = variableName_; - 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(); - variableName_ = s; - return s; - } - } - /** - *
    -   * Name of the variable tensor.
    -   * 
    - * - * string variable_name = 1; - */ - public com.google.protobuf.ByteString - getVariableNameBytes() { - java.lang.Object ref = variableName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - variableName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INITIAL_VALUE_NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object initialValueName_; - /** - *
    -   * Name of the tensor holding the variable's initial value.
    -   * 
    - * - * string initial_value_name = 6; - */ - public java.lang.String getInitialValueName() { - java.lang.Object ref = initialValueName_; - 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(); - initialValueName_ = s; - return s; - } - } - /** - *
    -   * Name of the tensor holding the variable's initial value.
    -   * 
    - * - * string initial_value_name = 6; - */ - public com.google.protobuf.ByteString - getInitialValueNameBytes() { - java.lang.Object ref = initialValueName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - initialValueName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INITIALIZER_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object initializerName_; - /** - *
    -   * Name of the initializer op.
    -   * 
    - * - * string initializer_name = 2; - */ - public java.lang.String getInitializerName() { - java.lang.Object ref = initializerName_; - 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(); - initializerName_ = s; - return s; - } - } - /** - *
    -   * Name of the initializer op.
    -   * 
    - * - * string initializer_name = 2; - */ - public com.google.protobuf.ByteString - getInitializerNameBytes() { - java.lang.Object ref = initializerName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - initializerName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SNAPSHOT_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object snapshotName_; - /** - *
    -   * Name of the snapshot tensor.
    -   * 
    - * - * string snapshot_name = 3; - */ - public java.lang.String getSnapshotName() { - java.lang.Object ref = snapshotName_; - 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(); - snapshotName_ = s; - return s; - } - } - /** - *
    -   * Name of the snapshot tensor.
    -   * 
    - * - * string snapshot_name = 3; - */ - public com.google.protobuf.ByteString - getSnapshotNameBytes() { - java.lang.Object ref = snapshotName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - snapshotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SAVE_SLICE_INFO_DEF_FIELD_NUMBER = 4; - private org.tensorflow.proto.framework.SaveSliceInfoDef saveSliceInfoDef_; - /** - *
    -   * Support for saving variables as slices of a larger variable.
    -   * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public boolean hasSaveSliceInfoDef() { - return saveSliceInfoDef_ != null; - } - /** - *
    -   * Support for saving variables as slices of a larger variable.
    -   * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public org.tensorflow.proto.framework.SaveSliceInfoDef getSaveSliceInfoDef() { - return saveSliceInfoDef_ == null ? org.tensorflow.proto.framework.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; - } - /** - *
    -   * Support for saving variables as slices of a larger variable.
    -   * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder() { - return getSaveSliceInfoDef(); - } - - public static final int IS_RESOURCE_FIELD_NUMBER = 5; - private boolean isResource_; - /** - *
    -   * Whether to represent this as a ResourceVariable.
    -   * 
    - * - * bool is_resource = 5; - */ - public boolean getIsResource() { - return isResource_; - } - - public static final int TRAINABLE_FIELD_NUMBER = 7; - private boolean trainable_; - /** - *
    -   * Whether this variable should be trained.
    -   * 
    - * - * bool trainable = 7; - */ - public boolean getTrainable() { - return trainable_; - } - - public static final int SYNCHRONIZATION_FIELD_NUMBER = 8; - private int synchronization_; - /** - *
    -   * Indicates when a distributed variable will be synced.
    -   * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public int getSynchronizationValue() { - return synchronization_; - } - /** - *
    -   * Indicates when a distributed variable will be synced.
    -   * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public org.tensorflow.proto.framework.VariableSynchronization getSynchronization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableSynchronization result = org.tensorflow.proto.framework.VariableSynchronization.valueOf(synchronization_); - return result == null ? org.tensorflow.proto.framework.VariableSynchronization.UNRECOGNIZED : result; - } - - public static final int AGGREGATION_FIELD_NUMBER = 9; - private int aggregation_; - /** - *
    -   * Indicates how a distributed variable will be aggregated.
    -   * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public int getAggregationValue() { - return aggregation_; - } - /** - *
    -   * Indicates how a distributed variable will be aggregated.
    -   * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public org.tensorflow.proto.framework.VariableAggregation getAggregation() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableAggregation result = org.tensorflow.proto.framework.VariableAggregation.valueOf(aggregation_); - return result == null ? org.tensorflow.proto.framework.VariableAggregation.UNRECOGNIZED : result; - } - - 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 (!getVariableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, variableName_); - } - if (!getInitializerNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, initializerName_); - } - if (!getSnapshotNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snapshotName_); - } - if (saveSliceInfoDef_ != null) { - output.writeMessage(4, getSaveSliceInfoDef()); - } - if (isResource_ != false) { - output.writeBool(5, isResource_); - } - if (!getInitialValueNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, initialValueName_); - } - if (trainable_ != false) { - output.writeBool(7, trainable_); - } - if (synchronization_ != org.tensorflow.proto.framework.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { - output.writeEnum(8, synchronization_); - } - if (aggregation_ != org.tensorflow.proto.framework.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { - output.writeEnum(9, aggregation_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getVariableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, variableName_); - } - if (!getInitializerNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, initializerName_); - } - if (!getSnapshotNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snapshotName_); - } - if (saveSliceInfoDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getSaveSliceInfoDef()); - } - if (isResource_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, isResource_); - } - if (!getInitialValueNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, initialValueName_); - } - if (trainable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(7, trainable_); - } - if (synchronization_ != org.tensorflow.proto.framework.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(8, synchronization_); - } - if (aggregation_ != org.tensorflow.proto.framework.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(9, aggregation_); - } - 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.VariableDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.VariableDef other = (org.tensorflow.proto.framework.VariableDef) obj; - - if (!getVariableName() - .equals(other.getVariableName())) return false; - if (!getInitialValueName() - .equals(other.getInitialValueName())) return false; - if (!getInitializerName() - .equals(other.getInitializerName())) return false; - if (!getSnapshotName() - .equals(other.getSnapshotName())) return false; - if (hasSaveSliceInfoDef() != other.hasSaveSliceInfoDef()) return false; - if (hasSaveSliceInfoDef()) { - if (!getSaveSliceInfoDef() - .equals(other.getSaveSliceInfoDef())) return false; - } - if (getIsResource() - != other.getIsResource()) return false; - if (getTrainable() - != other.getTrainable()) return false; - if (synchronization_ != other.synchronization_) return false; - if (aggregation_ != other.aggregation_) 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) + VARIABLE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getVariableName().hashCode(); - hash = (37 * hash) + INITIAL_VALUE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getInitialValueName().hashCode(); - hash = (37 * hash) + INITIALIZER_NAME_FIELD_NUMBER; - hash = (53 * hash) + getInitializerName().hashCode(); - hash = (37 * hash) + SNAPSHOT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getSnapshotName().hashCode(); - if (hasSaveSliceInfoDef()) { - hash = (37 * hash) + SAVE_SLICE_INFO_DEF_FIELD_NUMBER; - hash = (53 * hash) + getSaveSliceInfoDef().hashCode(); - } - hash = (37 * hash) + IS_RESOURCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsResource()); - hash = (37 * hash) + TRAINABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getTrainable()); - hash = (37 * hash) + SYNCHRONIZATION_FIELD_NUMBER; - hash = (53 * hash) + synchronization_; - hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; - hash = (53 * hash) + aggregation_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.VariableDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariableDef 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.VariableDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariableDef 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.VariableDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariableDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.VariableDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariableDef 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.VariableDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariableDef 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.VariableDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariableDef 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.VariableDef 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; - } - /** - *
    -   * Protocol buffer representing a Variable.
    -   * 
    - * - * Protobuf type {@code tensorflow.VariableDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VariableDef) - org.tensorflow.proto.framework.VariableDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_VariableDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VariableDef.class, org.tensorflow.proto.framework.VariableDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.VariableDef.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(); - variableName_ = ""; - - initialValueName_ = ""; - - initializerName_ = ""; - - snapshotName_ = ""; - - if (saveSliceInfoDefBuilder_ == null) { - saveSliceInfoDef_ = null; - } else { - saveSliceInfoDef_ = null; - saveSliceInfoDefBuilder_ = null; - } - isResource_ = false; - - trainable_ = false; - - synchronization_ = 0; - - aggregation_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariableDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.VariableDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariableDef build() { - org.tensorflow.proto.framework.VariableDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariableDef buildPartial() { - org.tensorflow.proto.framework.VariableDef result = new org.tensorflow.proto.framework.VariableDef(this); - result.variableName_ = variableName_; - result.initialValueName_ = initialValueName_; - result.initializerName_ = initializerName_; - result.snapshotName_ = snapshotName_; - if (saveSliceInfoDefBuilder_ == null) { - result.saveSliceInfoDef_ = saveSliceInfoDef_; - } else { - result.saveSliceInfoDef_ = saveSliceInfoDefBuilder_.build(); - } - result.isResource_ = isResource_; - result.trainable_ = trainable_; - result.synchronization_ = synchronization_; - result.aggregation_ = aggregation_; - 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.VariableDef) { - return mergeFrom((org.tensorflow.proto.framework.VariableDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.VariableDef other) { - if (other == org.tensorflow.proto.framework.VariableDef.getDefaultInstance()) return this; - if (!other.getVariableName().isEmpty()) { - variableName_ = other.variableName_; - onChanged(); - } - if (!other.getInitialValueName().isEmpty()) { - initialValueName_ = other.initialValueName_; - onChanged(); - } - if (!other.getInitializerName().isEmpty()) { - initializerName_ = other.initializerName_; - onChanged(); - } - if (!other.getSnapshotName().isEmpty()) { - snapshotName_ = other.snapshotName_; - onChanged(); - } - if (other.hasSaveSliceInfoDef()) { - mergeSaveSliceInfoDef(other.getSaveSliceInfoDef()); - } - if (other.getIsResource() != false) { - setIsResource(other.getIsResource()); - } - if (other.getTrainable() != false) { - setTrainable(other.getTrainable()); - } - if (other.synchronization_ != 0) { - setSynchronizationValue(other.getSynchronizationValue()); - } - if (other.aggregation_ != 0) { - setAggregationValue(other.getAggregationValue()); - } - 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.VariableDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.VariableDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object variableName_ = ""; - /** - *
    -     * Name of the variable tensor.
    -     * 
    - * - * string variable_name = 1; - */ - public java.lang.String getVariableName() { - java.lang.Object ref = variableName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - variableName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the variable tensor.
    -     * 
    - * - * string variable_name = 1; - */ - public com.google.protobuf.ByteString - getVariableNameBytes() { - java.lang.Object ref = variableName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - variableName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the variable tensor.
    -     * 
    - * - * string variable_name = 1; - */ - public Builder setVariableName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - variableName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the variable tensor.
    -     * 
    - * - * string variable_name = 1; - */ - public Builder clearVariableName() { - - variableName_ = getDefaultInstance().getVariableName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the variable tensor.
    -     * 
    - * - * string variable_name = 1; - */ - public Builder setVariableNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - variableName_ = value; - onChanged(); - return this; - } - - private java.lang.Object initialValueName_ = ""; - /** - *
    -     * Name of the tensor holding the variable's initial value.
    -     * 
    - * - * string initial_value_name = 6; - */ - public java.lang.String getInitialValueName() { - java.lang.Object ref = initialValueName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - initialValueName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the tensor holding the variable's initial value.
    -     * 
    - * - * string initial_value_name = 6; - */ - public com.google.protobuf.ByteString - getInitialValueNameBytes() { - java.lang.Object ref = initialValueName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - initialValueName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the tensor holding the variable's initial value.
    -     * 
    - * - * string initial_value_name = 6; - */ - public Builder setInitialValueName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - initialValueName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor holding the variable's initial value.
    -     * 
    - * - * string initial_value_name = 6; - */ - public Builder clearInitialValueName() { - - initialValueName_ = getDefaultInstance().getInitialValueName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor holding the variable's initial value.
    -     * 
    - * - * string initial_value_name = 6; - */ - public Builder setInitialValueNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - initialValueName_ = value; - onChanged(); - return this; - } - - private java.lang.Object initializerName_ = ""; - /** - *
    -     * Name of the initializer op.
    -     * 
    - * - * string initializer_name = 2; - */ - public java.lang.String getInitializerName() { - java.lang.Object ref = initializerName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - initializerName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the initializer op.
    -     * 
    - * - * string initializer_name = 2; - */ - public com.google.protobuf.ByteString - getInitializerNameBytes() { - java.lang.Object ref = initializerName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - initializerName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the initializer op.
    -     * 
    - * - * string initializer_name = 2; - */ - public Builder setInitializerName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - initializerName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the initializer op.
    -     * 
    - * - * string initializer_name = 2; - */ - public Builder clearInitializerName() { - - initializerName_ = getDefaultInstance().getInitializerName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the initializer op.
    -     * 
    - * - * string initializer_name = 2; - */ - public Builder setInitializerNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - initializerName_ = value; - onChanged(); - return this; - } - - private java.lang.Object snapshotName_ = ""; - /** - *
    -     * Name of the snapshot tensor.
    -     * 
    - * - * string snapshot_name = 3; - */ - public java.lang.String getSnapshotName() { - java.lang.Object ref = snapshotName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - snapshotName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the snapshot tensor.
    -     * 
    - * - * string snapshot_name = 3; - */ - public com.google.protobuf.ByteString - getSnapshotNameBytes() { - java.lang.Object ref = snapshotName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - snapshotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the snapshot tensor.
    -     * 
    - * - * string snapshot_name = 3; - */ - public Builder setSnapshotName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - snapshotName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the snapshot tensor.
    -     * 
    - * - * string snapshot_name = 3; - */ - public Builder clearSnapshotName() { - - snapshotName_ = getDefaultInstance().getSnapshotName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the snapshot tensor.
    -     * 
    - * - * string snapshot_name = 3; - */ - public Builder setSnapshotNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - snapshotName_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.SaveSliceInfoDef saveSliceInfoDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SaveSliceInfoDef, org.tensorflow.proto.framework.SaveSliceInfoDef.Builder, org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder> saveSliceInfoDefBuilder_; - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public boolean hasSaveSliceInfoDef() { - return saveSliceInfoDefBuilder_ != null || saveSliceInfoDef_ != null; - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public org.tensorflow.proto.framework.SaveSliceInfoDef getSaveSliceInfoDef() { - if (saveSliceInfoDefBuilder_ == null) { - return saveSliceInfoDef_ == null ? org.tensorflow.proto.framework.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; - } else { - return saveSliceInfoDefBuilder_.getMessage(); - } - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public Builder setSaveSliceInfoDef(org.tensorflow.proto.framework.SaveSliceInfoDef value) { - if (saveSliceInfoDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - saveSliceInfoDef_ = value; - onChanged(); - } else { - saveSliceInfoDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public Builder setSaveSliceInfoDef( - org.tensorflow.proto.framework.SaveSliceInfoDef.Builder builderForValue) { - if (saveSliceInfoDefBuilder_ == null) { - saveSliceInfoDef_ = builderForValue.build(); - onChanged(); - } else { - saveSliceInfoDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public Builder mergeSaveSliceInfoDef(org.tensorflow.proto.framework.SaveSliceInfoDef value) { - if (saveSliceInfoDefBuilder_ == null) { - if (saveSliceInfoDef_ != null) { - saveSliceInfoDef_ = - org.tensorflow.proto.framework.SaveSliceInfoDef.newBuilder(saveSliceInfoDef_).mergeFrom(value).buildPartial(); - } else { - saveSliceInfoDef_ = value; - } - onChanged(); - } else { - saveSliceInfoDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public Builder clearSaveSliceInfoDef() { - if (saveSliceInfoDefBuilder_ == null) { - saveSliceInfoDef_ = null; - onChanged(); - } else { - saveSliceInfoDef_ = null; - saveSliceInfoDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public org.tensorflow.proto.framework.SaveSliceInfoDef.Builder getSaveSliceInfoDefBuilder() { - - onChanged(); - return getSaveSliceInfoDefFieldBuilder().getBuilder(); - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - public org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder() { - if (saveSliceInfoDefBuilder_ != null) { - return saveSliceInfoDefBuilder_.getMessageOrBuilder(); - } else { - return saveSliceInfoDef_ == null ? - org.tensorflow.proto.framework.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; - } - } - /** - *
    -     * Support for saving variables as slices of a larger variable.
    -     * 
    - * - * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SaveSliceInfoDef, org.tensorflow.proto.framework.SaveSliceInfoDef.Builder, org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder> - getSaveSliceInfoDefFieldBuilder() { - if (saveSliceInfoDefBuilder_ == null) { - saveSliceInfoDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.SaveSliceInfoDef, org.tensorflow.proto.framework.SaveSliceInfoDef.Builder, org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder>( - getSaveSliceInfoDef(), - getParentForChildren(), - isClean()); - saveSliceInfoDef_ = null; - } - return saveSliceInfoDefBuilder_; - } - - private boolean isResource_ ; - /** - *
    -     * Whether to represent this as a ResourceVariable.
    -     * 
    - * - * bool is_resource = 5; - */ - public boolean getIsResource() { - return isResource_; - } - /** - *
    -     * Whether to represent this as a ResourceVariable.
    -     * 
    - * - * bool is_resource = 5; - */ - public Builder setIsResource(boolean value) { - - isResource_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether to represent this as a ResourceVariable.
    -     * 
    - * - * bool is_resource = 5; - */ - public Builder clearIsResource() { - - isResource_ = false; - onChanged(); - return this; - } - - private boolean trainable_ ; - /** - *
    -     * Whether this variable should be trained.
    -     * 
    - * - * bool trainable = 7; - */ - public boolean getTrainable() { - return trainable_; - } - /** - *
    -     * Whether this variable should be trained.
    -     * 
    - * - * bool trainable = 7; - */ - public Builder setTrainable(boolean value) { - - trainable_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether this variable should be trained.
    -     * 
    - * - * bool trainable = 7; - */ - public Builder clearTrainable() { - - trainable_ = false; - onChanged(); - return this; - } - - private int synchronization_ = 0; - /** - *
    -     * Indicates when a distributed variable will be synced.
    -     * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public int getSynchronizationValue() { - return synchronization_; - } - /** - *
    -     * Indicates when a distributed variable will be synced.
    -     * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public Builder setSynchronizationValue(int value) { - synchronization_ = value; - onChanged(); - return this; - } - /** - *
    -     * Indicates when a distributed variable will be synced.
    -     * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public org.tensorflow.proto.framework.VariableSynchronization getSynchronization() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableSynchronization result = org.tensorflow.proto.framework.VariableSynchronization.valueOf(synchronization_); - return result == null ? org.tensorflow.proto.framework.VariableSynchronization.UNRECOGNIZED : result; - } - /** - *
    -     * Indicates when a distributed variable will be synced.
    -     * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public Builder setSynchronization(org.tensorflow.proto.framework.VariableSynchronization value) { - if (value == null) { - throw new NullPointerException(); - } - - synchronization_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Indicates when a distributed variable will be synced.
    -     * 
    - * - * .tensorflow.VariableSynchronization synchronization = 8; - */ - public Builder clearSynchronization() { - - synchronization_ = 0; - onChanged(); - return this; - } - - private int aggregation_ = 0; - /** - *
    -     * Indicates how a distributed variable will be aggregated.
    -     * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public int getAggregationValue() { - return aggregation_; - } - /** - *
    -     * Indicates how a distributed variable will be aggregated.
    -     * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public Builder setAggregationValue(int value) { - aggregation_ = value; - onChanged(); - return this; - } - /** - *
    -     * Indicates how a distributed variable will be aggregated.
    -     * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public org.tensorflow.proto.framework.VariableAggregation getAggregation() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VariableAggregation result = org.tensorflow.proto.framework.VariableAggregation.valueOf(aggregation_); - return result == null ? org.tensorflow.proto.framework.VariableAggregation.UNRECOGNIZED : result; - } - /** - *
    -     * Indicates how a distributed variable will be aggregated.
    -     * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public Builder setAggregation(org.tensorflow.proto.framework.VariableAggregation value) { - if (value == null) { - throw new NullPointerException(); - } - - aggregation_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Indicates how a distributed variable will be aggregated.
    -     * 
    - * - * .tensorflow.VariableAggregation aggregation = 9; - */ - public Builder clearAggregation() { - - aggregation_ = 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.VariableDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VariableDef) - private static final org.tensorflow.proto.framework.VariableDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.VariableDef(); - } - - public static org.tensorflow.proto.framework.VariableDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VariableDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VariableDef(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.VariableDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProto.java deleted file mode 100644 index 47555bc3d7a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProto.java +++ /dev/null @@ -1,1097 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    - * 
    - * - * Protobuf type {@code tensorflow.VariantTensorDataProto} - */ -public final class VariantTensorDataProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VariantTensorDataProto) - VariantTensorDataProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use VariantTensorDataProto.newBuilder() to construct. - private VariantTensorDataProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VariantTensorDataProto() { - typeName_ = ""; - metadata_ = com.google.protobuf.ByteString.EMPTY; - tensors_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VariantTensorDataProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VariantTensorDataProto( - 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(); - - typeName_ = s; - break; - } - case 18: { - - metadata_ = input.readBytes(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tensors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensors_.add( - input.readMessage(org.tensorflow.proto.framework.TensorProto.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_ & 0x00000001) != 0)) { - tensors_ = java.util.Collections.unmodifiableList(tensors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VariantTensorDataProto.class, org.tensorflow.proto.framework.VariantTensorDataProto.Builder.class); - } - - public static final int TYPE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object typeName_; - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - public java.lang.String getTypeName() { - java.lang.Object ref = typeName_; - 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(); - typeName_ = s; - return s; - } - } - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - java.lang.Object ref = typeName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METADATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString metadata_; - /** - *
    -   * Portions of the object that are not Tensors.
    -   * 
    - * - * bytes metadata = 2; - */ - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - - public static final int TENSORS_FIELD_NUMBER = 3; - private java.util.List tensors_; - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List getTensorsList() { - return tensors_; - } - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsOrBuilderList() { - return tensors_; - } - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public int getTensorsCount() { - return tensors_.size(); - } - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProto getTensors(int index) { - return tensors_.get(index); - } - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorsOrBuilder( - int index) { - return tensors_.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 { - if (!getTypeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, typeName_); - } - if (!metadata_.isEmpty()) { - output.writeBytes(2, metadata_); - } - for (int i = 0; i < tensors_.size(); i++) { - output.writeMessage(3, tensors_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, typeName_); - } - if (!metadata_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, metadata_); - } - for (int i = 0; i < tensors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, tensors_.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.VariantTensorDataProto)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.VariantTensorDataProto other = (org.tensorflow.proto.framework.VariantTensorDataProto) obj; - - if (!getTypeName() - .equals(other.getTypeName())) return false; - if (!getMetadata() - .equals(other.getMetadata())) return false; - if (!getTensorsList() - .equals(other.getTensorsList())) 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) + TYPE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getTypeName().hashCode(); - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - if (getTensorsCount() > 0) { - hash = (37 * hash) + TENSORS_FIELD_NUMBER; - hash = (53 * hash) + getTensorsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.VariantTensorDataProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto 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.VariantTensorDataProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto 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.VariantTensorDataProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto 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.VariantTensorDataProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto 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.VariantTensorDataProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VariantTensorDataProto 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.VariantTensorDataProto 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; - } - /** - *
    -   * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    -   * 
    - * - * Protobuf type {@code tensorflow.VariantTensorDataProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VariantTensorDataProto) - org.tensorflow.proto.framework.VariantTensorDataProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VariantTensorDataProto.class, org.tensorflow.proto.framework.VariantTensorDataProto.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.VariantTensorDataProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - typeName_ = ""; - - metadata_ = com.google.protobuf.ByteString.EMPTY; - - if (tensorsBuilder_ == null) { - tensors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - tensorsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariantTensorDataProto getDefaultInstanceForType() { - return org.tensorflow.proto.framework.VariantTensorDataProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariantTensorDataProto build() { - org.tensorflow.proto.framework.VariantTensorDataProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VariantTensorDataProto buildPartial() { - org.tensorflow.proto.framework.VariantTensorDataProto result = new org.tensorflow.proto.framework.VariantTensorDataProto(this); - int from_bitField0_ = bitField0_; - result.typeName_ = typeName_; - result.metadata_ = metadata_; - if (tensorsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - tensors_ = java.util.Collections.unmodifiableList(tensors_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensors_ = tensors_; - } else { - result.tensors_ = tensorsBuilder_.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.VariantTensorDataProto) { - return mergeFrom((org.tensorflow.proto.framework.VariantTensorDataProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.VariantTensorDataProto other) { - if (other == org.tensorflow.proto.framework.VariantTensorDataProto.getDefaultInstance()) return this; - if (!other.getTypeName().isEmpty()) { - typeName_ = other.typeName_; - onChanged(); - } - if (other.getMetadata() != com.google.protobuf.ByteString.EMPTY) { - setMetadata(other.getMetadata()); - } - if (tensorsBuilder_ == null) { - if (!other.tensors_.isEmpty()) { - if (tensors_.isEmpty()) { - tensors_ = other.tensors_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorsIsMutable(); - tensors_.addAll(other.tensors_); - } - onChanged(); - } - } else { - if (!other.tensors_.isEmpty()) { - if (tensorsBuilder_.isEmpty()) { - tensorsBuilder_.dispose(); - tensorsBuilder_ = null; - tensors_ = other.tensors_; - bitField0_ = (bitField0_ & ~0x00000001); - tensorsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorsFieldBuilder() : null; - } else { - tensorsBuilder_.addAllMessages(other.tensors_); - } - } - } - 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.VariantTensorDataProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.VariantTensorDataProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object typeName_ = ""; - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public java.lang.String getTypeName() { - java.lang.Object ref = typeName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - typeName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - java.lang.Object ref = typeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder setTypeName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder clearTypeName() { - - typeName_ = getDefaultInstance().getTypeName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder setTypeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public Builder setMetadata(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - metadata_ = value; - onChanged(); - return this; - } - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public Builder clearMetadata() { - - metadata_ = getDefaultInstance().getMetadata(); - onChanged(); - return this; - } - - private java.util.List tensors_ = - java.util.Collections.emptyList(); - private void ensureTensorsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensors_ = new java.util.ArrayList(tensors_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorsBuilder_; - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List getTensorsList() { - if (tensorsBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensors_); - } else { - return tensorsBuilder_.getMessageList(); - } - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public int getTensorsCount() { - if (tensorsBuilder_ == null) { - return tensors_.size(); - } else { - return tensorsBuilder_.getCount(); - } - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProto getTensors(int index) { - if (tensorsBuilder_ == null) { - return tensors_.get(index); - } else { - return tensorsBuilder_.getMessage(index); - } - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder setTensors( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.set(index, value); - onChanged(); - } else { - tensorsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder setTensors( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors(org.tensorflow.proto.framework.TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.add(value); - onChanged(); - } else { - tensorsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.add(index, value); - onChanged(); - } else { - tensorsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.add(builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addAllTensors( - java.lang.Iterable values) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensors_); - onChanged(); - } else { - tensorsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder clearTensors() { - if (tensorsBuilder_ == null) { - tensors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - tensorsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder removeTensors(int index) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.remove(index); - onChanged(); - } else { - tensorsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorsBuilder( - int index) { - return getTensorsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorsOrBuilder( - int index) { - if (tensorsBuilder_ == null) { - return tensors_.get(index); } else { - return tensorsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsOrBuilderList() { - if (tensorsBuilder_ != null) { - return tensorsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensors_); - } - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorsBuilder() { - return getTensorsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorsBuilder( - int index) { - return getTensorsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsBuilderList() { - return getTensorsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorsFieldBuilder() { - if (tensorsBuilder_ == null) { - tensorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - tensors_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tensors_ = null; - } - return tensorsBuilder_; - } - @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.VariantTensorDataProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VariantTensorDataProto) - private static final org.tensorflow.proto.framework.VariantTensorDataProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.VariantTensorDataProto(); - } - - public static org.tensorflow.proto.framework.VariantTensorDataProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VariantTensorDataProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VariantTensorDataProto(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.VariantTensorDataProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java deleted file mode 100644 index 916d583c328..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public interface VariantTensorDataProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.VariantTensorDataProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - java.lang.String getTypeName(); - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - com.google.protobuf.ByteString - getTypeNameBytes(); - - /** - *
    -   * Portions of the object that are not Tensors.
    -   * 
    - * - * bytes metadata = 2; - */ - com.google.protobuf.ByteString getMetadata(); - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - java.util.List - getTensorsList(); - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - org.tensorflow.proto.framework.TensorProto getTensors(int index); - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - int getTensorsCount(); - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - java.util.List - getTensorsOrBuilderList(); - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorsOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfig.java deleted file mode 100644 index c6099d9d2df..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfig.java +++ /dev/null @@ -1,725 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/verifier_config.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * The config for graph verifiers.
    - * 
    - * - * Protobuf type {@code tensorflow.VerifierConfig} - */ -public final class VerifierConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VerifierConfig) - VerifierConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use VerifierConfig.newBuilder() to construct. - private VerifierConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VerifierConfig() { - structureVerifier_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VerifierConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VerifierConfig( - 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: { - - verificationTimeoutInMs_ = input.readInt64(); - break; - } - case 16: { - int rawValue = input.readEnum(); - - structureVerifier_ = rawValue; - 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.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VerifierConfig.class, org.tensorflow.proto.framework.VerifierConfig.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.VerifierConfig.Toggle} - */ - public enum Toggle - 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 Toggle valueOf(int value) { - return forNumber(value); - } - - public static Toggle 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< - Toggle> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Toggle findValueByNumber(int number) { - return Toggle.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.VerifierConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final Toggle[] VALUES = values(); - - public static Toggle 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 Toggle(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.VerifierConfig.Toggle) - } - - public static final int VERIFICATION_TIMEOUT_IN_MS_FIELD_NUMBER = 1; - private long verificationTimeoutInMs_; - /** - *
    -   * Deadline for completion of all verification i.e. all the Toggle ON
    -   * verifiers must complete execution within this time.
    -   * 
    - * - * int64 verification_timeout_in_ms = 1; - */ - public long getVerificationTimeoutInMs() { - return verificationTimeoutInMs_; - } - - public static final int STRUCTURE_VERIFIER_FIELD_NUMBER = 2; - private int structureVerifier_; - /** - *
    -   * Perform structural validation on a tensorflow graph. Default is OFF.
    -   * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public int getStructureVerifierValue() { - return structureVerifier_; - } - /** - *
    -   * Perform structural validation on a tensorflow graph. Default is OFF.
    -   * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public org.tensorflow.proto.framework.VerifierConfig.Toggle getStructureVerifier() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VerifierConfig.Toggle result = org.tensorflow.proto.framework.VerifierConfig.Toggle.valueOf(structureVerifier_); - return result == null ? org.tensorflow.proto.framework.VerifierConfig.Toggle.UNRECOGNIZED : result; - } - - 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 (verificationTimeoutInMs_ != 0L) { - output.writeInt64(1, verificationTimeoutInMs_); - } - if (structureVerifier_ != org.tensorflow.proto.framework.VerifierConfig.Toggle.DEFAULT.getNumber()) { - output.writeEnum(2, structureVerifier_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (verificationTimeoutInMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, verificationTimeoutInMs_); - } - if (structureVerifier_ != org.tensorflow.proto.framework.VerifierConfig.Toggle.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, structureVerifier_); - } - 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.VerifierConfig)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.VerifierConfig other = (org.tensorflow.proto.framework.VerifierConfig) obj; - - if (getVerificationTimeoutInMs() - != other.getVerificationTimeoutInMs()) return false; - if (structureVerifier_ != other.structureVerifier_) 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) + VERIFICATION_TIMEOUT_IN_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getVerificationTimeoutInMs()); - hash = (37 * hash) + STRUCTURE_VERIFIER_FIELD_NUMBER; - hash = (53 * hash) + structureVerifier_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.VerifierConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VerifierConfig 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.VerifierConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VerifierConfig 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.VerifierConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VerifierConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.VerifierConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VerifierConfig 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.VerifierConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VerifierConfig 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.VerifierConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VerifierConfig 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.VerifierConfig 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; - } - /** - *
    -   * The config for graph verifiers.
    -   * 
    - * - * Protobuf type {@code tensorflow.VerifierConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VerifierConfig) - org.tensorflow.proto.framework.VerifierConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VerifierConfig.class, org.tensorflow.proto.framework.VerifierConfig.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.VerifierConfig.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(); - verificationTimeoutInMs_ = 0L; - - structureVerifier_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VerifierConfig getDefaultInstanceForType() { - return org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.VerifierConfig build() { - org.tensorflow.proto.framework.VerifierConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VerifierConfig buildPartial() { - org.tensorflow.proto.framework.VerifierConfig result = new org.tensorflow.proto.framework.VerifierConfig(this); - result.verificationTimeoutInMs_ = verificationTimeoutInMs_; - result.structureVerifier_ = structureVerifier_; - 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.VerifierConfig) { - return mergeFrom((org.tensorflow.proto.framework.VerifierConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.VerifierConfig other) { - if (other == org.tensorflow.proto.framework.VerifierConfig.getDefaultInstance()) return this; - if (other.getVerificationTimeoutInMs() != 0L) { - setVerificationTimeoutInMs(other.getVerificationTimeoutInMs()); - } - if (other.structureVerifier_ != 0) { - setStructureVerifierValue(other.getStructureVerifierValue()); - } - 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.VerifierConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.VerifierConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long verificationTimeoutInMs_ ; - /** - *
    -     * Deadline for completion of all verification i.e. all the Toggle ON
    -     * verifiers must complete execution within this time.
    -     * 
    - * - * int64 verification_timeout_in_ms = 1; - */ - public long getVerificationTimeoutInMs() { - return verificationTimeoutInMs_; - } - /** - *
    -     * Deadline for completion of all verification i.e. all the Toggle ON
    -     * verifiers must complete execution within this time.
    -     * 
    - * - * int64 verification_timeout_in_ms = 1; - */ - public Builder setVerificationTimeoutInMs(long value) { - - verificationTimeoutInMs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Deadline for completion of all verification i.e. all the Toggle ON
    -     * verifiers must complete execution within this time.
    -     * 
    - * - * int64 verification_timeout_in_ms = 1; - */ - public Builder clearVerificationTimeoutInMs() { - - verificationTimeoutInMs_ = 0L; - onChanged(); - return this; - } - - private int structureVerifier_ = 0; - /** - *
    -     * Perform structural validation on a tensorflow graph. Default is OFF.
    -     * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public int getStructureVerifierValue() { - return structureVerifier_; - } - /** - *
    -     * Perform structural validation on a tensorflow graph. Default is OFF.
    -     * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public Builder setStructureVerifierValue(int value) { - structureVerifier_ = value; - onChanged(); - return this; - } - /** - *
    -     * Perform structural validation on a tensorflow graph. Default is OFF.
    -     * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public org.tensorflow.proto.framework.VerifierConfig.Toggle getStructureVerifier() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.VerifierConfig.Toggle result = org.tensorflow.proto.framework.VerifierConfig.Toggle.valueOf(structureVerifier_); - return result == null ? org.tensorflow.proto.framework.VerifierConfig.Toggle.UNRECOGNIZED : result; - } - /** - *
    -     * Perform structural validation on a tensorflow graph. Default is OFF.
    -     * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public Builder setStructureVerifier(org.tensorflow.proto.framework.VerifierConfig.Toggle value) { - if (value == null) { - throw new NullPointerException(); - } - - structureVerifier_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Perform structural validation on a tensorflow graph. Default is OFF.
    -     * 
    - * - * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; - */ - public Builder clearStructureVerifier() { - - structureVerifier_ = 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.VerifierConfig) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VerifierConfig) - private static final org.tensorflow.proto.framework.VerifierConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.VerifierConfig(); - } - - public static org.tensorflow.proto.framework.VerifierConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VerifierConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VerifierConfig(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.VerifierConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index f0c11d7b318..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigProtos.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/verifier_config.proto - -package org.tensorflow.proto.framework; - -public final class VerifierConfigProtos { - private VerifierConfigProtos() {} - 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_VerifierConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_VerifierConfig_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/verifier_conf" + - "ig.proto\022\ntensorflow\"\233\001\n\016VerifierConfig\022" + - "\"\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\222\001\n\036org.tensorflow.pr" + - "oto.frameworkB\024VerifierConfigProtosP\001ZUg" + - "ithub.com/tensorflow/tensorflow/tensorfl" + - "ow/go/core/protobuf/for_core_protos_go_p" + - "roto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_VerifierConfig_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_VerifierConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_VerifierConfig_descriptor, - new java.lang.String[] { "VerificationTimeoutInMs", "StructureVerifier", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDef.java deleted file mode 100644 index 6e83b2aa792..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDef.java +++ /dev/null @@ -1,792 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/versions.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Version information for a piece of serialized data
    - * There are different types of versions for each type of data
    - * (GraphDef, etc.), but they all have the same common shape
    - * described here.
    - * Each consumer has "consumer" and "min_producer" versions (specified
    - * elsewhere).  A consumer is allowed to consume this data if
    - *   producer >= min_producer
    - *   consumer >= min_consumer
    - *   consumer not in bad_consumers
    - * 
    - * - * Protobuf type {@code tensorflow.VersionDef} - */ -public final class VersionDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VersionDef) - VersionDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use VersionDef.newBuilder() to construct. - private VersionDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VersionDef() { - badConsumers_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VersionDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VersionDef( - 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: { - - producer_ = input.readInt32(); - break; - } - case 16: { - - minConsumer_ = input.readInt32(); - break; - } - case 24: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - badConsumers_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - badConsumers_.addInt(input.readInt32()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - badConsumers_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - badConsumers_.addInt(input.readInt32()); - } - input.popLimit(limit); - 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)) { - badConsumers_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VersionsProtos.internal_static_tensorflow_VersionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VersionDef.class, org.tensorflow.proto.framework.VersionDef.Builder.class); - } - - public static final int PRODUCER_FIELD_NUMBER = 1; - private int producer_; - /** - *
    -   * The version of the code that produced this data.
    -   * 
    - * - * int32 producer = 1; - */ - public int getProducer() { - return producer_; - } - - public static final int MIN_CONSUMER_FIELD_NUMBER = 2; - private int minConsumer_; - /** - *
    -   * Any consumer below this version is not allowed to consume this data.
    -   * 
    - * - * int32 min_consumer = 2; - */ - public int getMinConsumer() { - return minConsumer_; - } - - public static final int BAD_CONSUMERS_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.IntList badConsumers_; - /** - *
    -   * Specific consumer versions which are disallowed (e.g. due to bugs).
    -   * 
    - * - * repeated int32 bad_consumers = 3; - */ - public java.util.List - getBadConsumersList() { - return badConsumers_; - } - /** - *
    -   * Specific consumer versions which are disallowed (e.g. due to bugs).
    -   * 
    - * - * repeated int32 bad_consumers = 3; - */ - public int getBadConsumersCount() { - return badConsumers_.size(); - } - /** - *
    -   * Specific consumer versions which are disallowed (e.g. due to bugs).
    -   * 
    - * - * repeated int32 bad_consumers = 3; - */ - public int getBadConsumers(int index) { - return badConsumers_.getInt(index); - } - private int badConsumersMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (producer_ != 0) { - output.writeInt32(1, producer_); - } - if (minConsumer_ != 0) { - output.writeInt32(2, minConsumer_); - } - if (getBadConsumersList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(badConsumersMemoizedSerializedSize); - } - for (int i = 0; i < badConsumers_.size(); i++) { - output.writeInt32NoTag(badConsumers_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (producer_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, producer_); - } - if (minConsumer_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, minConsumer_); - } - { - int dataSize = 0; - for (int i = 0; i < badConsumers_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(badConsumers_.getInt(i)); - } - size += dataSize; - if (!getBadConsumersList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - badConsumersMemoizedSerializedSize = dataSize; - } - 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.VersionDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.VersionDef other = (org.tensorflow.proto.framework.VersionDef) obj; - - if (getProducer() - != other.getProducer()) return false; - if (getMinConsumer() - != other.getMinConsumer()) return false; - if (!getBadConsumersList() - .equals(other.getBadConsumersList())) 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) + PRODUCER_FIELD_NUMBER; - hash = (53 * hash) + getProducer(); - hash = (37 * hash) + MIN_CONSUMER_FIELD_NUMBER; - hash = (53 * hash) + getMinConsumer(); - if (getBadConsumersCount() > 0) { - hash = (37 * hash) + BAD_CONSUMERS_FIELD_NUMBER; - hash = (53 * hash) + getBadConsumersList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.VersionDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VersionDef 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.VersionDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VersionDef 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.VersionDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.VersionDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.VersionDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VersionDef 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.VersionDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VersionDef 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.VersionDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.VersionDef 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.VersionDef 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; - } - /** - *
    -   * Version information for a piece of serialized data
    -   * There are different types of versions for each type of data
    -   * (GraphDef, etc.), but they all have the same common shape
    -   * described here.
    -   * Each consumer has "consumer" and "min_producer" versions (specified
    -   * elsewhere).  A consumer is allowed to consume this data if
    -   *   producer >= min_producer
    -   *   consumer >= min_consumer
    -   *   consumer not in bad_consumers
    -   * 
    - * - * Protobuf type {@code tensorflow.VersionDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VersionDef) - org.tensorflow.proto.framework.VersionDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.VersionsProtos.internal_static_tensorflow_VersionDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.VersionDef.class, org.tensorflow.proto.framework.VersionDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.VersionDef.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(); - producer_ = 0; - - minConsumer_ = 0; - - badConsumers_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VersionDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.VersionDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.VersionDef build() { - org.tensorflow.proto.framework.VersionDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.VersionDef buildPartial() { - org.tensorflow.proto.framework.VersionDef result = new org.tensorflow.proto.framework.VersionDef(this); - int from_bitField0_ = bitField0_; - result.producer_ = producer_; - result.minConsumer_ = minConsumer_; - if (((bitField0_ & 0x00000001) != 0)) { - badConsumers_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.badConsumers_ = badConsumers_; - 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.VersionDef) { - return mergeFrom((org.tensorflow.proto.framework.VersionDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.VersionDef other) { - if (other == org.tensorflow.proto.framework.VersionDef.getDefaultInstance()) return this; - if (other.getProducer() != 0) { - setProducer(other.getProducer()); - } - if (other.getMinConsumer() != 0) { - setMinConsumer(other.getMinConsumer()); - } - if (!other.badConsumers_.isEmpty()) { - if (badConsumers_.isEmpty()) { - badConsumers_ = other.badConsumers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBadConsumersIsMutable(); - badConsumers_.addAll(other.badConsumers_); - } - onChanged(); - } - 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.VersionDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.VersionDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int producer_ ; - /** - *
    -     * The version of the code that produced this data.
    -     * 
    - * - * int32 producer = 1; - */ - public int getProducer() { - return producer_; - } - /** - *
    -     * The version of the code that produced this data.
    -     * 
    - * - * int32 producer = 1; - */ - public Builder setProducer(int value) { - - producer_ = value; - onChanged(); - return this; - } - /** - *
    -     * The version of the code that produced this data.
    -     * 
    - * - * int32 producer = 1; - */ - public Builder clearProducer() { - - producer_ = 0; - onChanged(); - return this; - } - - private int minConsumer_ ; - /** - *
    -     * Any consumer below this version is not allowed to consume this data.
    -     * 
    - * - * int32 min_consumer = 2; - */ - public int getMinConsumer() { - return minConsumer_; - } - /** - *
    -     * Any consumer below this version is not allowed to consume this data.
    -     * 
    - * - * int32 min_consumer = 2; - */ - public Builder setMinConsumer(int value) { - - minConsumer_ = value; - onChanged(); - return this; - } - /** - *
    -     * Any consumer below this version is not allowed to consume this data.
    -     * 
    - * - * int32 min_consumer = 2; - */ - public Builder clearMinConsumer() { - - minConsumer_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList badConsumers_ = emptyIntList(); - private void ensureBadConsumersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - badConsumers_ = mutableCopy(badConsumers_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public java.util.List - getBadConsumersList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(badConsumers_) : badConsumers_; - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public int getBadConsumersCount() { - return badConsumers_.size(); - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public int getBadConsumers(int index) { - return badConsumers_.getInt(index); - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public Builder setBadConsumers( - int index, int value) { - ensureBadConsumersIsMutable(); - badConsumers_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public Builder addBadConsumers(int value) { - ensureBadConsumersIsMutable(); - badConsumers_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public Builder addAllBadConsumers( - java.lang.Iterable values) { - ensureBadConsumersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, badConsumers_); - onChanged(); - return this; - } - /** - *
    -     * Specific consumer versions which are disallowed (e.g. due to bugs).
    -     * 
    - * - * repeated int32 bad_consumers = 3; - */ - public Builder clearBadConsumers() { - badConsumers_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - 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.VersionDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VersionDef) - private static final org.tensorflow.proto.framework.VersionDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.VersionDef(); - } - - public static org.tensorflow.proto.framework.VersionDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VersionDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VersionDef(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.VersionDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionsProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionsProtos.java deleted file mode 100644 index 0597ff6e213..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionsProtos.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/versions.proto - -package org.tensorflow.proto.framework; - -public final class VersionsProtos { - private VersionsProtos() {} - 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_VersionDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_VersionDef_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/framework/versions.pro" + - "to\022\ntensorflow\"K\n\nVersionDef\022\020\n\010producer" + - "\030\001 \001(\005\022\024\n\014min_consumer\030\002 \001(\005\022\025\n\rbad_cons" + - "umers\030\003 \003(\005B\206\001\n\036org.tensorflow.proto.fra" + - "meworkB\016VersionsProtosP\001ZOgithub.com/ten" + - "sorflow/tensorflow/tensorflow/go/core/fr" + - "amework/versions_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_VersionDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_VersionDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_VersionDef_descriptor, - new java.lang.String[] { "Producer", "MinConsumer", "BadConsumers", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDef.java deleted file mode 100644 index 9bd67ab7bcd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDef.java +++ /dev/null @@ -1,2534 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/control_flow.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a WhileContext object.
    - * 
    - * - * Protobuf type {@code tensorflow.WhileContextDef} - */ -public final class WhileContextDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.WhileContextDef) - WhileContextDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use WhileContextDef.newBuilder() to construct. - private WhileContextDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WhileContextDef() { - contextName_ = ""; - pivotName_ = ""; - pivotForPredName_ = ""; - pivotForBodyName_ = ""; - loopExitNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - loopEnterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - maximumIterationsName_ = ""; - nestedContexts_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WhileContextDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WhileContextDef( - 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(); - - contextName_ = s; - break; - } - case 16: { - - parallelIterations_ = input.readInt32(); - break; - } - case 24: { - - backProp_ = input.readBool(); - break; - } - case 32: { - - swapMemory_ = input.readBool(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - pivotName_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - pivotForPredName_ = s; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - pivotForBodyName_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - loopExitNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - loopExitNames_.add(s); - break; - } - case 74: { - org.tensorflow.proto.framework.ValuesDef.Builder subBuilder = null; - if (valuesDef_ != null) { - subBuilder = valuesDef_.toBuilder(); - } - valuesDef_ = input.readMessage(org.tensorflow.proto.framework.ValuesDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(valuesDef_); - valuesDef_ = subBuilder.buildPartial(); - } - - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - loopEnterNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - loopEnterNames_.add(s); - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - maximumIterationsName_ = s; - break; - } - case 98: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - nestedContexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - nestedContexts_.add( - input.readMessage(org.tensorflow.proto.framework.ControlFlowContextDef.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_ & 0x00000001) != 0)) { - loopExitNames_ = loopExitNames_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - loopEnterNames_ = loopEnterNames_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.WhileContextDef.class, org.tensorflow.proto.framework.WhileContextDef.Builder.class); - } - - public static final int CONTEXT_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object contextName_; - /** - *
    -   * Name of the context.
    -   * 
    - * - * string context_name = 1; - */ - public java.lang.String getContextName() { - java.lang.Object ref = contextName_; - 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(); - contextName_ = s; - return s; - } - } - /** - *
    -   * Name of the context.
    -   * 
    - * - * string context_name = 1; - */ - public com.google.protobuf.ByteString - getContextNameBytes() { - java.lang.Object ref = contextName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contextName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PARALLEL_ITERATIONS_FIELD_NUMBER = 2; - private int parallelIterations_; - /** - *
    -   * The number of iterations allowed to run in parallel.
    -   * 
    - * - * int32 parallel_iterations = 2; - */ - public int getParallelIterations() { - return parallelIterations_; - } - - public static final int BACK_PROP_FIELD_NUMBER = 3; - private boolean backProp_; - /** - *
    -   * Whether backprop is enabled for this while loop.
    -   * 
    - * - * bool back_prop = 3; - */ - public boolean getBackProp() { - return backProp_; - } - - public static final int SWAP_MEMORY_FIELD_NUMBER = 4; - private boolean swapMemory_; - /** - *
    -   * Whether GPU-CPU memory swap is enabled for this loop.
    -   * 
    - * - * bool swap_memory = 4; - */ - public boolean getSwapMemory() { - return swapMemory_; - } - - public static final int PIVOT_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object pivotName_; - /** - *
    -   * Name of the pivot tensor.
    -   * 
    - * - * string pivot_name = 5; - */ - public java.lang.String getPivotName() { - java.lang.Object ref = pivotName_; - 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(); - pivotName_ = s; - return s; - } - } - /** - *
    -   * Name of the pivot tensor.
    -   * 
    - * - * string pivot_name = 5; - */ - public com.google.protobuf.ByteString - getPivotNameBytes() { - java.lang.Object ref = pivotName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PIVOT_FOR_PRED_NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object pivotForPredName_; - /** - *
    -   * Name of the pivot_for_pred tensor.
    -   * 
    - * - * string pivot_for_pred_name = 6; - */ - public java.lang.String getPivotForPredName() { - java.lang.Object ref = pivotForPredName_; - 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(); - pivotForPredName_ = s; - return s; - } - } - /** - *
    -   * Name of the pivot_for_pred tensor.
    -   * 
    - * - * string pivot_for_pred_name = 6; - */ - public com.google.protobuf.ByteString - getPivotForPredNameBytes() { - java.lang.Object ref = pivotForPredName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotForPredName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PIVOT_FOR_BODY_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object pivotForBodyName_; - /** - *
    -   * Name of the pivot_for_body tensor.
    -   * 
    - * - * string pivot_for_body_name = 7; - */ - public java.lang.String getPivotForBodyName() { - java.lang.Object ref = pivotForBodyName_; - 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(); - pivotForBodyName_ = s; - return s; - } - } - /** - *
    -   * Name of the pivot_for_body tensor.
    -   * 
    - * - * string pivot_for_body_name = 7; - */ - public com.google.protobuf.ByteString - getPivotForBodyNameBytes() { - java.lang.Object ref = pivotForBodyName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotForBodyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LOOP_EXIT_NAMES_FIELD_NUMBER = 8; - private com.google.protobuf.LazyStringList loopExitNames_; - /** - *
    -   * List of names for exit tensors.
    -   * 
    - * - * repeated string loop_exit_names = 8; - */ - public com.google.protobuf.ProtocolStringList - getLoopExitNamesList() { - return loopExitNames_; - } - /** - *
    -   * List of names for exit tensors.
    -   * 
    - * - * repeated string loop_exit_names = 8; - */ - public int getLoopExitNamesCount() { - return loopExitNames_.size(); - } - /** - *
    -   * List of names for exit tensors.
    -   * 
    - * - * repeated string loop_exit_names = 8; - */ - public java.lang.String getLoopExitNames(int index) { - return loopExitNames_.get(index); - } - /** - *
    -   * List of names for exit tensors.
    -   * 
    - * - * repeated string loop_exit_names = 8; - */ - public com.google.protobuf.ByteString - getLoopExitNamesBytes(int index) { - return loopExitNames_.getByteString(index); - } - - public static final int LOOP_ENTER_NAMES_FIELD_NUMBER = 10; - private com.google.protobuf.LazyStringList loopEnterNames_; - /** - *
    -   * List of names for enter tensors.
    -   * 
    - * - * repeated string loop_enter_names = 10; - */ - public com.google.protobuf.ProtocolStringList - getLoopEnterNamesList() { - return loopEnterNames_; - } - /** - *
    -   * List of names for enter tensors.
    -   * 
    - * - * repeated string loop_enter_names = 10; - */ - public int getLoopEnterNamesCount() { - return loopEnterNames_.size(); - } - /** - *
    -   * List of names for enter tensors.
    -   * 
    - * - * repeated string loop_enter_names = 10; - */ - public java.lang.String getLoopEnterNames(int index) { - return loopEnterNames_.get(index); - } - /** - *
    -   * List of names for enter tensors.
    -   * 
    - * - * repeated string loop_enter_names = 10; - */ - public com.google.protobuf.ByteString - getLoopEnterNamesBytes(int index) { - return loopEnterNames_.getByteString(index); - } - - public static final int VALUES_DEF_FIELD_NUMBER = 9; - private org.tensorflow.proto.framework.ValuesDef valuesDef_; - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public boolean hasValuesDef() { - return valuesDef_ != null; - } - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public org.tensorflow.proto.framework.ValuesDef getValuesDef() { - return valuesDef_ == null ? org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } - /** - *
    -   * Values and external values in control flow context.
    -   * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder() { - return getValuesDef(); - } - - public static final int MAXIMUM_ITERATIONS_NAME_FIELD_NUMBER = 11; - private volatile java.lang.Object maximumIterationsName_; - /** - *
    -   * Optional name of the maximum_iterations tensor.
    -   * 
    - * - * string maximum_iterations_name = 11; - */ - public java.lang.String getMaximumIterationsName() { - java.lang.Object ref = maximumIterationsName_; - 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(); - maximumIterationsName_ = s; - return s; - } - } - /** - *
    -   * Optional name of the maximum_iterations tensor.
    -   * 
    - * - * string maximum_iterations_name = 11; - */ - public com.google.protobuf.ByteString - getMaximumIterationsNameBytes() { - java.lang.Object ref = maximumIterationsName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - maximumIterationsName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NESTED_CONTEXTS_FIELD_NUMBER = 12; - private java.util.List nestedContexts_; - /** - *
    -   * Contexts contained inside this context (e.g. nested whiles).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public java.util.List getNestedContextsList() { - return nestedContexts_; - } - /** - *
    -   * Contexts contained inside this context (e.g. nested whiles).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public java.util.List - getNestedContextsOrBuilderList() { - return nestedContexts_; - } - /** - *
    -   * Contexts contained inside this context (e.g. nested whiles).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public int getNestedContextsCount() { - return nestedContexts_.size(); - } - /** - *
    -   * Contexts contained inside this context (e.g. nested whiles).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index) { - return nestedContexts_.get(index); - } - /** - *
    -   * Contexts contained inside this context (e.g. nested whiles).
    -   * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( - int index) { - return nestedContexts_.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 { - if (!getContextNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contextName_); - } - if (parallelIterations_ != 0) { - output.writeInt32(2, parallelIterations_); - } - if (backProp_ != false) { - output.writeBool(3, backProp_); - } - if (swapMemory_ != false) { - output.writeBool(4, swapMemory_); - } - if (!getPivotNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pivotName_); - } - if (!getPivotForPredNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pivotForPredName_); - } - if (!getPivotForBodyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pivotForBodyName_); - } - for (int i = 0; i < loopExitNames_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, loopExitNames_.getRaw(i)); - } - if (valuesDef_ != null) { - output.writeMessage(9, getValuesDef()); - } - for (int i = 0; i < loopEnterNames_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, loopEnterNames_.getRaw(i)); - } - if (!getMaximumIterationsNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, maximumIterationsName_); - } - for (int i = 0; i < nestedContexts_.size(); i++) { - output.writeMessage(12, nestedContexts_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getContextNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contextName_); - } - if (parallelIterations_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, parallelIterations_); - } - if (backProp_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, backProp_); - } - if (swapMemory_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, swapMemory_); - } - if (!getPivotNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pivotName_); - } - if (!getPivotForPredNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pivotForPredName_); - } - if (!getPivotForBodyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pivotForBodyName_); - } - { - int dataSize = 0; - for (int i = 0; i < loopExitNames_.size(); i++) { - dataSize += computeStringSizeNoTag(loopExitNames_.getRaw(i)); - } - size += dataSize; - size += 1 * getLoopExitNamesList().size(); - } - if (valuesDef_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getValuesDef()); - } - { - int dataSize = 0; - for (int i = 0; i < loopEnterNames_.size(); i++) { - dataSize += computeStringSizeNoTag(loopEnterNames_.getRaw(i)); - } - size += dataSize; - size += 1 * getLoopEnterNamesList().size(); - } - if (!getMaximumIterationsNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, maximumIterationsName_); - } - for (int i = 0; i < nestedContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, nestedContexts_.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.WhileContextDef)) { - return super.equals(obj); - } - org.tensorflow.proto.framework.WhileContextDef other = (org.tensorflow.proto.framework.WhileContextDef) obj; - - if (!getContextName() - .equals(other.getContextName())) return false; - if (getParallelIterations() - != other.getParallelIterations()) return false; - if (getBackProp() - != other.getBackProp()) return false; - if (getSwapMemory() - != other.getSwapMemory()) return false; - if (!getPivotName() - .equals(other.getPivotName())) return false; - if (!getPivotForPredName() - .equals(other.getPivotForPredName())) return false; - if (!getPivotForBodyName() - .equals(other.getPivotForBodyName())) return false; - if (!getLoopExitNamesList() - .equals(other.getLoopExitNamesList())) return false; - if (!getLoopEnterNamesList() - .equals(other.getLoopEnterNamesList())) return false; - if (hasValuesDef() != other.hasValuesDef()) return false; - if (hasValuesDef()) { - if (!getValuesDef() - .equals(other.getValuesDef())) return false; - } - if (!getMaximumIterationsName() - .equals(other.getMaximumIterationsName())) return false; - if (!getNestedContextsList() - .equals(other.getNestedContextsList())) 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) + CONTEXT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getContextName().hashCode(); - hash = (37 * hash) + PARALLEL_ITERATIONS_FIELD_NUMBER; - hash = (53 * hash) + getParallelIterations(); - hash = (37 * hash) + BACK_PROP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getBackProp()); - hash = (37 * hash) + SWAP_MEMORY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSwapMemory()); - hash = (37 * hash) + PIVOT_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPivotName().hashCode(); - hash = (37 * hash) + PIVOT_FOR_PRED_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPivotForPredName().hashCode(); - hash = (37 * hash) + PIVOT_FOR_BODY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPivotForBodyName().hashCode(); - if (getLoopExitNamesCount() > 0) { - hash = (37 * hash) + LOOP_EXIT_NAMES_FIELD_NUMBER; - hash = (53 * hash) + getLoopExitNamesList().hashCode(); - } - if (getLoopEnterNamesCount() > 0) { - hash = (37 * hash) + LOOP_ENTER_NAMES_FIELD_NUMBER; - hash = (53 * hash) + getLoopEnterNamesList().hashCode(); - } - if (hasValuesDef()) { - hash = (37 * hash) + VALUES_DEF_FIELD_NUMBER; - hash = (53 * hash) + getValuesDef().hashCode(); - } - hash = (37 * hash) + MAXIMUM_ITERATIONS_NAME_FIELD_NUMBER; - hash = (53 * hash) + getMaximumIterationsName().hashCode(); - if (getNestedContextsCount() > 0) { - hash = (37 * hash) + NESTED_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getNestedContextsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.framework.WhileContextDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.WhileContextDef 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.WhileContextDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.WhileContextDef 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.WhileContextDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.framework.WhileContextDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.framework.WhileContextDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.WhileContextDef 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.WhileContextDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.WhileContextDef 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.WhileContextDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.framework.WhileContextDef 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.WhileContextDef 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; - } - /** - *
    -   * Protocol buffer representing a WhileContext object.
    -   * 
    - * - * Protobuf type {@code tensorflow.WhileContextDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.WhileContextDef) - org.tensorflow.proto.framework.WhileContextDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.framework.WhileContextDef.class, org.tensorflow.proto.framework.WhileContextDef.Builder.class); - } - - // Construct using org.tensorflow.proto.framework.WhileContextDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getNestedContextsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - contextName_ = ""; - - parallelIterations_ = 0; - - backProp_ = false; - - swapMemory_ = false; - - pivotName_ = ""; - - pivotForPredName_ = ""; - - pivotForBodyName_ = ""; - - loopExitNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - loopEnterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - if (valuesDefBuilder_ == null) { - valuesDef_ = null; - } else { - valuesDef_ = null; - valuesDefBuilder_ = null; - } - maximumIterationsName_ = ""; - - if (nestedContextsBuilder_ == null) { - nestedContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - nestedContextsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.framework.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.framework.WhileContextDef getDefaultInstanceForType() { - return org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.framework.WhileContextDef build() { - org.tensorflow.proto.framework.WhileContextDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.framework.WhileContextDef buildPartial() { - org.tensorflow.proto.framework.WhileContextDef result = new org.tensorflow.proto.framework.WhileContextDef(this); - int from_bitField0_ = bitField0_; - result.contextName_ = contextName_; - result.parallelIterations_ = parallelIterations_; - result.backProp_ = backProp_; - result.swapMemory_ = swapMemory_; - result.pivotName_ = pivotName_; - result.pivotForPredName_ = pivotForPredName_; - result.pivotForBodyName_ = pivotForBodyName_; - if (((bitField0_ & 0x00000001) != 0)) { - loopExitNames_ = loopExitNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.loopExitNames_ = loopExitNames_; - if (((bitField0_ & 0x00000002) != 0)) { - loopEnterNames_ = loopEnterNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.loopEnterNames_ = loopEnterNames_; - if (valuesDefBuilder_ == null) { - result.valuesDef_ = valuesDef_; - } else { - result.valuesDef_ = valuesDefBuilder_.build(); - } - result.maximumIterationsName_ = maximumIterationsName_; - if (nestedContextsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.nestedContexts_ = nestedContexts_; - } else { - result.nestedContexts_ = nestedContextsBuilder_.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.WhileContextDef) { - return mergeFrom((org.tensorflow.proto.framework.WhileContextDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.framework.WhileContextDef other) { - if (other == org.tensorflow.proto.framework.WhileContextDef.getDefaultInstance()) return this; - if (!other.getContextName().isEmpty()) { - contextName_ = other.contextName_; - onChanged(); - } - if (other.getParallelIterations() != 0) { - setParallelIterations(other.getParallelIterations()); - } - if (other.getBackProp() != false) { - setBackProp(other.getBackProp()); - } - if (other.getSwapMemory() != false) { - setSwapMemory(other.getSwapMemory()); - } - if (!other.getPivotName().isEmpty()) { - pivotName_ = other.pivotName_; - onChanged(); - } - if (!other.getPivotForPredName().isEmpty()) { - pivotForPredName_ = other.pivotForPredName_; - onChanged(); - } - if (!other.getPivotForBodyName().isEmpty()) { - pivotForBodyName_ = other.pivotForBodyName_; - onChanged(); - } - if (!other.loopExitNames_.isEmpty()) { - if (loopExitNames_.isEmpty()) { - loopExitNames_ = other.loopExitNames_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureLoopExitNamesIsMutable(); - loopExitNames_.addAll(other.loopExitNames_); - } - onChanged(); - } - if (!other.loopEnterNames_.isEmpty()) { - if (loopEnterNames_.isEmpty()) { - loopEnterNames_ = other.loopEnterNames_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureLoopEnterNamesIsMutable(); - loopEnterNames_.addAll(other.loopEnterNames_); - } - onChanged(); - } - if (other.hasValuesDef()) { - mergeValuesDef(other.getValuesDef()); - } - if (!other.getMaximumIterationsName().isEmpty()) { - maximumIterationsName_ = other.maximumIterationsName_; - onChanged(); - } - if (nestedContextsBuilder_ == null) { - if (!other.nestedContexts_.isEmpty()) { - if (nestedContexts_.isEmpty()) { - nestedContexts_ = other.nestedContexts_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureNestedContextsIsMutable(); - nestedContexts_.addAll(other.nestedContexts_); - } - onChanged(); - } - } else { - if (!other.nestedContexts_.isEmpty()) { - if (nestedContextsBuilder_.isEmpty()) { - nestedContextsBuilder_.dispose(); - nestedContextsBuilder_ = null; - nestedContexts_ = other.nestedContexts_; - bitField0_ = (bitField0_ & ~0x00000004); - nestedContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getNestedContextsFieldBuilder() : null; - } else { - nestedContextsBuilder_.addAllMessages(other.nestedContexts_); - } - } - } - 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.WhileContextDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.framework.WhileContextDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object contextName_ = ""; - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public java.lang.String getContextName() { - java.lang.Object ref = contextName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - contextName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public com.google.protobuf.ByteString - getContextNameBytes() { - java.lang.Object ref = contextName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - contextName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder setContextName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - contextName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder clearContextName() { - - contextName_ = getDefaultInstance().getContextName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the context.
    -     * 
    - * - * string context_name = 1; - */ - public Builder setContextNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - contextName_ = value; - onChanged(); - return this; - } - - private int parallelIterations_ ; - /** - *
    -     * The number of iterations allowed to run in parallel.
    -     * 
    - * - * int32 parallel_iterations = 2; - */ - public int getParallelIterations() { - return parallelIterations_; - } - /** - *
    -     * The number of iterations allowed to run in parallel.
    -     * 
    - * - * int32 parallel_iterations = 2; - */ - public Builder setParallelIterations(int value) { - - parallelIterations_ = value; - onChanged(); - return this; - } - /** - *
    -     * The number of iterations allowed to run in parallel.
    -     * 
    - * - * int32 parallel_iterations = 2; - */ - public Builder clearParallelIterations() { - - parallelIterations_ = 0; - onChanged(); - return this; - } - - private boolean backProp_ ; - /** - *
    -     * Whether backprop is enabled for this while loop.
    -     * 
    - * - * bool back_prop = 3; - */ - public boolean getBackProp() { - return backProp_; - } - /** - *
    -     * Whether backprop is enabled for this while loop.
    -     * 
    - * - * bool back_prop = 3; - */ - public Builder setBackProp(boolean value) { - - backProp_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether backprop is enabled for this while loop.
    -     * 
    - * - * bool back_prop = 3; - */ - public Builder clearBackProp() { - - backProp_ = false; - onChanged(); - return this; - } - - private boolean swapMemory_ ; - /** - *
    -     * Whether GPU-CPU memory swap is enabled for this loop.
    -     * 
    - * - * bool swap_memory = 4; - */ - public boolean getSwapMemory() { - return swapMemory_; - } - /** - *
    -     * Whether GPU-CPU memory swap is enabled for this loop.
    -     * 
    - * - * bool swap_memory = 4; - */ - public Builder setSwapMemory(boolean value) { - - swapMemory_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether GPU-CPU memory swap is enabled for this loop.
    -     * 
    - * - * bool swap_memory = 4; - */ - public Builder clearSwapMemory() { - - swapMemory_ = false; - onChanged(); - return this; - } - - private java.lang.Object pivotName_ = ""; - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 5; - */ - public java.lang.String getPivotName() { - java.lang.Object ref = pivotName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pivotName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 5; - */ - public com.google.protobuf.ByteString - getPivotNameBytes() { - java.lang.Object ref = pivotName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 5; - */ - public Builder setPivotName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pivotName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 5; - */ - public Builder clearPivotName() { - - pivotName_ = getDefaultInstance().getPivotName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot tensor.
    -     * 
    - * - * string pivot_name = 5; - */ - public Builder setPivotNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pivotName_ = value; - onChanged(); - return this; - } - - private java.lang.Object pivotForPredName_ = ""; - /** - *
    -     * Name of the pivot_for_pred tensor.
    -     * 
    - * - * string pivot_for_pred_name = 6; - */ - public java.lang.String getPivotForPredName() { - java.lang.Object ref = pivotForPredName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pivotForPredName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the pivot_for_pred tensor.
    -     * 
    - * - * string pivot_for_pred_name = 6; - */ - public com.google.protobuf.ByteString - getPivotForPredNameBytes() { - java.lang.Object ref = pivotForPredName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotForPredName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the pivot_for_pred tensor.
    -     * 
    - * - * string pivot_for_pred_name = 6; - */ - public Builder setPivotForPredName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pivotForPredName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot_for_pred tensor.
    -     * 
    - * - * string pivot_for_pred_name = 6; - */ - public Builder clearPivotForPredName() { - - pivotForPredName_ = getDefaultInstance().getPivotForPredName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot_for_pred tensor.
    -     * 
    - * - * string pivot_for_pred_name = 6; - */ - public Builder setPivotForPredNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pivotForPredName_ = value; - onChanged(); - return this; - } - - private java.lang.Object pivotForBodyName_ = ""; - /** - *
    -     * Name of the pivot_for_body tensor.
    -     * 
    - * - * string pivot_for_body_name = 7; - */ - public java.lang.String getPivotForBodyName() { - java.lang.Object ref = pivotForBodyName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pivotForBodyName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the pivot_for_body tensor.
    -     * 
    - * - * string pivot_for_body_name = 7; - */ - public com.google.protobuf.ByteString - getPivotForBodyNameBytes() { - java.lang.Object ref = pivotForBodyName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pivotForBodyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the pivot_for_body tensor.
    -     * 
    - * - * string pivot_for_body_name = 7; - */ - public Builder setPivotForBodyName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pivotForBodyName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot_for_body tensor.
    -     * 
    - * - * string pivot_for_body_name = 7; - */ - public Builder clearPivotForBodyName() { - - pivotForBodyName_ = getDefaultInstance().getPivotForBodyName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the pivot_for_body tensor.
    -     * 
    - * - * string pivot_for_body_name = 7; - */ - public Builder setPivotForBodyNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pivotForBodyName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList loopExitNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureLoopExitNamesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - loopExitNames_ = new com.google.protobuf.LazyStringArrayList(loopExitNames_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public com.google.protobuf.ProtocolStringList - getLoopExitNamesList() { - return loopExitNames_.getUnmodifiableView(); - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public int getLoopExitNamesCount() { - return loopExitNames_.size(); - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public java.lang.String getLoopExitNames(int index) { - return loopExitNames_.get(index); - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public com.google.protobuf.ByteString - getLoopExitNamesBytes(int index) { - return loopExitNames_.getByteString(index); - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public Builder setLoopExitNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLoopExitNamesIsMutable(); - loopExitNames_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public Builder addLoopExitNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLoopExitNamesIsMutable(); - loopExitNames_.add(value); - onChanged(); - return this; - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public Builder addAllLoopExitNames( - java.lang.Iterable values) { - ensureLoopExitNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, loopExitNames_); - onChanged(); - return this; - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public Builder clearLoopExitNames() { - loopExitNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * List of names for exit tensors.
    -     * 
    - * - * repeated string loop_exit_names = 8; - */ - public Builder addLoopExitNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureLoopExitNamesIsMutable(); - loopExitNames_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList loopEnterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureLoopEnterNamesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - loopEnterNames_ = new com.google.protobuf.LazyStringArrayList(loopEnterNames_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public com.google.protobuf.ProtocolStringList - getLoopEnterNamesList() { - return loopEnterNames_.getUnmodifiableView(); - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public int getLoopEnterNamesCount() { - return loopEnterNames_.size(); - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public java.lang.String getLoopEnterNames(int index) { - return loopEnterNames_.get(index); - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public com.google.protobuf.ByteString - getLoopEnterNamesBytes(int index) { - return loopEnterNames_.getByteString(index); - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public Builder setLoopEnterNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLoopEnterNamesIsMutable(); - loopEnterNames_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public Builder addLoopEnterNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLoopEnterNamesIsMutable(); - loopEnterNames_.add(value); - onChanged(); - return this; - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public Builder addAllLoopEnterNames( - java.lang.Iterable values) { - ensureLoopEnterNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, loopEnterNames_); - onChanged(); - return this; - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public Builder clearLoopEnterNames() { - loopEnterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * List of names for enter tensors.
    -     * 
    - * - * repeated string loop_enter_names = 10; - */ - public Builder addLoopEnterNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureLoopEnterNamesIsMutable(); - loopEnterNames_.add(value); - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.ValuesDef valuesDef_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder> valuesDefBuilder_; - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public boolean hasValuesDef() { - return valuesDefBuilder_ != null || valuesDef_ != null; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public org.tensorflow.proto.framework.ValuesDef getValuesDef() { - if (valuesDefBuilder_ == null) { - return valuesDef_ == null ? org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } else { - return valuesDefBuilder_.getMessage(); - } - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public Builder setValuesDef(org.tensorflow.proto.framework.ValuesDef value) { - if (valuesDefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - valuesDef_ = value; - onChanged(); - } else { - valuesDefBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public Builder setValuesDef( - org.tensorflow.proto.framework.ValuesDef.Builder builderForValue) { - if (valuesDefBuilder_ == null) { - valuesDef_ = builderForValue.build(); - onChanged(); - } else { - valuesDefBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public Builder mergeValuesDef(org.tensorflow.proto.framework.ValuesDef value) { - if (valuesDefBuilder_ == null) { - if (valuesDef_ != null) { - valuesDef_ = - org.tensorflow.proto.framework.ValuesDef.newBuilder(valuesDef_).mergeFrom(value).buildPartial(); - } else { - valuesDef_ = value; - } - onChanged(); - } else { - valuesDefBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public Builder clearValuesDef() { - if (valuesDefBuilder_ == null) { - valuesDef_ = null; - onChanged(); - } else { - valuesDef_ = null; - valuesDefBuilder_ = null; - } - - return this; - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public org.tensorflow.proto.framework.ValuesDef.Builder getValuesDefBuilder() { - - onChanged(); - return getValuesDefFieldBuilder().getBuilder(); - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - public org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder() { - if (valuesDefBuilder_ != null) { - return valuesDefBuilder_.getMessageOrBuilder(); - } else { - return valuesDef_ == null ? - org.tensorflow.proto.framework.ValuesDef.getDefaultInstance() : valuesDef_; - } - } - /** - *
    -     * Values and external values in control flow context.
    -     * 
    - * - * .tensorflow.ValuesDef values_def = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder> - getValuesDefFieldBuilder() { - if (valuesDefBuilder_ == null) { - valuesDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.ValuesDef, org.tensorflow.proto.framework.ValuesDef.Builder, org.tensorflow.proto.framework.ValuesDefOrBuilder>( - getValuesDef(), - getParentForChildren(), - isClean()); - valuesDef_ = null; - } - return valuesDefBuilder_; - } - - private java.lang.Object maximumIterationsName_ = ""; - /** - *
    -     * Optional name of the maximum_iterations tensor.
    -     * 
    - * - * string maximum_iterations_name = 11; - */ - public java.lang.String getMaximumIterationsName() { - java.lang.Object ref = maximumIterationsName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - maximumIterationsName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Optional name of the maximum_iterations tensor.
    -     * 
    - * - * string maximum_iterations_name = 11; - */ - public com.google.protobuf.ByteString - getMaximumIterationsNameBytes() { - java.lang.Object ref = maximumIterationsName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - maximumIterationsName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Optional name of the maximum_iterations tensor.
    -     * 
    - * - * string maximum_iterations_name = 11; - */ - public Builder setMaximumIterationsName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - maximumIterationsName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Optional name of the maximum_iterations tensor.
    -     * 
    - * - * string maximum_iterations_name = 11; - */ - public Builder clearMaximumIterationsName() { - - maximumIterationsName_ = getDefaultInstance().getMaximumIterationsName(); - onChanged(); - return this; - } - /** - *
    -     * Optional name of the maximum_iterations tensor.
    -     * 
    - * - * string maximum_iterations_name = 11; - */ - public Builder setMaximumIterationsNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - maximumIterationsName_ = value; - onChanged(); - return this; - } - - private java.util.List nestedContexts_ = - java.util.Collections.emptyList(); - private void ensureNestedContextsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - nestedContexts_ = new java.util.ArrayList(nestedContexts_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder> nestedContextsBuilder_; - - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public java.util.List getNestedContextsList() { - if (nestedContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(nestedContexts_); - } else { - return nestedContextsBuilder_.getMessageList(); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public int getNestedContextsCount() { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.size(); - } else { - return nestedContextsBuilder_.getCount(); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index) { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.get(index); - } else { - return nestedContextsBuilder_.getMessage(index); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder setNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.set(index, value); - onChanged(); - } else { - nestedContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder setNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder addNestedContexts(org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.add(value); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder addNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef value) { - if (nestedContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureNestedContextsIsMutable(); - nestedContexts_.add(index, value); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder addNestedContexts( - org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.add(builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder addNestedContexts( - int index, org.tensorflow.proto.framework.ControlFlowContextDef.Builder builderForValue) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - nestedContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder addAllNestedContexts( - java.lang.Iterable values) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, nestedContexts_); - onChanged(); - } else { - nestedContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder clearNestedContexts() { - if (nestedContextsBuilder_ == null) { - nestedContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - nestedContextsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public Builder removeNestedContexts(int index) { - if (nestedContextsBuilder_ == null) { - ensureNestedContextsIsMutable(); - nestedContexts_.remove(index); - onChanged(); - } else { - nestedContextsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder getNestedContextsBuilder( - int index) { - return getNestedContextsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( - int index) { - if (nestedContextsBuilder_ == null) { - return nestedContexts_.get(index); } else { - return nestedContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public java.util.List - getNestedContextsOrBuilderList() { - if (nestedContextsBuilder_ != null) { - return nestedContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(nestedContexts_); - } - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder addNestedContextsBuilder() { - return getNestedContextsFieldBuilder().addBuilder( - org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance()); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public org.tensorflow.proto.framework.ControlFlowContextDef.Builder addNestedContextsBuilder( - int index) { - return getNestedContextsFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.ControlFlowContextDef.getDefaultInstance()); - } - /** - *
    -     * Contexts contained inside this context (e.g. nested whiles).
    -     * 
    - * - * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; - */ - public java.util.List - getNestedContextsBuilderList() { - return getNestedContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder> - getNestedContextsFieldBuilder() { - if (nestedContextsBuilder_ == null) { - nestedContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.ControlFlowContextDef, org.tensorflow.proto.framework.ControlFlowContextDef.Builder, org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder>( - nestedContexts_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - nestedContexts_ = null; - } - return nestedContextsBuilder_; - } - @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.WhileContextDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.WhileContextDef) - private static final org.tensorflow.proto.framework.WhileContextDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.framework.WhileContextDef(); - } - - public static org.tensorflow.proto.framework.WhileContextDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WhileContextDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WhileContextDef(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.WhileContextDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index ac974d89c17..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptions.java +++ /dev/null @@ -1,1491 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/profiler_options.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * Next ID: 11
    - * 
    - * - * Protobuf type {@code tensorflow.ProfileOptions} - */ -public final class ProfileOptions extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions) - ProfileOptionsOrBuilder { -private static final long serialVersionUID = 0L; - // Use ProfileOptions.newBuilder() to construct. - private ProfileOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ProfileOptions() { - deviceType_ = 0; - repositoryPath_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ProfileOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ProfileOptions( - 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: { - - includeDatasetOps_ = input.readBool(); - break; - } - case 16: { - - hostTracerLevel_ = input.readUInt32(); - break; - } - case 24: { - - deviceTracerLevel_ = input.readUInt32(); - break; - } - case 32: { - - pythonTracerLevel_ = input.readUInt32(); - break; - } - case 40: { - - version_ = input.readUInt32(); - break; - } - case 48: { - int rawValue = input.readEnum(); - - deviceType_ = rawValue; - break; - } - case 56: { - - 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)) { - 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.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.ProfileOptions.class, org.tensorflow.proto.profiler.ProfileOptions.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.ProfileOptions.DeviceType} - */ - public enum DeviceType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNSPECIFIED = 0; - */ - UNSPECIFIED(0), - /** - * CPU = 1; - */ - CPU(1), - /** - * GPU = 2; - */ - GPU(2), - /** - * TPU = 3; - */ - TPU(3), - UNRECOGNIZED(-1), - ; - - /** - * UNSPECIFIED = 0; - */ - public static final int UNSPECIFIED_VALUE = 0; - /** - * CPU = 1; - */ - public static final int CPU_VALUE = 1; - /** - * GPU = 2; - */ - public static final int GPU_VALUE = 2; - /** - * TPU = 3; - */ - public static final int TPU_VALUE = 3; - - - 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 DeviceType valueOf(int value) { - return forNumber(value); - } - - public static DeviceType forNumber(int value) { - switch (value) { - case 0: return UNSPECIFIED; - case 1: return CPU; - case 2: return GPU; - case 3: return TPU; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - DeviceType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public DeviceType findValueByNumber(int number) { - return DeviceType.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.profiler.ProfileOptions.getDescriptor().getEnumTypes().get(0); - } - - private static final DeviceType[] VALUES = values(); - - public static DeviceType 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 DeviceType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.ProfileOptions.DeviceType) - } - - public static final int VERSION_FIELD_NUMBER = 5; - private int version_; - /** - *
    -   * Some default value of option are not proto3 default value. Use this version
    -   * to determine if we should use default option value instead of proto3
    -   * default value.
    -   * 
    - * - * uint32 version = 5; - */ - public int getVersion() { - return version_; - } - - public static final int DEVICE_TYPE_FIELD_NUMBER = 6; - private int deviceType_; - /** - *
    -   * Device type to profile/trace: (version >= 1)
    -   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -   * DeviceType::CPU: only CPU will be profiled.
    -   * DeviceType::GPU: only CPU/GPU will be profiled.
    -   * DeviceType::TPU: only CPU/TPU will be profiled.
    -   * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public int getDeviceTypeValue() { - return deviceType_; - } - /** - *
    -   * Device type to profile/trace: (version >= 1)
    -   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -   * DeviceType::CPU: only CPU will be profiled.
    -   * DeviceType::GPU: only CPU/GPU will be profiled.
    -   * DeviceType::TPU: only CPU/TPU will be profiled.
    -   * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public org.tensorflow.proto.profiler.ProfileOptions.DeviceType getDeviceType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.profiler.ProfileOptions.DeviceType result = org.tensorflow.proto.profiler.ProfileOptions.DeviceType.valueOf(deviceType_); - return result == null ? org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNRECOGNIZED : result; - } - - public static final int INCLUDE_DATASET_OPS_FIELD_NUMBER = 1; - private boolean includeDatasetOps_; - /** - *
    -   * We don't collect the dataset ops by default for better trace-viewer
    -   * scalability. The caller can mannually set this field to include the ops.
    -   * 
    - * - * bool include_dataset_ops = 1; - */ - public boolean getIncludeDatasetOps() { - return includeDatasetOps_; - } - - public static final int HOST_TRACER_LEVEL_FIELD_NUMBER = 2; - private int hostTracerLevel_; - /** - *
    -   * Levels of host tracing: (version >= 1)
    -   * - Level 0 is used to disable host traces.
    -   * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
    -   * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    -   *           level program execution details (expensive TF ops, XLA ops, etc).
    -   *           This is the default.
    -   * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    -   *           (low-level) program execution details (cheap TF ops, etc).
    -   * 
    - * - * uint32 host_tracer_level = 2; - */ - public int getHostTracerLevel() { - return hostTracerLevel_; - } - - public static final int DEVICE_TRACER_LEVEL_FIELD_NUMBER = 3; - private int deviceTracerLevel_; - /** - *
    -   * Levels of device tracing: (version >= 1)
    -   * - Level 0 is used to disable device traces.
    -   * - Level 1 is used to enable device traces.
    -   * - More levels might be defined for specific device for controlling the
    -   *   verbosity of the trace.
    -   * 
    - * - * uint32 device_tracer_level = 3; - */ - public int getDeviceTracerLevel() { - return deviceTracerLevel_; - } - - public static final int PYTHON_TRACER_LEVEL_FIELD_NUMBER = 4; - private int pythonTracerLevel_; - /** - *
    -   * Whether enable python function calls tracing. Runtime overhead ensues if
    -   * enabled. Default off. (version >= 1)
    -   * 
    - * - * uint32 python_tracer_level = 4; - */ - public int getPythonTracerLevel() { - return pythonTracerLevel_; - } - - public static final int ENABLE_HLO_PROTO_FIELD_NUMBER = 7; - private boolean enableHloProto_; - /** - *
    -   * Whether serialize hlo_proto when XLA is used. (version >= 1)
    -   * 
    - * - * bool enable_hlo_proto = 7; - */ - 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() { - 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 (includeDatasetOps_ != false) { - output.writeBool(1, includeDatasetOps_); - } - if (hostTracerLevel_ != 0) { - output.writeUInt32(2, hostTracerLevel_); - } - if (deviceTracerLevel_ != 0) { - output.writeUInt32(3, deviceTracerLevel_); - } - if (pythonTracerLevel_ != 0) { - output.writeUInt32(4, pythonTracerLevel_); - } - if (version_ != 0) { - output.writeUInt32(5, version_); - } - if (deviceType_ != org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) { - output.writeEnum(6, deviceType_); - } - 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); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (includeDatasetOps_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, includeDatasetOps_); - } - if (hostTracerLevel_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, hostTracerLevel_); - } - if (deviceTracerLevel_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, deviceTracerLevel_); - } - if (pythonTracerLevel_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, pythonTracerLevel_); - } - if (version_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(5, version_); - } - if (deviceType_ != org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, deviceType_); - } - if (enableHloProto_ != false) { - 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; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.profiler.ProfileOptions)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.ProfileOptions other = (org.tensorflow.proto.profiler.ProfileOptions) obj; - - if (getVersion() - != other.getVersion()) return false; - if (deviceType_ != other.deviceType_) return false; - if (getIncludeDatasetOps() - != other.getIncludeDatasetOps()) return false; - if (getHostTracerLevel() - != other.getHostTracerLevel()) return false; - if (getDeviceTracerLevel() - != other.getDeviceTracerLevel()) return false; - if (getPythonTracerLevel() - != 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; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); - hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + deviceType_; - hash = (37 * hash) + INCLUDE_DATASET_OPS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIncludeDatasetOps()); - hash = (37 * hash) + HOST_TRACER_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + getHostTracerLevel(); - hash = (37 * hash) + DEVICE_TRACER_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + getDeviceTracerLevel(); - hash = (37 * hash) + PYTHON_TRACER_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + getPythonTracerLevel(); - 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; - } - - public static org.tensorflow.proto.profiler.ProfileOptions parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.ProfileOptions 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.ProfileOptions parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.ProfileOptions 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.ProfileOptions parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.ProfileOptions parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.ProfileOptions 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.ProfileOptions parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.ProfileOptions 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.ProfileOptions parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.ProfileOptions 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.ProfileOptions 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; - } - /** - *
    -   * Next ID: 11
    -   * 
    - * - * Protobuf type {@code tensorflow.ProfileOptions} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions) - org.tensorflow.proto.profiler.ProfileOptionsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.ProfileOptions.class, org.tensorflow.proto.profiler.ProfileOptions.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.ProfileOptions.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(); - version_ = 0; - - deviceType_ = 0; - - includeDatasetOps_ = false; - - hostTracerLevel_ = 0; - - deviceTracerLevel_ = 0; - - pythonTracerLevel_ = 0; - - enableHloProto_ = false; - - startTimestampNs_ = 0L; - - durationMs_ = 0L; - - repositoryPath_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.ProfileOptions getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.ProfileOptions build() { - org.tensorflow.proto.profiler.ProfileOptions result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.ProfileOptions buildPartial() { - org.tensorflow.proto.profiler.ProfileOptions result = new org.tensorflow.proto.profiler.ProfileOptions(this); - result.version_ = version_; - result.deviceType_ = deviceType_; - result.includeDatasetOps_ = includeDatasetOps_; - result.hostTracerLevel_ = hostTracerLevel_; - result.deviceTracerLevel_ = deviceTracerLevel_; - result.pythonTracerLevel_ = pythonTracerLevel_; - result.enableHloProto_ = enableHloProto_; - result.startTimestampNs_ = startTimestampNs_; - result.durationMs_ = durationMs_; - result.repositoryPath_ = repositoryPath_; - 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.ProfileOptions) { - return mergeFrom((org.tensorflow.proto.profiler.ProfileOptions)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.ProfileOptions other) { - if (other == org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance()) return this; - if (other.getVersion() != 0) { - setVersion(other.getVersion()); - } - if (other.deviceType_ != 0) { - setDeviceTypeValue(other.getDeviceTypeValue()); - } - if (other.getIncludeDatasetOps() != false) { - setIncludeDatasetOps(other.getIncludeDatasetOps()); - } - if (other.getHostTracerLevel() != 0) { - setHostTracerLevel(other.getHostTracerLevel()); - } - if (other.getDeviceTracerLevel() != 0) { - setDeviceTracerLevel(other.getDeviceTracerLevel()); - } - if (other.getPythonTracerLevel() != 0) { - setPythonTracerLevel(other.getPythonTracerLevel()); - } - 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; - } - - @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.ProfileOptions parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.ProfileOptions) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int version_ ; - /** - *
    -     * Some default value of option are not proto3 default value. Use this version
    -     * to determine if we should use default option value instead of proto3
    -     * default value.
    -     * 
    - * - * uint32 version = 5; - */ - public int getVersion() { - return version_; - } - /** - *
    -     * Some default value of option are not proto3 default value. Use this version
    -     * to determine if we should use default option value instead of proto3
    -     * default value.
    -     * 
    - * - * uint32 version = 5; - */ - public Builder setVersion(int value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * Some default value of option are not proto3 default value. Use this version
    -     * to determine if we should use default option value instead of proto3
    -     * default value.
    -     * 
    - * - * uint32 version = 5; - */ - public Builder clearVersion() { - - version_ = 0; - onChanged(); - return this; - } - - private int deviceType_ = 0; - /** - *
    -     * Device type to profile/trace: (version >= 1)
    -     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -     * DeviceType::CPU: only CPU will be profiled.
    -     * DeviceType::GPU: only CPU/GPU will be profiled.
    -     * DeviceType::TPU: only CPU/TPU will be profiled.
    -     * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public int getDeviceTypeValue() { - return deviceType_; - } - /** - *
    -     * Device type to profile/trace: (version >= 1)
    -     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -     * DeviceType::CPU: only CPU will be profiled.
    -     * DeviceType::GPU: only CPU/GPU will be profiled.
    -     * DeviceType::TPU: only CPU/TPU will be profiled.
    -     * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public Builder setDeviceTypeValue(int value) { - deviceType_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device type to profile/trace: (version >= 1)
    -     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -     * DeviceType::CPU: only CPU will be profiled.
    -     * DeviceType::GPU: only CPU/GPU will be profiled.
    -     * DeviceType::TPU: only CPU/TPU will be profiled.
    -     * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public org.tensorflow.proto.profiler.ProfileOptions.DeviceType getDeviceType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.profiler.ProfileOptions.DeviceType result = org.tensorflow.proto.profiler.ProfileOptions.DeviceType.valueOf(deviceType_); - return result == null ? org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNRECOGNIZED : result; - } - /** - *
    -     * Device type to profile/trace: (version >= 1)
    -     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -     * DeviceType::CPU: only CPU will be profiled.
    -     * DeviceType::GPU: only CPU/GPU will be profiled.
    -     * DeviceType::TPU: only CPU/TPU will be profiled.
    -     * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public Builder setDeviceType(org.tensorflow.proto.profiler.ProfileOptions.DeviceType value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Device type to profile/trace: (version >= 1)
    -     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -     * DeviceType::CPU: only CPU will be profiled.
    -     * DeviceType::GPU: only CPU/GPU will be profiled.
    -     * DeviceType::TPU: only CPU/TPU will be profiled.
    -     * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - public Builder clearDeviceType() { - - deviceType_ = 0; - onChanged(); - return this; - } - - private boolean includeDatasetOps_ ; - /** - *
    -     * We don't collect the dataset ops by default for better trace-viewer
    -     * scalability. The caller can mannually set this field to include the ops.
    -     * 
    - * - * bool include_dataset_ops = 1; - */ - public boolean getIncludeDatasetOps() { - return includeDatasetOps_; - } - /** - *
    -     * We don't collect the dataset ops by default for better trace-viewer
    -     * scalability. The caller can mannually set this field to include the ops.
    -     * 
    - * - * bool include_dataset_ops = 1; - */ - public Builder setIncludeDatasetOps(boolean value) { - - includeDatasetOps_ = value; - onChanged(); - return this; - } - /** - *
    -     * We don't collect the dataset ops by default for better trace-viewer
    -     * scalability. The caller can mannually set this field to include the ops.
    -     * 
    - * - * bool include_dataset_ops = 1; - */ - public Builder clearIncludeDatasetOps() { - - includeDatasetOps_ = false; - onChanged(); - return this; - } - - private int hostTracerLevel_ ; - /** - *
    -     * Levels of host tracing: (version >= 1)
    -     * - Level 0 is used to disable host traces.
    -     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
    -     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    -     *           level program execution details (expensive TF ops, XLA ops, etc).
    -     *           This is the default.
    -     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    -     *           (low-level) program execution details (cheap TF ops, etc).
    -     * 
    - * - * uint32 host_tracer_level = 2; - */ - public int getHostTracerLevel() { - return hostTracerLevel_; - } - /** - *
    -     * Levels of host tracing: (version >= 1)
    -     * - Level 0 is used to disable host traces.
    -     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
    -     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    -     *           level program execution details (expensive TF ops, XLA ops, etc).
    -     *           This is the default.
    -     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    -     *           (low-level) program execution details (cheap TF ops, etc).
    -     * 
    - * - * uint32 host_tracer_level = 2; - */ - public Builder setHostTracerLevel(int value) { - - hostTracerLevel_ = value; - onChanged(); - return this; - } - /** - *
    -     * Levels of host tracing: (version >= 1)
    -     * - Level 0 is used to disable host traces.
    -     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
    -     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    -     *           level program execution details (expensive TF ops, XLA ops, etc).
    -     *           This is the default.
    -     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    -     *           (low-level) program execution details (cheap TF ops, etc).
    -     * 
    - * - * uint32 host_tracer_level = 2; - */ - public Builder clearHostTracerLevel() { - - hostTracerLevel_ = 0; - onChanged(); - return this; - } - - private int deviceTracerLevel_ ; - /** - *
    -     * Levels of device tracing: (version >= 1)
    -     * - Level 0 is used to disable device traces.
    -     * - Level 1 is used to enable device traces.
    -     * - More levels might be defined for specific device for controlling the
    -     *   verbosity of the trace.
    -     * 
    - * - * uint32 device_tracer_level = 3; - */ - public int getDeviceTracerLevel() { - return deviceTracerLevel_; - } - /** - *
    -     * Levels of device tracing: (version >= 1)
    -     * - Level 0 is used to disable device traces.
    -     * - Level 1 is used to enable device traces.
    -     * - More levels might be defined for specific device for controlling the
    -     *   verbosity of the trace.
    -     * 
    - * - * uint32 device_tracer_level = 3; - */ - public Builder setDeviceTracerLevel(int value) { - - deviceTracerLevel_ = value; - onChanged(); - return this; - } - /** - *
    -     * Levels of device tracing: (version >= 1)
    -     * - Level 0 is used to disable device traces.
    -     * - Level 1 is used to enable device traces.
    -     * - More levels might be defined for specific device for controlling the
    -     *   verbosity of the trace.
    -     * 
    - * - * uint32 device_tracer_level = 3; - */ - public Builder clearDeviceTracerLevel() { - - deviceTracerLevel_ = 0; - onChanged(); - return this; - } - - private int pythonTracerLevel_ ; - /** - *
    -     * Whether enable python function calls tracing. Runtime overhead ensues if
    -     * enabled. Default off. (version >= 1)
    -     * 
    - * - * uint32 python_tracer_level = 4; - */ - public int getPythonTracerLevel() { - return pythonTracerLevel_; - } - /** - *
    -     * Whether enable python function calls tracing. Runtime overhead ensues if
    -     * enabled. Default off. (version >= 1)
    -     * 
    - * - * uint32 python_tracer_level = 4; - */ - public Builder setPythonTracerLevel(int value) { - - pythonTracerLevel_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether enable python function calls tracing. Runtime overhead ensues if
    -     * enabled. Default off. (version >= 1)
    -     * 
    - * - * uint32 python_tracer_level = 4; - */ - public Builder clearPythonTracerLevel() { - - pythonTracerLevel_ = 0; - onChanged(); - return this; - } - - private boolean enableHloProto_ ; - /** - *
    -     * Whether serialize hlo_proto when XLA is used. (version >= 1)
    -     * 
    - * - * bool enable_hlo_proto = 7; - */ - public boolean getEnableHloProto() { - return enableHloProto_; - } - /** - *
    -     * Whether serialize hlo_proto when XLA is used. (version >= 1)
    -     * 
    - * - * bool enable_hlo_proto = 7; - */ - public Builder setEnableHloProto(boolean value) { - - enableHloProto_ = value; - onChanged(); - return this; - } - /** - *
    -     * Whether serialize hlo_proto when XLA is used. (version >= 1)
    -     * 
    - * - * bool enable_hlo_proto = 7; - */ - public Builder clearEnableHloProto() { - - enableHloProto_ = false; - 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) { - 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.ProfileOptions) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions) - private static final org.tensorflow.proto.profiler.ProfileOptions DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.ProfileOptions(); - } - - public static org.tensorflow.proto.profiler.ProfileOptions getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ProfileOptions parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ProfileOptions(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.ProfileOptions getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index ca6fa82f415..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfileOptionsOrBuilder.java +++ /dev/null @@ -1,140 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/profiler_options.proto - -package org.tensorflow.proto.profiler; - -public interface ProfileOptionsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ProfileOptions) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Some default value of option are not proto3 default value. Use this version
    -   * to determine if we should use default option value instead of proto3
    -   * default value.
    -   * 
    - * - * uint32 version = 5; - */ - int getVersion(); - - /** - *
    -   * Device type to profile/trace: (version >= 1)
    -   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -   * DeviceType::CPU: only CPU will be profiled.
    -   * DeviceType::GPU: only CPU/GPU will be profiled.
    -   * DeviceType::TPU: only CPU/TPU will be profiled.
    -   * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - int getDeviceTypeValue(); - /** - *
    -   * Device type to profile/trace: (version >= 1)
    -   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    -   * DeviceType::CPU: only CPU will be profiled.
    -   * DeviceType::GPU: only CPU/GPU will be profiled.
    -   * DeviceType::TPU: only CPU/TPU will be profiled.
    -   * 
    - * - * .tensorflow.ProfileOptions.DeviceType device_type = 6; - */ - org.tensorflow.proto.profiler.ProfileOptions.DeviceType getDeviceType(); - - /** - *
    -   * We don't collect the dataset ops by default for better trace-viewer
    -   * scalability. The caller can mannually set this field to include the ops.
    -   * 
    - * - * bool include_dataset_ops = 1; - */ - boolean getIncludeDatasetOps(); - - /** - *
    -   * Levels of host tracing: (version >= 1)
    -   * - Level 0 is used to disable host traces.
    -   * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
    -   * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    -   *           level program execution details (expensive TF ops, XLA ops, etc).
    -   *           This is the default.
    -   * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    -   *           (low-level) program execution details (cheap TF ops, etc).
    -   * 
    - * - * uint32 host_tracer_level = 2; - */ - int getHostTracerLevel(); - - /** - *
    -   * Levels of device tracing: (version >= 1)
    -   * - Level 0 is used to disable device traces.
    -   * - Level 1 is used to enable device traces.
    -   * - More levels might be defined for specific device for controlling the
    -   *   verbosity of the trace.
    -   * 
    - * - * uint32 device_tracer_level = 3; - */ - int getDeviceTracerLevel(); - - /** - *
    -   * Whether enable python function calls tracing. Runtime overhead ensues if
    -   * enabled. Default off. (version >= 1)
    -   * 
    - * - * uint32 python_tracer_level = 4; - */ - int getPythonTracerLevel(); - - /** - *
    -   * Whether serialize hlo_proto when XLA is used. (version >= 1)
    -   * 
    - * - * 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 deleted file mode 100644 index de30001ade0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/ProfilerOptionsProtos.java +++ /dev/null @@ -1,74 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/profiler_options.proto - -package org.tensorflow.proto.profiler; - -public final class ProfilerOptionsProtos { - private ProfilerOptionsProtos() {} - 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_ProfileOptions_descriptor; - 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() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n/tensorflow/core/profiler/profiler_opti" + - "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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_ProfileOptions_descriptor = - getDescriptor().getMessageTypes().get(0); - 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", "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 deleted file mode 100644 index f138785b0ce..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptions.java +++ /dev/null @@ -1,1117 +0,0 @@ -// 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 deleted file mode 100644 index 6adf91f203f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/RemoteProfilerSessionManagerOptionsOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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 deleted file mode 100644 index edc7854d97e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEvent.java +++ /dev/null @@ -1,1286 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * An XEvent is a trace event, optionally annotated with XStats.
    - * Next ID: 6
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XEvent} - */ -public final class XEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XEvent) - XEventOrBuilder { -private static final long serialVersionUID = 0L; - // Use XEvent.newBuilder() to construct. - private XEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XEvent() { - stats_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XEvent( - 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: { - - metadataId_ = input.readInt64(); - break; - } - case 16: { - dataCase_ = 2; - data_ = input.readInt64(); - break; - } - case 24: { - - durationPs_ = input.readInt64(); - break; - } - case 34: { - 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; - } - case 40: { - dataCase_ = 5; - data_ = 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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - stats_ = java.util.Collections.unmodifiableList(stats_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XEvent.class, org.tensorflow.proto.profiler.XEvent.Builder.class); - } - - private int dataCase_ = 0; - private java.lang.Object data_; - public enum DataCase - implements com.google.protobuf.Internal.EnumLite { - OFFSET_PS(2), - NUM_OCCURRENCES(5), - DATA_NOT_SET(0); - private final int value; - private DataCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static DataCase valueOf(int value) { - return forNumber(value); - } - - public static DataCase forNumber(int value) { - switch (value) { - case 2: return OFFSET_PS; - case 5: return NUM_OCCURRENCES; - case 0: return DATA_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public DataCase - getDataCase() { - return DataCase.forNumber( - dataCase_); - } - - public static final int METADATA_ID_FIELD_NUMBER = 1; - private long metadataId_; - /** - *
    -   * XEventMetadata.id of corresponding metadata.
    -   * 
    - * - * int64 metadata_id = 1; - */ - public long getMetadataId() { - return metadataId_; - } - - public static final int OFFSET_PS_FIELD_NUMBER = 2; - /** - *
    -   * Start time of the event in picoseconds, as offset from
    -   * XLine.timestamp_ns().
    -   * 
    - * - * int64 offset_ps = 2; - */ - public long getOffsetPs() { - if (dataCase_ == 2) { - return (java.lang.Long) data_; - } - return 0L; - } - - public static final int NUM_OCCURRENCES_FIELD_NUMBER = 5; - /** - *
    -   * Number of occurrences of the event, if aggregated.
    -   * 
    - * - * int64 num_occurrences = 5; - */ - public long getNumOccurrences() { - if (dataCase_ == 5) { - return (java.lang.Long) data_; - } - return 0L; - } - - public static final int DURATION_PS_FIELD_NUMBER = 3; - private long durationPs_; - /** - *
    -   * Duration of the event in picoseconds. Can be zero for an instant event.
    -   * 
    - * - * int64 duration_ps = 3; - */ - public long getDurationPs() { - return durationPs_; - } - - public static final int STATS_FIELD_NUMBER = 4; - private java.util.List stats_; - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public java.util.List getStatsList() { - return stats_; - } - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public java.util.List - getStatsOrBuilderList() { - return stats_; - } - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public int getStatsCount() { - return stats_.size(); - } - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStat getStats(int index) { - return stats_.get(index); - } - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index) { - return stats_.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 { - if (metadataId_ != 0L) { - output.writeInt64(1, metadataId_); - } - if (dataCase_ == 2) { - output.writeInt64( - 2, (long)((java.lang.Long) data_)); - } - if (durationPs_ != 0L) { - output.writeInt64(3, durationPs_); - } - for (int i = 0; i < stats_.size(); i++) { - output.writeMessage(4, stats_.get(i)); - } - if (dataCase_ == 5) { - output.writeInt64( - 5, (long)((java.lang.Long) data_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (metadataId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, metadataId_); - } - if (dataCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 2, (long)((java.lang.Long) data_)); - } - if (durationPs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, durationPs_); - } - for (int i = 0; i < stats_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, stats_.get(i)); - } - if (dataCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 5, (long)((java.lang.Long) data_)); - } - 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.XEvent)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XEvent other = (org.tensorflow.proto.profiler.XEvent) obj; - - if (getMetadataId() - != other.getMetadataId()) return false; - if (getDurationPs() - != other.getDurationPs()) return false; - if (!getStatsList() - .equals(other.getStatsList())) return false; - if (!getDataCase().equals(other.getDataCase())) return false; - switch (dataCase_) { - case 2: - if (getOffsetPs() - != other.getOffsetPs()) return false; - break; - case 5: - if (getNumOccurrences() - != other.getNumOccurrences()) return false; - break; - case 0: - default: - } - 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) + METADATA_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMetadataId()); - hash = (37 * hash) + DURATION_PS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDurationPs()); - if (getStatsCount() > 0) { - hash = (37 * hash) + STATS_FIELD_NUMBER; - hash = (53 * hash) + getStatsList().hashCode(); - } - switch (dataCase_) { - case 2: - hash = (37 * hash) + OFFSET_PS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffsetPs()); - break; - case 5: - hash = (37 * hash) + NUM_OCCURRENCES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumOccurrences()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEvent 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.XEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEvent 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.XEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEvent 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.XEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEvent 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.XEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEvent 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.XEvent 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; - } - /** - *
    -   * An XEvent is a trace event, optionally annotated with XStats.
    -   * Next ID: 6
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XEvent) - org.tensorflow.proto.profiler.XEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XEvent.class, org.tensorflow.proto.profiler.XEvent.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getStatsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - metadataId_ = 0L; - - durationPs_ = 0L; - - if (statsBuilder_ == null) { - stats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - statsBuilder_.clear(); - } - dataCase_ = 0; - data_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEvent_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XEvent getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XEvent.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XEvent build() { - org.tensorflow.proto.profiler.XEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XEvent buildPartial() { - org.tensorflow.proto.profiler.XEvent result = new org.tensorflow.proto.profiler.XEvent(this); - int from_bitField0_ = bitField0_; - result.metadataId_ = metadataId_; - if (dataCase_ == 2) { - result.data_ = data_; - } - if (dataCase_ == 5) { - result.data_ = data_; - } - result.durationPs_ = durationPs_; - if (statsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - stats_ = java.util.Collections.unmodifiableList(stats_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.stats_ = stats_; - } else { - result.stats_ = statsBuilder_.build(); - } - result.dataCase_ = dataCase_; - 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.XEvent) { - return mergeFrom((org.tensorflow.proto.profiler.XEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XEvent other) { - if (other == org.tensorflow.proto.profiler.XEvent.getDefaultInstance()) return this; - if (other.getMetadataId() != 0L) { - setMetadataId(other.getMetadataId()); - } - if (other.getDurationPs() != 0L) { - setDurationPs(other.getDurationPs()); - } - 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_); - } - } - } - switch (other.getDataCase()) { - case OFFSET_PS: { - setOffsetPs(other.getOffsetPs()); - break; - } - case NUM_OCCURRENCES: { - setNumOccurrences(other.getNumOccurrences()); - break; - } - case DATA_NOT_SET: { - break; - } - } - 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.XEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int dataCase_ = 0; - private java.lang.Object data_; - public DataCase - getDataCase() { - return DataCase.forNumber( - dataCase_); - } - - public Builder clearData() { - dataCase_ = 0; - data_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private long metadataId_ ; - /** - *
    -     * XEventMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public long getMetadataId() { - return metadataId_; - } - /** - *
    -     * XEventMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public Builder setMetadataId(long value) { - - metadataId_ = value; - onChanged(); - return this; - } - /** - *
    -     * XEventMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public Builder clearMetadataId() { - - metadataId_ = 0L; - onChanged(); - return this; - } - - /** - *
    -     * Start time of the event in picoseconds, as offset from
    -     * XLine.timestamp_ns().
    -     * 
    - * - * int64 offset_ps = 2; - */ - public long getOffsetPs() { - if (dataCase_ == 2) { - return (java.lang.Long) data_; - } - return 0L; - } - /** - *
    -     * Start time of the event in picoseconds, as offset from
    -     * XLine.timestamp_ns().
    -     * 
    - * - * int64 offset_ps = 2; - */ - public Builder setOffsetPs(long value) { - dataCase_ = 2; - data_ = value; - onChanged(); - return this; - } - /** - *
    -     * Start time of the event in picoseconds, as offset from
    -     * XLine.timestamp_ns().
    -     * 
    - * - * int64 offset_ps = 2; - */ - public Builder clearOffsetPs() { - if (dataCase_ == 2) { - dataCase_ = 0; - data_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * Number of occurrences of the event, if aggregated.
    -     * 
    - * - * int64 num_occurrences = 5; - */ - public long getNumOccurrences() { - if (dataCase_ == 5) { - return (java.lang.Long) data_; - } - return 0L; - } - /** - *
    -     * Number of occurrences of the event, if aggregated.
    -     * 
    - * - * int64 num_occurrences = 5; - */ - public Builder setNumOccurrences(long value) { - dataCase_ = 5; - data_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of occurrences of the event, if aggregated.
    -     * 
    - * - * int64 num_occurrences = 5; - */ - public Builder clearNumOccurrences() { - if (dataCase_ == 5) { - dataCase_ = 0; - data_ = null; - onChanged(); - } - return this; - } - - private long durationPs_ ; - /** - *
    -     * Duration of the event in picoseconds. Can be zero for an instant event.
    -     * 
    - * - * int64 duration_ps = 3; - */ - public long getDurationPs() { - return durationPs_; - } - /** - *
    -     * Duration of the event in picoseconds. Can be zero for an instant event.
    -     * 
    - * - * int64 duration_ps = 3; - */ - public Builder setDurationPs(long value) { - - durationPs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Duration of the event in picoseconds. Can be zero for an instant event.
    -     * 
    - * - * int64 duration_ps = 3; - */ - public Builder clearDurationPs() { - - durationPs_ = 0L; - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public java.util.List getStatsList() { - if (statsBuilder_ == null) { - return java.util.Collections.unmodifiableList(stats_); - } else { - return statsBuilder_.getMessageList(); - } - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public int getStatsCount() { - if (statsBuilder_ == null) { - return stats_.size(); - } else { - return statsBuilder_.getCount(); - } - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStat getStats(int index) { - if (statsBuilder_ == null) { - return stats_.get(index); - } else { - return statsBuilder_.getMessage(index); - } - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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 associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public Builder clearStats() { - if (statsBuilder_ == null) { - stats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - statsBuilder_.clear(); - } - return this; - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public Builder removeStats(int index) { - if (statsBuilder_ == null) { - ensureStatsIsMutable(); - stats_.remove(index); - onChanged(); - } else { - statsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder( - int index) { - return getStatsFieldBuilder().getBuilder(index); - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index) { - if (statsBuilder_ == null) { - return stats_.get(index); } else { - return statsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public java.util.List - getStatsOrBuilderList() { - if (statsBuilder_ != null) { - return statsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(stats_); - } - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() { - return getStatsFieldBuilder().addBuilder( - org.tensorflow.proto.profiler.XStat.getDefaultInstance()); - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder( - int index) { - return getStatsFieldBuilder().addBuilder( - index, org.tensorflow.proto.profiler.XStat.getDefaultInstance()); - } - /** - *
    -     * XStats associated with the event.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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) { - 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.XEvent) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XEvent) - private static final org.tensorflow.proto.profiler.XEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XEvent(); - } - - public static org.tensorflow.proto.profiler.XEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XEvent(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.XEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index f06bc4c25b7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadata.java +++ /dev/null @@ -1,1553 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * Metadata for an XEvent, corresponds to an event type and is shared by
    - * all XEvents with the same metadata_id.
    - * Next ID: 7
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XEventMetadata} - */ -public final class XEventMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XEventMetadata) - XEventMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use XEventMetadata.newBuilder() to construct. - private XEventMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XEventMetadata() { - name_ = ""; - displayName_ = ""; - metadata_ = com.google.protobuf.ByteString.EMPTY; - stats_ = java.util.Collections.emptyList(); - childId_ = emptyLongList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XEventMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XEventMetadata( - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - - metadata_ = input.readBytes(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - 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; - } - case 48: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - childId_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - childId_.addLong(input.readInt64()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - childId_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - childId_.addLong(input.readInt64()); - } - input.popLimit(limit); - 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)) { - stats_ = java.util.Collections.unmodifiableList(stats_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - childId_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEventMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XEventMetadata.class, org.tensorflow.proto.profiler.XEventMetadata.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - *
    -   * XPlane.event_metadata map key.
    -   * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -   * Name of the event.
    -   * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -   * Name of the event.
    -   * 
    - * - * string name = 2; - */ - 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 DISPLAY_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object displayName_; - /** - *
    -   * Name of the event shown in trace viewer.
    -   * 
    - * - * string display_name = 4; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - 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(); - displayName_ = s; - return s; - } - } - /** - *
    -   * Name of the event shown in trace viewer.
    -   * 
    - * - * string display_name = 4; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METADATA_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString metadata_; - /** - *
    -   * Additional metadata in serialized format.
    -   * 
    - * - * bytes metadata = 3; - */ - 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); - } - - public static final int CHILD_ID_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.LongList childId_; - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - public java.util.List - getChildIdList() { - return childId_; - } - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - public int getChildIdCount() { - return childId_.size(); - } - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - public long getChildId(int index) { - return childId_.getLong(index); - } - private int childIdMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!metadata_.isEmpty()) { - output.writeBytes(3, metadata_); - } - 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)); - } - if (getChildIdList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(childIdMemoizedSerializedSize); - } - for (int i = 0; i < childId_.size(); i++) { - output.writeInt64NoTag(childId_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!metadata_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, metadata_); - } - 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)); - } - { - int dataSize = 0; - for (int i = 0; i < childId_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(childId_.getLong(i)); - } - size += dataSize; - if (!getChildIdList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - childIdMemoizedSerializedSize = dataSize; - } - 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.XEventMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XEventMetadata other = (org.tensorflow.proto.profiler.XEventMetadata) obj; - - if (getId() - != other.getId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getDisplayName() - .equals(other.getDisplayName())) return false; - if (!getMetadata() - .equals(other.getMetadata())) return false; - if (!getStatsList() - .equals(other.getStatsList())) return false; - if (!getChildIdList() - .equals(other.getChildIdList())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - 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(); - } - if (getChildIdCount() > 0) { - hash = (37 * hash) + CHILD_ID_FIELD_NUMBER; - hash = (53 * hash) + getChildIdList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XEventMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEventMetadata 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.XEventMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEventMetadata 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.XEventMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XEventMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XEventMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEventMetadata 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.XEventMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEventMetadata 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.XEventMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XEventMetadata 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.XEventMetadata 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; - } - /** - *
    -   * Metadata for an XEvent, corresponds to an event type and is shared by
    -   * all XEvents with the same metadata_id.
    -   * Next ID: 7
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XEventMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XEventMetadata) - org.tensorflow.proto.profiler.XEventMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEventMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XEventMetadata.class, org.tensorflow.proto.profiler.XEventMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XEventMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getStatsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0L; - - name_ = ""; - - displayName_ = ""; - - metadata_ = com.google.protobuf.ByteString.EMPTY; - - if (statsBuilder_ == null) { - stats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - statsBuilder_.clear(); - } - childId_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XEventMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XEventMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XEventMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XEventMetadata build() { - org.tensorflow.proto.profiler.XEventMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @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(); - } - if (((bitField0_ & 0x00000002) != 0)) { - childId_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.childId_ = childId_; - 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.XEventMetadata) { - return mergeFrom((org.tensorflow.proto.profiler.XEventMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XEventMetadata other) { - if (other == org.tensorflow.proto.profiler.XEventMetadata.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - 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_); - } - } - } - if (!other.childId_.isEmpty()) { - if (childId_.isEmpty()) { - childId_ = other.childId_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureChildIdIsMutable(); - childId_.addAll(other.childId_); - } - onChanged(); - } - 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.XEventMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XEventMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long id_ ; - /** - *
    -     * XPlane.event_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - /** - *
    -     * XPlane.event_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
    -     * XPlane.event_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of the event.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of the event.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of the event.
    -     * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the event.
    -     * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the event.
    -     * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object displayName_ = ""; - /** - *
    -     * Name of the event shown in trace viewer.
    -     * 
    - * - * string display_name = 4; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the event shown in trace viewer.
    -     * 
    - * - * string display_name = 4; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the event shown in trace viewer.
    -     * 
    - * - * string display_name = 4; - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the event shown in trace viewer.
    -     * 
    - * - * string display_name = 4; - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the event shown in trace viewer.
    -     * 
    - * - * string display_name = 4; - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Additional metadata in serialized format.
    -     * 
    - * - * bytes metadata = 3; - */ - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - /** - *
    -     * Additional metadata in serialized format.
    -     * 
    - * - * bytes metadata = 3; - */ - public Builder setMetadata(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - metadata_ = value; - onChanged(); - return this; - } - /** - *
    -     * Additional metadata in serialized format.
    -     * 
    - * - * bytes metadata = 3; - */ - public Builder clearMetadata() { - - metadata_ = getDefaultInstance().getMetadata(); - 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_; - } - - private com.google.protobuf.Internal.LongList childId_ = emptyLongList(); - private void ensureChildIdIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - childId_ = mutableCopy(childId_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public java.util.List - getChildIdList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(childId_) : childId_; - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public int getChildIdCount() { - return childId_.size(); - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public long getChildId(int index) { - return childId_.getLong(index); - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public Builder setChildId( - int index, long value) { - ensureChildIdIsMutable(); - childId_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public Builder addChildId(long value) { - ensureChildIdIsMutable(); - childId_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public Builder addAllChildId( - java.lang.Iterable values) { - ensureChildIdIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, childId_); - onChanged(); - return this; - } - /** - *
    -     * XPlane.event_metadata map key for children events.
    -     * 
    - * - * repeated int64 child_id = 6; - */ - public Builder clearChildId() { - childId_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - 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.XEventMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XEventMetadata) - private static final org.tensorflow.proto.profiler.XEventMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XEventMetadata(); - } - - public static org.tensorflow.proto.profiler.XEventMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XEventMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XEventMetadata(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.XEventMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 3fbae52ad47..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventMetadataOrBuilder.java +++ /dev/null @@ -1,137 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XEventMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XEventMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * XPlane.event_metadata map key.
    -   * 
    - * - * int64 id = 1; - */ - long getId(); - - /** - *
    -   * Name of the event.
    -   * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -   * Name of the event.
    -   * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Name of the event shown in trace viewer.
    -   * 
    - * - * string display_name = 4; - */ - java.lang.String getDisplayName(); - /** - *
    -   * Name of the event shown in trace viewer.
    -   * 
    - * - * string display_name = 4; - */ - com.google.protobuf.ByteString - getDisplayNameBytes(); - - /** - *
    -   * Additional metadata in serialized format.
    -   * 
    - * - * 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); - - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - java.util.List getChildIdList(); - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - int getChildIdCount(); - /** - *
    -   * XPlane.event_metadata map key for children events.
    -   * 
    - * - * repeated int64 child_id = 6; - */ - long getChildId(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 deleted file mode 100644 index 4769931cb4e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XEventOrBuilder.java +++ /dev/null @@ -1,97 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XEvent) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * XEventMetadata.id of corresponding metadata.
    -   * 
    - * - * int64 metadata_id = 1; - */ - long getMetadataId(); - - /** - *
    -   * Start time of the event in picoseconds, as offset from
    -   * XLine.timestamp_ns().
    -   * 
    - * - * int64 offset_ps = 2; - */ - long getOffsetPs(); - - /** - *
    -   * Number of occurrences of the event, if aggregated.
    -   * 
    - * - * int64 num_occurrences = 5; - */ - long getNumOccurrences(); - - /** - *
    -   * Duration of the event in picoseconds. Can be zero for an instant event.
    -   * 
    - * - * int64 duration_ps = 3; - */ - long getDurationPs(); - - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - 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; - */ - 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; - */ - int getStatsCount(); - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - java.util.List - getStatsOrBuilderList(); - /** - *
    -   * XStats associated with the event.
    -   * Each of these XStats should have a different metadata_id.
    -   * 
    - * - * repeated .tensorflow.profiler.XStat stats = 4; - */ - org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index); - - public org.tensorflow.proto.profiler.XEvent.DataCase getDataCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLine.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLine.java deleted file mode 100644 index e9342bbb66f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLine.java +++ /dev/null @@ -1,1508 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * An XLine is a timeline of trace events (XEvents).
    - * Next ID: 12
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XLine} - */ -public final class XLine extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XLine) - XLineOrBuilder { -private static final long serialVersionUID = 0L; - // Use XLine.newBuilder() to construct. - private XLine(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XLine() { - name_ = ""; - displayName_ = ""; - events_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XLine(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XLine( - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 24: { - - timestampNs_ = input.readInt64(); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - events_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - events_.add( - input.readMessage(org.tensorflow.proto.profiler.XEvent.parser(), extensionRegistry)); - break; - } - case 72: { - - durationPs_ = input.readInt64(); - break; - } - case 80: { - - displayId_ = input.readInt64(); - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - 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)) { - events_ = java.util.Collections.unmodifiableList(events_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XLine_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XLine_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XLine.class, org.tensorflow.proto.profiler.XLine.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - *
    -   * Id of this line, can be repeated within an XPlane. All XLines with the
    -   * same id are effectively the same timeline.
    -   * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - - public static final int DISPLAY_ID_FIELD_NUMBER = 10; - private long displayId_; - /** - *
    -   * Display id of this line. Multiple lines with the same display_id are
    -   * grouped together in the same trace viewer row.
    -   * 
    - * - * int64 display_id = 10; - */ - public long getDisplayId() { - return displayId_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -   * Name of this XLine.
    -   * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -   * Name of this XLine.
    -   * 
    - * - * string name = 2; - */ - 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 DISPLAY_NAME_FIELD_NUMBER = 11; - private volatile java.lang.Object displayName_; - /** - *
    -   * Name of this XLine to display in trace viewer.
    -   * 
    - * - * string display_name = 11; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - 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(); - displayName_ = s; - return s; - } - } - /** - *
    -   * Name of this XLine to display in trace viewer.
    -   * 
    - * - * string display_name = 11; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_NS_FIELD_NUMBER = 3; - private long timestampNs_; - /** - *
    -   * Start time of this line in nanoseconds since the UNIX epoch.
    -   * XEvent.offset_ps is relative to this timestamp.
    -   * 
    - * - * int64 timestamp_ns = 3; - */ - public long getTimestampNs() { - return timestampNs_; - } - - public static final int DURATION_PS_FIELD_NUMBER = 9; - private long durationPs_; - /** - *
    -   * Profiling duration for this line in picoseconds.
    -   * 
    - * - * int64 duration_ps = 9; - */ - public long getDurationPs() { - return durationPs_; - } - - public static final int EVENTS_FIELD_NUMBER = 4; - private java.util.List events_; - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public java.util.List getEventsList() { - return events_; - } - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public java.util.List - getEventsOrBuilderList() { - return events_; - } - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public int getEventsCount() { - return events_.size(); - } - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEvent getEvents(int index) { - return events_.get(index); - } - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEventOrBuilder getEventsOrBuilder( - int index) { - return events_.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 { - if (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (timestampNs_ != 0L) { - output.writeInt64(3, timestampNs_); - } - for (int i = 0; i < events_.size(); i++) { - output.writeMessage(4, events_.get(i)); - } - if (durationPs_ != 0L) { - output.writeInt64(9, durationPs_); - } - if (displayId_ != 0L) { - output.writeInt64(10, displayId_); - } - if (!getDisplayNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, displayName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (timestampNs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, timestampNs_); - } - for (int i = 0; i < events_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, events_.get(i)); - } - if (durationPs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, durationPs_); - } - if (displayId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, displayId_); - } - if (!getDisplayNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, displayName_); - } - 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.XLine)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XLine other = (org.tensorflow.proto.profiler.XLine) obj; - - if (getId() - != other.getId()) return false; - if (getDisplayId() - != other.getDisplayId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getDisplayName() - .equals(other.getDisplayName())) return false; - if (getTimestampNs() - != other.getTimestampNs()) return false; - if (getDurationPs() - != other.getDurationPs()) return false; - if (!getEventsList() - .equals(other.getEventsList())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + DISPLAY_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDisplayId()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + TIMESTAMP_NS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimestampNs()); - hash = (37 * hash) + DURATION_PS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDurationPs()); - if (getEventsCount() > 0) { - hash = (37 * hash) + EVENTS_FIELD_NUMBER; - hash = (53 * hash) + getEventsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XLine parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XLine 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.XLine parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XLine 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.XLine parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XLine parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XLine parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XLine 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.XLine parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XLine 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.XLine parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XLine 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.XLine 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; - } - /** - *
    -   * An XLine is a timeline of trace events (XEvents).
    -   * Next ID: 12
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XLine} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XLine) - org.tensorflow.proto.profiler.XLineOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XLine_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XLine_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XLine.class, org.tensorflow.proto.profiler.XLine.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XLine.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEventsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0L; - - displayId_ = 0L; - - name_ = ""; - - displayName_ = ""; - - timestampNs_ = 0L; - - durationPs_ = 0L; - - if (eventsBuilder_ == null) { - events_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - eventsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XLine_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XLine getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XLine.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XLine build() { - org.tensorflow.proto.profiler.XLine result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XLine buildPartial() { - org.tensorflow.proto.profiler.XLine result = new org.tensorflow.proto.profiler.XLine(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.displayId_ = displayId_; - result.name_ = name_; - result.displayName_ = displayName_; - result.timestampNs_ = timestampNs_; - result.durationPs_ = durationPs_; - if (eventsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - events_ = java.util.Collections.unmodifiableList(events_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.events_ = events_; - } else { - result.events_ = eventsBuilder_.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.profiler.XLine) { - return mergeFrom((org.tensorflow.proto.profiler.XLine)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XLine other) { - if (other == org.tensorflow.proto.profiler.XLine.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (other.getDisplayId() != 0L) { - setDisplayId(other.getDisplayId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - if (other.getTimestampNs() != 0L) { - setTimestampNs(other.getTimestampNs()); - } - if (other.getDurationPs() != 0L) { - setDurationPs(other.getDurationPs()); - } - if (eventsBuilder_ == null) { - if (!other.events_.isEmpty()) { - if (events_.isEmpty()) { - events_ = other.events_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEventsIsMutable(); - events_.addAll(other.events_); - } - onChanged(); - } - } else { - if (!other.events_.isEmpty()) { - if (eventsBuilder_.isEmpty()) { - eventsBuilder_.dispose(); - eventsBuilder_ = null; - events_ = other.events_; - bitField0_ = (bitField0_ & ~0x00000001); - eventsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEventsFieldBuilder() : null; - } else { - eventsBuilder_.addAllMessages(other.events_); - } - } - } - 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.XLine parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XLine) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long id_ ; - /** - *
    -     * Id of this line, can be repeated within an XPlane. All XLines with the
    -     * same id are effectively the same timeline.
    -     * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - /** - *
    -     * Id of this line, can be repeated within an XPlane. All XLines with the
    -     * same id are effectively the same timeline.
    -     * 
    - * - * int64 id = 1; - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
    -     * Id of this line, can be repeated within an XPlane. All XLines with the
    -     * same id are effectively the same timeline.
    -     * 
    - * - * int64 id = 1; - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private long displayId_ ; - /** - *
    -     * Display id of this line. Multiple lines with the same display_id are
    -     * grouped together in the same trace viewer row.
    -     * 
    - * - * int64 display_id = 10; - */ - public long getDisplayId() { - return displayId_; - } - /** - *
    -     * Display id of this line. Multiple lines with the same display_id are
    -     * grouped together in the same trace viewer row.
    -     * 
    - * - * int64 display_id = 10; - */ - public Builder setDisplayId(long value) { - - displayId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Display id of this line. Multiple lines with the same display_id are
    -     * grouped together in the same trace viewer row.
    -     * 
    - * - * int64 display_id = 10; - */ - public Builder clearDisplayId() { - - displayId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of this XLine.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of this XLine.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of this XLine.
    -     * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of this XLine.
    -     * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of this XLine.
    -     * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object displayName_ = ""; - /** - *
    -     * Name of this XLine to display in trace viewer.
    -     * 
    - * - * string display_name = 11; - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of this XLine to display in trace viewer.
    -     * 
    - * - * string display_name = 11; - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of this XLine to display in trace viewer.
    -     * 
    - * - * string display_name = 11; - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of this XLine to display in trace viewer.
    -     * 
    - * - * string display_name = 11; - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - *
    -     * Name of this XLine to display in trace viewer.
    -     * 
    - * - * string display_name = 11; - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private long timestampNs_ ; - /** - *
    -     * Start time of this line in nanoseconds since the UNIX epoch.
    -     * XEvent.offset_ps is relative to this timestamp.
    -     * 
    - * - * int64 timestamp_ns = 3; - */ - public long getTimestampNs() { - return timestampNs_; - } - /** - *
    -     * Start time of this line in nanoseconds since the UNIX epoch.
    -     * XEvent.offset_ps is relative to this timestamp.
    -     * 
    - * - * int64 timestamp_ns = 3; - */ - public Builder setTimestampNs(long value) { - - timestampNs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Start time of this line in nanoseconds since the UNIX epoch.
    -     * XEvent.offset_ps is relative to this timestamp.
    -     * 
    - * - * int64 timestamp_ns = 3; - */ - public Builder clearTimestampNs() { - - timestampNs_ = 0L; - onChanged(); - return this; - } - - private long durationPs_ ; - /** - *
    -     * Profiling duration for this line in picoseconds.
    -     * 
    - * - * int64 duration_ps = 9; - */ - public long getDurationPs() { - return durationPs_; - } - /** - *
    -     * Profiling duration for this line in picoseconds.
    -     * 
    - * - * int64 duration_ps = 9; - */ - public Builder setDurationPs(long value) { - - durationPs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Profiling duration for this line in picoseconds.
    -     * 
    - * - * int64 duration_ps = 9; - */ - public Builder clearDurationPs() { - - durationPs_ = 0L; - onChanged(); - return this; - } - - private java.util.List events_ = - java.util.Collections.emptyList(); - private void ensureEventsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - events_ = new java.util.ArrayList(events_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XEvent, org.tensorflow.proto.profiler.XEvent.Builder, org.tensorflow.proto.profiler.XEventOrBuilder> eventsBuilder_; - - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public java.util.List getEventsList() { - if (eventsBuilder_ == null) { - return java.util.Collections.unmodifiableList(events_); - } else { - return eventsBuilder_.getMessageList(); - } - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public int getEventsCount() { - if (eventsBuilder_ == null) { - return events_.size(); - } else { - return eventsBuilder_.getCount(); - } - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEvent getEvents(int index) { - if (eventsBuilder_ == null) { - return events_.get(index); - } else { - return eventsBuilder_.getMessage(index); - } - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder setEvents( - int index, org.tensorflow.proto.profiler.XEvent value) { - if (eventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventsIsMutable(); - events_.set(index, value); - onChanged(); - } else { - eventsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder setEvents( - int index, org.tensorflow.proto.profiler.XEvent.Builder builderForValue) { - if (eventsBuilder_ == null) { - ensureEventsIsMutable(); - events_.set(index, builderForValue.build()); - onChanged(); - } else { - eventsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder addEvents(org.tensorflow.proto.profiler.XEvent value) { - if (eventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventsIsMutable(); - events_.add(value); - onChanged(); - } else { - eventsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder addEvents( - int index, org.tensorflow.proto.profiler.XEvent value) { - if (eventsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventsIsMutable(); - events_.add(index, value); - onChanged(); - } else { - eventsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder addEvents( - org.tensorflow.proto.profiler.XEvent.Builder builderForValue) { - if (eventsBuilder_ == null) { - ensureEventsIsMutable(); - events_.add(builderForValue.build()); - onChanged(); - } else { - eventsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder addEvents( - int index, org.tensorflow.proto.profiler.XEvent.Builder builderForValue) { - if (eventsBuilder_ == null) { - ensureEventsIsMutable(); - events_.add(index, builderForValue.build()); - onChanged(); - } else { - eventsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder addAllEvents( - java.lang.Iterable values) { - if (eventsBuilder_ == null) { - ensureEventsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, events_); - onChanged(); - } else { - eventsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder clearEvents() { - if (eventsBuilder_ == null) { - events_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - eventsBuilder_.clear(); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public Builder removeEvents(int index) { - if (eventsBuilder_ == null) { - ensureEventsIsMutable(); - events_.remove(index); - onChanged(); - } else { - eventsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEvent.Builder getEventsBuilder( - int index) { - return getEventsFieldBuilder().getBuilder(index); - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEventOrBuilder getEventsOrBuilder( - int index) { - if (eventsBuilder_ == null) { - return events_.get(index); } else { - return eventsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public java.util.List - getEventsOrBuilderList() { - if (eventsBuilder_ != null) { - return eventsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(events_); - } - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEvent.Builder addEventsBuilder() { - return getEventsFieldBuilder().addBuilder( - org.tensorflow.proto.profiler.XEvent.getDefaultInstance()); - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public org.tensorflow.proto.profiler.XEvent.Builder addEventsBuilder( - int index) { - return getEventsFieldBuilder().addBuilder( - index, org.tensorflow.proto.profiler.XEvent.getDefaultInstance()); - } - /** - *
    -     * XEvents within the same XLine should not overlap in time, but they can be
    -     * nested.
    -     * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - public java.util.List - getEventsBuilderList() { - return getEventsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XEvent, org.tensorflow.proto.profiler.XEvent.Builder, org.tensorflow.proto.profiler.XEventOrBuilder> - getEventsFieldBuilder() { - if (eventsBuilder_ == null) { - eventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XEvent, org.tensorflow.proto.profiler.XEvent.Builder, org.tensorflow.proto.profiler.XEventOrBuilder>( - events_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - events_ = null; - } - return eventsBuilder_; - } - @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.XLine) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XLine) - private static final org.tensorflow.proto.profiler.XLine DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XLine(); - } - - public static org.tensorflow.proto.profiler.XLine getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XLine parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XLine(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.XLine getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLineOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLineOrBuilder.java deleted file mode 100644 index 1cf5477dca7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XLineOrBuilder.java +++ /dev/null @@ -1,133 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XLineOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XLine) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Id of this line, can be repeated within an XPlane. All XLines with the
    -   * same id are effectively the same timeline.
    -   * 
    - * - * int64 id = 1; - */ - long getId(); - - /** - *
    -   * Display id of this line. Multiple lines with the same display_id are
    -   * grouped together in the same trace viewer row.
    -   * 
    - * - * int64 display_id = 10; - */ - long getDisplayId(); - - /** - *
    -   * Name of this XLine.
    -   * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -   * Name of this XLine.
    -   * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Name of this XLine to display in trace viewer.
    -   * 
    - * - * string display_name = 11; - */ - java.lang.String getDisplayName(); - /** - *
    -   * Name of this XLine to display in trace viewer.
    -   * 
    - * - * string display_name = 11; - */ - com.google.protobuf.ByteString - getDisplayNameBytes(); - - /** - *
    -   * Start time of this line in nanoseconds since the UNIX epoch.
    -   * XEvent.offset_ps is relative to this timestamp.
    -   * 
    - * - * int64 timestamp_ns = 3; - */ - long getTimestampNs(); - - /** - *
    -   * Profiling duration for this line in picoseconds.
    -   * 
    - * - * int64 duration_ps = 9; - */ - long getDurationPs(); - - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - java.util.List - getEventsList(); - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - org.tensorflow.proto.profiler.XEvent getEvents(int index); - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - int getEventsCount(); - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - java.util.List - getEventsOrBuilderList(); - /** - *
    -   * XEvents within the same XLine should not overlap in time, but they can be
    -   * nested.
    -   * 
    - * - * repeated .tensorflow.profiler.XEvent events = 4; - */ - org.tensorflow.proto.profiler.XEventOrBuilder getEventsOrBuilder( - int index); -} 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 deleted file mode 100644 index f63470466e8..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlane.java +++ /dev/null @@ -1,2191 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * An XPlane is a container of parallel timelines (XLines), generated by a
    - * profiling source or by post-processing one or more XPlanes.
    - * Next ID: 7
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XPlane} - */ -public final class XPlane extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XPlane) - XPlaneOrBuilder { -private static final long serialVersionUID = 0L; - // Use XPlane.newBuilder() to construct. - private XPlane(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XPlane() { - name_ = ""; - lines_ = java.util.Collections.emptyList(); - stats_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XPlane(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XPlane( - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - lines_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - lines_.add( - input.readMessage(org.tensorflow.proto.profiler.XLine.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - eventMetadata_ = com.google.protobuf.MapField.newMapField( - EventMetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - eventMetadata__ = input.readMessage( - EventMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - eventMetadata_.getMutableMap().put( - eventMetadata__.getKey(), eventMetadata__.getValue()); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - statMetadata_ = com.google.protobuf.MapField.newMapField( - StatMetadataDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000004; - } - com.google.protobuf.MapEntry - statMetadata__ = input.readMessage( - StatMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - statMetadata_.getMutableMap().put( - statMetadata__.getKey(), statMetadata__.getValue()); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - stats_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - stats_.add( - input.readMessage(org.tensorflow.proto.profiler.XStat.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_ & 0x00000001) != 0)) { - lines_ = java.util.Collections.unmodifiableList(lines_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - stats_ = java.util.Collections.unmodifiableList(stats_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetEventMetadata(); - case 5: - return internalGetStatMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XPlane.class, org.tensorflow.proto.profiler.XPlane.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - * int64 id = 1; - */ - public long getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -   * Name of this line.
    -   * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -   * Name of this line.
    -   * 
    - * - * string name = 2; - */ - 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 LINES_FIELD_NUMBER = 3; - private java.util.List lines_; - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public java.util.List getLinesList() { - return lines_; - } - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public java.util.List - getLinesOrBuilderList() { - return lines_; - } - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public int getLinesCount() { - return lines_.size(); - } - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLine getLines(int index) { - return lines_.get(index); - } - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder( - int index) { - return lines_.get(index); - } - - public static final int EVENT_METADATA_FIELD_NUMBER = 4; - private static final class EventMetadataDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.profiler.XEventMetadata.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> eventMetadata_; - private com.google.protobuf.MapField - internalGetEventMetadata() { - if (eventMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EventMetadataDefaultEntryHolder.defaultEntry); - } - return eventMetadata_; - } - - public int getEventMetadataCount() { - return internalGetEventMetadata().getMap().size(); - } - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public boolean containsEventMetadata( - long key) { - - return internalGetEventMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getEventMetadataMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEventMetadata() { - return getEventMetadataMap(); - } - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public java.util.Map getEventMetadataMap() { - return internalGetEventMetadata().getMap(); - } - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XEventMetadata defaultValue) { - - java.util.Map map = - internalGetEventMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrThrow( - long key) { - - java.util.Map map = - internalGetEventMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int STAT_METADATA_FIELD_NUMBER = 5; - private static final class StatMetadataDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.INT64, - 0L, - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.profiler.XStatMetadata.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> statMetadata_; - private com.google.protobuf.MapField - internalGetStatMetadata() { - if (statMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - StatMetadataDefaultEntryHolder.defaultEntry); - } - return statMetadata_; - } - - public int getStatMetadataCount() { - return internalGetStatMetadata().getMap().size(); - } - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public boolean containsStatMetadata( - long key) { - - return internalGetStatMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getStatMetadataMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getStatMetadata() { - return getStatMetadataMap(); - } - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public java.util.Map getStatMetadataMap() { - return internalGetStatMetadata().getMap(); - } - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XStatMetadata defaultValue) { - - java.util.Map map = - internalGetStatMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( - long key) { - - java.util.Map map = - internalGetStatMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int STATS_FIELD_NUMBER = 6; - private java.util.List stats_; - /** - *
    -   * 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; - */ - public java.util.List getStatsList() { - return stats_; - } - /** - *
    -   * 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; - */ - public java.util.List - getStatsOrBuilderList() { - return stats_; - } - /** - *
    -   * 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; - */ - public int getStatsCount() { - return stats_.size(); - } - /** - *
    -   * 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; - */ - public org.tensorflow.proto.profiler.XStat getStats(int index) { - return stats_.get(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; - */ - public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index) { - return stats_.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 { - if (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - for (int i = 0; i < lines_.size(); i++) { - output.writeMessage(3, lines_.get(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeLongMapTo( - output, - internalGetEventMetadata(), - EventMetadataDefaultEntryHolder.defaultEntry, - 4); - com.google.protobuf.GeneratedMessageV3 - .serializeLongMapTo( - output, - internalGetStatMetadata(), - StatMetadataDefaultEntryHolder.defaultEntry, - 5); - for (int i = 0; i < stats_.size(); i++) { - output.writeMessage(6, stats_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - for (int i = 0; i < lines_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, lines_.get(i)); - } - for (java.util.Map.Entry entry - : internalGetEventMetadata().getMap().entrySet()) { - com.google.protobuf.MapEntry - eventMetadata__ = EventMetadataDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, eventMetadata__); - } - for (java.util.Map.Entry entry - : internalGetStatMetadata().getMap().entrySet()) { - com.google.protobuf.MapEntry - statMetadata__ = StatMetadataDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, statMetadata__); - } - for (int i = 0; i < stats_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, stats_.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.profiler.XPlane)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XPlane other = (org.tensorflow.proto.profiler.XPlane) obj; - - if (getId() - != other.getId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getLinesList() - .equals(other.getLinesList())) return false; - if (!internalGetEventMetadata().equals( - other.internalGetEventMetadata())) return false; - if (!internalGetStatMetadata().equals( - other.internalGetStatMetadata())) return false; - if (!getStatsList() - .equals(other.getStatsList())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getLinesCount() > 0) { - hash = (37 * hash) + LINES_FIELD_NUMBER; - hash = (53 * hash) + getLinesList().hashCode(); - } - if (!internalGetEventMetadata().getMap().isEmpty()) { - hash = (37 * hash) + EVENT_METADATA_FIELD_NUMBER; - hash = (53 * hash) + internalGetEventMetadata().hashCode(); - } - if (!internalGetStatMetadata().getMap().isEmpty()) { - hash = (37 * hash) + STAT_METADATA_FIELD_NUMBER; - hash = (53 * hash) + internalGetStatMetadata().hashCode(); - } - if (getStatsCount() > 0) { - hash = (37 * hash) + STATS_FIELD_NUMBER; - hash = (53 * hash) + getStatsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XPlane parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XPlane 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.XPlane parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XPlane 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.XPlane parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XPlane parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XPlane parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XPlane 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.XPlane parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XPlane 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.XPlane parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XPlane 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.XPlane 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; - } - /** - *
    -   * An XPlane is a container of parallel timelines (XLines), generated by a
    -   * profiling source or by post-processing one or more XPlanes.
    -   * Next ID: 7
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XPlane} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XPlane) - org.tensorflow.proto.profiler.XPlaneOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 4: - return internalGetEventMetadata(); - case 5: - return internalGetStatMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 4: - return internalGetMutableEventMetadata(); - case 5: - return internalGetMutableStatMetadata(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XPlane.class, org.tensorflow.proto.profiler.XPlane.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XPlane.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getLinesFieldBuilder(); - getStatsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0L; - - name_ = ""; - - if (linesBuilder_ == null) { - lines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - linesBuilder_.clear(); - } - internalGetMutableEventMetadata().clear(); - internalGetMutableStatMetadata().clear(); - if (statsBuilder_ == null) { - stats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - statsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XPlane_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XPlane getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XPlane.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XPlane build() { - org.tensorflow.proto.profiler.XPlane result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XPlane buildPartial() { - org.tensorflow.proto.profiler.XPlane result = new org.tensorflow.proto.profiler.XPlane(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.name_ = name_; - if (linesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - lines_ = java.util.Collections.unmodifiableList(lines_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.lines_ = lines_; - } else { - result.lines_ = linesBuilder_.build(); - } - result.eventMetadata_ = internalGetEventMetadata(); - result.eventMetadata_.makeImmutable(); - result.statMetadata_ = internalGetStatMetadata(); - result.statMetadata_.makeImmutable(); - if (statsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - stats_ = java.util.Collections.unmodifiableList(stats_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.stats_ = stats_; - } else { - result.stats_ = statsBuilder_.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.profiler.XPlane) { - return mergeFrom((org.tensorflow.proto.profiler.XPlane)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XPlane other) { - if (other == org.tensorflow.proto.profiler.XPlane.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (linesBuilder_ == null) { - if (!other.lines_.isEmpty()) { - if (lines_.isEmpty()) { - lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureLinesIsMutable(); - lines_.addAll(other.lines_); - } - onChanged(); - } - } else { - if (!other.lines_.isEmpty()) { - if (linesBuilder_.isEmpty()) { - linesBuilder_.dispose(); - linesBuilder_ = null; - lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000001); - linesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinesFieldBuilder() : null; - } else { - linesBuilder_.addAllMessages(other.lines_); - } - } - } - internalGetMutableEventMetadata().mergeFrom( - other.internalGetEventMetadata()); - internalGetMutableStatMetadata().mergeFrom( - other.internalGetStatMetadata()); - if (statsBuilder_ == null) { - if (!other.stats_.isEmpty()) { - if (stats_.isEmpty()) { - stats_ = other.stats_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureStatsIsMutable(); - stats_.addAll(other.stats_); - } - onChanged(); - } - } else { - if (!other.stats_.isEmpty()) { - if (statsBuilder_.isEmpty()) { - statsBuilder_.dispose(); - statsBuilder_ = null; - stats_ = other.stats_; - bitField0_ = (bitField0_ & ~0x00000008); - statsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getStatsFieldBuilder() : null; - } else { - statsBuilder_.addAllMessages(other.stats_); - } - } - } - 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.XPlane parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XPlane) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long id_ ; - /** - * int64 id = 1; - */ - public long getId() { - return id_; - } - /** - * int64 id = 1; - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int64 id = 1; - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of this line.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of this line.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of this line.
    -     * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of this line.
    -     * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of this line.
    -     * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List lines_ = - java.util.Collections.emptyList(); - private void ensureLinesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - lines_ = new java.util.ArrayList(lines_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder> linesBuilder_; - - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public java.util.List getLinesList() { - if (linesBuilder_ == null) { - return java.util.Collections.unmodifiableList(lines_); - } else { - return linesBuilder_.getMessageList(); - } - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public int getLinesCount() { - if (linesBuilder_ == null) { - return lines_.size(); - } else { - return linesBuilder_.getCount(); - } - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLine getLines(int index) { - if (linesBuilder_ == null) { - return lines_.get(index); - } else { - return linesBuilder_.getMessage(index); - } - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder setLines( - int index, org.tensorflow.proto.profiler.XLine value) { - if (linesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.set(index, value); - onChanged(); - } else { - linesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder setLines( - int index, org.tensorflow.proto.profiler.XLine.Builder builderForValue) { - if (linesBuilder_ == null) { - ensureLinesIsMutable(); - lines_.set(index, builderForValue.build()); - onChanged(); - } else { - linesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder addLines(org.tensorflow.proto.profiler.XLine value) { - if (linesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.add(value); - onChanged(); - } else { - linesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder addLines( - int index, org.tensorflow.proto.profiler.XLine value) { - if (linesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.add(index, value); - onChanged(); - } else { - linesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder addLines( - org.tensorflow.proto.profiler.XLine.Builder builderForValue) { - if (linesBuilder_ == null) { - ensureLinesIsMutable(); - lines_.add(builderForValue.build()); - onChanged(); - } else { - linesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder addLines( - int index, org.tensorflow.proto.profiler.XLine.Builder builderForValue) { - if (linesBuilder_ == null) { - ensureLinesIsMutable(); - lines_.add(index, builderForValue.build()); - onChanged(); - } else { - linesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder addAllLines( - java.lang.Iterable values) { - if (linesBuilder_ == null) { - ensureLinesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, lines_); - onChanged(); - } else { - linesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder clearLines() { - if (linesBuilder_ == null) { - lines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - linesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public Builder removeLines(int index) { - if (linesBuilder_ == null) { - ensureLinesIsMutable(); - lines_.remove(index); - onChanged(); - } else { - linesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLine.Builder getLinesBuilder( - int index) { - return getLinesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder( - int index) { - if (linesBuilder_ == null) { - return lines_.get(index); } else { - return linesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public java.util.List - getLinesOrBuilderList() { - if (linesBuilder_ != null) { - return linesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(lines_); - } - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLine.Builder addLinesBuilder() { - return getLinesFieldBuilder().addBuilder( - org.tensorflow.proto.profiler.XLine.getDefaultInstance()); - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public org.tensorflow.proto.profiler.XLine.Builder addLinesBuilder( - int index) { - return getLinesFieldBuilder().addBuilder( - index, org.tensorflow.proto.profiler.XLine.getDefaultInstance()); - } - /** - *
    -     * Parallel timelines grouped in this plane. XLines with the same id
    -     * are effectively the same timeline.
    -     * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - public java.util.List - getLinesBuilderList() { - return getLinesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder> - getLinesFieldBuilder() { - if (linesBuilder_ == null) { - linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XLine, org.tensorflow.proto.profiler.XLine.Builder, org.tensorflow.proto.profiler.XLineOrBuilder>( - lines_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - lines_ = null; - } - return linesBuilder_; - } - - private com.google.protobuf.MapField< - java.lang.Long, org.tensorflow.proto.profiler.XEventMetadata> eventMetadata_; - private com.google.protobuf.MapField - internalGetEventMetadata() { - if (eventMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EventMetadataDefaultEntryHolder.defaultEntry); - } - return eventMetadata_; - } - private com.google.protobuf.MapField - internalGetMutableEventMetadata() { - onChanged();; - if (eventMetadata_ == null) { - eventMetadata_ = com.google.protobuf.MapField.newMapField( - EventMetadataDefaultEntryHolder.defaultEntry); - } - if (!eventMetadata_.isMutable()) { - eventMetadata_ = eventMetadata_.copy(); - } - return eventMetadata_; - } - - public int getEventMetadataCount() { - return internalGetEventMetadata().getMap().size(); - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public boolean containsEventMetadata( - long key) { - - return internalGetEventMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getEventMetadataMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEventMetadata() { - return getEventMetadataMap(); - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public java.util.Map getEventMetadataMap() { - return internalGetEventMetadata().getMap(); - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XEventMetadata defaultValue) { - - java.util.Map map = - internalGetEventMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrThrow( - long key) { - - java.util.Map map = - internalGetEventMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearEventMetadata() { - internalGetMutableEventMetadata().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public Builder removeEventMetadata( - long key) { - - internalGetMutableEventMetadata().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableEventMetadata() { - return internalGetMutableEventMetadata().getMutableMap(); - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - public Builder putEventMetadata( - long key, - org.tensorflow.proto.profiler.XEventMetadata value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableEventMetadata().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -     * should be used for events that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - public Builder putAllEventMetadata( - java.util.Map values) { - internalGetMutableEventMetadata().getMutableMap() - .putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.Long, org.tensorflow.proto.profiler.XStatMetadata> statMetadata_; - private com.google.protobuf.MapField - internalGetStatMetadata() { - if (statMetadata_ == null) { - return com.google.protobuf.MapField.emptyMapField( - StatMetadataDefaultEntryHolder.defaultEntry); - } - return statMetadata_; - } - private com.google.protobuf.MapField - internalGetMutableStatMetadata() { - onChanged();; - if (statMetadata_ == null) { - statMetadata_ = com.google.protobuf.MapField.newMapField( - StatMetadataDefaultEntryHolder.defaultEntry); - } - if (!statMetadata_.isMutable()) { - statMetadata_ = statMetadata_.copy(); - } - return statMetadata_; - } - - public int getStatMetadataCount() { - return internalGetStatMetadata().getMap().size(); - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public boolean containsStatMetadata( - long key) { - - return internalGetStatMetadata().getMap().containsKey(key); - } - /** - * Use {@link #getStatMetadataMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getStatMetadata() { - return getStatMetadataMap(); - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public java.util.Map getStatMetadataMap() { - return internalGetStatMetadata().getMap(); - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XStatMetadata defaultValue) { - - java.util.Map map = - internalGetStatMetadata().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( - long key) { - - java.util.Map map = - internalGetStatMetadata().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearStatMetadata() { - internalGetMutableStatMetadata().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public Builder removeStatMetadata( - long key) { - - internalGetMutableStatMetadata().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableStatMetadata() { - return internalGetMutableStatMetadata().getMutableMap(); - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - public Builder putStatMetadata( - long key, - org.tensorflow.proto.profiler.XStatMetadata value) { - - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableStatMetadata().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -     * should be used for stats that share the same ID over the whole XPlane.
    -     * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - public Builder putAllStatMetadata( - java.util.Map values) { - internalGetMutableStatMetadata().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List stats_ = - java.util.Collections.emptyList(); - private void ensureStatsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - stats_ = new java.util.ArrayList(stats_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XStat, org.tensorflow.proto.profiler.XStat.Builder, org.tensorflow.proto.profiler.XStatOrBuilder> statsBuilder_; - - /** - *
    -     * 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; - */ - public java.util.List getStatsList() { - if (statsBuilder_ == null) { - return java.util.Collections.unmodifiableList(stats_); - } else { - return statsBuilder_.getMessageList(); - } - } - /** - *
    -     * 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; - */ - public int getStatsCount() { - if (statsBuilder_ == null) { - return stats_.size(); - } else { - return statsBuilder_.getCount(); - } - } - /** - *
    -     * 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; - */ - public org.tensorflow.proto.profiler.XStat getStats(int index) { - if (statsBuilder_ == null) { - return stats_.get(index); - } else { - return statsBuilder_.getMessage(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; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - 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 associated with this plane, e.g. device capabilities.
    -     * Each of these XStats should have a different metadata_id.
    -     * 
    - * - * repeated .tensorflow.profiler.XStat stats = 6; - */ - public Builder clearStats() { - if (statsBuilder_ == null) { - stats_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - statsBuilder_.clear(); - } - return this; - } - /** - *
    -     * 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; - */ - public Builder removeStats(int index) { - if (statsBuilder_ == null) { - ensureStatsIsMutable(); - stats_.remove(index); - onChanged(); - } else { - statsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * 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; - */ - public org.tensorflow.proto.profiler.XStat.Builder getStatsBuilder( - int index) { - return getStatsFieldBuilder().getBuilder(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; - */ - public org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index) { - if (statsBuilder_ == null) { - return stats_.get(index); } else { - return statsBuilder_.getMessageOrBuilder(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; - */ - public java.util.List - getStatsOrBuilderList() { - if (statsBuilder_ != null) { - return statsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(stats_); - } - } - /** - *
    -     * 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; - */ - public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder() { - return getStatsFieldBuilder().addBuilder( - org.tensorflow.proto.profiler.XStat.getDefaultInstance()); - } - /** - *
    -     * 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; - */ - public org.tensorflow.proto.profiler.XStat.Builder addStatsBuilder( - int index) { - return getStatsFieldBuilder().addBuilder( - index, org.tensorflow.proto.profiler.XStat.getDefaultInstance()); - } - /** - *
    -     * 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; - */ - 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_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - stats_ = null; - } - return statsBuilder_; - } - @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.XPlane) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XPlane) - private static final org.tensorflow.proto.profiler.XPlane DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XPlane(); - } - - public static org.tensorflow.proto.profiler.XPlane getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XPlane parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XPlane(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.XPlane getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 1600cdece2b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneOrBuilder.java +++ /dev/null @@ -1,248 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XPlaneOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XPlane) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 id = 1; - */ - long getId(); - - /** - *
    -   * Name of this line.
    -   * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -   * Name of this line.
    -   * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - java.util.List - getLinesList(); - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - org.tensorflow.proto.profiler.XLine getLines(int index); - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - int getLinesCount(); - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - java.util.List - getLinesOrBuilderList(); - /** - *
    -   * Parallel timelines grouped in this plane. XLines with the same id
    -   * are effectively the same timeline.
    -   * 
    - * - * repeated .tensorflow.profiler.XLine lines = 3; - */ - org.tensorflow.proto.profiler.XLineOrBuilder getLinesOrBuilder( - int index); - - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - int getEventMetadataCount(); - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - boolean containsEventMetadata( - long key); - /** - * Use {@link #getEventMetadataMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getEventMetadata(); - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - java.util.Map - getEventMetadataMap(); - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XEventMetadata defaultValue); - /** - *
    -   * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    -   * should be used for events that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; - */ - - org.tensorflow.proto.profiler.XEventMetadata getEventMetadataOrThrow( - long key); - - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - int getStatMetadataCount(); - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - boolean containsStatMetadata( - long key); - /** - * Use {@link #getStatMetadataMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getStatMetadata(); - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - java.util.Map - getStatMetadataMap(); - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrDefault( - long key, - org.tensorflow.proto.profiler.XStatMetadata defaultValue); - /** - *
    -   * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    -   * should be used for stats that share the same ID over the whole XPlane.
    -   * 
    - * - * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; - */ - - org.tensorflow.proto.profiler.XStatMetadata getStatMetadataOrThrow( - long key); - - /** - *
    -   * 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; - */ - 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; - */ - 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; - */ - 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; - */ - java.util.List - getStatsOrBuilderList(); - /** - *
    -   * 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; - */ - org.tensorflow.proto.profiler.XStatOrBuilder getStatsOrBuilder( - int index); -} 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 deleted file mode 100644 index 041babd2d79..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XPlaneProtos.java +++ /dev/null @@ -1,169 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public final class XPlaneProtos { - private XPlaneProtos() {} - 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_XSpace_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XSpace_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XPlane_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XPlane_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XLine_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XLine_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XEvent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XStat_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XStat_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XEventMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_profiler_XStatMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_profiler_XStatMetadata_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/profiler/protobuf/xpla" + - "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\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\"\217\001\n\016XEventMetadata\022" + - "\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\024\n\014display_nam" + - "e\030\004 \001(\t\022\020\n\010metadata\030\003 \001(\014\022)\n\005stats\030\005 \003(\013" + - "2\032.tensorflow.profiler.XStat\022\020\n\010child_id" + - "\030\006 \003(\003\">\n\rXStatMetadata\022\n\n\002id\030\001 \001(\003\022\014\n\004n" + - "ame\030\002 \001(\t\022\023\n\013description\030\003 \001(\tB2\n\035org.te" + - "nsorflow.proto.profilerB\014XPlaneProtosP\001\370" + - "\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_profiler_XSpace_descriptor = - getDescriptor().getMessageTypes().get(0); - 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", "Hostnames", }); - internal_static_tensorflow_profiler_XPlane_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_profiler_XPlane_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XPlane_descriptor, - new java.lang.String[] { "Id", "Name", "Lines", "EventMetadata", "StatMetadata", "Stats", }); - internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor = - internal_static_tensorflow_profiler_XPlane_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor = - internal_static_tensorflow_profiler_XPlane_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_profiler_XLine_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_profiler_XLine_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XLine_descriptor, - new java.lang.String[] { "Id", "DisplayId", "Name", "DisplayName", "TimestampNs", "DurationPs", "Events", }); - internal_static_tensorflow_profiler_XEvent_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_profiler_XEvent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XEvent_descriptor, - new java.lang.String[] { "MetadataId", "OffsetPs", "NumOccurrences", "DurationPs", "Stats", "Data", }); - internal_static_tensorflow_profiler_XStat_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_profiler_XStat_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XStat_descriptor, - new java.lang.String[] { "MetadataId", "DoubleValue", "Uint64Value", "Int64Value", "StrValue", "BytesValue", "RefValue", "Value", }); - internal_static_tensorflow_profiler_XEventMetadata_descriptor = - getDescriptor().getMessageTypes().get(5); - 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", "Stats", "ChildId", }); - internal_static_tensorflow_profiler_XStatMetadata_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_profiler_XStatMetadata_descriptor, - new java.lang.String[] { "Id", "Name", "Description", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} 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 deleted file mode 100644 index 1c15a523498..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpace.java +++ /dev/null @@ -1,1441 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * A container of parallel XPlanes, generated by one or more profiling sources.
    - * Next ID: 5
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XSpace} - */ -public final class XSpace extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XSpace) - XSpaceOrBuilder { -private static final long serialVersionUID = 0L; - // Use XSpace.newBuilder() to construct. - private XSpace(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - 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 - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XSpace(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XSpace( - 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)) { - planes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - planes_.add( - input.readMessage(org.tensorflow.proto.profiler.XPlane.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - errors_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - errors_.add(s); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - warnings_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - 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)) { - 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)) { - planes_ = java.util.Collections.unmodifiableList(planes_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - errors_ = errors_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - warnings_ = warnings_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - hostnames_ = hostnames_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XSpace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XSpace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XSpace.class, org.tensorflow.proto.profiler.XSpace.Builder.class); - } - - public static final int PLANES_FIELD_NUMBER = 1; - private java.util.List planes_; - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public java.util.List getPlanesList() { - return planes_; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public java.util.List - getPlanesOrBuilderList() { - return planes_; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public int getPlanesCount() { - return planes_.size(); - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlane getPlanes(int index) { - return planes_.get(index); - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlaneOrBuilder getPlanesOrBuilder( - int index) { - return planes_.get(index); - } - - public static final int ERRORS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList errors_; - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - public com.google.protobuf.ProtocolStringList - getErrorsList() { - return errors_; - } - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - public int getErrorsCount() { - return errors_.size(); - } - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - public java.lang.String getErrors(int index) { - return errors_.get(index); - } - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - public com.google.protobuf.ByteString - getErrorsBytes(int index) { - return errors_.getByteString(index); - } - - public static final int WARNINGS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList warnings_; - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - public com.google.protobuf.ProtocolStringList - getWarningsList() { - return warnings_; - } - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - public int getWarningsCount() { - return warnings_.size(); - } - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - public java.lang.String getWarnings(int index) { - return warnings_.get(index); - } - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - public com.google.protobuf.ByteString - getWarningsBytes(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() { - 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 { - for (int i = 0; i < planes_.size(); i++) { - output.writeMessage(1, planes_.get(i)); - } - for (int i = 0; i < errors_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errors_.getRaw(i)); - } - 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); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < planes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, planes_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < errors_.size(); i++) { - dataSize += computeStringSizeNoTag(errors_.getRaw(i)); - } - size += dataSize; - size += 1 * getErrorsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < warnings_.size(); i++) { - dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); - } - 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; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.tensorflow.proto.profiler.XSpace)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XSpace other = (org.tensorflow.proto.profiler.XSpace) obj; - - if (!getPlanesList() - .equals(other.getPlanesList())) return false; - if (!getErrorsList() - .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; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPlanesCount() > 0) { - hash = (37 * hash) + PLANES_FIELD_NUMBER; - hash = (53 * hash) + getPlanesList().hashCode(); - } - if (getErrorsCount() > 0) { - hash = (37 * hash) + ERRORS_FIELD_NUMBER; - hash = (53 * hash) + getErrorsList().hashCode(); - } - if (getWarningsCount() > 0) { - 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; - } - - public static org.tensorflow.proto.profiler.XSpace parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XSpace 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.XSpace parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XSpace 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.XSpace parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XSpace parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XSpace parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XSpace 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.XSpace parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XSpace 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.XSpace parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XSpace 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.XSpace 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 container of parallel XPlanes, generated by one or more profiling sources.
    -   * Next ID: 5
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XSpace} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XSpace) - org.tensorflow.proto.profiler.XSpaceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XSpace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XSpace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XSpace.class, org.tensorflow.proto.profiler.XSpace.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XSpace.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPlanesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (planesBuilder_ == null) { - planes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - planesBuilder_.clear(); - } - errors_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - hostnames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XSpace_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XSpace getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XSpace.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XSpace build() { - org.tensorflow.proto.profiler.XSpace result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XSpace buildPartial() { - org.tensorflow.proto.profiler.XSpace result = new org.tensorflow.proto.profiler.XSpace(this); - int from_bitField0_ = bitField0_; - if (planesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - planes_ = java.util.Collections.unmodifiableList(planes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.planes_ = planes_; - } else { - result.planes_ = planesBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - errors_ = errors_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.errors_ = errors_; - if (((bitField0_ & 0x00000004) != 0)) { - warnings_ = warnings_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.warnings_ = warnings_; - if (((bitField0_ & 0x00000008) != 0)) { - hostnames_ = hostnames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.hostnames_ = hostnames_; - 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.XSpace) { - return mergeFrom((org.tensorflow.proto.profiler.XSpace)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XSpace other) { - if (other == org.tensorflow.proto.profiler.XSpace.getDefaultInstance()) return this; - if (planesBuilder_ == null) { - if (!other.planes_.isEmpty()) { - if (planes_.isEmpty()) { - planes_ = other.planes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePlanesIsMutable(); - planes_.addAll(other.planes_); - } - onChanged(); - } - } else { - if (!other.planes_.isEmpty()) { - if (planesBuilder_.isEmpty()) { - planesBuilder_.dispose(); - planesBuilder_ = null; - planes_ = other.planes_; - bitField0_ = (bitField0_ & ~0x00000001); - planesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPlanesFieldBuilder() : null; - } else { - planesBuilder_.addAllMessages(other.planes_); - } - } - } - if (!other.errors_.isEmpty()) { - if (errors_.isEmpty()) { - errors_ = other.errors_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureErrorsIsMutable(); - errors_.addAll(other.errors_); - } - onChanged(); - } - if (!other.warnings_.isEmpty()) { - if (warnings_.isEmpty()) { - warnings_ = other.warnings_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureWarningsIsMutable(); - warnings_.addAll(other.warnings_); - } - 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; - } - - @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.XSpace parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XSpace) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List planes_ = - java.util.Collections.emptyList(); - private void ensurePlanesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - planes_ = new java.util.ArrayList(planes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XPlane, org.tensorflow.proto.profiler.XPlane.Builder, org.tensorflow.proto.profiler.XPlaneOrBuilder> planesBuilder_; - - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public java.util.List getPlanesList() { - if (planesBuilder_ == null) { - return java.util.Collections.unmodifiableList(planes_); - } else { - return planesBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public int getPlanesCount() { - if (planesBuilder_ == null) { - return planes_.size(); - } else { - return planesBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlane getPlanes(int index) { - if (planesBuilder_ == null) { - return planes_.get(index); - } else { - return planesBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder setPlanes( - int index, org.tensorflow.proto.profiler.XPlane value) { - if (planesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePlanesIsMutable(); - planes_.set(index, value); - onChanged(); - } else { - planesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder setPlanes( - int index, org.tensorflow.proto.profiler.XPlane.Builder builderForValue) { - if (planesBuilder_ == null) { - ensurePlanesIsMutable(); - planes_.set(index, builderForValue.build()); - onChanged(); - } else { - planesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder addPlanes(org.tensorflow.proto.profiler.XPlane value) { - if (planesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePlanesIsMutable(); - planes_.add(value); - onChanged(); - } else { - planesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder addPlanes( - int index, org.tensorflow.proto.profiler.XPlane value) { - if (planesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePlanesIsMutable(); - planes_.add(index, value); - onChanged(); - } else { - planesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder addPlanes( - org.tensorflow.proto.profiler.XPlane.Builder builderForValue) { - if (planesBuilder_ == null) { - ensurePlanesIsMutable(); - planes_.add(builderForValue.build()); - onChanged(); - } else { - planesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder addPlanes( - int index, org.tensorflow.proto.profiler.XPlane.Builder builderForValue) { - if (planesBuilder_ == null) { - ensurePlanesIsMutable(); - planes_.add(index, builderForValue.build()); - onChanged(); - } else { - planesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder addAllPlanes( - java.lang.Iterable values) { - if (planesBuilder_ == null) { - ensurePlanesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, planes_); - onChanged(); - } else { - planesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder clearPlanes() { - if (planesBuilder_ == null) { - planes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - planesBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public Builder removePlanes(int index) { - if (planesBuilder_ == null) { - ensurePlanesIsMutable(); - planes_.remove(index); - onChanged(); - } else { - planesBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlane.Builder getPlanesBuilder( - int index) { - return getPlanesFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlaneOrBuilder getPlanesOrBuilder( - int index) { - if (planesBuilder_ == null) { - return planes_.get(index); } else { - return planesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public java.util.List - getPlanesOrBuilderList() { - if (planesBuilder_ != null) { - return planesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(planes_); - } - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlane.Builder addPlanesBuilder() { - return getPlanesFieldBuilder().addBuilder( - org.tensorflow.proto.profiler.XPlane.getDefaultInstance()); - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public org.tensorflow.proto.profiler.XPlane.Builder addPlanesBuilder( - int index) { - return getPlanesFieldBuilder().addBuilder( - index, org.tensorflow.proto.profiler.XPlane.getDefaultInstance()); - } - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - public java.util.List - getPlanesBuilderList() { - return getPlanesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XPlane, org.tensorflow.proto.profiler.XPlane.Builder, org.tensorflow.proto.profiler.XPlaneOrBuilder> - getPlanesFieldBuilder() { - if (planesBuilder_ == null) { - planesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.profiler.XPlane, org.tensorflow.proto.profiler.XPlane.Builder, org.tensorflow.proto.profiler.XPlaneOrBuilder>( - planes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - planes_ = null; - } - return planesBuilder_; - } - - private com.google.protobuf.LazyStringList errors_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureErrorsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - errors_ = new com.google.protobuf.LazyStringArrayList(errors_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public com.google.protobuf.ProtocolStringList - getErrorsList() { - return errors_.getUnmodifiableView(); - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public int getErrorsCount() { - return errors_.size(); - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public java.lang.String getErrors(int index) { - return errors_.get(index); - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public com.google.protobuf.ByteString - getErrorsBytes(int index) { - return errors_.getByteString(index); - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public Builder setErrors( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureErrorsIsMutable(); - errors_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public Builder addErrors( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureErrorsIsMutable(); - errors_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public Builder addAllErrors( - java.lang.Iterable values) { - ensureErrorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, errors_); - onChanged(); - return this; - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public Builder clearErrors() { - errors_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * Errors (if any) in the generation of planes.
    -     * 
    - * - * repeated string errors = 2; - */ - public Builder addErrorsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureErrorsIsMutable(); - errors_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureWarningsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); - bitField0_ |= 0x00000004; - } - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public com.google.protobuf.ProtocolStringList - getWarningsList() { - return warnings_.getUnmodifiableView(); - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public int getWarningsCount() { - return warnings_.size(); - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public java.lang.String getWarnings(int index) { - return warnings_.get(index); - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public com.google.protobuf.ByteString - getWarningsBytes(int index) { - return warnings_.getByteString(index); - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public Builder setWarnings( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureWarningsIsMutable(); - warnings_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public Builder addWarnings( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureWarningsIsMutable(); - warnings_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public Builder addAllWarnings( - java.lang.Iterable values) { - ensureWarningsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, warnings_); - onChanged(); - return this; - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public Builder clearWarnings() { - warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - *
    -     * Warnings (if any) in the generation of planes;
    -     * 
    - * - * repeated string warnings = 3; - */ - public Builder addWarningsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureWarningsIsMutable(); - warnings_.add(value); - 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) { - 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.XSpace) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XSpace) - private static final org.tensorflow.proto.profiler.XSpace DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XSpace(); - } - - public static org.tensorflow.proto.profiler.XSpace getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XSpace parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XSpace(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.XSpace getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 06a0a5b45ba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XSpaceOrBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XSpaceOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XSpace) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - java.util.List - getPlanesList(); - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - org.tensorflow.proto.profiler.XPlane getPlanes(int index); - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - int getPlanesCount(); - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - java.util.List - getPlanesOrBuilderList(); - /** - * repeated .tensorflow.profiler.XPlane planes = 1; - */ - org.tensorflow.proto.profiler.XPlaneOrBuilder getPlanesOrBuilder( - int index); - - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - java.util.List - getErrorsList(); - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - int getErrorsCount(); - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - java.lang.String getErrors(int index); - /** - *
    -   * Errors (if any) in the generation of planes.
    -   * 
    - * - * repeated string errors = 2; - */ - com.google.protobuf.ByteString - getErrorsBytes(int index); - - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - java.util.List - getWarningsList(); - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - int getWarningsCount(); - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - java.lang.String getWarnings(int index); - /** - *
    -   * Warnings (if any) in the generation of planes;
    -   * 
    - * - * repeated string warnings = 3; - */ - 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/XStat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStat.java deleted file mode 100644 index 3ab8c18a43a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStat.java +++ /dev/null @@ -1,1111 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * An XStat is a named value associated with an XEvent, e.g., a performance
    - * counter value, a metric computed by a formula applied over nested XEvents
    - * and XStats.
    - * Next ID: 8
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XStat} - */ -public final class XStat extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XStat) - XStatOrBuilder { -private static final long serialVersionUID = 0L; - // Use XStat.newBuilder() to construct. - private XStat(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XStat() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XStat(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XStat( - 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: { - - metadataId_ = input.readInt64(); - break; - } - case 17: { - valueCase_ = 2; - value_ = input.readDouble(); - break; - } - case 24: { - valueCase_ = 3; - value_ = input.readUInt64(); - break; - } - case 32: { - valueCase_ = 4; - value_ = input.readInt64(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - valueCase_ = 5; - value_ = s; - break; - } - case 50: { - valueCase_ = 6; - value_ = input.readBytes(); - break; - } - case 56: { - valueCase_ = 7; - value_ = 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 { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XStat.class, org.tensorflow.proto.profiler.XStat.Builder.class); - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite { - DOUBLE_VALUE(2), - UINT64_VALUE(3), - INT64_VALUE(4), - STR_VALUE(5), - BYTES_VALUE(6), - REF_VALUE(7), - VALUE_NOT_SET(0); - private final int value; - private ValueCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 2: return DOUBLE_VALUE; - case 3: return UINT64_VALUE; - case 4: return INT64_VALUE; - case 5: return STR_VALUE; - case 6: return BYTES_VALUE; - case 7: return REF_VALUE; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int METADATA_ID_FIELD_NUMBER = 1; - private long metadataId_; - /** - *
    -   * XStatMetadata.id of corresponding metadata.
    -   * 
    - * - * int64 metadata_id = 1; - */ - public long getMetadataId() { - return metadataId_; - } - - public static final int DOUBLE_VALUE_FIELD_NUMBER = 2; - /** - * double double_value = 2; - */ - public double getDoubleValue() { - if (valueCase_ == 2) { - return (java.lang.Double) value_; - } - return 0D; - } - - public static final int UINT64_VALUE_FIELD_NUMBER = 3; - /** - * uint64 uint64_value = 3; - */ - public long getUint64Value() { - if (valueCase_ == 3) { - return (java.lang.Long) value_; - } - return 0L; - } - - public static final int INT64_VALUE_FIELD_NUMBER = 4; - /** - * int64 int64_value = 4; - */ - public long getInt64Value() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - - public static final int STR_VALUE_FIELD_NUMBER = 5; - /** - * string str_value = 5; - */ - public java.lang.String getStrValue() { - java.lang.Object ref = ""; - if (valueCase_ == 5) { - ref = value_; - } - 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(); - if (valueCase_ == 5) { - value_ = s; - } - return s; - } - } - /** - * string str_value = 5; - */ - public com.google.protobuf.ByteString - getStrValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 5) { - ref = value_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 5) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BYTES_VALUE_FIELD_NUMBER = 6; - /** - * bytes bytes_value = 6; - */ - public com.google.protobuf.ByteString getBytesValue() { - if (valueCase_ == 6) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int REF_VALUE_FIELD_NUMBER = 7; - /** - *
    -   * A string value that stored in XStatMetadata::name.
    -   * 
    - * - * uint64 ref_value = 7; - */ - public long getRefValue() { - if (valueCase_ == 7) { - return (java.lang.Long) value_; - } - return 0L; - } - - 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 (metadataId_ != 0L) { - output.writeInt64(1, metadataId_); - } - if (valueCase_ == 2) { - output.writeDouble( - 2, (double)((java.lang.Double) value_)); - } - if (valueCase_ == 3) { - output.writeUInt64( - 3, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 4) { - output.writeInt64( - 4, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 5) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, value_); - } - if (valueCase_ == 6) { - output.writeBytes( - 6, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 7) { - output.writeUInt64( - 7, (long)((java.lang.Long) value_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (metadataId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, metadataId_); - } - if (valueCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize( - 2, (double)((java.lang.Double) value_)); - } - if (valueCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size( - 3, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 4, (long)((java.lang.Long) value_)); - } - if (valueCase_ == 5) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, value_); - } - if (valueCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 6, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size( - 7, (long)((java.lang.Long) value_)); - } - 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.XStat)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XStat other = (org.tensorflow.proto.profiler.XStat) obj; - - if (getMetadataId() - != other.getMetadataId()) return false; - if (!getValueCase().equals(other.getValueCase())) return false; - switch (valueCase_) { - case 2: - if (java.lang.Double.doubleToLongBits(getDoubleValue()) - != java.lang.Double.doubleToLongBits( - other.getDoubleValue())) return false; - break; - case 3: - if (getUint64Value() - != other.getUint64Value()) return false; - break; - case 4: - if (getInt64Value() - != other.getInt64Value()) return false; - break; - case 5: - if (!getStrValue() - .equals(other.getStrValue())) return false; - break; - case 6: - if (!getBytesValue() - .equals(other.getBytesValue())) return false; - break; - case 7: - if (getRefValue() - != other.getRefValue()) return false; - break; - case 0: - default: - } - 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) + METADATA_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMetadataId()); - switch (valueCase_) { - case 2: - hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getDoubleValue())); - break; - case 3: - hash = (37 * hash) + UINT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getUint64Value()); - break; - case 4: - hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getInt64Value()); - break; - case 5: - hash = (37 * hash) + STR_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStrValue().hashCode(); - break; - case 6: - hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getBytesValue().hashCode(); - break; - case 7: - hash = (37 * hash) + REF_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRefValue()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XStat parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStat parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XStat parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStat 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.XStat parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStat 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.XStat parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStat 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.XStat 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; - } - /** - *
    -   * An XStat is a named value associated with an XEvent, e.g., a performance
    -   * counter value, a metric computed by a formula applied over nested XEvents
    -   * and XStats.
    -   * Next ID: 8
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XStat} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XStat) - org.tensorflow.proto.profiler.XStatOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XStat.class, org.tensorflow.proto.profiler.XStat.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XStat.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(); - metadataId_ = 0L; - - valueCase_ = 0; - value_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStat_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStat getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XStat.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStat build() { - org.tensorflow.proto.profiler.XStat result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStat buildPartial() { - org.tensorflow.proto.profiler.XStat result = new org.tensorflow.proto.profiler.XStat(this); - result.metadataId_ = metadataId_; - if (valueCase_ == 2) { - result.value_ = value_; - } - if (valueCase_ == 3) { - result.value_ = value_; - } - if (valueCase_ == 4) { - result.value_ = value_; - } - if (valueCase_ == 5) { - result.value_ = value_; - } - if (valueCase_ == 6) { - result.value_ = value_; - } - if (valueCase_ == 7) { - result.value_ = value_; - } - result.valueCase_ = valueCase_; - 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.XStat) { - return mergeFrom((org.tensorflow.proto.profiler.XStat)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XStat other) { - if (other == org.tensorflow.proto.profiler.XStat.getDefaultInstance()) return this; - if (other.getMetadataId() != 0L) { - setMetadataId(other.getMetadataId()); - } - switch (other.getValueCase()) { - case DOUBLE_VALUE: { - setDoubleValue(other.getDoubleValue()); - break; - } - case UINT64_VALUE: { - setUint64Value(other.getUint64Value()); - break; - } - case INT64_VALUE: { - setInt64Value(other.getInt64Value()); - break; - } - case STR_VALUE: { - valueCase_ = 5; - value_ = other.value_; - onChanged(); - break; - } - case BYTES_VALUE: { - setBytesValue(other.getBytesValue()); - break; - } - case REF_VALUE: { - setRefValue(other.getRefValue()); - break; - } - case VALUE_NOT_SET: { - break; - } - } - 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.XStat parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XStat) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int valueCase_ = 0; - private java.lang.Object value_; - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - private long metadataId_ ; - /** - *
    -     * XStatMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public long getMetadataId() { - return metadataId_; - } - /** - *
    -     * XStatMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public Builder setMetadataId(long value) { - - metadataId_ = value; - onChanged(); - return this; - } - /** - *
    -     * XStatMetadata.id of corresponding metadata.
    -     * 
    - * - * int64 metadata_id = 1; - */ - public Builder clearMetadataId() { - - metadataId_ = 0L; - onChanged(); - return this; - } - - /** - * double double_value = 2; - */ - public double getDoubleValue() { - if (valueCase_ == 2) { - return (java.lang.Double) value_; - } - return 0D; - } - /** - * double double_value = 2; - */ - public Builder setDoubleValue(double value) { - valueCase_ = 2; - value_ = value; - onChanged(); - return this; - } - /** - * double double_value = 2; - */ - public Builder clearDoubleValue() { - if (valueCase_ == 2) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - * uint64 uint64_value = 3; - */ - public long getUint64Value() { - if (valueCase_ == 3) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - * uint64 uint64_value = 3; - */ - public Builder setUint64Value(long value) { - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - /** - * uint64 uint64_value = 3; - */ - public Builder clearUint64Value() { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - * int64 int64_value = 4; - */ - public long getInt64Value() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - * int64 int64_value = 4; - */ - public Builder setInt64Value(long value) { - valueCase_ = 4; - value_ = value; - onChanged(); - return this; - } - /** - * int64 int64_value = 4; - */ - public Builder clearInt64Value() { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - * string str_value = 5; - */ - public java.lang.String getStrValue() { - java.lang.Object ref = ""; - if (valueCase_ == 5) { - ref = value_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 5) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string str_value = 5; - */ - public com.google.protobuf.ByteString - getStrValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 5) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 5) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string str_value = 5; - */ - public Builder setStrValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 5; - value_ = value; - onChanged(); - return this; - } - /** - * string str_value = 5; - */ - public Builder clearStrValue() { - if (valueCase_ == 5) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - /** - * string str_value = 5; - */ - public Builder setStrValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - valueCase_ = 5; - value_ = value; - onChanged(); - return this; - } - - /** - * bytes bytes_value = 6; - */ - public com.google.protobuf.ByteString getBytesValue() { - if (valueCase_ == 6) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * bytes bytes_value = 6; - */ - public Builder setBytesValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 6; - value_ = value; - onChanged(); - return this; - } - /** - * bytes bytes_value = 6; - */ - public Builder clearBytesValue() { - if (valueCase_ == 6) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * A string value that stored in XStatMetadata::name.
    -     * 
    - * - * uint64 ref_value = 7; - */ - public long getRefValue() { - if (valueCase_ == 7) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - *
    -     * A string value that stored in XStatMetadata::name.
    -     * 
    - * - * uint64 ref_value = 7; - */ - public Builder setRefValue(long value) { - valueCase_ = 7; - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * A string value that stored in XStatMetadata::name.
    -     * 
    - * - * uint64 ref_value = 7; - */ - public Builder clearRefValue() { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - 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.XStat) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XStat) - private static final org.tensorflow.proto.profiler.XStat DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XStat(); - } - - public static org.tensorflow.proto.profiler.XStat getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XStat parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XStat(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.XStat getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 007fbb4aa12..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadata.java +++ /dev/null @@ -1,822 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -/** - *
    - * Metadata for an XStat, corresponds to a stat type and is shared by all
    - * XStats with the same metadata_id.
    - * Next ID: 4
    - * 
    - * - * Protobuf type {@code tensorflow.profiler.XStatMetadata} - */ -public final class XStatMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.profiler.XStatMetadata) - XStatMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use XStatMetadata.newBuilder() to construct. - private XStatMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private XStatMetadata() { - name_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new XStatMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private XStatMetadata( - 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: { - - id_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - 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.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStatMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XStatMetadata.class, org.tensorflow.proto.profiler.XStatMetadata.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - /** - *
    -   * XPlane.stat_metadata map key.
    -   * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - *
    -   * Name of the stat (should be short).
    -   * Two XStatMetadata with different id should have different names.
    -   * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -   * Name of the stat (should be short).
    -   * Two XStatMetadata with different id should have different names.
    -   * 
    - * - * string name = 2; - */ - 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 DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - *
    -   * Description of the stat (might be long).
    -   * 
    - * - * string description = 3; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - 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(); - description_ = s; - return s; - } - } - /** - *
    -   * Description of the stat (might be long).
    -   * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (id_ != 0L) { - output.writeInt64(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - 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.XStatMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.profiler.XStatMetadata other = (org.tensorflow.proto.profiler.XStatMetadata) obj; - - if (getId() - != other.getId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getDescription() - .equals(other.getDescription())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.profiler.XStatMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStatMetadata 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.XStatMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStatMetadata 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.XStatMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.profiler.XStatMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.profiler.XStatMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStatMetadata 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.XStatMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStatMetadata 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.XStatMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.profiler.XStatMetadata 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.XStatMetadata 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; - } - /** - *
    -   * Metadata for an XStat, corresponds to a stat type and is shared by all
    -   * XStats with the same metadata_id.
    -   * Next ID: 4
    -   * 
    - * - * Protobuf type {@code tensorflow.profiler.XStatMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XStatMetadata) - org.tensorflow.proto.profiler.XStatMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStatMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.profiler.XStatMetadata.class, org.tensorflow.proto.profiler.XStatMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.profiler.XStatMetadata.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(); - id_ = 0L; - - name_ = ""; - - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.profiler.XPlaneProtos.internal_static_tensorflow_profiler_XStatMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStatMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.profiler.XStatMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStatMetadata build() { - org.tensorflow.proto.profiler.XStatMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.profiler.XStatMetadata buildPartial() { - org.tensorflow.proto.profiler.XStatMetadata result = new org.tensorflow.proto.profiler.XStatMetadata(this); - result.id_ = id_; - result.name_ = name_; - result.description_ = description_; - 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.XStatMetadata) { - return mergeFrom((org.tensorflow.proto.profiler.XStatMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.profiler.XStatMetadata other) { - if (other == org.tensorflow.proto.profiler.XStatMetadata.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - 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.XStatMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.profiler.XStatMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long id_ ; - /** - *
    -     * XPlane.stat_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public long getId() { - return id_; - } - /** - *
    -     * XPlane.stat_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - /** - *
    -     * XPlane.stat_metadata map key.
    -     * 
    - * - * int64 id = 1; - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of the stat (should be short).
    -     * Two XStatMetadata with different id should have different names.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of the stat (should be short).
    -     * Two XStatMetadata with different id should have different names.
    -     * 
    - * - * string name = 2; - */ - 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; - } - } - /** - *
    -     * Name of the stat (should be short).
    -     * Two XStatMetadata with different id should have different names.
    -     * 
    - * - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the stat (should be short).
    -     * Two XStatMetadata with different id should have different names.
    -     * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the stat (should be short).
    -     * Two XStatMetadata with different id should have different names.
    -     * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
    -     * Description of the stat (might be long).
    -     * 
    - * - * string description = 3; - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Description of the stat (might be long).
    -     * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Description of the stat (might be long).
    -     * 
    - * - * string description = 3; - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
    -     * Description of the stat (might be long).
    -     * 
    - * - * string description = 3; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
    -     * Description of the stat (might be long).
    -     * 
    - * - * string description = 3; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - 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.XStatMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.profiler.XStatMetadata) - private static final org.tensorflow.proto.profiler.XStatMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.XStatMetadata(); - } - - public static org.tensorflow.proto.profiler.XStatMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public XStatMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new XStatMetadata(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.XStatMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 26b174f6b3f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatMetadataOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XStatMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XStatMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * XPlane.stat_metadata map key.
    -   * 
    - * - * int64 id = 1; - */ - long getId(); - - /** - *
    -   * Name of the stat (should be short).
    -   * Two XStatMetadata with different id should have different names.
    -   * 
    - * - * string name = 2; - */ - java.lang.String getName(); - /** - *
    -   * Name of the stat (should be short).
    -   * Two XStatMetadata with different id should have different names.
    -   * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Description of the stat (might be long).
    -   * 
    - * - * string description = 3; - */ - java.lang.String getDescription(); - /** - *
    -   * Description of the stat (might be long).
    -   * 
    - * - * string description = 3; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatOrBuilder.java deleted file mode 100644 index ddbd0ef1584..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/profiler/XStatOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/profiler/protobuf/xplane.proto - -package org.tensorflow.proto.profiler; - -public interface XStatOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XStat) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * XStatMetadata.id of corresponding metadata.
    -   * 
    - * - * int64 metadata_id = 1; - */ - long getMetadataId(); - - /** - * double double_value = 2; - */ - double getDoubleValue(); - - /** - * uint64 uint64_value = 3; - */ - long getUint64Value(); - - /** - * int64 int64_value = 4; - */ - long getInt64Value(); - - /** - * string str_value = 5; - */ - java.lang.String getStrValue(); - /** - * string str_value = 5; - */ - com.google.protobuf.ByteString - getStrValueBytes(); - - /** - * bytes bytes_value = 6; - */ - com.google.protobuf.ByteString getBytesValue(); - - /** - *
    -   * A string value that stored in XStatMetadata::name.
    -   * 
    - * - * uint64 ref_value = 7; - */ - long getRefValue(); - - public org.tensorflow.proto.profiler.XStat.ValueCase getValueCase(); -} 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 deleted file mode 100644 index d92aacf04eb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BfcMemoryMapProtos.java +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public final class BfcMemoryMapProtos { - private BfcMemoryMapProtos() {} - 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_MemAllocatorStats_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MemChunk_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemChunk_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BinSummary_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BinSummary_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SnapShot_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SnapShot_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MemoryDump_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemoryDump_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/bfc_memory_ma" + - "p.proto\022\ntensorflow\"\222\001\n\021MemAllocatorStat" + - "s\022\022\n\nnum_allocs\030\001 \001(\003\022\024\n\014bytes_in_use\030\002 " + - "\001(\003\022\031\n\021peak_bytes_in_use\030\003 \001(\003\022\032\n\022larges" + - "t_alloc_size\030\004 \001(\003\022\034\n\024fragmentation_metr" + - "ic\030\005 \001(\002\"\256\001\n\010MemChunk\022\017\n\007address\030\001 \001(\004\022\014" + - "\n\004size\030\002 \001(\003\022\026\n\016requested_size\030\003 \001(\003\022\013\n\003" + - "bin\030\004 \001(\005\022\017\n\007op_name\030\005 \001(\t\022\026\n\016freed_at_c" + - "ount\030\006 \001(\004\022\024\n\014action_count\030\007 \001(\004\022\016\n\006in_u" + - "se\030\010 \001(\010\022\017\n\007step_id\030\t \001(\004\"\213\001\n\nBinSummary" + - "\022\013\n\003bin\030\001 \001(\005\022\032\n\022total_bytes_in_use\030\002 \001(" + - "\003\022\032\n\022total_bytes_in_bin\030\003 \001(\003\022\033\n\023total_c" + - "hunks_in_use\030\004 \001(\003\022\033\n\023total_chunks_in_bi" + - "n\030\005 \001(\003\".\n\010SnapShot\022\024\n\014action_count\030\001 \001(" + - "\004\022\014\n\004size\030\002 \001(\003\"\315\001\n\nMemoryDump\022\026\n\016alloca" + - "tor_name\030\001 \001(\t\022+\n\013bin_summary\030\002 \003(\0132\026.te" + - "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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_MemAllocatorStats_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemAllocatorStats_descriptor, - new java.lang.String[] { "NumAllocs", "BytesInUse", "PeakBytesInUse", "LargestAllocSize", "FragmentationMetric", }); - internal_static_tensorflow_MemChunk_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_MemChunk_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemChunk_descriptor, - new java.lang.String[] { "Address", "Size", "RequestedSize", "Bin", "OpName", "FreedAtCount", "ActionCount", "InUse", "StepId", }); - internal_static_tensorflow_BinSummary_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_BinSummary_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BinSummary_descriptor, - new java.lang.String[] { "Bin", "TotalBytesInUse", "TotalBytesInBin", "TotalChunksInUse", "TotalChunksInBin", }); - internal_static_tensorflow_SnapShot_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_SnapShot_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SnapShot_descriptor, - new java.lang.String[] { "ActionCount", "Size", }); - internal_static_tensorflow_MemoryDump_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_MemoryDump_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemoryDump_descriptor, - new java.lang.String[] { "AllocatorName", "BinSummary", "Chunk", "SnapShot", "Stats", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummary.java deleted file mode 100644 index 66f221b62f0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummary.java +++ /dev/null @@ -1,708 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.BinSummary} - */ -public final class BinSummary extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BinSummary) - BinSummaryOrBuilder { -private static final long serialVersionUID = 0L; - // Use BinSummary.newBuilder() to construct. - private BinSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BinSummary() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BinSummary(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BinSummary( - 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: { - - bin_ = input.readInt32(); - break; - } - case 16: { - - totalBytesInUse_ = input.readInt64(); - break; - } - case 24: { - - totalBytesInBin_ = input.readInt64(); - break; - } - case 32: { - - totalChunksInUse_ = input.readInt64(); - break; - } - case 40: { - - totalChunksInBin_ = 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.util.BfcMemoryMapProtos.internal_static_tensorflow_BinSummary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_BinSummary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BinSummary.class, org.tensorflow.proto.util.BinSummary.Builder.class); - } - - public static final int BIN_FIELD_NUMBER = 1; - private int bin_; - /** - * int32 bin = 1; - */ - public int getBin() { - return bin_; - } - - public static final int TOTAL_BYTES_IN_USE_FIELD_NUMBER = 2; - private long totalBytesInUse_; - /** - * int64 total_bytes_in_use = 2; - */ - public long getTotalBytesInUse() { - return totalBytesInUse_; - } - - public static final int TOTAL_BYTES_IN_BIN_FIELD_NUMBER = 3; - private long totalBytesInBin_; - /** - * int64 total_bytes_in_bin = 3; - */ - public long getTotalBytesInBin() { - return totalBytesInBin_; - } - - public static final int TOTAL_CHUNKS_IN_USE_FIELD_NUMBER = 4; - private long totalChunksInUse_; - /** - * int64 total_chunks_in_use = 4; - */ - public long getTotalChunksInUse() { - return totalChunksInUse_; - } - - public static final int TOTAL_CHUNKS_IN_BIN_FIELD_NUMBER = 5; - private long totalChunksInBin_; - /** - * int64 total_chunks_in_bin = 5; - */ - public long getTotalChunksInBin() { - return totalChunksInBin_; - } - - 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 (bin_ != 0) { - output.writeInt32(1, bin_); - } - if (totalBytesInUse_ != 0L) { - output.writeInt64(2, totalBytesInUse_); - } - if (totalBytesInBin_ != 0L) { - output.writeInt64(3, totalBytesInBin_); - } - if (totalChunksInUse_ != 0L) { - output.writeInt64(4, totalChunksInUse_); - } - if (totalChunksInBin_ != 0L) { - output.writeInt64(5, totalChunksInBin_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (bin_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, bin_); - } - if (totalBytesInUse_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, totalBytesInUse_); - } - if (totalBytesInBin_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, totalBytesInBin_); - } - if (totalChunksInUse_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, totalChunksInUse_); - } - if (totalChunksInBin_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, totalChunksInBin_); - } - 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.util.BinSummary)) { - return super.equals(obj); - } - org.tensorflow.proto.util.BinSummary other = (org.tensorflow.proto.util.BinSummary) obj; - - if (getBin() - != other.getBin()) return false; - if (getTotalBytesInUse() - != other.getTotalBytesInUse()) return false; - if (getTotalBytesInBin() - != other.getTotalBytesInBin()) return false; - if (getTotalChunksInUse() - != other.getTotalChunksInUse()) return false; - if (getTotalChunksInBin() - != other.getTotalChunksInBin()) 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) + BIN_FIELD_NUMBER; - hash = (53 * hash) + getBin(); - hash = (37 * hash) + TOTAL_BYTES_IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalBytesInUse()); - hash = (37 * hash) + TOTAL_BYTES_IN_BIN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalBytesInBin()); - hash = (37 * hash) + TOTAL_CHUNKS_IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalChunksInUse()); - hash = (37 * hash) + TOTAL_CHUNKS_IN_BIN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotalChunksInBin()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.BinSummary parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BinSummary 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.BinSummary parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BinSummary 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.BinSummary parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BinSummary parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.BinSummary parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BinSummary 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.BinSummary parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BinSummary 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.BinSummary parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BinSummary 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.util.BinSummary 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.BinSummary} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BinSummary) - org.tensorflow.proto.util.BinSummaryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_BinSummary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_BinSummary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BinSummary.class, org.tensorflow.proto.util.BinSummary.Builder.class); - } - - // Construct using org.tensorflow.proto.util.BinSummary.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(); - bin_ = 0; - - totalBytesInUse_ = 0L; - - totalBytesInBin_ = 0L; - - totalChunksInUse_ = 0L; - - totalChunksInBin_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_BinSummary_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.BinSummary getDefaultInstanceForType() { - return org.tensorflow.proto.util.BinSummary.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.BinSummary build() { - org.tensorflow.proto.util.BinSummary result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.BinSummary buildPartial() { - org.tensorflow.proto.util.BinSummary result = new org.tensorflow.proto.util.BinSummary(this); - result.bin_ = bin_; - result.totalBytesInUse_ = totalBytesInUse_; - result.totalBytesInBin_ = totalBytesInBin_; - result.totalChunksInUse_ = totalChunksInUse_; - result.totalChunksInBin_ = totalChunksInBin_; - 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.util.BinSummary) { - return mergeFrom((org.tensorflow.proto.util.BinSummary)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.BinSummary other) { - if (other == org.tensorflow.proto.util.BinSummary.getDefaultInstance()) return this; - if (other.getBin() != 0) { - setBin(other.getBin()); - } - if (other.getTotalBytesInUse() != 0L) { - setTotalBytesInUse(other.getTotalBytesInUse()); - } - if (other.getTotalBytesInBin() != 0L) { - setTotalBytesInBin(other.getTotalBytesInBin()); - } - if (other.getTotalChunksInUse() != 0L) { - setTotalChunksInUse(other.getTotalChunksInUse()); - } - if (other.getTotalChunksInBin() != 0L) { - setTotalChunksInBin(other.getTotalChunksInBin()); - } - 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.util.BinSummary parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.BinSummary) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bin_ ; - /** - * int32 bin = 1; - */ - public int getBin() { - return bin_; - } - /** - * int32 bin = 1; - */ - public Builder setBin(int value) { - - bin_ = value; - onChanged(); - return this; - } - /** - * int32 bin = 1; - */ - public Builder clearBin() { - - bin_ = 0; - onChanged(); - return this; - } - - private long totalBytesInUse_ ; - /** - * int64 total_bytes_in_use = 2; - */ - public long getTotalBytesInUse() { - return totalBytesInUse_; - } - /** - * int64 total_bytes_in_use = 2; - */ - public Builder setTotalBytesInUse(long value) { - - totalBytesInUse_ = value; - onChanged(); - return this; - } - /** - * int64 total_bytes_in_use = 2; - */ - public Builder clearTotalBytesInUse() { - - totalBytesInUse_ = 0L; - onChanged(); - return this; - } - - private long totalBytesInBin_ ; - /** - * int64 total_bytes_in_bin = 3; - */ - public long getTotalBytesInBin() { - return totalBytesInBin_; - } - /** - * int64 total_bytes_in_bin = 3; - */ - public Builder setTotalBytesInBin(long value) { - - totalBytesInBin_ = value; - onChanged(); - return this; - } - /** - * int64 total_bytes_in_bin = 3; - */ - public Builder clearTotalBytesInBin() { - - totalBytesInBin_ = 0L; - onChanged(); - return this; - } - - private long totalChunksInUse_ ; - /** - * int64 total_chunks_in_use = 4; - */ - public long getTotalChunksInUse() { - return totalChunksInUse_; - } - /** - * int64 total_chunks_in_use = 4; - */ - public Builder setTotalChunksInUse(long value) { - - totalChunksInUse_ = value; - onChanged(); - return this; - } - /** - * int64 total_chunks_in_use = 4; - */ - public Builder clearTotalChunksInUse() { - - totalChunksInUse_ = 0L; - onChanged(); - return this; - } - - private long totalChunksInBin_ ; - /** - * int64 total_chunks_in_bin = 5; - */ - public long getTotalChunksInBin() { - return totalChunksInBin_; - } - /** - * int64 total_chunks_in_bin = 5; - */ - public Builder setTotalChunksInBin(long value) { - - totalChunksInBin_ = value; - onChanged(); - return this; - } - /** - * int64 total_chunks_in_bin = 5; - */ - public Builder clearTotalChunksInBin() { - - totalChunksInBin_ = 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.BinSummary) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BinSummary) - private static final org.tensorflow.proto.util.BinSummary DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.BinSummary(); - } - - public static org.tensorflow.proto.util.BinSummary getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BinSummary parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BinSummary(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.util.BinSummary getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummaryOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummaryOrBuilder.java deleted file mode 100644 index 077107aa85f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BinSummaryOrBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public interface BinSummaryOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BinSummary) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 bin = 1; - */ - int getBin(); - - /** - * int64 total_bytes_in_use = 2; - */ - long getTotalBytesInUse(); - - /** - * int64 total_bytes_in_bin = 3; - */ - long getTotalBytesInBin(); - - /** - * int64 total_chunks_in_use = 4; - */ - long getTotalChunksInUse(); - - /** - * int64 total_chunks_in_bin = 5; - */ - long getTotalChunksInBin(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProto.java deleted file mode 100644 index a74911cdde6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProto.java +++ /dev/null @@ -1,1540 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensor_bundle.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Describes the metadata related to a checkpointed tensor.
    - * 
    - * - * Protobuf type {@code tensorflow.BundleEntryProto} - */ -public final class BundleEntryProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BundleEntryProto) - BundleEntryProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use BundleEntryProto.newBuilder() to construct. - private BundleEntryProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BundleEntryProto() { - dtype_ = 0; - slices_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BundleEntryProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BundleEntryProto( - 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - shardId_ = input.readInt32(); - break; - } - case 32: { - - offset_ = input.readInt64(); - break; - } - case 40: { - - size_ = input.readInt64(); - break; - } - case 53: { - - crc32C_ = input.readFixed32(); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - slices_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - slices_.add( - input.readMessage(org.tensorflow.proto.framework.TensorSliceProto.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_ & 0x00000001) != 0)) { - slices_ = java.util.Collections.unmodifiableList(slices_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BundleEntryProto.class, org.tensorflow.proto.util.BundleEntryProto.Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - /** - *
    -   * The tensor dtype and shape.
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -   * The tensor dtype and shape.
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int SHARD_ID_FIELD_NUMBER = 3; - private int shardId_; - /** - *
    -   * The binary content of the tensor lies in:
    -   *   File "shard_id": bytes [offset, offset + size).
    -   * 
    - * - * int32 shard_id = 3; - */ - public int getShardId() { - return shardId_; - } - - public static final int OFFSET_FIELD_NUMBER = 4; - private long offset_; - /** - * int64 offset = 4; - */ - public long getOffset() { - return offset_; - } - - public static final int SIZE_FIELD_NUMBER = 5; - private long size_; - /** - * int64 size = 5; - */ - public long getSize() { - return size_; - } - - public static final int CRC32C_FIELD_NUMBER = 6; - private int crc32C_; - /** - *
    -   * The CRC32C checksum of the tensor bytes.
    -   * 
    - * - * fixed32 crc32c = 6; - */ - public int getCrc32C() { - return crc32C_; - } - - public static final int SLICES_FIELD_NUMBER = 7; - private java.util.List slices_; - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public java.util.List getSlicesList() { - return slices_; - } - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public java.util.List - getSlicesOrBuilderList() { - return slices_; - } - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public int getSlicesCount() { - return slices_.size(); - } - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlices(int index) { - return slices_.get(index); - } - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSlicesOrBuilder( - int index) { - return slices_.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 { - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (shardId_ != 0) { - output.writeInt32(3, shardId_); - } - if (offset_ != 0L) { - output.writeInt64(4, offset_); - } - if (size_ != 0L) { - output.writeInt64(5, size_); - } - if (crc32C_ != 0) { - output.writeFixed32(6, crc32C_); - } - for (int i = 0; i < slices_.size(); i++) { - output.writeMessage(7, slices_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (shardId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, shardId_); - } - if (offset_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, offset_); - } - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, size_); - } - if (crc32C_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFixed32Size(6, crc32C_); - } - for (int i = 0; i < slices_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, slices_.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.util.BundleEntryProto)) { - return super.equals(obj); - } - org.tensorflow.proto.util.BundleEntryProto other = (org.tensorflow.proto.util.BundleEntryProto) obj; - - if (dtype_ != other.dtype_) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (getShardId() - != other.getShardId()) return false; - if (getOffset() - != other.getOffset()) return false; - if (getSize() - != other.getSize()) return false; - if (getCrc32C() - != other.getCrc32C()) return false; - if (!getSlicesList() - .equals(other.getSlicesList())) 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) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + SHARD_ID_FIELD_NUMBER; - hash = (53 * hash) + getShardId(); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffset()); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (37 * hash) + CRC32C_FIELD_NUMBER; - hash = (53 * hash) + getCrc32C(); - if (getSlicesCount() > 0) { - hash = (37 * hash) + SLICES_FIELD_NUMBER; - hash = (53 * hash) + getSlicesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.BundleEntryProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleEntryProto 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.BundleEntryProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleEntryProto 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.BundleEntryProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleEntryProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.BundleEntryProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleEntryProto 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.BundleEntryProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleEntryProto 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.BundleEntryProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleEntryProto 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.util.BundleEntryProto 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; - } - /** - *
    -   * Describes the metadata related to a checkpointed tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.BundleEntryProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BundleEntryProto) - org.tensorflow.proto.util.BundleEntryProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BundleEntryProto.class, org.tensorflow.proto.util.BundleEntryProto.Builder.class); - } - - // Construct using org.tensorflow.proto.util.BundleEntryProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSlicesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - shardId_ = 0; - - offset_ = 0L; - - size_ = 0L; - - crc32C_ = 0; - - if (slicesBuilder_ == null) { - slices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - slicesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleEntryProto getDefaultInstanceForType() { - return org.tensorflow.proto.util.BundleEntryProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleEntryProto build() { - org.tensorflow.proto.util.BundleEntryProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleEntryProto buildPartial() { - org.tensorflow.proto.util.BundleEntryProto result = new org.tensorflow.proto.util.BundleEntryProto(this); - int from_bitField0_ = bitField0_; - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.shardId_ = shardId_; - result.offset_ = offset_; - result.size_ = size_; - result.crc32C_ = crc32C_; - if (slicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - slices_ = java.util.Collections.unmodifiableList(slices_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.slices_ = slices_; - } else { - result.slices_ = slicesBuilder_.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.util.BundleEntryProto) { - return mergeFrom((org.tensorflow.proto.util.BundleEntryProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.BundleEntryProto other) { - if (other == org.tensorflow.proto.util.BundleEntryProto.getDefaultInstance()) return this; - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.getShardId() != 0) { - setShardId(other.getShardId()); - } - if (other.getOffset() != 0L) { - setOffset(other.getOffset()); - } - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (other.getCrc32C() != 0) { - setCrc32C(other.getCrc32C()); - } - if (slicesBuilder_ == null) { - if (!other.slices_.isEmpty()) { - if (slices_.isEmpty()) { - slices_ = other.slices_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSlicesIsMutable(); - slices_.addAll(other.slices_); - } - onChanged(); - } - } else { - if (!other.slices_.isEmpty()) { - if (slicesBuilder_.isEmpty()) { - slicesBuilder_.dispose(); - slicesBuilder_ = null; - slices_ = other.slices_; - bitField0_ = (bitField0_ & ~0x00000001); - slicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSlicesFieldBuilder() : null; - } else { - slicesBuilder_.addAllMessages(other.slices_); - } - } - } - 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.util.BundleEntryProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.BundleEntryProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int dtype_ = 0; - /** - *
    -     * The tensor dtype and shape.
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - *
    -     * The tensor dtype and shape.
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - /** - *
    -     * The tensor dtype and shape.
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public org.tensorflow.proto.framework.DataType getDtype() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(dtype_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - *
    -     * The tensor dtype and shape.
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * The tensor dtype and shape.
    -     * 
    - * - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private int shardId_ ; - /** - *
    -     * The binary content of the tensor lies in:
    -     *   File "shard_id": bytes [offset, offset + size).
    -     * 
    - * - * int32 shard_id = 3; - */ - public int getShardId() { - return shardId_; - } - /** - *
    -     * The binary content of the tensor lies in:
    -     *   File "shard_id": bytes [offset, offset + size).
    -     * 
    - * - * int32 shard_id = 3; - */ - public Builder setShardId(int value) { - - shardId_ = value; - onChanged(); - return this; - } - /** - *
    -     * The binary content of the tensor lies in:
    -     *   File "shard_id": bytes [offset, offset + size).
    -     * 
    - * - * int32 shard_id = 3; - */ - public Builder clearShardId() { - - shardId_ = 0; - onChanged(); - return this; - } - - private long offset_ ; - /** - * int64 offset = 4; - */ - public long getOffset() { - return offset_; - } - /** - * int64 offset = 4; - */ - public Builder setOffset(long value) { - - offset_ = value; - onChanged(); - return this; - } - /** - * int64 offset = 4; - */ - public Builder clearOffset() { - - offset_ = 0L; - onChanged(); - return this; - } - - private long size_ ; - /** - * int64 size = 5; - */ - public long getSize() { - return size_; - } - /** - * int64 size = 5; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - * int64 size = 5; - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private int crc32C_ ; - /** - *
    -     * The CRC32C checksum of the tensor bytes.
    -     * 
    - * - * fixed32 crc32c = 6; - */ - public int getCrc32C() { - return crc32C_; - } - /** - *
    -     * The CRC32C checksum of the tensor bytes.
    -     * 
    - * - * fixed32 crc32c = 6; - */ - public Builder setCrc32C(int value) { - - crc32C_ = value; - onChanged(); - return this; - } - /** - *
    -     * The CRC32C checksum of the tensor bytes.
    -     * 
    - * - * fixed32 crc32c = 6; - */ - public Builder clearCrc32C() { - - crc32C_ = 0; - onChanged(); - return this; - } - - private java.util.List slices_ = - java.util.Collections.emptyList(); - private void ensureSlicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - slices_ = new java.util.ArrayList(slices_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> slicesBuilder_; - - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public java.util.List getSlicesList() { - if (slicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(slices_); - } else { - return slicesBuilder_.getMessageList(); - } - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public int getSlicesCount() { - if (slicesBuilder_ == null) { - return slices_.size(); - } else { - return slicesBuilder_.getCount(); - } - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlices(int index) { - if (slicesBuilder_ == null) { - return slices_.get(index); - } else { - return slicesBuilder_.getMessage(index); - } - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder setSlices( - int index, org.tensorflow.proto.framework.TensorSliceProto value) { - if (slicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlicesIsMutable(); - slices_.set(index, value); - onChanged(); - } else { - slicesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder setSlices( - int index, org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (slicesBuilder_ == null) { - ensureSlicesIsMutable(); - slices_.set(index, builderForValue.build()); - onChanged(); - } else { - slicesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder addSlices(org.tensorflow.proto.framework.TensorSliceProto value) { - if (slicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlicesIsMutable(); - slices_.add(value); - onChanged(); - } else { - slicesBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder addSlices( - int index, org.tensorflow.proto.framework.TensorSliceProto value) { - if (slicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSlicesIsMutable(); - slices_.add(index, value); - onChanged(); - } else { - slicesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder addSlices( - org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (slicesBuilder_ == null) { - ensureSlicesIsMutable(); - slices_.add(builderForValue.build()); - onChanged(); - } else { - slicesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder addSlices( - int index, org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (slicesBuilder_ == null) { - ensureSlicesIsMutable(); - slices_.add(index, builderForValue.build()); - onChanged(); - } else { - slicesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder addAllSlices( - java.lang.Iterable values) { - if (slicesBuilder_ == null) { - ensureSlicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, slices_); - onChanged(); - } else { - slicesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder clearSlices() { - if (slicesBuilder_ == null) { - slices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - slicesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public Builder removeSlices(int index) { - if (slicesBuilder_ == null) { - ensureSlicesIsMutable(); - slices_.remove(index); - onChanged(); - } else { - slicesBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder getSlicesBuilder( - int index) { - return getSlicesFieldBuilder().getBuilder(index); - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSlicesOrBuilder( - int index) { - if (slicesBuilder_ == null) { - return slices_.get(index); } else { - return slicesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public java.util.List - getSlicesOrBuilderList() { - if (slicesBuilder_ != null) { - return slicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(slices_); - } - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder addSlicesBuilder() { - return getSlicesFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance()); - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder addSlicesBuilder( - int index) { - return getSlicesFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance()); - } - /** - *
    -     * Iff present, this entry represents a partitioned tensor.  The previous
    -     * fields are interpreted as follows:
    -     *   "dtype", "shape": describe the full tensor.
    -     *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -     *      These information for each slice can be looked up in their own
    -     *      BundleEntryProto, keyed by each "slice_name".
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - public java.util.List - getSlicesBuilderList() { - return getSlicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> - getSlicesFieldBuilder() { - if (slicesBuilder_ == null) { - slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder>( - slices_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - slices_ = null; - } - return slicesBuilder_; - } - @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.BundleEntryProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BundleEntryProto) - private static final org.tensorflow.proto.util.BundleEntryProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.BundleEntryProto(); - } - - public static org.tensorflow.proto.util.BundleEntryProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BundleEntryProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BundleEntryProto(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.util.BundleEntryProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProtoOrBuilder.java deleted file mode 100644 index a95ca5d54e6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleEntryProtoOrBuilder.java +++ /dev/null @@ -1,137 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensor_bundle.proto - -package org.tensorflow.proto.util; - -public interface BundleEntryProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BundleEntryProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The tensor dtype and shape.
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - /** - *
    -   * The tensor dtype and shape.
    -   * 
    - * - * .tensorflow.DataType dtype = 1; - */ - org.tensorflow.proto.framework.DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - *
    -   * The binary content of the tensor lies in:
    -   *   File "shard_id": bytes [offset, offset + size).
    -   * 
    - * - * int32 shard_id = 3; - */ - int getShardId(); - - /** - * int64 offset = 4; - */ - long getOffset(); - - /** - * int64 size = 5; - */ - long getSize(); - - /** - *
    -   * The CRC32C checksum of the tensor bytes.
    -   * 
    - * - * fixed32 crc32c = 6; - */ - int getCrc32C(); - - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - java.util.List - getSlicesList(); - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - org.tensorflow.proto.framework.TensorSliceProto getSlices(int index); - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - int getSlicesCount(); - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - java.util.List - getSlicesOrBuilderList(); - /** - *
    -   * Iff present, this entry represents a partitioned tensor.  The previous
    -   * fields are interpreted as follows:
    -   *   "dtype", "shape": describe the full tensor.
    -   *   "shard_id", "offset", "size", "crc32c": all IGNORED.
    -   *      These information for each slice can be looked up in their own
    -   *      BundleEntryProto, keyed by each "slice_name".
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slices = 7; - */ - org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSlicesOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProto.java deleted file mode 100644 index 1a30188c8a5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProto.java +++ /dev/null @@ -1,929 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensor_bundle.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Special header that is associated with a bundle.
    - * TODO(zongheng,zhifengc): maybe in the future, we can add information about
    - * which binary produced this checkpoint, timestamp, etc. Sometime, these can be
    - * valuable debugging information. And if needed, these can be used as defensive
    - * information ensuring reader (binary version) of the checkpoint and the writer
    - * (binary version) must match within certain range, etc.
    - * 
    - * - * Protobuf type {@code tensorflow.BundleHeaderProto} - */ -public final class BundleHeaderProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BundleHeaderProto) - BundleHeaderProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use BundleHeaderProto.newBuilder() to construct. - private BundleHeaderProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BundleHeaderProto() { - endianness_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BundleHeaderProto(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BundleHeaderProto( - 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: { - - numShards_ = input.readInt32(); - break; - } - case 16: { - int rawValue = input.readEnum(); - - endianness_ = rawValue; - break; - } - case 26: { - org.tensorflow.proto.framework.VersionDef.Builder subBuilder = null; - if (version_ != null) { - subBuilder = version_.toBuilder(); - } - version_ = input.readMessage(org.tensorflow.proto.framework.VersionDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(version_); - version_ = subBuilder.buildPartial(); - } - - 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.util.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BundleHeaderProto.class, org.tensorflow.proto.util.BundleHeaderProto.Builder.class); - } - - /** - *
    -   * An enum indicating the endianness of the platform that produced this
    -   * bundle.  A bundle can only be read by a platform with matching endianness.
    -   * Defaults to LITTLE, as most modern platforms are little-endian.
    -   * Affects the binary tensor data bytes only, not the metadata in protobufs.
    -   * 
    - * - * Protobuf enum {@code tensorflow.BundleHeaderProto.Endianness} - */ - public enum Endianness - implements com.google.protobuf.ProtocolMessageEnum { - /** - * LITTLE = 0; - */ - LITTLE(0), - /** - * BIG = 1; - */ - BIG(1), - UNRECOGNIZED(-1), - ; - - /** - * LITTLE = 0; - */ - public static final int LITTLE_VALUE = 0; - /** - * BIG = 1; - */ - public static final int BIG_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 Endianness valueOf(int value) { - return forNumber(value); - } - - public static Endianness forNumber(int value) { - switch (value) { - case 0: return LITTLE; - case 1: return BIG; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Endianness> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Endianness findValueByNumber(int number) { - return Endianness.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.util.BundleHeaderProto.getDescriptor().getEnumTypes().get(0); - } - - private static final Endianness[] VALUES = values(); - - public static Endianness 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 Endianness(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.BundleHeaderProto.Endianness) - } - - public static final int NUM_SHARDS_FIELD_NUMBER = 1; - private int numShards_; - /** - *
    -   * Number of data files in the bundle.
    -   * 
    - * - * int32 num_shards = 1; - */ - public int getNumShards() { - return numShards_; - } - - public static final int ENDIANNESS_FIELD_NUMBER = 2; - private int endianness_; - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public int getEndiannessValue() { - return endianness_; - } - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public org.tensorflow.proto.util.BundleHeaderProto.Endianness getEndianness() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.BundleHeaderProto.Endianness result = org.tensorflow.proto.util.BundleHeaderProto.Endianness.valueOf(endianness_); - return result == null ? org.tensorflow.proto.util.BundleHeaderProto.Endianness.UNRECOGNIZED : result; - } - - public static final int VERSION_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.VersionDef version_; - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public boolean hasVersion() { - return version_ != null; - } - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public org.tensorflow.proto.framework.VersionDef getVersion() { - return version_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder() { - return getVersion(); - } - - 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 (numShards_ != 0) { - output.writeInt32(1, numShards_); - } - if (endianness_ != org.tensorflow.proto.util.BundleHeaderProto.Endianness.LITTLE.getNumber()) { - output.writeEnum(2, endianness_); - } - if (version_ != null) { - output.writeMessage(3, getVersion()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (numShards_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, numShards_); - } - if (endianness_ != org.tensorflow.proto.util.BundleHeaderProto.Endianness.LITTLE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, endianness_); - } - if (version_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getVersion()); - } - 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.util.BundleHeaderProto)) { - return super.equals(obj); - } - org.tensorflow.proto.util.BundleHeaderProto other = (org.tensorflow.proto.util.BundleHeaderProto) obj; - - if (getNumShards() - != other.getNumShards()) return false; - if (endianness_ != other.endianness_) return false; - if (hasVersion() != other.hasVersion()) return false; - if (hasVersion()) { - if (!getVersion() - .equals(other.getVersion())) 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) + NUM_SHARDS_FIELD_NUMBER; - hash = (53 * hash) + getNumShards(); - hash = (37 * hash) + ENDIANNESS_FIELD_NUMBER; - hash = (53 * hash) + endianness_; - if (hasVersion()) { - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.BundleHeaderProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleHeaderProto 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.BundleHeaderProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleHeaderProto 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.BundleHeaderProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.BundleHeaderProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.BundleHeaderProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleHeaderProto 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.BundleHeaderProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleHeaderProto 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.BundleHeaderProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.BundleHeaderProto 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.util.BundleHeaderProto 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; - } - /** - *
    -   * Special header that is associated with a bundle.
    -   * TODO(zongheng,zhifengc): maybe in the future, we can add information about
    -   * which binary produced this checkpoint, timestamp, etc. Sometime, these can be
    -   * valuable debugging information. And if needed, these can be used as defensive
    -   * information ensuring reader (binary version) of the checkpoint and the writer
    -   * (binary version) must match within certain range, etc.
    -   * 
    - * - * Protobuf type {@code tensorflow.BundleHeaderProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BundleHeaderProto) - org.tensorflow.proto.util.BundleHeaderProtoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.BundleHeaderProto.class, org.tensorflow.proto.util.BundleHeaderProto.Builder.class); - } - - // Construct using org.tensorflow.proto.util.BundleHeaderProto.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(); - numShards_ = 0; - - endianness_ = 0; - - if (versionBuilder_ == null) { - version_ = null; - } else { - version_ = null; - versionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleHeaderProto getDefaultInstanceForType() { - return org.tensorflow.proto.util.BundleHeaderProto.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleHeaderProto build() { - org.tensorflow.proto.util.BundleHeaderProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.BundleHeaderProto buildPartial() { - org.tensorflow.proto.util.BundleHeaderProto result = new org.tensorflow.proto.util.BundleHeaderProto(this); - result.numShards_ = numShards_; - result.endianness_ = endianness_; - if (versionBuilder_ == null) { - result.version_ = version_; - } else { - result.version_ = versionBuilder_.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.util.BundleHeaderProto) { - return mergeFrom((org.tensorflow.proto.util.BundleHeaderProto)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.BundleHeaderProto other) { - if (other == org.tensorflow.proto.util.BundleHeaderProto.getDefaultInstance()) return this; - if (other.getNumShards() != 0) { - setNumShards(other.getNumShards()); - } - if (other.endianness_ != 0) { - setEndiannessValue(other.getEndiannessValue()); - } - if (other.hasVersion()) { - mergeVersion(other.getVersion()); - } - 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.util.BundleHeaderProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.BundleHeaderProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int numShards_ ; - /** - *
    -     * Number of data files in the bundle.
    -     * 
    - * - * int32 num_shards = 1; - */ - public int getNumShards() { - return numShards_; - } - /** - *
    -     * Number of data files in the bundle.
    -     * 
    - * - * int32 num_shards = 1; - */ - public Builder setNumShards(int value) { - - numShards_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of data files in the bundle.
    -     * 
    - * - * int32 num_shards = 1; - */ - public Builder clearNumShards() { - - numShards_ = 0; - onChanged(); - return this; - } - - private int endianness_ = 0; - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public int getEndiannessValue() { - return endianness_; - } - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public Builder setEndiannessValue(int value) { - endianness_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public org.tensorflow.proto.util.BundleHeaderProto.Endianness getEndianness() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.BundleHeaderProto.Endianness result = org.tensorflow.proto.util.BundleHeaderProto.Endianness.valueOf(endianness_); - return result == null ? org.tensorflow.proto.util.BundleHeaderProto.Endianness.UNRECOGNIZED : result; - } - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public Builder setEndianness(org.tensorflow.proto.util.BundleHeaderProto.Endianness value) { - if (value == null) { - throw new NullPointerException(); - } - - endianness_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - public Builder clearEndianness() { - - endianness_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.VersionDef version_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> versionBuilder_; - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public boolean hasVersion() { - return versionBuilder_ != null || version_ != null; - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public org.tensorflow.proto.framework.VersionDef getVersion() { - if (versionBuilder_ == null) { - return version_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } else { - return versionBuilder_.getMessage(); - } - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public Builder setVersion(org.tensorflow.proto.framework.VersionDef value) { - if (versionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - version_ = value; - onChanged(); - } else { - versionBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public Builder setVersion( - org.tensorflow.proto.framework.VersionDef.Builder builderForValue) { - if (versionBuilder_ == null) { - version_ = builderForValue.build(); - onChanged(); - } else { - versionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public Builder mergeVersion(org.tensorflow.proto.framework.VersionDef value) { - if (versionBuilder_ == null) { - if (version_ != null) { - version_ = - org.tensorflow.proto.framework.VersionDef.newBuilder(version_).mergeFrom(value).buildPartial(); - } else { - version_ = value; - } - onChanged(); - } else { - versionBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public Builder clearVersion() { - if (versionBuilder_ == null) { - version_ = null; - onChanged(); - } else { - version_ = null; - versionBuilder_ = null; - } - - return this; - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public org.tensorflow.proto.framework.VersionDef.Builder getVersionBuilder() { - - onChanged(); - return getVersionFieldBuilder().getBuilder(); - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder() { - if (versionBuilder_ != null) { - return versionBuilder_.getMessageOrBuilder(); - } else { - return version_ == null ? - org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : version_; - } - } - /** - *
    -     * Versioning of the tensor bundle format.
    -     * 
    - * - * .tensorflow.VersionDef version = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> - getVersionFieldBuilder() { - if (versionBuilder_ == null) { - versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder>( - getVersion(), - getParentForChildren(), - isClean()); - version_ = null; - } - return versionBuilder_; - } - @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.BundleHeaderProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BundleHeaderProto) - private static final org.tensorflow.proto.util.BundleHeaderProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.BundleHeaderProto(); - } - - public static org.tensorflow.proto.util.BundleHeaderProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BundleHeaderProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BundleHeaderProto(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.util.BundleHeaderProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProtoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProtoOrBuilder.java deleted file mode 100644 index f80c5fcef1c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/BundleHeaderProtoOrBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensor_bundle.proto - -package org.tensorflow.proto.util; - -public interface BundleHeaderProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BundleHeaderProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Number of data files in the bundle.
    -   * 
    - * - * int32 num_shards = 1; - */ - int getNumShards(); - - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - int getEndiannessValue(); - /** - * .tensorflow.BundleHeaderProto.Endianness endianness = 2; - */ - org.tensorflow.proto.util.BundleHeaderProto.Endianness getEndianness(); - - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - boolean hasVersion(); - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - org.tensorflow.proto.framework.VersionDef getVersion(); - /** - *
    -   * Versioning of the tensor bundle format.
    -   * 
    - * - * .tensorflow.VersionDef version = 3; - */ - org.tensorflow.proto.framework.VersionDefOrBuilder getVersionOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocation.java deleted file mode 100644 index 28d856a52f3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocation.java +++ /dev/null @@ -1,837 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Code location information: A stack trace with host-name information.
    - * Instead of encoding the detailed stack trace, this proto refers to IDs of
    - * stack frames stored as `StackFrameWithId` protos.
    - * 
    - * - * Protobuf type {@code tensorflow.CodeLocation} - */ -public final class CodeLocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CodeLocation) - CodeLocationOrBuilder { -private static final long serialVersionUID = 0L; - // Use CodeLocation.newBuilder() to construct. - private CodeLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CodeLocation() { - hostName_ = ""; - stackFrameIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CodeLocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CodeLocation( - 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(); - - hostName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - stackFrameIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - stackFrameIds_.add(s); - 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)) { - stackFrameIds_ = stackFrameIds_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_CodeLocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.CodeLocation.class, org.tensorflow.proto.util.CodeLocation.Builder.class); - } - - public static final int HOST_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object hostName_; - /** - *
    -   * Host name on which the source files are located.
    -   * 
    - * - * string host_name = 1; - */ - public java.lang.String getHostName() { - java.lang.Object ref = hostName_; - 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(); - hostName_ = s; - return s; - } - } - /** - *
    -   * Host name on which the source files are located.
    -   * 
    - * - * string host_name = 1; - */ - public com.google.protobuf.ByteString - getHostNameBytes() { - java.lang.Object ref = hostName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STACK_FRAME_IDS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList stackFrameIds_; - /** - *
    -   * ID to a stack frame, each of which is pointed to
    -   * by a unique ID. The ordering of the frames is consistent with Python's
    -   * `traceback.extract_tb()`.
    -   * 
    - * - * repeated string stack_frame_ids = 2; - */ - public com.google.protobuf.ProtocolStringList - getStackFrameIdsList() { - return stackFrameIds_; - } - /** - *
    -   * ID to a stack frame, each of which is pointed to
    -   * by a unique ID. The ordering of the frames is consistent with Python's
    -   * `traceback.extract_tb()`.
    -   * 
    - * - * repeated string stack_frame_ids = 2; - */ - public int getStackFrameIdsCount() { - return stackFrameIds_.size(); - } - /** - *
    -   * ID to a stack frame, each of which is pointed to
    -   * by a unique ID. The ordering of the frames is consistent with Python's
    -   * `traceback.extract_tb()`.
    -   * 
    - * - * repeated string stack_frame_ids = 2; - */ - public java.lang.String getStackFrameIds(int index) { - return stackFrameIds_.get(index); - } - /** - *
    -   * ID to a stack frame, each of which is pointed to
    -   * by a unique ID. The ordering of the frames is consistent with Python's
    -   * `traceback.extract_tb()`.
    -   * 
    - * - * repeated string stack_frame_ids = 2; - */ - public com.google.protobuf.ByteString - getStackFrameIdsBytes(int index) { - return stackFrameIds_.getByteString(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 { - if (!getHostNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostName_); - } - for (int i = 0; i < stackFrameIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, stackFrameIds_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHostNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostName_); - } - { - int dataSize = 0; - for (int i = 0; i < stackFrameIds_.size(); i++) { - dataSize += computeStringSizeNoTag(stackFrameIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getStackFrameIdsList().size(); - } - 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.util.CodeLocation)) { - return super.equals(obj); - } - org.tensorflow.proto.util.CodeLocation other = (org.tensorflow.proto.util.CodeLocation) obj; - - if (!getHostName() - .equals(other.getHostName())) return false; - if (!getStackFrameIdsList() - .equals(other.getStackFrameIdsList())) 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) + HOST_NAME_FIELD_NUMBER; - hash = (53 * hash) + getHostName().hashCode(); - if (getStackFrameIdsCount() > 0) { - hash = (37 * hash) + STACK_FRAME_IDS_FIELD_NUMBER; - hash = (53 * hash) + getStackFrameIdsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.CodeLocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.CodeLocation 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.CodeLocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.CodeLocation 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.CodeLocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.CodeLocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.CodeLocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.CodeLocation 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.CodeLocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.CodeLocation 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.CodeLocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.CodeLocation 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.util.CodeLocation 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; - } - /** - *
    -   * Code location information: A stack trace with host-name information.
    -   * Instead of encoding the detailed stack trace, this proto refers to IDs of
    -   * stack frames stored as `StackFrameWithId` protos.
    -   * 
    - * - * Protobuf type {@code tensorflow.CodeLocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CodeLocation) - org.tensorflow.proto.util.CodeLocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_CodeLocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.CodeLocation.class, org.tensorflow.proto.util.CodeLocation.Builder.class); - } - - // Construct using org.tensorflow.proto.util.CodeLocation.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(); - hostName_ = ""; - - stackFrameIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.CodeLocation getDefaultInstanceForType() { - return org.tensorflow.proto.util.CodeLocation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.CodeLocation build() { - org.tensorflow.proto.util.CodeLocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.CodeLocation buildPartial() { - org.tensorflow.proto.util.CodeLocation result = new org.tensorflow.proto.util.CodeLocation(this); - int from_bitField0_ = bitField0_; - result.hostName_ = hostName_; - if (((bitField0_ & 0x00000001) != 0)) { - stackFrameIds_ = stackFrameIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.stackFrameIds_ = stackFrameIds_; - 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.util.CodeLocation) { - return mergeFrom((org.tensorflow.proto.util.CodeLocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.CodeLocation other) { - if (other == org.tensorflow.proto.util.CodeLocation.getDefaultInstance()) return this; - if (!other.getHostName().isEmpty()) { - hostName_ = other.hostName_; - onChanged(); - } - if (!other.stackFrameIds_.isEmpty()) { - if (stackFrameIds_.isEmpty()) { - stackFrameIds_ = other.stackFrameIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureStackFrameIdsIsMutable(); - stackFrameIds_.addAll(other.stackFrameIds_); - } - onChanged(); - } - 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.util.CodeLocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.CodeLocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object hostName_ = ""; - /** - *
    -     * Host name on which the source files are located.
    -     * 
    - * - * string host_name = 1; - */ - public java.lang.String getHostName() { - java.lang.Object ref = hostName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Host name on which the source files are located.
    -     * 
    - * - * string host_name = 1; - */ - public com.google.protobuf.ByteString - getHostNameBytes() { - java.lang.Object ref = hostName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Host name on which the source files are located.
    -     * 
    - * - * string host_name = 1; - */ - public Builder setHostName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Host name on which the source files are located.
    -     * 
    - * - * string host_name = 1; - */ - public Builder clearHostName() { - - hostName_ = getDefaultInstance().getHostName(); - onChanged(); - return this; - } - /** - *
    -     * Host name on which the source files are located.
    -     * 
    - * - * string host_name = 1; - */ - public Builder setHostNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList stackFrameIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureStackFrameIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - stackFrameIds_ = new com.google.protobuf.LazyStringArrayList(stackFrameIds_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public com.google.protobuf.ProtocolStringList - getStackFrameIdsList() { - return stackFrameIds_.getUnmodifiableView(); - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public int getStackFrameIdsCount() { - return stackFrameIds_.size(); - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public java.lang.String getStackFrameIds(int index) { - return stackFrameIds_.get(index); - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public com.google.protobuf.ByteString - getStackFrameIdsBytes(int index) { - return stackFrameIds_.getByteString(index); - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public Builder setStackFrameIds( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStackFrameIdsIsMutable(); - stackFrameIds_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public Builder addStackFrameIds( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStackFrameIdsIsMutable(); - stackFrameIds_.add(value); - onChanged(); - return this; - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public Builder addAllStackFrameIds( - java.lang.Iterable values) { - ensureStackFrameIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, stackFrameIds_); - onChanged(); - return this; - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public Builder clearStackFrameIds() { - stackFrameIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * ID to a stack frame, each of which is pointed to
    -     * by a unique ID. The ordering of the frames is consistent with Python's
    -     * `traceback.extract_tb()`.
    -     * 
    - * - * repeated string stack_frame_ids = 2; - */ - public Builder addStackFrameIdsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureStackFrameIdsIsMutable(); - stackFrameIds_.add(value); - 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.CodeLocation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CodeLocation) - private static final org.tensorflow.proto.util.CodeLocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.CodeLocation(); - } - - public static org.tensorflow.proto.util.CodeLocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CodeLocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CodeLocation(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.util.CodeLocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEvent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEvent.java deleted file mode 100644 index a1b0b986a3d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEvent.java +++ /dev/null @@ -1,2883 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * An Event related to the debugging of a TensorFlow program.
    - * 
    - * - * Protobuf type {@code tensorflow.DebugEvent} - */ -public final class DebugEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebugEvent) - DebugEventOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebugEvent.newBuilder() to construct. - private DebugEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebugEvent() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebugEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebugEvent( - 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 9: { - - wallTime_ = input.readDouble(); - break; - } - case 16: { - - step_ = input.readInt64(); - break; - } - case 26: { - org.tensorflow.proto.util.DebugMetadata.Builder subBuilder = null; - if (whatCase_ == 3) { - subBuilder = ((org.tensorflow.proto.util.DebugMetadata) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.DebugMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.DebugMetadata) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 3; - break; - } - case 34: { - org.tensorflow.proto.util.SourceFile.Builder subBuilder = null; - if (whatCase_ == 4) { - subBuilder = ((org.tensorflow.proto.util.SourceFile) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.SourceFile.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.SourceFile) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 4; - break; - } - case 50: { - org.tensorflow.proto.util.StackFrameWithId.Builder subBuilder = null; - if (whatCase_ == 6) { - subBuilder = ((org.tensorflow.proto.util.StackFrameWithId) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.StackFrameWithId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.StackFrameWithId) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 6; - break; - } - case 58: { - org.tensorflow.proto.util.GraphOpCreation.Builder subBuilder = null; - if (whatCase_ == 7) { - subBuilder = ((org.tensorflow.proto.util.GraphOpCreation) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.GraphOpCreation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.GraphOpCreation) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 7; - break; - } - case 66: { - org.tensorflow.proto.util.DebuggedGraph.Builder subBuilder = null; - if (whatCase_ == 8) { - subBuilder = ((org.tensorflow.proto.util.DebuggedGraph) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.DebuggedGraph.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.DebuggedGraph) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 8; - break; - } - case 74: { - org.tensorflow.proto.util.Execution.Builder subBuilder = null; - if (whatCase_ == 9) { - subBuilder = ((org.tensorflow.proto.util.Execution) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.Execution.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.Execution) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 9; - break; - } - case 82: { - org.tensorflow.proto.util.GraphExecutionTrace.Builder subBuilder = null; - if (whatCase_ == 10) { - subBuilder = ((org.tensorflow.proto.util.GraphExecutionTrace) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.GraphExecutionTrace.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.GraphExecutionTrace) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 10; - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - whatCase_ = 11; - what_ = s; - break; - } - case 98: { - org.tensorflow.proto.util.DebuggedDevice.Builder subBuilder = null; - if (whatCase_ == 12) { - subBuilder = ((org.tensorflow.proto.util.DebuggedDevice) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.DebuggedDevice.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.DebuggedDevice) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 12; - 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.util.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebugEvent.class, org.tensorflow.proto.util.DebugEvent.Builder.class); - } - - private int whatCase_ = 0; - private java.lang.Object what_; - public enum WhatCase - implements com.google.protobuf.Internal.EnumLite { - DEBUG_METADATA(3), - SOURCE_FILE(4), - STACK_FRAME_WITH_ID(6), - GRAPH_OP_CREATION(7), - DEBUGGED_GRAPH(8), - EXECUTION(9), - GRAPH_EXECUTION_TRACE(10), - GRAPH_ID(11), - DEBUGGED_DEVICE(12), - WHAT_NOT_SET(0); - private final int value; - private WhatCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static WhatCase valueOf(int value) { - return forNumber(value); - } - - public static WhatCase forNumber(int value) { - switch (value) { - case 3: return DEBUG_METADATA; - case 4: return SOURCE_FILE; - case 6: return STACK_FRAME_WITH_ID; - case 7: return GRAPH_OP_CREATION; - case 8: return DEBUGGED_GRAPH; - case 9: return EXECUTION; - case 10: return GRAPH_EXECUTION_TRACE; - case 11: return GRAPH_ID; - case 12: return DEBUGGED_DEVICE; - case 0: return WHAT_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public WhatCase - getWhatCase() { - return WhatCase.forNumber( - whatCase_); - } - - public static final int WALL_TIME_FIELD_NUMBER = 1; - private double wallTime_; - /** - *
    -   * Timestamp in seconds (with microsecond precision).
    -   * 
    - * - * double wall_time = 1; - */ - public double getWallTime() { - return wallTime_; - } - - public static final int STEP_FIELD_NUMBER = 2; - private long step_; - /** - *
    -   * Step of training (if available).
    -   * 
    - * - * int64 step = 2; - */ - public long getStep() { - return step_; - } - - public static final int DEBUG_METADATA_FIELD_NUMBER = 3; - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public boolean hasDebugMetadata() { - return whatCase_ == 3; - } - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public org.tensorflow.proto.util.DebugMetadata getDebugMetadata() { - if (whatCase_ == 3) { - return (org.tensorflow.proto.util.DebugMetadata) what_; - } - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public org.tensorflow.proto.util.DebugMetadataOrBuilder getDebugMetadataOrBuilder() { - if (whatCase_ == 3) { - return (org.tensorflow.proto.util.DebugMetadata) what_; - } - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - - public static final int SOURCE_FILE_FIELD_NUMBER = 4; - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public boolean hasSourceFile() { - return whatCase_ == 4; - } - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public org.tensorflow.proto.util.SourceFile getSourceFile() { - if (whatCase_ == 4) { - return (org.tensorflow.proto.util.SourceFile) what_; - } - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public org.tensorflow.proto.util.SourceFileOrBuilder getSourceFileOrBuilder() { - if (whatCase_ == 4) { - return (org.tensorflow.proto.util.SourceFile) what_; - } - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - - public static final int STACK_FRAME_WITH_ID_FIELD_NUMBER = 6; - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public boolean hasStackFrameWithId() { - return whatCase_ == 6; - } - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public org.tensorflow.proto.util.StackFrameWithId getStackFrameWithId() { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.StackFrameWithId) what_; - } - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public org.tensorflow.proto.util.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder() { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.StackFrameWithId) what_; - } - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - - public static final int GRAPH_OP_CREATION_FIELD_NUMBER = 7; - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public boolean hasGraphOpCreation() { - return whatCase_ == 7; - } - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public org.tensorflow.proto.util.GraphOpCreation getGraphOpCreation() { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.GraphOpCreation) what_; - } - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public org.tensorflow.proto.util.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder() { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.GraphOpCreation) what_; - } - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - - public static final int DEBUGGED_GRAPH_FIELD_NUMBER = 8; - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public boolean hasDebuggedGraph() { - return whatCase_ == 8; - } - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public org.tensorflow.proto.util.DebuggedGraph getDebuggedGraph() { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.DebuggedGraph) what_; - } - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public org.tensorflow.proto.util.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder() { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.DebuggedGraph) what_; - } - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - - public static final int EXECUTION_FIELD_NUMBER = 9; - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - public boolean hasExecution() { - return whatCase_ == 9; - } - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - public org.tensorflow.proto.util.Execution getExecution() { - if (whatCase_ == 9) { - return (org.tensorflow.proto.util.Execution) what_; - } - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - public org.tensorflow.proto.util.ExecutionOrBuilder getExecutionOrBuilder() { - if (whatCase_ == 9) { - return (org.tensorflow.proto.util.Execution) what_; - } - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - - public static final int GRAPH_EXECUTION_TRACE_FIELD_NUMBER = 10; - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public boolean hasGraphExecutionTrace() { - return whatCase_ == 10; - } - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public org.tensorflow.proto.util.GraphExecutionTrace getGraphExecutionTrace() { - if (whatCase_ == 10) { - return (org.tensorflow.proto.util.GraphExecutionTrace) what_; - } - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public org.tensorflow.proto.util.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder() { - if (whatCase_ == 10) { - return (org.tensorflow.proto.util.GraphExecutionTrace) what_; - } - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - - public static final int GRAPH_ID_FIELD_NUMBER = 11; - /** - *
    -   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -   * to the execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 11; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = ""; - if (whatCase_ == 11) { - ref = what_; - } - 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(); - if (whatCase_ == 11) { - what_ = s; - } - return s; - } - } - /** - *
    -   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -   * to the execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 11; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = ""; - if (whatCase_ == 11) { - ref = what_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (whatCase_ == 11) { - what_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEBUGGED_DEVICE_FIELD_NUMBER = 12; - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public boolean hasDebuggedDevice() { - return whatCase_ == 12; - } - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public org.tensorflow.proto.util.DebuggedDevice getDebuggedDevice() { - if (whatCase_ == 12) { - return (org.tensorflow.proto.util.DebuggedDevice) what_; - } - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public org.tensorflow.proto.util.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder() { - if (whatCase_ == 12) { - return (org.tensorflow.proto.util.DebuggedDevice) what_; - } - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - - 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 (wallTime_ != 0D) { - output.writeDouble(1, wallTime_); - } - if (step_ != 0L) { - output.writeInt64(2, step_); - } - if (whatCase_ == 3) { - output.writeMessage(3, (org.tensorflow.proto.util.DebugMetadata) what_); - } - if (whatCase_ == 4) { - output.writeMessage(4, (org.tensorflow.proto.util.SourceFile) what_); - } - if (whatCase_ == 6) { - output.writeMessage(6, (org.tensorflow.proto.util.StackFrameWithId) what_); - } - if (whatCase_ == 7) { - output.writeMessage(7, (org.tensorflow.proto.util.GraphOpCreation) what_); - } - if (whatCase_ == 8) { - output.writeMessage(8, (org.tensorflow.proto.util.DebuggedGraph) what_); - } - if (whatCase_ == 9) { - output.writeMessage(9, (org.tensorflow.proto.util.Execution) what_); - } - if (whatCase_ == 10) { - output.writeMessage(10, (org.tensorflow.proto.util.GraphExecutionTrace) what_); - } - if (whatCase_ == 11) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, what_); - } - if (whatCase_ == 12) { - output.writeMessage(12, (org.tensorflow.proto.util.DebuggedDevice) what_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (wallTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, wallTime_); - } - if (step_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, step_); - } - if (whatCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (org.tensorflow.proto.util.DebugMetadata) what_); - } - if (whatCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (org.tensorflow.proto.util.SourceFile) what_); - } - if (whatCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (org.tensorflow.proto.util.StackFrameWithId) what_); - } - if (whatCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (org.tensorflow.proto.util.GraphOpCreation) what_); - } - if (whatCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (org.tensorflow.proto.util.DebuggedGraph) what_); - } - if (whatCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, (org.tensorflow.proto.util.Execution) what_); - } - if (whatCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (org.tensorflow.proto.util.GraphExecutionTrace) what_); - } - if (whatCase_ == 11) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, what_); - } - if (whatCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, (org.tensorflow.proto.util.DebuggedDevice) what_); - } - 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.util.DebugEvent)) { - return super.equals(obj); - } - org.tensorflow.proto.util.DebugEvent other = (org.tensorflow.proto.util.DebugEvent) obj; - - if (java.lang.Double.doubleToLongBits(getWallTime()) - != java.lang.Double.doubleToLongBits( - other.getWallTime())) return false; - if (getStep() - != other.getStep()) return false; - if (!getWhatCase().equals(other.getWhatCase())) return false; - switch (whatCase_) { - case 3: - if (!getDebugMetadata() - .equals(other.getDebugMetadata())) return false; - break; - case 4: - if (!getSourceFile() - .equals(other.getSourceFile())) return false; - break; - case 6: - if (!getStackFrameWithId() - .equals(other.getStackFrameWithId())) return false; - break; - case 7: - if (!getGraphOpCreation() - .equals(other.getGraphOpCreation())) return false; - break; - case 8: - if (!getDebuggedGraph() - .equals(other.getDebuggedGraph())) return false; - break; - case 9: - if (!getExecution() - .equals(other.getExecution())) return false; - break; - case 10: - if (!getGraphExecutionTrace() - .equals(other.getGraphExecutionTrace())) return false; - break; - case 11: - if (!getGraphId() - .equals(other.getGraphId())) return false; - break; - case 12: - if (!getDebuggedDevice() - .equals(other.getDebuggedDevice())) return false; - break; - case 0: - default: - } - 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) + WALL_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getWallTime())); - hash = (37 * hash) + STEP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStep()); - switch (whatCase_) { - case 3: - hash = (37 * hash) + DEBUG_METADATA_FIELD_NUMBER; - hash = (53 * hash) + getDebugMetadata().hashCode(); - break; - case 4: - hash = (37 * hash) + SOURCE_FILE_FIELD_NUMBER; - hash = (53 * hash) + getSourceFile().hashCode(); - break; - case 6: - hash = (37 * hash) + STACK_FRAME_WITH_ID_FIELD_NUMBER; - hash = (53 * hash) + getStackFrameWithId().hashCode(); - break; - case 7: - hash = (37 * hash) + GRAPH_OP_CREATION_FIELD_NUMBER; - hash = (53 * hash) + getGraphOpCreation().hashCode(); - break; - case 8: - hash = (37 * hash) + DEBUGGED_GRAPH_FIELD_NUMBER; - hash = (53 * hash) + getDebuggedGraph().hashCode(); - break; - case 9: - hash = (37 * hash) + EXECUTION_FIELD_NUMBER; - hash = (53 * hash) + getExecution().hashCode(); - break; - case 10: - hash = (37 * hash) + GRAPH_EXECUTION_TRACE_FIELD_NUMBER; - hash = (53 * hash) + getGraphExecutionTrace().hashCode(); - break; - case 11: - hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; - hash = (53 * hash) + getGraphId().hashCode(); - break; - case 12: - hash = (37 * hash) + DEBUGGED_DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getDebuggedDevice().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.DebugEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugEvent 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.DebugEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugEvent 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.DebugEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.DebugEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugEvent 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.DebugEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugEvent 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.DebugEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugEvent 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.util.DebugEvent 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; - } - /** - *
    -   * An Event related to the debugging of a TensorFlow program.
    -   * 
    - * - * Protobuf type {@code tensorflow.DebugEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebugEvent) - org.tensorflow.proto.util.DebugEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebugEvent.class, org.tensorflow.proto.util.DebugEvent.Builder.class); - } - - // Construct using org.tensorflow.proto.util.DebugEvent.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(); - wallTime_ = 0D; - - step_ = 0L; - - whatCase_ = 0; - what_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugEvent getDefaultInstanceForType() { - return org.tensorflow.proto.util.DebugEvent.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugEvent build() { - org.tensorflow.proto.util.DebugEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugEvent buildPartial() { - org.tensorflow.proto.util.DebugEvent result = new org.tensorflow.proto.util.DebugEvent(this); - result.wallTime_ = wallTime_; - result.step_ = step_; - if (whatCase_ == 3) { - if (debugMetadataBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = debugMetadataBuilder_.build(); - } - } - if (whatCase_ == 4) { - if (sourceFileBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = sourceFileBuilder_.build(); - } - } - if (whatCase_ == 6) { - if (stackFrameWithIdBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = stackFrameWithIdBuilder_.build(); - } - } - if (whatCase_ == 7) { - if (graphOpCreationBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = graphOpCreationBuilder_.build(); - } - } - if (whatCase_ == 8) { - if (debuggedGraphBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = debuggedGraphBuilder_.build(); - } - } - if (whatCase_ == 9) { - if (executionBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = executionBuilder_.build(); - } - } - if (whatCase_ == 10) { - if (graphExecutionTraceBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = graphExecutionTraceBuilder_.build(); - } - } - if (whatCase_ == 11) { - result.what_ = what_; - } - if (whatCase_ == 12) { - if (debuggedDeviceBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = debuggedDeviceBuilder_.build(); - } - } - result.whatCase_ = whatCase_; - 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.util.DebugEvent) { - return mergeFrom((org.tensorflow.proto.util.DebugEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.DebugEvent other) { - if (other == org.tensorflow.proto.util.DebugEvent.getDefaultInstance()) return this; - if (other.getWallTime() != 0D) { - setWallTime(other.getWallTime()); - } - if (other.getStep() != 0L) { - setStep(other.getStep()); - } - switch (other.getWhatCase()) { - case DEBUG_METADATA: { - mergeDebugMetadata(other.getDebugMetadata()); - break; - } - case SOURCE_FILE: { - mergeSourceFile(other.getSourceFile()); - break; - } - case STACK_FRAME_WITH_ID: { - mergeStackFrameWithId(other.getStackFrameWithId()); - break; - } - case GRAPH_OP_CREATION: { - mergeGraphOpCreation(other.getGraphOpCreation()); - break; - } - case DEBUGGED_GRAPH: { - mergeDebuggedGraph(other.getDebuggedGraph()); - break; - } - case EXECUTION: { - mergeExecution(other.getExecution()); - break; - } - case GRAPH_EXECUTION_TRACE: { - mergeGraphExecutionTrace(other.getGraphExecutionTrace()); - break; - } - case GRAPH_ID: { - whatCase_ = 11; - what_ = other.what_; - onChanged(); - break; - } - case DEBUGGED_DEVICE: { - mergeDebuggedDevice(other.getDebuggedDevice()); - break; - } - case WHAT_NOT_SET: { - break; - } - } - 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.util.DebugEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.DebugEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int whatCase_ = 0; - private java.lang.Object what_; - public WhatCase - getWhatCase() { - return WhatCase.forNumber( - whatCase_); - } - - public Builder clearWhat() { - whatCase_ = 0; - what_ = null; - onChanged(); - return this; - } - - - private double wallTime_ ; - /** - *
    -     * Timestamp in seconds (with microsecond precision).
    -     * 
    - * - * double wall_time = 1; - */ - public double getWallTime() { - return wallTime_; - } - /** - *
    -     * Timestamp in seconds (with microsecond precision).
    -     * 
    - * - * double wall_time = 1; - */ - public Builder setWallTime(double value) { - - wallTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Timestamp in seconds (with microsecond precision).
    -     * 
    - * - * double wall_time = 1; - */ - public Builder clearWallTime() { - - wallTime_ = 0D; - onChanged(); - return this; - } - - private long step_ ; - /** - *
    -     * Step of training (if available).
    -     * 
    - * - * int64 step = 2; - */ - public long getStep() { - return step_; - } - /** - *
    -     * Step of training (if available).
    -     * 
    - * - * int64 step = 2; - */ - public Builder setStep(long value) { - - step_ = value; - onChanged(); - return this; - } - /** - *
    -     * Step of training (if available).
    -     * 
    - * - * int64 step = 2; - */ - public Builder clearStep() { - - step_ = 0L; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebugMetadata, org.tensorflow.proto.util.DebugMetadata.Builder, org.tensorflow.proto.util.DebugMetadataOrBuilder> debugMetadataBuilder_; - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public boolean hasDebugMetadata() { - return whatCase_ == 3; - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public org.tensorflow.proto.util.DebugMetadata getDebugMetadata() { - if (debugMetadataBuilder_ == null) { - if (whatCase_ == 3) { - return (org.tensorflow.proto.util.DebugMetadata) what_; - } - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } else { - if (whatCase_ == 3) { - return debugMetadataBuilder_.getMessage(); - } - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public Builder setDebugMetadata(org.tensorflow.proto.util.DebugMetadata value) { - if (debugMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - debugMetadataBuilder_.setMessage(value); - } - whatCase_ = 3; - return this; - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public Builder setDebugMetadata( - org.tensorflow.proto.util.DebugMetadata.Builder builderForValue) { - if (debugMetadataBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - debugMetadataBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 3; - return this; - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public Builder mergeDebugMetadata(org.tensorflow.proto.util.DebugMetadata value) { - if (debugMetadataBuilder_ == null) { - if (whatCase_ == 3 && - what_ != org.tensorflow.proto.util.DebugMetadata.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.DebugMetadata.newBuilder((org.tensorflow.proto.util.DebugMetadata) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 3) { - debugMetadataBuilder_.mergeFrom(value); - } - debugMetadataBuilder_.setMessage(value); - } - whatCase_ = 3; - return this; - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public Builder clearDebugMetadata() { - if (debugMetadataBuilder_ == null) { - if (whatCase_ == 3) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 3) { - whatCase_ = 0; - what_ = null; - } - debugMetadataBuilder_.clear(); - } - return this; - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public org.tensorflow.proto.util.DebugMetadata.Builder getDebugMetadataBuilder() { - return getDebugMetadataFieldBuilder().getBuilder(); - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - public org.tensorflow.proto.util.DebugMetadataOrBuilder getDebugMetadataOrBuilder() { - if ((whatCase_ == 3) && (debugMetadataBuilder_ != null)) { - return debugMetadataBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 3) { - return (org.tensorflow.proto.util.DebugMetadata) what_; - } - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - } - /** - *
    -     * Metadata related to this debugging data.
    -     * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebugMetadata, org.tensorflow.proto.util.DebugMetadata.Builder, org.tensorflow.proto.util.DebugMetadataOrBuilder> - getDebugMetadataFieldBuilder() { - if (debugMetadataBuilder_ == null) { - if (!(whatCase_ == 3)) { - what_ = org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - debugMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebugMetadata, org.tensorflow.proto.util.DebugMetadata.Builder, org.tensorflow.proto.util.DebugMetadataOrBuilder>( - (org.tensorflow.proto.util.DebugMetadata) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 3; - onChanged();; - return debugMetadataBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SourceFile, org.tensorflow.proto.util.SourceFile.Builder, org.tensorflow.proto.util.SourceFileOrBuilder> sourceFileBuilder_; - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public boolean hasSourceFile() { - return whatCase_ == 4; - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public org.tensorflow.proto.util.SourceFile getSourceFile() { - if (sourceFileBuilder_ == null) { - if (whatCase_ == 4) { - return (org.tensorflow.proto.util.SourceFile) what_; - } - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } else { - if (whatCase_ == 4) { - return sourceFileBuilder_.getMessage(); - } - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public Builder setSourceFile(org.tensorflow.proto.util.SourceFile value) { - if (sourceFileBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - sourceFileBuilder_.setMessage(value); - } - whatCase_ = 4; - return this; - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public Builder setSourceFile( - org.tensorflow.proto.util.SourceFile.Builder builderForValue) { - if (sourceFileBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - sourceFileBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 4; - return this; - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public Builder mergeSourceFile(org.tensorflow.proto.util.SourceFile value) { - if (sourceFileBuilder_ == null) { - if (whatCase_ == 4 && - what_ != org.tensorflow.proto.util.SourceFile.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.SourceFile.newBuilder((org.tensorflow.proto.util.SourceFile) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 4) { - sourceFileBuilder_.mergeFrom(value); - } - sourceFileBuilder_.setMessage(value); - } - whatCase_ = 4; - return this; - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public Builder clearSourceFile() { - if (sourceFileBuilder_ == null) { - if (whatCase_ == 4) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 4) { - whatCase_ = 0; - what_ = null; - } - sourceFileBuilder_.clear(); - } - return this; - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public org.tensorflow.proto.util.SourceFile.Builder getSourceFileBuilder() { - return getSourceFileFieldBuilder().getBuilder(); - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - public org.tensorflow.proto.util.SourceFileOrBuilder getSourceFileOrBuilder() { - if ((whatCase_ == 4) && (sourceFileBuilder_ != null)) { - return sourceFileBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 4) { - return (org.tensorflow.proto.util.SourceFile) what_; - } - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - } - /** - *
    -     * The content of a source file.
    -     * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SourceFile, org.tensorflow.proto.util.SourceFile.Builder, org.tensorflow.proto.util.SourceFileOrBuilder> - getSourceFileFieldBuilder() { - if (sourceFileBuilder_ == null) { - if (!(whatCase_ == 4)) { - what_ = org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - sourceFileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SourceFile, org.tensorflow.proto.util.SourceFile.Builder, org.tensorflow.proto.util.SourceFileOrBuilder>( - (org.tensorflow.proto.util.SourceFile) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 4; - onChanged();; - return sourceFileBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.StackFrameWithId, org.tensorflow.proto.util.StackFrameWithId.Builder, org.tensorflow.proto.util.StackFrameWithIdOrBuilder> stackFrameWithIdBuilder_; - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public boolean hasStackFrameWithId() { - return whatCase_ == 6; - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public org.tensorflow.proto.util.StackFrameWithId getStackFrameWithId() { - if (stackFrameWithIdBuilder_ == null) { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.StackFrameWithId) what_; - } - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } else { - if (whatCase_ == 6) { - return stackFrameWithIdBuilder_.getMessage(); - } - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public Builder setStackFrameWithId(org.tensorflow.proto.util.StackFrameWithId value) { - if (stackFrameWithIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - stackFrameWithIdBuilder_.setMessage(value); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public Builder setStackFrameWithId( - org.tensorflow.proto.util.StackFrameWithId.Builder builderForValue) { - if (stackFrameWithIdBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - stackFrameWithIdBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public Builder mergeStackFrameWithId(org.tensorflow.proto.util.StackFrameWithId value) { - if (stackFrameWithIdBuilder_ == null) { - if (whatCase_ == 6 && - what_ != org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.StackFrameWithId.newBuilder((org.tensorflow.proto.util.StackFrameWithId) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 6) { - stackFrameWithIdBuilder_.mergeFrom(value); - } - stackFrameWithIdBuilder_.setMessage(value); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public Builder clearStackFrameWithId() { - if (stackFrameWithIdBuilder_ == null) { - if (whatCase_ == 6) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 6) { - whatCase_ = 0; - what_ = null; - } - stackFrameWithIdBuilder_.clear(); - } - return this; - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public org.tensorflow.proto.util.StackFrameWithId.Builder getStackFrameWithIdBuilder() { - return getStackFrameWithIdFieldBuilder().getBuilder(); - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - public org.tensorflow.proto.util.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder() { - if ((whatCase_ == 6) && (stackFrameWithIdBuilder_ != null)) { - return stackFrameWithIdBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.StackFrameWithId) what_; - } - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - } - /** - *
    -     * A stack frame (filename, line number and column number, function name and
    -     * code string) with ID.
    -     * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.StackFrameWithId, org.tensorflow.proto.util.StackFrameWithId.Builder, org.tensorflow.proto.util.StackFrameWithIdOrBuilder> - getStackFrameWithIdFieldBuilder() { - if (stackFrameWithIdBuilder_ == null) { - if (!(whatCase_ == 6)) { - what_ = org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - stackFrameWithIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.StackFrameWithId, org.tensorflow.proto.util.StackFrameWithId.Builder, org.tensorflow.proto.util.StackFrameWithIdOrBuilder>( - (org.tensorflow.proto.util.StackFrameWithId) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 6; - onChanged();; - return stackFrameWithIdBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphOpCreation, org.tensorflow.proto.util.GraphOpCreation.Builder, org.tensorflow.proto.util.GraphOpCreationOrBuilder> graphOpCreationBuilder_; - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public boolean hasGraphOpCreation() { - return whatCase_ == 7; - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public org.tensorflow.proto.util.GraphOpCreation getGraphOpCreation() { - if (graphOpCreationBuilder_ == null) { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.GraphOpCreation) what_; - } - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } else { - if (whatCase_ == 7) { - return graphOpCreationBuilder_.getMessage(); - } - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public Builder setGraphOpCreation(org.tensorflow.proto.util.GraphOpCreation value) { - if (graphOpCreationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - graphOpCreationBuilder_.setMessage(value); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public Builder setGraphOpCreation( - org.tensorflow.proto.util.GraphOpCreation.Builder builderForValue) { - if (graphOpCreationBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - graphOpCreationBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public Builder mergeGraphOpCreation(org.tensorflow.proto.util.GraphOpCreation value) { - if (graphOpCreationBuilder_ == null) { - if (whatCase_ == 7 && - what_ != org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.GraphOpCreation.newBuilder((org.tensorflow.proto.util.GraphOpCreation) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 7) { - graphOpCreationBuilder_.mergeFrom(value); - } - graphOpCreationBuilder_.setMessage(value); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public Builder clearGraphOpCreation() { - if (graphOpCreationBuilder_ == null) { - if (whatCase_ == 7) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 7) { - whatCase_ = 0; - what_ = null; - } - graphOpCreationBuilder_.clear(); - } - return this; - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public org.tensorflow.proto.util.GraphOpCreation.Builder getGraphOpCreationBuilder() { - return getGraphOpCreationFieldBuilder().getBuilder(); - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - public org.tensorflow.proto.util.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder() { - if ((whatCase_ == 7) && (graphOpCreationBuilder_ != null)) { - return graphOpCreationBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.GraphOpCreation) what_; - } - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - } - /** - *
    -     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -     * a Python function).
    -     * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphOpCreation, org.tensorflow.proto.util.GraphOpCreation.Builder, org.tensorflow.proto.util.GraphOpCreationOrBuilder> - getGraphOpCreationFieldBuilder() { - if (graphOpCreationBuilder_ == null) { - if (!(whatCase_ == 7)) { - what_ = org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - graphOpCreationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphOpCreation, org.tensorflow.proto.util.GraphOpCreation.Builder, org.tensorflow.proto.util.GraphOpCreationOrBuilder>( - (org.tensorflow.proto.util.GraphOpCreation) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 7; - onChanged();; - return graphOpCreationBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedGraph, org.tensorflow.proto.util.DebuggedGraph.Builder, org.tensorflow.proto.util.DebuggedGraphOrBuilder> debuggedGraphBuilder_; - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public boolean hasDebuggedGraph() { - return whatCase_ == 8; - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public org.tensorflow.proto.util.DebuggedGraph getDebuggedGraph() { - if (debuggedGraphBuilder_ == null) { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.DebuggedGraph) what_; - } - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } else { - if (whatCase_ == 8) { - return debuggedGraphBuilder_.getMessage(); - } - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public Builder setDebuggedGraph(org.tensorflow.proto.util.DebuggedGraph value) { - if (debuggedGraphBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - debuggedGraphBuilder_.setMessage(value); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public Builder setDebuggedGraph( - org.tensorflow.proto.util.DebuggedGraph.Builder builderForValue) { - if (debuggedGraphBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - debuggedGraphBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public Builder mergeDebuggedGraph(org.tensorflow.proto.util.DebuggedGraph value) { - if (debuggedGraphBuilder_ == null) { - if (whatCase_ == 8 && - what_ != org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.DebuggedGraph.newBuilder((org.tensorflow.proto.util.DebuggedGraph) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 8) { - debuggedGraphBuilder_.mergeFrom(value); - } - debuggedGraphBuilder_.setMessage(value); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public Builder clearDebuggedGraph() { - if (debuggedGraphBuilder_ == null) { - if (whatCase_ == 8) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 8) { - whatCase_ = 0; - what_ = null; - } - debuggedGraphBuilder_.clear(); - } - return this; - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public org.tensorflow.proto.util.DebuggedGraph.Builder getDebuggedGraphBuilder() { - return getDebuggedGraphFieldBuilder().getBuilder(); - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - public org.tensorflow.proto.util.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder() { - if ((whatCase_ == 8) && (debuggedGraphBuilder_ != null)) { - return debuggedGraphBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.DebuggedGraph) what_; - } - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - } - /** - *
    -     * Information about a debugged graph.
    -     * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedGraph, org.tensorflow.proto.util.DebuggedGraph.Builder, org.tensorflow.proto.util.DebuggedGraphOrBuilder> - getDebuggedGraphFieldBuilder() { - if (debuggedGraphBuilder_ == null) { - if (!(whatCase_ == 8)) { - what_ = org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - debuggedGraphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedGraph, org.tensorflow.proto.util.DebuggedGraph.Builder, org.tensorflow.proto.util.DebuggedGraphOrBuilder>( - (org.tensorflow.proto.util.DebuggedGraph) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 8; - onChanged();; - return debuggedGraphBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.Execution, org.tensorflow.proto.util.Execution.Builder, org.tensorflow.proto.util.ExecutionOrBuilder> executionBuilder_; - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public boolean hasExecution() { - return whatCase_ == 9; - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public org.tensorflow.proto.util.Execution getExecution() { - if (executionBuilder_ == null) { - if (whatCase_ == 9) { - return (org.tensorflow.proto.util.Execution) what_; - } - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } else { - if (whatCase_ == 9) { - return executionBuilder_.getMessage(); - } - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public Builder setExecution(org.tensorflow.proto.util.Execution value) { - if (executionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - executionBuilder_.setMessage(value); - } - whatCase_ = 9; - return this; - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public Builder setExecution( - org.tensorflow.proto.util.Execution.Builder builderForValue) { - if (executionBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - executionBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 9; - return this; - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public Builder mergeExecution(org.tensorflow.proto.util.Execution value) { - if (executionBuilder_ == null) { - if (whatCase_ == 9 && - what_ != org.tensorflow.proto.util.Execution.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.Execution.newBuilder((org.tensorflow.proto.util.Execution) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 9) { - executionBuilder_.mergeFrom(value); - } - executionBuilder_.setMessage(value); - } - whatCase_ = 9; - return this; - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public Builder clearExecution() { - if (executionBuilder_ == null) { - if (whatCase_ == 9) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 9) { - whatCase_ = 0; - what_ = null; - } - executionBuilder_.clear(); - } - return this; - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public org.tensorflow.proto.util.Execution.Builder getExecutionBuilder() { - return getExecutionFieldBuilder().getBuilder(); - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - public org.tensorflow.proto.util.ExecutionOrBuilder getExecutionOrBuilder() { - if ((whatCase_ == 9) && (executionBuilder_ != null)) { - return executionBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 9) { - return (org.tensorflow.proto.util.Execution) what_; - } - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - } - /** - *
    -     * Execution of an op or a Graph (e.g., a tf.function).
    -     * 
    - * - * .tensorflow.Execution execution = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.Execution, org.tensorflow.proto.util.Execution.Builder, org.tensorflow.proto.util.ExecutionOrBuilder> - getExecutionFieldBuilder() { - if (executionBuilder_ == null) { - if (!(whatCase_ == 9)) { - what_ = org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - executionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.Execution, org.tensorflow.proto.util.Execution.Builder, org.tensorflow.proto.util.ExecutionOrBuilder>( - (org.tensorflow.proto.util.Execution) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 9; - onChanged();; - return executionBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphExecutionTrace, org.tensorflow.proto.util.GraphExecutionTrace.Builder, org.tensorflow.proto.util.GraphExecutionTraceOrBuilder> graphExecutionTraceBuilder_; - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public boolean hasGraphExecutionTrace() { - return whatCase_ == 10; - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public org.tensorflow.proto.util.GraphExecutionTrace getGraphExecutionTrace() { - if (graphExecutionTraceBuilder_ == null) { - if (whatCase_ == 10) { - return (org.tensorflow.proto.util.GraphExecutionTrace) what_; - } - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } else { - if (whatCase_ == 10) { - return graphExecutionTraceBuilder_.getMessage(); - } - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public Builder setGraphExecutionTrace(org.tensorflow.proto.util.GraphExecutionTrace value) { - if (graphExecutionTraceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - graphExecutionTraceBuilder_.setMessage(value); - } - whatCase_ = 10; - return this; - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public Builder setGraphExecutionTrace( - org.tensorflow.proto.util.GraphExecutionTrace.Builder builderForValue) { - if (graphExecutionTraceBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - graphExecutionTraceBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 10; - return this; - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public Builder mergeGraphExecutionTrace(org.tensorflow.proto.util.GraphExecutionTrace value) { - if (graphExecutionTraceBuilder_ == null) { - if (whatCase_ == 10 && - what_ != org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.GraphExecutionTrace.newBuilder((org.tensorflow.proto.util.GraphExecutionTrace) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 10) { - graphExecutionTraceBuilder_.mergeFrom(value); - } - graphExecutionTraceBuilder_.setMessage(value); - } - whatCase_ = 10; - return this; - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public Builder clearGraphExecutionTrace() { - if (graphExecutionTraceBuilder_ == null) { - if (whatCase_ == 10) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 10) { - whatCase_ = 0; - what_ = null; - } - graphExecutionTraceBuilder_.clear(); - } - return this; - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public org.tensorflow.proto.util.GraphExecutionTrace.Builder getGraphExecutionTraceBuilder() { - return getGraphExecutionTraceFieldBuilder().getBuilder(); - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - public org.tensorflow.proto.util.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder() { - if ((whatCase_ == 10) && (graphExecutionTraceBuilder_ != null)) { - return graphExecutionTraceBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 10) { - return (org.tensorflow.proto.util.GraphExecutionTrace) what_; - } - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - } - /** - *
    -     * A graph execution trace: Contains information about the intermediate
    -     * tensors computed during the graph execution.
    -     * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphExecutionTrace, org.tensorflow.proto.util.GraphExecutionTrace.Builder, org.tensorflow.proto.util.GraphExecutionTraceOrBuilder> - getGraphExecutionTraceFieldBuilder() { - if (graphExecutionTraceBuilder_ == null) { - if (!(whatCase_ == 10)) { - what_ = org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - graphExecutionTraceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.GraphExecutionTrace, org.tensorflow.proto.util.GraphExecutionTrace.Builder, org.tensorflow.proto.util.GraphExecutionTraceOrBuilder>( - (org.tensorflow.proto.util.GraphExecutionTrace) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 10; - onChanged();; - return graphExecutionTraceBuilder_; - } - - /** - *
    -     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -     * to the execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 11; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = ""; - if (whatCase_ == 11) { - ref = what_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (whatCase_ == 11) { - what_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -     * to the execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 11; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = ""; - if (whatCase_ == 11) { - ref = what_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (whatCase_ == 11) { - what_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -     * to the execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 11; - */ - public Builder setGraphId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - whatCase_ = 11; - what_ = value; - onChanged(); - return this; - } - /** - *
    -     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -     * to the execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 11; - */ - public Builder clearGraphId() { - if (whatCase_ == 11) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - return this; - } - /** - *
    -     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -     * to the execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 11; - */ - public Builder setGraphIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - whatCase_ = 11; - what_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedDevice, org.tensorflow.proto.util.DebuggedDevice.Builder, org.tensorflow.proto.util.DebuggedDeviceOrBuilder> debuggedDeviceBuilder_; - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public boolean hasDebuggedDevice() { - return whatCase_ == 12; - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public org.tensorflow.proto.util.DebuggedDevice getDebuggedDevice() { - if (debuggedDeviceBuilder_ == null) { - if (whatCase_ == 12) { - return (org.tensorflow.proto.util.DebuggedDevice) what_; - } - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } else { - if (whatCase_ == 12) { - return debuggedDeviceBuilder_.getMessage(); - } - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public Builder setDebuggedDevice(org.tensorflow.proto.util.DebuggedDevice value) { - if (debuggedDeviceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - debuggedDeviceBuilder_.setMessage(value); - } - whatCase_ = 12; - return this; - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public Builder setDebuggedDevice( - org.tensorflow.proto.util.DebuggedDevice.Builder builderForValue) { - if (debuggedDeviceBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - debuggedDeviceBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 12; - return this; - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public Builder mergeDebuggedDevice(org.tensorflow.proto.util.DebuggedDevice value) { - if (debuggedDeviceBuilder_ == null) { - if (whatCase_ == 12 && - what_ != org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.DebuggedDevice.newBuilder((org.tensorflow.proto.util.DebuggedDevice) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 12) { - debuggedDeviceBuilder_.mergeFrom(value); - } - debuggedDeviceBuilder_.setMessage(value); - } - whatCase_ = 12; - return this; - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public Builder clearDebuggedDevice() { - if (debuggedDeviceBuilder_ == null) { - if (whatCase_ == 12) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 12) { - whatCase_ = 0; - what_ = null; - } - debuggedDeviceBuilder_.clear(); - } - return this; - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public org.tensorflow.proto.util.DebuggedDevice.Builder getDebuggedDeviceBuilder() { - return getDebuggedDeviceFieldBuilder().getBuilder(); - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - public org.tensorflow.proto.util.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder() { - if ((whatCase_ == 12) && (debuggedDeviceBuilder_ != null)) { - return debuggedDeviceBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 12) { - return (org.tensorflow.proto.util.DebuggedDevice) what_; - } - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - } - /** - *
    -     * A device on which debugger-instrumented ops and/or tensors reside.
    -     * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedDevice, org.tensorflow.proto.util.DebuggedDevice.Builder, org.tensorflow.proto.util.DebuggedDeviceOrBuilder> - getDebuggedDeviceFieldBuilder() { - if (debuggedDeviceBuilder_ == null) { - if (!(whatCase_ == 12)) { - what_ = org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - debuggedDeviceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.DebuggedDevice, org.tensorflow.proto.util.DebuggedDevice.Builder, org.tensorflow.proto.util.DebuggedDeviceOrBuilder>( - (org.tensorflow.proto.util.DebuggedDevice) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 12; - onChanged();; - return debuggedDeviceBuilder_; - } - @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.DebugEvent) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebugEvent) - private static final org.tensorflow.proto.util.DebugEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.DebugEvent(); - } - - public static org.tensorflow.proto.util.DebugEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebugEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebugEvent(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.util.DebugEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventOrBuilder.java deleted file mode 100644 index dd322c5d995..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventOrBuilder.java +++ /dev/null @@ -1,258 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -public interface DebugEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.DebugEvent) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Timestamp in seconds (with microsecond precision).
    -   * 
    - * - * double wall_time = 1; - */ - double getWallTime(); - - /** - *
    -   * Step of training (if available).
    -   * 
    - * - * int64 step = 2; - */ - long getStep(); - - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - boolean hasDebugMetadata(); - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - org.tensorflow.proto.util.DebugMetadata getDebugMetadata(); - /** - *
    -   * Metadata related to this debugging data.
    -   * 
    - * - * .tensorflow.DebugMetadata debug_metadata = 3; - */ - org.tensorflow.proto.util.DebugMetadataOrBuilder getDebugMetadataOrBuilder(); - - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - boolean hasSourceFile(); - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - org.tensorflow.proto.util.SourceFile getSourceFile(); - /** - *
    -   * The content of a source file.
    -   * 
    - * - * .tensorflow.SourceFile source_file = 4; - */ - org.tensorflow.proto.util.SourceFileOrBuilder getSourceFileOrBuilder(); - - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - boolean hasStackFrameWithId(); - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - org.tensorflow.proto.util.StackFrameWithId getStackFrameWithId(); - /** - *
    -   * A stack frame (filename, line number and column number, function name and
    -   * code string) with ID.
    -   * 
    - * - * .tensorflow.StackFrameWithId stack_frame_with_id = 6; - */ - org.tensorflow.proto.util.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder(); - - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - boolean hasGraphOpCreation(); - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - org.tensorflow.proto.util.GraphOpCreation getGraphOpCreation(); - /** - *
    -   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    -   * a Python function).
    -   * 
    - * - * .tensorflow.GraphOpCreation graph_op_creation = 7; - */ - org.tensorflow.proto.util.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder(); - - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - boolean hasDebuggedGraph(); - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - org.tensorflow.proto.util.DebuggedGraph getDebuggedGraph(); - /** - *
    -   * Information about a debugged graph.
    -   * 
    - * - * .tensorflow.DebuggedGraph debugged_graph = 8; - */ - org.tensorflow.proto.util.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder(); - - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - boolean hasExecution(); - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - org.tensorflow.proto.util.Execution getExecution(); - /** - *
    -   * Execution of an op or a Graph (e.g., a tf.function).
    -   * 
    - * - * .tensorflow.Execution execution = 9; - */ - org.tensorflow.proto.util.ExecutionOrBuilder getExecutionOrBuilder(); - - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - boolean hasGraphExecutionTrace(); - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - org.tensorflow.proto.util.GraphExecutionTrace getGraphExecutionTrace(); - /** - *
    -   * A graph execution trace: Contains information about the intermediate
    -   * tensors computed during the graph execution.
    -   * 
    - * - * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; - */ - org.tensorflow.proto.util.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder(); - - /** - *
    -   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -   * to the execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 11; - */ - java.lang.String getGraphId(); - /** - *
    -   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    -   * to the execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 11; - */ - com.google.protobuf.ByteString - getGraphIdBytes(); - - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - boolean hasDebuggedDevice(); - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - org.tensorflow.proto.util.DebuggedDevice getDebuggedDevice(); - /** - *
    -   * A device on which debugger-instrumented ops and/or tensors reside.
    -   * 
    - * - * .tensorflow.DebuggedDevice debugged_device = 12; - */ - org.tensorflow.proto.util.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder(); - - public org.tensorflow.proto.util.DebugEvent.WhatCase getWhatCase(); -} 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 deleted file mode 100644 index 52b391e8520..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugEventProtos.java +++ /dev/null @@ -1,206 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -public final class DebugEventProtos { - private DebugEventProtos() {} - 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_DebugEvent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DebugEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DebugMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DebugMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SourceFile_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SourceFile_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_StackFrameWithId_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_StackFrameWithId_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CodeLocation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CodeLocation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphOpCreation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphOpCreation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DebuggedGraph_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DebuggedGraph_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_DebuggedDevice_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_DebuggedDevice_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_Execution_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Execution_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GraphExecutionTrace_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GraphExecutionTrace_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/debug_event.p" + - "roto\022\ntensorflow\032&tensorflow/core/framew" + - "ork/tensor.proto\032/tensorflow/core/protob" + - "uf/graph_debug_info.proto\"\376\003\n\nDebugEvent" + - "\022\021\n\twall_time\030\001 \001(\001\022\014\n\004step\030\002 \001(\003\0223\n\016deb" + - "ug_metadata\030\003 \001(\0132\031.tensorflow.DebugMeta" + - "dataH\000\022-\n\013source_file\030\004 \001(\0132\026.tensorflow" + - ".SourceFileH\000\022;\n\023stack_frame_with_id\030\006 \001" + - "(\0132\034.tensorflow.StackFrameWithIdH\000\0228\n\021gr" + - "aph_op_creation\030\007 \001(\0132\033.tensorflow.Graph" + - "OpCreationH\000\0223\n\016debugged_graph\030\010 \001(\0132\031.t" + - "ensorflow.DebuggedGraphH\000\022*\n\texecution\030\t" + - " \001(\0132\025.tensorflow.ExecutionH\000\022@\n\025graph_e" + - "xecution_trace\030\n \001(\0132\037.tensorflow.GraphE" + - "xecutionTraceH\000\022\022\n\010graph_id\030\013 \001(\tH\000\0225\n\017d" + - "ebugged_device\030\014 \001(\0132\032.tensorflow.Debugg" + - "edDeviceH\000B\006\n\004what\"W\n\rDebugMetadata\022\032\n\022t" + - "ensorflow_version\030\001 \001(\t\022\024\n\014file_version\030" + - "\002 \001(\t\022\024\n\014tfdbg_run_id\030\003 \001(\t\"A\n\nSourceFil" + - "e\022\021\n\tfile_path\030\001 \001(\t\022\021\n\thost_name\030\002 \001(\t\022" + - "\r\n\005lines\030\003 \003(\t\"]\n\020StackFrameWithId\022\n\n\002id" + - "\030\001 \001(\t\022=\n\rfile_line_col\030\002 \001(\0132&.tensorfl" + - "ow.GraphDebugInfo.FileLineCol\":\n\014CodeLoc" + - "ation\022\021\n\thost_name\030\001 \001(\t\022\027\n\017stack_frame_" + - "ids\030\002 \003(\t\"\344\001\n\017GraphOpCreation\022\017\n\007op_type" + - "\030\001 \001(\t\022\017\n\007op_name\030\002 \001(\t\022\022\n\ngraph_name\030\003 " + - "\001(\t\022\020\n\010graph_id\030\004 \001(\t\022\023\n\013device_name\030\005 \001" + - "(\t\022\023\n\013input_names\030\006 \003(\t\022\023\n\013num_outputs\030\007" + - " \001(\005\022/\n\rcode_location\030\010 \001(\0132\030.tensorflow" + - ".CodeLocation\022\031\n\021output_tensor_ids\030\t \003(\005" + - "\"\245\001\n\rDebuggedGraph\022\020\n\010graph_id\030\001 \001(\t\022\022\n\n" + - "graph_name\030\002 \001(\t\022\030\n\020instrumented_ops\030\003 \003" + - "(\t\022\032\n\022original_graph_def\030\004 \001(\014\022\036\n\026instru" + - "mented_graph_def\030\005 \001(\014\022\030\n\020outer_context_" + - "id\030\006 \001(\t\"8\n\016DebuggedDevice\022\023\n\013device_nam" + - "e\030\001 \001(\t\022\021\n\tdevice_id\030\002 \001(\005\"\263\002\n\tExecution" + - "\022\017\n\007op_type\030\001 \001(\t\022\023\n\013num_outputs\030\002 \001(\005\022\020" + - "\n\010graph_id\030\003 \001(\t\022\030\n\020input_tensor_ids\030\004 \003" + - "(\003\022\031\n\021output_tensor_ids\030\005 \003(\003\0226\n\021tensor_" + - "debug_mode\030\006 \001(\0162\033.tensorflow.TensorDebu" + - "gMode\022.\n\rtensor_protos\030\007 \003(\0132\027.tensorflo" + - "w.TensorProto\022/\n\rcode_location\030\010 \001(\0132\030.t" + - "ensorflow.CodeLocation\022 \n\030output_tensor_" + - "device_ids\030\t \003(\005\"\321\001\n\023GraphExecutionTrace" + - "\022\030\n\020tfdbg_context_id\030\001 \001(\t\022\017\n\007op_name\030\002 " + - "\001(\t\022\023\n\013output_slot\030\003 \001(\005\0226\n\021tensor_debug" + - "_mode\030\004 \001(\0162\033.tensorflow.TensorDebugMode" + - "\022-\n\014tensor_proto\030\005 \001(\0132\027.tensorflow.Tens" + - "orProto\022\023\n\013device_name\030\006 \001(\t*\266\001\n\017TensorD" + - "ebugMode\022\017\n\013UNSPECIFIED\020\000\022\r\n\tNO_TENSOR\020\001" + - "\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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.GraphDebugInfoProtos.getDescriptor(), - }); - internal_static_tensorflow_DebugEvent_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_DebugEvent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DebugEvent_descriptor, - new java.lang.String[] { "WallTime", "Step", "DebugMetadata", "SourceFile", "StackFrameWithId", "GraphOpCreation", "DebuggedGraph", "Execution", "GraphExecutionTrace", "GraphId", "DebuggedDevice", "What", }); - internal_static_tensorflow_DebugMetadata_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_DebugMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DebugMetadata_descriptor, - new java.lang.String[] { "TensorflowVersion", "FileVersion", "TfdbgRunId", }); - internal_static_tensorflow_SourceFile_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_SourceFile_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SourceFile_descriptor, - new java.lang.String[] { "FilePath", "HostName", "Lines", }); - internal_static_tensorflow_StackFrameWithId_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_StackFrameWithId_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_StackFrameWithId_descriptor, - new java.lang.String[] { "Id", "FileLineCol", }); - internal_static_tensorflow_CodeLocation_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_CodeLocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CodeLocation_descriptor, - new java.lang.String[] { "HostName", "StackFrameIds", }); - internal_static_tensorflow_GraphOpCreation_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_GraphOpCreation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphOpCreation_descriptor, - new java.lang.String[] { "OpType", "OpName", "GraphName", "GraphId", "DeviceName", "InputNames", "NumOutputs", "CodeLocation", "OutputTensorIds", }); - internal_static_tensorflow_DebuggedGraph_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_DebuggedGraph_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DebuggedGraph_descriptor, - new java.lang.String[] { "GraphId", "GraphName", "InstrumentedOps", "OriginalGraphDef", "InstrumentedGraphDef", "OuterContextId", }); - internal_static_tensorflow_DebuggedDevice_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_DebuggedDevice_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_DebuggedDevice_descriptor, - new java.lang.String[] { "DeviceName", "DeviceId", }); - internal_static_tensorflow_Execution_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_tensorflow_Execution_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Execution_descriptor, - new java.lang.String[] { "OpType", "NumOutputs", "GraphId", "InputTensorIds", "OutputTensorIds", "TensorDebugMode", "TensorProtos", "CodeLocation", "OutputTensorDeviceIds", }); - internal_static_tensorflow_GraphExecutionTrace_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GraphExecutionTrace_descriptor, - new java.lang.String[] { "TfdbgContextId", "OpName", "OutputSlot", "TensorDebugMode", "TensorProto", "DeviceName", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.GraphDebugInfoProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadata.java deleted file mode 100644 index e0679182c6e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadata.java +++ /dev/null @@ -1,920 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Metadata about the debugger and the debugged TensorFlow program.
    - * 
    - * - * Protobuf type {@code tensorflow.DebugMetadata} - */ -public final class DebugMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebugMetadata) - DebugMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebugMetadata.newBuilder() to construct. - private DebugMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebugMetadata() { - tensorflowVersion_ = ""; - fileVersion_ = ""; - tfdbgRunId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebugMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebugMetadata( - 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(); - - tensorflowVersion_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - fileVersion_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - tfdbgRunId_ = s; - 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.util.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebugMetadata.class, org.tensorflow.proto.util.DebugMetadata.Builder.class); - } - - public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 1; - private volatile java.lang.Object tensorflowVersion_; - /** - *
    -   * Version of TensorFlow.
    -   * 
    - * - * string tensorflow_version = 1; - */ - public java.lang.String getTensorflowVersion() { - java.lang.Object ref = tensorflowVersion_; - 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(); - tensorflowVersion_ = s; - return s; - } - } - /** - *
    -   * Version of TensorFlow.
    -   * 
    - * - * string tensorflow_version = 1; - */ - public com.google.protobuf.ByteString - getTensorflowVersionBytes() { - java.lang.Object ref = tensorflowVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILE_VERSION_FIELD_NUMBER = 2; - private volatile java.lang.Object fileVersion_; - /** - *
    -   * Version of the DebugEvent file format.
    -   * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -   * 
    - * - * string file_version = 2; - */ - public java.lang.String getFileVersion() { - java.lang.Object ref = fileVersion_; - 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(); - fileVersion_ = s; - return s; - } - } - /** - *
    -   * Version of the DebugEvent file format.
    -   * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -   * 
    - * - * string file_version = 2; - */ - public com.google.protobuf.ByteString - getFileVersionBytes() { - java.lang.Object ref = fileVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fileVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TFDBG_RUN_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object tfdbgRunId_; - /** - *
    -   * A unique ID for the current run of tfdbg.
    -   * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -   * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -   * have the same ID.
    -   * 
    - * - * string tfdbg_run_id = 3; - */ - public java.lang.String getTfdbgRunId() { - java.lang.Object ref = tfdbgRunId_; - 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(); - tfdbgRunId_ = s; - return s; - } - } - /** - *
    -   * A unique ID for the current run of tfdbg.
    -   * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -   * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -   * have the same ID.
    -   * 
    - * - * string tfdbg_run_id = 3; - */ - public com.google.protobuf.ByteString - getTfdbgRunIdBytes() { - java.lang.Object ref = tfdbgRunId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfdbgRunId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getTensorflowVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tensorflowVersion_); - } - if (!getFileVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fileVersion_); - } - if (!getTfdbgRunIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tfdbgRunId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTensorflowVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tensorflowVersion_); - } - if (!getFileVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fileVersion_); - } - if (!getTfdbgRunIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tfdbgRunId_); - } - 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.util.DebugMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.util.DebugMetadata other = (org.tensorflow.proto.util.DebugMetadata) obj; - - if (!getTensorflowVersion() - .equals(other.getTensorflowVersion())) return false; - if (!getFileVersion() - .equals(other.getFileVersion())) return false; - if (!getTfdbgRunId() - .equals(other.getTfdbgRunId())) 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) + TENSORFLOW_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getTensorflowVersion().hashCode(); - hash = (37 * hash) + FILE_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getFileVersion().hashCode(); - hash = (37 * hash) + TFDBG_RUN_ID_FIELD_NUMBER; - hash = (53 * hash) + getTfdbgRunId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.DebugMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugMetadata 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.DebugMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugMetadata 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.DebugMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebugMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.DebugMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugMetadata 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.DebugMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugMetadata 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.DebugMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebugMetadata 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.util.DebugMetadata 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; - } - /** - *
    -   * Metadata about the debugger and the debugged TensorFlow program.
    -   * 
    - * - * Protobuf type {@code tensorflow.DebugMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebugMetadata) - org.tensorflow.proto.util.DebugMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebugMetadata.class, org.tensorflow.proto.util.DebugMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.util.DebugMetadata.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(); - tensorflowVersion_ = ""; - - fileVersion_ = ""; - - tfdbgRunId_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.util.DebugMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugMetadata build() { - org.tensorflow.proto.util.DebugMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebugMetadata buildPartial() { - org.tensorflow.proto.util.DebugMetadata result = new org.tensorflow.proto.util.DebugMetadata(this); - result.tensorflowVersion_ = tensorflowVersion_; - result.fileVersion_ = fileVersion_; - result.tfdbgRunId_ = tfdbgRunId_; - 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.util.DebugMetadata) { - return mergeFrom((org.tensorflow.proto.util.DebugMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.DebugMetadata other) { - if (other == org.tensorflow.proto.util.DebugMetadata.getDefaultInstance()) return this; - if (!other.getTensorflowVersion().isEmpty()) { - tensorflowVersion_ = other.tensorflowVersion_; - onChanged(); - } - if (!other.getFileVersion().isEmpty()) { - fileVersion_ = other.fileVersion_; - onChanged(); - } - if (!other.getTfdbgRunId().isEmpty()) { - tfdbgRunId_ = other.tfdbgRunId_; - onChanged(); - } - 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.util.DebugMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.DebugMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object tensorflowVersion_ = ""; - /** - *
    -     * Version of TensorFlow.
    -     * 
    - * - * string tensorflow_version = 1; - */ - public java.lang.String getTensorflowVersion() { - java.lang.Object ref = tensorflowVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tensorflowVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Version of TensorFlow.
    -     * 
    - * - * string tensorflow_version = 1; - */ - public com.google.protobuf.ByteString - getTensorflowVersionBytes() { - java.lang.Object ref = tensorflowVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tensorflowVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Version of TensorFlow.
    -     * 
    - * - * string tensorflow_version = 1; - */ - public Builder setTensorflowVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorflowVersion_ = value; - onChanged(); - return this; - } - /** - *
    -     * Version of TensorFlow.
    -     * 
    - * - * string tensorflow_version = 1; - */ - public Builder clearTensorflowVersion() { - - tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); - onChanged(); - return this; - } - /** - *
    -     * Version of TensorFlow.
    -     * 
    - * - * string tensorflow_version = 1; - */ - public Builder setTensorflowVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tensorflowVersion_ = value; - onChanged(); - return this; - } - - private java.lang.Object fileVersion_ = ""; - /** - *
    -     * Version of the DebugEvent file format.
    -     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -     * 
    - * - * string file_version = 2; - */ - public java.lang.String getFileVersion() { - java.lang.Object ref = fileVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fileVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Version of the DebugEvent file format.
    -     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -     * 
    - * - * string file_version = 2; - */ - public com.google.protobuf.ByteString - getFileVersionBytes() { - java.lang.Object ref = fileVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fileVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Version of the DebugEvent file format.
    -     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -     * 
    - * - * string file_version = 2; - */ - public Builder setFileVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fileVersion_ = value; - onChanged(); - return this; - } - /** - *
    -     * Version of the DebugEvent file format.
    -     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -     * 
    - * - * string file_version = 2; - */ - public Builder clearFileVersion() { - - fileVersion_ = getDefaultInstance().getFileVersion(); - onChanged(); - return this; - } - /** - *
    -     * Version of the DebugEvent file format.
    -     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    -     * 
    - * - * string file_version = 2; - */ - public Builder setFileVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fileVersion_ = value; - onChanged(); - return this; - } - - private java.lang.Object tfdbgRunId_ = ""; - /** - *
    -     * A unique ID for the current run of tfdbg.
    -     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -     * have the same ID.
    -     * 
    - * - * string tfdbg_run_id = 3; - */ - public java.lang.String getTfdbgRunId() { - java.lang.Object ref = tfdbgRunId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tfdbgRunId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A unique ID for the current run of tfdbg.
    -     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -     * have the same ID.
    -     * 
    - * - * string tfdbg_run_id = 3; - */ - public com.google.protobuf.ByteString - getTfdbgRunIdBytes() { - java.lang.Object ref = tfdbgRunId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfdbgRunId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A unique ID for the current run of tfdbg.
    -     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -     * have the same ID.
    -     * 
    - * - * string tfdbg_run_id = 3; - */ - public Builder setTfdbgRunId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tfdbgRunId_ = value; - onChanged(); - return this; - } - /** - *
    -     * A unique ID for the current run of tfdbg.
    -     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -     * have the same ID.
    -     * 
    - * - * string tfdbg_run_id = 3; - */ - public Builder clearTfdbgRunId() { - - tfdbgRunId_ = getDefaultInstance().getTfdbgRunId(); - onChanged(); - return this; - } - /** - *
    -     * A unique ID for the current run of tfdbg.
    -     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    -     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    -     * have the same ID.
    -     * 
    - * - * string tfdbg_run_id = 3; - */ - public Builder setTfdbgRunIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tfdbgRunId_ = value; - 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.DebugMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebugMetadata) - private static final org.tensorflow.proto.util.DebugMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.DebugMetadata(); - } - - public static org.tensorflow.proto.util.DebugMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebugMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebugMetadata(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.util.DebugMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDevice.java deleted file mode 100644 index 18f528481cd..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDevice.java +++ /dev/null @@ -1,667 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * A device on which ops and/or tensors are instrumented by the debugger.
    - * 
    - * - * Protobuf type {@code tensorflow.DebuggedDevice} - */ -public final class DebuggedDevice extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebuggedDevice) - DebuggedDeviceOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebuggedDevice.newBuilder() to construct. - private DebuggedDevice(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebuggedDevice() { - deviceName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebuggedDevice(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebuggedDevice( - 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(); - - deviceName_ = s; - break; - } - case 16: { - - deviceId_ = input.readInt32(); - 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.util.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebuggedDevice.class, org.tensorflow.proto.util.DebuggedDevice.Builder.class); - } - - public static final int DEVICE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object deviceName_; - /** - *
    -   * Name of the device.
    -   * 
    - * - * string device_name = 1; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - 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(); - deviceName_ = s; - return s; - } - } - /** - *
    -   * Name of the device.
    -   * 
    - * - * string device_name = 1; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private int deviceId_; - /** - *
    -   * A debugger-generated ID for the device. Guaranteed to be unique within
    -   * the scope of the debugged TensorFlow program, including single-host and
    -   * multi-host settings.
    -   * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    -   * 
    - * - * int32 device_id = 2; - */ - public int getDeviceId() { - return deviceId_; - } - - 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 (!getDeviceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deviceName_); - } - if (deviceId_ != 0) { - output.writeInt32(2, deviceId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDeviceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, deviceName_); - } - if (deviceId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, deviceId_); - } - 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.util.DebuggedDevice)) { - return super.equals(obj); - } - org.tensorflow.proto.util.DebuggedDevice other = (org.tensorflow.proto.util.DebuggedDevice) obj; - - if (!getDeviceName() - .equals(other.getDeviceName())) return false; - if (getDeviceId() - != other.getDeviceId()) 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_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDeviceName().hashCode(); - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.DebuggedDevice parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedDevice 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.DebuggedDevice parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedDevice 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.DebuggedDevice parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedDevice parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.DebuggedDevice parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedDevice 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.DebuggedDevice parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedDevice 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.DebuggedDevice parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedDevice 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.util.DebuggedDevice 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 on which ops and/or tensors are instrumented by the debugger.
    -   * 
    - * - * Protobuf type {@code tensorflow.DebuggedDevice} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedDevice) - org.tensorflow.proto.util.DebuggedDeviceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebuggedDevice.class, org.tensorflow.proto.util.DebuggedDevice.Builder.class); - } - - // Construct using org.tensorflow.proto.util.DebuggedDevice.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(); - deviceName_ = ""; - - deviceId_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedDevice getDefaultInstanceForType() { - return org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedDevice build() { - org.tensorflow.proto.util.DebuggedDevice result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedDevice buildPartial() { - org.tensorflow.proto.util.DebuggedDevice result = new org.tensorflow.proto.util.DebuggedDevice(this); - result.deviceName_ = deviceName_; - result.deviceId_ = deviceId_; - 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.util.DebuggedDevice) { - return mergeFrom((org.tensorflow.proto.util.DebuggedDevice)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.DebuggedDevice other) { - if (other == org.tensorflow.proto.util.DebuggedDevice.getDefaultInstance()) return this; - if (!other.getDeviceName().isEmpty()) { - deviceName_ = other.deviceName_; - onChanged(); - } - if (other.getDeviceId() != 0) { - setDeviceId(other.getDeviceId()); - } - 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.util.DebuggedDevice parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.DebuggedDevice) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object deviceName_ = ""; - /** - *
    -     * Name of the device.
    -     * 
    - * - * string device_name = 1; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the device.
    -     * 
    - * - * string device_name = 1; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the device.
    -     * 
    - * - * string device_name = 1; - */ - public Builder setDeviceName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the device.
    -     * 
    - * - * string device_name = 1; - */ - public Builder clearDeviceName() { - - deviceName_ = getDefaultInstance().getDeviceName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the device.
    -     * 
    - * - * string device_name = 1; - */ - public Builder setDeviceNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceName_ = value; - onChanged(); - return this; - } - - private int deviceId_ ; - /** - *
    -     * A debugger-generated ID for the device. Guaranteed to be unique within
    -     * the scope of the debugged TensorFlow program, including single-host and
    -     * multi-host settings.
    -     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    -     * 
    - * - * int32 device_id = 2; - */ - public int getDeviceId() { - return deviceId_; - } - /** - *
    -     * A debugger-generated ID for the device. Guaranteed to be unique within
    -     * the scope of the debugged TensorFlow program, including single-host and
    -     * multi-host settings.
    -     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    -     * 
    - * - * int32 device_id = 2; - */ - public Builder setDeviceId(int value) { - - deviceId_ = value; - onChanged(); - return this; - } - /** - *
    -     * A debugger-generated ID for the device. Guaranteed to be unique within
    -     * the scope of the debugged TensorFlow program, including single-host and
    -     * multi-host settings.
    -     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    -     * 
    - * - * int32 device_id = 2; - */ - public Builder clearDeviceId() { - - deviceId_ = 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.DebuggedDevice) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebuggedDevice) - private static final org.tensorflow.proto.util.DebuggedDevice DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.DebuggedDevice(); - } - - public static org.tensorflow.proto.util.DebuggedDevice getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebuggedDevice parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebuggedDevice(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.util.DebuggedDevice getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraph.java deleted file mode 100644 index 6fa3e5adcff..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraph.java +++ /dev/null @@ -1,1295 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * A debugger-instrumented graph.
    - * 
    - * - * Protobuf type {@code tensorflow.DebuggedGraph} - */ -public final class DebuggedGraph extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.DebuggedGraph) - DebuggedGraphOrBuilder { -private static final long serialVersionUID = 0L; - // Use DebuggedGraph.newBuilder() to construct. - private DebuggedGraph(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DebuggedGraph() { - graphId_ = ""; - graphName_ = ""; - instrumentedOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; - instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; - outerContextId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DebuggedGraph(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DebuggedGraph( - 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(); - - graphId_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - graphName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - instrumentedOps_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - instrumentedOps_.add(s); - break; - } - case 34: { - - originalGraphDef_ = input.readBytes(); - break; - } - case 42: { - - instrumentedGraphDef_ = input.readBytes(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - outerContextId_ = s; - 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)) { - instrumentedOps_ = instrumentedOps_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebuggedGraph.class, org.tensorflow.proto.util.DebuggedGraph.Builder.class); - } - - public static final int GRAPH_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object graphId_; - /** - *
    -   * An ID for the graph.
    -   * This can be used up to look up graph names. Generated by the debugger.
    -   * 
    - * - * string graph_id = 1; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - 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(); - graphId_ = s; - return s; - } - } - /** - *
    -   * An ID for the graph.
    -   * This can be used up to look up graph names. Generated by the debugger.
    -   * 
    - * - * string graph_id = 1; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPH_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object graphName_; - /** - *
    -   * Name of the graph (if available).
    -   * 
    - * - * string graph_name = 2; - */ - public java.lang.String getGraphName() { - java.lang.Object ref = graphName_; - 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(); - graphName_ = s; - return s; - } - } - /** - *
    -   * Name of the graph (if available).
    -   * 
    - * - * string graph_name = 2; - */ - public com.google.protobuf.ByteString - getGraphNameBytes() { - java.lang.Object ref = graphName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INSTRUMENTED_OPS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList instrumentedOps_; - /** - *
    -   * Names of the instrumented ops. This can be used to look up op name
    -   * based on the numeric-summary tensors (2nd column).
    -   * 
    - * - * repeated string instrumented_ops = 3; - */ - public com.google.protobuf.ProtocolStringList - getInstrumentedOpsList() { - return instrumentedOps_; - } - /** - *
    -   * Names of the instrumented ops. This can be used to look up op name
    -   * based on the numeric-summary tensors (2nd column).
    -   * 
    - * - * repeated string instrumented_ops = 3; - */ - public int getInstrumentedOpsCount() { - return instrumentedOps_.size(); - } - /** - *
    -   * Names of the instrumented ops. This can be used to look up op name
    -   * based on the numeric-summary tensors (2nd column).
    -   * 
    - * - * repeated string instrumented_ops = 3; - */ - public java.lang.String getInstrumentedOps(int index) { - return instrumentedOps_.get(index); - } - /** - *
    -   * Names of the instrumented ops. This can be used to look up op name
    -   * based on the numeric-summary tensors (2nd column).
    -   * 
    - * - * repeated string instrumented_ops = 3; - */ - public com.google.protobuf.ByteString - getInstrumentedOpsBytes(int index) { - return instrumentedOps_.getByteString(index); - } - - public static final int ORIGINAL_GRAPH_DEF_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString originalGraphDef_; - /** - *
    -   * Original (uninstrumented) GraphDef (if available).
    -   * 
    - * - * bytes original_graph_def = 4; - */ - public com.google.protobuf.ByteString getOriginalGraphDef() { - return originalGraphDef_; - } - - public static final int INSTRUMENTED_GRAPH_DEF_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString instrumentedGraphDef_; - /** - *
    -   * An encoded version of a GraphDef.
    -   * This graph may include the debugger-inserted ops.
    -   * 
    - * - * bytes instrumented_graph_def = 5; - */ - public com.google.protobuf.ByteString getInstrumentedGraphDef() { - return instrumentedGraphDef_; - } - - public static final int OUTER_CONTEXT_ID_FIELD_NUMBER = 6; - private volatile java.lang.Object outerContextId_; - /** - *
    -   * IDs of the immediate enclosing context (graph), if any.
    -   * 
    - * - * string outer_context_id = 6; - */ - public java.lang.String getOuterContextId() { - java.lang.Object ref = outerContextId_; - 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(); - outerContextId_ = s; - return s; - } - } - /** - *
    -   * IDs of the immediate enclosing context (graph), if any.
    -   * 
    - * - * string outer_context_id = 6; - */ - public com.google.protobuf.ByteString - getOuterContextIdBytes() { - java.lang.Object ref = outerContextId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - outerContextId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getGraphIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, graphId_); - } - if (!getGraphNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, graphName_); - } - for (int i = 0; i < instrumentedOps_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, instrumentedOps_.getRaw(i)); - } - if (!originalGraphDef_.isEmpty()) { - output.writeBytes(4, originalGraphDef_); - } - if (!instrumentedGraphDef_.isEmpty()) { - output.writeBytes(5, instrumentedGraphDef_); - } - if (!getOuterContextIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, outerContextId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGraphIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, graphId_); - } - if (!getGraphNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, graphName_); - } - { - int dataSize = 0; - for (int i = 0; i < instrumentedOps_.size(); i++) { - dataSize += computeStringSizeNoTag(instrumentedOps_.getRaw(i)); - } - size += dataSize; - size += 1 * getInstrumentedOpsList().size(); - } - if (!originalGraphDef_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, originalGraphDef_); - } - if (!instrumentedGraphDef_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, instrumentedGraphDef_); - } - if (!getOuterContextIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, outerContextId_); - } - 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.util.DebuggedGraph)) { - return super.equals(obj); - } - org.tensorflow.proto.util.DebuggedGraph other = (org.tensorflow.proto.util.DebuggedGraph) obj; - - if (!getGraphId() - .equals(other.getGraphId())) return false; - if (!getGraphName() - .equals(other.getGraphName())) return false; - if (!getInstrumentedOpsList() - .equals(other.getInstrumentedOpsList())) return false; - if (!getOriginalGraphDef() - .equals(other.getOriginalGraphDef())) return false; - if (!getInstrumentedGraphDef() - .equals(other.getInstrumentedGraphDef())) return false; - if (!getOuterContextId() - .equals(other.getOuterContextId())) 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) + GRAPH_ID_FIELD_NUMBER; - hash = (53 * hash) + getGraphId().hashCode(); - hash = (37 * hash) + GRAPH_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphName().hashCode(); - if (getInstrumentedOpsCount() > 0) { - hash = (37 * hash) + INSTRUMENTED_OPS_FIELD_NUMBER; - hash = (53 * hash) + getInstrumentedOpsList().hashCode(); - } - hash = (37 * hash) + ORIGINAL_GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getOriginalGraphDef().hashCode(); - hash = (37 * hash) + INSTRUMENTED_GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getInstrumentedGraphDef().hashCode(); - hash = (37 * hash) + OUTER_CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getOuterContextId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.DebuggedGraph parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedGraph 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.DebuggedGraph parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedGraph 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.DebuggedGraph parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.DebuggedGraph parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.DebuggedGraph parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedGraph 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.DebuggedGraph parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedGraph 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.DebuggedGraph parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.DebuggedGraph 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.util.DebuggedGraph 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 debugger-instrumented graph.
    -   * 
    - * - * Protobuf type {@code tensorflow.DebuggedGraph} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedGraph) - org.tensorflow.proto.util.DebuggedGraphOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.DebuggedGraph.class, org.tensorflow.proto.util.DebuggedGraph.Builder.class); - } - - // Construct using org.tensorflow.proto.util.DebuggedGraph.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(); - graphId_ = ""; - - graphName_ = ""; - - instrumentedOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; - - instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; - - outerContextId_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedGraph getDefaultInstanceForType() { - return org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedGraph build() { - org.tensorflow.proto.util.DebuggedGraph result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.DebuggedGraph buildPartial() { - org.tensorflow.proto.util.DebuggedGraph result = new org.tensorflow.proto.util.DebuggedGraph(this); - int from_bitField0_ = bitField0_; - result.graphId_ = graphId_; - result.graphName_ = graphName_; - if (((bitField0_ & 0x00000001) != 0)) { - instrumentedOps_ = instrumentedOps_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.instrumentedOps_ = instrumentedOps_; - result.originalGraphDef_ = originalGraphDef_; - result.instrumentedGraphDef_ = instrumentedGraphDef_; - result.outerContextId_ = outerContextId_; - 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.util.DebuggedGraph) { - return mergeFrom((org.tensorflow.proto.util.DebuggedGraph)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.DebuggedGraph other) { - if (other == org.tensorflow.proto.util.DebuggedGraph.getDefaultInstance()) return this; - if (!other.getGraphId().isEmpty()) { - graphId_ = other.graphId_; - onChanged(); - } - if (!other.getGraphName().isEmpty()) { - graphName_ = other.graphName_; - onChanged(); - } - if (!other.instrumentedOps_.isEmpty()) { - if (instrumentedOps_.isEmpty()) { - instrumentedOps_ = other.instrumentedOps_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInstrumentedOpsIsMutable(); - instrumentedOps_.addAll(other.instrumentedOps_); - } - onChanged(); - } - if (other.getOriginalGraphDef() != com.google.protobuf.ByteString.EMPTY) { - setOriginalGraphDef(other.getOriginalGraphDef()); - } - if (other.getInstrumentedGraphDef() != com.google.protobuf.ByteString.EMPTY) { - setInstrumentedGraphDef(other.getInstrumentedGraphDef()); - } - if (!other.getOuterContextId().isEmpty()) { - outerContextId_ = other.outerContextId_; - onChanged(); - } - 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.util.DebuggedGraph parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.DebuggedGraph) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object graphId_ = ""; - /** - *
    -     * An ID for the graph.
    -     * This can be used up to look up graph names. Generated by the debugger.
    -     * 
    - * - * string graph_id = 1; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * An ID for the graph.
    -     * This can be used up to look up graph names. Generated by the debugger.
    -     * 
    - * - * string graph_id = 1; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * An ID for the graph.
    -     * This can be used up to look up graph names. Generated by the debugger.
    -     * 
    - * - * string graph_id = 1; - */ - public Builder setGraphId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphId_ = value; - onChanged(); - return this; - } - /** - *
    -     * An ID for the graph.
    -     * This can be used up to look up graph names. Generated by the debugger.
    -     * 
    - * - * string graph_id = 1; - */ - public Builder clearGraphId() { - - graphId_ = getDefaultInstance().getGraphId(); - onChanged(); - return this; - } - /** - *
    -     * An ID for the graph.
    -     * This can be used up to look up graph names. Generated by the debugger.
    -     * 
    - * - * string graph_id = 1; - */ - public Builder setGraphIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphId_ = value; - onChanged(); - return this; - } - - private java.lang.Object graphName_ = ""; - /** - *
    -     * Name of the graph (if available).
    -     * 
    - * - * string graph_name = 2; - */ - public java.lang.String getGraphName() { - java.lang.Object ref = graphName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the graph (if available).
    -     * 
    - * - * string graph_name = 2; - */ - public com.google.protobuf.ByteString - getGraphNameBytes() { - java.lang.Object ref = graphName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the graph (if available).
    -     * 
    - * - * string graph_name = 2; - */ - public Builder setGraphName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the graph (if available).
    -     * 
    - * - * string graph_name = 2; - */ - public Builder clearGraphName() { - - graphName_ = getDefaultInstance().getGraphName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the graph (if available).
    -     * 
    - * - * string graph_name = 2; - */ - public Builder setGraphNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList instrumentedOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureInstrumentedOpsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - instrumentedOps_ = new com.google.protobuf.LazyStringArrayList(instrumentedOps_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public com.google.protobuf.ProtocolStringList - getInstrumentedOpsList() { - return instrumentedOps_.getUnmodifiableView(); - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public int getInstrumentedOpsCount() { - return instrumentedOps_.size(); - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public java.lang.String getInstrumentedOps(int index) { - return instrumentedOps_.get(index); - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public com.google.protobuf.ByteString - getInstrumentedOpsBytes(int index) { - return instrumentedOps_.getByteString(index); - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public Builder setInstrumentedOps( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInstrumentedOpsIsMutable(); - instrumentedOps_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public Builder addInstrumentedOps( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInstrumentedOpsIsMutable(); - instrumentedOps_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public Builder addAllInstrumentedOps( - java.lang.Iterable values) { - ensureInstrumentedOpsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, instrumentedOps_); - onChanged(); - return this; - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public Builder clearInstrumentedOps() { - instrumentedOps_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Names of the instrumented ops. This can be used to look up op name
    -     * based on the numeric-summary tensors (2nd column).
    -     * 
    - * - * repeated string instrumented_ops = 3; - */ - public Builder addInstrumentedOpsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInstrumentedOpsIsMutable(); - instrumentedOps_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Original (uninstrumented) GraphDef (if available).
    -     * 
    - * - * bytes original_graph_def = 4; - */ - public com.google.protobuf.ByteString getOriginalGraphDef() { - return originalGraphDef_; - } - /** - *
    -     * Original (uninstrumented) GraphDef (if available).
    -     * 
    - * - * bytes original_graph_def = 4; - */ - public Builder setOriginalGraphDef(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - originalGraphDef_ = value; - onChanged(); - return this; - } - /** - *
    -     * Original (uninstrumented) GraphDef (if available).
    -     * 
    - * - * bytes original_graph_def = 4; - */ - public Builder clearOriginalGraphDef() { - - originalGraphDef_ = getDefaultInstance().getOriginalGraphDef(); - onChanged(); - return this; - } - - private com.google.protobuf.ByteString instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * An encoded version of a GraphDef.
    -     * This graph may include the debugger-inserted ops.
    -     * 
    - * - * bytes instrumented_graph_def = 5; - */ - public com.google.protobuf.ByteString getInstrumentedGraphDef() { - return instrumentedGraphDef_; - } - /** - *
    -     * An encoded version of a GraphDef.
    -     * This graph may include the debugger-inserted ops.
    -     * 
    - * - * bytes instrumented_graph_def = 5; - */ - public Builder setInstrumentedGraphDef(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - instrumentedGraphDef_ = value; - onChanged(); - return this; - } - /** - *
    -     * An encoded version of a GraphDef.
    -     * This graph may include the debugger-inserted ops.
    -     * 
    - * - * bytes instrumented_graph_def = 5; - */ - public Builder clearInstrumentedGraphDef() { - - instrumentedGraphDef_ = getDefaultInstance().getInstrumentedGraphDef(); - onChanged(); - return this; - } - - private java.lang.Object outerContextId_ = ""; - /** - *
    -     * IDs of the immediate enclosing context (graph), if any.
    -     * 
    - * - * string outer_context_id = 6; - */ - public java.lang.String getOuterContextId() { - java.lang.Object ref = outerContextId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - outerContextId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * IDs of the immediate enclosing context (graph), if any.
    -     * 
    - * - * string outer_context_id = 6; - */ - public com.google.protobuf.ByteString - getOuterContextIdBytes() { - java.lang.Object ref = outerContextId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - outerContextId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * IDs of the immediate enclosing context (graph), if any.
    -     * 
    - * - * string outer_context_id = 6; - */ - public Builder setOuterContextId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - outerContextId_ = value; - onChanged(); - return this; - } - /** - *
    -     * IDs of the immediate enclosing context (graph), if any.
    -     * 
    - * - * string outer_context_id = 6; - */ - public Builder clearOuterContextId() { - - outerContextId_ = getDefaultInstance().getOuterContextId(); - onChanged(); - return this; - } - /** - *
    -     * IDs of the immediate enclosing context (graph), if any.
    -     * 
    - * - * string outer_context_id = 6; - */ - public Builder setOuterContextIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - outerContextId_ = value; - 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.DebuggedGraph) - } - - // @@protoc_insertion_point(class_scope:tensorflow.DebuggedGraph) - private static final org.tensorflow.proto.util.DebuggedGraph DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.DebuggedGraph(); - } - - public static org.tensorflow.proto.util.DebuggedGraph getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DebuggedGraph parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DebuggedGraph(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.util.DebuggedGraph getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Event.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Event.java deleted file mode 100644 index b43e146b202..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Event.java +++ /dev/null @@ -1,2061 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Protocol buffer representing an event that happened during
    - * the execution of a Brain model.
    - * 
    - * - * Protobuf type {@code tensorflow.Event} - */ -public final class Event extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Event) - EventOrBuilder { -private static final long serialVersionUID = 0L; - // Use Event.newBuilder() to construct. - private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Event() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Event(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Event( - 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 9: { - - wallTime_ = input.readDouble(); - break; - } - case 16: { - - step_ = input.readInt64(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - whatCase_ = 3; - what_ = s; - break; - } - case 34: { - whatCase_ = 4; - what_ = input.readBytes(); - break; - } - case 42: { - org.tensorflow.proto.framework.Summary.Builder subBuilder = null; - if (whatCase_ == 5) { - subBuilder = ((org.tensorflow.proto.framework.Summary) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.framework.Summary.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.framework.Summary) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 5; - break; - } - case 50: { - org.tensorflow.proto.util.LogMessage.Builder subBuilder = null; - if (whatCase_ == 6) { - subBuilder = ((org.tensorflow.proto.util.LogMessage) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.LogMessage.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.LogMessage) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 6; - break; - } - case 58: { - org.tensorflow.proto.util.SessionLog.Builder subBuilder = null; - if (whatCase_ == 7) { - subBuilder = ((org.tensorflow.proto.util.SessionLog) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.SessionLog.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.SessionLog) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 7; - break; - } - case 66: { - org.tensorflow.proto.util.TaggedRunMetadata.Builder subBuilder = null; - if (whatCase_ == 8) { - subBuilder = ((org.tensorflow.proto.util.TaggedRunMetadata) what_).toBuilder(); - } - what_ = - input.readMessage(org.tensorflow.proto.util.TaggedRunMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.tensorflow.proto.util.TaggedRunMetadata) what_); - what_ = subBuilder.buildPartial(); - } - whatCase_ = 8; - break; - } - case 74: { - whatCase_ = 9; - what_ = input.readBytes(); - 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.util.EventProtos.internal_static_tensorflow_Event_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_Event_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.Event.class, org.tensorflow.proto.util.Event.Builder.class); - } - - private int whatCase_ = 0; - private java.lang.Object what_; - public enum WhatCase - implements com.google.protobuf.Internal.EnumLite { - FILE_VERSION(3), - GRAPH_DEF(4), - SUMMARY(5), - @java.lang.Deprecated LOG_MESSAGE(6), - SESSION_LOG(7), - TAGGED_RUN_METADATA(8), - META_GRAPH_DEF(9), - WHAT_NOT_SET(0); - private final int value; - private WhatCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static WhatCase valueOf(int value) { - return forNumber(value); - } - - public static WhatCase forNumber(int value) { - switch (value) { - case 3: return FILE_VERSION; - case 4: return GRAPH_DEF; - case 5: return SUMMARY; - case 6: return LOG_MESSAGE; - case 7: return SESSION_LOG; - case 8: return TAGGED_RUN_METADATA; - case 9: return META_GRAPH_DEF; - case 0: return WHAT_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public WhatCase - getWhatCase() { - return WhatCase.forNumber( - whatCase_); - } - - public static final int WALL_TIME_FIELD_NUMBER = 1; - private double wallTime_; - /** - *
    -   * Timestamp of the event.
    -   * 
    - * - * double wall_time = 1; - */ - public double getWallTime() { - return wallTime_; - } - - public static final int STEP_FIELD_NUMBER = 2; - private long step_; - /** - *
    -   * Global step of the event.
    -   * 
    - * - * int64 step = 2; - */ - public long getStep() { - return step_; - } - - public static final int FILE_VERSION_FIELD_NUMBER = 3; - /** - *
    -   * An event file was started, with the specified version.
    -   * This is use to identify the contents of the record IO files
    -   * easily.  Current version is "brain.Event:2".  All versions
    -   * start with "brain.Event:".
    -   * 
    - * - * string file_version = 3; - */ - public java.lang.String getFileVersion() { - java.lang.Object ref = ""; - if (whatCase_ == 3) { - ref = what_; - } - 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(); - if (whatCase_ == 3) { - what_ = s; - } - return s; - } - } - /** - *
    -   * An event file was started, with the specified version.
    -   * This is use to identify the contents of the record IO files
    -   * easily.  Current version is "brain.Event:2".  All versions
    -   * start with "brain.Event:".
    -   * 
    - * - * string file_version = 3; - */ - public com.google.protobuf.ByteString - getFileVersionBytes() { - java.lang.Object ref = ""; - if (whatCase_ == 3) { - ref = what_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (whatCase_ == 3) { - what_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPH_DEF_FIELD_NUMBER = 4; - /** - *
    -   * An encoded version of a GraphDef.
    -   * 
    - * - * bytes graph_def = 4; - */ - public com.google.protobuf.ByteString getGraphDef() { - if (whatCase_ == 4) { - return (com.google.protobuf.ByteString) what_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int SUMMARY_FIELD_NUMBER = 5; - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - public boolean hasSummary() { - return whatCase_ == 5; - } - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - public org.tensorflow.proto.framework.Summary getSummary() { - if (whatCase_ == 5) { - return (org.tensorflow.proto.framework.Summary) what_; - } - return org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - public org.tensorflow.proto.framework.SummaryOrBuilder getSummaryOrBuilder() { - if (whatCase_ == 5) { - return (org.tensorflow.proto.framework.Summary) what_; - } - return org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } - - public static final int LOG_MESSAGE_FIELD_NUMBER = 6; - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public boolean hasLogMessage() { - return whatCase_ == 6; - } - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.util.LogMessage getLogMessage() { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.LogMessage) what_; - } - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.util.LogMessageOrBuilder getLogMessageOrBuilder() { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.LogMessage) what_; - } - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - - public static final int SESSION_LOG_FIELD_NUMBER = 7; - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public boolean hasSessionLog() { - return whatCase_ == 7; - } - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public org.tensorflow.proto.util.SessionLog getSessionLog() { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.SessionLog) what_; - } - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public org.tensorflow.proto.util.SessionLogOrBuilder getSessionLogOrBuilder() { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.SessionLog) what_; - } - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - - public static final int TAGGED_RUN_METADATA_FIELD_NUMBER = 8; - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public boolean hasTaggedRunMetadata() { - return whatCase_ == 8; - } - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public org.tensorflow.proto.util.TaggedRunMetadata getTaggedRunMetadata() { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.TaggedRunMetadata) what_; - } - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public org.tensorflow.proto.util.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder() { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.TaggedRunMetadata) what_; - } - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - - public static final int META_GRAPH_DEF_FIELD_NUMBER = 9; - /** - *
    -   * An encoded version of a MetaGraphDef.
    -   * 
    - * - * bytes meta_graph_def = 9; - */ - public com.google.protobuf.ByteString getMetaGraphDef() { - if (whatCase_ == 9) { - return (com.google.protobuf.ByteString) what_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - 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 (wallTime_ != 0D) { - output.writeDouble(1, wallTime_); - } - if (step_ != 0L) { - output.writeInt64(2, step_); - } - if (whatCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, what_); - } - if (whatCase_ == 4) { - output.writeBytes( - 4, (com.google.protobuf.ByteString) what_); - } - if (whatCase_ == 5) { - output.writeMessage(5, (org.tensorflow.proto.framework.Summary) what_); - } - if (whatCase_ == 6) { - output.writeMessage(6, (org.tensorflow.proto.util.LogMessage) what_); - } - if (whatCase_ == 7) { - output.writeMessage(7, (org.tensorflow.proto.util.SessionLog) what_); - } - if (whatCase_ == 8) { - output.writeMessage(8, (org.tensorflow.proto.util.TaggedRunMetadata) what_); - } - if (whatCase_ == 9) { - output.writeBytes( - 9, (com.google.protobuf.ByteString) what_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (wallTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(1, wallTime_); - } - if (step_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, step_); - } - if (whatCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, what_); - } - if (whatCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 4, (com.google.protobuf.ByteString) what_); - } - if (whatCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (org.tensorflow.proto.framework.Summary) what_); - } - if (whatCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (org.tensorflow.proto.util.LogMessage) what_); - } - if (whatCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (org.tensorflow.proto.util.SessionLog) what_); - } - if (whatCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (org.tensorflow.proto.util.TaggedRunMetadata) what_); - } - if (whatCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 9, (com.google.protobuf.ByteString) what_); - } - 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.util.Event)) { - return super.equals(obj); - } - org.tensorflow.proto.util.Event other = (org.tensorflow.proto.util.Event) obj; - - if (java.lang.Double.doubleToLongBits(getWallTime()) - != java.lang.Double.doubleToLongBits( - other.getWallTime())) return false; - if (getStep() - != other.getStep()) return false; - if (!getWhatCase().equals(other.getWhatCase())) return false; - switch (whatCase_) { - case 3: - if (!getFileVersion() - .equals(other.getFileVersion())) return false; - break; - case 4: - if (!getGraphDef() - .equals(other.getGraphDef())) return false; - break; - case 5: - if (!getSummary() - .equals(other.getSummary())) return false; - break; - case 6: - if (!getLogMessage() - .equals(other.getLogMessage())) return false; - break; - case 7: - if (!getSessionLog() - .equals(other.getSessionLog())) return false; - break; - case 8: - if (!getTaggedRunMetadata() - .equals(other.getTaggedRunMetadata())) return false; - break; - case 9: - if (!getMetaGraphDef() - .equals(other.getMetaGraphDef())) return false; - break; - case 0: - default: - } - 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) + WALL_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getWallTime())); - hash = (37 * hash) + STEP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStep()); - switch (whatCase_) { - case 3: - hash = (37 * hash) + FILE_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getFileVersion().hashCode(); - break; - case 4: - hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getGraphDef().hashCode(); - break; - case 5: - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - break; - case 6: - hash = (37 * hash) + LOG_MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getLogMessage().hashCode(); - break; - case 7: - hash = (37 * hash) + SESSION_LOG_FIELD_NUMBER; - hash = (53 * hash) + getSessionLog().hashCode(); - break; - case 8: - hash = (37 * hash) + TAGGED_RUN_METADATA_FIELD_NUMBER; - hash = (53 * hash) + getTaggedRunMetadata().hashCode(); - break; - case 9: - hash = (37 * hash) + META_GRAPH_DEF_FIELD_NUMBER; - hash = (53 * hash) + getMetaGraphDef().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.Event parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Event 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.Event parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Event 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.Event parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Event parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.Event parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Event 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.Event parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Event 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.Event parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Event 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.util.Event 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; - } - /** - *
    -   * Protocol buffer representing an event that happened during
    -   * the execution of a Brain model.
    -   * 
    - * - * Protobuf type {@code tensorflow.Event} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Event) - org.tensorflow.proto.util.EventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_Event_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_Event_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.Event.class, org.tensorflow.proto.util.Event.Builder.class); - } - - // Construct using org.tensorflow.proto.util.Event.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(); - wallTime_ = 0D; - - step_ = 0L; - - whatCase_ = 0; - what_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_Event_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.Event getDefaultInstanceForType() { - return org.tensorflow.proto.util.Event.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.Event build() { - org.tensorflow.proto.util.Event result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.Event buildPartial() { - org.tensorflow.proto.util.Event result = new org.tensorflow.proto.util.Event(this); - result.wallTime_ = wallTime_; - result.step_ = step_; - if (whatCase_ == 3) { - result.what_ = what_; - } - if (whatCase_ == 4) { - result.what_ = what_; - } - if (whatCase_ == 5) { - if (summaryBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = summaryBuilder_.build(); - } - } - if (whatCase_ == 6) { - if (logMessageBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = logMessageBuilder_.build(); - } - } - if (whatCase_ == 7) { - if (sessionLogBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = sessionLogBuilder_.build(); - } - } - if (whatCase_ == 8) { - if (taggedRunMetadataBuilder_ == null) { - result.what_ = what_; - } else { - result.what_ = taggedRunMetadataBuilder_.build(); - } - } - if (whatCase_ == 9) { - result.what_ = what_; - } - result.whatCase_ = whatCase_; - 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.util.Event) { - return mergeFrom((org.tensorflow.proto.util.Event)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.Event other) { - if (other == org.tensorflow.proto.util.Event.getDefaultInstance()) return this; - if (other.getWallTime() != 0D) { - setWallTime(other.getWallTime()); - } - if (other.getStep() != 0L) { - setStep(other.getStep()); - } - switch (other.getWhatCase()) { - case FILE_VERSION: { - whatCase_ = 3; - what_ = other.what_; - onChanged(); - break; - } - case GRAPH_DEF: { - setGraphDef(other.getGraphDef()); - break; - } - case SUMMARY: { - mergeSummary(other.getSummary()); - break; - } - case LOG_MESSAGE: { - mergeLogMessage(other.getLogMessage()); - break; - } - case SESSION_LOG: { - mergeSessionLog(other.getSessionLog()); - break; - } - case TAGGED_RUN_METADATA: { - mergeTaggedRunMetadata(other.getTaggedRunMetadata()); - break; - } - case META_GRAPH_DEF: { - setMetaGraphDef(other.getMetaGraphDef()); - break; - } - case WHAT_NOT_SET: { - break; - } - } - 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.util.Event parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.Event) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int whatCase_ = 0; - private java.lang.Object what_; - public WhatCase - getWhatCase() { - return WhatCase.forNumber( - whatCase_); - } - - public Builder clearWhat() { - whatCase_ = 0; - what_ = null; - onChanged(); - return this; - } - - - private double wallTime_ ; - /** - *
    -     * Timestamp of the event.
    -     * 
    - * - * double wall_time = 1; - */ - public double getWallTime() { - return wallTime_; - } - /** - *
    -     * Timestamp of the event.
    -     * 
    - * - * double wall_time = 1; - */ - public Builder setWallTime(double value) { - - wallTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Timestamp of the event.
    -     * 
    - * - * double wall_time = 1; - */ - public Builder clearWallTime() { - - wallTime_ = 0D; - onChanged(); - return this; - } - - private long step_ ; - /** - *
    -     * Global step of the event.
    -     * 
    - * - * int64 step = 2; - */ - public long getStep() { - return step_; - } - /** - *
    -     * Global step of the event.
    -     * 
    - * - * int64 step = 2; - */ - public Builder setStep(long value) { - - step_ = value; - onChanged(); - return this; - } - /** - *
    -     * Global step of the event.
    -     * 
    - * - * int64 step = 2; - */ - public Builder clearStep() { - - step_ = 0L; - onChanged(); - return this; - } - - /** - *
    -     * An event file was started, with the specified version.
    -     * This is use to identify the contents of the record IO files
    -     * easily.  Current version is "brain.Event:2".  All versions
    -     * start with "brain.Event:".
    -     * 
    - * - * string file_version = 3; - */ - public java.lang.String getFileVersion() { - java.lang.Object ref = ""; - if (whatCase_ == 3) { - ref = what_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (whatCase_ == 3) { - what_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * An event file was started, with the specified version.
    -     * This is use to identify the contents of the record IO files
    -     * easily.  Current version is "brain.Event:2".  All versions
    -     * start with "brain.Event:".
    -     * 
    - * - * string file_version = 3; - */ - public com.google.protobuf.ByteString - getFileVersionBytes() { - java.lang.Object ref = ""; - if (whatCase_ == 3) { - ref = what_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (whatCase_ == 3) { - what_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * An event file was started, with the specified version.
    -     * This is use to identify the contents of the record IO files
    -     * easily.  Current version is "brain.Event:2".  All versions
    -     * start with "brain.Event:".
    -     * 
    - * - * string file_version = 3; - */ - public Builder setFileVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - whatCase_ = 3; - what_ = value; - onChanged(); - return this; - } - /** - *
    -     * An event file was started, with the specified version.
    -     * This is use to identify the contents of the record IO files
    -     * easily.  Current version is "brain.Event:2".  All versions
    -     * start with "brain.Event:".
    -     * 
    - * - * string file_version = 3; - */ - public Builder clearFileVersion() { - if (whatCase_ == 3) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - return this; - } - /** - *
    -     * An event file was started, with the specified version.
    -     * This is use to identify the contents of the record IO files
    -     * easily.  Current version is "brain.Event:2".  All versions
    -     * start with "brain.Event:".
    -     * 
    - * - * string file_version = 3; - */ - public Builder setFileVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - whatCase_ = 3; - what_ = value; - onChanged(); - return this; - } - - /** - *
    -     * An encoded version of a GraphDef.
    -     * 
    - * - * bytes graph_def = 4; - */ - public com.google.protobuf.ByteString getGraphDef() { - if (whatCase_ == 4) { - return (com.google.protobuf.ByteString) what_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
    -     * An encoded version of a GraphDef.
    -     * 
    - * - * bytes graph_def = 4; - */ - public Builder setGraphDef(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - whatCase_ = 4; - what_ = value; - onChanged(); - return this; - } - /** - *
    -     * An encoded version of a GraphDef.
    -     * 
    - * - * bytes graph_def = 4; - */ - public Builder clearGraphDef() { - if (whatCase_ == 4) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.Summary, org.tensorflow.proto.framework.Summary.Builder, org.tensorflow.proto.framework.SummaryOrBuilder> summaryBuilder_; - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public boolean hasSummary() { - return whatCase_ == 5; - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public org.tensorflow.proto.framework.Summary getSummary() { - if (summaryBuilder_ == null) { - if (whatCase_ == 5) { - return (org.tensorflow.proto.framework.Summary) what_; - } - return org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } else { - if (whatCase_ == 5) { - return summaryBuilder_.getMessage(); - } - return org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public Builder setSummary(org.tensorflow.proto.framework.Summary value) { - if (summaryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - summaryBuilder_.setMessage(value); - } - whatCase_ = 5; - return this; - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public Builder setSummary( - org.tensorflow.proto.framework.Summary.Builder builderForValue) { - if (summaryBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - summaryBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 5; - return this; - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public Builder mergeSummary(org.tensorflow.proto.framework.Summary value) { - if (summaryBuilder_ == null) { - if (whatCase_ == 5 && - what_ != org.tensorflow.proto.framework.Summary.getDefaultInstance()) { - what_ = org.tensorflow.proto.framework.Summary.newBuilder((org.tensorflow.proto.framework.Summary) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 5) { - summaryBuilder_.mergeFrom(value); - } - summaryBuilder_.setMessage(value); - } - whatCase_ = 5; - return this; - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public Builder clearSummary() { - if (summaryBuilder_ == null) { - if (whatCase_ == 5) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 5) { - whatCase_ = 0; - what_ = null; - } - summaryBuilder_.clear(); - } - return this; - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public org.tensorflow.proto.framework.Summary.Builder getSummaryBuilder() { - return getSummaryFieldBuilder().getBuilder(); - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - public org.tensorflow.proto.framework.SummaryOrBuilder getSummaryOrBuilder() { - if ((whatCase_ == 5) && (summaryBuilder_ != null)) { - return summaryBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 5) { - return (org.tensorflow.proto.framework.Summary) what_; - } - return org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } - } - /** - *
    -     * A summary was generated.
    -     * 
    - * - * .tensorflow.Summary summary = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.Summary, org.tensorflow.proto.framework.Summary.Builder, org.tensorflow.proto.framework.SummaryOrBuilder> - getSummaryFieldBuilder() { - if (summaryBuilder_ == null) { - if (!(whatCase_ == 5)) { - what_ = org.tensorflow.proto.framework.Summary.getDefaultInstance(); - } - summaryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.Summary, org.tensorflow.proto.framework.Summary.Builder, org.tensorflow.proto.framework.SummaryOrBuilder>( - (org.tensorflow.proto.framework.Summary) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 5; - onChanged();; - return summaryBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.LogMessage, org.tensorflow.proto.util.LogMessage.Builder, org.tensorflow.proto.util.LogMessageOrBuilder> logMessageBuilder_; - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public boolean hasLogMessage() { - return whatCase_ == 6; - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.util.LogMessage getLogMessage() { - if (logMessageBuilder_ == null) { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.LogMessage) what_; - } - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } else { - if (whatCase_ == 6) { - return logMessageBuilder_.getMessage(); - } - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setLogMessage(org.tensorflow.proto.util.LogMessage value) { - if (logMessageBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - logMessageBuilder_.setMessage(value); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder setLogMessage( - org.tensorflow.proto.util.LogMessage.Builder builderForValue) { - if (logMessageBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - logMessageBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder mergeLogMessage(org.tensorflow.proto.util.LogMessage value) { - if (logMessageBuilder_ == null) { - if (whatCase_ == 6 && - what_ != org.tensorflow.proto.util.LogMessage.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.LogMessage.newBuilder((org.tensorflow.proto.util.LogMessage) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 6) { - logMessageBuilder_.mergeFrom(value); - } - logMessageBuilder_.setMessage(value); - } - whatCase_ = 6; - return this; - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public Builder clearLogMessage() { - if (logMessageBuilder_ == null) { - if (whatCase_ == 6) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 6) { - whatCase_ = 0; - what_ = null; - } - logMessageBuilder_.clear(); - } - return this; - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.util.LogMessage.Builder getLogMessageBuilder() { - return getLogMessageFieldBuilder().getBuilder(); - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated public org.tensorflow.proto.util.LogMessageOrBuilder getLogMessageOrBuilder() { - if ((whatCase_ == 6) && (logMessageBuilder_ != null)) { - return logMessageBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 6) { - return (org.tensorflow.proto.util.LogMessage) what_; - } - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - } - /** - *
    -     * The user output a log message. This was theoretically used by the defunct
    -     * tensorboard_logging module, which has since been removed; this field is
    -     * now deprecated and should not be used.
    -     * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.LogMessage, org.tensorflow.proto.util.LogMessage.Builder, org.tensorflow.proto.util.LogMessageOrBuilder> - getLogMessageFieldBuilder() { - if (logMessageBuilder_ == null) { - if (!(whatCase_ == 6)) { - what_ = org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - logMessageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.LogMessage, org.tensorflow.proto.util.LogMessage.Builder, org.tensorflow.proto.util.LogMessageOrBuilder>( - (org.tensorflow.proto.util.LogMessage) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 6; - onChanged();; - return logMessageBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SessionLog, org.tensorflow.proto.util.SessionLog.Builder, org.tensorflow.proto.util.SessionLogOrBuilder> sessionLogBuilder_; - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public boolean hasSessionLog() { - return whatCase_ == 7; - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public org.tensorflow.proto.util.SessionLog getSessionLog() { - if (sessionLogBuilder_ == null) { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.SessionLog) what_; - } - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } else { - if (whatCase_ == 7) { - return sessionLogBuilder_.getMessage(); - } - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public Builder setSessionLog(org.tensorflow.proto.util.SessionLog value) { - if (sessionLogBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - sessionLogBuilder_.setMessage(value); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public Builder setSessionLog( - org.tensorflow.proto.util.SessionLog.Builder builderForValue) { - if (sessionLogBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - sessionLogBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public Builder mergeSessionLog(org.tensorflow.proto.util.SessionLog value) { - if (sessionLogBuilder_ == null) { - if (whatCase_ == 7 && - what_ != org.tensorflow.proto.util.SessionLog.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.SessionLog.newBuilder((org.tensorflow.proto.util.SessionLog) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 7) { - sessionLogBuilder_.mergeFrom(value); - } - sessionLogBuilder_.setMessage(value); - } - whatCase_ = 7; - return this; - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public Builder clearSessionLog() { - if (sessionLogBuilder_ == null) { - if (whatCase_ == 7) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 7) { - whatCase_ = 0; - what_ = null; - } - sessionLogBuilder_.clear(); - } - return this; - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public org.tensorflow.proto.util.SessionLog.Builder getSessionLogBuilder() { - return getSessionLogFieldBuilder().getBuilder(); - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - public org.tensorflow.proto.util.SessionLogOrBuilder getSessionLogOrBuilder() { - if ((whatCase_ == 7) && (sessionLogBuilder_ != null)) { - return sessionLogBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 7) { - return (org.tensorflow.proto.util.SessionLog) what_; - } - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - } - /** - *
    -     * The state of the session which can be used for restarting after crashes.
    -     * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SessionLog, org.tensorflow.proto.util.SessionLog.Builder, org.tensorflow.proto.util.SessionLogOrBuilder> - getSessionLogFieldBuilder() { - if (sessionLogBuilder_ == null) { - if (!(whatCase_ == 7)) { - what_ = org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - sessionLogBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SessionLog, org.tensorflow.proto.util.SessionLog.Builder, org.tensorflow.proto.util.SessionLogOrBuilder>( - (org.tensorflow.proto.util.SessionLog) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 7; - onChanged();; - return sessionLogBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.TaggedRunMetadata, org.tensorflow.proto.util.TaggedRunMetadata.Builder, org.tensorflow.proto.util.TaggedRunMetadataOrBuilder> taggedRunMetadataBuilder_; - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public boolean hasTaggedRunMetadata() { - return whatCase_ == 8; - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public org.tensorflow.proto.util.TaggedRunMetadata getTaggedRunMetadata() { - if (taggedRunMetadataBuilder_ == null) { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.TaggedRunMetadata) what_; - } - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } else { - if (whatCase_ == 8) { - return taggedRunMetadataBuilder_.getMessage(); - } - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public Builder setTaggedRunMetadata(org.tensorflow.proto.util.TaggedRunMetadata value) { - if (taggedRunMetadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - what_ = value; - onChanged(); - } else { - taggedRunMetadataBuilder_.setMessage(value); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public Builder setTaggedRunMetadata( - org.tensorflow.proto.util.TaggedRunMetadata.Builder builderForValue) { - if (taggedRunMetadataBuilder_ == null) { - what_ = builderForValue.build(); - onChanged(); - } else { - taggedRunMetadataBuilder_.setMessage(builderForValue.build()); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public Builder mergeTaggedRunMetadata(org.tensorflow.proto.util.TaggedRunMetadata value) { - if (taggedRunMetadataBuilder_ == null) { - if (whatCase_ == 8 && - what_ != org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance()) { - what_ = org.tensorflow.proto.util.TaggedRunMetadata.newBuilder((org.tensorflow.proto.util.TaggedRunMetadata) what_) - .mergeFrom(value).buildPartial(); - } else { - what_ = value; - } - onChanged(); - } else { - if (whatCase_ == 8) { - taggedRunMetadataBuilder_.mergeFrom(value); - } - taggedRunMetadataBuilder_.setMessage(value); - } - whatCase_ = 8; - return this; - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public Builder clearTaggedRunMetadata() { - if (taggedRunMetadataBuilder_ == null) { - if (whatCase_ == 8) { - whatCase_ = 0; - what_ = null; - onChanged(); - } - } else { - if (whatCase_ == 8) { - whatCase_ = 0; - what_ = null; - } - taggedRunMetadataBuilder_.clear(); - } - return this; - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public org.tensorflow.proto.util.TaggedRunMetadata.Builder getTaggedRunMetadataBuilder() { - return getTaggedRunMetadataFieldBuilder().getBuilder(); - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - public org.tensorflow.proto.util.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder() { - if ((whatCase_ == 8) && (taggedRunMetadataBuilder_ != null)) { - return taggedRunMetadataBuilder_.getMessageOrBuilder(); - } else { - if (whatCase_ == 8) { - return (org.tensorflow.proto.util.TaggedRunMetadata) what_; - } - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - } - /** - *
    -     * The metadata returned by running a session.run() call.
    -     * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.TaggedRunMetadata, org.tensorflow.proto.util.TaggedRunMetadata.Builder, org.tensorflow.proto.util.TaggedRunMetadataOrBuilder> - getTaggedRunMetadataFieldBuilder() { - if (taggedRunMetadataBuilder_ == null) { - if (!(whatCase_ == 8)) { - what_ = org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - taggedRunMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.TaggedRunMetadata, org.tensorflow.proto.util.TaggedRunMetadata.Builder, org.tensorflow.proto.util.TaggedRunMetadataOrBuilder>( - (org.tensorflow.proto.util.TaggedRunMetadata) what_, - getParentForChildren(), - isClean()); - what_ = null; - } - whatCase_ = 8; - onChanged();; - return taggedRunMetadataBuilder_; - } - - /** - *
    -     * An encoded version of a MetaGraphDef.
    -     * 
    - * - * bytes meta_graph_def = 9; - */ - public com.google.protobuf.ByteString getMetaGraphDef() { - if (whatCase_ == 9) { - return (com.google.protobuf.ByteString) what_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
    -     * An encoded version of a MetaGraphDef.
    -     * 
    - * - * bytes meta_graph_def = 9; - */ - public Builder setMetaGraphDef(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - whatCase_ = 9; - what_ = value; - onChanged(); - return this; - } - /** - *
    -     * An encoded version of a MetaGraphDef.
    -     * 
    - * - * bytes meta_graph_def = 9; - */ - public Builder clearMetaGraphDef() { - if (whatCase_ == 9) { - whatCase_ = 0; - what_ = null; - 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.Event) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Event) - private static final org.tensorflow.proto.util.Event DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.Event(); - } - - public static org.tensorflow.proto.util.Event getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Event parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Event(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.util.Event getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventOrBuilder.java deleted file mode 100644 index c318fe32cb6..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventOrBuilder.java +++ /dev/null @@ -1,177 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface EventOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.Event) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Timestamp of the event.
    -   * 
    - * - * double wall_time = 1; - */ - double getWallTime(); - - /** - *
    -   * Global step of the event.
    -   * 
    - * - * int64 step = 2; - */ - long getStep(); - - /** - *
    -   * An event file was started, with the specified version.
    -   * This is use to identify the contents of the record IO files
    -   * easily.  Current version is "brain.Event:2".  All versions
    -   * start with "brain.Event:".
    -   * 
    - * - * string file_version = 3; - */ - java.lang.String getFileVersion(); - /** - *
    -   * An event file was started, with the specified version.
    -   * This is use to identify the contents of the record IO files
    -   * easily.  Current version is "brain.Event:2".  All versions
    -   * start with "brain.Event:".
    -   * 
    - * - * string file_version = 3; - */ - com.google.protobuf.ByteString - getFileVersionBytes(); - - /** - *
    -   * An encoded version of a GraphDef.
    -   * 
    - * - * bytes graph_def = 4; - */ - com.google.protobuf.ByteString getGraphDef(); - - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - boolean hasSummary(); - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - org.tensorflow.proto.framework.Summary getSummary(); - /** - *
    -   * A summary was generated.
    -   * 
    - * - * .tensorflow.Summary summary = 5; - */ - org.tensorflow.proto.framework.SummaryOrBuilder getSummaryOrBuilder(); - - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated boolean hasLogMessage(); - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated org.tensorflow.proto.util.LogMessage getLogMessage(); - /** - *
    -   * The user output a log message. This was theoretically used by the defunct
    -   * tensorboard_logging module, which has since been removed; this field is
    -   * now deprecated and should not be used.
    -   * 
    - * - * .tensorflow.LogMessage log_message = 6 [deprecated = true]; - */ - @java.lang.Deprecated org.tensorflow.proto.util.LogMessageOrBuilder getLogMessageOrBuilder(); - - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - boolean hasSessionLog(); - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - org.tensorflow.proto.util.SessionLog getSessionLog(); - /** - *
    -   * The state of the session which can be used for restarting after crashes.
    -   * 
    - * - * .tensorflow.SessionLog session_log = 7; - */ - org.tensorflow.proto.util.SessionLogOrBuilder getSessionLogOrBuilder(); - - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - boolean hasTaggedRunMetadata(); - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - org.tensorflow.proto.util.TaggedRunMetadata getTaggedRunMetadata(); - /** - *
    -   * The metadata returned by running a session.run() call.
    -   * 
    - * - * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; - */ - org.tensorflow.proto.util.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder(); - - /** - *
    -   * An encoded version of a MetaGraphDef.
    -   * 
    - * - * bytes meta_graph_def = 9; - */ - com.google.protobuf.ByteString getMetaGraphDef(); - - public org.tensorflow.proto.util.Event.WhatCase getWhatCase(); -} 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 deleted file mode 100644 index 74fc5501c1f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/EventProtos.java +++ /dev/null @@ -1,163 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public final class EventProtos { - private EventProtos() {} - 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_Event_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_Event_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_LogMessage_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_LogMessage_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SessionLog_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SessionLog_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TaggedRunMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_WatchdogConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_WatchdogConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RequestedExitCode_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RequestedExitCode_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_WorkerHeartbeatRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_WorkerHeartbeatResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_WorkerHeartbeatResponse_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/util/event.proto\022\ntens" + - "orflow\032\'tensorflow/core/framework/summar" + - "y.proto\"\277\002\n\005Event\022\021\n\twall_time\030\001 \001(\001\022\014\n\004" + - "step\030\002 \001(\003\022\026\n\014file_version\030\003 \001(\tH\000\022\023\n\tgr" + - "aph_def\030\004 \001(\014H\000\022&\n\007summary\030\005 \001(\0132\023.tenso" + - "rflow.SummaryH\000\0221\n\013log_message\030\006 \001(\0132\026.t" + - "ensorflow.LogMessageB\002\030\001H\000\022-\n\013session_lo" + - "g\030\007 \001(\0132\026.tensorflow.SessionLogH\000\022<\n\023tag" + - "ged_run_metadata\030\010 \001(\0132\035.tensorflow.Tagg" + - "edRunMetadataH\000\022\030\n\016meta_graph_def\030\t \001(\014H" + - "\000B\006\n\004what\"\241\001\n\nLogMessage\022+\n\005level\030\001 \001(\0162" + - "\034.tensorflow.LogMessage.Level\022\017\n\007message" + - "\030\002 \001(\t\"Q\n\005Level\022\013\n\007UNKNOWN\020\000\022\r\n\tDEBUGGIN" + - "G\020\n\022\010\n\004INFO\020\024\022\010\n\004WARN\020\036\022\t\n\005ERROR\020(\022\t\n\005FA" + - "TAL\0202\032\002\030\001:\002\030\001\"\266\001\n\nSessionLog\0224\n\006status\030\001" + - " \001(\0162$.tensorflow.SessionLog.SessionStat" + - "us\022\027\n\017checkpoint_path\030\002 \001(\t\022\013\n\003msg\030\003 \001(\t" + - "\"L\n\rSessionStatus\022\026\n\022STATUS_UNSPECIFIED\020" + - "\000\022\t\n\005START\020\001\022\010\n\004STOP\020\002\022\016\n\nCHECKPOINT\020\003\"6" + - "\n\021TaggedRunMetadata\022\013\n\003tag\030\001 \001(\t\022\024\n\014run_" + - "metadata\030\002 \001(\014\"$\n\016WatchdogConfig\022\022\n\ntime" + - "out_ms\030\001 \001(\003\"&\n\021RequestedExitCode\022\021\n\texi" + - "t_code\030\001 \001(\005\"\266\001\n\026WorkerHeartbeatRequest\022" + - "5\n\rshutdown_mode\030\001 \001(\0162\036.tensorflow.Work" + - "erShutdownMode\0223\n\017watchdog_config\030\002 \001(\0132" + - "\032.tensorflow.WatchdogConfig\0220\n\texit_code" + - "\030\003 \001(\0132\035.tensorflow.RequestedExitCode\"\203\001" + - "\n\027WorkerHeartbeatResponse\022/\n\rhealth_stat" + - "us\030\001 \001(\0162\030.tensorflow.WorkerHealth\022%\n\nwo" + - "rker_log\030\002 \003(\0132\021.tensorflow.Event\022\020\n\010hos" + - "tname\030\003 \001(\t*[\n\014WorkerHealth\022\006\n\002OK\020\000\022\034\n\030R" + - "ECEIVED_SHUTDOWN_SIGNAL\020\001\022\022\n\016INTERNAL_ER" + - "ROR\020\002\022\021\n\rSHUTTING_DOWN\020\003*k\n\022WorkerShutdo" + - "wnMode\022\013\n\007DEFAULT\020\000\022\022\n\016NOT_CONFIGURED\020\001\022" + - "\030\n\024WAIT_FOR_COORDINATOR\020\002\022\032\n\026SHUTDOWN_AF" + - "TER_TIMEOUT\020\003Bv\n\031org.tensorflow.proto.ut" + - "ilB\013EventProtosP\001ZGgithub.com/tensorflow" + - "/tensorflow/tensorflow/go/core/util/even" + - "t_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.SummaryProtos.getDescriptor(), - }); - internal_static_tensorflow_Event_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_Event_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_Event_descriptor, - new java.lang.String[] { "WallTime", "Step", "FileVersion", "GraphDef", "Summary", "LogMessage", "SessionLog", "TaggedRunMetadata", "MetaGraphDef", "What", }); - internal_static_tensorflow_LogMessage_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_LogMessage_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_LogMessage_descriptor, - new java.lang.String[] { "Level", "Message", }); - internal_static_tensorflow_SessionLog_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_SessionLog_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SessionLog_descriptor, - new java.lang.String[] { "Status", "CheckpointPath", "Msg", }); - internal_static_tensorflow_TaggedRunMetadata_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TaggedRunMetadata_descriptor, - new java.lang.String[] { "Tag", "RunMetadata", }); - internal_static_tensorflow_WatchdogConfig_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_WatchdogConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_WatchdogConfig_descriptor, - new java.lang.String[] { "TimeoutMs", }); - internal_static_tensorflow_RequestedExitCode_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_RequestedExitCode_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RequestedExitCode_descriptor, - new java.lang.String[] { "ExitCode", }); - internal_static_tensorflow_WorkerHeartbeatRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_WorkerHeartbeatRequest_descriptor, - new java.lang.String[] { "ShutdownMode", "WatchdogConfig", "ExitCode", }); - internal_static_tensorflow_WorkerHeartbeatResponse_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_WorkerHeartbeatResponse_descriptor, - new java.lang.String[] { "HealthStatus", "WorkerLog", "Hostname", }); - org.tensorflow.proto.framework.SummaryProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Execution.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Execution.java deleted file mode 100644 index 42d3a1d835a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/Execution.java +++ /dev/null @@ -1,2259 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Data relating to the eager execution of an op or a Graph.
    - * For a op that generates N output tensors (N >= 0), only one
    - * Execution proto will be used to describe the execution event.
    - * 
    - * - * Protobuf type {@code tensorflow.Execution} - */ -public final class Execution extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.Execution) - ExecutionOrBuilder { -private static final long serialVersionUID = 0L; - // Use Execution.newBuilder() to construct. - private Execution(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Execution() { - opType_ = ""; - graphId_ = ""; - inputTensorIds_ = emptyLongList(); - outputTensorIds_ = emptyLongList(); - tensorDebugMode_ = 0; - tensorProtos_ = java.util.Collections.emptyList(); - outputTensorDeviceIds_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Execution(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Execution( - 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(); - - opType_ = s; - break; - } - case 16: { - - numOutputs_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - graphId_ = s; - break; - } - case 32: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - inputTensorIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - inputTensorIds_.addLong(input.readInt64()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - inputTensorIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - inputTensorIds_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 40: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputTensorIds_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - outputTensorIds_.addLong(input.readInt64()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - outputTensorIds_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - outputTensorIds_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 48: { - int rawValue = input.readEnum(); - - tensorDebugMode_ = rawValue; - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - tensorProtos_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - tensorProtos_.add( - input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry)); - break; - } - case 66: { - org.tensorflow.proto.util.CodeLocation.Builder subBuilder = null; - if (codeLocation_ != null) { - subBuilder = codeLocation_.toBuilder(); - } - codeLocation_ = input.readMessage(org.tensorflow.proto.util.CodeLocation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(codeLocation_); - codeLocation_ = subBuilder.buildPartial(); - } - - break; - } - case 72: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - outputTensorDeviceIds_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - outputTensorDeviceIds_.addInt(input.readInt32()); - break; - } - case 74: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) { - outputTensorDeviceIds_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - while (input.getBytesUntilLimit() > 0) { - outputTensorDeviceIds_.addInt(input.readInt32()); - } - input.popLimit(limit); - 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)) { - inputTensorIds_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - outputTensorIds_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - tensorProtos_ = java.util.Collections.unmodifiableList(tensorProtos_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - outputTensorDeviceIds_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_Execution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.Execution.class, org.tensorflow.proto.util.Execution.Builder.class); - } - - public static final int OP_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object opType_; - /** - *
    -   * Op type (e.g., "MatMul").
    -   * In the case of a Graph, this is the name of the Graph.
    -   * 
    - * - * string op_type = 1; - */ - public java.lang.String getOpType() { - java.lang.Object ref = opType_; - 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(); - opType_ = s; - return s; - } - } - /** - *
    -   * Op type (e.g., "MatMul").
    -   * In the case of a Graph, this is the name of the Graph.
    -   * 
    - * - * string op_type = 1; - */ - public com.google.protobuf.ByteString - getOpTypeBytes() { - java.lang.Object ref = opType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NUM_OUTPUTS_FIELD_NUMBER = 2; - private int numOutputs_; - /** - *
    -   * Number of output tensors.
    -   * 
    - * - * int32 num_outputs = 2; - */ - public int getNumOutputs() { - return numOutputs_; - } - - public static final int GRAPH_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object graphId_; - /** - *
    -   * The graph that's executed: applicable only to the eager
    -   * execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 3; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - 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(); - graphId_ = s; - return s; - } - } - /** - *
    -   * The graph that's executed: applicable only to the eager
    -   * execution of a FuncGraph.
    -   * 
    - * - * string graph_id = 3; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INPUT_TENSOR_IDS_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.LongList inputTensorIds_; - /** - *
    -   * IDs of the input tensors (if available).
    -   * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public java.util.List - getInputTensorIdsList() { - return inputTensorIds_; - } - /** - *
    -   * IDs of the input tensors (if available).
    -   * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public int getInputTensorIdsCount() { - return inputTensorIds_.size(); - } - /** - *
    -   * IDs of the input tensors (if available).
    -   * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public long getInputTensorIds(int index) { - return inputTensorIds_.getLong(index); - } - private int inputTensorIdsMemoizedSerializedSize = -1; - - public static final int OUTPUT_TENSOR_IDS_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.LongList outputTensorIds_; - /** - *
    -   * IDs of the output tensors (if availbable).
    -   * If specified, must have the same length as tensor_protos.
    -   * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public java.util.List - getOutputTensorIdsList() { - return outputTensorIds_; - } - /** - *
    -   * IDs of the output tensors (if availbable).
    -   * If specified, must have the same length as tensor_protos.
    -   * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public int getOutputTensorIdsCount() { - return outputTensorIds_.size(); - } - /** - *
    -   * IDs of the output tensors (if availbable).
    -   * If specified, must have the same length as tensor_protos.
    -   * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public long getOutputTensorIds(int index) { - return outputTensorIds_.getLong(index); - } - private int outputTensorIdsMemoizedSerializedSize = -1; - - public static final int TENSOR_DEBUG_MODE_FIELD_NUMBER = 6; - private int tensorDebugMode_; - /** - *
    -   * Type of the tensor value encapsulated in this proto.
    -   * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public int getTensorDebugModeValue() { - return tensorDebugMode_; - } - /** - *
    -   * Type of the tensor value encapsulated in this proto.
    -   * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_); - return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result; - } - - public static final int TENSOR_PROTOS_FIELD_NUMBER = 7; - private java.util.List tensorProtos_; - /** - *
    -   * Output Tensor values in the type described by `tensor_value_type`.
    -   * The length of this should match `num_outputs`.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public java.util.List getTensorProtosList() { - return tensorProtos_; - } - /** - *
    -   * Output Tensor values in the type described by `tensor_value_type`.
    -   * The length of this should match `num_outputs`.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public java.util.List - getTensorProtosOrBuilderList() { - return tensorProtos_; - } - /** - *
    -   * Output Tensor values in the type described by `tensor_value_type`.
    -   * The length of this should match `num_outputs`.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public int getTensorProtosCount() { - return tensorProtos_.size(); - } - /** - *
    -   * Output Tensor values in the type described by `tensor_value_type`.
    -   * The length of this should match `num_outputs`.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProto getTensorProtos(int index) { - return tensorProtos_.get(index); - } - /** - *
    -   * Output Tensor values in the type described by `tensor_value_type`.
    -   * The length of this should match `num_outputs`.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder( - int index) { - return tensorProtos_.get(index); - } - - public static final int CODE_LOCATION_FIELD_NUMBER = 8; - private org.tensorflow.proto.util.CodeLocation codeLocation_; - /** - *
    -   * Stack trace of the eager execution.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public boolean hasCodeLocation() { - return codeLocation_ != null; - } - /** - *
    -   * Stack trace of the eager execution.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation getCodeLocation() { - return codeLocation_ == null ? org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } - /** - *
    -   * Stack trace of the eager execution.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder() { - return getCodeLocation(); - } - - public static final int OUTPUT_TENSOR_DEVICE_IDS_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.IntList outputTensorDeviceIds_; - /** - *
    -   * Debugged-generated IDs of the devices on which the output tensors reside.
    -   * To look up details about the device (e.g., name), cross-reference this
    -   * field with the DebuggedDevice messages.
    -   * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public java.util.List - getOutputTensorDeviceIdsList() { - return outputTensorDeviceIds_; - } - /** - *
    -   * Debugged-generated IDs of the devices on which the output tensors reside.
    -   * To look up details about the device (e.g., name), cross-reference this
    -   * field with the DebuggedDevice messages.
    -   * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public int getOutputTensorDeviceIdsCount() { - return outputTensorDeviceIds_.size(); - } - /** - *
    -   * Debugged-generated IDs of the devices on which the output tensors reside.
    -   * To look up details about the device (e.g., name), cross-reference this
    -   * field with the DebuggedDevice messages.
    -   * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public int getOutputTensorDeviceIds(int index) { - return outputTensorDeviceIds_.getInt(index); - } - private int outputTensorDeviceIdsMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (!getOpTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, opType_); - } - if (numOutputs_ != 0) { - output.writeInt32(2, numOutputs_); - } - if (!getGraphIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, graphId_); - } - if (getInputTensorIdsList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(inputTensorIdsMemoizedSerializedSize); - } - for (int i = 0; i < inputTensorIds_.size(); i++) { - output.writeInt64NoTag(inputTensorIds_.getLong(i)); - } - if (getOutputTensorIdsList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(outputTensorIdsMemoizedSerializedSize); - } - for (int i = 0; i < outputTensorIds_.size(); i++) { - output.writeInt64NoTag(outputTensorIds_.getLong(i)); - } - if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) { - output.writeEnum(6, tensorDebugMode_); - } - for (int i = 0; i < tensorProtos_.size(); i++) { - output.writeMessage(7, tensorProtos_.get(i)); - } - if (codeLocation_ != null) { - output.writeMessage(8, getCodeLocation()); - } - if (getOutputTensorDeviceIdsList().size() > 0) { - output.writeUInt32NoTag(74); - output.writeUInt32NoTag(outputTensorDeviceIdsMemoizedSerializedSize); - } - for (int i = 0; i < outputTensorDeviceIds_.size(); i++) { - output.writeInt32NoTag(outputTensorDeviceIds_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getOpTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, opType_); - } - if (numOutputs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, numOutputs_); - } - if (!getGraphIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, graphId_); - } - { - int dataSize = 0; - for (int i = 0; i < inputTensorIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(inputTensorIds_.getLong(i)); - } - size += dataSize; - if (!getInputTensorIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - inputTensorIdsMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < outputTensorIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(outputTensorIds_.getLong(i)); - } - size += dataSize; - if (!getOutputTensorIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - outputTensorIdsMemoizedSerializedSize = dataSize; - } - if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, tensorDebugMode_); - } - for (int i = 0; i < tensorProtos_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, tensorProtos_.get(i)); - } - if (codeLocation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getCodeLocation()); - } - { - int dataSize = 0; - for (int i = 0; i < outputTensorDeviceIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(outputTensorDeviceIds_.getInt(i)); - } - size += dataSize; - if (!getOutputTensorDeviceIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - outputTensorDeviceIdsMemoizedSerializedSize = dataSize; - } - 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.util.Execution)) { - return super.equals(obj); - } - org.tensorflow.proto.util.Execution other = (org.tensorflow.proto.util.Execution) obj; - - if (!getOpType() - .equals(other.getOpType())) return false; - if (getNumOutputs() - != other.getNumOutputs()) return false; - if (!getGraphId() - .equals(other.getGraphId())) return false; - if (!getInputTensorIdsList() - .equals(other.getInputTensorIdsList())) return false; - if (!getOutputTensorIdsList() - .equals(other.getOutputTensorIdsList())) return false; - if (tensorDebugMode_ != other.tensorDebugMode_) return false; - if (!getTensorProtosList() - .equals(other.getTensorProtosList())) return false; - if (hasCodeLocation() != other.hasCodeLocation()) return false; - if (hasCodeLocation()) { - if (!getCodeLocation() - .equals(other.getCodeLocation())) return false; - } - if (!getOutputTensorDeviceIdsList() - .equals(other.getOutputTensorDeviceIdsList())) 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) + OP_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOpType().hashCode(); - hash = (37 * hash) + NUM_OUTPUTS_FIELD_NUMBER; - hash = (53 * hash) + getNumOutputs(); - hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; - hash = (53 * hash) + getGraphId().hashCode(); - if (getInputTensorIdsCount() > 0) { - hash = (37 * hash) + INPUT_TENSOR_IDS_FIELD_NUMBER; - hash = (53 * hash) + getInputTensorIdsList().hashCode(); - } - if (getOutputTensorIdsCount() > 0) { - hash = (37 * hash) + OUTPUT_TENSOR_IDS_FIELD_NUMBER; - hash = (53 * hash) + getOutputTensorIdsList().hashCode(); - } - hash = (37 * hash) + TENSOR_DEBUG_MODE_FIELD_NUMBER; - hash = (53 * hash) + tensorDebugMode_; - if (getTensorProtosCount() > 0) { - hash = (37 * hash) + TENSOR_PROTOS_FIELD_NUMBER; - hash = (53 * hash) + getTensorProtosList().hashCode(); - } - if (hasCodeLocation()) { - hash = (37 * hash) + CODE_LOCATION_FIELD_NUMBER; - hash = (53 * hash) + getCodeLocation().hashCode(); - } - if (getOutputTensorDeviceIdsCount() > 0) { - hash = (37 * hash) + OUTPUT_TENSOR_DEVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getOutputTensorDeviceIdsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.Execution parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Execution 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.Execution parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Execution 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.Execution parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.Execution parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.Execution parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Execution 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.Execution parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Execution 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.Execution parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.Execution 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.util.Execution 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; - } - /** - *
    -   * Data relating to the eager execution of an op or a Graph.
    -   * For a op that generates N output tensors (N >= 0), only one
    -   * Execution proto will be used to describe the execution event.
    -   * 
    - * - * Protobuf type {@code tensorflow.Execution} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.Execution) - org.tensorflow.proto.util.ExecutionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_Execution_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.Execution.class, org.tensorflow.proto.util.Execution.Builder.class); - } - - // Construct using org.tensorflow.proto.util.Execution.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorProtosFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - opType_ = ""; - - numOutputs_ = 0; - - graphId_ = ""; - - inputTensorIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - outputTensorIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - tensorDebugMode_ = 0; - - if (tensorProtosBuilder_ == null) { - tensorProtos_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - tensorProtosBuilder_.clear(); - } - if (codeLocationBuilder_ == null) { - codeLocation_ = null; - } else { - codeLocation_ = null; - codeLocationBuilder_ = null; - } - outputTensorDeviceIds_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.Execution getDefaultInstanceForType() { - return org.tensorflow.proto.util.Execution.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.Execution build() { - org.tensorflow.proto.util.Execution result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.Execution buildPartial() { - org.tensorflow.proto.util.Execution result = new org.tensorflow.proto.util.Execution(this); - int from_bitField0_ = bitField0_; - result.opType_ = opType_; - result.numOutputs_ = numOutputs_; - result.graphId_ = graphId_; - if (((bitField0_ & 0x00000001) != 0)) { - inputTensorIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.inputTensorIds_ = inputTensorIds_; - if (((bitField0_ & 0x00000002) != 0)) { - outputTensorIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.outputTensorIds_ = outputTensorIds_; - result.tensorDebugMode_ = tensorDebugMode_; - if (tensorProtosBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - tensorProtos_ = java.util.Collections.unmodifiableList(tensorProtos_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.tensorProtos_ = tensorProtos_; - } else { - result.tensorProtos_ = tensorProtosBuilder_.build(); - } - if (codeLocationBuilder_ == null) { - result.codeLocation_ = codeLocation_; - } else { - result.codeLocation_ = codeLocationBuilder_.build(); - } - if (((bitField0_ & 0x00000008) != 0)) { - outputTensorDeviceIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.outputTensorDeviceIds_ = outputTensorDeviceIds_; - 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.util.Execution) { - return mergeFrom((org.tensorflow.proto.util.Execution)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.Execution other) { - if (other == org.tensorflow.proto.util.Execution.getDefaultInstance()) return this; - if (!other.getOpType().isEmpty()) { - opType_ = other.opType_; - onChanged(); - } - if (other.getNumOutputs() != 0) { - setNumOutputs(other.getNumOutputs()); - } - if (!other.getGraphId().isEmpty()) { - graphId_ = other.graphId_; - onChanged(); - } - if (!other.inputTensorIds_.isEmpty()) { - if (inputTensorIds_.isEmpty()) { - inputTensorIds_ = other.inputTensorIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputTensorIdsIsMutable(); - inputTensorIds_.addAll(other.inputTensorIds_); - } - onChanged(); - } - if (!other.outputTensorIds_.isEmpty()) { - if (outputTensorIds_.isEmpty()) { - outputTensorIds_ = other.outputTensorIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.addAll(other.outputTensorIds_); - } - onChanged(); - } - if (other.tensorDebugMode_ != 0) { - setTensorDebugModeValue(other.getTensorDebugModeValue()); - } - if (tensorProtosBuilder_ == null) { - if (!other.tensorProtos_.isEmpty()) { - if (tensorProtos_.isEmpty()) { - tensorProtos_ = other.tensorProtos_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureTensorProtosIsMutable(); - tensorProtos_.addAll(other.tensorProtos_); - } - onChanged(); - } - } else { - if (!other.tensorProtos_.isEmpty()) { - if (tensorProtosBuilder_.isEmpty()) { - tensorProtosBuilder_.dispose(); - tensorProtosBuilder_ = null; - tensorProtos_ = other.tensorProtos_; - bitField0_ = (bitField0_ & ~0x00000004); - tensorProtosBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorProtosFieldBuilder() : null; - } else { - tensorProtosBuilder_.addAllMessages(other.tensorProtos_); - } - } - } - if (other.hasCodeLocation()) { - mergeCodeLocation(other.getCodeLocation()); - } - if (!other.outputTensorDeviceIds_.isEmpty()) { - if (outputTensorDeviceIds_.isEmpty()) { - outputTensorDeviceIds_ = other.outputTensorDeviceIds_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureOutputTensorDeviceIdsIsMutable(); - outputTensorDeviceIds_.addAll(other.outputTensorDeviceIds_); - } - onChanged(); - } - 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.util.Execution parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.Execution) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object opType_ = ""; - /** - *
    -     * Op type (e.g., "MatMul").
    -     * In the case of a Graph, this is the name of the Graph.
    -     * 
    - * - * string op_type = 1; - */ - public java.lang.String getOpType() { - java.lang.Object ref = opType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Op type (e.g., "MatMul").
    -     * In the case of a Graph, this is the name of the Graph.
    -     * 
    - * - * string op_type = 1; - */ - public com.google.protobuf.ByteString - getOpTypeBytes() { - java.lang.Object ref = opType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Op type (e.g., "MatMul").
    -     * In the case of a Graph, this is the name of the Graph.
    -     * 
    - * - * string op_type = 1; - */ - public Builder setOpType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opType_ = value; - onChanged(); - return this; - } - /** - *
    -     * Op type (e.g., "MatMul").
    -     * In the case of a Graph, this is the name of the Graph.
    -     * 
    - * - * string op_type = 1; - */ - public Builder clearOpType() { - - opType_ = getDefaultInstance().getOpType(); - onChanged(); - return this; - } - /** - *
    -     * Op type (e.g., "MatMul").
    -     * In the case of a Graph, this is the name of the Graph.
    -     * 
    - * - * string op_type = 1; - */ - public Builder setOpTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opType_ = value; - onChanged(); - return this; - } - - private int numOutputs_ ; - /** - *
    -     * Number of output tensors.
    -     * 
    - * - * int32 num_outputs = 2; - */ - public int getNumOutputs() { - return numOutputs_; - } - /** - *
    -     * Number of output tensors.
    -     * 
    - * - * int32 num_outputs = 2; - */ - public Builder setNumOutputs(int value) { - - numOutputs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of output tensors.
    -     * 
    - * - * int32 num_outputs = 2; - */ - public Builder clearNumOutputs() { - - numOutputs_ = 0; - onChanged(); - return this; - } - - private java.lang.Object graphId_ = ""; - /** - *
    -     * The graph that's executed: applicable only to the eager
    -     * execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 3; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The graph that's executed: applicable only to the eager
    -     * execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 3; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The graph that's executed: applicable only to the eager
    -     * execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 3; - */ - public Builder setGraphId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphId_ = value; - onChanged(); - return this; - } - /** - *
    -     * The graph that's executed: applicable only to the eager
    -     * execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 3; - */ - public Builder clearGraphId() { - - graphId_ = getDefaultInstance().getGraphId(); - onChanged(); - return this; - } - /** - *
    -     * The graph that's executed: applicable only to the eager
    -     * execution of a FuncGraph.
    -     * 
    - * - * string graph_id = 3; - */ - public Builder setGraphIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphId_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList inputTensorIds_ = emptyLongList(); - private void ensureInputTensorIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - inputTensorIds_ = mutableCopy(inputTensorIds_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public java.util.List - getInputTensorIdsList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(inputTensorIds_) : inputTensorIds_; - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public int getInputTensorIdsCount() { - return inputTensorIds_.size(); - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public long getInputTensorIds(int index) { - return inputTensorIds_.getLong(index); - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public Builder setInputTensorIds( - int index, long value) { - ensureInputTensorIdsIsMutable(); - inputTensorIds_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public Builder addInputTensorIds(long value) { - ensureInputTensorIdsIsMutable(); - inputTensorIds_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public Builder addAllInputTensorIds( - java.lang.Iterable values) { - ensureInputTensorIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputTensorIds_); - onChanged(); - return this; - } - /** - *
    -     * IDs of the input tensors (if available).
    -     * 
    - * - * repeated int64 input_tensor_ids = 4; - */ - public Builder clearInputTensorIds() { - inputTensorIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList outputTensorIds_ = emptyLongList(); - private void ensureOutputTensorIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - outputTensorIds_ = mutableCopy(outputTensorIds_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public java.util.List - getOutputTensorIdsList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(outputTensorIds_) : outputTensorIds_; - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public int getOutputTensorIdsCount() { - return outputTensorIds_.size(); - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public long getOutputTensorIds(int index) { - return outputTensorIds_.getLong(index); - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public Builder setOutputTensorIds( - int index, long value) { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public Builder addOutputTensorIds(long value) { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.addLong(value); - onChanged(); - return this; - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public Builder addAllOutputTensorIds( - java.lang.Iterable values) { - ensureOutputTensorIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputTensorIds_); - onChanged(); - return this; - } - /** - *
    -     * IDs of the output tensors (if availbable).
    -     * If specified, must have the same length as tensor_protos.
    -     * 
    - * - * repeated int64 output_tensor_ids = 5; - */ - public Builder clearOutputTensorIds() { - outputTensorIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private int tensorDebugMode_ = 0; - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public int getTensorDebugModeValue() { - return tensorDebugMode_; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public Builder setTensorDebugModeValue(int value) { - tensorDebugMode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_); - return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public Builder setTensorDebugMode(org.tensorflow.proto.util.TensorDebugMode value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorDebugMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 6; - */ - public Builder clearTensorDebugMode() { - - tensorDebugMode_ = 0; - onChanged(); - return this; - } - - private java.util.List tensorProtos_ = - java.util.Collections.emptyList(); - private void ensureTensorProtosIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - tensorProtos_ = new java.util.ArrayList(tensorProtos_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorProtosBuilder_; - - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public java.util.List getTensorProtosList() { - if (tensorProtosBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensorProtos_); - } else { - return tensorProtosBuilder_.getMessageList(); - } - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public int getTensorProtosCount() { - if (tensorProtosBuilder_ == null) { - return tensorProtos_.size(); - } else { - return tensorProtosBuilder_.getCount(); - } - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProto getTensorProtos(int index) { - if (tensorProtosBuilder_ == null) { - return tensorProtos_.get(index); - } else { - return tensorProtosBuilder_.getMessage(index); - } - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder setTensorProtos( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorProtosBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorProtosIsMutable(); - tensorProtos_.set(index, value); - onChanged(); - } else { - tensorProtosBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder setTensorProtos( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorProtosBuilder_ == null) { - ensureTensorProtosIsMutable(); - tensorProtos_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorProtosBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder addTensorProtos(org.tensorflow.proto.framework.TensorProto value) { - if (tensorProtosBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorProtosIsMutable(); - tensorProtos_.add(value); - onChanged(); - } else { - tensorProtosBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder addTensorProtos( - int index, org.tensorflow.proto.framework.TensorProto value) { - if (tensorProtosBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorProtosIsMutable(); - tensorProtos_.add(index, value); - onChanged(); - } else { - tensorProtosBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder addTensorProtos( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorProtosBuilder_ == null) { - ensureTensorProtosIsMutable(); - tensorProtos_.add(builderForValue.build()); - onChanged(); - } else { - tensorProtosBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder addTensorProtos( - int index, org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorProtosBuilder_ == null) { - ensureTensorProtosIsMutable(); - tensorProtos_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorProtosBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder addAllTensorProtos( - java.lang.Iterable values) { - if (tensorProtosBuilder_ == null) { - ensureTensorProtosIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensorProtos_); - onChanged(); - } else { - tensorProtosBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder clearTensorProtos() { - if (tensorProtosBuilder_ == null) { - tensorProtos_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - tensorProtosBuilder_.clear(); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public Builder removeTensorProtos(int index) { - if (tensorProtosBuilder_ == null) { - ensureTensorProtosIsMutable(); - tensorProtos_.remove(index); - onChanged(); - } else { - tensorProtosBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorProtosBuilder( - int index) { - return getTensorProtosFieldBuilder().getBuilder(index); - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder( - int index) { - if (tensorProtosBuilder_ == null) { - return tensorProtos_.get(index); } else { - return tensorProtosBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public java.util.List - getTensorProtosOrBuilderList() { - if (tensorProtosBuilder_ != null) { - return tensorProtosBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensorProtos_); - } - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorProtosBuilder() { - return getTensorProtosFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public org.tensorflow.proto.framework.TensorProto.Builder addTensorProtosBuilder( - int index) { - return getTensorProtosFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorProto.getDefaultInstance()); - } - /** - *
    -     * Output Tensor values in the type described by `tensor_value_type`.
    -     * The length of this should match `num_outputs`.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor_protos = 7; - */ - public java.util.List - getTensorProtosBuilderList() { - return getTensorProtosFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorProtosFieldBuilder() { - if (tensorProtosBuilder_ == null) { - tensorProtosBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - tensorProtos_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - tensorProtos_ = null; - } - return tensorProtosBuilder_; - } - - private org.tensorflow.proto.util.CodeLocation codeLocation_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder> codeLocationBuilder_; - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public boolean hasCodeLocation() { - return codeLocationBuilder_ != null || codeLocation_ != null; - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation getCodeLocation() { - if (codeLocationBuilder_ == null) { - return codeLocation_ == null ? org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } else { - return codeLocationBuilder_.getMessage(); - } - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder setCodeLocation(org.tensorflow.proto.util.CodeLocation value) { - if (codeLocationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - codeLocation_ = value; - onChanged(); - } else { - codeLocationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder setCodeLocation( - org.tensorflow.proto.util.CodeLocation.Builder builderForValue) { - if (codeLocationBuilder_ == null) { - codeLocation_ = builderForValue.build(); - onChanged(); - } else { - codeLocationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder mergeCodeLocation(org.tensorflow.proto.util.CodeLocation value) { - if (codeLocationBuilder_ == null) { - if (codeLocation_ != null) { - codeLocation_ = - org.tensorflow.proto.util.CodeLocation.newBuilder(codeLocation_).mergeFrom(value).buildPartial(); - } else { - codeLocation_ = value; - } - onChanged(); - } else { - codeLocationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder clearCodeLocation() { - if (codeLocationBuilder_ == null) { - codeLocation_ = null; - onChanged(); - } else { - codeLocation_ = null; - codeLocationBuilder_ = null; - } - - return this; - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation.Builder getCodeLocationBuilder() { - - onChanged(); - return getCodeLocationFieldBuilder().getBuilder(); - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder() { - if (codeLocationBuilder_ != null) { - return codeLocationBuilder_.getMessageOrBuilder(); - } else { - return codeLocation_ == null ? - org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } - } - /** - *
    -     * Stack trace of the eager execution.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder> - getCodeLocationFieldBuilder() { - if (codeLocationBuilder_ == null) { - codeLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder>( - getCodeLocation(), - getParentForChildren(), - isClean()); - codeLocation_ = null; - } - return codeLocationBuilder_; - } - - private com.google.protobuf.Internal.IntList outputTensorDeviceIds_ = emptyIntList(); - private void ensureOutputTensorDeviceIdsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - outputTensorDeviceIds_ = mutableCopy(outputTensorDeviceIds_); - bitField0_ |= 0x00000008; - } - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public java.util.List - getOutputTensorDeviceIdsList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(outputTensorDeviceIds_) : outputTensorDeviceIds_; - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public int getOutputTensorDeviceIdsCount() { - return outputTensorDeviceIds_.size(); - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public int getOutputTensorDeviceIds(int index) { - return outputTensorDeviceIds_.getInt(index); - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public Builder setOutputTensorDeviceIds( - int index, int value) { - ensureOutputTensorDeviceIdsIsMutable(); - outputTensorDeviceIds_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public Builder addOutputTensorDeviceIds(int value) { - ensureOutputTensorDeviceIdsIsMutable(); - outputTensorDeviceIds_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public Builder addAllOutputTensorDeviceIds( - java.lang.Iterable values) { - ensureOutputTensorDeviceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputTensorDeviceIds_); - onChanged(); - return this; - } - /** - *
    -     * Debugged-generated IDs of the devices on which the output tensors reside.
    -     * To look up details about the device (e.g., name), cross-reference this
    -     * field with the DebuggedDevice messages.
    -     * 
    - * - * repeated int32 output_tensor_device_ids = 9; - */ - public Builder clearOutputTensorDeviceIds() { - outputTensorDeviceIds_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - 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.Execution) - } - - // @@protoc_insertion_point(class_scope:tensorflow.Execution) - private static final org.tensorflow.proto.util.Execution DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.Execution(); - } - - public static org.tensorflow.proto.util.Execution getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Execution parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Execution(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.util.Execution getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTrace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTrace.java deleted file mode 100644 index 3ea9e244ff2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTrace.java +++ /dev/null @@ -1,1359 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Data relating to an execution of a Graph (e.g., an eager execution of a
    - * FuncGraph).
    - * The values of the intermediate tensors computed in the graph are recorded
    - * in this proto. A graph execution may correspond to one or more pieces of
    - * `GraphExecutionTrace`, depending on whether the instrumented tensor values
    - * are summarized in an aggregated or separate fashion.
    - * 
    - * - * Protobuf type {@code tensorflow.GraphExecutionTrace} - */ -public final class GraphExecutionTrace extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphExecutionTrace) - GraphExecutionTraceOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphExecutionTrace.newBuilder() to construct. - private GraphExecutionTrace(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphExecutionTrace() { - tfdbgContextId_ = ""; - opName_ = ""; - tensorDebugMode_ = 0; - deviceName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphExecutionTrace(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphExecutionTrace( - 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(); - - tfdbgContextId_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - opName_ = s; - break; - } - case 24: { - - outputSlot_ = input.readInt32(); - break; - } - case 32: { - int rawValue = input.readEnum(); - - tensorDebugMode_ = rawValue; - break; - } - case 42: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (tensorProto_ != null) { - subBuilder = tensorProto_.toBuilder(); - } - tensorProto_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorProto_); - tensorProto_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceName_ = s; - 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.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.GraphExecutionTrace.class, org.tensorflow.proto.util.GraphExecutionTrace.Builder.class); - } - - public static final int TFDBG_CONTEXT_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object tfdbgContextId_; - /** - *
    -   * Unique ID of the context that the executed op(s) belong to (e.g., a
    -   * compiled concrete tf.function).
    -   * 
    - * - * string tfdbg_context_id = 1; - */ - public java.lang.String getTfdbgContextId() { - java.lang.Object ref = tfdbgContextId_; - 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(); - tfdbgContextId_ = s; - return s; - } - } - /** - *
    -   * Unique ID of the context that the executed op(s) belong to (e.g., a
    -   * compiled concrete tf.function).
    -   * 
    - * - * string tfdbg_context_id = 1; - */ - public com.google.protobuf.ByteString - getTfdbgContextIdBytes() { - java.lang.Object ref = tfdbgContextId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfdbgContextId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OP_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object opName_; - /** - *
    -   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -   * level).
    -   * 
    - * - * string op_name = 2; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - 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(); - opName_ = s; - return s; - } - } - /** - *
    -   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -   * level).
    -   * 
    - * - * string op_name = 2; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OUTPUT_SLOT_FIELD_NUMBER = 3; - private int outputSlot_; - /** - *
    -   * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    -   * trace level).
    -   * 
    - * - * int32 output_slot = 3; - */ - public int getOutputSlot() { - return outputSlot_; - } - - public static final int TENSOR_DEBUG_MODE_FIELD_NUMBER = 4; - private int tensorDebugMode_; - /** - *
    -   * Type of the tensor value encapsulated in this proto.
    -   * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public int getTensorDebugModeValue() { - return tensorDebugMode_; - } - /** - *
    -   * Type of the tensor value encapsulated in this proto.
    -   * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_); - return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result; - } - - public static final int TENSOR_PROTO_FIELD_NUMBER = 5; - private org.tensorflow.proto.framework.TensorProto tensorProto_; - /** - *
    -   * Tensor value in the type described by `tensor_value_type`.
    -   * This tensor may summarize the value of a single intermediate op of the
    -   * graph, or those of multiple intermediate tensors.
    -   * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public boolean hasTensorProto() { - return tensorProto_ != null; - } - /** - *
    -   * Tensor value in the type described by `tensor_value_type`.
    -   * This tensor may summarize the value of a single intermediate op of the
    -   * graph, or those of multiple intermediate tensors.
    -   * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public org.tensorflow.proto.framework.TensorProto getTensorProto() { - return tensorProto_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_; - } - /** - *
    -   * Tensor value in the type described by `tensor_value_type`.
    -   * This tensor may summarize the value of a single intermediate op of the
    -   * graph, or those of multiple intermediate tensors.
    -   * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtoOrBuilder() { - return getTensorProto(); - } - - public static final int DEVICE_NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object deviceName_; - /** - *
    -   * Name of the device that the op belongs to.
    -   * 
    - * - * string device_name = 6; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - 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(); - deviceName_ = s; - return s; - } - } - /** - *
    -   * Name of the device that the op belongs to.
    -   * 
    - * - * string device_name = 6; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getTfdbgContextIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tfdbgContextId_); - } - if (!getOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, opName_); - } - if (outputSlot_ != 0) { - output.writeInt32(3, outputSlot_); - } - if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) { - output.writeEnum(4, tensorDebugMode_); - } - if (tensorProto_ != null) { - output.writeMessage(5, getTensorProto()); - } - if (!getDeviceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, deviceName_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTfdbgContextIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tfdbgContextId_); - } - if (!getOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, opName_); - } - if (outputSlot_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, outputSlot_); - } - if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, tensorDebugMode_); - } - if (tensorProto_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getTensorProto()); - } - if (!getDeviceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, deviceName_); - } - 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.util.GraphExecutionTrace)) { - return super.equals(obj); - } - org.tensorflow.proto.util.GraphExecutionTrace other = (org.tensorflow.proto.util.GraphExecutionTrace) obj; - - if (!getTfdbgContextId() - .equals(other.getTfdbgContextId())) return false; - if (!getOpName() - .equals(other.getOpName())) return false; - if (getOutputSlot() - != other.getOutputSlot()) return false; - if (tensorDebugMode_ != other.tensorDebugMode_) return false; - if (hasTensorProto() != other.hasTensorProto()) return false; - if (hasTensorProto()) { - if (!getTensorProto() - .equals(other.getTensorProto())) return false; - } - if (!getDeviceName() - .equals(other.getDeviceName())) 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) + TFDBG_CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getTfdbgContextId().hashCode(); - hash = (37 * hash) + OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getOpName().hashCode(); - hash = (37 * hash) + OUTPUT_SLOT_FIELD_NUMBER; - hash = (53 * hash) + getOutputSlot(); - hash = (37 * hash) + TENSOR_DEBUG_MODE_FIELD_NUMBER; - hash = (53 * hash) + tensorDebugMode_; - if (hasTensorProto()) { - hash = (37 * hash) + TENSOR_PROTO_FIELD_NUMBER; - hash = (53 * hash) + getTensorProto().hashCode(); - } - hash = (37 * hash) + DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDeviceName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphExecutionTrace 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.GraphExecutionTrace parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphExecutionTrace 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.GraphExecutionTrace parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphExecutionTrace 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.GraphExecutionTrace parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphExecutionTrace 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.GraphExecutionTrace parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace 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; - } - /** - *
    -   * Data relating to an execution of a Graph (e.g., an eager execution of a
    -   * FuncGraph).
    -   * The values of the intermediate tensors computed in the graph are recorded
    -   * in this proto. A graph execution may correspond to one or more pieces of
    -   * `GraphExecutionTrace`, depending on whether the instrumented tensor values
    -   * are summarized in an aggregated or separate fashion.
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphExecutionTrace} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphExecutionTrace) - org.tensorflow.proto.util.GraphExecutionTraceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.GraphExecutionTrace.class, org.tensorflow.proto.util.GraphExecutionTrace.Builder.class); - } - - // Construct using org.tensorflow.proto.util.GraphExecutionTrace.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(); - tfdbgContextId_ = ""; - - opName_ = ""; - - outputSlot_ = 0; - - tensorDebugMode_ = 0; - - if (tensorProtoBuilder_ == null) { - tensorProto_ = null; - } else { - tensorProto_ = null; - tensorProtoBuilder_ = null; - } - deviceName_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphExecutionTrace getDefaultInstanceForType() { - return org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphExecutionTrace build() { - org.tensorflow.proto.util.GraphExecutionTrace result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphExecutionTrace buildPartial() { - org.tensorflow.proto.util.GraphExecutionTrace result = new org.tensorflow.proto.util.GraphExecutionTrace(this); - result.tfdbgContextId_ = tfdbgContextId_; - result.opName_ = opName_; - result.outputSlot_ = outputSlot_; - result.tensorDebugMode_ = tensorDebugMode_; - if (tensorProtoBuilder_ == null) { - result.tensorProto_ = tensorProto_; - } else { - result.tensorProto_ = tensorProtoBuilder_.build(); - } - result.deviceName_ = deviceName_; - 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.util.GraphExecutionTrace) { - return mergeFrom((org.tensorflow.proto.util.GraphExecutionTrace)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.GraphExecutionTrace other) { - if (other == org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance()) return this; - if (!other.getTfdbgContextId().isEmpty()) { - tfdbgContextId_ = other.tfdbgContextId_; - onChanged(); - } - if (!other.getOpName().isEmpty()) { - opName_ = other.opName_; - onChanged(); - } - if (other.getOutputSlot() != 0) { - setOutputSlot(other.getOutputSlot()); - } - if (other.tensorDebugMode_ != 0) { - setTensorDebugModeValue(other.getTensorDebugModeValue()); - } - if (other.hasTensorProto()) { - mergeTensorProto(other.getTensorProto()); - } - if (!other.getDeviceName().isEmpty()) { - deviceName_ = other.deviceName_; - onChanged(); - } - 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.util.GraphExecutionTrace parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.GraphExecutionTrace) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object tfdbgContextId_ = ""; - /** - *
    -     * Unique ID of the context that the executed op(s) belong to (e.g., a
    -     * compiled concrete tf.function).
    -     * 
    - * - * string tfdbg_context_id = 1; - */ - public java.lang.String getTfdbgContextId() { - java.lang.Object ref = tfdbgContextId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tfdbgContextId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Unique ID of the context that the executed op(s) belong to (e.g., a
    -     * compiled concrete tf.function).
    -     * 
    - * - * string tfdbg_context_id = 1; - */ - public com.google.protobuf.ByteString - getTfdbgContextIdBytes() { - java.lang.Object ref = tfdbgContextId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfdbgContextId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Unique ID of the context that the executed op(s) belong to (e.g., a
    -     * compiled concrete tf.function).
    -     * 
    - * - * string tfdbg_context_id = 1; - */ - public Builder setTfdbgContextId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tfdbgContextId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Unique ID of the context that the executed op(s) belong to (e.g., a
    -     * compiled concrete tf.function).
    -     * 
    - * - * string tfdbg_context_id = 1; - */ - public Builder clearTfdbgContextId() { - - tfdbgContextId_ = getDefaultInstance().getTfdbgContextId(); - onChanged(); - return this; - } - /** - *
    -     * Unique ID of the context that the executed op(s) belong to (e.g., a
    -     * compiled concrete tf.function).
    -     * 
    - * - * string tfdbg_context_id = 1; - */ - public Builder setTfdbgContextIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tfdbgContextId_ = value; - onChanged(); - return this; - } - - private java.lang.Object opName_ = ""; - /** - *
    -     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -     * level).
    -     * 
    - * - * string op_name = 2; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -     * level).
    -     * 
    - * - * string op_name = 2; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -     * level).
    -     * 
    - * - * string op_name = 2; - */ - public Builder setOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -     * level).
    -     * 
    - * - * string op_name = 2; - */ - public Builder clearOpName() { - - opName_ = getDefaultInstance().getOpName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    -     * level).
    -     * 
    - * - * string op_name = 2; - */ - public Builder setOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opName_ = value; - onChanged(); - return this; - } - - private int outputSlot_ ; - /** - *
    -     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    -     * trace level).
    -     * 
    - * - * int32 output_slot = 3; - */ - public int getOutputSlot() { - return outputSlot_; - } - /** - *
    -     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    -     * trace level).
    -     * 
    - * - * int32 output_slot = 3; - */ - public Builder setOutputSlot(int value) { - - outputSlot_ = value; - onChanged(); - return this; - } - /** - *
    -     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    -     * trace level).
    -     * 
    - * - * int32 output_slot = 3; - */ - public Builder clearOutputSlot() { - - outputSlot_ = 0; - onChanged(); - return this; - } - - private int tensorDebugMode_ = 0; - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public int getTensorDebugModeValue() { - return tensorDebugMode_; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public Builder setTensorDebugModeValue(int value) { - tensorDebugMode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_); - return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public Builder setTensorDebugMode(org.tensorflow.proto.util.TensorDebugMode value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorDebugMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor value encapsulated in this proto.
    -     * 
    - * - * .tensorflow.TensorDebugMode tensor_debug_mode = 4; - */ - public Builder clearTensorDebugMode() { - - tensorDebugMode_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.TensorProto tensorProto_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorProtoBuilder_; - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public boolean hasTensorProto() { - return tensorProtoBuilder_ != null || tensorProto_ != null; - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public org.tensorflow.proto.framework.TensorProto getTensorProto() { - if (tensorProtoBuilder_ == null) { - return tensorProto_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_; - } else { - return tensorProtoBuilder_.getMessage(); - } - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public Builder setTensorProto(org.tensorflow.proto.framework.TensorProto value) { - if (tensorProtoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorProto_ = value; - onChanged(); - } else { - tensorProtoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public Builder setTensorProto( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (tensorProtoBuilder_ == null) { - tensorProto_ = builderForValue.build(); - onChanged(); - } else { - tensorProtoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public Builder mergeTensorProto(org.tensorflow.proto.framework.TensorProto value) { - if (tensorProtoBuilder_ == null) { - if (tensorProto_ != null) { - tensorProto_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(tensorProto_).mergeFrom(value).buildPartial(); - } else { - tensorProto_ = value; - } - onChanged(); - } else { - tensorProtoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public Builder clearTensorProto() { - if (tensorProtoBuilder_ == null) { - tensorProto_ = null; - onChanged(); - } else { - tensorProto_ = null; - tensorProtoBuilder_ = null; - } - - return this; - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getTensorProtoBuilder() { - - onChanged(); - return getTensorProtoFieldBuilder().getBuilder(); - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtoOrBuilder() { - if (tensorProtoBuilder_ != null) { - return tensorProtoBuilder_.getMessageOrBuilder(); - } else { - return tensorProto_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_; - } - } - /** - *
    -     * Tensor value in the type described by `tensor_value_type`.
    -     * This tensor may summarize the value of a single intermediate op of the
    -     * graph, or those of multiple intermediate tensors.
    -     * 
    - * - * .tensorflow.TensorProto tensor_proto = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getTensorProtoFieldBuilder() { - if (tensorProtoBuilder_ == null) { - tensorProtoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getTensorProto(), - getParentForChildren(), - isClean()); - tensorProto_ = null; - } - return tensorProtoBuilder_; - } - - private java.lang.Object deviceName_ = ""; - /** - *
    -     * Name of the device that the op belongs to.
    -     * 
    - * - * string device_name = 6; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the device that the op belongs to.
    -     * 
    - * - * string device_name = 6; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the device that the op belongs to.
    -     * 
    - * - * string device_name = 6; - */ - public Builder setDeviceName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the device that the op belongs to.
    -     * 
    - * - * string device_name = 6; - */ - public Builder clearDeviceName() { - - deviceName_ = getDefaultInstance().getDeviceName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the device that the op belongs to.
    -     * 
    - * - * string device_name = 6; - */ - public Builder setDeviceNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceName_ = value; - 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.GraphExecutionTrace) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphExecutionTrace) - private static final org.tensorflow.proto.util.GraphExecutionTrace DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.GraphExecutionTrace(); - } - - public static org.tensorflow.proto.util.GraphExecutionTrace getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphExecutionTrace parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphExecutionTrace(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.util.GraphExecutionTrace getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreation.java deleted file mode 100644 index da8a4523ec0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreation.java +++ /dev/null @@ -1,1936 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * The creation of an op in a TensorFlow Graph (e.g., FuncGraph in TF2).
    - * 
    - * - * Protobuf type {@code tensorflow.GraphOpCreation} - */ -public final class GraphOpCreation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GraphOpCreation) - GraphOpCreationOrBuilder { -private static final long serialVersionUID = 0L; - // Use GraphOpCreation.newBuilder() to construct. - private GraphOpCreation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GraphOpCreation() { - opType_ = ""; - opName_ = ""; - graphName_ = ""; - graphId_ = ""; - deviceName_ = ""; - inputNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - outputTensorIds_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GraphOpCreation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GraphOpCreation( - 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(); - - opType_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - opName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - graphName_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - graphId_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceName_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - inputNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - inputNames_.add(s); - break; - } - case 56: { - - numOutputs_ = input.readInt32(); - break; - } - case 66: { - org.tensorflow.proto.util.CodeLocation.Builder subBuilder = null; - if (codeLocation_ != null) { - subBuilder = codeLocation_.toBuilder(); - } - codeLocation_ = input.readMessage(org.tensorflow.proto.util.CodeLocation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(codeLocation_); - codeLocation_ = subBuilder.buildPartial(); - } - - break; - } - case 72: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputTensorIds_ = newIntList(); - mutable_bitField0_ |= 0x00000002; - } - outputTensorIds_.addInt(input.readInt32()); - break; - } - case 74: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - outputTensorIds_ = newIntList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - outputTensorIds_.addInt(input.readInt32()); - } - input.popLimit(limit); - 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)) { - inputNames_ = inputNames_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - outputTensorIds_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.GraphOpCreation.class, org.tensorflow.proto.util.GraphOpCreation.Builder.class); - } - - public static final int OP_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object opType_; - /** - *
    -   * Type of the op (e.g., "MatMul").
    -   * 
    - * - * string op_type = 1; - */ - public java.lang.String getOpType() { - java.lang.Object ref = opType_; - 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(); - opType_ = s; - return s; - } - } - /** - *
    -   * Type of the op (e.g., "MatMul").
    -   * 
    - * - * string op_type = 1; - */ - public com.google.protobuf.ByteString - getOpTypeBytes() { - java.lang.Object ref = opType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OP_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object opName_; - /** - *
    -   * Name of the op (e.g., "Dense/MatMul_1").
    -   * 
    - * - * string op_name = 2; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - 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(); - opName_ = s; - return s; - } - } - /** - *
    -   * Name of the op (e.g., "Dense/MatMul_1").
    -   * 
    - * - * string op_name = 2; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPH_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object graphName_; - /** - *
    -   * Name of the graph that the op is a part of (if available).
    -   * 
    - * - * string graph_name = 3; - */ - public java.lang.String getGraphName() { - java.lang.Object ref = graphName_; - 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(); - graphName_ = s; - return s; - } - } - /** - *
    -   * Name of the graph that the op is a part of (if available).
    -   * 
    - * - * string graph_name = 3; - */ - public com.google.protobuf.ByteString - getGraphNameBytes() { - java.lang.Object ref = graphName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPH_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object graphId_; - /** - *
    -   * Unique ID of the graph (generated by debugger).
    -   * This is the ID of the immediately-enclosing graph.
    -   * 
    - * - * string graph_id = 4; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - 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(); - graphId_ = s; - return s; - } - } - /** - *
    -   * Unique ID of the graph (generated by debugger).
    -   * This is the ID of the immediately-enclosing graph.
    -   * 
    - * - * string graph_id = 4; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object deviceName_; - /** - *
    -   * Name of the device that the op is assigned to (if available).
    -   * 
    - * - * string device_name = 5; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - 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(); - deviceName_ = s; - return s; - } - } - /** - *
    -   * Name of the device that the op is assigned to (if available).
    -   * 
    - * - * string device_name = 5; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INPUT_NAMES_FIELD_NUMBER = 6; - private com.google.protobuf.LazyStringList inputNames_; - /** - *
    -   * Names of the input tensors to the op.
    -   * 
    - * - * repeated string input_names = 6; - */ - public com.google.protobuf.ProtocolStringList - getInputNamesList() { - return inputNames_; - } - /** - *
    -   * Names of the input tensors to the op.
    -   * 
    - * - * repeated string input_names = 6; - */ - public int getInputNamesCount() { - return inputNames_.size(); - } - /** - *
    -   * Names of the input tensors to the op.
    -   * 
    - * - * repeated string input_names = 6; - */ - public java.lang.String getInputNames(int index) { - return inputNames_.get(index); - } - /** - *
    -   * Names of the input tensors to the op.
    -   * 
    - * - * repeated string input_names = 6; - */ - public com.google.protobuf.ByteString - getInputNamesBytes(int index) { - return inputNames_.getByteString(index); - } - - public static final int NUM_OUTPUTS_FIELD_NUMBER = 7; - private int numOutputs_; - /** - *
    -   * Number of output tensors emitted by the op.
    -   * 
    - * - * int32 num_outputs = 7; - */ - public int getNumOutputs() { - return numOutputs_; - } - - public static final int CODE_LOCATION_FIELD_NUMBER = 8; - private org.tensorflow.proto.util.CodeLocation codeLocation_; - /** - *
    -   * The unique ID for code location (stack trace) of the op's creation.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public boolean hasCodeLocation() { - return codeLocation_ != null; - } - /** - *
    -   * The unique ID for code location (stack trace) of the op's creation.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation getCodeLocation() { - return codeLocation_ == null ? org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } - /** - *
    -   * The unique ID for code location (stack trace) of the op's creation.
    -   * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder() { - return getCodeLocation(); - } - - public static final int OUTPUT_TENSOR_IDS_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.IntList outputTensorIds_; - /** - *
    -   * Unique IDs for the output tensors of this op.
    -   * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public java.util.List - getOutputTensorIdsList() { - return outputTensorIds_; - } - /** - *
    -   * Unique IDs for the output tensors of this op.
    -   * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public int getOutputTensorIdsCount() { - return outputTensorIds_.size(); - } - /** - *
    -   * Unique IDs for the output tensors of this op.
    -   * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public int getOutputTensorIds(int index) { - return outputTensorIds_.getInt(index); - } - private int outputTensorIdsMemoizedSerializedSize = -1; - - 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 { - getSerializedSize(); - if (!getOpTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, opType_); - } - if (!getOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, opName_); - } - if (!getGraphNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, graphName_); - } - if (!getGraphIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, graphId_); - } - if (!getDeviceNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, deviceName_); - } - for (int i = 0; i < inputNames_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, inputNames_.getRaw(i)); - } - if (numOutputs_ != 0) { - output.writeInt32(7, numOutputs_); - } - if (codeLocation_ != null) { - output.writeMessage(8, getCodeLocation()); - } - if (getOutputTensorIdsList().size() > 0) { - output.writeUInt32NoTag(74); - output.writeUInt32NoTag(outputTensorIdsMemoizedSerializedSize); - } - for (int i = 0; i < outputTensorIds_.size(); i++) { - output.writeInt32NoTag(outputTensorIds_.getInt(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getOpTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, opType_); - } - if (!getOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, opName_); - } - if (!getGraphNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, graphName_); - } - if (!getGraphIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, graphId_); - } - if (!getDeviceNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, deviceName_); - } - { - int dataSize = 0; - for (int i = 0; i < inputNames_.size(); i++) { - dataSize += computeStringSizeNoTag(inputNames_.getRaw(i)); - } - size += dataSize; - size += 1 * getInputNamesList().size(); - } - if (numOutputs_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, numOutputs_); - } - if (codeLocation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getCodeLocation()); - } - { - int dataSize = 0; - for (int i = 0; i < outputTensorIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(outputTensorIds_.getInt(i)); - } - size += dataSize; - if (!getOutputTensorIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - outputTensorIdsMemoizedSerializedSize = dataSize; - } - 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.util.GraphOpCreation)) { - return super.equals(obj); - } - org.tensorflow.proto.util.GraphOpCreation other = (org.tensorflow.proto.util.GraphOpCreation) obj; - - if (!getOpType() - .equals(other.getOpType())) return false; - if (!getOpName() - .equals(other.getOpName())) return false; - if (!getGraphName() - .equals(other.getGraphName())) return false; - if (!getGraphId() - .equals(other.getGraphId())) return false; - if (!getDeviceName() - .equals(other.getDeviceName())) return false; - if (!getInputNamesList() - .equals(other.getInputNamesList())) return false; - if (getNumOutputs() - != other.getNumOutputs()) return false; - if (hasCodeLocation() != other.hasCodeLocation()) return false; - if (hasCodeLocation()) { - if (!getCodeLocation() - .equals(other.getCodeLocation())) return false; - } - if (!getOutputTensorIdsList() - .equals(other.getOutputTensorIdsList())) 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) + OP_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOpType().hashCode(); - hash = (37 * hash) + OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getOpName().hashCode(); - hash = (37 * hash) + GRAPH_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphName().hashCode(); - hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; - hash = (53 * hash) + getGraphId().hashCode(); - hash = (37 * hash) + DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDeviceName().hashCode(); - if (getInputNamesCount() > 0) { - hash = (37 * hash) + INPUT_NAMES_FIELD_NUMBER; - hash = (53 * hash) + getInputNamesList().hashCode(); - } - hash = (37 * hash) + NUM_OUTPUTS_FIELD_NUMBER; - hash = (53 * hash) + getNumOutputs(); - if (hasCodeLocation()) { - hash = (37 * hash) + CODE_LOCATION_FIELD_NUMBER; - hash = (53 * hash) + getCodeLocation().hashCode(); - } - if (getOutputTensorIdsCount() > 0) { - hash = (37 * hash) + OUTPUT_TENSOR_IDS_FIELD_NUMBER; - hash = (53 * hash) + getOutputTensorIdsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.GraphOpCreation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphOpCreation 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.GraphOpCreation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphOpCreation 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.GraphOpCreation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.GraphOpCreation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.GraphOpCreation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphOpCreation 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.GraphOpCreation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphOpCreation 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.GraphOpCreation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.GraphOpCreation 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.util.GraphOpCreation 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; - } - /** - *
    -   * The creation of an op in a TensorFlow Graph (e.g., FuncGraph in TF2).
    -   * 
    - * - * Protobuf type {@code tensorflow.GraphOpCreation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GraphOpCreation) - org.tensorflow.proto.util.GraphOpCreationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.GraphOpCreation.class, org.tensorflow.proto.util.GraphOpCreation.Builder.class); - } - - // Construct using org.tensorflow.proto.util.GraphOpCreation.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(); - opType_ = ""; - - opName_ = ""; - - graphName_ = ""; - - graphId_ = ""; - - deviceName_ = ""; - - inputNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - numOutputs_ = 0; - - if (codeLocationBuilder_ == null) { - codeLocation_ = null; - } else { - codeLocation_ = null; - codeLocationBuilder_ = null; - } - outputTensorIds_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphOpCreation getDefaultInstanceForType() { - return org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphOpCreation build() { - org.tensorflow.proto.util.GraphOpCreation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.GraphOpCreation buildPartial() { - org.tensorflow.proto.util.GraphOpCreation result = new org.tensorflow.proto.util.GraphOpCreation(this); - int from_bitField0_ = bitField0_; - result.opType_ = opType_; - result.opName_ = opName_; - result.graphName_ = graphName_; - result.graphId_ = graphId_; - result.deviceName_ = deviceName_; - if (((bitField0_ & 0x00000001) != 0)) { - inputNames_ = inputNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.inputNames_ = inputNames_; - result.numOutputs_ = numOutputs_; - if (codeLocationBuilder_ == null) { - result.codeLocation_ = codeLocation_; - } else { - result.codeLocation_ = codeLocationBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - outputTensorIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.outputTensorIds_ = outputTensorIds_; - 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.util.GraphOpCreation) { - return mergeFrom((org.tensorflow.proto.util.GraphOpCreation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.GraphOpCreation other) { - if (other == org.tensorflow.proto.util.GraphOpCreation.getDefaultInstance()) return this; - if (!other.getOpType().isEmpty()) { - opType_ = other.opType_; - onChanged(); - } - if (!other.getOpName().isEmpty()) { - opName_ = other.opName_; - onChanged(); - } - if (!other.getGraphName().isEmpty()) { - graphName_ = other.graphName_; - onChanged(); - } - if (!other.getGraphId().isEmpty()) { - graphId_ = other.graphId_; - onChanged(); - } - if (!other.getDeviceName().isEmpty()) { - deviceName_ = other.deviceName_; - onChanged(); - } - if (!other.inputNames_.isEmpty()) { - if (inputNames_.isEmpty()) { - inputNames_ = other.inputNames_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputNamesIsMutable(); - inputNames_.addAll(other.inputNames_); - } - onChanged(); - } - if (other.getNumOutputs() != 0) { - setNumOutputs(other.getNumOutputs()); - } - if (other.hasCodeLocation()) { - mergeCodeLocation(other.getCodeLocation()); - } - if (!other.outputTensorIds_.isEmpty()) { - if (outputTensorIds_.isEmpty()) { - outputTensorIds_ = other.outputTensorIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.addAll(other.outputTensorIds_); - } - onChanged(); - } - 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.util.GraphOpCreation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.GraphOpCreation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object opType_ = ""; - /** - *
    -     * Type of the op (e.g., "MatMul").
    -     * 
    - * - * string op_type = 1; - */ - public java.lang.String getOpType() { - java.lang.Object ref = opType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Type of the op (e.g., "MatMul").
    -     * 
    - * - * string op_type = 1; - */ - public com.google.protobuf.ByteString - getOpTypeBytes() { - java.lang.Object ref = opType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Type of the op (e.g., "MatMul").
    -     * 
    - * - * string op_type = 1; - */ - public Builder setOpType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opType_ = value; - onChanged(); - return this; - } - /** - *
    -     * Type of the op (e.g., "MatMul").
    -     * 
    - * - * string op_type = 1; - */ - public Builder clearOpType() { - - opType_ = getDefaultInstance().getOpType(); - onChanged(); - return this; - } - /** - *
    -     * Type of the op (e.g., "MatMul").
    -     * 
    - * - * string op_type = 1; - */ - public Builder setOpTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opType_ = value; - onChanged(); - return this; - } - - private java.lang.Object opName_ = ""; - /** - *
    -     * Name of the op (e.g., "Dense/MatMul_1").
    -     * 
    - * - * string op_name = 2; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the op (e.g., "Dense/MatMul_1").
    -     * 
    - * - * string op_name = 2; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the op (e.g., "Dense/MatMul_1").
    -     * 
    - * - * string op_name = 2; - */ - public Builder setOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the op (e.g., "Dense/MatMul_1").
    -     * 
    - * - * string op_name = 2; - */ - public Builder clearOpName() { - - opName_ = getDefaultInstance().getOpName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the op (e.g., "Dense/MatMul_1").
    -     * 
    - * - * string op_name = 2; - */ - public Builder setOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opName_ = value; - onChanged(); - return this; - } - - private java.lang.Object graphName_ = ""; - /** - *
    -     * Name of the graph that the op is a part of (if available).
    -     * 
    - * - * string graph_name = 3; - */ - public java.lang.String getGraphName() { - java.lang.Object ref = graphName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the graph that the op is a part of (if available).
    -     * 
    - * - * string graph_name = 3; - */ - public com.google.protobuf.ByteString - getGraphNameBytes() { - java.lang.Object ref = graphName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the graph that the op is a part of (if available).
    -     * 
    - * - * string graph_name = 3; - */ - public Builder setGraphName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the graph that the op is a part of (if available).
    -     * 
    - * - * string graph_name = 3; - */ - public Builder clearGraphName() { - - graphName_ = getDefaultInstance().getGraphName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the graph that the op is a part of (if available).
    -     * 
    - * - * string graph_name = 3; - */ - public Builder setGraphNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphName_ = value; - onChanged(); - return this; - } - - private java.lang.Object graphId_ = ""; - /** - *
    -     * Unique ID of the graph (generated by debugger).
    -     * This is the ID of the immediately-enclosing graph.
    -     * 
    - * - * string graph_id = 4; - */ - public java.lang.String getGraphId() { - java.lang.Object ref = graphId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - graphId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Unique ID of the graph (generated by debugger).
    -     * This is the ID of the immediately-enclosing graph.
    -     * 
    - * - * string graph_id = 4; - */ - public com.google.protobuf.ByteString - getGraphIdBytes() { - java.lang.Object ref = graphId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - graphId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Unique ID of the graph (generated by debugger).
    -     * This is the ID of the immediately-enclosing graph.
    -     * 
    - * - * string graph_id = 4; - */ - public Builder setGraphId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphId_ = value; - onChanged(); - return this; - } - /** - *
    -     * Unique ID of the graph (generated by debugger).
    -     * This is the ID of the immediately-enclosing graph.
    -     * 
    - * - * string graph_id = 4; - */ - public Builder clearGraphId() { - - graphId_ = getDefaultInstance().getGraphId(); - onChanged(); - return this; - } - /** - *
    -     * Unique ID of the graph (generated by debugger).
    -     * This is the ID of the immediately-enclosing graph.
    -     * 
    - * - * string graph_id = 4; - */ - public Builder setGraphIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphId_ = value; - onChanged(); - return this; - } - - private java.lang.Object deviceName_ = ""; - /** - *
    -     * Name of the device that the op is assigned to (if available).
    -     * 
    - * - * string device_name = 5; - */ - public java.lang.String getDeviceName() { - java.lang.Object ref = deviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the device that the op is assigned to (if available).
    -     * 
    - * - * string device_name = 5; - */ - public com.google.protobuf.ByteString - getDeviceNameBytes() { - java.lang.Object ref = deviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the device that the op is assigned to (if available).
    -     * 
    - * - * string device_name = 5; - */ - public Builder setDeviceName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the device that the op is assigned to (if available).
    -     * 
    - * - * string device_name = 5; - */ - public Builder clearDeviceName() { - - deviceName_ = getDefaultInstance().getDeviceName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the device that the op is assigned to (if available).
    -     * 
    - * - * string device_name = 5; - */ - public Builder setDeviceNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList inputNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureInputNamesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - inputNames_ = new com.google.protobuf.LazyStringArrayList(inputNames_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public com.google.protobuf.ProtocolStringList - getInputNamesList() { - return inputNames_.getUnmodifiableView(); - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public int getInputNamesCount() { - return inputNames_.size(); - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public java.lang.String getInputNames(int index) { - return inputNames_.get(index); - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public com.google.protobuf.ByteString - getInputNamesBytes(int index) { - return inputNames_.getByteString(index); - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public Builder setInputNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputNamesIsMutable(); - inputNames_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public Builder addInputNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputNamesIsMutable(); - inputNames_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public Builder addAllInputNames( - java.lang.Iterable values) { - ensureInputNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputNames_); - onChanged(); - return this; - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public Builder clearInputNames() { - inputNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Names of the input tensors to the op.
    -     * 
    - * - * repeated string input_names = 6; - */ - public Builder addInputNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInputNamesIsMutable(); - inputNames_.add(value); - onChanged(); - return this; - } - - private int numOutputs_ ; - /** - *
    -     * Number of output tensors emitted by the op.
    -     * 
    - * - * int32 num_outputs = 7; - */ - public int getNumOutputs() { - return numOutputs_; - } - /** - *
    -     * Number of output tensors emitted by the op.
    -     * 
    - * - * int32 num_outputs = 7; - */ - public Builder setNumOutputs(int value) { - - numOutputs_ = value; - onChanged(); - return this; - } - /** - *
    -     * Number of output tensors emitted by the op.
    -     * 
    - * - * int32 num_outputs = 7; - */ - public Builder clearNumOutputs() { - - numOutputs_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.util.CodeLocation codeLocation_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder> codeLocationBuilder_; - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public boolean hasCodeLocation() { - return codeLocationBuilder_ != null || codeLocation_ != null; - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation getCodeLocation() { - if (codeLocationBuilder_ == null) { - return codeLocation_ == null ? org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } else { - return codeLocationBuilder_.getMessage(); - } - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder setCodeLocation(org.tensorflow.proto.util.CodeLocation value) { - if (codeLocationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - codeLocation_ = value; - onChanged(); - } else { - codeLocationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder setCodeLocation( - org.tensorflow.proto.util.CodeLocation.Builder builderForValue) { - if (codeLocationBuilder_ == null) { - codeLocation_ = builderForValue.build(); - onChanged(); - } else { - codeLocationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder mergeCodeLocation(org.tensorflow.proto.util.CodeLocation value) { - if (codeLocationBuilder_ == null) { - if (codeLocation_ != null) { - codeLocation_ = - org.tensorflow.proto.util.CodeLocation.newBuilder(codeLocation_).mergeFrom(value).buildPartial(); - } else { - codeLocation_ = value; - } - onChanged(); - } else { - codeLocationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public Builder clearCodeLocation() { - if (codeLocationBuilder_ == null) { - codeLocation_ = null; - onChanged(); - } else { - codeLocation_ = null; - codeLocationBuilder_ = null; - } - - return this; - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocation.Builder getCodeLocationBuilder() { - - onChanged(); - return getCodeLocationFieldBuilder().getBuilder(); - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - public org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder() { - if (codeLocationBuilder_ != null) { - return codeLocationBuilder_.getMessageOrBuilder(); - } else { - return codeLocation_ == null ? - org.tensorflow.proto.util.CodeLocation.getDefaultInstance() : codeLocation_; - } - } - /** - *
    -     * The unique ID for code location (stack trace) of the op's creation.
    -     * 
    - * - * .tensorflow.CodeLocation code_location = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder> - getCodeLocationFieldBuilder() { - if (codeLocationBuilder_ == null) { - codeLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.CodeLocation, org.tensorflow.proto.util.CodeLocation.Builder, org.tensorflow.proto.util.CodeLocationOrBuilder>( - getCodeLocation(), - getParentForChildren(), - isClean()); - codeLocation_ = null; - } - return codeLocationBuilder_; - } - - private com.google.protobuf.Internal.IntList outputTensorIds_ = emptyIntList(); - private void ensureOutputTensorIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - outputTensorIds_ = mutableCopy(outputTensorIds_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public java.util.List - getOutputTensorIdsList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(outputTensorIds_) : outputTensorIds_; - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public int getOutputTensorIdsCount() { - return outputTensorIds_.size(); - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public int getOutputTensorIds(int index) { - return outputTensorIds_.getInt(index); - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public Builder setOutputTensorIds( - int index, int value) { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public Builder addOutputTensorIds(int value) { - ensureOutputTensorIdsIsMutable(); - outputTensorIds_.addInt(value); - onChanged(); - return this; - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public Builder addAllOutputTensorIds( - java.lang.Iterable values) { - ensureOutputTensorIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputTensorIds_); - onChanged(); - return this; - } - /** - *
    -     * Unique IDs for the output tensors of this op.
    -     * 
    - * - * repeated int32 output_tensor_ids = 9; - */ - public Builder clearOutputTensorIds() { - outputTensorIds_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - 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.GraphOpCreation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GraphOpCreation) - private static final org.tensorflow.proto.util.GraphOpCreation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.GraphOpCreation(); - } - - public static org.tensorflow.proto.util.GraphOpCreation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GraphOpCreation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GraphOpCreation(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.util.GraphOpCreation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessage.java deleted file mode 100644 index 4104327961a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessage.java +++ /dev/null @@ -1,791 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Protocol buffer used for logging messages to the events file.
    - * This was theoretically used by the defunct tensorboard_logging module, which
    - * has been removed; this message is now deprecated and should not be used.
    - * 
    - * - * Protobuf type {@code tensorflow.LogMessage} - */ -@java.lang.Deprecated public final class LogMessage extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.LogMessage) - LogMessageOrBuilder { -private static final long serialVersionUID = 0L; - // Use LogMessage.newBuilder() to construct. - private LogMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LogMessage() { - level_ = 0; - message_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LogMessage(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LogMessage( - 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: { - int rawValue = input.readEnum(); - - level_ = rawValue; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - message_ = s; - 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.util.EventProtos.internal_static_tensorflow_LogMessage_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_LogMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.LogMessage.class, org.tensorflow.proto.util.LogMessage.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.LogMessage.Level} - */ - public enum Level - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - *
    -     * Note: The logging level 10 cannot be named DEBUG. Some software
    -     * projects compile their C/C++ code with -DDEBUG in debug builds. So the
    -     * C++ code generated from this file should not have an identifier named
    -     * DEBUG.
    -     * 
    - * - * DEBUGGING = 10; - */ - DEBUGGING(10), - /** - * INFO = 20; - */ - INFO(20), - /** - * WARN = 30; - */ - WARN(30), - /** - * ERROR = 40; - */ - ERROR(40), - /** - * FATAL = 50; - */ - FATAL(50), - UNRECOGNIZED(-1), - ; - - /** - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - *
    -     * Note: The logging level 10 cannot be named DEBUG. Some software
    -     * projects compile their C/C++ code with -DDEBUG in debug builds. So the
    -     * C++ code generated from this file should not have an identifier named
    -     * DEBUG.
    -     * 
    - * - * DEBUGGING = 10; - */ - public static final int DEBUGGING_VALUE = 10; - /** - * INFO = 20; - */ - public static final int INFO_VALUE = 20; - /** - * WARN = 30; - */ - public static final int WARN_VALUE = 30; - /** - * ERROR = 40; - */ - public static final int ERROR_VALUE = 40; - /** - * FATAL = 50; - */ - public static final int FATAL_VALUE = 50; - - - 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 Level valueOf(int value) { - return forNumber(value); - } - - public static Level forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 10: return DEBUGGING; - case 20: return INFO; - case 30: return WARN; - case 40: return ERROR; - case 50: return FATAL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Level> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Level findValueByNumber(int number) { - return Level.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.util.LogMessage.getDescriptor().getEnumTypes().get(0); - } - - private static final Level[] VALUES = values(); - - public static Level 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 Level(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.LogMessage.Level) - } - - public static final int LEVEL_FIELD_NUMBER = 1; - private int level_; - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public int getLevelValue() { - return level_; - } - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public org.tensorflow.proto.util.LogMessage.Level getLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.LogMessage.Level result = org.tensorflow.proto.util.LogMessage.Level.valueOf(level_); - return result == null ? org.tensorflow.proto.util.LogMessage.Level.UNRECOGNIZED : result; - } - - public static final int MESSAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object message_; - /** - * string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - 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(); - message_ = s; - return s; - } - } - /** - * string message = 2; - */ - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (level_ != org.tensorflow.proto.util.LogMessage.Level.UNKNOWN.getNumber()) { - output.writeEnum(1, level_); - } - if (!getMessageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (level_ != org.tensorflow.proto.util.LogMessage.Level.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, level_); - } - if (!getMessageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); - } - 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.util.LogMessage)) { - return super.equals(obj); - } - org.tensorflow.proto.util.LogMessage other = (org.tensorflow.proto.util.LogMessage) obj; - - if (level_ != other.level_) return false; - if (!getMessage() - .equals(other.getMessage())) 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) + LEVEL_FIELD_NUMBER; - hash = (53 * hash) + level_; - hash = (37 * hash) + MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getMessage().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.LogMessage parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.LogMessage 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.LogMessage parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.LogMessage 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.LogMessage parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.LogMessage parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.LogMessage parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.LogMessage 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.LogMessage parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.LogMessage 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.LogMessage parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.LogMessage 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.util.LogMessage 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; - } - /** - *
    -   * Protocol buffer used for logging messages to the events file.
    -   * This was theoretically used by the defunct tensorboard_logging module, which
    -   * has been removed; this message is now deprecated and should not be used.
    -   * 
    - * - * Protobuf type {@code tensorflow.LogMessage} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.LogMessage) - org.tensorflow.proto.util.LogMessageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_LogMessage_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_LogMessage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.LogMessage.class, org.tensorflow.proto.util.LogMessage.Builder.class); - } - - // Construct using org.tensorflow.proto.util.LogMessage.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(); - level_ = 0; - - message_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_LogMessage_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.LogMessage getDefaultInstanceForType() { - return org.tensorflow.proto.util.LogMessage.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.LogMessage build() { - org.tensorflow.proto.util.LogMessage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.LogMessage buildPartial() { - org.tensorflow.proto.util.LogMessage result = new org.tensorflow.proto.util.LogMessage(this); - result.level_ = level_; - result.message_ = message_; - 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.util.LogMessage) { - return mergeFrom((org.tensorflow.proto.util.LogMessage)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.LogMessage other) { - if (other == org.tensorflow.proto.util.LogMessage.getDefaultInstance()) return this; - if (other.level_ != 0) { - setLevelValue(other.getLevelValue()); - } - if (!other.getMessage().isEmpty()) { - message_ = other.message_; - onChanged(); - } - 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.util.LogMessage parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.LogMessage) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int level_ = 0; - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public int getLevelValue() { - return level_; - } - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public Builder setLevelValue(int value) { - level_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public org.tensorflow.proto.util.LogMessage.Level getLevel() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.LogMessage.Level result = org.tensorflow.proto.util.LogMessage.Level.valueOf(level_); - return result == null ? org.tensorflow.proto.util.LogMessage.Level.UNRECOGNIZED : result; - } - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public Builder setLevel(org.tensorflow.proto.util.LogMessage.Level value) { - if (value == null) { - throw new NullPointerException(); - } - - level_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.LogMessage.Level level = 1; - */ - public Builder clearLevel() { - - level_ = 0; - onChanged(); - return this; - } - - private java.lang.Object message_ = ""; - /** - * string message = 2; - */ - public java.lang.String getMessage() { - java.lang.Object ref = message_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - message_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string message = 2; - */ - public com.google.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string message = 2; - */ - public Builder setMessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - message_ = value; - onChanged(); - return this; - } - /** - * string message = 2; - */ - public Builder clearMessage() { - - message_ = getDefaultInstance().getMessage(); - onChanged(); - return this; - } - /** - * string message = 2; - */ - public Builder setMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - message_ = value; - 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.LogMessage) - } - - // @@protoc_insertion_point(class_scope:tensorflow.LogMessage) - private static final org.tensorflow.proto.util.LogMessage DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.LogMessage(); - } - - public static org.tensorflow.proto.util.LogMessage getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LogMessage parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LogMessage(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.util.LogMessage getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessageOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessageOrBuilder.java deleted file mode 100644 index bb57ab21916..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/LogMessageOrBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -@java.lang.Deprecated public interface LogMessageOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.LogMessage) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.LogMessage.Level level = 1; - */ - int getLevelValue(); - /** - * .tensorflow.LogMessage.Level level = 1; - */ - org.tensorflow.proto.util.LogMessage.Level getLevel(); - - /** - * string message = 2; - */ - java.lang.String getMessage(); - /** - * string message = 2; - */ - com.google.protobuf.ByteString - getMessageBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStats.java deleted file mode 100644 index 78a84b41b9c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStats.java +++ /dev/null @@ -1,718 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Some of the data from AllocatorStats
    - * 
    - * - * Protobuf type {@code tensorflow.MemAllocatorStats} - */ -public final class MemAllocatorStats extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemAllocatorStats) - MemAllocatorStatsOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemAllocatorStats.newBuilder() to construct. - private MemAllocatorStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemAllocatorStats() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemAllocatorStats(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemAllocatorStats( - 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: { - - numAllocs_ = input.readInt64(); - break; - } - case 16: { - - bytesInUse_ = input.readInt64(); - break; - } - case 24: { - - peakBytesInUse_ = input.readInt64(); - break; - } - case 32: { - - largestAllocSize_ = input.readInt64(); - break; - } - case 45: { - - fragmentationMetric_ = input.readFloat(); - 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.util.BfcMemoryMapProtos.internal_static_tensorflow_MemAllocatorStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemAllocatorStats.class, org.tensorflow.proto.util.MemAllocatorStats.Builder.class); - } - - public static final int NUM_ALLOCS_FIELD_NUMBER = 1; - private long numAllocs_; - /** - * int64 num_allocs = 1; - */ - public long getNumAllocs() { - return numAllocs_; - } - - public static final int BYTES_IN_USE_FIELD_NUMBER = 2; - private long bytesInUse_; - /** - * int64 bytes_in_use = 2; - */ - public long getBytesInUse() { - return bytesInUse_; - } - - public static final int PEAK_BYTES_IN_USE_FIELD_NUMBER = 3; - private long peakBytesInUse_; - /** - * int64 peak_bytes_in_use = 3; - */ - public long getPeakBytesInUse() { - return peakBytesInUse_; - } - - public static final int LARGEST_ALLOC_SIZE_FIELD_NUMBER = 4; - private long largestAllocSize_; - /** - * int64 largest_alloc_size = 4; - */ - public long getLargestAllocSize() { - return largestAllocSize_; - } - - public static final int FRAGMENTATION_METRIC_FIELD_NUMBER = 5; - private float fragmentationMetric_; - /** - * float fragmentation_metric = 5; - */ - public float getFragmentationMetric() { - return fragmentationMetric_; - } - - 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 (numAllocs_ != 0L) { - output.writeInt64(1, numAllocs_); - } - if (bytesInUse_ != 0L) { - output.writeInt64(2, bytesInUse_); - } - if (peakBytesInUse_ != 0L) { - output.writeInt64(3, peakBytesInUse_); - } - if (largestAllocSize_ != 0L) { - output.writeInt64(4, largestAllocSize_); - } - if (fragmentationMetric_ != 0F) { - output.writeFloat(5, fragmentationMetric_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (numAllocs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, numAllocs_); - } - if (bytesInUse_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, bytesInUse_); - } - if (peakBytesInUse_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, peakBytesInUse_); - } - if (largestAllocSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, largestAllocSize_); - } - if (fragmentationMetric_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(5, fragmentationMetric_); - } - 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.util.MemAllocatorStats)) { - return super.equals(obj); - } - org.tensorflow.proto.util.MemAllocatorStats other = (org.tensorflow.proto.util.MemAllocatorStats) obj; - - if (getNumAllocs() - != other.getNumAllocs()) return false; - if (getBytesInUse() - != other.getBytesInUse()) return false; - if (getPeakBytesInUse() - != other.getPeakBytesInUse()) return false; - if (getLargestAllocSize() - != other.getLargestAllocSize()) return false; - if (java.lang.Float.floatToIntBits(getFragmentationMetric()) - != java.lang.Float.floatToIntBits( - other.getFragmentationMetric())) 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) + NUM_ALLOCS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumAllocs()); - hash = (37 * hash) + BYTES_IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getBytesInUse()); - hash = (37 * hash) + PEAK_BYTES_IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPeakBytesInUse()); - hash = (37 * hash) + LARGEST_ALLOC_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLargestAllocSize()); - hash = (37 * hash) + FRAGMENTATION_METRIC_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getFragmentationMetric()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.MemAllocatorStats parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemAllocatorStats 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.MemAllocatorStats parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemAllocatorStats 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.MemAllocatorStats parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemAllocatorStats parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.MemAllocatorStats parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemAllocatorStats 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.MemAllocatorStats parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemAllocatorStats 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.MemAllocatorStats parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemAllocatorStats 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.util.MemAllocatorStats 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; - } - /** - *
    -   * Some of the data from AllocatorStats
    -   * 
    - * - * Protobuf type {@code tensorflow.MemAllocatorStats} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemAllocatorStats) - org.tensorflow.proto.util.MemAllocatorStatsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemAllocatorStats_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemAllocatorStats.class, org.tensorflow.proto.util.MemAllocatorStats.Builder.class); - } - - // Construct using org.tensorflow.proto.util.MemAllocatorStats.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(); - numAllocs_ = 0L; - - bytesInUse_ = 0L; - - peakBytesInUse_ = 0L; - - largestAllocSize_ = 0L; - - fragmentationMetric_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemAllocatorStats_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemAllocatorStats getDefaultInstanceForType() { - return org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.MemAllocatorStats build() { - org.tensorflow.proto.util.MemAllocatorStats result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemAllocatorStats buildPartial() { - org.tensorflow.proto.util.MemAllocatorStats result = new org.tensorflow.proto.util.MemAllocatorStats(this); - result.numAllocs_ = numAllocs_; - result.bytesInUse_ = bytesInUse_; - result.peakBytesInUse_ = peakBytesInUse_; - result.largestAllocSize_ = largestAllocSize_; - result.fragmentationMetric_ = fragmentationMetric_; - 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.util.MemAllocatorStats) { - return mergeFrom((org.tensorflow.proto.util.MemAllocatorStats)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.MemAllocatorStats other) { - if (other == org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance()) return this; - if (other.getNumAllocs() != 0L) { - setNumAllocs(other.getNumAllocs()); - } - if (other.getBytesInUse() != 0L) { - setBytesInUse(other.getBytesInUse()); - } - if (other.getPeakBytesInUse() != 0L) { - setPeakBytesInUse(other.getPeakBytesInUse()); - } - if (other.getLargestAllocSize() != 0L) { - setLargestAllocSize(other.getLargestAllocSize()); - } - if (other.getFragmentationMetric() != 0F) { - setFragmentationMetric(other.getFragmentationMetric()); - } - 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.util.MemAllocatorStats parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.MemAllocatorStats) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long numAllocs_ ; - /** - * int64 num_allocs = 1; - */ - public long getNumAllocs() { - return numAllocs_; - } - /** - * int64 num_allocs = 1; - */ - public Builder setNumAllocs(long value) { - - numAllocs_ = value; - onChanged(); - return this; - } - /** - * int64 num_allocs = 1; - */ - public Builder clearNumAllocs() { - - numAllocs_ = 0L; - onChanged(); - return this; - } - - private long bytesInUse_ ; - /** - * int64 bytes_in_use = 2; - */ - public long getBytesInUse() { - return bytesInUse_; - } - /** - * int64 bytes_in_use = 2; - */ - public Builder setBytesInUse(long value) { - - bytesInUse_ = value; - onChanged(); - return this; - } - /** - * int64 bytes_in_use = 2; - */ - public Builder clearBytesInUse() { - - bytesInUse_ = 0L; - onChanged(); - return this; - } - - private long peakBytesInUse_ ; - /** - * int64 peak_bytes_in_use = 3; - */ - public long getPeakBytesInUse() { - return peakBytesInUse_; - } - /** - * int64 peak_bytes_in_use = 3; - */ - public Builder setPeakBytesInUse(long value) { - - peakBytesInUse_ = value; - onChanged(); - return this; - } - /** - * int64 peak_bytes_in_use = 3; - */ - public Builder clearPeakBytesInUse() { - - peakBytesInUse_ = 0L; - onChanged(); - return this; - } - - private long largestAllocSize_ ; - /** - * int64 largest_alloc_size = 4; - */ - public long getLargestAllocSize() { - return largestAllocSize_; - } - /** - * int64 largest_alloc_size = 4; - */ - public Builder setLargestAllocSize(long value) { - - largestAllocSize_ = value; - onChanged(); - return this; - } - /** - * int64 largest_alloc_size = 4; - */ - public Builder clearLargestAllocSize() { - - largestAllocSize_ = 0L; - onChanged(); - return this; - } - - private float fragmentationMetric_ ; - /** - * float fragmentation_metric = 5; - */ - public float getFragmentationMetric() { - return fragmentationMetric_; - } - /** - * float fragmentation_metric = 5; - */ - public Builder setFragmentationMetric(float value) { - - fragmentationMetric_ = value; - onChanged(); - return this; - } - /** - * float fragmentation_metric = 5; - */ - public Builder clearFragmentationMetric() { - - fragmentationMetric_ = 0F; - 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.MemAllocatorStats) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemAllocatorStats) - private static final org.tensorflow.proto.util.MemAllocatorStats DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.MemAllocatorStats(); - } - - public static org.tensorflow.proto.util.MemAllocatorStats getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemAllocatorStats parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemAllocatorStats(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.util.MemAllocatorStats getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStatsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStatsOrBuilder.java deleted file mode 100644 index 119204effcb..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemAllocatorStatsOrBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public interface MemAllocatorStatsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemAllocatorStats) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 num_allocs = 1; - */ - long getNumAllocs(); - - /** - * int64 bytes_in_use = 2; - */ - long getBytesInUse(); - - /** - * int64 peak_bytes_in_use = 3; - */ - long getPeakBytesInUse(); - - /** - * int64 largest_alloc_size = 4; - */ - long getLargestAllocSize(); - - /** - * float fragmentation_metric = 5; - */ - float getFragmentationMetric(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunk.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunk.java deleted file mode 100644 index 3212e0b9c85..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunk.java +++ /dev/null @@ -1,1009 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.MemChunk} - */ -public final class MemChunk extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemChunk) - MemChunkOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemChunk.newBuilder() to construct. - private MemChunk(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemChunk() { - opName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemChunk(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemChunk( - 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: { - - address_ = input.readUInt64(); - break; - } - case 16: { - - size_ = input.readInt64(); - break; - } - case 24: { - - requestedSize_ = input.readInt64(); - break; - } - case 32: { - - bin_ = input.readInt32(); - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - opName_ = s; - break; - } - case 48: { - - freedAtCount_ = input.readUInt64(); - break; - } - case 56: { - - actionCount_ = input.readUInt64(); - break; - } - case 64: { - - inUse_ = input.readBool(); - break; - } - case 72: { - - stepId_ = 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 { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemChunk_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemChunk_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemChunk.class, org.tensorflow.proto.util.MemChunk.Builder.class); - } - - public static final int ADDRESS_FIELD_NUMBER = 1; - private long address_; - /** - * uint64 address = 1; - */ - public long getAddress() { - return address_; - } - - public static final int SIZE_FIELD_NUMBER = 2; - private long size_; - /** - * int64 size = 2; - */ - public long getSize() { - return size_; - } - - public static final int REQUESTED_SIZE_FIELD_NUMBER = 3; - private long requestedSize_; - /** - * int64 requested_size = 3; - */ - public long getRequestedSize() { - return requestedSize_; - } - - public static final int BIN_FIELD_NUMBER = 4; - private int bin_; - /** - * int32 bin = 4; - */ - public int getBin() { - return bin_; - } - - public static final int OP_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object opName_; - /** - * string op_name = 5; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - 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(); - opName_ = s; - return s; - } - } - /** - * string op_name = 5; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FREED_AT_COUNT_FIELD_NUMBER = 6; - private long freedAtCount_; - /** - * uint64 freed_at_count = 6; - */ - public long getFreedAtCount() { - return freedAtCount_; - } - - public static final int ACTION_COUNT_FIELD_NUMBER = 7; - private long actionCount_; - /** - * uint64 action_count = 7; - */ - public long getActionCount() { - return actionCount_; - } - - public static final int IN_USE_FIELD_NUMBER = 8; - private boolean inUse_; - /** - * bool in_use = 8; - */ - public boolean getInUse() { - return inUse_; - } - - public static final int STEP_ID_FIELD_NUMBER = 9; - private long stepId_; - /** - * uint64 step_id = 9; - */ - public long getStepId() { - return stepId_; - } - - 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 (address_ != 0L) { - output.writeUInt64(1, address_); - } - if (size_ != 0L) { - output.writeInt64(2, size_); - } - if (requestedSize_ != 0L) { - output.writeInt64(3, requestedSize_); - } - if (bin_ != 0) { - output.writeInt32(4, bin_); - } - if (!getOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, opName_); - } - if (freedAtCount_ != 0L) { - output.writeUInt64(6, freedAtCount_); - } - if (actionCount_ != 0L) { - output.writeUInt64(7, actionCount_); - } - if (inUse_ != false) { - output.writeBool(8, inUse_); - } - if (stepId_ != 0L) { - output.writeUInt64(9, stepId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (address_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, address_); - } - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, size_); - } - if (requestedSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, requestedSize_); - } - if (bin_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, bin_); - } - if (!getOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, opName_); - } - if (freedAtCount_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, freedAtCount_); - } - if (actionCount_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(7, actionCount_); - } - if (inUse_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, inUse_); - } - if (stepId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(9, stepId_); - } - 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.util.MemChunk)) { - return super.equals(obj); - } - org.tensorflow.proto.util.MemChunk other = (org.tensorflow.proto.util.MemChunk) obj; - - if (getAddress() - != other.getAddress()) return false; - if (getSize() - != other.getSize()) return false; - if (getRequestedSize() - != other.getRequestedSize()) return false; - if (getBin() - != other.getBin()) return false; - if (!getOpName() - .equals(other.getOpName())) return false; - if (getFreedAtCount() - != other.getFreedAtCount()) return false; - if (getActionCount() - != other.getActionCount()) return false; - if (getInUse() - != other.getInUse()) return false; - if (getStepId() - != other.getStepId()) 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) + ADDRESS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAddress()); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (37 * hash) + REQUESTED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRequestedSize()); - hash = (37 * hash) + BIN_FIELD_NUMBER; - hash = (53 * hash) + getBin(); - hash = (37 * hash) + OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getOpName().hashCode(); - hash = (37 * hash) + FREED_AT_COUNT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFreedAtCount()); - hash = (37 * hash) + ACTION_COUNT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getActionCount()); - hash = (37 * hash) + IN_USE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getInUse()); - hash = (37 * hash) + STEP_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStepId()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.MemChunk parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemChunk 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.MemChunk parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemChunk 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.MemChunk parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemChunk parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.MemChunk parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemChunk 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.MemChunk parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemChunk 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.MemChunk parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemChunk 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.util.MemChunk 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.MemChunk} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemChunk) - org.tensorflow.proto.util.MemChunkOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemChunk_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemChunk_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemChunk.class, org.tensorflow.proto.util.MemChunk.Builder.class); - } - - // Construct using org.tensorflow.proto.util.MemChunk.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(); - address_ = 0L; - - size_ = 0L; - - requestedSize_ = 0L; - - bin_ = 0; - - opName_ = ""; - - freedAtCount_ = 0L; - - actionCount_ = 0L; - - inUse_ = false; - - stepId_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemChunk_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemChunk getDefaultInstanceForType() { - return org.tensorflow.proto.util.MemChunk.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.MemChunk build() { - org.tensorflow.proto.util.MemChunk result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemChunk buildPartial() { - org.tensorflow.proto.util.MemChunk result = new org.tensorflow.proto.util.MemChunk(this); - result.address_ = address_; - result.size_ = size_; - result.requestedSize_ = requestedSize_; - result.bin_ = bin_; - result.opName_ = opName_; - result.freedAtCount_ = freedAtCount_; - result.actionCount_ = actionCount_; - result.inUse_ = inUse_; - result.stepId_ = stepId_; - 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.util.MemChunk) { - return mergeFrom((org.tensorflow.proto.util.MemChunk)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.MemChunk other) { - if (other == org.tensorflow.proto.util.MemChunk.getDefaultInstance()) return this; - if (other.getAddress() != 0L) { - setAddress(other.getAddress()); - } - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (other.getRequestedSize() != 0L) { - setRequestedSize(other.getRequestedSize()); - } - if (other.getBin() != 0) { - setBin(other.getBin()); - } - if (!other.getOpName().isEmpty()) { - opName_ = other.opName_; - onChanged(); - } - if (other.getFreedAtCount() != 0L) { - setFreedAtCount(other.getFreedAtCount()); - } - if (other.getActionCount() != 0L) { - setActionCount(other.getActionCount()); - } - if (other.getInUse() != false) { - setInUse(other.getInUse()); - } - if (other.getStepId() != 0L) { - setStepId(other.getStepId()); - } - 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.util.MemChunk parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.MemChunk) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long address_ ; - /** - * uint64 address = 1; - */ - public long getAddress() { - return address_; - } - /** - * uint64 address = 1; - */ - public Builder setAddress(long value) { - - address_ = value; - onChanged(); - return this; - } - /** - * uint64 address = 1; - */ - public Builder clearAddress() { - - address_ = 0L; - onChanged(); - return this; - } - - private long size_ ; - /** - * int64 size = 2; - */ - public long getSize() { - return size_; - } - /** - * int64 size = 2; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - * int64 size = 2; - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private long requestedSize_ ; - /** - * int64 requested_size = 3; - */ - public long getRequestedSize() { - return requestedSize_; - } - /** - * int64 requested_size = 3; - */ - public Builder setRequestedSize(long value) { - - requestedSize_ = value; - onChanged(); - return this; - } - /** - * int64 requested_size = 3; - */ - public Builder clearRequestedSize() { - - requestedSize_ = 0L; - onChanged(); - return this; - } - - private int bin_ ; - /** - * int32 bin = 4; - */ - public int getBin() { - return bin_; - } - /** - * int32 bin = 4; - */ - public Builder setBin(int value) { - - bin_ = value; - onChanged(); - return this; - } - /** - * int32 bin = 4; - */ - public Builder clearBin() { - - bin_ = 0; - onChanged(); - return this; - } - - private java.lang.Object opName_ = ""; - /** - * string op_name = 5; - */ - public java.lang.String getOpName() { - java.lang.Object ref = opName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - opName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string op_name = 5; - */ - public com.google.protobuf.ByteString - getOpNameBytes() { - java.lang.Object ref = opName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - opName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string op_name = 5; - */ - public Builder setOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - opName_ = value; - onChanged(); - return this; - } - /** - * string op_name = 5; - */ - public Builder clearOpName() { - - opName_ = getDefaultInstance().getOpName(); - onChanged(); - return this; - } - /** - * string op_name = 5; - */ - public Builder setOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - opName_ = value; - onChanged(); - return this; - } - - private long freedAtCount_ ; - /** - * uint64 freed_at_count = 6; - */ - public long getFreedAtCount() { - return freedAtCount_; - } - /** - * uint64 freed_at_count = 6; - */ - public Builder setFreedAtCount(long value) { - - freedAtCount_ = value; - onChanged(); - return this; - } - /** - * uint64 freed_at_count = 6; - */ - public Builder clearFreedAtCount() { - - freedAtCount_ = 0L; - onChanged(); - return this; - } - - private long actionCount_ ; - /** - * uint64 action_count = 7; - */ - public long getActionCount() { - return actionCount_; - } - /** - * uint64 action_count = 7; - */ - public Builder setActionCount(long value) { - - actionCount_ = value; - onChanged(); - return this; - } - /** - * uint64 action_count = 7; - */ - public Builder clearActionCount() { - - actionCount_ = 0L; - onChanged(); - return this; - } - - private boolean inUse_ ; - /** - * bool in_use = 8; - */ - public boolean getInUse() { - return inUse_; - } - /** - * bool in_use = 8; - */ - public Builder setInUse(boolean value) { - - inUse_ = value; - onChanged(); - return this; - } - /** - * bool in_use = 8; - */ - public Builder clearInUse() { - - inUse_ = false; - onChanged(); - return this; - } - - private long stepId_ ; - /** - * uint64 step_id = 9; - */ - public long getStepId() { - return stepId_; - } - /** - * uint64 step_id = 9; - */ - public Builder setStepId(long value) { - - stepId_ = value; - onChanged(); - return this; - } - /** - * uint64 step_id = 9; - */ - public Builder clearStepId() { - - stepId_ = 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.MemChunk) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemChunk) - private static final org.tensorflow.proto.util.MemChunk DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.MemChunk(); - } - - public static org.tensorflow.proto.util.MemChunk getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemChunk parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemChunk(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.util.MemChunk getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunkOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunkOrBuilder.java deleted file mode 100644 index 6dbce3e91ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemChunkOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public interface MemChunkOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemChunk) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 address = 1; - */ - long getAddress(); - - /** - * int64 size = 2; - */ - long getSize(); - - /** - * int64 requested_size = 3; - */ - long getRequestedSize(); - - /** - * int32 bin = 4; - */ - int getBin(); - - /** - * string op_name = 5; - */ - java.lang.String getOpName(); - /** - * string op_name = 5; - */ - com.google.protobuf.ByteString - getOpNameBytes(); - - /** - * uint64 freed_at_count = 6; - */ - long getFreedAtCount(); - - /** - * uint64 action_count = 7; - */ - long getActionCount(); - - /** - * bool in_use = 8; - */ - boolean getInUse(); - - /** - * uint64 step_id = 9; - */ - long getStepId(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectory.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectory.java deleted file mode 100644 index 0f7f977819f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectory.java +++ /dev/null @@ -1,773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/memmapped_file_system.proto - -package org.tensorflow.proto.util; - -/** - *
    - * A directory of regions in a memmapped file.
    - * 
    - * - * Protobuf type {@code tensorflow.MemmappedFileSystemDirectory} - */ -public final class MemmappedFileSystemDirectory extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemmappedFileSystemDirectory) - MemmappedFileSystemDirectoryOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemmappedFileSystemDirectory.newBuilder() to construct. - private MemmappedFileSystemDirectory(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemmappedFileSystemDirectory() { - element_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemmappedFileSystemDirectory(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemmappedFileSystemDirectory( - 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)) { - element_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - element_.add( - input.readMessage(org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.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_ & 0x00000001) != 0)) { - element_ = java.util.Collections.unmodifiableList(element_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemmappedFileSystemDirectory.class, org.tensorflow.proto.util.MemmappedFileSystemDirectory.Builder.class); - } - - public static final int ELEMENT_FIELD_NUMBER = 1; - private java.util.List element_; - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public java.util.List getElementList() { - return element_; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public java.util.List - getElementOrBuilderList() { - return element_; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public int getElementCount() { - return element_.size(); - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement getElement(int index) { - return element_.get(index); - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( - int index) { - return element_.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 { - for (int i = 0; i < element_.size(); i++) { - output.writeMessage(1, element_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < element_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, element_.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.util.MemmappedFileSystemDirectory)) { - return super.equals(obj); - } - org.tensorflow.proto.util.MemmappedFileSystemDirectory other = (org.tensorflow.proto.util.MemmappedFileSystemDirectory) obj; - - if (!getElementList() - .equals(other.getElementList())) 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 (getElementCount() > 0) { - hash = (37 * hash) + ELEMENT_FIELD_NUMBER; - hash = (53 * hash) + getElementList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory 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.MemmappedFileSystemDirectory parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory 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.MemmappedFileSystemDirectory parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory 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.MemmappedFileSystemDirectory parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory 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.MemmappedFileSystemDirectory parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory 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.util.MemmappedFileSystemDirectory 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 directory of regions in a memmapped file.
    -   * 
    - * - * Protobuf type {@code tensorflow.MemmappedFileSystemDirectory} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemmappedFileSystemDirectory) - org.tensorflow.proto.util.MemmappedFileSystemDirectoryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemmappedFileSystemDirectory.class, org.tensorflow.proto.util.MemmappedFileSystemDirectory.Builder.class); - } - - // Construct using org.tensorflow.proto.util.MemmappedFileSystemDirectory.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getElementFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (elementBuilder_ == null) { - element_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - elementBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectory getDefaultInstanceForType() { - return org.tensorflow.proto.util.MemmappedFileSystemDirectory.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectory build() { - org.tensorflow.proto.util.MemmappedFileSystemDirectory result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectory buildPartial() { - org.tensorflow.proto.util.MemmappedFileSystemDirectory result = new org.tensorflow.proto.util.MemmappedFileSystemDirectory(this); - int from_bitField0_ = bitField0_; - if (elementBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - element_ = java.util.Collections.unmodifiableList(element_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.element_ = element_; - } else { - result.element_ = elementBuilder_.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.util.MemmappedFileSystemDirectory) { - return mergeFrom((org.tensorflow.proto.util.MemmappedFileSystemDirectory)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.MemmappedFileSystemDirectory other) { - if (other == org.tensorflow.proto.util.MemmappedFileSystemDirectory.getDefaultInstance()) return this; - if (elementBuilder_ == null) { - if (!other.element_.isEmpty()) { - if (element_.isEmpty()) { - element_ = other.element_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureElementIsMutable(); - element_.addAll(other.element_); - } - onChanged(); - } - } else { - if (!other.element_.isEmpty()) { - if (elementBuilder_.isEmpty()) { - elementBuilder_.dispose(); - elementBuilder_ = null; - element_ = other.element_; - bitField0_ = (bitField0_ & ~0x00000001); - elementBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getElementFieldBuilder() : null; - } else { - elementBuilder_.addAllMessages(other.element_); - } - } - } - 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.util.MemmappedFileSystemDirectory parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.MemmappedFileSystemDirectory) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List element_ = - java.util.Collections.emptyList(); - private void ensureElementIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - element_ = new java.util.ArrayList(element_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder> elementBuilder_; - - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public java.util.List getElementList() { - if (elementBuilder_ == null) { - return java.util.Collections.unmodifiableList(element_); - } else { - return elementBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public int getElementCount() { - if (elementBuilder_ == null) { - return element_.size(); - } else { - return elementBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement getElement(int index) { - if (elementBuilder_ == null) { - return element_.get(index); - } else { - return elementBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder setElement( - int index, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement value) { - if (elementBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureElementIsMutable(); - element_.set(index, value); - onChanged(); - } else { - elementBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder setElement( - int index, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder builderForValue) { - if (elementBuilder_ == null) { - ensureElementIsMutable(); - element_.set(index, builderForValue.build()); - onChanged(); - } else { - elementBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder addElement(org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement value) { - if (elementBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureElementIsMutable(); - element_.add(value); - onChanged(); - } else { - elementBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder addElement( - int index, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement value) { - if (elementBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureElementIsMutable(); - element_.add(index, value); - onChanged(); - } else { - elementBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder addElement( - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder builderForValue) { - if (elementBuilder_ == null) { - ensureElementIsMutable(); - element_.add(builderForValue.build()); - onChanged(); - } else { - elementBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder addElement( - int index, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder builderForValue) { - if (elementBuilder_ == null) { - ensureElementIsMutable(); - element_.add(index, builderForValue.build()); - onChanged(); - } else { - elementBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder addAllElement( - java.lang.Iterable values) { - if (elementBuilder_ == null) { - ensureElementIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, element_); - onChanged(); - } else { - elementBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder clearElement() { - if (elementBuilder_ == null) { - element_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - elementBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public Builder removeElement(int index) { - if (elementBuilder_ == null) { - ensureElementIsMutable(); - element_.remove(index); - onChanged(); - } else { - elementBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder getElementBuilder( - int index) { - return getElementFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( - int index) { - if (elementBuilder_ == null) { - return element_.get(index); } else { - return elementBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public java.util.List - getElementOrBuilderList() { - if (elementBuilder_ != null) { - return elementBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(element_); - } - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder addElementBuilder() { - return getElementFieldBuilder().addBuilder( - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.getDefaultInstance()); - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder addElementBuilder( - int index) { - return getElementFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.getDefaultInstance()); - } - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - public java.util.List - getElementBuilderList() { - return getElementFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder> - getElementFieldBuilder() { - if (elementBuilder_ == null) { - elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder>( - element_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - element_ = null; - } - return elementBuilder_; - } - @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.MemmappedFileSystemDirectory) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectory) - private static final org.tensorflow.proto.util.MemmappedFileSystemDirectory DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.MemmappedFileSystemDirectory(); - } - - public static org.tensorflow.proto.util.MemmappedFileSystemDirectory getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemmappedFileSystemDirectory parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemmappedFileSystemDirectory(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.util.MemmappedFileSystemDirectory getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElement.java deleted file mode 100644 index d2dafba3ef2..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElement.java +++ /dev/null @@ -1,670 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/memmapped_file_system.proto - -package org.tensorflow.proto.util; - -/** - *
    - * A message that describes one region of memmapped file.
    - * 
    - * - * Protobuf type {@code tensorflow.MemmappedFileSystemDirectoryElement} - */ -public final class MemmappedFileSystemDirectoryElement extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemmappedFileSystemDirectoryElement) - MemmappedFileSystemDirectoryElementOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemmappedFileSystemDirectoryElement.newBuilder() to construct. - private MemmappedFileSystemDirectoryElement(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemmappedFileSystemDirectoryElement() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemmappedFileSystemDirectoryElement(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemmappedFileSystemDirectoryElement( - 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: { - - offset_ = input.readUInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 24: { - - length_ = 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 { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.class, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder.class); - } - - public static final int OFFSET_FIELD_NUMBER = 1; - private long offset_; - /** - * uint64 offset = 1; - */ - public long getOffset() { - return offset_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * string name = 2; - */ - 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; - } - } - /** - * string name = 2; - */ - 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 LENGTH_FIELD_NUMBER = 3; - private long length_; - /** - * uint64 length = 3; - */ - public long getLength() { - return length_; - } - - 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 (offset_ != 0L) { - output.writeUInt64(1, offset_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - if (length_ != 0L) { - output.writeUInt64(3, length_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (offset_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, offset_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - if (length_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, length_); - } - 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.util.MemmappedFileSystemDirectoryElement)) { - return super.equals(obj); - } - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement other = (org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement) obj; - - if (getOffset() - != other.getOffset()) return false; - if (!getName() - .equals(other.getName())) return false; - if (getLength() - != other.getLength()) 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) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffset()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + LENGTH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLength()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystemDirectoryElement parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystemDirectoryElement parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystemDirectoryElement parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystemDirectoryElement parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement 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.util.MemmappedFileSystemDirectoryElement 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 message that describes one region of memmapped file.
    -   * 
    - * - * Protobuf type {@code tensorflow.MemmappedFileSystemDirectoryElement} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemmappedFileSystemDirectoryElement) - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.class, org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.Builder.class); - } - - // Construct using org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.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(); - offset_ = 0L; - - name_ = ""; - - length_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.MemmappedFileSystemProtos.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement getDefaultInstanceForType() { - return org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement build() { - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement buildPartial() { - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement result = new org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement(this); - result.offset_ = offset_; - result.name_ = name_; - result.length_ = length_; - 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.util.MemmappedFileSystemDirectoryElement) { - return mergeFrom((org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement other) { - if (other == org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement.getDefaultInstance()) return this; - if (other.getOffset() != 0L) { - setOffset(other.getOffset()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getLength() != 0L) { - setLength(other.getLength()); - } - 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.util.MemmappedFileSystemDirectoryElement parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long offset_ ; - /** - * uint64 offset = 1; - */ - public long getOffset() { - return offset_; - } - /** - * uint64 offset = 1; - */ - public Builder setOffset(long value) { - - offset_ = value; - onChanged(); - return this; - } - /** - * uint64 offset = 1; - */ - public Builder clearOffset() { - - offset_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 2; - */ - 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; - } - } - /** - * string name = 2; - */ - 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; - } - } - /** - * string name = 2; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private long length_ ; - /** - * uint64 length = 3; - */ - public long getLength() { - return length_; - } - /** - * uint64 length = 3; - */ - public Builder setLength(long value) { - - length_ = value; - onChanged(); - return this; - } - /** - * uint64 length = 3; - */ - public Builder clearLength() { - - length_ = 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.MemmappedFileSystemDirectoryElement) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectoryElement) - private static final org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement(); - } - - public static org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemmappedFileSystemDirectoryElement parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemmappedFileSystemDirectoryElement(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.util.MemmappedFileSystemDirectoryElement getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElementOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElementOrBuilder.java deleted file mode 100644 index 93fd60f2faa..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryElementOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/memmapped_file_system.proto - -package org.tensorflow.proto.util; - -public interface MemmappedFileSystemDirectoryElementOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemmappedFileSystemDirectoryElement) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 offset = 1; - */ - long getOffset(); - - /** - * string name = 2; - */ - java.lang.String getName(); - /** - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * uint64 length = 3; - */ - long getLength(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryOrBuilder.java deleted file mode 100644 index c19c30645f5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemDirectoryOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/memmapped_file_system.proto - -package org.tensorflow.proto.util; - -public interface MemmappedFileSystemDirectoryOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemmappedFileSystemDirectory) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - java.util.List - getElementList(); - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElement getElement(int index); - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - int getElementCount(); - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - java.util.List - getElementOrBuilderList(); - /** - * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; - */ - org.tensorflow.proto.util.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemProtos.java deleted file mode 100644 index 2e2809cce45..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemmappedFileSystemProtos.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/memmapped_file_system.proto - -package org.tensorflow.proto.util; - -public final class MemmappedFileSystemProtos { - private MemmappedFileSystemProtos() {} - 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_MemmappedFileSystemDirectoryElement_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0tensorflow/core/util/memmapped_file_sy" + - "stem.proto\022\ntensorflow\"S\n#MemmappedFileS" + - "ystemDirectoryElement\022\016\n\006offset\030\001 \001(\004\022\014\n" + - "\004name\030\002 \001(\t\022\016\n\006length\030\003 \001(\004\"`\n\034Memmapped" + - "FileSystemDirectory\022@\n\007element\030\001 \003(\0132/.t" + - "ensorflow.MemmappedFileSystemDirectoryEl" + - "ementB;\n\031org.tensorflow.proto.utilB\031Memm" + - "appedFileSystemProtosP\001\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor, - new java.lang.String[] { "Offset", "Name", "Length", }); - internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor, - new java.lang.String[] { "Element", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDump.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDump.java deleted file mode 100644 index e7408bfc997..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDump.java +++ /dev/null @@ -1,1759 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.MemoryDump} - */ -public final class MemoryDump extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryDump) - MemoryDumpOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryDump.newBuilder() to construct. - private MemoryDump(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryDump() { - allocatorName_ = ""; - binSummary_ = java.util.Collections.emptyList(); - chunk_ = java.util.Collections.emptyList(); - snapShot_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryDump(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryDump( - 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(); - - allocatorName_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - binSummary_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - binSummary_.add( - input.readMessage(org.tensorflow.proto.util.BinSummary.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - chunk_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - chunk_.add( - input.readMessage(org.tensorflow.proto.util.MemChunk.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - snapShot_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - snapShot_.add( - input.readMessage(org.tensorflow.proto.util.SnapShot.parser(), extensionRegistry)); - break; - } - case 42: { - org.tensorflow.proto.util.MemAllocatorStats.Builder subBuilder = null; - if (stats_ != null) { - subBuilder = stats_.toBuilder(); - } - stats_ = input.readMessage(org.tensorflow.proto.util.MemAllocatorStats.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(stats_); - stats_ = subBuilder.buildPartial(); - } - - 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)) { - binSummary_ = java.util.Collections.unmodifiableList(binSummary_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - chunk_ = java.util.Collections.unmodifiableList(chunk_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - snapShot_ = java.util.Collections.unmodifiableList(snapShot_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemoryDump.class, org.tensorflow.proto.util.MemoryDump.Builder.class); - } - - public static final int ALLOCATOR_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object allocatorName_; - /** - * string allocator_name = 1; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - 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(); - allocatorName_ = s; - return s; - } - } - /** - * string allocator_name = 1; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BIN_SUMMARY_FIELD_NUMBER = 2; - private java.util.List binSummary_; - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public java.util.List getBinSummaryList() { - return binSummary_; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public java.util.List - getBinSummaryOrBuilderList() { - return binSummary_; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public int getBinSummaryCount() { - return binSummary_.size(); - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummary getBinSummary(int index) { - return binSummary_.get(index); - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummaryOrBuilder getBinSummaryOrBuilder( - int index) { - return binSummary_.get(index); - } - - public static final int CHUNK_FIELD_NUMBER = 3; - private java.util.List chunk_; - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public java.util.List getChunkList() { - return chunk_; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public java.util.List - getChunkOrBuilderList() { - return chunk_; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public int getChunkCount() { - return chunk_.size(); - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunk getChunk(int index) { - return chunk_.get(index); - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunkOrBuilder getChunkOrBuilder( - int index) { - return chunk_.get(index); - } - - public static final int SNAP_SHOT_FIELD_NUMBER = 4; - private java.util.List snapShot_; - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public java.util.List getSnapShotList() { - return snapShot_; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public java.util.List - getSnapShotOrBuilderList() { - return snapShot_; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public int getSnapShotCount() { - return snapShot_.size(); - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShot getSnapShot(int index) { - return snapShot_.get(index); - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShotOrBuilder getSnapShotOrBuilder( - int index) { - return snapShot_.get(index); - } - - public static final int STATS_FIELD_NUMBER = 5; - private org.tensorflow.proto.util.MemAllocatorStats stats_; - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public boolean hasStats() { - return stats_ != null; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public org.tensorflow.proto.util.MemAllocatorStats getStats() { - return stats_ == null ? org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public org.tensorflow.proto.util.MemAllocatorStatsOrBuilder getStatsOrBuilder() { - return getStats(); - } - - 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 (!getAllocatorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allocatorName_); - } - for (int i = 0; i < binSummary_.size(); i++) { - output.writeMessage(2, binSummary_.get(i)); - } - for (int i = 0; i < chunk_.size(); i++) { - output.writeMessage(3, chunk_.get(i)); - } - for (int i = 0; i < snapShot_.size(); i++) { - output.writeMessage(4, snapShot_.get(i)); - } - if (stats_ != null) { - output.writeMessage(5, getStats()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getAllocatorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, allocatorName_); - } - for (int i = 0; i < binSummary_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, binSummary_.get(i)); - } - for (int i = 0; i < chunk_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, chunk_.get(i)); - } - for (int i = 0; i < snapShot_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, snapShot_.get(i)); - } - if (stats_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getStats()); - } - 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.util.MemoryDump)) { - return super.equals(obj); - } - org.tensorflow.proto.util.MemoryDump other = (org.tensorflow.proto.util.MemoryDump) obj; - - if (!getAllocatorName() - .equals(other.getAllocatorName())) return false; - if (!getBinSummaryList() - .equals(other.getBinSummaryList())) return false; - if (!getChunkList() - .equals(other.getChunkList())) return false; - if (!getSnapShotList() - .equals(other.getSnapShotList())) return false; - if (hasStats() != other.hasStats()) return false; - if (hasStats()) { - if (!getStats() - .equals(other.getStats())) 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) + ALLOCATOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getAllocatorName().hashCode(); - if (getBinSummaryCount() > 0) { - hash = (37 * hash) + BIN_SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getBinSummaryList().hashCode(); - } - if (getChunkCount() > 0) { - hash = (37 * hash) + CHUNK_FIELD_NUMBER; - hash = (53 * hash) + getChunkList().hashCode(); - } - if (getSnapShotCount() > 0) { - hash = (37 * hash) + SNAP_SHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapShotList().hashCode(); - } - if (hasStats()) { - hash = (37 * hash) + STATS_FIELD_NUMBER; - hash = (53 * hash) + getStats().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.MemoryDump parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.MemoryDump parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.MemoryDump parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.MemoryDump 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.util.MemoryDump 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.MemoryDump} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryDump) - org.tensorflow.proto.util.MemoryDumpOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.MemoryDump.class, org.tensorflow.proto.util.MemoryDump.Builder.class); - } - - // Construct using org.tensorflow.proto.util.MemoryDump.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getBinSummaryFieldBuilder(); - getChunkFieldBuilder(); - getSnapShotFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - allocatorName_ = ""; - - if (binSummaryBuilder_ == null) { - binSummary_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - binSummaryBuilder_.clear(); - } - if (chunkBuilder_ == null) { - chunk_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - chunkBuilder_.clear(); - } - if (snapShotBuilder_ == null) { - snapShot_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - snapShotBuilder_.clear(); - } - if (statsBuilder_ == null) { - stats_ = null; - } else { - stats_ = null; - statsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemoryDump getDefaultInstanceForType() { - return org.tensorflow.proto.util.MemoryDump.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.MemoryDump build() { - org.tensorflow.proto.util.MemoryDump result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.MemoryDump buildPartial() { - org.tensorflow.proto.util.MemoryDump result = new org.tensorflow.proto.util.MemoryDump(this); - int from_bitField0_ = bitField0_; - result.allocatorName_ = allocatorName_; - if (binSummaryBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - binSummary_ = java.util.Collections.unmodifiableList(binSummary_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.binSummary_ = binSummary_; - } else { - result.binSummary_ = binSummaryBuilder_.build(); - } - if (chunkBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - chunk_ = java.util.Collections.unmodifiableList(chunk_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.chunk_ = chunk_; - } else { - result.chunk_ = chunkBuilder_.build(); - } - if (snapShotBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - snapShot_ = java.util.Collections.unmodifiableList(snapShot_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.snapShot_ = snapShot_; - } else { - result.snapShot_ = snapShotBuilder_.build(); - } - if (statsBuilder_ == null) { - result.stats_ = stats_; - } else { - result.stats_ = statsBuilder_.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.util.MemoryDump) { - return mergeFrom((org.tensorflow.proto.util.MemoryDump)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.MemoryDump other) { - if (other == org.tensorflow.proto.util.MemoryDump.getDefaultInstance()) return this; - if (!other.getAllocatorName().isEmpty()) { - allocatorName_ = other.allocatorName_; - onChanged(); - } - if (binSummaryBuilder_ == null) { - if (!other.binSummary_.isEmpty()) { - if (binSummary_.isEmpty()) { - binSummary_ = other.binSummary_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBinSummaryIsMutable(); - binSummary_.addAll(other.binSummary_); - } - onChanged(); - } - } else { - if (!other.binSummary_.isEmpty()) { - if (binSummaryBuilder_.isEmpty()) { - binSummaryBuilder_.dispose(); - binSummaryBuilder_ = null; - binSummary_ = other.binSummary_; - bitField0_ = (bitField0_ & ~0x00000001); - binSummaryBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getBinSummaryFieldBuilder() : null; - } else { - binSummaryBuilder_.addAllMessages(other.binSummary_); - } - } - } - if (chunkBuilder_ == null) { - if (!other.chunk_.isEmpty()) { - if (chunk_.isEmpty()) { - chunk_ = other.chunk_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureChunkIsMutable(); - chunk_.addAll(other.chunk_); - } - onChanged(); - } - } else { - if (!other.chunk_.isEmpty()) { - if (chunkBuilder_.isEmpty()) { - chunkBuilder_.dispose(); - chunkBuilder_ = null; - chunk_ = other.chunk_; - bitField0_ = (bitField0_ & ~0x00000002); - chunkBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getChunkFieldBuilder() : null; - } else { - chunkBuilder_.addAllMessages(other.chunk_); - } - } - } - if (snapShotBuilder_ == null) { - if (!other.snapShot_.isEmpty()) { - if (snapShot_.isEmpty()) { - snapShot_ = other.snapShot_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureSnapShotIsMutable(); - snapShot_.addAll(other.snapShot_); - } - onChanged(); - } - } else { - if (!other.snapShot_.isEmpty()) { - if (snapShotBuilder_.isEmpty()) { - snapShotBuilder_.dispose(); - snapShotBuilder_ = null; - snapShot_ = other.snapShot_; - bitField0_ = (bitField0_ & ~0x00000004); - snapShotBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSnapShotFieldBuilder() : null; - } else { - snapShotBuilder_.addAllMessages(other.snapShot_); - } - } - } - if (other.hasStats()) { - mergeStats(other.getStats()); - } - 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.util.MemoryDump parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.MemoryDump) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object allocatorName_ = ""; - /** - * string allocator_name = 1; - */ - public java.lang.String getAllocatorName() { - java.lang.Object ref = allocatorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - allocatorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string allocator_name = 1; - */ - public com.google.protobuf.ByteString - getAllocatorNameBytes() { - java.lang.Object ref = allocatorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - allocatorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string allocator_name = 1; - */ - public Builder setAllocatorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - allocatorName_ = value; - onChanged(); - return this; - } - /** - * string allocator_name = 1; - */ - public Builder clearAllocatorName() { - - allocatorName_ = getDefaultInstance().getAllocatorName(); - onChanged(); - return this; - } - /** - * string allocator_name = 1; - */ - public Builder setAllocatorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - allocatorName_ = value; - onChanged(); - return this; - } - - private java.util.List binSummary_ = - java.util.Collections.emptyList(); - private void ensureBinSummaryIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - binSummary_ = new java.util.ArrayList(binSummary_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder> binSummaryBuilder_; - - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public java.util.List getBinSummaryList() { - if (binSummaryBuilder_ == null) { - return java.util.Collections.unmodifiableList(binSummary_); - } else { - return binSummaryBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public int getBinSummaryCount() { - if (binSummaryBuilder_ == null) { - return binSummary_.size(); - } else { - return binSummaryBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummary getBinSummary(int index) { - if (binSummaryBuilder_ == null) { - return binSummary_.get(index); - } else { - return binSummaryBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder setBinSummary( - int index, org.tensorflow.proto.util.BinSummary value) { - if (binSummaryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBinSummaryIsMutable(); - binSummary_.set(index, value); - onChanged(); - } else { - binSummaryBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder setBinSummary( - int index, org.tensorflow.proto.util.BinSummary.Builder builderForValue) { - if (binSummaryBuilder_ == null) { - ensureBinSummaryIsMutable(); - binSummary_.set(index, builderForValue.build()); - onChanged(); - } else { - binSummaryBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder addBinSummary(org.tensorflow.proto.util.BinSummary value) { - if (binSummaryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBinSummaryIsMutable(); - binSummary_.add(value); - onChanged(); - } else { - binSummaryBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder addBinSummary( - int index, org.tensorflow.proto.util.BinSummary value) { - if (binSummaryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBinSummaryIsMutable(); - binSummary_.add(index, value); - onChanged(); - } else { - binSummaryBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder addBinSummary( - org.tensorflow.proto.util.BinSummary.Builder builderForValue) { - if (binSummaryBuilder_ == null) { - ensureBinSummaryIsMutable(); - binSummary_.add(builderForValue.build()); - onChanged(); - } else { - binSummaryBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder addBinSummary( - int index, org.tensorflow.proto.util.BinSummary.Builder builderForValue) { - if (binSummaryBuilder_ == null) { - ensureBinSummaryIsMutable(); - binSummary_.add(index, builderForValue.build()); - onChanged(); - } else { - binSummaryBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder addAllBinSummary( - java.lang.Iterable values) { - if (binSummaryBuilder_ == null) { - ensureBinSummaryIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, binSummary_); - onChanged(); - } else { - binSummaryBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder clearBinSummary() { - if (binSummaryBuilder_ == null) { - binSummary_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - binSummaryBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public Builder removeBinSummary(int index) { - if (binSummaryBuilder_ == null) { - ensureBinSummaryIsMutable(); - binSummary_.remove(index); - onChanged(); - } else { - binSummaryBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummary.Builder getBinSummaryBuilder( - int index) { - return getBinSummaryFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummaryOrBuilder getBinSummaryOrBuilder( - int index) { - if (binSummaryBuilder_ == null) { - return binSummary_.get(index); } else { - return binSummaryBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public java.util.List - getBinSummaryOrBuilderList() { - if (binSummaryBuilder_ != null) { - return binSummaryBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(binSummary_); - } - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummary.Builder addBinSummaryBuilder() { - return getBinSummaryFieldBuilder().addBuilder( - org.tensorflow.proto.util.BinSummary.getDefaultInstance()); - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public org.tensorflow.proto.util.BinSummary.Builder addBinSummaryBuilder( - int index) { - return getBinSummaryFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.BinSummary.getDefaultInstance()); - } - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - public java.util.List - getBinSummaryBuilderList() { - return getBinSummaryFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder> - getBinSummaryFieldBuilder() { - if (binSummaryBuilder_ == null) { - binSummaryBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder>( - binSummary_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - binSummary_ = null; - } - return binSummaryBuilder_; - } - - private java.util.List chunk_ = - java.util.Collections.emptyList(); - private void ensureChunkIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - chunk_ = new java.util.ArrayList(chunk_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder> chunkBuilder_; - - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public java.util.List getChunkList() { - if (chunkBuilder_ == null) { - return java.util.Collections.unmodifiableList(chunk_); - } else { - return chunkBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public int getChunkCount() { - if (chunkBuilder_ == null) { - return chunk_.size(); - } else { - return chunkBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunk getChunk(int index) { - if (chunkBuilder_ == null) { - return chunk_.get(index); - } else { - return chunkBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder setChunk( - int index, org.tensorflow.proto.util.MemChunk value) { - if (chunkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunkIsMutable(); - chunk_.set(index, value); - onChanged(); - } else { - chunkBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder setChunk( - int index, org.tensorflow.proto.util.MemChunk.Builder builderForValue) { - if (chunkBuilder_ == null) { - ensureChunkIsMutable(); - chunk_.set(index, builderForValue.build()); - onChanged(); - } else { - chunkBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder addChunk(org.tensorflow.proto.util.MemChunk value) { - if (chunkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunkIsMutable(); - chunk_.add(value); - onChanged(); - } else { - chunkBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder addChunk( - int index, org.tensorflow.proto.util.MemChunk value) { - if (chunkBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunkIsMutable(); - chunk_.add(index, value); - onChanged(); - } else { - chunkBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder addChunk( - org.tensorflow.proto.util.MemChunk.Builder builderForValue) { - if (chunkBuilder_ == null) { - ensureChunkIsMutable(); - chunk_.add(builderForValue.build()); - onChanged(); - } else { - chunkBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder addChunk( - int index, org.tensorflow.proto.util.MemChunk.Builder builderForValue) { - if (chunkBuilder_ == null) { - ensureChunkIsMutable(); - chunk_.add(index, builderForValue.build()); - onChanged(); - } else { - chunkBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder addAllChunk( - java.lang.Iterable values) { - if (chunkBuilder_ == null) { - ensureChunkIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, chunk_); - onChanged(); - } else { - chunkBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder clearChunk() { - if (chunkBuilder_ == null) { - chunk_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - chunkBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public Builder removeChunk(int index) { - if (chunkBuilder_ == null) { - ensureChunkIsMutable(); - chunk_.remove(index); - onChanged(); - } else { - chunkBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunk.Builder getChunkBuilder( - int index) { - return getChunkFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunkOrBuilder getChunkOrBuilder( - int index) { - if (chunkBuilder_ == null) { - return chunk_.get(index); } else { - return chunkBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public java.util.List - getChunkOrBuilderList() { - if (chunkBuilder_ != null) { - return chunkBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(chunk_); - } - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunk.Builder addChunkBuilder() { - return getChunkFieldBuilder().addBuilder( - org.tensorflow.proto.util.MemChunk.getDefaultInstance()); - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public org.tensorflow.proto.util.MemChunk.Builder addChunkBuilder( - int index) { - return getChunkFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.MemChunk.getDefaultInstance()); - } - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - public java.util.List - getChunkBuilderList() { - return getChunkFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder> - getChunkFieldBuilder() { - if (chunkBuilder_ == null) { - chunkBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder>( - chunk_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - chunk_ = null; - } - return chunkBuilder_; - } - - private java.util.List snapShot_ = - java.util.Collections.emptyList(); - private void ensureSnapShotIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - snapShot_ = new java.util.ArrayList(snapShot_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder> snapShotBuilder_; - - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public java.util.List getSnapShotList() { - if (snapShotBuilder_ == null) { - return java.util.Collections.unmodifiableList(snapShot_); - } else { - return snapShotBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public int getSnapShotCount() { - if (snapShotBuilder_ == null) { - return snapShot_.size(); - } else { - return snapShotBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShot getSnapShot(int index) { - if (snapShotBuilder_ == null) { - return snapShot_.get(index); - } else { - return snapShotBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder setSnapShot( - int index, org.tensorflow.proto.util.SnapShot value) { - if (snapShotBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapShotIsMutable(); - snapShot_.set(index, value); - onChanged(); - } else { - snapShotBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder setSnapShot( - int index, org.tensorflow.proto.util.SnapShot.Builder builderForValue) { - if (snapShotBuilder_ == null) { - ensureSnapShotIsMutable(); - snapShot_.set(index, builderForValue.build()); - onChanged(); - } else { - snapShotBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder addSnapShot(org.tensorflow.proto.util.SnapShot value) { - if (snapShotBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapShotIsMutable(); - snapShot_.add(value); - onChanged(); - } else { - snapShotBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder addSnapShot( - int index, org.tensorflow.proto.util.SnapShot value) { - if (snapShotBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSnapShotIsMutable(); - snapShot_.add(index, value); - onChanged(); - } else { - snapShotBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder addSnapShot( - org.tensorflow.proto.util.SnapShot.Builder builderForValue) { - if (snapShotBuilder_ == null) { - ensureSnapShotIsMutable(); - snapShot_.add(builderForValue.build()); - onChanged(); - } else { - snapShotBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder addSnapShot( - int index, org.tensorflow.proto.util.SnapShot.Builder builderForValue) { - if (snapShotBuilder_ == null) { - ensureSnapShotIsMutable(); - snapShot_.add(index, builderForValue.build()); - onChanged(); - } else { - snapShotBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder addAllSnapShot( - java.lang.Iterable values) { - if (snapShotBuilder_ == null) { - ensureSnapShotIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, snapShot_); - onChanged(); - } else { - snapShotBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder clearSnapShot() { - if (snapShotBuilder_ == null) { - snapShot_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - snapShotBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public Builder removeSnapShot(int index) { - if (snapShotBuilder_ == null) { - ensureSnapShotIsMutable(); - snapShot_.remove(index); - onChanged(); - } else { - snapShotBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShot.Builder getSnapShotBuilder( - int index) { - return getSnapShotFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShotOrBuilder getSnapShotOrBuilder( - int index) { - if (snapShotBuilder_ == null) { - return snapShot_.get(index); } else { - return snapShotBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public java.util.List - getSnapShotOrBuilderList() { - if (snapShotBuilder_ != null) { - return snapShotBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(snapShot_); - } - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShot.Builder addSnapShotBuilder() { - return getSnapShotFieldBuilder().addBuilder( - org.tensorflow.proto.util.SnapShot.getDefaultInstance()); - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public org.tensorflow.proto.util.SnapShot.Builder addSnapShotBuilder( - int index) { - return getSnapShotFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.SnapShot.getDefaultInstance()); - } - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - public java.util.List - getSnapShotBuilderList() { - return getSnapShotFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder> - getSnapShotFieldBuilder() { - if (snapShotBuilder_ == null) { - snapShotBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder>( - snapShot_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - snapShot_ = null; - } - return snapShotBuilder_; - } - - private org.tensorflow.proto.util.MemAllocatorStats stats_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder> statsBuilder_; - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public boolean hasStats() { - return statsBuilder_ != null || stats_ != null; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public org.tensorflow.proto.util.MemAllocatorStats getStats() { - if (statsBuilder_ == null) { - return stats_ == null ? org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_; - } else { - return statsBuilder_.getMessage(); - } - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public Builder setStats(org.tensorflow.proto.util.MemAllocatorStats value) { - if (statsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - stats_ = value; - onChanged(); - } else { - statsBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public Builder setStats( - org.tensorflow.proto.util.MemAllocatorStats.Builder builderForValue) { - if (statsBuilder_ == null) { - stats_ = builderForValue.build(); - onChanged(); - } else { - statsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public Builder mergeStats(org.tensorflow.proto.util.MemAllocatorStats value) { - if (statsBuilder_ == null) { - if (stats_ != null) { - stats_ = - org.tensorflow.proto.util.MemAllocatorStats.newBuilder(stats_).mergeFrom(value).buildPartial(); - } else { - stats_ = value; - } - onChanged(); - } else { - statsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public Builder clearStats() { - if (statsBuilder_ == null) { - stats_ = null; - onChanged(); - } else { - stats_ = null; - statsBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public org.tensorflow.proto.util.MemAllocatorStats.Builder getStatsBuilder() { - - onChanged(); - return getStatsFieldBuilder().getBuilder(); - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - public org.tensorflow.proto.util.MemAllocatorStatsOrBuilder getStatsOrBuilder() { - if (statsBuilder_ != null) { - return statsBuilder_.getMessageOrBuilder(); - } else { - return stats_ == null ? - org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_; - } - } - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder> - getStatsFieldBuilder() { - if (statsBuilder_ == null) { - statsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder>( - getStats(), - getParentForChildren(), - isClean()); - stats_ = null; - } - return statsBuilder_; - } - @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.MemoryDump) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryDump) - private static final org.tensorflow.proto.util.MemoryDump DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.MemoryDump(); - } - - public static org.tensorflow.proto.util.MemoryDump getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryDump parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryDump(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.util.MemoryDump getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDumpOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDumpOrBuilder.java deleted file mode 100644 index 5d15667734f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/MemoryDumpOrBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public interface MemoryDumpOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemoryDump) - com.google.protobuf.MessageOrBuilder { - - /** - * string allocator_name = 1; - */ - java.lang.String getAllocatorName(); - /** - * string allocator_name = 1; - */ - com.google.protobuf.ByteString - getAllocatorNameBytes(); - - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - java.util.List - getBinSummaryList(); - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - org.tensorflow.proto.util.BinSummary getBinSummary(int index); - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - int getBinSummaryCount(); - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - java.util.List - getBinSummaryOrBuilderList(); - /** - * repeated .tensorflow.BinSummary bin_summary = 2; - */ - org.tensorflow.proto.util.BinSummaryOrBuilder getBinSummaryOrBuilder( - int index); - - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - java.util.List - getChunkList(); - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - org.tensorflow.proto.util.MemChunk getChunk(int index); - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - int getChunkCount(); - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - java.util.List - getChunkOrBuilderList(); - /** - * repeated .tensorflow.MemChunk chunk = 3; - */ - org.tensorflow.proto.util.MemChunkOrBuilder getChunkOrBuilder( - int index); - - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - java.util.List - getSnapShotList(); - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - org.tensorflow.proto.util.SnapShot getSnapShot(int index); - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - int getSnapShotCount(); - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - java.util.List - getSnapShotOrBuilderList(); - /** - * repeated .tensorflow.SnapShot snap_shot = 4; - */ - org.tensorflow.proto.util.SnapShotOrBuilder getSnapShotOrBuilder( - int index); - - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - boolean hasStats(); - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - org.tensorflow.proto.util.MemAllocatorStats getStats(); - /** - * .tensorflow.MemAllocatorStats stats = 5; - */ - org.tensorflow.proto.util.MemAllocatorStatsOrBuilder getStatsOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCode.java deleted file mode 100644 index 093cc8f7b5e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCode.java +++ /dev/null @@ -1,476 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.RequestedExitCode} - */ -public final class RequestedExitCode extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RequestedExitCode) - RequestedExitCodeOrBuilder { -private static final long serialVersionUID = 0L; - // Use RequestedExitCode.newBuilder() to construct. - private RequestedExitCode(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RequestedExitCode() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RequestedExitCode(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RequestedExitCode( - 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: { - - exitCode_ = input.readInt32(); - 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.util.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_RequestedExitCode_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.RequestedExitCode.class, org.tensorflow.proto.util.RequestedExitCode.Builder.class); - } - - public static final int EXIT_CODE_FIELD_NUMBER = 1; - private int exitCode_; - /** - * int32 exit_code = 1; - */ - public int getExitCode() { - return exitCode_; - } - - 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 (exitCode_ != 0) { - output.writeInt32(1, exitCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (exitCode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, exitCode_); - } - 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.util.RequestedExitCode)) { - return super.equals(obj); - } - org.tensorflow.proto.util.RequestedExitCode other = (org.tensorflow.proto.util.RequestedExitCode) obj; - - if (getExitCode() - != other.getExitCode()) 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) + EXIT_CODE_FIELD_NUMBER; - hash = (53 * hash) + getExitCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.RequestedExitCode parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.RequestedExitCode 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.RequestedExitCode parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.RequestedExitCode 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.RequestedExitCode parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.RequestedExitCode parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.RequestedExitCode parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.RequestedExitCode 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.RequestedExitCode parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.RequestedExitCode 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.RequestedExitCode parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.RequestedExitCode 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.util.RequestedExitCode 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.RequestedExitCode} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RequestedExitCode) - org.tensorflow.proto.util.RequestedExitCodeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_RequestedExitCode_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.RequestedExitCode.class, org.tensorflow.proto.util.RequestedExitCode.Builder.class); - } - - // Construct using org.tensorflow.proto.util.RequestedExitCode.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(); - exitCode_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.RequestedExitCode getDefaultInstanceForType() { - return org.tensorflow.proto.util.RequestedExitCode.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.RequestedExitCode build() { - org.tensorflow.proto.util.RequestedExitCode result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.RequestedExitCode buildPartial() { - org.tensorflow.proto.util.RequestedExitCode result = new org.tensorflow.proto.util.RequestedExitCode(this); - result.exitCode_ = exitCode_; - 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.util.RequestedExitCode) { - return mergeFrom((org.tensorflow.proto.util.RequestedExitCode)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.RequestedExitCode other) { - if (other == org.tensorflow.proto.util.RequestedExitCode.getDefaultInstance()) return this; - if (other.getExitCode() != 0) { - setExitCode(other.getExitCode()); - } - 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.util.RequestedExitCode parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.RequestedExitCode) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int exitCode_ ; - /** - * int32 exit_code = 1; - */ - public int getExitCode() { - return exitCode_; - } - /** - * int32 exit_code = 1; - */ - public Builder setExitCode(int value) { - - exitCode_ = value; - onChanged(); - return this; - } - /** - * int32 exit_code = 1; - */ - public Builder clearExitCode() { - - exitCode_ = 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.RequestedExitCode) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RequestedExitCode) - private static final org.tensorflow.proto.util.RequestedExitCode DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.RequestedExitCode(); - } - - public static org.tensorflow.proto.util.RequestedExitCode getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RequestedExitCode parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RequestedExitCode(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.util.RequestedExitCode getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCodeOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCodeOrBuilder.java deleted file mode 100644 index 260e7609dc7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/RequestedExitCodeOrBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface RequestedExitCodeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.RequestedExitCode) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 exit_code = 1; - */ - int getExitCode(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSlice.java deleted file mode 100644 index b1473544ce7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSlice.java +++ /dev/null @@ -1,1073 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Saved tensor slice: it stores the name of the tensors, the slice, and the
    - * raw data.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedSlice} - */ -public final class SavedSlice extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedSlice) - SavedSliceOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedSlice.newBuilder() to construct. - private SavedSlice(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedSlice() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedSlice(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedSlice( - 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 18: { - org.tensorflow.proto.framework.TensorSliceProto.Builder subBuilder = null; - if (slice_ != null) { - subBuilder = slice_.toBuilder(); - } - slice_ = input.readMessage(org.tensorflow.proto.framework.TensorSliceProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(slice_); - slice_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null; - if (data_ != null) { - subBuilder = data_.toBuilder(); - } - data_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(data_); - data_ = subBuilder.buildPartial(); - } - - 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.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedSlice.class, org.tensorflow.proto.util.SavedSlice.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Name of the tensor that this slice belongs to. This must be identical to
    -   * the name used to encode the key for this record.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Name of the tensor that this slice belongs to. This must be identical to
    -   * the name used to encode the key for this record.
    -   * 
    - * - * 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 SLICE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorSliceProto slice_; - /** - *
    -   * Extent of the slice.  Must have one entry for each of the dimension of the
    -   * tensor that this slice belongs to.
    -   * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public boolean hasSlice() { - return slice_ != null; - } - /** - *
    -   * Extent of the slice.  Must have one entry for each of the dimension of the
    -   * tensor that this slice belongs to.
    -   * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlice() { - return slice_ == null ? org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance() : slice_; - } - /** - *
    -   * Extent of the slice.  Must have one entry for each of the dimension of the
    -   * tensor that this slice belongs to.
    -   * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder() { - return getSlice(); - } - - public static final int DATA_FIELD_NUMBER = 3; - private org.tensorflow.proto.framework.TensorProto data_; - /** - *
    -   * The raw data of the slice is stored as a TensorProto. Only raw data are
    -   * stored (we don't fill in fields such as dtype or tensor_shape).
    -   * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public boolean hasData() { - return data_ != null; - } - /** - *
    -   * The raw data of the slice is stored as a TensorProto. Only raw data are
    -   * stored (we don't fill in fields such as dtype or tensor_shape).
    -   * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public org.tensorflow.proto.framework.TensorProto getData() { - return data_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : data_; - } - /** - *
    -   * The raw data of the slice is stored as a TensorProto. Only raw data are
    -   * stored (we don't fill in fields such as dtype or tensor_shape).
    -   * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getDataOrBuilder() { - return getData(); - } - - 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 (slice_ != null) { - output.writeMessage(2, getSlice()); - } - if (data_ != null) { - output.writeMessage(3, getData()); - } - 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 (slice_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getSlice()); - } - if (data_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getData()); - } - 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.util.SavedSlice)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SavedSlice other = (org.tensorflow.proto.util.SavedSlice) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasSlice() != other.hasSlice()) return false; - if (hasSlice()) { - if (!getSlice() - .equals(other.getSlice())) return false; - } - if (hasData() != other.hasData()) return false; - if (hasData()) { - if (!getData() - .equals(other.getData())) 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(); - if (hasSlice()) { - hash = (37 * hash) + SLICE_FIELD_NUMBER; - hash = (53 * hash) + getSlice().hashCode(); - } - if (hasData()) { - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getData().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SavedSlice parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSlice 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.SavedSlice parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSlice 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.SavedSlice parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSlice parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SavedSlice parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSlice 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.SavedSlice parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSlice 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.SavedSlice parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSlice 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.util.SavedSlice 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; - } - /** - *
    -   * Saved tensor slice: it stores the name of the tensors, the slice, and the
    -   * raw data.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedSlice} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedSlice) - org.tensorflow.proto.util.SavedSliceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedSlice.class, org.tensorflow.proto.util.SavedSlice.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SavedSlice.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_ = ""; - - if (sliceBuilder_ == null) { - slice_ = null; - } else { - slice_ = null; - sliceBuilder_ = null; - } - if (dataBuilder_ == null) { - data_ = null; - } else { - data_ = null; - dataBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSlice getDefaultInstanceForType() { - return org.tensorflow.proto.util.SavedSlice.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSlice build() { - org.tensorflow.proto.util.SavedSlice result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSlice buildPartial() { - org.tensorflow.proto.util.SavedSlice result = new org.tensorflow.proto.util.SavedSlice(this); - result.name_ = name_; - if (sliceBuilder_ == null) { - result.slice_ = slice_; - } else { - result.slice_ = sliceBuilder_.build(); - } - if (dataBuilder_ == null) { - result.data_ = data_; - } else { - result.data_ = dataBuilder_.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.util.SavedSlice) { - return mergeFrom((org.tensorflow.proto.util.SavedSlice)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SavedSlice other) { - if (other == org.tensorflow.proto.util.SavedSlice.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasSlice()) { - mergeSlice(other.getSlice()); - } - if (other.hasData()) { - mergeData(other.getData()); - } - 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.util.SavedSlice parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SavedSlice) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of the tensor that this slice belongs to. This must be identical to
    -     * the name used to encode the key for this record.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor that this slice belongs to. This must be identical to
    -     * the name used to encode the key for this record.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor that this slice belongs to. This must be identical to
    -     * the name used to encode the key for this record.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor that this slice belongs to. This must be identical to
    -     * the name used to encode the key for this record.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor that this slice belongs to. This must be identical to
    -     * the name used to encode the key for this record.
    -     * 
    - * - * 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 org.tensorflow.proto.framework.TensorSliceProto slice_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> sliceBuilder_; - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public boolean hasSlice() { - return sliceBuilder_ != null || slice_ != null; - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlice() { - if (sliceBuilder_ == null) { - return slice_ == null ? org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance() : slice_; - } else { - return sliceBuilder_.getMessage(); - } - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public Builder setSlice(org.tensorflow.proto.framework.TensorSliceProto value) { - if (sliceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - slice_ = value; - onChanged(); - } else { - sliceBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public Builder setSlice( - org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (sliceBuilder_ == null) { - slice_ = builderForValue.build(); - onChanged(); - } else { - sliceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public Builder mergeSlice(org.tensorflow.proto.framework.TensorSliceProto value) { - if (sliceBuilder_ == null) { - if (slice_ != null) { - slice_ = - org.tensorflow.proto.framework.TensorSliceProto.newBuilder(slice_).mergeFrom(value).buildPartial(); - } else { - slice_ = value; - } - onChanged(); - } else { - sliceBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public Builder clearSlice() { - if (sliceBuilder_ == null) { - slice_ = null; - onChanged(); - } else { - slice_ = null; - sliceBuilder_ = null; - } - - return this; - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder getSliceBuilder() { - - onChanged(); - return getSliceFieldBuilder().getBuilder(); - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder() { - if (sliceBuilder_ != null) { - return sliceBuilder_.getMessageOrBuilder(); - } else { - return slice_ == null ? - org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance() : slice_; - } - } - /** - *
    -     * Extent of the slice.  Must have one entry for each of the dimension of the
    -     * tensor that this slice belongs to.
    -     * 
    - * - * .tensorflow.TensorSliceProto slice = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> - getSliceFieldBuilder() { - if (sliceBuilder_ == null) { - sliceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder>( - getSlice(), - getParentForChildren(), - isClean()); - slice_ = null; - } - return sliceBuilder_; - } - - private org.tensorflow.proto.framework.TensorProto data_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> dataBuilder_; - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public boolean hasData() { - return dataBuilder_ != null || data_ != null; - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public org.tensorflow.proto.framework.TensorProto getData() { - if (dataBuilder_ == null) { - return data_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : data_; - } else { - return dataBuilder_.getMessage(); - } - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public Builder setData(org.tensorflow.proto.framework.TensorProto value) { - if (dataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - data_ = value; - onChanged(); - } else { - dataBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public Builder setData( - org.tensorflow.proto.framework.TensorProto.Builder builderForValue) { - if (dataBuilder_ == null) { - data_ = builderForValue.build(); - onChanged(); - } else { - dataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public Builder mergeData(org.tensorflow.proto.framework.TensorProto value) { - if (dataBuilder_ == null) { - if (data_ != null) { - data_ = - org.tensorflow.proto.framework.TensorProto.newBuilder(data_).mergeFrom(value).buildPartial(); - } else { - data_ = value; - } - onChanged(); - } else { - dataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public Builder clearData() { - if (dataBuilder_ == null) { - data_ = null; - onChanged(); - } else { - data_ = null; - dataBuilder_ = null; - } - - return this; - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public org.tensorflow.proto.framework.TensorProto.Builder getDataBuilder() { - - onChanged(); - return getDataFieldBuilder().getBuilder(); - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - public org.tensorflow.proto.framework.TensorProtoOrBuilder getDataOrBuilder() { - if (dataBuilder_ != null) { - return dataBuilder_.getMessageOrBuilder(); - } else { - return data_ == null ? - org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : data_; - } - } - /** - *
    -     * The raw data of the slice is stored as a TensorProto. Only raw data are
    -     * stored (we don't fill in fields such as dtype or tensor_shape).
    -     * 
    - * - * .tensorflow.TensorProto data = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> - getDataFieldBuilder() { - if (dataBuilder_ == null) { - dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>( - getData(), - getParentForChildren(), - isClean()); - data_ = null; - } - return dataBuilder_; - } - @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.SavedSlice) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedSlice) - private static final org.tensorflow.proto.util.SavedSlice DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SavedSlice(); - } - - public static org.tensorflow.proto.util.SavedSlice getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedSlice parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedSlice(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.util.SavedSlice getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMeta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMeta.java deleted file mode 100644 index 884792faec0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMeta.java +++ /dev/null @@ -1,1364 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Metadata describing the set of slices of the same tensor saved in a
    - * checkpoint file.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedSliceMeta} - */ -public final class SavedSliceMeta extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedSliceMeta) - SavedSliceMetaOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedSliceMeta.newBuilder() to construct. - private SavedSliceMeta(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedSliceMeta() { - name_ = ""; - type_ = 0; - slice_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedSliceMeta(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedSliceMeta( - 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 18: { - org.tensorflow.proto.framework.TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(org.tensorflow.proto.framework.TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - slice_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - slice_.add( - input.readMessage(org.tensorflow.proto.framework.TensorSliceProto.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_ & 0x00000001) != 0)) { - slice_ = java.util.Collections.unmodifiableList(slice_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedSliceMeta.class, org.tensorflow.proto.util.SavedSliceMeta.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * 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 SHAPE_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.TensorShapeProto shape_; - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - public static final int TYPE_FIELD_NUMBER = 3; - private int type_; - /** - *
    -   * Type of the tensor
    -   * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - /** - *
    -   * Type of the tensor
    -   * 
    - * - * .tensorflow.DataType type = 3; - */ - public org.tensorflow.proto.framework.DataType getType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(type_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - - public static final int SLICE_FIELD_NUMBER = 4; - private java.util.List slice_; - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public java.util.List getSliceList() { - return slice_; - } - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public java.util.List - getSliceOrBuilderList() { - return slice_; - } - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public int getSliceCount() { - return slice_.size(); - } - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlice(int index) { - return slice_.get(index); - } - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder( - int index) { - return slice_.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 { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - if (type_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, type_); - } - for (int i = 0; i < slice_.size(); i++) { - output.writeMessage(4, slice_.get(i)); - } - 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 (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - if (type_ != org.tensorflow.proto.framework.DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, type_); - } - for (int i = 0; i < slice_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, slice_.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.util.SavedSliceMeta)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SavedSliceMeta other = (org.tensorflow.proto.util.SavedSliceMeta) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasShape() != other.hasShape()) return false; - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (type_ != other.type_) return false; - if (!getSliceList() - .equals(other.getSliceList())) 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(); - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - if (getSliceCount() > 0) { - hash = (37 * hash) + SLICE_FIELD_NUMBER; - hash = (53 * hash) + getSliceList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SavedSliceMeta parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSliceMeta 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.SavedSliceMeta parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSliceMeta 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.SavedSliceMeta parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedSliceMeta parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SavedSliceMeta parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSliceMeta 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.SavedSliceMeta parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSliceMeta 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.SavedSliceMeta parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedSliceMeta 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.util.SavedSliceMeta 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; - } - /** - *
    -   * Metadata describing the set of slices of the same tensor saved in a
    -   * checkpoint file.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedSliceMeta} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedSliceMeta) - org.tensorflow.proto.util.SavedSliceMetaOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedSliceMeta.class, org.tensorflow.proto.util.SavedSliceMeta.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SavedSliceMeta.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSliceFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - type_ = 0; - - if (sliceBuilder_ == null) { - slice_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - sliceBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSliceMeta getDefaultInstanceForType() { - return org.tensorflow.proto.util.SavedSliceMeta.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSliceMeta build() { - org.tensorflow.proto.util.SavedSliceMeta result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedSliceMeta buildPartial() { - org.tensorflow.proto.util.SavedSliceMeta result = new org.tensorflow.proto.util.SavedSliceMeta(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - result.type_ = type_; - if (sliceBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - slice_ = java.util.Collections.unmodifiableList(slice_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.slice_ = slice_; - } else { - result.slice_ = sliceBuilder_.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.util.SavedSliceMeta) { - return mergeFrom((org.tensorflow.proto.util.SavedSliceMeta)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SavedSliceMeta other) { - if (other == org.tensorflow.proto.util.SavedSliceMeta.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (sliceBuilder_ == null) { - if (!other.slice_.isEmpty()) { - if (slice_.isEmpty()) { - slice_ = other.slice_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSliceIsMutable(); - slice_.addAll(other.slice_); - } - onChanged(); - } - } else { - if (!other.slice_.isEmpty()) { - if (sliceBuilder_.isEmpty()) { - sliceBuilder_.dispose(); - sliceBuilder_ = null; - slice_ = other.slice_; - bitField0_ = (bitField0_ & ~0x00000001); - sliceBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSliceFieldBuilder() : null; - } else { - sliceBuilder_.addAllMessages(other.slice_); - } - } - } - 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.util.SavedSliceMeta parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SavedSliceMeta) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the tensor.
    -     * 
    - * - * 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 org.tensorflow.proto.framework.TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> shapeBuilder_; - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - org.tensorflow.proto.framework.TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(org.tensorflow.proto.framework.TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - org.tensorflow.proto.framework.TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - public org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - org.tensorflow.proto.framework.TensorShapeProto.getDefaultInstance() : shape_; - } - } - /** - *
    -     * Shape of the tensor
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.TensorShapeProto, org.tensorflow.proto.framework.TensorShapeProto.Builder, org.tensorflow.proto.framework.TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private int type_ = 0; - /** - *
    -     * Type of the tensor
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - /** - *
    -     * Type of the tensor
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setTypeValue(int value) { - type_ = value; - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public org.tensorflow.proto.framework.DataType getType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.framework.DataType result = org.tensorflow.proto.framework.DataType.valueOf(type_); - return result == null ? org.tensorflow.proto.framework.DataType.UNRECOGNIZED : result; - } - /** - *
    -     * Type of the tensor
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setType(org.tensorflow.proto.framework.DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
    -     * Type of the tensor
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private java.util.List slice_ = - java.util.Collections.emptyList(); - private void ensureSliceIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - slice_ = new java.util.ArrayList(slice_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> sliceBuilder_; - - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public java.util.List getSliceList() { - if (sliceBuilder_ == null) { - return java.util.Collections.unmodifiableList(slice_); - } else { - return sliceBuilder_.getMessageList(); - } - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public int getSliceCount() { - if (sliceBuilder_ == null) { - return slice_.size(); - } else { - return sliceBuilder_.getCount(); - } - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProto getSlice(int index) { - if (sliceBuilder_ == null) { - return slice_.get(index); - } else { - return sliceBuilder_.getMessage(index); - } - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder setSlice( - int index, org.tensorflow.proto.framework.TensorSliceProto value) { - if (sliceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSliceIsMutable(); - slice_.set(index, value); - onChanged(); - } else { - sliceBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder setSlice( - int index, org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (sliceBuilder_ == null) { - ensureSliceIsMutable(); - slice_.set(index, builderForValue.build()); - onChanged(); - } else { - sliceBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder addSlice(org.tensorflow.proto.framework.TensorSliceProto value) { - if (sliceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSliceIsMutable(); - slice_.add(value); - onChanged(); - } else { - sliceBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder addSlice( - int index, org.tensorflow.proto.framework.TensorSliceProto value) { - if (sliceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSliceIsMutable(); - slice_.add(index, value); - onChanged(); - } else { - sliceBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder addSlice( - org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (sliceBuilder_ == null) { - ensureSliceIsMutable(); - slice_.add(builderForValue.build()); - onChanged(); - } else { - sliceBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder addSlice( - int index, org.tensorflow.proto.framework.TensorSliceProto.Builder builderForValue) { - if (sliceBuilder_ == null) { - ensureSliceIsMutable(); - slice_.add(index, builderForValue.build()); - onChanged(); - } else { - sliceBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder addAllSlice( - java.lang.Iterable values) { - if (sliceBuilder_ == null) { - ensureSliceIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, slice_); - onChanged(); - } else { - sliceBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder clearSlice() { - if (sliceBuilder_ == null) { - slice_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sliceBuilder_.clear(); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public Builder removeSlice(int index) { - if (sliceBuilder_ == null) { - ensureSliceIsMutable(); - slice_.remove(index); - onChanged(); - } else { - sliceBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder getSliceBuilder( - int index) { - return getSliceFieldBuilder().getBuilder(index); - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder( - int index) { - if (sliceBuilder_ == null) { - return slice_.get(index); } else { - return sliceBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public java.util.List - getSliceOrBuilderList() { - if (sliceBuilder_ != null) { - return sliceBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(slice_); - } - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder addSliceBuilder() { - return getSliceFieldBuilder().addBuilder( - org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance()); - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public org.tensorflow.proto.framework.TensorSliceProto.Builder addSliceBuilder( - int index) { - return getSliceFieldBuilder().addBuilder( - index, org.tensorflow.proto.framework.TensorSliceProto.getDefaultInstance()); - } - /** - *
    -     * Explicit list of slices saved in the checkpoint file.
    -     * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - public java.util.List - getSliceBuilderList() { - return getSliceFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder> - getSliceFieldBuilder() { - if (sliceBuilder_ == null) { - sliceBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.framework.TensorSliceProto, org.tensorflow.proto.framework.TensorSliceProto.Builder, org.tensorflow.proto.framework.TensorSliceProtoOrBuilder>( - slice_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - slice_ = null; - } - return sliceBuilder_; - } - @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.SavedSliceMeta) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedSliceMeta) - private static final org.tensorflow.proto.util.SavedSliceMeta DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SavedSliceMeta(); - } - - public static org.tensorflow.proto.util.SavedSliceMeta getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedSliceMeta parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedSliceMeta(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.util.SavedSliceMeta getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMetaOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMetaOrBuilder.java deleted file mode 100644 index 76aff4e7eb5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceMetaOrBuilder.java +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -public interface SavedSliceMetaOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SavedSliceMeta) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * string name = 1; - */ - java.lang.String getName(); - /** - *
    -   * Name of the tensor.
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProto getShape(); - /** - *
    -   * Shape of the tensor
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 2; - */ - org.tensorflow.proto.framework.TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - *
    -   * Type of the tensor
    -   * 
    - * - * .tensorflow.DataType type = 3; - */ - int getTypeValue(); - /** - *
    -   * Type of the tensor
    -   * 
    - * - * .tensorflow.DataType type = 3; - */ - org.tensorflow.proto.framework.DataType getType(); - - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - java.util.List - getSliceList(); - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - org.tensorflow.proto.framework.TensorSliceProto getSlice(int index); - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - int getSliceCount(); - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - java.util.List - getSliceOrBuilderList(); - /** - *
    -   * Explicit list of slices saved in the checkpoint file.
    -   * 
    - * - * repeated .tensorflow.TensorSliceProto slice = 4; - */ - org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMeta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMeta.java deleted file mode 100644 index 6217e7ed403..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMeta.java +++ /dev/null @@ -1,1108 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Metadata describing the set of tensor slices saved in a checkpoint file.
    - * It is always stored at the beginning of each checkpoint file.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedTensorSliceMeta} - */ -public final class SavedTensorSliceMeta extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedTensorSliceMeta) - SavedTensorSliceMetaOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedTensorSliceMeta.newBuilder() to construct. - private SavedTensorSliceMeta(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedTensorSliceMeta() { - tensor_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedTensorSliceMeta(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedTensorSliceMeta( - 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)) { - tensor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensor_.add( - input.readMessage(org.tensorflow.proto.util.SavedSliceMeta.parser(), extensionRegistry)); - break; - } - case 18: { - org.tensorflow.proto.framework.VersionDef.Builder subBuilder = null; - if (versions_ != null) { - subBuilder = versions_.toBuilder(); - } - versions_ = input.readMessage(org.tensorflow.proto.framework.VersionDef.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(versions_); - versions_ = subBuilder.buildPartial(); - } - - 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)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedTensorSliceMeta.class, org.tensorflow.proto.util.SavedTensorSliceMeta.Builder.class); - } - - public static final int TENSOR_FIELD_NUMBER = 1; - private java.util.List tensor_; - /** - *
    -   * Each SavedSliceMeta describes the slices for one tensor.
    -   * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public java.util.List getTensorList() { - return tensor_; - } - /** - *
    -   * Each SavedSliceMeta describes the slices for one tensor.
    -   * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public java.util.List - getTensorOrBuilderList() { - return tensor_; - } - /** - *
    -   * Each SavedSliceMeta describes the slices for one tensor.
    -   * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public int getTensorCount() { - return tensor_.size(); - } - /** - *
    -   * Each SavedSliceMeta describes the slices for one tensor.
    -   * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMeta getTensor(int index) { - return tensor_.get(index); - } - /** - *
    -   * Each SavedSliceMeta describes the slices for one tensor.
    -   * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder( - int index) { - return tensor_.get(index); - } - - public static final int VERSIONS_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.VersionDef versions_; - /** - *
    -   * Compatibility version of this checkpoint.  See core/public/version.h
    -   * for version history.
    -   * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public boolean hasVersions() { - return versions_ != null; - } - /** - *
    -   * Compatibility version of this checkpoint.  See core/public/version.h
    -   * for version history.
    -   * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public org.tensorflow.proto.framework.VersionDef getVersions() { - return versions_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } - /** - *
    -   * Compatibility version of this checkpoint.  See core/public/version.h
    -   * for version history.
    -   * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder() { - return getVersions(); - } - - 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 { - for (int i = 0; i < tensor_.size(); i++) { - output.writeMessage(1, tensor_.get(i)); - } - if (versions_ != null) { - output.writeMessage(2, getVersions()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < tensor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, tensor_.get(i)); - } - if (versions_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getVersions()); - } - 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.util.SavedTensorSliceMeta)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SavedTensorSliceMeta other = (org.tensorflow.proto.util.SavedTensorSliceMeta) obj; - - if (!getTensorList() - .equals(other.getTensorList())) return false; - if (hasVersions() != other.hasVersions()) return false; - if (hasVersions()) { - if (!getVersions() - .equals(other.getVersions())) 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 (getTensorCount() > 0) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensorList().hashCode(); - } - if (hasVersions()) { - hash = (37 * hash) + VERSIONS_FIELD_NUMBER; - hash = (53 * hash) + getVersions().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SavedTensorSliceMeta parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSliceMeta 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.util.SavedTensorSliceMeta 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; - } - /** - *
    -   * Metadata describing the set of tensor slices saved in a checkpoint file.
    -   * It is always stored at the beginning of each checkpoint file.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedTensorSliceMeta} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedTensorSliceMeta) - org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedTensorSliceMeta.class, org.tensorflow.proto.util.SavedTensorSliceMeta.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SavedTensorSliceMeta.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - tensorBuilder_.clear(); - } - if (versionsBuilder_ == null) { - versions_ = null; - } else { - versions_ = null; - versionsBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSliceMeta getDefaultInstanceForType() { - return org.tensorflow.proto.util.SavedTensorSliceMeta.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSliceMeta build() { - org.tensorflow.proto.util.SavedTensorSliceMeta result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSliceMeta buildPartial() { - org.tensorflow.proto.util.SavedTensorSliceMeta result = new org.tensorflow.proto.util.SavedTensorSliceMeta(this); - int from_bitField0_ = bitField0_; - if (tensorBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.build(); - } - if (versionsBuilder_ == null) { - result.versions_ = versions_; - } else { - result.versions_ = versionsBuilder_.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.util.SavedTensorSliceMeta) { - return mergeFrom((org.tensorflow.proto.util.SavedTensorSliceMeta)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SavedTensorSliceMeta other) { - if (other == org.tensorflow.proto.util.SavedTensorSliceMeta.getDefaultInstance()) return this; - if (tensorBuilder_ == null) { - if (!other.tensor_.isEmpty()) { - if (tensor_.isEmpty()) { - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorIsMutable(); - tensor_.addAll(other.tensor_); - } - onChanged(); - } - } else { - if (!other.tensor_.isEmpty()) { - if (tensorBuilder_.isEmpty()) { - tensorBuilder_.dispose(); - tensorBuilder_ = null; - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000001); - tensorBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorFieldBuilder() : null; - } else { - tensorBuilder_.addAllMessages(other.tensor_); - } - } - } - if (other.hasVersions()) { - mergeVersions(other.getVersions()); - } - 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.util.SavedTensorSliceMeta parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SavedTensorSliceMeta) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List tensor_ = - java.util.Collections.emptyList(); - private void ensureTensorIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensor_ = new java.util.ArrayList(tensor_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SavedSliceMeta, org.tensorflow.proto.util.SavedSliceMeta.Builder, org.tensorflow.proto.util.SavedSliceMetaOrBuilder> tensorBuilder_; - - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public java.util.List getTensorList() { - if (tensorBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensor_); - } else { - return tensorBuilder_.getMessageList(); - } - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public int getTensorCount() { - if (tensorBuilder_ == null) { - return tensor_.size(); - } else { - return tensorBuilder_.getCount(); - } - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMeta getTensor(int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); - } else { - return tensorBuilder_.getMessage(index); - } - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder setTensor( - int index, org.tensorflow.proto.util.SavedSliceMeta value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.set(index, value); - onChanged(); - } else { - tensorBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder setTensor( - int index, org.tensorflow.proto.util.SavedSliceMeta.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder addTensor(org.tensorflow.proto.util.SavedSliceMeta value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(value); - onChanged(); - } else { - tensorBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder addTensor( - int index, org.tensorflow.proto.util.SavedSliceMeta value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(index, value); - onChanged(); - } else { - tensorBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder addTensor( - org.tensorflow.proto.util.SavedSliceMeta.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder addTensor( - int index, org.tensorflow.proto.util.SavedSliceMeta.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder addAllTensor( - java.lang.Iterable values) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensor_); - onChanged(); - } else { - tensorBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - tensorBuilder_.clear(); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public Builder removeTensor(int index) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.remove(index); - onChanged(); - } else { - tensorBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMeta.Builder getTensorBuilder( - int index) { - return getTensorFieldBuilder().getBuilder(index); - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder( - int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); } else { - return tensorBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public java.util.List - getTensorOrBuilderList() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensor_); - } - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMeta.Builder addTensorBuilder() { - return getTensorFieldBuilder().addBuilder( - org.tensorflow.proto.util.SavedSliceMeta.getDefaultInstance()); - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public org.tensorflow.proto.util.SavedSliceMeta.Builder addTensorBuilder( - int index) { - return getTensorFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.SavedSliceMeta.getDefaultInstance()); - } - /** - *
    -     * Each SavedSliceMeta describes the slices for one tensor.
    -     * 
    - * - * repeated .tensorflow.SavedSliceMeta tensor = 1; - */ - public java.util.List - getTensorBuilderList() { - return getTensorFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SavedSliceMeta, org.tensorflow.proto.util.SavedSliceMeta.Builder, org.tensorflow.proto.util.SavedSliceMetaOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.SavedSliceMeta, org.tensorflow.proto.util.SavedSliceMeta.Builder, org.tensorflow.proto.util.SavedSliceMetaOrBuilder>( - tensor_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - - private org.tensorflow.proto.framework.VersionDef versions_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> versionsBuilder_; - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public boolean hasVersions() { - return versionsBuilder_ != null || versions_ != null; - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public org.tensorflow.proto.framework.VersionDef getVersions() { - if (versionsBuilder_ == null) { - return versions_ == null ? org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } else { - return versionsBuilder_.getMessage(); - } - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public Builder setVersions(org.tensorflow.proto.framework.VersionDef value) { - if (versionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - versions_ = value; - onChanged(); - } else { - versionsBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public Builder setVersions( - org.tensorflow.proto.framework.VersionDef.Builder builderForValue) { - if (versionsBuilder_ == null) { - versions_ = builderForValue.build(); - onChanged(); - } else { - versionsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public Builder mergeVersions(org.tensorflow.proto.framework.VersionDef value) { - if (versionsBuilder_ == null) { - if (versions_ != null) { - versions_ = - org.tensorflow.proto.framework.VersionDef.newBuilder(versions_).mergeFrom(value).buildPartial(); - } else { - versions_ = value; - } - onChanged(); - } else { - versionsBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public Builder clearVersions() { - if (versionsBuilder_ == null) { - versions_ = null; - onChanged(); - } else { - versions_ = null; - versionsBuilder_ = null; - } - - return this; - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public org.tensorflow.proto.framework.VersionDef.Builder getVersionsBuilder() { - - onChanged(); - return getVersionsFieldBuilder().getBuilder(); - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - public org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder() { - if (versionsBuilder_ != null) { - return versionsBuilder_.getMessageOrBuilder(); - } else { - return versions_ == null ? - org.tensorflow.proto.framework.VersionDef.getDefaultInstance() : versions_; - } - } - /** - *
    -     * Compatibility version of this checkpoint.  See core/public/version.h
    -     * for version history.
    -     * 
    - * - * .tensorflow.VersionDef versions = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder> - getVersionsFieldBuilder() { - if (versionsBuilder_ == null) { - versionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.VersionDef, org.tensorflow.proto.framework.VersionDef.Builder, org.tensorflow.proto.framework.VersionDefOrBuilder>( - getVersions(), - getParentForChildren(), - isClean()); - versions_ = null; - } - return versionsBuilder_; - } - @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.SavedTensorSliceMeta) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedTensorSliceMeta) - private static final org.tensorflow.proto.util.SavedTensorSliceMeta DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SavedTensorSliceMeta(); - } - - public static org.tensorflow.proto.util.SavedTensorSliceMeta getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedTensorSliceMeta parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedTensorSliceMeta(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.util.SavedTensorSliceMeta getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceProtos.java deleted file mode 100644 index 94de1b07571..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceProtos.java +++ /dev/null @@ -1,109 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -public final class SavedTensorSliceProtos { - private SavedTensorSliceProtos() {} - 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_SavedSliceMeta_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedTensorSliceMeta_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedSlice_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedSlice_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_SavedTensorSlices_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SavedTensorSlices_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/util/saved_tensor_slic" + - "e.proto\022\ntensorflow\032,tensorflow/core/fra" + - "mework/tensor_shape.proto\032,tensorflow/co" + - "re/framework/tensor_slice.proto\032&tensorf" + - "low/core/framework/tensor.proto\032%tensorf" + - "low/core/framework/types.proto\032(tensorfl" + - "ow/core/framework/versions.proto\"\234\001\n\016Sav" + - "edSliceMeta\022\014\n\004name\030\001 \001(\t\022+\n\005shape\030\002 \001(\013" + - "2\034.tensorflow.TensorShapeProto\022\"\n\004type\030\003" + - " \001(\0162\024.tensorflow.DataType\022+\n\005slice\030\004 \003(" + - "\0132\034.tensorflow.TensorSliceProto\"l\n\024Saved" + - "TensorSliceMeta\022*\n\006tensor\030\001 \003(\0132\032.tensor" + - "flow.SavedSliceMeta\022(\n\010versions\030\002 \001(\0132\026." + - "tensorflow.VersionDef\"n\n\nSavedSlice\022\014\n\004n" + - "ame\030\001 \001(\t\022+\n\005slice\030\002 \001(\0132\034.tensorflow.Te" + - "nsorSliceProto\022%\n\004data\030\003 \001(\0132\027.tensorflo" + - "w.TensorProto\"i\n\021SavedTensorSlices\022.\n\004me" + - "ta\030\001 \001(\0132 .tensorflow.SavedTensorSliceMe" + - "ta\022$\n\004data\030\002 \001(\0132\026.tensorflow.SavedSlice" + - "B8\n\031org.tensorflow.proto.utilB\026SavedTens" + - "orSliceProtosP\001\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorSliceProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(), - }); - internal_static_tensorflow_SavedSliceMeta_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedSliceMeta_descriptor, - new java.lang.String[] { "Name", "Shape", "Type", "Slice", }); - internal_static_tensorflow_SavedTensorSliceMeta_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedTensorSliceMeta_descriptor, - new java.lang.String[] { "Tensor", "Versions", }); - internal_static_tensorflow_SavedSlice_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_SavedSlice_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedSlice_descriptor, - new java.lang.String[] { "Name", "Slice", "Data", }); - internal_static_tensorflow_SavedTensorSlices_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SavedTensorSlices_descriptor, - new java.lang.String[] { "Meta", "Data", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorSliceProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlices.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlices.java deleted file mode 100644 index e058ca978ee..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlices.java +++ /dev/null @@ -1,899 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/saved_tensor_slice.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Each record in a v3 checkpoint file is a serialized SavedTensorSlices
    - * message.
    - * 
    - * - * Protobuf type {@code tensorflow.SavedTensorSlices} - */ -public final class SavedTensorSlices extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SavedTensorSlices) - SavedTensorSlicesOrBuilder { -private static final long serialVersionUID = 0L; - // Use SavedTensorSlices.newBuilder() to construct. - private SavedTensorSlices(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SavedTensorSlices() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SavedTensorSlices(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SavedTensorSlices( - 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: { - org.tensorflow.proto.util.SavedTensorSliceMeta.Builder subBuilder = null; - if (meta_ != null) { - subBuilder = meta_.toBuilder(); - } - meta_ = input.readMessage(org.tensorflow.proto.util.SavedTensorSliceMeta.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(meta_); - meta_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - org.tensorflow.proto.util.SavedSlice.Builder subBuilder = null; - if (data_ != null) { - subBuilder = data_.toBuilder(); - } - data_ = input.readMessage(org.tensorflow.proto.util.SavedSlice.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(data_); - data_ = subBuilder.buildPartial(); - } - - 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.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedTensorSlices.class, org.tensorflow.proto.util.SavedTensorSlices.Builder.class); - } - - public static final int META_FIELD_NUMBER = 1; - private org.tensorflow.proto.util.SavedTensorSliceMeta meta_; - /** - *
    -   * This is only present at the first item of each checkpoint file and serves
    -   * as a table of contents, listing all the tensor slices saved in this file.
    -   * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public boolean hasMeta() { - return meta_ != null; - } - /** - *
    -   * This is only present at the first item of each checkpoint file and serves
    -   * as a table of contents, listing all the tensor slices saved in this file.
    -   * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public org.tensorflow.proto.util.SavedTensorSliceMeta getMeta() { - return meta_ == null ? org.tensorflow.proto.util.SavedTensorSliceMeta.getDefaultInstance() : meta_; - } - /** - *
    -   * This is only present at the first item of each checkpoint file and serves
    -   * as a table of contents, listing all the tensor slices saved in this file.
    -   * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder getMetaOrBuilder() { - return getMeta(); - } - - public static final int DATA_FIELD_NUMBER = 2; - private org.tensorflow.proto.util.SavedSlice data_; - /** - *
    -   * This exists in all but the first item of each checkpoint file.
    -   * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public boolean hasData() { - return data_ != null; - } - /** - *
    -   * This exists in all but the first item of each checkpoint file.
    -   * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public org.tensorflow.proto.util.SavedSlice getData() { - return data_ == null ? org.tensorflow.proto.util.SavedSlice.getDefaultInstance() : data_; - } - /** - *
    -   * This exists in all but the first item of each checkpoint file.
    -   * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public org.tensorflow.proto.util.SavedSliceOrBuilder getDataOrBuilder() { - return getData(); - } - - 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 (meta_ != null) { - output.writeMessage(1, getMeta()); - } - if (data_ != null) { - output.writeMessage(2, getData()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (meta_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getMeta()); - } - if (data_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getData()); - } - 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.util.SavedTensorSlices)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SavedTensorSlices other = (org.tensorflow.proto.util.SavedTensorSlices) obj; - - if (hasMeta() != other.hasMeta()) return false; - if (hasMeta()) { - if (!getMeta() - .equals(other.getMeta())) return false; - } - if (hasData() != other.hasData()) return false; - if (hasData()) { - if (!getData() - .equals(other.getData())) 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 (hasMeta()) { - hash = (37 * hash) + META_FIELD_NUMBER; - hash = (53 * hash) + getMeta().hashCode(); - } - if (hasData()) { - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getData().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SavedTensorSlices parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSlices 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.SavedTensorSlices parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSlices 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.SavedTensorSlices parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SavedTensorSlices parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SavedTensorSlices parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSlices 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.SavedTensorSlices parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSlices 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.SavedTensorSlices parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SavedTensorSlices 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.util.SavedTensorSlices 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; - } - /** - *
    -   * Each record in a v3 checkpoint file is a serialized SavedTensorSlices
    -   * message.
    -   * 
    - * - * Protobuf type {@code tensorflow.SavedTensorSlices} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SavedTensorSlices) - org.tensorflow.proto.util.SavedTensorSlicesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SavedTensorSlices.class, org.tensorflow.proto.util.SavedTensorSlices.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SavedTensorSlices.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 (metaBuilder_ == null) { - meta_ = null; - } else { - meta_ = null; - metaBuilder_ = null; - } - if (dataBuilder_ == null) { - data_ = null; - } else { - data_ = null; - dataBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSlices getDefaultInstanceForType() { - return org.tensorflow.proto.util.SavedTensorSlices.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSlices build() { - org.tensorflow.proto.util.SavedTensorSlices result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SavedTensorSlices buildPartial() { - org.tensorflow.proto.util.SavedTensorSlices result = new org.tensorflow.proto.util.SavedTensorSlices(this); - if (metaBuilder_ == null) { - result.meta_ = meta_; - } else { - result.meta_ = metaBuilder_.build(); - } - if (dataBuilder_ == null) { - result.data_ = data_; - } else { - result.data_ = dataBuilder_.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.util.SavedTensorSlices) { - return mergeFrom((org.tensorflow.proto.util.SavedTensorSlices)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SavedTensorSlices other) { - if (other == org.tensorflow.proto.util.SavedTensorSlices.getDefaultInstance()) return this; - if (other.hasMeta()) { - mergeMeta(other.getMeta()); - } - if (other.hasData()) { - mergeData(other.getData()); - } - 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.util.SavedTensorSlices parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SavedTensorSlices) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.tensorflow.proto.util.SavedTensorSliceMeta meta_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedTensorSliceMeta, org.tensorflow.proto.util.SavedTensorSliceMeta.Builder, org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder> metaBuilder_; - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public boolean hasMeta() { - return metaBuilder_ != null || meta_ != null; - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public org.tensorflow.proto.util.SavedTensorSliceMeta getMeta() { - if (metaBuilder_ == null) { - return meta_ == null ? org.tensorflow.proto.util.SavedTensorSliceMeta.getDefaultInstance() : meta_; - } else { - return metaBuilder_.getMessage(); - } - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public Builder setMeta(org.tensorflow.proto.util.SavedTensorSliceMeta value) { - if (metaBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - meta_ = value; - onChanged(); - } else { - metaBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public Builder setMeta( - org.tensorflow.proto.util.SavedTensorSliceMeta.Builder builderForValue) { - if (metaBuilder_ == null) { - meta_ = builderForValue.build(); - onChanged(); - } else { - metaBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public Builder mergeMeta(org.tensorflow.proto.util.SavedTensorSliceMeta value) { - if (metaBuilder_ == null) { - if (meta_ != null) { - meta_ = - org.tensorflow.proto.util.SavedTensorSliceMeta.newBuilder(meta_).mergeFrom(value).buildPartial(); - } else { - meta_ = value; - } - onChanged(); - } else { - metaBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public Builder clearMeta() { - if (metaBuilder_ == null) { - meta_ = null; - onChanged(); - } else { - meta_ = null; - metaBuilder_ = null; - } - - return this; - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public org.tensorflow.proto.util.SavedTensorSliceMeta.Builder getMetaBuilder() { - - onChanged(); - return getMetaFieldBuilder().getBuilder(); - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - public org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder getMetaOrBuilder() { - if (metaBuilder_ != null) { - return metaBuilder_.getMessageOrBuilder(); - } else { - return meta_ == null ? - org.tensorflow.proto.util.SavedTensorSliceMeta.getDefaultInstance() : meta_; - } - } - /** - *
    -     * This is only present at the first item of each checkpoint file and serves
    -     * as a table of contents, listing all the tensor slices saved in this file.
    -     * 
    - * - * .tensorflow.SavedTensorSliceMeta meta = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedTensorSliceMeta, org.tensorflow.proto.util.SavedTensorSliceMeta.Builder, org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder> - getMetaFieldBuilder() { - if (metaBuilder_ == null) { - metaBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedTensorSliceMeta, org.tensorflow.proto.util.SavedTensorSliceMeta.Builder, org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder>( - getMeta(), - getParentForChildren(), - isClean()); - meta_ = null; - } - return metaBuilder_; - } - - private org.tensorflow.proto.util.SavedSlice data_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedSlice, org.tensorflow.proto.util.SavedSlice.Builder, org.tensorflow.proto.util.SavedSliceOrBuilder> dataBuilder_; - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public boolean hasData() { - return dataBuilder_ != null || data_ != null; - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public org.tensorflow.proto.util.SavedSlice getData() { - if (dataBuilder_ == null) { - return data_ == null ? org.tensorflow.proto.util.SavedSlice.getDefaultInstance() : data_; - } else { - return dataBuilder_.getMessage(); - } - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public Builder setData(org.tensorflow.proto.util.SavedSlice value) { - if (dataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - data_ = value; - onChanged(); - } else { - dataBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public Builder setData( - org.tensorflow.proto.util.SavedSlice.Builder builderForValue) { - if (dataBuilder_ == null) { - data_ = builderForValue.build(); - onChanged(); - } else { - dataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public Builder mergeData(org.tensorflow.proto.util.SavedSlice value) { - if (dataBuilder_ == null) { - if (data_ != null) { - data_ = - org.tensorflow.proto.util.SavedSlice.newBuilder(data_).mergeFrom(value).buildPartial(); - } else { - data_ = value; - } - onChanged(); - } else { - dataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public Builder clearData() { - if (dataBuilder_ == null) { - data_ = null; - onChanged(); - } else { - data_ = null; - dataBuilder_ = null; - } - - return this; - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public org.tensorflow.proto.util.SavedSlice.Builder getDataBuilder() { - - onChanged(); - return getDataFieldBuilder().getBuilder(); - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - public org.tensorflow.proto.util.SavedSliceOrBuilder getDataOrBuilder() { - if (dataBuilder_ != null) { - return dataBuilder_.getMessageOrBuilder(); - } else { - return data_ == null ? - org.tensorflow.proto.util.SavedSlice.getDefaultInstance() : data_; - } - } - /** - *
    -     * This exists in all but the first item of each checkpoint file.
    -     * 
    - * - * .tensorflow.SavedSlice data = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedSlice, org.tensorflow.proto.util.SavedSlice.Builder, org.tensorflow.proto.util.SavedSliceOrBuilder> - getDataFieldBuilder() { - if (dataBuilder_ == null) { - dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.SavedSlice, org.tensorflow.proto.util.SavedSlice.Builder, org.tensorflow.proto.util.SavedSliceOrBuilder>( - getData(), - getParentForChildren(), - isClean()); - data_ = null; - } - return dataBuilder_; - } - @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.SavedTensorSlices) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SavedTensorSlices) - private static final org.tensorflow.proto.util.SavedTensorSlices DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SavedTensorSlices(); - } - - public static org.tensorflow.proto.util.SavedTensorSlices getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SavedTensorSlices parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SavedTensorSlices(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.util.SavedTensorSlices getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDef.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDef.java deleted file mode 100644 index daf4a6c91e4..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDef.java +++ /dev/null @@ -1,1356 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saver.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Protocol buffer representing the configuration of a Saver.
    - * 
    - * - * Protobuf type {@code tensorflow.SaverDef} - */ -public final class SaverDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SaverDef) - SaverDefOrBuilder { -private static final long serialVersionUID = 0L; - // Use SaverDef.newBuilder() to construct. - private SaverDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SaverDef() { - filenameTensorName_ = ""; - saveTensorName_ = ""; - restoreOpName_ = ""; - version_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SaverDef(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SaverDef( - 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(); - - filenameTensorName_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - saveTensorName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - restoreOpName_ = s; - break; - } - case 32: { - - maxToKeep_ = input.readInt32(); - break; - } - case 40: { - - sharded_ = input.readBool(); - break; - } - case 53: { - - keepCheckpointEveryNHours_ = input.readFloat(); - break; - } - case 56: { - int rawValue = input.readEnum(); - - version_ = rawValue; - 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.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SaverDef.class, org.tensorflow.proto.util.SaverDef.Builder.class); - } - - /** - *
    -   * A version number that identifies a different on-disk checkpoint format.
    -   * Usually, each subclass of BaseSaverBuilder works with a particular
    -   * version/format.  However, it is possible that the same builder may be
    -   * upgraded to support a newer checkpoint format in the future.
    -   * 
    - * - * Protobuf enum {@code tensorflow.SaverDef.CheckpointFormatVersion} - */ - public enum CheckpointFormatVersion - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * Internal legacy format.
    -     * 
    - * - * LEGACY = 0; - */ - LEGACY(0), - /** - *
    -     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
    -     * 
    - * - * V1 = 1; - */ - V1(1), - /** - *
    -     * Current format: more efficient.
    -     * 
    - * - * V2 = 2; - */ - V2(2), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * Internal legacy format.
    -     * 
    - * - * LEGACY = 0; - */ - public static final int LEGACY_VALUE = 0; - /** - *
    -     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
    -     * 
    - * - * V1 = 1; - */ - public static final int V1_VALUE = 1; - /** - *
    -     * Current format: more efficient.
    -     * 
    - * - * V2 = 2; - */ - public static final int V2_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 CheckpointFormatVersion valueOf(int value) { - return forNumber(value); - } - - public static CheckpointFormatVersion forNumber(int value) { - switch (value) { - case 0: return LEGACY; - case 1: return V1; - case 2: return V2; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - CheckpointFormatVersion> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public CheckpointFormatVersion findValueByNumber(int number) { - return CheckpointFormatVersion.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.util.SaverDef.getDescriptor().getEnumTypes().get(0); - } - - private static final CheckpointFormatVersion[] VALUES = values(); - - public static CheckpointFormatVersion 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 CheckpointFormatVersion(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.SaverDef.CheckpointFormatVersion) - } - - public static final int FILENAME_TENSOR_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object filenameTensorName_; - /** - *
    -   * The name of the tensor in which to specify the filename when saving or
    -   * restoring a model checkpoint.
    -   * 
    - * - * string filename_tensor_name = 1; - */ - public java.lang.String getFilenameTensorName() { - java.lang.Object ref = filenameTensorName_; - 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(); - filenameTensorName_ = s; - return s; - } - } - /** - *
    -   * The name of the tensor in which to specify the filename when saving or
    -   * restoring a model checkpoint.
    -   * 
    - * - * string filename_tensor_name = 1; - */ - public com.google.protobuf.ByteString - getFilenameTensorNameBytes() { - java.lang.Object ref = filenameTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filenameTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SAVE_TENSOR_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object saveTensorName_; - /** - *
    -   * The operation to run when saving a model checkpoint.
    -   * 
    - * - * string save_tensor_name = 2; - */ - public java.lang.String getSaveTensorName() { - java.lang.Object ref = saveTensorName_; - 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(); - saveTensorName_ = s; - return s; - } - } - /** - *
    -   * The operation to run when saving a model checkpoint.
    -   * 
    - * - * string save_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getSaveTensorNameBytes() { - java.lang.Object ref = saveTensorName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - saveTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESTORE_OP_NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object restoreOpName_; - /** - *
    -   * The operation to run when restoring a model checkpoint.
    -   * 
    - * - * string restore_op_name = 3; - */ - public java.lang.String getRestoreOpName() { - java.lang.Object ref = restoreOpName_; - 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(); - restoreOpName_ = s; - return s; - } - } - /** - *
    -   * The operation to run when restoring a model checkpoint.
    -   * 
    - * - * string restore_op_name = 3; - */ - public com.google.protobuf.ByteString - getRestoreOpNameBytes() { - java.lang.Object ref = restoreOpName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - restoreOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_TO_KEEP_FIELD_NUMBER = 4; - private int maxToKeep_; - /** - *
    -   * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    -   * 
    - * - * int32 max_to_keep = 4; - */ - public int getMaxToKeep() { - return maxToKeep_; - } - - public static final int SHARDED_FIELD_NUMBER = 5; - private boolean sharded_; - /** - *
    -   * Shard the save files, one per device that has Variable nodes.
    -   * 
    - * - * bool sharded = 5; - */ - public boolean getSharded() { - return sharded_; - } - - public static final int KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER = 6; - private float keepCheckpointEveryNHours_; - /** - *
    -   * How often to keep an additional checkpoint. If not specified, only the last
    -   * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    -   * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    -   * for every n hours of training.
    -   * 
    - * - * float keep_checkpoint_every_n_hours = 6; - */ - public float getKeepCheckpointEveryNHours() { - return keepCheckpointEveryNHours_; - } - - public static final int VERSION_FIELD_NUMBER = 7; - private int version_; - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public int getVersionValue() { - return version_; - } - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion getVersion() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.valueOf(version_); - return result == null ? org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result; - } - - 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 (!getFilenameTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filenameTensorName_); - } - if (!getSaveTensorNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, saveTensorName_); - } - if (!getRestoreOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, restoreOpName_); - } - if (maxToKeep_ != 0) { - output.writeInt32(4, maxToKeep_); - } - if (sharded_ != false) { - output.writeBool(5, sharded_); - } - if (keepCheckpointEveryNHours_ != 0F) { - output.writeFloat(6, keepCheckpointEveryNHours_); - } - if (version_ != org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) { - output.writeEnum(7, version_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getFilenameTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filenameTensorName_); - } - if (!getSaveTensorNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, saveTensorName_); - } - if (!getRestoreOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, restoreOpName_); - } - if (maxToKeep_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, maxToKeep_); - } - if (sharded_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, sharded_); - } - if (keepCheckpointEveryNHours_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(6, keepCheckpointEveryNHours_); - } - if (version_ != org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, version_); - } - 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.util.SaverDef)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SaverDef other = (org.tensorflow.proto.util.SaverDef) obj; - - if (!getFilenameTensorName() - .equals(other.getFilenameTensorName())) return false; - if (!getSaveTensorName() - .equals(other.getSaveTensorName())) return false; - if (!getRestoreOpName() - .equals(other.getRestoreOpName())) return false; - if (getMaxToKeep() - != other.getMaxToKeep()) return false; - if (getSharded() - != other.getSharded()) return false; - if (java.lang.Float.floatToIntBits(getKeepCheckpointEveryNHours()) - != java.lang.Float.floatToIntBits( - other.getKeepCheckpointEveryNHours())) return false; - if (version_ != other.version_) 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) + FILENAME_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getFilenameTensorName().hashCode(); - hash = (37 * hash) + SAVE_TENSOR_NAME_FIELD_NUMBER; - hash = (53 * hash) + getSaveTensorName().hashCode(); - hash = (37 * hash) + RESTORE_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getRestoreOpName().hashCode(); - hash = (37 * hash) + MAX_TO_KEEP_FIELD_NUMBER; - hash = (53 * hash) + getMaxToKeep(); - hash = (37 * hash) + SHARDED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSharded()); - hash = (37 * hash) + KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getKeepCheckpointEveryNHours()); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + version_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SaverDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SaverDef 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.SaverDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SaverDef 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.SaverDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SaverDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SaverDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SaverDef 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.SaverDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SaverDef 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.SaverDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SaverDef 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.util.SaverDef 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; - } - /** - *
    -   * Protocol buffer representing the configuration of a Saver.
    -   * 
    - * - * Protobuf type {@code tensorflow.SaverDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SaverDef) - org.tensorflow.proto.util.SaverDefOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SaverDef.class, org.tensorflow.proto.util.SaverDef.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SaverDef.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(); - filenameTensorName_ = ""; - - saveTensorName_ = ""; - - restoreOpName_ = ""; - - maxToKeep_ = 0; - - sharded_ = false; - - keepCheckpointEveryNHours_ = 0F; - - version_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SaverDef getDefaultInstanceForType() { - return org.tensorflow.proto.util.SaverDef.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SaverDef build() { - org.tensorflow.proto.util.SaverDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SaverDef buildPartial() { - org.tensorflow.proto.util.SaverDef result = new org.tensorflow.proto.util.SaverDef(this); - result.filenameTensorName_ = filenameTensorName_; - result.saveTensorName_ = saveTensorName_; - result.restoreOpName_ = restoreOpName_; - result.maxToKeep_ = maxToKeep_; - result.sharded_ = sharded_; - result.keepCheckpointEveryNHours_ = keepCheckpointEveryNHours_; - result.version_ = version_; - 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.util.SaverDef) { - return mergeFrom((org.tensorflow.proto.util.SaverDef)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SaverDef other) { - if (other == org.tensorflow.proto.util.SaverDef.getDefaultInstance()) return this; - if (!other.getFilenameTensorName().isEmpty()) { - filenameTensorName_ = other.filenameTensorName_; - onChanged(); - } - if (!other.getSaveTensorName().isEmpty()) { - saveTensorName_ = other.saveTensorName_; - onChanged(); - } - if (!other.getRestoreOpName().isEmpty()) { - restoreOpName_ = other.restoreOpName_; - onChanged(); - } - if (other.getMaxToKeep() != 0) { - setMaxToKeep(other.getMaxToKeep()); - } - if (other.getSharded() != false) { - setSharded(other.getSharded()); - } - if (other.getKeepCheckpointEveryNHours() != 0F) { - setKeepCheckpointEveryNHours(other.getKeepCheckpointEveryNHours()); - } - if (other.version_ != 0) { - setVersionValue(other.getVersionValue()); - } - 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.util.SaverDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SaverDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object filenameTensorName_ = ""; - /** - *
    -     * The name of the tensor in which to specify the filename when saving or
    -     * restoring a model checkpoint.
    -     * 
    - * - * string filename_tensor_name = 1; - */ - public java.lang.String getFilenameTensorName() { - java.lang.Object ref = filenameTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filenameTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The name of the tensor in which to specify the filename when saving or
    -     * restoring a model checkpoint.
    -     * 
    - * - * string filename_tensor_name = 1; - */ - public com.google.protobuf.ByteString - getFilenameTensorNameBytes() { - java.lang.Object ref = filenameTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filenameTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The name of the tensor in which to specify the filename when saving or
    -     * restoring a model checkpoint.
    -     * 
    - * - * string filename_tensor_name = 1; - */ - public Builder setFilenameTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filenameTensorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The name of the tensor in which to specify the filename when saving or
    -     * restoring a model checkpoint.
    -     * 
    - * - * string filename_tensor_name = 1; - */ - public Builder clearFilenameTensorName() { - - filenameTensorName_ = getDefaultInstance().getFilenameTensorName(); - onChanged(); - return this; - } - /** - *
    -     * The name of the tensor in which to specify the filename when saving or
    -     * restoring a model checkpoint.
    -     * 
    - * - * string filename_tensor_name = 1; - */ - public Builder setFilenameTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filenameTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object saveTensorName_ = ""; - /** - *
    -     * The operation to run when saving a model checkpoint.
    -     * 
    - * - * string save_tensor_name = 2; - */ - public java.lang.String getSaveTensorName() { - java.lang.Object ref = saveTensorName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - saveTensorName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation to run when saving a model checkpoint.
    -     * 
    - * - * string save_tensor_name = 2; - */ - public com.google.protobuf.ByteString - getSaveTensorNameBytes() { - java.lang.Object ref = saveTensorName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - saveTensorName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation to run when saving a model checkpoint.
    -     * 
    - * - * string save_tensor_name = 2; - */ - public Builder setSaveTensorName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - saveTensorName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation to run when saving a model checkpoint.
    -     * 
    - * - * string save_tensor_name = 2; - */ - public Builder clearSaveTensorName() { - - saveTensorName_ = getDefaultInstance().getSaveTensorName(); - onChanged(); - return this; - } - /** - *
    -     * The operation to run when saving a model checkpoint.
    -     * 
    - * - * string save_tensor_name = 2; - */ - public Builder setSaveTensorNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - saveTensorName_ = value; - onChanged(); - return this; - } - - private java.lang.Object restoreOpName_ = ""; - /** - *
    -     * The operation to run when restoring a model checkpoint.
    -     * 
    - * - * string restore_op_name = 3; - */ - public java.lang.String getRestoreOpName() { - java.lang.Object ref = restoreOpName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - restoreOpName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The operation to run when restoring a model checkpoint.
    -     * 
    - * - * string restore_op_name = 3; - */ - public com.google.protobuf.ByteString - getRestoreOpNameBytes() { - java.lang.Object ref = restoreOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - restoreOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The operation to run when restoring a model checkpoint.
    -     * 
    - * - * string restore_op_name = 3; - */ - public Builder setRestoreOpName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - restoreOpName_ = value; - onChanged(); - return this; - } - /** - *
    -     * The operation to run when restoring a model checkpoint.
    -     * 
    - * - * string restore_op_name = 3; - */ - public Builder clearRestoreOpName() { - - restoreOpName_ = getDefaultInstance().getRestoreOpName(); - onChanged(); - return this; - } - /** - *
    -     * The operation to run when restoring a model checkpoint.
    -     * 
    - * - * string restore_op_name = 3; - */ - public Builder setRestoreOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - restoreOpName_ = value; - onChanged(); - return this; - } - - private int maxToKeep_ ; - /** - *
    -     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    -     * 
    - * - * int32 max_to_keep = 4; - */ - public int getMaxToKeep() { - return maxToKeep_; - } - /** - *
    -     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    -     * 
    - * - * int32 max_to_keep = 4; - */ - public Builder setMaxToKeep(int value) { - - maxToKeep_ = value; - onChanged(); - return this; - } - /** - *
    -     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    -     * 
    - * - * int32 max_to_keep = 4; - */ - public Builder clearMaxToKeep() { - - maxToKeep_ = 0; - onChanged(); - return this; - } - - private boolean sharded_ ; - /** - *
    -     * Shard the save files, one per device that has Variable nodes.
    -     * 
    - * - * bool sharded = 5; - */ - public boolean getSharded() { - return sharded_; - } - /** - *
    -     * Shard the save files, one per device that has Variable nodes.
    -     * 
    - * - * bool sharded = 5; - */ - public Builder setSharded(boolean value) { - - sharded_ = value; - onChanged(); - return this; - } - /** - *
    -     * Shard the save files, one per device that has Variable nodes.
    -     * 
    - * - * bool sharded = 5; - */ - public Builder clearSharded() { - - sharded_ = false; - onChanged(); - return this; - } - - private float keepCheckpointEveryNHours_ ; - /** - *
    -     * How often to keep an additional checkpoint. If not specified, only the last
    -     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    -     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    -     * for every n hours of training.
    -     * 
    - * - * float keep_checkpoint_every_n_hours = 6; - */ - public float getKeepCheckpointEveryNHours() { - return keepCheckpointEveryNHours_; - } - /** - *
    -     * How often to keep an additional checkpoint. If not specified, only the last
    -     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    -     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    -     * for every n hours of training.
    -     * 
    - * - * float keep_checkpoint_every_n_hours = 6; - */ - public Builder setKeepCheckpointEveryNHours(float value) { - - keepCheckpointEveryNHours_ = value; - onChanged(); - return this; - } - /** - *
    -     * How often to keep an additional checkpoint. If not specified, only the last
    -     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    -     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    -     * for every n hours of training.
    -     * 
    - * - * float keep_checkpoint_every_n_hours = 6; - */ - public Builder clearKeepCheckpointEveryNHours() { - - keepCheckpointEveryNHours_ = 0F; - onChanged(); - return this; - } - - private int version_ = 0; - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public int getVersionValue() { - return version_; - } - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public Builder setVersionValue(int value) { - version_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion getVersion() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.valueOf(version_); - return result == null ? org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result; - } - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public Builder setVersion(org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; - */ - public Builder clearVersion() { - - version_ = 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.SaverDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SaverDef) - private static final org.tensorflow.proto.util.SaverDef DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SaverDef(); - } - - public static org.tensorflow.proto.util.SaverDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SaverDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SaverDef(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.util.SaverDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index 279140f5a3a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverProtos.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/saver.proto - -package org.tensorflow.proto.util; - -public final class SaverProtos { - private SaverProtos() {} - 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_SaverDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_SaverDef_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/saver.proto\022\n" + - "tensorflow\"\236\002\n\010SaverDef\022\034\n\024filename_tens" + - "or_name\030\001 \001(\t\022\030\n\020save_tensor_name\030\002 \001(\t\022" + - "\027\n\017restore_op_name\030\003 \001(\t\022\023\n\013max_to_keep\030" + - "\004 \001(\005\022\017\n\007sharded\030\005 \001(\010\022%\n\035keep_checkpoin" + - "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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_SaverDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_SaverDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_SaverDef_descriptor, - new java.lang.String[] { "FilenameTensorName", "SaveTensorName", "RestoreOpName", "MaxToKeep", "Sharded", "KeepCheckpointEveryNHours", "Version", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLog.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLog.java deleted file mode 100644 index 824dba910f9..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLog.java +++ /dev/null @@ -1,910 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Protocol buffer used for logging session state.
    - * 
    - * - * Protobuf type {@code tensorflow.SessionLog} - */ -public final class SessionLog extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SessionLog) - SessionLogOrBuilder { -private static final long serialVersionUID = 0L; - // Use SessionLog.newBuilder() to construct. - private SessionLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SessionLog() { - status_ = 0; - checkpointPath_ = ""; - msg_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SessionLog(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SessionLog( - 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: { - int rawValue = input.readEnum(); - - status_ = rawValue; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - checkpointPath_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - msg_ = s; - 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.util.EventProtos.internal_static_tensorflow_SessionLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_SessionLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SessionLog.class, org.tensorflow.proto.util.SessionLog.Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.SessionLog.SessionStatus} - */ - public enum SessionStatus - implements com.google.protobuf.ProtocolMessageEnum { - /** - * STATUS_UNSPECIFIED = 0; - */ - STATUS_UNSPECIFIED(0), - /** - * START = 1; - */ - START(1), - /** - * STOP = 2; - */ - STOP(2), - /** - * CHECKPOINT = 3; - */ - CHECKPOINT(3), - UNRECOGNIZED(-1), - ; - - /** - * STATUS_UNSPECIFIED = 0; - */ - public static final int STATUS_UNSPECIFIED_VALUE = 0; - /** - * START = 1; - */ - public static final int START_VALUE = 1; - /** - * STOP = 2; - */ - public static final int STOP_VALUE = 2; - /** - * CHECKPOINT = 3; - */ - public static final int CHECKPOINT_VALUE = 3; - - - 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 SessionStatus valueOf(int value) { - return forNumber(value); - } - - public static SessionStatus forNumber(int value) { - switch (value) { - case 0: return STATUS_UNSPECIFIED; - case 1: return START; - case 2: return STOP; - case 3: return CHECKPOINT; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - SessionStatus> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SessionStatus findValueByNumber(int number) { - return SessionStatus.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.util.SessionLog.getDescriptor().getEnumTypes().get(0); - } - - private static final SessionStatus[] VALUES = values(); - - public static SessionStatus 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 SessionStatus(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.SessionLog.SessionStatus) - } - - public static final int STATUS_FIELD_NUMBER = 1; - private int status_; - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public int getStatusValue() { - return status_; - } - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public org.tensorflow.proto.util.SessionLog.SessionStatus getStatus() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.SessionLog.SessionStatus result = org.tensorflow.proto.util.SessionLog.SessionStatus.valueOf(status_); - return result == null ? org.tensorflow.proto.util.SessionLog.SessionStatus.UNRECOGNIZED : result; - } - - public static final int CHECKPOINT_PATH_FIELD_NUMBER = 2; - private volatile java.lang.Object checkpointPath_; - /** - *
    -   * This checkpoint_path contains both the path and filename.
    -   * 
    - * - * string checkpoint_path = 2; - */ - public java.lang.String getCheckpointPath() { - java.lang.Object ref = checkpointPath_; - 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(); - checkpointPath_ = s; - return s; - } - } - /** - *
    -   * This checkpoint_path contains both the path and filename.
    -   * 
    - * - * string checkpoint_path = 2; - */ - public com.google.protobuf.ByteString - getCheckpointPathBytes() { - java.lang.Object ref = checkpointPath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - checkpointPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MSG_FIELD_NUMBER = 3; - private volatile java.lang.Object msg_; - /** - * string msg = 3; - */ - public java.lang.String getMsg() { - java.lang.Object ref = msg_; - 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(); - msg_ = s; - return s; - } - } - /** - * string msg = 3; - */ - public com.google.protobuf.ByteString - getMsgBytes() { - java.lang.Object ref = msg_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - msg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (status_ != org.tensorflow.proto.util.SessionLog.SessionStatus.STATUS_UNSPECIFIED.getNumber()) { - output.writeEnum(1, status_); - } - if (!getCheckpointPathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, checkpointPath_); - } - if (!getMsgBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, msg_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (status_ != org.tensorflow.proto.util.SessionLog.SessionStatus.STATUS_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, status_); - } - if (!getCheckpointPathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, checkpointPath_); - } - if (!getMsgBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, msg_); - } - 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.util.SessionLog)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SessionLog other = (org.tensorflow.proto.util.SessionLog) obj; - - if (status_ != other.status_) return false; - if (!getCheckpointPath() - .equals(other.getCheckpointPath())) return false; - if (!getMsg() - .equals(other.getMsg())) 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) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + status_; - hash = (37 * hash) + CHECKPOINT_PATH_FIELD_NUMBER; - hash = (53 * hash) + getCheckpointPath().hashCode(); - hash = (37 * hash) + MSG_FIELD_NUMBER; - hash = (53 * hash) + getMsg().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SessionLog parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SessionLog 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.SessionLog parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SessionLog 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.SessionLog parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SessionLog parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SessionLog parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SessionLog 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.SessionLog parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SessionLog 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.SessionLog parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SessionLog 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.util.SessionLog 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; - } - /** - *
    -   * Protocol buffer used for logging session state.
    -   * 
    - * - * Protobuf type {@code tensorflow.SessionLog} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SessionLog) - org.tensorflow.proto.util.SessionLogOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_SessionLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_SessionLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SessionLog.class, org.tensorflow.proto.util.SessionLog.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SessionLog.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(); - status_ = 0; - - checkpointPath_ = ""; - - msg_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_SessionLog_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SessionLog getDefaultInstanceForType() { - return org.tensorflow.proto.util.SessionLog.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SessionLog build() { - org.tensorflow.proto.util.SessionLog result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SessionLog buildPartial() { - org.tensorflow.proto.util.SessionLog result = new org.tensorflow.proto.util.SessionLog(this); - result.status_ = status_; - result.checkpointPath_ = checkpointPath_; - result.msg_ = msg_; - 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.util.SessionLog) { - return mergeFrom((org.tensorflow.proto.util.SessionLog)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SessionLog other) { - if (other == org.tensorflow.proto.util.SessionLog.getDefaultInstance()) return this; - if (other.status_ != 0) { - setStatusValue(other.getStatusValue()); - } - if (!other.getCheckpointPath().isEmpty()) { - checkpointPath_ = other.checkpointPath_; - onChanged(); - } - if (!other.getMsg().isEmpty()) { - msg_ = other.msg_; - onChanged(); - } - 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.util.SessionLog parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SessionLog) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int status_ = 0; - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public int getStatusValue() { - return status_; - } - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public Builder setStatusValue(int value) { - status_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public org.tensorflow.proto.util.SessionLog.SessionStatus getStatus() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.SessionLog.SessionStatus result = org.tensorflow.proto.util.SessionLog.SessionStatus.valueOf(status_); - return result == null ? org.tensorflow.proto.util.SessionLog.SessionStatus.UNRECOGNIZED : result; - } - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public Builder setStatus(org.tensorflow.proto.util.SessionLog.SessionStatus value) { - if (value == null) { - throw new NullPointerException(); - } - - status_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - public Builder clearStatus() { - - status_ = 0; - onChanged(); - return this; - } - - private java.lang.Object checkpointPath_ = ""; - /** - *
    -     * This checkpoint_path contains both the path and filename.
    -     * 
    - * - * string checkpoint_path = 2; - */ - public java.lang.String getCheckpointPath() { - java.lang.Object ref = checkpointPath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - checkpointPath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * This checkpoint_path contains both the path and filename.
    -     * 
    - * - * string checkpoint_path = 2; - */ - public com.google.protobuf.ByteString - getCheckpointPathBytes() { - java.lang.Object ref = checkpointPath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - checkpointPath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * This checkpoint_path contains both the path and filename.
    -     * 
    - * - * string checkpoint_path = 2; - */ - public Builder setCheckpointPath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - checkpointPath_ = value; - onChanged(); - return this; - } - /** - *
    -     * This checkpoint_path contains both the path and filename.
    -     * 
    - * - * string checkpoint_path = 2; - */ - public Builder clearCheckpointPath() { - - checkpointPath_ = getDefaultInstance().getCheckpointPath(); - onChanged(); - return this; - } - /** - *
    -     * This checkpoint_path contains both the path and filename.
    -     * 
    - * - * string checkpoint_path = 2; - */ - public Builder setCheckpointPathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - checkpointPath_ = value; - onChanged(); - return this; - } - - private java.lang.Object msg_ = ""; - /** - * string msg = 3; - */ - public java.lang.String getMsg() { - java.lang.Object ref = msg_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - msg_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string msg = 3; - */ - public com.google.protobuf.ByteString - getMsgBytes() { - java.lang.Object ref = msg_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - msg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string msg = 3; - */ - public Builder setMsg( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - msg_ = value; - onChanged(); - return this; - } - /** - * string msg = 3; - */ - public Builder clearMsg() { - - msg_ = getDefaultInstance().getMsg(); - onChanged(); - return this; - } - /** - * string msg = 3; - */ - public Builder setMsgBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - msg_ = value; - 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.SessionLog) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SessionLog) - private static final org.tensorflow.proto.util.SessionLog DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SessionLog(); - } - - public static org.tensorflow.proto.util.SessionLog getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SessionLog parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SessionLog(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.util.SessionLog getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLogOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLogOrBuilder.java deleted file mode 100644 index 84ba691a95d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SessionLogOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface SessionLogOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SessionLog) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - int getStatusValue(); - /** - * .tensorflow.SessionLog.SessionStatus status = 1; - */ - org.tensorflow.proto.util.SessionLog.SessionStatus getStatus(); - - /** - *
    -   * This checkpoint_path contains both the path and filename.
    -   * 
    - * - * string checkpoint_path = 2; - */ - java.lang.String getCheckpointPath(); - /** - *
    -   * This checkpoint_path contains both the path and filename.
    -   * 
    - * - * string checkpoint_path = 2; - */ - com.google.protobuf.ByteString - getCheckpointPathBytes(); - - /** - * string msg = 3; - */ - java.lang.String getMsg(); - /** - * string msg = 3; - */ - com.google.protobuf.ByteString - getMsgBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShot.java deleted file mode 100644 index bde929e4c6d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShot.java +++ /dev/null @@ -1,535 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.SnapShot} - */ -public final class SnapShot extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SnapShot) - SnapShotOrBuilder { -private static final long serialVersionUID = 0L; - // Use SnapShot.newBuilder() to construct. - private SnapShot(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SnapShot() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SnapShot(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SnapShot( - 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: { - - actionCount_ = input.readUInt64(); - break; - } - case 16: { - - size_ = 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.util.BfcMemoryMapProtos.internal_static_tensorflow_SnapShot_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_SnapShot_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SnapShot.class, org.tensorflow.proto.util.SnapShot.Builder.class); - } - - public static final int ACTION_COUNT_FIELD_NUMBER = 1; - private long actionCount_; - /** - * uint64 action_count = 1; - */ - public long getActionCount() { - return actionCount_; - } - - public static final int SIZE_FIELD_NUMBER = 2; - private long size_; - /** - * int64 size = 2; - */ - public long getSize() { - return size_; - } - - 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 (actionCount_ != 0L) { - output.writeUInt64(1, actionCount_); - } - if (size_ != 0L) { - output.writeInt64(2, size_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (actionCount_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, actionCount_); - } - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, size_); - } - 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.util.SnapShot)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SnapShot other = (org.tensorflow.proto.util.SnapShot) obj; - - if (getActionCount() - != other.getActionCount()) return false; - if (getSize() - != other.getSize()) 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) + ACTION_COUNT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getActionCount()); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SnapShot parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SnapShot 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.SnapShot parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SnapShot 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.SnapShot parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SnapShot parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SnapShot parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SnapShot 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.SnapShot parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SnapShot 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.SnapShot parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SnapShot 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.util.SnapShot 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.SnapShot} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SnapShot) - org.tensorflow.proto.util.SnapShotOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_SnapShot_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_SnapShot_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SnapShot.class, org.tensorflow.proto.util.SnapShot.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SnapShot.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(); - actionCount_ = 0L; - - size_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_SnapShot_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SnapShot getDefaultInstanceForType() { - return org.tensorflow.proto.util.SnapShot.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SnapShot build() { - org.tensorflow.proto.util.SnapShot result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SnapShot buildPartial() { - org.tensorflow.proto.util.SnapShot result = new org.tensorflow.proto.util.SnapShot(this); - result.actionCount_ = actionCount_; - result.size_ = size_; - 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.util.SnapShot) { - return mergeFrom((org.tensorflow.proto.util.SnapShot)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SnapShot other) { - if (other == org.tensorflow.proto.util.SnapShot.getDefaultInstance()) return this; - if (other.getActionCount() != 0L) { - setActionCount(other.getActionCount()); - } - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - 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.util.SnapShot parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SnapShot) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long actionCount_ ; - /** - * uint64 action_count = 1; - */ - public long getActionCount() { - return actionCount_; - } - /** - * uint64 action_count = 1; - */ - public Builder setActionCount(long value) { - - actionCount_ = value; - onChanged(); - return this; - } - /** - * uint64 action_count = 1; - */ - public Builder clearActionCount() { - - actionCount_ = 0L; - onChanged(); - return this; - } - - private long size_ ; - /** - * int64 size = 2; - */ - public long getSize() { - return size_; - } - /** - * int64 size = 2; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - * int64 size = 2; - */ - public Builder clearSize() { - - size_ = 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.SnapShot) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SnapShot) - private static final org.tensorflow.proto.util.SnapShot DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SnapShot(); - } - - public static org.tensorflow.proto.util.SnapShot getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SnapShot parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SnapShot(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.util.SnapShot getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShotOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShotOrBuilder.java deleted file mode 100644 index 787a23ded48..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SnapShotOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/bfc_memory_map.proto - -package org.tensorflow.proto.util; - -public interface SnapShotOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.SnapShot) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 action_count = 1; - */ - long getActionCount(); - - /** - * int64 size = 2; - */ - long getSize(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFile.java deleted file mode 100644 index b8f6c068649..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFile.java +++ /dev/null @@ -1,964 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * Content of a source file involved in the execution of the debugged TensorFlow
    - * program.
    - * 
    - * - * Protobuf type {@code tensorflow.SourceFile} - */ -public final class SourceFile extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.SourceFile) - SourceFileOrBuilder { -private static final long serialVersionUID = 0L; - // Use SourceFile.newBuilder() to construct. - private SourceFile(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SourceFile() { - filePath_ = ""; - hostName_ = ""; - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SourceFile(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SourceFile( - 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(); - - filePath_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - hostName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - lines_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - lines_.add(s); - 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)) { - lines_ = lines_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_SourceFile_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SourceFile.class, org.tensorflow.proto.util.SourceFile.Builder.class); - } - - public static final int FILE_PATH_FIELD_NUMBER = 1; - private volatile java.lang.Object filePath_; - /** - *
    -   * Path to the file.
    -   * 
    - * - * string file_path = 1; - */ - public java.lang.String getFilePath() { - java.lang.Object ref = filePath_; - 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(); - filePath_ = s; - return s; - } - } - /** - *
    -   * Path to the file.
    -   * 
    - * - * string file_path = 1; - */ - public com.google.protobuf.ByteString - getFilePathBytes() { - java.lang.Object ref = filePath_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HOST_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object hostName_; - /** - *
    -   * Name of the host on which the file is located.
    -   * 
    - * - * string host_name = 2; - */ - public java.lang.String getHostName() { - java.lang.Object ref = hostName_; - 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(); - hostName_ = s; - return s; - } - } - /** - *
    -   * Name of the host on which the file is located.
    -   * 
    - * - * string host_name = 2; - */ - public com.google.protobuf.ByteString - getHostNameBytes() { - java.lang.Object ref = hostName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LINES_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList lines_; - /** - *
    -   * Line-by-line content of the file.
    -   * 
    - * - * repeated string lines = 3; - */ - public com.google.protobuf.ProtocolStringList - getLinesList() { - return lines_; - } - /** - *
    -   * Line-by-line content of the file.
    -   * 
    - * - * repeated string lines = 3; - */ - public int getLinesCount() { - return lines_.size(); - } - /** - *
    -   * Line-by-line content of the file.
    -   * 
    - * - * repeated string lines = 3; - */ - public java.lang.String getLines(int index) { - return lines_.get(index); - } - /** - *
    -   * Line-by-line content of the file.
    -   * 
    - * - * repeated string lines = 3; - */ - public com.google.protobuf.ByteString - getLinesBytes(int index) { - return lines_.getByteString(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 { - if (!getFilePathBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filePath_); - } - if (!getHostNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, hostName_); - } - for (int i = 0; i < lines_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lines_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getFilePathBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filePath_); - } - if (!getHostNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, hostName_); - } - { - int dataSize = 0; - for (int i = 0; i < lines_.size(); i++) { - dataSize += computeStringSizeNoTag(lines_.getRaw(i)); - } - size += dataSize; - size += 1 * getLinesList().size(); - } - 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.util.SourceFile)) { - return super.equals(obj); - } - org.tensorflow.proto.util.SourceFile other = (org.tensorflow.proto.util.SourceFile) obj; - - if (!getFilePath() - .equals(other.getFilePath())) return false; - if (!getHostName() - .equals(other.getHostName())) return false; - if (!getLinesList() - .equals(other.getLinesList())) 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) + FILE_PATH_FIELD_NUMBER; - hash = (53 * hash) + getFilePath().hashCode(); - hash = (37 * hash) + HOST_NAME_FIELD_NUMBER; - hash = (53 * hash) + getHostName().hashCode(); - if (getLinesCount() > 0) { - hash = (37 * hash) + LINES_FIELD_NUMBER; - hash = (53 * hash) + getLinesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.SourceFile parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SourceFile 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.SourceFile parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SourceFile 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.SourceFile parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.SourceFile parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.SourceFile parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SourceFile 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.SourceFile parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SourceFile 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.SourceFile parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.SourceFile 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.util.SourceFile 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; - } - /** - *
    -   * Content of a source file involved in the execution of the debugged TensorFlow
    -   * program.
    -   * 
    - * - * Protobuf type {@code tensorflow.SourceFile} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.SourceFile) - org.tensorflow.proto.util.SourceFileOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_SourceFile_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.SourceFile.class, org.tensorflow.proto.util.SourceFile.Builder.class); - } - - // Construct using org.tensorflow.proto.util.SourceFile.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(); - filePath_ = ""; - - hostName_ = ""; - - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.SourceFile getDefaultInstanceForType() { - return org.tensorflow.proto.util.SourceFile.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.SourceFile build() { - org.tensorflow.proto.util.SourceFile result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.SourceFile buildPartial() { - org.tensorflow.proto.util.SourceFile result = new org.tensorflow.proto.util.SourceFile(this); - int from_bitField0_ = bitField0_; - result.filePath_ = filePath_; - result.hostName_ = hostName_; - if (((bitField0_ & 0x00000001) != 0)) { - lines_ = lines_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.lines_ = lines_; - 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.util.SourceFile) { - return mergeFrom((org.tensorflow.proto.util.SourceFile)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.SourceFile other) { - if (other == org.tensorflow.proto.util.SourceFile.getDefaultInstance()) return this; - if (!other.getFilePath().isEmpty()) { - filePath_ = other.filePath_; - onChanged(); - } - if (!other.getHostName().isEmpty()) { - hostName_ = other.hostName_; - onChanged(); - } - if (!other.lines_.isEmpty()) { - if (lines_.isEmpty()) { - lines_ = other.lines_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureLinesIsMutable(); - lines_.addAll(other.lines_); - } - onChanged(); - } - 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.util.SourceFile parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.SourceFile) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object filePath_ = ""; - /** - *
    -     * Path to the file.
    -     * 
    - * - * string file_path = 1; - */ - public java.lang.String getFilePath() { - java.lang.Object ref = filePath_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filePath_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Path to the file.
    -     * 
    - * - * string file_path = 1; - */ - public com.google.protobuf.ByteString - getFilePathBytes() { - java.lang.Object ref = filePath_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - filePath_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Path to the file.
    -     * 
    - * - * string file_path = 1; - */ - public Builder setFilePath( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - filePath_ = value; - onChanged(); - return this; - } - /** - *
    -     * Path to the file.
    -     * 
    - * - * string file_path = 1; - */ - public Builder clearFilePath() { - - filePath_ = getDefaultInstance().getFilePath(); - onChanged(); - return this; - } - /** - *
    -     * Path to the file.
    -     * 
    - * - * string file_path = 1; - */ - public Builder setFilePathBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - filePath_ = value; - onChanged(); - return this; - } - - private java.lang.Object hostName_ = ""; - /** - *
    -     * Name of the host on which the file is located.
    -     * 
    - * - * string host_name = 2; - */ - public java.lang.String getHostName() { - java.lang.Object ref = hostName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Name of the host on which the file is located.
    -     * 
    - * - * string host_name = 2; - */ - public com.google.protobuf.ByteString - getHostNameBytes() { - java.lang.Object ref = hostName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Name of the host on which the file is located.
    -     * 
    - * - * string host_name = 2; - */ - public Builder setHostName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostName_ = value; - onChanged(); - return this; - } - /** - *
    -     * Name of the host on which the file is located.
    -     * 
    - * - * string host_name = 2; - */ - public Builder clearHostName() { - - hostName_ = getDefaultInstance().getHostName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the host on which the file is located.
    -     * 
    - * - * string host_name = 2; - */ - public Builder setHostNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureLinesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - lines_ = new com.google.protobuf.LazyStringArrayList(lines_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public com.google.protobuf.ProtocolStringList - getLinesList() { - return lines_.getUnmodifiableView(); - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public int getLinesCount() { - return lines_.size(); - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public java.lang.String getLines(int index) { - return lines_.get(index); - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public com.google.protobuf.ByteString - getLinesBytes(int index) { - return lines_.getByteString(index); - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public Builder setLines( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public Builder addLines( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinesIsMutable(); - lines_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public Builder addAllLines( - java.lang.Iterable values) { - ensureLinesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, lines_); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public Builder clearLines() { - lines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * Line-by-line content of the file.
    -     * 
    - * - * repeated string lines = 3; - */ - public Builder addLinesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureLinesIsMutable(); - lines_.add(value); - 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.SourceFile) - } - - // @@protoc_insertion_point(class_scope:tensorflow.SourceFile) - private static final org.tensorflow.proto.util.SourceFile DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.SourceFile(); - } - - public static org.tensorflow.proto.util.SourceFile getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SourceFile parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SourceFile(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.util.SourceFile getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithId.java deleted file mode 100644 index e41ffbd6cc3..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithId.java +++ /dev/null @@ -1,835 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/debug_event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * A stack frame with ID.
    - * 
    - * - * Protobuf type {@code tensorflow.StackFrameWithId} - */ -public final class StackFrameWithId extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.StackFrameWithId) - StackFrameWithIdOrBuilder { -private static final long serialVersionUID = 0L; - // Use StackFrameWithId.newBuilder() to construct. - private StackFrameWithId(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StackFrameWithId() { - id_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StackFrameWithId(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StackFrameWithId( - 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(); - - id_ = s; - break; - } - case 18: { - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder subBuilder = null; - if (fileLineCol_ != null) { - subBuilder = fileLineCol_.toBuilder(); - } - fileLineCol_ = input.readMessage(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fileLineCol_); - fileLineCol_ = subBuilder.buildPartial(); - } - - 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.util.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.StackFrameWithId.class, org.tensorflow.proto.util.StackFrameWithId.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - *
    -   * A unique ID for the stack frame: A UUID-like string.
    -   * 
    - * - * string id = 1; - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - 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(); - id_ = s; - return s; - } - } - /** - *
    -   * A unique ID for the stack frame: A UUID-like string.
    -   * 
    - * - * string id = 1; - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILE_LINE_COL_FIELD_NUMBER = 2; - private org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol fileLineCol_; - /** - *
    -   * Stack frame, i.e., a frame of a stack trace, containing information
    -   * regarding the file name, line number, function name, code content
    -   * of the line, and column number (if available).
    -   * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public boolean hasFileLineCol() { - return fileLineCol_ != null; - } - /** - *
    -   * Stack frame, i.e., a frame of a stack trace, containing information
    -   * regarding the file name, line number, function name, code content
    -   * of the line, and column number (if available).
    -   * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCol() { - return fileLineCol_ == null ? org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; - } - /** - *
    -   * Stack frame, i.e., a frame of a stack trace, containing information
    -   * regarding the file name, line number, function name, code content
    -   * of the line, and column number (if available).
    -   * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder() { - return getFileLineCol(); - } - - 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 (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); - } - if (fileLineCol_ != null) { - output.writeMessage(2, getFileLineCol()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); - } - if (fileLineCol_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getFileLineCol()); - } - 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.util.StackFrameWithId)) { - return super.equals(obj); - } - org.tensorflow.proto.util.StackFrameWithId other = (org.tensorflow.proto.util.StackFrameWithId) obj; - - if (!getId() - .equals(other.getId())) return false; - if (hasFileLineCol() != other.hasFileLineCol()) return false; - if (hasFileLineCol()) { - if (!getFileLineCol() - .equals(other.getFileLineCol())) 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) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - if (hasFileLineCol()) { - hash = (37 * hash) + FILE_LINE_COL_FIELD_NUMBER; - hash = (53 * hash) + getFileLineCol().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.StackFrameWithId parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.StackFrameWithId 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.StackFrameWithId parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.StackFrameWithId 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.StackFrameWithId parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.StackFrameWithId parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.StackFrameWithId parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.StackFrameWithId 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.StackFrameWithId parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.StackFrameWithId 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.StackFrameWithId parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.StackFrameWithId 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.util.StackFrameWithId 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 stack frame with ID.
    -   * 
    - * - * Protobuf type {@code tensorflow.StackFrameWithId} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.StackFrameWithId) - org.tensorflow.proto.util.StackFrameWithIdOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.StackFrameWithId.class, org.tensorflow.proto.util.StackFrameWithId.Builder.class); - } - - // Construct using org.tensorflow.proto.util.StackFrameWithId.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(); - id_ = ""; - - if (fileLineColBuilder_ == null) { - fileLineCol_ = null; - } else { - fileLineCol_ = null; - fileLineColBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.StackFrameWithId getDefaultInstanceForType() { - return org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.StackFrameWithId build() { - org.tensorflow.proto.util.StackFrameWithId result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.StackFrameWithId buildPartial() { - org.tensorflow.proto.util.StackFrameWithId result = new org.tensorflow.proto.util.StackFrameWithId(this); - result.id_ = id_; - if (fileLineColBuilder_ == null) { - result.fileLineCol_ = fileLineCol_; - } else { - result.fileLineCol_ = fileLineColBuilder_.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.util.StackFrameWithId) { - return mergeFrom((org.tensorflow.proto.util.StackFrameWithId)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.StackFrameWithId other) { - if (other == org.tensorflow.proto.util.StackFrameWithId.getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (other.hasFileLineCol()) { - mergeFileLineCol(other.getFileLineCol()); - } - 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.util.StackFrameWithId parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.StackFrameWithId) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object id_ = ""; - /** - *
    -     * A unique ID for the stack frame: A UUID-like string.
    -     * 
    - * - * string id = 1; - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * A unique ID for the stack frame: A UUID-like string.
    -     * 
    - * - * string id = 1; - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * A unique ID for the stack frame: A UUID-like string.
    -     * 
    - * - * string id = 1; - */ - public Builder setId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - id_ = value; - onChanged(); - return this; - } - /** - *
    -     * A unique ID for the stack frame: A UUID-like string.
    -     * 
    - * - * string id = 1; - */ - public Builder clearId() { - - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - *
    -     * A unique ID for the stack frame: A UUID-like string.
    -     * 
    - * - * string id = 1; - */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - id_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol fileLineCol_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder> fileLineColBuilder_; - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public boolean hasFileLineCol() { - return fileLineColBuilder_ != null || fileLineCol_ != null; - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCol() { - if (fileLineColBuilder_ == null) { - return fileLineCol_ == null ? org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; - } else { - return fileLineColBuilder_.getMessage(); - } - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public Builder setFileLineCol(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol value) { - if (fileLineColBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - fileLineCol_ = value; - onChanged(); - } else { - fileLineColBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public Builder setFileLineCol( - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder builderForValue) { - if (fileLineColBuilder_ == null) { - fileLineCol_ = builderForValue.build(); - onChanged(); - } else { - fileLineColBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public Builder mergeFileLineCol(org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol value) { - if (fileLineColBuilder_ == null) { - if (fileLineCol_ != null) { - fileLineCol_ = - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.newBuilder(fileLineCol_).mergeFrom(value).buildPartial(); - } else { - fileLineCol_ = value; - } - onChanged(); - } else { - fileLineColBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public Builder clearFileLineCol() { - if (fileLineColBuilder_ == null) { - fileLineCol_ = null; - onChanged(); - } else { - fileLineCol_ = null; - fileLineColBuilder_ = null; - } - - return this; - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder getFileLineColBuilder() { - - onChanged(); - return getFileLineColFieldBuilder().getBuilder(); - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - public org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder() { - if (fileLineColBuilder_ != null) { - return fileLineColBuilder_.getMessageOrBuilder(); - } else { - return fileLineCol_ == null ? - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; - } - } - /** - *
    -     * Stack frame, i.e., a frame of a stack trace, containing information
    -     * regarding the file name, line number, function name, code content
    -     * of the line, and column number (if available).
    -     * 
    - * - * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder> - getFileLineColFieldBuilder() { - if (fileLineColBuilder_ == null) { - fileLineColBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol, org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder>( - getFileLineCol(), - getParentForChildren(), - isClean()); - fileLineCol_ = null; - } - return fileLineColBuilder_; - } - @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.StackFrameWithId) - } - - // @@protoc_insertion_point(class_scope:tensorflow.StackFrameWithId) - private static final org.tensorflow.proto.util.StackFrameWithId DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.StackFrameWithId(); - } - - public static org.tensorflow.proto.util.StackFrameWithId getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StackFrameWithId parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StackFrameWithId(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.util.StackFrameWithId getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadata.java deleted file mode 100644 index 4880946d5df..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadata.java +++ /dev/null @@ -1,663 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - *
    - * For logging the metadata output for a single session.run() call.
    - * 
    - * - * Protobuf type {@code tensorflow.TaggedRunMetadata} - */ -public final class TaggedRunMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TaggedRunMetadata) - TaggedRunMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use TaggedRunMetadata.newBuilder() to construct. - private TaggedRunMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TaggedRunMetadata() { - tag_ = ""; - runMetadata_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TaggedRunMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TaggedRunMetadata( - 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(); - - tag_ = s; - break; - } - case 18: { - - runMetadata_ = input.readBytes(); - 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.util.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.TaggedRunMetadata.class, org.tensorflow.proto.util.TaggedRunMetadata.Builder.class); - } - - public static final int TAG_FIELD_NUMBER = 1; - private volatile java.lang.Object tag_; - /** - *
    -   * Tag name associated with this metadata.
    -   * 
    - * - * string tag = 1; - */ - public java.lang.String getTag() { - java.lang.Object ref = tag_; - 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(); - tag_ = s; - return s; - } - } - /** - *
    -   * Tag name associated with this metadata.
    -   * 
    - * - * string tag = 1; - */ - public com.google.protobuf.ByteString - getTagBytes() { - java.lang.Object ref = tag_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tag_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RUN_METADATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString runMetadata_; - /** - *
    -   * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    -   * deserialization.
    -   * 
    - * - * bytes run_metadata = 2; - */ - public com.google.protobuf.ByteString getRunMetadata() { - return runMetadata_; - } - - 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 (!getTagBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tag_); - } - if (!runMetadata_.isEmpty()) { - output.writeBytes(2, runMetadata_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTagBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tag_); - } - if (!runMetadata_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, runMetadata_); - } - 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.util.TaggedRunMetadata)) { - return super.equals(obj); - } - org.tensorflow.proto.util.TaggedRunMetadata other = (org.tensorflow.proto.util.TaggedRunMetadata) obj; - - if (!getTag() - .equals(other.getTag())) return false; - if (!getRunMetadata() - .equals(other.getRunMetadata())) 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) + TAG_FIELD_NUMBER; - hash = (53 * hash) + getTag().hashCode(); - hash = (37 * hash) + RUN_METADATA_FIELD_NUMBER; - hash = (53 * hash) + getRunMetadata().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.TaggedRunMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.TaggedRunMetadata 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.TaggedRunMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.TaggedRunMetadata 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.TaggedRunMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.TaggedRunMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.TaggedRunMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.TaggedRunMetadata 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.TaggedRunMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.TaggedRunMetadata 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.TaggedRunMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.TaggedRunMetadata 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.util.TaggedRunMetadata 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; - } - /** - *
    -   * For logging the metadata output for a single session.run() call.
    -   * 
    - * - * Protobuf type {@code tensorflow.TaggedRunMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TaggedRunMetadata) - org.tensorflow.proto.util.TaggedRunMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.TaggedRunMetadata.class, org.tensorflow.proto.util.TaggedRunMetadata.Builder.class); - } - - // Construct using org.tensorflow.proto.util.TaggedRunMetadata.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(); - tag_ = ""; - - runMetadata_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.TaggedRunMetadata getDefaultInstanceForType() { - return org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.TaggedRunMetadata build() { - org.tensorflow.proto.util.TaggedRunMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.TaggedRunMetadata buildPartial() { - org.tensorflow.proto.util.TaggedRunMetadata result = new org.tensorflow.proto.util.TaggedRunMetadata(this); - result.tag_ = tag_; - result.runMetadata_ = runMetadata_; - 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.util.TaggedRunMetadata) { - return mergeFrom((org.tensorflow.proto.util.TaggedRunMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.TaggedRunMetadata other) { - if (other == org.tensorflow.proto.util.TaggedRunMetadata.getDefaultInstance()) return this; - if (!other.getTag().isEmpty()) { - tag_ = other.tag_; - onChanged(); - } - if (other.getRunMetadata() != com.google.protobuf.ByteString.EMPTY) { - setRunMetadata(other.getRunMetadata()); - } - 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.util.TaggedRunMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.TaggedRunMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object tag_ = ""; - /** - *
    -     * Tag name associated with this metadata.
    -     * 
    - * - * string tag = 1; - */ - public java.lang.String getTag() { - java.lang.Object ref = tag_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tag_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Tag name associated with this metadata.
    -     * 
    - * - * string tag = 1; - */ - public com.google.protobuf.ByteString - getTagBytes() { - java.lang.Object ref = tag_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tag_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Tag name associated with this metadata.
    -     * 
    - * - * string tag = 1; - */ - public Builder setTag( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tag_ = value; - onChanged(); - return this; - } - /** - *
    -     * Tag name associated with this metadata.
    -     * 
    - * - * string tag = 1; - */ - public Builder clearTag() { - - tag_ = getDefaultInstance().getTag(); - onChanged(); - return this; - } - /** - *
    -     * Tag name associated with this metadata.
    -     * 
    - * - * string tag = 1; - */ - public Builder setTagBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tag_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString runMetadata_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    -     * deserialization.
    -     * 
    - * - * bytes run_metadata = 2; - */ - public com.google.protobuf.ByteString getRunMetadata() { - return runMetadata_; - } - /** - *
    -     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    -     * deserialization.
    -     * 
    - * - * bytes run_metadata = 2; - */ - public Builder setRunMetadata(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - runMetadata_ = value; - onChanged(); - return this; - } - /** - *
    -     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    -     * deserialization.
    -     * 
    - * - * bytes run_metadata = 2; - */ - public Builder clearRunMetadata() { - - runMetadata_ = getDefaultInstance().getRunMetadata(); - 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.TaggedRunMetadata) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TaggedRunMetadata) - private static final org.tensorflow.proto.util.TaggedRunMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.TaggedRunMetadata(); - } - - public static org.tensorflow.proto.util.TaggedRunMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TaggedRunMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TaggedRunMetadata(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.util.TaggedRunMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - 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 deleted file mode 100644 index a3ba9d49dce..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorBundleProtos.java +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/protobuf/tensor_bundle.proto - -package org.tensorflow.proto.util; - -public final class TensorBundleProtos { - private TensorBundleProtos() {} - 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_BundleHeaderProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BundleEntryProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BundleEntryProto_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/tensor_bundle" + - ".proto\022\ntensorflow\032,tensorflow/core/fram" + - "ework/tensor_shape.proto\032,tensorflow/cor" + - "e/framework/tensor_slice.proto\032%tensorfl" + - "ow/core/framework/types.proto\032(tensorflo" + - "w/core/framework/versions.proto\"\261\001\n\021Bund" + - "leHeaderProto\022\022\n\nnum_shards\030\001 \001(\005\022<\n\nend" + - "ianness\030\002 \001(\0162(.tensorflow.BundleHeaderP" + - "roto.Endianness\022\'\n\007version\030\003 \001(\0132\026.tenso" + - "rflow.VersionDef\"!\n\nEndianness\022\n\n\006LITTLE" + - "\020\000\022\007\n\003BIG\020\001\"\322\001\n\020BundleEntryProto\022#\n\005dtyp" + - "e\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005shape\030\002" + - " \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\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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorSliceProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(), - }); - internal_static_tensorflow_BundleHeaderProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BundleHeaderProto_descriptor, - new java.lang.String[] { "NumShards", "Endianness", "Version", }); - internal_static_tensorflow_BundleEntryProto_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_BundleEntryProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BundleEntryProto_descriptor, - new java.lang.String[] { "Dtype", "Shape", "ShardId", "Offset", "Size", "Crc32C", "Slices", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorSliceProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); - org.tensorflow.proto.framework.VersionsProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfig.java deleted file mode 100644 index f818bbca13f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfig.java +++ /dev/null @@ -1,477 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.WatchdogConfig} - */ -public final class WatchdogConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.WatchdogConfig) - WatchdogConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use WatchdogConfig.newBuilder() to construct. - private WatchdogConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WatchdogConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WatchdogConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WatchdogConfig( - 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: { - - timeoutMs_ = 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.util.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WatchdogConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WatchdogConfig.class, org.tensorflow.proto.util.WatchdogConfig.Builder.class); - } - - public static final int TIMEOUT_MS_FIELD_NUMBER = 1; - private long timeoutMs_; - /** - * int64 timeout_ms = 1; - */ - public long getTimeoutMs() { - return timeoutMs_; - } - - 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 (timeoutMs_ != 0L) { - output.writeInt64(1, timeoutMs_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (timeoutMs_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, timeoutMs_); - } - 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.util.WatchdogConfig)) { - return super.equals(obj); - } - org.tensorflow.proto.util.WatchdogConfig other = (org.tensorflow.proto.util.WatchdogConfig) obj; - - if (getTimeoutMs() - != other.getTimeoutMs()) 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) + TIMEOUT_MS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimeoutMs()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.WatchdogConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WatchdogConfig 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.WatchdogConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WatchdogConfig 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.WatchdogConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WatchdogConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.WatchdogConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WatchdogConfig 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.WatchdogConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WatchdogConfig 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.WatchdogConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WatchdogConfig 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.util.WatchdogConfig 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.WatchdogConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.WatchdogConfig) - org.tensorflow.proto.util.WatchdogConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WatchdogConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WatchdogConfig.class, org.tensorflow.proto.util.WatchdogConfig.Builder.class); - } - - // Construct using org.tensorflow.proto.util.WatchdogConfig.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(); - timeoutMs_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.WatchdogConfig getDefaultInstanceForType() { - return org.tensorflow.proto.util.WatchdogConfig.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.WatchdogConfig build() { - org.tensorflow.proto.util.WatchdogConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.WatchdogConfig buildPartial() { - org.tensorflow.proto.util.WatchdogConfig result = new org.tensorflow.proto.util.WatchdogConfig(this); - result.timeoutMs_ = timeoutMs_; - 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.util.WatchdogConfig) { - return mergeFrom((org.tensorflow.proto.util.WatchdogConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.WatchdogConfig other) { - if (other == org.tensorflow.proto.util.WatchdogConfig.getDefaultInstance()) return this; - if (other.getTimeoutMs() != 0L) { - setTimeoutMs(other.getTimeoutMs()); - } - 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.util.WatchdogConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.WatchdogConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long timeoutMs_ ; - /** - * int64 timeout_ms = 1; - */ - public long getTimeoutMs() { - return timeoutMs_; - } - /** - * int64 timeout_ms = 1; - */ - public Builder setTimeoutMs(long value) { - - timeoutMs_ = value; - onChanged(); - return this; - } - /** - * int64 timeout_ms = 1; - */ - public Builder clearTimeoutMs() { - - timeoutMs_ = 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.WatchdogConfig) - } - - // @@protoc_insertion_point(class_scope:tensorflow.WatchdogConfig) - private static final org.tensorflow.proto.util.WatchdogConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.WatchdogConfig(); - } - - public static org.tensorflow.proto.util.WatchdogConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WatchdogConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WatchdogConfig(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.util.WatchdogConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfigOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfigOrBuilder.java deleted file mode 100644 index 74e6511d5ad..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WatchdogConfigOrBuilder.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface WatchdogConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.WatchdogConfig) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 timeout_ms = 1; - */ - long getTimeoutMs(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequest.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequest.java deleted file mode 100644 index 9be331b3eca..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequest.java +++ /dev/null @@ -1,866 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.WorkerHeartbeatRequest} - */ -public final class WorkerHeartbeatRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.WorkerHeartbeatRequest) - WorkerHeartbeatRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use WorkerHeartbeatRequest.newBuilder() to construct. - private WorkerHeartbeatRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WorkerHeartbeatRequest() { - shutdownMode_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WorkerHeartbeatRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WorkerHeartbeatRequest( - 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: { - int rawValue = input.readEnum(); - - shutdownMode_ = rawValue; - break; - } - case 18: { - org.tensorflow.proto.util.WatchdogConfig.Builder subBuilder = null; - if (watchdogConfig_ != null) { - subBuilder = watchdogConfig_.toBuilder(); - } - watchdogConfig_ = input.readMessage(org.tensorflow.proto.util.WatchdogConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(watchdogConfig_); - watchdogConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.util.RequestedExitCode.Builder subBuilder = null; - if (exitCode_ != null) { - subBuilder = exitCode_.toBuilder(); - } - exitCode_ = input.readMessage(org.tensorflow.proto.util.RequestedExitCode.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(exitCode_); - exitCode_ = subBuilder.buildPartial(); - } - - 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.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WorkerHeartbeatRequest.class, org.tensorflow.proto.util.WorkerHeartbeatRequest.Builder.class); - } - - public static final int SHUTDOWN_MODE_FIELD_NUMBER = 1; - private int shutdownMode_; - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public int getShutdownModeValue() { - return shutdownMode_; - } - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public org.tensorflow.proto.util.WorkerShutdownMode getShutdownMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.WorkerShutdownMode result = org.tensorflow.proto.util.WorkerShutdownMode.valueOf(shutdownMode_); - return result == null ? org.tensorflow.proto.util.WorkerShutdownMode.UNRECOGNIZED : result; - } - - public static final int WATCHDOG_CONFIG_FIELD_NUMBER = 2; - private org.tensorflow.proto.util.WatchdogConfig watchdogConfig_; - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public boolean hasWatchdogConfig() { - return watchdogConfig_ != null; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public org.tensorflow.proto.util.WatchdogConfig getWatchdogConfig() { - return watchdogConfig_ == null ? org.tensorflow.proto.util.WatchdogConfig.getDefaultInstance() : watchdogConfig_; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public org.tensorflow.proto.util.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder() { - return getWatchdogConfig(); - } - - public static final int EXIT_CODE_FIELD_NUMBER = 3; - private org.tensorflow.proto.util.RequestedExitCode exitCode_; - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public boolean hasExitCode() { - return exitCode_ != null; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public org.tensorflow.proto.util.RequestedExitCode getExitCode() { - return exitCode_ == null ? org.tensorflow.proto.util.RequestedExitCode.getDefaultInstance() : exitCode_; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public org.tensorflow.proto.util.RequestedExitCodeOrBuilder getExitCodeOrBuilder() { - return getExitCode(); - } - - 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 (shutdownMode_ != org.tensorflow.proto.util.WorkerShutdownMode.DEFAULT.getNumber()) { - output.writeEnum(1, shutdownMode_); - } - if (watchdogConfig_ != null) { - output.writeMessage(2, getWatchdogConfig()); - } - if (exitCode_ != null) { - output.writeMessage(3, getExitCode()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (shutdownMode_ != org.tensorflow.proto.util.WorkerShutdownMode.DEFAULT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, shutdownMode_); - } - if (watchdogConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getWatchdogConfig()); - } - if (exitCode_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getExitCode()); - } - 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.util.WorkerHeartbeatRequest)) { - return super.equals(obj); - } - org.tensorflow.proto.util.WorkerHeartbeatRequest other = (org.tensorflow.proto.util.WorkerHeartbeatRequest) obj; - - if (shutdownMode_ != other.shutdownMode_) return false; - if (hasWatchdogConfig() != other.hasWatchdogConfig()) return false; - if (hasWatchdogConfig()) { - if (!getWatchdogConfig() - .equals(other.getWatchdogConfig())) return false; - } - if (hasExitCode() != other.hasExitCode()) return false; - if (hasExitCode()) { - if (!getExitCode() - .equals(other.getExitCode())) 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) + SHUTDOWN_MODE_FIELD_NUMBER; - hash = (53 * hash) + shutdownMode_; - if (hasWatchdogConfig()) { - hash = (37 * hash) + WATCHDOG_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getWatchdogConfig().hashCode(); - } - if (hasExitCode()) { - hash = (37 * hash) + EXIT_CODE_FIELD_NUMBER; - hash = (53 * hash) + getExitCode().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.WorkerHeartbeatRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatRequest 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.util.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.WorkerHeartbeatRequest) - org.tensorflow.proto.util.WorkerHeartbeatRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WorkerHeartbeatRequest.class, org.tensorflow.proto.util.WorkerHeartbeatRequest.Builder.class); - } - - // Construct using org.tensorflow.proto.util.WorkerHeartbeatRequest.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(); - shutdownMode_ = 0; - - if (watchdogConfigBuilder_ == null) { - watchdogConfig_ = null; - } else { - watchdogConfig_ = null; - watchdogConfigBuilder_ = null; - } - if (exitCodeBuilder_ == null) { - exitCode_ = null; - } else { - exitCode_ = null; - exitCodeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatRequest getDefaultInstanceForType() { - return org.tensorflow.proto.util.WorkerHeartbeatRequest.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatRequest build() { - org.tensorflow.proto.util.WorkerHeartbeatRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatRequest buildPartial() { - org.tensorflow.proto.util.WorkerHeartbeatRequest result = new org.tensorflow.proto.util.WorkerHeartbeatRequest(this); - result.shutdownMode_ = shutdownMode_; - if (watchdogConfigBuilder_ == null) { - result.watchdogConfig_ = watchdogConfig_; - } else { - result.watchdogConfig_ = watchdogConfigBuilder_.build(); - } - if (exitCodeBuilder_ == null) { - result.exitCode_ = exitCode_; - } else { - result.exitCode_ = exitCodeBuilder_.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.util.WorkerHeartbeatRequest) { - return mergeFrom((org.tensorflow.proto.util.WorkerHeartbeatRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.WorkerHeartbeatRequest other) { - if (other == org.tensorflow.proto.util.WorkerHeartbeatRequest.getDefaultInstance()) return this; - if (other.shutdownMode_ != 0) { - setShutdownModeValue(other.getShutdownModeValue()); - } - if (other.hasWatchdogConfig()) { - mergeWatchdogConfig(other.getWatchdogConfig()); - } - if (other.hasExitCode()) { - mergeExitCode(other.getExitCode()); - } - 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.util.WorkerHeartbeatRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.WorkerHeartbeatRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int shutdownMode_ = 0; - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public int getShutdownModeValue() { - return shutdownMode_; - } - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public Builder setShutdownModeValue(int value) { - shutdownMode_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public org.tensorflow.proto.util.WorkerShutdownMode getShutdownMode() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.WorkerShutdownMode result = org.tensorflow.proto.util.WorkerShutdownMode.valueOf(shutdownMode_); - return result == null ? org.tensorflow.proto.util.WorkerShutdownMode.UNRECOGNIZED : result; - } - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public Builder setShutdownMode(org.tensorflow.proto.util.WorkerShutdownMode value) { - if (value == null) { - throw new NullPointerException(); - } - - shutdownMode_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - public Builder clearShutdownMode() { - - shutdownMode_ = 0; - onChanged(); - return this; - } - - private org.tensorflow.proto.util.WatchdogConfig watchdogConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.WatchdogConfig, org.tensorflow.proto.util.WatchdogConfig.Builder, org.tensorflow.proto.util.WatchdogConfigOrBuilder> watchdogConfigBuilder_; - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public boolean hasWatchdogConfig() { - return watchdogConfigBuilder_ != null || watchdogConfig_ != null; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public org.tensorflow.proto.util.WatchdogConfig getWatchdogConfig() { - if (watchdogConfigBuilder_ == null) { - return watchdogConfig_ == null ? org.tensorflow.proto.util.WatchdogConfig.getDefaultInstance() : watchdogConfig_; - } else { - return watchdogConfigBuilder_.getMessage(); - } - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public Builder setWatchdogConfig(org.tensorflow.proto.util.WatchdogConfig value) { - if (watchdogConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - watchdogConfig_ = value; - onChanged(); - } else { - watchdogConfigBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public Builder setWatchdogConfig( - org.tensorflow.proto.util.WatchdogConfig.Builder builderForValue) { - if (watchdogConfigBuilder_ == null) { - watchdogConfig_ = builderForValue.build(); - onChanged(); - } else { - watchdogConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public Builder mergeWatchdogConfig(org.tensorflow.proto.util.WatchdogConfig value) { - if (watchdogConfigBuilder_ == null) { - if (watchdogConfig_ != null) { - watchdogConfig_ = - org.tensorflow.proto.util.WatchdogConfig.newBuilder(watchdogConfig_).mergeFrom(value).buildPartial(); - } else { - watchdogConfig_ = value; - } - onChanged(); - } else { - watchdogConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public Builder clearWatchdogConfig() { - if (watchdogConfigBuilder_ == null) { - watchdogConfig_ = null; - onChanged(); - } else { - watchdogConfig_ = null; - watchdogConfigBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public org.tensorflow.proto.util.WatchdogConfig.Builder getWatchdogConfigBuilder() { - - onChanged(); - return getWatchdogConfigFieldBuilder().getBuilder(); - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - public org.tensorflow.proto.util.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder() { - if (watchdogConfigBuilder_ != null) { - return watchdogConfigBuilder_.getMessageOrBuilder(); - } else { - return watchdogConfig_ == null ? - org.tensorflow.proto.util.WatchdogConfig.getDefaultInstance() : watchdogConfig_; - } - } - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.WatchdogConfig, org.tensorflow.proto.util.WatchdogConfig.Builder, org.tensorflow.proto.util.WatchdogConfigOrBuilder> - getWatchdogConfigFieldBuilder() { - if (watchdogConfigBuilder_ == null) { - watchdogConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.WatchdogConfig, org.tensorflow.proto.util.WatchdogConfig.Builder, org.tensorflow.proto.util.WatchdogConfigOrBuilder>( - getWatchdogConfig(), - getParentForChildren(), - isClean()); - watchdogConfig_ = null; - } - return watchdogConfigBuilder_; - } - - private org.tensorflow.proto.util.RequestedExitCode exitCode_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.RequestedExitCode, org.tensorflow.proto.util.RequestedExitCode.Builder, org.tensorflow.proto.util.RequestedExitCodeOrBuilder> exitCodeBuilder_; - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public boolean hasExitCode() { - return exitCodeBuilder_ != null || exitCode_ != null; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public org.tensorflow.proto.util.RequestedExitCode getExitCode() { - if (exitCodeBuilder_ == null) { - return exitCode_ == null ? org.tensorflow.proto.util.RequestedExitCode.getDefaultInstance() : exitCode_; - } else { - return exitCodeBuilder_.getMessage(); - } - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public Builder setExitCode(org.tensorflow.proto.util.RequestedExitCode value) { - if (exitCodeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - exitCode_ = value; - onChanged(); - } else { - exitCodeBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public Builder setExitCode( - org.tensorflow.proto.util.RequestedExitCode.Builder builderForValue) { - if (exitCodeBuilder_ == null) { - exitCode_ = builderForValue.build(); - onChanged(); - } else { - exitCodeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public Builder mergeExitCode(org.tensorflow.proto.util.RequestedExitCode value) { - if (exitCodeBuilder_ == null) { - if (exitCode_ != null) { - exitCode_ = - org.tensorflow.proto.util.RequestedExitCode.newBuilder(exitCode_).mergeFrom(value).buildPartial(); - } else { - exitCode_ = value; - } - onChanged(); - } else { - exitCodeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public Builder clearExitCode() { - if (exitCodeBuilder_ == null) { - exitCode_ = null; - onChanged(); - } else { - exitCode_ = null; - exitCodeBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public org.tensorflow.proto.util.RequestedExitCode.Builder getExitCodeBuilder() { - - onChanged(); - return getExitCodeFieldBuilder().getBuilder(); - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - public org.tensorflow.proto.util.RequestedExitCodeOrBuilder getExitCodeOrBuilder() { - if (exitCodeBuilder_ != null) { - return exitCodeBuilder_.getMessageOrBuilder(); - } else { - return exitCode_ == null ? - org.tensorflow.proto.util.RequestedExitCode.getDefaultInstance() : exitCode_; - } - } - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.RequestedExitCode, org.tensorflow.proto.util.RequestedExitCode.Builder, org.tensorflow.proto.util.RequestedExitCodeOrBuilder> - getExitCodeFieldBuilder() { - if (exitCodeBuilder_ == null) { - exitCodeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.RequestedExitCode, org.tensorflow.proto.util.RequestedExitCode.Builder, org.tensorflow.proto.util.RequestedExitCodeOrBuilder>( - getExitCode(), - getParentForChildren(), - isClean()); - exitCode_ = null; - } - return exitCodeBuilder_; - } - @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.WorkerHeartbeatRequest) - } - - // @@protoc_insertion_point(class_scope:tensorflow.WorkerHeartbeatRequest) - private static final org.tensorflow.proto.util.WorkerHeartbeatRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.WorkerHeartbeatRequest(); - } - - public static org.tensorflow.proto.util.WorkerHeartbeatRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WorkerHeartbeatRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WorkerHeartbeatRequest(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.util.WorkerHeartbeatRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequestOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequestOrBuilder.java deleted file mode 100644 index 28e78122ba0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatRequestOrBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface WorkerHeartbeatRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.WorkerHeartbeatRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - int getShutdownModeValue(); - /** - * .tensorflow.WorkerShutdownMode shutdown_mode = 1; - */ - org.tensorflow.proto.util.WorkerShutdownMode getShutdownMode(); - - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - boolean hasWatchdogConfig(); - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - org.tensorflow.proto.util.WatchdogConfig getWatchdogConfig(); - /** - * .tensorflow.WatchdogConfig watchdog_config = 2; - */ - org.tensorflow.proto.util.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder(); - - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - boolean hasExitCode(); - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - org.tensorflow.proto.util.RequestedExitCode getExitCode(); - /** - * .tensorflow.RequestedExitCode exit_code = 3; - */ - org.tensorflow.proto.util.RequestedExitCodeOrBuilder getExitCodeOrBuilder(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponse.java deleted file mode 100644 index 87262dd0405..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponse.java +++ /dev/null @@ -1,977 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -/** - * Protobuf type {@code tensorflow.WorkerHeartbeatResponse} - */ -public final class WorkerHeartbeatResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.WorkerHeartbeatResponse) - WorkerHeartbeatResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use WorkerHeartbeatResponse.newBuilder() to construct. - private WorkerHeartbeatResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WorkerHeartbeatResponse() { - healthStatus_ = 0; - workerLog_ = java.util.Collections.emptyList(); - hostname_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WorkerHeartbeatResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WorkerHeartbeatResponse( - 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: { - int rawValue = input.readEnum(); - - healthStatus_ = rawValue; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - workerLog_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - workerLog_.add( - input.readMessage(org.tensorflow.proto.util.Event.parser(), extensionRegistry)); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - hostname_ = s; - 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)) { - workerLog_ = java.util.Collections.unmodifiableList(workerLog_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WorkerHeartbeatResponse.class, org.tensorflow.proto.util.WorkerHeartbeatResponse.Builder.class); - } - - public static final int HEALTH_STATUS_FIELD_NUMBER = 1; - private int healthStatus_; - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public int getHealthStatusValue() { - return healthStatus_; - } - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public org.tensorflow.proto.util.WorkerHealth getHealthStatus() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.WorkerHealth result = org.tensorflow.proto.util.WorkerHealth.valueOf(healthStatus_); - return result == null ? org.tensorflow.proto.util.WorkerHealth.UNRECOGNIZED : result; - } - - public static final int WORKER_LOG_FIELD_NUMBER = 2; - private java.util.List workerLog_; - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public java.util.List getWorkerLogList() { - return workerLog_; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public java.util.List - getWorkerLogOrBuilderList() { - return workerLog_; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public int getWorkerLogCount() { - return workerLog_.size(); - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.Event getWorkerLog(int index) { - return workerLog_.get(index); - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.EventOrBuilder getWorkerLogOrBuilder( - int index) { - return workerLog_.get(index); - } - - public static final int HOSTNAME_FIELD_NUMBER = 3; - private volatile java.lang.Object hostname_; - /** - * string hostname = 3; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - 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(); - hostname_ = s; - return s; - } - } - /** - * string hostname = 3; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (healthStatus_ != org.tensorflow.proto.util.WorkerHealth.OK.getNumber()) { - output.writeEnum(1, healthStatus_); - } - for (int i = 0; i < workerLog_.size(); i++) { - output.writeMessage(2, workerLog_.get(i)); - } - if (!getHostnameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, hostname_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (healthStatus_ != org.tensorflow.proto.util.WorkerHealth.OK.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, healthStatus_); - } - for (int i = 0; i < workerLog_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, workerLog_.get(i)); - } - if (!getHostnameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, hostname_); - } - 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.util.WorkerHeartbeatResponse)) { - return super.equals(obj); - } - org.tensorflow.proto.util.WorkerHeartbeatResponse other = (org.tensorflow.proto.util.WorkerHeartbeatResponse) obj; - - if (healthStatus_ != other.healthStatus_) return false; - if (!getWorkerLogList() - .equals(other.getWorkerLogList())) return false; - if (!getHostname() - .equals(other.getHostname())) 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) + HEALTH_STATUS_FIELD_NUMBER; - hash = (53 * hash) + healthStatus_; - if (getWorkerLogCount() > 0) { - hash = (37 * hash) + WORKER_LOG_FIELD_NUMBER; - hash = (53 * hash) + getWorkerLogList().hashCode(); - } - hash = (37 * hash) + HOSTNAME_FIELD_NUMBER; - hash = (53 * hash) + getHostname().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.WorkerHeartbeatResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.WorkerHeartbeatResponse 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.util.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.WorkerHeartbeatResponse) - org.tensorflow.proto.util.WorkerHeartbeatResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.WorkerHeartbeatResponse.class, org.tensorflow.proto.util.WorkerHeartbeatResponse.Builder.class); - } - - // Construct using org.tensorflow.proto.util.WorkerHeartbeatResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getWorkerLogFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - healthStatus_ = 0; - - if (workerLogBuilder_ == null) { - workerLog_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - workerLogBuilder_.clear(); - } - hostname_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatResponse getDefaultInstanceForType() { - return org.tensorflow.proto.util.WorkerHeartbeatResponse.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatResponse build() { - org.tensorflow.proto.util.WorkerHeartbeatResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.WorkerHeartbeatResponse buildPartial() { - org.tensorflow.proto.util.WorkerHeartbeatResponse result = new org.tensorflow.proto.util.WorkerHeartbeatResponse(this); - int from_bitField0_ = bitField0_; - result.healthStatus_ = healthStatus_; - if (workerLogBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - workerLog_ = java.util.Collections.unmodifiableList(workerLog_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.workerLog_ = workerLog_; - } else { - result.workerLog_ = workerLogBuilder_.build(); - } - result.hostname_ = hostname_; - 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.util.WorkerHeartbeatResponse) { - return mergeFrom((org.tensorflow.proto.util.WorkerHeartbeatResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.WorkerHeartbeatResponse other) { - if (other == org.tensorflow.proto.util.WorkerHeartbeatResponse.getDefaultInstance()) return this; - if (other.healthStatus_ != 0) { - setHealthStatusValue(other.getHealthStatusValue()); - } - if (workerLogBuilder_ == null) { - if (!other.workerLog_.isEmpty()) { - if (workerLog_.isEmpty()) { - workerLog_ = other.workerLog_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWorkerLogIsMutable(); - workerLog_.addAll(other.workerLog_); - } - onChanged(); - } - } else { - if (!other.workerLog_.isEmpty()) { - if (workerLogBuilder_.isEmpty()) { - workerLogBuilder_.dispose(); - workerLogBuilder_ = null; - workerLog_ = other.workerLog_; - bitField0_ = (bitField0_ & ~0x00000001); - workerLogBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getWorkerLogFieldBuilder() : null; - } else { - workerLogBuilder_.addAllMessages(other.workerLog_); - } - } - } - if (!other.getHostname().isEmpty()) { - hostname_ = other.hostname_; - onChanged(); - } - 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.util.WorkerHeartbeatResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.WorkerHeartbeatResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int healthStatus_ = 0; - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public int getHealthStatusValue() { - return healthStatus_; - } - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public Builder setHealthStatusValue(int value) { - healthStatus_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public org.tensorflow.proto.util.WorkerHealth getHealthStatus() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.WorkerHealth result = org.tensorflow.proto.util.WorkerHealth.valueOf(healthStatus_); - return result == null ? org.tensorflow.proto.util.WorkerHealth.UNRECOGNIZED : result; - } - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public Builder setHealthStatus(org.tensorflow.proto.util.WorkerHealth value) { - if (value == null) { - throw new NullPointerException(); - } - - healthStatus_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - public Builder clearHealthStatus() { - - healthStatus_ = 0; - onChanged(); - return this; - } - - private java.util.List workerLog_ = - java.util.Collections.emptyList(); - private void ensureWorkerLogIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - workerLog_ = new java.util.ArrayList(workerLog_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.Event, org.tensorflow.proto.util.Event.Builder, org.tensorflow.proto.util.EventOrBuilder> workerLogBuilder_; - - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public java.util.List getWorkerLogList() { - if (workerLogBuilder_ == null) { - return java.util.Collections.unmodifiableList(workerLog_); - } else { - return workerLogBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public int getWorkerLogCount() { - if (workerLogBuilder_ == null) { - return workerLog_.size(); - } else { - return workerLogBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.Event getWorkerLog(int index) { - if (workerLogBuilder_ == null) { - return workerLog_.get(index); - } else { - return workerLogBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder setWorkerLog( - int index, org.tensorflow.proto.util.Event value) { - if (workerLogBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWorkerLogIsMutable(); - workerLog_.set(index, value); - onChanged(); - } else { - workerLogBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder setWorkerLog( - int index, org.tensorflow.proto.util.Event.Builder builderForValue) { - if (workerLogBuilder_ == null) { - ensureWorkerLogIsMutable(); - workerLog_.set(index, builderForValue.build()); - onChanged(); - } else { - workerLogBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder addWorkerLog(org.tensorflow.proto.util.Event value) { - if (workerLogBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWorkerLogIsMutable(); - workerLog_.add(value); - onChanged(); - } else { - workerLogBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder addWorkerLog( - int index, org.tensorflow.proto.util.Event value) { - if (workerLogBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWorkerLogIsMutable(); - workerLog_.add(index, value); - onChanged(); - } else { - workerLogBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder addWorkerLog( - org.tensorflow.proto.util.Event.Builder builderForValue) { - if (workerLogBuilder_ == null) { - ensureWorkerLogIsMutable(); - workerLog_.add(builderForValue.build()); - onChanged(); - } else { - workerLogBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder addWorkerLog( - int index, org.tensorflow.proto.util.Event.Builder builderForValue) { - if (workerLogBuilder_ == null) { - ensureWorkerLogIsMutable(); - workerLog_.add(index, builderForValue.build()); - onChanged(); - } else { - workerLogBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder addAllWorkerLog( - java.lang.Iterable values) { - if (workerLogBuilder_ == null) { - ensureWorkerLogIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, workerLog_); - onChanged(); - } else { - workerLogBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder clearWorkerLog() { - if (workerLogBuilder_ == null) { - workerLog_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - workerLogBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public Builder removeWorkerLog(int index) { - if (workerLogBuilder_ == null) { - ensureWorkerLogIsMutable(); - workerLog_.remove(index); - onChanged(); - } else { - workerLogBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.Event.Builder getWorkerLogBuilder( - int index) { - return getWorkerLogFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.EventOrBuilder getWorkerLogOrBuilder( - int index) { - if (workerLogBuilder_ == null) { - return workerLog_.get(index); } else { - return workerLogBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public java.util.List - getWorkerLogOrBuilderList() { - if (workerLogBuilder_ != null) { - return workerLogBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(workerLog_); - } - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.Event.Builder addWorkerLogBuilder() { - return getWorkerLogFieldBuilder().addBuilder( - org.tensorflow.proto.util.Event.getDefaultInstance()); - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public org.tensorflow.proto.util.Event.Builder addWorkerLogBuilder( - int index) { - return getWorkerLogFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.Event.getDefaultInstance()); - } - /** - * repeated .tensorflow.Event worker_log = 2; - */ - public java.util.List - getWorkerLogBuilderList() { - return getWorkerLogFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.Event, org.tensorflow.proto.util.Event.Builder, org.tensorflow.proto.util.EventOrBuilder> - getWorkerLogFieldBuilder() { - if (workerLogBuilder_ == null) { - workerLogBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.Event, org.tensorflow.proto.util.Event.Builder, org.tensorflow.proto.util.EventOrBuilder>( - workerLog_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - workerLog_ = null; - } - return workerLogBuilder_; - } - - private java.lang.Object hostname_ = ""; - /** - * string hostname = 3; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostname_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string hostname = 3; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string hostname = 3; - */ - public Builder setHostname( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostname_ = value; - onChanged(); - return this; - } - /** - * string hostname = 3; - */ - public Builder clearHostname() { - - hostname_ = getDefaultInstance().getHostname(); - onChanged(); - return this; - } - /** - * string hostname = 3; - */ - public Builder setHostnameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostname_ = value; - 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.WorkerHeartbeatResponse) - } - - // @@protoc_insertion_point(class_scope:tensorflow.WorkerHeartbeatResponse) - private static final org.tensorflow.proto.util.WorkerHeartbeatResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.WorkerHeartbeatResponse(); - } - - public static org.tensorflow.proto.util.WorkerHeartbeatResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WorkerHeartbeatResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WorkerHeartbeatResponse(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.util.WorkerHeartbeatResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponseOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponseOrBuilder.java deleted file mode 100644 index 5f42f819a51..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHeartbeatResponseOrBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/event.proto - -package org.tensorflow.proto.util; - -public interface WorkerHeartbeatResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.WorkerHeartbeatResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - int getHealthStatusValue(); - /** - * .tensorflow.WorkerHealth health_status = 1; - */ - org.tensorflow.proto.util.WorkerHealth getHealthStatus(); - - /** - * repeated .tensorflow.Event worker_log = 2; - */ - java.util.List - getWorkerLogList(); - /** - * repeated .tensorflow.Event worker_log = 2; - */ - org.tensorflow.proto.util.Event getWorkerLog(int index); - /** - * repeated .tensorflow.Event worker_log = 2; - */ - int getWorkerLogCount(); - /** - * repeated .tensorflow.Event worker_log = 2; - */ - java.util.List - getWorkerLogOrBuilderList(); - /** - * repeated .tensorflow.Event worker_log = 2; - */ - org.tensorflow.proto.util.EventOrBuilder getWorkerLogOrBuilder( - int index); - - /** - * string hostname = 3; - */ - java.lang.String getHostname(); - /** - * string hostname = 3; - */ - com.google.protobuf.ByteString - getHostnameBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfo.java deleted file mode 100644 index c80f9c4ff64..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfo.java +++ /dev/null @@ -1,966 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - *
    - * Matches DeviceAttributes
    - * 
    - * - * Protobuf type {@code tensorflow.AvailableDeviceInfo} - */ -public final class AvailableDeviceInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AvailableDeviceInfo) - AvailableDeviceInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use AvailableDeviceInfo.newBuilder() to construct. - private AvailableDeviceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AvailableDeviceInfo() { - name_ = ""; - type_ = ""; - physicalDescription_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AvailableDeviceInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AvailableDeviceInfo( - 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 18: { - java.lang.String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 24: { - - memoryLimit_ = input.readInt64(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - physicalDescription_ = s; - 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.util.testlog.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.AvailableDeviceInfo.class, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Device name.
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Device name.
    -   * 
    - * - * 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 TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object type_; - /** - *
    -   * Device type, e.g. 'CPU' or 'GPU'.
    -   * 
    - * - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - 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(); - type_ = s; - return s; - } - } - /** - *
    -   * Device type, e.g. 'CPU' or 'GPU'.
    -   * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MEMORY_LIMIT_FIELD_NUMBER = 3; - private long memoryLimit_; - /** - *
    -   * Memory capacity in bytes.
    -   * 
    - * - * int64 memory_limit = 3; - */ - public long getMemoryLimit() { - return memoryLimit_; - } - - public static final int PHYSICAL_DESCRIPTION_FIELD_NUMBER = 4; - private volatile java.lang.Object physicalDescription_; - /** - *
    -   * The physical description of this device.
    -   * 
    - * - * string physical_description = 4; - */ - public java.lang.String getPhysicalDescription() { - java.lang.Object ref = physicalDescription_; - 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(); - physicalDescription_ = s; - return s; - } - } - /** - *
    -   * The physical description of this device.
    -   * 
    - * - * string physical_description = 4; - */ - public com.google.protobuf.ByteString - getPhysicalDescriptionBytes() { - java.lang.Object ref = physicalDescription_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - physicalDescription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (memoryLimit_ != 0L) { - output.writeInt64(3, memoryLimit_); - } - if (!getPhysicalDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, physicalDescription_); - } - 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 (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (memoryLimit_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, memoryLimit_); - } - if (!getPhysicalDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, physicalDescription_); - } - 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.util.testlog.AvailableDeviceInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.AvailableDeviceInfo other = (org.tensorflow.proto.util.testlog.AvailableDeviceInfo) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getType() - .equals(other.getType())) return false; - if (getMemoryLimit() - != other.getMemoryLimit()) return false; - if (!getPhysicalDescription() - .equals(other.getPhysicalDescription())) 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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (37 * hash) + MEMORY_LIMIT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMemoryLimit()); - hash = (37 * hash) + PHYSICAL_DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getPhysicalDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo 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.testlog.AvailableDeviceInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo 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.testlog.AvailableDeviceInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo 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.testlog.AvailableDeviceInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo 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.testlog.AvailableDeviceInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo 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.util.testlog.AvailableDeviceInfo 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; - } - /** - *
    -   * Matches DeviceAttributes
    -   * 
    - * - * Protobuf type {@code tensorflow.AvailableDeviceInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AvailableDeviceInfo) - org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.AvailableDeviceInfo.class, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.AvailableDeviceInfo.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_ = ""; - - type_ = ""; - - memoryLimit_ = 0L; - - physicalDescription_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.AvailableDeviceInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo build() { - org.tensorflow.proto.util.testlog.AvailableDeviceInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo buildPartial() { - org.tensorflow.proto.util.testlog.AvailableDeviceInfo result = new org.tensorflow.proto.util.testlog.AvailableDeviceInfo(this); - result.name_ = name_; - result.type_ = type_; - result.memoryLimit_ = memoryLimit_; - result.physicalDescription_ = physicalDescription_; - 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.util.testlog.AvailableDeviceInfo) { - return mergeFrom((org.tensorflow.proto.util.testlog.AvailableDeviceInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.AvailableDeviceInfo other) { - if (other == org.tensorflow.proto.util.testlog.AvailableDeviceInfo.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.getMemoryLimit() != 0L) { - setMemoryLimit(other.getMemoryLimit()); - } - if (!other.getPhysicalDescription().isEmpty()) { - physicalDescription_ = other.physicalDescription_; - onChanged(); - } - 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.util.testlog.AvailableDeviceInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.AvailableDeviceInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Device name.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Device name.
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Device name.
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device name.
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Device name.
    -     * 
    - * - * 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 java.lang.Object type_ = ""; - /** - *
    -     * Device type, e.g. 'CPU' or 'GPU'.
    -     * 
    - * - * string type = 2; - */ - public java.lang.String getType() { - java.lang.Object ref = type_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Device type, e.g. 'CPU' or 'GPU'.
    -     * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - java.lang.Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Device type, e.g. 'CPU' or 'GPU'.
    -     * 
    - * - * string type = 2; - */ - public Builder setType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - /** - *
    -     * Device type, e.g. 'CPU' or 'GPU'.
    -     * 
    - * - * string type = 2; - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - /** - *
    -     * Device type, e.g. 'CPU' or 'GPU'.
    -     * 
    - * - * string type = 2; - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private long memoryLimit_ ; - /** - *
    -     * Memory capacity in bytes.
    -     * 
    - * - * int64 memory_limit = 3; - */ - public long getMemoryLimit() { - return memoryLimit_; - } - /** - *
    -     * Memory capacity in bytes.
    -     * 
    - * - * int64 memory_limit = 3; - */ - public Builder setMemoryLimit(long value) { - - memoryLimit_ = value; - onChanged(); - return this; - } - /** - *
    -     * Memory capacity in bytes.
    -     * 
    - * - * int64 memory_limit = 3; - */ - public Builder clearMemoryLimit() { - - memoryLimit_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object physicalDescription_ = ""; - /** - *
    -     * The physical description of this device.
    -     * 
    - * - * string physical_description = 4; - */ - public java.lang.String getPhysicalDescription() { - java.lang.Object ref = physicalDescription_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - physicalDescription_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The physical description of this device.
    -     * 
    - * - * string physical_description = 4; - */ - public com.google.protobuf.ByteString - getPhysicalDescriptionBytes() { - java.lang.Object ref = physicalDescription_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - physicalDescription_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The physical description of this device.
    -     * 
    - * - * string physical_description = 4; - */ - public Builder setPhysicalDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - physicalDescription_ = value; - onChanged(); - return this; - } - /** - *
    -     * The physical description of this device.
    -     * 
    - * - * string physical_description = 4; - */ - public Builder clearPhysicalDescription() { - - physicalDescription_ = getDefaultInstance().getPhysicalDescription(); - onChanged(); - return this; - } - /** - *
    -     * The physical description of this device.
    -     * 
    - * - * string physical_description = 4; - */ - public Builder setPhysicalDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - physicalDescription_ = value; - 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.AvailableDeviceInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AvailableDeviceInfo) - private static final org.tensorflow.proto.util.testlog.AvailableDeviceInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.AvailableDeviceInfo(); - } - - public static org.tensorflow.proto.util.testlog.AvailableDeviceInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AvailableDeviceInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AvailableDeviceInfo(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.util.testlog.AvailableDeviceInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntries.java deleted file mode 100644 index 27fe4cdcc81..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntries.java +++ /dev/null @@ -1,765 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.BenchmarkEntries} - */ -public final class BenchmarkEntries extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BenchmarkEntries) - BenchmarkEntriesOrBuilder { -private static final long serialVersionUID = 0L; - // Use BenchmarkEntries.newBuilder() to construct. - private BenchmarkEntries(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BenchmarkEntries() { - entry_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BenchmarkEntries(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BenchmarkEntries( - 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)) { - entry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entry_.add( - input.readMessage(org.tensorflow.proto.util.testlog.BenchmarkEntry.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_ & 0x00000001) != 0)) { - entry_ = java.util.Collections.unmodifiableList(entry_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BenchmarkEntries.class, org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder.class); - } - - public static final int ENTRY_FIELD_NUMBER = 1; - private java.util.List entry_; - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public java.util.List getEntryList() { - return entry_; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public java.util.List - getEntryOrBuilderList() { - return entry_; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public int getEntryCount() { - return entry_.size(); - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntry getEntry(int index) { - return entry_.get(index); - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder getEntryOrBuilder( - int index) { - return entry_.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 { - for (int i = 0; i < entry_.size(); i++) { - output.writeMessage(1, entry_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entry_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, entry_.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.util.testlog.BenchmarkEntries)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.BenchmarkEntries other = (org.tensorflow.proto.util.testlog.BenchmarkEntries) obj; - - if (!getEntryList() - .equals(other.getEntryList())) 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 (getEntryCount() > 0) { - hash = (37 * hash) + ENTRY_FIELD_NUMBER; - hash = (53 * hash) + getEntryList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.BenchmarkEntries parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries 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.testlog.BenchmarkEntries parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries 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.testlog.BenchmarkEntries parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries 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.testlog.BenchmarkEntries parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries 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.testlog.BenchmarkEntries parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntries 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.util.testlog.BenchmarkEntries 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.BenchmarkEntries} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BenchmarkEntries) - org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BenchmarkEntries.class, org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.BenchmarkEntries.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEntryFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (entryBuilder_ == null) { - entry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - entryBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntries getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.BenchmarkEntries.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntries build() { - org.tensorflow.proto.util.testlog.BenchmarkEntries result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntries buildPartial() { - org.tensorflow.proto.util.testlog.BenchmarkEntries result = new org.tensorflow.proto.util.testlog.BenchmarkEntries(this); - int from_bitField0_ = bitField0_; - if (entryBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - entry_ = java.util.Collections.unmodifiableList(entry_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entry_ = entry_; - } else { - result.entry_ = entryBuilder_.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.util.testlog.BenchmarkEntries) { - return mergeFrom((org.tensorflow.proto.util.testlog.BenchmarkEntries)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.BenchmarkEntries other) { - if (other == org.tensorflow.proto.util.testlog.BenchmarkEntries.getDefaultInstance()) return this; - if (entryBuilder_ == null) { - if (!other.entry_.isEmpty()) { - if (entry_.isEmpty()) { - entry_ = other.entry_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntryIsMutable(); - entry_.addAll(other.entry_); - } - onChanged(); - } - } else { - if (!other.entry_.isEmpty()) { - if (entryBuilder_.isEmpty()) { - entryBuilder_.dispose(); - entryBuilder_ = null; - entry_ = other.entry_; - bitField0_ = (bitField0_ & ~0x00000001); - entryBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEntryFieldBuilder() : null; - } else { - entryBuilder_.addAllMessages(other.entry_); - } - } - } - 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.util.testlog.BenchmarkEntries parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.BenchmarkEntries) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List entry_ = - java.util.Collections.emptyList(); - private void ensureEntryIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - entry_ = new java.util.ArrayList(entry_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntry, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder> entryBuilder_; - - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public java.util.List getEntryList() { - if (entryBuilder_ == null) { - return java.util.Collections.unmodifiableList(entry_); - } else { - return entryBuilder_.getMessageList(); - } - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public int getEntryCount() { - if (entryBuilder_ == null) { - return entry_.size(); - } else { - return entryBuilder_.getCount(); - } - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntry getEntry(int index) { - if (entryBuilder_ == null) { - return entry_.get(index); - } else { - return entryBuilder_.getMessage(index); - } - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder setEntry( - int index, org.tensorflow.proto.util.testlog.BenchmarkEntry value) { - if (entryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntryIsMutable(); - entry_.set(index, value); - onChanged(); - } else { - entryBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder setEntry( - int index, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder builderForValue) { - if (entryBuilder_ == null) { - ensureEntryIsMutable(); - entry_.set(index, builderForValue.build()); - onChanged(); - } else { - entryBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder addEntry(org.tensorflow.proto.util.testlog.BenchmarkEntry value) { - if (entryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntryIsMutable(); - entry_.add(value); - onChanged(); - } else { - entryBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder addEntry( - int index, org.tensorflow.proto.util.testlog.BenchmarkEntry value) { - if (entryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntryIsMutable(); - entry_.add(index, value); - onChanged(); - } else { - entryBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder addEntry( - org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder builderForValue) { - if (entryBuilder_ == null) { - ensureEntryIsMutable(); - entry_.add(builderForValue.build()); - onChanged(); - } else { - entryBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder addEntry( - int index, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder builderForValue) { - if (entryBuilder_ == null) { - ensureEntryIsMutable(); - entry_.add(index, builderForValue.build()); - onChanged(); - } else { - entryBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder addAllEntry( - java.lang.Iterable values) { - if (entryBuilder_ == null) { - ensureEntryIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, entry_); - onChanged(); - } else { - entryBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder clearEntry() { - if (entryBuilder_ == null) { - entry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entryBuilder_.clear(); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public Builder removeEntry(int index) { - if (entryBuilder_ == null) { - ensureEntryIsMutable(); - entry_.remove(index); - onChanged(); - } else { - entryBuilder_.remove(index); - } - return this; - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder getEntryBuilder( - int index) { - return getEntryFieldBuilder().getBuilder(index); - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder getEntryOrBuilder( - int index) { - if (entryBuilder_ == null) { - return entry_.get(index); } else { - return entryBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public java.util.List - getEntryOrBuilderList() { - if (entryBuilder_ != null) { - return entryBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entry_); - } - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder addEntryBuilder() { - return getEntryFieldBuilder().addBuilder( - org.tensorflow.proto.util.testlog.BenchmarkEntry.getDefaultInstance()); - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder addEntryBuilder( - int index) { - return getEntryFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.testlog.BenchmarkEntry.getDefaultInstance()); - } - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - public java.util.List - getEntryBuilderList() { - return getEntryFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntry, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder> - getEntryFieldBuilder() { - if (entryBuilder_ == null) { - entryBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntry, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder>( - entry_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - entry_ = null; - } - return entryBuilder_; - } - @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.BenchmarkEntries) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BenchmarkEntries) - private static final org.tensorflow.proto.util.testlog.BenchmarkEntries DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.BenchmarkEntries(); - } - - public static org.tensorflow.proto.util.testlog.BenchmarkEntries getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BenchmarkEntries parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BenchmarkEntries(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.util.testlog.BenchmarkEntries getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntriesOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntriesOrBuilder.java deleted file mode 100644 index 25a3905dfdf..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntriesOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface BenchmarkEntriesOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BenchmarkEntries) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - java.util.List - getEntryList(); - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - org.tensorflow.proto.util.testlog.BenchmarkEntry getEntry(int index); - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - int getEntryCount(); - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - java.util.List - getEntryOrBuilderList(); - /** - * repeated .tensorflow.BenchmarkEntry entry = 1; - */ - org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder getEntryOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntry.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntry.java deleted file mode 100644 index b83843aa744..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntry.java +++ /dev/null @@ -1,1676 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - *
    - * Each unit test or benchmark in a test or benchmark run provides
    - * some set of information.  Here we provide some reasonable keys
    - * one would expect to see, with optional key/value pairs for things
    - * we haven't considered.
    - * This BenchmarkEntry should be emitted by each unit test or benchmark
    - * reporter.
    - * 
    - * - * Protobuf type {@code tensorflow.BenchmarkEntry} - */ -public final class BenchmarkEntry extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BenchmarkEntry) - BenchmarkEntryOrBuilder { -private static final long serialVersionUID = 0L; - // Use BenchmarkEntry.newBuilder() to construct. - private BenchmarkEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BenchmarkEntry() { - name_ = ""; - metrics_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BenchmarkEntry(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BenchmarkEntry( - 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: { - - iters_ = input.readInt64(); - break; - } - case 25: { - - cpuTime_ = input.readDouble(); - break; - } - case 33: { - - wallTime_ = input.readDouble(); - break; - } - case 41: { - - throughput_ = input.readDouble(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - extras_ = com.google.protobuf.MapField.newMapField( - ExtrasDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - extras__ = input.readMessage( - ExtrasDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - extras_.getMutableMap().put( - extras__.getKey(), extras__.getValue()); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - metrics_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - metrics_.add( - input.readMessage(org.tensorflow.proto.util.testlog.MetricEntry.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)) { - metrics_ = java.util.Collections.unmodifiableList(metrics_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetExtras(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BenchmarkEntry.class, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * The name of the specific benchmark or test
    -   * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -   * 
    - * - * 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 specific benchmark or test
    -   * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -   * 
    - * - * 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 ITERS_FIELD_NUMBER = 2; - private long iters_; - /** - *
    -   * If a benchmark, how many iterations it was run for
    -   * 
    - * - * int64 iters = 2; - */ - public long getIters() { - return iters_; - } - - public static final int CPU_TIME_FIELD_NUMBER = 3; - private double cpuTime_; - /** - *
    -   * Total cpu time used for all iterations (in seconds)
    -   * 
    - * - * double cpu_time = 3; - */ - public double getCpuTime() { - return cpuTime_; - } - - public static final int WALL_TIME_FIELD_NUMBER = 4; - private double wallTime_; - /** - *
    -   * Total wall time used for all iterations (in seconds)
    -   * 
    - * - * double wall_time = 4; - */ - public double getWallTime() { - return wallTime_; - } - - public static final int THROUGHPUT_FIELD_NUMBER = 5; - private double throughput_; - /** - *
    -   * Throughput (in MB/s)
    -   * 
    - * - * double throughput = 5; - */ - public double getThroughput() { - return throughput_; - } - - public static final int EXTRAS_FIELD_NUMBER = 6; - private static final class ExtrasDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, org.tensorflow.proto.util.testlog.EntryValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - org.tensorflow.proto.util.testlog.EntryValue.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.util.testlog.EntryValue> extras_; - private com.google.protobuf.MapField - internalGetExtras() { - if (extras_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExtrasDefaultEntryHolder.defaultEntry); - } - return extras_; - } - - public int getExtrasCount() { - return internalGetExtras().getMap().size(); - } - /** - *
    -   * Generic map from result key to value.
    -   * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public boolean containsExtras( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExtras().getMap().containsKey(key); - } - /** - * Use {@link #getExtrasMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getExtras() { - return getExtrasMap(); - } - /** - *
    -   * Generic map from result key to value.
    -   * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public java.util.Map getExtrasMap() { - return internalGetExtras().getMap(); - } - /** - *
    -   * Generic map from result key to value.
    -   * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public org.tensorflow.proto.util.testlog.EntryValue getExtrasOrDefault( - java.lang.String key, - org.tensorflow.proto.util.testlog.EntryValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtras().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Generic map from result key to value.
    -   * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtras().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int METRICS_FIELD_NUMBER = 7; - private java.util.List metrics_; - /** - *
    -   * Metric name, value and expected range. This can include accuracy metrics
    -   * typically used to determine whether the accuracy test has passed
    -   * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public java.util.List getMetricsList() { - return metrics_; - } - /** - *
    -   * Metric name, value and expected range. This can include accuracy metrics
    -   * typically used to determine whether the accuracy test has passed
    -   * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public java.util.List - getMetricsOrBuilderList() { - return metrics_; - } - /** - *
    -   * Metric name, value and expected range. This can include accuracy metrics
    -   * typically used to determine whether the accuracy test has passed
    -   * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public int getMetricsCount() { - return metrics_.size(); - } - /** - *
    -   * Metric name, value and expected range. This can include accuracy metrics
    -   * typically used to determine whether the accuracy test has passed
    -   * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntry getMetrics(int index) { - return metrics_.get(index); - } - /** - *
    -   * Metric name, value and expected range. This can include accuracy metrics
    -   * typically used to determine whether the accuracy test has passed
    -   * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntryOrBuilder getMetricsOrBuilder( - int index) { - return metrics_.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 { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (iters_ != 0L) { - output.writeInt64(2, iters_); - } - if (cpuTime_ != 0D) { - output.writeDouble(3, cpuTime_); - } - if (wallTime_ != 0D) { - output.writeDouble(4, wallTime_); - } - if (throughput_ != 0D) { - output.writeDouble(5, throughput_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetExtras(), - ExtrasDefaultEntryHolder.defaultEntry, - 6); - for (int i = 0; i < metrics_.size(); i++) { - output.writeMessage(7, metrics_.get(i)); - } - 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 (iters_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, iters_); - } - if (cpuTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, cpuTime_); - } - if (wallTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(4, wallTime_); - } - if (throughput_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(5, throughput_); - } - for (java.util.Map.Entry entry - : internalGetExtras().getMap().entrySet()) { - com.google.protobuf.MapEntry - extras__ = ExtrasDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, extras__); - } - for (int i = 0; i < metrics_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, metrics_.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.util.testlog.BenchmarkEntry)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.BenchmarkEntry other = (org.tensorflow.proto.util.testlog.BenchmarkEntry) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getIters() - != other.getIters()) return false; - if (java.lang.Double.doubleToLongBits(getCpuTime()) - != java.lang.Double.doubleToLongBits( - other.getCpuTime())) return false; - if (java.lang.Double.doubleToLongBits(getWallTime()) - != java.lang.Double.doubleToLongBits( - other.getWallTime())) return false; - if (java.lang.Double.doubleToLongBits(getThroughput()) - != java.lang.Double.doubleToLongBits( - other.getThroughput())) return false; - if (!internalGetExtras().equals( - other.internalGetExtras())) return false; - if (!getMetricsList() - .equals(other.getMetricsList())) 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) + ITERS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getIters()); - hash = (37 * hash) + CPU_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getCpuTime())); - hash = (37 * hash) + WALL_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getWallTime())); - hash = (37 * hash) + THROUGHPUT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getThroughput())); - if (!internalGetExtras().getMap().isEmpty()) { - hash = (37 * hash) + EXTRAS_FIELD_NUMBER; - hash = (53 * hash) + internalGetExtras().hashCode(); - } - if (getMetricsCount() > 0) { - hash = (37 * hash) + METRICS_FIELD_NUMBER; - hash = (53 * hash) + getMetricsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.BenchmarkEntry parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry 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.testlog.BenchmarkEntry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry 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.testlog.BenchmarkEntry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry 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.testlog.BenchmarkEntry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry 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.testlog.BenchmarkEntry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BenchmarkEntry 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.util.testlog.BenchmarkEntry 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; - } - /** - *
    -   * Each unit test or benchmark in a test or benchmark run provides
    -   * some set of information.  Here we provide some reasonable keys
    -   * one would expect to see, with optional key/value pairs for things
    -   * we haven't considered.
    -   * This BenchmarkEntry should be emitted by each unit test or benchmark
    -   * reporter.
    -   * 
    - * - * Protobuf type {@code tensorflow.BenchmarkEntry} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BenchmarkEntry) - org.tensorflow.proto.util.testlog.BenchmarkEntryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetExtras(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 6: - return internalGetMutableExtras(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BenchmarkEntry.class, org.tensorflow.proto.util.testlog.BenchmarkEntry.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.BenchmarkEntry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getMetricsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - iters_ = 0L; - - cpuTime_ = 0D; - - wallTime_ = 0D; - - throughput_ = 0D; - - internalGetMutableExtras().clear(); - if (metricsBuilder_ == null) { - metrics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - metricsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntry getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.BenchmarkEntry.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntry build() { - org.tensorflow.proto.util.testlog.BenchmarkEntry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BenchmarkEntry buildPartial() { - org.tensorflow.proto.util.testlog.BenchmarkEntry result = new org.tensorflow.proto.util.testlog.BenchmarkEntry(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.iters_ = iters_; - result.cpuTime_ = cpuTime_; - result.wallTime_ = wallTime_; - result.throughput_ = throughput_; - result.extras_ = internalGetExtras(); - result.extras_.makeImmutable(); - if (metricsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - metrics_ = java.util.Collections.unmodifiableList(metrics_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.metrics_ = metrics_; - } else { - result.metrics_ = metricsBuilder_.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.util.testlog.BenchmarkEntry) { - return mergeFrom((org.tensorflow.proto.util.testlog.BenchmarkEntry)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.BenchmarkEntry other) { - if (other == org.tensorflow.proto.util.testlog.BenchmarkEntry.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getIters() != 0L) { - setIters(other.getIters()); - } - if (other.getCpuTime() != 0D) { - setCpuTime(other.getCpuTime()); - } - if (other.getWallTime() != 0D) { - setWallTime(other.getWallTime()); - } - if (other.getThroughput() != 0D) { - setThroughput(other.getThroughput()); - } - internalGetMutableExtras().mergeFrom( - other.internalGetExtras()); - if (metricsBuilder_ == null) { - if (!other.metrics_.isEmpty()) { - if (metrics_.isEmpty()) { - metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMetricsIsMutable(); - metrics_.addAll(other.metrics_); - } - onChanged(); - } - } else { - if (!other.metrics_.isEmpty()) { - if (metricsBuilder_.isEmpty()) { - metricsBuilder_.dispose(); - metricsBuilder_ = null; - metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000002); - metricsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getMetricsFieldBuilder() : null; - } else { - metricsBuilder_.addAllMessages(other.metrics_); - } - } - } - 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.util.testlog.BenchmarkEntry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.BenchmarkEntry) 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 specific benchmark or test
    -     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -     * 
    - * - * 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 specific benchmark or test
    -     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -     * 
    - * - * 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 specific benchmark or test
    -     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -     * 
    - * - * 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 specific benchmark or test
    -     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * The name of the specific benchmark or test
    -     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    -     * 
    - * - * 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 long iters_ ; - /** - *
    -     * If a benchmark, how many iterations it was run for
    -     * 
    - * - * int64 iters = 2; - */ - public long getIters() { - return iters_; - } - /** - *
    -     * If a benchmark, how many iterations it was run for
    -     * 
    - * - * int64 iters = 2; - */ - public Builder setIters(long value) { - - iters_ = value; - onChanged(); - return this; - } - /** - *
    -     * If a benchmark, how many iterations it was run for
    -     * 
    - * - * int64 iters = 2; - */ - public Builder clearIters() { - - iters_ = 0L; - onChanged(); - return this; - } - - private double cpuTime_ ; - /** - *
    -     * Total cpu time used for all iterations (in seconds)
    -     * 
    - * - * double cpu_time = 3; - */ - public double getCpuTime() { - return cpuTime_; - } - /** - *
    -     * Total cpu time used for all iterations (in seconds)
    -     * 
    - * - * double cpu_time = 3; - */ - public Builder setCpuTime(double value) { - - cpuTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Total cpu time used for all iterations (in seconds)
    -     * 
    - * - * double cpu_time = 3; - */ - public Builder clearCpuTime() { - - cpuTime_ = 0D; - onChanged(); - return this; - } - - private double wallTime_ ; - /** - *
    -     * Total wall time used for all iterations (in seconds)
    -     * 
    - * - * double wall_time = 4; - */ - public double getWallTime() { - return wallTime_; - } - /** - *
    -     * Total wall time used for all iterations (in seconds)
    -     * 
    - * - * double wall_time = 4; - */ - public Builder setWallTime(double value) { - - wallTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * Total wall time used for all iterations (in seconds)
    -     * 
    - * - * double wall_time = 4; - */ - public Builder clearWallTime() { - - wallTime_ = 0D; - onChanged(); - return this; - } - - private double throughput_ ; - /** - *
    -     * Throughput (in MB/s)
    -     * 
    - * - * double throughput = 5; - */ - public double getThroughput() { - return throughput_; - } - /** - *
    -     * Throughput (in MB/s)
    -     * 
    - * - * double throughput = 5; - */ - public Builder setThroughput(double value) { - - throughput_ = value; - onChanged(); - return this; - } - /** - *
    -     * Throughput (in MB/s)
    -     * 
    - * - * double throughput = 5; - */ - public Builder clearThroughput() { - - throughput_ = 0D; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, org.tensorflow.proto.util.testlog.EntryValue> extras_; - private com.google.protobuf.MapField - internalGetExtras() { - if (extras_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ExtrasDefaultEntryHolder.defaultEntry); - } - return extras_; - } - private com.google.protobuf.MapField - internalGetMutableExtras() { - onChanged();; - if (extras_ == null) { - extras_ = com.google.protobuf.MapField.newMapField( - ExtrasDefaultEntryHolder.defaultEntry); - } - if (!extras_.isMutable()) { - extras_ = extras_.copy(); - } - return extras_; - } - - public int getExtrasCount() { - return internalGetExtras().getMap().size(); - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public boolean containsExtras( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetExtras().getMap().containsKey(key); - } - /** - * Use {@link #getExtrasMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getExtras() { - return getExtrasMap(); - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public java.util.Map getExtrasMap() { - return internalGetExtras().getMap(); - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public org.tensorflow.proto.util.testlog.EntryValue getExtrasOrDefault( - java.lang.String key, - org.tensorflow.proto.util.testlog.EntryValue defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtras().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetExtras().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearExtras() { - internalGetMutableExtras().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public Builder removeExtras( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExtras().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableExtras() { - return internalGetMutableExtras().getMutableMap(); - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - public Builder putExtras( - java.lang.String key, - org.tensorflow.proto.util.testlog.EntryValue value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableExtras().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Generic map from result key to value.
    -     * 
    - * - * map<string, .tensorflow.EntryValue> extras = 6; - */ - - public Builder putAllExtras( - java.util.Map values) { - internalGetMutableExtras().getMutableMap() - .putAll(values); - return this; - } - - private java.util.List metrics_ = - java.util.Collections.emptyList(); - private void ensureMetricsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - metrics_ = new java.util.ArrayList(metrics_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.MetricEntry, org.tensorflow.proto.util.testlog.MetricEntry.Builder, org.tensorflow.proto.util.testlog.MetricEntryOrBuilder> metricsBuilder_; - - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public java.util.List getMetricsList() { - if (metricsBuilder_ == null) { - return java.util.Collections.unmodifiableList(metrics_); - } else { - return metricsBuilder_.getMessageList(); - } - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public int getMetricsCount() { - if (metricsBuilder_ == null) { - return metrics_.size(); - } else { - return metricsBuilder_.getCount(); - } - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntry getMetrics(int index) { - if (metricsBuilder_ == null) { - return metrics_.get(index); - } else { - return metricsBuilder_.getMessage(index); - } - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder setMetrics( - int index, org.tensorflow.proto.util.testlog.MetricEntry value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.set(index, value); - onChanged(); - } else { - metricsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder setMetrics( - int index, org.tensorflow.proto.util.testlog.MetricEntry.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.set(index, builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder addMetrics(org.tensorflow.proto.util.testlog.MetricEntry value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.add(value); - onChanged(); - } else { - metricsBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder addMetrics( - int index, org.tensorflow.proto.util.testlog.MetricEntry value) { - if (metricsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMetricsIsMutable(); - metrics_.add(index, value); - onChanged(); - } else { - metricsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder addMetrics( - org.tensorflow.proto.util.testlog.MetricEntry.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.add(builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder addMetrics( - int index, org.tensorflow.proto.util.testlog.MetricEntry.Builder builderForValue) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.add(index, builderForValue.build()); - onChanged(); - } else { - metricsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder addAllMetrics( - java.lang.Iterable values) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, metrics_); - onChanged(); - } else { - metricsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder clearMetrics() { - if (metricsBuilder_ == null) { - metrics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - metricsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public Builder removeMetrics(int index) { - if (metricsBuilder_ == null) { - ensureMetricsIsMutable(); - metrics_.remove(index); - onChanged(); - } else { - metricsBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntry.Builder getMetricsBuilder( - int index) { - return getMetricsFieldBuilder().getBuilder(index); - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntryOrBuilder getMetricsOrBuilder( - int index) { - if (metricsBuilder_ == null) { - return metrics_.get(index); } else { - return metricsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public java.util.List - getMetricsOrBuilderList() { - if (metricsBuilder_ != null) { - return metricsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(metrics_); - } - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntry.Builder addMetricsBuilder() { - return getMetricsFieldBuilder().addBuilder( - org.tensorflow.proto.util.testlog.MetricEntry.getDefaultInstance()); - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public org.tensorflow.proto.util.testlog.MetricEntry.Builder addMetricsBuilder( - int index) { - return getMetricsFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.testlog.MetricEntry.getDefaultInstance()); - } - /** - *
    -     * Metric name, value and expected range. This can include accuracy metrics
    -     * typically used to determine whether the accuracy test has passed
    -     * 
    - * - * repeated .tensorflow.MetricEntry metrics = 7; - */ - public java.util.List - getMetricsBuilderList() { - return getMetricsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.MetricEntry, org.tensorflow.proto.util.testlog.MetricEntry.Builder, org.tensorflow.proto.util.testlog.MetricEntryOrBuilder> - getMetricsFieldBuilder() { - if (metricsBuilder_ == null) { - metricsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.MetricEntry, org.tensorflow.proto.util.testlog.MetricEntry.Builder, org.tensorflow.proto.util.testlog.MetricEntryOrBuilder>( - metrics_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - metrics_ = null; - } - return metricsBuilder_; - } - @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.BenchmarkEntry) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BenchmarkEntry) - private static final org.tensorflow.proto.util.testlog.BenchmarkEntry DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.BenchmarkEntry(); - } - - public static org.tensorflow.proto.util.testlog.BenchmarkEntry getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BenchmarkEntry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BenchmarkEntry(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.util.testlog.BenchmarkEntry getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfiguration.java deleted file mode 100644 index 8d571429f4f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfiguration.java +++ /dev/null @@ -1,1021 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.BuildConfiguration} - */ -public final class BuildConfiguration extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.BuildConfiguration) - BuildConfigurationOrBuilder { -private static final long serialVersionUID = 0L; - // Use BuildConfiguration.newBuilder() to construct. - private BuildConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BuildConfiguration() { - mode_ = ""; - ccFlags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - opts_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BuildConfiguration(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BuildConfiguration( - 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(); - - mode_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - ccFlags_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - ccFlags_.add(s); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - opts_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - opts_.add(s); - 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)) { - ccFlags_ = ccFlags_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - opts_ = opts_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BuildConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BuildConfiguration.class, org.tensorflow.proto.util.testlog.BuildConfiguration.Builder.class); - } - - public static final int MODE_FIELD_NUMBER = 1; - private volatile java.lang.Object mode_; - /** - *
    -   * opt, dbg, etc
    -   * 
    - * - * string mode = 1; - */ - public java.lang.String getMode() { - java.lang.Object ref = mode_; - 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(); - mode_ = s; - return s; - } - } - /** - *
    -   * opt, dbg, etc
    -   * 
    - * - * string mode = 1; - */ - public com.google.protobuf.ByteString - getModeBytes() { - java.lang.Object ref = mode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CC_FLAGS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList ccFlags_; - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - public com.google.protobuf.ProtocolStringList - getCcFlagsList() { - return ccFlags_; - } - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - public int getCcFlagsCount() { - return ccFlags_.size(); - } - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - public java.lang.String getCcFlags(int index) { - return ccFlags_.get(index); - } - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - public com.google.protobuf.ByteString - getCcFlagsBytes(int index) { - return ccFlags_.getByteString(index); - } - - public static final int OPTS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList opts_; - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - public com.google.protobuf.ProtocolStringList - getOptsList() { - return opts_; - } - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - public int getOptsCount() { - return opts_.size(); - } - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - public java.lang.String getOpts(int index) { - return opts_.get(index); - } - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - public com.google.protobuf.ByteString - getOptsBytes(int index) { - return opts_.getByteString(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 { - if (!getModeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mode_); - } - for (int i = 0; i < ccFlags_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ccFlags_.getRaw(i)); - } - for (int i = 0; i < opts_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, opts_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getModeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mode_); - } - { - int dataSize = 0; - for (int i = 0; i < ccFlags_.size(); i++) { - dataSize += computeStringSizeNoTag(ccFlags_.getRaw(i)); - } - size += dataSize; - size += 1 * getCcFlagsList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < opts_.size(); i++) { - dataSize += computeStringSizeNoTag(opts_.getRaw(i)); - } - size += dataSize; - size += 1 * getOptsList().size(); - } - 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.util.testlog.BuildConfiguration)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.BuildConfiguration other = (org.tensorflow.proto.util.testlog.BuildConfiguration) obj; - - if (!getMode() - .equals(other.getMode())) return false; - if (!getCcFlagsList() - .equals(other.getCcFlagsList())) return false; - if (!getOptsList() - .equals(other.getOptsList())) 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) + MODE_FIELD_NUMBER; - hash = (53 * hash) + getMode().hashCode(); - if (getCcFlagsCount() > 0) { - hash = (37 * hash) + CC_FLAGS_FIELD_NUMBER; - hash = (53 * hash) + getCcFlagsList().hashCode(); - } - if (getOptsCount() > 0) { - hash = (37 * hash) + OPTS_FIELD_NUMBER; - hash = (53 * hash) + getOptsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.BuildConfiguration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration 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.testlog.BuildConfiguration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration 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.testlog.BuildConfiguration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration 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.testlog.BuildConfiguration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration 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.testlog.BuildConfiguration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.BuildConfiguration 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.util.testlog.BuildConfiguration 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.BuildConfiguration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.BuildConfiguration) - org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BuildConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.BuildConfiguration.class, org.tensorflow.proto.util.testlog.BuildConfiguration.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.BuildConfiguration.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(); - mode_ = ""; - - ccFlags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - opts_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BuildConfiguration getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.BuildConfiguration.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BuildConfiguration build() { - org.tensorflow.proto.util.testlog.BuildConfiguration result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.BuildConfiguration buildPartial() { - org.tensorflow.proto.util.testlog.BuildConfiguration result = new org.tensorflow.proto.util.testlog.BuildConfiguration(this); - int from_bitField0_ = bitField0_; - result.mode_ = mode_; - if (((bitField0_ & 0x00000001) != 0)) { - ccFlags_ = ccFlags_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.ccFlags_ = ccFlags_; - if (((bitField0_ & 0x00000002) != 0)) { - opts_ = opts_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.opts_ = opts_; - 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.util.testlog.BuildConfiguration) { - return mergeFrom((org.tensorflow.proto.util.testlog.BuildConfiguration)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.BuildConfiguration other) { - if (other == org.tensorflow.proto.util.testlog.BuildConfiguration.getDefaultInstance()) return this; - if (!other.getMode().isEmpty()) { - mode_ = other.mode_; - onChanged(); - } - if (!other.ccFlags_.isEmpty()) { - if (ccFlags_.isEmpty()) { - ccFlags_ = other.ccFlags_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCcFlagsIsMutable(); - ccFlags_.addAll(other.ccFlags_); - } - onChanged(); - } - if (!other.opts_.isEmpty()) { - if (opts_.isEmpty()) { - opts_ = other.opts_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOptsIsMutable(); - opts_.addAll(other.opts_); - } - onChanged(); - } - 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.util.testlog.BuildConfiguration parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.BuildConfiguration) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object mode_ = ""; - /** - *
    -     * opt, dbg, etc
    -     * 
    - * - * string mode = 1; - */ - public java.lang.String getMode() { - java.lang.Object ref = mode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - mode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * opt, dbg, etc
    -     * 
    - * - * string mode = 1; - */ - public com.google.protobuf.ByteString - getModeBytes() { - java.lang.Object ref = mode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - mode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * opt, dbg, etc
    -     * 
    - * - * string mode = 1; - */ - public Builder setMode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - mode_ = value; - onChanged(); - return this; - } - /** - *
    -     * opt, dbg, etc
    -     * 
    - * - * string mode = 1; - */ - public Builder clearMode() { - - mode_ = getDefaultInstance().getMode(); - onChanged(); - return this; - } - /** - *
    -     * opt, dbg, etc
    -     * 
    - * - * string mode = 1; - */ - public Builder setModeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - mode_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList ccFlags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureCcFlagsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - ccFlags_ = new com.google.protobuf.LazyStringArrayList(ccFlags_); - bitField0_ |= 0x00000001; - } - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public com.google.protobuf.ProtocolStringList - getCcFlagsList() { - return ccFlags_.getUnmodifiableView(); - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public int getCcFlagsCount() { - return ccFlags_.size(); - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public java.lang.String getCcFlags(int index) { - return ccFlags_.get(index); - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public com.google.protobuf.ByteString - getCcFlagsBytes(int index) { - return ccFlags_.getByteString(index); - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public Builder setCcFlags( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureCcFlagsIsMutable(); - ccFlags_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public Builder addCcFlags( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureCcFlagsIsMutable(); - ccFlags_.add(value); - onChanged(); - return this; - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public Builder addAllCcFlags( - java.lang.Iterable values) { - ensureCcFlagsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, ccFlags_); - onChanged(); - return this; - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public Builder clearCcFlags() { - ccFlags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
    -     * CC compiler flags, if known
    -     * 
    - * - * repeated string cc_flags = 2; - */ - public Builder addCcFlagsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureCcFlagsIsMutable(); - ccFlags_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList opts_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureOptsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - opts_ = new com.google.protobuf.LazyStringArrayList(opts_); - bitField0_ |= 0x00000002; - } - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public com.google.protobuf.ProtocolStringList - getOptsList() { - return opts_.getUnmodifiableView(); - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public int getOptsCount() { - return opts_.size(); - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public java.lang.String getOpts(int index) { - return opts_.get(index); - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public com.google.protobuf.ByteString - getOptsBytes(int index) { - return opts_.getByteString(index); - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public Builder setOpts( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptsIsMutable(); - opts_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public Builder addOpts( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureOptsIsMutable(); - opts_.add(value); - onChanged(); - return this; - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public Builder addAllOpts( - java.lang.Iterable values) { - ensureOptsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, opts_); - onChanged(); - return this; - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public Builder clearOpts() { - opts_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
    -     * Bazel compilation options, if known
    -     * 
    - * - * repeated string opts = 3; - */ - public Builder addOptsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureOptsIsMutable(); - opts_.add(value); - 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.BuildConfiguration) - } - - // @@protoc_insertion_point(class_scope:tensorflow.BuildConfiguration) - private static final org.tensorflow.proto.util.testlog.BuildConfiguration DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.BuildConfiguration(); - } - - public static org.tensorflow.proto.util.testlog.BuildConfiguration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BuildConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BuildConfiguration(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.util.testlog.BuildConfiguration getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfigurationOrBuilder.java deleted file mode 100644 index 4fd04ebf65d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BuildConfigurationOrBuilder.java +++ /dev/null @@ -1,97 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface BuildConfigurationOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.BuildConfiguration) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * opt, dbg, etc
    -   * 
    - * - * string mode = 1; - */ - java.lang.String getMode(); - /** - *
    -   * opt, dbg, etc
    -   * 
    - * - * string mode = 1; - */ - com.google.protobuf.ByteString - getModeBytes(); - - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - java.util.List - getCcFlagsList(); - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - int getCcFlagsCount(); - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - java.lang.String getCcFlags(int index); - /** - *
    -   * CC compiler flags, if known
    -   * 
    - * - * repeated string cc_flags = 2; - */ - com.google.protobuf.ByteString - getCcFlagsBytes(int index); - - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - java.util.List - getOptsList(); - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - int getOptsCount(); - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - java.lang.String getOpts(int index); - /** - *
    -   * Bazel compilation options, if known
    -   * 
    - * - * repeated string opts = 3; - */ - com.google.protobuf.ByteString - getOptsBytes(int index); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfo.java deleted file mode 100644 index b4ae942f481..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfo.java +++ /dev/null @@ -1,1254 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.CPUInfo} - */ -public final class CPUInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CPUInfo) - CPUInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use CPUInfo.newBuilder() to construct. - private CPUInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CPUInfo() { - cpuInfo_ = ""; - cpuGovernor_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CPUInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CPUInfo( - 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: { - - numCores_ = input.readInt64(); - break; - } - case 16: { - - numCoresAllowed_ = input.readInt64(); - break; - } - case 25: { - - mhzPerCpu_ = input.readDouble(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - cpuInfo_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - cpuGovernor_ = s; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - cacheSize_ = com.google.protobuf.MapField.newMapField( - CacheSizeDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - cacheSize__ = input.readMessage( - CacheSizeDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - cacheSize_.getMutableMap().put( - cacheSize__.getKey(), cacheSize__.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.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetCacheSize(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.CPUInfo.class, org.tensorflow.proto.util.testlog.CPUInfo.Builder.class); - } - - public static final int NUM_CORES_FIELD_NUMBER = 1; - private long numCores_; - /** - * int64 num_cores = 1; - */ - public long getNumCores() { - return numCores_; - } - - public static final int NUM_CORES_ALLOWED_FIELD_NUMBER = 2; - private long numCoresAllowed_; - /** - * int64 num_cores_allowed = 2; - */ - public long getNumCoresAllowed() { - return numCoresAllowed_; - } - - public static final int MHZ_PER_CPU_FIELD_NUMBER = 3; - private double mhzPerCpu_; - /** - *
    -   * How fast are these cpus?
    -   * 
    - * - * double mhz_per_cpu = 3; - */ - public double getMhzPerCpu() { - return mhzPerCpu_; - } - - public static final int CPU_INFO_FIELD_NUMBER = 4; - private volatile java.lang.Object cpuInfo_; - /** - *
    -   * Additional cpu information. For example,
    -   * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -   * 
    - * - * string cpu_info = 4; - */ - public java.lang.String getCpuInfo() { - java.lang.Object ref = cpuInfo_; - 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(); - cpuInfo_ = s; - return s; - } - } - /** - *
    -   * Additional cpu information. For example,
    -   * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -   * 
    - * - * string cpu_info = 4; - */ - public com.google.protobuf.ByteString - getCpuInfoBytes() { - java.lang.Object ref = cpuInfo_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cpuInfo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CPU_GOVERNOR_FIELD_NUMBER = 5; - private volatile java.lang.Object cpuGovernor_; - /** - *
    -   * What kind of cpu scaling is enabled on the host.
    -   * Examples include "performance", "ondemand", "conservative", "mixed".
    -   * 
    - * - * string cpu_governor = 5; - */ - public java.lang.String getCpuGovernor() { - java.lang.Object ref = cpuGovernor_; - 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(); - cpuGovernor_ = s; - return s; - } - } - /** - *
    -   * What kind of cpu scaling is enabled on the host.
    -   * Examples include "performance", "ondemand", "conservative", "mixed".
    -   * 
    - * - * string cpu_governor = 5; - */ - public com.google.protobuf.ByteString - getCpuGovernorBytes() { - java.lang.Object ref = cpuGovernor_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cpuGovernor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CACHE_SIZE_FIELD_NUMBER = 6; - private static final class CacheSizeDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.Long> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.INT64, - 0L); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.Long> cacheSize_; - private com.google.protobuf.MapField - internalGetCacheSize() { - if (cacheSize_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CacheSizeDefaultEntryHolder.defaultEntry); - } - return cacheSize_; - } - - public int getCacheSizeCount() { - return internalGetCacheSize().getMap().size(); - } - /** - *
    -   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -   * 
    - * - * map<string, int64> cache_size = 6; - */ - - public boolean containsCacheSize( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCacheSize().getMap().containsKey(key); - } - /** - * Use {@link #getCacheSizeMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getCacheSize() { - return getCacheSizeMap(); - } - /** - *
    -   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -   * 
    - * - * map<string, int64> cache_size = 6; - */ - - public java.util.Map getCacheSizeMap() { - return internalGetCacheSize().getMap(); - } - /** - *
    -   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -   * 
    - * - * map<string, int64> cache_size = 6; - */ - - public long getCacheSizeOrDefault( - java.lang.String key, - long defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCacheSize().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -   * 
    - * - * map<string, int64> cache_size = 6; - */ - - public long getCacheSizeOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCacheSize().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 (numCores_ != 0L) { - output.writeInt64(1, numCores_); - } - if (numCoresAllowed_ != 0L) { - output.writeInt64(2, numCoresAllowed_); - } - if (mhzPerCpu_ != 0D) { - output.writeDouble(3, mhzPerCpu_); - } - if (!getCpuInfoBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, cpuInfo_); - } - if (!getCpuGovernorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, cpuGovernor_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetCacheSize(), - CacheSizeDefaultEntryHolder.defaultEntry, - 6); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (numCores_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, numCores_); - } - if (numCoresAllowed_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, numCoresAllowed_); - } - if (mhzPerCpu_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, mhzPerCpu_); - } - if (!getCpuInfoBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, cpuInfo_); - } - if (!getCpuGovernorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, cpuGovernor_); - } - for (java.util.Map.Entry entry - : internalGetCacheSize().getMap().entrySet()) { - com.google.protobuf.MapEntry - cacheSize__ = CacheSizeDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, cacheSize__); - } - 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.util.testlog.CPUInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.CPUInfo other = (org.tensorflow.proto.util.testlog.CPUInfo) obj; - - if (getNumCores() - != other.getNumCores()) return false; - if (getNumCoresAllowed() - != other.getNumCoresAllowed()) return false; - if (java.lang.Double.doubleToLongBits(getMhzPerCpu()) - != java.lang.Double.doubleToLongBits( - other.getMhzPerCpu())) return false; - if (!getCpuInfo() - .equals(other.getCpuInfo())) return false; - if (!getCpuGovernor() - .equals(other.getCpuGovernor())) return false; - if (!internalGetCacheSize().equals( - other.internalGetCacheSize())) 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) + NUM_CORES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumCores()); - hash = (37 * hash) + NUM_CORES_ALLOWED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumCoresAllowed()); - hash = (37 * hash) + MHZ_PER_CPU_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getMhzPerCpu())); - hash = (37 * hash) + CPU_INFO_FIELD_NUMBER; - hash = (53 * hash) + getCpuInfo().hashCode(); - hash = (37 * hash) + CPU_GOVERNOR_FIELD_NUMBER; - hash = (53 * hash) + getCpuGovernor().hashCode(); - if (!internalGetCacheSize().getMap().isEmpty()) { - hash = (37 * hash) + CACHE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + internalGetCacheSize().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.CPUInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CPUInfo 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.testlog.CPUInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CPUInfo 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.testlog.CPUInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CPUInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.CPUInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CPUInfo 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.testlog.CPUInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CPUInfo 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.testlog.CPUInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CPUInfo 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.util.testlog.CPUInfo 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.CPUInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CPUInfo) - org.tensorflow.proto.util.testlog.CPUInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 6: - return internalGetCacheSize(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 6: - return internalGetMutableCacheSize(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.CPUInfo.class, org.tensorflow.proto.util.testlog.CPUInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.CPUInfo.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(); - numCores_ = 0L; - - numCoresAllowed_ = 0L; - - mhzPerCpu_ = 0D; - - cpuInfo_ = ""; - - cpuGovernor_ = ""; - - internalGetMutableCacheSize().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CPUInfo getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.CPUInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CPUInfo build() { - org.tensorflow.proto.util.testlog.CPUInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CPUInfo buildPartial() { - org.tensorflow.proto.util.testlog.CPUInfo result = new org.tensorflow.proto.util.testlog.CPUInfo(this); - int from_bitField0_ = bitField0_; - result.numCores_ = numCores_; - result.numCoresAllowed_ = numCoresAllowed_; - result.mhzPerCpu_ = mhzPerCpu_; - result.cpuInfo_ = cpuInfo_; - result.cpuGovernor_ = cpuGovernor_; - result.cacheSize_ = internalGetCacheSize(); - result.cacheSize_.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.util.testlog.CPUInfo) { - return mergeFrom((org.tensorflow.proto.util.testlog.CPUInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.CPUInfo other) { - if (other == org.tensorflow.proto.util.testlog.CPUInfo.getDefaultInstance()) return this; - if (other.getNumCores() != 0L) { - setNumCores(other.getNumCores()); - } - if (other.getNumCoresAllowed() != 0L) { - setNumCoresAllowed(other.getNumCoresAllowed()); - } - if (other.getMhzPerCpu() != 0D) { - setMhzPerCpu(other.getMhzPerCpu()); - } - if (!other.getCpuInfo().isEmpty()) { - cpuInfo_ = other.cpuInfo_; - onChanged(); - } - if (!other.getCpuGovernor().isEmpty()) { - cpuGovernor_ = other.cpuGovernor_; - onChanged(); - } - internalGetMutableCacheSize().mergeFrom( - other.internalGetCacheSize()); - 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.util.testlog.CPUInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.CPUInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long numCores_ ; - /** - * int64 num_cores = 1; - */ - public long getNumCores() { - return numCores_; - } - /** - * int64 num_cores = 1; - */ - public Builder setNumCores(long value) { - - numCores_ = value; - onChanged(); - return this; - } - /** - * int64 num_cores = 1; - */ - public Builder clearNumCores() { - - numCores_ = 0L; - onChanged(); - return this; - } - - private long numCoresAllowed_ ; - /** - * int64 num_cores_allowed = 2; - */ - public long getNumCoresAllowed() { - return numCoresAllowed_; - } - /** - * int64 num_cores_allowed = 2; - */ - public Builder setNumCoresAllowed(long value) { - - numCoresAllowed_ = value; - onChanged(); - return this; - } - /** - * int64 num_cores_allowed = 2; - */ - public Builder clearNumCoresAllowed() { - - numCoresAllowed_ = 0L; - onChanged(); - return this; - } - - private double mhzPerCpu_ ; - /** - *
    -     * How fast are these cpus?
    -     * 
    - * - * double mhz_per_cpu = 3; - */ - public double getMhzPerCpu() { - return mhzPerCpu_; - } - /** - *
    -     * How fast are these cpus?
    -     * 
    - * - * double mhz_per_cpu = 3; - */ - public Builder setMhzPerCpu(double value) { - - mhzPerCpu_ = value; - onChanged(); - return this; - } - /** - *
    -     * How fast are these cpus?
    -     * 
    - * - * double mhz_per_cpu = 3; - */ - public Builder clearMhzPerCpu() { - - mhzPerCpu_ = 0D; - onChanged(); - return this; - } - - private java.lang.Object cpuInfo_ = ""; - /** - *
    -     * Additional cpu information. For example,
    -     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -     * 
    - * - * string cpu_info = 4; - */ - public java.lang.String getCpuInfo() { - java.lang.Object ref = cpuInfo_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - cpuInfo_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Additional cpu information. For example,
    -     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -     * 
    - * - * string cpu_info = 4; - */ - public com.google.protobuf.ByteString - getCpuInfoBytes() { - java.lang.Object ref = cpuInfo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cpuInfo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Additional cpu information. For example,
    -     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -     * 
    - * - * string cpu_info = 4; - */ - public Builder setCpuInfo( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - cpuInfo_ = value; - onChanged(); - return this; - } - /** - *
    -     * Additional cpu information. For example,
    -     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -     * 
    - * - * string cpu_info = 4; - */ - public Builder clearCpuInfo() { - - cpuInfo_ = getDefaultInstance().getCpuInfo(); - onChanged(); - return this; - } - /** - *
    -     * Additional cpu information. For example,
    -     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    -     * 
    - * - * string cpu_info = 4; - */ - public Builder setCpuInfoBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - cpuInfo_ = value; - onChanged(); - return this; - } - - private java.lang.Object cpuGovernor_ = ""; - /** - *
    -     * What kind of cpu scaling is enabled on the host.
    -     * Examples include "performance", "ondemand", "conservative", "mixed".
    -     * 
    - * - * string cpu_governor = 5; - */ - public java.lang.String getCpuGovernor() { - java.lang.Object ref = cpuGovernor_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - cpuGovernor_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * What kind of cpu scaling is enabled on the host.
    -     * Examples include "performance", "ondemand", "conservative", "mixed".
    -     * 
    - * - * string cpu_governor = 5; - */ - public com.google.protobuf.ByteString - getCpuGovernorBytes() { - java.lang.Object ref = cpuGovernor_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - cpuGovernor_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * What kind of cpu scaling is enabled on the host.
    -     * Examples include "performance", "ondemand", "conservative", "mixed".
    -     * 
    - * - * string cpu_governor = 5; - */ - public Builder setCpuGovernor( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - cpuGovernor_ = value; - onChanged(); - return this; - } - /** - *
    -     * What kind of cpu scaling is enabled on the host.
    -     * Examples include "performance", "ondemand", "conservative", "mixed".
    -     * 
    - * - * string cpu_governor = 5; - */ - public Builder clearCpuGovernor() { - - cpuGovernor_ = getDefaultInstance().getCpuGovernor(); - onChanged(); - return this; - } - /** - *
    -     * What kind of cpu scaling is enabled on the host.
    -     * Examples include "performance", "ondemand", "conservative", "mixed".
    -     * 
    - * - * string cpu_governor = 5; - */ - public Builder setCpuGovernorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - cpuGovernor_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.Long> cacheSize_; - private com.google.protobuf.MapField - internalGetCacheSize() { - if (cacheSize_ == null) { - return com.google.protobuf.MapField.emptyMapField( - CacheSizeDefaultEntryHolder.defaultEntry); - } - return cacheSize_; - } - private com.google.protobuf.MapField - internalGetMutableCacheSize() { - onChanged();; - if (cacheSize_ == null) { - cacheSize_ = com.google.protobuf.MapField.newMapField( - CacheSizeDefaultEntryHolder.defaultEntry); - } - if (!cacheSize_.isMutable()) { - cacheSize_ = cacheSize_.copy(); - } - return cacheSize_; - } - - public int getCacheSizeCount() { - return internalGetCacheSize().getMap().size(); - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public boolean containsCacheSize( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetCacheSize().getMap().containsKey(key); - } - /** - * Use {@link #getCacheSizeMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getCacheSize() { - return getCacheSizeMap(); - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public java.util.Map getCacheSizeMap() { - return internalGetCacheSize().getMap(); - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public long getCacheSizeOrDefault( - java.lang.String key, - long defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCacheSize().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public long getCacheSizeOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetCacheSize().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearCacheSize() { - internalGetMutableCacheSize().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public Builder removeCacheSize( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableCacheSize().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableCacheSize() { - return internalGetMutableCacheSize().getMutableMap(); - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - public Builder putCacheSize( - java.lang.String key, - long value) { - if (key == null) { throw new java.lang.NullPointerException(); } - - internalGetMutableCacheSize().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    -     * 
    - * - * map<string, int64> cache_size = 6; - */ - - public Builder putAllCacheSize( - java.util.Map values) { - internalGetMutableCacheSize().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.CPUInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CPUInfo) - private static final org.tensorflow.proto.util.testlog.CPUInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.CPUInfo(); - } - - public static org.tensorflow.proto.util.testlog.CPUInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CPUInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CPUInfo(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.util.testlog.CPUInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitId.java deleted file mode 100644 index beac981e730..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitId.java +++ /dev/null @@ -1,964 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.CommitId} - */ -public final class CommitId extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.CommitId) - CommitIdOrBuilder { -private static final long serialVersionUID = 0L; - // Use CommitId.newBuilder() to construct. - private CommitId(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CommitId() { - snapshot_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CommitId(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CommitId( - 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: { - kindCase_ = 1; - kind_ = input.readInt64(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - kindCase_ = 2; - kind_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - snapshot_ = s; - break; - } - case 32: { - - pendingChangelist_ = 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.util.testlog.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CommitId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.CommitId.class, org.tensorflow.proto.util.testlog.CommitId.Builder.class); - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - CHANGELIST(1), - HASH(2), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: return CHANGELIST; - case 2: return HASH; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int CHANGELIST_FIELD_NUMBER = 1; - /** - *
    -   * Submitted changelist.
    -   * 
    - * - * int64 changelist = 1; - */ - public long getChangelist() { - if (kindCase_ == 1) { - return (java.lang.Long) kind_; - } - return 0L; - } - - public static final int HASH_FIELD_NUMBER = 2; - /** - * string hash = 2; - */ - public java.lang.String getHash() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - 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(); - if (kindCase_ == 2) { - kind_ = s; - } - return s; - } - } - /** - * string hash = 2; - */ - public com.google.protobuf.ByteString - getHashBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 2) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SNAPSHOT_FIELD_NUMBER = 3; - private volatile java.lang.Object snapshot_; - /** - *
    -   * Hash of intermediate change between hash/changelist and what was tested.
    -   * Not used if the build is from a commit without modifications.
    -   * 
    - * - * string snapshot = 3; - */ - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - 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(); - snapshot_ = s; - return s; - } - } - /** - *
    -   * Hash of intermediate change between hash/changelist and what was tested.
    -   * Not used if the build is from a commit without modifications.
    -   * 
    - * - * string snapshot = 3; - */ - public com.google.protobuf.ByteString - getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - snapshot_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PENDING_CHANGELIST_FIELD_NUMBER = 4; - private long pendingChangelist_; - /** - *
    -   * Changelist tested if the change list is not already submitted.
    -   * 
    - * - * int64 pending_changelist = 4; - */ - public long getPendingChangelist() { - return pendingChangelist_; - } - - 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 (kindCase_ == 1) { - output.writeInt64( - 1, (long)((java.lang.Long) kind_)); - } - if (kindCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kind_); - } - if (!getSnapshotBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snapshot_); - } - if (pendingChangelist_ != 0L) { - output.writeInt64(4, pendingChangelist_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 1, (long)((java.lang.Long) kind_)); - } - if (kindCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kind_); - } - if (!getSnapshotBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snapshot_); - } - if (pendingChangelist_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(4, pendingChangelist_); - } - 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.util.testlog.CommitId)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.CommitId other = (org.tensorflow.proto.util.testlog.CommitId) obj; - - if (!getSnapshot() - .equals(other.getSnapshot())) return false; - if (getPendingChangelist() - != other.getPendingChangelist()) return false; - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 1: - if (getChangelist() - != other.getChangelist()) return false; - break; - case 2: - if (!getHash() - .equals(other.getHash())) return false; - break; - case 0: - default: - } - 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) + SNAPSHOT_FIELD_NUMBER; - hash = (53 * hash) + getSnapshot().hashCode(); - hash = (37 * hash) + PENDING_CHANGELIST_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPendingChangelist()); - switch (kindCase_) { - case 1: - hash = (37 * hash) + CHANGELIST_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getChangelist()); - break; - case 2: - hash = (37 * hash) + HASH_FIELD_NUMBER; - hash = (53 * hash) + getHash().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.CommitId parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CommitId 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.testlog.CommitId parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CommitId 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.testlog.CommitId parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.CommitId parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.CommitId parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CommitId 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.testlog.CommitId parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CommitId 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.testlog.CommitId parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.CommitId 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.util.testlog.CommitId 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.CommitId} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.CommitId) - org.tensorflow.proto.util.testlog.CommitIdOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CommitId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.CommitId.class, org.tensorflow.proto.util.testlog.CommitId.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.CommitId.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(); - snapshot_ = ""; - - pendingChangelist_ = 0L; - - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CommitId getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.CommitId.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CommitId build() { - org.tensorflow.proto.util.testlog.CommitId result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.CommitId buildPartial() { - org.tensorflow.proto.util.testlog.CommitId result = new org.tensorflow.proto.util.testlog.CommitId(this); - if (kindCase_ == 1) { - result.kind_ = kind_; - } - if (kindCase_ == 2) { - result.kind_ = kind_; - } - result.snapshot_ = snapshot_; - result.pendingChangelist_ = pendingChangelist_; - result.kindCase_ = kindCase_; - 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.util.testlog.CommitId) { - return mergeFrom((org.tensorflow.proto.util.testlog.CommitId)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.CommitId other) { - if (other == org.tensorflow.proto.util.testlog.CommitId.getDefaultInstance()) return this; - if (!other.getSnapshot().isEmpty()) { - snapshot_ = other.snapshot_; - onChanged(); - } - if (other.getPendingChangelist() != 0L) { - setPendingChangelist(other.getPendingChangelist()); - } - switch (other.getKindCase()) { - case CHANGELIST: { - setChangelist(other.getChangelist()); - break; - } - case HASH: { - kindCase_ = 2; - kind_ = other.kind_; - onChanged(); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.util.testlog.CommitId parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.CommitId) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - - /** - *
    -     * Submitted changelist.
    -     * 
    - * - * int64 changelist = 1; - */ - public long getChangelist() { - if (kindCase_ == 1) { - return (java.lang.Long) kind_; - } - return 0L; - } - /** - *
    -     * Submitted changelist.
    -     * 
    - * - * int64 changelist = 1; - */ - public Builder setChangelist(long value) { - kindCase_ = 1; - kind_ = value; - onChanged(); - return this; - } - /** - *
    -     * Submitted changelist.
    -     * 
    - * - * int64 changelist = 1; - */ - public Builder clearChangelist() { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * string hash = 2; - */ - public java.lang.String getHash() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (kindCase_ == 2) { - kind_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string hash = 2; - */ - public com.google.protobuf.ByteString - getHashBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 2) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string hash = 2; - */ - public Builder setHash( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 2; - kind_ = value; - onChanged(); - return this; - } - /** - * string hash = 2; - */ - public Builder clearHash() { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - /** - * string hash = 2; - */ - public Builder setHashBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kindCase_ = 2; - kind_ = value; - onChanged(); - return this; - } - - private java.lang.Object snapshot_ = ""; - /** - *
    -     * Hash of intermediate change between hash/changelist and what was tested.
    -     * Not used if the build is from a commit without modifications.
    -     * 
    - * - * string snapshot = 3; - */ - public java.lang.String getSnapshot() { - java.lang.Object ref = snapshot_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - snapshot_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Hash of intermediate change between hash/changelist and what was tested.
    -     * Not used if the build is from a commit without modifications.
    -     * 
    - * - * string snapshot = 3; - */ - public com.google.protobuf.ByteString - getSnapshotBytes() { - java.lang.Object ref = snapshot_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - snapshot_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Hash of intermediate change between hash/changelist and what was tested.
    -     * Not used if the build is from a commit without modifications.
    -     * 
    - * - * string snapshot = 3; - */ - public Builder setSnapshot( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - snapshot_ = value; - onChanged(); - return this; - } - /** - *
    -     * Hash of intermediate change between hash/changelist and what was tested.
    -     * Not used if the build is from a commit without modifications.
    -     * 
    - * - * string snapshot = 3; - */ - public Builder clearSnapshot() { - - snapshot_ = getDefaultInstance().getSnapshot(); - onChanged(); - return this; - } - /** - *
    -     * Hash of intermediate change between hash/changelist and what was tested.
    -     * Not used if the build is from a commit without modifications.
    -     * 
    - * - * string snapshot = 3; - */ - public Builder setSnapshotBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - snapshot_ = value; - onChanged(); - return this; - } - - private long pendingChangelist_ ; - /** - *
    -     * Changelist tested if the change list is not already submitted.
    -     * 
    - * - * int64 pending_changelist = 4; - */ - public long getPendingChangelist() { - return pendingChangelist_; - } - /** - *
    -     * Changelist tested if the change list is not already submitted.
    -     * 
    - * - * int64 pending_changelist = 4; - */ - public Builder setPendingChangelist(long value) { - - pendingChangelist_ = value; - onChanged(); - return this; - } - /** - *
    -     * Changelist tested if the change list is not already submitted.
    -     * 
    - * - * int64 pending_changelist = 4; - */ - public Builder clearPendingChangelist() { - - pendingChangelist_ = 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.CommitId) - } - - // @@protoc_insertion_point(class_scope:tensorflow.CommitId) - private static final org.tensorflow.proto.util.testlog.CommitId DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.CommitId(); - } - - public static org.tensorflow.proto.util.testlog.CommitId getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CommitId parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CommitId(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.util.testlog.CommitId getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitIdOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitIdOrBuilder.java deleted file mode 100644 index b63f4353379..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CommitIdOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface CommitIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.CommitId) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Submitted changelist.
    -   * 
    - * - * int64 changelist = 1; - */ - long getChangelist(); - - /** - * string hash = 2; - */ - java.lang.String getHash(); - /** - * string hash = 2; - */ - com.google.protobuf.ByteString - getHashBytes(); - - /** - *
    -   * Hash of intermediate change between hash/changelist and what was tested.
    -   * Not used if the build is from a commit without modifications.
    -   * 
    - * - * string snapshot = 3; - */ - java.lang.String getSnapshot(); - /** - *
    -   * Hash of intermediate change between hash/changelist and what was tested.
    -   * Not used if the build is from a commit without modifications.
    -   * 
    - * - * string snapshot = 3; - */ - com.google.protobuf.ByteString - getSnapshotBytes(); - - /** - *
    -   * Changelist tested if the change list is not already submitted.
    -   * 
    - * - * int64 pending_changelist = 4; - */ - long getPendingChangelist(); - - public org.tensorflow.proto.util.testlog.CommitId.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValue.java deleted file mode 100644 index d8ca9fffd45..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValue.java +++ /dev/null @@ -1,713 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.EntryValue} - */ -public final class EntryValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.EntryValue) - EntryValueOrBuilder { -private static final long serialVersionUID = 0L; - // Use EntryValue.newBuilder() to construct. - private EntryValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EntryValue() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EntryValue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EntryValue( - 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 9: { - kindCase_ = 1; - kind_ = input.readDouble(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - kindCase_ = 2; - kind_ = s; - 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.util.testlog.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_EntryValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.EntryValue.class, org.tensorflow.proto.util.testlog.EntryValue.Builder.class); - } - - private int kindCase_ = 0; - private java.lang.Object kind_; - public enum KindCase - implements com.google.protobuf.Internal.EnumLite { - DOUBLE_VALUE(1), - STRING_VALUE(2), - KIND_NOT_SET(0); - private final int value; - private KindCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: return DOUBLE_VALUE; - case 2: return STRING_VALUE; - case 0: return KIND_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public static final int DOUBLE_VALUE_FIELD_NUMBER = 1; - /** - * double double_value = 1; - */ - public double getDoubleValue() { - if (kindCase_ == 1) { - return (java.lang.Double) kind_; - } - return 0D; - } - - public static final int STRING_VALUE_FIELD_NUMBER = 2; - /** - * string string_value = 2; - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - 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(); - if (kindCase_ == 2) { - kind_ = s; - } - return s; - } - } - /** - * string string_value = 2; - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 2) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (kindCase_ == 1) { - output.writeDouble( - 1, (double)((java.lang.Double) kind_)); - } - if (kindCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kind_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize( - 1, (double)((java.lang.Double) kind_)); - } - if (kindCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kind_); - } - 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.util.testlog.EntryValue)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.EntryValue other = (org.tensorflow.proto.util.testlog.EntryValue) obj; - - if (!getKindCase().equals(other.getKindCase())) return false; - switch (kindCase_) { - case 1: - if (java.lang.Double.doubleToLongBits(getDoubleValue()) - != java.lang.Double.doubleToLongBits( - other.getDoubleValue())) return false; - break; - case 2: - if (!getStringValue() - .equals(other.getStringValue())) return false; - break; - case 0: - default: - } - 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(); - switch (kindCase_) { - case 1: - hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getDoubleValue())); - break; - case 2: - hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStringValue().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.EntryValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.EntryValue 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.testlog.EntryValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.EntryValue 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.testlog.EntryValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.EntryValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.EntryValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.EntryValue 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.testlog.EntryValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.EntryValue 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.testlog.EntryValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.EntryValue 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.util.testlog.EntryValue 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.EntryValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.EntryValue) - org.tensorflow.proto.util.testlog.EntryValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_EntryValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.EntryValue.class, org.tensorflow.proto.util.testlog.EntryValue.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.EntryValue.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(); - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.EntryValue getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.EntryValue.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.EntryValue build() { - org.tensorflow.proto.util.testlog.EntryValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.EntryValue buildPartial() { - org.tensorflow.proto.util.testlog.EntryValue result = new org.tensorflow.proto.util.testlog.EntryValue(this); - if (kindCase_ == 1) { - result.kind_ = kind_; - } - if (kindCase_ == 2) { - result.kind_ = kind_; - } - result.kindCase_ = kindCase_; - 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.util.testlog.EntryValue) { - return mergeFrom((org.tensorflow.proto.util.testlog.EntryValue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.EntryValue other) { - if (other == org.tensorflow.proto.util.testlog.EntryValue.getDefaultInstance()) return this; - switch (other.getKindCase()) { - case DOUBLE_VALUE: { - setDoubleValue(other.getDoubleValue()); - break; - } - case STRING_VALUE: { - kindCase_ = 2; - kind_ = other.kind_; - onChanged(); - break; - } - case KIND_NOT_SET: { - break; - } - } - 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.util.testlog.EntryValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.EntryValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int kindCase_ = 0; - private java.lang.Object kind_; - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - - /** - * double double_value = 1; - */ - public double getDoubleValue() { - if (kindCase_ == 1) { - return (java.lang.Double) kind_; - } - return 0D; - } - /** - * double double_value = 1; - */ - public Builder setDoubleValue(double value) { - kindCase_ = 1; - kind_ = value; - onChanged(); - return this; - } - /** - * double double_value = 1; - */ - public Builder clearDoubleValue() { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * string string_value = 2; - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (kindCase_ == 2) { - kind_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string string_value = 2; - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (kindCase_ == 2) { - ref = kind_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (kindCase_ == 2) { - kind_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string string_value = 2; - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 2; - kind_ = value; - onChanged(); - return this; - } - /** - * string string_value = 2; - */ - public Builder clearStringValue() { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - /** - * string string_value = 2; - */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kindCase_ = 2; - kind_ = value; - 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.EntryValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.EntryValue) - private static final org.tensorflow.proto.util.testlog.EntryValue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.EntryValue(); - } - - public static org.tensorflow.proto.util.testlog.EntryValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EntryValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EntryValue(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.util.testlog.EntryValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValueOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValueOrBuilder.java deleted file mode 100644 index 4a2d71e54ba..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/EntryValueOrBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface EntryValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.EntryValue) - com.google.protobuf.MessageOrBuilder { - - /** - * double double_value = 1; - */ - double getDoubleValue(); - - /** - * string string_value = 2; - */ - java.lang.String getStringValue(); - /** - * string string_value = 2; - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - public org.tensorflow.proto.util.testlog.EntryValue.KindCase getKindCase(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfo.java deleted file mode 100644 index 7f6878d36ad..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfo.java +++ /dev/null @@ -1,884 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.GPUInfo} - */ -public final class GPUInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.GPUInfo) - GPUInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use GPUInfo.newBuilder() to construct. - private GPUInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GPUInfo() { - model_ = ""; - uuid_ = ""; - busId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GPUInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GPUInfo( - 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(); - - model_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - uuid_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - busId_ = s; - 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.util.testlog.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_GPUInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.GPUInfo.class, org.tensorflow.proto.util.testlog.GPUInfo.Builder.class); - } - - public static final int MODEL_FIELD_NUMBER = 1; - private volatile java.lang.Object model_; - /** - *
    -   * e.g. "Tesla K40c"
    -   * 
    - * - * string model = 1; - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - 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(); - model_ = s; - return s; - } - } - /** - *
    -   * e.g. "Tesla K40c"
    -   * 
    - * - * string model = 1; - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UUID_FIELD_NUMBER = 2; - private volatile java.lang.Object uuid_; - /** - *
    -   * Final entry in output of "nvidia-smi -L"
    -   * 
    - * - * string uuid = 2; - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - 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(); - uuid_ = s; - return s; - } - } - /** - *
    -   * Final entry in output of "nvidia-smi -L"
    -   * 
    - * - * string uuid = 2; - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BUS_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object busId_; - /** - *
    -   * e.g. "0000:04:00.0"
    -   * 
    - * - * string bus_id = 3; - */ - public java.lang.String getBusId() { - java.lang.Object ref = busId_; - 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(); - busId_ = s; - return s; - } - } - /** - *
    -   * e.g. "0000:04:00.0"
    -   * 
    - * - * string bus_id = 3; - */ - public com.google.protobuf.ByteString - getBusIdBytes() { - java.lang.Object ref = busId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - busId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getModelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); - } - if (!getUuidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uuid_); - } - if (!getBusIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, busId_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getModelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); - } - if (!getUuidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uuid_); - } - if (!getBusIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, busId_); - } - 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.util.testlog.GPUInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.GPUInfo other = (org.tensorflow.proto.util.testlog.GPUInfo) obj; - - if (!getModel() - .equals(other.getModel())) return false; - if (!getUuid() - .equals(other.getUuid())) return false; - if (!getBusId() - .equals(other.getBusId())) 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) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + UUID_FIELD_NUMBER; - hash = (53 * hash) + getUuid().hashCode(); - hash = (37 * hash) + BUS_ID_FIELD_NUMBER; - hash = (53 * hash) + getBusId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.GPUInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.GPUInfo 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.testlog.GPUInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.GPUInfo 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.testlog.GPUInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.GPUInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.GPUInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.GPUInfo 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.testlog.GPUInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.GPUInfo 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.testlog.GPUInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.GPUInfo 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.util.testlog.GPUInfo 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.GPUInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.GPUInfo) - org.tensorflow.proto.util.testlog.GPUInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_GPUInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.GPUInfo.class, org.tensorflow.proto.util.testlog.GPUInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.GPUInfo.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(); - model_ = ""; - - uuid_ = ""; - - busId_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.GPUInfo getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.GPUInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.GPUInfo build() { - org.tensorflow.proto.util.testlog.GPUInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.GPUInfo buildPartial() { - org.tensorflow.proto.util.testlog.GPUInfo result = new org.tensorflow.proto.util.testlog.GPUInfo(this); - result.model_ = model_; - result.uuid_ = uuid_; - result.busId_ = busId_; - 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.util.testlog.GPUInfo) { - return mergeFrom((org.tensorflow.proto.util.testlog.GPUInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.GPUInfo other) { - if (other == org.tensorflow.proto.util.testlog.GPUInfo.getDefaultInstance()) return this; - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (!other.getUuid().isEmpty()) { - uuid_ = other.uuid_; - onChanged(); - } - if (!other.getBusId().isEmpty()) { - busId_ = other.busId_; - onChanged(); - } - 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.util.testlog.GPUInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.GPUInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object model_ = ""; - /** - *
    -     * e.g. "Tesla K40c"
    -     * 
    - * - * string model = 1; - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. "Tesla K40c"
    -     * 
    - * - * string model = 1; - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. "Tesla K40c"
    -     * 
    - * - * string model = 1; - */ - public Builder setModel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. "Tesla K40c"
    -     * 
    - * - * string model = 1; - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - *
    -     * e.g. "Tesla K40c"
    -     * 
    - * - * string model = 1; - */ - public Builder setModelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private java.lang.Object uuid_ = ""; - /** - *
    -     * Final entry in output of "nvidia-smi -L"
    -     * 
    - * - * string uuid = 2; - */ - public java.lang.String getUuid() { - java.lang.Object ref = uuid_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uuid_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Final entry in output of "nvidia-smi -L"
    -     * 
    - * - * string uuid = 2; - */ - public com.google.protobuf.ByteString - getUuidBytes() { - java.lang.Object ref = uuid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uuid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Final entry in output of "nvidia-smi -L"
    -     * 
    - * - * string uuid = 2; - */ - public Builder setUuid( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uuid_ = value; - onChanged(); - return this; - } - /** - *
    -     * Final entry in output of "nvidia-smi -L"
    -     * 
    - * - * string uuid = 2; - */ - public Builder clearUuid() { - - uuid_ = getDefaultInstance().getUuid(); - onChanged(); - return this; - } - /** - *
    -     * Final entry in output of "nvidia-smi -L"
    -     * 
    - * - * string uuid = 2; - */ - public Builder setUuidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uuid_ = value; - onChanged(); - return this; - } - - private java.lang.Object busId_ = ""; - /** - *
    -     * e.g. "0000:04:00.0"
    -     * 
    - * - * string bus_id = 3; - */ - public java.lang.String getBusId() { - java.lang.Object ref = busId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - busId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. "0000:04:00.0"
    -     * 
    - * - * string bus_id = 3; - */ - public com.google.protobuf.ByteString - getBusIdBytes() { - java.lang.Object ref = busId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - busId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. "0000:04:00.0"
    -     * 
    - * - * string bus_id = 3; - */ - public Builder setBusId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - busId_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. "0000:04:00.0"
    -     * 
    - * - * string bus_id = 3; - */ - public Builder clearBusId() { - - busId_ = getDefaultInstance().getBusId(); - onChanged(); - return this; - } - /** - *
    -     * e.g. "0000:04:00.0"
    -     * 
    - * - * string bus_id = 3; - */ - public Builder setBusIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - busId_ = value; - 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.GPUInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.GPUInfo) - private static final org.tensorflow.proto.util.testlog.GPUInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.GPUInfo(); - } - - public static org.tensorflow.proto.util.testlog.GPUInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GPUInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GPUInfo(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.util.testlog.GPUInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfiguration.java deleted file mode 100644 index 70b9d4a3d7c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfiguration.java +++ /dev/null @@ -1,2241 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.MachineConfiguration} - */ -public final class MachineConfiguration extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MachineConfiguration) - MachineConfigurationOrBuilder { -private static final long serialVersionUID = 0L; - // Use MachineConfiguration.newBuilder() to construct. - private MachineConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MachineConfiguration() { - hostname_ = ""; - serialIdentifier_ = ""; - deviceInfo_ = java.util.Collections.emptyList(); - availableDeviceInfo_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MachineConfiguration(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MachineConfiguration( - 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(); - - hostname_ = s; - break; - } - case 18: { - org.tensorflow.proto.util.testlog.PlatformInfo.Builder subBuilder = null; - if (platformInfo_ != null) { - subBuilder = platformInfo_.toBuilder(); - } - platformInfo_ = input.readMessage(org.tensorflow.proto.util.testlog.PlatformInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(platformInfo_); - platformInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.util.testlog.CPUInfo.Builder subBuilder = null; - if (cpuInfo_ != null) { - subBuilder = cpuInfo_.toBuilder(); - } - cpuInfo_ = input.readMessage(org.tensorflow.proto.util.testlog.CPUInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(cpuInfo_); - cpuInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceInfo_.add( - input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - availableDeviceInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - availableDeviceInfo_.add( - input.readMessage(org.tensorflow.proto.util.testlog.AvailableDeviceInfo.parser(), extensionRegistry)); - break; - } - case 50: { - org.tensorflow.proto.util.testlog.MemoryInfo.Builder subBuilder = null; - if (memoryInfo_ != null) { - subBuilder = memoryInfo_.toBuilder(); - } - memoryInfo_ = input.readMessage(org.tensorflow.proto.util.testlog.MemoryInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(memoryInfo_); - memoryInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - serialIdentifier_ = s; - 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)) { - deviceInfo_ = java.util.Collections.unmodifiableList(deviceInfo_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - availableDeviceInfo_ = java.util.Collections.unmodifiableList(availableDeviceInfo_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MachineConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MachineConfiguration.class, org.tensorflow.proto.util.testlog.MachineConfiguration.Builder.class); - } - - public static final int HOSTNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object hostname_; - /** - *
    -   * Host name of machine that ran the benchmark.
    -   * 
    - * - * string hostname = 1; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - 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(); - hostname_ = s; - return s; - } - } - /** - *
    -   * Host name of machine that ran the benchmark.
    -   * 
    - * - * string hostname = 1; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERIAL_IDENTIFIER_FIELD_NUMBER = 7; - private volatile java.lang.Object serialIdentifier_; - /** - *
    -   * Unique serial number of the machine.
    -   * 
    - * - * string serial_identifier = 7; - */ - public java.lang.String getSerialIdentifier() { - java.lang.Object ref = serialIdentifier_; - 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(); - serialIdentifier_ = s; - return s; - } - } - /** - *
    -   * Unique serial number of the machine.
    -   * 
    - * - * string serial_identifier = 7; - */ - public com.google.protobuf.ByteString - getSerialIdentifierBytes() { - java.lang.Object ref = serialIdentifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serialIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PLATFORM_INFO_FIELD_NUMBER = 2; - private org.tensorflow.proto.util.testlog.PlatformInfo platformInfo_; - /** - *
    -   * Additional platform information.
    -   * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public boolean hasPlatformInfo() { - return platformInfo_ != null; - } - /** - *
    -   * Additional platform information.
    -   * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public org.tensorflow.proto.util.testlog.PlatformInfo getPlatformInfo() { - return platformInfo_ == null ? org.tensorflow.proto.util.testlog.PlatformInfo.getDefaultInstance() : platformInfo_; - } - /** - *
    -   * Additional platform information.
    -   * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder getPlatformInfoOrBuilder() { - return getPlatformInfo(); - } - - public static final int CPU_INFO_FIELD_NUMBER = 3; - private org.tensorflow.proto.util.testlog.CPUInfo cpuInfo_; - /** - *
    -   * CPU Information.
    -   * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public boolean hasCpuInfo() { - return cpuInfo_ != null; - } - /** - *
    -   * CPU Information.
    -   * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public org.tensorflow.proto.util.testlog.CPUInfo getCpuInfo() { - return cpuInfo_ == null ? org.tensorflow.proto.util.testlog.CPUInfo.getDefaultInstance() : cpuInfo_; - } - /** - *
    -   * CPU Information.
    -   * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public org.tensorflow.proto.util.testlog.CPUInfoOrBuilder getCpuInfoOrBuilder() { - return getCpuInfo(); - } - - public static final int DEVICE_INFO_FIELD_NUMBER = 4; - private java.util.List deviceInfo_; - /** - *
    -   * Other devices that are attached and relevant (e.g. GPUInfo).
    -   * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public java.util.List getDeviceInfoList() { - return deviceInfo_; - } - /** - *
    -   * Other devices that are attached and relevant (e.g. GPUInfo).
    -   * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public java.util.List - getDeviceInfoOrBuilderList() { - return deviceInfo_; - } - /** - *
    -   * Other devices that are attached and relevant (e.g. GPUInfo).
    -   * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public int getDeviceInfoCount() { - return deviceInfo_.size(); - } - /** - *
    -   * Other devices that are attached and relevant (e.g. GPUInfo).
    -   * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.Any getDeviceInfo(int index) { - return deviceInfo_.get(index); - } - /** - *
    -   * Other devices that are attached and relevant (e.g. GPUInfo).
    -   * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder( - int index) { - return deviceInfo_.get(index); - } - - public static final int AVAILABLE_DEVICE_INFO_FIELD_NUMBER = 5; - private java.util.List availableDeviceInfo_; - /** - *
    -   * Devices accessible to the test (e.g. as given by list_local_devices).
    -   * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public java.util.List getAvailableDeviceInfoList() { - return availableDeviceInfo_; - } - /** - *
    -   * Devices accessible to the test (e.g. as given by list_local_devices).
    -   * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public java.util.List - getAvailableDeviceInfoOrBuilderList() { - return availableDeviceInfo_; - } - /** - *
    -   * Devices accessible to the test (e.g. as given by list_local_devices).
    -   * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public int getAvailableDeviceInfoCount() { - return availableDeviceInfo_.size(); - } - /** - *
    -   * Devices accessible to the test (e.g. as given by list_local_devices).
    -   * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo getAvailableDeviceInfo(int index) { - return availableDeviceInfo_.get(index); - } - /** - *
    -   * Devices accessible to the test (e.g. as given by list_local_devices).
    -   * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder( - int index) { - return availableDeviceInfo_.get(index); - } - - public static final int MEMORY_INFO_FIELD_NUMBER = 6; - private org.tensorflow.proto.util.testlog.MemoryInfo memoryInfo_; - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public boolean hasMemoryInfo() { - return memoryInfo_ != null; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public org.tensorflow.proto.util.testlog.MemoryInfo getMemoryInfo() { - return memoryInfo_ == null ? org.tensorflow.proto.util.testlog.MemoryInfo.getDefaultInstance() : memoryInfo_; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder getMemoryInfoOrBuilder() { - return getMemoryInfo(); - } - - 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 (!getHostnameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostname_); - } - if (platformInfo_ != null) { - output.writeMessage(2, getPlatformInfo()); - } - if (cpuInfo_ != null) { - output.writeMessage(3, getCpuInfo()); - } - for (int i = 0; i < deviceInfo_.size(); i++) { - output.writeMessage(4, deviceInfo_.get(i)); - } - for (int i = 0; i < availableDeviceInfo_.size(); i++) { - output.writeMessage(5, availableDeviceInfo_.get(i)); - } - if (memoryInfo_ != null) { - output.writeMessage(6, getMemoryInfo()); - } - if (!getSerialIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, serialIdentifier_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getHostnameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostname_); - } - if (platformInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPlatformInfo()); - } - if (cpuInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getCpuInfo()); - } - for (int i = 0; i < deviceInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, deviceInfo_.get(i)); - } - for (int i = 0; i < availableDeviceInfo_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, availableDeviceInfo_.get(i)); - } - if (memoryInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getMemoryInfo()); - } - if (!getSerialIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, serialIdentifier_); - } - 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.util.testlog.MachineConfiguration)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.MachineConfiguration other = (org.tensorflow.proto.util.testlog.MachineConfiguration) obj; - - if (!getHostname() - .equals(other.getHostname())) return false; - if (!getSerialIdentifier() - .equals(other.getSerialIdentifier())) return false; - if (hasPlatformInfo() != other.hasPlatformInfo()) return false; - if (hasPlatformInfo()) { - if (!getPlatformInfo() - .equals(other.getPlatformInfo())) return false; - } - if (hasCpuInfo() != other.hasCpuInfo()) return false; - if (hasCpuInfo()) { - if (!getCpuInfo() - .equals(other.getCpuInfo())) return false; - } - if (!getDeviceInfoList() - .equals(other.getDeviceInfoList())) return false; - if (!getAvailableDeviceInfoList() - .equals(other.getAvailableDeviceInfoList())) return false; - if (hasMemoryInfo() != other.hasMemoryInfo()) return false; - if (hasMemoryInfo()) { - if (!getMemoryInfo() - .equals(other.getMemoryInfo())) 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) + HOSTNAME_FIELD_NUMBER; - hash = (53 * hash) + getHostname().hashCode(); - hash = (37 * hash) + SERIAL_IDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getSerialIdentifier().hashCode(); - if (hasPlatformInfo()) { - hash = (37 * hash) + PLATFORM_INFO_FIELD_NUMBER; - hash = (53 * hash) + getPlatformInfo().hashCode(); - } - if (hasCpuInfo()) { - hash = (37 * hash) + CPU_INFO_FIELD_NUMBER; - hash = (53 * hash) + getCpuInfo().hashCode(); - } - if (getDeviceInfoCount() > 0) { - hash = (37 * hash) + DEVICE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getDeviceInfoList().hashCode(); - } - if (getAvailableDeviceInfoCount() > 0) { - hash = (37 * hash) + AVAILABLE_DEVICE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getAvailableDeviceInfoList().hashCode(); - } - if (hasMemoryInfo()) { - hash = (37 * hash) + MEMORY_INFO_FIELD_NUMBER; - hash = (53 * hash) + getMemoryInfo().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.MachineConfiguration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration 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.testlog.MachineConfiguration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration 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.testlog.MachineConfiguration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration 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.testlog.MachineConfiguration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration 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.testlog.MachineConfiguration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MachineConfiguration 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.util.testlog.MachineConfiguration 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.MachineConfiguration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MachineConfiguration) - org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MachineConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MachineConfiguration.class, org.tensorflow.proto.util.testlog.MachineConfiguration.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.MachineConfiguration.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDeviceInfoFieldBuilder(); - getAvailableDeviceInfoFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - hostname_ = ""; - - serialIdentifier_ = ""; - - if (platformInfoBuilder_ == null) { - platformInfo_ = null; - } else { - platformInfo_ = null; - platformInfoBuilder_ = null; - } - if (cpuInfoBuilder_ == null) { - cpuInfo_ = null; - } else { - cpuInfo_ = null; - cpuInfoBuilder_ = null; - } - if (deviceInfoBuilder_ == null) { - deviceInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - deviceInfoBuilder_.clear(); - } - if (availableDeviceInfoBuilder_ == null) { - availableDeviceInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - availableDeviceInfoBuilder_.clear(); - } - if (memoryInfoBuilder_ == null) { - memoryInfo_ = null; - } else { - memoryInfo_ = null; - memoryInfoBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MachineConfiguration getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.MachineConfiguration.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MachineConfiguration build() { - org.tensorflow.proto.util.testlog.MachineConfiguration result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MachineConfiguration buildPartial() { - org.tensorflow.proto.util.testlog.MachineConfiguration result = new org.tensorflow.proto.util.testlog.MachineConfiguration(this); - int from_bitField0_ = bitField0_; - result.hostname_ = hostname_; - result.serialIdentifier_ = serialIdentifier_; - if (platformInfoBuilder_ == null) { - result.platformInfo_ = platformInfo_; - } else { - result.platformInfo_ = platformInfoBuilder_.build(); - } - if (cpuInfoBuilder_ == null) { - result.cpuInfo_ = cpuInfo_; - } else { - result.cpuInfo_ = cpuInfoBuilder_.build(); - } - if (deviceInfoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - deviceInfo_ = java.util.Collections.unmodifiableList(deviceInfo_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceInfo_ = deviceInfo_; - } else { - result.deviceInfo_ = deviceInfoBuilder_.build(); - } - if (availableDeviceInfoBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - availableDeviceInfo_ = java.util.Collections.unmodifiableList(availableDeviceInfo_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.availableDeviceInfo_ = availableDeviceInfo_; - } else { - result.availableDeviceInfo_ = availableDeviceInfoBuilder_.build(); - } - if (memoryInfoBuilder_ == null) { - result.memoryInfo_ = memoryInfo_; - } else { - result.memoryInfo_ = memoryInfoBuilder_.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.util.testlog.MachineConfiguration) { - return mergeFrom((org.tensorflow.proto.util.testlog.MachineConfiguration)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.MachineConfiguration other) { - if (other == org.tensorflow.proto.util.testlog.MachineConfiguration.getDefaultInstance()) return this; - if (!other.getHostname().isEmpty()) { - hostname_ = other.hostname_; - onChanged(); - } - if (!other.getSerialIdentifier().isEmpty()) { - serialIdentifier_ = other.serialIdentifier_; - onChanged(); - } - if (other.hasPlatformInfo()) { - mergePlatformInfo(other.getPlatformInfo()); - } - if (other.hasCpuInfo()) { - mergeCpuInfo(other.getCpuInfo()); - } - if (deviceInfoBuilder_ == null) { - if (!other.deviceInfo_.isEmpty()) { - if (deviceInfo_.isEmpty()) { - deviceInfo_ = other.deviceInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceInfoIsMutable(); - deviceInfo_.addAll(other.deviceInfo_); - } - onChanged(); - } - } else { - if (!other.deviceInfo_.isEmpty()) { - if (deviceInfoBuilder_.isEmpty()) { - deviceInfoBuilder_.dispose(); - deviceInfoBuilder_ = null; - deviceInfo_ = other.deviceInfo_; - bitField0_ = (bitField0_ & ~0x00000001); - deviceInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceInfoFieldBuilder() : null; - } else { - deviceInfoBuilder_.addAllMessages(other.deviceInfo_); - } - } - } - if (availableDeviceInfoBuilder_ == null) { - if (!other.availableDeviceInfo_.isEmpty()) { - if (availableDeviceInfo_.isEmpty()) { - availableDeviceInfo_ = other.availableDeviceInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.addAll(other.availableDeviceInfo_); - } - onChanged(); - } - } else { - if (!other.availableDeviceInfo_.isEmpty()) { - if (availableDeviceInfoBuilder_.isEmpty()) { - availableDeviceInfoBuilder_.dispose(); - availableDeviceInfoBuilder_ = null; - availableDeviceInfo_ = other.availableDeviceInfo_; - bitField0_ = (bitField0_ & ~0x00000002); - availableDeviceInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAvailableDeviceInfoFieldBuilder() : null; - } else { - availableDeviceInfoBuilder_.addAllMessages(other.availableDeviceInfo_); - } - } - } - if (other.hasMemoryInfo()) { - mergeMemoryInfo(other.getMemoryInfo()); - } - 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.util.testlog.MachineConfiguration parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.MachineConfiguration) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object hostname_ = ""; - /** - *
    -     * Host name of machine that ran the benchmark.
    -     * 
    - * - * string hostname = 1; - */ - public java.lang.String getHostname() { - java.lang.Object ref = hostname_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - hostname_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Host name of machine that ran the benchmark.
    -     * 
    - * - * string hostname = 1; - */ - public com.google.protobuf.ByteString - getHostnameBytes() { - java.lang.Object ref = hostname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - hostname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Host name of machine that ran the benchmark.
    -     * 
    - * - * string hostname = 1; - */ - public Builder setHostname( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - hostname_ = value; - onChanged(); - return this; - } - /** - *
    -     * Host name of machine that ran the benchmark.
    -     * 
    - * - * string hostname = 1; - */ - public Builder clearHostname() { - - hostname_ = getDefaultInstance().getHostname(); - onChanged(); - return this; - } - /** - *
    -     * Host name of machine that ran the benchmark.
    -     * 
    - * - * string hostname = 1; - */ - public Builder setHostnameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - hostname_ = value; - onChanged(); - return this; - } - - private java.lang.Object serialIdentifier_ = ""; - /** - *
    -     * Unique serial number of the machine.
    -     * 
    - * - * string serial_identifier = 7; - */ - public java.lang.String getSerialIdentifier() { - java.lang.Object ref = serialIdentifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - serialIdentifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Unique serial number of the machine.
    -     * 
    - * - * string serial_identifier = 7; - */ - public com.google.protobuf.ByteString - getSerialIdentifierBytes() { - java.lang.Object ref = serialIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - serialIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Unique serial number of the machine.
    -     * 
    - * - * string serial_identifier = 7; - */ - public Builder setSerialIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - serialIdentifier_ = value; - onChanged(); - return this; - } - /** - *
    -     * Unique serial number of the machine.
    -     * 
    - * - * string serial_identifier = 7; - */ - public Builder clearSerialIdentifier() { - - serialIdentifier_ = getDefaultInstance().getSerialIdentifier(); - onChanged(); - return this; - } - /** - *
    -     * Unique serial number of the machine.
    -     * 
    - * - * string serial_identifier = 7; - */ - public Builder setSerialIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - serialIdentifier_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.util.testlog.PlatformInfo platformInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.PlatformInfo, org.tensorflow.proto.util.testlog.PlatformInfo.Builder, org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder> platformInfoBuilder_; - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public boolean hasPlatformInfo() { - return platformInfoBuilder_ != null || platformInfo_ != null; - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public org.tensorflow.proto.util.testlog.PlatformInfo getPlatformInfo() { - if (platformInfoBuilder_ == null) { - return platformInfo_ == null ? org.tensorflow.proto.util.testlog.PlatformInfo.getDefaultInstance() : platformInfo_; - } else { - return platformInfoBuilder_.getMessage(); - } - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public Builder setPlatformInfo(org.tensorflow.proto.util.testlog.PlatformInfo value) { - if (platformInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - platformInfo_ = value; - onChanged(); - } else { - platformInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public Builder setPlatformInfo( - org.tensorflow.proto.util.testlog.PlatformInfo.Builder builderForValue) { - if (platformInfoBuilder_ == null) { - platformInfo_ = builderForValue.build(); - onChanged(); - } else { - platformInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public Builder mergePlatformInfo(org.tensorflow.proto.util.testlog.PlatformInfo value) { - if (platformInfoBuilder_ == null) { - if (platformInfo_ != null) { - platformInfo_ = - org.tensorflow.proto.util.testlog.PlatformInfo.newBuilder(platformInfo_).mergeFrom(value).buildPartial(); - } else { - platformInfo_ = value; - } - onChanged(); - } else { - platformInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public Builder clearPlatformInfo() { - if (platformInfoBuilder_ == null) { - platformInfo_ = null; - onChanged(); - } else { - platformInfo_ = null; - platformInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public org.tensorflow.proto.util.testlog.PlatformInfo.Builder getPlatformInfoBuilder() { - - onChanged(); - return getPlatformInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - public org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder getPlatformInfoOrBuilder() { - if (platformInfoBuilder_ != null) { - return platformInfoBuilder_.getMessageOrBuilder(); - } else { - return platformInfo_ == null ? - org.tensorflow.proto.util.testlog.PlatformInfo.getDefaultInstance() : platformInfo_; - } - } - /** - *
    -     * Additional platform information.
    -     * 
    - * - * .tensorflow.PlatformInfo platform_info = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.PlatformInfo, org.tensorflow.proto.util.testlog.PlatformInfo.Builder, org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder> - getPlatformInfoFieldBuilder() { - if (platformInfoBuilder_ == null) { - platformInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.PlatformInfo, org.tensorflow.proto.util.testlog.PlatformInfo.Builder, org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder>( - getPlatformInfo(), - getParentForChildren(), - isClean()); - platformInfo_ = null; - } - return platformInfoBuilder_; - } - - private org.tensorflow.proto.util.testlog.CPUInfo cpuInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CPUInfo, org.tensorflow.proto.util.testlog.CPUInfo.Builder, org.tensorflow.proto.util.testlog.CPUInfoOrBuilder> cpuInfoBuilder_; - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public boolean hasCpuInfo() { - return cpuInfoBuilder_ != null || cpuInfo_ != null; - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public org.tensorflow.proto.util.testlog.CPUInfo getCpuInfo() { - if (cpuInfoBuilder_ == null) { - return cpuInfo_ == null ? org.tensorflow.proto.util.testlog.CPUInfo.getDefaultInstance() : cpuInfo_; - } else { - return cpuInfoBuilder_.getMessage(); - } - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public Builder setCpuInfo(org.tensorflow.proto.util.testlog.CPUInfo value) { - if (cpuInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - cpuInfo_ = value; - onChanged(); - } else { - cpuInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public Builder setCpuInfo( - org.tensorflow.proto.util.testlog.CPUInfo.Builder builderForValue) { - if (cpuInfoBuilder_ == null) { - cpuInfo_ = builderForValue.build(); - onChanged(); - } else { - cpuInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public Builder mergeCpuInfo(org.tensorflow.proto.util.testlog.CPUInfo value) { - if (cpuInfoBuilder_ == null) { - if (cpuInfo_ != null) { - cpuInfo_ = - org.tensorflow.proto.util.testlog.CPUInfo.newBuilder(cpuInfo_).mergeFrom(value).buildPartial(); - } else { - cpuInfo_ = value; - } - onChanged(); - } else { - cpuInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public Builder clearCpuInfo() { - if (cpuInfoBuilder_ == null) { - cpuInfo_ = null; - onChanged(); - } else { - cpuInfo_ = null; - cpuInfoBuilder_ = null; - } - - return this; - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public org.tensorflow.proto.util.testlog.CPUInfo.Builder getCpuInfoBuilder() { - - onChanged(); - return getCpuInfoFieldBuilder().getBuilder(); - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - public org.tensorflow.proto.util.testlog.CPUInfoOrBuilder getCpuInfoOrBuilder() { - if (cpuInfoBuilder_ != null) { - return cpuInfoBuilder_.getMessageOrBuilder(); - } else { - return cpuInfo_ == null ? - org.tensorflow.proto.util.testlog.CPUInfo.getDefaultInstance() : cpuInfo_; - } - } - /** - *
    -     * CPU Information.
    -     * 
    - * - * .tensorflow.CPUInfo cpu_info = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CPUInfo, org.tensorflow.proto.util.testlog.CPUInfo.Builder, org.tensorflow.proto.util.testlog.CPUInfoOrBuilder> - getCpuInfoFieldBuilder() { - if (cpuInfoBuilder_ == null) { - cpuInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CPUInfo, org.tensorflow.proto.util.testlog.CPUInfo.Builder, org.tensorflow.proto.util.testlog.CPUInfoOrBuilder>( - getCpuInfo(), - getParentForChildren(), - isClean()); - cpuInfo_ = null; - } - return cpuInfoBuilder_; - } - - private java.util.List deviceInfo_ = - java.util.Collections.emptyList(); - private void ensureDeviceInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceInfo_ = new java.util.ArrayList(deviceInfo_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> deviceInfoBuilder_; - - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public java.util.List getDeviceInfoList() { - if (deviceInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceInfo_); - } else { - return deviceInfoBuilder_.getMessageList(); - } - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public int getDeviceInfoCount() { - if (deviceInfoBuilder_ == null) { - return deviceInfo_.size(); - } else { - return deviceInfoBuilder_.getCount(); - } - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.Any getDeviceInfo(int index) { - if (deviceInfoBuilder_ == null) { - return deviceInfo_.get(index); - } else { - return deviceInfoBuilder_.getMessage(index); - } - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder setDeviceInfo( - int index, com.google.protobuf.Any value) { - if (deviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceInfoIsMutable(); - deviceInfo_.set(index, value); - onChanged(); - } else { - deviceInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder setDeviceInfo( - int index, com.google.protobuf.Any.Builder builderForValue) { - if (deviceInfoBuilder_ == null) { - ensureDeviceInfoIsMutable(); - deviceInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder addDeviceInfo(com.google.protobuf.Any value) { - if (deviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceInfoIsMutable(); - deviceInfo_.add(value); - onChanged(); - } else { - deviceInfoBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder addDeviceInfo( - int index, com.google.protobuf.Any value) { - if (deviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceInfoIsMutable(); - deviceInfo_.add(index, value); - onChanged(); - } else { - deviceInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder addDeviceInfo( - com.google.protobuf.Any.Builder builderForValue) { - if (deviceInfoBuilder_ == null) { - ensureDeviceInfoIsMutable(); - deviceInfo_.add(builderForValue.build()); - onChanged(); - } else { - deviceInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder addDeviceInfo( - int index, com.google.protobuf.Any.Builder builderForValue) { - if (deviceInfoBuilder_ == null) { - ensureDeviceInfoIsMutable(); - deviceInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder addAllDeviceInfo( - java.lang.Iterable values) { - if (deviceInfoBuilder_ == null) { - ensureDeviceInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceInfo_); - onChanged(); - } else { - deviceInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder clearDeviceInfo() { - if (deviceInfoBuilder_ == null) { - deviceInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - deviceInfoBuilder_.clear(); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public Builder removeDeviceInfo(int index) { - if (deviceInfoBuilder_ == null) { - ensureDeviceInfoIsMutable(); - deviceInfo_.remove(index); - onChanged(); - } else { - deviceInfoBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.Any.Builder getDeviceInfoBuilder( - int index) { - return getDeviceInfoFieldBuilder().getBuilder(index); - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder( - int index) { - if (deviceInfoBuilder_ == null) { - return deviceInfo_.get(index); } else { - return deviceInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public java.util.List - getDeviceInfoOrBuilderList() { - if (deviceInfoBuilder_ != null) { - return deviceInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(deviceInfo_); - } - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.Any.Builder addDeviceInfoBuilder() { - return getDeviceInfoFieldBuilder().addBuilder( - com.google.protobuf.Any.getDefaultInstance()); - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public com.google.protobuf.Any.Builder addDeviceInfoBuilder( - int index) { - return getDeviceInfoFieldBuilder().addBuilder( - index, com.google.protobuf.Any.getDefaultInstance()); - } - /** - *
    -     * Other devices that are attached and relevant (e.g. GPUInfo).
    -     * 
    - * - * repeated .google.protobuf.Any device_info = 4; - */ - public java.util.List - getDeviceInfoBuilderList() { - return getDeviceInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getDeviceInfoFieldBuilder() { - if (deviceInfoBuilder_ == null) { - deviceInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - deviceInfo_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - deviceInfo_ = null; - } - return deviceInfoBuilder_; - } - - private java.util.List availableDeviceInfo_ = - java.util.Collections.emptyList(); - private void ensureAvailableDeviceInfoIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - availableDeviceInfo_ = new java.util.ArrayList(availableDeviceInfo_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.AvailableDeviceInfo, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder, org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder> availableDeviceInfoBuilder_; - - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public java.util.List getAvailableDeviceInfoList() { - if (availableDeviceInfoBuilder_ == null) { - return java.util.Collections.unmodifiableList(availableDeviceInfo_); - } else { - return availableDeviceInfoBuilder_.getMessageList(); - } - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public int getAvailableDeviceInfoCount() { - if (availableDeviceInfoBuilder_ == null) { - return availableDeviceInfo_.size(); - } else { - return availableDeviceInfoBuilder_.getCount(); - } - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo getAvailableDeviceInfo(int index) { - if (availableDeviceInfoBuilder_ == null) { - return availableDeviceInfo_.get(index); - } else { - return availableDeviceInfoBuilder_.getMessage(index); - } - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder setAvailableDeviceInfo( - int index, org.tensorflow.proto.util.testlog.AvailableDeviceInfo value) { - if (availableDeviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.set(index, value); - onChanged(); - } else { - availableDeviceInfoBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder setAvailableDeviceInfo( - int index, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder builderForValue) { - if (availableDeviceInfoBuilder_ == null) { - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.set(index, builderForValue.build()); - onChanged(); - } else { - availableDeviceInfoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder addAvailableDeviceInfo(org.tensorflow.proto.util.testlog.AvailableDeviceInfo value) { - if (availableDeviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.add(value); - onChanged(); - } else { - availableDeviceInfoBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder addAvailableDeviceInfo( - int index, org.tensorflow.proto.util.testlog.AvailableDeviceInfo value) { - if (availableDeviceInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.add(index, value); - onChanged(); - } else { - availableDeviceInfoBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder addAvailableDeviceInfo( - org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder builderForValue) { - if (availableDeviceInfoBuilder_ == null) { - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.add(builderForValue.build()); - onChanged(); - } else { - availableDeviceInfoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder addAvailableDeviceInfo( - int index, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder builderForValue) { - if (availableDeviceInfoBuilder_ == null) { - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.add(index, builderForValue.build()); - onChanged(); - } else { - availableDeviceInfoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder addAllAvailableDeviceInfo( - java.lang.Iterable values) { - if (availableDeviceInfoBuilder_ == null) { - ensureAvailableDeviceInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, availableDeviceInfo_); - onChanged(); - } else { - availableDeviceInfoBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder clearAvailableDeviceInfo() { - if (availableDeviceInfoBuilder_ == null) { - availableDeviceInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - availableDeviceInfoBuilder_.clear(); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public Builder removeAvailableDeviceInfo(int index) { - if (availableDeviceInfoBuilder_ == null) { - ensureAvailableDeviceInfoIsMutable(); - availableDeviceInfo_.remove(index); - onChanged(); - } else { - availableDeviceInfoBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder getAvailableDeviceInfoBuilder( - int index) { - return getAvailableDeviceInfoFieldBuilder().getBuilder(index); - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder( - int index) { - if (availableDeviceInfoBuilder_ == null) { - return availableDeviceInfo_.get(index); } else { - return availableDeviceInfoBuilder_.getMessageOrBuilder(index); - } - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public java.util.List - getAvailableDeviceInfoOrBuilderList() { - if (availableDeviceInfoBuilder_ != null) { - return availableDeviceInfoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(availableDeviceInfo_); - } - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder addAvailableDeviceInfoBuilder() { - return getAvailableDeviceInfoFieldBuilder().addBuilder( - org.tensorflow.proto.util.testlog.AvailableDeviceInfo.getDefaultInstance()); - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder addAvailableDeviceInfoBuilder( - int index) { - return getAvailableDeviceInfoFieldBuilder().addBuilder( - index, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.getDefaultInstance()); - } - /** - *
    -     * Devices accessible to the test (e.g. as given by list_local_devices).
    -     * 
    - * - * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; - */ - public java.util.List - getAvailableDeviceInfoBuilderList() { - return getAvailableDeviceInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.AvailableDeviceInfo, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder, org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder> - getAvailableDeviceInfoFieldBuilder() { - if (availableDeviceInfoBuilder_ == null) { - availableDeviceInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.tensorflow.proto.util.testlog.AvailableDeviceInfo, org.tensorflow.proto.util.testlog.AvailableDeviceInfo.Builder, org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder>( - availableDeviceInfo_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - availableDeviceInfo_ = null; - } - return availableDeviceInfoBuilder_; - } - - private org.tensorflow.proto.util.testlog.MemoryInfo memoryInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MemoryInfo, org.tensorflow.proto.util.testlog.MemoryInfo.Builder, org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder> memoryInfoBuilder_; - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public boolean hasMemoryInfo() { - return memoryInfoBuilder_ != null || memoryInfo_ != null; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public org.tensorflow.proto.util.testlog.MemoryInfo getMemoryInfo() { - if (memoryInfoBuilder_ == null) { - return memoryInfo_ == null ? org.tensorflow.proto.util.testlog.MemoryInfo.getDefaultInstance() : memoryInfo_; - } else { - return memoryInfoBuilder_.getMessage(); - } - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public Builder setMemoryInfo(org.tensorflow.proto.util.testlog.MemoryInfo value) { - if (memoryInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - memoryInfo_ = value; - onChanged(); - } else { - memoryInfoBuilder_.setMessage(value); - } - - return this; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public Builder setMemoryInfo( - org.tensorflow.proto.util.testlog.MemoryInfo.Builder builderForValue) { - if (memoryInfoBuilder_ == null) { - memoryInfo_ = builderForValue.build(); - onChanged(); - } else { - memoryInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public Builder mergeMemoryInfo(org.tensorflow.proto.util.testlog.MemoryInfo value) { - if (memoryInfoBuilder_ == null) { - if (memoryInfo_ != null) { - memoryInfo_ = - org.tensorflow.proto.util.testlog.MemoryInfo.newBuilder(memoryInfo_).mergeFrom(value).buildPartial(); - } else { - memoryInfo_ = value; - } - onChanged(); - } else { - memoryInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public Builder clearMemoryInfo() { - if (memoryInfoBuilder_ == null) { - memoryInfo_ = null; - onChanged(); - } else { - memoryInfo_ = null; - memoryInfoBuilder_ = null; - } - - return this; - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public org.tensorflow.proto.util.testlog.MemoryInfo.Builder getMemoryInfoBuilder() { - - onChanged(); - return getMemoryInfoFieldBuilder().getBuilder(); - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - public org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder getMemoryInfoOrBuilder() { - if (memoryInfoBuilder_ != null) { - return memoryInfoBuilder_.getMessageOrBuilder(); - } else { - return memoryInfo_ == null ? - org.tensorflow.proto.util.testlog.MemoryInfo.getDefaultInstance() : memoryInfo_; - } - } - /** - * .tensorflow.MemoryInfo memory_info = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MemoryInfo, org.tensorflow.proto.util.testlog.MemoryInfo.Builder, org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder> - getMemoryInfoFieldBuilder() { - if (memoryInfoBuilder_ == null) { - memoryInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MemoryInfo, org.tensorflow.proto.util.testlog.MemoryInfo.Builder, org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder>( - getMemoryInfo(), - getParentForChildren(), - isClean()); - memoryInfo_ = null; - } - return memoryInfoBuilder_; - } - @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.MachineConfiguration) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MachineConfiguration) - private static final org.tensorflow.proto.util.testlog.MachineConfiguration DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.MachineConfiguration(); - } - - public static org.tensorflow.proto.util.testlog.MachineConfiguration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MachineConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MachineConfiguration(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.util.testlog.MachineConfiguration getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfo.java deleted file mode 100644 index e28e00134cc..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfo.java +++ /dev/null @@ -1,567 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.MemoryInfo} - */ -public final class MemoryInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MemoryInfo) - MemoryInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use MemoryInfo.newBuilder() to construct. - private MemoryInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MemoryInfo() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MemoryInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MemoryInfo( - 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: { - - total_ = input.readInt64(); - break; - } - case 16: { - - available_ = 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.util.testlog.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MemoryInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MemoryInfo.class, org.tensorflow.proto.util.testlog.MemoryInfo.Builder.class); - } - - public static final int TOTAL_FIELD_NUMBER = 1; - private long total_; - /** - *
    -   * Total virtual memory in bytes
    -   * 
    - * - * int64 total = 1; - */ - public long getTotal() { - return total_; - } - - public static final int AVAILABLE_FIELD_NUMBER = 2; - private long available_; - /** - *
    -   * Immediately available memory in bytes
    -   * 
    - * - * int64 available = 2; - */ - public long getAvailable() { - return available_; - } - - 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 (total_ != 0L) { - output.writeInt64(1, total_); - } - if (available_ != 0L) { - output.writeInt64(2, available_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (total_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, total_); - } - if (available_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, available_); - } - 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.util.testlog.MemoryInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.MemoryInfo other = (org.tensorflow.proto.util.testlog.MemoryInfo) obj; - - if (getTotal() - != other.getTotal()) return false; - if (getAvailable() - != other.getAvailable()) 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) + TOTAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTotal()); - hash = (37 * hash) + AVAILABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getAvailable()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.MemoryInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo 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.testlog.MemoryInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo 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.testlog.MemoryInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo 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.testlog.MemoryInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo 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.testlog.MemoryInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MemoryInfo 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.util.testlog.MemoryInfo 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.MemoryInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MemoryInfo) - org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MemoryInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MemoryInfo.class, org.tensorflow.proto.util.testlog.MemoryInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.MemoryInfo.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(); - total_ = 0L; - - available_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MemoryInfo getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.MemoryInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MemoryInfo build() { - org.tensorflow.proto.util.testlog.MemoryInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MemoryInfo buildPartial() { - org.tensorflow.proto.util.testlog.MemoryInfo result = new org.tensorflow.proto.util.testlog.MemoryInfo(this); - result.total_ = total_; - result.available_ = available_; - 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.util.testlog.MemoryInfo) { - return mergeFrom((org.tensorflow.proto.util.testlog.MemoryInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.MemoryInfo other) { - if (other == org.tensorflow.proto.util.testlog.MemoryInfo.getDefaultInstance()) return this; - if (other.getTotal() != 0L) { - setTotal(other.getTotal()); - } - if (other.getAvailable() != 0L) { - setAvailable(other.getAvailable()); - } - 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.util.testlog.MemoryInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.MemoryInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long total_ ; - /** - *
    -     * Total virtual memory in bytes
    -     * 
    - * - * int64 total = 1; - */ - public long getTotal() { - return total_; - } - /** - *
    -     * Total virtual memory in bytes
    -     * 
    - * - * int64 total = 1; - */ - public Builder setTotal(long value) { - - total_ = value; - onChanged(); - return this; - } - /** - *
    -     * Total virtual memory in bytes
    -     * 
    - * - * int64 total = 1; - */ - public Builder clearTotal() { - - total_ = 0L; - onChanged(); - return this; - } - - private long available_ ; - /** - *
    -     * Immediately available memory in bytes
    -     * 
    - * - * int64 available = 2; - */ - public long getAvailable() { - return available_; - } - /** - *
    -     * Immediately available memory in bytes
    -     * 
    - * - * int64 available = 2; - */ - public Builder setAvailable(long value) { - - available_ = value; - onChanged(); - return this; - } - /** - *
    -     * Immediately available memory in bytes
    -     * 
    - * - * int64 available = 2; - */ - public Builder clearAvailable() { - - available_ = 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.MemoryInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MemoryInfo) - private static final org.tensorflow.proto.util.testlog.MemoryInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.MemoryInfo(); - } - - public static org.tensorflow.proto.util.testlog.MemoryInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MemoryInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MemoryInfo(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.util.testlog.MemoryInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfoOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfoOrBuilder.java deleted file mode 100644 index 1700a289e4f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MemoryInfoOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface MemoryInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.MemoryInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Total virtual memory in bytes
    -   * 
    - * - * int64 total = 1; - */ - long getTotal(); - - /** - *
    -   * Immediately available memory in bytes
    -   * 
    - * - * int64 available = 2; - */ - long getAvailable(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntry.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntry.java deleted file mode 100644 index 0ebe3ce31ab..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntry.java +++ /dev/null @@ -1,1107 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.MetricEntry} - */ -public final class MetricEntry extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.MetricEntry) - MetricEntryOrBuilder { -private static final long serialVersionUID = 0L; - // Use MetricEntry.newBuilder() to construct. - private MetricEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MetricEntry() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new MetricEntry(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private MetricEntry( - 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 17: { - - value_ = input.readDouble(); - break; - } - case 26: { - com.google.protobuf.DoubleValue.Builder subBuilder = null; - if (minValue_ != null) { - subBuilder = minValue_.toBuilder(); - } - minValue_ = input.readMessage(com.google.protobuf.DoubleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(minValue_); - minValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - com.google.protobuf.DoubleValue.Builder subBuilder = null; - if (maxValue_ != null) { - subBuilder = maxValue_.toBuilder(); - } - maxValue_ = input.readMessage(com.google.protobuf.DoubleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(maxValue_); - maxValue_ = subBuilder.buildPartial(); - } - - 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.util.testlog.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MetricEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MetricEntry.class, org.tensorflow.proto.util.testlog.MetricEntry.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
    -   * Metric name
    -   * 
    - * - * 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; - } - } - /** - *
    -   * Metric name
    -   * 
    - * - * 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 VALUE_FIELD_NUMBER = 2; - private double value_; - /** - *
    -   * Metric value
    -   * 
    - * - * double value = 2; - */ - public double getValue() { - return value_; - } - - public static final int MIN_VALUE_FIELD_NUMBER = 3; - private com.google.protobuf.DoubleValue minValue_; - /** - *
    -   * The minimum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public boolean hasMinValue() { - return minValue_ != null; - } - /** - *
    -   * The minimum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public com.google.protobuf.DoubleValue getMinValue() { - return minValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; - } - /** - *
    -   * The minimum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public com.google.protobuf.DoubleValueOrBuilder getMinValueOrBuilder() { - return getMinValue(); - } - - public static final int MAX_VALUE_FIELD_NUMBER = 4; - private com.google.protobuf.DoubleValue maxValue_; - /** - *
    -   * The maximum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public boolean hasMaxValue() { - return maxValue_ != null; - } - /** - *
    -   * The maximum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public com.google.protobuf.DoubleValue getMaxValue() { - return maxValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; - } - /** - *
    -   * The maximum acceptable value for the metric if specified
    -   * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public com.google.protobuf.DoubleValueOrBuilder getMaxValueOrBuilder() { - return getMaxValue(); - } - - 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 (value_ != 0D) { - output.writeDouble(2, value_); - } - if (minValue_ != null) { - output.writeMessage(3, getMinValue()); - } - if (maxValue_ != null) { - output.writeMessage(4, getMaxValue()); - } - 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 (value_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, value_); - } - if (minValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getMinValue()); - } - if (maxValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getMaxValue()); - } - 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.util.testlog.MetricEntry)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.MetricEntry other = (org.tensorflow.proto.util.testlog.MetricEntry) obj; - - if (!getName() - .equals(other.getName())) return false; - if (java.lang.Double.doubleToLongBits(getValue()) - != java.lang.Double.doubleToLongBits( - other.getValue())) return false; - if (hasMinValue() != other.hasMinValue()) return false; - if (hasMinValue()) { - if (!getMinValue() - .equals(other.getMinValue())) return false; - } - if (hasMaxValue() != other.hasMaxValue()) return false; - if (hasMaxValue()) { - if (!getMaxValue() - .equals(other.getMaxValue())) 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) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getValue())); - if (hasMinValue()) { - hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getMinValue().hashCode(); - } - if (hasMaxValue()) { - hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getMaxValue().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.MetricEntry parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MetricEntry 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.testlog.MetricEntry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MetricEntry 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.testlog.MetricEntry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.MetricEntry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.MetricEntry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MetricEntry 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.testlog.MetricEntry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MetricEntry 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.testlog.MetricEntry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.MetricEntry 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.util.testlog.MetricEntry 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.MetricEntry} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.MetricEntry) - org.tensorflow.proto.util.testlog.MetricEntryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MetricEntry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.MetricEntry.class, org.tensorflow.proto.util.testlog.MetricEntry.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.MetricEntry.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_ = ""; - - value_ = 0D; - - if (minValueBuilder_ == null) { - minValue_ = null; - } else { - minValue_ = null; - minValueBuilder_ = null; - } - if (maxValueBuilder_ == null) { - maxValue_ = null; - } else { - maxValue_ = null; - maxValueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MetricEntry getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.MetricEntry.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MetricEntry build() { - org.tensorflow.proto.util.testlog.MetricEntry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.MetricEntry buildPartial() { - org.tensorflow.proto.util.testlog.MetricEntry result = new org.tensorflow.proto.util.testlog.MetricEntry(this); - result.name_ = name_; - result.value_ = value_; - if (minValueBuilder_ == null) { - result.minValue_ = minValue_; - } else { - result.minValue_ = minValueBuilder_.build(); - } - if (maxValueBuilder_ == null) { - result.maxValue_ = maxValue_; - } else { - result.maxValue_ = maxValueBuilder_.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.util.testlog.MetricEntry) { - return mergeFrom((org.tensorflow.proto.util.testlog.MetricEntry)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.MetricEntry other) { - if (other == org.tensorflow.proto.util.testlog.MetricEntry.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getValue() != 0D) { - setValue(other.getValue()); - } - if (other.hasMinValue()) { - mergeMinValue(other.getMinValue()); - } - if (other.hasMaxValue()) { - mergeMaxValue(other.getMaxValue()); - } - 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.util.testlog.MetricEntry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.MetricEntry) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Metric name
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Metric name
    -     * 
    - * - * 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; - } - } - /** - *
    -     * Metric name
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Metric name
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Metric name
    -     * 
    - * - * 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 double value_ ; - /** - *
    -     * Metric value
    -     * 
    - * - * double value = 2; - */ - public double getValue() { - return value_; - } - /** - *
    -     * Metric value
    -     * 
    - * - * double value = 2; - */ - public Builder setValue(double value) { - - value_ = value; - onChanged(); - return this; - } - /** - *
    -     * Metric value
    -     * 
    - * - * double value = 2; - */ - public Builder clearValue() { - - value_ = 0D; - onChanged(); - return this; - } - - private com.google.protobuf.DoubleValue minValue_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> minValueBuilder_; - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public boolean hasMinValue() { - return minValueBuilder_ != null || minValue_ != null; - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public com.google.protobuf.DoubleValue getMinValue() { - if (minValueBuilder_ == null) { - return minValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; - } else { - return minValueBuilder_.getMessage(); - } - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public Builder setMinValue(com.google.protobuf.DoubleValue value) { - if (minValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - minValue_ = value; - onChanged(); - } else { - minValueBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public Builder setMinValue( - com.google.protobuf.DoubleValue.Builder builderForValue) { - if (minValueBuilder_ == null) { - minValue_ = builderForValue.build(); - onChanged(); - } else { - minValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public Builder mergeMinValue(com.google.protobuf.DoubleValue value) { - if (minValueBuilder_ == null) { - if (minValue_ != null) { - minValue_ = - com.google.protobuf.DoubleValue.newBuilder(minValue_).mergeFrom(value).buildPartial(); - } else { - minValue_ = value; - } - onChanged(); - } else { - minValueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public Builder clearMinValue() { - if (minValueBuilder_ == null) { - minValue_ = null; - onChanged(); - } else { - minValue_ = null; - minValueBuilder_ = null; - } - - return this; - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public com.google.protobuf.DoubleValue.Builder getMinValueBuilder() { - - onChanged(); - return getMinValueFieldBuilder().getBuilder(); - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - public com.google.protobuf.DoubleValueOrBuilder getMinValueOrBuilder() { - if (minValueBuilder_ != null) { - return minValueBuilder_.getMessageOrBuilder(); - } else { - return minValue_ == null ? - com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; - } - } - /** - *
    -     * The minimum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue min_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> - getMinValueFieldBuilder() { - if (minValueBuilder_ == null) { - minValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder>( - getMinValue(), - getParentForChildren(), - isClean()); - minValue_ = null; - } - return minValueBuilder_; - } - - private com.google.protobuf.DoubleValue maxValue_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> maxValueBuilder_; - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public boolean hasMaxValue() { - return maxValueBuilder_ != null || maxValue_ != null; - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public com.google.protobuf.DoubleValue getMaxValue() { - if (maxValueBuilder_ == null) { - return maxValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; - } else { - return maxValueBuilder_.getMessage(); - } - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public Builder setMaxValue(com.google.protobuf.DoubleValue value) { - if (maxValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - maxValue_ = value; - onChanged(); - } else { - maxValueBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public Builder setMaxValue( - com.google.protobuf.DoubleValue.Builder builderForValue) { - if (maxValueBuilder_ == null) { - maxValue_ = builderForValue.build(); - onChanged(); - } else { - maxValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public Builder mergeMaxValue(com.google.protobuf.DoubleValue value) { - if (maxValueBuilder_ == null) { - if (maxValue_ != null) { - maxValue_ = - com.google.protobuf.DoubleValue.newBuilder(maxValue_).mergeFrom(value).buildPartial(); - } else { - maxValue_ = value; - } - onChanged(); - } else { - maxValueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public Builder clearMaxValue() { - if (maxValueBuilder_ == null) { - maxValue_ = null; - onChanged(); - } else { - maxValue_ = null; - maxValueBuilder_ = null; - } - - return this; - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public com.google.protobuf.DoubleValue.Builder getMaxValueBuilder() { - - onChanged(); - return getMaxValueFieldBuilder().getBuilder(); - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - public com.google.protobuf.DoubleValueOrBuilder getMaxValueOrBuilder() { - if (maxValueBuilder_ != null) { - return maxValueBuilder_.getMessageOrBuilder(); - } else { - return maxValue_ == null ? - com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; - } - } - /** - *
    -     * The maximum acceptable value for the metric if specified
    -     * 
    - * - * .google.protobuf.DoubleValue max_value = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> - getMaxValueFieldBuilder() { - if (maxValueBuilder_ == null) { - maxValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder>( - getMaxValue(), - getParentForChildren(), - isClean()); - maxValue_ = null; - } - return maxValueBuilder_; - } - @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.MetricEntry) - } - - // @@protoc_insertion_point(class_scope:tensorflow.MetricEntry) - private static final org.tensorflow.proto.util.testlog.MetricEntry DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.MetricEntry(); - } - - public static org.tensorflow.proto.util.testlog.MetricEntry getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MetricEntry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MetricEntry(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.util.testlog.MetricEntry getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfo.java deleted file mode 100644 index efe3a52d92e..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfo.java +++ /dev/null @@ -1,1349 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - * Protobuf type {@code tensorflow.PlatformInfo} - */ -public final class PlatformInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.PlatformInfo) - PlatformInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use PlatformInfo.newBuilder() to construct. - private PlatformInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PlatformInfo() { - bits_ = ""; - linkage_ = ""; - machine_ = ""; - release_ = ""; - system_ = ""; - version_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PlatformInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PlatformInfo( - 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(); - - bits_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - linkage_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - machine_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - release_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - system_ = s; - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - version_ = s; - 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.util.testlog.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_PlatformInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.PlatformInfo.class, org.tensorflow.proto.util.testlog.PlatformInfo.Builder.class); - } - - public static final int BITS_FIELD_NUMBER = 1; - private volatile java.lang.Object bits_; - /** - *
    -   * e.g. '64bit'
    -   * 
    - * - * string bits = 1; - */ - public java.lang.String getBits() { - java.lang.Object ref = bits_; - 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(); - bits_ = s; - return s; - } - } - /** - *
    -   * e.g. '64bit'
    -   * 
    - * - * string bits = 1; - */ - public com.google.protobuf.ByteString - getBitsBytes() { - java.lang.Object ref = bits_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - bits_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LINKAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object linkage_; - /** - *
    -   * e.g. 'ELF'
    -   * 
    - * - * string linkage = 2; - */ - public java.lang.String getLinkage() { - java.lang.Object ref = linkage_; - 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(); - linkage_ = s; - return s; - } - } - /** - *
    -   * e.g. 'ELF'
    -   * 
    - * - * string linkage = 2; - */ - public com.google.protobuf.ByteString - getLinkageBytes() { - java.lang.Object ref = linkage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - linkage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MACHINE_FIELD_NUMBER = 3; - private volatile java.lang.Object machine_; - /** - *
    -   * e.g. 'i386'
    -   * 
    - * - * string machine = 3; - */ - public java.lang.String getMachine() { - java.lang.Object ref = machine_; - 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(); - machine_ = s; - return s; - } - } - /** - *
    -   * e.g. 'i386'
    -   * 
    - * - * string machine = 3; - */ - public com.google.protobuf.ByteString - getMachineBytes() { - java.lang.Object ref = machine_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - machine_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RELEASE_FIELD_NUMBER = 4; - private volatile java.lang.Object release_; - /** - *
    -   * e.g. '3.13.0-76-generic'
    -   * 
    - * - * string release = 4; - */ - public java.lang.String getRelease() { - java.lang.Object ref = release_; - 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(); - release_ = s; - return s; - } - } - /** - *
    -   * e.g. '3.13.0-76-generic'
    -   * 
    - * - * string release = 4; - */ - public com.google.protobuf.ByteString - getReleaseBytes() { - java.lang.Object ref = release_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - release_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SYSTEM_FIELD_NUMBER = 5; - private volatile java.lang.Object system_; - /** - *
    -   * e.g. 'Linux'
    -   * 
    - * - * string system = 5; - */ - public java.lang.String getSystem() { - java.lang.Object ref = system_; - 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(); - system_ = s; - return s; - } - } - /** - *
    -   * e.g. 'Linux'
    -   * 
    - * - * string system = 5; - */ - public com.google.protobuf.ByteString - getSystemBytes() { - java.lang.Object ref = system_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - system_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VERSION_FIELD_NUMBER = 6; - private volatile java.lang.Object version_; - /** - *
    -   * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -   * 
    - * - * string version = 6; - */ - public java.lang.String getVersion() { - java.lang.Object ref = version_; - 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(); - version_ = s; - return s; - } - } - /** - *
    -   * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -   * 
    - * - * string version = 6; - */ - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getBitsBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bits_); - } - if (!getLinkageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, linkage_); - } - if (!getMachineBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, machine_); - } - if (!getReleaseBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, release_); - } - if (!getSystemBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, system_); - } - if (!getVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, version_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getBitsBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bits_); - } - if (!getLinkageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, linkage_); - } - if (!getMachineBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, machine_); - } - if (!getReleaseBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, release_); - } - if (!getSystemBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, system_); - } - if (!getVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, version_); - } - 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.util.testlog.PlatformInfo)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.PlatformInfo other = (org.tensorflow.proto.util.testlog.PlatformInfo) obj; - - if (!getBits() - .equals(other.getBits())) return false; - if (!getLinkage() - .equals(other.getLinkage())) return false; - if (!getMachine() - .equals(other.getMachine())) return false; - if (!getRelease() - .equals(other.getRelease())) return false; - if (!getSystem() - .equals(other.getSystem())) return false; - if (!getVersion() - .equals(other.getVersion())) 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) + BITS_FIELD_NUMBER; - hash = (53 * hash) + getBits().hashCode(); - hash = (37 * hash) + LINKAGE_FIELD_NUMBER; - hash = (53 * hash) + getLinkage().hashCode(); - hash = (37 * hash) + MACHINE_FIELD_NUMBER; - hash = (53 * hash) + getMachine().hashCode(); - hash = (37 * hash) + RELEASE_FIELD_NUMBER; - hash = (53 * hash) + getRelease().hashCode(); - hash = (37 * hash) + SYSTEM_FIELD_NUMBER; - hash = (53 * hash) + getSystem().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.PlatformInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo 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.testlog.PlatformInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo 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.testlog.PlatformInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo 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.testlog.PlatformInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo 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.testlog.PlatformInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.PlatformInfo 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.util.testlog.PlatformInfo 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.PlatformInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.PlatformInfo) - org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_PlatformInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.PlatformInfo.class, org.tensorflow.proto.util.testlog.PlatformInfo.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.PlatformInfo.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(); - bits_ = ""; - - linkage_ = ""; - - machine_ = ""; - - release_ = ""; - - system_ = ""; - - version_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.PlatformInfo getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.PlatformInfo.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.PlatformInfo build() { - org.tensorflow.proto.util.testlog.PlatformInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.PlatformInfo buildPartial() { - org.tensorflow.proto.util.testlog.PlatformInfo result = new org.tensorflow.proto.util.testlog.PlatformInfo(this); - result.bits_ = bits_; - result.linkage_ = linkage_; - result.machine_ = machine_; - result.release_ = release_; - result.system_ = system_; - result.version_ = version_; - 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.util.testlog.PlatformInfo) { - return mergeFrom((org.tensorflow.proto.util.testlog.PlatformInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.PlatformInfo other) { - if (other == org.tensorflow.proto.util.testlog.PlatformInfo.getDefaultInstance()) return this; - if (!other.getBits().isEmpty()) { - bits_ = other.bits_; - onChanged(); - } - if (!other.getLinkage().isEmpty()) { - linkage_ = other.linkage_; - onChanged(); - } - if (!other.getMachine().isEmpty()) { - machine_ = other.machine_; - onChanged(); - } - if (!other.getRelease().isEmpty()) { - release_ = other.release_; - onChanged(); - } - if (!other.getSystem().isEmpty()) { - system_ = other.system_; - onChanged(); - } - if (!other.getVersion().isEmpty()) { - version_ = other.version_; - onChanged(); - } - 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.util.testlog.PlatformInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.PlatformInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object bits_ = ""; - /** - *
    -     * e.g. '64bit'
    -     * 
    - * - * string bits = 1; - */ - public java.lang.String getBits() { - java.lang.Object ref = bits_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bits_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. '64bit'
    -     * 
    - * - * string bits = 1; - */ - public com.google.protobuf.ByteString - getBitsBytes() { - java.lang.Object ref = bits_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - bits_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. '64bit'
    -     * 
    - * - * string bits = 1; - */ - public Builder setBits( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bits_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. '64bit'
    -     * 
    - * - * string bits = 1; - */ - public Builder clearBits() { - - bits_ = getDefaultInstance().getBits(); - onChanged(); - return this; - } - /** - *
    -     * e.g. '64bit'
    -     * 
    - * - * string bits = 1; - */ - public Builder setBitsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bits_ = value; - onChanged(); - return this; - } - - private java.lang.Object linkage_ = ""; - /** - *
    -     * e.g. 'ELF'
    -     * 
    - * - * string linkage = 2; - */ - public java.lang.String getLinkage() { - java.lang.Object ref = linkage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - linkage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. 'ELF'
    -     * 
    - * - * string linkage = 2; - */ - public com.google.protobuf.ByteString - getLinkageBytes() { - java.lang.Object ref = linkage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - linkage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. 'ELF'
    -     * 
    - * - * string linkage = 2; - */ - public Builder setLinkage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - linkage_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. 'ELF'
    -     * 
    - * - * string linkage = 2; - */ - public Builder clearLinkage() { - - linkage_ = getDefaultInstance().getLinkage(); - onChanged(); - return this; - } - /** - *
    -     * e.g. 'ELF'
    -     * 
    - * - * string linkage = 2; - */ - public Builder setLinkageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - linkage_ = value; - onChanged(); - return this; - } - - private java.lang.Object machine_ = ""; - /** - *
    -     * e.g. 'i386'
    -     * 
    - * - * string machine = 3; - */ - public java.lang.String getMachine() { - java.lang.Object ref = machine_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - machine_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. 'i386'
    -     * 
    - * - * string machine = 3; - */ - public com.google.protobuf.ByteString - getMachineBytes() { - java.lang.Object ref = machine_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - machine_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. 'i386'
    -     * 
    - * - * string machine = 3; - */ - public Builder setMachine( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - machine_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. 'i386'
    -     * 
    - * - * string machine = 3; - */ - public Builder clearMachine() { - - machine_ = getDefaultInstance().getMachine(); - onChanged(); - return this; - } - /** - *
    -     * e.g. 'i386'
    -     * 
    - * - * string machine = 3; - */ - public Builder setMachineBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - machine_ = value; - onChanged(); - return this; - } - - private java.lang.Object release_ = ""; - /** - *
    -     * e.g. '3.13.0-76-generic'
    -     * 
    - * - * string release = 4; - */ - public java.lang.String getRelease() { - java.lang.Object ref = release_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - release_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. '3.13.0-76-generic'
    -     * 
    - * - * string release = 4; - */ - public com.google.protobuf.ByteString - getReleaseBytes() { - java.lang.Object ref = release_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - release_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. '3.13.0-76-generic'
    -     * 
    - * - * string release = 4; - */ - public Builder setRelease( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - release_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. '3.13.0-76-generic'
    -     * 
    - * - * string release = 4; - */ - public Builder clearRelease() { - - release_ = getDefaultInstance().getRelease(); - onChanged(); - return this; - } - /** - *
    -     * e.g. '3.13.0-76-generic'
    -     * 
    - * - * string release = 4; - */ - public Builder setReleaseBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - release_ = value; - onChanged(); - return this; - } - - private java.lang.Object system_ = ""; - /** - *
    -     * e.g. 'Linux'
    -     * 
    - * - * string system = 5; - */ - public java.lang.String getSystem() { - java.lang.Object ref = system_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - system_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. 'Linux'
    -     * 
    - * - * string system = 5; - */ - public com.google.protobuf.ByteString - getSystemBytes() { - java.lang.Object ref = system_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - system_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. 'Linux'
    -     * 
    - * - * string system = 5; - */ - public Builder setSystem( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - system_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. 'Linux'
    -     * 
    - * - * string system = 5; - */ - public Builder clearSystem() { - - system_ = getDefaultInstance().getSystem(); - onChanged(); - return this; - } - /** - *
    -     * e.g. 'Linux'
    -     * 
    - * - * string system = 5; - */ - public Builder setSystemBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - system_ = value; - onChanged(); - return this; - } - - private java.lang.Object version_ = ""; - /** - *
    -     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -     * 
    - * - * string version = 6; - */ - public java.lang.String getVersion() { - java.lang.Object ref = version_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - version_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -     * 
    - * - * string version = 6; - */ - public com.google.protobuf.ByteString - getVersionBytes() { - java.lang.Object ref = version_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - version_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -     * 
    - * - * string version = 6; - */ - public Builder setVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value; - onChanged(); - return this; - } - /** - *
    -     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -     * 
    - * - * string version = 6; - */ - public Builder clearVersion() { - - version_ = getDefaultInstance().getVersion(); - onChanged(); - return this; - } - /** - *
    -     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    -     * 
    - * - * string version = 6; - */ - public Builder setVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - version_ = value; - 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.PlatformInfo) - } - - // @@protoc_insertion_point(class_scope:tensorflow.PlatformInfo) - private static final org.tensorflow.proto.util.testlog.PlatformInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.PlatformInfo(); - } - - public static org.tensorflow.proto.util.testlog.PlatformInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PlatformInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PlatformInfo(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.util.testlog.PlatformInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfiguration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfiguration.java deleted file mode 100644 index 1ec51529d32..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfiguration.java +++ /dev/null @@ -1,917 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - *
    - * Run-specific items such as arguments to the test / benchmark.
    - * 
    - * - * Protobuf type {@code tensorflow.RunConfiguration} - */ -public final class RunConfiguration extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.RunConfiguration) - RunConfigurationOrBuilder { -private static final long serialVersionUID = 0L; - // Use RunConfiguration.newBuilder() to construct. - private RunConfiguration(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RunConfiguration() { - argument_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RunConfiguration(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RunConfiguration( - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - argument_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - argument_.add(s); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - envVars_ = com.google.protobuf.MapField.newMapField( - EnvVarsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - envVars__ = input.readMessage( - EnvVarsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - envVars_.getMutableMap().put( - envVars__.getKey(), envVars__.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 { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - argument_ = argument_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetEnvVars(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.RunConfiguration.class, org.tensorflow.proto.util.testlog.RunConfiguration.Builder.class); - } - - public static final int ARGUMENT_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList argument_; - /** - * repeated string argument = 1; - */ - public com.google.protobuf.ProtocolStringList - getArgumentList() { - return argument_; - } - /** - * repeated string argument = 1; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated string argument = 1; - */ - public java.lang.String getArgument(int index) { - return argument_.get(index); - } - /** - * repeated string argument = 1; - */ - public com.google.protobuf.ByteString - getArgumentBytes(int index) { - return argument_.getByteString(index); - } - - public static final int ENV_VARS_FIELD_NUMBER = 2; - private static final class EnvVarsDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> envVars_; - private com.google.protobuf.MapField - internalGetEnvVars() { - if (envVars_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EnvVarsDefaultEntryHolder.defaultEntry); - } - return envVars_; - } - - public int getEnvVarsCount() { - return internalGetEnvVars().getMap().size(); - } - /** - *
    -   * Environment variables used to run the test/benchmark.
    -   * 
    - * - * map<string, string> env_vars = 2; - */ - - public boolean containsEnvVars( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetEnvVars().getMap().containsKey(key); - } - /** - * Use {@link #getEnvVarsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEnvVars() { - return getEnvVarsMap(); - } - /** - *
    -   * Environment variables used to run the test/benchmark.
    -   * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.util.Map getEnvVarsMap() { - return internalGetEnvVars().getMap(); - } - /** - *
    -   * Environment variables used to run the test/benchmark.
    -   * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.lang.String getEnvVarsOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvVars().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -   * Environment variables used to run the test/benchmark.
    -   * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.lang.String getEnvVarsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvVars().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 { - for (int i = 0; i < argument_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, argument_.getRaw(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetEnvVars(), - EnvVarsDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < argument_.size(); i++) { - dataSize += computeStringSizeNoTag(argument_.getRaw(i)); - } - size += dataSize; - size += 1 * getArgumentList().size(); - } - for (java.util.Map.Entry entry - : internalGetEnvVars().getMap().entrySet()) { - com.google.protobuf.MapEntry - envVars__ = EnvVarsDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, envVars__); - } - 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.util.testlog.RunConfiguration)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.RunConfiguration other = (org.tensorflow.proto.util.testlog.RunConfiguration) obj; - - if (!getArgumentList() - .equals(other.getArgumentList())) return false; - if (!internalGetEnvVars().equals( - other.internalGetEnvVars())) 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 (getArgumentCount() > 0) { - hash = (37 * hash) + ARGUMENT_FIELD_NUMBER; - hash = (53 * hash) + getArgumentList().hashCode(); - } - if (!internalGetEnvVars().getMap().isEmpty()) { - hash = (37 * hash) + ENV_VARS_FIELD_NUMBER; - hash = (53 * hash) + internalGetEnvVars().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.RunConfiguration parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration 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.testlog.RunConfiguration parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration 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.testlog.RunConfiguration parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration 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.testlog.RunConfiguration parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration 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.testlog.RunConfiguration parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.RunConfiguration 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.util.testlog.RunConfiguration 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; - } - /** - *
    -   * Run-specific items such as arguments to the test / benchmark.
    -   * 
    - * - * Protobuf type {@code tensorflow.RunConfiguration} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.RunConfiguration) - org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetEnvVars(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableEnvVars(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.RunConfiguration.class, org.tensorflow.proto.util.testlog.RunConfiguration.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.RunConfiguration.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(); - argument_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableEnvVars().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.RunConfiguration getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.RunConfiguration.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.RunConfiguration build() { - org.tensorflow.proto.util.testlog.RunConfiguration result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.RunConfiguration buildPartial() { - org.tensorflow.proto.util.testlog.RunConfiguration result = new org.tensorflow.proto.util.testlog.RunConfiguration(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - argument_ = argument_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.argument_ = argument_; - result.envVars_ = internalGetEnvVars(); - result.envVars_.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.util.testlog.RunConfiguration) { - return mergeFrom((org.tensorflow.proto.util.testlog.RunConfiguration)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.RunConfiguration other) { - if (other == org.tensorflow.proto.util.testlog.RunConfiguration.getDefaultInstance()) return this; - if (!other.argument_.isEmpty()) { - if (argument_.isEmpty()) { - argument_ = other.argument_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureArgumentIsMutable(); - argument_.addAll(other.argument_); - } - onChanged(); - } - internalGetMutableEnvVars().mergeFrom( - other.internalGetEnvVars()); - 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.util.testlog.RunConfiguration parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.RunConfiguration) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList argument_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureArgumentIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - argument_ = new com.google.protobuf.LazyStringArrayList(argument_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string argument = 1; - */ - public com.google.protobuf.ProtocolStringList - getArgumentList() { - return argument_.getUnmodifiableView(); - } - /** - * repeated string argument = 1; - */ - public int getArgumentCount() { - return argument_.size(); - } - /** - * repeated string argument = 1; - */ - public java.lang.String getArgument(int index) { - return argument_.get(index); - } - /** - * repeated string argument = 1; - */ - public com.google.protobuf.ByteString - getArgumentBytes(int index) { - return argument_.getByteString(index); - } - /** - * repeated string argument = 1; - */ - public Builder setArgument( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string argument = 1; - */ - public Builder addArgument( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgumentIsMutable(); - argument_.add(value); - onChanged(); - return this; - } - /** - * repeated string argument = 1; - */ - public Builder addAllArgument( - java.lang.Iterable values) { - ensureArgumentIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, argument_); - onChanged(); - return this; - } - /** - * repeated string argument = 1; - */ - public Builder clearArgument() { - argument_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string argument = 1; - */ - public Builder addArgumentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureArgumentIsMutable(); - argument_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> envVars_; - private com.google.protobuf.MapField - internalGetEnvVars() { - if (envVars_ == null) { - return com.google.protobuf.MapField.emptyMapField( - EnvVarsDefaultEntryHolder.defaultEntry); - } - return envVars_; - } - private com.google.protobuf.MapField - internalGetMutableEnvVars() { - onChanged();; - if (envVars_ == null) { - envVars_ = com.google.protobuf.MapField.newMapField( - EnvVarsDefaultEntryHolder.defaultEntry); - } - if (!envVars_.isMutable()) { - envVars_ = envVars_.copy(); - } - return envVars_; - } - - public int getEnvVarsCount() { - return internalGetEnvVars().getMap().size(); - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public boolean containsEnvVars( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetEnvVars().getMap().containsKey(key); - } - /** - * Use {@link #getEnvVarsMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getEnvVars() { - return getEnvVarsMap(); - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.util.Map getEnvVarsMap() { - return internalGetEnvVars().getMap(); - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.lang.String getEnvVarsOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvVars().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public java.lang.String getEnvVarsOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetEnvVars().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearEnvVars() { - internalGetMutableEnvVars().getMutableMap() - .clear(); - return this; - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public Builder removeEnvVars( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableEnvVars().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableEnvVars() { - return internalGetMutableEnvVars().getMutableMap(); - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - public Builder putEnvVars( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableEnvVars().getMutableMap() - .put(key, value); - return this; - } - /** - *
    -     * Environment variables used to run the test/benchmark.
    -     * 
    - * - * map<string, string> env_vars = 2; - */ - - public Builder putAllEnvVars( - java.util.Map values) { - internalGetMutableEnvVars().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.RunConfiguration) - } - - // @@protoc_insertion_point(class_scope:tensorflow.RunConfiguration) - private static final org.tensorflow.proto.util.testlog.RunConfiguration DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.RunConfiguration(); - } - - public static org.tensorflow.proto.util.testlog.RunConfiguration getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RunConfiguration parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RunConfiguration(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.util.testlog.RunConfiguration getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestLogProtos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestLogProtos.java deleted file mode 100644 index bb4033abe44..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestLogProtos.java +++ /dev/null @@ -1,288 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public final class TestLogProtos { - private TestLogProtos() {} - 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_EntryValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_EntryValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MetricEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MetricEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BenchmarkEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BenchmarkEntries_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_BuildConfiguration_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_BuildConfiguration_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CommitId_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CommitId_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CPUInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CPUInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_CPUInfo_CacheSizeEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MemoryInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MemoryInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_GPUInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_GPUInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_PlatformInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_PlatformInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_AvailableDeviceInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_MachineConfiguration_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_MachineConfiguration_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunConfiguration_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunConfiguration_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_RunConfiguration_EnvVarsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TestResults_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TestResults_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/util/test_log.proto\022\nt" + - "ensorflow\032\031google/protobuf/any.proto\032\036go" + - "ogle/protobuf/wrappers.proto\"D\n\nEntryVal" + - "ue\022\026\n\014double_value\030\001 \001(\001H\000\022\026\n\014string_val" + - "ue\030\002 \001(\tH\000B\006\n\004kind\"\214\001\n\013MetricEntry\022\014\n\004na" + - "me\030\001 \001(\t\022\r\n\005value\030\002 \001(\001\022/\n\tmin_value\030\003 \001" + - "(\0132\034.google.protobuf.DoubleValue\022/\n\tmax_" + - "value\030\004 \001(\0132\034.google.protobuf.DoubleValu" + - "e\"\217\002\n\016BenchmarkEntry\022\014\n\004name\030\001 \001(\t\022\r\n\005it" + - "ers\030\002 \001(\003\022\020\n\010cpu_time\030\003 \001(\001\022\021\n\twall_time" + - "\030\004 \001(\001\022\022\n\nthroughput\030\005 \001(\001\0226\n\006extras\030\006 \003" + - "(\0132&.tensorflow.BenchmarkEntry.ExtrasEnt" + - "ry\022(\n\007metrics\030\007 \003(\0132\027.tensorflow.MetricE" + - "ntry\032E\n\013ExtrasEntry\022\013\n\003key\030\001 \001(\t\022%\n\005valu" + - "e\030\002 \001(\0132\026.tensorflow.EntryValue:\0028\001\"=\n\020B" + - "enchmarkEntries\022)\n\005entry\030\001 \003(\0132\032.tensorf" + - "low.BenchmarkEntry\"B\n\022BuildConfiguration" + - "\022\014\n\004mode\030\001 \001(\t\022\020\n\010cc_flags\030\002 \003(\t\022\014\n\004opts" + - "\030\003 \003(\t\"f\n\010CommitId\022\024\n\nchangelist\030\001 \001(\003H\000" + - "\022\016\n\004hash\030\002 \001(\tH\000\022\020\n\010snapshot\030\003 \001(\t\022\032\n\022pe" + - "nding_changelist\030\004 \001(\003B\006\n\004kind\"\336\001\n\007CPUIn" + - "fo\022\021\n\tnum_cores\030\001 \001(\003\022\031\n\021num_cores_allow" + - "ed\030\002 \001(\003\022\023\n\013mhz_per_cpu\030\003 \001(\001\022\020\n\010cpu_inf" + - "o\030\004 \001(\t\022\024\n\014cpu_governor\030\005 \001(\t\0226\n\ncache_s" + - "ize\030\006 \003(\0132\".tensorflow.CPUInfo.CacheSize" + - "Entry\0320\n\016CacheSizeEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + - "value\030\002 \001(\003:\0028\001\".\n\nMemoryInfo\022\r\n\005total\030\001" + - " \001(\003\022\021\n\tavailable\030\002 \001(\003\"6\n\007GPUInfo\022\r\n\005mo" + - "del\030\001 \001(\t\022\014\n\004uuid\030\002 \001(\t\022\016\n\006bus_id\030\003 \001(\t\"" + - "p\n\014PlatformInfo\022\014\n\004bits\030\001 \001(\t\022\017\n\007linkage" + - "\030\002 \001(\t\022\017\n\007machine\030\003 \001(\t\022\017\n\007release\030\004 \001(\t" + - "\022\016\n\006system\030\005 \001(\t\022\017\n\007version\030\006 \001(\t\"e\n\023Ava" + - "ilableDeviceInfo\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002" + - " \001(\t\022\024\n\014memory_limit\030\003 \001(\003\022\034\n\024physical_d" + - "escription\030\004 \001(\t\"\263\002\n\024MachineConfiguratio" + - "n\022\020\n\010hostname\030\001 \001(\t\022\031\n\021serial_identifier" + - "\030\007 \001(\t\022/\n\rplatform_info\030\002 \001(\0132\030.tensorfl" + - "ow.PlatformInfo\022%\n\010cpu_info\030\003 \001(\0132\023.tens" + - "orflow.CPUInfo\022)\n\013device_info\030\004 \003(\0132\024.go" + - "ogle.protobuf.Any\022>\n\025available_device_in" + - "fo\030\005 \003(\0132\037.tensorflow.AvailableDeviceInf" + - "o\022+\n\013memory_info\030\006 \001(\0132\026.tensorflow.Memo" + - "ryInfo\"\221\001\n\020RunConfiguration\022\020\n\010argument\030" + - "\001 \003(\t\022;\n\010env_vars\030\002 \003(\0132).tensorflow.Run" + - "Configuration.EnvVarsEntry\032.\n\014EnvVarsEnt" + - "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\320\004\n\013T" + - "estResults\022\016\n\006target\030\001 \001(\t\022-\n\007entries\030\002 " + - "\001(\0132\034.tensorflow.BenchmarkEntries\022;\n\023bui" + - "ld_configuration\030\003 \001(\0132\036.tensorflow.Buil" + - "dConfiguration\022\'\n\tcommit_id\030\004 \001(\0132\024.tens" + - "orflow.CommitId\022\022\n\nstart_time\030\005 \001(\003\022\020\n\010r" + - "un_time\030\006 \001(\001\022?\n\025machine_configuration\030\007" + - " \001(\0132 .tensorflow.MachineConfiguration\0227" + - "\n\021run_configuration\030\010 \001(\0132\034.tensorflow.R" + - "unConfiguration\022\014\n\004name\030\t \001(\t\022=\n\016benchma" + - "rk_type\030\n \001(\0162%.tensorflow.TestResults.B" + - "enchmarkType\022\020\n\010run_mode\030\013 \001(\t\022\022\n\ntf_ver" + - "sion\030\014 \001(\t\"\210\001\n\rBenchmarkType\022\013\n\007UNKNOWN\020" + - "\000\022\026\n\022CPP_MICROBENCHMARK\020\001\022\024\n\020PYTHON_BENC" + - "HMARK\020\002\022\025\n\021ANDROID_BENCHMARK\020\003\022\022\n\016EDGE_B" + - "ENCHMARK\020\004\022\021\n\rIOS_BENCHMARK\020\005B7\n!org.ten" + - "sorflow.proto.util.testlogB\rTestLogProto" + - "sP\001\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.AnyProto.getDescriptor(), - com.google.protobuf.WrappersProto.getDescriptor(), - }); - internal_static_tensorflow_EntryValue_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_EntryValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_EntryValue_descriptor, - new java.lang.String[] { "DoubleValue", "StringValue", "Kind", }); - internal_static_tensorflow_MetricEntry_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_MetricEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MetricEntry_descriptor, - new java.lang.String[] { "Name", "Value", "MinValue", "MaxValue", }); - internal_static_tensorflow_BenchmarkEntry_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BenchmarkEntry_descriptor, - new java.lang.String[] { "Name", "Iters", "CpuTime", "WallTime", "Throughput", "Extras", "Metrics", }); - internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor = - internal_static_tensorflow_BenchmarkEntry_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_BenchmarkEntries_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BenchmarkEntries_descriptor, - new java.lang.String[] { "Entry", }); - internal_static_tensorflow_BuildConfiguration_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_tensorflow_BuildConfiguration_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_BuildConfiguration_descriptor, - new java.lang.String[] { "Mode", "CcFlags", "Opts", }); - internal_static_tensorflow_CommitId_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_tensorflow_CommitId_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CommitId_descriptor, - new java.lang.String[] { "Changelist", "Hash", "Snapshot", "PendingChangelist", "Kind", }); - internal_static_tensorflow_CPUInfo_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_tensorflow_CPUInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CPUInfo_descriptor, - new java.lang.String[] { "NumCores", "NumCoresAllowed", "MhzPerCpu", "CpuInfo", "CpuGovernor", "CacheSize", }); - internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor = - internal_static_tensorflow_CPUInfo_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_CPUInfo_CacheSizeEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_MemoryInfo_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_tensorflow_MemoryInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MemoryInfo_descriptor, - new java.lang.String[] { "Total", "Available", }); - internal_static_tensorflow_GPUInfo_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_tensorflow_GPUInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_GPUInfo_descriptor, - new java.lang.String[] { "Model", "Uuid", "BusId", }); - internal_static_tensorflow_PlatformInfo_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_tensorflow_PlatformInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_PlatformInfo_descriptor, - new java.lang.String[] { "Bits", "Linkage", "Machine", "Release", "System", "Version", }); - internal_static_tensorflow_AvailableDeviceInfo_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AvailableDeviceInfo_descriptor, - new java.lang.String[] { "Name", "Type", "MemoryLimit", "PhysicalDescription", }); - internal_static_tensorflow_MachineConfiguration_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_tensorflow_MachineConfiguration_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_MachineConfiguration_descriptor, - new java.lang.String[] { "Hostname", "SerialIdentifier", "PlatformInfo", "CpuInfo", "DeviceInfo", "AvailableDeviceInfo", "MemoryInfo", }); - internal_static_tensorflow_RunConfiguration_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_tensorflow_RunConfiguration_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunConfiguration_descriptor, - new java.lang.String[] { "Argument", "EnvVars", }); - internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor = - internal_static_tensorflow_RunConfiguration_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_RunConfiguration_EnvVarsEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_tensorflow_TestResults_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_tensorflow_TestResults_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TestResults_descriptor, - new java.lang.String[] { "Target", "Entries", "BuildConfiguration", "CommitId", "StartTime", "RunTime", "MachineConfiguration", "RunConfiguration", "Name", "BenchmarkType", "RunMode", "TfVersion", }); - com.google.protobuf.AnyProto.getDescriptor(); - com.google.protobuf.WrappersProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResults.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResults.java deleted file mode 100644 index 15ae63f6d31..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResults.java +++ /dev/null @@ -1,2624 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -/** - *
    - * The output of one benchmark / test run.  Each run contains a list of
    - * tests or benchmarks, stored as BenchmarkEntry messages.
    - * This message should be emitted by the reporter (which runs the
    - * test / BM in a subprocess and then reads the emitted BenchmarkEntry messages;
    - * usually from a serialized json file, finally collecting them along
    - * with additional information about the test run.
    - * 
    - * - * Protobuf type {@code tensorflow.TestResults} - */ -public final class TestResults extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TestResults) - TestResultsOrBuilder { -private static final long serialVersionUID = 0L; - // Use TestResults.newBuilder() to construct. - private TestResults(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TestResults() { - target_ = ""; - name_ = ""; - benchmarkType_ = 0; - runMode_ = ""; - tfVersion_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TestResults(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TestResults( - 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(); - - target_ = s; - break; - } - case 18: { - org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder subBuilder = null; - if (entries_ != null) { - subBuilder = entries_.toBuilder(); - } - entries_ = input.readMessage(org.tensorflow.proto.util.testlog.BenchmarkEntries.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(entries_); - entries_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - org.tensorflow.proto.util.testlog.BuildConfiguration.Builder subBuilder = null; - if (buildConfiguration_ != null) { - subBuilder = buildConfiguration_.toBuilder(); - } - buildConfiguration_ = input.readMessage(org.tensorflow.proto.util.testlog.BuildConfiguration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(buildConfiguration_); - buildConfiguration_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - org.tensorflow.proto.util.testlog.CommitId.Builder subBuilder = null; - if (commitId_ != null) { - subBuilder = commitId_.toBuilder(); - } - commitId_ = input.readMessage(org.tensorflow.proto.util.testlog.CommitId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(commitId_); - commitId_ = subBuilder.buildPartial(); - } - - break; - } - case 40: { - - startTime_ = input.readInt64(); - break; - } - case 49: { - - runTime_ = input.readDouble(); - break; - } - case 58: { - org.tensorflow.proto.util.testlog.MachineConfiguration.Builder subBuilder = null; - if (machineConfiguration_ != null) { - subBuilder = machineConfiguration_.toBuilder(); - } - machineConfiguration_ = input.readMessage(org.tensorflow.proto.util.testlog.MachineConfiguration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(machineConfiguration_); - machineConfiguration_ = subBuilder.buildPartial(); - } - - break; - } - case 66: { - org.tensorflow.proto.util.testlog.RunConfiguration.Builder subBuilder = null; - if (runConfiguration_ != null) { - subBuilder = runConfiguration_.toBuilder(); - } - runConfiguration_ = input.readMessage(org.tensorflow.proto.util.testlog.RunConfiguration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(runConfiguration_); - runConfiguration_ = subBuilder.buildPartial(); - } - - break; - } - case 74: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 80: { - int rawValue = input.readEnum(); - - benchmarkType_ = rawValue; - break; - } - case 90: { - java.lang.String s = input.readStringRequireUtf8(); - - runMode_ = s; - break; - } - case 98: { - java.lang.String s = input.readStringRequireUtf8(); - - tfVersion_ = s; - 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.util.testlog.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_TestResults_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.TestResults.class, org.tensorflow.proto.util.testlog.TestResults.Builder.class); - } - - /** - *
    -   * The type of benchmark.
    -   * 
    - * - * Protobuf enum {@code tensorflow.TestResults.BenchmarkType} - */ - public enum BenchmarkType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * Fallback for protos written before Type was introduced.
    -     * 
    - * - * UNKNOWN = 0; - */ - UNKNOWN(0), - /** - * CPP_MICROBENCHMARK = 1; - */ - CPP_MICROBENCHMARK(1), - /** - * PYTHON_BENCHMARK = 2; - */ - PYTHON_BENCHMARK(2), - /** - * ANDROID_BENCHMARK = 3; - */ - ANDROID_BENCHMARK(3), - /** - * EDGE_BENCHMARK = 4; - */ - EDGE_BENCHMARK(4), - /** - * IOS_BENCHMARK = 5; - */ - IOS_BENCHMARK(5), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * Fallback for protos written before Type was introduced.
    -     * 
    - * - * UNKNOWN = 0; - */ - public static final int UNKNOWN_VALUE = 0; - /** - * CPP_MICROBENCHMARK = 1; - */ - public static final int CPP_MICROBENCHMARK_VALUE = 1; - /** - * PYTHON_BENCHMARK = 2; - */ - public static final int PYTHON_BENCHMARK_VALUE = 2; - /** - * ANDROID_BENCHMARK = 3; - */ - public static final int ANDROID_BENCHMARK_VALUE = 3; - /** - * EDGE_BENCHMARK = 4; - */ - public static final int EDGE_BENCHMARK_VALUE = 4; - /** - * IOS_BENCHMARK = 5; - */ - public static final int IOS_BENCHMARK_VALUE = 5; - - - 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 BenchmarkType valueOf(int value) { - return forNumber(value); - } - - public static BenchmarkType forNumber(int value) { - switch (value) { - case 0: return UNKNOWN; - case 1: return CPP_MICROBENCHMARK; - case 2: return PYTHON_BENCHMARK; - case 3: return ANDROID_BENCHMARK; - case 4: return EDGE_BENCHMARK; - case 5: return IOS_BENCHMARK; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - BenchmarkType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public BenchmarkType findValueByNumber(int number) { - return BenchmarkType.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.util.testlog.TestResults.getDescriptor().getEnumTypes().get(0); - } - - private static final BenchmarkType[] VALUES = values(); - - public static BenchmarkType 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 BenchmarkType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.TestResults.BenchmarkType) - } - - public static final int TARGET_FIELD_NUMBER = 1; - private volatile java.lang.Object target_; - /** - *
    -   * The target of the run, e.g.:
    -   *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -   * 
    - * - * string target = 1; - */ - public java.lang.String getTarget() { - java.lang.Object ref = target_; - 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(); - target_ = s; - return s; - } - } - /** - *
    -   * The target of the run, e.g.:
    -   *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -   * 
    - * - * string target = 1; - */ - public com.google.protobuf.ByteString - getTargetBytes() { - java.lang.Object ref = target_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - target_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENTRIES_FIELD_NUMBER = 2; - private org.tensorflow.proto.util.testlog.BenchmarkEntries entries_; - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public boolean hasEntries() { - return entries_ != null; - } - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntries getEntries() { - return entries_ == null ? org.tensorflow.proto.util.testlog.BenchmarkEntries.getDefaultInstance() : entries_; - } - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder getEntriesOrBuilder() { - return getEntries(); - } - - public static final int BUILD_CONFIGURATION_FIELD_NUMBER = 3; - private org.tensorflow.proto.util.testlog.BuildConfiguration buildConfiguration_; - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public boolean hasBuildConfiguration() { - return buildConfiguration_ != null; - } - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public org.tensorflow.proto.util.testlog.BuildConfiguration getBuildConfiguration() { - return buildConfiguration_ == null ? org.tensorflow.proto.util.testlog.BuildConfiguration.getDefaultInstance() : buildConfiguration_; - } - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder() { - return getBuildConfiguration(); - } - - public static final int COMMIT_ID_FIELD_NUMBER = 4; - private org.tensorflow.proto.util.testlog.CommitId commitId_; - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public boolean hasCommitId() { - return commitId_ != null; - } - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public org.tensorflow.proto.util.testlog.CommitId getCommitId() { - return commitId_ == null ? org.tensorflow.proto.util.testlog.CommitId.getDefaultInstance() : commitId_; - } - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public org.tensorflow.proto.util.testlog.CommitIdOrBuilder getCommitIdOrBuilder() { - return getCommitId(); - } - - public static final int START_TIME_FIELD_NUMBER = 5; - private long startTime_; - /** - *
    -   * The time the run started (in seconds of UTC time since Unix epoch)
    -   * 
    - * - * int64 start_time = 5; - */ - public long getStartTime() { - return startTime_; - } - - public static final int RUN_TIME_FIELD_NUMBER = 6; - private double runTime_; - /** - *
    -   * The amount of time the total run took (wall time in seconds)
    -   * 
    - * - * double run_time = 6; - */ - public double getRunTime() { - return runTime_; - } - - public static final int MACHINE_CONFIGURATION_FIELD_NUMBER = 7; - private org.tensorflow.proto.util.testlog.MachineConfiguration machineConfiguration_; - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public boolean hasMachineConfiguration() { - return machineConfiguration_ != null; - } - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public org.tensorflow.proto.util.testlog.MachineConfiguration getMachineConfiguration() { - return machineConfiguration_ == null ? org.tensorflow.proto.util.testlog.MachineConfiguration.getDefaultInstance() : machineConfiguration_; - } - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder() { - return getMachineConfiguration(); - } - - public static final int RUN_CONFIGURATION_FIELD_NUMBER = 8; - private org.tensorflow.proto.util.testlog.RunConfiguration runConfiguration_; - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public boolean hasRunConfiguration() { - return runConfiguration_ != null; - } - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public org.tensorflow.proto.util.testlog.RunConfiguration getRunConfiguration() { - return runConfiguration_ == null ? org.tensorflow.proto.util.testlog.RunConfiguration.getDefaultInstance() : runConfiguration_; - } - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder getRunConfigurationOrBuilder() { - return getRunConfiguration(); - } - - public static final int NAME_FIELD_NUMBER = 9; - private volatile java.lang.Object name_; - /** - *
    -   * Benchmark target identifier.
    -   * 
    - * - * string name = 9; - */ - 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; - } - } - /** - *
    -   * Benchmark target identifier.
    -   * 
    - * - * string name = 9; - */ - 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 BENCHMARK_TYPE_FIELD_NUMBER = 10; - private int benchmarkType_; - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public int getBenchmarkTypeValue() { - return benchmarkType_; - } - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public org.tensorflow.proto.util.testlog.TestResults.BenchmarkType getBenchmarkType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.testlog.TestResults.BenchmarkType result = org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.valueOf(benchmarkType_); - return result == null ? org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.UNRECOGNIZED : result; - } - - public static final int RUN_MODE_FIELD_NUMBER = 11; - private volatile java.lang.Object runMode_; - /** - *
    -   * Used for differentiating between continuous and debug builds.
    -   * Must be one of:
    -   * * cbuild: results from continuous build.
    -   * * presubmit: results from oneshot requests.
    -   * * culprit: results from culprit finder rerun.
    -   * 
    - * - * string run_mode = 11; - */ - public java.lang.String getRunMode() { - java.lang.Object ref = runMode_; - 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(); - runMode_ = s; - return s; - } - } - /** - *
    -   * Used for differentiating between continuous and debug builds.
    -   * Must be one of:
    -   * * cbuild: results from continuous build.
    -   * * presubmit: results from oneshot requests.
    -   * * culprit: results from culprit finder rerun.
    -   * 
    - * - * string run_mode = 11; - */ - public com.google.protobuf.ByteString - getRunModeBytes() { - java.lang.Object ref = runMode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - runMode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TF_VERSION_FIELD_NUMBER = 12; - private volatile java.lang.Object tfVersion_; - /** - *
    -   * TensorFlow version this benchmark runs against.
    -   * This can be either set to full version or just the major version.
    -   * 
    - * - * string tf_version = 12; - */ - public java.lang.String getTfVersion() { - java.lang.Object ref = tfVersion_; - 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(); - tfVersion_ = s; - return s; - } - } - /** - *
    -   * TensorFlow version this benchmark runs against.
    -   * This can be either set to full version or just the major version.
    -   * 
    - * - * string tf_version = 12; - */ - public com.google.protobuf.ByteString - getTfVersionBytes() { - java.lang.Object ref = tfVersion_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - 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 (!getTargetBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, target_); - } - if (entries_ != null) { - output.writeMessage(2, getEntries()); - } - if (buildConfiguration_ != null) { - output.writeMessage(3, getBuildConfiguration()); - } - if (commitId_ != null) { - output.writeMessage(4, getCommitId()); - } - if (startTime_ != 0L) { - output.writeInt64(5, startTime_); - } - if (runTime_ != 0D) { - output.writeDouble(6, runTime_); - } - if (machineConfiguration_ != null) { - output.writeMessage(7, getMachineConfiguration()); - } - if (runConfiguration_ != null) { - output.writeMessage(8, getRunConfiguration()); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, name_); - } - if (benchmarkType_ != org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.UNKNOWN.getNumber()) { - output.writeEnum(10, benchmarkType_); - } - if (!getRunModeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, runMode_); - } - if (!getTfVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, tfVersion_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTargetBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, target_); - } - if (entries_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getEntries()); - } - if (buildConfiguration_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getBuildConfiguration()); - } - if (commitId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getCommitId()); - } - if (startTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, startTime_); - } - if (runTime_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(6, runTime_); - } - if (machineConfiguration_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getMachineConfiguration()); - } - if (runConfiguration_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getRunConfiguration()); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, name_); - } - if (benchmarkType_ != org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(10, benchmarkType_); - } - if (!getRunModeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, runMode_); - } - if (!getTfVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, tfVersion_); - } - 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.util.testlog.TestResults)) { - return super.equals(obj); - } - org.tensorflow.proto.util.testlog.TestResults other = (org.tensorflow.proto.util.testlog.TestResults) obj; - - if (!getTarget() - .equals(other.getTarget())) return false; - if (hasEntries() != other.hasEntries()) return false; - if (hasEntries()) { - if (!getEntries() - .equals(other.getEntries())) return false; - } - if (hasBuildConfiguration() != other.hasBuildConfiguration()) return false; - if (hasBuildConfiguration()) { - if (!getBuildConfiguration() - .equals(other.getBuildConfiguration())) return false; - } - if (hasCommitId() != other.hasCommitId()) return false; - if (hasCommitId()) { - if (!getCommitId() - .equals(other.getCommitId())) return false; - } - if (getStartTime() - != other.getStartTime()) return false; - if (java.lang.Double.doubleToLongBits(getRunTime()) - != java.lang.Double.doubleToLongBits( - other.getRunTime())) return false; - if (hasMachineConfiguration() != other.hasMachineConfiguration()) return false; - if (hasMachineConfiguration()) { - if (!getMachineConfiguration() - .equals(other.getMachineConfiguration())) return false; - } - if (hasRunConfiguration() != other.hasRunConfiguration()) return false; - if (hasRunConfiguration()) { - if (!getRunConfiguration() - .equals(other.getRunConfiguration())) return false; - } - if (!getName() - .equals(other.getName())) return false; - if (benchmarkType_ != other.benchmarkType_) return false; - if (!getRunMode() - .equals(other.getRunMode())) return false; - if (!getTfVersion() - .equals(other.getTfVersion())) 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) + TARGET_FIELD_NUMBER; - hash = (53 * hash) + getTarget().hashCode(); - if (hasEntries()) { - hash = (37 * hash) + ENTRIES_FIELD_NUMBER; - hash = (53 * hash) + getEntries().hashCode(); - } - if (hasBuildConfiguration()) { - hash = (37 * hash) + BUILD_CONFIGURATION_FIELD_NUMBER; - hash = (53 * hash) + getBuildConfiguration().hashCode(); - } - if (hasCommitId()) { - hash = (37 * hash) + COMMIT_ID_FIELD_NUMBER; - hash = (53 * hash) + getCommitId().hashCode(); - } - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStartTime()); - hash = (37 * hash) + RUN_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getRunTime())); - if (hasMachineConfiguration()) { - hash = (37 * hash) + MACHINE_CONFIGURATION_FIELD_NUMBER; - hash = (53 * hash) + getMachineConfiguration().hashCode(); - } - if (hasRunConfiguration()) { - hash = (37 * hash) + RUN_CONFIGURATION_FIELD_NUMBER; - hash = (53 * hash) + getRunConfiguration().hashCode(); - } - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + BENCHMARK_TYPE_FIELD_NUMBER; - hash = (53 * hash) + benchmarkType_; - hash = (37 * hash) + RUN_MODE_FIELD_NUMBER; - hash = (53 * hash) + getRunMode().hashCode(); - hash = (37 * hash) + TF_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getTfVersion().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.tensorflow.proto.util.testlog.TestResults parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.TestResults 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.testlog.TestResults parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.TestResults 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.testlog.TestResults parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.tensorflow.proto.util.testlog.TestResults parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.tensorflow.proto.util.testlog.TestResults parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.TestResults 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.testlog.TestResults parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.TestResults 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.testlog.TestResults parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.tensorflow.proto.util.testlog.TestResults 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.util.testlog.TestResults 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; - } - /** - *
    -   * The output of one benchmark / test run.  Each run contains a list of
    -   * tests or benchmarks, stored as BenchmarkEntry messages.
    -   * This message should be emitted by the reporter (which runs the
    -   * test / BM in a subprocess and then reads the emitted BenchmarkEntry messages;
    -   * usually from a serialized json file, finally collecting them along
    -   * with additional information about the test run.
    -   * 
    - * - * Protobuf type {@code tensorflow.TestResults} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TestResults) - org.tensorflow.proto.util.testlog.TestResultsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_TestResults_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.tensorflow.proto.util.testlog.TestResults.class, org.tensorflow.proto.util.testlog.TestResults.Builder.class); - } - - // Construct using org.tensorflow.proto.util.testlog.TestResults.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(); - target_ = ""; - - if (entriesBuilder_ == null) { - entries_ = null; - } else { - entries_ = null; - entriesBuilder_ = null; - } - if (buildConfigurationBuilder_ == null) { - buildConfiguration_ = null; - } else { - buildConfiguration_ = null; - buildConfigurationBuilder_ = null; - } - if (commitIdBuilder_ == null) { - commitId_ = null; - } else { - commitId_ = null; - commitIdBuilder_ = null; - } - startTime_ = 0L; - - runTime_ = 0D; - - if (machineConfigurationBuilder_ == null) { - machineConfiguration_ = null; - } else { - machineConfiguration_ = null; - machineConfigurationBuilder_ = null; - } - if (runConfigurationBuilder_ == null) { - runConfiguration_ = null; - } else { - runConfiguration_ = null; - runConfigurationBuilder_ = null; - } - name_ = ""; - - benchmarkType_ = 0; - - runMode_ = ""; - - tfVersion_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.tensorflow.proto.util.testlog.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.TestResults getDefaultInstanceForType() { - return org.tensorflow.proto.util.testlog.TestResults.getDefaultInstance(); - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.TestResults build() { - org.tensorflow.proto.util.testlog.TestResults result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.tensorflow.proto.util.testlog.TestResults buildPartial() { - org.tensorflow.proto.util.testlog.TestResults result = new org.tensorflow.proto.util.testlog.TestResults(this); - result.target_ = target_; - if (entriesBuilder_ == null) { - result.entries_ = entries_; - } else { - result.entries_ = entriesBuilder_.build(); - } - if (buildConfigurationBuilder_ == null) { - result.buildConfiguration_ = buildConfiguration_; - } else { - result.buildConfiguration_ = buildConfigurationBuilder_.build(); - } - if (commitIdBuilder_ == null) { - result.commitId_ = commitId_; - } else { - result.commitId_ = commitIdBuilder_.build(); - } - result.startTime_ = startTime_; - result.runTime_ = runTime_; - if (machineConfigurationBuilder_ == null) { - result.machineConfiguration_ = machineConfiguration_; - } else { - result.machineConfiguration_ = machineConfigurationBuilder_.build(); - } - if (runConfigurationBuilder_ == null) { - result.runConfiguration_ = runConfiguration_; - } else { - result.runConfiguration_ = runConfigurationBuilder_.build(); - } - result.name_ = name_; - result.benchmarkType_ = benchmarkType_; - result.runMode_ = runMode_; - result.tfVersion_ = tfVersion_; - 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.util.testlog.TestResults) { - return mergeFrom((org.tensorflow.proto.util.testlog.TestResults)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.tensorflow.proto.util.testlog.TestResults other) { - if (other == org.tensorflow.proto.util.testlog.TestResults.getDefaultInstance()) return this; - if (!other.getTarget().isEmpty()) { - target_ = other.target_; - onChanged(); - } - if (other.hasEntries()) { - mergeEntries(other.getEntries()); - } - if (other.hasBuildConfiguration()) { - mergeBuildConfiguration(other.getBuildConfiguration()); - } - if (other.hasCommitId()) { - mergeCommitId(other.getCommitId()); - } - if (other.getStartTime() != 0L) { - setStartTime(other.getStartTime()); - } - if (other.getRunTime() != 0D) { - setRunTime(other.getRunTime()); - } - if (other.hasMachineConfiguration()) { - mergeMachineConfiguration(other.getMachineConfiguration()); - } - if (other.hasRunConfiguration()) { - mergeRunConfiguration(other.getRunConfiguration()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.benchmarkType_ != 0) { - setBenchmarkTypeValue(other.getBenchmarkTypeValue()); - } - if (!other.getRunMode().isEmpty()) { - runMode_ = other.runMode_; - onChanged(); - } - if (!other.getTfVersion().isEmpty()) { - tfVersion_ = other.tfVersion_; - onChanged(); - } - 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.util.testlog.TestResults parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.tensorflow.proto.util.testlog.TestResults) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object target_ = ""; - /** - *
    -     * The target of the run, e.g.:
    -     *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -     * 
    - * - * string target = 1; - */ - public java.lang.String getTarget() { - java.lang.Object ref = target_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - target_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * The target of the run, e.g.:
    -     *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -     * 
    - * - * string target = 1; - */ - public com.google.protobuf.ByteString - getTargetBytes() { - java.lang.Object ref = target_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - target_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * The target of the run, e.g.:
    -     *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -     * 
    - * - * string target = 1; - */ - public Builder setTarget( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - target_ = value; - onChanged(); - return this; - } - /** - *
    -     * The target of the run, e.g.:
    -     *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -     * 
    - * - * string target = 1; - */ - public Builder clearTarget() { - - target_ = getDefaultInstance().getTarget(); - onChanged(); - return this; - } - /** - *
    -     * The target of the run, e.g.:
    -     *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -     * 
    - * - * string target = 1; - */ - public Builder setTargetBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - target_ = value; - onChanged(); - return this; - } - - private org.tensorflow.proto.util.testlog.BenchmarkEntries entries_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntries, org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder> entriesBuilder_; - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public boolean hasEntries() { - return entriesBuilder_ != null || entries_ != null; - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntries getEntries() { - if (entriesBuilder_ == null) { - return entries_ == null ? org.tensorflow.proto.util.testlog.BenchmarkEntries.getDefaultInstance() : entries_; - } else { - return entriesBuilder_.getMessage(); - } - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public Builder setEntries(org.tensorflow.proto.util.testlog.BenchmarkEntries value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - entries_ = value; - onChanged(); - } else { - entriesBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public Builder setEntries( - org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder builderForValue) { - if (entriesBuilder_ == null) { - entries_ = builderForValue.build(); - onChanged(); - } else { - entriesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public Builder mergeEntries(org.tensorflow.proto.util.testlog.BenchmarkEntries value) { - if (entriesBuilder_ == null) { - if (entries_ != null) { - entries_ = - org.tensorflow.proto.util.testlog.BenchmarkEntries.newBuilder(entries_).mergeFrom(value).buildPartial(); - } else { - entries_ = value; - } - onChanged(); - } else { - entriesBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public Builder clearEntries() { - if (entriesBuilder_ == null) { - entries_ = null; - onChanged(); - } else { - entries_ = null; - entriesBuilder_ = null; - } - - return this; - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder getEntriesBuilder() { - - onChanged(); - return getEntriesFieldBuilder().getBuilder(); - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - public org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder getEntriesOrBuilder() { - if (entriesBuilder_ != null) { - return entriesBuilder_.getMessageOrBuilder(); - } else { - return entries_ == null ? - org.tensorflow.proto.util.testlog.BenchmarkEntries.getDefaultInstance() : entries_; - } - } - /** - *
    -     * The list of tests or benchmarks in this run.
    -     * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntries, org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder> - getEntriesFieldBuilder() { - if (entriesBuilder_ == null) { - entriesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BenchmarkEntries, org.tensorflow.proto.util.testlog.BenchmarkEntries.Builder, org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder>( - getEntries(), - getParentForChildren(), - isClean()); - entries_ = null; - } - return entriesBuilder_; - } - - private org.tensorflow.proto.util.testlog.BuildConfiguration buildConfiguration_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BuildConfiguration, org.tensorflow.proto.util.testlog.BuildConfiguration.Builder, org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder> buildConfigurationBuilder_; - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public boolean hasBuildConfiguration() { - return buildConfigurationBuilder_ != null || buildConfiguration_ != null; - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public org.tensorflow.proto.util.testlog.BuildConfiguration getBuildConfiguration() { - if (buildConfigurationBuilder_ == null) { - return buildConfiguration_ == null ? org.tensorflow.proto.util.testlog.BuildConfiguration.getDefaultInstance() : buildConfiguration_; - } else { - return buildConfigurationBuilder_.getMessage(); - } - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public Builder setBuildConfiguration(org.tensorflow.proto.util.testlog.BuildConfiguration value) { - if (buildConfigurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - buildConfiguration_ = value; - onChanged(); - } else { - buildConfigurationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public Builder setBuildConfiguration( - org.tensorflow.proto.util.testlog.BuildConfiguration.Builder builderForValue) { - if (buildConfigurationBuilder_ == null) { - buildConfiguration_ = builderForValue.build(); - onChanged(); - } else { - buildConfigurationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public Builder mergeBuildConfiguration(org.tensorflow.proto.util.testlog.BuildConfiguration value) { - if (buildConfigurationBuilder_ == null) { - if (buildConfiguration_ != null) { - buildConfiguration_ = - org.tensorflow.proto.util.testlog.BuildConfiguration.newBuilder(buildConfiguration_).mergeFrom(value).buildPartial(); - } else { - buildConfiguration_ = value; - } - onChanged(); - } else { - buildConfigurationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public Builder clearBuildConfiguration() { - if (buildConfigurationBuilder_ == null) { - buildConfiguration_ = null; - onChanged(); - } else { - buildConfiguration_ = null; - buildConfigurationBuilder_ = null; - } - - return this; - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public org.tensorflow.proto.util.testlog.BuildConfiguration.Builder getBuildConfigurationBuilder() { - - onChanged(); - return getBuildConfigurationFieldBuilder().getBuilder(); - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - public org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder() { - if (buildConfigurationBuilder_ != null) { - return buildConfigurationBuilder_.getMessageOrBuilder(); - } else { - return buildConfiguration_ == null ? - org.tensorflow.proto.util.testlog.BuildConfiguration.getDefaultInstance() : buildConfiguration_; - } - } - /** - *
    -     * The configuration of the build (compiled opt? with cuda? any copts?)
    -     * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BuildConfiguration, org.tensorflow.proto.util.testlog.BuildConfiguration.Builder, org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder> - getBuildConfigurationFieldBuilder() { - if (buildConfigurationBuilder_ == null) { - buildConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.BuildConfiguration, org.tensorflow.proto.util.testlog.BuildConfiguration.Builder, org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder>( - getBuildConfiguration(), - getParentForChildren(), - isClean()); - buildConfiguration_ = null; - } - return buildConfigurationBuilder_; - } - - private org.tensorflow.proto.util.testlog.CommitId commitId_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CommitId, org.tensorflow.proto.util.testlog.CommitId.Builder, org.tensorflow.proto.util.testlog.CommitIdOrBuilder> commitIdBuilder_; - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public boolean hasCommitId() { - return commitIdBuilder_ != null || commitId_ != null; - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public org.tensorflow.proto.util.testlog.CommitId getCommitId() { - if (commitIdBuilder_ == null) { - return commitId_ == null ? org.tensorflow.proto.util.testlog.CommitId.getDefaultInstance() : commitId_; - } else { - return commitIdBuilder_.getMessage(); - } - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public Builder setCommitId(org.tensorflow.proto.util.testlog.CommitId value) { - if (commitIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - commitId_ = value; - onChanged(); - } else { - commitIdBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public Builder setCommitId( - org.tensorflow.proto.util.testlog.CommitId.Builder builderForValue) { - if (commitIdBuilder_ == null) { - commitId_ = builderForValue.build(); - onChanged(); - } else { - commitIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public Builder mergeCommitId(org.tensorflow.proto.util.testlog.CommitId value) { - if (commitIdBuilder_ == null) { - if (commitId_ != null) { - commitId_ = - org.tensorflow.proto.util.testlog.CommitId.newBuilder(commitId_).mergeFrom(value).buildPartial(); - } else { - commitId_ = value; - } - onChanged(); - } else { - commitIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public Builder clearCommitId() { - if (commitIdBuilder_ == null) { - commitId_ = null; - onChanged(); - } else { - commitId_ = null; - commitIdBuilder_ = null; - } - - return this; - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public org.tensorflow.proto.util.testlog.CommitId.Builder getCommitIdBuilder() { - - onChanged(); - return getCommitIdFieldBuilder().getBuilder(); - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - public org.tensorflow.proto.util.testlog.CommitIdOrBuilder getCommitIdOrBuilder() { - if (commitIdBuilder_ != null) { - return commitIdBuilder_.getMessageOrBuilder(); - } else { - return commitId_ == null ? - org.tensorflow.proto.util.testlog.CommitId.getDefaultInstance() : commitId_; - } - } - /** - *
    -     * The commit id (git hash or changelist)
    -     * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CommitId, org.tensorflow.proto.util.testlog.CommitId.Builder, org.tensorflow.proto.util.testlog.CommitIdOrBuilder> - getCommitIdFieldBuilder() { - if (commitIdBuilder_ == null) { - commitIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.CommitId, org.tensorflow.proto.util.testlog.CommitId.Builder, org.tensorflow.proto.util.testlog.CommitIdOrBuilder>( - getCommitId(), - getParentForChildren(), - isClean()); - commitId_ = null; - } - return commitIdBuilder_; - } - - private long startTime_ ; - /** - *
    -     * The time the run started (in seconds of UTC time since Unix epoch)
    -     * 
    - * - * int64 start_time = 5; - */ - public long getStartTime() { - return startTime_; - } - /** - *
    -     * The time the run started (in seconds of UTC time since Unix epoch)
    -     * 
    - * - * int64 start_time = 5; - */ - public Builder setStartTime(long value) { - - startTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * The time the run started (in seconds of UTC time since Unix epoch)
    -     * 
    - * - * int64 start_time = 5; - */ - public Builder clearStartTime() { - - startTime_ = 0L; - onChanged(); - return this; - } - - private double runTime_ ; - /** - *
    -     * The amount of time the total run took (wall time in seconds)
    -     * 
    - * - * double run_time = 6; - */ - public double getRunTime() { - return runTime_; - } - /** - *
    -     * The amount of time the total run took (wall time in seconds)
    -     * 
    - * - * double run_time = 6; - */ - public Builder setRunTime(double value) { - - runTime_ = value; - onChanged(); - return this; - } - /** - *
    -     * The amount of time the total run took (wall time in seconds)
    -     * 
    - * - * double run_time = 6; - */ - public Builder clearRunTime() { - - runTime_ = 0D; - onChanged(); - return this; - } - - private org.tensorflow.proto.util.testlog.MachineConfiguration machineConfiguration_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MachineConfiguration, org.tensorflow.proto.util.testlog.MachineConfiguration.Builder, org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder> machineConfigurationBuilder_; - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public boolean hasMachineConfiguration() { - return machineConfigurationBuilder_ != null || machineConfiguration_ != null; - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public org.tensorflow.proto.util.testlog.MachineConfiguration getMachineConfiguration() { - if (machineConfigurationBuilder_ == null) { - return machineConfiguration_ == null ? org.tensorflow.proto.util.testlog.MachineConfiguration.getDefaultInstance() : machineConfiguration_; - } else { - return machineConfigurationBuilder_.getMessage(); - } - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public Builder setMachineConfiguration(org.tensorflow.proto.util.testlog.MachineConfiguration value) { - if (machineConfigurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - machineConfiguration_ = value; - onChanged(); - } else { - machineConfigurationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public Builder setMachineConfiguration( - org.tensorflow.proto.util.testlog.MachineConfiguration.Builder builderForValue) { - if (machineConfigurationBuilder_ == null) { - machineConfiguration_ = builderForValue.build(); - onChanged(); - } else { - machineConfigurationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public Builder mergeMachineConfiguration(org.tensorflow.proto.util.testlog.MachineConfiguration value) { - if (machineConfigurationBuilder_ == null) { - if (machineConfiguration_ != null) { - machineConfiguration_ = - org.tensorflow.proto.util.testlog.MachineConfiguration.newBuilder(machineConfiguration_).mergeFrom(value).buildPartial(); - } else { - machineConfiguration_ = value; - } - onChanged(); - } else { - machineConfigurationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public Builder clearMachineConfiguration() { - if (machineConfigurationBuilder_ == null) { - machineConfiguration_ = null; - onChanged(); - } else { - machineConfiguration_ = null; - machineConfigurationBuilder_ = null; - } - - return this; - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public org.tensorflow.proto.util.testlog.MachineConfiguration.Builder getMachineConfigurationBuilder() { - - onChanged(); - return getMachineConfigurationFieldBuilder().getBuilder(); - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - public org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder() { - if (machineConfigurationBuilder_ != null) { - return machineConfigurationBuilder_.getMessageOrBuilder(); - } else { - return machineConfiguration_ == null ? - org.tensorflow.proto.util.testlog.MachineConfiguration.getDefaultInstance() : machineConfiguration_; - } - } - /** - *
    -     * Machine-specific parameters (Platform and CPU info)
    -     * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MachineConfiguration, org.tensorflow.proto.util.testlog.MachineConfiguration.Builder, org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder> - getMachineConfigurationFieldBuilder() { - if (machineConfigurationBuilder_ == null) { - machineConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.MachineConfiguration, org.tensorflow.proto.util.testlog.MachineConfiguration.Builder, org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder>( - getMachineConfiguration(), - getParentForChildren(), - isClean()); - machineConfiguration_ = null; - } - return machineConfigurationBuilder_; - } - - private org.tensorflow.proto.util.testlog.RunConfiguration runConfiguration_; - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.RunConfiguration, org.tensorflow.proto.util.testlog.RunConfiguration.Builder, org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder> runConfigurationBuilder_; - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public boolean hasRunConfiguration() { - return runConfigurationBuilder_ != null || runConfiguration_ != null; - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public org.tensorflow.proto.util.testlog.RunConfiguration getRunConfiguration() { - if (runConfigurationBuilder_ == null) { - return runConfiguration_ == null ? org.tensorflow.proto.util.testlog.RunConfiguration.getDefaultInstance() : runConfiguration_; - } else { - return runConfigurationBuilder_.getMessage(); - } - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public Builder setRunConfiguration(org.tensorflow.proto.util.testlog.RunConfiguration value) { - if (runConfigurationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - runConfiguration_ = value; - onChanged(); - } else { - runConfigurationBuilder_.setMessage(value); - } - - return this; - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public Builder setRunConfiguration( - org.tensorflow.proto.util.testlog.RunConfiguration.Builder builderForValue) { - if (runConfigurationBuilder_ == null) { - runConfiguration_ = builderForValue.build(); - onChanged(); - } else { - runConfigurationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public Builder mergeRunConfiguration(org.tensorflow.proto.util.testlog.RunConfiguration value) { - if (runConfigurationBuilder_ == null) { - if (runConfiguration_ != null) { - runConfiguration_ = - org.tensorflow.proto.util.testlog.RunConfiguration.newBuilder(runConfiguration_).mergeFrom(value).buildPartial(); - } else { - runConfiguration_ = value; - } - onChanged(); - } else { - runConfigurationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public Builder clearRunConfiguration() { - if (runConfigurationBuilder_ == null) { - runConfiguration_ = null; - onChanged(); - } else { - runConfiguration_ = null; - runConfigurationBuilder_ = null; - } - - return this; - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public org.tensorflow.proto.util.testlog.RunConfiguration.Builder getRunConfigurationBuilder() { - - onChanged(); - return getRunConfigurationFieldBuilder().getBuilder(); - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - public org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder getRunConfigurationOrBuilder() { - if (runConfigurationBuilder_ != null) { - return runConfigurationBuilder_.getMessageOrBuilder(); - } else { - return runConfiguration_ == null ? - org.tensorflow.proto.util.testlog.RunConfiguration.getDefaultInstance() : runConfiguration_; - } - } - /** - *
    -     * Run-specific parameters (arguments, etc)
    -     * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.RunConfiguration, org.tensorflow.proto.util.testlog.RunConfiguration.Builder, org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder> - getRunConfigurationFieldBuilder() { - if (runConfigurationBuilder_ == null) { - runConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.tensorflow.proto.util.testlog.RunConfiguration, org.tensorflow.proto.util.testlog.RunConfiguration.Builder, org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder>( - getRunConfiguration(), - getParentForChildren(), - isClean()); - runConfiguration_ = null; - } - return runConfigurationBuilder_; - } - - private java.lang.Object name_ = ""; - /** - *
    -     * Benchmark target identifier.
    -     * 
    - * - * string name = 9; - */ - 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; - } - } - /** - *
    -     * Benchmark target identifier.
    -     * 
    - * - * string name = 9; - */ - 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; - } - } - /** - *
    -     * Benchmark target identifier.
    -     * 
    - * - * string name = 9; - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
    -     * Benchmark target identifier.
    -     * 
    - * - * string name = 9; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Benchmark target identifier.
    -     * 
    - * - * string name = 9; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int benchmarkType_ = 0; - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public int getBenchmarkTypeValue() { - return benchmarkType_; - } - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public Builder setBenchmarkTypeValue(int value) { - benchmarkType_ = value; - onChanged(); - return this; - } - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public org.tensorflow.proto.util.testlog.TestResults.BenchmarkType getBenchmarkType() { - @SuppressWarnings("deprecation") - org.tensorflow.proto.util.testlog.TestResults.BenchmarkType result = org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.valueOf(benchmarkType_); - return result == null ? org.tensorflow.proto.util.testlog.TestResults.BenchmarkType.UNRECOGNIZED : result; - } - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public Builder setBenchmarkType(org.tensorflow.proto.util.testlog.TestResults.BenchmarkType value) { - if (value == null) { - throw new NullPointerException(); - } - - benchmarkType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - public Builder clearBenchmarkType() { - - benchmarkType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object runMode_ = ""; - /** - *
    -     * Used for differentiating between continuous and debug builds.
    -     * Must be one of:
    -     * * cbuild: results from continuous build.
    -     * * presubmit: results from oneshot requests.
    -     * * culprit: results from culprit finder rerun.
    -     * 
    - * - * string run_mode = 11; - */ - public java.lang.String getRunMode() { - java.lang.Object ref = runMode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - runMode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * Used for differentiating between continuous and debug builds.
    -     * Must be one of:
    -     * * cbuild: results from continuous build.
    -     * * presubmit: results from oneshot requests.
    -     * * culprit: results from culprit finder rerun.
    -     * 
    - * - * string run_mode = 11; - */ - public com.google.protobuf.ByteString - getRunModeBytes() { - java.lang.Object ref = runMode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - runMode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * Used for differentiating between continuous and debug builds.
    -     * Must be one of:
    -     * * cbuild: results from continuous build.
    -     * * presubmit: results from oneshot requests.
    -     * * culprit: results from culprit finder rerun.
    -     * 
    - * - * string run_mode = 11; - */ - public Builder setRunMode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - runMode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Used for differentiating between continuous and debug builds.
    -     * Must be one of:
    -     * * cbuild: results from continuous build.
    -     * * presubmit: results from oneshot requests.
    -     * * culprit: results from culprit finder rerun.
    -     * 
    - * - * string run_mode = 11; - */ - public Builder clearRunMode() { - - runMode_ = getDefaultInstance().getRunMode(); - onChanged(); - return this; - } - /** - *
    -     * Used for differentiating between continuous and debug builds.
    -     * Must be one of:
    -     * * cbuild: results from continuous build.
    -     * * presubmit: results from oneshot requests.
    -     * * culprit: results from culprit finder rerun.
    -     * 
    - * - * string run_mode = 11; - */ - public Builder setRunModeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - runMode_ = value; - onChanged(); - return this; - } - - private java.lang.Object tfVersion_ = ""; - /** - *
    -     * TensorFlow version this benchmark runs against.
    -     * This can be either set to full version or just the major version.
    -     * 
    - * - * string tf_version = 12; - */ - public java.lang.String getTfVersion() { - java.lang.Object ref = tfVersion_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tfVersion_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
    -     * TensorFlow version this benchmark runs against.
    -     * This can be either set to full version or just the major version.
    -     * 
    - * - * string tf_version = 12; - */ - public com.google.protobuf.ByteString - getTfVersionBytes() { - java.lang.Object ref = tfVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tfVersion_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
    -     * TensorFlow version this benchmark runs against.
    -     * This can be either set to full version or just the major version.
    -     * 
    - * - * string tf_version = 12; - */ - public Builder setTfVersion( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tfVersion_ = value; - onChanged(); - return this; - } - /** - *
    -     * TensorFlow version this benchmark runs against.
    -     * This can be either set to full version or just the major version.
    -     * 
    - * - * string tf_version = 12; - */ - public Builder clearTfVersion() { - - tfVersion_ = getDefaultInstance().getTfVersion(); - onChanged(); - return this; - } - /** - *
    -     * TensorFlow version this benchmark runs against.
    -     * This can be either set to full version or just the major version.
    -     * 
    - * - * string tf_version = 12; - */ - public Builder setTfVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tfVersion_ = value; - 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.TestResults) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TestResults) - private static final org.tensorflow.proto.util.testlog.TestResults DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.tensorflow.proto.util.testlog.TestResults(); - } - - public static org.tensorflow.proto.util.testlog.TestResults getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TestResults parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TestResults(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.util.testlog.TestResults getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResultsOrBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResultsOrBuilder.java deleted file mode 100644 index 28ef5b7bfd0..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/TestResultsOrBuilder.java +++ /dev/null @@ -1,245 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto - -package org.tensorflow.proto.util.testlog; - -public interface TestResultsOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TestResults) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * The target of the run, e.g.:
    -   *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -   * 
    - * - * string target = 1; - */ - java.lang.String getTarget(); - /** - *
    -   * The target of the run, e.g.:
    -   *  //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    -   * 
    - * - * string target = 1; - */ - com.google.protobuf.ByteString - getTargetBytes(); - - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - boolean hasEntries(); - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - org.tensorflow.proto.util.testlog.BenchmarkEntries getEntries(); - /** - *
    -   * The list of tests or benchmarks in this run.
    -   * 
    - * - * .tensorflow.BenchmarkEntries entries = 2; - */ - org.tensorflow.proto.util.testlog.BenchmarkEntriesOrBuilder getEntriesOrBuilder(); - - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - boolean hasBuildConfiguration(); - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - org.tensorflow.proto.util.testlog.BuildConfiguration getBuildConfiguration(); - /** - *
    -   * The configuration of the build (compiled opt? with cuda? any copts?)
    -   * 
    - * - * .tensorflow.BuildConfiguration build_configuration = 3; - */ - org.tensorflow.proto.util.testlog.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder(); - - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - boolean hasCommitId(); - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - org.tensorflow.proto.util.testlog.CommitId getCommitId(); - /** - *
    -   * The commit id (git hash or changelist)
    -   * 
    - * - * .tensorflow.CommitId commit_id = 4; - */ - org.tensorflow.proto.util.testlog.CommitIdOrBuilder getCommitIdOrBuilder(); - - /** - *
    -   * The time the run started (in seconds of UTC time since Unix epoch)
    -   * 
    - * - * int64 start_time = 5; - */ - long getStartTime(); - - /** - *
    -   * The amount of time the total run took (wall time in seconds)
    -   * 
    - * - * double run_time = 6; - */ - double getRunTime(); - - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - boolean hasMachineConfiguration(); - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - org.tensorflow.proto.util.testlog.MachineConfiguration getMachineConfiguration(); - /** - *
    -   * Machine-specific parameters (Platform and CPU info)
    -   * 
    - * - * .tensorflow.MachineConfiguration machine_configuration = 7; - */ - org.tensorflow.proto.util.testlog.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder(); - - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - boolean hasRunConfiguration(); - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - org.tensorflow.proto.util.testlog.RunConfiguration getRunConfiguration(); - /** - *
    -   * Run-specific parameters (arguments, etc)
    -   * 
    - * - * .tensorflow.RunConfiguration run_configuration = 8; - */ - org.tensorflow.proto.util.testlog.RunConfigurationOrBuilder getRunConfigurationOrBuilder(); - - /** - *
    -   * Benchmark target identifier.
    -   * 
    - * - * string name = 9; - */ - java.lang.String getName(); - /** - *
    -   * Benchmark target identifier.
    -   * 
    - * - * string name = 9; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - int getBenchmarkTypeValue(); - /** - * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; - */ - org.tensorflow.proto.util.testlog.TestResults.BenchmarkType getBenchmarkType(); - - /** - *
    -   * Used for differentiating between continuous and debug builds.
    -   * Must be one of:
    -   * * cbuild: results from continuous build.
    -   * * presubmit: results from oneshot requests.
    -   * * culprit: results from culprit finder rerun.
    -   * 
    - * - * string run_mode = 11; - */ - java.lang.String getRunMode(); - /** - *
    -   * Used for differentiating between continuous and debug builds.
    -   * Must be one of:
    -   * * cbuild: results from continuous build.
    -   * * presubmit: results from oneshot requests.
    -   * * culprit: results from culprit finder rerun.
    -   * 
    - * - * string run_mode = 11; - */ - com.google.protobuf.ByteString - getRunModeBytes(); - - /** - *
    -   * TensorFlow version this benchmark runs against.
    -   * This can be either set to full version or just the major version.
    -   * 
    - * - * string tf_version = 12; - */ - java.lang.String getTfVersion(); - /** - *
    -   * TensorFlow version this benchmark runs against.
    -   * This can be either set to full version or just the major version.
    -   * 
    - * - * string tf_version = 12; - */ - com.google.protobuf.ByteString - getTfVersionBytes(); -} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/resources/ops.pb b/tensorflow-core/tensorflow-core-api/src/gen/resources/ops.pb deleted file mode 100644 index ff27424bb23..00000000000 Binary files a/tensorflow-core/tensorflow-core-api/src/gen/resources/ops.pb and /dev/null differ diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/module-info.java b/tensorflow-core/tensorflow-core-api/src/main/java/module-info.java new file mode 100644 index 00000000000..b12e7042b48 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/module-info.java @@ -0,0 +1,56 @@ +/* +Copyright 2022 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. +======================================================================= +*/ + +/** Core module implementing the TensorFlow Java API and operator definitions. */ +module tensorflow { + requires transitive org.tensorflow.ndarray; + requires transitive tensorflow.nativelib; + requires java.logging; + + exports org.tensorflow; + exports org.tensorflow.types; + exports org.tensorflow.types.annotation; + exports org.tensorflow.types.family; + exports org.tensorflow.op; + exports org.tensorflow.op.annotation; + exports org.tensorflow.op.core; + exports org.tensorflow.op.audio; + exports org.tensorflow.op.bitwise; + exports org.tensorflow.op.cluster; + exports org.tensorflow.op.collective; + exports org.tensorflow.op.data; + exports org.tensorflow.op.data.experimental; + exports org.tensorflow.op.debugging; + exports org.tensorflow.op.dtypes; + exports org.tensorflow.op.image; + exports org.tensorflow.op.io; + exports org.tensorflow.op.linalg; + exports org.tensorflow.op.linalg.sparse; + exports org.tensorflow.op.math; + exports org.tensorflow.op.math.special; + exports org.tensorflow.op.nn; + exports org.tensorflow.op.quantization; + exports org.tensorflow.op.ragged; + exports org.tensorflow.op.random; + exports org.tensorflow.op.signal; + exports org.tensorflow.op.sparse; + exports org.tensorflow.op.strings; + exports org.tensorflow.op.summary; + exports org.tensorflow.op.tpu; + exports org.tensorflow.op.train; + exports org.tensorflow.op.xla; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractGradientAdapter.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractGradientAdapter.java new file mode 100644 index 00000000000..94f82786ed3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractGradientAdapter.java @@ -0,0 +1,111 @@ +/* + Copyright 2024 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. +============================================================================== +*/ +package org.tensorflow; + +import java.util.ArrayList; +import java.util.List; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.PointerPointer; +import org.bytedeco.javacpp.PointerScope; +import org.tensorflow.internal.c_api.TFJ_GradFuncAdapter; +import org.tensorflow.internal.c_api.TFJ_GraphId; +import org.tensorflow.internal.c_api.TFJ_Scope; +import org.tensorflow.internal.c_api.TF_Operation; +import org.tensorflow.internal.c_api.TF_Output; + +/** Helper base class for custom gradient adapters INTERNAL USE ONLY */ +public abstract class AbstractGradientAdapter extends TFJ_GradFuncAdapter { + + protected AbstractGradientAdapter() { + super(); + } + + protected abstract List> apply( + Graph graph, TFJ_Scope scope, GraphOperation operation, List> gradInputs); + + @Override + public int call( + TFJ_GraphId nativeGraphId, + TFJ_Scope nativeScope, + TF_Operation nativeOperation, + TF_Output nativeGradInputs, + int nativeGradInputsLength, + PointerPointer nativeGradOutputsPtr) { + try (PointerScope callScope = new PointerScope()) { + var graph = Graph.findGraph(nativeGraphId); + var operation = new GraphOperation(graph, nativeOperation); + var gradInputs = fromNativeOutputs(graph, nativeGradInputs, nativeGradInputsLength); + + // The graph locks are not re-entrant, so attempting to add an op to a graph that has been + // locked by the gradient builder will fail without this. + graph.setDangerousGradientBuilder(true); + List> gradOutputs = apply(graph, nativeScope, operation, gradInputs); + graph.setDangerousGradientBuilder(false); + + nativeGradOutputsPtr.put(toNativeOutputs(gradOutputs)); + return gradOutputs.size(); + } + } + + /** + * Convert an array of native outputs to a list of {@link Output}s. + * + * @param g the graph the outputs are in + * @param nativeOutputs array of outputs + * @param length number of outputs + * @return a list of Outputs + */ + private static List> fromNativeOutputs(Graph g, TF_Output nativeOutputs, int length) { + List> outputs = new ArrayList<>(length); + for (int i = 0; i < length; ++i) { + var nativeOutput = nativeOutputs.position(i); + outputs.add( + i, new Output<>(new GraphOperation(g, nativeOutput.oper()), nativeOutput.index())); + } + return outputs; + } + + /** + * Put the Java outputs into the array of native outputs, resizing it to the necessary size. + * + * @param outputs the outputs to put + * @return pointer to the native array of outputs + */ + private static TF_Output toNativeOutputs(List> outputs) { + // Use malloc to allocate native outputs, as they will be freed by the native layer and we do + // not want JavaCPP to deallocate them + var nativeOutputs = + new TF_Output(Pointer.malloc((long) outputs.size() * Pointer.sizeof(TF_Output.class))); + + for (int i = 0; i < outputs.size(); ++i) { + Operand operand = outputs.get(i); + var nativeOutput = nativeOutputs.getPointer(i); + + // Convention: null Operand => NoGradient + if (operand == null) { + nativeOutput.oper((TF_Operation) null); + nativeOutput.index(0); + continue; + } + + var output = operand.asOutput(); + nativeOutput.oper(((GraphOperation) output.op()).getUnsafeNativeHandle()); + nativeOutput.index(output.index()); + } + return nativeOutputs; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java index 3d390d33406..9b45ecd4d69 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java @@ -17,7 +17,7 @@ import org.bytedeco.javacpp.Pointer; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -43,7 +43,11 @@ public Output output(int idx) { int numOutputs = this.numOutputs(); if (idx >= numOutputs) { throw new IndexOutOfBoundsException( - "Can't get output with index " + idx + ", this op only has " + numOutputs + " outputs."); + "Can't get output with index " + + idx + + ", this op only has " + + numOutputs + + " outputs."); } if (idx < 0) { diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ConcreteFunction.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ConcreteFunction.java index 4d07b678811..79be3210158 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ConcreteFunction.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ConcreteFunction.java @@ -1,4 +1,4 @@ -/* Copyright 2020-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2020-2022 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. @@ -44,13 +44,13 @@ import org.tensorflow.op.core.PartitionedCall; import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.core.PlaceholderWithDefault; -import org.tensorflow.proto.framework.AttrValue; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.FunctionDef; -import org.tensorflow.proto.framework.OpDef.ArgDef; -import org.tensorflow.proto.framework.SignatureDef; -import org.tensorflow.proto.framework.TensorInfo; -import org.tensorflow.proto.framework.TensorShapeProto; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.FunctionDef; +import org.tensorflow.proto.OpDef.ArgDef; +import org.tensorflow.proto.SignatureDef; +import org.tensorflow.proto.TensorInfo; +import org.tensorflow.proto.TensorShapeProto; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; @@ -295,8 +295,8 @@ public Operand call(Scope scope, Operand argument) { } @Override - public Map call(Map arguments) { - // FIXME need to manage input/output operand lifetimes + public Result call(Map arguments) { + // FIXME need to manage input operand lifetimes Ops tf = Ops.create(); Map> inputs = new LinkedHashMap<>(arguments.size()); @@ -305,11 +305,11 @@ public Map call(Map arguments) { inputs.put(inputName, tf.constantOf((TType) argument)); } Map> outputs = tf.call(this, inputs); - Map tensorOutputs = new LinkedHashMap<>(outputs.size()); + LinkedHashMap tensorOutputs = new LinkedHashMap<>(outputs.size()); for (String outputName : outputs.keySet()) { tensorOutputs.put(outputName, outputs.get(outputName).asTensor()); } - return tensorOutputs; + return new Result(tensorOutputs); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DeviceSpec.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DeviceSpec.java index 1fe55670681..8c83cd8c16f 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DeviceSpec.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DeviceSpec.java @@ -7,7 +7,8 @@ * *

    This is a Java port from python device_spec.py. * - * @see device_spec.py. + * @see device_spec.py. */ public final class DeviceSpec { private static final String JOB_PREFIX = "/job:"; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java index fa705ca6ea6..b2814368fe2 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java @@ -29,7 +29,7 @@ import org.tensorflow.internal.c_api.TF_Status; import org.tensorflow.internal.c_api.TF_Tensor; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; /** * Implementation of an {@link Operation} executed eagerly. @@ -118,6 +118,7 @@ public boolean equals(Object o) { @Override Shape shape(int outputIndex) { + // If the tensor of this output has already been resolved, return its shape. // Otherwise, retrieve the tensor shape from the native library. Tensor tensor = outputTensors.get(outputIndex); @@ -189,9 +190,9 @@ private static Tensor resolveTensorHandle(TFE_TensorHandle handle, EagerSession requireTensorHandle(handle); try (PointerScope scope = new PointerScope()) { TF_Status status = TF_Status.newStatus(); - TF_Tensor tensor = TFE_TensorHandleResolve(handle, status).withDeallocator(); + TF_Tensor tensor = TFE_TensorHandleResolve(handle, status); status.throwExceptionIfNotOK(); - return RawTensor.fromHandle(tensor, session).asTypedTensor(); + return RawTensor.fromHandle(tensor.withDeallocator(), session).asTypedTensor(); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java index cc47083bfce..e63e3b5ab4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java @@ -33,6 +33,7 @@ import static org.tensorflow.internal.c_api.global.tensorflow.TFE_OpSetAttrTensor; import static org.tensorflow.internal.c_api.global.tensorflow.TFE_OpSetAttrType; import static org.tensorflow.internal.c_api.global.tensorflow.TFE_OpSetAttrTypeList; +import static org.tensorflow.internal.c_api.global.tensorflow.TFE_OpSetAttrValueProto; import static org.tensorflow.internal.c_api.global.tensorflow.TFE_OpSetDevice; import java.nio.charset.Charset; @@ -54,7 +55,8 @@ import org.tensorflow.internal.c_api.TF_Tensor; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Scope; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; /** * An {@link OperationBuilder} for building {@link Operation Operations} that are executed eagerly. @@ -73,9 +75,7 @@ final class EagerOperationBuilder implements OperationBuilder { public EagerOperation build() { scope.apply(this); TFE_TensorHandle[] tensorHandles = execute(opHandle, session); - EagerOperation op = new EagerOperation(session, opHandle, tensorHandles, type, name); - scope.onOpCreated(op); - return op; + return new EagerOperation(session, opHandle, tensorHandles, type, name); } @Override @@ -250,7 +250,13 @@ public OperationBuilder setAttr(String name, ConcreteFunction[] value) { return this; } - private TFE_Op opHandle; + @Override + public OperationBuilder setAttr(String name, AttrValue value) { + setAttrValue(opHandle, name, value); + return this; + } + + private final TFE_Op opHandle; private final EagerSession session; private final String type; @@ -475,4 +481,14 @@ private static void setAttrFunctionList( TFE_OpSetAttrFunctionList(opHandle, new BytePointer(attrName), fns, functionNames.size()); } } + + private static void setAttrValue(TFE_Op opHandle, String name, AttrValue value) { + requireOp(opHandle); + try (PointerScope scope = new PointerScope()) { + TF_Status status = TF_Status.newStatus(); + byte[] bytes = value.toByteArray(); + TFE_OpSetAttrValueProto(opHandle, name, new BytePointer(bytes), bytes.length, status); + status.throwExceptionIfNotOK(); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java index f141e9dc551..84fc4d7fe9c 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2024 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. @@ -29,11 +29,12 @@ import org.tensorflow.internal.c_api.TFE_Context; import org.tensorflow.internal.c_api.TFE_ContextOptions; import org.tensorflow.internal.c_api.TF_Status; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.core.Variable; -import org.tensorflow.proto.framework.ConfigProto; +import org.tensorflow.proto.ConfigProto; /** * An environment for executing TensorFlow operations eagerly. @@ -114,7 +115,7 @@ public Options devicePlacementPolicy(DevicePlacementPolicy value) { * * @param config a config protocol buffer * @see config.proto + * href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto">config.proto */ public Options config(ConfigProto config) { this.config = config; @@ -334,14 +335,10 @@ public Scope baseScope() { /** Noop, initialization is meaningless for eager sessions */ @Override - public boolean isInitOp(Operation op) { + public boolean isInitializer(Operation op) { return false; } - /** Noop, initialization is meaningless for eager sessions */ - @Override - public void registerInitOp(Operation op) {} - TFE_Context nativeHandle() { checkSession(); return nativeHandle; @@ -397,7 +394,7 @@ void detach(Pointer... resources) { private final WeakPointerScope nativeResources; private TFE_Context nativeHandle; - private final Scope baseScope = new Scope(this); + private final Scope baseScope = new OpScope(this); private EagerSession(Options options) { this.nativeResources = new WeakPointerScope(); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ExecutionEnvironment.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ExecutionEnvironment.java index 87745138f01..c9c28575bbb 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ExecutionEnvironment.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/ExecutionEnvironment.java @@ -101,29 +101,10 @@ default boolean isGraph() { */ Scope baseScope(); - /** - * Get the execution environment to use for initialization. In most cases is {@code this}. - * - *

    Should generally only be used internally. - */ - default ExecutionEnvironment initEnv() { - return this; - } - - /** - * Register an op and all of its inputs (and control inputs) as an initialization op. - * - *

    Should generally only be used internally, prefer {@link - * org.tensorflow.op.Ops#withInitScope()}. - * - * @throws IllegalStateException if the op or one of its inputs can't be made an init op. - */ - void registerInitOp(Operation op); - /** * Get whether an op is an initialization op. * *

    Should generally only be used internally. */ - boolean isInitOp(Operation op); + boolean isInitializer(Operation op); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java index 98b6c98abc4..488434c56f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2024 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. @@ -15,6 +15,7 @@ */ package org.tensorflow; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_GetGraphId; import static org.tensorflow.internal.c_api.global.tensorflow.TF_AddGradientsWithPrefix; import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteGraph; import static org.tensorflow.internal.c_api.global.tensorflow.TF_FinishWhile; @@ -37,8 +38,11 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; import java.util.Queue; import java.util.Set; +import java.util.WeakHashMap; import java.util.stream.Collectors; import org.bytedeco.javacpp.BytePointer; import org.bytedeco.javacpp.Pointer; @@ -46,6 +50,7 @@ import org.bytedeco.javacpp.PointerScope; import org.bytedeco.javacpp.SizeTPointer; import org.tensorflow.exceptions.TensorFlowException; +import org.tensorflow.internal.c_api.TFJ_GraphId; import org.tensorflow.internal.c_api.TF_Buffer; import org.tensorflow.internal.c_api.TF_Function; import org.tensorflow.internal.c_api.TF_Graph; @@ -56,6 +61,7 @@ import org.tensorflow.internal.c_api.TF_WhileParams; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.op.Op; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Ops; import org.tensorflow.op.Scope; import org.tensorflow.op.core.Constant; @@ -64,8 +70,8 @@ import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.train.Restore; import org.tensorflow.op.train.Save; -import org.tensorflow.proto.framework.GraphDef; -import org.tensorflow.proto.util.SaverDef; +import org.tensorflow.proto.GraphDef; +import org.tensorflow.proto.SaverDef; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -81,14 +87,17 @@ public final class Graph implements ExecutionEnvironment, AutoCloseable { /** Create an empty Graph. */ public Graph() { - nativeHandle = allocate(); - this.baseScope = new Scope(this); + this(allocate()); } /** Create a Graph from an existing handle (takes ownership). */ Graph(TF_Graph nativeHandle) { this.nativeHandle = nativeHandle; - this.baseScope = new Scope(this); + this.nativeId = TFJ_GetGraphId(nativeHandle); + this.baseScope = new OpScope(this); + + // Add graph to global map, so we can retrieve it later from a single ID + ALL_GRAPHS.put(nativeId, this); } Graph(TF_Graph nativeHandle, SaverDef saverDef) { @@ -104,6 +113,9 @@ public Graph() { */ @Override public void close() { + ALL_GRAPHS.remove(nativeId); + nativeId = null; + synchronized (nativeHandleLock) { if (nativeHandle == null || nativeHandle.isNull()) { return; @@ -215,7 +227,7 @@ public Output outputOrThrow(String output) { *

    The order of iteration is unspecified. Consumers of the iterator will receive no * notification should the underlying graph change during iteration. */ - public Iterator operations() { + public Iterator operations() { return new OperationIterator(this); } @@ -366,12 +378,22 @@ public synchronized Set subgraphFrom(Set> inputs) { return downstream; } + /** + * Returns a builder to add {@link Operation}s to the Graph. + * + * @param type of the Operation (i.e., identifies the computation to be performed) + * @param name to refer to the created Operation in the graph. + * @param scope the scope to use for the operation + * @return an {@link OperationBuilder}, which will add the Operation to the graph when {@link + * OperationBuilder#build()} is invoked. If {@link OperationBuilder#build()} is not invoked, + * then some resources may leak. + */ @Override public GraphOperationBuilder opBuilder(String type, String name, Scope scope) { if (!isOpEnabled(type)) { throw new IllegalArgumentException("Op " + type + " is not valid in graph mode."); } - return new GraphOperationBuilder(this, type, name, scope); + return new GraphOperationBuilder(this, type, name, scope, dangerousGradientBuilder); } @Override @@ -501,7 +523,7 @@ public void importGraphDef(GraphDef graphDef) throws IllegalArgumentException { importGraphDef(graphDef, ""); } - private static final String INIT_OP_BASE_NAME = "Init"; + static final String INIT_OP_NAME = "Init"; /** * Import a representation of a TensorFlow graph. @@ -524,39 +546,23 @@ public void importGraphDef(GraphDef graphDef, String prefix) throws IllegalArgum String initPrefix; if (!prefix.isEmpty()) { if (prefix.endsWith("/")) { - initPrefix = prefix + INIT_OP_BASE_NAME; + initPrefix = prefix + INIT_OP_NAME; } else { - initPrefix = prefix + "/" + INIT_OP_BASE_NAME; + initPrefix = prefix + "/" + INIT_OP_NAME; } } else { - initPrefix = INIT_OP_BASE_NAME; + initPrefix = INIT_OP_NAME; } operations() .forEachRemaining( op -> { if (op.name().startsWith(initPrefix)) { - registerInitOp(op); + registerInitializer(op, false); } }); } - private synchronized void addInitOp() { - if (!newInitializers) { - return; - } - if (initializers.isEmpty()) { - return; - } - - baseScope.refreshNames(); - OperationBuilder builder = - baseScope().withInitScope().opBuilder(NoOp.OP_NAME, INIT_OP_BASE_NAME); - initializers.forEach(builder::addControlInput); - builder.build(); - newInitializers = false; - } - /** * Generate a representation of the Graph. * @@ -568,66 +574,18 @@ private synchronized void addInitOp() { * @see #importGraphDef(GraphDef, String) */ public GraphDef toGraphDef() { - addInitOp(); + GraphDef graphDef; synchronized (nativeHandleLock) { - return toGraphDef(nativeHandle); - } - } - - private boolean registerInitOpHelper(Operation op) { - if (isInitOp(op)) return false; - checkInput(op); - - if (!(op instanceof GraphOperation)) { - throw new IllegalStateException("Can't use a non-graph op as a graph's init op."); - } - GraphOperation graphOp = (GraphOperation) op; - - if (op.type().equals(Placeholder.OP_NAME)) { - throw new IllegalStateException("Can not make a placeholder " + op + " an init op."); - } - - for (GraphOperation controlInput : graphOp.controlInputs()) { - registerInitOpHelper(controlInput); - } - - for (Operand input : graphOp.inputs()) { - registerInitOpHelper(input.op()); - } - return initializers.add(op); - } - - @Override - public void registerInitOp(Operation op) { - if (registerInitOpHelper(op)) { - newInitializers = true; + graphDef = toGraphDef(nativeHandle); } + return addOrUpdateInit(graphDef); } @Override - public boolean isInitOp(Operation op) { + public boolean isInitializer(Operation op) { return initializers.contains(op); } - /** - * Returns a set of ops that will run all initializers added to the graph via {@link - * #registerInitOp(Operation)}. - * - *

    Note that NoOps aren't included in this list, since any inputs or control dependencies are - * guaranteed to also be in this list, and including the no-ops wouldn't change the initialization - * result. - */ - public Set initializers() { - return initializers.stream() - .filter(x -> !x.type().equals(NoOp.OP_NAME)) - .collect(Collectors.toSet()); - } - - /** Get whether the graph has any initializers */ - public boolean hasInitializers() { - return !initializers.isEmpty(); - } - /** * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, i.e., * {@code d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...} @@ -651,7 +609,8 @@ public boolean hasInitializers() { * @param dx if not null, the partial derivatives of some loss function {@code L} w.r.t. {@code y} * @return the partial derivatives {@code dy} with the size of {@code x} */ - public Output[] addGradients(String prefix, Output[] y, Output[] x, Output[] dx) { + public synchronized Output[] addGradients( + String prefix, Output[] y, Output[] x, Output[] dx) { Output[] dy = new Output[x.length]; final TF_Operation[] yHandles = new TF_Operation[y.length]; final int[] yIndices = new int[y.length]; @@ -846,6 +805,8 @@ public Output[] whileLoop( * Return the {@link SaverDef} instance used to save the state of all variables present in this * graph. * + *

    + * *

    The first time this method is called it builds the {@link SaverDef}. If this graph already * contains a "save/restore_all" operation then it is assumed to contain all necessary saving and * restoring operations. If that operation does not exist then the graph is mutated to add all the @@ -875,14 +836,60 @@ synchronized SaverDef saverDef() { return saverDef; } + /** + * Register an op as an initialization op. + * + * @throws IllegalArgumentException if the op or one of its inputs can't be made an init op. + */ + synchronized void registerInitializer(GraphOperation op, boolean isNew) { + if (isInitializer(op)) { + return; + } + checkInput(op); + for (GraphOperation controlInput : op.controlInputs()) { + checkInput(controlInput); + } + for (Operand input : op.inputs()) { + checkInput(input.op()); + } + if (initializers.add(op) && isNew && newInitializersMarker < 0) { + newInitializersMarker = initializers.size() - 1; + } + } + + /** + * Returns a set of ops that will run all initializers added to the graph via {@link + * #registerInitializer(GraphOperation, boolean)}. + * + *

    Note that NoOps aren't included in this list, since any inputs or control dependencies are + * guaranteed to also be in this list, and including the no-ops wouldn't change the initialization + * result. + */ + Set initializers() { + return initializers; + } + private final Object nativeHandleLock = new Object(); private TF_Graph nativeHandle; + private TFJ_GraphId nativeId; private int refcount = 0; private SaverDef saverDef; private final Scope baseScope; + private boolean dangerousGradientBuilder; + private final Set initializers = Collections.synchronizedSet(new LinkedHashSet<>()); - private boolean newInitializers = false; + private int newInitializersMarker = -1; + + /** + * Use builders without locking. This should only be used during custom gradient building. + * + *

    The graph locks are not re-entrant, so attempting to add an op to a graph that has been + * locked by the gradient builder will fail without this. + */ + synchronized void setDangerousGradientBuilder(boolean dangerous) { + dangerousGradientBuilder = dangerous; + } // Related native objects (such as the TF_Operation object backing an Operation instance) // have a validity tied to that of the Graph. The handles to those native objects are not @@ -929,7 +936,7 @@ Reference ref() { return new Reference(); } - private static final class OperationIterator implements Iterator { + private static final class OperationIterator implements Iterator { OperationIterator(Graph g) { this.graph = g; @@ -963,8 +970,8 @@ public boolean hasNext() { } @Override - public Operation next() { - Operation rhett = this.operation; + public GraphOperation next() { + GraphOperation rhett = this.operation; this.advance(); return rhett; } @@ -975,7 +982,7 @@ public void remove() { } private final Graph graph; - private Operation operation; + private GraphOperation operation; private int position; } @@ -1061,6 +1068,32 @@ private static GraphDef toGraphDef(TF_Graph handle) { } } + private GraphDef addOrUpdateInit(GraphDef graphDef) { + if (newInitializersMarker < 0) { + return graphDef; + } + var graphDefWithInitBuilder = graphDef.toBuilder(); + var initNode = + graphDefWithInitBuilder.getNodeBuilderList().stream() + .filter(n -> n.getName().equals(INIT_OP_NAME)) + .findFirst() + .orElseGet( + () -> { + return graphDefWithInitBuilder + .addNodeBuilder() + .setName(INIT_OP_NAME) + .setOp(NoOp.OP_NAME); + }); + + // Register each initializer as a control dependency of the Init op by adding their names + // prefixed with the '^' symbol to the list of inputs + initializers.stream() + .skip(newInitializersMarker) + .forEach(op -> initNode.addInput("^" + op.name())); + + return graphDefWithInitBuilder.build(); + } + static void resolveOutputs( String type, TF_Operation[] srcOps, int[] srcIndices, TF_Output dst, int n) { if (srcOps.length != n) { @@ -1239,11 +1272,13 @@ private static Object[] whileLoop( private static SaverDef addVariableSaver(Graph graph) { Ops tf = Ops.create(graph).withSubScope(SAVER_DEF_SCOPE); + // TODO handle resource variables, too + List varNames = new ArrayList<>(); List> varOutputs = new ArrayList<>(); List> varTypes = new ArrayList<>(); - for (Iterator iter = graph.operations(); iter.hasNext(); ) { + for (Iterator iter = graph.operations(); iter.hasNext(); ) { Operation op = iter.next(); if (op.type().equals("VariableV2")) { varNames.add(op.name()); @@ -1284,6 +1319,23 @@ private static SaverDef addVariableSaver(Graph graph) { .build(); } + private static final Map ALL_GRAPHS = + Collections.synchronizedMap(new WeakHashMap<>()); + + /** + * Find the graph with the matching ID. + * + * @return the graph if there is one + * @throws NoSuchElementException if graph is not found + */ + public static Graph findGraph(TFJ_GraphId graphId) { + var graph = ALL_GRAPHS.get(graphId); + if (graph == null || graph.nativeHandle == null) { + throw new NoSuchElementException("Graph not found"); + } + return graph; + } + static { try { // Ensure that TensorFlow native library and classes are ready to be used diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java index b97ef09a9e4..f56a510a720 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java @@ -18,8 +18,10 @@ import static org.tensorflow.internal.c_api.global.tensorflow.TF_GraphGetTensorNumDims; import static org.tensorflow.internal.c_api.global.tensorflow.TF_GraphGetTensorShape; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationAllInputs; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationDevice; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetControlInputs; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetControlOutputs; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationInput; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationInputListLength; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationName; import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationNumControlInputs; @@ -36,6 +38,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import org.bytedeco.javacpp.Pointer; import org.bytedeco.javacpp.PointerPointer; import org.bytedeco.javacpp.PointerScope; @@ -45,7 +48,7 @@ import org.tensorflow.internal.c_api.TF_Output; import org.tensorflow.internal.c_api.TF_Status; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; /** * Implementation for an {@link Operation} added as a node to a {@link Graph}. @@ -184,17 +187,64 @@ Tensor tensor(int outputIdx) { throw new IllegalStateException("Graph tensors must be fetched by running a session"); } - /** - * Get the number of inputs to the op, not including control inputs. - */ + /** Get the op's device. */ + public String device() { + return TF_OperationDevice(getCheckedNativeHandle()).getString(); + } + + /** Get the number of inputs to the op, not including control inputs. */ public int numInputs() { + requireHandle(unsafeNativeHandle); return TF_OperationNumInputs(getUnsafeNativeHandle()); } + /** Gets the input at the given index */ + public Output input(int idx) { + if (idx < 0) { + throw new IndexOutOfBoundsException("Can't get input with index < 0."); + } + + int numInputs = numInputs(); + if (idx >= numInputs) { + throw new IndexOutOfBoundsException( + "Can't get input with index " + idx + ", this op only has " + numInputs + " inputs."); + } + + try (PointerScope scope = new PointerScope()) { + TF_Input input = new TF_Input().oper(getUnsafeNativeHandle()).index(idx); + TF_Output output = TF_OperationInput(input); + return new GraphOperation(graph, output.oper()).output(output.index()); + } + } + + private final AtomicReference attrs = + new AtomicReference<>(null); + + /** Get an inspector for the graph operation's attributes. */ + public OperationAttributeInspector attributes() { + return attrs.updateAndGet( + (old) -> old == null ? new GraphOperationAttributeInspector(this) : old); + } + /** - * Get the op's inputs, not including control inputs. + * Get the input list that starts at {@code idx} and has length {@code length} + * + * @param idx the starting index of the list + * @param length the length of the list + * @return the input list + * @see #inputListLength(String) */ + public Output[] inputList(int idx, int length) { + Output[] inputs = new Output[length]; + for (int i = 0; i < length; ++i) { + inputs[i] = input(idx + i); + } + return inputs; + } + + /** Get the op's inputs, not including control inputs. */ public List> inputs() { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { int numInputs = numInputs(); TF_Output handles = new TF_Output(numInputs); @@ -214,11 +264,13 @@ public List> inputs() { } /** - * Get the number of ops that use this op's designated output as an input, not including control dependencies. + * Get the number of ops that use this op's designated output as an input, not including control + * dependencies. * * @param index the output to look for usages of */ public int numConsumers(int index) { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { TF_Output output = new TF_Output().oper(getUnsafeNativeHandle()).index(index); return TF_OperationOutputNumConsumers(output); @@ -226,11 +278,13 @@ public int numConsumers(int index) { } /** - * Get the ops that use this op's designated output as an input, not including control dependencies. + * Get the ops that use this op's designated output as an input, not including control + * dependencies. * * @param index the output to look for usages of */ public Set consumers(int index) { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { TF_Output output = new TF_Output().oper(getUnsafeNativeHandle()).index(index); int numConsumers = numConsumers(index); @@ -250,9 +304,11 @@ public Set consumers(int index) { } /** - * Get the number of ops that use any of this op's outputs as an input, not including control dependencies. + * Get the number of ops that use any of this op's outputs as an input, not including control + * dependencies. */ public int numConsumers() { + requireHandle(unsafeNativeHandle); int all = 0; for (int i = 0; i < numOutputs(); i++) { all += numConsumers(i); @@ -260,11 +316,11 @@ public int numConsumers() { return all; } - /** * Get the ops that use any of this op's outputs as an input, not including control dependencies. */ public Set consumers() { + requireHandle(unsafeNativeHandle); Set all = new LinkedHashSet<>(); for (int i = 0; i < numOutputs(); i++) { all.addAll(consumers(i)); @@ -272,19 +328,17 @@ public Set consumers() { return all; } - /** - * Get the number of control inputs for this op. - */ + /** Get the number of control inputs for this op. */ public int numControlInputs() { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { return TF_OperationNumControlInputs(getUnsafeNativeHandle()); } } - /** - * Get the control inputs of this op. - */ + /** Get the control inputs of this op. */ public Set controlInputs() { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { int numInputs = numControlInputs(); PointerPointer handles = new PointerPointer<>(numInputs); @@ -301,19 +355,17 @@ public Set controlInputs() { } } - /** - * Get the number of ops with this op as a control dependency. - */ + /** Get the number of ops with this op as a control dependency. */ public int numControlConsumers() { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { return TF_OperationNumControlOutputs(getUnsafeNativeHandle()); } } - /** - * Get the ops with this op as a control dependency. - */ + /** Get the ops with this op as a control dependency. */ public Set controlConsumers() { + requireHandle(unsafeNativeHandle); try (PointerScope scope = new PointerScope()) { int numConsumers = numControlConsumers(); PointerPointer handles = new PointerPointer<>(numConsumers); @@ -330,18 +382,32 @@ public Set controlConsumers() { } } + /** + * Get the native handle of this operation. + * + *

    No liveness or non-null checking is done, the operation may have been deallocated. + */ + public TF_Operation getUnsafeNativeHandle() { + return unsafeNativeHandle; + } - TF_Operation getUnsafeNativeHandle() { + TF_Operation getCheckedNativeHandle() { + requireHandle(unsafeNativeHandle); return unsafeNativeHandle; } + Graph graph() { + return graph; + } + private final Graph graph; private final TF_Operation unsafeNativeHandle; private static void requireHandle(Pointer handle) { if (handle == null || handle.isNull()) { - throw new IllegalStateException("close() has been called on the Graph this Operation was a part of"); + throw new IllegalStateException( + "close() has been called on the Graph this Operation was a part of"); } } @@ -388,8 +454,12 @@ private static long[] shape(TF_Graph graphHandle, TF_Operation opHandle, int out int numOutputs = TF_OperationNumOutputs(opHandle); if (outputIndex < 0 || outputIndex >= numOutputs) { - throw new IndexOutOfBoundsException("invalid output index (" + outputIndex - + ") for an operation that has " + numOutputs + " outputs"); + throw new IndexOutOfBoundsException( + "invalid output index (" + + outputIndex + + ") for an operation that has " + + numOutputs + + " outputs"); } try (PointerScope scope = new PointerScope()) { @@ -397,7 +467,9 @@ private static long[] shape(TF_Graph graphHandle, TF_Operation opHandle, int out TF_Status status = TF_Status.newStatus(); int numDims = TF_GraphGetTensorNumDims(graphHandle, output, status); status.throwExceptionIfNotOK(); - if (numDims < 0) return null; + if (numDims < 0) { + return null; + } long[] dims = new long[numDims]; TF_GraphGetTensorShape(graphHandle, output, dims, numDims, status); status.throwExceptionIfNotOK(); @@ -411,8 +483,12 @@ private static int dtype(TF_Graph graphHandle, TF_Operation opHandle, int output int numOutputs = TF_OperationNumOutputs(opHandle); if (outputIndex < 0 || outputIndex >= numOutputs) { - throw new IndexOutOfBoundsException("invalid output index (" + outputIndex - + ") for an operation that has " + numOutputs + " outputs"); + throw new IndexOutOfBoundsException( + "invalid output index (" + + outputIndex + + ") for an operation that has " + + numOutputs + + " outputs"); } try (PointerScope scope = new PointerScope()) { diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationAttributeInspector.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationAttributeInspector.java new file mode 100644 index 00000000000..2c2654e85ea --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationAttributeInspector.java @@ -0,0 +1,367 @@ +/* + Copyright 2021 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. +======================================================================= + +*/ +package org.tensorflow; + +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrBool; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrBoolList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrFloat; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrFloatList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrInt; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrIntList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrMetadata; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrShape; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrShapeList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrString; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrStringList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrTensor; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrTensorList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrType; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrTypeList; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_OperationGetAttrValueProto; + +import com.google.protobuf.InvalidProtocolBufferException; +import java.nio.charset.StandardCharsets; +import org.bytedeco.javacpp.BytePointer; +import org.bytedeco.javacpp.IntPointer; +import org.bytedeco.javacpp.LongPointer; +import org.bytedeco.javacpp.PointerPointer; +import org.bytedeco.javacpp.PointerScope; +import org.bytedeco.javacpp.SizeTPointer; +import org.tensorflow.internal.c_api.TF_AttrMetadata; +import org.tensorflow.internal.c_api.TF_Buffer; +import org.tensorflow.internal.c_api.TF_Status; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.AttributeMetadata; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; + +class GraphOperationAttributeInspector implements OperationAttributeInspector { + private final GraphOperation op; + + GraphOperationAttributeInspector(GraphOperation op) { + this.op = op; + } + + @Override + public AttributeMetadata getAttrMetadata(String name) { + try (PointerScope scope = new PointerScope()) { + TF_Status status = TF_Status.newStatus(); + TF_AttrMetadata r = TF_OperationGetAttrMetadata(op.getCheckedNativeHandle(), name, status); + status.throwExceptionIfNotOK(); + return new AttributeMetadata(r); + } + } + + @Override + public AttrValue getAttrValueProto(String name) { + try (PointerScope scope = new PointerScope()) { + TF_Buffer buffer = TF_Buffer.newBuffer(); + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrValueProto(op.getCheckedNativeHandle(), name, buffer, status); + status.throwExceptionIfNotOK(); + return AttrValue.parseFrom(buffer.dataAsByteBuffer()); + } catch (InvalidProtocolBufferException e) { + throw new IllegalStateException("Invalid protobuf for attribute " + name, e); + } + } + + @Override + public String getAttrString(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).totalSize; + BytePointer result = new BytePointer(size); + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrString(op.getCheckedNativeHandle(), name, result, size, status); + status.throwExceptionIfNotOK(); + return result.getString(); + } + } + + @Override + public String[] getAttrStringList(String name) { + try (PointerScope scope = new PointerScope()) { + AttributeMetadata metadata = getAttrMetadata(name); + int listSize = (int) metadata.listSize; + long totalSize = metadata.totalSize; + + PointerPointer values = new PointerPointer<>(listSize); + SizeTPointer lengths = new SizeTPointer(listSize); + BytePointer storage = new BytePointer(totalSize); + + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrStringList( + op.getCheckedNativeHandle(), + new BytePointer(name), + values, + lengths, + listSize, + storage, + totalSize, + status); + status.throwExceptionIfNotOK(); + + String[] results = new String[listSize]; + + for (int i = 0; i < results.length; i++) { + int length = (int) lengths.get(i); + + if (length == 0) { + results[i] = ""; + continue; + } + + byte[] bytes = new byte[length]; + BytePointer p = values.get(BytePointer.class, i); + p.get(bytes); + + results[i] = new String(bytes, StandardCharsets.UTF_8); + } + + return results; + } + } + + @Override + public long getAttrInt(String name) { + try (PointerScope scope = new PointerScope()) { + long[] result = new long[1]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrInt(op.getCheckedNativeHandle(), name, result, status); + status.throwExceptionIfNotOK(); + return result[0]; + } + } + + @Override + public long[] getAttrIntList(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).listSize; + long[] result = new long[(int) size]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrIntList(op.getCheckedNativeHandle(), name, result, result.length, status); + status.throwExceptionIfNotOK(); + return result; + } + } + + @Override + public float getAttrFloat(String name) { + try (PointerScope scope = new PointerScope()) { + float[] result = new float[1]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrFloat(op.getCheckedNativeHandle(), name, result, status); + status.throwExceptionIfNotOK(); + return result[0]; + } + } + + @Override + public float[] getAttrFloatList(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).listSize; + float[] result = new float[(int) size]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrFloatList( + op.getCheckedNativeHandle(), name, result, result.length, status); + status.throwExceptionIfNotOK(); + return result; + } + } + + @Override + public boolean getAttrBool(String name) { + try (PointerScope scope = new PointerScope()) { + byte[] result = new byte[1]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrBool(op.getCheckedNativeHandle(), name, result, status); + status.throwExceptionIfNotOK(); + return result[0] == 1; + } + } + + @Override + public boolean[] getAttrBoolList(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).listSize; + byte[] byteResults = new byte[(int) size]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrBoolList( + op.getCheckedNativeHandle(), name, byteResults, byteResults.length, status); + status.throwExceptionIfNotOK(); + + boolean[] results = new boolean[byteResults.length]; + + for (int i = 0; i < results.length; i++) { + results[i] = byteResults[i] == 1; + } + + return results; + } + } + + @Override + public DataType getAttrType(String name) { + try (PointerScope scope = new PointerScope()) { + int[] result = new int[1]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrType(op.getCheckedNativeHandle(), name, result, status); + status.throwExceptionIfNotOK(); + return DataType.forNumber(result[0]); + } + } + + @Override + public DataType[] getAttrTypeList(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).listSize; + int[] typeInts = new int[(int) size]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrTypeList( + op.getCheckedNativeHandle(), name, typeInts, typeInts.length, status); + status.throwExceptionIfNotOK(); + + DataType[] results = new DataType[typeInts.length]; + + for (int i = 0; i < results.length; i++) { + results[i] = DataType.forNumber(typeInts[i]); + } + + return results; + } + } + + @Override + public Tensor getAttrTensor(String name) { + try (PointerScope scope = new PointerScope()) { + PointerPointer result = new PointerPointer<>(1); + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrTensor(op.getCheckedNativeHandle(), new BytePointer(name), result, status); + status.throwExceptionIfNotOK(); + return RawTensor.fromHandle(result.get(TF_Tensor.class, 0).withDeallocator()); + } + } + + @Override + public Tensor[] getAttrTensorList(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).listSize; + PointerPointer pointers = new PointerPointer<>(size); + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrTensorList( + op.getCheckedNativeHandle(), new BytePointer(name), pointers, (int) size, status); + status.throwExceptionIfNotOK(); + + Tensor[] results = new Tensor[(int) size]; + for (int i = 0; i < results.length; i++) { + results[i] = RawTensor.fromHandle(pointers.get(TF_Tensor.class, i).withDeallocator()); + } + + return results; + } + } + + @Override + public Shape getAttrShape(String name) { + try (PointerScope scope = new PointerScope()) { + long size = getAttrMetadata(name).totalSize; + + if (size == -1) { + return Shape.unknown(); + } + + long[] result = new long[(int) size]; + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrShape(op.getCheckedNativeHandle(), name, result, result.length, status); + status.throwExceptionIfNotOK(); + return Shape.of(result); + } + } + + @Override + public Shape[] getAttrShapeList(String name) { + try (PointerScope scope = new PointerScope()) { + AttributeMetadata metadata = getAttrMetadata(name); + int listSize = (int) metadata.listSize; + int totalSize = (int) metadata.totalSize; + + PointerPointer dimPointers = new PointerPointer<>(listSize); + IntPointer numDims = new IntPointer(listSize); + LongPointer storage = new LongPointer(totalSize); + + TF_Status status = TF_Status.newStatus(); + TF_OperationGetAttrShapeList( + op.getCheckedNativeHandle(), + new BytePointer(name), + dimPointers, + numDims, + listSize, + storage, + totalSize, + status); + status.throwExceptionIfNotOK(); + + Shape[] results = new Shape[listSize]; + + for (int i = 0; i < results.length; i++) { + int length = numDims.get(i); + + if (length == -1) { + results[i] = Shape.unknown(); + continue; + } + + long[] shape = new long[length]; + dimPointers.get(LongPointer.class, i).get(shape); + results[i] = Shape.of(shape); + } + + return results; + } + } + + @Override + public ConcreteFunction getAttrFunction(String name) { + AttrValue proto = getAttrValueProto(name); + if (!proto.hasFunc()) + throw new IllegalArgumentException("Attribute \"" + name + "\" is not a function."); + return op.graph().getFunction(proto.getFunc().getName()); + } + + @Override + public ConcreteFunction[] getAttrFunctionList(String name) { + AttrValue proto = getAttrValueProto(name); + if (!proto.hasList()) + throw new IllegalArgumentException("Attribute \"" + name + "\" is not a list."); + + AttrValue.ListValue list = proto.getList(); + + int size = list.getFuncCount(); + if (size < 0) { + throw new IllegalArgumentException("Attribute \"" + name + "\" is not a list of functions."); + } else if (size == 0) { + return new ConcreteFunction[0]; + } else { + ConcreteFunction[] functions = new ConcreteFunction[size]; + for (int i = 0; i < size; i++) { + functions[i] = op.graph().getFunction(list.getFunc(i).getName()); + } + return functions; + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java index d1040469992..d68232b2598 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java @@ -15,11 +15,14 @@ */ package org.tensorflow; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_UnmapOperationName; import static org.tensorflow.internal.c_api.global.tensorflow.TF_AddControlInput; import static org.tensorflow.internal.c_api.global.tensorflow.TF_AddInput; import static org.tensorflow.internal.c_api.global.tensorflow.TF_AddInputList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_FinishOperation; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_FinishOperationLocked; import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewOperation; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewOperationLocked; import static org.tensorflow.internal.c_api.global.tensorflow.TF_SetAttrBool; import static org.tensorflow.internal.c_api.global.tensorflow.TF_SetAttrBoolList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_SetAttrFloat; @@ -59,22 +62,25 @@ import org.tensorflow.internal.c_api.TF_Tensor; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Scope; -import org.tensorflow.proto.framework.AttrValue; -import org.tensorflow.proto.framework.AttrValue.ListValue; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.NameAttrList; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.AttrValue.ListValue; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.NameAttrList; /** An {@link OperationBuilder} for adding {@link GraphOperation}s to a {@link Graph}. */ public final class GraphOperationBuilder implements OperationBuilder { - GraphOperationBuilder(Graph graph, String type, String name, Scope scope) { + GraphOperationBuilder( + Graph graph, String type, String name, Scope scope, boolean dangerousGradientBuilder) { this.graph = graph; this.scope = scope; - Graph.Reference r = graph.ref(); - try { - this.unsafeNativeHandle = allocate(r.nativeHandle(), type, name); - } finally { - r.close(); + this.dangerousGradientBuilder = dangerousGradientBuilder; + try (Graph.Reference r = graph.ref()) { + if (dangerousGradientBuilder) { + this.unsafeNativeHandle = allocateDangerousGradient(r.nativeHandle(), type, name); + } else { + this.unsafeNativeHandle = allocate(r.nativeHandle(), type, name); + } } } @@ -86,14 +92,19 @@ public final class GraphOperationBuilder implements OperationBuilder { @Override public GraphOperation build() { scope.apply(this); - Graph.Reference r = graph.ref(); - try { - GraphOperation op = new GraphOperation(graph, finish(unsafeNativeHandle)); + try (Graph.Reference r = graph.ref()) { + TF_Operation built; + if (dangerousGradientBuilder) { + built = finishDangerousGradient(r.nativeHandle(), unsafeNativeHandle); + } else { + built = finish(unsafeNativeHandle); + } + GraphOperation op = new GraphOperation(graph, built); unsafeNativeHandle = null; - scope.onOpCreated(op); + if (scope.isInit()) { + graph.registerInitializer(op, true); + } return op; - } finally { - r.close(); } } @@ -377,10 +388,29 @@ public OperationBuilder setAttr(String name, ConcreteFunction[] value) { return this; } + @Override + public OperationBuilder setAttr(String name, AttrValue value) { + Graph.Reference r = graph.ref(); + try { + setAttrValue(unsafeNativeHandle, name, value); + } finally { + r.close(); + } + return this; + } + private TF_OperationDescription unsafeNativeHandle; - private Graph graph; + private final Graph graph; private final Scope scope; + /** + * Use builders without locking. This should only be used during custom gradient building. + * + *

    The graph locks are not re-entrant, so attempting to add an op to a graph that has been + * locked by the gradient builder will fail without this. + */ + private final boolean dangerousGradientBuilder; + private static void requireHandle(Pointer handle) { if (handle == null || handle.isNull()) { throw new IllegalStateException("Operation has already been built"); @@ -408,6 +438,20 @@ private static TF_OperationDescription allocate(TF_Graph graphHandle, String typ return TF_NewOperation(graphHandle, type, name); } + /** + * Use builders without locking. This should only be used during custom gradient building. + * + *

    The graph locks are not re-entrant, so attempting to add an op to a graph that has been + * locked by the gradient builder will fail without this. + */ + private static TF_OperationDescription allocateDangerousGradient( + TF_Graph graphHandle, String type, String name) { + if (graphHandle == null || graphHandle.isNull()) { + throw new IllegalStateException("close() has been called on the Graph"); + } + return TF_NewOperationLocked(graphHandle, type, name); + } + private static TF_Operation finish(TF_OperationDescription handle) { requireHandle(handle); @@ -419,6 +463,24 @@ private static TF_Operation finish(TF_OperationDescription handle) { } } + /** + * Use builders without locking. This should only be used during custom gradient building. + * + *

    The graph locks are not re-entrant, so attempting to add an op to a graph that has been + * locked by the gradient builder will fail without this. + */ + private static TF_Operation finishDangerousGradient(TF_Graph g, TF_OperationDescription handle) { + requireHandle(handle); + + try (PointerScope scope = new PointerScope()) { + TF_Status status = TF_Status.newStatus(); + TF_Operation op = TF_FinishOperationLocked(handle, status); + status.throwExceptionIfNotOK(); + TFJ_UnmapOperationName(g, op); + return op; + } + } + private static void addInput(TF_OperationDescription handle, TF_Operation opHandle, int index) { try (PointerScope scope = new PointerScope()) { TF_Output out = new TF_Output(); @@ -597,19 +659,24 @@ private static void setAttrFunctionName( private static void setAttrFunctionList( TF_OperationDescription opHandle, String attrName, List functionNames) { + AttrValue value = + AttrValue.newBuilder() + .setList( + ListValue.newBuilder() + .addAllFunc( + functionNames.stream() + .map(x -> NameAttrList.newBuilder().setName(x).build()) + .collect(Collectors.toList())) + .build()) + .build(); + setAttrValue(opHandle, attrName, value); + } + + private static void setAttrValue( + TF_OperationDescription opHandle, String attrName, AttrValue value) { requireHandle(opHandle); try (PointerScope scope = new PointerScope()) { TF_Status status = TF_Status.newStatus(); - AttrValue value = - AttrValue.newBuilder() - .setList( - ListValue.newBuilder() - .addAllFunc( - functionNames.stream() - .map(x -> NameAttrList.newBuilder().setName(x).build()) - .collect(Collectors.toList())) - .build()) - .build(); byte[] bytes = value.toByteArray(); TF_SetAttrValueProto(opHandle, attrName, new BytePointer(bytes), bytes.length, status); status.throwExceptionIfNotOK(); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeFunction.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeFunction.java index 05e89a39722..4dbde8f2473 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeFunction.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeFunction.java @@ -20,9 +20,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayDeque; -import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -33,8 +31,8 @@ import org.tensorflow.internal.c_api.TF_Buffer; import org.tensorflow.internal.c_api.TF_Function; import org.tensorflow.internal.c_api.TF_Status; -import org.tensorflow.proto.framework.FunctionDef; -import org.tensorflow.proto.framework.NodeDef; +import org.tensorflow.proto.FunctionDef; +import org.tensorflow.proto.NodeDef; /** * A class holding a native function handle and providing cached access to it's {@link FunctionDef}. @@ -92,7 +90,7 @@ public synchronized List getDependencies() { } }); } - dependencies = Collections.unmodifiableList(new ArrayList<>(deps)); + dependencies = List.copyOf(deps); } return dependencies; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java deleted file mode 100644 index b0733a22646..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright 2017 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. -==============================================================================*/ - -package org.tensorflow; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Helper class for loading the TensorFlow Java native library. - * - *

    The Java TensorFlow bindings require a native (JNI) library. This library - * (libtensorflow_jni.so on Linux, libtensorflow_jni.dylib on OS X, tensorflow_jni.dll on Windows) - * can be made available to the JVM using the java.library.path System property (e.g., using - * -Djava.library.path command-line argument). However, doing so requires an additional step of - * configuration. - * - *

    Alternatively, the native libraries can be packaed in a .jar, making them easily usable from - * build systems like Maven. However, in such cases, the native library has to be extracted from the - * .jar archive. - * - *

    NativeLibrary.load() takes care of this. First looking for the library in java.library.path - * and failing that, it tries to find the OS and architecture specific version of the library in the - * set of ClassLoader resources (under org/tensorflow/native/OS-ARCH). The resources paths used for - * lookup must be consistent with any packaging (such as on Maven Central) of the TensorFlow Java - * native libraries. - */ -final class NativeLibrary { - private static final boolean DEBUG = - System.getProperty("org.tensorflow.NativeLibrary.DEBUG") != null; - private static final String JNI_LIBNAME = "tensorflow_jni"; - - public static void load() { - org.bytedeco.javacpp.Loader.load(org.tensorflow.internal.c_api.global.tensorflow.class); - - if (isLoaded() || tryLoadLibrary()) { - // Either: - // (1) The native library has already been statically loaded, OR - // (2) The required native code has been statically linked (through a custom launcher), OR - // (3) The native code is part of another library (such as an application-level library) - // that has already been loaded. For example, tensorflow/examples/android and - // tensorflow/contrib/android include the required native code in differently named libraries. - // - // Doesn't matter how, but it seems the native code is loaded, so nothing else to do. - return; - } - // Native code is not present, perhaps it has been packaged into the .jar file containing this. - // Extract the JNI library itself - final String jniLibName = System.mapLibraryName(JNI_LIBNAME); - final String jniResourceName = makeResourceName(jniLibName); - log("jniResourceName: " + jniResourceName); - final InputStream jniResource = - NativeLibrary.class.getClassLoader().getResourceAsStream(jniResourceName); - // Extract the JNI's dependency - final String frameworkLibName = - getVersionedLibraryName(System.mapLibraryName("tensorflow_framework")); - final String frameworkResourceName = makeResourceName(frameworkLibName); - log("frameworkResourceName: " + frameworkResourceName); - final InputStream frameworkResource = - NativeLibrary.class.getClassLoader().getResourceAsStream(frameworkResourceName); - // Do not complain if the framework resource wasn't found. This may just mean that we're - // building with --config=monolithic (in which case it's not needed and not included). - if (jniResource == null) { - throw new UnsatisfiedLinkError( - String.format( - "Cannot find TensorFlow native library for OS: %s, architecture: %s. See " - + "https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java/README.md" - + " for possible solutions (such as building the library from source). Additional" - + " information on attempts to find the native library can be obtained by adding" - + " org.tensorflow.NativeLibrary.DEBUG=1 to the system properties of the JVM.", - os(), architecture())); - } - try { - // Create a temporary directory for the extracted resource and its dependencies. - final File tempPath = createTemporaryDirectory(); - // Deletions are in the reverse order of requests, so we need to request that the directory be - // deleted first, so that it is empty when the request is fulfilled. - tempPath.deleteOnExit(); - final String tempDirectory = tempPath.getCanonicalPath(); - if (frameworkResource != null) { - extractResource(frameworkResource, frameworkLibName, tempDirectory); - } else { - log( - frameworkResourceName - + " not found. This is fine assuming " - + jniResourceName - + " is not built to depend on it."); - } - System.load(extractResource(jniResource, jniLibName, tempDirectory)); - } catch (IOException e) { - throw new UnsatisfiedLinkError( - String.format( - "Unable to extract native library into a temporary file (%s)", e.toString())); - } - } - - private static boolean tryLoadLibrary() { - try { - System.loadLibrary(JNI_LIBNAME); - return true; - } catch (UnsatisfiedLinkError e) { - log("tryLoadLibraryFailed: " + e.getMessage()); - return false; - } - } - - private static boolean isLoaded() { - try { - TensorFlow.version(); - log("isLoaded: true"); - return true; - } catch (UnsatisfiedLinkError e) { - return false; - } - } - - private static boolean resourceExists(String baseName) { - return NativeLibrary.class.getClassLoader().getResource(makeResourceName(baseName)) != null; - } - - private static String getVersionedLibraryName(String libFilename) { - // If the resource exists as an unversioned file, return that. - if (resourceExists(libFilename)) { - return libFilename; - } - - final String versionName = getMajorVersionNumber(); - - // If we're on darwin, the versioned libraries look like blah.1.dylib. - final String darwinSuffix = ".dylib"; - if (libFilename.endsWith(darwinSuffix)) { - final String prefix = libFilename.substring(0, libFilename.length() - darwinSuffix.length()); - if (versionName != null) { - final String darwinVersionedLibrary = prefix + "." + versionName + darwinSuffix; - if (resourceExists(darwinVersionedLibrary)) { - return darwinVersionedLibrary; - } - } else { - // If we're here, we're on darwin, but we couldn't figure out the major version number. We - // already tried the library name without any changes, but let's do one final try for the - // library with a .so suffix. - final String darwinSoName = prefix + ".so"; - if (resourceExists(darwinSoName)) { - return darwinSoName; - } - } - } else if (libFilename.endsWith(".so")) { - // Libraries ending in ".so" are versioned like "libfoo.so.1", so try that. - final String versionedSoName = libFilename + "." + versionName; - if (versionName != null && resourceExists(versionedSoName)) { - return versionedSoName; - } - } - - // Otherwise, we've got no idea. - return libFilename; - } - - /** - * Returns the major version number of this TensorFlow Java API, or {@code null} if it cannot be - * determined. - */ - private static String getMajorVersionNumber() { - String version = NativeLibrary.class.getPackage().getImplementationVersion(); - // expecting a string like 1.14.0, we want to get the first '1'. - int dotIndex; - if (version == null || (dotIndex = version.indexOf('.')) == -1) { - return null; - } - String majorVersion = version.substring(0, dotIndex); - try { - Integer.parseInt(majorVersion); - return majorVersion; - } catch (NumberFormatException unused) { - return null; - } - } - - private static String extractResource( - InputStream resource, String resourceName, String extractToDirectory) throws IOException { - final File dst = new File(extractToDirectory, resourceName); - dst.deleteOnExit(); - final String dstPath = dst.toString(); - log("extracting native library to: " + dstPath); - final long nbytes = copy(resource, dst); - log(String.format("copied %d bytes to %s", nbytes, dstPath)); - return dstPath; - } - - private static String os() { - final String p = System.getProperty("os.name").toLowerCase(); - if (p.contains("linux")) { - return "linux"; - } else if (p.contains("os x") || p.contains("darwin")) { - return "darwin"; - } else if (p.contains("windows")) { - return "windows"; - } else { - return p.replaceAll("\\s", ""); - } - } - - private static String architecture() { - final String arch = System.getProperty("os.arch").toLowerCase(); - return (arch.equals("amd64")) ? "x86_64" : arch; - } - - private static void log(String msg) { - if (DEBUG) { - System.err.println("org.tensorflow.NativeLibrary: " + msg); - } - } - - private static String makeResourceName(String baseName) { - return "org/tensorflow/native/" + String.format("%s-%s/", os(), architecture()) + baseName; - } - - private static long copy(InputStream src, File dstFile) throws IOException { - FileOutputStream dst = new FileOutputStream(dstFile); - try { - byte[] buffer = new byte[1 << 20]; // 1MB - long ret = 0; - int n = 0; - while ((n = src.read(buffer)) >= 0) { - dst.write(buffer, 0, n); - ret += n; - } - return ret; - } finally { - dst.close(); - src.close(); - } - } - - // Shamelessly adapted from Guava to avoid using java.nio, for Android API - // compatibility. - private static File createTemporaryDirectory() { - File baseDirectory = new File(System.getProperty("java.io.tmpdir")); - String directoryName = "tensorflow_native_libraries-" + System.currentTimeMillis() + "-"; - for (int attempt = 0; attempt < 1000; attempt++) { - File temporaryDirectory = new File(baseDirectory, directoryName + attempt); - if (temporaryDirectory.mkdir()) { - return temporaryDirectory; - } - } - throw new IllegalStateException( - "Could not create a temporary directory (tried to make " - + directoryName - + "*) to extract TensorFlow native libraries."); - } - - private NativeLibrary() {} -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java index 80f62eb5acc..2f9b9451ab4 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java @@ -56,7 +56,7 @@ public interface Operand extends Op, Shaped { /** * Returns the tensor at this operand. * - * Only works when running in an eager execution + *

    Only works when running in an eager execution * * @return the tensor * @throws IllegalStateException if this is an operand of a graph @@ -65,15 +65,14 @@ default T asTensor() { return asOutput().asTensor(); } - /** - * Returns the tensor type of this operand - */ + /** Returns the tensor type of this operand */ default Class type() { return asOutput().type(); } /** - * Returns the (possibly partially known) shape of the tensor referred to by the {@link Output} of this operand. + * Returns the (possibly partially known) shape of the tensor referred to by the {@link Output} of + * this operand. */ @Override default Shape shape() { diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java index b47eee6850c..46d1f68dc37 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java @@ -25,24 +25,19 @@ */ public interface Operation { - /** - * Returns the full name of the Operation. - */ + /** Returns the full name of the Operation. */ String name(); /** - * Returns the type of the operation, i.e., the name of the computation performed by the operation. + * Returns the type of the operation, i.e., the name of the computation performed by the + * operation. */ String type(); - /** - * Returns the execution environment this operation was created in. - */ + /** Returns the execution environment this operation was created in. */ ExecutionEnvironment env(); - /** - * Returns the number of tensors produced by this operation. - */ + /** Returns the number of tensors produced by this operation. */ int numOutputs(); /** diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationAttributeInspector.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationAttributeInspector.java new file mode 100644 index 00000000000..9f7c376c2fe --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationAttributeInspector.java @@ -0,0 +1,173 @@ +/* + Copyright 2021 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. +======================================================================= + +*/ +package org.tensorflow; + +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.AttributeMetadata; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; + +/** Helper type for attribute getters, so we don't clutter the operation classes too much. */ +public interface OperationAttributeInspector { + + /** + * Get the metadata of an attribute of this operation. + * + * @param name the name of the attribute + * @return the metadata of the attribute + */ + AttributeMetadata getAttrMetadata(String name); + + /** + * Get the value of an attribute of this operation as an {@link AttrValue} proto. + * + * @param name the name of the attribute + * @return the value of the attribute as an {@link AttrValue} proto + */ + AttrValue getAttrValueProto(String name); + + // TODO get attribute names. Needs TF 2.7 + + /** + * Get the value of a string attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + String getAttrString(String name); + + /** + * Get the value of a string list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + String[] getAttrStringList(String name); + + /** + * Get the value of a int attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + long getAttrInt(String name); + + /** + * Get the value of a int list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + long[] getAttrIntList(String name); + + /** + * Get the value of a float attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + float getAttrFloat(String name); + + /** + * Get the value of a float list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + float[] getAttrFloatList(String name); + + /** + * Get the value of a boolean attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + boolean getAttrBool(String name); + + /** + * Get the value of a boolean list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + boolean[] getAttrBoolList(String name); + + /** + * Get the value of a data type attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + DataType getAttrType(String name); + + /** + * Get the value of a data type list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + DataType[] getAttrTypeList(String name); + + /** + * Get the value of a tensor attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + Tensor getAttrTensor(String name); + + /** + * Get the value of a tensor list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + Tensor[] getAttrTensorList(String name); + + /** + * Get the value of a shape attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + Shape getAttrShape(String name); + + /** + * Get the value of a shape list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + Shape[] getAttrShapeList(String name); + + /** + * Get the value of a function attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + ConcreteFunction getAttrFunction(String name); + + /** + * Get the value of a function list attribute of this operation. + * + * @param name the name of the attribute + * @return the value of the attribute + */ + ConcreteFunction[] getAttrFunctionList(String name); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java index 569f37c8f4a..c648e61a938 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java @@ -1,22 +1,23 @@ /* Copyright 2019-2021 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; /** * A builder for {@link Operation}s. @@ -244,4 +245,13 @@ public interface OperationBuilder { * @return the OperationBuilder instance for chaining. */ OperationBuilder setAttr(String name, ConcreteFunction[] value); + + /** + * Set value of an attribute of the operation being built. Does not attach any functions. + * + * @param name attribute name + * @param value attribute value + * @return the OperationBuilder instance for chaining. + */ + OperationBuilder setAttr(String name, AttrValue value); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java index a7e48fcb9ee..285e3ae9fa1 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java @@ -19,7 +19,7 @@ import org.bytedeco.javacpp.Pointer; import org.tensorflow.internal.types.registry.TensorTypeRegistry; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -147,6 +147,15 @@ Pointer getUnsafeNativeHandle() { return operation.getUnsafeNativeHandle(index); } + /** + * Returns whether the underlying operation has no valid handle. Makes the opposite check as + * GraphOperation.requireHandle * + */ + public boolean isClosed() { + Pointer handle = operation.getUnsafeNativeHandle(index); + return handle == null || handle.isNull(); + } + private final AbstractOperation operation; private final int index; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/RawTensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/RawTensor.java index 2a4a21face3..702dc566441 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/RawTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/RawTensor.java @@ -27,19 +27,19 @@ import org.tensorflow.internal.types.registry.TensorTypeRegistry; import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.buffer.ByteDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A tensor which memory has not been mapped to a data space directly accessible from the JVM. * *

    A raw tensor is a minimalist representation of a tensor allocated in native memory by the - * TensorFlow runtime library and it controls its lifetime within the current process. The data - * is represented by a flat {@link ByteDataBuffer buffer of bytes}, until it is mapped in a - * n-dimensional typed space by a {@link TType typed tensor}.

    + * TensorFlow runtime library and it controls its lifetime within the current process. The data is + * represented by a flat {@link ByteDataBuffer buffer of bytes}, until it is mapped in a + * n-dimensional typed space by a {@link TType typed tensor}. * - *

    Instances of a RawTensor are not thread-safe and their resource must be released - * by calling {@link #close()} explicitly or implicitly via try-with-resources.

    + *

    Instances of a RawTensor are not thread-safe and their resource must be released by + * calling {@link #close()} explicitly or implicitly via try-with-resources. */ public final class RawTensor implements Tensor { @@ -81,9 +81,7 @@ public ByteDataBuffer data() { return buffer; } - /** - * Returns a string describing the type and shape of the tensor. - */ + /** Returns a string describing the type and shape of the tensor. */ @Override public String toString() { return String.format("%s tensor with shape %s", typeInfo.dataType(), shape); @@ -92,20 +90,20 @@ public String toString() { /** * Allocates a new tensor in native memory of the given type, shape and size. * - *

    The size of the tensor must be at least large enough to contain all scalars for the - * given type and shape. More memory can also be allocated to store also metadata within the - * tensor itself, e.g. a lookup table in a string tensor. + *

    The size of the tensor must be at least large enough to contain all scalars for the given + * type and shape. More memory can also be allocated to store also metadata within the tensor + * itself, e.g. a lookup table in a string tensor. * * @param type tensor type class * @param shape shape of the tensor * @param size size in bytes of the tensor, or -1 to compute the size from the shape * @return allocated tensor * @throws IllegalArgumentException if {@code size} is smaller than the minimum space required to - * store the tensor data - * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given - * {@code type} are of variable length (e.g. strings) - * @throws IllegalArgumentException if {@code shape} is totally or partially - * {@link Shape#hasUnknownDimension() unknown} + * store the tensor data + * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given {@code + * type} are of variable length (e.g. strings) + * @throws IllegalArgumentException if {@code shape} is totally or partially {@link + * Shape#hasUnknownDimension() unknown} * @throws IllegalStateException if tensor failed to be allocated */ static RawTensor allocate(Class type, Shape shape, long size) { @@ -123,12 +121,14 @@ static RawTensor allocate(Class type, Shape shape, long size) { allocatedSize = shape.size() * typeInfo.byteSize(); } else if (!typeInfo.isVariableLength() && shape.size() * typeInfo.byteSize() > allocatedSize) { - // Minimum requirements for datatypes of variable length cannot be verified in a relevant way so + // Minimum requirements for datatypes of variable length cannot be verified in a relevant way + // so // we only validate them for fixed length datatypes throw new IllegalArgumentException( "Tensor size is not large enough to contain all scalar values"); } - TF_Tensor nativeHandle = allocate(typeInfo.dataType().getNumber(), shape.asArray(), allocatedSize); + TF_Tensor nativeHandle = + allocate(typeInfo.dataType().getNumber(), shape.asArray(), allocatedSize); try (PointerScope scope = new PointerScope()) { scope.attach(nativeHandle); RawTensor t = new RawTensor(typeInfo, shape); @@ -147,9 +147,9 @@ static RawTensor fromHandle(TF_Tensor handle) { TensorTypeInfo typeInfo = TensorTypeRegistry.find(DataType.forNumber(dtype(handle))); RawTensor t = new RawTensor(typeInfo, Shape.of(shape(handle))); try (PointerScope scope = new PointerScope()) { - scope.attach(handle); - t.tensorHandle = handle; - t.tensorScope = scope.extend(); + scope.attach(handle); + t.tensorHandle = handle; + t.tensorScope = scope.extend(); } return t; } @@ -168,6 +168,7 @@ static RawTensor fromHandle(TF_Tensor handle, EagerSession session) { /** * Returns the native handle to this tensor + * * @throws IllegalStateException if tensor has been closed */ TF_Tensor nativeHandle() { @@ -178,7 +179,8 @@ TF_Tensor nativeHandle() { * Returns a typed reference to this tensor * *

    In some cases, it is more useful to keep a typed reference to a tensor rather than its raw - * nature to prevent mapping its memory on every access (e.g. when calling {@link Operand#asTensor()}). + * nature to prevent mapping its memory on every access (e.g. when calling {@link + * Operand#asTensor()}). * * @return typed reference to this tensor */ @@ -186,6 +188,13 @@ TType asTypedTensor() { return typeInfo.mapper().mapDense(this); } + /** + * @return metadata about the type of this tensor. + */ + TensorTypeInfo typeInfo() { + return typeInfo; + } + private static TF_Tensor requireHandle(TF_Tensor handle) { if (handle == null || handle.isNull()) { throw new IllegalStateException("close() was called on the Tensor"); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Result.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Result.java new file mode 100644 index 00000000000..74e68956eb5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Result.java @@ -0,0 +1,199 @@ +/* +Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +Copyright 2022 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. +======================================================================= +*/ +package org.tensorflow; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.tensorflow.exceptions.TensorFlowException; +import org.tensorflow.proto.RunMetadata; + +/** + * An {@link AutoCloseable} wrapper around a {@link Map} containing {@link Tensor}s. + * + *

    When this is closed it closes all the {@link Tensor}s inside it. If you maintain a reference + * to a value after this object has been closed it will throw an {@link IllegalStateException} upon + * access. + * + *

    This class is not thread-safe with respect to the close operation. Multiple closers or one + * thread closing a tensor while another is reading may throw exceptions. + * + *

    Note this class is used to manage the lifetimes of tensors produced by the TensorFlow runtime, + * from sessions and function calls. It is not used as an argument to {@code session.run} or + * function calls as users are in control of the creation of input tensors. + */ +public final class Result implements AutoCloseable, Iterable> { + @Override + public void close() { + if (!closed) { + for (Tensor t : list) { + try { + t.close(); + } catch (TensorFlowException e) { + logger.log(Level.WARNING, "Exception raised when closing tensor inside result.", e); + } + } + closed = true; + } else { + logger.warning("Closing an already closed Result"); + } + } + + @Override + public Iterator> iterator() { + if (!closed) { + return map.entrySet().iterator(); + } else { + throw new IllegalStateException("Result is closed"); + } + } + + /** + * Returns the number of outputs in this Result. + * + * @return The number of outputs. + */ + public int size() { + return map.size(); + } + + /** + * Gets the set containing all the tensor names. + * + * @return The tensor names set. + */ + public Set keySet() { + return Collections.unmodifiableSet(map.keySet()); + } + + /** + * Does this result object have a tensor for the supplied key? + * + * @param key The key to check. + * @return True if this result object has a tensor for this key. + */ + public boolean containsKey(String key) { + return map.containsKey(key); + } + + /** + * Gets the value from the container at the specified index. + * + *

    Throws {@link IllegalStateException} if the container has been closed, and {@link + * IndexOutOfBoundsException} if the index is invalid. + * + * @param index The index to lookup. + * @return The value at the index. + */ + public Tensor get(int index) { + if (!closed) { + return list.get(index); + } else { + throw new IllegalStateException("Result is closed"); + } + } + + /** + * Gets the value from the container assuming it's not been closed. + * + *

    Throws {@link IllegalStateException} if the container has been closed. + * + * @param key The key to lookup. + * @return Optional.of the value if it exists. + */ + public Optional get(String key) { + if (!closed) { + return Optional.ofNullable(map.get(key)); + } else { + throw new IllegalStateException("Result is closed"); + } + } + + /** + * Metadata about the run. + * + *

    A RunMetadata + * protocol buffer. + */ + public Optional getMetadata() { + return Optional.ofNullable(metadata); + } + + /** + * Creates a Result from the names and values produced by {@link Session.Runner#run()}. + * + * @param names The output names. + * @param values The output values. + * @param metadata The run metadata, may be null. + */ + Result(List names, List values, RunMetadata metadata) { + this.map = new LinkedHashMap<>(); + this.list = new ArrayList<>(values); + + if (names.size() != values.size()) { + throw new IllegalArgumentException( + "Expected same number of names and values, found names.length = " + + names.size() + + ", values.length = " + + values.size()); + } + + for (int i = 0; i < names.size(); i++) { + Tensor old = this.map.put(names.get(i), values.get(i)); + if (old != null) { + throw new IllegalArgumentException( + "Name collision in the result set, two outputs are named '" + names.get(i) + "'"); + } + } + this.metadata = metadata; + this.closed = false; + } + + /** + * Creates a Result from the names and values. + * + * @param outputs The run outputs. + */ + Result(LinkedHashMap outputs) { + this.map = outputs; + this.list = new ArrayList<>(outputs.size()); + for (Map.Entry e : outputs.entrySet()) { + list.add(e.getValue()); + } + this.metadata = null; + this.closed = false; + } + + private final Map map; + + private final List list; + + private final RunMetadata metadata; + + private boolean closed; + + private static final Logger logger = Logger.getLogger(Result.class.getName()); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SavedModelBundle.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SavedModelBundle.java index 6445f05d276..dbbb1ab759d 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SavedModelBundle.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SavedModelBundle.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2024 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. @@ -41,12 +41,14 @@ import org.tensorflow.internal.c_api.TF_Session; import org.tensorflow.internal.c_api.TF_SessionOptions; import org.tensorflow.internal.c_api.TF_Status; -import org.tensorflow.proto.framework.ConfigProto; -import org.tensorflow.proto.framework.MetaGraphDef; -import org.tensorflow.proto.framework.MetaGraphDef.MetaInfoDef; -import org.tensorflow.proto.framework.RunOptions; -import org.tensorflow.proto.framework.SavedModel; -import org.tensorflow.proto.util.SaverDef; +import org.tensorflow.proto.CollectionDef; +import org.tensorflow.proto.CollectionDef.NodeList; +import org.tensorflow.proto.ConfigProto; +import org.tensorflow.proto.MetaGraphDef; +import org.tensorflow.proto.MetaGraphDef.MetaInfoDef; +import org.tensorflow.proto.RunOptions; +import org.tensorflow.proto.SavedModel; +import org.tensorflow.proto.SaverDef; /** * SavedModelBundle represents a model loaded from storage. @@ -64,6 +66,24 @@ public class SavedModelBundle implements AutoCloseable { public static final String DEFAULT_TAG = "serve"; + /** + * Tensorflow init op tracking signature. Init ops are executed before loading variables, so this + * does not work for us. + */ + private static final String INIT_OP_SIGNATURE_KEY = "__saved_model_init_op"; + + /** + * A backup Tensorflow init op collection key. In TF1, init ops will be stored in collections + * instead of signatures. + */ + private static final String MAIN_OP_COLLECTION_KEY = "saved_model_main_op"; + + /** An even more legacy init op collection key. */ + private static final String LEGACY_INIT_OP_COLLECTION_KEY = "legacy_init_op"; + + /** The collection where table initializers are stored in some hub models. */ + private static final String TABLE_INITIALIZERS_COLLECTION_KEY = "table_initializer"; + /** Options for loading a SavedModel. */ public static final class Loader { @@ -230,9 +250,8 @@ public Exporter withSignature(Signature signature) { /** * Add multiple signatures to the model. Wraps {@link #withSignature(Signature)} * - *

    Either {@link #withSession(Session)} or {@link * #withFunction(SessionFunction)} must - * be called before this method, and the session set there will be used for these - * signatures. + *

    Either {@link #withSession(Session)} or {@link #withFunction(SessionFunction)} must be + * called before this method, and the session set there will be used for these signatures. * * @throws IllegalStateException if no session has been set * @return this @@ -293,6 +312,25 @@ public void export() throws IOException { private final Map functions = new LinkedHashMap<>(); } + /** + * Load a saved model from an export directory. The model that is being loaded should be created + * using the Saved Model + * API. + * + *

    This method is a shorthand for: + * + *

    {@code
    +   * SavedModelBundle.loader().load();
    +   * }
    + * + * @param exportDir the directory path containing a saved model. + * @return a bundle containing the graph and associated session. + */ + public static SavedModelBundle load(String exportDir) { + Loader loader = loader(exportDir); + return loader.load(); + } + /** * Load a saved model from an export directory. The model that is being loaded should be created * using the Saved Model @@ -310,9 +348,7 @@ public void export() throws IOException { */ public static SavedModelBundle load(String exportDir, String... tags) { Loader loader = loader(exportDir); - if (tags != null && tags.length > 0) { - loader.withTags(tags); - } + loader.withTags(tags); return loader.load(); } @@ -365,7 +401,11 @@ public Session session() { /** Return the signature of all functions available in this saved model. */ public List signatures() { - return functions.values().stream().map(f -> f.signature()).collect(Collectors.toList()); + // the init signatures aren't actual functions, just markers + return functions.values().stream() + .map(SessionFunction::signature) + .filter(s -> !s.key().equals(INIT_OP_SIGNATURE_KEY)) + .collect(Collectors.toList()); } /** @@ -382,7 +422,7 @@ public List signatures() { * @return object that can be used to make calls to a function * @throws IllegalArgumentException if {@code signatureKey} is not found in this saved model. */ - public TensorFunction function(String signatureKey) { + public SessionFunction function(String signatureKey) { SessionFunction function = functions.get(signatureKey); if (function == null) { throw new IllegalArgumentException( @@ -396,7 +436,7 @@ public TensorFunction function(String signatureKey) { * *

    All functions use the bundle's underlying session. */ - public List functions() { + public List functions() { return new ArrayList<>(functions.values()); } @@ -420,7 +460,7 @@ public List functions() { * @return list of output tensors, mapped by the signature name * @throws IllegalArgumentException if no function can be selected by default */ - public Map call(Map arguments) { + public Result call(Map arguments) { SessionFunction function = null; if (functions.size() == 1) { function = functions.values().iterator().next(); @@ -449,14 +489,40 @@ public void close() { private final Map functions; private SavedModelBundle( - Graph graph, Session session, MetaGraphDef metaGraphDef, Map signatures) { + Graph graph, + Session session, + MetaGraphDef metaGraphDef, + Map functions) { this.graph = graph; this.session = session; this.metaGraphDef = metaGraphDef; - this.functions = - signatures.entrySet().stream() - .collect( - Collectors.toMap(Entry::getKey, e -> new SessionFunction(e.getValue(), session))); + this.functions = functions; + } + + private static GraphOperation findInitOp( + Graph graph, Map signatures, Map collections) { + + Signature initSig = signatures.get(INIT_OP_SIGNATURE_KEY); + if (initSig != null) { + return (GraphOperation) + graph.outputOrThrow(initSig.getOutputs().get(INIT_OP_SIGNATURE_KEY).name).op(); + } + + CollectionDef initCollection; + if (collections.containsKey(MAIN_OP_COLLECTION_KEY)) { + initCollection = collections.get(MAIN_OP_COLLECTION_KEY); + } else { + initCollection = collections.get(LEGACY_INIT_OP_COLLECTION_KEY); + } + + if (initCollection != null) { + NodeList nodes = initCollection.getNodeList(); + if (nodes.getValueCount() != 1) { + throw new IllegalArgumentException("Expected exactly one main op in saved model."); + } + return (GraphOperation) graph.outputOrThrow(nodes.getValue(0)).op(); + } + return null; } /** @@ -486,7 +552,34 @@ private static SavedModelBundle fromHandle( functions.put(signatureName, signature); } }); - return new SavedModelBundle(graph, session, metaGraphDef, functions); + + GraphOperation initOp = findInitOp(graph, functions, metaGraphDef.getCollectionDefMap()); + if (initOp != null) { + graph.registerInitializer(initOp, false); + } + + session.markAllInitializersAsRan(); + + // FIXME: For Ryan, why marking all initializers as run before adding these ones? + if (metaGraphDef.containsCollectionDef(TABLE_INITIALIZERS_COLLECTION_KEY)) { + metaGraphDef + .getCollectionDefMap() + .get(TABLE_INITIALIZERS_COLLECTION_KEY) + .getNodeList() + .getValueList() + .forEach( + node -> { + graph.registerInitializer(graph.operationOrThrow(node), false); + }); + } + + return new SavedModelBundle( + graph, + session, + metaGraphDef, + functions.entrySet().stream() + .collect( + Collectors.toMap(Entry::getKey, e -> new SessionFunction(e.getValue(), session)))); } private static SavedModelBundle load( @@ -525,6 +618,7 @@ private static SavedModelBundle load( throw new TensorFlowException("Cannot parse MetaGraphDef protocol buffer", e); } } + bundle.session.initialize(); return bundle; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Server.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Server.java index 2488a93c929..bc5e0fdc5cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Server.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Server.java @@ -25,7 +25,7 @@ import org.bytedeco.javacpp.PointerScope; import org.tensorflow.internal.c_api.TF_Server; import org.tensorflow.internal.c_api.TF_Status; -import org.tensorflow.proto.distruntime.ServerDef; +import org.tensorflow.proto.ServerDef; /** * An in-process TensorFlow server, for use in distributed training. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java index dfb8b7bbf60..80d99f227ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2022 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. @@ -22,11 +22,8 @@ import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Set; import org.bytedeco.javacpp.BytePointer; import org.bytedeco.javacpp.Pointer; import org.bytedeco.javacpp.PointerPointer; @@ -44,11 +41,11 @@ import org.tensorflow.op.Op; import org.tensorflow.op.Ops; import org.tensorflow.op.core.ReadVariableOp; -import org.tensorflow.proto.framework.ConfigProto; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.RunMetadata; -import org.tensorflow.proto.framework.RunOptions; -import org.tensorflow.proto.util.SaverDef; +import org.tensorflow.proto.ConfigProto; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.RunMetadata; +import org.tensorflow.proto.RunOptions; +import org.tensorflow.proto.SaverDef; import org.tensorflow.types.TString; /** @@ -183,13 +180,12 @@ public void close() { * *

    This runs any ops that have been created with an init scope that have not already been ran. */ - public void initialize() { - Runner runner = runner(); - graph.initializers().stream().filter((x) -> !ranInits.contains(x)).forEach(runner::addTarget); - ranInits.clear(); - ranInits.addAll(graph.initializers()); - if (!runner.isEmpty()) { + public synchronized void initialize() { + if (hasUnranInitializers()) { + Runner runner = runner(); + graph.initializers().stream().skip(ranInitializersMarker).forEach(runner::addTarget); runner.runNoInit(); + markAllInitializersAsRan(); } } @@ -200,15 +196,13 @@ public void initialize() { * * @return this */ - public Session forceInitialize() { - Set initializers = graph.initializers(); - if (!initializers.isEmpty()) { - Runner runner = runner(); - initializers.forEach(runner::addTarget); + public synchronized Session forceInitialize() { + Runner runner = runner(); + graph.initializers().stream().forEach(runner::addTarget); + if (!runner.isEmpty()) { runner.runNoInit(); } - ranInits.clear(); - ranInits.addAll(graph.initializers()); + markAllInitializersAsRan(); return this; } @@ -227,8 +221,8 @@ public final class Runner { * Avoid evaluating {@code operation} and substitute {@code t} for the value it produces. * * @param operation Is either the string name of the operation, in which case this method is a - * shorthand for {@code feed(operation, 0)}, or it is a string of the form - * operation_name:output_index , in which case this method acts like {@code + * shorthand for {@code feed(operation, 0)}, or it is a string of the form {@code + * operation_name:output_index}, in which case this method acts like {@code * feed(operation_name, output_index)}. These colon-separated names are commonly used in the * {@code SignatureDef} protocol buffer messages that are included in {@link * SavedModelBundle#metaGraphDef()}. @@ -289,8 +283,8 @@ public Runner feed(Operand operand, Tensor t) { *

    If the output is a resource variable, will fetch the value. * * @param operation Is either the string name of the operation, in which case this method is a - * shorthand for {@code fetch(operation, 0)}, or it is a string of the form - * operation_name:output_index , in which case this method acts like {@code + * shorthand for {@code fetch(operation, 0)}, or it is a string of the form {@code + * operation_name:output_index}, in which case this method acts like {@code * fetch(operation_name, output_index)}. These colon-separated names are commonly used in * the {@code SignatureDef} protocol buffer messages that are included in {@link * SavedModelBundle#metaGraphDef()}. @@ -298,7 +292,9 @@ public Runner feed(Operand operand, Tensor t) { * @throws IllegalArgumentException if no output exists with the provided name */ public Runner fetch(String operation) { - return fetch(graph.outputOrThrow(operation)); + Runner r = fetch(graph.outputOrThrow(operation), false); + outputNames.add(operation); + return r; } /** @@ -328,6 +324,20 @@ public Runner fetch(String operation, int index) { * @return this session runner */ public Runner fetch(Output output) { + return fetch(output, true); + } + + /** + * Makes {@link #run()} return the Tensor referred to by {@code output}. + * + *

    If {@code output} is a resource variable, will fetch the value. + * + * @param output the node to fetch the tensor from + * @param recordName Records the output name. If false the output name must be recorded by the + * calling method as otherwise the result object will throw on construction. + * @return this session runner + */ + private Runner fetch(Output output, boolean recordName) { if (output.env() != graph) { throw new IllegalStateException( "Can't fetch output " @@ -370,6 +380,9 @@ public Runner fetch(Output output) { } else { outputs.add(output); } + if (recordName) { + outputNames.add(output.name()); + } return this; } @@ -389,12 +402,13 @@ public Runner fetch(Operand operand) { * Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor * Tensors}. * - * @param operation the string name of the operation to execute + * @param operation Is either the string name of the operation or it is a string of the form + * {@code operation_name:output_index}, where {@code output_index} will simply be ignored. * @return this session runner * @throws IllegalArgumentException if no operation exists with the provided name */ public Runner addTarget(String operation) { - return addTarget(graph.operationOrThrow(operation)); + return addTarget(graph.outputOrThrow(operation)); } /** @@ -449,45 +463,17 @@ public boolean isEmpty() { return targets.isEmpty() && outputs.isEmpty(); } - private void doInit() { - if (autoInit) { - initialize(); - } else { - graph - .initializers() - .forEach( - x -> { - if (!ranInits.contains(x)) - throw new IllegalStateException( - "Graph has un-ran initializers, but the session's autoInit is false. Run Session.initialize() before calling run()."); - }); - } - } - /** * Execute the graph fragments necessary to compute all requested fetches. * *

    WARNING: The caller assumes ownership of all returned {@link Tensor Tensors}, i.e., - * the caller must call {@link Tensor#close} on all elements of the returned list to free up - * resources. - * - *

    TODO(ashankar): Reconsider the return type here. Two things in particular: (a) Make it - * easier for the caller to cleanup (perhaps returning something like AutoCloseableList in - * SessionTest.java), and (b) Evaluate whether the return value should be a list, or maybe a - * {@code Map}? - * - *

    TODO(andrewmyers): It would also be good if whatever is returned here made it easier to - * extract output tensors in a type-safe way. + * the caller must call {@link Result#close} to free up resources. * * @return list of resulting tensors fetched by this session runner */ - public List run() { - doInit(); - return runNoInit(); - } - - List runNoInit() { - return runHelper(false).outputs; + public Result run() { + verifyInit(); + return runHelper(false); } /** @@ -500,12 +486,32 @@ List runNoInit() { * * @return list of resulting tensors fetched by this session runner, with execution metadata */ - public Run runAndFetchMetadata() { - doInit(); + public Result runAndFetchMetadata() { + verifyInit(); return runHelper(true); } - private Run runHelper(boolean wantMetadata) { + /** + * Link {@link #run()} but without trying to initialize the session if it's not + * + * @return list of resulting tensors fetched by this session runner + */ + Result runNoInit() { + return runHelper(false); + } + + private void verifyInit() { + if (hasUnranInitializers()) { + if (autoInit) { + initialize(); + } else { + throw new IllegalStateException( + "Graph has un-ran initializers, but the session's autoInit is false. Run Session.initialize() before calling run()."); + } + } + } + + private Result runHelper(boolean wantMetadata) { TF_Tensor[] inputTensorHandles = new TF_Tensor[inputTensors.size()]; TF_Operation[] inputOpHandles = new TF_Operation[inputs.size()]; int[] inputOpIndices = new int[inputs.size()]; @@ -560,10 +566,7 @@ private Run runHelper(boolean wantMetadata) { } finally { runRef.close(); } - Run ret = new Run(); - ret.outputs = outputs; - ret.metadata = metadata; - return ret; + return new Result(outputNames, outputs, metadata); } private class Reference implements AutoCloseable { @@ -593,6 +596,7 @@ public void close() { private final ArrayList> inputs = new ArrayList<>(); private final ArrayList inputTensors = new ArrayList<>(); private final ArrayList> outputs = new ArrayList<>(); + private final ArrayList outputNames = new ArrayList<>(); private final ArrayList targets = new ArrayList<>(); private RunOptions runOptions = null; } @@ -639,8 +643,9 @@ public SessionFunction function(Signature signature) { * * @param signature the signature of the function * @param arguments the arguments to call with. + * @return The results of the function call. */ - public Map run(Signature signature, Map arguments) { + public Result run(Signature signature, Map arguments) { return function(signature).call(arguments); } @@ -657,7 +662,7 @@ public Map run(Signature signature, Map argument * * @param prefix prefix to the variable files to save */ - public void save(String prefix) { + public synchronized void save(String prefix) { SaverDef saverDef = graph.saverDef(); runner() .addTarget(saverDef.getSaveTensorName()) @@ -679,38 +684,17 @@ public void save(String prefix) { * * @param prefix prefix to restore from */ - public void restore(String prefix) { + public synchronized void restore(String prefix) { SaverDef saverDef = graph.saverDef(); runner() .addTarget(saverDef.getRestoreOpName()) .feed(saverDef.getFilenameTensorName(), TString.scalarOf(prefix)) .runNoInit(); // TODO better way of doing this, only count as ran assignments to the restored variables. - ranInits.clear(); - ranInits.addAll(graph.initializers()); + markAllInitializersAsRan(); } - /** - * Output tensors and metadata obtained when executing a session. - * - *

    See {@link Runner#runAndFetchMetadata()} - */ - public static final class Run { - - /** Tensors from requested fetches. */ - public List outputs; - - /** - * Metadata about the run. - * - *

    A RunMetadata - * protocol buffer. - */ - public RunMetadata metadata; - } - - Graph graph() { + public Graph graph() { return graph; } @@ -722,7 +706,7 @@ Graph graph() { private int numActiveRuns; private final boolean autoInit; - private final Set ranInits = Collections.synchronizedSet(new LinkedHashSet<>()); + private int ranInitializersMarker = 0; private static void requireHandle(Pointer handle) { if (handle == null || handle.isNull()) { @@ -852,4 +836,12 @@ private static RunMetadata run( } } } + + private boolean hasUnranInitializers() { + return ranInitializersMarker < graph.initializers().size(); + } + + void markAllInitializersAsRan() { + ranInitializersMarker = graph.initializers().size(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SessionFunction.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SessionFunction.java index 07bc418ac51..877ba1b2f2c 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SessionFunction.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SessionFunction.java @@ -1,23 +1,22 @@ -/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2021-2022 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 +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 + 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow; import java.io.IOException; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; /** @@ -89,7 +88,7 @@ public SessionFunction withNewSession(Session session) { } @Override - public Map call(Map arguments) { + public Result call(Map arguments) { Session.Runner runner = session.runner(); signature .getInputs() @@ -113,15 +112,16 @@ public Map call(Map arguments) { signature.getOutputs().values().forEach(x -> runner.fetch(x.name)); - List results = runner.run(); + Result results = runner.run(); - Map outputs = new LinkedHashMap<>(results.size()); + // Unpack the result object and rebuild it with the expected names. + LinkedHashMap outputs = new LinkedHashMap<>(results.size()); int i = 0; for (String outputName : signature.outputNames()) { outputs.put(outputName, results.get(i)); i++; } - return outputs; + return new Result(outputs); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Signature.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Signature.java index 251f5a6e4b3..0d6866c4e70 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Signature.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Signature.java @@ -1,18 +1,18 @@ /* Copyright 2020-2021 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow; import java.util.Collections; @@ -20,11 +20,11 @@ import java.util.Map; import java.util.Set; import org.tensorflow.ndarray.Shape; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.SignatureDef; -import org.tensorflow.proto.framework.TensorInfo; -import org.tensorflow.proto.framework.TensorShapeProto; -import org.tensorflow.proto.framework.TensorShapeProto.Dim; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.SignatureDef; +import org.tensorflow.proto.TensorInfo; +import org.tensorflow.proto.TensorShapeProto; +import org.tensorflow.proto.TensorShapeProto.Dim; /** * Describe the inputs and outputs of an executable entity, such as a {@link ConcreteFunction}, @@ -39,6 +39,7 @@ public static class TensorDescription { /** The name of the tensor's operand in the graph */ public final String name; + /** The data type of the tensor */ public final DataType dataType; @@ -157,11 +158,15 @@ public Signature build() { return new Signature(key, signatureBuilder.build()); } - private static TensorInfo toTensorInfo(Output operand) { + static TensorInfo toTensorInfo(Output operand) { Shape shape = operand.shape(); TensorShapeProto.Builder tensorShapeBuilder = TensorShapeProto.newBuilder(); - for (int i = 0; i < shape.numDimensions(); ++i) { - tensorShapeBuilder.addDim(Dim.newBuilder().setSize(shape.size(i))); + if (shape.isUnknown()) { + tensorShapeBuilder.setUnknownRank(true); + } else { + for (int i = 0; i < shape.numDimensions(); ++i) { + tensorShapeBuilder.addDim(Dim.newBuilder().setSize(shape.get(i))); + } } return TensorInfo.newBuilder() .setDtype(operand.dataType()) diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SparseTensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SparseTensor.java new file mode 100644 index 00000000000..752b1786354 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/SparseTensor.java @@ -0,0 +1,165 @@ +/* Copyright 2022 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. +==============================================================================*/ +package org.tensorflow; + +import org.bytedeco.javacpp.PointerScope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +/** + * A virtual type of {@link Tensor} composed of three dense tensors (indices, values and dimensions) + * used to represent the sparse data into a multi-dimensional dense space. + * + *

    Any tensor returned by a sparse tensor factory (e.g. {@link TInt64#sparseTensorOf(TInt64, + * TInt64, TInt64)}) can be casted back to this interface to access directly the dense tensors it is + * composed of. + * + *

    A sparse tensor will keep strong references to its dense tensors to prevent them to be + * released before it is closed itself. Likewise, closing a sparse tensor won't release the memory + * of its dense tensors until they in turn are closed. It is then important to protect not only the + * dense tensors within a try-with-resource block but the sparse tensor itself. + * + *

    For example, this code is perfectly safe: + * + *

    {@code
    + * TFloat64 createSparseTensor() {
    + *     try (TInt64 indices = TInt64.tensorOf(...);
    + *         TFloat64 values = TFloat64.vectorOf(...);
    + *         TInt64 denseShape = TInt64.vectorOf(...)) {
    + *         return TFloat64.sparseTensorOf(indices, values, denseShape);
    + *     }
    + * }
    + * try (TFloat64 sparseTensor = createSparseTensor()) {
    + *     ...
    + * }
    + * }
    + * + * @param type of data stored in the tensor + */ +public interface SparseTensor extends Tensor { + + /** + * Creates a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3.8]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18}, and element {@code [2,4,0]} of the tensor has a value of {@code 3.8}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @throws IllegalArgumentException if shapes of the dense tensors are not compatible + */ + static SparseTensor of(TInt64 indices, T values, TInt64 denseShape) { + if (indices.rank() != 2) { + throw new IllegalArgumentException("Sparse indices must be a rank-2 tensor"); + } + if (values.rank() != 1) { + throw new IllegalArgumentException("Sparse values must be a rank-1 tensor"); + } + if (denseShape.rank() != 1) { + throw new IllegalArgumentException("Sparse shape must be a rank-1 tensor"); + } + if (indices.shape().get(0) != values.shape().get(0)) { + throw new IllegalArgumentException( + "Number of indices must be equal to the number of values [" + + indices.shape().get(0) + + " != " + + values.shape().get(0) + + "]"); + } + if (indices.shape().get(1) != denseShape.shape().get(0)) { + throw new IllegalArgumentException( + "Indices must have a coordinate for each dimensions of the tensor [" + + indices.shape().get(1) + + " != " + + denseShape.shape().get(0) + + "]"); + } + // Use mapper of the values tensor as this is the one giving the type of the sparse tensor as + // well + TensorMapper mapper = (TensorMapper) values.asRawTensor().typeInfo().mapper(); + + // Attach all tensors to a new pointer scope (this will increment their reference count) and + // preserve a strong reference to that scope inside the sparse tensor. This is done by + // extending this scope in the sparse tensor constructors, via mapSparse() + try (PointerScope scope = new PointerScope()) { + scope.attach(indices.asRawTensor().nativeHandle()); + scope.attach(values.asRawTensor().nativeHandle()); + scope.attach(denseShape.asRawTensor().nativeHandle()); + return mapper.mapSparse(indices, values, denseShape, scope); + } + } + + @Override + default RawTensor asRawTensor() { + throw new UnsupportedOperationException( + "Sparse tensors cannot be converted to a single raw tensor"); + } + + /** + * Returns this instance as a typed tensor. + * + *

    This method is equivalent to cast directly the {@code SparseTensor} instance to {@code + * T}. + * + * @return the typed tensor + */ + default T asTypedTensor() { + return (T) this; + } + + /** + * Gets the indices of the sparsed values. + * + *

    Indices are a 2-D long array of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain nonzero values (elements are zero-indexed). + * + *

    For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * coordinates {@code [1,3]} and {@code [2,4]} have nonzero values. + * + * @return the indices + */ + TInt64 indices(); + + /** + * Gets the sparse values. + * + *

    Values are a 1-D array of type {@code T} and shape {@code [N]}, that supplies the values for + * each element in indices. + * + *

    For example, given {@code indices=[[1,3], [2,4]]}, and {@code values=[18, 3.6]} specifies + * that element {@code [1,3]} of the sparse tensor has a value of {@code 18}, and element {@code + * [2,4]} of the sparse tensor has a value of {@code 3.6}. + * + * @return the values + */ + T values(); + + /** + * Gets the sparse tensor dimensions defining the shape in that tensor in a dense space. + * + *

    Dimensions A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents to total number of element in dimension {@code i} in a dense version of that tensor. + * + * @return the dense shape + */ + TInt64 denseShape(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java index fc1275229bf..0c243f4a2ab 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java @@ -1,4 +1,4 @@ -/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2016-2024 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. @@ -19,16 +19,16 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.Shaped; import org.tensorflow.ndarray.buffer.ByteDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** * A statically typed multi-dimensional array. * - *

    There are two categories of tensors in TensorFlow Java: {@link TType typed tensors} and - * {@link RawTensor raw tensors}. The former maps the tensor native memory to an - * n-dimensional typed data space, allowing direct I/O operations from the JVM, while the latter - * is only a reference to a native tensor allowing basic operations and flat data access.

    + *

    There are two categories of tensors in TensorFlow Java: {@link TType typed tensors} and {@link + * RawTensor raw tensors}. The former maps the tensor native memory to an n-dimensional typed data + * space, allowing direct I/O operations from the JVM, while the latter is only a reference to a + * native tensor allowing basic operations and flat data access. * *

    WARNING: Resources consumed by the Tensor object must be explicitly freed by * invoking the {@link #close()} method when the object is no longer needed. For example, using a @@ -39,6 +39,7 @@ * doSomethingWith(t); * } * } + * *

    Instances of a Tensor are not thread-safe. */ public interface Tensor extends Shaped, AutoCloseable { @@ -54,9 +55,9 @@ public interface Tensor extends Shaped, AutoCloseable { * @param shape shape of the tensor * @return an allocated but uninitialized tensor * @throws IllegalArgumentException if elements of the given {@code type} are of variable length - * (e.g. strings) - * @throws IllegalArgumentException if {@code shape} is totally or partially - * {@link Shape#hasUnknownDimension() unknown} + * (e.g. strings) + * @throws IllegalArgumentException if {@code shape} is totally or partially {@link + * Shape#hasUnknownDimension() unknown} * @throws IllegalStateException if tensor failed to be allocated */ static T of(Class type, Shape shape) { @@ -67,8 +68,8 @@ static T of(Class type, Shape shape) { * Allocates a tensor of a given datatype, shape and size. * *

    This method is identical to {@link #of(Class, Shape)}, except that the final size of the - * tensor can be explicitly set instead of computing it from the datatype and shape, which could be - * larger than the actual space required to store the data but not smaller. + * tensor can be explicitly set instead of computing it from the datatype and shape, which could + * be larger than the actual space required to store the data but not smaller. * * @param the tensor type * @param type the tensor type class @@ -77,17 +78,17 @@ static T of(Class type, Shape shape) { * @return an allocated but uninitialized tensor * @see #of(Class, Shape) * @throws IllegalArgumentException if {@code size} is smaller than the minimum space required to - * store the tensor data - * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given - * {@code type} are of variable length (e.g. strings) - * @throws IllegalArgumentException if {@code shape} is totally or partially - * {@link Shape#hasUnknownDimension() unknown} + * store the tensor data + * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given {@code + * type} are of variable length (e.g. strings) + * @throws IllegalArgumentException if {@code shape} is totally or partially {@link + * Shape#hasUnknownDimension() unknown} * @throws IllegalStateException if tensor failed to be allocated */ static T of(Class type, Shape shape, long size) { RawTensor tensor = RawTensor.allocate(type, shape, size); try { - return (T)tensor.asTypedTensor(); + return (T) tensor.asTypedTensor(); } catch (Exception e) { tensor.close(); throw e; @@ -99,7 +100,7 @@ static T of(Class type, Shape shape, long size) { * *

    The amount of memory to allocate is derived from the datatype and the shape of the tensor. * Tensor data is initialized by calling the {@code dataInitializer}, which receives in argument - * the value returned by {@link #data()} on the allocated tensor. For example: + * the value returned by {@code data()} on the allocated tensor. For example: * *

    {@code
        * FloatNdArray data = ...
    @@ -114,12 +115,13 @@ static  T of(Class type, Shape shape, long size) {
        * @param  the tensor type
        * @param type the tensor type class
        * @param shape shape of the tensor
    -   * @param dataInitializer method receiving accessor to the allocated tensor data for initialization
    +   * @param dataInitializer method receiving accessor to the allocated tensor data for
    +   *     initialization
        * @return an allocated and initialized tensor
        * @throws IllegalArgumentException if elements of the given {@code type} are of variable length
    -   *                                  (e.g. strings)
    -   * @throws IllegalArgumentException if {@code shape} is totally or partially
    -   *                                  {@link Shape#hasUnknownDimension() unknown}
    +   *     (e.g. strings)
    +   * @throws IllegalArgumentException if {@code shape} is totally or partially {@link
    +   *     Shape#hasUnknownDimension() unknown}
        * @throws IllegalStateException if tensor failed to be allocated
        */
       static  T of(Class type, Shape shape, Consumer dataInitializer) {
    @@ -129,28 +131,30 @@ static  T of(Class type, Shape shape, Consumer dataInitia
       /**
        * Allocates a tensor of a given datatype, shape and size.
        *
    -   * 

    This method is identical to {@link #of(Class, Shape, Consumer)}, except that the final - * size for the tensor can be explicitly set instead of being computed from the datatype and shape. + *

    This method is identical to {@link #of(Class, Shape, Consumer)}, except that the final size + * for the tensor can be explicitly set instead of being computed from the datatype and shape. * - *

    This could be useful for tensor types that stores data but also metadata in the tensor memory, - * such as the lookup table in a tensor of strings. + *

    This could be useful for tensor types that stores data but also metadata in the tensor + * memory, such as the lookup table in a tensor of strings. * * @param the tensor type * @param type the tensor type class * @param shape shape of the tensor * @param size size in bytes of the tensor or -1 to compute the size from the shape - * @param dataInitializer method receiving accessor to the allocated tensor data for initialization + * @param dataInitializer method receiving accessor to the allocated tensor data for + * initialization * @return an allocated and initialized tensor * @see #of(Class, Shape, long, Consumer) * @throws IllegalArgumentException if {@code size} is smaller than the minimum space required to - * store the tensor data - * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given - * {@code type} are of variable length (e.g. strings) - * @throws IllegalArgumentException if {@code shape} is totally or partially - * {@link Shape#hasUnknownDimension() unknown} + * store the tensor data + * @throws IllegalArgumentException if {@code size} is set to -1 but elements of the given {@code + * type} are of variable length (e.g. strings) + * @throws IllegalArgumentException if {@code shape} is totally or partially {@link + * Shape#hasUnknownDimension() unknown} * @throws IllegalStateException if tensor failed to be allocated */ - static T of(Class type, Shape shape, long size, Consumer dataInitializer) { + static T of( + Class type, Shape shape, long size, Consumer dataInitializer) { T tensor = of(type, shape, size); try { dataInitializer.accept(tensor); @@ -172,36 +176,46 @@ static T of(Class type, Shape shape, long size, Consumer * @param shape the tensor shape. * @param rawData a buffer containing the tensor raw data. * @throws IllegalArgumentException if {@code rawData} is not large enough to contain the tensor - * data - * @throws IllegalArgumentException if {@code shape} is totally or partially - * {@link Shape#hasUnknownDimension() unknown} + * data + * @throws IllegalArgumentException if {@code shape} is totally or partially {@link + * Shape#hasUnknownDimension() unknown} * @throws IllegalStateException if tensor failed to be allocated with the given parameters */ static T of(Class type, Shape shape, ByteDataBuffer rawData) { - return of(type, shape, rawData.size(), t -> rawData.copyTo(t.asRawTensor().data(), rawData.size())); + return of( + type, shape, rawData.size(), t -> rawData.copyTo(t.asRawTensor().data(), rawData.size())); } - /** - * Returns the {@link DataType} of elements stored in the tensor. - */ + /** Returns the {@link DataType} of elements stored in the tensor. */ DataType dataType(); - /** - * Returns the size, in bytes, of the tensor data. - */ + /** Returns the size, in bytes, of the tensor data. */ long numBytes(); - /** - * Returns the shape of the tensor. - */ + /** Returns the shape of the tensor. */ @Override Shape shape(); /** * Returns a raw (untyped) representation of this tensor + * + * @throws UnsupportedOperationException if this tensor is composed of other tensors, such as + * {@link SparseTensor sparse tensors}. */ RawTensor asRawTensor(); + /** + * Check if this tensor is sparse or not. + * + *

    When this method returns {@code true}, the tensor could be cast to a {@link SparseTensor} to + * access its indices, values and denseShape tensors. + * + * @return true if this tensor is a sparse tensor. + */ + default boolean isSparse() { + return false; + } + /** * Release resources associated with the Tensor. * diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java index 23f4c62bc7f..a6b9e86dd9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java @@ -1,36 +1,50 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2022 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 +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 + 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_HasGradient; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_RegisterCustomGradient; import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteBuffer; import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteLibraryHandle; import static org.tensorflow.internal.c_api.global.tensorflow.TF_GetAllOpList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_GetOpList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_LoadLibrary; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_RegisterFilesystemPlugin; import static org.tensorflow.internal.c_api.global.tensorflow.TF_Version; import com.google.protobuf.InvalidProtocolBufferException; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; import org.bytedeco.javacpp.PointerScope; import org.tensorflow.exceptions.TensorFlowException; +import org.tensorflow.internal.c_api.TFJ_GradFuncAdapter; +import org.tensorflow.internal.c_api.TFJ_RuntimeLibrary; import org.tensorflow.internal.c_api.TF_Buffer; import org.tensorflow.internal.c_api.TF_Library; import org.tensorflow.internal.c_api.TF_Status; -import org.tensorflow.proto.framework.OpList; +import org.tensorflow.op.CustomGradient; +import org.tensorflow.op.GradientDispatch; +import org.tensorflow.op.RawCustomGradient; +import org.tensorflow.op.RawOpInputs; +import org.tensorflow.op.annotation.OpInputsMetadata; +import org.tensorflow.op.annotation.OpMetadata; +import org.tensorflow.proto.OpList; /** Static utility methods describing the TensorFlow runtime. */ public final class TensorFlow { @@ -96,6 +110,21 @@ public static OpList loadLibrary(String filename) { } } + /** + * Loads the filesystem plugin from filename and registers all the filesystems it supports. + * + *

    Throws a TF runtime exception if the plugin failed to load. + * + * @param filename Path of the dynamic library containing the filesystem support. + */ + public static void registerFilesystemPlugin(String filename) { + try (PointerScope scope = new PointerScope()) { + TF_Status status = TF_Status.newStatus(); + TF_RegisterFilesystemPlugin(filename, status); + status.throwExceptionIfNotOK(); + } + } + private static TF_Library libraryLoad(String filename) { try (PointerScope scope = new PointerScope()) { TF_Status status = TF_Status.newStatus(); @@ -125,7 +154,7 @@ private TensorFlow() {} /** Load the TensorFlow runtime C library. */ static { try { - NativeLibrary.load(); + TFJ_RuntimeLibrary.load(); } catch (Exception e) { /* * This code is called during static initialization of this and of other classes. @@ -138,4 +167,110 @@ private TensorFlow() {} throw e; } } + + /* + * Keeps references to custom gradient functions to prevent them from being deallocated. All + * access of this set should be synchronized on this class. + * + *

    Required for correctness + */ + private static final Set gradientFuncs = + Collections.newSetFromMap(new IdentityHashMap<>()); + + static synchronized boolean hasGradient(String opType) { + return TFJ_HasGradient(opType); + } + + /** + * Register a custom gradient function for ops of {@code opType} type. + * + *

    Creates the gradient based off of a {@link GraphOperation}. To operate on the op input class + * instead use {@link CustomGradient}. + * + *

    Note that this only works with graph gradients, and will eventually be deprecated in favor + * of unified gradient support once it is fully supported by tensorflow core. + * + *

    Warning: Custom gradient registration is currently not supported on Windows, see GitHub issue for more info. + * + * @param opType the type of op to register the gradient for. Should usually be an {@code OP_NAME} + * field, i.e. {@link org.tensorflow.op.math.Add#OP_NAME}. + * @param gradient the gradient function to use + * @return {@code true} if the gradient was registered, {@code false} if there was already a + * gradient registered for this op + */ + public static synchronized boolean registerCustomGradient( + String opType, RawCustomGradient gradient) { + if (isWindowsOs()) { + throw new UnsupportedOperationException( + "Custom gradient registration is not supported on Windows systems."); + } + if (hasGradient(opType)) { + return false; + } + + GradientDispatch.putRaw(opType, gradient); + TFJ_GradFuncAdapter g = GradientDispatch.adapter(); + + if (!TFJ_RegisterCustomGradient(opType, g)) { + return false; + } + gradientFuncs.add(g); + return true; + } + + /** + * Register a custom gradient function for ops of {@code inputClass}'s op type. The actual op type + * is detected from the class's {@link OpInputsMetadata} annotation. As such, it only works on + * generated op classes or custom op classes with the correct annotations. To operate on the + * {@link org.tensorflow.GraphOperation} directly use {@link RawCustomGradient}. + * + *

    Warning: Custom gradient registration is currently not supported on Windows, see GitHub issue for more info. + * + * @param inputClass the inputs class of op to register the gradient for. + * @param gradient the gradient function to use + * @return {@code true} if the gradient was registered, {@code false} if there was already a + * gradient registered for this op + * @throws IllegalArgumentException if {@code inputClass} is not annotated with {@link + * OpInputsMetadata} or the op class is not annotated with {@link OpMetadata}. + */ + public static synchronized > boolean registerCustomGradient( + Class inputClass, CustomGradient gradient) { + if (isWindowsOs()) { + throw new UnsupportedOperationException( + "Custom gradient registration is not supported on Windows systems."); + } + OpInputsMetadata metadata = inputClass.getAnnotation(OpInputsMetadata.class); + if (metadata == null) { + throw new IllegalArgumentException( + "Inputs Class " + + inputClass + + " does not have a OpInputsMetadata annotation. Was it generated by tensorflow/java? If it was, this is a bug."); + } + OpMetadata outputMetadata = metadata.outputsClass().getAnnotation(OpMetadata.class); + if (outputMetadata == null) { + throw new IllegalArgumentException( + "Op Class " + + metadata.outputsClass() + + " does not have a OpMetadata annotation. Was it generated by tensorflow/java? If it was, this is a bug."); + } + String opType = outputMetadata.opType(); + if (hasGradient(opType)) { + return false; + } + + GradientDispatch.putTyped(opType, gradient, inputClass); + TFJ_GradFuncAdapter g = GradientDispatch.adapter(); + + if (!TFJ_RegisterCustomGradient(opType, g)) { + return false; + } + gradientFuncs.add(g); + return true; + } + + private static boolean isWindowsOs() { + return System.getProperty("os.name", "").toLowerCase(Locale.ENGLISH).startsWith("win"); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFunction.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFunction.java index 0304d786494..1b83a1176ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFunction.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFunction.java @@ -1,18 +1,18 @@ /* Copyright 2021 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 +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 + 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow; import java.util.LinkedHashMap; @@ -28,7 +28,7 @@ public interface TensorFunction { /** * Invokes a function using the default eager session. * - *

    Caller is responsible for closing all Tensors. + *

    Caller is responsible for close the result object. * * @param arguments list of tensors to pass in input to the function, mapped by their signature * name @@ -37,7 +37,7 @@ public interface TensorFunction { * @throws IllegalArgumentException if the passed arguments don't match up to the function's * parameters. */ - Map call(Map arguments); + Result call(Map arguments); /** * Invokes a function with a single input and output using the default eager session. @@ -76,12 +76,11 @@ default Tensor call(Tensor tensor) { } String inputName = signature().inputNames().iterator().next(); - String outputName = signature().outputNames().iterator().next(); Map inputMap = new LinkedHashMap<>(); inputMap.put(inputName, tensor); - return call(inputMap).get(outputName); + return call(inputMap).get(0); } static Operand validateDescription( diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorMapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorMapper.java index 9896f55b55b..1abf8c115cf 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorMapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorMapper.java @@ -16,12 +16,14 @@ */ package org.tensorflow; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Maps the native memory of a {@link RawTensor} to a n-dimensional typed data space - * accessible from the JVM. + * Maps the native memory of a {@link RawTensor} to a n-dimensional typed data space accessible from + * the JVM. * *

    Usage of this class is reserved for internal purposes only. * @@ -38,6 +40,20 @@ public abstract class TensorMapper { */ protected abstract T mapDense(RawTensor tensor); + /** + * Maps the provided dense {@code tensors} as a sparse tensor of type {@code T}. + * + * @param indices indices of the non-default values in a dense space + * @param values non-default values of the tensor + * @param denseShape size of the dimensions definining the shape of the sparse tensor in a dense + * space. + * @param tensorScope scope to extend to keep a reference on the sub-tensors composing this sparse + * tensor + * @return an instance of {@code T}. + */ + protected abstract SparseTensor mapSparse( + TInt64 indices, T values, TInt64 denseShape, PointerScope tensorScope); + /** * Helper for retrieving the native handle of a raw tensor * 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 48ee4f72bee..3bf262bec14 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 @@ -23,27 +23,24 @@ import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_GetSize; import java.nio.ReadOnlyBufferException; -import java.util.function.Function; import org.bytedeco.javacpp.BytePointer; import org.bytedeco.javacpp.Loader; import org.bytedeco.javacpp.Pointer; import org.bytedeco.javacpp.PointerScope; -import org.tensorflow.TensorFlow; -import org.tensorflow.ndarray.buffer.DataBuffer; import org.tensorflow.internal.c_api.TF_TString; +import org.tensorflow.ndarray.buffer.DataBuffer; import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; import org.tensorflow.ndarray.impl.buffer.Validator; -import org.tensorflow.ndarray.NdArray; /** * Buffer for storing string tensor data. * - *

    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 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)} - * priory to know exactly how many bytes are required to store the data). + *

    The data of the buffer must be initialized only once, by calling {@link #init}, and the buffer + * must have been allocated with enough space (use {@link #computeSize} priory to know exactly how + * many bytes are required to store the data). * *

    After its data has been initialized, the buffer is read-only as it is not possible to change * safely a value without reinitializing the whole data. @@ -66,8 +63,8 @@ public static long computeSize(ByteSequenceProvider byteSequenceProvider) * *

    While it is not enforced programmatically, it is mandatory that this method is called only * once after the creation of the buffer. The buffer must have been allocated according to the - * same set of data, calling {@link #computeSize(NdArray, Function)} priory to make sure there is - * enough space to store it. + * same set of data, calling {@link #computeSize} priory to make sure there is enough space to + * store it. * * @param byteSequenceProvider produces sequences of bytes to use as the tensor 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 5cf2716c083..30f019bf11a 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 @@ -20,8 +20,6 @@ import static org.tensorflow.internal.c_api.global.tensorflow.TF_TensorByteSize; import static org.tensorflow.internal.c_api.global.tensorflow.TF_TensorData; -import java.nio.ByteBuffer; -import java.nio.LongBuffer; import org.bytedeco.javacpp.Pointer; import org.tensorflow.internal.c_api.TF_Tensor; import org.tensorflow.ndarray.buffer.BooleanDataBuffer; @@ -34,9 +32,7 @@ import org.tensorflow.ndarray.buffer.ShortDataBuffer; import org.tensorflow.ndarray.buffer.layout.DataLayouts; -/** - * Maps native tensor memory into {@link DataBuffers}, allowing I/O operations from the JVM. - */ +/** Maps native tensor memory into {@link DataBuffers}, allowing I/O operations from the JVM. */ public final class TensorBuffers { /** @@ -162,7 +158,8 @@ public static ByteSequenceTensorBuffer toStrings(TF_Tensor nativeTensor, long nu return TensorRawDataBufferFactory.mapTensorToStrings(tensorMemory, numElements); } if (numElements > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Cannot map string tensor of " + numElements + " elements"); + throw new IllegalArgumentException( + "Cannot map string tensor of " + numElements + " elements"); } return new ByteSequenceTensorBuffer(tensorMemory, numElements); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Context.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Context.java deleted file mode 100644 index 87602243a11..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Context.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_DeleteContext; -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_NewContext; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTFE_Context extends Pointer { - protected static class DeleteDeallocator extends TFE_Context implements Pointer.Deallocator { - DeleteDeallocator(TFE_Context s) { super(s); } - @Override public void deallocate() { if(!isNull()) TFE_DeleteContext(this); setNull(); } - } - - /** References to prevent deallocation. */ - protected TFE_ContextOptions opts; - - public AbstractTFE_Context(Pointer p) { super(p); } - - /** - * Calls TFE_NewContext(), and registers a deallocator. - * @return TFE_Context created. Do not call TFE_DeleteContext() on it. - */ - public static TFE_Context newContext(TFE_ContextOptions opts, TF_Status status) { - TFE_Context c = TFE_NewContext(opts, status); - if (c != null) { - c.opts = opts; - c.deallocator(new DeleteDeallocator(c)); - } - return c; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_ContextOptions.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_ContextOptions.java deleted file mode 100644 index cd9ea29b946..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_ContextOptions.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_DeleteContextOptions; -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_NewContextOptions; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTFE_ContextOptions extends Pointer { - protected static class DeleteDeallocator extends - TFE_ContextOptions implements Pointer.Deallocator { - DeleteDeallocator(TFE_ContextOptions s) { super(s); } - @Override public void deallocate() { if (!isNull()) TFE_DeleteContextOptions(this); setNull(); } - } - - public AbstractTFE_ContextOptions(Pointer p) { super(p); } - - /** - * Calls TFE_NewContextOptions(), and registers a deallocator. - * @return TFE_ContextOptions created. Do not call TFE_DeleteContextOptions() on it. - */ - public static TFE_ContextOptions newContextOptions() { - TFE_ContextOptions o = TFE_NewContextOptions(); - if (o != null) { - o.deallocator(new DeleteDeallocator(o)); - } - return o; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Op.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Op.java deleted file mode 100644 index 4391bd8d288..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_Op.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_DeleteOp; -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_NewOp; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTFE_Op extends Pointer { - protected static class DeleteDeallocator extends TFE_Op implements Pointer.Deallocator { - DeleteDeallocator(TFE_Op s) { super(s); } - @Override public void deallocate() { if (!isNull()) TFE_DeleteOp(this); setNull(); } - } - - /** A reference to prevent deallocation. */ - protected TFE_Context context; - - public AbstractTFE_Op(Pointer p) { super(p); } - - /** - * Calls TFE_NewOp(), and registers a deallocator. - * @return TFE_Op created. Do not call TFE_DeleteOp() on it. - */ - public static TFE_Op newOp(TFE_Context ctx, String op_or_function_name, TF_Status status) { - TFE_Op o = TFE_NewOp(ctx, op_or_function_name, status); - if (o != null) { - o.context = ctx; - o.deallocator(new DeleteDeallocator(o)); - } - return o; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_TensorHandle.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_TensorHandle.java deleted file mode 100644 index c5d6c09330a..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTFE_TensorHandle.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_DeleteTensorHandle; -import static org.tensorflow.internal.c_api.global.tensorflow.TFE_NewTensorHandle; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTFE_TensorHandle extends Pointer { - protected static class DeleteDeallocator extends TFE_TensorHandle implements Pointer.Deallocator { - DeleteDeallocator(TFE_TensorHandle s) { super(s); } - @Override public void deallocate() { if (!isNull()) TFE_DeleteTensorHandle(this); setNull(); } - } - - /** A reference to prevent deallocation. */ - protected TF_Tensor tensor; - - public AbstractTFE_TensorHandle(Pointer p) { super(p); } - - /** - * Calls TFE_NewTensorHandle(), and registers a deallocator. - * @return TFE_TensorHandle created. Do not call TFE_DeleteTensorHandle() on it. - */ - public static TFE_TensorHandle newTensor(TF_Tensor t, TF_Status status) { - TFE_TensorHandle th = TFE_NewTensorHandle(t, status); - if (th != null) { - th.tensor = t; - th.deallocator(new DeleteDeallocator(th)); - } - return th; - } - - /** Registers a deallocator and returns this. */ - public TFE_TensorHandle withDeallocator() { - return (TFE_TensorHandle)this.deallocator(new DeleteDeallocator((TFE_TensorHandle)this)); - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java deleted file mode 100644 index 976f515987c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteBuffer; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewBuffer; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewBufferFromString; - -import com.google.protobuf.Message; -import java.nio.ByteBuffer; -import org.bytedeco.javacpp.BytePointer; -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTF_Buffer extends Pointer { - protected static class DeleteDeallocator extends TF_Buffer implements Pointer.Deallocator { - DeleteDeallocator(TF_Buffer s) { super(s); } - @Override public void deallocate() { if (!isNull()) TF_DeleteBuffer(this); setNull(); } - } - - public AbstractTF_Buffer(Pointer p) { super(p); } - - /** - * Calls TF_NewBuffer(), and registers a deallocator. - * @return TF_Buffer created. Do not call TF_DeleteBuffer() on it. - */ - public static TF_Buffer newBuffer() { - TF_Buffer b = TF_NewBuffer(); - if (b != null) { - b.deallocator(new DeleteDeallocator(b)); - } - return b; - } - - /** Returns {@code newBufferFromString(new BytePointer(proto.toByteArray())), or null if proto is null or empty. */ - public static TF_Buffer newBufferFromString(Message proto) { - if (proto == null) { - return null; - } - return newBufferFromString(new BytePointer(proto.toByteArray())); - } - - /** - * Calls TF_NewBufferFromString(), and registers a deallocator. - * @return TF_Buffer created, or null if proto is null or empty. Do not call TF_DeleteBuffer() on it. - */ - public static TF_Buffer newBufferFromString(Pointer proto) { - if (proto == null || proto.isNull() || proto.limit() == 0) { - return null; - } - TF_Buffer b = TF_NewBufferFromString(proto, proto.limit()); - if (b != null) { - b.deallocator(new DeleteDeallocator(b)); - } - return b; - } - - /** - * Returns a copy of the data in a Java array - * @throws IndexOutOfBoundsException if too large. - */ - public byte[] copyData() { - long length = ((TF_Buffer)this).length(); - if (length > Integer.MAX_VALUE) { - throw new IndexOutOfBoundsException("TF_Buffer is too large to serialize into a byte[] array"); - } - byte[] data = new byte[(int)length]; - new BytePointer(((TF_Buffer)this).data()).get(data); - return data; - } - - /** - * Returns the data of this buffer as a {@link java.nio.ByteBuffer} - * @throws IndexOutOfBoundsException if too large. - */ - public ByteBuffer dataAsByteBuffer() { - long length = ((TF_Buffer)this).length(); - if (length > Integer.MAX_VALUE) { - throw new IndexOutOfBoundsException("TF_Buffer is too large to accessed via a ByteBuffer interface"); - } - return ((TF_Buffer)this).data().capacity(length).asByteBuffer(); - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Function.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Function.java deleted file mode 100644 index a3647b5671d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Function.java +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright 2019-2021 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. - ======================================================================= - */ -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteFunction; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTF_Function extends Pointer { - - protected static class DeleteDeallocator extends TF_Function implements Deallocator { - - DeleteDeallocator(TF_Function s) { - super(s); - } - - @Override - public void deallocate() { - if (!isNull()) { - TF_DeleteFunction(this); - } - setNull(); - } - } - - public AbstractTF_Function(Pointer p) { - super(p); - } - - public TF_Function withDeallocator() { - return this.deallocator(new DeleteDeallocator((TF_Function) this)); - } - - /** Calls the deallocator, if registered, otherwise has no effect. */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java deleted file mode 100644 index 3dfcc8790a7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteImportGraphDefOptions; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewImportGraphDefOptions; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTF_ImportGraphDefOptions extends Pointer { - protected static class DeleteDeallocator extends - TF_ImportGraphDefOptions implements Pointer.Deallocator { - DeleteDeallocator(TF_ImportGraphDefOptions s) { super(s); } - @Override public void deallocate() { if (!isNull()) TF_DeleteImportGraphDefOptions(this); setNull(); } - } - - public AbstractTF_ImportGraphDefOptions(Pointer p) { super(p); } - - /** - * Calls TF_NewImportGraphDefOptions(), and registers a deallocator. - * @return TF_ImportGraphDefOptions created. Do not call TF_DeleteImportGraphDefOptions() on it. - */ - public static TF_ImportGraphDefOptions newImportGraphDefOptions() { - TF_ImportGraphDefOptions o = TF_NewImportGraphDefOptions(); - if (o != null) { - o.deallocator(new DeleteDeallocator(o)); - } - return o; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java deleted file mode 100644 index 13bbd0bc3e5..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TF_CloseSession; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteSession; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_LoadSessionFromSavedModel; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewSession; - -import org.bytedeco.javacpp.BytePointer; -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.PointerPointer; -import org.bytedeco.javacpp.PointerScope; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTF_Session extends Pointer { - protected static class DeleteDeallocator extends TF_Session implements Pointer.Deallocator { - DeleteDeallocator(TF_Session s) { super(s); } - @Override public void deallocate() { - if (!isNull()) { - try (PointerScope scope = new PointerScope()) { - TF_Status status = TF_Status.newStatus(); - TF_CloseSession(this, status); - // Result of close is ignored, delete anyway. - TF_DeleteSession(this, status); - status.throwExceptionIfNotOK(); - setNull(); - } - } - } - } - - /** References to prevent deallocation. */ - protected TF_Graph graph; - protected TF_SessionOptions opts; - protected TF_Buffer run_options; - protected TF_Buffer meta_graph_def; - protected TF_Status status; - - public AbstractTF_Session(Pointer p) { super(p); } - - /** - * Calls TF_NewSession(), and registers a deallocator. - * @return TF_Session created. Do not call TF_DeleteSession() on it. - */ - public static TF_Session newSession(TF_Graph graph, TF_SessionOptions opts, TF_Status status) { - TF_Session s = TF_NewSession(graph, opts, status); - if (s != null) { - s.graph = graph; - s.opts = opts; - s.status = status; - s.deallocator(new DeleteDeallocator(s)); - } - return s; - } - - /** - * Calls TF_LoadSessionFromSavedModel(), and registers a deallocator. - * @return TF_Session created. Do not call TF_DeleteSession() on it. - */ - public static TF_Session loadSessionFromSavedModel(TF_SessionOptions session_options, TF_Buffer run_options, - String export_dir, String[] tags, TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status) { - TF_Session s = TF_LoadSessionFromSavedModel(session_options, run_options, - new BytePointer(export_dir), new PointerPointer(tags), tags.length, graph, meta_graph_def, status); - if (s != null) { - s.graph = graph; - s.opts = session_options; - s.run_options = run_options; - s.meta_graph_def = meta_graph_def; - s.status = status; - s.deallocator(new DeleteDeallocator(s)); - } - return s; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java deleted file mode 100644 index e235e86c3ce..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - 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. - ======================================================================= - */ - -package org.tensorflow.internal.c_api; - -import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteSessionOptions; -import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewSessionOptions; - -import org.bytedeco.javacpp.Pointer; -import org.bytedeco.javacpp.annotation.Properties; - -@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) -public abstract class AbstractTF_SessionOptions extends Pointer { - protected static class DeleteDeallocator extends - TF_SessionOptions implements Pointer.Deallocator { - DeleteDeallocator(TF_SessionOptions s) { super(s); } - @Override public void deallocate() { if (!isNull()) TF_DeleteSessionOptions(this); setNull(); } - } - - public AbstractTF_SessionOptions(Pointer p) { super(p); } - - /** - * Calls TF_NewSessionOptions(), and registers a deallocator. - * @return TF_SessionOptions created. Do not call TF_DeleteSessionOptions() on it. - */ - public static TF_SessionOptions newSessionOptions() { - TF_SessionOptions o = TF_NewSessionOptions(); - if (o != null) { - o.deallocator(new DeleteDeallocator(o)); - } - return o; - } - - /** - * Calls the deallocator, if registered, otherwise has no effect. - */ - public void delete() { - deallocate(); - } -} 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 deleted file mode 100644 index 6cb3be62eb7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java +++ /dev/null @@ -1,390 +0,0 @@ -/* Copyright 2019-2021 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. -======================================================================= -*/ -package org.tensorflow.internal.c_api.presets; - -import java.util.List; -import org.bytedeco.javacpp.ClassProperties; -import org.bytedeco.javacpp.LoadEnabled; -import org.bytedeco.javacpp.Loader; -import org.bytedeco.javacpp.annotation.NoException; -import org.bytedeco.javacpp.annotation.Platform; -import org.bytedeco.javacpp.annotation.Properties; -import org.bytedeco.javacpp.tools.Info; -import org.bytedeco.javacpp.tools.InfoMap; -import org.bytedeco.javacpp.tools.InfoMapper; - -/** @author Samuel Audet */ -@Properties( - value = { - @Platform( - 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", - "tensorflow/c/ops.h", - "tensorflow/c/eager/c_api.h" - }, - link = "tensorflow_cc@.2", - preload = {"iomp5", "mklml", "mklml_intel", "tensorflow_framework@.2"}, - preloadresource = "/org/bytedeco/mkldnn/", - resource = {"LICENSE", "THIRD_PARTY_TF_JNI_LICENSES"}), - @Platform( - value = "windows", - preload = { - "api-ms-win-crt-locale-l1-1-0", - "api-ms-win-crt-string-l1-1-0", - "api-ms-win-crt-stdio-l1-1-0", - "api-ms-win-crt-math-l1-1-0", - "api-ms-win-crt-heap-l1-1-0", - "api-ms-win-crt-runtime-l1-1-0", - "api-ms-win-crt-convert-l1-1-0", - "api-ms-win-crt-environment-l1-1-0", - "api-ms-win-crt-time-l1-1-0", - "api-ms-win-crt-filesystem-l1-1-0", - "api-ms-win-crt-utility-l1-1-0", - "api-ms-win-crt-multibyte-l1-1-0", - "api-ms-win-core-string-l1-1-0", - "api-ms-win-core-errorhandling-l1-1-0", - "api-ms-win-core-timezone-l1-1-0", - "api-ms-win-core-file-l1-1-0", - "api-ms-win-core-namedpipe-l1-1-0", - "api-ms-win-core-handle-l1-1-0", - "api-ms-win-core-file-l2-1-0", - "api-ms-win-core-heap-l1-1-0", - "api-ms-win-core-libraryloader-l1-1-0", - "api-ms-win-core-synch-l1-1-0", - "api-ms-win-core-processthreads-l1-1-0", - "api-ms-win-core-processenvironment-l1-1-0", - "api-ms-win-core-datetime-l1-1-0", - "api-ms-win-core-localization-l1-2-0", - "api-ms-win-core-sysinfo-l1-1-0", - "api-ms-win-core-synch-l1-2-0", - "api-ms-win-core-console-l1-1-0", - "api-ms-win-core-debug-l1-1-0", - "api-ms-win-core-rtlsupport-l1-1-0", - "api-ms-win-core-processthreads-l1-1-1", - "api-ms-win-core-file-l1-2-0", - "api-ms-win-core-profile-l1-1-0", - "api-ms-win-core-memory-l1-1-0", - "api-ms-win-core-util-l1-1-0", - "api-ms-win-core-interlocked-l1-1-0", - "ucrtbase", - "vcruntime140", - "vcruntime140_1", - "msvcp140", - "concrt140", - "vcomp140", - "msvcr120", - "libiomp5md", - "mklml", - "tensorflow_framework" - }), - @Platform( - value = "windows-x86", - preloadpath = { - "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/redist/x86/Microsoft.VC140.CRT/", - "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/redist/x86/Microsoft.VC140.OpenMP/", - "C:/Program Files (x86)/Windows Kits/10/Redist/ucrt/DLLs/x86/" - }), - @Platform( - value = "windows-x86_64", - preloadpath = { - "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/redist/x64/Microsoft.VC140.CRT/", - "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/redist/x64/Microsoft.VC140.OpenMP/", - "C:/Program Files (x86)/Windows Kits/10/Redist/ucrt/DLLs/x64/" - }), - @Platform( - value = {"linux", "macosx", "windows"}, - extension = {"-mkl", "-gpu", "-mkl-gpu"}) - }, - target = "org.tensorflow.internal.c_api", - global = "org.tensorflow.internal.c_api.global.tensorflow") -@NoException -public class tensorflow implements LoadEnabled, InfoMapper { - - @Override - public void init(ClassProperties properties) { - String platform = properties.getProperty("platform"); - String extension = properties.getProperty("platform.extension"); - List preloads = properties.get("platform.preload"); - List resources = properties.get("platform.preloadresource"); - List preloadpaths = properties.get("platform.preloadpath"); - - String vcredistdir = System.getenv("VCToolsRedistDir"); - if (vcredistdir != null && vcredistdir.length() > 0) { - switch (platform) { - case "windows-x86": - preloadpaths.add(0, vcredistdir + "\\x86\\Microsoft.VC142.CRT"); - preloadpaths.add(1, vcredistdir + "\\x86\\Microsoft.VC142.OpenMP"); - preloadpaths.add(2, vcredistdir + "\\x86\\Microsoft.VC141.CRT"); - preloadpaths.add(3, vcredistdir + "\\x86\\Microsoft.VC141.OpenMP"); - break; - case "windows-x86_64": - preloadpaths.add(0, vcredistdir + "\\x64\\Microsoft.VC142.CRT"); - preloadpaths.add(1, vcredistdir + "\\x64\\Microsoft.VC142.OpenMP"); - preloadpaths.add(2, vcredistdir + "\\x64\\Microsoft.VC141.CRT"); - preloadpaths.add(3, vcredistdir + "\\x64\\Microsoft.VC141.OpenMP"); - break; - default: - // not Windows - } - } - - // Only apply this at load time - if (!Loader.isLoadLibraries()) { - return; - } - - // Let users enable loading of the full version of MKL - String load = - System.getProperty( - "org.bytedeco.openblas.load", System.getProperty("org.bytedeco.mklml.load", "")) - .toLowerCase(); - - int i = 0; - if (load.equals("mkl") || load.equals("mkl_rt")) { - String[] libs = { - "iomp5", - "libiomp5md", - "mkl_core", - "mkl_avx", - "mkl_avx2", - "mkl_avx512", - "mkl_avx512_mic", - "mkl_def", - "mkl_mc", - "mkl_mc3", - "mkl_intel_lp64", - "mkl_intel_thread", - "mkl_gnu_thread", - "mkl_rt" - }; - for (i = 0; i < libs.length; i++) { - preloads.add(i, libs[i] + "#" + libs[i]); - } - load = "mkl_rt"; - resources.add("/org/bytedeco/mkl/"); - } - - if (load.length() > 0) { - if (platform.startsWith("linux")) { - preloads.add(i, load + "#mklml_intel"); - } else if (platform.startsWith("macosx")) { - preloads.add(i, load + "#mklml"); - } else if (platform.startsWith("windows")) { - preloads.add(i, load + "#mklml"); - } - } - - // Only apply this at load time since we don't want to copy the CUDA libraries here - if (!Loader.isLoadLibraries() || extension == null || !extension.endsWith("-gpu")) { - return; - } - 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) { - 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); - } - } - if (i > 0) { - resources.add("/org/bytedeco/cuda/"); - resources.add("/org/bytedeco/tensorrt/"); - } - } - - @Override - public void map(InfoMap infoMap) { - 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")) - .put( - new Info("TF_Tensor") - .pointerTypes("TF_Tensor") - .base("org.tensorflow.internal.c_api.AbstractTF_Tensor")) - .put( - new Info("TF_Session") - .pointerTypes("TF_Session") - .base("org.tensorflow.internal.c_api.AbstractTF_Session")) - .put( - new Info("TF_SessionOptions") - .pointerTypes("TF_SessionOptions") - .base("org.tensorflow.internal.c_api.AbstractTF_SessionOptions")) - .put( - new Info("TF_Graph") - .pointerTypes("TF_Graph") - .base("org.tensorflow.internal.c_api.AbstractTF_Graph")) - .put( - new Info("TF_Graph::graph") - .javaText("public native @MemberGetter @ByRef Graph graph();")) - .put( - new Info("TF_Graph::refiner") - .javaText("public native @MemberGetter @ByRef ShapeRefiner refiner();")) - .put( - new Info("TF_Function") - .pointerTypes("TF_Function") - .base("org.tensorflow.internal.c_api.AbstractTF_Function")) - .put( - new Info("TF_ImportGraphDefOptions") - .pointerTypes("TF_ImportGraphDefOptions") - .base("org.tensorflow.internal.c_api.AbstractTF_ImportGraphDefOptions")) - .put( - new Info( - "TF_Operation", - "TF_WhileParams", - "TFE_MonitoringCounterCell", - "TFE_MonitoringSamplerCell", - "TFE_MonitoringCounter0", - "TFE_MonitoringCounter1", - "TFE_MonitoringCounter2", - "TFE_MonitoringIntGaugeCell", - "TFE_MonitoringStringGaugeCell", - "TFE_MonitoringBoolGaugeCell", - "TFE_MonitoringIntGauge0", - "TFE_MonitoringIntGauge1", - "TFE_MonitoringIntGauge2", - "TFE_MonitoringStringGauge0", - "TFE_MonitoringStringGauge1", - "TFE_MonitoringStringGauge2", - "TFE_MonitoringBoolGauge0", - "TFE_MonitoringBoolGauge1", - "TFE_MonitoringBoolGauge2", - "TFE_MonitoringSampler0", - "TFE_MonitoringSampler1", - "TFE_MonitoringSampler2") - .purify()) - .put( - new Info("TF_Operation::node") - .javaText("public native @MemberGetter @ByRef Node node();")) - .put( - new Info("TFE_MonitoringCounterCell::cell") - .javaText("public native @MemberGetter @ByRef CounterCell cell();")) - .put( - new Info("TFE_MonitoringSamplerCell::cell") - .javaText("public native @MemberGetter @ByRef SamplerCell cell();")) - .put( - new Info("TFE_MonitoringIntGaugeCell::cell") - .javaText("public native @MemberGetter @ByRef IntGaugeCell cell();")) - .put( - new Info("TFE_MonitoringStringGaugeCell::cell") - .javaText("public native @MemberGetter @ByRef StringGaugeCell cell();")) - .put( - new Info("TFE_MonitoringBoolGaugeCell::cell") - .javaText("public native @MemberGetter @ByRef BoolGaugeCell cell();")) - .put( - new Info("TFE_Context") - .pointerTypes("TFE_Context") - .base("org.tensorflow.internal.c_api.AbstractTFE_Context")) - .put( - new Info("TFE_ContextOptions") - .pointerTypes("TFE_ContextOptions") - .base("org.tensorflow.internal.c_api.AbstractTFE_ContextOptions")) - .put( - new Info("TFE_Context::context") - .javaText("@MemberGetter public native @ByRef EagerContext context();")) - .put( - new Info("TFE_Op") - .pointerTypes("TFE_Op") - .base("org.tensorflow.internal.c_api.AbstractTFE_Op")) - .put( - new Info("TFE_Op::operation") - .javaText("@MemberGetter public native @ByRef EagerOperation operation();")) - .put( - new Info("TFE_TensorHandle") - .pointerTypes("TFE_TensorHandle") - .base("org.tensorflow.internal.c_api.AbstractTFE_TensorHandle")) - .put(new Info("SP_Stream").cast().pointerTypes("Pointer")) - .put( - new Info( - "TF_ShapeInferenceContextDimValueKnown", - "TFE_NewTensorHandle(const tensorflow::Tensor&, TF_Status*)", - "TF_InitKernel") - .skip()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/SparseHelpers.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/SparseHelpers.java new file mode 100644 index 00000000000..0aa808e9a4a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/SparseHelpers.java @@ -0,0 +1,49 @@ +/* Copyright 2022 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. +==============================================================================*/ +package org.tensorflow.internal.types; + +import org.tensorflow.SparseTensor; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.types.TInt64; + +/** Internal helper class for sparse tensor mappers */ +abstract class SparseHelpers { + + /** + * Convert a 1-D dense tensor, where each scalar represents the size of a dimension, to a {@link + * DimensionalSpace} instance as expected by the NdArray library. + * + * @param denseShape 1-D dense tensor holding the size of each dimensions + * @return a {@link DimensionalSpace} with these dimensions + */ + static DimensionalSpace toDimensionalSpace(TInt64 denseShape) { + return DimensionalSpace.create(Shape.of(StdArrays.array1dCopyOf(denseShape))); + } + + /** + * Compute the total number of bytes required to store a sparse tensor by adding the size of each + * of its dense sub-tensors. + * + * @param sparseTensor the sparse tensor + * @return the total number of bytes + */ + static long numBytes(SparseTensor sparseTensor) { + return sparseTensor.indices().numBytes() + + sparseTensor.values().numBytes() + + sparseTensor.denseShape().numBytes(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBfloat16Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBfloat16Mapper.java index 27688e55779..72fe6dfe745 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBfloat16Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBfloat16Mapper.java @@ -16,26 +16,38 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.FloatDataBuffer; import org.tensorflow.ndarray.buffer.layout.DataLayouts; import org.tensorflow.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.FloatSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBfloat16; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_BFLOAT16} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_BFLOAT16} tensors to a n-dimensional data + * space. */ public final class TBfloat16Mapper extends TensorMapper { @Override protected TBfloat16 mapDense(RawTensor tensor) { - FloatDataBuffer buffer = DataLayouts.BFLOAT16.applyTo(TensorBuffers.toShorts(nativeHandle(tensor))); + FloatDataBuffer buffer = + DataLayouts.BFLOAT16.applyTo(TensorBuffers.toShorts(nativeHandle(tensor))); return new DenseTBfloat16(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TBfloat16 values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTBfloat16(indices, values, denseShape, tensorScope); + } + private static final class DenseTBfloat16 extends FloatDenseNdArray implements TBfloat16 { @Override @@ -43,6 +55,21 @@ public Class type() { return TBfloat16.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -55,4 +82,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTBfloat16 extends FloatSparseNdArray + implements TBfloat16, SparseTensor { + + @Override + public Class type() { + return TBfloat16.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TBfloat16 values() { + return (TBfloat16) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTBfloat16(TInt64 indices, TBfloat16 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0.0f, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBoolMapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBoolMapper.java index ff4c11a521b..becea1bd410 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBoolMapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TBoolMapper.java @@ -16,16 +16,21 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.BooleanDataBuffer; import org.tensorflow.ndarray.impl.dense.BooleanDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.BooleanSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_BOOL} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_BOOL} tensors to a n-dimensional data + * space. */ public final class TBoolMapper extends TensorMapper { @@ -35,6 +40,12 @@ protected TBool mapDense(RawTensor tensor) { return new DenseTBool(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TBool values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTBool(indices, values, denseShape, tensorScope); + } + private static final class DenseTBool extends BooleanDenseNdArray implements TBool { @Override @@ -42,6 +53,21 @@ public Class type() { return TBool.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +80,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTBool extends BooleanSparseNdArray + implements TBool, SparseTensor { + + @Override + public Class type() { + return TBool.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TBool values() { + return (TBool) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTBool(TInt64 indices, TBool values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, false, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat16Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat16Mapper.java index fec84843f57..e49b7df2574 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat16Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat16Mapper.java @@ -16,26 +16,38 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.FloatDataBuffer; import org.tensorflow.ndarray.buffer.layout.DataLayouts; import org.tensorflow.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.FloatSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat16; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_HALF} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_HALF} tensors to a n-dimensional data + * space. */ public final class TFloat16Mapper extends TensorMapper { @Override protected TFloat16 mapDense(RawTensor tensor) { - FloatDataBuffer buffer = DataLayouts.FLOAT16.applyTo(TensorBuffers.toShorts(nativeHandle(tensor))); + FloatDataBuffer buffer = + DataLayouts.FLOAT16.applyTo(TensorBuffers.toShorts(nativeHandle(tensor))); return new DenseTFloat16(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TFloat16 values, TInt64 denseShape, PointerScope tensorScope) { + return new TFloat16Mapper.SparseTFloat16(indices, values, denseShape, tensorScope); + } + private static final class DenseTFloat16 extends FloatDenseNdArray implements TFloat16 { @Override @@ -43,6 +55,21 @@ public Class type() { return TFloat16.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -55,4 +82,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTFloat16 extends FloatSparseNdArray + implements TFloat16, SparseTensor { + + @Override + public Class type() { + return TFloat16.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TFloat16 values() { + return (TFloat16) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTFloat16(TInt64 indices, TFloat16 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0.0f, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat32Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat32Mapper.java index 62fc0d226ac..dfd7d05bcea 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat32Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat32Mapper.java @@ -16,16 +16,21 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.FloatDataBuffer; import org.tensorflow.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.FloatSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_FLOAT} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_FLOAT} tensors to a n-dimensional data + * space. */ public final class TFloat32Mapper extends TensorMapper { @@ -35,6 +40,12 @@ protected TFloat32 mapDense(RawTensor tensor) { return new DenseTFloat32(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TFloat32 values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTFloat32(indices, values, denseShape, tensorScope); + } + private static final class DenseTFloat32 extends FloatDenseNdArray implements TFloat32 { @Override @@ -42,6 +53,21 @@ public Class type() { return TFloat32.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +80,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTFloat32 extends FloatSparseNdArray + implements TFloat32, SparseTensor { + + @Override + public Class type() { + return TFloat32.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TFloat32 values() { + return (TFloat32) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTFloat32(TInt64 indices, TFloat32 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0.0f, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat64Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat64Mapper.java index 375a7429950..e5524348629 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat64Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TFloat64Mapper.java @@ -16,16 +16,21 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.DoubleDataBuffer; import org.tensorflow.ndarray.impl.dense.DoubleDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.DoubleSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat64; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_DOUBLE} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_DOUBLE} tensors to a n-dimensional data + * space. */ public final class TFloat64Mapper extends TensorMapper { @@ -35,6 +40,12 @@ protected TFloat64 mapDense(RawTensor tensor) { return new DenseTFloat64(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TFloat64 values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTFloat64(indices, values, denseShape, tensorScope); + } + private static final class DenseTFloat64 extends DoubleDenseNdArray implements TFloat64 { @Override @@ -42,6 +53,21 @@ public Class type() { return TFloat64.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +80,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTFloat64 extends DoubleSparseNdArray + implements TFloat64, SparseTensor { + + @Override + public Class type() { + return TFloat64.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TFloat64 values() { + return (TFloat64) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTFloat64(TInt64 indices, TFloat64 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0L, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt32Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt32Mapper.java index fa0852a8b09..12802b264b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt32Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt32Mapper.java @@ -16,16 +16,21 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.IntDataBuffer; import org.tensorflow.ndarray.impl.dense.IntDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.IntSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_INT32} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_INT32} tensors to a n-dimensional data + * space. */ public final class TInt32Mapper extends TensorMapper { @@ -35,6 +40,12 @@ protected TInt32 mapDense(RawTensor tensor) { return new DenseTInt32(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TInt32 values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTInt32(indices, values, denseShape, tensorScope); + } + private static final class DenseTInt32 extends IntDenseNdArray implements TInt32 { @Override @@ -42,6 +53,21 @@ public Class type() { return TInt32.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +80,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTInt32 extends IntSparseNdArray + implements TInt32, SparseTensor { + + @Override + public Class type() { + return TInt32.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TInt32 values() { + return (TInt32) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTInt32(TInt64 indices, TInt32 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt64Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt64Mapper.java index c5f2325e25a..a85cc40faff 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt64Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TInt64Mapper.java @@ -16,16 +16,20 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.LongDataBuffer; import org.tensorflow.ndarray.impl.dense.LongDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.LongSparseNdArray; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt64; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_INT64} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_INT64} tensors to a n-dimensional data + * space. */ public final class TInt64Mapper extends TensorMapper { @@ -35,6 +39,12 @@ protected TInt64 mapDense(RawTensor tensor) { return new DenseTInt64(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TInt64 values, TInt64 denseShape, PointerScope tensorScope) { + return new TInt64Mapper.SparseTInt64(indices, values, denseShape, tensorScope); + } + private static final class DenseTInt64 extends LongDenseNdArray implements TInt64 { @Override @@ -42,6 +52,21 @@ public Class type() { return TInt64.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +79,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTInt64 extends LongSparseNdArray + implements TInt64, SparseTensor { + + @Override + public Class type() { + return TInt64.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TInt64 values() { + return (TInt64) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTInt64(TInt64 indices, TInt64 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, 0L, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringInitializer.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringInitializer.java index 74db0f5285c..8dd4547c8d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringInitializer.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringInitializer.java @@ -18,8 +18,8 @@ import java.util.function.Consumer; import java.util.function.Function; -import org.tensorflow.internal.buffer.ByteSequenceTensorBuffer; import org.tensorflow.internal.buffer.ByteSequenceProvider; +import org.tensorflow.internal.buffer.ByteSequenceTensorBuffer; import org.tensorflow.internal.types.TStringMapper.TStringInternal; import org.tensorflow.ndarray.NdArray; import org.tensorflow.types.TString; @@ -47,7 +47,7 @@ public long computeRequiredSize() { @Override public void accept(TString tensor) { - ((TStringInternal)tensor).init(byteSequenceProvider); + ((TStringInternal) tensor).init(byteSequenceProvider); } private final ByteSequenceProvider byteSequenceProvider; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringMapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringMapper.java index de7c6016e0e..3406e2165a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringMapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TStringMapper.java @@ -18,7 +18,9 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.ByteSequenceProvider; import org.tensorflow.internal.buffer.ByteSequenceTensorBuffer; @@ -29,11 +31,14 @@ import org.tensorflow.ndarray.buffer.layout.DataLayout; import org.tensorflow.ndarray.buffer.layout.DataLayouts; import org.tensorflow.ndarray.impl.dense.DenseNdArray; +import org.tensorflow.ndarray.impl.sparse.SparseNdArray; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_STRING} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_STRING} tensors to a n-dimensional data + * space. */ public final class TStringMapper extends TensorMapper { @@ -42,13 +47,18 @@ public final class TStringMapper extends TensorMapper { @Override protected TString mapDense(RawTensor tensor) { - ByteSequenceTensorBuffer buffer = TensorBuffers.toStrings(nativeHandle(tensor), tensor.shape().size()); + ByteSequenceTensorBuffer buffer = + TensorBuffers.toStrings(nativeHandle(tensor), tensor.shape().size()); return new DenseTString(tensor, buffer, UTF_8_LAYOUT); } - /** - * Adds package-private methods to all instances of {@code TString} - */ + @Override + protected SparseTensor mapSparse( + TInt64 indices, TString values, TInt64 denseShape, PointerScope tensorScope) { + return new SparseTString(indices, values, denseShape, tensorScope); + } + + /** Adds package-private methods to all instances of {@code TString} */ interface TStringInternal extends TString { /** @@ -82,6 +92,21 @@ public Class type() { return TString.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -93,11 +118,83 @@ public RawTensor asRawTensor() { DenseTString( RawTensor rawTensor, ByteSequenceTensorBuffer buffer, - DataLayout, String> layout - ) { + DataLayout, String> layout) { super(layout.applyTo(buffer), rawTensor.shape()); this.rawTensor = rawTensor; this.buffer = buffer; } } + + private static final class SparseTString extends SparseNdArray + implements TString, SparseTensor { + + @Override + public Class type() { + return TString.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TString values() { + return (TString) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + @Override + public TString using(Charset charset) { + return new SparseTString( + indices(), values().using(charset), denseShape(), tensorScope, false); + } + + @Override + public NdArray asBytes() { + return SparseNdArray.create(byte[].class, indices(), values().asBytes(), dimensions()); + } + + SparseTString(TInt64 indices, TString values, TInt64 denseShape, PointerScope tensorScope) { + this(indices, values, denseShape, tensorScope, true); + } + + private SparseTString( + TInt64 indices, + TString values, + TInt64 denseShape, + PointerScope tensorScope, + boolean extendScope) { + super(String.class, indices, values, "", SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = extendScope ? tensorScope.extend() : tensorScope; + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint16Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint16Mapper.java new file mode 100644 index 00000000000..43faa1199ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint16Mapper.java @@ -0,0 +1,136 @@ +/* + * Copyright 2022 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. + * ======================================================================= + */ +package org.tensorflow.internal.types; + +import org.bytedeco.javacpp.PointerScope; +import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; +import org.tensorflow.TensorMapper; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dense.ShortDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.ShortSparseNdArray; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TUint16; + +/** + * Maps memory of {@link org.tensorflow.proto.DataType#DT_UINT16} tensors to a n-dimensional data + * space. + */ +public final class TUint16Mapper extends TensorMapper { + + @Override + protected TUint16 mapDense(RawTensor tensor) { + ShortDataBuffer buffer = TensorBuffers.toShorts(nativeHandle(tensor)); + return new DenseTUint16(tensor, buffer); + } + + @Override + protected SparseTensor mapSparse( + TInt64 indices, TUint16 values, TInt64 denseShape, PointerScope tensorScope) { + return new TUint16Mapper.SparseTUint16(indices, values, denseShape, tensorScope); + } + + private static final class DenseTUint16 extends ShortDenseNdArray implements TUint16 { + + @Override + public Class type() { + return TUint16.class; + } + + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + + @Override + public RawTensor asRawTensor() { + return rawTensor; + } + + final RawTensor rawTensor; + + DenseTUint16(RawTensor rawTensor, ShortDataBuffer buffer) { + super(buffer, rawTensor.shape()); + this.rawTensor = rawTensor; + } + } + + private static final class SparseTUint16 extends ShortSparseNdArray + implements TUint16, SparseTensor { + + @Override + public Class type() { + return TUint16.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TUint16 values() { + return (TUint16) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTUint16(TInt64 indices, TUint16 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, (short) 0, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint8Mapper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint8Mapper.java index 427debd1ac8..71c2652a7a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint8Mapper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint8Mapper.java @@ -16,16 +16,21 @@ */ package org.tensorflow.internal.types; +import org.bytedeco.javacpp.PointerScope; import org.tensorflow.RawTensor; +import org.tensorflow.SparseTensor; import org.tensorflow.TensorMapper; import org.tensorflow.internal.buffer.TensorBuffers; import org.tensorflow.ndarray.buffer.ByteDataBuffer; import org.tensorflow.ndarray.impl.dense.ByteDenseNdArray; +import org.tensorflow.ndarray.impl.sparse.ByteSparseNdArray; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt64; import org.tensorflow.types.TUint8; /** - * Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_UINT8} tensors - * to a n-dimensional data space. + * Maps memory of {@link org.tensorflow.proto.DataType#DT_UINT8} tensors to a n-dimensional data + * space. */ public final class TUint8Mapper extends TensorMapper { @@ -35,6 +40,12 @@ protected TUint8 mapDense(RawTensor tensor) { return new DenseTUint8(tensor, buffer); } + @Override + protected SparseTensor mapSparse( + TInt64 indices, TUint8 values, TInt64 denseShape, PointerScope tensorScope) { + return new TUint8Mapper.SparseTUint8(indices, values, denseShape, tensorScope); + } + private static final class DenseTUint8 extends ByteDenseNdArray implements TUint8 { @Override @@ -42,6 +53,21 @@ public Class type() { return TUint8.class; } + @Override + public DataType dataType() { + return asRawTensor().dataType(); + } + + @Override + public long numBytes() { + return asRawTensor().numBytes(); + } + + @Override + public void close() { + asRawTensor().close(); + } + @Override public RawTensor asRawTensor() { return rawTensor; @@ -54,4 +80,57 @@ public RawTensor asRawTensor() { this.rawTensor = rawTensor; } } + + private static final class SparseTUint8 extends ByteSparseNdArray + implements TUint8, SparseTensor { + + @Override + public Class type() { + return TUint8.class; + } + + @Override + public DataType dataType() { + return values().dataType(); + } + + @Override + public long numBytes() { + return SparseHelpers.numBytes(this); + } + + @Override + public void close() { + tensorScope.close(); + } + + @Override + public boolean isSparse() { + return true; + } + + @Override + public TInt64 indices() { + return (TInt64) getIndices(); + } + + @Override + public TUint8 values() { + return (TUint8) getValues(); + } + + @Override + public TInt64 denseShape() { + return denseShape; + } + + SparseTUint8(TInt64 indices, TUint8 values, TInt64 denseShape, PointerScope tensorScope) { + super(indices, values, (byte) 0, SparseHelpers.toDimensionalSpace(denseShape)); + this.denseShape = denseShape; + this.tensorScope = tensorScope.extend(); + } + + private final TInt64 denseShape; + private final PointerScope tensorScope; + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeInfo.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeInfo.java index a4a89a71649..a152975fa7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeInfo.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeInfo.java @@ -17,7 +17,7 @@ package org.tensorflow.internal.types.registry; import org.tensorflow.TensorMapper; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** @@ -27,36 +27,35 @@ */ public final class TensorTypeInfo { - /** - * Returns the class of this tensor type - */ + /** Returns the class of this tensor type */ public Class type() { return type; } - /** - * Returns the corresponding data type for this tensor type - */ + /** Returns the corresponding data type for this tensor type */ public DataType dataType() { return dataType; } /** - * Returns the number of bytes required to store one element of the corresponding data type, -1 if variable. + * Returns the number of bytes required to store one element of the corresponding data type, -1 if + * variable. */ public int byteSize() { return byteSize; } /** - * Returns true if elements of the corresponding data type are of variable length (undefined number of bytes) + * Returns true if elements of the corresponding data type are of variable length (undefined + * number of bytes) */ public boolean isVariableLength() { return byteSize < 0; } /** - * Returns an object used to map {@link org.tensorflow.RawTensor raw tensors} to a tensor of this type + * Returns an object used to map {@link org.tensorflow.RawTensor raw tensors} to a tensor of this + * type */ public TensorMapper mapper() { return mapper; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeRegistry.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeRegistry.java index 1b061bebef9..9cb5d4a9dca 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeRegistry.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/registry/TensorTypeRegistry.java @@ -19,7 +19,7 @@ import java.util.HashMap; import java.util.Map; import org.tensorflow.TensorMapper; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBfloat16; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat16; @@ -28,13 +28,12 @@ import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.TUint16; import org.tensorflow.types.TUint8; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TType; -/** - * Repository of all registered tensor types. - */ +/** Repository of all registered tensor types. */ public final class TensorTypeRegistry { /** @@ -47,9 +46,10 @@ public final class TensorTypeRegistry { public static TensorTypeInfo find(DataType dataType) { TensorTypeInfo typeInfo = TYPES_BY_CODE.get(dataType.getNumber()); if (typeInfo == null) { - throw new IllegalArgumentException("No tensor type has been registered for data type " + dataType); + throw new IllegalArgumentException( + "No tensor type has been registered for data type " + dataType); } - return (TensorTypeInfo)typeInfo; + return (TensorTypeInfo) typeInfo; } /** @@ -62,28 +62,37 @@ public static TensorTypeInfo find(DataType dataType) { public static TensorTypeInfo find(Class type) { TensorTypeInfo typeInfo = TYPES_BY_CLASS.get(type); if (typeInfo == null) { - throw new IllegalArgumentException("Class \"" + type.getName() + "\" is not registered as a tensor type"); + throw new IllegalArgumentException( + "Class \"" + type.getName() + "\" is not registered as a tensor type"); } - return (TensorTypeInfo)typeInfo; + return (TensorTypeInfo) typeInfo; } private static final Map> TYPES_BY_CODE = new HashMap<>(); - private static final Map, TensorTypeInfo> TYPES_BY_CLASS = new HashMap<>(); + private static final Map, TensorTypeInfo> TYPES_BY_CLASS = + new HashMap<>(); private static void register(Class type) { TensorType typeAnnot = type.getDeclaredAnnotation(TensorType.class); if (typeAnnot == null) { - throw new IllegalArgumentException("Class \"" + type.getName() + "\" must be annotated " - + "with @TensorType to be registered as a tensor type"); + throw new IllegalArgumentException( + "Class \"" + + type.getName() + + "\" must be annotated " + + "with @TensorType to be registered as a tensor type"); } TensorMapper mapper; try { - mapper = (TensorMapper)typeAnnot.mapperClass().newInstance(); + mapper = (TensorMapper) typeAnnot.mapperClass().newInstance(); } catch (ReflectiveOperationException e) { - throw new IllegalArgumentException("Class \"" + type.getName() + "\" must have a public " - + "parameter-less constructor to be used as a tensor mapper"); + throw new IllegalArgumentException( + "Class \"" + + type.getName() + + "\" must have a public " + + "parameter-less constructor to be used as a tensor mapper"); } - TensorTypeInfo typeInfo = new TensorTypeInfo<>(type, typeAnnot.dataType(), typeAnnot.byteSize(), mapper); + TensorTypeInfo typeInfo = + new TensorTypeInfo<>(type, typeAnnot.dataType(), typeAnnot.byteSize(), mapper); TYPES_BY_CLASS.put(type, typeInfo); TYPES_BY_CODE.put(typeInfo.dataType().getNumber(), typeInfo); TYPES_BY_CODE.put(typeInfo.dataType().getNumber() + 100, typeInfo); @@ -100,6 +109,7 @@ private static void register(Class type) { register(TInt64.class); register(TString.class); register(TUint8.class); + register(TUint16.class); register(TBfloat16.class); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/AttributeMetadata.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/AttributeMetadata.java new file mode 100644 index 00000000000..29ff5950786 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/AttributeMetadata.java @@ -0,0 +1,57 @@ +/* + Copyright 2021 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. +============================================================================== +*/ +package org.tensorflow.op; + +import org.tensorflow.internal.c_api.TF_AttrMetadata; + +/** + * Metadata of an op's attribute. + * + * @see org.tensorflow.internal.c_api.TF_AttrMetadata + */ +public class AttributeMetadata { + + /** Whether this attribute is a list. */ + public final boolean isList; + + /** The size of the list if this attribute is a list, undefined otherwise. */ + public final long listSize; + /** + * The type of this attribute, or the type of the list values if it is a list. + * + *

    See {@code tensorflow/c/tf_attrtype.h}. + */ + public final int type; + + /** The total size of this attribute. Exact meaning depends on the type. */ + public final long totalSize; + + public AttributeMetadata(boolean isList, long listSize, int type, long totalSize) { + this.isList = isList; + this.listSize = listSize; + this.type = type; + this.totalSize = totalSize; + } + + public AttributeMetadata(TF_AttrMetadata nativeMetadata) { + this( + nativeMetadata.is_list() == 1, + nativeMetadata.list_size(), + nativeMetadata.type(), + nativeMetadata.total_size()); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/CustomGradient.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/CustomGradient.java new file mode 100644 index 00000000000..5af78959b39 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/CustomGradient.java @@ -0,0 +1,50 @@ +/* + Copyright 2024 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. +============================================================================== +*/ +package org.tensorflow.op; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.Output; +import org.tensorflow.TensorFlow; + +/** + * A custom gradient for ops of type {@link T}. Should be registered using {@link + * TensorFlow#registerCustomGradient(Class, CustomGradient)}. + * + *

    Creates the gradient based off of an instance of the op inputs class, which is created using + * reflection. To operate on the {@link org.tensorflow.GraphOperation} directly use {@link + * RawCustomGradient}. + * + *

    The type of the op is not checked here, but it is required to match the class given to the + * adapter. + * + * @param the type of op this gradient is for. + */ +@SuppressWarnings("rawtypes") +@FunctionalInterface +public interface CustomGradient { + + /** + * Calculate the gradients for {@code op}. + * + * @param tf the {@link Ops} instance used to create ops + * @param op the op to calculate the gradients of. + * @param gradInputs the gradients of the op's outputs. + * @return the gradients of the op's inputs. + */ + List> call(Ops tf, T op, List> gradInputs); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/DispatchingGradientAdapter.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/DispatchingGradientAdapter.java new file mode 100644 index 00000000000..d82aa5df8a2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/DispatchingGradientAdapter.java @@ -0,0 +1,145 @@ +/* Copyright 2026 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. +======================================================================= +*/ +package org.tensorflow.op; + +import java.lang.reflect.Constructor; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import org.tensorflow.AbstractGradientAdapter; +import org.tensorflow.Graph; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Output; +import org.tensorflow.internal.c_api.TFJ_Scope; + +/** + * Dispatching adapter for Java-side custom gradient registration. + * + *

    This class mirrors the behavior of TensorFlow Python's {@code tf.RegisterGradient} mechanism + * by providing a centralized dispatch layer for custom gradients in the Java API. + * + *

    Gradients may be registered in one of two forms for a given op type: + * + *

      + *
    • A raw gradient ({@link RawCustomGradient}) operating directly on {@link GraphOperation} and + * {@link Output} objects. + *
    • A typed gradient ({@link CustomGradient}) operating on generated {@link RawOpInputs} + * subclasses. + *
    + * + *

    For any given op type, exactly one gradient definition is permitted: either raw or typed. + * Duplicate registrations, or attempts to mix raw and typed gradients for the same op type, are + * rejected to prevent ambiguous dispatch behavior. + * + *

    At runtime, {@link #apply(Graph, TFJ_Scope, GraphOperation, List)} determines the operation + * type and dispatches to the corresponding registered gradient implementation. + */ +final class DispatchingGradientAdapter extends AbstractGradientAdapter { + + private final ConcurrentMap raw = new ConcurrentHashMap<>(); + private final ConcurrentMap> typed = new ConcurrentHashMap<>(); + + private static String dupMsg(String opType, String existingKind, String newKind) { + return "A " + + existingKind + + " gradient is already registered for op type '" + + opType + + "'. Raw and typed registrations are mutually exclusive; cannot register " + + newKind + + "."; + } + + static final class TypedEntry> { + final CustomGradient grad; + final Class inputClass; + final Constructor ctor; + + TypedEntry(CustomGradient grad, Class inputClass) { + this.grad = grad; + this.inputClass = inputClass; + try { + this.ctor = inputClass.getConstructor(org.tensorflow.GraphOperation.class); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException( + "Inputs class " + inputClass.getName() + " must have a public ctor(GraphOperation).", + e); + } + } + } + + void putRaw(String opType, RawCustomGradient g) { + if (typed.containsKey(opType)) { + throw new IllegalStateException(dupMsg(opType, "typed", "raw")); + } + RawCustomGradient prev = raw.putIfAbsent(opType, g); + if (prev != null) { + throw new IllegalStateException( + "A raw gradient is already registered for op type '" + opType + "'."); + } + } + + > void putTyped( + String opType, CustomGradient g, Class inputClass) { + if (raw.containsKey(opType)) { + throw new IllegalStateException(dupMsg(opType, "raw", "typed")); + } + TypedEntry prev = typed.putIfAbsent(opType, new TypedEntry<>(g, inputClass)); + if (prev != null) { + throw new IllegalStateException( + "A typed gradient is already registered for op type '" + opType + "'."); + } + } + + @Override + protected List> apply( + Graph graph, TFJ_Scope scope, GraphOperation operation, List> gradInputs) { + + final String opType = operation.type(); + + RawCustomGradient rg = raw.get(opType); + if (rg != null) { + // NativeScope & Ops constructors are package-private => must be in org.tensorflow.op + Scope nativeScope = + new NativeScope(scope, graph, operation.name()).withSubScope(operation.name()); + return rg.call(new Ops(nativeScope), operation, gradInputs); + } + + @SuppressWarnings("rawtypes") + TypedEntry te = typed.get(opType); + if (te != null) { + return applyTyped(graph, scope, operation, gradInputs, te); + } + + throw new IllegalStateException("No Java custom gradient registered for op type: " + opType); + } + + private > List> applyTyped( + Graph graph, + TFJ_Scope scope, + GraphOperation operation, + List> gradInputs, + TypedEntry te) { + try { + T inputs = te.ctor.newInstance(operation); + Scope nativeScope = + new NativeScope(scope, graph, operation.name()).withSubScope(operation.name()); + return te.grad.call(new Ops(nativeScope), inputs, gradInputs); + } catch (ReflectiveOperationException e) { + throw new RuntimeException("Failed to instantiate inputs for " + te.inputClass.getName(), e); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/GradientDispatch.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/GradientDispatch.java new file mode 100644 index 00000000000..441cff5a2fc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/GradientDispatch.java @@ -0,0 +1,40 @@ +/* Copyright 2026 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. +======================================================================= +*/ +package org.tensorflow.op; + +import org.tensorflow.internal.c_api.TFJ_GradFuncAdapter; + +/** Public bridge to a single native gradient adapter. */ +public final class GradientDispatch { + + // package-private adapter that can access NativeScope/Ops constructors + static final DispatchingGradientAdapter ADAPTER = new DispatchingGradientAdapter(); + + private GradientDispatch() {} + + public static TFJ_GradFuncAdapter adapter() { + return ADAPTER; + } + + public static void putRaw(String opType, RawCustomGradient gradient) { + ADAPTER.putRaw(opType, gradient); + } + + public static > void putTyped( + String opType, CustomGradient gradient, Class inputClass) { + ADAPTER.putTyped(opType, gradient, inputClass); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/NativeScope.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/NativeScope.java new file mode 100644 index 00000000000..f7685bbad6b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/NativeScope.java @@ -0,0 +1,149 @@ +/* + Copyright 2024 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. +============================================================================== +*/ +package org.tensorflow.op; + +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_GetUniqueNameForOp; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_NewScopeWithControlDependencies; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_NewScopeWithDevice; +import static org.tensorflow.internal.c_api.global.tensorflow.TFJ_NewSubScope; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.tensorflow.DeviceSpec; +import org.tensorflow.ExecutionEnvironment; +import org.tensorflow.Graph; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.internal.c_api.TFJ_Scope; +import org.tensorflow.internal.c_api.TF_Operation; + +/** A {@link Scope} implementation backed by a native scope. */ +public final class NativeScope implements Scope { + + @Override + public ExecutionEnvironment env() { + return graph; + } + + @Override + public NativeScope withSubScope(String childScopeName) { + return new NativeScope(TFJ_NewSubScope(nativeScope, childScopeName), graph, null, device); + } + + @Override + public NativeScope withName(String opName) { + return new NativeScope(nativeScope, graph, opName, device); + } + + @Override + public NativeScope withNameAsSubScope(String defaultName) { + if (opName == null) { + return withSubScope(defaultName); + } else { + return withSubScope(opName); + } + } + + @Override + public NativeScope withDevice(DeviceSpec newDevice) { + return new NativeScope( + TFJ_NewScopeWithDevice(nativeScope, newDevice.toString()), graph, newDevice.toString()); + } + + @Override + public Scope withInitScope() { + throw new IllegalStateException("Can't add init operations in a native scope"); + } + + @Override + public String makeOpName(String defaultName) { + String name = opName != null ? opName : defaultName; + return TFJ_GetUniqueNameForOp(nativeScope, name); + } + + @Override + public String makeUnique(String id) { + return TFJ_GetUniqueNameForOp(nativeScope, id); + } + + @Override + public void refreshNames() {} + + @Override + public Scope withControlDependencies(Iterable controls) { + return withControlDependencyOps( + StreamSupport.stream(controls.spliterator(), false) + .map(Op::op) + .collect(Collectors.toList())); + } + + @Override + public Scope withControlDependencyOps(Iterable controls) { + List controlDeps = + StreamSupport.stream(controls.spliterator(), false).collect(Collectors.toList()); + TF_Operation[] ops = new TF_Operation[controlDeps.size()]; + + for (int i = 0; i < controlDeps.size(); i++) { + Operation op = controlDeps.get(i); + if (!(op instanceof GraphOperation)) { + throw new IllegalArgumentException("Can only add graph ops as control dependencies"); + } + ops[i] = ((GraphOperation) op).getUnsafeNativeHandle(); + } + + return new NativeScope( + TFJ_NewScopeWithControlDependencies(nativeScope, ops[0], ops.length), graph, device); + } + + @Override + public OperationBuilder apply(OperationBuilder builder) { + return builder; + } + + @Override + public String getDeviceString() { + if (device == null) { + throw new UnsupportedOperationException( + "Can't get device string for native scope unless it has been explicitly set"); + } else { + return device; + } + } + + @Override + public boolean isInit() { + return false; + } + + NativeScope(TFJ_Scope nativeScope, Graph graph, String device) { + this(nativeScope, graph, null, device); + } + + private NativeScope(TFJ_Scope nativeScope, Graph graph, String opName, String device) { + this.graph = graph; + this.nativeScope = nativeScope; + this.opName = opName; + this.device = device; + } + + private final Graph graph; + private final TFJ_Scope nativeScope; + private final String opName; + private final String device; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Op.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Op.java index 6051623414f..1eaf0a63339 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Op.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Op.java @@ -21,17 +21,17 @@ /** * A logical unit of computation. * - *

    {@code Op} implementations provide a strongly typed API for building and executing - * operations without the use of literals and indexes, as required in internal classes like - * {@link Operation}. + *

    {@code Op} implementations provide a strongly typed API for building and executing operations + * without the use of literals and indexes, as required in internal classes like {@link Operation}. * *

    Ops can be classified under two categories: + * *

      - *
    • {@link RawOp Raw} ops target a single TensorFlow operation and are, in most cases, - * generated automatically from the {@code OpDef} proto definitions exposed by TensorFlow runtime - * library.
    • - *
    • Composite ops execute a series of other ops to accomplish a task logically presented - * as a single unit of computation. + *
    • {@link RawOp Raw} ops target a single TensorFlow operation and are, in most cases, + * generated automatically from the {@code OpDef} proto definitions exposed by TensorFlow + * runtime library. + *
    • Composite ops execute a series of other ops to accomplish a task logically presented + * as a single unit of computation. *
    */ public interface Op { @@ -50,9 +50,7 @@ public interface Op { */ Operation op(); - /** - * Return the execution environment this op was created in. - */ + /** Return the execution environment this op was created in. */ default ExecutionEnvironment env() { return op().env(); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/OpScope.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/OpScope.java new file mode 100644 index 00000000000..b96b2ebccac --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/OpScope.java @@ -0,0 +1,146 @@ +/* Copyright 2017 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. +==============================================================================*/ + +package org.tensorflow.op; + +import java.util.ArrayList; +import java.util.List; +import org.tensorflow.DeviceSpec; +import org.tensorflow.ExecutionEnvironment; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; + +/** + * A Java implementation of {@link Scope}. This is used in all cases except custom gradient + * definitions. + */ +public final class OpScope implements Scope { + + /** + * Create a new top-level scope. + * + * @param env The execution environment used by the scope. + */ + public OpScope(ExecutionEnvironment env) { + this(env, new NameScope(env), new ArrayList<>(), DeviceSpec.newBuilder().build(), false); + } + + @Override + public ExecutionEnvironment env() { + return env; + } + + @Override + public OpScope withSubScope(String childScopeName) { + return new OpScope( + env, nameScope.withSubScope(childScopeName, env), controlDependencies, deviceSpec, isInit); + } + + @Override + public OpScope withName(String opName) { + return new OpScope(env, nameScope.withName(opName), controlDependencies, deviceSpec, isInit); + } + + @Override + public OpScope withNameAsSubScope(String defaultName) { + return new OpScope( + env, + nameScope.withSubScope(nameScope.makeOpName(defaultName), env), + controlDependencies, + deviceSpec, + isInit); + } + + @Override + public OpScope withDevice(DeviceSpec newDevice) { + return new OpScope(env, nameScope, controlDependencies, newDevice, isInit); + } + + @Override + public OpScope withInitScope() { + return new OpScope(env, nameScope, new ArrayList<>(), deviceSpec, true); + } + + @Override + public String makeOpName(String defaultName) { + return nameScope.makeOpName(defaultName); + } + + @Override + public String makeUnique(String id) { + return nameScope.makeUnique(id); + } + + @Override + public void refreshNames() { + nameScope.importIdsFrom(env); + } + + private OpScope( + ExecutionEnvironment env, + NameScope nameScope, + List controlDependencies, + DeviceSpec deviceSpec, + boolean isInit) { + this.env = env; + this.nameScope = nameScope; + this.controlDependencies = controlDependencies; + this.deviceSpec = deviceSpec; + this.isInit = isInit; + } + + @Override + public Scope withControlDependencyOps(Iterable controls) { + ArrayList toAdd = new ArrayList<>(); + for (Operation control : controls) { + env.checkInput(control); + if (isInit && !env.isInitializer(control)) { + throw new IllegalArgumentException("Init scope can not have non-init control dependency."); + } + if (isInit || !env.isInitializer(control)) { + toAdd.add(control); + } + } + + return new OpScope(env, nameScope, toAdd, deviceSpec, isInit); + } + + @Override + public OperationBuilder apply(OperationBuilder builder) { + builder.setDevice(deviceSpec.toString()); + for (Operation control : controlDependencies) { + if (isInit || !env.isInitializer(control)) { + builder.addControlInput(control); + } + } + return builder; + } + + @Override + public boolean isInit() { + return isInit; + } + + @Override + public String getDeviceString() { + return deviceSpec.toString(); + } + + private final ExecutionEnvironment env; + private final List controlDependencies; + private final NameScope nameScope; + private final DeviceSpec deviceSpec; + private final boolean isInit; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Operands.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Operands.java index 5706ff1f283..be04d776840 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Operands.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Operands.java @@ -22,7 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.Output; import org.tensorflow.internal.types.registry.TensorTypeRegistry; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.family.TType; /** Utilities for manipulating operand related types and lists. */ diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawCustomGradient.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawCustomGradient.java new file mode 100644 index 00000000000..ad348600e74 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawCustomGradient.java @@ -0,0 +1,48 @@ +/* + Copyright 2024 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. +============================================================================== +*/ +package org.tensorflow.op; + +import java.util.List; +import org.tensorflow.GraphOperation; +import org.tensorflow.Operand; +import org.tensorflow.Output; +import org.tensorflow.TensorFlow; + +/** + * A custom gradient for an op of unspecified type. Should be registered using {@link + * TensorFlow#registerCustomGradient(String, RawCustomGradient)}. + * + *

    Creates the gradient based off of a {@link GraphOperation}. To operate on the op input class + * instead use {@link CustomGradient}. + * + *

    The op type of {@code op} will depend on the op type string passed to the registration method. + * Note that the registration method can be called more than once, resulting this gradient function + * being used for multiple different op types. + */ +@FunctionalInterface +public interface RawCustomGradient { + + /** + * Calculate the gradients for {@code op}. + * + * @param tf the {@link Ops} instance used to create ops + * @param op the op to calculate the gradients of. + * @param gradInputs the gradients of the op's outputs. + * @return the gradients of the op's inputs. + */ + List> call(Ops tf, GraphOperation op, List> gradInputs); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOp.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOp.java index 53137a84b54..b55a0062c44 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOp.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOp.java @@ -59,8 +59,19 @@ public final String toString() { * Constructor. * * @param operation the underlying operation + * @param requiredType the type that the underlying operation must be */ - protected RawOp(Operation operation) { + protected RawOp(Operation operation, String requiredType) { + if (!requiredType.equals(operation.type())) { + throw new IllegalArgumentException( + "Can't create a " + + this.getClass() + + " from an operation with type \"" + + operation.type() + + "\", operation must have type \"" + + requiredType + + "\"."); + } this.operation = operation; } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOpInputs.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOpInputs.java new file mode 100644 index 00000000000..0b236d955d8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/RawOpInputs.java @@ -0,0 +1,110 @@ +/* + Copyright 2021 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. +============================================================================== +*/ +package org.tensorflow.op; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; +import org.tensorflow.GraphOperation; +import org.tensorflow.OperationAttributeInspector; +import org.tensorflow.proto.AttrValue; + +/** A base class for operation input accessors. */ +public abstract class RawOpInputs { + + /** The outputs of this operation. */ + public T getOutputs() { + return outputs; + } + + /** Get the names of this op's attributes */ + public Set attributeNames() { + return attributeNames; + } + + /** + * Get the value of an attribute as an {@link AttrValue} proto. The type-safe accessors should be + * preferred when possible. + * + * @param name the name of the attribute + * @return the value of the attribute, as an {@link AttrValue} proto + */ + public AttrValue attributeValue(String name) { + return op.attributes().getAttrValueProto(name); + } + + /** Get all attribute value protos */ + public Map attributeValues() { + Map values = new LinkedHashMap<>(attributeNames.size()); + for (String name : attributeNames) { + values.put(name, attributeValue(name)); + } + return values; + } + + /** + * Get the metadata for an attribute + * + * @param name the name of the attribute + * @return the attribute's metadata + */ + public AttributeMetadata attributeMetadata(String name) { + return op.attributes().getAttrMetadata(name); + } + + /** Get an inspector for the operation's attributes. */ + public OperationAttributeInspector attributes() { + return op.attributes(); + } + + @Override + public final int hashCode() { + return op.hashCode(); + } + + @Override + public final boolean equals(Object obj) { + if (this == obj) { + return true; + } + // Note: we consider that all objects wrapping the same operation are equal, no matter their + // implementation + if (!(obj instanceof RawOpInputs)) { + return false; + } + return op.equals(((RawOpInputs) obj).op); + } + + @Override + public final String toString() { + return String.format("Inputs of <%s '%s'>", op.type(), op.name()); + } + + protected RawOpInputs(T outputs, GraphOperation op, Collection attributeNames) { + this.outputs = outputs; + this.op = op; + this.attributeNames = Collections.unmodifiableSet(new LinkedHashSet<>(attributeNames)); + } + + // don't expose, this will be converted to a ForwardOperation w/ new gradient support + private final GraphOperation op; + private final T outputs; + private final Set attributeNames; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java index b4705ea95a3..99426477d55 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java @@ -15,8 +15,6 @@ */ package org.tensorflow.op; -import java.util.ArrayList; -import java.util.List; import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.tensorflow.DeviceSpec; @@ -80,24 +78,10 @@ * *

    Scope objects are not thread-safe. */ -public final class Scope { - - /** - * Create a new top-level scope. - * - *

    For internal use only, use {@link ExecutionEnvironment#baseScope()} if you need a - * base level scope. - * - * @param env The execution environment used by the scope. - */ - public Scope(ExecutionEnvironment env) { - this(env, new NameScope(env), new ArrayList<>(), DeviceSpec.newBuilder().build(), false); - } +public interface Scope { /** Returns the execution environment used by this scope. */ - public ExecutionEnvironment env() { - return env; - } + ExecutionEnvironment env(); /** * Returns a new scope where added operations will have the provided name prefix. @@ -112,10 +96,7 @@ public ExecutionEnvironment env() { * @return a new subscope * @throws IllegalArgumentException if the name is invalid */ - public Scope withSubScope(String childScopeName) { - return new Scope( - env, nameScope.withSubScope(childScopeName, env), controlDependencies, deviceSpec, isInit); - } + Scope withSubScope(String childScopeName); /** * Return a new scope that uses the provided name for an op. @@ -129,9 +110,7 @@ public Scope withSubScope(String childScopeName) { * @return a new Scope that uses opName for operations. * @throws IllegalArgumentException if the name is invalid */ - public Scope withName(String opName) { - return new Scope(env, nameScope.withName(opName), controlDependencies, deviceSpec, isInit); - } + Scope withName(String opName); /** * Returns a new scope where added operations will be prefixed by this scope's op name (set by @@ -149,14 +128,7 @@ public Scope withName(String opName) { * @return a new subscope * @throws IllegalArgumentException if the name is invalid */ - public Scope withNameAsSubScope(String defaultName) { - return new Scope( - env, - nameScope.withSubScope(nameScope.makeOpName(defaultName), env), - controlDependencies, - deviceSpec, - isInit); - } + Scope withNameAsSubScope(String defaultName); /** * Return a new scope that uses the provided device specification for an op. @@ -164,19 +136,13 @@ public Scope withNameAsSubScope(String defaultName) { *

    Operations created within this scope will place the created operations on the device(s) * matching the provided spec. * - * @param deviceSpec device specification for an operator in the returned scope + * @param newDevice device specification for an operator in the returned scope * @return a new Scope that uses opName for operations. */ - public Scope withDevice(DeviceSpec deviceSpec) { - return new Scope(env, nameScope, controlDependencies, deviceSpec, isInit); - } - - // TODO stop gradient recording in init scopes (once we have gradient recording) + Scope withDevice(DeviceSpec newDevice); /** Get an extension of this scope that generates initialization ops. */ - public Scope withInitScope() { - return new Scope(env.initEnv(), nameScope, new ArrayList<>(), deviceSpec, true); - } + Scope withInitScope(); /** * Create a unique name for an operator and reserves it, using a provided default if necessary. @@ -198,55 +164,17 @@ public Scope withInitScope() { * @return unique name for the operator. * @throws IllegalArgumentException if the default name is invalid. */ - public String makeOpName(String defaultName) { - return nameScope.makeOpName(defaultName); - } + String makeOpName(String defaultName); /** Makes a unique name from {@code id} and reserves it. */ - public String makeUnique(String id) { - return nameScope.makeUnique(id); - } - - /** - * Returns a builder to create a new {@link Operation}. - * - *

    Note that {@code name} is automatically made unique. - * - * @param type of the Operation (i.e., identifies the computation to be performed) - * @param name to refer to the created Operation in this environment scope. Is uniquified. - * @return an {@link OperationBuilder} to create an Operation when {@link - * OperationBuilder#build()} is invoked. If {@link OperationBuilder#build()} is not invoked, - * then some resources may leak. - */ - public OperationBuilder opBuilder(String type, String name) { - return env.opBuilder(type, makeOpName(name), this); - } - - public static boolean isValidOpName(String name) { - return NameScope.isValidName(name); - } + String makeUnique(String id); /** * Refresh the used name list (used for uniquifying names) from the underlying graph. * *

    Should be used if you made changes to the graph from non-{@code Scope} APIs. */ - public void refreshNames() { - nameScope.importIdsFrom(env); - } - - private Scope( - ExecutionEnvironment env, - NameScope nameScope, - List controlDependencies, - DeviceSpec deviceSpec, - boolean isInit) { - this.env = env; - this.nameScope = nameScope; - this.controlDependencies = controlDependencies; - this.deviceSpec = deviceSpec; - this.isInit = isInit; - } + void refreshNames(); /** * Returns a new scope where added operations will have the provided control dependencies. @@ -260,7 +188,7 @@ private Scope( * @param controls control dependencies for ops created with the returned scope * @return a new scope with the provided control dependencies */ - public Scope withControlDependencies(Iterable controls) { + default Scope withControlDependencies(Iterable controls) { return withControlDependencyOps( StreamSupport.stream(controls.spliterator(), false) .map(Op::op) @@ -279,19 +207,26 @@ public Scope withControlDependencies(Iterable controls) { * @param controls control dependencies for ops created with the returned scope * @return a new scope with the provided control dependencies */ - public Scope withControlDependencyOps(Iterable controls) { - ArrayList toAdd = new ArrayList<>(); - for (Operation control : controls) { - env.checkInput(control); - if (isInit && !env.isInitOp(control)) { - throw new IllegalArgumentException("Init scope can not have non-init control dependency."); - } - if (isInit || !env.isInitOp(control)) { - toAdd.add(control); - } - } + Scope withControlDependencyOps(Iterable controls); + + /** + * Returns a builder to create a new {@link Operation}. + * + *

    Note that {@code name} is automatically made unique. + * + * @param type of the Operation (i.e., identifies the computation to be performed) + * @param name to refer to the created Operation in this environment scope. Is uniquified. + * @return an {@link OperationBuilder} to create an Operation when {@link + * OperationBuilder#build()} is invoked. If {@link OperationBuilder#build()} is not invoked, + * then some resources may leak. + */ + default OperationBuilder opBuilder(String type, String name) { + return env().opBuilder(type, makeOpName(name), this); + } - return new Scope(env, nameScope, toAdd, deviceSpec, isInit); + /** Check whether {@code name} is a valid name for an operation. */ + static boolean isValidOpName(String name) { + return NameScope.isValidName(name); } /** @@ -302,40 +237,11 @@ public Scope withControlDependencyOps(Iterable controls) { * * @param builder OperationBuilder to add control inputs and device specification to */ - public OperationBuilder apply(OperationBuilder builder) { - builder.setDevice(deviceSpec.toString()); - for (Operation control : controlDependencies) { - if (isInit || !env.isInitOp(control)) { - builder.addControlInput(control); - } - } - return builder; - } - - /** - * Handle op creation, like registering it as an init op if the scope is init. - * - *

    FOR INTERNAL USE ONLY - */ - public void onOpCreated(Operation op) { - if (isInit) { - env.registerInitOp(op); - } - } + OperationBuilder apply(OperationBuilder builder); /** Returns device string from the scope. */ - public String getDeviceString() { - return deviceSpec.toString(); - } + String getDeviceString(); /** Get whether this scope is building init ops. */ - public boolean isInit() { - return isInit; - } - - private final ExecutionEnvironment env; - private final List controlDependencies; - private final NameScope nameScope; - private final DeviceSpec deviceSpec; - private final boolean isInit; + boolean isInit(); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Endpoint.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Endpoint.java index 2db1672fdb4..2d64e50d747 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Endpoint.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Endpoint.java @@ -70,8 +70,8 @@ * Indicates that the class description should be copied in the documentation of this endpoint, * instead of the description of the annotated method. * - *

    Tags of the annotated method, like {@code @param} and {@code @return}, are copied to - * the endpoint documentation independently from this value. + *

    Tags of the annotated method, like {@code @param} and {@code @return}, are copied to the + * endpoint documentation independently from this value. */ boolean describeByClass() default false; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpInputsMetadata.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpInputsMetadata.java new file mode 100644 index 00000000000..e15f60e505a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpInputsMetadata.java @@ -0,0 +1,36 @@ +/* + Copyright 2021 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. +======================================================================= + +*/ +package org.tensorflow.op.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.tensorflow.op.RawOp; + +/** + * An annotation to provide metadata about an op inputs accessor class. Should only be used by users + * on custom ops, will be generated for non-custom ops. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OpInputsMetadata { + + /** The main op class. */ + Class outputsClass(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpMetadata.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpMetadata.java new file mode 100644 index 00000000000..7f3bc929f73 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/OpMetadata.java @@ -0,0 +1,40 @@ +/* + Copyright 2021 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. +======================================================================= + +*/ +package org.tensorflow.op.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.tensorflow.op.RawOpInputs; + +/** + * An annotation to provide metadata about an op. Should only be used by users on custom ops, will + * be generated for non-custom ops. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OpMetadata { + + /** The type of the op in the TF runtime. */ + String opType(); + + /** The typesafe inputs class (which should be annotated with {@link OpInputsMetadata}). */ + @SuppressWarnings("rawtypes") + Class inputsClass(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Operator.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Operator.java index dc995509a05..748fab26230 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Operator.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/annotation/Operator.java @@ -25,11 +25,11 @@ * Annotation used by classes to make TensorFlow operations conveniently accessible via {@code * org.tensorflow.op.Ops} or one of its groups. * - *

    An annotation processor ({@code org.tensorflow.processor.OperatorProcessor}) builds the - * {@code Ops} class by aggregating all classes annotated as {@code @Operator}s. Each annotated - * class must have at least one public static factory method named {@code create} that - * accepts a {@link org.tensorflow.op.Scope} as its first argument. The processor then adds a - * convenience method in the {@code Ops} class. For example: + *

    An annotation processor ({@code org.tensorflow.processor.OperatorProcessor}) builds the {@code + * Ops} class by aggregating all classes annotated as {@code @Operator}s. Each annotated class + * must have at least one public static factory method named {@code create} that accepts a + * {@link org.tensorflow.op.Scope} as its first argument. The processor then adds a convenience + * method in the {@code Ops} class. For example: * *

    {@code
      * @Operator
    @@ -96,8 +96,8 @@
        * }
    * *

    The group name must be a valid Java - * package name. + * href="https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html">valid Java package + * name. */ String group() default ""; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMask.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMask.java index 85a41ef485f..f83cf577889 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMask.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMask.java @@ -1,19 +1,19 @@ /* - Copyright 2021 The TensorFlow Authors. All Rights Reserved. + Copyright 2021 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 +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 + 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. - ============================================================================== - */ +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. +============================================================================== +*/ package org.tensorflow.op.core; import java.util.Arrays; @@ -33,18 +33,19 @@ public abstract class BooleanMask { /** - * Apply boolean mask to tensor. Returns the flat array of each element corresponding to a {@code true} in the mask. - *

    - * Numpy equivalent is {@code tensor[mask]}. - *

    - * In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match - * the first K dimensions of {@code tensor}'s shape. We then have: - * {@code booleanMask(tensor, mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} - * where {@code (i1,...,iK)} is the ith {@code true} entry of {@code mask} (row-major order). - *

    - * The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 by default). - * In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match - * the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * Apply boolean mask to tensor. Returns the flat array of each element corresponding to a {@code + * true} in the mask. + * + *

    Numpy equivalent is {@code tensor[mask]}. + * + *

    In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match + * the first K dimensions of {@code tensor}'s shape. We then have: {@code booleanMask(tensor, + * mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code + * true} entry of {@code mask} (row-major order). + * + *

    The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 + * by default). In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape + * must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. * * @param scope * @param tensor The tensor to mask. @@ -53,8 +54,8 @@ public abstract class BooleanMask { * @return The masked tensor. */ @Endpoint(name = "booleanMask") - public static Operand create(Scope scope, Operand tensor, Operand mask, - Options... options) { + public static Operand create( + Scope scope, Operand tensor, Operand mask, Options... options) { scope = scope.withNameAsSubScope("BooleanMask"); @@ -77,7 +78,7 @@ public static Operand create(Scope scope, Operand tensor if (maskShape.numDimensions() == 0) { throw new IllegalArgumentException("Mask cannot be a scalar."); } - if (maskShape.hasUnknownDimension()) { + if (maskShape.isUnknown()) { throw new IllegalArgumentException("Mask cannot have unknown number of dimensions"); } @@ -85,59 +86,67 @@ public static Operand create(Scope scope, Operand tensor Shape requiredMaskShape = tensorShape.subShape(axis, axis + maskShape.numDimensions()); if (!requiredMaskShape.isCompatibleWith(maskShape)) { throw new IllegalArgumentException( - "Mask shape " + maskShape + " is not compatible with the required mask shape: " + requiredMaskShape + "."); + "Mask shape " + + maskShape + + " is not compatible with the required mask shape: " + + requiredMaskShape + + "."); } - org.tensorflow.op.core.Shape liveShape = org.tensorflow.op.core.Shape.create(scope, tensor); - - Operand leadingSize = ReduceProd.create(scope, - StridedSliceHelper.stridedSlice(scope, - liveShape, - Indices.range(axis, axis + maskShape.numDimensions()) - ), - Constant.arrayOf(scope, 0) - ); - - Operand flattened = Reshape.create(scope, tensor, Concat.create( - scope, - Arrays.asList( - StridedSliceHelper.stridedSlice(scope, liveShape, Indices.sliceTo(axis)), - Reshape.create(scope, leadingSize, Constant.arrayOf(scope, 1)), - StridedSliceHelper.stridedSlice(scope, liveShape, Indices.sliceFrom(axis + maskShape.numDimensions())) - ), - Constant.scalarOf(scope, 0) - )); + org.tensorflow.op.core.Shape liveShape = + org.tensorflow.op.core.Shape.create(scope, tensor); + + Operand leadingSize = + ReduceProd.create( + scope, + StridedSliceHelper.stridedSlice( + scope, liveShape, Indices.range(axis, axis + maskShape.numDimensions())), + Constant.arrayOf(scope, 0)); + + Operand flattened = + Reshape.create( + scope, + tensor, + Concat.create( + scope, + Arrays.asList( + StridedSliceHelper.stridedSlice(scope, liveShape, Indices.sliceTo(axis)), + Reshape.create(scope, leadingSize, Constant.arrayOf(scope, 1)), + StridedSliceHelper.stridedSlice( + scope, liveShape, Indices.sliceFrom(axis + maskShape.numDimensions()))), + Constant.scalarOf(scope, 0))); Operand flatMask = Reshape.create(scope, mask, Constant.arrayOf(scope, -1)); - Operand indices = Squeeze.create(scope, Where.create(scope, flatMask), Squeeze.axis(Collections.singletonList(1L))); + Operand indices = + Squeeze.create( + scope, Where.create(scope, flatMask), Squeeze.axis(Collections.singletonList(1L))); return Gather.create(scope, flattened, indices, axisTensor); } /** - * Used to indicate the axis to mask from. - * {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match - * the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. - * @param axis the axis to mask from. Uses 0 if null. + * Used to indicate the axis to mask from. {@code axis + dim(mask) <= dim(tensor)} and {@code + * mask}'s shape must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s + * shape. + * + * @param axis the axis to mask from. Uses 0 if null. */ - public static Options axis(Integer axis){ + public static Options axis(Integer axis) { return new Options().axis(axis); } - /** - * Used to indicate the axis to mask from. - * {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match - * the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * Used to indicate the axis to mask from. {@code axis + dim(mask) <= dim(tensor)} and {@code + * mask}'s shape must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s + * shape. + * * @param axis the axis to mask from. */ - public static Options axis(int axis){ + public static Options axis(int axis) { return new Options().axis(axis); } - /** - * Optional attributes for {@link org.tensorflow.op.core.BooleanMask} - */ + /** Optional attributes for {@link org.tensorflow.op.core.BooleanMask} */ public static class Options { /** @@ -150,8 +159,6 @@ public Options axis(Integer axis) { private Integer axis; - private Options() { - } + private Options() {} } - } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMaskUpdate.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMaskUpdate.java index a40ae7ab017..d402bda432a 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMaskUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/BooleanMaskUpdate.java @@ -1,19 +1,19 @@ /* - Copyright 2021 The TensorFlow Authors. All Rights Reserved. + Copyright 2021 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 +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 + 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. - ============================================================================== - */ +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. +============================================================================== +*/ package org.tensorflow.op.core; import java.util.Arrays; @@ -32,23 +32,24 @@ public abstract class BooleanMaskUpdate { /** - * Updates a tensor at the masked values, and returns the updated tensor. Does not mutate the input tensors. {@code - * updates} will be broadcasted by default - *

    - * Numpy equivalent is `tensor[mask] = updates`. - *

    - * In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match the first K dimensions of - * {@code tensor}'s shape. We then have: {@code booleanMask(tensor, mask)[i, j1,...,jd] = - * tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code true} entry of {@code mask} (row-major - * order). - *

    - * The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 by default). In that - * case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match the first {@code axis + - * dim(mask)} dimensions of {@code tensor}'s shape. - *

    - * The shape of {@code updates} should be {@code [n, t_1, t_2, ...]} where {@code n} is the number of true values in - * {@code mask} and {@code t_i} is the {@code i}th dimension of {@code tensor} after {@code axis} and {@code mask}. - * {@code updates} will be broadcasted to this shape by default, which can be disabled using {@code options}. + * Updates a tensor at the masked values, and returns the updated tensor. Does not mutate the + * input tensors. {@code updates} will be broadcasted by default + * + *

    Numpy equivalent is `tensor[mask] = updates`. + * + *

    In general, {@code 0 < dim(mask) = K <= dim(tensor)}, and {@code mask}'s shape must match + * the first K dimensions of {@code tensor}'s shape. We then have: {@code booleanMask(tensor, + * mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]} where {@code (i1,...,iK)} is the ith {@code + * true} entry of {@code mask} (row-major order). + * + *

    The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 + * by default). In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape + * must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * + *

    The shape of {@code updates} should be {@code [n, t_1, t_2, ...]} where {@code n} is the + * number of true values in {@code mask} and {@code t_i} is the {@code i}th dimension of {@code + * tensor} after {@code axis} and {@code mask}. {@code updates} will be broadcasted to this shape + * by default, which can be disabled using {@code options}. * * @param tensor The tensor to mask. * @param mask The mask to apply. @@ -57,9 +58,8 @@ public abstract class BooleanMaskUpdate { * @return The masked tensor. */ @Endpoint(name = "booleanMaskUpdate") - public static Operand create(Scope scope, Operand tensor, Operand mask, - Operand updates, - Options... options) { + public static Operand create( + Scope scope, Operand tensor, Operand mask, Operand updates, Options... options) { scope = scope.withNameAsSubScope("BooleanMaskUpdate"); @@ -86,53 +86,53 @@ public static Operand create(Scope scope, Operand tensor if (maskShape.numDimensions() == 0) { throw new IllegalArgumentException("Mask cannot be a scalar."); } - if (maskShape.hasUnknownDimension()) { + if (maskShape.isUnknown()) { throw new IllegalArgumentException("Mask cannot have unknown number of dimensions"); } Shape requiredMaskShape = tensorShape.subShape(axis, axis + maskShape.numDimensions()); if (!requiredMaskShape.isCompatibleWith(maskShape)) { throw new IllegalArgumentException( - "Mask shape " + maskShape + " is not compatible with the required mask shape: " + requiredMaskShape + "."); + "Mask shape " + + maskShape + + " is not compatible with the required mask shape: " + + requiredMaskShape + + "."); } Operand liveShape = org.tensorflow.op.core.Shape.create(scope, tensor); - Operand leadingSize = ReduceProd.create(scope, - StridedSliceHelper.stridedSlice(scope, - liveShape, - Indices.sliceTo(axis + maskShape.numDimensions()) - ), - Constant.arrayOf(scope, 0) - ); - - Operand innerShape = StridedSliceHelper - .stridedSlice(scope, liveShape, Indices.sliceFrom(axis + maskShape.numDimensions())); - - Operand reshaped = Reshape.create(scope, tensor, Concat.create( - scope, - Arrays.asList( - Reshape.create(scope, leadingSize, Constant.arrayOf(scope, 1)), - innerShape - ), - Constant.scalarOf(scope, 0) - )); + Operand leadingSize = + ReduceProd.create( + scope, + StridedSliceHelper.stridedSlice( + scope, liveShape, Indices.sliceTo(axis + maskShape.numDimensions())), + Constant.arrayOf(scope, 0)); + + Operand innerShape = + StridedSliceHelper.stridedSlice( + scope, liveShape, Indices.sliceFrom(axis + maskShape.numDimensions())); + + Operand reshaped = + Reshape.create( + scope, + tensor, + Concat.create( + scope, + Arrays.asList( + Reshape.create(scope, leadingSize, Constant.arrayOf(scope, 1)), innerShape), + Constant.scalarOf(scope, 0))); Operand indices = Where.create(scope, mask); if (broadcast) { Operand indicesShape = org.tensorflow.op.core.Shape.create(scope, indices); // this is the number of true values - Operand batchShape = StridedSliceHelper.stridedSlice(scope, indicesShape, Indices.sliceTo(-1)); + Operand batchShape = + StridedSliceHelper.stridedSlice(scope, indicesShape, Indices.sliceTo(-1)); - Operand updateShape = Concat.create( - scope, - Arrays.asList( - batchShape, - innerShape - ), - Constant.scalarOf(scope, 0) - ); + Operand updateShape = + Concat.create(scope, Arrays.asList(batchShape, innerShape), Constant.scalarOf(scope, 0)); updates = BroadcastTo.create(scope, updates, updateShape); } @@ -142,25 +142,22 @@ public static Operand create(Scope scope, Operand tensor } /** - * Used to indicate the axis to mask from. {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape must match - * the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * Used to indicate the axis to mask from. {@code axis + dim(mask) <= dim(tensor)} and {@code + * mask}'s shape must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s + * shape. * - * @param axis the axis to mask from. Uses 0 if null. + * @param axis the axis to mask from. Uses 0 if null. */ public static Options axis(Integer axis) { return new Options().axis(axis); } - /** - * Whether to try broadcasting update. True by default. - */ + /** Whether to try broadcasting update. True by default. */ public static Options broadcast(Boolean broadcast) { return new Options().broadcast(broadcast); } - /** - * Optional attributes for {@link BooleanMaskUpdate} - */ + /** Optional attributes for {@link BooleanMaskUpdate} */ public static class Options { /** @@ -172,7 +169,7 @@ public Options axis(Integer axis) { } /** - * @param broadcast (Optional) Whether to try broadcasting update. True by default. + * @param broadcast (Optional) Whether to try broadcasting update. True by default. */ public Options broadcast(Boolean broadcast) { this.broadcast = broadcast; @@ -182,8 +179,6 @@ public Options broadcast(Boolean broadcast) { private Integer axis; private Boolean broadcast; - private Options() { - } + private Options() {} } - } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java index f9f6e00f0f6..b68bdbcd289 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java @@ -1329,11 +1329,7 @@ public static Constant tensorOfSameType( /** * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed - * afterwards without issue. - * - *

    Note: this endpoint cannot be simply called {@code constant} since it will conflict with - * other endpoints accepting an NdArray in parameter {e.g. {@link #tensorOf(Scope, - * FloatNdArray)}}. + * afterward without issue. * * @param scope is a scope used to add the underlying operation. * @param tensor a Tensor holding the constant value @@ -1356,7 +1352,7 @@ public Output asOutput() { } private Constant(Operation operation) { - super(operation); + super(operation, OP_NAME); output = operation.output(0); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Function.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Function.java index 255a62e1253..94d279b52fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Function.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Function.java @@ -1,18 +1,18 @@ -/* Copyright 2020-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2020-2024 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 +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 + 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. - ======================================================================= - */ +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. +======================================================================= +*/ package org.tensorflow.op.core; import java.util.Map; @@ -27,6 +27,9 @@ @Operator(name = "call") public abstract class Function { + /** Constructor. */ + public Function() {} + /** * Calls the function in an execution environment, adding its graph as a function if it isn't * already present. The inputs and outputs are keyed by the names set in the {@code Signature}. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java index 82edab51d40..e7159f3e9e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java @@ -29,18 +29,20 @@ import org.tensorflow.types.family.TType; /** - * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, - * i.e., {@code d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...} - *

    - * If {@code Options.dx()} values are set, they are as the initial symbolic partial derivatives of some loss - * function {@code L} w.r.t. {@code y}. {@code Options.dx()} must have the size of {@code y}. - *

    - * If {@code Options.dx()} is not set, the implementation will use dx of {@code OnesLike} for all + * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, i.e., + * {@code d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2...} + * + *

    If {@code Options.dx()} values are set, they are as the initial symbolic partial derivatives + * of some loss function {@code L} w.r.t. {@code y}. {@code Options.dx()} must have the size of + * {@code y}. + * + *

    If {@code Options.dx()} is not set, the implementation will use dx of {@code OnesLike} for all * shapes in {@code y}. - *

    - * The partial derivatives are returned in output {@code dy}, with the size of {@code x}. - *

    - * Example of usage: + * + *

    The partial derivatives are returned in output {@code dy}, with the size of {@code x}. + * + *

    Example of usage: + * *

    {@code
      * Gradients gradients = tf.gradients(loss, Arrays.asList(w, b));
      * Constant alpha = tf.constant(1.0f);
    @@ -51,9 +53,7 @@
     @Operator
     public final class Gradients implements Iterable> {
     
    -  /**
    -   * Optional attributes for {@link Gradients}
    -   */
    +  /** Optional attributes for {@link Gradients} */
       public static class Options {
     
         /**
    @@ -67,8 +67,7 @@ public Options dx(Iterable> dx) {
     
         private Iterable> dx;
     
    -    private Options() {
    -    }
    +    private Options() {}
       }
     
       /**
    @@ -138,10 +137,8 @@ public static Options dx(Iterable> dx) {
       public Iterator> iterator() {
         return (Iterator) dy.iterator();
       }
    -  
    -  /**
    -   * Partial derivatives of {@code y}s w.r.t. {@code x}s, with the size of {@code x}
    -   */
    +
    +  /** Partial derivatives of {@code y}s w.r.t. {@code x}s, with the size of {@code x} */
       public List> dy() {
         return dy;
       }
    @@ -162,7 +159,7 @@ public  Output dy(int index) {
       }
     
       private List> dy;
    -  
    +
       private Gradients(List> dy) {
         this.dy = dy;
       }
    diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Ones.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Ones.java
    index eff062c3de7..142bbbd223e 100644
    --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Ones.java
    +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Ones.java
    @@ -28,10 +28,13 @@
     
     /**
      * An operator creating a constant initialized with ones of the shape given by `dims`.
    - * 
    + *
      * 

    For example, the following expression + * *

    {@code tf.ones(tf.constant(shape), TFloat32.class)}
    + * * is the equivalent of + * *
    {@code tf.fill(tf.constant(shape), tf.constant(1.0f))}
    * * @param constant type @@ -49,7 +52,8 @@ public final class Ones implements Op, Operand { * @throws IllegalArgumentException if the tensor type or shape cannot be initialized with ones. */ @Endpoint - public static Ones create(Scope scope, Operand dims, Class type) { + public static Ones create( + Scope scope, Operand dims, Class type) { Scope onesScope = scope.withSubScope("Ones"); if (type == TString.class) { throw new IllegalArgumentException("Can't create Ones of String DataType"); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Shapes.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Shapes.java index 2bf2eecc4cb..309fd81f1e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Shapes.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Shapes.java @@ -1,4 +1,4 @@ -/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2020-2024 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. @@ -106,8 +106,7 @@ public static Operand flatten(Scope scope, Shape shape) { * @return the flattened shape */ @Endpoint(name = "flatten") - public static Operand flatten( - Scope scope, Shape shape, Class type) { + public static Operand flatten(Scope scope, Shape shape, Class type) { return ExpandDims.create( scope, size(scope, shape, type), @@ -136,8 +135,7 @@ public static Operand size(Scope scope, Shape shape) { * @return the size */ @Endpoint(name = "size") - public static Operand size( - Scope scope, Shape shape, Class type) { + public static Operand size(Scope scope, Shape shape, Class type) { Slice dims = Slice.create( scope, @@ -352,8 +350,7 @@ public static Operand squeeze(Scope scope, Shape shape) { * @return the squeezed shape */ @Endpoint(name = "squeeze") - public static Operand squeeze( - Scope scope, Shape shape, Class type) { + public static Operand squeeze(Scope scope, Shape shape, Class type) { Operand mask = NotEqual.create(scope, shape, Cast.create(scope, OnesLike.create(scope, shape), type)); @@ -382,8 +379,7 @@ public static Operand head(Scope scope, Shape shape) { * @return a 1-dimensional Operand containing the Shape's first dimension */ @Endpoint(name = "head") - public static Operand head( - Scope scope, Shape shape, Class type) { + public static Operand head(Scope scope, Shape shape, Class type) { return take(scope, shape, Cast.create(scope, Constant.scalarOf(scope, 1), type), type); } @@ -393,7 +389,8 @@ public static Operand head( * * @param scope current scope * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @return a 1-dimensional operand with the dimensions matching the first n dimensions of the * shape */ @@ -408,7 +405,8 @@ public static Operand take(Scope scope, Shape shape, Operand the shape datatype. * @return a 1-dimensional operand with the dimensions matching * the first n dimensions of the @@ -450,8 +448,7 @@ public static Operand tail(Scope scope, Shape shape) { * Shape */ @Endpoint(name = "tail") - public static Operand tail( - Scope scope, Shape shape, Class type) { + public static Operand tail(Scope scope, Shape shape, Class type) { return takeLast(scope, shape, Cast.create(scope, Constant.scalarOf(scope, 1), type), type); } @@ -461,7 +458,8 @@ public static Operand tail( * * @param scope current scope * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @return a 1-dimensional operand containing the dimensions matching the last n dimensions of the * shape */ @@ -477,7 +475,8 @@ public static Operand takeLast( * * @param scope current scope * @param shape the TensorFlow shape - * @param n the number of leading dimensions to get, must be <= than the shape's numDimensions() + * @param n the number of leading dimensions to get, must be less than or equal to the shape's + * numDimensions() * @param type the shape datatype. * @param the shape datatype. * @return a 1-dimensional operand containing the dimensions matching the last n dimensions of the diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/StridedSliceHelper.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/StridedSliceHelper.java index e97934ee312..109c97c0247 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/StridedSliceHelper.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/StridedSliceHelper.java @@ -1,4 +1,4 @@ -/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2020-2024 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. @@ -15,8 +15,8 @@ package org.tensorflow.op.core; import org.tensorflow.Operand; -import org.tensorflow.ndarray.index.Indices; import org.tensorflow.ndarray.index.Index; +import org.tensorflow.ndarray.index.Indices; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; @@ -41,8 +41,15 @@ static class StridedSliceArgs { final long newAxisMask; final long shrinkAxisMask; - private StridedSliceArgs(int[] begin, int[] end, int[] strides, long beginMask, long endMask, long ellipsisMask, - long newAxisMask, long shrinkAxisMask) { + private StridedSliceArgs( + int[] begin, + int[] end, + int[] strides, + long beginMask, + long endMask, + long ellipsisMask, + long newAxisMask, + long shrinkAxisMask) { this.begin = begin; this.end = end; this.strides = strides; @@ -83,7 +90,8 @@ static StridedSliceArgs mergeIndexes(Index[] indices) { end[i] = (int) idx.end(); if (end[i] != idx.end()) { - throw new IllegalArgumentException("Can't convert long end value to int for index " + idx + ": Out of bounds"); + throw new IllegalArgumentException( + "Can't convert long end value to int for index " + idx + ": Out of bounds"); } strides[i] = (int) idx.stride(); @@ -116,57 +124,66 @@ static StridedSliceArgs mergeIndexes(Index[] indices) { } } - return new StridedSliceArgs(begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); + return new StridedSliceArgs( + begin, end, strides, beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask); } /** * Return a strided slice from `input`. - *

    - * The goal of this op is to produce a new tensor with a subset of the elements from the `n` dimensional `input` - * tensor. The subset is chosen using a sequence of `m` sparse range specifications encoded into the arguments of this - * function. Note, in some cases `m` could be equal to `n`, but this need not be the case. Each range specification - * entry can be one of the following: - *

    - * - An ellipsis (...) using {@link Indices#ellipsis()}. Ellipses are used to imply zero or more dimensions of - * full-dimension selection. For example, {@code stridedSlice(foo, Indices.ellipsis()} is the identity slice. - *

    - * - A new axis using {@link Indices#newAxis()}. This is used to insert a new shape=1 dimension. - * For example, `{@code stridedSlice(foo, Indices.newAxis())} where {@code foo} is shape {@code (3, 4)} - * produces a {@code (1, 3, 4)} tensor. - *

    - * - A range {@code begin:end:stride} using {@link Indices#slice(Long, Long, long)} Index.slice()} or {@link Indices#all()}. This is used to specify - * how much to choose from a given dimension. {@code stride} can be any integer but 0. {@code begin} is an integer which - * represents the index of the first value to select while {@code end} represents the index of the last value to select - * (exclusive). Begin and end can be null, in which case the index begins or ends at the beginning or end of the dimension, - * respectively (reversed if stride is negative). When both are null, {@code slice()} is the same as {@code all()}. - * The number of values selected in each dimension is {@code end - begin} if {@code stride > 0} and {@code begin - end} - * if {@code stride < 0}. {@code begin} and {@code end} can be negative where {@code -1} is the last element, {@code -2} - * is the second to last. For example, given a shape {@code (3,)} tensor {@code stridedSlice(foo, Indices.all())}, the - * effective {@code begin} and {@code end} are {@code 0} and {@code 3}. Do not assume this is equivalent to - * {@code stridedSlice(foo, Indices.slice(0, -1))} which has an effective {@code begin} and {@code end} of {@code 0} and - * {@code 2}. Another example is {@code stridedSlice(foo, Indices.slice(-2, null, -1))} which reverses the first dimension - * of a tensor while dropping the last two (in the original order elements). For example {@code foo = [1,2,3,4]; - * stridedSlice(foo, Indices.slice(-2, null, -1)} is {@code [4,3]}. - *

    - * - A single index using {@link Indices#at(long)}. This is used to keep only elements that have a given index. For - * example ({@code stridedSlice(foo, Indices.at(2))} on a shape {@code (5,6)} tensor produces a shape {@code (6,)} tensor. - * The dimension can be kept with size one using {@link Indices#at(long, boolean)}. - *

    - * These semantics generally follow NumPy's indexing semantics, which can be found here: - * https://numpy.org/doc/stable/reference/arrays.indexing.html - *

    * - * Requirements: - * `0 != strides[i] for i in [0, m)` Only one ellipsis. + *

    The goal of this op is to produce a new tensor with a subset of the elements from the `n` + * dimensional `input` tensor. The subset is chosen using a sequence of `m` sparse range + * specifications encoded into the arguments of this function. Note, in some cases `m` could be + * equal to `n`, but this need not be the case. Each range specification entry can be one of the + * following: + * + *

    - An ellipsis (...) using {@link org.tensorflow.ndarray.index.Indices#ellipsis()}. Ellipses + * are used to imply zero or more dimensions of full-dimension selection. For example, {@code + * stridedSlice(foo, Indices.ellipsis()} is the identity slice. + * + *

    - A new axis using {@link org.tensorflow.ndarray.index.Indices#newAxis()}. This is used to + * insert a new shape=1 dimension. For example, `{@code stridedSlice(foo, Indices.newAxis())} + * where {@code foo} is shape {@code (3, 4)} produces a {@code (1, 3, 4)} tensor. + * + *

    - A range {@code begin:end:stride} using {@link + * org.tensorflow.ndarray.index.Indices#slice(Long, Long, long)} Index.slice()} or {@link + * org.tensorflow.ndarray.index.Indices#all()}. This is used to specify how much to choose from a + * given dimension. {@code stride} can be any integer but 0. {@code begin} is an integer which + * represents the index of the first value to select while {@code end} represents the index of the + * last value to select (exclusive). Begin and end can be null, in which case the index begins or + * ends at the beginning or end of the dimension, respectively (reversed if stride is negative). + * When both are null, {@code slice()} is the same as {@code all()}. The number of values selected + * in each dimension is {@code end - begin} if {@code stride > 0} and {@code begin - end} if + * {@code stride < 0}. {@code begin} and {@code end} can be negative where {@code -1} is the last + * element, {@code -2} is the second to last. For example, given a shape {@code (3,)} tensor + * {@code stridedSlice(foo, Indices.all())}, the effective {@code begin} and {@code end} are + * {@code 0} and {@code 3}. Do not assume this is equivalent to {@code stridedSlice(foo, + * Indices.slice(0, -1))} which has an effective {@code begin} and {@code end} of {@code 0} and + * {@code 2}. Another example is {@code stridedSlice(foo, Indices.slice(-2, null, -1))} which + * reverses the first dimension of a tensor while dropping the last two (in the original order + * elements). For example {@code foo = [1,2,3,4]; stridedSlice(foo, Indices.slice(-2, null, -1)} + * is {@code [4,3]}. + * + *

    - A single index using {@link org.tensorflow.ndarray.index.Indices#at(long)}. This is used + * to keep only elements that have a given index. For example ({@code stridedSlice(foo, + * Indices.at(2))} on a shape {@code (5,6)} tensor produces a shape {@code (6,)} tensor. The + * dimension can be kept with size one using {@link org.tensorflow.ndarray.index.Indices#at(long, + * boolean)}. + * + *

    These semantics generally follow NumPy's indexing semantics, which can be found here: https://numpy.org/doc/stable/reference/arrays.indexing.html + * + *

    Requirements: `0 != strides[i] for i in [0, m)` Only one ellipsis. * * @param scope current scope * @param data type for {@code output()} output - * @param indices The indices to slice. See {@link Indices}. + * @param indices The indices to slice. See {@link org.tensorflow.ndarray.index.Indices}. * @return a new instance of StridedSlice - * @see Indices + * @see org.tensorflow.ndarray.index.Indices */ @Endpoint(name = "stridedSlice") - public static StridedSlice stridedSlice(Scope scope, Operand input, Index... indices) { + public static StridedSlice stridedSlice( + Scope scope, Operand input, Index... indices) { StridedSliceArgs args = mergeIndexes(indices); return StridedSlice.create( scope, @@ -178,30 +195,31 @@ public static StridedSlice stridedSlice(Scope scope, Operan StridedSlice.endMask(args.endMask), StridedSlice.ellipsisMask(args.ellipsisMask), StridedSlice.newAxisMask(args.newAxisMask), - StridedSlice.shrinkAxisMask(args.shrinkAxisMask) - ); + StridedSlice.shrinkAxisMask(args.shrinkAxisMask)); } /** * Assign `value` to the sliced l-value reference of `ref`. - *

    - * The values of `value` are assigned to the positions in the variable `ref` that are selected by the slice - * parameters. The slice parameters `begin`, `end`, `strides`, etc. work exactly as in `StridedSlice`. - *

    - * NOTE this op currently does not support broadcasting and so `value`'s shape must be exactly the shape produced by - * the slice of `ref`. + * + *

    The values of `value` are assigned to the positions in the variable `ref` that are selected + * by the slice parameters. The slice parameters `begin`, `end`, `strides`, etc. work exactly as + * in `StridedSlice`. + * + *

    NOTE this op currently does not support broadcasting and so `value`'s shape must be exactly + * the shape produced by the slice of `ref`. * * @param data type for {@code outputRef()} output * @param scope current scope * @param ref the tensor to assign to. * @param value the value to assign. - * @param indices The indices to slice. See {@link Indices}. + * @param indices The indices to slice. See {@link org.tensorflow.ndarray.index.Indices}. * @return a new instance of StridedSliceAssign - * @see org.tensorflow.op.Ops#stridedSlice(Operand, Index...) + * @see org.tensorflow.op.Ops#stridedSlice(org.tensorflow.Operand, + * org.tensorflow.ndarray.index.Index...) */ @Endpoint(name = "stridedSliceAssign") - public static StridedSliceAssign stridedSliceAssign(Scope scope, Operand ref, - Operand value, Index... indices) { + public static StridedSliceAssign stridedSliceAssign( + Scope scope, Operand ref, Operand value, Index... indices) { StridedSliceArgs args = mergeIndexes(indices); return StridedSliceAssign.create( scope, @@ -214,8 +232,6 @@ public static StridedSliceAssign stridedSliceAssign(Scope s StridedSliceAssign.endMask(args.endMask), StridedSliceAssign.ellipsisMask(args.ellipsisMask), StridedSliceAssign.newAxisMask(args.newAxisMask), - StridedSliceAssign.shrinkAxisMask(args.shrinkAxisMask) - ); + StridedSliceAssign.shrinkAxisMask(args.shrinkAxisMask)); } - } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java index bb6f693a9c6..e2c48decec4 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java @@ -28,10 +28,13 @@ /** * An operator creating a constant initialized with zeros of the shape given by `dims`. - * + * *

    For example, the following expression + * *

    {@code tf.zeros(tf.constant(shape), TFloat32.class)}
    + * * is the equivalent of + * *
    {@code tf.fill(tf.constant(shape), tf.constant(0.0f))}
    * * @param constant type @@ -50,11 +53,12 @@ public final class Zeros implements Op, Operand { */ @Endpoint @SuppressWarnings("unchecked") - public static Zeros create(Scope scope, Operand dims, Class type) { + public static Zeros create( + Scope scope, Operand dims, Class type) { Scope zerosScope = scope.withSubScope("Zeros"); Operand zero; if (type == TString.class) { - zero = (Operand)Constant.scalarOf(zerosScope.withName("Zero"), ""); + zero = (Operand) Constant.scalarOf(zerosScope.withName("Zero"), ""); } else { zero = Cast.create(zerosScope.withName("Zero"), Constant.scalarOf(zerosScope, 0), type); } @@ -70,9 +74,9 @@ public Operation op() { public Output asOutput() { return fill.asOutput(); } - + private final Fill fill; - + private Zeros(Fill fill) { this.fill = fill; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/package-info.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/package-info.java index 983cda5260c..49cdef2a624 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/package-info.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/package-info.java @@ -16,10 +16,12 @@ /** * Defines classes to build, save, load and execute TensorFlow models. * - *

    WARNING: The API is currently experimental and is not covered by TensorFlow API stability guarantees. See README.md - * for installation instructions. + *

    API Stability: Since version 1.0.0, the TensorFlow Java API is covered by TensorFlow API stability guarantees. + * Please note that as this library is a wrapper for the TensorFlow C API, its stability is subject + * to the stability of the underlying upstream TensorFlow project. See the README.md for installation + * instructions. * *

    The LabelImage diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBfloat16.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBfloat16.java index ef20b5ec2b6..c511262e339 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBfloat16.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBfloat16.java @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TBfloat16Mapper; @@ -26,7 +27,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.FloatDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TFloating; @@ -40,7 +41,7 @@ *

    Since there is no floating-point type that fits in 16 bits in Java, a conversion (with * potentially a precision loss) is required for each 32 bits value written or read on a tensor of * this type from the JVM. Therefore, if a lot of I/O operations are to be expected on a tensor, - * performances will be improved by working with {@link TFloat32} or {@link TFloat64} data types + * performances will be improved by working with {@link TFloat32} or {@link TBfloat16} data types * whenever possible. * *

    Note that some CPUs support the bfloat16 format natively, which can result in faster @@ -69,7 +70,8 @@ static TBfloat16 vectorOf(float... values) { if (values == null) { throw new IllegalArgumentException(); } - return Tensor.of(TBfloat16.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); + return Tensor.of( + TBfloat16.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); } /** @@ -102,7 +104,7 @@ static TBfloat16 tensorOf(Shape shape) { * @return the new tensor */ static TBfloat16 tensorOf(Shape shape, FloatDataBuffer data) { - return Tensor.of(TBfloat16.class, shape, d -> d.write(data)); + return Tensor.of(TBfloat16.class, shape, d -> d.copyFrom(data)); } /** @@ -116,5 +118,28 @@ static TBfloat16 tensorOf(Shape shape, FloatDataBuffer data) { static TBfloat16 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TBfloat16.class, shape, dataInit); } -} + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18f, 3.8f]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18f}, and element {@code [2,4,0]} of the tensor has a value of {@code 3.8f}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TBfloat16 sparseTensorOf(TInt64 indices, TBfloat16 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java index 0158c12b910..eee01cd0892 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 The TensorFlow Authors. All Rights Reserved. + * Copyright 2019-2024 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. @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TBoolMapper; @@ -27,7 +28,7 @@ import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.BooleanDataBuffer; import org.tensorflow.ndarray.buffer.layout.DataLayouts; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TType; @@ -94,7 +95,7 @@ static TBool tensorOf(Shape shape) { * @return the new tensor */ static TBool tensorOf(Shape shape, BooleanDataBuffer data) { - return Tensor.of(TBool.class, shape, d -> d.write(data)); + return Tensor.of(TBool.class, shape, d -> d.copyFrom(data)); } /** @@ -108,4 +109,28 @@ static TBool tensorOf(Shape shape, BooleanDataBuffer data) { static TBool tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TBool.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of {@code false}. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[true, true]} specifies that element {@code [1,3,1]} and element {@code [2,4,0]} of + * the tensor have a value of {@code true}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TBool sparseTensorOf(TInt64 indices, TBool values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat16.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat16.java index a43a0831f10..8b590b58339 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat16.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat16.java @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TFloat16Mapper; @@ -26,7 +27,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.FloatDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TFloating; @@ -36,7 +37,7 @@ *

    Since there is no floating-point type that fits in 16 bits in Java, a conversion (with * potentially a precision loss) is required for each 32 bits value written or read on a tensor of * this type from the JVM. Therefore, if a lot of I/O operations are to be expected on a tensor, - * performances will be improved by working with {@link TFloat32} or {@link TFloat64} data types + * performances will be improved by working with {@link TFloat32} or {@link TFloat16} data types * whenever possible. * *

    Also, {@code TFloat16} tensors normally perform better if they are located in GPU memory since @@ -66,7 +67,8 @@ static TFloat16 vectorOf(float... values) { if (values == null) { throw new IllegalArgumentException(); } - return Tensor.of(TFloat16.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); + return Tensor.of( + TFloat16.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); } /** @@ -99,7 +101,7 @@ static TFloat16 tensorOf(Shape shape) { * @return the new tensor */ static TFloat16 tensorOf(Shape shape, FloatDataBuffer data) { - return Tensor.of(TFloat16.class, shape, d -> d.write(data)); + return Tensor.of(TFloat16.class, shape, d -> d.copyFrom(data)); } /** @@ -113,4 +115,28 @@ static TFloat16 tensorOf(Shape shape, FloatDataBuffer data) { static TFloat16 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TFloat16.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18f, 3.8f]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18f}, and element {@code [2,4,0]} of the tensor has a value of {@code 3.8f}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TFloat16 sparseTensorOf(TInt64 indices, TFloat16 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat32.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat32.java index 35208f7de43..8b1bdf13639 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat32.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat32.java @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TFloat32Mapper; @@ -26,7 +27,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.FloatDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TFloating; @@ -54,7 +55,8 @@ static TFloat32 vectorOf(float... values) { if (values == null) { throw new IllegalArgumentException(); } - return Tensor.of(TFloat32.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); + return Tensor.of( + TFloat32.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); } /** @@ -87,7 +89,7 @@ static TFloat32 tensorOf(Shape shape) { * @return the new tensor */ static TFloat32 tensorOf(Shape shape, FloatDataBuffer data) { - return Tensor.of(TFloat32.class, shape, d -> d.write(data)); + return Tensor.of(TFloat32.class, shape, d -> d.copyFrom(data)); } /** @@ -101,4 +103,28 @@ static TFloat32 tensorOf(Shape shape, FloatDataBuffer data) { static TFloat32 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TFloat32.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18f, 3.8f]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18f}, and element {@code [2,4,0]} of the tensor has a value of {@code 3.8f}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TFloat32 sparseTensorOf(TInt64 indices, TFloat32 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat64.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat64.java index 957612691e5..f76323d06d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat64.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat64.java @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TFloat64Mapper; @@ -26,11 +27,10 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.DoubleDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TFloating; - /** IEEE-754 double-precision 64-bit float tensor type. */ @TensorType(dataType = DataType.DT_DOUBLE, byteSize = 8, mapperClass = TFloat64Mapper.class) public interface TFloat64 extends DoubleNdArray, TFloating { @@ -55,7 +55,8 @@ static TFloat64 vectorOf(double... values) { if (values == null) { throw new IllegalArgumentException(); } - return Tensor.of(TFloat64.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); + return Tensor.of( + TFloat64.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); } /** @@ -88,7 +89,7 @@ static TFloat64 tensorOf(Shape shape) { * @return the new tensor */ static TFloat64 tensorOf(Shape shape, DoubleDataBuffer data) { - return Tensor.of(TFloat64.class, shape, d -> d.write(data)); + return Tensor.of(TFloat64.class, shape, d -> d.copyFrom(data)); } /** @@ -102,4 +103,28 @@ static TFloat64 tensorOf(Shape shape, DoubleDataBuffer data) { static TFloat64 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TFloat64.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3.8]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18}, and element {@code [2,4,0]} of the tensor has a value of {@code 3.8}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TFloat64 sparseTensorOf(TInt64 indices, TFloat64 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java index 8f6b587795b..d2fb4814a24 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.internal.types.TInt32Mapper; import org.tensorflow.ndarray.IntNdArray; @@ -25,7 +26,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.IntDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TIntegral; @@ -87,7 +88,7 @@ static TInt32 tensorOf(Shape shape) { * @return the new tensor */ static TInt32 tensorOf(Shape shape, IntDataBuffer data) { - return Tensor.of(TInt32.class, shape, d -> d.write(data)); + return Tensor.of(TInt32.class, shape, d -> d.copyFrom(data)); } /** @@ -100,5 +101,28 @@ static TInt32 tensorOf(Shape shape, IntDataBuffer data) { static TInt32 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TInt32.class, shape, dataInit); } -} + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse tensor has a value of + * {@code 18}, and element {@code [2,4,0]} of the tensor has a value of {@code 3}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TInt32 sparseTensorOf(TInt64 indices, TInt32 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java index 867248c5392..57741e22641 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 The TensorFlow Authors. All Rights Reserved. + * Copyright 2019-2024 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. @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TInt64Mapper; @@ -26,7 +27,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.LongDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TIntegral; @@ -87,7 +88,7 @@ static TInt64 tensorOf(Shape shape) { * @return the new tensor */ static TInt64 tensorOf(Shape shape, LongDataBuffer data) { - return Tensor.of(TInt64.class, shape, d -> d.write(data)); + return Tensor.of(TInt64.class, shape, d -> d.copyFrom(data)); } /** @@ -101,4 +102,28 @@ static TInt64 tensorOf(Shape shape, LongDataBuffer data) { static TInt64 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TInt64.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18L, 3L]} specifies that element {@code [1,3,1]} of the sparse tensor has a value + * of {@code 18L}, and element {@code [2,4,0]} of the tensor has a value of {@code 3L}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TInt64 sparseTensorOf(TInt64 indices, TInt64 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java index b3000cc2f8a..14b438fbe76 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 The TensorFlow Authors. All Rights Reserved. + * Copyright 2019-2024 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. @@ -20,6 +20,7 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.function.Function; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.internal.types.TStringInitializer; import org.tensorflow.internal.types.TStringMapper; @@ -27,7 +28,7 @@ import org.tensorflow.ndarray.NdArrays; import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.buffer.DataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TType; @@ -105,7 +106,8 @@ static TString tensorOf(NdArray src) { * @return the new tensor */ static TString tensorOf(Charset charset, NdArray src) { - TStringInitializer initializer = new TStringInitializer<>(src, s -> s.getBytes(charset)); + TStringInitializer initializer = + new TStringInitializer<>(src, s -> s.getBytes(charset)); return Tensor.of(TString.class, src.shape(), initializer.computeRequiredSize(), initializer); } @@ -129,8 +131,8 @@ static TString tensorOf(Shape shape, DataBuffer data) { *

    The data will be copied from the provided buffer to the tensor after it is allocated. The * strings are encoded into bytes using the charset passed in parameter. * - *

    If charset is different than default UTF-8, then it must also be provided explicitly when - * reading data from the tensor, using {@link #using(Charset)}: + *

    If charset is different from the default UTF-8, then it must also be provided explicitly + * when reading data from the tensor, using {@link #using(Charset)}: * *

    {@code
        * // Given `originalStrings` an initialized buffer of strings
    @@ -190,6 +192,31 @@ static TString tensorOfBytes(Shape shape, DataBuffer data) {
         return tensorOfBytes(NdArrays.wrap(shape, data));
       }
     
    +  /**
    +   * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense
    +   * tensors, with an empty string as the default value.
    +   *
    +   * 

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=["one", "two"]} specifies that element {@code [1,3,1]} of the sparse tensor has a + * value of {@code "one"}, and element {@code [2,4,0]} of the tensor has a value of {@code + * "two"}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TString sparseTensorOf(TInt64 indices, TString values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } + /** * Use a specific charset for decoding data from a string tensor, instead of the default UTF-8. * @@ -208,6 +235,8 @@ static TString tensorOfBytes(Shape shape, DataBuffer data) { */ TString using(Charset charset); - /** @return the tensor data as a n-dimensional array of raw byte sequences. */ + /** + * @return the tensor data as a n-dimensional array of raw byte sequences. + */ NdArray asBytes(); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint16.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint16.java new file mode 100644 index 00000000000..313df5f6ea1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint16.java @@ -0,0 +1,130 @@ +/* + * Copyright 2022-2024 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. + * ======================================================================= + */ + +package org.tensorflow.types; + +import java.util.function.Consumer; +import org.tensorflow.SparseTensor; +import org.tensorflow.Tensor; +import org.tensorflow.exceptions.TensorFlowException; +import org.tensorflow.internal.types.TUint16Mapper; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.annotation.TensorType; +import org.tensorflow.types.family.TIntegral; + +/** 16-bit unsigned integer tensor type. */ +@TensorType(dataType = DataType.DT_UINT16, byteSize = 2, mapperClass = TUint16Mapper.class) +public interface TUint16 extends ShortNdArray, TIntegral { + + /** + * Allocates a new tensor for storing a single short value. + * + * @param value short to store in the new tensor + * @return the new tensor + */ + static TUint16 scalarOf(short value) { + return Tensor.of(TUint16.class, Shape.scalar(), data -> data.setShort(value)); + } + + /** + * Allocates a new tensor for storing a vector of shorts. + * + * @param values short to store in the new tensor + * @return the new tensor + */ + static TUint16 vectorOf(short... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return Tensor.of( + TUint16.class, Shape.of(values.length), data -> StdArrays.copyTo(values, data)); + } + + /** + * Allocates a new tensor which is a copy of a given array of shorts. + * + *

    The tensor will have the same shape as the source array and its data will be copied. + * + * @param src the source array giving the shape and data to the new tensor + * @return the new tensor + */ + static TUint16 tensorOf(NdArray src) { + return Tensor.of(TUint16.class, src.shape(), src::copyTo); + } + + /** + * Allocates a new tensor of the given shape. + * + * @param shape shape of the tensor to allocate + * @return the new tensor + */ + static TUint16 tensorOf(Shape shape) { + return Tensor.of(TUint16.class, shape); + } + + /** + * Allocates a new tensor of the given shape, initialized with the provided data. + * + * @param shape shape of the tensor to allocate + * @param data buffer of shorts to initialize the tensor with + * @return the new tensor + */ + static TUint16 tensorOf(Shape shape, ShortDataBuffer data) { + return Tensor.of(TUint16.class, shape, d -> d.copyFrom(data)); + } + + /** + * Allocates a new tensor of the given shape and initialize its data. + * + * @param shape shape of the tensor to allocate + * @param dataInit tensor data initializer + * @return the new tensor + * @throws TensorFlowException if the tensor cannot be allocated or initialized + */ + static TUint16 tensorOf(Shape shape, Consumer dataInit) { + return Tensor.of(TUint16.class, shape, dataInit); + } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse tensor has a value of + * {@code 18}, and element {@code [2,4,0]} of the tensor has a value of {@code 3}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TUint16 sparseTensorOf(TInt64 indices, TUint16 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint8.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint8.java index eae86414cb4..ff9d31a6fd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint8.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUint8.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 The TensorFlow Authors. All Rights Reserved. + * Copyright 2019-2024 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. @@ -18,6 +18,7 @@ package org.tensorflow.types; import java.util.function.Consumer; +import org.tensorflow.SparseTensor; import org.tensorflow.Tensor; import org.tensorflow.exceptions.TensorFlowException; import org.tensorflow.internal.types.TUint8Mapper; @@ -26,7 +27,7 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.ByteDataBuffer; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.annotation.TensorType; import org.tensorflow.types.family.TIntegral; @@ -87,7 +88,7 @@ static TUint8 tensorOf(Shape shape) { * @return the new tensor */ static TUint8 tensorOf(Shape shape, ByteDataBuffer data) { - return Tensor.of(TUint8.class, shape, d -> d.write(data)); + return Tensor.of(TUint8.class, shape, d -> d.copyFrom(data)); } /** @@ -101,4 +102,28 @@ static TUint8 tensorOf(Shape shape, ByteDataBuffer data) { static TUint8 tensorOf(Shape shape, Consumer dataInit) { return Tensor.of(TUint8.class, shape, dataInit); } + + /** + * Create a sparse tensor from {@code indices}, {@code values} and {@code denseShape} dense + * tensors, with a default value of zero. + * + *

    The returned instance also implements the {@link SparseTensor} interface, allowing a user to + * access directly the dense tensors when needed. + * + * @param indices A 2-D tensor of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse tensor that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D tensor of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse tensor has a value of + * {@code 18}, and element {@code [2,4,0]} of the tensor has a value of {@code 3}. + * @param denseShape A 1-D tensor of shape {@code [ndims]} where each the value at index {@code i} + * represents the size of dimension {@code i} in a dense version of that tensor. + * @return the new sparse tensor + * @see SparseTensor for more details on sparse tensors and how to release their memory properly + */ + static TUint8 sparseTensorOf(TInt64 indices, TUint8 values, TInt64 denseShape) { + return SparseTensor.of(indices, values, denseShape).asTypedTensor(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/annotation/TensorType.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/annotation/TensorType.java index 78ab5d7a8b6..c6579eb66aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/annotation/TensorType.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/annotation/TensorType.java @@ -22,32 +22,29 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.tensorflow.TensorMapper; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; /** * Annotation for all tensor types. * *

    Any interface extending {@link org.tensorflow.types.family.TType TType} to be registered as a - * tensor type must be annotated with {@code @TensorType} to provide metadata required for allocating - * and mapping tensors of this type.

    + * tensor type must be annotated with {@code @TensorType} to provide metadata required for + * allocating and mapping tensors of this type. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface TensorType { - /** - * The data type of each elements in a tensor of this type - */ + /** The data type of each elements in a tensor of this type */ DataType dataType(); /** - * The number of bytes required one element of a tensor of type, -1 for variable-length element tensors + * The number of bytes required one element of a tensor of type, -1 for variable-length element + * tensors */ int byteSize(); - /** - * The class of the {@link TensorMapper} to allocate and use for mapping tensors of this type - */ + /** The class of the {@link TensorMapper} to allocate and use for mapping tensors of this type */ Class> mapperClass(); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TFloating.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TFloating.java index bba2e5983f5..e3e520a94f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TFloating.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TFloating.java @@ -19,8 +19,8 @@ /** * Common interface for all floating point tensors. * - *

    Operations that only accepts floating point values as some of their operands enforce that the tensor - * types for these operands to be bound to this interface. For example: + *

    Operations that only accepts floating point values as some of their operands enforce that the + * tensor types for these operands to be bound to this interface. For example: * *

    {@code
      * Ops tf = Ops.create();
    diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java
    index 9349fbb59ea..b5b3126bf74 100644
    --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java
    +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java
    @@ -18,17 +18,16 @@
     package org.tensorflow.types.family;
     
     import org.tensorflow.Tensor;
    -import org.tensorflow.proto.framework.DataType;
     
     /**
      * Common interface for all typed tensors.
      *
      * 

    Typed tensors wrap a {@link org.tensorflow.RawTensor RawTensor} by mapping their native memory - * to a n-dimensional data space allowing direct I/O access from the JVM.

    + * to a n-dimensional data space allowing direct I/O access from the JVM. * *

    Subinterfaces of {@code TType} are propagated as a generic parameter to various entities of - * TensorFlow to identify the type of the tensor they carry. For example, a - * {@link org.tensorflow.Operand Operand<TFloat32>} is an operand which outputs a 32-bit floating + * TensorFlow to identify the type of the tensor they carry. For example, a {@link + * org.tensorflow.Operand Operand<TFloat32>} is an operand which outputs a 32-bit floating * point tensor. This parameter ensure type-compatibility between operands of a computation at * compile-time. For example: * @@ -43,41 +42,24 @@ * tf.math.add(c1, c3); // Compilation failure * }

    * - *

    Even if all typed tensors implements somehow {@link org.tensorflow.ndarray.NdArray NdArray} - * to provide access to their data, {@code TType} deliberately does not extend directly from this + *

    Even if all typed tensors implements somehow {@link org.tensorflow.ndarray.NdArray NdArray} to + * provide access to their data, {@code TType} deliberately does not extend directly from this * interface, for the following reasons: + * *

      *
    • Implementing {@code NdArray} at this level could only expose boxed-type accessors, which - * are less performant than their primitive equivalent, only exposed by subinterfaces of - * {@code NdArray} (e.g. {@code FloatNdArray}). - *
    • + * are less performant than their primitive equivalent, only exposed by subinterfaces of + * {@code NdArray} (e.g. {@code FloatNdArray}). *
    • {@code TType} would need to carry a new generic parameter for typing the {@code NdArray}, - * which will increase the verbosity in the signature of any method accepting or returning - * an instance of this interface, which is very common. - *
    • + * which will increase the verbosity in the signature of any method accepting or returning an + * instance of this interface, which is very common. *
    - * Therefore, enforcing the user to cast a reference of {@code TType} in a concrete tensor type before - * accessing its data guarantees better performance and improves readability. + * + * Therefore, enforcing the user to cast a reference of {@code TType} in a concrete tensor type + * before accessing its data guarantees better performance and improves readability. */ public interface TType extends Tensor { - /** - * Returns the type of this tensor as a registered subclass of {@code TType} - */ + /** Returns the type of this tensor as a registered subclass of {@code TType} */ Class type(); - - @Override - default DataType dataType() { - return asRawTensor().dataType(); - } - - @Override - default long numBytes() { - return asRawTensor().numBytes(); - } - - @Override - default void close() { - asRawTensor().close(); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/package-info.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/package-info.java index fcf1f554133..8fbe9d17477 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/package-info.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/package-info.java @@ -18,9 +18,9 @@ /** * Interfaces used to group tensor types in families that define a particular domain of data. * - *

    Some operations enforces that only operands of a type from a given family can be passed - * in argument. For example, if an operation only allows numeric operands, such operands must be - * bound to the {@link org.tensorflow.types.family.TNumber TNumber} interface. + *

    Some operations enforces that only operands of a type from a given family can be passed in + * argument. For example, if an operation only allows numeric operands, such operands must be bound + * to the {@link org.tensorflow.types.family.TNumber TNumber} interface. * *

    All tensor types is bound to {@link org.tensorflow.types.family.TType TType}, which lays at * the root of the family hierarchy. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/package-info.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/package-info.java index 746ae703694..2bb4c79a22f 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/package-info.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/package-info.java @@ -18,24 +18,25 @@ /** * Defines classes that represent TensorFlow tensor types. For each possible data type that can be * used in a tensor, there is a corresponding interface that is used to represent it and its hidden - * implementation. For example, the TensorFlow int32 type is represented by the tensor type interface - * {@link org.tensorflow.types.TInt32 TInt32}, where the {@code T} prefix stands for "Tensor of". + * implementation. For example, the TensorFlow int32 type is represented by the tensor type + * interface {@link org.tensorflow.types.TInt32 TInt32}, where the {@code T} prefix stands for + * "Tensor of". * - *

    To support compile-time checking of tensor element types, each interface in this package must be - * bound to one of the marker interface found in {@link org.tensorflow.types.family}, according + *

    To support compile-time checking of tensor element types, each interface in this package must + * be bound to one of the marker interface found in {@link org.tensorflow.types.family}, according * to the nature of the data. * *

    Each tensor type must be annotated with {@link org.tensorflow.types.annotation.TensorType} to * provide type metadata that should be used for allocating or mapping tensors of this type. * - *

    Instances of tensor types must also implement the {@link org.tensorflow.ndarray.NdArray NdArray} - * interface so a user can access directly the tensor data in a n-dimensional space. + *

    Instances of tensor types must also implement the {@link org.tensorflow.ndarray.NdArray + * NdArray} interface so a user can access directly the tensor data in a n-dimensional space. * - *

    Note that while it is always possible to allocate a tensor using the - * {@link org.tensorflow.Tensor#of(Class, Shape) Tensor.of(...)} - * method, most tensor types expose factory methods that simplify the creation process, like - * {@code scalarOf(...)}, {@code vectorOf(...)}, {@code tensorOf(...)}, etc. + *

    Note that while it is always possible to allocate a tensor using the {@link + * org.tensorflow.Tensor#of(Class, Shape) Tensor.of(...)} method, most tensor types expose factory + * methods that simplify the creation process, like {@code scalarOf(...)}, {@code vectorOf(...)}, + * {@code tensorOf(...)}, etc. */ package org.tensorflow.types; -import org.tensorflow.ndarray.Shape; \ No newline at end of file +import org.tensorflow.ndarray.Shape; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/AutoCloseableList.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/AutoCloseableList.java deleted file mode 100644 index 330a40bae6b..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/AutoCloseableList.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.tensorflow; - -import java.util.ArrayList; -import java.util.Collection; - -public final class AutoCloseableList extends ArrayList - implements AutoCloseable { - - public AutoCloseableList(Collection c) { - super(c); - } - - @Override - public void close() { - Exception toThrow = null; - for (AutoCloseable c : this) { - try { - c.close(); - } catch (Exception e) { - toThrow = e; - } - } - if (toThrow != null) { - throw new RuntimeException(toThrow); - } - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ConcreteFunctionTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ConcreteFunctionTest.java index 250ff9cc383..0dc3101e80a 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ConcreteFunctionTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ConcreteFunctionTest.java @@ -26,7 +26,7 @@ import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.math.Add; import org.tensorflow.op.math.Sub; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -162,9 +162,9 @@ public void testFunctionWithTwoOutputs() { Map inputs = new HashMap<>(); inputs.put("x", TInt32.scalarOf(2)); - Map outputs = cf.call(inputs); - assertEquals(4, ((TInt32) outputs.get("dbl")).getInt()); - assertEquals(6, ((TInt32) outputs.get("trpl")).getInt()); + Result outputs = cf.call(inputs); + assertEquals(4, ((TInt32) outputs.get("dbl").get()).getInt()); + assertEquals(6, ((TInt32) outputs.get("trpl").get()).getInt()); } private static Signature square(Ops tf) { @@ -205,15 +205,14 @@ public void testGradientsGraph() { try (TFloat32 c1 = TFloat32.scalarOf(3.0f); TFloat32 c2 = TFloat32.scalarOf(2.0f); - AutoCloseableList outputs = - new AutoCloseableList<>( - s.runner() - .feed(x1, c1) - .feed(x2, c2) - .fetch(grads0[0]) - .fetch(grads1[0]) - .fetch(grads1[1]) - .run())) { + Result outputs = + s.runner() + .feed(x1, c1) + .feed(x2, c2) + .fetch(grads0[0]) + .fetch(grads1[0]) + .fetch(grads1[1]) + .run()) { assertEquals(3, outputs.size()); assertEquals(108.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientRegistryCapacityTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientRegistryCapacityTest.java new file mode 100644 index 00000000000..3df4cba96d8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientRegistryCapacityTest.java @@ -0,0 +1,102 @@ +/* + Copyright 2026 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. +============================================================================== +*/ +package org.tensorflow; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.tensorflow.internal.c_api.TF_Buffer; +import org.tensorflow.internal.c_api.global.tensorflow; +import org.tensorflow.proto.OpDef; +import org.tensorflow.proto.OpList; + +/** + * Regression test for PR #632: Registering >10 custom gradients must work; all registered opTypes + * must be present in the native gradient registry (TensorFlow.hasGradient(opType) becomes true). + */ +public class CustomGradientRegistryCapacityTest { + + private static List listAllOpTypes() { + TF_Buffer buf = tensorflow.TF_GetAllOpList(); + try { + OpList opList = OpList.parseFrom(buf.dataAsByteBuffer()); + List names = new ArrayList<>(opList.getOpCount()); + for (OpDef op : opList.getOpList()) { + names.add(op.getName()); + } + Collections.sort(names); + return names; + } catch (Exception e) { + throw new RuntimeException("Failed to parse TF_GetAllOpList()", e); + } + } + + @Test + public void registerMoreThanTenGradients_thenHasGradientIsTrue() { + + // 1) Discover op types that currently have NO gradient registered. + List ops = listAllOpTypes(); + + List noGrad = new ArrayList<>(); + for (String opType : ops) { + if (!TensorFlow.hasGradient(opType)) { + // Avoid internal/private ops to reduce risk of weirdness (optional) + if (!opType.startsWith("_")) { + noGrad.add(opType); + } + } + } + + // 2) Pick 11 opTypes (stable order: alphabetical). + // We intentionally pick from "noGrad" so the test is meaningful: + // before: hasGradient=false, after register: true. + assertTrue(noGrad.size() >= 11, "Need at least 11 ops with no gradient in this runtime."); + + List selected = noGrad.subList(0, 11); + + // 3) Before: ensure hasGradient is false + for (String opType : selected) { + assertFalse( + TensorFlow.hasGradient(opType), + "Precondition failed: expected no gradient for " + opType); + } + + // 4) Register 11 custom gradients (simple zerosLike per input) + for (String opType : selected) { + TensorFlow.registerCustomGradient( + opType, + (tf, op, gradInputs) -> { + int n = op.numInputs(); + ArrayList> grads = new ArrayList<>(n); + for (int i = 0; i < n; i++) { + grads.add(tf.zerosLike(op.input(i))); + } + return grads; + }); + } + + // 5) After: ensure hasGradient is true for all + for (String opType : selected) { + assertTrue( + TensorFlow.hasGradient(opType), "Expected gradient to be registered for " + opType); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientTest.java new file mode 100644 index 00000000000..81e401dbccc --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientTest.java @@ -0,0 +1,127 @@ +/* + Copyright 2024 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. +============================================================================== +*/ +package org.tensorflow; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; +import org.tensorflow.ndarray.index.Indices; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Merge; +import org.tensorflow.op.dtypes.Cast; +import org.tensorflow.op.nn.NthElement; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TFloat32; + +// FIXME: Since TF 2.10.1, custom gradient registration is failing on Windows, see +// https://github.com/tensorflow/java/issues/486 +public class CustomGradientTest { + + @EnabledOnOs(OS.WINDOWS) + @Test + public void customGradientRegistrationUnsupportedOnWindows() { + assertThrows( + UnsupportedOperationException.class, + () -> + TensorFlow.registerCustomGradient( + NthElement.OP_NAME, + (tf, op, gradInputs) -> + Arrays.asList(tf.withName("inAGrad").constant(0f), tf.constant(0f)))); + + assertThrows( + UnsupportedOperationException.class, + () -> + TensorFlow.registerCustomGradient( + NthElement.Inputs.class, + (tf, op, gradInputs) -> + Arrays.asList(tf.withName("inAGrad").constant(0f), tf.constant(0f)))); + } + + @DisabledOnOs(OS.WINDOWS) + @Test + public void testAlreadyExisting() { + assertFalse( + TensorFlow.registerCustomGradient( + Cast.Inputs.class, + (tf, op, gradInputs) -> { + Operand out = gradInputs.get(0); + Operand a = tf.stridedSlice(out, Indices.slice(0, 1)); + Operand b = tf.stridedSlice(out, Indices.slice(1, 2)); + return Arrays.asList(a, b, tf.constant(0f)); + })); + } + + @DisabledOnOs(OS.WINDOWS) + @Test + public void testCustomGradient() { + try (Graph g = new Graph(); + Session s = new Session(g)) { + assertFalse(TensorFlow.hasGradient("NthElement")); + assertTrue( + TensorFlow.registerCustomGradient( + NthElement.Inputs.class, + (tf, op, gradInputs) -> + Arrays.asList(tf.withName("inAGrad").constant(0f), tf.constant(0f)))); + + Ops tf = Ops.create(g); + Output x = tf.placeholder(TFloat32.class).output(); + Output y = + tf.math.add(tf.nn.nthElement(x, tf.constant(2)), tf.constant(4f)).asOutput(); + + Output[] grads0 = g.addGradients(y, toArray(x)); + assertNotNull(grads0); + assertEquals(1, grads0.length); + assertEquals(DataType.DT_FLOAT, grads0[0].dataType()); + + try (TFloat32 c1 = TFloat32.vectorOf(3.0f, 2.0f, 1.0f, 0.0f); + Result outputs = s.runner().feed(x, c1).fetch(grads0[0]).run()) { + + assertEquals(1, outputs.size()); + assertEquals(0.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); + } + } + } + + @DisabledOnOs(OS.WINDOWS) + @Test + public void applyGradientOnMultipleNodesOfSameOpType() { + try (Graph g = new Graph()) { + assertTrue( + TensorFlow.registerCustomGradient( + Merge.Inputs.class, + (tf, op, gradInputs) -> + gradInputs.stream().map(i -> tf.constant(-10)).collect(Collectors.toList()))); + var tf = Ops.create(g); + var initialValue = tf.constant(10); + var merge1 = tf.merge(List.of(initialValue, tf.constant(20))); + var merge2 = tf.merge(List.of(merge1.output(), tf.constant(30))); + + // Just make sure that it won't throw + g.addGradients(merge2.output(), toArray(initialValue.asOutput())); + } + } + + private static Output[] toArray(Output... outputs) { + return outputs; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientsTest.java new file mode 100644 index 00000000000..c1d528c8a20 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/CustomGradientsTest.java @@ -0,0 +1,140 @@ +/* + Copyright 2026 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. +============================================================================== +*/ +package org.tensorflow; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.OS; +import org.tensorflow.op.CustomGradient; +import org.tensorflow.op.Ops; +import org.tensorflow.op.RawCustomGradient; +import org.tensorflow.op.nn.SparseSoftmaxCrossEntropyWithLogits; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt32; + +@DisabledOnOs(OS.WINDOWS) +public class CustomGradientsTest { + + @Test + public void noGradientNullIsSupported() { + // Register a custom gradient for an op that has NO native gradient in TF core. + CustomGradient grad = + (tf, op, gradInputs) -> { + @SuppressWarnings("unchecked") + Operand gLoss = (Operand) gradInputs.get(0); // [B] + + @SuppressWarnings("unchecked") + Operand logits = op.features; + + SparseSoftmaxCrossEntropyWithLogits xent = + SparseSoftmaxCrossEntropyWithLogits.create(tf.scope(), logits, op.labels); + + Operand backprop = xent.backprop(); // [B,C] + Operand gLossE = tf.expandDims(gLoss, tf.constant(1)); // [B,1] + Operand dLogits = tf.math.mul(gLossE, backprop); // [B,C] + + // labels: NoGradient + return java.util.Arrays.asList(dLogits, null); + }; + + assertTrue( + TensorFlow.registerCustomGradient(SparseSoftmaxCrossEntropyWithLogits.Inputs.class, grad)); + + try (Graph g = new Graph()) { + Ops tf = Ops.create(g); + + // Small fixed shapes to be able to create an explicit seed (avoid OnesLike in addGradients). + Operand logits = tf.constant(new float[][] {{1f, 2f, 3f}, {3f, 2f, 1f}}); + Operand labels = tf.constant(new int[] {2, 0}); + + SparseSoftmaxCrossEntropyWithLogits xent = + SparseSoftmaxCrossEntropyWithLogits.create(tf.scope(), logits, labels); + + Output loss = xent.loss(); // [2] + Operand seed = tf.constant(new float[] {1f, 1f}); // same shape as loss + + Output[] grads = + g.addGradients( + "seed", + new Output[] {loss}, + new Output[] {logits.asOutput(), labels.asOutput()}, + new Output[] {seed.asOutput()}); + + // logits grad exists, labels grad must be "NoGradient" (represented as a CLOSED Output) + assertNotNull(grads); + assertEquals(2, grads.length); + assertNotNull(grads[0], "Expected gradient for logits"); + assertNotNull(grads[1], "Expected an Output placeholder for labels gradient"); + assertTrue(grads[1].isClosed(), "Expected closed gradient (NoGradient) for labels"); + } + } + + @Test + public void sigmoidGradHasCustomGradientWithoutOnesLikeSeed() { + // Register custom gradient for SigmoidGrad (if already registered, it will return false, + // but the test can still pass because the gradient exists in the current process). + TensorFlow.registerCustomGradient( + "SigmoidGrad", + (RawCustomGradient) + (tf, op, gradInputs) -> { + @SuppressWarnings("unchecked") + Operand y = (Operand) op.input(0); // sigmoid(x) + @SuppressWarnings("unchecked") + Operand dy = (Operand) op.input(1); // upstream into SigmoidGrad + @SuppressWarnings("unchecked") + Operand upstream = (Operand) gradInputs.get(0); + + Operand one = tf.constant(1.0f); + Operand yTimesOneMinusY = tf.math.mul(y, tf.math.sub(one, y)); + + // dL/d(dy) = upstream * y*(1-y) + Operand dDy = tf.math.mul(upstream, yTimesOneMinusY); + + // dL/d(y) not needed for this test; return zeros to keep it non-null. + Operand dY = tf.zerosLike(y); + + return java.util.Arrays.asList(dY, dDy); + }); + + try (Graph g = new Graph()) { + Ops tf = Ops.create(g); + + Operand x = tf.placeholder(TFloat32.class); + Operand y = tf.math.sigmoid(x); + + // Provide an explicit seed dy to avoid Graph.addGradients defaulting to OnesLike(y) + Operand seed = tf.fill(tf.shape(y), tf.constant(1.0f)); + + Output[] grads = + g.addGradients( + "seed", + new Output[] {y.asOutput()}, + new Output[] {x.asOutput()}, + new Output[] {seed.asOutput()}); + + assertNotNull(grads); + assertEquals(1, grads.length); + assertNotNull(grads[0], "Expected a non-null gradient for sigmoid(x) wrt x."); + assertFalse(grads[0].isClosed(), "Expected an active Output for d(sigmoid)/dx."); + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/DeviceSpecTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/DeviceSpecTest.java index e4340da3275..f3d8037a19c 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/DeviceSpecTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/DeviceSpecTest.java @@ -14,99 +14,99 @@ ==============================================================================*/ package org.tensorflow; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import static org.tensorflow.DeviceSpec.DeviceType; + import org.junit.jupiter.api.Test; import org.tensorflow.exceptions.TFInvalidArgumentException; import org.tensorflow.op.Ops; import org.tensorflow.op.core.Constant; -import org.tensorflow.proto.framework.ConfigProto; +import org.tensorflow.proto.ConfigProto; import org.tensorflow.types.TInt32; -import static com.google.common.truth.Truth.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; -import static org.tensorflow.DeviceSpec.DeviceType; - /** Tests for {@link DeviceSpec}. */ public class DeviceSpecTest { @Test public void withDeviceMethod() { - ConfigProto config = ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) + ConfigProto config = + ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) .setLogDevicePlacement(true) .build(); - try (Graph g = new Graph(); Session session = new Session(g, config)) { + try (Graph g = new Graph(); + Session session = new Session(g, config)) { Ops tf = Ops.create(g).withSubScope("testScope"); Constant aOps = tf.constant(-1); - DeviceSpec deviceSpec = DeviceSpec.newBuilder() + DeviceSpec deviceSpec = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) .deviceType(DeviceSpec.DeviceType.CPU) .build(); - Output absOps = tf - .withName("absWithDevice") - .withDevice(deviceSpec) - .math - .abs(aOps) - .asOutput(); + Output absOps = + tf.withName("absWithDevice").withDevice(deviceSpec).math.abs(aOps).asOutput(); - try (AutoCloseableList t = - new AutoCloseableList<>(session.runner().fetch(absOps).run())) { - assertEquals(1, ((TInt32)t.get(0)).getInt()); + try (Result t = session.runner().fetch(absOps).run()) { + assertEquals(1, ((TInt32) t.get(0)).getInt()); } } } @Test public void withEmptyDeviceSpec() { - ConfigProto config = ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) + ConfigProto config = + ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) .setLogDevicePlacement(true) .build(); - try (Graph g = new Graph(); Session session = new Session(g, config)) { + try (Graph g = new Graph(); + Session session = new Session(g, config)) { Ops tf = Ops.create(g).withSubScope("testScope"); Constant aOps = tf.constant(-1); - DeviceSpec deviceSpec = DeviceSpec.newBuilder() + DeviceSpec deviceSpec = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) .deviceType(DeviceSpec.DeviceType.CPU) .build(); - Output absOps = tf - .withName("absWithDevice") - .withDevice(deviceSpec) - .math - .abs(aOps) - .asOutput(); + Output absOps = + tf.withName("absWithDevice").withDevice(deviceSpec).math.abs(aOps).asOutput(); - try (AutoCloseableList t = - new AutoCloseableList<>(session.runner().fetch(absOps).run())) { - assertEquals(1, ((TInt32)t.get(0)).getInt()); + try (Result t = session.runner().fetch(absOps).run()) { + assertEquals(1, ((TInt32) t.get(0)).getInt()); } } } @Test public void withTwoScopes() { - ConfigProto config = ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) + ConfigProto config = + ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) .setLogDevicePlacement(true) .build(); - try (Graph g = new Graph(); Session session = new Session(g, config)) { - DeviceSpec deviceSpec1 = DeviceSpec.newBuilder() + try (Graph g = new Graph(); + Session session = new Session(g, config)) { + DeviceSpec deviceSpec1 = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) .deviceType(DeviceSpec.DeviceType.CPU) .build(); - DeviceSpec deviceSpec2 = DeviceSpec.newBuilder() + DeviceSpec deviceSpec2 = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) @@ -119,33 +119,27 @@ public void withTwoScopes() { Constant aOps = tf1.constant(-1); Constant bOps = tf2.constant(10); - Output absOps = tf1 - .withName("absWithDevice") - .math - .abs(aOps) - .asOutput(); + Output absOps = tf1.withName("absWithDevice").math.abs(aOps).asOutput(); - Output mulOps = tf2 - .withName("mulWithDevice") - .math - .mul(absOps, bOps) - .asOutput(); + Output mulOps = tf2.withName("mulWithDevice").math.mul(absOps, bOps).asOutput(); - try (AutoCloseableList t = - new AutoCloseableList<>(session.runner().fetch(mulOps).run())) { - assertEquals(10, ((TInt32)t.get(0)).getInt()); + try (Result t = session.runner().fetch(mulOps).run()) { + assertEquals(10, ((TInt32) t.get(0)).getInt()); } } } @Test public void withIncorrectDeviceSpec() { - ConfigProto config = ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) + ConfigProto config = + ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) .setLogDevicePlacement(true) .build(); - try (Graph g = new Graph(); Session session = new Session(g, config)) { - DeviceSpec correctDeviceSpec = DeviceSpec.newBuilder() + try (Graph g = new Graph(); + Session session = new Session(g, config)) { + DeviceSpec correctDeviceSpec = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) @@ -153,7 +147,8 @@ public void withIncorrectDeviceSpec() { .build(); // Incorrect device spec, it will never be executed - DeviceSpec incorrectDeviceSpec = DeviceSpec.newBuilder() + DeviceSpec incorrectDeviceSpec = + DeviceSpec.newBuilder() .job("UNKNOWN") .replica(1) .task(1000) @@ -165,22 +160,17 @@ public void withIncorrectDeviceSpec() { Constant aOps = tf.constant(-1); Constant bOps = tf.constant(10); - Output absOps = tf - .withName("absWithDevice") - .withDevice(incorrectDeviceSpec) - .math - .abs(aOps) - .asOutput(); + Output absOps = + tf.withName("absWithDevice").withDevice(incorrectDeviceSpec).math.abs(aOps).asOutput(); - Output mulOps = tf - .withName("mulWithDevice") + Output mulOps = + tf.withName("mulWithDevice") .withDevice(correctDeviceSpec) .math .mul(absOps, bOps) .asOutput(); - try (AutoCloseableList t = - new AutoCloseableList<>(session.runner().fetch(mulOps).run())) { + try (Result t = session.runner().fetch(mulOps).run()) { fail(); } catch (TFInvalidArgumentException e) { // ok @@ -190,12 +180,15 @@ public void withIncorrectDeviceSpec() { @Test public void withDeviceSpecInScope() { - ConfigProto config = ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) + ConfigProto config = + ConfigProto.newBuilder(ConfigProto.getDefaultInstance()) .setLogDevicePlacement(true) .build(); - try (Graph g = new Graph(); Session session = new Session(g, config)) { - DeviceSpec deviceSpec = DeviceSpec.newBuilder() + try (Graph g = new Graph(); + Session session = new Session(g, config)) { + DeviceSpec deviceSpec = + DeviceSpec.newBuilder() .job("localhost") .replica(0) .task(0) @@ -206,15 +199,10 @@ public void withDeviceSpecInScope() { Constant aOps = tf.constant(-1); - Output absOps = tf - .withName("absWithDevice") - .math - .abs(aOps) - .asOutput(); + Output absOps = tf.withName("absWithDevice").math.abs(aOps).asOutput(); - try (AutoCloseableList t = - new AutoCloseableList<>(session.runner().fetch(absOps).run())) { - assertEquals(1, ((TInt32)t.get(0)).getInt()); + try (Result t = session.runner().fetch(absOps).run()) { + assertEquals(1, ((TInt32) t.get(0)).getInt()); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java index e67312a9847..3129cd7d18c 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TInt32; /** Unit tests for {@link EagerOperationBuilder} class. */ diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java index e2dc82f4c48..65bb83bac8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java @@ -22,7 +22,7 @@ import org.tensorflow.exceptions.TFInvalidArgumentException; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java index 84e1e56df56..4867f310af5 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java @@ -23,7 +23,7 @@ import org.tensorflow.exceptions.TFInvalidArgumentException; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt32; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java index ac9694adabd..1f16cfd649f 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java @@ -15,6 +15,7 @@ package org.tensorflow; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -28,9 +29,14 @@ import java.util.Set; import org.junit.jupiter.api.Test; import org.tensorflow.exceptions.TFInvalidArgumentException; +import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Barrier; +import org.tensorflow.op.debugging.DebugIdentity; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** Unit tests for {@link org.tensorflow.GraphOperation}. */ public class GraphOperationTest { @@ -39,6 +45,7 @@ public class GraphOperationTest { public void outputListLengthFailsOnInvalidName() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); + Operation op = tf.math.add(tf.constant(1), tf.constant(2)).op(); assertEquals(1, op.outputListLength("z")); @@ -56,8 +63,8 @@ public void operationEquality() { GraphOperation op1; try (Graph g = new Graph()) { Ops tf = Ops.create(g); - op1 = (GraphOperation)tf.withName("op1").constant(1).op(); - GraphOperation op2 = (GraphOperation)tf.withName("op2").constant(2).op(); + op1 = (GraphOperation) tf.withName("op1").constant(1).op(); + GraphOperation op2 = (GraphOperation) tf.withName("op2").constant(2).op(); GraphOperation op3 = new GraphOperation(g, op1.getUnsafeNativeHandle()); GraphOperation op4 = g.operation("op1"); assertEquals(op1, op1); @@ -81,8 +88,8 @@ public void operationEquality() { public void operationCollection() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); - GraphOperation op1 = (GraphOperation)tf.withName("op1").constant(1).op(); - GraphOperation op2 = (GraphOperation)tf.withName("op2").constant(2).op(); + GraphOperation op1 = (GraphOperation) tf.withName("op1").constant(1).op(); + GraphOperation op2 = (GraphOperation) tf.withName("op2").constant(2).op(); GraphOperation op3 = new GraphOperation(g, op1.getUnsafeNativeHandle()); GraphOperation op4 = g.operation("op1"); Set ops = new HashSet<>(); @@ -149,7 +156,8 @@ public void outputListLength() { Ops tf = Ops.create(g); assertEquals(1, tf.split(tf.constant(0), tf.array(0, 1), 1L).op().outputListLength("output")); assertEquals(2, tf.split(tf.constant(0), tf.array(0, 1), 2L).op().outputListLength("output")); - assertEquals(3, tf.split(tf.constant(0), tf.array(0, 1, 2), 3L).op().outputListLength("output")); + assertEquals( + 3, tf.split(tf.constant(0), tf.array(0, 1, 2), 3L).op().outputListLength("output")); } } @@ -157,7 +165,8 @@ public void outputListLength() { public void inputListLength() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); - assertEquals(1, tf.split(tf.constant(0), tf.array(0, 1), 1L).op().inputListLength("split_dim")); + assertEquals( + 1, tf.split(tf.constant(0), tf.array(0, 1), 1L).op().inputListLength("split_dim")); try { tf.split(tf.constant(0), tf.array(0, 1), 2L).op().inputListLength("inputs"); } catch (TFInvalidArgumentException iae) { @@ -206,6 +215,8 @@ public void inputs() { assertEquals(2, op.numInputs()); assertEquals(Arrays.asList(a.asOutput(), b.asOutput()), op.inputs()); + assertEquals(a.asOutput(), op.input(0)); + assertEquals(b.asOutput(), op.input(1)); } } @@ -256,4 +267,36 @@ public void controlConsumers() { assertEquals(new LinkedHashSet<>(Collections.singletonList(c.op())), op.controlConsumers()); } } + + @Test + public void getAttributes() { + try (Graph g = new Graph()) { + Ops tf = Ops.create(g); + + Operand a = tf.array(1f); + Operand c = + DebugIdentity.create( + tf.scope(), + a, + DebugIdentity.debugUrls(Arrays.asList("a", "b")), + DebugIdentity.ioIndex(1L)); + Operand barrier = + tf.barrier( + Arrays.asList(TInt32.class, TInt32.class), + Barrier.shapes(new Shape[] {Shape.of(1, 2), Shape.of(3, 4)})); + + GraphOperation op1 = (GraphOperation) c.op(); + + assertEquals(1, op1.attributes().getAttrInt("io_index")); + assertArrayEquals(new String[] {"a", "b"}, op1.attributes().getAttrStringList("debug_urls")); + + GraphOperation op2 = (GraphOperation) barrier.op(); + assertArrayEquals( + new DataType[] {DataType.DT_INT32, DataType.DT_INT32}, + op2.attributes().getAttrTypeList("component_types")); + assertArrayEquals( + new Shape[] {Shape.of(1, 2), Shape.of(3, 4)}, + op2.attributes().getAttrShapeList("shapes")); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java index 464701306f8..cf23f815fdf 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java @@ -25,14 +25,14 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; -import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.tensorflow.exceptions.TFInvalidArgumentException; import org.tensorflow.op.Ops; import org.tensorflow.op.linalg.MatMul; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.GraphDef; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.GraphDef; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -72,8 +72,15 @@ public void graphDefRoundTripWithInit() { Ops init = tf.withInitScope(); Operand variable = init.variable(init.constant(4)); - Operand result = tf.withName("result").math.add(variable, tf.constant(2)); + tf.withName("result").math.add(variable, tf.constant(2)); graphDef = g.toGraphDef(); + + var initNode = + graphDef.getNodeList().stream() + .filter(n -> n.getName().equals(Graph.INIT_OP_NAME)) + .collect(Collectors.toList()); + assertEquals(1, initNode.size()); + assertEquals(3, initNode.get(0).getInputCount()); } try (Graph g = new Graph()) { @@ -82,17 +89,23 @@ public void graphDefRoundTripWithInit() { Ops tf = Ops.create(g); Ops init = tf.withInitScope(); - Operand variable2 = init.withName("var2").variable(init.constant(4)); + init.withName("var2").variable(init.constant(4)); + graphDef = g.toGraphDef(); + + var initNode = + graphDef.getNodeList().stream() + .filter(n -> n.getName().equals(Graph.INIT_OP_NAME)) + .collect(Collectors.toList()); + assertEquals(1, initNode.size()); + assertEquals(6, initNode.get(0).getInputCount()); - try (Session s = new Session(g, true)) { - List results = s.runner().fetch("result").fetch("var2").run(); + try (Session s = new Session(g, true); + Result results = s.runner().fetch("result").fetch("var2").run()) { TInt32 result = (TInt32) results.get(0); assertEquals(6, result.getInt()); TInt32 var2Result = (TInt32) results.get(1); assertEquals(4, var2Result.getInt()); - - results.forEach(Tensor::close); } } } @@ -147,7 +160,7 @@ private static void validateImportedGraph(Graph g, String prefix) { public void iterateOverOperations() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); - Iterator iterator = g.operations(); + Iterator iterator = g.operations(); HashSet operations; assertFalse(iterator.hasNext()); @@ -266,16 +279,14 @@ public void addGradientsToGraph() { try (TFloat32 c1 = TFloat32.scalarOf(3.0f); TFloat32 c2 = TFloat32.scalarOf(2.0f); - AutoCloseableList outputs = - new AutoCloseableList<>( - s.runner() - .feed(x1, c1) - .feed(x2, c2) - .fetch(grads0[0]) - .fetch(grads1[0]) - .fetch(grads1[1]) - .run())) { - + Result outputs = + s.runner() + .feed(x1, c1) + .feed(x2, c2) + .fetch(grads0[0]) + .fetch(grads1[0]) + .fetch(grads1[1]) + .run()) { assertEquals(3, outputs.size()); assertEquals(108.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); assertEquals(6.0f, ((TFloat32) outputs.get(1)).getFloat(), 0.0f); @@ -419,14 +430,13 @@ public void buildWhileLoopMultipleInputs() { try (TInt32 c1 = TInt32.scalarOf(2); TInt32 c2 = TInt32.scalarOf(5); - AutoCloseableList outputs = - new AutoCloseableList<>( - s.runner() - .feed(input1, c1) - .feed(input2, c2) - .fetch(loopOutputs[0]) - .fetch(loopOutputs[1]) - .run())) { + Result outputs = + s.runner() + .feed(input1, c1) + .feed(input2, c2) + .fetch(loopOutputs[0]) + .fetch(loopOutputs[1]) + .run()) { assertEquals(2, outputs.size()); assertEquals(16, ((TInt32) outputs.get(0)).getInt()); // ((2^2)^2) assertEquals(625, ((TInt32) outputs.get(1)).getInt()); // ((5^2)^2) diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/RawTensorTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/RawTensorTest.java index 0d2d8af8b1c..cbd9cc098c0 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/RawTensorTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/RawTensorTest.java @@ -31,10 +31,10 @@ public class RawTensorTest { @Test public void rawToTypedTensor() { RawTensor rawTensor = RawTensor.allocate(TFloat32.class, Shape.of(2, 2), -1); - TFloat32 floatTensor = (TFloat32)rawTensor.asTypedTensor(); + TFloat32 floatTensor = (TFloat32) rawTensor.asTypedTensor(); assertSame(floatTensor.asRawTensor(), rawTensor); try { - TInt32 intTensor = (TInt32)rawTensor.asTypedTensor(); + TInt32 intTensor = (TInt32) rawTensor.asTypedTensor(); fail(); } catch (ClassCastException e) { // ok diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java index ffe4d072bb5..5eb3bf71660 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java @@ -39,11 +39,11 @@ import org.tensorflow.op.core.Placeholder; import org.tensorflow.op.core.ReduceSum; import org.tensorflow.op.core.Variable; -import org.tensorflow.proto.framework.ConfigProto; -import org.tensorflow.proto.framework.RunOptions; -import org.tensorflow.proto.framework.SignatureDef; -import org.tensorflow.proto.framework.TensorInfo; -import org.tensorflow.proto.util.SaverDef; +import org.tensorflow.proto.ConfigProto; +import org.tensorflow.proto.RunOptions; +import org.tensorflow.proto.SaverDef; +import org.tensorflow.proto.SignatureDef; +import org.tensorflow.proto.TensorInfo; import org.tensorflow.types.TFloat32; /** Unit tests for {@link org.tensorflow.SavedModelBundle}. */ @@ -68,6 +68,11 @@ public class SavedModelBundleTest { @Test public void load() { + try (SavedModelBundle bundle = SavedModelBundle.load(SAVED_MODEL_PATH)) { + assertNotNull(bundle.session()); + assertNotNull(bundle.graph()); + assertNotNull(bundle.metaGraphDef()); + } try (SavedModelBundle bundle = SavedModelBundle.load(SAVED_MODEL_PATH, "serve")) { assertNotNull(bundle.session()); assertNotNull(bundle.graph()); @@ -180,9 +185,7 @@ public void exportFunctionWithVariables() throws IOException { assertEquals("save/restore_all", saverDef.getRestoreOpName()); assertEquals(1, savedModel.metaGraphDef().getSignatureDefCount()); - assertEquals( - Signature.DEFAULT_KEY, - savedModel.metaGraphDef().getSignatureDefMap().keySet().iterator().next()); + assertTrue(savedModel.metaGraphDef().getSignatureDefMap().containsKey(Signature.DEFAULT_KEY)); TensorFunction function = savedModel.function(Signature.DEFAULT_KEY); assertNotNull(function); @@ -217,7 +220,10 @@ public void exportFunctionWithVariables() throws IOException { // Now call the same function directly from the model try (TFloat32 zTensor = (TFloat32) - savedModel.call(Collections.singletonMap("input", xTensor)).get("reducedSum")) { + savedModel + .call(Collections.singletonMap("input", xTensor)) + .get("reducedSum") + .get()) { assertEquals(reducedSum, zTensor.getFloat(), EPSILON); } } @@ -269,18 +275,15 @@ public void cannotExportMultipleFunctionsWithSameSignatureKey() throws IOExcepti @Test public void cannotExportOrImportInvalidTags() { - assertThrows(IllegalArgumentException.class, () -> - SavedModelBundle.loader("/").withTags(null) - ); - assertThrows(IllegalArgumentException.class, () -> - SavedModelBundle.loader("/").withTags(new String[]{"tag", null}) - ); - assertThrows(IllegalArgumentException.class, () -> - SavedModelBundle.exporter("/").withTags(null) - ); - assertThrows(IllegalArgumentException.class, () -> - SavedModelBundle.exporter("/").withTags(new String[]{"tag", null}) - ); + assertThrows(IllegalArgumentException.class, () -> SavedModelBundle.loader("/").withTags(null)); + assertThrows( + IllegalArgumentException.class, + () -> SavedModelBundle.loader("/").withTags(new String[] {"tag", null})); + assertThrows( + IllegalArgumentException.class, () -> SavedModelBundle.exporter("/").withTags(null)); + assertThrows( + IllegalArgumentException.class, + () -> SavedModelBundle.exporter("/").withTags(new String[] {"tag", null})); } @Test @@ -298,9 +301,9 @@ public void pythonTfFunction() { System.out.println(add.signature()); args.put("a", a); args.put("b", b); - Map result = add.call(args); + Result result = add.call(args); assertEquals(result.size(), 1); - try (TFloat32 c = (TFloat32) result.values().iterator().next()) { + try (TFloat32 c = (TFloat32) result.get(0)) { assertEquals(25.5f, c.getFloat()); } } @@ -312,11 +315,7 @@ public void pythonTfFunction() { args.put("dummy", dummy); // TF functions always require an input, so we supply a dummy one here // This test actually checks that resource variables can be loaded correctly. - try (TFloat32 v = - (TFloat32) - getVariable - .call(args) - .get(getVariable.signature().outputNames().iterator().next())) { + try (TFloat32 v = (TFloat32) getVariable.call(args).get(0)) { assertEquals(2f, v.getFloat()); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java index 3575da6c8c2..37ca3ce2c1b 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java @@ -16,7 +16,6 @@ package org.tensorflow; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -26,6 +25,7 @@ import java.nio.file.Path; import java.util.Comparator; import java.util.Iterator; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.tensorflow.ndarray.NdArrays; import org.tensorflow.ndarray.Shape; @@ -36,9 +36,10 @@ import org.tensorflow.op.core.Variable; import org.tensorflow.op.linalg.MatMul; import org.tensorflow.op.math.Add; -import org.tensorflow.proto.framework.ConfigProto; -import org.tensorflow.proto.framework.GraphDef; -import org.tensorflow.proto.framework.RunOptions; +import org.tensorflow.proto.ConfigProto; +import org.tensorflow.proto.GraphDef; +import org.tensorflow.proto.RunMetadata; +import org.tensorflow.proto.RunOptions; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -69,8 +70,7 @@ public void runUsingOperationNames() { Ops tf = Ops.create(g); transpose_A_times_X(tf, new int[][] {{2}, {3}}); try (TInt32 x = TInt32.tensorOf(StdArrays.ndCopyOf(new int[][] {{5}, {7}})); - AutoCloseableList outputs = - new AutoCloseableList<>(s.runner().feed("X", x).fetch("Y").run())) { + Result outputs = s.runner().feed("X", x).fetch("Y").run()) { assertEquals(1, outputs.size()); assertEquals(31, ((TInt32) outputs.get(0)).getInt(0, 0)); } @@ -86,8 +86,7 @@ public void runUsingOperationHandles() { Output feed = g.operation("X").output(0); Output fetch = g.operation("Y").output(0); try (TInt32 x = TInt32.tensorOf(StdArrays.ndCopyOf(new int[][] {{5}, {7}})); - AutoCloseableList outputs = - new AutoCloseableList<>(s.runner().feed(feed, x).fetch(fetch).run())) { + Result outputs = s.runner().feed(feed, x).fetch(fetch).run()) { assertEquals(1, outputs.size()); assertEquals(31, ((TInt32) outputs.get(0)).getInt(0, 0)); } @@ -124,20 +123,20 @@ public void runWithMetadata() { Ops tf = Ops.create(g); transpose_A_times_X(tf, new int[][] {{2}, {3}}); try (TInt32 x = TInt32.tensorOf(StdArrays.ndCopyOf(new int[][] {{5}, {7}}))) { - Session.Run result = + Result result = s.runner() .feed("X", x) .fetch("Y") .setOptions(fullTraceRunOptions()) .runAndFetchMetadata(); // Sanity check on outputs. - AutoCloseableList outputs = new AutoCloseableList<>(result.outputs); - assertEquals(1, outputs.size()); - assertEquals(31, ((TInt32) outputs.get(0)).getInt(0, 0)); + assertEquals(1, result.size()); + assertEquals(31, ((TInt32) result.get(0)).getInt(0, 0)); // Sanity check on metadata - assertNotNull(result.metadata); - assertTrue(result.metadata.hasStepStats(), result.metadata.toString()); - outputs.close(); + Optional metadata = result.getMetadata(); + assertTrue(metadata.isPresent()); + assertTrue(metadata.get().hasStepStats(), metadata.get().toString()); + result.close(); } } } @@ -149,8 +148,7 @@ public void runMultipleOutputs() { Ops tf = Ops.create(g); tf.withName("c1").constant(2718); tf.withName("c2").constant(31415); - AutoCloseableList outputs = - new AutoCloseableList<>(s.runner().fetch("c2").fetch("c1").run()); + Result outputs = s.runner().fetch("c2").fetch("c1").run(); assertEquals(2, outputs.size()); assertEquals(31415, ((TInt32) outputs.get(0)).getInt()); assertEquals(2718, ((TInt32) outputs.get(1)).getInt()); @@ -227,10 +225,8 @@ public void saveAndRestore() throws IOException { restoredGraph.importGraphDef(graphDef); try (Session restoredSession = new Session(restoredGraph)) { restoredSession.restore(testFolder.resolve("checkpoint").toString()); - try (AutoCloseableList oldList = - new AutoCloseableList<>(s.runner().fetch("x").fetch("y").run()); - AutoCloseableList newList = - new AutoCloseableList<>(restoredSession.runner().fetch("x").fetch("y").run())) { + try (Result oldList = s.runner().fetch("x").fetch("y").run(); + Result newList = restoredSession.runner().fetch("x").fetch("y").run()) { assertEquals(oldList.get(0), newList.get(0)); assertEquals(oldList.get(1), newList.get(1)); } @@ -264,7 +260,7 @@ public static void testFetchVariable() { private static int numOperations(Graph g) { int numOperations = 0; - for (Iterator it = g.operations(); it.hasNext(); ) { + for (Iterator it = g.operations(); it.hasNext(); ) { Operation o = it.next(); numOperations++; } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SignatureTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SignatureTest.java index c9740ce4a6b..28e97939aa2 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SignatureTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SignatureTest.java @@ -14,14 +14,16 @@ ==============================================================================*/ package org.tensorflow; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Signature.TensorDescription; +import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; -import org.tensorflow.proto.framework.DataType; - -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; +import org.tensorflow.op.core.Placeholder; +import org.tensorflow.proto.DataType; +import org.tensorflow.types.TInt32; public class SignatureTest { @@ -37,10 +39,11 @@ public void cannotUseEmptyKey() { public void cannotDuplicateInputOutputNames() { try (Graph g = new Graph()) { Ops tf = Ops.create(g); - Signature.Builder builder = Signature.builder() - .input("x", tf.constant(10.0f)) - .output("x", tf.constant(10.0f)) // can add an output with the same name as an input - .output("y", tf.constant(20.0f)); + Signature.Builder builder = + Signature.builder() + .input("x", tf.constant(10.0f)) + .output("x", tf.constant(10.0f)) // can add an output with the same name as an input + .output("y", tf.constant(20.0f)); assertThrows(IllegalArgumentException.class, () -> builder.input("x", tf.constant(10))); assertThrows(IllegalArgumentException.class, () -> builder.output("y", tf.constant(20.0f))); } @@ -49,10 +52,12 @@ public void cannotDuplicateInputOutputNames() { @Test public void getInputsAndOutputs() { Ops tf = Ops.create(); - Signature builder = Signature.builder() - .input("x", tf.constant(10.0f)) - .output("y", tf.constant(new float[][] {{10.0f, 30.0f}})) - .output("z", tf.constant(20.0f)).build(); + Signature builder = + Signature.builder() + .input("x", tf.constant(10.0f)) + .output("y", tf.constant(new float[][] {{10.0f, 30.0f}})) + .output("z", tf.constant(20.0f)) + .build(); Map inputs = builder.getInputs(); assertEquals(inputs.size(), 1); @@ -62,8 +67,8 @@ public void getInputsAndOutputs() { assertEquals(outputs.get("y").dataType, DataType.DT_FLOAT); assertEquals(outputs.get("z").dataType, DataType.DT_FLOAT); - assertArrayEquals(outputs.get("y").shape.asArray(), new long [] {1,2}); - assertArrayEquals(outputs.get("z").shape.asArray(), new long [] {}); + assertArrayEquals(outputs.get("y").shape.asArray(), new long[] {1, 2}); + assertArrayEquals(outputs.get("z").shape.asArray(), new long[] {}); Signature emptySignature = Signature.builder().build(); assertEquals(emptySignature.getInputs().size(), 0); @@ -78,4 +83,29 @@ public void emptyMethodNameConvertedToNull() { signature = Signature.builder().key("f").methodName(null).build(); assertNull(signature.methodName()); } + + @Test + public void createTensorInfoFromOperandWithUnknownShape() { + try (Graph g = new Graph()) { + var tf = Ops.create(g); + var placeholder = tf.placeholder(TInt32.class); + var tensorInfo = Signature.Builder.toTensorInfo(placeholder.asOutput()); + assertTrue(tensorInfo.getTensorShape().getUnknownRank()); + assertEquals(0, tensorInfo.getTensorShape().getDimCount()); + } + } + + @Test + public void createTensorInfoFromOperandWithPartiallyUnknownShape() { + try (Graph g = new Graph()) { + var tf = Ops.create(g); + var shape = Shape.of(Shape.UNKNOWN_SIZE, 10); + var placeholder = tf.placeholder(TInt32.class, Placeholder.shape(shape)); + var tensorInfo = Signature.Builder.toTensorInfo(placeholder.asOutput()); + assertFalse(tensorInfo.getTensorShape().getUnknownRank()); + assertEquals(2, tensorInfo.getTensorShape().getDimCount()); + assertEquals(-1, tensorInfo.getTensorShape().getDim(0).getSize()); + assertEquals(10, tensorInfo.getTensorShape().getDim(1).getSize()); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SparseTensorTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SparseTensorTest.java new file mode 100644 index 00000000000..753c3af7ac1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SparseTensorTest.java @@ -0,0 +1,207 @@ +/* + * Copyright 2022 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. + * ======================================================================= + */ +package org.tensorflow; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.op.Ops; +import org.tensorflow.op.sparse.SparseSplit; +import org.tensorflow.types.TFloat64; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; + +public class SparseTensorTest { + + @Test + public void createSparseTensor() { + long[][] indicesArray = new long[][] {{0, 0, 3}, {0, 2, 3}, {1, 0, 0}, {2, 2, 1}}; + try (TInt64 indices = TInt64.tensorOf(StdArrays.ndCopyOf(indicesArray)); + TFloat64 values = TFloat64.vectorOf(10.0, 20.0, 30.0, 40.0); + TInt64 denseShape = TInt64.vectorOf(3, 3, 4); + TFloat64 tensor = TFloat64.sparseTensorOf(indices, values, denseShape)) { + + assertNotNull(tensor); + assertEquals(Shape.of(3, 3, 4), tensor.shape()); + + tensor + .scalars() + .forEachIndexed( + (coords, scalar) -> { + if (Arrays.equals(coords, indicesArray[0])) { + assertEquals(10.0, scalar.getDouble()); + } else if (Arrays.equals(coords, indicesArray[1])) { + assertEquals(20.0, scalar.getDouble()); + } else if (Arrays.equals(coords, indicesArray[2])) { + assertEquals(30.0, scalar.getDouble()); + } else if (Arrays.equals(coords, indicesArray[3])) { + assertEquals(40.0, scalar.getDouble()); + } else { + assertEquals(0.0, scalar.getDouble()); + } + }); + + assertTrue(SparseTensor.class.isAssignableFrom(tensor.getClass())); + SparseTensor sparseTensor = (SparseTensor) tensor; + assertEquals(indices, sparseTensor.indices()); + assertEquals(values, sparseTensor.values()); + assertEquals(denseShape, sparseTensor.denseShape()); + } + } + + @Test + public void splitSparseTensor() { + Ops tf = Ops.create(); + LongNdArray indicesArray = + StdArrays.ndCopyOf(new long[][] {{0, 0}, {0, 2}, {1, 0}, {1, 1}, {1, 3}, {2, 2}}); + try (TInt64 indices = TInt64.tensorOf(indicesArray); + TFloat64 values = TFloat64.vectorOf(10.0, 20.0, 30.0, 40.0, 50.0, 60.0); + TInt64 dimensions = TInt64.vectorOf(3, 4); + SparseTensor sparseTensor = SparseTensor.of(indices, values, dimensions)) { + + // [10.0 0.0 20.0 0.0] [10.0 0.0] [20.0 0.0] + // [30.0 40.0 0.0 50.0] ==> [30.0 40.0] + [ 0.0 50.0] + // [ 0.0 0.0 60.0 0.0] [ 0.0 0.0] [60.0 0.0] + SparseSplit split = + tf.sparse.sparseSplit( + tf.constant(1L), + tf.constant(sparseTensor.indices()), + tf.constant(sparseTensor.values()), + tf.constant(sparseTensor.denseShape()), + 2L); + List> splitIndices = split.outputIndices(); + List> splitValues = split.outputValues(); + List> splitDenseShape = split.outputShape(); + + assertEquals(2, splitIndices.size()); + assertEquals(2, splitValues.size()); + assertEquals(2, splitDenseShape.size()); + + SparseTensor sparsePart1 = + SparseTensor.of( + splitIndices.get(0).asTensor(), + splitValues.get(0).asTensor(), + splitDenseShape.get(0).asTensor()); + assertEquals( + StdArrays.ndCopyOf(new long[][] {{0, 0}, {1, 0}, {1, 1}}), sparsePart1.indices()); + assertEquals(NdArrays.vectorOf(10.0, 30.0, 40.0), sparsePart1.values()); + assertEquals(NdArrays.vectorOf(3L, 2L), sparsePart1.denseShape()); + + SparseTensor sparsePart2 = + SparseTensor.of( + splitIndices.get(1).asTensor(), + splitValues.get(1).asTensor(), + splitDenseShape.get(1).asTensor()); + assertEquals( + StdArrays.ndCopyOf(new long[][] {{0, 0}, {1, 1}, {2, 0}}), sparsePart2.indices()); + assertEquals(NdArrays.vectorOf(20.0, 50.0, 60.0), sparsePart2.values()); + assertEquals(NdArrays.vectorOf(3L, 2L), sparsePart2.denseShape()); + } + } + + @Test + void releaseSparseTensorBeforeTensors() { + TensorState state = null; + + try (TInt64 indices = TInt64.tensorOf(StdArrays.ndCopyOf(new long[][] {{3}, {6}, {9}})); + TFloat64 values = TFloat64.vectorOf(30.0, 60.0, 90.0); + TInt64 denseShape = TInt64.vectorOf(10); + TFloat64 sparseTensor = TFloat64.sparseTensorOf(indices, values, denseShape)) { + state = new TensorState(sparseTensor); + assertFalse(state.isClosed()); + } + assertTrue(state.isClosed()); + + try (TInt64 indices = TInt64.tensorOf(StdArrays.ndCopyOf(new long[][] {{3}, {6}, {9}})); + TFloat64 values = TFloat64.vectorOf(30.0, 60.0, 90.0); + TInt64 denseShape = TInt64.vectorOf(10)) { + try (TFloat64 sparseTensor = TFloat64.sparseTensorOf(indices, values, denseShape)) { + state = new TensorState(sparseTensor); + assertFalse(state.isClosed()); + } + assertFalse(state.isClosed()); + } + assertTrue(state.isClosed()); + } + + @Test + void releaseTensorsBeforeSparseTensor() { + TensorState state = null; + + try (TFloat64 sparseTensor = createSparseTensorForTest()) { + state = new TensorState(sparseTensor); + assertFalse(state.isClosed()); + } + assertTrue(state.isClosed()); + + TFloat64 sparseTensor; + try (TInt64 indices = TInt64.tensorOf(StdArrays.ndCopyOf(new long[][] {{3}, {6}, {9}})); + TFloat64 values = TFloat64.vectorOf(30.0, 60.0, 90.0); + TInt64 denseShape = TInt64.vectorOf(10)) { + sparseTensor = TFloat64.sparseTensorOf(indices, values, denseShape); + state = new TensorState(sparseTensor); + assertFalse(state.isClosed()); + } + assertFalse(state.isClosed()); // Not closing the sparse tensor would leak + sparseTensor.close(); + assertTrue(state.isClosed()); + } + + private TFloat64 createSparseTensorForTest() { + try (TInt64 indices = TInt64.tensorOf(StdArrays.ndCopyOf(new long[][] {{3}, {6}, {9}})); + TFloat64 values = TFloat64.vectorOf(30.0, 60.0, 90.0); + TInt64 denseShape = TInt64.vectorOf(10)) { + return TFloat64.sparseTensorOf(indices, values, denseShape); + } + } + + private static final class TensorState { + + TensorState(TFloat64 tensor) { + SparseTensor sparseTensor = (SparseTensor) tensor; + this.indicesRef = sparseTensor.indices(); + this.valuesRef = sparseTensor.values(); + this.denseShapeRef = sparseTensor.denseShape(); + } + + boolean isClosed() { + try { + // nativeHandle() will throw if the tensor has been closed + indicesRef.asRawTensor().nativeHandle(); + valuesRef.asRawTensor().nativeHandle(); + denseShapeRef.asRawTensor().nativeHandle(); + return false; + + } catch (IllegalStateException e) { + return true; + } + } + + private TInt64 indicesRef = null; + private TFloat64 valuesRef = null; + private TInt64 denseShapeRef = null; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorFlowTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorFlowTest.java index faa53831e32..edf7bcd7190 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorFlowTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorFlowTest.java @@ -18,13 +18,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.io.File; import java.nio.file.Paths; import org.junit.jupiter.api.Test; -import org.tensorflow.proto.framework.OpList; +import org.tensorflow.proto.OpList; /** Unit tests for {@link org.tensorflow.TensorFlow}. */ public class TensorFlowTest { @@ -40,30 +39,21 @@ public void registeredOpList() { } @Test - public void loadLibrary() { - File customOpLibrary = Paths.get("").resolve("bazel-bin/libcustom_ops_test.so").toFile(); - - // Disable this test if the custom op library is not available. This may happen on some - // platforms (e.g. Windows) or when using a development profile that skips the native build + public void loadTFTextLibrary() { + String libname = + System.mapLibraryName("_sentence_breaking_ops") + .substring(3); // strips off the lib on macOS & Linux, don't care about Windows. + File customOpLibrary = + Paths.get("", "target", "tf-text-download", "tensorflow_text", "python", "ops", libname) + .toFile(); + + // Disable this test if the tf-text library is not available. This may happen on some platforms + // (e.g. Windows) assumeTrue(customOpLibrary.exists()); - try (Graph g = new Graph()) { - // Build a graph with an unrecognized operation. - try { - g.baseScope().opBuilder("MyTest", "MyTest").build(); - fail("should not be able to construct graphs with unregistered ops"); - } catch (IllegalArgumentException e) { - // expected exception - } - - // Load the library containing the operation. - OpList opList = TensorFlow.loadLibrary(customOpLibrary.getAbsolutePath()); - assertNotNull(opList); - assertEquals(1, opList.getOpCount()); - assertEquals(opList.getOpList().get(0).getName(), "MyTest"); - - // Now graph building should succeed. - g.baseScope().opBuilder("MyTest", "MyTest").build(); - } + OpList opList = TensorFlow.loadLibrary(customOpLibrary.getAbsolutePath()); + assertNotNull(opList); + assertEquals(1, opList.getOpCount()); + assertEquals(opList.getOpList().get(0).getName(), "SentenceFragments"); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java index 9415a986222..b671ecc8f53 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java @@ -41,7 +41,7 @@ import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.DataBuffers; import org.tensorflow.op.Ops; -import org.tensorflow.proto.framework.DataType; +import org.tensorflow.proto.DataType; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; @@ -66,7 +66,7 @@ public void createWithRawData() { Shape strings_shape = Shape.scalar(); byte[] strings_; // raw TF_STRING try (TString t = TString.tensorOf(NdArrays.scalarOfObject(strings))) { - strings_ = new byte[(int)t.numBytes()]; + strings_ = new byte[(int) t.numBytes()]; t.asRawTensor().data().read(strings_); } @@ -74,7 +74,7 @@ public void createWithRawData() { { try (TBool t = Tensor.of(TBool.class, bools_shape, DataBuffers.of(bools_))) { boolean[] actual = new boolean[bools_.length]; - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertArrayEquals(bools, actual); } @@ -86,11 +86,14 @@ public void createWithRawData() { // validate creating a tensor using a direct byte buffer (in host order) { - DoubleBuffer buf = ByteBuffer.allocateDirect(8 * doubles.length).order(ByteOrder.nativeOrder()) - .asDoubleBuffer().put(doubles); - try (TFloat64 t = TFloat64.tensorOf(doubles_shape, d -> d.write(DataBuffers.of(buf)))) { + DoubleBuffer buf = + ByteBuffer.allocateDirect(8 * doubles.length) + .order(ByteOrder.nativeOrder()) + .asDoubleBuffer() + .put(doubles); + try (TFloat64 t = TFloat64.tensorOf(doubles_shape, d -> d.copyFrom(DataBuffers.of(buf)))) { double[] actual = new double[doubles.length]; - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertArrayEquals(doubles, actual, EPSILON); } } @@ -114,7 +117,7 @@ public void createFromBufferWithNativeByteOrder() { flipBuffer(buf); try (TFloat64 t = TFloat64.tensorOf(Shape.of(4), DataBuffers.of(buf))) { double[] actual = new double[doubles.length]; - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertArrayEquals(doubles, actual, EPSILON); } } @@ -133,39 +136,39 @@ public void createFromBufferWithNonNativeByteOrder() { flipBuffer(buf); try (TFloat64 t = TFloat64.tensorOf(Shape.of(4), DataBuffers.of(buf))) { double[] actual = new double[doubles.length]; - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertArrayEquals(doubles, actual, EPSILON); } } @Test public void createWithTypedBuffer() { - IntBuffer ints = IntBuffer.wrap(new int[]{1, 2, 3, 4}); - FloatBuffer floats = FloatBuffer.wrap(new float[]{1f, 2f, 3f, 4f}); - DoubleBuffer doubles = DoubleBuffer.wrap(new double[]{1d, 2d, 3d, 4d}); - LongBuffer longs = LongBuffer.wrap(new long[]{1L, 2L, 3L, 4L}); + IntBuffer ints = IntBuffer.wrap(new int[] {1, 2, 3, 4}); + FloatBuffer floats = FloatBuffer.wrap(new float[] {1f, 2f, 3f, 4f}); + DoubleBuffer doubles = DoubleBuffer.wrap(new double[] {1d, 2d, 3d, 4d}); + LongBuffer longs = LongBuffer.wrap(new long[] {1L, 2L, 3L, 4L}); // validate creating a tensor using a typed buffer { Shape shape = Shape.of(4); try (TFloat64 t = TFloat64.tensorOf(shape, DataBuffers.of(doubles))) { DoubleBuffer actual = DoubleBuffer.allocate(doubles.capacity()); - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertEquals(doubles, actual); } try (TFloat32 t = TFloat32.tensorOf(shape, DataBuffers.of(floats))) { FloatBuffer actual = FloatBuffer.allocate(floats.capacity()); - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertEquals(floats, actual); } try (TInt32 t = TInt32.tensorOf(shape, DataBuffers.of(ints))) { IntBuffer actual = IntBuffer.allocate(ints.capacity()); - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertEquals(ints, actual); } try (TInt64 t = TInt64.tensorOf(shape, DataBuffers.of(longs))) { LongBuffer actual = LongBuffer.allocate(longs.capacity()); - t.read(DataBuffers.of(actual)); + t.copyTo(DataBuffers.of(actual)); assertEquals(longs, actual); } } @@ -243,7 +246,7 @@ public void readFromRawData() { // validate the use of direct buffers { ByteBuffer bbuf = - ByteBuffer.allocateDirect((int)tdoubles.numBytes()).order(ByteOrder.nativeOrder()); + ByteBuffer.allocateDirect((int) tdoubles.numBytes()).order(ByteOrder.nativeOrder()); tdoubles.asRawTensor().data().copyTo(DataBuffers.of(bbuf), tdoubles.numBytes()); assertEquals(doubles[0], bbuf.asDoubleBuffer().get(0), EPSILON); } @@ -251,13 +254,17 @@ public void readFromRawData() { // validate byte order conversion { DoubleBuffer foreignBuf = - ByteBuffer.allocate((int)tdoubles.numBytes()) + ByteBuffer.allocate((int) tdoubles.numBytes()) .order( ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN) .asDoubleBuffer(); - tdoubles.asRawTensor().data().asDoubles().copyTo(DataBuffers.of(foreignBuf), foreignBuf.capacity()); + tdoubles + .asRawTensor() + .data() + .asDoubles() + .copyTo(DataBuffers.of(foreignBuf), foreignBuf.capacity()); double[] actual = new double[foreignBuf.remaining()]; foreignBuf.get(actual); assertArrayEquals(doubles, actual, EPSILON); @@ -320,7 +327,7 @@ public void scalars() { @Test public void nDimensional() { - DoubleNdArray vector = StdArrays.ndCopyOf(new double[]{1.414, 2.718, 3.1415}); + DoubleNdArray vector = StdArrays.ndCopyOf(new double[] {1.414, 2.718, 3.1415}); try (TFloat64 t = TFloat64.tensorOf(vector)) { assertEquals(TFloat64.class, t.type()); assertEquals(DataType.DT_DOUBLE, t.dataType()); @@ -329,7 +336,7 @@ public void nDimensional() { assertEquals(vector, t); } - IntNdArray matrix = StdArrays.ndCopyOf(new int[][]{{1, 2, 3}, {4, 5, 6}}); + IntNdArray matrix = StdArrays.ndCopyOf(new int[][] {{1, 2, 3}, {4, 5, 6}}); try (TInt32 t = TInt32.tensorOf(matrix)) { assertEquals(TInt32.class, t.type()); assertEquals(DataType.DT_INT32, t.dataType()); @@ -339,9 +346,11 @@ public void nDimensional() { assertEquals(matrix, t); } - LongNdArray threeD = StdArrays.ndCopyOf(new long[][][]{ - {{1}, {3}, {5}, {7}, {9}}, {{2}, {4}, {6}, {8}, {0}}, - }); + LongNdArray threeD = + StdArrays.ndCopyOf( + new long[][][] { + {{1}, {3}, {5}, {7}, {9}}, {{2}, {4}, {6}, {8}, {0}}, + }); try (TInt64 t = TInt64.tensorOf(threeD)) { assertEquals(TInt64.class, t.type()); assertEquals(DataType.DT_INT64, t.dataType()); @@ -352,11 +361,13 @@ public void nDimensional() { assertEquals(threeD, t); } - BooleanNdArray fourD = StdArrays.ndCopyOf(new boolean[][][][]{ - {{{false, false, false, true}, {false, false, true, false}}}, - {{{false, false, true, true}, {false, true, false, false}}}, - {{{false, true, false, true}, {false, true, true, false}}}, - }); + BooleanNdArray fourD = + StdArrays.ndCopyOf( + new boolean[][][][] { + {{{false, false, false, true}, {false, false, true, false}}}, + {{{false, false, true, true}, {false, true, false, false}}}, + {{{false, true, false, true}, {false, true, true, false}}}, + }); try (TBool t = TBool.tensorOf(fourD)) { assertEquals(TBool.class, t.type()); assertEquals(DataType.DT_BOOL, t.dataType()); @@ -387,7 +398,9 @@ public void testNDimensionalStringTensor() { } NdArray byteMatrix = NdArrays.ofObjects(byte[].class, matrix.shape()); - matrix.scalars().forEachIndexed((i, s) -> byteMatrix.setObject(s.getObject().getBytes(UTF_8), i)); + matrix + .scalars() + .forEachIndexed((i, s) -> byteMatrix.setObject(s.getObject().getBytes(UTF_8), i)); try (TString t = TString.tensorOfBytes(byteMatrix)) { assertEquals(TString.class, t.type()); assertEquals(DataType.DT_STRING, t.dataType()); @@ -409,7 +422,7 @@ public void testUint8TensorFromArray() { assertEquals(4, t.shape().size(0)); byte[] got = new byte[4]; - t.read(DataBuffers.of(got)); + t.copyTo(DataBuffers.of(got)); assertArrayEquals(vector, got); } } @@ -417,14 +430,14 @@ public void testUint8TensorFromArray() { @Test public void testCreateFromArrayOfBoxed() { Integer[] vector = new Integer[] {1, 2, 3, 4}; - try (TInt32 t = TInt32.tensorOf(Shape.of(4), d -> d.write(DataBuffers.ofObjects(vector)))) { + try (TInt32 t = TInt32.tensorOf(Shape.of(4), d -> d.copyFrom(DataBuffers.ofObjects(vector)))) { assertEquals(TInt32.class, t.type()); assertEquals(DataType.DT_INT32, t.dataType()); assertEquals(1, t.shape().numDimensions()); assertEquals(4, t.shape().size(0)); Integer[] got = new Integer[4]; - t.read(DataBuffers.ofObjects(got)); + t.copyTo(DataBuffers.ofObjects(got)); assertArrayEquals(vector, got); } } @@ -512,9 +525,10 @@ public void fromHandle() { // // An exception is made for this test, where the pitfalls of this is avoided by not calling // close() on both Tensors. - final FloatNdArray matrix = StdArrays.ndCopyOf(new float[][]{{1, 2, 3}, {4, 5, 6}}); + final FloatNdArray matrix = StdArrays.ndCopyOf(new float[][] {{1, 2, 3}, {4, 5, 6}}); try (TFloat32 src = TFloat32.tensorOf(matrix)) { - TFloat32 cpy = (TFloat32)RawTensor.fromHandle(src.asRawTensor().nativeHandle()).asTypedTensor(); + TFloat32 cpy = + (TFloat32) RawTensor.fromHandle(src.asRawTensor().nativeHandle()).asTypedTensor(); assertEquals(src.type(), cpy.type()); assertEquals(src.dataType(), cpy.dataType()); assertEquals(src.shape().numDimensions(), cpy.shape().numDimensions()); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/WrongEnvTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/WrongEnvTest.java index 18bdeb40e83..abe7b3bc43e 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/WrongEnvTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/WrongEnvTest.java @@ -1,19 +1,19 @@ /* - Copyright 2021 The TensorFlow Authors. All Rights Reserved. + Copyright 2021 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 +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 + 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. - ============================================================================== - */ +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. +============================================================================== +*/ package org.tensorflow; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -24,14 +24,10 @@ import org.tensorflow.op.Ops; import org.tensorflow.types.TInt32; -/** - * Tests for using Operands in different environments - */ +/** Tests for using Operands in different environments */ public class WrongEnvTest { - /** - * Should work fine - */ + /** Should work fine */ @Test public void testTwoEagers() { try (EagerSession e1 = EagerSession.create(); @@ -47,7 +43,6 @@ public void testTwoEagers() { try (TInt32 tensor = c.asTensor()) { assertEquals(11, tensor.getInt()); } - } } @@ -104,5 +99,4 @@ public void testTwoGraphs() { assertTrue(e.getMessage().contains("was from a different graph")); } } - } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/benchmark/TensorBenchmark.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/benchmark/TensorBenchmark.java index 053738d2dd6..61fb9e9b63e 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/benchmark/TensorBenchmark.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/benchmark/TensorBenchmark.java @@ -13,12 +13,14 @@ import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.runner.RunnerException; import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; import org.tensorflow.ndarray.buffer.DataBuffers; import org.tensorflow.ndarray.buffer.IntDataBuffer; -import org.tensorflow.ndarray.StdArrays; import org.tensorflow.types.TInt32; -@Fork(value = 1, jvmArgs = {"-Xms4G", "-Xmx4G"}) +@Fork( + value = 1, + jvmArgs = {"-Xms4G", "-Xmx4G"}) @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 3) @Measurement(iterations = 5) @@ -32,108 +34,70 @@ public static void main(String[] args) throws IOException, RunnerException { @Benchmark @Measurement(batchSize = 1000) public void initTensorByStdArrays() { - int[][][][] data = new int[][][][] { - { - { - {0, 0, 0}, {0, 0, 1}, {0, 0, 2} - }, - { - {0, 1, 0}, {0, 1, 1}, {0, 1, 2} - }, - { - {0, 2, 0}, {0, 2, 1}, {0, 2, 2} - } - }, { - { - {1, 0, 0}, {1, 0, 1}, {1, 0, 2} - }, - { - {1, 1, 0}, {1, 1, 1}, {1, 1, 2} - }, - { - {1, 2, 0}, {1, 2, 1}, {1, 2, 2} - } - }, { - { - {2, 0, 0}, {2, 0, 1}, {2, 0, 2} - }, - { - {2, 1, 0}, {2, 1, 1}, {2, 1, 2} - }, - { - {2, 2, 0}, {2, 2, 1}, {2, 2, 2} - } - } - }; + int[][][][] data = + new int[][][][] { + { + {{0, 0, 0}, {0, 0, 1}, {0, 0, 2}}, + {{0, 1, 0}, {0, 1, 1}, {0, 1, 2}}, + {{0, 2, 0}, {0, 2, 1}, {0, 2, 2}} + }, + { + {{1, 0, 0}, {1, 0, 1}, {1, 0, 2}}, + {{1, 1, 0}, {1, 1, 1}, {1, 1, 2}}, + {{1, 2, 0}, {1, 2, 1}, {1, 2, 2}} + }, + { + {{2, 0, 0}, {2, 0, 1}, {2, 0, 2}}, + {{2, 1, 0}, {2, 1, 1}, {2, 1, 2}}, + {{2, 2, 0}, {2, 2, 1}, {2, 2, 2}} + } + }; TInt32.tensorOf(StdArrays.shapeOf(data), d -> StdArrays.copyTo(data, d)); } @Benchmark @Measurement(batchSize = 1000) public void initTensorByVectors() { - TInt32.tensorOf(Shape.of(3, 3, 3, 3), d -> d - .set(vectorOf(0, 0, 0), 0, 0, 0) - .set(vectorOf(0, 0, 1), 0, 0, 1) - .set(vectorOf(0, 0, 2), 0, 0, 2) - .set(vectorOf(0, 1, 0), 0, 1, 0) - .set(vectorOf(0, 1, 1), 0, 1, 1) - .set(vectorOf(0, 1, 2), 0, 1, 2) - .set(vectorOf(0, 2, 0), 0, 2, 0) - .set(vectorOf(0, 2, 1), 0, 2, 1) - .set(vectorOf(0, 2, 2), 0, 2, 2) - .set(vectorOf(1, 0, 0), 1, 0, 0) - .set(vectorOf(1, 0, 1), 1, 0, 1) - .set(vectorOf(1, 0, 2), 1, 0, 2) - .set(vectorOf(1, 1, 0), 1, 1, 0) - .set(vectorOf(1, 1, 1), 1, 1, 1) - .set(vectorOf(1, 1, 2), 1, 1, 2) - .set(vectorOf(1, 2, 0), 1, 2, 0) - .set(vectorOf(1, 2, 1), 1, 2, 1) - .set(vectorOf(1, 2, 2), 1, 2, 2) - .set(vectorOf(2, 0, 0), 2, 0, 0) - .set(vectorOf(2, 0, 1), 2, 0, 1) - .set(vectorOf(2, 0, 2), 2, 0, 2) - .set(vectorOf(2, 1, 0), 2, 1, 0) - .set(vectorOf(2, 1, 1), 2, 1, 1) - .set(vectorOf(2, 1, 2), 2, 1, 2) - .set(vectorOf(2, 2, 0), 2, 2, 0) - .set(vectorOf(2, 2, 1), 2, 2, 1) - .set(vectorOf(2, 2, 2), 2, 2, 2) - ); + TInt32.tensorOf( + Shape.of(3, 3, 3, 3), + d -> + d.set(vectorOf(0, 0, 0), 0, 0, 0) + .set(vectorOf(0, 0, 1), 0, 0, 1) + .set(vectorOf(0, 0, 2), 0, 0, 2) + .set(vectorOf(0, 1, 0), 0, 1, 0) + .set(vectorOf(0, 1, 1), 0, 1, 1) + .set(vectorOf(0, 1, 2), 0, 1, 2) + .set(vectorOf(0, 2, 0), 0, 2, 0) + .set(vectorOf(0, 2, 1), 0, 2, 1) + .set(vectorOf(0, 2, 2), 0, 2, 2) + .set(vectorOf(1, 0, 0), 1, 0, 0) + .set(vectorOf(1, 0, 1), 1, 0, 1) + .set(vectorOf(1, 0, 2), 1, 0, 2) + .set(vectorOf(1, 1, 0), 1, 1, 0) + .set(vectorOf(1, 1, 1), 1, 1, 1) + .set(vectorOf(1, 1, 2), 1, 1, 2) + .set(vectorOf(1, 2, 0), 1, 2, 0) + .set(vectorOf(1, 2, 1), 1, 2, 1) + .set(vectorOf(1, 2, 2), 1, 2, 2) + .set(vectorOf(2, 0, 0), 2, 0, 0) + .set(vectorOf(2, 0, 1), 2, 0, 1) + .set(vectorOf(2, 0, 2), 2, 0, 2) + .set(vectorOf(2, 1, 0), 2, 1, 0) + .set(vectorOf(2, 1, 1), 2, 1, 1) + .set(vectorOf(2, 1, 2), 2, 1, 2) + .set(vectorOf(2, 2, 0), 2, 2, 0) + .set(vectorOf(2, 2, 1), 2, 2, 1) + .set(vectorOf(2, 2, 2), 2, 2, 2)); } @Benchmark @Measurement(batchSize = 1000) public void initTensorByFlatArray() { - IntDataBuffer data = DataBuffers.of( - 0, 0, 0, - 0, 0, 1, - 0, 0, 2, - 0, 1, 0, - 0, 1, 1, - 0, 1, 2, - 0, 2, 0, - 0, 2, 1, - 0, 2, 2, - 1, 0, 0, - 1, 0, 1, - 1, 0, 2, - 1, 1, 0, - 1, 1, 1, - 1, 1, 2, - 1, 2, 0, - 1, 2, 1, - 1, 2, 2, - 2, 0, 0, - 2, 0, 1, - 2, 0, 2, - 2, 1, 0, - 2, 1, 1, - 2, 1, 2, - 2, 2, 0, - 2, 2, 1, - 2, 2, 2 - ); + IntDataBuffer data = + DataBuffers.of( + 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 1, 0, 0, 1, 1, 0, 1, 2, 0, 2, 0, 0, 2, 1, 0, 2, 2, 1, 0, + 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 0, 1, 2, 1, 1, 2, 2, 2, 0, 0, 2, + 0, 1, 2, 0, 2, 2, 1, 0, 2, 1, 1, 2, 1, 2, 2, 2, 0, 2, 2, 1, 2, 2, 2); TInt32.tensorOf(Shape.of(3, 3, 3, 3), data); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/RawOpTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/RawOpTest.java index 5d523a986ad..d58e349b7e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/RawOpTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/RawOpTest.java @@ -18,18 +18,30 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.HashSet; import java.util.Set; import org.junit.jupiter.api.Test; import org.tensorflow.Graph; +import org.tensorflow.Operand; import org.tensorflow.Output; +import org.tensorflow.op.math.Add; import org.tensorflow.types.TInt32; /** Unit tests for {@link RawOp} */ public class RawOpTest { + @Test + public void wrongOpType() { + try (Graph g = new Graph()) { + Ops tf = Ops.create(g); + Operand a = tf.constant(10); + assertThrows(IllegalArgumentException.class, () -> new Add(a.op())); + } + } + @Test public void equalsHashcode() { try (Graph g = new Graph()) { @@ -38,10 +50,10 @@ public void equalsHashcode() { Output array = tf.constant(new int[2]).asOutput(); RawOp test1 = - new RawOp(g.baseScope().opBuilder("Shape", "shape1").addInput(array).build()) {}; + new RawOp(g.baseScope().opBuilder("Shape", "shape1").addInput(array).build(), "Shape") {}; RawOp test2 = - new RawOp(g.baseScope().opBuilder("Shape", "shape2").addInput(array).build()) {}; - RawOp test3 = new RawOp(test1.operation) {}; + new RawOp(g.baseScope().opBuilder("Shape", "shape2").addInput(array).build(), "Shape") {}; + RawOp test3 = new RawOp(test1.operation, test1.operation.type()) {}; // equals() tests assertNotEquals(test1, test2); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java index 6b37a908f8e..e2213c7ab1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java @@ -50,7 +50,7 @@ public void testSeparateOps() { @Test public void basicNames() { try (Graph g = new Graph()) { - Scope root = new Scope(g); + Scope root = new OpScope(g); assertEquals("add", root.makeOpName("add")); assertEquals("add_1", root.makeOpName("add")); assertEquals("add_2", root.makeOpName("add")); @@ -61,7 +61,7 @@ public void basicNames() { @Test public void hierarchicalNames() { try (Graph g = new Graph()) { - Scope root = new Scope(g); + Scope root = new OpScope(g); Scope child = root.withSubScope("child"); assertEquals("child/add", child.makeOpName("add")); assertEquals("child/add_1", child.makeOpName("add")); @@ -87,7 +87,7 @@ public void hierarchicalNames() { @Test public void scopeAndOpNames() { try (Graph g = new Graph()) { - Scope root = new Scope(g); + Scope root = new OpScope(g); Scope child = root.withSubScope("child"); @@ -100,7 +100,7 @@ public void scopeAndOpNames() { @Test public void validateNames() { try (Graph g = new Graph()) { - Scope root = new Scope(g); + Scope root = new OpScope(g); final String[] invalid_names = { "_", "-", "-x", // Names are constrained to start with [A-Za-z0-9.] @@ -137,7 +137,7 @@ public void validateNames() { @Test public void basic() { try (Graph g = new Graph()) { - Scope s = new Scope(g); + Scope s = new OpScope(g); Const c1 = Const.create(s, 42); assertEquals("Const", c1.output().op().name()); Const c2 = Const.create(s, 7); @@ -152,7 +152,7 @@ public void basic() { @Test public void hierarchy() { try (Graph g = new Graph()) { - Scope root = new Scope(g); + Scope root = new OpScope(g); Scope child = root.withSubScope("child"); assertEquals("child/Const", Const.create(child, 42).output().op().name()); assertEquals("child/four", Const.create(child.withName("four"), 4).output().op().name()); @@ -163,7 +163,7 @@ public void hierarchy() { public void composite() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope s = new Scope(g); + Scope s = new OpScope(g); Output data = Const.create(s.withName("data"), new int[] {600, 470, 170, 430, 300}).output(); @@ -195,6 +195,7 @@ public void composite() { // "handwritten" sample operator classes private static final class Const { + private final Output output; static Const create(Scope s, int v) { @@ -224,6 +225,7 @@ Output output() { } private static final class Mean { + private final Output output; static Mean create(Scope s, Output input, Output reductionIndices) { @@ -241,6 +243,7 @@ Output output() { } private static final class SquaredDifference { + private final Output output; static SquaredDifference create(Scope s, Output x, Output y) { @@ -262,6 +265,7 @@ Output output() { } private static final class Variance { + private final Output output; static Variance create(Scope base, Output x) { diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskTest.java index 7c5210c0f2d..53af60d44bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskTest.java @@ -1,45 +1,47 @@ /* - Copyright 2021 The TensorFlow Authors. All Rights Reserved. + Copyright 2021 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 +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 + 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. - ============================================================================== - */ +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. +============================================================================== +*/ package org.tensorflow.op.core; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.Session; import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.types.TBool; -import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; public class BooleanMaskTest { @Test - public void testBooleanMask(){ + public void testBooleanMask() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand input = Constant.arrayOf(scope, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); Operand input2 = ExpandDims.create(scope, input, Constant.scalarOf(scope, 0)); - Operand mask = Constant.arrayOf(scope, true, true, false, false, true, true, true, false, false, false); + Operand mask = + Constant.arrayOf(scope, true, true, false, false, true, true, true, false, false, false); Operand output1 = BooleanMask.create(scope, input, mask); Operand output2 = BooleanMask.create(scope, input2, mask, BooleanMask.axis(1)); @@ -65,4 +67,39 @@ public void testBooleanMask(){ } } } + + @Test + public void testBooleanMaskWithPartiallyUnknownShape() { + try (Graph g = new Graph(); + Session sess = new Session(g)) { + Scope scope = new OpScope(g); + + Operand input = Constant.arrayOf(scope, 1, 2, 3, 4); + Placeholder inputMask = + Placeholder.create(scope, TBool.class, Placeholder.shape(Shape.of(Shape.UNKNOWN_SIZE))); + + Operand output = BooleanMask.create(scope, input, inputMask); + + try (TBool mask = TBool.vectorOf(true, false, false, true); + TInt32 result = (TInt32) sess.runner().feed(inputMask, mask).fetch(output).run().get(0)) { + // expected shape from Python tensorflow + assertEquals(Shape.of(2), result.shape()); + assertEquals(1, result.getInt(0)); + assertEquals(4, result.getInt(1)); + } + } + } + + @Test + public void testBooleanMaskWithUnknownShape() { + try (Graph g = new Graph()) { + Scope scope = new OpScope(g); + + Operand input = Constant.arrayOf(scope, 1, 2, 3, 4); + Placeholder inputMask = Placeholder.create(scope, TBool.class); + + assertThrows( + IllegalArgumentException.class, () -> BooleanMask.create(scope, input, inputMask)); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskUpdateTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskUpdateTest.java index c2b514bfdb6..84f4229144b 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskUpdateTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/BooleanMaskUpdateTest.java @@ -1,31 +1,31 @@ /* - Copyright 2021 The TensorFlow Authors. All Rights Reserved. + Copyright 2021 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 +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 + 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. - ============================================================================== - */ +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. +============================================================================== +*/ package org.tensorflow.op.core; import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.List; +import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; import org.tensorflow.Graph; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Session; -import org.tensorflow.Tensor; import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt32; @@ -36,19 +36,21 @@ public class BooleanMaskUpdateTest { public void testBooleanMaskUpdateSlice() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); - Operand input = Constant.tensorOf(scope, new int[][]{{0, 0, 0}, {1, 1, 1}, {2, 2, 2}}); + Operand input = + Constant.tensorOf(scope, new int[][] {{0, 0, 0}, {1, 1, 1}, {2, 2, 2}}); Operand mask = Constant.arrayOf(scope, true, false, false); - Operand value = Constant.tensorOf(scope, new int[][]{{-1, -1, -1}}); + Operand value = Constant.tensorOf(scope, new int[][] {{-1, -1, -1}}); Operand output = BooleanMaskUpdate.create(scope, input, mask, value); - Operand bcastOutput = BooleanMaskUpdate.create(scope, input, mask, Constant.scalarOf(scope, -1)); + Operand bcastOutput = + BooleanMaskUpdate.create(scope, input, mask, Constant.scalarOf(scope, -1)); - List results = sess.runner().fetch(output).fetch(bcastOutput).run(); + Result results = sess.runner().fetch(output).fetch(bcastOutput).run(); try (TInt32 result = (TInt32) results.get(0); TInt32 bcastResult = (TInt32) results.get(1)) { @@ -73,19 +75,21 @@ public void testBooleanMaskUpdateSlice() { public void testBooleanMaskUpdateSliceWithBroadcast() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); - Operand input = Constant.tensorOf(scope, new int[][]{{0, 0, 0}, {1, 1, 1}, {2, 2, 2}}); + Operand input = + Constant.tensorOf(scope, new int[][] {{0, 0, 0}, {1, 1, 1}, {2, 2, 2}}); Operand mask = Constant.arrayOf(scope, true, false, false); - Operand value = Constant.vectorOf(scope, new int[]{-1, -1, -1}); + Operand value = Constant.vectorOf(scope, new int[] {-1, -1, -1}); Operand output = BooleanMaskUpdate.create(scope, input, mask, value); - Operand bcastOutput = BooleanMaskUpdate.create(scope, input, mask, Constant.scalarOf(scope, -1)); + Operand bcastOutput = + BooleanMaskUpdate.create(scope, input, mask, Constant.scalarOf(scope, -1)); - List results = sess.runner().fetch(output).fetch(bcastOutput).run(); + Result results = sess.runner().fetch(output).fetch(bcastOutput).run(); try (TInt32 result = (TInt32) results.get(0); TInt32 bcastResult = (TInt32) results.get(1)) { @@ -110,20 +114,24 @@ public void testBooleanMaskUpdateSliceWithBroadcast() { public void testBooleanMaskUpdateAxis() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); - Operand input = Constant.tensorOf(scope, new int[][][]{{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}}); + Operand input = + Constant.tensorOf(scope, new int[][][] {{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}}); - Operand mask = Constant.arrayOf(scope, true, true, false, false, true, true, true, false, false, false); + Operand mask = + Constant.arrayOf(scope, true, true, false, false, true, true, true, false, false, false); Operand value = Constant.arrayOf(scope, -1, -1, -1, -1, -1); - Operand output = BooleanMaskUpdate.create(scope, input, mask, value, BooleanMaskUpdate.axis(2)); + Operand output = + BooleanMaskUpdate.create(scope, input, mask, value, BooleanMaskUpdate.axis(2)); - Operand bcastOutput = BooleanMaskUpdate - .create(scope, input, mask, Constant.scalarOf(scope, -1), BooleanMaskUpdate.axis(2)); + Operand bcastOutput = + BooleanMaskUpdate.create( + scope, input, mask, Constant.scalarOf(scope, -1), BooleanMaskUpdate.axis(2)); - List results = sess.runner().fetch(output).fetch(bcastOutput).run(); + Result results = sess.runner().fetch(output).fetch(bcastOutput).run(); try (TInt32 result = (TInt32) results.get(0); TInt32 bcastResult = (TInt32) results.get(1)) { @@ -144,4 +152,44 @@ public void testBooleanMaskUpdateAxis() { } } } + + @Test + public void testBooleanMaskUpdateWithPartiallyUnknownShape() { + try (Graph g = new Graph(); + Session sess = new Session(g)) { + Scope scope = new OpScope(g); + + Operand input = Constant.arrayOf(scope, 1, 2, 3, 4); + Operand updates = Constant.arrayOf(scope, -1, 2); + Placeholder inputMask = + Placeholder.create(scope, TBool.class, Placeholder.shape(Shape.of(Shape.UNKNOWN_SIZE))); + + Operand output = BooleanMaskUpdate.create(scope, input, inputMask, updates); + + try (TBool mask = TBool.vectorOf(false, true, false, true); + TInt32 result = (TInt32) sess.runner().feed(inputMask, mask).fetch(output).run().get(0)) { + // expected shape from Python tensorflow + assertEquals(Shape.of(4), result.shape()); + assertEquals(1, result.getInt(0)); + assertEquals(-1, result.getInt(1)); + assertEquals(3, result.getInt(2)); + assertEquals(2, result.getInt(3)); + } + } + } + + @Test + public void testBooleanMaskUpdateWithUnknownShape() { + try (Graph g = new Graph()) { + Scope scope = new OpScope(g); + + Operand input = Constant.arrayOf(scope, 1, 2, 3, 4); + Operand updates = Constant.arrayOf(scope, -1, 2); + Placeholder inputMask = Placeholder.create(scope, TBool.class); + + assertThrows( + IllegalArgumentException.class, + () -> BooleanMaskUpdate.create(scope, input, inputMask, updates)); + } + } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java index 6df73261867..5194fccd707 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java @@ -19,12 +19,11 @@ import java.io.IOException; import org.junit.jupiter.api.Test; -import org.tensorflow.AutoCloseableList; import org.tensorflow.EagerSession; import org.tensorflow.Graph; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Session; -import org.tensorflow.Tensor; import org.tensorflow.ndarray.DoubleNdArray; import org.tensorflow.ndarray.FloatNdArray; import org.tensorflow.ndarray.IntNdArray; @@ -38,6 +37,7 @@ import org.tensorflow.ndarray.buffer.FloatDataBuffer; import org.tensorflow.ndarray.buffer.IntDataBuffer; import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Ops; import org.tensorflow.op.Scope; import org.tensorflow.types.TBfloat16; @@ -62,11 +62,10 @@ public void createInts() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Constant op1 = Constant.tensorOf(scope, shape, buffer); Constant op2 = Constant.tensorOf(scope, array); - try (AutoCloseableList t = - new AutoCloseableList<>(sess.runner().fetch(op1).fetch(op2).run())) { + try (Result t = sess.runner().fetch(op1).fetch(op2).run()) { assertEquals(array, t.get(0)); assertEquals(array, t.get(1)); } @@ -81,11 +80,10 @@ public void createFloats() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Constant op1 = Constant.tensorOf(scope, shape, buffer); Constant op2 = Constant.tensorOf(scope, array); - try (AutoCloseableList t = - new AutoCloseableList<>(sess.runner().fetch(op1).fetch(op2).run())) { + try (Result t = sess.runner().fetch(op1).fetch(op2).run()) { assertEquals(array, t.get(0)); assertEquals(array, t.get(1)); } @@ -100,11 +98,10 @@ public void createDoubles() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Constant op1 = Constant.tensorOf(scope, shape, buffer); Constant op2 = Constant.tensorOf(scope, array); - try (AutoCloseableList t = - new AutoCloseableList<>(sess.runner().fetch(op1).fetch(op2).run())) { + try (Result t = sess.runner().fetch(op1).fetch(op2).run()) { assertEquals(array, t.get(0)); assertEquals(array, t.get(1)); } @@ -119,11 +116,10 @@ public void createLongs() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Constant op1 = Constant.tensorOf(scope, shape, buffer); Constant op2 = Constant.tensorOf(scope, array); - try (AutoCloseableList t = - new AutoCloseableList<>(sess.runner().fetch(op1).fetch(op2).run())) { + try (Result t = sess.runner().fetch(op1).fetch(op2).run()) { assertEquals(array, t.get(0)); assertEquals(array, t.get(1)); } @@ -138,11 +134,10 @@ public void createStrings() throws IOException { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Constant op1 = Constant.tensorOf(scope, shape, buffer); Constant op2 = Constant.tensorOf(scope, array); - try (AutoCloseableList t = - new AutoCloseableList<>(sess.runner().fetch(op1).fetch(op2).run())) { + try (Result t = sess.runner().fetch(op1).fetch(op2).run()) { assertEquals(array, t.get(0)); assertEquals(array, t.get(1)); } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java index b1ebd469eb3..0eca95aab59 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java @@ -35,7 +35,7 @@ public void tensorInputTensorOutput() { Session sess = new Session(g)) { Ops ops = Ops.create(g); Operand x = ops.math.add(ops.constant(1), ops.constant(2)); - try (TInt32 result = (TInt32)sess.runner().fetch(x).run().get(0)) { + try (TInt32 result = (TInt32) sess.runner().fetch(x).run().get(0)) { assertEquals(3, result.getInt()); } } @@ -51,7 +51,7 @@ public void testListInputTensorOutput() { inputs.add(ops.constant(2)); inputs.add(ops.constant(3)); Operand x = ops.math.addN(inputs); - try (TInt32 result = (TInt32)sess.runner().fetch(x).run().get(0)) { + try (TInt32 result = (TInt32) sess.runner().fetch(x).run().get(0)) { assertEquals(6, result.getInt()); } } @@ -73,10 +73,9 @@ public void testControlDependencies() { Operand initVariable = ops.assign(variable, ops.constant(0)); ArrayList controls = new ArrayList<>(); controls.add(ops.assign(variable, ops.constant(3))); - Operand x = - ops.withControlDependencies(controls).math.add(variable, ops.constant(0)); + Operand x = ops.withControlDependencies(controls).math.add(variable, ops.constant(0)); sess.runner().addTarget(initVariable).run(); - try (TInt32 result = (TInt32)sess.runner().fetch(x).run().get(0)) { + try (TInt32 result = (TInt32) sess.runner().fetch(x).run().get(0)) { assertEquals(3, result.getInt()); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java index 80150b64bb6..fb52b2d1059 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java @@ -21,11 +21,10 @@ import java.util.Arrays; import org.junit.jupiter.api.Test; -import org.tensorflow.AutoCloseableList; import org.tensorflow.Graph; import org.tensorflow.Output; +import org.tensorflow.Result; import org.tensorflow.Session; -import org.tensorflow.Tensor; import org.tensorflow.op.Ops; import org.tensorflow.types.TFloat32; @@ -48,12 +47,10 @@ public void createGradients() { assertEquals(2, grads.dy().size()); try (TFloat32 c = TFloat32.scalarOf(3.0f); - AutoCloseableList outputs = - new AutoCloseableList<>( - sess.runner().feed(x, c).fetch(grads.dy(0)).fetch(grads.dy(1)).run())) { + Result outputs = sess.runner().feed(x, c).fetch(grads.dy(0)).fetch(grads.dy(1)).run()) { - assertEquals(108.0f, ((TFloat32)outputs.get(0)).getFloat(), 0.0f); - assertEquals(18.0f, ((TFloat32)outputs.get(1)).getFloat(), 0.0f); + assertEquals(108.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); + assertEquals(18.0f, ((TFloat32) outputs.get(1)).getFloat(), 0.0f); } } } @@ -75,10 +72,9 @@ public void createGradientsWithSum() { assertEquals(1, grads.dy().size()); try (TFloat32 c = TFloat32.scalarOf(3.0f); - AutoCloseableList outputs = - new AutoCloseableList<>(sess.runner().feed(x, c).fetch(grads.dy(0)).run())) { + Result outputs = sess.runner().feed(x, c).fetch(grads.dy(0)).run()) { - assertEquals(114.0f, ((TFloat32)outputs.get(0)).getFloat(), 0.0f); + assertEquals(114.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); } } } @@ -94,18 +90,17 @@ public void createGradientsWithInitialValues() { Output y1 = tf.math.square(y0).y(); Gradients grads0 = Gradients.create(tf.scope(), y1, Arrays.asList(y0)); - Gradients grads1 = Gradients.create(tf.scope(), y0, Arrays.asList(x), Gradients.dx(grads0.dy())); + Gradients grads1 = + Gradients.create(tf.scope(), y0, Arrays.asList(x), Gradients.dx(grads0.dy())); assertNotNull(grads1); assertNotNull(grads1.dy()); assertEquals(1, grads1.dy().size()); try (TFloat32 c = TFloat32.scalarOf(3.0f); - AutoCloseableList outputs = - new AutoCloseableList<>( - sess.runner().feed(x, c).fetch(grads1.dy(0)).run())) { + Result outputs = sess.runner().feed(x, c).fetch(grads1.dy(0)).run()) { - assertEquals(108.0f, ((TFloat32)outputs.get(0)).getFloat(), 0.0f); + assertEquals(108.0f, ((TFloat32) outputs.get(0)).getFloat(), 0.0f); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IfTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IfTest.java index 57bc0bc9ffb..16cd17cab8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IfTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IfTest.java @@ -27,6 +27,7 @@ import org.tensorflow.Session; import org.tensorflow.Signature; import org.tensorflow.op.Ops; +import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; public class IfTest { @@ -37,7 +38,8 @@ private static Operand basicIf(Ops tf, Operand a, Operand { Operand a1 = ops.placeholder(TInt32.class); Operand b1 = ops.placeholder(TInt32.class); - return Signature.builder().input("a", a1).input("b", b1).output("y", a1).build(); + Operand y = ops.identity(a1); + return Signature.builder().input("a", a1).input("b", b1).output("y", y).build(); }); ConcreteFunction elseBranch = @@ -45,7 +47,10 @@ private static Operand basicIf(Ops tf, Operand a, Operand { Operand a1 = ops.placeholder(TInt32.class); Operand b1 = ops.placeholder(TInt32.class); - Operand y = ops.math.neg(b1); + // Casts around the math.neg operator as it's not implemented correctly for int32 in + // GPUs at some point between TF 2.10 and TF 2.15. + Operand y = + ops.dtypes.cast(ops.math.neg(ops.dtypes.cast(b1, TFloat32.class)), TInt32.class); return Signature.builder().input("a", a1).input("b", b1).output("y", y).build(); }); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IndexingTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IndexingTest.java index 9a66d2445d2..7fd64957700 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IndexingTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/IndexingTest.java @@ -21,52 +21,55 @@ import org.tensorflow.Graph; import org.tensorflow.Session; import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.index.Indices; import org.tensorflow.ndarray.index.Index; +import org.tensorflow.ndarray.index.Indices; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.types.TFloat32; public class IndexingTest { // [2, 1:2, :, tf.newaxis, ..., :4, 4::2] - private static final Index[] slice = new Index[]{ - Indices.at(2), - Indices.at(1, true), - Indices.all(), - Indices.newAxis(), - Indices.ellipsis(), - Indices.sliceTo( 4), - Indices.sliceFrom(4, 2) - }; + private static final Index[] slice = + new Index[] { + Indices.at(2), + Indices.at(1, true), + Indices.all(), + Indices.newAxis(), + Indices.ellipsis(), + Indices.sliceTo(4), + Indices.sliceFrom(4, 2) + }; @Test public void testIndexMerge() { StridedSliceHelper.StridedSliceArgs args = StridedSliceHelper.mergeIndexes(slice); - assertArrayEquals(new int[]{2, 1, 0, 0, 0, 0, 4}, args.begin); - assertArrayEquals(new int[]{3, 2, 0, 0, 0, 4, 0}, args.end); - assertArrayEquals(new int[]{1, 1, 1, 1, 1, 1, 2}, args.strides); + assertArrayEquals(new int[] {2, 1, 0, 0, 0, 0, 4}, args.begin); + assertArrayEquals(new int[] {3, 2, 0, 0, 0, 4, 0}, args.end); + assertArrayEquals(new int[] {1, 1, 1, 1, 1, 1, 2}, args.strides); assertEquals(0b0100100, args.beginMask); assertEquals(0b1000100, args.endMask); assertEquals(0b0010000, args.ellipsisMask); assertEquals(0b0001000, args.newAxisMask); assertEquals(0b0000001, args.shrinkAxisMask); - } @Test - public void testStridedSliceIndex(){ + public void testStridedSliceIndex() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {10, 10, 10, 10, 10, 10, 10, 10}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TFloat32.class); StridedSlice output = StridedSliceHelper.stridedSlice(scope, op, slice); try (TFloat32 result = (TFloat32) sess.runner().fetch(output.asOutput()).run().get(0)) { // expected shape from Python tensorflow - assertEquals(Shape.of(1, 10, 1, 10, 10, 10, 4, 3), result.shape(), "Slice index didn't match expected (Python)"); + assertEquals( + Shape.of(1, 10, 1, 10, 10, 10, 4, 3), + result.shape(), + "Slice index didn't match expected (Python)"); } } } - } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ShapesTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ShapesTest.java index 39c04c942af..27bfa5fffb6 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ShapesTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ShapesTest.java @@ -22,6 +22,7 @@ import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.Session; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -34,7 +35,7 @@ public class ShapesTest { public void testFlatten_Operand() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Shape expResult = Shape.create(scope, operand, TInt64.class); Operand reshaped = @@ -43,12 +44,11 @@ public void testFlatten_Operand() { Shape tfshape = Shape.create(scope, actual, TInt64.class); AtomicInteger index = new AtomicInteger(); - try (TInt64 result1 = (TInt64)session.runner().fetch(tfshape.asOutput()).run().get(0); - TInt64 result2 = (TInt64)session.runner().fetch(expResult.asOutput()).run().get(0)) { + try (TInt64 result1 = (TInt64) session.runner().fetch(tfshape.asOutput()).run().get(0); + TInt64 result2 = (TInt64) session.runner().fetch(expResult.asOutput()).run().get(0)) { result1 .scalars() - .forEach( - s -> assertEquals(result2.getLong(index.getAndIncrement()), s.getLong())); + .forEach(s -> assertEquals(result2.getLong(index.getAndIncrement()), s.getLong())); } } } @@ -57,7 +57,7 @@ public void testFlatten_Operand() { @Test public void testFlatten_Shape() { try (EagerSession session = EagerSession.create()) { - Scope scope = new Scope(session); + Scope scope = new OpScope(session); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Shape expShape = Shape.create(scope, operand, TInt64.class); Operand actual = @@ -70,9 +70,7 @@ public void testFlatten_Shape() { .asTensor() .scalars() .forEach( - s -> - assertEquals( - expShape.asTensor().getLong(index.getAndIncrement()), s.getLong())); + s -> assertEquals(expShape.asTensor().getLong(index.getAndIncrement()), s.getLong())); } } @@ -81,7 +79,7 @@ public void testFlatten_Shape() { public void testSize_Shape() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2, 1})); @@ -89,7 +87,7 @@ public void testSize_Shape() { Operand size = Shapes.size(scope, tfshape, TInt64.class); AtomicInteger index = new AtomicInteger(); - try (TInt64 result1 = (TInt64)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt64 result1 = (TInt64) session.runner().fetch(size.asOutput()).run().get(0)) { result1.scalars().forEach(s -> assertEquals(8, s.getLong())); } } @@ -100,24 +98,24 @@ public void testSize_Shape() { public void testSize_Shape_Operand() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2, 1})); Shape tfshape = Shape.create(scope, actual); Operand size = Shapes.size(scope, tfshape, Constant.scalarOf(scope, 0)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(4, s.getInt())); } size = Shapes.size(scope, tfshape, Constant.scalarOf(scope, 1)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(2, s.getInt())); } size = Shapes.size(scope, tfshape, Constant.scalarOf(scope, 2)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(1, s.getInt())); } } @@ -128,23 +126,23 @@ public void testSize_Shape_Operand() { public void testSize_Operand_Operand() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2, 1})); Operand size = Shapes.size(scope, actual, Constant.scalarOf(scope, 0)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(4, s.getInt())); } size = Shapes.size(scope, actual, Constant.scalarOf(scope, 1)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(2, s.getInt())); } size = Shapes.size(scope, actual, Constant.scalarOf(scope, 2)); - try (TInt32 result = (TInt32)session.runner().fetch(size.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(size.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(1, s.getInt())); } } @@ -155,14 +153,14 @@ public void testSize_Operand_Operand() { public void testNumDimensions() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2, 1})); Shape tfshape = Shape.create(scope, actual); Operand nDims = Shapes.numDimensions(scope, tfshape); - try (TInt32 result = (TInt32)session.runner().fetch(nDims.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(nDims.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(3, s.getInt())); } } @@ -172,7 +170,7 @@ public void testNumDimensions() { @Test public void testReduceDims_Operand_Operand() { try (EagerSession session = EagerSession.create()) { - Scope scope = new Scope(session); + Scope scope = new OpScope(session); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {2, 2, 2})); @@ -197,7 +195,7 @@ public void testReduceDims_Operand_Operand() { @Test public void testReduceDims_Shape_Operand() { try (EagerSession session = EagerSession.create()) { - Scope scope = new Scope(session); + Scope scope = new OpScope(session); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {2, 2, 2})); @@ -249,7 +247,7 @@ public void testReduceDims_Shape_Operand() { public void testSqueeze() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 1, 2, 1})); @@ -258,7 +256,7 @@ public void testSqueeze() { Operand squeezed = Shapes.squeeze(scope, tfshape); AtomicInteger index = new AtomicInteger(); int[] expected = {4, 2}; - try (TInt32 result = (TInt32)session.runner().fetch(squeezed.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(squeezed.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -274,7 +272,7 @@ public void testSqueeze() { public void testHead() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 1, 2, 1})); @@ -283,7 +281,7 @@ public void testHead() { Operand head = Shapes.head(scope, tfshape); AtomicInteger index = new AtomicInteger(); int[] expected = {4}; - try (TInt32 result = (TInt32)session.runner().fetch(head.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(head.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -299,7 +297,7 @@ public void testHead() { public void testTake() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 1, 2, 1})); @@ -308,7 +306,7 @@ public void testTake() { Operand take = Shapes.take(scope, tfshape, Constant.scalarOf(scope, 2)); AtomicInteger index = new AtomicInteger(); int[] expected = {4, 1}; - try (TInt32 result = (TInt32)session.runner().fetch(take.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(take.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -324,7 +322,7 @@ public void testTake() { public void testTail() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 1, 2, 1})); @@ -333,7 +331,7 @@ public void testTail() { Operand tail = Shapes.tail(scope, tfshape); AtomicInteger index = new AtomicInteger(); int[] expected = {1}; - try (TInt32 result = (TInt32)session.runner().fetch(tail.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(tail.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -349,7 +347,7 @@ public void testTail() { public void testTakeLast() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 1, 2, 1})); @@ -358,7 +356,7 @@ public void testTakeLast() { Operand takeLast = Shapes.takeLast(scope, tfshape, Constant.scalarOf(scope, 3)); AtomicInteger index = new AtomicInteger(); int[] expected = {1, 2, 1}; - try (TInt32 result = (TInt32)session.runner().fetch(takeLast.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(takeLast.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -374,15 +372,16 @@ public void testTakeLast() { public void testPrependInt() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); - Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); + Operand actual = + Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); Shape tfshape = Shape.create(scope, actual); Operand prepend = Shapes.prepend(scope, tfshape, 3); AtomicInteger index = new AtomicInteger(); int[] expected = {3, 4, 2}; - try (TInt32 result = (TInt32)session.runner().fetch(prepend.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(prepend.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -398,15 +397,16 @@ public void testPrependInt() { public void testPrependLong() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); - Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); + Operand actual = + Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); Shape tfshape = Shape.create(scope, actual, TInt64.class); Operand prepend = Shapes.prepend(scope, tfshape, 1L); AtomicInteger index = new AtomicInteger(); long[] expected = {1, 4, 2}; - try (TInt64 result = (TInt64)session.runner().fetch(prepend.asOutput()).run().get(0)) { + try (TInt64 result = (TInt64) session.runner().fetch(prepend.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -422,7 +422,7 @@ public void testPrependLong() { public void testPrependShapeTInt32() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand1 = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual1 = Reshape.create(scope, operand1, Constant.vectorOf(scope, new long[] {4, 2})); @@ -435,7 +435,7 @@ public void testPrependShapeTInt32() { Operand prepend = Shapes.prepend(scope, tfshape1, tfshape2); AtomicInteger index = new AtomicInteger(); int[] expected = {2, 4, 4, 2}; - try (TInt32 result = (TInt32)session.runner().fetch(prepend.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(prepend.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -451,7 +451,7 @@ public void testPrependShapeTInt32() { public void testPrependShapeTInt64() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand1 = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual1 = Reshape.create(scope, operand1, Constant.vectorOf(scope, new long[] {4, 2})); @@ -464,7 +464,7 @@ public void testPrependShapeTInt64() { Operand prepend = Shapes.prepend(scope, tfshape1, tfshape2); AtomicInteger index = new AtomicInteger(); long[] expected = {2, 4, 4, 2}; - try (TInt64 result = (TInt64)session.runner().fetch(prepend.asOutput()).run().get(0)) { + try (TInt64 result = (TInt64) session.runner().fetch(prepend.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -480,15 +480,16 @@ public void testPrependShapeTInt64() { public void testAppendLong() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); - Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); + Operand actual = + Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); Shape tfshape = Shape.create(scope, actual, TInt64.class); Operand append = Shapes.append(scope, tfshape, 2L); AtomicInteger index = new AtomicInteger(); long[] expected = {4L, 2L, 2L}; - try (TInt64 result = (TInt64)session.runner().fetch(append.asOutput()).run().get(0)) { + try (TInt64 result = (TInt64) session.runner().fetch(append.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -504,15 +505,16 @@ public void testAppendLong() { public void testAppendInt() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); - Operand actual = Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); + Operand actual = + Reshape.create(scope, operand, Constant.vectorOf(scope, new long[] {4, 2})); Shape tfshape = Shape.create(scope, actual); Operand append = Shapes.append(scope, tfshape, 2); AtomicInteger index = new AtomicInteger(); int[] expected = {4, 2, 2}; - try (TInt32 result = (TInt32)session.runner().fetch(append.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(append.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -528,7 +530,7 @@ public void testAppendInt() { public void testAppendShapeTInt32() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand1 = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual1 = Reshape.create(scope, operand1, Constant.vectorOf(scope, new long[] {4, 2})); @@ -541,7 +543,7 @@ public void testAppendShapeTInt32() { Operand append = Shapes.append(scope, tfshape1, tfshape2); AtomicInteger index = new AtomicInteger(); int[] expected = {4, 2, 2, 4}; - try (TInt32 result = (TInt32)session.runner().fetch(append.asOutput()).run().get(0)) { + try (TInt32 result = (TInt32) session.runner().fetch(append.asOutput()).run().get(0)) { result .scalars() .forEach( @@ -557,7 +559,7 @@ public void testAppendShapeTInt32() { public void testAppendShapeTInt64() { try (Graph g = new Graph(); Session session = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); Operand operand1 = Constant.arrayOf(scope, new float[] {1, 2, 3, 4, 5, 6, 7, 8}); Operand actual1 = Reshape.create(scope, operand1, Constant.vectorOf(scope, new long[] {4, 2})); @@ -570,7 +572,7 @@ public void testAppendShapeTInt64() { Operand append = Shapes.append(scope, tfshape1, tfshape2); AtomicInteger index = new AtomicInteger(); long[] expected = {4, 2, 2, 4}; - try (TInt64 result = (TInt64)session.runner().fetch(append.asOutput()).run().get(0)) { + try (TInt64 result = (TInt64) session.runner().fetch(append.asOutput()).run().get(0)) { result .scalars() .forEach( diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java index 4121baf3af1..73b7e0a551c 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java @@ -19,10 +19,11 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.List; import org.junit.jupiter.api.Test; import org.tensorflow.Graph; +import org.tensorflow.Result; import org.tensorflow.Session; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Scope; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; @@ -38,10 +39,10 @@ public class ZerosTest { public void createIntZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TInt32.class); - try (TInt32 result = (TInt32)sess.runner().fetch(op).run().get(0)) { + try (TInt32 result = (TInt32) sess.runner().fetch(op).run().get(0)) { result.scalars().forEach(s -> assertEquals(0, s.getInt())); } } @@ -51,10 +52,10 @@ public void createIntZeros() { public void createFloatZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TFloat32.class); - try (TFloat32 result = (TFloat32)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TFloat32 result = (TFloat32) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(0.0f, s.getFloat(), 0)); } } @@ -64,10 +65,10 @@ public void createFloatZeros() { public void createDoubleZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TFloat64.class); - try (TFloat64 result = (TFloat64)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TFloat64 result = (TFloat64) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(0.0f, s.getDouble(), 0)); } } @@ -77,10 +78,10 @@ public void createDoubleZeros() { public void createLongZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TInt64.class); - try (TInt64 result = (TInt64)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TInt64 result = (TInt64) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(0L, s.getLong())); } } @@ -90,23 +91,23 @@ public void createLongZeros() { public void createBooleanZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TBool.class); - try (TBool result = (TBool)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TBool result = (TBool) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertFalse(s.getBoolean())); } - } + } } @Test public void createUint8Zeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TUint8.class); - try (TUint8 result = (TUint8)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TUint8 result = (TUint8) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertEquals(0, s.getByte())); } } @@ -116,10 +117,10 @@ public void createUint8Zeros() { public void createStringZeros() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; Zeros op = Zeros.create(scope, Constant.vectorOf(scope, shape), TString.class); - try (TString result = (TString)sess.runner().fetch(op.asOutput()).run().get(0)) { + try (TString result = (TString) sess.runner().fetch(op.asOutput()).run().get(0)) { result.scalars().forEach(s -> assertTrue(s.getObject().isEmpty())); } } @@ -129,10 +130,12 @@ public void createStringZeros() { public void operationsComposingZerosAreCorrectlyNamed() { try (Graph g = new Graph(); Session sess = new Session(g)) { - Scope scope = new Scope(g); + Scope scope = new OpScope(g); long[] shape = {2, 2}; - Zeros zeros = Zeros.create(scope.withSubScope("test"), Constant.vectorOf(scope, shape), TFloat32.class); - List results = sess.runner().addTarget("test/Zeros/Zero").addTarget("test/Zeros/Fill").run(); + Zeros zeros = + Zeros.create(scope.withSubScope("test"), Constant.vectorOf(scope, shape), TFloat32.class); + Result results = + sess.runner().addTarget("test/Zeros/Zero").addTarget("test/Zeros/Fill").run(); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java index faddc7c5826..1f89f5426b9 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java @@ -26,7 +26,6 @@ import org.tensorflow.ndarray.index.Indices; import org.tensorflow.op.Ops; import org.tensorflow.op.core.Constant; -import org.tensorflow.op.math.Add; import org.tensorflow.op.math.Sub; import org.tensorflow.types.family.TNumber; @@ -39,38 +38,39 @@ public void initializeTensorsWithZeros() { assertEquals(3, tensor.rank()); assertEquals(12, tensor.size()); - NdArray data = (NdArray)tensor; + NdArray data = (NdArray) tensor; try (EagerSession session = EagerSession.create()) { Ops tf = Ops.create(session); // Initialize tensor memory with zeros and take a snapshot - data.scalars().forEach(scalar -> ((NdArray)scalar).setObject(valueOf(0))); + data.scalars().forEach(scalar -> ((NdArray) scalar).setObject(valueOf(0))); Constant x = tf.constantOf(tensor); // Initialize the same tensor memory with ones and take a snapshot - data.scalars().forEach(scalar -> ((NdArray)scalar).setObject(valueOf(1))); + data.scalars().forEach(scalar -> ((NdArray) scalar).setObject(valueOf(1))); Constant y = tf.constantOf(tensor); // Subtract y from x and validate the result Sub sub = tf.math.sub(x, y); - ((NdArray)sub.asTensor()).scalars().forEach(scalar -> - assertEquals(valueOf(-1), scalar.getObject()) - ); + ((NdArray) sub.asTensor()) + .scalars() + .forEach(scalar -> assertEquals(valueOf(-1), scalar.getObject())); } } @Test public void setAndCompute() { - NdArray heapData = allocateNdArray(Shape.of(4)) - .setObject(valueOf(0), 0) - .setObject(valueOf(1), 1) - .setObject(valueOf(2), 2) - .setObject(valueOf(3), 3); + NdArray heapData = + allocateNdArray(Shape.of(4)) + .setObject(valueOf(0), 0) + .setObject(valueOf(1), 1) + .setObject(valueOf(2), 2) + .setObject(valueOf(3), 3); // Creates a 2x2 matrix try (T tensor = allocateTensor(Shape.of(2, 2))) { - NdArray data = (NdArray)tensor; + NdArray data = (NdArray) tensor; // Copy first 2 values of the vector to the first row of the matrix data.set(heapData.slice(Indices.range(0, 2)), 0); @@ -94,13 +94,13 @@ public void setAndCompute() { try (EagerSession session = EagerSession.create()) { Ops tf = Ops.create(session); - Add add = tf.math.add(tf.constantOf(tensor), tf.constantOf(tensor)); - NdArray result = (NdArray)add.asTensor(); + Sub sub = tf.math.sub(tf.constantOf(tensor), tf.constantOf(tensor)); + NdArray result = (NdArray) sub.asTensor(); assertEquals(valueOf(0), result.getObject(0, 0)); - assertEquals(valueOf(2), result.getObject(0, 1)); - assertEquals(valueOf(2), result.getObject(1, 0)); - assertEquals(valueOf(6), result.getObject(1, 1)); + assertEquals(valueOf(0), result.getObject(0, 1)); + assertEquals(valueOf(0), result.getObject(1, 0)); + assertEquals(valueOf(0), result.getObject(1, 1)); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TBoolTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TBoolTest.java new file mode 100644 index 00000000000..df5e1333b00 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TBoolTest.java @@ -0,0 +1,156 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.types; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; +import org.tensorflow.EagerSession; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.index.Indices; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Constant; +import org.tensorflow.op.math.LogicalAnd; +import org.tensorflow.op.math.LogicalNot; +import org.tensorflow.op.math.LogicalOr; + +public class TBoolTest { + + @Test + public void createScalar() { + TBool tensorT = TBool.scalarOf(true); + assertNotNull(tensorT); + assertEquals(Shape.scalar(), tensorT.shape()); + assertEquals(true, tensorT.getObject()); + + TBool tensorF = TBool.scalarOf(false); + assertNotNull(tensorF); + assertEquals(Shape.scalar(), tensorF.shape()); + assertEquals(false, tensorF.getObject()); + } + + @Test + public void createVector() { + TBool tensor = TBool.vectorOf(true, false); + assertNotNull(tensor); + assertEquals(Shape.of(2), tensor.shape()); + assertEquals(true, tensor.getObject(0)); + assertEquals(false, tensor.getObject(1)); + } + + @Test + public void createCopy() { + NdArray bools = + NdArrays.ofObjects(Boolean.class, Shape.of(2, 2)) + .setObject(true, 0, 0) + .setObject(false, 0, 1) + .setObject(false, 1, 0) + .setObject(true, 1, 1); + + TBool tensor = TBool.tensorOf(bools); + assertNotNull(tensor); + bools.scalars().forEachIndexed((idx, s) -> assertEquals(s.getObject(), tensor.getObject(idx))); + } + + @Test + public void initializeTensorsWithBools() { + // Allocate a tensor of booleans of the shape (2, 3, 2) + TBool tensor = TBool.tensorOf(Shape.of(2, 3, 2)); + + assertEquals(3, tensor.rank()); + assertEquals(12, tensor.size()); + NdArray data = (NdArray) tensor; + + try (EagerSession session = EagerSession.create()) { + Ops tf = Ops.create(session); + + // Initialize tensor memory with falses and take a snapshot + data.scalars().forEach(scalar -> ((NdArray) scalar).setObject(false)); + Constant x = tf.constantOf(tensor); + + // Initialize the same tensor memory with trues and take a snapshot + data.scalars().forEach(scalar -> ((NdArray) scalar).setObject(true)); + Constant y = tf.constantOf(tensor); + + // Calculate x AND y and validate the result + LogicalAnd xAndY = tf.math.logicalAnd(x, y); + ((NdArray) xAndY.asTensor()) + .scalars() + .forEach(scalar -> assertEquals(false, scalar.getObject())); + + // Calculate x OR y and validate the result + LogicalOr xOrY = tf.math.logicalOr(x, y); + ((NdArray) xOrY.asTensor()) + .scalars() + .forEach(scalar -> assertEquals(true, scalar.getObject())); + + // Calculate !x and validate the result against y + LogicalNot notX = tf.math.logicalNot(x); + assertEquals(y.asTensor(), notX.asTensor()); + } + } + + @Test + public void setAndCompute() { + NdArray heapData = + NdArrays.ofBooleans(Shape.of(4)) + .setObject(true, 0) + .setObject(false, 1) + .setObject(true, 2) + .setObject(false, 3); + + // Creates a 2x2 matrix + try (TBool tensor = TBool.tensorOf(Shape.of(2, 2))) { + NdArray data = (NdArray) tensor; + + // Copy first 2 values of the vector to the first row of the matrix + data.set(heapData.slice(Indices.range(0, 2)), 0); + + // Copy values at an odd position in the vector as the second row of the matrix + data.set(heapData.slice(Indices.odd()), 1); + + assertEquals(true, data.getObject(0, 0)); + assertEquals(false, data.getObject(0, 1)); + assertEquals(false, data.getObject(1, 0)); + assertEquals(false, data.getObject(1, 1)); + + // Read rows of the tensor in reverse order + NdArray flippedData = data.slice(Indices.flip(), Indices.flip()); + + assertEquals(false, flippedData.getObject(0, 0)); + assertEquals(false, flippedData.getObject(0, 1)); + assertEquals(false, flippedData.getObject(1, 0)); + assertEquals(true, flippedData.getObject(1, 1)); + + try (EagerSession session = EagerSession.create()) { + Ops tf = Ops.create(session); + + LogicalNot sub = tf.math.logicalNot(tf.constantOf(tensor)); + NdArray result = (NdArray) sub.asTensor(); + + assertEquals(false, result.getObject(0, 0)); + assertEquals(true, result.getObject(0, 1)); + assertEquals(true, result.getObject(1, 0)); + assertEquals(true, result.getObject(1, 1)); + } + } + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TStringTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TStringTest.java index c8182ec8d57..a7b3ffbca31 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TStringTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TStringTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.nio.charset.StandardCharsets; - import org.bytedeco.javacpp.Pointer; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -43,10 +42,14 @@ public void createScalar() { @Test public void createrScalarLongerThan127() { - TString tensor = TString.scalarOf("Long String 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 !"); + TString tensor = + TString.scalarOf( + "Long String 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 !"); assertNotNull(tensor); assertEquals(Shape.scalar(), tensor.shape()); - assertEquals("Long String 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 !", tensor.getObject()); + assertEquals( + "Long String 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 !", + tensor.getObject()); } @Test @@ -60,38 +63,40 @@ public void createVector() { @Test public void createCopy() { - NdArray strings = NdArrays.ofObjects(String.class, Shape.of(2, 2)) - .setObject("Pretty", 0, 0) - .setObject("vacant", 0, 1) - .setObject("New", 1, 0) - .setObject("York", 1, 1); + NdArray strings = + NdArrays.ofObjects(String.class, Shape.of(2, 2)) + .setObject("Pretty", 0, 0) + .setObject("vacant", 0, 1) + .setObject("New", 1, 0) + .setObject("York", 1, 1); TString tensor = TString.tensorOf(strings); assertNotNull(tensor); - strings.scalars().forEachIndexed((idx, s) -> - assertEquals(s.getObject(), tensor.getObject(idx)) - ); + strings + .scalars() + .forEachIndexed((idx, s) -> assertEquals(s.getObject(), tensor.getObject(idx))); } @Test public void defaultCharsetIsUtf8() { TString tensor = TString.tensorOf(NdArrays.scalarOfObject(BABY_CHICK)); byte[] bytes = tensor.asBytes().getObject(); - assertArrayEquals(new byte[] { (byte)0xF0, (byte)0x9F, (byte)0x90, (byte)0xA5 }, bytes); + assertArrayEquals(new byte[] {(byte) 0xF0, (byte) 0x9F, (byte) 0x90, (byte) 0xA5}, bytes); assertEquals(BABY_CHICK, tensor.getObject()); } @Test public void usingDifferentCharset() { - TString tensor = TString.tensorOf(StandardCharsets.UTF_16LE, NdArrays.scalarOfObject(BABY_CHICK)); + TString tensor = + TString.tensorOf(StandardCharsets.UTF_16LE, NdArrays.scalarOfObject(BABY_CHICK)); byte[] bytes = tensor.asBytes().getObject(); - assertArrayEquals(new byte[] { (byte)0x3D, (byte)0xD8, (byte)0x25, (byte)0xDC }, bytes); + assertArrayEquals(new byte[] {(byte) 0x3D, (byte) 0xD8, (byte) 0x25, (byte) 0xDC}, bytes); assertEquals(BABY_CHICK, tensor.using(StandardCharsets.UTF_16LE).getObject()); } @Test public void initializingTensorWithRawBytes() { - String[] strings = new String[] { "TensorFlow", "For", "Java", "Rocks", "!" }; + String[] strings = new String[] {"TensorFlow", "For", "Java", "Rocks", "!"}; NdArray bytes = NdArrays.ofObjects(byte[].class, Shape.of(strings.length)); for (int i = 0; i < strings.length; ++i) { bytes.setObject(strings[i].getBytes(), i); @@ -124,10 +129,11 @@ public void testNoLeaks() throws Exception { long bytesAfter = Pointer.physicalBytes(); - // the difference should ideally be 0, but the JVM and TF Core may be holding onto some unrelated stuff... + // the difference should ideally be 0, but the JVM and TF Core may be holding onto some + // unrelated stuff... assertTrue(Math.abs(bytesAfter - bytesBefore) < 10_000_000); } private static final String A_LARGE_STRING = new String(new byte[1_000_000]); - private static final String BABY_CHICK = "\uD83D\uDC25"; + private static final String BABY_CHICK = "\uD83D\uDC25"; } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUint16Test.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUint16Test.java new file mode 100644 index 00000000000..5bfb63d6ad5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUint16Test.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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. + * ======================================================================= + */ + +package org.tensorflow.types; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; + +public class TUint16Test extends NumericTypesTestBase { + + @Override + TUint16 allocateTensor(Shape shape) { + return TUint16.tensorOf(shape); + } + + @Override + NdArray allocateNdArray(Shape shape) { + return NdArrays.ofShorts(shape); + } + + @Override + Short valueOf(Integer value) { + return value.shortValue(); + } +} diff --git a/tensorflow-core/tensorflow-core-generator/pom.xml b/tensorflow-core/tensorflow-core-generator/pom.xml index 25608fe7e24..bb532f5deab 100644 --- a/tensorflow-core/tensorflow-core-generator/pom.xml +++ b/tensorflow-core/tensorflow-core-generator/pom.xml @@ -5,28 +5,46 @@ org.tensorflow tensorflow-core - 0.4.0-SNAPSHOT + 1.2.0-SNAPSHOT tensorflow-core-generator jar - TensorFlow Core Generators + TensorFlow Generators Code generators for TensorFlow Java client - - org.tensorflow.core.generator - - + + org.tensorflow + tensorflow-core-native + ${project.version} + + + org.tensorflow + tensorflow-core-native + ${project.version} + ${native.classifier} + + + org.tensorflow + tensorflow-core-native + ${project.version} + defs + com.google.guava guava - 30.1.1-jre + 32.1.3-jre + + + org.springframework + spring-core + 5.3.32 com.squareup javapoet - 1.12.1 + 1.13.0 com.google.protobuf @@ -44,21 +62,20 @@ commonmark 0.17.1 + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + - - maven-jar-plugin - 3.2.0 - - - - ${java.module.name} - - - - com.diffplug.spotless spotless-maven-plugin diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/module-info.java b/tensorflow-core/tensorflow-core-generator/src/main/java/module-info.java new file mode 100644 index 00000000000..a6efd2561a3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/module-info.java @@ -0,0 +1,34 @@ +/* +Copyright 2022 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. +======================================================================= +*/ + +/** + * Code to generate the Java side implementations of TensorFlow's ops based on the TensorFlow op + * definition files. + */ +module tensorflow.generator { + requires tensorflow.nativelib; + requires transitive java.compiler; + requires com.github.javaparser.core; + requires com.google.protobuf; + requires com.google.common; + requires transitive com.squareup.javapoet; + requires org.commonmark; + requires spring.core; + + exports org.tensorflow.generator.op; + exports org.tensorflow.generator.op.processor; +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/Names.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/Names.java deleted file mode 100644 index d2218c7d6e0..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/Names.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ -package org.tensorflow; - -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeName; - -public class Names { - - public static final String TensorflowPackage = "org.tensorflow"; - public static final String OpPackage = TensorflowPackage + ".op"; - public static final String TypesPackage = TensorflowPackage + ".types"; - - public static final ClassName Operator = ClassName.get(OpPackage + ".annotation", "Operator"); - public static final ClassName Endpoint = ClassName.get(OpPackage + ".annotation", "Endpoint"); - - public static final ClassName TType = ClassName.get(TypesPackage + ".family", "TType"); - public static final ClassName TString = ClassName.get(TypesPackage, "TString"); - public static final ClassName TBool = ClassName.get(TypesPackage, "TBool"); - - public static final ClassName TNumber = ClassName.get(TypesPackage + ".family", "TNumber"); - - public static final ClassName TFloating = ClassName.get(TypesPackage + ".family", "TFloating"); - public static final ClassName TBfloat16 = ClassName.get(TypesPackage, "TBfloat16"); - public static final ClassName TFloat16 = ClassName.get(TypesPackage, "TFloat16"); - public static final ClassName TFloat32 = ClassName.get(TypesPackage, "TFloat32"); - public static final ClassName TFloat64 = ClassName.get(TypesPackage, "TFloat64"); - - public static final ClassName TIntegral = ClassName.get(TypesPackage + ".family", "TIntegral"); - public static final ClassName TUint8 = ClassName.get(TypesPackage, "TUint8"); - public static final ClassName TInt32 = ClassName.get(TypesPackage, "TInt32"); - public static final ClassName TInt64 = ClassName.get(TypesPackage, "TInt64"); - - public static final TypeName Op = ClassName.get(OpPackage, "Op"); - public static final ClassName RawOp = ClassName.get(OpPackage, "RawOp"); - public static final ClassName Operation = ClassName.get(TensorflowPackage, "Operation"); - public static final ClassName Operands = ClassName.get(OpPackage, "Operands"); - public static final ClassName OperationBuilder = ClassName.get(TensorflowPackage, "OperationBuilder"); - public static final TypeName IterableOp = ParameterizedTypeName.get(ClassName.get(Iterable.class), Op); - - public static final ClassName Operand = ClassName.get(TensorflowPackage, "Operand"); - public static final ClassName Output = ClassName.get(TensorflowPackage, "Output"); - - public static final ClassName Shape = ClassName.get(TensorflowPackage + ".ndarray", "Shape"); - public static final ClassName Tensor = ClassName.get(TensorflowPackage, "Tensor"); - public static final ClassName ConcreteFunction = ClassName.get(TensorflowPackage, "ConcreteFunction"); - - public static final ClassName Scope = ClassName.get(OpPackage, "Scope"); - public static final TypeName DeviceSpec = ClassName.get(TensorflowPackage, "DeviceSpec"); - public static final ClassName Ops = ClassName.get(OpPackage, "Ops"); - - public static final TypeName ExecutionEnvironment = - ClassName.get(TensorflowPackage, "ExecutionEnvironment"); - public static final TypeName EagerSession = ClassName.get(TensorflowPackage, "EagerSession"); - - public static final TypeName String = ClassName.get(String.class); - -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/AttributeType.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/AttributeType.java new file mode 100644 index 00000000000..2041ecff7bd --- /dev/null +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/AttributeType.java @@ -0,0 +1,42 @@ +/* + Copyright 2021 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. +============================================================================== +*/ +package org.tensorflow.generator.op; + +enum AttributeType { + STRING("String"), + INT("Int"), + FLOAT("Float"), + BOOL("Bool"), + SHAPE("Shape"), + TENSOR("Tensor"), + TYPE("Type"); + // TODO add Func once supported + + private final String methodName; + + private AttributeType(String methodName) { + this.methodName = methodName; + } + + public String getterName(boolean isList) { + if (isList) { + return methodName + "List"; + } else { + return methodName; + } + } +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ClassGenerator.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ClassGenerator.java similarity index 83% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ClassGenerator.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ClassGenerator.java index 54f153b1988..91d66134880 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ClassGenerator.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ClassGenerator.java @@ -14,10 +14,10 @@ limitations under the License. ======================================================================= */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; -import static org.tensorflow.op.generator.GeneratorUtils.javaizeMemberName; -import static org.tensorflow.op.generator.GeneratorUtils.parseDocumentation; +import static org.tensorflow.generator.op.GeneratorUtils.javaizeMemberName; +import static org.tensorflow.generator.op.GeneratorUtils.parseDocumentation; import com.squareup.javapoet.AnnotationSpec; import com.squareup.javapoet.ArrayTypeName; @@ -34,6 +34,7 @@ import com.squareup.javapoet.WildcardTypeName; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -44,14 +45,13 @@ import java.util.Set; import java.util.StringJoiner; import javax.lang.model.element.Modifier; -import org.tensorflow.Names; -import org.tensorflow.proto.framework.ApiDef; -import org.tensorflow.proto.framework.ApiDef.Endpoint; -import org.tensorflow.proto.framework.ApiDef.Visibility; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.OpDef; -import org.tensorflow.proto.framework.OpDef.ArgDef; -import org.tensorflow.proto.framework.OpDef.AttrDef; +import org.tensorflow.proto.ApiDef; +import org.tensorflow.proto.ApiDef.Endpoint; +import org.tensorflow.proto.ApiDef.Visibility; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.OpDef; +import org.tensorflow.proto.OpDef.ArgDef; +import org.tensorflow.proto.OpDef.AttrDef; /** A generator to generate a op class */ final class ClassGenerator { @@ -70,6 +70,7 @@ enum RenderMode { } private static final String OP_NAME_FIELD = "OP_NAME"; + private static final String INPUTS_CLASS_NAME = "Inputs"; /** The in-progress class builder for the top level op class. */ private final TypeSpec.Builder builder; @@ -104,7 +105,7 @@ enum RenderMode { /** * The generated options class, or null if it doesn't have one or {@link #buildOptionsClass()} has - * not been ran. + * not been run. */ private TypeSpec optionsClass = null; @@ -214,12 +215,29 @@ private String fullClassName() { return fullPackage + "." + className; } + private ClassName className() { + return ClassName.get(fullPackage, className); + } + + private ClassName inputsClassName() { + return ClassName.get(fullPackage, className, INPUTS_CLASS_NAME); + } + + private TypeName maybeParameterize( + ClassName baseType, Collection parameters) { + if (parameters.isEmpty()) { + return baseType; + } else { + return ParameterizedTypeName.get(baseType, parameters.toArray(new TypeName[0])); + } + } + /** Build the class. */ void buildClass() { builder.addModifiers(Modifier.PUBLIC); if (!isStateSelector) { builder.addModifiers(Modifier.FINAL); - builder.superclass(Names.RawOp); + addInputsMetadataAnnotation(); } if (isStateSubclass) { @@ -279,8 +297,6 @@ void buildClass() { if (seenGenerics.add(typeVar.name)) { typeParams.add(typeVar); builder.addTypeVariable(typeVar); - builder.addJavadoc( - "\n@param <$L> data type for {@code $L} output\n", typeVar.name, output.getName()); } } } @@ -340,6 +356,8 @@ void buildClass() { } buildConstructor(); + buildInputsClass(); + builder.superclass(Names.RawOp); } } @@ -527,7 +545,7 @@ private void buildFactoryMethods() { ParameterSpec.Builder param = ParameterSpec.builder(type.iterableIfIterable().javaType, name); String description = argDef.getDescription().isEmpty() - ? String.format("the %s value", name) + ? String.format("The %s value", name) : argDef.getDescription(); paramTags.put(name, CodeBlock.of("$L", parseDocumentation(description))); factoryBuilder.addParameter(param.build()); @@ -567,7 +585,7 @@ private void buildFactoryMethods() { String description = apiAttr.getDescription().isEmpty() - ? String.format("the value of the %s property", javaName) + ? String.format("The value of the %s attribute", javaName) : apiAttr.getDescription(); paramTags.put(javaName, CodeBlock.of("$L", parseDocumentation(description))); @@ -730,6 +748,10 @@ private void buildSecondaryFactory( body.add("$T.class", defaultTypes.get(attr)); } else { factoryBuilder.addParameter(param); + // Checking if the parameter being added is the variadic options or not + if (param.name.equals("options")) { + factoryBuilder.varargs(); + } factoryBuilder.addJavadoc("\n@param $L $L", param.name, paramTags.get(param.name)); typeVars.addAll(new ResolvedType(param.type).findGenerics()); body.add("$L", param.name); @@ -778,6 +800,7 @@ private void buildGettersAndSetters() { .returns(ClassName.get(fullPackage, className, "Options")) .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .addCode("return new Options().$L($L);", method.name, argName) + .varargs(method.varargs) .build()); }); } @@ -864,7 +887,7 @@ private void buildInterfaceImpl() { /** Add a constructor to get the outputs from an operation */ private void buildConstructor() { - MethodSpec.Builder ctor = MethodSpec.constructorBuilder().addModifiers(Modifier.PRIVATE); + MethodSpec.Builder ctor = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC); ctor.addParameter(Names.Operation, "operation"); @@ -879,7 +902,7 @@ private void buildConstructor() { } } CodeBlock.Builder body = CodeBlock.builder(); - body.addStatement("super(operation)"); + body.addStatement("super(operation, $L)", OP_NAME_FIELD); if (op.getOutputArgCount() > 0) { body.addStatement("int outputIdx = 0"); @@ -916,4 +939,136 @@ private void buildConstructor() { ctor.addCode(body.build()); builder.addMethod(ctor.build()); } + + private Set buildInputsClass() { + TypeSpec.Builder inputsBuilder = + TypeSpec.classBuilder(INPUTS_CLASS_NAME).addModifiers(Modifier.PUBLIC, Modifier.STATIC); + MethodSpec.Builder ctor = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC); + ctor.addParameter(Names.GraphOperation, "op"); + + StringJoiner attrNames = new StringJoiner(", "); + + Set typeVars = new LinkedHashSet<>(); + CodeBlock.Builder fieldInits = CodeBlock.builder(); + + fieldInits.addStatement("int inputIndex = 0"); + + // add the inputs as parameters, and add them to the op builder + for (ArgDef input : op.getInputArgList()) { + ResolvedType type = resolver.typeOf(input); + String name = getJavaName(input); + ApiDef.Arg argDef = argApis.get(input); + + typeVars.addAll(type.findGenerics()); + + TypeName javaType = type.iterableIfIterable().javaType; + + String description = + argDef.getDescription().isEmpty() + ? String.format("The %s input", name) + : argDef.getDescription(); + + inputsBuilder.addField( + FieldSpec.builder(javaType, name, Modifier.PUBLIC, Modifier.FINAL) + .addJavadoc("$L", parseDocumentation(description)) + .build()); + + if (type.iterable) { + String inputListLength = name + "Length"; + fieldInits.addStatement( + "int $L = op.inputListLength($S)", inputListLength, input.getName()); + fieldInits.addStatement( + "$L = $T.asList(($T) op.inputList(inputIndex, $L))", + name, + Names.Arrays, + ArrayTypeName.of(type.javaType), + inputListLength); + fieldInits.addStatement("inputIndex += $L", inputListLength); + } else { + fieldInits.addStatement("$L = ($T) op.input(inputIndex++)", name, javaType); + } + } + + for (AttrDef attr : op.getAttrList()) { + ResolvedType type = resolver.typeOf(attr); + String name = getJavaName(attr); + + if (type.attributeType != null) { + + ApiDef.Attr apiAttr = attrApis.get(attr); + + String description = + apiAttr.getDescription().isEmpty() + ? String.format("The %s attribute", name) + : apiAttr.getDescription(); + + TypeName javaType = type.jniType; + if (type.iterable) { + javaType = ArrayTypeName.of(javaType); + } + + attrNames.add(CodeBlock.of("$S", attr.getName()).toString()); + inputsBuilder.addField( + FieldSpec.builder(javaType, name, Modifier.PUBLIC, Modifier.FINAL) + .addJavadoc("$L", parseDocumentation(description)) + .build()); + fieldInits.addStatement( + "$L = op.attributes().getAttr$L($S)", + name, + type.attributeType.getterName(type.iterable), + attr.getName()); + } + } + + List sharedTypeVars = new ArrayList<>(); + for (TypeVariableName onClass : this.builder.typeVariables) { + if (typeVars.contains(onClass)) { + sharedTypeVars.add(onClass); + } else { + sharedTypeVars.add(WildcardTypeName.subtypeOf(TypeName.OBJECT)); + } + } + + TypeName outputClass = className(); + if (!this.builder.typeVariables.isEmpty()) { + outputClass = + ParameterizedTypeName.get( + (ClassName) outputClass, sharedTypeVars.toArray(new TypeName[0])); + } + + inputsBuilder.superclass(ParameterizedTypeName.get(Names.RawOpInputs, outputClass)); + + CodeBlock.Builder body = CodeBlock.builder(); + body.addStatement( + "super(new $L(op), op, $T.asList($L))", + this.builder.typeVariables.isEmpty() ? className : className + "<>", + Names.Arrays, + attrNames.toString()); + + body.add(fieldInits.build()); + ctor.addCode(body.build()); + + inputsBuilder.addMethod(ctor.build()); + inputsBuilder.addTypeVariables(typeVars); + addInputsMetadataAnnotation(inputsBuilder); + this.builder.addType(inputsBuilder.build()); + return typeVars; + } + + /** Adds the GeneratedOpMetadata annotation to the op class. */ + private void addInputsMetadataAnnotation() { + builder.addAnnotation( + AnnotationSpec.builder(Names.OpMetadata) + .addMember("opType", "$L", className + ".OP_NAME") + .addMember("inputsClass", "$T.class", inputsClassName()) + .build()); + } + + /** Adds the GeneratedOpInputsMetadata annotation to the op input class. */ + private void addInputsMetadataAnnotation(TypeSpec.Builder inputsBuilder) { + inputsBuilder.addAnnotation( + AnnotationSpec.builder(Names.OpInputsMetadata) + .addMember("outputsClass", "$T.class", className()) + .build()); + } } diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/FullOpDef.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/FullOpDef.java similarity index 95% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/FullOpDef.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/FullOpDef.java index 5e7775194d7..65e223091eb 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/FullOpDef.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/FullOpDef.java @@ -13,15 +13,15 @@ limitations under the License. ======================================================================= */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; import com.squareup.javapoet.TypeSpec; import java.util.StringJoiner; -import org.tensorflow.proto.framework.ApiDef; -import org.tensorflow.proto.framework.ApiDef.Endpoint; -import org.tensorflow.proto.framework.OpDef; +import org.tensorflow.proto.ApiDef; +import org.tensorflow.proto.ApiDef.Endpoint; +import org.tensorflow.proto.OpDef; -public final class FullOpDef { +final class FullOpDef { public final OpDef opDef; public final ApiDef apiDef; public final String basePackage; diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/GeneratorUtils.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/GeneratorUtils.java similarity index 94% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/GeneratorUtils.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/GeneratorUtils.java index 0aa1638a861..a51062f3288 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/GeneratorUtils.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/GeneratorUtils.java @@ -13,12 +13,12 @@ limitations under the License. ======================================================================= */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; import org.commonmark.node.Node; import org.commonmark.parser.Parser; -import org.tensorflow.op.generator.javadoc.JavaDocRenderer; -import org.tensorflow.proto.framework.OpDef.ArgDef; +import org.tensorflow.generator.op.javadoc.JavaDocRenderer; +import org.tensorflow.proto.OpDef.ArgDef; /** Utilities for op generation */ final class GeneratorUtils { diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/Names.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/Names.java new file mode 100644 index 00000000000..e96601ff0da --- /dev/null +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/Names.java @@ -0,0 +1,87 @@ +/* + Copyright 2021 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. +============================================================================== +*/ +package org.tensorflow.generator.op; + +import com.squareup.javapoet.ArrayTypeName; +import com.squareup.javapoet.ClassName; +import com.squareup.javapoet.ParameterizedTypeName; +import com.squareup.javapoet.TypeName; + +public class Names { + + public static final String TensorflowPackage = "org.tensorflow"; + public static final String OpPackage = TensorflowPackage + ".op"; + public static final String TypesPackage = TensorflowPackage + ".types"; + + public static final ClassName Operator = ClassName.get(OpPackage + ".annotation", "Operator"); + public static final ClassName Endpoint = ClassName.get(OpPackage + ".annotation", "Endpoint"); + public static final ClassName OpMetadata = ClassName.get(OpPackage + ".annotation", "OpMetadata"); + public static final ClassName OpInputsMetadata = + ClassName.get(OpPackage + ".annotation", "OpInputsMetadata"); + + public static final ClassName TType = ClassName.get(TypesPackage + ".family", "TType"); + public static final ClassName TString = ClassName.get(TypesPackage, "TString"); + public static final ClassName TBool = ClassName.get(TypesPackage, "TBool"); + + public static final ClassName TNumber = ClassName.get(TypesPackage + ".family", "TNumber"); + + public static final ClassName TFloating = ClassName.get(TypesPackage + ".family", "TFloating"); + public static final ClassName TBfloat16 = ClassName.get(TypesPackage, "TBfloat16"); + public static final ClassName TFloat16 = ClassName.get(TypesPackage, "TFloat16"); + public static final ClassName TFloat32 = ClassName.get(TypesPackage, "TFloat32"); + public static final ClassName TFloat64 = ClassName.get(TypesPackage, "TFloat64"); + + public static final ClassName TIntegral = ClassName.get(TypesPackage + ".family", "TIntegral"); + public static final ClassName TUint8 = ClassName.get(TypesPackage, "TUint8"); + public static final ClassName TInt32 = ClassName.get(TypesPackage, "TInt32"); + public static final ClassName TInt64 = ClassName.get(TypesPackage, "TInt64"); + + public static final TypeName Op = ClassName.get(OpPackage, "Op"); + public static final ClassName RawOp = ClassName.get(OpPackage, "RawOp"); + public static final ClassName RawOpInputs = ClassName.get(OpPackage, "RawOpInputs"); + public static final ClassName Operation = ClassName.get(TensorflowPackage, "Operation"); + public static final ClassName GraphOperation = ClassName.get(TensorflowPackage, "GraphOperation"); + public static final ClassName Operands = ClassName.get(OpPackage, "Operands"); + public static final ClassName OperationBuilder = + ClassName.get(TensorflowPackage, "OperationBuilder"); + public static final TypeName IterableOp = + ParameterizedTypeName.get(ClassName.get(Iterable.class), Op); + public static final TypeName IterableOperation = + ParameterizedTypeName.get(ClassName.get(Iterable.class), Operation); + public static final TypeName ArrayOp = ArrayTypeName.of(Op); + public static final TypeName ArrayOperation = ArrayTypeName.of(Operation); + + public static final ClassName Operand = ClassName.get(TensorflowPackage, "Operand"); + public static final ClassName Output = ClassName.get(TensorflowPackage, "Output"); + + public static final ClassName Shape = ClassName.get(TensorflowPackage + ".ndarray", "Shape"); + public static final ClassName Tensor = ClassName.get(TensorflowPackage, "Tensor"); + public static final ClassName ConcreteFunction = + ClassName.get(TensorflowPackage, "ConcreteFunction"); + + public static final ClassName Scope = ClassName.get(OpPackage, "Scope"); + public static final ClassName OpScope = ClassName.get(OpPackage, "OpScope"); + public static final TypeName DeviceSpec = ClassName.get(TensorflowPackage, "DeviceSpec"); + public static final ClassName Ops = ClassName.get(OpPackage, "Ops"); + + public static final TypeName ExecutionEnvironment = + ClassName.get(TensorflowPackage, "ExecutionEnvironment"); + public static final TypeName EagerSession = ClassName.get(TensorflowPackage, "EagerSession"); + + public static final TypeName String = ClassName.get(String.class); + public static final ClassName Arrays = ClassName.get(java.util.Arrays.class); +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/OpGenerator.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/OpGenerator.java new file mode 100644 index 00000000000..2f3c27b28f2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/OpGenerator.java @@ -0,0 +1,459 @@ +/* Copyright 2021 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. +======================================================================= +*/ +package org.tensorflow.generator.op; + +import com.google.protobuf.TextFormat; +import com.squareup.javapoet.JavaFile; +import com.squareup.javapoet.TypeSpec; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Scanner; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.bytedeco.javacpp.BytePointer; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.tensorflow.internal.c_api.TF_ApiDefMap; +import org.tensorflow.internal.c_api.TF_Buffer; +import org.tensorflow.internal.c_api.TF_Status; +import org.tensorflow.internal.c_api.global.tensorflow; +import org.tensorflow.proto.ApiDef; +import org.tensorflow.proto.ApiDefs; +import org.tensorflow.proto.OpDef; +import org.tensorflow.proto.OpList; + +public final class OpGenerator { + + private static final String LICENSE = + "/* Copyright 2018-2023 The TensorFlow Authors. All Rights Reserved.\n" + + "\n" + + "Licensed under the Apache License, Version 2.0 (the \"License\");\n" + + "you may not use this file except in compliance with the License.\n" + + "You may obtain a copy of the License at\n" + + "\n" + + " http://www.apache.org/licenses/LICENSE-2.0\n" + + "\n" + + "Unless required by applicable law or agreed to in writing, software\n" + + "distributed under the License is distributed on an \"AS IS\" BASIS,\n" + + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + + "See the License for the specific language governing permissions and\n" + + "limitations under the License.\n" + + "=======================================================================*/" + + "\n"; + + private static final String HELP_TEXT = + "Args should be: [--help] [-p ] [-a ] [-o ] [-c] []"; + + private static final String DEFAULT_OP_DEF_FILE = "org/tensorflow/ops.pbtxt"; + + private static final Scanner USER_PROMPT = new Scanner(System.in, StandardCharsets.UTF_8); + + /** + * Args should be {@code [base_package]}. + * + *

    {@code base_package} is {@code org.tensorflow.op} by default. + * + *

    Will delete everything in {@code outputDir}. + */ + public static void main(String[] args) throws IOException, URISyntaxException { + String packageName = "org.tensorflow.op"; + String apiDefsPath = null; + String outputPath = "."; + String opDefsPath = null; + boolean createMissingApiDefs = false; + + for (int argIdx = 0; argIdx < args.length; ++argIdx) { + var arg = arg(args, argIdx); + switch (arg) { + case "--help": + case "-h": + System.out.println(HELP_TEXT); + return; + case "-p": + packageName = arg(args, ++argIdx); + break; + case "-a": + apiDefsPath = arg(args, ++argIdx); + break; + case "-o": + outputPath = arg(args, ++argIdx); + break; + case "-c": + createMissingApiDefs = true; + break; + default: + if (argIdx == args.length - 1) { + opDefsPath = arg(args, argIdx); + } else { + System.err.println("Unknown argument \"" + arg + "\""); + System.out.println(HELP_TEXT); + System.exit(1); + } + } + } + System.out.println("Generating ops files:"); + System.out.println(" Ops definitions: " + (opDefsPath != null ? opDefsPath : "")); + System.out.println(" Java API definitions: " + apiDefsPath); + System.out.println(" Package name: " + packageName); + System.out.println(" Output directory: " + outputPath); + + File outputDir = new File(outputPath); + OpList opList = null; + + if (opDefsPath != null) { + var opDefsFile = new File(opDefsPath); + + if (!opDefsFile.exists()) { + System.err.println("Op def file " + opDefsFile + " does not exist."); + System.exit(1); + } + if (!opDefsFile.isFile()) { + System.err.println("Op def file " + opDefsFile + " is not a file."); + System.exit(1); + } + if (!opDefsFile.canRead()) { + System.err.println("Can't read Op def file " + opDefsFile + "."); + System.exit(1); + } + try (var opDefsInput = new FileInputStream(opDefsFile)) { + opList = readOpList(opDefsFile.getName(), opDefsInput); + } + } else { + var opDefsFile = OpGenerator.class.getClassLoader().getResource(DEFAULT_OP_DEF_FILE); + + if (opDefsFile == null) { + throw new FileNotFoundException( + "\"" + DEFAULT_OP_DEF_FILE + "\" cannot be found in native artifact"); + } + try (var opDefsInput = opDefsFile.openStream()) { + opList = readOpList(opDefsFile.getFile(), opDefsInput); + } + } + + File basePackage = new File(outputDir, packageName.replace('.', '/')); + if (basePackage.exists()) { + try { + Files.walkFileTree( + basePackage.toPath(), + new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) + throws IOException { + Files.delete(dir); + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException ignored) { + } + } + + var generator = new OpGenerator(packageName, apiDefsPath, outputDir, createMissingApiDefs); + generator.generate(opList); + } + + private static String arg(String[] args, int idx) { + if (idx >= args.length) { + System.err.println(HELP_TEXT); + System.exit(1); + } + return args[idx]; + } + + private static OpList readOpList(String filename, InputStream protoInput) { + try { + if (filename.endsWith(".pbtxt")) { + return TextFormat.parse( + new String(protoInput.readAllBytes(), StandardCharsets.UTF_8), OpList.class); + } + return OpList.parseFrom(protoInput); + + } catch (IOException e) { + throw new RuntimeException("Error parsing proto file named \"" + filename + "\"", e); + } + } + + private final String basePackage; + private final Path apiDefsPath; + private final File outputDir; + private final boolean createMissingApiDefs; + + private OpGenerator( + String basePackage, String apiDefsPath, File outputDir, boolean createMissingApiDefs) { + this.basePackage = basePackage; + this.apiDefsPath = Path.of(apiDefsPath); + this.outputDir = outputDir; + this.createMissingApiDefs = createMissingApiDefs; + } + + private Map buildDefMap(OpList opList) { + TF_ApiDefMap apiDefMap = null; + try (TF_Status status = TF_Status.newStatus()) { + apiDefMap = tensorflow.TF_NewApiDefMap(TF_Buffer.newBufferFromString(opList), status); + status.throwExceptionIfNotOK(); + + // Check if there is any missing APIs in the provided path, if so give a chance to the invoker + // of this generator + // to create one before continuing + for (OpDef opDef : opList.getOpList()) { + var apiDefFile = apiDefsPath.resolve("api_def_" + opDef.getName() + ".pbtxt").toFile(); + if (!apiDefFile.exists()) { + if (createMissingApiDefs) { + createApiDef(opDef, apiDefFile); + } else { + System.out.println("Warning: No Java API definitions for operation " + opDef.getName()); + } + } + } + + // We must build the ApiDefMap before any attempt to retrieve a value from it, or it will fail + // Load first the base APIs coming from the native artifact, then load provided APIs + mergeBaseApiDefs(apiDefMap, status); + mergeApiDefs(apiDefMap, status); + + Map defs = new LinkedHashMap<>(); + for (OpDef opDef : opList.getOpList()) { + var apiDef = + tensorflow.TF_ApiDefMapGet( + apiDefMap, opDef.getName(), opDef.getName().length(), status); + defs.put(opDef, ApiDef.parseFrom(apiDef.copyData())); + } + return defs; + + } catch (Exception e) { + throw e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e); + + } finally { + if (apiDefMap != null) { + tensorflow.TF_DeleteApiDefMap(apiDefMap); + } + } + } + + private void mergeBaseApiDefs(TF_ApiDefMap apiDefMap, TF_Status status) { + try { + var resourceResolver = + new PathMatchingResourcePatternResolver(OpGenerator.class.getClassLoader()); + var apiDefs = resourceResolver.getResources("org/tensorflow/base_api/api_def_*.pbtxt"); + for (var apiDef : apiDefs) { + try (var apiDefInput = apiDef.getInputStream()) { + tensorflow.TF_ApiDefMapPut( + apiDefMap, + new BytePointer(apiDefInput.readAllBytes()), + apiDef.contentLength(), + status); + status.throwExceptionIfNotOK(); + } catch (IOException e) { + throw new RuntimeException( + "Failed to parse API definition in resource \"" + apiDef.getURI() + "\"", e); + } + } + } catch (IOException e) { + throw new RuntimeException( + "Failed to browse API definitions in resource folder \"" + apiDefsPath + "\"", e); + } + } + + private void mergeApiDefs(TF_ApiDefMap apiDefMap, TF_Status status) { + try (Stream s = Files.walk(apiDefsPath)) { + s.filter(p -> p.toString().endsWith(".pbtxt")) + .forEach( + p -> { + try { + byte[] content = Files.readAllBytes(p); + tensorflow.TF_ApiDefMapPut( + apiDefMap, new BytePointer(content), content.length, status); + status.throwExceptionIfNotOK(); + } catch (IOException e) { + throw new RuntimeException( + "Failed to parse API definition in resource file \"" + p.toString() + "\"", + e); + } + }); + } catch (IOException e) { + throw new RuntimeException( + "Failed to browse API definitions in resource folder \"" + apiDefsPath + "\"", e); + } + } + + private void createApiDef(OpDef opDef, File apiDefFile) throws IOException { + System.out.println("Creating Java API definition for operator " + opDef.getName()); + var apiDef = ApiDef.newBuilder(); + apiDef.setGraphOpName(opDef.getName()); + + ApiDef.Visibility visibility = null; + do { + System.out.print( + " Choose visibility of this op [v]isible/[h]idden/[s]kip/[d]efault (default=v): "); + var value = USER_PROMPT.nextLine().trim(); + if (!value.isEmpty()) { + switch (value) { + case "V": + case "v": + visibility = ApiDef.Visibility.VISIBLE; + apiDef.setVisibility(visibility); + break; + case "H": + case "h": + visibility = ApiDef.Visibility.HIDDEN; + apiDef.setVisibility(visibility); + break; + case "S": + case "s": + visibility = ApiDef.Visibility.SKIP; + apiDef.setVisibility(visibility); + break; + case "D": + case "d": + visibility = ApiDef.Visibility.DEFAULT_VISIBILITY; + break; + default: + break; + } + } else { + visibility = ApiDef.Visibility.VISIBLE; + } + } while (visibility == null); + + if (visibility != ApiDef.Visibility.SKIP) { + var endpointNameBuilder = new StringBuilder(); + + System.out.print(" Set the group of this op (default=core): "); + var groupName = USER_PROMPT.nextLine().trim(); + if (!groupName.isEmpty() && !groupName.equals("core")) { + endpointNameBuilder.append(groupName).append("."); + } + System.out.print(" Set the name of this op (default=" + opDef.getName() + "): "); + var opCustomName = USER_PROMPT.nextLine().trim(); + endpointNameBuilder.append(opCustomName.isEmpty() ? opDef.getName() : opCustomName); + + var endpoint = ApiDef.Endpoint.newBuilder(); + endpoint.setName(endpointNameBuilder.toString()); + apiDef.addEndpoint(endpoint); + } + if (!apiDefFile.exists() && !apiDefFile.createNewFile()) { + System.err.println("Cannot create API definition file \"" + apiDefFile.getPath() + "\""); + } + try (var apiDefWriter = new FileWriter(apiDefFile, StandardCharsets.UTF_8)) { + var apiDefs = ApiDefs.newBuilder(); + apiDefs.addOp(apiDef.build()); + apiDefWriter.write(TextFormat.printer().printToString(apiDefs.build())); + + } catch (Exception e) { + // If something goes wrong, erase the file we've just created + if (!apiDefFile.delete()) { + System.err.println( + "Cannot delete invalid API definition file \"" + + apiDefFile.getPath() + + "\", please clean up manually"); + } + throw e; + } + } + + private void writeToFile(TypeSpec spec, String packageName) { + JavaFile file = + JavaFile.builder(packageName, spec).indent(" ").skipJavaLangImports(true).build(); + + File outputFile = + new File(outputDir, packageName.replace('.', '/') + '/' + spec.name + ".java"); + outputFile.getParentFile().mkdirs(); + try { + StringBuilder builder = new StringBuilder(); + builder.append(LICENSE + '\n'); + builder.append("// This class has been generated, DO NOT EDIT!\n\n"); + file.writeTo(builder); + + Files.write( + outputFile.toPath(), + builder.toString().getBytes(StandardCharsets.UTF_8), + StandardOpenOption.WRITE, + StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException ioException) { + throw new IllegalStateException("Failed to write file " + outputFile, ioException); + } + } + + /** Generate all the ops that pass {@link ClassGenerator#canGenerateOp(OpDef, ApiDef)}. */ + private void generate(OpList opList) { + Map ops = buildDefMap(opList); + + List fullOps = + ops.entrySet().stream() + .filter(e -> ClassGenerator.canGenerateOp(e.getKey(), e.getValue())) + .flatMap( + (entry) -> + entry.getValue().getEndpointList().stream() + .map( + (endpoint) -> { + String name; + String pack; + + int pos = endpoint.getName().lastIndexOf('.'); + if (pos > -1) { + pack = endpoint.getName().substring(0, pos); + name = endpoint.getName().substring(pos + 1); + } else { + pack = "core"; + name = endpoint.getName(); + } + + return new FullOpDef( + entry.getKey(), + entry.getValue(), + basePackage, + basePackage + "." + pack, + pack, + name, + endpoint); + })) + .collect(Collectors.toList()); + + List statefulPairs = StatefulPair.extractStatefulPairs(fullOps); + + fullOps.forEach( + (def) -> { + TypeSpec spec = def.buildOpClass(); + writeToFile(spec, def.packageName); + }); + + statefulPairs.forEach( + (pair) -> { + pair.buildOpClasses().forEach((spec) -> writeToFile(spec, pair.getPackageName())); + }); + } +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ResolvedType.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ResolvedType.java similarity index 83% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ResolvedType.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ResolvedType.java index 65d4547e263..60af166391c 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/ResolvedType.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/ResolvedType.java @@ -14,7 +14,7 @@ limitations under the License. ============================================================================== */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; import com.squareup.javapoet.ArrayTypeName; import com.squareup.javapoet.ClassName; @@ -22,8 +22,6 @@ import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeVariableName; import com.squareup.javapoet.WildcardTypeName; -import org.tensorflow.Names; - import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; @@ -40,6 +38,9 @@ final class ResolvedType { /** The type for jni/attribute setting use. */ final TypeName jniType; + /** The type of the attribute, for accessors, if supported. */ + final AttributeType attributeType; + /** * Whether this type should be made iterable when used. * @@ -47,7 +48,7 @@ final class ResolvedType { */ final boolean iterable; - ResolvedType(TypeName javaType, TypeName jniType, boolean iterable) { + ResolvedType(TypeName javaType, TypeName jniType, AttributeType attributeType, boolean iterable) { if (javaType == null) { throw new NullPointerException("Can't create with a null javaType"); } @@ -58,50 +59,51 @@ final class ResolvedType { this.javaType = javaType; this.jniType = jniType; this.iterable = iterable; + this.attributeType = attributeType; + } + + ResolvedType(TypeName javaType, TypeName jniType, boolean iterable) { + this(javaType, jniType, null, iterable); + } + + ResolvedType(TypeName javaType, TypeName jniType, AttributeType attributeType) { + this(javaType, jniType, attributeType, false); } ResolvedType(TypeName javaType, TypeName jniType) { - this(javaType, jniType, false); + this(javaType, jniType, null, false); } - ResolvedType(TypeName type, boolean iterable) { + ResolvedType(TypeName type, AttributeType attributeType, boolean iterable) { if (type == null) { throw new NullPointerException("Can't create with a null type"); } if (type.isPrimitive()) { this.javaType = type.box(); - jniType = type; } else { this.javaType = type; - this.jniType = type; } + jniType = type; this.iterable = iterable; + this.attributeType = attributeType; } - ResolvedType(TypeName type) { - this(type, false); - } - - ResolvedType(Class javaType, Class jniType, boolean iterable) { - this(TypeName.get(javaType), TypeName.get(jniType), iterable); - } - - ResolvedType(Class javaType, Class jniType) { - this(TypeName.get(javaType), TypeName.get(jniType), false); + ResolvedType(TypeName type, boolean iterable) { + this(type, (AttributeType) null, iterable); } - ResolvedType(Class type, boolean iterable) { - this(TypeName.get(type), iterable); + ResolvedType(TypeName type, AttributeType attributeType) { + this(type, attributeType, false); } - ResolvedType(Class type) { + ResolvedType(TypeName type) { this(type, false); } /** Returns a copy of this type with the specified {@code iterable} value. */ ResolvedType withIterable(boolean iterable) { - return new ResolvedType(javaType, jniType, iterable); + return new ResolvedType(javaType, jniType, attributeType, iterable); } /** Get the unboxed version of {@code javaType} if it is a boxed primitive. */ @@ -121,7 +123,7 @@ ResolvedType arrayIfIterable() { } else { newJType = javaType; } - return new ResolvedType(newJType, jniType, iterable); + return new ResolvedType(newJType, jniType, attributeType, iterable); } /** Return a copy, wrapping {@code javaType} in {@link Iterable} if this type is iterable. */ @@ -132,7 +134,7 @@ ResolvedType iterableIfIterable() { } else { newJType = javaType; } - return new ResolvedType(newJType, jniType, iterable); + return new ResolvedType(newJType, jniType, attributeType, iterable); } /** Return a copy, wrapping {@code javaType} in {@link List} if this type is iterable. */ @@ -143,7 +145,7 @@ ResolvedType listIfIterable() { } else { newJType = javaType; } - return new ResolvedType(newJType, jniType, iterable); + return new ResolvedType(newJType, jniType, attributeType, iterable); } /** True if wrapping will be done by {@link #classIfGeneric()} */ @@ -162,7 +164,7 @@ ResolvedType classIfGeneric() { } else { newJType = javaType; } - return new ResolvedType(newJType, jniType, iterable); + return new ResolvedType(newJType, jniType, attributeType, iterable); } /** Recursively get all type variable names in {@code javaType}. */ diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/StatefulPair.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/StatefulPair.java similarity index 98% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/StatefulPair.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/StatefulPair.java index 246eb3878f6..580d23c6ab4 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/StatefulPair.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/StatefulPair.java @@ -13,7 +13,7 @@ limitations under the License. ======================================================================= */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; import com.squareup.javapoet.TypeSpec; import java.util.ArrayList; @@ -21,7 +21,7 @@ import java.util.List; import java.util.StringJoiner; -public final class StatefulPair { +final class StatefulPair { public final FullOpDef statefulOp; public final FullOpDef statelessOp; public final String selectorClassName; diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/TypeResolver.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/TypeResolver.java similarity index 92% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/TypeResolver.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/TypeResolver.java index f24813598ce..92dd7c951c7 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/TypeResolver.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/TypeResolver.java @@ -14,25 +14,23 @@ limitations under the License. ============================================================================== */ -package org.tensorflow.op.generator; +package org.tensorflow.generator.op; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeVariableName; import com.squareup.javapoet.WildcardTypeName; -import org.tensorflow.Names; -import org.tensorflow.proto.framework.AttrValue; -import org.tensorflow.proto.framework.DataType; -import org.tensorflow.proto.framework.OpDef; -import org.tensorflow.proto.framework.OpDef.ArgDef; -import org.tensorflow.proto.framework.OpDef.AttrDef; - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.tensorflow.proto.AttrValue; +import org.tensorflow.proto.DataType; +import org.tensorflow.proto.OpDef; +import org.tensorflow.proto.OpDef.ArgDef; +import org.tensorflow.proto.OpDef.AttrDef; /** * A utility class to handle type calculations for a {@link ClassGenerator}. Should be one to one @@ -42,6 +40,7 @@ final class TypeResolver { static TypeName WILDCARD = WildcardTypeName.subtypeOf(TypeName.OBJECT); static TypeName STRING = TypeName.get(java.lang.String.class); + /** Data types that are real numbers. */ private static final Set realNumberTypes = new HashSet<>(); @@ -67,16 +66,20 @@ final class TypeResolver { /** The op def to get types for. */ private final OpDef op; + /** The processed argument types. */ private final Map argTypes = new HashMap<>(); + /** Known types. Not simply a cache. */ private final Map known = new HashMap<>(); + /** * Attributes that were reached while getting the types of inputs. * *

    These are excluded from factory methods. */ private final Set reachedFromInput = new HashSet<>(); + private char nextGenericLetter = 'T'; TypeResolver(OpDef op) { @@ -225,30 +228,31 @@ private ResolvedType typeOf(AttrDef attr, boolean fromInput) { switch (typeName) { case "string": - types = new ResolvedType(STRING); + types = new ResolvedType(STRING, AttributeType.STRING); break; case "int": - types = new ResolvedType(TypeName.LONG); + types = new ResolvedType(TypeName.LONG, AttributeType.INT); break; case "float": - types = new ResolvedType(TypeName.FLOAT); + types = new ResolvedType(TypeName.FLOAT, AttributeType.FLOAT); break; case "bool": - types = new ResolvedType(TypeName.BOOLEAN); + types = new ResolvedType(TypeName.BOOLEAN, AttributeType.BOOL); break; case "shape": - types = new ResolvedType(Names.Shape); + types = new ResolvedType(Names.Shape, AttributeType.SHAPE); break; case "tensor": - types = new ResolvedType(Names.Tensor); + types = new ResolvedType(Names.Tensor, AttributeType.TENSOR); break; case "type": TypeName family = typeFamily(attr); TypeName type = iterable ? WildcardTypeName.subtypeOf(family) : nextGeneric().withBounds(family); - types = new ResolvedType(type, TypeName.get(DataType.class)); + types = new ResolvedType(type, TypeName.get(DataType.class), AttributeType.TYPE); break; case "func": + // TODO add attribute type once supported types = new ResolvedType(Names.ConcreteFunction); break; default: diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/CoreJavaDocNodeRenderer.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/CoreJavaDocNodeRenderer.java similarity index 96% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/CoreJavaDocNodeRenderer.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/CoreJavaDocNodeRenderer.java index c5c7866af5c..37c26c2a292 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/CoreJavaDocNodeRenderer.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/CoreJavaDocNodeRenderer.java @@ -1,9 +1,8 @@ -package org.tensorflow.op.generator.javadoc; +package org.tensorflow.generator.op.javadoc; import com.google.common.base.CaseFormat; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; @@ -152,14 +151,11 @@ public class CoreJavaDocNodeRenderer extends AbstractVisitor implements NodeRend }; private static final Set allowedHtml5Tags = new HashSet<>(Arrays.asList(html5Tags)); private static final Map urlLinkConversion = - new HashMap() { - { - put("../../../api_docs/python/math_ops", "org.tensorflow.op.MathOps"); - put( - "https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update", + Map.of( + "../../../api_docs/python/math_ops", "org.tensorflow.op.MathOps", + "https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update", "org.tensorflow.op.Ops#tensorScatterNdUpdate"); - } - }; + protected final JavaDocNodeRendererContext context; private final JavaDocWriter writer; private boolean firstParagraph; @@ -291,8 +287,7 @@ public void visit(ThematicBreak thematicBreak) { @Override public void visit(IndentedCodeBlock indentedCodeBlock) { - renderCodeBlock( - indentedCodeBlock.getLiteral(), indentedCodeBlock, Collections.emptyMap()); + renderCodeBlock(indentedCodeBlock.getLiteral(), indentedCodeBlock, Collections.emptyMap()); } @Override @@ -432,7 +427,7 @@ public void visit(Code code) { public void visit(HtmlInline htmlInline) { String text = htmlInline.getLiteral(); // handle non- JavaDoc html, e.g. - String tag = text.replace("\\", ""); + String tag = text.replace("/", ""); if (!allowedHtml5Tags.contains(tag.toLowerCase())) { text = text.replace("<", "<").replace(">", ">"); writer.raw(text); diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererContext.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererContext.java new file mode 100644 index 00000000000..80767db57ac --- /dev/null +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererContext.java @@ -0,0 +1,76 @@ +package org.tensorflow.generator.op.javadoc; + +import java.util.Map; +import org.commonmark.node.Image; +import org.commonmark.node.Link; +import org.commonmark.node.Node; +import org.commonmark.renderer.html.UrlSanitizer; + +public interface JavaDocNodeRendererContext { + + /** + * Encode a URL into a String. + * + * @param url to be encoded + * @return an encoded URL (depending on the configuration) + */ + String encodeUrl(String url); + + /** + * Let extensions modify the HTML tag attributes. + * + * @param node the node for which the attributes are applied + * @param tagName the HTML tag name that these attributes are for (e.g. {@code h1}, {@code pre}, + * {@code code}). + * @param attributes the attributes that were calculated by the renderer + * @return the extended attributes with added/updated/removed entries + */ + Map extendAttributes(Node node, String tagName, Map attributes); + + /** + * Gets the HTML writer. + * + * @return the HTML writer to use + */ + JavaDocWriter getWriter(); + + /** + * The HTML for a line break. + * + * @return HTML that should be rendered for a soft line break + */ + String getSoftbreak(); + + /** + * Render the specified node and its children using the configured renderers. This should be used + * to render child nodes; be careful not to pass the node that is being rendered, that would + * result in an endless loop. + * + * @param node the node to render + */ + void render(Node node); + + /** + * Should HTML be escaped? + * + * @return whether HTML blocks and tags should be escaped or not + */ + boolean shouldEscapeHtml(); + + /** + * Should URLs be sanitized? + * + * @return true if the {@link UrlSanitizer} should be used. + * @since 0.14.0 + */ + boolean shouldSanitizeUrls(); + + /** + * Gets the URL sanitizer. + * + * @return Sanitizer to use for securing {@link Link} href and {@link Image} src if {@link + * #shouldSanitizeUrls()} is true. + * @since 0.14.0 + */ + UrlSanitizer urlSanitizer(); +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererFactory.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererFactory.java similarity index 90% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererFactory.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererFactory.java index b48020db6cd..4654e13ca9e 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererFactory.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocNodeRendererFactory.java @@ -1,4 +1,4 @@ -package org.tensorflow.op.generator.javadoc; +package org.tensorflow.generator.op.javadoc; import org.commonmark.renderer.NodeRenderer; diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocRenderer.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocRenderer.java similarity index 92% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocRenderer.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocRenderer.java index 9a4861b2220..33b0aaf87b3 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocRenderer.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocRenderer.java @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. =======================================================================*/ -package org.tensorflow.op.generator.javadoc; +package org.tensorflow.generator.op.javadoc; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -65,13 +65,7 @@ private JavaDocRenderer(Builder builder) { this.nodeRendererFactories = new ArrayList<>(builder.nodeRendererFactories.size() + 1); this.nodeRendererFactories.addAll(builder.nodeRendererFactories); // Add as last. This means clients can override the rendering of core nodes if they want. - this.nodeRendererFactories.add( - new JavaDocNodeRendererFactory() { - @Override - public NodeRenderer create(JavaDocNodeRendererContext context) { - return new CoreJavaDocNodeRenderer(context); - } - }); + this.nodeRendererFactories.add(CoreJavaDocNodeRenderer::new); } /** @@ -102,17 +96,13 @@ public String render(Node node) { return sb.toString(); } - /** - * Extension for {@link JavaDocRenderer}. - */ + /** Extension for {@link JavaDocRenderer}. */ public interface JavaDocRendererExtension extends Extension { void extend(Builder rendererBuilder); } - /** - * Builder for configuring an {@link JavaDocRenderer}. See methods for default configuration. - */ + /** Builder for configuring an {@link JavaDocRenderer}. See methods for default configuration. */ public static class Builder { private final List attributeProviderFactories = new ArrayList<>(); @@ -131,8 +121,8 @@ public JavaDocRenderer build() { } /** - * The HTML to use for rendering a softbreak, defaults to {@code "\n"} (meaning the rendered result doesn't have a - * line break). + * The HTML to use for rendering a softbreak, defaults to {@code "\n"} (meaning the rendered + * result doesn't have a line break). * *

    Set it to {@code "
    "} (or {@code "
    "} to make them hard breaks. * @@ -147,10 +137,12 @@ public Builder softbreak(String softbreak) { } /** - * Whether {@link HtmlInline} and {@link HtmlBlock} should be escaped, defaults to {@code false}. + * Whether {@link HtmlInline} and {@link HtmlBlock} should be escaped, defaults to {@code + * false}. * *

    Note that {@link HtmlInline} is only a tag itself, not the text between an opening tag and - * a closing tag. So markup in the text will be parsed as normal and is not affected by this option. + * a closing tag. So markup in the text will be parsed as normal and is not affected by this + * option. * * @param escapeJavaDoc true for escaping, false for preserving raw HTML * @return {@code this} @@ -161,7 +153,8 @@ public Builder escapeJavaDoc(boolean escapeJavaDoc) { } /** - * Whether {@link Image} src and {@link Link} href should be sanitized, defaults to {@code false}. + * Whether {@link Image} src and {@link Link} href should be sanitized, defaults to {@code + * false}. * * @param sanitizeUrls true for sanitization, false for preserving raw attribute * @return {@code this} @@ -206,7 +199,8 @@ public Builder percentEncodeUrls(boolean percentEncodeUrls) { } /** - * Add a factory for an attribute provider for adding/changing HTML attributes to the rendered tags. + * Add a factory for an attribute provider for adding/changing HTML attributes to the rendered + * tags. * * @param attributeProviderFactory the attribute provider factory to add * @return {@code this} @@ -220,12 +214,12 @@ public Builder attributeProviderFactory(AttributeProviderFactory attributeProvid } /** - * Add a factory for instantiating a node renderer (done when rendering). This allows to override the rendering of - * node types or define rendering for custom node types. + * Add a factory for instantiating a node renderer (done when rendering). This allows to + * override the rendering of node types or define rendering for custom node types. * *

    If multiple node renderers for the same node type are created, the one from the factory - * that was added first "wins". (This is how the rendering for core node types can be overridden; the default - * rendering comes last.) + * that was added first "wins". (This is how the rendering for core node types can be + * overridden; the default rendering comes last.) * * @param nodeRendererFactory the factory for creating a node renderer * @return {@code this} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocWriter.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocWriter.java similarity index 97% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocWriter.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocWriter.java index ca19c1b4d38..d5d73df3f0b 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocWriter.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/javadoc/JavaDocWriter.java @@ -1,4 +1,4 @@ -package org.tensorflow.op.generator.javadoc; +package org.tensorflow.generator.op.javadoc; import java.io.IOException; import java.util.Collections; diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/processor/OperatorProcessor.java similarity index 92% rename from tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java rename to tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/processor/OperatorProcessor.java index 2a33483cb7b..5376d45027b 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/generator/op/processor/OperatorProcessor.java @@ -13,7 +13,7 @@ limitations under the License. ======================================================================= */ -package org.tensorflow.processor.operator; +package org.tensorflow.generator.op.processor; import com.github.javaparser.ast.comments.JavadocComment; import com.github.javaparser.javadoc.Javadoc; @@ -62,7 +62,7 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import javax.tools.Diagnostic.Kind; -import org.tensorflow.Names; +import org.tensorflow.generator.op.Names; /** * A compile-time Processor that aggregates classes annotated with {@code @@ -155,6 +155,7 @@ public Set getSupportedAnnotationTypes() { } private static class OpsSpec { + private static final Comparator PARAMETER_SPEC_COMPARATOR = (o1, o2) -> { if (o1.parameters.size() > o2.parameters.size()) { @@ -198,7 +199,7 @@ private static class OpsSpec { Pattern.compile("@(?:param|return|throws|exception|see|deprecated)\\s+.*"); private static final String LICENSE = - "Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n" + "Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved.\n" + "\n" + "Licensed under the Apache License, Version 2.0 (the \"License\");\n" + "you may not use this file except in compliance with the License.\n" @@ -458,8 +459,7 @@ private static TypeSpec buildGroupClass(OpsSpec spec) { TypeSpec.classBuilder(spec.className) .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addJavadoc( - "An API for building {@code $L} operations as {@link $T Op}s\n\n" - + "@see {@link $T}\n", + "An API for building {@code $L} operations as {@link $T Op}s\n\n" + "@see $T\n", spec.groupName, Names.Op, Names.Ops) @@ -495,7 +495,6 @@ private static TypeSpec buildTopClass(OpsSpec spec) { MethodSpec.Builder ctorBuilder = MethodSpec.constructorBuilder() .addParameter(Names.Scope, "scope") - .addModifiers(Modifier.PRIVATE) .addStatement("this.scope = scope", Names.Scope); TypeSpec.Builder opsBuilder = @@ -546,7 +545,7 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addStatement("return new $T(scope.withSubScope(childScopeName))", Names.Ops) .addJavadoc( "Returns an API that builds operations with the provided name prefix.\n" - + "\n@see {@link $T#withSubScope(String)}\n", + + "\n@see $T#withSubScope(String)\n", Names.Scope) .build()); @@ -561,26 +560,7 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addModifiers(Modifier.PUBLIC) .returns(Names.Ops) .addStatement("return new $T(scope.withInitScope())", Names.Ops) - .addJavadoc( - "Returns an API that builds init operations. {@link #liftToInitScope(Operand)} will be called for all created operations.\n" - + initScopeComment - + "\n@see #liftToInitScope(Operand)") - .build()); - - TypeVariableName T = TypeVariableName.get("T").withBounds(Names.Operand); - opsBuilder.addMethod( - MethodSpec.methodBuilder("liftToInitScope") - .addTypeVariable(T) - .addModifiers(Modifier.PUBLIC) - .addParameter(T, "op") - .returns(T) - .addStatement("scope.env().registerInitOp(op.op())") - .addStatement("return op") - .addJavadoc( - "Make {@code op} an init operation, doing the same for all of it's inputs (and control inputs).\n" - + initScopeComment - + "\n@see ExecutionEnvironment#registerInitOp(Operation)\n" - + "\n@throws IllegalStateException if the op or one of its inputs can't be made an init op.") + .addJavadoc("Returns an API that builds init operations.\n" + initScopeComment) .build()); opsBuilder.addMethod( @@ -591,7 +571,7 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addStatement("return new Ops(scope.withName(opName))") .addJavadoc( "Returns an API that uses the provided name for an op.\n\n" - + "@see {@link $T#withName(String)}\n", + + "@see $T#withName(String)\n", Names.Scope) .build()); @@ -603,7 +583,7 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addStatement("return new Ops(scope.withDevice(deviceSpec))") .addJavadoc( "Returns an API that places the created operations on the device(s) matching the provided spec.\n\n" - + "@see {@link $T#withDevice(DeviceSpec)}\n", + + "@see $T#withDevice(DeviceSpec)\n", Names.Scope) .build()); @@ -615,7 +595,45 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addStatement("return new Ops(scope.withControlDependencies(controls))") .addJavadoc( "Returns an API that adds operations to the graph with the provided control dependencies.\n\n" - + "@see {@link $T#withControlDependencies(Iterable>)}\n", + + "@see $T#withControlDependencies(Iterable)\n", + Names.Scope) + .build()); + + opsBuilder.addMethod( + MethodSpec.methodBuilder("withControlDependencies") + .addModifiers(Modifier.PUBLIC) + .addParameter(Names.ArrayOp, "controls") + .varargs() + .returns(Names.Ops) + .addStatement("return withControlDependencies($T.asList(controls))", Names.Arrays) + .addJavadoc( + "Returns an API that adds operations to the graph with the provided control dependencies.\n\n" + + "@see $T#withControlDependencies(Iterable)\n", + Names.Scope) + .build()); + + opsBuilder.addMethod( + MethodSpec.methodBuilder("withControlDependencyOps") + .addModifiers(Modifier.PUBLIC) + .addParameter(Names.IterableOperation, "controls") + .returns(Names.Ops) + .addStatement("return new Ops(scope.withControlDependencyOps(controls))") + .addJavadoc( + "Returns an API that adds operations to the graph with the provided control dependencies.\n\n" + + "@see $T#withControlDependencyOps(Iterable)\n", + Names.Scope) + .build()); + + opsBuilder.addMethod( + MethodSpec.methodBuilder("withControlDependencyOps") + .addModifiers(Modifier.PUBLIC) + .addParameter(Names.ArrayOperation, "controls") + .varargs() + .returns(Names.Ops) + .addStatement("return withControlDependencyOps($T.asList(controls))", Names.Arrays) + .addJavadoc( + "Returns an API that adds operations to the graph with the provided control dependencies.\n\n" + + "@see $T#withControlDependencyOps(Iterable)\n", Names.Scope) .build()); @@ -637,7 +655,7 @@ private static TypeSpec buildTopClass(OpsSpec spec) { .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .addParameter(Names.ExecutionEnvironment, "env") .returns(Names.Ops) - .addStatement("return new Ops(env.baseScope())", Names.Scope) + .addStatement("return new Ops(env.baseScope())") .addJavadoc( "Creates an API for building operations in the provided execution environment\n") .build()); diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/OpGenerator.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/OpGenerator.java deleted file mode 100644 index 9dc597c7f74..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/OpGenerator.java +++ /dev/null @@ -1,261 +0,0 @@ -/* Copyright 2021 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. -======================================================================= -*/ -package org.tensorflow.op.generator; - -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.UnknownFieldSet; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.TypeSpec; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.StandardOpenOption; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.tensorflow.proto.framework.ApiDef; -import org.tensorflow.proto.framework.OpDef; -import org.tensorflow.proto.framework.OpList; - -public final class OpGenerator { - - private static final String LICENSE = - "/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n" - + "\n" - + "Licensed under the Apache License, Version 2.0 (the \"License\");\n" - + "you may not use this file except in compliance with the License.\n" - + "You may obtain a copy of the License at\n" - + "\n" - + " http://www.apache.org/licenses/LICENSE-2.0\n" - + "\n" - + "Unless required by applicable law or agreed to in writing, software\n" - + "distributed under the License is distributed on an \"AS IS\" BASIS,\n" - + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" - + "See the License for the specific language governing permissions and\n" - + "limitations under the License.\n" - + "=======================================================================*/" - + "\n"; - - private static final String HELP_TEXT = "Args should be: [base_package]"; - - private static final int API_DEF_FIELD_NUMBER = 100; - - /** - * Args should be {@code [base_package]}. - * - *

    {@code base_package} is {@code org.tensorflow.op} by default. - * - *

    Will delete everything in {@code outputDir}. - */ - public static void main(String[] args) { - - if (args[0].equals("--help")) { - System.out.println(HELP_TEXT); - return; - } - - if (args.length < 2) { - System.err.println(HELP_TEXT); - System.exit(1); - } - - File outputDir = new File(args[0]); - File inputFile = new File(args[1]); - - if (!inputFile.exists()) { - System.err.println("Op def file " + inputFile + " does not exist."); - System.exit(1); - } - - if (!inputFile.isFile()) { - System.err.println("Op def file " + inputFile + " is not a file."); - System.exit(1); - } - - if (!inputFile.canRead()) { - System.err.println("Can't read Op def file " + inputFile + "."); - System.exit(1); - } - - String packageName = "org.tensorflow.op"; - - if (args.length > 2) { - packageName = args[2]; - } - - File basePackage = new File(outputDir, packageName.replace('.', '/')); - - if (basePackage.exists()) { - try { - Files.walkFileTree( - basePackage.toPath(), - new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) - throws IOException { - Files.delete(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) - throws IOException { - Files.delete(dir); - return FileVisitResult.CONTINUE; - } - }); - } catch (IOException ignored) { - - } - } - - generate(outputDir, packageName, inputFile); - } - - /** Build the list of ops and api defs, then call {@link #generate(File, String, Map)} */ - private static void generate(File outputDir, String packageName, File opDefs) { - OpList opList = null; - try { - opList = OpList.parseFrom(new FileInputStream(opDefs)); - } catch (FileNotFoundException e) { - // already checked in main, shouldn't happen here - System.err.println("Op def file " + opDefs + " not found."); - System.exit(1); - } catch (IOException e) { - throw new RuntimeException( - "Error parsing op def file " - + opDefs - + ", was it generated by op_export_main.cc (in tensorflow-core-api)?", - e); - } - Map defs = new LinkedHashMap<>(opList.getOpCount()); - - for (OpDef op : opList.getOpList()) { - try { - if (!op.getUnknownFields().hasField(API_DEF_FIELD_NUMBER)) { - throw new RuntimeException( - "No attached ApiDef for op " - + op.getName() - + ", was " - + opDefs - + " generated by op_export_main.cc (in tensorflow-core-api)? The op's ApiDef should be" - + " attached as unknown field " - + API_DEF_FIELD_NUMBER - + "."); - } - ApiDef api = - ApiDef.parseFrom( - op.getUnknownFields() - .getField(API_DEF_FIELD_NUMBER) - .getLengthDelimitedList() - .get(0)); - defs.put( - op.toBuilder().setUnknownFields(UnknownFieldSet.newBuilder().build()).build(), api); - } catch (InvalidProtocolBufferException e) { - throw new RuntimeException( - "Could not parse attached ApiDef for op " - + op.getName() - + ", was " - + opDefs - + " generated by op_export_main.cc (in tensorflow-core-api)?", - e); - } - } - - generate(outputDir, packageName, defs); - } - - private static void writeToFile(TypeSpec spec, File outputDir, String packageName) { - JavaFile file = - JavaFile.builder(packageName, spec).indent(" ").skipJavaLangImports(true).build(); - - File outputFile = - new File(outputDir, packageName.replace('.', '/') + '/' + spec.name + ".java"); - outputFile.getParentFile().mkdirs(); - try { - StringBuilder builder = new StringBuilder(); - builder.append(LICENSE + '\n'); - builder.append("// This class has been generated, DO NOT EDIT!\n\n"); - file.writeTo(builder); - - Files.write( - outputFile.toPath(), - builder.toString().getBytes(StandardCharsets.UTF_8), - StandardOpenOption.WRITE, - StandardOpenOption.CREATE, - StandardOpenOption.TRUNCATE_EXISTING); - } catch (IOException ioException) { - throw new IllegalStateException("Failed to write file " + outputFile, ioException); - } - } - - /** Generate all the ops that pass {@link ClassGenerator#canGenerateOp(OpDef, ApiDef)}. */ - private static void generate(File outputDir, String basePackage, Map ops) { - List fullOps = - ops.entrySet().stream() - .filter(e -> ClassGenerator.canGenerateOp(e.getKey(), e.getValue())) - .flatMap( - (entry) -> - entry.getValue().getEndpointList().stream() - .map( - (endpoint) -> { - String name; - String pack; - - int pos = endpoint.getName().lastIndexOf('.'); - if (pos > -1) { - pack = endpoint.getName().substring(0, pos); - name = endpoint.getName().substring(pos + 1); - } else { - pack = "core"; - name = endpoint.getName(); - } - - return new FullOpDef( - entry.getKey(), - entry.getValue(), - basePackage, - basePackage + "." + pack, - pack, - name, - endpoint); - })) - .collect(Collectors.toList()); - - List statefulPairs = StatefulPair.extractStatefulPairs(fullOps); - - fullOps.forEach( - (def) -> { - TypeSpec spec = def.buildOpClass(); - - writeToFile(spec, outputDir, def.packageName); - }); - - statefulPairs.forEach( - (pair) -> { - pair.buildOpClasses() - .forEach((spec) -> writeToFile(spec, outputDir, pair.getPackageName())); - }); - } -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererContext.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererContext.java deleted file mode 100644 index 7fdd04607af..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/op/generator/javadoc/JavaDocNodeRendererContext.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.tensorflow.op.generator.javadoc; - -import java.util.Map; -import org.commonmark.node.Image; -import org.commonmark.node.Link; -import org.commonmark.node.Node; -import org.commonmark.renderer.html.UrlSanitizer; - -public interface JavaDocNodeRendererContext { - - /** - * @param url to be encoded - * @return an encoded URL (depending on the configuration) - */ - String encodeUrl(String url); - - /** - * Let extensions modify the HTML tag attributes. - * - * @param node the node for which the attributes are applied - * @param tagName the HTML tag name that these attributes are for (e.g. {@code h1}, {@code pre}, {@code code}). - * @param attributes the attributes that were calculated by the renderer - * @return the extended attributes with added/updated/removed entries - */ - Map extendAttributes(Node node, String tagName, Map attributes); - - /** - * @return the HTML writer to use - */ - JavaDocWriter getWriter(); - - /** - * @return HTML that should be rendered for a soft line break - */ - String getSoftbreak(); - - /** - * Render the specified node and its children using the configured renderers. This should be used to render child - * nodes; be careful not to pass the node that is being rendered, that would result in an endless loop. - * - * @param node the node to render - */ - void render(Node node); - - /** - * @return whether HTML blocks and tags should be escaped or not - */ - boolean shouldEscapeHtml(); - - /** - * @return true if the {@link UrlSanitizer} should be used. - * @since 0.14.0 - */ - boolean shouldSanitizeUrls(); - - /** - * @return Sanitizer to use for securing {@link Link} href and {@link Image} src if {@link #shouldSanitizeUrls()} is - * true. - * @since 0.14.0 - */ - UrlSanitizer urlSanitizer(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDef.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDef.java deleted file mode 100644 index 0abecb69bc2..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDef.java +++ /dev/null @@ -1,6711 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -/** - *

    - * Used to specify and override the default API & behavior in the
    - * generated code for client languages, from what you would get from
    - * the OpDef alone. There will be a set of ApiDefs that are common
    - * to all client languages, and another set per client language.
    - * The per-client-language ApiDefs will inherit values from the
    - * common ApiDefs which it can either replace or modify.
    - * We separate the API definition from the OpDef so we can evolve the
    - * API while remaining backwards compatible when interpretting old
    - * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    - * ApiDefs message.
    - * WARNING: Be *very* careful changing the API for any existing op --
    - * you can change the semantics of existing code.  These changes may
    - * need to wait until a major release of TensorFlow to avoid breaking
    - * our compatibility promises.
    - * 
    - * - * Protobuf type {@code tensorflow.ApiDef} - */ -public final class ApiDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef) - ApiDefOrBuilder { -private static final long serialVersionUID = 0L; - - // Use ApiDef.newBuilder() to construct. - private ApiDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ApiDef() { - graphOpName_ = ""; - deprecationMessage_ = ""; - visibility_ = 0; - endpoint_ = java.util.Collections.emptyList(); - inArg_ = java.util.Collections.emptyList(); - outArg_ = java.util.Collections.emptyList(); - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - attr_ = java.util.Collections.emptyList(); - summary_ = ""; - description_ = ""; - descriptionPrefix_ = ""; - descriptionSuffix_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new ApiDef(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private ApiDef( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - graphOpName_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - visibility_ = rawValue; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - endpoint_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - endpoint_.add( - input.readMessage(Endpoint.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - inArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - inArg_.add( - input.readMessage(Arg.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - outArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - outArg_.add( - input.readMessage(Arg.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - attr_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - attr_.add( - input.readMessage(Attr.parser(), extensionRegistry)); - break; - } - case 58: { - String s = input.readStringRequireUtf8(); - - summary_ = s; - break; - } - case 66: { - String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 74: { - String s = input.readStringRequireUtf8(); - - descriptionPrefix_ = s; - break; - } - case 82: { - String s = input.readStringRequireUtf8(); - - descriptionSuffix_ = s; - break; - } - case 90: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - argOrder_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - argOrder_.add(s); - break; - } - case 98: { - String s = input.readStringRequireUtf8(); - - deprecationMessage_ = s; - break; - } - case 104: { - - deprecationVersion_ = input.readInt32(); - 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)) { - endpoint_ = java.util.Collections.unmodifiableList(endpoint_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - inArg_ = java.util.Collections.unmodifiableList(inArg_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - outArg_ = java.util.Collections.unmodifiableList(outArg_); - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - argOrder_ = argOrder_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ApiDef.class, Builder.class); - } - - /** - * Protobuf enum {@code tensorflow.ApiDef.Visibility} - */ - public enum Visibility - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -     * Normally this is "VISIBLE" unless you are inheriting a
    -     * different value from another ApiDef.
    -     * 
    - * - * DEFAULT_VISIBILITY = 0; - */ - DEFAULT_VISIBILITY(0), - /** - *
    -     * Publicly visible in the API.
    -     * 
    - * - * VISIBLE = 1; - */ - VISIBLE(1), - /** - *
    -     * Do not include this op in the generated API. If visibility is
    -     * set to 'SKIP', other fields are ignored for this op.
    -     * 
    - * - * SKIP = 2; - */ - SKIP(2), - /** - *
    -     * Hide this op by putting it into an internal namespace (or whatever
    -     * is appropriate in the target language).
    -     * 
    - * - * HIDDEN = 3; - */ - HIDDEN(3), - UNRECOGNIZED(-1), - ; - - /** - *
    -     * Normally this is "VISIBLE" unless you are inheriting a
    -     * different value from another ApiDef.
    -     * 
    - * - * DEFAULT_VISIBILITY = 0; - */ - public static final int DEFAULT_VISIBILITY_VALUE = 0; - /** - *
    -     * Publicly visible in the API.
    -     * 
    - * - * VISIBLE = 1; - */ - public static final int VISIBLE_VALUE = 1; - /** - *
    -     * Do not include this op in the generated API. If visibility is
    -     * set to 'SKIP', other fields are ignored for this op.
    -     * 
    - * - * SKIP = 2; - */ - public static final int SKIP_VALUE = 2; - /** - *
    -     * Hide this op by putting it into an internal namespace (or whatever
    -     * is appropriate in the target language).
    -     * 
    - * - * HIDDEN = 3; - */ - public static final int HIDDEN_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @Deprecated - public static Visibility valueOf(int value) { - return forNumber(value); - } - - public static Visibility forNumber(int value) { - switch (value) { - case 0: return DEFAULT_VISIBILITY; - case 1: return VISIBLE; - case 2: return SKIP; - case 3: return HIDDEN; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap< - Visibility> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Visibility findValueByNumber(int number) { - return Visibility.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 ApiDef.getDescriptor().getEnumTypes().get(0); - } - - private static final Visibility[] VALUES = values(); - - public static Visibility valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private Visibility(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.ApiDef.Visibility) - } - - public interface EndpointOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Endpoint) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - String getName(); - - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Set if this endpoint is deprecated. If set to true, a message suggesting
    -     * to use a non-deprecated endpoint instead will be printed. If all
    -     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -     * 
    - * - * bool deprecated = 3; - */ - boolean getDeprecated(); - - /** - *
    -     * Major version when an endpoint will be deleted. For e.g. set this
    -     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 4; - */ - int getDeprecationVersion(); - } - - /** - *
    -   * If you specify any endpoint, this will replace all of the
    -   * inherited endpoints.  The first endpoint should be the
    -   * "canonical" endpoint, and should not be deprecated (unless all
    -   * endpoints are deprecated).
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Endpoint} - */ - public static final class Endpoint extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Endpoint) - EndpointOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use Endpoint.newBuilder() to construct. - private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Endpoint() { - name_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new Endpoint(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private Endpoint( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 24: { - - deprecated_ = input.readBool(); - break; - } - case 32: { - - deprecationVersion_ = input.readInt32(); - 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 ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Endpoint.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -     * Name should be either like "CamelCaseName" or
    -     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -     * use a snake_case convention instead of CamelCase.
    -     * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPRECATED_FIELD_NUMBER = 3; - private boolean deprecated_; - - /** - *
    -     * Set if this endpoint is deprecated. If set to true, a message suggesting
    -     * to use a non-deprecated endpoint instead will be printed. If all
    -     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -     * 
    - * - * bool deprecated = 3; - */ - public boolean getDeprecated() { - return deprecated_; - } - - public static final int DEPRECATION_VERSION_FIELD_NUMBER = 4; - private int deprecationVersion_; - - /** - *
    -     * Major version when an endpoint will be deleted. For e.g. set this
    -     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 4; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @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 (deprecated_ != false) { - output.writeBool(3, deprecated_); - } - if (deprecationVersion_ != 0) { - output.writeInt32(4, deprecationVersion_); - } - unknownFields.writeTo(output); - } - - @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 (deprecated_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, deprecated_); - } - if (deprecationVersion_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, deprecationVersion_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof Endpoint)) { - return super.equals(obj); - } - Endpoint other = (Endpoint) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (getDeprecated() - != other.getDeprecated()) return false; - if (getDeprecationVersion() - != other.getDeprecationVersion()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + DEPRECATED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDeprecated()); - hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationVersion(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static Endpoint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Endpoint parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Endpoint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Endpoint parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Endpoint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Endpoint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Endpoint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Endpoint 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 Endpoint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static Endpoint 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 Endpoint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Endpoint parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Endpoint prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * If you specify any endpoint, this will replace all of the
    -     * inherited endpoints.  The first endpoint should be the
    -     * "canonical" endpoint, and should not be deprecated (unless all
    -     * endpoints are deprecated).
    -     * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Endpoint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Endpoint) - EndpointOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Endpoint.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Endpoint.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - deprecated_ = false; - - deprecationVersion_ = 0; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; - } - - @Override - public Endpoint getDefaultInstanceForType() { - return Endpoint.getDefaultInstance(); - } - - @Override - public Endpoint build() { - Endpoint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Endpoint buildPartial() { - Endpoint result = new Endpoint(this); - result.name_ = name_; - result.deprecated_ = deprecated_; - result.deprecationVersion_ = deprecationVersion_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Endpoint) { - return mergeFrom((Endpoint) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(Endpoint other) { - if (other == Endpoint.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getDeprecated() != false) { - setDeprecated(other.getDeprecated()); - } - if (other.getDeprecationVersion() != 0) { - setDeprecationVersion(other.getDeprecationVersion()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Endpoint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Endpoint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - *
    -       * Name should be either like "CamelCaseName" or
    -       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    -       * use a snake_case convention instead of CamelCase.
    -       * 
    - * - * 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 boolean deprecated_ ; - - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public boolean getDeprecated() { - return deprecated_; - } - - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public Builder setDeprecated(boolean value) { - - deprecated_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Set if this endpoint is deprecated. If set to true, a message suggesting
    -       * to use a non-deprecated endpoint instead will be printed. If all
    -       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    -       * 
    - * - * bool deprecated = 3; - */ - public Builder clearDeprecated() { - - deprecated_ = false; - onChanged(); - return this; - } - - private int deprecationVersion_ ; - - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public Builder setDeprecationVersion(int value) { - - deprecationVersion_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Major version when an endpoint will be deleted. For e.g. set this
    -       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    -       * deprecated in versions before that.
    -       * 
    - * - * int32 deprecation_version = 4; - */ - public Builder clearDeprecationVersion() { - - deprecationVersion_ = 0; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Endpoint) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Endpoint) - private static final Endpoint DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new Endpoint(); - } - - public static Endpoint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public Endpoint parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Endpoint(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public Endpoint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ArgOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Arg) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - String getName(); - - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - String getRenameTo(); - - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - com.google.protobuf.ByteString - getRenameToBytes(); - - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - String getDescription(); - - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - } - - /** - * Protobuf type {@code tensorflow.ApiDef.Arg} - */ - public static final class Arg extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Arg) - ArgOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use Arg.newBuilder() to construct. - private Arg(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Arg() { - name_ = ""; - renameTo_ = ""; - description_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new Arg(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private Arg( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - renameTo_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - description_ = s; - 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 ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Arg.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RENAME_TO_FIELD_NUMBER = 2; - private volatile Object renameTo_; - - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public String getRenameTo() { - Object ref = renameTo_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } - } - - /** - *
    -     * Change the name used to access this arg in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile Object description_; - - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -     * Note: this will replace any inherited arg doc. There is no
    -     * current way of modifying arg descriptions (other than replacing
    -     * them entirely) as can be done with op descriptions.
    -     * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @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 (!getRenameToBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, renameTo_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - unknownFields.writeTo(output); - } - - @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 (!getRenameToBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, renameTo_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof Arg)) { - return super.equals(obj); - } - Arg other = (Arg) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!getRenameTo() - .equals(other.getRenameTo())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + RENAME_TO_FIELD_NUMBER; - hash = (53 * hash) + getRenameTo().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static Arg parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Arg parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Arg parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Arg parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Arg parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Arg parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Arg parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Arg 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 Arg parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static Arg 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 Arg parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Arg parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Arg prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code tensorflow.ApiDef.Arg} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Arg) - ArgOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Arg.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Arg.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - renameTo_ = ""; - - description_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; - } - - @Override - public Arg getDefaultInstanceForType() { - return Arg.getDefaultInstance(); - } - - @Override - public Arg build() { - Arg result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Arg buildPartial() { - Arg result = new Arg(this); - result.name_ = name_; - result.renameTo_ = renameTo_; - result.description_ = description_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Arg) { - return mergeFrom((Arg) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(Arg other) { - if (other == Arg.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getRenameTo().isEmpty()) { - renameTo_ = other.renameTo_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Arg parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Arg) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - * 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 Object renameTo_ = ""; - - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public String getRenameTo() { - Object ref = renameTo_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameTo( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - renameTo_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder clearRenameTo() { - - renameTo_ = getDefaultInstance().getRenameTo(); - onChanged(); - return this; - } - - /** - *
    -       * Change the name used to access this arg in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameToBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - renameTo_ = value; - onChanged(); - return this; - } - - private Object description_ = ""; - - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -       * Note: this will replace any inherited arg doc. There is no
    -       * current way of modifying arg descriptions (other than replacing
    -       * them entirely) as can be done with op descriptions.
    -       * 
    - * - * string description = 3; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Arg) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Arg) - private static final Arg DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new Arg(); - } - - public static Arg getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public Arg parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Arg(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public Arg getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AttrOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Attr) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - String getName(); - - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - String getRenameTo(); - - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - com.google.protobuf.ByteString - getRenameToBytes(); - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - boolean hasDefaultValue(); - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - AttrValue getDefaultValue(); - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - AttrValueOrBuilder getDefaultValueOrBuilder(); - - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - String getDescription(); - - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - } - - /** - *
    -   * Description of the graph-construction-time configuration of this
    -   * Op.  That is to say, this describes the attr fields that will
    -   * be specified in the NodeDef.
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Attr} - */ - public static final class Attr extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Attr) - AttrOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use Attr.newBuilder() to construct. - private Attr(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Attr() { - name_ = ""; - renameTo_ = ""; - description_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new Attr(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private Attr( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - renameTo_ = s; - break; - } - case 26: { - AttrValue.Builder subBuilder = null; - if (defaultValue_ != null) { - subBuilder = defaultValue_.toBuilder(); - } - defaultValue_ = input.readMessage(AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultValue_); - defaultValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - description_ = s; - 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 ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Attr.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RENAME_TO_FIELD_NUMBER = 2; - private volatile Object renameTo_; - - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public String getRenameTo() { - Object ref = renameTo_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } - } - - /** - *
    -     * Change the name used to access this attr in the API from what
    -     * is used in the GraphDef.  Note that these names in `backticks`
    -     * will also be replaced in the summary & description fields.
    -     * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; - private AttrValue defaultValue_; - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValue_ != null; - } - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue getDefaultValue() { - return defaultValue_ == null ? AttrValue.getDefaultInstance() : defaultValue_; - } - - /** - *
    -     * Specify a new default value to use for this attr.  This default
    -     * will be used when creating new graphs, as opposed to the
    -     * default in the OpDef, which will be used when interpreting old
    -     * GraphDefs.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValueOrBuilder getDefaultValueOrBuilder() { - return getDefaultValue(); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 4; - private volatile Object description_; - - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -     * Note: this will replace any inherited attr doc, there is no current
    -     * way of modifying attr descriptions as can be done with op descriptions.
    -     * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @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 (!getRenameToBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, renameTo_); - } - if (defaultValue_ != null) { - output.writeMessage(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); - } - unknownFields.writeTo(output); - } - - @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 (!getRenameToBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, renameTo_); - } - if (defaultValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof Attr)) { - return super.equals(obj); - } - Attr other = (Attr) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!getRenameTo() - .equals(other.getRenameTo())) return false; - if (hasDefaultValue() != other.hasDefaultValue()) return false; - if (hasDefaultValue()) { - if (!getDefaultValue() - .equals(other.getDefaultValue())) return false; - } - if (!getDescription() - .equals(other.getDescription())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + RENAME_TO_FIELD_NUMBER; - hash = (53 * hash) + getRenameTo().hashCode(); - if (hasDefaultValue()) { - hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultValue().hashCode(); - } - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static Attr parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Attr parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Attr parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Attr parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Attr parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Attr parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Attr parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Attr 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 Attr parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static Attr 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 Attr parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Attr parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Attr prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * Description of the graph-construction-time configuration of this
    -     * Op.  That is to say, this describes the attr fields that will
    -     * be specified in the NodeDef.
    -     * 
    - * - * Protobuf type {@code tensorflow.ApiDef.Attr} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Attr) - AttrOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Attr.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.Attr.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - renameTo_ = ""; - - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - description_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; - } - - @Override - public Attr getDefaultInstanceForType() { - return Attr.getDefaultInstance(); - } - - @Override - public Attr build() { - Attr result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Attr buildPartial() { - Attr result = new Attr(this); - result.name_ = name_; - result.renameTo_ = renameTo_; - if (defaultValueBuilder_ == null) { - result.defaultValue_ = defaultValue_; - } else { - result.defaultValue_ = defaultValueBuilder_.build(); - } - result.description_ = description_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Attr) { - return mergeFrom((Attr) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(Attr other) { - if (other == Attr.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getRenameTo().isEmpty()) { - renameTo_ = other.renameTo_; - onChanged(); - } - if (other.hasDefaultValue()) { - mergeDefaultValue(other.getDefaultValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Attr parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Attr) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - * 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 Object renameTo_ = ""; - - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public String getRenameTo() { - Object ref = renameTo_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - renameTo_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public com.google.protobuf.ByteString - getRenameToBytes() { - Object ref = renameTo_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - renameTo_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameTo( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - renameTo_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder clearRenameTo() { - - renameTo_ = getDefaultInstance().getRenameTo(); - onChanged(); - return this; - } - - /** - *
    -       * Change the name used to access this attr in the API from what
    -       * is used in the GraphDef.  Note that these names in `backticks`
    -       * will also be replaced in the summary & description fields.
    -       * 
    - * - * string rename_to = 2; - */ - public Builder setRenameToBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - renameTo_ = value; - onChanged(); - return this; - } - - private AttrValue defaultValue_; - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> defaultValueBuilder_; - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValueBuilder_ != null || defaultValue_ != null; - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue getDefaultValue() { - if (defaultValueBuilder_ == null) { - return defaultValue_ == null ? AttrValue.getDefaultInstance() : defaultValue_; - } else { - return defaultValueBuilder_.getMessage(); - } - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue(AttrValue value) { - if (defaultValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultValue_ = value; - onChanged(); - } else { - defaultValueBuilder_.setMessage(value); - } - - return this; - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue( - AttrValue.Builder builderForValue) { - if (defaultValueBuilder_ == null) { - defaultValue_ = builderForValue.build(); - onChanged(); - } else { - defaultValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder mergeDefaultValue(AttrValue value) { - if (defaultValueBuilder_ == null) { - if (defaultValue_ != null) { - defaultValue_ = - AttrValue.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); - } else { - defaultValue_ = value; - } - onChanged(); - } else { - defaultValueBuilder_.mergeFrom(value); - } - - return this; - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder clearDefaultValue() { - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - onChanged(); - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - - return this; - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue.Builder getDefaultValueBuilder() { - - onChanged(); - return getDefaultValueFieldBuilder().getBuilder(); - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValueOrBuilder getDefaultValueOrBuilder() { - if (defaultValueBuilder_ != null) { - return defaultValueBuilder_.getMessageOrBuilder(); - } else { - return defaultValue_ == null ? - AttrValue.getDefaultInstance() : defaultValue_; - } - } - - /** - *
    -       * Specify a new default value to use for this attr.  This default
    -       * will be used when creating new graphs, as opposed to the
    -       * default in the OpDef, which will be used when interpreting old
    -       * GraphDefs.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> - getDefaultValueFieldBuilder() { - if (defaultValueBuilder_ == null) { - defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder>( - getDefaultValue(), - getParentForChildren(), - isClean()); - defaultValue_ = null; - } - return defaultValueBuilder_; - } - - private Object description_ = ""; - - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -       * Note: this will replace any inherited attr doc, there is no current
    -       * way of modifying attr descriptions as can be done with op descriptions.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Attr) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Attr) - private static final Attr DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new Attr(); - } - - public static Attr getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public Attr parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Attr(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public Attr getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int GRAPH_OP_NAME_FIELD_NUMBER = 1; - private volatile Object graphOpName_; - - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - public String getGraphOpName() { - Object ref = graphOpName_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - graphOpName_ = s; - return s; - } - } - - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - public com.google.protobuf.ByteString - getGraphOpNameBytes() { - Object ref = graphOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - graphOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPRECATION_MESSAGE_FIELD_NUMBER = 12; - private volatile Object deprecationMessage_; - - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - public String getDeprecationMessage() { - Object ref = deprecationMessage_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - deprecationMessage_ = s; - return s; - } - } - - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - public com.google.protobuf.ByteString - getDeprecationMessageBytes() { - Object ref = deprecationMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - deprecationMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEPRECATION_VERSION_FIELD_NUMBER = 13; - private int deprecationVersion_; - - /** - *
    -   * Major version when the op will be deleted. For e.g. set this
    -   * value to 2 if op API should be removed in TensorFlow 2.0 and
    -   * deprecated in versions before that.
    -   * 
    - * - * int32 deprecation_version = 13; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - public static final int VISIBILITY_FIELD_NUMBER = 2; - private int visibility_; - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public int getVisibilityValue() { - return visibility_; - } - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Visibility getVisibility() { - @SuppressWarnings("deprecation") - Visibility result = Visibility.valueOf(visibility_); - return result == null ? Visibility.UNRECOGNIZED : result; - } - - public static final int ENDPOINT_FIELD_NUMBER = 3; - private java.util.List endpoint_; - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List getEndpointList() { - return endpoint_; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointOrBuilderList() { - return endpoint_; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public int getEndpointCount() { - return endpoint_.size(); - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Endpoint getEndpoint(int index) { - return endpoint_.get(index); - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public EndpointOrBuilder getEndpointOrBuilder( - int index) { - return endpoint_.get(index); - } - - public static final int IN_ARG_FIELD_NUMBER = 4; - private java.util.List inArg_; - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List getInArgList() { - return inArg_; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgOrBuilderList() { - return inArg_; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public int getInArgCount() { - return inArg_.size(); - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Arg getInArg(int index) { - return inArg_.get(index); - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public ArgOrBuilder getInArgOrBuilder( - int index) { - return inArg_.get(index); - } - - public static final int OUT_ARG_FIELD_NUMBER = 5; - private java.util.List outArg_; - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List getOutArgList() { - return outArg_; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgOrBuilderList() { - return outArg_; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public int getOutArgCount() { - return outArg_.size(); - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Arg getOutArg(int index) { - return outArg_.get(index); - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public ArgOrBuilder getOutArgOrBuilder( - int index) { - return outArg_.get(index); - } - - public static final int ARG_ORDER_FIELD_NUMBER = 11; - private com.google.protobuf.LazyStringList argOrder_; - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ProtocolStringList - getArgOrderList() { - return argOrder_; - } - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public int getArgOrderCount() { - return argOrder_.size(); - } - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public String getArgOrder(int index) { - return argOrder_.get(index); - } - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ByteString - getArgOrderBytes(int index) { - return argOrder_.getByteString(index); - } - - public static final int ATTR_FIELD_NUMBER = 6; - private java.util.List attr_; - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List getAttrList() { - return attr_; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrOrBuilderList() { - return attr_; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public int getAttrCount() { - return attr_.size(); - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Attr getAttr(int index) { - return attr_.get(index); - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public AttrOrBuilder getAttrOrBuilder( - int index) { - return attr_.get(index); - } - - public static final int SUMMARY_FIELD_NUMBER = 7; - private volatile Object summary_; - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - public String getSummary() { - Object ref = summary_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - summary_ = s; - return s; - } - } - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 8; - private volatile Object description_; - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_PREFIX_FIELD_NUMBER = 9; - private volatile Object descriptionPrefix_; - - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - public String getDescriptionPrefix() { - Object ref = descriptionPrefix_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - descriptionPrefix_ = s; - return s; - } - } - - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - public com.google.protobuf.ByteString - getDescriptionPrefixBytes() { - Object ref = descriptionPrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - descriptionPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_SUFFIX_FIELD_NUMBER = 10; - private volatile Object descriptionSuffix_; - - /** - * string description_suffix = 10; - */ - public String getDescriptionSuffix() { - Object ref = descriptionSuffix_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - descriptionSuffix_ = s; - return s; - } - } - - /** - * string description_suffix = 10; - */ - public com.google.protobuf.ByteString - getDescriptionSuffixBytes() { - Object ref = descriptionSuffix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - descriptionSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getGraphOpNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, graphOpName_); - } - if (visibility_ != Visibility.DEFAULT_VISIBILITY.getNumber()) { - output.writeEnum(2, visibility_); - } - for (int i = 0; i < endpoint_.size(); i++) { - output.writeMessage(3, endpoint_.get(i)); - } - for (int i = 0; i < inArg_.size(); i++) { - output.writeMessage(4, inArg_.get(i)); - } - for (int i = 0; i < outArg_.size(); i++) { - output.writeMessage(5, outArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - output.writeMessage(6, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_); - } - if (!getDescriptionPrefixBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, descriptionPrefix_); - } - if (!getDescriptionSuffixBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, descriptionSuffix_); - } - for (int i = 0; i < argOrder_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, argOrder_.getRaw(i)); - } - if (!getDeprecationMessageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, deprecationMessage_); - } - if (deprecationVersion_ != 0) { - output.writeInt32(13, deprecationVersion_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getGraphOpNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, graphOpName_); - } - if (visibility_ != Visibility.DEFAULT_VISIBILITY.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, visibility_); - } - for (int i = 0; i < endpoint_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, endpoint_.get(i)); - } - for (int i = 0; i < inArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, inArg_.get(i)); - } - for (int i = 0; i < outArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, outArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_); - } - if (!getDescriptionPrefixBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, descriptionPrefix_); - } - if (!getDescriptionSuffixBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, descriptionSuffix_); - } - { - int dataSize = 0; - for (int i = 0; i < argOrder_.size(); i++) { - dataSize += computeStringSizeNoTag(argOrder_.getRaw(i)); - } - size += dataSize; - size += 1 * getArgOrderList().size(); - } - if (!getDeprecationMessageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, deprecationMessage_); - } - if (deprecationVersion_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(13, deprecationVersion_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ApiDef)) { - return super.equals(obj); - } - ApiDef other = (ApiDef) obj; - - if (!getGraphOpName() - .equals(other.getGraphOpName())) { - return false; - } - if (!getDeprecationMessage() - .equals(other.getDeprecationMessage())) return false; - if (getDeprecationVersion() - != other.getDeprecationVersion()) return false; - if (visibility_ != other.visibility_) return false; - if (!getEndpointList() - .equals(other.getEndpointList())) return false; - if (!getInArgList() - .equals(other.getInArgList())) return false; - if (!getOutArgList() - .equals(other.getOutArgList())) return false; - if (!getArgOrderList() - .equals(other.getArgOrderList())) return false; - if (!getAttrList() - .equals(other.getAttrList())) return false; - if (!getSummary() - .equals(other.getSummary())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!getDescriptionPrefix() - .equals(other.getDescriptionPrefix())) return false; - if (!getDescriptionSuffix() - .equals(other.getDescriptionSuffix())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GRAPH_OP_NAME_FIELD_NUMBER; - hash = (53 * hash) + getGraphOpName().hashCode(); - hash = (37 * hash) + DEPRECATION_MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationMessage().hashCode(); - hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecationVersion(); - hash = (37 * hash) + VISIBILITY_FIELD_NUMBER; - hash = (53 * hash) + visibility_; - if (getEndpointCount() > 0) { - hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; - hash = (53 * hash) + getEndpointList().hashCode(); - } - if (getInArgCount() > 0) { - hash = (37 * hash) + IN_ARG_FIELD_NUMBER; - hash = (53 * hash) + getInArgList().hashCode(); - } - if (getOutArgCount() > 0) { - hash = (37 * hash) + OUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getOutArgList().hashCode(); - } - if (getArgOrderCount() > 0) { - hash = (37 * hash) + ARG_ORDER_FIELD_NUMBER; - hash = (53 * hash) + getArgOrderList().hashCode(); - } - if (getAttrCount() > 0) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + getAttrList().hashCode(); - } - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + DESCRIPTION_PREFIX_FIELD_NUMBER; - hash = (53 * hash) + getDescriptionPrefix().hashCode(); - hash = (37 * hash) + DESCRIPTION_SUFFIX_FIELD_NUMBER; - hash = (53 * hash) + getDescriptionSuffix().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ApiDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ApiDef parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ApiDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ApiDef parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ApiDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ApiDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ApiDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ApiDef 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 ApiDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static ApiDef 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 ApiDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ApiDef parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(ApiDef prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Used to specify and override the default API & behavior in the
    -   * generated code for client languages, from what you would get from
    -   * the OpDef alone. There will be a set of ApiDefs that are common
    -   * to all client languages, and another set per client language.
    -   * The per-client-language ApiDefs will inherit values from the
    -   * common ApiDefs which it can either replace or modify.
    -   * We separate the API definition from the OpDef so we can evolve the
    -   * API while remaining backwards compatible when interpretting old
    -   * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    -   * ApiDefs message.
    -   * WARNING: Be *very* careful changing the API for any existing op --
    -   * you can change the semantics of existing code.  These changes may
    -   * need to wait until a major release of TensorFlow to avoid breaking
    -   * our compatibility promises.
    -   * 
    - * - * Protobuf type {@code tensorflow.ApiDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef) - ApiDefOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ApiDef.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ApiDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEndpointFieldBuilder(); - getInArgFieldBuilder(); - getOutArgFieldBuilder(); - getAttrFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - graphOpName_ = ""; - - deprecationMessage_ = ""; - - deprecationVersion_ = 0; - - visibility_ = 0; - - if (endpointBuilder_ == null) { - endpoint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - endpointBuilder_.clear(); - } - if (inArgBuilder_ == null) { - inArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - inArgBuilder_.clear(); - } - if (outArgBuilder_ == null) { - outArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - outArgBuilder_.clear(); - } - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - } else { - attrBuilder_.clear(); - } - summary_ = ""; - - description_ = ""; - - descriptionPrefix_ = ""; - - descriptionSuffix_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; - } - - @Override - public ApiDef getDefaultInstanceForType() { - return ApiDef.getDefaultInstance(); - } - - @Override - public ApiDef build() { - ApiDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public ApiDef buildPartial() { - ApiDef result = new ApiDef(this); - int from_bitField0_ = bitField0_; - result.graphOpName_ = graphOpName_; - result.deprecationMessage_ = deprecationMessage_; - result.deprecationVersion_ = deprecationVersion_; - result.visibility_ = visibility_; - if (endpointBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - endpoint_ = java.util.Collections.unmodifiableList(endpoint_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.endpoint_ = endpoint_; - } else { - result.endpoint_ = endpointBuilder_.build(); - } - if (inArgBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - inArg_ = java.util.Collections.unmodifiableList(inArg_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.inArg_ = inArg_; - } else { - result.inArg_ = inArgBuilder_.build(); - } - if (outArgBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - outArg_ = java.util.Collections.unmodifiableList(outArg_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.outArg_ = outArg_; - } else { - result.outArg_ = outArgBuilder_.build(); - } - if (((bitField0_ & 0x00000008) != 0)) { - argOrder_ = argOrder_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.argOrder_ = argOrder_; - if (attrBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.attr_ = attr_; - } else { - result.attr_ = attrBuilder_.build(); - } - result.summary_ = summary_; - result.description_ = description_; - result.descriptionPrefix_ = descriptionPrefix_; - result.descriptionSuffix_ = descriptionSuffix_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ApiDef) { - return mergeFrom((ApiDef) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ApiDef other) { - if (other == ApiDef.getDefaultInstance()) { - return this; - } - if (!other.getGraphOpName().isEmpty()) { - graphOpName_ = other.graphOpName_; - onChanged(); - } - if (!other.getDeprecationMessage().isEmpty()) { - deprecationMessage_ = other.deprecationMessage_; - onChanged(); - } - if (other.getDeprecationVersion() != 0) { - setDeprecationVersion(other.getDeprecationVersion()); - } - if (other.visibility_ != 0) { - setVisibilityValue(other.getVisibilityValue()); - } - if (endpointBuilder_ == null) { - if (!other.endpoint_.isEmpty()) { - if (endpoint_.isEmpty()) { - endpoint_ = other.endpoint_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEndpointIsMutable(); - endpoint_.addAll(other.endpoint_); - } - onChanged(); - } - } else { - if (!other.endpoint_.isEmpty()) { - if (endpointBuilder_.isEmpty()) { - endpointBuilder_.dispose(); - endpointBuilder_ = null; - endpoint_ = other.endpoint_; - bitField0_ = (bitField0_ & ~0x00000001); - endpointBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEndpointFieldBuilder() : null; - } else { - endpointBuilder_.addAllMessages(other.endpoint_); - } - } - } - if (inArgBuilder_ == null) { - if (!other.inArg_.isEmpty()) { - if (inArg_.isEmpty()) { - inArg_ = other.inArg_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInArgIsMutable(); - inArg_.addAll(other.inArg_); - } - onChanged(); - } - } else { - if (!other.inArg_.isEmpty()) { - if (inArgBuilder_.isEmpty()) { - inArgBuilder_.dispose(); - inArgBuilder_ = null; - inArg_ = other.inArg_; - bitField0_ = (bitField0_ & ~0x00000002); - inArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInArgFieldBuilder() : null; - } else { - inArgBuilder_.addAllMessages(other.inArg_); - } - } - } - if (outArgBuilder_ == null) { - if (!other.outArg_.isEmpty()) { - if (outArg_.isEmpty()) { - outArg_ = other.outArg_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureOutArgIsMutable(); - outArg_.addAll(other.outArg_); - } - onChanged(); - } - } else { - if (!other.outArg_.isEmpty()) { - if (outArgBuilder_.isEmpty()) { - outArgBuilder_.dispose(); - outArgBuilder_ = null; - outArg_ = other.outArg_; - bitField0_ = (bitField0_ & ~0x00000004); - outArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutArgFieldBuilder() : null; - } else { - outArgBuilder_.addAllMessages(other.outArg_); - } - } - } - if (!other.argOrder_.isEmpty()) { - if (argOrder_.isEmpty()) { - argOrder_ = other.argOrder_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureArgOrderIsMutable(); - argOrder_.addAll(other.argOrder_); - } - onChanged(); - } - if (attrBuilder_ == null) { - if (!other.attr_.isEmpty()) { - if (attr_.isEmpty()) { - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureAttrIsMutable(); - attr_.addAll(other.attr_); - } - onChanged(); - } - } else { - if (!other.attr_.isEmpty()) { - if (attrBuilder_.isEmpty()) { - attrBuilder_.dispose(); - attrBuilder_ = null; - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000010); - attrBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttrFieldBuilder() : null; - } else { - attrBuilder_.addAllMessages(other.attr_); - } - } - } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (!other.getDescriptionPrefix().isEmpty()) { - descriptionPrefix_ = other.descriptionPrefix_; - onChanged(); - } - if (!other.getDescriptionSuffix().isEmpty()) { - descriptionSuffix_ = other.descriptionSuffix_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ApiDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ApiDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private Object graphOpName_ = ""; - - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public String getGraphOpName() { - Object ref = graphOpName_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - graphOpName_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public com.google.protobuf.ByteString - getGraphOpNameBytes() { - Object ref = graphOpName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - graphOpName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder setGraphOpName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - graphOpName_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder clearGraphOpName() { - - graphOpName_ = getDefaultInstance().getGraphOpName(); - onChanged(); - return this; - } - - /** - *
    -     * Name of the op (in the OpDef) to specify the API for.
    -     * 
    - * - * string graph_op_name = 1; - */ - public Builder setGraphOpNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - graphOpName_ = value; - onChanged(); - return this; - } - - private Object deprecationMessage_ = ""; - - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public String getDeprecationMessage() { - Object ref = deprecationMessage_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - deprecationMessage_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public com.google.protobuf.ByteString - getDeprecationMessageBytes() { - Object ref = deprecationMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - deprecationMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder setDeprecationMessage( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - deprecationMessage_ = value; - onChanged(); - return this; - } - - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder clearDeprecationMessage() { - - deprecationMessage_ = getDefaultInstance().getDeprecationMessage(); - onChanged(); - return this; - } - - /** - *
    -     * If this op is deprecated, set deprecation message to the message
    -     * that should be logged when this op is used.
    -     * The message should indicate alternative op to use, if any.
    -     * 
    - * - * string deprecation_message = 12; - */ - public Builder setDeprecationMessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deprecationMessage_ = value; - onChanged(); - return this; - } - - private int deprecationVersion_ ; - - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public int getDeprecationVersion() { - return deprecationVersion_; - } - - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public Builder setDeprecationVersion(int value) { - - deprecationVersion_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Major version when the op will be deleted. For e.g. set this
    -     * value to 2 if op API should be removed in TensorFlow 2.0 and
    -     * deprecated in versions before that.
    -     * 
    - * - * int32 deprecation_version = 13; - */ - public Builder clearDeprecationVersion() { - - deprecationVersion_ = 0; - onChanged(); - return this; - } - - private int visibility_ = 0; - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public int getVisibilityValue() { - return visibility_; - } - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder setVisibilityValue(int value) { - visibility_ = value; - onChanged(); - return this; - } - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Visibility getVisibility() { - @SuppressWarnings("deprecation") - Visibility result = Visibility.valueOf(visibility_); - return result == null ? Visibility.UNRECOGNIZED : result; - } - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder setVisibility(Visibility value) { - if (value == null) { - throw new NullPointerException(); - } - - visibility_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - public Builder clearVisibility() { - - visibility_ = 0; - onChanged(); - return this; - } - - private java.util.List endpoint_ = - java.util.Collections.emptyList(); - - private void ensureEndpointIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - endpoint_ = new java.util.ArrayList(endpoint_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Endpoint, Endpoint.Builder, EndpointOrBuilder> endpointBuilder_; - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List getEndpointList() { - if (endpointBuilder_ == null) { - return java.util.Collections.unmodifiableList(endpoint_); - } else { - return endpointBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public int getEndpointCount() { - if (endpointBuilder_ == null) { - return endpoint_.size(); - } else { - return endpointBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Endpoint getEndpoint(int index) { - if (endpointBuilder_ == null) { - return endpoint_.get(index); - } else { - return endpointBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder setEndpoint( - int index, Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.set(index, value); - onChanged(); - } else { - endpointBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder setEndpoint( - int index, Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.set(index, builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint(Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.add(value); - onChanged(); - } else { - endpointBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - int index, Endpoint value) { - if (endpointBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEndpointIsMutable(); - endpoint_.add(index, value); - onChanged(); - } else { - endpointBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.add(builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addEndpoint( - int index, Endpoint.Builder builderForValue) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.add(index, builderForValue.build()); - onChanged(); - } else { - endpointBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder addAllEndpoint( - Iterable values) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, endpoint_); - onChanged(); - } else { - endpointBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder clearEndpoint() { - if (endpointBuilder_ == null) { - endpoint_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - endpointBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Builder removeEndpoint(int index) { - if (endpointBuilder_ == null) { - ensureEndpointIsMutable(); - endpoint_.remove(index); - onChanged(); - } else { - endpointBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Endpoint.Builder getEndpointBuilder( - int index) { - return getEndpointFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public EndpointOrBuilder getEndpointOrBuilder( - int index) { - if (endpointBuilder_ == null) { - return endpoint_.get(index); - } else { - return endpointBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointOrBuilderList() { - if (endpointBuilder_ != null) { - return endpointBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(endpoint_); - } - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Endpoint.Builder addEndpointBuilder() { - return getEndpointFieldBuilder().addBuilder( - Endpoint.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public Endpoint.Builder addEndpointBuilder( - int index) { - return getEndpointFieldBuilder().addBuilder( - index, Endpoint.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - public java.util.List - getEndpointBuilderList() { - return getEndpointFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Endpoint, Endpoint.Builder, EndpointOrBuilder> - getEndpointFieldBuilder() { - if (endpointBuilder_ == null) { - endpointBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Endpoint, Endpoint.Builder, EndpointOrBuilder>( - endpoint_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - endpoint_ = null; - } - return endpointBuilder_; - } - - private java.util.List inArg_ = - java.util.Collections.emptyList(); - - private void ensureInArgIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - inArg_ = new java.util.ArrayList(inArg_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder> inArgBuilder_; - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List getInArgList() { - if (inArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(inArg_); - } else { - return inArgBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public int getInArgCount() { - if (inArgBuilder_ == null) { - return inArg_.size(); - } else { - return inArgBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Arg getInArg(int index) { - if (inArgBuilder_ == null) { - return inArg_.get(index); - } else { - return inArgBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder setInArg( - int index, Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.set(index, value); - onChanged(); - } else { - inArgBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder setInArg( - int index, Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.set(index, builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg(Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.add(value); - onChanged(); - } else { - inArgBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - int index, Arg value) { - if (inArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInArgIsMutable(); - inArg_.add(index, value); - onChanged(); - } else { - inArgBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.add(builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addInArg( - int index, Arg.Builder builderForValue) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.add(index, builderForValue.build()); - onChanged(); - } else { - inArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder addAllInArg( - Iterable values) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inArg_); - onChanged(); - } else { - inArgBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder clearInArg() { - if (inArgBuilder_ == null) { - inArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - inArgBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Builder removeInArg(int index) { - if (inArgBuilder_ == null) { - ensureInArgIsMutable(); - inArg_.remove(index); - onChanged(); - } else { - inArgBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Arg.Builder getInArgBuilder( - int index) { - return getInArgFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public ArgOrBuilder getInArgOrBuilder( - int index) { - if (inArgBuilder_ == null) { - return inArg_.get(index); - } else { - return inArgBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgOrBuilderList() { - if (inArgBuilder_ != null) { - return inArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inArg_); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Arg.Builder addInArgBuilder() { - return getInArgFieldBuilder().addBuilder( - Arg.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public Arg.Builder addInArgBuilder( - int index) { - return getInArgFieldBuilder().addBuilder( - index, Arg.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - public java.util.List - getInArgBuilderList() { - return getInArgFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder> - getInArgFieldBuilder() { - if (inArgBuilder_ == null) { - inArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder>( - inArg_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - inArg_ = null; - } - return inArgBuilder_; - } - - private java.util.List outArg_ = - java.util.Collections.emptyList(); - - private void ensureOutArgIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - outArg_ = new java.util.ArrayList(outArg_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder> outArgBuilder_; - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List getOutArgList() { - if (outArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(outArg_); - } else { - return outArgBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public int getOutArgCount() { - if (outArgBuilder_ == null) { - return outArg_.size(); - } else { - return outArgBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Arg getOutArg(int index) { - if (outArgBuilder_ == null) { - return outArg_.get(index); - } else { - return outArgBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder setOutArg( - int index, Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.set(index, value); - onChanged(); - } else { - outArgBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder setOutArg( - int index, Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.set(index, builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg(Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.add(value); - onChanged(); - } else { - outArgBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - int index, Arg value) { - if (outArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutArgIsMutable(); - outArg_.add(index, value); - onChanged(); - } else { - outArgBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.add(builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addOutArg( - int index, Arg.Builder builderForValue) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.add(index, builderForValue.build()); - onChanged(); - } else { - outArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder addAllOutArg( - Iterable values) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outArg_); - onChanged(); - } else { - outArgBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder clearOutArg() { - if (outArgBuilder_ == null) { - outArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - outArgBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Builder removeOutArg(int index) { - if (outArgBuilder_ == null) { - ensureOutArgIsMutable(); - outArg_.remove(index); - onChanged(); - } else { - outArgBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Arg.Builder getOutArgBuilder( - int index) { - return getOutArgFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public ArgOrBuilder getOutArgOrBuilder( - int index) { - if (outArgBuilder_ == null) { - return outArg_.get(index); - } else { - return outArgBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgOrBuilderList() { - if (outArgBuilder_ != null) { - return outArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outArg_); - } - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Arg.Builder addOutArgBuilder() { - return getOutArgFieldBuilder().addBuilder( - Arg.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public Arg.Builder addOutArgBuilder( - int index) { - return getOutArgFieldBuilder().addBuilder( - index, Arg.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - public java.util.List - getOutArgBuilderList() { - return getOutArgFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder> - getOutArgFieldBuilder() { - if (outArgBuilder_ == null) { - outArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Arg, Arg.Builder, ArgOrBuilder>( - outArg_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - outArg_ = null; - } - return outArgBuilder_; - } - - private com.google.protobuf.LazyStringList argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureArgOrderIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - argOrder_ = new com.google.protobuf.LazyStringArrayList(argOrder_); - bitField0_ |= 0x00000008; - } - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ProtocolStringList - getArgOrderList() { - return argOrder_.getUnmodifiableView(); - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public int getArgOrderCount() { - return argOrder_.size(); - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public String getArgOrder(int index) { - return argOrder_.get(index); - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public com.google.protobuf.ByteString - getArgOrderBytes(int index) { - return argOrder_.getByteString(index); - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder setArgOrder( - int index, String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgOrderIsMutable(); - argOrder_.set(index, value); - onChanged(); - return this; - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addArgOrder( - String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureArgOrderIsMutable(); - argOrder_.add(value); - onChanged(); - return this; - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addAllArgOrder( - Iterable values) { - ensureArgOrderIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, argOrder_); - onChanged(); - return this; - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder clearArgOrder() { - argOrder_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - /** - *
    -     * List of original in_arg names to specify new argument order.
    -     * Length of arg_order should be either empty to keep current order
    -     * or match size of in_arg.
    -     * 
    - * - * repeated string arg_order = 11; - */ - public Builder addArgOrderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureArgOrderIsMutable(); - argOrder_.add(value); - onChanged(); - return this; - } - - private java.util.List attr_ = - java.util.Collections.emptyList(); - - private void ensureAttrIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - attr_ = new java.util.ArrayList(attr_); - bitField0_ |= 0x00000010; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Attr, Attr.Builder, AttrOrBuilder> attrBuilder_; - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List getAttrList() { - if (attrBuilder_ == null) { - return java.util.Collections.unmodifiableList(attr_); - } else { - return attrBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public int getAttrCount() { - if (attrBuilder_ == null) { - return attr_.size(); - } else { - return attrBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Attr getAttr(int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder setAttr( - int index, Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.set(index, value); - onChanged(); - } else { - attrBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder setAttr( - int index, Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.set(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr(Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(value); - onChanged(); - } else { - attrBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - int index, Attr value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(index, value); - onChanged(); - } else { - attrBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAttr( - int index, Attr.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder addAllAttr( - Iterable values) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attr_); - onChanged(); - } else { - attrBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder clearAttr() { - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - } else { - attrBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Builder removeAttr(int index) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.remove(index); - onChanged(); - } else { - attrBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Attr.Builder getAttrBuilder( - int index) { - return getAttrFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public AttrOrBuilder getAttrOrBuilder( - int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrOrBuilderList() { - if (attrBuilder_ != null) { - return attrBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attr_); - } - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Attr.Builder addAttrBuilder() { - return getAttrFieldBuilder().addBuilder( - Attr.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public Attr.Builder addAttrBuilder( - int index) { - return getAttrFieldBuilder().addBuilder( - index, Attr.getDefaultInstance()); - } - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - public java.util.List - getAttrBuilderList() { - return getAttrFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Attr, Attr.Builder, AttrOrBuilder> - getAttrFieldBuilder() { - if (attrBuilder_ == null) { - attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Attr, Attr.Builder, AttrOrBuilder>( - attr_, - ((bitField0_ & 0x00000010) != 0), - getParentForChildren(), - isClean()); - attr_ = null; - } - return attrBuilder_; - } - - private Object summary_ = ""; - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public String getSummary() { - Object ref = summary_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - summary_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder setSummary( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - summary_ = value; - onChanged(); - return this; - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder clearSummary() { - - summary_ = getDefaultInstance().getSummary(); - onChanged(); - return this; - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 7; - */ - public Builder setSummaryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; - } - - private Object description_ = ""; - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 8; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private Object descriptionPrefix_ = ""; - - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public String getDescriptionPrefix() { - Object ref = descriptionPrefix_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - descriptionPrefix_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public com.google.protobuf.ByteString - getDescriptionPrefixBytes() { - Object ref = descriptionPrefix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - descriptionPrefix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder setDescriptionPrefix( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - descriptionPrefix_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder clearDescriptionPrefix() { - - descriptionPrefix_ = getDefaultInstance().getDescriptionPrefix(); - onChanged(); - return this; - } - - /** - *
    -     * Modify an existing/inherited description by adding text to the beginning
    -     * or end.
    -     * 
    - * - * string description_prefix = 9; - */ - public Builder setDescriptionPrefixBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - descriptionPrefix_ = value; - onChanged(); - return this; - } - - private Object descriptionSuffix_ = ""; - - /** - * string description_suffix = 10; - */ - public String getDescriptionSuffix() { - Object ref = descriptionSuffix_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - descriptionSuffix_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string description_suffix = 10; - */ - public com.google.protobuf.ByteString - getDescriptionSuffixBytes() { - Object ref = descriptionSuffix_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - descriptionSuffix_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string description_suffix = 10; - */ - public Builder setDescriptionSuffix( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - descriptionSuffix_ = value; - onChanged(); - return this; - } - - /** - * string description_suffix = 10; - */ - public Builder clearDescriptionSuffix() { - - descriptionSuffix_ = getDefaultInstance().getDescriptionSuffix(); - onChanged(); - return this; - } - - /** - * string description_suffix = 10; - */ - public Builder setDescriptionSuffixBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - descriptionSuffix_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ApiDef) - private static final ApiDef DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new ApiDef(); - } - - public static ApiDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public ApiDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApiDef(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public ApiDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java deleted file mode 100644 index 66d48f8040a..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefOrBuilder.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -public interface ApiDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - String getGraphOpName(); - - /** - *
    -   * Name of the op (in the OpDef) to specify the API for.
    -   * 
    - * - * string graph_op_name = 1; - */ - com.google.protobuf.ByteString - getGraphOpNameBytes(); - - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - String getDeprecationMessage(); - - /** - *
    -   * If this op is deprecated, set deprecation message to the message
    -   * that should be logged when this op is used.
    -   * The message should indicate alternative op to use, if any.
    -   * 
    - * - * string deprecation_message = 12; - */ - com.google.protobuf.ByteString - getDeprecationMessageBytes(); - - /** - *
    -   * Major version when the op will be deleted. For e.g. set this
    -   * value to 2 if op API should be removed in TensorFlow 2.0 and
    -   * deprecated in versions before that.
    -   * 
    - * - * int32 deprecation_version = 13; - */ - int getDeprecationVersion(); - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - int getVisibilityValue(); - - /** - * .tensorflow.ApiDef.Visibility visibility = 2; - */ - ApiDef.Visibility getVisibility(); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - java.util.List - getEndpointList(); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - ApiDef.Endpoint getEndpoint(int index); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - int getEndpointCount(); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - java.util.List - getEndpointOrBuilderList(); - - /** - * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; - */ - ApiDef.EndpointOrBuilder getEndpointOrBuilder( - int index); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - java.util.List - getInArgList(); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - ApiDef.Arg getInArg(int index); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - int getInArgCount(); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - java.util.List - getInArgOrBuilderList(); - - /** - * repeated .tensorflow.ApiDef.Arg in_arg = 4; - */ - ApiDef.ArgOrBuilder getInArgOrBuilder( - int index); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - java.util.List - getOutArgList(); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - ApiDef.Arg getOutArg(int index); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - int getOutArgCount(); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - java.util.List - getOutArgOrBuilderList(); - - /** - * repeated .tensorflow.ApiDef.Arg out_arg = 5; - */ - ApiDef.ArgOrBuilder getOutArgOrBuilder( - int index); - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - java.util.List - getArgOrderList(); - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - int getArgOrderCount(); - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - String getArgOrder(int index); - - /** - *
    -   * List of original in_arg names to specify new argument order.
    -   * Length of arg_order should be either empty to keep current order
    -   * or match size of in_arg.
    -   * 
    - * - * repeated string arg_order = 11; - */ - com.google.protobuf.ByteString - getArgOrderBytes(int index); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - java.util.List - getAttrList(); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - ApiDef.Attr getAttr(int index); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - int getAttrCount(); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - java.util.List - getAttrOrBuilderList(); - - /** - * repeated .tensorflow.ApiDef.Attr attr = 6; - */ - ApiDef.AttrOrBuilder getAttrOrBuilder( - int index); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - String getSummary(); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 7; - */ - com.google.protobuf.ByteString - getSummaryBytes(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - String getDescription(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 8; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - String getDescriptionPrefix(); - - /** - *
    -   * Modify an existing/inherited description by adding text to the beginning
    -   * or end.
    -   * 
    - * - * string description_prefix = 9; - */ - com.google.protobuf.ByteString - getDescriptionPrefixBytes(); - - /** - * string description_suffix = 10; - */ - String getDescriptionSuffix(); - - /** - * string description_suffix = 10; - */ - com.google.protobuf.ByteString - getDescriptionSuffixBytes(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefProtos.java deleted file mode 100644 index 513c5824729..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ApiDefProtos.java +++ /dev/null @@ -1,118 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/api_def.proto - -package org.tensorflow.proto.framework; - -public final class ApiDefProtos { - private ApiDefProtos() {} - 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_ApiDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Endpoint_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Arg_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDef_Attr_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ApiDefs_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ApiDefs_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n\'tensorflow/core/framework/api_def.prot" + - "o\022\ntensorflow\032*tensorflow/core/framework" + - "/attr_value.proto\"\341\005\n\006ApiDef\022\025\n\rgraph_op" + - "_name\030\001 \001(\t\022\033\n\023deprecation_message\030\014 \001(\t" + - "\022\033\n\023deprecation_version\030\r \001(\005\0221\n\nvisibil" + - "ity\030\002 \001(\0162\035.tensorflow.ApiDef.Visibility" + - "\022-\n\010endpoint\030\003 \003(\0132\033.tensorflow.ApiDef.E" + - "ndpoint\022&\n\006in_arg\030\004 \003(\0132\026.tensorflow.Api" + - "Def.Arg\022\'\n\007out_arg\030\005 \003(\0132\026.tensorflow.Ap" + - "iDef.Arg\022\021\n\targ_order\030\013 \003(\t\022%\n\004attr\030\006 \003(" + - "\0132\027.tensorflow.ApiDef.Attr\022\017\n\007summary\030\007 " + - "\001(\t\022\023\n\013description\030\010 \001(\t\022\032\n\022description_" + - "prefix\030\t \001(\t\022\032\n\022description_suffix\030\n \001(\t" + - "\032I\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\022\n\ndeprecated" + - "\030\003 \001(\010\022\033\n\023deprecation_version\030\004 \001(\005\032;\n\003A" + - "rg\022\014\n\004name\030\001 \001(\t\022\021\n\trename_to\030\002 \001(\t\022\023\n\013d" + - "escription\030\003 \001(\t\032j\n\004Attr\022\014\n\004name\030\001 \001(\t\022\021" + - "\n\trename_to\030\002 \001(\t\022,\n\rdefault_value\030\003 \001(\013" + - "2\025.tensorflow.AttrValue\022\023\n\013description\030\004" + - " \001(\t\"G\n\nVisibility\022\026\n\022DEFAULT_VISIBILITY" + - "\020\000\022\013\n\007VISIBLE\020\001\022\010\n\004SKIP\020\002\022\n\n\006HIDDEN\020\003\")\n" + - "\007ApiDefs\022\036\n\002op\030\001 \003(\0132\022.tensorflow.ApiDef" + - "B\203\001\n\036org.tensorflow.proto.frameworkB\014Api" + - "DefProtosP\001ZNgithub.com/tensorflow/tenso" + - "rflow/tensorflow/go/core/framework/api_d" + - "ef_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - AttrValueProtos.getDescriptor(), - }); - internal_static_tensorflow_ApiDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ApiDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_descriptor, - new String[]{"GraphOpName", "DeprecationMessage", "DeprecationVersion", "Visibility", "Endpoint", "InArg", - "OutArg", "ArgOrder", "Attr", "Summary", "Description", "DescriptionPrefix", "DescriptionSuffix",}); - internal_static_tensorflow_ApiDef_Endpoint_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Endpoint_descriptor, - new String[]{"Name", "Deprecated", "DeprecationVersion",}); - internal_static_tensorflow_ApiDef_Arg_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Arg_descriptor, - new String[]{"Name", "RenameTo", "Description",}); - internal_static_tensorflow_ApiDef_Attr_descriptor = - internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(2); - internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDef_Attr_descriptor, - new String[]{"Name", "RenameTo", "DefaultValue", "Description",}); - internal_static_tensorflow_ApiDefs_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_ApiDefs_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ApiDefs_descriptor, - new String[]{"Op",}); - AttrValueProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValue.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValue.java deleted file mode 100644 index 6b1cbee96a6..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValue.java +++ /dev/null @@ -1,5682 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing the value for an attr used to configure an Op.
    - * Comment indicates the corresponding attr type.  Only the field matching the
    - * attr type may be filled.
    - * 
    - * - * Protobuf type {@code tensorflow.AttrValue} - */ -public final class AttrValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AttrValue) - AttrValueOrBuilder { -private static final long serialVersionUID = 0L; - - // Use AttrValue.newBuilder() to construct. - private AttrValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AttrValue() { - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new AttrValue(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private AttrValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - ListValue.Builder subBuilder = null; - if (valueCase_ == 1) { - subBuilder = ((ListValue) value_).toBuilder(); - } - value_ = - input.readMessage(ListValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((ListValue) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 1; - break; - } - case 18: { - valueCase_ = 2; - value_ = input.readBytes(); - break; - } - case 24: { - valueCase_ = 3; - value_ = input.readInt64(); - break; - } - case 37: { - valueCase_ = 4; - value_ = input.readFloat(); - break; - } - case 40: { - valueCase_ = 5; - value_ = input.readBool(); - break; - } - case 48: { - int rawValue = input.readEnum(); - valueCase_ = 6; - value_ = rawValue; - break; - } - case 58: { - TensorShapeProto.Builder subBuilder = null; - if (valueCase_ == 7) { - subBuilder = ((TensorShapeProto) value_).toBuilder(); - } - value_ = - input.readMessage(TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((TensorShapeProto) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 7; - break; - } - case 66: { - TensorProto.Builder subBuilder = null; - if (valueCase_ == 8) { - subBuilder = ((TensorProto) value_).toBuilder(); - } - value_ = - input.readMessage(TensorProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((TensorProto) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 8; - break; - } - case 74: { - String s = input.readStringRequireUtf8(); - valueCase_ = 9; - value_ = s; - break; - } - case 82: { - NameAttrList.Builder subBuilder = null; - if (valueCase_ == 10) { - subBuilder = ((NameAttrList) value_).toBuilder(); - } - value_ = - input.readMessage(NameAttrList.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((NameAttrList) value_); - value_ = subBuilder.buildPartial(); - } - valueCase_ = 10; - 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 AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AttrValue.class, Builder.class); - } - - public interface ListValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue.ListValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - java.util.List getSList(); - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - int getSCount(); - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - com.google.protobuf.ByteString getS(int index); - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - java.util.List getIList(); - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - int getICount(); - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - long getI(int index); - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - java.util.List getFList(); - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - int getFCount(); - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - float getF(int index); - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - java.util.List getBList(); - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - int getBCount(); - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - boolean getB(int index); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - java.util.List getTypeList(); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - int getTypeCount(); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - DataType getType(int index); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - java.util.List - getTypeValueList(); - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - int getTypeValue(int index); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - java.util.List - getShapeList(); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - TensorShapeProto getShape(int index); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - int getShapeCount(); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - java.util.List - getShapeOrBuilderList(); - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - TensorShapeProtoOrBuilder getShapeOrBuilder( - int index); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - java.util.List - getTensorList(); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - TensorProto getTensor(int index); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - int getTensorCount(); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - java.util.List - getTensorOrBuilderList(); - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - TensorProtoOrBuilder getTensorOrBuilder( - int index); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - java.util.List - getFuncList(); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - NameAttrList getFunc(int index); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - int getFuncCount(); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - java.util.List - getFuncOrBuilderList(); - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - NameAttrListOrBuilder getFuncOrBuilder( - int index); - } - - /** - *
    -   * LINT.IfChange
    -   * 
    - * - * Protobuf type {@code tensorflow.AttrValue.ListValue} - */ - public static final class ListValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.AttrValue.ListValue) - ListValueOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use ListValue.newBuilder() to construct. - private ListValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListValue() { - s_ = java.util.Collections.emptyList(); - i_ = emptyLongList(); - f_ = emptyFloatList(); - b_ = emptyBooleanList(); - type_ = java.util.Collections.emptyList(); - shape_ = java.util.Collections.emptyList(); - tensor_ = java.util.Collections.emptyList(); - func_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new ListValue(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private ListValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - s_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - s_.add(input.readBytes()); - break; - } - case 24: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - i_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - i_.addLong(input.readInt64()); - break; - } - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - i_ = newLongList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - i_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 37: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - f_ = newFloatList(); - mutable_bitField0_ |= 0x00000004; - } - f_.addFloat(input.readFloat()); - break; - } - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - f_ = newFloatList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - f_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 40: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - b_ = newBooleanList(); - mutable_bitField0_ |= 0x00000008; - } - b_.addBoolean(input.readBool()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) { - b_ = newBooleanList(); - mutable_bitField0_ |= 0x00000008; - } - while (input.getBytesUntilLimit() > 0) { - b_.addBoolean(input.readBool()); - } - input.popLimit(limit); - break; - } - case 48: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - type_.add(rawValue); - break; - } - case 50: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - type_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - shape_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - shape_.add( - input.readMessage(TensorShapeProto.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { - tensor_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - tensor_.add( - input.readMessage(TensorProto.parser(), extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { - func_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - func_.add( - input.readMessage(NameAttrList.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_ & 0x00000001) != 0)) { - s_ = java.util.Collections.unmodifiableList(s_); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - i_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - f_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - b_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - type_ = java.util.Collections.unmodifiableList(type_); - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - shape_ = java.util.Collections.unmodifiableList(shape_); - } - if (((mutable_bitField0_ & 0x00000040) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - } - if (((mutable_bitField0_ & 0x00000080) != 0)) { - func_ = java.util.Collections.unmodifiableList(func_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ListValue.class, Builder.class); - } - - public static final int S_FIELD_NUMBER = 2; - private java.util.List s_; - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public java.util.List - getSList() { - return s_; - } - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public int getSCount() { - return s_.size(); - } - - /** - *
    -     * "list(string)"
    -     * 
    - * - * repeated bytes s = 2; - */ - public com.google.protobuf.ByteString getS(int index) { - return s_.get(index); - } - - public static final int I_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.LongList i_; - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public java.util.List - getIList() { - return i_; - } - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public int getICount() { - return i_.size(); - } - - /** - *
    -     * "list(int)"
    -     * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public long getI(int index) { - return i_.getLong(index); - } - - private int iMemoizedSerializedSize = -1; - - public static final int F_FIELD_NUMBER = 4; - private com.google.protobuf.Internal.FloatList f_; - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public java.util.List - getFList() { - return f_; - } - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public int getFCount() { - return f_.size(); - } - - /** - *
    -     * "list(float)"
    -     * 
    - * - * repeated float f = 4 [packed = true]; - */ - public float getF(int index) { - return f_.getFloat(index); - } - - private int fMemoizedSerializedSize = -1; - - public static final int B_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.BooleanList b_; - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public java.util.List - getBList() { - return b_; - } - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public int getBCount() { - return b_.size(); - } - - /** - *
    -     * "list(bool)"
    -     * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public boolean getB(int index) { - return b_.getBoolean(index); - } - - private int bMemoizedSerializedSize = -1; - - public static final int TYPE_FIELD_NUMBER = 6; - private java.util.List type_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - Integer, DataType> type_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - Integer, DataType>() { - public DataType convert(Integer from) { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(from); - return result == null ? DataType.UNRECOGNIZED : result; - } - }; - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List getTypeList() { - return new com.google.protobuf.Internal.ListAdapter< - Integer, DataType>(type_, type_converter_); - } - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeCount() { - return type_.size(); - } - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public DataType getType(int index) { - return type_converter_.convert(type_.get(index)); - } - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List - getTypeValueList() { - return type_; - } - - /** - *
    -     * "list(type)"
    -     * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeValue(int index) { - return type_.get(index); - } - - private int typeMemoizedSerializedSize; - - public static final int SHAPE_FIELD_NUMBER = 7; - private java.util.List shape_; - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List getShapeList() { - return shape_; - } - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeOrBuilderList() { - return shape_; - } - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public int getShapeCount() { - return shape_.size(); - } - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto getShape(int index) { - return shape_.get(index); - } - - /** - *
    -     * "list(shape)"
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder( - int index) { - return shape_.get(index); - } - - public static final int TENSOR_FIELD_NUMBER = 8; - private java.util.List tensor_; - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List getTensorList() { - return tensor_; - } - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorOrBuilderList() { - return tensor_; - } - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public int getTensorCount() { - return tensor_.size(); - } - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProto getTensor(int index) { - return tensor_.get(index); - } - - /** - *
    -     * "list(tensor)"
    -     * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProtoOrBuilder getTensorOrBuilder( - int index) { - return tensor_.get(index); - } - - public static final int FUNC_FIELD_NUMBER = 9; - private java.util.List func_; - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List getFuncList() { - return func_; - } - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncOrBuilderList() { - return func_; - } - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public int getFuncCount() { - return func_.size(); - } - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrList getFunc(int index) { - return func_.get(index); - } - - /** - *
    -     * "list(attr)"
    -     * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrListOrBuilder getFuncOrBuilder( - int index) { - return func_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < s_.size(); i++) { - output.writeBytes(2, s_.get(i)); - } - if (getIList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(iMemoizedSerializedSize); - } - for (int i = 0; i < i_.size(); i++) { - output.writeInt64NoTag(i_.getLong(i)); - } - if (getFList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(fMemoizedSerializedSize); - } - for (int i = 0; i < f_.size(); i++) { - output.writeFloatNoTag(f_.getFloat(i)); - } - if (getBList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(bMemoizedSerializedSize); - } - for (int i = 0; i < b_.size(); i++) { - output.writeBoolNoTag(b_.getBoolean(i)); - } - if (getTypeList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(typeMemoizedSerializedSize); - } - for (int i = 0; i < type_.size(); i++) { - output.writeEnumNoTag(type_.get(i)); - } - for (int i = 0; i < shape_.size(); i++) { - output.writeMessage(7, shape_.get(i)); - } - for (int i = 0; i < tensor_.size(); i++) { - output.writeMessage(8, tensor_.get(i)); - } - for (int i = 0; i < func_.size(); i++) { - output.writeMessage(9, func_.get(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < s_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(s_.get(i)); - } - size += dataSize; - size += 1 * getSList().size(); - } - { - int dataSize = 0; - for (int i = 0; i < i_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(i_.getLong(i)); - } - size += dataSize; - if (!getIList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - iMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * getFList().size(); - size += dataSize; - if (!getFList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - fMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * getBList().size(); - size += dataSize; - if (!getBList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - bMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < type_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(type_.get(i)); - } - size += dataSize; - if (!getTypeList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }typeMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < shape_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, shape_.get(i)); - } - for (int i = 0; i < tensor_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, tensor_.get(i)); - } - for (int i = 0; i < func_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, func_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ListValue)) { - return super.equals(obj); - } - ListValue other = (ListValue) obj; - - if (!getSList() - .equals(other.getSList())) { - return false; - } - if (!getIList() - .equals(other.getIList())) return false; - if (!getFList() - .equals(other.getFList())) return false; - if (!getBList() - .equals(other.getBList())) return false; - if (!type_.equals(other.type_)) return false; - if (!getShapeList() - .equals(other.getShapeList())) return false; - if (!getTensorList() - .equals(other.getTensorList())) return false; - if (!getFuncList() - .equals(other.getFuncList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSCount() > 0) { - hash = (37 * hash) + S_FIELD_NUMBER; - hash = (53 * hash) + getSList().hashCode(); - } - if (getICount() > 0) { - hash = (37 * hash) + I_FIELD_NUMBER; - hash = (53 * hash) + getIList().hashCode(); - } - if (getFCount() > 0) { - hash = (37 * hash) + F_FIELD_NUMBER; - hash = (53 * hash) + getFList().hashCode(); - } - if (getBCount() > 0) { - hash = (37 * hash) + B_FIELD_NUMBER; - hash = (53 * hash) + getBList().hashCode(); - } - if (getTypeCount() > 0) { - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_.hashCode(); - } - if (getShapeCount() > 0) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShapeList().hashCode(); - } - if (getTensorCount() > 0) { - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensorList().hashCode(); - } - if (getFuncCount() > 0) { - hash = (37 * hash) + FUNC_FIELD_NUMBER; - hash = (53 * hash) + getFuncList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ListValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ListValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ListValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ListValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ListValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ListValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ListValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ListValue 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 ListValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static ListValue 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 ListValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ListValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(ListValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * LINT.IfChange
    -     * 
    - * - * Protobuf type {@code tensorflow.AttrValue.ListValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue.ListValue) - ListValueOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ListValue.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AttrValue.ListValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getShapeFieldBuilder(); - getTensorFieldBuilder(); - getFuncFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - s_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - i_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - f_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000004); - b_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000008); - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - if (shapeBuilder_ == null) { - shape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - } else { - shapeBuilder_.clear(); - } - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - } else { - tensorBuilder_.clear(); - } - if (funcBuilder_ == null) { - func_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - } else { - funcBuilder_.clear(); - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; - } - - @Override - public ListValue getDefaultInstanceForType() { - return ListValue.getDefaultInstance(); - } - - @Override - public ListValue build() { - ListValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public ListValue buildPartial() { - ListValue result = new ListValue(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - s_ = java.util.Collections.unmodifiableList(s_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.s_ = s_; - if (((bitField0_ & 0x00000002) != 0)) { - i_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.i_ = i_; - if (((bitField0_ & 0x00000004) != 0)) { - f_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.f_ = f_; - if (((bitField0_ & 0x00000008) != 0)) { - b_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.b_ = b_; - if (((bitField0_ & 0x00000010) != 0)) { - type_ = java.util.Collections.unmodifiableList(type_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.type_ = type_; - if (shapeBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { - shape_ = java.util.Collections.unmodifiableList(shape_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - if (tensorBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { - tensor_ = java.util.Collections.unmodifiableList(tensor_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.tensor_ = tensor_; - } else { - result.tensor_ = tensorBuilder_.build(); - } - if (funcBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0)) { - func_ = java.util.Collections.unmodifiableList(func_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.func_ = func_; - } else { - result.func_ = funcBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ListValue) { - return mergeFrom((ListValue) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ListValue other) { - if (other == ListValue.getDefaultInstance()) { - return this; - } - if (!other.s_.isEmpty()) { - if (s_.isEmpty()) { - s_ = other.s_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSIsMutable(); - s_.addAll(other.s_); - } - onChanged(); - } - if (!other.i_.isEmpty()) { - if (i_.isEmpty()) { - i_ = other.i_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureIIsMutable(); - i_.addAll(other.i_); - } - onChanged(); - } - if (!other.f_.isEmpty()) { - if (f_.isEmpty()) { - f_ = other.f_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureFIsMutable(); - f_.addAll(other.f_); - } - onChanged(); - } - if (!other.b_.isEmpty()) { - if (b_.isEmpty()) { - b_ = other.b_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureBIsMutable(); - b_.addAll(other.b_); - } - onChanged(); - } - if (!other.type_.isEmpty()) { - if (type_.isEmpty()) { - type_ = other.type_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureTypeIsMutable(); - type_.addAll(other.type_); - } - onChanged(); - } - if (shapeBuilder_ == null) { - if (!other.shape_.isEmpty()) { - if (shape_.isEmpty()) { - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureShapeIsMutable(); - shape_.addAll(other.shape_); - } - onChanged(); - } - } else { - if (!other.shape_.isEmpty()) { - if (shapeBuilder_.isEmpty()) { - shapeBuilder_.dispose(); - shapeBuilder_ = null; - shape_ = other.shape_; - bitField0_ = (bitField0_ & ~0x00000020); - shapeBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getShapeFieldBuilder() : null; - } else { - shapeBuilder_.addAllMessages(other.shape_); - } - } - } - if (tensorBuilder_ == null) { - if (!other.tensor_.isEmpty()) { - if (tensor_.isEmpty()) { - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureTensorIsMutable(); - tensor_.addAll(other.tensor_); - } - onChanged(); - } - } else { - if (!other.tensor_.isEmpty()) { - if (tensorBuilder_.isEmpty()) { - tensorBuilder_.dispose(); - tensorBuilder_ = null; - tensor_ = other.tensor_; - bitField0_ = (bitField0_ & ~0x00000040); - tensorBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorFieldBuilder() : null; - } else { - tensorBuilder_.addAllMessages(other.tensor_); - } - } - } - if (funcBuilder_ == null) { - if (!other.func_.isEmpty()) { - if (func_.isEmpty()) { - func_ = other.func_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureFuncIsMutable(); - func_.addAll(other.func_); - } - onChanged(); - } - } else { - if (!other.func_.isEmpty()) { - if (funcBuilder_.isEmpty()) { - funcBuilder_.dispose(); - funcBuilder_ = null; - func_ = other.func_; - bitField0_ = (bitField0_ & ~0x00000080); - funcBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFuncFieldBuilder() : null; - } else { - funcBuilder_.addAllMessages(other.func_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ListValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ListValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List s_ = java.util.Collections.emptyList(); - - private void ensureSIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - s_ = new java.util.ArrayList(s_); - bitField0_ |= 0x00000001; - } - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public java.util.List - getSList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(s_) : s_; - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public int getSCount() { - return s_.size(); - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public com.google.protobuf.ByteString getS(int index) { - return s_.get(index); - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder setS( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSIsMutable(); - s_.set(index, value); - onChanged(); - return this; - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder addS(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureSIsMutable(); - s_.add(value); - onChanged(); - return this; - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder addAllS( - Iterable values) { - ensureSIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, s_); - onChanged(); - return this; - } - - /** - *
    -       * "list(string)"
    -       * 
    - * - * repeated bytes s = 2; - */ - public Builder clearS() { - s_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList i_ = emptyLongList(); - - private void ensureIIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - i_ = mutableCopy(i_); - bitField0_ |= 0x00000002; - } - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public java.util.List - getIList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(i_) : i_; - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public int getICount() { - return i_.size(); - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public long getI(int index) { - return i_.getLong(index); - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder setI( - int index, long value) { - ensureIIsMutable(); - i_.setLong(index, value); - onChanged(); - return this; - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder addI(long value) { - ensureIIsMutable(); - i_.addLong(value); - onChanged(); - return this; - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder addAllI( - Iterable values) { - ensureIIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, i_); - onChanged(); - return this; - } - - /** - *
    -       * "list(int)"
    -       * 
    - * - * repeated int64 i = 3 [packed = true]; - */ - public Builder clearI() { - i_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList f_ = emptyFloatList(); - - private void ensureFIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - f_ = mutableCopy(f_); - bitField0_ |= 0x00000004; - } - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public java.util.List - getFList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(f_) : f_; - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public int getFCount() { - return f_.size(); - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public float getF(int index) { - return f_.getFloat(index); - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder setF( - int index, float value) { - ensureFIsMutable(); - f_.setFloat(index, value); - onChanged(); - return this; - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder addF(float value) { - ensureFIsMutable(); - f_.addFloat(value); - onChanged(); - return this; - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder addAllF( - Iterable values) { - ensureFIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, f_); - onChanged(); - return this; - } - - /** - *
    -       * "list(float)"
    -       * 
    - * - * repeated float f = 4 [packed = true]; - */ - public Builder clearF() { - f_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.BooleanList b_ = emptyBooleanList(); - - private void ensureBIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - b_ = mutableCopy(b_); - bitField0_ |= 0x00000008; - } - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public java.util.List - getBList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(b_) : b_; - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public int getBCount() { - return b_.size(); - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public boolean getB(int index) { - return b_.getBoolean(index); - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder setB( - int index, boolean value) { - ensureBIsMutable(); - b_.setBoolean(index, value); - onChanged(); - return this; - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder addB(boolean value) { - ensureBIsMutable(); - b_.addBoolean(value); - onChanged(); - return this; - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder addAllB( - Iterable values) { - ensureBIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, b_); - onChanged(); - return this; - } - - /** - *
    -       * "list(bool)"
    -       * 
    - * - * repeated bool b = 5 [packed = true]; - */ - public Builder clearB() { - b_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - private java.util.List type_ = - java.util.Collections.emptyList(); - - private void ensureTypeIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - type_ = new java.util.ArrayList(type_); - bitField0_ |= 0x00000010; - } - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List getTypeList() { - return new com.google.protobuf.Internal.ListAdapter< - Integer, DataType>(type_, type_converter_); - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeCount() { - return type_.size(); - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public DataType getType(int index) { - return type_converter_.convert(type_.get(index)); - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder setType( - int index, DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.set(index, value.getNumber()); - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addType(DataType value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTypeIsMutable(); - type_.add(value.getNumber()); - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addAllType( - Iterable values) { - ensureTypeIsMutable(); - for (DataType value : values) { - type_.add(value.getNumber()); - } - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder clearType() { - type_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public java.util.List - getTypeValueList() { - return java.util.Collections.unmodifiableList(type_); - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public int getTypeValue(int index) { - return type_.get(index); - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder setTypeValue( - int index, int value) { - ensureTypeIsMutable(); - type_.set(index, value); - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addTypeValue(int value) { - ensureTypeIsMutable(); - type_.add(value); - onChanged(); - return this; - } - - /** - *
    -       * "list(type)"
    -       * 
    - * - * repeated .tensorflow.DataType type = 6 [packed = true]; - */ - public Builder addAllTypeValue( - Iterable values) { - ensureTypeIsMutable(); - for (int value : values) { - type_.add(value); - } - onChanged(); - return this; - } - - private java.util.List shape_ = - java.util.Collections.emptyList(); - - private void ensureShapeIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - shape_ = new java.util.ArrayList(shape_); - bitField0_ |= 0x00000020; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> shapeBuilder_; - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List getShapeList() { - if (shapeBuilder_ == null) { - return java.util.Collections.unmodifiableList(shape_); - } else { - return shapeBuilder_.getMessageList(); - } - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public int getShapeCount() { - if (shapeBuilder_ == null) { - return shape_.size(); - } else { - return shapeBuilder_.getCount(); - } - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto getShape(int index) { - if (shapeBuilder_ == null) { - return shape_.get(index); - } else { - return shapeBuilder_.getMessage(index); - } - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - int index, TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.set(index, value); - onChanged(); - } else { - shapeBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - int index, TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.set(index, builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape(TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.add(value); - onChanged(); - } else { - shapeBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - int index, TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureShapeIsMutable(); - shape_.add(index, value); - onChanged(); - } else { - shapeBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.add(builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addShape( - int index, TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.add(index, builderForValue.build()); - onChanged(); - } else { - shapeBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder addAllShape( - Iterable values) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, shape_); - onChanged(); - } else { - shapeBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - shapeBuilder_.clear(); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public Builder removeShape(int index) { - if (shapeBuilder_ == null) { - ensureShapeIsMutable(); - shape_.remove(index); - onChanged(); - } else { - shapeBuilder_.remove(index); - } - return this; - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto.Builder getShapeBuilder( - int index) { - return getShapeFieldBuilder().getBuilder(index); - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder( - int index) { - if (shapeBuilder_ == null) { - return shape_.get(index); - } else { - return shapeBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeOrBuilderList() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(shape_); - } - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto.Builder addShapeBuilder() { - return getShapeFieldBuilder().addBuilder( - TensorShapeProto.getDefaultInstance()); - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto.Builder addShapeBuilder( - int index) { - return getShapeFieldBuilder().addBuilder( - index, TensorShapeProto.getDefaultInstance()); - } - - /** - *
    -       * "list(shape)"
    -       * 
    - * - * repeated .tensorflow.TensorShapeProto shape = 7; - */ - public java.util.List - getShapeBuilderList() { - return getShapeFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>( - shape_, - ((bitField0_ & 0x00000020) != 0), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - private java.util.List tensor_ = - java.util.Collections.emptyList(); - - private void ensureTensorIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { - tensor_ = new java.util.ArrayList(tensor_); - bitField0_ |= 0x00000040; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> tensorBuilder_; - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List getTensorList() { - if (tensorBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensor_); - } else { - return tensorBuilder_.getMessageList(); - } - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public int getTensorCount() { - if (tensorBuilder_ == null) { - return tensor_.size(); - } else { - return tensorBuilder_.getCount(); - } - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProto getTensor(int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); - } else { - return tensorBuilder_.getMessage(index); - } - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - int index, TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.set(index, value); - onChanged(); - } else { - tensorBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - int index, TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor(TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(value); - onChanged(); - } else { - tensorBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - int index, TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorIsMutable(); - tensor_.add(index, value); - onChanged(); - } else { - tensorBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addTensor( - int index, TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder addAllTensor( - Iterable values) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensor_); - onChanged(); - } else { - tensorBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - tensor_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - } else { - tensorBuilder_.clear(); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public Builder removeTensor(int index) { - if (tensorBuilder_ == null) { - ensureTensorIsMutable(); - tensor_.remove(index); - onChanged(); - } else { - tensorBuilder_.remove(index); - } - return this; - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProto.Builder getTensorBuilder( - int index) { - return getTensorFieldBuilder().getBuilder(index); - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProtoOrBuilder getTensorOrBuilder( - int index) { - if (tensorBuilder_ == null) { - return tensor_.get(index); - } else { - return tensorBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorOrBuilderList() { - if (tensorBuilder_ != null) { - return tensorBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensor_); - } - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProto.Builder addTensorBuilder() { - return getTensorFieldBuilder().addBuilder( - TensorProto.getDefaultInstance()); - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public TensorProto.Builder addTensorBuilder( - int index) { - return getTensorFieldBuilder().addBuilder( - index, TensorProto.getDefaultInstance()); - } - - /** - *
    -       * "list(tensor)"
    -       * 
    - * - * repeated .tensorflow.TensorProto tensor = 8; - */ - public java.util.List - getTensorBuilderList() { - return getTensorFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder>( - tensor_, - ((bitField0_ & 0x00000040) != 0), - getParentForChildren(), - isClean()); - tensor_ = null; - } - return tensorBuilder_; - } - - private java.util.List func_ = - java.util.Collections.emptyList(); - - private void ensureFuncIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { - func_ = new java.util.ArrayList(func_); - bitField0_ |= 0x00000080; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> funcBuilder_; - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List getFuncList() { - if (funcBuilder_ == null) { - return java.util.Collections.unmodifiableList(func_); - } else { - return funcBuilder_.getMessageList(); - } - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public int getFuncCount() { - if (funcBuilder_ == null) { - return func_.size(); - } else { - return funcBuilder_.getCount(); - } - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrList getFunc(int index) { - if (funcBuilder_ == null) { - return func_.get(index); - } else { - return funcBuilder_.getMessage(index); - } - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder setFunc( - int index, NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.set(index, value); - onChanged(); - } else { - funcBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder setFunc( - int index, NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.set(index, builderForValue.build()); - onChanged(); - } else { - funcBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc(NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.add(value); - onChanged(); - } else { - funcBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - int index, NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFuncIsMutable(); - func_.add(index, value); - onChanged(); - } else { - funcBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.add(builderForValue.build()); - onChanged(); - } else { - funcBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addFunc( - int index, NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.add(index, builderForValue.build()); - onChanged(); - } else { - funcBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder addAllFunc( - Iterable values) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, func_); - onChanged(); - } else { - funcBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder clearFunc() { - if (funcBuilder_ == null) { - func_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - } else { - funcBuilder_.clear(); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public Builder removeFunc(int index) { - if (funcBuilder_ == null) { - ensureFuncIsMutable(); - func_.remove(index); - onChanged(); - } else { - funcBuilder_.remove(index); - } - return this; - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrList.Builder getFuncBuilder( - int index) { - return getFuncFieldBuilder().getBuilder(index); - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrListOrBuilder getFuncOrBuilder( - int index) { - if (funcBuilder_ == null) { - return func_.get(index); - } else { - return funcBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncOrBuilderList() { - if (funcBuilder_ != null) { - return funcBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(func_); - } - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrList.Builder addFuncBuilder() { - return getFuncFieldBuilder().addBuilder( - NameAttrList.getDefaultInstance()); - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public NameAttrList.Builder addFuncBuilder( - int index) { - return getFuncFieldBuilder().addBuilder( - index, NameAttrList.getDefaultInstance()); - } - - /** - *
    -       * "list(attr)"
    -       * 
    - * - * repeated .tensorflow.NameAttrList func = 9; - */ - public java.util.List - getFuncBuilderList() { - return getFuncFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> - getFuncFieldBuilder() { - if (funcBuilder_ == null) { - funcBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>( - func_, - ((bitField0_ & 0x00000080) != 0), - getParentForChildren(), - isClean()); - func_ = null; - } - return funcBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue.ListValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AttrValue.ListValue) - private static final ListValue DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new ListValue(); - } - - public static ListValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public ListValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListValue(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public ListValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int valueCase_ = 0; - private Object value_; - - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite { - S(2), - I(3), - F(4), - B(5), - TYPE(6), - SHAPE(7), - TENSOR(8), - LIST(1), - FUNC(10), - PLACEHOLDER(9), - VALUE_NOT_SET(0); - private final int value; - - private ValueCase(int value) { - this.value = value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 2: return S; - case 3: return I; - case 4: return F; - case 5: return B; - case 6: return TYPE; - case 7: return SHAPE; - case 8: return TENSOR; - case 1: return LIST; - case 10: return FUNC; - case 9: return PLACEHOLDER; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int S_FIELD_NUMBER = 2; - - /** - *
    -   * "string"
    -   * 
    - * - * bytes s = 2; - */ - public com.google.protobuf.ByteString getS() { - if (valueCase_ == 2) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int I_FIELD_NUMBER = 3; - - /** - *
    -   * "int"
    -   * 
    - * - * int64 i = 3; - */ - public long getI() { - if (valueCase_ == 3) { - return (Long) value_; - } - return 0L; - } - - public static final int F_FIELD_NUMBER = 4; - - /** - *
    -   * "float"
    -   * 
    - * - * float f = 4; - */ - public float getF() { - if (valueCase_ == 4) { - return (Float) value_; - } - return 0F; - } - - public static final int B_FIELD_NUMBER = 5; - - /** - *
    -   * "bool"
    -   * 
    - * - * bool b = 5; - */ - public boolean getB() { - if (valueCase_ == 5) { - return (Boolean) value_; - } - return false; - } - - public static final int TYPE_FIELD_NUMBER = 6; - - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - public int getTypeValue() { - if (valueCase_ == 6) { - return (Integer) value_; - } - return 0; - } - - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - public DataType getType() { - if (valueCase_ == 6) { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf( - (Integer) value_); - return result == null ? DataType.UNRECOGNIZED : result; - } - return DataType.DT_INVALID; - } - - public static final int SHAPE_FIELD_NUMBER = 7; - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public boolean hasShape() { - return valueCase_ == 7; - } - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto getShape() { - if (valueCase_ == 7) { - return (TensorShapeProto) value_; - } - return TensorShapeProto.getDefaultInstance(); - } - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (valueCase_ == 7) { - return (TensorShapeProto) value_; - } - return TensorShapeProto.getDefaultInstance(); - } - - public static final int TENSOR_FIELD_NUMBER = 8; - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public boolean hasTensor() { - return valueCase_ == 8; - } - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public TensorProto getTensor() { - if (valueCase_ == 8) { - return (TensorProto) value_; - } - return TensorProto.getDefaultInstance(); - } - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public TensorProtoOrBuilder getTensorOrBuilder() { - if (valueCase_ == 8) { - return (TensorProto) value_; - } - return TensorProto.getDefaultInstance(); - } - - public static final int LIST_FIELD_NUMBER = 1; - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public boolean hasList() { - return valueCase_ == 1; - } - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public ListValue getList() { - if (valueCase_ == 1) { - return (ListValue) value_; - } - return ListValue.getDefaultInstance(); - } - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public ListValueOrBuilder getListOrBuilder() { - if (valueCase_ == 1) { - return (ListValue) value_; - } - return ListValue.getDefaultInstance(); - } - - public static final int FUNC_FIELD_NUMBER = 10; - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public boolean hasFunc() { - return valueCase_ == 10; - } - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public NameAttrList getFunc() { - if (valueCase_ == 10) { - return (NameAttrList) value_; - } - return NameAttrList.getDefaultInstance(); - } - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public NameAttrListOrBuilder getFuncOrBuilder() { - if (valueCase_ == 10) { - return (NameAttrList) value_; - } - return NameAttrList.getDefaultInstance(); - } - - public static final int PLACEHOLDER_FIELD_NUMBER = 9; - - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - public String getPlaceholder() { - Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (valueCase_ == 9) { - value_ = s; - } - return s; - } - } - - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - public com.google.protobuf.ByteString - getPlaceholderBytes() { - Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - if (valueCase_ == 9) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (valueCase_ == 1) { - output.writeMessage(1, (ListValue) value_); - } - if (valueCase_ == 2) { - output.writeBytes( - 2, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 3) { - output.writeInt64( - 3, (long) ((Long) value_)); - } - if (valueCase_ == 4) { - output.writeFloat( - 4, (float) ((Float) value_)); - } - if (valueCase_ == 5) { - output.writeBool( - 5, (boolean) ((Boolean) value_)); - } - if (valueCase_ == 6) { - output.writeEnum(6, ((Integer) value_)); - } - if (valueCase_ == 7) { - output.writeMessage(7, (TensorShapeProto) value_); - } - if (valueCase_ == 8) { - output.writeMessage(8, (TensorProto) value_); - } - if (valueCase_ == 9) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, value_); - } - if (valueCase_ == 10) { - output.writeMessage(10, (NameAttrList) value_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (valueCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (ListValue) value_); - } - if (valueCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 2, (com.google.protobuf.ByteString) value_); - } - if (valueCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 3, (long) ((Long) value_)); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize( - 4, (float) ((Float) value_)); - } - if (valueCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 5, (boolean) ((Boolean) value_)); - } - if (valueCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, ((Integer) value_)); - } - if (valueCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (TensorShapeProto) value_); - } - if (valueCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (TensorProto) value_); - } - if (valueCase_ == 9) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, value_); - } - if (valueCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (NameAttrList) value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof AttrValue)) { - return super.equals(obj); - } - AttrValue other = (AttrValue) obj; - - if (!getValueCase().equals(other.getValueCase())) { - return false; - } - switch (valueCase_) { - case 2: - if (!getS() - .equals(other.getS())) { - return false; - } - break; - case 3: - if (getI() - != other.getI()) { - return false; - } - break; - case 4: - if (Float.floatToIntBits(getF()) - != Float.floatToIntBits( - other.getF())) { - return false; - } - break; - case 5: - if (getB() - != other.getB()) { - return false; - } - break; - case 6: - if (getTypeValue() - != other.getTypeValue()) { - return false; - } - break; - case 7: - if (!getShape() - .equals(other.getShape())) return false; - break; - case 8: - if (!getTensor() - .equals(other.getTensor())) return false; - break; - case 1: - if (!getList() - .equals(other.getList())) return false; - break; - case 10: - if (!getFunc() - .equals(other.getFunc())) return false; - break; - case 9: - if (!getPlaceholder() - .equals(other.getPlaceholder())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (valueCase_) { - case 2: - hash = (37 * hash) + S_FIELD_NUMBER; - hash = (53 * hash) + getS().hashCode(); - break; - case 3: - hash = (37 * hash) + I_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getI()); - break; - case 4: - hash = (37 * hash) + F_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getF()); - break; - case 5: - hash = (37 * hash) + B_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getB()); - break; - case 6: - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getTypeValue(); - break; - case 7: - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - break; - case 8: - hash = (37 * hash) + TENSOR_FIELD_NUMBER; - hash = (53 * hash) + getTensor().hashCode(); - break; - case 1: - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getList().hashCode(); - break; - case 10: - hash = (37 * hash) + FUNC_FIELD_NUMBER; - hash = (53 * hash) + getFunc().hashCode(); - break; - case 9: - hash = (37 * hash) + PLACEHOLDER_FIELD_NUMBER; - hash = (53 * hash) + getPlaceholder().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static AttrValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static AttrValue 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 AttrValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static AttrValue 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 AttrValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static AttrValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(AttrValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Protocol buffer representing the value for an attr used to configure an Op.
    -   * Comment indicates the corresponding attr type.  Only the field matching the
    -   * attr type may be filled.
    -   * 
    - * - * Protobuf type {@code tensorflow.AttrValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue) - AttrValueOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AttrValue.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.AttrValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - valueCase_ = 0; - value_ = null; - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; - } - - @Override - public AttrValue getDefaultInstanceForType() { - return AttrValue.getDefaultInstance(); - } - - @Override - public AttrValue build() { - AttrValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public AttrValue buildPartial() { - AttrValue result = new AttrValue(this); - if (valueCase_ == 2) { - result.value_ = value_; - } - if (valueCase_ == 3) { - result.value_ = value_; - } - if (valueCase_ == 4) { - result.value_ = value_; - } - if (valueCase_ == 5) { - result.value_ = value_; - } - if (valueCase_ == 6) { - result.value_ = value_; - } - if (valueCase_ == 7) { - if (shapeBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = shapeBuilder_.build(); - } - } - if (valueCase_ == 8) { - if (tensorBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = tensorBuilder_.build(); - } - } - if (valueCase_ == 1) { - if (listBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = listBuilder_.build(); - } - } - if (valueCase_ == 10) { - if (funcBuilder_ == null) { - result.value_ = value_; - } else { - result.value_ = funcBuilder_.build(); - } - } - if (valueCase_ == 9) { - result.value_ = value_; - } - result.valueCase_ = valueCase_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof AttrValue) { - return mergeFrom((AttrValue) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(AttrValue other) { - if (other == AttrValue.getDefaultInstance()) { - return this; - } - switch (other.getValueCase()) { - case S: { - setS(other.getS()); - break; - } - case I: { - setI(other.getI()); - break; - } - case F: { - setF(other.getF()); - break; - } - case B: { - setB(other.getB()); - break; - } - case TYPE: { - setTypeValue(other.getTypeValue()); - break; - } - case SHAPE: { - mergeShape(other.getShape()); - break; - } - case TENSOR: { - mergeTensor(other.getTensor()); - break; - } - case LIST: { - mergeList(other.getList()); - break; - } - case FUNC: { - mergeFunc(other.getFunc()); - break; - } - case PLACEHOLDER: { - valueCase_ = 9; - value_ = other.value_; - onChanged(); - break; - } - case VALUE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - AttrValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (AttrValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int valueCase_ = 0; - private Object value_; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public com.google.protobuf.ByteString getS() { - if (valueCase_ == 2) { - return (com.google.protobuf.ByteString) value_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public Builder setS(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 2; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * "string"
    -     * 
    - * - * bytes s = 2; - */ - public Builder clearS() { - if (valueCase_ == 2) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public long getI() { - if (valueCase_ == 3) { - return (Long) value_; - } - return 0L; - } - - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public Builder setI(long value) { - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * "int"
    -     * 
    - * - * int64 i = 3; - */ - public Builder clearI() { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public float getF() { - if (valueCase_ == 4) { - return (Float) value_; - } - return 0F; - } - - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public Builder setF(float value) { - valueCase_ = 4; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * "float"
    -     * 
    - * - * float f = 4; - */ - public Builder clearF() { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public boolean getB() { - if (valueCase_ == 5) { - return (Boolean) value_; - } - return false; - } - - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public Builder setB(boolean value) { - valueCase_ = 5; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * "bool"
    -     * 
    - * - * bool b = 5; - */ - public Builder clearB() { - if (valueCase_ == 5) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public int getTypeValue() { - if (valueCase_ == 6) { - return ((Integer) value_).intValue(); - } - return 0; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder setTypeValue(int value) { - valueCase_ = 6; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public DataType getType() { - if (valueCase_ == 6) { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf( - (Integer) value_); - return result == null ? DataType.UNRECOGNIZED : result; - } - return DataType.DT_INVALID; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder setType(DataType value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 6; - value_ = value.getNumber(); - onChanged(); - return this; - } - - /** - *
    -     * "type"
    -     * 
    - * - * .tensorflow.DataType type = 6; - */ - public Builder clearType() { - if (valueCase_ == 6) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> shapeBuilder_; - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public boolean hasShape() { - return valueCase_ == 7; - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - if (valueCase_ == 7) { - return (TensorShapeProto) value_; - } - return TensorShapeProto.getDefaultInstance(); - } else { - if (valueCase_ == 7) { - return shapeBuilder_.getMessage(); - } - return TensorShapeProto.getDefaultInstance(); - } - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape(TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder setShape( - TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 7; - return this; - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder mergeShape(TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (valueCase_ == 7 && - value_ != TensorShapeProto.getDefaultInstance()) { - value_ = TensorShapeProto.newBuilder((TensorShapeProto) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 7) { - shapeBuilder_.mergeFrom(value); - } - shapeBuilder_.setMessage(value); - } - valueCase_ = 7; - return this; - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 7) { - valueCase_ = 0; - value_ = null; - } - shapeBuilder_.clear(); - } - return this; - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProto.Builder getShapeBuilder() { - return getShapeFieldBuilder().getBuilder(); - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder() { - if ((valueCase_ == 7) && (shapeBuilder_ != null)) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 7) { - return (TensorShapeProto) value_; - } - return TensorShapeProto.getDefaultInstance(); - } - } - - /** - *
    -     * "shape"
    -     * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - if (!(valueCase_ == 7)) { - value_ = TensorShapeProto.getDefaultInstance(); - } - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>( - (TensorShapeProto) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 7; - onChanged();; - return shapeBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> tensorBuilder_; - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public boolean hasTensor() { - return valueCase_ == 8; - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public TensorProto getTensor() { - if (tensorBuilder_ == null) { - if (valueCase_ == 8) { - return (TensorProto) value_; - } - return TensorProto.getDefaultInstance(); - } else { - if (valueCase_ == 8) { - return tensorBuilder_.getMessage(); - } - return TensorProto.getDefaultInstance(); - } - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor(TensorProto value) { - if (tensorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - tensorBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder setTensor( - TensorProto.Builder builderForValue) { - if (tensorBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - tensorBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 8; - return this; - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder mergeTensor(TensorProto value) { - if (tensorBuilder_ == null) { - if (valueCase_ == 8 && - value_ != TensorProto.getDefaultInstance()) { - value_ = TensorProto.newBuilder((TensorProto) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 8) { - tensorBuilder_.mergeFrom(value); - } - tensorBuilder_.setMessage(value); - } - valueCase_ = 8; - return this; - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public Builder clearTensor() { - if (tensorBuilder_ == null) { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 8) { - valueCase_ = 0; - value_ = null; - } - tensorBuilder_.clear(); - } - return this; - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public TensorProto.Builder getTensorBuilder() { - return getTensorFieldBuilder().getBuilder(); - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - public TensorProtoOrBuilder getTensorOrBuilder() { - if ((valueCase_ == 8) && (tensorBuilder_ != null)) { - return tensorBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 8) { - return (TensorProto) value_; - } - return TensorProto.getDefaultInstance(); - } - } - - /** - *
    -     * "tensor"
    -     * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> - getTensorFieldBuilder() { - if (tensorBuilder_ == null) { - if (!(valueCase_ == 8)) { - value_ = TensorProto.getDefaultInstance(); - } - tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder>( - (TensorProto) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 8; - onChanged();; - return tensorBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - ListValue, ListValue.Builder, ListValueOrBuilder> listBuilder_; - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public boolean hasList() { - return valueCase_ == 1; - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public ListValue getList() { - if (listBuilder_ == null) { - if (valueCase_ == 1) { - return (ListValue) value_; - } - return ListValue.getDefaultInstance(); - } else { - if (valueCase_ == 1) { - return listBuilder_.getMessage(); - } - return ListValue.getDefaultInstance(); - } - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder setList(ListValue value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - listBuilder_.setMessage(value); - } - valueCase_ = 1; - return this; - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder setList( - ListValue.Builder builderForValue) { - if (listBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - listBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 1; - return this; - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder mergeList(ListValue value) { - if (listBuilder_ == null) { - if (valueCase_ == 1 && - value_ != ListValue.getDefaultInstance()) { - value_ = ListValue.newBuilder((ListValue) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 1) { - listBuilder_.mergeFrom(value); - } - listBuilder_.setMessage(value); - } - valueCase_ = 1; - return this; - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public Builder clearList() { - if (listBuilder_ == null) { - if (valueCase_ == 1) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 1) { - valueCase_ = 0; - value_ = null; - } - listBuilder_.clear(); - } - return this; - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public ListValue.Builder getListBuilder() { - return getListFieldBuilder().getBuilder(); - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - public ListValueOrBuilder getListOrBuilder() { - if ((valueCase_ == 1) && (listBuilder_ != null)) { - return listBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 1) { - return (ListValue) value_; - } - return ListValue.getDefaultInstance(); - } - } - - /** - *
    -     * any "list(...)"
    -     * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - ListValue, ListValue.Builder, ListValueOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - if (!(valueCase_ == 1)) { - value_ = ListValue.getDefaultInstance(); - } - listBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - ListValue, ListValue.Builder, ListValueOrBuilder>( - (ListValue) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 1; - onChanged();; - return listBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> funcBuilder_; - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public boolean hasFunc() { - return valueCase_ == 10; - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public NameAttrList getFunc() { - if (funcBuilder_ == null) { - if (valueCase_ == 10) { - return (NameAttrList) value_; - } - return NameAttrList.getDefaultInstance(); - } else { - if (valueCase_ == 10) { - return funcBuilder_.getMessage(); - } - return NameAttrList.getDefaultInstance(); - } - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder setFunc(NameAttrList value) { - if (funcBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - onChanged(); - } else { - funcBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder setFunc( - NameAttrList.Builder builderForValue) { - if (funcBuilder_ == null) { - value_ = builderForValue.build(); - onChanged(); - } else { - funcBuilder_.setMessage(builderForValue.build()); - } - valueCase_ = 10; - return this; - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder mergeFunc(NameAttrList value) { - if (funcBuilder_ == null) { - if (valueCase_ == 10 && - value_ != NameAttrList.getDefaultInstance()) { - value_ = NameAttrList.newBuilder((NameAttrList) value_) - .mergeFrom(value).buildPartial(); - } else { - value_ = value; - } - onChanged(); - } else { - if (valueCase_ == 10) { - funcBuilder_.mergeFrom(value); - } - funcBuilder_.setMessage(value); - } - valueCase_ = 10; - return this; - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public Builder clearFunc() { - if (funcBuilder_ == null) { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - } else { - if (valueCase_ == 10) { - valueCase_ = 0; - value_ = null; - } - funcBuilder_.clear(); - } - return this; - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public NameAttrList.Builder getFuncBuilder() { - return getFuncFieldBuilder().getBuilder(); - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - public NameAttrListOrBuilder getFuncOrBuilder() { - if ((valueCase_ == 10) && (funcBuilder_ != null)) { - return funcBuilder_.getMessageOrBuilder(); - } else { - if (valueCase_ == 10) { - return (NameAttrList) value_; - } - return NameAttrList.getDefaultInstance(); - } - } - - /** - *
    -     * "func" represents a function. func.name is a function's name or
    -     * a primitive op's name. func.attr.first is the name of an attr
    -     * defined for that function. func.attr.second is the value for
    -     * that attr in the instantiation.
    -     * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> - getFuncFieldBuilder() { - if (funcBuilder_ == null) { - if (!(valueCase_ == 10)) { - value_ = NameAttrList.getDefaultInstance(); - } - funcBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>( - (NameAttrList) value_, - getParentForChildren(), - isClean()); - value_ = null; - } - valueCase_ = 10; - onChanged();; - return funcBuilder_; - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public String getPlaceholder() { - Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (valueCase_ == 9) { - value_ = s; - } - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public com.google.protobuf.ByteString - getPlaceholderBytes() { - Object ref = ""; - if (valueCase_ == 9) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - if (valueCase_ == 9) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder setPlaceholder( - String value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 9; - value_ = value; - onChanged(); - return this; - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder clearPlaceholder() { - if (valueCase_ == 9) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - - /** - *
    -     * This is a placeholder only used in nodes defined inside a
    -     * function.  It indicates the attr value will be supplied when
    -     * the function is instantiated.  For example, let us suppose a
    -     * node "N" in function "FN". "N" has an attr "A" with value
    -     * placeholder = "foo". When FN is instantiated with attr "foo"
    -     * set to "bar", the instantiated node N's attr A will have been
    -     * given the value "bar".
    -     * 
    - * - * string placeholder = 9; - */ - public Builder setPlaceholderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - valueCase_ = 9; - value_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue) - } - - // @@protoc_insertion_point(class_scope:tensorflow.AttrValue) - private static final AttrValue DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new AttrValue(); - } - - public static AttrValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public AttrValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttrValue(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public AttrValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java deleted file mode 100644 index 5fbd4ee61df..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueOrBuilder.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public interface AttrValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * "string"
    -   * 
    - * - * bytes s = 2; - */ - com.google.protobuf.ByteString getS(); - - /** - *
    -   * "int"
    -   * 
    - * - * int64 i = 3; - */ - long getI(); - - /** - *
    -   * "float"
    -   * 
    - * - * float f = 4; - */ - float getF(); - - /** - *
    -   * "bool"
    -   * 
    - * - * bool b = 5; - */ - boolean getB(); - - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - int getTypeValue(); - - /** - *
    -   * "type"
    -   * 
    - * - * .tensorflow.DataType type = 6; - */ - DataType getType(); - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - boolean hasShape(); - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - TensorShapeProto getShape(); - - /** - *
    -   * "shape"
    -   * 
    - * - * .tensorflow.TensorShapeProto shape = 7; - */ - TensorShapeProtoOrBuilder getShapeOrBuilder(); - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - boolean hasTensor(); - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - TensorProto getTensor(); - - /** - *
    -   * "tensor"
    -   * 
    - * - * .tensorflow.TensorProto tensor = 8; - */ - TensorProtoOrBuilder getTensorOrBuilder(); - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - boolean hasList(); - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - AttrValue.ListValue getList(); - - /** - *
    -   * any "list(...)"
    -   * 
    - * - * .tensorflow.AttrValue.ListValue list = 1; - */ - AttrValue.ListValueOrBuilder getListOrBuilder(); - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - boolean hasFunc(); - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - NameAttrList getFunc(); - - /** - *
    -   * "func" represents a function. func.name is a function's name or
    -   * a primitive op's name. func.attr.first is the name of an attr
    -   * defined for that function. func.attr.second is the value for
    -   * that attr in the instantiation.
    -   * 
    - * - * .tensorflow.NameAttrList func = 10; - */ - NameAttrListOrBuilder getFuncOrBuilder(); - - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - String getPlaceholder(); - - /** - *
    -   * This is a placeholder only used in nodes defined inside a
    -   * function.  It indicates the attr value will be supplied when
    -   * the function is instantiated.  For example, let us suppose a
    -   * node "N" in function "FN". "N" has an attr "A" with value
    -   * placeholder = "foo". When FN is instantiated with attr "foo"
    -   * set to "bar", the instantiated node N's attr A will have been
    -   * given the value "bar".
    -   * 
    - * - * string placeholder = 9; - */ - com.google.protobuf.ByteString - getPlaceholderBytes(); - - public AttrValue.ValueCase getValueCase(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueProtos.java deleted file mode 100644 index dc10b02c1aa..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/AttrValueProtos.java +++ /dev/null @@ -1,111 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public final class AttrValueProtos { - private AttrValueProtos() {} - 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_AttrValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AttrValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_AttrValue_ListValue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NameAttrList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NameAttrList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_NameAttrList_AttrEntry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n*tensorflow/core/framework/attr_value.p" + - "roto\022\ntensorflow\032&tensorflow/core/framew" + - "ork/tensor.proto\032,tensorflow/core/framew" + - "ork/tensor_shape.proto\032%tensorflow/core/" + - "framework/types.proto\"\246\004\n\tAttrValue\022\013\n\001s" + - "\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030" - + - "\005 \001(\010H\000\022$\n\004type\030\006 \001(\0162\024.tensorflow.DataT" + - "ypeH\000\022-\n\005shape\030\007 \001(\0132\034.tensorflow.Tensor" + - "ShapeProtoH\000\022)\n\006tensor\030\010 \001(\0132\027.tensorflo" + - "w.TensorProtoH\000\022/\n\004list\030\001 \001(\0132\037.tensorfl" + - "ow.AttrValue.ListValueH\000\022(\n\004func\030\n \001(\0132\030" + - ".tensorflow.NameAttrListH\000\022\025\n\013placeholde" + - "r\030\t \001(\tH\000\032\351\001\n\tListValue\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030" + - "\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022" + - "&\n\004type\030\006 \003(\0162\024.tensorflow.DataTypeB\002\020\001\022" + - "+\n\005shape\030\007 \003(\0132\034.tensorflow.TensorShapeP" + - "roto\022\'\n\006tensor\030\010 \003(\0132\027.tensorflow.Tensor" + - "Proto\022&\n\004func\030\t \003(\0132\030.tensorflow.NameAtt" + - "rListB\007\n\005value\"\222\001\n\014NameAttrList\022\014\n\004name\030" + - "\001 \001(\t\0220\n\004attr\030\002 \003(\0132\".tensorflow.NameAtt" + - "rList.AttrEntry\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(" + - "\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrValue:" + - "\0028\001B\211\001\n\036org.tensorflow.proto.frameworkB\017" + - "AttrValueProtosP\001ZQgithub.com/tensorflow" + - "/tensorflow/tensorflow/go/core/framework" + - "/attr_value_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - TensorProtos.getDescriptor(), - TensorShapeProtos.getDescriptor(), - TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_AttrValue_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_AttrValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AttrValue_descriptor, - new String[]{"S", "I", "F", "B", "Type", "Shape", "Tensor", "List", "Func", "Placeholder", "Value",}); - internal_static_tensorflow_AttrValue_ListValue_descriptor = - internal_static_tensorflow_AttrValue_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_AttrValue_ListValue_descriptor, - new String[]{"S", "I", "F", "B", "Type", "Shape", "Tensor", "Func",}); - internal_static_tensorflow_NameAttrList_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_NameAttrList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NameAttrList_descriptor, - new String[]{"Name", "Attr",}); - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor = - internal_static_tensorflow_NameAttrList_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_NameAttrList_AttrEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, - new String[]{"Key", "Value",}); - TensorProtos.getDescriptor(); - TensorShapeProtos.getDescriptor(); - TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/DataType.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/DataType.java deleted file mode 100644 index 361e33facbe..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/DataType.java +++ /dev/null @@ -1,635 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/types.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * (== suppress_warning documentation-presence ==)
    - * LINT.IfChange
    - * 
    - * - * Protobuf enum {@code tensorflow.DataType} - */ -public enum DataType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
    -   * Not a legal value for DataType.  Used to indicate a DataType field
    -   * has not been set.
    -   * 
    - * - * DT_INVALID = 0; - */ - DT_INVALID(0), - /** - *
    -   * Data types that all computation devices are expected to be
    -   * capable to support.
    -   * 
    - * - * DT_FLOAT = 1; - */ - DT_FLOAT(1), - /** - * DT_DOUBLE = 2; - */ - DT_DOUBLE(2), - /** - * DT_INT32 = 3; - */ - DT_INT32(3), - /** - * DT_UINT8 = 4; - */ - DT_UINT8(4), - /** - * DT_INT16 = 5; - */ - DT_INT16(5), - /** - * DT_INT8 = 6; - */ - DT_INT8(6), - /** - * DT_STRING = 7; - */ - DT_STRING(7), - /** - *
    -   * Single-precision complex
    -   * 
    - * - * DT_COMPLEX64 = 8; - */ - DT_COMPLEX64(8), - /** - * DT_INT64 = 9; - */ - DT_INT64(9), - /** - * DT_BOOL = 10; - */ - DT_BOOL(10), - /** - *
    -   * Quantized int8
    -   * 
    - * - * DT_QINT8 = 11; - */ - DT_QINT8(11), - /** - *
    -   * Quantized uint8
    -   * 
    - * - * DT_QUINT8 = 12; - */ - DT_QUINT8(12), - /** - *
    -   * Quantized int32
    -   * 
    - * - * DT_QINT32 = 13; - */ - DT_QINT32(13), - /** - *
    -   * Float32 truncated to 16 bits.  Only for cast ops.
    -   * 
    - * - * DT_BFLOAT16 = 14; - */ - DT_BFLOAT16(14), - /** - *
    -   * Quantized int16
    -   * 
    - * - * DT_QINT16 = 15; - */ - DT_QINT16(15), - /** - *
    -   * Quantized uint16
    -   * 
    - * - * DT_QUINT16 = 16; - */ - DT_QUINT16(16), - /** - * DT_UINT16 = 17; - */ - DT_UINT16(17), - /** - *
    -   * Double-precision complex
    -   * 
    - * - * DT_COMPLEX128 = 18; - */ - DT_COMPLEX128(18), - /** - * DT_HALF = 19; - */ - DT_HALF(19), - /** - * DT_RESOURCE = 20; - */ - DT_RESOURCE(20), - /** - *
    -   * Arbitrary C++ data types
    -   * 
    - * - * DT_VARIANT = 21; - */ - DT_VARIANT(21), - /** - * DT_UINT32 = 22; - */ - DT_UINT32(22), - /** - * DT_UINT64 = 23; - */ - DT_UINT64(23), - /** - *
    -   * Do not use!  These are only for parameters.  Every enum above
    -   * should have a corresponding value below (verified by types_test).
    -   * 
    - * - * DT_FLOAT_REF = 101; - */ - DT_FLOAT_REF(101), - /** - * DT_DOUBLE_REF = 102; - */ - DT_DOUBLE_REF(102), - /** - * DT_INT32_REF = 103; - */ - DT_INT32_REF(103), - /** - * DT_UINT8_REF = 104; - */ - DT_UINT8_REF(104), - /** - * DT_INT16_REF = 105; - */ - DT_INT16_REF(105), - /** - * DT_INT8_REF = 106; - */ - DT_INT8_REF(106), - /** - * DT_STRING_REF = 107; - */ - DT_STRING_REF(107), - /** - * DT_COMPLEX64_REF = 108; - */ - DT_COMPLEX64_REF(108), - /** - * DT_INT64_REF = 109; - */ - DT_INT64_REF(109), - /** - * DT_BOOL_REF = 110; - */ - DT_BOOL_REF(110), - /** - * DT_QINT8_REF = 111; - */ - DT_QINT8_REF(111), - /** - * DT_QUINT8_REF = 112; - */ - DT_QUINT8_REF(112), - /** - * DT_QINT32_REF = 113; - */ - DT_QINT32_REF(113), - /** - * DT_BFLOAT16_REF = 114; - */ - DT_BFLOAT16_REF(114), - /** - * DT_QINT16_REF = 115; - */ - DT_QINT16_REF(115), - /** - * DT_QUINT16_REF = 116; - */ - DT_QUINT16_REF(116), - /** - * DT_UINT16_REF = 117; - */ - DT_UINT16_REF(117), - /** - * DT_COMPLEX128_REF = 118; - */ - DT_COMPLEX128_REF(118), - /** - * DT_HALF_REF = 119; - */ - DT_HALF_REF(119), - /** - * DT_RESOURCE_REF = 120; - */ - DT_RESOURCE_REF(120), - /** - * DT_VARIANT_REF = 121; - */ - DT_VARIANT_REF(121), - /** - * DT_UINT32_REF = 122; - */ - DT_UINT32_REF(122), - /** - * DT_UINT64_REF = 123; - */ - DT_UINT64_REF(123), - UNRECOGNIZED(-1), - ; - - /** - *
    -   * Not a legal value for DataType.  Used to indicate a DataType field
    -   * has not been set.
    -   * 
    - * - * DT_INVALID = 0; - */ - public static final int DT_INVALID_VALUE = 0; - /** - *
    -   * Data types that all computation devices are expected to be
    -   * capable to support.
    -   * 
    - * - * DT_FLOAT = 1; - */ - public static final int DT_FLOAT_VALUE = 1; - /** - * DT_DOUBLE = 2; - */ - public static final int DT_DOUBLE_VALUE = 2; - /** - * DT_INT32 = 3; - */ - public static final int DT_INT32_VALUE = 3; - /** - * DT_UINT8 = 4; - */ - public static final int DT_UINT8_VALUE = 4; - /** - * DT_INT16 = 5; - */ - public static final int DT_INT16_VALUE = 5; - /** - * DT_INT8 = 6; - */ - public static final int DT_INT8_VALUE = 6; - /** - * DT_STRING = 7; - */ - public static final int DT_STRING_VALUE = 7; - /** - *
    -   * Single-precision complex
    -   * 
    - * - * DT_COMPLEX64 = 8; - */ - public static final int DT_COMPLEX64_VALUE = 8; - /** - * DT_INT64 = 9; - */ - public static final int DT_INT64_VALUE = 9; - /** - * DT_BOOL = 10; - */ - public static final int DT_BOOL_VALUE = 10; - /** - *
    -   * Quantized int8
    -   * 
    - * - * DT_QINT8 = 11; - */ - public static final int DT_QINT8_VALUE = 11; - /** - *
    -   * Quantized uint8
    -   * 
    - * - * DT_QUINT8 = 12; - */ - public static final int DT_QUINT8_VALUE = 12; - /** - *
    -   * Quantized int32
    -   * 
    - * - * DT_QINT32 = 13; - */ - public static final int DT_QINT32_VALUE = 13; - /** - *
    -   * Float32 truncated to 16 bits.  Only for cast ops.
    -   * 
    - * - * DT_BFLOAT16 = 14; - */ - public static final int DT_BFLOAT16_VALUE = 14; - /** - *
    -   * Quantized int16
    -   * 
    - * - * DT_QINT16 = 15; - */ - public static final int DT_QINT16_VALUE = 15; - /** - *
    -   * Quantized uint16
    -   * 
    - * - * DT_QUINT16 = 16; - */ - public static final int DT_QUINT16_VALUE = 16; - /** - * DT_UINT16 = 17; - */ - public static final int DT_UINT16_VALUE = 17; - /** - *
    -   * Double-precision complex
    -   * 
    - * - * DT_COMPLEX128 = 18; - */ - public static final int DT_COMPLEX128_VALUE = 18; - /** - * DT_HALF = 19; - */ - public static final int DT_HALF_VALUE = 19; - /** - * DT_RESOURCE = 20; - */ - public static final int DT_RESOURCE_VALUE = 20; - /** - *
    -   * Arbitrary C++ data types
    -   * 
    - * - * DT_VARIANT = 21; - */ - public static final int DT_VARIANT_VALUE = 21; - /** - * DT_UINT32 = 22; - */ - public static final int DT_UINT32_VALUE = 22; - /** - * DT_UINT64 = 23; - */ - public static final int DT_UINT64_VALUE = 23; - /** - *
    -   * Do not use!  These are only for parameters.  Every enum above
    -   * should have a corresponding value below (verified by types_test).
    -   * 
    - * - * DT_FLOAT_REF = 101; - */ - public static final int DT_FLOAT_REF_VALUE = 101; - /** - * DT_DOUBLE_REF = 102; - */ - public static final int DT_DOUBLE_REF_VALUE = 102; - /** - * DT_INT32_REF = 103; - */ - public static final int DT_INT32_REF_VALUE = 103; - /** - * DT_UINT8_REF = 104; - */ - public static final int DT_UINT8_REF_VALUE = 104; - /** - * DT_INT16_REF = 105; - */ - public static final int DT_INT16_REF_VALUE = 105; - /** - * DT_INT8_REF = 106; - */ - public static final int DT_INT8_REF_VALUE = 106; - /** - * DT_STRING_REF = 107; - */ - public static final int DT_STRING_REF_VALUE = 107; - /** - * DT_COMPLEX64_REF = 108; - */ - public static final int DT_COMPLEX64_REF_VALUE = 108; - /** - * DT_INT64_REF = 109; - */ - public static final int DT_INT64_REF_VALUE = 109; - /** - * DT_BOOL_REF = 110; - */ - public static final int DT_BOOL_REF_VALUE = 110; - /** - * DT_QINT8_REF = 111; - */ - public static final int DT_QINT8_REF_VALUE = 111; - /** - * DT_QUINT8_REF = 112; - */ - public static final int DT_QUINT8_REF_VALUE = 112; - /** - * DT_QINT32_REF = 113; - */ - public static final int DT_QINT32_REF_VALUE = 113; - /** - * DT_BFLOAT16_REF = 114; - */ - public static final int DT_BFLOAT16_REF_VALUE = 114; - /** - * DT_QINT16_REF = 115; - */ - public static final int DT_QINT16_REF_VALUE = 115; - /** - * DT_QUINT16_REF = 116; - */ - public static final int DT_QUINT16_REF_VALUE = 116; - /** - * DT_UINT16_REF = 117; - */ - public static final int DT_UINT16_REF_VALUE = 117; - /** - * DT_COMPLEX128_REF = 118; - */ - public static final int DT_COMPLEX128_REF_VALUE = 118; - /** - * DT_HALF_REF = 119; - */ - public static final int DT_HALF_REF_VALUE = 119; - /** - * DT_RESOURCE_REF = 120; - */ - public static final int DT_RESOURCE_REF_VALUE = 120; - /** - * DT_VARIANT_REF = 121; - */ - public static final int DT_VARIANT_REF_VALUE = 121; - /** - * DT_UINT32_REF = 122; - */ - public static final int DT_UINT32_REF_VALUE = 122; - /** - * DT_UINT64_REF = 123; - */ - public static final int DT_UINT64_REF_VALUE = 123; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @Deprecated - public static DataType valueOf(int value) { - return forNumber(value); - } - - public static DataType forNumber(int value) { - switch (value) { - case 0: return DT_INVALID; - case 1: return DT_FLOAT; - case 2: return DT_DOUBLE; - case 3: return DT_INT32; - case 4: return DT_UINT8; - case 5: return DT_INT16; - case 6: return DT_INT8; - case 7: return DT_STRING; - case 8: return DT_COMPLEX64; - case 9: return DT_INT64; - case 10: return DT_BOOL; - case 11: return DT_QINT8; - case 12: return DT_QUINT8; - case 13: return DT_QINT32; - case 14: return DT_BFLOAT16; - case 15: return DT_QINT16; - case 16: return DT_QUINT16; - case 17: return DT_UINT16; - case 18: return DT_COMPLEX128; - case 19: return DT_HALF; - case 20: return DT_RESOURCE; - case 21: return DT_VARIANT; - case 22: return DT_UINT32; - case 23: return DT_UINT64; - case 101: return DT_FLOAT_REF; - case 102: return DT_DOUBLE_REF; - case 103: return DT_INT32_REF; - case 104: return DT_UINT8_REF; - case 105: return DT_INT16_REF; - case 106: return DT_INT8_REF; - case 107: return DT_STRING_REF; - case 108: return DT_COMPLEX64_REF; - case 109: return DT_INT64_REF; - case 110: return DT_BOOL_REF; - case 111: return DT_QINT8_REF; - case 112: return DT_QUINT8_REF; - case 113: return DT_QINT32_REF; - case 114: return DT_BFLOAT16_REF; - case 115: return DT_QINT16_REF; - case 116: return DT_QUINT16_REF; - case 117: return DT_UINT16_REF; - case 118: return DT_COMPLEX128_REF; - case 119: return DT_HALF_REF; - case 120: return DT_RESOURCE_REF; - case 121: return DT_VARIANT_REF; - case 122: return DT_UINT32_REF; - case 123: return DT_UINT64_REF; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap< - DataType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public DataType findValueByNumber(int number) { - return DataType.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 TypesProtos.getDescriptor().getEnumTypes().get(0); - } - - private static final DataType[] VALUES = values(); - - public static DataType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private DataType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:tensorflow.DataType) -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrList.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrList.java deleted file mode 100644 index adb1f9c66d1..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrList.java +++ /dev/null @@ -1,907 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A list of attr names and their values. The whole list is attached
    - * with a string name.  E.g., MatMul[T=float].
    - * 
    - * - * Protobuf type {@code tensorflow.NameAttrList} - */ -public final class NameAttrList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.NameAttrList) - NameAttrListOrBuilder { -private static final long serialVersionUID = 0L; - // Use NameAttrList.newBuilder() to construct. - private NameAttrList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private NameAttrList() { - name_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new NameAttrList(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private NameAttrList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - attr__ = input.readMessage( - AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attr_.getMutableMap().put( - attr__.getKey(), attr__.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 AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - NameAttrList.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ATTR_FIELD_NUMBER = 2; - private static final class AttrDefaultEntryHolder { - - static final com.google.protobuf.MapEntry< - String, AttrValue> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - AttrValueProtos.internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - AttrValue.getDefaultInstance()); - } - - private com.google.protobuf.MapField< - String, AttrValue> attr_; - - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - String key) { - if (key == null) { - throw new NullPointerException(); - } - return internalGetAttr().getMap().containsKey(key); - } - - /** - * Use {@link #getAttrMap()} instead. - */ - @Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public AttrValue getAttrOrDefault( - String key, - AttrValue defaultValue) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public AttrValue getAttrOrThrow( - String key) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttr(), - AttrDefaultEntryHolder.defaultEntry, - 2); - unknownFields.writeTo(output); - } - - @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_); - } - for (java.util.Map.Entry entry - : internalGetAttr().getMap().entrySet()) { - com.google.protobuf.MapEntry - attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, attr__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof NameAttrList)) { - return super.equals(obj); - } - NameAttrList other = (NameAttrList) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!internalGetAttr().equals( - other.internalGetAttr())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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(); - if (!internalGetAttr().getMap().isEmpty()) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttr().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static NameAttrList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static NameAttrList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static NameAttrList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static NameAttrList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static NameAttrList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static NameAttrList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static NameAttrList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static NameAttrList 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 NameAttrList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static NameAttrList 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 NameAttrList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static NameAttrList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(NameAttrList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
    -   * A list of attr names and their values. The whole list is attached
    -   * with a string name.  E.g., MatMul[T=float].
    -   * 
    - * - * Protobuf type {@code tensorflow.NameAttrList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.NameAttrList) - NameAttrListOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 2: - return internalGetAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 2: - return internalGetMutableAttr(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - NameAttrList.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.NameAttrList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - internalGetMutableAttr().clear(); - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; - } - - @Override - public NameAttrList getDefaultInstanceForType() { - return NameAttrList.getDefaultInstance(); - } - - @Override - public NameAttrList build() { - NameAttrList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public NameAttrList buildPartial() { - NameAttrList result = new NameAttrList(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.attr_ = internalGetAttr(); - result.attr_.makeImmutable(); - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof NameAttrList) { - return mergeFrom((NameAttrList) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(NameAttrList other) { - if (other == NameAttrList.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - internalGetMutableAttr().mergeFrom( - other.internalGetAttr()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - NameAttrList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (NameAttrList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private Object name_ = ""; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * 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 com.google.protobuf.MapField< - String, AttrValue> attr_; - - private com.google.protobuf.MapField - internalGetAttr() { - if (attr_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttrDefaultEntryHolder.defaultEntry); - } - return attr_; - } - - private com.google.protobuf.MapField - internalGetMutableAttr() { - onChanged(); - ; - if (attr_ == null) { - attr_ = com.google.protobuf.MapField.newMapField( - AttrDefaultEntryHolder.defaultEntry); - } - if (!attr_.isMutable()) { - attr_ = attr_.copy(); - } - return attr_; - } - - public int getAttrCount() { - return internalGetAttr().getMap().size(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public boolean containsAttr( - String key) { - if (key == null) { - throw new NullPointerException(); - } - return internalGetAttr().getMap().containsKey(key); - } - - /** - * Use {@link #getAttrMap()} instead. - */ - @Deprecated - public java.util.Map getAttr() { - return getAttrMap(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public java.util.Map getAttrMap() { - return internalGetAttr().getMap(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public AttrValue getAttrOrDefault( - String key, - AttrValue defaultValue) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = - internalGetAttr().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public AttrValue getAttrOrThrow( - String key) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = - internalGetAttr().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttr() { - internalGetMutableAttr().getMutableMap() - .clear(); - return this; - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder removeAttr( - String key) { - if (key == null) { - throw new NullPointerException(); - } - internalGetMutableAttr().getMutableMap() - .remove(key); - return this; - } - - /** - * Use alternate mutation accessors instead. - */ - @Deprecated - public java.util.Map - getMutableAttr() { - return internalGetMutableAttr().getMutableMap(); - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - public Builder putAttr( - String key, - AttrValue value) { - if (key == null) { - throw new NullPointerException(); - } - if (value == null) { - throw new NullPointerException(); - } - internalGetMutableAttr().getMutableMap() - .put(key, value); - return this; - } - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - public Builder putAllAttr( - java.util.Map values) { - internalGetMutableAttr().getMutableMap() - .putAll(values); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.NameAttrList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.NameAttrList) - private static final NameAttrList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new NameAttrList(); - } - - public static NameAttrList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public NameAttrList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new NameAttrList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public NameAttrList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java deleted file mode 100644 index 28d9c352eea..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/NameAttrListOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/attr_value.proto - -package org.tensorflow.proto.framework; - -public interface NameAttrListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.NameAttrList) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - String getName(); - - /** - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - int getAttrCount(); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - boolean containsAttr( - String key); - - /** - * Use {@link #getAttrMap()} instead. - */ - @Deprecated - java.util.Map - getAttr(); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - java.util.Map - getAttrMap(); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - AttrValue getAttrOrDefault( - String key, - AttrValue defaultValue); - - /** - * map<string, .tensorflow.AttrValue> attr = 2; - */ - - AttrValue getAttrOrThrow( - String key); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDef.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDef.java deleted file mode 100644 index b2ceb5da4e3..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDef.java +++ /dev/null @@ -1,6658 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    - * using the "op" field which should match the name of a OpDef.
    - * LINT.IfChange
    - * 
    - * - * Protobuf type {@code tensorflow.OpDef} - */ -public final class OpDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef) - OpDefOrBuilder { -private static final long serialVersionUID = 0L; - - // Use OpDef.newBuilder() to construct. - private OpDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private OpDef() { - name_ = ""; - inputArg_ = java.util.Collections.emptyList(); - outputArg_ = java.util.Collections.emptyList(); - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - attr_ = java.util.Collections.emptyList(); - summary_ = ""; - description_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new OpDef(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private OpDef( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - inputArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - inputArg_.add( - input.readMessage(ArgDef.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - outputArg_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - outputArg_.add( - input.readMessage(ArgDef.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - attr_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - attr_.add( - input.readMessage(AttrDef.parser(), extensionRegistry)); - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - summary_ = s; - break; - } - case 50: { - String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 66: { - OpDeprecation.Builder subBuilder = null; - if (deprecation_ != null) { - subBuilder = deprecation_.toBuilder(); - } - deprecation_ = input.readMessage(OpDeprecation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deprecation_); - deprecation_ = subBuilder.buildPartial(); - } - - break; - } - case 128: { - - isAggregate_ = input.readBool(); - break; - } - case 136: { - - isStateful_ = input.readBool(); - break; - } - case 144: { - - isCommutative_ = input.readBool(); - break; - } - case 152: { - - allowsUninitializedInput_ = input.readBool(); - break; - } - case 162: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - controlOutput_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - controlOutput_.add(s); - 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)) { - inputArg_ = java.util.Collections.unmodifiableList(inputArg_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - outputArg_ = java.util.Collections.unmodifiableList(outputArg_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - controlOutput_ = controlOutput_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpDef.class, Builder.class); - } - - public interface ArgDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.ArgDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - String getName(); - - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - String getDescription(); - - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - int getTypeValue(); - - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - DataType getType(); - - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - String getTypeAttr(); - - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - com.google.protobuf.ByteString - getTypeAttrBytes(); - - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - String getNumberAttr(); - - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - com.google.protobuf.ByteString - getNumberAttrBytes(); - - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - String getTypeListAttr(); - - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - com.google.protobuf.ByteString - getTypeListAttrBytes(); - - /** - *
    -     * For inputs: if true, the inputs are required to be refs.
    -     *   By default, inputs can be either refs or non-refs.
    -     * For outputs: if true, outputs are refs, otherwise they are not.
    -     * 
    - * - * bool is_ref = 16; - */ - boolean getIsRef(); - } - - /** - *
    -   * For describing inputs and outputs.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef.ArgDef} - */ - public static final class ArgDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef.ArgDef) - ArgDefOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use ArgDef.newBuilder() to construct. - private ArgDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ArgDef() { - name_ = ""; - description_ = ""; - type_ = 0; - typeAttr_ = ""; - numberAttr_ = ""; - typeListAttr_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new ArgDef(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private ArgDef( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 24: { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - typeAttr_ = s; - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - numberAttr_ = s; - break; - } - case 50: { - String s = input.readStringRequireUtf8(); - - typeListAttr_ = s; - break; - } - case 128: { - - isRef_ = input.readBool(); - 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 OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ArgDef.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -     * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile Object description_; - - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -     * Human readable description.
    -     * 
    - * - * string description = 2; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 3; - private int type_; - - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - - /** - *
    -     * Describes the type of one or more tensors that are accepted/produced
    -     * by this input/output arg.  The only legal combinations are:
    -     * * For a single tensor: either the "type" field is set or the
    -     *   "type_attr" field is set to the name of an attr with type "type".
    -     * * For a sequence of tensors with the same type: the "number_attr"
    -     *   field will be set to the name of an attr with type "int", and
    -     *   either the "type" or "type_attr" field will be set as for
    -     *   single tensors.
    -     * * For a sequence of tensors, the "type_list_attr" field will be set
    -     *   to the name of an attr with type "list(type)".
    -     * 
    - * - * .tensorflow.DataType type = 3; - */ - public DataType getType() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(type_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - public static final int TYPE_ATTR_FIELD_NUMBER = 4; - private volatile Object typeAttr_; - - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - public String getTypeAttr() { - Object ref = typeAttr_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeAttr_ = s; - return s; - } - } - - /** - *
    -     * if specified, attr must have type "type"
    -     * 
    - * - * string type_attr = 4; - */ - public com.google.protobuf.ByteString - getTypeAttrBytes() { - Object ref = typeAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NUMBER_ATTR_FIELD_NUMBER = 5; - private volatile Object numberAttr_; - - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - public String getNumberAttr() { - Object ref = numberAttr_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - numberAttr_ = s; - return s; - } - } - - /** - *
    -     * if specified, attr must have type "int"
    -     * 
    - * - * string number_attr = 5; - */ - public com.google.protobuf.ByteString - getNumberAttrBytes() { - Object ref = numberAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - numberAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_LIST_ATTR_FIELD_NUMBER = 6; - private volatile Object typeListAttr_; - - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - public String getTypeListAttr() { - Object ref = typeListAttr_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeListAttr_ = s; - return s; - } - } - - /** - *
    -     * If specified, attr must have type "list(type)", and none of
    -     * type, type_attr, and number_attr may be specified.
    -     * 
    - * - * string type_list_attr = 6; - */ - public com.google.protobuf.ByteString - getTypeListAttrBytes() { - Object ref = typeListAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeListAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IS_REF_FIELD_NUMBER = 16; - private boolean isRef_; - - /** - *
    -     * For inputs: if true, the inputs are required to be refs.
    -     *   By default, inputs can be either refs or non-refs.
    -     * For outputs: if true, outputs are refs, otherwise they are not.
    -     * 
    - * - * bool is_ref = 16; - */ - public boolean getIsRef() { - return isRef_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @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 (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); - } - if (type_ != DataType.DT_INVALID.getNumber()) { - output.writeEnum(3, type_); - } - if (!getTypeAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, typeAttr_); - } - if (!getNumberAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, numberAttr_); - } - if (!getTypeListAttrBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, typeListAttr_); - } - if (isRef_ != false) { - output.writeBool(16, isRef_); - } - unknownFields.writeTo(output); - } - - @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 (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); - } - if (type_ != DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, type_); - } - if (!getTypeAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, typeAttr_); - } - if (!getNumberAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, numberAttr_); - } - if (!getTypeListAttrBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, typeListAttr_); - } - if (isRef_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, isRef_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ArgDef)) { - return super.equals(obj); - } - ArgDef other = (ArgDef) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!getDescription() - .equals(other.getDescription())) return false; - if (type_ != other.type_) return false; - if (!getTypeAttr() - .equals(other.getTypeAttr())) return false; - if (!getNumberAttr() - .equals(other.getNumberAttr())) return false; - if (!getTypeListAttr() - .equals(other.getTypeListAttr())) return false; - if (getIsRef() - != other.getIsRef()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + TYPE_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getTypeAttr().hashCode(); - hash = (37 * hash) + NUMBER_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getNumberAttr().hashCode(); - hash = (37 * hash) + TYPE_LIST_ATTR_FIELD_NUMBER; - hash = (53 * hash) + getTypeListAttr().hashCode(); - hash = (37 * hash) + IS_REF_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsRef()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ArgDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ArgDef parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ArgDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ArgDef parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ArgDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ArgDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ArgDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ArgDef 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 ArgDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static ArgDef 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 ArgDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ArgDef parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(ArgDef prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * For describing inputs and outputs.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpDef.ArgDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.ArgDef) - ArgDefOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ArgDef.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.ArgDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - type_ = 0; - - typeAttr_ = ""; - - numberAttr_ = ""; - - typeListAttr_ = ""; - - isRef_ = false; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; - } - - @Override - public ArgDef getDefaultInstanceForType() { - return ArgDef.getDefaultInstance(); - } - - @Override - public ArgDef build() { - ArgDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public ArgDef buildPartial() { - ArgDef result = new ArgDef(this); - result.name_ = name_; - result.description_ = description_; - result.type_ = type_; - result.typeAttr_ = typeAttr_; - result.numberAttr_ = numberAttr_; - result.typeListAttr_ = typeListAttr_; - result.isRef_ = isRef_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ArgDef) { - return mergeFrom((ArgDef) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ArgDef other) { - if (other == ArgDef.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (!other.getTypeAttr().isEmpty()) { - typeAttr_ = other.typeAttr_; - onChanged(); - } - if (!other.getNumberAttr().isEmpty()) { - numberAttr_ = other.numberAttr_; - onChanged(); - } - if (!other.getTypeListAttr().isEmpty()) { - typeListAttr_ = other.typeListAttr_; - onChanged(); - } - if (other.getIsRef() != false) { - setIsRef(other.getIsRef()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ArgDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ArgDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - *
    -       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    -       * 
    - * - * 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 Object description_ = ""; - - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -       * Human readable description.
    -       * 
    - * - * string description = 2; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private int type_ = 0; - - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public int getTypeValue() { - return type_; - } - - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setTypeValue(int value) { - type_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public DataType getType() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(type_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder setType(DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - - /** - *
    -       * Describes the type of one or more tensors that are accepted/produced
    -       * by this input/output arg.  The only legal combinations are:
    -       * * For a single tensor: either the "type" field is set or the
    -       *   "type_attr" field is set to the name of an attr with type "type".
    -       * * For a sequence of tensors with the same type: the "number_attr"
    -       *   field will be set to the name of an attr with type "int", and
    -       *   either the "type" or "type_attr" field will be set as for
    -       *   single tensors.
    -       * * For a sequence of tensors, the "type_list_attr" field will be set
    -       *   to the name of an attr with type "list(type)".
    -       * 
    - * - * .tensorflow.DataType type = 3; - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private Object typeAttr_ = ""; - - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public String getTypeAttr() { - Object ref = typeAttr_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeAttr_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public com.google.protobuf.ByteString - getTypeAttrBytes() { - Object ref = typeAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder setTypeAttr( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeAttr_ = value; - onChanged(); - return this; - } - - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder clearTypeAttr() { - - typeAttr_ = getDefaultInstance().getTypeAttr(); - onChanged(); - return this; - } - - /** - *
    -       * if specified, attr must have type "type"
    -       * 
    - * - * string type_attr = 4; - */ - public Builder setTypeAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeAttr_ = value; - onChanged(); - return this; - } - - private Object numberAttr_ = ""; - - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public String getNumberAttr() { - Object ref = numberAttr_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - numberAttr_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public com.google.protobuf.ByteString - getNumberAttrBytes() { - Object ref = numberAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - numberAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder setNumberAttr( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - numberAttr_ = value; - onChanged(); - return this; - } - - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder clearNumberAttr() { - - numberAttr_ = getDefaultInstance().getNumberAttr(); - onChanged(); - return this; - } - - /** - *
    -       * if specified, attr must have type "int"
    -       * 
    - * - * string number_attr = 5; - */ - public Builder setNumberAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - numberAttr_ = value; - onChanged(); - return this; - } - - private Object typeListAttr_ = ""; - - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public String getTypeListAttr() { - Object ref = typeListAttr_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeListAttr_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public com.google.protobuf.ByteString - getTypeListAttrBytes() { - Object ref = typeListAttr_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeListAttr_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder setTypeListAttr( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeListAttr_ = value; - onChanged(); - return this; - } - - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder clearTypeListAttr() { - - typeListAttr_ = getDefaultInstance().getTypeListAttr(); - onChanged(); - return this; - } - - /** - *
    -       * If specified, attr must have type "list(type)", and none of
    -       * type, type_attr, and number_attr may be specified.
    -       * 
    - * - * string type_list_attr = 6; - */ - public Builder setTypeListAttrBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeListAttr_ = value; - onChanged(); - return this; - } - - private boolean isRef_ ; - - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public boolean getIsRef() { - return isRef_; - } - - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public Builder setIsRef(boolean value) { - - isRef_ = value; - onChanged(); - return this; - } - - /** - *
    -       * For inputs: if true, the inputs are required to be refs.
    -       *   By default, inputs can be either refs or non-refs.
    -       * For outputs: if true, outputs are refs, otherwise they are not.
    -       * 
    - * - * bool is_ref = 16; - */ - public Builder clearIsRef() { - - isRef_ = false; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.OpDef.ArgDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef.ArgDef) - private static final ArgDef DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new ArgDef(); - } - - public static ArgDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public ArgDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ArgDef(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public ArgDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface AttrDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.AttrDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - String getName(); - - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - String getType(); - - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - boolean hasDefaultValue(); - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - AttrValue getDefaultValue(); - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - AttrValueOrBuilder getDefaultValueOrBuilder(); - - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - String getDescription(); - - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -     * For type == "int", this is a minimum value.  For "list(___)"
    -     * types, this is the minimum length.
    -     * 
    - * - * bool has_minimum = 5; - */ - boolean getHasMinimum(); - - /** - * int64 minimum = 6; - */ - long getMinimum(); - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - boolean hasAllowedValues(); - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - AttrValue getAllowedValues(); - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - AttrValueOrBuilder getAllowedValuesOrBuilder(); - } - - /** - *
    -   * Description of the graph-construction-time configuration of this
    -   * Op.  That is to say, this describes the attr fields that will
    -   * be specified in the NodeDef.
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef.AttrDef} - */ - public static final class AttrDef extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDef.AttrDef) - AttrDefOrBuilder { - - private static final long serialVersionUID = 0L; - - // Use AttrDef.newBuilder() to construct. - private AttrDef(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private AttrDef() { - name_ = ""; - type_ = ""; - description_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new AttrDef(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private AttrDef( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - type_ = s; - break; - } - case 26: { - AttrValue.Builder subBuilder = null; - if (defaultValue_ != null) { - subBuilder = defaultValue_.toBuilder(); - } - defaultValue_ = input.readMessage(AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(defaultValue_); - defaultValue_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 40: { - - hasMinimum_ = input.readBool(); - break; - } - case 48: { - - minimum_ = input.readInt64(); - break; - } - case 58: { - AttrValue.Builder subBuilder = null; - if (allowedValues_ != null) { - subBuilder = allowedValues_.toBuilder(); - } - allowedValues_ = input.readMessage(AttrValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(allowedValues_); - allowedValues_ = subBuilder.buildPartial(); - } - - 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 OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AttrDef.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -     * A descriptive name for the argument.  May be used, e.g. by the
    -     * Python client, as a keyword argument name, and so should match
    -     * the regexp "[a-z][a-z0-9_]+".
    -     * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 2; - private volatile Object type_; - - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - public String getType() { - Object ref = type_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - type_ = s; - return s; - } - } - - /** - *
    -     * One of the type names from attr_value.proto ("string", "list(string)",
    -     * "int", etc.).
    -     * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; - private AttrValue defaultValue_; - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValue_ != null; - } - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue getDefaultValue() { - return defaultValue_ == null ? AttrValue.getDefaultInstance() : defaultValue_; - } - - /** - *
    -     * A reasonable default for this attribute if the user does not supply
    -     * a value.  If not specified, the user must supply a value.
    -     * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValueOrBuilder getDefaultValueOrBuilder() { - return getDefaultValue(); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 4; - private volatile Object description_; - - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -     * Human-readable description.
    -     * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HAS_MINIMUM_FIELD_NUMBER = 5; - private boolean hasMinimum_; - - /** - *
    -     * For type == "int", this is a minimum value.  For "list(___)"
    -     * types, this is the minimum length.
    -     * 
    - * - * bool has_minimum = 5; - */ - public boolean getHasMinimum() { - return hasMinimum_; - } - - public static final int MINIMUM_FIELD_NUMBER = 6; - private long minimum_; - - /** - * int64 minimum = 6; - */ - public long getMinimum() { - return minimum_; - } - - public static final int ALLOWED_VALUES_FIELD_NUMBER = 7; - private AttrValue allowedValues_; - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public boolean hasAllowedValues() { - return allowedValues_ != null; - } - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public AttrValue getAllowedValues() { - return allowedValues_ == null ? AttrValue.getDefaultInstance() : allowedValues_; - } - - /** - *
    -     * The set of allowed values.  Has type that is the "list" version
    -     * of the "type" field above (uses the "list" field of AttrValue).
    -     * If type == "type" or "list(type)" above, then the "type" field
    -     * of "allowed_values.list" has the set of allowed DataTypes.
    -     * If type == "string" or "list(string)", then the "s" field of
    -     * "allowed_values.list" has the set of allowed strings.
    -     * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public AttrValueOrBuilder getAllowedValuesOrBuilder() { - return getAllowedValues(); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @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 (!getTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); - } - if (defaultValue_ != null) { - output.writeMessage(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); - } - if (hasMinimum_ != false) { - output.writeBool(5, hasMinimum_); - } - if (minimum_ != 0L) { - output.writeInt64(6, minimum_); - } - if (allowedValues_ != null) { - output.writeMessage(7, getAllowedValues()); - } - unknownFields.writeTo(output); - } - - @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 (!getTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); - } - if (defaultValue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDefaultValue()); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); - } - if (hasMinimum_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, hasMinimum_); - } - if (minimum_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(6, minimum_); - } - if (allowedValues_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getAllowedValues()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof AttrDef)) { - return super.equals(obj); - } - AttrDef other = (AttrDef) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!getType() - .equals(other.getType())) return false; - if (hasDefaultValue() != other.hasDefaultValue()) return false; - if (hasDefaultValue()) { - if (!getDefaultValue() - .equals(other.getDefaultValue())) return false; - } - if (!getDescription() - .equals(other.getDescription())) return false; - if (getHasMinimum() - != other.getHasMinimum()) return false; - if (getMinimum() - != other.getMinimum()) return false; - if (hasAllowedValues() != other.hasAllowedValues()) return false; - if (hasAllowedValues()) { - if (!getAllowedValues() - .equals(other.getAllowedValues())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - if (hasDefaultValue()) { - hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getDefaultValue().hashCode(); - } - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + HAS_MINIMUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getHasMinimum()); - hash = (37 * hash) + MINIMUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMinimum()); - if (hasAllowedValues()) { - hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; - hash = (53 * hash) + getAllowedValues().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static AttrDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrDef parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrDef parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static AttrDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static AttrDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static AttrDef 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 AttrDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static AttrDef 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 AttrDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static AttrDef parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(AttrDef prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * Description of the graph-construction-time configuration of this
    -     * Op.  That is to say, this describes the attr fields that will
    -     * be specified in the NodeDef.
    -     * 
    - * - * Protobuf type {@code tensorflow.OpDef.AttrDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.AttrDef) - AttrDefOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AttrDef.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.AttrDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - type_ = ""; - - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - description_ = ""; - - hasMinimum_ = false; - - minimum_ = 0L; - - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; - } - - @Override - public AttrDef getDefaultInstanceForType() { - return AttrDef.getDefaultInstance(); - } - - @Override - public AttrDef build() { - AttrDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public AttrDef buildPartial() { - AttrDef result = new AttrDef(this); - result.name_ = name_; - result.type_ = type_; - if (defaultValueBuilder_ == null) { - result.defaultValue_ = defaultValue_; - } else { - result.defaultValue_ = defaultValueBuilder_.build(); - } - result.description_ = description_; - result.hasMinimum_ = hasMinimum_; - result.minimum_ = minimum_; - if (allowedValuesBuilder_ == null) { - result.allowedValues_ = allowedValues_; - } else { - result.allowedValues_ = allowedValuesBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof AttrDef) { - return mergeFrom((AttrDef) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(AttrDef other) { - if (other == AttrDef.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getType().isEmpty()) { - type_ = other.type_; - onChanged(); - } - if (other.hasDefaultValue()) { - mergeDefaultValue(other.getDefaultValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.getHasMinimum() != false) { - setHasMinimum(other.getHasMinimum()); - } - if (other.getMinimum() != 0L) { - setMinimum(other.getMinimum()); - } - if (other.hasAllowedValues()) { - mergeAllowedValues(other.getAllowedValues()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - AttrDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (AttrDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - *
    -       * A descriptive name for the argument.  May be used, e.g. by the
    -       * Python client, as a keyword argument name, and so should match
    -       * the regexp "[a-z][a-z0-9_]+".
    -       * 
    - * - * 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 Object type_ = ""; - - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public String getType() { - Object ref = type_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - type_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public com.google.protobuf.ByteString - getTypeBytes() { - Object ref = type_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - type_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder setType( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value; - onChanged(); - return this; - } - - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder clearType() { - - type_ = getDefaultInstance().getType(); - onChanged(); - return this; - } - - /** - *
    -       * One of the type names from attr_value.proto ("string", "list(string)",
    -       * "int", etc.).
    -       * 
    - * - * string type = 2; - */ - public Builder setTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - type_ = value; - onChanged(); - return this; - } - - private AttrValue defaultValue_; - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> defaultValueBuilder_; - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public boolean hasDefaultValue() { - return defaultValueBuilder_ != null || defaultValue_ != null; - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue getDefaultValue() { - if (defaultValueBuilder_ == null) { - return defaultValue_ == null ? AttrValue.getDefaultInstance() : defaultValue_; - } else { - return defaultValueBuilder_.getMessage(); - } - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue(AttrValue value) { - if (defaultValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - defaultValue_ = value; - onChanged(); - } else { - defaultValueBuilder_.setMessage(value); - } - - return this; - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder setDefaultValue( - AttrValue.Builder builderForValue) { - if (defaultValueBuilder_ == null) { - defaultValue_ = builderForValue.build(); - onChanged(); - } else { - defaultValueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder mergeDefaultValue(AttrValue value) { - if (defaultValueBuilder_ == null) { - if (defaultValue_ != null) { - defaultValue_ = - AttrValue.newBuilder(defaultValue_).mergeFrom(value).buildPartial(); - } else { - defaultValue_ = value; - } - onChanged(); - } else { - defaultValueBuilder_.mergeFrom(value); - } - - return this; - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public Builder clearDefaultValue() { - if (defaultValueBuilder_ == null) { - defaultValue_ = null; - onChanged(); - } else { - defaultValue_ = null; - defaultValueBuilder_ = null; - } - - return this; - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValue.Builder getDefaultValueBuilder() { - - onChanged(); - return getDefaultValueFieldBuilder().getBuilder(); - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - public AttrValueOrBuilder getDefaultValueOrBuilder() { - if (defaultValueBuilder_ != null) { - return defaultValueBuilder_.getMessageOrBuilder(); - } else { - return defaultValue_ == null ? - AttrValue.getDefaultInstance() : defaultValue_; - } - } - - /** - *
    -       * A reasonable default for this attribute if the user does not supply
    -       * a value.  If not specified, the user must supply a value.
    -       * 
    - * - * .tensorflow.AttrValue default_value = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> - getDefaultValueFieldBuilder() { - if (defaultValueBuilder_ == null) { - defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder>( - getDefaultValue(), - getParentForChildren(), - isClean()); - defaultValue_ = null; - } - return defaultValueBuilder_; - } - - private Object description_ = ""; - - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -       * Human-readable description.
    -       * 
    - * - * string description = 4; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private boolean hasMinimum_ ; - - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public boolean getHasMinimum() { - return hasMinimum_; - } - - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public Builder setHasMinimum(boolean value) { - - hasMinimum_ = value; - onChanged(); - return this; - } - - /** - *
    -       * For type == "int", this is a minimum value.  For "list(___)"
    -       * types, this is the minimum length.
    -       * 
    - * - * bool has_minimum = 5; - */ - public Builder clearHasMinimum() { - - hasMinimum_ = false; - onChanged(); - return this; - } - - private long minimum_ ; - - /** - * int64 minimum = 6; - */ - public long getMinimum() { - return minimum_; - } - - /** - * int64 minimum = 6; - */ - public Builder setMinimum(long value) { - - minimum_ = value; - onChanged(); - return this; - } - - /** - * int64 minimum = 6; - */ - public Builder clearMinimum() { - - minimum_ = 0L; - onChanged(); - return this; - } - - private AttrValue allowedValues_; - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> allowedValuesBuilder_; - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public boolean hasAllowedValues() { - return allowedValuesBuilder_ != null || allowedValues_ != null; - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public AttrValue getAllowedValues() { - if (allowedValuesBuilder_ == null) { - return allowedValues_ == null ? AttrValue.getDefaultInstance() : allowedValues_; - } else { - return allowedValuesBuilder_.getMessage(); - } - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder setAllowedValues(AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - allowedValues_ = value; - onChanged(); - } else { - allowedValuesBuilder_.setMessage(value); - } - - return this; - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder setAllowedValues( - AttrValue.Builder builderForValue) { - if (allowedValuesBuilder_ == null) { - allowedValues_ = builderForValue.build(); - onChanged(); - } else { - allowedValuesBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder mergeAllowedValues(AttrValue value) { - if (allowedValuesBuilder_ == null) { - if (allowedValues_ != null) { - allowedValues_ = - AttrValue.newBuilder(allowedValues_).mergeFrom(value).buildPartial(); - } else { - allowedValues_ = value; - } - onChanged(); - } else { - allowedValuesBuilder_.mergeFrom(value); - } - - return this; - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public Builder clearAllowedValues() { - if (allowedValuesBuilder_ == null) { - allowedValues_ = null; - onChanged(); - } else { - allowedValues_ = null; - allowedValuesBuilder_ = null; - } - - return this; - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public AttrValue.Builder getAllowedValuesBuilder() { - - onChanged(); - return getAllowedValuesFieldBuilder().getBuilder(); - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - public AttrValueOrBuilder getAllowedValuesOrBuilder() { - if (allowedValuesBuilder_ != null) { - return allowedValuesBuilder_.getMessageOrBuilder(); - } else { - return allowedValues_ == null ? - AttrValue.getDefaultInstance() : allowedValues_; - } - } - - /** - *
    -       * The set of allowed values.  Has type that is the "list" version
    -       * of the "type" field above (uses the "list" field of AttrValue).
    -       * If type == "type" or "list(type)" above, then the "type" field
    -       * of "allowed_values.list" has the set of allowed DataTypes.
    -       * If type == "string" or "list(string)", then the "s" field of
    -       * "allowed_values.list" has the set of allowed strings.
    -       * 
    - * - * .tensorflow.AttrValue allowed_values = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder> - getAllowedValuesFieldBuilder() { - if (allowedValuesBuilder_ == null) { - allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - AttrValue, AttrValue.Builder, AttrValueOrBuilder>( - getAllowedValues(), - getParentForChildren(), - isClean()); - allowedValues_ = null; - } - return allowedValuesBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.OpDef.AttrDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef.AttrDef) - private static final AttrDef DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new AttrDef(); - } - - public static AttrDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public AttrDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttrDef(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public AttrDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INPUT_ARG_FIELD_NUMBER = 2; - private java.util.List inputArg_; - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List getInputArgList() { - return inputArg_; - } - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgOrBuilderList() { - return inputArg_; - } - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public int getInputArgCount() { - return inputArg_.size(); - } - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDef getInputArg(int index) { - return inputArg_.get(index); - } - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDefOrBuilder getInputArgOrBuilder( - int index) { - return inputArg_.get(index); - } - - public static final int OUTPUT_ARG_FIELD_NUMBER = 3; - private java.util.List outputArg_; - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List getOutputArgList() { - return outputArg_; - } - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgOrBuilderList() { - return outputArg_; - } - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public int getOutputArgCount() { - return outputArg_.size(); - } - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDef getOutputArg(int index) { - return outputArg_.get(index); - } - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDefOrBuilder getOutputArgOrBuilder( - int index) { - return outputArg_.get(index); - } - - public static final int CONTROL_OUTPUT_FIELD_NUMBER = 20; - private com.google.protobuf.LazyStringList controlOutput_; - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ProtocolStringList - getControlOutputList() { - return controlOutput_; - } - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public int getControlOutputCount() { - return controlOutput_.size(); - } - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public String getControlOutput(int index) { - return controlOutput_.get(index); - } - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ByteString - getControlOutputBytes(int index) { - return controlOutput_.getByteString(index); - } - - public static final int ATTR_FIELD_NUMBER = 4; - private java.util.List attr_; - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List getAttrList() { - return attr_; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrOrBuilderList() { - return attr_; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public int getAttrCount() { - return attr_.size(); - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDef getAttr(int index) { - return attr_.get(index); - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDefOrBuilder getAttrOrBuilder( - int index) { - return attr_.get(index); - } - - public static final int DEPRECATION_FIELD_NUMBER = 8; - private OpDeprecation deprecation_; - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public boolean hasDeprecation() { - return deprecation_ != null; - } - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public OpDeprecation getDeprecation() { - return deprecation_ == null ? OpDeprecation.getDefaultInstance() : deprecation_; - } - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public OpDeprecationOrBuilder getDeprecationOrBuilder() { - return getDeprecation(); - } - - public static final int SUMMARY_FIELD_NUMBER = 5; - private volatile Object summary_; - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - public String getSummary() { - Object ref = summary_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - summary_ = s; - return s; - } - } - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 6; - private volatile Object description_; - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - public String getDescription() { - Object ref = description_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IS_COMMUTATIVE_FIELD_NUMBER = 18; - private boolean isCommutative_; - - /** - *
    -   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -   * 
    - * - * bool is_commutative = 18; - */ - public boolean getIsCommutative() { - return isCommutative_; - } - - public static final int IS_AGGREGATE_FIELD_NUMBER = 16; - private boolean isAggregate_; - - /** - *
    -   * If is_aggregate is true, then this operation accepts N >= 2
    -   * inputs and produces 1 output all of the same type.  Should be
    -   * associative and commutative, and produce output with the same
    -   * shape as the input.  The optimizer may replace an aggregate op
    -   * taking input from multiple devices with a tree of aggregate ops
    -   * that aggregate locally within each device (and possibly within
    -   * groups of nearby devices) before communicating.
    -   * TODO(josh11b): Implement that optimization.
    -   * 
    - * - * bool is_aggregate = 16; - */ - public boolean getIsAggregate() { - return isAggregate_; - } - - public static final int IS_STATEFUL_FIELD_NUMBER = 17; - private boolean isStateful_; - - /** - *
    -   * Ops are marked as stateful if their behavior depends on some state beyond
    -   * their input tensors (e.g. variable reading op) or if they have
    -   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -   * must always produce the same output for the same input and have
    -   * no side-effects.
    -   * By default Ops may be moved between devices.  Stateful ops should
    -   * either not be moved, or should only be moved if that state can also
    -   * be moved (e.g. via some sort of save / restore).
    -   * Stateful ops are guaranteed to never be optimized away by Common
    -   * Subexpression Elimination (CSE).
    -   * 
    - * - * bool is_stateful = 17; - */ - public boolean getIsStateful() { - return isStateful_; - } - - public static final int ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER = 19; - private boolean allowsUninitializedInput_; - - /** - *
    -   * By default, all inputs to an Op must be initialized Tensors.  Ops
    -   * that may initialize tensors for the first time should set this
    -   * field to true, to allow the Op to take an uninitialized Tensor as
    -   * input.
    -   * 
    - * - * bool allows_uninitialized_input = 19; - */ - public boolean getAllowsUninitializedInput() { - return allowsUninitializedInput_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < inputArg_.size(); i++) { - output.writeMessage(2, inputArg_.get(i)); - } - for (int i = 0; i < outputArg_.size(); i++) { - output.writeMessage(3, outputArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - output.writeMessage(4, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); - } - if (deprecation_ != null) { - output.writeMessage(8, getDeprecation()); - } - if (isAggregate_ != false) { - output.writeBool(16, isAggregate_); - } - if (isStateful_ != false) { - output.writeBool(17, isStateful_); - } - if (isCommutative_ != false) { - output.writeBool(18, isCommutative_); - } - if (allowsUninitializedInput_ != false) { - output.writeBool(19, allowsUninitializedInput_); - } - for (int i = 0; i < controlOutput_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 20, controlOutput_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @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_); - } - for (int i = 0; i < inputArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, inputArg_.get(i)); - } - for (int i = 0; i < outputArg_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, outputArg_.get(i)); - } - for (int i = 0; i < attr_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, attr_.get(i)); - } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, summary_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); - } - if (deprecation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, getDeprecation()); - } - if (isAggregate_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, isAggregate_); - } - if (isStateful_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(17, isStateful_); - } - if (isCommutative_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(18, isCommutative_); - } - if (allowsUninitializedInput_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(19, allowsUninitializedInput_); - } - { - int dataSize = 0; - for (int i = 0; i < controlOutput_.size(); i++) { - dataSize += computeStringSizeNoTag(controlOutput_.getRaw(i)); - } - size += dataSize; - size += 2 * getControlOutputList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof OpDef)) { - return super.equals(obj); - } - OpDef other = (OpDef) obj; - - if (!getName() - .equals(other.getName())) { - return false; - } - if (!getInputArgList() - .equals(other.getInputArgList())) return false; - if (!getOutputArgList() - .equals(other.getOutputArgList())) return false; - if (!getControlOutputList() - .equals(other.getControlOutputList())) return false; - if (!getAttrList() - .equals(other.getAttrList())) return false; - if (hasDeprecation() != other.hasDeprecation()) return false; - if (hasDeprecation()) { - if (!getDeprecation() - .equals(other.getDeprecation())) return false; - } - if (!getSummary() - .equals(other.getSummary())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (getIsCommutative() - != other.getIsCommutative()) return false; - if (getIsAggregate() - != other.getIsAggregate()) return false; - if (getIsStateful() - != other.getIsStateful()) return false; - if (getAllowsUninitializedInput() - != other.getAllowsUninitializedInput()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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(); - if (getInputArgCount() > 0) { - hash = (37 * hash) + INPUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getInputArgList().hashCode(); - } - if (getOutputArgCount() > 0) { - hash = (37 * hash) + OUTPUT_ARG_FIELD_NUMBER; - hash = (53 * hash) + getOutputArgList().hashCode(); - } - if (getControlOutputCount() > 0) { - hash = (37 * hash) + CONTROL_OUTPUT_FIELD_NUMBER; - hash = (53 * hash) + getControlOutputList().hashCode(); - } - if (getAttrCount() > 0) { - hash = (37 * hash) + ATTR_FIELD_NUMBER; - hash = (53 * hash) + getAttrList().hashCode(); - } - if (hasDeprecation()) { - hash = (37 * hash) + DEPRECATION_FIELD_NUMBER; - hash = (53 * hash) + getDeprecation().hashCode(); - } - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + IS_COMMUTATIVE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsCommutative()); - hash = (37 * hash) + IS_AGGREGATE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsAggregate()); - hash = (37 * hash) + IS_STATEFUL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsStateful()); - hash = (37 * hash) + ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAllowsUninitializedInput()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static OpDef parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDef parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDef parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDef parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDef parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDef parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDef parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpDef 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 OpDef parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static OpDef 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 OpDef parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpDef parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(OpDef prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    -   * using the "op" field which should match the name of a OpDef.
    -   * LINT.IfChange
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDef} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDef) - OpDefOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpDef.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDef.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInputArgFieldBuilder(); - getOutputArgFieldBuilder(); - getAttrFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (inputArgBuilder_ == null) { - inputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - inputArgBuilder_.clear(); - } - if (outputArgBuilder_ == null) { - outputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - outputArgBuilder_.clear(); - } - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - attrBuilder_.clear(); - } - if (deprecationBuilder_ == null) { - deprecation_ = null; - } else { - deprecation_ = null; - deprecationBuilder_ = null; - } - summary_ = ""; - - description_ = ""; - - isCommutative_ = false; - - isAggregate_ = false; - - isStateful_ = false; - - allowsUninitializedInput_ = false; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return OpDefProtos.internal_static_tensorflow_OpDef_descriptor; - } - - @Override - public OpDef getDefaultInstanceForType() { - return OpDef.getDefaultInstance(); - } - - @Override - public OpDef build() { - OpDef result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public OpDef buildPartial() { - OpDef result = new OpDef(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (inputArgBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - inputArg_ = java.util.Collections.unmodifiableList(inputArg_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.inputArg_ = inputArg_; - } else { - result.inputArg_ = inputArgBuilder_.build(); - } - if (outputArgBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - outputArg_ = java.util.Collections.unmodifiableList(outputArg_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.outputArg_ = outputArg_; - } else { - result.outputArg_ = outputArgBuilder_.build(); - } - if (((bitField0_ & 0x00000004) != 0)) { - controlOutput_ = controlOutput_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.controlOutput_ = controlOutput_; - if (attrBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - attr_ = java.util.Collections.unmodifiableList(attr_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.attr_ = attr_; - } else { - result.attr_ = attrBuilder_.build(); - } - if (deprecationBuilder_ == null) { - result.deprecation_ = deprecation_; - } else { - result.deprecation_ = deprecationBuilder_.build(); - } - result.summary_ = summary_; - result.description_ = description_; - result.isCommutative_ = isCommutative_; - result.isAggregate_ = isAggregate_; - result.isStateful_ = isStateful_; - result.allowsUninitializedInput_ = allowsUninitializedInput_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof OpDef) { - return mergeFrom((OpDef) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(OpDef other) { - if (other == OpDef.getDefaultInstance()) { - return this; - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (inputArgBuilder_ == null) { - if (!other.inputArg_.isEmpty()) { - if (inputArg_.isEmpty()) { - inputArg_ = other.inputArg_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInputArgIsMutable(); - inputArg_.addAll(other.inputArg_); - } - onChanged(); - } - } else { - if (!other.inputArg_.isEmpty()) { - if (inputArgBuilder_.isEmpty()) { - inputArgBuilder_.dispose(); - inputArgBuilder_ = null; - inputArg_ = other.inputArg_; - bitField0_ = (bitField0_ & ~0x00000001); - inputArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInputArgFieldBuilder() : null; - } else { - inputArgBuilder_.addAllMessages(other.inputArg_); - } - } - } - if (outputArgBuilder_ == null) { - if (!other.outputArg_.isEmpty()) { - if (outputArg_.isEmpty()) { - outputArg_ = other.outputArg_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureOutputArgIsMutable(); - outputArg_.addAll(other.outputArg_); - } - onChanged(); - } - } else { - if (!other.outputArg_.isEmpty()) { - if (outputArgBuilder_.isEmpty()) { - outputArgBuilder_.dispose(); - outputArgBuilder_ = null; - outputArg_ = other.outputArg_; - bitField0_ = (bitField0_ & ~0x00000002); - outputArgBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOutputArgFieldBuilder() : null; - } else { - outputArgBuilder_.addAllMessages(other.outputArg_); - } - } - } - if (!other.controlOutput_.isEmpty()) { - if (controlOutput_.isEmpty()) { - controlOutput_ = other.controlOutput_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureControlOutputIsMutable(); - controlOutput_.addAll(other.controlOutput_); - } - onChanged(); - } - if (attrBuilder_ == null) { - if (!other.attr_.isEmpty()) { - if (attr_.isEmpty()) { - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureAttrIsMutable(); - attr_.addAll(other.attr_); - } - onChanged(); - } - } else { - if (!other.attr_.isEmpty()) { - if (attrBuilder_.isEmpty()) { - attrBuilder_.dispose(); - attrBuilder_ = null; - attr_ = other.attr_; - bitField0_ = (bitField0_ & ~0x00000008); - attrBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttrFieldBuilder() : null; - } else { - attrBuilder_.addAllMessages(other.attr_); - } - } - } - if (other.hasDeprecation()) { - mergeDeprecation(other.getDeprecation()); - } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.getIsCommutative() != false) { - setIsCommutative(other.getIsCommutative()); - } - if (other.getIsAggregate() != false) { - setIsAggregate(other.getIsAggregate()); - } - if (other.getIsStateful() != false) { - setIsStateful(other.getIsStateful()); - } - if (other.getAllowsUninitializedInput() != false) { - setAllowsUninitializedInput(other.getAllowsUninitializedInput()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - OpDef parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (OpDef) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private Object name_ = ""; - - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - *
    -     * Op names starting with an underscore are reserved for internal use.
    -     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -     * 
    - * - * 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 java.util.List inputArg_ = - java.util.Collections.emptyList(); - - private void ensureInputArgIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - inputArg_ = new java.util.ArrayList(inputArg_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder> inputArgBuilder_; - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List getInputArgList() { - if (inputArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(inputArg_); - } else { - return inputArgBuilder_.getMessageList(); - } - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public int getInputArgCount() { - if (inputArgBuilder_ == null) { - return inputArg_.size(); - } else { - return inputArgBuilder_.getCount(); - } - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDef getInputArg(int index) { - if (inputArgBuilder_ == null) { - return inputArg_.get(index); - } else { - return inputArgBuilder_.getMessage(index); - } - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder setInputArg( - int index, ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.set(index, value); - onChanged(); - } else { - inputArgBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder setInputArg( - int index, ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.set(index, builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg(ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.add(value); - onChanged(); - } else { - inputArgBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - int index, ArgDef value) { - if (inputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInputArgIsMutable(); - inputArg_.add(index, value); - onChanged(); - } else { - inputArgBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.add(builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addInputArg( - int index, ArgDef.Builder builderForValue) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.add(index, builderForValue.build()); - onChanged(); - } else { - inputArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder addAllInputArg( - Iterable values) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, inputArg_); - onChanged(); - } else { - inputArgBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder clearInputArg() { - if (inputArgBuilder_ == null) { - inputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - inputArgBuilder_.clear(); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public Builder removeInputArg(int index) { - if (inputArgBuilder_ == null) { - ensureInputArgIsMutable(); - inputArg_.remove(index); - onChanged(); - } else { - inputArgBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDef.Builder getInputArgBuilder( - int index) { - return getInputArgFieldBuilder().getBuilder(index); - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDefOrBuilder getInputArgOrBuilder( - int index) { - if (inputArgBuilder_ == null) { - return inputArg_.get(index); - } else { - return inputArgBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgOrBuilderList() { - if (inputArgBuilder_ != null) { - return inputArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(inputArg_); - } - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDef.Builder addInputArgBuilder() { - return getInputArgFieldBuilder().addBuilder( - ArgDef.getDefaultInstance()); - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public ArgDef.Builder addInputArgBuilder( - int index) { - return getInputArgFieldBuilder().addBuilder( - index, ArgDef.getDefaultInstance()); - } - - /** - *
    -     * Description of the input(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - public java.util.List - getInputArgBuilderList() { - return getInputArgFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder> - getInputArgFieldBuilder() { - if (inputArgBuilder_ == null) { - inputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder>( - inputArg_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - inputArg_ = null; - } - return inputArgBuilder_; - } - - private java.util.List outputArg_ = - java.util.Collections.emptyList(); - - private void ensureOutputArgIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - outputArg_ = new java.util.ArrayList(outputArg_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder> outputArgBuilder_; - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List getOutputArgList() { - if (outputArgBuilder_ == null) { - return java.util.Collections.unmodifiableList(outputArg_); - } else { - return outputArgBuilder_.getMessageList(); - } - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public int getOutputArgCount() { - if (outputArgBuilder_ == null) { - return outputArg_.size(); - } else { - return outputArgBuilder_.getCount(); - } - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDef getOutputArg(int index) { - if (outputArgBuilder_ == null) { - return outputArg_.get(index); - } else { - return outputArgBuilder_.getMessage(index); - } - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder setOutputArg( - int index, ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.set(index, value); - onChanged(); - } else { - outputArgBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder setOutputArg( - int index, ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.set(index, builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg(ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.add(value); - onChanged(); - } else { - outputArgBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - int index, ArgDef value) { - if (outputArgBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOutputArgIsMutable(); - outputArg_.add(index, value); - onChanged(); - } else { - outputArgBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.add(builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addOutputArg( - int index, ArgDef.Builder builderForValue) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.add(index, builderForValue.build()); - onChanged(); - } else { - outputArgBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder addAllOutputArg( - Iterable values) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, outputArg_); - onChanged(); - } else { - outputArgBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder clearOutputArg() { - if (outputArgBuilder_ == null) { - outputArg_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - outputArgBuilder_.clear(); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public Builder removeOutputArg(int index) { - if (outputArgBuilder_ == null) { - ensureOutputArgIsMutable(); - outputArg_.remove(index); - onChanged(); - } else { - outputArgBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDef.Builder getOutputArgBuilder( - int index) { - return getOutputArgFieldBuilder().getBuilder(index); - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDefOrBuilder getOutputArgOrBuilder( - int index) { - if (outputArgBuilder_ == null) { - return outputArg_.get(index); - } else { - return outputArgBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgOrBuilderList() { - if (outputArgBuilder_ != null) { - return outputArgBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(outputArg_); - } - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDef.Builder addOutputArgBuilder() { - return getOutputArgFieldBuilder().addBuilder( - ArgDef.getDefaultInstance()); - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public ArgDef.Builder addOutputArgBuilder( - int index) { - return getOutputArgFieldBuilder().addBuilder( - index, ArgDef.getDefaultInstance()); - } - - /** - *
    -     * Description of the output(s).
    -     * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - public java.util.List - getOutputArgBuilderList() { - return getOutputArgFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder> - getOutputArgFieldBuilder() { - if (outputArgBuilder_ == null) { - outputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ArgDef, ArgDef.Builder, ArgDefOrBuilder>( - outputArg_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - outputArg_ = null; - } - return outputArgBuilder_; - } - - private com.google.protobuf.LazyStringList controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureControlOutputIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - controlOutput_ = new com.google.protobuf.LazyStringArrayList(controlOutput_); - bitField0_ |= 0x00000004; - } - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ProtocolStringList - getControlOutputList() { - return controlOutput_.getUnmodifiableView(); - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public int getControlOutputCount() { - return controlOutput_.size(); - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public String getControlOutput(int index) { - return controlOutput_.get(index); - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public com.google.protobuf.ByteString - getControlOutputBytes(int index) { - return controlOutput_.getByteString(index); - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder setControlOutput( - int index, String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureControlOutputIsMutable(); - controlOutput_.set(index, value); - onChanged(); - return this; - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addControlOutput( - String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureControlOutputIsMutable(); - controlOutput_.add(value); - onChanged(); - return this; - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addAllControlOutput( - Iterable values) { - ensureControlOutputIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, controlOutput_); - onChanged(); - return this; - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder clearControlOutput() { - controlOutput_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - /** - *
    -     * Named control outputs for this operation. Useful only for composite
    -     * operations (i.e. functions) which want to name different control outputs.
    -     * 
    - * - * repeated string control_output = 20; - */ - public Builder addControlOutputBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureControlOutputIsMutable(); - controlOutput_.add(value); - onChanged(); - return this; - } - - private java.util.List attr_ = - java.util.Collections.emptyList(); - - private void ensureAttrIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - attr_ = new java.util.ArrayList(attr_); - bitField0_ |= 0x00000008; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - AttrDef, AttrDef.Builder, AttrDefOrBuilder> attrBuilder_; - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List getAttrList() { - if (attrBuilder_ == null) { - return java.util.Collections.unmodifiableList(attr_); - } else { - return attrBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public int getAttrCount() { - if (attrBuilder_ == null) { - return attr_.size(); - } else { - return attrBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDef getAttr(int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder setAttr( - int index, AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.set(index, value); - onChanged(); - } else { - attrBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder setAttr( - int index, AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.set(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr(AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(value); - onChanged(); - } else { - attrBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - int index, AttrDef value) { - if (attrBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttrIsMutable(); - attr_.add(index, value); - onChanged(); - } else { - attrBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAttr( - int index, AttrDef.Builder builderForValue) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.add(index, builderForValue.build()); - onChanged(); - } else { - attrBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder addAllAttr( - Iterable values) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attr_); - onChanged(); - } else { - attrBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder clearAttr() { - if (attrBuilder_ == null) { - attr_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - } else { - attrBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public Builder removeAttr(int index) { - if (attrBuilder_ == null) { - ensureAttrIsMutable(); - attr_.remove(index); - onChanged(); - } else { - attrBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDef.Builder getAttrBuilder( - int index) { - return getAttrFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDefOrBuilder getAttrOrBuilder( - int index) { - if (attrBuilder_ == null) { - return attr_.get(index); - } else { - return attrBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrOrBuilderList() { - if (attrBuilder_ != null) { - return attrBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attr_); - } - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDef.Builder addAttrBuilder() { - return getAttrFieldBuilder().addBuilder( - AttrDef.getDefaultInstance()); - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public AttrDef.Builder addAttrBuilder( - int index) { - return getAttrFieldBuilder().addBuilder( - index, AttrDef.getDefaultInstance()); - } - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - public java.util.List - getAttrBuilderList() { - return getAttrFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - AttrDef, AttrDef.Builder, AttrDefOrBuilder> - getAttrFieldBuilder() { - if (attrBuilder_ == null) { - attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - AttrDef, AttrDef.Builder, AttrDefOrBuilder>( - attr_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - attr_ = null; - } - return attrBuilder_; - } - - private OpDeprecation deprecation_; - private com.google.protobuf.SingleFieldBuilderV3< - OpDeprecation, OpDeprecation.Builder, OpDeprecationOrBuilder> deprecationBuilder_; - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public boolean hasDeprecation() { - return deprecationBuilder_ != null || deprecation_ != null; - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public OpDeprecation getDeprecation() { - if (deprecationBuilder_ == null) { - return deprecation_ == null ? OpDeprecation.getDefaultInstance() : deprecation_; - } else { - return deprecationBuilder_.getMessage(); - } - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder setDeprecation(OpDeprecation value) { - if (deprecationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deprecation_ = value; - onChanged(); - } else { - deprecationBuilder_.setMessage(value); - } - - return this; - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder setDeprecation( - OpDeprecation.Builder builderForValue) { - if (deprecationBuilder_ == null) { - deprecation_ = builderForValue.build(); - onChanged(); - } else { - deprecationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder mergeDeprecation(OpDeprecation value) { - if (deprecationBuilder_ == null) { - if (deprecation_ != null) { - deprecation_ = - OpDeprecation.newBuilder(deprecation_).mergeFrom(value).buildPartial(); - } else { - deprecation_ = value; - } - onChanged(); - } else { - deprecationBuilder_.mergeFrom(value); - } - - return this; - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public Builder clearDeprecation() { - if (deprecationBuilder_ == null) { - deprecation_ = null; - onChanged(); - } else { - deprecation_ = null; - deprecationBuilder_ = null; - } - - return this; - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public OpDeprecation.Builder getDeprecationBuilder() { - - onChanged(); - return getDeprecationFieldBuilder().getBuilder(); - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - public OpDeprecationOrBuilder getDeprecationOrBuilder() { - if (deprecationBuilder_ != null) { - return deprecationBuilder_.getMessageOrBuilder(); - } else { - return deprecation_ == null ? - OpDeprecation.getDefaultInstance() : deprecation_; - } - } - - /** - *
    -     * Optional deprecation based on GraphDef versions.
    -     * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - private com.google.protobuf.SingleFieldBuilderV3< - OpDeprecation, OpDeprecation.Builder, OpDeprecationOrBuilder> - getDeprecationFieldBuilder() { - if (deprecationBuilder_ == null) { - deprecationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - OpDeprecation, OpDeprecation.Builder, OpDeprecationOrBuilder>( - getDeprecation(), - getParentForChildren(), - isClean()); - deprecation_ = null; - } - return deprecationBuilder_; - } - - private Object summary_ = ""; - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public String getSummary() { - Object ref = summary_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - summary_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public com.google.protobuf.ByteString - getSummaryBytes() { - Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder setSummary( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - summary_ = value; - onChanged(); - return this; - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder clearSummary() { - - summary_ = getDefaultInstance().getSummary(); - onChanged(); - return this; - } - - /** - *
    -     * One-line human-readable description of what the Op does.
    -     * 
    - * - * string summary = 5; - */ - public Builder setSummaryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; - } - - private Object description_ = ""; - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public String getDescription() { - Object ref = description_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public com.google.protobuf.ByteString - getDescriptionBytes() { - Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder setDescription( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - - /** - *
    -     * Additional, longer human-readable description of what the Op does.
    -     * 
    - * - * string description = 6; - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private boolean isCommutative_ ; - - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public boolean getIsCommutative() { - return isCommutative_; - } - - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public Builder setIsCommutative(boolean value) { - - isCommutative_ = value; - onChanged(); - return this; - } - - /** - *
    -     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -     * 
    - * - * bool is_commutative = 18; - */ - public Builder clearIsCommutative() { - - isCommutative_ = false; - onChanged(); - return this; - } - - private boolean isAggregate_ ; - - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public boolean getIsAggregate() { - return isAggregate_; - } - - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public Builder setIsAggregate(boolean value) { - - isAggregate_ = value; - onChanged(); - return this; - } - - /** - *
    -     * If is_aggregate is true, then this operation accepts N >= 2
    -     * inputs and produces 1 output all of the same type.  Should be
    -     * associative and commutative, and produce output with the same
    -     * shape as the input.  The optimizer may replace an aggregate op
    -     * taking input from multiple devices with a tree of aggregate ops
    -     * that aggregate locally within each device (and possibly within
    -     * groups of nearby devices) before communicating.
    -     * TODO(josh11b): Implement that optimization.
    -     * 
    - * - * bool is_aggregate = 16; - */ - public Builder clearIsAggregate() { - - isAggregate_ = false; - onChanged(); - return this; - } - - private boolean isStateful_ ; - - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public boolean getIsStateful() { - return isStateful_; - } - - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public Builder setIsStateful(boolean value) { - - isStateful_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Ops are marked as stateful if their behavior depends on some state beyond
    -     * their input tensors (e.g. variable reading op) or if they have
    -     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -     * must always produce the same output for the same input and have
    -     * no side-effects.
    -     * By default Ops may be moved between devices.  Stateful ops should
    -     * either not be moved, or should only be moved if that state can also
    -     * be moved (e.g. via some sort of save / restore).
    -     * Stateful ops are guaranteed to never be optimized away by Common
    -     * Subexpression Elimination (CSE).
    -     * 
    - * - * bool is_stateful = 17; - */ - public Builder clearIsStateful() { - - isStateful_ = false; - onChanged(); - return this; - } - - private boolean allowsUninitializedInput_ ; - - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public boolean getAllowsUninitializedInput() { - return allowsUninitializedInput_; - } - - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public Builder setAllowsUninitializedInput(boolean value) { - - allowsUninitializedInput_ = value; - onChanged(); - return this; - } - - /** - *
    -     * By default, all inputs to an Op must be initialized Tensors.  Ops
    -     * that may initialize tensors for the first time should set this
    -     * field to true, to allow the Op to take an uninitialized Tensor as
    -     * input.
    -     * 
    - * - * bool allows_uninitialized_input = 19; - */ - public Builder clearAllowsUninitializedInput() { - - allowsUninitializedInput_ = false; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.OpDef) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDef) - private static final OpDef DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new OpDef(); - } - - public static OpDef getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public OpDef parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpDef(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public OpDef getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefOrBuilder.java deleted file mode 100644 index 6eba95296f0..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefOrBuilder.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpDefOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDef) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - String getName(); - - /** - *
    -   * Op names starting with an underscore are reserved for internal use.
    -   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    -   * 
    - * - * string name = 1; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - java.util.List - getInputArgList(); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - OpDef.ArgDef getInputArg(int index); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - int getInputArgCount(); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - java.util.List - getInputArgOrBuilderList(); - - /** - *
    -   * Description of the input(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef input_arg = 2; - */ - OpDef.ArgDefOrBuilder getInputArgOrBuilder( - int index); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - java.util.List - getOutputArgList(); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - OpDef.ArgDef getOutputArg(int index); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - int getOutputArgCount(); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - java.util.List - getOutputArgOrBuilderList(); - - /** - *
    -   * Description of the output(s).
    -   * 
    - * - * repeated .tensorflow.OpDef.ArgDef output_arg = 3; - */ - OpDef.ArgDefOrBuilder getOutputArgOrBuilder( - int index); - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - java.util.List - getControlOutputList(); - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - int getControlOutputCount(); - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - String getControlOutput(int index); - - /** - *
    -   * Named control outputs for this operation. Useful only for composite
    -   * operations (i.e. functions) which want to name different control outputs.
    -   * 
    - * - * repeated string control_output = 20; - */ - com.google.protobuf.ByteString - getControlOutputBytes(int index); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - java.util.List - getAttrList(); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - OpDef.AttrDef getAttr(int index); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - int getAttrCount(); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - java.util.List - getAttrOrBuilderList(); - - /** - * repeated .tensorflow.OpDef.AttrDef attr = 4; - */ - OpDef.AttrDefOrBuilder getAttrOrBuilder( - int index); - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - boolean hasDeprecation(); - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - OpDeprecation getDeprecation(); - - /** - *
    -   * Optional deprecation based on GraphDef versions.
    -   * 
    - * - * .tensorflow.OpDeprecation deprecation = 8; - */ - OpDeprecationOrBuilder getDeprecationOrBuilder(); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - String getSummary(); - - /** - *
    -   * One-line human-readable description of what the Op does.
    -   * 
    - * - * string summary = 5; - */ - com.google.protobuf.ByteString - getSummaryBytes(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - String getDescription(); - - /** - *
    -   * Additional, longer human-readable description of what the Op does.
    -   * 
    - * - * string description = 6; - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
    -   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    -   * 
    - * - * bool is_commutative = 18; - */ - boolean getIsCommutative(); - - /** - *
    -   * If is_aggregate is true, then this operation accepts N >= 2
    -   * inputs and produces 1 output all of the same type.  Should be
    -   * associative and commutative, and produce output with the same
    -   * shape as the input.  The optimizer may replace an aggregate op
    -   * taking input from multiple devices with a tree of aggregate ops
    -   * that aggregate locally within each device (and possibly within
    -   * groups of nearby devices) before communicating.
    -   * TODO(josh11b): Implement that optimization.
    -   * 
    - * - * bool is_aggregate = 16; - */ - boolean getIsAggregate(); - - /** - *
    -   * Ops are marked as stateful if their behavior depends on some state beyond
    -   * their input tensors (e.g. variable reading op) or if they have
    -   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    -   * must always produce the same output for the same input and have
    -   * no side-effects.
    -   * By default Ops may be moved between devices.  Stateful ops should
    -   * either not be moved, or should only be moved if that state can also
    -   * be moved (e.g. via some sort of save / restore).
    -   * Stateful ops are guaranteed to never be optimized away by Common
    -   * Subexpression Elimination (CSE).
    -   * 
    - * - * bool is_stateful = 17; - */ - boolean getIsStateful(); - - /** - *
    -   * By default, all inputs to an Op must be initialized Tensors.  Ops
    -   * that may initialize tensors for the first time should set this
    -   * field to true, to allow the Op to take an uninitialized Tensor as
    -   * input.
    -   * 
    - * - * bool allows_uninitialized_input = 19; - */ - boolean getAllowsUninitializedInput(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefProtos.java deleted file mode 100644 index 73a23b05126..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDefProtos.java +++ /dev/null @@ -1,122 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public final class OpDefProtos { - private OpDefProtos() {} - 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_OpDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDef_ArgDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDef_AttrDef_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpDeprecation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpDeprecation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_OpList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_OpList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n&tensorflow/core/framework/op_def.proto" + - "\022\ntensorflow\032*tensorflow/core/framework/" + - "attr_value.proto\032%tensorflow/core/framew" + - "ork/types.proto\"\320\005\n\005OpDef\022\014\n\004name\030\001 \001(\t\022" + - "+\n\tinput_arg\030\002 \003(\0132\030.tensorflow.OpDef.Ar" + - "gDef\022,\n\noutput_arg\030\003 \003(\0132\030.tensorflow.Op" + - "Def.ArgDef\022\026\n\016control_output\030\024 \003(\t\022\'\n\004at" + - "tr\030\004 \003(\0132\031.tensorflow.OpDef.AttrDef\022.\n\013d" + - "eprecation\030\010 \001(\0132\031.tensorflow.OpDeprecat" + - "ion\022\017\n\007summary\030\005 \001(\t\022\023\n\013description\030\006 \001(" + - "\t\022\026\n\016is_commutative\030\022 \001(\010\022\024\n\014is_aggregat" + - "e\030\020 \001(\010\022\023\n\013is_stateful\030\021 \001(\010\022\"\n\032allows_u" + - "ninitialized_input\030\023 \001(\010\032\237\001\n\006ArgDef\022\014\n\004n" + - "ame\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022\"\n\004type\030\003" + - " \001(\0162\024.tensorflow.DataType\022\021\n\ttype_attr\030" + - "\004 \001(\t\022\023\n\013number_attr\030\005 \001(\t\022\026\n\016type_list_" + - "attr\030\006 \001(\t\022\016\n\006is_ref\030\020 \001(\010\032\275\001\n\007AttrDef\022\014" + - "\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022,\n\rdefault_va" + - "lue\030\003 \001(\0132\025.tensorflow.AttrValue\022\023\n\013desc" + - "ription\030\004 \001(\t\022\023\n\013has_minimum\030\005 \001(\010\022\017\n\007mi" + - "nimum\030\006 \001(\003\022-\n\016allowed_values\030\007 \001(\0132\025.te" + - "nsorflow.AttrValue\"5\n\rOpDeprecation\022\017\n\007v" + - "ersion\030\001 \001(\005\022\023\n\013explanation\030\002 \001(\t\"\'\n\006OpL" + - "ist\022\035\n\002op\030\001 \003(\0132\021.tensorflow.OpDefB\201\001\n\036o" + - "rg.tensorflow.proto.frameworkB\013OpDefProt" + - "osP\001ZMgithub.com/tensorflow/tensorflow/t" + - "ensorflow/go/core/framework/op_def_go_pr" + - "oto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - AttrValueProtos.getDescriptor(), - TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_OpDef_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_OpDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_descriptor, - new String[]{"Name", "InputArg", "OutputArg", "ControlOutput", "Attr", "Deprecation", "Summary", "Description", - "IsCommutative", "IsAggregate", "IsStateful", "AllowsUninitializedInput",}); - internal_static_tensorflow_OpDef_ArgDef_descriptor = - internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_ArgDef_descriptor, - new String[]{"Name", "Description", "Type", "TypeAttr", "NumberAttr", "TypeListAttr", "IsRef",}); - internal_static_tensorflow_OpDef_AttrDef_descriptor = - internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(1); - internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDef_AttrDef_descriptor, - new String[]{"Name", "Type", "DefaultValue", "Description", "HasMinimum", "Minimum", "AllowedValues",}); - internal_static_tensorflow_OpDeprecation_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_OpDeprecation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpDeprecation_descriptor, - new String[]{"Version", "Explanation",}); - internal_static_tensorflow_OpList_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_tensorflow_OpList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_OpList_descriptor, - new String[]{"Op",}); - AttrValueProtos.getDescriptor(); - TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecation.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecation.java deleted file mode 100644 index 3e9a153b2dd..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecation.java +++ /dev/null @@ -1,717 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Information about version-dependent deprecation of an op
    - * 
    - * - * Protobuf type {@code tensorflow.OpDeprecation} - */ -public final class OpDeprecation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpDeprecation) - OpDeprecationOrBuilder { -private static final long serialVersionUID = 0L; - - // Use OpDeprecation.newBuilder() to construct. - private OpDeprecation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private OpDeprecation() { - explanation_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new OpDeprecation(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private OpDeprecation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - - version_ = input.readInt32(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - explanation_ = s; - 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 OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpDeprecation.class, Builder.class); - } - - public static final int VERSION_FIELD_NUMBER = 1; - private int version_; - - /** - *
    -   * First GraphDef version at which the op is disallowed.
    -   * 
    - * - * int32 version = 1; - */ - public int getVersion() { - return version_; - } - - public static final int EXPLANATION_FIELD_NUMBER = 2; - private volatile Object explanation_; - - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - public String getExplanation() { - Object ref = explanation_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - explanation_ = s; - return s; - } - } - - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - public com.google.protobuf.ByteString - getExplanationBytes() { - Object ref = explanation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - explanation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (version_ != 0) { - output.writeInt32(1, version_); - } - if (!getExplanationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, explanation_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (version_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, version_); - } - if (!getExplanationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, explanation_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof OpDeprecation)) { - return super.equals(obj); - } - OpDeprecation other = (OpDeprecation) obj; - - if (getVersion() - != other.getVersion()) { - return false; - } - if (!getExplanation() - .equals(other.getExplanation())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + getVersion(); - hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; - hash = (53 * hash) + getExplanation().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static OpDeprecation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDeprecation parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDeprecation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDeprecation parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDeprecation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpDeprecation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpDeprecation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpDeprecation 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 OpDeprecation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static OpDeprecation 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 OpDeprecation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpDeprecation parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(OpDeprecation prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Information about version-dependent deprecation of an op
    -   * 
    - * - * Protobuf type {@code tensorflow.OpDeprecation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpDeprecation) - OpDeprecationOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpDeprecation.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpDeprecation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - version_ = 0; - - explanation_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; - } - - @Override - public OpDeprecation getDefaultInstanceForType() { - return OpDeprecation.getDefaultInstance(); - } - - @Override - public OpDeprecation build() { - OpDeprecation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public OpDeprecation buildPartial() { - OpDeprecation result = new OpDeprecation(this); - result.version_ = version_; - result.explanation_ = explanation_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof OpDeprecation) { - return mergeFrom((OpDeprecation) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(OpDeprecation other) { - if (other == OpDeprecation.getDefaultInstance()) { - return this; - } - if (other.getVersion() != 0) { - setVersion(other.getVersion()); - } - if (!other.getExplanation().isEmpty()) { - explanation_ = other.explanation_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - OpDeprecation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (OpDeprecation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int version_ ; - - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public int getVersion() { - return version_; - } - - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public Builder setVersion(int value) { - - version_ = value; - onChanged(); - return this; - } - - /** - *
    -     * First GraphDef version at which the op is disallowed.
    -     * 
    - * - * int32 version = 1; - */ - public Builder clearVersion() { - - version_ = 0; - onChanged(); - return this; - } - - private Object explanation_ = ""; - - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public String getExplanation() { - Object ref = explanation_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - explanation_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public com.google.protobuf.ByteString - getExplanationBytes() { - Object ref = explanation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - explanation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder setExplanation( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - explanation_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder clearExplanation() { - - explanation_ = getDefaultInstance().getExplanation(); - onChanged(); - return this; - } - - /** - *
    -     * Explanation of why it was deprecated and what to use instead.
    -     * 
    - * - * string explanation = 2; - */ - public Builder setExplanationBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - explanation_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.OpDeprecation) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpDeprecation) - private static final OpDeprecation DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new OpDeprecation(); - } - - public static OpDeprecation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public OpDeprecation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpDeprecation(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public OpDeprecation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java deleted file mode 100644 index c930452f754..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpDeprecationOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpDeprecationOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpDeprecation) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * First GraphDef version at which the op is disallowed.
    -   * 
    - * - * int32 version = 1; - */ - int getVersion(); - - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - String getExplanation(); - - /** - *
    -   * Explanation of why it was deprecated and what to use instead.
    -   * 
    - * - * string explanation = 2; - */ - com.google.protobuf.ByteString - getExplanationBytes(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpList.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpList.java deleted file mode 100644 index 57bbb10a4ce..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpList.java +++ /dev/null @@ -1,850 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * A collection of OpDefs
    - * 
    - * - * Protobuf type {@code tensorflow.OpList} - */ -public final class OpList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.OpList) - OpListOrBuilder { -private static final long serialVersionUID = 0L; - - // Use OpList.newBuilder() to construct. - private OpList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private OpList() { - op_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new OpList(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private OpList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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)) { - op_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - op_.add( - input.readMessage(OpDef.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_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpList.class, Builder.class); - } - - public static final int OP_FIELD_NUMBER = 1; - private java.util.List op_; - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List getOpList() { - return op_; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - return op_; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public int getOpCount() { - return op_.size(); - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDef getOp(int index) { - return op_.get(index); - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDefOrBuilder getOpOrBuilder( - int index) { - return op_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < op_.size(); i++) { - output.writeMessage(1, op_.get(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < op_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, op_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof OpList)) { - return super.equals(obj); - } - OpList other = (OpList) obj; - - if (!getOpList() - .equals(other.getOpList())) { - return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getOpCount() > 0) { - hash = (37 * hash) + OP_FIELD_NUMBER; - hash = (53 * hash) + getOpList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static OpList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static OpList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static OpList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpList 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 OpList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static OpList 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 OpList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static OpList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(OpList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * A collection of OpDefs
    -   * 
    - * - * Protobuf type {@code tensorflow.OpList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.OpList) - OpListOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - OpList.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.OpList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getOpFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - opBuilder_.clear(); - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return OpDefProtos.internal_static_tensorflow_OpList_descriptor; - } - - @Override - public OpList getDefaultInstanceForType() { - return OpList.getDefaultInstance(); - } - - @Override - public OpList build() { - OpList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public OpList buildPartial() { - OpList result = new OpList(this); - int from_bitField0_ = bitField0_; - if (opBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - op_ = java.util.Collections.unmodifiableList(op_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.op_ = op_; - } else { - result.op_ = opBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof OpList) { - return mergeFrom((OpList) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(OpList other) { - if (other == OpList.getDefaultInstance()) { - return this; - } - if (opBuilder_ == null) { - if (!other.op_.isEmpty()) { - if (op_.isEmpty()) { - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureOpIsMutable(); - op_.addAll(other.op_); - } - onChanged(); - } - } else { - if (!other.op_.isEmpty()) { - if (opBuilder_.isEmpty()) { - opBuilder_.dispose(); - opBuilder_ = null; - op_ = other.op_; - bitField0_ = (bitField0_ & ~0x00000001); - opBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getOpFieldBuilder() : null; - } else { - opBuilder_.addAllMessages(other.op_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - OpList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (OpList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List op_ = - java.util.Collections.emptyList(); - - private void ensureOpIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - op_ = new java.util.ArrayList(op_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - OpDef, OpDef.Builder, OpDefOrBuilder> opBuilder_; - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List getOpList() { - if (opBuilder_ == null) { - return java.util.Collections.unmodifiableList(op_); - } else { - return opBuilder_.getMessageList(); - } - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public int getOpCount() { - if (opBuilder_ == null) { - return op_.size(); - } else { - return opBuilder_.getCount(); - } - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDef getOp(int index) { - if (opBuilder_ == null) { - return op_.get(index); - } else { - return opBuilder_.getMessage(index); - } - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder setOp( - int index, OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.set(index, value); - onChanged(); - } else { - opBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder setOp( - int index, OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.set(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp(OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(value); - onChanged(); - } else { - opBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - int index, OpDef value) { - if (opBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureOpIsMutable(); - op_.add(index, value); - onChanged(); - } else { - opBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addOp( - int index, OpDef.Builder builderForValue) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.add(index, builderForValue.build()); - onChanged(); - } else { - opBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder addAllOp( - Iterable values) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, op_); - onChanged(); - } else { - opBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder clearOp() { - if (opBuilder_ == null) { - op_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - opBuilder_.clear(); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public Builder removeOp(int index) { - if (opBuilder_ == null) { - ensureOpIsMutable(); - op_.remove(index); - onChanged(); - } else { - opBuilder_.remove(index); - } - return this; - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDef.Builder getOpBuilder( - int index) { - return getOpFieldBuilder().getBuilder(index); - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDefOrBuilder getOpOrBuilder( - int index) { - if (opBuilder_ == null) { - return op_.get(index); - } else { - return opBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpOrBuilderList() { - if (opBuilder_ != null) { - return opBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(op_); - } - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDef.Builder addOpBuilder() { - return getOpFieldBuilder().addBuilder( - OpDef.getDefaultInstance()); - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public OpDef.Builder addOpBuilder( - int index) { - return getOpFieldBuilder().addBuilder( - index, OpDef.getDefaultInstance()); - } - - /** - * repeated .tensorflow.OpDef op = 1; - */ - public java.util.List - getOpBuilderList() { - return getOpFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - OpDef, OpDef.Builder, OpDefOrBuilder> - getOpFieldBuilder() { - if (opBuilder_ == null) { - opBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - OpDef, OpDef.Builder, OpDefOrBuilder>( - op_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - op_ = null; - } - return opBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:tensorflow.OpList) - } - - // @@protoc_insertion_point(class_scope:tensorflow.OpList) - private static final OpList DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new OpList(); - } - - public static OpList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public OpList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OpList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public OpList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpListOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpListOrBuilder.java deleted file mode 100644 index 50274f623af..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/OpListOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2021 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. - ============================================================================== - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/op_def.proto - -package org.tensorflow.proto.framework; - -public interface OpListOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.OpList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .tensorflow.OpDef op = 1; - */ - java.util.List - getOpList(); - - /** - * repeated .tensorflow.OpDef op = 1; - */ - OpDef getOp(int index); - - /** - * repeated .tensorflow.OpDef op = 1; - */ - int getOpCount(); - - /** - * repeated .tensorflow.OpDef op = 1; - */ - java.util.List - getOpOrBuilderList(); - - /** - * repeated .tensorflow.OpDef op = 1; - */ - OpDefOrBuilder getOpOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandle.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandle.java deleted file mode 100644 index f65858a9e4a..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandle.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -public final class ResourceHandle { - private ResourceHandle() {} - 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_ResourceHandleProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n/tensorflow/core/framework/resource_han" + - "dle.proto\022\ntensorflow\032,tensorflow/core/f" + - "ramework/tensor_shape.proto\032%tensorflow/" + - "core/framework/types.proto\"\245\002\n\023ResourceH" + - "andleProto\022\016\n\006device\030\001 \001(\t\022\021\n\tcontainer\030" + - "\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\021\n\thash_code\030\004 \001(\004\022\027" + - "\n\017maybe_type_name\030\005 \001(\t\022H\n\021dtypes_and_sh" + - "apes\030\006 \003(\0132-.tensorflow.ResourceHandlePr" + - "oto.DtypeAndShape\032a\n\rDtypeAndShape\022#\n\005dt" + - "ype\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005shape" + - "\030\002 \001(\0132\034.tensorflow.TensorShapeProtoJ\004\010\007" + - "\020\010B\215\001\n\036org.tensorflow.proto.frameworkB\016R" + - "esourceHandleP\001ZVgithub.com/tensorflow/t" + - "ensorflow/tensorflow/go/core/framework/r" + - "esource_handle_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - TensorShapeProtos.getDescriptor(), - TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_ResourceHandleProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ResourceHandleProto_descriptor, - new String[]{"Device", "Container", "Name", "HashCode", "MaybeTypeName", "DtypesAndShapes",}); - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor = - internal_static_tensorflow_ResourceHandleProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor, - new String[]{"Dtype", "Shape",}); - TensorShapeProtos.getDescriptor(); - TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProto.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProto.java deleted file mode 100644 index 2307f0bf23c..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProto.java +++ /dev/null @@ -1,2416 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a handle to a tensorflow resource. Handles are
    - * not valid across executions, but can be serialized back and forth from within
    - * a single run.
    - * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto} - */ -public final class ResourceHandleProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto) - ResourceHandleProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use ResourceHandleProto.newBuilder() to construct. - private ResourceHandleProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ResourceHandleProto() { - device_ = ""; - container_ = ""; - name_ = ""; - maybeTypeName_ = ""; - dtypesAndShapes_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new ResourceHandleProto(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ResourceHandleProto( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - device_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - container_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 32: { - - hashCode_ = input.readUInt64(); - break; - } - case 42: { - String s = input.readStringRequireUtf8(); - - maybeTypeName_ = s; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dtypesAndShapes_.add( - input.readMessage(DtypeAndShape.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_ & 0x00000001) != 0)) { - dtypesAndShapes_ = java.util.Collections.unmodifiableList(dtypesAndShapes_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ResourceHandleProto.class, Builder.class); - } - - public interface DtypeAndShapeOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto.DtypeAndShape) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - - /** - * .tensorflow.DataType dtype = 1; - */ - DataType getDtype(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - boolean hasShape(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - TensorShapeProto getShape(); - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - TensorShapeProtoOrBuilder getShapeOrBuilder(); - } - /** - *
    -   * Protocol buffer representing a pair of (data type, tensor shape).
    -   * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} - */ - public static final class DtypeAndShape extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto.DtypeAndShape) - DtypeAndShapeOrBuilder { - private static final long serialVersionUID = 0L; - // Use DtypeAndShape.newBuilder() to construct. - private DtypeAndShape(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DtypeAndShape() { - dtype_ = 0; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new DtypeAndShape(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DtypeAndShape( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - TensorShapeProto.Builder subBuilder = null; - if (shape_ != null) { - subBuilder = shape_.toBuilder(); - } - shape_ = input.readMessage(TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(shape_); - shape_ = subBuilder.buildPartial(); - } - - 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 ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - DtypeAndShape.class, Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public DataType getDtype() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(dtype_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - public static final int SHAPE_FIELD_NUMBER = 2; - private TensorShapeProto shape_; - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shape_ != null; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public TensorShapeProto getShape() { - return shape_ == null ? TensorShapeProto.getDefaultInstance() : shape_; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder() { - return getShape(); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (dtype_ != DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (shape_ != null) { - output.writeMessage(2, getShape()); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (shape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getShape()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof DtypeAndShape)) { - return super.equals(obj); - } - DtypeAndShape other = (DtypeAndShape) obj; - - if (dtype_ != other.dtype_) { - return false; - } - if (hasShape() != other.hasShape()) { - return false; - } - if (hasShape()) { - if (!getShape() - .equals(other.getShape())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasShape()) { - hash = (37 * hash) + SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getShape().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static DtypeAndShape parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static DtypeAndShape parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static DtypeAndShape parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static DtypeAndShape parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static DtypeAndShape parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static DtypeAndShape parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static DtypeAndShape parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static DtypeAndShape 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 DtypeAndShape parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static DtypeAndShape 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 DtypeAndShape parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static DtypeAndShape parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(DtypeAndShape prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * Protocol buffer representing a pair of (data type, tensor shape).
    -     * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto.DtypeAndShape) - DtypeAndShapeOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable - .ensureFieldAccessorsInitialized( - DtypeAndShape.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ResourceHandleProto.DtypeAndShape.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - dtype_ = 0; - - if (shapeBuilder_ == null) { - shape_ = null; - } else { - shape_ = null; - shapeBuilder_ = null; - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; - } - - @Override - public DtypeAndShape getDefaultInstanceForType() { - return DtypeAndShape.getDefaultInstance(); - } - - @Override - public DtypeAndShape build() { - DtypeAndShape result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public DtypeAndShape buildPartial() { - DtypeAndShape result = new DtypeAndShape(this); - result.dtype_ = dtype_; - if (shapeBuilder_ == null) { - result.shape_ = shape_; - } else { - result.shape_ = shapeBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof DtypeAndShape) { - return mergeFrom((DtypeAndShape) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(DtypeAndShape other) { - if (other == DtypeAndShape.getDefaultInstance()) { - return this; - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasShape()) { - mergeShape(other.getShape()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - DtypeAndShape parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (DtypeAndShape) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public DataType getDtype() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(dtype_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private TensorShapeProto shape_; - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> shapeBuilder_; - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public boolean hasShape() { - return shapeBuilder_ != null || shape_ != null; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public TensorShapeProto getShape() { - if (shapeBuilder_ == null) { - return shape_ == null ? TensorShapeProto.getDefaultInstance() : shape_; - } else { - return shapeBuilder_.getMessage(); - } - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape(TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - shape_ = value; - onChanged(); - } else { - shapeBuilder_.setMessage(value); - } - - return this; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder setShape( - TensorShapeProto.Builder builderForValue) { - if (shapeBuilder_ == null) { - shape_ = builderForValue.build(); - onChanged(); - } else { - shapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder mergeShape(TensorShapeProto value) { - if (shapeBuilder_ == null) { - if (shape_ != null) { - shape_ = - TensorShapeProto.newBuilder(shape_).mergeFrom(value).buildPartial(); - } else { - shape_ = value; - } - onChanged(); - } else { - shapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public Builder clearShape() { - if (shapeBuilder_ == null) { - shape_ = null; - onChanged(); - } else { - shape_ = null; - shapeBuilder_ = null; - } - - return this; - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public TensorShapeProto.Builder getShapeBuilder() { - - onChanged(); - return getShapeFieldBuilder().getBuilder(); - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - public TensorShapeProtoOrBuilder getShapeOrBuilder() { - if (shapeBuilder_ != null) { - return shapeBuilder_.getMessageOrBuilder(); - } else { - return shape_ == null ? - TensorShapeProto.getDefaultInstance() : shape_; - } - } - - /** - * .tensorflow.TensorShapeProto shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> - getShapeFieldBuilder() { - if (shapeBuilder_ == null) { - shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>( - getShape(), - getParentForChildren(), - isClean()); - shape_ = null; - } - return shapeBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.ResourceHandleProto.DtypeAndShape) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto.DtypeAndShape) - private static final DtypeAndShape DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new DtypeAndShape(); - } - - public static DtypeAndShape getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public DtypeAndShape parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DtypeAndShape(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public DtypeAndShape getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int DEVICE_FIELD_NUMBER = 1; - private volatile Object device_; - - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - public String getDevice() { - Object ref = device_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - device_ = s; - return s; - } - } - - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - public com.google.protobuf.ByteString - getDeviceBytes() { - Object ref = device_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - device_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONTAINER_FIELD_NUMBER = 2; - private volatile Object container_; - - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - public String getContainer() { - Object ref = container_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - container_ = s; - return s; - } - } - - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - public com.google.protobuf.ByteString - getContainerBytes() { - Object ref = container_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - container_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile Object name_; - - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int HASH_CODE_FIELD_NUMBER = 4; - private long hashCode_; - /** - *
    -   * Hash code for the type of the resource. Is only valid in the same device
    -   * and in the same execution.
    -   * 
    - * - * uint64 hash_code = 4; - */ - public long getHashCode() { - return hashCode_; - } - - public static final int MAYBE_TYPE_NAME_FIELD_NUMBER = 5; - private volatile Object maybeTypeName_; - - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - public String getMaybeTypeName() { - Object ref = maybeTypeName_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - maybeTypeName_ = s; - return s; - } - } - - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - public com.google.protobuf.ByteString - getMaybeTypeNameBytes() { - Object ref = maybeTypeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - maybeTypeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DTYPES_AND_SHAPES_FIELD_NUMBER = 6; - private java.util.List dtypesAndShapes_; - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List getDtypesAndShapesList() { - return dtypesAndShapes_; - } - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesOrBuilderList() { - return dtypesAndShapes_; - } - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public int getDtypesAndShapesCount() { - return dtypesAndShapes_.size(); - } - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShape getDtypesAndShapes(int index) { - return dtypesAndShapes_.get(index); - } - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index) { - return dtypesAndShapes_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getDeviceBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_); - } - if (!getContainerBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, container_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (hashCode_ != 0L) { - output.writeUInt64(4, hashCode_); - } - if (!getMaybeTypeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, maybeTypeName_); - } - for (int i = 0; i < dtypesAndShapes_.size(); i++) { - output.writeMessage(6, dtypesAndShapes_.get(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getDeviceBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_); - } - if (!getContainerBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, container_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (hashCode_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, hashCode_); - } - if (!getMaybeTypeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, maybeTypeName_); - } - for (int i = 0; i < dtypesAndShapes_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, dtypesAndShapes_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ResourceHandleProto)) { - return super.equals(obj); - } - ResourceHandleProto other = (ResourceHandleProto) obj; - - if (!getDevice() - .equals(other.getDevice())) { - return false; - } - if (!getContainer() - .equals(other.getContainer())) return false; - if (!getName() - .equals(other.getName())) return false; - if (getHashCode() - != other.getHashCode()) return false; - if (!getMaybeTypeName() - .equals(other.getMaybeTypeName())) return false; - if (!getDtypesAndShapesList() - .equals(other.getDtypesAndShapesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DEVICE_FIELD_NUMBER; - hash = (53 * hash) + getDevice().hashCode(); - hash = (37 * hash) + CONTAINER_FIELD_NUMBER; - hash = (53 * hash) + getContainer().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + HASH_CODE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getHashCode()); - hash = (37 * hash) + MAYBE_TYPE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getMaybeTypeName().hashCode(); - if (getDtypesAndShapesCount() > 0) { - hash = (37 * hash) + DTYPES_AND_SHAPES_FIELD_NUMBER; - hash = (53 * hash) + getDtypesAndShapesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ResourceHandleProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ResourceHandleProto parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ResourceHandleProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ResourceHandleProto parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ResourceHandleProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ResourceHandleProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ResourceHandleProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ResourceHandleProto 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 ResourceHandleProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static ResourceHandleProto 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 ResourceHandleProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static ResourceHandleProto parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(ResourceHandleProto prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
    -   * Protocol buffer representing a handle to a tensorflow resource. Handles are
    -   * not valid across executions, but can be serialized back and forth from within
    -   * a single run.
    -   * 
    - * - * Protobuf type {@code tensorflow.ResourceHandleProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto) - ResourceHandleProtoOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ResourceHandleProto.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.ResourceHandleProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDtypesAndShapesFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - device_ = ""; - - container_ = ""; - - name_ = ""; - - hashCode_ = 0L; - - maybeTypeName_ = ""; - - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - dtypesAndShapesBuilder_.clear(); - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; - } - - @Override - public ResourceHandleProto getDefaultInstanceForType() { - return ResourceHandleProto.getDefaultInstance(); - } - - @Override - public ResourceHandleProto build() { - ResourceHandleProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public ResourceHandleProto buildPartial() { - ResourceHandleProto result = new ResourceHandleProto(this); - int from_bitField0_ = bitField0_; - result.device_ = device_; - result.container_ = container_; - result.name_ = name_; - result.hashCode_ = hashCode_; - result.maybeTypeName_ = maybeTypeName_; - if (dtypesAndShapesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = java.util.Collections.unmodifiableList(dtypesAndShapes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dtypesAndShapes_ = dtypesAndShapes_; - } else { - result.dtypesAndShapes_ = dtypesAndShapesBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ResourceHandleProto) { - return mergeFrom((ResourceHandleProto) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(ResourceHandleProto other) { - if (other == ResourceHandleProto.getDefaultInstance()) { - return this; - } - if (!other.getDevice().isEmpty()) { - device_ = other.device_; - onChanged(); - } - if (!other.getContainer().isEmpty()) { - container_ = other.container_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getHashCode() != 0L) { - setHashCode(other.getHashCode()); - } - if (!other.getMaybeTypeName().isEmpty()) { - maybeTypeName_ = other.maybeTypeName_; - onChanged(); - } - if (dtypesAndShapesBuilder_ == null) { - if (!other.dtypesAndShapes_.isEmpty()) { - if (dtypesAndShapes_.isEmpty()) { - dtypesAndShapes_ = other.dtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.addAll(other.dtypesAndShapes_); - } - onChanged(); - } - } else { - if (!other.dtypesAndShapes_.isEmpty()) { - if (dtypesAndShapesBuilder_.isEmpty()) { - dtypesAndShapesBuilder_.dispose(); - dtypesAndShapesBuilder_ = null; - dtypesAndShapes_ = other.dtypesAndShapes_; - bitField0_ = (bitField0_ & ~0x00000001); - dtypesAndShapesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDtypesAndShapesFieldBuilder() : null; - } else { - dtypesAndShapesBuilder_.addAllMessages(other.dtypesAndShapes_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ResourceHandleProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ResourceHandleProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private Object device_ = ""; - - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public String getDevice() { - Object ref = device_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - device_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public com.google.protobuf.ByteString - getDeviceBytes() { - Object ref = device_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - device_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder setDevice( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - device_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder clearDevice() { - - device_ = getDefaultInstance().getDevice(); - onChanged(); - return this; - } - /** - *
    -     * Unique name for the device containing the resource.
    -     * 
    - * - * string device = 1; - */ - public Builder setDeviceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - device_ = value; - onChanged(); - return this; - } - - private Object container_ = ""; - - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public String getContainer() { - Object ref = container_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - container_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public com.google.protobuf.ByteString - getContainerBytes() { - Object ref = container_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - container_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder setContainer( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - container_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder clearContainer() { - - container_ = getDefaultInstance().getContainer(); - onChanged(); - return this; - } - /** - *
    -     * Container in which this resource is placed.
    -     * 
    - * - * string container = 2; - */ - public Builder setContainerBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - container_ = value; - onChanged(); - return this; - } - - private Object name_ = ""; - - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * string name = 3; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -     * Unique name of this resource.
    -     * 
    - * - * 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 hashCode_ ; - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public long getHashCode() { - return hashCode_; - } - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public Builder setHashCode(long value) { - - hashCode_ = value; - onChanged(); - return this; - } - /** - *
    -     * Hash code for the type of the resource. Is only valid in the same device
    -     * and in the same execution.
    -     * 
    - * - * uint64 hash_code = 4; - */ - public Builder clearHashCode() { - - hashCode_ = 0L; - onChanged(); - return this; - } - - private Object maybeTypeName_ = ""; - - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public String getMaybeTypeName() { - Object ref = maybeTypeName_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - maybeTypeName_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public com.google.protobuf.ByteString - getMaybeTypeNameBytes() { - Object ref = maybeTypeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - maybeTypeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder setMaybeTypeName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - maybeTypeName_ = value; - onChanged(); - return this; - } - - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder clearMaybeTypeName() { - - maybeTypeName_ = getDefaultInstance().getMaybeTypeName(); - onChanged(); - return this; - } - /** - *
    -     * For debug-only, the name of the type pointed to by this handle, if
    -     * available.
    -     * 
    - * - * string maybe_type_name = 5; - */ - public Builder setMaybeTypeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - maybeTypeName_ = value; - onChanged(); - return this; - } - - private java.util.List dtypesAndShapes_ = - java.util.Collections.emptyList(); - private void ensureDtypesAndShapesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dtypesAndShapes_ = new java.util.ArrayList(dtypesAndShapes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - DtypeAndShape, DtypeAndShape.Builder, DtypeAndShapeOrBuilder> dtypesAndShapesBuilder_; - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List getDtypesAndShapesList() { - if (dtypesAndShapesBuilder_ == null) { - return java.util.Collections.unmodifiableList(dtypesAndShapes_); - } else { - return dtypesAndShapesBuilder_.getMessageList(); - } - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public int getDtypesAndShapesCount() { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.size(); - } else { - return dtypesAndShapesBuilder_.getCount(); - } - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShape getDtypesAndShapes(int index) { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.get(index); - } else { - return dtypesAndShapesBuilder_.getMessage(index); - } - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder setDtypesAndShapes( - int index, DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.set(index, value); - onChanged(); - } else { - dtypesAndShapesBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder setDtypesAndShapes( - int index, DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.set(index, builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes(DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(value); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - int index, DtypeAndShape value) { - if (dtypesAndShapesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(index, value); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addDtypesAndShapes( - int index, DtypeAndShape.Builder builderForValue) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.add(index, builderForValue.build()); - onChanged(); - } else { - dtypesAndShapesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder addAllDtypesAndShapes( - Iterable values) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dtypesAndShapes_); - onChanged(); - } else { - dtypesAndShapesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder clearDtypesAndShapes() { - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - dtypesAndShapesBuilder_.clear(); - } - return this; - } - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public Builder removeDtypesAndShapes(int index) { - if (dtypesAndShapesBuilder_ == null) { - ensureDtypesAndShapesIsMutable(); - dtypesAndShapes_.remove(index); - onChanged(); - } else { - dtypesAndShapesBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShape.Builder getDtypesAndShapesBuilder( - int index) { - return getDtypesAndShapesFieldBuilder().getBuilder(index); - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index) { - if (dtypesAndShapesBuilder_ == null) { - return dtypesAndShapes_.get(index); - } else { - return dtypesAndShapesBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesOrBuilderList() { - if (dtypesAndShapesBuilder_ != null) { - return dtypesAndShapesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(dtypesAndShapes_); - } - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShape.Builder addDtypesAndShapesBuilder() { - return getDtypesAndShapesFieldBuilder().addBuilder( - DtypeAndShape.getDefaultInstance()); - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public DtypeAndShape.Builder addDtypesAndShapesBuilder( - int index) { - return getDtypesAndShapesFieldBuilder().addBuilder( - index, DtypeAndShape.getDefaultInstance()); - } - - /** - *
    -     * Data types and shapes for the underlying resource.
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - public java.util.List - getDtypesAndShapesBuilderList() { - return getDtypesAndShapesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - DtypeAndShape, DtypeAndShape.Builder, DtypeAndShapeOrBuilder> - getDtypesAndShapesFieldBuilder() { - if (dtypesAndShapesBuilder_ == null) { - dtypesAndShapesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - DtypeAndShape, DtypeAndShape.Builder, DtypeAndShapeOrBuilder>( - dtypesAndShapes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - dtypesAndShapes_ = null; - } - return dtypesAndShapesBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.ResourceHandleProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto) - private static final ResourceHandleProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new ResourceHandleProto(); - } - - public static ResourceHandleProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public ResourceHandleProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceHandleProto(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public ResourceHandleProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java deleted file mode 100644 index ffea8ce565a..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/ResourceHandleProtoOrBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/resource_handle.proto - -package org.tensorflow.proto.framework; - -public interface ResourceHandleProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - String getDevice(); - - /** - *
    -   * Unique name for the device containing the resource.
    -   * 
    - * - * string device = 1; - */ - com.google.protobuf.ByteString - getDeviceBytes(); - - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - String getContainer(); - - /** - *
    -   * Container in which this resource is placed.
    -   * 
    - * - * string container = 2; - */ - com.google.protobuf.ByteString - getContainerBytes(); - - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - String getName(); - - /** - *
    -   * Unique name of this resource.
    -   * 
    - * - * string name = 3; - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
    -   * Hash code for the type of the resource. Is only valid in the same device
    -   * and in the same execution.
    -   * 
    - * - * uint64 hash_code = 4; - */ - long getHashCode(); - - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - String getMaybeTypeName(); - - /** - *
    -   * For debug-only, the name of the type pointed to by this handle, if
    -   * available.
    -   * 
    - * - * string maybe_type_name = 5; - */ - com.google.protobuf.ByteString - getMaybeTypeNameBytes(); - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - java.util.List - getDtypesAndShapesList(); - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index); - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - int getDtypesAndShapesCount(); - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - java.util.List - getDtypesAndShapesOrBuilderList(); - - /** - *
    -   * Data types and shapes for the underlying resource.
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; - */ - ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProto.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProto.java deleted file mode 100644 index 509d35aa596..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProto.java +++ /dev/null @@ -1,4133 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing a tensor.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorProto} - */ -public final class TensorProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorProto) - TensorProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorProto.newBuilder() to construct. - private TensorProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorProto() { - dtype_ = 0; - tensorContent_ = com.google.protobuf.ByteString.EMPTY; - halfVal_ = emptyIntList(); - floatVal_ = emptyFloatList(); - doubleVal_ = emptyDoubleList(); - intVal_ = emptyIntList(); - stringVal_ = java.util.Collections.emptyList(); - scomplexVal_ = emptyFloatList(); - int64Val_ = emptyLongList(); - boolVal_ = emptyBooleanList(); - dcomplexVal_ = emptyDoubleList(); - resourceHandleVal_ = java.util.Collections.emptyList(); - variantVal_ = java.util.Collections.emptyList(); - uint32Val_ = emptyIntList(); - uint64Val_ = emptyLongList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new TensorProto(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorProto( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - int rawValue = input.readEnum(); - - dtype_ = rawValue; - break; - } - case 18: { - TensorShapeProto.Builder subBuilder = null; - if (tensorShape_ != null) { - subBuilder = tensorShape_.toBuilder(); - } - tensorShape_ = input.readMessage(TensorShapeProto.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(tensorShape_); - tensorShape_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - versionNumber_ = input.readInt32(); - break; - } - case 34: { - - tensorContent_ = input.readBytes(); - break; - } - case 45: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - floatVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000002; - } - floatVal_.addFloat(input.readFloat()); - break; - } - case 42: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { - floatVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000002; - } - while (input.getBytesUntilLimit() > 0) { - floatVal_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 49: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - doubleVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000004; - } - doubleVal_.addDouble(input.readDouble()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { - doubleVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000004; - } - while (input.getBytesUntilLimit() > 0) { - doubleVal_.addDouble(input.readDouble()); - } - input.popLimit(limit); - break; - } - case 56: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - intVal_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - intVal_.addInt(input.readInt32()); - break; - } - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) { - intVal_ = newIntList(); - mutable_bitField0_ |= 0x00000008; - } - while (input.getBytesUntilLimit() > 0) { - intVal_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { - stringVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - stringVal_.add(input.readBytes()); - break; - } - case 77: { - if (!((mutable_bitField0_ & 0x00000020) != 0)) { - scomplexVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000020; - } - scomplexVal_.addFloat(input.readFloat()); - break; - } - case 74: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000020) != 0) && input.getBytesUntilLimit() > 0) { - scomplexVal_ = newFloatList(); - mutable_bitField0_ |= 0x00000020; - } - while (input.getBytesUntilLimit() > 0) { - scomplexVal_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } - case 80: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { - int64Val_ = newLongList(); - mutable_bitField0_ |= 0x00000040; - } - int64Val_.addLong(input.readInt64()); - break; - } - case 82: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000040) != 0) && input.getBytesUntilLimit() > 0) { - int64Val_ = newLongList(); - mutable_bitField0_ |= 0x00000040; - } - while (input.getBytesUntilLimit() > 0) { - int64Val_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } - case 88: { - if (!((mutable_bitField0_ & 0x00000080) != 0)) { - boolVal_ = newBooleanList(); - mutable_bitField0_ |= 0x00000080; - } - boolVal_.addBoolean(input.readBool()); - break; - } - case 90: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000080) != 0) && input.getBytesUntilLimit() > 0) { - boolVal_ = newBooleanList(); - mutable_bitField0_ |= 0x00000080; - } - while (input.getBytesUntilLimit() > 0) { - boolVal_.addBoolean(input.readBool()); - } - input.popLimit(limit); - break; - } - case 97: { - if (!((mutable_bitField0_ & 0x00000100) != 0)) { - dcomplexVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000100; - } - dcomplexVal_.addDouble(input.readDouble()); - break; - } - case 98: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000100) != 0) && input.getBytesUntilLimit() > 0) { - dcomplexVal_ = newDoubleList(); - mutable_bitField0_ |= 0x00000100; - } - while (input.getBytesUntilLimit() > 0) { - dcomplexVal_.addDouble(input.readDouble()); - } - input.popLimit(limit); - break; - } - case 104: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - halfVal_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - halfVal_.addInt(input.readInt32()); - break; - } - case 106: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - halfVal_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - halfVal_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 114: { - if (!((mutable_bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000200; - } - resourceHandleVal_.add( - input.readMessage(ResourceHandleProto.parser(), extensionRegistry)); - break; - } - case 122: { - if (!((mutable_bitField0_ & 0x00000400) != 0)) { - variantVal_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; - } - variantVal_.add( - input.readMessage(VariantTensorDataProto.parser(), extensionRegistry)); - break; - } - case 128: { - if (!((mutable_bitField0_ & 0x00000800) != 0)) { - uint32Val_ = newIntList(); - mutable_bitField0_ |= 0x00000800; - } - uint32Val_.addInt(input.readUInt32()); - break; - } - case 130: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000800) != 0) && input.getBytesUntilLimit() > 0) { - uint32Val_ = newIntList(); - mutable_bitField0_ |= 0x00000800; - } - while (input.getBytesUntilLimit() > 0) { - uint32Val_.addInt(input.readUInt32()); - } - input.popLimit(limit); - break; - } - case 136: { - if (!((mutable_bitField0_ & 0x00001000) != 0)) { - uint64Val_ = newLongList(); - mutable_bitField0_ |= 0x00001000; - } - uint64Val_.addLong(input.readUInt64()); - break; - } - case 138: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00001000) != 0) && input.getBytesUntilLimit() > 0) { - uint64Val_ = newLongList(); - mutable_bitField0_ |= 0x00001000; - } - while (input.getBytesUntilLimit() > 0) { - uint64Val_.addLong(input.readUInt64()); - } - input.popLimit(limit); - 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)) { - floatVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - doubleVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - intVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000010) != 0)) { - stringVal_ = java.util.Collections.unmodifiableList(stringVal_); // C - } - if (((mutable_bitField0_ & 0x00000020) != 0)) { - scomplexVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000040) != 0)) { - int64Val_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000080) != 0)) { - boolVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000100) != 0)) { - dcomplexVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - halfVal_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = java.util.Collections.unmodifiableList(resourceHandleVal_); - } - if (((mutable_bitField0_ & 0x00000400) != 0)) { - variantVal_ = java.util.Collections.unmodifiableList(variantVal_); - } - if (((mutable_bitField0_ & 0x00000800) != 0)) { - uint32Val_.makeImmutable(); // C - } - if (((mutable_bitField0_ & 0x00001000) != 0)) { - uint64Val_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - TensorProto.class, Builder.class); - } - - public static final int DTYPE_FIELD_NUMBER = 1; - private int dtype_; - - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public DataType getDtype() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(dtype_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; - private TensorShapeProto tensorShape_; - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShape_ != null; - } - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public TensorShapeProto getTensorShape() { - return tensorShape_ == null ? TensorShapeProto.getDefaultInstance() : tensorShape_; - } - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - return getTensorShape(); - } - - public static final int VERSION_NUMBER_FIELD_NUMBER = 3; - private int versionNumber_; - /** - *
    -   * Version number.
    -   * In version 0, if the "repeated xxx" representations contain only one
    -   * element, that element is repeated to fill the shape.  This makes it easy
    -   * to represent a constant Tensor with a single value.
    -   * 
    - * - * int32 version_number = 3; - */ - public int getVersionNumber() { - return versionNumber_; - } - - public static final int TENSOR_CONTENT_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString tensorContent_; - /** - *
    -   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -   * can be used for all tensor types. The purpose of this representation is to
    -   * reduce serialization overhead during RPC call by avoiding serialization of
    -   * many repeated small items.
    -   * 
    - * - * bytes tensor_content = 4; - */ - public com.google.protobuf.ByteString getTensorContent() { - return tensorContent_; - } - - public static final int HALF_VAL_FIELD_NUMBER = 13; - private com.google.protobuf.Internal.IntList halfVal_; - - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public java.util.List - getHalfValList() { - return halfVal_; - } - - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfValCount() { - return halfVal_.size(); - } - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfVal(int index) { - return halfVal_.getInt(index); - } - private int halfValMemoizedSerializedSize = -1; - - public static final int FLOAT_VAL_FIELD_NUMBER = 5; - private com.google.protobuf.Internal.FloatList floatVal_; - - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public java.util.List - getFloatValList() { - return floatVal_; - } - - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public int getFloatValCount() { - return floatVal_.size(); - } - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public float getFloatVal(int index) { - return floatVal_.getFloat(index); - } - private int floatValMemoizedSerializedSize = -1; - - public static final int DOUBLE_VAL_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.DoubleList doubleVal_; - - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public java.util.List - getDoubleValList() { - return doubleVal_; - } - - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public int getDoubleValCount() { - return doubleVal_.size(); - } - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public double getDoubleVal(int index) { - return doubleVal_.getDouble(index); - } - private int doubleValMemoizedSerializedSize = -1; - - public static final int INT_VAL_FIELD_NUMBER = 7; - private com.google.protobuf.Internal.IntList intVal_; - - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public java.util.List - getIntValList() { - return intVal_; - } - - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntValCount() { - return intVal_.size(); - } - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntVal(int index) { - return intVal_.getInt(index); - } - private int intValMemoizedSerializedSize = -1; - - public static final int STRING_VAL_FIELD_NUMBER = 8; - private java.util.List stringVal_; - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public java.util.List - getStringValList() { - return stringVal_; - } - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public int getStringValCount() { - return stringVal_.size(); - } - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - public com.google.protobuf.ByteString getStringVal(int index) { - return stringVal_.get(index); - } - - public static final int SCOMPLEX_VAL_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.FloatList scomplexVal_; - - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public java.util.List - getScomplexValList() { - return scomplexVal_; - } - - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public int getScomplexValCount() { - return scomplexVal_.size(); - } - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public float getScomplexVal(int index) { - return scomplexVal_.getFloat(index); - } - private int scomplexValMemoizedSerializedSize = -1; - - public static final int INT64_VAL_FIELD_NUMBER = 10; - private com.google.protobuf.Internal.LongList int64Val_; - - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public java.util.List - getInt64ValList() { - return int64Val_; - } - - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public int getInt64ValCount() { - return int64Val_.size(); - } - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public long getInt64Val(int index) { - return int64Val_.getLong(index); - } - private int int64ValMemoizedSerializedSize = -1; - - public static final int BOOL_VAL_FIELD_NUMBER = 11; - private com.google.protobuf.Internal.BooleanList boolVal_; - - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public java.util.List - getBoolValList() { - return boolVal_; - } - - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public int getBoolValCount() { - return boolVal_.size(); - } - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public boolean getBoolVal(int index) { - return boolVal_.getBoolean(index); - } - private int boolValMemoizedSerializedSize = -1; - - public static final int DCOMPLEX_VAL_FIELD_NUMBER = 12; - private com.google.protobuf.Internal.DoubleList dcomplexVal_; - - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public java.util.List - getDcomplexValList() { - return dcomplexVal_; - } - - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public int getDcomplexValCount() { - return dcomplexVal_.size(); - } - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public double getDcomplexVal(int index) { - return dcomplexVal_.getDouble(index); - } - private int dcomplexValMemoizedSerializedSize = -1; - - public static final int RESOURCE_HANDLE_VAL_FIELD_NUMBER = 14; - private java.util.List resourceHandleVal_; - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List getResourceHandleValList() { - return resourceHandleVal_; - } - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValOrBuilderList() { - return resourceHandleVal_; - } - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public int getResourceHandleValCount() { - return resourceHandleVal_.size(); - } - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProto getResourceHandleVal(int index) { - return resourceHandleVal_.get(index); - } - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index) { - return resourceHandleVal_.get(index); - } - - public static final int VARIANT_VAL_FIELD_NUMBER = 15; - private java.util.List variantVal_; - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List getVariantValList() { - return variantVal_; - } - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValOrBuilderList() { - return variantVal_; - } - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public int getVariantValCount() { - return variantVal_.size(); - } - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProto getVariantVal(int index) { - return variantVal_.get(index); - } - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index) { - return variantVal_.get(index); - } - - public static final int UINT32_VAL_FIELD_NUMBER = 16; - private com.google.protobuf.Internal.IntList uint32Val_; - - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public java.util.List - getUint32ValList() { - return uint32Val_; - } - - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32ValCount() { - return uint32Val_.size(); - } - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32Val(int index) { - return uint32Val_.getInt(index); - } - private int uint32ValMemoizedSerializedSize = -1; - - public static final int UINT64_VAL_FIELD_NUMBER = 17; - private com.google.protobuf.Internal.LongList uint64Val_; - - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public java.util.List - getUint64ValList() { - return uint64Val_; - } - - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public int getUint64ValCount() { - return uint64Val_.size(); - } - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public long getUint64Val(int index) { - return uint64Val_.getLong(index); - } - private int uint64ValMemoizedSerializedSize = -1; - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (dtype_ != DataType.DT_INVALID.getNumber()) { - output.writeEnum(1, dtype_); - } - if (tensorShape_ != null) { - output.writeMessage(2, getTensorShape()); - } - if (versionNumber_ != 0) { - output.writeInt32(3, versionNumber_); - } - if (!tensorContent_.isEmpty()) { - output.writeBytes(4, tensorContent_); - } - if (getFloatValList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(floatValMemoizedSerializedSize); - } - for (int i = 0; i < floatVal_.size(); i++) { - output.writeFloatNoTag(floatVal_.getFloat(i)); - } - if (getDoubleValList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(doubleValMemoizedSerializedSize); - } - for (int i = 0; i < doubleVal_.size(); i++) { - output.writeDoubleNoTag(doubleVal_.getDouble(i)); - } - if (getIntValList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(intValMemoizedSerializedSize); - } - for (int i = 0; i < intVal_.size(); i++) { - output.writeInt32NoTag(intVal_.getInt(i)); - } - for (int i = 0; i < stringVal_.size(); i++) { - output.writeBytes(8, stringVal_.get(i)); - } - if (getScomplexValList().size() > 0) { - output.writeUInt32NoTag(74); - output.writeUInt32NoTag(scomplexValMemoizedSerializedSize); - } - for (int i = 0; i < scomplexVal_.size(); i++) { - output.writeFloatNoTag(scomplexVal_.getFloat(i)); - } - if (getInt64ValList().size() > 0) { - output.writeUInt32NoTag(82); - output.writeUInt32NoTag(int64ValMemoizedSerializedSize); - } - for (int i = 0; i < int64Val_.size(); i++) { - output.writeInt64NoTag(int64Val_.getLong(i)); - } - if (getBoolValList().size() > 0) { - output.writeUInt32NoTag(90); - output.writeUInt32NoTag(boolValMemoizedSerializedSize); - } - for (int i = 0; i < boolVal_.size(); i++) { - output.writeBoolNoTag(boolVal_.getBoolean(i)); - } - if (getDcomplexValList().size() > 0) { - output.writeUInt32NoTag(98); - output.writeUInt32NoTag(dcomplexValMemoizedSerializedSize); - } - for (int i = 0; i < dcomplexVal_.size(); i++) { - output.writeDoubleNoTag(dcomplexVal_.getDouble(i)); - } - if (getHalfValList().size() > 0) { - output.writeUInt32NoTag(106); - output.writeUInt32NoTag(halfValMemoizedSerializedSize); - } - for (int i = 0; i < halfVal_.size(); i++) { - output.writeInt32NoTag(halfVal_.getInt(i)); - } - for (int i = 0; i < resourceHandleVal_.size(); i++) { - output.writeMessage(14, resourceHandleVal_.get(i)); - } - for (int i = 0; i < variantVal_.size(); i++) { - output.writeMessage(15, variantVal_.get(i)); - } - if (getUint32ValList().size() > 0) { - output.writeUInt32NoTag(130); - output.writeUInt32NoTag(uint32ValMemoizedSerializedSize); - } - for (int i = 0; i < uint32Val_.size(); i++) { - output.writeUInt32NoTag(uint32Val_.getInt(i)); - } - if (getUint64ValList().size() > 0) { - output.writeUInt32NoTag(138); - output.writeUInt32NoTag(uint64ValMemoizedSerializedSize); - } - for (int i = 0; i < uint64Val_.size(); i++) { - output.writeUInt64NoTag(uint64Val_.getLong(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (dtype_ != DataType.DT_INVALID.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, dtype_); - } - if (tensorShape_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTensorShape()); - } - if (versionNumber_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, versionNumber_); - } - if (!tensorContent_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, tensorContent_); - } - { - int dataSize = 0; - dataSize = 4 * getFloatValList().size(); - size += dataSize; - if (!getFloatValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - floatValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * getDoubleValList().size(); - size += dataSize; - if (!getDoubleValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - doubleValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < intVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(intVal_.getInt(i)); - } - size += dataSize; - if (!getIntValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - intValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < stringVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(stringVal_.get(i)); - } - size += dataSize; - size += 1 * getStringValList().size(); - } - { - int dataSize = 0; - dataSize = 4 * getScomplexValList().size(); - size += dataSize; - if (!getScomplexValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - scomplexValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < int64Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt64SizeNoTag(int64Val_.getLong(i)); - } - size += dataSize; - if (!getInt64ValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - int64ValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 1 * getBoolValList().size(); - size += dataSize; - if (!getBoolValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - boolValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * getDcomplexValList().size(); - size += dataSize; - if (!getDcomplexValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - dcomplexValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < halfVal_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(halfVal_.getInt(i)); - } - size += dataSize; - if (!getHalfValList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - halfValMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < resourceHandleVal_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, resourceHandleVal_.get(i)); - } - for (int i = 0; i < variantVal_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(15, variantVal_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < uint32Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(uint32Val_.getInt(i)); - } - size += dataSize; - if (!getUint32ValList().isEmpty()) { - size += 2; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - uint32ValMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < uint64Val_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt64SizeNoTag(uint64Val_.getLong(i)); - } - size += dataSize; - if (!getUint64ValList().isEmpty()) { - size += 2; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - uint64ValMemoizedSerializedSize = dataSize; - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof TensorProto)) { - return super.equals(obj); - } - TensorProto other = (TensorProto) obj; - - if (dtype_ != other.dtype_) { - return false; - } - if (hasTensorShape() != other.hasTensorShape()) { - return false; - } - if (hasTensorShape()) { - if (!getTensorShape() - .equals(other.getTensorShape())) return false; - } - if (getVersionNumber() - != other.getVersionNumber()) return false; - if (!getTensorContent() - .equals(other.getTensorContent())) return false; - if (!getHalfValList() - .equals(other.getHalfValList())) return false; - if (!getFloatValList() - .equals(other.getFloatValList())) return false; - if (!getDoubleValList() - .equals(other.getDoubleValList())) return false; - if (!getIntValList() - .equals(other.getIntValList())) return false; - if (!getStringValList() - .equals(other.getStringValList())) return false; - if (!getScomplexValList() - .equals(other.getScomplexValList())) return false; - if (!getInt64ValList() - .equals(other.getInt64ValList())) return false; - if (!getBoolValList() - .equals(other.getBoolValList())) return false; - if (!getDcomplexValList() - .equals(other.getDcomplexValList())) return false; - if (!getResourceHandleValList() - .equals(other.getResourceHandleValList())) return false; - if (!getVariantValList() - .equals(other.getVariantValList())) return false; - if (!getUint32ValList() - .equals(other.getUint32ValList())) return false; - if (!getUint64ValList() - .equals(other.getUint64ValList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + dtype_; - if (hasTensorShape()) { - hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; - hash = (53 * hash) + getTensorShape().hashCode(); - } - hash = (37 * hash) + VERSION_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getVersionNumber(); - hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getTensorContent().hashCode(); - if (getHalfValCount() > 0) { - hash = (37 * hash) + HALF_VAL_FIELD_NUMBER; - hash = (53 * hash) + getHalfValList().hashCode(); - } - if (getFloatValCount() > 0) { - hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getFloatValList().hashCode(); - } - if (getDoubleValCount() > 0) { - hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; - hash = (53 * hash) + getDoubleValList().hashCode(); - } - if (getIntValCount() > 0) { - hash = (37 * hash) + INT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getIntValList().hashCode(); - } - if (getStringValCount() > 0) { - hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; - hash = (53 * hash) + getStringValList().hashCode(); - } - if (getScomplexValCount() > 0) { - hash = (37 * hash) + SCOMPLEX_VAL_FIELD_NUMBER; - hash = (53 * hash) + getScomplexValList().hashCode(); - } - if (getInt64ValCount() > 0) { - hash = (37 * hash) + INT64_VAL_FIELD_NUMBER; - hash = (53 * hash) + getInt64ValList().hashCode(); - } - if (getBoolValCount() > 0) { - hash = (37 * hash) + BOOL_VAL_FIELD_NUMBER; - hash = (53 * hash) + getBoolValList().hashCode(); - } - if (getDcomplexValCount() > 0) { - hash = (37 * hash) + DCOMPLEX_VAL_FIELD_NUMBER; - hash = (53 * hash) + getDcomplexValList().hashCode(); - } - if (getResourceHandleValCount() > 0) { - hash = (37 * hash) + RESOURCE_HANDLE_VAL_FIELD_NUMBER; - hash = (53 * hash) + getResourceHandleValList().hashCode(); - } - if (getVariantValCount() > 0) { - hash = (37 * hash) + VARIANT_VAL_FIELD_NUMBER; - hash = (53 * hash) + getVariantValList().hashCode(); - } - if (getUint32ValCount() > 0) { - hash = (37 * hash) + UINT32_VAL_FIELD_NUMBER; - hash = (53 * hash) + getUint32ValList().hashCode(); - } - if (getUint64ValCount() > 0) { - hash = (37 * hash) + UINT64_VAL_FIELD_NUMBER; - hash = (53 * hash) + getUint64ValList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static TensorProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorProto parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorProto parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static TensorProto 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 TensorProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static TensorProto 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 TensorProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static TensorProto parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(TensorProto prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Protocol buffer representing a tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorProto) - TensorProtoOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - TensorProto.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResourceHandleValFieldBuilder(); - getVariantValFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - dtype_ = 0; - - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - versionNumber_ = 0; - - tensorContent_ = com.google.protobuf.ByteString.EMPTY; - - halfVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - floatVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000002); - doubleVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000004); - intVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - stringVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - scomplexVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000020); - int64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000040); - boolVal_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000080); - dcomplexVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000100); - if (resourceHandleValBuilder_ == null) { - resourceHandleVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - } else { - resourceHandleValBuilder_.clear(); - } - if (variantValBuilder_ == null) { - variantVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - } else { - variantValBuilder_.clear(); - } - uint32Val_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000800); - uint64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00001000); - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return TensorProtos.internal_static_tensorflow_TensorProto_descriptor; - } - - @Override - public TensorProto getDefaultInstanceForType() { - return TensorProto.getDefaultInstance(); - } - - @Override - public TensorProto build() { - TensorProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public TensorProto buildPartial() { - TensorProto result = new TensorProto(this); - int from_bitField0_ = bitField0_; - result.dtype_ = dtype_; - if (tensorShapeBuilder_ == null) { - result.tensorShape_ = tensorShape_; - } else { - result.tensorShape_ = tensorShapeBuilder_.build(); - } - result.versionNumber_ = versionNumber_; - result.tensorContent_ = tensorContent_; - if (((bitField0_ & 0x00000001) != 0)) { - halfVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.halfVal_ = halfVal_; - if (((bitField0_ & 0x00000002) != 0)) { - floatVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.floatVal_ = floatVal_; - if (((bitField0_ & 0x00000004) != 0)) { - doubleVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.doubleVal_ = doubleVal_; - if (((bitField0_ & 0x00000008) != 0)) { - intVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.intVal_ = intVal_; - if (((bitField0_ & 0x00000010) != 0)) { - stringVal_ = java.util.Collections.unmodifiableList(stringVal_); - bitField0_ = (bitField0_ & ~0x00000010); - } - result.stringVal_ = stringVal_; - if (((bitField0_ & 0x00000020) != 0)) { - scomplexVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.scomplexVal_ = scomplexVal_; - if (((bitField0_ & 0x00000040) != 0)) { - int64Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.int64Val_ = int64Val_; - if (((bitField0_ & 0x00000080) != 0)) { - boolVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.boolVal_ = boolVal_; - if (((bitField0_ & 0x00000100) != 0)) { - dcomplexVal_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.dcomplexVal_ = dcomplexVal_; - if (resourceHandleValBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = java.util.Collections.unmodifiableList(resourceHandleVal_); - bitField0_ = (bitField0_ & ~0x00000200); - } - result.resourceHandleVal_ = resourceHandleVal_; - } else { - result.resourceHandleVal_ = resourceHandleValBuilder_.build(); - } - if (variantValBuilder_ == null) { - if (((bitField0_ & 0x00000400) != 0)) { - variantVal_ = java.util.Collections.unmodifiableList(variantVal_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.variantVal_ = variantVal_; - } else { - result.variantVal_ = variantValBuilder_.build(); - } - if (((bitField0_ & 0x00000800) != 0)) { - uint32Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.uint32Val_ = uint32Val_; - if (((bitField0_ & 0x00001000) != 0)) { - uint64Val_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.uint64Val_ = uint64Val_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof TensorProto) { - return mergeFrom((TensorProto) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(TensorProto other) { - if (other == TensorProto.getDefaultInstance()) { - return this; - } - if (other.dtype_ != 0) { - setDtypeValue(other.getDtypeValue()); - } - if (other.hasTensorShape()) { - mergeTensorShape(other.getTensorShape()); - } - if (other.getVersionNumber() != 0) { - setVersionNumber(other.getVersionNumber()); - } - if (other.getTensorContent() != com.google.protobuf.ByteString.EMPTY) { - setTensorContent(other.getTensorContent()); - } - if (!other.halfVal_.isEmpty()) { - if (halfVal_.isEmpty()) { - halfVal_ = other.halfVal_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureHalfValIsMutable(); - halfVal_.addAll(other.halfVal_); - } - onChanged(); - } - if (!other.floatVal_.isEmpty()) { - if (floatVal_.isEmpty()) { - floatVal_ = other.floatVal_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureFloatValIsMutable(); - floatVal_.addAll(other.floatVal_); - } - onChanged(); - } - if (!other.doubleVal_.isEmpty()) { - if (doubleVal_.isEmpty()) { - doubleVal_ = other.doubleVal_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureDoubleValIsMutable(); - doubleVal_.addAll(other.doubleVal_); - } - onChanged(); - } - if (!other.intVal_.isEmpty()) { - if (intVal_.isEmpty()) { - intVal_ = other.intVal_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureIntValIsMutable(); - intVal_.addAll(other.intVal_); - } - onChanged(); - } - if (!other.stringVal_.isEmpty()) { - if (stringVal_.isEmpty()) { - stringVal_ = other.stringVal_; - bitField0_ = (bitField0_ & ~0x00000010); - } else { - ensureStringValIsMutable(); - stringVal_.addAll(other.stringVal_); - } - onChanged(); - } - if (!other.scomplexVal_.isEmpty()) { - if (scomplexVal_.isEmpty()) { - scomplexVal_ = other.scomplexVal_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureScomplexValIsMutable(); - scomplexVal_.addAll(other.scomplexVal_); - } - onChanged(); - } - if (!other.int64Val_.isEmpty()) { - if (int64Val_.isEmpty()) { - int64Val_ = other.int64Val_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureInt64ValIsMutable(); - int64Val_.addAll(other.int64Val_); - } - onChanged(); - } - if (!other.boolVal_.isEmpty()) { - if (boolVal_.isEmpty()) { - boolVal_ = other.boolVal_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureBoolValIsMutable(); - boolVal_.addAll(other.boolVal_); - } - onChanged(); - } - if (!other.dcomplexVal_.isEmpty()) { - if (dcomplexVal_.isEmpty()) { - dcomplexVal_ = other.dcomplexVal_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureDcomplexValIsMutable(); - dcomplexVal_.addAll(other.dcomplexVal_); - } - onChanged(); - } - if (resourceHandleValBuilder_ == null) { - if (!other.resourceHandleVal_.isEmpty()) { - if (resourceHandleVal_.isEmpty()) { - resourceHandleVal_ = other.resourceHandleVal_; - bitField0_ = (bitField0_ & ~0x00000200); - } else { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.addAll(other.resourceHandleVal_); - } - onChanged(); - } - } else { - if (!other.resourceHandleVal_.isEmpty()) { - if (resourceHandleValBuilder_.isEmpty()) { - resourceHandleValBuilder_.dispose(); - resourceHandleValBuilder_ = null; - resourceHandleVal_ = other.resourceHandleVal_; - bitField0_ = (bitField0_ & ~0x00000200); - resourceHandleValBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResourceHandleValFieldBuilder() : null; - } else { - resourceHandleValBuilder_.addAllMessages(other.resourceHandleVal_); - } - } - } - if (variantValBuilder_ == null) { - if (!other.variantVal_.isEmpty()) { - if (variantVal_.isEmpty()) { - variantVal_ = other.variantVal_; - bitField0_ = (bitField0_ & ~0x00000400); - } else { - ensureVariantValIsMutable(); - variantVal_.addAll(other.variantVal_); - } - onChanged(); - } - } else { - if (!other.variantVal_.isEmpty()) { - if (variantValBuilder_.isEmpty()) { - variantValBuilder_.dispose(); - variantValBuilder_ = null; - variantVal_ = other.variantVal_; - bitField0_ = (bitField0_ & ~0x00000400); - variantValBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getVariantValFieldBuilder() : null; - } else { - variantValBuilder_.addAllMessages(other.variantVal_); - } - } - } - if (!other.uint32Val_.isEmpty()) { - if (uint32Val_.isEmpty()) { - uint32Val_ = other.uint32Val_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureUint32ValIsMutable(); - uint32Val_.addAll(other.uint32Val_); - } - onChanged(); - } - if (!other.uint64Val_.isEmpty()) { - if (uint64Val_.isEmpty()) { - uint64Val_ = other.uint64Val_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureUint64ValIsMutable(); - uint64Val_.addAll(other.uint64Val_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - TensorProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (TensorProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int dtype_ = 0; - /** - * .tensorflow.DataType dtype = 1; - */ - public int getDtypeValue() { - return dtype_; - } - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtypeValue(int value) { - dtype_ = value; - onChanged(); - return this; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public DataType getDtype() { - @SuppressWarnings("deprecation") - DataType result = DataType.valueOf(dtype_); - return result == null ? DataType.UNRECOGNIZED : result; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder setDtype(DataType value) { - if (value == null) { - throw new NullPointerException(); - } - - dtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .tensorflow.DataType dtype = 1; - */ - public Builder clearDtype() { - - dtype_ = 0; - onChanged(); - return this; - } - - private TensorShapeProto tensorShape_; - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> tensorShapeBuilder_; - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public boolean hasTensorShape() { - return tensorShapeBuilder_ != null || tensorShape_ != null; - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public TensorShapeProto getTensorShape() { - if (tensorShapeBuilder_ == null) { - return tensorShape_ == null ? TensorShapeProto.getDefaultInstance() : tensorShape_; - } else { - return tensorShapeBuilder_.getMessage(); - } - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape(TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - tensorShape_ = value; - onChanged(); - } else { - tensorShapeBuilder_.setMessage(value); - } - - return this; - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder setTensorShape( - TensorShapeProto.Builder builderForValue) { - if (tensorShapeBuilder_ == null) { - tensorShape_ = builderForValue.build(); - onChanged(); - } else { - tensorShapeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder mergeTensorShape(TensorShapeProto value) { - if (tensorShapeBuilder_ == null) { - if (tensorShape_ != null) { - tensorShape_ = - TensorShapeProto.newBuilder(tensorShape_).mergeFrom(value).buildPartial(); - } else { - tensorShape_ = value; - } - onChanged(); - } else { - tensorShapeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public Builder clearTensorShape() { - if (tensorShapeBuilder_ == null) { - tensorShape_ = null; - onChanged(); - } else { - tensorShape_ = null; - tensorShapeBuilder_ = null; - } - - return this; - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public TensorShapeProto.Builder getTensorShapeBuilder() { - - onChanged(); - return getTensorShapeFieldBuilder().getBuilder(); - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - public TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { - if (tensorShapeBuilder_ != null) { - return tensorShapeBuilder_.getMessageOrBuilder(); - } else { - return tensorShape_ == null ? - TensorShapeProto.getDefaultInstance() : tensorShape_; - } - } - - /** - *
    -     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -     * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> - getTensorShapeFieldBuilder() { - if (tensorShapeBuilder_ == null) { - tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>( - getTensorShape(), - getParentForChildren(), - isClean()); - tensorShape_ = null; - } - return tensorShapeBuilder_; - } - - private int versionNumber_ ; - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public int getVersionNumber() { - return versionNumber_; - } - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public Builder setVersionNumber(int value) { - - versionNumber_ = value; - onChanged(); - return this; - } - /** - *
    -     * Version number.
    -     * In version 0, if the "repeated xxx" representations contain only one
    -     * element, that element is repeated to fill the shape.  This makes it easy
    -     * to represent a constant Tensor with a single value.
    -     * 
    - * - * int32 version_number = 3; - */ - public Builder clearVersionNumber() { - - versionNumber_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString tensorContent_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public com.google.protobuf.ByteString getTensorContent() { - return tensorContent_; - } - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public Builder setTensorContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - tensorContent_ = value; - onChanged(); - return this; - } - /** - *
    -     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -     * can be used for all tensor types. The purpose of this representation is to
    -     * reduce serialization overhead during RPC call by avoiding serialization of
    -     * many repeated small items.
    -     * 
    - * - * bytes tensor_content = 4; - */ - public Builder clearTensorContent() { - - tensorContent_ = getDefaultInstance().getTensorContent(); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList halfVal_ = emptyIntList(); - private void ensureHalfValIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - halfVal_ = mutableCopy(halfVal_); - bitField0_ |= 0x00000001; - } - } - - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public java.util.List - getHalfValList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(halfVal_) : halfVal_; - } - - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfValCount() { - return halfVal_.size(); - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public int getHalfVal(int index) { - return halfVal_.getInt(index); - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder setHalfVal( - int index, int value) { - ensureHalfValIsMutable(); - halfVal_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder addHalfVal(int value) { - ensureHalfValIsMutable(); - halfVal_.addInt(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder addAllHalfVal( - Iterable values) { - ensureHalfValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, halfVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -     * have some pointless zero padding for each value here.
    -     * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - public Builder clearHalfVal() { - halfVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList floatVal_ = emptyFloatList(); - private void ensureFloatValIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - floatVal_ = mutableCopy(floatVal_); - bitField0_ |= 0x00000002; - } - } - - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public java.util.List - getFloatValList() { - return ((bitField0_ & 0x00000002) != 0) ? - java.util.Collections.unmodifiableList(floatVal_) : floatVal_; - } - - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public int getFloatValCount() { - return floatVal_.size(); - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public float getFloatVal(int index) { - return floatVal_.getFloat(index); - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder setFloatVal( - int index, float value) { - ensureFloatValIsMutable(); - floatVal_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder addFloatVal(float value) { - ensureFloatValIsMutable(); - floatVal_.addFloat(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder addAllFloatVal( - Iterable values) { - ensureFloatValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, floatVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_FLOAT.
    -     * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - public Builder clearFloatVal() { - floatVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList doubleVal_ = emptyDoubleList(); - private void ensureDoubleValIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - doubleVal_ = mutableCopy(doubleVal_); - bitField0_ |= 0x00000004; - } - } - - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public java.util.List - getDoubleValList() { - return ((bitField0_ & 0x00000004) != 0) ? - java.util.Collections.unmodifiableList(doubleVal_) : doubleVal_; - } - - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public int getDoubleValCount() { - return doubleVal_.size(); - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public double getDoubleVal(int index) { - return doubleVal_.getDouble(index); - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder setDoubleVal( - int index, double value) { - ensureDoubleValIsMutable(); - doubleVal_.setDouble(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder addDoubleVal(double value) { - ensureDoubleValIsMutable(); - doubleVal_.addDouble(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder addAllDoubleVal( - Iterable values) { - ensureDoubleValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, doubleVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_DOUBLE.
    -     * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - public Builder clearDoubleVal() { - doubleVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList intVal_ = emptyIntList(); - private void ensureIntValIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - intVal_ = mutableCopy(intVal_); - bitField0_ |= 0x00000008; - } - } - - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public java.util.List - getIntValList() { - return ((bitField0_ & 0x00000008) != 0) ? - java.util.Collections.unmodifiableList(intVal_) : intVal_; - } - - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntValCount() { - return intVal_.size(); - } - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public int getIntVal(int index) { - return intVal_.getInt(index); - } - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder setIntVal( - int index, int value) { - ensureIntValIsMutable(); - intVal_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder addIntVal(int value) { - ensureIntValIsMutable(); - intVal_.addInt(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder addAllIntVal( - Iterable values) { - ensureIntValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, intVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -     * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - public Builder clearIntVal() { - intVal_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - private java.util.List stringVal_ = java.util.Collections.emptyList(); - private void ensureStringValIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { - stringVal_ = new java.util.ArrayList(stringVal_); - bitField0_ |= 0x00000010; - } - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public java.util.List - getStringValList() { - return ((bitField0_ & 0x00000010) != 0) ? - java.util.Collections.unmodifiableList(stringVal_) : stringVal_; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public int getStringValCount() { - return stringVal_.size(); - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public com.google.protobuf.ByteString getStringVal(int index) { - return stringVal_.get(index); - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder setStringVal( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringValIsMutable(); - stringVal_.set(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder addStringVal(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureStringValIsMutable(); - stringVal_.add(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder addAllStringVal( - Iterable values) { - ensureStringValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, stringVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_STRING
    -     * 
    - * - * repeated bytes string_val = 8; - */ - public Builder clearStringVal() { - stringVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.FloatList scomplexVal_ = emptyFloatList(); - private void ensureScomplexValIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { - scomplexVal_ = mutableCopy(scomplexVal_); - bitField0_ |= 0x00000020; - } - } - - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public java.util.List - getScomplexValList() { - return ((bitField0_ & 0x00000020) != 0) ? - java.util.Collections.unmodifiableList(scomplexVal_) : scomplexVal_; - } - - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public int getScomplexValCount() { - return scomplexVal_.size(); - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public float getScomplexVal(int index) { - return scomplexVal_.getFloat(index); - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder setScomplexVal( - int index, float value) { - ensureScomplexValIsMutable(); - scomplexVal_.setFloat(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder addScomplexVal(float value) { - ensureScomplexValIsMutable(); - scomplexVal_.addFloat(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder addAllScomplexVal( - Iterable values) { - ensureScomplexValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, scomplexVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th single precision complex.
    -     * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - public Builder clearScomplexVal() { - scomplexVal_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList int64Val_ = emptyLongList(); - private void ensureInt64ValIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { - int64Val_ = mutableCopy(int64Val_); - bitField0_ |= 0x00000040; - } - } - - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public java.util.List - getInt64ValList() { - return ((bitField0_ & 0x00000040) != 0) ? - java.util.Collections.unmodifiableList(int64Val_) : int64Val_; - } - - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public int getInt64ValCount() { - return int64Val_.size(); - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public long getInt64Val(int index) { - return int64Val_.getLong(index); - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder setInt64Val( - int index, long value) { - ensureInt64ValIsMutable(); - int64Val_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder addInt64Val(long value) { - ensureInt64ValIsMutable(); - int64Val_.addLong(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder addAllInt64Val( - Iterable values) { - ensureInt64ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, int64Val_); - onChanged(); - return this; - } - - /** - *
    -     * DT_INT64
    -     * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - public Builder clearInt64Val() { - int64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.BooleanList boolVal_ = emptyBooleanList(); - private void ensureBoolValIsMutable() { - if (!((bitField0_ & 0x00000080) != 0)) { - boolVal_ = mutableCopy(boolVal_); - bitField0_ |= 0x00000080; - } - } - - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public java.util.List - getBoolValList() { - return ((bitField0_ & 0x00000080) != 0) ? - java.util.Collections.unmodifiableList(boolVal_) : boolVal_; - } - - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public int getBoolValCount() { - return boolVal_.size(); - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public boolean getBoolVal(int index) { - return boolVal_.getBoolean(index); - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder setBoolVal( - int index, boolean value) { - ensureBoolValIsMutable(); - boolVal_.setBoolean(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder addBoolVal(boolean value) { - ensureBoolValIsMutable(); - boolVal_.addBoolean(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder addAllBoolVal( - Iterable values) { - ensureBoolValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, boolVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_BOOL
    -     * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - public Builder clearBoolVal() { - boolVal_ = emptyBooleanList(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.DoubleList dcomplexVal_ = emptyDoubleList(); - private void ensureDcomplexValIsMutable() { - if (!((bitField0_ & 0x00000100) != 0)) { - dcomplexVal_ = mutableCopy(dcomplexVal_); - bitField0_ |= 0x00000100; - } - } - - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public java.util.List - getDcomplexValList() { - return ((bitField0_ & 0x00000100) != 0) ? - java.util.Collections.unmodifiableList(dcomplexVal_) : dcomplexVal_; - } - - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public int getDcomplexValCount() { - return dcomplexVal_.size(); - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public double getDcomplexVal(int index) { - return dcomplexVal_.getDouble(index); - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder setDcomplexVal( - int index, double value) { - ensureDcomplexValIsMutable(); - dcomplexVal_.setDouble(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder addDcomplexVal(double value) { - ensureDcomplexValIsMutable(); - dcomplexVal_.addDouble(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder addAllDcomplexVal( - Iterable values) { - ensureDcomplexValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dcomplexVal_); - onChanged(); - return this; - } - - /** - *
    -     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -     * and imaginary parts of i-th double precision complex.
    -     * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - public Builder clearDcomplexVal() { - dcomplexVal_ = emptyDoubleList(); - bitField0_ = (bitField0_ & ~0x00000100); - onChanged(); - return this; - } - - private java.util.List resourceHandleVal_ = - java.util.Collections.emptyList(); - private void ensureResourceHandleValIsMutable() { - if (!((bitField0_ & 0x00000200) != 0)) { - resourceHandleVal_ = new java.util.ArrayList(resourceHandleVal_); - bitField0_ |= 0x00000200; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ResourceHandleProto, ResourceHandleProto.Builder, ResourceHandleProtoOrBuilder> resourceHandleValBuilder_; - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List getResourceHandleValList() { - if (resourceHandleValBuilder_ == null) { - return java.util.Collections.unmodifiableList(resourceHandleVal_); - } else { - return resourceHandleValBuilder_.getMessageList(); - } - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public int getResourceHandleValCount() { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.size(); - } else { - return resourceHandleValBuilder_.getCount(); - } - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProto getResourceHandleVal(int index) { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.get(index); - } else { - return resourceHandleValBuilder_.getMessage(index); - } - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder setResourceHandleVal( - int index, ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.set(index, value); - onChanged(); - } else { - resourceHandleValBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder setResourceHandleVal( - int index, ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.set(index, builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal(ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(value); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - int index, ResourceHandleProto value) { - if (resourceHandleValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(index, value); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addResourceHandleVal( - int index, ResourceHandleProto.Builder builderForValue) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.add(index, builderForValue.build()); - onChanged(); - } else { - resourceHandleValBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder addAllResourceHandleVal( - Iterable values) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, resourceHandleVal_); - onChanged(); - } else { - resourceHandleValBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder clearResourceHandleVal() { - if (resourceHandleValBuilder_ == null) { - resourceHandleVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); - onChanged(); - } else { - resourceHandleValBuilder_.clear(); - } - return this; - } - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public Builder removeResourceHandleVal(int index) { - if (resourceHandleValBuilder_ == null) { - ensureResourceHandleValIsMutable(); - resourceHandleVal_.remove(index); - onChanged(); - } else { - resourceHandleValBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProto.Builder getResourceHandleValBuilder( - int index) { - return getResourceHandleValFieldBuilder().getBuilder(index); - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index) { - if (resourceHandleValBuilder_ == null) { - return resourceHandleVal_.get(index); - } else { - return resourceHandleValBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValOrBuilderList() { - if (resourceHandleValBuilder_ != null) { - return resourceHandleValBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(resourceHandleVal_); - } - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProto.Builder addResourceHandleValBuilder() { - return getResourceHandleValFieldBuilder().addBuilder( - ResourceHandleProto.getDefaultInstance()); - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public ResourceHandleProto.Builder addResourceHandleValBuilder( - int index) { - return getResourceHandleValFieldBuilder().addBuilder( - index, ResourceHandleProto.getDefaultInstance()); - } - - /** - *
    -     * DT_RESOURCE
    -     * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - public java.util.List - getResourceHandleValBuilderList() { - return getResourceHandleValFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ResourceHandleProto, ResourceHandleProto.Builder, ResourceHandleProtoOrBuilder> - getResourceHandleValFieldBuilder() { - if (resourceHandleValBuilder_ == null) { - resourceHandleValBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ResourceHandleProto, ResourceHandleProto.Builder, ResourceHandleProtoOrBuilder>( - resourceHandleVal_, - ((bitField0_ & 0x00000200) != 0), - getParentForChildren(), - isClean()); - resourceHandleVal_ = null; - } - return resourceHandleValBuilder_; - } - - private java.util.List variantVal_ = - java.util.Collections.emptyList(); - private void ensureVariantValIsMutable() { - if (!((bitField0_ & 0x00000400) != 0)) { - variantVal_ = new java.util.ArrayList(variantVal_); - bitField0_ |= 0x00000400; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - VariantTensorDataProto, VariantTensorDataProto.Builder, VariantTensorDataProtoOrBuilder> variantValBuilder_; - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List getVariantValList() { - if (variantValBuilder_ == null) { - return java.util.Collections.unmodifiableList(variantVal_); - } else { - return variantValBuilder_.getMessageList(); - } - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public int getVariantValCount() { - if (variantValBuilder_ == null) { - return variantVal_.size(); - } else { - return variantValBuilder_.getCount(); - } - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProto getVariantVal(int index) { - if (variantValBuilder_ == null) { - return variantVal_.get(index); - } else { - return variantValBuilder_.getMessage(index); - } - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder setVariantVal( - int index, VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.set(index, value); - onChanged(); - } else { - variantValBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder setVariantVal( - int index, VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.set(index, builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal(VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.add(value); - onChanged(); - } else { - variantValBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - int index, VariantTensorDataProto value) { - if (variantValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureVariantValIsMutable(); - variantVal_.add(index, value); - onChanged(); - } else { - variantValBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.add(builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addVariantVal( - int index, VariantTensorDataProto.Builder builderForValue) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.add(index, builderForValue.build()); - onChanged(); - } else { - variantValBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder addAllVariantVal( - Iterable values) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, variantVal_); - onChanged(); - } else { - variantValBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder clearVariantVal() { - if (variantValBuilder_ == null) { - variantVal_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); - onChanged(); - } else { - variantValBuilder_.clear(); - } - return this; - } - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public Builder removeVariantVal(int index) { - if (variantValBuilder_ == null) { - ensureVariantValIsMutable(); - variantVal_.remove(index); - onChanged(); - } else { - variantValBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProto.Builder getVariantValBuilder( - int index) { - return getVariantValFieldBuilder().getBuilder(index); - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index) { - if (variantValBuilder_ == null) { - return variantVal_.get(index); - } else { - return variantValBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValOrBuilderList() { - if (variantValBuilder_ != null) { - return variantValBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(variantVal_); - } - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProto.Builder addVariantValBuilder() { - return getVariantValFieldBuilder().addBuilder( - VariantTensorDataProto.getDefaultInstance()); - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public VariantTensorDataProto.Builder addVariantValBuilder( - int index) { - return getVariantValFieldBuilder().addBuilder( - index, VariantTensorDataProto.getDefaultInstance()); - } - - /** - *
    -     * DT_VARIANT
    -     * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - public java.util.List - getVariantValBuilderList() { - return getVariantValFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - VariantTensorDataProto, VariantTensorDataProto.Builder, VariantTensorDataProtoOrBuilder> - getVariantValFieldBuilder() { - if (variantValBuilder_ == null) { - variantValBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - VariantTensorDataProto, VariantTensorDataProto.Builder, VariantTensorDataProtoOrBuilder>( - variantVal_, - ((bitField0_ & 0x00000400) != 0), - getParentForChildren(), - isClean()); - variantVal_ = null; - } - return variantValBuilder_; - } - - private com.google.protobuf.Internal.IntList uint32Val_ = emptyIntList(); - private void ensureUint32ValIsMutable() { - if (!((bitField0_ & 0x00000800) != 0)) { - uint32Val_ = mutableCopy(uint32Val_); - bitField0_ |= 0x00000800; - } - } - - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public java.util.List - getUint32ValList() { - return ((bitField0_ & 0x00000800) != 0) ? - java.util.Collections.unmodifiableList(uint32Val_) : uint32Val_; - } - - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32ValCount() { - return uint32Val_.size(); - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public int getUint32Val(int index) { - return uint32Val_.getInt(index); - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder setUint32Val( - int index, int value) { - ensureUint32ValIsMutable(); - uint32Val_.setInt(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder addUint32Val(int value) { - ensureUint32ValIsMutable(); - uint32Val_.addInt(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder addAllUint32Val( - Iterable values) { - ensureUint32ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, uint32Val_); - onChanged(); - return this; - } - - /** - *
    -     * DT_UINT32
    -     * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - public Builder clearUint32Val() { - uint32Val_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000800); - onChanged(); - return this; - } - - private com.google.protobuf.Internal.LongList uint64Val_ = emptyLongList(); - private void ensureUint64ValIsMutable() { - if (!((bitField0_ & 0x00001000) != 0)) { - uint64Val_ = mutableCopy(uint64Val_); - bitField0_ |= 0x00001000; - } - } - - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public java.util.List - getUint64ValList() { - return ((bitField0_ & 0x00001000) != 0) ? - java.util.Collections.unmodifiableList(uint64Val_) : uint64Val_; - } - - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public int getUint64ValCount() { - return uint64Val_.size(); - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public long getUint64Val(int index) { - return uint64Val_.getLong(index); - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder setUint64Val( - int index, long value) { - ensureUint64ValIsMutable(); - uint64Val_.setLong(index, value); - onChanged(); - return this; - } - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder addUint64Val(long value) { - ensureUint64ValIsMutable(); - uint64Val_.addLong(value); - onChanged(); - return this; - } - - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder addAllUint64Val( - Iterable values) { - ensureUint64ValIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, uint64Val_); - onChanged(); - return this; - } - - /** - *
    -     * DT_UINT64
    -     * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - public Builder clearUint64Val() { - uint64Val_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00001000); - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.TensorProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorProto) - private static final TensorProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new TensorProto(); - } - - public static TensorProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public TensorProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorProto(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public TensorProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java deleted file mode 100644 index dc040a74683..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtoOrBuilder.java +++ /dev/null @@ -1,459 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public interface TensorProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorProto) - com.google.protobuf.MessageOrBuilder { - - /** - * .tensorflow.DataType dtype = 1; - */ - int getDtypeValue(); - - /** - * .tensorflow.DataType dtype = 1; - */ - DataType getDtype(); - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - boolean hasTensorShape(); - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - TensorShapeProto getTensorShape(); - - /** - *
    -   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    -   * 
    - * - * .tensorflow.TensorShapeProto tensor_shape = 2; - */ - TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); - - /** - *
    -   * Version number.
    -   * In version 0, if the "repeated xxx" representations contain only one
    -   * element, that element is repeated to fill the shape.  This makes it easy
    -   * to represent a constant Tensor with a single value.
    -   * 
    - * - * int32 version_number = 3; - */ - int getVersionNumber(); - - /** - *
    -   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    -   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    -   * can be used for all tensor types. The purpose of this representation is to
    -   * reduce serialization overhead during RPC call by avoiding serialization of
    -   * many repeated small items.
    -   * 
    - * - * bytes tensor_content = 4; - */ - com.google.protobuf.ByteString getTensorContent(); - - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - java.util.List getHalfValList(); - - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - int getHalfValCount(); - /** - *
    -   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    -   * have some pointless zero padding for each value here.
    -   * 
    - * - * repeated int32 half_val = 13 [packed = true]; - */ - int getHalfVal(int index); - - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - java.util.List getFloatValList(); - - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - int getFloatValCount(); - /** - *
    -   * DT_FLOAT.
    -   * 
    - * - * repeated float float_val = 5 [packed = true]; - */ - float getFloatVal(int index); - - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - java.util.List getDoubleValList(); - - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - int getDoubleValCount(); - /** - *
    -   * DT_DOUBLE.
    -   * 
    - * - * repeated double double_val = 6 [packed = true]; - */ - double getDoubleVal(int index); - - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - java.util.List getIntValList(); - - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - int getIntValCount(); - /** - *
    -   * DT_INT32, DT_INT16, DT_INT8, DT_UINT8.
    -   * 
    - * - * repeated int32 int_val = 7 [packed = true]; - */ - int getIntVal(int index); - - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - java.util.List getStringValList(); - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - int getStringValCount(); - /** - *
    -   * DT_STRING
    -   * 
    - * - * repeated bytes string_val = 8; - */ - com.google.protobuf.ByteString getStringVal(int index); - - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - java.util.List getScomplexValList(); - - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - int getScomplexValCount(); - /** - *
    -   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th single precision complex.
    -   * 
    - * - * repeated float scomplex_val = 9 [packed = true]; - */ - float getScomplexVal(int index); - - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - java.util.List getInt64ValList(); - - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - int getInt64ValCount(); - /** - *
    -   * DT_INT64
    -   * 
    - * - * repeated int64 int64_val = 10 [packed = true]; - */ - long getInt64Val(int index); - - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - java.util.List getBoolValList(); - - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - int getBoolValCount(); - /** - *
    -   * DT_BOOL
    -   * 
    - * - * repeated bool bool_val = 11 [packed = true]; - */ - boolean getBoolVal(int index); - - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - java.util.List getDcomplexValList(); - - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - int getDcomplexValCount(); - /** - *
    -   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    -   * and imaginary parts of i-th double precision complex.
    -   * 
    - * - * repeated double dcomplex_val = 12 [packed = true]; - */ - double getDcomplexVal(int index); - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - java.util.List - getResourceHandleValList(); - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - ResourceHandleProto getResourceHandleVal(int index); - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - int getResourceHandleValCount(); - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - java.util.List - getResourceHandleValOrBuilderList(); - - /** - *
    -   * DT_RESOURCE
    -   * 
    - * - * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; - */ - ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( - int index); - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - java.util.List - getVariantValList(); - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - VariantTensorDataProto getVariantVal(int index); - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - int getVariantValCount(); - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - java.util.List - getVariantValOrBuilderList(); - - /** - *
    -   * DT_VARIANT
    -   * 
    - * - * repeated .tensorflow.VariantTensorDataProto variant_val = 15; - */ - VariantTensorDataProtoOrBuilder getVariantValOrBuilder( - int index); - - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - java.util.List getUint32ValList(); - - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - int getUint32ValCount(); - /** - *
    -   * DT_UINT32
    -   * 
    - * - * repeated uint32 uint32_val = 16 [packed = true]; - */ - int getUint32Val(int index); - - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - java.util.List getUint64ValList(); - - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - int getUint64ValCount(); - /** - *
    -   * DT_UINT64
    -   * 
    - * - * repeated uint64 uint64_val = 17 [packed = true]; - */ - long getUint64Val(int index); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtos.java deleted file mode 100644 index 1cca6fdc8c2..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorProtos.java +++ /dev/null @@ -1,88 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public final class TensorProtos { - private TensorProtos() {} - 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_TensorProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_VariantTensorDataProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n&tensorflow/core/framework/tensor.proto" + - "\022\ntensorflow\032/tensorflow/core/framework/" + - "resource_handle.proto\032,tensorflow/core/f" + - "ramework/tensor_shape.proto\032%tensorflow/" + - "core/framework/types.proto\"\214\004\n\013TensorPro" + - "to\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.DataType\022" + - "2\n\014tensor_shape\030\002 \001(\0132\034.tensorflow.Tenso" + - "rShapeProto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016t" + - "ensor_content\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020" + - "\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006" + - " \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_" + - "val\030\010 \003(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\ti" + - "nt64_val\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001" + - "\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001\022<\n\023resource_h" + - "andle_val\030\016 \003(\0132\037.tensorflow.ResourceHan" + - "dleProto\0227\n\013variant_val\030\017 \003(\0132\".tensorfl" + - "ow.VariantTensorDataProto\022\026\n\nuint32_val\030" + - "\020 \003(\rB\002\020\001\022\026\n\nuint64_val\030\021 \003(\004B\002\020\001\"g\n\026Var" + - "iantTensorDataProto\022\021\n\ttype_name\030\001 \001(\t\022\020" + - "\n\010metadata\030\002 \001(\014\022(\n\007tensors\030\003 \003(\0132\027.tens" + - "orflow.TensorProtoB\202\001\n\036org.tensorflow.pr" + - "oto.frameworkB\014TensorProtosP\001ZMgithub.co" + - "m/tensorflow/tensorflow/tensorflow/go/co" + - "re/framework/tensor_go_proto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - ResourceHandle.getDescriptor(), - TensorShapeProtos.getDescriptor(), - TypesProtos.getDescriptor(), - }); - internal_static_tensorflow_TensorProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorProto_descriptor, - new String[]{"Dtype", "TensorShape", "VersionNumber", "TensorContent", "HalfVal", "FloatVal", "DoubleVal", - "IntVal", "StringVal", "ScomplexVal", "Int64Val", "BoolVal", "DcomplexVal", "ResourceHandleVal", - "VariantVal", "Uint32Val", "Uint64Val",}); - internal_static_tensorflow_VariantTensorDataProto_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_VariantTensorDataProto_descriptor, - new String[]{"TypeName", "Metadata", "Tensors",}); - ResourceHandle.getDescriptor(); - TensorShapeProtos.getDescriptor(); - TypesProtos.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProto.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProto.java deleted file mode 100644 index 1d8e33c85e8..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProto.java +++ /dev/null @@ -1,1937 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Dimensions of a tensor.
    - * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto} - */ -public final class TensorShapeProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto) - TensorShapeProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use TensorShapeProto.newBuilder() to construct. - private TensorShapeProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TensorShapeProto() { - dim_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new TensorShapeProto(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TensorShapeProto( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - dim_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - dim_.add( - input.readMessage(Dim.parser(), extensionRegistry)); - break; - } - case 24: { - - unknownRank_ = input.readBool(); - 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)) { - dim_ = java.util.Collections.unmodifiableList(dim_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - TensorShapeProto.class, Builder.class); - } - - public interface DimOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto.Dim) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -     * Size of the tensor in that dimension.
    -     * This value must be >= -1, but values of -1 are reserved for "unknown"
    -     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -     * that work with TensorShapeProto may fail at runtime when deserializing
    -     * a TensorShapeProto containing a dim value of -1.
    -     * 
    - * - * int64 size = 1; - */ - long getSize(); - - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - String getName(); - - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - *
    -   * One dimension of the tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto.Dim} - */ - public static final class Dim extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto.Dim) - DimOrBuilder { - private static final long serialVersionUID = 0L; - // Use Dim.newBuilder() to construct. - private Dim(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Dim() { - name_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new Dim(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Dim( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - - size_ = input.readInt64(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - name_ = s; - 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 TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Dim.class, Builder.class); - } - - public static final int SIZE_FIELD_NUMBER = 1; - private long size_; - - /** - *
    -     * Size of the tensor in that dimension.
    -     * This value must be >= -1, but values of -1 are reserved for "unknown"
    -     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -     * that work with TensorShapeProto may fail at runtime when deserializing
    -     * a TensorShapeProto containing a dim value of -1.
    -     * 
    - * - * int64 size = 1; - */ - public long getSize() { - return size_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile Object name_; - - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
    -     * Optional name of the tensor dimension.
    -     * 
    - * - * string name = 2; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (size_ != 0L) { - output.writeInt64(1, size_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (size_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, size_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof Dim)) { - return super.equals(obj); - } - Dim other = (Dim) obj; - - if (getSize() - != other.getSize()) { - return false; - } - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSize()); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static Dim parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Dim parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Dim parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Dim parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Dim parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Dim parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Dim parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Dim 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 Dim parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static Dim 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 Dim parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Dim parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Dim prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -     * One dimension of the tensor.
    -     * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto.Dim} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto.Dim) - DimOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Dim.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorShapeProto.Dim.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - size_ = 0L; - - name_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - } - - @Override - public Dim getDefaultInstanceForType() { - return Dim.getDefaultInstance(); - } - - @Override - public Dim build() { - Dim result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Dim buildPartial() { - Dim result = new Dim(this); - result.size_ = size_; - result.name_ = name_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Dim) { - return mergeFrom((Dim) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(Dim other) { - if (other == Dim.getDefaultInstance()) { - return this; - } - if (other.getSize() != 0L) { - setSize(other.getSize()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Dim parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Dim) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long size_ ; - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public long getSize() { - return size_; - } - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public Builder setSize(long value) { - - size_ = value; - onChanged(); - return this; - } - /** - *
    -       * Size of the tensor in that dimension.
    -       * This value must be >= -1, but values of -1 are reserved for "unknown"
    -       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    -       * that work with TensorShapeProto may fail at runtime when deserializing
    -       * a TensorShapeProto containing a dim value of -1.
    -       * 
    - * - * int64 size = 1; - */ - public Builder clearSize() { - - size_ = 0L; - onChanged(); - return this; - } - - private Object name_ = ""; - - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
    -       * Optional name of the tensor dimension.
    -       * 
    - * - * string name = 2; - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.TensorShapeProto.Dim) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto.Dim) - private static final Dim DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new Dim(); - } - - public static Dim getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public Dim parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Dim(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public Dim getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int DIM_FIELD_NUMBER = 2; - private java.util.List dim_; - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List getDimList() { - return dim_; - } - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimOrBuilderList() { - return dim_; - } - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public int getDimCount() { - return dim_.size(); - } - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Dim getDim(int index) { - return dim_.get(index); - } - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public DimOrBuilder getDimOrBuilder( - int index) { - return dim_.get(index); - } - - public static final int UNKNOWN_RANK_FIELD_NUMBER = 3; - private boolean unknownRank_; - /** - *
    -   * If true, the number of dimensions in the shape is unknown.
    -   * If true, "dim.size()" must be 0.
    -   * 
    - * - * bool unknown_rank = 3; - */ - public boolean getUnknownRank() { - return unknownRank_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < dim_.size(); i++) { - output.writeMessage(2, dim_.get(i)); - } - if (unknownRank_ != false) { - output.writeBool(3, unknownRank_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < dim_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, dim_.get(i)); - } - if (unknownRank_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, unknownRank_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof TensorShapeProto)) { - return super.equals(obj); - } - TensorShapeProto other = (TensorShapeProto) obj; - - if (!getDimList() - .equals(other.getDimList())) { - return false; - } - if (getUnknownRank() - != other.getUnknownRank()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDimCount() > 0) { - hash = (37 * hash) + DIM_FIELD_NUMBER; - hash = (53 * hash) + getDimList().hashCode(); - } - hash = (37 * hash) + UNKNOWN_RANK_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUnknownRank()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static TensorShapeProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorShapeProto parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorShapeProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorShapeProto parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorShapeProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static TensorShapeProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static TensorShapeProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static TensorShapeProto 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 TensorShapeProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static TensorShapeProto 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 TensorShapeProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static TensorShapeProto parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(TensorShapeProto prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Dimensions of a tensor.
    -   * 
    - * - * Protobuf type {@code tensorflow.TensorShapeProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto) - TensorShapeProtoOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - TensorShapeProto.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.TensorShapeProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDimFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - if (dimBuilder_ == null) { - dim_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - dimBuilder_.clear(); - } - unknownRank_ = false; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; - } - - @Override - public TensorShapeProto getDefaultInstanceForType() { - return TensorShapeProto.getDefaultInstance(); - } - - @Override - public TensorShapeProto build() { - TensorShapeProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public TensorShapeProto buildPartial() { - TensorShapeProto result = new TensorShapeProto(this); - int from_bitField0_ = bitField0_; - if (dimBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - dim_ = java.util.Collections.unmodifiableList(dim_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.dim_ = dim_; - } else { - result.dim_ = dimBuilder_.build(); - } - result.unknownRank_ = unknownRank_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof TensorShapeProto) { - return mergeFrom((TensorShapeProto) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(TensorShapeProto other) { - if (other == TensorShapeProto.getDefaultInstance()) { - return this; - } - if (dimBuilder_ == null) { - if (!other.dim_.isEmpty()) { - if (dim_.isEmpty()) { - dim_ = other.dim_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDimIsMutable(); - dim_.addAll(other.dim_); - } - onChanged(); - } - } else { - if (!other.dim_.isEmpty()) { - if (dimBuilder_.isEmpty()) { - dimBuilder_.dispose(); - dimBuilder_ = null; - dim_ = other.dim_; - bitField0_ = (bitField0_ & ~0x00000001); - dimBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDimFieldBuilder() : null; - } else { - dimBuilder_.addAllMessages(other.dim_); - } - } - } - if (other.getUnknownRank() != false) { - setUnknownRank(other.getUnknownRank()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - TensorShapeProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (TensorShapeProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List dim_ = - java.util.Collections.emptyList(); - private void ensureDimIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - dim_ = new java.util.ArrayList(dim_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Dim, Dim.Builder, DimOrBuilder> dimBuilder_; - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List getDimList() { - if (dimBuilder_ == null) { - return java.util.Collections.unmodifiableList(dim_); - } else { - return dimBuilder_.getMessageList(); - } - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public int getDimCount() { - if (dimBuilder_ == null) { - return dim_.size(); - } else { - return dimBuilder_.getCount(); - } - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Dim getDim(int index) { - if (dimBuilder_ == null) { - return dim_.get(index); - } else { - return dimBuilder_.getMessage(index); - } - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder setDim( - int index, Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.set(index, value); - onChanged(); - } else { - dimBuilder_.setMessage(index, value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder setDim( - int index, Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.set(index, builderForValue.build()); - onChanged(); - } else { - dimBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim(Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.add(value); - onChanged(); - } else { - dimBuilder_.addMessage(value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - int index, Dim value) { - if (dimBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDimIsMutable(); - dim_.add(index, value); - onChanged(); - } else { - dimBuilder_.addMessage(index, value); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.add(builderForValue.build()); - onChanged(); - } else { - dimBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addDim( - int index, Dim.Builder builderForValue) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.add(index, builderForValue.build()); - onChanged(); - } else { - dimBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder addAllDim( - Iterable values) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dim_); - onChanged(); - } else { - dimBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder clearDim() { - if (dimBuilder_ == null) { - dim_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - dimBuilder_.clear(); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Builder removeDim(int index) { - if (dimBuilder_ == null) { - ensureDimIsMutable(); - dim_.remove(index); - onChanged(); - } else { - dimBuilder_.remove(index); - } - return this; - } - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Dim.Builder getDimBuilder( - int index) { - return getDimFieldBuilder().getBuilder(index); - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public DimOrBuilder getDimOrBuilder( - int index) { - if (dimBuilder_ == null) { - return dim_.get(index); - } else { - return dimBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimOrBuilderList() { - if (dimBuilder_ != null) { - return dimBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(dim_); - } - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Dim.Builder addDimBuilder() { - return getDimFieldBuilder().addBuilder( - Dim.getDefaultInstance()); - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public Dim.Builder addDimBuilder( - int index) { - return getDimFieldBuilder().addBuilder( - index, Dim.getDefaultInstance()); - } - - /** - *
    -     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -     * corresponds to a dimension of unknown size. The names are
    -     * optional.
    -     * The order of entries in "dim" matters: It indicates the layout of the
    -     * values in the tensor in-memory representation.
    -     * The first entry in "dim" is the outermost dimension used to layout the
    -     * values, the last entry is the innermost dimension.  This matches the
    -     * in-memory layout of RowMajor Eigen tensors.
    -     * If "dim.size()" > 0, "unknown_rank" must be false.
    -     * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - public java.util.List - getDimBuilderList() { - return getDimFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Dim, Dim.Builder, DimOrBuilder> - getDimFieldBuilder() { - if (dimBuilder_ == null) { - dimBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Dim, Dim.Builder, DimOrBuilder>( - dim_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - dim_ = null; - } - return dimBuilder_; - } - - private boolean unknownRank_ ; - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public boolean getUnknownRank() { - return unknownRank_; - } - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public Builder setUnknownRank(boolean value) { - - unknownRank_ = value; - onChanged(); - return this; - } - /** - *
    -     * If true, the number of dimensions in the shape is unknown.
    -     * If true, "dim.size()" must be 0.
    -     * 
    - * - * bool unknown_rank = 3; - */ - public Builder clearUnknownRank() { - - unknownRank_ = false; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.TensorShapeProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto) - private static final TensorShapeProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new TensorShapeProto(); - } - - public static TensorShapeProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public TensorShapeProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TensorShapeProto(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public TensorShapeProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java deleted file mode 100644 index 821c5e65d39..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtoOrBuilder.java +++ /dev/null @@ -1,109 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -public interface TensorShapeProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - java.util.List - getDimList(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - TensorShapeProto.Dim getDim(int index); - - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - int getDimCount(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - java.util.List - getDimOrBuilderList(); - /** - *
    -   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    -   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    -   * corresponds to a dimension of unknown size. The names are
    -   * optional.
    -   * The order of entries in "dim" matters: It indicates the layout of the
    -   * values in the tensor in-memory representation.
    -   * The first entry in "dim" is the outermost dimension used to layout the
    -   * values, the last entry is the innermost dimension.  This matches the
    -   * in-memory layout of RowMajor Eigen tensors.
    -   * If "dim.size()" > 0, "unknown_rank" must be false.
    -   * 
    - * - * repeated .tensorflow.TensorShapeProto.Dim dim = 2; - */ - TensorShapeProto.DimOrBuilder getDimOrBuilder( - int index); - - /** - *
    -   * If true, the number of dimensions in the shape is unknown.
    -   * If true, "dim.size()" must be 0.
    -   * 
    - * - * bool unknown_rank = 3; - */ - boolean getUnknownRank(); -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtos.java deleted file mode 100644 index 9ab282b0d36..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TensorShapeProtos.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor_shape.proto - -package org.tensorflow.proto.framework; - -public final class TensorShapeProtos { - private TensorShapeProtos() {} - 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_TensorShapeProto_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorShapeProto_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_tensorflow_TensorShapeProto_Dim_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n,tensorflow/core/framework/tensor_shape" + - ".proto\022\ntensorflow\"z\n\020TensorShapeProto\022-" + - "\n\003dim\030\002 \003(\0132 .tensorflow.TensorShapeProt" + - "o.Dim\022\024\n\014unknown_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004si" + - "ze\030\001 \001(\003\022\014\n\004name\030\002 \001(\tB\215\001\n\036org.tensorflo" + - "w.proto.frameworkB\021TensorShapeProtosP\001ZS" + - "github.com/tensorflow/tensorflow/tensorf" + - "low/go/core/framework/tensor_shape_go_pr" + - "oto\370\001\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_tensorflow_TensorShapeProto_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_tensorflow_TensorShapeProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorShapeProto_descriptor, - new String[]{"Dim", "UnknownRank",}); - internal_static_tensorflow_TensorShapeProto_Dim_descriptor = - internal_static_tensorflow_TensorShapeProto_descriptor.getNestedTypes().get(0); - internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_tensorflow_TensorShapeProto_Dim_descriptor, - new String[]{"Size", "Name",}); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TypesProtos.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TypesProtos.java deleted file mode 100644 index ce695f3a289..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/TypesProtos.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/types.proto - -package org.tensorflow.proto.framework; - -public final class TypesProtos { - private TypesProtos() {} - 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 static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - String[] descriptorData = { - "\n%tensorflow/core/framework/types.proto\022" + - "\ntensorflow*\252\006\n\010DataType\022\016\n\nDT_INVALID\020\000" + - "\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT_DOUBLE\020\002\022\014\n\010DT_INT3" + - "2\020\003\022\014\n\010DT_UINT8\020\004\022\014\n\010DT_INT16\020\005\022\013\n\007DT_IN" + - "T8\020\006\022\r\n\tDT_STRING\020\007\022\020\n\014DT_COMPLEX64\020\010\022\014\n" + - "\010DT_INT64\020\t\022\013\n\007DT_BOOL\020\n\022\014\n\010DT_QINT8\020\013\022\r" + - "\n\tDT_QUINT8\020\014\022\r\n\tDT_QINT32\020\r\022\017\n\013DT_BFLOA" + - "T16\020\016\022\r\n\tDT_QINT16\020\017\022\016\n\nDT_QUINT16\020\020\022\r\n\t" + - "DT_UINT16\020\021\022\021\n\rDT_COMPLEX128\020\022\022\013\n\007DT_HAL" + - "F\020\023\022\017\n\013DT_RESOURCE\020\024\022\016\n\nDT_VARIANT\020\025\022\r\n\t" + - "DT_UINT32\020\026\022\r\n\tDT_UINT64\020\027\022\020\n\014DT_FLOAT_R" + - "EF\020e\022\021\n\rDT_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020" + - "g\022\020\n\014DT_UINT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n" + - "\013DT_INT8_REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_" + - "COMPLEX64_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_" + - "BOOL_REF\020n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT" + - "8_REF\020p\022\021\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT1" + - "6_REF\020r\022\021\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16" + - "_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{*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, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProto.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProto.java deleted file mode 100644 index eb288982f6e..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProto.java +++ /dev/null @@ -1,1156 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -/** - *
    - * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    - * 
    - * - * Protobuf type {@code tensorflow.VariantTensorDataProto} - */ -public final class VariantTensorDataProto extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:tensorflow.VariantTensorDataProto) - VariantTensorDataProtoOrBuilder { -private static final long serialVersionUID = 0L; - // Use VariantTensorDataProto.newBuilder() to construct. - private VariantTensorDataProto(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VariantTensorDataProto() { - typeName_ = ""; - metadata_ = com.google.protobuf.ByteString.EMPTY; - tensors_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new VariantTensorDataProto(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VariantTensorDataProto( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new 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: { - String s = input.readStringRequireUtf8(); - - typeName_ = s; - break; - } - case 18: { - - metadata_ = input.readBytes(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tensors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tensors_.add( - input.readMessage(TensorProto.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_ & 0x00000001) != 0)) { - tensors_ = java.util.Collections.unmodifiableList(tensors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - VariantTensorDataProto.class, Builder.class); - } - - public static final int TYPE_NAME_FIELD_NUMBER = 1; - private volatile Object typeName_; - - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - public String getTypeName() { - Object ref = typeName_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeName_ = s; - return s; - } - } - - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - Object ref = typeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METADATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString metadata_; - /** - *
    -   * Portions of the object that are not Tensors.
    -   * 
    - * - * bytes metadata = 2; - */ - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - - public static final int TENSORS_FIELD_NUMBER = 3; - private java.util.List tensors_; - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List getTensorsList() { - return tensors_; - } - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsOrBuilderList() { - return tensors_; - } - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public int getTensorsCount() { - return tensors_.size(); - } - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProto getTensors(int index) { - return tensors_.get(index); - } - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProtoOrBuilder getTensorsOrBuilder( - int index) { - return tensors_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getTypeNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, typeName_); - } - if (!metadata_.isEmpty()) { - output.writeBytes(2, metadata_); - } - for (int i = 0; i < tensors_.size(); i++) { - output.writeMessage(3, tensors_.get(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getTypeNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, typeName_); - } - if (!metadata_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, metadata_); - } - for (int i = 0; i < tensors_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, tensors_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof VariantTensorDataProto)) { - return super.equals(obj); - } - VariantTensorDataProto other = (VariantTensorDataProto) obj; - - if (!getTypeName() - .equals(other.getTypeName())) { - return false; - } - if (!getMetadata() - .equals(other.getMetadata())) return false; - if (!getTensorsList() - .equals(other.getTensorsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getTypeName().hashCode(); - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - if (getTensorsCount() > 0) { - hash = (37 * hash) + TENSORS_FIELD_NUMBER; - hash = (53 * hash) + getTensorsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static VariantTensorDataProto parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static VariantTensorDataProto parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static VariantTensorDataProto parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static VariantTensorDataProto parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static VariantTensorDataProto parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static VariantTensorDataProto parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static VariantTensorDataProto parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static VariantTensorDataProto 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 VariantTensorDataProto parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static VariantTensorDataProto 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 VariantTensorDataProto parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static VariantTensorDataProto parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { return newBuilder(); } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(VariantTensorDataProto prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - *
    -   * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    -   * 
    - * - * Protobuf type {@code tensorflow.VariantTensorDataProto} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:tensorflow.VariantTensorDataProto) - VariantTensorDataProtoOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable - .ensureFieldAccessorsInitialized( - VariantTensorDataProto.class, Builder.class); - } - - // Construct using org.tensorflow.proto.framework.VariantTensorDataProto.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTensorsFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - typeName_ = ""; - - metadata_ = com.google.protobuf.ByteString.EMPTY; - - if (tensorsBuilder_ == null) { - tensors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - tensorsBuilder_.clear(); - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; - } - - @Override - public VariantTensorDataProto getDefaultInstanceForType() { - return VariantTensorDataProto.getDefaultInstance(); - } - - @Override - public VariantTensorDataProto build() { - VariantTensorDataProto result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public VariantTensorDataProto buildPartial() { - VariantTensorDataProto result = new VariantTensorDataProto(this); - int from_bitField0_ = bitField0_; - result.typeName_ = typeName_; - result.metadata_ = metadata_; - if (tensorsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - tensors_ = java.util.Collections.unmodifiableList(tensors_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tensors_ = tensors_; - } else { - result.tensors_ = tensorsBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof VariantTensorDataProto) { - return mergeFrom((VariantTensorDataProto) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(VariantTensorDataProto other) { - if (other == VariantTensorDataProto.getDefaultInstance()) { - return this; - } - if (!other.getTypeName().isEmpty()) { - typeName_ = other.typeName_; - onChanged(); - } - if (other.getMetadata() != com.google.protobuf.ByteString.EMPTY) { - setMetadata(other.getMetadata()); - } - if (tensorsBuilder_ == null) { - if (!other.tensors_.isEmpty()) { - if (tensors_.isEmpty()) { - tensors_ = other.tensors_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTensorsIsMutable(); - tensors_.addAll(other.tensors_); - } - onChanged(); - } - } else { - if (!other.tensors_.isEmpty()) { - if (tensorsBuilder_.isEmpty()) { - tensorsBuilder_.dispose(); - tensorsBuilder_ = null; - tensors_ = other.tensors_; - bitField0_ = (bitField0_ & ~0x00000001); - tensorsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTensorsFieldBuilder() : null; - } else { - tensorsBuilder_.addAllMessages(other.tensors_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - VariantTensorDataProto parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (VariantTensorDataProto) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private Object typeName_ = ""; - - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public String getTypeName() { - Object ref = typeName_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - typeName_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public com.google.protobuf.ByteString - getTypeNameBytes() { - Object ref = typeName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - typeName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder setTypeName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - typeName_ = value; - onChanged(); - return this; - } - - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder clearTypeName() { - - typeName_ = getDefaultInstance().getTypeName(); - onChanged(); - return this; - } - /** - *
    -     * Name of the type of objects being serialized.
    -     * 
    - * - * string type_name = 1; - */ - public Builder setTypeNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - typeName_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public Builder setMetadata(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - metadata_ = value; - onChanged(); - return this; - } - /** - *
    -     * Portions of the object that are not Tensors.
    -     * 
    - * - * bytes metadata = 2; - */ - public Builder clearMetadata() { - - metadata_ = getDefaultInstance().getMetadata(); - onChanged(); - return this; - } - - private java.util.List tensors_ = - java.util.Collections.emptyList(); - private void ensureTensorsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tensors_ = new java.util.ArrayList(tensors_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> tensorsBuilder_; - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List getTensorsList() { - if (tensorsBuilder_ == null) { - return java.util.Collections.unmodifiableList(tensors_); - } else { - return tensorsBuilder_.getMessageList(); - } - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public int getTensorsCount() { - if (tensorsBuilder_ == null) { - return tensors_.size(); - } else { - return tensorsBuilder_.getCount(); - } - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProto getTensors(int index) { - if (tensorsBuilder_ == null) { - return tensors_.get(index); - } else { - return tensorsBuilder_.getMessage(index); - } - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder setTensors( - int index, TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.set(index, value); - onChanged(); - } else { - tensorsBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder setTensors( - int index, TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.set(index, builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors(TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.add(value); - onChanged(); - } else { - tensorsBuilder_.addMessage(value); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - int index, TensorProto value) { - if (tensorsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTensorsIsMutable(); - tensors_.add(index, value); - onChanged(); - } else { - tensorsBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.add(builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addTensors( - int index, TensorProto.Builder builderForValue) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.add(index, builderForValue.build()); - onChanged(); - } else { - tensorsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder addAllTensors( - Iterable values) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tensors_); - onChanged(); - } else { - tensorsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder clearTensors() { - if (tensorsBuilder_ == null) { - tensors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - tensorsBuilder_.clear(); - } - return this; - } - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public Builder removeTensors(int index) { - if (tensorsBuilder_ == null) { - ensureTensorsIsMutable(); - tensors_.remove(index); - onChanged(); - } else { - tensorsBuilder_.remove(index); - } - return this; - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProto.Builder getTensorsBuilder( - int index) { - return getTensorsFieldBuilder().getBuilder(index); - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProtoOrBuilder getTensorsOrBuilder( - int index) { - if (tensorsBuilder_ == null) { - return tensors_.get(index); - } else { - return tensorsBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsOrBuilderList() { - if (tensorsBuilder_ != null) { - return tensorsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tensors_); - } - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProto.Builder addTensorsBuilder() { - return getTensorsFieldBuilder().addBuilder( - TensorProto.getDefaultInstance()); - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public TensorProto.Builder addTensorsBuilder( - int index) { - return getTensorsFieldBuilder().addBuilder( - index, TensorProto.getDefaultInstance()); - } - - /** - *
    -     * Tensors contained within objects being serialized.
    -     * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - public java.util.List - getTensorsBuilderList() { - return getTensorsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder> - getTensorsFieldBuilder() { - if (tensorsBuilder_ == null) { - tensorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - TensorProto, TensorProto.Builder, TensorProtoOrBuilder>( - tensors_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tensors_ = null; - } - return tensorsBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:tensorflow.VariantTensorDataProto) - } - - // @@protoc_insertion_point(class_scope:tensorflow.VariantTensorDataProto) - private static final VariantTensorDataProto DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new VariantTensorDataProto(); - } - - public static VariantTensorDataProto getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public VariantTensorDataProto parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VariantTensorDataProto(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public VariantTensorDataProto getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java deleted file mode 100644 index 963212721e9..00000000000 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/proto/framework/VariantTensorDataProtoOrBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/framework/tensor.proto - -package org.tensorflow.proto.framework; - -public interface VariantTensorDataProtoOrBuilder extends - // @@protoc_insertion_point(interface_extends:tensorflow.VariantTensorDataProto) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - String getTypeName(); - - /** - *
    -   * Name of the type of objects being serialized.
    -   * 
    - * - * string type_name = 1; - */ - com.google.protobuf.ByteString - getTypeNameBytes(); - - /** - *
    -   * Portions of the object that are not Tensors.
    -   * 
    - * - * bytes metadata = 2; - */ - com.google.protobuf.ByteString getMetadata(); - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - java.util.List - getTensorsList(); - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - TensorProto getTensors(int index); - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - int getTensorsCount(); - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - java.util.List - getTensorsOrBuilderList(); - - /** - *
    -   * Tensors contained within objects being serialized.
    -   * 
    - * - * repeated .tensorflow.TensorProto tensors = 3; - */ - TensorProtoOrBuilder getTensorsOrBuilder( - int index); -} diff --git a/tensorflow-core/tensorflow-core-native/.bazelrc b/tensorflow-core/tensorflow-core-native/.bazelrc new file mode 100644 index 00000000000..7437d982e91 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/.bazelrc @@ -0,0 +1,5 @@ +build --experimental_ui_max_stdouterr_bytes=-1 + +# We don't need this cache, since we are not building TF from GitHub Actions anymore. Just keeping this here for reference +# build --remote_cache=https://storage.googleapis.com/tensorflow-sigs-jvm +# build --remote_upload_local_results=false diff --git a/tensorflow-core/tensorflow-core-native/.bazelversion b/tensorflow-core/tensorflow-core-native/.bazelversion new file mode 100644 index 00000000000..5c733d6c13a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/.bazelversion @@ -0,0 +1,2 @@ +7.4.1 +# NOTE: Update Bazel version in tensorflow/tools/ci_build/release/common.sh.oss \ No newline at end of file diff --git a/tensorflow-core/tensorflow-core-native/BUILD b/tensorflow-core/tensorflow-core-native/BUILD new file mode 100644 index 00000000000..f480e638867 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/BUILD @@ -0,0 +1,9 @@ +load("@rules_java//java:defs.bzl", "java_proto_library") + +java_proto_library( + name = "java_proto_gen_sources", + deps = [ + "@org_tensorflow//tensorflow/core:protos_all", + "@local_xla//xla/tsl/protobuf:protos_all" + ] +) diff --git a/tensorflow-core/tensorflow-core-native/WORKSPACE b/tensorflow-core/tensorflow-core-native/WORKSPACE new file mode 100644 index 00000000000..a0f6b30323e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/WORKSPACE @@ -0,0 +1,202 @@ +workspace(name = "tensorflow_java") + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# TensorFlow archive +# Note: Make sure to synchronize Maven dependencies inherited from TensorFlow binaries when updating +# the version of this archive (e.g. google protobuf) +http_archive( + name = "org_tensorflow", + patches = [ + ":tensorflow-visibility.patch", + ":tensorflow-proto.patch", + ], + patch_tool = "patch", + patch_args = ["-p1"], + patch_cmds = [ + "find tensorflow third_party/xla/third_party/tsl third_party/xla/xla/tsl -name \\*.proto | xargs sed -i.bak '/^option java_package/d'", + "find tensorflow third_party/xla/third_party/tsl third_party/xla/xla/tsl -name \\*.proto | xargs sed -i.bak 's/^package tensorflow\\([^;]*\\).*$/package tensorflow\\1;\\noption java_package = \"org.tensorflow.proto\\1\";/'", + ], + urls = [ + "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.20.0.tar.gz", + ], + sha256 = "a640d1f97be316a09301dfc9347e3d929ad4d9a2336e3ca23c32c93b0ff7e5d0", + strip_prefix = "tensorflow-2.20.0" +) + +##### Copy content of tensorflow/WORKSPACE here (make sure to change references of default package "//" to "@org_tensorflow//") + +# buildifier: disable=load-on-top + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "rules_shell", + sha256 = "bc61ef94facc78e20a645726f64756e5e285a045037c7a61f65af2941f4c25e1", + strip_prefix = "rules_shell-0.4.1", + url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.4.1/rules_shell-v0.4.1.tar.gz", +) + +# Initialize the TensorFlow repository and all dependencies. +# +# The cascade of load() statements and tf_workspace?() calls works around the +# restriction that load() statements need to be at the top of .bzl files. +# E.g. we can not retrieve a new repository with http_archive and then load() +# a macro from that repository in the same file. +load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3") + +tf_workspace3() + +load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") + +rules_shell_dependencies() + +rules_shell_toolchains() + +# Initialize hermetic Python +load("@local_xla//third_party/py:python_init_rules.bzl", "python_init_rules") + +python_init_rules() + +load("@local_xla//third_party/py:python_init_repositories.bzl", "python_init_repositories") + +python_init_repositories( + default_python_version = "system", + local_wheel_dist_folder = "dist", + local_wheel_inclusion_list = [ + "tensorflow*", + "tf_nightly*", + ], + local_wheel_workspaces = ["@org_tensorflow//:WORKSPACE"], + requirements = { + "3.9": "@org_tensorflow//:requirements_lock_3_9.txt", + "3.10": "@org_tensorflow//:requirements_lock_3_10.txt", + "3.11": "@org_tensorflow//:requirements_lock_3_11.txt", + "3.12": "@org_tensorflow//:requirements_lock_3_12.txt", + "3.13": "@org_tensorflow//:requirements_lock_3_13.txt", + }, +) + +load("@local_xla//third_party/py:python_init_toolchains.bzl", "python_init_toolchains") + +python_init_toolchains() + +load("@local_xla//third_party/py:python_init_pip.bzl", "python_init_pip") + +python_init_pip() + +load("@pypi//:requirements.bzl", "install_deps") + +install_deps() +# End hermetic Python initialization + +load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2") + +tf_workspace2() + +# Added to fix macOS compiler support on Tahoe? +#http_archive( +# name = "build_bazel_apple_support", +# sha256 = "1ae6fcf983cff3edab717636f91ad0efff2e5ba75607fdddddfd6ad0dbdfaf10", +# urls = ["https://github.com/bazelbuild/apple_support/releases/download/1.24.5/apple_support.1.24.5.tar.gz"] +#) + +load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1") + +tf_workspace1() + +load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0") + +tf_workspace0() + +load( + "@local_xla//third_party/py:python_wheel.bzl", + "python_wheel_version_suffix_repository", +) + +python_wheel_version_suffix_repository(name = "tf_wheel_version_suffix") + +load( + "@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl", + "cuda_json_init_repository", +) + +cuda_json_init_repository() + +load( + "@cuda_redist_json//:distributions.bzl", + "CUDA_REDISTRIBUTIONS", + "CUDNN_REDISTRIBUTIONS", +) +load( + "@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl", + "cuda_redist_init_repositories", + "cudnn_redist_init_repository", +) + +cuda_redist_init_repositories( + cuda_redistributions = CUDA_REDISTRIBUTIONS, +) + +cudnn_redist_init_repository( + cudnn_redistributions = CUDNN_REDISTRIBUTIONS, +) + +load( + "@rules_ml_toolchain//third_party/gpus/cuda/hermetic:cuda_configure.bzl", + "cuda_configure", +) + +cuda_configure(name = "local_config_cuda") + +load( + "@rules_ml_toolchain//third_party/nccl/hermetic:nccl_redist_init_repository.bzl", + "nccl_redist_init_repository", +) + +nccl_redist_init_repository() + +load( + "@rules_ml_toolchain//third_party/nccl/hermetic:nccl_configure.bzl", + "nccl_configure", +) + +nccl_configure(name = "local_config_nccl") + +load( + "@rules_ml_toolchain//third_party/nvshmem/hermetic:nvshmem_json_init_repository.bzl", + "nvshmem_json_init_repository", +) + +nvshmem_json_init_repository() + +load( + "@nvshmem_redist_json//:distributions.bzl", + "NVSHMEM_REDISTRIBUTIONS", +) +load( + "@rules_ml_toolchain//third_party/nvshmem/hermetic:nvshmem_redist_init_repository.bzl", + "nvshmem_redist_init_repository", +) + +nvshmem_redist_init_repository( + nvshmem_redistributions = NVSHMEM_REDISTRIBUTIONS, +) + +load( + "@rules_ml_toolchain//third_party/nvshmem/hermetic:nvshmem_configure.bzl", + "nvshmem_configure", +) + +nvshmem_configure(name = "local_config_nvshmem") + +load( + "@rules_ml_toolchain//cc_toolchain/deps:cc_toolchain_deps.bzl", + "cc_toolchain_deps", +) + +cc_toolchain_deps() + +register_toolchains("@rules_ml_toolchain//cc_toolchain:lx64_lx64") + +register_toolchains("@rules_ml_toolchain//cc_toolchain:lx64_lx64_cuda") \ No newline at end of file diff --git a/tensorflow-core/tensorflow-core-native/external/tensorflow-proto.patch b/tensorflow-core/tensorflow-core-native/external/tensorflow-proto.patch new file mode 100644 index 00000000000..6fa1c9ce030 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/external/tensorflow-proto.patch @@ -0,0 +1,9 @@ +diff -ruN tensorflow/tensorflow/core/lib/core/error_codes.proto tensorflow-proto-patch/tensorflow/core/lib/core/error_codes.proto +--- tensorflow/tensorflow/core/lib/core/error_codes.proto ++++ tensorflow-proto-patch/tensorflow/core/lib/core/error_codes.proto +@@ -1,3 +1,5 @@ + syntax = "proto3"; + ++package tensorflow; ++ + import public "tsl/protobuf/error_codes.proto"; \ No newline at end of file diff --git a/tensorflow-core/tensorflow-core-native/external/tensorflow-visibility.patch b/tensorflow-core/tensorflow-core-native/external/tensorflow-visibility.patch new file mode 100644 index 00000000000..0465e780881 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/external/tensorflow-visibility.patch @@ -0,0 +1,35 @@ +diff -ruN tensorflow/tensorflow/BUILD tensorflow-2.6.0-visibility/tensorflow/BUILD +--- tensorflow/tensorflow/BUILD 2021-08-10 04:10:27.000000000 +0900 ++++ tensorflow-visibility/tensorflow/BUILD 2021-08-30 11:18:31.089781754 +0900 +@@ -46,7 +46,7 @@ load( + + package( + # copybara:uncomment default_applicable_licenses = [":license"], +- default_visibility = [":internal"], ++ default_visibility = ["//visibility:public"], + ) + + # copybara:uncomment_begin +diff -ruN tensorflow/tensorflow/core/api_def/BUILD tensorflow-2.6.0-visibility/tensorflow/core/api_def/BUILD +--- tensorflow/tensorflow/core/api_def/BUILD 2021-08-10 04:10:27.000000000 +0900 ++++ tensorflow-visibility/tensorflow/core/api_def/BUILD 2021-08-30 11:17:56.392705484 +0900 +@@ -29,7 +29,7 @@ + alias( + name = "base_api_def", + actual = "//tensorflow/core/api_def/base_api:base_api_def", +- visibility = ["//tensorflow:internal"], ++ visibility = ["//visibility:public"], + ) + + alias( +diff -ruN tensorflow/tensorflow/tools/api/lib/BUILD tensorflow-2.6.0-visibility/tensorflow/tools/api/lib/BUILD +--- tensorflow/tensorflow/tools/api/lib/BUILD 2021-08-10 04:10:27.000000000 +0900 ++++ tensorflow-visibility/tensorflow/tools/api/lib/BUILD 2021-08-30 11:17:56.392705484 +0900 +@@ -16,6 +16,7 @@ + tf_proto_library( + name = "api_objects_proto", + srcs = ["api_objects.proto"], ++ visibility = ["//visibility:public"], + ) + + py_library( diff --git a/tensorflow-core/tensorflow-core-native/pom.xml b/tensorflow-core/tensorflow-core-native/pom.xml new file mode 100644 index 00000000000..2e9102b450b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/pom.xml @@ -0,0 +1,634 @@ + + + 4.0.0 + + + org.tensorflow + tensorflow-core + 1.2.0-SNAPSHOT + + tensorflow-core-native + jar + + TensorFlow Native Library + Platform-dependent native code and pure-Java code for the TensorFlow machine intelligence library. + + + true + true + true + false + true + true + false + + ${project.build.directory}/dist/ + ${project.basedir}/src/main/native + + + + + org.bytedeco + javacpp + ${javacpp.version} + + + org.bytedeco + javacpp + ${javacpp.version} + ${javacpp.platform} + test + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + + + native-build + + + native.build + + + + false + false + false + false + false + true + + + + + + deploying + + true + true + + + + + maven-dependency-plugin + 3.6.1 + + + copy-native-artifacts + validate + + copy + + + ${project.build.directory} + true + true + true + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${javacpp.platform.linux-x86_64} + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${javacpp.platform.linux-x86_64}-gpu + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${javacpp.platform.macosx-arm64} + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${javacpp.platform.linux-arm64} + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + attach-artifacts + validate + + attach-artifact + + + + + ${project.build.directory}/${project.artifactId}-${project.version}-${javacpp.platform.linux-x86_64}.jar + ${javacpp.platform.linux-x86_64} + + + ${project.build.directory}/${project.artifactId}-${project.version}-${javacpp.platform.linux-x86_64}-gpu.jar + ${javacpp.platform.linux-x86_64}-gpu + + + ${project.build.directory}/${project.artifactId}-${project.version}-${javacpp.platform.macosx-arm64}.jar + ${javacpp.platform.macosx-arm64} + + + ${project.build.directory}/${project.artifactId}-${project.version}-${javacpp.platform.linux-arm64}.jar + ${javacpp.platform.linux-arm64} + + + + + + + + + + + + + generating + + false + false + false + false + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + + bazel-build + + exec + + initialize + + ${bazel.build.skip} + bash + + scripts/bazel_build.sh + + + ${javacpp.platform} + ${bazel.build.flags} + + + + + + bazel-generate + + exec + + generate-sources + + ${bazel.generate.skip} + bash + + scripts/bazel_generate.sh + + + ${javacpp.platform} + ${bazel.build.flags} + + + + + + bazel-clean + + exec + + clean + + ${bazel.clean.skip} + bash + + scripts/bazel_clean.sh + + + + + + dist-download + initialize + + exec + + + ${dist.download.skip} + bash + + scripts/dist_download.sh + ${dist.download.folder} + + + ${native.classifier} + + ${project.basedir} + + + + + + + org.bytedeco + javacpp + ${javacpp.version} + + ${javacpp.platform.properties} + + + platform.root + ${javacpp.platform.root} + + + platform.compiler + ${javacpp.platform.compiler} + + + platform.extension + ${javacpp.platform.extension} + + + ${project.build.outputDirectory} + + ${dist.download.folder}/tensorflow/include/ + ${native.source.directory}/org/tensorflow/internal/c_api/ + + ${project.basedir}/bazel-${project.artifactId}/external/org_tensorflow/ + ${project.basedir}/bazel-${project.artifactId}/external/local_tsl/ + ${project.basedir}/bazel-${project.artifactId}/external/local_xla/ + ${project.basedir}/bazel-bin/external/org_tensorflow/ + ${project.basedir}/bazel-${project.artifactId}/external/com_google_absl/ + ${project.basedir}/bazel-${project.artifactId}/external/eigen_archive/ + ${project.basedir}/bazel-${project.artifactId}/external/com_google_protobuf/src/ + + + ${dist.download.folder}/tensorflow/ + ${dist.download.folder}/tensorflow/lib/ + + ${project.basedir}/bazel-bin/external/llvm_openmp/ + ${project.basedir}/bazel-bin/external/org_tensorflow/tensorflow/ + + + ${project.basedir}/../../ + ${project.basedir}/bazel-bin/external/org_tensorflow/tensorflow/tools/lib_package/ + + + + + + javacpp-validate + validate + + build + + + + + javacpp-parser + generate-sources + + parse + + + ${javacpp.generate.skip} + ${project.basedir}/src/gen/java + org.tensorflow.internal.c_api.presets.* + + + + + javacpp-compiler + process-classes + + build + + + ${javacpp.build.skip} + + ${project.build.directory}/native/org/tensorflow/internal/c_api/${native.classifier}/ + org.tensorflow.internal.c_api.** + true + true + + + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + + add-gen-sources + generate-sources + + add-source + + + + ${project.basedir}/src/gen/java + + + + + + + + maven-clean-plugin + 3.3.2 + + + + generated-sources-clean + clean + + clean + + + ${javacpp.clean.skip} + + + src/gen + + + + + + + + + maven-resources-plugin + 3.3.1 + + + + copy-resources + initialize + + resources + + + + + generated-resources-copy + process-resources + + copy-resources + + + ${project.build.directory}/defs-classes + + + src/gen/resources + + + + + + + + + maven-compiler-plugin + 3.11.0 + + + ${maven.compiler.release} + + + + + javacpp-compiler + initialize + + compile + + + + org/tensorflow/internal/c_api/presets/*.java + + + 8 + + + + + + + + maven-jar-plugin + 3.3.0 + + + + native-jar + package + + jar + + + + + tensorflow.nativelib.${os.name}.${os.arch} + + + ${native.classifier} + true + + + org/tensorflow/internal/c_api/${native.classifier}/ + + ${project.build.directory}/native + + org/tensorflow/internal/c_api/${native.classifier}/*.exp + 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}/*msvcr120* + + + + + + defs-jar + package + + jar + + + defs + true + ${project.build.directory}/defs-classes + + + + + + + maven-deploy-plugin + 3.1.1 + + + + native-only + + deploy-file + + + + ${project.build.directory}/${project.artifactId}-${project.version}-${native.classifier}.jar + central + ${project.groupId} + ${project.artifactId} + ${native.classifier} + pom.xml + false + + + + + + + maven-surefire-plugin + + + + default-test + integration-test + + test + + + + ${project.build.directory}/${project.artifactId}-${project.version}-${native.classifier}.jar + ${project.build.directory}/native/ + + + + + + + + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + diff --git a/tensorflow-core/tensorflow-core-native/scripts/bazel_build.sh b/tensorflow-core/tensorflow-core-native/scripts/bazel_build.sh new file mode 100755 index 00000000000..3a4f1131dbe --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/scripts/bazel_build.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Script to build native TensorFlow libraries +set -eu +source $(pwd -P)/scripts/bazel_common.sh + +echo "Building TensorFlow with Bazel" +# Build C/C++ API of TensorFlow itself including a target to generate ops for Java +${BAZEL_CMD:=bazel} --bazelrc=tensorflow.bazelrc $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \ + @org_tensorflow//tensorflow:tensorflow_cc + +# Normalize some paths with symbolic links +echo "Normalizing paths" +TENSORFLOW_SO=($TENSORFLOW_BIN/libtensorflow_cc.so.?.??.?) +TENSORFLOW_FRMK_SO=($TENSORFLOW_BIN/libtensorflow_framework.so.?.??.?) +if [[ -f $TENSORFLOW_SO ]]; then + export TENSORFLOW_LIB=$TENSORFLOW_SO + ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow_cc.so + ln -sf $(basename $TENSORFLOW_SO) $TENSORFLOW_BIN/libtensorflow_cc.so.2 + ln -sf $(basename $TENSORFLOW_FRMK_SO) $TENSORFLOW_BIN/libtensorflow_framework.so + ln -sf $(basename $TENSORFLOW_FRMK_SO) $TENSORFLOW_BIN/libtensorflow_framework.so.2 +fi +TENSORFLOW_DYLIB=($TENSORFLOW_BIN/libtensorflow_cc.?.??.?.dylib) +TENSORFLOW_FRMK_DYLIB=($TENSORFLOW_BIN/libtensorflow_framework.?.??.?.dylib) +if [[ -f $TENSORFLOW_DYLIB ]]; then + export TENSORFLOW_LIB=$TENSORFLOW_DYLIB + ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow_cc.dylib + ln -sf $(basename $TENSORFLOW_DYLIB) $TENSORFLOW_BIN/libtensorflow_cc.2.dylib + ln -sf $(basename $TENSORFLOW_FRMK_DYLIB) $TENSORFLOW_BIN/libtensorflow_framework.dylib + ln -sf $(basename $TENSORFLOW_FRMK_DYLIB) $TENSORFLOW_BIN/libtensorflow_framework.2.dylib +fi +TENSORFLOW_DLLS=($TENSORFLOW_BIN/tensorflow_cc.dll.if.lib $TENSORFLOW_BIN/libtensorflow_cc.dll.ifso) +for TENSORFLOW_DLL in ${TENSORFLOW_DLLS[@]}; do + if [[ -f $TENSORFLOW_DLL ]]; then + export TENSORFLOW_LIB=$TENSORFLOW_BIN/tensorflow_cc.dll + ln -sf $(basename $TENSORFLOW_DLL) $TENSORFLOW_BIN/tensorflow_cc.lib + fi +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 ' ') + echo $UGLYPATH + 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 diff --git a/tensorflow-core/tensorflow-core-native/scripts/bazel_clean.sh b/tensorflow-core/tensorflow-core-native/scripts/bazel_clean.sh new file mode 100755 index 00000000000..e6700c4ce7d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/scripts/bazel_clean.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -eu +source $(pwd -P)/scripts/bazel_common.sh +${BAZEL_CMD:=bazel} clean diff --git a/tensorflow-core/tensorflow-core-native/scripts/bazel_common.sh b/tensorflow-core/tensorflow-core-native/scripts/bazel_common.sh new file mode 100755 index 00000000000..a46225129a6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/scripts/bazel_common.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -eu + +# Set generic Bazel build options +export BAZEL_VC="${VCINSTALLDIR:-}" +if [[ -d $BAZEL_VC ]]; then + export BUILD_FLAGS="--output_user_root=$(cygpath -w $TMP) build" + export PYTHON_BIN_PATH=$(which python.exe) +else + export BUILD_FLAGS="build" + export PYTHON_BIN_PATH=$(which python3) +fi + +# Add platform specific flags +if [[ "${PLATFORM:-}" == macosx-arm64 ]]; then + BUILD_FLAGS="$BUILD_FLAGS --config=macos_arm64" +fi +BUILD_FLAGS="$BUILD_FLAGS --experimental_repo_remote_exec --python_path="$PYTHON_BIN_PATH" --output_filter=DONT_MATCH_ANYTHING --verbose_failures" + +export BAZEL_BIN=$(pwd -P)/bazel-bin +export TENSORFLOW_BIN=$BAZEL_BIN/external/org_tensorflow/tensorflow + +export BAZEL_SRCS=$(pwd -P)/bazel-tensorflow-core-native +export TENSORFLOW_SRCS=$BAZEL_SRCS/external/org_tensorflow/tensorflow diff --git a/tensorflow-core/tensorflow-core-native/scripts/bazel_generate.sh b/tensorflow-core/tensorflow-core-native/scripts/bazel_generate.sh new file mode 100755 index 00000000000..ab0fd0ec6c1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/scripts/bazel_generate.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Script to build native TensorFlow libraries +set -eu +source $(pwd -P)/scripts/bazel_common.sh + +echo "Generate sources with Bazel" +# Build C/C++ API of TensorFlow itself including a target to generate ops for Java +${BAZEL_CMD:=bazel} --bazelrc=tensorflow.bazelrc $BUILD_FLAGS ${BUILD_USER_FLAGS:-} \ + @org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate \ + :java_proto_gen_sources + +echo "Rebuilding generated source directories" +GEN_SRCS_DIR=src/gen/java +rm -rf $GEN_SRCS_DIR +mkdir -p $GEN_SRCS_DIR + +GEN_RESOURCE_DIR=src/gen/resources +rm -rf $GEN_RESOURCE_DIR +mkdir -p $GEN_RESOURCE_DIR/org/tensorflow/ + +# Copy ops definitions to Java resources +echo "Copying TF ops definitions" +cp -f $TENSORFLOW_SRCS/core/ops/ops.pbtxt $GEN_RESOURCE_DIR/org/tensorflow +cp -rf $TENSORFLOW_SRCS/core/api_def/base_api $GEN_RESOURCE_DIR/org/tensorflow/ + +# Copy generated Java protos from source jars +echo "Extracting TF/TSL/XLA proto Java sources" +cd $GEN_SRCS_DIR +find $TENSORFLOW_BIN $BAZEL_BIN/external/local_tsl/tsl $BAZEL_BIN/external/local_xla/xla -name \*-speed-src.jar -exec jar xf {} \; +rm -rf META-INF diff --git a/tensorflow-core/tensorflow-core-native/scripts/dist_download.sh b/tensorflow-core/tensorflow-core-native/scripts/dist_download.sh new file mode 100755 index 00000000000..54ffca74ac0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/scripts/dist_download.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -e + +DOWNLOAD_FOLDER="$1" + +case ${PLATFORM:-} in + 'linux-x86_64') + WHEEL_URL='https://files.pythonhosted.org/packages/1a/9e/594164db23e3e262da1a0e8983258811eff56e5af6b7b6da5eccccb8d4c7/tensorflow_cpu-2.20.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl' + ;; + 'linux-x86_64-gpu') + WHEEL_URL='https://files.pythonhosted.org/packages/43/fb/8be8547c128613d82a2b006004026d86ed0bd672e913029a98153af4ffab/tensorflow-2.20.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl' + ;; + 'linux-arm64') + WHEEL_URL='https://files.pythonhosted.org/packages/ea/4c/c1aa90c5cc92e9f7f9c78421e121ef25bae7d378f8d1d4cbad46c6308836/tensorflow-2.20.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl' + ;; + 'macosx-arm64') + WHEEL_URL='https://files.pythonhosted.org/packages/04/82/af283f402f8d1e9315644a331a5f0f326264c5d1de08262f3de5a5ade422/tensorflow-2.20.0-cp313-cp313-macosx_12_0_arm64.whl' + ;; + *) + echo "TensorFlow distribution for ${PLATFORM} is not supported for download" + exit 1; +esac + +mkdir -p "$DOWNLOAD_FOLDER" +cd "$DOWNLOAD_FOLDER" + +if [[ -n "$WHEEL_URL" ]]; then + echo "Downloading $WHEEL_URL" + if [ ! -f 'tensorflow.whl' ]; then + curl -L $WHEEL_URL --output 'tensorflow.whl' + fi + yes | unzip -q -u 'tensorflow.whl' # use 'yes' because for some reasons -u does not work on Windows + if [[ "$PLATFORM" == "linux-arm64" ]]; then + cp $DOWNLOAD_FOLDER/tensorflow.libs/* $DOWNLOAD_FOLDER/tensorflow/ + fi +fi + +if [[ -n "$CLIB_URL" ]]; then + echo "Downloading $CLIB_URL" + if [ ! -f 'tensorflow_c.zip' ]; then + curl -L $CLIB_URL --output 'tensorflow_c.zip' + fi + yes | unzip -q -u -d tensorflow 'tensorflow_c.zip' +fi + +cd tensorflow +if [[ "$PLATFORM" =~ "linux" ]]; then + ln -fs libtensorflow_cc.so.2 libtensorflow_cc.so + ln -fs libtensorflow_framework.so.2 libtensorflow_framework.so + if [[ "$PLATFORM" == "linux-arm64" ]]; then + cp ../tensorflow.libs/libomp-f1025659.so.5 libomp-f1025659.so.5 + ln -fs libomp-f1025659.so.5 libomp-f1025659.so + fi +elif [[ "$PLATFORM" =~ "macosx" ]]; then + ln -fs libtensorflow_cc.2.dylib libtensorflow_cc.dylib + ln -fs libtensorflow_framework.2.dylib libtensorflow_framework.dylib +fi +ls -l . diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java index 245b3e2018a..58873a30c53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java index b01b2c229ea..6ce5d643c9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java index 2ea782928ac..03b4094e19e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancelCallback.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancelCallback.java new file mode 100644 index 00000000000..bcb0ffbdec9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancelCallback.java @@ -0,0 +1,39 @@ +// Targeted by JavaCPP version 1.5.12: 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 TFE_CancelCallback extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TFE_CancelCallback() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TFE_CancelCallback(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_CancelCallback(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TFE_CancelCallback position(long position) { + return (TFE_CancelCallback)super.position(position); + } + @Override public TFE_CancelCallback getPointer(long i) { + return new TFE_CancelCallback((Pointer)this).offsetAddress(i); + } + + public static class Callback_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Callback_Pointer(Pointer p) { super(p); } + protected Callback_Pointer() { allocate(); } + private native void allocate(); + public native void call(Pointer context); + } + public native Callback_Pointer callback(); public native TFE_CancelCallback callback(Callback_Pointer setter); + public native Pointer context(); public native TFE_CancelCallback context(Pointer setter); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancellationManager.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancellationManager.java new file mode 100644 index 00000000000..85181d651a6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CancellationManager.java @@ -0,0 +1,21 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// ----------------------------------------------------------------------------- +// Cancellation APIs. + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_CancellationManager extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_CancellationManager() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_CancellationManager(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java similarity index 94% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java index f3309ed7530..ee22b68f7ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java index 93223d33e0c..1e6b1dad072 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDevice.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDevice.java new file mode 100644 index 00000000000..cda91d819b3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDevice.java @@ -0,0 +1,126 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// Struct to be filled in. Functions are required except where indicated. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_CustomDevice extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TFE_CustomDevice() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TFE_CustomDevice(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_CustomDevice(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TFE_CustomDevice position(long position) { + return (TFE_CustomDevice)super.position(position); + } + @Override public TFE_CustomDevice getPointer(long i) { + return new TFE_CustomDevice((Pointer)this).offsetAddress(i); + } + + public native int version(); public native TFE_CustomDevice version(int setter); + // Method to copy a tensor to the custom device. + public static class Copy_tensor_to_device_TFE_Context_TFE_TensorHandle_TF_Status_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Copy_tensor_to_device_TFE_Context_TFE_TensorHandle_TF_Status_Pointer(Pointer p) { super(p); } + protected Copy_tensor_to_device_TFE_Context_TFE_TensorHandle_TF_Status_Pointer() { allocate(); } + private native void allocate(); + public native TFE_TensorHandle call(TFE_Context context, + TFE_TensorHandle tensor, + TF_Status status, + Pointer device_info); + } + public native Copy_tensor_to_device_TFE_Context_TFE_TensorHandle_TF_Status_Pointer copy_tensor_to_device(); public native TFE_CustomDevice copy_tensor_to_device(Copy_tensor_to_device_TFE_Context_TFE_TensorHandle_TF_Status_Pointer setter); + + // Method to copy a tensor from the custom device to a target device. + public static class Copy_tensor_from_device_TFE_Context_TFE_TensorHandle_BytePointer_TF_Status_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Copy_tensor_from_device_TFE_Context_TFE_TensorHandle_BytePointer_TF_Status_Pointer(Pointer p) { super(p); } + protected Copy_tensor_from_device_TFE_Context_TFE_TensorHandle_BytePointer_TF_Status_Pointer() { allocate(); } + private native void allocate(); + public native TFE_TensorHandle call(TFE_Context context, + TFE_TensorHandle tensor, + @Cast("const char*") BytePointer target_device_name, + TF_Status status, + Pointer device_info); + } + public native Copy_tensor_from_device_TFE_Context_TFE_TensorHandle_BytePointer_TF_Status_Pointer copy_tensor_from_device(); public native TFE_CustomDevice copy_tensor_from_device(Copy_tensor_from_device_TFE_Context_TFE_TensorHandle_BytePointer_TF_Status_Pointer setter); + + // Method to execute an operation. + // + // Arguments provide enough information to reconstruct the original `TFE_Op`, + // or construct a transformed version, by inspecting the passed `op`. + // + // TFE_OpGetDevice(op) records the original placement of the operation. It may + // be an empty string if no device was explicitly requested, but will + // otherwise be the name of this custom device. Ops are placed onto a custom + // device if any of their inputs are on that custom device, but custom devices + // are free to set a bad status in order to require explicit placement. + public static class Execute_TFE_Op_IntPointer_PointerPointer_TF_Status_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Execute_TFE_Op_IntPointer_PointerPointer_TF_Status_Pointer(Pointer p) { super(p); } + protected Execute_TFE_Op_IntPointer_PointerPointer_TF_Status_Pointer() { allocate(); } + private native void allocate(); + public native void call(@Const TFE_Op op, IntPointer num_outputs, + @Cast("TFE_TensorHandle**") PointerPointer outputs, TF_Status s, Pointer device_info); + } + public native Execute_TFE_Op_IntPointer_PointerPointer_TF_Status_Pointer execute(); public native TFE_CustomDevice execute(Execute_TFE_Op_IntPointer_PointerPointer_TF_Status_Pointer setter); + + // Method to delete a device. + public static class Delete_device_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Delete_device_Pointer(Pointer p) { super(p); } + protected Delete_device_Pointer() { allocate(); } + private native void allocate(); + public native void call(Pointer device_info); + } + public native Delete_device_Pointer delete_device(); public native TFE_CustomDevice delete_device(Delete_device_Pointer setter); + + // Implements TFE_CreatePackedTensorHandle when one of `handles` is on this + // custom device. + // + // Many devices will want to simply return an "unimplemented" status + // here. This is the default behavior if `pack` is null when passed to + // TFE_RegisterCustomDevice. + public static class Pack_TFE_Context_PointerPointer_int_TF_Status_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Pack_TFE_Context_PointerPointer_int_TF_Status_Pointer(Pointer p) { super(p); } + protected Pack_TFE_Context_PointerPointer_int_TF_Status_Pointer() { allocate(); } + private native void allocate(); + public native TFE_TensorHandle call(TFE_Context context, @Cast("TFE_TensorHandle**") PointerPointer handles, + int num_handles, TF_Status s, + Pointer device_info); + } + public native Pack_TFE_Context_PointerPointer_int_TF_Status_Pointer pack(); public native TFE_CustomDevice pack(Pack_TFE_Context_PointerPointer_int_TF_Status_Pointer setter); + + // Pins the op to `device` based on inputs to `op`. Returns true + // signifying to pin to the current custom device. Returns false + // to pin to the physical device. + // + // This function is guaranteed to be called only when all of the custom-device + // inputs are on this device. + public static class Shall_pin_to_this_device_TFE_Op_TF_Status extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Shall_pin_to_this_device_TFE_Op_TF_Status(Pointer p) { super(p); } + protected Shall_pin_to_this_device_TFE_Op_TF_Status() { allocate(); } + private native void allocate(); + public native @Cast("bool") boolean call(@Const TFE_Op op, TF_Status s); + } + public native Shall_pin_to_this_device_TFE_Op_TF_Status shall_pin_to_this_device(); public native TFE_CustomDevice shall_pin_to_this_device(Shall_pin_to_this_device_TFE_Op_TF_Status setter); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDeviceTensorHandle.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDeviceTensorHandle.java new file mode 100644 index 00000000000..fef6b028ee8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_CustomDeviceTensorHandle.java @@ -0,0 +1,89 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// Struct to be filled in to define a custom device tensor handle. Fields are +// required except where indicated. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_CustomDeviceTensorHandle extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TFE_CustomDeviceTensorHandle() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TFE_CustomDeviceTensorHandle(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_CustomDeviceTensorHandle(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TFE_CustomDeviceTensorHandle position(long position) { + return (TFE_CustomDeviceTensorHandle)super.position(position); + } + @Override public TFE_CustomDeviceTensorHandle getPointer(long i) { + return new TFE_CustomDeviceTensorHandle((Pointer)this).offsetAddress(i); + } + + public native int version(); public native TFE_CustomDeviceTensorHandle version(int setter); + + // Computes the rank of the tensor handle. + // + // Shapes are specified via callbacks because retrieving the shape of a tensor + // is a blocking operation for async eager; custom devices should avoid + // retrieving shapes of tensors they wrap until the custom device tensor's + // shape is explicitly requested where possible. + public static class Num_dims_Pointer_TF_Status extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Num_dims_Pointer_TF_Status(Pointer p) { super(p); } + protected Num_dims_Pointer_TF_Status() { allocate(); } + private native void allocate(); + public native int call(Pointer data, TF_Status status); + } + public native Num_dims_Pointer_TF_Status num_dims(); public native TFE_CustomDeviceTensorHandle num_dims(Num_dims_Pointer_TF_Status setter); + + // Computes the axis length at `dim_index`. + public static class Dim_Pointer_int_TF_Status extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Dim_Pointer_int_TF_Status(Pointer p) { super(p); } + protected Dim_Pointer_int_TF_Status() { allocate(); } + private native void allocate(); + public native @Cast("int64_t") long call(Pointer data, int dim_index, TF_Status status); + } + public native Dim_Pointer_int_TF_Status dim(); public native TFE_CustomDeviceTensorHandle dim(Dim_Pointer_int_TF_Status setter); + + public static class Deallocator_Pointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Deallocator_Pointer(Pointer p) { super(p); } + protected Deallocator_Pointer() { allocate(); } + private native void allocate(); + public native void call(Pointer data); + } + public native @Name("deallocator") Deallocator_Pointer cdt_deallocator(); public native TFE_CustomDeviceTensorHandle cdt_deallocator(Deallocator_Pointer setter); + + // Summarizes the value of this tensor. The caller takes ownership of the + // returned buffer. If `status` is not TF_OK, instead returns a null pointer. + // + // Does not include the shape and dtype of the tensor (which is generally + // appended later), but should include any information specific to this custom + // device which would be useful for debugging. + // + // Optional. If null, defaults to resolving the TFE_TensorHandle into a + // TF_Tensor and summarizing that. + public static class Summarize_Pointer_TF_Status extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Summarize_Pointer_TF_Status(Pointer p) { super(p); } + protected Summarize_Pointer_TF_Status() { allocate(); } + private native void allocate(); + public native TF_Buffer call(Pointer data, TF_Status status); + } + public native Summarize_Pointer_TF_Status summarize(); public native TFE_CustomDeviceTensorHandle summarize(Summarize_Pointer_TF_Status setter); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Executor.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Executor.java new file mode 100644 index 00000000000..5edcd18e91e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Executor.java @@ -0,0 +1,20 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// ----------------------------------------------------------------------------- +// Eager Executor APIs. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_Executor extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_Executor() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_Executor(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge0.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge0.java new file mode 100644 index 00000000000..86b997f9c5f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge0.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Bool Gauge without label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringBoolGauge0 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringBoolGauge0() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringBoolGauge0(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge1.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge1.java new file mode 100644 index 00000000000..e8d0be739c3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge1.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Bool Gauge with 1 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringBoolGauge1 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringBoolGauge1() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringBoolGauge1(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge2.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge2.java new file mode 100644 index 00000000000..be6f3a4157f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGauge2.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Bool Gauge with 2 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringBoolGauge2 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringBoolGauge2() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringBoolGauge2(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGaugeCell.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGaugeCell.java new file mode 100644 index 00000000000..3f595391ea2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBoolGaugeCell.java @@ -0,0 +1,18 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringBoolGaugeCell extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringBoolGaugeCell() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringBoolGaugeCell(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBuckets.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBuckets.java new file mode 100644 index 00000000000..1e962207ae1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringBuckets.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for sampler buckets +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringBuckets extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringBuckets() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringBuckets(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter0.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter0.java new file mode 100644 index 00000000000..2e6c7e1bd47 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter0.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Counter without label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringCounter0 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringCounter0() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringCounter0(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter1.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter1.java new file mode 100644 index 00000000000..4fca4cbd77f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter1.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Counter with 1 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringCounter1 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringCounter1() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringCounter1(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter2.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter2.java new file mode 100644 index 00000000000..deec4369dd0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounter2.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Counter with 2 labels. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringCounter2 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringCounter2() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringCounter2(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounterCell.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounterCell.java new file mode 100644 index 00000000000..41652a4ccf2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringCounterCell.java @@ -0,0 +1,23 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// TODO(fishx): Move these monitoring APIs into a separate file. +// ----------------------------------------------------------------------------- +// Monitoring Counter APIs. +// These APIs de-templated monitoring Counter for swig. + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringCounterCell extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringCounterCell() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringCounterCell(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge0.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge0.java new file mode 100644 index 00000000000..44a58a1b211 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge0.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Int Gauge without label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringIntGauge0 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringIntGauge0() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringIntGauge0(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge1.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge1.java new file mode 100644 index 00000000000..b1d9654bec7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge1.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Int Gauge with 1 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringIntGauge1 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringIntGauge1() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringIntGauge1(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge2.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge2.java new file mode 100644 index 00000000000..a2a140e73b6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGauge2.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Int Gauge with 2 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringIntGauge2 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringIntGauge2() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringIntGauge2(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGaugeCell.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGaugeCell.java new file mode 100644 index 00000000000..102cd37b2a9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringIntGaugeCell.java @@ -0,0 +1,22 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// ----------------------------------------------------------------------------- +// Monitoring Gauge APIs. +// These APIs de-templated monitoring Gauge for swig. + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringIntGaugeCell extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringIntGaugeCell() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringIntGaugeCell(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler0.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler0.java new file mode 100644 index 00000000000..9c4194944e7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler0.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Sampler without label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringSampler0 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringSampler0() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringSampler0(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler1.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler1.java new file mode 100644 index 00000000000..afd8b49e657 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler1.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Sampler with 1 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringSampler1 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringSampler1() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringSampler1(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler2.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler2.java new file mode 100644 index 00000000000..0dfaee7d782 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSampler2.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for Sampler with 2 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringSampler2 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringSampler2() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringSampler2(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSamplerCell.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSamplerCell.java new file mode 100644 index 00000000000..e3547fb10ac --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringSamplerCell.java @@ -0,0 +1,22 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// ----------------------------------------------------------------------------- +// Monitoring Sampler APIs. +// These APIs de-templated monitoring Sampler for swig. + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringSamplerCell extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringSamplerCell() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringSamplerCell(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge0.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge0.java new file mode 100644 index 00000000000..213b72c2a4f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge0.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for String Gauge without label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGauge0 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGauge0() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGauge0(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge1.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge1.java new file mode 100644 index 00000000000..a19ae751637 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge1.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for String Gauge with 1 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGauge1 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGauge1() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGauge1(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge2.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge2.java new file mode 100644 index 00000000000..a30f250a8ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge2.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for String Gauge with 2 label. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGauge2 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGauge2() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGauge2(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge3.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge3.java new file mode 100644 index 00000000000..fb80143410e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge3.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for String Gauge with 3 labels. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGauge3 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGauge3() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGauge3(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge4.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge4.java new file mode 100644 index 00000000000..d3d33cbb1e6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGauge4.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for String Gauge with 4 labels. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGauge4 extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGauge4() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGauge4(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGaugeCell.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGaugeCell.java new file mode 100644 index 00000000000..cf839004e4b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_MonitoringStringGaugeCell.java @@ -0,0 +1,18 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_MonitoringStringGaugeCell extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_MonitoringStringGaugeCell() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_MonitoringStringGaugeCell(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java similarity index 94% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java index 9c68d0d9920..4a1b8e2e899 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_OpAttrs.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_OpAttrs.java new file mode 100644 index 00000000000..cc7923eecbf --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_OpAttrs.java @@ -0,0 +1,26 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// APIs for generically dealing with op attributes (e.g. when forwarding them +// through custom device implementations). +// +// TODO(allenl): Currently these are black boxes, but we should have some way to +// inspect values. This would let people e.g. copy over most attributes and then +// modify some based on their values. + +// A reference to an op's name -> attribute mapping +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFE_OpAttrs extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFE_OpAttrs() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFE_OpAttrs(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java index fcdf2858a91..23f1399b60e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java similarity index 86% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java index 7fa3f7ec6cb..4bca36afa91 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; @@ -13,7 +13,7 @@ // // Like a TF_Tensor, a TFE_TensorHandle refers to a tensor with a value, shape, // type etc. Unlike a TF_Tensor, a TFE_TensorHandle may refer to such tensors -// placed in memory of different devices or remote address spaces. +// placed in the memory of different devices or remote address spaces. @Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_TensorHandle extends org.tensorflow.internal.c_api.AbstractTFE_TensorHandle { /** Empty constructor. Calls {@code super((Pointer)null)}. */ diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GradFuncAdapter.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GradFuncAdapter.java new file mode 100644 index 00000000000..b948e0bb83b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GradFuncAdapter.java @@ -0,0 +1,27 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +/** Function to be implemented on the JVM side to be called back by the native library when it is time to attach gradient operations for the given op, graph and scope. + * + * {@code grad_inputs} are the inputs available to the gradient operations. {@code grad_outputs} must received the address of an array of {@code TF_Output} allocated by the JVM, which + * represents the outputs of the gradient operations to attach to the graph. It is important to guarantee that the JVM won't try to trigger the deallocation + * of that pointer, since the native code will take care of that when it won't need the array anymore. + * + * Returns the number of elements pointed by grad_outputs. */ +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFJ_GradFuncAdapter extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFJ_GradFuncAdapter(Pointer p) { super(p); } + protected TFJ_GradFuncAdapter() { allocate(); } + private native void allocate(); + public native int call(TFJ_GraphId graphId, TFJ_Scope scope, TF_Operation operation, TF_Output grad_inputs, int grad_inputs_length, @Cast("TF_Output**") PointerPointer grad_outputs); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GraphId.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GraphId.java new file mode 100644 index 00000000000..46273ff116a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_GraphId.java @@ -0,0 +1,19 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +/** Unique identifier of a TensorFlow graph instance */ +@Namespace @Name("void") @Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFJ_GraphId extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFJ_GraphId() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFJ_GraphId(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_Scope.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_Scope.java new file mode 100644 index 00000000000..2b1f059ea34 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TFJ_Scope.java @@ -0,0 +1,18 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TFJ_Scope extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TFJ_Scope() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TFJ_Scope(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java similarity index 96% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java index 4f622e33714..a107a5fca3c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AllocatorAttributes.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java similarity index 94% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java index 8da3d79e7f7..010e72afc58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrBuilder.java new file mode 100644 index 00000000000..5e90a864542 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrBuilder.java @@ -0,0 +1,21 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// TF_NewAttrBuilder() returns an object that you can set attributes on as +// though it were an op. This allows querying properties of that op for +// type-checking purposes like if the op will run on a particular device type. +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_AttrBuilder extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TF_AttrBuilder() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_AttrBuilder(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java similarity index 97% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java index 0b83058a276..5bfdc300bfa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java similarity index 97% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java index a8653a2049f..a3c175e743d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; @@ -8,6 +8,7 @@ import static org.tensorflow.internal.c_api.global.tensorflow.*; +// #endif // -------------------------------------------------------------------------- // TF_Buffer holds a pointer to a block of data and its associated length. diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_CheckpointReader.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_CheckpointReader.java new file mode 100644 index 00000000000..139e8890b73 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_CheckpointReader.java @@ -0,0 +1,20 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// TF_NewCheckpointReader() return the CheckpointReader that can be use to +// investigate or load the variable from the checkpoint file +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_CheckpointReader extends Pointer { + /** Empty constructor. Calls {@code super((Pointer)null)}. */ + public TF_CheckpointReader() { super((Pointer)null); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_CheckpointReader(Pointer p) { super(p); } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java index c2923086177..9e43f800123 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java similarity index 90% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java index bc86ab8a823..4e592d8f5c3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java index 29d075cafc1..23b78cd1e1b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java index fc12f275678..71baf2504f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java index f4521d36625..f94f4151612 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java index 69ccb1f83ff..a8d717dbcc5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java index 269a1b07f17..90ccbbc4f7d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java index 9e73e8dbf78..ae27224db9a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java index 6be7fcbec8d..0c4e471a82b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java index 4daad4f8a2a..823bba704f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java index 490ca238753..f2787037d42 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java index bd36144620d..34229d26d81 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java similarity index 94% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java index aceb639f7af..40f4755522f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java index a034dd7f647..f70734dc616 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java index 749655f6209..000fbc6bf60 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndType.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndType.java new file mode 100644 index 00000000000..0022ee15d23 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndType.java @@ -0,0 +1,37 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// Information about the shape of a Tensor and its type. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_ShapeAndType extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_ShapeAndType() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_ShapeAndType(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_ShapeAndType(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_ShapeAndType position(long position) { + return (TF_ShapeAndType)super.position(position); + } + @Override public TF_ShapeAndType getPointer(long i) { + return new TF_ShapeAndType((Pointer)this).offsetAddress(i); + } + + // Number of dimensions. -1 indicates unknown rank. + public native int num_dims(); public native TF_ShapeAndType num_dims(int setter); + // Array of dimensions. -1 indicates unknown dim. + public native @Cast("int64_t*") LongPointer dims(); public native TF_ShapeAndType dims(LongPointer setter); + // The data type. May be 0 to denote unknown type. + public native @Cast("TF_DataType") int dtype(); public native TF_ShapeAndType dtype(int setter); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndTypeList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndTypeList.java new file mode 100644 index 00000000000..acb68133e42 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeAndTypeList.java @@ -0,0 +1,33 @@ +// Targeted by JavaCPP version 1.5.12: 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.*; + + +// A list of TF_ShapeAndType elements.. +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_ShapeAndTypeList extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public TF_ShapeAndTypeList() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public TF_ShapeAndTypeList(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public TF_ShapeAndTypeList(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public TF_ShapeAndTypeList position(long position) { + return (TF_ShapeAndTypeList)super.position(position); + } + @Override public TF_ShapeAndTypeList getPointer(long i) { + return new TF_ShapeAndTypeList((Pointer)this).offsetAddress(i); + } + + public native int num_items(); public native TF_ShapeAndTypeList num_items(int setter); + public native TF_ShapeAndType items(); public native TF_ShapeAndTypeList items(TF_ShapeAndType setter); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java index 7a70dc56e95..b31ed7f4646 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java similarity index 96% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java index 85ac4ee877f..64ae5dfd3e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_StringView.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java similarity index 96% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java index 7b4c3ad59a4..89455bbfe30 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java index e9031c07e18..352d77d2bd3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Large.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java index 19f06db9224..7b11bc70ffc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Offset.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java index c9dca734aa0..b36ff8c9706 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Raw.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java index 8efeeb5176d..70edc44605c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Small.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java similarity index 96% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java index d7ba9e1baa4..bb050ab5b27 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_Union.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; 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-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java index b6c3278403d..e3cac3b45a2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_TString_View.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java similarity index 95% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java index 9966d1cbfe3..8fac15d737b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java similarity index 96% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java index 1777d9a4d35..41bf07ffa9c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Tensor.java similarity index 93% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Tensor.java index 3a4952d5b63..224cc05b58e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/Tensor.java @@ -1,4 +1,4 @@ -// Targeted by JavaCPP version 1.5.6: DO NOT EDIT THIS FILE +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE package org.tensorflow.internal.c_api; diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java new file mode 100644 index 00000000000..48a6a3ded36 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java @@ -0,0 +1,5348 @@ +// Targeted by JavaCPP version 1.5.12: DO NOT EDIT THIS FILE + +package org.tensorflow.internal.c_api.global; + +import org.tensorflow.internal.c_api.*; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +public class tensorflow extends org.tensorflow.internal.c_api.presets.tensorflow { + static { Loader.load(); } + +// Parsed from tsl/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_TSL_PLATFORM_CTSTRING_INTERNAL_H_ +// #define TENSORFLOW_TSL_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) 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 void TF_TString_ReserveAmortized(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_TSL_PLATFORM_CTSTRING_INTERNAL_H_ + + +// Parsed from tsl/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_TSL_PLATFORM_CTSTRING_H_ +// #define TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ + +// #include +// #include + +// #include "tsl/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'. +// Reserve 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. +// Similar to TF_TString_Reserve, except that we ensure amortized growth, i.e. +// that we grow the capacity by at least a constant factor >1. + +// 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_TSL_PLATFORM_CTSTRING_H_ + + +// Parsed from xla/tsl/c/tsl_status.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 XLA_TSL_C_TSL_STATUS_H_ +// #define XLA_TSL_C_TSL_STATUS_H_ + +// #ifdef __cplusplus +// #endif + +// -------------------------------------------------------------------------- +// TSL_Code holds an error code. The enum values here are identical to +// corresponding values in error_codes.proto. +/** enum TSL_Code */ +public static final int + TSL_OK = 0, + TSL_CANCELLED = 1, + TSL_UNKNOWN = 2, + TSL_INVALID_ARGUMENT = 3, + TSL_DEADLINE_EXCEEDED = 4, + TSL_NOT_FOUND = 5, + TSL_ALREADY_EXISTS = 6, + TSL_PERMISSION_DENIED = 7, + TSL_UNAUTHENTICATED = 16, + TSL_RESOURCE_EXHAUSTED = 8, + TSL_FAILED_PRECONDITION = 9, + TSL_ABORTED = 10, + TSL_OUT_OF_RANGE = 11, + TSL_UNIMPLEMENTED = 12, + TSL_INTERNAL = 13, + TSL_UNAVAILABLE = 14, + TSL_DATA_LOSS = 15; + +// -------------------------------------------------------------------------- + +// Return a new status object. + +// Delete a previously created status object. + +// Record in *s. Any previous information is lost. +// A common use is to clear a status: TSL_SetStatus(s, TSL_OK, ""); + +// Record as a payload in *s. The previous payload having the +// same key (if any) is overwritten. Payload will not be added if the Status +// is OK. + +// Iterates over the stored payloads and calls the `visitor(key, value)` +// callable for each one. `key` and `value` is only usable during the callback. +// `capture` will be passed to the callback without modification. + +// Convert from an I/O error code (e.g., errno) to a TSL_Status value. +// Any previous information is lost. Prefer to use this instead of TSL_SetStatus +// when the error comes from I/O operations. + +// Return the code record in *s. + +// Return a pointer to the (null-terminated) error message in *s. The +// return value points to memory that is only usable until the next +// mutation to *s. Always returns an empty string if TSL_GetCode(s) is +// TSL_OK. + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // XLA_TSL_C_TSL_STATUS_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 +// #ifdef TF_CAPI_WEAK +// #define TF_CAPI_EXPORT +// __attribute__((visibility("default"))) __attribute((weak)) +// #else +// #define TF_CAPI_EXPORT __attribute__((visibility("default"))) +// #endif // TF_CAPI_WEAK +// #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. + +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_DATATYPE_H_ +// #define TENSORFLOW_C_TF_DATATYPE_H_ + +// #include + +// #include "tensorflow/c/c_api_macros.h" + +// #ifdef __cplusplus +// #endif + +// -------------------------------------------------------------------------- +// TF_DataType holds the type for a scalar value. E.g., one slot in a tensor. +// The enum values here are identical to corresponding values in types.proto. +/** enum TF_DataType */ +public static final int + TF_FLOAT = 1, + TF_DOUBLE = 2, + TF_INT32 = 3, // Int32 tensors are always in 'host' memory. + TF_UINT8 = 4, + TF_INT16 = 5, + TF_INT8 = 6, + TF_STRING = 7, + TF_COMPLEX64 = 8, // Single-precision complex + TF_COMPLEX = 8, // Old identifier kept for API backwards compatibility + TF_INT64 = 9, + TF_BOOL = 10, + TF_QINT8 = 11, // Quantized int8 + TF_QUINT8 = 12, // Quantized uint8 + TF_QINT32 = 13, // Quantized int32 + TF_BFLOAT16 = 14, // Float32 truncated to 16 bits. + TF_QINT16 = 15, // Quantized int16 + TF_QUINT16 = 16, // Quantized uint16 + TF_UINT16 = 17, + TF_COMPLEX128 = 18, // Double-precision complex + TF_HALF = 19, + TF_RESOURCE = 20, + TF_VARIANT = 21, + TF_UINT32 = 22, + TF_UINT64 = 23, + TF_FLOAT8_E5M2 = 24, // 5 exponent bits, 2 mantissa bits. + TF_FLOAT8_E4M3FN = 25, // 4 exponent bits, 3 mantissa bits, finite-only, with + // 2 NaNs (0bS1111111). + TF_FLOAT8_E4M3FNUZ = 26, // 4 exponent bits, 3 mantissa bits, + // finite-only,with NaN. + TF_FLOAT8_E4M3B11FNUZ = 27, // 4 exponent bits, 3 mantissa bits, 11 bits + // bias, finite-only, with NaNs. + TF_FLOAT8_E5M2FNUZ = 28, // 5 exponent bits, 2 mantissa bits, + // finite-only,with NaN. + TF_INT4 = 29, + TF_UINT4 = 30, + TF_INT2 = 31, + TF_UINT2 = 32; + +// TF_DataTypeSize returns the sizeof() for the underlying type corresponding +// to the given TF_DataType enum value. Returns 0 for variable length types +// (eg. TF_STRING) or on failure. +public static native @Cast("size_t") long TF_DataTypeSize(@Cast("TF_DataType") int dt); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_DATATYPE_H_ + + +// Parsed from tensorflow/c/tf_status.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_C_TF_STATUS_H_ +// #define TENSORFLOW_C_TF_STATUS_H_ + +// #include "tensorflow/c/c_api_macros.h" +// #include "xla/tsl/c/tsl_status.h" + +// #ifdef __cplusplus +// Targeting ../TF_Status.java + + + +// -------------------------------------------------------------------------- +// TF_Code holds an error code. The enum values here are identical to +// corresponding values in error_codes.proto. +// LINT.IfChange +public static final int TF_OK = TSL_OK; +public static final int TF_CANCELLED = TSL_CANCELLED; +public static final int TF_UNKNOWN = TSL_UNKNOWN; +public static final int TF_INVALID_ARGUMENT = TSL_INVALID_ARGUMENT; +public static final int TF_DEADLINE_EXCEEDED = TSL_DEADLINE_EXCEEDED; +public static final int TF_NOT_FOUND = TSL_NOT_FOUND; +public static final int TF_ALREADY_EXISTS = TSL_ALREADY_EXISTS; +public static final int TF_PERMISSION_DENIED = TSL_PERMISSION_DENIED; +public static final int TF_UNAUTHENTICATED = TSL_UNAUTHENTICATED; +public static final int TF_RESOURCE_EXHAUSTED = TSL_RESOURCE_EXHAUSTED; +public static final int TF_FAILED_PRECONDITION = TSL_FAILED_PRECONDITION; +public static final int TF_ABORTED = TSL_ABORTED; +public static final int TF_OUT_OF_RANGE = TSL_OUT_OF_RANGE; +public static final int TF_UNIMPLEMENTED = TSL_UNIMPLEMENTED; +public static final int TF_INTERNAL = TSL_INTERNAL; +public static final int TF_UNAVAILABLE = TSL_UNAVAILABLE; +public static final int TF_DATA_LOSS = TSL_DATA_LOSS; +// LINT.ThenChange(//tensorflow/python/py_exception_registry_wrapper.cc) + +// -------------------------------------------------------------------------- + +// Return a new status object. +public static native TF_Status TF_NewStatus(); + +// Delete a previously created status object. +public static native void TF_DeleteStatus(TF_Status arg0); + +// Record in *s. Any previous information is lost. +// A common use is to clear a status: TF_SetStatus(s, TF_OK, ""); +public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, + @Cast("const char*") BytePointer msg); +public static native void TF_SetStatus(TF_Status s, @Cast("TF_Code") int code, + String msg); + +// Record as a payload in *s. The previous payload having the +// same key (if any) is overwritten. Payload will not be added if the Status +// is OK. +public static native void TF_SetPayload(TF_Status s, @Cast("const char*") BytePointer key, + @Cast("const char*") BytePointer value); +public static native void TF_SetPayload(TF_Status s, String key, + String value); + +// Iterates over the stored payloads and calls the `visitor(key, value)` +// callable for each one. `key` and `value` is only usable during the callback. +// `capture` will be passed to the callback without modification. +// #define TF_PayloadVisitor TSL_PayloadVisitor + + +// Convert from an I/O error code (e.g., errno) to a TF_Status value. +// Any previous information is lost. Prefer to use this instead of TF_SetStatus +// when the error comes from I/O operations. +public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, + @Cast("const char*") BytePointer context); +public static native void TF_SetStatusFromIOError(TF_Status s, int error_code, + String context); + +// Return the code record in *s. +public static native @Cast("TF_Code") int TF_GetCode(@Const TF_Status s); + +// Return a pointer to the (null-terminated) error message in *s. The +// return value points to memory that is only usable until the next +// mutation to *s. Always returns an empty string if TF_GetCode(s) is +// TF_OK. +public static native @Cast("const char*") BytePointer TF_Message(@Const TF_Status s); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_STATUS_H_ + + +// Parsed from tensorflow/c/tf_buffer.h + +/* Copyright 2022 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_BUFFER_H_ +// #define TENSORFLOW_C_TF_BUFFER_H_ + +// #include + +// #include "tensorflow/c/c_api_macros.h" + +// #ifdef __cplusplus +// Targeting ../TF_Buffer.java + + + +// Makes a copy of the input and sets an appropriate deallocator. Useful for +// passing in read-only, input protobufs. +public static native TF_Buffer TF_NewBufferFromString(@Const Pointer proto, + @Cast("size_t") long proto_len); + +// Useful for passing *out* a protobuf. +public static native TF_Buffer TF_NewBuffer(); + +public static native void TF_DeleteBuffer(TF_Buffer arg0); + +public static native @ByVal TF_Buffer TF_GetBuffer(TF_Buffer buffer); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_BUFFER_H_ + + +// Parsed from tensorflow/c/tf_tensor.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_C_TF_TENSOR_H_ +// #define TENSORFLOW_C_TF_TENSOR_H_ + +// #include +// #include + +// #include "tensorflow/c/c_api_macros.h" +// #include "tensorflow/c/tf_datatype.h" +// #include "tensorflow/c/tf_status.h" + +// #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 + + +// Targeting ../Deallocator_Pointer_long_Pointer.java + + +public static native TF_Tensor TF_NewTensor( + @Cast("TF_DataType") int arg0, @Cast("const int64_t*") LongPointer dims, int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg); +public static native TF_Tensor TF_NewTensor( + @Cast("TF_DataType") int arg0, @Cast("const int64_t*") LongBuffer dims, int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg); +public static native TF_Tensor TF_NewTensor( + @Cast("TF_DataType") int arg0, @Cast("const int64_t*") long[] dims, int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg); + +// Returns the alignment, in bytes, required for allocating aligned tensors. +// +// This can be used in combination with TF_NewTensor to manually manage +// memory while ensuring the resulting tensors satisfy TensorFlow's +// memory alignment preferences. +public static native @Cast("size_t") long TF_TensorDefaultAlignment(); + +// Allocate and return a new Tensor. +// +// This function is an alternative to TF_NewTensor and should be used when +// memory is allocated to pass the Tensor to the C API. The allocated memory +// satisfies TensorFlow's memory alignment preferences and should be preferred +// over calling malloc and free. +// +// The caller must set the Tensor values by writing them to the pointer returned +// by TF_TensorData with length TF_TensorByteSize. +public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, + @Cast("const int64_t*") LongPointer dims, + int num_dims, @Cast("size_t") long len); +public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, + @Cast("const int64_t*") LongBuffer dims, + int num_dims, @Cast("size_t") long len); +public static native TF_Tensor TF_AllocateTensor(@Cast("TF_DataType") int arg0, + @Cast("const int64_t*") long[] dims, + int num_dims, @Cast("size_t") long len); + +// Deletes `tensor` and returns a new TF_Tensor with the same content if +// possible. Returns nullptr and leaves `tensor` untouched if not. +public static native TF_Tensor TF_TensorMaybeMove(TF_Tensor tensor); + +// Destroy a tensor. +public static native void TF_DeleteTensor(TF_Tensor arg0); + +// Return the type of a tensor element. +public static native @Cast("TF_DataType") int TF_TensorType(@Const TF_Tensor arg0); + +// Set a new shape for the Tensor. +public static native void TF_SetShape(TF_Tensor tensor, @Cast("const int64_t*") LongPointer dims, + int num_dims); +public static native void TF_SetShape(TF_Tensor tensor, @Cast("const int64_t*") LongBuffer dims, + int num_dims); +public static native void TF_SetShape(TF_Tensor tensor, @Cast("const int64_t*") long[] dims, + int num_dims); + +// Return the number of dimensions that the tensor has. +public static native int TF_NumDims(@Const TF_Tensor arg0); + +// Return the length of the tensor in the "dim_index" dimension. +// REQUIRES: 0 <= dim_index < TF_NumDims(tensor) +public static native @Cast("int64_t") long TF_Dim(@Const TF_Tensor tensor, int dim_index); + +// Return the size of the underlying data in bytes. +public static native @Cast("size_t") long TF_TensorByteSize(@Const TF_Tensor arg0); + +// Return a pointer to the underlying data buffer. +public static native Pointer TF_TensorData(@Const TF_Tensor arg0); + +// Returns the number of elements in the tensor. +public static native @Cast("int64_t") long TF_TensorElementCount(@Const TF_Tensor tensor); + +// Copy the internal data representation of `from` to `to`. `new_dims` and +// `num_new_dims` specify the new shape of the `to` tensor, `type` specifies its +// data type. On success, *status is set to TF_OK and the two tensors share the +// same data buffer. +// +// This call requires that the `from` tensor and the given type and shape (dims +// and num_dims) are "compatible" (i.e. they occupy the same number of bytes). +// Specifically, given from_type_size = TF_DataTypeSize(TF_TensorType(from)): +// +// ShapeElementCount(dims, num_dims) * TF_DataTypeSize(type) +// +// must equal +// +// TF_TensorElementCount(from) * from_type_size +// +// where TF_ShapeElementCount would be the number of elements in a tensor with +// the given shape. +// +// In addition, this function requires: +// * TF_DataTypeSize(TF_TensorType(from)) != 0 +// * TF_DataTypeSize(type) != 0 +// +// If any of the requirements are not met, *status is set to +// TF_INVALID_ARGUMENT. +public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, + @Cast("TF_DataType") int type, TF_Tensor to, + @Cast("const int64_t*") LongPointer new_dims, + int num_new_dims, + TF_Status status); +public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, + @Cast("TF_DataType") int type, TF_Tensor to, + @Cast("const int64_t*") LongBuffer new_dims, + int num_new_dims, + TF_Status status); +public static native void TF_TensorBitcastFrom(@Const TF_Tensor from, + @Cast("TF_DataType") int type, TF_Tensor to, + @Cast("const int64_t*") long[] new_dims, + int num_new_dims, + TF_Status status); + +// Returns bool iff this tensor is aligned. +public static native @Cast("bool") boolean TF_TensorIsAligned(@Const TF_Tensor arg0); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_TENSOR_H_ + + +// Parsed from tensorflow/c/tf_attrtype.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_C_TF_ATTRTYPE_H_ +// #define TENSORFLOW_C_TF_ATTRTYPE_H_ + +// #ifdef __cplusplus +// #endif + +// TF_AttrType describes the type of the value of an attribute on an operation. +/** enum TF_AttrType */ +public static final int + TF_ATTR_STRING = 0, + TF_ATTR_INT = 1, + TF_ATTR_FLOAT = 2, + TF_ATTR_BOOL = 3, + TF_ATTR_TYPE = 4, + TF_ATTR_SHAPE = 5, + TF_ATTR_TENSOR = 6, + TF_ATTR_PLACEHOLDER = 7, + TF_ATTR_FUNC = 8; + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_ATTRTYPE_H_ + + +// Parsed from tensorflow/c/c_api.h + +/* Copyright 2015 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_H_ +// #define TENSORFLOW_C_C_API_H_ + +// #include +// #include + +// #include "tensorflow/c/c_api_macros.h" +// #include "tensorflow/c/tf_attrtype.h" +// #include "tensorflow/c/tf_buffer.h" +// #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. +// +// The API leans towards simplicity and uniformity instead of convenience +// since most usage will be by language specific wrappers. +// +// Conventions: +// * We use the prefix TF_ for everything in the API. +// * Objects are always passed around as pointers to opaque structs +// and these structs are allocated/deallocated via the API. +// * TF_Status holds error information. It is an object type +// and therefore is passed around as a pointer to an opaque +// struct as mentioned above. +// * Every call that has a TF_Status* argument clears it on success +// and fills it with error info on failure. +// * unsigned char is used for booleans (instead of the 'bool' type). +// In C++ bool is a keyword while in C99 bool is a macro defined +// in stdbool.h. It is possible for the two to be inconsistent. +// For example, neither the C99 nor the C++11 standard force a byte +// size on the bool type, so the macro defined in stdbool.h could +// be inconsistent with the bool keyword in C++. Thus, the use +// of stdbool.h is avoided and unsigned char is used instead. +// * size_t is used to represent byte sizes of objects that are +// materialized in the address space of the calling process. +// * int is used as an index into arrays. +// * Deletion functions are safe to call on nullptr. +// +// Questions left to address: +// * Might at some point need a way for callers to provide their own Env. +// * Maybe add TF_TensorShape that encapsulates dimension info. +// +// Design decisions made: +// * Backing store for tensor memory has an associated deallocation +// function. This deallocation function will point to client code +// for tensors populated by the client. So the client can do things +// like shadowing a numpy array. +// * We do not provide TF_OK since it is not strictly necessary and we +// are not optimizing for convenience. +// * We make assumption that one session has one graph. This should be +// fine since we have the ability to run sub-graphs. +// * We could allow NULL for some arguments (e.g., NULL options arg). +// However since convenience is not a primary goal, we don't do this. +// * Devices are not in this API. Instead, they are created/used internally +// and the API just provides high level controls over the number of +// devices of each type. + +// #ifdef __cplusplus +// #endif + +// -------------------------------------------------------------------------- +// TF_Version returns a string describing version information of the +// TensorFlow library. TensorFlow uses semantic versioning. +public static native @Cast("const char*") BytePointer TF_Version(); + +// Parsing a serialized TensorProto into a TF_Tensor. +public static native void TF_TensorFromProto(@Const TF_Buffer from, + TF_Tensor to, TF_Status status); +// Targeting ../TF_StringView.java + + +// Targeting ../TF_SessionOptions.java + + + +// Return a new options object. +public static native TF_SessionOptions TF_NewSessionOptions(); + +// Set the target in TF_SessionOptions.options. +// target can be empty, a single entry, or a comma separated list of entries. +// Each entry is in one of the following formats : +// "local" +// ip:port +// host:port +public static native void TF_SetTarget(TF_SessionOptions options, + @Cast("const char*") BytePointer target); +public static native void TF_SetTarget(TF_SessionOptions options, + String target); + +// Set the config in TF_SessionOptions.options. +// config should be a serialized tensorflow.ConfigProto proto. +// If config was not parsed successfully as a ConfigProto, record the +// error information in *status. +public static native void TF_SetConfig(TF_SessionOptions options, + @Const Pointer proto, @Cast("size_t") long proto_len, + TF_Status status); + +// Destroy an options object. +public static native void TF_DeleteSessionOptions(TF_SessionOptions arg0); +// Targeting ../TF_Graph.java + + + +// Return a new graph object. +public static native TF_Graph TF_NewGraph(); + +// Destroy an options object. Graph will be deleted once no more +// TFSession's are referencing it. +public static native void TF_DeleteGraph(TF_Graph arg0); +// Targeting ../TF_OperationDescription.java + + +// Targeting ../TF_Operation.java + + +// Targeting ../TF_Input.java + + +// Targeting ../TF_Output.java + + +// Targeting ../TF_Function.java + + +// Targeting ../TF_FunctionOptions.java + + + +// Sets the shape of the Tensor referenced by `output` in `graph` to +// the shape described by `dims` and `num_dims`. +// +// If the number of dimensions is unknown, `num_dims` must be set to +// -1 and `dims` can be null. If a dimension is unknown, the +// corresponding entry in the `dims` array must be -1. +// +// This does not overwrite the existing shape associated with `output`, +// but merges the input shape with the existing shape. For example, +// setting a shape of [-1, 2] with an existing shape [2, -1] would set +// a final shape of [2, 2] based on shape merging semantics. +// +// Returns an error into `status` if: +// * `output` is not in `graph`. +// * An invalid shape is being set (e.g., the shape being set +// is incompatible with the existing shape). +public static native void TF_GraphSetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("const int64_t*") LongPointer dims, + int num_dims, + TF_Status status); +public static native void TF_GraphSetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("const int64_t*") LongBuffer dims, + int num_dims, + TF_Status status); +public static native void TF_GraphSetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("const int64_t*") long[] dims, + int num_dims, + TF_Status status); + +// Returns the number of dimensions of the Tensor referenced by `output` +// in `graph`. +// +// If the number of dimensions in the shape is unknown, returns -1. +// +// Returns an error into `status` if: +// * `output` is not in `graph`. +public static native int TF_GraphGetTensorNumDims(TF_Graph graph, + @ByVal TF_Output output, + TF_Status status); + +// Returns the shape of the Tensor referenced by `output` in `graph` +// into `dims`. `dims` must be an array large enough to hold `num_dims` +// entries (e.g., the return value of TF_GraphGetTensorNumDims). +// +// If the number of dimensions in the shape is unknown or the shape is +// a scalar, `dims` will remain untouched. Otherwise, each element of +// `dims` will be set corresponding to the size of the dimension. An +// unknown dimension is represented by `-1`. +// +// Returns an error into `status` if: +// * `output` is not in `graph`. +// * `num_dims` does not match the actual number of dimensions. +public static native void TF_GraphGetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("int64_t*") LongPointer dims, int num_dims, + TF_Status status); +public static native void TF_GraphGetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("int64_t*") LongBuffer dims, int num_dims, + TF_Status status); +public static native void TF_GraphGetTensorShape(TF_Graph graph, + @ByVal TF_Output output, + @Cast("int64_t*") long[] dims, int num_dims, + TF_Status status); + +// Creates a new operation - see `TF_NewOperation` for more details. +// +// The lock for `graph` must be held when calling this function. +// +// Unless implementing advanced behavior, like custom gradient functions, you +// most likely need to call `TF_NewOperation` instead. +public static native TF_OperationDescription TF_NewOperationLocked( + TF_Graph graph, @Cast("const char*") BytePointer op_type, @Cast("const char*") BytePointer oper_name); +public static native TF_OperationDescription TF_NewOperationLocked( + TF_Graph graph, String op_type, String oper_name); + +// Operation will only be added to *graph when TF_FinishOperation() is +// called (assuming TF_FinishOperation() does not return an error). +// *graph must not be deleted until after TF_FinishOperation() is +// called. +public static native TF_OperationDescription TF_NewOperation( + TF_Graph graph, @Cast("const char*") BytePointer op_type, @Cast("const char*") BytePointer oper_name); +public static native TF_OperationDescription TF_NewOperation( + TF_Graph graph, String op_type, String oper_name); + +// Specify the device for `desc`. Defaults to empty, meaning unconstrained. +public static native void TF_SetDevice(TF_OperationDescription desc, + @Cast("const char*") BytePointer device); +public static native void TF_SetDevice(TF_OperationDescription desc, + String device); + +// The calls to TF_AddInput and TF_AddInputList must match (in number, +// order, and type) the op declaration. For example, the "Concat" op +// has registration: +// REGISTER_OP("Concat") +// .Input("concat_dim: int32") +// .Input("values: N * T") +// .Output("output: T") +// .Attr("N: int >= 2") +// .Attr("T: type"); +// that defines two inputs, "concat_dim" and "values" (in that order). +// You must use TF_AddInput() for the first input (since it takes a +// single tensor), and TF_AddInputList() for the second input (since +// it takes a list, even if you were to pass a list with a single +// tensor), as in: +// TF_OperationDescription* desc = TF_NewOperation(graph, "Concat", "c"); +// TF_Output concat_dim_input = {...}; +// TF_AddInput(desc, concat_dim_input); +// TF_Output values_inputs[5] = {{...}, ..., {...}}; +// TF_AddInputList(desc, values_inputs, 5); + +// For inputs that take a single tensor. +public static native void TF_AddInput(TF_OperationDescription desc, + @ByVal TF_Output input); + +// For inputs that take a list of tensors. +// inputs must point to TF_Output[num_inputs]. +public static native void TF_AddInputList(TF_OperationDescription desc, + @Const TF_Output inputs, + int num_inputs); + +// Call once per control input to `desc`. +public static native void TF_AddControlInput(TF_OperationDescription desc, + TF_Operation input); + +// Request that `desc` be co-located on the device where `op` +// is placed. +// +// Use of this is discouraged since the implementation of device placement is +// subject to change. Primarily intended for internal libraries +public static native void TF_ColocateWith(TF_OperationDescription desc, + TF_Operation op); + +// Call some TF_SetAttr*() function for every attr that is not +// inferred from an input and doesn't have a default value you wish to +// keep. + +// `value` must point to a string of length `length` bytes. +public static native void TF_SetAttrString(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Const Pointer value, @Cast("size_t") long length); +public static native void TF_SetAttrString(TF_OperationDescription desc, + String attr_name, + @Const Pointer value, @Cast("size_t") long length); +// `values` and `lengths` each must have lengths `num_values`. +// `values[i]` must point to a string of length `lengths[i]` bytes. +public static native void TF_SetAttrStringList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") PointerPointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TF_SetAttrStringList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TF_SetAttrStringList(TF_OperationDescription desc, + String attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TF_SetAttrInt(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, @Cast("int64_t") long value); +public static native void TF_SetAttrInt(TF_OperationDescription desc, + String attr_name, @Cast("int64_t") long value); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongPointer values, + int num_values); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") LongBuffer values, + int num_values); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") long[] values, + int num_values); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") LongPointer values, + int num_values); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongBuffer values, + int num_values); +public static native void TF_SetAttrIntList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") long[] values, + int num_values); +public static native void TF_SetAttrFloat(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, float value); +public static native void TF_SetAttrFloat(TF_OperationDescription desc, + String attr_name, float value); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Const FloatPointer values, + int num_values); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + String attr_name, + @Const FloatBuffer values, + int num_values); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Const float[] values, + int num_values); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + String attr_name, + @Const FloatPointer values, + int num_values); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Const FloatBuffer values, + int num_values); +public static native void TF_SetAttrFloatList(TF_OperationDescription desc, + String attr_name, + @Const float[] values, + int num_values); +public static native void TF_SetAttrBool(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char") byte value); +public static native void TF_SetAttrBool(TF_OperationDescription desc, + String attr_name, + @Cast("unsigned char") byte value); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") BytePointer values, + int num_values); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + String attr_name, + @Cast("const unsigned char*") ByteBuffer values, + int num_values); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") byte[] values, + int num_values); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + String attr_name, + @Cast("const unsigned char*") BytePointer values, + int num_values); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") ByteBuffer values, + int num_values); +public static native void TF_SetAttrBoolList(TF_OperationDescription desc, + String attr_name, + @Cast("const unsigned char*") byte[] values, + int num_values); +public static native void TF_SetAttrType(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType") int value); +public static native void TF_SetAttrType(TF_OperationDescription desc, + String attr_name, + @Cast("TF_DataType") int value); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + String attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + String attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TF_SetAttrTypeList(TF_OperationDescription desc, + String attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); +public static native void TF_SetAttrPlaceholder(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const char*") BytePointer placeholder); +public static native void TF_SetAttrPlaceholder(TF_OperationDescription desc, + String attr_name, + String placeholder); + +// Set a 'func' attribute to the specified name. +// `value` must point to a string of length `length` bytes. +public static native void TF_SetAttrFuncName(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const char*") BytePointer value, @Cast("size_t") long length); +public static native void TF_SetAttrFuncName(TF_OperationDescription desc, + String attr_name, + String value, @Cast("size_t") long length); + +// Set `num_dims` to -1 to represent "unknown rank". Otherwise, +// `dims` points to an array of length `num_dims`. `dims[i]` must be +// >= -1, with -1 meaning "unknown dimension". +public static native void TF_SetAttrShape(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongPointer dims, int num_dims); +public static native void TF_SetAttrShape(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") LongBuffer dims, int num_dims); +public static native void TF_SetAttrShape(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") long[] dims, int num_dims); +public static native void TF_SetAttrShape(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") LongPointer dims, int num_dims); +public static native void TF_SetAttrShape(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongBuffer dims, int num_dims); +public static native void TF_SetAttrShape(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*") long[] dims, int num_dims); +// `dims` and `num_dims` must point to arrays of length `num_shapes`. +// Set `num_dims[i]` to -1 to represent "unknown rank". Otherwise, +// `dims[i]` points to an array of length `num_dims[i]`. `dims[i][j]` +// must be >= -1, with -1 meaning "unknown dimension". +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*const*") PointerPointer dims, + @Const IntPointer num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*const*") @ByPtrPtr LongPointer dims, + @Const IntPointer num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*const*") @ByPtrPtr LongBuffer dims, + @Const IntBuffer num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*const*") @ByPtrPtr long[] dims, + @Const int[] num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*const*") @ByPtrPtr LongPointer dims, + @Const IntPointer num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*const*") @ByPtrPtr LongBuffer dims, + @Const IntBuffer num_dims, + int num_shapes); +public static native void TF_SetAttrShapeList(TF_OperationDescription desc, + String attr_name, + @Cast("const int64_t*const*") @ByPtrPtr long[] dims, + @Const int[] num_dims, + int num_shapes); +// `proto` must point to an array of `proto_len` bytes representing a +// binary-serialized TensorShapeProto. +public static native void TF_SetAttrTensorShapeProto( + TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, @Const Pointer proto, + @Cast("size_t") long proto_len, TF_Status status); +public static native void TF_SetAttrTensorShapeProto( + TF_OperationDescription desc, String attr_name, @Const Pointer proto, + @Cast("size_t") long proto_len, TF_Status status); +// `protos` and `proto_lens` must point to arrays of length `num_shapes`. +// `protos[i]` must point to an array of `proto_lens[i]` bytes +// representing a binary-serialized TensorShapeProto. +public static native void TF_SetAttrTensorShapeProtoList( + TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") PointerPointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, + TF_Status status); +public static native void TF_SetAttrTensorShapeProtoList( + TF_OperationDescription desc, @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, + TF_Status status); +public static native void TF_SetAttrTensorShapeProtoList( + TF_OperationDescription desc, String attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer protos, @Cast("const size_t*") SizeTPointer proto_lens, int num_shapes, + TF_Status status); + +public static native void TF_SetAttrTensor(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + TF_Tensor value, + TF_Status status); +public static native void TF_SetAttrTensor(TF_OperationDescription desc, + String attr_name, + TF_Tensor value, + TF_Status status); +public static native void TF_SetAttrTensorList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_Tensor*const*") PointerPointer values, + int num_values, + TF_Status status); +public static native void TF_SetAttrTensorList(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @ByPtrPtr TF_Tensor values, + int num_values, + TF_Status status); +public static native void TF_SetAttrTensorList(TF_OperationDescription desc, + String attr_name, + @ByPtrPtr TF_Tensor values, + int num_values, + TF_Status status); + +// `proto` should point to a sequence of bytes of length `proto_len` +// representing a binary serialization of an AttrValue protocol +// buffer. +public static native void TF_SetAttrValueProto(TF_OperationDescription desc, + @Cast("const char*") BytePointer attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); +public static native void TF_SetAttrValueProto(TF_OperationDescription desc, + String attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// Adds this operation to the graph - see `TF_FinishOperation` for more details. +// +// The lock for `graph` must be held when calling this function. +// +// Unless implementing advanced behavior, like custom gradient functions, you +// most likely need to call `TF_FinishOperation` instead. +public static native TF_Operation TF_FinishOperationLocked( + TF_OperationDescription desc, TF_Status status); + +// If this function succeeds: +// * *status is set to an OK value, +// * a TF_Operation is added to the graph, +// * a non-null value pointing to the added operation is returned -- +// this value is valid until the underlying graph is deleted. +// Otherwise: +// * *status is set to a non-OK value, +// * the graph is not modified, +// * a null value is returned. +// In either case, it deletes `desc`. +public static native TF_Operation TF_FinishOperation( + TF_OperationDescription desc, TF_Status status); + +// TF_Operation functions. Operations are immutable once created, so +// these are all query functions. + +public static native @Cast("const char*") BytePointer TF_OperationName(TF_Operation oper); +public static native @Cast("const char*") BytePointer TF_OperationOpType(TF_Operation oper); +public static native @Cast("const char*") BytePointer TF_OperationDevice(TF_Operation oper); + +public static native int TF_OperationNumOutputs(TF_Operation oper); +public static native @Cast("TF_DataType") int TF_OperationOutputType(@ByVal TF_Output oper_out); +public static native int TF_OperationOutputListLength(TF_Operation oper, + @Cast("const char*") BytePointer arg_name, + TF_Status status); +public static native int TF_OperationOutputListLength(TF_Operation oper, + String arg_name, + TF_Status status); + +public static native int TF_OperationNumInputs(TF_Operation oper); +public static native @Cast("TF_DataType") int TF_OperationInputType(@ByVal TF_Input oper_in); +public static native int TF_OperationInputListLength(TF_Operation oper, + @Cast("const char*") BytePointer arg_name, + TF_Status status); +public static native int TF_OperationInputListLength(TF_Operation oper, + String arg_name, + TF_Status status); + +// In this code: +// TF_Output producer = TF_OperationInput(consumer); +// There is an edge from producer.oper's output (given by +// producer.index) to consumer.oper's input (given by consumer.index). +public static native @ByVal TF_Output TF_OperationInput(@ByVal TF_Input oper_in); + +// Get list of all inputs of a specific operation. `inputs` must point to +// an array of length at least `max_inputs` (ideally set to +// TF_OperationNumInputs(oper)). Beware that a concurrent +// modification of the graph can increase the number of inputs of +// an operation. +public static native void TF_OperationAllInputs(TF_Operation oper, + TF_Output inputs, + int max_inputs); + +// Get the number of current consumers of a specific output of an +// operation. Note that this number can change when new operations +// are added to the graph. +public static native int TF_OperationOutputNumConsumers(@ByVal TF_Output oper_out); + +// Get list of all current consumers of a specific output of an +// operation. `consumers` must point to an array of length at least +// `max_consumers` (ideally set to +// TF_OperationOutputNumConsumers(oper_out)). Beware that a concurrent +// modification of the graph can increase the number of consumers of +// an operation. Returns the number of output consumers (should match +// TF_OperationOutputNumConsumers(oper_out)). +public static native int TF_OperationOutputConsumers(@ByVal TF_Output oper_out, + TF_Input consumers, + int max_consumers); + +// Get the number of control inputs to an operation. +public static native int TF_OperationNumControlInputs(TF_Operation oper); + +// Get list of all control inputs to an operation. `control_inputs` must +// point to an array of length `max_control_inputs` (ideally set to +// TF_OperationNumControlInputs(oper)). Returns the number of control +// inputs (should match TF_OperationNumControlInputs(oper)). +public static native int TF_OperationGetControlInputs( + TF_Operation oper, @Cast("TF_Operation**") PointerPointer control_inputs, int max_control_inputs); +public static native int TF_OperationGetControlInputs( + TF_Operation oper, @ByPtrPtr TF_Operation control_inputs, int max_control_inputs); + +// Get the number of operations that have `*oper` as a control input. +// Note that this number can change when new operations are added to +// the graph. +public static native int TF_OperationNumControlOutputs(TF_Operation oper); + +// Get the list of operations that have `*oper` as a control input. +// `control_outputs` must point to an array of length at least +// `max_control_outputs` (ideally set to +// TF_OperationNumControlOutputs(oper)). Beware that a concurrent +// modification of the graph can increase the number of control +// outputs. Returns the number of control outputs (should match +// TF_OperationNumControlOutputs(oper)). +public static native int TF_OperationGetControlOutputs( + TF_Operation oper, @Cast("TF_Operation**") PointerPointer control_outputs, + int max_control_outputs); +public static native int TF_OperationGetControlOutputs( + TF_Operation oper, @ByPtrPtr TF_Operation control_outputs, + int max_control_outputs); +// Targeting ../TF_AttrMetadata.java + + + +// Returns metadata about the value of the attribute `attr_name` of `oper`. +public static native @ByVal TF_AttrMetadata TF_OperationGetAttrMetadata( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Status status); +public static native @ByVal TF_AttrMetadata TF_OperationGetAttrMetadata( + TF_Operation oper, String attr_name, TF_Status status); + +// Fills in `value` with the value of the attribute `attr_name`. `value` must +// point to an array of length at least `max_length` (ideally set to +// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, +// attr_name)). +public static native void TF_OperationGetAttrString(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + Pointer value, + @Cast("size_t") long max_length, + TF_Status status); +public static native void TF_OperationGetAttrString(TF_Operation oper, + String attr_name, + Pointer value, + @Cast("size_t") long max_length, + TF_Status status); + +// Get the list of strings in the value of the attribute `attr_name`. Fills in +// `values` and `lengths`, each of which must point to an array of length at +// least `max_values`. +// +// The elements of values will point to addresses in `storage` which must be at +// least `storage_size` bytes in length. Ideally, max_values would be set to +// TF_AttrMetadata.list_size and `storage` would be at least +// TF_AttrMetadata.total_size, obtained from TF_OperationGetAttrMetadata(oper, +// attr_name). +// +// Fails if storage_size is too small to hold the requested number of strings. +public static native void TF_OperationGetAttrStringList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("void**") PointerPointer values, @Cast("size_t*") SizeTPointer lengths, + int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); +public static native void TF_OperationGetAttrStringList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("void**") @ByPtrPtr Pointer values, @Cast("size_t*") SizeTPointer lengths, + int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); +public static native void TF_OperationGetAttrStringList( + TF_Operation oper, String attr_name, @Cast("void**") @ByPtrPtr Pointer values, @Cast("size_t*") SizeTPointer lengths, + int max_values, Pointer storage, @Cast("size_t") long storage_size, TF_Status status); + +public static native void TF_OperationGetAttrInt(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongPointer value, + TF_Status status); +public static native void TF_OperationGetAttrInt(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrInt(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") long[] value, + TF_Status status); +public static native void TF_OperationGetAttrInt(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongPointer value, + TF_Status status); +public static native void TF_OperationGetAttrInt(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrInt(TF_Operation oper, + String attr_name, + @Cast("int64_t*") long[] value, + TF_Status status); + +// Fills in `values` with the value of the attribute `attr_name` of `oper`. +// `values` must point to an array of length at least `max_values` (ideally set +// TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, +// attr_name)). +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") long[] values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrIntList(TF_Operation oper, + String attr_name, + @Cast("int64_t*") long[] values, + int max_values, + TF_Status status); + +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + FloatPointer value, + TF_Status status); +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + String attr_name, + FloatBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + float[] value, + TF_Status status); +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + String attr_name, + FloatPointer value, + TF_Status status); +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + FloatBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrFloat(TF_Operation oper, + String attr_name, + float[] value, + TF_Status status); + +// Fills in `values` with the value of the attribute `attr_name` of `oper`. +// `values` must point to an array of length at least `max_values` (ideally set +// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, +// attr_name)). +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + FloatPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + String attr_name, + FloatBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + float[] values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + String attr_name, + FloatPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + FloatBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrFloatList(TF_Operation oper, + String attr_name, + float[] values, + int max_values, + TF_Status status); + +public static native void TF_OperationGetAttrBool(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") BytePointer value, + TF_Status status); +public static native void TF_OperationGetAttrBool(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") ByteBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrBool(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") byte[] value, + TF_Status status); +public static native void TF_OperationGetAttrBool(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") BytePointer value, + TF_Status status); +public static native void TF_OperationGetAttrBool(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") ByteBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrBool(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") byte[] value, + TF_Status status); + +// Fills in `values` with the value of the attribute `attr_name` of `oper`. +// `values` must point to an array of length at least `max_values` (ideally set +// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, +// attr_name)). +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") BytePointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") ByteBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") byte[] values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") BytePointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") ByteBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrBoolList(TF_Operation oper, + String attr_name, + @Cast("unsigned char*") byte[] values, + int max_values, + TF_Status status); + +public static native void TF_OperationGetAttrType(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") IntPointer value, + TF_Status status); +public static native void TF_OperationGetAttrType(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") IntBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrType(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") int[] value, + TF_Status status); +public static native void TF_OperationGetAttrType(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") IntPointer value, + TF_Status status); +public static native void TF_OperationGetAttrType(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") IntBuffer value, + TF_Status status); +public static native void TF_OperationGetAttrType(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") int[] value, + TF_Status status); + +// Fills in `values` with the value of the attribute `attr_name` of `oper`. +// `values` must point to an array of length at least `max_values` (ideally set +// to TF_AttrMetadata.list_size from TF_OperationGetAttrMetadata(oper, +// attr_name)). +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") IntPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") IntBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") int[] values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") IntPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType*") IntBuffer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTypeList(TF_Operation oper, + String attr_name, + @Cast("TF_DataType*") int[] values, + int max_values, + TF_Status status); + +// Fills in `value` with the value of the attribute `attr_name` of `oper`. +// `values` must point to an array of length at least `num_dims` (ideally set to +// TF_Attr_Meta.size from TF_OperationGetAttrMetadata(oper, attr_name)). +public static native void TF_OperationGetAttrShape(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongPointer value, + int num_dims, + TF_Status status); +public static native void TF_OperationGetAttrShape(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongBuffer value, + int num_dims, + TF_Status status); +public static native void TF_OperationGetAttrShape(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") long[] value, + int num_dims, + TF_Status status); +public static native void TF_OperationGetAttrShape(TF_Operation oper, + String attr_name, + @Cast("int64_t*") LongPointer value, + int num_dims, + TF_Status status); +public static native void TF_OperationGetAttrShape(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("int64_t*") LongBuffer value, + int num_dims, + TF_Status status); +public static native void TF_OperationGetAttrShape(TF_Operation oper, + String attr_name, + @Cast("int64_t*") long[] value, + int num_dims, + TF_Status status); + +// Fills in `dims` with the list of shapes in the attribute `attr_name` of +// `oper` and `num_dims` with the corresponding number of dimensions. On return, +// for every i where `num_dims[i]` > 0, `dims[i]` will be an array of +// `num_dims[i]` elements. A value of -1 for `num_dims[i]` indicates that the +// i-th shape in the list is unknown. +// +// The elements of `dims` will point to addresses in `storage` which must be +// large enough to hold at least `storage_size` int64_ts. Ideally, `num_shapes` +// would be set to TF_AttrMetadata.list_size and `storage_size` would be set to +// TF_AttrMetadata.total_size from TF_OperationGetAttrMetadata(oper, +// attr_name). +// +// Fails if storage_size is insufficient to hold the requested shapes. +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") PointerPointer dims, IntPointer num_dims, + int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr LongPointer dims, IntPointer num_dims, + int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr LongBuffer dims, IntBuffer num_dims, + int num_shapes, @Cast("int64_t*") LongBuffer storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr long[] dims, int[] num_dims, + int num_shapes, @Cast("int64_t*") long[] storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr LongPointer dims, IntPointer num_dims, + int num_shapes, @Cast("int64_t*") LongPointer storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("int64_t**") @ByPtrPtr LongBuffer dims, IntBuffer num_dims, + int num_shapes, @Cast("int64_t*") LongBuffer storage, int storage_size, TF_Status status); +public static native void TF_OperationGetAttrShapeList( + TF_Operation oper, String attr_name, @Cast("int64_t**") @ByPtrPtr long[] dims, int[] num_dims, + int num_shapes, @Cast("int64_t*") long[] storage, int storage_size, TF_Status status); + +// Sets `value` to the binary-serialized TensorShapeProto of the value of +// `attr_name` attribute of `oper`. +public static native void TF_OperationGetAttrTensorShapeProto( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Buffer value, + TF_Status status); +public static native void TF_OperationGetAttrTensorShapeProto( + TF_Operation oper, String attr_name, TF_Buffer value, + TF_Status status); + +// Fills in `values` with binary-serialized TensorShapeProto values of the +// attribute `attr_name` of `oper`. `values` must point to an array of length at +// least `num_values` (ideally set to TF_AttrMetadata.list_size from +// TF_OperationGetAttrMetadata(oper, attr_name)). +public static native void TF_OperationGetAttrTensorShapeProtoList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @Cast("TF_Buffer**") PointerPointer values, + int max_values, TF_Status status); +public static native void TF_OperationGetAttrTensorShapeProtoList( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, @ByPtrPtr TF_Buffer values, + int max_values, TF_Status status); +public static native void TF_OperationGetAttrTensorShapeProtoList( + TF_Operation oper, String attr_name, @ByPtrPtr TF_Buffer values, + int max_values, TF_Status status); + +// Gets the TF_Tensor valued attribute of `attr_name` of `oper`. +// +// Allocates a new TF_Tensor which the caller is expected to take +// ownership of (and can deallocate using TF_DeleteTensor). +public static native void TF_OperationGetAttrTensor(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_Tensor**") PointerPointer value, + TF_Status status); +public static native void TF_OperationGetAttrTensor(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @ByPtrPtr TF_Tensor value, + TF_Status status); +public static native void TF_OperationGetAttrTensor(TF_Operation oper, + String attr_name, + @ByPtrPtr TF_Tensor value, + TF_Status status); + +// Fills in `values` with the TF_Tensor values of the attribute `attr_name` of +// `oper`. `values` must point to an array of TF_Tensor* of length at least +// `max_values` (ideally set to TF_AttrMetadata.list_size from +// TF_OperationGetAttrMetadata(oper, attr_name)). +// +// The caller takes ownership of all the non-null TF_Tensor* entries in `values` +// (which can be deleted using TF_DeleteTensor(values[i])). +public static native void TF_OperationGetAttrTensorList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_Tensor**") PointerPointer values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTensorList(TF_Operation oper, + @Cast("const char*") BytePointer attr_name, + @ByPtrPtr TF_Tensor values, + int max_values, + TF_Status status); +public static native void TF_OperationGetAttrTensorList(TF_Operation oper, + String attr_name, + @ByPtrPtr TF_Tensor values, + int max_values, + TF_Status status); + +// Sets `output_attr_value` to the binary-serialized AttrValue proto +// representation of the value of the `attr_name` attr of `oper`. +public static native void TF_OperationGetAttrValueProto( + TF_Operation oper, @Cast("const char*") BytePointer attr_name, TF_Buffer output_attr_value, + TF_Status status); +public static native void TF_OperationGetAttrValueProto( + TF_Operation oper, String attr_name, TF_Buffer output_attr_value, + TF_Status status); + +// Get the number of attributes the operation has. +public static native int TF_OperationGetNumAttrs(TF_Operation oper); + +// Get the length of the name of the ith attribute, or -1 if there is not an +// ith attribute. +public static native int TF_OperationGetAttrNameLength(TF_Operation oper, + int i); + +// Get the name of the ith attribute. output should have the size of +// TF_OperationGetAttrNameLength(oper, i). +public static native void TF_OperationGetAttrName(TF_Operation oper, int i, + @Cast("char*") BytePointer output, + TF_Status status); +public static native void TF_OperationGetAttrName(TF_Operation oper, int i, + @Cast("char*") ByteBuffer output, + TF_Status status); +public static native void TF_OperationGetAttrName(TF_Operation oper, int i, + @Cast("char*") byte[] output, + TF_Status status); + +// Returns the operation in the graph with `oper_name`. Returns nullptr if +// no operation found. +public static native TF_Operation TF_GraphOperationByName( + TF_Graph graph, @Cast("const char*") BytePointer oper_name); +public static native TF_Operation TF_GraphOperationByName( + TF_Graph graph, String oper_name); + +// Iterate through the operations of a graph. To use: +// size_t pos = 0; +// TF_Operation* oper; +// while ((oper = TF_GraphNextOperation(graph, &pos)) != nullptr) { +// DoSomethingWithOperation(oper); +// } +public static native TF_Operation TF_GraphNextOperation(TF_Graph graph, + @Cast("size_t*") SizeTPointer pos); + +// Write out a serialized representation of `graph` (as a GraphDef protocol +// message) to `output_graph_def` (allocated by TF_NewBuffer()). +// `output_graph_def`'s underlying buffer will be freed when TF_DeleteBuffer() +// is called. +// +// May fail on very large graphs in the future. +public static native void TF_GraphToGraphDef(TF_Graph graph, + TF_Buffer output_graph_def, + TF_Status status); + +// Returns the serialized OpDef proto with name `op_name`, or a bad status if no +// such op exists. This can return OpDefs of functions copied into the graph. +public static native void TF_GraphGetOpDef(TF_Graph graph, + @Cast("const char*") BytePointer op_name, + TF_Buffer output_op_def, + TF_Status status); +public static native void TF_GraphGetOpDef(TF_Graph graph, + String op_name, + TF_Buffer output_op_def, + TF_Status status); + +// Returns the serialized VersionDef proto for this graph. +public static native void TF_GraphVersions(TF_Graph graph, + TF_Buffer output_version_def, + TF_Status status); +// Targeting ../TF_ImportGraphDefOptions.java + + + +public static native TF_ImportGraphDefOptions TF_NewImportGraphDefOptions(); +public static native void TF_DeleteImportGraphDefOptions( + TF_ImportGraphDefOptions opts); + +// Set the prefix to be prepended to the names of nodes in `graph_def` that will +// be imported into `graph`. `prefix` is copied and has no lifetime +// requirements. +public static native void TF_ImportGraphDefOptionsSetPrefix( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer prefix); +public static native void TF_ImportGraphDefOptionsSetPrefix( + TF_ImportGraphDefOptions opts, String prefix); + +// Set the execution device for nodes in `graph_def`. +// Only applies to nodes where a device was not already explicitly specified. +// `device` is copied and has no lifetime requirements. +public static native void TF_ImportGraphDefOptionsSetDefaultDevice( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer device); +public static native void TF_ImportGraphDefOptionsSetDefaultDevice( + TF_ImportGraphDefOptions opts, String device); + +// Set whether to uniquify imported operation names. If true, imported operation +// names will be modified if their name already exists in the graph. If false, +// conflicting names will be treated as an error. Note that this option has no +// effect if a prefix is set, since the prefix will guarantee all names are +// unique. Defaults to false. +public static native void TF_ImportGraphDefOptionsSetUniquifyNames( + TF_ImportGraphDefOptions opts, @Cast("unsigned char") byte uniquify_names); + +// If true, the specified prefix will be modified if it already exists as an +// operation name or prefix in the graph. If false, a conflicting prefix will be +// treated as an error. This option has no effect if no prefix is specified. +public static native void TF_ImportGraphDefOptionsSetUniquifyPrefix( + TF_ImportGraphDefOptions opts, @Cast("unsigned char") byte uniquify_prefix); + +// Set any imported nodes with input `src_name:src_index` to have that input +// replaced with `dst`. `src_name` refers to a node in the graph to be imported, +// `dst` references a node already existing in the graph being imported into. +// `src_name` is copied and has no lifetime requirements. +public static native void TF_ImportGraphDefOptionsAddInputMapping( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer src_name, int src_index, + @ByVal TF_Output dst); +public static native void TF_ImportGraphDefOptionsAddInputMapping( + TF_ImportGraphDefOptions opts, String src_name, int src_index, + @ByVal TF_Output dst); + +// Set any imported nodes with control input `src_name` to have that input +// replaced with `dst`. `src_name` refers to a node in the graph to be imported, +// `dst` references an operation already existing in the graph being imported +// into. `src_name` is copied and has no lifetime requirements. +public static native void TF_ImportGraphDefOptionsRemapControlDependency( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer src_name, TF_Operation dst); +public static native void TF_ImportGraphDefOptionsRemapControlDependency( + TF_ImportGraphDefOptions opts, String src_name, TF_Operation dst); + +// Cause the imported graph to have a control dependency on `oper`. `oper` +// should exist in the graph being imported into. +public static native void TF_ImportGraphDefOptionsAddControlDependency( + TF_ImportGraphDefOptions opts, TF_Operation oper); + +// Add an output in `graph_def` to be returned via the `return_outputs` output +// parameter of TF_GraphImportGraphDef(). If the output is remapped via an input +// mapping, the corresponding existing tensor in `graph` will be returned. +// `oper_name` is copied and has no lifetime requirements. +public static native void TF_ImportGraphDefOptionsAddReturnOutput( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer oper_name, int index); +public static native void TF_ImportGraphDefOptionsAddReturnOutput( + TF_ImportGraphDefOptions opts, String oper_name, int index); + +// Returns the number of return outputs added via +// TF_ImportGraphDefOptionsAddReturnOutput(). +public static native int TF_ImportGraphDefOptionsNumReturnOutputs( + @Const TF_ImportGraphDefOptions opts); + +// Add an operation in `graph_def` to be returned via the `return_opers` output +// parameter of TF_GraphImportGraphDef(). `oper_name` is copied and has no +// lifetime requirements. +public static native void TF_ImportGraphDefOptionsAddReturnOperation( + TF_ImportGraphDefOptions opts, @Cast("const char*") BytePointer oper_name); +public static native void TF_ImportGraphDefOptionsAddReturnOperation( + TF_ImportGraphDefOptions opts, String oper_name); + +// Returns the number of return operations added via +// TF_ImportGraphDefOptionsAddReturnOperation(). +public static native int TF_ImportGraphDefOptionsNumReturnOperations( + @Const TF_ImportGraphDefOptions opts); +// Targeting ../TF_ImportGraphDefResults.java + + + +// Fetches the return outputs requested via +// TF_ImportGraphDefOptionsAddReturnOutput(). The number of fetched outputs is +// returned in `num_outputs`. The array of return outputs is returned in +// `outputs`. `*outputs` is owned by and has the lifetime of `results`. +public static native void TF_ImportGraphDefResultsReturnOutputs( + TF_ImportGraphDefResults results, IntPointer num_outputs, @Cast("TF_Output**") PointerPointer outputs); +public static native void TF_ImportGraphDefResultsReturnOutputs( + TF_ImportGraphDefResults results, IntPointer num_outputs, @ByPtrPtr TF_Output outputs); +public static native void TF_ImportGraphDefResultsReturnOutputs( + TF_ImportGraphDefResults results, IntBuffer num_outputs, @ByPtrPtr TF_Output outputs); +public static native void TF_ImportGraphDefResultsReturnOutputs( + TF_ImportGraphDefResults results, int[] num_outputs, @ByPtrPtr TF_Output outputs); + +// Fetches the return operations requested via +// TF_ImportGraphDefOptionsAddReturnOperation(). The number of fetched +// operations is returned in `num_opers`. The array of return operations is +// returned in `opers`. `*opers` is owned by and has the lifetime of `results`. +public static native void TF_ImportGraphDefResultsReturnOperations( + TF_ImportGraphDefResults results, IntPointer num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); +public static native void TF_ImportGraphDefResultsReturnOperations( + TF_ImportGraphDefResults results, IntBuffer num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); +public static native void TF_ImportGraphDefResultsReturnOperations( + TF_ImportGraphDefResults results, int[] num_opers, @Cast("TF_Operation***") @ByPtrPtr PointerPointer opers); + +// Fetches any input mappings requested via +// TF_ImportGraphDefOptionsAddInputMapping() that didn't appear in the GraphDef +// and weren't used as input to any node in the imported graph def. The number +// of fetched mappings is returned in `num_missing_unused_input_mappings`. The +// array of each mapping's source node name is returned in `src_names`, and the +// array of each mapping's source index is returned in `src_indexes`. +// +// `*src_names`, `*src_indexes`, and the memory backing each string in +// `src_names` are owned by and have the lifetime of `results`. +public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( + TF_ImportGraphDefResults results, IntPointer num_missing_unused_input_mappings, + @Cast("const char***") @ByPtrPtr PointerPointer src_names, @Cast("int**") PointerPointer src_indexes); +public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( + TF_ImportGraphDefResults results, IntPointer num_missing_unused_input_mappings, + @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr IntPointer src_indexes); +public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( + TF_ImportGraphDefResults results, IntBuffer num_missing_unused_input_mappings, + @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr IntBuffer src_indexes); +public static native void TF_ImportGraphDefResultsMissingUnusedInputMappings( + TF_ImportGraphDefResults results, int[] num_missing_unused_input_mappings, + @Cast("const char***") @ByPtrPtr PointerPointer src_names, @ByPtrPtr int[] src_indexes); + +// Deletes a results object returned by TF_GraphImportGraphDefWithResults(). +public static native void TF_DeleteImportGraphDefResults( + TF_ImportGraphDefResults results); + +// Import the graph serialized in `graph_def` into `graph`. Returns nullptr and +// a bad status on error. Otherwise, returns a populated +// TF_ImportGraphDefResults instance. The returned instance must be deleted via +// TF_DeleteImportGraphDefResults(). +public static native TF_ImportGraphDefResults TF_GraphImportGraphDefWithResults(TF_Graph graph, @Const TF_Buffer graph_def, + @Const TF_ImportGraphDefOptions options, + TF_Status status); + +// Has the same behavior as TF_GraphImportGraphDefWithResults, but instead of +// taking in a serialized tensorflow::GraphDef, it takes in a *pointer* to the +// C++ *in memory representation* of the GraphDef, stored in `graph_def->data` +public static native TF_ImportGraphDefResults TF_GraphImportGraphDefWithResultsNoSerialization( + TF_Graph graph, @Const TF_Buffer graph_def, + @Const TF_ImportGraphDefOptions options, TF_Status status); + +// Import the graph serialized in `graph_def` into `graph`. +// Convenience function for when only return outputs are needed. +// +// `num_return_outputs` must be the number of return outputs added (i.e. the +// result of TF_ImportGraphDefOptionsNumReturnOutputs()). If +// `num_return_outputs` is non-zero, `return_outputs` must be of length +// `num_return_outputs`. Otherwise it can be null. +public static native void TF_GraphImportGraphDefWithReturnOutputs( + TF_Graph graph, @Const TF_Buffer graph_def, + @Const TF_ImportGraphDefOptions options, TF_Output return_outputs, + int num_return_outputs, TF_Status status); + +// Import the graph serialized in `graph_def` into `graph`. +// Convenience function for when no results are needed. +public static native void TF_GraphImportGraphDef( + TF_Graph graph, @Const TF_Buffer graph_def, + @Const TF_ImportGraphDefOptions options, TF_Status status); + +// Adds a copy of function `func` and optionally its gradient function `grad` +// to `g`. Once `func`/`grad` is added to `g`, it can be called by creating +// an operation using the function's name. +// Any changes to `func`/`grad` (including deleting it) done after this method +// returns, won't affect the copy of `func`/`grad` in `g`. +// If `func` or `grad` are already in `g`, TF_GraphCopyFunction has no +// effect on them, but can establish the function->gradient relationship +// between them if `func` does not already have a gradient. If `func` already +// has a gradient different from `grad`, an error is returned. +// +// `func` must not be null. +// If `grad` is null and `func` is not in `g`, `func` is added without a +// gradient. +// If `grad` is null and `func` is in `g`, TF_GraphCopyFunction is a noop. +// `grad` must have appropriate signature as described in the doc of +// GradientDef in tensorflow/core/framework/function.proto. +// +// If successful, status is set to OK and `func` and `grad` are added to `g`. +// Otherwise, status is set to the encountered error and `g` is unmodified. +public static native void TF_GraphCopyFunction(TF_Graph g, + @Const TF_Function func, + @Const TF_Function grad, + TF_Status status); + +// Returns the number of TF_Functions registered in `g`. +public static native int TF_GraphNumFunctions(TF_Graph g); + +// Fills in `funcs` with the TF_Function* registered in `g`. +// `funcs` must point to an array of TF_Function* of length at least +// `max_func`. In usual usage, max_func should be set to the result of +// TF_GraphNumFunctions(g). In this case, all the functions registered in +// `g` will be returned. Else, an unspecified subset. +// +// If successful, returns the number of TF_Function* successfully set in +// `funcs` and sets status to OK. The caller takes ownership of +// all the returned TF_Functions. They must be deleted with TF_DeleteFunction. +// On error, returns 0, sets status to the encountered error, and the contents +// of funcs will be undefined. +public static native int TF_GraphGetFunctions(TF_Graph g, @Cast("TF_Function**") PointerPointer funcs, + int max_func, TF_Status status); +public static native int TF_GraphGetFunctions(TF_Graph g, @ByPtrPtr TF_Function funcs, + int max_func, TF_Status status); + +// Note: The following function may fail on very large protos in the future. + +public static native void TF_OperationToNodeDef(TF_Operation oper, + TF_Buffer output_node_def, + TF_Status status); +// Targeting ../TF_WhileParams.java + + + +// Creates a TF_WhileParams for creating a while loop in `g`. `inputs` are +// outputs that already exist in `g` used as initial values for the loop +// variables. +// +// The returned TF_WhileParams will have all fields initialized except +// `cond_output`, `body_outputs`, and `name`. The `body_outputs` buffer will be +// allocated to size `ninputs`. The caller should build `cond_graph` and +// `body_graph` starting from the inputs, and store the final outputs in +// `cond_output` and `body_outputs`. +// +// If `status` is OK, the caller must call either TF_FinishWhile or +// TF_AbortWhile on the returned TF_WhileParams. If `status` isn't OK, the +// returned TF_WhileParams is not valid, and the caller should not call +// TF_FinishWhile() or TF_AbortWhile(). +// +// Missing functionality (TODO): +// - Gradients +// - Reference-type inputs +// - Directly referencing external tensors from the cond/body graphs (this is +// possible in the Python API) +public static native @ByVal TF_WhileParams TF_NewWhile(TF_Graph g, TF_Output inputs, + int ninputs, + TF_Status status); + +// Builds the while loop specified by `params` and returns the output tensors of +// the while loop in `outputs`. `outputs` should be allocated to size +// `params.ninputs`. +// +// `params` is no longer valid once this returns. +// +// Either this or TF_AbortWhile() must be called after a successful +// TF_NewWhile() call. +public static native void TF_FinishWhile(@Const TF_WhileParams params, + TF_Status status, + TF_Output outputs); + +// Frees `params`s resources without building a while loop. `params` is no +// longer valid after this returns. Either this or TF_FinishWhile() must be +// called after a successful TF_NewWhile() call. +public static native void TF_AbortWhile(@Const TF_WhileParams params); + +// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, +// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... +// +// `dx` are used as initial gradients (which represent the symbolic partial +// derivatives of some loss function `L` w.r.t. `y`). +// `dx` must be nullptr or have size `ny`. +// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all +// shapes in `y`. +// The partial derivatives are returned in `dy`. `dy` should be allocated to +// size `nx`. +// +// Gradient nodes are automatically named under the "gradients/" prefix. To +// guarantee name uniqueness, subsequent calls to the same graph will +// append an incremental tag to the prefix: "gradients_1/", "gradients_2/", ... +// See TF_AddGradientsWithPrefix, which provides a means to specify a custom +// name prefix for operations added to a graph to compute the gradients. +// +// WARNING: This function does not yet support all the gradients that python +// supports. See +// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md +// for instructions on how to add C++ more gradients. +public static native void TF_AddGradients(TF_Graph g, TF_Output y, int ny, + TF_Output x, int nx, TF_Output dx, + TF_Status status, TF_Output dy); + +// Adds operations to compute the partial derivatives of sum of `y`s w.r.t `x`s, +// i.e., d(y_1 + y_2 + ...)/dx_1, d(y_1 + y_2 + ...)/dx_2... +// This is a variant of TF_AddGradients that allows to caller to pass a custom +// name prefix to the operations added to a graph to compute the gradients. +// +// `dx` are used as initial gradients (which represent the symbolic partial +// derivatives of some loss function `L` w.r.t. `y`). +// `dx` must be nullptr or have size `ny`. +// If `dx` is nullptr, the implementation will use dx of `OnesLike` for all +// shapes in `y`. +// The partial derivatives are returned in `dy`. `dy` should be allocated to +// size `nx`. +// `prefix` names the scope into which all gradients operations are being added. +// `prefix` must be unique within the provided graph otherwise this operation +// will fail. If `prefix` is nullptr, the default prefixing behaviour takes +// place, see TF_AddGradients for more details. +// +// WARNING: This function does not yet support all the gradients that python +// supports. See +// https://www.tensorflow.org/code/tensorflow/cc/gradients/README.md +// for instructions on how to add C++ more gradients. +public static native void TF_AddGradientsWithPrefix(TF_Graph g, @Cast("const char*") BytePointer prefix, + TF_Output y, int ny, + TF_Output x, int nx, + TF_Output dx, TF_Status status, + TF_Output dy); +public static native void TF_AddGradientsWithPrefix(TF_Graph g, String prefix, + TF_Output y, int ny, + TF_Output x, int nx, + TF_Output dx, TF_Status status, + TF_Output dy); + +// Create a TF_Function from a TF_Graph +// +// Params: +// fn_body - the graph whose operations (or subset of whose operations) will be +// converted to TF_Function. +// fn_name - the name of the new TF_Function. Should match the operation +// name (OpDef.name) regexp [A-Z][A-Za-z0-9_.\\-/]*. +// If `append_hash_to_fn_name` is false, `fn_name` must be distinct +// from other function and operation names (at least those +// registered in graphs where this function will be used). +// append_hash_to_fn_name - Must be 0 or 1. If set to 1, the actual name +// of the function will be `fn_name` appended with +// '_'. +// If set to 0, the function's name will be `fn_name`. +// num_opers - `num_opers` contains the number of elements in the `opers` array +// or a special value of -1 meaning that no array is given. +// The distinction between an empty array of operations and no +// array of operations is necessary to distinguish the case of +// creating a function with no body (e.g. identity or permutation) +// and the case of creating a function whose body contains all +// the nodes in the graph (except for the automatic skipping, see +// below). +// opers - Array of operations to become the body of the function or null. +// - If no array is given (`num_opers` = -1), all the +// operations in `fn_body` will become part of the function +// except operations referenced in `inputs`. These operations +// must have a single output (these operations are typically +// placeholders created for the sole purpose of representing +// an input. We can relax this constraint if there are +// compelling use cases). +// - If an array is given (`num_opers` >= 0), all operations +// in it will become part of the function. In particular, no +// automatic skipping of dummy input operations is performed. +// ninputs - number of elements in `inputs` array +// inputs - array of TF_Outputs that specify the inputs to the function. +// If `ninputs` is zero (the function takes no inputs), `inputs` +// can be null. The names used for function inputs are normalized +// names of the operations (usually placeholders) pointed to by +// `inputs`. These operation names should start with a letter. +// Normalization will convert all letters to lowercase and +// non-alphanumeric characters to '_' to make resulting names match +// the "[a-z][a-z0-9_]*" pattern for operation argument names. +// `inputs` cannot contain the same tensor twice. +// noutputs - number of elements in `outputs` array +// outputs - array of TF_Outputs that specify the outputs of the function. +// If `noutputs` is zero (the function returns no outputs), `outputs` +// can be null. `outputs` can contain the same tensor more than once. +// output_names - The names of the function's outputs. `output_names` array +// must either have the same length as `outputs` +// (i.e. `noutputs`) or be null. In the former case, +// the names should match the regular expression for ArgDef +// names - "[a-z][a-z0-9_]*". In the latter case, +// names for outputs will be generated automatically. +// opts - various options for the function, e.g. XLA's inlining control. +// description - optional human-readable description of this function. +// status - Set to OK on success and an appropriate error on failure. +// +// Note that when the same TF_Output is listed as both an input and an output, +// the corresponding function's output will equal to this input, +// instead of the original node's output. +// +// Callers must also satisfy the following constraints: +// - `inputs` cannot refer to TF_Outputs within a control flow context. For +// example, one cannot use the output of "switch" node as input. +// - `inputs` and `outputs` cannot have reference types. Reference types are +// not exposed through C API and are being replaced with Resources. We support +// reference types inside function's body to support legacy code. Do not +// use them in new code. +// - Every node in the function's body must have all of its inputs (including +// control inputs). In other words, for every node in the body, each input +// must be either listed in `inputs` or must come from another node in +// the body. In particular, it is an error to have a control edge going from +// a node outside of the body into a node in the body. This applies to control +// edges going from nodes referenced in `inputs` to nodes in the body when +// the former nodes are not in the body (automatically skipped or not +// included in explicitly specified body). +// +// Returns: +// On success, a newly created TF_Function instance. It must be deleted by +// calling TF_DeleteFunction. +// +// On failure, null. +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Cast("const TF_Operation*const*") PointerPointer opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") PointerPointer output_names, + @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, + @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, + @Const TF_FunctionOptions opts, String description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, + @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, + @Const TF_FunctionOptions opts, String description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, + @Const TF_FunctionOptions opts, @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunction( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, + @Const TF_FunctionOptions opts, String description, TF_Status status); + +// Similar to TF_GraphToFunction but allows specifying control outputs of the +// function. +// +// The arguments of TF_GraphToFunction have the same meaning, but the new +// arguments are as follows: +// +// ncontrol_outputs: Number of control outputs of the function. +// control_outputs: vector of TF_Operation objects to be marked as control +// outputs of the function. Operations marked as control outputs are +// guaranteed to execute. +// control_output_names: Optional. If not nullptr, vector of strings, one +// per control output, with their names to be added to the function's +// OpDef. +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Cast("const TF_Operation*const*") PointerPointer opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") PointerPointer output_names, + int ncontrol_outputs, @Cast("const TF_Operation*const*") PointerPointer control_outputs, + @Cast("const char*const*") PointerPointer control_output_names, @Const TF_FunctionOptions opts, + @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr BytePointer control_output_names, @Const TF_FunctionOptions opts, + @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr ByteBuffer control_output_names, @Const TF_FunctionOptions opts, + String description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr byte[] control_output_names, @Const TF_FunctionOptions opts, + @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr BytePointer output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr BytePointer control_output_names, @Const TF_FunctionOptions opts, + String description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, @Cast("const char*") BytePointer fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr ByteBuffer output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr ByteBuffer control_output_names, @Const TF_FunctionOptions opts, + @Cast("const char*") BytePointer description, TF_Status status); +public static native TF_Function TF_GraphToFunctionWithControlOutputs( + @Const TF_Graph fn_body, String fn_name, + @Cast("unsigned char") byte append_hash_to_fn_name, int num_opers, + @Const @ByPtrPtr TF_Operation opers, int ninputs, @Const TF_Output inputs, + int noutputs, @Const TF_Output outputs, @Cast("const char*const*") @ByPtrPtr byte[] output_names, + int ncontrol_outputs, @Const @ByPtrPtr TF_Operation control_outputs, + @Cast("const char*const*") @ByPtrPtr byte[] control_output_names, @Const TF_FunctionOptions opts, + String description, TF_Status status); + +// Returns the name of the graph function. +// The return value points to memory that is only usable until the next +// mutation to *func. +public static native @Cast("const char*") BytePointer TF_FunctionName(TF_Function func); + +// Write out a serialized representation of `func` (as a FunctionDef protocol +// message) to `output_func_def` (allocated by TF_NewBuffer()). +// `output_func_def`'s underlying buffer will be freed when TF_DeleteBuffer() +// is called. +// +// May fail on very large graphs in the future. +public static native void TF_FunctionToFunctionDef(TF_Function func, + TF_Buffer output_func_def, + TF_Status status); + +// Construct and return the function whose FunctionDef representation is +// serialized in `proto`. `proto_len` must equal the number of bytes +// pointed to by `proto`. +// Returns: +// On success, a newly created TF_Function instance. It must be deleted by +// calling TF_DeleteFunction. +// +// On failure, null. +public static native TF_Function TF_FunctionImportFunctionDef( + @Const Pointer proto, @Cast("size_t") long proto_len, TF_Status status); + +// Sets function attribute named `attr_name` to value stored in `proto`. +// If this attribute is already set to another value, it is overridden. +// `proto` should point to a sequence of bytes of length `proto_len` +// representing a binary serialization of an AttrValue protocol +// buffer. +public static native void TF_FunctionSetAttrValueProto(TF_Function func, + @Cast("const char*") BytePointer attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); +public static native void TF_FunctionSetAttrValueProto(TF_Function func, + String attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// Sets `output_attr_value` to the binary-serialized AttrValue proto +// representation of the value of the `attr_name` attr of `func`. +// If `attr_name` attribute is not present, status is set to an error. +public static native void TF_FunctionGetAttrValueProto( + TF_Function func, @Cast("const char*") BytePointer attr_name, TF_Buffer output_attr_value, + TF_Status status); +public static native void TF_FunctionGetAttrValueProto( + TF_Function func, String attr_name, TF_Buffer output_attr_value, + TF_Status status); + +// Frees the memory used by the `func` struct. +// TF_DeleteFunction is a noop if `func` is null. +// Deleting a function does not remove it from any graphs it was copied to. +public static native void TF_DeleteFunction(TF_Function func); + +// Attempts to evaluate `output`. This will only be possible if `output` doesn't +// depend on any graph inputs (this function is safe to call if this isn't the +// case though). +// +// If the evaluation is successful, this function returns true and `output`s +// value is returned in `result`. Otherwise returns false. An error status is +// returned if something is wrong with the graph or input. Note that this may +// return false even if no error status is set. +public static native @Cast("unsigned char") byte TF_TryEvaluateConstant(TF_Graph graph, + @ByVal TF_Output output, + @Cast("TF_Tensor**") PointerPointer result, + TF_Status status); +public static native @Cast("unsigned char") byte TF_TryEvaluateConstant(TF_Graph graph, + @ByVal TF_Output output, + @ByPtrPtr TF_Tensor result, + TF_Status status); +// Targeting ../TF_Session.java + + + +// Return a new execution session with the associated graph, or NULL on +// error. Does not take ownership of any input parameters. +// +// *`graph` must be a valid graph (not deleted or nullptr). `graph` will be +// kept alive for the lifetime of the returned TF_Session. New nodes can still +// be added to `graph` after this call. +public static native TF_Session TF_NewSession(TF_Graph graph, + @Const TF_SessionOptions opts, + TF_Status status); + +// This function creates a new TF_Session (which is created on success) using +// `session_options`, and then initializes state (restoring tensors and other +// assets) using `run_options`. +// +// Any NULL and non-NULL value combinations for (`run_options, `meta_graph_def`) +// are valid. +// +// - `export_dir` must be set to the path of the exported SavedModel. +// - `tags` must include the set of tags used to identify one MetaGraphDef in +// the SavedModel. +// - `graph` must be a graph newly allocated with TF_NewGraph(). +// +// If successful, populates `graph` with the contents of the Graph and +// `meta_graph_def` with the MetaGraphDef of the loaded model. +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") PointerPointer tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr BytePointer tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + String export_dir, @Cast("const char*const*") @ByPtrPtr ByteBuffer tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr byte[] tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + String export_dir, @Cast("const char*const*") @ByPtrPtr BytePointer tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + @Cast("const char*") BytePointer export_dir, @Cast("const char*const*") @ByPtrPtr ByteBuffer tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); +public static native TF_Session TF_LoadSessionFromSavedModel( + @Const TF_SessionOptions session_options, @Const TF_Buffer run_options, + String export_dir, @Cast("const char*const*") @ByPtrPtr byte[] tags, int tags_len, + TF_Graph graph, TF_Buffer meta_graph_def, TF_Status status); + +// Close a session. +// +// Contacts any other processes associated with the session, if applicable. +// May not be called after TF_DeleteSession(). +public static native void TF_CloseSession(TF_Session arg0, TF_Status status); + +// Destroy a session object. +// +// Even if error information is recorded in *status, this call discards all +// local resources associated with the session. The session may not be used +// during or after this call (and the session drops its reference to the +// corresponding graph). +public static native void TF_DeleteSession(TF_Session arg0, TF_Status status); + +// Run the graph associated with the session starting with the supplied inputs +// (inputs[0,ninputs-1] with corresponding values in input_values[0,ninputs-1]). +// +// Any NULL and non-NULL value combinations for (`run_options`, +// `run_metadata`) are valid. +// +// - `run_options` may be NULL, in which case it will be ignored; or +// non-NULL, in which case it must point to a `TF_Buffer` containing the +// serialized representation of a `RunOptions` protocol buffer. +// - `run_metadata` may be NULL, in which case it will be ignored; or +// non-NULL, in which case it must point to an empty, freshly allocated +// `TF_Buffer` that may be updated to contain the serialized representation +// of a `RunMetadata` protocol buffer. +// +// The caller retains ownership of `input_values` (which can be deleted using +// TF_DeleteTensor). The caller also retains ownership of `run_options` and/or +// `run_metadata` (when not NULL) and should manually call TF_DeleteBuffer on +// them. +// +// On success, the tensors corresponding to outputs[0,noutputs-1] are placed in +// output_values[]. Ownership of the elements of output_values[] is transferred +// to the caller, which must eventually call TF_DeleteTensor on them. +// +// On failure, output_values[] contains NULLs. +public static native void TF_SessionRun( + TF_Session session, + @Const TF_Buffer run_options, + @Const TF_Output inputs, @Cast("TF_Tensor*const*") PointerPointer input_values, int ninputs, + @Const TF_Output outputs, @Cast("TF_Tensor**") PointerPointer output_values, int noutputs, + @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, + TF_Buffer run_metadata, + TF_Status arg11); +public static native void TF_SessionRun( + TF_Session session, + @Const TF_Buffer run_options, + @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, + @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + TF_Buffer run_metadata, + TF_Status arg11); + +// Set up the graph with the intended feeds (inputs) and fetches (outputs) for a +// sequence of partial run calls. +// +// On success, returns a handle that is used for subsequent PRun calls. The +// handle should be deleted with TF_DeletePRunHandle when it is no longer +// needed. +// +// On failure, out_status contains a tensorflow::Status with an error +// message. *handle is set to nullptr. +public static native void TF_SessionPRunSetup( + TF_Session arg0, + @Const TF_Output inputs, int ninputs, + @Const TF_Output outputs, int noutputs, + @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, + @Cast("const char**") PointerPointer handle, + TF_Status arg8); +public static native void TF_SessionPRunSetup( + TF_Session arg0, + @Const TF_Output inputs, int ninputs, + @Const TF_Output outputs, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + @Cast("const char**") @ByPtrPtr BytePointer handle, + TF_Status arg8); +public static native void TF_SessionPRunSetup( + TF_Session arg0, + @Const TF_Output inputs, int ninputs, + @Const TF_Output outputs, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + @Cast("const char**") @ByPtrPtr ByteBuffer handle, + TF_Status arg8); +public static native void TF_SessionPRunSetup( + TF_Session arg0, + @Const TF_Output inputs, int ninputs, + @Const TF_Output outputs, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + @Cast("const char**") @ByPtrPtr byte[] handle, + TF_Status arg8); + +// Continue to run the graph with additional feeds and fetches. The +// execution state is uniquely identified by the handle. +public static native void TF_SessionPRun( + TF_Session arg0, @Cast("const char*") BytePointer handle, + @Const TF_Output inputs, @Cast("TF_Tensor*const*") PointerPointer input_values, int ninputs, + @Const TF_Output outputs, @Cast("TF_Tensor**") PointerPointer output_values, int noutputs, + @Cast("const TF_Operation*const*") PointerPointer target_opers, int ntargets, + TF_Status arg10); +public static native void TF_SessionPRun( + TF_Session arg0, @Cast("const char*") BytePointer handle, + @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, + @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + TF_Status arg10); +public static native void TF_SessionPRun( + TF_Session arg0, String handle, + @Const TF_Output inputs, @ByPtrPtr TF_Tensor input_values, int ninputs, + @Const TF_Output outputs, @ByPtrPtr TF_Tensor output_values, int noutputs, + @Const @ByPtrPtr TF_Operation target_opers, int ntargets, + TF_Status arg10); + +// Deletes a handle allocated by TF_SessionPRunSetup. +// Once called, no more calls to TF_SessionPRun should be made. +public static native void TF_DeletePRunHandle(@Cast("const char*") BytePointer handle); +public static native void TF_DeletePRunHandle(String handle); +// Targeting ../TF_DeprecatedSession.java + + + +public static native TF_DeprecatedSession TF_NewDeprecatedSession( + @Const TF_SessionOptions arg0, TF_Status status); +public static native void TF_CloseDeprecatedSession(TF_DeprecatedSession arg0, + TF_Status status); +public static native void TF_DeleteDeprecatedSession(TF_DeprecatedSession arg0, + TF_Status status); +public static native void TF_Reset(@Const TF_SessionOptions opt, + @Cast("const char**") PointerPointer containers, int ncontainers, + TF_Status status); +public static native void TF_Reset(@Const TF_SessionOptions opt, + @Cast("const char**") @ByPtrPtr BytePointer containers, int ncontainers, + TF_Status status); +public static native void TF_Reset(@Const TF_SessionOptions opt, + @Cast("const char**") @ByPtrPtr ByteBuffer containers, int ncontainers, + TF_Status status); +public static native void TF_Reset(@Const TF_SessionOptions opt, + @Cast("const char**") @ByPtrPtr byte[] containers, int ncontainers, + TF_Status status); +// Treat the bytes proto[0,proto_len-1] as a serialized GraphDef and +// add the nodes in that GraphDef to the graph for the session. +// +// Prefer use of TF_Session and TF_GraphImportGraphDef over this. +public static native void TF_ExtendGraph(TF_DeprecatedSession arg0, + @Const Pointer proto, @Cast("size_t") long proto_len, + TF_Status arg3); + +// See TF_SessionRun() above. +public static native void TF_Run(TF_DeprecatedSession arg0, + @Const TF_Buffer run_options, + @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, + int ninputs, @Cast("const char**") PointerPointer output_names, + @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, + @Cast("const char**") PointerPointer target_oper_names, int ntargets, + TF_Buffer run_metadata, TF_Status arg11); +public static native void TF_Run(TF_DeprecatedSession arg0, + @Const TF_Buffer run_options, + @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, + TF_Buffer run_metadata, TF_Status arg11); +public static native void TF_Run(TF_DeprecatedSession arg0, + @Const TF_Buffer run_options, + @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, + TF_Buffer run_metadata, TF_Status arg11); +public static native void TF_Run(TF_DeprecatedSession arg0, + @Const TF_Buffer run_options, + @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, + TF_Buffer run_metadata, TF_Status arg11); + +// See TF_SessionPRunSetup() above. +public static native void TF_PRunSetup(TF_DeprecatedSession arg0, + @Cast("const char**") PointerPointer input_names, int ninputs, + @Cast("const char**") PointerPointer output_names, int noutputs, + @Cast("const char**") PointerPointer target_oper_names, + int ntargets, @Cast("const char**") PointerPointer handle, + TF_Status arg8); +public static native void TF_PRunSetup(TF_DeprecatedSession arg0, + @Cast("const char**") @ByPtrPtr BytePointer input_names, int ninputs, + @Cast("const char**") @ByPtrPtr BytePointer output_names, int noutputs, + @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, + int ntargets, @Cast("const char**") @ByPtrPtr BytePointer handle, + TF_Status arg8); +public static native void TF_PRunSetup(TF_DeprecatedSession arg0, + @Cast("const char**") @ByPtrPtr ByteBuffer input_names, int ninputs, + @Cast("const char**") @ByPtrPtr ByteBuffer output_names, int noutputs, + @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, + int ntargets, @Cast("const char**") @ByPtrPtr ByteBuffer handle, + TF_Status arg8); +public static native void TF_PRunSetup(TF_DeprecatedSession arg0, + @Cast("const char**") @ByPtrPtr byte[] input_names, int ninputs, + @Cast("const char**") @ByPtrPtr byte[] output_names, int noutputs, + @Cast("const char**") @ByPtrPtr byte[] target_oper_names, + int ntargets, @Cast("const char**") @ByPtrPtr byte[] handle, + TF_Status arg8); + +// See TF_SessionPRun above. +public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, + @Cast("const char**") PointerPointer input_names, @Cast("TF_Tensor**") PointerPointer inputs, + int ninputs, @Cast("const char**") PointerPointer output_names, + @Cast("TF_Tensor**") PointerPointer outputs, int noutputs, + @Cast("const char**") PointerPointer target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, + @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, + @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, + @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, + @Cast("const char**") @ByPtrPtr BytePointer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr BytePointer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr BytePointer target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, @Cast("const char*") BytePointer handle, + @Cast("const char**") @ByPtrPtr ByteBuffer input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr ByteBuffer output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr ByteBuffer target_oper_names, int ntargets, + TF_Status arg10); +public static native void TF_PRun(TF_DeprecatedSession arg0, String handle, + @Cast("const char**") @ByPtrPtr byte[] input_names, @ByPtrPtr TF_Tensor inputs, + int ninputs, @Cast("const char**") @ByPtrPtr byte[] output_names, + @ByPtrPtr TF_Tensor outputs, int noutputs, + @Cast("const char**") @ByPtrPtr byte[] target_oper_names, int ntargets, + TF_Status arg10); +// Targeting ../TF_DeviceList.java + + + +// Lists all devices in a TF_Session. +// +// Caller takes ownership of the returned TF_DeviceList* which must eventually +// be freed with a call to TF_DeleteDeviceList. +public static native TF_DeviceList TF_SessionListDevices(TF_Session session, + TF_Status status); + +// Lists all devices in a TF_Session. +// +// Caller takes ownership of the returned TF_DeviceList* which must eventually +// be freed with a call to TF_DeleteDeviceList. +public static native TF_DeviceList TF_DeprecatedSessionListDevices( + TF_DeprecatedSession session, TF_Status status); + +// Deallocates the device list. +public static native void TF_DeleteDeviceList(TF_DeviceList list); + +// Counts the number of elements in the device list. +public static native int TF_DeviceListCount(@Const TF_DeviceList list); + +// Retrieves the full name of the device (e.g. /job:worker/replica:0/...) +// The return value will be a pointer to a null terminated string. The caller +// must not modify or delete the string. It will be deallocated upon a call to +// TF_DeleteDeviceList. +// +// If index is out of bounds, an error code will be set in the status object, +// and a null pointer will be returned. +public static native @Cast("const char*") BytePointer TF_DeviceListName(@Const TF_DeviceList list, + int index, + TF_Status status); + +// Retrieves the type of the device at the given index. +// +// The caller must not modify or delete the string. It will be deallocated upon +// a call to TF_DeleteDeviceList. +// +// If index is out of bounds, an error code will be set in the status object, +// and a null pointer will be returned. +public static native @Cast("const char*") BytePointer TF_DeviceListType(@Const TF_DeviceList list, + int index, + TF_Status status); + +// Retrieve the amount of memory associated with a given device. +// +// If index is out of bounds, an error code will be set in the status object, +// and -1 will be returned. +public static native @Cast("int64_t") long TF_DeviceListMemoryBytes( + @Const TF_DeviceList list, int index, TF_Status status); + +// Retrieve the incarnation number of a given device. +// +// If index is out of bounds, an error code will be set in the status object, +// and 0 will be returned. +public static native @Cast("uint64_t") long TF_DeviceListIncarnation( + @Const TF_DeviceList list, int index, TF_Status status); +// Targeting ../TF_Library.java + + + +// Load the library specified by library_filename and register the ops and +// kernels present in that library. +// +// Pass "library_filename" to a platform-specific mechanism for dynamically +// loading a library. The rules for determining the exact location of the +// library are platform-specific and are not documented here. +// +// On success, place OK in status and return the newly created library handle. +// The caller owns the library handle. +// +// On failure, place an error status in status and return NULL. +public static native TF_Library TF_LoadLibrary(@Cast("const char*") BytePointer library_filename, + TF_Status status); +public static native TF_Library TF_LoadLibrary(String library_filename, + TF_Status status); + +// Get the OpList of OpDefs defined in the library pointed by lib_handle. +// +// Returns a TF_Buffer. The memory pointed to by the result is owned by +// lib_handle. The data in the buffer will be the serialized OpList proto for +// ops defined in the library. +public static native @ByVal TF_Buffer TF_GetOpList(TF_Library lib_handle); + +// Frees the memory associated with the library handle. +// Does NOT unload the library. +public static native void TF_DeleteLibraryHandle(TF_Library lib_handle); + +// Get the OpList of all OpDefs defined in this address space. +// Returns a TF_Buffer, ownership of which is transferred to the caller +// (and can be freed using TF_DeleteBuffer). +// +// The data in the buffer will be the serialized OpList proto for ops registered +// in this address space. +public static native TF_Buffer TF_GetAllOpList(); +// Targeting ../TF_ApiDefMap.java + + + +// Creates a new TF_ApiDefMap instance. +// +// Params: +// op_list_buffer - TF_Buffer instance containing serialized OpList +// protocol buffer. (See +// https://www.tensorflow.org/code/tensorflow/core/framework/op_def.proto +// for the OpList proto definition). +// status - Set to OK on success and an appropriate error on failure. +public static native TF_ApiDefMap TF_NewApiDefMap(TF_Buffer op_list_buffer, + TF_Status status); + +// Deallocates a TF_ApiDefMap. +public static native void TF_DeleteApiDefMap(TF_ApiDefMap apimap); + +// Add ApiDefs to the map. +// +// `text` corresponds to a text representation of an ApiDefs protocol message. +// (https://www.tensorflow.org/code/tensorflow/core/framework/api_def.proto). +// +// The provided ApiDefs will be merged with existing ones in the map, with +// precedence given to the newly added version in case of conflicts with +// previous calls to TF_ApiDefMapPut. +public static native void TF_ApiDefMapPut(TF_ApiDefMap api_def_map, + @Cast("const char*") BytePointer text, @Cast("size_t") long text_len, + TF_Status status); +public static native void TF_ApiDefMapPut(TF_ApiDefMap api_def_map, + String text, @Cast("size_t") long text_len, + TF_Status status); + +// Returns a serialized ApiDef protocol buffer for the TensorFlow operation +// named `name`. +public static native TF_Buffer TF_ApiDefMapGet(TF_ApiDefMap api_def_map, + @Cast("const char*") BytePointer name, + @Cast("size_t") long name_len, + TF_Status status); +public static native TF_Buffer TF_ApiDefMapGet(TF_ApiDefMap api_def_map, + String name, + @Cast("size_t") long name_len, + TF_Status status); + +// -------------------------------------------------------------------------- +// Kernel definition information. + +// Returns a serialized KernelList protocol buffer containing KernelDefs for all +// registered kernels. +public static native TF_Buffer TF_GetAllRegisteredKernels(TF_Status status); + +// Returns a serialized KernelList protocol buffer containing KernelDefs for all +// kernels registered for the operation named `name`. +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 + + + +// Creates a new in-process TensorFlow server configured using a serialized +// ServerDef protocol buffer provided via `proto` and `proto_len`. +// +// The server will not serve any requests until TF_ServerStart is invoked. +// The server will stop serving requests once TF_ServerStop or +// TF_DeleteServer is invoked. +public static native TF_Server TF_NewServer(@Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// Starts an in-process TensorFlow server. +public static native void TF_ServerStart(TF_Server server, TF_Status status); + +// Stops an in-process TensorFlow server. +public static native void TF_ServerStop(TF_Server server, TF_Status status); + +// Blocks until the server has been successfully stopped (via TF_ServerStop or +// TF_ServerClose). +public static native void TF_ServerJoin(TF_Server server, TF_Status status); + +// Returns the target string that can be provided to TF_SetTarget() to connect +// a TF_Session to `server`. +// +// The returned string is valid only until TF_DeleteServer is invoked. +public static native @Cast("const char*") BytePointer TF_ServerTarget(TF_Server server); + +// Destroy an in-process TensorFlow server, frees memory. If server is running +// it will be stopped and joined. +public static native void TF_DeleteServer(TF_Server server); +// Targeting ../Listener_BytePointer.java + + +public static native void TF_RegisterLogListener( + Listener_BytePointer listener); +// Targeting ../Listener_String.java + + +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); + +// Apis that are corresponding to python c api. -------------------- + +// Add control input to `op`. +public static native void TF_AddOperationControlInput(TF_Graph graph, + TF_Operation op, + TF_Operation input); + +// Changes an attr value in the node_def Protocol Buffer and sets a status upon +// completion. +public static native void TF_SetAttr(TF_Graph graph, TF_Operation op, + @Cast("const char*") BytePointer attr_name, + TF_Buffer attr_value_proto, + TF_Status status); +public static native void TF_SetAttr(TF_Graph graph, TF_Operation op, + String attr_name, + TF_Buffer attr_value_proto, + TF_Status status); + +// Clears the attr in the node_def Protocol Buffer and sets a status upon +// completion. +public static native void TF_ClearAttr(TF_Graph graph, TF_Operation op, + @Cast("const char*") BytePointer attr_name, + TF_Status status); +public static native void TF_ClearAttr(TF_Graph graph, TF_Operation op, + String attr_name, + TF_Status status); + +// Sets the experimental_type` field in the node_def Protocol Buffer. +public static native void TF_SetFullType(TF_Graph graph, TF_Operation op, + @Const TF_Buffer full_type_proto); + +// Set the requested device for `graph`. +public static native void TF_SetRequestedDevice(TF_Graph graph, + TF_Operation op, + @Cast("const char*") BytePointer device); +public static native void TF_SetRequestedDevice(TF_Graph graph, + TF_Operation op, + String device); + +// Remove all the control inputs from `op` in `graph`. +public static native void TF_RemoveAllControlInputs(TF_Graph graph, + TF_Operation op); + +// Set if `graph` requires shape inference functions. +public static native void TF_SetRequireShapeInferenceFns(TF_Graph graph, + @Cast("bool") boolean require); + +// Extends `session` with any new operations added to its associated graph. +// Usually this happens automatically in TF_SessionRun. After this is called, +// TF_SessionRun will no longer extend the session on every call. +// +// We expose this here to allow fine-grained synchronization in multi-threaded +// workloads, which is required since the Python implementation depends on the +// above mutation methods. This allows us to prevent modifications to nodes in +// the graph after the session has been made aware of them. +public static native void TF_ExtendSession(TF_Session session, + TF_Status status); + +// Returns the serialized CppShapeInferenceResult::HandleData proto for +// `output` if its a resource or variant tensor, or otherwise returns the empty +// string. +public static native TF_Buffer TF_GetHandleShapeAndType(TF_Graph graph, + @ByVal TF_Output output); + +// Sets `output` based on `proto`, which should be a serialized +// CppShapeInferenceResult::HandleData proto. `output` should be a resource +// or variant tensor. +// NOTE(skyewm): `proto` is passed a void*/size_t pair instead of a std::string +// because I couldn't get SWIG to work otherwise. +public static native void TF_SetHandleShapeAndType(TF_Graph graph, + @ByVal TF_Output output, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// This method is used to add a new input edge to 'dst', which must be a While +// op. The While op's "T" attribute must have already been updated to include +// the new edge. This is used to construct tf.while_loop gradients. +public static native void TF_AddWhileInputHack(TF_Graph graph, + @ByVal TF_Output new_src, + TF_Operation dst, + TF_Status status); + +// ---------------------------------------------------------------- + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_C_API_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/c/c_api_macros.h" +// #include "tensorflow/c/tf_tensor.h" +// #include "tensorflow/core/platform/ctstring.h" + +// #ifdef __cplusplus +// #endif + +public static native void TF_StringInit(TF_TString t); + +public static native void TF_StringCopy(TF_TString dst, @Cast("const char*") BytePointer src, + @Cast("size_t") long size); +public static native void TF_StringCopy(TF_TString dst, String src, + @Cast("size_t") long size); + +public static native void TF_StringAssignView(TF_TString dst, @Cast("const char*") BytePointer src, + @Cast("size_t") long size); +public static native void TF_StringAssignView(TF_TString dst, String src, + @Cast("size_t") long size); + +public static native @Cast("const char*") BytePointer TF_StringGetDataPointer( + @Const TF_TString tstr); + +public static native @Cast("TF_TString_Type") int TF_StringGetType(@Const TF_TString str); + +public static native @Cast("size_t") long TF_StringGetSize(@Const TF_TString tstr); + +public static native @Cast("size_t") long TF_StringGetCapacity(@Const TF_TString str); + +public static native void TF_StringDealloc(TF_TString tstr); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_TF_TSTRING_H_ + + +// Parsed from tensorflow/c/eager/c_api.h + +/* Copyright 2017 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_EAGER_C_API_H_ +// #define TENSORFLOW_C_EAGER_C_API_H_ + +// C API extensions to experiment with eager execution of kernels. +// WARNING: Unlike tensorflow/c/c_api.h, the API here is not guaranteed to be +// stable and can change without notice. + +// #include "tensorflow/c/c_api.h" +// #include "tensorflow/c/c_api_macros.h" + +// #ifdef __cplusplus +// Targeting ../TFE_ContextOptions.java + + + +// Return a new options object. +public static native TFE_ContextOptions TFE_NewContextOptions(); + +// Set the config in TF_ContextOptions.options. +// config should be a serialized tensorflow.ConfigProto proto. +// If config was not parsed successfully as a ConfigProto, record the +// error information in *status. +public static native void TFE_ContextOptionsSetConfig( + TFE_ContextOptions options, @Const Pointer proto, @Cast("size_t") long proto_len, + TF_Status status); + +// Controls how to act when we try to run an operation on a given device but +// some input tensors are not on that device. +// LINT.IfChange +// Note: Keep in sync with internal copy of enum in eager/context.h. +/** enum TFE_ContextDevicePlacementPolicy */ +public static final int + // Running operations with input tensors on the wrong device will fail. + TFE_DEVICE_PLACEMENT_EXPLICIT = 0, + // Copy the tensor to the right device but log a warning. + TFE_DEVICE_PLACEMENT_WARN = 1, + // Silently copy the tensor, which has a performance cost since the operation + // will be blocked till the copy completes. This is the default placement + // policy. + 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/c/eager/immediate_execution_context.h) + +// Sets the default execution mode (sync/async). Note that this can be +// overridden per thread using TFE_ContextSetExecutorForThread. +public static native void TFE_ContextOptionsSetAsync(TFE_ContextOptions arg0, + @Cast("unsigned char") byte enable); + +public static native void TFE_ContextOptionsSetDevicePlacementPolicy( + TFE_ContextOptions arg0, @Cast("TFE_ContextDevicePlacementPolicy") int arg1); + +// Destroy an options object. +public static native void TFE_DeleteContextOptions(TFE_ContextOptions arg0); +// Targeting ../TFE_Context.java + + + +public static native TFE_Context TFE_NewContext( + @Const TFE_ContextOptions opts, TF_Status status); +public static native void TFE_DeleteContext(TFE_Context ctx); +public static native TF_DeviceList TFE_ContextListDevices(TFE_Context ctx, + TF_Status status); + +// Clears the internal caches in the TFE context. Useful when reseeding random +// ops. +public static native void TFE_ContextClearCaches(TFE_Context ctx); + +// Sets a thread-local device placement policy. After this call, other calls to +// TFE_Execute in the same thread will use the device policy specified here +// instead of the device policy used to construct the context. This has no +// effect on the device policy used by other program threads. +public static native void TFE_ContextSetThreadLocalDevicePlacementPolicy( + TFE_Context ctx, @Cast("TFE_ContextDevicePlacementPolicy") int policy); + +// Returns the device placement policy to be used by this context in the current +// thread. +public static native @Cast("TFE_ContextDevicePlacementPolicy") int TFE_ContextGetDevicePlacementPolicy(TFE_Context ctx); + +// A tensorflow.ServerDef specifies remote workers (in addition to the current +// workers name). Operations created in this context can then be executed on +// any of these remote workers by setting an appropriate device. +// +// If the following is set, all servers identified by the +// ServerDef must be up when the context is created. +public static native void TFE_ContextSetServerDef(TFE_Context ctx, + int keep_alive_secs, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); +// Targeting ../TFE_TensorHandle.java + + + +public static native TFE_TensorHandle TFE_NewTensorHandle(@Const TF_Tensor t, + TF_Status status); +// Indicates that the caller will not be using `h` any more. +public static native void TFE_DeleteTensorHandle(TFE_TensorHandle h); +public static native @Cast("TF_DataType") int TFE_TensorHandleDataType(TFE_TensorHandle h); +// This function will block till the operation that produces `h` has completed. +public static native int TFE_TensorHandleNumDims(TFE_TensorHandle h, + TF_Status status); +public static native @Cast("int64_t") long TFE_TensorHandleNumElements(TFE_TensorHandle h, + TF_Status status); +// This function will block till the operation that produces `h` has completed. +public static native @Cast("int64_t") long TFE_TensorHandleDim(TFE_TensorHandle h, + int dim_index, + TF_Status status); + +// Returns the device of the operation that produced `h`. If `h` was produced by +// a copy, returns the destination device of the copy. Note that the returned +// device name is not always the device holding the tensor handle's memory. If +// you want the latter, use TFE_TensorHandleBackingDeviceName. This function +// will block till the operation that produces `h` has completed. +public static native @Cast("const char*") BytePointer TFE_TensorHandleDeviceName( + TFE_TensorHandle h, TF_Status status); + +// Returns the name of the device in whose memory `h` resides. +// +// This function will block till the operation that produces `h` has completed. +public static native @Cast("const char*") BytePointer TFE_TensorHandleBackingDeviceName( + TFE_TensorHandle h, TF_Status status); + +// Return a pointer to a new TFE_TensorHandle that shares the underlying tensor +// with `h`. On success, `status` is set to OK. On failure, `status` reflects +// the error and a nullptr is returned. +public static native TFE_TensorHandle TFE_TensorHandleCopySharingTensor( + TFE_TensorHandle h, TF_Status status); + +// This function will block till the operation that produces `h` has +// completed. The memory returned might alias the internal memory used by +// TensorFlow. Hence, callers should not mutate this memory (for example by +// modifying the memory region pointed to by TF_TensorData() on the returned +// TF_Tensor). +public static native TF_Tensor TFE_TensorHandleResolve(TFE_TensorHandle h, + TF_Status status); + +// Create a new TFE_TensorHandle with the same contents as 'h' but placed +// in the memory of the device name 'device_name'. +// If source and destination are the same device, then this creates a new handle +// that shares the underlying buffer. Otherwise, it currently requires at least +// one of the source or destination devices to be CPU (i.e., for the source or +// destination tensor to be placed in host memory). +// If async execution is enabled, the copy may be enqueued and the call will +// return "non-ready" handle. Else, this function returns after the copy has +// been done. +public static native TFE_TensorHandle TFE_TensorHandleCopyToDevice( + TFE_TensorHandle h, TFE_Context ctx, @Cast("const char*") BytePointer device_name, + TF_Status status); +public static native TFE_TensorHandle TFE_TensorHandleCopyToDevice( + TFE_TensorHandle h, TFE_Context ctx, String device_name, + TF_Status status); +// Targeting ../TFE_TensorDebugInfo.java + + + +// Retrieves TFE_TensorDebugInfo for `handle`. +// If TFE_TensorHandleTensorDebugInfo succeeds, `status` is set to OK and caller +// is responsible for deleting returned TFE_TensorDebugInfo. +// If TFE_TensorHandleTensorDebugInfo fails, `status` is set to appropriate +// error and nullptr is returned. This function can block till the operation +// that produces `handle` has completed. +public static native TFE_TensorDebugInfo TFE_TensorHandleTensorDebugInfo( + TFE_TensorHandle h, TF_Status status); + +// Deletes `debug_info`. +public static native void TFE_DeleteTensorDebugInfo( + TFE_TensorDebugInfo debug_info); + +// Returns the number of dimensions used to represent the tensor on its device. +// The number of dimensions used to represent the tensor on device can be +// different from the number returned by TFE_TensorHandleNumDims. +// The return value was current at the time of TFE_TensorDebugInfo creation. +public static native int TFE_TensorDebugInfoOnDeviceNumDims( + TFE_TensorDebugInfo debug_info); + +// Returns the number of elements in dimension `dim_index`. +// Tensor representation on device can be transposed from its representation +// on host. The data contained in dimension `dim_index` on device +// can correspond to the data contained in another dimension in on-host +// representation. The dimensions are indexed using the standard TensorFlow +// major-to-minor order (slowest varying dimension first), +// not the XLA's minor-to-major order. +// On-device dimensions can be padded. TFE_TensorDebugInfoOnDeviceDim returns +// the number of elements in a dimension after padding. +// The return value was current at the time of TFE_TensorDebugInfo creation. +public static native @Cast("int64_t") long TFE_TensorDebugInfoOnDeviceDim( + TFE_TensorDebugInfo debug_info, int dim_index); +// Targeting ../TFE_Op.java + + + +public static native TFE_Op TFE_NewOp(TFE_Context ctx, + @Cast("const char*") BytePointer op_or_function_name, + TF_Status status); +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(@Const TFE_Op op, + TF_Status status); + +public static native void TFE_OpAddInput(TFE_Op op, TFE_TensorHandle input, + TF_Status status); + +public static native void TFE_OpAddInputList(TFE_Op op, + @Cast("TFE_TensorHandle**") PointerPointer inputs, + int num_inputs, + TF_Status status); +public static native void TFE_OpAddInputList(TFE_Op op, + @ByPtrPtr TFE_TensorHandle inputs, + 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, + TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, + String attr_name, + @Cast("unsigned char*") ByteBuffer is_list, + TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") byte[] is_list, + TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, + String attr_name, + @Cast("unsigned char*") BytePointer is_list, + TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") ByteBuffer is_list, + TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpGetAttrType(TFE_Op op, + String attr_name, + @Cast("unsigned char*") byte[] is_list, + TF_Status status); +// Get an attribute type given an op name; a fusion of TFE_NewOp and +// TFE_OpGetAttrType for use from Python without the overhead of the individual +// calls and memory management of TFE_Op. +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") BytePointer is_list, TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, String op_or_function_name, String attr_name, + @Cast("unsigned char*") ByteBuffer is_list, TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") byte[] is_list, TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, String op_or_function_name, String attr_name, + @Cast("unsigned char*") BytePointer is_list, TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, @Cast("const char*") BytePointer op_or_function_name, @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char*") ByteBuffer is_list, TF_Status status); +public static native @Cast("TF_AttrType") int TFE_OpNameGetAttrType( + TFE_Context ctx, String op_or_function_name, String attr_name, + @Cast("unsigned char*") byte[] is_list, TF_Status status); + +public static native void TFE_OpSetAttrString(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const Pointer value, + @Cast("size_t") long length); +public static native void TFE_OpSetAttrString(TFE_Op op, + String attr_name, + @Const Pointer value, + @Cast("size_t") long length); +public static native void TFE_OpSetAttrInt(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("int64_t") long value); +public static native void TFE_OpSetAttrInt(TFE_Op op, String attr_name, + @Cast("int64_t") long value); +public static native void TFE_OpSetAttrFloat(TFE_Op op, @Cast("const char*") BytePointer attr_name, + float value); +public static native void TFE_OpSetAttrFloat(TFE_Op op, String attr_name, + float value); +public static native void TFE_OpSetAttrBool(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("unsigned char") byte value); +public static native void TFE_OpSetAttrBool(TFE_Op op, String attr_name, + @Cast("unsigned char") byte value); +public static native void TFE_OpSetAttrType(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType") int value); +public static native void TFE_OpSetAttrType(TFE_Op op, String attr_name, + @Cast("TF_DataType") int value); +// If the number of dimensions is unknown, `num_dims` must be set to +// -1 and `dims` can be null. If a dimension is unknown, the +// corresponding entry in the `dims` array must be -1. +public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongPointer dims, + int num_dims, + TF_Status out_status); +public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, + @Cast("const int64_t*") LongBuffer dims, + int num_dims, + TF_Status out_status); +public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") long[] dims, + int num_dims, + TF_Status out_status); +public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, + @Cast("const int64_t*") LongPointer dims, + int num_dims, + TF_Status out_status); +public static native void TFE_OpSetAttrShape(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongBuffer dims, + int num_dims, + TF_Status out_status); +public static native void TFE_OpSetAttrShape(TFE_Op op, String attr_name, + @Cast("const int64_t*") long[] dims, + int num_dims, + TF_Status out_status); + +// Sets the attribute attr_name to be a function specified by 'function'. +// +// TODO(ashankar,iga): Add this functionality to the C API for graph +// construction. Perhaps we want an AttrValueMap equivalent in the C API? +public static native void TFE_OpSetAttrFunction(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const TFE_Op value); +public static native void TFE_OpSetAttrFunction(TFE_Op op, + String attr_name, + @Const TFE_Op value); + +public static native void TFE_OpSetAttrFunctionName(TFE_Op op, @Cast("const char*") BytePointer attr_name, + @Cast("const char*") BytePointer data, @Cast("size_t") long length); +public static native void TFE_OpSetAttrFunctionName(TFE_Op op, String attr_name, + String data, @Cast("size_t") long length); + +public static native void TFE_OpSetAttrTensor(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + TF_Tensor tensor, + TF_Status status); +public static native void TFE_OpSetAttrTensor(TFE_Op op, + String attr_name, + TF_Tensor tensor, + TF_Status status); + +public static native void TFE_OpSetAttrStringList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") PointerPointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TFE_OpSetAttrStringList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TFE_OpSetAttrStringList(TFE_Op op, + String attr_name, + @Cast("const void*const*") @ByPtrPtr Pointer values, + @Cast("const size_t*") SizeTPointer lengths, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongPointer values, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + String attr_name, + @Cast("const int64_t*") LongBuffer values, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") long[] values, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + String attr_name, + @Cast("const int64_t*") LongPointer values, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const int64_t*") LongBuffer values, + int num_values); +public static native void TFE_OpSetAttrIntList(TFE_Op op, + String attr_name, + @Cast("const int64_t*") long[] values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const FloatPointer values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + String attr_name, + @Const FloatBuffer values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const float[] values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + String attr_name, + @Const FloatPointer values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const FloatBuffer values, + int num_values); +public static native void TFE_OpSetAttrFloatList(TFE_Op op, + String attr_name, + @Const float[] values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") BytePointer values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + String attr_name, + @Cast("const unsigned char*") ByteBuffer values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") byte[] values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + String attr_name, + @Cast("const unsigned char*") BytePointer values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const unsigned char*") ByteBuffer values, + int num_values); +public static native void TFE_OpSetAttrBoolList(TFE_Op op, + String attr_name, + @Cast("const unsigned char*") byte[] values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + String attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + String attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TFE_OpSetAttrTypeList(TFE_Op op, + String attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") PointerPointer dims, + @Const IntPointer num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr LongPointer dims, + @Const IntPointer num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr LongBuffer dims, + @Const IntBuffer num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr long[] dims, + @Const int[] num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr LongPointer dims, + @Const IntPointer num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, @Cast("const char*") BytePointer attr_name, @Cast("const int64_t**") @ByPtrPtr LongBuffer dims, + @Const IntBuffer num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrShapeList( + TFE_Op op, String attr_name, @Cast("const int64_t**") @ByPtrPtr long[] dims, + @Const int[] num_dims, int num_values, TF_Status out_status); +public static native void TFE_OpSetAttrFunctionList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Cast("const TFE_Op**") PointerPointer value, + int num_values); +public static native void TFE_OpSetAttrFunctionList(TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const @ByPtrPtr TFE_Op value, + int num_values); +public static native void TFE_OpSetAttrFunctionList(TFE_Op op, + String attr_name, + @Const @ByPtrPtr TFE_Op value, + int num_values); + +// Returns the length (number of tensors) of the input argument `input_name` +// found in the provided `op`. +public static native int TFE_OpGetInputLength(TFE_Op op, + @Cast("const char*") BytePointer input_name, + TF_Status status); +public static native int TFE_OpGetInputLength(TFE_Op op, + String input_name, + TF_Status status); + +// Returns the length (number of tensors) of the output argument `output_name` +// found in the provided `op`. +public static native int TFE_OpGetOutputLength(TFE_Op op, + @Cast("const char*") BytePointer output_name, + TF_Status status); +public static native int TFE_OpGetOutputLength(TFE_Op op, + String output_name, + TF_Status status); + +// Execute the operation defined by 'op' and return handles to computed +// tensors in `retvals`. +// +// 'retvals' must point to a pre-allocated array of TFE_TensorHandle* and +// '*num_retvals' should be set to the size of this array. It is an error if +// the size of 'retvals' is less than the number of outputs. This call sets +// *num_retvals to the number of outputs. +// +// If async execution is enabled, the call may simply enqueue the execution +// and return "non-ready" handles in `retvals`. Note that any handles contained +// in 'op' should not be mutated till the kernel execution actually finishes. +// +// For sync execution, if any of the inputs to `op` are not ready, this call +// will block till they become ready and then return when the kernel execution +// is done. +// TODO(agarwal): change num_retvals to int from int*. +public static native void TFE_Execute(TFE_Op op, @Cast("TFE_TensorHandle**") PointerPointer retvals, + IntPointer num_retvals, TF_Status status); +public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, + IntPointer num_retvals, TF_Status status); +public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, + IntBuffer num_retvals, TF_Status status); +public static native void TFE_Execute(TFE_Op op, @ByPtrPtr TFE_TensorHandle retvals, + int[] num_retvals, TF_Status status); + +// Add a function (serialized FunctionDef protocol buffer) to ctx so +// that it can be invoked using TFE_Execute. +public static native void TFE_ContextAddFunctionDef( + TFE_Context ctx, @Cast("const char*") BytePointer serialized_function_def, @Cast("size_t") long size, + TF_Status status); +public static native void TFE_ContextAddFunctionDef( + TFE_Context ctx, String serialized_function_def, @Cast("size_t") long size, + TF_Status status); + +// Adds a function (created from TF_GraphToFunction or +// TF_FunctionImportFunctionDef) to the context, allowing it to be executed with +// TFE_Execute by creating an op with the same name as the function. +public static native void TFE_ContextAddFunction(TFE_Context ctx, + TF_Function function, + TF_Status status); + +// Removes a function from the context. Once removed, you can no longer +// TFE_Execute it or TFE_Execute any TFE_Op which has it as an attribute or any +// other function which calls it as an attribute. +public static native void TFE_ContextRemoveFunction(TFE_Context ctx, + @Cast("const char*") BytePointer name, + TF_Status status); +public static native void TFE_ContextRemoveFunction(TFE_Context ctx, + String name, + TF_Status status); + +// Checks whether a function is registered under `name`. +public static native @Cast("unsigned char") byte TFE_ContextHasFunction(TFE_Context ctx, + @Cast("const char*") BytePointer name); +public static native @Cast("unsigned char") byte TFE_ContextHasFunction(TFE_Context ctx, + String name); + +// Enables tracing of RunMetadata on the ops executed from this context. +public static native void TFE_ContextEnableRunMetadata(TFE_Context ctx); + +// Disables tracing of RunMetadata on the ops executed from this context. +public static native void TFE_ContextDisableRunMetadata(TFE_Context ctx); + +// Populates the passed-in buffer with a serialized RunMetadata protocol buffer +// containing any run metadata information accumulated so far and clears this +// information. +// If async mode is enabled, this call blocks till all currently pending ops are +// done. +public static native void TFE_ContextExportRunMetadata(TFE_Context ctx, + TF_Buffer buf, + TF_Status status); + +// Some TF ops need a step container to be set to limit the lifetime of some +// resources (mostly TensorArray and Stack, used in while loop gradients in +// graph mode). Calling this on a context tells it to start a step. +public static native void TFE_ContextStartStep(TFE_Context ctx); + +// Ends a step. When there is no active step (that is, every started step has +// been ended) step containers will be cleared. Note: it is not safe to call +// TFE_ContextEndStep while ops that rely on the step container may be running. +public static native void TFE_ContextEndStep(TFE_Context ctx); + +// #ifdef __cplusplus +// Targeting ../Tensor.java + + + // namespace tensorflow + + +// #endif + +// #endif // TENSORFLOW_C_EAGER_C_API_H_ + + +// Parsed from tensorflow/c/eager/c_api_experimental.h + +/* 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. +==============================================================================*/ +// #ifndef TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ +// #define TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ + +// #include "tensorflow/c/c_api.h" +// #include "tensorflow/c/c_api_macros.h" +// #include "tensorflow/c/eager/c_api.h" + +// #ifdef __cplusplus +// #endif + +// Resets `op_to_reset` with `op_or_function_name` and `raw_device_name`. This +// is for performance optimization by reusing an exiting unused op rather than +// creating a new op every time. If `raw_device_name` is `NULL` or empty, it +// does not set the device name. If it's not `NULL`, then it attempts to parse +// and set the device name. It's effectively `TFE_OpSetDevice`, but it is faster +// than separately calling it because if the existing op has the same +// `raw_device_name`, it skips parsing and just leave as it is. +public static native void TFE_OpReset(TFE_Op op_to_reset, + @Cast("const char*") BytePointer op_or_function_name, + @Cast("const char*") BytePointer raw_device_name, + TF_Status status); +public static native void TFE_OpReset(TFE_Op op_to_reset, + String op_or_function_name, + String raw_device_name, + TF_Status status); + +// Enables only graph collection in RunMetadata on the functions executed from +// this context. +public static native void TFE_ContextEnableGraphCollection(TFE_Context ctx); + +// Disables only graph collection in RunMetadata on the functions executed from +// this context. +public static native void TFE_ContextDisableGraphCollection(TFE_Context ctx); +// Targeting ../TFE_MonitoringCounterCell.java + + + +// Atomically increments the value of the cell. The value must be non-negative. +public static native void TFE_MonitoringCounterCellIncrementBy( + TFE_MonitoringCounterCell cell, @Cast("int64_t") long value); + +// Retrieves the current value of the cell. +public static native @Cast("int64_t") long TFE_MonitoringCounterCellValue( + TFE_MonitoringCounterCell cell); +// Targeting ../TFE_MonitoringCounter0.java + + +// Returns a new Counter metric object. The caller should manage lifetime of +// the object. Using duplicate metric name will crash the program with fatal +// error. +public static native TFE_MonitoringCounter0 TFE_MonitoringNewCounter0( + @Cast("const char*") BytePointer name, TF_Status status, @Cast("const char*") BytePointer description); +public static native TFE_MonitoringCounter0 TFE_MonitoringNewCounter0( + String name, TF_Status status, String description); +// Deletes the Counter object. +public static native void TFE_MonitoringDeleteCounter0( + TFE_MonitoringCounter0 counter); +// Retrieves the cell from the Counter object. The Counter object will manage +// lifetime of the cell. +public static native TFE_MonitoringCounterCell TFE_MonitoringGetCellCounter0( + TFE_MonitoringCounter0 counter); +// Targeting ../TFE_MonitoringCounter1.java + + +public static native TFE_MonitoringCounter1 TFE_MonitoringNewCounter1( + @Cast("const char*") BytePointer name, TF_Status status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringCounter1 TFE_MonitoringNewCounter1( + String name, TF_Status status, String description, + String label1); +public static native void TFE_MonitoringDeleteCounter1( + TFE_MonitoringCounter1 counter); +public static native TFE_MonitoringCounterCell TFE_MonitoringGetCellCounter1( + TFE_MonitoringCounter1 counter, @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringCounterCell TFE_MonitoringGetCellCounter1( + TFE_MonitoringCounter1 counter, String label1); +// Targeting ../TFE_MonitoringCounter2.java + + +public static native TFE_MonitoringCounter2 TFE_MonitoringNewCounter2( + @Cast("const char*") BytePointer name, TF_Status status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringCounter2 TFE_MonitoringNewCounter2( + String name, TF_Status status, String description, + String label1, String label2); +public static native void TFE_MonitoringDeleteCounter2( + TFE_MonitoringCounter2 counter); +public static native TFE_MonitoringCounterCell TFE_MonitoringGetCellCounter2( + TFE_MonitoringCounter2 counter, @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringCounterCell TFE_MonitoringGetCellCounter2( + TFE_MonitoringCounter2 counter, String label1, String label2); +// Targeting ../TFE_MonitoringIntGaugeCell.java + + + +// Atomically set the value of the cell. +public static native void TFE_MonitoringIntGaugeCellSet( + TFE_MonitoringIntGaugeCell cell, @Cast("int64_t") long value); + +// Retrieves the current value of the cell. +public static native @Cast("int64_t") long TFE_MonitoringIntGaugeCellValue( + TFE_MonitoringIntGaugeCell cell); +// Targeting ../TFE_MonitoringIntGauge0.java + + +public static native TFE_MonitoringIntGauge0 TFE_MonitoringNewIntGauge0( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description); +public static native TFE_MonitoringIntGauge0 TFE_MonitoringNewIntGauge0( + String name, TF_Status out_status, String description); +public static native void TFE_MonitoringDeleteIntGauge0( + TFE_MonitoringIntGauge0 gauge); +public static native TFE_MonitoringIntGaugeCell TFE_MonitoringGetCellIntGauge0(TFE_MonitoringIntGauge0 gauge); +// Targeting ../TFE_MonitoringIntGauge1.java + + +public static native TFE_MonitoringIntGauge1 TFE_MonitoringNewIntGauge1( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringIntGauge1 TFE_MonitoringNewIntGauge1( + String name, TF_Status out_status, String description, + String label1); +public static native void TFE_MonitoringDeleteIntGauge1( + TFE_MonitoringIntGauge1 gauge); +public static native TFE_MonitoringIntGaugeCell TFE_MonitoringGetCellIntGauge1(TFE_MonitoringIntGauge1 gauge, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringIntGaugeCell TFE_MonitoringGetCellIntGauge1(TFE_MonitoringIntGauge1 gauge, + String label1); +// Targeting ../TFE_MonitoringIntGauge2.java + + +public static native TFE_MonitoringIntGauge2 TFE_MonitoringNewIntGauge2( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringIntGauge2 TFE_MonitoringNewIntGauge2( + String name, TF_Status out_status, String description, + String label1, String label2); +public static native void TFE_MonitoringDeleteIntGauge2( + TFE_MonitoringIntGauge2 gauge); +public static native TFE_MonitoringIntGaugeCell TFE_MonitoringGetCellIntGauge2(TFE_MonitoringIntGauge2 gauge, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringIntGaugeCell TFE_MonitoringGetCellIntGauge2(TFE_MonitoringIntGauge2 gauge, + String label1, String label2); +// Targeting ../TFE_MonitoringStringGaugeCell.java + + +public static native void TFE_MonitoringStringGaugeCellSet( + TFE_MonitoringStringGaugeCell cell, @Cast("const char*") BytePointer value); +public static native void TFE_MonitoringStringGaugeCellSet( + TFE_MonitoringStringGaugeCell cell, String value); +// Retrieves the string value and saves it in the buffer. +public static native void TFE_MonitoringStringGaugeCellValue( + TFE_MonitoringStringGaugeCell cell, TF_Buffer buf); +// Targeting ../TFE_MonitoringStringGauge0.java + + +public static native TFE_MonitoringStringGauge0 TFE_MonitoringNewStringGauge0( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description); +public static native TFE_MonitoringStringGauge0 TFE_MonitoringNewStringGauge0( + String name, TF_Status out_status, String description); +public static native void TFE_MonitoringDeleteStringGauge0( + TFE_MonitoringStringGauge0 gauge); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge0(TFE_MonitoringStringGauge0 gauge); +// Targeting ../TFE_MonitoringStringGauge1.java + + +public static native TFE_MonitoringStringGauge1 TFE_MonitoringNewStringGauge1( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringStringGauge1 TFE_MonitoringNewStringGauge1( + String name, TF_Status out_status, String description, + String label1); +public static native void TFE_MonitoringDeleteStringGauge1( + TFE_MonitoringStringGauge1 gauge); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge1(TFE_MonitoringStringGauge1 gauge, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge1(TFE_MonitoringStringGauge1 gauge, + String label1); +// Targeting ../TFE_MonitoringStringGauge2.java + + +public static native TFE_MonitoringStringGauge2 TFE_MonitoringNewStringGauge2( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringStringGauge2 TFE_MonitoringNewStringGauge2( + String name, TF_Status out_status, String description, + String label1, String label2); +public static native void TFE_MonitoringDeleteStringGauge2( + TFE_MonitoringStringGauge2 gauge); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge2(TFE_MonitoringStringGauge2 gauge, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge2(TFE_MonitoringStringGauge2 gauge, + String label1, String label2); +// Targeting ../TFE_MonitoringStringGauge3.java + + +public static native TFE_MonitoringStringGauge3 TFE_MonitoringNewStringGauge3( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2, @Cast("const char*") BytePointer label3); +public static native TFE_MonitoringStringGauge3 TFE_MonitoringNewStringGauge3( + String name, TF_Status out_status, String description, + String label1, String label2, String label3); +public static native void TFE_MonitoringDeleteStringGauge3( + TFE_MonitoringStringGauge3 gauge); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge3(TFE_MonitoringStringGauge3 gauge, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2, + @Cast("const char*") BytePointer label3); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge3(TFE_MonitoringStringGauge3 gauge, + String label1, String label2, + String label3); +// Targeting ../TFE_MonitoringStringGauge4.java + + +public static native TFE_MonitoringStringGauge4 TFE_MonitoringNewStringGauge4( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2, @Cast("const char*") BytePointer label3, + @Cast("const char*") BytePointer label4); +public static native TFE_MonitoringStringGauge4 TFE_MonitoringNewStringGauge4( + String name, TF_Status out_status, String description, + String label1, String label2, String label3, + String label4); +public static native void TFE_MonitoringDeleteStringGauge4( + TFE_MonitoringStringGauge4 gauge); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge4(TFE_MonitoringStringGauge4 gauge, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2, + @Cast("const char*") BytePointer label3, @Cast("const char*") BytePointer label4); +public static native TFE_MonitoringStringGaugeCell TFE_MonitoringGetCellStringGauge4(TFE_MonitoringStringGauge4 gauge, + String label1, String label2, + String label3, String label4); +// Targeting ../TFE_MonitoringBoolGaugeCell.java + + +public static native void TFE_MonitoringBoolGaugeCellSet( + TFE_MonitoringBoolGaugeCell cell, @Cast("bool") boolean value); +public static native @Cast("bool") boolean TFE_MonitoringBoolGaugeCellValue( + TFE_MonitoringBoolGaugeCell cell); +// Targeting ../TFE_MonitoringBoolGauge0.java + + +public static native TFE_MonitoringBoolGauge0 TFE_MonitoringNewBoolGauge0( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description); +public static native TFE_MonitoringBoolGauge0 TFE_MonitoringNewBoolGauge0( + String name, TF_Status out_status, String description); +public static native void TFE_MonitoringDeleteBoolGauge0( + TFE_MonitoringBoolGauge0 gauge); +public static native TFE_MonitoringBoolGaugeCell TFE_MonitoringGetCellBoolGauge0(TFE_MonitoringBoolGauge0 gauge); +// Targeting ../TFE_MonitoringBoolGauge1.java + + +public static native TFE_MonitoringBoolGauge1 TFE_MonitoringNewBoolGauge1( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringBoolGauge1 TFE_MonitoringNewBoolGauge1( + String name, TF_Status out_status, String description, + String label1); +public static native void TFE_MonitoringDeleteBoolGauge1( + TFE_MonitoringBoolGauge1 gauge); +public static native TFE_MonitoringBoolGaugeCell TFE_MonitoringGetCellBoolGauge1(TFE_MonitoringBoolGauge1 gauge, + @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringBoolGaugeCell TFE_MonitoringGetCellBoolGauge1(TFE_MonitoringBoolGauge1 gauge, + String label1); +// Targeting ../TFE_MonitoringBoolGauge2.java + + +public static native TFE_MonitoringBoolGauge2 TFE_MonitoringNewBoolGauge2( + @Cast("const char*") BytePointer name, TF_Status out_status, @Cast("const char*") BytePointer description, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringBoolGauge2 TFE_MonitoringNewBoolGauge2( + String name, TF_Status out_status, String description, + String label1, String label2); +public static native void TFE_MonitoringDeleteBoolGauge2( + TFE_MonitoringBoolGauge2 gauge); +public static native TFE_MonitoringBoolGaugeCell TFE_MonitoringGetCellBoolGauge2(TFE_MonitoringBoolGauge2 gauge, + @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringBoolGaugeCell TFE_MonitoringGetCellBoolGauge2(TFE_MonitoringBoolGauge2 gauge, + String label1, String label2); +// Targeting ../TFE_MonitoringSamplerCell.java + + + +// Atomically add the value of the cell. +public static native void TFE_MonitoringSamplerCellAdd( + TFE_MonitoringSamplerCell cell, double value); + +// Retrieves the current value of the cell. The return value is a HistogramProto +// saved in the buffer. +public static native void TFE_MonitoringSamplerCellValue( + TFE_MonitoringSamplerCell cell, TF_Buffer buf); +// Targeting ../TFE_MonitoringBuckets.java + + +public static native TFE_MonitoringBuckets TFE_MonitoringNewExponentialBuckets(double scale, double growth_factor, + int bucket_count); +public static native void TFE_MonitoringDeleteBuckets( + TFE_MonitoringBuckets buckets); +// Targeting ../TFE_MonitoringSampler0.java + + +public static native TFE_MonitoringSampler0 TFE_MonitoringNewSampler0( + @Cast("const char*") BytePointer name, TFE_MonitoringBuckets buckets, TF_Status out_status, + @Cast("const char*") BytePointer description); +public static native TFE_MonitoringSampler0 TFE_MonitoringNewSampler0( + String name, TFE_MonitoringBuckets buckets, TF_Status out_status, + String description); +public static native void TFE_MonitoringDeleteSampler0( + TFE_MonitoringSampler0 sampler); +public static native TFE_MonitoringSamplerCell TFE_MonitoringGetCellSampler0( + TFE_MonitoringSampler0 sampler); +// Targeting ../TFE_MonitoringSampler1.java + + +public static native TFE_MonitoringSampler1 TFE_MonitoringNewSampler1( + @Cast("const char*") BytePointer name, TFE_MonitoringBuckets buckets, TF_Status out_status, + @Cast("const char*") BytePointer description, @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringSampler1 TFE_MonitoringNewSampler1( + String name, TFE_MonitoringBuckets buckets, TF_Status out_status, + String description, String label1); +public static native void TFE_MonitoringDeleteSampler1( + TFE_MonitoringSampler1 sampler); +public static native TFE_MonitoringSamplerCell TFE_MonitoringGetCellSampler1( + TFE_MonitoringSampler1 sampler, @Cast("const char*") BytePointer label1); +public static native TFE_MonitoringSamplerCell TFE_MonitoringGetCellSampler1( + TFE_MonitoringSampler1 sampler, String label1); +// Targeting ../TFE_MonitoringSampler2.java + + +public static native TFE_MonitoringSampler2 TFE_MonitoringNewSampler2( + @Cast("const char*") BytePointer name, TFE_MonitoringBuckets buckets, TF_Status out_status, + @Cast("const char*") BytePointer description, @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringSampler2 TFE_MonitoringNewSampler2( + String name, TFE_MonitoringBuckets buckets, TF_Status out_status, + String description, String label1, String label2); +public static native void TFE_MonitoringDeleteSampler2( + TFE_MonitoringSampler2 sampler); +public static native TFE_MonitoringSamplerCell TFE_MonitoringGetCellSampler2( + TFE_MonitoringSampler2 sampler, @Cast("const char*") BytePointer label1, @Cast("const char*") BytePointer label2); +public static native TFE_MonitoringSamplerCell TFE_MonitoringGetCellSampler2( + TFE_MonitoringSampler2 sampler, String label1, String label2); + +// Sets whether to use TFRT +public static native void TFE_ContextOptionsSetTfrt(TFE_ContextOptions arg0, + @Cast("bool") boolean use_tfrt); + +// Returns the context_id from the EagerContext which is used by the +// EagerService to maintain consistency between client and worker. The +// context_id is initialized with a dummy value and is later set when the worker +// is initialized (either locally or remotely). The context_id can change during +// the process lifetime although this should cause the worker to be +// reinitialized (e.g. cleared caches) as well. +public static native @Cast("uint64_t") long TFE_GetContextId(TFE_Context ctx); +// Targeting ../TFE_CancellationManager.java + + +// Targeting ../TFE_CancelCallback.java + + +public static native TFE_CancellationManager TFE_NewCancellationManager(); +public static native @Cast("bool") boolean TFE_CancellationManagerIsCancelled( + TFE_CancellationManager arg0); +public static native @Cast("bool") boolean TFE_CancellationManagerIsCancelling( + TFE_CancellationManager arg0); +public static native void TFE_CancellationManagerStartCancel( + TFE_CancellationManager arg0); +public static native @Cast("TFE_CancellationToken") long TFE_CancellationManagerGetToken( + TFE_CancellationManager arg0); +public static native @Cast("bool") boolean TFE_CancellationManagerRegisterCallback( + TFE_CancellationManager arg0, @Cast("TFE_CancellationToken") long token, + @Const TFE_CancelCallback c_callback, @Cast("const char*") BytePointer callback_name); +public static native @Cast("bool") boolean TFE_CancellationManagerRegisterCallback( + TFE_CancellationManager arg0, @Cast("TFE_CancellationToken") long token, + @Const TFE_CancelCallback c_callback, String callback_name); +public static native @Cast("bool") boolean TFE_CancellationManagerDeregisterCallback( + TFE_CancellationManager arg0, @Cast("TFE_CancellationToken") long token); +public static native @Cast("bool") boolean TFE_CancellationManagerTryDeregisterCallback( + TFE_CancellationManager arg0, @Cast("TFE_CancellationToken") long token); +public static native void TFE_DeleteCancellationManager( + TFE_CancellationManager arg0); + +// Associates the given `cancellation_manager` with `op`, so that invoking +// `TFE_CancellationManagerStartCancel(cancellation_manager)` will cancel the +// execution of `op`. +public static native void TFE_OpSetCancellationManager( + TFE_Op op, TFE_CancellationManager cancellation_manager, + TF_Status status); +// Targeting ../TFE_Executor.java + + + +// Creates a new eager Executor. Nodes in one executor are guaranteed to be +// executed in sequence. Assigning nodes to different executors allows executing +// nodes in parallel. +// in_flight_nodes_limit: when is_async is true, this value controls the +// maximum number of in flight async nodes. Enqueuing of additional async ops +// after the limit is reached blocks until some inflight nodes finishes. +// The effect is bounding the memory held by inflight TensorHandles that are +// referenced by the inflight nodes. +// A recommended value has not been established. +// A value of 0 removes the limit, which is the behavior of TensorFlow 2.11. +// When is_async is false, the value is ignored. +public static native TFE_Executor TFE_NewExecutor( + @Cast("bool") boolean is_async, @Cast("bool") boolean enable_streaming_enqueue, int in_flight_nodes_limit); + +// Deletes the eager Executor without waiting for enqueued nodes. Please call +// TFE_ExecutorWaitForAllPendingNodes before calling this API if you want to +// make sure all nodes are finished. +public static native void TFE_DeleteExecutor(TFE_Executor arg0); + +// Returns true if the executor is in async mode. +public static native @Cast("bool") boolean TFE_ExecutorIsAsync(TFE_Executor arg0); + +// Causes the calling thread to block till all ops dispatched in this executor +// have been executed. Note that "execution" here refers to kernel execution / +// scheduling of copies, etc. Similar to sync execution, it doesn't guarantee +// that lower level device queues (like GPU streams) have been flushed. +// +// This call may not block for execution of ops enqueued concurrently with this +// call. +public static native void TFE_ExecutorWaitForAllPendingNodes( + TFE_Executor arg0, TF_Status status); + +// When an error happens, any pending operations are discarded, and newly issued +// ops return an error. This call clears the error state and re-enables +// execution of newly issued ops. +// +// Note that outputs of discarded ops remain in a corrupt state and should not +// be used for future calls. +// TODO(agarwal): mark the affected handles and raise errors if they are used. +public static native void TFE_ExecutorClearError(TFE_Executor arg0); + +// Sets a custom Executor for the current thread. All nodes created by this +// thread will be added to this Executor. It will override the current executor. +public static native void TFE_ContextSetExecutorForThread(TFE_Context arg0, + TFE_Executor arg1); + +// Returns the Executor for the current thread. +public static native TFE_Executor TFE_ContextGetExecutorForThread( + TFE_Context arg0); + +// ----------------------------------------------------------------------------- +// Dynamic cluster API. + +// Update an existing context with a new set of servers defined in a ServerDef +// proto. Servers can be added to and removed from the list of remote workers +// in the context. A New set of servers identified by the ServerDef must be up +// when the context is updated. +// +// This API is for experimental usage and may be subject to change. +public static native void TFE_ContextUpdateServerDef(TFE_Context ctx, + int keep_alive_secs, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// This API is for experimental usage and may be subject to change. +public static native void TFE_ContextUpdateServerDefWithTimeout( + TFE_Context ctx, int keep_alive_secs, @Const Pointer proto, @Cast("size_t") long proto_len, + @Cast("int64_t") long init_timeout_in_ms, TF_Status status); + +// This API is for experimental usage and may be subject to change. +public static native void TFE_ContextSetServerDefWithTimeout( + TFE_Context ctx, int keep_alive_secs, @Const Pointer proto, @Cast("size_t") long proto_len, + @Cast("int64_t") long init_timeout_in_ms, TF_Status status, + @Cast("bool") boolean clear_existing_contexts); + +// Set server def with retries and timeout. This is helpful for fault-tolerant +// initial connection in high-preemption environments, such as +// ParameterServerStrategy training. +// This API is for experimental usage and may be subject to change. +public static native void TFE_ContextSetServerDefWithTimeoutAndRetries( + TFE_Context ctx, int keep_alive_secs, @Const Pointer proto, @Cast("size_t") long proto_len, + @Cast("int64_t") long init_timeout_in_ms, int retries, TF_Status status, + @Cast("bool") boolean clear_existing_contexts); + +// Checks whether a remote worker is alive or not. This will return true even if +// the context doesn't exist on the remote worker. +public static native @Cast("bool") boolean TFE_ContextCheckAlive(TFE_Context ctx, + @Cast("const char*") BytePointer worker_name, + TF_Status status); +public static native @Cast("bool") boolean TFE_ContextCheckAlive(TFE_Context ctx, + String worker_name, + TF_Status status); + +// Sync pending nodes in local executors (including the context default executor +// and thread executors) and streaming requests to remote executors, and get the +// combined status. +public static native void TFE_ContextAsyncWait(TFE_Context ctx, + TF_Status status); + +// This function will block till the operation that produces `h` has +// completed. This is only valid on local TFE_TensorHandles. The pointer +// returned will be on the device in which the TFE_TensorHandle resides (so e.g. +// for a GPU tensor this will return a pointer to GPU memory). The pointer is +// only guaranteed to be valid until TFE_DeleteTensorHandle is called on this +// TensorHandle. Only supports POD data types. +public static native Pointer TFE_TensorHandleDevicePointer(TFE_TensorHandle arg0, + TF_Status arg1); + +// This function will block till the operation that produces `h` has +// completed. This is only valid on local TFE_TensorHandles. Returns the size in +// bytes of the memory pointed to by the device pointer returned above. +public static native @Cast("size_t") long TFE_TensorHandleDeviceMemorySize(TFE_TensorHandle arg0, + TF_Status arg1); + +// Creates a new TensorHandle from memory residing in the physical device +// device_name. Takes ownership of the memory, and will call deleter to release +// it after TF no longer needs it or in case of error. +// +// Custom devices must use TFE_NewCustomDeviceTensorHandle instead. +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, @Cast("const char*") BytePointer device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") LongPointer dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, String device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") LongBuffer dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, @Cast("const char*") BytePointer device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") long[] dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, String device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") LongPointer dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, @Cast("const char*") BytePointer device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") LongBuffer dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); +public static native TFE_TensorHandle TFE_NewTensorHandleFromDeviceMemory( + TFE_Context ctx, String device_name, @Cast("TF_DataType") int arg2, @Cast("const int64_t*") long[] dims, + int num_dims, Pointer data, @Cast("size_t") long len, + Deallocator_Pointer_long_Pointer deallocator, + Pointer deallocator_arg, TF_Status status); + +// Retrieves the address space (i.e. job, replia, task) of the local host and +// saves it in the buffer. +public static native void TFE_HostAddressSpace(TFE_Context ctx, + TF_Buffer buf); +// Targeting ../TFE_OpAttrs.java + + + +// Fetch a reference to `op`'s attributes. The returned reference is only valid +// while `op` is alive. +public static native @Const TFE_OpAttrs TFE_OpGetAttrs(@Const TFE_Op op); +// Add attributes in `attrs` to `op`. +// +// Does not overwrite or update existing attributes, but adds new ones. +public static native void TFE_OpAddAttrs(TFE_Op op, @Const TFE_OpAttrs attrs); + +// Serialize `attrs` as a tensorflow::NameAttrList protocol buffer (into `buf`), +// containing the op name and a map of its attributes. +public static native void TFE_OpAttrsSerialize(@Const TFE_OpAttrs attrs, + TF_Buffer buf, + TF_Status status); + +// Set an op's attribute from a serialized AttrValue protocol buffer. +// +// Analogous to TF_SetAttrValueProto for building graph operations. +public static native void TFE_OpSetAttrValueProto(@Const TFE_Op op, + @Cast("const char*") BytePointer attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); +public static native void TFE_OpSetAttrValueProto(@Const TFE_Op op, + String attr_name, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// TODO(b/166642410): It would be nice, for custom devices and for other users, +// to have a non-string representation of devices (TF_Device) extracted from +// tensors/ops/etc. and usable in APIs like OpSetDevice/ResetOp/etc. + +public static final int TFE_CUSTOM_DEVICE_VERSION = 4; +// Targeting ../TFE_CustomDevice.java + + + +// Registers a custom device for use with eager execution. +// +// Eager operations may be placed on this device, e.g. `with +// tf.device("CUSTOM"):` from Python if `device_name` for this call is +// "/job:localhost/replica:0/task:0/device:CUSTOM:0". +// +// The custom device defines copy operations for moving TensorHandles on and +// off, and an execution operation for named operations. Often execution will +// simply wrap op execution on one or more physical devices. +// +// device_info is an opaque caller-defined type stored with the custom device +// which is passed to the functions referenced in the TFE_CustomDevice struct +// `device` (execute, delete_device, etc.). It can for example contain the +// names of wrapped devices. +// +// There are currently no graph semantics implemented for registered custom +// devices, so executing tf.functions which contain operations placed on the +// custom devices will fail. +// +// `device_name` must not name an existing physical or custom device. It must +// follow the format: +// +// /job:/replica:/task:/device:: +// +// If the device is successfully registered, `status` is set to TF_OK. Otherwise +// the device is not usable. In case of a bad status, `device.delete_device` is +// still called on `device_info` (i.e. the caller does not retain ownership). +// +// This API is highly experimental, and in particular is expected to change when +// it starts supporting operations with attributes and when tf.function support +// is added. +public static native void TFE_RegisterCustomDevice(TFE_Context ctx, + @ByVal TFE_CustomDevice device, + @Cast("const char*") BytePointer device_name, + Pointer device_info, + TF_Status status); +public static native void TFE_RegisterCustomDevice(TFE_Context ctx, + @ByVal TFE_CustomDevice device, + String device_name, + Pointer device_info, + TF_Status status); + +// Returns whether `device_name` maps to a registered custom device. +public static native @Cast("bool") boolean TFE_IsCustomDevice(TFE_Context ctx, + @Cast("const char*") BytePointer device_name); +public static native @Cast("bool") boolean TFE_IsCustomDevice(TFE_Context ctx, + String device_name); +// Targeting ../TFE_CustomDeviceTensorHandle.java + + + +// Creates a new TensorHandle from memory residing in a custom device. Takes +// ownership of the memory pointed to by `tensor_handle_data`, and calls +// `methods.deallocator` to release it after TF no longer needs it or in case of +// an error. +// +// This call is similar to `TFE_NewTensorHandleFromDeviceMemory`, but supports +// custom devices instead of physical devices and does not require blocking +// waiting for exact shapes. +public static native TFE_TensorHandle TFE_NewCustomDeviceTensorHandle( + TFE_Context arg0, @Cast("const char*") BytePointer device_name, @Cast("TF_DataType") int arg2, Pointer data, + @ByVal TFE_CustomDeviceTensorHandle methods, TF_Status status); +public static native TFE_TensorHandle TFE_NewCustomDeviceTensorHandle( + TFE_Context arg0, String device_name, @Cast("TF_DataType") int arg2, Pointer data, + @ByVal TFE_CustomDeviceTensorHandle methods, TF_Status status); + +public static native void TFE_ContextGetFunctionDef(TFE_Context ctx, + @Cast("const char*") BytePointer function_name, + TF_Buffer buf, + TF_Status status); +public static native void TFE_ContextGetFunctionDef(TFE_Context ctx, + String function_name, + TF_Buffer buf, + TF_Status status); + +// Get GraphDebugInfo containing stack traces mapping to node names +public static native void TFE_ContextGetGraphDebugInfo( + TFE_Context ctx, @Cast("const char*") BytePointer function_name, TF_Buffer buf, + TF_Status status); +public static native void TFE_ContextGetGraphDebugInfo( + TFE_Context ctx, String function_name, TF_Buffer buf, + TF_Status status); + +// Extracts a TF_Function from the context. +// Must call TF_DeleteFunction on the returned value. +public static native TF_Function TFE_ContextGetFunction(TFE_Context ctx, + @Cast("const char*") BytePointer name, + TF_Status status); +public static native TF_Function TFE_ContextGetFunction(TFE_Context ctx, + String name, + TF_Status status); + +// Allocate and return a new Tensor on the host. +// +// The caller must set the Tensor values by writing them to the pointer returned +// by TF_TensorData with length TF_TensorByteSize. +public static native TF_Tensor TFE_AllocateHostTensor(TFE_Context ctx, + @Cast("TF_DataType") int dtype, + @Cast("const int64_t*") LongPointer dims, + int num_dims, + TF_Status status); +public static native TF_Tensor TFE_AllocateHostTensor(TFE_Context ctx, + @Cast("TF_DataType") int dtype, + @Cast("const int64_t*") LongBuffer dims, + int num_dims, + TF_Status status); +public static native TF_Tensor TFE_AllocateHostTensor(TFE_Context ctx, + @Cast("TF_DataType") int dtype, + @Cast("const int64_t*") long[] dims, + int num_dims, + TF_Status status); + +// Given a Tensor, wrap it with a TensorHandle +// +// Similar to TFE_NewTensorHandle, but includes a pointer to the TFE_Context. +// The context should be identical to that of the Tensor. +public static native TFE_TensorHandle TFE_NewTensorHandleFromTensor( + TFE_Context ctx, TF_Tensor t, TF_Status status); + +// Create a packed TensorHandle with the given list of TensorHandles. +// If `handles` are on the same device, assign the same device to the packed +// handle; if `handles` are on different deivces, assign a CompositeDevice to +// it. +public static native TFE_TensorHandle TFE_CreatePackedTensorHandle( + TFE_Context ctx, @Cast("TFE_TensorHandle**") PointerPointer handles, IntPointer num_handles, + TF_Status status); +public static native TFE_TensorHandle TFE_CreatePackedTensorHandle( + TFE_Context ctx, @ByPtrPtr TFE_TensorHandle handles, IntPointer num_handles, + TF_Status status); +public static native TFE_TensorHandle TFE_CreatePackedTensorHandle( + TFE_Context ctx, @ByPtrPtr TFE_TensorHandle handles, IntBuffer num_handles, + TF_Status status); +public static native TFE_TensorHandle TFE_CreatePackedTensorHandle( + TFE_Context ctx, @ByPtrPtr TFE_TensorHandle handles, int[] num_handles, + TF_Status status); + +// Configure soft device placement policy for the eager executor. Note this +// policy is applied to any subsequent op executions. +public static native void TFE_ContextSetSoftDevicePlacement(TFE_Context ctx, + @Cast("unsigned char") byte enable, + TF_Status status); + +// Configure device placement policy logging for the eager executor. Note this +// policy is applied to any subsequent op executions. +public static native void TFE_ContextSetLogDevicePlacement(TFE_Context ctx, + @Cast("unsigned char") byte enable, + TF_Status status); + +// Enables running eager ops as function. +public static native void TFE_ContextSetRunEagerOpAsFunction(TFE_Context ctx, + @Cast("unsigned char") byte enable, + TF_Status status); + +// Enables rewrite jit_compile functions. +public static native void TFE_ContextSetJitCompileRewrite(TFE_Context ctx, + @Cast("unsigned char") byte enable, + TF_Status status); + +// Returns the device type of the operation that produced `h`. +public static native @Cast("const char*") BytePointer TFE_TensorHandleDeviceType( + TFE_TensorHandle h, TF_Status status); + +// Returns the device ID of the operation that produced `h`. +public static native int TFE_TensorHandleDeviceID(TFE_TensorHandle h, + TF_Status status); + +// Returns the status for the tensor handle. In TFRT, a tensor handle can carry +// error info if error happens. If so, the status will be set with the error +// info. If not, status will be set as OK. +public static native void TFE_TensorHandleGetStatus(TFE_TensorHandle h, + TF_Status status); + +// Get a comma-separated list of op names executed in graph functions dispatched +// to `ctx`. This feature is currently only enabled for TFRT debug builds, for +// performance and simplicity reasons. +public static native void TFE_GetExecutedOpNames(TFE_Context ctx, + TF_Buffer buf, + TF_Status status); + +// Set logical devices to the context's device manager. +// If logical devices are already configured at context initialization +// through TFE_ContextOptions, this method should not be called. +public static native void TFE_SetLogicalCpuDevices(TFE_Context ctx, + int num_cpus, + @Cast("const char*") BytePointer prefix, + TF_Status status); +public static native void TFE_SetLogicalCpuDevices(TFE_Context ctx, + int num_cpus, + String prefix, + TF_Status status); + +// Set configuration key and value using coordination service. +// If coordination service is enabled, the key-value will be stored on the +// leader and become accessible to all workers in the cluster. +// Currently, a config key can only be set with one value, and subsequently +// setting the same key will lead to errors. +// +// Note that the key-values are only expected to be used for cluster +// configuration data, and should not be used for storing a large amount of data +// or being accessed very frequently. +public static native void TFE_InsertConfigKeyValue(TFE_Context ctx, + @Cast("const char*") BytePointer key, + @Cast("const char*") BytePointer value, + TF_Status status); +public static native void TFE_InsertConfigKeyValue(TFE_Context ctx, + String key, + String value, + TF_Status status); + +// Get configuration key and value using coordination service. +// The config key must be set before getting its value. Getting value of +// non-existing config keys will result in errors. +// If `timeout_in_ms=0`, this call will block until the key-value is set or the +// worker shuts down. +public static native void TFE_GetConfigKeyValue(TFE_Context ctx, + @Cast("const char*") BytePointer key, + @Cast("int64_t") long timeout_in_ms, + TF_Buffer value_buf, + TF_Status status); +public static native void TFE_GetConfigKeyValue(TFE_Context ctx, + String key, + @Cast("int64_t") long timeout_in_ms, + TF_Buffer value_buf, + TF_Status status); + +// Delete configuration key-value. If `key` is a directory, recursively clean up +// all key-values under the path specified by `key`. +public static native void TFE_DeleteConfigKeyValue(TFE_Context ctx, + @Cast("const char*") BytePointer key, + TF_Status status); +public static native void TFE_DeleteConfigKeyValue(TFE_Context ctx, + String key, + TF_Status status); + +// Report error (specified by error_code and error_message) to other tasks in +// the cluster. +public static native void TFE_ReportErrorToCluster(TFE_Context ctx, + int error_code, + @Cast("const char*") BytePointer error_message, + TF_Status status); +public static native void TFE_ReportErrorToCluster(TFE_Context ctx, + int error_code, + String error_message, + TF_Status status); + +// Get task states from the Coordination Service. +public static native void TFE_GetTaskStates(TFE_Context ctx, + @Const @ByRef TF_Buffer tasks, + Pointer states, TF_Status status); + +public static native void TFE_WaitAtBarrier(TFE_Context ctx, + @Cast("const char*") BytePointer barrier_id, + @Cast("int64_t") long barrier_timeout_in_ms, + TF_Status status); +public static native void TFE_WaitAtBarrier(TFE_Context ctx, + String barrier_id, + @Cast("int64_t") long barrier_timeout_in_ms, + TF_Status status); + +public static native void TFE_InitializeLocalOnlyContext(TFE_Context ctx, + int keep_alive_secs, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_EAGER_C_API_EXPERIMENTAL_H_ + + +// Parsed from tensorflow/c/c_api_experimental.h + +/* 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. +==============================================================================*/ + +// #ifndef TENSORFLOW_C_C_API_EXPERIMENTAL_H_ +// #define TENSORFLOW_C_C_API_EXPERIMENTAL_H_ + +// #include +// #include + +// #include "tensorflow/c/c_api.h" +// #include "tensorflow/c/c_api_macros.h" +// #include "tensorflow/c/eager/c_api.h" + +// -------------------------------------------------------------------------- +// Experimental C API for TensorFlow. +// +// The API here is subject to changes in the future. +// -------------------------------------------------------------------------- + +// #ifdef __cplusplus +// #endif + +// When `enable` is true, set +// tensorflow.ConfigProto.OptimizerOptions.global_jit_level to ON_1, and also +// set XLA flag values to prepare for XLA compilation. Otherwise set +// global_jit_level to OFF. +// +// This and the next API are syntax sugar over TF_SetConfig(), and is used by +// clients that cannot read/write the tensorflow.ConfigProto proto. +// TODO: Migrate to TF_CreateConfig() below. +public static native void TF_EnableXLACompilation(TF_SessionOptions options, + @Cast("unsigned char") byte enable); + +// Set XLA's internal BuildXlaOpsPassFlags.tf_xla_enable_lazy_compilation to the +// value of 'enabled'. Also returns the original value of that flag. +// +// Use in tests to allow XLA to fallback to TF classic. This has global effect. +public static native @Cast("unsigned char") byte TF_SetXlaEnableLazyCompilation( + @Cast("unsigned char") byte enable); +public static native @Cast("unsigned char") byte TF_SetTfXlaCpuGlobalJit(@Cast("unsigned char") byte enable); + +// Sets XLA's auto jit mode according to the specified string, which is parsed +// as if passed in XLA_FLAGS. This has global effect. +public static native void TF_SetXlaAutoJitMode(@Cast("const char*") BytePointer mode); +public static native void TF_SetXlaAutoJitMode(String mode); + +// Returns whether the single GPU or general XLA auto jit optimizations are +// enabled through MarkForCompilationPassFlags. +public static native @Cast("unsigned char") byte TF_GetXlaAutoJitEnabled(); + +// Sets XLA's minimum cluster size. This has global effect. +public static native void TF_SetXlaMinClusterSize(int size); + +// Gets/Sets TF/XLA flag for whether(true) or not(false) to disable constant +// folding. This is for testing to ensure that XLA is being tested rather than +// Tensorflow's CPU implementation through constant folding. +public static native @Cast("unsigned char") byte TF_GetXlaConstantFoldingDisabled(); +public static native void TF_SetXlaConstantFoldingDisabled( + @Cast("unsigned char") byte should_enable); + +// Create a serialized tensorflow.ConfigProto proto, where: +// +// a) ConfigProto.optimizer_options.global_jit_level is set to ON_1 if +// `enable_xla_compilation` is non-zero, and OFF otherwise. +// b) ConfigProto.gpu_options.allow_growth is set to `gpu_memory_allow_growth`. +// c) ConfigProto.device_count is set to `num_cpu_devices`. +public static native TF_Buffer TF_CreateConfig( + @Cast("unsigned char") byte enable_xla_compilation, @Cast("unsigned char") byte gpu_memory_allow_growth, + @Cast("unsigned int") int num_cpu_devices); + +// Create a serialized tensorflow.RunOptions proto, where RunOptions.trace_level +// is set to FULL_TRACE if `enable_full_trace` is non-zero, and NO_TRACE +// otherwise. +public static native TF_Buffer TF_CreateRunOptions( + @Cast("unsigned char") byte enable_full_trace); + +// Returns the graph content in a human-readable format, with length set in +// `len`. The format is subject to change in the future. +// The returned string is heap-allocated, and caller should call free() on it. +public static native @Cast("const char*") BytePointer TF_GraphDebugString(TF_Graph graph, + @Cast("size_t*") SizeTPointer len); + +// Returns the function content in a human-readable format, with length set in +// `len`. The format is subject to change in the future. +// The returned string is heap-allocated, and caller should call free() on it. +// +// Do not return const char*, because some foreign language binding +// (e.g. swift) cannot then call free() on the returned pointer. +public static native @Cast("char*") BytePointer TF_FunctionDebugString(TF_Function func, + @Cast("size_t*") SizeTPointer len); + +// On success, dequeues a tensor from a TF-managed FifoQueue given by +// `tensor_id`, associated with `session`. There must be a graph node named +// "fifo_queue_dequeue_", to be executed by this API call. + +// Caller must call TF_DeleteTensor() over the returned tensor. If the queue is +// empty, this call is blocked. +// +// Tensors are enqueued via the corresponding TF enqueue op. +// TODO(hongm): Add support for `timeout_ms`. +public static native TF_Tensor TF_DequeueNamedTensor(TF_Session session, + int tensor_id, + TF_Status status); + +// On success, enqueues `tensor` into a TF-managed FifoQueue given by +// `tensor_id`, associated with `session`. There must be a graph node named +// "fifo_queue_enqueue_", to be executed by this API call. It reads +// from a placeholder node "arg_tensor_enqueue_". +// +// `tensor` is still owned by the caller. This call will be blocked if the queue +// has reached its capacity, and will be unblocked when the queued tensors again +// drop below the capacity due to dequeuing. +// +// Tensors are dequeued via the corresponding TF dequeue op. +// TODO(hongm): Add support for `timeout_ms`. +public static native void TF_EnqueueNamedTensor(TF_Session session, + int tensor_id, + TF_Tensor tensor, + TF_Status status); +// Create a serialized tensorflow.ServerDef proto. +public static native TF_Buffer TFE_GetServerDef(@Cast("const char*") BytePointer text_proto, TF_Status status); +public static native TF_Buffer TFE_GetServerDef(String text_proto, TF_Status status); + +public static native void TF_MakeInternalErrorStatus(TF_Status status, + @Cast("const char*") BytePointer errMsg); +public static native void TF_MakeInternalErrorStatus(TF_Status status, + String errMsg); +// Targeting ../TF_CheckpointReader.java + + +public static native TF_CheckpointReader TF_NewCheckpointReader( + @Cast("const char*") BytePointer filename, TF_Status status); +public static native TF_CheckpointReader TF_NewCheckpointReader( + String filename, TF_Status status); +public static native void TF_DeleteCheckpointReader( + TF_CheckpointReader reader); +public static native int TF_CheckpointReaderHasTensor( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name); +public static native int TF_CheckpointReaderHasTensor( + TF_CheckpointReader reader, String name); +// Get the variable name at the given index +public static native @Cast("const char*") BytePointer TF_CheckpointReaderGetVariable( + TF_CheckpointReader reader, int index); +// Get the number of variable in the checkpoint +public static native int TF_CheckpointReaderSize(TF_CheckpointReader reader); +// Get the DataType of a variable +public static native @Cast("TF_DataType") int TF_CheckpointReaderGetVariableDataType( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name); +public static native @Cast("TF_DataType") int TF_CheckpointReaderGetVariableDataType( + TF_CheckpointReader reader, String name); +// Read the shape of a variable and write to `dims` +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name, @Cast("int64_t*") LongPointer dims, int num_dims, + TF_Status status); +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, String name, @Cast("int64_t*") LongBuffer dims, int num_dims, + TF_Status status); +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name, @Cast("int64_t*") long[] dims, int num_dims, + TF_Status status); +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, String name, @Cast("int64_t*") LongPointer dims, int num_dims, + TF_Status status); +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name, @Cast("int64_t*") LongBuffer dims, int num_dims, + TF_Status status); +public static native void TF_CheckpointReaderGetVariableShape( + TF_CheckpointReader reader, String name, @Cast("int64_t*") long[] dims, int num_dims, + TF_Status status); +// Get the number of dimension of a variable +public static native int TF_CheckpointReaderGetVariableNumDims( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name); +public static native int TF_CheckpointReaderGetVariableNumDims( + TF_CheckpointReader reader, String name); +// Load the weight of a variable +public static native TF_Tensor TF_CheckpointReaderGetTensor( + TF_CheckpointReader reader, @Cast("const char*") BytePointer name, TF_Status status); +public static native TF_Tensor TF_CheckpointReaderGetTensor( + TF_CheckpointReader reader, String name, TF_Status status); +// Targeting ../TF_AttrBuilder.java + + +public static native TF_AttrBuilder TF_NewAttrBuilder(@Cast("const char*") BytePointer op_name); +public static native TF_AttrBuilder TF_NewAttrBuilder(String op_name); +public static native void TF_DeleteAttrBuilder(TF_AttrBuilder builder); +public static native void TF_AttrBuilderSetType(TF_AttrBuilder builder, + @Cast("const char*") BytePointer attr_name, + @Cast("TF_DataType") int value); +public static native void TF_AttrBuilderSetType(TF_AttrBuilder builder, + String attr_name, + @Cast("TF_DataType") int value); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + String attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + String attr_name, + @Cast("const TF_DataType*") IntPointer values, + int num_values); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + @Cast("const char*") BytePointer attr_name, + @Cast("const TF_DataType*") IntBuffer values, + int num_values); +public static native void TF_AttrBuilderSetTypeList(TF_AttrBuilder builder, + String attr_name, + @Cast("const TF_DataType*") int[] values, + int num_values); + +// Checks the tensorflow::NodeDef built via the methods above to see if it can +// run on device_type. +public static native void TF_AttrBuilderCheckCanRunOnDevice( + TF_AttrBuilder builder, @Cast("const char*") BytePointer device_type, TF_Status status); +public static native void TF_AttrBuilderCheckCanRunOnDevice( + TF_AttrBuilder builder, String device_type, TF_Status status); + +// For argument number input_index, fetch the corresponding number_attr that +// needs to be updated with the argument length of the input list. +// Returns nullptr if there is any problem like op_name is not found, or the +// argument does not support this attribute type. +public static native @Cast("const char*") BytePointer TF_GetNumberAttrForOpListInput( + @Cast("const char*") BytePointer op_name, int input_index, TF_Status status); +public static native String TF_GetNumberAttrForOpListInput( + String op_name, int input_index, TF_Status status); + +// Returns 1 if the op is stateful, 0 otherwise. The return value is undefined +// if the status is not ok. +public static native int TF_OpIsStateful(@Cast("const char*") BytePointer op_type, + TF_Status status); +public static native int TF_OpIsStateful(String op_type, + TF_Status status); + +// Platform specific initialization routine. Very few platforms actually require +// this to be called. +public static native void TF_InitMain(@Cast("const char*") BytePointer usage, IntPointer argc, @Cast("char***") @ByPtrPtr PointerPointer argv); +public static native void TF_InitMain(String usage, IntBuffer argc, @Cast("char***") @ByPtrPtr PointerPointer argv); +public static native void TF_InitMain(@Cast("const char*") BytePointer usage, int[] argc, @Cast("char***") @ByPtrPtr PointerPointer argv); +public static native void TF_InitMain(String usage, IntPointer argc, @Cast("char***") @ByPtrPtr PointerPointer argv); +public static native void TF_InitMain(@Cast("const char*") BytePointer usage, IntBuffer argc, @Cast("char***") @ByPtrPtr PointerPointer argv); +public static native void TF_InitMain(String usage, int[] argc, @Cast("char***") @ByPtrPtr PointerPointer argv); + +// Platform-specific implementation to return an unused port. (This should used +// in tests only.) +public static native int TF_PickUnusedPortOrDie(); + +// Fast path method that makes constructing a single scalar tensor require less +// overhead and copies. +public static native TFE_TensorHandle TFE_NewTensorHandleFromScalar( + @Cast("TF_DataType") int data_type, Pointer data, @Cast("size_t") long len, TF_Status status); + +// Specify the server_def that enables collective ops. +// This is different to the above function in that it doesn't create remote +// contexts, and remotely executing ops is not possible. It just enables +// communication for collective ops. +public static native void TFE_EnableCollectiveOps(TFE_Context ctx, + @Const Pointer proto, + @Cast("size_t") long proto_len, + TF_Status status); + +// Aborts all ongoing collectives with the specified status. After abortion, +// subsequent collectives will error with this status immediately. To reset the +// collectives, create a new EagerContext. +// +// This is intended to be used when a peer failure is detected. +public static native void TFE_AbortCollectiveOps(TFE_Context ctx, + TF_Status status); + +// Checks the health of collective ops peers. Explicit health check is needed in +// multi worker collective ops to detect failures in the cluster. If a peer is +// down, collective ops may hang. +public static native void TFE_CollectiveOpsCheckPeerHealth( + TFE_Context ctx, @Cast("const char*") BytePointer task, @Cast("int64_t") long timeout_in_ms, + TF_Status status); +public static native void TFE_CollectiveOpsCheckPeerHealth( + TFE_Context ctx, String task, @Cast("int64_t") long timeout_in_ms, + TF_Status status); +// Targeting ../TF_ShapeAndType.java + + +// Targeting ../TF_ShapeAndTypeList.java + + + +// API for manipulating TF_ShapeAndTypeList objects. +// +public static native TF_ShapeAndTypeList TF_NewShapeAndTypeList( + int num_shapes); +public static native void TF_ShapeAndTypeListSetShape( + TF_ShapeAndTypeList shape_list, int index, @Cast("const int64_t*") LongPointer dims, + int num_dims); +public static native void TF_ShapeAndTypeListSetShape( + TF_ShapeAndTypeList shape_list, int index, @Cast("const int64_t*") LongBuffer dims, + int num_dims); +public static native void TF_ShapeAndTypeListSetShape( + TF_ShapeAndTypeList shape_list, int index, @Cast("const int64_t*") long[] dims, + int num_dims); +public static native void TF_ShapeAndTypeListSetUnknownShape( + TF_ShapeAndTypeList shape_list, int index); +public static native void TF_ShapeAndTypeListSetDtype( + TF_ShapeAndTypeList shape_list, int index, @Cast("TF_DataType") int dtype); +public static native void TF_DeleteShapeAndTypeList( + TF_ShapeAndTypeList shape_list); +public static native void TF_DeleteShapeAndTypeListArray( + @Cast("TF_ShapeAndTypeList**") PointerPointer shape_list_array, int num_items); +public static native void TF_DeleteShapeAndTypeListArray( + @ByPtrPtr TF_ShapeAndTypeList shape_list_array, int num_items); + +// Infer shapes for the given `op`. The arguments mimic the arguments of the +// `shape_inference::InferenceContext` constructor. Note the following: +// - The inputs of the `op` are not used for shape inference. So, it is +// OK to not have the inputs properly set in `op`. See `input_tensors` +// if you want shape inference to consider the input tensors of the +// op for shape inference. +// - The types need not be set in `input_shapes` as it is not used. +// - The number of `input_tensors` should be the same as the number of items +// in `input_shapes`. +// +// The results are returned in `output_shapes` and +// `output_resource_shapes_and_types`. The caller is responsible for freeing the +// memory in these buffers by calling `TF_DeleteShapeAndTypeList`. +public static native void TFE_InferShapes( + TFE_Op op, TF_ShapeAndTypeList input_shapes, @Cast("TF_Tensor**") PointerPointer input_tensors, + TF_ShapeAndTypeList input_tensor_as_shapes, + @Cast("TF_ShapeAndTypeList**") PointerPointer input_resource_shapes_and_types, + @Cast("TF_ShapeAndTypeList**") PointerPointer output_shapes, + @Cast("TF_ShapeAndTypeList***") @ByPtrPtr PointerPointer output_resource_shapes_and_types, TF_Status status); +public static native void TFE_InferShapes( + TFE_Op op, TF_ShapeAndTypeList input_shapes, @ByPtrPtr TF_Tensor input_tensors, + TF_ShapeAndTypeList input_tensor_as_shapes, + @ByPtrPtr TF_ShapeAndTypeList input_resource_shapes_and_types, + @ByPtrPtr TF_ShapeAndTypeList output_shapes, + @Cast("TF_ShapeAndTypeList***") @ByPtrPtr PointerPointer output_resource_shapes_and_types, TF_Status status); + +public static native void TF_ImportGraphDefOptionsSetValidateColocationConstraints( + TF_ImportGraphDefOptions opts, @Cast("unsigned char") byte enable); + +// Load the library specified by library_filename and register the pluggable +// device and related kernels present in that library. This function is not +// supported on embedded on mobile and embedded platforms and will fail if +// called. +// +// Pass "library_filename" to a platform-specific mechanism for dynamically +// loading a library. The rules for determining the exact location of the +// library are platform-specific and are not documented here. +// +// On success, returns the newly created library handle and places OK in status. +// The caller owns the library handle. +// +// On failure, returns nullptr and places an error status in status. +public static native TF_Library TF_LoadPluggableDeviceLibrary( + @Cast("const char*") BytePointer library_filename, TF_Status status); +public static native TF_Library TF_LoadPluggableDeviceLibrary( + String library_filename, TF_Status status); + +// Frees the memory associated with the library handle. +// Does NOT unload the library. +public static native void TF_DeletePluggableDeviceLibraryHandle( + TF_Library lib_handle); + +// Removes `func_name` from `g`. If `func_name` is not in `g`, an error will be +// returned. +public static native void TF_GraphRemoveFunction(TF_Graph g, + @Cast("const char*") BytePointer func_name, + TF_Status status); +public static native void TF_GraphRemoveFunction(TF_Graph g, + String func_name, + TF_Status status); + +// #ifdef __cplusplus /* end extern "C" */ +// #endif + +// #endif // TENSORFLOW_C_C_API_EXPERIMENTAL_H_ + + +// Parsed from tfe_serverdef_stub.h + +/* Copyright 2025 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 +provided 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_JAVA_TFE_SERVERDEF_STUB_H_ +// #define TENSORFLOW_JAVA_TFE_SERVERDEF_STUB_H_ + +// #ifdef _WIN32 + +// #include "tensorflow/c/c_api.h" +// #include "tensorflow/c/c_api_experimental.h" + +// Include the implementation so that a local definition is always available +// on Windows. +// #include "tfe_serverdef_stub.cc" + +// #endif // _WIN32 + +// #endif // TENSORFLOW_JAVA_TFE_SERVERDEF_STUB_H_ + +// Parsed from tfj_graph.h + +/* Copyright 2024 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_JAVA_GRAPH_H_ +// #define TENSORFLOW_JAVA_GRAPH_H_ + +// #include "tensorflow/c/c_api.h" +// Targeting ../TFJ_GraphId.java + + + +/** Returns the unique identifier of the graph {@code g} */ +public static native TFJ_GraphId TFJ_GetGraphId(@Const TF_Graph g); + +/** Remove an operation from the name map of the graph {@code g}, so that it cannot be reversely looked up by name. + * This is particularly useful for preventing custom gradient operations to pollute the graph namespace. */ +public static native void TFJ_UnmapOperationName(TF_Graph g, TF_Operation operation); + +// #include "tfj_graph_impl.cc" // include CC file in its header to compile it with JavaCPP + +// #endif // TENSORFLOW_JAVA_GRAPH_H_ + + +// Parsed from tfj_scope.h + +/* Copyright 2024 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_JAVA_SCOPE_H_ +// #define TENSORFLOW_JAVA_SCOPE_H_ + +// #include + +// #include "tensorflow/c/c_api.h" +// Targeting ../TFJ_Scope.java + + + +// The following functions are for users making graphs. They return brand new +// scopes, or scopes derived from an existing scope object. + +/** Return a new scope. + * This creates a new graph and all operations constructed in this graph + * should use the returned object as the "root" scope. */ +public static native @ByVal TFJ_Scope TFJ_NewRootScope(); + +/** Return a new scope. Ops created with this scope will have + * {@code name/child_scope_name} as the prefix. The actual name will be unique + * in the current scope. All other properties are inherited from the current + * scope. If {@code child_scope_name} is empty, the {@code /} is elided. */ +public static native @ByVal TFJ_Scope TFJ_NewSubScope(@Const TFJ_Scope scope, @Cast("const char*") BytePointer child_scope_name); +public static native @ByVal TFJ_Scope TFJ_NewSubScope(@Const TFJ_Scope scope, String child_scope_name); + +/** Return a new scope. All ops created within the returned scope will have as + * control dependencies the union of operations in the control_deps vector + * and the control dependencies of the current scope. */ +public static native @ByVal TFJ_Scope TFJ_NewScopeWithControlDependencies(@Const TFJ_Scope scope, TF_Operation control_deps, int control_deps_size); + +/** Return a new scope. All ops created within the returned scope will have + * the device field set to 'device'. */ +public static native @ByVal TFJ_Scope TFJ_NewScopeWithDevice(@Const TFJ_Scope scope, @Cast("const char*") BytePointer device); +public static native @ByVal TFJ_Scope TFJ_NewScopeWithDevice(@Const TFJ_Scope scope, String device); + +/** Return a unique name, using default_name if an op name has not been specified. + * Note: returns C++ std string to prevent buffer to be freed up before consuming the characters */ +public static native @StdString BytePointer TFJ_GetUniqueNameForOp(@Const TFJ_Scope scope, @Cast("const char*") BytePointer default_name); +public static native @StdString String TFJ_GetUniqueNameForOp(@Const TFJ_Scope scope, String default_name); + +// #include "tfj_scope_impl.cc" // include CC file in its header to compile it with JavaCPP + +// #endif // TENSORFLOW_JAVA_SCOPE_H_ + + +// Parsed from tfj_gradients.h + +/* Copyright 2024 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_JAVA_GRADIENTS_H_ +// #define TENSORFLOW_JAVA_GRADIENTS_H_ + +// #include "tfj_scope.h" + +/// +/// +// #include "tensorflow/c/c_api.h" +// Targeting ../TFJ_GradFuncAdapter.java + + + +/** Returns true if a gradient function has already be registered for operations of type {@code op_type} */ + +/// +public static native @Cast("bool") boolean TFJ_HasGradient(@Cast("const char*") BytePointer op_type); +public static native @Cast("bool") boolean TFJ_HasGradient(String op_type); + +/** Registers a gradient function for operations of type {@code op_type}. + * + * Returns true if the function has been registered successfully, false if operation failed or if gradient function is already registered to that {@code op_type}. */ +public static native @Cast("bool") boolean TFJ_RegisterCustomGradient(@Cast("const char*") BytePointer op_type, TFJ_GradFuncAdapter custom_gradient_adapter); +public static native @Cast("bool") boolean TFJ_RegisterCustomGradient(String op_type, TFJ_GradFuncAdapter custom_gradient_adapter); + +// #include "tfj_gradients_impl.cc" // include CC file in its header to compile it with JavaCPP + +// #endif // TENSORFLOW_JAVA_GRADIENTS_H_ + + +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescription.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescription.java new file mode 100644 index 00000000000..967073358af --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescription.java @@ -0,0 +1,944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/allocation_description.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.AllocationDescription} + */ +public final class AllocationDescription extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AllocationDescription) + AllocationDescriptionOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllocationDescription.class.getName()); + } + // Use AllocationDescription.newBuilder() to construct. + private AllocationDescription(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllocationDescription() { + allocatorName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocationDescription.class, org.tensorflow.proto.AllocationDescription.Builder.class); + } + + public static final int REQUESTED_BYTES_FIELD_NUMBER = 1; + private long requestedBytes_ = 0L; + /** + *
    +   * Total number of bytes requested
    +   * 
    + * + * int64 requested_bytes = 1; + * @return The requestedBytes. + */ + @java.lang.Override + public long getRequestedBytes() { + return requestedBytes_; + } + + public static final int ALLOCATED_BYTES_FIELD_NUMBER = 2; + private long allocatedBytes_ = 0L; + /** + *
    +   * Total number of bytes allocated if known
    +   * 
    + * + * int64 allocated_bytes = 2; + * @return The allocatedBytes. + */ + @java.lang.Override + public long getAllocatedBytes() { + return allocatedBytes_; + } + + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + *
    +   * Name of the allocator used
    +   * 
    + * + * string allocator_name = 3; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + *
    +   * Name of the allocator used
    +   * 
    + * + * string allocator_name = 3; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATION_ID_FIELD_NUMBER = 4; + private long allocationId_ = 0L; + /** + *
    +   * Identifier of the allocated buffer if known
    +   * 
    + * + * int64 allocation_id = 4; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + + public static final int HAS_SINGLE_REFERENCE_FIELD_NUMBER = 5; + private boolean hasSingleReference_ = false; + /** + *
    +   * Set if this tensor only has one remaining reference
    +   * 
    + * + * bool has_single_reference = 5; + * @return The hasSingleReference. + */ + @java.lang.Override + public boolean getHasSingleReference() { + return hasSingleReference_; + } + + public static final int PTR_FIELD_NUMBER = 6; + private long ptr_ = 0L; + /** + *
    +   * Address of the allocation.
    +   * 
    + * + * uint64 ptr = 6; + * @return The ptr. + */ + @java.lang.Override + public long getPtr() { + return ptr_; + } + + 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 (requestedBytes_ != 0L) { + output.writeInt64(1, requestedBytes_); + } + if (allocatedBytes_ != 0L) { + output.writeInt64(2, allocatedBytes_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, allocatorName_); + } + if (allocationId_ != 0L) { + output.writeInt64(4, allocationId_); + } + if (hasSingleReference_ != false) { + output.writeBool(5, hasSingleReference_); + } + if (ptr_ != 0L) { + output.writeUInt64(6, ptr_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestedBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, requestedBytes_); + } + if (allocatedBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, allocatedBytes_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, allocatorName_); + } + if (allocationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, allocationId_); + } + if (hasSingleReference_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, hasSingleReference_); + } + if (ptr_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, ptr_); + } + size += getUnknownFields().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.AllocationDescription)) { + return super.equals(obj); + } + org.tensorflow.proto.AllocationDescription other = (org.tensorflow.proto.AllocationDescription) obj; + + if (getRequestedBytes() + != other.getRequestedBytes()) return false; + if (getAllocatedBytes() + != other.getAllocatedBytes()) return false; + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (getAllocationId() + != other.getAllocationId()) return false; + if (getHasSingleReference() + != other.getHasSingleReference()) return false; + if (getPtr() + != other.getPtr()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REQUESTED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRequestedBytes()); + hash = (37 * hash) + ALLOCATED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocatedBytes()); + hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocationId()); + hash = (37 * hash) + HAS_SINGLE_REFERENCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHasSingleReference()); + hash = (37 * hash) + PTR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPtr()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AllocationDescription parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationDescription 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.AllocationDescription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationDescription 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.AllocationDescription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationDescription parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AllocationDescription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocationDescription parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AllocationDescription parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AllocationDescription parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AllocationDescription parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocationDescription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AllocationDescription 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.AllocationDescription} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AllocationDescription) + org.tensorflow.proto.AllocationDescriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocationDescription.class, org.tensorflow.proto.AllocationDescription.Builder.class); + } + + // Construct using org.tensorflow.proto.AllocationDescription.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + requestedBytes_ = 0L; + allocatedBytes_ = 0L; + allocatorName_ = ""; + allocationId_ = 0L; + hasSingleReference_ = false; + ptr_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.AllocationDescriptionProtos.internal_static_tensorflow_AllocationDescription_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AllocationDescription getDefaultInstanceForType() { + return org.tensorflow.proto.AllocationDescription.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AllocationDescription build() { + org.tensorflow.proto.AllocationDescription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AllocationDescription buildPartial() { + org.tensorflow.proto.AllocationDescription result = new org.tensorflow.proto.AllocationDescription(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AllocationDescription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.requestedBytes_ = requestedBytes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allocatedBytes_ = allocatedBytes_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allocatorName_ = allocatorName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allocationId_ = allocationId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.hasSingleReference_ = hasSingleReference_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.ptr_ = ptr_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AllocationDescription) { + return mergeFrom((org.tensorflow.proto.AllocationDescription)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AllocationDescription other) { + if (other == org.tensorflow.proto.AllocationDescription.getDefaultInstance()) return this; + if (other.getRequestedBytes() != 0L) { + setRequestedBytes(other.getRequestedBytes()); + } + if (other.getAllocatedBytes() != 0L) { + setAllocatedBytes(other.getAllocatedBytes()); + } + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getAllocationId() != 0L) { + setAllocationId(other.getAllocationId()); + } + if (other.getHasSingleReference() != false) { + setHasSingleReference(other.getHasSingleReference()); + } + if (other.getPtr() != 0L) { + setPtr(other.getPtr()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + requestedBytes_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + allocatedBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + allocationId_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + hasSingleReference_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + ptr_ = input.readUInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long requestedBytes_ ; + /** + *
    +     * Total number of bytes requested
    +     * 
    + * + * int64 requested_bytes = 1; + * @return The requestedBytes. + */ + @java.lang.Override + public long getRequestedBytes() { + return requestedBytes_; + } + /** + *
    +     * Total number of bytes requested
    +     * 
    + * + * int64 requested_bytes = 1; + * @param value The requestedBytes to set. + * @return This builder for chaining. + */ + public Builder setRequestedBytes(long value) { + + requestedBytes_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Total number of bytes requested
    +     * 
    + * + * int64 requested_bytes = 1; + * @return This builder for chaining. + */ + public Builder clearRequestedBytes() { + bitField0_ = (bitField0_ & ~0x00000001); + requestedBytes_ = 0L; + onChanged(); + return this; + } + + private long allocatedBytes_ ; + /** + *
    +     * Total number of bytes allocated if known
    +     * 
    + * + * int64 allocated_bytes = 2; + * @return The allocatedBytes. + */ + @java.lang.Override + public long getAllocatedBytes() { + return allocatedBytes_; + } + /** + *
    +     * Total number of bytes allocated if known
    +     * 
    + * + * int64 allocated_bytes = 2; + * @param value The allocatedBytes to set. + * @return This builder for chaining. + */ + public Builder setAllocatedBytes(long value) { + + allocatedBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Total number of bytes allocated if known
    +     * 
    + * + * int64 allocated_bytes = 2; + * @return This builder for chaining. + */ + public Builder clearAllocatedBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + allocatedBytes_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object allocatorName_ = ""; + /** + *
    +     * Name of the allocator used
    +     * 
    + * + * string allocator_name = 3; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the allocator used
    +     * 
    + * + * string allocator_name = 3; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the allocator used
    +     * 
    + * + * string allocator_name = 3; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used
    +     * 
    + * + * string allocator_name = 3; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used
    +     * 
    + * + * string allocator_name = 3; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long allocationId_ ; + /** + *
    +     * Identifier of the allocated buffer if known
    +     * 
    + * + * int64 allocation_id = 4; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + /** + *
    +     * Identifier of the allocated buffer if known
    +     * 
    + * + * int64 allocation_id = 4; + * @param value The allocationId to set. + * @return This builder for chaining. + */ + public Builder setAllocationId(long value) { + + allocationId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Identifier of the allocated buffer if known
    +     * 
    + * + * int64 allocation_id = 4; + * @return This builder for chaining. + */ + public Builder clearAllocationId() { + bitField0_ = (bitField0_ & ~0x00000008); + allocationId_ = 0L; + onChanged(); + return this; + } + + private boolean hasSingleReference_ ; + /** + *
    +     * Set if this tensor only has one remaining reference
    +     * 
    + * + * bool has_single_reference = 5; + * @return The hasSingleReference. + */ + @java.lang.Override + public boolean getHasSingleReference() { + return hasSingleReference_; + } + /** + *
    +     * Set if this tensor only has one remaining reference
    +     * 
    + * + * bool has_single_reference = 5; + * @param value The hasSingleReference to set. + * @return This builder for chaining. + */ + public Builder setHasSingleReference(boolean value) { + + hasSingleReference_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Set if this tensor only has one remaining reference
    +     * 
    + * + * bool has_single_reference = 5; + * @return This builder for chaining. + */ + public Builder clearHasSingleReference() { + bitField0_ = (bitField0_ & ~0x00000010); + hasSingleReference_ = false; + onChanged(); + return this; + } + + private long ptr_ ; + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 6; + * @return The ptr. + */ + @java.lang.Override + public long getPtr() { + return ptr_; + } + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 6; + * @param value The ptr to set. + * @return This builder for chaining. + */ + public Builder setPtr(long value) { + + ptr_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 6; + * @return This builder for chaining. + */ + public Builder clearPtr() { + bitField0_ = (bitField0_ & ~0x00000020); + ptr_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AllocationDescription) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AllocationDescription) + private static final org.tensorflow.proto.AllocationDescription DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AllocationDescription(); + } + + public static org.tensorflow.proto.AllocationDescription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocationDescription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AllocationDescription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionOrBuilder.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionOrBuilder.java index 9fbd5df0695..bb64ef9e0c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationDescriptionOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/allocation_description.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface AllocationDescriptionOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.AllocationDescription) @@ -13,6 +15,7 @@ public interface AllocationDescriptionOrBuilder extends *
    * * int64 requested_bytes = 1; + * @return The requestedBytes. */ long getRequestedBytes(); @@ -22,6 +25,7 @@ public interface AllocationDescriptionOrBuilder extends *
    * * int64 allocated_bytes = 2; + * @return The allocatedBytes. */ long getAllocatedBytes(); @@ -31,6 +35,7 @@ public interface AllocationDescriptionOrBuilder extends *
    * * string allocator_name = 3; + * @return The allocatorName. */ java.lang.String getAllocatorName(); /** @@ -39,6 +44,7 @@ public interface AllocationDescriptionOrBuilder extends * * * string allocator_name = 3; + * @return The bytes for allocatorName. */ com.google.protobuf.ByteString getAllocatorNameBytes(); @@ -49,6 +55,7 @@ public interface AllocationDescriptionOrBuilder extends * * * int64 allocation_id = 4; + * @return The allocationId. */ long getAllocationId(); @@ -58,6 +65,7 @@ public interface AllocationDescriptionOrBuilder extends * * * bool has_single_reference = 5; + * @return The hasSingleReference. */ boolean getHasSingleReference(); @@ -67,6 +75,7 @@ public interface AllocationDescriptionOrBuilder extends * * * uint64 ptr = 6; + * @return The ptr. */ long getPtr(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionProtos.java new file mode 100644 index 00000000000..80ca6baa735 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationDescriptionProtos.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/allocation_description.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class AllocationDescriptionProtos { + private AllocationDescriptionProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllocationDescriptionProtos.class.getName()); + } + 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_AllocationDescription_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_AllocationDescription_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n6tensorflow/core/framework/allocation_d" + + "escription.proto\022\ntensorflow\"\243\001\n\025Allocat" + + "ionDescription\022\027\n\017requested_bytes\030\001 \001(\003\022" + + "\027\n\017allocated_bytes\030\002 \001(\003\022\026\n\016allocator_na" + + "me\030\003 \001(\t\022\025\n\rallocation_id\030\004 \001(\003\022\034\n\024has_s" + + "ingle_reference\030\005 \001(\010\022\013\n\003ptr\030\006 \001(\004B\227\001\n\024o" + + "rg.tensorflow.protoB\033AllocationDescripti" + + "onProtosP\001Z]github.com/tensorflow/tensor" + + "flow/tensorflow/go/core/framework/alloca" + + "tion_description_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_AllocationDescription_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_AllocationDescription_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_AllocationDescription_descriptor, + new java.lang.String[] { "RequestedBytes", "AllocatedBytes", "AllocatorName", "AllocationId", "HasSingleReference", "Ptr", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecord.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecord.java new file mode 100644 index 00000000000..64ef50b0cce --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecord.java @@ -0,0 +1,539 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * An allocation/de-allocation operation performed by the allocator.
    + * 
    + * + * Protobuf type {@code tensorflow.AllocationRecord} + */ +public final class AllocationRecord extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AllocationRecord) + AllocationRecordOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllocationRecord.class.getName()); + } + // Use AllocationRecord.newBuilder() to construct. + private AllocationRecord(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllocationRecord() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocationRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocationRecord.class, org.tensorflow.proto.AllocationRecord.Builder.class); + } + + public static final int ALLOC_MICROS_FIELD_NUMBER = 1; + private long allocMicros_ = 0L; + /** + *
    +   * The timestamp of the operation.
    +   * 
    + * + * int64 alloc_micros = 1; + * @return The allocMicros. + */ + @java.lang.Override + public long getAllocMicros() { + return allocMicros_; + } + + public static final int ALLOC_BYTES_FIELD_NUMBER = 2; + private long allocBytes_ = 0L; + /** + *
    +   * Number of bytes allocated, or de-allocated if negative.
    +   * 
    + * + * int64 alloc_bytes = 2; + * @return The allocBytes. + */ + @java.lang.Override + public long getAllocBytes() { + return allocBytes_; + } + + 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 (allocMicros_ != 0L) { + output.writeInt64(1, allocMicros_); + } + if (allocBytes_ != 0L) { + output.writeInt64(2, allocBytes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (allocMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, allocMicros_); + } + if (allocBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, allocBytes_); + } + size += getUnknownFields().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.AllocationRecord)) { + return super.equals(obj); + } + org.tensorflow.proto.AllocationRecord other = (org.tensorflow.proto.AllocationRecord) obj; + + if (getAllocMicros() + != other.getAllocMicros()) return false; + if (getAllocBytes() + != other.getAllocBytes()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALLOC_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocMicros()); + hash = (37 * hash) + ALLOC_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocBytes()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AllocationRecord parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationRecord 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.AllocationRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationRecord 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.AllocationRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocationRecord parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AllocationRecord parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocationRecord parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AllocationRecord parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AllocationRecord parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AllocationRecord parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocationRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AllocationRecord 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * An allocation/de-allocation operation performed by the allocator.
    +   * 
    + * + * Protobuf type {@code tensorflow.AllocationRecord} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AllocationRecord) + org.tensorflow.proto.AllocationRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocationRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocationRecord.class, org.tensorflow.proto.AllocationRecord.Builder.class); + } + + // Construct using org.tensorflow.proto.AllocationRecord.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allocMicros_ = 0L; + allocBytes_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocationRecord_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AllocationRecord getDefaultInstanceForType() { + return org.tensorflow.proto.AllocationRecord.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AllocationRecord build() { + org.tensorflow.proto.AllocationRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AllocationRecord buildPartial() { + org.tensorflow.proto.AllocationRecord result = new org.tensorflow.proto.AllocationRecord(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AllocationRecord result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allocMicros_ = allocMicros_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allocBytes_ = allocBytes_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AllocationRecord) { + return mergeFrom((org.tensorflow.proto.AllocationRecord)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AllocationRecord other) { + if (other == org.tensorflow.proto.AllocationRecord.getDefaultInstance()) return this; + if (other.getAllocMicros() != 0L) { + setAllocMicros(other.getAllocMicros()); + } + if (other.getAllocBytes() != 0L) { + setAllocBytes(other.getAllocBytes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + allocMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + allocBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long allocMicros_ ; + /** + *
    +     * The timestamp of the operation.
    +     * 
    + * + * int64 alloc_micros = 1; + * @return The allocMicros. + */ + @java.lang.Override + public long getAllocMicros() { + return allocMicros_; + } + /** + *
    +     * The timestamp of the operation.
    +     * 
    + * + * int64 alloc_micros = 1; + * @param value The allocMicros to set. + * @return This builder for chaining. + */ + public Builder setAllocMicros(long value) { + + allocMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The timestamp of the operation.
    +     * 
    + * + * int64 alloc_micros = 1; + * @return This builder for chaining. + */ + public Builder clearAllocMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + allocMicros_ = 0L; + onChanged(); + return this; + } + + private long allocBytes_ ; + /** + *
    +     * Number of bytes allocated, or de-allocated if negative.
    +     * 
    + * + * int64 alloc_bytes = 2; + * @return The allocBytes. + */ + @java.lang.Override + public long getAllocBytes() { + return allocBytes_; + } + /** + *
    +     * Number of bytes allocated, or de-allocated if negative.
    +     * 
    + * + * int64 alloc_bytes = 2; + * @param value The allocBytes to set. + * @return This builder for chaining. + */ + public Builder setAllocBytes(long value) { + + allocBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Number of bytes allocated, or de-allocated if negative.
    +     * 
    + * + * int64 alloc_bytes = 2; + * @return This builder for chaining. + */ + public Builder clearAllocBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + allocBytes_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AllocationRecord) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AllocationRecord) + private static final org.tensorflow.proto.AllocationRecord DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AllocationRecord(); + } + + public static org.tensorflow.proto.AllocationRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocationRecord parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AllocationRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecordOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecordOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecordOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecordOrBuilder.java index c6c5dd502da..4825baf1aaf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocationRecordOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocationRecordOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface AllocationRecordOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.AllocationRecord) @@ -13,6 +15,7 @@ public interface AllocationRecordOrBuilder extends * * * int64 alloc_micros = 1; + * @return The allocMicros. */ long getAllocMicros(); @@ -22,6 +25,7 @@ public interface AllocationRecordOrBuilder extends * * * int64 alloc_bytes = 2; + * @return The allocBytes. */ long getAllocBytes(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsed.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsed.java new file mode 100644 index 00000000000..49e5a0df53f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsed.java @@ -0,0 +1,1267 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.AllocatorMemoryUsed} + */ +public final class AllocatorMemoryUsed extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AllocatorMemoryUsed) + AllocatorMemoryUsedOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllocatorMemoryUsed.class.getName()); + } + // Use AllocatorMemoryUsed.newBuilder() to construct. + private AllocatorMemoryUsed(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllocatorMemoryUsed() { + allocatorName_ = ""; + allocationRecords_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocatorMemoryUsed.class, org.tensorflow.proto.AllocatorMemoryUsed.Builder.class); + } + + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + * string allocator_name = 1; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + * string allocator_name = 1; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_BYTES_FIELD_NUMBER = 2; + private long totalBytes_ = 0L; + /** + *
    +   * These are per-node allocator memory stats.
    +   * 
    + * + * int64 total_bytes = 2; + * @return The totalBytes. + */ + @java.lang.Override + public long getTotalBytes() { + return totalBytes_; + } + + public static final int PEAK_BYTES_FIELD_NUMBER = 3; + private long peakBytes_ = 0L; + /** + * int64 peak_bytes = 3; + * @return The peakBytes. + */ + @java.lang.Override + public long getPeakBytes() { + return peakBytes_; + } + + public static final int LIVE_BYTES_FIELD_NUMBER = 4; + private long liveBytes_ = 0L; + /** + *
    +   * The bytes that are not deallocated.
    +   * 
    + * + * int64 live_bytes = 4; + * @return The liveBytes. + */ + @java.lang.Override + public long getLiveBytes() { + return liveBytes_; + } + + public static final int ALLOCATION_RECORDS_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List allocationRecords_; + /** + *
    +   * The allocation and deallocation timeline.
    +   * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + @java.lang.Override + public java.util.List getAllocationRecordsList() { + return allocationRecords_; + } + /** + *
    +   * The allocation and deallocation timeline.
    +   * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + @java.lang.Override + public java.util.List + getAllocationRecordsOrBuilderList() { + return allocationRecords_; + } + /** + *
    +   * The allocation and deallocation timeline.
    +   * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + @java.lang.Override + public int getAllocationRecordsCount() { + return allocationRecords_.size(); + } + /** + *
    +   * The allocation and deallocation timeline.
    +   * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AllocationRecord getAllocationRecords(int index) { + return allocationRecords_.get(index); + } + /** + *
    +   * The allocation and deallocation timeline.
    +   * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AllocationRecordOrBuilder getAllocationRecordsOrBuilder( + int index) { + return allocationRecords_.get(index); + } + + public static final int ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER = 5; + private long allocatorBytesInUse_ = 0L; + /** + *
    +   * These are snapshots of the overall allocator memory stats.
    +   * The number of live bytes currently allocated by the allocator.
    +   * 
    + * + * int64 allocator_bytes_in_use = 5; + * @return The allocatorBytesInUse. + */ + @java.lang.Override + public long getAllocatorBytesInUse() { + return allocatorBytesInUse_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, allocatorName_); + } + if (totalBytes_ != 0L) { + output.writeInt64(2, totalBytes_); + } + if (peakBytes_ != 0L) { + output.writeInt64(3, peakBytes_); + } + if (liveBytes_ != 0L) { + output.writeInt64(4, liveBytes_); + } + if (allocatorBytesInUse_ != 0L) { + output.writeInt64(5, allocatorBytesInUse_); + } + for (int i = 0; i < allocationRecords_.size(); i++) { + output.writeMessage(6, allocationRecords_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, allocatorName_); + } + if (totalBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, totalBytes_); + } + if (peakBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, peakBytes_); + } + if (liveBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, liveBytes_); + } + if (allocatorBytesInUse_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, allocatorBytesInUse_); + } + for (int i = 0; i < allocationRecords_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, allocationRecords_.get(i)); + } + size += getUnknownFields().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.AllocatorMemoryUsed)) { + return super.equals(obj); + } + org.tensorflow.proto.AllocatorMemoryUsed other = (org.tensorflow.proto.AllocatorMemoryUsed) obj; + + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (getTotalBytes() + != other.getTotalBytes()) return false; + if (getPeakBytes() + != other.getPeakBytes()) return false; + if (getLiveBytes() + != other.getLiveBytes()) return false; + if (!getAllocationRecordsList() + .equals(other.getAllocationRecordsList())) return false; + if (getAllocatorBytesInUse() + != other.getAllocatorBytesInUse()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + hash = (37 * hash) + TOTAL_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalBytes()); + hash = (37 * hash) + PEAK_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPeakBytes()); + hash = (37 * hash) + LIVE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLiveBytes()); + if (getAllocationRecordsCount() > 0) { + hash = (37 * hash) + ALLOCATION_RECORDS_FIELD_NUMBER; + hash = (53 * hash) + getAllocationRecordsList().hashCode(); + } + hash = (37 * hash) + ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocatorBytesInUse()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocatorMemoryUsed 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.AllocatorMemoryUsed parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AllocatorMemoryUsed parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AllocatorMemoryUsed parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AllocatorMemoryUsed parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AllocatorMemoryUsed 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.AllocatorMemoryUsed} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AllocatorMemoryUsed) + org.tensorflow.proto.AllocatorMemoryUsedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AllocatorMemoryUsed.class, org.tensorflow.proto.AllocatorMemoryUsed.Builder.class); + } + + // Construct using org.tensorflow.proto.AllocatorMemoryUsed.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allocatorName_ = ""; + totalBytes_ = 0L; + peakBytes_ = 0L; + liveBytes_ = 0L; + if (allocationRecordsBuilder_ == null) { + allocationRecords_ = java.util.Collections.emptyList(); + } else { + allocationRecords_ = null; + allocationRecordsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + allocatorBytesInUse_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AllocatorMemoryUsed getDefaultInstanceForType() { + return org.tensorflow.proto.AllocatorMemoryUsed.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AllocatorMemoryUsed build() { + org.tensorflow.proto.AllocatorMemoryUsed result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AllocatorMemoryUsed buildPartial() { + org.tensorflow.proto.AllocatorMemoryUsed result = new org.tensorflow.proto.AllocatorMemoryUsed(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.AllocatorMemoryUsed result) { + if (allocationRecordsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + allocationRecords_ = java.util.Collections.unmodifiableList(allocationRecords_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.allocationRecords_ = allocationRecords_; + } else { + result.allocationRecords_ = allocationRecordsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.AllocatorMemoryUsed result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allocatorName_ = allocatorName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.totalBytes_ = totalBytes_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.peakBytes_ = peakBytes_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.liveBytes_ = liveBytes_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.allocatorBytesInUse_ = allocatorBytesInUse_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AllocatorMemoryUsed) { + return mergeFrom((org.tensorflow.proto.AllocatorMemoryUsed)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AllocatorMemoryUsed other) { + if (other == org.tensorflow.proto.AllocatorMemoryUsed.getDefaultInstance()) return this; + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getTotalBytes() != 0L) { + setTotalBytes(other.getTotalBytes()); + } + if (other.getPeakBytes() != 0L) { + setPeakBytes(other.getPeakBytes()); + } + if (other.getLiveBytes() != 0L) { + setLiveBytes(other.getLiveBytes()); + } + if (allocationRecordsBuilder_ == null) { + if (!other.allocationRecords_.isEmpty()) { + if (allocationRecords_.isEmpty()) { + allocationRecords_ = other.allocationRecords_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAllocationRecordsIsMutable(); + allocationRecords_.addAll(other.allocationRecords_); + } + onChanged(); + } + } else { + if (!other.allocationRecords_.isEmpty()) { + if (allocationRecordsBuilder_.isEmpty()) { + allocationRecordsBuilder_.dispose(); + allocationRecordsBuilder_ = null; + allocationRecords_ = other.allocationRecords_; + bitField0_ = (bitField0_ & ~0x00000010); + allocationRecordsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAllocationRecordsFieldBuilder() : null; + } else { + allocationRecordsBuilder_.addAllMessages(other.allocationRecords_); + } + } + } + if (other.getAllocatorBytesInUse() != 0L) { + setAllocatorBytesInUse(other.getAllocatorBytesInUse()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + totalBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + peakBytes_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + liveBytes_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + allocatorBytesInUse_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 50: { + org.tensorflow.proto.AllocationRecord m = + input.readMessage( + org.tensorflow.proto.AllocationRecord.parser(), + extensionRegistry); + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + allocationRecords_.add(m); + } else { + allocationRecordsBuilder_.addMessage(m); + } + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object allocatorName_ = ""; + /** + * string allocator_name = 1; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string allocator_name = 1; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string allocator_name = 1; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string allocator_name = 1; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string allocator_name = 1; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long totalBytes_ ; + /** + *
    +     * These are per-node allocator memory stats.
    +     * 
    + * + * int64 total_bytes = 2; + * @return The totalBytes. + */ + @java.lang.Override + public long getTotalBytes() { + return totalBytes_; + } + /** + *
    +     * These are per-node allocator memory stats.
    +     * 
    + * + * int64 total_bytes = 2; + * @param value The totalBytes to set. + * @return This builder for chaining. + */ + public Builder setTotalBytes(long value) { + + totalBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * These are per-node allocator memory stats.
    +     * 
    + * + * int64 total_bytes = 2; + * @return This builder for chaining. + */ + public Builder clearTotalBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + totalBytes_ = 0L; + onChanged(); + return this; + } + + private long peakBytes_ ; + /** + * int64 peak_bytes = 3; + * @return The peakBytes. + */ + @java.lang.Override + public long getPeakBytes() { + return peakBytes_; + } + /** + * int64 peak_bytes = 3; + * @param value The peakBytes to set. + * @return This builder for chaining. + */ + public Builder setPeakBytes(long value) { + + peakBytes_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 peak_bytes = 3; + * @return This builder for chaining. + */ + public Builder clearPeakBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + peakBytes_ = 0L; + onChanged(); + return this; + } + + private long liveBytes_ ; + /** + *
    +     * The bytes that are not deallocated.
    +     * 
    + * + * int64 live_bytes = 4; + * @return The liveBytes. + */ + @java.lang.Override + public long getLiveBytes() { + return liveBytes_; + } + /** + *
    +     * The bytes that are not deallocated.
    +     * 
    + * + * int64 live_bytes = 4; + * @param value The liveBytes to set. + * @return This builder for chaining. + */ + public Builder setLiveBytes(long value) { + + liveBytes_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The bytes that are not deallocated.
    +     * 
    + * + * int64 live_bytes = 4; + * @return This builder for chaining. + */ + public Builder clearLiveBytes() { + bitField0_ = (bitField0_ & ~0x00000008); + liveBytes_ = 0L; + onChanged(); + return this; + } + + private java.util.List allocationRecords_ = + java.util.Collections.emptyList(); + private void ensureAllocationRecordsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + allocationRecords_ = new java.util.ArrayList(allocationRecords_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationRecord, org.tensorflow.proto.AllocationRecord.Builder, org.tensorflow.proto.AllocationRecordOrBuilder> allocationRecordsBuilder_; + + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public java.util.List getAllocationRecordsList() { + if (allocationRecordsBuilder_ == null) { + return java.util.Collections.unmodifiableList(allocationRecords_); + } else { + return allocationRecordsBuilder_.getMessageList(); + } + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public int getAllocationRecordsCount() { + if (allocationRecordsBuilder_ == null) { + return allocationRecords_.size(); + } else { + return allocationRecordsBuilder_.getCount(); + } + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public org.tensorflow.proto.AllocationRecord getAllocationRecords(int index) { + if (allocationRecordsBuilder_ == null) { + return allocationRecords_.get(index); + } else { + return allocationRecordsBuilder_.getMessage(index); + } + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder setAllocationRecords( + int index, org.tensorflow.proto.AllocationRecord value) { + if (allocationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationRecordsIsMutable(); + allocationRecords_.set(index, value); + onChanged(); + } else { + allocationRecordsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder setAllocationRecords( + int index, org.tensorflow.proto.AllocationRecord.Builder builderForValue) { + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + allocationRecords_.set(index, builderForValue.build()); + onChanged(); + } else { + allocationRecordsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder addAllocationRecords(org.tensorflow.proto.AllocationRecord value) { + if (allocationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationRecordsIsMutable(); + allocationRecords_.add(value); + onChanged(); + } else { + allocationRecordsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder addAllocationRecords( + int index, org.tensorflow.proto.AllocationRecord value) { + if (allocationRecordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllocationRecordsIsMutable(); + allocationRecords_.add(index, value); + onChanged(); + } else { + allocationRecordsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder addAllocationRecords( + org.tensorflow.proto.AllocationRecord.Builder builderForValue) { + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + allocationRecords_.add(builderForValue.build()); + onChanged(); + } else { + allocationRecordsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder addAllocationRecords( + int index, org.tensorflow.proto.AllocationRecord.Builder builderForValue) { + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + allocationRecords_.add(index, builderForValue.build()); + onChanged(); + } else { + allocationRecordsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder addAllAllocationRecords( + java.lang.Iterable values) { + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, allocationRecords_); + onChanged(); + } else { + allocationRecordsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder clearAllocationRecords() { + if (allocationRecordsBuilder_ == null) { + allocationRecords_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + allocationRecordsBuilder_.clear(); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public Builder removeAllocationRecords(int index) { + if (allocationRecordsBuilder_ == null) { + ensureAllocationRecordsIsMutable(); + allocationRecords_.remove(index); + onChanged(); + } else { + allocationRecordsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public org.tensorflow.proto.AllocationRecord.Builder getAllocationRecordsBuilder( + int index) { + return getAllocationRecordsFieldBuilder().getBuilder(index); + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public org.tensorflow.proto.AllocationRecordOrBuilder getAllocationRecordsOrBuilder( + int index) { + if (allocationRecordsBuilder_ == null) { + return allocationRecords_.get(index); } else { + return allocationRecordsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public java.util.List + getAllocationRecordsOrBuilderList() { + if (allocationRecordsBuilder_ != null) { + return allocationRecordsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(allocationRecords_); + } + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public org.tensorflow.proto.AllocationRecord.Builder addAllocationRecordsBuilder() { + return getAllocationRecordsFieldBuilder().addBuilder( + org.tensorflow.proto.AllocationRecord.getDefaultInstance()); + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public org.tensorflow.proto.AllocationRecord.Builder addAllocationRecordsBuilder( + int index) { + return getAllocationRecordsFieldBuilder().addBuilder( + index, org.tensorflow.proto.AllocationRecord.getDefaultInstance()); + } + /** + *
    +     * The allocation and deallocation timeline.
    +     * 
    + * + * repeated .tensorflow.AllocationRecord allocation_records = 6; + */ + public java.util.List + getAllocationRecordsBuilderList() { + return getAllocationRecordsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationRecord, org.tensorflow.proto.AllocationRecord.Builder, org.tensorflow.proto.AllocationRecordOrBuilder> + getAllocationRecordsFieldBuilder() { + if (allocationRecordsBuilder_ == null) { + allocationRecordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationRecord, org.tensorflow.proto.AllocationRecord.Builder, org.tensorflow.proto.AllocationRecordOrBuilder>( + allocationRecords_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + allocationRecords_ = null; + } + return allocationRecordsBuilder_; + } + + private long allocatorBytesInUse_ ; + /** + *
    +     * These are snapshots of the overall allocator memory stats.
    +     * The number of live bytes currently allocated by the allocator.
    +     * 
    + * + * int64 allocator_bytes_in_use = 5; + * @return The allocatorBytesInUse. + */ + @java.lang.Override + public long getAllocatorBytesInUse() { + return allocatorBytesInUse_; + } + /** + *
    +     * These are snapshots of the overall allocator memory stats.
    +     * The number of live bytes currently allocated by the allocator.
    +     * 
    + * + * int64 allocator_bytes_in_use = 5; + * @param value The allocatorBytesInUse to set. + * @return This builder for chaining. + */ + public Builder setAllocatorBytesInUse(long value) { + + allocatorBytesInUse_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * These are snapshots of the overall allocator memory stats.
    +     * The number of live bytes currently allocated by the allocator.
    +     * 
    + * + * int64 allocator_bytes_in_use = 5; + * @return This builder for chaining. + */ + public Builder clearAllocatorBytesInUse() { + bitField0_ = (bitField0_ & ~0x00000020); + allocatorBytesInUse_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AllocatorMemoryUsed) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AllocatorMemoryUsed) + private static final org.tensorflow.proto.AllocatorMemoryUsed DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AllocatorMemoryUsed(); + } + + public static org.tensorflow.proto.AllocatorMemoryUsed getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllocatorMemoryUsed parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AllocatorMemoryUsed getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsedOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsedOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsedOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsedOrBuilder.java index 44dc47fa31d..64564b22ffa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AllocatorMemoryUsedOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AllocatorMemoryUsedOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface AllocatorMemoryUsedOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.AllocatorMemoryUsed) @@ -9,10 +11,12 @@ public interface AllocatorMemoryUsedOrBuilder extends /** * string allocator_name = 1; + * @return The allocatorName. */ java.lang.String getAllocatorName(); /** * string allocator_name = 1; + * @return The bytes for allocatorName. */ com.google.protobuf.ByteString getAllocatorNameBytes(); @@ -23,11 +27,13 @@ public interface AllocatorMemoryUsedOrBuilder extends * * * int64 total_bytes = 2; + * @return The totalBytes. */ long getTotalBytes(); /** * int64 peak_bytes = 3; + * @return The peakBytes. */ long getPeakBytes(); @@ -37,6 +43,7 @@ public interface AllocatorMemoryUsedOrBuilder extends * * * int64 live_bytes = 4; + * @return The liveBytes. */ long getLiveBytes(); @@ -47,7 +54,7 @@ public interface AllocatorMemoryUsedOrBuilder extends * * repeated .tensorflow.AllocationRecord allocation_records = 6; */ - java.util.List + java.util.List getAllocationRecordsList(); /** *
    @@ -56,7 +63,7 @@ public interface AllocatorMemoryUsedOrBuilder extends
        *
        * repeated .tensorflow.AllocationRecord allocation_records = 6;
        */
    -  org.tensorflow.proto.framework.AllocationRecord getAllocationRecords(int index);
    +  org.tensorflow.proto.AllocationRecord getAllocationRecords(int index);
       /**
        * 
        * The allocation and deallocation timeline.
    @@ -72,7 +79,7 @@ public interface AllocatorMemoryUsedOrBuilder extends
        *
        * repeated .tensorflow.AllocationRecord allocation_records = 6;
        */
    -  java.util.List 
    +  java.util.List 
           getAllocationRecordsOrBuilderList();
       /**
        * 
    @@ -81,7 +88,7 @@ public interface AllocatorMemoryUsedOrBuilder extends
        *
        * repeated .tensorflow.AllocationRecord allocation_records = 6;
        */
    -  org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrBuilder(
    +  org.tensorflow.proto.AllocationRecordOrBuilder getAllocationRecordsOrBuilder(
           int index);
     
       /**
    @@ -91,6 +98,7 @@ org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrB
        * 
    * * int64 allocator_bytes_in_use = 5; + * @return The allocatorBytesInUse. */ long getAllocatorBytesInUse(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDef.java new file mode 100644 index 00000000000..eba5e89cca2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDef.java @@ -0,0 +1,6335 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/api_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Used to specify and override the default API & behavior in the
    + * generated code for client languages, from what you would get from
    + * the OpDef alone. There will be a set of ApiDefs that are common
    + * to all client languages, and another set per client language.
    + * The per-client-language ApiDefs will inherit values from the
    + * common ApiDefs which it can either replace or modify.
    + *
    + * We separate the API definition from the OpDef so we can evolve the
    + * API while remaining backwards compatible when interpreting old
    + * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    + * ApiDefs message.
    + *
    + * WARNING: Be *very* careful changing the API for any existing op --
    + * you can change the semantics of existing code.  These changes may
    + * need to wait until a major release of TensorFlow to avoid breaking
    + * our compatibility promises.
    + * 
    + * + * Protobuf type {@code tensorflow.ApiDef} + */ +public final class ApiDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ApiDef) + ApiDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ApiDef.class.getName()); + } + // Use ApiDef.newBuilder() to construct. + private ApiDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ApiDef() { + graphOpName_ = ""; + deprecationMessage_ = ""; + visibility_ = 0; + endpoint_ = java.util.Collections.emptyList(); + inArg_ = java.util.Collections.emptyList(); + outArg_ = java.util.Collections.emptyList(); + argOrder_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + attr_ = java.util.Collections.emptyList(); + summary_ = ""; + description_ = ""; + descriptionPrefix_ = ""; + descriptionSuffix_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.class, org.tensorflow.proto.ApiDef.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.ApiDef.Visibility} + */ + public enum Visibility + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * Normally this is "VISIBLE" unless you are inheriting a
    +     * different value from another ApiDef.
    +     * 
    + * + * DEFAULT_VISIBILITY = 0; + */ + DEFAULT_VISIBILITY(0), + /** + *
    +     * Publicly visible in the API.
    +     * 
    + * + * VISIBLE = 1; + */ + VISIBLE(1), + /** + *
    +     * Do not include this op in the generated API. If visibility is
    +     * set to 'SKIP', other fields are ignored for this op.
    +     * 
    + * + * SKIP = 2; + */ + SKIP(2), + /** + *
    +     * Hide this op by putting it into an internal namespace (or whatever
    +     * is appropriate in the target language).
    +     * 
    + * + * HIDDEN = 3; + */ + HIDDEN(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Visibility.class.getName()); + } + /** + *
    +     * Normally this is "VISIBLE" unless you are inheriting a
    +     * different value from another ApiDef.
    +     * 
    + * + * DEFAULT_VISIBILITY = 0; + */ + public static final int DEFAULT_VISIBILITY_VALUE = 0; + /** + *
    +     * Publicly visible in the API.
    +     * 
    + * + * VISIBLE = 1; + */ + public static final int VISIBLE_VALUE = 1; + /** + *
    +     * Do not include this op in the generated API. If visibility is
    +     * set to 'SKIP', other fields are ignored for this op.
    +     * 
    + * + * SKIP = 2; + */ + public static final int SKIP_VALUE = 2; + /** + *
    +     * Hide this op by putting it into an internal namespace (or whatever
    +     * is appropriate in the target language).
    +     * 
    + * + * HIDDEN = 3; + */ + public static final int HIDDEN_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Visibility valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Visibility forNumber(int value) { + switch (value) { + case 0: return DEFAULT_VISIBILITY; + case 1: return VISIBLE; + case 2: return SKIP; + case 3: return HIDDEN; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Visibility> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Visibility findValueByNumber(int number) { + return Visibility.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.ApiDef.getDescriptor().getEnumTypes().get(0); + } + + private static final Visibility[] VALUES = values(); + + public static Visibility 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 Visibility(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.ApiDef.Visibility) + } + + public interface EndpointOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Endpoint) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Name should be either like "CamelCaseName" or
    +     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +     * use a snake_case convention instead of CamelCase.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name should be either like "CamelCaseName" or
    +     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +     * use a snake_case convention instead of CamelCase.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Set if this endpoint is deprecated. If set to true, a message suggesting
    +     * to use a non-deprecated endpoint instead will be printed. If all
    +     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    +     * 
    + * + * bool deprecated = 3; + * @return The deprecated. + */ + boolean getDeprecated(); + + /** + *
    +     * Major version when an endpoint will be deleted. For e.g. set this
    +     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    +     * deprecated in versions before that.
    +     * 
    + * + * int32 deprecation_version = 4; + * @return The deprecationVersion. + */ + int getDeprecationVersion(); + } + /** + *
    +   * If you specify any endpoint, this will replace all of the
    +   * inherited endpoints.  The first endpoint should be the
    +   * "canonical" endpoint, and should not be deprecated (unless all
    +   * endpoints are deprecated).
    +   * 
    + * + * Protobuf type {@code tensorflow.ApiDef.Endpoint} + */ + public static final class Endpoint extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Endpoint) + EndpointOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Endpoint.class.getName()); + } + // Use Endpoint.newBuilder() to construct. + private Endpoint(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Endpoint() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Endpoint.class, org.tensorflow.proto.ApiDef.Endpoint.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name should be either like "CamelCaseName" or
    +     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +     * use a snake_case convention instead of CamelCase.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name should be either like "CamelCaseName" or
    +     * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +     * use a snake_case convention instead of CamelCase.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 DEPRECATED_FIELD_NUMBER = 3; + private boolean deprecated_ = false; + /** + *
    +     * Set if this endpoint is deprecated. If set to true, a message suggesting
    +     * to use a non-deprecated endpoint instead will be printed. If all
    +     * endpoints are deprecated, set deprecation_message in ApiDef instead.
    +     * 
    + * + * bool deprecated = 3; + * @return The deprecated. + */ + @java.lang.Override + public boolean getDeprecated() { + return deprecated_; + } + + public static final int DEPRECATION_VERSION_FIELD_NUMBER = 4; + private int deprecationVersion_ = 0; + /** + *
    +     * Major version when an endpoint will be deleted. For e.g. set this
    +     * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    +     * deprecated in versions before that.
    +     * 
    + * + * int32 deprecation_version = 4; + * @return The deprecationVersion. + */ + @java.lang.Override + public int getDeprecationVersion() { + return deprecationVersion_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (deprecated_ != false) { + output.writeBool(3, deprecated_); + } + if (deprecationVersion_ != 0) { + output.writeInt32(4, deprecationVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (deprecated_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, deprecated_); + } + if (deprecationVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, deprecationVersion_); + } + size += getUnknownFields().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.ApiDef.Endpoint)) { + return super.equals(obj); + } + org.tensorflow.proto.ApiDef.Endpoint other = (org.tensorflow.proto.ApiDef.Endpoint) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getDeprecated() + != other.getDeprecated()) return false; + if (getDeprecationVersion() + != other.getDeprecationVersion()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEPRECATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDeprecated()); + hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationVersion(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Endpoint 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.ApiDef.Endpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Endpoint 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.ApiDef.Endpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ApiDef.Endpoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ApiDef.Endpoint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ApiDef.Endpoint 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * If you specify any endpoint, this will replace all of the
    +     * inherited endpoints.  The first endpoint should be the
    +     * "canonical" endpoint, and should not be deprecated (unless all
    +     * endpoints are deprecated).
    +     * 
    + * + * Protobuf type {@code tensorflow.ApiDef.Endpoint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Endpoint) + org.tensorflow.proto.ApiDef.EndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Endpoint.class, org.tensorflow.proto.ApiDef.Endpoint.Builder.class); + } + + // Construct using org.tensorflow.proto.ApiDef.Endpoint.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + deprecated_ = false; + deprecationVersion_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Endpoint_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Endpoint getDefaultInstanceForType() { + return org.tensorflow.proto.ApiDef.Endpoint.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Endpoint build() { + org.tensorflow.proto.ApiDef.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Endpoint buildPartial() { + org.tensorflow.proto.ApiDef.Endpoint result = new org.tensorflow.proto.ApiDef.Endpoint(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ApiDef.Endpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deprecated_ = deprecated_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deprecationVersion_ = deprecationVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ApiDef.Endpoint) { + return mergeFrom((org.tensorflow.proto.ApiDef.Endpoint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ApiDef.Endpoint other) { + if (other == org.tensorflow.proto.ApiDef.Endpoint.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getDeprecated() != false) { + setDeprecated(other.getDeprecated()); + } + if (other.getDeprecationVersion() != 0) { + setDeprecationVersion(other.getDeprecationVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: { + deprecated_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: { + deprecationVersion_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * Name should be either like "CamelCaseName" or
    +       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +       * use a snake_case convention instead of CamelCase.
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name should be either like "CamelCaseName" or
    +       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +       * use a snake_case convention instead of CamelCase.
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name should be either like "CamelCaseName" or
    +       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +       * use a snake_case convention instead of CamelCase.
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Name should be either like "CamelCaseName" or
    +       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +       * use a snake_case convention instead of CamelCase.
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Name should be either like "CamelCaseName" or
    +       * "Package.CamelCaseName". Client-language-specific ApiDefs may
    +       * use a snake_case convention instead of CamelCase.
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean deprecated_ ; + /** + *
    +       * Set if this endpoint is deprecated. If set to true, a message suggesting
    +       * to use a non-deprecated endpoint instead will be printed. If all
    +       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    +       * 
    + * + * bool deprecated = 3; + * @return The deprecated. + */ + @java.lang.Override + public boolean getDeprecated() { + return deprecated_; + } + /** + *
    +       * Set if this endpoint is deprecated. If set to true, a message suggesting
    +       * to use a non-deprecated endpoint instead will be printed. If all
    +       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    +       * 
    + * + * bool deprecated = 3; + * @param value The deprecated to set. + * @return This builder for chaining. + */ + public Builder setDeprecated(boolean value) { + + deprecated_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Set if this endpoint is deprecated. If set to true, a message suggesting
    +       * to use a non-deprecated endpoint instead will be printed. If all
    +       * endpoints are deprecated, set deprecation_message in ApiDef instead.
    +       * 
    + * + * bool deprecated = 3; + * @return This builder for chaining. + */ + public Builder clearDeprecated() { + bitField0_ = (bitField0_ & ~0x00000002); + deprecated_ = false; + onChanged(); + return this; + } + + private int deprecationVersion_ ; + /** + *
    +       * Major version when an endpoint will be deleted. For e.g. set this
    +       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    +       * deprecated in versions before that.
    +       * 
    + * + * int32 deprecation_version = 4; + * @return The deprecationVersion. + */ + @java.lang.Override + public int getDeprecationVersion() { + return deprecationVersion_; + } + /** + *
    +       * Major version when an endpoint will be deleted. For e.g. set this
    +       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    +       * deprecated in versions before that.
    +       * 
    + * + * int32 deprecation_version = 4; + * @param value The deprecationVersion to set. + * @return This builder for chaining. + */ + public Builder setDeprecationVersion(int value) { + + deprecationVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Major version when an endpoint will be deleted. For e.g. set this
    +       * value to 2 if endpoint should be removed in TensorFlow 2.0 and
    +       * deprecated in versions before that.
    +       * 
    + * + * int32 deprecation_version = 4; + * @return This builder for chaining. + */ + public Builder clearDeprecationVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + deprecationVersion_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Endpoint) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Endpoint) + private static final org.tensorflow.proto.ApiDef.Endpoint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ApiDef.Endpoint(); + } + + public static org.tensorflow.proto.ApiDef.Endpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Endpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ApiDef.Endpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ArgOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Arg) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Change the name used to access this arg in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + java.lang.String getRenameTo(); + /** + *
    +     * Change the name used to access this arg in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + com.google.protobuf.ByteString + getRenameToBytes(); + + /** + *
    +     * Note: this will replace any inherited arg doc. There is no
    +     * current way of modifying arg descriptions (other than replacing
    +     * them entirely) as can be done with op descriptions.
    +     * 
    + * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +     * Note: this will replace any inherited arg doc. There is no
    +     * current way of modifying arg descriptions (other than replacing
    +     * them entirely) as can be done with op descriptions.
    +     * 
    + * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + * Protobuf type {@code tensorflow.ApiDef.Arg} + */ + public static final class Arg extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Arg) + ArgOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Arg.class.getName()); + } + // Use Arg.newBuilder() to construct. + private Arg(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Arg() { + name_ = ""; + renameTo_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Arg.class, org.tensorflow.proto.ApiDef.Arg.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 RENAME_TO_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object renameTo_ = ""; + /** + *
    +     * Change the name used to access this arg in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + @java.lang.Override + public java.lang.String getRenameTo() { + java.lang.Object ref = renameTo_; + 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(); + renameTo_ = s; + return s; + } + } + /** + *
    +     * Change the name used to access this arg in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRenameToBytes() { + java.lang.Object ref = renameTo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + renameTo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +     * Note: this will replace any inherited arg doc. There is no
    +     * current way of modifying arg descriptions (other than replacing
    +     * them entirely) as can be done with op descriptions.
    +     * 
    + * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +     * Note: this will replace any inherited arg doc. There is no
    +     * current way of modifying arg descriptions (other than replacing
    +     * them entirely) as can be done with op descriptions.
    +     * 
    + * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(renameTo_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, renameTo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(renameTo_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, renameTo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + size += getUnknownFields().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.ApiDef.Arg)) { + return super.equals(obj); + } + org.tensorflow.proto.ApiDef.Arg other = (org.tensorflow.proto.ApiDef.Arg) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getRenameTo() + .equals(other.getRenameTo())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RENAME_TO_FIELD_NUMBER; + hash = (53 * hash) + getRenameTo().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ApiDef.Arg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Arg 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.ApiDef.Arg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Arg 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.ApiDef.Arg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Arg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Arg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Arg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ApiDef.Arg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ApiDef.Arg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Arg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Arg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ApiDef.Arg 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ApiDef.Arg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Arg) + org.tensorflow.proto.ApiDef.ArgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Arg.class, org.tensorflow.proto.ApiDef.Arg.Builder.class); + } + + // Construct using org.tensorflow.proto.ApiDef.Arg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + renameTo_ = ""; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Arg_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Arg getDefaultInstanceForType() { + return org.tensorflow.proto.ApiDef.Arg.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Arg build() { + org.tensorflow.proto.ApiDef.Arg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Arg buildPartial() { + org.tensorflow.proto.ApiDef.Arg result = new org.tensorflow.proto.ApiDef.Arg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ApiDef.Arg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renameTo_ = renameTo_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ApiDef.Arg) { + return mergeFrom((org.tensorflow.proto.ApiDef.Arg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ApiDef.Arg other) { + if (other == org.tensorflow.proto.ApiDef.Arg.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRenameTo().isEmpty()) { + renameTo_ = other.renameTo_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + renameTo_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object renameTo_ = ""; + /** + *
    +       * Change the name used to access this arg in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + public java.lang.String getRenameTo() { + java.lang.Object ref = renameTo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + renameTo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Change the name used to access this arg in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + public com.google.protobuf.ByteString + getRenameToBytes() { + java.lang.Object ref = renameTo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + renameTo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Change the name used to access this arg in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @param value The renameTo to set. + * @return This builder for chaining. + */ + public Builder setRenameTo( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + renameTo_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Change the name used to access this arg in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return This builder for chaining. + */ + public Builder clearRenameTo() { + renameTo_ = getDefaultInstance().getRenameTo(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Change the name used to access this arg in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @param value The bytes for renameTo to set. + * @return This builder for chaining. + */ + public Builder setRenameToBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + renameTo_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
    +       * Note: this will replace any inherited arg doc. There is no
    +       * current way of modifying arg descriptions (other than replacing
    +       * them entirely) as can be done with op descriptions.
    +       * 
    + * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Note: this will replace any inherited arg doc. There is no
    +       * current way of modifying arg descriptions (other than replacing
    +       * them entirely) as can be done with op descriptions.
    +       * 
    + * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Note: this will replace any inherited arg doc. There is no
    +       * current way of modifying arg descriptions (other than replacing
    +       * them entirely) as can be done with op descriptions.
    +       * 
    + * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Note: this will replace any inherited arg doc. There is no
    +       * current way of modifying arg descriptions (other than replacing
    +       * them entirely) as can be done with op descriptions.
    +       * 
    + * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Note: this will replace any inherited arg doc. There is no
    +       * current way of modifying arg descriptions (other than replacing
    +       * them entirely) as can be done with op descriptions.
    +       * 
    + * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Arg) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Arg) + private static final org.tensorflow.proto.ApiDef.Arg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ApiDef.Arg(); + } + + public static org.tensorflow.proto.ApiDef.Arg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Arg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ApiDef.Arg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AttrOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef.Attr) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Change the name used to access this attr in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + java.lang.String getRenameTo(); + /** + *
    +     * Change the name used to access this attr in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + com.google.protobuf.ByteString + getRenameToBytes(); + + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + boolean hasDefaultValue(); + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + org.tensorflow.proto.AttrValue getDefaultValue(); + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder(); + + /** + *
    +     * Note: this will replace any inherited attr doc, there is no current
    +     * way of modifying attr descriptions as can be done with op descriptions.
    +     * 
    + * + * string description = 4; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +     * Note: this will replace any inherited attr doc, there is no current
    +     * way of modifying attr descriptions as can be done with op descriptions.
    +     * 
    + * + * string description = 4; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
    +   * Description of the graph-construction-time configuration of this
    +   * Op.  That is to say, this describes the attr fields that will
    +   * be specified in the NodeDef.
    +   * 
    + * + * Protobuf type {@code tensorflow.ApiDef.Attr} + */ + public static final class Attr extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ApiDef.Attr) + AttrOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Attr.class.getName()); + } + // Use Attr.newBuilder() to construct. + private Attr(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Attr() { + name_ = ""; + renameTo_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Attr.class, org.tensorflow.proto.ApiDef.Attr.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 RENAME_TO_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object renameTo_ = ""; + /** + *
    +     * Change the name used to access this attr in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + @java.lang.Override + public java.lang.String getRenameTo() { + java.lang.Object ref = renameTo_; + 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(); + renameTo_ = s; + return s; + } + } + /** + *
    +     * Change the name used to access this attr in the API from what
    +     * is used in the GraphDef.  Note that these names in `backticks`
    +     * will also be replaced in the summary & description fields.
    +     * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRenameToBytes() { + java.lang.Object ref = renameTo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + renameTo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; + private org.tensorflow.proto.AttrValue defaultValue_; + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + @java.lang.Override + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getDefaultValue() { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + /** + *
    +     * Specify a new default value to use for this attr.  This default
    +     * will be used when creating new graphs, as opposed to the
    +     * default in the OpDef, which will be used when interpreting old
    +     * GraphDefs.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder() { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +     * Note: this will replace any inherited attr doc, there is no current
    +     * way of modifying attr descriptions as can be done with op descriptions.
    +     * 
    + * + * string description = 4; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +     * Note: this will replace any inherited attr doc, there is no current
    +     * way of modifying attr descriptions as can be done with op descriptions.
    +     * 
    + * + * string description = 4; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(renameTo_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, renameTo_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(renameTo_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, renameTo_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, description_); + } + size += getUnknownFields().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.ApiDef.Attr)) { + return super.equals(obj); + } + org.tensorflow.proto.ApiDef.Attr other = (org.tensorflow.proto.ApiDef.Attr) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getRenameTo() + .equals(other.getRenameTo())) return false; + if (hasDefaultValue() != other.hasDefaultValue()) return false; + if (hasDefaultValue()) { + if (!getDefaultValue() + .equals(other.getDefaultValue())) return false; + } + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RENAME_TO_FIELD_NUMBER; + hash = (53 * hash) + getRenameTo().hashCode(); + if (hasDefaultValue()) { + hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultValue().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ApiDef.Attr parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Attr 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.ApiDef.Attr parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Attr 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.ApiDef.Attr parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef.Attr parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Attr parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Attr parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ApiDef.Attr parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ApiDef.Attr parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef.Attr parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef.Attr parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ApiDef.Attr 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Description of the graph-construction-time configuration of this
    +     * Op.  That is to say, this describes the attr fields that will
    +     * be specified in the NodeDef.
    +     * 
    + * + * Protobuf type {@code tensorflow.ApiDef.Attr} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef.Attr) + org.tensorflow.proto.ApiDef.AttrOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.Attr.class, org.tensorflow.proto.ApiDef.Attr.Builder.class); + } + + // Construct using org.tensorflow.proto.ApiDef.Attr.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getDefaultValueFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + renameTo_ = ""; + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_Attr_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Attr getDefaultInstanceForType() { + return org.tensorflow.proto.ApiDef.Attr.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Attr build() { + org.tensorflow.proto.ApiDef.Attr result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef.Attr buildPartial() { + org.tensorflow.proto.ApiDef.Attr result = new org.tensorflow.proto.ApiDef.Attr(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ApiDef.Attr result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renameTo_ = renameTo_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.defaultValue_ = defaultValueBuilder_ == null + ? defaultValue_ + : defaultValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ApiDef.Attr) { + return mergeFrom((org.tensorflow.proto.ApiDef.Attr)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ApiDef.Attr other) { + if (other == org.tensorflow.proto.ApiDef.Attr.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRenameTo().isEmpty()) { + renameTo_ = other.renameTo_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDefaultValue()) { + mergeDefaultValue(other.getDefaultValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + renameTo_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getDefaultValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object renameTo_ = ""; + /** + *
    +       * Change the name used to access this attr in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return The renameTo. + */ + public java.lang.String getRenameTo() { + java.lang.Object ref = renameTo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + renameTo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Change the name used to access this attr in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return The bytes for renameTo. + */ + public com.google.protobuf.ByteString + getRenameToBytes() { + java.lang.Object ref = renameTo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + renameTo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Change the name used to access this attr in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @param value The renameTo to set. + * @return This builder for chaining. + */ + public Builder setRenameTo( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + renameTo_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Change the name used to access this attr in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @return This builder for chaining. + */ + public Builder clearRenameTo() { + renameTo_ = getDefaultInstance().getRenameTo(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Change the name used to access this attr in the API from what
    +       * is used in the GraphDef.  Note that these names in `backticks`
    +       * will also be replaced in the summary & description fields.
    +       * 
    + * + * string rename_to = 2; + * @param value The bytes for renameTo to set. + * @return This builder for chaining. + */ + public Builder setRenameToBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + renameTo_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private org.tensorflow.proto.AttrValue defaultValue_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> defaultValueBuilder_; + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + public org.tensorflow.proto.AttrValue getDefaultValue() { + if (defaultValueBuilder_ == null) { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } else { + return defaultValueBuilder_.getMessage(); + } + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder setDefaultValue(org.tensorflow.proto.AttrValue value) { + if (defaultValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultValue_ = value; + } else { + defaultValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder setDefaultValue( + org.tensorflow.proto.AttrValue.Builder builderForValue) { + if (defaultValueBuilder_ == null) { + defaultValue_ = builderForValue.build(); + } else { + defaultValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder mergeDefaultValue(org.tensorflow.proto.AttrValue value) { + if (defaultValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + defaultValue_ != null && + defaultValue_ != org.tensorflow.proto.AttrValue.getDefaultInstance()) { + getDefaultValueBuilder().mergeFrom(value); + } else { + defaultValue_ = value; + } + } else { + defaultValueBuilder_.mergeFrom(value); + } + if (defaultValue_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder clearDefaultValue() { + bitField0_ = (bitField0_ & ~0x00000004); + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public org.tensorflow.proto.AttrValue.Builder getDefaultValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDefaultValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder() { + if (defaultValueBuilder_ != null) { + return defaultValueBuilder_.getMessageOrBuilder(); + } else { + return defaultValue_ == null ? + org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + } + /** + *
    +       * Specify a new default value to use for this attr.  This default
    +       * will be used when creating new graphs, as opposed to the
    +       * default in the OpDef, which will be used when interpreting old
    +       * GraphDefs.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> + getDefaultValueFieldBuilder() { + if (defaultValueBuilder_ == null) { + defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder>( + getDefaultValue(), + getParentForChildren(), + isClean()); + defaultValue_ = null; + } + return defaultValueBuilder_; + } + + private java.lang.Object description_ = ""; + /** + *
    +       * Note: this will replace any inherited attr doc, there is no current
    +       * way of modifying attr descriptions as can be done with op descriptions.
    +       * 
    + * + * string description = 4; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Note: this will replace any inherited attr doc, there is no current
    +       * way of modifying attr descriptions as can be done with op descriptions.
    +       * 
    + * + * string description = 4; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Note: this will replace any inherited attr doc, there is no current
    +       * way of modifying attr descriptions as can be done with op descriptions.
    +       * 
    + * + * string description = 4; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Note: this will replace any inherited attr doc, there is no current
    +       * way of modifying attr descriptions as can be done with op descriptions.
    +       * 
    + * + * string description = 4; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * Note: this will replace any inherited attr doc, there is no current
    +       * way of modifying attr descriptions as can be done with op descriptions.
    +       * 
    + * + * string description = 4; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef.Attr) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ApiDef.Attr) + private static final org.tensorflow.proto.ApiDef.Attr DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ApiDef.Attr(); + } + + public static org.tensorflow.proto.ApiDef.Attr getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attr parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ApiDef.Attr getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int GRAPH_OP_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object graphOpName_ = ""; + /** + *
    +   * Name of the op (in the OpDef) to specify the API for.
    +   * 
    + * + * string graph_op_name = 1; + * @return The graphOpName. + */ + @java.lang.Override + public java.lang.String getGraphOpName() { + java.lang.Object ref = graphOpName_; + 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(); + graphOpName_ = s; + return s; + } + } + /** + *
    +   * Name of the op (in the OpDef) to specify the API for.
    +   * 
    + * + * string graph_op_name = 1; + * @return The bytes for graphOpName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphOpNameBytes() { + java.lang.Object ref = graphOpName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPRECATION_MESSAGE_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private volatile java.lang.Object deprecationMessage_ = ""; + /** + *
    +   * If this op is deprecated, set deprecation message to the message
    +   * that should be logged when this op is used.
    +   * The message should indicate alternative op to use, if any.
    +   * 
    + * + * string deprecation_message = 12; + * @return The deprecationMessage. + */ + @java.lang.Override + public java.lang.String getDeprecationMessage() { + java.lang.Object ref = deprecationMessage_; + 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(); + deprecationMessage_ = s; + return s; + } + } + /** + *
    +   * If this op is deprecated, set deprecation message to the message
    +   * that should be logged when this op is used.
    +   * The message should indicate alternative op to use, if any.
    +   * 
    + * + * string deprecation_message = 12; + * @return The bytes for deprecationMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeprecationMessageBytes() { + java.lang.Object ref = deprecationMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deprecationMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPRECATION_VERSION_FIELD_NUMBER = 13; + private int deprecationVersion_ = 0; + /** + *
    +   * Major version when the op will be deleted. For e.g. set this
    +   * value to 2 if op API should be removed in TensorFlow 2.0 and
    +   * deprecated in versions before that.
    +   * 
    + * + * int32 deprecation_version = 13; + * @return The deprecationVersion. + */ + @java.lang.Override + public int getDeprecationVersion() { + return deprecationVersion_; + } + + public static final int VISIBILITY_FIELD_NUMBER = 2; + private int visibility_ = 0; + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The enum numeric value on the wire for visibility. + */ + @java.lang.Override public int getVisibilityValue() { + return visibility_; + } + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The visibility. + */ + @java.lang.Override public org.tensorflow.proto.ApiDef.Visibility getVisibility() { + org.tensorflow.proto.ApiDef.Visibility result = org.tensorflow.proto.ApiDef.Visibility.forNumber(visibility_); + return result == null ? org.tensorflow.proto.ApiDef.Visibility.UNRECOGNIZED : result; + } + + public static final int ENDPOINT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List endpoint_; + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + @java.lang.Override + public java.util.List getEndpointList() { + return endpoint_; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + @java.lang.Override + public java.util.List + getEndpointOrBuilderList() { + return endpoint_; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + @java.lang.Override + public int getEndpointCount() { + return endpoint_.size(); + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.Endpoint getEndpoint(int index) { + return endpoint_.get(index); + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.EndpointOrBuilder getEndpointOrBuilder( + int index) { + return endpoint_.get(index); + } + + public static final int IN_ARG_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List inArg_; + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + @java.lang.Override + public java.util.List getInArgList() { + return inArg_; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + @java.lang.Override + public java.util.List + getInArgOrBuilderList() { + return inArg_; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + @java.lang.Override + public int getInArgCount() { + return inArg_.size(); + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.Arg getInArg(int index) { + return inArg_.get(index); + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.ArgOrBuilder getInArgOrBuilder( + int index) { + return inArg_.get(index); + } + + public static final int OUT_ARG_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List outArg_; + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + @java.lang.Override + public java.util.List getOutArgList() { + return outArg_; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + @java.lang.Override + public java.util.List + getOutArgOrBuilderList() { + return outArg_; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + @java.lang.Override + public int getOutArgCount() { + return outArg_.size(); + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.Arg getOutArg(int index) { + return outArg_.get(index); + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.ArgOrBuilder getOutArgOrBuilder( + int index) { + return outArg_.get(index); + } + + public static final int ARG_ORDER_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList argOrder_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @return A list containing the argOrder. + */ + public com.google.protobuf.ProtocolStringList + getArgOrderList() { + return argOrder_; + } + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @return The count of argOrder. + */ + public int getArgOrderCount() { + return argOrder_.size(); + } + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @param index The index of the element to return. + * @return The argOrder at the given index. + */ + public java.lang.String getArgOrder(int index) { + return argOrder_.get(index); + } + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @param index The index of the value to return. + * @return The bytes of the argOrder at the given index. + */ + public com.google.protobuf.ByteString + getArgOrderBytes(int index) { + return argOrder_.getByteString(index); + } + + public static final int ATTR_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List attr_; + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + @java.lang.Override + public java.util.List getAttrList() { + return attr_; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + @java.lang.Override + public java.util.List + getAttrOrBuilderList() { + return attr_; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + @java.lang.Override + public int getAttrCount() { + return attr_.size(); + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.Attr getAttr(int index) { + return attr_.get(index); + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.AttrOrBuilder getAttrOrBuilder( + int index) { + return attr_.get(index); + } + + public static final int SUMMARY_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object summary_ = ""; + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 7; + * @return The summary. + */ + @java.lang.Override + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + 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(); + summary_ = s; + return s; + } + } + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 7; + * @return The bytes for summary. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 8; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 8; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_PREFIX_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private volatile java.lang.Object descriptionPrefix_ = ""; + /** + *
    +   * Modify an existing/inherited description by adding text to the beginning
    +   * or end.
    +   * 
    + * + * string description_prefix = 9; + * @return The descriptionPrefix. + */ + @java.lang.Override + public java.lang.String getDescriptionPrefix() { + java.lang.Object ref = descriptionPrefix_; + 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(); + descriptionPrefix_ = s; + return s; + } + } + /** + *
    +   * Modify an existing/inherited description by adding text to the beginning
    +   * or end.
    +   * 
    + * + * string description_prefix = 9; + * @return The bytes for descriptionPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionPrefixBytes() { + java.lang.Object ref = descriptionPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + descriptionPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_SUFFIX_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private volatile java.lang.Object descriptionSuffix_ = ""; + /** + * string description_suffix = 10; + * @return The descriptionSuffix. + */ + @java.lang.Override + public java.lang.String getDescriptionSuffix() { + java.lang.Object ref = descriptionSuffix_; + 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(); + descriptionSuffix_ = s; + return s; + } + } + /** + * string description_suffix = 10; + * @return The bytes for descriptionSuffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionSuffixBytes() { + java.lang.Object ref = descriptionSuffix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + descriptionSuffix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphOpName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, graphOpName_); + } + if (visibility_ != org.tensorflow.proto.ApiDef.Visibility.DEFAULT_VISIBILITY.getNumber()) { + output.writeEnum(2, visibility_); + } + for (int i = 0; i < endpoint_.size(); i++) { + output.writeMessage(3, endpoint_.get(i)); + } + for (int i = 0; i < inArg_.size(); i++) { + output.writeMessage(4, inArg_.get(i)); + } + for (int i = 0; i < outArg_.size(); i++) { + output.writeMessage(5, outArg_.get(i)); + } + for (int i = 0; i < attr_.size(); i++) { + output.writeMessage(6, attr_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, summary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(descriptionPrefix_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, descriptionPrefix_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(descriptionSuffix_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, descriptionSuffix_); + } + for (int i = 0; i < argOrder_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, argOrder_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deprecationMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, deprecationMessage_); + } + if (deprecationVersion_ != 0) { + output.writeInt32(13, deprecationVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphOpName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, graphOpName_); + } + if (visibility_ != org.tensorflow.proto.ApiDef.Visibility.DEFAULT_VISIBILITY.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, visibility_); + } + for (int i = 0; i < endpoint_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, endpoint_.get(i)); + } + for (int i = 0; i < inArg_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, inArg_.get(i)); + } + for (int i = 0; i < outArg_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, outArg_.get(i)); + } + for (int i = 0; i < attr_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, attr_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, summary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(descriptionPrefix_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, descriptionPrefix_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(descriptionSuffix_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, descriptionSuffix_); + } + { + int dataSize = 0; + for (int i = 0; i < argOrder_.size(); i++) { + dataSize += computeStringSizeNoTag(argOrder_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgOrderList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deprecationMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, deprecationMessage_); + } + if (deprecationVersion_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, deprecationVersion_); + } + size += getUnknownFields().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.ApiDef)) { + return super.equals(obj); + } + org.tensorflow.proto.ApiDef other = (org.tensorflow.proto.ApiDef) obj; + + if (!getGraphOpName() + .equals(other.getGraphOpName())) return false; + if (!getDeprecationMessage() + .equals(other.getDeprecationMessage())) return false; + if (getDeprecationVersion() + != other.getDeprecationVersion()) return false; + if (visibility_ != other.visibility_) return false; + if (!getEndpointList() + .equals(other.getEndpointList())) return false; + if (!getInArgList() + .equals(other.getInArgList())) return false; + if (!getOutArgList() + .equals(other.getOutArgList())) return false; + if (!getArgOrderList() + .equals(other.getArgOrderList())) return false; + if (!getAttrList() + .equals(other.getAttrList())) return false; + if (!getSummary() + .equals(other.getSummary())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getDescriptionPrefix() + .equals(other.getDescriptionPrefix())) return false; + if (!getDescriptionSuffix() + .equals(other.getDescriptionSuffix())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GRAPH_OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGraphOpName().hashCode(); + hash = (37 * hash) + DEPRECATION_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationMessage().hashCode(); + hash = (37 * hash) + DEPRECATION_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getDeprecationVersion(); + hash = (37 * hash) + VISIBILITY_FIELD_NUMBER; + hash = (53 * hash) + visibility_; + if (getEndpointCount() > 0) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpointList().hashCode(); + } + if (getInArgCount() > 0) { + hash = (37 * hash) + IN_ARG_FIELD_NUMBER; + hash = (53 * hash) + getInArgList().hashCode(); + } + if (getOutArgCount() > 0) { + hash = (37 * hash) + OUT_ARG_FIELD_NUMBER; + hash = (53 * hash) + getOutArgList().hashCode(); + } + if (getArgOrderCount() > 0) { + hash = (37 * hash) + ARG_ORDER_FIELD_NUMBER; + hash = (53 * hash) + getArgOrderList().hashCode(); + } + if (getAttrCount() > 0) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + getAttrList().hashCode(); + } + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + DESCRIPTION_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getDescriptionPrefix().hashCode(); + hash = (37 * hash) + DESCRIPTION_SUFFIX_FIELD_NUMBER; + hash = (53 * hash) + getDescriptionSuffix().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ApiDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef 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.ApiDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef 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.ApiDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ApiDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ApiDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ApiDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ApiDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Used to specify and override the default API & behavior in the
    +   * generated code for client languages, from what you would get from
    +   * the OpDef alone. There will be a set of ApiDefs that are common
    +   * to all client languages, and another set per client language.
    +   * The per-client-language ApiDefs will inherit values from the
    +   * common ApiDefs which it can either replace or modify.
    +   *
    +   * We separate the API definition from the OpDef so we can evolve the
    +   * API while remaining backwards compatible when interpreting old
    +   * graphs.  Overrides go in an "api_def.pbtxt" file with a text-format
    +   * ApiDefs message.
    +   *
    +   * WARNING: Be *very* careful changing the API for any existing op --
    +   * you can change the semantics of existing code.  These changes may
    +   * need to wait until a major release of TensorFlow to avoid breaking
    +   * our compatibility promises.
    +   * 
    + * + * Protobuf type {@code tensorflow.ApiDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ApiDef) + org.tensorflow.proto.ApiDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDef.class, org.tensorflow.proto.ApiDef.Builder.class); + } + + // Construct using org.tensorflow.proto.ApiDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + graphOpName_ = ""; + deprecationMessage_ = ""; + deprecationVersion_ = 0; + visibility_ = 0; + if (endpointBuilder_ == null) { + endpoint_ = java.util.Collections.emptyList(); + } else { + endpoint_ = null; + endpointBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (inArgBuilder_ == null) { + inArg_ = java.util.Collections.emptyList(); + } else { + inArg_ = null; + inArgBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (outArgBuilder_ == null) { + outArg_ = java.util.Collections.emptyList(); + } else { + outArg_ = null; + outArgBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + argOrder_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + if (attrBuilder_ == null) { + attr_ = java.util.Collections.emptyList(); + } else { + attr_ = null; + attrBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + summary_ = ""; + description_ = ""; + descriptionPrefix_ = ""; + descriptionSuffix_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef getDefaultInstanceForType() { + return org.tensorflow.proto.ApiDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef build() { + org.tensorflow.proto.ApiDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDef buildPartial() { + org.tensorflow.proto.ApiDef result = new org.tensorflow.proto.ApiDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ApiDef result) { + if (endpointBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + endpoint_ = java.util.Collections.unmodifiableList(endpoint_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.endpoint_ = endpoint_; + } else { + result.endpoint_ = endpointBuilder_.build(); + } + if (inArgBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + inArg_ = java.util.Collections.unmodifiableList(inArg_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.inArg_ = inArg_; + } else { + result.inArg_ = inArgBuilder_.build(); + } + if (outArgBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + outArg_ = java.util.Collections.unmodifiableList(outArg_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.outArg_ = outArg_; + } else { + result.outArg_ = outArgBuilder_.build(); + } + if (attrBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + attr_ = java.util.Collections.unmodifiableList(attr_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.attr_ = attr_; + } else { + result.attr_ = attrBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ApiDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.graphOpName_ = graphOpName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deprecationMessage_ = deprecationMessage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deprecationVersion_ = deprecationVersion_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.visibility_ = visibility_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + argOrder_.makeImmutable(); + result.argOrder_ = argOrder_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.summary_ = summary_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.descriptionPrefix_ = descriptionPrefix_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.descriptionSuffix_ = descriptionSuffix_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ApiDef) { + return mergeFrom((org.tensorflow.proto.ApiDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ApiDef other) { + if (other == org.tensorflow.proto.ApiDef.getDefaultInstance()) return this; + if (!other.getGraphOpName().isEmpty()) { + graphOpName_ = other.graphOpName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeprecationMessage().isEmpty()) { + deprecationMessage_ = other.deprecationMessage_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getDeprecationVersion() != 0) { + setDeprecationVersion(other.getDeprecationVersion()); + } + if (other.visibility_ != 0) { + setVisibilityValue(other.getVisibilityValue()); + } + if (endpointBuilder_ == null) { + if (!other.endpoint_.isEmpty()) { + if (endpoint_.isEmpty()) { + endpoint_ = other.endpoint_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureEndpointIsMutable(); + endpoint_.addAll(other.endpoint_); + } + onChanged(); + } + } else { + if (!other.endpoint_.isEmpty()) { + if (endpointBuilder_.isEmpty()) { + endpointBuilder_.dispose(); + endpointBuilder_ = null; + endpoint_ = other.endpoint_; + bitField0_ = (bitField0_ & ~0x00000010); + endpointBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getEndpointFieldBuilder() : null; + } else { + endpointBuilder_.addAllMessages(other.endpoint_); + } + } + } + if (inArgBuilder_ == null) { + if (!other.inArg_.isEmpty()) { + if (inArg_.isEmpty()) { + inArg_ = other.inArg_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureInArgIsMutable(); + inArg_.addAll(other.inArg_); + } + onChanged(); + } + } else { + if (!other.inArg_.isEmpty()) { + if (inArgBuilder_.isEmpty()) { + inArgBuilder_.dispose(); + inArgBuilder_ = null; + inArg_ = other.inArg_; + bitField0_ = (bitField0_ & ~0x00000020); + inArgBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getInArgFieldBuilder() : null; + } else { + inArgBuilder_.addAllMessages(other.inArg_); + } + } + } + if (outArgBuilder_ == null) { + if (!other.outArg_.isEmpty()) { + if (outArg_.isEmpty()) { + outArg_ = other.outArg_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureOutArgIsMutable(); + outArg_.addAll(other.outArg_); + } + onChanged(); + } + } else { + if (!other.outArg_.isEmpty()) { + if (outArgBuilder_.isEmpty()) { + outArgBuilder_.dispose(); + outArgBuilder_ = null; + outArg_ = other.outArg_; + bitField0_ = (bitField0_ & ~0x00000040); + outArgBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutArgFieldBuilder() : null; + } else { + outArgBuilder_.addAllMessages(other.outArg_); + } + } + } + if (!other.argOrder_.isEmpty()) { + if (argOrder_.isEmpty()) { + argOrder_ = other.argOrder_; + bitField0_ |= 0x00000080; + } else { + ensureArgOrderIsMutable(); + argOrder_.addAll(other.argOrder_); + } + onChanged(); + } + if (attrBuilder_ == null) { + if (!other.attr_.isEmpty()) { + if (attr_.isEmpty()) { + attr_ = other.attr_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureAttrIsMutable(); + attr_.addAll(other.attr_); + } + onChanged(); + } + } else { + if (!other.attr_.isEmpty()) { + if (attrBuilder_.isEmpty()) { + attrBuilder_.dispose(); + attrBuilder_ = null; + attr_ = other.attr_; + bitField0_ = (bitField0_ & ~0x00000100); + attrBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAttrFieldBuilder() : null; + } else { + attrBuilder_.addAllMessages(other.attr_); + } + } + } + if (!other.getSummary().isEmpty()) { + summary_ = other.summary_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getDescriptionPrefix().isEmpty()) { + descriptionPrefix_ = other.descriptionPrefix_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getDescriptionSuffix().isEmpty()) { + descriptionSuffix_ = other.descriptionSuffix_; + bitField0_ |= 0x00001000; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + graphOpName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + visibility_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 26: { + org.tensorflow.proto.ApiDef.Endpoint m = + input.readMessage( + org.tensorflow.proto.ApiDef.Endpoint.parser(), + extensionRegistry); + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + endpoint_.add(m); + } else { + endpointBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + org.tensorflow.proto.ApiDef.Arg m = + input.readMessage( + org.tensorflow.proto.ApiDef.Arg.parser(), + extensionRegistry); + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + inArg_.add(m); + } else { + inArgBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + org.tensorflow.proto.ApiDef.Arg m = + input.readMessage( + org.tensorflow.proto.ApiDef.Arg.parser(), + extensionRegistry); + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + outArg_.add(m); + } else { + outArgBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + org.tensorflow.proto.ApiDef.Attr m = + input.readMessage( + org.tensorflow.proto.ApiDef.Attr.parser(), + extensionRegistry); + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(m); + } else { + attrBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: { + summary_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 58 + case 66: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 66 + case 74: { + descriptionPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 74 + case 82: { + descriptionSuffix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 82 + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + ensureArgOrderIsMutable(); + argOrder_.add(s); + break; + } // case 90 + case 98: { + deprecationMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 98 + case 104: { + deprecationVersion_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 104 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object graphOpName_ = ""; + /** + *
    +     * Name of the op (in the OpDef) to specify the API for.
    +     * 
    + * + * string graph_op_name = 1; + * @return The graphOpName. + */ + public java.lang.String getGraphOpName() { + java.lang.Object ref = graphOpName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphOpName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the op (in the OpDef) to specify the API for.
    +     * 
    + * + * string graph_op_name = 1; + * @return The bytes for graphOpName. + */ + public com.google.protobuf.ByteString + getGraphOpNameBytes() { + java.lang.Object ref = graphOpName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the op (in the OpDef) to specify the API for.
    +     * 
    + * + * string graph_op_name = 1; + * @param value The graphOpName to set. + * @return This builder for chaining. + */ + public Builder setGraphOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphOpName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the op (in the OpDef) to specify the API for.
    +     * 
    + * + * string graph_op_name = 1; + * @return This builder for chaining. + */ + public Builder clearGraphOpName() { + graphOpName_ = getDefaultInstance().getGraphOpName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the op (in the OpDef) to specify the API for.
    +     * 
    + * + * string graph_op_name = 1; + * @param value The bytes for graphOpName to set. + * @return This builder for chaining. + */ + public Builder setGraphOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphOpName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deprecationMessage_ = ""; + /** + *
    +     * If this op is deprecated, set deprecation message to the message
    +     * that should be logged when this op is used.
    +     * The message should indicate alternative op to use, if any.
    +     * 
    + * + * string deprecation_message = 12; + * @return The deprecationMessage. + */ + public java.lang.String getDeprecationMessage() { + java.lang.Object ref = deprecationMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deprecationMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * If this op is deprecated, set deprecation message to the message
    +     * that should be logged when this op is used.
    +     * The message should indicate alternative op to use, if any.
    +     * 
    + * + * string deprecation_message = 12; + * @return The bytes for deprecationMessage. + */ + public com.google.protobuf.ByteString + getDeprecationMessageBytes() { + java.lang.Object ref = deprecationMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deprecationMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * If this op is deprecated, set deprecation message to the message
    +     * that should be logged when this op is used.
    +     * The message should indicate alternative op to use, if any.
    +     * 
    + * + * string deprecation_message = 12; + * @param value The deprecationMessage to set. + * @return This builder for chaining. + */ + public Builder setDeprecationMessage( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deprecationMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If this op is deprecated, set deprecation message to the message
    +     * that should be logged when this op is used.
    +     * The message should indicate alternative op to use, if any.
    +     * 
    + * + * string deprecation_message = 12; + * @return This builder for chaining. + */ + public Builder clearDeprecationMessage() { + deprecationMessage_ = getDefaultInstance().getDeprecationMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * If this op is deprecated, set deprecation message to the message
    +     * that should be logged when this op is used.
    +     * The message should indicate alternative op to use, if any.
    +     * 
    + * + * string deprecation_message = 12; + * @param value The bytes for deprecationMessage to set. + * @return This builder for chaining. + */ + public Builder setDeprecationMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deprecationMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int deprecationVersion_ ; + /** + *
    +     * Major version when the op will be deleted. For e.g. set this
    +     * value to 2 if op API should be removed in TensorFlow 2.0 and
    +     * deprecated in versions before that.
    +     * 
    + * + * int32 deprecation_version = 13; + * @return The deprecationVersion. + */ + @java.lang.Override + public int getDeprecationVersion() { + return deprecationVersion_; + } + /** + *
    +     * Major version when the op will be deleted. For e.g. set this
    +     * value to 2 if op API should be removed in TensorFlow 2.0 and
    +     * deprecated in versions before that.
    +     * 
    + * + * int32 deprecation_version = 13; + * @param value The deprecationVersion to set. + * @return This builder for chaining. + */ + public Builder setDeprecationVersion(int value) { + + deprecationVersion_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Major version when the op will be deleted. For e.g. set this
    +     * value to 2 if op API should be removed in TensorFlow 2.0 and
    +     * deprecated in versions before that.
    +     * 
    + * + * int32 deprecation_version = 13; + * @return This builder for chaining. + */ + public Builder clearDeprecationVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + deprecationVersion_ = 0; + onChanged(); + return this; + } + + private int visibility_ = 0; + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The enum numeric value on the wire for visibility. + */ + @java.lang.Override public int getVisibilityValue() { + return visibility_; + } + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @param value The enum numeric value on the wire for visibility to set. + * @return This builder for chaining. + */ + public Builder setVisibilityValue(int value) { + visibility_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The visibility. + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef.Visibility getVisibility() { + org.tensorflow.proto.ApiDef.Visibility result = org.tensorflow.proto.ApiDef.Visibility.forNumber(visibility_); + return result == null ? org.tensorflow.proto.ApiDef.Visibility.UNRECOGNIZED : result; + } + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @param value The visibility to set. + * @return This builder for chaining. + */ + public Builder setVisibility(org.tensorflow.proto.ApiDef.Visibility value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + visibility_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return This builder for chaining. + */ + public Builder clearVisibility() { + bitField0_ = (bitField0_ & ~0x00000008); + visibility_ = 0; + onChanged(); + return this; + } + + private java.util.List endpoint_ = + java.util.Collections.emptyList(); + private void ensureEndpointIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + endpoint_ = new java.util.ArrayList(endpoint_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Endpoint, org.tensorflow.proto.ApiDef.Endpoint.Builder, org.tensorflow.proto.ApiDef.EndpointOrBuilder> endpointBuilder_; + + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public java.util.List getEndpointList() { + if (endpointBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoint_); + } else { + return endpointBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public int getEndpointCount() { + if (endpointBuilder_ == null) { + return endpoint_.size(); + } else { + return endpointBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public org.tensorflow.proto.ApiDef.Endpoint getEndpoint(int index) { + if (endpointBuilder_ == null) { + return endpoint_.get(index); + } else { + return endpointBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder setEndpoint( + int index, org.tensorflow.proto.ApiDef.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointIsMutable(); + endpoint_.set(index, value); + onChanged(); + } else { + endpointBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder setEndpoint( + int index, org.tensorflow.proto.ApiDef.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + endpoint_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder addEndpoint(org.tensorflow.proto.ApiDef.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointIsMutable(); + endpoint_.add(value); + onChanged(); + } else { + endpointBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder addEndpoint( + int index, org.tensorflow.proto.ApiDef.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointIsMutable(); + endpoint_.add(index, value); + onChanged(); + } else { + endpointBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder addEndpoint( + org.tensorflow.proto.ApiDef.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + endpoint_.add(builderForValue.build()); + onChanged(); + } else { + endpointBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder addEndpoint( + int index, org.tensorflow.proto.ApiDef.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + endpoint_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder addAllEndpoint( + java.lang.Iterable values) { + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, endpoint_); + onChanged(); + } else { + endpointBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder clearEndpoint() { + if (endpointBuilder_ == null) { + endpoint_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + endpointBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public Builder removeEndpoint(int index) { + if (endpointBuilder_ == null) { + ensureEndpointIsMutable(); + endpoint_.remove(index); + onChanged(); + } else { + endpointBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public org.tensorflow.proto.ApiDef.Endpoint.Builder getEndpointBuilder( + int index) { + return getEndpointFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public org.tensorflow.proto.ApiDef.EndpointOrBuilder getEndpointOrBuilder( + int index) { + if (endpointBuilder_ == null) { + return endpoint_.get(index); } else { + return endpointBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public java.util.List + getEndpointOrBuilderList() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoint_); + } + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public org.tensorflow.proto.ApiDef.Endpoint.Builder addEndpointBuilder() { + return getEndpointFieldBuilder().addBuilder( + org.tensorflow.proto.ApiDef.Endpoint.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public org.tensorflow.proto.ApiDef.Endpoint.Builder addEndpointBuilder( + int index) { + return getEndpointFieldBuilder().addBuilder( + index, org.tensorflow.proto.ApiDef.Endpoint.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + public java.util.List + getEndpointBuilderList() { + return getEndpointFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Endpoint, org.tensorflow.proto.ApiDef.Endpoint.Builder, org.tensorflow.proto.ApiDef.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Endpoint, org.tensorflow.proto.ApiDef.Endpoint.Builder, org.tensorflow.proto.ApiDef.EndpointOrBuilder>( + endpoint_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + endpoint_ = null; + } + return endpointBuilder_; + } + + private java.util.List inArg_ = + java.util.Collections.emptyList(); + private void ensureInArgIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + inArg_ = new java.util.ArrayList(inArg_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder> inArgBuilder_; + + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public java.util.List getInArgList() { + if (inArgBuilder_ == null) { + return java.util.Collections.unmodifiableList(inArg_); + } else { + return inArgBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public int getInArgCount() { + if (inArgBuilder_ == null) { + return inArg_.size(); + } else { + return inArgBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public org.tensorflow.proto.ApiDef.Arg getInArg(int index) { + if (inArgBuilder_ == null) { + return inArg_.get(index); + } else { + return inArgBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder setInArg( + int index, org.tensorflow.proto.ApiDef.Arg value) { + if (inArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInArgIsMutable(); + inArg_.set(index, value); + onChanged(); + } else { + inArgBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder setInArg( + int index, org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + inArg_.set(index, builderForValue.build()); + onChanged(); + } else { + inArgBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder addInArg(org.tensorflow.proto.ApiDef.Arg value) { + if (inArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInArgIsMutable(); + inArg_.add(value); + onChanged(); + } else { + inArgBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder addInArg( + int index, org.tensorflow.proto.ApiDef.Arg value) { + if (inArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInArgIsMutable(); + inArg_.add(index, value); + onChanged(); + } else { + inArgBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder addInArg( + org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + inArg_.add(builderForValue.build()); + onChanged(); + } else { + inArgBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder addInArg( + int index, org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + inArg_.add(index, builderForValue.build()); + onChanged(); + } else { + inArgBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder addAllInArg( + java.lang.Iterable values) { + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inArg_); + onChanged(); + } else { + inArgBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder clearInArg() { + if (inArgBuilder_ == null) { + inArg_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + inArgBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public Builder removeInArg(int index) { + if (inArgBuilder_ == null) { + ensureInArgIsMutable(); + inArg_.remove(index); + onChanged(); + } else { + inArgBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder getInArgBuilder( + int index) { + return getInArgFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public org.tensorflow.proto.ApiDef.ArgOrBuilder getInArgOrBuilder( + int index) { + if (inArgBuilder_ == null) { + return inArg_.get(index); } else { + return inArgBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public java.util.List + getInArgOrBuilderList() { + if (inArgBuilder_ != null) { + return inArgBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inArg_); + } + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder addInArgBuilder() { + return getInArgFieldBuilder().addBuilder( + org.tensorflow.proto.ApiDef.Arg.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder addInArgBuilder( + int index) { + return getInArgFieldBuilder().addBuilder( + index, org.tensorflow.proto.ApiDef.Arg.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + public java.util.List + getInArgBuilderList() { + return getInArgFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder> + getInArgFieldBuilder() { + if (inArgBuilder_ == null) { + inArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder>( + inArg_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + inArg_ = null; + } + return inArgBuilder_; + } + + private java.util.List outArg_ = + java.util.Collections.emptyList(); + private void ensureOutArgIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + outArg_ = new java.util.ArrayList(outArg_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder> outArgBuilder_; + + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public java.util.List getOutArgList() { + if (outArgBuilder_ == null) { + return java.util.Collections.unmodifiableList(outArg_); + } else { + return outArgBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public int getOutArgCount() { + if (outArgBuilder_ == null) { + return outArg_.size(); + } else { + return outArgBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public org.tensorflow.proto.ApiDef.Arg getOutArg(int index) { + if (outArgBuilder_ == null) { + return outArg_.get(index); + } else { + return outArgBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder setOutArg( + int index, org.tensorflow.proto.ApiDef.Arg value) { + if (outArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutArgIsMutable(); + outArg_.set(index, value); + onChanged(); + } else { + outArgBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder setOutArg( + int index, org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + outArg_.set(index, builderForValue.build()); + onChanged(); + } else { + outArgBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder addOutArg(org.tensorflow.proto.ApiDef.Arg value) { + if (outArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutArgIsMutable(); + outArg_.add(value); + onChanged(); + } else { + outArgBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder addOutArg( + int index, org.tensorflow.proto.ApiDef.Arg value) { + if (outArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutArgIsMutable(); + outArg_.add(index, value); + onChanged(); + } else { + outArgBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder addOutArg( + org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + outArg_.add(builderForValue.build()); + onChanged(); + } else { + outArgBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder addOutArg( + int index, org.tensorflow.proto.ApiDef.Arg.Builder builderForValue) { + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + outArg_.add(index, builderForValue.build()); + onChanged(); + } else { + outArgBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder addAllOutArg( + java.lang.Iterable values) { + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outArg_); + onChanged(); + } else { + outArgBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder clearOutArg() { + if (outArgBuilder_ == null) { + outArg_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + outArgBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public Builder removeOutArg(int index) { + if (outArgBuilder_ == null) { + ensureOutArgIsMutable(); + outArg_.remove(index); + onChanged(); + } else { + outArgBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder getOutArgBuilder( + int index) { + return getOutArgFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public org.tensorflow.proto.ApiDef.ArgOrBuilder getOutArgOrBuilder( + int index) { + if (outArgBuilder_ == null) { + return outArg_.get(index); } else { + return outArgBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public java.util.List + getOutArgOrBuilderList() { + if (outArgBuilder_ != null) { + return outArgBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outArg_); + } + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder addOutArgBuilder() { + return getOutArgFieldBuilder().addBuilder( + org.tensorflow.proto.ApiDef.Arg.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public org.tensorflow.proto.ApiDef.Arg.Builder addOutArgBuilder( + int index) { + return getOutArgFieldBuilder().addBuilder( + index, org.tensorflow.proto.ApiDef.Arg.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + public java.util.List + getOutArgBuilderList() { + return getOutArgFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder> + getOutArgFieldBuilder() { + if (outArgBuilder_ == null) { + outArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Arg, org.tensorflow.proto.ApiDef.Arg.Builder, org.tensorflow.proto.ApiDef.ArgOrBuilder>( + outArg_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + outArg_ = null; + } + return outArgBuilder_; + } + + private com.google.protobuf.LazyStringArrayList argOrder_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureArgOrderIsMutable() { + if (!argOrder_.isModifiable()) { + argOrder_ = new com.google.protobuf.LazyStringArrayList(argOrder_); + } + bitField0_ |= 0x00000080; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @return A list containing the argOrder. + */ + public com.google.protobuf.ProtocolStringList + getArgOrderList() { + argOrder_.makeImmutable(); + return argOrder_; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @return The count of argOrder. + */ + public int getArgOrderCount() { + return argOrder_.size(); + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param index The index of the element to return. + * @return The argOrder at the given index. + */ + public java.lang.String getArgOrder(int index) { + return argOrder_.get(index); + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param index The index of the value to return. + * @return The bytes of the argOrder at the given index. + */ + public com.google.protobuf.ByteString + getArgOrderBytes(int index) { + return argOrder_.getByteString(index); + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param index The index to set the value at. + * @param value The argOrder to set. + * @return This builder for chaining. + */ + public Builder setArgOrder( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgOrderIsMutable(); + argOrder_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param value The argOrder to add. + * @return This builder for chaining. + */ + public Builder addArgOrder( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgOrderIsMutable(); + argOrder_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param values The argOrder to add. + * @return This builder for chaining. + */ + public Builder addAllArgOrder( + java.lang.Iterable values) { + ensureArgOrderIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, argOrder_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @return This builder for chaining. + */ + public Builder clearArgOrder() { + argOrder_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080);; + onChanged(); + return this; + } + /** + *
    +     * List of original in_arg names to specify new argument order.
    +     * Length of arg_order should be either empty to keep current order
    +     * or match size of in_arg.
    +     * 
    + * + * repeated string arg_order = 11; + * @param value The bytes of the argOrder to add. + * @return This builder for chaining. + */ + public Builder addArgOrderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureArgOrderIsMutable(); + argOrder_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.util.List attr_ = + java.util.Collections.emptyList(); + private void ensureAttrIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + attr_ = new java.util.ArrayList(attr_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Attr, org.tensorflow.proto.ApiDef.Attr.Builder, org.tensorflow.proto.ApiDef.AttrOrBuilder> attrBuilder_; + + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public java.util.List getAttrList() { + if (attrBuilder_ == null) { + return java.util.Collections.unmodifiableList(attr_); + } else { + return attrBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public int getAttrCount() { + if (attrBuilder_ == null) { + return attr_.size(); + } else { + return attrBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public org.tensorflow.proto.ApiDef.Attr getAttr(int index) { + if (attrBuilder_ == null) { + return attr_.get(index); + } else { + return attrBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder setAttr( + int index, org.tensorflow.proto.ApiDef.Attr value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.set(index, value); + onChanged(); + } else { + attrBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder setAttr( + int index, org.tensorflow.proto.ApiDef.Attr.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.set(index, builderForValue.build()); + onChanged(); + } else { + attrBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder addAttr(org.tensorflow.proto.ApiDef.Attr value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.add(value); + onChanged(); + } else { + attrBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder addAttr( + int index, org.tensorflow.proto.ApiDef.Attr value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.add(index, value); + onChanged(); + } else { + attrBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder addAttr( + org.tensorflow.proto.ApiDef.Attr.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(builderForValue.build()); + onChanged(); + } else { + attrBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder addAttr( + int index, org.tensorflow.proto.ApiDef.Attr.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(index, builderForValue.build()); + onChanged(); + } else { + attrBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder addAllAttr( + java.lang.Iterable values) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, attr_); + onChanged(); + } else { + attrBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder clearAttr() { + if (attrBuilder_ == null) { + attr_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + attrBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public Builder removeAttr(int index) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.remove(index); + onChanged(); + } else { + attrBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public org.tensorflow.proto.ApiDef.Attr.Builder getAttrBuilder( + int index) { + return getAttrFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public org.tensorflow.proto.ApiDef.AttrOrBuilder getAttrOrBuilder( + int index) { + if (attrBuilder_ == null) { + return attr_.get(index); } else { + return attrBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public java.util.List + getAttrOrBuilderList() { + if (attrBuilder_ != null) { + return attrBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attr_); + } + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public org.tensorflow.proto.ApiDef.Attr.Builder addAttrBuilder() { + return getAttrFieldBuilder().addBuilder( + org.tensorflow.proto.ApiDef.Attr.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public org.tensorflow.proto.ApiDef.Attr.Builder addAttrBuilder( + int index) { + return getAttrFieldBuilder().addBuilder( + index, org.tensorflow.proto.ApiDef.Attr.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + public java.util.List + getAttrBuilderList() { + return getAttrFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Attr, org.tensorflow.proto.ApiDef.Attr.Builder, org.tensorflow.proto.ApiDef.AttrOrBuilder> + getAttrFieldBuilder() { + if (attrBuilder_ == null) { + attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef.Attr, org.tensorflow.proto.ApiDef.Attr.Builder, org.tensorflow.proto.ApiDef.AttrOrBuilder>( + attr_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + attr_ = null; + } + return attrBuilder_; + } + + private java.lang.Object summary_ = ""; + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 7; + * @return The summary. + */ + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summary_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 7; + * @return The bytes for summary. + */ + public com.google.protobuf.ByteString + getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 7; + * @param value The summary to set. + * @return This builder for chaining. + */ + public Builder setSummary( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + summary_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 7; + * @return This builder for chaining. + */ + public Builder clearSummary() { + summary_ = getDefaultInstance().getSummary(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 7; + * @param value The bytes for summary to set. + * @return This builder for chaining. + */ + public Builder setSummaryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + summary_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 8; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 8; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 8; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 8; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 8; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object descriptionPrefix_ = ""; + /** + *
    +     * Modify an existing/inherited description by adding text to the beginning
    +     * or end.
    +     * 
    + * + * string description_prefix = 9; + * @return The descriptionPrefix. + */ + public java.lang.String getDescriptionPrefix() { + java.lang.Object ref = descriptionPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + descriptionPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Modify an existing/inherited description by adding text to the beginning
    +     * or end.
    +     * 
    + * + * string description_prefix = 9; + * @return The bytes for descriptionPrefix. + */ + public com.google.protobuf.ByteString + getDescriptionPrefixBytes() { + java.lang.Object ref = descriptionPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + descriptionPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Modify an existing/inherited description by adding text to the beginning
    +     * or end.
    +     * 
    + * + * string description_prefix = 9; + * @param value The descriptionPrefix to set. + * @return This builder for chaining. + */ + public Builder setDescriptionPrefix( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + descriptionPrefix_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * Modify an existing/inherited description by adding text to the beginning
    +     * or end.
    +     * 
    + * + * string description_prefix = 9; + * @return This builder for chaining. + */ + public Builder clearDescriptionPrefix() { + descriptionPrefix_ = getDefaultInstance().getDescriptionPrefix(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + *
    +     * Modify an existing/inherited description by adding text to the beginning
    +     * or end.
    +     * 
    + * + * string description_prefix = 9; + * @param value The bytes for descriptionPrefix to set. + * @return This builder for chaining. + */ + public Builder setDescriptionPrefixBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + descriptionPrefix_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object descriptionSuffix_ = ""; + /** + * string description_suffix = 10; + * @return The descriptionSuffix. + */ + public java.lang.String getDescriptionSuffix() { + java.lang.Object ref = descriptionSuffix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + descriptionSuffix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string description_suffix = 10; + * @return The bytes for descriptionSuffix. + */ + public com.google.protobuf.ByteString + getDescriptionSuffixBytes() { + java.lang.Object ref = descriptionSuffix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + descriptionSuffix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string description_suffix = 10; + * @param value The descriptionSuffix to set. + * @return This builder for chaining. + */ + public Builder setDescriptionSuffix( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + descriptionSuffix_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * string description_suffix = 10; + * @return This builder for chaining. + */ + public Builder clearDescriptionSuffix() { + descriptionSuffix_ = getDefaultInstance().getDescriptionSuffix(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * string description_suffix = 10; + * @param value The bytes for descriptionSuffix to set. + * @return This builder for chaining. + */ + public Builder setDescriptionSuffixBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + descriptionSuffix_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ApiDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ApiDef) + private static final org.tensorflow.proto.ApiDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ApiDef(); + } + + public static org.tensorflow.proto.ApiDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ApiDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefOrBuilder.java new file mode 100644 index 00000000000..14dadfc1643 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefOrBuilder.java @@ -0,0 +1,297 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/api_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ApiDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ApiDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Name of the op (in the OpDef) to specify the API for.
    +   * 
    + * + * string graph_op_name = 1; + * @return The graphOpName. + */ + java.lang.String getGraphOpName(); + /** + *
    +   * Name of the op (in the OpDef) to specify the API for.
    +   * 
    + * + * string graph_op_name = 1; + * @return The bytes for graphOpName. + */ + com.google.protobuf.ByteString + getGraphOpNameBytes(); + + /** + *
    +   * If this op is deprecated, set deprecation message to the message
    +   * that should be logged when this op is used.
    +   * The message should indicate alternative op to use, if any.
    +   * 
    + * + * string deprecation_message = 12; + * @return The deprecationMessage. + */ + java.lang.String getDeprecationMessage(); + /** + *
    +   * If this op is deprecated, set deprecation message to the message
    +   * that should be logged when this op is used.
    +   * The message should indicate alternative op to use, if any.
    +   * 
    + * + * string deprecation_message = 12; + * @return The bytes for deprecationMessage. + */ + com.google.protobuf.ByteString + getDeprecationMessageBytes(); + + /** + *
    +   * Major version when the op will be deleted. For e.g. set this
    +   * value to 2 if op API should be removed in TensorFlow 2.0 and
    +   * deprecated in versions before that.
    +   * 
    + * + * int32 deprecation_version = 13; + * @return The deprecationVersion. + */ + int getDeprecationVersion(); + + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The enum numeric value on the wire for visibility. + */ + int getVisibilityValue(); + /** + * .tensorflow.ApiDef.Visibility visibility = 2; + * @return The visibility. + */ + org.tensorflow.proto.ApiDef.Visibility getVisibility(); + + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + java.util.List + getEndpointList(); + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + org.tensorflow.proto.ApiDef.Endpoint getEndpoint(int index); + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + int getEndpointCount(); + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + java.util.List + getEndpointOrBuilderList(); + /** + * repeated .tensorflow.ApiDef.Endpoint endpoint = 3; + */ + org.tensorflow.proto.ApiDef.EndpointOrBuilder getEndpointOrBuilder( + int index); + + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + java.util.List + getInArgList(); + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + org.tensorflow.proto.ApiDef.Arg getInArg(int index); + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + int getInArgCount(); + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + java.util.List + getInArgOrBuilderList(); + /** + * repeated .tensorflow.ApiDef.Arg in_arg = 4; + */ + org.tensorflow.proto.ApiDef.ArgOrBuilder getInArgOrBuilder( + int index); + + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + java.util.List + getOutArgList(); + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + org.tensorflow.proto.ApiDef.Arg getOutArg(int index); + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + int getOutArgCount(); + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + java.util.List + getOutArgOrBuilderList(); + /** + * repeated .tensorflow.ApiDef.Arg out_arg = 5; + */ + org.tensorflow.proto.ApiDef.ArgOrBuilder getOutArgOrBuilder( + int index); + + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @return A list containing the argOrder. + */ + java.util.List + getArgOrderList(); + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @return The count of argOrder. + */ + int getArgOrderCount(); + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @param index The index of the element to return. + * @return The argOrder at the given index. + */ + java.lang.String getArgOrder(int index); + /** + *
    +   * List of original in_arg names to specify new argument order.
    +   * Length of arg_order should be either empty to keep current order
    +   * or match size of in_arg.
    +   * 
    + * + * repeated string arg_order = 11; + * @param index The index of the value to return. + * @return The bytes of the argOrder at the given index. + */ + com.google.protobuf.ByteString + getArgOrderBytes(int index); + + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + java.util.List + getAttrList(); + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + org.tensorflow.proto.ApiDef.Attr getAttr(int index); + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + int getAttrCount(); + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + java.util.List + getAttrOrBuilderList(); + /** + * repeated .tensorflow.ApiDef.Attr attr = 6; + */ + org.tensorflow.proto.ApiDef.AttrOrBuilder getAttrOrBuilder( + int index); + + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 7; + * @return The summary. + */ + java.lang.String getSummary(); + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 7; + * @return The bytes for summary. + */ + com.google.protobuf.ByteString + getSummaryBytes(); + + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 8; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 8; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
    +   * Modify an existing/inherited description by adding text to the beginning
    +   * or end.
    +   * 
    + * + * string description_prefix = 9; + * @return The descriptionPrefix. + */ + java.lang.String getDescriptionPrefix(); + /** + *
    +   * Modify an existing/inherited description by adding text to the beginning
    +   * or end.
    +   * 
    + * + * string description_prefix = 9; + * @return The bytes for descriptionPrefix. + */ + com.google.protobuf.ByteString + getDescriptionPrefixBytes(); + + /** + * string description_suffix = 10; + * @return The descriptionSuffix. + */ + java.lang.String getDescriptionSuffix(); + /** + * string description_suffix = 10; + * @return The bytes for descriptionSuffix. + */ + com.google.protobuf.ByteString + getDescriptionSuffixBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefProtos.java new file mode 100644 index 00000000000..8c7940039f2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefProtos.java @@ -0,0 +1,129 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/api_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ApiDefProtos { + private ApiDefProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ApiDefProtos.class.getName()); + } + 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_ApiDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ApiDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ApiDef_Endpoint_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ApiDef_Arg_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ApiDef_Attr_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ApiDefs_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ApiDefs_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/framework/api_def.prot" + + "o\022\ntensorflow\032*tensorflow/core/framework" + + "/attr_value.proto\"\341\005\n\006ApiDef\022\025\n\rgraph_op" + + "_name\030\001 \001(\t\022\033\n\023deprecation_message\030\014 \001(\t" + + "\022\033\n\023deprecation_version\030\r \001(\005\0221\n\nvisibil" + + "ity\030\002 \001(\0162\035.tensorflow.ApiDef.Visibility" + + "\022-\n\010endpoint\030\003 \003(\0132\033.tensorflow.ApiDef.E" + + "ndpoint\022&\n\006in_arg\030\004 \003(\0132\026.tensorflow.Api" + + "Def.Arg\022\'\n\007out_arg\030\005 \003(\0132\026.tensorflow.Ap" + + "iDef.Arg\022\021\n\targ_order\030\013 \003(\t\022%\n\004attr\030\006 \003(" + + "\0132\027.tensorflow.ApiDef.Attr\022\017\n\007summary\030\007 " + + "\001(\t\022\023\n\013description\030\010 \001(\t\022\032\n\022description_" + + "prefix\030\t \001(\t\022\032\n\022description_suffix\030\n \001(\t" + + "\032I\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\022\n\ndeprecated" + + "\030\003 \001(\010\022\033\n\023deprecation_version\030\004 \001(\005\032;\n\003A" + + "rg\022\014\n\004name\030\001 \001(\t\022\021\n\trename_to\030\002 \001(\t\022\023\n\013d" + + "escription\030\003 \001(\t\032j\n\004Attr\022\014\n\004name\030\001 \001(\t\022\021" + + "\n\trename_to\030\002 \001(\t\022,\n\rdefault_value\030\003 \001(\013" + + "2\025.tensorflow.AttrValue\022\023\n\013description\030\004" + + " \001(\t\"G\n\nVisibility\022\026\n\022DEFAULT_VISIBILITY" + + "\020\000\022\013\n\007VISIBLE\020\001\022\010\n\004SKIP\020\002\022\n\n\006HIDDEN\020\003\")\n" + + "\007ApiDefs\022\036\n\002op\030\001 \003(\0132\022.tensorflow.ApiDef" + + "By\n\024org.tensorflow.protoB\014ApiDefProtosP\001" + + "ZNgithub.com/tensorflow/tensorflow/tenso" + + "rflow/go/core/framework/api_def_go_proto" + + "\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + }); + internal_static_tensorflow_ApiDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_ApiDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ApiDef_descriptor, + new java.lang.String[] { "GraphOpName", "DeprecationMessage", "DeprecationVersion", "Visibility", "Endpoint", "InArg", "OutArg", "ArgOrder", "Attr", "Summary", "Description", "DescriptionPrefix", "DescriptionSuffix", }); + internal_static_tensorflow_ApiDef_Endpoint_descriptor = + internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_ApiDef_Endpoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ApiDef_Endpoint_descriptor, + new java.lang.String[] { "Name", "Deprecated", "DeprecationVersion", }); + internal_static_tensorflow_ApiDef_Arg_descriptor = + internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_ApiDef_Arg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ApiDef_Arg_descriptor, + new java.lang.String[] { "Name", "RenameTo", "Description", }); + internal_static_tensorflow_ApiDef_Attr_descriptor = + internal_static_tensorflow_ApiDef_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_ApiDef_Attr_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ApiDef_Attr_descriptor, + new java.lang.String[] { "Name", "RenameTo", "DefaultValue", "Description", }); + internal_static_tensorflow_ApiDefs_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_ApiDefs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ApiDefs_descriptor, + new java.lang.String[] { "Op", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefs.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefs.java new file mode 100644 index 00000000000..a260fd1794e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefs.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/api_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.ApiDefs} + */ +public final class ApiDefs extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ApiDefs) + ApiDefsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ApiDefs.class.getName()); + } + // Use ApiDefs.newBuilder() to construct. + private ApiDefs(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ApiDefs() { + op_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDefs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDefs.class, org.tensorflow.proto.ApiDefs.Builder.class); + } + + public static final int OP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List op_; + /** + * repeated .tensorflow.ApiDef op = 1; + */ + @java.lang.Override + public java.util.List getOpList() { + return op_; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + @java.lang.Override + public java.util.List + getOpOrBuilderList() { + return op_; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + @java.lang.Override + public int getOpCount() { + return op_.size(); + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDef getOp(int index) { + return op_.get(index); + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + @java.lang.Override + public org.tensorflow.proto.ApiDefOrBuilder getOpOrBuilder( + int index) { + return op_.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 { + for (int i = 0; i < op_.size(); i++) { + output.writeMessage(1, op_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < op_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, op_.get(i)); + } + size += getUnknownFields().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.ApiDefs)) { + return super.equals(obj); + } + org.tensorflow.proto.ApiDefs other = (org.tensorflow.proto.ApiDefs) obj; + + if (!getOpList() + .equals(other.getOpList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOpCount() > 0) { + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOpList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ApiDefs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDefs 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.ApiDefs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDefs 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.ApiDefs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ApiDefs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ApiDefs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDefs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ApiDefs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ApiDefs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ApiDefs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ApiDefs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ApiDefs 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ApiDefs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ApiDefs) + org.tensorflow.proto.ApiDefsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDefs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ApiDefs.class, org.tensorflow.proto.ApiDefs.Builder.class); + } + + // Construct using org.tensorflow.proto.ApiDefs.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (opBuilder_ == null) { + op_ = java.util.Collections.emptyList(); + } else { + op_ = null; + opBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ApiDefProtos.internal_static_tensorflow_ApiDefs_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDefs getDefaultInstanceForType() { + return org.tensorflow.proto.ApiDefs.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ApiDefs build() { + org.tensorflow.proto.ApiDefs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ApiDefs buildPartial() { + org.tensorflow.proto.ApiDefs result = new org.tensorflow.proto.ApiDefs(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ApiDefs result) { + if (opBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + op_ = java.util.Collections.unmodifiableList(op_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.op_ = op_; + } else { + result.op_ = opBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ApiDefs result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ApiDefs) { + return mergeFrom((org.tensorflow.proto.ApiDefs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ApiDefs other) { + if (other == org.tensorflow.proto.ApiDefs.getDefaultInstance()) return this; + if (opBuilder_ == null) { + if (!other.op_.isEmpty()) { + if (op_.isEmpty()) { + op_ = other.op_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOpIsMutable(); + op_.addAll(other.op_); + } + onChanged(); + } + } else { + if (!other.op_.isEmpty()) { + if (opBuilder_.isEmpty()) { + opBuilder_.dispose(); + opBuilder_ = null; + op_ = other.op_; + bitField0_ = (bitField0_ & ~0x00000001); + opBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOpFieldBuilder() : null; + } else { + opBuilder_.addAllMessages(other.op_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.ApiDef m = + input.readMessage( + org.tensorflow.proto.ApiDef.parser(), + extensionRegistry); + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(m); + } else { + opBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List op_ = + java.util.Collections.emptyList(); + private void ensureOpIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + op_ = new java.util.ArrayList(op_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef, org.tensorflow.proto.ApiDef.Builder, org.tensorflow.proto.ApiDefOrBuilder> opBuilder_; + + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public java.util.List getOpList() { + if (opBuilder_ == null) { + return java.util.Collections.unmodifiableList(op_); + } else { + return opBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public int getOpCount() { + if (opBuilder_ == null) { + return op_.size(); + } else { + return opBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public org.tensorflow.proto.ApiDef getOp(int index) { + if (opBuilder_ == null) { + return op_.get(index); + } else { + return opBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder setOp( + int index, org.tensorflow.proto.ApiDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.set(index, value); + onChanged(); + } else { + opBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder setOp( + int index, org.tensorflow.proto.ApiDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.set(index, builderForValue.build()); + onChanged(); + } else { + opBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder addOp(org.tensorflow.proto.ApiDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.add(value); + onChanged(); + } else { + opBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder addOp( + int index, org.tensorflow.proto.ApiDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.add(index, value); + onChanged(); + } else { + opBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder addOp( + org.tensorflow.proto.ApiDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(builderForValue.build()); + onChanged(); + } else { + opBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder addOp( + int index, org.tensorflow.proto.ApiDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(index, builderForValue.build()); + onChanged(); + } else { + opBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder addAllOp( + java.lang.Iterable values) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, op_); + onChanged(); + } else { + opBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder clearOp() { + if (opBuilder_ == null) { + op_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + opBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public Builder removeOp(int index) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.remove(index); + onChanged(); + } else { + opBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public org.tensorflow.proto.ApiDef.Builder getOpBuilder( + int index) { + return getOpFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public org.tensorflow.proto.ApiDefOrBuilder getOpOrBuilder( + int index) { + if (opBuilder_ == null) { + return op_.get(index); } else { + return opBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public java.util.List + getOpOrBuilderList() { + if (opBuilder_ != null) { + return opBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(op_); + } + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public org.tensorflow.proto.ApiDef.Builder addOpBuilder() { + return getOpFieldBuilder().addBuilder( + org.tensorflow.proto.ApiDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public org.tensorflow.proto.ApiDef.Builder addOpBuilder( + int index) { + return getOpFieldBuilder().addBuilder( + index, org.tensorflow.proto.ApiDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.ApiDef op = 1; + */ + public java.util.List + getOpBuilderList() { + return getOpFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef, org.tensorflow.proto.ApiDef.Builder, org.tensorflow.proto.ApiDefOrBuilder> + getOpFieldBuilder() { + if (opBuilder_ == null) { + opBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ApiDef, org.tensorflow.proto.ApiDef.Builder, org.tensorflow.proto.ApiDefOrBuilder>( + op_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + op_ = null; + } + return opBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ApiDefs) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ApiDefs) + private static final org.tensorflow.proto.ApiDefs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ApiDefs(); + } + + public static org.tensorflow.proto.ApiDefs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApiDefs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ApiDefs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefsOrBuilder.java new file mode 100644 index 00000000000..b8ebc086863 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ApiDefsOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/api_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ApiDefsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ApiDefs) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.ApiDef op = 1; + */ + java.util.List + getOpList(); + /** + * repeated .tensorflow.ApiDef op = 1; + */ + org.tensorflow.proto.ApiDef getOp(int index); + /** + * repeated .tensorflow.ApiDef op = 1; + */ + int getOpCount(); + /** + * repeated .tensorflow.ApiDef op = 1; + */ + java.util.List + getOpOrBuilderList(); + /** + * repeated .tensorflow.ApiDef op = 1; + */ + org.tensorflow.proto.ApiDefOrBuilder getOpOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDef.java new file mode 100644 index 00000000000..db61fe4a55e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDef.java @@ -0,0 +1,794 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * An asset file def for a single file or a set of sharded files with the same
    + * name.
    + * 
    + * + * Protobuf type {@code tensorflow.AssetFileDef} + */ +public final class AssetFileDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AssetFileDef) + AssetFileDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AssetFileDef.class.getName()); + } + // Use AssetFileDef.newBuilder() to construct. + private AssetFileDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AssetFileDef() { + filename_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AssetFileDef.class, org.tensorflow.proto.AssetFileDef.Builder.class); + } + + private int bitField0_; + public static final int TENSOR_INFO_FIELD_NUMBER = 1; + private org.tensorflow.proto.TensorInfo tensorInfo_; + /** + *
    +   * The tensor to bind the asset filename to.
    +   * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + * @return Whether the tensorInfo field is set. + */ + @java.lang.Override + public boolean hasTensorInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The tensor to bind the asset filename to.
    +   * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + * @return The tensorInfo. + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getTensorInfo() { + return tensorInfo_ == null ? org.tensorflow.proto.TensorInfo.getDefaultInstance() : tensorInfo_; + } + /** + *
    +   * The tensor to bind the asset filename to.
    +   * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfoOrBuilder getTensorInfoOrBuilder() { + return tensorInfo_ == null ? org.tensorflow.proto.TensorInfo.getDefaultInstance() : tensorInfo_; + } + + public static final int FILENAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object filename_ = ""; + /** + *
    +   * The filename within an assets directory. Note: does not include the path
    +   * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +   * would be "vocab.txt".
    +   * 
    + * + * string filename = 2; + * @return The filename. + */ + @java.lang.Override + public java.lang.String getFilename() { + java.lang.Object ref = filename_; + 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(); + filename_ = s; + return s; + } + } + /** + *
    +   * The filename within an assets directory. Note: does not include the path
    +   * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +   * would be "vocab.txt".
    +   * 
    + * + * string filename = 2; + * @return The bytes for filename. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilenameBytes() { + java.lang.Object ref = filename_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filename_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTensorInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filename_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, filename_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTensorInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filename_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filename_); + } + size += getUnknownFields().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.AssetFileDef)) { + return super.equals(obj); + } + org.tensorflow.proto.AssetFileDef other = (org.tensorflow.proto.AssetFileDef) obj; + + if (hasTensorInfo() != other.hasTensorInfo()) return false; + if (hasTensorInfo()) { + if (!getTensorInfo() + .equals(other.getTensorInfo())) return false; + } + if (!getFilename() + .equals(other.getFilename())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTensorInfo()) { + hash = (37 * hash) + TENSOR_INFO_FIELD_NUMBER; + hash = (53 * hash) + getTensorInfo().hashCode(); + } + hash = (37 * hash) + FILENAME_FIELD_NUMBER; + hash = (53 * hash) + getFilename().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AssetFileDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AssetFileDef 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.AssetFileDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AssetFileDef 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.AssetFileDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AssetFileDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AssetFileDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AssetFileDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AssetFileDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AssetFileDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AssetFileDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AssetFileDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AssetFileDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * An asset file def for a single file or a set of sharded files with the same
    +   * name.
    +   * 
    + * + * Protobuf type {@code tensorflow.AssetFileDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AssetFileDef) + org.tensorflow.proto.AssetFileDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AssetFileDef.class, org.tensorflow.proto.AssetFileDef.Builder.class); + } + + // Construct using org.tensorflow.proto.AssetFileDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tensorInfo_ = null; + if (tensorInfoBuilder_ != null) { + tensorInfoBuilder_.dispose(); + tensorInfoBuilder_ = null; + } + filename_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_AssetFileDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AssetFileDef getDefaultInstanceForType() { + return org.tensorflow.proto.AssetFileDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AssetFileDef build() { + org.tensorflow.proto.AssetFileDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AssetFileDef buildPartial() { + org.tensorflow.proto.AssetFileDef result = new org.tensorflow.proto.AssetFileDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AssetFileDef result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tensorInfo_ = tensorInfoBuilder_ == null + ? tensorInfo_ + : tensorInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filename_ = filename_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AssetFileDef) { + return mergeFrom((org.tensorflow.proto.AssetFileDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AssetFileDef other) { + if (other == org.tensorflow.proto.AssetFileDef.getDefaultInstance()) return this; + if (other.hasTensorInfo()) { + mergeTensorInfo(other.getTensorInfo()); + } + if (!other.getFilename().isEmpty()) { + filename_ = other.filename_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getTensorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + filename_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.TensorInfo tensorInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder> tensorInfoBuilder_; + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + * @return Whether the tensorInfo field is set. + */ + public boolean hasTensorInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + * @return The tensorInfo. + */ + public org.tensorflow.proto.TensorInfo getTensorInfo() { + if (tensorInfoBuilder_ == null) { + return tensorInfo_ == null ? org.tensorflow.proto.TensorInfo.getDefaultInstance() : tensorInfo_; + } else { + return tensorInfoBuilder_.getMessage(); + } + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public Builder setTensorInfo(org.tensorflow.proto.TensorInfo value) { + if (tensorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorInfo_ = value; + } else { + tensorInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public Builder setTensorInfo( + org.tensorflow.proto.TensorInfo.Builder builderForValue) { + if (tensorInfoBuilder_ == null) { + tensorInfo_ = builderForValue.build(); + } else { + tensorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public Builder mergeTensorInfo(org.tensorflow.proto.TensorInfo value) { + if (tensorInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + tensorInfo_ != null && + tensorInfo_ != org.tensorflow.proto.TensorInfo.getDefaultInstance()) { + getTensorInfoBuilder().mergeFrom(value); + } else { + tensorInfo_ = value; + } + } else { + tensorInfoBuilder_.mergeFrom(value); + } + if (tensorInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public Builder clearTensorInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + tensorInfo_ = null; + if (tensorInfoBuilder_ != null) { + tensorInfoBuilder_.dispose(); + tensorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public org.tensorflow.proto.TensorInfo.Builder getTensorInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTensorInfoFieldBuilder().getBuilder(); + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + public org.tensorflow.proto.TensorInfoOrBuilder getTensorInfoOrBuilder() { + if (tensorInfoBuilder_ != null) { + return tensorInfoBuilder_.getMessageOrBuilder(); + } else { + return tensorInfo_ == null ? + org.tensorflow.proto.TensorInfo.getDefaultInstance() : tensorInfo_; + } + } + /** + *
    +     * The tensor to bind the asset filename to.
    +     * 
    + * + * .tensorflow.TensorInfo tensor_info = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder> + getTensorInfoFieldBuilder() { + if (tensorInfoBuilder_ == null) { + tensorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder>( + getTensorInfo(), + getParentForChildren(), + isClean()); + tensorInfo_ = null; + } + return tensorInfoBuilder_; + } + + private java.lang.Object filename_ = ""; + /** + *
    +     * The filename within an assets directory. Note: does not include the path
    +     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +     * would be "vocab.txt".
    +     * 
    + * + * string filename = 2; + * @return The filename. + */ + public java.lang.String getFilename() { + java.lang.Object ref = filename_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filename_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The filename within an assets directory. Note: does not include the path
    +     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +     * would be "vocab.txt".
    +     * 
    + * + * string filename = 2; + * @return The bytes for filename. + */ + public com.google.protobuf.ByteString + getFilenameBytes() { + java.lang.Object ref = filename_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filename_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The filename within an assets directory. Note: does not include the path
    +     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +     * would be "vocab.txt".
    +     * 
    + * + * string filename = 2; + * @param value The filename to set. + * @return This builder for chaining. + */ + public Builder setFilename( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + filename_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The filename within an assets directory. Note: does not include the path
    +     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +     * would be "vocab.txt".
    +     * 
    + * + * string filename = 2; + * @return This builder for chaining. + */ + public Builder clearFilename() { + filename_ = getDefaultInstance().getFilename(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The filename within an assets directory. Note: does not include the path
    +     * prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
    +     * would be "vocab.txt".
    +     * 
    + * + * string filename = 2; + * @param value The bytes for filename to set. + * @return This builder for chaining. + */ + public Builder setFilenameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + filename_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AssetFileDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AssetFileDef) + private static final org.tensorflow.proto.AssetFileDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AssetFileDef(); + } + + public static org.tensorflow.proto.AssetFileDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AssetFileDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AssetFileDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDefOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDefOrBuilder.java index dd8ec09799f..52a03d57c0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/AssetFileDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AssetFileDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface AssetFileDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.AssetFileDef) @@ -13,6 +15,7 @@ public interface AssetFileDefOrBuilder extends *
    * * .tensorflow.TensorInfo tensor_info = 1; + * @return Whether the tensorInfo field is set. */ boolean hasTensorInfo(); /** @@ -21,8 +24,9 @@ public interface AssetFileDefOrBuilder extends *
    * * .tensorflow.TensorInfo tensor_info = 1; + * @return The tensorInfo. */ - org.tensorflow.proto.framework.TensorInfo getTensorInfo(); + org.tensorflow.proto.TensorInfo getTensorInfo(); /** *
        * The tensor to bind the asset filename to.
    @@ -30,7 +34,7 @@ public interface AssetFileDefOrBuilder extends
        *
        * .tensorflow.TensorInfo tensor_info = 1;
        */
    -  org.tensorflow.proto.framework.TensorInfoOrBuilder getTensorInfoOrBuilder();
    +  org.tensorflow.proto.TensorInfoOrBuilder getTensorInfoOrBuilder();
     
       /**
        * 
    @@ -40,6 +44,7 @@ public interface AssetFileDefOrBuilder extends
        * 
    * * string filename = 2; + * @return The filename. */ java.lang.String getFilename(); /** @@ -50,6 +55,7 @@ public interface AssetFileDefOrBuilder extends *
    * * string filename = 2; + * @return The bytes for filename. */ com.google.protobuf.ByteString getFilenameBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValue.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValue.java new file mode 100644 index 00000000000..50282f98466 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValue.java @@ -0,0 +1,5570 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/attr_value.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing the value for an attr used to configure an Op.
    + * Comment indicates the corresponding attr type.  Only the field matching the
    + * attr type may be filled.
    + * 
    + * + * Protobuf type {@code tensorflow.AttrValue} + */ +public final class AttrValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AttrValue) + AttrValueOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AttrValue.class.getName()); + } + // Use AttrValue.newBuilder() to construct. + private AttrValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AttrValue() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AttrValue.class, org.tensorflow.proto.AttrValue.Builder.class); + } + + public interface ListValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue.ListValue) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @return A list containing the s. + */ + java.util.List getSList(); + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @return The count of s. + */ + int getSCount(); + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @param index The index of the element to return. + * @return The s at the given index. + */ + com.google.protobuf.ByteString getS(int index); + + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return A list containing the i. + */ + java.util.List getIList(); + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return The count of i. + */ + int getICount(); + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param index The index of the element to return. + * @return The i at the given index. + */ + long getI(int index); + + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @return A list containing the f. + */ + java.util.List getFList(); + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @return The count of f. + */ + int getFCount(); + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @param index The index of the element to return. + * @return The f at the given index. + */ + float getF(int index); + + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @return A list containing the b. + */ + java.util.List getBList(); + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @return The count of b. + */ + int getBCount(); + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @param index The index of the element to return. + * @return The b at the given index. + */ + boolean getB(int index); + + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the type. + */ + java.util.List getTypeList(); + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return The count of type. + */ + int getTypeCount(); + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the element to return. + * @return The type at the given index. + */ + org.tensorflow.proto.DataType getType(int index); + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the enum numeric values on the wire for type. + */ + java.util.List + getTypeValueList(); + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of type at the given index. + */ + int getTypeValue(int index); + + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + java.util.List + getShapeList(); + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + org.tensorflow.proto.TensorShapeProto getShape(int index); + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + int getShapeCount(); + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + java.util.List + getShapeOrBuilderList(); + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder( + int index); + + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + java.util.List + getTensorList(); + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + org.tensorflow.proto.TensorProto getTensor(int index); + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + int getTensorCount(); + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + java.util.List + getTensorOrBuilderList(); + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index); + + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + java.util.List + getFuncList(); + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + org.tensorflow.proto.NameAttrList getFunc(int index); + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + int getFuncCount(); + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + java.util.List + getFuncOrBuilderList(); + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder( + int index); + } + /** + *
    +   * LINT.IfChange
    +   * 
    + * + * Protobuf type {@code tensorflow.AttrValue.ListValue} + */ + public static final class ListValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AttrValue.ListValue) + ListValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ListValue.class.getName()); + } + // Use ListValue.newBuilder() to construct. + private ListValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ListValue() { + s_ = emptyList(com.google.protobuf.ByteString.class); + i_ = emptyLongList(); + f_ = emptyFloatList(); + b_ = emptyBooleanList(); + type_ = emptyIntList(); + shape_ = java.util.Collections.emptyList(); + tensor_ = java.util.Collections.emptyList(); + func_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AttrValue.ListValue.class, org.tensorflow.proto.AttrValue.ListValue.Builder.class); + } + + public static final int S_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList s_ = + emptyList(com.google.protobuf.ByteString.class); + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @return A list containing the s. + */ + @java.lang.Override + public java.util.List + getSList() { + return s_; + } + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @return The count of s. + */ + public int getSCount() { + return s_.size(); + } + /** + *
    +     * "list(string)"
    +     * 
    + * + * repeated bytes s = 2; + * @param index The index of the element to return. + * @return The s at the given index. + */ + public com.google.protobuf.ByteString getS(int index) { + return s_.get(index); + } + + public static final int I_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList i_ = + emptyLongList(); + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return A list containing the i. + */ + @java.lang.Override + public java.util.List + getIList() { + return i_; + } + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return The count of i. + */ + public int getICount() { + return i_.size(); + } + /** + *
    +     * "list(int)"
    +     * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param index The index of the element to return. + * @return The i at the given index. + */ + public long getI(int index) { + return i_.getLong(index); + } + private int iMemoizedSerializedSize = -1; + + public static final int F_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList f_ = + emptyFloatList(); + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @return A list containing the f. + */ + @java.lang.Override + public java.util.List + getFList() { + return f_; + } + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @return The count of f. + */ + public int getFCount() { + return f_.size(); + } + /** + *
    +     * "list(float)"
    +     * 
    + * + * repeated float f = 4 [packed = true]; + * @param index The index of the element to return. + * @return The f at the given index. + */ + public float getF(int index) { + return f_.getFloat(index); + } + private int fMemoizedSerializedSize = -1; + + public static final int B_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.BooleanList b_ = + emptyBooleanList(); + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @return A list containing the b. + */ + @java.lang.Override + public java.util.List + getBList() { + return b_; + } + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @return The count of b. + */ + public int getBCount() { + return b_.size(); + } + /** + *
    +     * "list(bool)"
    +     * 
    + * + * repeated bool b = 5 [packed = true]; + * @param index The index of the element to return. + * @return The b at the given index. + */ + public boolean getB(int index) { + return b_.getBoolean(index); + } + private int bMemoizedSerializedSize = -1; + + public static final int TYPE_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList type_; + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType> type_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType>() { + public org.tensorflow.proto.DataType convert(int from) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(from); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + }; + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the type. + */ + @java.lang.Override + public java.util.List getTypeList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(type_, type_converter_); + } + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return The count of type. + */ + @java.lang.Override + public int getTypeCount() { + return type_.size(); + } + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the element to return. + * @return The type at the given index. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getType(int index) { + return type_converter_.convert(type_.getInt(index)); + } + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the enum numeric values on the wire for type. + */ + @java.lang.Override + public java.util.List + getTypeValueList() { + return type_; + } + /** + *
    +     * "list(type)"
    +     * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of type at the given index. + */ + @java.lang.Override + public int getTypeValue(int index) { + return type_.getInt(index); + } + private int typeMemoizedSerializedSize; + + public static final int SHAPE_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List shape_; + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public java.util.List getShapeList() { + return shape_; + } + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public java.util.List + getShapeOrBuilderList() { + return shape_; + } + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public int getShapeCount() { + return shape_.size(); + } + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape(int index) { + return shape_.get(index); + } + /** + *
    +     * "list(shape)"
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder( + int index) { + return shape_.get(index); + } + + public static final int TENSOR_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private java.util.List tensor_; + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public java.util.List getTensorList() { + return tensor_; + } + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public java.util.List + getTensorOrBuilderList() { + return tensor_; + } + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public int getTensorCount() { + return tensor_.size(); + } + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensor(int index) { + return tensor_.get(index); + } + /** + *
    +     * "list(tensor)"
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index) { + return tensor_.get(index); + } + + public static final int FUNC_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List func_; + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + @java.lang.Override + public java.util.List getFuncList() { + return func_; + } + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + @java.lang.Override + public java.util.List + getFuncOrBuilderList() { + return func_; + } + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + @java.lang.Override + public int getFuncCount() { + return func_.size(); + } + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrList getFunc(int index) { + return func_.get(index); + } + /** + *
    +     * "list(attr)"
    +     * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder( + int index) { + return func_.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 { + getSerializedSize(); + for (int i = 0; i < s_.size(); i++) { + output.writeBytes(2, s_.get(i)); + } + if (getIList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(iMemoizedSerializedSize); + } + for (int i = 0; i < i_.size(); i++) { + output.writeInt64NoTag(i_.getLong(i)); + } + if (getFList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(fMemoizedSerializedSize); + } + for (int i = 0; i < f_.size(); i++) { + output.writeFloatNoTag(f_.getFloat(i)); + } + if (getBList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(bMemoizedSerializedSize); + } + for (int i = 0; i < b_.size(); i++) { + output.writeBoolNoTag(b_.getBoolean(i)); + } + if (getTypeList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(typeMemoizedSerializedSize); + } + for (int i = 0; i < type_.size(); i++) { + output.writeEnumNoTag(type_.getInt(i)); + } + for (int i = 0; i < shape_.size(); i++) { + output.writeMessage(7, shape_.get(i)); + } + for (int i = 0; i < tensor_.size(); i++) { + output.writeMessage(8, tensor_.get(i)); + } + for (int i = 0; i < func_.size(); i++) { + output.writeMessage(9, func_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < s_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(s_.get(i)); + } + size += dataSize; + size += 1 * getSList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < i_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(i_.getLong(i)); + } + size += dataSize; + if (!getIList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + iMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 4 * getFList().size(); + size += dataSize; + if (!getFList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + fMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 1 * getBList().size(); + size += dataSize; + if (!getBList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + bMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < type_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(type_.getInt(i)); + } + size += dataSize; + if (!getTypeList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }typeMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < shape_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, shape_.get(i)); + } + for (int i = 0; i < tensor_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, tensor_.get(i)); + } + for (int i = 0; i < func_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, func_.get(i)); + } + size += getUnknownFields().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.AttrValue.ListValue)) { + return super.equals(obj); + } + org.tensorflow.proto.AttrValue.ListValue other = (org.tensorflow.proto.AttrValue.ListValue) obj; + + if (!getSList() + .equals(other.getSList())) return false; + if (!getIList() + .equals(other.getIList())) return false; + if (!getFList() + .equals(other.getFList())) return false; + if (!getBList() + .equals(other.getBList())) return false; + if (!type_.equals(other.type_)) return false; + if (!getShapeList() + .equals(other.getShapeList())) return false; + if (!getTensorList() + .equals(other.getTensorList())) return false; + if (!getFuncList() + .equals(other.getFuncList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSCount() > 0) { + hash = (37 * hash) + S_FIELD_NUMBER; + hash = (53 * hash) + getSList().hashCode(); + } + if (getICount() > 0) { + hash = (37 * hash) + I_FIELD_NUMBER; + hash = (53 * hash) + getIList().hashCode(); + } + if (getFCount() > 0) { + hash = (37 * hash) + F_FIELD_NUMBER; + hash = (53 * hash) + getFList().hashCode(); + } + if (getBCount() > 0) { + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getBList().hashCode(); + } + if (getTypeCount() > 0) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_.hashCode(); + } + if (getShapeCount() > 0) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShapeList().hashCode(); + } + if (getTensorCount() > 0) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensorList().hashCode(); + } + if (getFuncCount() > 0) { + hash = (37 * hash) + FUNC_FIELD_NUMBER; + hash = (53 * hash) + getFuncList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AttrValue.ListValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue.ListValue 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.AttrValue.ListValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue.ListValue 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.AttrValue.ListValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue.ListValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AttrValue.ListValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AttrValue.ListValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AttrValue.ListValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AttrValue.ListValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AttrValue.ListValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AttrValue.ListValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AttrValue.ListValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * LINT.IfChange
    +     * 
    + * + * Protobuf type {@code tensorflow.AttrValue.ListValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue.ListValue) + org.tensorflow.proto.AttrValue.ListValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AttrValue.ListValue.class, org.tensorflow.proto.AttrValue.ListValue.Builder.class); + } + + // Construct using org.tensorflow.proto.AttrValue.ListValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + s_ = emptyList(com.google.protobuf.ByteString.class); + i_ = emptyLongList(); + f_ = emptyFloatList(); + b_ = emptyBooleanList(); + type_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + if (shapeBuilder_ == null) { + shape_ = java.util.Collections.emptyList(); + } else { + shape_ = null; + shapeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + } else { + tensor_ = null; + tensorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (funcBuilder_ == null) { + func_ = java.util.Collections.emptyList(); + } else { + func_ = null; + funcBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValue getDefaultInstanceForType() { + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValue build() { + org.tensorflow.proto.AttrValue.ListValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValue buildPartial() { + org.tensorflow.proto.AttrValue.ListValue result = new org.tensorflow.proto.AttrValue.ListValue(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.AttrValue.ListValue result) { + if (((bitField0_ & 0x00000010) != 0)) { + type_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.type_ = type_; + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + shape_ = java.util.Collections.unmodifiableList(shape_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.shape_ = shape_; + } else { + result.shape_ = shapeBuilder_.build(); + } + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + tensor_ = java.util.Collections.unmodifiableList(tensor_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.tensor_ = tensor_; + } else { + result.tensor_ = tensorBuilder_.build(); + } + if (funcBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + func_ = java.util.Collections.unmodifiableList(func_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.func_ = func_; + } else { + result.func_ = funcBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.AttrValue.ListValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + s_.makeImmutable(); + result.s_ = s_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + i_.makeImmutable(); + result.i_ = i_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + f_.makeImmutable(); + result.f_ = f_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + b_.makeImmutable(); + result.b_ = b_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AttrValue.ListValue) { + return mergeFrom((org.tensorflow.proto.AttrValue.ListValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AttrValue.ListValue other) { + if (other == org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance()) return this; + if (!other.s_.isEmpty()) { + if (s_.isEmpty()) { + s_ = other.s_; + s_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureSIsMutable(); + s_.addAll(other.s_); + } + onChanged(); + } + if (!other.i_.isEmpty()) { + if (i_.isEmpty()) { + i_ = other.i_; + i_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureIIsMutable(); + i_.addAll(other.i_); + } + onChanged(); + } + if (!other.f_.isEmpty()) { + if (f_.isEmpty()) { + f_ = other.f_; + f_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureFIsMutable(); + f_.addAll(other.f_); + } + onChanged(); + } + if (!other.b_.isEmpty()) { + if (b_.isEmpty()) { + b_ = other.b_; + b_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensureBIsMutable(); + b_.addAll(other.b_); + } + onChanged(); + } + if (!other.type_.isEmpty()) { + if (type_.isEmpty()) { + type_ = other.type_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTypeIsMutable(); + type_.addAll(other.type_); + } + onChanged(); + } + if (shapeBuilder_ == null) { + if (!other.shape_.isEmpty()) { + if (shape_.isEmpty()) { + shape_ = other.shape_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureShapeIsMutable(); + shape_.addAll(other.shape_); + } + onChanged(); + } + } else { + if (!other.shape_.isEmpty()) { + if (shapeBuilder_.isEmpty()) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + shape_ = other.shape_; + bitField0_ = (bitField0_ & ~0x00000020); + shapeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getShapeFieldBuilder() : null; + } else { + shapeBuilder_.addAllMessages(other.shape_); + } + } + } + if (tensorBuilder_ == null) { + if (!other.tensor_.isEmpty()) { + if (tensor_.isEmpty()) { + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureTensorIsMutable(); + tensor_.addAll(other.tensor_); + } + onChanged(); + } + } else { + if (!other.tensor_.isEmpty()) { + if (tensorBuilder_.isEmpty()) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000040); + tensorBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorFieldBuilder() : null; + } else { + tensorBuilder_.addAllMessages(other.tensor_); + } + } + } + if (funcBuilder_ == null) { + if (!other.func_.isEmpty()) { + if (func_.isEmpty()) { + func_ = other.func_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureFuncIsMutable(); + func_.addAll(other.func_); + } + onChanged(); + } + } else { + if (!other.func_.isEmpty()) { + if (funcBuilder_.isEmpty()) { + funcBuilder_.dispose(); + funcBuilder_ = null; + func_ = other.func_; + bitField0_ = (bitField0_ & ~0x00000080); + funcBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFuncFieldBuilder() : null; + } else { + funcBuilder_.addAllMessages(other.func_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureSIsMutable(); + s_.add(v); + break; + } // case 18 + case 24: { + long v = input.readInt64(); + ensureIIsMutable(); + i_.addLong(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureIIsMutable(); + while (input.getBytesUntilLimit() > 0) { + i_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 26 + case 37: { + float v = input.readFloat(); + ensureFIsMutable(); + f_.addFloat(v); + break; + } // case 37 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureFIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + f_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 34 + case 40: { + boolean v = input.readBool(); + ensureBIsMutable(); + b_.addBoolean(v); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureBIsMutable(alloc / 1); + while (input.getBytesUntilLimit() > 0) { + b_.addBoolean(input.readBool()); + } + input.popLimit(limit); + break; + } // case 42 + case 48: { + int tmpRaw = input.readEnum(); + ensureTypeIsMutable(); + type_.addInt(tmpRaw); + break; + } // case 48 + case 50: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureTypeIsMutable(); + type_.addInt(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 50 + case 58: { + org.tensorflow.proto.TensorShapeProto m = + input.readMessage( + org.tensorflow.proto.TensorShapeProto.parser(), + extensionRegistry); + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + shape_.add(m); + } else { + shapeBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + org.tensorflow.proto.TensorProto m = + input.readMessage( + org.tensorflow.proto.TensorProto.parser(), + extensionRegistry); + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(m); + } else { + tensorBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: { + org.tensorflow.proto.NameAttrList m = + input.readMessage( + org.tensorflow.proto.NameAttrList.parser(), + extensionRegistry); + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + func_.add(m); + } else { + funcBuilder_.addMessage(m); + } + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList s_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureSIsMutable() { + if (!s_.isModifiable()) { + s_ = makeMutableCopy(s_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @return A list containing the s. + */ + public java.util.List + getSList() { + s_.makeImmutable(); + return s_; + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @return The count of s. + */ + public int getSCount() { + return s_.size(); + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @param index The index of the element to return. + * @return The s at the given index. + */ + public com.google.protobuf.ByteString getS(int index) { + return s_.get(index); + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @param index The index to set the value at. + * @param value The s to set. + * @return This builder for chaining. + */ + public Builder setS( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureSIsMutable(); + s_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @param value The s to add. + * @return This builder for chaining. + */ + public Builder addS(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureSIsMutable(); + s_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @param values The s to add. + * @return This builder for chaining. + */ + public Builder addAllS( + java.lang.Iterable values) { + ensureSIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, s_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * "list(string)"
    +       * 
    + * + * repeated bytes s = 2; + * @return This builder for chaining. + */ + public Builder clearS() { + s_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList i_ = emptyLongList(); + private void ensureIIsMutable() { + if (!i_.isModifiable()) { + i_ = makeMutableCopy(i_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return A list containing the i. + */ + public java.util.List + getIList() { + i_.makeImmutable(); + return i_; + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return The count of i. + */ + public int getICount() { + return i_.size(); + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param index The index of the element to return. + * @return The i at the given index. + */ + public long getI(int index) { + return i_.getLong(index); + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param index The index to set the value at. + * @param value The i to set. + * @return This builder for chaining. + */ + public Builder setI( + int index, long value) { + + ensureIIsMutable(); + i_.setLong(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param value The i to add. + * @return This builder for chaining. + */ + public Builder addI(long value) { + + ensureIIsMutable(); + i_.addLong(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @param values The i to add. + * @return This builder for chaining. + */ + public Builder addAllI( + java.lang.Iterable values) { + ensureIIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, i_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * "list(int)"
    +       * 
    + * + * repeated int64 i = 3 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearI() { + i_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList f_ = emptyFloatList(); + private void ensureFIsMutable() { + if (!f_.isModifiable()) { + f_ = makeMutableCopy(f_); + } + bitField0_ |= 0x00000004; + } + private void ensureFIsMutable(int capacity) { + if (!f_.isModifiable()) { + f_ = makeMutableCopy(f_, capacity); + } + bitField0_ |= 0x00000004; + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @return A list containing the f. + */ + public java.util.List + getFList() { + f_.makeImmutable(); + return f_; + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @return The count of f. + */ + public int getFCount() { + return f_.size(); + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @param index The index of the element to return. + * @return The f at the given index. + */ + public float getF(int index) { + return f_.getFloat(index); + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @param index The index to set the value at. + * @param value The f to set. + * @return This builder for chaining. + */ + public Builder setF( + int index, float value) { + + ensureFIsMutable(); + f_.setFloat(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @param value The f to add. + * @return This builder for chaining. + */ + public Builder addF(float value) { + + ensureFIsMutable(); + f_.addFloat(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @param values The f to add. + * @return This builder for chaining. + */ + public Builder addAllF( + java.lang.Iterable values) { + ensureFIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, f_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * "list(float)"
    +       * 
    + * + * repeated float f = 4 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearF() { + f_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.BooleanList b_ = emptyBooleanList(); + private void ensureBIsMutable() { + if (!b_.isModifiable()) { + b_ = makeMutableCopy(b_); + } + bitField0_ |= 0x00000008; + } + private void ensureBIsMutable(int capacity) { + if (!b_.isModifiable()) { + b_ = makeMutableCopy(b_, capacity); + } + bitField0_ |= 0x00000008; + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @return A list containing the b. + */ + public java.util.List + getBList() { + b_.makeImmutable(); + return b_; + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @return The count of b. + */ + public int getBCount() { + return b_.size(); + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @param index The index of the element to return. + * @return The b at the given index. + */ + public boolean getB(int index) { + return b_.getBoolean(index); + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @param index The index to set the value at. + * @param value The b to set. + * @return This builder for chaining. + */ + public Builder setB( + int index, boolean value) { + + ensureBIsMutable(); + b_.setBoolean(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @param value The b to add. + * @return This builder for chaining. + */ + public Builder addB(boolean value) { + + ensureBIsMutable(); + b_.addBoolean(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @param values The b to add. + * @return This builder for chaining. + */ + public Builder addAllB( + java.lang.Iterable values) { + ensureBIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, b_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * "list(bool)"
    +       * 
    + * + * repeated bool b = 5 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearB() { + b_ = emptyBooleanList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList type_ = + emptyIntList(); + private void ensureTypeIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + type_ = makeMutableCopy(type_); + bitField0_ |= 0x00000010; + } + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the type. + */ + public java.util.List getTypeList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(type_, type_converter_); + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return The count of type. + */ + public int getTypeCount() { + return type_.size(); + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the element to return. + * @return The type at the given index. + */ + public org.tensorflow.proto.DataType getType(int index) { + return type_converter_.convert(type_.getInt(index)); + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index to set the value at. + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + int index, org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeIsMutable(); + type_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param value The type to add. + * @return This builder for chaining. + */ + public Builder addType(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypeIsMutable(); + type_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param values The type to add. + * @return This builder for chaining. + */ + public Builder addAllType( + java.lang.Iterable values) { + ensureTypeIsMutable(); + for (org.tensorflow.proto.DataType value : values) { + type_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @return A list containing the enum numeric values on the wire for type. + */ + public java.util.List + getTypeValueList() { + return java.util.Collections.unmodifiableList(type_); + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of type at the given index. + */ + public int getTypeValue(int index) { + return type_.getInt(index); + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue( + int index, int value) { + ensureTypeIsMutable(); + type_.setInt(index, value); + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param value The enum numeric value on the wire for type to add. + * @return This builder for chaining. + */ + public Builder addTypeValue(int value) { + ensureTypeIsMutable(); + type_.addInt(value); + onChanged(); + return this; + } + /** + *
    +       * "list(type)"
    +       * 
    + * + * repeated .tensorflow.DataType type = 6 [packed = true]; + * @param values The enum numeric values on the wire for type to add. + * @return This builder for chaining. + */ + public Builder addAllTypeValue( + java.lang.Iterable values) { + ensureTypeIsMutable(); + for (int value : values) { + type_.addInt(value); + } + onChanged(); + return this; + } + + private java.util.List shape_ = + java.util.Collections.emptyList(); + private void ensureShapeIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + shape_ = new java.util.ArrayList(shape_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public java.util.List getShapeList() { + if (shapeBuilder_ == null) { + return java.util.Collections.unmodifiableList(shape_); + } else { + return shapeBuilder_.getMessageList(); + } + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public int getShapeCount() { + if (shapeBuilder_ == null) { + return shape_.size(); + } else { + return shapeBuilder_.getCount(); + } + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProto getShape(int index) { + if (shapeBuilder_ == null) { + return shape_.get(index); + } else { + return shapeBuilder_.getMessage(index); + } + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder setShape( + int index, org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeIsMutable(); + shape_.set(index, value); + onChanged(); + } else { + shapeBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder setShape( + int index, org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + shape_.set(index, builderForValue.build()); + onChanged(); + } else { + shapeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder addShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeIsMutable(); + shape_.add(value); + onChanged(); + } else { + shapeBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder addShape( + int index, org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeIsMutable(); + shape_.add(index, value); + onChanged(); + } else { + shapeBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder addShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + shape_.add(builderForValue.build()); + onChanged(); + } else { + shapeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder addShape( + int index, org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + shape_.add(index, builderForValue.build()); + onChanged(); + } else { + shapeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder addAllShape( + java.lang.Iterable values) { + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, shape_); + onChanged(); + } else { + shapeBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder clearShape() { + if (shapeBuilder_ == null) { + shape_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + shapeBuilder_.clear(); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public Builder removeShape(int index) { + if (shapeBuilder_ == null) { + ensureShapeIsMutable(); + shape_.remove(index); + onChanged(); + } else { + shapeBuilder_.remove(index); + } + return this; + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder( + int index) { + return getShapeFieldBuilder().getBuilder(index); + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder( + int index) { + if (shapeBuilder_ == null) { + return shape_.get(index); } else { + return shapeBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public java.util.List + getShapeOrBuilderList() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shape_); + } + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProto.Builder addShapeBuilder() { + return getShapeFieldBuilder().addBuilder( + org.tensorflow.proto.TensorShapeProto.getDefaultInstance()); + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProto.Builder addShapeBuilder( + int index) { + return getShapeFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorShapeProto.getDefaultInstance()); + } + /** + *
    +       * "list(shape)"
    +       * 
    + * + * repeated .tensorflow.TensorShapeProto shape = 7; + */ + public java.util.List + getShapeBuilderList() { + return getShapeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + shape_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private java.util.List tensor_ = + java.util.Collections.emptyList(); + private void ensureTensorIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + tensor_ = new java.util.ArrayList(tensor_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorBuilder_; + + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public java.util.List getTensorList() { + if (tensorBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensor_); + } else { + return tensorBuilder_.getMessageList(); + } + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public int getTensorCount() { + if (tensorBuilder_ == null) { + return tensor_.size(); + } else { + return tensorBuilder_.getCount(); + } + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProto getTensor(int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); + } else { + return tensorBuilder_.getMessage(index); + } + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder setTensor( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.set(index, value); + onChanged(); + } else { + tensorBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder setTensor( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder addTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(value); + onChanged(); + } else { + tensorBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder addTensor( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(index, value); + onChanged(); + } else { + tensorBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder addTensor( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder addTensor( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder addAllTensor( + java.lang.Iterable values) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensor_); + onChanged(); + } else { + tensorBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder clearTensor() { + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + tensorBuilder_.clear(); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public Builder removeTensor(int index) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.remove(index); + onChanged(); + } else { + tensorBuilder_.remove(index); + } + return this; + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorBuilder( + int index) { + return getTensorFieldBuilder().getBuilder(index); + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); } else { + return tensorBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public java.util.List + getTensorOrBuilderList() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensor_); + } + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorBuilder() { + return getTensorFieldBuilder().addBuilder( + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorBuilder( + int index) { + return getTensorFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +       * "list(tensor)"
    +       * 
    + * + * repeated .tensorflow.TensorProto tensor = 8; + */ + public java.util.List + getTensorBuilderList() { + return getTensorFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + tensor_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + private java.util.List func_ = + java.util.Collections.emptyList(); + private void ensureFuncIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + func_ = new java.util.ArrayList(func_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder> funcBuilder_; + + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public java.util.List getFuncList() { + if (funcBuilder_ == null) { + return java.util.Collections.unmodifiableList(func_); + } else { + return funcBuilder_.getMessageList(); + } + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public int getFuncCount() { + if (funcBuilder_ == null) { + return func_.size(); + } else { + return funcBuilder_.getCount(); + } + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public org.tensorflow.proto.NameAttrList getFunc(int index) { + if (funcBuilder_ == null) { + return func_.get(index); + } else { + return funcBuilder_.getMessage(index); + } + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder setFunc( + int index, org.tensorflow.proto.NameAttrList value) { + if (funcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFuncIsMutable(); + func_.set(index, value); + onChanged(); + } else { + funcBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder setFunc( + int index, org.tensorflow.proto.NameAttrList.Builder builderForValue) { + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + func_.set(index, builderForValue.build()); + onChanged(); + } else { + funcBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder addFunc(org.tensorflow.proto.NameAttrList value) { + if (funcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFuncIsMutable(); + func_.add(value); + onChanged(); + } else { + funcBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder addFunc( + int index, org.tensorflow.proto.NameAttrList value) { + if (funcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFuncIsMutable(); + func_.add(index, value); + onChanged(); + } else { + funcBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder addFunc( + org.tensorflow.proto.NameAttrList.Builder builderForValue) { + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + func_.add(builderForValue.build()); + onChanged(); + } else { + funcBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder addFunc( + int index, org.tensorflow.proto.NameAttrList.Builder builderForValue) { + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + func_.add(index, builderForValue.build()); + onChanged(); + } else { + funcBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder addAllFunc( + java.lang.Iterable values) { + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, func_); + onChanged(); + } else { + funcBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder clearFunc() { + if (funcBuilder_ == null) { + func_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + funcBuilder_.clear(); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public Builder removeFunc(int index) { + if (funcBuilder_ == null) { + ensureFuncIsMutable(); + func_.remove(index); + onChanged(); + } else { + funcBuilder_.remove(index); + } + return this; + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public org.tensorflow.proto.NameAttrList.Builder getFuncBuilder( + int index) { + return getFuncFieldBuilder().getBuilder(index); + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder( + int index) { + if (funcBuilder_ == null) { + return func_.get(index); } else { + return funcBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public java.util.List + getFuncOrBuilderList() { + if (funcBuilder_ != null) { + return funcBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(func_); + } + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public org.tensorflow.proto.NameAttrList.Builder addFuncBuilder() { + return getFuncFieldBuilder().addBuilder( + org.tensorflow.proto.NameAttrList.getDefaultInstance()); + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public org.tensorflow.proto.NameAttrList.Builder addFuncBuilder( + int index) { + return getFuncFieldBuilder().addBuilder( + index, org.tensorflow.proto.NameAttrList.getDefaultInstance()); + } + /** + *
    +       * "list(attr)"
    +       * 
    + * + * repeated .tensorflow.NameAttrList func = 9; + */ + public java.util.List + getFuncBuilderList() { + return getFuncFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder> + getFuncFieldBuilder() { + if (funcBuilder_ == null) { + funcBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder>( + func_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + func_ = null; + } + return funcBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue.ListValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AttrValue.ListValue) + private static final org.tensorflow.proto.AttrValue.ListValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AttrValue.ListValue(); + } + + public static org.tensorflow.proto.AttrValue.ListValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AttrValue.ListValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int valueCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + S(2), + I(3), + F(4), + B(5), + TYPE(6), + SHAPE(7), + TENSOR(8), + LIST(1), + FUNC(10), + PLACEHOLDER(9), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 2: return S; + case 3: return I; + case 4: return F; + case 5: return B; + case 6: return TYPE; + case 7: return SHAPE; + case 8: return TENSOR; + case 1: return LIST; + case 10: return FUNC; + case 9: return PLACEHOLDER; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int S_FIELD_NUMBER = 2; + /** + *
    +   * "string"
    +   * 
    + * + * bytes s = 2; + * @return Whether the s field is set. + */ + @java.lang.Override + public boolean hasS() { + return valueCase_ == 2; + } + /** + *
    +   * "string"
    +   * 
    + * + * bytes s = 2; + * @return The s. + */ + @java.lang.Override + public com.google.protobuf.ByteString getS() { + if (valueCase_ == 2) { + return (com.google.protobuf.ByteString) value_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int I_FIELD_NUMBER = 3; + /** + *
    +   * "int"
    +   * 
    + * + * int64 i = 3; + * @return Whether the i field is set. + */ + @java.lang.Override + public boolean hasI() { + return valueCase_ == 3; + } + /** + *
    +   * "int"
    +   * 
    + * + * int64 i = 3; + * @return The i. + */ + @java.lang.Override + public long getI() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + + public static final int F_FIELD_NUMBER = 4; + /** + *
    +   * "float"
    +   * 
    + * + * float f = 4; + * @return Whether the f field is set. + */ + @java.lang.Override + public boolean hasF() { + return valueCase_ == 4; + } + /** + *
    +   * "float"
    +   * 
    + * + * float f = 4; + * @return The f. + */ + @java.lang.Override + public float getF() { + if (valueCase_ == 4) { + return (java.lang.Float) value_; + } + return 0F; + } + + public static final int B_FIELD_NUMBER = 5; + /** + *
    +   * "bool"
    +   * 
    + * + * bool b = 5; + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return valueCase_ == 5; + } + /** + *
    +   * "bool"
    +   * 
    + * + * bool b = 5; + * @return The b. + */ + @java.lang.Override + public boolean getB() { + if (valueCase_ == 5) { + return (java.lang.Boolean) value_; + } + return false; + } + + public static final int TYPE_FIELD_NUMBER = 6; + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return Whether the type field is set. + */ + public boolean hasType() { + return valueCase_ == 6; + } + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return The enum numeric value on the wire for type. + */ + public int getTypeValue() { + if (valueCase_ == 6) { + return (java.lang.Integer) value_; + } + return 0; + } + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return The type. + */ + public org.tensorflow.proto.DataType getType() { + if (valueCase_ == 6) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber( + (java.lang.Integer) value_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + return org.tensorflow.proto.DataType.DT_INVALID; + } + + public static final int SHAPE_FIELD_NUMBER = 7; + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return valueCase_ == 7; + } + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + if (valueCase_ == 7) { + return (org.tensorflow.proto.TensorShapeProto) value_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (valueCase_ == 7) { + return (org.tensorflow.proto.TensorShapeProto) value_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + + public static final int TENSOR_FIELD_NUMBER = 8; + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return Whether the tensor field is set. + */ + @java.lang.Override + public boolean hasTensor() { + return valueCase_ == 8; + } + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return The tensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensor() { + if (valueCase_ == 8) { + return (org.tensorflow.proto.TensorProto) value_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder() { + if (valueCase_ == 8) { + return (org.tensorflow.proto.TensorProto) value_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + + public static final int LIST_FIELD_NUMBER = 1; + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return Whether the list field is set. + */ + @java.lang.Override + public boolean hasList() { + return valueCase_ == 1; + } + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return The list. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValue getList() { + if (valueCase_ == 1) { + return (org.tensorflow.proto.AttrValue.ListValue) value_; + } + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValueOrBuilder getListOrBuilder() { + if (valueCase_ == 1) { + return (org.tensorflow.proto.AttrValue.ListValue) value_; + } + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + + public static final int FUNC_FIELD_NUMBER = 10; + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return Whether the func field is set. + */ + @java.lang.Override + public boolean hasFunc() { + return valueCase_ == 10; + } + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return The func. + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrList getFunc() { + if (valueCase_ == 10) { + return (org.tensorflow.proto.NameAttrList) value_; + } + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder() { + if (valueCase_ == 10) { + return (org.tensorflow.proto.NameAttrList) value_; + } + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + + public static final int PLACEHOLDER_FIELD_NUMBER = 9; + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return Whether the placeholder field is set. + */ + public boolean hasPlaceholder() { + return valueCase_ == 9; + } + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return The placeholder. + */ + public java.lang.String getPlaceholder() { + java.lang.Object ref = ""; + if (valueCase_ == 9) { + ref = value_; + } + 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(); + if (valueCase_ == 9) { + value_ = s; + } + return s; + } + } + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return The bytes for placeholder. + */ + public com.google.protobuf.ByteString + getPlaceholderBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 9) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 9) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (valueCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.AttrValue.ListValue) value_); + } + if (valueCase_ == 2) { + output.writeBytes( + 2, (com.google.protobuf.ByteString) value_); + } + if (valueCase_ == 3) { + output.writeInt64( + 3, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 4) { + output.writeFloat( + 4, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 5) { + output.writeBool( + 5, (boolean)((java.lang.Boolean) value_)); + } + if (valueCase_ == 6) { + output.writeEnum(6, ((java.lang.Integer) value_)); + } + if (valueCase_ == 7) { + output.writeMessage(7, (org.tensorflow.proto.TensorShapeProto) value_); + } + if (valueCase_ == 8) { + output.writeMessage(8, (org.tensorflow.proto.TensorProto) value_); + } + if (valueCase_ == 9) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, value_); + } + if (valueCase_ == 10) { + output.writeMessage(10, (org.tensorflow.proto.NameAttrList) value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.AttrValue.ListValue) value_); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 2, (com.google.protobuf.ByteString) value_); + } + if (valueCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 3, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize( + 4, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 5, (boolean)((java.lang.Boolean) value_)); + } + if (valueCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, ((java.lang.Integer) value_)); + } + if (valueCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (org.tensorflow.proto.TensorShapeProto) value_); + } + if (valueCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (org.tensorflow.proto.TensorProto) value_); + } + if (valueCase_ == 9) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, value_); + } + if (valueCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (org.tensorflow.proto.NameAttrList) value_); + } + size += getUnknownFields().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.AttrValue)) { + return super.equals(obj); + } + org.tensorflow.proto.AttrValue other = (org.tensorflow.proto.AttrValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 2: + if (!getS() + .equals(other.getS())) return false; + break; + case 3: + if (getI() + != other.getI()) return false; + break; + case 4: + if (java.lang.Float.floatToIntBits(getF()) + != java.lang.Float.floatToIntBits( + other.getF())) return false; + break; + case 5: + if (getB() + != other.getB()) return false; + break; + case 6: + if (getTypeValue() + != other.getTypeValue()) return false; + break; + case 7: + if (!getShape() + .equals(other.getShape())) return false; + break; + case 8: + if (!getTensor() + .equals(other.getTensor())) return false; + break; + case 1: + if (!getList() + .equals(other.getList())) return false; + break; + case 10: + if (!getFunc() + .equals(other.getFunc())) return false; + break; + case 9: + if (!getPlaceholder() + .equals(other.getPlaceholder())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueCase_) { + case 2: + hash = (37 * hash) + S_FIELD_NUMBER; + hash = (53 * hash) + getS().hashCode(); + break; + case 3: + hash = (37 * hash) + I_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getI()); + break; + case 4: + hash = (37 * hash) + F_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getF()); + break; + case 5: + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getB()); + break; + case 6: + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTypeValue(); + break; + case 7: + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + break; + case 8: + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensor().hashCode(); + break; + case 1: + hash = (37 * hash) + LIST_FIELD_NUMBER; + hash = (53 * hash) + getList().hashCode(); + break; + case 10: + hash = (37 * hash) + FUNC_FIELD_NUMBER; + hash = (53 * hash) + getFunc().hashCode(); + break; + case 9: + hash = (37 * hash) + PLACEHOLDER_FIELD_NUMBER; + hash = (53 * hash) + getPlaceholder().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AttrValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue 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.AttrValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue 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.AttrValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AttrValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AttrValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AttrValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AttrValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AttrValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AttrValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AttrValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AttrValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing the value for an attr used to configure an Op.
    +   * Comment indicates the corresponding attr type.  Only the field matching the
    +   * attr type may be filled.
    +   * 
    + * + * Protobuf type {@code tensorflow.AttrValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue) + org.tensorflow.proto.AttrValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AttrValue.class, org.tensorflow.proto.AttrValue.Builder.class); + } + + // Construct using org.tensorflow.proto.AttrValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (shapeBuilder_ != null) { + shapeBuilder_.clear(); + } + if (tensorBuilder_ != null) { + tensorBuilder_.clear(); + } + if (listBuilder_ != null) { + listBuilder_.clear(); + } + if (funcBuilder_ != null) { + funcBuilder_.clear(); + } + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue getDefaultInstanceForType() { + return org.tensorflow.proto.AttrValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue build() { + org.tensorflow.proto.AttrValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AttrValue buildPartial() { + org.tensorflow.proto.AttrValue result = new org.tensorflow.proto.AttrValue(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AttrValue result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.AttrValue result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + if (valueCase_ == 7 && + shapeBuilder_ != null) { + result.value_ = shapeBuilder_.build(); + } + if (valueCase_ == 8 && + tensorBuilder_ != null) { + result.value_ = tensorBuilder_.build(); + } + if (valueCase_ == 1 && + listBuilder_ != null) { + result.value_ = listBuilder_.build(); + } + if (valueCase_ == 10 && + funcBuilder_ != null) { + result.value_ = funcBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AttrValue) { + return mergeFrom((org.tensorflow.proto.AttrValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AttrValue other) { + if (other == org.tensorflow.proto.AttrValue.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case S: { + setS(other.getS()); + break; + } + case I: { + setI(other.getI()); + break; + } + case F: { + setF(other.getF()); + break; + } + case B: { + setB(other.getB()); + break; + } + case TYPE: { + setTypeValue(other.getTypeValue()); + break; + } + case SHAPE: { + mergeShape(other.getShape()); + break; + } + case TENSOR: { + mergeTensor(other.getTensor()); + break; + } + case LIST: { + mergeList(other.getList()); + break; + } + case FUNC: { + mergeFunc(other.getFunc()); + break; + } + case PLACEHOLDER: { + valueCase_ = 9; + value_ = other.value_; + onChanged(); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getListFieldBuilder().getBuilder(), + extensionRegistry); + valueCase_ = 1; + break; + } // case 10 + case 18: { + value_ = input.readBytes(); + valueCase_ = 2; + break; + } // case 18 + case 24: { + value_ = input.readInt64(); + valueCase_ = 3; + break; + } // case 24 + case 37: { + value_ = input.readFloat(); + valueCase_ = 4; + break; + } // case 37 + case 40: { + value_ = input.readBool(); + valueCase_ = 5; + break; + } // case 40 + case 48: { + int rawValue = input.readEnum(); + valueCase_ = 6; + value_ = rawValue; + break; + } // case 48 + case 58: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + valueCase_ = 7; + break; + } // case 58 + case 66: { + input.readMessage( + getTensorFieldBuilder().getBuilder(), + extensionRegistry); + valueCase_ = 8; + break; + } // case 66 + case 74: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 9; + value_ = s; + break; + } // case 74 + case 82: { + input.readMessage( + getFuncFieldBuilder().getBuilder(), + extensionRegistry); + valueCase_ = 10; + break; + } // case 82 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + *
    +     * "string"
    +     * 
    + * + * bytes s = 2; + * @return Whether the s field is set. + */ + public boolean hasS() { + return valueCase_ == 2; + } + /** + *
    +     * "string"
    +     * 
    + * + * bytes s = 2; + * @return The s. + */ + public com.google.protobuf.ByteString getS() { + if (valueCase_ == 2) { + return (com.google.protobuf.ByteString) value_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
    +     * "string"
    +     * 
    + * + * bytes s = 2; + * @param value The s to set. + * @return This builder for chaining. + */ + public Builder setS(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * "string"
    +     * 
    + * + * bytes s = 2; + * @return This builder for chaining. + */ + public Builder clearS() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + *
    +     * "int"
    +     * 
    + * + * int64 i = 3; + * @return Whether the i field is set. + */ + public boolean hasI() { + return valueCase_ == 3; + } + /** + *
    +     * "int"
    +     * 
    + * + * int64 i = 3; + * @return The i. + */ + public long getI() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + *
    +     * "int"
    +     * 
    + * + * int64 i = 3; + * @param value The i to set. + * @return This builder for chaining. + */ + public Builder setI(long value) { + + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * "int"
    +     * 
    + * + * int64 i = 3; + * @return This builder for chaining. + */ + public Builder clearI() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + *
    +     * "float"
    +     * 
    + * + * float f = 4; + * @return Whether the f field is set. + */ + public boolean hasF() { + return valueCase_ == 4; + } + /** + *
    +     * "float"
    +     * 
    + * + * float f = 4; + * @return The f. + */ + public float getF() { + if (valueCase_ == 4) { + return (java.lang.Float) value_; + } + return 0F; + } + /** + *
    +     * "float"
    +     * 
    + * + * float f = 4; + * @param value The f to set. + * @return This builder for chaining. + */ + public Builder setF(float value) { + + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * "float"
    +     * 
    + * + * float f = 4; + * @return This builder for chaining. + */ + public Builder clearF() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + *
    +     * "bool"
    +     * 
    + * + * bool b = 5; + * @return Whether the b field is set. + */ + public boolean hasB() { + return valueCase_ == 5; + } + /** + *
    +     * "bool"
    +     * 
    + * + * bool b = 5; + * @return The b. + */ + public boolean getB() { + if (valueCase_ == 5) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + *
    +     * "bool"
    +     * 
    + * + * bool b = 5; + * @param value The b to set. + * @return This builder for chaining. + */ + public Builder setB(boolean value) { + + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * "bool"
    +     * 
    + * + * bool b = 5; + * @return This builder for chaining. + */ + public Builder clearB() { + if (valueCase_ == 5) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return valueCase_ == 6; + } + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + if (valueCase_ == 6) { + return ((java.lang.Integer) value_).intValue(); + } + return 0; + } + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + valueCase_ = 6; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @return The type. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getType() { + if (valueCase_ == 6) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber( + (java.lang.Integer) value_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + return org.tensorflow.proto.DataType.DT_INVALID; + } + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 6; + value_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * "type"
    +     * 
    + * + * .tensorflow.DataType type = 6; + * @return This builder for chaining. + */ + public Builder clearType() { + if (valueCase_ == 6) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return valueCase_ == 7; + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + if (valueCase_ == 7) { + return (org.tensorflow.proto.TensorShapeProto) value_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } else { + if (valueCase_ == 7) { + return shapeBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + shapeBuilder_.setMessage(value); + } + valueCase_ = 7; + return this; + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 7; + return this; + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (valueCase_ == 7 && + value_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + value_ = org.tensorflow.proto.TensorShapeProto.newBuilder((org.tensorflow.proto.TensorShapeProto) value_) + .mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 7) { + shapeBuilder_.mergeFrom(value); + } else { + shapeBuilder_.setMessage(value); + } + } + valueCase_ = 7; + return this; + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + public Builder clearShape() { + if (shapeBuilder_ == null) { + if (valueCase_ == 7) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 7) { + valueCase_ = 0; + value_ = null; + } + shapeBuilder_.clear(); + } + return this; + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + return getShapeFieldBuilder().getBuilder(); + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if ((valueCase_ == 7) && (shapeBuilder_ != null)) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 7) { + return (org.tensorflow.proto.TensorShapeProto) value_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + } + /** + *
    +     * "shape"
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + if (!(valueCase_ == 7)) { + value_ = org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + (org.tensorflow.proto.TensorShapeProto) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 7; + onChanged(); + return shapeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorBuilder_; + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return Whether the tensor field is set. + */ + @java.lang.Override + public boolean hasTensor() { + return valueCase_ == 8; + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return The tensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensor() { + if (tensorBuilder_ == null) { + if (valueCase_ == 8) { + return (org.tensorflow.proto.TensorProto) value_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } else { + if (valueCase_ == 8) { + return tensorBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + public Builder setTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + tensorBuilder_.setMessage(value); + } + valueCase_ = 8; + return this; + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + public Builder setTensor( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + tensorBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 8; + return this; + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + public Builder mergeTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (valueCase_ == 8 && + value_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + value_ = org.tensorflow.proto.TensorProto.newBuilder((org.tensorflow.proto.TensorProto) value_) + .mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 8) { + tensorBuilder_.mergeFrom(value); + } else { + tensorBuilder_.setMessage(value); + } + } + valueCase_ = 8; + return this; + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + public Builder clearTensor() { + if (tensorBuilder_ == null) { + if (valueCase_ == 8) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 8) { + valueCase_ = 0; + value_ = null; + } + tensorBuilder_.clear(); + } + return this; + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorBuilder() { + return getTensorFieldBuilder().getBuilder(); + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder() { + if ((valueCase_ == 8) && (tensorBuilder_ != null)) { + return tensorBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 8) { + return (org.tensorflow.proto.TensorProto) value_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +     * "tensor"
    +     * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + if (!(valueCase_ == 8)) { + value_ = org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + tensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + (org.tensorflow.proto.TensorProto) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 8; + onChanged(); + return tensorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue.ListValue, org.tensorflow.proto.AttrValue.ListValue.Builder, org.tensorflow.proto.AttrValue.ListValueOrBuilder> listBuilder_; + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return Whether the list field is set. + */ + @java.lang.Override + public boolean hasList() { + return valueCase_ == 1; + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return The list. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValue getList() { + if (listBuilder_ == null) { + if (valueCase_ == 1) { + return (org.tensorflow.proto.AttrValue.ListValue) value_; + } + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } else { + if (valueCase_ == 1) { + return listBuilder_.getMessage(); + } + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + public Builder setList(org.tensorflow.proto.AttrValue.ListValue value) { + if (listBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + listBuilder_.setMessage(value); + } + valueCase_ = 1; + return this; + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + public Builder setList( + org.tensorflow.proto.AttrValue.ListValue.Builder builderForValue) { + if (listBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + listBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 1; + return this; + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + public Builder mergeList(org.tensorflow.proto.AttrValue.ListValue value) { + if (listBuilder_ == null) { + if (valueCase_ == 1 && + value_ != org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance()) { + value_ = org.tensorflow.proto.AttrValue.ListValue.newBuilder((org.tensorflow.proto.AttrValue.ListValue) value_) + .mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 1) { + listBuilder_.mergeFrom(value); + } else { + listBuilder_.setMessage(value); + } + } + valueCase_ = 1; + return this; + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + public Builder clearList() { + if (listBuilder_ == null) { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + } + listBuilder_.clear(); + } + return this; + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + public org.tensorflow.proto.AttrValue.ListValue.Builder getListBuilder() { + return getListFieldBuilder().getBuilder(); + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue.ListValueOrBuilder getListOrBuilder() { + if ((valueCase_ == 1) && (listBuilder_ != null)) { + return listBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 1) { + return (org.tensorflow.proto.AttrValue.ListValue) value_; + } + return org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + } + /** + *
    +     * any "list(...)"
    +     * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue.ListValue, org.tensorflow.proto.AttrValue.ListValue.Builder, org.tensorflow.proto.AttrValue.ListValueOrBuilder> + getListFieldBuilder() { + if (listBuilder_ == null) { + if (!(valueCase_ == 1)) { + value_ = org.tensorflow.proto.AttrValue.ListValue.getDefaultInstance(); + } + listBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue.ListValue, org.tensorflow.proto.AttrValue.ListValue.Builder, org.tensorflow.proto.AttrValue.ListValueOrBuilder>( + (org.tensorflow.proto.AttrValue.ListValue) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 1; + onChanged(); + return listBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder> funcBuilder_; + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return Whether the func field is set. + */ + @java.lang.Override + public boolean hasFunc() { + return valueCase_ == 10; + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return The func. + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrList getFunc() { + if (funcBuilder_ == null) { + if (valueCase_ == 10) { + return (org.tensorflow.proto.NameAttrList) value_; + } + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } else { + if (valueCase_ == 10) { + return funcBuilder_.getMessage(); + } + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + public Builder setFunc(org.tensorflow.proto.NameAttrList value) { + if (funcBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + onChanged(); + } else { + funcBuilder_.setMessage(value); + } + valueCase_ = 10; + return this; + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + public Builder setFunc( + org.tensorflow.proto.NameAttrList.Builder builderForValue) { + if (funcBuilder_ == null) { + value_ = builderForValue.build(); + onChanged(); + } else { + funcBuilder_.setMessage(builderForValue.build()); + } + valueCase_ = 10; + return this; + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + public Builder mergeFunc(org.tensorflow.proto.NameAttrList value) { + if (funcBuilder_ == null) { + if (valueCase_ == 10 && + value_ != org.tensorflow.proto.NameAttrList.getDefaultInstance()) { + value_ = org.tensorflow.proto.NameAttrList.newBuilder((org.tensorflow.proto.NameAttrList) value_) + .mergeFrom(value).buildPartial(); + } else { + value_ = value; + } + onChanged(); + } else { + if (valueCase_ == 10) { + funcBuilder_.mergeFrom(value); + } else { + funcBuilder_.setMessage(value); + } + } + valueCase_ = 10; + return this; + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + public Builder clearFunc() { + if (funcBuilder_ == null) { + if (valueCase_ == 10) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + } else { + if (valueCase_ == 10) { + valueCase_ = 0; + value_ = null; + } + funcBuilder_.clear(); + } + return this; + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + public org.tensorflow.proto.NameAttrList.Builder getFuncBuilder() { + return getFuncFieldBuilder().getBuilder(); + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + @java.lang.Override + public org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder() { + if ((valueCase_ == 10) && (funcBuilder_ != null)) { + return funcBuilder_.getMessageOrBuilder(); + } else { + if (valueCase_ == 10) { + return (org.tensorflow.proto.NameAttrList) value_; + } + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + } + /** + *
    +     * "func" represents a function. func.name is a function's name or
    +     * a primitive op's name. func.attr.first is the name of an attr
    +     * defined for that function. func.attr.second is the value for
    +     * that attr in the instantiation.
    +     * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder> + getFuncFieldBuilder() { + if (funcBuilder_ == null) { + if (!(valueCase_ == 10)) { + value_ = org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + funcBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NameAttrList, org.tensorflow.proto.NameAttrList.Builder, org.tensorflow.proto.NameAttrListOrBuilder>( + (org.tensorflow.proto.NameAttrList) value_, + getParentForChildren(), + isClean()); + value_ = null; + } + valueCase_ = 10; + onChanged(); + return funcBuilder_; + } + + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @return Whether the placeholder field is set. + */ + @java.lang.Override + public boolean hasPlaceholder() { + return valueCase_ == 9; + } + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @return The placeholder. + */ + @java.lang.Override + public java.lang.String getPlaceholder() { + java.lang.Object ref = ""; + if (valueCase_ == 9) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 9) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @return The bytes for placeholder. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPlaceholderBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 9) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 9) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @param value The placeholder to set. + * @return This builder for chaining. + */ + public Builder setPlaceholder( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valueCase_ = 9; + value_ = value; + onChanged(); + return this; + } + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @return This builder for chaining. + */ + public Builder clearPlaceholder() { + if (valueCase_ == 9) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + *
    +     * This is a placeholder only used in nodes defined inside a
    +     * function.  It indicates the attr value will be supplied when
    +     * the function is instantiated.  For example, let us suppose a
    +     * node "N" in function "FN". "N" has an attr "A" with value
    +     * placeholder = "foo". When FN is instantiated with attr "foo"
    +     * set to "bar", the instantiated node N's attr A will have been
    +     * given the value "bar".
    +     * 
    + * + * string placeholder = 9; + * @param value The bytes for placeholder to set. + * @return This builder for chaining. + */ + public Builder setPlaceholderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valueCase_ = 9; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AttrValue) + private static final org.tensorflow.proto.AttrValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AttrValue(); + } + + public static org.tensorflow.proto.AttrValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttrValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AttrValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueOrBuilder.java new file mode 100644 index 00000000000..88837631bad --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueOrBuilder.java @@ -0,0 +1,281 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/attr_value.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface AttrValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * "string"
    +   * 
    + * + * bytes s = 2; + * @return Whether the s field is set. + */ + boolean hasS(); + /** + *
    +   * "string"
    +   * 
    + * + * bytes s = 2; + * @return The s. + */ + com.google.protobuf.ByteString getS(); + + /** + *
    +   * "int"
    +   * 
    + * + * int64 i = 3; + * @return Whether the i field is set. + */ + boolean hasI(); + /** + *
    +   * "int"
    +   * 
    + * + * int64 i = 3; + * @return The i. + */ + long getI(); + + /** + *
    +   * "float"
    +   * 
    + * + * float f = 4; + * @return Whether the f field is set. + */ + boolean hasF(); + /** + *
    +   * "float"
    +   * 
    + * + * float f = 4; + * @return The f. + */ + float getF(); + + /** + *
    +   * "bool"
    +   * 
    + * + * bool b = 5; + * @return Whether the b field is set. + */ + boolean hasB(); + /** + *
    +   * "bool"
    +   * 
    + * + * bool b = 5; + * @return The b. + */ + boolean getB(); + + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return Whether the type field is set. + */ + boolean hasType(); + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + *
    +   * "type"
    +   * 
    + * + * .tensorflow.DataType type = 6; + * @return The type. + */ + org.tensorflow.proto.DataType getType(); + + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + *
    +   * "shape"
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 7; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return Whether the tensor field is set. + */ + boolean hasTensor(); + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + * @return The tensor. + */ + org.tensorflow.proto.TensorProto getTensor(); + /** + *
    +   * "tensor"
    +   * 
    + * + * .tensorflow.TensorProto tensor = 8; + */ + org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder(); + + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return Whether the list field is set. + */ + boolean hasList(); + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + * @return The list. + */ + org.tensorflow.proto.AttrValue.ListValue getList(); + /** + *
    +   * any "list(...)"
    +   * 
    + * + * .tensorflow.AttrValue.ListValue list = 1; + */ + org.tensorflow.proto.AttrValue.ListValueOrBuilder getListOrBuilder(); + + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return Whether the func field is set. + */ + boolean hasFunc(); + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + * @return The func. + */ + org.tensorflow.proto.NameAttrList getFunc(); + /** + *
    +   * "func" represents a function. func.name is a function's name or
    +   * a primitive op's name. func.attr.first is the name of an attr
    +   * defined for that function. func.attr.second is the value for
    +   * that attr in the instantiation.
    +   * 
    + * + * .tensorflow.NameAttrList func = 10; + */ + org.tensorflow.proto.NameAttrListOrBuilder getFuncOrBuilder(); + + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return Whether the placeholder field is set. + */ + boolean hasPlaceholder(); + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return The placeholder. + */ + java.lang.String getPlaceholder(); + /** + *
    +   * This is a placeholder only used in nodes defined inside a
    +   * function.  It indicates the attr value will be supplied when
    +   * the function is instantiated.  For example, let us suppose a
    +   * node "N" in function "FN". "N" has an attr "A" with value
    +   * placeholder = "foo". When FN is instantiated with attr "foo"
    +   * set to "bar", the instantiated node N's attr A will have been
    +   * given the value "bar".
    +   * 
    + * + * string placeholder = 9; + * @return The bytes for placeholder. + */ + com.google.protobuf.ByteString + getPlaceholderBytes(); + + org.tensorflow.proto.AttrValue.ValueCase getValueCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueProtos.java new file mode 100644 index 00000000000..e37ba3edf83 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AttrValueProtos.java @@ -0,0 +1,122 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/attr_value.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class AttrValueProtos { + private AttrValueProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AttrValueProtos.class.getName()); + } + 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_AttrValue_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_AttrValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_AttrValue_ListValue_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NameAttrList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NameAttrList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NameAttrList_AttrEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NameAttrList_AttrEntry_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/framework/attr_value.p" + + "roto\022\ntensorflow\032&tensorflow/core/framew" + + "ork/tensor.proto\032,tensorflow/core/framew" + + "ork/tensor_shape.proto\032%tensorflow/core/" + + "framework/types.proto\"\246\004\n\tAttrValue\022\013\n\001s" + + "\030\002 \001(\014H\000\022\013\n\001i\030\003 \001(\003H\000\022\013\n\001f\030\004 \001(\002H\000\022\013\n\001b\030" + + "\005 \001(\010H\000\022$\n\004type\030\006 \001(\0162\024.tensorflow.DataT" + + "ypeH\000\022-\n\005shape\030\007 \001(\0132\034.tensorflow.Tensor" + + "ShapeProtoH\000\022)\n\006tensor\030\010 \001(\0132\027.tensorflo" + + "w.TensorProtoH\000\022/\n\004list\030\001 \001(\0132\037.tensorfl" + + "ow.AttrValue.ListValueH\000\022(\n\004func\030\n \001(\0132\030" + + ".tensorflow.NameAttrListH\000\022\025\n\013placeholde" + + "r\030\t \001(\tH\000\032\351\001\n\tListValue\022\t\n\001s\030\002 \003(\014\022\r\n\001i\030" + + "\003 \003(\003B\002\020\001\022\r\n\001f\030\004 \003(\002B\002\020\001\022\r\n\001b\030\005 \003(\010B\002\020\001\022" + + "&\n\004type\030\006 \003(\0162\024.tensorflow.DataTypeB\002\020\001\022" + + "+\n\005shape\030\007 \003(\0132\034.tensorflow.TensorShapeP" + + "roto\022\'\n\006tensor\030\010 \003(\0132\027.tensorflow.Tensor" + + "Proto\022&\n\004func\030\t \003(\0132\030.tensorflow.NameAtt" + + "rListB\007\n\005value\"\222\001\n\014NameAttrList\022\014\n\004name\030" + + "\001 \001(\t\0220\n\004attr\030\002 \003(\0132\".tensorflow.NameAtt" + + "rList.AttrEntry\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(" + + "\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.AttrValue:" + + "\0028\001B\177\n\024org.tensorflow.protoB\017AttrValuePr" + + "otosP\001ZQgithub.com/tensorflow/tensorflow" + + "/tensorflow/go/core/framework/attr_value" + + "_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_AttrValue_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_AttrValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_AttrValue_descriptor, + new java.lang.String[] { "S", "I", "F", "B", "Type", "Shape", "Tensor", "List", "Func", "Placeholder", "Value", }); + internal_static_tensorflow_AttrValue_ListValue_descriptor = + internal_static_tensorflow_AttrValue_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_AttrValue_ListValue_descriptor, + new java.lang.String[] { "S", "I", "F", "B", "Type", "Shape", "Tensor", "Func", }); + internal_static_tensorflow_NameAttrList_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_NameAttrList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NameAttrList_descriptor, + new java.lang.String[] { "Name", "Attr", }); + internal_static_tensorflow_NameAttrList_AttrEntry_descriptor = + internal_static_tensorflow_NameAttrList_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_NameAttrList_AttrEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptions.java new file mode 100644 index 00000000000..9c98cce7b81 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptions.java @@ -0,0 +1,498 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.AutoParallelOptions} + */ +public final class AutoParallelOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AutoParallelOptions) + AutoParallelOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AutoParallelOptions.class.getName()); + } + // Use AutoParallelOptions.newBuilder() to construct. + private AutoParallelOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AutoParallelOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AutoParallelOptions.class, org.tensorflow.proto.AutoParallelOptions.Builder.class); + } + + public static final int ENABLE_FIELD_NUMBER = 1; + private boolean enable_ = false; + /** + * bool enable = 1; + * @return The enable. + */ + @java.lang.Override + public boolean getEnable() { + return enable_; + } + + public static final int NUM_REPLICAS_FIELD_NUMBER = 2; + private int numReplicas_ = 0; + /** + * int32 num_replicas = 2; + * @return The numReplicas. + */ + @java.lang.Override + public int getNumReplicas() { + return numReplicas_; + } + + 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 (enable_ != false) { + output.writeBool(1, enable_); + } + if (numReplicas_ != 0) { + output.writeInt32(2, numReplicas_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enable_); + } + if (numReplicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, numReplicas_); + } + size += getUnknownFields().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.AutoParallelOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.AutoParallelOptions other = (org.tensorflow.proto.AutoParallelOptions) obj; + + if (getEnable() + != other.getEnable()) return false; + if (getNumReplicas() + != other.getNumReplicas()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ENABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnable()); + hash = (37 * hash) + NUM_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getNumReplicas(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AutoParallelOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AutoParallelOptions 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.AutoParallelOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AutoParallelOptions 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.AutoParallelOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AutoParallelOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AutoParallelOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AutoParallelOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AutoParallelOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AutoParallelOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AutoParallelOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AutoParallelOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AutoParallelOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.AutoParallelOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AutoParallelOptions) + org.tensorflow.proto.AutoParallelOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AutoParallelOptions.class, org.tensorflow.proto.AutoParallelOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.AutoParallelOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enable_ = false; + numReplicas_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_AutoParallelOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AutoParallelOptions getDefaultInstanceForType() { + return org.tensorflow.proto.AutoParallelOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AutoParallelOptions build() { + org.tensorflow.proto.AutoParallelOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AutoParallelOptions buildPartial() { + org.tensorflow.proto.AutoParallelOptions result = new org.tensorflow.proto.AutoParallelOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AutoParallelOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enable_ = enable_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numReplicas_ = numReplicas_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AutoParallelOptions) { + return mergeFrom((org.tensorflow.proto.AutoParallelOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AutoParallelOptions other) { + if (other == org.tensorflow.proto.AutoParallelOptions.getDefaultInstance()) return this; + if (other.getEnable() != false) { + setEnable(other.getEnable()); + } + if (other.getNumReplicas() != 0) { + setNumReplicas(other.getNumReplicas()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + enable_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + numReplicas_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean enable_ ; + /** + * bool enable = 1; + * @return The enable. + */ + @java.lang.Override + public boolean getEnable() { + return enable_; + } + /** + * bool enable = 1; + * @param value The enable to set. + * @return This builder for chaining. + */ + public Builder setEnable(boolean value) { + + enable_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool enable = 1; + * @return This builder for chaining. + */ + public Builder clearEnable() { + bitField0_ = (bitField0_ & ~0x00000001); + enable_ = false; + onChanged(); + return this; + } + + private int numReplicas_ ; + /** + * int32 num_replicas = 2; + * @return The numReplicas. + */ + @java.lang.Override + public int getNumReplicas() { + return numReplicas_; + } + /** + * int32 num_replicas = 2; + * @param value The numReplicas to set. + * @return This builder for chaining. + */ + public Builder setNumReplicas(int value) { + + numReplicas_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 num_replicas = 2; + * @return This builder for chaining. + */ + public Builder clearNumReplicas() { + bitField0_ = (bitField0_ & ~0x00000002); + numReplicas_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AutoParallelOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AutoParallelOptions) + private static final org.tensorflow.proto.AutoParallelOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AutoParallelOptions(); + } + + public static org.tensorflow.proto.AutoParallelOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutoParallelOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AutoParallelOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptionsOrBuilder.java new file mode 100644 index 00000000000..2220bc1d192 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AutoParallelOptionsOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface AutoParallelOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.AutoParallelOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * bool enable = 1; + * @return The enable. + */ + boolean getEnable(); + + /** + * int32 num_replicas = 2; + * @return The numReplicas. + */ + int getNumReplicas(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfo.java new file mode 100644 index 00000000000..174ab3c3307 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfo.java @@ -0,0 +1,948 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Matches DeviceAttributes
    + * 
    + * + * Protobuf type {@code tensorflow.AvailableDeviceInfo} + */ +public final class AvailableDeviceInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.AvailableDeviceInfo) + AvailableDeviceInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AvailableDeviceInfo.class.getName()); + } + // Use AvailableDeviceInfo.newBuilder() to construct. + private AvailableDeviceInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AvailableDeviceInfo() { + name_ = ""; + type_ = ""; + physicalDescription_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AvailableDeviceInfo.class, org.tensorflow.proto.AvailableDeviceInfo.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Device name.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Device name.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + *
    +   * Device type, e.g. 'CPU' or 'GPU'.
    +   * 
    + * + * string type = 2; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + *
    +   * Device type, e.g. 'CPU' or 'GPU'.
    +   * 
    + * + * string type = 2; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MEMORY_LIMIT_FIELD_NUMBER = 3; + private long memoryLimit_ = 0L; + /** + *
    +   * Memory capacity in bytes.
    +   * 
    + * + * int64 memory_limit = 3; + * @return The memoryLimit. + */ + @java.lang.Override + public long getMemoryLimit() { + return memoryLimit_; + } + + public static final int PHYSICAL_DESCRIPTION_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object physicalDescription_ = ""; + /** + *
    +   * The physical description of this device.
    +   * 
    + * + * string physical_description = 4; + * @return The physicalDescription. + */ + @java.lang.Override + public java.lang.String getPhysicalDescription() { + java.lang.Object ref = physicalDescription_; + 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(); + physicalDescription_ = s; + return s; + } + } + /** + *
    +   * The physical description of this device.
    +   * 
    + * + * string physical_description = 4; + * @return The bytes for physicalDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPhysicalDescriptionBytes() { + java.lang.Object ref = physicalDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + physicalDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + if (memoryLimit_ != 0L) { + output.writeInt64(3, memoryLimit_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(physicalDescription_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, physicalDescription_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + if (memoryLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, memoryLimit_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(physicalDescription_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, physicalDescription_); + } + size += getUnknownFields().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.AvailableDeviceInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.AvailableDeviceInfo other = (org.tensorflow.proto.AvailableDeviceInfo) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (getMemoryLimit() + != other.getMemoryLimit()) return false; + if (!getPhysicalDescription() + .equals(other.getPhysicalDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + MEMORY_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemoryLimit()); + hash = (37 * hash) + PHYSICAL_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getPhysicalDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AvailableDeviceInfo 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.AvailableDeviceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AvailableDeviceInfo 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.AvailableDeviceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.AvailableDeviceInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.AvailableDeviceInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.AvailableDeviceInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.AvailableDeviceInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Matches DeviceAttributes
    +   * 
    + * + * Protobuf type {@code tensorflow.AvailableDeviceInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.AvailableDeviceInfo) + org.tensorflow.proto.AvailableDeviceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.AvailableDeviceInfo.class, org.tensorflow.proto.AvailableDeviceInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.AvailableDeviceInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + memoryLimit_ = 0L; + physicalDescription_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_AvailableDeviceInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.AvailableDeviceInfo getDefaultInstanceForType() { + return org.tensorflow.proto.AvailableDeviceInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.AvailableDeviceInfo build() { + org.tensorflow.proto.AvailableDeviceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.AvailableDeviceInfo buildPartial() { + org.tensorflow.proto.AvailableDeviceInfo result = new org.tensorflow.proto.AvailableDeviceInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.AvailableDeviceInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.memoryLimit_ = memoryLimit_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.physicalDescription_ = physicalDescription_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.AvailableDeviceInfo) { + return mergeFrom((org.tensorflow.proto.AvailableDeviceInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.AvailableDeviceInfo other) { + if (other == org.tensorflow.proto.AvailableDeviceInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getMemoryLimit() != 0L) { + setMemoryLimit(other.getMemoryLimit()); + } + if (!other.getPhysicalDescription().isEmpty()) { + physicalDescription_ = other.physicalDescription_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + memoryLimit_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + physicalDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Device name.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Device name.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Device name.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Device name.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Device name.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + *
    +     * Device type, e.g. 'CPU' or 'GPU'.
    +     * 
    + * + * string type = 2; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Device type, e.g. 'CPU' or 'GPU'.
    +     * 
    + * + * string type = 2; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Device type, e.g. 'CPU' or 'GPU'.
    +     * 
    + * + * string type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Device type, e.g. 'CPU' or 'GPU'.
    +     * 
    + * + * string type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Device type, e.g. 'CPU' or 'GPU'.
    +     * 
    + * + * string type = 2; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long memoryLimit_ ; + /** + *
    +     * Memory capacity in bytes.
    +     * 
    + * + * int64 memory_limit = 3; + * @return The memoryLimit. + */ + @java.lang.Override + public long getMemoryLimit() { + return memoryLimit_; + } + /** + *
    +     * Memory capacity in bytes.
    +     * 
    + * + * int64 memory_limit = 3; + * @param value The memoryLimit to set. + * @return This builder for chaining. + */ + public Builder setMemoryLimit(long value) { + + memoryLimit_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Memory capacity in bytes.
    +     * 
    + * + * int64 memory_limit = 3; + * @return This builder for chaining. + */ + public Builder clearMemoryLimit() { + bitField0_ = (bitField0_ & ~0x00000004); + memoryLimit_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object physicalDescription_ = ""; + /** + *
    +     * The physical description of this device.
    +     * 
    + * + * string physical_description = 4; + * @return The physicalDescription. + */ + public java.lang.String getPhysicalDescription() { + java.lang.Object ref = physicalDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + physicalDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The physical description of this device.
    +     * 
    + * + * string physical_description = 4; + * @return The bytes for physicalDescription. + */ + public com.google.protobuf.ByteString + getPhysicalDescriptionBytes() { + java.lang.Object ref = physicalDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + physicalDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The physical description of this device.
    +     * 
    + * + * string physical_description = 4; + * @param value The physicalDescription to set. + * @return This builder for chaining. + */ + public Builder setPhysicalDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + physicalDescription_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The physical description of this device.
    +     * 
    + * + * string physical_description = 4; + * @return This builder for chaining. + */ + public Builder clearPhysicalDescription() { + physicalDescription_ = getDefaultInstance().getPhysicalDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * The physical description of this device.
    +     * 
    + * + * string physical_description = 4; + * @param value The bytes for physicalDescription to set. + * @return This builder for chaining. + */ + public Builder setPhysicalDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + physicalDescription_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.AvailableDeviceInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.AvailableDeviceInfo) + private static final org.tensorflow.proto.AvailableDeviceInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.AvailableDeviceInfo(); + } + + public static org.tensorflow.proto.AvailableDeviceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AvailableDeviceInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.AvailableDeviceInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfoOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfoOrBuilder.java index 138fcf086ef..de445a4283f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/AvailableDeviceInfoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/AvailableDeviceInfoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface AvailableDeviceInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.AvailableDeviceInfo) @@ -13,6 +15,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -21,6 +24,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -31,6 +35,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string type = 2; + * @return The type. */ java.lang.String getType(); /** @@ -39,6 +44,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string type = 2; + * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); @@ -49,6 +55,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * int64 memory_limit = 3; + * @return The memoryLimit. */ long getMemoryLimit(); @@ -58,6 +65,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string physical_description = 4; + * @return The physicalDescription. */ java.lang.String getPhysicalDescription(); /** @@ -66,6 +74,7 @@ public interface AvailableDeviceInfoOrBuilder extends * * * string physical_description = 4; + * @return The bytes for physicalDescription. */ com.google.protobuf.ByteString getPhysicalDescriptionBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptions.java new file mode 100644 index 00000000000..fb63a3ec488 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptions.java @@ -0,0 +1,958 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.BatchingOptions} + */ +public final class BatchingOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BatchingOptions) + BatchingOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BatchingOptions.class.getName()); + } + // Use BatchingOptions.newBuilder() to construct. + private BatchingOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BatchingOptions() { + allowedBatchSizes_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_BatchingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_BatchingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BatchingOptions.class, org.tensorflow.proto.BatchingOptions.Builder.class); + } + + public static final int NUM_BATCH_THREADS_FIELD_NUMBER = 1; + private int numBatchThreads_ = 0; + /** + *
    +   * Number of scheduling threads for processing batches of work. Determines
    +   * the number of batches processed in parallel. This should be roughly in line
    +   * with the number of TPU cores available.
    +   * 
    + * + * int32 num_batch_threads = 1; + * @return The numBatchThreads. + */ + @java.lang.Override + public int getNumBatchThreads() { + return numBatchThreads_; + } + + public static final int MAX_BATCH_SIZE_FIELD_NUMBER = 2; + private int maxBatchSize_ = 0; + /** + *
    +   * The maximum allowed batch size. Can be larger than allowed_batch_sizes to
    +   * utilize large batch splitting.
    +   * 
    + * + * int32 max_batch_size = 2; + * @return The maxBatchSize. + */ + @java.lang.Override + public int getMaxBatchSize() { + return maxBatchSize_; + } + + public static final int BATCH_TIMEOUT_MICROS_FIELD_NUMBER = 3; + private int batchTimeoutMicros_ = 0; + /** + *
    +   * Maximum number of microseconds to wait before outputting an incomplete
    +   * batch.
    +   * 
    + * + * int32 batch_timeout_micros = 3; + * @return The batchTimeoutMicros. + */ + @java.lang.Override + public int getBatchTimeoutMicros() { + return batchTimeoutMicros_; + } + + public static final int ALLOWED_BATCH_SIZES_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList allowedBatchSizes_ = + emptyIntList(); + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return A list containing the allowedBatchSizes. + */ + @java.lang.Override + public java.util.List + getAllowedBatchSizesList() { + return allowedBatchSizes_; + } + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return The count of allowedBatchSizes. + */ + public int getAllowedBatchSizesCount() { + return allowedBatchSizes_.size(); + } + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param index The index of the element to return. + * @return The allowedBatchSizes at the given index. + */ + public int getAllowedBatchSizes(int index) { + return allowedBatchSizes_.getInt(index); + } + private int allowedBatchSizesMemoizedSerializedSize = -1; + + public static final int MAX_ENQUEUED_BATCHES_FIELD_NUMBER = 5; + private int maxEnqueuedBatches_ = 0; + /** + *
    +   * Maximum number of batches enqueued for processing before requests are
    +   * failed fast.
    +   * 
    + * + * int32 max_enqueued_batches = 5; + * @return The maxEnqueuedBatches. + */ + @java.lang.Override + public int getMaxEnqueuedBatches() { + return maxEnqueuedBatches_; + } + + 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 { + getSerializedSize(); + if (numBatchThreads_ != 0) { + output.writeInt32(1, numBatchThreads_); + } + if (maxBatchSize_ != 0) { + output.writeInt32(2, maxBatchSize_); + } + if (batchTimeoutMicros_ != 0) { + output.writeInt32(3, batchTimeoutMicros_); + } + if (getAllowedBatchSizesList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(allowedBatchSizesMemoizedSerializedSize); + } + for (int i = 0; i < allowedBatchSizes_.size(); i++) { + output.writeInt32NoTag(allowedBatchSizes_.getInt(i)); + } + if (maxEnqueuedBatches_ != 0) { + output.writeInt32(5, maxEnqueuedBatches_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numBatchThreads_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, numBatchThreads_); + } + if (maxBatchSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, maxBatchSize_); + } + if (batchTimeoutMicros_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, batchTimeoutMicros_); + } + { + int dataSize = 0; + for (int i = 0; i < allowedBatchSizes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(allowedBatchSizes_.getInt(i)); + } + size += dataSize; + if (!getAllowedBatchSizesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + allowedBatchSizesMemoizedSerializedSize = dataSize; + } + if (maxEnqueuedBatches_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, maxEnqueuedBatches_); + } + size += getUnknownFields().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.BatchingOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.BatchingOptions other = (org.tensorflow.proto.BatchingOptions) obj; + + if (getNumBatchThreads() + != other.getNumBatchThreads()) return false; + if (getMaxBatchSize() + != other.getMaxBatchSize()) return false; + if (getBatchTimeoutMicros() + != other.getBatchTimeoutMicros()) return false; + if (!getAllowedBatchSizesList() + .equals(other.getAllowedBatchSizesList())) return false; + if (getMaxEnqueuedBatches() + != other.getMaxEnqueuedBatches()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_BATCH_THREADS_FIELD_NUMBER; + hash = (53 * hash) + getNumBatchThreads(); + hash = (37 * hash) + MAX_BATCH_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getMaxBatchSize(); + hash = (37 * hash) + BATCH_TIMEOUT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + getBatchTimeoutMicros(); + if (getAllowedBatchSizesCount() > 0) { + hash = (37 * hash) + ALLOWED_BATCH_SIZES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedBatchSizesList().hashCode(); + } + hash = (37 * hash) + MAX_ENQUEUED_BATCHES_FIELD_NUMBER; + hash = (53 * hash) + getMaxEnqueuedBatches(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BatchingOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BatchingOptions 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.BatchingOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BatchingOptions 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.BatchingOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BatchingOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BatchingOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BatchingOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BatchingOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BatchingOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BatchingOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BatchingOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BatchingOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.BatchingOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BatchingOptions) + org.tensorflow.proto.BatchingOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_BatchingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_BatchingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BatchingOptions.class, org.tensorflow.proto.BatchingOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.BatchingOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numBatchThreads_ = 0; + maxBatchSize_ = 0; + batchTimeoutMicros_ = 0; + allowedBatchSizes_ = emptyIntList(); + maxEnqueuedBatches_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_BatchingOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BatchingOptions getDefaultInstanceForType() { + return org.tensorflow.proto.BatchingOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BatchingOptions build() { + org.tensorflow.proto.BatchingOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BatchingOptions buildPartial() { + org.tensorflow.proto.BatchingOptions result = new org.tensorflow.proto.BatchingOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BatchingOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numBatchThreads_ = numBatchThreads_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxBatchSize_ = maxBatchSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.batchTimeoutMicros_ = batchTimeoutMicros_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + allowedBatchSizes_.makeImmutable(); + result.allowedBatchSizes_ = allowedBatchSizes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.maxEnqueuedBatches_ = maxEnqueuedBatches_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BatchingOptions) { + return mergeFrom((org.tensorflow.proto.BatchingOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BatchingOptions other) { + if (other == org.tensorflow.proto.BatchingOptions.getDefaultInstance()) return this; + if (other.getNumBatchThreads() != 0) { + setNumBatchThreads(other.getNumBatchThreads()); + } + if (other.getMaxBatchSize() != 0) { + setMaxBatchSize(other.getMaxBatchSize()); + } + if (other.getBatchTimeoutMicros() != 0) { + setBatchTimeoutMicros(other.getBatchTimeoutMicros()); + } + if (!other.allowedBatchSizes_.isEmpty()) { + if (allowedBatchSizes_.isEmpty()) { + allowedBatchSizes_ = other.allowedBatchSizes_; + allowedBatchSizes_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensureAllowedBatchSizesIsMutable(); + allowedBatchSizes_.addAll(other.allowedBatchSizes_); + } + onChanged(); + } + if (other.getMaxEnqueuedBatches() != 0) { + setMaxEnqueuedBatches(other.getMaxEnqueuedBatches()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + numBatchThreads_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + maxBatchSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + batchTimeoutMicros_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + int v = input.readInt32(); + ensureAllowedBatchSizesIsMutable(); + allowedBatchSizes_.addInt(v); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAllowedBatchSizesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + allowedBatchSizes_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 34 + case 40: { + maxEnqueuedBatches_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int numBatchThreads_ ; + /** + *
    +     * Number of scheduling threads for processing batches of work. Determines
    +     * the number of batches processed in parallel. This should be roughly in line
    +     * with the number of TPU cores available.
    +     * 
    + * + * int32 num_batch_threads = 1; + * @return The numBatchThreads. + */ + @java.lang.Override + public int getNumBatchThreads() { + return numBatchThreads_; + } + /** + *
    +     * Number of scheduling threads for processing batches of work. Determines
    +     * the number of batches processed in parallel. This should be roughly in line
    +     * with the number of TPU cores available.
    +     * 
    + * + * int32 num_batch_threads = 1; + * @param value The numBatchThreads to set. + * @return This builder for chaining. + */ + public Builder setNumBatchThreads(int value) { + + numBatchThreads_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Number of scheduling threads for processing batches of work. Determines
    +     * the number of batches processed in parallel. This should be roughly in line
    +     * with the number of TPU cores available.
    +     * 
    + * + * int32 num_batch_threads = 1; + * @return This builder for chaining. + */ + public Builder clearNumBatchThreads() { + bitField0_ = (bitField0_ & ~0x00000001); + numBatchThreads_ = 0; + onChanged(); + return this; + } + + private int maxBatchSize_ ; + /** + *
    +     * The maximum allowed batch size. Can be larger than allowed_batch_sizes to
    +     * utilize large batch splitting.
    +     * 
    + * + * int32 max_batch_size = 2; + * @return The maxBatchSize. + */ + @java.lang.Override + public int getMaxBatchSize() { + return maxBatchSize_; + } + /** + *
    +     * The maximum allowed batch size. Can be larger than allowed_batch_sizes to
    +     * utilize large batch splitting.
    +     * 
    + * + * int32 max_batch_size = 2; + * @param value The maxBatchSize to set. + * @return This builder for chaining. + */ + public Builder setMaxBatchSize(int value) { + + maxBatchSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The maximum allowed batch size. Can be larger than allowed_batch_sizes to
    +     * utilize large batch splitting.
    +     * 
    + * + * int32 max_batch_size = 2; + * @return This builder for chaining. + */ + public Builder clearMaxBatchSize() { + bitField0_ = (bitField0_ & ~0x00000002); + maxBatchSize_ = 0; + onChanged(); + return this; + } + + private int batchTimeoutMicros_ ; + /** + *
    +     * Maximum number of microseconds to wait before outputting an incomplete
    +     * batch.
    +     * 
    + * + * int32 batch_timeout_micros = 3; + * @return The batchTimeoutMicros. + */ + @java.lang.Override + public int getBatchTimeoutMicros() { + return batchTimeoutMicros_; + } + /** + *
    +     * Maximum number of microseconds to wait before outputting an incomplete
    +     * batch.
    +     * 
    + * + * int32 batch_timeout_micros = 3; + * @param value The batchTimeoutMicros to set. + * @return This builder for chaining. + */ + public Builder setBatchTimeoutMicros(int value) { + + batchTimeoutMicros_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Maximum number of microseconds to wait before outputting an incomplete
    +     * batch.
    +     * 
    + * + * int32 batch_timeout_micros = 3; + * @return This builder for chaining. + */ + public Builder clearBatchTimeoutMicros() { + bitField0_ = (bitField0_ & ~0x00000004); + batchTimeoutMicros_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList allowedBatchSizes_ = emptyIntList(); + private void ensureAllowedBatchSizesIsMutable() { + if (!allowedBatchSizes_.isModifiable()) { + allowedBatchSizes_ = makeMutableCopy(allowedBatchSizes_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return A list containing the allowedBatchSizes. + */ + public java.util.List + getAllowedBatchSizesList() { + allowedBatchSizes_.makeImmutable(); + return allowedBatchSizes_; + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return The count of allowedBatchSizes. + */ + public int getAllowedBatchSizesCount() { + return allowedBatchSizes_.size(); + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param index The index of the element to return. + * @return The allowedBatchSizes at the given index. + */ + public int getAllowedBatchSizes(int index) { + return allowedBatchSizes_.getInt(index); + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param index The index to set the value at. + * @param value The allowedBatchSizes to set. + * @return This builder for chaining. + */ + public Builder setAllowedBatchSizes( + int index, int value) { + + ensureAllowedBatchSizesIsMutable(); + allowedBatchSizes_.setInt(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param value The allowedBatchSizes to add. + * @return This builder for chaining. + */ + public Builder addAllowedBatchSizes(int value) { + + ensureAllowedBatchSizesIsMutable(); + allowedBatchSizes_.addInt(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param values The allowedBatchSizes to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedBatchSizes( + java.lang.Iterable values) { + ensureAllowedBatchSizesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, allowedBatchSizes_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Optional list of allowed batch sizes. If left empty, does nothing.
    +     * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +     * to one of those sizes. The entries must increase monotonically, and the
    +     * final entry must be equal or less than the max_batch_size.
    +     * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return This builder for chaining. + */ + public Builder clearAllowedBatchSizes() { + allowedBatchSizes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private int maxEnqueuedBatches_ ; + /** + *
    +     * Maximum number of batches enqueued for processing before requests are
    +     * failed fast.
    +     * 
    + * + * int32 max_enqueued_batches = 5; + * @return The maxEnqueuedBatches. + */ + @java.lang.Override + public int getMaxEnqueuedBatches() { + return maxEnqueuedBatches_; + } + /** + *
    +     * Maximum number of batches enqueued for processing before requests are
    +     * failed fast.
    +     * 
    + * + * int32 max_enqueued_batches = 5; + * @param value The maxEnqueuedBatches to set. + * @return This builder for chaining. + */ + public Builder setMaxEnqueuedBatches(int value) { + + maxEnqueuedBatches_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Maximum number of batches enqueued for processing before requests are
    +     * failed fast.
    +     * 
    + * + * int32 max_enqueued_batches = 5; + * @return This builder for chaining. + */ + public Builder clearMaxEnqueuedBatches() { + bitField0_ = (bitField0_ & ~0x00000010); + maxEnqueuedBatches_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BatchingOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BatchingOptions) + private static final org.tensorflow.proto.BatchingOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BatchingOptions(); + } + + public static org.tensorflow.proto.BatchingOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchingOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BatchingOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptionsOrBuilder.java new file mode 100644 index 00000000000..f23c6d205d3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BatchingOptionsOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BatchingOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BatchingOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Number of scheduling threads for processing batches of work. Determines
    +   * the number of batches processed in parallel. This should be roughly in line
    +   * with the number of TPU cores available.
    +   * 
    + * + * int32 num_batch_threads = 1; + * @return The numBatchThreads. + */ + int getNumBatchThreads(); + + /** + *
    +   * The maximum allowed batch size. Can be larger than allowed_batch_sizes to
    +   * utilize large batch splitting.
    +   * 
    + * + * int32 max_batch_size = 2; + * @return The maxBatchSize. + */ + int getMaxBatchSize(); + + /** + *
    +   * Maximum number of microseconds to wait before outputting an incomplete
    +   * batch.
    +   * 
    + * + * int32 batch_timeout_micros = 3; + * @return The batchTimeoutMicros. + */ + int getBatchTimeoutMicros(); + + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return A list containing the allowedBatchSizes. + */ + java.util.List getAllowedBatchSizesList(); + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @return The count of allowedBatchSizes. + */ + int getAllowedBatchSizesCount(); + /** + *
    +   * Optional list of allowed batch sizes. If left empty, does nothing.
    +   * Otherwise, supplies a list of batch sizes, causing the op to pad batches up
    +   * to one of those sizes. The entries must increase monotonically, and the
    +   * final entry must be equal or less than the max_batch_size.
    +   * 
    + * + * repeated int32 allowed_batch_sizes = 4; + * @param index The index of the element to return. + * @return The allowedBatchSizes at the given index. + */ + int getAllowedBatchSizes(int index); + + /** + *
    +   * Maximum number of batches enqueued for processing before requests are
    +   * failed fast.
    +   * 
    + * + * int32 max_enqueued_batches = 5; + * @return The maxEnqueuedBatches. + */ + int getMaxEnqueuedBatches(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntries.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntries.java new file mode 100644 index 00000000000..78647b68d29 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntries.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.BenchmarkEntries} + */ +public final class BenchmarkEntries extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BenchmarkEntries) + BenchmarkEntriesOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BenchmarkEntries.class.getName()); + } + // Use BenchmarkEntries.newBuilder() to construct. + private BenchmarkEntries(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BenchmarkEntries() { + entry_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BenchmarkEntries.class, org.tensorflow.proto.BenchmarkEntries.Builder.class); + } + + public static final int ENTRY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List entry_; + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + @java.lang.Override + public java.util.List getEntryList() { + return entry_; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + @java.lang.Override + public java.util.List + getEntryOrBuilderList() { + return entry_; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + @java.lang.Override + public int getEntryCount() { + return entry_.size(); + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntry getEntry(int index) { + return entry_.get(index); + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntryOrBuilder getEntryOrBuilder( + int index) { + return entry_.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 { + for (int i = 0; i < entry_.size(); i++) { + output.writeMessage(1, entry_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entry_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, entry_.get(i)); + } + size += getUnknownFields().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.BenchmarkEntries)) { + return super.equals(obj); + } + org.tensorflow.proto.BenchmarkEntries other = (org.tensorflow.proto.BenchmarkEntries) obj; + + if (!getEntryList() + .equals(other.getEntryList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntryCount() > 0) { + hash = (37 * hash) + ENTRY_FIELD_NUMBER; + hash = (53 * hash) + getEntryList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BenchmarkEntries parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntries 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.BenchmarkEntries parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntries 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.BenchmarkEntries parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntries parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BenchmarkEntries parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BenchmarkEntries parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BenchmarkEntries parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BenchmarkEntries parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BenchmarkEntries parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BenchmarkEntries parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BenchmarkEntries 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.BenchmarkEntries} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BenchmarkEntries) + org.tensorflow.proto.BenchmarkEntriesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BenchmarkEntries.class, org.tensorflow.proto.BenchmarkEntries.Builder.class); + } + + // Construct using org.tensorflow.proto.BenchmarkEntries.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (entryBuilder_ == null) { + entry_ = java.util.Collections.emptyList(); + } else { + entry_ = null; + entryBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntries_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntries getDefaultInstanceForType() { + return org.tensorflow.proto.BenchmarkEntries.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntries build() { + org.tensorflow.proto.BenchmarkEntries result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntries buildPartial() { + org.tensorflow.proto.BenchmarkEntries result = new org.tensorflow.proto.BenchmarkEntries(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.BenchmarkEntries result) { + if (entryBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entry_ = java.util.Collections.unmodifiableList(entry_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entry_ = entry_; + } else { + result.entry_ = entryBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.BenchmarkEntries result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BenchmarkEntries) { + return mergeFrom((org.tensorflow.proto.BenchmarkEntries)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BenchmarkEntries other) { + if (other == org.tensorflow.proto.BenchmarkEntries.getDefaultInstance()) return this; + if (entryBuilder_ == null) { + if (!other.entry_.isEmpty()) { + if (entry_.isEmpty()) { + entry_ = other.entry_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntryIsMutable(); + entry_.addAll(other.entry_); + } + onChanged(); + } + } else { + if (!other.entry_.isEmpty()) { + if (entryBuilder_.isEmpty()) { + entryBuilder_.dispose(); + entryBuilder_ = null; + entry_ = other.entry_; + bitField0_ = (bitField0_ & ~0x00000001); + entryBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getEntryFieldBuilder() : null; + } else { + entryBuilder_.addAllMessages(other.entry_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.BenchmarkEntry m = + input.readMessage( + org.tensorflow.proto.BenchmarkEntry.parser(), + extensionRegistry); + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + entry_.add(m); + } else { + entryBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List entry_ = + java.util.Collections.emptyList(); + private void ensureEntryIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entry_ = new java.util.ArrayList(entry_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BenchmarkEntry, org.tensorflow.proto.BenchmarkEntry.Builder, org.tensorflow.proto.BenchmarkEntryOrBuilder> entryBuilder_; + + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public java.util.List getEntryList() { + if (entryBuilder_ == null) { + return java.util.Collections.unmodifiableList(entry_); + } else { + return entryBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public int getEntryCount() { + if (entryBuilder_ == null) { + return entry_.size(); + } else { + return entryBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public org.tensorflow.proto.BenchmarkEntry getEntry(int index) { + if (entryBuilder_ == null) { + return entry_.get(index); + } else { + return entryBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder setEntry( + int index, org.tensorflow.proto.BenchmarkEntry value) { + if (entryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntryIsMutable(); + entry_.set(index, value); + onChanged(); + } else { + entryBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder setEntry( + int index, org.tensorflow.proto.BenchmarkEntry.Builder builderForValue) { + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + entry_.set(index, builderForValue.build()); + onChanged(); + } else { + entryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder addEntry(org.tensorflow.proto.BenchmarkEntry value) { + if (entryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntryIsMutable(); + entry_.add(value); + onChanged(); + } else { + entryBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder addEntry( + int index, org.tensorflow.proto.BenchmarkEntry value) { + if (entryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntryIsMutable(); + entry_.add(index, value); + onChanged(); + } else { + entryBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder addEntry( + org.tensorflow.proto.BenchmarkEntry.Builder builderForValue) { + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + entry_.add(builderForValue.build()); + onChanged(); + } else { + entryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder addEntry( + int index, org.tensorflow.proto.BenchmarkEntry.Builder builderForValue) { + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + entry_.add(index, builderForValue.build()); + onChanged(); + } else { + entryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder addAllEntry( + java.lang.Iterable values) { + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entry_); + onChanged(); + } else { + entryBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder clearEntry() { + if (entryBuilder_ == null) { + entry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entryBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public Builder removeEntry(int index) { + if (entryBuilder_ == null) { + ensureEntryIsMutable(); + entry_.remove(index); + onChanged(); + } else { + entryBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public org.tensorflow.proto.BenchmarkEntry.Builder getEntryBuilder( + int index) { + return getEntryFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public org.tensorflow.proto.BenchmarkEntryOrBuilder getEntryOrBuilder( + int index) { + if (entryBuilder_ == null) { + return entry_.get(index); } else { + return entryBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public java.util.List + getEntryOrBuilderList() { + if (entryBuilder_ != null) { + return entryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entry_); + } + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public org.tensorflow.proto.BenchmarkEntry.Builder addEntryBuilder() { + return getEntryFieldBuilder().addBuilder( + org.tensorflow.proto.BenchmarkEntry.getDefaultInstance()); + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public org.tensorflow.proto.BenchmarkEntry.Builder addEntryBuilder( + int index) { + return getEntryFieldBuilder().addBuilder( + index, org.tensorflow.proto.BenchmarkEntry.getDefaultInstance()); + } + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + public java.util.List + getEntryBuilderList() { + return getEntryFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BenchmarkEntry, org.tensorflow.proto.BenchmarkEntry.Builder, org.tensorflow.proto.BenchmarkEntryOrBuilder> + getEntryFieldBuilder() { + if (entryBuilder_ == null) { + entryBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BenchmarkEntry, org.tensorflow.proto.BenchmarkEntry.Builder, org.tensorflow.proto.BenchmarkEntryOrBuilder>( + entry_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + entry_ = null; + } + return entryBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BenchmarkEntries) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BenchmarkEntries) + private static final org.tensorflow.proto.BenchmarkEntries DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BenchmarkEntries(); + } + + public static org.tensorflow.proto.BenchmarkEntries getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BenchmarkEntries parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BenchmarkEntries getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntriesOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntriesOrBuilder.java new file mode 100644 index 00000000000..7f439a05b87 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntriesOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BenchmarkEntriesOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BenchmarkEntries) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + java.util.List + getEntryList(); + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + org.tensorflow.proto.BenchmarkEntry getEntry(int index); + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + int getEntryCount(); + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + java.util.List + getEntryOrBuilderList(); + /** + * repeated .tensorflow.BenchmarkEntry entry = 1; + */ + org.tensorflow.proto.BenchmarkEntryOrBuilder getEntryOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntry.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntry.java new file mode 100644 index 00000000000..7b41d4e7a15 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntry.java @@ -0,0 +1,1714 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Each unit test or benchmark in a test or benchmark run provides
    + * some set of information.  Here we provide some reasonable keys
    + * one would expect to see, with optional key/value pairs for things
    + * we haven't considered.
    + *
    + * This BenchmarkEntry should be emitted by each unit test or benchmark
    + * reporter.
    + * 
    + * + * Protobuf type {@code tensorflow.BenchmarkEntry} + */ +public final class BenchmarkEntry extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BenchmarkEntry) + BenchmarkEntryOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BenchmarkEntry.class.getName()); + } + // Use BenchmarkEntry.newBuilder() to construct. + private BenchmarkEntry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BenchmarkEntry() { + name_ = ""; + metrics_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetExtras(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BenchmarkEntry.class, org.tensorflow.proto.BenchmarkEntry.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * The name of the specific benchmark or test
    +   * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 specific benchmark or test
    +   * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 ITERS_FIELD_NUMBER = 2; + private long iters_ = 0L; + /** + *
    +   * If a benchmark, how many iterations it was run for
    +   * 
    + * + * int64 iters = 2; + * @return The iters. + */ + @java.lang.Override + public long getIters() { + return iters_; + } + + public static final int CPU_TIME_FIELD_NUMBER = 3; + private double cpuTime_ = 0D; + /** + *
    +   * Total cpu time used for all iterations (in seconds)
    +   * 
    + * + * double cpu_time = 3; + * @return The cpuTime. + */ + @java.lang.Override + public double getCpuTime() { + return cpuTime_; + } + + public static final int WALL_TIME_FIELD_NUMBER = 4; + private double wallTime_ = 0D; + /** + *
    +   * Total wall time used for all iterations (in seconds)
    +   * 
    + * + * double wall_time = 4; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + + public static final int THROUGHPUT_FIELD_NUMBER = 5; + private double throughput_ = 0D; + /** + *
    +   * Throughput (in MB/s)
    +   * 
    + * + * double throughput = 5; + * @return The throughput. + */ + @java.lang.Override + public double getThroughput() { + return throughput_; + } + + public static final int EXTRAS_FIELD_NUMBER = 6; + private static final class ExtrasDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.EntryValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.EntryValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.EntryValue> extras_; + private com.google.protobuf.MapField + internalGetExtras() { + if (extras_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ExtrasDefaultEntryHolder.defaultEntry); + } + return extras_; + } + public int getExtrasCount() { + return internalGetExtras().getMap().size(); + } + /** + *
    +   * Generic map from result key to value.
    +   * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public boolean containsExtras( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetExtras().getMap().containsKey(key); + } + /** + * Use {@link #getExtrasMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getExtras() { + return getExtrasMap(); + } + /** + *
    +   * Generic map from result key to value.
    +   * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public java.util.Map getExtrasMap() { + return internalGetExtras().getMap(); + } + /** + *
    +   * Generic map from result key to value.
    +   * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.EntryValue getExtrasOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.EntryValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExtras().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Generic map from result key to value.
    +   * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public org.tensorflow.proto.EntryValue getExtrasOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExtras().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METRICS_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List metrics_; + /** + *
    +   * Metric name, value and expected range. This can include accuracy metrics
    +   * typically used to determine whether the accuracy test has passed
    +   * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + @java.lang.Override + public java.util.List getMetricsList() { + return metrics_; + } + /** + *
    +   * Metric name, value and expected range. This can include accuracy metrics
    +   * typically used to determine whether the accuracy test has passed
    +   * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + @java.lang.Override + public java.util.List + getMetricsOrBuilderList() { + return metrics_; + } + /** + *
    +   * Metric name, value and expected range. This can include accuracy metrics
    +   * typically used to determine whether the accuracy test has passed
    +   * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + @java.lang.Override + public int getMetricsCount() { + return metrics_.size(); + } + /** + *
    +   * Metric name, value and expected range. This can include accuracy metrics
    +   * typically used to determine whether the accuracy test has passed
    +   * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + @java.lang.Override + public org.tensorflow.proto.MetricEntry getMetrics(int index) { + return metrics_.get(index); + } + /** + *
    +   * Metric name, value and expected range. This can include accuracy metrics
    +   * typically used to determine whether the accuracy test has passed
    +   * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + @java.lang.Override + public org.tensorflow.proto.MetricEntryOrBuilder getMetricsOrBuilder( + int index) { + return metrics_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (iters_ != 0L) { + output.writeInt64(2, iters_); + } + if (java.lang.Double.doubleToRawLongBits(cpuTime_) != 0) { + output.writeDouble(3, cpuTime_); + } + if (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + output.writeDouble(4, wallTime_); + } + if (java.lang.Double.doubleToRawLongBits(throughput_) != 0) { + output.writeDouble(5, throughput_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetExtras(), + ExtrasDefaultEntryHolder.defaultEntry, + 6); + for (int i = 0; i < metrics_.size(); i++) { + output.writeMessage(7, metrics_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (iters_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, iters_); + } + if (java.lang.Double.doubleToRawLongBits(cpuTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, cpuTime_); + } + if (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, wallTime_); + } + if (java.lang.Double.doubleToRawLongBits(throughput_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(5, throughput_); + } + for (java.util.Map.Entry entry + : internalGetExtras().getMap().entrySet()) { + com.google.protobuf.MapEntry + extras__ = ExtrasDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, extras__); + } + for (int i = 0; i < metrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, metrics_.get(i)); + } + size += getUnknownFields().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.BenchmarkEntry)) { + return super.equals(obj); + } + org.tensorflow.proto.BenchmarkEntry other = (org.tensorflow.proto.BenchmarkEntry) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getIters() + != other.getIters()) return false; + if (java.lang.Double.doubleToLongBits(getCpuTime()) + != java.lang.Double.doubleToLongBits( + other.getCpuTime())) return false; + if (java.lang.Double.doubleToLongBits(getWallTime()) + != java.lang.Double.doubleToLongBits( + other.getWallTime())) return false; + if (java.lang.Double.doubleToLongBits(getThroughput()) + != java.lang.Double.doubleToLongBits( + other.getThroughput())) return false; + if (!internalGetExtras().equals( + other.internalGetExtras())) return false; + if (!getMetricsList() + .equals(other.getMetricsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ITERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIters()); + hash = (37 * hash) + CPU_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCpuTime())); + hash = (37 * hash) + WALL_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getWallTime())); + hash = (37 * hash) + THROUGHPUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getThroughput())); + if (!internalGetExtras().getMap().isEmpty()) { + hash = (37 * hash) + EXTRAS_FIELD_NUMBER; + hash = (53 * hash) + internalGetExtras().hashCode(); + } + if (getMetricsCount() > 0) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetricsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BenchmarkEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntry 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.BenchmarkEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntry 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.BenchmarkEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BenchmarkEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BenchmarkEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BenchmarkEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BenchmarkEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BenchmarkEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BenchmarkEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BenchmarkEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BenchmarkEntry 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Each unit test or benchmark in a test or benchmark run provides
    +   * some set of information.  Here we provide some reasonable keys
    +   * one would expect to see, with optional key/value pairs for things
    +   * we haven't considered.
    +   *
    +   * This BenchmarkEntry should be emitted by each unit test or benchmark
    +   * reporter.
    +   * 
    + * + * Protobuf type {@code tensorflow.BenchmarkEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BenchmarkEntry) + org.tensorflow.proto.BenchmarkEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetExtras(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableExtras(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BenchmarkEntry.class, org.tensorflow.proto.BenchmarkEntry.Builder.class); + } + + // Construct using org.tensorflow.proto.BenchmarkEntry.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + iters_ = 0L; + cpuTime_ = 0D; + wallTime_ = 0D; + throughput_ = 0D; + internalGetMutableExtras().clear(); + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + } else { + metrics_ = null; + metricsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BenchmarkEntry_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntry getDefaultInstanceForType() { + return org.tensorflow.proto.BenchmarkEntry.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntry build() { + org.tensorflow.proto.BenchmarkEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntry buildPartial() { + org.tensorflow.proto.BenchmarkEntry result = new org.tensorflow.proto.BenchmarkEntry(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.BenchmarkEntry result) { + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + metrics_ = java.util.Collections.unmodifiableList(metrics_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.metrics_ = metrics_; + } else { + result.metrics_ = metricsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.BenchmarkEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.iters_ = iters_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cpuTime_ = cpuTime_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.wallTime_ = wallTime_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.throughput_ = throughput_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.extras_ = internalGetExtras().build(ExtrasDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BenchmarkEntry) { + return mergeFrom((org.tensorflow.proto.BenchmarkEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BenchmarkEntry other) { + if (other == org.tensorflow.proto.BenchmarkEntry.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getIters() != 0L) { + setIters(other.getIters()); + } + if (other.getCpuTime() != 0D) { + setCpuTime(other.getCpuTime()); + } + if (other.getWallTime() != 0D) { + setWallTime(other.getWallTime()); + } + if (other.getThroughput() != 0D) { + setThroughput(other.getThroughput()); + } + internalGetMutableExtras().mergeFrom( + other.internalGetExtras()); + bitField0_ |= 0x00000020; + if (metricsBuilder_ == null) { + if (!other.metrics_.isEmpty()) { + if (metrics_.isEmpty()) { + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureMetricsIsMutable(); + metrics_.addAll(other.metrics_); + } + onChanged(); + } + } else { + if (!other.metrics_.isEmpty()) { + if (metricsBuilder_.isEmpty()) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000040); + metricsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMetricsFieldBuilder() : null; + } else { + metricsBuilder_.addAllMessages(other.metrics_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + iters_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 25: { + cpuTime_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + wallTime_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 41: { + throughput_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 50: { + com.google.protobuf.MapEntry + extras__ = input.readMessage( + ExtrasDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableExtras().ensureBuilderMap().put( + extras__.getKey(), extras__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + org.tensorflow.proto.MetricEntry m = + input.readMessage( + org.tensorflow.proto.MetricEntry.parser(), + extensionRegistry); + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(m); + } else { + metricsBuilder_.addMessage(m); + } + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * The name of the specific benchmark or test
    +     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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 specific benchmark or test
    +     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 specific benchmark or test
    +     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The name of the specific benchmark or test
    +     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The name of the specific benchmark or test
    +     * (e.g. BM_AdjustContrast_gpu_B_W_H)
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long iters_ ; + /** + *
    +     * If a benchmark, how many iterations it was run for
    +     * 
    + * + * int64 iters = 2; + * @return The iters. + */ + @java.lang.Override + public long getIters() { + return iters_; + } + /** + *
    +     * If a benchmark, how many iterations it was run for
    +     * 
    + * + * int64 iters = 2; + * @param value The iters to set. + * @return This builder for chaining. + */ + public Builder setIters(long value) { + + iters_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If a benchmark, how many iterations it was run for
    +     * 
    + * + * int64 iters = 2; + * @return This builder for chaining. + */ + public Builder clearIters() { + bitField0_ = (bitField0_ & ~0x00000002); + iters_ = 0L; + onChanged(); + return this; + } + + private double cpuTime_ ; + /** + *
    +     * Total cpu time used for all iterations (in seconds)
    +     * 
    + * + * double cpu_time = 3; + * @return The cpuTime. + */ + @java.lang.Override + public double getCpuTime() { + return cpuTime_; + } + /** + *
    +     * Total cpu time used for all iterations (in seconds)
    +     * 
    + * + * double cpu_time = 3; + * @param value The cpuTime to set. + * @return This builder for chaining. + */ + public Builder setCpuTime(double value) { + + cpuTime_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Total cpu time used for all iterations (in seconds)
    +     * 
    + * + * double cpu_time = 3; + * @return This builder for chaining. + */ + public Builder clearCpuTime() { + bitField0_ = (bitField0_ & ~0x00000004); + cpuTime_ = 0D; + onChanged(); + return this; + } + + private double wallTime_ ; + /** + *
    +     * Total wall time used for all iterations (in seconds)
    +     * 
    + * + * double wall_time = 4; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + /** + *
    +     * Total wall time used for all iterations (in seconds)
    +     * 
    + * + * double wall_time = 4; + * @param value The wallTime to set. + * @return This builder for chaining. + */ + public Builder setWallTime(double value) { + + wallTime_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Total wall time used for all iterations (in seconds)
    +     * 
    + * + * double wall_time = 4; + * @return This builder for chaining. + */ + public Builder clearWallTime() { + bitField0_ = (bitField0_ & ~0x00000008); + wallTime_ = 0D; + onChanged(); + return this; + } + + private double throughput_ ; + /** + *
    +     * Throughput (in MB/s)
    +     * 
    + * + * double throughput = 5; + * @return The throughput. + */ + @java.lang.Override + public double getThroughput() { + return throughput_; + } + /** + *
    +     * Throughput (in MB/s)
    +     * 
    + * + * double throughput = 5; + * @param value The throughput to set. + * @return This builder for chaining. + */ + public Builder setThroughput(double value) { + + throughput_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Throughput (in MB/s)
    +     * 
    + * + * double throughput = 5; + * @return This builder for chaining. + */ + public Builder clearThroughput() { + bitField0_ = (bitField0_ & ~0x00000010); + throughput_ = 0D; + onChanged(); + return this; + } + + private static final class ExtrasConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.EntryValue build(org.tensorflow.proto.EntryValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.EntryValue) { return (org.tensorflow.proto.EntryValue) val; } + return ((org.tensorflow.proto.EntryValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return ExtrasDefaultEntryHolder.defaultEntry; + } + }; + private static final ExtrasConverter extrasConverter = new ExtrasConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.EntryValueOrBuilder, org.tensorflow.proto.EntryValue, org.tensorflow.proto.EntryValue.Builder> extras_; + private com.google.protobuf.MapFieldBuilder + internalGetExtras() { + if (extras_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(extrasConverter); + } + return extras_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableExtras() { + if (extras_ == null) { + extras_ = new com.google.protobuf.MapFieldBuilder<>(extrasConverter); + } + bitField0_ |= 0x00000020; + onChanged(); + return extras_; + } + public int getExtrasCount() { + return internalGetExtras().ensureBuilderMap().size(); + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public boolean containsExtras( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetExtras().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getExtrasMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getExtras() { + return getExtrasMap(); + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public java.util.Map getExtrasMap() { + return internalGetExtras().getImmutableMap(); + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.EntryValue getExtrasOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.EntryValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableExtras().ensureBuilderMap(); + return map.containsKey(key) ? extrasConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + @java.lang.Override + public org.tensorflow.proto.EntryValue getExtrasOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableExtras().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return extrasConverter.build(map.get(key)); + } + public Builder clearExtras() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableExtras().clear(); + return this; + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + public Builder removeExtras( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableExtras().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableExtras() { + bitField0_ |= 0x00000020; + return internalGetMutableExtras().ensureMessageMap(); + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + public Builder putExtras( + java.lang.String key, + org.tensorflow.proto.EntryValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableExtras().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + public Builder putAllExtras( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableExtras().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +     * Generic map from result key to value.
    +     * 
    + * + * map<string, .tensorflow.EntryValue> extras = 6; + */ + public org.tensorflow.proto.EntryValue.Builder putExtrasBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableExtras().ensureBuilderMap(); + org.tensorflow.proto.EntryValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.EntryValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.EntryValue) { + entry = ((org.tensorflow.proto.EntryValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.EntryValue.Builder) entry; + } + + private java.util.List metrics_ = + java.util.Collections.emptyList(); + private void ensureMetricsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + metrics_ = new java.util.ArrayList(metrics_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetricEntry, org.tensorflow.proto.MetricEntry.Builder, org.tensorflow.proto.MetricEntryOrBuilder> metricsBuilder_; + + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public java.util.List getMetricsList() { + if (metricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(metrics_); + } else { + return metricsBuilder_.getMessageList(); + } + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public int getMetricsCount() { + if (metricsBuilder_ == null) { + return metrics_.size(); + } else { + return metricsBuilder_.getCount(); + } + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public org.tensorflow.proto.MetricEntry getMetrics(int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); + } else { + return metricsBuilder_.getMessage(index); + } + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder setMetrics( + int index, org.tensorflow.proto.MetricEntry value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.set(index, value); + onChanged(); + } else { + metricsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder setMetrics( + int index, org.tensorflow.proto.MetricEntry.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.set(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder addMetrics(org.tensorflow.proto.MetricEntry value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(value); + onChanged(); + } else { + metricsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder addMetrics( + int index, org.tensorflow.proto.MetricEntry value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(index, value); + onChanged(); + } else { + metricsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder addMetrics( + org.tensorflow.proto.MetricEntry.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder addMetrics( + int index, org.tensorflow.proto.MetricEntry.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder addAllMetrics( + java.lang.Iterable values) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, metrics_); + onChanged(); + } else { + metricsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder clearMetrics() { + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + metricsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public Builder removeMetrics(int index) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.remove(index); + onChanged(); + } else { + metricsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public org.tensorflow.proto.MetricEntry.Builder getMetricsBuilder( + int index) { + return getMetricsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public org.tensorflow.proto.MetricEntryOrBuilder getMetricsOrBuilder( + int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); } else { + return metricsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public java.util.List + getMetricsOrBuilderList() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metrics_); + } + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public org.tensorflow.proto.MetricEntry.Builder addMetricsBuilder() { + return getMetricsFieldBuilder().addBuilder( + org.tensorflow.proto.MetricEntry.getDefaultInstance()); + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public org.tensorflow.proto.MetricEntry.Builder addMetricsBuilder( + int index) { + return getMetricsFieldBuilder().addBuilder( + index, org.tensorflow.proto.MetricEntry.getDefaultInstance()); + } + /** + *
    +     * Metric name, value and expected range. This can include accuracy metrics
    +     * typically used to determine whether the accuracy test has passed
    +     * 
    + * + * repeated .tensorflow.MetricEntry metrics = 7; + */ + public java.util.List + getMetricsBuilderList() { + return getMetricsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetricEntry, org.tensorflow.proto.MetricEntry.Builder, org.tensorflow.proto.MetricEntryOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetricEntry, org.tensorflow.proto.MetricEntry.Builder, org.tensorflow.proto.MetricEntryOrBuilder>( + metrics_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BenchmarkEntry) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BenchmarkEntry) + private static final org.tensorflow.proto.BenchmarkEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BenchmarkEntry(); + } + + public static org.tensorflow.proto.BenchmarkEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BenchmarkEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BenchmarkEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntryOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntryOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntryOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntryOrBuilder.java index 475b3e31b7c..9e699bd4b76 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/BenchmarkEntryOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BenchmarkEntryOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface BenchmarkEntryOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.BenchmarkEntry) @@ -14,6 +16,7 @@ public interface BenchmarkEntryOrBuilder extends * * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -23,6 +26,7 @@ public interface BenchmarkEntryOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -33,6 +37,7 @@ public interface BenchmarkEntryOrBuilder extends * * * int64 iters = 2; + * @return The iters. */ long getIters(); @@ -42,6 +47,7 @@ public interface BenchmarkEntryOrBuilder extends * * * double cpu_time = 3; + * @return The cpuTime. */ double getCpuTime(); @@ -51,6 +57,7 @@ public interface BenchmarkEntryOrBuilder extends * * * double wall_time = 4; + * @return The wallTime. */ double getWallTime(); @@ -60,6 +67,7 @@ public interface BenchmarkEntryOrBuilder extends * * * double throughput = 5; + * @return The throughput. */ double getThroughput(); @@ -84,7 +92,7 @@ boolean containsExtras( * Use {@link #getExtrasMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getExtras(); /** *
    @@ -93,7 +101,7 @@ boolean containsExtras(
        *
        * map<string, .tensorflow.EntryValue> extras = 6;
        */
    -  java.util.Map
    +  java.util.Map
       getExtrasMap();
       /**
        * 
    @@ -102,10 +110,11 @@ boolean containsExtras(
        *
        * map<string, .tensorflow.EntryValue> extras = 6;
        */
    -
    -  org.tensorflow.proto.util.testlog.EntryValue getExtrasOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.EntryValue getExtrasOrDefault(
           java.lang.String key,
    -      org.tensorflow.proto.util.testlog.EntryValue defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.EntryValue defaultValue);
       /**
        * 
        * Generic map from result key to value.
    @@ -113,8 +122,7 @@ org.tensorflow.proto.util.testlog.EntryValue getExtrasOrDefault(
        *
        * map<string, .tensorflow.EntryValue> extras = 6;
        */
    -
    -  org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow(
    +  org.tensorflow.proto.EntryValue getExtrasOrThrow(
           java.lang.String key);
     
       /**
    @@ -125,7 +133,7 @@ org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow(
        *
        * repeated .tensorflow.MetricEntry metrics = 7;
        */
    -  java.util.List 
    +  java.util.List 
           getMetricsList();
       /**
        * 
    @@ -135,7 +143,7 @@ org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow(
        *
        * repeated .tensorflow.MetricEntry metrics = 7;
        */
    -  org.tensorflow.proto.util.testlog.MetricEntry getMetrics(int index);
    +  org.tensorflow.proto.MetricEntry getMetrics(int index);
       /**
        * 
        * Metric name, value and expected range. This can include accuracy metrics
    @@ -153,7 +161,7 @@ org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow(
        *
        * repeated .tensorflow.MetricEntry metrics = 7;
        */
    -  java.util.List 
    +  java.util.List 
           getMetricsOrBuilderList();
       /**
        * 
    @@ -163,6 +171,6 @@ org.tensorflow.proto.util.testlog.EntryValue getExtrasOrThrow(
        *
        * repeated .tensorflow.MetricEntry metrics = 7;
        */
    -  org.tensorflow.proto.util.testlog.MetricEntryOrBuilder getMetricsOrBuilder(
    +  org.tensorflow.proto.MetricEntryOrBuilder getMetricsOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BfcMemoryMap.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BfcMemoryMap.java
    new file mode 100644
    index 00000000000..d84aebde9c7
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BfcMemoryMap.java
    @@ -0,0 +1,5033 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/bfc_memory_map.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class BfcMemoryMap {
    +  private BfcMemoryMap() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      BfcMemoryMap.class.getName());
    +  }
    +  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 MemAllocatorStatsOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.MemAllocatorStats)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * int64 num_allocs = 1;
    +     * @return The numAllocs.
    +     */
    +    long getNumAllocs();
    +
    +    /**
    +     * int64 bytes_in_use = 2;
    +     * @return The bytesInUse.
    +     */
    +    long getBytesInUse();
    +
    +    /**
    +     * int64 peak_bytes_in_use = 3;
    +     * @return The peakBytesInUse.
    +     */
    +    long getPeakBytesInUse();
    +
    +    /**
    +     * int64 largest_alloc_size = 4;
    +     * @return The largestAllocSize.
    +     */
    +    long getLargestAllocSize();
    +
    +    /**
    +     * float fragmentation_metric = 5;
    +     * @return The fragmentationMetric.
    +     */
    +    float getFragmentationMetric();
    +  }
    +  /**
    +   * 
    +   * Some of the data from AllocatorStats
    +   * 
    + * + * Protobuf type {@code tensorflow.MemAllocatorStats} + */ + public static final class MemAllocatorStats extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemAllocatorStats) + MemAllocatorStatsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemAllocatorStats.class.getName()); + } + // Use MemAllocatorStats.newBuilder() to construct. + private MemAllocatorStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemAllocatorStats() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemAllocatorStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.class, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder.class); + } + + public static final int NUM_ALLOCS_FIELD_NUMBER = 1; + private long numAllocs_ = 0L; + /** + * int64 num_allocs = 1; + * @return The numAllocs. + */ + @java.lang.Override + public long getNumAllocs() { + return numAllocs_; + } + + public static final int BYTES_IN_USE_FIELD_NUMBER = 2; + private long bytesInUse_ = 0L; + /** + * int64 bytes_in_use = 2; + * @return The bytesInUse. + */ + @java.lang.Override + public long getBytesInUse() { + return bytesInUse_; + } + + public static final int PEAK_BYTES_IN_USE_FIELD_NUMBER = 3; + private long peakBytesInUse_ = 0L; + /** + * int64 peak_bytes_in_use = 3; + * @return The peakBytesInUse. + */ + @java.lang.Override + public long getPeakBytesInUse() { + return peakBytesInUse_; + } + + public static final int LARGEST_ALLOC_SIZE_FIELD_NUMBER = 4; + private long largestAllocSize_ = 0L; + /** + * int64 largest_alloc_size = 4; + * @return The largestAllocSize. + */ + @java.lang.Override + public long getLargestAllocSize() { + return largestAllocSize_; + } + + public static final int FRAGMENTATION_METRIC_FIELD_NUMBER = 5; + private float fragmentationMetric_ = 0F; + /** + * float fragmentation_metric = 5; + * @return The fragmentationMetric. + */ + @java.lang.Override + public float getFragmentationMetric() { + return fragmentationMetric_; + } + + 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 (numAllocs_ != 0L) { + output.writeInt64(1, numAllocs_); + } + if (bytesInUse_ != 0L) { + output.writeInt64(2, bytesInUse_); + } + if (peakBytesInUse_ != 0L) { + output.writeInt64(3, peakBytesInUse_); + } + if (largestAllocSize_ != 0L) { + output.writeInt64(4, largestAllocSize_); + } + if (java.lang.Float.floatToRawIntBits(fragmentationMetric_) != 0) { + output.writeFloat(5, fragmentationMetric_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numAllocs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, numAllocs_); + } + if (bytesInUse_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, bytesInUse_); + } + if (peakBytesInUse_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, peakBytesInUse_); + } + if (largestAllocSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, largestAllocSize_); + } + if (java.lang.Float.floatToRawIntBits(fragmentationMetric_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(5, fragmentationMetric_); + } + size += getUnknownFields().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.BfcMemoryMap.MemAllocatorStats)) { + return super.equals(obj); + } + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats other = (org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats) obj; + + if (getNumAllocs() + != other.getNumAllocs()) return false; + if (getBytesInUse() + != other.getBytesInUse()) return false; + if (getPeakBytesInUse() + != other.getPeakBytesInUse()) return false; + if (getLargestAllocSize() + != other.getLargestAllocSize()) return false; + if (java.lang.Float.floatToIntBits(getFragmentationMetric()) + != java.lang.Float.floatToIntBits( + other.getFragmentationMetric())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_ALLOCS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumAllocs()); + hash = (37 * hash) + BYTES_IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBytesInUse()); + hash = (37 * hash) + PEAK_BYTES_IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPeakBytesInUse()); + hash = (37 * hash) + LARGEST_ALLOC_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLargestAllocSize()); + hash = (37 * hash) + FRAGMENTATION_METRIC_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFragmentationMetric()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats 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.BfcMemoryMap.MemAllocatorStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats 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.BfcMemoryMap.MemAllocatorStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BfcMemoryMap.MemAllocatorStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Some of the data from AllocatorStats
    +     * 
    + * + * Protobuf type {@code tensorflow.MemAllocatorStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemAllocatorStats) + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemAllocatorStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.class, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder.class); + } + + // Construct using org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numAllocs_ = 0L; + bytesInUse_ = 0L; + peakBytesInUse_ = 0L; + largestAllocSize_ = 0L; + fragmentationMetric_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemAllocatorStats_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats getDefaultInstanceForType() { + return org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats build() { + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats buildPartial() { + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats result = new org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numAllocs_ = numAllocs_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bytesInUse_ = bytesInUse_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.peakBytesInUse_ = peakBytesInUse_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.largestAllocSize_ = largestAllocSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fragmentationMetric_ = fragmentationMetric_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats) { + return mergeFrom((org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats other) { + if (other == org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance()) return this; + if (other.getNumAllocs() != 0L) { + setNumAllocs(other.getNumAllocs()); + } + if (other.getBytesInUse() != 0L) { + setBytesInUse(other.getBytesInUse()); + } + if (other.getPeakBytesInUse() != 0L) { + setPeakBytesInUse(other.getPeakBytesInUse()); + } + if (other.getLargestAllocSize() != 0L) { + setLargestAllocSize(other.getLargestAllocSize()); + } + if (other.getFragmentationMetric() != 0F) { + setFragmentationMetric(other.getFragmentationMetric()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + numAllocs_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + bytesInUse_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + peakBytesInUse_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + largestAllocSize_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 45: { + fragmentationMetric_ = input.readFloat(); + bitField0_ |= 0x00000010; + break; + } // case 45 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long numAllocs_ ; + /** + * int64 num_allocs = 1; + * @return The numAllocs. + */ + @java.lang.Override + public long getNumAllocs() { + return numAllocs_; + } + /** + * int64 num_allocs = 1; + * @param value The numAllocs to set. + * @return This builder for chaining. + */ + public Builder setNumAllocs(long value) { + + numAllocs_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 num_allocs = 1; + * @return This builder for chaining. + */ + public Builder clearNumAllocs() { + bitField0_ = (bitField0_ & ~0x00000001); + numAllocs_ = 0L; + onChanged(); + return this; + } + + private long bytesInUse_ ; + /** + * int64 bytes_in_use = 2; + * @return The bytesInUse. + */ + @java.lang.Override + public long getBytesInUse() { + return bytesInUse_; + } + /** + * int64 bytes_in_use = 2; + * @param value The bytesInUse to set. + * @return This builder for chaining. + */ + public Builder setBytesInUse(long value) { + + bytesInUse_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 bytes_in_use = 2; + * @return This builder for chaining. + */ + public Builder clearBytesInUse() { + bitField0_ = (bitField0_ & ~0x00000002); + bytesInUse_ = 0L; + onChanged(); + return this; + } + + private long peakBytesInUse_ ; + /** + * int64 peak_bytes_in_use = 3; + * @return The peakBytesInUse. + */ + @java.lang.Override + public long getPeakBytesInUse() { + return peakBytesInUse_; + } + /** + * int64 peak_bytes_in_use = 3; + * @param value The peakBytesInUse to set. + * @return This builder for chaining. + */ + public Builder setPeakBytesInUse(long value) { + + peakBytesInUse_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 peak_bytes_in_use = 3; + * @return This builder for chaining. + */ + public Builder clearPeakBytesInUse() { + bitField0_ = (bitField0_ & ~0x00000004); + peakBytesInUse_ = 0L; + onChanged(); + return this; + } + + private long largestAllocSize_ ; + /** + * int64 largest_alloc_size = 4; + * @return The largestAllocSize. + */ + @java.lang.Override + public long getLargestAllocSize() { + return largestAllocSize_; + } + /** + * int64 largest_alloc_size = 4; + * @param value The largestAllocSize to set. + * @return This builder for chaining. + */ + public Builder setLargestAllocSize(long value) { + + largestAllocSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 largest_alloc_size = 4; + * @return This builder for chaining. + */ + public Builder clearLargestAllocSize() { + bitField0_ = (bitField0_ & ~0x00000008); + largestAllocSize_ = 0L; + onChanged(); + return this; + } + + private float fragmentationMetric_ ; + /** + * float fragmentation_metric = 5; + * @return The fragmentationMetric. + */ + @java.lang.Override + public float getFragmentationMetric() { + return fragmentationMetric_; + } + /** + * float fragmentation_metric = 5; + * @param value The fragmentationMetric to set. + * @return This builder for chaining. + */ + public Builder setFragmentationMetric(float value) { + + fragmentationMetric_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * float fragmentation_metric = 5; + * @return This builder for chaining. + */ + public Builder clearFragmentationMetric() { + bitField0_ = (bitField0_ & ~0x00000010); + fragmentationMetric_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemAllocatorStats) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemAllocatorStats) + private static final org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats(); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemAllocatorStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BfcMemoryMap.MemAllocatorStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MemChunkOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MemChunk) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 address = 1; + * @return The address. + */ + long getAddress(); + + /** + * int64 size = 2; + * @return The size. + */ + long getSize(); + + /** + * int64 requested_size = 3; + * @return The requestedSize. + */ + long getRequestedSize(); + + /** + * int32 bin = 4; + * @return The bin. + */ + int getBin(); + + /** + * string op_name = 5; + * @return The opName. + */ + java.lang.String getOpName(); + /** + * string op_name = 5; + * @return The bytes for opName. + */ + com.google.protobuf.ByteString + getOpNameBytes(); + + /** + * uint64 freed_at_count = 6; + * @return The freedAtCount. + */ + long getFreedAtCount(); + + /** + * uint64 action_count = 7; + * @return The actionCount. + */ + long getActionCount(); + + /** + * bool in_use = 8; + * @return The inUse. + */ + boolean getInUse(); + + /** + * uint64 step_id = 9; + * @return The stepId. + */ + long getStepId(); + } + /** + * Protobuf type {@code tensorflow.MemChunk} + */ + public static final class MemChunk extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemChunk) + MemChunkOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemChunk.class.getName()); + } + // Use MemChunk.newBuilder() to construct. + private MemChunk(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemChunk() { + opName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemChunk.class, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder.class); + } + + public static final int ADDRESS_FIELD_NUMBER = 1; + private long address_ = 0L; + /** + * uint64 address = 1; + * @return The address. + */ + @java.lang.Override + public long getAddress() { + return address_; + } + + public static final int SIZE_FIELD_NUMBER = 2; + private long size_ = 0L; + /** + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int REQUESTED_SIZE_FIELD_NUMBER = 3; + private long requestedSize_ = 0L; + /** + * int64 requested_size = 3; + * @return The requestedSize. + */ + @java.lang.Override + public long getRequestedSize() { + return requestedSize_; + } + + public static final int BIN_FIELD_NUMBER = 4; + private int bin_ = 0; + /** + * int32 bin = 4; + * @return The bin. + */ + @java.lang.Override + public int getBin() { + return bin_; + } + + public static final int OP_NAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object opName_ = ""; + /** + * string op_name = 5; + * @return The opName. + */ + @java.lang.Override + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + 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(); + opName_ = s; + return s; + } + } + /** + * string op_name = 5; + * @return The bytes for opName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FREED_AT_COUNT_FIELD_NUMBER = 6; + private long freedAtCount_ = 0L; + /** + * uint64 freed_at_count = 6; + * @return The freedAtCount. + */ + @java.lang.Override + public long getFreedAtCount() { + return freedAtCount_; + } + + public static final int ACTION_COUNT_FIELD_NUMBER = 7; + private long actionCount_ = 0L; + /** + * uint64 action_count = 7; + * @return The actionCount. + */ + @java.lang.Override + public long getActionCount() { + return actionCount_; + } + + public static final int IN_USE_FIELD_NUMBER = 8; + private boolean inUse_ = false; + /** + * bool in_use = 8; + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + + public static final int STEP_ID_FIELD_NUMBER = 9; + private long stepId_ = 0L; + /** + * uint64 step_id = 9; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + 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 (address_ != 0L) { + output.writeUInt64(1, address_); + } + if (size_ != 0L) { + output.writeInt64(2, size_); + } + if (requestedSize_ != 0L) { + output.writeInt64(3, requestedSize_); + } + if (bin_ != 0) { + output.writeInt32(4, bin_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, opName_); + } + if (freedAtCount_ != 0L) { + output.writeUInt64(6, freedAtCount_); + } + if (actionCount_ != 0L) { + output.writeUInt64(7, actionCount_); + } + if (inUse_ != false) { + output.writeBool(8, inUse_); + } + if (stepId_ != 0L) { + output.writeUInt64(9, stepId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (address_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, address_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, size_); + } + if (requestedSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, requestedSize_); + } + if (bin_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, bin_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, opName_); + } + if (freedAtCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, freedAtCount_); + } + if (actionCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(7, actionCount_); + } + if (inUse_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, inUse_); + } + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(9, stepId_); + } + size += getUnknownFields().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.BfcMemoryMap.MemChunk)) { + return super.equals(obj); + } + org.tensorflow.proto.BfcMemoryMap.MemChunk other = (org.tensorflow.proto.BfcMemoryMap.MemChunk) obj; + + if (getAddress() + != other.getAddress()) return false; + if (getSize() + != other.getSize()) return false; + if (getRequestedSize() + != other.getRequestedSize()) return false; + if (getBin() + != other.getBin()) return false; + if (!getOpName() + .equals(other.getOpName())) return false; + if (getFreedAtCount() + != other.getFreedAtCount()) return false; + if (getActionCount() + != other.getActionCount()) return false; + if (getInUse() + != other.getInUse()) return false; + if (getStepId() + != other.getStepId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAddress()); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + REQUESTED_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRequestedSize()); + hash = (37 * hash) + BIN_FIELD_NUMBER; + hash = (53 * hash) + getBin(); + hash = (37 * hash) + OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOpName().hashCode(); + hash = (37 * hash) + FREED_AT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFreedAtCount()); + hash = (37 * hash) + ACTION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getActionCount()); + hash = (37 * hash) + IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInUse()); + hash = (37 * hash) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk 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.BfcMemoryMap.MemChunk parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk 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.BfcMemoryMap.MemChunk parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemChunk parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BfcMemoryMap.MemChunk 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemChunk} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemChunk) + org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemChunk_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemChunk_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemChunk.class, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder.class); + } + + // Construct using org.tensorflow.proto.BfcMemoryMap.MemChunk.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + address_ = 0L; + size_ = 0L; + requestedSize_ = 0L; + bin_ = 0; + opName_ = ""; + freedAtCount_ = 0L; + actionCount_ = 0L; + inUse_ = false; + stepId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemChunk_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemChunk getDefaultInstanceForType() { + return org.tensorflow.proto.BfcMemoryMap.MemChunk.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemChunk build() { + org.tensorflow.proto.BfcMemoryMap.MemChunk result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemChunk buildPartial() { + org.tensorflow.proto.BfcMemoryMap.MemChunk result = new org.tensorflow.proto.BfcMemoryMap.MemChunk(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BfcMemoryMap.MemChunk result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestedSize_ = requestedSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bin_ = bin_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.opName_ = opName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.freedAtCount_ = freedAtCount_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.actionCount_ = actionCount_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.inUse_ = inUse_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.stepId_ = stepId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BfcMemoryMap.MemChunk) { + return mergeFrom((org.tensorflow.proto.BfcMemoryMap.MemChunk)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BfcMemoryMap.MemChunk other) { + if (other == org.tensorflow.proto.BfcMemoryMap.MemChunk.getDefaultInstance()) return this; + if (other.getAddress() != 0L) { + setAddress(other.getAddress()); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (other.getRequestedSize() != 0L) { + setRequestedSize(other.getRequestedSize()); + } + if (other.getBin() != 0) { + setBin(other.getBin()); + } + if (!other.getOpName().isEmpty()) { + opName_ = other.opName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getFreedAtCount() != 0L) { + setFreedAtCount(other.getFreedAtCount()); + } + if (other.getActionCount() != 0L) { + setActionCount(other.getActionCount()); + } + if (other.getInUse() != false) { + setInUse(other.getInUse()); + } + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + address_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + size_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + requestedSize_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + bin_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + opName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + freedAtCount_ = input.readUInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + actionCount_ = input.readUInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + inUse_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + stepId_ = input.readUInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long address_ ; + /** + * uint64 address = 1; + * @return The address. + */ + @java.lang.Override + public long getAddress() { + return address_; + } + /** + * uint64 address = 1; + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(long value) { + + address_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 address = 1; + * @return This builder for chaining. + */ + public Builder clearAddress() { + bitField0_ = (bitField0_ & ~0x00000001); + address_ = 0L; + onChanged(); + return this; + } + + private long size_ ; + /** + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * int64 size = 2; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 size = 2; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000002); + size_ = 0L; + onChanged(); + return this; + } + + private long requestedSize_ ; + /** + * int64 requested_size = 3; + * @return The requestedSize. + */ + @java.lang.Override + public long getRequestedSize() { + return requestedSize_; + } + /** + * int64 requested_size = 3; + * @param value The requestedSize to set. + * @return This builder for chaining. + */ + public Builder setRequestedSize(long value) { + + requestedSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 requested_size = 3; + * @return This builder for chaining. + */ + public Builder clearRequestedSize() { + bitField0_ = (bitField0_ & ~0x00000004); + requestedSize_ = 0L; + onChanged(); + return this; + } + + private int bin_ ; + /** + * int32 bin = 4; + * @return The bin. + */ + @java.lang.Override + public int getBin() { + return bin_; + } + /** + * int32 bin = 4; + * @param value The bin to set. + * @return This builder for chaining. + */ + public Builder setBin(int value) { + + bin_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 bin = 4; + * @return This builder for chaining. + */ + public Builder clearBin() { + bitField0_ = (bitField0_ & ~0x00000008); + bin_ = 0; + onChanged(); + return this; + } + + private java.lang.Object opName_ = ""; + /** + * string op_name = 5; + * @return The opName. + */ + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string op_name = 5; + * @return The bytes for opName. + */ + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string op_name = 5; + * @param value The opName to set. + * @return This builder for chaining. + */ + public Builder setOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string op_name = 5; + * @return This builder for chaining. + */ + public Builder clearOpName() { + opName_ = getDefaultInstance().getOpName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string op_name = 5; + * @param value The bytes for opName to set. + * @return This builder for chaining. + */ + public Builder setOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private long freedAtCount_ ; + /** + * uint64 freed_at_count = 6; + * @return The freedAtCount. + */ + @java.lang.Override + public long getFreedAtCount() { + return freedAtCount_; + } + /** + * uint64 freed_at_count = 6; + * @param value The freedAtCount to set. + * @return This builder for chaining. + */ + public Builder setFreedAtCount(long value) { + + freedAtCount_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * uint64 freed_at_count = 6; + * @return This builder for chaining. + */ + public Builder clearFreedAtCount() { + bitField0_ = (bitField0_ & ~0x00000020); + freedAtCount_ = 0L; + onChanged(); + return this; + } + + private long actionCount_ ; + /** + * uint64 action_count = 7; + * @return The actionCount. + */ + @java.lang.Override + public long getActionCount() { + return actionCount_; + } + /** + * uint64 action_count = 7; + * @param value The actionCount to set. + * @return This builder for chaining. + */ + public Builder setActionCount(long value) { + + actionCount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * uint64 action_count = 7; + * @return This builder for chaining. + */ + public Builder clearActionCount() { + bitField0_ = (bitField0_ & ~0x00000040); + actionCount_ = 0L; + onChanged(); + return this; + } + + private boolean inUse_ ; + /** + * bool in_use = 8; + * @return The inUse. + */ + @java.lang.Override + public boolean getInUse() { + return inUse_; + } + /** + * bool in_use = 8; + * @param value The inUse to set. + * @return This builder for chaining. + */ + public Builder setInUse(boolean value) { + + inUse_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * bool in_use = 8; + * @return This builder for chaining. + */ + public Builder clearInUse() { + bitField0_ = (bitField0_ & ~0x00000080); + inUse_ = false; + onChanged(); + return this; + } + + private long stepId_ ; + /** + * uint64 step_id = 9; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + * uint64 step_id = 9; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * uint64 step_id = 9; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000100); + stepId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemChunk) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemChunk) + private static final org.tensorflow.proto.BfcMemoryMap.MemChunk DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BfcMemoryMap.MemChunk(); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemChunk getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemChunk parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BfcMemoryMap.MemChunk getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BinSummaryOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BinSummary) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 bin = 1; + * @return The bin. + */ + int getBin(); + + /** + * int64 total_bytes_in_use = 2; + * @return The totalBytesInUse. + */ + long getTotalBytesInUse(); + + /** + * int64 total_bytes_in_bin = 3; + * @return The totalBytesInBin. + */ + long getTotalBytesInBin(); + + /** + * int64 total_chunks_in_use = 4; + * @return The totalChunksInUse. + */ + long getTotalChunksInUse(); + + /** + * int64 total_chunks_in_bin = 5; + * @return The totalChunksInBin. + */ + long getTotalChunksInBin(); + } + /** + * Protobuf type {@code tensorflow.BinSummary} + */ + public static final class BinSummary extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BinSummary) + BinSummaryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BinSummary.class.getName()); + } + // Use BinSummary.newBuilder() to construct. + private BinSummary(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BinSummary() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_BinSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_BinSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.BinSummary.class, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder.class); + } + + public static final int BIN_FIELD_NUMBER = 1; + private int bin_ = 0; + /** + * int32 bin = 1; + * @return The bin. + */ + @java.lang.Override + public int getBin() { + return bin_; + } + + public static final int TOTAL_BYTES_IN_USE_FIELD_NUMBER = 2; + private long totalBytesInUse_ = 0L; + /** + * int64 total_bytes_in_use = 2; + * @return The totalBytesInUse. + */ + @java.lang.Override + public long getTotalBytesInUse() { + return totalBytesInUse_; + } + + public static final int TOTAL_BYTES_IN_BIN_FIELD_NUMBER = 3; + private long totalBytesInBin_ = 0L; + /** + * int64 total_bytes_in_bin = 3; + * @return The totalBytesInBin. + */ + @java.lang.Override + public long getTotalBytesInBin() { + return totalBytesInBin_; + } + + public static final int TOTAL_CHUNKS_IN_USE_FIELD_NUMBER = 4; + private long totalChunksInUse_ = 0L; + /** + * int64 total_chunks_in_use = 4; + * @return The totalChunksInUse. + */ + @java.lang.Override + public long getTotalChunksInUse() { + return totalChunksInUse_; + } + + public static final int TOTAL_CHUNKS_IN_BIN_FIELD_NUMBER = 5; + private long totalChunksInBin_ = 0L; + /** + * int64 total_chunks_in_bin = 5; + * @return The totalChunksInBin. + */ + @java.lang.Override + public long getTotalChunksInBin() { + return totalChunksInBin_; + } + + 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 (bin_ != 0) { + output.writeInt32(1, bin_); + } + if (totalBytesInUse_ != 0L) { + output.writeInt64(2, totalBytesInUse_); + } + if (totalBytesInBin_ != 0L) { + output.writeInt64(3, totalBytesInBin_); + } + if (totalChunksInUse_ != 0L) { + output.writeInt64(4, totalChunksInUse_); + } + if (totalChunksInBin_ != 0L) { + output.writeInt64(5, totalChunksInBin_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (bin_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, bin_); + } + if (totalBytesInUse_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, totalBytesInUse_); + } + if (totalBytesInBin_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, totalBytesInBin_); + } + if (totalChunksInUse_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, totalChunksInUse_); + } + if (totalChunksInBin_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, totalChunksInBin_); + } + size += getUnknownFields().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.BfcMemoryMap.BinSummary)) { + return super.equals(obj); + } + org.tensorflow.proto.BfcMemoryMap.BinSummary other = (org.tensorflow.proto.BfcMemoryMap.BinSummary) obj; + + if (getBin() + != other.getBin()) return false; + if (getTotalBytesInUse() + != other.getTotalBytesInUse()) return false; + if (getTotalBytesInBin() + != other.getTotalBytesInBin()) return false; + if (getTotalChunksInUse() + != other.getTotalChunksInUse()) return false; + if (getTotalChunksInBin() + != other.getTotalChunksInBin()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BIN_FIELD_NUMBER; + hash = (53 * hash) + getBin(); + hash = (37 * hash) + TOTAL_BYTES_IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalBytesInUse()); + hash = (37 * hash) + TOTAL_BYTES_IN_BIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalBytesInBin()); + hash = (37 * hash) + TOTAL_CHUNKS_IN_USE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalChunksInUse()); + hash = (37 * hash) + TOTAL_CHUNKS_IN_BIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalChunksInBin()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary 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.BfcMemoryMap.BinSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary 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.BfcMemoryMap.BinSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.BinSummary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BfcMemoryMap.BinSummary 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.BinSummary} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BinSummary) + org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_BinSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_BinSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.BinSummary.class, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder.class); + } + + // Construct using org.tensorflow.proto.BfcMemoryMap.BinSummary.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bin_ = 0; + totalBytesInUse_ = 0L; + totalBytesInBin_ = 0L; + totalChunksInUse_ = 0L; + totalChunksInBin_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_BinSummary_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.BinSummary getDefaultInstanceForType() { + return org.tensorflow.proto.BfcMemoryMap.BinSummary.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.BinSummary build() { + org.tensorflow.proto.BfcMemoryMap.BinSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.BinSummary buildPartial() { + org.tensorflow.proto.BfcMemoryMap.BinSummary result = new org.tensorflow.proto.BfcMemoryMap.BinSummary(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BfcMemoryMap.BinSummary result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bin_ = bin_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.totalBytesInUse_ = totalBytesInUse_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.totalBytesInBin_ = totalBytesInBin_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.totalChunksInUse_ = totalChunksInUse_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.totalChunksInBin_ = totalChunksInBin_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BfcMemoryMap.BinSummary) { + return mergeFrom((org.tensorflow.proto.BfcMemoryMap.BinSummary)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BfcMemoryMap.BinSummary other) { + if (other == org.tensorflow.proto.BfcMemoryMap.BinSummary.getDefaultInstance()) return this; + if (other.getBin() != 0) { + setBin(other.getBin()); + } + if (other.getTotalBytesInUse() != 0L) { + setTotalBytesInUse(other.getTotalBytesInUse()); + } + if (other.getTotalBytesInBin() != 0L) { + setTotalBytesInBin(other.getTotalBytesInBin()); + } + if (other.getTotalChunksInUse() != 0L) { + setTotalChunksInUse(other.getTotalChunksInUse()); + } + if (other.getTotalChunksInBin() != 0L) { + setTotalChunksInBin(other.getTotalChunksInBin()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bin_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + totalBytesInUse_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + totalBytesInBin_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + totalChunksInUse_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + totalChunksInBin_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int bin_ ; + /** + * int32 bin = 1; + * @return The bin. + */ + @java.lang.Override + public int getBin() { + return bin_; + } + /** + * int32 bin = 1; + * @param value The bin to set. + * @return This builder for chaining. + */ + public Builder setBin(int value) { + + bin_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 bin = 1; + * @return This builder for chaining. + */ + public Builder clearBin() { + bitField0_ = (bitField0_ & ~0x00000001); + bin_ = 0; + onChanged(); + return this; + } + + private long totalBytesInUse_ ; + /** + * int64 total_bytes_in_use = 2; + * @return The totalBytesInUse. + */ + @java.lang.Override + public long getTotalBytesInUse() { + return totalBytesInUse_; + } + /** + * int64 total_bytes_in_use = 2; + * @param value The totalBytesInUse to set. + * @return This builder for chaining. + */ + public Builder setTotalBytesInUse(long value) { + + totalBytesInUse_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 total_bytes_in_use = 2; + * @return This builder for chaining. + */ + public Builder clearTotalBytesInUse() { + bitField0_ = (bitField0_ & ~0x00000002); + totalBytesInUse_ = 0L; + onChanged(); + return this; + } + + private long totalBytesInBin_ ; + /** + * int64 total_bytes_in_bin = 3; + * @return The totalBytesInBin. + */ + @java.lang.Override + public long getTotalBytesInBin() { + return totalBytesInBin_; + } + /** + * int64 total_bytes_in_bin = 3; + * @param value The totalBytesInBin to set. + * @return This builder for chaining. + */ + public Builder setTotalBytesInBin(long value) { + + totalBytesInBin_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 total_bytes_in_bin = 3; + * @return This builder for chaining. + */ + public Builder clearTotalBytesInBin() { + bitField0_ = (bitField0_ & ~0x00000004); + totalBytesInBin_ = 0L; + onChanged(); + return this; + } + + private long totalChunksInUse_ ; + /** + * int64 total_chunks_in_use = 4; + * @return The totalChunksInUse. + */ + @java.lang.Override + public long getTotalChunksInUse() { + return totalChunksInUse_; + } + /** + * int64 total_chunks_in_use = 4; + * @param value The totalChunksInUse to set. + * @return This builder for chaining. + */ + public Builder setTotalChunksInUse(long value) { + + totalChunksInUse_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 total_chunks_in_use = 4; + * @return This builder for chaining. + */ + public Builder clearTotalChunksInUse() { + bitField0_ = (bitField0_ & ~0x00000008); + totalChunksInUse_ = 0L; + onChanged(); + return this; + } + + private long totalChunksInBin_ ; + /** + * int64 total_chunks_in_bin = 5; + * @return The totalChunksInBin. + */ + @java.lang.Override + public long getTotalChunksInBin() { + return totalChunksInBin_; + } + /** + * int64 total_chunks_in_bin = 5; + * @param value The totalChunksInBin to set. + * @return This builder for chaining. + */ + public Builder setTotalChunksInBin(long value) { + + totalChunksInBin_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 total_chunks_in_bin = 5; + * @return This builder for chaining. + */ + public Builder clearTotalChunksInBin() { + bitField0_ = (bitField0_ & ~0x00000010); + totalChunksInBin_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BinSummary) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BinSummary) + private static final org.tensorflow.proto.BfcMemoryMap.BinSummary DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BfcMemoryMap.BinSummary(); + } + + public static org.tensorflow.proto.BfcMemoryMap.BinSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BinSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BfcMemoryMap.BinSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SnapShotOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SnapShot) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 action_count = 1; + * @return The actionCount. + */ + long getActionCount(); + + /** + * int64 size = 2; + * @return The size. + */ + long getSize(); + } + /** + * Protobuf type {@code tensorflow.SnapShot} + */ + public static final class SnapShot extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SnapShot) + SnapShotOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SnapShot.class.getName()); + } + // Use SnapShot.newBuilder() to construct. + private SnapShot(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SnapShot() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_SnapShot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_SnapShot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.SnapShot.class, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder.class); + } + + public static final int ACTION_COUNT_FIELD_NUMBER = 1; + private long actionCount_ = 0L; + /** + * uint64 action_count = 1; + * @return The actionCount. + */ + @java.lang.Override + public long getActionCount() { + return actionCount_; + } + + public static final int SIZE_FIELD_NUMBER = 2; + private long size_ = 0L; + /** + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + 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 (actionCount_ != 0L) { + output.writeUInt64(1, actionCount_); + } + if (size_ != 0L) { + output.writeInt64(2, size_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (actionCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, actionCount_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, size_); + } + size += getUnknownFields().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.BfcMemoryMap.SnapShot)) { + return super.equals(obj); + } + org.tensorflow.proto.BfcMemoryMap.SnapShot other = (org.tensorflow.proto.BfcMemoryMap.SnapShot) obj; + + if (getActionCount() + != other.getActionCount()) return false; + if (getSize() + != other.getSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ACTION_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getActionCount()); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot 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.BfcMemoryMap.SnapShot parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot 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.BfcMemoryMap.SnapShot parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.SnapShot parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BfcMemoryMap.SnapShot 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SnapShot} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SnapShot) + org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_SnapShot_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_SnapShot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.SnapShot.class, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder.class); + } + + // Construct using org.tensorflow.proto.BfcMemoryMap.SnapShot.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + actionCount_ = 0L; + size_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_SnapShot_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.SnapShot getDefaultInstanceForType() { + return org.tensorflow.proto.BfcMemoryMap.SnapShot.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.SnapShot build() { + org.tensorflow.proto.BfcMemoryMap.SnapShot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.SnapShot buildPartial() { + org.tensorflow.proto.BfcMemoryMap.SnapShot result = new org.tensorflow.proto.BfcMemoryMap.SnapShot(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BfcMemoryMap.SnapShot result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.actionCount_ = actionCount_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.size_ = size_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BfcMemoryMap.SnapShot) { + return mergeFrom((org.tensorflow.proto.BfcMemoryMap.SnapShot)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BfcMemoryMap.SnapShot other) { + if (other == org.tensorflow.proto.BfcMemoryMap.SnapShot.getDefaultInstance()) return this; + if (other.getActionCount() != 0L) { + setActionCount(other.getActionCount()); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + actionCount_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + size_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long actionCount_ ; + /** + * uint64 action_count = 1; + * @return The actionCount. + */ + @java.lang.Override + public long getActionCount() { + return actionCount_; + } + /** + * uint64 action_count = 1; + * @param value The actionCount to set. + * @return This builder for chaining. + */ + public Builder setActionCount(long value) { + + actionCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 action_count = 1; + * @return This builder for chaining. + */ + public Builder clearActionCount() { + bitField0_ = (bitField0_ & ~0x00000001); + actionCount_ = 0L; + onChanged(); + return this; + } + + private long size_ ; + /** + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * int64 size = 2; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 size = 2; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000002); + size_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SnapShot) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SnapShot) + private static final org.tensorflow.proto.BfcMemoryMap.SnapShot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BfcMemoryMap.SnapShot(); + } + + public static org.tensorflow.proto.BfcMemoryMap.SnapShot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapShot parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BfcMemoryMap.SnapShot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MemoryDumpOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MemoryDump) + com.google.protobuf.MessageOrBuilder { + + /** + * string allocator_name = 1; + * @return The allocatorName. + */ + java.lang.String getAllocatorName(); + /** + * string allocator_name = 1; + * @return The bytes for allocatorName. + */ + com.google.protobuf.ByteString + getAllocatorNameBytes(); + + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + java.util.List + getBinSummaryList(); + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + org.tensorflow.proto.BfcMemoryMap.BinSummary getBinSummary(int index); + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + int getBinSummaryCount(); + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + java.util.List + getBinSummaryOrBuilderList(); + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder getBinSummaryOrBuilder( + int index); + + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + java.util.List + getChunkList(); + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + org.tensorflow.proto.BfcMemoryMap.MemChunk getChunk(int index); + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + int getChunkCount(); + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + java.util.List + getChunkOrBuilderList(); + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder getChunkOrBuilder( + int index); + + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + java.util.List + getSnapShotList(); + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + org.tensorflow.proto.BfcMemoryMap.SnapShot getSnapShot(int index); + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + int getSnapShotCount(); + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + java.util.List + getSnapShotOrBuilderList(); + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder getSnapShotOrBuilder( + int index); + + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return The stats. + */ + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats getStats(); + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder getStatsOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.MemoryDump} + */ + public static final class MemoryDump extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryDump) + MemoryDumpOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryDump.class.getName()); + } + // Use MemoryDump.newBuilder() to construct. + private MemoryDump(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryDump() { + allocatorName_ = ""; + binSummary_ = java.util.Collections.emptyList(); + chunk_ = java.util.Collections.emptyList(); + snapShot_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemoryDump_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemoryDump_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemoryDump.class, org.tensorflow.proto.BfcMemoryMap.MemoryDump.Builder.class); + } + + private int bitField0_; + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + * string allocator_name = 1; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + * string allocator_name = 1; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BIN_SUMMARY_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List binSummary_; + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + @java.lang.Override + public java.util.List getBinSummaryList() { + return binSummary_; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + @java.lang.Override + public java.util.List + getBinSummaryOrBuilderList() { + return binSummary_; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + @java.lang.Override + public int getBinSummaryCount() { + return binSummary_.size(); + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.BinSummary getBinSummary(int index) { + return binSummary_.get(index); + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder getBinSummaryOrBuilder( + int index) { + return binSummary_.get(index); + } + + public static final int CHUNK_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List chunk_; + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + @java.lang.Override + public java.util.List getChunkList() { + return chunk_; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + @java.lang.Override + public java.util.List + getChunkOrBuilderList() { + return chunk_; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + @java.lang.Override + public int getChunkCount() { + return chunk_.size(); + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemChunk getChunk(int index) { + return chunk_.get(index); + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder getChunkOrBuilder( + int index) { + return chunk_.get(index); + } + + public static final int SNAP_SHOT_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List snapShot_; + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + @java.lang.Override + public java.util.List getSnapShotList() { + return snapShot_; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + @java.lang.Override + public java.util.List + getSnapShotOrBuilderList() { + return snapShot_; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + @java.lang.Override + public int getSnapShotCount() { + return snapShot_.size(); + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.SnapShot getSnapShot(int index) { + return snapShot_.get(index); + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder getSnapShotOrBuilder( + int index) { + return snapShot_.get(index); + } + + public static final int STATS_FIELD_NUMBER = 5; + private org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats stats_; + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return The stats. + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats getStats() { + return stats_ == null ? org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance() : stats_; + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance() : stats_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, allocatorName_); + } + for (int i = 0; i < binSummary_.size(); i++) { + output.writeMessage(2, binSummary_.get(i)); + } + for (int i = 0; i < chunk_.size(); i++) { + output.writeMessage(3, chunk_.get(i)); + } + for (int i = 0; i < snapShot_.size(); i++) { + output.writeMessage(4, snapShot_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, allocatorName_); + } + for (int i = 0; i < binSummary_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, binSummary_.get(i)); + } + for (int i = 0; i < chunk_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, chunk_.get(i)); + } + for (int i = 0; i < snapShot_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, snapShot_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getStats()); + } + size += getUnknownFields().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.BfcMemoryMap.MemoryDump)) { + return super.equals(obj); + } + org.tensorflow.proto.BfcMemoryMap.MemoryDump other = (org.tensorflow.proto.BfcMemoryMap.MemoryDump) obj; + + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (!getBinSummaryList() + .equals(other.getBinSummaryList())) return false; + if (!getChunkList() + .equals(other.getChunkList())) return false; + if (!getSnapShotList() + .equals(other.getSnapShotList())) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats() + .equals(other.getStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + if (getBinSummaryCount() > 0) { + hash = (37 * hash) + BIN_SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getBinSummaryList().hashCode(); + } + if (getChunkCount() > 0) { + hash = (37 * hash) + CHUNK_FIELD_NUMBER; + hash = (53 * hash) + getChunkList().hashCode(); + } + if (getSnapShotCount() > 0) { + hash = (37 * hash) + SNAP_SHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapShotList().hashCode(); + } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump 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.BfcMemoryMap.MemoryDump parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump 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.BfcMemoryMap.MemoryDump parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BfcMemoryMap.MemoryDump 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryDump} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryDump) + org.tensorflow.proto.BfcMemoryMap.MemoryDumpOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemoryDump_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemoryDump_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BfcMemoryMap.MemoryDump.class, org.tensorflow.proto.BfcMemoryMap.MemoryDump.Builder.class); + } + + // Construct using org.tensorflow.proto.BfcMemoryMap.MemoryDump.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getBinSummaryFieldBuilder(); + getChunkFieldBuilder(); + getSnapShotFieldBuilder(); + getStatsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allocatorName_ = ""; + if (binSummaryBuilder_ == null) { + binSummary_ = java.util.Collections.emptyList(); + } else { + binSummary_ = null; + binSummaryBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (chunkBuilder_ == null) { + chunk_ = java.util.Collections.emptyList(); + } else { + chunk_ = null; + chunkBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (snapShotBuilder_ == null) { + snapShot_ = java.util.Collections.emptyList(); + } else { + snapShot_ = null; + snapShotBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.BfcMemoryMap.internal_static_tensorflow_MemoryDump_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemoryDump getDefaultInstanceForType() { + return org.tensorflow.proto.BfcMemoryMap.MemoryDump.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemoryDump build() { + org.tensorflow.proto.BfcMemoryMap.MemoryDump result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BfcMemoryMap.MemoryDump buildPartial() { + org.tensorflow.proto.BfcMemoryMap.MemoryDump result = new org.tensorflow.proto.BfcMemoryMap.MemoryDump(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.BfcMemoryMap.MemoryDump result) { + if (binSummaryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + binSummary_ = java.util.Collections.unmodifiableList(binSummary_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.binSummary_ = binSummary_; + } else { + result.binSummary_ = binSummaryBuilder_.build(); + } + if (chunkBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + chunk_ = java.util.Collections.unmodifiableList(chunk_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.chunk_ = chunk_; + } else { + result.chunk_ = chunkBuilder_.build(); + } + if (snapShotBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + snapShot_ = java.util.Collections.unmodifiableList(snapShot_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.snapShot_ = snapShot_; + } else { + result.snapShot_ = snapShotBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.BfcMemoryMap.MemoryDump result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allocatorName_ = allocatorName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.stats_ = statsBuilder_ == null + ? stats_ + : statsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BfcMemoryMap.MemoryDump) { + return mergeFrom((org.tensorflow.proto.BfcMemoryMap.MemoryDump)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BfcMemoryMap.MemoryDump other) { + if (other == org.tensorflow.proto.BfcMemoryMap.MemoryDump.getDefaultInstance()) return this; + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (binSummaryBuilder_ == null) { + if (!other.binSummary_.isEmpty()) { + if (binSummary_.isEmpty()) { + binSummary_ = other.binSummary_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureBinSummaryIsMutable(); + binSummary_.addAll(other.binSummary_); + } + onChanged(); + } + } else { + if (!other.binSummary_.isEmpty()) { + if (binSummaryBuilder_.isEmpty()) { + binSummaryBuilder_.dispose(); + binSummaryBuilder_ = null; + binSummary_ = other.binSummary_; + bitField0_ = (bitField0_ & ~0x00000002); + binSummaryBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getBinSummaryFieldBuilder() : null; + } else { + binSummaryBuilder_.addAllMessages(other.binSummary_); + } + } + } + if (chunkBuilder_ == null) { + if (!other.chunk_.isEmpty()) { + if (chunk_.isEmpty()) { + chunk_ = other.chunk_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureChunkIsMutable(); + chunk_.addAll(other.chunk_); + } + onChanged(); + } + } else { + if (!other.chunk_.isEmpty()) { + if (chunkBuilder_.isEmpty()) { + chunkBuilder_.dispose(); + chunkBuilder_ = null; + chunk_ = other.chunk_; + bitField0_ = (bitField0_ & ~0x00000004); + chunkBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getChunkFieldBuilder() : null; + } else { + chunkBuilder_.addAllMessages(other.chunk_); + } + } + } + if (snapShotBuilder_ == null) { + if (!other.snapShot_.isEmpty()) { + if (snapShot_.isEmpty()) { + snapShot_ = other.snapShot_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSnapShotIsMutable(); + snapShot_.addAll(other.snapShot_); + } + onChanged(); + } + } else { + if (!other.snapShot_.isEmpty()) { + if (snapShotBuilder_.isEmpty()) { + snapShotBuilder_.dispose(); + snapShotBuilder_ = null; + snapShot_ = other.snapShot_; + bitField0_ = (bitField0_ & ~0x00000008); + snapShotBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSnapShotFieldBuilder() : null; + } else { + snapShotBuilder_.addAllMessages(other.snapShot_); + } + } + } + if (other.hasStats()) { + mergeStats(other.getStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.BfcMemoryMap.BinSummary m = + input.readMessage( + org.tensorflow.proto.BfcMemoryMap.BinSummary.parser(), + extensionRegistry); + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + binSummary_.add(m); + } else { + binSummaryBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + org.tensorflow.proto.BfcMemoryMap.MemChunk m = + input.readMessage( + org.tensorflow.proto.BfcMemoryMap.MemChunk.parser(), + extensionRegistry); + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + chunk_.add(m); + } else { + chunkBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + org.tensorflow.proto.BfcMemoryMap.SnapShot m = + input.readMessage( + org.tensorflow.proto.BfcMemoryMap.SnapShot.parser(), + extensionRegistry); + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + snapShot_.add(m); + } else { + snapShotBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + input.readMessage( + getStatsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object allocatorName_ = ""; + /** + * string allocator_name = 1; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string allocator_name = 1; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string allocator_name = 1; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string allocator_name = 1; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string allocator_name = 1; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List binSummary_ = + java.util.Collections.emptyList(); + private void ensureBinSummaryIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + binSummary_ = new java.util.ArrayList(binSummary_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.BinSummary, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder, org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder> binSummaryBuilder_; + + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public java.util.List getBinSummaryList() { + if (binSummaryBuilder_ == null) { + return java.util.Collections.unmodifiableList(binSummary_); + } else { + return binSummaryBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public int getBinSummaryCount() { + if (binSummaryBuilder_ == null) { + return binSummary_.size(); + } else { + return binSummaryBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public org.tensorflow.proto.BfcMemoryMap.BinSummary getBinSummary(int index) { + if (binSummaryBuilder_ == null) { + return binSummary_.get(index); + } else { + return binSummaryBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder setBinSummary( + int index, org.tensorflow.proto.BfcMemoryMap.BinSummary value) { + if (binSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBinSummaryIsMutable(); + binSummary_.set(index, value); + onChanged(); + } else { + binSummaryBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder setBinSummary( + int index, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder builderForValue) { + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + binSummary_.set(index, builderForValue.build()); + onChanged(); + } else { + binSummaryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder addBinSummary(org.tensorflow.proto.BfcMemoryMap.BinSummary value) { + if (binSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBinSummaryIsMutable(); + binSummary_.add(value); + onChanged(); + } else { + binSummaryBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder addBinSummary( + int index, org.tensorflow.proto.BfcMemoryMap.BinSummary value) { + if (binSummaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBinSummaryIsMutable(); + binSummary_.add(index, value); + onChanged(); + } else { + binSummaryBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder addBinSummary( + org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder builderForValue) { + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + binSummary_.add(builderForValue.build()); + onChanged(); + } else { + binSummaryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder addBinSummary( + int index, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder builderForValue) { + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + binSummary_.add(index, builderForValue.build()); + onChanged(); + } else { + binSummaryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder addAllBinSummary( + java.lang.Iterable values) { + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, binSummary_); + onChanged(); + } else { + binSummaryBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder clearBinSummary() { + if (binSummaryBuilder_ == null) { + binSummary_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + binSummaryBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public Builder removeBinSummary(int index) { + if (binSummaryBuilder_ == null) { + ensureBinSummaryIsMutable(); + binSummary_.remove(index); + onChanged(); + } else { + binSummaryBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder getBinSummaryBuilder( + int index) { + return getBinSummaryFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder getBinSummaryOrBuilder( + int index) { + if (binSummaryBuilder_ == null) { + return binSummary_.get(index); } else { + return binSummaryBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public java.util.List + getBinSummaryOrBuilderList() { + if (binSummaryBuilder_ != null) { + return binSummaryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(binSummary_); + } + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder addBinSummaryBuilder() { + return getBinSummaryFieldBuilder().addBuilder( + org.tensorflow.proto.BfcMemoryMap.BinSummary.getDefaultInstance()); + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder addBinSummaryBuilder( + int index) { + return getBinSummaryFieldBuilder().addBuilder( + index, org.tensorflow.proto.BfcMemoryMap.BinSummary.getDefaultInstance()); + } + /** + * repeated .tensorflow.BinSummary bin_summary = 2; + */ + public java.util.List + getBinSummaryBuilderList() { + return getBinSummaryFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.BinSummary, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder, org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder> + getBinSummaryFieldBuilder() { + if (binSummaryBuilder_ == null) { + binSummaryBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.BinSummary, org.tensorflow.proto.BfcMemoryMap.BinSummary.Builder, org.tensorflow.proto.BfcMemoryMap.BinSummaryOrBuilder>( + binSummary_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + binSummary_ = null; + } + return binSummaryBuilder_; + } + + private java.util.List chunk_ = + java.util.Collections.emptyList(); + private void ensureChunkIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + chunk_ = new java.util.ArrayList(chunk_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemChunk, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder, org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder> chunkBuilder_; + + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public java.util.List getChunkList() { + if (chunkBuilder_ == null) { + return java.util.Collections.unmodifiableList(chunk_); + } else { + return chunkBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public int getChunkCount() { + if (chunkBuilder_ == null) { + return chunk_.size(); + } else { + return chunkBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public org.tensorflow.proto.BfcMemoryMap.MemChunk getChunk(int index) { + if (chunkBuilder_ == null) { + return chunk_.get(index); + } else { + return chunkBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder setChunk( + int index, org.tensorflow.proto.BfcMemoryMap.MemChunk value) { + if (chunkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkIsMutable(); + chunk_.set(index, value); + onChanged(); + } else { + chunkBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder setChunk( + int index, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder builderForValue) { + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + chunk_.set(index, builderForValue.build()); + onChanged(); + } else { + chunkBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder addChunk(org.tensorflow.proto.BfcMemoryMap.MemChunk value) { + if (chunkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkIsMutable(); + chunk_.add(value); + onChanged(); + } else { + chunkBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder addChunk( + int index, org.tensorflow.proto.BfcMemoryMap.MemChunk value) { + if (chunkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkIsMutable(); + chunk_.add(index, value); + onChanged(); + } else { + chunkBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder addChunk( + org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder builderForValue) { + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + chunk_.add(builderForValue.build()); + onChanged(); + } else { + chunkBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder addChunk( + int index, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder builderForValue) { + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + chunk_.add(index, builderForValue.build()); + onChanged(); + } else { + chunkBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder addAllChunk( + java.lang.Iterable values) { + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, chunk_); + onChanged(); + } else { + chunkBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder clearChunk() { + if (chunkBuilder_ == null) { + chunk_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + chunkBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public Builder removeChunk(int index) { + if (chunkBuilder_ == null) { + ensureChunkIsMutable(); + chunk_.remove(index); + onChanged(); + } else { + chunkBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder getChunkBuilder( + int index) { + return getChunkFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder getChunkOrBuilder( + int index) { + if (chunkBuilder_ == null) { + return chunk_.get(index); } else { + return chunkBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public java.util.List + getChunkOrBuilderList() { + if (chunkBuilder_ != null) { + return chunkBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(chunk_); + } + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder addChunkBuilder() { + return getChunkFieldBuilder().addBuilder( + org.tensorflow.proto.BfcMemoryMap.MemChunk.getDefaultInstance()); + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder addChunkBuilder( + int index) { + return getChunkFieldBuilder().addBuilder( + index, org.tensorflow.proto.BfcMemoryMap.MemChunk.getDefaultInstance()); + } + /** + * repeated .tensorflow.MemChunk chunk = 3; + */ + public java.util.List + getChunkBuilderList() { + return getChunkFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemChunk, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder, org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder> + getChunkFieldBuilder() { + if (chunkBuilder_ == null) { + chunkBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemChunk, org.tensorflow.proto.BfcMemoryMap.MemChunk.Builder, org.tensorflow.proto.BfcMemoryMap.MemChunkOrBuilder>( + chunk_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + chunk_ = null; + } + return chunkBuilder_; + } + + private java.util.List snapShot_ = + java.util.Collections.emptyList(); + private void ensureSnapShotIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + snapShot_ = new java.util.ArrayList(snapShot_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.SnapShot, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder, org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder> snapShotBuilder_; + + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public java.util.List getSnapShotList() { + if (snapShotBuilder_ == null) { + return java.util.Collections.unmodifiableList(snapShot_); + } else { + return snapShotBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public int getSnapShotCount() { + if (snapShotBuilder_ == null) { + return snapShot_.size(); + } else { + return snapShotBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public org.tensorflow.proto.BfcMemoryMap.SnapShot getSnapShot(int index) { + if (snapShotBuilder_ == null) { + return snapShot_.get(index); + } else { + return snapShotBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder setSnapShot( + int index, org.tensorflow.proto.BfcMemoryMap.SnapShot value) { + if (snapShotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapShotIsMutable(); + snapShot_.set(index, value); + onChanged(); + } else { + snapShotBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder setSnapShot( + int index, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder builderForValue) { + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + snapShot_.set(index, builderForValue.build()); + onChanged(); + } else { + snapShotBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder addSnapShot(org.tensorflow.proto.BfcMemoryMap.SnapShot value) { + if (snapShotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapShotIsMutable(); + snapShot_.add(value); + onChanged(); + } else { + snapShotBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder addSnapShot( + int index, org.tensorflow.proto.BfcMemoryMap.SnapShot value) { + if (snapShotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSnapShotIsMutable(); + snapShot_.add(index, value); + onChanged(); + } else { + snapShotBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder addSnapShot( + org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder builderForValue) { + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + snapShot_.add(builderForValue.build()); + onChanged(); + } else { + snapShotBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder addSnapShot( + int index, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder builderForValue) { + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + snapShot_.add(index, builderForValue.build()); + onChanged(); + } else { + snapShotBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder addAllSnapShot( + java.lang.Iterable values) { + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, snapShot_); + onChanged(); + } else { + snapShotBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder clearSnapShot() { + if (snapShotBuilder_ == null) { + snapShot_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + snapShotBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public Builder removeSnapShot(int index) { + if (snapShotBuilder_ == null) { + ensureSnapShotIsMutable(); + snapShot_.remove(index); + onChanged(); + } else { + snapShotBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder getSnapShotBuilder( + int index) { + return getSnapShotFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder getSnapShotOrBuilder( + int index) { + if (snapShotBuilder_ == null) { + return snapShot_.get(index); } else { + return snapShotBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public java.util.List + getSnapShotOrBuilderList() { + if (snapShotBuilder_ != null) { + return snapShotBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(snapShot_); + } + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder addSnapShotBuilder() { + return getSnapShotFieldBuilder().addBuilder( + org.tensorflow.proto.BfcMemoryMap.SnapShot.getDefaultInstance()); + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder addSnapShotBuilder( + int index) { + return getSnapShotFieldBuilder().addBuilder( + index, org.tensorflow.proto.BfcMemoryMap.SnapShot.getDefaultInstance()); + } + /** + * repeated .tensorflow.SnapShot snap_shot = 4; + */ + public java.util.List + getSnapShotBuilderList() { + return getSnapShotFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.SnapShot, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder, org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder> + getSnapShotFieldBuilder() { + if (snapShotBuilder_ == null) { + snapShotBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.SnapShot, org.tensorflow.proto.BfcMemoryMap.SnapShot.Builder, org.tensorflow.proto.BfcMemoryMap.SnapShotOrBuilder>( + snapShot_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + snapShot_ = null; + } + return snapShotBuilder_; + } + + private org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats stats_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder> statsBuilder_; + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + * @return The stats. + */ + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null ? org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance() : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public Builder setStats(org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public Builder setStats( + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public Builder mergeStats(org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + stats_ != null && + stats_ != org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + if (stats_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000010); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + public org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null ? + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.getDefaultInstance() : stats_; + } + } + /** + * .tensorflow.MemAllocatorStats stats = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStats.Builder, org.tensorflow.proto.BfcMemoryMap.MemAllocatorStatsOrBuilder>( + getStats(), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryDump) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryDump) + private static final org.tensorflow.proto.BfcMemoryMap.MemoryDump DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BfcMemoryMap.MemoryDump(); + } + + public static org.tensorflow.proto.BfcMemoryMap.MemoryDump getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryDump parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BfcMemoryMap.MemoryDump getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MemAllocatorStats_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MemChunk_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MemChunk_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_BinSummary_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_BinSummary_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SnapShot_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SnapShot_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MemoryDump_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MemoryDump_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%xla/tsl/protobuf/bfc_memory_map.proto\022" + + "\ntensorflow\"\222\001\n\021MemAllocatorStats\022\022\n\nnum" + + "_allocs\030\001 \001(\003\022\024\n\014bytes_in_use\030\002 \001(\003\022\031\n\021p" + + "eak_bytes_in_use\030\003 \001(\003\022\032\n\022largest_alloc_" + + "size\030\004 \001(\003\022\034\n\024fragmentation_metric\030\005 \001(\002" + + "\"\256\001\n\010MemChunk\022\017\n\007address\030\001 \001(\004\022\014\n\004size\030\002" + + " \001(\003\022\026\n\016requested_size\030\003 \001(\003\022\013\n\003bin\030\004 \001(" + + "\005\022\017\n\007op_name\030\005 \001(\t\022\026\n\016freed_at_count\030\006 \001" + + "(\004\022\024\n\014action_count\030\007 \001(\004\022\016\n\006in_use\030\010 \001(\010" + + "\022\017\n\007step_id\030\t \001(\004\"\213\001\n\nBinSummary\022\013\n\003bin\030" + + "\001 \001(\005\022\032\n\022total_bytes_in_use\030\002 \001(\003\022\032\n\022tot" + + "al_bytes_in_bin\030\003 \001(\003\022\033\n\023total_chunks_in" + + "_use\030\004 \001(\003\022\033\n\023total_chunks_in_bin\030\005 \001(\003\"" + + ".\n\010SnapShot\022\024\n\014action_count\030\001 \001(\004\022\014\n\004siz" + + "e\030\002 \001(\003\"\315\001\n\nMemoryDump\022\026\n\016allocator_name" + + "\030\001 \001(\t\022+\n\013bin_summary\030\002 \003(\0132\026.tensorflow" + + ".BinSummary\022#\n\005chunk\030\003 \003(\0132\024.tensorflow." + + "MemChunk\022\'\n\tsnap_shot\030\004 \003(\0132\024.tensorflow" + + ".SnapShot\022,\n\005stats\030\005 \001(\0132\035.tensorflow.Me" + + "mAllocatorStatsBV\n\024org.tensorflow.protoZ" + + ">github.com/google/tsl/tsl/go/protobuf/f" + + "or_core_protos_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_MemAllocatorStats_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_MemAllocatorStats_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MemAllocatorStats_descriptor, + new java.lang.String[] { "NumAllocs", "BytesInUse", "PeakBytesInUse", "LargestAllocSize", "FragmentationMetric", }); + internal_static_tensorflow_MemChunk_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_MemChunk_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MemChunk_descriptor, + new java.lang.String[] { "Address", "Size", "RequestedSize", "Bin", "OpName", "FreedAtCount", "ActionCount", "InUse", "StepId", }); + internal_static_tensorflow_BinSummary_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_BinSummary_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_BinSummary_descriptor, + new java.lang.String[] { "Bin", "TotalBytesInUse", "TotalBytesInBin", "TotalChunksInUse", "TotalChunksInBin", }); + internal_static_tensorflow_SnapShot_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_SnapShot_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SnapShot_descriptor, + new java.lang.String[] { "ActionCount", "Size", }); + internal_static_tensorflow_MemoryDump_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_MemoryDump_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MemoryDump_descriptor, + new java.lang.String[] { "AllocatorName", "BinSummary", "Chunk", "SnapShot", "Stats", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfiguration.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfiguration.java new file mode 100644 index 00000000000..5924c47cbc4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfiguration.java @@ -0,0 +1,1011 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.BuildConfiguration} + */ +public final class BuildConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BuildConfiguration) + BuildConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BuildConfiguration.class.getName()); + } + // Use BuildConfiguration.newBuilder() to construct. + private BuildConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BuildConfiguration() { + mode_ = ""; + ccFlags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + opts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BuildConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BuildConfiguration.class, org.tensorflow.proto.BuildConfiguration.Builder.class); + } + + public static final int MODE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object mode_ = ""; + /** + *
    +   * opt, dbg, etc
    +   * 
    + * + * string mode = 1; + * @return The mode. + */ + @java.lang.Override + public java.lang.String getMode() { + java.lang.Object ref = mode_; + 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(); + mode_ = s; + return s; + } + } + /** + *
    +   * opt, dbg, etc
    +   * 
    + * + * string mode = 1; + * @return The bytes for mode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModeBytes() { + java.lang.Object ref = mode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CC_FLAGS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList ccFlags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @return A list containing the ccFlags. + */ + public com.google.protobuf.ProtocolStringList + getCcFlagsList() { + return ccFlags_; + } + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @return The count of ccFlags. + */ + public int getCcFlagsCount() { + return ccFlags_.size(); + } + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the element to return. + * @return The ccFlags at the given index. + */ + public java.lang.String getCcFlags(int index) { + return ccFlags_.get(index); + } + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the value to return. + * @return The bytes of the ccFlags at the given index. + */ + public com.google.protobuf.ByteString + getCcFlagsBytes(int index) { + return ccFlags_.getByteString(index); + } + + public static final int OPTS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList opts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @return A list containing the opts. + */ + public com.google.protobuf.ProtocolStringList + getOptsList() { + return opts_; + } + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @return The count of opts. + */ + public int getOptsCount() { + return opts_.size(); + } + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @param index The index of the element to return. + * @return The opts at the given index. + */ + public java.lang.String getOpts(int index) { + return opts_.get(index); + } + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @param index The index of the value to return. + * @return The bytes of the opts at the given index. + */ + public com.google.protobuf.ByteString + getOptsBytes(int index) { + return opts_.getByteString(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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, mode_); + } + for (int i = 0; i < ccFlags_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ccFlags_.getRaw(i)); + } + for (int i = 0; i < opts_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, opts_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, mode_); + } + { + int dataSize = 0; + for (int i = 0; i < ccFlags_.size(); i++) { + dataSize += computeStringSizeNoTag(ccFlags_.getRaw(i)); + } + size += dataSize; + size += 1 * getCcFlagsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < opts_.size(); i++) { + dataSize += computeStringSizeNoTag(opts_.getRaw(i)); + } + size += dataSize; + size += 1 * getOptsList().size(); + } + size += getUnknownFields().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.BuildConfiguration)) { + return super.equals(obj); + } + org.tensorflow.proto.BuildConfiguration other = (org.tensorflow.proto.BuildConfiguration) obj; + + if (!getMode() + .equals(other.getMode())) return false; + if (!getCcFlagsList() + .equals(other.getCcFlagsList())) return false; + if (!getOptsList() + .equals(other.getOptsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + getMode().hashCode(); + if (getCcFlagsCount() > 0) { + hash = (37 * hash) + CC_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getCcFlagsList().hashCode(); + } + if (getOptsCount() > 0) { + hash = (37 * hash) + OPTS_FIELD_NUMBER; + hash = (53 * hash) + getOptsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BuildConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BuildConfiguration 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.BuildConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BuildConfiguration 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.BuildConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BuildConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BuildConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BuildConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BuildConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BuildConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BuildConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BuildConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BuildConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.BuildConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BuildConfiguration) + org.tensorflow.proto.BuildConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BuildConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BuildConfiguration.class, org.tensorflow.proto.BuildConfiguration.Builder.class); + } + + // Construct using org.tensorflow.proto.BuildConfiguration.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mode_ = ""; + ccFlags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + opts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_BuildConfiguration_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BuildConfiguration getDefaultInstanceForType() { + return org.tensorflow.proto.BuildConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BuildConfiguration build() { + org.tensorflow.proto.BuildConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BuildConfiguration buildPartial() { + org.tensorflow.proto.BuildConfiguration result = new org.tensorflow.proto.BuildConfiguration(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BuildConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mode_ = mode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + ccFlags_.makeImmutable(); + result.ccFlags_ = ccFlags_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + opts_.makeImmutable(); + result.opts_ = opts_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BuildConfiguration) { + return mergeFrom((org.tensorflow.proto.BuildConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BuildConfiguration other) { + if (other == org.tensorflow.proto.BuildConfiguration.getDefaultInstance()) return this; + if (!other.getMode().isEmpty()) { + mode_ = other.mode_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.ccFlags_.isEmpty()) { + if (ccFlags_.isEmpty()) { + ccFlags_ = other.ccFlags_; + bitField0_ |= 0x00000002; + } else { + ensureCcFlagsIsMutable(); + ccFlags_.addAll(other.ccFlags_); + } + onChanged(); + } + if (!other.opts_.isEmpty()) { + if (opts_.isEmpty()) { + opts_ = other.opts_; + bitField0_ |= 0x00000004; + } else { + ensureOptsIsMutable(); + opts_.addAll(other.opts_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + mode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureCcFlagsIsMutable(); + ccFlags_.add(s); + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureOptsIsMutable(); + opts_.add(s); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object mode_ = ""; + /** + *
    +     * opt, dbg, etc
    +     * 
    + * + * string mode = 1; + * @return The mode. + */ + public java.lang.String getMode() { + java.lang.Object ref = mode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * opt, dbg, etc
    +     * 
    + * + * string mode = 1; + * @return The bytes for mode. + */ + public com.google.protobuf.ByteString + getModeBytes() { + java.lang.Object ref = mode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * opt, dbg, etc
    +     * 
    + * + * string mode = 1; + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + mode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * opt, dbg, etc
    +     * 
    + * + * string mode = 1; + * @return This builder for chaining. + */ + public Builder clearMode() { + mode_ = getDefaultInstance().getMode(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * opt, dbg, etc
    +     * 
    + * + * string mode = 1; + * @param value The bytes for mode to set. + * @return This builder for chaining. + */ + public Builder setModeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + mode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList ccFlags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureCcFlagsIsMutable() { + if (!ccFlags_.isModifiable()) { + ccFlags_ = new com.google.protobuf.LazyStringArrayList(ccFlags_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @return A list containing the ccFlags. + */ + public com.google.protobuf.ProtocolStringList + getCcFlagsList() { + ccFlags_.makeImmutable(); + return ccFlags_; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @return The count of ccFlags. + */ + public int getCcFlagsCount() { + return ccFlags_.size(); + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the element to return. + * @return The ccFlags at the given index. + */ + public java.lang.String getCcFlags(int index) { + return ccFlags_.get(index); + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the value to return. + * @return The bytes of the ccFlags at the given index. + */ + public com.google.protobuf.ByteString + getCcFlagsBytes(int index) { + return ccFlags_.getByteString(index); + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param index The index to set the value at. + * @param value The ccFlags to set. + * @return This builder for chaining. + */ + public Builder setCcFlags( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureCcFlagsIsMutable(); + ccFlags_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param value The ccFlags to add. + * @return This builder for chaining. + */ + public Builder addCcFlags( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureCcFlagsIsMutable(); + ccFlags_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param values The ccFlags to add. + * @return This builder for chaining. + */ + public Builder addAllCcFlags( + java.lang.Iterable values) { + ensureCcFlagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, ccFlags_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @return This builder for chaining. + */ + public Builder clearCcFlags() { + ccFlags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +     * CC compiler flags, if known
    +     * 
    + * + * repeated string cc_flags = 2; + * @param value The bytes of the ccFlags to add. + * @return This builder for chaining. + */ + public Builder addCcFlagsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureCcFlagsIsMutable(); + ccFlags_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList opts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureOptsIsMutable() { + if (!opts_.isModifiable()) { + opts_ = new com.google.protobuf.LazyStringArrayList(opts_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @return A list containing the opts. + */ + public com.google.protobuf.ProtocolStringList + getOptsList() { + opts_.makeImmutable(); + return opts_; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @return The count of opts. + */ + public int getOptsCount() { + return opts_.size(); + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param index The index of the element to return. + * @return The opts at the given index. + */ + public java.lang.String getOpts(int index) { + return opts_.get(index); + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param index The index of the value to return. + * @return The bytes of the opts at the given index. + */ + public com.google.protobuf.ByteString + getOptsBytes(int index) { + return opts_.getByteString(index); + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param index The index to set the value at. + * @param value The opts to set. + * @return This builder for chaining. + */ + public Builder setOpts( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOptsIsMutable(); + opts_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param value The opts to add. + * @return This builder for chaining. + */ + public Builder addOpts( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOptsIsMutable(); + opts_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param values The opts to add. + * @return This builder for chaining. + */ + public Builder addAllOpts( + java.lang.Iterable values) { + ensureOptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, opts_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @return This builder for chaining. + */ + public Builder clearOpts() { + opts_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Bazel compilation options, if known
    +     * 
    + * + * repeated string opts = 3; + * @param value The bytes of the opts to add. + * @return This builder for chaining. + */ + public Builder addOptsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureOptsIsMutable(); + opts_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BuildConfiguration) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BuildConfiguration) + private static final org.tensorflow.proto.BuildConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BuildConfiguration(); + } + + public static org.tensorflow.proto.BuildConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BuildConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfigurationOrBuilder.java new file mode 100644 index 00000000000..4e529158905 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BuildConfigurationOrBuilder.java @@ -0,0 +1,113 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BuildConfigurationOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BuildConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * opt, dbg, etc
    +   * 
    + * + * string mode = 1; + * @return The mode. + */ + java.lang.String getMode(); + /** + *
    +   * opt, dbg, etc
    +   * 
    + * + * string mode = 1; + * @return The bytes for mode. + */ + com.google.protobuf.ByteString + getModeBytes(); + + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @return A list containing the ccFlags. + */ + java.util.List + getCcFlagsList(); + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @return The count of ccFlags. + */ + int getCcFlagsCount(); + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the element to return. + * @return The ccFlags at the given index. + */ + java.lang.String getCcFlags(int index); + /** + *
    +   * CC compiler flags, if known
    +   * 
    + * + * repeated string cc_flags = 2; + * @param index The index of the value to return. + * @return The bytes of the ccFlags at the given index. + */ + com.google.protobuf.ByteString + getCcFlagsBytes(int index); + + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @return A list containing the opts. + */ + java.util.List + getOptsList(); + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @return The count of opts. + */ + int getOptsCount(); + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @param index The index of the element to return. + * @return The opts at the given index. + */ + java.lang.String getOpts(int index); + /** + *
    +   * Bazel compilation options, if known
    +   * 
    + * + * repeated string opts = 3; + * @param index The index of the value to return. + * @return The bytes of the opts at the given index. + */ + com.google.protobuf.ByteString + getOptsBytes(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProto.java new file mode 100644 index 00000000000..778eb17b5d2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProto.java @@ -0,0 +1,1575 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensor_bundle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Describes the metadata related to a checkpointed tensor.
    + * 
    + * + * Protobuf type {@code tensorflow.BundleEntryProto} + */ +public final class BundleEntryProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BundleEntryProto) + BundleEntryProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BundleEntryProto.class.getName()); + } + // Use BundleEntryProto.newBuilder() to construct. + private BundleEntryProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BundleEntryProto() { + dtype_ = 0; + slices_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BundleEntryProto.class, org.tensorflow.proto.BundleEntryProto.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + *
    +   * The tensor dtype and shape.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +   * The tensor dtype and shape.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int SHARD_ID_FIELD_NUMBER = 3; + private int shardId_ = 0; + /** + *
    +   * The binary content of the tensor lies in:
    +   * File "shard_id": bytes [offset, offset + size).
    +   * 
    + * + * int32 shard_id = 3; + * @return The shardId. + */ + @java.lang.Override + public int getShardId() { + return shardId_; + } + + public static final int OFFSET_FIELD_NUMBER = 4; + private long offset_ = 0L; + /** + * int64 offset = 4; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + + public static final int SIZE_FIELD_NUMBER = 5; + private long size_ = 0L; + /** + * int64 size = 5; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int CRC32C_FIELD_NUMBER = 6; + private int crc32C_ = 0; + /** + *
    +   * The CRC32C checksum of the tensor bytes.
    +   * 
    + * + * fixed32 crc32c = 6; + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + + public static final int SLICES_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List slices_; + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + @java.lang.Override + public java.util.List getSlicesList() { + return slices_; + } + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + @java.lang.Override + public java.util.List + getSlicesOrBuilderList() { + return slices_; + } + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + @java.lang.Override + public int getSlicesCount() { + return slices_.size(); + } + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto getSlices(int index) { + return slices_.get(index); + } + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSlicesOrBuilder( + int index) { + return slices_.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 { + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (shardId_ != 0) { + output.writeInt32(3, shardId_); + } + if (offset_ != 0L) { + output.writeInt64(4, offset_); + } + if (size_ != 0L) { + output.writeInt64(5, size_); + } + if (crc32C_ != 0) { + output.writeFixed32(6, crc32C_); + } + for (int i = 0; i < slices_.size(); i++) { + output.writeMessage(7, slices_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (shardId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, shardId_); + } + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, offset_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, size_); + } + if (crc32C_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(6, crc32C_); + } + for (int i = 0; i < slices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, slices_.get(i)); + } + size += getUnknownFields().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.BundleEntryProto)) { + return super.equals(obj); + } + org.tensorflow.proto.BundleEntryProto other = (org.tensorflow.proto.BundleEntryProto) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (getShardId() + != other.getShardId()) return false; + if (getOffset() + != other.getOffset()) return false; + if (getSize() + != other.getSize()) return false; + if (getCrc32C() + != other.getCrc32C()) return false; + if (!getSlicesList() + .equals(other.getSlicesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + SHARD_ID_FIELD_NUMBER; + hash = (53 * hash) + getShardId(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffset()); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + CRC32C_FIELD_NUMBER; + hash = (53 * hash) + getCrc32C(); + if (getSlicesCount() > 0) { + hash = (37 * hash) + SLICES_FIELD_NUMBER; + hash = (53 * hash) + getSlicesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BundleEntryProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleEntryProto 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.BundleEntryProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleEntryProto 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.BundleEntryProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleEntryProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BundleEntryProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BundleEntryProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BundleEntryProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BundleEntryProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BundleEntryProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BundleEntryProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BundleEntryProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Describes the metadata related to a checkpointed tensor.
    +   * 
    + * + * Protobuf type {@code tensorflow.BundleEntryProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BundleEntryProto) + org.tensorflow.proto.BundleEntryProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BundleEntryProto.class, org.tensorflow.proto.BundleEntryProto.Builder.class); + } + + // Construct using org.tensorflow.proto.BundleEntryProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getSlicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + shardId_ = 0; + offset_ = 0L; + size_ = 0L; + crc32C_ = 0; + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + } else { + slices_ = null; + slicesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleEntryProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BundleEntryProto getDefaultInstanceForType() { + return org.tensorflow.proto.BundleEntryProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BundleEntryProto build() { + org.tensorflow.proto.BundleEntryProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BundleEntryProto buildPartial() { + org.tensorflow.proto.BundleEntryProto result = new org.tensorflow.proto.BundleEntryProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.BundleEntryProto result) { + if (slicesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.slices_ = slices_; + } else { + result.slices_ = slicesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.BundleEntryProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.shardId_ = shardId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.crc32C_ = crc32C_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BundleEntryProto) { + return mergeFrom((org.tensorflow.proto.BundleEntryProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BundleEntryProto other) { + if (other == org.tensorflow.proto.BundleEntryProto.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.getShardId() != 0) { + setShardId(other.getShardId()); + } + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (other.getCrc32C() != 0) { + setCrc32C(other.getCrc32C()); + } + if (slicesBuilder_ == null) { + if (!other.slices_.isEmpty()) { + if (slices_.isEmpty()) { + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureSlicesIsMutable(); + slices_.addAll(other.slices_); + } + onChanged(); + } + } else { + if (!other.slices_.isEmpty()) { + if (slicesBuilder_.isEmpty()) { + slicesBuilder_.dispose(); + slicesBuilder_ = null; + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000040); + slicesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSlicesFieldBuilder() : null; + } else { + slicesBuilder_.addAllMessages(other.slices_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + shardId_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + offset_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + size_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 53: { + crc32C_ = input.readFixed32(); + bitField0_ |= 0x00000020; + break; + } // case 53 + case 58: { + org.tensorflow.proto.TensorSliceProto m = + input.readMessage( + org.tensorflow.proto.TensorSliceProto.parser(), + extensionRegistry); + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(m); + } else { + slicesBuilder_.addMessage(m); + } + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + *
    +     * The tensor dtype and shape.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * The tensor dtype and shape.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The tensor dtype and shape.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +     * The tensor dtype and shape.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * The tensor dtype and shape.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private int shardId_ ; + /** + *
    +     * The binary content of the tensor lies in:
    +     * File "shard_id": bytes [offset, offset + size).
    +     * 
    + * + * int32 shard_id = 3; + * @return The shardId. + */ + @java.lang.Override + public int getShardId() { + return shardId_; + } + /** + *
    +     * The binary content of the tensor lies in:
    +     * File "shard_id": bytes [offset, offset + size).
    +     * 
    + * + * int32 shard_id = 3; + * @param value The shardId to set. + * @return This builder for chaining. + */ + public Builder setShardId(int value) { + + shardId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The binary content of the tensor lies in:
    +     * File "shard_id": bytes [offset, offset + size).
    +     * 
    + * + * int32 shard_id = 3; + * @return This builder for chaining. + */ + public Builder clearShardId() { + bitField0_ = (bitField0_ & ~0x00000004); + shardId_ = 0; + onChanged(); + return this; + } + + private long offset_ ; + /** + * int64 offset = 4; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + /** + * int64 offset = 4; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(long value) { + + offset_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 offset = 4; + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000008); + offset_ = 0L; + onChanged(); + return this; + } + + private long size_ ; + /** + * int64 size = 5; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * int64 size = 5; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 size = 5; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000010); + size_ = 0L; + onChanged(); + return this; + } + + private int crc32C_ ; + /** + *
    +     * The CRC32C checksum of the tensor bytes.
    +     * 
    + * + * fixed32 crc32c = 6; + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + /** + *
    +     * The CRC32C checksum of the tensor bytes.
    +     * 
    + * + * fixed32 crc32c = 6; + * @param value The crc32c to set. + * @return This builder for chaining. + */ + public Builder setCrc32C(int value) { + + crc32C_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * The CRC32C checksum of the tensor bytes.
    +     * 
    + * + * fixed32 crc32c = 6; + * @return This builder for chaining. + */ + public Builder clearCrc32C() { + bitField0_ = (bitField0_ & ~0x00000020); + crc32C_ = 0; + onChanged(); + return this; + } + + private java.util.List slices_ = + java.util.Collections.emptyList(); + private void ensureSlicesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + slices_ = new java.util.ArrayList(slices_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> slicesBuilder_; + + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public java.util.List getSlicesList() { + if (slicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slices_); + } else { + return slicesBuilder_.getMessageList(); + } + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public int getSlicesCount() { + if (slicesBuilder_ == null) { + return slices_.size(); + } else { + return slicesBuilder_.getCount(); + } + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public org.tensorflow.proto.TensorSliceProto getSlices(int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); + } else { + return slicesBuilder_.getMessage(index); + } + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder setSlices( + int index, org.tensorflow.proto.TensorSliceProto value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.set(index, value); + onChanged(); + } else { + slicesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder setSlices( + int index, org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.set(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder addSlices(org.tensorflow.proto.TensorSliceProto value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(value); + onChanged(); + } else { + slicesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder addSlices( + int index, org.tensorflow.proto.TensorSliceProto value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(index, value); + onChanged(); + } else { + slicesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder addSlices( + org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder addSlices( + int index, org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(index, builderForValue.build()); + onChanged(); + } else { + slicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder addAllSlices( + java.lang.Iterable values) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slices_); + onChanged(); + } else { + slicesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder clearSlices() { + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + slicesBuilder_.clear(); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public Builder removeSlices(int index) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.remove(index); + onChanged(); + } else { + slicesBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public org.tensorflow.proto.TensorSliceProto.Builder getSlicesBuilder( + int index) { + return getSlicesFieldBuilder().getBuilder(index); + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSlicesOrBuilder( + int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { + return slicesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public java.util.List + getSlicesOrBuilderList() { + if (slicesBuilder_ != null) { + return slicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slices_); + } + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public org.tensorflow.proto.TensorSliceProto.Builder addSlicesBuilder() { + return getSlicesFieldBuilder().addBuilder( + org.tensorflow.proto.TensorSliceProto.getDefaultInstance()); + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public org.tensorflow.proto.TensorSliceProto.Builder addSlicesBuilder( + int index) { + return getSlicesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorSliceProto.getDefaultInstance()); + } + /** + *
    +     * Iff present, this entry represents a partitioned tensor.  The previous
    +     * fields are interpreted as follows:
    +     *
    +     * "dtype", "shape": describe the full tensor.
    +     * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +     * These information for each slice can be looked up in their own
    +     * BundleEntryProto, keyed by each "slice_name".
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + public java.util.List + getSlicesBuilderList() { + return getSlicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> + getSlicesFieldBuilder() { + if (slicesBuilder_ == null) { + slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder>( + slices_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + slices_ = null; + } + return slicesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BundleEntryProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BundleEntryProto) + private static final org.tensorflow.proto.BundleEntryProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BundleEntryProto(); + } + + public static org.tensorflow.proto.BundleEntryProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleEntryProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BundleEntryProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProtoOrBuilder.java new file mode 100644 index 00000000000..cc082e079da --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleEntryProtoOrBuilder.java @@ -0,0 +1,152 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensor_bundle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BundleEntryProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BundleEntryProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * The tensor dtype and shape.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + *
    +   * The tensor dtype and shape.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + *
    +   * The binary content of the tensor lies in:
    +   * File "shard_id": bytes [offset, offset + size).
    +   * 
    + * + * int32 shard_id = 3; + * @return The shardId. + */ + int getShardId(); + + /** + * int64 offset = 4; + * @return The offset. + */ + long getOffset(); + + /** + * int64 size = 5; + * @return The size. + */ + long getSize(); + + /** + *
    +   * The CRC32C checksum of the tensor bytes.
    +   * 
    + * + * fixed32 crc32c = 6; + * @return The crc32c. + */ + int getCrc32C(); + + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + java.util.List + getSlicesList(); + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + org.tensorflow.proto.TensorSliceProto getSlices(int index); + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + int getSlicesCount(); + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + java.util.List + getSlicesOrBuilderList(); + /** + *
    +   * Iff present, this entry represents a partitioned tensor.  The previous
    +   * fields are interpreted as follows:
    +   *
    +   * "dtype", "shape": describe the full tensor.
    +   * "shard_id", "offset", "size", "crc32c": all IGNORED.
    +   * These information for each slice can be looked up in their own
    +   * BundleEntryProto, keyed by each "slice_name".
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slices = 7; + */ + org.tensorflow.proto.TensorSliceProtoOrBuilder getSlicesOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProto.java new file mode 100644 index 00000000000..b3794d41c2e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProto.java @@ -0,0 +1,927 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensor_bundle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Special header that is associated with a bundle.
    + *
    + * TODO(zongheng,zhifengc): maybe in the future, we can add information about
    + * which binary produced this checkpoint, timestamp, etc. Sometime, these can be
    + * valuable debugging information. And if needed, these can be used as defensive
    + * information ensuring reader (binary version) of the checkpoint and the writer
    + * (binary version) must match within certain range, etc.
    + * 
    + * + * Protobuf type {@code tensorflow.BundleHeaderProto} + */ +public final class BundleHeaderProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BundleHeaderProto) + BundleHeaderProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BundleHeaderProto.class.getName()); + } + // Use BundleHeaderProto.newBuilder() to construct. + private BundleHeaderProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BundleHeaderProto() { + endianness_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BundleHeaderProto.class, org.tensorflow.proto.BundleHeaderProto.Builder.class); + } + + /** + *
    +   * An enum indicating the endianness of the platform that produced this
    +   * bundle.  A bundle can only be read by a platform with matching endianness.
    +   * Defaults to LITTLE, as most modern platforms are little-endian.
    +   *
    +   * Affects the binary tensor data bytes only, not the metadata in protobufs.
    +   * 
    + * + * Protobuf enum {@code tensorflow.BundleHeaderProto.Endianness} + */ + public enum Endianness + implements com.google.protobuf.ProtocolMessageEnum { + /** + * LITTLE = 0; + */ + LITTLE(0), + /** + * BIG = 1; + */ + BIG(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Endianness.class.getName()); + } + /** + * LITTLE = 0; + */ + public static final int LITTLE_VALUE = 0; + /** + * BIG = 1; + */ + public static final int BIG_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Endianness valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Endianness forNumber(int value) { + switch (value) { + case 0: return LITTLE; + case 1: return BIG; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Endianness> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Endianness findValueByNumber(int number) { + return Endianness.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.BundleHeaderProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Endianness[] VALUES = values(); + + public static Endianness 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 Endianness(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.BundleHeaderProto.Endianness) + } + + private int bitField0_; + public static final int NUM_SHARDS_FIELD_NUMBER = 1; + private int numShards_ = 0; + /** + *
    +   * Number of data files in the bundle.
    +   * 
    + * + * int32 num_shards = 1; + * @return The numShards. + */ + @java.lang.Override + public int getNumShards() { + return numShards_; + } + + public static final int ENDIANNESS_FIELD_NUMBER = 2; + private int endianness_ = 0; + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The enum numeric value on the wire for endianness. + */ + @java.lang.Override public int getEndiannessValue() { + return endianness_; + } + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The endianness. + */ + @java.lang.Override public org.tensorflow.proto.BundleHeaderProto.Endianness getEndianness() { + org.tensorflow.proto.BundleHeaderProto.Endianness result = org.tensorflow.proto.BundleHeaderProto.Endianness.forNumber(endianness_); + return result == null ? org.tensorflow.proto.BundleHeaderProto.Endianness.UNRECOGNIZED : result; + } + + public static final int VERSION_FIELD_NUMBER = 3; + private org.tensorflow.proto.VersionDef version_; + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + * @return The version. + */ + @java.lang.Override + public org.tensorflow.proto.VersionDef getVersion() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + */ + @java.lang.Override + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + + 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 (numShards_ != 0) { + output.writeInt32(1, numShards_); + } + if (endianness_ != org.tensorflow.proto.BundleHeaderProto.Endianness.LITTLE.getNumber()) { + output.writeEnum(2, endianness_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getVersion()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numShards_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, numShards_); + } + if (endianness_ != org.tensorflow.proto.BundleHeaderProto.Endianness.LITTLE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, endianness_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getVersion()); + } + size += getUnknownFields().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.BundleHeaderProto)) { + return super.equals(obj); + } + org.tensorflow.proto.BundleHeaderProto other = (org.tensorflow.proto.BundleHeaderProto) obj; + + if (getNumShards() + != other.getNumShards()) return false; + if (endianness_ != other.endianness_) return false; + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion() + .equals(other.getVersion())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_SHARDS_FIELD_NUMBER; + hash = (53 * hash) + getNumShards(); + hash = (37 * hash) + ENDIANNESS_FIELD_NUMBER; + hash = (53 * hash) + endianness_; + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BundleHeaderProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleHeaderProto 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.BundleHeaderProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleHeaderProto 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.BundleHeaderProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BundleHeaderProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BundleHeaderProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BundleHeaderProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BundleHeaderProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BundleHeaderProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BundleHeaderProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BundleHeaderProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BundleHeaderProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Special header that is associated with a bundle.
    +   *
    +   * TODO(zongheng,zhifengc): maybe in the future, we can add information about
    +   * which binary produced this checkpoint, timestamp, etc. Sometime, these can be
    +   * valuable debugging information. And if needed, these can be used as defensive
    +   * information ensuring reader (binary version) of the checkpoint and the writer
    +   * (binary version) must match within certain range, etc.
    +   * 
    + * + * Protobuf type {@code tensorflow.BundleHeaderProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BundleHeaderProto) + org.tensorflow.proto.BundleHeaderProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BundleHeaderProto.class, org.tensorflow.proto.BundleHeaderProto.Builder.class); + } + + // Construct using org.tensorflow.proto.BundleHeaderProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numShards_ = 0; + endianness_ = 0; + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorBundleProtos.internal_static_tensorflow_BundleHeaderProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BundleHeaderProto getDefaultInstanceForType() { + return org.tensorflow.proto.BundleHeaderProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BundleHeaderProto build() { + org.tensorflow.proto.BundleHeaderProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BundleHeaderProto buildPartial() { + org.tensorflow.proto.BundleHeaderProto result = new org.tensorflow.proto.BundleHeaderProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BundleHeaderProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numShards_ = numShards_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endianness_ = endianness_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = versionBuilder_ == null + ? version_ + : versionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BundleHeaderProto) { + return mergeFrom((org.tensorflow.proto.BundleHeaderProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BundleHeaderProto other) { + if (other == org.tensorflow.proto.BundleHeaderProto.getDefaultInstance()) return this; + if (other.getNumShards() != 0) { + setNumShards(other.getNumShards()); + } + if (other.endianness_ != 0) { + setEndiannessValue(other.getEndiannessValue()); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + numShards_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + endianness_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getVersionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int numShards_ ; + /** + *
    +     * Number of data files in the bundle.
    +     * 
    + * + * int32 num_shards = 1; + * @return The numShards. + */ + @java.lang.Override + public int getNumShards() { + return numShards_; + } + /** + *
    +     * Number of data files in the bundle.
    +     * 
    + * + * int32 num_shards = 1; + * @param value The numShards to set. + * @return This builder for chaining. + */ + public Builder setNumShards(int value) { + + numShards_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Number of data files in the bundle.
    +     * 
    + * + * int32 num_shards = 1; + * @return This builder for chaining. + */ + public Builder clearNumShards() { + bitField0_ = (bitField0_ & ~0x00000001); + numShards_ = 0; + onChanged(); + return this; + } + + private int endianness_ = 0; + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The enum numeric value on the wire for endianness. + */ + @java.lang.Override public int getEndiannessValue() { + return endianness_; + } + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @param value The enum numeric value on the wire for endianness to set. + * @return This builder for chaining. + */ + public Builder setEndiannessValue(int value) { + endianness_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The endianness. + */ + @java.lang.Override + public org.tensorflow.proto.BundleHeaderProto.Endianness getEndianness() { + org.tensorflow.proto.BundleHeaderProto.Endianness result = org.tensorflow.proto.BundleHeaderProto.Endianness.forNumber(endianness_); + return result == null ? org.tensorflow.proto.BundleHeaderProto.Endianness.UNRECOGNIZED : result; + } + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @param value The endianness to set. + * @return This builder for chaining. + */ + public Builder setEndianness(org.tensorflow.proto.BundleHeaderProto.Endianness value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + endianness_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return This builder for chaining. + */ + public Builder clearEndianness() { + bitField0_ = (bitField0_ & ~0x00000002); + endianness_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.VersionDef version_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> versionBuilder_; + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + * @return The version. + */ + public org.tensorflow.proto.VersionDef getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public Builder setVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public Builder setVersion( + org.tensorflow.proto.VersionDef.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public Builder mergeVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + version_ != null && + version_ != org.tensorflow.proto.VersionDef.getDefaultInstance()) { + getVersionBuilder().mergeFrom(value); + } else { + version_ = value; + } + } else { + versionBuilder_.mergeFrom(value); + } + if (version_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public org.tensorflow.proto.VersionDef.Builder getVersionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + } + /** + *
    +     * Versioning of the tensor bundle format.
    +     * 
    + * + * .tensorflow.VersionDef version = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BundleHeaderProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BundleHeaderProto) + private static final org.tensorflow.proto.BundleHeaderProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BundleHeaderProto(); + } + + public static org.tensorflow.proto.BundleHeaderProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleHeaderProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BundleHeaderProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProtoOrBuilder.java new file mode 100644 index 00000000000..af4013c645d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BundleHeaderProtoOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensor_bundle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BundleHeaderProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BundleHeaderProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Number of data files in the bundle.
    +   * 
    + * + * int32 num_shards = 1; + * @return The numShards. + */ + int getNumShards(); + + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The enum numeric value on the wire for endianness. + */ + int getEndiannessValue(); + /** + * .tensorflow.BundleHeaderProto.Endianness endianness = 2; + * @return The endianness. + */ + org.tensorflow.proto.BundleHeaderProto.Endianness getEndianness(); + + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + * @return The version. + */ + org.tensorflow.proto.VersionDef getVersion(); + /** + *
    +   * Versioning of the tensor bundle format.
    +   * 
    + * + * .tensorflow.VersionDef version = 3; + */ + org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesList.java new file mode 100644 index 00000000000..2f6bc835be9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesList.java @@ -0,0 +1,529 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * LINT.IfChange
    + * Containers to hold repeated fundamental values.
    + * 
    + * + * Protobuf type {@code tensorflow.BytesList} + */ +public final class BytesList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BytesList) + BytesListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BytesList.class.getName()); + } + // Use BytesList.newBuilder() to construct. + private BytesList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesList() { + value_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_BytesList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BytesList.class, org.tensorflow.proto.BytesList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList value_ = + emptyList(com.google.protobuf.ByteString.class); + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated bytes value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public com.google.protobuf.ByteString getValue(int index) { + return value_.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 { + for (int i = 0; i < value_.size(); i++) { + output.writeBytes(1, value_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(value_.get(i)); + } + size += dataSize; + size += 1 * getValueList().size(); + } + size += getUnknownFields().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.BytesList)) { + return super.equals(obj); + } + org.tensorflow.proto.BytesList other = (org.tensorflow.proto.BytesList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.BytesList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BytesList 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.BytesList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BytesList 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.BytesList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.BytesList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.BytesList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BytesList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.BytesList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.BytesList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.BytesList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.BytesList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.BytesList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * LINT.IfChange
    +   * Containers to hold repeated fundamental values.
    +   * 
    + * + * Protobuf type {@code tensorflow.BytesList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BytesList) + org.tensorflow.proto.BytesListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_BytesList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.BytesList.class, org.tensorflow.proto.BytesList.Builder.class); + } + + // Construct using org.tensorflow.proto.BytesList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_BytesList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.BytesList getDefaultInstanceForType() { + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.BytesList build() { + org.tensorflow.proto.BytesList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.BytesList buildPartial() { + org.tensorflow.proto.BytesList result = new org.tensorflow.proto.BytesList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.BytesList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.BytesList) { + return mergeFrom((org.tensorflow.proto.BytesList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.BytesList other) { + if (other == org.tensorflow.proto.BytesList.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureValueIsMutable(); + value_.add(v); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList value_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated bytes value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public com.google.protobuf.ByteString getValue(int index) { + return value_.get(index); + } + /** + * repeated bytes value = 1; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BytesList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BytesList) + private static final org.tensorflow.proto.BytesList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.BytesList(); + } + + public static org.tensorflow.proto.BytesList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.BytesList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesListOrBuilder.java new file mode 100644 index 00000000000..aedd4074e8e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/BytesListOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface BytesListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BytesList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated bytes value = 1; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + com.google.protobuf.ByteString getValue(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfo.java new file mode 100644 index 00000000000..035624d0f53 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfo.java @@ -0,0 +1,1244 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.CPUInfo} + */ +public final class CPUInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CPUInfo) + CPUInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CPUInfo.class.getName()); + } + // Use CPUInfo.newBuilder() to construct. + private CPUInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CPUInfo() { + cpuInfo_ = ""; + cpuGovernor_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetCacheSize(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CPUInfo.class, org.tensorflow.proto.CPUInfo.Builder.class); + } + + public static final int NUM_CORES_FIELD_NUMBER = 1; + private long numCores_ = 0L; + /** + * int64 num_cores = 1; + * @return The numCores. + */ + @java.lang.Override + public long getNumCores() { + return numCores_; + } + + public static final int NUM_CORES_ALLOWED_FIELD_NUMBER = 2; + private long numCoresAllowed_ = 0L; + /** + * int64 num_cores_allowed = 2; + * @return The numCoresAllowed. + */ + @java.lang.Override + public long getNumCoresAllowed() { + return numCoresAllowed_; + } + + public static final int MHZ_PER_CPU_FIELD_NUMBER = 3; + private double mhzPerCpu_ = 0D; + /** + *
    +   * How fast are these cpus?
    +   * 
    + * + * double mhz_per_cpu = 3; + * @return The mhzPerCpu. + */ + @java.lang.Override + public double getMhzPerCpu() { + return mhzPerCpu_; + } + + public static final int CPU_INFO_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object cpuInfo_ = ""; + /** + *
    +   * Additional cpu information. For example,
    +   * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +   * 
    + * + * string cpu_info = 4; + * @return The cpuInfo. + */ + @java.lang.Override + public java.lang.String getCpuInfo() { + java.lang.Object ref = cpuInfo_; + 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(); + cpuInfo_ = s; + return s; + } + } + /** + *
    +   * Additional cpu information. For example,
    +   * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +   * 
    + * + * string cpu_info = 4; + * @return The bytes for cpuInfo. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCpuInfoBytes() { + java.lang.Object ref = cpuInfo_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpuInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CPU_GOVERNOR_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object cpuGovernor_ = ""; + /** + *
    +   * What kind of cpu scaling is enabled on the host.
    +   * Examples include "performance", "ondemand", "conservative", "mixed".
    +   * 
    + * + * string cpu_governor = 5; + * @return The cpuGovernor. + */ + @java.lang.Override + public java.lang.String getCpuGovernor() { + java.lang.Object ref = cpuGovernor_; + 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(); + cpuGovernor_ = s; + return s; + } + } + /** + *
    +   * What kind of cpu scaling is enabled on the host.
    +   * Examples include "performance", "ondemand", "conservative", "mixed".
    +   * 
    + * + * string cpu_governor = 5; + * @return The bytes for cpuGovernor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCpuGovernorBytes() { + java.lang.Object ref = cpuGovernor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpuGovernor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CACHE_SIZE_FIELD_NUMBER = 6; + private static final class CacheSizeDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.Long> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT64, + 0L); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> cacheSize_; + private com.google.protobuf.MapField + internalGetCacheSize() { + if (cacheSize_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CacheSizeDefaultEntryHolder.defaultEntry); + } + return cacheSize_; + } + public int getCacheSizeCount() { + return internalGetCacheSize().getMap().size(); + } + /** + *
    +   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +   * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public boolean containsCacheSize( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetCacheSize().getMap().containsKey(key); + } + /** + * Use {@link #getCacheSizeMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCacheSize() { + return getCacheSizeMap(); + } + /** + *
    +   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +   * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public java.util.Map getCacheSizeMap() { + return internalGetCacheSize().getMap(); + } + /** + *
    +   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +   * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public long getCacheSizeOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCacheSize().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +   * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public long getCacheSizeOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCacheSize().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 (numCores_ != 0L) { + output.writeInt64(1, numCores_); + } + if (numCoresAllowed_ != 0L) { + output.writeInt64(2, numCoresAllowed_); + } + if (java.lang.Double.doubleToRawLongBits(mhzPerCpu_) != 0) { + output.writeDouble(3, mhzPerCpu_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cpuInfo_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, cpuInfo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cpuGovernor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, cpuGovernor_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetCacheSize(), + CacheSizeDefaultEntryHolder.defaultEntry, + 6); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numCores_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, numCores_); + } + if (numCoresAllowed_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, numCoresAllowed_); + } + if (java.lang.Double.doubleToRawLongBits(mhzPerCpu_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, mhzPerCpu_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cpuInfo_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, cpuInfo_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cpuGovernor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, cpuGovernor_); + } + for (java.util.Map.Entry entry + : internalGetCacheSize().getMap().entrySet()) { + com.google.protobuf.MapEntry + cacheSize__ = CacheSizeDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, cacheSize__); + } + size += getUnknownFields().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.CPUInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.CPUInfo other = (org.tensorflow.proto.CPUInfo) obj; + + if (getNumCores() + != other.getNumCores()) return false; + if (getNumCoresAllowed() + != other.getNumCoresAllowed()) return false; + if (java.lang.Double.doubleToLongBits(getMhzPerCpu()) + != java.lang.Double.doubleToLongBits( + other.getMhzPerCpu())) return false; + if (!getCpuInfo() + .equals(other.getCpuInfo())) return false; + if (!getCpuGovernor() + .equals(other.getCpuGovernor())) return false; + if (!internalGetCacheSize().equals( + other.internalGetCacheSize())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_CORES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumCores()); + hash = (37 * hash) + NUM_CORES_ALLOWED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumCoresAllowed()); + hash = (37 * hash) + MHZ_PER_CPU_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMhzPerCpu())); + hash = (37 * hash) + CPU_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCpuInfo().hashCode(); + hash = (37 * hash) + CPU_GOVERNOR_FIELD_NUMBER; + hash = (53 * hash) + getCpuGovernor().hashCode(); + if (!internalGetCacheSize().getMap().isEmpty()) { + hash = (37 * hash) + CACHE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + internalGetCacheSize().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CPUInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CPUInfo 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.CPUInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CPUInfo 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.CPUInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CPUInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CPUInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CPUInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CPUInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CPUInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CPUInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CPUInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CPUInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.CPUInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CPUInfo) + org.tensorflow.proto.CPUInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetCacheSize(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableCacheSize(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CPUInfo.class, org.tensorflow.proto.CPUInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.CPUInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numCores_ = 0L; + numCoresAllowed_ = 0L; + mhzPerCpu_ = 0D; + cpuInfo_ = ""; + cpuGovernor_ = ""; + internalGetMutableCacheSize().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CPUInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CPUInfo getDefaultInstanceForType() { + return org.tensorflow.proto.CPUInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CPUInfo build() { + org.tensorflow.proto.CPUInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CPUInfo buildPartial() { + org.tensorflow.proto.CPUInfo result = new org.tensorflow.proto.CPUInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CPUInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numCores_ = numCores_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numCoresAllowed_ = numCoresAllowed_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mhzPerCpu_ = mhzPerCpu_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cpuInfo_ = cpuInfo_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cpuGovernor_ = cpuGovernor_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.cacheSize_ = internalGetCacheSize(); + result.cacheSize_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CPUInfo) { + return mergeFrom((org.tensorflow.proto.CPUInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CPUInfo other) { + if (other == org.tensorflow.proto.CPUInfo.getDefaultInstance()) return this; + if (other.getNumCores() != 0L) { + setNumCores(other.getNumCores()); + } + if (other.getNumCoresAllowed() != 0L) { + setNumCoresAllowed(other.getNumCoresAllowed()); + } + if (other.getMhzPerCpu() != 0D) { + setMhzPerCpu(other.getMhzPerCpu()); + } + if (!other.getCpuInfo().isEmpty()) { + cpuInfo_ = other.cpuInfo_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getCpuGovernor().isEmpty()) { + cpuGovernor_ = other.cpuGovernor_; + bitField0_ |= 0x00000010; + onChanged(); + } + internalGetMutableCacheSize().mergeFrom( + other.internalGetCacheSize()); + bitField0_ |= 0x00000020; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + numCores_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + numCoresAllowed_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 25: { + mhzPerCpu_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 34: { + cpuInfo_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + cpuGovernor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + com.google.protobuf.MapEntry + cacheSize__ = input.readMessage( + CacheSizeDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableCacheSize().getMutableMap().put( + cacheSize__.getKey(), cacheSize__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long numCores_ ; + /** + * int64 num_cores = 1; + * @return The numCores. + */ + @java.lang.Override + public long getNumCores() { + return numCores_; + } + /** + * int64 num_cores = 1; + * @param value The numCores to set. + * @return This builder for chaining. + */ + public Builder setNumCores(long value) { + + numCores_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 num_cores = 1; + * @return This builder for chaining. + */ + public Builder clearNumCores() { + bitField0_ = (bitField0_ & ~0x00000001); + numCores_ = 0L; + onChanged(); + return this; + } + + private long numCoresAllowed_ ; + /** + * int64 num_cores_allowed = 2; + * @return The numCoresAllowed. + */ + @java.lang.Override + public long getNumCoresAllowed() { + return numCoresAllowed_; + } + /** + * int64 num_cores_allowed = 2; + * @param value The numCoresAllowed to set. + * @return This builder for chaining. + */ + public Builder setNumCoresAllowed(long value) { + + numCoresAllowed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 num_cores_allowed = 2; + * @return This builder for chaining. + */ + public Builder clearNumCoresAllowed() { + bitField0_ = (bitField0_ & ~0x00000002); + numCoresAllowed_ = 0L; + onChanged(); + return this; + } + + private double mhzPerCpu_ ; + /** + *
    +     * How fast are these cpus?
    +     * 
    + * + * double mhz_per_cpu = 3; + * @return The mhzPerCpu. + */ + @java.lang.Override + public double getMhzPerCpu() { + return mhzPerCpu_; + } + /** + *
    +     * How fast are these cpus?
    +     * 
    + * + * double mhz_per_cpu = 3; + * @param value The mhzPerCpu to set. + * @return This builder for chaining. + */ + public Builder setMhzPerCpu(double value) { + + mhzPerCpu_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * How fast are these cpus?
    +     * 
    + * + * double mhz_per_cpu = 3; + * @return This builder for chaining. + */ + public Builder clearMhzPerCpu() { + bitField0_ = (bitField0_ & ~0x00000004); + mhzPerCpu_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object cpuInfo_ = ""; + /** + *
    +     * Additional cpu information. For example,
    +     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +     * 
    + * + * string cpu_info = 4; + * @return The cpuInfo. + */ + public java.lang.String getCpuInfo() { + java.lang.Object ref = cpuInfo_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpuInfo_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Additional cpu information. For example,
    +     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +     * 
    + * + * string cpu_info = 4; + * @return The bytes for cpuInfo. + */ + public com.google.protobuf.ByteString + getCpuInfoBytes() { + java.lang.Object ref = cpuInfo_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpuInfo_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Additional cpu information. For example,
    +     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +     * 
    + * + * string cpu_info = 4; + * @param value The cpuInfo to set. + * @return This builder for chaining. + */ + public Builder setCpuInfo( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cpuInfo_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Additional cpu information. For example,
    +     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +     * 
    + * + * string cpu_info = 4; + * @return This builder for chaining. + */ + public Builder clearCpuInfo() { + cpuInfo_ = getDefaultInstance().getCpuInfo(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * Additional cpu information. For example,
    +     * Intel Ivybridge with HyperThreading (24 cores) dL1:32KB dL2:256KB dL3:30MB
    +     * 
    + * + * string cpu_info = 4; + * @param value The bytes for cpuInfo to set. + * @return This builder for chaining. + */ + public Builder setCpuInfoBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cpuInfo_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object cpuGovernor_ = ""; + /** + *
    +     * What kind of cpu scaling is enabled on the host.
    +     * Examples include "performance", "ondemand", "conservative", "mixed".
    +     * 
    + * + * string cpu_governor = 5; + * @return The cpuGovernor. + */ + public java.lang.String getCpuGovernor() { + java.lang.Object ref = cpuGovernor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpuGovernor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * What kind of cpu scaling is enabled on the host.
    +     * Examples include "performance", "ondemand", "conservative", "mixed".
    +     * 
    + * + * string cpu_governor = 5; + * @return The bytes for cpuGovernor. + */ + public com.google.protobuf.ByteString + getCpuGovernorBytes() { + java.lang.Object ref = cpuGovernor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpuGovernor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * What kind of cpu scaling is enabled on the host.
    +     * Examples include "performance", "ondemand", "conservative", "mixed".
    +     * 
    + * + * string cpu_governor = 5; + * @param value The cpuGovernor to set. + * @return This builder for chaining. + */ + public Builder setCpuGovernor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cpuGovernor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * What kind of cpu scaling is enabled on the host.
    +     * Examples include "performance", "ondemand", "conservative", "mixed".
    +     * 
    + * + * string cpu_governor = 5; + * @return This builder for chaining. + */ + public Builder clearCpuGovernor() { + cpuGovernor_ = getDefaultInstance().getCpuGovernor(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * What kind of cpu scaling is enabled on the host.
    +     * Examples include "performance", "ondemand", "conservative", "mixed".
    +     * 
    + * + * string cpu_governor = 5; + * @param value The bytes for cpuGovernor to set. + * @return This builder for chaining. + */ + public Builder setCpuGovernorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cpuGovernor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> cacheSize_; + private com.google.protobuf.MapField + internalGetCacheSize() { + if (cacheSize_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CacheSizeDefaultEntryHolder.defaultEntry); + } + return cacheSize_; + } + private com.google.protobuf.MapField + internalGetMutableCacheSize() { + if (cacheSize_ == null) { + cacheSize_ = com.google.protobuf.MapField.newMapField( + CacheSizeDefaultEntryHolder.defaultEntry); + } + if (!cacheSize_.isMutable()) { + cacheSize_ = cacheSize_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return cacheSize_; + } + public int getCacheSizeCount() { + return internalGetCacheSize().getMap().size(); + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public boolean containsCacheSize( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetCacheSize().getMap().containsKey(key); + } + /** + * Use {@link #getCacheSizeMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCacheSize() { + return getCacheSizeMap(); + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public java.util.Map getCacheSizeMap() { + return internalGetCacheSize().getMap(); + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public long getCacheSizeOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCacheSize().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + @java.lang.Override + public long getCacheSizeOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCacheSize().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearCacheSize() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableCacheSize().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + public Builder removeCacheSize( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableCacheSize().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableCacheSize() { + bitField0_ |= 0x00000020; + return internalGetMutableCacheSize().getMutableMap(); + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + public Builder putCacheSize( + java.lang.String key, + long value) { + if (key == null) { throw new NullPointerException("map key"); } + + internalGetMutableCacheSize().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +     * Cache sizes (in bytes), e.g. "L2": 262144 (for 256KB)
    +     * 
    + * + * map<string, int64> cache_size = 6; + */ + public Builder putAllCacheSize( + java.util.Map values) { + internalGetMutableCacheSize().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CPUInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CPUInfo) + private static final org.tensorflow.proto.CPUInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CPUInfo(); + } + + public static org.tensorflow.proto.CPUInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CPUInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CPUInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfoOrBuilder.java similarity index 88% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfoOrBuilder.java index be5a9556f41..7989860564f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/CPUInfoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CPUInfoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface CPUInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.CPUInfo) @@ -9,11 +11,13 @@ public interface CPUInfoOrBuilder extends /** * int64 num_cores = 1; + * @return The numCores. */ long getNumCores(); /** * int64 num_cores_allowed = 2; + * @return The numCoresAllowed. */ long getNumCoresAllowed(); @@ -23,6 +27,7 @@ public interface CPUInfoOrBuilder extends *
    * * double mhz_per_cpu = 3; + * @return The mhzPerCpu. */ double getMhzPerCpu(); @@ -33,6 +38,7 @@ public interface CPUInfoOrBuilder extends *
    * * string cpu_info = 4; + * @return The cpuInfo. */ java.lang.String getCpuInfo(); /** @@ -42,6 +48,7 @@ public interface CPUInfoOrBuilder extends *
    * * string cpu_info = 4; + * @return The bytes for cpuInfo. */ com.google.protobuf.ByteString getCpuInfoBytes(); @@ -53,6 +60,7 @@ public interface CPUInfoOrBuilder extends *
    * * string cpu_governor = 5; + * @return The cpuGovernor. */ java.lang.String getCpuGovernor(); /** @@ -62,6 +70,7 @@ public interface CPUInfoOrBuilder extends *
    * * string cpu_governor = 5; + * @return The bytes for cpuGovernor. */ com.google.protobuf.ByteString getCpuGovernorBytes(); @@ -105,7 +114,6 @@ boolean containsCacheSize( * * map<string, int64> cache_size = 6; */ - long getCacheSizeOrDefault( java.lang.String key, long defaultValue); @@ -116,7 +124,6 @@ long getCacheSizeOrDefault( * * map<string, int64> cache_size = 6; */ - long getCacheSizeOrThrow( java.lang.String key); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptions.java new file mode 100644 index 00000000000..5e11341845b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptions.java @@ -0,0 +1,3074 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines a subgraph in another `GraphDef` as a set of feed points and nodes
    + * to be fetched or executed.
    + *
    + * Compare with the arguments to `Session::Run()`.
    + * 
    + * + * Protobuf type {@code tensorflow.CallableOptions} + */ +public final class CallableOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CallableOptions) + CallableOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CallableOptions.class.getName()); + } + // Use CallableOptions.newBuilder() to construct. + private CallableOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CallableOptions() { + feed_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + fetch_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + target_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + tensorConnection_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetFeedDevices(); + case 7: + return internalGetFetchDevices(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CallableOptions.class, org.tensorflow.proto.CallableOptions.Builder.class); + } + + private int bitField0_; + public static final int FEED_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList feed_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +   * 
    + * + * repeated string feed = 1; + * @return A list containing the feed. + */ + public com.google.protobuf.ProtocolStringList + getFeedList() { + return feed_; + } + /** + *
    +   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +   * 
    + * + * repeated string feed = 1; + * @return The count of feed. + */ + public int getFeedCount() { + return feed_.size(); + } + /** + *
    +   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +   * 
    + * + * repeated string feed = 1; + * @param index The index of the element to return. + * @return The feed at the given index. + */ + public java.lang.String getFeed(int index) { + return feed_.get(index); + } + /** + *
    +   * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +   * 
    + * + * repeated string feed = 1; + * @param index The index of the value to return. + * @return The bytes of the feed at the given index. + */ + public com.google.protobuf.ByteString + getFeedBytes(int index) { + return feed_.getByteString(index); + } + + public static final int FETCH_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList fetch_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Fetches. A list of tensor names. The caller of the callable expects a
    +   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +   * order of specified fetches does not change the execution order.
    +   * 
    + * + * repeated string fetch = 2; + * @return A list containing the fetch. + */ + public com.google.protobuf.ProtocolStringList + getFetchList() { + return fetch_; + } + /** + *
    +   * Fetches. A list of tensor names. The caller of the callable expects a
    +   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +   * order of specified fetches does not change the execution order.
    +   * 
    + * + * repeated string fetch = 2; + * @return The count of fetch. + */ + public int getFetchCount() { + return fetch_.size(); + } + /** + *
    +   * Fetches. A list of tensor names. The caller of the callable expects a
    +   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +   * order of specified fetches does not change the execution order.
    +   * 
    + * + * repeated string fetch = 2; + * @param index The index of the element to return. + * @return The fetch at the given index. + */ + public java.lang.String getFetch(int index) { + return fetch_.get(index); + } + /** + *
    +   * Fetches. A list of tensor names. The caller of the callable expects a
    +   * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +   * order of specified fetches does not change the execution order.
    +   * 
    + * + * repeated string fetch = 2; + * @param index The index of the value to return. + * @return The bytes of the fetch at the given index. + */ + public com.google.protobuf.ByteString + getFetchBytes(int index) { + return fetch_.getByteString(index); + } + + public static final int TARGET_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList target_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Target Nodes. A list of node names. The named nodes will be run by the
    +   * callable but their outputs will not be returned.
    +   * 
    + * + * repeated string target = 3; + * @return A list containing the target. + */ + public com.google.protobuf.ProtocolStringList + getTargetList() { + return target_; + } + /** + *
    +   * Target Nodes. A list of node names. The named nodes will be run by the
    +   * callable but their outputs will not be returned.
    +   * 
    + * + * repeated string target = 3; + * @return The count of target. + */ + public int getTargetCount() { + return target_.size(); + } + /** + *
    +   * Target Nodes. A list of node names. The named nodes will be run by the
    +   * callable but their outputs will not be returned.
    +   * 
    + * + * repeated string target = 3; + * @param index The index of the element to return. + * @return The target at the given index. + */ + public java.lang.String getTarget(int index) { + return target_.get(index); + } + /** + *
    +   * Target Nodes. A list of node names. The named nodes will be run by the
    +   * callable but their outputs will not be returned.
    +   * 
    + * + * repeated string target = 3; + * @param index The index of the value to return. + * @return The bytes of the target at the given index. + */ + public com.google.protobuf.ByteString + getTargetBytes(int index) { + return target_.getByteString(index); + } + + public static final int RUN_OPTIONS_FIELD_NUMBER = 4; + private org.tensorflow.proto.RunOptions runOptions_; + /** + *
    +   * Options that will be applied to each run.
    +   * 
    + * + * .tensorflow.RunOptions run_options = 4; + * @return Whether the runOptions field is set. + */ + @java.lang.Override + public boolean hasRunOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Options that will be applied to each run.
    +   * 
    + * + * .tensorflow.RunOptions run_options = 4; + * @return The runOptions. + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions getRunOptions() { + return runOptions_ == null ? org.tensorflow.proto.RunOptions.getDefaultInstance() : runOptions_; + } + /** + *
    +   * Options that will be applied to each run.
    +   * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + @java.lang.Override + public org.tensorflow.proto.RunOptionsOrBuilder getRunOptionsOrBuilder() { + return runOptions_ == null ? org.tensorflow.proto.RunOptions.getDefaultInstance() : runOptions_; + } + + public static final int TENSOR_CONNECTION_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List tensorConnection_; + /** + *
    +   * Tensors to be connected in the callable. Each TensorConnection denotes
    +   * a pair of tensors in the graph, between which an edge will be created
    +   * in the callable.
    +   * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + @java.lang.Override + public java.util.List getTensorConnectionList() { + return tensorConnection_; + } + /** + *
    +   * Tensors to be connected in the callable. Each TensorConnection denotes
    +   * a pair of tensors in the graph, between which an edge will be created
    +   * in the callable.
    +   * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + @java.lang.Override + public java.util.List + getTensorConnectionOrBuilderList() { + return tensorConnection_; + } + /** + *
    +   * Tensors to be connected in the callable. Each TensorConnection denotes
    +   * a pair of tensors in the graph, between which an edge will be created
    +   * in the callable.
    +   * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + @java.lang.Override + public int getTensorConnectionCount() { + return tensorConnection_.size(); + } + /** + *
    +   * Tensors to be connected in the callable. Each TensorConnection denotes
    +   * a pair of tensors in the graph, between which an edge will be created
    +   * in the callable.
    +   * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorConnection getTensorConnection(int index) { + return tensorConnection_.get(index); + } + /** + *
    +   * Tensors to be connected in the callable. Each TensorConnection denotes
    +   * a pair of tensors in the graph, between which an edge will be created
    +   * in the callable.
    +   * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorConnectionOrBuilder getTensorConnectionOrBuilder( + int index) { + return tensorConnection_.get(index); + } + + public static final int FEED_DEVICES_FIELD_NUMBER = 6; + private static final class FeedDevicesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> feedDevices_; + private com.google.protobuf.MapField + internalGetFeedDevices() { + if (feedDevices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeedDevicesDefaultEntryHolder.defaultEntry); + } + return feedDevices_; + } + public int getFeedDevicesCount() { + return internalGetFeedDevices().getMap().size(); + } + /** + *
    +   * The Tensor objects fed in the callable and fetched from the callable
    +   * are expected to be backed by host (CPU) memory by default.
    +   *
    +   * The options below allow changing that - feeding tensors backed by
    +   * device memory, or returning tensors that are backed by device memory.
    +   *
    +   * The maps below map the name of a feed/fetch tensor (which appears in
    +   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +   * owning the memory backing the contents of the tensor.
    +   *
    +   * For example, creating a callable with the following options:
    +   *
    +   * CallableOptions {
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   * }
    +   *
    +   * means that the Callable expects:
    +   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +   * - The second argument ("b:0") is a Tensor backed by host memory.
    +   * and of its return values:
    +   * - The first output ("x:0") will be backed by host memory.
    +   * - The second output ("y:0") will be backed by GPU memory.
    +   *
    +   * FEEDS:
    +   * It is the responsibility of the caller to ensure that the memory of the fed
    +   * tensors will be correctly initialized and synchronized before it is
    +   * accessed by operations executed during the call to Session::RunCallable().
    +   *
    +   * This is typically ensured by using the TensorFlow memory allocators
    +   * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
    +   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +   * operation that produced the contents of the tensor has completed, i.e., the
    +   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +   * cuStreamSynchronize()).
    +   * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public boolean containsFeedDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeedDevices().getMap().containsKey(key); + } + /** + * Use {@link #getFeedDevicesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeedDevices() { + return getFeedDevicesMap(); + } + /** + *
    +   * The Tensor objects fed in the callable and fetched from the callable
    +   * are expected to be backed by host (CPU) memory by default.
    +   *
    +   * The options below allow changing that - feeding tensors backed by
    +   * device memory, or returning tensors that are backed by device memory.
    +   *
    +   * The maps below map the name of a feed/fetch tensor (which appears in
    +   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +   * owning the memory backing the contents of the tensor.
    +   *
    +   * For example, creating a callable with the following options:
    +   *
    +   * CallableOptions {
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   * }
    +   *
    +   * means that the Callable expects:
    +   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +   * - The second argument ("b:0") is a Tensor backed by host memory.
    +   * and of its return values:
    +   * - The first output ("x:0") will be backed by host memory.
    +   * - The second output ("y:0") will be backed by GPU memory.
    +   *
    +   * FEEDS:
    +   * It is the responsibility of the caller to ensure that the memory of the fed
    +   * tensors will be correctly initialized and synchronized before it is
    +   * accessed by operations executed during the call to Session::RunCallable().
    +   *
    +   * This is typically ensured by using the TensorFlow memory allocators
    +   * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
    +   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +   * operation that produced the contents of the tensor has completed, i.e., the
    +   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +   * cuStreamSynchronize()).
    +   * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public java.util.Map getFeedDevicesMap() { + return internalGetFeedDevices().getMap(); + } + /** + *
    +   * The Tensor objects fed in the callable and fetched from the callable
    +   * are expected to be backed by host (CPU) memory by default.
    +   *
    +   * The options below allow changing that - feeding tensors backed by
    +   * device memory, or returning tensors that are backed by device memory.
    +   *
    +   * The maps below map the name of a feed/fetch tensor (which appears in
    +   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +   * owning the memory backing the contents of the tensor.
    +   *
    +   * For example, creating a callable with the following options:
    +   *
    +   * CallableOptions {
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   * }
    +   *
    +   * means that the Callable expects:
    +   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +   * - The second argument ("b:0") is a Tensor backed by host memory.
    +   * and of its return values:
    +   * - The first output ("x:0") will be backed by host memory.
    +   * - The second output ("y:0") will be backed by GPU memory.
    +   *
    +   * FEEDS:
    +   * It is the responsibility of the caller to ensure that the memory of the fed
    +   * tensors will be correctly initialized and synchronized before it is
    +   * accessed by operations executed during the call to Session::RunCallable().
    +   *
    +   * This is typically ensured by using the TensorFlow memory allocators
    +   * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
    +   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +   * operation that produced the contents of the tensor has completed, i.e., the
    +   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +   * cuStreamSynchronize()).
    +   * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFeedDevicesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeedDevices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * The Tensor objects fed in the callable and fetched from the callable
    +   * are expected to be backed by host (CPU) memory by default.
    +   *
    +   * The options below allow changing that - feeding tensors backed by
    +   * device memory, or returning tensors that are backed by device memory.
    +   *
    +   * The maps below map the name of a feed/fetch tensor (which appears in
    +   * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +   * owning the memory backing the contents of the tensor.
    +   *
    +   * For example, creating a callable with the following options:
    +   *
    +   * CallableOptions {
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   * }
    +   *
    +   * means that the Callable expects:
    +   * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +   * - The second argument ("b:0") is a Tensor backed by host memory.
    +   * and of its return values:
    +   * - The first output ("x:0") will be backed by host memory.
    +   * - The second output ("y:0") will be backed by GPU memory.
    +   *
    +   * FEEDS:
    +   * It is the responsibility of the caller to ensure that the memory of the fed
    +   * tensors will be correctly initialized and synchronized before it is
    +   * accessed by operations executed during the call to Session::RunCallable().
    +   *
    +   * This is typically ensured by using the TensorFlow memory allocators
    +   * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
    +   * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +   * operation that produced the contents of the tensor has completed, i.e., the
    +   * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +   * cuStreamSynchronize()).
    +   * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public java.lang.String getFeedDevicesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeedDevices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FETCH_DEVICES_FIELD_NUMBER = 7; + private static final class FetchDevicesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> fetchDevices_; + private com.google.protobuf.MapField + internalGetFetchDevices() { + if (fetchDevices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FetchDevicesDefaultEntryHolder.defaultEntry); + } + return fetchDevices_; + } + public int getFetchDevicesCount() { + return internalGetFetchDevices().getMap().size(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public boolean containsFetchDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFetchDevices().getMap().containsKey(key); + } + /** + * Use {@link #getFetchDevicesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFetchDevices() { + return getFetchDevicesMap(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public java.util.Map getFetchDevicesMap() { + return internalGetFetchDevices().getMap(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFetchDevicesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFetchDevices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public java.lang.String getFetchDevicesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFetchDevices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int FETCH_SKIP_SYNC_FIELD_NUMBER = 8; + private boolean fetchSkipSync_ = false; + /** + *
    +   * By default, RunCallable() will synchronize the GPU stream before returning
    +   * fetched tensors on a GPU device, to ensure that the values in those tensors
    +   * have been produced. This simplifies interacting with the tensors, but
    +   * potentially incurs a performance hit.
    +   *
    +   * If this options is set to true, the caller is responsible for ensuring
    +   * that the values in the fetched tensors have been produced before they are
    +   * used. The caller can do this by invoking `Device::Sync()` on the underlying
    +   * device(s), or by feeding the tensors back to the same Session using
    +   * `feed_devices` with the same corresponding device name.
    +   * 
    + * + * bool fetch_skip_sync = 8; + * @return The fetchSkipSync. + */ + @java.lang.Override + public boolean getFetchSkipSync() { + return fetchSkipSync_; + } + + 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 { + for (int i = 0; i < feed_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, feed_.getRaw(i)); + } + for (int i = 0; i < fetch_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, fetch_.getRaw(i)); + } + for (int i = 0; i < target_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, target_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getRunOptions()); + } + for (int i = 0; i < tensorConnection_.size(); i++) { + output.writeMessage(5, tensorConnection_.get(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFeedDevices(), + FeedDevicesDefaultEntryHolder.defaultEntry, + 6); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFetchDevices(), + FetchDevicesDefaultEntryHolder.defaultEntry, + 7); + if (fetchSkipSync_ != false) { + output.writeBool(8, fetchSkipSync_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < feed_.size(); i++) { + dataSize += computeStringSizeNoTag(feed_.getRaw(i)); + } + size += dataSize; + size += 1 * getFeedList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < fetch_.size(); i++) { + dataSize += computeStringSizeNoTag(fetch_.getRaw(i)); + } + size += dataSize; + size += 1 * getFetchList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < target_.size(); i++) { + dataSize += computeStringSizeNoTag(target_.getRaw(i)); + } + size += dataSize; + size += 1 * getTargetList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getRunOptions()); + } + for (int i = 0; i < tensorConnection_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, tensorConnection_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetFeedDevices().getMap().entrySet()) { + com.google.protobuf.MapEntry + feedDevices__ = FeedDevicesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, feedDevices__); + } + for (java.util.Map.Entry entry + : internalGetFetchDevices().getMap().entrySet()) { + com.google.protobuf.MapEntry + fetchDevices__ = FetchDevicesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, fetchDevices__); + } + if (fetchSkipSync_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, fetchSkipSync_); + } + size += getUnknownFields().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.CallableOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.CallableOptions other = (org.tensorflow.proto.CallableOptions) obj; + + if (!getFeedList() + .equals(other.getFeedList())) return false; + if (!getFetchList() + .equals(other.getFetchList())) return false; + if (!getTargetList() + .equals(other.getTargetList())) return false; + if (hasRunOptions() != other.hasRunOptions()) return false; + if (hasRunOptions()) { + if (!getRunOptions() + .equals(other.getRunOptions())) return false; + } + if (!getTensorConnectionList() + .equals(other.getTensorConnectionList())) return false; + if (!internalGetFeedDevices().equals( + other.internalGetFeedDevices())) return false; + if (!internalGetFetchDevices().equals( + other.internalGetFetchDevices())) return false; + if (getFetchSkipSync() + != other.getFetchSkipSync()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFeedCount() > 0) { + hash = (37 * hash) + FEED_FIELD_NUMBER; + hash = (53 * hash) + getFeedList().hashCode(); + } + if (getFetchCount() > 0) { + hash = (37 * hash) + FETCH_FIELD_NUMBER; + hash = (53 * hash) + getFetchList().hashCode(); + } + if (getTargetCount() > 0) { + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTargetList().hashCode(); + } + if (hasRunOptions()) { + hash = (37 * hash) + RUN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRunOptions().hashCode(); + } + if (getTensorConnectionCount() > 0) { + hash = (37 * hash) + TENSOR_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getTensorConnectionList().hashCode(); + } + if (!internalGetFeedDevices().getMap().isEmpty()) { + hash = (37 * hash) + FEED_DEVICES_FIELD_NUMBER; + hash = (53 * hash) + internalGetFeedDevices().hashCode(); + } + if (!internalGetFetchDevices().getMap().isEmpty()) { + hash = (37 * hash) + FETCH_DEVICES_FIELD_NUMBER; + hash = (53 * hash) + internalGetFetchDevices().hashCode(); + } + hash = (37 * hash) + FETCH_SKIP_SYNC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFetchSkipSync()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CallableOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CallableOptions 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.CallableOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CallableOptions 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.CallableOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CallableOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CallableOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CallableOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CallableOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CallableOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CallableOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CallableOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CallableOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines a subgraph in another `GraphDef` as a set of feed points and nodes
    +   * to be fetched or executed.
    +   *
    +   * Compare with the arguments to `Session::Run()`.
    +   * 
    + * + * Protobuf type {@code tensorflow.CallableOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CallableOptions) + org.tensorflow.proto.CallableOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetFeedDevices(); + case 7: + return internalGetFetchDevices(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableFeedDevices(); + case 7: + return internalGetMutableFetchDevices(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CallableOptions.class, org.tensorflow.proto.CallableOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.CallableOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getRunOptionsFieldBuilder(); + getTensorConnectionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + feed_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + fetch_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + target_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + runOptions_ = null; + if (runOptionsBuilder_ != null) { + runOptionsBuilder_.dispose(); + runOptionsBuilder_ = null; + } + if (tensorConnectionBuilder_ == null) { + tensorConnection_ = java.util.Collections.emptyList(); + } else { + tensorConnection_ = null; + tensorConnectionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableFeedDevices().clear(); + internalGetMutableFetchDevices().clear(); + fetchSkipSync_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_CallableOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CallableOptions getDefaultInstanceForType() { + return org.tensorflow.proto.CallableOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CallableOptions build() { + org.tensorflow.proto.CallableOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CallableOptions buildPartial() { + org.tensorflow.proto.CallableOptions result = new org.tensorflow.proto.CallableOptions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CallableOptions result) { + if (tensorConnectionBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + tensorConnection_ = java.util.Collections.unmodifiableList(tensorConnection_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.tensorConnection_ = tensorConnection_; + } else { + result.tensorConnection_ = tensorConnectionBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CallableOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + feed_.makeImmutable(); + result.feed_ = feed_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + fetch_.makeImmutable(); + result.fetch_ = fetch_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + target_.makeImmutable(); + result.target_ = target_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.runOptions_ = runOptionsBuilder_ == null + ? runOptions_ + : runOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.feedDevices_ = internalGetFeedDevices(); + result.feedDevices_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fetchDevices_ = internalGetFetchDevices(); + result.fetchDevices_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fetchSkipSync_ = fetchSkipSync_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CallableOptions) { + return mergeFrom((org.tensorflow.proto.CallableOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CallableOptions other) { + if (other == org.tensorflow.proto.CallableOptions.getDefaultInstance()) return this; + if (!other.feed_.isEmpty()) { + if (feed_.isEmpty()) { + feed_ = other.feed_; + bitField0_ |= 0x00000001; + } else { + ensureFeedIsMutable(); + feed_.addAll(other.feed_); + } + onChanged(); + } + if (!other.fetch_.isEmpty()) { + if (fetch_.isEmpty()) { + fetch_ = other.fetch_; + bitField0_ |= 0x00000002; + } else { + ensureFetchIsMutable(); + fetch_.addAll(other.fetch_); + } + onChanged(); + } + if (!other.target_.isEmpty()) { + if (target_.isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + } else { + ensureTargetIsMutable(); + target_.addAll(other.target_); + } + onChanged(); + } + if (other.hasRunOptions()) { + mergeRunOptions(other.getRunOptions()); + } + if (tensorConnectionBuilder_ == null) { + if (!other.tensorConnection_.isEmpty()) { + if (tensorConnection_.isEmpty()) { + tensorConnection_ = other.tensorConnection_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureTensorConnectionIsMutable(); + tensorConnection_.addAll(other.tensorConnection_); + } + onChanged(); + } + } else { + if (!other.tensorConnection_.isEmpty()) { + if (tensorConnectionBuilder_.isEmpty()) { + tensorConnectionBuilder_.dispose(); + tensorConnectionBuilder_ = null; + tensorConnection_ = other.tensorConnection_; + bitField0_ = (bitField0_ & ~0x00000010); + tensorConnectionBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorConnectionFieldBuilder() : null; + } else { + tensorConnectionBuilder_.addAllMessages(other.tensorConnection_); + } + } + } + internalGetMutableFeedDevices().mergeFrom( + other.internalGetFeedDevices()); + bitField0_ |= 0x00000020; + internalGetMutableFetchDevices().mergeFrom( + other.internalGetFetchDevices()); + bitField0_ |= 0x00000040; + if (other.getFetchSkipSync() != false) { + setFetchSkipSync(other.getFetchSkipSync()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureFeedIsMutable(); + feed_.add(s); + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureFetchIsMutable(); + fetch_.add(s); + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureTargetIsMutable(); + target_.add(s); + break; + } // case 26 + case 34: { + input.readMessage( + getRunOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + org.tensorflow.proto.TensorConnection m = + input.readMessage( + org.tensorflow.proto.TensorConnection.parser(), + extensionRegistry); + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + tensorConnection_.add(m); + } else { + tensorConnectionBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + com.google.protobuf.MapEntry + feedDevices__ = input.readMessage( + FeedDevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFeedDevices().getMutableMap().put( + feedDevices__.getKey(), feedDevices__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + com.google.protobuf.MapEntry + fetchDevices__ = input.readMessage( + FetchDevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFetchDevices().getMutableMap().put( + fetchDevices__.getKey(), fetchDevices__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: { + fetchSkipSync_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList feed_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFeedIsMutable() { + if (!feed_.isModifiable()) { + feed_ = new com.google.protobuf.LazyStringArrayList(feed_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @return A list containing the feed. + */ + public com.google.protobuf.ProtocolStringList + getFeedList() { + feed_.makeImmutable(); + return feed_; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @return The count of feed. + */ + public int getFeedCount() { + return feed_.size(); + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param index The index of the element to return. + * @return The feed at the given index. + */ + public java.lang.String getFeed(int index) { + return feed_.get(index); + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param index The index of the value to return. + * @return The bytes of the feed at the given index. + */ + public com.google.protobuf.ByteString + getFeedBytes(int index) { + return feed_.getByteString(index); + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param index The index to set the value at. + * @param value The feed to set. + * @return This builder for chaining. + */ + public Builder setFeed( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFeedIsMutable(); + feed_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param value The feed to add. + * @return This builder for chaining. + */ + public Builder addFeed( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFeedIsMutable(); + feed_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param values The feed to add. + * @return This builder for chaining. + */ + public Builder addAllFeed( + java.lang.Iterable values) { + ensureFeedIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, feed_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @return This builder for chaining. + */ + public Builder clearFeed() { + feed_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
    +     * Tensors to be fed in the callable. Each feed is the name of a tensor.
    +     * 
    + * + * repeated string feed = 1; + * @param value The bytes of the feed to add. + * @return This builder for chaining. + */ + public Builder addFeedBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureFeedIsMutable(); + feed_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList fetch_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFetchIsMutable() { + if (!fetch_.isModifiable()) { + fetch_ = new com.google.protobuf.LazyStringArrayList(fetch_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @return A list containing the fetch. + */ + public com.google.protobuf.ProtocolStringList + getFetchList() { + fetch_.makeImmutable(); + return fetch_; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @return The count of fetch. + */ + public int getFetchCount() { + return fetch_.size(); + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param index The index of the element to return. + * @return The fetch at the given index. + */ + public java.lang.String getFetch(int index) { + return fetch_.get(index); + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param index The index of the value to return. + * @return The bytes of the fetch at the given index. + */ + public com.google.protobuf.ByteString + getFetchBytes(int index) { + return fetch_.getByteString(index); + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param index The index to set the value at. + * @param value The fetch to set. + * @return This builder for chaining. + */ + public Builder setFetch( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFetchIsMutable(); + fetch_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param value The fetch to add. + * @return This builder for chaining. + */ + public Builder addFetch( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFetchIsMutable(); + fetch_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param values The fetch to add. + * @return This builder for chaining. + */ + public Builder addAllFetch( + java.lang.Iterable values) { + ensureFetchIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fetch_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @return This builder for chaining. + */ + public Builder clearFetch() { + fetch_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +     * Fetches. A list of tensor names. The caller of the callable expects a
    +     * tensor to be returned for each fetch[i] (see RunStepResponse.tensor). The
    +     * order of specified fetches does not change the execution order.
    +     * 
    + * + * repeated string fetch = 2; + * @param value The bytes of the fetch to add. + * @return This builder for chaining. + */ + public Builder addFetchBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureFetchIsMutable(); + fetch_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList target_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureTargetIsMutable() { + if (!target_.isModifiable()) { + target_ = new com.google.protobuf.LazyStringArrayList(target_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @return A list containing the target. + */ + public com.google.protobuf.ProtocolStringList + getTargetList() { + target_.makeImmutable(); + return target_; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @return The count of target. + */ + public int getTargetCount() { + return target_.size(); + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param index The index of the element to return. + * @return The target at the given index. + */ + public java.lang.String getTarget(int index) { + return target_.get(index); + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param index The index of the value to return. + * @return The bytes of the target at the given index. + */ + public com.google.protobuf.ByteString + getTargetBytes(int index) { + return target_.getByteString(index); + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param index The index to set the value at. + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTargetIsMutable(); + target_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param value The target to add. + * @return This builder for chaining. + */ + public Builder addTarget( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTargetIsMutable(); + target_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param values The target to add. + * @return This builder for chaining. + */ + public Builder addAllTarget( + java.lang.Iterable values) { + ensureTargetIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, target_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Target Nodes. A list of node names. The named nodes will be run by the
    +     * callable but their outputs will not be returned.
    +     * 
    + * + * repeated string target = 3; + * @param value The bytes of the target to add. + * @return This builder for chaining. + */ + public Builder addTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureTargetIsMutable(); + target_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private org.tensorflow.proto.RunOptions runOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions, org.tensorflow.proto.RunOptions.Builder, org.tensorflow.proto.RunOptionsOrBuilder> runOptionsBuilder_; + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + * @return Whether the runOptions field is set. + */ + public boolean hasRunOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + * @return The runOptions. + */ + public org.tensorflow.proto.RunOptions getRunOptions() { + if (runOptionsBuilder_ == null) { + return runOptions_ == null ? org.tensorflow.proto.RunOptions.getDefaultInstance() : runOptions_; + } else { + return runOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public Builder setRunOptions(org.tensorflow.proto.RunOptions value) { + if (runOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runOptions_ = value; + } else { + runOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public Builder setRunOptions( + org.tensorflow.proto.RunOptions.Builder builderForValue) { + if (runOptionsBuilder_ == null) { + runOptions_ = builderForValue.build(); + } else { + runOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public Builder mergeRunOptions(org.tensorflow.proto.RunOptions value) { + if (runOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + runOptions_ != null && + runOptions_ != org.tensorflow.proto.RunOptions.getDefaultInstance()) { + getRunOptionsBuilder().mergeFrom(value); + } else { + runOptions_ = value; + } + } else { + runOptionsBuilder_.mergeFrom(value); + } + if (runOptions_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public Builder clearRunOptions() { + bitField0_ = (bitField0_ & ~0x00000008); + runOptions_ = null; + if (runOptionsBuilder_ != null) { + runOptionsBuilder_.dispose(); + runOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public org.tensorflow.proto.RunOptions.Builder getRunOptionsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRunOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + public org.tensorflow.proto.RunOptionsOrBuilder getRunOptionsOrBuilder() { + if (runOptionsBuilder_ != null) { + return runOptionsBuilder_.getMessageOrBuilder(); + } else { + return runOptions_ == null ? + org.tensorflow.proto.RunOptions.getDefaultInstance() : runOptions_; + } + } + /** + *
    +     * Options that will be applied to each run.
    +     * 
    + * + * .tensorflow.RunOptions run_options = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions, org.tensorflow.proto.RunOptions.Builder, org.tensorflow.proto.RunOptionsOrBuilder> + getRunOptionsFieldBuilder() { + if (runOptionsBuilder_ == null) { + runOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions, org.tensorflow.proto.RunOptions.Builder, org.tensorflow.proto.RunOptionsOrBuilder>( + getRunOptions(), + getParentForChildren(), + isClean()); + runOptions_ = null; + } + return runOptionsBuilder_; + } + + private java.util.List tensorConnection_ = + java.util.Collections.emptyList(); + private void ensureTensorConnectionIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + tensorConnection_ = new java.util.ArrayList(tensorConnection_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorConnection, org.tensorflow.proto.TensorConnection.Builder, org.tensorflow.proto.TensorConnectionOrBuilder> tensorConnectionBuilder_; + + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public java.util.List getTensorConnectionList() { + if (tensorConnectionBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensorConnection_); + } else { + return tensorConnectionBuilder_.getMessageList(); + } + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public int getTensorConnectionCount() { + if (tensorConnectionBuilder_ == null) { + return tensorConnection_.size(); + } else { + return tensorConnectionBuilder_.getCount(); + } + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public org.tensorflow.proto.TensorConnection getTensorConnection(int index) { + if (tensorConnectionBuilder_ == null) { + return tensorConnection_.get(index); + } else { + return tensorConnectionBuilder_.getMessage(index); + } + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder setTensorConnection( + int index, org.tensorflow.proto.TensorConnection value) { + if (tensorConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorConnectionIsMutable(); + tensorConnection_.set(index, value); + onChanged(); + } else { + tensorConnectionBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder setTensorConnection( + int index, org.tensorflow.proto.TensorConnection.Builder builderForValue) { + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + tensorConnection_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorConnectionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder addTensorConnection(org.tensorflow.proto.TensorConnection value) { + if (tensorConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorConnectionIsMutable(); + tensorConnection_.add(value); + onChanged(); + } else { + tensorConnectionBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder addTensorConnection( + int index, org.tensorflow.proto.TensorConnection value) { + if (tensorConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorConnectionIsMutable(); + tensorConnection_.add(index, value); + onChanged(); + } else { + tensorConnectionBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder addTensorConnection( + org.tensorflow.proto.TensorConnection.Builder builderForValue) { + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + tensorConnection_.add(builderForValue.build()); + onChanged(); + } else { + tensorConnectionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder addTensorConnection( + int index, org.tensorflow.proto.TensorConnection.Builder builderForValue) { + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + tensorConnection_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorConnectionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder addAllTensorConnection( + java.lang.Iterable values) { + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensorConnection_); + onChanged(); + } else { + tensorConnectionBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder clearTensorConnection() { + if (tensorConnectionBuilder_ == null) { + tensorConnection_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + tensorConnectionBuilder_.clear(); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public Builder removeTensorConnection(int index) { + if (tensorConnectionBuilder_ == null) { + ensureTensorConnectionIsMutable(); + tensorConnection_.remove(index); + onChanged(); + } else { + tensorConnectionBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public org.tensorflow.proto.TensorConnection.Builder getTensorConnectionBuilder( + int index) { + return getTensorConnectionFieldBuilder().getBuilder(index); + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public org.tensorflow.proto.TensorConnectionOrBuilder getTensorConnectionOrBuilder( + int index) { + if (tensorConnectionBuilder_ == null) { + return tensorConnection_.get(index); } else { + return tensorConnectionBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public java.util.List + getTensorConnectionOrBuilderList() { + if (tensorConnectionBuilder_ != null) { + return tensorConnectionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensorConnection_); + } + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public org.tensorflow.proto.TensorConnection.Builder addTensorConnectionBuilder() { + return getTensorConnectionFieldBuilder().addBuilder( + org.tensorflow.proto.TensorConnection.getDefaultInstance()); + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public org.tensorflow.proto.TensorConnection.Builder addTensorConnectionBuilder( + int index) { + return getTensorConnectionFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorConnection.getDefaultInstance()); + } + /** + *
    +     * Tensors to be connected in the callable. Each TensorConnection denotes
    +     * a pair of tensors in the graph, between which an edge will be created
    +     * in the callable.
    +     * 
    + * + * repeated .tensorflow.TensorConnection tensor_connection = 5; + */ + public java.util.List + getTensorConnectionBuilderList() { + return getTensorConnectionFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorConnection, org.tensorflow.proto.TensorConnection.Builder, org.tensorflow.proto.TensorConnectionOrBuilder> + getTensorConnectionFieldBuilder() { + if (tensorConnectionBuilder_ == null) { + tensorConnectionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorConnection, org.tensorflow.proto.TensorConnection.Builder, org.tensorflow.proto.TensorConnectionOrBuilder>( + tensorConnection_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + tensorConnection_ = null; + } + return tensorConnectionBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> feedDevices_; + private com.google.protobuf.MapField + internalGetFeedDevices() { + if (feedDevices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeedDevicesDefaultEntryHolder.defaultEntry); + } + return feedDevices_; + } + private com.google.protobuf.MapField + internalGetMutableFeedDevices() { + if (feedDevices_ == null) { + feedDevices_ = com.google.protobuf.MapField.newMapField( + FeedDevicesDefaultEntryHolder.defaultEntry); + } + if (!feedDevices_.isMutable()) { + feedDevices_ = feedDevices_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return feedDevices_; + } + public int getFeedDevicesCount() { + return internalGetFeedDevices().getMap().size(); + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public boolean containsFeedDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeedDevices().getMap().containsKey(key); + } + /** + * Use {@link #getFeedDevicesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeedDevices() { + return getFeedDevicesMap(); + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public java.util.Map getFeedDevicesMap() { + return internalGetFeedDevices().getMap(); + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFeedDevicesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeedDevices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + @java.lang.Override + public java.lang.String getFeedDevicesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeedDevices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearFeedDevices() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableFeedDevices().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + public Builder removeFeedDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFeedDevices().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFeedDevices() { + bitField0_ |= 0x00000020; + return internalGetMutableFeedDevices().getMutableMap(); + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + public Builder putFeedDevices( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFeedDevices().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +     * The Tensor objects fed in the callable and fetched from the callable
    +     * are expected to be backed by host (CPU) memory by default.
    +     *
    +     * The options below allow changing that - feeding tensors backed by
    +     * device memory, or returning tensors that are backed by device memory.
    +     *
    +     * The maps below map the name of a feed/fetch tensor (which appears in
    +     * 'feed' or 'fetch' fields above), to the fully qualified name of the device
    +     * owning the memory backing the contents of the tensor.
    +     *
    +     * For example, creating a callable with the following options:
    +     *
    +     * CallableOptions {
    +     * feed: "a:0"
    +     * feed: "b:0"
    +     *
    +     * fetch: "x:0"
    +     * fetch: "y:0"
    +     *
    +     * feed_devices: {
    +     * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     *
    +     * fetch_devices: {
    +     * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +     * }
    +     * }
    +     *
    +     * means that the Callable expects:
    +     * - The first argument ("a:0") is a Tensor backed by GPU memory.
    +     * - The second argument ("b:0") is a Tensor backed by host memory.
    +     * and of its return values:
    +     * - The first output ("x:0") will be backed by host memory.
    +     * - The second output ("y:0") will be backed by GPU memory.
    +     *
    +     * FEEDS:
    +     * It is the responsibility of the caller to ensure that the memory of the fed
    +     * tensors will be correctly initialized and synchronized before it is
    +     * accessed by operations executed during the call to Session::RunCallable().
    +     *
    +     * This is typically ensured by using the TensorFlow memory allocators
    +     * (Device::GetAllocator()) to create the Tensor to be fed.
    +     *
    +     * Alternatively, for CUDA-enabled GPU devices, this typically means that the
    +     * operation that produced the contents of the tensor has completed, i.e., the
    +     * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    +     * cuStreamSynchronize()).
    +     * 
    + * + * map<string, string> feed_devices = 6; + */ + public Builder putAllFeedDevices( + java.util.Map values) { + internalGetMutableFeedDevices().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> fetchDevices_; + private com.google.protobuf.MapField + internalGetFetchDevices() { + if (fetchDevices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FetchDevicesDefaultEntryHolder.defaultEntry); + } + return fetchDevices_; + } + private com.google.protobuf.MapField + internalGetMutableFetchDevices() { + if (fetchDevices_ == null) { + fetchDevices_ = com.google.protobuf.MapField.newMapField( + FetchDevicesDefaultEntryHolder.defaultEntry); + } + if (!fetchDevices_.isMutable()) { + fetchDevices_ = fetchDevices_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return fetchDevices_; + } + public int getFetchDevicesCount() { + return internalGetFetchDevices().getMap().size(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public boolean containsFetchDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFetchDevices().getMap().containsKey(key); + } + /** + * Use {@link #getFetchDevicesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFetchDevices() { + return getFetchDevicesMap(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public java.util.Map getFetchDevicesMap() { + return internalGetFetchDevices().getMap(); + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFetchDevicesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFetchDevices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> fetch_devices = 7; + */ + @java.lang.Override + public java.lang.String getFetchDevicesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFetchDevices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearFetchDevices() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableFetchDevices().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> fetch_devices = 7; + */ + public Builder removeFetchDevices( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFetchDevices().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFetchDevices() { + bitField0_ |= 0x00000040; + return internalGetMutableFetchDevices().getMutableMap(); + } + /** + * map<string, string> fetch_devices = 7; + */ + public Builder putFetchDevices( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFetchDevices().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + * map<string, string> fetch_devices = 7; + */ + public Builder putAllFetchDevices( + java.util.Map values) { + internalGetMutableFetchDevices().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private boolean fetchSkipSync_ ; + /** + *
    +     * By default, RunCallable() will synchronize the GPU stream before returning
    +     * fetched tensors on a GPU device, to ensure that the values in those tensors
    +     * have been produced. This simplifies interacting with the tensors, but
    +     * potentially incurs a performance hit.
    +     *
    +     * If this options is set to true, the caller is responsible for ensuring
    +     * that the values in the fetched tensors have been produced before they are
    +     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    +     * device(s), or by feeding the tensors back to the same Session using
    +     * `feed_devices` with the same corresponding device name.
    +     * 
    + * + * bool fetch_skip_sync = 8; + * @return The fetchSkipSync. + */ + @java.lang.Override + public boolean getFetchSkipSync() { + return fetchSkipSync_; + } + /** + *
    +     * By default, RunCallable() will synchronize the GPU stream before returning
    +     * fetched tensors on a GPU device, to ensure that the values in those tensors
    +     * have been produced. This simplifies interacting with the tensors, but
    +     * potentially incurs a performance hit.
    +     *
    +     * If this options is set to true, the caller is responsible for ensuring
    +     * that the values in the fetched tensors have been produced before they are
    +     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    +     * device(s), or by feeding the tensors back to the same Session using
    +     * `feed_devices` with the same corresponding device name.
    +     * 
    + * + * bool fetch_skip_sync = 8; + * @param value The fetchSkipSync to set. + * @return This builder for chaining. + */ + public Builder setFetchSkipSync(boolean value) { + + fetchSkipSync_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * By default, RunCallable() will synchronize the GPU stream before returning
    +     * fetched tensors on a GPU device, to ensure that the values in those tensors
    +     * have been produced. This simplifies interacting with the tensors, but
    +     * potentially incurs a performance hit.
    +     *
    +     * If this options is set to true, the caller is responsible for ensuring
    +     * that the values in the fetched tensors have been produced before they are
    +     * used. The caller can do this by invoking `Device::Sync()` on the underlying
    +     * device(s), or by feeding the tensors back to the same Session using
    +     * `feed_devices` with the same corresponding device name.
    +     * 
    + * + * bool fetch_skip_sync = 8; + * @return This builder for chaining. + */ + public Builder clearFetchSkipSync() { + bitField0_ = (bitField0_ & ~0x00000080); + fetchSkipSync_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CallableOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CallableOptions) + private static final org.tensorflow.proto.CallableOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CallableOptions(); + } + + public static org.tensorflow.proto.CallableOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CallableOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CallableOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptionsOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptionsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptionsOrBuilder.java index d65852d4843..422a47d8e89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CallableOptionsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CallableOptionsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface CallableOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.CallableOptions) @@ -13,6 +15,7 @@ public interface CallableOptionsOrBuilder extends *
    * * repeated string feed = 1; + * @return A list containing the feed. */ java.util.List getFeedList(); @@ -22,6 +25,7 @@ public interface CallableOptionsOrBuilder extends * * * repeated string feed = 1; + * @return The count of feed. */ int getFeedCount(); /** @@ -30,6 +34,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string feed = 1; + * @param index The index of the element to return. + * @return The feed at the given index. */ java.lang.String getFeed(int index); /** @@ -38,6 +44,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string feed = 1; + * @param index The index of the value to return. + * @return The bytes of the feed at the given index. */ com.google.protobuf.ByteString getFeedBytes(int index); @@ -50,6 +58,7 @@ public interface CallableOptionsOrBuilder extends * * * repeated string fetch = 2; + * @return A list containing the fetch. */ java.util.List getFetchList(); @@ -61,6 +70,7 @@ public interface CallableOptionsOrBuilder extends * * * repeated string fetch = 2; + * @return The count of fetch. */ int getFetchCount(); /** @@ -71,6 +81,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string fetch = 2; + * @param index The index of the element to return. + * @return The fetch at the given index. */ java.lang.String getFetch(int index); /** @@ -81,6 +93,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string fetch = 2; + * @param index The index of the value to return. + * @return The bytes of the fetch at the given index. */ com.google.protobuf.ByteString getFetchBytes(int index); @@ -92,6 +106,7 @@ public interface CallableOptionsOrBuilder extends * * * repeated string target = 3; + * @return A list containing the target. */ java.util.List getTargetList(); @@ -102,6 +117,7 @@ public interface CallableOptionsOrBuilder extends * * * repeated string target = 3; + * @return The count of target. */ int getTargetCount(); /** @@ -111,6 +127,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string target = 3; + * @param index The index of the element to return. + * @return The target at the given index. */ java.lang.String getTarget(int index); /** @@ -120,6 +138,8 @@ public interface CallableOptionsOrBuilder extends * * * repeated string target = 3; + * @param index The index of the value to return. + * @return The bytes of the target at the given index. */ com.google.protobuf.ByteString getTargetBytes(int index); @@ -130,6 +150,7 @@ public interface CallableOptionsOrBuilder extends * * * .tensorflow.RunOptions run_options = 4; + * @return Whether the runOptions field is set. */ boolean hasRunOptions(); /** @@ -138,8 +159,9 @@ public interface CallableOptionsOrBuilder extends * * * .tensorflow.RunOptions run_options = 4; + * @return The runOptions. */ - org.tensorflow.proto.framework.RunOptions getRunOptions(); + org.tensorflow.proto.RunOptions getRunOptions(); /** *
        * Options that will be applied to each run.
    @@ -147,7 +169,7 @@ public interface CallableOptionsOrBuilder extends
        *
        * .tensorflow.RunOptions run_options = 4;
        */
    -  org.tensorflow.proto.framework.RunOptionsOrBuilder getRunOptionsOrBuilder();
    +  org.tensorflow.proto.RunOptionsOrBuilder getRunOptionsOrBuilder();
     
       /**
        * 
    @@ -158,7 +180,7 @@ public interface CallableOptionsOrBuilder extends
        *
        * repeated .tensorflow.TensorConnection tensor_connection = 5;
        */
    -  java.util.List 
    +  java.util.List 
           getTensorConnectionList();
       /**
        * 
    @@ -169,7 +191,7 @@ public interface CallableOptionsOrBuilder extends
        *
        * repeated .tensorflow.TensorConnection tensor_connection = 5;
        */
    -  org.tensorflow.proto.framework.TensorConnection getTensorConnection(int index);
    +  org.tensorflow.proto.TensorConnection getTensorConnection(int index);
       /**
        * 
        * Tensors to be connected in the callable. Each TensorConnection denotes
    @@ -189,7 +211,7 @@ public interface CallableOptionsOrBuilder extends
        *
        * repeated .tensorflow.TensorConnection tensor_connection = 5;
        */
    -  java.util.List 
    +  java.util.List 
           getTensorConnectionOrBuilderList();
       /**
        * 
    @@ -200,43 +222,54 @@ public interface CallableOptionsOrBuilder extends
        *
        * repeated .tensorflow.TensorConnection tensor_connection = 5;
        */
    -  org.tensorflow.proto.framework.TensorConnectionOrBuilder getTensorConnectionOrBuilder(
    +  org.tensorflow.proto.TensorConnectionOrBuilder getTensorConnectionOrBuilder(
           int index);
     
       /**
        * 
        * The Tensor objects fed in the callable and fetched from the callable
        * are expected to be backed by host (CPU) memory by default.
    +   *
        * The options below allow changing that - feeding tensors backed by
        * device memory, or returning tensors that are backed by device memory.
    +   *
        * The maps below map the name of a feed/fetch tensor (which appears in
        * 'feed' or 'fetch' fields above), to the fully qualified name of the device
        * owning the memory backing the contents of the tensor.
    +   *
        * For example, creating a callable with the following options:
    +   *
        * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
        * }
    +   *
        * means that the Callable expects:
        * - The first argument ("a:0") is a Tensor backed by GPU memory.
        * - The second argument ("b:0") is a Tensor backed by host memory.
        * and of its return values:
        * - The first output ("x:0") will be backed by host memory.
        * - The second output ("y:0") will be backed by GPU memory.
    +   *
        * FEEDS:
        * It is the responsibility of the caller to ensure that the memory of the fed
        * tensors will be correctly initialized and synchronized before it is
        * accessed by operations executed during the call to Session::RunCallable().
    +   *
        * This is typically ensured by using the TensorFlow memory allocators
        * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
        * Alternatively, for CUDA-enabled GPU devices, this typically means that the
        * operation that produced the contents of the tensor has completed, i.e., the
        * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    @@ -250,36 +283,47 @@ org.tensorflow.proto.framework.TensorConnectionOrBuilder getTensorConnectionOrBu
        * 
        * The Tensor objects fed in the callable and fetched from the callable
        * are expected to be backed by host (CPU) memory by default.
    +   *
        * The options below allow changing that - feeding tensors backed by
        * device memory, or returning tensors that are backed by device memory.
    +   *
        * The maps below map the name of a feed/fetch tensor (which appears in
        * 'feed' or 'fetch' fields above), to the fully qualified name of the device
        * owning the memory backing the contents of the tensor.
    +   *
        * For example, creating a callable with the following options:
    +   *
        * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
        * }
    +   * }
    +   *
        * means that the Callable expects:
        * - The first argument ("a:0") is a Tensor backed by GPU memory.
        * - The second argument ("b:0") is a Tensor backed by host memory.
        * and of its return values:
        * - The first output ("x:0") will be backed by host memory.
        * - The second output ("y:0") will be backed by GPU memory.
    +   *
        * FEEDS:
        * It is the responsibility of the caller to ensure that the memory of the fed
        * tensors will be correctly initialized and synchronized before it is
        * accessed by operations executed during the call to Session::RunCallable().
    +   *
        * This is typically ensured by using the TensorFlow memory allocators
        * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
        * Alternatively, for CUDA-enabled GPU devices, this typically means that the
        * operation that produced the contents of the tensor has completed, i.e., the
        * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    @@ -300,36 +344,47 @@ boolean containsFeedDevices(
        * 
        * The Tensor objects fed in the callable and fetched from the callable
        * are expected to be backed by host (CPU) memory by default.
    +   *
        * The options below allow changing that - feeding tensors backed by
        * device memory, or returning tensors that are backed by device memory.
    +   *
        * The maps below map the name of a feed/fetch tensor (which appears in
        * 'feed' or 'fetch' fields above), to the fully qualified name of the device
        * owning the memory backing the contents of the tensor.
    +   *
        * For example, creating a callable with the following options:
    +   *
        * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
        * }
    +   *
        * means that the Callable expects:
        * - The first argument ("a:0") is a Tensor backed by GPU memory.
        * - The second argument ("b:0") is a Tensor backed by host memory.
        * and of its return values:
        * - The first output ("x:0") will be backed by host memory.
        * - The second output ("y:0") will be backed by GPU memory.
    +   *
        * FEEDS:
        * It is the responsibility of the caller to ensure that the memory of the fed
        * tensors will be correctly initialized and synchronized before it is
        * accessed by operations executed during the call to Session::RunCallable().
    +   *
        * This is typically ensured by using the TensorFlow memory allocators
        * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
        * Alternatively, for CUDA-enabled GPU devices, this typically means that the
        * operation that produced the contents of the tensor has completed, i.e., the
        * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    @@ -344,36 +399,47 @@ boolean containsFeedDevices(
        * 
        * The Tensor objects fed in the callable and fetched from the callable
        * are expected to be backed by host (CPU) memory by default.
    +   *
        * The options below allow changing that - feeding tensors backed by
        * device memory, or returning tensors that are backed by device memory.
    +   *
        * The maps below map the name of a feed/fetch tensor (which appears in
        * 'feed' or 'fetch' fields above), to the fully qualified name of the device
        * owning the memory backing the contents of the tensor.
    +   *
        * For example, creating a callable with the following options:
    +   *
        * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
        * }
    +   * }
    +   *
        * means that the Callable expects:
        * - The first argument ("a:0") is a Tensor backed by GPU memory.
        * - The second argument ("b:0") is a Tensor backed by host memory.
        * and of its return values:
        * - The first output ("x:0") will be backed by host memory.
        * - The second output ("y:0") will be backed by GPU memory.
    +   *
        * FEEDS:
        * It is the responsibility of the caller to ensure that the memory of the fed
        * tensors will be correctly initialized and synchronized before it is
        * accessed by operations executed during the call to Session::RunCallable().
    +   *
        * This is typically ensured by using the TensorFlow memory allocators
        * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
        * Alternatively, for CUDA-enabled GPU devices, this typically means that the
        * operation that produced the contents of the tensor has completed, i.e., the
        * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    @@ -382,44 +448,56 @@ boolean containsFeedDevices(
        *
        * map<string, string> feed_devices = 6;
        */
    -
    -  java.lang.String getFeedDevicesOrDefault(
    +  /* nullable */
    +java.lang.String getFeedDevicesOrDefault(
           java.lang.String key,
    -      java.lang.String defaultValue);
    +      /* nullable */
    +java.lang.String defaultValue);
       /**
        * 
        * The Tensor objects fed in the callable and fetched from the callable
        * are expected to be backed by host (CPU) memory by default.
    +   *
        * The options below allow changing that - feeding tensors backed by
        * device memory, or returning tensors that are backed by device memory.
    +   *
        * The maps below map the name of a feed/fetch tensor (which appears in
        * 'feed' or 'fetch' fields above), to the fully qualified name of the device
        * owning the memory backing the contents of the tensor.
    +   *
        * For example, creating a callable with the following options:
    +   *
        * CallableOptions {
    -   *   feed: "a:0"
    -   *   feed: "b:0"
    -   *   fetch: "x:0"
    -   *   fetch: "y:0"
    -   *   feed_devices: {
    -   *     "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *   }
    -   *   fetch_devices: {
    -   *     "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    -   *  }
    +   * feed: "a:0"
    +   * feed: "b:0"
    +   *
    +   * fetch: "x:0"
    +   * fetch: "y:0"
    +   *
    +   * feed_devices: {
    +   * "a:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
    +   *
    +   * fetch_devices: {
    +   * "y:0": "/job:localhost/replica:0/task:0/device:GPU:0"
    +   * }
        * }
    +   *
        * means that the Callable expects:
        * - The first argument ("a:0") is a Tensor backed by GPU memory.
        * - The second argument ("b:0") is a Tensor backed by host memory.
        * and of its return values:
        * - The first output ("x:0") will be backed by host memory.
        * - The second output ("y:0") will be backed by GPU memory.
    +   *
        * FEEDS:
        * It is the responsibility of the caller to ensure that the memory of the fed
        * tensors will be correctly initialized and synchronized before it is
        * accessed by operations executed during the call to Session::RunCallable().
    +   *
        * This is typically ensured by using the TensorFlow memory allocators
        * (Device::GetAllocator()) to create the Tensor to be fed.
    +   *
        * Alternatively, for CUDA-enabled GPU devices, this typically means that the
        * operation that produced the contents of the tensor has completed, i.e., the
        * CUDA stream has been synchronized (e.g., via cuCtxSynchronize() or
    @@ -428,7 +506,6 @@ java.lang.String getFeedDevicesOrDefault(
        *
        * map<string, string> feed_devices = 6;
        */
    -
       java.lang.String getFeedDevicesOrThrow(
           java.lang.String key);
     
    @@ -455,14 +532,14 @@ boolean containsFetchDevices(
       /**
        * map<string, string> fetch_devices = 7;
        */
    -
    -  java.lang.String getFetchDevicesOrDefault(
    +  /* nullable */
    +java.lang.String getFetchDevicesOrDefault(
           java.lang.String key,
    -      java.lang.String defaultValue);
    +      /* nullable */
    +java.lang.String defaultValue);
       /**
        * map<string, string> fetch_devices = 7;
        */
    -
       java.lang.String getFetchDevicesOrThrow(
           java.lang.String key);
     
    @@ -472,6 +549,7 @@ java.lang.String getFetchDevicesOrThrow(
        * fetched tensors on a GPU device, to ensure that the values in those tensors
        * have been produced. This simplifies interacting with the tensors, but
        * potentially incurs a performance hit.
    +   *
        * If this options is set to true, the caller is responsible for ensuring
        * that the values in the fetched tensors have been produced before they are
        * used. The caller can do this by invoking `Device::Sync()` on the underlying
    @@ -480,6 +558,7 @@ java.lang.String getFetchDevicesOrThrow(
        * 
    * * bool fetch_skip_sync = 8; + * @return The fetchSkipSync. */ boolean getFetchSkipSync(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDef.java new file mode 100644 index 00000000000..e0593e89941 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDef.java @@ -0,0 +1,819 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/cluster.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines a TensorFlow cluster as a set of jobs.
    + * 
    + * + * Protobuf type {@code tensorflow.ClusterDef} + */ +public final class ClusterDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ClusterDef) + ClusterDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ClusterDef.class.getName()); + } + // Use ClusterDef.newBuilder() to construct. + private ClusterDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ClusterDef() { + job_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_ClusterDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ClusterDef.class, org.tensorflow.proto.ClusterDef.Builder.class); + } + + public static final int JOB_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List job_; + /** + *
    +   * The jobs that comprise the cluster.
    +   * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + @java.lang.Override + public java.util.List getJobList() { + return job_; + } + /** + *
    +   * The jobs that comprise the cluster.
    +   * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + @java.lang.Override + public java.util.List + getJobOrBuilderList() { + return job_; + } + /** + *
    +   * The jobs that comprise the cluster.
    +   * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + @java.lang.Override + public int getJobCount() { + return job_.size(); + } + /** + *
    +   * The jobs that comprise the cluster.
    +   * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + @java.lang.Override + public org.tensorflow.proto.JobDef getJob(int index) { + return job_.get(index); + } + /** + *
    +   * The jobs that comprise the cluster.
    +   * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + @java.lang.Override + public org.tensorflow.proto.JobDefOrBuilder getJobOrBuilder( + int index) { + return job_.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 { + for (int i = 0; i < job_.size(); i++) { + output.writeMessage(1, job_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < job_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, job_.get(i)); + } + size += getUnknownFields().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.ClusterDef)) { + return super.equals(obj); + } + org.tensorflow.proto.ClusterDef other = (org.tensorflow.proto.ClusterDef) obj; + + if (!getJobList() + .equals(other.getJobList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getJobCount() > 0) { + hash = (37 * hash) + JOB_FIELD_NUMBER; + hash = (53 * hash) + getJobList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ClusterDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDef 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.ClusterDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDef 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.ClusterDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ClusterDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ClusterDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ClusterDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ClusterDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ClusterDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ClusterDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ClusterDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines a TensorFlow cluster as a set of jobs.
    +   * 
    + * + * Protobuf type {@code tensorflow.ClusterDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ClusterDef) + org.tensorflow.proto.ClusterDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_ClusterDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ClusterDef.class, org.tensorflow.proto.ClusterDef.Builder.class); + } + + // Construct using org.tensorflow.proto.ClusterDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (jobBuilder_ == null) { + job_ = java.util.Collections.emptyList(); + } else { + job_ = null; + jobBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_ClusterDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDef getDefaultInstanceForType() { + return org.tensorflow.proto.ClusterDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDef build() { + org.tensorflow.proto.ClusterDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDef buildPartial() { + org.tensorflow.proto.ClusterDef result = new org.tensorflow.proto.ClusterDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ClusterDef result) { + if (jobBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + job_ = java.util.Collections.unmodifiableList(job_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.job_ = job_; + } else { + result.job_ = jobBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ClusterDef result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ClusterDef) { + return mergeFrom((org.tensorflow.proto.ClusterDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ClusterDef other) { + if (other == org.tensorflow.proto.ClusterDef.getDefaultInstance()) return this; + if (jobBuilder_ == null) { + if (!other.job_.isEmpty()) { + if (job_.isEmpty()) { + job_ = other.job_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureJobIsMutable(); + job_.addAll(other.job_); + } + onChanged(); + } + } else { + if (!other.job_.isEmpty()) { + if (jobBuilder_.isEmpty()) { + jobBuilder_.dispose(); + jobBuilder_ = null; + job_ = other.job_; + bitField0_ = (bitField0_ & ~0x00000001); + jobBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getJobFieldBuilder() : null; + } else { + jobBuilder_.addAllMessages(other.job_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.JobDef m = + input.readMessage( + org.tensorflow.proto.JobDef.parser(), + extensionRegistry); + if (jobBuilder_ == null) { + ensureJobIsMutable(); + job_.add(m); + } else { + jobBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List job_ = + java.util.Collections.emptyList(); + private void ensureJobIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + job_ = new java.util.ArrayList(job_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDef, org.tensorflow.proto.JobDef.Builder, org.tensorflow.proto.JobDefOrBuilder> jobBuilder_; + + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public java.util.List getJobList() { + if (jobBuilder_ == null) { + return java.util.Collections.unmodifiableList(job_); + } else { + return jobBuilder_.getMessageList(); + } + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public int getJobCount() { + if (jobBuilder_ == null) { + return job_.size(); + } else { + return jobBuilder_.getCount(); + } + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public org.tensorflow.proto.JobDef getJob(int index) { + if (jobBuilder_ == null) { + return job_.get(index); + } else { + return jobBuilder_.getMessage(index); + } + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder setJob( + int index, org.tensorflow.proto.JobDef value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobIsMutable(); + job_.set(index, value); + onChanged(); + } else { + jobBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder setJob( + int index, org.tensorflow.proto.JobDef.Builder builderForValue) { + if (jobBuilder_ == null) { + ensureJobIsMutable(); + job_.set(index, builderForValue.build()); + onChanged(); + } else { + jobBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder addJob(org.tensorflow.proto.JobDef value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobIsMutable(); + job_.add(value); + onChanged(); + } else { + jobBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder addJob( + int index, org.tensorflow.proto.JobDef value) { + if (jobBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobIsMutable(); + job_.add(index, value); + onChanged(); + } else { + jobBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder addJob( + org.tensorflow.proto.JobDef.Builder builderForValue) { + if (jobBuilder_ == null) { + ensureJobIsMutable(); + job_.add(builderForValue.build()); + onChanged(); + } else { + jobBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder addJob( + int index, org.tensorflow.proto.JobDef.Builder builderForValue) { + if (jobBuilder_ == null) { + ensureJobIsMutable(); + job_.add(index, builderForValue.build()); + onChanged(); + } else { + jobBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder addAllJob( + java.lang.Iterable values) { + if (jobBuilder_ == null) { + ensureJobIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, job_); + onChanged(); + } else { + jobBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder clearJob() { + if (jobBuilder_ == null) { + job_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + jobBuilder_.clear(); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public Builder removeJob(int index) { + if (jobBuilder_ == null) { + ensureJobIsMutable(); + job_.remove(index); + onChanged(); + } else { + jobBuilder_.remove(index); + } + return this; + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public org.tensorflow.proto.JobDef.Builder getJobBuilder( + int index) { + return getJobFieldBuilder().getBuilder(index); + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public org.tensorflow.proto.JobDefOrBuilder getJobOrBuilder( + int index) { + if (jobBuilder_ == null) { + return job_.get(index); } else { + return jobBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public java.util.List + getJobOrBuilderList() { + if (jobBuilder_ != null) { + return jobBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(job_); + } + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public org.tensorflow.proto.JobDef.Builder addJobBuilder() { + return getJobFieldBuilder().addBuilder( + org.tensorflow.proto.JobDef.getDefaultInstance()); + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public org.tensorflow.proto.JobDef.Builder addJobBuilder( + int index) { + return getJobFieldBuilder().addBuilder( + index, org.tensorflow.proto.JobDef.getDefaultInstance()); + } + /** + *
    +     * The jobs that comprise the cluster.
    +     * 
    + * + * repeated .tensorflow.JobDef job = 1; + */ + public java.util.List + getJobBuilderList() { + return getJobFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDef, org.tensorflow.proto.JobDef.Builder, org.tensorflow.proto.JobDefOrBuilder> + getJobFieldBuilder() { + if (jobBuilder_ == null) { + jobBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDef, org.tensorflow.proto.JobDef.Builder, org.tensorflow.proto.JobDefOrBuilder>( + job_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + job_ = null; + } + return jobBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ClusterDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ClusterDef) + private static final org.tensorflow.proto.ClusterDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ClusterDef(); + } + + public static org.tensorflow.proto.ClusterDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ClusterDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDefOrBuilder.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDefOrBuilder.java index 8cecd262cc2..ffec98bc2ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ClusterDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/cluster.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.distruntime; +package org.tensorflow.proto; public interface ClusterDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.ClusterDef) @@ -14,7 +16,7 @@ public interface ClusterDefOrBuilder extends * * repeated .tensorflow.JobDef job = 1; */ - java.util.List + java.util.List getJobList(); /** *
    @@ -23,7 +25,7 @@ public interface ClusterDefOrBuilder extends
        *
        * repeated .tensorflow.JobDef job = 1;
        */
    -  org.tensorflow.proto.distruntime.JobDef getJob(int index);
    +  org.tensorflow.proto.JobDef getJob(int index);
       /**
        * 
        * The jobs that comprise the cluster.
    @@ -39,7 +41,7 @@ public interface ClusterDefOrBuilder extends
        *
        * repeated .tensorflow.JobDef job = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getJobOrBuilderList();
       /**
        * 
    @@ -48,6 +50,6 @@ public interface ClusterDefOrBuilder extends
        *
        * repeated .tensorflow.JobDef job = 1;
        */
    -  org.tensorflow.proto.distruntime.JobDefOrBuilder getJobOrBuilder(
    +  org.tensorflow.proto.JobDefOrBuilder getJobOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFilters.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFilters.java
    new file mode 100644
    index 00000000000..250aec1e1ad
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFilters.java
    @@ -0,0 +1,727 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/device_filters.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Defines the device filters for jobs in a cluster.
    + * 
    + * + * Protobuf type {@code tensorflow.ClusterDeviceFilters} + */ +public final class ClusterDeviceFilters extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ClusterDeviceFilters) + ClusterDeviceFiltersOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ClusterDeviceFilters.class.getName()); + } + // Use ClusterDeviceFilters.newBuilder() to construct. + private ClusterDeviceFilters(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ClusterDeviceFilters() { + jobs_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ClusterDeviceFilters.class, org.tensorflow.proto.ClusterDeviceFilters.Builder.class); + } + + public static final int JOBS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List jobs_; + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + @java.lang.Override + public java.util.List getJobsList() { + return jobs_; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + @java.lang.Override + public java.util.List + getJobsOrBuilderList() { + return jobs_; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + @java.lang.Override + public int getJobsCount() { + return jobs_.size(); + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.JobDeviceFilters getJobs(int index) { + return jobs_.get(index); + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.JobDeviceFiltersOrBuilder getJobsOrBuilder( + int index) { + return jobs_.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 { + for (int i = 0; i < jobs_.size(); i++) { + output.writeMessage(1, jobs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < jobs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, jobs_.get(i)); + } + size += getUnknownFields().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.ClusterDeviceFilters)) { + return super.equals(obj); + } + org.tensorflow.proto.ClusterDeviceFilters other = (org.tensorflow.proto.ClusterDeviceFilters) obj; + + if (!getJobsList() + .equals(other.getJobsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getJobsCount() > 0) { + hash = (37 * hash) + JOBS_FIELD_NUMBER; + hash = (53 * hash) + getJobsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDeviceFilters 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.ClusterDeviceFilters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDeviceFilters 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.ClusterDeviceFilters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ClusterDeviceFilters parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ClusterDeviceFilters parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ClusterDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ClusterDeviceFilters 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines the device filters for jobs in a cluster.
    +   * 
    + * + * Protobuf type {@code tensorflow.ClusterDeviceFilters} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ClusterDeviceFilters) + org.tensorflow.proto.ClusterDeviceFiltersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ClusterDeviceFilters.class, org.tensorflow.proto.ClusterDeviceFilters.Builder.class); + } + + // Construct using org.tensorflow.proto.ClusterDeviceFilters.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + } else { + jobs_ = null; + jobsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_ClusterDeviceFilters_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDeviceFilters getDefaultInstanceForType() { + return org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDeviceFilters build() { + org.tensorflow.proto.ClusterDeviceFilters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ClusterDeviceFilters buildPartial() { + org.tensorflow.proto.ClusterDeviceFilters result = new org.tensorflow.proto.ClusterDeviceFilters(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ClusterDeviceFilters result) { + if (jobsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + jobs_ = java.util.Collections.unmodifiableList(jobs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.jobs_ = jobs_; + } else { + result.jobs_ = jobsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ClusterDeviceFilters result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ClusterDeviceFilters) { + return mergeFrom((org.tensorflow.proto.ClusterDeviceFilters)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ClusterDeviceFilters other) { + if (other == org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance()) return this; + if (jobsBuilder_ == null) { + if (!other.jobs_.isEmpty()) { + if (jobs_.isEmpty()) { + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureJobsIsMutable(); + jobs_.addAll(other.jobs_); + } + onChanged(); + } + } else { + if (!other.jobs_.isEmpty()) { + if (jobsBuilder_.isEmpty()) { + jobsBuilder_.dispose(); + jobsBuilder_ = null; + jobs_ = other.jobs_; + bitField0_ = (bitField0_ & ~0x00000001); + jobsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getJobsFieldBuilder() : null; + } else { + jobsBuilder_.addAllMessages(other.jobs_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.JobDeviceFilters m = + input.readMessage( + org.tensorflow.proto.JobDeviceFilters.parser(), + extensionRegistry); + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(m); + } else { + jobsBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List jobs_ = + java.util.Collections.emptyList(); + private void ensureJobsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + jobs_ = new java.util.ArrayList(jobs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDeviceFilters, org.tensorflow.proto.JobDeviceFilters.Builder, org.tensorflow.proto.JobDeviceFiltersOrBuilder> jobsBuilder_; + + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public java.util.List getJobsList() { + if (jobsBuilder_ == null) { + return java.util.Collections.unmodifiableList(jobs_); + } else { + return jobsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public int getJobsCount() { + if (jobsBuilder_ == null) { + return jobs_.size(); + } else { + return jobsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public org.tensorflow.proto.JobDeviceFilters getJobs(int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); + } else { + return jobsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder setJobs( + int index, org.tensorflow.proto.JobDeviceFilters value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.set(index, value); + onChanged(); + } else { + jobsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder setJobs( + int index, org.tensorflow.proto.JobDeviceFilters.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.set(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder addJobs(org.tensorflow.proto.JobDeviceFilters value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(value); + onChanged(); + } else { + jobsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder addJobs( + int index, org.tensorflow.proto.JobDeviceFilters value) { + if (jobsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureJobsIsMutable(); + jobs_.add(index, value); + onChanged(); + } else { + jobsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder addJobs( + org.tensorflow.proto.JobDeviceFilters.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder addJobs( + int index, org.tensorflow.proto.JobDeviceFilters.Builder builderForValue) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.add(index, builderForValue.build()); + onChanged(); + } else { + jobsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder addAllJobs( + java.lang.Iterable values) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, jobs_); + onChanged(); + } else { + jobsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder clearJobs() { + if (jobsBuilder_ == null) { + jobs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + jobsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public Builder removeJobs(int index) { + if (jobsBuilder_ == null) { + ensureJobsIsMutable(); + jobs_.remove(index); + onChanged(); + } else { + jobsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public org.tensorflow.proto.JobDeviceFilters.Builder getJobsBuilder( + int index) { + return getJobsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public org.tensorflow.proto.JobDeviceFiltersOrBuilder getJobsOrBuilder( + int index) { + if (jobsBuilder_ == null) { + return jobs_.get(index); } else { + return jobsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public java.util.List + getJobsOrBuilderList() { + if (jobsBuilder_ != null) { + return jobsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(jobs_); + } + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public org.tensorflow.proto.JobDeviceFilters.Builder addJobsBuilder() { + return getJobsFieldBuilder().addBuilder( + org.tensorflow.proto.JobDeviceFilters.getDefaultInstance()); + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public org.tensorflow.proto.JobDeviceFilters.Builder addJobsBuilder( + int index) { + return getJobsFieldBuilder().addBuilder( + index, org.tensorflow.proto.JobDeviceFilters.getDefaultInstance()); + } + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + public java.util.List + getJobsBuilderList() { + return getJobsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDeviceFilters, org.tensorflow.proto.JobDeviceFilters.Builder, org.tensorflow.proto.JobDeviceFiltersOrBuilder> + getJobsFieldBuilder() { + if (jobsBuilder_ == null) { + jobsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.JobDeviceFilters, org.tensorflow.proto.JobDeviceFilters.Builder, org.tensorflow.proto.JobDeviceFiltersOrBuilder>( + jobs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + jobs_ = null; + } + return jobsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ClusterDeviceFilters) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ClusterDeviceFilters) + private static final org.tensorflow.proto.ClusterDeviceFilters DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ClusterDeviceFilters(); + } + + public static org.tensorflow.proto.ClusterDeviceFilters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClusterDeviceFilters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ClusterDeviceFilters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFiltersOrBuilder.java new file mode 100644 index 00000000000..56c5436ebcd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterDeviceFiltersOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ClusterDeviceFiltersOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ClusterDeviceFilters) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + java.util.List + getJobsList(); + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + org.tensorflow.proto.JobDeviceFilters getJobs(int index); + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + int getJobsCount(); + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + java.util.List + getJobsOrBuilderList(); + /** + * repeated .tensorflow.JobDeviceFilters jobs = 1; + */ + org.tensorflow.proto.JobDeviceFiltersOrBuilder getJobsOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterProtos.java new file mode 100644 index 00000000000..5f55a24f00b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ClusterProtos.java @@ -0,0 +1,88 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/cluster.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ClusterProtos { + private ClusterProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ClusterProtos.class.getName()); + } + 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_JobDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_JobDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_JobDef_TasksEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_JobDef_TasksEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ClusterDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ClusterDef_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/cluster.proto" + + "\022\ntensorflow\"r\n\006JobDef\022\014\n\004name\030\001 \001(\t\022,\n\005" + + "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\201\001\n\024org.tensorflow.proto" + + "B\rClusterProtosP\001ZUgithub.com/tensorflow" + + "/tensorflow/tensorflow/go/core/protobuf/" + + "for_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_JobDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_JobDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_JobDef_descriptor, + new java.lang.String[] { "Name", "Tasks", }); + internal_static_tensorflow_JobDef_TasksEntry_descriptor = + internal_static_tensorflow_JobDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_JobDef_TasksEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_JobDef_TasksEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_ClusterDef_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_ClusterDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ClusterDef_descriptor, + new java.lang.String[] { "Job", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocation.java new file mode 100644 index 00000000000..c19176e024a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocation.java @@ -0,0 +1,808 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Code location information: A stack trace with host-name information.
    + * Instead of encoding the detailed stack trace, this proto refers to IDs of
    + * stack frames stored as `StackFrameWithId` protos.
    + * 
    + * + * Protobuf type {@code tensorflow.CodeLocation} + */ +public final class CodeLocation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CodeLocation) + CodeLocationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CodeLocation.class.getName()); + } + // Use CodeLocation.newBuilder() to construct. + private CodeLocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CodeLocation() { + hostName_ = ""; + stackFrameIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_CodeLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CodeLocation.class, org.tensorflow.proto.CodeLocation.Builder.class); + } + + public static final int HOST_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object hostName_ = ""; + /** + *
    +   * Host name on which the source files are located.
    +   * 
    + * + * string host_name = 1; + * @return The hostName. + */ + @java.lang.Override + public java.lang.String getHostName() { + java.lang.Object ref = hostName_; + 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(); + hostName_ = s; + return s; + } + } + /** + *
    +   * Host name on which the source files are located.
    +   * 
    + * + * string host_name = 1; + * @return The bytes for hostName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHostNameBytes() { + java.lang.Object ref = hostName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STACK_FRAME_IDS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList stackFrameIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * ID to a stack frame, each of which is pointed to
    +   * by a unique ID. The ordering of the frames is consistent with Python's
    +   * `traceback.extract_tb()`.
    +   * 
    + * + * repeated string stack_frame_ids = 2; + * @return A list containing the stackFrameIds. + */ + public com.google.protobuf.ProtocolStringList + getStackFrameIdsList() { + return stackFrameIds_; + } + /** + *
    +   * ID to a stack frame, each of which is pointed to
    +   * by a unique ID. The ordering of the frames is consistent with Python's
    +   * `traceback.extract_tb()`.
    +   * 
    + * + * repeated string stack_frame_ids = 2; + * @return The count of stackFrameIds. + */ + public int getStackFrameIdsCount() { + return stackFrameIds_.size(); + } + /** + *
    +   * ID to a stack frame, each of which is pointed to
    +   * by a unique ID. The ordering of the frames is consistent with Python's
    +   * `traceback.extract_tb()`.
    +   * 
    + * + * repeated string stack_frame_ids = 2; + * @param index The index of the element to return. + * @return The stackFrameIds at the given index. + */ + public java.lang.String getStackFrameIds(int index) { + return stackFrameIds_.get(index); + } + /** + *
    +   * ID to a stack frame, each of which is pointed to
    +   * by a unique ID. The ordering of the frames is consistent with Python's
    +   * `traceback.extract_tb()`.
    +   * 
    + * + * repeated string stack_frame_ids = 2; + * @param index The index of the value to return. + * @return The bytes of the stackFrameIds at the given index. + */ + public com.google.protobuf.ByteString + getStackFrameIdsBytes(int index) { + return stackFrameIds_.getByteString(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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, hostName_); + } + for (int i = 0; i < stackFrameIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, stackFrameIds_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, hostName_); + } + { + int dataSize = 0; + for (int i = 0; i < stackFrameIds_.size(); i++) { + dataSize += computeStringSizeNoTag(stackFrameIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getStackFrameIdsList().size(); + } + size += getUnknownFields().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.CodeLocation)) { + return super.equals(obj); + } + org.tensorflow.proto.CodeLocation other = (org.tensorflow.proto.CodeLocation) obj; + + if (!getHostName() + .equals(other.getHostName())) return false; + if (!getStackFrameIdsList() + .equals(other.getStackFrameIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOST_NAME_FIELD_NUMBER; + hash = (53 * hash) + getHostName().hashCode(); + if (getStackFrameIdsCount() > 0) { + hash = (37 * hash) + STACK_FRAME_IDS_FIELD_NUMBER; + hash = (53 * hash) + getStackFrameIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CodeLocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CodeLocation 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.CodeLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CodeLocation 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.CodeLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CodeLocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CodeLocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CodeLocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CodeLocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CodeLocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CodeLocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CodeLocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CodeLocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Code location information: A stack trace with host-name information.
    +   * Instead of encoding the detailed stack trace, this proto refers to IDs of
    +   * stack frames stored as `StackFrameWithId` protos.
    +   * 
    + * + * Protobuf type {@code tensorflow.CodeLocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CodeLocation) + org.tensorflow.proto.CodeLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_CodeLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CodeLocation.class, org.tensorflow.proto.CodeLocation.Builder.class); + } + + // Construct using org.tensorflow.proto.CodeLocation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostName_ = ""; + stackFrameIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_CodeLocation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CodeLocation getDefaultInstanceForType() { + return org.tensorflow.proto.CodeLocation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CodeLocation build() { + org.tensorflow.proto.CodeLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CodeLocation buildPartial() { + org.tensorflow.proto.CodeLocation result = new org.tensorflow.proto.CodeLocation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CodeLocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostName_ = hostName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + stackFrameIds_.makeImmutable(); + result.stackFrameIds_ = stackFrameIds_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CodeLocation) { + return mergeFrom((org.tensorflow.proto.CodeLocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CodeLocation other) { + if (other == org.tensorflow.proto.CodeLocation.getDefaultInstance()) return this; + if (!other.getHostName().isEmpty()) { + hostName_ = other.hostName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.stackFrameIds_.isEmpty()) { + if (stackFrameIds_.isEmpty()) { + stackFrameIds_ = other.stackFrameIds_; + bitField0_ |= 0x00000002; + } else { + ensureStackFrameIdsIsMutable(); + stackFrameIds_.addAll(other.stackFrameIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + hostName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureStackFrameIdsIsMutable(); + stackFrameIds_.add(s); + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object hostName_ = ""; + /** + *
    +     * Host name on which the source files are located.
    +     * 
    + * + * string host_name = 1; + * @return The hostName. + */ + public java.lang.String getHostName() { + java.lang.Object ref = hostName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Host name on which the source files are located.
    +     * 
    + * + * string host_name = 1; + * @return The bytes for hostName. + */ + public com.google.protobuf.ByteString + getHostNameBytes() { + java.lang.Object ref = hostName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Host name on which the source files are located.
    +     * 
    + * + * string host_name = 1; + * @param value The hostName to set. + * @return This builder for chaining. + */ + public Builder setHostName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + hostName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Host name on which the source files are located.
    +     * 
    + * + * string host_name = 1; + * @return This builder for chaining. + */ + public Builder clearHostName() { + hostName_ = getDefaultInstance().getHostName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Host name on which the source files are located.
    +     * 
    + * + * string host_name = 1; + * @param value The bytes for hostName to set. + * @return This builder for chaining. + */ + public Builder setHostNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + hostName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList stackFrameIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureStackFrameIdsIsMutable() { + if (!stackFrameIds_.isModifiable()) { + stackFrameIds_ = new com.google.protobuf.LazyStringArrayList(stackFrameIds_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @return A list containing the stackFrameIds. + */ + public com.google.protobuf.ProtocolStringList + getStackFrameIdsList() { + stackFrameIds_.makeImmutable(); + return stackFrameIds_; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @return The count of stackFrameIds. + */ + public int getStackFrameIdsCount() { + return stackFrameIds_.size(); + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param index The index of the element to return. + * @return The stackFrameIds at the given index. + */ + public java.lang.String getStackFrameIds(int index) { + return stackFrameIds_.get(index); + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param index The index of the value to return. + * @return The bytes of the stackFrameIds at the given index. + */ + public com.google.protobuf.ByteString + getStackFrameIdsBytes(int index) { + return stackFrameIds_.getByteString(index); + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param index The index to set the value at. + * @param value The stackFrameIds to set. + * @return This builder for chaining. + */ + public Builder setStackFrameIds( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureStackFrameIdsIsMutable(); + stackFrameIds_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param value The stackFrameIds to add. + * @return This builder for chaining. + */ + public Builder addStackFrameIds( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureStackFrameIdsIsMutable(); + stackFrameIds_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param values The stackFrameIds to add. + * @return This builder for chaining. + */ + public Builder addAllStackFrameIds( + java.lang.Iterable values) { + ensureStackFrameIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, stackFrameIds_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @return This builder for chaining. + */ + public Builder clearStackFrameIds() { + stackFrameIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +     * ID to a stack frame, each of which is pointed to
    +     * by a unique ID. The ordering of the frames is consistent with Python's
    +     * `traceback.extract_tb()`.
    +     * 
    + * + * repeated string stack_frame_ids = 2; + * @param value The bytes of the stackFrameIds to add. + * @return This builder for chaining. + */ + public Builder addStackFrameIdsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureStackFrameIdsIsMutable(); + stackFrameIds_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CodeLocation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CodeLocation) + private static final org.tensorflow.proto.CodeLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CodeLocation(); + } + + public static org.tensorflow.proto.CodeLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CodeLocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CodeLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocationOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocationOrBuilder.java index b75306258be..4c1cc378579 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/CodeLocationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CodeLocationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface CodeLocationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.CodeLocation) @@ -13,6 +15,7 @@ public interface CodeLocationOrBuilder extends *
    * * string host_name = 1; + * @return The hostName. */ java.lang.String getHostName(); /** @@ -21,6 +24,7 @@ public interface CodeLocationOrBuilder extends *
    * * string host_name = 1; + * @return The bytes for hostName. */ com.google.protobuf.ByteString getHostNameBytes(); @@ -33,6 +37,7 @@ public interface CodeLocationOrBuilder extends *
    * * repeated string stack_frame_ids = 2; + * @return A list containing the stackFrameIds. */ java.util.List getStackFrameIdsList(); @@ -44,6 +49,7 @@ public interface CodeLocationOrBuilder extends *
    * * repeated string stack_frame_ids = 2; + * @return The count of stackFrameIds. */ int getStackFrameIdsCount(); /** @@ -54,6 +60,8 @@ public interface CodeLocationOrBuilder extends *
    * * repeated string stack_frame_ids = 2; + * @param index The index of the element to return. + * @return The stackFrameIds at the given index. */ java.lang.String getStackFrameIds(int index); /** @@ -64,6 +72,8 @@ public interface CodeLocationOrBuilder extends *
    * * repeated string stack_frame_ids = 2; + * @param index The index of the value to return. + * @return The bytes of the stackFrameIds at the given index. */ com.google.protobuf.ByteString getStackFrameIdsBytes(int index); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDef.java new file mode 100644 index 00000000000..e072f35c64f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDef.java @@ -0,0 +1,4653 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * CollectionDef should cover most collections.
    + * To add a user-defined collection, do one of the following:
    + * 1. For simple data types, such as string, int, float:
    + * tf.add_to_collection("your_collection_name", your_simple_value)
    + * strings will be stored as bytes_list.
    + *
    + * 2. For Protobuf types, there are three ways to add them:
    + * 1) tf.add_to_collection("your_collection_name",
    + * your_proto.SerializeToString())
    + *
    + * collection_def {
    + * key: "user_defined_bytes_collection"
    + * value {
    + * bytes_list {
    + * value: "queue_name: \"test_queue\"\n"
    + * }
    + * }
    + * }
    + *
    + * or
    + *
    + * 2) tf.add_to_collection("your_collection_name", str(your_proto))
    + *
    + * collection_def {
    + * key: "user_defined_string_collection"
    + * value {
    + * bytes_list {
    + * value: "\n\ntest_queue"
    + * }
    + * }
    + * }
    + *
    + * or
    + *
    + * 3) any_buf = any_pb2.Any()
    + * tf.add_to_collection("your_collection_name",
    + * any_buf.Pack(your_proto))
    + *
    + * collection_def {
    + * key: "user_defined_any_collection"
    + * value {
    + * any_list {
    + * value {
    + * type_url: "type.googleapis.com/tensorflow.QueueRunnerDef"
    + * value: "\n\ntest_queue"
    + * }
    + * }
    + * }
    + * }
    + *
    + * 3. For Python objects, implement to_proto() and from_proto(), and register
    + * them in the following manner:
    + * ops.register_proto_function("your_collection_name",
    + * proto_type,
    + * to_proto=YourPythonObject.to_proto,
    + * from_proto=YourPythonObject.from_proto)
    + * These functions will be invoked to serialize and de-serialize the
    + * collection. For example,
    + * ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES,
    + * proto_type=variable_pb2.VariableDef,
    + * to_proto=Variable.to_proto,
    + * from_proto=Variable.from_proto)
    + * 
    + * + * Protobuf type {@code tensorflow.CollectionDef} + */ +public final class CollectionDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef) + CollectionDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CollectionDef.class.getName()); + } + // Use CollectionDef.newBuilder() to construct. + private CollectionDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CollectionDef() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.class, org.tensorflow.proto.CollectionDef.Builder.class); + } + + public interface NodeListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.NodeList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string value = 1; + * @return A list containing the value. + */ + java.util.List + getValueList(); + /** + * repeated string value = 1; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + java.lang.String getValue(int index); + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + com.google.protobuf.ByteString + getValueBytes(int index); + } + /** + *
    +   * NodeList is used for collecting nodes in graph. For example
    +   * collection_def {
    +   * key: "summaries"
    +   * value {
    +   * node_list {
    +   * value: "input_producer/ScalarSummary:0"
    +   * value: "shuffle_batch/ScalarSummary:0"
    +   * value: "ImageSummary:0"
    +   * }
    +   * }
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.NodeList} + */ + public static final class NodeList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.NodeList) + NodeListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeList.class.getName()); + } + // Use NodeList.newBuilder() to construct. + private NodeList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NodeList() { + value_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.NodeList.class, org.tensorflow.proto.CollectionDef.NodeList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList value_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string value = 1; + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList + getValueList() { + return value_; + } + /** + * repeated string value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString + getValueBytes(int index) { + return value_.getByteString(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 { + for (int i = 0; i < value_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += computeStringSizeNoTag(value_.getRaw(i)); + } + size += dataSize; + size += 1 * getValueList().size(); + } + size += getUnknownFields().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.CollectionDef.NodeList)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef.NodeList other = (org.tensorflow.proto.CollectionDef.NodeList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.NodeList 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.CollectionDef.NodeList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.NodeList 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.CollectionDef.NodeList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef.NodeList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef.NodeList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.NodeList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef.NodeList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * NodeList is used for collecting nodes in graph. For example
    +     * collection_def {
    +     * key: "summaries"
    +     * value {
    +     * node_list {
    +     * value: "input_producer/ScalarSummary:0"
    +     * value: "shuffle_batch/ScalarSummary:0"
    +     * value: "ImageSummary:0"
    +     * }
    +     * }
    +     * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.NodeList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.NodeList) + org.tensorflow.proto.CollectionDef.NodeListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.NodeList.class, org.tensorflow.proto.CollectionDef.NodeList.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.NodeList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_NodeList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeList getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeList build() { + org.tensorflow.proto.CollectionDef.NodeList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeList buildPartial() { + org.tensorflow.proto.CollectionDef.NodeList result = new org.tensorflow.proto.CollectionDef.NodeList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef.NodeList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef.NodeList) { + return mergeFrom((org.tensorflow.proto.CollectionDef.NodeList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef.NodeList other) { + if (other == org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureValueIsMutable(); + value_.add(s); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList value_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = new com.google.protobuf.LazyStringArrayList(value_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string value = 1; + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated string value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString + getValueBytes(int index) { + return value_.getByteString(index); + } + /** + * repeated string value = 1; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param value The bytes of the value to add. + * @return This builder for chaining. + */ + public Builder addValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureValueIsMutable(); + value_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef.NodeList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.NodeList) + private static final org.tensorflow.proto.CollectionDef.NodeList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef.NodeList(); + } + + public static org.tensorflow.proto.CollectionDef.NodeList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef.NodeList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BytesListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.BytesList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated bytes value = 1; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + com.google.protobuf.ByteString getValue(int index); + } + /** + *
    +   * BytesList is used for collecting strings and serialized protobufs. For
    +   * example:
    +   * collection_def {
    +   * key: "trainable_variables"
    +   * value {
    +   * bytes_list {
    +   * value: "\n\017conv1/weights:0\022\024conv1/weights/Assign
    +   * \032\024conv1/weights/read:0"
    +   * value: "\n\016conv1/biases:0\022\023conv1/biases/Assign\032
    +   * \023conv1/biases/read:0"
    +   * }
    +   * }
    +   * }
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.BytesList} + */ + public static final class BytesList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.BytesList) + BytesListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BytesList.class.getName()); + } + // Use BytesList.newBuilder() to construct. + private BytesList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BytesList() { + value_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.BytesList.class, org.tensorflow.proto.CollectionDef.BytesList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList value_ = + emptyList(com.google.protobuf.ByteString.class); + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated bytes value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public com.google.protobuf.ByteString getValue(int index) { + return value_.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 { + for (int i = 0; i < value_.size(); i++) { + output.writeBytes(1, value_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(value_.get(i)); + } + size += dataSize; + size += 1 * getValueList().size(); + } + size += getUnknownFields().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.CollectionDef.BytesList)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef.BytesList other = (org.tensorflow.proto.CollectionDef.BytesList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.BytesList 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.CollectionDef.BytesList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.BytesList 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.CollectionDef.BytesList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef.BytesList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef.BytesList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.BytesList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef.BytesList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * BytesList is used for collecting strings and serialized protobufs. For
    +     * example:
    +     * collection_def {
    +     * key: "trainable_variables"
    +     * value {
    +     * bytes_list {
    +     * value: "\n\017conv1/weights:0\022\024conv1/weights/Assign
    +     * \032\024conv1/weights/read:0"
    +     * value: "\n\016conv1/biases:0\022\023conv1/biases/Assign\032
    +     * \023conv1/biases/read:0"
    +     * }
    +     * }
    +     * }
    +     * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.BytesList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.BytesList) + org.tensorflow.proto.CollectionDef.BytesListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.BytesList.class, org.tensorflow.proto.CollectionDef.BytesList.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.BytesList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_BytesList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesList getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesList build() { + org.tensorflow.proto.CollectionDef.BytesList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesList buildPartial() { + org.tensorflow.proto.CollectionDef.BytesList result = new org.tensorflow.proto.CollectionDef.BytesList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef.BytesList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef.BytesList) { + return mergeFrom((org.tensorflow.proto.CollectionDef.BytesList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef.BytesList other) { + if (other == org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureValueIsMutable(); + value_.add(v); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList value_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated bytes value = 1; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated bytes value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated bytes value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public com.google.protobuf.ByteString getValue(int index) { + return value_.get(index); + } + /** + * repeated bytes value = 1; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureValueIsMutable(); + value_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef.BytesList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.BytesList) + private static final org.tensorflow.proto.CollectionDef.BytesList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef.BytesList(); + } + + public static org.tensorflow.proto.CollectionDef.BytesList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BytesList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef.BytesList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface Int64ListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.Int64List) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int64 value = 1 [packed = true]; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated int64 value = 1 [packed = true]; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated int64 value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + long getValue(int index); + } + /** + *
    +   * Int64List is used for collecting int, int64 and long values.
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.Int64List} + */ + public static final class Int64List extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.Int64List) + Int64ListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Int64List.class.getName()); + } + // Use Int64List.newBuilder() to construct. + private Int64List(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Int64List() { + value_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.Int64List.class, org.tensorflow.proto.CollectionDef.Int64List.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList value_ = + emptyLongList(); + /** + * repeated int64 value = 1 [packed = true]; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated int64 value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated int64 value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public long getValue(int index) { + return value_.getLong(index); + } + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeInt64NoTag(value_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(value_.getLong(i)); + } + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.CollectionDef.Int64List)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef.Int64List other = (org.tensorflow.proto.CollectionDef.Int64List) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.Int64List 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.CollectionDef.Int64List parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.Int64List 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.CollectionDef.Int64List parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef.Int64List parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef.Int64List parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.Int64List parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef.Int64List 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Int64List is used for collecting int, int64 and long values.
    +     * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.Int64List} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.Int64List) + org.tensorflow.proto.CollectionDef.Int64ListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.Int64List.class, org.tensorflow.proto.CollectionDef.Int64List.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.Int64List.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_Int64List_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64List getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64List build() { + org.tensorflow.proto.CollectionDef.Int64List result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64List buildPartial() { + org.tensorflow.proto.CollectionDef.Int64List result = new org.tensorflow.proto.CollectionDef.Int64List(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef.Int64List result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef.Int64List) { + return mergeFrom((org.tensorflow.proto.CollectionDef.Int64List)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef.Int64List other) { + if (other == org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readInt64(); + ensureValueIsMutable(); + value_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValueIsMutable(); + while (input.getBytesUntilLimit() > 0) { + value_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList value_ = emptyLongList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int64 value = 1 [packed = true]; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated int64 value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated int64 value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public long getValue(int index) { + return value_.getLong(index); + } + /** + * repeated int64 value = 1 [packed = true]; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, long value) { + + ensureValueIsMutable(); + value_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true]; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(long value) { + + ensureValueIsMutable(); + value_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true]; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef.Int64List) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.Int64List) + private static final org.tensorflow.proto.CollectionDef.Int64List DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef.Int64List(); + } + + public static org.tensorflow.proto.CollectionDef.Int64List getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64List parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef.Int64List getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FloatListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.FloatList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + float getValue(int index); + } + /** + *
    +   * FloatList is used for collecting float values.
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.FloatList} + */ + public static final class FloatList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.FloatList) + FloatListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FloatList.class.getName()); + } + // Use FloatList.newBuilder() to construct. + private FloatList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FloatList() { + value_ = emptyFloatList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.FloatList.class, org.tensorflow.proto.CollectionDef.FloatList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList value_ = + emptyFloatList(); + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeFloatNoTag(value_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getValueList().size(); + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.CollectionDef.FloatList)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef.FloatList other = (org.tensorflow.proto.CollectionDef.FloatList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.FloatList 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.CollectionDef.FloatList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.FloatList 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.CollectionDef.FloatList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef.FloatList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef.FloatList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.FloatList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef.FloatList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * FloatList is used for collecting float values.
    +     * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.FloatList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.FloatList) + org.tensorflow.proto.CollectionDef.FloatListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.FloatList.class, org.tensorflow.proto.CollectionDef.FloatList.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.FloatList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_FloatList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatList getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatList build() { + org.tensorflow.proto.CollectionDef.FloatList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatList buildPartial() { + org.tensorflow.proto.CollectionDef.FloatList result = new org.tensorflow.proto.CollectionDef.FloatList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef.FloatList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef.FloatList) { + return mergeFrom((org.tensorflow.proto.CollectionDef.FloatList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef.FloatList other) { + if (other == org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + float v = input.readFloat(); + ensureValueIsMutable(); + value_.addFloat(v); + break; + } // case 13 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureValueIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + value_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + private void ensureValueIsMutable(int capacity) { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_, capacity); + } + bitField0_ |= 0x00000001; + } + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, float value) { + + ensureValueIsMutable(); + value_.setFloat(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(float value) { + + ensureValueIsMutable(); + value_.addFloat(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef.FloatList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.FloatList) + private static final org.tensorflow.proto.CollectionDef.FloatList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef.FloatList(); + } + + public static org.tensorflow.proto.CollectionDef.FloatList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef.FloatList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AnyListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef.AnyList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .google.protobuf.Any value = 1; + */ + java.util.List + getValueList(); + /** + * repeated .google.protobuf.Any value = 1; + */ + com.google.protobuf.Any getValue(int index); + /** + * repeated .google.protobuf.Any value = 1; + */ + int getValueCount(); + /** + * repeated .google.protobuf.Any value = 1; + */ + java.util.List + getValueOrBuilderList(); + /** + * repeated .google.protobuf.Any value = 1; + */ + com.google.protobuf.AnyOrBuilder getValueOrBuilder( + int index); + } + /** + *
    +   * AnyList is used for collecting Any protos.
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.AnyList} + */ + public static final class AnyList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CollectionDef.AnyList) + AnyListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AnyList.class.getName()); + } + // Use AnyList.newBuilder() to construct. + private AnyList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AnyList() { + value_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.AnyList.class, org.tensorflow.proto.CollectionDef.AnyList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List value_; + /** + * repeated .google.protobuf.Any value = 1; + */ + @java.lang.Override + public java.util.List getValueList() { + return value_; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + @java.lang.Override + public java.util.List + getValueOrBuilderList() { + return value_; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + @java.lang.Override + public int getValueCount() { + return value_.size(); + } + /** + * repeated .google.protobuf.Any value = 1; + */ + @java.lang.Override + public com.google.protobuf.Any getValue(int index) { + return value_.get(index); + } + /** + * repeated .google.protobuf.Any value = 1; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getValueOrBuilder( + int index) { + return value_.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 { + for (int i = 0; i < value_.size(); i++) { + output.writeMessage(1, value_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < value_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, value_.get(i)); + } + size += getUnknownFields().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.CollectionDef.AnyList)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef.AnyList other = (org.tensorflow.proto.CollectionDef.AnyList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.AnyList 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.CollectionDef.AnyList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.AnyList 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.CollectionDef.AnyList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef.AnyList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef.AnyList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef.AnyList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef.AnyList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * AnyList is used for collecting Any protos.
    +     * 
    + * + * Protobuf type {@code tensorflow.CollectionDef.AnyList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef.AnyList) + org.tensorflow.proto.CollectionDef.AnyListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.AnyList.class, org.tensorflow.proto.CollectionDef.AnyList.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.AnyList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valueBuilder_ == null) { + value_ = java.util.Collections.emptyList(); + } else { + value_ = null; + valueBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_AnyList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyList getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyList build() { + org.tensorflow.proto.CollectionDef.AnyList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyList buildPartial() { + org.tensorflow.proto.CollectionDef.AnyList result = new org.tensorflow.proto.CollectionDef.AnyList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CollectionDef.AnyList result) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + value_ = java.util.Collections.unmodifiableList(value_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.value_ = value_; + } else { + result.value_ = valueBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef.AnyList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef.AnyList) { + return mergeFrom((org.tensorflow.proto.CollectionDef.AnyList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef.AnyList other) { + if (other == org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance()) return this; + if (valueBuilder_ == null) { + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + } else { + if (!other.value_.isEmpty()) { + if (valueBuilder_.isEmpty()) { + valueBuilder_.dispose(); + valueBuilder_ = null; + value_ = other.value_; + bitField0_ = (bitField0_ & ~0x00000001); + valueBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getValueFieldBuilder() : null; + } else { + valueBuilder_.addAllMessages(other.value_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Any m = + input.readMessage( + com.google.protobuf.Any.parser(), + extensionRegistry); + if (valueBuilder_ == null) { + ensureValueIsMutable(); + value_.add(m); + } else { + valueBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List value_ = + java.util.Collections.emptyList(); + private void ensureValueIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + value_ = new java.util.ArrayList(value_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> valueBuilder_; + + /** + * repeated .google.protobuf.Any value = 1; + */ + public java.util.List getValueList() { + if (valueBuilder_ == null) { + return java.util.Collections.unmodifiableList(value_); + } else { + return valueBuilder_.getMessageList(); + } + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public int getValueCount() { + if (valueBuilder_ == null) { + return value_.size(); + } else { + return valueBuilder_.getCount(); + } + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public com.google.protobuf.Any getValue(int index) { + if (valueBuilder_ == null) { + return value_.get(index); + } else { + return valueBuilder_.getMessage(index); + } + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder setValue( + int index, com.google.protobuf.Any value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.set(index, value); + onChanged(); + } else { + valueBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder setValue( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (valueBuilder_ == null) { + ensureValueIsMutable(); + value_.set(index, builderForValue.build()); + onChanged(); + } else { + valueBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder addValue(com.google.protobuf.Any value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.add(value); + onChanged(); + } else { + valueBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder addValue( + int index, com.google.protobuf.Any value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.add(index, value); + onChanged(); + } else { + valueBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder addValue( + com.google.protobuf.Any.Builder builderForValue) { + if (valueBuilder_ == null) { + ensureValueIsMutable(); + value_.add(builderForValue.build()); + onChanged(); + } else { + valueBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder addValue( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (valueBuilder_ == null) { + ensureValueIsMutable(); + value_.add(index, builderForValue.build()); + onChanged(); + } else { + valueBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder addAllValue( + java.lang.Iterable values) { + if (valueBuilder_ == null) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + onChanged(); + } else { + valueBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder clearValue() { + if (valueBuilder_ == null) { + value_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valueBuilder_.clear(); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public Builder removeValue(int index) { + if (valueBuilder_ == null) { + ensureValueIsMutable(); + value_.remove(index); + onChanged(); + } else { + valueBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public com.google.protobuf.Any.Builder getValueBuilder( + int index) { + return getValueFieldBuilder().getBuilder(index); + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public com.google.protobuf.AnyOrBuilder getValueOrBuilder( + int index) { + if (valueBuilder_ == null) { + return value_.get(index); } else { + return valueBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public java.util.List + getValueOrBuilderList() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(value_); + } + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public com.google.protobuf.Any.Builder addValueBuilder() { + return getValueFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public com.google.protobuf.Any.Builder addValueBuilder( + int index) { + return getValueFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any value = 1; + */ + public java.util.List + getValueBuilderList() { + return getValueFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + value_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + value_ = null; + } + return valueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef.AnyList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef.AnyList) + private static final org.tensorflow.proto.CollectionDef.AnyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef.AnyList(); + } + + public static org.tensorflow.proto.CollectionDef.AnyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnyList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef.AnyList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int kindCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object kind_; + public enum KindCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NODE_LIST(1), + BYTES_LIST(2), + INT64_LIST(3), + FLOAT_LIST(4), + ANY_LIST(5), + KIND_NOT_SET(0); + private final int value; + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: return NODE_LIST; + case 2: return BYTES_LIST; + case 3: return INT64_LIST; + case 4: return FLOAT_LIST; + case 5: return ANY_LIST; + case 0: return KIND_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public static final int NODE_LIST_FIELD_NUMBER = 1; + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return Whether the nodeList field is set. + */ + @java.lang.Override + public boolean hasNodeList() { + return kindCase_ == 1; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return The nodeList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeList getNodeList() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.CollectionDef.NodeList) kind_; + } + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeListOrBuilder getNodeListOrBuilder() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.CollectionDef.NodeList) kind_; + } + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + + public static final int BYTES_LIST_FIELD_NUMBER = 2; + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return Whether the bytesList field is set. + */ + @java.lang.Override + public boolean hasBytesList() { + return kindCase_ == 2; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return The bytesList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesList getBytesList() { + if (kindCase_ == 2) { + return (org.tensorflow.proto.CollectionDef.BytesList) kind_; + } + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesListOrBuilder getBytesListOrBuilder() { + if (kindCase_ == 2) { + return (org.tensorflow.proto.CollectionDef.BytesList) kind_; + } + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + + public static final int INT64_LIST_FIELD_NUMBER = 3; + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return Whether the int64List field is set. + */ + @java.lang.Override + public boolean hasInt64List() { + return kindCase_ == 3; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return The int64List. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64List getInt64List() { + if (kindCase_ == 3) { + return (org.tensorflow.proto.CollectionDef.Int64List) kind_; + } + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder() { + if (kindCase_ == 3) { + return (org.tensorflow.proto.CollectionDef.Int64List) kind_; + } + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + + public static final int FLOAT_LIST_FIELD_NUMBER = 4; + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return Whether the floatList field is set. + */ + @java.lang.Override + public boolean hasFloatList() { + return kindCase_ == 4; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return The floatList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatList getFloatList() { + if (kindCase_ == 4) { + return (org.tensorflow.proto.CollectionDef.FloatList) kind_; + } + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatListOrBuilder getFloatListOrBuilder() { + if (kindCase_ == 4) { + return (org.tensorflow.proto.CollectionDef.FloatList) kind_; + } + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + + public static final int ANY_LIST_FIELD_NUMBER = 5; + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return Whether the anyList field is set. + */ + @java.lang.Override + public boolean hasAnyList() { + return kindCase_ == 5; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return The anyList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyList getAnyList() { + if (kindCase_ == 5) { + return (org.tensorflow.proto.CollectionDef.AnyList) kind_; + } + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyListOrBuilder getAnyListOrBuilder() { + if (kindCase_ == 5) { + return (org.tensorflow.proto.CollectionDef.AnyList) kind_; + } + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.CollectionDef.NodeList) kind_); + } + if (kindCase_ == 2) { + output.writeMessage(2, (org.tensorflow.proto.CollectionDef.BytesList) kind_); + } + if (kindCase_ == 3) { + output.writeMessage(3, (org.tensorflow.proto.CollectionDef.Int64List) kind_); + } + if (kindCase_ == 4) { + output.writeMessage(4, (org.tensorflow.proto.CollectionDef.FloatList) kind_); + } + if (kindCase_ == 5) { + output.writeMessage(5, (org.tensorflow.proto.CollectionDef.AnyList) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.CollectionDef.NodeList) kind_); + } + if (kindCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.tensorflow.proto.CollectionDef.BytesList) kind_); + } + if (kindCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (org.tensorflow.proto.CollectionDef.Int64List) kind_); + } + if (kindCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (org.tensorflow.proto.CollectionDef.FloatList) kind_); + } + if (kindCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (org.tensorflow.proto.CollectionDef.AnyList) kind_); + } + size += getUnknownFields().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.CollectionDef)) { + return super.equals(obj); + } + org.tensorflow.proto.CollectionDef other = (org.tensorflow.proto.CollectionDef) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getNodeList() + .equals(other.getNodeList())) return false; + break; + case 2: + if (!getBytesList() + .equals(other.getBytesList())) return false; + break; + case 3: + if (!getInt64List() + .equals(other.getInt64List())) return false; + break; + case 4: + if (!getFloatList() + .equals(other.getFloatList())) return false; + break; + case 5: + if (!getAnyList() + .equals(other.getAnyList())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + NODE_LIST_FIELD_NUMBER; + hash = (53 * hash) + getNodeList().hashCode(); + break; + case 2: + hash = (37 * hash) + BYTES_LIST_FIELD_NUMBER; + hash = (53 * hash) + getBytesList().hashCode(); + break; + case 3: + hash = (37 * hash) + INT64_LIST_FIELD_NUMBER; + hash = (53 * hash) + getInt64List().hashCode(); + break; + case 4: + hash = (37 * hash) + FLOAT_LIST_FIELD_NUMBER; + hash = (53 * hash) + getFloatList().hashCode(); + break; + case 5: + hash = (37 * hash) + ANY_LIST_FIELD_NUMBER; + hash = (53 * hash) + getAnyList().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CollectionDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef 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.CollectionDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef 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.CollectionDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CollectionDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CollectionDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CollectionDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CollectionDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CollectionDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CollectionDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * CollectionDef should cover most collections.
    +   * To add a user-defined collection, do one of the following:
    +   * 1. For simple data types, such as string, int, float:
    +   * tf.add_to_collection("your_collection_name", your_simple_value)
    +   * strings will be stored as bytes_list.
    +   *
    +   * 2. For Protobuf types, there are three ways to add them:
    +   * 1) tf.add_to_collection("your_collection_name",
    +   * your_proto.SerializeToString())
    +   *
    +   * collection_def {
    +   * key: "user_defined_bytes_collection"
    +   * value {
    +   * bytes_list {
    +   * value: "queue_name: \"test_queue\"\n"
    +   * }
    +   * }
    +   * }
    +   *
    +   * or
    +   *
    +   * 2) tf.add_to_collection("your_collection_name", str(your_proto))
    +   *
    +   * collection_def {
    +   * key: "user_defined_string_collection"
    +   * value {
    +   * bytes_list {
    +   * value: "\n\ntest_queue"
    +   * }
    +   * }
    +   * }
    +   *
    +   * or
    +   *
    +   * 3) any_buf = any_pb2.Any()
    +   * tf.add_to_collection("your_collection_name",
    +   * any_buf.Pack(your_proto))
    +   *
    +   * collection_def {
    +   * key: "user_defined_any_collection"
    +   * value {
    +   * any_list {
    +   * value {
    +   * type_url: "type.googleapis.com/tensorflow.QueueRunnerDef"
    +   * value: "\n\ntest_queue"
    +   * }
    +   * }
    +   * }
    +   * }
    +   *
    +   * 3. For Python objects, implement to_proto() and from_proto(), and register
    +   * them in the following manner:
    +   * ops.register_proto_function("your_collection_name",
    +   * proto_type,
    +   * to_proto=YourPythonObject.to_proto,
    +   * from_proto=YourPythonObject.from_proto)
    +   * These functions will be invoked to serialize and de-serialize the
    +   * collection. For example,
    +   * ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES,
    +   * proto_type=variable_pb2.VariableDef,
    +   * to_proto=Variable.to_proto,
    +   * from_proto=Variable.from_proto)
    +   * 
    + * + * Protobuf type {@code tensorflow.CollectionDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CollectionDef) + org.tensorflow.proto.CollectionDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CollectionDef.class, org.tensorflow.proto.CollectionDef.Builder.class); + } + + // Construct using org.tensorflow.proto.CollectionDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodeListBuilder_ != null) { + nodeListBuilder_.clear(); + } + if (bytesListBuilder_ != null) { + bytesListBuilder_.clear(); + } + if (int64ListBuilder_ != null) { + int64ListBuilder_.clear(); + } + if (floatListBuilder_ != null) { + floatListBuilder_.clear(); + } + if (anyListBuilder_ != null) { + anyListBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_CollectionDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef getDefaultInstanceForType() { + return org.tensorflow.proto.CollectionDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef build() { + org.tensorflow.proto.CollectionDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CollectionDef buildPartial() { + org.tensorflow.proto.CollectionDef result = new org.tensorflow.proto.CollectionDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CollectionDef result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.CollectionDef result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && + nodeListBuilder_ != null) { + result.kind_ = nodeListBuilder_.build(); + } + if (kindCase_ == 2 && + bytesListBuilder_ != null) { + result.kind_ = bytesListBuilder_.build(); + } + if (kindCase_ == 3 && + int64ListBuilder_ != null) { + result.kind_ = int64ListBuilder_.build(); + } + if (kindCase_ == 4 && + floatListBuilder_ != null) { + result.kind_ = floatListBuilder_.build(); + } + if (kindCase_ == 5 && + anyListBuilder_ != null) { + result.kind_ = anyListBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CollectionDef) { + return mergeFrom((org.tensorflow.proto.CollectionDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CollectionDef other) { + if (other == org.tensorflow.proto.CollectionDef.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case NODE_LIST: { + mergeNodeList(other.getNodeList()); + break; + } + case BYTES_LIST: { + mergeBytesList(other.getBytesList()); + break; + } + case INT64_LIST: { + mergeInt64List(other.getInt64List()); + break; + } + case FLOAT_LIST: { + mergeFloatList(other.getFloatList()); + break; + } + case ANY_LIST: { + mergeAnyList(other.getAnyList()); + break; + } + case KIND_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getNodeListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + getBytesListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + getInt64ListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + case 34: { + input.readMessage( + getFloatListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: { + input.readMessage( + getAnyListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int kindCase_ = 0; + private java.lang.Object kind_; + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.NodeList, org.tensorflow.proto.CollectionDef.NodeList.Builder, org.tensorflow.proto.CollectionDef.NodeListOrBuilder> nodeListBuilder_; + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return Whether the nodeList field is set. + */ + @java.lang.Override + public boolean hasNodeList() { + return kindCase_ == 1; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return The nodeList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeList getNodeList() { + if (nodeListBuilder_ == null) { + if (kindCase_ == 1) { + return (org.tensorflow.proto.CollectionDef.NodeList) kind_; + } + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return nodeListBuilder_.getMessage(); + } + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + public Builder setNodeList(org.tensorflow.proto.CollectionDef.NodeList value) { + if (nodeListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + nodeListBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + public Builder setNodeList( + org.tensorflow.proto.CollectionDef.NodeList.Builder builderForValue) { + if (nodeListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + nodeListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + public Builder mergeNodeList(org.tensorflow.proto.CollectionDef.NodeList value) { + if (nodeListBuilder_ == null) { + if (kindCase_ == 1 && + kind_ != org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.CollectionDef.NodeList.newBuilder((org.tensorflow.proto.CollectionDef.NodeList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + nodeListBuilder_.mergeFrom(value); + } else { + nodeListBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + public Builder clearNodeList() { + if (nodeListBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + nodeListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + public org.tensorflow.proto.CollectionDef.NodeList.Builder getNodeListBuilder() { + return getNodeListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.NodeListOrBuilder getNodeListOrBuilder() { + if ((kindCase_ == 1) && (nodeListBuilder_ != null)) { + return nodeListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (org.tensorflow.proto.CollectionDef.NodeList) kind_; + } + return org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.NodeList, org.tensorflow.proto.CollectionDef.NodeList.Builder, org.tensorflow.proto.CollectionDef.NodeListOrBuilder> + getNodeListFieldBuilder() { + if (nodeListBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = org.tensorflow.proto.CollectionDef.NodeList.getDefaultInstance(); + } + nodeListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.NodeList, org.tensorflow.proto.CollectionDef.NodeList.Builder, org.tensorflow.proto.CollectionDef.NodeListOrBuilder>( + (org.tensorflow.proto.CollectionDef.NodeList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return nodeListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.BytesList, org.tensorflow.proto.CollectionDef.BytesList.Builder, org.tensorflow.proto.CollectionDef.BytesListOrBuilder> bytesListBuilder_; + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return Whether the bytesList field is set. + */ + @java.lang.Override + public boolean hasBytesList() { + return kindCase_ == 2; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return The bytesList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesList getBytesList() { + if (bytesListBuilder_ == null) { + if (kindCase_ == 2) { + return (org.tensorflow.proto.CollectionDef.BytesList) kind_; + } + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } else { + if (kindCase_ == 2) { + return bytesListBuilder_.getMessage(); + } + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + public Builder setBytesList(org.tensorflow.proto.CollectionDef.BytesList value) { + if (bytesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + bytesListBuilder_.setMessage(value); + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + public Builder setBytesList( + org.tensorflow.proto.CollectionDef.BytesList.Builder builderForValue) { + if (bytesListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + bytesListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + public Builder mergeBytesList(org.tensorflow.proto.CollectionDef.BytesList value) { + if (bytesListBuilder_ == null) { + if (kindCase_ == 2 && + kind_ != org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.CollectionDef.BytesList.newBuilder((org.tensorflow.proto.CollectionDef.BytesList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 2) { + bytesListBuilder_.mergeFrom(value); + } else { + bytesListBuilder_.setMessage(value); + } + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + public Builder clearBytesList() { + if (bytesListBuilder_ == null) { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + } + bytesListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + public org.tensorflow.proto.CollectionDef.BytesList.Builder getBytesListBuilder() { + return getBytesListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.BytesListOrBuilder getBytesListOrBuilder() { + if ((kindCase_ == 2) && (bytesListBuilder_ != null)) { + return bytesListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 2) { + return (org.tensorflow.proto.CollectionDef.BytesList) kind_; + } + return org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.BytesList, org.tensorflow.proto.CollectionDef.BytesList.Builder, org.tensorflow.proto.CollectionDef.BytesListOrBuilder> + getBytesListFieldBuilder() { + if (bytesListBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = org.tensorflow.proto.CollectionDef.BytesList.getDefaultInstance(); + } + bytesListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.BytesList, org.tensorflow.proto.CollectionDef.BytesList.Builder, org.tensorflow.proto.CollectionDef.BytesListOrBuilder>( + (org.tensorflow.proto.CollectionDef.BytesList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 2; + onChanged(); + return bytesListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.Int64List, org.tensorflow.proto.CollectionDef.Int64List.Builder, org.tensorflow.proto.CollectionDef.Int64ListOrBuilder> int64ListBuilder_; + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return Whether the int64List field is set. + */ + @java.lang.Override + public boolean hasInt64List() { + return kindCase_ == 3; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return The int64List. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64List getInt64List() { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3) { + return (org.tensorflow.proto.CollectionDef.Int64List) kind_; + } + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } else { + if (kindCase_ == 3) { + return int64ListBuilder_.getMessage(); + } + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + public Builder setInt64List(org.tensorflow.proto.CollectionDef.Int64List value) { + if (int64ListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + int64ListBuilder_.setMessage(value); + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + public Builder setInt64List( + org.tensorflow.proto.CollectionDef.Int64List.Builder builderForValue) { + if (int64ListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + int64ListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + public Builder mergeInt64List(org.tensorflow.proto.CollectionDef.Int64List value) { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3 && + kind_ != org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance()) { + kind_ = org.tensorflow.proto.CollectionDef.Int64List.newBuilder((org.tensorflow.proto.CollectionDef.Int64List) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 3) { + int64ListBuilder_.mergeFrom(value); + } else { + int64ListBuilder_.setMessage(value); + } + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + public Builder clearInt64List() { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + } + int64ListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + public org.tensorflow.proto.CollectionDef.Int64List.Builder getInt64ListBuilder() { + return getInt64ListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder() { + if ((kindCase_ == 3) && (int64ListBuilder_ != null)) { + return int64ListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 3) { + return (org.tensorflow.proto.CollectionDef.Int64List) kind_; + } + return org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.Int64List, org.tensorflow.proto.CollectionDef.Int64List.Builder, org.tensorflow.proto.CollectionDef.Int64ListOrBuilder> + getInt64ListFieldBuilder() { + if (int64ListBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = org.tensorflow.proto.CollectionDef.Int64List.getDefaultInstance(); + } + int64ListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.Int64List, org.tensorflow.proto.CollectionDef.Int64List.Builder, org.tensorflow.proto.CollectionDef.Int64ListOrBuilder>( + (org.tensorflow.proto.CollectionDef.Int64List) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 3; + onChanged(); + return int64ListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.FloatList, org.tensorflow.proto.CollectionDef.FloatList.Builder, org.tensorflow.proto.CollectionDef.FloatListOrBuilder> floatListBuilder_; + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return Whether the floatList field is set. + */ + @java.lang.Override + public boolean hasFloatList() { + return kindCase_ == 4; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return The floatList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatList getFloatList() { + if (floatListBuilder_ == null) { + if (kindCase_ == 4) { + return (org.tensorflow.proto.CollectionDef.FloatList) kind_; + } + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return floatListBuilder_.getMessage(); + } + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + public Builder setFloatList(org.tensorflow.proto.CollectionDef.FloatList value) { + if (floatListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + floatListBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + public Builder setFloatList( + org.tensorflow.proto.CollectionDef.FloatList.Builder builderForValue) { + if (floatListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + floatListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + public Builder mergeFloatList(org.tensorflow.proto.CollectionDef.FloatList value) { + if (floatListBuilder_ == null) { + if (kindCase_ == 4 && + kind_ != org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.CollectionDef.FloatList.newBuilder((org.tensorflow.proto.CollectionDef.FloatList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + floatListBuilder_.mergeFrom(value); + } else { + floatListBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + public Builder clearFloatList() { + if (floatListBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + floatListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + public org.tensorflow.proto.CollectionDef.FloatList.Builder getFloatListBuilder() { + return getFloatListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.FloatListOrBuilder getFloatListOrBuilder() { + if ((kindCase_ == 4) && (floatListBuilder_ != null)) { + return floatListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (org.tensorflow.proto.CollectionDef.FloatList) kind_; + } + return org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.FloatList, org.tensorflow.proto.CollectionDef.FloatList.Builder, org.tensorflow.proto.CollectionDef.FloatListOrBuilder> + getFloatListFieldBuilder() { + if (floatListBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = org.tensorflow.proto.CollectionDef.FloatList.getDefaultInstance(); + } + floatListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.FloatList, org.tensorflow.proto.CollectionDef.FloatList.Builder, org.tensorflow.proto.CollectionDef.FloatListOrBuilder>( + (org.tensorflow.proto.CollectionDef.FloatList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + return floatListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.AnyList, org.tensorflow.proto.CollectionDef.AnyList.Builder, org.tensorflow.proto.CollectionDef.AnyListOrBuilder> anyListBuilder_; + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return Whether the anyList field is set. + */ + @java.lang.Override + public boolean hasAnyList() { + return kindCase_ == 5; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return The anyList. + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyList getAnyList() { + if (anyListBuilder_ == null) { + if (kindCase_ == 5) { + return (org.tensorflow.proto.CollectionDef.AnyList) kind_; + } + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } else { + if (kindCase_ == 5) { + return anyListBuilder_.getMessage(); + } + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + public Builder setAnyList(org.tensorflow.proto.CollectionDef.AnyList value) { + if (anyListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + anyListBuilder_.setMessage(value); + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + public Builder setAnyList( + org.tensorflow.proto.CollectionDef.AnyList.Builder builderForValue) { + if (anyListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + anyListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + public Builder mergeAnyList(org.tensorflow.proto.CollectionDef.AnyList value) { + if (anyListBuilder_ == null) { + if (kindCase_ == 5 && + kind_ != org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.CollectionDef.AnyList.newBuilder((org.tensorflow.proto.CollectionDef.AnyList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 5) { + anyListBuilder_.mergeFrom(value); + } else { + anyListBuilder_.setMessage(value); + } + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + public Builder clearAnyList() { + if (anyListBuilder_ == null) { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + } + anyListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + public org.tensorflow.proto.CollectionDef.AnyList.Builder getAnyListBuilder() { + return getAnyListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef.AnyListOrBuilder getAnyListOrBuilder() { + if ((kindCase_ == 5) && (anyListBuilder_ != null)) { + return anyListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 5) { + return (org.tensorflow.proto.CollectionDef.AnyList) kind_; + } + return org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + } + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.AnyList, org.tensorflow.proto.CollectionDef.AnyList.Builder, org.tensorflow.proto.CollectionDef.AnyListOrBuilder> + getAnyListFieldBuilder() { + if (anyListBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = org.tensorflow.proto.CollectionDef.AnyList.getDefaultInstance(); + } + anyListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CollectionDef.AnyList, org.tensorflow.proto.CollectionDef.AnyList.Builder, org.tensorflow.proto.CollectionDef.AnyListOrBuilder>( + (org.tensorflow.proto.CollectionDef.AnyList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 5; + onChanged(); + return anyListBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CollectionDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CollectionDef) + private static final org.tensorflow.proto.CollectionDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CollectionDef(); + } + + public static org.tensorflow.proto.CollectionDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CollectionDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CollectionDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDefOrBuilder.java new file mode 100644 index 00000000000..0b80d88866e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CollectionDefOrBuilder.java @@ -0,0 +1,88 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface CollectionDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CollectionDef) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return Whether the nodeList field is set. + */ + boolean hasNodeList(); + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + * @return The nodeList. + */ + org.tensorflow.proto.CollectionDef.NodeList getNodeList(); + /** + * .tensorflow.CollectionDef.NodeList node_list = 1; + */ + org.tensorflow.proto.CollectionDef.NodeListOrBuilder getNodeListOrBuilder(); + + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return Whether the bytesList field is set. + */ + boolean hasBytesList(); + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + * @return The bytesList. + */ + org.tensorflow.proto.CollectionDef.BytesList getBytesList(); + /** + * .tensorflow.CollectionDef.BytesList bytes_list = 2; + */ + org.tensorflow.proto.CollectionDef.BytesListOrBuilder getBytesListOrBuilder(); + + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return Whether the int64List field is set. + */ + boolean hasInt64List(); + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + * @return The int64List. + */ + org.tensorflow.proto.CollectionDef.Int64List getInt64List(); + /** + * .tensorflow.CollectionDef.Int64List int64_list = 3; + */ + org.tensorflow.proto.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder(); + + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return Whether the floatList field is set. + */ + boolean hasFloatList(); + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + * @return The floatList. + */ + org.tensorflow.proto.CollectionDef.FloatList getFloatList(); + /** + * .tensorflow.CollectionDef.FloatList float_list = 4; + */ + org.tensorflow.proto.CollectionDef.FloatListOrBuilder getFloatListOrBuilder(); + + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return Whether the anyList field is set. + */ + boolean hasAnyList(); + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + * @return The anyList. + */ + org.tensorflow.proto.CollectionDef.AnyList getAnyList(); + /** + * .tensorflow.CollectionDef.AnyList any_list = 5; + */ + org.tensorflow.proto.CollectionDef.AnyListOrBuilder getAnyListOrBuilder(); + + org.tensorflow.proto.CollectionDef.KindCase getKindCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitId.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitId.java new file mode 100644 index 00000000000..e47f5125f55 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitId.java @@ -0,0 +1,983 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.CommitId} + */ +public final class CommitId extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CommitId) + CommitIdOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CommitId.class.getName()); + } + // Use CommitId.newBuilder() to construct. + private CommitId(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CommitId() { + snapshot_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CommitId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CommitId.class, org.tensorflow.proto.CommitId.Builder.class); + } + + private int kindCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object kind_; + public enum KindCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CHANGELIST(1), + HASH(2), + KIND_NOT_SET(0); + private final int value; + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: return CHANGELIST; + case 2: return HASH; + case 0: return KIND_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public static final int CHANGELIST_FIELD_NUMBER = 1; + /** + *
    +   * Submitted changelist.
    +   * 
    + * + * int64 changelist = 1; + * @return Whether the changelist field is set. + */ + @java.lang.Override + public boolean hasChangelist() { + return kindCase_ == 1; + } + /** + *
    +   * Submitted changelist.
    +   * 
    + * + * int64 changelist = 1; + * @return The changelist. + */ + @java.lang.Override + public long getChangelist() { + if (kindCase_ == 1) { + return (java.lang.Long) kind_; + } + return 0L; + } + + public static final int HASH_FIELD_NUMBER = 2; + /** + * string hash = 2; + * @return Whether the hash field is set. + */ + public boolean hasHash() { + return kindCase_ == 2; + } + /** + * string hash = 2; + * @return The hash. + */ + public java.lang.String getHash() { + java.lang.Object ref = ""; + if (kindCase_ == 2) { + ref = kind_; + } + 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(); + if (kindCase_ == 2) { + kind_ = s; + } + return s; + } + } + /** + * string hash = 2; + * @return The bytes for hash. + */ + public com.google.protobuf.ByteString + getHashBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 2) { + ref = kind_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (kindCase_ == 2) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object snapshot_ = ""; + /** + *
    +   * Hash of intermediate change between hash/changelist and what was tested.
    +   * Not used if the build is from a commit without modifications.
    +   * 
    + * + * string snapshot = 3; + * @return The snapshot. + */ + @java.lang.Override + public java.lang.String getSnapshot() { + java.lang.Object ref = snapshot_; + 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(); + snapshot_ = s; + return s; + } + } + /** + *
    +   * Hash of intermediate change between hash/changelist and what was tested.
    +   * Not used if the build is from a commit without modifications.
    +   * 
    + * + * string snapshot = 3; + * @return The bytes for snapshot. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSnapshotBytes() { + java.lang.Object ref = snapshot_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + snapshot_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PENDING_CHANGELIST_FIELD_NUMBER = 4; + private long pendingChangelist_ = 0L; + /** + *
    +   * Changelist tested if the change list is not already submitted.
    +   * 
    + * + * int64 pending_changelist = 4; + * @return The pendingChangelist. + */ + @java.lang.Override + public long getPendingChangelist() { + return pendingChangelist_; + } + + 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 (kindCase_ == 1) { + output.writeInt64( + 1, (long)((java.lang.Long) kind_)); + } + if (kindCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshot_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, snapshot_); + } + if (pendingChangelist_ != 0L) { + output.writeInt64(4, pendingChangelist_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 1, (long)((java.lang.Long) kind_)); + } + if (kindCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshot_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, snapshot_); + } + if (pendingChangelist_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, pendingChangelist_); + } + size += getUnknownFields().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.CommitId)) { + return super.equals(obj); + } + org.tensorflow.proto.CommitId other = (org.tensorflow.proto.CommitId) obj; + + if (!getSnapshot() + .equals(other.getSnapshot())) return false; + if (getPendingChangelist() + != other.getPendingChangelist()) return false; + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (getChangelist() + != other.getChangelist()) return false; + break; + case 2: + if (!getHash() + .equals(other.getHash())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + hash = (37 * hash) + PENDING_CHANGELIST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPendingChangelist()); + switch (kindCase_) { + case 1: + hash = (37 * hash) + CHANGELIST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getChangelist()); + break; + case 2: + hash = (37 * hash) + HASH_FIELD_NUMBER; + hash = (53 * hash) + getHash().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CommitId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CommitId 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.CommitId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CommitId 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.CommitId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CommitId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CommitId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CommitId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CommitId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CommitId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CommitId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CommitId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CommitId 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.CommitId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CommitId) + org.tensorflow.proto.CommitIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CommitId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CommitId.class, org.tensorflow.proto.CommitId.Builder.class); + } + + // Construct using org.tensorflow.proto.CommitId.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + snapshot_ = ""; + pendingChangelist_ = 0L; + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_CommitId_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CommitId getDefaultInstanceForType() { + return org.tensorflow.proto.CommitId.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CommitId build() { + org.tensorflow.proto.CommitId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CommitId buildPartial() { + org.tensorflow.proto.CommitId result = new org.tensorflow.proto.CommitId(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CommitId result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.snapshot_ = snapshot_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pendingChangelist_ = pendingChangelist_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.CommitId result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CommitId) { + return mergeFrom((org.tensorflow.proto.CommitId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CommitId other) { + if (other == org.tensorflow.proto.CommitId.getDefaultInstance()) return this; + if (!other.getSnapshot().isEmpty()) { + snapshot_ = other.snapshot_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPendingChangelist() != 0L) { + setPendingChangelist(other.getPendingChangelist()); + } + switch (other.getKindCase()) { + case CHANGELIST: { + setChangelist(other.getChangelist()); + break; + } + case HASH: { + kindCase_ = 2; + kind_ = other.kind_; + onChanged(); + break; + } + case KIND_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + kind_ = input.readInt64(); + kindCase_ = 1; + break; + } // case 8 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + kindCase_ = 2; + kind_ = s; + break; + } // case 18 + case 26: { + snapshot_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + pendingChangelist_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int kindCase_ = 0; + private java.lang.Object kind_; + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + *
    +     * Submitted changelist.
    +     * 
    + * + * int64 changelist = 1; + * @return Whether the changelist field is set. + */ + public boolean hasChangelist() { + return kindCase_ == 1; + } + /** + *
    +     * Submitted changelist.
    +     * 
    + * + * int64 changelist = 1; + * @return The changelist. + */ + public long getChangelist() { + if (kindCase_ == 1) { + return (java.lang.Long) kind_; + } + return 0L; + } + /** + *
    +     * Submitted changelist.
    +     * 
    + * + * int64 changelist = 1; + * @param value The changelist to set. + * @return This builder for chaining. + */ + public Builder setChangelist(long value) { + + kindCase_ = 1; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +     * Submitted changelist.
    +     * 
    + * + * int64 changelist = 1; + * @return This builder for chaining. + */ + public Builder clearChangelist() { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * string hash = 2; + * @return Whether the hash field is set. + */ + @java.lang.Override + public boolean hasHash() { + return kindCase_ == 2; + } + /** + * string hash = 2; + * @return The hash. + */ + @java.lang.Override + public java.lang.String getHash() { + java.lang.Object ref = ""; + if (kindCase_ == 2) { + ref = kind_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (kindCase_ == 2) { + kind_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string hash = 2; + * @return The bytes for hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHashBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 2) { + ref = kind_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (kindCase_ == 2) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string hash = 2; + * @param value The hash to set. + * @return This builder for chaining. + */ + public Builder setHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + kindCase_ = 2; + kind_ = value; + onChanged(); + return this; + } + /** + * string hash = 2; + * @return This builder for chaining. + */ + public Builder clearHash() { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + /** + * string hash = 2; + * @param value The bytes for hash to set. + * @return This builder for chaining. + */ + public Builder setHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + kindCase_ = 2; + kind_ = value; + onChanged(); + return this; + } + + private java.lang.Object snapshot_ = ""; + /** + *
    +     * Hash of intermediate change between hash/changelist and what was tested.
    +     * Not used if the build is from a commit without modifications.
    +     * 
    + * + * string snapshot = 3; + * @return The snapshot. + */ + public java.lang.String getSnapshot() { + java.lang.Object ref = snapshot_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snapshot_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Hash of intermediate change between hash/changelist and what was tested.
    +     * Not used if the build is from a commit without modifications.
    +     * 
    + * + * string snapshot = 3; + * @return The bytes for snapshot. + */ + public com.google.protobuf.ByteString + getSnapshotBytes() { + java.lang.Object ref = snapshot_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + snapshot_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Hash of intermediate change between hash/changelist and what was tested.
    +     * Not used if the build is from a commit without modifications.
    +     * 
    + * + * string snapshot = 3; + * @param value The snapshot to set. + * @return This builder for chaining. + */ + public Builder setSnapshot( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + snapshot_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Hash of intermediate change between hash/changelist and what was tested.
    +     * Not used if the build is from a commit without modifications.
    +     * 
    + * + * string snapshot = 3; + * @return This builder for chaining. + */ + public Builder clearSnapshot() { + snapshot_ = getDefaultInstance().getSnapshot(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Hash of intermediate change between hash/changelist and what was tested.
    +     * Not used if the build is from a commit without modifications.
    +     * 
    + * + * string snapshot = 3; + * @param value The bytes for snapshot to set. + * @return This builder for chaining. + */ + public Builder setSnapshotBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + snapshot_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long pendingChangelist_ ; + /** + *
    +     * Changelist tested if the change list is not already submitted.
    +     * 
    + * + * int64 pending_changelist = 4; + * @return The pendingChangelist. + */ + @java.lang.Override + public long getPendingChangelist() { + return pendingChangelist_; + } + /** + *
    +     * Changelist tested if the change list is not already submitted.
    +     * 
    + * + * int64 pending_changelist = 4; + * @param value The pendingChangelist to set. + * @return This builder for chaining. + */ + public Builder setPendingChangelist(long value) { + + pendingChangelist_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Changelist tested if the change list is not already submitted.
    +     * 
    + * + * int64 pending_changelist = 4; + * @return This builder for chaining. + */ + public Builder clearPendingChangelist() { + bitField0_ = (bitField0_ & ~0x00000008); + pendingChangelist_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CommitId) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CommitId) + private static final org.tensorflow.proto.CommitId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CommitId(); + } + + public static org.tensorflow.proto.CommitId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommitId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CommitId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitIdOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitIdOrBuilder.java new file mode 100644 index 00000000000..0975a2c537f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CommitIdOrBuilder.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface CommitIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CommitId) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Submitted changelist.
    +   * 
    + * + * int64 changelist = 1; + * @return Whether the changelist field is set. + */ + boolean hasChangelist(); + /** + *
    +   * Submitted changelist.
    +   * 
    + * + * int64 changelist = 1; + * @return The changelist. + */ + long getChangelist(); + + /** + * string hash = 2; + * @return Whether the hash field is set. + */ + boolean hasHash(); + /** + * string hash = 2; + * @return The hash. + */ + java.lang.String getHash(); + /** + * string hash = 2; + * @return The bytes for hash. + */ + com.google.protobuf.ByteString + getHashBytes(); + + /** + *
    +   * Hash of intermediate change between hash/changelist and what was tested.
    +   * Not used if the build is from a commit without modifications.
    +   * 
    + * + * string snapshot = 3; + * @return The snapshot. + */ + java.lang.String getSnapshot(); + /** + *
    +   * Hash of intermediate change between hash/changelist and what was tested.
    +   * Not used if the build is from a commit without modifications.
    +   * 
    + * + * string snapshot = 3; + * @return The bytes for snapshot. + */ + com.google.protobuf.ByteString + getSnapshotBytes(); + + /** + *
    +   * Changelist tested if the change list is not already submitted.
    +   * 
    + * + * int64 pending_changelist = 4; + * @return The pendingChangelist. + */ + long getPendingChangelist(); + + org.tensorflow.proto.CommitId.KindCase getKindCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CompositeTensorVariant.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CompositeTensorVariant.java new file mode 100644 index 00000000000..80fd1875558 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CompositeTensorVariant.java @@ -0,0 +1,653 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/composite_tensor_variant.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class CompositeTensorVariant { + private CompositeTensorVariant() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CompositeTensorVariant.class.getName()); + } + 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 CompositeTensorVariantMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CompositeTensorVariantMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return Whether the typeSpecProto field is set. + */ + boolean hasTypeSpecProto(); + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return The typeSpecProto. + */ + org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecProto(); + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder(); + } + /** + *
    +   * Metadata for CompositeTensorVariant, used when serializing as Variant.
    +   *
    +   * We define a new message here (rather than directly using TypeSpecProto for
    +   * the metadata string) to retain flexibility to change the metadata encoding
    +   * to support additional features.
    +   * 
    + * + * Protobuf type {@code tensorflow.CompositeTensorVariantMetadata} + */ + public static final class CompositeTensorVariantMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CompositeTensorVariantMetadata) + CompositeTensorVariantMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CompositeTensorVariantMetadata.class.getName()); + } + // Use CompositeTensorVariantMetadata.newBuilder() to construct. + private CompositeTensorVariantMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CompositeTensorVariantMetadata() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.class, org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.Builder.class); + } + + private int bitField0_; + public static final int TYPE_SPEC_PROTO_FIELD_NUMBER = 1; + private org.tensorflow.proto.Struct.TypeSpecProto typeSpecProto_; + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return Whether the typeSpecProto field is set. + */ + @java.lang.Override + public boolean hasTypeSpecProto() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return The typeSpecProto. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecProto() { + return typeSpecProto_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpecProto_; + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder() { + return typeSpecProto_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpecProto_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTypeSpecProto()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTypeSpecProto()); + } + size += getUnknownFields().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.CompositeTensorVariant.CompositeTensorVariantMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata other = (org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata) obj; + + if (hasTypeSpecProto() != other.hasTypeSpecProto()) return false; + if (hasTypeSpecProto()) { + if (!getTypeSpecProto() + .equals(other.getTypeSpecProto())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTypeSpecProto()) { + hash = (37 * hash) + TYPE_SPEC_PROTO_FIELD_NUMBER; + hash = (53 * hash) + getTypeSpecProto().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata 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.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CompositeTensorVariant.CompositeTensorVariantMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for CompositeTensorVariant, used when serializing as Variant.
    +     *
    +     * We define a new message here (rather than directly using TypeSpecProto for
    +     * the metadata string) to retain flexibility to change the metadata encoding
    +     * to support additional features.
    +     * 
    + * + * Protobuf type {@code tensorflow.CompositeTensorVariantMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CompositeTensorVariantMetadata) + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.class, org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTypeSpecProtoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeSpecProto_ = null; + if (typeSpecProtoBuilder_ != null) { + typeSpecProtoBuilder_.dispose(); + typeSpecProtoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CompositeTensorVariant.internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata build() { + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata buildPartial() { + org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata result = new org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeSpecProto_ = typeSpecProtoBuilder_ == null + ? typeSpecProto_ + : typeSpecProtoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata) { + return mergeFrom((org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata other) { + if (other == org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata.getDefaultInstance()) return this; + if (other.hasTypeSpecProto()) { + mergeTypeSpecProto(other.getTypeSpecProto()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getTypeSpecProtoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.Struct.TypeSpecProto typeSpecProto_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> typeSpecProtoBuilder_; + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return Whether the typeSpecProto field is set. + */ + public boolean hasTypeSpecProto() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + * @return The typeSpecProto. + */ + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecProto() { + if (typeSpecProtoBuilder_ == null) { + return typeSpecProto_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpecProto_; + } else { + return typeSpecProtoBuilder_.getMessage(); + } + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public Builder setTypeSpecProto(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecProtoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + typeSpecProto_ = value; + } else { + typeSpecProtoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public Builder setTypeSpecProto( + org.tensorflow.proto.Struct.TypeSpecProto.Builder builderForValue) { + if (typeSpecProtoBuilder_ == null) { + typeSpecProto_ = builderForValue.build(); + } else { + typeSpecProtoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public Builder mergeTypeSpecProto(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecProtoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + typeSpecProto_ != null && + typeSpecProto_ != org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance()) { + getTypeSpecProtoBuilder().mergeFrom(value); + } else { + typeSpecProto_ = value; + } + } else { + typeSpecProtoBuilder_.mergeFrom(value); + } + if (typeSpecProto_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public Builder clearTypeSpecProto() { + bitField0_ = (bitField0_ & ~0x00000001); + typeSpecProto_ = null; + if (typeSpecProtoBuilder_ != null) { + typeSpecProtoBuilder_.dispose(); + typeSpecProtoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public org.tensorflow.proto.Struct.TypeSpecProto.Builder getTypeSpecProtoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTypeSpecProtoFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecProtoOrBuilder() { + if (typeSpecProtoBuilder_ != null) { + return typeSpecProtoBuilder_.getMessageOrBuilder(); + } else { + return typeSpecProto_ == null ? + org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpecProto_; + } + } + /** + * .tensorflow.TypeSpecProto type_spec_proto = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> + getTypeSpecProtoFieldBuilder() { + if (typeSpecProtoBuilder_ == null) { + typeSpecProtoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder>( + getTypeSpecProto(), + getParentForChildren(), + isClean()); + typeSpecProto_ = null; + } + return typeSpecProtoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CompositeTensorVariantMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CompositeTensorVariantMetadata) + private static final org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata(); + } + + public static org.tensorflow.proto.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompositeTensorVariantMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CompositeTensorVariant.CompositeTensorVariantMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n7tensorflow/core/protobuf/composite_ten" + + "sor_variant.proto\022\ntensorflow\032%tensorflo" + + "w/core/protobuf/struct.proto\"T\n\036Composit" + + "eTensorVariantMetadata\0222\n\017type_spec_prot" + + "o\030\001 \001(\0132\031.tensorflow.TypeSpecProtoBm\n\024or" + + "g.tensorflow.protoZUgithub.com/tensorflo" + + "w/tensorflow/tensorflow/go/core/protobuf" + + "/for_core_protos_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.Struct.getDescriptor(), + }); + internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_CompositeTensorVariantMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CompositeTensorVariantMetadata_descriptor, + new java.lang.String[] { "TypeSpecProto", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.Struct.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDef.java new file mode 100644 index 00000000000..a75ca0e43fb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDef.java @@ -0,0 +1,1635 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing a CondContext object.
    + * 
    + * + * Protobuf type {@code tensorflow.CondContextDef} + */ +public final class CondContextDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CondContextDef) + CondContextDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CondContextDef.class.getName()); + } + // Use CondContextDef.newBuilder() to construct. + private CondContextDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CondContextDef() { + contextName_ = ""; + predName_ = ""; + pivotName_ = ""; + nestedContexts_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_CondContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CondContextDef.class, org.tensorflow.proto.CondContextDef.Builder.class); + } + + private int bitField0_; + public static final int CONTEXT_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object contextName_ = ""; + /** + *
    +   * Name of the context.
    +   * 
    + * + * string context_name = 1; + * @return The contextName. + */ + @java.lang.Override + public java.lang.String getContextName() { + java.lang.Object ref = contextName_; + 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(); + contextName_ = s; + return s; + } + } + /** + *
    +   * Name of the context.
    +   * 
    + * + * string context_name = 1; + * @return The bytes for contextName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextNameBytes() { + java.lang.Object ref = contextName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRED_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object predName_ = ""; + /** + *
    +   * Name of the pred tensor.
    +   * 
    + * + * string pred_name = 2; + * @return The predName. + */ + @java.lang.Override + public java.lang.String getPredName() { + java.lang.Object ref = predName_; + 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(); + predName_ = s; + return s; + } + } + /** + *
    +   * Name of the pred tensor.
    +   * 
    + * + * string pred_name = 2; + * @return The bytes for predName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPredNameBytes() { + java.lang.Object ref = predName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + predName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PIVOT_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object pivotName_ = ""; + /** + *
    +   * Name of the pivot tensor.
    +   * 
    + * + * string pivot_name = 3; + * @return The pivotName. + */ + @java.lang.Override + public java.lang.String getPivotName() { + java.lang.Object ref = pivotName_; + 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(); + pivotName_ = s; + return s; + } + } + /** + *
    +   * Name of the pivot tensor.
    +   * 
    + * + * string pivot_name = 3; + * @return The bytes for pivotName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPivotNameBytes() { + java.lang.Object ref = pivotName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BRANCH_FIELD_NUMBER = 4; + private int branch_ = 0; + /** + *
    +   * Branch prediction. 0 or 1.
    +   * 
    + * + * int32 branch = 4; + * @return The branch. + */ + @java.lang.Override + public int getBranch() { + return branch_; + } + + public static final int VALUES_DEF_FIELD_NUMBER = 5; + private org.tensorflow.proto.ValuesDef valuesDef_; + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 5; + * @return Whether the valuesDef field is set. + */ + @java.lang.Override + public boolean hasValuesDef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 5; + * @return The valuesDef. + */ + @java.lang.Override + public org.tensorflow.proto.ValuesDef getValuesDef() { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + @java.lang.Override + public org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder() { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + + public static final int NESTED_CONTEXTS_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List nestedContexts_; + /** + *
    +   * Contexts contained inside this context (e.g. nested conds).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + @java.lang.Override + public java.util.List getNestedContextsList() { + return nestedContexts_; + } + /** + *
    +   * Contexts contained inside this context (e.g. nested conds).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + @java.lang.Override + public java.util.List + getNestedContextsOrBuilderList() { + return nestedContexts_; + } + /** + *
    +   * Contexts contained inside this context (e.g. nested conds).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + @java.lang.Override + public int getNestedContextsCount() { + return nestedContexts_.size(); + } + /** + *
    +   * Contexts contained inside this context (e.g. nested conds).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index) { + return nestedContexts_.get(index); + } + /** + *
    +   * Contexts contained inside this context (e.g. nested conds).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( + int index) { + return nestedContexts_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, contextName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(predName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, predName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pivotName_); + } + if (branch_ != 0) { + output.writeInt32(4, branch_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getValuesDef()); + } + for (int i = 0; i < nestedContexts_.size(); i++) { + output.writeMessage(6, nestedContexts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, contextName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(predName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, predName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pivotName_); + } + if (branch_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, branch_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getValuesDef()); + } + for (int i = 0; i < nestedContexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, nestedContexts_.get(i)); + } + size += getUnknownFields().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.CondContextDef)) { + return super.equals(obj); + } + org.tensorflow.proto.CondContextDef other = (org.tensorflow.proto.CondContextDef) obj; + + if (!getContextName() + .equals(other.getContextName())) return false; + if (!getPredName() + .equals(other.getPredName())) return false; + if (!getPivotName() + .equals(other.getPivotName())) return false; + if (getBranch() + != other.getBranch()) return false; + if (hasValuesDef() != other.hasValuesDef()) return false; + if (hasValuesDef()) { + if (!getValuesDef() + .equals(other.getValuesDef())) return false; + } + if (!getNestedContextsList() + .equals(other.getNestedContextsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONTEXT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getContextName().hashCode(); + hash = (37 * hash) + PRED_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPredName().hashCode(); + hash = (37 * hash) + PIVOT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPivotName().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch(); + if (hasValuesDef()) { + hash = (37 * hash) + VALUES_DEF_FIELD_NUMBER; + hash = (53 * hash) + getValuesDef().hashCode(); + } + if (getNestedContextsCount() > 0) { + hash = (37 * hash) + NESTED_CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getNestedContextsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CondContextDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CondContextDef 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.CondContextDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CondContextDef 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.CondContextDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CondContextDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CondContextDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CondContextDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CondContextDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CondContextDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CondContextDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CondContextDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CondContextDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a CondContext object.
    +   * 
    + * + * Protobuf type {@code tensorflow.CondContextDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CondContextDef) + org.tensorflow.proto.CondContextDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_CondContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CondContextDef.class, org.tensorflow.proto.CondContextDef.Builder.class); + } + + // Construct using org.tensorflow.proto.CondContextDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValuesDefFieldBuilder(); + getNestedContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contextName_ = ""; + predName_ = ""; + pivotName_ = ""; + branch_ = 0; + valuesDef_ = null; + if (valuesDefBuilder_ != null) { + valuesDefBuilder_.dispose(); + valuesDefBuilder_ = null; + } + if (nestedContextsBuilder_ == null) { + nestedContexts_ = java.util.Collections.emptyList(); + } else { + nestedContexts_ = null; + nestedContextsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_CondContextDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CondContextDef getDefaultInstanceForType() { + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CondContextDef build() { + org.tensorflow.proto.CondContextDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CondContextDef buildPartial() { + org.tensorflow.proto.CondContextDef result = new org.tensorflow.proto.CondContextDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CondContextDef result) { + if (nestedContextsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.nestedContexts_ = nestedContexts_; + } else { + result.nestedContexts_ = nestedContextsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CondContextDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.contextName_ = contextName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.predName_ = predName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pivotName_ = pivotName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.branch_ = branch_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.valuesDef_ = valuesDefBuilder_ == null + ? valuesDef_ + : valuesDefBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CondContextDef) { + return mergeFrom((org.tensorflow.proto.CondContextDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CondContextDef other) { + if (other == org.tensorflow.proto.CondContextDef.getDefaultInstance()) return this; + if (!other.getContextName().isEmpty()) { + contextName_ = other.contextName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPredName().isEmpty()) { + predName_ = other.predName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getPivotName().isEmpty()) { + pivotName_ = other.pivotName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getBranch() != 0) { + setBranch(other.getBranch()); + } + if (other.hasValuesDef()) { + mergeValuesDef(other.getValuesDef()); + } + if (nestedContextsBuilder_ == null) { + if (!other.nestedContexts_.isEmpty()) { + if (nestedContexts_.isEmpty()) { + nestedContexts_ = other.nestedContexts_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureNestedContextsIsMutable(); + nestedContexts_.addAll(other.nestedContexts_); + } + onChanged(); + } + } else { + if (!other.nestedContexts_.isEmpty()) { + if (nestedContextsBuilder_.isEmpty()) { + nestedContextsBuilder_.dispose(); + nestedContextsBuilder_ = null; + nestedContexts_ = other.nestedContexts_; + bitField0_ = (bitField0_ & ~0x00000020); + nestedContextsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNestedContextsFieldBuilder() : null; + } else { + nestedContextsBuilder_.addAllMessages(other.nestedContexts_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + contextName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + predName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + pivotName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + branch_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + getValuesDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + org.tensorflow.proto.ControlFlowContextDef m = + input.readMessage( + org.tensorflow.proto.ControlFlowContextDef.parser(), + extensionRegistry); + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(m); + } else { + nestedContextsBuilder_.addMessage(m); + } + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object contextName_ = ""; + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return The contextName. + */ + public java.lang.String getContextName() { + java.lang.Object ref = contextName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return The bytes for contextName. + */ + public com.google.protobuf.ByteString + getContextNameBytes() { + java.lang.Object ref = contextName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @param value The contextName to set. + * @return This builder for chaining. + */ + public Builder setContextName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return This builder for chaining. + */ + public Builder clearContextName() { + contextName_ = getDefaultInstance().getContextName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @param value The bytes for contextName to set. + * @return This builder for chaining. + */ + public Builder setContextNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object predName_ = ""; + /** + *
    +     * Name of the pred tensor.
    +     * 
    + * + * string pred_name = 2; + * @return The predName. + */ + public java.lang.String getPredName() { + java.lang.Object ref = predName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + predName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the pred tensor.
    +     * 
    + * + * string pred_name = 2; + * @return The bytes for predName. + */ + public com.google.protobuf.ByteString + getPredNameBytes() { + java.lang.Object ref = predName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + predName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the pred tensor.
    +     * 
    + * + * string pred_name = 2; + * @param value The predName to set. + * @return This builder for chaining. + */ + public Builder setPredName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + predName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the pred tensor.
    +     * 
    + * + * string pred_name = 2; + * @return This builder for chaining. + */ + public Builder clearPredName() { + predName_ = getDefaultInstance().getPredName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the pred tensor.
    +     * 
    + * + * string pred_name = 2; + * @param value The bytes for predName to set. + * @return This builder for chaining. + */ + public Builder setPredNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + predName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object pivotName_ = ""; + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 3; + * @return The pivotName. + */ + public java.lang.String getPivotName() { + java.lang.Object ref = pivotName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pivotName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 3; + * @return The bytes for pivotName. + */ + public com.google.protobuf.ByteString + getPivotNameBytes() { + java.lang.Object ref = pivotName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 3; + * @param value The pivotName to set. + * @return This builder for chaining. + */ + public Builder setPivotName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pivotName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 3; + * @return This builder for chaining. + */ + public Builder clearPivotName() { + pivotName_ = getDefaultInstance().getPivotName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 3; + * @param value The bytes for pivotName to set. + * @return This builder for chaining. + */ + public Builder setPivotNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pivotName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int branch_ ; + /** + *
    +     * Branch prediction. 0 or 1.
    +     * 
    + * + * int32 branch = 4; + * @return The branch. + */ + @java.lang.Override + public int getBranch() { + return branch_; + } + /** + *
    +     * Branch prediction. 0 or 1.
    +     * 
    + * + * int32 branch = 4; + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(int value) { + + branch_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Branch prediction. 0 or 1.
    +     * 
    + * + * int32 branch = 4; + * @return This builder for chaining. + */ + public Builder clearBranch() { + bitField0_ = (bitField0_ & ~0x00000008); + branch_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.ValuesDef valuesDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder> valuesDefBuilder_; + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + * @return Whether the valuesDef field is set. + */ + public boolean hasValuesDef() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + * @return The valuesDef. + */ + public org.tensorflow.proto.ValuesDef getValuesDef() { + if (valuesDefBuilder_ == null) { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } else { + return valuesDefBuilder_.getMessage(); + } + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public Builder setValuesDef(org.tensorflow.proto.ValuesDef value) { + if (valuesDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valuesDef_ = value; + } else { + valuesDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public Builder setValuesDef( + org.tensorflow.proto.ValuesDef.Builder builderForValue) { + if (valuesDefBuilder_ == null) { + valuesDef_ = builderForValue.build(); + } else { + valuesDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public Builder mergeValuesDef(org.tensorflow.proto.ValuesDef value) { + if (valuesDefBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + valuesDef_ != null && + valuesDef_ != org.tensorflow.proto.ValuesDef.getDefaultInstance()) { + getValuesDefBuilder().mergeFrom(value); + } else { + valuesDef_ = value; + } + } else { + valuesDefBuilder_.mergeFrom(value); + } + if (valuesDef_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public Builder clearValuesDef() { + bitField0_ = (bitField0_ & ~0x00000010); + valuesDef_ = null; + if (valuesDefBuilder_ != null) { + valuesDefBuilder_.dispose(); + valuesDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public org.tensorflow.proto.ValuesDef.Builder getValuesDefBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getValuesDefFieldBuilder().getBuilder(); + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + public org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder() { + if (valuesDefBuilder_ != null) { + return valuesDefBuilder_.getMessageOrBuilder(); + } else { + return valuesDef_ == null ? + org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder> + getValuesDefFieldBuilder() { + if (valuesDefBuilder_ == null) { + valuesDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder>( + getValuesDef(), + getParentForChildren(), + isClean()); + valuesDef_ = null; + } + return valuesDefBuilder_; + } + + private java.util.List nestedContexts_ = + java.util.Collections.emptyList(); + private void ensureNestedContextsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + nestedContexts_ = new java.util.ArrayList(nestedContexts_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder> nestedContextsBuilder_; + + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public java.util.List getNestedContextsList() { + if (nestedContextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nestedContexts_); + } else { + return nestedContextsBuilder_.getMessageList(); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public int getNestedContextsCount() { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.size(); + } else { + return nestedContextsBuilder_.getCount(); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index) { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.get(index); + } else { + return nestedContextsBuilder_.getMessage(index); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder setNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.set(index, value); + onChanged(); + } else { + nestedContextsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder setNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.set(index, builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder addNestedContexts(org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.add(value); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder addNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.add(index, value); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder addNestedContexts( + org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder addNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(index, builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder addAllNestedContexts( + java.lang.Iterable values) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nestedContexts_); + onChanged(); + } else { + nestedContextsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder clearNestedContexts() { + if (nestedContextsBuilder_ == null) { + nestedContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + nestedContextsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public Builder removeNestedContexts(int index) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.remove(index); + onChanged(); + } else { + nestedContextsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder getNestedContextsBuilder( + int index) { + return getNestedContextsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( + int index) { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.get(index); } else { + return nestedContextsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public java.util.List + getNestedContextsOrBuilderList() { + if (nestedContextsBuilder_ != null) { + return nestedContextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nestedContexts_); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder addNestedContextsBuilder() { + return getNestedContextsFieldBuilder().addBuilder( + org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance()); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder addNestedContextsBuilder( + int index) { + return getNestedContextsFieldBuilder().addBuilder( + index, org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance()); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested conds).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6; + */ + public java.util.List + getNestedContextsBuilderList() { + return getNestedContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder> + getNestedContextsFieldBuilder() { + if (nestedContextsBuilder_ == null) { + nestedContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder>( + nestedContexts_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + nestedContexts_ = null; + } + return nestedContextsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CondContextDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CondContextDef) + private static final org.tensorflow.proto.CondContextDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CondContextDef(); + } + + public static org.tensorflow.proto.CondContextDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CondContextDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CondContextDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDefOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDefOrBuilder.java index 1dcdef5fd71..e136d8849da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CondContextDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CondContextDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface CondContextDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.CondContextDef) @@ -13,6 +15,7 @@ public interface CondContextDefOrBuilder extends *
    * * string context_name = 1; + * @return The contextName. */ java.lang.String getContextName(); /** @@ -21,6 +24,7 @@ public interface CondContextDefOrBuilder extends *
    * * string context_name = 1; + * @return The bytes for contextName. */ com.google.protobuf.ByteString getContextNameBytes(); @@ -31,6 +35,7 @@ public interface CondContextDefOrBuilder extends *
    * * string pred_name = 2; + * @return The predName. */ java.lang.String getPredName(); /** @@ -39,6 +44,7 @@ public interface CondContextDefOrBuilder extends *
    * * string pred_name = 2; + * @return The bytes for predName. */ com.google.protobuf.ByteString getPredNameBytes(); @@ -49,6 +55,7 @@ public interface CondContextDefOrBuilder extends *
    * * string pivot_name = 3; + * @return The pivotName. */ java.lang.String getPivotName(); /** @@ -57,6 +64,7 @@ public interface CondContextDefOrBuilder extends *
    * * string pivot_name = 3; + * @return The bytes for pivotName. */ com.google.protobuf.ByteString getPivotNameBytes(); @@ -67,6 +75,7 @@ public interface CondContextDefOrBuilder extends * * * int32 branch = 4; + * @return The branch. */ int getBranch(); @@ -76,6 +85,7 @@ public interface CondContextDefOrBuilder extends * * * .tensorflow.ValuesDef values_def = 5; + * @return Whether the valuesDef field is set. */ boolean hasValuesDef(); /** @@ -84,8 +94,9 @@ public interface CondContextDefOrBuilder extends * * * .tensorflow.ValuesDef values_def = 5; + * @return The valuesDef. */ - org.tensorflow.proto.framework.ValuesDef getValuesDef(); + org.tensorflow.proto.ValuesDef getValuesDef(); /** *
        * Values and external values in control flow context.
    @@ -93,7 +104,7 @@ public interface CondContextDefOrBuilder extends
        *
        * .tensorflow.ValuesDef values_def = 5;
        */
    -  org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder();
    +  org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder();
     
       /**
        * 
    @@ -102,7 +113,7 @@ public interface CondContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6;
        */
    -  java.util.List 
    +  java.util.List 
           getNestedContextsList();
       /**
        * 
    @@ -111,7 +122,7 @@ public interface CondContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6;
        */
    -  org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index);
    +  org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index);
       /**
        * 
        * Contexts contained inside this context (e.g. nested conds).
    @@ -127,7 +138,7 @@ public interface CondContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6;
        */
    -  java.util.List 
    +  java.util.List 
           getNestedContextsOrBuilderList();
       /**
        * 
    @@ -136,6 +147,6 @@ public interface CondContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 6;
        */
    -  org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder(
    +  org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProto.java
    new file mode 100644
    index 00000000000..08d6ec83d47
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProto.java
    @@ -0,0 +1,8501 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/config.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Session configuration parameters.
    + * The system picks appropriate values for fields that are not set.
    + * 
    + * + * Protobuf type {@code tensorflow.ConfigProto} + */ +public final class ConfigProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ConfigProto) + ConfigProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ConfigProto.class.getName()); + } + // Use ConfigProto.newBuilder() to construct. + private ConfigProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ConfigProto() { + sessionInterOpThreadPool_ = java.util.Collections.emptyList(); + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetDeviceCount(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ConfigProto.class, org.tensorflow.proto.ConfigProto.Builder.class); + } + + public interface ExperimentalOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ConfigProto.Experimental) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Task name for group resolution.
    +     * 
    + * + * string collective_group_leader = 1; + * @return The collectiveGroupLeader. + */ + java.lang.String getCollectiveGroupLeader(); + /** + *
    +     * Task name for group resolution.
    +     * 
    + * + * string collective_group_leader = 1; + * @return The bytes for collectiveGroupLeader. + */ + com.google.protobuf.ByteString + getCollectiveGroupLeaderBytes(); + + /** + *
    +     * Which executor to use, the default executor will be used
    +     * if it is an empty string or "DEFAULT"
    +     * 
    + * + * string executor_type = 3; + * @return The executorType. + */ + java.lang.String getExecutorType(); + /** + *
    +     * Which executor to use, the default executor will be used
    +     * if it is an empty string or "DEFAULT"
    +     * 
    + * + * string executor_type = 3; + * @return The bytes for executorType. + */ + com.google.protobuf.ByteString + getExecutorTypeBytes(); + + /** + *
    +     * Guidance to formatting of large RecvBuf fields for transfer.
    +     * Any positive value sets the max chunk size.  0 defaults to 4096.
    +     * Any negative value indicates no max, i.e. one chunk only.
    +     * 
    + * + * int32 recv_buf_max_chunk = 4; + * @return The recvBufMaxChunk. + */ + int getRecvBufMaxChunk(); + + /** + *
    +     * If true, and supported by the platform, the runtime will attempt to
    +     * use NUMA affinity where applicable.  One consequence will be the
    +     * existence of as many CPU devices as there are available NUMA nodes.
    +     * 
    + * + * bool use_numa_affinity = 5; + * @return The useNumaAffinity. + */ + boolean getUseNumaAffinity(); + + /** + *
    +     * If true, make collective op execution order sequential and deterministic
    +     * for potentially concurrent collective instances.
    +     * 
    + * + * bool collective_deterministic_sequential_execution = 6; + * @return The collectiveDeterministicSequentialExecution. + */ + boolean getCollectiveDeterministicSequentialExecution(); + + /** + *
    +     * If true, use NCCL for CollectiveOps.  This feature is highly
    +     * experimental.
    +     * 
    + * + * bool collective_nccl = 7; + * @return The collectiveNccl. + */ + boolean getCollectiveNccl(); + + /** + *
    +     * In the following, session state means the value of a variable, elements
    +     * in a hash table, or any other resource, accessible by worker sessions
    +     * held by a TF server.
    +     *
    +     * When ClusterSpec propagation is enabled, the value of
    +     * isolate_session_state is ignored when deciding whether to share session
    +     * states in a TF server (for backwards compatibility reasons).
    +     * - If share_session_state_in_clusterspec_propagation is true, the session
    +     * states are shared.
    +     * - If share_session_state_in_clusterspec_propagation is false, session
    +     * states are isolated.
    +     *
    +     * When clusterspec propagation is not used, the value of
    +     * share_session_state_in_clusterspec_propagation is ignored when deciding
    +     * whether to share session states in a TF server.
    +     * - If isolate_session_state is true, session states are isolated.
    +     * - If isolate_session_state is false, session states are shared.
    +     *
    +     * TODO(b/129330037): Add a single API that consistently treats
    +     * isolate_session_state and ClusterSpec propagation.
    +     * 
    + * + * bool share_session_state_in_clusterspec_propagation = 8; + * @return The shareSessionStateInClusterspecPropagation. + */ + boolean getShareSessionStateInClusterspecPropagation(); + + /** + *
    +     * If using a direct session, disable spinning while waiting for work in
    +     * the thread pool. This may result in higher latency for completing ops,
    +     * but in the case where there is a lot of spinning may result in lower
    +     * CPU usage.
    +     * 
    + * + * bool disable_thread_spinning = 9; + * @return The disableThreadSpinning. + */ + boolean getDisableThreadSpinning(); + + /** + *
    +     * This was promoted to a non-experimental API. Please use
    +     * ConfigProto.share_cluster_devices_in_session instead.
    +     * 
    + * + * bool share_cluster_devices_in_session = 10; + * @return The shareClusterDevicesInSession. + */ + boolean getShareClusterDevicesInSession(); + + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return Whether the sessionMetadata field is set. + */ + boolean hasSessionMetadata(); + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return The sessionMetadata. + */ + org.tensorflow.proto.SessionMetadata getSessionMetadata(); + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder(); + + /** + *
    +     * If true, the session may treat the graph as being static for optimization
    +     * purposes.
    +     *
    +     * If this option is set to true when a session is created, the full
    +     * GraphDef must be passed in a single call to Session::Create(), and
    +     * Session::Extend() may not be supported.
    +     * 
    + * + * bool optimize_for_static_graph = 12; + * @return The optimizeForStaticGraph. + */ + boolean getOptimizeForStaticGraph(); + + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
    +     * to true. Default value or false is ignored. Use mlir_bridge_rollout for
    +     * finer control.
    +     *
    +     * If this option is set to true when a session is created, MLIR is used to
    +     * perform the set of graph transformations to put the graph in a form that
    +     * can be executed with delegation of some computations to an accelerator.
    +     * This builds on the model of XLA where a subset of the graph is
    +     * encapsulated and attached to a "compile" operation, whose result is fed
    +     * to an "execute" operation. The kernel for these operations is responsible
    +     * to lower the encapsulated graph to a particular device.
    +     * 
    + * + * bool enable_mlir_bridge = 13; + * @return The enableMlirBridge. + */ + boolean getEnableMlirBridge(); + + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge.
    +     * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The enum numeric value on the wire for mlirBridgeRollout. + */ + int getMlirBridgeRolloutValue(); + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge.
    +     * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The mlirBridgeRollout. + */ + org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout(); + + /** + *
    +     * Whether to enable the MLIR-based Graph optimizations.
    +     *
    +     * This will become a part of standard Tensorflow graph optimization
    +     * pipeline, currently this is only used for gradual migration and testing
    +     * new passes that are replacing existing optimizations in Grappler.
    +     * 
    + * + * bool enable_mlir_graph_optimization = 16; + * @return The enableMlirGraphOptimization. + */ + boolean getEnableMlirGraphOptimization(); + + /** + *
    +     * If true, the session will not store an additional copy of the graph for
    +     * each subgraph.
    +     *
    +     * If this option is set to true when a session is created, the
    +     * `RunOptions.output_partition_graphs` options must not be set.
    +     * 
    + * + * bool disable_output_partition_graphs = 14; + * @return The disableOutputPartitionGraphs. + */ + boolean getDisableOutputPartitionGraphs(); + + /** + *
    +     * Minimum number of batches run through the XLA graph before XLA fusion
    +     * autotuner is enabled. Default value of zero disables the autotuner.
    +     *
    +     * The XLA fusion autotuner can improve performance by executing a heuristic
    +     * search on the compiler parameters.
    +     * 
    + * + * int64 xla_fusion_autotuner_thresh = 15; + * @return The xlaFusionAutotunerThresh. + */ + long getXlaFusionAutotunerThresh(); + + /** + *
    +     * Whether runtime execution uses TFRT.
    +     * 
    + * + * bool use_tfrt = 18; + * @return The useTfrt. + */ + boolean getUseTfrt(); + + /** + *
    +     * If true, use Pathways with TFRT API for multi host support.
    +     * 
    + * + * bool enable_multi_host = 27; + * @return The enableMultiHost. + */ + boolean getEnableMultiHost(); + + /** + *
    +     * If true, use ifrt as the backend for TFRT. This is only used when
    +     * `use_tfrt` is true.
    +     * 
    + * + * bool tfrt_use_ifrt = 32; + * @return The tfrtUseIfrt. + */ + boolean getTfrtUseIfrt(); + + /** + *
    +     * Port for the Pathways server. Ignored if enable_multi_host=false.
    +     * 
    + * + * int32 backend_server_port = 28; + * @return The backendServerPort. + */ + int getBackendServerPort(); + + /** + *
    +     * If true, TFRT will use TPU specific compiler passes and perform TPU
    +     * specific initialization.
    +     * 
    + * + * bool target_tpu = 29; + * @return The targetTpu. + */ + boolean getTargetTpu(); + + /** + *
    +     * If true, TFRT will use GPU specific compiler passes and perform GPU
    +     * specific initialization.
    +     * 
    + * + * bool target_gpu = 30; + * @return The targetGpu. + */ + boolean getTargetGpu(); + + /** + *
    +     * The threshold to merge small streams in TFRT. The stream with cost
    +     * smaller than the threshold will be merged. Setting it to value 1
    +     * disables all merges.
    +     * 
    + * + * int32 stream_merge_threshold = 31; + * @return The streamMergeThreshold. + */ + int getStreamMergeThreshold(); + + /** + *
    +     * Whether functional control flow op lowering should be disabled. This is
    +     * useful when executing within a portable runtime where control flow op
    +     * kernels may not be loaded due to selective registration.
    +     * 
    + * + * bool disable_functional_ops_lowering = 21; + * @return The disableFunctionalOpsLowering. + */ + boolean getDisableFunctionalOpsLowering(); + + /** + *
    +     * Provides a hint to XLA auto clustering to prefer forming a single large
    +     * cluster that encompasses most of the graph.
    +     * 
    + * + * bool xla_prefer_single_graph_cluster = 22; + * @return The xlaPreferSingleGraphCluster. + */ + boolean getXlaPreferSingleGraphCluster(); + + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return Whether the coordinationConfig field is set. + */ + boolean hasCoordinationConfig(); + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return The coordinationConfig. + */ + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig getCoordinationConfig(); + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder getCoordinationConfigOrBuilder(); + + /** + *
    +     * If true, the session will treat the graph as being non-static for
    +     * optimization purposes.
    +     *
    +     * If this option is set to true when a session is created, the full
    +     * GraphDef will be retained to enable calls to Session::Extend().
    +     * Calling Extend() without setting this flag will result in errors.
    +     *
    +     * This option is meant to replace `optimize_for_static_graph` and it
    +     * aims to negate its value.
    +     * 
    + * + * bool disable_optimize_for_static_graph = 24; + * @return The disableOptimizeForStaticGraph. + */ + boolean getDisableOptimizeForStaticGraph(); + + /** + *
    +     * Whether eager remote execution will stream all the function calls or
    +     * allow them to happen in parallel. When true, streaming execution is
    +     * disabled, and parallel execution is allowed.
    +     * 
    + * + * bool disable_eager_executor_streaming_enqueue = 26; + * @return The disableEagerExecutorStreamingEnqueue. + */ + boolean getDisableEagerExecutorStreamingEnqueue(); + + /** + *
    +     * If true, the function library runtime will be finalized when the session
    +     * is finalized.
    +     * 
    + * + * bool finalize_function_library_runtime = 33; + * @return The finalizeFunctionLibraryRuntime. + */ + boolean getFinalizeFunctionLibraryRuntime(); + + /** + *
    +     * If true, the resource manager will be finalized when the session
    +     * is finalized.
    +     * 
    + * + * bool finalize_resource_manager = 34; + * @return The finalizeResourceManager. + */ + boolean getFinalizeResourceManager(); + } + /** + *
    +   * Everything inside Experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * Protobuf type {@code tensorflow.ConfigProto.Experimental} + */ + public static final class Experimental extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ConfigProto.Experimental) + ExperimentalOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Experimental.class.getName()); + } + // Use Experimental.newBuilder() to construct. + private Experimental(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Experimental() { + collectiveGroupLeader_ = ""; + executorType_ = ""; + mlirBridgeRollout_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ConfigProto.Experimental.class, org.tensorflow.proto.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), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MlirBridgeRollout.class.getName()); + } + /** + *
    +       * 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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MlirBridgeRollout valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire 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() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.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) + } + + private int bitField0_; + public static final int COLLECTIVE_GROUP_LEADER_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object collectiveGroupLeader_ = ""; + /** + *
    +     * Task name for group resolution.
    +     * 
    + * + * string collective_group_leader = 1; + * @return The collectiveGroupLeader. + */ + @java.lang.Override + public java.lang.String getCollectiveGroupLeader() { + java.lang.Object ref = collectiveGroupLeader_; + 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(); + collectiveGroupLeader_ = s; + return s; + } + } + /** + *
    +     * Task name for group resolution.
    +     * 
    + * + * string collective_group_leader = 1; + * @return The bytes for collectiveGroupLeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCollectiveGroupLeaderBytes() { + java.lang.Object ref = collectiveGroupLeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + collectiveGroupLeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXECUTOR_TYPE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object executorType_ = ""; + /** + *
    +     * Which executor to use, the default executor will be used
    +     * if it is an empty string or "DEFAULT"
    +     * 
    + * + * string executor_type = 3; + * @return The executorType. + */ + @java.lang.Override + public java.lang.String getExecutorType() { + java.lang.Object ref = executorType_; + 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(); + executorType_ = s; + return s; + } + } + /** + *
    +     * Which executor to use, the default executor will be used
    +     * if it is an empty string or "DEFAULT"
    +     * 
    + * + * string executor_type = 3; + * @return The bytes for executorType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getExecutorTypeBytes() { + java.lang.Object ref = executorType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + executorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECV_BUF_MAX_CHUNK_FIELD_NUMBER = 4; + private int recvBufMaxChunk_ = 0; + /** + *
    +     * Guidance to formatting of large RecvBuf fields for transfer.
    +     * Any positive value sets the max chunk size.  0 defaults to 4096.
    +     * Any negative value indicates no max, i.e. one chunk only.
    +     * 
    + * + * int32 recv_buf_max_chunk = 4; + * @return The recvBufMaxChunk. + */ + @java.lang.Override + public int getRecvBufMaxChunk() { + return recvBufMaxChunk_; + } + + public static final int USE_NUMA_AFFINITY_FIELD_NUMBER = 5; + private boolean useNumaAffinity_ = false; + /** + *
    +     * If true, and supported by the platform, the runtime will attempt to
    +     * use NUMA affinity where applicable.  One consequence will be the
    +     * existence of as many CPU devices as there are available NUMA nodes.
    +     * 
    + * + * bool use_numa_affinity = 5; + * @return The useNumaAffinity. + */ + @java.lang.Override + public boolean getUseNumaAffinity() { + return useNumaAffinity_; + } + + public static final int COLLECTIVE_DETERMINISTIC_SEQUENTIAL_EXECUTION_FIELD_NUMBER = 6; + private boolean collectiveDeterministicSequentialExecution_ = false; + /** + *
    +     * If true, make collective op execution order sequential and deterministic
    +     * for potentially concurrent collective instances.
    +     * 
    + * + * bool collective_deterministic_sequential_execution = 6; + * @return The collectiveDeterministicSequentialExecution. + */ + @java.lang.Override + public boolean getCollectiveDeterministicSequentialExecution() { + return collectiveDeterministicSequentialExecution_; + } + + public static final int COLLECTIVE_NCCL_FIELD_NUMBER = 7; + private boolean collectiveNccl_ = false; + /** + *
    +     * If true, use NCCL for CollectiveOps.  This feature is highly
    +     * experimental.
    +     * 
    + * + * bool collective_nccl = 7; + * @return The collectiveNccl. + */ + @java.lang.Override + public boolean getCollectiveNccl() { + return collectiveNccl_; + } + + public static final int SHARE_SESSION_STATE_IN_CLUSTERSPEC_PROPAGATION_FIELD_NUMBER = 8; + private boolean shareSessionStateInClusterspecPropagation_ = false; + /** + *
    +     * In the following, session state means the value of a variable, elements
    +     * in a hash table, or any other resource, accessible by worker sessions
    +     * held by a TF server.
    +     *
    +     * When ClusterSpec propagation is enabled, the value of
    +     * isolate_session_state is ignored when deciding whether to share session
    +     * states in a TF server (for backwards compatibility reasons).
    +     * - If share_session_state_in_clusterspec_propagation is true, the session
    +     * states are shared.
    +     * - If share_session_state_in_clusterspec_propagation is false, session
    +     * states are isolated.
    +     *
    +     * When clusterspec propagation is not used, the value of
    +     * share_session_state_in_clusterspec_propagation is ignored when deciding
    +     * whether to share session states in a TF server.
    +     * - If isolate_session_state is true, session states are isolated.
    +     * - If isolate_session_state is false, session states are shared.
    +     *
    +     * TODO(b/129330037): Add a single API that consistently treats
    +     * isolate_session_state and ClusterSpec propagation.
    +     * 
    + * + * bool share_session_state_in_clusterspec_propagation = 8; + * @return The shareSessionStateInClusterspecPropagation. + */ + @java.lang.Override + public boolean getShareSessionStateInClusterspecPropagation() { + return shareSessionStateInClusterspecPropagation_; + } + + public static final int DISABLE_THREAD_SPINNING_FIELD_NUMBER = 9; + private boolean disableThreadSpinning_ = false; + /** + *
    +     * If using a direct session, disable spinning while waiting for work in
    +     * the thread pool. This may result in higher latency for completing ops,
    +     * but in the case where there is a lot of spinning may result in lower
    +     * CPU usage.
    +     * 
    + * + * bool disable_thread_spinning = 9; + * @return The disableThreadSpinning. + */ + @java.lang.Override + public boolean getDisableThreadSpinning() { + return disableThreadSpinning_; + } + + public static final int SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER = 10; + private boolean shareClusterDevicesInSession_ = false; + /** + *
    +     * This was promoted to a non-experimental API. Please use
    +     * ConfigProto.share_cluster_devices_in_session instead.
    +     * 
    + * + * bool share_cluster_devices_in_session = 10; + * @return The shareClusterDevicesInSession. + */ + @java.lang.Override + public boolean getShareClusterDevicesInSession() { + return shareClusterDevicesInSession_; + } + + public static final int SESSION_METADATA_FIELD_NUMBER = 11; + private org.tensorflow.proto.SessionMetadata sessionMetadata_; + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return Whether the sessionMetadata field is set. + */ + @java.lang.Override + public boolean hasSessionMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return The sessionMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.SessionMetadata getSessionMetadata() { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + /** + *
    +     * Metadata about the session.
    +     *
    +     * If set, this can be used by the runtime and the Ops for debugging,
    +     * monitoring, etc.
    +     *
    +     * NOTE: This is currently used and propagated only by the direct session
    +     * and EagerContext.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + @java.lang.Override + public org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + + public static final int OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER = 12; + private boolean optimizeForStaticGraph_ = false; + /** + *
    +     * If true, the session may treat the graph as being static for optimization
    +     * purposes.
    +     *
    +     * If this option is set to true when a session is created, the full
    +     * GraphDef must be passed in a single call to Session::Create(), and
    +     * Session::Extend() may not be supported.
    +     * 
    + * + * bool optimize_for_static_graph = 12; + * @return The optimizeForStaticGraph. + */ + @java.lang.Override + public boolean getOptimizeForStaticGraph() { + return optimizeForStaticGraph_; + } + + public static final int ENABLE_MLIR_BRIDGE_FIELD_NUMBER = 13; + private boolean enableMlirBridge_ = false; + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
    +     * to true. Default value or false is ignored. Use mlir_bridge_rollout for
    +     * finer control.
    +     *
    +     * If this option is set to true when a session is created, MLIR is used to
    +     * perform the set of graph transformations to put the graph in a form that
    +     * can be executed with delegation of some computations to an accelerator.
    +     * This builds on the model of XLA where a subset of the graph is
    +     * encapsulated and attached to a "compile" operation, whose result is fed
    +     * to an "execute" operation. The kernel for these operations is responsible
    +     * to lower the encapsulated graph to a particular device.
    +     * 
    + * + * bool enable_mlir_bridge = 13; + * @return The enableMlirBridge. + */ + @java.lang.Override + public boolean getEnableMlirBridge() { + return enableMlirBridge_; + } + + public static final int MLIR_BRIDGE_ROLLOUT_FIELD_NUMBER = 17; + private int mlirBridgeRollout_ = 0; + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge.
    +     * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The enum numeric value on the wire for mlirBridgeRollout. + */ + @java.lang.Override public int getMlirBridgeRolloutValue() { + return mlirBridgeRollout_; + } + /** + *
    +     * Whether to enable the MLIR-based TF->XLA bridge.
    +     * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The mlirBridgeRollout. + */ + @java.lang.Override public org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout() { + org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout result = org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.forNumber(mlirBridgeRollout_); + return result == null ? org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.UNRECOGNIZED : result; + } + + public static final int ENABLE_MLIR_GRAPH_OPTIMIZATION_FIELD_NUMBER = 16; + private boolean enableMlirGraphOptimization_ = false; + /** + *
    +     * Whether to enable the MLIR-based Graph optimizations.
    +     *
    +     * This will become a part of standard Tensorflow graph optimization
    +     * pipeline, currently this is only used for gradual migration and testing
    +     * new passes that are replacing existing optimizations in Grappler.
    +     * 
    + * + * bool enable_mlir_graph_optimization = 16; + * @return The enableMlirGraphOptimization. + */ + @java.lang.Override + public boolean getEnableMlirGraphOptimization() { + return enableMlirGraphOptimization_; + } + + public static final int DISABLE_OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER = 14; + private boolean disableOutputPartitionGraphs_ = false; + /** + *
    +     * If true, the session will not store an additional copy of the graph for
    +     * each subgraph.
    +     *
    +     * If this option is set to true when a session is created, the
    +     * `RunOptions.output_partition_graphs` options must not be set.
    +     * 
    + * + * bool disable_output_partition_graphs = 14; + * @return The disableOutputPartitionGraphs. + */ + @java.lang.Override + public boolean getDisableOutputPartitionGraphs() { + return disableOutputPartitionGraphs_; + } + + public static final int XLA_FUSION_AUTOTUNER_THRESH_FIELD_NUMBER = 15; + private long xlaFusionAutotunerThresh_ = 0L; + /** + *
    +     * Minimum number of batches run through the XLA graph before XLA fusion
    +     * autotuner is enabled. Default value of zero disables the autotuner.
    +     *
    +     * The XLA fusion autotuner can improve performance by executing a heuristic
    +     * search on the compiler parameters.
    +     * 
    + * + * int64 xla_fusion_autotuner_thresh = 15; + * @return The xlaFusionAutotunerThresh. + */ + @java.lang.Override + public long getXlaFusionAutotunerThresh() { + return xlaFusionAutotunerThresh_; + } + + public static final int USE_TFRT_FIELD_NUMBER = 18; + private boolean useTfrt_ = false; + /** + *
    +     * Whether runtime execution uses TFRT.
    +     * 
    + * + * bool use_tfrt = 18; + * @return The useTfrt. + */ + @java.lang.Override + public boolean getUseTfrt() { + return useTfrt_; + } + + public static final int ENABLE_MULTI_HOST_FIELD_NUMBER = 27; + private boolean enableMultiHost_ = false; + /** + *
    +     * If true, use Pathways with TFRT API for multi host support.
    +     * 
    + * + * bool enable_multi_host = 27; + * @return The enableMultiHost. + */ + @java.lang.Override + public boolean getEnableMultiHost() { + return enableMultiHost_; + } + + public static final int TFRT_USE_IFRT_FIELD_NUMBER = 32; + private boolean tfrtUseIfrt_ = false; + /** + *
    +     * If true, use ifrt as the backend for TFRT. This is only used when
    +     * `use_tfrt` is true.
    +     * 
    + * + * bool tfrt_use_ifrt = 32; + * @return The tfrtUseIfrt. + */ + @java.lang.Override + public boolean getTfrtUseIfrt() { + return tfrtUseIfrt_; + } + + public static final int BACKEND_SERVER_PORT_FIELD_NUMBER = 28; + private int backendServerPort_ = 0; + /** + *
    +     * Port for the Pathways server. Ignored if enable_multi_host=false.
    +     * 
    + * + * int32 backend_server_port = 28; + * @return The backendServerPort. + */ + @java.lang.Override + public int getBackendServerPort() { + return backendServerPort_; + } + + public static final int TARGET_TPU_FIELD_NUMBER = 29; + private boolean targetTpu_ = false; + /** + *
    +     * If true, TFRT will use TPU specific compiler passes and perform TPU
    +     * specific initialization.
    +     * 
    + * + * bool target_tpu = 29; + * @return The targetTpu. + */ + @java.lang.Override + public boolean getTargetTpu() { + return targetTpu_; + } + + public static final int TARGET_GPU_FIELD_NUMBER = 30; + private boolean targetGpu_ = false; + /** + *
    +     * If true, TFRT will use GPU specific compiler passes and perform GPU
    +     * specific initialization.
    +     * 
    + * + * bool target_gpu = 30; + * @return The targetGpu. + */ + @java.lang.Override + public boolean getTargetGpu() { + return targetGpu_; + } + + public static final int STREAM_MERGE_THRESHOLD_FIELD_NUMBER = 31; + private int streamMergeThreshold_ = 0; + /** + *
    +     * The threshold to merge small streams in TFRT. The stream with cost
    +     * smaller than the threshold will be merged. Setting it to value 1
    +     * disables all merges.
    +     * 
    + * + * int32 stream_merge_threshold = 31; + * @return The streamMergeThreshold. + */ + @java.lang.Override + public int getStreamMergeThreshold() { + return streamMergeThreshold_; + } + + public static final int DISABLE_FUNCTIONAL_OPS_LOWERING_FIELD_NUMBER = 21; + private boolean disableFunctionalOpsLowering_ = false; + /** + *
    +     * Whether functional control flow op lowering should be disabled. This is
    +     * useful when executing within a portable runtime where control flow op
    +     * kernels may not be loaded due to selective registration.
    +     * 
    + * + * bool disable_functional_ops_lowering = 21; + * @return The disableFunctionalOpsLowering. + */ + @java.lang.Override + public boolean getDisableFunctionalOpsLowering() { + return disableFunctionalOpsLowering_; + } + + public static final int XLA_PREFER_SINGLE_GRAPH_CLUSTER_FIELD_NUMBER = 22; + private boolean xlaPreferSingleGraphCluster_ = false; + /** + *
    +     * Provides a hint to XLA auto clustering to prefer forming a single large
    +     * cluster that encompasses most of the graph.
    +     * 
    + * + * bool xla_prefer_single_graph_cluster = 22; + * @return The xlaPreferSingleGraphCluster. + */ + @java.lang.Override + public boolean getXlaPreferSingleGraphCluster() { + return xlaPreferSingleGraphCluster_; + } + + public static final int COORDINATION_CONFIG_FIELD_NUMBER = 23; + private org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig coordinationConfig_; + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return Whether the coordinationConfig field is set. + */ + @java.lang.Override + public boolean hasCoordinationConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return The coordinationConfig. + */ + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig getCoordinationConfig() { + return coordinationConfig_ == null ? org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance() : coordinationConfig_; + } + /** + *
    +     * Distributed coordination service configurations.
    +     * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder getCoordinationConfigOrBuilder() { + return coordinationConfig_ == null ? org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance() : coordinationConfig_; + } + + public static final int DISABLE_OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER = 24; + private boolean disableOptimizeForStaticGraph_ = false; + /** + *
    +     * If true, the session will treat the graph as being non-static for
    +     * optimization purposes.
    +     *
    +     * If this option is set to true when a session is created, the full
    +     * GraphDef will be retained to enable calls to Session::Extend().
    +     * Calling Extend() without setting this flag will result in errors.
    +     *
    +     * This option is meant to replace `optimize_for_static_graph` and it
    +     * aims to negate its value.
    +     * 
    + * + * bool disable_optimize_for_static_graph = 24; + * @return The disableOptimizeForStaticGraph. + */ + @java.lang.Override + public boolean getDisableOptimizeForStaticGraph() { + return disableOptimizeForStaticGraph_; + } + + public static final int DISABLE_EAGER_EXECUTOR_STREAMING_ENQUEUE_FIELD_NUMBER = 26; + private boolean disableEagerExecutorStreamingEnqueue_ = false; + /** + *
    +     * Whether eager remote execution will stream all the function calls or
    +     * allow them to happen in parallel. When true, streaming execution is
    +     * disabled, and parallel execution is allowed.
    +     * 
    + * + * bool disable_eager_executor_streaming_enqueue = 26; + * @return The disableEagerExecutorStreamingEnqueue. + */ + @java.lang.Override + public boolean getDisableEagerExecutorStreamingEnqueue() { + return disableEagerExecutorStreamingEnqueue_; + } + + public static final int FINALIZE_FUNCTION_LIBRARY_RUNTIME_FIELD_NUMBER = 33; + private boolean finalizeFunctionLibraryRuntime_ = false; + /** + *
    +     * If true, the function library runtime will be finalized when the session
    +     * is finalized.
    +     * 
    + * + * bool finalize_function_library_runtime = 33; + * @return The finalizeFunctionLibraryRuntime. + */ + @java.lang.Override + public boolean getFinalizeFunctionLibraryRuntime() { + return finalizeFunctionLibraryRuntime_; + } + + public static final int FINALIZE_RESOURCE_MANAGER_FIELD_NUMBER = 34; + private boolean finalizeResourceManager_ = false; + /** + *
    +     * If true, the resource manager will be finalized when the session
    +     * is finalized.
    +     * 
    + * + * bool finalize_resource_manager = 34; + * @return The finalizeResourceManager. + */ + @java.lang.Override + public boolean getFinalizeResourceManager() { + return finalizeResourceManager_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(collectiveGroupLeader_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, collectiveGroupLeader_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(executorType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, executorType_); + } + if (recvBufMaxChunk_ != 0) { + output.writeInt32(4, recvBufMaxChunk_); + } + if (useNumaAffinity_ != false) { + output.writeBool(5, useNumaAffinity_); + } + if (collectiveDeterministicSequentialExecution_ != false) { + output.writeBool(6, collectiveDeterministicSequentialExecution_); + } + if (collectiveNccl_ != false) { + output.writeBool(7, collectiveNccl_); + } + if (shareSessionStateInClusterspecPropagation_ != false) { + output.writeBool(8, shareSessionStateInClusterspecPropagation_); + } + if (disableThreadSpinning_ != false) { + output.writeBool(9, disableThreadSpinning_); + } + if (shareClusterDevicesInSession_ != false) { + output.writeBool(10, shareClusterDevicesInSession_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(11, getSessionMetadata()); + } + if (optimizeForStaticGraph_ != false) { + output.writeBool(12, optimizeForStaticGraph_); + } + if (enableMlirBridge_ != false) { + output.writeBool(13, enableMlirBridge_); + } + if (disableOutputPartitionGraphs_ != false) { + output.writeBool(14, disableOutputPartitionGraphs_); + } + if (xlaFusionAutotunerThresh_ != 0L) { + output.writeInt64(15, xlaFusionAutotunerThresh_); + } + if (enableMlirGraphOptimization_ != false) { + output.writeBool(16, enableMlirGraphOptimization_); + } + if (mlirBridgeRollout_ != org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.MLIR_BRIDGE_ROLLOUT_UNSPECIFIED.getNumber()) { + output.writeEnum(17, mlirBridgeRollout_); + } + if (useTfrt_ != false) { + output.writeBool(18, useTfrt_); + } + if (disableFunctionalOpsLowering_ != false) { + output.writeBool(21, disableFunctionalOpsLowering_); + } + if (xlaPreferSingleGraphCluster_ != false) { + output.writeBool(22, xlaPreferSingleGraphCluster_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(23, getCoordinationConfig()); + } + if (disableOptimizeForStaticGraph_ != false) { + output.writeBool(24, disableOptimizeForStaticGraph_); + } + if (disableEagerExecutorStreamingEnqueue_ != false) { + output.writeBool(26, disableEagerExecutorStreamingEnqueue_); + } + if (enableMultiHost_ != false) { + output.writeBool(27, enableMultiHost_); + } + if (backendServerPort_ != 0) { + output.writeInt32(28, backendServerPort_); + } + if (targetTpu_ != false) { + output.writeBool(29, targetTpu_); + } + if (targetGpu_ != false) { + output.writeBool(30, targetGpu_); + } + if (streamMergeThreshold_ != 0) { + output.writeInt32(31, streamMergeThreshold_); + } + if (tfrtUseIfrt_ != false) { + output.writeBool(32, tfrtUseIfrt_); + } + if (finalizeFunctionLibraryRuntime_ != false) { + output.writeBool(33, finalizeFunctionLibraryRuntime_); + } + if (finalizeResourceManager_ != false) { + output.writeBool(34, finalizeResourceManager_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collectiveGroupLeader_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, collectiveGroupLeader_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(executorType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, executorType_); + } + if (recvBufMaxChunk_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, recvBufMaxChunk_); + } + if (useNumaAffinity_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, useNumaAffinity_); + } + if (collectiveDeterministicSequentialExecution_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, collectiveDeterministicSequentialExecution_); + } + if (collectiveNccl_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, collectiveNccl_); + } + if (shareSessionStateInClusterspecPropagation_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, shareSessionStateInClusterspecPropagation_); + } + if (disableThreadSpinning_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, disableThreadSpinning_); + } + if (shareClusterDevicesInSession_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(10, shareClusterDevicesInSession_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getSessionMetadata()); + } + if (optimizeForStaticGraph_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, optimizeForStaticGraph_); + } + if (enableMlirBridge_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, enableMlirBridge_); + } + if (disableOutputPartitionGraphs_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, disableOutputPartitionGraphs_); + } + if (xlaFusionAutotunerThresh_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(15, xlaFusionAutotunerThresh_); + } + if (enableMlirGraphOptimization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, enableMlirGraphOptimization_); + } + if (mlirBridgeRollout_ != org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.MLIR_BRIDGE_ROLLOUT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(17, mlirBridgeRollout_); + } + if (useTfrt_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(18, useTfrt_); + } + if (disableFunctionalOpsLowering_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, disableFunctionalOpsLowering_); + } + if (xlaPreferSingleGraphCluster_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(22, xlaPreferSingleGraphCluster_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getCoordinationConfig()); + } + if (disableOptimizeForStaticGraph_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(24, disableOptimizeForStaticGraph_); + } + if (disableEagerExecutorStreamingEnqueue_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(26, disableEagerExecutorStreamingEnqueue_); + } + if (enableMultiHost_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(27, enableMultiHost_); + } + if (backendServerPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(28, backendServerPort_); + } + if (targetTpu_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(29, targetTpu_); + } + if (targetGpu_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(30, targetGpu_); + } + if (streamMergeThreshold_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(31, streamMergeThreshold_); + } + if (tfrtUseIfrt_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(32, tfrtUseIfrt_); + } + if (finalizeFunctionLibraryRuntime_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(33, finalizeFunctionLibraryRuntime_); + } + if (finalizeResourceManager_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(34, finalizeResourceManager_); + } + size += getUnknownFields().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.ConfigProto.Experimental)) { + return super.equals(obj); + } + org.tensorflow.proto.ConfigProto.Experimental other = (org.tensorflow.proto.ConfigProto.Experimental) obj; + + if (!getCollectiveGroupLeader() + .equals(other.getCollectiveGroupLeader())) return false; + if (!getExecutorType() + .equals(other.getExecutorType())) return false; + if (getRecvBufMaxChunk() + != other.getRecvBufMaxChunk()) return false; + if (getUseNumaAffinity() + != other.getUseNumaAffinity()) return false; + if (getCollectiveDeterministicSequentialExecution() + != other.getCollectiveDeterministicSequentialExecution()) return false; + if (getCollectiveNccl() + != other.getCollectiveNccl()) return false; + if (getShareSessionStateInClusterspecPropagation() + != other.getShareSessionStateInClusterspecPropagation()) return false; + if (getDisableThreadSpinning() + != other.getDisableThreadSpinning()) return false; + if (getShareClusterDevicesInSession() + != other.getShareClusterDevicesInSession()) return false; + if (hasSessionMetadata() != other.hasSessionMetadata()) return false; + if (hasSessionMetadata()) { + if (!getSessionMetadata() + .equals(other.getSessionMetadata())) return false; + } + if (getOptimizeForStaticGraph() + != other.getOptimizeForStaticGraph()) return false; + if (getEnableMlirBridge() + != other.getEnableMlirBridge()) return false; + if (mlirBridgeRollout_ != other.mlirBridgeRollout_) return false; + if (getEnableMlirGraphOptimization() + != other.getEnableMlirGraphOptimization()) return false; + if (getDisableOutputPartitionGraphs() + != other.getDisableOutputPartitionGraphs()) return false; + if (getXlaFusionAutotunerThresh() + != other.getXlaFusionAutotunerThresh()) return false; + if (getUseTfrt() + != other.getUseTfrt()) return false; + if (getEnableMultiHost() + != other.getEnableMultiHost()) return false; + if (getTfrtUseIfrt() + != other.getTfrtUseIfrt()) return false; + if (getBackendServerPort() + != other.getBackendServerPort()) return false; + if (getTargetTpu() + != other.getTargetTpu()) return false; + if (getTargetGpu() + != other.getTargetGpu()) return false; + if (getStreamMergeThreshold() + != other.getStreamMergeThreshold()) return false; + if (getDisableFunctionalOpsLowering() + != other.getDisableFunctionalOpsLowering()) return false; + if (getXlaPreferSingleGraphCluster() + != other.getXlaPreferSingleGraphCluster()) return false; + if (hasCoordinationConfig() != other.hasCoordinationConfig()) return false; + if (hasCoordinationConfig()) { + if (!getCoordinationConfig() + .equals(other.getCoordinationConfig())) return false; + } + if (getDisableOptimizeForStaticGraph() + != other.getDisableOptimizeForStaticGraph()) return false; + if (getDisableEagerExecutorStreamingEnqueue() + != other.getDisableEagerExecutorStreamingEnqueue()) return false; + if (getFinalizeFunctionLibraryRuntime() + != other.getFinalizeFunctionLibraryRuntime()) return false; + if (getFinalizeResourceManager() + != other.getFinalizeResourceManager()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + COLLECTIVE_GROUP_LEADER_FIELD_NUMBER; + hash = (53 * hash) + getCollectiveGroupLeader().hashCode(); + hash = (37 * hash) + EXECUTOR_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getExecutorType().hashCode(); + hash = (37 * hash) + RECV_BUF_MAX_CHUNK_FIELD_NUMBER; + hash = (53 * hash) + getRecvBufMaxChunk(); + hash = (37 * hash) + USE_NUMA_AFFINITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseNumaAffinity()); + hash = (37 * hash) + COLLECTIVE_DETERMINISTIC_SEQUENTIAL_EXECUTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCollectiveDeterministicSequentialExecution()); + hash = (37 * hash) + COLLECTIVE_NCCL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCollectiveNccl()); + hash = (37 * hash) + SHARE_SESSION_STATE_IN_CLUSTERSPEC_PROPAGATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getShareSessionStateInClusterspecPropagation()); + hash = (37 * hash) + DISABLE_THREAD_SPINNING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableThreadSpinning()); + hash = (37 * hash) + SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getShareClusterDevicesInSession()); + if (hasSessionMetadata()) { + hash = (37 * hash) + SESSION_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getSessionMetadata().hashCode(); + } + hash = (37 * hash) + OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getOptimizeForStaticGraph()); + 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()); + hash = (37 * hash) + DISABLE_OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableOutputPartitionGraphs()); + hash = (37 * hash) + XLA_FUSION_AUTOTUNER_THRESH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getXlaFusionAutotunerThresh()); + hash = (37 * hash) + USE_TFRT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseTfrt()); + hash = (37 * hash) + ENABLE_MULTI_HOST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableMultiHost()); + hash = (37 * hash) + TFRT_USE_IFRT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTfrtUseIfrt()); + hash = (37 * hash) + BACKEND_SERVER_PORT_FIELD_NUMBER; + hash = (53 * hash) + getBackendServerPort(); + hash = (37 * hash) + TARGET_TPU_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTargetTpu()); + hash = (37 * hash) + TARGET_GPU_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTargetGpu()); + hash = (37 * hash) + STREAM_MERGE_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + getStreamMergeThreshold(); + hash = (37 * hash) + DISABLE_FUNCTIONAL_OPS_LOWERING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableFunctionalOpsLowering()); + hash = (37 * hash) + XLA_PREFER_SINGLE_GRAPH_CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getXlaPreferSingleGraphCluster()); + if (hasCoordinationConfig()) { + hash = (37 * hash) + COORDINATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getCoordinationConfig().hashCode(); + } + hash = (37 * hash) + DISABLE_OPTIMIZE_FOR_STATIC_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableOptimizeForStaticGraph()); + hash = (37 * hash) + DISABLE_EAGER_EXECUTOR_STREAMING_ENQUEUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableEagerExecutorStreamingEnqueue()); + hash = (37 * hash) + FINALIZE_FUNCTION_LIBRARY_RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinalizeFunctionLibraryRuntime()); + hash = (37 * hash) + FINALIZE_RESOURCE_MANAGER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinalizeResourceManager()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto.Experimental 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.ConfigProto.Experimental parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto.Experimental 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.ConfigProto.Experimental parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ConfigProto.Experimental parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ConfigProto.Experimental parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ConfigProto.Experimental parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ConfigProto.Experimental 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Everything inside Experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * Protobuf type {@code tensorflow.ConfigProto.Experimental} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ConfigProto.Experimental) + org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ConfigProto.Experimental.class, org.tensorflow.proto.ConfigProto.Experimental.Builder.class); + } + + // Construct using org.tensorflow.proto.ConfigProto.Experimental.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSessionMetadataFieldBuilder(); + getCoordinationConfigFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + collectiveGroupLeader_ = ""; + executorType_ = ""; + recvBufMaxChunk_ = 0; + useNumaAffinity_ = false; + collectiveDeterministicSequentialExecution_ = false; + collectiveNccl_ = false; + shareSessionStateInClusterspecPropagation_ = false; + disableThreadSpinning_ = false; + shareClusterDevicesInSession_ = false; + sessionMetadata_ = null; + if (sessionMetadataBuilder_ != null) { + sessionMetadataBuilder_.dispose(); + sessionMetadataBuilder_ = null; + } + optimizeForStaticGraph_ = false; + enableMlirBridge_ = false; + mlirBridgeRollout_ = 0; + enableMlirGraphOptimization_ = false; + disableOutputPartitionGraphs_ = false; + xlaFusionAutotunerThresh_ = 0L; + useTfrt_ = false; + enableMultiHost_ = false; + tfrtUseIfrt_ = false; + backendServerPort_ = 0; + targetTpu_ = false; + targetGpu_ = false; + streamMergeThreshold_ = 0; + disableFunctionalOpsLowering_ = false; + xlaPreferSingleGraphCluster_ = false; + coordinationConfig_ = null; + if (coordinationConfigBuilder_ != null) { + coordinationConfigBuilder_.dispose(); + coordinationConfigBuilder_ = null; + } + disableOptimizeForStaticGraph_ = false; + disableEagerExecutorStreamingEnqueue_ = false; + finalizeFunctionLibraryRuntime_ = false; + finalizeResourceManager_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_Experimental_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto.Experimental getDefaultInstanceForType() { + return org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto.Experimental build() { + org.tensorflow.proto.ConfigProto.Experimental result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto.Experimental buildPartial() { + org.tensorflow.proto.ConfigProto.Experimental result = new org.tensorflow.proto.ConfigProto.Experimental(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ConfigProto.Experimental result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.collectiveGroupLeader_ = collectiveGroupLeader_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.executorType_ = executorType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.recvBufMaxChunk_ = recvBufMaxChunk_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.useNumaAffinity_ = useNumaAffinity_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.collectiveDeterministicSequentialExecution_ = collectiveDeterministicSequentialExecution_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.collectiveNccl_ = collectiveNccl_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.shareSessionStateInClusterspecPropagation_ = shareSessionStateInClusterspecPropagation_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.disableThreadSpinning_ = disableThreadSpinning_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.shareClusterDevicesInSession_ = shareClusterDevicesInSession_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sessionMetadata_ = sessionMetadataBuilder_ == null + ? sessionMetadata_ + : sessionMetadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.optimizeForStaticGraph_ = optimizeForStaticGraph_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.enableMlirBridge_ = enableMlirBridge_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.mlirBridgeRollout_ = mlirBridgeRollout_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.enableMlirGraphOptimization_ = enableMlirGraphOptimization_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.disableOutputPartitionGraphs_ = disableOutputPartitionGraphs_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.xlaFusionAutotunerThresh_ = xlaFusionAutotunerThresh_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.useTfrt_ = useTfrt_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.enableMultiHost_ = enableMultiHost_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.tfrtUseIfrt_ = tfrtUseIfrt_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.backendServerPort_ = backendServerPort_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.targetTpu_ = targetTpu_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.targetGpu_ = targetGpu_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.streamMergeThreshold_ = streamMergeThreshold_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.disableFunctionalOpsLowering_ = disableFunctionalOpsLowering_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.xlaPreferSingleGraphCluster_ = xlaPreferSingleGraphCluster_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.coordinationConfig_ = coordinationConfigBuilder_ == null + ? coordinationConfig_ + : coordinationConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.disableOptimizeForStaticGraph_ = disableOptimizeForStaticGraph_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.disableEagerExecutorStreamingEnqueue_ = disableEagerExecutorStreamingEnqueue_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.finalizeFunctionLibraryRuntime_ = finalizeFunctionLibraryRuntime_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.finalizeResourceManager_ = finalizeResourceManager_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ConfigProto.Experimental) { + return mergeFrom((org.tensorflow.proto.ConfigProto.Experimental)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ConfigProto.Experimental other) { + if (other == org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance()) return this; + if (!other.getCollectiveGroupLeader().isEmpty()) { + collectiveGroupLeader_ = other.collectiveGroupLeader_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getExecutorType().isEmpty()) { + executorType_ = other.executorType_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getRecvBufMaxChunk() != 0) { + setRecvBufMaxChunk(other.getRecvBufMaxChunk()); + } + if (other.getUseNumaAffinity() != false) { + setUseNumaAffinity(other.getUseNumaAffinity()); + } + if (other.getCollectiveDeterministicSequentialExecution() != false) { + setCollectiveDeterministicSequentialExecution(other.getCollectiveDeterministicSequentialExecution()); + } + if (other.getCollectiveNccl() != false) { + setCollectiveNccl(other.getCollectiveNccl()); + } + if (other.getShareSessionStateInClusterspecPropagation() != false) { + setShareSessionStateInClusterspecPropagation(other.getShareSessionStateInClusterspecPropagation()); + } + if (other.getDisableThreadSpinning() != false) { + setDisableThreadSpinning(other.getDisableThreadSpinning()); + } + if (other.getShareClusterDevicesInSession() != false) { + setShareClusterDevicesInSession(other.getShareClusterDevicesInSession()); + } + if (other.hasSessionMetadata()) { + mergeSessionMetadata(other.getSessionMetadata()); + } + if (other.getOptimizeForStaticGraph() != false) { + setOptimizeForStaticGraph(other.getOptimizeForStaticGraph()); + } + if (other.getEnableMlirBridge() != false) { + setEnableMlirBridge(other.getEnableMlirBridge()); + } + if (other.mlirBridgeRollout_ != 0) { + setMlirBridgeRolloutValue(other.getMlirBridgeRolloutValue()); + } + if (other.getEnableMlirGraphOptimization() != false) { + setEnableMlirGraphOptimization(other.getEnableMlirGraphOptimization()); + } + if (other.getDisableOutputPartitionGraphs() != false) { + setDisableOutputPartitionGraphs(other.getDisableOutputPartitionGraphs()); + } + if (other.getXlaFusionAutotunerThresh() != 0L) { + setXlaFusionAutotunerThresh(other.getXlaFusionAutotunerThresh()); + } + if (other.getUseTfrt() != false) { + setUseTfrt(other.getUseTfrt()); + } + if (other.getEnableMultiHost() != false) { + setEnableMultiHost(other.getEnableMultiHost()); + } + if (other.getTfrtUseIfrt() != false) { + setTfrtUseIfrt(other.getTfrtUseIfrt()); + } + if (other.getBackendServerPort() != 0) { + setBackendServerPort(other.getBackendServerPort()); + } + if (other.getTargetTpu() != false) { + setTargetTpu(other.getTargetTpu()); + } + if (other.getTargetGpu() != false) { + setTargetGpu(other.getTargetGpu()); + } + if (other.getStreamMergeThreshold() != 0) { + setStreamMergeThreshold(other.getStreamMergeThreshold()); + } + if (other.getDisableFunctionalOpsLowering() != false) { + setDisableFunctionalOpsLowering(other.getDisableFunctionalOpsLowering()); + } + if (other.getXlaPreferSingleGraphCluster() != false) { + setXlaPreferSingleGraphCluster(other.getXlaPreferSingleGraphCluster()); + } + if (other.hasCoordinationConfig()) { + mergeCoordinationConfig(other.getCoordinationConfig()); + } + if (other.getDisableOptimizeForStaticGraph() != false) { + setDisableOptimizeForStaticGraph(other.getDisableOptimizeForStaticGraph()); + } + if (other.getDisableEagerExecutorStreamingEnqueue() != false) { + setDisableEagerExecutorStreamingEnqueue(other.getDisableEagerExecutorStreamingEnqueue()); + } + if (other.getFinalizeFunctionLibraryRuntime() != false) { + setFinalizeFunctionLibraryRuntime(other.getFinalizeFunctionLibraryRuntime()); + } + if (other.getFinalizeResourceManager() != false) { + setFinalizeResourceManager(other.getFinalizeResourceManager()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + collectiveGroupLeader_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: { + executorType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: { + recvBufMaxChunk_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: { + useNumaAffinity_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 48: { + collectiveDeterministicSequentialExecution_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 48 + case 56: { + collectiveNccl_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: { + shareSessionStateInClusterspecPropagation_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 72: { + disableThreadSpinning_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 72 + case 80: { + shareClusterDevicesInSession_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 90: { + input.readMessage( + getSessionMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 90 + case 96: { + optimizeForStaticGraph_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 96 + case 104: { + enableMlirBridge_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 104 + case 112: { + disableOutputPartitionGraphs_ = input.readBool(); + bitField0_ |= 0x00004000; + break; + } // case 112 + case 120: { + xlaFusionAutotunerThresh_ = input.readInt64(); + bitField0_ |= 0x00008000; + break; + } // case 120 + case 128: { + enableMlirGraphOptimization_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 128 + case 136: { + mlirBridgeRollout_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 136 + case 144: { + useTfrt_ = input.readBool(); + bitField0_ |= 0x00010000; + break; + } // case 144 + case 168: { + disableFunctionalOpsLowering_ = input.readBool(); + bitField0_ |= 0x00800000; + break; + } // case 168 + case 176: { + xlaPreferSingleGraphCluster_ = input.readBool(); + bitField0_ |= 0x01000000; + break; + } // case 176 + case 186: { + input.readMessage( + getCoordinationConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x02000000; + break; + } // case 186 + case 192: { + disableOptimizeForStaticGraph_ = input.readBool(); + bitField0_ |= 0x04000000; + break; + } // case 192 + case 208: { + disableEagerExecutorStreamingEnqueue_ = input.readBool(); + bitField0_ |= 0x08000000; + break; + } // case 208 + case 216: { + enableMultiHost_ = input.readBool(); + bitField0_ |= 0x00020000; + break; + } // case 216 + case 224: { + backendServerPort_ = input.readInt32(); + bitField0_ |= 0x00080000; + break; + } // case 224 + case 232: { + targetTpu_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 232 + case 240: { + targetGpu_ = input.readBool(); + bitField0_ |= 0x00200000; + break; + } // case 240 + case 248: { + streamMergeThreshold_ = input.readInt32(); + bitField0_ |= 0x00400000; + break; + } // case 248 + case 256: { + tfrtUseIfrt_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 256 + case 264: { + finalizeFunctionLibraryRuntime_ = input.readBool(); + bitField0_ |= 0x10000000; + break; + } // case 264 + case 272: { + finalizeResourceManager_ = input.readBool(); + bitField0_ |= 0x20000000; + break; + } // case 272 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object collectiveGroupLeader_ = ""; + /** + *
    +       * Task name for group resolution.
    +       * 
    + * + * string collective_group_leader = 1; + * @return The collectiveGroupLeader. + */ + public java.lang.String getCollectiveGroupLeader() { + java.lang.Object ref = collectiveGroupLeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectiveGroupLeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Task name for group resolution.
    +       * 
    + * + * string collective_group_leader = 1; + * @return The bytes for collectiveGroupLeader. + */ + public com.google.protobuf.ByteString + getCollectiveGroupLeaderBytes() { + java.lang.Object ref = collectiveGroupLeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + collectiveGroupLeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Task name for group resolution.
    +       * 
    + * + * string collective_group_leader = 1; + * @param value The collectiveGroupLeader to set. + * @return This builder for chaining. + */ + public Builder setCollectiveGroupLeader( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + collectiveGroupLeader_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Task name for group resolution.
    +       * 
    + * + * string collective_group_leader = 1; + * @return This builder for chaining. + */ + public Builder clearCollectiveGroupLeader() { + collectiveGroupLeader_ = getDefaultInstance().getCollectiveGroupLeader(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Task name for group resolution.
    +       * 
    + * + * string collective_group_leader = 1; + * @param value The bytes for collectiveGroupLeader to set. + * @return This builder for chaining. + */ + public Builder setCollectiveGroupLeaderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + collectiveGroupLeader_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object executorType_ = ""; + /** + *
    +       * Which executor to use, the default executor will be used
    +       * if it is an empty string or "DEFAULT"
    +       * 
    + * + * string executor_type = 3; + * @return The executorType. + */ + public java.lang.String getExecutorType() { + java.lang.Object ref = executorType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + executorType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Which executor to use, the default executor will be used
    +       * if it is an empty string or "DEFAULT"
    +       * 
    + * + * string executor_type = 3; + * @return The bytes for executorType. + */ + public com.google.protobuf.ByteString + getExecutorTypeBytes() { + java.lang.Object ref = executorType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + executorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Which executor to use, the default executor will be used
    +       * if it is an empty string or "DEFAULT"
    +       * 
    + * + * string executor_type = 3; + * @param value The executorType to set. + * @return This builder for chaining. + */ + public Builder setExecutorType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + executorType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Which executor to use, the default executor will be used
    +       * if it is an empty string or "DEFAULT"
    +       * 
    + * + * string executor_type = 3; + * @return This builder for chaining. + */ + public Builder clearExecutorType() { + executorType_ = getDefaultInstance().getExecutorType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Which executor to use, the default executor will be used
    +       * if it is an empty string or "DEFAULT"
    +       * 
    + * + * string executor_type = 3; + * @param value The bytes for executorType to set. + * @return This builder for chaining. + */ + public Builder setExecutorTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + executorType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int recvBufMaxChunk_ ; + /** + *
    +       * Guidance to formatting of large RecvBuf fields for transfer.
    +       * Any positive value sets the max chunk size.  0 defaults to 4096.
    +       * Any negative value indicates no max, i.e. one chunk only.
    +       * 
    + * + * int32 recv_buf_max_chunk = 4; + * @return The recvBufMaxChunk. + */ + @java.lang.Override + public int getRecvBufMaxChunk() { + return recvBufMaxChunk_; + } + /** + *
    +       * Guidance to formatting of large RecvBuf fields for transfer.
    +       * Any positive value sets the max chunk size.  0 defaults to 4096.
    +       * Any negative value indicates no max, i.e. one chunk only.
    +       * 
    + * + * int32 recv_buf_max_chunk = 4; + * @param value The recvBufMaxChunk to set. + * @return This builder for chaining. + */ + public Builder setRecvBufMaxChunk(int value) { + + recvBufMaxChunk_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Guidance to formatting of large RecvBuf fields for transfer.
    +       * Any positive value sets the max chunk size.  0 defaults to 4096.
    +       * Any negative value indicates no max, i.e. one chunk only.
    +       * 
    + * + * int32 recv_buf_max_chunk = 4; + * @return This builder for chaining. + */ + public Builder clearRecvBufMaxChunk() { + bitField0_ = (bitField0_ & ~0x00000004); + recvBufMaxChunk_ = 0; + onChanged(); + return this; + } + + private boolean useNumaAffinity_ ; + /** + *
    +       * If true, and supported by the platform, the runtime will attempt to
    +       * use NUMA affinity where applicable.  One consequence will be the
    +       * existence of as many CPU devices as there are available NUMA nodes.
    +       * 
    + * + * bool use_numa_affinity = 5; + * @return The useNumaAffinity. + */ + @java.lang.Override + public boolean getUseNumaAffinity() { + return useNumaAffinity_; + } + /** + *
    +       * If true, and supported by the platform, the runtime will attempt to
    +       * use NUMA affinity where applicable.  One consequence will be the
    +       * existence of as many CPU devices as there are available NUMA nodes.
    +       * 
    + * + * bool use_numa_affinity = 5; + * @param value The useNumaAffinity to set. + * @return This builder for chaining. + */ + public Builder setUseNumaAffinity(boolean value) { + + useNumaAffinity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * If true, and supported by the platform, the runtime will attempt to
    +       * use NUMA affinity where applicable.  One consequence will be the
    +       * existence of as many CPU devices as there are available NUMA nodes.
    +       * 
    + * + * bool use_numa_affinity = 5; + * @return This builder for chaining. + */ + public Builder clearUseNumaAffinity() { + bitField0_ = (bitField0_ & ~0x00000008); + useNumaAffinity_ = false; + onChanged(); + return this; + } + + private boolean collectiveDeterministicSequentialExecution_ ; + /** + *
    +       * If true, make collective op execution order sequential and deterministic
    +       * for potentially concurrent collective instances.
    +       * 
    + * + * bool collective_deterministic_sequential_execution = 6; + * @return The collectiveDeterministicSequentialExecution. + */ + @java.lang.Override + public boolean getCollectiveDeterministicSequentialExecution() { + return collectiveDeterministicSequentialExecution_; + } + /** + *
    +       * If true, make collective op execution order sequential and deterministic
    +       * for potentially concurrent collective instances.
    +       * 
    + * + * bool collective_deterministic_sequential_execution = 6; + * @param value The collectiveDeterministicSequentialExecution to set. + * @return This builder for chaining. + */ + public Builder setCollectiveDeterministicSequentialExecution(boolean value) { + + collectiveDeterministicSequentialExecution_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * If true, make collective op execution order sequential and deterministic
    +       * for potentially concurrent collective instances.
    +       * 
    + * + * bool collective_deterministic_sequential_execution = 6; + * @return This builder for chaining. + */ + public Builder clearCollectiveDeterministicSequentialExecution() { + bitField0_ = (bitField0_ & ~0x00000010); + collectiveDeterministicSequentialExecution_ = false; + onChanged(); + return this; + } + + private boolean collectiveNccl_ ; + /** + *
    +       * If true, use NCCL for CollectiveOps.  This feature is highly
    +       * experimental.
    +       * 
    + * + * bool collective_nccl = 7; + * @return The collectiveNccl. + */ + @java.lang.Override + public boolean getCollectiveNccl() { + return collectiveNccl_; + } + /** + *
    +       * If true, use NCCL for CollectiveOps.  This feature is highly
    +       * experimental.
    +       * 
    + * + * bool collective_nccl = 7; + * @param value The collectiveNccl to set. + * @return This builder for chaining. + */ + public Builder setCollectiveNccl(boolean value) { + + collectiveNccl_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * If true, use NCCL for CollectiveOps.  This feature is highly
    +       * experimental.
    +       * 
    + * + * bool collective_nccl = 7; + * @return This builder for chaining. + */ + public Builder clearCollectiveNccl() { + bitField0_ = (bitField0_ & ~0x00000020); + collectiveNccl_ = false; + onChanged(); + return this; + } + + private boolean shareSessionStateInClusterspecPropagation_ ; + /** + *
    +       * In the following, session state means the value of a variable, elements
    +       * in a hash table, or any other resource, accessible by worker sessions
    +       * held by a TF server.
    +       *
    +       * When ClusterSpec propagation is enabled, the value of
    +       * isolate_session_state is ignored when deciding whether to share session
    +       * states in a TF server (for backwards compatibility reasons).
    +       * - If share_session_state_in_clusterspec_propagation is true, the session
    +       * states are shared.
    +       * - If share_session_state_in_clusterspec_propagation is false, session
    +       * states are isolated.
    +       *
    +       * When clusterspec propagation is not used, the value of
    +       * share_session_state_in_clusterspec_propagation is ignored when deciding
    +       * whether to share session states in a TF server.
    +       * - If isolate_session_state is true, session states are isolated.
    +       * - If isolate_session_state is false, session states are shared.
    +       *
    +       * TODO(b/129330037): Add a single API that consistently treats
    +       * isolate_session_state and ClusterSpec propagation.
    +       * 
    + * + * bool share_session_state_in_clusterspec_propagation = 8; + * @return The shareSessionStateInClusterspecPropagation. + */ + @java.lang.Override + public boolean getShareSessionStateInClusterspecPropagation() { + return shareSessionStateInClusterspecPropagation_; + } + /** + *
    +       * In the following, session state means the value of a variable, elements
    +       * in a hash table, or any other resource, accessible by worker sessions
    +       * held by a TF server.
    +       *
    +       * When ClusterSpec propagation is enabled, the value of
    +       * isolate_session_state is ignored when deciding whether to share session
    +       * states in a TF server (for backwards compatibility reasons).
    +       * - If share_session_state_in_clusterspec_propagation is true, the session
    +       * states are shared.
    +       * - If share_session_state_in_clusterspec_propagation is false, session
    +       * states are isolated.
    +       *
    +       * When clusterspec propagation is not used, the value of
    +       * share_session_state_in_clusterspec_propagation is ignored when deciding
    +       * whether to share session states in a TF server.
    +       * - If isolate_session_state is true, session states are isolated.
    +       * - If isolate_session_state is false, session states are shared.
    +       *
    +       * TODO(b/129330037): Add a single API that consistently treats
    +       * isolate_session_state and ClusterSpec propagation.
    +       * 
    + * + * bool share_session_state_in_clusterspec_propagation = 8; + * @param value The shareSessionStateInClusterspecPropagation to set. + * @return This builder for chaining. + */ + public Builder setShareSessionStateInClusterspecPropagation(boolean value) { + + shareSessionStateInClusterspecPropagation_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * In the following, session state means the value of a variable, elements
    +       * in a hash table, or any other resource, accessible by worker sessions
    +       * held by a TF server.
    +       *
    +       * When ClusterSpec propagation is enabled, the value of
    +       * isolate_session_state is ignored when deciding whether to share session
    +       * states in a TF server (for backwards compatibility reasons).
    +       * - If share_session_state_in_clusterspec_propagation is true, the session
    +       * states are shared.
    +       * - If share_session_state_in_clusterspec_propagation is false, session
    +       * states are isolated.
    +       *
    +       * When clusterspec propagation is not used, the value of
    +       * share_session_state_in_clusterspec_propagation is ignored when deciding
    +       * whether to share session states in a TF server.
    +       * - If isolate_session_state is true, session states are isolated.
    +       * - If isolate_session_state is false, session states are shared.
    +       *
    +       * TODO(b/129330037): Add a single API that consistently treats
    +       * isolate_session_state and ClusterSpec propagation.
    +       * 
    + * + * bool share_session_state_in_clusterspec_propagation = 8; + * @return This builder for chaining. + */ + public Builder clearShareSessionStateInClusterspecPropagation() { + bitField0_ = (bitField0_ & ~0x00000040); + shareSessionStateInClusterspecPropagation_ = false; + onChanged(); + return this; + } + + private boolean disableThreadSpinning_ ; + /** + *
    +       * If using a direct session, disable spinning while waiting for work in
    +       * the thread pool. This may result in higher latency for completing ops,
    +       * but in the case where there is a lot of spinning may result in lower
    +       * CPU usage.
    +       * 
    + * + * bool disable_thread_spinning = 9; + * @return The disableThreadSpinning. + */ + @java.lang.Override + public boolean getDisableThreadSpinning() { + return disableThreadSpinning_; + } + /** + *
    +       * If using a direct session, disable spinning while waiting for work in
    +       * the thread pool. This may result in higher latency for completing ops,
    +       * but in the case where there is a lot of spinning may result in lower
    +       * CPU usage.
    +       * 
    + * + * bool disable_thread_spinning = 9; + * @param value The disableThreadSpinning to set. + * @return This builder for chaining. + */ + public Builder setDisableThreadSpinning(boolean value) { + + disableThreadSpinning_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * If using a direct session, disable spinning while waiting for work in
    +       * the thread pool. This may result in higher latency for completing ops,
    +       * but in the case where there is a lot of spinning may result in lower
    +       * CPU usage.
    +       * 
    + * + * bool disable_thread_spinning = 9; + * @return This builder for chaining. + */ + public Builder clearDisableThreadSpinning() { + bitField0_ = (bitField0_ & ~0x00000080); + disableThreadSpinning_ = false; + onChanged(); + return this; + } + + private boolean shareClusterDevicesInSession_ ; + /** + *
    +       * This was promoted to a non-experimental API. Please use
    +       * ConfigProto.share_cluster_devices_in_session instead.
    +       * 
    + * + * bool share_cluster_devices_in_session = 10; + * @return The shareClusterDevicesInSession. + */ + @java.lang.Override + public boolean getShareClusterDevicesInSession() { + return shareClusterDevicesInSession_; + } + /** + *
    +       * This was promoted to a non-experimental API. Please use
    +       * ConfigProto.share_cluster_devices_in_session instead.
    +       * 
    + * + * bool share_cluster_devices_in_session = 10; + * @param value The shareClusterDevicesInSession to set. + * @return This builder for chaining. + */ + public Builder setShareClusterDevicesInSession(boolean value) { + + shareClusterDevicesInSession_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * This was promoted to a non-experimental API. Please use
    +       * ConfigProto.share_cluster_devices_in_session instead.
    +       * 
    + * + * bool share_cluster_devices_in_session = 10; + * @return This builder for chaining. + */ + public Builder clearShareClusterDevicesInSession() { + bitField0_ = (bitField0_ & ~0x00000100); + shareClusterDevicesInSession_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.SessionMetadata sessionMetadata_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder> sessionMetadataBuilder_; + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return Whether the sessionMetadata field is set. + */ + public boolean hasSessionMetadata() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + * @return The sessionMetadata. + */ + public org.tensorflow.proto.SessionMetadata getSessionMetadata() { + if (sessionMetadataBuilder_ == null) { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } else { + return sessionMetadataBuilder_.getMessage(); + } + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public Builder setSessionMetadata(org.tensorflow.proto.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionMetadata_ = value; + } else { + sessionMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public Builder setSessionMetadata( + org.tensorflow.proto.SessionMetadata.Builder builderForValue) { + if (sessionMetadataBuilder_ == null) { + sessionMetadata_ = builderForValue.build(); + } else { + sessionMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public Builder mergeSessionMetadata(org.tensorflow.proto.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + sessionMetadata_ != null && + sessionMetadata_ != org.tensorflow.proto.SessionMetadata.getDefaultInstance()) { + getSessionMetadataBuilder().mergeFrom(value); + } else { + sessionMetadata_ = value; + } + } else { + sessionMetadataBuilder_.mergeFrom(value); + } + if (sessionMetadata_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public Builder clearSessionMetadata() { + bitField0_ = (bitField0_ & ~0x00000200); + sessionMetadata_ = null; + if (sessionMetadataBuilder_ != null) { + sessionMetadataBuilder_.dispose(); + sessionMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public org.tensorflow.proto.SessionMetadata.Builder getSessionMetadataBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getSessionMetadataFieldBuilder().getBuilder(); + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + public org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + if (sessionMetadataBuilder_ != null) { + return sessionMetadataBuilder_.getMessageOrBuilder(); + } else { + return sessionMetadata_ == null ? + org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + } + /** + *
    +       * Metadata about the session.
    +       *
    +       * If set, this can be used by the runtime and the Ops for debugging,
    +       * monitoring, etc.
    +       *
    +       * NOTE: This is currently used and propagated only by the direct session
    +       * and EagerContext.
    +       * 
    + * + * .tensorflow.SessionMetadata session_metadata = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder> + getSessionMetadataFieldBuilder() { + if (sessionMetadataBuilder_ == null) { + sessionMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder>( + getSessionMetadata(), + getParentForChildren(), + isClean()); + sessionMetadata_ = null; + } + return sessionMetadataBuilder_; + } + + private boolean optimizeForStaticGraph_ ; + /** + *
    +       * If true, the session may treat the graph as being static for optimization
    +       * purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef must be passed in a single call to Session::Create(), and
    +       * Session::Extend() may not be supported.
    +       * 
    + * + * bool optimize_for_static_graph = 12; + * @return The optimizeForStaticGraph. + */ + @java.lang.Override + public boolean getOptimizeForStaticGraph() { + return optimizeForStaticGraph_; + } + /** + *
    +       * If true, the session may treat the graph as being static for optimization
    +       * purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef must be passed in a single call to Session::Create(), and
    +       * Session::Extend() may not be supported.
    +       * 
    + * + * bool optimize_for_static_graph = 12; + * @param value The optimizeForStaticGraph to set. + * @return This builder for chaining. + */ + public Builder setOptimizeForStaticGraph(boolean value) { + + optimizeForStaticGraph_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * If true, the session may treat the graph as being static for optimization
    +       * purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef must be passed in a single call to Session::Create(), and
    +       * Session::Extend() may not be supported.
    +       * 
    + * + * bool optimize_for_static_graph = 12; + * @return This builder for chaining. + */ + public Builder clearOptimizeForStaticGraph() { + bitField0_ = (bitField0_ & ~0x00000400); + optimizeForStaticGraph_ = false; + onChanged(); + return this; + } + + private boolean enableMlirBridge_ ; + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
    +       * to true. Default value or false is ignored. Use mlir_bridge_rollout for
    +       * finer control.
    +       *
    +       * If this option is set to true when a session is created, MLIR is used to
    +       * perform the set of graph transformations to put the graph in a form that
    +       * can be executed with delegation of some computations to an accelerator.
    +       * This builds on the model of XLA where a subset of the graph is
    +       * encapsulated and attached to a "compile" operation, whose result is fed
    +       * to an "execute" operation. The kernel for these operations is responsible
    +       * to lower the encapsulated graph to a particular device.
    +       * 
    + * + * bool enable_mlir_bridge = 13; + * @return The enableMlirBridge. + */ + @java.lang.Override + public boolean getEnableMlirBridge() { + return enableMlirBridge_; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
    +       * to true. Default value or false is ignored. Use mlir_bridge_rollout for
    +       * finer control.
    +       *
    +       * If this option is set to true when a session is created, MLIR is used to
    +       * perform the set of graph transformations to put the graph in a form that
    +       * can be executed with delegation of some computations to an accelerator.
    +       * This builds on the model of XLA where a subset of the graph is
    +       * encapsulated and attached to a "compile" operation, whose result is fed
    +       * to an "execute" operation. The kernel for these operations is responsible
    +       * to lower the encapsulated graph to a particular device.
    +       * 
    + * + * bool enable_mlir_bridge = 13; + * @param value The enableMlirBridge to set. + * @return This builder for chaining. + */ + public Builder setEnableMlirBridge(boolean value) { + + enableMlirBridge_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge. This is only used if set
    +       * to true. Default value or false is ignored. Use mlir_bridge_rollout for
    +       * finer control.
    +       *
    +       * If this option is set to true when a session is created, MLIR is used to
    +       * perform the set of graph transformations to put the graph in a form that
    +       * can be executed with delegation of some computations to an accelerator.
    +       * This builds on the model of XLA where a subset of the graph is
    +       * encapsulated and attached to a "compile" operation, whose result is fed
    +       * to an "execute" operation. The kernel for these operations is responsible
    +       * to lower the encapsulated graph to a particular device.
    +       * 
    + * + * bool enable_mlir_bridge = 13; + * @return This builder for chaining. + */ + public Builder clearEnableMlirBridge() { + bitField0_ = (bitField0_ & ~0x00000800); + enableMlirBridge_ = false; + onChanged(); + return this; + } + + private int mlirBridgeRollout_ = 0; + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge.
    +       * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The enum numeric value on the wire for mlirBridgeRollout. + */ + @java.lang.Override public int getMlirBridgeRolloutValue() { + return mlirBridgeRollout_; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge.
    +       * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @param value The enum numeric value on the wire for mlirBridgeRollout to set. + * @return This builder for chaining. + */ + public Builder setMlirBridgeRolloutValue(int value) { + mlirBridgeRollout_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge.
    +       * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return The mlirBridgeRollout. + */ + @java.lang.Override + public org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout getMlirBridgeRollout() { + org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout result = org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.forNumber(mlirBridgeRollout_); + return result == null ? org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout.UNRECOGNIZED : result; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge.
    +       * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @param value The mlirBridgeRollout to set. + * @return This builder for chaining. + */ + public Builder setMlirBridgeRollout(org.tensorflow.proto.ConfigProto.Experimental.MlirBridgeRollout value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + mlirBridgeRollout_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Whether to enable the MLIR-based TF->XLA bridge.
    +       * 
    + * + * .tensorflow.ConfigProto.Experimental.MlirBridgeRollout mlir_bridge_rollout = 17; + * @return This builder for chaining. + */ + public Builder clearMlirBridgeRollout() { + bitField0_ = (bitField0_ & ~0x00001000); + mlirBridgeRollout_ = 0; + onChanged(); + return this; + } + + private boolean enableMlirGraphOptimization_ ; + /** + *
    +       * Whether to enable the MLIR-based Graph optimizations.
    +       *
    +       * This will become a part of standard Tensorflow graph optimization
    +       * pipeline, currently this is only used for gradual migration and testing
    +       * new passes that are replacing existing optimizations in Grappler.
    +       * 
    + * + * bool enable_mlir_graph_optimization = 16; + * @return The enableMlirGraphOptimization. + */ + @java.lang.Override + public boolean getEnableMlirGraphOptimization() { + return enableMlirGraphOptimization_; + } + /** + *
    +       * Whether to enable the MLIR-based Graph optimizations.
    +       *
    +       * This will become a part of standard Tensorflow graph optimization
    +       * pipeline, currently this is only used for gradual migration and testing
    +       * new passes that are replacing existing optimizations in Grappler.
    +       * 
    + * + * bool enable_mlir_graph_optimization = 16; + * @param value The enableMlirGraphOptimization to set. + * @return This builder for chaining. + */ + public Builder setEnableMlirGraphOptimization(boolean value) { + + enableMlirGraphOptimization_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * Whether to enable the MLIR-based Graph optimizations.
    +       *
    +       * This will become a part of standard Tensorflow graph optimization
    +       * pipeline, currently this is only used for gradual migration and testing
    +       * new passes that are replacing existing optimizations in Grappler.
    +       * 
    + * + * bool enable_mlir_graph_optimization = 16; + * @return This builder for chaining. + */ + public Builder clearEnableMlirGraphOptimization() { + bitField0_ = (bitField0_ & ~0x00002000); + enableMlirGraphOptimization_ = false; + onChanged(); + return this; + } + + private boolean disableOutputPartitionGraphs_ ; + /** + *
    +       * If true, the session will not store an additional copy of the graph for
    +       * each subgraph.
    +       *
    +       * If this option is set to true when a session is created, the
    +       * `RunOptions.output_partition_graphs` options must not be set.
    +       * 
    + * + * bool disable_output_partition_graphs = 14; + * @return The disableOutputPartitionGraphs. + */ + @java.lang.Override + public boolean getDisableOutputPartitionGraphs() { + return disableOutputPartitionGraphs_; + } + /** + *
    +       * If true, the session will not store an additional copy of the graph for
    +       * each subgraph.
    +       *
    +       * If this option is set to true when a session is created, the
    +       * `RunOptions.output_partition_graphs` options must not be set.
    +       * 
    + * + * bool disable_output_partition_graphs = 14; + * @param value The disableOutputPartitionGraphs to set. + * @return This builder for chaining. + */ + public Builder setDisableOutputPartitionGraphs(boolean value) { + + disableOutputPartitionGraphs_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * If true, the session will not store an additional copy of the graph for
    +       * each subgraph.
    +       *
    +       * If this option is set to true when a session is created, the
    +       * `RunOptions.output_partition_graphs` options must not be set.
    +       * 
    + * + * bool disable_output_partition_graphs = 14; + * @return This builder for chaining. + */ + public Builder clearDisableOutputPartitionGraphs() { + bitField0_ = (bitField0_ & ~0x00004000); + disableOutputPartitionGraphs_ = false; + onChanged(); + return this; + } + + private long xlaFusionAutotunerThresh_ ; + /** + *
    +       * Minimum number of batches run through the XLA graph before XLA fusion
    +       * autotuner is enabled. Default value of zero disables the autotuner.
    +       *
    +       * The XLA fusion autotuner can improve performance by executing a heuristic
    +       * search on the compiler parameters.
    +       * 
    + * + * int64 xla_fusion_autotuner_thresh = 15; + * @return The xlaFusionAutotunerThresh. + */ + @java.lang.Override + public long getXlaFusionAutotunerThresh() { + return xlaFusionAutotunerThresh_; + } + /** + *
    +       * Minimum number of batches run through the XLA graph before XLA fusion
    +       * autotuner is enabled. Default value of zero disables the autotuner.
    +       *
    +       * The XLA fusion autotuner can improve performance by executing a heuristic
    +       * search on the compiler parameters.
    +       * 
    + * + * int64 xla_fusion_autotuner_thresh = 15; + * @param value The xlaFusionAutotunerThresh to set. + * @return This builder for chaining. + */ + public Builder setXlaFusionAutotunerThresh(long value) { + + xlaFusionAutotunerThresh_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +       * Minimum number of batches run through the XLA graph before XLA fusion
    +       * autotuner is enabled. Default value of zero disables the autotuner.
    +       *
    +       * The XLA fusion autotuner can improve performance by executing a heuristic
    +       * search on the compiler parameters.
    +       * 
    + * + * int64 xla_fusion_autotuner_thresh = 15; + * @return This builder for chaining. + */ + public Builder clearXlaFusionAutotunerThresh() { + bitField0_ = (bitField0_ & ~0x00008000); + xlaFusionAutotunerThresh_ = 0L; + onChanged(); + return this; + } + + private boolean useTfrt_ ; + /** + *
    +       * Whether runtime execution uses TFRT.
    +       * 
    + * + * bool use_tfrt = 18; + * @return The useTfrt. + */ + @java.lang.Override + public boolean getUseTfrt() { + return useTfrt_; + } + /** + *
    +       * Whether runtime execution uses TFRT.
    +       * 
    + * + * bool use_tfrt = 18; + * @param value The useTfrt to set. + * @return This builder for chaining. + */ + public Builder setUseTfrt(boolean value) { + + useTfrt_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +       * Whether runtime execution uses TFRT.
    +       * 
    + * + * bool use_tfrt = 18; + * @return This builder for chaining. + */ + public Builder clearUseTfrt() { + bitField0_ = (bitField0_ & ~0x00010000); + useTfrt_ = false; + onChanged(); + return this; + } + + private boolean enableMultiHost_ ; + /** + *
    +       * If true, use Pathways with TFRT API for multi host support.
    +       * 
    + * + * bool enable_multi_host = 27; + * @return The enableMultiHost. + */ + @java.lang.Override + public boolean getEnableMultiHost() { + return enableMultiHost_; + } + /** + *
    +       * If true, use Pathways with TFRT API for multi host support.
    +       * 
    + * + * bool enable_multi_host = 27; + * @param value The enableMultiHost to set. + * @return This builder for chaining. + */ + public Builder setEnableMultiHost(boolean value) { + + enableMultiHost_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + *
    +       * If true, use Pathways with TFRT API for multi host support.
    +       * 
    + * + * bool enable_multi_host = 27; + * @return This builder for chaining. + */ + public Builder clearEnableMultiHost() { + bitField0_ = (bitField0_ & ~0x00020000); + enableMultiHost_ = false; + onChanged(); + return this; + } + + private boolean tfrtUseIfrt_ ; + /** + *
    +       * If true, use ifrt as the backend for TFRT. This is only used when
    +       * `use_tfrt` is true.
    +       * 
    + * + * bool tfrt_use_ifrt = 32; + * @return The tfrtUseIfrt. + */ + @java.lang.Override + public boolean getTfrtUseIfrt() { + return tfrtUseIfrt_; + } + /** + *
    +       * If true, use ifrt as the backend for TFRT. This is only used when
    +       * `use_tfrt` is true.
    +       * 
    + * + * bool tfrt_use_ifrt = 32; + * @param value The tfrtUseIfrt to set. + * @return This builder for chaining. + */ + public Builder setTfrtUseIfrt(boolean value) { + + tfrtUseIfrt_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + *
    +       * If true, use ifrt as the backend for TFRT. This is only used when
    +       * `use_tfrt` is true.
    +       * 
    + * + * bool tfrt_use_ifrt = 32; + * @return This builder for chaining. + */ + public Builder clearTfrtUseIfrt() { + bitField0_ = (bitField0_ & ~0x00040000); + tfrtUseIfrt_ = false; + onChanged(); + return this; + } + + private int backendServerPort_ ; + /** + *
    +       * Port for the Pathways server. Ignored if enable_multi_host=false.
    +       * 
    + * + * int32 backend_server_port = 28; + * @return The backendServerPort. + */ + @java.lang.Override + public int getBackendServerPort() { + return backendServerPort_; + } + /** + *
    +       * Port for the Pathways server. Ignored if enable_multi_host=false.
    +       * 
    + * + * int32 backend_server_port = 28; + * @param value The backendServerPort to set. + * @return This builder for chaining. + */ + public Builder setBackendServerPort(int value) { + + backendServerPort_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + *
    +       * Port for the Pathways server. Ignored if enable_multi_host=false.
    +       * 
    + * + * int32 backend_server_port = 28; + * @return This builder for chaining. + */ + public Builder clearBackendServerPort() { + bitField0_ = (bitField0_ & ~0x00080000); + backendServerPort_ = 0; + onChanged(); + return this; + } + + private boolean targetTpu_ ; + /** + *
    +       * If true, TFRT will use TPU specific compiler passes and perform TPU
    +       * specific initialization.
    +       * 
    + * + * bool target_tpu = 29; + * @return The targetTpu. + */ + @java.lang.Override + public boolean getTargetTpu() { + return targetTpu_; + } + /** + *
    +       * If true, TFRT will use TPU specific compiler passes and perform TPU
    +       * specific initialization.
    +       * 
    + * + * bool target_tpu = 29; + * @param value The targetTpu to set. + * @return This builder for chaining. + */ + public Builder setTargetTpu(boolean value) { + + targetTpu_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + *
    +       * If true, TFRT will use TPU specific compiler passes and perform TPU
    +       * specific initialization.
    +       * 
    + * + * bool target_tpu = 29; + * @return This builder for chaining. + */ + public Builder clearTargetTpu() { + bitField0_ = (bitField0_ & ~0x00100000); + targetTpu_ = false; + onChanged(); + return this; + } + + private boolean targetGpu_ ; + /** + *
    +       * If true, TFRT will use GPU specific compiler passes and perform GPU
    +       * specific initialization.
    +       * 
    + * + * bool target_gpu = 30; + * @return The targetGpu. + */ + @java.lang.Override + public boolean getTargetGpu() { + return targetGpu_; + } + /** + *
    +       * If true, TFRT will use GPU specific compiler passes and perform GPU
    +       * specific initialization.
    +       * 
    + * + * bool target_gpu = 30; + * @param value The targetGpu to set. + * @return This builder for chaining. + */ + public Builder setTargetGpu(boolean value) { + + targetGpu_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + *
    +       * If true, TFRT will use GPU specific compiler passes and perform GPU
    +       * specific initialization.
    +       * 
    + * + * bool target_gpu = 30; + * @return This builder for chaining. + */ + public Builder clearTargetGpu() { + bitField0_ = (bitField0_ & ~0x00200000); + targetGpu_ = false; + onChanged(); + return this; + } + + private int streamMergeThreshold_ ; + /** + *
    +       * The threshold to merge small streams in TFRT. The stream with cost
    +       * smaller than the threshold will be merged. Setting it to value 1
    +       * disables all merges.
    +       * 
    + * + * int32 stream_merge_threshold = 31; + * @return The streamMergeThreshold. + */ + @java.lang.Override + public int getStreamMergeThreshold() { + return streamMergeThreshold_; + } + /** + *
    +       * The threshold to merge small streams in TFRT. The stream with cost
    +       * smaller than the threshold will be merged. Setting it to value 1
    +       * disables all merges.
    +       * 
    + * + * int32 stream_merge_threshold = 31; + * @param value The streamMergeThreshold to set. + * @return This builder for chaining. + */ + public Builder setStreamMergeThreshold(int value) { + + streamMergeThreshold_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + *
    +       * The threshold to merge small streams in TFRT. The stream with cost
    +       * smaller than the threshold will be merged. Setting it to value 1
    +       * disables all merges.
    +       * 
    + * + * int32 stream_merge_threshold = 31; + * @return This builder for chaining. + */ + public Builder clearStreamMergeThreshold() { + bitField0_ = (bitField0_ & ~0x00400000); + streamMergeThreshold_ = 0; + onChanged(); + return this; + } + + private boolean disableFunctionalOpsLowering_ ; + /** + *
    +       * Whether functional control flow op lowering should be disabled. This is
    +       * useful when executing within a portable runtime where control flow op
    +       * kernels may not be loaded due to selective registration.
    +       * 
    + * + * bool disable_functional_ops_lowering = 21; + * @return The disableFunctionalOpsLowering. + */ + @java.lang.Override + public boolean getDisableFunctionalOpsLowering() { + return disableFunctionalOpsLowering_; + } + /** + *
    +       * Whether functional control flow op lowering should be disabled. This is
    +       * useful when executing within a portable runtime where control flow op
    +       * kernels may not be loaded due to selective registration.
    +       * 
    + * + * bool disable_functional_ops_lowering = 21; + * @param value The disableFunctionalOpsLowering to set. + * @return This builder for chaining. + */ + public Builder setDisableFunctionalOpsLowering(boolean value) { + + disableFunctionalOpsLowering_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + *
    +       * Whether functional control flow op lowering should be disabled. This is
    +       * useful when executing within a portable runtime where control flow op
    +       * kernels may not be loaded due to selective registration.
    +       * 
    + * + * bool disable_functional_ops_lowering = 21; + * @return This builder for chaining. + */ + public Builder clearDisableFunctionalOpsLowering() { + bitField0_ = (bitField0_ & ~0x00800000); + disableFunctionalOpsLowering_ = false; + onChanged(); + return this; + } + + private boolean xlaPreferSingleGraphCluster_ ; + /** + *
    +       * Provides a hint to XLA auto clustering to prefer forming a single large
    +       * cluster that encompasses most of the graph.
    +       * 
    + * + * bool xla_prefer_single_graph_cluster = 22; + * @return The xlaPreferSingleGraphCluster. + */ + @java.lang.Override + public boolean getXlaPreferSingleGraphCluster() { + return xlaPreferSingleGraphCluster_; + } + /** + *
    +       * Provides a hint to XLA auto clustering to prefer forming a single large
    +       * cluster that encompasses most of the graph.
    +       * 
    + * + * bool xla_prefer_single_graph_cluster = 22; + * @param value The xlaPreferSingleGraphCluster to set. + * @return This builder for chaining. + */ + public Builder setXlaPreferSingleGraphCluster(boolean value) { + + xlaPreferSingleGraphCluster_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + *
    +       * Provides a hint to XLA auto clustering to prefer forming a single large
    +       * cluster that encompasses most of the graph.
    +       * 
    + * + * bool xla_prefer_single_graph_cluster = 22; + * @return This builder for chaining. + */ + public Builder clearXlaPreferSingleGraphCluster() { + bitField0_ = (bitField0_ & ~0x01000000); + xlaPreferSingleGraphCluster_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig coordinationConfig_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder> coordinationConfigBuilder_; + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return Whether the coordinationConfig field is set. + */ + public boolean hasCoordinationConfig() { + return ((bitField0_ & 0x02000000) != 0); + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + * @return The coordinationConfig. + */ + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig getCoordinationConfig() { + if (coordinationConfigBuilder_ == null) { + return coordinationConfig_ == null ? org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance() : coordinationConfig_; + } else { + return coordinationConfigBuilder_.getMessage(); + } + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public Builder setCoordinationConfig(org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig value) { + if (coordinationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + coordinationConfig_ = value; + } else { + coordinationConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public Builder setCoordinationConfig( + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder builderForValue) { + if (coordinationConfigBuilder_ == null) { + coordinationConfig_ = builderForValue.build(); + } else { + coordinationConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public Builder mergeCoordinationConfig(org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig value) { + if (coordinationConfigBuilder_ == null) { + if (((bitField0_ & 0x02000000) != 0) && + coordinationConfig_ != null && + coordinationConfig_ != org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance()) { + getCoordinationConfigBuilder().mergeFrom(value); + } else { + coordinationConfig_ = value; + } + } else { + coordinationConfigBuilder_.mergeFrom(value); + } + if (coordinationConfig_ != null) { + bitField0_ |= 0x02000000; + onChanged(); + } + return this; + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public Builder clearCoordinationConfig() { + bitField0_ = (bitField0_ & ~0x02000000); + coordinationConfig_ = null; + if (coordinationConfigBuilder_ != null) { + coordinationConfigBuilder_.dispose(); + coordinationConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder getCoordinationConfigBuilder() { + bitField0_ |= 0x02000000; + onChanged(); + return getCoordinationConfigFieldBuilder().getBuilder(); + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder getCoordinationConfigOrBuilder() { + if (coordinationConfigBuilder_ != null) { + return coordinationConfigBuilder_.getMessageOrBuilder(); + } else { + return coordinationConfig_ == null ? + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance() : coordinationConfig_; + } + } + /** + *
    +       * Distributed coordination service configurations.
    +       * 
    + * + * .tensorflow.CoordinationServiceConfig coordination_config = 23; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder> + getCoordinationConfigFieldBuilder() { + if (coordinationConfigBuilder_ == null) { + coordinationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder>( + getCoordinationConfig(), + getParentForChildren(), + isClean()); + coordinationConfig_ = null; + } + return coordinationConfigBuilder_; + } + + private boolean disableOptimizeForStaticGraph_ ; + /** + *
    +       * If true, the session will treat the graph as being non-static for
    +       * optimization purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef will be retained to enable calls to Session::Extend().
    +       * Calling Extend() without setting this flag will result in errors.
    +       *
    +       * This option is meant to replace `optimize_for_static_graph` and it
    +       * aims to negate its value.
    +       * 
    + * + * bool disable_optimize_for_static_graph = 24; + * @return The disableOptimizeForStaticGraph. + */ + @java.lang.Override + public boolean getDisableOptimizeForStaticGraph() { + return disableOptimizeForStaticGraph_; + } + /** + *
    +       * If true, the session will treat the graph as being non-static for
    +       * optimization purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef will be retained to enable calls to Session::Extend().
    +       * Calling Extend() without setting this flag will result in errors.
    +       *
    +       * This option is meant to replace `optimize_for_static_graph` and it
    +       * aims to negate its value.
    +       * 
    + * + * bool disable_optimize_for_static_graph = 24; + * @param value The disableOptimizeForStaticGraph to set. + * @return This builder for chaining. + */ + public Builder setDisableOptimizeForStaticGraph(boolean value) { + + disableOptimizeForStaticGraph_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + *
    +       * If true, the session will treat the graph as being non-static for
    +       * optimization purposes.
    +       *
    +       * If this option is set to true when a session is created, the full
    +       * GraphDef will be retained to enable calls to Session::Extend().
    +       * Calling Extend() without setting this flag will result in errors.
    +       *
    +       * This option is meant to replace `optimize_for_static_graph` and it
    +       * aims to negate its value.
    +       * 
    + * + * bool disable_optimize_for_static_graph = 24; + * @return This builder for chaining. + */ + public Builder clearDisableOptimizeForStaticGraph() { + bitField0_ = (bitField0_ & ~0x04000000); + disableOptimizeForStaticGraph_ = false; + onChanged(); + return this; + } + + private boolean disableEagerExecutorStreamingEnqueue_ ; + /** + *
    +       * Whether eager remote execution will stream all the function calls or
    +       * allow them to happen in parallel. When true, streaming execution is
    +       * disabled, and parallel execution is allowed.
    +       * 
    + * + * bool disable_eager_executor_streaming_enqueue = 26; + * @return The disableEagerExecutorStreamingEnqueue. + */ + @java.lang.Override + public boolean getDisableEagerExecutorStreamingEnqueue() { + return disableEagerExecutorStreamingEnqueue_; + } + /** + *
    +       * Whether eager remote execution will stream all the function calls or
    +       * allow them to happen in parallel. When true, streaming execution is
    +       * disabled, and parallel execution is allowed.
    +       * 
    + * + * bool disable_eager_executor_streaming_enqueue = 26; + * @param value The disableEagerExecutorStreamingEnqueue to set. + * @return This builder for chaining. + */ + public Builder setDisableEagerExecutorStreamingEnqueue(boolean value) { + + disableEagerExecutorStreamingEnqueue_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + *
    +       * Whether eager remote execution will stream all the function calls or
    +       * allow them to happen in parallel. When true, streaming execution is
    +       * disabled, and parallel execution is allowed.
    +       * 
    + * + * bool disable_eager_executor_streaming_enqueue = 26; + * @return This builder for chaining. + */ + public Builder clearDisableEagerExecutorStreamingEnqueue() { + bitField0_ = (bitField0_ & ~0x08000000); + disableEagerExecutorStreamingEnqueue_ = false; + onChanged(); + return this; + } + + private boolean finalizeFunctionLibraryRuntime_ ; + /** + *
    +       * If true, the function library runtime will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_function_library_runtime = 33; + * @return The finalizeFunctionLibraryRuntime. + */ + @java.lang.Override + public boolean getFinalizeFunctionLibraryRuntime() { + return finalizeFunctionLibraryRuntime_; + } + /** + *
    +       * If true, the function library runtime will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_function_library_runtime = 33; + * @param value The finalizeFunctionLibraryRuntime to set. + * @return This builder for chaining. + */ + public Builder setFinalizeFunctionLibraryRuntime(boolean value) { + + finalizeFunctionLibraryRuntime_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + /** + *
    +       * If true, the function library runtime will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_function_library_runtime = 33; + * @return This builder for chaining. + */ + public Builder clearFinalizeFunctionLibraryRuntime() { + bitField0_ = (bitField0_ & ~0x10000000); + finalizeFunctionLibraryRuntime_ = false; + onChanged(); + return this; + } + + private boolean finalizeResourceManager_ ; + /** + *
    +       * If true, the resource manager will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_resource_manager = 34; + * @return The finalizeResourceManager. + */ + @java.lang.Override + public boolean getFinalizeResourceManager() { + return finalizeResourceManager_; + } + /** + *
    +       * If true, the resource manager will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_resource_manager = 34; + * @param value The finalizeResourceManager to set. + * @return This builder for chaining. + */ + public Builder setFinalizeResourceManager(boolean value) { + + finalizeResourceManager_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + /** + *
    +       * If true, the resource manager will be finalized when the session
    +       * is finalized.
    +       * 
    + * + * bool finalize_resource_manager = 34; + * @return This builder for chaining. + */ + public Builder clearFinalizeResourceManager() { + bitField0_ = (bitField0_ & ~0x20000000); + finalizeResourceManager_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ConfigProto.Experimental) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ConfigProto.Experimental) + private static final org.tensorflow.proto.ConfigProto.Experimental DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ConfigProto.Experimental(); + } + + public static org.tensorflow.proto.ConfigProto.Experimental getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Experimental parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ConfigProto.Experimental getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int DEVICE_COUNT_FIELD_NUMBER = 1; + private static final class DeviceCountDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.Integer> deviceCount_; + private com.google.protobuf.MapField + internalGetDeviceCount() { + if (deviceCount_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DeviceCountDefaultEntryHolder.defaultEntry); + } + return deviceCount_; + } + public int getDeviceCountCount() { + return internalGetDeviceCount().getMap().size(); + } + /** + *
    +   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +   * number of devices of that type to use.  If a particular device
    +   * type is not found in the map, the system picks an appropriate
    +   * number.
    +   * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public boolean containsDeviceCount( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDeviceCount().getMap().containsKey(key); + } + /** + * Use {@link #getDeviceCountMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDeviceCount() { + return getDeviceCountMap(); + } + /** + *
    +   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +   * number of devices of that type to use.  If a particular device
    +   * type is not found in the map, the system picks an appropriate
    +   * number.
    +   * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public java.util.Map getDeviceCountMap() { + return internalGetDeviceCount().getMap(); + } + /** + *
    +   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +   * number of devices of that type to use.  If a particular device
    +   * type is not found in the map, the system picks an appropriate
    +   * number.
    +   * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public int getDeviceCountOrDefault( + java.lang.String key, + int defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDeviceCount().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +   * number of devices of that type to use.  If a particular device
    +   * type is not found in the map, the system picks an appropriate
    +   * number.
    +   * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public int getDeviceCountOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDeviceCount().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int INTRA_OP_PARALLELISM_THREADS_FIELD_NUMBER = 2; + private int intraOpParallelismThreads_ = 0; + /** + *
    +   * The execution of an individual op (for some op types) can be
    +   * parallelized on a pool of intra_op_parallelism_threads.
    +   * 0 means the system picks an appropriate number.
    +   *
    +   * If you create an ordinary session, e.g., from Python or C++,
    +   * then there is exactly one intra op thread pool per process.
    +   * The first session created determines the number of threads in this pool.
    +   * All subsequent sessions reuse/share this one global pool.
    +   *
    +   * There are notable exceptions to the default behavior described above:
    +   * 1. There is an environment variable  for overriding this thread pool,
    +   * named TF_OVERRIDE_GLOBAL_THREADPOOL.
    +   * 2. When connecting to a server, such as a remote `tf.train.Server`
    +   * instance, then this option will be ignored altogether.
    +   * 
    + * + * int32 intra_op_parallelism_threads = 2; + * @return The intraOpParallelismThreads. + */ + @java.lang.Override + public int getIntraOpParallelismThreads() { + return intraOpParallelismThreads_; + } + + public static final int INTER_OP_PARALLELISM_THREADS_FIELD_NUMBER = 5; + private int interOpParallelismThreads_ = 0; + /** + *
    +   * Nodes that perform blocking operations are enqueued on a pool of
    +   * inter_op_parallelism_threads available in each process.
    +   *
    +   * 0 means the system picks an appropriate number.
    +   * Negative means all operations are performed in caller's thread.
    +   *
    +   * Note that the first Session created in the process sets the
    +   * number of threads for all future sessions unless use_per_session_threads is
    +   * true or session_inter_op_thread_pool is configured.
    +   * 
    + * + * int32 inter_op_parallelism_threads = 5; + * @return The interOpParallelismThreads. + */ + @java.lang.Override + public int getInterOpParallelismThreads() { + return interOpParallelismThreads_; + } + + public static final int USE_PER_SESSION_THREADS_FIELD_NUMBER = 9; + private boolean usePerSessionThreads_ = false; + /** + *
    +   * If true, use a new set of threads for this session rather than the global
    +   * pool of threads. Only supported by direct sessions.
    +   *
    +   * If false, use the global threads created by the first session, or the
    +   * per-session thread pools configured by session_inter_op_thread_pool.
    +   *
    +   * This option is deprecated. The same effect can be achieved by setting
    +   * session_inter_op_thread_pool to have one element, whose num_threads equals
    +   * inter_op_parallelism_threads.
    +   * 
    + * + * bool use_per_session_threads = 9; + * @return The usePerSessionThreads. + */ + @java.lang.Override + public boolean getUsePerSessionThreads() { + return usePerSessionThreads_; + } + + public static final int SESSION_INTER_OP_THREAD_POOL_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List sessionInterOpThreadPool_; + /** + *
    +   * This option is experimental - it may be replaced with a different mechanism
    +   * in the future.
    +   *
    +   * Configures session thread pools. If this is configured, then RunOptions for
    +   * a Run call can select the thread pool to use.
    +   *
    +   * The intended use is for when some session invocations need to run in a
    +   * background pool limited to a small number of threads:
    +   * - For example, a session may be configured to have one large pool (for
    +   * regular compute) and one small pool (for periodic, low priority work);
    +   * using the small pool is currently the mechanism for limiting the inter-op
    +   * parallelism of the low priority work.  Note that it does not limit the
    +   * parallelism of work spawned by a single op kernel implementation.
    +   * - Using this setting is normally not needed in training, but may help some
    +   * serving use cases.
    +   * - It is also generally recommended to set the global_name field of this
    +   * proto, to avoid creating multiple large pools. It is typically better to
    +   * run the non-low-priority work, even across sessions, in a single large
    +   * pool.
    +   * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + @java.lang.Override + public java.util.List getSessionInterOpThreadPoolList() { + return sessionInterOpThreadPool_; + } + /** + *
    +   * This option is experimental - it may be replaced with a different mechanism
    +   * in the future.
    +   *
    +   * Configures session thread pools. If this is configured, then RunOptions for
    +   * a Run call can select the thread pool to use.
    +   *
    +   * The intended use is for when some session invocations need to run in a
    +   * background pool limited to a small number of threads:
    +   * - For example, a session may be configured to have one large pool (for
    +   * regular compute) and one small pool (for periodic, low priority work);
    +   * using the small pool is currently the mechanism for limiting the inter-op
    +   * parallelism of the low priority work.  Note that it does not limit the
    +   * parallelism of work spawned by a single op kernel implementation.
    +   * - Using this setting is normally not needed in training, but may help some
    +   * serving use cases.
    +   * - It is also generally recommended to set the global_name field of this
    +   * proto, to avoid creating multiple large pools. It is typically better to
    +   * run the non-low-priority work, even across sessions, in a single large
    +   * pool.
    +   * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + @java.lang.Override + public java.util.List + getSessionInterOpThreadPoolOrBuilderList() { + return sessionInterOpThreadPool_; + } + /** + *
    +   * This option is experimental - it may be replaced with a different mechanism
    +   * in the future.
    +   *
    +   * Configures session thread pools. If this is configured, then RunOptions for
    +   * a Run call can select the thread pool to use.
    +   *
    +   * The intended use is for when some session invocations need to run in a
    +   * background pool limited to a small number of threads:
    +   * - For example, a session may be configured to have one large pool (for
    +   * regular compute) and one small pool (for periodic, low priority work);
    +   * using the small pool is currently the mechanism for limiting the inter-op
    +   * parallelism of the low priority work.  Note that it does not limit the
    +   * parallelism of work spawned by a single op kernel implementation.
    +   * - Using this setting is normally not needed in training, but may help some
    +   * serving use cases.
    +   * - It is also generally recommended to set the global_name field of this
    +   * proto, to avoid creating multiple large pools. It is typically better to
    +   * run the non-low-priority work, even across sessions, in a single large
    +   * pool.
    +   * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + @java.lang.Override + public int getSessionInterOpThreadPoolCount() { + return sessionInterOpThreadPool_.size(); + } + /** + *
    +   * This option is experimental - it may be replaced with a different mechanism
    +   * in the future.
    +   *
    +   * Configures session thread pools. If this is configured, then RunOptions for
    +   * a Run call can select the thread pool to use.
    +   *
    +   * The intended use is for when some session invocations need to run in a
    +   * background pool limited to a small number of threads:
    +   * - For example, a session may be configured to have one large pool (for
    +   * regular compute) and one small pool (for periodic, low priority work);
    +   * using the small pool is currently the mechanism for limiting the inter-op
    +   * parallelism of the low priority work.  Note that it does not limit the
    +   * parallelism of work spawned by a single op kernel implementation.
    +   * - Using this setting is normally not needed in training, but may help some
    +   * serving use cases.
    +   * - It is also generally recommended to set the global_name field of this
    +   * proto, to avoid creating multiple large pools. It is typically better to
    +   * run the non-low-priority work, even across sessions, in a single large
    +   * pool.
    +   * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ThreadPoolOptionProto getSessionInterOpThreadPool(int index) { + return sessionInterOpThreadPool_.get(index); + } + /** + *
    +   * This option is experimental - it may be replaced with a different mechanism
    +   * in the future.
    +   *
    +   * Configures session thread pools. If this is configured, then RunOptions for
    +   * a Run call can select the thread pool to use.
    +   *
    +   * The intended use is for when some session invocations need to run in a
    +   * background pool limited to a small number of threads:
    +   * - For example, a session may be configured to have one large pool (for
    +   * regular compute) and one small pool (for periodic, low priority work);
    +   * using the small pool is currently the mechanism for limiting the inter-op
    +   * parallelism of the low priority work.  Note that it does not limit the
    +   * parallelism of work spawned by a single op kernel implementation.
    +   * - Using this setting is normally not needed in training, but may help some
    +   * serving use cases.
    +   * - It is also generally recommended to set the global_name field of this
    +   * proto, to avoid creating multiple large pools. It is typically better to
    +   * run the non-low-priority work, even across sessions, in a single large
    +   * pool.
    +   * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder( + int index) { + return sessionInterOpThreadPool_.get(index); + } + + public static final int PLACEMENT_PERIOD_FIELD_NUMBER = 3; + private int placementPeriod_ = 0; + /** + *
    +   * Assignment of Nodes to Devices is recomputed every placement_period
    +   * steps until the system warms up (at which point the recomputation
    +   * typically slows down automatically).
    +   * 
    + * + * int32 placement_period = 3; + * @return The placementPeriod. + */ + @java.lang.Override + public int getPlacementPeriod() { + return placementPeriod_; + } + + public static final int DEVICE_FILTERS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * When any filters are present sessions will ignore all devices which do not
    +   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +   * "/job:worker/replica:3", etc.
    +   * 
    + * + * repeated string device_filters = 4; + * @return A list containing the deviceFilters. + */ + public com.google.protobuf.ProtocolStringList + getDeviceFiltersList() { + return deviceFilters_; + } + /** + *
    +   * When any filters are present sessions will ignore all devices which do not
    +   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +   * "/job:worker/replica:3", etc.
    +   * 
    + * + * repeated string device_filters = 4; + * @return The count of deviceFilters. + */ + public int getDeviceFiltersCount() { + return deviceFilters_.size(); + } + /** + *
    +   * When any filters are present sessions will ignore all devices which do not
    +   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +   * "/job:worker/replica:3", etc.
    +   * 
    + * + * repeated string device_filters = 4; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. + */ + public java.lang.String getDeviceFilters(int index) { + return deviceFilters_.get(index); + } + /** + *
    +   * When any filters are present sessions will ignore all devices which do not
    +   * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +   * "/job:worker/replica:3", etc.
    +   * 
    + * + * repeated string device_filters = 4; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. + */ + public com.google.protobuf.ByteString + getDeviceFiltersBytes(int index) { + return deviceFilters_.getByteString(index); + } + + public static final int GPU_OPTIONS_FIELD_NUMBER = 6; + private org.tensorflow.proto.GPUOptions gpuOptions_; + /** + *
    +   * Options that apply to all GPUs.
    +   * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + * @return Whether the gpuOptions field is set. + */ + @java.lang.Override + public boolean hasGpuOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Options that apply to all GPUs.
    +   * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + * @return The gpuOptions. + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions getGpuOptions() { + return gpuOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : gpuOptions_; + } + /** + *
    +   * Options that apply to all GPUs.
    +   * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptionsOrBuilder getGpuOptionsOrBuilder() { + return gpuOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : gpuOptions_; + } + + public static final int PLUGGABLE_DEVICE_OPTIONS_FIELD_NUMBER = 18; + private org.tensorflow.proto.GPUOptions pluggableDeviceOptions_; + /** + *
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return Whether the pluggableDeviceOptions field is set. + */ + @java.lang.Override + public boolean hasPluggableDeviceOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return The pluggableDeviceOptions. + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions getPluggableDeviceOptions() { + return pluggableDeviceOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : pluggableDeviceOptions_; + } + /** + *
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptionsOrBuilder getPluggableDeviceOptionsOrBuilder() { + return pluggableDeviceOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : pluggableDeviceOptions_; + } + + public static final int ALLOW_SOFT_PLACEMENT_FIELD_NUMBER = 7; + private boolean allowSoftPlacement_ = false; + /** + *
    +   * Whether soft placement is allowed. If allow_soft_placement is true,
    +   * an op will be placed on CPU if
    +   * 1. there's no GPU implementation for the OP
    +   * or
    +   * 2. no GPU devices are known or registered
    +   * or
    +   * 3. need to co-locate with reftype input(s) which are from CPU.
    +   * 
    + * + * bool allow_soft_placement = 7; + * @return The allowSoftPlacement. + */ + @java.lang.Override + public boolean getAllowSoftPlacement() { + return allowSoftPlacement_; + } + + public static final int LOG_DEVICE_PLACEMENT_FIELD_NUMBER = 8; + private boolean logDevicePlacement_ = false; + /** + *
    +   * Whether device placements should be logged.
    +   * 
    + * + * bool log_device_placement = 8; + * @return The logDevicePlacement. + */ + @java.lang.Override + public boolean getLogDevicePlacement() { + return logDevicePlacement_; + } + + public static final int GRAPH_OPTIONS_FIELD_NUMBER = 10; + private org.tensorflow.proto.GraphOptions graphOptions_; + /** + *
    +   * Options that apply to all graphs.
    +   * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + * @return Whether the graphOptions field is set. + */ + @java.lang.Override + public boolean hasGraphOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * Options that apply to all graphs.
    +   * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + * @return The graphOptions. + */ + @java.lang.Override + public org.tensorflow.proto.GraphOptions getGraphOptions() { + return graphOptions_ == null ? org.tensorflow.proto.GraphOptions.getDefaultInstance() : graphOptions_; + } + /** + *
    +   * Options that apply to all graphs.
    +   * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + @java.lang.Override + public org.tensorflow.proto.GraphOptionsOrBuilder getGraphOptionsOrBuilder() { + return graphOptions_ == null ? org.tensorflow.proto.GraphOptions.getDefaultInstance() : graphOptions_; + } + + public static final int OPERATION_TIMEOUT_IN_MS_FIELD_NUMBER = 11; + private long operationTimeoutInMs_ = 0L; + /** + *
    +   * Global timeout for all blocking operations in this session.  If non-zero,
    +   * and not overridden on a per-operation basis, this value will be used as the
    +   * deadline for all blocking operations.
    +   * 
    + * + * int64 operation_timeout_in_ms = 11; + * @return The operationTimeoutInMs. + */ + @java.lang.Override + public long getOperationTimeoutInMs() { + return operationTimeoutInMs_; + } + + public static final int RPC_OPTIONS_FIELD_NUMBER = 13; + private org.tensorflow.proto.RpcOptions.RPCOptions rpcOptions_; + /** + *
    +   * Options that apply when this session uses the distributed runtime.
    +   * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + * @return Whether the rpcOptions field is set. + */ + @java.lang.Override + public boolean hasRpcOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +   * Options that apply when this session uses the distributed runtime.
    +   * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + * @return The rpcOptions. + */ + @java.lang.Override + public org.tensorflow.proto.RpcOptions.RPCOptions getRpcOptions() { + return rpcOptions_ == null ? org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance() : rpcOptions_; + } + /** + *
    +   * Options that apply when this session uses the distributed runtime.
    +   * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + @java.lang.Override + public org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder getRpcOptionsOrBuilder() { + return rpcOptions_ == null ? org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance() : rpcOptions_; + } + + public static final int CLUSTER_DEF_FIELD_NUMBER = 14; + private org.tensorflow.proto.ClusterDef clusterDef_; + /** + *
    +   * Optional list of all workers to use in this session.
    +   * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + * @return Whether the clusterDef field is set. + */ + @java.lang.Override + public boolean hasClusterDef() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +   * Optional list of all workers to use in this session.
    +   * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + * @return The clusterDef. + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDef getClusterDef() { + return clusterDef_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : clusterDef_; + } + /** + *
    +   * Optional list of all workers to use in this session.
    +   * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDefOrBuilder getClusterDefOrBuilder() { + return clusterDef_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : clusterDef_; + } + + public static final int ISOLATE_SESSION_STATE_FIELD_NUMBER = 15; + private boolean isolateSessionState_ = false; + /** + *
    +   * If true, any resources such as Variables used in the session will not be
    +   * shared with other sessions. However, when clusterspec propagation is
    +   * enabled, this field is ignored and sessions are always isolated.
    +   * 
    + * + * bool isolate_session_state = 15; + * @return The isolateSessionState. + */ + @java.lang.Override + public boolean getIsolateSessionState() { + return isolateSessionState_; + } + + public static final int SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER = 17; + private boolean shareClusterDevicesInSession_ = false; + /** + *
    +   * When true, WorkerSessions are created with device attributes from the
    +   * full cluster.
    +   * This is helpful when a worker wants to partition a graph
    +   * (for example during a PartitionedCallOp).
    +   * 
    + * + * bool share_cluster_devices_in_session = 17; + * @return The shareClusterDevicesInSession. + */ + @java.lang.Override + public boolean getShareClusterDevicesInSession() { + return shareClusterDevicesInSession_; + } + + public static final int EXPERIMENTAL_FIELD_NUMBER = 16; + private org.tensorflow.proto.ConfigProto.Experimental experimental_; + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return Whether the experimental field is set. + */ + @java.lang.Override + public boolean hasExperimental() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return The experimental. + */ + @java.lang.Override + public org.tensorflow.proto.ConfigProto.Experimental getExperimental() { + return experimental_ == null ? org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance() : experimental_; + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + @java.lang.Override + public org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder() { + return experimental_ == null ? org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance() : experimental_; + } + + 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.GeneratedMessage + .serializeStringMapTo( + output, + internalGetDeviceCount(), + DeviceCountDefaultEntryHolder.defaultEntry, + 1); + if (intraOpParallelismThreads_ != 0) { + output.writeInt32(2, intraOpParallelismThreads_); + } + if (placementPeriod_ != 0) { + output.writeInt32(3, placementPeriod_); + } + for (int i = 0; i < deviceFilters_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, deviceFilters_.getRaw(i)); + } + if (interOpParallelismThreads_ != 0) { + output.writeInt32(5, interOpParallelismThreads_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getGpuOptions()); + } + if (allowSoftPlacement_ != false) { + output.writeBool(7, allowSoftPlacement_); + } + if (logDevicePlacement_ != false) { + output.writeBool(8, logDevicePlacement_); + } + if (usePerSessionThreads_ != false) { + output.writeBool(9, usePerSessionThreads_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getGraphOptions()); + } + if (operationTimeoutInMs_ != 0L) { + output.writeInt64(11, operationTimeoutInMs_); + } + for (int i = 0; i < sessionInterOpThreadPool_.size(); i++) { + output.writeMessage(12, sessionInterOpThreadPool_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(13, getRpcOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(14, getClusterDef()); + } + if (isolateSessionState_ != false) { + output.writeBool(15, isolateSessionState_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(16, getExperimental()); + } + if (shareClusterDevicesInSession_ != false) { + output.writeBool(17, shareClusterDevicesInSession_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(18, getPluggableDeviceOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetDeviceCount().getMap().entrySet()) { + com.google.protobuf.MapEntry + deviceCount__ = DeviceCountDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, deviceCount__); + } + if (intraOpParallelismThreads_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, intraOpParallelismThreads_); + } + if (placementPeriod_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, placementPeriod_); + } + { + int dataSize = 0; + for (int i = 0; i < deviceFilters_.size(); i++) { + dataSize += computeStringSizeNoTag(deviceFilters_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeviceFiltersList().size(); + } + if (interOpParallelismThreads_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, interOpParallelismThreads_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getGpuOptions()); + } + if (allowSoftPlacement_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, allowSoftPlacement_); + } + if (logDevicePlacement_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, logDevicePlacement_); + } + if (usePerSessionThreads_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, usePerSessionThreads_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getGraphOptions()); + } + if (operationTimeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, operationTimeoutInMs_); + } + for (int i = 0; i < sessionInterOpThreadPool_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, sessionInterOpThreadPool_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, getRpcOptions()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getClusterDef()); + } + if (isolateSessionState_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(15, isolateSessionState_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getExperimental()); + } + if (shareClusterDevicesInSession_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, shareClusterDevicesInSession_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, getPluggableDeviceOptions()); + } + size += getUnknownFields().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.ConfigProto)) { + return super.equals(obj); + } + org.tensorflow.proto.ConfigProto other = (org.tensorflow.proto.ConfigProto) obj; + + if (!internalGetDeviceCount().equals( + other.internalGetDeviceCount())) return false; + if (getIntraOpParallelismThreads() + != other.getIntraOpParallelismThreads()) return false; + if (getInterOpParallelismThreads() + != other.getInterOpParallelismThreads()) return false; + if (getUsePerSessionThreads() + != other.getUsePerSessionThreads()) return false; + if (!getSessionInterOpThreadPoolList() + .equals(other.getSessionInterOpThreadPoolList())) return false; + if (getPlacementPeriod() + != other.getPlacementPeriod()) return false; + if (!getDeviceFiltersList() + .equals(other.getDeviceFiltersList())) return false; + if (hasGpuOptions() != other.hasGpuOptions()) return false; + if (hasGpuOptions()) { + if (!getGpuOptions() + .equals(other.getGpuOptions())) return false; + } + if (hasPluggableDeviceOptions() != other.hasPluggableDeviceOptions()) return false; + if (hasPluggableDeviceOptions()) { + if (!getPluggableDeviceOptions() + .equals(other.getPluggableDeviceOptions())) return false; + } + if (getAllowSoftPlacement() + != other.getAllowSoftPlacement()) return false; + if (getLogDevicePlacement() + != other.getLogDevicePlacement()) return false; + if (hasGraphOptions() != other.hasGraphOptions()) return false; + if (hasGraphOptions()) { + if (!getGraphOptions() + .equals(other.getGraphOptions())) return false; + } + if (getOperationTimeoutInMs() + != other.getOperationTimeoutInMs()) return false; + if (hasRpcOptions() != other.hasRpcOptions()) return false; + if (hasRpcOptions()) { + if (!getRpcOptions() + .equals(other.getRpcOptions())) return false; + } + if (hasClusterDef() != other.hasClusterDef()) return false; + if (hasClusterDef()) { + if (!getClusterDef() + .equals(other.getClusterDef())) return false; + } + if (getIsolateSessionState() + != other.getIsolateSessionState()) return false; + if (getShareClusterDevicesInSession() + != other.getShareClusterDevicesInSession()) return false; + if (hasExperimental() != other.hasExperimental()) return false; + if (hasExperimental()) { + if (!getExperimental() + .equals(other.getExperimental())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetDeviceCount().getMap().isEmpty()) { + hash = (37 * hash) + DEVICE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + internalGetDeviceCount().hashCode(); + } + hash = (37 * hash) + INTRA_OP_PARALLELISM_THREADS_FIELD_NUMBER; + hash = (53 * hash) + getIntraOpParallelismThreads(); + hash = (37 * hash) + INTER_OP_PARALLELISM_THREADS_FIELD_NUMBER; + hash = (53 * hash) + getInterOpParallelismThreads(); + hash = (37 * hash) + USE_PER_SESSION_THREADS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUsePerSessionThreads()); + if (getSessionInterOpThreadPoolCount() > 0) { + hash = (37 * hash) + SESSION_INTER_OP_THREAD_POOL_FIELD_NUMBER; + hash = (53 * hash) + getSessionInterOpThreadPoolList().hashCode(); + } + hash = (37 * hash) + PLACEMENT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getPlacementPeriod(); + if (getDeviceFiltersCount() > 0) { + hash = (37 * hash) + DEVICE_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceFiltersList().hashCode(); + } + if (hasGpuOptions()) { + hash = (37 * hash) + GPU_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getGpuOptions().hashCode(); + } + if (hasPluggableDeviceOptions()) { + hash = (37 * hash) + PLUGGABLE_DEVICE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPluggableDeviceOptions().hashCode(); + } + hash = (37 * hash) + ALLOW_SOFT_PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowSoftPlacement()); + hash = (37 * hash) + LOG_DEVICE_PLACEMENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLogDevicePlacement()); + if (hasGraphOptions()) { + hash = (37 * hash) + GRAPH_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getGraphOptions().hashCode(); + } + hash = (37 * hash) + OPERATION_TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOperationTimeoutInMs()); + if (hasRpcOptions()) { + hash = (37 * hash) + RPC_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRpcOptions().hashCode(); + } + if (hasClusterDef()) { + hash = (37 * hash) + CLUSTER_DEF_FIELD_NUMBER; + hash = (53 * hash) + getClusterDef().hashCode(); + } + hash = (37 * hash) + ISOLATE_SESSION_STATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsolateSessionState()); + hash = (37 * hash) + SHARE_CLUSTER_DEVICES_IN_SESSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getShareClusterDevicesInSession()); + if (hasExperimental()) { + hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; + hash = (53 * hash) + getExperimental().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ConfigProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto 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.ConfigProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto 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.ConfigProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ConfigProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ConfigProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ConfigProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ConfigProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ConfigProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ConfigProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ConfigProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ConfigProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Session configuration parameters.
    +   * The system picks appropriate values for fields that are not set.
    +   * 
    + * + * Protobuf type {@code tensorflow.ConfigProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ConfigProto) + org.tensorflow.proto.ConfigProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetDeviceCount(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableDeviceCount(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ConfigProto.class, org.tensorflow.proto.ConfigProto.Builder.class); + } + + // Construct using org.tensorflow.proto.ConfigProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSessionInterOpThreadPoolFieldBuilder(); + getGpuOptionsFieldBuilder(); + getPluggableDeviceOptionsFieldBuilder(); + getGraphOptionsFieldBuilder(); + getRpcOptionsFieldBuilder(); + getClusterDefFieldBuilder(); + getExperimentalFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableDeviceCount().clear(); + intraOpParallelismThreads_ = 0; + interOpParallelismThreads_ = 0; + usePerSessionThreads_ = false; + if (sessionInterOpThreadPoolBuilder_ == null) { + sessionInterOpThreadPool_ = java.util.Collections.emptyList(); + } else { + sessionInterOpThreadPool_ = null; + sessionInterOpThreadPoolBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + placementPeriod_ = 0; + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + gpuOptions_ = null; + if (gpuOptionsBuilder_ != null) { + gpuOptionsBuilder_.dispose(); + gpuOptionsBuilder_ = null; + } + pluggableDeviceOptions_ = null; + if (pluggableDeviceOptionsBuilder_ != null) { + pluggableDeviceOptionsBuilder_.dispose(); + pluggableDeviceOptionsBuilder_ = null; + } + allowSoftPlacement_ = false; + logDevicePlacement_ = false; + graphOptions_ = null; + if (graphOptionsBuilder_ != null) { + graphOptionsBuilder_.dispose(); + graphOptionsBuilder_ = null; + } + operationTimeoutInMs_ = 0L; + rpcOptions_ = null; + if (rpcOptionsBuilder_ != null) { + rpcOptionsBuilder_.dispose(); + rpcOptionsBuilder_ = null; + } + clusterDef_ = null; + if (clusterDefBuilder_ != null) { + clusterDefBuilder_.dispose(); + clusterDefBuilder_ = null; + } + isolateSessionState_ = false; + shareClusterDevicesInSession_ = false; + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ConfigProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto getDefaultInstanceForType() { + return org.tensorflow.proto.ConfigProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto build() { + org.tensorflow.proto.ConfigProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ConfigProto buildPartial() { + org.tensorflow.proto.ConfigProto result = new org.tensorflow.proto.ConfigProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ConfigProto result) { + if (sessionInterOpThreadPoolBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + sessionInterOpThreadPool_ = java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.sessionInterOpThreadPool_ = sessionInterOpThreadPool_; + } else { + result.sessionInterOpThreadPool_ = sessionInterOpThreadPoolBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ConfigProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deviceCount_ = internalGetDeviceCount(); + result.deviceCount_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.intraOpParallelismThreads_ = intraOpParallelismThreads_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.interOpParallelismThreads_ = interOpParallelismThreads_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.usePerSessionThreads_ = usePerSessionThreads_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.placementPeriod_ = placementPeriod_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + deviceFilters_.makeImmutable(); + result.deviceFilters_ = deviceFilters_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.gpuOptions_ = gpuOptionsBuilder_ == null + ? gpuOptions_ + : gpuOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pluggableDeviceOptions_ = pluggableDeviceOptionsBuilder_ == null + ? pluggableDeviceOptions_ + : pluggableDeviceOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.allowSoftPlacement_ = allowSoftPlacement_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.logDevicePlacement_ = logDevicePlacement_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.graphOptions_ = graphOptionsBuilder_ == null + ? graphOptions_ + : graphOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.operationTimeoutInMs_ = operationTimeoutInMs_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.rpcOptions_ = rpcOptionsBuilder_ == null + ? rpcOptions_ + : rpcOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.clusterDef_ = clusterDefBuilder_ == null + ? clusterDef_ + : clusterDefBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.isolateSessionState_ = isolateSessionState_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.shareClusterDevicesInSession_ = shareClusterDevicesInSession_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.experimental_ = experimentalBuilder_ == null + ? experimental_ + : experimentalBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ConfigProto) { + return mergeFrom((org.tensorflow.proto.ConfigProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ConfigProto other) { + if (other == org.tensorflow.proto.ConfigProto.getDefaultInstance()) return this; + internalGetMutableDeviceCount().mergeFrom( + other.internalGetDeviceCount()); + bitField0_ |= 0x00000001; + if (other.getIntraOpParallelismThreads() != 0) { + setIntraOpParallelismThreads(other.getIntraOpParallelismThreads()); + } + if (other.getInterOpParallelismThreads() != 0) { + setInterOpParallelismThreads(other.getInterOpParallelismThreads()); + } + if (other.getUsePerSessionThreads() != false) { + setUsePerSessionThreads(other.getUsePerSessionThreads()); + } + if (sessionInterOpThreadPoolBuilder_ == null) { + if (!other.sessionInterOpThreadPool_.isEmpty()) { + if (sessionInterOpThreadPool_.isEmpty()) { + sessionInterOpThreadPool_ = other.sessionInterOpThreadPool_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.addAll(other.sessionInterOpThreadPool_); + } + onChanged(); + } + } else { + if (!other.sessionInterOpThreadPool_.isEmpty()) { + if (sessionInterOpThreadPoolBuilder_.isEmpty()) { + sessionInterOpThreadPoolBuilder_.dispose(); + sessionInterOpThreadPoolBuilder_ = null; + sessionInterOpThreadPool_ = other.sessionInterOpThreadPool_; + bitField0_ = (bitField0_ & ~0x00000010); + sessionInterOpThreadPoolBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSessionInterOpThreadPoolFieldBuilder() : null; + } else { + sessionInterOpThreadPoolBuilder_.addAllMessages(other.sessionInterOpThreadPool_); + } + } + } + if (other.getPlacementPeriod() != 0) { + setPlacementPeriod(other.getPlacementPeriod()); + } + if (!other.deviceFilters_.isEmpty()) { + if (deviceFilters_.isEmpty()) { + deviceFilters_ = other.deviceFilters_; + bitField0_ |= 0x00000040; + } else { + ensureDeviceFiltersIsMutable(); + deviceFilters_.addAll(other.deviceFilters_); + } + onChanged(); + } + if (other.hasGpuOptions()) { + mergeGpuOptions(other.getGpuOptions()); + } + if (other.hasPluggableDeviceOptions()) { + mergePluggableDeviceOptions(other.getPluggableDeviceOptions()); + } + if (other.getAllowSoftPlacement() != false) { + setAllowSoftPlacement(other.getAllowSoftPlacement()); + } + if (other.getLogDevicePlacement() != false) { + setLogDevicePlacement(other.getLogDevicePlacement()); + } + if (other.hasGraphOptions()) { + mergeGraphOptions(other.getGraphOptions()); + } + if (other.getOperationTimeoutInMs() != 0L) { + setOperationTimeoutInMs(other.getOperationTimeoutInMs()); + } + if (other.hasRpcOptions()) { + mergeRpcOptions(other.getRpcOptions()); + } + if (other.hasClusterDef()) { + mergeClusterDef(other.getClusterDef()); + } + if (other.getIsolateSessionState() != false) { + setIsolateSessionState(other.getIsolateSessionState()); + } + if (other.getShareClusterDevicesInSession() != false) { + setShareClusterDevicesInSession(other.getShareClusterDevicesInSession()); + } + if (other.hasExperimental()) { + mergeExperimental(other.getExperimental()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + deviceCount__ = input.readMessage( + DeviceCountDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableDeviceCount().getMutableMap().put( + deviceCount__.getKey(), deviceCount__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + intraOpParallelismThreads_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + placementPeriod_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 24 + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(s); + break; + } // case 34 + case 40: { + interOpParallelismThreads_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 40 + case 50: { + input.readMessage( + getGpuOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 56: { + allowSoftPlacement_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 56 + case 64: { + logDevicePlacement_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 64 + case 72: { + usePerSessionThreads_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 72 + case 82: { + input.readMessage( + getGraphOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: { + operationTimeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 88 + case 98: { + org.tensorflow.proto.ThreadPoolOptionProto m = + input.readMessage( + org.tensorflow.proto.ThreadPoolOptionProto.parser(), + extensionRegistry); + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.add(m); + } else { + sessionInterOpThreadPoolBuilder_.addMessage(m); + } + break; + } // case 98 + case 106: { + input.readMessage( + getRpcOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 106 + case 114: { + input.readMessage( + getClusterDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00004000; + break; + } // case 114 + case 120: { + isolateSessionState_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 120 + case 130: { + input.readMessage( + getExperimentalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 130 + case 136: { + shareClusterDevicesInSession_ = input.readBool(); + bitField0_ |= 0x00010000; + break; + } // case 136 + case 146: { + input.readMessage( + getPluggableDeviceOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 146 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, java.lang.Integer> deviceCount_; + private com.google.protobuf.MapField + internalGetDeviceCount() { + if (deviceCount_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DeviceCountDefaultEntryHolder.defaultEntry); + } + return deviceCount_; + } + private com.google.protobuf.MapField + internalGetMutableDeviceCount() { + if (deviceCount_ == null) { + deviceCount_ = com.google.protobuf.MapField.newMapField( + DeviceCountDefaultEntryHolder.defaultEntry); + } + if (!deviceCount_.isMutable()) { + deviceCount_ = deviceCount_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return deviceCount_; + } + public int getDeviceCountCount() { + return internalGetDeviceCount().getMap().size(); + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public boolean containsDeviceCount( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDeviceCount().getMap().containsKey(key); + } + /** + * Use {@link #getDeviceCountMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDeviceCount() { + return getDeviceCountMap(); + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public java.util.Map getDeviceCountMap() { + return internalGetDeviceCount().getMap(); + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public int getDeviceCountOrDefault( + java.lang.String key, + int defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDeviceCount().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + @java.lang.Override + public int getDeviceCountOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDeviceCount().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearDeviceCount() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableDeviceCount().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + public Builder removeDeviceCount( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableDeviceCount().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableDeviceCount() { + bitField0_ |= 0x00000001; + return internalGetMutableDeviceCount().getMutableMap(); + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + public Builder putDeviceCount( + java.lang.String key, + int value) { + if (key == null) { throw new NullPointerException("map key"); } + + internalGetMutableDeviceCount().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Map from device type name (e.g., "CPU" or "GPU" ) to maximum
    +     * number of devices of that type to use.  If a particular device
    +     * type is not found in the map, the system picks an appropriate
    +     * number.
    +     * 
    + * + * map<string, int32> device_count = 1; + */ + public Builder putAllDeviceCount( + java.util.Map values) { + internalGetMutableDeviceCount().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + private int intraOpParallelismThreads_ ; + /** + *
    +     * The execution of an individual op (for some op types) can be
    +     * parallelized on a pool of intra_op_parallelism_threads.
    +     * 0 means the system picks an appropriate number.
    +     *
    +     * If you create an ordinary session, e.g., from Python or C++,
    +     * then there is exactly one intra op thread pool per process.
    +     * The first session created determines the number of threads in this pool.
    +     * All subsequent sessions reuse/share this one global pool.
    +     *
    +     * There are notable exceptions to the default behavior described above:
    +     * 1. There is an environment variable  for overriding this thread pool,
    +     * named TF_OVERRIDE_GLOBAL_THREADPOOL.
    +     * 2. When connecting to a server, such as a remote `tf.train.Server`
    +     * instance, then this option will be ignored altogether.
    +     * 
    + * + * int32 intra_op_parallelism_threads = 2; + * @return The intraOpParallelismThreads. + */ + @java.lang.Override + public int getIntraOpParallelismThreads() { + return intraOpParallelismThreads_; + } + /** + *
    +     * The execution of an individual op (for some op types) can be
    +     * parallelized on a pool of intra_op_parallelism_threads.
    +     * 0 means the system picks an appropriate number.
    +     *
    +     * If you create an ordinary session, e.g., from Python or C++,
    +     * then there is exactly one intra op thread pool per process.
    +     * The first session created determines the number of threads in this pool.
    +     * All subsequent sessions reuse/share this one global pool.
    +     *
    +     * There are notable exceptions to the default behavior described above:
    +     * 1. There is an environment variable  for overriding this thread pool,
    +     * named TF_OVERRIDE_GLOBAL_THREADPOOL.
    +     * 2. When connecting to a server, such as a remote `tf.train.Server`
    +     * instance, then this option will be ignored altogether.
    +     * 
    + * + * int32 intra_op_parallelism_threads = 2; + * @param value The intraOpParallelismThreads to set. + * @return This builder for chaining. + */ + public Builder setIntraOpParallelismThreads(int value) { + + intraOpParallelismThreads_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The execution of an individual op (for some op types) can be
    +     * parallelized on a pool of intra_op_parallelism_threads.
    +     * 0 means the system picks an appropriate number.
    +     *
    +     * If you create an ordinary session, e.g., from Python or C++,
    +     * then there is exactly one intra op thread pool per process.
    +     * The first session created determines the number of threads in this pool.
    +     * All subsequent sessions reuse/share this one global pool.
    +     *
    +     * There are notable exceptions to the default behavior described above:
    +     * 1. There is an environment variable  for overriding this thread pool,
    +     * named TF_OVERRIDE_GLOBAL_THREADPOOL.
    +     * 2. When connecting to a server, such as a remote `tf.train.Server`
    +     * instance, then this option will be ignored altogether.
    +     * 
    + * + * int32 intra_op_parallelism_threads = 2; + * @return This builder for chaining. + */ + public Builder clearIntraOpParallelismThreads() { + bitField0_ = (bitField0_ & ~0x00000002); + intraOpParallelismThreads_ = 0; + onChanged(); + return this; + } + + private int interOpParallelismThreads_ ; + /** + *
    +     * Nodes that perform blocking operations are enqueued on a pool of
    +     * inter_op_parallelism_threads available in each process.
    +     *
    +     * 0 means the system picks an appropriate number.
    +     * Negative means all operations are performed in caller's thread.
    +     *
    +     * Note that the first Session created in the process sets the
    +     * number of threads for all future sessions unless use_per_session_threads is
    +     * true or session_inter_op_thread_pool is configured.
    +     * 
    + * + * int32 inter_op_parallelism_threads = 5; + * @return The interOpParallelismThreads. + */ + @java.lang.Override + public int getInterOpParallelismThreads() { + return interOpParallelismThreads_; + } + /** + *
    +     * Nodes that perform blocking operations are enqueued on a pool of
    +     * inter_op_parallelism_threads available in each process.
    +     *
    +     * 0 means the system picks an appropriate number.
    +     * Negative means all operations are performed in caller's thread.
    +     *
    +     * Note that the first Session created in the process sets the
    +     * number of threads for all future sessions unless use_per_session_threads is
    +     * true or session_inter_op_thread_pool is configured.
    +     * 
    + * + * int32 inter_op_parallelism_threads = 5; + * @param value The interOpParallelismThreads to set. + * @return This builder for chaining. + */ + public Builder setInterOpParallelismThreads(int value) { + + interOpParallelismThreads_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Nodes that perform blocking operations are enqueued on a pool of
    +     * inter_op_parallelism_threads available in each process.
    +     *
    +     * 0 means the system picks an appropriate number.
    +     * Negative means all operations are performed in caller's thread.
    +     *
    +     * Note that the first Session created in the process sets the
    +     * number of threads for all future sessions unless use_per_session_threads is
    +     * true or session_inter_op_thread_pool is configured.
    +     * 
    + * + * int32 inter_op_parallelism_threads = 5; + * @return This builder for chaining. + */ + public Builder clearInterOpParallelismThreads() { + bitField0_ = (bitField0_ & ~0x00000004); + interOpParallelismThreads_ = 0; + onChanged(); + return this; + } + + private boolean usePerSessionThreads_ ; + /** + *
    +     * If true, use a new set of threads for this session rather than the global
    +     * pool of threads. Only supported by direct sessions.
    +     *
    +     * If false, use the global threads created by the first session, or the
    +     * per-session thread pools configured by session_inter_op_thread_pool.
    +     *
    +     * This option is deprecated. The same effect can be achieved by setting
    +     * session_inter_op_thread_pool to have one element, whose num_threads equals
    +     * inter_op_parallelism_threads.
    +     * 
    + * + * bool use_per_session_threads = 9; + * @return The usePerSessionThreads. + */ + @java.lang.Override + public boolean getUsePerSessionThreads() { + return usePerSessionThreads_; + } + /** + *
    +     * If true, use a new set of threads for this session rather than the global
    +     * pool of threads. Only supported by direct sessions.
    +     *
    +     * If false, use the global threads created by the first session, or the
    +     * per-session thread pools configured by session_inter_op_thread_pool.
    +     *
    +     * This option is deprecated. The same effect can be achieved by setting
    +     * session_inter_op_thread_pool to have one element, whose num_threads equals
    +     * inter_op_parallelism_threads.
    +     * 
    + * + * bool use_per_session_threads = 9; + * @param value The usePerSessionThreads to set. + * @return This builder for chaining. + */ + public Builder setUsePerSessionThreads(boolean value) { + + usePerSessionThreads_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * If true, use a new set of threads for this session rather than the global
    +     * pool of threads. Only supported by direct sessions.
    +     *
    +     * If false, use the global threads created by the first session, or the
    +     * per-session thread pools configured by session_inter_op_thread_pool.
    +     *
    +     * This option is deprecated. The same effect can be achieved by setting
    +     * session_inter_op_thread_pool to have one element, whose num_threads equals
    +     * inter_op_parallelism_threads.
    +     * 
    + * + * bool use_per_session_threads = 9; + * @return This builder for chaining. + */ + public Builder clearUsePerSessionThreads() { + bitField0_ = (bitField0_ & ~0x00000008); + usePerSessionThreads_ = false; + onChanged(); + return this; + } + + private java.util.List sessionInterOpThreadPool_ = + java.util.Collections.emptyList(); + private void ensureSessionInterOpThreadPoolIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + sessionInterOpThreadPool_ = new java.util.ArrayList(sessionInterOpThreadPool_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ThreadPoolOptionProto, org.tensorflow.proto.ThreadPoolOptionProto.Builder, org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder> sessionInterOpThreadPoolBuilder_; + + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public java.util.List getSessionInterOpThreadPoolList() { + if (sessionInterOpThreadPoolBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); + } else { + return sessionInterOpThreadPoolBuilder_.getMessageList(); + } + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public int getSessionInterOpThreadPoolCount() { + if (sessionInterOpThreadPoolBuilder_ == null) { + return sessionInterOpThreadPool_.size(); + } else { + return sessionInterOpThreadPoolBuilder_.getCount(); + } + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public org.tensorflow.proto.ThreadPoolOptionProto getSessionInterOpThreadPool(int index) { + if (sessionInterOpThreadPoolBuilder_ == null) { + return sessionInterOpThreadPool_.get(index); + } else { + return sessionInterOpThreadPoolBuilder_.getMessage(index); + } + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder setSessionInterOpThreadPool( + int index, org.tensorflow.proto.ThreadPoolOptionProto value) { + if (sessionInterOpThreadPoolBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.set(index, value); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder setSessionInterOpThreadPool( + int index, org.tensorflow.proto.ThreadPoolOptionProto.Builder builderForValue) { + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder addSessionInterOpThreadPool(org.tensorflow.proto.ThreadPoolOptionProto value) { + if (sessionInterOpThreadPoolBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.add(value); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder addSessionInterOpThreadPool( + int index, org.tensorflow.proto.ThreadPoolOptionProto value) { + if (sessionInterOpThreadPoolBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.add(index, value); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder addSessionInterOpThreadPool( + org.tensorflow.proto.ThreadPoolOptionProto.Builder builderForValue) { + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.add(builderForValue.build()); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder addSessionInterOpThreadPool( + int index, org.tensorflow.proto.ThreadPoolOptionProto.Builder builderForValue) { + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder addAllSessionInterOpThreadPool( + java.lang.Iterable values) { + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sessionInterOpThreadPool_); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder clearSessionInterOpThreadPool() { + if (sessionInterOpThreadPoolBuilder_ == null) { + sessionInterOpThreadPool_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.clear(); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public Builder removeSessionInterOpThreadPool(int index) { + if (sessionInterOpThreadPoolBuilder_ == null) { + ensureSessionInterOpThreadPoolIsMutable(); + sessionInterOpThreadPool_.remove(index); + onChanged(); + } else { + sessionInterOpThreadPoolBuilder_.remove(index); + } + return this; + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public org.tensorflow.proto.ThreadPoolOptionProto.Builder getSessionInterOpThreadPoolBuilder( + int index) { + return getSessionInterOpThreadPoolFieldBuilder().getBuilder(index); + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder( + int index) { + if (sessionInterOpThreadPoolBuilder_ == null) { + return sessionInterOpThreadPool_.get(index); } else { + return sessionInterOpThreadPoolBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public java.util.List + getSessionInterOpThreadPoolOrBuilderList() { + if (sessionInterOpThreadPoolBuilder_ != null) { + return sessionInterOpThreadPoolBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessionInterOpThreadPool_); + } + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public org.tensorflow.proto.ThreadPoolOptionProto.Builder addSessionInterOpThreadPoolBuilder() { + return getSessionInterOpThreadPoolFieldBuilder().addBuilder( + org.tensorflow.proto.ThreadPoolOptionProto.getDefaultInstance()); + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public org.tensorflow.proto.ThreadPoolOptionProto.Builder addSessionInterOpThreadPoolBuilder( + int index) { + return getSessionInterOpThreadPoolFieldBuilder().addBuilder( + index, org.tensorflow.proto.ThreadPoolOptionProto.getDefaultInstance()); + } + /** + *
    +     * This option is experimental - it may be replaced with a different mechanism
    +     * in the future.
    +     *
    +     * Configures session thread pools. If this is configured, then RunOptions for
    +     * a Run call can select the thread pool to use.
    +     *
    +     * The intended use is for when some session invocations need to run in a
    +     * background pool limited to a small number of threads:
    +     * - For example, a session may be configured to have one large pool (for
    +     * regular compute) and one small pool (for periodic, low priority work);
    +     * using the small pool is currently the mechanism for limiting the inter-op
    +     * parallelism of the low priority work.  Note that it does not limit the
    +     * parallelism of work spawned by a single op kernel implementation.
    +     * - Using this setting is normally not needed in training, but may help some
    +     * serving use cases.
    +     * - It is also generally recommended to set the global_name field of this
    +     * proto, to avoid creating multiple large pools. It is typically better to
    +     * run the non-low-priority work, even across sessions, in a single large
    +     * pool.
    +     * 
    + * + * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12; + */ + public java.util.List + getSessionInterOpThreadPoolBuilderList() { + return getSessionInterOpThreadPoolFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ThreadPoolOptionProto, org.tensorflow.proto.ThreadPoolOptionProto.Builder, org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder> + getSessionInterOpThreadPoolFieldBuilder() { + if (sessionInterOpThreadPoolBuilder_ == null) { + sessionInterOpThreadPoolBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ThreadPoolOptionProto, org.tensorflow.proto.ThreadPoolOptionProto.Builder, org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder>( + sessionInterOpThreadPool_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + sessionInterOpThreadPool_ = null; + } + return sessionInterOpThreadPoolBuilder_; + } + + private int placementPeriod_ ; + /** + *
    +     * Assignment of Nodes to Devices is recomputed every placement_period
    +     * steps until the system warms up (at which point the recomputation
    +     * typically slows down automatically).
    +     * 
    + * + * int32 placement_period = 3; + * @return The placementPeriod. + */ + @java.lang.Override + public int getPlacementPeriod() { + return placementPeriod_; + } + /** + *
    +     * Assignment of Nodes to Devices is recomputed every placement_period
    +     * steps until the system warms up (at which point the recomputation
    +     * typically slows down automatically).
    +     * 
    + * + * int32 placement_period = 3; + * @param value The placementPeriod to set. + * @return This builder for chaining. + */ + public Builder setPlacementPeriod(int value) { + + placementPeriod_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Assignment of Nodes to Devices is recomputed every placement_period
    +     * steps until the system warms up (at which point the recomputation
    +     * typically slows down automatically).
    +     * 
    + * + * int32 placement_period = 3; + * @return This builder for chaining. + */ + public Builder clearPlacementPeriod() { + bitField0_ = (bitField0_ & ~0x00000020); + placementPeriod_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDeviceFiltersIsMutable() { + if (!deviceFilters_.isModifiable()) { + deviceFilters_ = new com.google.protobuf.LazyStringArrayList(deviceFilters_); + } + bitField0_ |= 0x00000040; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @return A list containing the deviceFilters. + */ + public com.google.protobuf.ProtocolStringList + getDeviceFiltersList() { + deviceFilters_.makeImmutable(); + return deviceFilters_; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @return The count of deviceFilters. + */ + public int getDeviceFiltersCount() { + return deviceFilters_.size(); + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. + */ + public java.lang.String getDeviceFilters(int index) { + return deviceFilters_.get(index); + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. + */ + public com.google.protobuf.ByteString + getDeviceFiltersBytes(int index) { + return deviceFilters_.getByteString(index); + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param index The index to set the value at. + * @param value The deviceFilters to set. + * @return This builder for chaining. + */ + public Builder setDeviceFilters( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDeviceFiltersIsMutable(); + deviceFilters_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param value The deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addDeviceFilters( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param values The deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceFilters( + java.lang.Iterable values) { + ensureDeviceFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceFilters_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceFilters() { + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040);; + onChanged(); + return this; + } + /** + *
    +     * When any filters are present sessions will ignore all devices which do not
    +     * match the filters. Each filter can be partially specified, e.g. "/job:ps"
    +     * "/job:worker/replica:3", etc.
    +     * 
    + * + * repeated string device_filters = 4; + * @param value The bytes of the deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addDeviceFiltersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private org.tensorflow.proto.GPUOptions gpuOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder> gpuOptionsBuilder_; + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + * @return Whether the gpuOptions field is set. + */ + public boolean hasGpuOptions() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + * @return The gpuOptions. + */ + public org.tensorflow.proto.GPUOptions getGpuOptions() { + if (gpuOptionsBuilder_ == null) { + return gpuOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : gpuOptions_; + } else { + return gpuOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public Builder setGpuOptions(org.tensorflow.proto.GPUOptions value) { + if (gpuOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gpuOptions_ = value; + } else { + gpuOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public Builder setGpuOptions( + org.tensorflow.proto.GPUOptions.Builder builderForValue) { + if (gpuOptionsBuilder_ == null) { + gpuOptions_ = builderForValue.build(); + } else { + gpuOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public Builder mergeGpuOptions(org.tensorflow.proto.GPUOptions value) { + if (gpuOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + gpuOptions_ != null && + gpuOptions_ != org.tensorflow.proto.GPUOptions.getDefaultInstance()) { + getGpuOptionsBuilder().mergeFrom(value); + } else { + gpuOptions_ = value; + } + } else { + gpuOptionsBuilder_.mergeFrom(value); + } + if (gpuOptions_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public Builder clearGpuOptions() { + bitField0_ = (bitField0_ & ~0x00000080); + gpuOptions_ = null; + if (gpuOptionsBuilder_ != null) { + gpuOptionsBuilder_.dispose(); + gpuOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public org.tensorflow.proto.GPUOptions.Builder getGpuOptionsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getGpuOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + public org.tensorflow.proto.GPUOptionsOrBuilder getGpuOptionsOrBuilder() { + if (gpuOptionsBuilder_ != null) { + return gpuOptionsBuilder_.getMessageOrBuilder(); + } else { + return gpuOptions_ == null ? + org.tensorflow.proto.GPUOptions.getDefaultInstance() : gpuOptions_; + } + } + /** + *
    +     * Options that apply to all GPUs.
    +     * 
    + * + * .tensorflow.GPUOptions gpu_options = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder> + getGpuOptionsFieldBuilder() { + if (gpuOptionsBuilder_ == null) { + gpuOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder>( + getGpuOptions(), + getParentForChildren(), + isClean()); + gpuOptions_ = null; + } + return gpuOptionsBuilder_; + } + + private org.tensorflow.proto.GPUOptions pluggableDeviceOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder> pluggableDeviceOptionsBuilder_; + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return Whether the pluggableDeviceOptions field is set. + */ + public boolean hasPluggableDeviceOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return The pluggableDeviceOptions. + */ + public org.tensorflow.proto.GPUOptions getPluggableDeviceOptions() { + if (pluggableDeviceOptionsBuilder_ == null) { + return pluggableDeviceOptions_ == null ? org.tensorflow.proto.GPUOptions.getDefaultInstance() : pluggableDeviceOptions_; + } else { + return pluggableDeviceOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public Builder setPluggableDeviceOptions(org.tensorflow.proto.GPUOptions value) { + if (pluggableDeviceOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pluggableDeviceOptions_ = value; + } else { + pluggableDeviceOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public Builder setPluggableDeviceOptions( + org.tensorflow.proto.GPUOptions.Builder builderForValue) { + if (pluggableDeviceOptionsBuilder_ == null) { + pluggableDeviceOptions_ = builderForValue.build(); + } else { + pluggableDeviceOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public Builder mergePluggableDeviceOptions(org.tensorflow.proto.GPUOptions value) { + if (pluggableDeviceOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + pluggableDeviceOptions_ != null && + pluggableDeviceOptions_ != org.tensorflow.proto.GPUOptions.getDefaultInstance()) { + getPluggableDeviceOptionsBuilder().mergeFrom(value); + } else { + pluggableDeviceOptions_ = value; + } + } else { + pluggableDeviceOptionsBuilder_.mergeFrom(value); + } + if (pluggableDeviceOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public Builder clearPluggableDeviceOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + pluggableDeviceOptions_ = null; + if (pluggableDeviceOptionsBuilder_ != null) { + pluggableDeviceOptionsBuilder_.dispose(); + pluggableDeviceOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public org.tensorflow.proto.GPUOptions.Builder getPluggableDeviceOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getPluggableDeviceOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + public org.tensorflow.proto.GPUOptionsOrBuilder getPluggableDeviceOptionsOrBuilder() { + if (pluggableDeviceOptionsBuilder_ != null) { + return pluggableDeviceOptionsBuilder_.getMessageOrBuilder(); + } else { + return pluggableDeviceOptions_ == null ? + org.tensorflow.proto.GPUOptions.getDefaultInstance() : pluggableDeviceOptions_; + } + } + /** + *
    +     * Options that apply to pluggable devices.
    +     * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder> + getPluggableDeviceOptionsFieldBuilder() { + if (pluggableDeviceOptionsBuilder_ == null) { + pluggableDeviceOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions, org.tensorflow.proto.GPUOptions.Builder, org.tensorflow.proto.GPUOptionsOrBuilder>( + getPluggableDeviceOptions(), + getParentForChildren(), + isClean()); + pluggableDeviceOptions_ = null; + } + return pluggableDeviceOptionsBuilder_; + } + + private boolean allowSoftPlacement_ ; + /** + *
    +     * Whether soft placement is allowed. If allow_soft_placement is true,
    +     * an op will be placed on CPU if
    +     * 1. there's no GPU implementation for the OP
    +     * or
    +     * 2. no GPU devices are known or registered
    +     * or
    +     * 3. need to co-locate with reftype input(s) which are from CPU.
    +     * 
    + * + * bool allow_soft_placement = 7; + * @return The allowSoftPlacement. + */ + @java.lang.Override + public boolean getAllowSoftPlacement() { + return allowSoftPlacement_; + } + /** + *
    +     * Whether soft placement is allowed. If allow_soft_placement is true,
    +     * an op will be placed on CPU if
    +     * 1. there's no GPU implementation for the OP
    +     * or
    +     * 2. no GPU devices are known or registered
    +     * or
    +     * 3. need to co-locate with reftype input(s) which are from CPU.
    +     * 
    + * + * bool allow_soft_placement = 7; + * @param value The allowSoftPlacement to set. + * @return This builder for chaining. + */ + public Builder setAllowSoftPlacement(boolean value) { + + allowSoftPlacement_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Whether soft placement is allowed. If allow_soft_placement is true,
    +     * an op will be placed on CPU if
    +     * 1. there's no GPU implementation for the OP
    +     * or
    +     * 2. no GPU devices are known or registered
    +     * or
    +     * 3. need to co-locate with reftype input(s) which are from CPU.
    +     * 
    + * + * bool allow_soft_placement = 7; + * @return This builder for chaining. + */ + public Builder clearAllowSoftPlacement() { + bitField0_ = (bitField0_ & ~0x00000200); + allowSoftPlacement_ = false; + onChanged(); + return this; + } + + private boolean logDevicePlacement_ ; + /** + *
    +     * Whether device placements should be logged.
    +     * 
    + * + * bool log_device_placement = 8; + * @return The logDevicePlacement. + */ + @java.lang.Override + public boolean getLogDevicePlacement() { + return logDevicePlacement_; + } + /** + *
    +     * Whether device placements should be logged.
    +     * 
    + * + * bool log_device_placement = 8; + * @param value The logDevicePlacement to set. + * @return This builder for chaining. + */ + public Builder setLogDevicePlacement(boolean value) { + + logDevicePlacement_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Whether device placements should be logged.
    +     * 
    + * + * bool log_device_placement = 8; + * @return This builder for chaining. + */ + public Builder clearLogDevicePlacement() { + bitField0_ = (bitField0_ & ~0x00000400); + logDevicePlacement_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.GraphOptions graphOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOptions, org.tensorflow.proto.GraphOptions.Builder, org.tensorflow.proto.GraphOptionsOrBuilder> graphOptionsBuilder_; + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + * @return Whether the graphOptions field is set. + */ + public boolean hasGraphOptions() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + * @return The graphOptions. + */ + public org.tensorflow.proto.GraphOptions getGraphOptions() { + if (graphOptionsBuilder_ == null) { + return graphOptions_ == null ? org.tensorflow.proto.GraphOptions.getDefaultInstance() : graphOptions_; + } else { + return graphOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public Builder setGraphOptions(org.tensorflow.proto.GraphOptions value) { + if (graphOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + graphOptions_ = value; + } else { + graphOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public Builder setGraphOptions( + org.tensorflow.proto.GraphOptions.Builder builderForValue) { + if (graphOptionsBuilder_ == null) { + graphOptions_ = builderForValue.build(); + } else { + graphOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public Builder mergeGraphOptions(org.tensorflow.proto.GraphOptions value) { + if (graphOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) && + graphOptions_ != null && + graphOptions_ != org.tensorflow.proto.GraphOptions.getDefaultInstance()) { + getGraphOptionsBuilder().mergeFrom(value); + } else { + graphOptions_ = value; + } + } else { + graphOptionsBuilder_.mergeFrom(value); + } + if (graphOptions_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public Builder clearGraphOptions() { + bitField0_ = (bitField0_ & ~0x00000800); + graphOptions_ = null; + if (graphOptionsBuilder_ != null) { + graphOptionsBuilder_.dispose(); + graphOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public org.tensorflow.proto.GraphOptions.Builder getGraphOptionsBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getGraphOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + public org.tensorflow.proto.GraphOptionsOrBuilder getGraphOptionsOrBuilder() { + if (graphOptionsBuilder_ != null) { + return graphOptionsBuilder_.getMessageOrBuilder(); + } else { + return graphOptions_ == null ? + org.tensorflow.proto.GraphOptions.getDefaultInstance() : graphOptions_; + } + } + /** + *
    +     * Options that apply to all graphs.
    +     * 
    + * + * .tensorflow.GraphOptions graph_options = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOptions, org.tensorflow.proto.GraphOptions.Builder, org.tensorflow.proto.GraphOptionsOrBuilder> + getGraphOptionsFieldBuilder() { + if (graphOptionsBuilder_ == null) { + graphOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOptions, org.tensorflow.proto.GraphOptions.Builder, org.tensorflow.proto.GraphOptionsOrBuilder>( + getGraphOptions(), + getParentForChildren(), + isClean()); + graphOptions_ = null; + } + return graphOptionsBuilder_; + } + + private long operationTimeoutInMs_ ; + /** + *
    +     * Global timeout for all blocking operations in this session.  If non-zero,
    +     * and not overridden on a per-operation basis, this value will be used as the
    +     * deadline for all blocking operations.
    +     * 
    + * + * int64 operation_timeout_in_ms = 11; + * @return The operationTimeoutInMs. + */ + @java.lang.Override + public long getOperationTimeoutInMs() { + return operationTimeoutInMs_; + } + /** + *
    +     * Global timeout for all blocking operations in this session.  If non-zero,
    +     * and not overridden on a per-operation basis, this value will be used as the
    +     * deadline for all blocking operations.
    +     * 
    + * + * int64 operation_timeout_in_ms = 11; + * @param value The operationTimeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setOperationTimeoutInMs(long value) { + + operationTimeoutInMs_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * Global timeout for all blocking operations in this session.  If non-zero,
    +     * and not overridden on a per-operation basis, this value will be used as the
    +     * deadline for all blocking operations.
    +     * 
    + * + * int64 operation_timeout_in_ms = 11; + * @return This builder for chaining. + */ + public Builder clearOperationTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00001000); + operationTimeoutInMs_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.RpcOptions.RPCOptions rpcOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RpcOptions.RPCOptions, org.tensorflow.proto.RpcOptions.RPCOptions.Builder, org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder> rpcOptionsBuilder_; + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + * @return Whether the rpcOptions field is set. + */ + public boolean hasRpcOptions() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + * @return The rpcOptions. + */ + public org.tensorflow.proto.RpcOptions.RPCOptions getRpcOptions() { + if (rpcOptionsBuilder_ == null) { + return rpcOptions_ == null ? org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance() : rpcOptions_; + } else { + return rpcOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public Builder setRpcOptions(org.tensorflow.proto.RpcOptions.RPCOptions value) { + if (rpcOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rpcOptions_ = value; + } else { + rpcOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public Builder setRpcOptions( + org.tensorflow.proto.RpcOptions.RPCOptions.Builder builderForValue) { + if (rpcOptionsBuilder_ == null) { + rpcOptions_ = builderForValue.build(); + } else { + rpcOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public Builder mergeRpcOptions(org.tensorflow.proto.RpcOptions.RPCOptions value) { + if (rpcOptionsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + rpcOptions_ != null && + rpcOptions_ != org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance()) { + getRpcOptionsBuilder().mergeFrom(value); + } else { + rpcOptions_ = value; + } + } else { + rpcOptionsBuilder_.mergeFrom(value); + } + if (rpcOptions_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public Builder clearRpcOptions() { + bitField0_ = (bitField0_ & ~0x00002000); + rpcOptions_ = null; + if (rpcOptionsBuilder_ != null) { + rpcOptionsBuilder_.dispose(); + rpcOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public org.tensorflow.proto.RpcOptions.RPCOptions.Builder getRpcOptionsBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getRpcOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + public org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder getRpcOptionsOrBuilder() { + if (rpcOptionsBuilder_ != null) { + return rpcOptionsBuilder_.getMessageOrBuilder(); + } else { + return rpcOptions_ == null ? + org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance() : rpcOptions_; + } + } + /** + *
    +     * Options that apply when this session uses the distributed runtime.
    +     * 
    + * + * .tensorflow.RPCOptions rpc_options = 13; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RpcOptions.RPCOptions, org.tensorflow.proto.RpcOptions.RPCOptions.Builder, org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder> + getRpcOptionsFieldBuilder() { + if (rpcOptionsBuilder_ == null) { + rpcOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RpcOptions.RPCOptions, org.tensorflow.proto.RpcOptions.RPCOptions.Builder, org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder>( + getRpcOptions(), + getParentForChildren(), + isClean()); + rpcOptions_ = null; + } + return rpcOptionsBuilder_; + } + + private org.tensorflow.proto.ClusterDef clusterDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder> clusterDefBuilder_; + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + * @return Whether the clusterDef field is set. + */ + public boolean hasClusterDef() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + * @return The clusterDef. + */ + public org.tensorflow.proto.ClusterDef getClusterDef() { + if (clusterDefBuilder_ == null) { + return clusterDef_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : clusterDef_; + } else { + return clusterDefBuilder_.getMessage(); + } + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public Builder setClusterDef(org.tensorflow.proto.ClusterDef value) { + if (clusterDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterDef_ = value; + } else { + clusterDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public Builder setClusterDef( + org.tensorflow.proto.ClusterDef.Builder builderForValue) { + if (clusterDefBuilder_ == null) { + clusterDef_ = builderForValue.build(); + } else { + clusterDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public Builder mergeClusterDef(org.tensorflow.proto.ClusterDef value) { + if (clusterDefBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0) && + clusterDef_ != null && + clusterDef_ != org.tensorflow.proto.ClusterDef.getDefaultInstance()) { + getClusterDefBuilder().mergeFrom(value); + } else { + clusterDef_ = value; + } + } else { + clusterDefBuilder_.mergeFrom(value); + } + if (clusterDef_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } + return this; + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public Builder clearClusterDef() { + bitField0_ = (bitField0_ & ~0x00004000); + clusterDef_ = null; + if (clusterDefBuilder_ != null) { + clusterDefBuilder_.dispose(); + clusterDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public org.tensorflow.proto.ClusterDef.Builder getClusterDefBuilder() { + bitField0_ |= 0x00004000; + onChanged(); + return getClusterDefFieldBuilder().getBuilder(); + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + public org.tensorflow.proto.ClusterDefOrBuilder getClusterDefOrBuilder() { + if (clusterDefBuilder_ != null) { + return clusterDefBuilder_.getMessageOrBuilder(); + } else { + return clusterDef_ == null ? + org.tensorflow.proto.ClusterDef.getDefaultInstance() : clusterDef_; + } + } + /** + *
    +     * Optional list of all workers to use in this session.
    +     * 
    + * + * .tensorflow.ClusterDef cluster_def = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder> + getClusterDefFieldBuilder() { + if (clusterDefBuilder_ == null) { + clusterDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder>( + getClusterDef(), + getParentForChildren(), + isClean()); + clusterDef_ = null; + } + return clusterDefBuilder_; + } + + private boolean isolateSessionState_ ; + /** + *
    +     * If true, any resources such as Variables used in the session will not be
    +     * shared with other sessions. However, when clusterspec propagation is
    +     * enabled, this field is ignored and sessions are always isolated.
    +     * 
    + * + * bool isolate_session_state = 15; + * @return The isolateSessionState. + */ + @java.lang.Override + public boolean getIsolateSessionState() { + return isolateSessionState_; + } + /** + *
    +     * If true, any resources such as Variables used in the session will not be
    +     * shared with other sessions. However, when clusterspec propagation is
    +     * enabled, this field is ignored and sessions are always isolated.
    +     * 
    + * + * bool isolate_session_state = 15; + * @param value The isolateSessionState to set. + * @return This builder for chaining. + */ + public Builder setIsolateSessionState(boolean value) { + + isolateSessionState_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +     * If true, any resources such as Variables used in the session will not be
    +     * shared with other sessions. However, when clusterspec propagation is
    +     * enabled, this field is ignored and sessions are always isolated.
    +     * 
    + * + * bool isolate_session_state = 15; + * @return This builder for chaining. + */ + public Builder clearIsolateSessionState() { + bitField0_ = (bitField0_ & ~0x00008000); + isolateSessionState_ = false; + onChanged(); + return this; + } + + private boolean shareClusterDevicesInSession_ ; + /** + *
    +     * When true, WorkerSessions are created with device attributes from the
    +     * full cluster.
    +     * This is helpful when a worker wants to partition a graph
    +     * (for example during a PartitionedCallOp).
    +     * 
    + * + * bool share_cluster_devices_in_session = 17; + * @return The shareClusterDevicesInSession. + */ + @java.lang.Override + public boolean getShareClusterDevicesInSession() { + return shareClusterDevicesInSession_; + } + /** + *
    +     * When true, WorkerSessions are created with device attributes from the
    +     * full cluster.
    +     * This is helpful when a worker wants to partition a graph
    +     * (for example during a PartitionedCallOp).
    +     * 
    + * + * bool share_cluster_devices_in_session = 17; + * @param value The shareClusterDevicesInSession to set. + * @return This builder for chaining. + */ + public Builder setShareClusterDevicesInSession(boolean value) { + + shareClusterDevicesInSession_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +     * When true, WorkerSessions are created with device attributes from the
    +     * full cluster.
    +     * This is helpful when a worker wants to partition a graph
    +     * (for example during a PartitionedCallOp).
    +     * 
    + * + * bool share_cluster_devices_in_session = 17; + * @return This builder for chaining. + */ + public Builder clearShareClusterDevicesInSession() { + bitField0_ = (bitField0_ & ~0x00010000); + shareClusterDevicesInSession_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.ConfigProto.Experimental experimental_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto.Experimental, org.tensorflow.proto.ConfigProto.Experimental.Builder, org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder> experimentalBuilder_; + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return Whether the experimental field is set. + */ + public boolean hasExperimental() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return The experimental. + */ + public org.tensorflow.proto.ConfigProto.Experimental getExperimental() { + if (experimentalBuilder_ == null) { + return experimental_ == null ? org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance() : experimental_; + } else { + return experimentalBuilder_.getMessage(); + } + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public Builder setExperimental(org.tensorflow.proto.ConfigProto.Experimental value) { + if (experimentalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimental_ = value; + } else { + experimentalBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public Builder setExperimental( + org.tensorflow.proto.ConfigProto.Experimental.Builder builderForValue) { + if (experimentalBuilder_ == null) { + experimental_ = builderForValue.build(); + } else { + experimentalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public Builder mergeExperimental(org.tensorflow.proto.ConfigProto.Experimental value) { + if (experimentalBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) && + experimental_ != null && + experimental_ != org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance()) { + getExperimentalBuilder().mergeFrom(value); + } else { + experimental_ = value; + } + } else { + experimentalBuilder_.mergeFrom(value); + } + if (experimental_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public Builder clearExperimental() { + bitField0_ = (bitField0_ & ~0x00020000); + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public org.tensorflow.proto.ConfigProto.Experimental.Builder getExperimentalBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getExperimentalFieldBuilder().getBuilder(); + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + public org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder() { + if (experimentalBuilder_ != null) { + return experimentalBuilder_.getMessageOrBuilder(); + } else { + return experimental_ == null ? + org.tensorflow.proto.ConfigProto.Experimental.getDefaultInstance() : experimental_; + } + } + /** + * .tensorflow.ConfigProto.Experimental experimental = 16; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto.Experimental, org.tensorflow.proto.ConfigProto.Experimental.Builder, org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder> + getExperimentalFieldBuilder() { + if (experimentalBuilder_ == null) { + experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto.Experimental, org.tensorflow.proto.ConfigProto.Experimental.Builder, org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder>( + getExperimental(), + getParentForChildren(), + isClean()); + experimental_ = null; + } + return experimentalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ConfigProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ConfigProto) + private static final org.tensorflow.proto.ConfigProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ConfigProto(); + } + + public static org.tensorflow.proto.ConfigProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfigProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ConfigProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtoOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtoOrBuilder.java index 3b83aa99dea..915822fff06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ConfigProtoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface ConfigProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.ConfigProto) @@ -58,7 +60,6 @@ boolean containsDeviceCount( * * map<string, int32> device_count = 1; */ - int getDeviceCountOrDefault( java.lang.String key, int defaultValue); @@ -72,7 +73,6 @@ int getDeviceCountOrDefault( * * map<string, int32> device_count = 1; */ - int getDeviceCountOrThrow( java.lang.String key); @@ -81,18 +81,21 @@ int getDeviceCountOrThrow( * The execution of an individual op (for some op types) can be * parallelized on a pool of intra_op_parallelism_threads. * 0 means the system picks an appropriate number. + * * If you create an ordinary session, e.g., from Python or C++, * then there is exactly one intra op thread pool per process. * The first session created determines the number of threads in this pool. * All subsequent sessions reuse/share this one global pool. + * * There are notable exceptions to the default behavior described above: * 1. There is an environment variable for overriding this thread pool, - * named TF_OVERRIDE_GLOBAL_THREADPOOL. + * named TF_OVERRIDE_GLOBAL_THREADPOOL. * 2. When connecting to a server, such as a remote `tf.train.Server` - * instance, then this option will be ignored altogether. + * instance, then this option will be ignored altogether. *
    * * int32 intra_op_parallelism_threads = 2; + * @return The intraOpParallelismThreads. */ int getIntraOpParallelismThreads(); @@ -100,14 +103,17 @@ int getDeviceCountOrThrow( *
        * Nodes that perform blocking operations are enqueued on a pool of
        * inter_op_parallelism_threads available in each process.
    +   *
        * 0 means the system picks an appropriate number.
        * Negative means all operations are performed in caller's thread.
    +   *
        * Note that the first Session created in the process sets the
        * number of threads for all future sessions unless use_per_session_threads is
        * true or session_inter_op_thread_pool is configured.
        * 
    * * int32 inter_op_parallelism_threads = 5; + * @return The interOpParallelismThreads. */ int getInterOpParallelismThreads(); @@ -115,14 +121,17 @@ int getDeviceCountOrThrow( *
        * If true, use a new set of threads for this session rather than the global
        * pool of threads. Only supported by direct sessions.
    +   *
        * If false, use the global threads created by the first session, or the
        * per-session thread pools configured by session_inter_op_thread_pool.
    +   *
        * This option is deprecated. The same effect can be achieved by setting
        * session_inter_op_thread_pool to have one element, whose num_threads equals
        * inter_op_parallelism_threads.
        * 
    * * bool use_per_session_threads = 9; + * @return The usePerSessionThreads. */ boolean getUsePerSessionThreads(); @@ -130,8 +139,10 @@ int getDeviceCountOrThrow( *
        * This option is experimental - it may be replaced with a different mechanism
        * in the future.
    +   *
        * Configures session thread pools. If this is configured, then RunOptions for
        * a Run call can select the thread pool to use.
    +   *
        * The intended use is for when some session invocations need to run in a
        * background pool limited to a small number of threads:
        * - For example, a session may be configured to have one large pool (for
    @@ -149,14 +160,16 @@ int getDeviceCountOrThrow(
        *
        * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12;
        */
    -  java.util.List 
    +  java.util.List 
           getSessionInterOpThreadPoolList();
       /**
        * 
        * This option is experimental - it may be replaced with a different mechanism
        * in the future.
    +   *
        * Configures session thread pools. If this is configured, then RunOptions for
        * a Run call can select the thread pool to use.
    +   *
        * The intended use is for when some session invocations need to run in a
        * background pool limited to a small number of threads:
        * - For example, a session may be configured to have one large pool (for
    @@ -174,13 +187,15 @@ int getDeviceCountOrThrow(
        *
        * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12;
        */
    -  org.tensorflow.proto.framework.ThreadPoolOptionProto getSessionInterOpThreadPool(int index);
    +  org.tensorflow.proto.ThreadPoolOptionProto getSessionInterOpThreadPool(int index);
       /**
        * 
        * This option is experimental - it may be replaced with a different mechanism
        * in the future.
    +   *
        * Configures session thread pools. If this is configured, then RunOptions for
        * a Run call can select the thread pool to use.
    +   *
        * The intended use is for when some session invocations need to run in a
        * background pool limited to a small number of threads:
        * - For example, a session may be configured to have one large pool (for
    @@ -203,8 +218,10 @@ int getDeviceCountOrThrow(
        * 
        * This option is experimental - it may be replaced with a different mechanism
        * in the future.
    +   *
        * Configures session thread pools. If this is configured, then RunOptions for
        * a Run call can select the thread pool to use.
    +   *
        * The intended use is for when some session invocations need to run in a
        * background pool limited to a small number of threads:
        * - For example, a session may be configured to have one large pool (for
    @@ -222,14 +239,16 @@ int getDeviceCountOrThrow(
        *
        * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12;
        */
    -  java.util.List 
    +  java.util.List 
           getSessionInterOpThreadPoolOrBuilderList();
       /**
        * 
        * This option is experimental - it may be replaced with a different mechanism
        * in the future.
    +   *
        * Configures session thread pools. If this is configured, then RunOptions for
        * a Run call can select the thread pool to use.
    +   *
        * The intended use is for when some session invocations need to run in a
        * background pool limited to a small number of threads:
        * - For example, a session may be configured to have one large pool (for
    @@ -247,7 +266,7 @@ int getDeviceCountOrThrow(
        *
        * repeated .tensorflow.ThreadPoolOptionProto session_inter_op_thread_pool = 12;
        */
    -  org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder(
    +  org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder getSessionInterOpThreadPoolOrBuilder(
           int index);
     
       /**
    @@ -258,6 +277,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        * 
    * * int32 placement_period = 3; + * @return The placementPeriod. */ int getPlacementPeriod(); @@ -269,6 +289,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * repeated string device_filters = 4; + * @return A list containing the deviceFilters. */ java.util.List getDeviceFiltersList(); @@ -280,6 +301,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * repeated string device_filters = 4; + * @return The count of deviceFilters. */ int getDeviceFiltersCount(); /** @@ -290,6 +312,8 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * repeated string device_filters = 4; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. */ java.lang.String getDeviceFilters(int index); /** @@ -300,6 +324,8 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * repeated string device_filters = 4; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. */ com.google.protobuf.ByteString getDeviceFiltersBytes(int index); @@ -310,6 +336,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.GPUOptions gpu_options = 6; + * @return Whether the gpuOptions field is set. */ boolean hasGpuOptions(); /** @@ -318,8 +345,9 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.GPUOptions gpu_options = 6; + * @return The gpuOptions. */ - org.tensorflow.proto.framework.GPUOptions getGpuOptions(); + org.tensorflow.proto.GPUOptions getGpuOptions(); /** *
        * Options that apply to all GPUs.
    @@ -327,20 +355,48 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        *
        * .tensorflow.GPUOptions gpu_options = 6;
        */
    -  org.tensorflow.proto.framework.GPUOptionsOrBuilder getGpuOptionsOrBuilder();
    +  org.tensorflow.proto.GPUOptionsOrBuilder getGpuOptionsOrBuilder();
    +
    +  /**
    +   * 
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return Whether the pluggableDeviceOptions field is set. + */ + boolean hasPluggableDeviceOptions(); + /** + *
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + * @return The pluggableDeviceOptions. + */ + org.tensorflow.proto.GPUOptions getPluggableDeviceOptions(); + /** + *
    +   * Options that apply to pluggable devices.
    +   * 
    + * + * .tensorflow.GPUOptions pluggable_device_options = 18; + */ + org.tensorflow.proto.GPUOptionsOrBuilder getPluggableDeviceOptionsOrBuilder(); /** *
        * Whether soft placement is allowed. If allow_soft_placement is true,
        * an op will be placed on CPU if
    -   *   1. there's no GPU implementation for the OP
    +   * 1. there's no GPU implementation for the OP
        * or
    -   *   2. no GPU devices are known or registered
    +   * 2. no GPU devices are known or registered
        * or
    -   *   3. need to co-locate with reftype input(s) which are from CPU.
    +   * 3. need to co-locate with reftype input(s) which are from CPU.
        * 
    * * bool allow_soft_placement = 7; + * @return The allowSoftPlacement. */ boolean getAllowSoftPlacement(); @@ -350,6 +406,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * bool log_device_placement = 8; + * @return The logDevicePlacement. */ boolean getLogDevicePlacement(); @@ -359,6 +416,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.GraphOptions graph_options = 10; + * @return Whether the graphOptions field is set. */ boolean hasGraphOptions(); /** @@ -367,8 +425,9 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.GraphOptions graph_options = 10; + * @return The graphOptions. */ - org.tensorflow.proto.framework.GraphOptions getGraphOptions(); + org.tensorflow.proto.GraphOptions getGraphOptions(); /** *
        * Options that apply to all graphs.
    @@ -376,7 +435,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        *
        * .tensorflow.GraphOptions graph_options = 10;
        */
    -  org.tensorflow.proto.framework.GraphOptionsOrBuilder getGraphOptionsOrBuilder();
    +  org.tensorflow.proto.GraphOptionsOrBuilder getGraphOptionsOrBuilder();
     
       /**
        * 
    @@ -386,6 +445,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        * 
    * * int64 operation_timeout_in_ms = 11; + * @return The operationTimeoutInMs. */ long getOperationTimeoutInMs(); @@ -395,6 +455,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.RPCOptions rpc_options = 13; + * @return Whether the rpcOptions field is set. */ boolean hasRpcOptions(); /** @@ -403,8 +464,9 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT * * * .tensorflow.RPCOptions rpc_options = 13; + * @return The rpcOptions. */ - org.tensorflow.proto.framework.RPCOptions getRpcOptions(); + org.tensorflow.proto.RpcOptions.RPCOptions getRpcOptions(); /** *
        * Options that apply when this session uses the distributed runtime.
    @@ -412,7 +474,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        *
        * .tensorflow.RPCOptions rpc_options = 13;
        */
    -  org.tensorflow.proto.framework.RPCOptionsOrBuilder getRpcOptionsOrBuilder();
    +  org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder getRpcOptionsOrBuilder();
     
       /**
        * 
    @@ -420,6 +482,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        * 
    * * .tensorflow.ClusterDef cluster_def = 14; + * @return Whether the clusterDef field is set. */ boolean hasClusterDef(); /** @@ -428,8 +491,9 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * .tensorflow.ClusterDef cluster_def = 14; + * @return The clusterDef. */ - org.tensorflow.proto.distruntime.ClusterDef getClusterDef(); + org.tensorflow.proto.ClusterDef getClusterDef(); /** *
        * Optional list of all workers to use in this session.
    @@ -437,7 +501,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        *
        * .tensorflow.ClusterDef cluster_def = 14;
        */
    -  org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterDefOrBuilder();
    +  org.tensorflow.proto.ClusterDefOrBuilder getClusterDefOrBuilder();
     
       /**
        * 
    @@ -447,6 +511,7 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT
        * 
    * * bool isolate_session_state = 15; + * @return The isolateSessionState. */ boolean getIsolateSessionState(); @@ -459,19 +524,22 @@ org.tensorflow.proto.framework.ThreadPoolOptionProtoOrBuilder getSessionInterOpT *
    * * bool share_cluster_devices_in_session = 17; + * @return The shareClusterDevicesInSession. */ boolean getShareClusterDevicesInSession(); /** * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return Whether the experimental field is set. */ boolean hasExperimental(); /** * .tensorflow.ConfigProto.Experimental experimental = 16; + * @return The experimental. */ - org.tensorflow.proto.framework.ConfigProto.Experimental getExperimental(); + org.tensorflow.proto.ConfigProto.Experimental getExperimental(); /** * .tensorflow.ConfigProto.Experimental experimental = 16; */ - org.tensorflow.proto.framework.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder(); + org.tensorflow.proto.ConfigProto.ExperimentalOrBuilder getExperimentalOrBuilder(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtos.java new file mode 100644 index 00000000000..63e85085fa7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ConfigProtos.java @@ -0,0 +1,460 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ConfigProtos { + private ConfigProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ConfigProtos.class.getName()); + } + 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_GPUOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GPUOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GPUOptions_Experimental_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OptimizerOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OptimizerOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ThreadPoolOptionProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SessionMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SessionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ConfigProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ConfigProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ConfigProto_DeviceCountEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ConfigProto_Experimental_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RunOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RunOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RunOptions_Experimental_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RunMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RunMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorConnection_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CallableOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CallableOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CallableOptions_FeedDevicesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CallableOptions_FetchDevicesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_BatchingOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_BatchingOptions_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/config.proto\022" + + "\ntensorflow\032*xla/tsl/protobuf/coordinati" + + "on_config.proto\032*tensorflow/core/framewo" + + "rk/cost_graph.proto\032%tensorflow/core/fra" + + "mework/graph.proto\032*tensorflow/core/fram" + + "ework/step_stats.proto\032&tensorflow/core/" + + "protobuf/cluster.proto\032$tensorflow/core/" + + "protobuf/debug.proto\032.tensorflow/core/pr" + + "otobuf/rewriter_config.proto\032*tensorflow" + + "/core/protobuf/rpc_options.proto\"\211\n\n\nGPU" + + "Options\022\'\n\037per_process_gpu_memory_fracti" + + "on\030\001 \001(\001\022\024\n\014allow_growth\030\004 \001(\010\022\026\n\016alloca" + + "tor_type\030\002 \001(\t\022\037\n\027deferred_deletion_byte" + + "s\030\003 \001(\003\022\033\n\023visible_device_list\030\005 \001(\t\022\"\n\032" + + "polling_active_delay_usecs\030\006 \001(\005\022$\n\034poll" + + "ing_inactive_delay_msecs\030\007 \001(\005\022\034\n\024force_" + + "gpu_compatible\030\010 \001(\010\0229\n\014experimental\030\t \001" + + "(\0132#.tensorflow.GPUOptions.Experimental\032" + + "\302\007\n\014Experimental\022K\n\017virtual_devices\030\001 \003(" + + "\01322.tensorflow.GPUOptions.Experimental.V" + + "irtualDevices\022#\n\033num_virtual_devices_per" + + "_gpu\030\017 \001(\005\022\032\n\022use_unified_memory\030\002 \001(\010\022#" + + "\n\033num_dev_to_dev_copy_streams\030\003 \001(\005\022\035\n\025c" + + "ollective_ring_order\030\004 \001(\t\022\035\n\025timestampe" + + "d_allocator\030\005 \001(\010\022#\n\033kernel_tracker_max_" + + "interval\030\007 \001(\005\022 \n\030kernel_tracker_max_byt" + + "es\030\010 \001(\005\022\"\n\032kernel_tracker_max_pending\030\t" + + " \001(\005\022\'\n\037internal_fragmentation_fraction\030" + + "\n \001(\001\022\035\n\025use_cuda_malloc_async\030\013 \001(\010\022,\n$" + + "disallow_retry_on_allocation_failure\030\014 \001" + + "(\010\022 \n\030gpu_host_mem_limit_in_mb\030\r \001(\002\022$\n\034" + + "gpu_host_mem_disallow_growth\030\016 \001(\010\022$\n\034gp" + + "u_system_memory_size_in_mb\030\020 \001(\005\022.\n&popu" + + "late_pjrt_gpu_client_creation_info\030\021 \001(\010" + + "\022\017\n\007node_id\030\022 \001(\005\022T\n\024stream_merge_option" + + "s\030\023 \001(\01326.tensorflow.GPUOptions.Experime" + + "ntal.StreamMergeOptions\032S\n\016VirtualDevice" + + "s\022\027\n\017memory_limit_mb\030\001 \003(\002\022\020\n\010priority\030\002" + + " \003(\005\022\026\n\016device_ordinal\030\003 \003(\005\032\205\001\n\022StreamM" + + "ergeOptions\022#\n\033merge_host_to_device_stre" + + "am\030\001 \001(\010\022#\n\033merge_device_to_host_stream\030" + + "\002 \001(\010\022%\n\035merge_device_to_device_stream\030\003" + + " \001(\010\"\235\003\n\020OptimizerOptions\022+\n#do_common_s" + + "ubexpression_elimination\030\001 \001(\010\022\033\n\023do_con" + + "stant_folding\030\002 \001(\010\022$\n\034max_folded_consta" + + "nt_in_bytes\030\006 \001(\003\022\034\n\024do_function_inlinin" + + "g\030\004 \001(\010\0225\n\topt_level\030\003 \001(\0162\".tensorflow." + + "OptimizerOptions.Level\022E\n\020global_jit_lev" + + "el\030\005 \001(\0162+.tensorflow.OptimizerOptions.G" + + "lobalJitLevel\022\026\n\016cpu_global_jit\030\007 \001(\010\" \n" + + "\005Level\022\006\n\002L1\020\000\022\017\n\002L0\020\377\377\377\377\377\377\377\377\377\001\"C\n\016Globa" + + "lJitLevel\022\013\n\007DEFAULT\020\000\022\020\n\003OFF\020\377\377\377\377\377\377\377\377\377\001" + + "\022\010\n\004ON_1\020\001\022\010\n\004ON_2\020\002\"\356\002\n\014GraphOptions\022\036\n" + + "\026enable_recv_scheduling\030\002 \001(\010\0227\n\021optimiz" + + "er_options\030\003 \001(\0132\034.tensorflow.OptimizerO" + + "ptions\022\030\n\020build_cost_model\030\004 \001(\003\022\036\n\026buil" + + "d_cost_model_after\030\t \001(\003\022\024\n\014infer_shapes" + + "\030\005 \001(\010\022\032\n\022place_pruned_graph\030\006 \001(\010\022 \n\030en" + + "able_bfloat16_sendrecv\030\007 \001(\010\022\025\n\rtimeline" + + "_step\030\010 \001(\005\0223\n\017rewrite_options\030\n \001(\0132\032.t" + + "ensorflow.RewriterConfigJ\004\010\001\020\002R%skip_com" + + "mon_subexpression_elimination\"A\n\025ThreadP" + + "oolOptionProto\022\023\n\013num_threads\030\001 \001(\005\022\023\n\013g" + + "lobal_name\030\002 \001(\t\"0\n\017SessionMetadata\022\014\n\004n" + + "ame\030\001 \001(\t\022\017\n\007version\030\002 \001(\003\"\264\021\n\013ConfigPro" + + "to\022>\n\014device_count\030\001 \003(\0132(.tensorflow.Co" + + "nfigProto.DeviceCountEntry\022$\n\034intra_op_p" + + "arallelism_threads\030\002 \001(\005\022$\n\034inter_op_par" + + "allelism_threads\030\005 \001(\005\022\037\n\027use_per_sessio" + + "n_threads\030\t \001(\010\022G\n\034session_inter_op_thre" + + "ad_pool\030\014 \003(\0132!.tensorflow.ThreadPoolOpt" + + "ionProto\022\030\n\020placement_period\030\003 \001(\005\022\026\n\016de" + + "vice_filters\030\004 \003(\t\022+\n\013gpu_options\030\006 \001(\0132" + + "\026.tensorflow.GPUOptions\0228\n\030pluggable_dev" + + "ice_options\030\022 \001(\0132\026.tensorflow.GPUOption" + + "s\022\034\n\024allow_soft_placement\030\007 \001(\010\022\034\n\024log_d" + + "evice_placement\030\010 \001(\010\022/\n\rgraph_options\030\n" + + " \001(\0132\030.tensorflow.GraphOptions\022\037\n\027operat" + + "ion_timeout_in_ms\030\013 \001(\003\022+\n\013rpc_options\030\r" + + " \001(\0132\026.tensorflow.RPCOptions\022+\n\013cluster_" + + "def\030\016 \001(\0132\026.tensorflow.ClusterDef\022\035\n\025iso" + + "late_session_state\030\017 \001(\010\022(\n share_cluste" + + "r_devices_in_session\030\021 \001(\010\022:\n\014experiment" + + "al\030\020 \001(\0132$.tensorflow.ConfigProto.Experi" + + "mental\0322\n\020DeviceCountEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\005:\0028\001\032\364\n\n\014Experimental\022\037\n\027c" + + "ollective_group_leader\030\001 \001(\t\022\025\n\rexecutor" + + "_type\030\003 \001(\t\022\032\n\022recv_buf_max_chunk\030\004 \001(\005\022" + + "\031\n\021use_numa_affinity\030\005 \001(\010\0225\n-collective" + + "_deterministic_sequential_execution\030\006 \001(" + + "\010\022\027\n\017collective_nccl\030\007 \001(\010\0226\n.share_sess" + + "ion_state_in_clusterspec_propagation\030\010 \001" + + "(\010\022\037\n\027disable_thread_spinning\030\t \001(\010\022(\n s" + + "hare_cluster_devices_in_session\030\n \001(\010\0225\n" + + "\020session_metadata\030\013 \001(\0132\033.tensorflow.Ses" + + "sionMetadata\022!\n\031optimize_for_static_grap" + + "h\030\014 \001(\010\022\032\n\022enable_mlir_bridge\030\r \001(\010\022S\n\023m" + + "lir_bridge_rollout\030\021 \001(\01626.tensorflow.Co" + + "nfigProto.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\022\020" + + "\n\010use_tfrt\030\022 \001(\010\022\031\n\021enable_multi_host\030\033 " + + "\001(\010\022\025\n\rtfrt_use_ifrt\030 \001(\010\022\033\n\023backend_se" + + "rver_port\030\034 \001(\005\022\022\n\ntarget_tpu\030\035 \001(\010\022\022\n\nt" + + "arget_gpu\030\036 \001(\010\022\036\n\026stream_merge_threshol" + + "d\030\037 \001(\005\022\'\n\037disable_functional_ops_loweri" + + "ng\030\025 \001(\010\022\'\n\037xla_prefer_single_graph_clus" + + "ter\030\026 \001(\010\022B\n\023coordination_config\030\027 \001(\0132%" + + ".tensorflow.CoordinationServiceConfig\022)\n" + + "!disable_optimize_for_static_graph\030\030 \001(\010" + + "\0220\n(disable_eager_executor_streaming_enq" + + "ueue\030\032 \001(\010\022)\n!finalize_function_library_" + + "runtime\030! \001(\010\022!\n\031finalize_resource_manag" + + "er\030\" \001(\010\"\336\001\n\021MlirBridgeRollout\022#\n\037MLIR_B" + + "RIDGE_ROLLOUT_UNSPECIFIED\020\000\022\037\n\033MLIR_BRID" + + "GE_ROLLOUT_ENABLED\020\001\022 \n\034MLIR_BRIDGE_ROLL" + + "OUT_DISABLED\020\002\"\004\010\003\020\003\"\004\010\004\020\004*%MLIR_BRIDGE_" + + "ROLLOUT_SAFE_MODE_ENABLED*.MLIR_BRIDGE_R" + + "OLLOUT_SAFE_MODE_FALLBACK_ENABLEDJ\004\010\002\020\003J" + + "\004\010\023\020\024J\004\010\024\020\025J\004\010\031\020\032\"\341\004\n\nRunOptions\0226\n\013trac" + + "e_level\030\001 \001(\0162!.tensorflow.RunOptions.Tr" + + "aceLevel\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_partitio" + + "n_graphs\030\005 \001(\010\022/\n\rdebug_options\030\006 \001(\0132\030." + + "tensorflow.DebugOptions\022*\n\"report_tensor" + + "_allocations_upon_oom\030\007 \001(\010\0229\n\014experimen" + + "tal\030\010 \001(\0132#.tensorflow.RunOptions.Experi" + + "mental\032\322\001\n\014Experimental\022\034\n\024collective_gr" + + "aph_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.RunHa" + + "ndlerPoolOptions\032)\n\025RunHandlerPoolOption" + + "s\022\020\n\010priority\030\001 \001(\003\"R\n\nTraceLevel\022\014\n\010NO_" + + "TRACE\020\000\022\022\n\016SOFTWARE_TRACE\020\001\022\022\n\016HARDWARE_" + + "TRACE\020\002\022\016\n\nFULL_TRACE\020\003J\004\010\004\020\005\"\276\003\n\013RunMet" + + "adata\022)\n\nstep_stats\030\001 \001(\0132\025.tensorflow.S" + + "tepStats\022,\n\ncost_graph\030\002 \001(\0132\030.tensorflo" + + "w.CostGraphDef\022.\n\020partition_graphs\030\003 \003(\013" + + "2\024.tensorflow.GraphDef\022?\n\017function_graph" + + "s\030\004 \003(\0132&.tensorflow.RunMetadata.Functio" + + "nGraphs\0225\n\020session_metadata\030\005 \001(\0132\033.tens" + + "orflow.SessionMetadata\032\255\001\n\016FunctionGraph" + + "s\022.\n\020partition_graphs\030\001 \003(\0132\024.tensorflow" + + ".GraphDef\0224\n\026pre_optimization_graph\030\002 \001(" + + "\0132\024.tensorflow.GraphDef\0225\n\027post_optimiza" + + "tion_graph\030\003 \001(\0132\024.tensorflow.GraphDef\":" + + "\n\020TensorConnection\022\023\n\013from_tensor\030\001 \001(\t\022" + + "\021\n\tto_tensor\030\002 \001(\t\"\260\003\n\017CallableOptions\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.Ru" + + "nOptions\0227\n\021tensor_connection\030\005 \003(\0132\034.te" + + "nsorflow.TensorConnection\022B\n\014feed_device" + + "s\030\006 \003(\0132,.tensorflow.CallableOptions.Fee" + + "dDevicesEntry\022D\n\rfetch_devices\030\007 \003(\0132-.t" + + "ensorflow.CallableOptions.FetchDevicesEn" + + "try\022\027\n\017fetch_skip_sync\030\010 \001(\010\0322\n\020FeedDevi" + + "cesEntry\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\005va" + + "lue\030\002 \001(\t:\0028\001\"\235\001\n\017BatchingOptions\022\031\n\021num" + + "_batch_threads\030\001 \001(\005\022\026\n\016max_batch_size\030\002" + + " \001(\005\022\034\n\024batch_timeout_micros\030\003 \001(\005\022\033\n\023al" + + "lowed_batch_sizes\030\004 \003(\005\022\034\n\024max_enqueued_" + + "batches\030\005 \001(\005B\200\001\n\024org.tensorflow.protoB\014" + + "ConfigProtosP\001ZUgithub.com/tensorflow/te" + + "nsorflow/tensorflow/go/core/protobuf/for" + + "_core_protos_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.CoordinationConfig.getDescriptor(), + org.tensorflow.proto.CostGraphProtos.getDescriptor(), + org.tensorflow.proto.GraphProtos.getDescriptor(), + org.tensorflow.proto.StepStatsProtos.getDescriptor(), + org.tensorflow.proto.ClusterProtos.getDescriptor(), + org.tensorflow.proto.DebugProtos.getDescriptor(), + org.tensorflow.proto.RewriterConfigProtos.getDescriptor(), + org.tensorflow.proto.dummy.RpcOptions.getDescriptor(), + }); + internal_static_tensorflow_GPUOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_GPUOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GPUOptions_descriptor, + new java.lang.String[] { "PerProcessGpuMemoryFraction", "AllowGrowth", "AllocatorType", "DeferredDeletionBytes", "VisibleDeviceList", "PollingActiveDelayUsecs", "PollingInactiveDelayMsecs", "ForceGpuCompatible", "Experimental", }); + internal_static_tensorflow_GPUOptions_Experimental_descriptor = + internal_static_tensorflow_GPUOptions_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GPUOptions_Experimental_descriptor, + new java.lang.String[] { "VirtualDevices", "NumVirtualDevicesPerGpu", "UseUnifiedMemory", "NumDevToDevCopyStreams", "CollectiveRingOrder", "TimestampedAllocator", "KernelTrackerMaxInterval", "KernelTrackerMaxBytes", "KernelTrackerMaxPending", "InternalFragmentationFraction", "UseCudaMallocAsync", "DisallowRetryOnAllocationFailure", "GpuHostMemLimitInMb", "GpuHostMemDisallowGrowth", "GpuSystemMemorySizeInMb", "PopulatePjrtGpuClientCreationInfo", "NodeId", "StreamMergeOptions", }); + internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor = + internal_static_tensorflow_GPUOptions_Experimental_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor, + new java.lang.String[] { "MemoryLimitMb", "Priority", "DeviceOrdinal", }); + internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor = + internal_static_tensorflow_GPUOptions_Experimental_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor, + new java.lang.String[] { "MergeHostToDeviceStream", "MergeDeviceToHostStream", "MergeDeviceToDeviceStream", }); + internal_static_tensorflow_OptimizerOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_OptimizerOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OptimizerOptions_descriptor, + new java.lang.String[] { "DoCommonSubexpressionElimination", "DoConstantFolding", "MaxFoldedConstantInBytes", "DoFunctionInlining", "OptLevel", "GlobalJitLevel", "CpuGlobalJit", }); + internal_static_tensorflow_GraphOptions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_GraphOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphOptions_descriptor, + new java.lang.String[] { "EnableRecvScheduling", "OptimizerOptions", "BuildCostModel", "BuildCostModelAfter", "InferShapes", "PlacePrunedGraph", "EnableBfloat16Sendrecv", "TimelineStep", "RewriteOptions", }); + internal_static_tensorflow_ThreadPoolOptionProto_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ThreadPoolOptionProto_descriptor, + new java.lang.String[] { "NumThreads", "GlobalName", }); + internal_static_tensorflow_SessionMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_SessionMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SessionMetadata_descriptor, + new java.lang.String[] { "Name", "Version", }); + internal_static_tensorflow_ConfigProto_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_ConfigProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ConfigProto_descriptor, + new java.lang.String[] { "DeviceCount", "IntraOpParallelismThreads", "InterOpParallelismThreads", "UsePerSessionThreads", "SessionInterOpThreadPool", "PlacementPeriod", "DeviceFilters", "GpuOptions", "PluggableDeviceOptions", "AllowSoftPlacement", "LogDevicePlacement", "GraphOptions", "OperationTimeoutInMs", "RpcOptions", "ClusterDef", "IsolateSessionState", "ShareClusterDevicesInSession", "Experimental", }); + internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor = + internal_static_tensorflow_ConfigProto_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_ConfigProto_DeviceCountEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ConfigProto_DeviceCountEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_ConfigProto_Experimental_descriptor = + internal_static_tensorflow_ConfigProto_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_ConfigProto_Experimental_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ConfigProto_Experimental_descriptor, + new java.lang.String[] { "CollectiveGroupLeader", "ExecutorType", "RecvBufMaxChunk", "UseNumaAffinity", "CollectiveDeterministicSequentialExecution", "CollectiveNccl", "ShareSessionStateInClusterspecPropagation", "DisableThreadSpinning", "ShareClusterDevicesInSession", "SessionMetadata", "OptimizeForStaticGraph", "EnableMlirBridge", "MlirBridgeRollout", "EnableMlirGraphOptimization", "DisableOutputPartitionGraphs", "XlaFusionAutotunerThresh", "UseTfrt", "EnableMultiHost", "TfrtUseIfrt", "BackendServerPort", "TargetTpu", "TargetGpu", "StreamMergeThreshold", "DisableFunctionalOpsLowering", "XlaPreferSingleGraphCluster", "CoordinationConfig", "DisableOptimizeForStaticGraph", "DisableEagerExecutorStreamingEnqueue", "FinalizeFunctionLibraryRuntime", "FinalizeResourceManager", }); + internal_static_tensorflow_RunOptions_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_RunOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RunOptions_descriptor, + new java.lang.String[] { "TraceLevel", "TimeoutInMs", "InterOpThreadPool", "OutputPartitionGraphs", "DebugOptions", "ReportTensorAllocationsUponOom", "Experimental", }); + internal_static_tensorflow_RunOptions_Experimental_descriptor = + internal_static_tensorflow_RunOptions_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RunOptions_Experimental_descriptor, + new java.lang.String[] { "CollectiveGraphKey", "UseRunHandlerPool", "RunHandlerPoolOptions", }); + internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor = + internal_static_tensorflow_RunOptions_Experimental_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor, + new java.lang.String[] { "Priority", }); + internal_static_tensorflow_RunMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_tensorflow_RunMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RunMetadata_descriptor, + new java.lang.String[] { "StepStats", "CostGraph", "PartitionGraphs", "FunctionGraphs", "SessionMetadata", }); + internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor = + internal_static_tensorflow_RunMetadata_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor, + new java.lang.String[] { "PartitionGraphs", "PreOptimizationGraph", "PostOptimizationGraph", }); + internal_static_tensorflow_TensorConnection_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_tensorflow_TensorConnection_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorConnection_descriptor, + new java.lang.String[] { "FromTensor", "ToTensor", }); + internal_static_tensorflow_CallableOptions_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_tensorflow_CallableOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CallableOptions_descriptor, + new java.lang.String[] { "Feed", "Fetch", "Target", "RunOptions", "TensorConnection", "FeedDevices", "FetchDevices", "FetchSkipSync", }); + internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor = + internal_static_tensorflow_CallableOptions_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_CallableOptions_FeedDevicesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CallableOptions_FeedDevicesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor = + internal_static_tensorflow_CallableOptions_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_CallableOptions_FetchDevicesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CallableOptions_FetchDevicesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_BatchingOptions_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_tensorflow_BatchingOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_BatchingOptions_descriptor, + new java.lang.String[] { "NumBatchThreads", "MaxBatchSize", "BatchTimeoutMicros", "AllowedBatchSizes", "MaxEnqueuedBatches", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.CoordinationConfig.getDescriptor(); + org.tensorflow.proto.CostGraphProtos.getDescriptor(); + org.tensorflow.proto.GraphProtos.getDescriptor(); + org.tensorflow.proto.StepStatsProtos.getDescriptor(); + org.tensorflow.proto.ClusterProtos.getDescriptor(); + org.tensorflow.proto.DebugProtos.getDescriptor(); + org.tensorflow.proto.RewriterConfigProtos.getDescriptor(); + org.tensorflow.proto.dummy.RpcOptions.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDef.java new file mode 100644 index 00000000000..94e682160fc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDef.java @@ -0,0 +1,866 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Container for any kind of control flow context. Any other control flow
    + * contexts that are added below should also be added here.
    + * 
    + * + * Protobuf type {@code tensorflow.ControlFlowContextDef} + */ +public final class ControlFlowContextDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ControlFlowContextDef) + ControlFlowContextDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ControlFlowContextDef.class.getName()); + } + // Use ControlFlowContextDef.newBuilder() to construct. + private ControlFlowContextDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ControlFlowContextDef() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ControlFlowContextDef.class, org.tensorflow.proto.ControlFlowContextDef.Builder.class); + } + + private int ctxtCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object ctxt_; + public enum CtxtCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + COND_CTXT(1), + WHILE_CTXT(2), + CTXT_NOT_SET(0); + private final int value; + private CtxtCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CtxtCase valueOf(int value) { + return forNumber(value); + } + + public static CtxtCase forNumber(int value) { + switch (value) { + case 1: return COND_CTXT; + case 2: return WHILE_CTXT; + case 0: return CTXT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public CtxtCase + getCtxtCase() { + return CtxtCase.forNumber( + ctxtCase_); + } + + public static final int COND_CTXT_FIELD_NUMBER = 1; + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return Whether the condCtxt field is set. + */ + @java.lang.Override + public boolean hasCondCtxt() { + return ctxtCase_ == 1; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return The condCtxt. + */ + @java.lang.Override + public org.tensorflow.proto.CondContextDef getCondCtxt() { + if (ctxtCase_ == 1) { + return (org.tensorflow.proto.CondContextDef) ctxt_; + } + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CondContextDefOrBuilder getCondCtxtOrBuilder() { + if (ctxtCase_ == 1) { + return (org.tensorflow.proto.CondContextDef) ctxt_; + } + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + + public static final int WHILE_CTXT_FIELD_NUMBER = 2; + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return Whether the whileCtxt field is set. + */ + @java.lang.Override + public boolean hasWhileCtxt() { + return ctxtCase_ == 2; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return The whileCtxt. + */ + @java.lang.Override + public org.tensorflow.proto.WhileContextDef getWhileCtxt() { + if (ctxtCase_ == 2) { + return (org.tensorflow.proto.WhileContextDef) ctxt_; + } + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + @java.lang.Override + public org.tensorflow.proto.WhileContextDefOrBuilder getWhileCtxtOrBuilder() { + if (ctxtCase_ == 2) { + return (org.tensorflow.proto.WhileContextDef) ctxt_; + } + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + + 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 (ctxtCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.CondContextDef) ctxt_); + } + if (ctxtCase_ == 2) { + output.writeMessage(2, (org.tensorflow.proto.WhileContextDef) ctxt_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ctxtCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.CondContextDef) ctxt_); + } + if (ctxtCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.tensorflow.proto.WhileContextDef) ctxt_); + } + size += getUnknownFields().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.ControlFlowContextDef)) { + return super.equals(obj); + } + org.tensorflow.proto.ControlFlowContextDef other = (org.tensorflow.proto.ControlFlowContextDef) obj; + + if (!getCtxtCase().equals(other.getCtxtCase())) return false; + switch (ctxtCase_) { + case 1: + if (!getCondCtxt() + .equals(other.getCondCtxt())) return false; + break; + case 2: + if (!getWhileCtxt() + .equals(other.getWhileCtxt())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (ctxtCase_) { + case 1: + hash = (37 * hash) + COND_CTXT_FIELD_NUMBER; + hash = (53 * hash) + getCondCtxt().hashCode(); + break; + case 2: + hash = (37 * hash) + WHILE_CTXT_FIELD_NUMBER; + hash = (53 * hash) + getWhileCtxt().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ControlFlowContextDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ControlFlowContextDef 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.ControlFlowContextDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ControlFlowContextDef 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.ControlFlowContextDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ControlFlowContextDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ControlFlowContextDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ControlFlowContextDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ControlFlowContextDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ControlFlowContextDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ControlFlowContextDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ControlFlowContextDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ControlFlowContextDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Container for any kind of control flow context. Any other control flow
    +   * contexts that are added below should also be added here.
    +   * 
    + * + * Protobuf type {@code tensorflow.ControlFlowContextDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ControlFlowContextDef) + org.tensorflow.proto.ControlFlowContextDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ControlFlowContextDef.class, org.tensorflow.proto.ControlFlowContextDef.Builder.class); + } + + // Construct using org.tensorflow.proto.ControlFlowContextDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (condCtxtBuilder_ != null) { + condCtxtBuilder_.clear(); + } + if (whileCtxtBuilder_ != null) { + whileCtxtBuilder_.clear(); + } + ctxtCase_ = 0; + ctxt_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ControlFlowContextDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDef getDefaultInstanceForType() { + return org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDef build() { + org.tensorflow.proto.ControlFlowContextDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDef buildPartial() { + org.tensorflow.proto.ControlFlowContextDef result = new org.tensorflow.proto.ControlFlowContextDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ControlFlowContextDef result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.ControlFlowContextDef result) { + result.ctxtCase_ = ctxtCase_; + result.ctxt_ = this.ctxt_; + if (ctxtCase_ == 1 && + condCtxtBuilder_ != null) { + result.ctxt_ = condCtxtBuilder_.build(); + } + if (ctxtCase_ == 2 && + whileCtxtBuilder_ != null) { + result.ctxt_ = whileCtxtBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ControlFlowContextDef) { + return mergeFrom((org.tensorflow.proto.ControlFlowContextDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ControlFlowContextDef other) { + if (other == org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance()) return this; + switch (other.getCtxtCase()) { + case COND_CTXT: { + mergeCondCtxt(other.getCondCtxt()); + break; + } + case WHILE_CTXT: { + mergeWhileCtxt(other.getWhileCtxt()); + break; + } + case CTXT_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getCondCtxtFieldBuilder().getBuilder(), + extensionRegistry); + ctxtCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + getWhileCtxtFieldBuilder().getBuilder(), + extensionRegistry); + ctxtCase_ = 2; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int ctxtCase_ = 0; + private java.lang.Object ctxt_; + public CtxtCase + getCtxtCase() { + return CtxtCase.forNumber( + ctxtCase_); + } + + public Builder clearCtxt() { + ctxtCase_ = 0; + ctxt_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CondContextDef, org.tensorflow.proto.CondContextDef.Builder, org.tensorflow.proto.CondContextDefOrBuilder> condCtxtBuilder_; + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return Whether the condCtxt field is set. + */ + @java.lang.Override + public boolean hasCondCtxt() { + return ctxtCase_ == 1; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return The condCtxt. + */ + @java.lang.Override + public org.tensorflow.proto.CondContextDef getCondCtxt() { + if (condCtxtBuilder_ == null) { + if (ctxtCase_ == 1) { + return (org.tensorflow.proto.CondContextDef) ctxt_; + } + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } else { + if (ctxtCase_ == 1) { + return condCtxtBuilder_.getMessage(); + } + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + public Builder setCondCtxt(org.tensorflow.proto.CondContextDef value) { + if (condCtxtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ctxt_ = value; + onChanged(); + } else { + condCtxtBuilder_.setMessage(value); + } + ctxtCase_ = 1; + return this; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + public Builder setCondCtxt( + org.tensorflow.proto.CondContextDef.Builder builderForValue) { + if (condCtxtBuilder_ == null) { + ctxt_ = builderForValue.build(); + onChanged(); + } else { + condCtxtBuilder_.setMessage(builderForValue.build()); + } + ctxtCase_ = 1; + return this; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + public Builder mergeCondCtxt(org.tensorflow.proto.CondContextDef value) { + if (condCtxtBuilder_ == null) { + if (ctxtCase_ == 1 && + ctxt_ != org.tensorflow.proto.CondContextDef.getDefaultInstance()) { + ctxt_ = org.tensorflow.proto.CondContextDef.newBuilder((org.tensorflow.proto.CondContextDef) ctxt_) + .mergeFrom(value).buildPartial(); + } else { + ctxt_ = value; + } + onChanged(); + } else { + if (ctxtCase_ == 1) { + condCtxtBuilder_.mergeFrom(value); + } else { + condCtxtBuilder_.setMessage(value); + } + } + ctxtCase_ = 1; + return this; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + public Builder clearCondCtxt() { + if (condCtxtBuilder_ == null) { + if (ctxtCase_ == 1) { + ctxtCase_ = 0; + ctxt_ = null; + onChanged(); + } + } else { + if (ctxtCase_ == 1) { + ctxtCase_ = 0; + ctxt_ = null; + } + condCtxtBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + public org.tensorflow.proto.CondContextDef.Builder getCondCtxtBuilder() { + return getCondCtxtFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CondContextDefOrBuilder getCondCtxtOrBuilder() { + if ((ctxtCase_ == 1) && (condCtxtBuilder_ != null)) { + return condCtxtBuilder_.getMessageOrBuilder(); + } else { + if (ctxtCase_ == 1) { + return (org.tensorflow.proto.CondContextDef) ctxt_; + } + return org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + } + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CondContextDef, org.tensorflow.proto.CondContextDef.Builder, org.tensorflow.proto.CondContextDefOrBuilder> + getCondCtxtFieldBuilder() { + if (condCtxtBuilder_ == null) { + if (!(ctxtCase_ == 1)) { + ctxt_ = org.tensorflow.proto.CondContextDef.getDefaultInstance(); + } + condCtxtBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CondContextDef, org.tensorflow.proto.CondContextDef.Builder, org.tensorflow.proto.CondContextDefOrBuilder>( + (org.tensorflow.proto.CondContextDef) ctxt_, + getParentForChildren(), + isClean()); + ctxt_ = null; + } + ctxtCase_ = 1; + onChanged(); + return condCtxtBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.WhileContextDef, org.tensorflow.proto.WhileContextDef.Builder, org.tensorflow.proto.WhileContextDefOrBuilder> whileCtxtBuilder_; + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return Whether the whileCtxt field is set. + */ + @java.lang.Override + public boolean hasWhileCtxt() { + return ctxtCase_ == 2; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return The whileCtxt. + */ + @java.lang.Override + public org.tensorflow.proto.WhileContextDef getWhileCtxt() { + if (whileCtxtBuilder_ == null) { + if (ctxtCase_ == 2) { + return (org.tensorflow.proto.WhileContextDef) ctxt_; + } + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } else { + if (ctxtCase_ == 2) { + return whileCtxtBuilder_.getMessage(); + } + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + public Builder setWhileCtxt(org.tensorflow.proto.WhileContextDef value) { + if (whileCtxtBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ctxt_ = value; + onChanged(); + } else { + whileCtxtBuilder_.setMessage(value); + } + ctxtCase_ = 2; + return this; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + public Builder setWhileCtxt( + org.tensorflow.proto.WhileContextDef.Builder builderForValue) { + if (whileCtxtBuilder_ == null) { + ctxt_ = builderForValue.build(); + onChanged(); + } else { + whileCtxtBuilder_.setMessage(builderForValue.build()); + } + ctxtCase_ = 2; + return this; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + public Builder mergeWhileCtxt(org.tensorflow.proto.WhileContextDef value) { + if (whileCtxtBuilder_ == null) { + if (ctxtCase_ == 2 && + ctxt_ != org.tensorflow.proto.WhileContextDef.getDefaultInstance()) { + ctxt_ = org.tensorflow.proto.WhileContextDef.newBuilder((org.tensorflow.proto.WhileContextDef) ctxt_) + .mergeFrom(value).buildPartial(); + } else { + ctxt_ = value; + } + onChanged(); + } else { + if (ctxtCase_ == 2) { + whileCtxtBuilder_.mergeFrom(value); + } else { + whileCtxtBuilder_.setMessage(value); + } + } + ctxtCase_ = 2; + return this; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + public Builder clearWhileCtxt() { + if (whileCtxtBuilder_ == null) { + if (ctxtCase_ == 2) { + ctxtCase_ = 0; + ctxt_ = null; + onChanged(); + } + } else { + if (ctxtCase_ == 2) { + ctxtCase_ = 0; + ctxt_ = null; + } + whileCtxtBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + public org.tensorflow.proto.WhileContextDef.Builder getWhileCtxtBuilder() { + return getWhileCtxtFieldBuilder().getBuilder(); + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + @java.lang.Override + public org.tensorflow.proto.WhileContextDefOrBuilder getWhileCtxtOrBuilder() { + if ((ctxtCase_ == 2) && (whileCtxtBuilder_ != null)) { + return whileCtxtBuilder_.getMessageOrBuilder(); + } else { + if (ctxtCase_ == 2) { + return (org.tensorflow.proto.WhileContextDef) ctxt_; + } + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + } + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.WhileContextDef, org.tensorflow.proto.WhileContextDef.Builder, org.tensorflow.proto.WhileContextDefOrBuilder> + getWhileCtxtFieldBuilder() { + if (whileCtxtBuilder_ == null) { + if (!(ctxtCase_ == 2)) { + ctxt_ = org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + whileCtxtBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.WhileContextDef, org.tensorflow.proto.WhileContextDef.Builder, org.tensorflow.proto.WhileContextDefOrBuilder>( + (org.tensorflow.proto.WhileContextDef) ctxt_, + getParentForChildren(), + isClean()); + ctxt_ = null; + } + ctxtCase_ = 2; + onChanged(); + return whileCtxtBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ControlFlowContextDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ControlFlowContextDef) + private static final org.tensorflow.proto.ControlFlowContextDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ControlFlowContextDef(); + } + + public static org.tensorflow.proto.ControlFlowContextDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ControlFlowContextDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ControlFlowContextDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDefOrBuilder.java new file mode 100644 index 00000000000..0fba58feb04 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowContextDefOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ControlFlowContextDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ControlFlowContextDef) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return Whether the condCtxt field is set. + */ + boolean hasCondCtxt(); + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + * @return The condCtxt. + */ + org.tensorflow.proto.CondContextDef getCondCtxt(); + /** + * .tensorflow.CondContextDef cond_ctxt = 1; + */ + org.tensorflow.proto.CondContextDefOrBuilder getCondCtxtOrBuilder(); + + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return Whether the whileCtxt field is set. + */ + boolean hasWhileCtxt(); + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + * @return The whileCtxt. + */ + org.tensorflow.proto.WhileContextDef getWhileCtxt(); + /** + * .tensorflow.WhileContextDef while_ctxt = 2; + */ + org.tensorflow.proto.WhileContextDefOrBuilder getWhileCtxtOrBuilder(); + + org.tensorflow.proto.ControlFlowContextDef.CtxtCase getCtxtCase(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowProtos.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowProtos.java index 0177c3eae88..522e46a72f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ControlFlowProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ControlFlowProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class ControlFlowProtos { private ControlFlowProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ControlFlowProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,27 +28,27 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ValuesDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ValuesDef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ValuesDef_ExternalValuesEntry_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ValuesDef_ExternalValuesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ControlFlowContextDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CondContextDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CondContextDef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_WhileContextDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_WhileContextDef_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -71,10 +82,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" + - "\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" + "\205\001\n\024org.tensorflow.protoB\021ControlFlowPro" + + "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, @@ -83,33 +94,34 @@ public static void registerAllExtensions( internal_static_tensorflow_ValuesDef_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_ValuesDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ValuesDef_descriptor, new java.lang.String[] { "Values", "ExternalValues", }); internal_static_tensorflow_ValuesDef_ExternalValuesEntry_descriptor = internal_static_tensorflow_ValuesDef_descriptor.getNestedTypes().get(0); internal_static_tensorflow_ValuesDef_ExternalValuesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ValuesDef_ExternalValuesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_tensorflow_ControlFlowContextDef_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_ControlFlowContextDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ControlFlowContextDef_descriptor, new java.lang.String[] { "CondCtxt", "WhileCtxt", "Ctxt", }); internal_static_tensorflow_CondContextDef_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_CondContextDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CondContextDef_descriptor, new java.lang.String[] { "ContextName", "PredName", "PivotName", "Branch", "ValuesDef", "NestedContexts", }); internal_static_tensorflow_WhileContextDef_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_WhileContextDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_WhileContextDef_descriptor, new java.lang.String[] { "ContextName", "ParallelIterations", "BackProp", "SwapMemory", "PivotName", "PivotForPredName", "PivotForBodyName", "LoopExitNames", "LoopEnterNames", "ValuesDef", "MaximumIterationsName", "NestedContexts", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CoordinationConfig.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CoordinationConfig.java new file mode 100644 index 00000000000..f032747ea8e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CoordinationConfig.java @@ -0,0 +1,3074 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/coordination_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class CoordinationConfig { + private CoordinationConfig() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CoordinationConfig.class.getName()); + } + 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 CoordinatedJobOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CoordinatedJob) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int32 num_tasks = 2; + * @return The numTasks. + */ + int getNumTasks(); + } + /** + *
    +   * Represents a job type and the number of tasks under this job.
    +   * For example, ("worker", 20) implies that there will be 20 worker tasks.
    +   * 
    + * + * Protobuf type {@code tensorflow.CoordinatedJob} + */ + public static final class CoordinatedJob extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CoordinatedJob) + CoordinatedJobOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CoordinatedJob.class.getName()); + } + // Use CoordinatedJob.newBuilder() to construct. + private CoordinatedJob(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CoordinatedJob() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinatedJob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinatedJob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CoordinationConfig.CoordinatedJob.class, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 NUM_TASKS_FIELD_NUMBER = 2; + private int numTasks_ = 0; + /** + * int32 num_tasks = 2; + * @return The numTasks. + */ + @java.lang.Override + public int getNumTasks() { + return numTasks_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (numTasks_ != 0) { + output.writeInt32(2, numTasks_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (numTasks_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, numTasks_); + } + size += getUnknownFields().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.CoordinationConfig.CoordinatedJob)) { + return super.equals(obj); + } + org.tensorflow.proto.CoordinationConfig.CoordinatedJob other = (org.tensorflow.proto.CoordinationConfig.CoordinatedJob) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getNumTasks() + != other.getNumTasks()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_TASKS_FIELD_NUMBER; + hash = (53 * hash) + getNumTasks(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob 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.CoordinationConfig.CoordinatedJob parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob 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.CoordinationConfig.CoordinatedJob parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CoordinationConfig.CoordinatedJob 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a job type and the number of tasks under this job.
    +     * For example, ("worker", 20) implies that there will be 20 worker tasks.
    +     * 
    + * + * Protobuf type {@code tensorflow.CoordinatedJob} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CoordinatedJob) + org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinatedJob_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinatedJob_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CoordinationConfig.CoordinatedJob.class, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder.class); + } + + // Construct using org.tensorflow.proto.CoordinationConfig.CoordinatedJob.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + numTasks_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinatedJob_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob getDefaultInstanceForType() { + return org.tensorflow.proto.CoordinationConfig.CoordinatedJob.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob build() { + org.tensorflow.proto.CoordinationConfig.CoordinatedJob result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob buildPartial() { + org.tensorflow.proto.CoordinationConfig.CoordinatedJob result = new org.tensorflow.proto.CoordinationConfig.CoordinatedJob(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CoordinationConfig.CoordinatedJob result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numTasks_ = numTasks_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CoordinationConfig.CoordinatedJob) { + return mergeFrom((org.tensorflow.proto.CoordinationConfig.CoordinatedJob)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CoordinationConfig.CoordinatedJob other) { + if (other == org.tensorflow.proto.CoordinationConfig.CoordinatedJob.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNumTasks() != 0) { + setNumTasks(other.getNumTasks()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + numTasks_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int numTasks_ ; + /** + * int32 num_tasks = 2; + * @return The numTasks. + */ + @java.lang.Override + public int getNumTasks() { + return numTasks_; + } + /** + * int32 num_tasks = 2; + * @param value The numTasks to set. + * @return This builder for chaining. + */ + public Builder setNumTasks(int value) { + + numTasks_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 num_tasks = 2; + * @return This builder for chaining. + */ + public Builder clearNumTasks() { + bitField0_ = (bitField0_ & ~0x00000002); + numTasks_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CoordinatedJob) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CoordinatedJob) + private static final org.tensorflow.proto.CoordinationConfig.CoordinatedJob DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CoordinationConfig.CoordinatedJob(); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinatedJob getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CoordinatedJob parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CoordinationConfig.CoordinatedJob getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CoordinationServiceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CoordinationServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Type of coordination service implementation to enable.
    +     * For example, setting the service type as "standalone" starts a service
    +     * instance on the leader task to provide the coordination services such as
    +     * heartbeats and consistent key-value store.
    +     * 
    + * + * string service_type = 1; + * @return The serviceType. + */ + java.lang.String getServiceType(); + /** + *
    +     * Type of coordination service implementation to enable.
    +     * For example, setting the service type as "standalone" starts a service
    +     * instance on the leader task to provide the coordination services such as
    +     * heartbeats and consistent key-value store.
    +     * 
    + * + * string service_type = 1; + * @return The bytes for serviceType. + */ + com.google.protobuf.ByteString + getServiceTypeBytes(); + + /** + *
    +     * Address where the coordination service instance is hosted.
    +     * 
    + * + * string service_leader = 2; + * @return The serviceLeader. + */ + java.lang.String getServiceLeader(); + /** + *
    +     * Address where the coordination service instance is hosted.
    +     * 
    + * + * string service_leader = 2; + * @return The bytes for serviceLeader. + */ + com.google.protobuf.ByteString + getServiceLeaderBytes(); + + /** + *
    +     * Whether to enable the health check mechanism.
    +     * 
    + * + * bool enable_health_check = 3; + * @return The enableHealthCheck. + */ + boolean getEnableHealthCheck(); + + /** + *
    +     * Maximum wait time for all members in the cluster to be registered.
    +     * 
    + * + * int64 cluster_register_timeout_in_ms = 4; + * @return The clusterRegisterTimeoutInMs. + */ + long getClusterRegisterTimeoutInMs(); + + /** + *
    +     * Denotes if we should synchronize the agents' register attempts by blocking
    +     * on a barrier. This is useful for synchronized restarts.
    +     * 
    + * + * bool cluster_register_with_barrier = 14; + * @return The clusterRegisterWithBarrier. + */ + boolean getClusterRegisterWithBarrier(); + + /** + *
    +     * Heartbeat timeout, if a task does not record heartbeat in this time
    +     * window, it will be considered disconnected.
    +     * Note: This is also used as a grace period to accept any heartbeats after
    +     * the agent has disconnected, to account for the lag time between the service
    +     * recording the state change and the agent stopping heartbeats.
    +     * 
    + * + * int64 heartbeat_timeout_in_ms = 5; + * @return The heartbeatTimeoutInMs. + */ + long getHeartbeatTimeoutInMs(); + + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + java.util.List + getCoordinatedJobListList(); + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + org.tensorflow.proto.CoordinationConfig.CoordinatedJob getCoordinatedJobList(int index); + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + int getCoordinatedJobListCount(); + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + java.util.List + getCoordinatedJobListOrBuilderList(); + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder getCoordinatedJobListOrBuilder( + int index); + + /** + *
    +     * Denotes how long to wait for all coordination agents to reach the barriers
    +     * (after the first shutdown request) before disconnecting together. If
    +     * set to 0, no barrier is imposed upon shutdown and each worker can
    +     * disconnect individually.
    +     * 
    + * + * int64 shutdown_barrier_timeout_in_ms = 7; + * @return The shutdownBarrierTimeoutInMs. + */ + long getShutdownBarrierTimeoutInMs(); + + /** + *
    +     * If set, agents do not make an explicit Shutdown() call. Service will only
    +     * find out about the disconnecte agent via stale heartbeats. Used for
    +     * testing.
    +     * 
    + * + * bool agent_destruction_without_shutdown = 8; + * @return The agentDestructionWithoutShutdown. + */ + boolean getAgentDestructionWithoutShutdown(); + + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @return A list containing the recoverableJobs. + */ + java.util.List + getRecoverableJobsList(); + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @return The count of recoverableJobs. + */ + int getRecoverableJobsCount(); + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the element to return. + * @return The recoverableJobs at the given index. + */ + java.lang.String getRecoverableJobs(int index); + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the value to return. + * @return The bytes of the recoverableJobs at the given index. + */ + com.google.protobuf.ByteString + getRecoverableJobsBytes(int index); + + /** + *
    +     * If a task restarts with a new incarnation, we may allow it to reconnect
    +     * silently. This is useful when we know that a task can immediately resume
    +     * work upon re-connecting to the service.
    +     * 
    + * + * bool allow_new_incarnation_to_reconnect = 11; + * @return The allowNewIncarnationToReconnect. + */ + boolean getAllowNewIncarnationToReconnect(); + + /** + *
    +     * Disables coordination service.
    +     * Some libraries enable coordination service by default even if the user did
    +     * not specify any config. This field allows users to explicitly disable
    +     * coordination service under all situations.
    +     * 
    + * + * bool force_disable = 12; + * @return The forceDisable. + */ + boolean getForceDisable(); + + /** + *
    +     * Use long polling to get error from coordination service as the error
    +     * propagation mechanism.
    +     * 
    + * + * bool poll_for_error_from_service_at_startup = 13; + * @return The pollForErrorFromServiceAtStartup. + */ + boolean getPollForErrorFromServiceAtStartup(); + } + /** + *
    +   * Coordination service configuration parameters.
    +   * The system picks appropriate values for fields that are not set.
    +   * 
    + * + * Protobuf type {@code tensorflow.CoordinationServiceConfig} + */ + public static final class CoordinationServiceConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CoordinationServiceConfig) + CoordinationServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CoordinationServiceConfig.class.getName()); + } + // Use CoordinationServiceConfig.newBuilder() to construct. + private CoordinationServiceConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CoordinationServiceConfig() { + serviceType_ = ""; + serviceLeader_ = ""; + coordinatedJobList_ = java.util.Collections.emptyList(); + recoverableJobs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinationServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinationServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.class, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder.class); + } + + public static final int SERVICE_TYPE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object serviceType_ = ""; + /** + *
    +     * Type of coordination service implementation to enable.
    +     * For example, setting the service type as "standalone" starts a service
    +     * instance on the leader task to provide the coordination services such as
    +     * heartbeats and consistent key-value store.
    +     * 
    + * + * string service_type = 1; + * @return The serviceType. + */ + @java.lang.Override + public java.lang.String getServiceType() { + java.lang.Object ref = serviceType_; + 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(); + serviceType_ = s; + return s; + } + } + /** + *
    +     * Type of coordination service implementation to enable.
    +     * For example, setting the service type as "standalone" starts a service
    +     * instance on the leader task to provide the coordination services such as
    +     * heartbeats and consistent key-value store.
    +     * 
    + * + * string service_type = 1; + * @return The bytes for serviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServiceTypeBytes() { + java.lang.Object ref = serviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LEADER_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object serviceLeader_ = ""; + /** + *
    +     * Address where the coordination service instance is hosted.
    +     * 
    + * + * string service_leader = 2; + * @return The serviceLeader. + */ + @java.lang.Override + public java.lang.String getServiceLeader() { + java.lang.Object ref = serviceLeader_; + 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(); + serviceLeader_ = s; + return s; + } + } + /** + *
    +     * Address where the coordination service instance is hosted.
    +     * 
    + * + * string service_leader = 2; + * @return The bytes for serviceLeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServiceLeaderBytes() { + java.lang.Object ref = serviceLeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceLeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_HEALTH_CHECK_FIELD_NUMBER = 3; + private boolean enableHealthCheck_ = false; + /** + *
    +     * Whether to enable the health check mechanism.
    +     * 
    + * + * bool enable_health_check = 3; + * @return The enableHealthCheck. + */ + @java.lang.Override + public boolean getEnableHealthCheck() { + return enableHealthCheck_; + } + + public static final int CLUSTER_REGISTER_TIMEOUT_IN_MS_FIELD_NUMBER = 4; + private long clusterRegisterTimeoutInMs_ = 0L; + /** + *
    +     * Maximum wait time for all members in the cluster to be registered.
    +     * 
    + * + * int64 cluster_register_timeout_in_ms = 4; + * @return The clusterRegisterTimeoutInMs. + */ + @java.lang.Override + public long getClusterRegisterTimeoutInMs() { + return clusterRegisterTimeoutInMs_; + } + + public static final int CLUSTER_REGISTER_WITH_BARRIER_FIELD_NUMBER = 14; + private boolean clusterRegisterWithBarrier_ = false; + /** + *
    +     * Denotes if we should synchronize the agents' register attempts by blocking
    +     * on a barrier. This is useful for synchronized restarts.
    +     * 
    + * + * bool cluster_register_with_barrier = 14; + * @return The clusterRegisterWithBarrier. + */ + @java.lang.Override + public boolean getClusterRegisterWithBarrier() { + return clusterRegisterWithBarrier_; + } + + public static final int HEARTBEAT_TIMEOUT_IN_MS_FIELD_NUMBER = 5; + private long heartbeatTimeoutInMs_ = 0L; + /** + *
    +     * Heartbeat timeout, if a task does not record heartbeat in this time
    +     * window, it will be considered disconnected.
    +     * Note: This is also used as a grace period to accept any heartbeats after
    +     * the agent has disconnected, to account for the lag time between the service
    +     * recording the state change and the agent stopping heartbeats.
    +     * 
    + * + * int64 heartbeat_timeout_in_ms = 5; + * @return The heartbeatTimeoutInMs. + */ + @java.lang.Override + public long getHeartbeatTimeoutInMs() { + return heartbeatTimeoutInMs_; + } + + public static final int COORDINATED_JOB_LIST_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private java.util.List coordinatedJobList_; + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + @java.lang.Override + public java.util.List getCoordinatedJobListList() { + return coordinatedJobList_; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + @java.lang.Override + public java.util.List + getCoordinatedJobListOrBuilderList() { + return coordinatedJobList_; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + @java.lang.Override + public int getCoordinatedJobListCount() { + return coordinatedJobList_.size(); + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob getCoordinatedJobList(int index) { + return coordinatedJobList_.get(index); + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder getCoordinatedJobListOrBuilder( + int index) { + return coordinatedJobList_.get(index); + } + + public static final int SHUTDOWN_BARRIER_TIMEOUT_IN_MS_FIELD_NUMBER = 7; + private long shutdownBarrierTimeoutInMs_ = 0L; + /** + *
    +     * Denotes how long to wait for all coordination agents to reach the barriers
    +     * (after the first shutdown request) before disconnecting together. If
    +     * set to 0, no barrier is imposed upon shutdown and each worker can
    +     * disconnect individually.
    +     * 
    + * + * int64 shutdown_barrier_timeout_in_ms = 7; + * @return The shutdownBarrierTimeoutInMs. + */ + @java.lang.Override + public long getShutdownBarrierTimeoutInMs() { + return shutdownBarrierTimeoutInMs_; + } + + public static final int AGENT_DESTRUCTION_WITHOUT_SHUTDOWN_FIELD_NUMBER = 8; + private boolean agentDestructionWithoutShutdown_ = false; + /** + *
    +     * If set, agents do not make an explicit Shutdown() call. Service will only
    +     * find out about the disconnecte agent via stale heartbeats. Used for
    +     * testing.
    +     * 
    + * + * bool agent_destruction_without_shutdown = 8; + * @return The agentDestructionWithoutShutdown. + */ + @java.lang.Override + public boolean getAgentDestructionWithoutShutdown() { + return agentDestructionWithoutShutdown_; + } + + public static final int RECOVERABLE_JOBS_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList recoverableJobs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @return A list containing the recoverableJobs. + */ + public com.google.protobuf.ProtocolStringList + getRecoverableJobsList() { + return recoverableJobs_; + } + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @return The count of recoverableJobs. + */ + public int getRecoverableJobsCount() { + return recoverableJobs_.size(); + } + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the element to return. + * @return The recoverableJobs at the given index. + */ + public java.lang.String getRecoverableJobs(int index) { + return recoverableJobs_.get(index); + } + /** + *
    +     * The list of jobs which are recoverable. If a task in this list fails,
    +     * it will not propagate error to other tasks.
    +     * If empty, no jobs will be recoverable and every task failure will cause
    +     * error propagation to other tasks.
    +     * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the value to return. + * @return The bytes of the recoverableJobs at the given index. + */ + public com.google.protobuf.ByteString + getRecoverableJobsBytes(int index) { + return recoverableJobs_.getByteString(index); + } + + public static final int ALLOW_NEW_INCARNATION_TO_RECONNECT_FIELD_NUMBER = 11; + private boolean allowNewIncarnationToReconnect_ = false; + /** + *
    +     * If a task restarts with a new incarnation, we may allow it to reconnect
    +     * silently. This is useful when we know that a task can immediately resume
    +     * work upon re-connecting to the service.
    +     * 
    + * + * bool allow_new_incarnation_to_reconnect = 11; + * @return The allowNewIncarnationToReconnect. + */ + @java.lang.Override + public boolean getAllowNewIncarnationToReconnect() { + return allowNewIncarnationToReconnect_; + } + + public static final int FORCE_DISABLE_FIELD_NUMBER = 12; + private boolean forceDisable_ = false; + /** + *
    +     * Disables coordination service.
    +     * Some libraries enable coordination service by default even if the user did
    +     * not specify any config. This field allows users to explicitly disable
    +     * coordination service under all situations.
    +     * 
    + * + * bool force_disable = 12; + * @return The forceDisable. + */ + @java.lang.Override + public boolean getForceDisable() { + return forceDisable_; + } + + public static final int POLL_FOR_ERROR_FROM_SERVICE_AT_STARTUP_FIELD_NUMBER = 13; + private boolean pollForErrorFromServiceAtStartup_ = false; + /** + *
    +     * Use long polling to get error from coordination service as the error
    +     * propagation mechanism.
    +     * 
    + * + * bool poll_for_error_from_service_at_startup = 13; + * @return The pollForErrorFromServiceAtStartup. + */ + @java.lang.Override + public boolean getPollForErrorFromServiceAtStartup() { + return pollForErrorFromServiceAtStartup_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, serviceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceLeader_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, serviceLeader_); + } + if (enableHealthCheck_ != false) { + output.writeBool(3, enableHealthCheck_); + } + if (clusterRegisterTimeoutInMs_ != 0L) { + output.writeInt64(4, clusterRegisterTimeoutInMs_); + } + if (heartbeatTimeoutInMs_ != 0L) { + output.writeInt64(5, heartbeatTimeoutInMs_); + } + if (shutdownBarrierTimeoutInMs_ != 0L) { + output.writeInt64(7, shutdownBarrierTimeoutInMs_); + } + if (agentDestructionWithoutShutdown_ != false) { + output.writeBool(8, agentDestructionWithoutShutdown_); + } + for (int i = 0; i < recoverableJobs_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, recoverableJobs_.getRaw(i)); + } + for (int i = 0; i < coordinatedJobList_.size(); i++) { + output.writeMessage(10, coordinatedJobList_.get(i)); + } + if (allowNewIncarnationToReconnect_ != false) { + output.writeBool(11, allowNewIncarnationToReconnect_); + } + if (forceDisable_ != false) { + output.writeBool(12, forceDisable_); + } + if (pollForErrorFromServiceAtStartup_ != false) { + output.writeBool(13, pollForErrorFromServiceAtStartup_); + } + if (clusterRegisterWithBarrier_ != false) { + output.writeBool(14, clusterRegisterWithBarrier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, serviceType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceLeader_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, serviceLeader_); + } + if (enableHealthCheck_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, enableHealthCheck_); + } + if (clusterRegisterTimeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, clusterRegisterTimeoutInMs_); + } + if (heartbeatTimeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, heartbeatTimeoutInMs_); + } + if (shutdownBarrierTimeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, shutdownBarrierTimeoutInMs_); + } + if (agentDestructionWithoutShutdown_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, agentDestructionWithoutShutdown_); + } + { + int dataSize = 0; + for (int i = 0; i < recoverableJobs_.size(); i++) { + dataSize += computeStringSizeNoTag(recoverableJobs_.getRaw(i)); + } + size += dataSize; + size += 1 * getRecoverableJobsList().size(); + } + for (int i = 0; i < coordinatedJobList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, coordinatedJobList_.get(i)); + } + if (allowNewIncarnationToReconnect_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, allowNewIncarnationToReconnect_); + } + if (forceDisable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, forceDisable_); + } + if (pollForErrorFromServiceAtStartup_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, pollForErrorFromServiceAtStartup_); + } + if (clusterRegisterWithBarrier_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, clusterRegisterWithBarrier_); + } + size += getUnknownFields().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.CoordinationConfig.CoordinationServiceConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig other = (org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig) obj; + + if (!getServiceType() + .equals(other.getServiceType())) return false; + if (!getServiceLeader() + .equals(other.getServiceLeader())) return false; + if (getEnableHealthCheck() + != other.getEnableHealthCheck()) return false; + if (getClusterRegisterTimeoutInMs() + != other.getClusterRegisterTimeoutInMs()) return false; + if (getClusterRegisterWithBarrier() + != other.getClusterRegisterWithBarrier()) return false; + if (getHeartbeatTimeoutInMs() + != other.getHeartbeatTimeoutInMs()) return false; + if (!getCoordinatedJobListList() + .equals(other.getCoordinatedJobListList())) return false; + if (getShutdownBarrierTimeoutInMs() + != other.getShutdownBarrierTimeoutInMs()) return false; + if (getAgentDestructionWithoutShutdown() + != other.getAgentDestructionWithoutShutdown()) return false; + if (!getRecoverableJobsList() + .equals(other.getRecoverableJobsList())) return false; + if (getAllowNewIncarnationToReconnect() + != other.getAllowNewIncarnationToReconnect()) return false; + if (getForceDisable() + != other.getForceDisable()) return false; + if (getPollForErrorFromServiceAtStartup() + != other.getPollForErrorFromServiceAtStartup()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SERVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getServiceType().hashCode(); + hash = (37 * hash) + SERVICE_LEADER_FIELD_NUMBER; + hash = (53 * hash) + getServiceLeader().hashCode(); + hash = (37 * hash) + ENABLE_HEALTH_CHECK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableHealthCheck()); + hash = (37 * hash) + CLUSTER_REGISTER_TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClusterRegisterTimeoutInMs()); + hash = (37 * hash) + CLUSTER_REGISTER_WITH_BARRIER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getClusterRegisterWithBarrier()); + hash = (37 * hash) + HEARTBEAT_TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHeartbeatTimeoutInMs()); + if (getCoordinatedJobListCount() > 0) { + hash = (37 * hash) + COORDINATED_JOB_LIST_FIELD_NUMBER; + hash = (53 * hash) + getCoordinatedJobListList().hashCode(); + } + hash = (37 * hash) + SHUTDOWN_BARRIER_TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getShutdownBarrierTimeoutInMs()); + hash = (37 * hash) + AGENT_DESTRUCTION_WITHOUT_SHUTDOWN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAgentDestructionWithoutShutdown()); + if (getRecoverableJobsCount() > 0) { + hash = (37 * hash) + RECOVERABLE_JOBS_FIELD_NUMBER; + hash = (53 * hash) + getRecoverableJobsList().hashCode(); + } + hash = (37 * hash) + ALLOW_NEW_INCARNATION_TO_RECONNECT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowNewIncarnationToReconnect()); + hash = (37 * hash) + FORCE_DISABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForceDisable()); + hash = (37 * hash) + POLL_FOR_ERROR_FROM_SERVICE_AT_STARTUP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPollForErrorFromServiceAtStartup()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig 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.CoordinationConfig.CoordinationServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig 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.CoordinationConfig.CoordinationServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CoordinationConfig.CoordinationServiceConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Coordination service configuration parameters.
    +     * The system picks appropriate values for fields that are not set.
    +     * 
    + * + * Protobuf type {@code tensorflow.CoordinationServiceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CoordinationServiceConfig) + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinationServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinationServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.class, org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + serviceType_ = ""; + serviceLeader_ = ""; + enableHealthCheck_ = false; + clusterRegisterTimeoutInMs_ = 0L; + clusterRegisterWithBarrier_ = false; + heartbeatTimeoutInMs_ = 0L; + if (coordinatedJobListBuilder_ == null) { + coordinatedJobList_ = java.util.Collections.emptyList(); + } else { + coordinatedJobList_ = null; + coordinatedJobListBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + shutdownBarrierTimeoutInMs_ = 0L; + agentDestructionWithoutShutdown_ = false; + recoverableJobs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + allowNewIncarnationToReconnect_ = false; + forceDisable_ = false; + pollForErrorFromServiceAtStartup_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CoordinationConfig.internal_static_tensorflow_CoordinationServiceConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig getDefaultInstanceForType() { + return org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig build() { + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig buildPartial() { + org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig result = new org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig result) { + if (coordinatedJobListBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + coordinatedJobList_ = java.util.Collections.unmodifiableList(coordinatedJobList_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.coordinatedJobList_ = coordinatedJobList_; + } else { + result.coordinatedJobList_ = coordinatedJobListBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.serviceType_ = serviceType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceLeader_ = serviceLeader_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.enableHealthCheck_ = enableHealthCheck_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusterRegisterTimeoutInMs_ = clusterRegisterTimeoutInMs_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clusterRegisterWithBarrier_ = clusterRegisterWithBarrier_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.heartbeatTimeoutInMs_ = heartbeatTimeoutInMs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.shutdownBarrierTimeoutInMs_ = shutdownBarrierTimeoutInMs_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.agentDestructionWithoutShutdown_ = agentDestructionWithoutShutdown_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + recoverableJobs_.makeImmutable(); + result.recoverableJobs_ = recoverableJobs_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.allowNewIncarnationToReconnect_ = allowNewIncarnationToReconnect_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.forceDisable_ = forceDisable_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.pollForErrorFromServiceAtStartup_ = pollForErrorFromServiceAtStartup_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig) { + return mergeFrom((org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig other) { + if (other == org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig.getDefaultInstance()) return this; + if (!other.getServiceType().isEmpty()) { + serviceType_ = other.serviceType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getServiceLeader().isEmpty()) { + serviceLeader_ = other.serviceLeader_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getEnableHealthCheck() != false) { + setEnableHealthCheck(other.getEnableHealthCheck()); + } + if (other.getClusterRegisterTimeoutInMs() != 0L) { + setClusterRegisterTimeoutInMs(other.getClusterRegisterTimeoutInMs()); + } + if (other.getClusterRegisterWithBarrier() != false) { + setClusterRegisterWithBarrier(other.getClusterRegisterWithBarrier()); + } + if (other.getHeartbeatTimeoutInMs() != 0L) { + setHeartbeatTimeoutInMs(other.getHeartbeatTimeoutInMs()); + } + if (coordinatedJobListBuilder_ == null) { + if (!other.coordinatedJobList_.isEmpty()) { + if (coordinatedJobList_.isEmpty()) { + coordinatedJobList_ = other.coordinatedJobList_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.addAll(other.coordinatedJobList_); + } + onChanged(); + } + } else { + if (!other.coordinatedJobList_.isEmpty()) { + if (coordinatedJobListBuilder_.isEmpty()) { + coordinatedJobListBuilder_.dispose(); + coordinatedJobListBuilder_ = null; + coordinatedJobList_ = other.coordinatedJobList_; + bitField0_ = (bitField0_ & ~0x00000040); + coordinatedJobListBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCoordinatedJobListFieldBuilder() : null; + } else { + coordinatedJobListBuilder_.addAllMessages(other.coordinatedJobList_); + } + } + } + if (other.getShutdownBarrierTimeoutInMs() != 0L) { + setShutdownBarrierTimeoutInMs(other.getShutdownBarrierTimeoutInMs()); + } + if (other.getAgentDestructionWithoutShutdown() != false) { + setAgentDestructionWithoutShutdown(other.getAgentDestructionWithoutShutdown()); + } + if (!other.recoverableJobs_.isEmpty()) { + if (recoverableJobs_.isEmpty()) { + recoverableJobs_ = other.recoverableJobs_; + bitField0_ |= 0x00000200; + } else { + ensureRecoverableJobsIsMutable(); + recoverableJobs_.addAll(other.recoverableJobs_); + } + onChanged(); + } + if (other.getAllowNewIncarnationToReconnect() != false) { + setAllowNewIncarnationToReconnect(other.getAllowNewIncarnationToReconnect()); + } + if (other.getForceDisable() != false) { + setForceDisable(other.getForceDisable()); + } + if (other.getPollForErrorFromServiceAtStartup() != false) { + setPollForErrorFromServiceAtStartup(other.getPollForErrorFromServiceAtStartup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + serviceType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + serviceLeader_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + enableHealthCheck_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + clusterRegisterTimeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + heartbeatTimeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 56: { + shutdownBarrierTimeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: { + agentDestructionWithoutShutdown_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 74: { + java.lang.String s = input.readStringRequireUtf8(); + ensureRecoverableJobsIsMutable(); + recoverableJobs_.add(s); + break; + } // case 74 + case 82: { + org.tensorflow.proto.CoordinationConfig.CoordinatedJob m = + input.readMessage( + org.tensorflow.proto.CoordinationConfig.CoordinatedJob.parser(), + extensionRegistry); + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.add(m); + } else { + coordinatedJobListBuilder_.addMessage(m); + } + break; + } // case 82 + case 88: { + allowNewIncarnationToReconnect_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + forceDisable_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + pollForErrorFromServiceAtStartup_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + clusterRegisterWithBarrier_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 112 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object serviceType_ = ""; + /** + *
    +       * Type of coordination service implementation to enable.
    +       * For example, setting the service type as "standalone" starts a service
    +       * instance on the leader task to provide the coordination services such as
    +       * heartbeats and consistent key-value store.
    +       * 
    + * + * string service_type = 1; + * @return The serviceType. + */ + public java.lang.String getServiceType() { + java.lang.Object ref = serviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Type of coordination service implementation to enable.
    +       * For example, setting the service type as "standalone" starts a service
    +       * instance on the leader task to provide the coordination services such as
    +       * heartbeats and consistent key-value store.
    +       * 
    + * + * string service_type = 1; + * @return The bytes for serviceType. + */ + public com.google.protobuf.ByteString + getServiceTypeBytes() { + java.lang.Object ref = serviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Type of coordination service implementation to enable.
    +       * For example, setting the service type as "standalone" starts a service
    +       * instance on the leader task to provide the coordination services such as
    +       * heartbeats and consistent key-value store.
    +       * 
    + * + * string service_type = 1; + * @param value The serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + serviceType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Type of coordination service implementation to enable.
    +       * For example, setting the service type as "standalone" starts a service
    +       * instance on the leader task to provide the coordination services such as
    +       * heartbeats and consistent key-value store.
    +       * 
    + * + * string service_type = 1; + * @return This builder for chaining. + */ + public Builder clearServiceType() { + serviceType_ = getDefaultInstance().getServiceType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Type of coordination service implementation to enable.
    +       * For example, setting the service type as "standalone" starts a service
    +       * instance on the leader task to provide the coordination services such as
    +       * heartbeats and consistent key-value store.
    +       * 
    + * + * string service_type = 1; + * @param value The bytes for serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + serviceType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object serviceLeader_ = ""; + /** + *
    +       * Address where the coordination service instance is hosted.
    +       * 
    + * + * string service_leader = 2; + * @return The serviceLeader. + */ + public java.lang.String getServiceLeader() { + java.lang.Object ref = serviceLeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceLeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Address where the coordination service instance is hosted.
    +       * 
    + * + * string service_leader = 2; + * @return The bytes for serviceLeader. + */ + public com.google.protobuf.ByteString + getServiceLeaderBytes() { + java.lang.Object ref = serviceLeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceLeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Address where the coordination service instance is hosted.
    +       * 
    + * + * string service_leader = 2; + * @param value The serviceLeader to set. + * @return This builder for chaining. + */ + public Builder setServiceLeader( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + serviceLeader_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Address where the coordination service instance is hosted.
    +       * 
    + * + * string service_leader = 2; + * @return This builder for chaining. + */ + public Builder clearServiceLeader() { + serviceLeader_ = getDefaultInstance().getServiceLeader(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Address where the coordination service instance is hosted.
    +       * 
    + * + * string service_leader = 2; + * @param value The bytes for serviceLeader to set. + * @return This builder for chaining. + */ + public Builder setServiceLeaderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + serviceLeader_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean enableHealthCheck_ ; + /** + *
    +       * Whether to enable the health check mechanism.
    +       * 
    + * + * bool enable_health_check = 3; + * @return The enableHealthCheck. + */ + @java.lang.Override + public boolean getEnableHealthCheck() { + return enableHealthCheck_; + } + /** + *
    +       * Whether to enable the health check mechanism.
    +       * 
    + * + * bool enable_health_check = 3; + * @param value The enableHealthCheck to set. + * @return This builder for chaining. + */ + public Builder setEnableHealthCheck(boolean value) { + + enableHealthCheck_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Whether to enable the health check mechanism.
    +       * 
    + * + * bool enable_health_check = 3; + * @return This builder for chaining. + */ + public Builder clearEnableHealthCheck() { + bitField0_ = (bitField0_ & ~0x00000004); + enableHealthCheck_ = false; + onChanged(); + return this; + } + + private long clusterRegisterTimeoutInMs_ ; + /** + *
    +       * Maximum wait time for all members in the cluster to be registered.
    +       * 
    + * + * int64 cluster_register_timeout_in_ms = 4; + * @return The clusterRegisterTimeoutInMs. + */ + @java.lang.Override + public long getClusterRegisterTimeoutInMs() { + return clusterRegisterTimeoutInMs_; + } + /** + *
    +       * Maximum wait time for all members in the cluster to be registered.
    +       * 
    + * + * int64 cluster_register_timeout_in_ms = 4; + * @param value The clusterRegisterTimeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setClusterRegisterTimeoutInMs(long value) { + + clusterRegisterTimeoutInMs_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Maximum wait time for all members in the cluster to be registered.
    +       * 
    + * + * int64 cluster_register_timeout_in_ms = 4; + * @return This builder for chaining. + */ + public Builder clearClusterRegisterTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00000008); + clusterRegisterTimeoutInMs_ = 0L; + onChanged(); + return this; + } + + private boolean clusterRegisterWithBarrier_ ; + /** + *
    +       * Denotes if we should synchronize the agents' register attempts by blocking
    +       * on a barrier. This is useful for synchronized restarts.
    +       * 
    + * + * bool cluster_register_with_barrier = 14; + * @return The clusterRegisterWithBarrier. + */ + @java.lang.Override + public boolean getClusterRegisterWithBarrier() { + return clusterRegisterWithBarrier_; + } + /** + *
    +       * Denotes if we should synchronize the agents' register attempts by blocking
    +       * on a barrier. This is useful for synchronized restarts.
    +       * 
    + * + * bool cluster_register_with_barrier = 14; + * @param value The clusterRegisterWithBarrier to set. + * @return This builder for chaining. + */ + public Builder setClusterRegisterWithBarrier(boolean value) { + + clusterRegisterWithBarrier_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Denotes if we should synchronize the agents' register attempts by blocking
    +       * on a barrier. This is useful for synchronized restarts.
    +       * 
    + * + * bool cluster_register_with_barrier = 14; + * @return This builder for chaining. + */ + public Builder clearClusterRegisterWithBarrier() { + bitField0_ = (bitField0_ & ~0x00000010); + clusterRegisterWithBarrier_ = false; + onChanged(); + return this; + } + + private long heartbeatTimeoutInMs_ ; + /** + *
    +       * Heartbeat timeout, if a task does not record heartbeat in this time
    +       * window, it will be considered disconnected.
    +       * Note: This is also used as a grace period to accept any heartbeats after
    +       * the agent has disconnected, to account for the lag time between the service
    +       * recording the state change and the agent stopping heartbeats.
    +       * 
    + * + * int64 heartbeat_timeout_in_ms = 5; + * @return The heartbeatTimeoutInMs. + */ + @java.lang.Override + public long getHeartbeatTimeoutInMs() { + return heartbeatTimeoutInMs_; + } + /** + *
    +       * Heartbeat timeout, if a task does not record heartbeat in this time
    +       * window, it will be considered disconnected.
    +       * Note: This is also used as a grace period to accept any heartbeats after
    +       * the agent has disconnected, to account for the lag time between the service
    +       * recording the state change and the agent stopping heartbeats.
    +       * 
    + * + * int64 heartbeat_timeout_in_ms = 5; + * @param value The heartbeatTimeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setHeartbeatTimeoutInMs(long value) { + + heartbeatTimeoutInMs_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Heartbeat timeout, if a task does not record heartbeat in this time
    +       * window, it will be considered disconnected.
    +       * Note: This is also used as a grace period to accept any heartbeats after
    +       * the agent has disconnected, to account for the lag time between the service
    +       * recording the state change and the agent stopping heartbeats.
    +       * 
    + * + * int64 heartbeat_timeout_in_ms = 5; + * @return This builder for chaining. + */ + public Builder clearHeartbeatTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00000020); + heartbeatTimeoutInMs_ = 0L; + onChanged(); + return this; + } + + private java.util.List coordinatedJobList_ = + java.util.Collections.emptyList(); + private void ensureCoordinatedJobListIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + coordinatedJobList_ = new java.util.ArrayList(coordinatedJobList_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinatedJob, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder, org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder> coordinatedJobListBuilder_; + + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public java.util.List getCoordinatedJobListList() { + if (coordinatedJobListBuilder_ == null) { + return java.util.Collections.unmodifiableList(coordinatedJobList_); + } else { + return coordinatedJobListBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public int getCoordinatedJobListCount() { + if (coordinatedJobListBuilder_ == null) { + return coordinatedJobList_.size(); + } else { + return coordinatedJobListBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob getCoordinatedJobList(int index) { + if (coordinatedJobListBuilder_ == null) { + return coordinatedJobList_.get(index); + } else { + return coordinatedJobListBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder setCoordinatedJobList( + int index, org.tensorflow.proto.CoordinationConfig.CoordinatedJob value) { + if (coordinatedJobListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.set(index, value); + onChanged(); + } else { + coordinatedJobListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder setCoordinatedJobList( + int index, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder builderForValue) { + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.set(index, builderForValue.build()); + onChanged(); + } else { + coordinatedJobListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder addCoordinatedJobList(org.tensorflow.proto.CoordinationConfig.CoordinatedJob value) { + if (coordinatedJobListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.add(value); + onChanged(); + } else { + coordinatedJobListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder addCoordinatedJobList( + int index, org.tensorflow.proto.CoordinationConfig.CoordinatedJob value) { + if (coordinatedJobListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.add(index, value); + onChanged(); + } else { + coordinatedJobListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder addCoordinatedJobList( + org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder builderForValue) { + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.add(builderForValue.build()); + onChanged(); + } else { + coordinatedJobListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder addCoordinatedJobList( + int index, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder builderForValue) { + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.add(index, builderForValue.build()); + onChanged(); + } else { + coordinatedJobListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder addAllCoordinatedJobList( + java.lang.Iterable values) { + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, coordinatedJobList_); + onChanged(); + } else { + coordinatedJobListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder clearCoordinatedJobList() { + if (coordinatedJobListBuilder_ == null) { + coordinatedJobList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + coordinatedJobListBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public Builder removeCoordinatedJobList(int index) { + if (coordinatedJobListBuilder_ == null) { + ensureCoordinatedJobListIsMutable(); + coordinatedJobList_.remove(index); + onChanged(); + } else { + coordinatedJobListBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder getCoordinatedJobListBuilder( + int index) { + return getCoordinatedJobListFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder getCoordinatedJobListOrBuilder( + int index) { + if (coordinatedJobListBuilder_ == null) { + return coordinatedJobList_.get(index); } else { + return coordinatedJobListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public java.util.List + getCoordinatedJobListOrBuilderList() { + if (coordinatedJobListBuilder_ != null) { + return coordinatedJobListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(coordinatedJobList_); + } + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder addCoordinatedJobListBuilder() { + return getCoordinatedJobListFieldBuilder().addBuilder( + org.tensorflow.proto.CoordinationConfig.CoordinatedJob.getDefaultInstance()); + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder addCoordinatedJobListBuilder( + int index) { + return getCoordinatedJobListFieldBuilder().addBuilder( + index, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.getDefaultInstance()); + } + /** + * repeated .tensorflow.CoordinatedJob coordinated_job_list = 10; + */ + public java.util.List + getCoordinatedJobListBuilderList() { + return getCoordinatedJobListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinatedJob, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder, org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder> + getCoordinatedJobListFieldBuilder() { + if (coordinatedJobListBuilder_ == null) { + coordinatedJobListBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CoordinationConfig.CoordinatedJob, org.tensorflow.proto.CoordinationConfig.CoordinatedJob.Builder, org.tensorflow.proto.CoordinationConfig.CoordinatedJobOrBuilder>( + coordinatedJobList_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + coordinatedJobList_ = null; + } + return coordinatedJobListBuilder_; + } + + private long shutdownBarrierTimeoutInMs_ ; + /** + *
    +       * Denotes how long to wait for all coordination agents to reach the barriers
    +       * (after the first shutdown request) before disconnecting together. If
    +       * set to 0, no barrier is imposed upon shutdown and each worker can
    +       * disconnect individually.
    +       * 
    + * + * int64 shutdown_barrier_timeout_in_ms = 7; + * @return The shutdownBarrierTimeoutInMs. + */ + @java.lang.Override + public long getShutdownBarrierTimeoutInMs() { + return shutdownBarrierTimeoutInMs_; + } + /** + *
    +       * Denotes how long to wait for all coordination agents to reach the barriers
    +       * (after the first shutdown request) before disconnecting together. If
    +       * set to 0, no barrier is imposed upon shutdown and each worker can
    +       * disconnect individually.
    +       * 
    + * + * int64 shutdown_barrier_timeout_in_ms = 7; + * @param value The shutdownBarrierTimeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setShutdownBarrierTimeoutInMs(long value) { + + shutdownBarrierTimeoutInMs_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * Denotes how long to wait for all coordination agents to reach the barriers
    +       * (after the first shutdown request) before disconnecting together. If
    +       * set to 0, no barrier is imposed upon shutdown and each worker can
    +       * disconnect individually.
    +       * 
    + * + * int64 shutdown_barrier_timeout_in_ms = 7; + * @return This builder for chaining. + */ + public Builder clearShutdownBarrierTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00000080); + shutdownBarrierTimeoutInMs_ = 0L; + onChanged(); + return this; + } + + private boolean agentDestructionWithoutShutdown_ ; + /** + *
    +       * If set, agents do not make an explicit Shutdown() call. Service will only
    +       * find out about the disconnecte agent via stale heartbeats. Used for
    +       * testing.
    +       * 
    + * + * bool agent_destruction_without_shutdown = 8; + * @return The agentDestructionWithoutShutdown. + */ + @java.lang.Override + public boolean getAgentDestructionWithoutShutdown() { + return agentDestructionWithoutShutdown_; + } + /** + *
    +       * If set, agents do not make an explicit Shutdown() call. Service will only
    +       * find out about the disconnecte agent via stale heartbeats. Used for
    +       * testing.
    +       * 
    + * + * bool agent_destruction_without_shutdown = 8; + * @param value The agentDestructionWithoutShutdown to set. + * @return This builder for chaining. + */ + public Builder setAgentDestructionWithoutShutdown(boolean value) { + + agentDestructionWithoutShutdown_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * If set, agents do not make an explicit Shutdown() call. Service will only
    +       * find out about the disconnecte agent via stale heartbeats. Used for
    +       * testing.
    +       * 
    + * + * bool agent_destruction_without_shutdown = 8; + * @return This builder for chaining. + */ + public Builder clearAgentDestructionWithoutShutdown() { + bitField0_ = (bitField0_ & ~0x00000100); + agentDestructionWithoutShutdown_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList recoverableJobs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureRecoverableJobsIsMutable() { + if (!recoverableJobs_.isModifiable()) { + recoverableJobs_ = new com.google.protobuf.LazyStringArrayList(recoverableJobs_); + } + bitField0_ |= 0x00000200; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @return A list containing the recoverableJobs. + */ + public com.google.protobuf.ProtocolStringList + getRecoverableJobsList() { + recoverableJobs_.makeImmutable(); + return recoverableJobs_; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @return The count of recoverableJobs. + */ + public int getRecoverableJobsCount() { + return recoverableJobs_.size(); + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the element to return. + * @return The recoverableJobs at the given index. + */ + public java.lang.String getRecoverableJobs(int index) { + return recoverableJobs_.get(index); + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index of the value to return. + * @return The bytes of the recoverableJobs at the given index. + */ + public com.google.protobuf.ByteString + getRecoverableJobsBytes(int index) { + return recoverableJobs_.getByteString(index); + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param index The index to set the value at. + * @param value The recoverableJobs to set. + * @return This builder for chaining. + */ + public Builder setRecoverableJobs( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureRecoverableJobsIsMutable(); + recoverableJobs_.set(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param value The recoverableJobs to add. + * @return This builder for chaining. + */ + public Builder addRecoverableJobs( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureRecoverableJobsIsMutable(); + recoverableJobs_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param values The recoverableJobs to add. + * @return This builder for chaining. + */ + public Builder addAllRecoverableJobs( + java.lang.Iterable values) { + ensureRecoverableJobsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, recoverableJobs_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @return This builder for chaining. + */ + public Builder clearRecoverableJobs() { + recoverableJobs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200);; + onChanged(); + return this; + } + /** + *
    +       * The list of jobs which are recoverable. If a task in this list fails,
    +       * it will not propagate error to other tasks.
    +       * If empty, no jobs will be recoverable and every task failure will cause
    +       * error propagation to other tasks.
    +       * 
    + * + * repeated string recoverable_jobs = 9; + * @param value The bytes of the recoverableJobs to add. + * @return This builder for chaining. + */ + public Builder addRecoverableJobsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureRecoverableJobsIsMutable(); + recoverableJobs_.add(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private boolean allowNewIncarnationToReconnect_ ; + /** + *
    +       * If a task restarts with a new incarnation, we may allow it to reconnect
    +       * silently. This is useful when we know that a task can immediately resume
    +       * work upon re-connecting to the service.
    +       * 
    + * + * bool allow_new_incarnation_to_reconnect = 11; + * @return The allowNewIncarnationToReconnect. + */ + @java.lang.Override + public boolean getAllowNewIncarnationToReconnect() { + return allowNewIncarnationToReconnect_; + } + /** + *
    +       * If a task restarts with a new incarnation, we may allow it to reconnect
    +       * silently. This is useful when we know that a task can immediately resume
    +       * work upon re-connecting to the service.
    +       * 
    + * + * bool allow_new_incarnation_to_reconnect = 11; + * @param value The allowNewIncarnationToReconnect to set. + * @return This builder for chaining. + */ + public Builder setAllowNewIncarnationToReconnect(boolean value) { + + allowNewIncarnationToReconnect_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * If a task restarts with a new incarnation, we may allow it to reconnect
    +       * silently. This is useful when we know that a task can immediately resume
    +       * work upon re-connecting to the service.
    +       * 
    + * + * bool allow_new_incarnation_to_reconnect = 11; + * @return This builder for chaining. + */ + public Builder clearAllowNewIncarnationToReconnect() { + bitField0_ = (bitField0_ & ~0x00000400); + allowNewIncarnationToReconnect_ = false; + onChanged(); + return this; + } + + private boolean forceDisable_ ; + /** + *
    +       * Disables coordination service.
    +       * Some libraries enable coordination service by default even if the user did
    +       * not specify any config. This field allows users to explicitly disable
    +       * coordination service under all situations.
    +       * 
    + * + * bool force_disable = 12; + * @return The forceDisable. + */ + @java.lang.Override + public boolean getForceDisable() { + return forceDisable_; + } + /** + *
    +       * Disables coordination service.
    +       * Some libraries enable coordination service by default even if the user did
    +       * not specify any config. This field allows users to explicitly disable
    +       * coordination service under all situations.
    +       * 
    + * + * bool force_disable = 12; + * @param value The forceDisable to set. + * @return This builder for chaining. + */ + public Builder setForceDisable(boolean value) { + + forceDisable_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Disables coordination service.
    +       * Some libraries enable coordination service by default even if the user did
    +       * not specify any config. This field allows users to explicitly disable
    +       * coordination service under all situations.
    +       * 
    + * + * bool force_disable = 12; + * @return This builder for chaining. + */ + public Builder clearForceDisable() { + bitField0_ = (bitField0_ & ~0x00000800); + forceDisable_ = false; + onChanged(); + return this; + } + + private boolean pollForErrorFromServiceAtStartup_ ; + /** + *
    +       * Use long polling to get error from coordination service as the error
    +       * propagation mechanism.
    +       * 
    + * + * bool poll_for_error_from_service_at_startup = 13; + * @return The pollForErrorFromServiceAtStartup. + */ + @java.lang.Override + public boolean getPollForErrorFromServiceAtStartup() { + return pollForErrorFromServiceAtStartup_; + } + /** + *
    +       * Use long polling to get error from coordination service as the error
    +       * propagation mechanism.
    +       * 
    + * + * bool poll_for_error_from_service_at_startup = 13; + * @param value The pollForErrorFromServiceAtStartup to set. + * @return This builder for chaining. + */ + public Builder setPollForErrorFromServiceAtStartup(boolean value) { + + pollForErrorFromServiceAtStartup_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * Use long polling to get error from coordination service as the error
    +       * propagation mechanism.
    +       * 
    + * + * bool poll_for_error_from_service_at_startup = 13; + * @return This builder for chaining. + */ + public Builder clearPollForErrorFromServiceAtStartup() { + bitField0_ = (bitField0_ & ~0x00001000); + pollForErrorFromServiceAtStartup_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CoordinationServiceConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CoordinationServiceConfig) + private static final org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig(); + } + + public static org.tensorflow.proto.CoordinationConfig.CoordinationServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CoordinationServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CoordinationConfig.CoordinationServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CoordinatedJob_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CoordinatedJob_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CoordinationServiceConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CoordinationServiceConfig_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*xla/tsl/protobuf/coordination_config.p" + + "roto\022\ntensorflow\"1\n\016CoordinatedJob\022\014\n\004na" + + "me\030\001 \001(\t\022\021\n\tnum_tasks\030\002 \001(\005\"\367\003\n\031Coordina" + + "tionServiceConfig\022\024\n\014service_type\030\001 \001(\t\022" + + "\026\n\016service_leader\030\002 \001(\t\022\033\n\023enable_health" + + "_check\030\003 \001(\010\022&\n\036cluster_register_timeout" + + "_in_ms\030\004 \001(\003\022%\n\035cluster_register_with_ba" + + "rrier\030\016 \001(\010\022\037\n\027heartbeat_timeout_in_ms\030\005" + + " \001(\003\0228\n\024coordinated_job_list\030\n \003(\0132\032.ten" + + "sorflow.CoordinatedJob\022&\n\036shutdown_barri" + + "er_timeout_in_ms\030\007 \001(\003\022*\n\"agent_destruct" + + "ion_without_shutdown\030\010 \001(\010\022\030\n\020recoverabl" + + "e_jobs\030\t \003(\t\022*\n\"allow_new_incarnation_to" + + "_reconnect\030\013 \001(\010\022\025\n\rforce_disable\030\014 \001(\010\022" + + ".\n&poll_for_error_from_service_at_startu" + + "p\030\r \001(\010J\004\010\006\020\007Bm\n\024org.tensorflow.protoZUg" + + "ithub.com/tensorflow/tensorflow/tensorfl" + + "ow/go/core/protobuf/for_core_protos_go_p" + + "rotob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_CoordinatedJob_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_CoordinatedJob_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CoordinatedJob_descriptor, + new java.lang.String[] { "Name", "NumTasks", }); + internal_static_tensorflow_CoordinationServiceConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_CoordinationServiceConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CoordinationServiceConfig_descriptor, + new java.lang.String[] { "ServiceType", "ServiceLeader", "EnableHealthCheck", "ClusterRegisterTimeoutInMs", "ClusterRegisterWithBarrier", "HeartbeatTimeoutInMs", "CoordinatedJobList", "ShutdownBarrierTimeoutInMs", "AgentDestructionWithoutShutdown", "RecoverableJobs", "AllowNewIncarnationToReconnect", "ForceDisable", "PollForErrorFromServiceAtStartup", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDef.java new file mode 100644 index 00000000000..c1b43631e02 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDef.java @@ -0,0 +1,5836 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/cost_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.CostGraphDef} + */ +public final class CostGraphDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef) + CostGraphDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CostGraphDef.class.getName()); + } + // Use CostGraphDef.newBuilder() to construct. + private CostGraphDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CostGraphDef() { + node_ = java.util.Collections.emptyList(); + cost_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.class, org.tensorflow.proto.CostGraphDef.Builder.class); + } + + public interface NodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The name of the node. Names are globally unique.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * The name of the node. Names are globally unique.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * The device of the node. Can be empty if the node is mapped to the
    +     * default partition or partitioning hasn't been run yet.
    +     * 
    + * + * string device = 2; + * @return The device. + */ + java.lang.String getDevice(); + /** + *
    +     * The device of the node. Can be empty if the node is mapped to the
    +     * default partition or partitioning hasn't been run yet.
    +     * 
    + * + * string device = 2; + * @return The bytes for device. + */ + com.google.protobuf.ByteString + getDeviceBytes(); + + /** + *
    +     * The id of the node. Node ids are only unique inside a partition.
    +     * 
    + * + * int32 id = 3; + * @return The id. + */ + int getId(); + + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + java.util.List + getInputInfoList(); + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + org.tensorflow.proto.CostGraphDef.Node.InputInfo getInputInfo(int index); + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + int getInputInfoCount(); + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + java.util.List + getInputInfoOrBuilderList(); + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( + int index); + + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + java.util.List + getOutputInfoList(); + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + org.tensorflow.proto.CostGraphDef.Node.OutputInfo getOutputInfo(int index); + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + int getOutputInfoCount(); + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + java.util.List + getOutputInfoOrBuilderList(); + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( + int index); + + /** + *
    +     * Temporary memory used by this node.
    +     * 
    + * + * int64 temporary_memory_size = 6; + * @return The temporaryMemorySize. + */ + long getTemporaryMemorySize(); + + /** + *
    +     * Persistent memory used by this node.
    +     * 
    + * + * int64 persistent_memory_size = 12; + * @return The persistentMemorySize. + */ + long getPersistentMemorySize(); + + /** + * int64 host_temp_memory_size = 10 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.host_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=52 + * @return The hostTempMemorySize. + */ + @java.lang.Deprecated long getHostTempMemorySize(); + + /** + * int64 device_temp_memory_size = 11 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=53 + * @return The deviceTempMemorySize. + */ + @java.lang.Deprecated long getDeviceTempMemorySize(); + + /** + * int64 device_persistent_memory_size = 16 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=54 + * @return The devicePersistentMemorySize. + */ + @java.lang.Deprecated long getDevicePersistentMemorySize(); + + /** + *
    +     * Estimate of the computational cost of this node, in microseconds.
    +     * 
    + * + * int64 compute_cost = 9; + * @return The computeCost. + */ + long getComputeCost(); + + /** + *
    +     * Analytical estimate of the computational cost of this node, in
    +     * microseconds.
    +     * 
    + * + * int64 compute_time = 14; + * @return The computeTime. + */ + long getComputeTime(); + + /** + *
    +     * Analytical estimate of the memory access cost of this node, in
    +     * microseconds.
    +     * 
    + * + * int64 memory_time = 15; + * @return The memoryTime. + */ + long getMemoryTime(); + + /** + *
    +     * If true, the output is permanent: it can't be discarded, because this
    +     * node is part of the "final output". Nodes may depend on final nodes.
    +     * 
    + * + * bool is_final = 7; + * @return The isFinal. + */ + boolean getIsFinal(); + + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @return A list containing the controlInput. + */ + java.util.List getControlInputList(); + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @return The count of controlInput. + */ + int getControlInputCount(); + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @param index The index of the element to return. + * @return The controlInput at the given index. + */ + int getControlInput(int index); + + /** + *
    +     * Are the costs inaccurate?
    +     * 
    + * + * bool inaccurate = 17; + * @return The inaccurate. + */ + boolean getInaccurate(); + } + /** + * Protobuf type {@code tensorflow.CostGraphDef.Node} + */ + public static final class Node extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Node.class.getName()); + } + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Node() { + name_ = ""; + device_ = ""; + inputInfo_ = java.util.Collections.emptyList(); + outputInfo_ = java.util.Collections.emptyList(); + controlInput_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.class, org.tensorflow.proto.CostGraphDef.Node.Builder.class); + } + + public interface InputInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node.InputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 preceding_node = 1; + * @return The precedingNode. + */ + int getPrecedingNode(); + + /** + * int32 preceding_port = 2; + * @return The precedingPort. + */ + int getPrecedingPort(); + } + /** + *
    +     * Inputs of this node. They must be executed before this node can be
    +     * executed. An input is a particular output of another node, specified
    +     * by the node id and the output index.
    +     * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.Node.InputInfo} + */ + public static final class InputInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node.InputInfo) + InputInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + InputInfo.class.getName()); + } + // Use InputInfo.newBuilder() to construct. + private InputInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private InputInfo() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.InputInfo.class, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder.class); + } + + public static final int PRECEDING_NODE_FIELD_NUMBER = 1; + private int precedingNode_ = 0; + /** + * int32 preceding_node = 1; + * @return The precedingNode. + */ + @java.lang.Override + public int getPrecedingNode() { + return precedingNode_; + } + + public static final int PRECEDING_PORT_FIELD_NUMBER = 2; + private int precedingPort_ = 0; + /** + * int32 preceding_port = 2; + * @return The precedingPort. + */ + @java.lang.Override + public int getPrecedingPort() { + return precedingPort_; + } + + 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 (precedingNode_ != 0) { + output.writeInt32(1, precedingNode_); + } + if (precedingPort_ != 0) { + output.writeInt32(2, precedingPort_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (precedingNode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, precedingNode_); + } + if (precedingPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, precedingPort_); + } + size += getUnknownFields().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.CostGraphDef.Node.InputInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.CostGraphDef.Node.InputInfo other = (org.tensorflow.proto.CostGraphDef.Node.InputInfo) obj; + + if (getPrecedingNode() + != other.getPrecedingNode()) return false; + if (getPrecedingPort() + != other.getPrecedingPort()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PRECEDING_NODE_FIELD_NUMBER; + hash = (53 * hash) + getPrecedingNode(); + hash = (37 * hash) + PRECEDING_PORT_FIELD_NUMBER; + hash = (53 * hash) + getPrecedingPort(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo 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.CostGraphDef.Node.InputInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CostGraphDef.Node.InputInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Inputs of this node. They must be executed before this node can be
    +       * executed. An input is a particular output of another node, specified
    +       * by the node id and the output index.
    +       * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.Node.InputInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node.InputInfo) + org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.InputInfo.class, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.CostGraphDef.Node.InputInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + precedingNode_ = 0; + precedingPort_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.InputInfo getDefaultInstanceForType() { + return org.tensorflow.proto.CostGraphDef.Node.InputInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.InputInfo build() { + org.tensorflow.proto.CostGraphDef.Node.InputInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.InputInfo buildPartial() { + org.tensorflow.proto.CostGraphDef.Node.InputInfo result = new org.tensorflow.proto.CostGraphDef.Node.InputInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CostGraphDef.Node.InputInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.precedingNode_ = precedingNode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.precedingPort_ = precedingPort_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CostGraphDef.Node.InputInfo) { + return mergeFrom((org.tensorflow.proto.CostGraphDef.Node.InputInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CostGraphDef.Node.InputInfo other) { + if (other == org.tensorflow.proto.CostGraphDef.Node.InputInfo.getDefaultInstance()) return this; + if (other.getPrecedingNode() != 0) { + setPrecedingNode(other.getPrecedingNode()); + } + if (other.getPrecedingPort() != 0) { + setPrecedingPort(other.getPrecedingPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + precedingNode_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + precedingPort_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int precedingNode_ ; + /** + * int32 preceding_node = 1; + * @return The precedingNode. + */ + @java.lang.Override + public int getPrecedingNode() { + return precedingNode_; + } + /** + * int32 preceding_node = 1; + * @param value The precedingNode to set. + * @return This builder for chaining. + */ + public Builder setPrecedingNode(int value) { + + precedingNode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 preceding_node = 1; + * @return This builder for chaining. + */ + public Builder clearPrecedingNode() { + bitField0_ = (bitField0_ & ~0x00000001); + precedingNode_ = 0; + onChanged(); + return this; + } + + private int precedingPort_ ; + /** + * int32 preceding_port = 2; + * @return The precedingPort. + */ + @java.lang.Override + public int getPrecedingPort() { + return precedingPort_; + } + /** + * int32 preceding_port = 2; + * @param value The precedingPort to set. + * @return This builder for chaining. + */ + public Builder setPrecedingPort(int value) { + + precedingPort_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 preceding_port = 2; + * @return This builder for chaining. + */ + public Builder clearPrecedingPort() { + bitField0_ = (bitField0_ & ~0x00000002); + precedingPort_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CostGraphDef.Node.InputInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.InputInfo) + private static final org.tensorflow.proto.CostGraphDef.Node.InputInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CostGraphDef.Node.InputInfo(); + } + + public static org.tensorflow.proto.CostGraphDef.Node.InputInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CostGraphDef.Node.InputInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OutputInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.Node.OutputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 size = 1; + * @return The size. + */ + long getSize(); + + /** + *
    +       * If >= 0, the output is an alias of an input. Note that an alias input
    +       * may itself be an alias. The algorithm will therefore need to follow
    +       * those pointers.
    +       * 
    + * + * int64 alias_input_port = 2; + * @return The aliasInputPort. + */ + long getAliasInputPort(); + + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * .tensorflow.DataType dtype = 4; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 4; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + } + /** + *
    +     * Outputs of this node.
    +     * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.Node.OutputInfo} + */ + public static final class OutputInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.Node.OutputInfo) + OutputInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OutputInfo.class.getName()); + } + // Use OutputInfo.newBuilder() to construct. + private OutputInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OutputInfo() { + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.OutputInfo.class, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder.class); + } + + private int bitField0_; + public static final int SIZE_FIELD_NUMBER = 1; + private long size_ = 0L; + /** + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int ALIAS_INPUT_PORT_FIELD_NUMBER = 2; + private long aliasInputPort_ = 0L; + /** + *
    +       * If >= 0, the output is an alias of an input. Note that an alias input
    +       * may itself be an alias. The algorithm will therefore need to follow
    +       * those pointers.
    +       * 
    + * + * int64 alias_input_port = 2; + * @return The aliasInputPort. + */ + @java.lang.Override + public long getAliasInputPort() { + return aliasInputPort_; + } + + public static final int SHAPE_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int DTYPE_FIELD_NUMBER = 4; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 4; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 4; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + 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 (size_ != 0L) { + output.writeInt64(1, size_); + } + if (aliasInputPort_ != 0L) { + output.writeInt64(2, aliasInputPort_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(4, dtype_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, size_); + } + if (aliasInputPort_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, aliasInputPort_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, dtype_); + } + size += getUnknownFields().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.CostGraphDef.Node.OutputInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.CostGraphDef.Node.OutputInfo other = (org.tensorflow.proto.CostGraphDef.Node.OutputInfo) obj; + + if (getSize() + != other.getSize()) return false; + if (getAliasInputPort() + != other.getAliasInputPort()) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (dtype_ != other.dtype_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + ALIAS_INPUT_PORT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAliasInputPort()); + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo 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.CostGraphDef.Node.OutputInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CostGraphDef.Node.OutputInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Outputs of this node.
    +       * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.Node.OutputInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node.OutputInfo) + org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.OutputInfo.class, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.CostGraphDef.Node.OutputInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + size_ = 0L; + aliasInputPort_ = 0L; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + dtype_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo getDefaultInstanceForType() { + return org.tensorflow.proto.CostGraphDef.Node.OutputInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo build() { + org.tensorflow.proto.CostGraphDef.Node.OutputInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo buildPartial() { + org.tensorflow.proto.CostGraphDef.Node.OutputInfo result = new org.tensorflow.proto.CostGraphDef.Node.OutputInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CostGraphDef.Node.OutputInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.aliasInputPort_ = aliasInputPort_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dtype_ = dtype_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CostGraphDef.Node.OutputInfo) { + return mergeFrom((org.tensorflow.proto.CostGraphDef.Node.OutputInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CostGraphDef.Node.OutputInfo other) { + if (other == org.tensorflow.proto.CostGraphDef.Node.OutputInfo.getDefaultInstance()) return this; + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (other.getAliasInputPort() != 0L) { + setAliasInputPort(other.getAliasInputPort()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + size_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + aliasInputPort_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long size_ ; + /** + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * int64 size = 1; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 size = 1; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + onChanged(); + return this; + } + + private long aliasInputPort_ ; + /** + *
    +         * If >= 0, the output is an alias of an input. Note that an alias input
    +         * may itself be an alias. The algorithm will therefore need to follow
    +         * those pointers.
    +         * 
    + * + * int64 alias_input_port = 2; + * @return The aliasInputPort. + */ + @java.lang.Override + public long getAliasInputPort() { + return aliasInputPort_; + } + /** + *
    +         * If >= 0, the output is an alias of an input. Note that an alias input
    +         * may itself be an alias. The algorithm will therefore need to follow
    +         * those pointers.
    +         * 
    + * + * int64 alias_input_port = 2; + * @param value The aliasInputPort to set. + * @return This builder for chaining. + */ + public Builder setAliasInputPort(long value) { + + aliasInputPort_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * If >= 0, the output is an alias of an input. Note that an alias input
    +         * may itself be an alias. The algorithm will therefore need to follow
    +         * those pointers.
    +         * 
    + * + * int64 alias_input_port = 2; + * @return This builder for chaining. + */ + public Builder clearAliasInputPort() { + bitField0_ = (bitField0_ & ~0x00000002); + aliasInputPort_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 3; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000004); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 4; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 4; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 4; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 4; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 4; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000008); + dtype_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CostGraphDef.Node.OutputInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node.OutputInfo) + private static final org.tensorflow.proto.CostGraphDef.Node.OutputInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CostGraphDef.Node.OutputInfo(); + } + + public static org.tensorflow.proto.CostGraphDef.Node.OutputInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CostGraphDef.Node.OutputInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * The name of the node. Names are globally unique.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 node. Names are globally unique.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + *
    +     * The device of the node. Can be empty if the node is mapped to the
    +     * default partition or partitioning hasn't been run yet.
    +     * 
    + * + * string device = 2; + * @return The device. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * The device of the node. Can be empty if the node is mapped to the
    +     * default partition or partitioning hasn't been run yet.
    +     * 
    + * + * string device = 2; + * @return The bytes for device. + */ + @java.lang.Override + 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 ID_FIELD_NUMBER = 3; + private int id_ = 0; + /** + *
    +     * The id of the node. Node ids are only unique inside a partition.
    +     * 
    + * + * int32 id = 3; + * @return The id. + */ + @java.lang.Override + public int getId() { + return id_; + } + + public static final int INPUT_INFO_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List inputInfo_; + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + @java.lang.Override + public java.util.List getInputInfoList() { + return inputInfo_; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + @java.lang.Override + public java.util.List + getInputInfoOrBuilderList() { + return inputInfo_; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + @java.lang.Override + public int getInputInfoCount() { + return inputInfo_.size(); + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.InputInfo getInputInfo(int index) { + return inputInfo_.get(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( + int index) { + return inputInfo_.get(index); + } + + public static final int OUTPUT_INFO_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List outputInfo_; + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + @java.lang.Override + public java.util.List getOutputInfoList() { + return outputInfo_; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + @java.lang.Override + public java.util.List + getOutputInfoOrBuilderList() { + return outputInfo_; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + @java.lang.Override + public int getOutputInfoCount() { + return outputInfo_.size(); + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo getOutputInfo(int index) { + return outputInfo_.get(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( + int index) { + return outputInfo_.get(index); + } + + public static final int TEMPORARY_MEMORY_SIZE_FIELD_NUMBER = 6; + private long temporaryMemorySize_ = 0L; + /** + *
    +     * Temporary memory used by this node.
    +     * 
    + * + * int64 temporary_memory_size = 6; + * @return The temporaryMemorySize. + */ + @java.lang.Override + public long getTemporaryMemorySize() { + return temporaryMemorySize_; + } + + public static final int PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 12; + private long persistentMemorySize_ = 0L; + /** + *
    +     * Persistent memory used by this node.
    +     * 
    + * + * int64 persistent_memory_size = 12; + * @return The persistentMemorySize. + */ + @java.lang.Override + public long getPersistentMemorySize() { + return persistentMemorySize_; + } + + public static final int HOST_TEMP_MEMORY_SIZE_FIELD_NUMBER = 10; + private long hostTempMemorySize_ = 0L; + /** + * int64 host_temp_memory_size = 10 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.host_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=52 + * @return The hostTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getHostTempMemorySize() { + return hostTempMemorySize_; + } + + public static final int DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER = 11; + private long deviceTempMemorySize_ = 0L; + /** + * int64 device_temp_memory_size = 11 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=53 + * @return The deviceTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemorySize() { + return deviceTempMemorySize_; + } + + public static final int DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 16; + private long devicePersistentMemorySize_ = 0L; + /** + * int64 device_persistent_memory_size = 16 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=54 + * @return The devicePersistentMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemorySize() { + return devicePersistentMemorySize_; + } + + public static final int COMPUTE_COST_FIELD_NUMBER = 9; + private long computeCost_ = 0L; + /** + *
    +     * Estimate of the computational cost of this node, in microseconds.
    +     * 
    + * + * int64 compute_cost = 9; + * @return The computeCost. + */ + @java.lang.Override + public long getComputeCost() { + return computeCost_; + } + + public static final int COMPUTE_TIME_FIELD_NUMBER = 14; + private long computeTime_ = 0L; + /** + *
    +     * Analytical estimate of the computational cost of this node, in
    +     * microseconds.
    +     * 
    + * + * int64 compute_time = 14; + * @return The computeTime. + */ + @java.lang.Override + public long getComputeTime() { + return computeTime_; + } + + public static final int MEMORY_TIME_FIELD_NUMBER = 15; + private long memoryTime_ = 0L; + /** + *
    +     * Analytical estimate of the memory access cost of this node, in
    +     * microseconds.
    +     * 
    + * + * int64 memory_time = 15; + * @return The memoryTime. + */ + @java.lang.Override + public long getMemoryTime() { + return memoryTime_; + } + + public static final int IS_FINAL_FIELD_NUMBER = 7; + private boolean isFinal_ = false; + /** + *
    +     * If true, the output is permanent: it can't be discarded, because this
    +     * node is part of the "final output". Nodes may depend on final nodes.
    +     * 
    + * + * bool is_final = 7; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + + public static final int CONTROL_INPUT_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList controlInput_ = + emptyIntList(); + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @return A list containing the controlInput. + */ + @java.lang.Override + public java.util.List + getControlInputList() { + return controlInput_; + } + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @return The count of controlInput. + */ + public int getControlInputCount() { + return controlInput_.size(); + } + /** + *
    +     * Ids of the control inputs for this node.
    +     * 
    + * + * repeated int32 control_input = 8; + * @param index The index of the element to return. + * @return The controlInput at the given index. + */ + public int getControlInput(int index) { + return controlInput_.getInt(index); + } + private int controlInputMemoizedSerializedSize = -1; + + public static final int INACCURATE_FIELD_NUMBER = 17; + private boolean inaccurate_ = false; + /** + *
    +     * Are the costs inaccurate?
    +     * 
    + * + * bool inaccurate = 17; + * @return The inaccurate. + */ + @java.lang.Override + public boolean getInaccurate() { + return inaccurate_; + } + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, device_); + } + if (id_ != 0) { + output.writeInt32(3, id_); + } + for (int i = 0; i < inputInfo_.size(); i++) { + output.writeMessage(4, inputInfo_.get(i)); + } + for (int i = 0; i < outputInfo_.size(); i++) { + output.writeMessage(5, outputInfo_.get(i)); + } + if (temporaryMemorySize_ != 0L) { + output.writeInt64(6, temporaryMemorySize_); + } + if (isFinal_ != false) { + output.writeBool(7, isFinal_); + } + if (getControlInputList().size() > 0) { + output.writeUInt32NoTag(66); + output.writeUInt32NoTag(controlInputMemoizedSerializedSize); + } + for (int i = 0; i < controlInput_.size(); i++) { + output.writeInt32NoTag(controlInput_.getInt(i)); + } + if (computeCost_ != 0L) { + output.writeInt64(9, computeCost_); + } + if (hostTempMemorySize_ != 0L) { + output.writeInt64(10, hostTempMemorySize_); + } + if (deviceTempMemorySize_ != 0L) { + output.writeInt64(11, deviceTempMemorySize_); + } + if (persistentMemorySize_ != 0L) { + output.writeInt64(12, persistentMemorySize_); + } + if (computeTime_ != 0L) { + output.writeInt64(14, computeTime_); + } + if (memoryTime_ != 0L) { + output.writeInt64(15, memoryTime_); + } + if (devicePersistentMemorySize_ != 0L) { + output.writeInt64(16, devicePersistentMemorySize_); + } + if (inaccurate_ != false) { + output.writeBool(17, inaccurate_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, device_); + } + if (id_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, id_); + } + for (int i = 0; i < inputInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, inputInfo_.get(i)); + } + for (int i = 0; i < outputInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, outputInfo_.get(i)); + } + if (temporaryMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, temporaryMemorySize_); + } + if (isFinal_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, isFinal_); + } + { + int dataSize = 0; + for (int i = 0; i < controlInput_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(controlInput_.getInt(i)); + } + size += dataSize; + if (!getControlInputList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + controlInputMemoizedSerializedSize = dataSize; + } + if (computeCost_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, computeCost_); + } + if (hostTempMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, hostTempMemorySize_); + } + if (deviceTempMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, deviceTempMemorySize_); + } + if (persistentMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, persistentMemorySize_); + } + if (computeTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(14, computeTime_); + } + if (memoryTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(15, memoryTime_); + } + if (devicePersistentMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(16, devicePersistentMemorySize_); + } + if (inaccurate_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, inaccurate_); + } + size += getUnknownFields().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.CostGraphDef.Node)) { + return super.equals(obj); + } + org.tensorflow.proto.CostGraphDef.Node other = (org.tensorflow.proto.CostGraphDef.Node) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDevice() + .equals(other.getDevice())) return false; + if (getId() + != other.getId()) return false; + if (!getInputInfoList() + .equals(other.getInputInfoList())) return false; + if (!getOutputInfoList() + .equals(other.getOutputInfoList())) return false; + if (getTemporaryMemorySize() + != other.getTemporaryMemorySize()) return false; + if (getPersistentMemorySize() + != other.getPersistentMemorySize()) return false; + if (getHostTempMemorySize() + != other.getHostTempMemorySize()) return false; + if (getDeviceTempMemorySize() + != other.getDeviceTempMemorySize()) return false; + if (getDevicePersistentMemorySize() + != other.getDevicePersistentMemorySize()) return false; + if (getComputeCost() + != other.getComputeCost()) return false; + if (getComputeTime() + != other.getComputeTime()) return false; + if (getMemoryTime() + != other.getMemoryTime()) return false; + if (getIsFinal() + != other.getIsFinal()) return false; + if (!getControlInputList() + .equals(other.getControlInputList())) return false; + if (getInaccurate() + != other.getInaccurate()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId(); + if (getInputInfoCount() > 0) { + hash = (37 * hash) + INPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getInputInfoList().hashCode(); + } + if (getOutputInfoCount() > 0) { + hash = (37 * hash) + OUTPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getOutputInfoList().hashCode(); + } + hash = (37 * hash) + TEMPORARY_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTemporaryMemorySize()); + hash = (37 * hash) + PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPersistentMemorySize()); + hash = (37 * hash) + HOST_TEMP_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHostTempMemorySize()); + hash = (37 * hash) + DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDeviceTempMemorySize()); + hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDevicePersistentMemorySize()); + hash = (37 * hash) + COMPUTE_COST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getComputeCost()); + hash = (37 * hash) + COMPUTE_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getComputeTime()); + hash = (37 * hash) + MEMORY_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemoryTime()); + hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFinal()); + if (getControlInputCount() > 0) { + hash = (37 * hash) + CONTROL_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getControlInputList().hashCode(); + } + hash = (37 * hash) + INACCURATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInaccurate()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CostGraphDef.Node parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node 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.CostGraphDef.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node 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.CostGraphDef.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.Node parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CostGraphDef.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CostGraphDef.Node parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.Node parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.Node parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CostGraphDef.Node 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.CostGraphDef.Node} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.Node) + org.tensorflow.proto.CostGraphDef.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.Node.class, org.tensorflow.proto.CostGraphDef.Node.Builder.class); + } + + // Construct using org.tensorflow.proto.CostGraphDef.Node.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + device_ = ""; + id_ = 0; + if (inputInfoBuilder_ == null) { + inputInfo_ = java.util.Collections.emptyList(); + } else { + inputInfo_ = null; + inputInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (outputInfoBuilder_ == null) { + outputInfo_ = java.util.Collections.emptyList(); + } else { + outputInfo_ = null; + outputInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + temporaryMemorySize_ = 0L; + persistentMemorySize_ = 0L; + hostTempMemorySize_ = 0L; + deviceTempMemorySize_ = 0L; + devicePersistentMemorySize_ = 0L; + computeCost_ = 0L; + computeTime_ = 0L; + memoryTime_ = 0L; + isFinal_ = false; + controlInput_ = emptyIntList(); + inaccurate_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_Node_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node getDefaultInstanceForType() { + return org.tensorflow.proto.CostGraphDef.Node.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node build() { + org.tensorflow.proto.CostGraphDef.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node buildPartial() { + org.tensorflow.proto.CostGraphDef.Node result = new org.tensorflow.proto.CostGraphDef.Node(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CostGraphDef.Node result) { + if (inputInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + inputInfo_ = java.util.Collections.unmodifiableList(inputInfo_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.inputInfo_ = inputInfo_; + } else { + result.inputInfo_ = inputInfoBuilder_.build(); + } + if (outputInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + outputInfo_ = java.util.Collections.unmodifiableList(outputInfo_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.outputInfo_ = outputInfo_; + } else { + result.outputInfo_ = outputInfoBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CostGraphDef.Node result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.device_ = device_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.temporaryMemorySize_ = temporaryMemorySize_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.persistentMemorySize_ = persistentMemorySize_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.hostTempMemorySize_ = hostTempMemorySize_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deviceTempMemorySize_ = deviceTempMemorySize_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.devicePersistentMemorySize_ = devicePersistentMemorySize_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.computeCost_ = computeCost_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.computeTime_ = computeTime_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.memoryTime_ = memoryTime_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.isFinal_ = isFinal_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + controlInput_.makeImmutable(); + result.controlInput_ = controlInput_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.inaccurate_ = inaccurate_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CostGraphDef.Node) { + return mergeFrom((org.tensorflow.proto.CostGraphDef.Node)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CostGraphDef.Node other) { + if (other == org.tensorflow.proto.CostGraphDef.Node.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getId() != 0) { + setId(other.getId()); + } + if (inputInfoBuilder_ == null) { + if (!other.inputInfo_.isEmpty()) { + if (inputInfo_.isEmpty()) { + inputInfo_ = other.inputInfo_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureInputInfoIsMutable(); + inputInfo_.addAll(other.inputInfo_); + } + onChanged(); + } + } else { + if (!other.inputInfo_.isEmpty()) { + if (inputInfoBuilder_.isEmpty()) { + inputInfoBuilder_.dispose(); + inputInfoBuilder_ = null; + inputInfo_ = other.inputInfo_; + bitField0_ = (bitField0_ & ~0x00000008); + inputInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getInputInfoFieldBuilder() : null; + } else { + inputInfoBuilder_.addAllMessages(other.inputInfo_); + } + } + } + if (outputInfoBuilder_ == null) { + if (!other.outputInfo_.isEmpty()) { + if (outputInfo_.isEmpty()) { + outputInfo_ = other.outputInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureOutputInfoIsMutable(); + outputInfo_.addAll(other.outputInfo_); + } + onChanged(); + } + } else { + if (!other.outputInfo_.isEmpty()) { + if (outputInfoBuilder_.isEmpty()) { + outputInfoBuilder_.dispose(); + outputInfoBuilder_ = null; + outputInfo_ = other.outputInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + outputInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutputInfoFieldBuilder() : null; + } else { + outputInfoBuilder_.addAllMessages(other.outputInfo_); + } + } + } + if (other.getTemporaryMemorySize() != 0L) { + setTemporaryMemorySize(other.getTemporaryMemorySize()); + } + if (other.getPersistentMemorySize() != 0L) { + setPersistentMemorySize(other.getPersistentMemorySize()); + } + if (other.getHostTempMemorySize() != 0L) { + setHostTempMemorySize(other.getHostTempMemorySize()); + } + if (other.getDeviceTempMemorySize() != 0L) { + setDeviceTempMemorySize(other.getDeviceTempMemorySize()); + } + if (other.getDevicePersistentMemorySize() != 0L) { + setDevicePersistentMemorySize(other.getDevicePersistentMemorySize()); + } + if (other.getComputeCost() != 0L) { + setComputeCost(other.getComputeCost()); + } + if (other.getComputeTime() != 0L) { + setComputeTime(other.getComputeTime()); + } + if (other.getMemoryTime() != 0L) { + setMemoryTime(other.getMemoryTime()); + } + if (other.getIsFinal() != false) { + setIsFinal(other.getIsFinal()); + } + if (!other.controlInput_.isEmpty()) { + if (controlInput_.isEmpty()) { + controlInput_ = other.controlInput_; + controlInput_.makeImmutable(); + bitField0_ |= 0x00004000; + } else { + ensureControlInputIsMutable(); + controlInput_.addAll(other.controlInput_); + } + onChanged(); + } + if (other.getInaccurate() != false) { + setInaccurate(other.getInaccurate()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + id_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + org.tensorflow.proto.CostGraphDef.Node.InputInfo m = + input.readMessage( + org.tensorflow.proto.CostGraphDef.Node.InputInfo.parser(), + extensionRegistry); + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + inputInfo_.add(m); + } else { + inputInfoBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + org.tensorflow.proto.CostGraphDef.Node.OutputInfo m = + input.readMessage( + org.tensorflow.proto.CostGraphDef.Node.OutputInfo.parser(), + extensionRegistry); + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + outputInfo_.add(m); + } else { + outputInfoBuilder_.addMessage(m); + } + break; + } // case 42 + case 48: { + temporaryMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + isFinal_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 56 + case 64: { + int v = input.readInt32(); + ensureControlInputIsMutable(); + controlInput_.addInt(v); + break; + } // case 64 + case 66: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureControlInputIsMutable(); + while (input.getBytesUntilLimit() > 0) { + controlInput_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 66 + case 72: { + computeCost_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 72 + case 80: { + hostTempMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 80 + case 88: { + deviceTempMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 96: { + persistentMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 96 + case 112: { + computeTime_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 112 + case 120: { + memoryTime_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 120 + case 128: { + devicePersistentMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 128 + case 136: { + inaccurate_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 136 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * The name of the node. Names are globally unique.
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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 node. Names are globally unique.
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 node. Names are globally unique.
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The name of the node. Names are globally unique.
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * The name of the node. Names are globally unique.
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object device_ = ""; + /** + *
    +       * The device of the node. Can be empty if the node is mapped to the
    +       * default partition or partitioning hasn't been run yet.
    +       * 
    + * + * string device = 2; + * @return The device. + */ + 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; + } + } + /** + *
    +       * The device of the node. Can be empty if the node is mapped to the
    +       * default partition or partitioning hasn't been run yet.
    +       * 
    + * + * string device = 2; + * @return The bytes for device. + */ + 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; + } + } + /** + *
    +       * The device of the node. Can be empty if the node is mapped to the
    +       * default partition or partitioning hasn't been run yet.
    +       * 
    + * + * string device = 2; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The device of the node. Can be empty if the node is mapped to the
    +       * default partition or partitioning hasn't been run yet.
    +       * 
    + * + * string device = 2; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * The device of the node. Can be empty if the node is mapped to the
    +       * default partition or partitioning hasn't been run yet.
    +       * 
    + * + * string device = 2; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int id_ ; + /** + *
    +       * The id of the node. Node ids are only unique inside a partition.
    +       * 
    + * + * int32 id = 3; + * @return The id. + */ + @java.lang.Override + public int getId() { + return id_; + } + /** + *
    +       * The id of the node. Node ids are only unique inside a partition.
    +       * 
    + * + * int32 id = 3; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(int value) { + + id_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The id of the node. Node ids are only unique inside a partition.
    +       * 
    + * + * int32 id = 3; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000004); + id_ = 0; + onChanged(); + return this; + } + + private java.util.List inputInfo_ = + java.util.Collections.emptyList(); + private void ensureInputInfoIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + inputInfo_ = new java.util.ArrayList(inputInfo_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.InputInfo, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder> inputInfoBuilder_; + + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public java.util.List getInputInfoList() { + if (inputInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputInfo_); + } else { + return inputInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public int getInputInfoCount() { + if (inputInfoBuilder_ == null) { + return inputInfo_.size(); + } else { + return inputInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public org.tensorflow.proto.CostGraphDef.Node.InputInfo getInputInfo(int index) { + if (inputInfoBuilder_ == null) { + return inputInfo_.get(index); + } else { + return inputInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder setInputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.InputInfo value) { + if (inputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputInfoIsMutable(); + inputInfo_.set(index, value); + onChanged(); + } else { + inputInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder setInputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder builderForValue) { + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + inputInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + inputInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder addInputInfo(org.tensorflow.proto.CostGraphDef.Node.InputInfo value) { + if (inputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputInfoIsMutable(); + inputInfo_.add(value); + onChanged(); + } else { + inputInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder addInputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.InputInfo value) { + if (inputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputInfoIsMutable(); + inputInfo_.add(index, value); + onChanged(); + } else { + inputInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder addInputInfo( + org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder builderForValue) { + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + inputInfo_.add(builderForValue.build()); + onChanged(); + } else { + inputInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder addInputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder builderForValue) { + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + inputInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + inputInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder addAllInputInfo( + java.lang.Iterable values) { + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputInfo_); + onChanged(); + } else { + inputInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder clearInputInfo() { + if (inputInfoBuilder_ == null) { + inputInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + inputInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public Builder removeInputInfo(int index) { + if (inputInfoBuilder_ == null) { + ensureInputInfoIsMutable(); + inputInfo_.remove(index); + onChanged(); + } else { + inputInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder getInputInfoBuilder( + int index) { + return getInputInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder getInputInfoOrBuilder( + int index) { + if (inputInfoBuilder_ == null) { + return inputInfo_.get(index); } else { + return inputInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public java.util.List + getInputInfoOrBuilderList() { + if (inputInfoBuilder_ != null) { + return inputInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputInfo_); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder addInputInfoBuilder() { + return getInputInfoFieldBuilder().addBuilder( + org.tensorflow.proto.CostGraphDef.Node.InputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder addInputInfoBuilder( + int index) { + return getInputInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.CostGraphDef.Node.InputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node.InputInfo input_info = 4; + */ + public java.util.List + getInputInfoBuilderList() { + return getInputInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.InputInfo, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder> + getInputInfoFieldBuilder() { + if (inputInfoBuilder_ == null) { + inputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.InputInfo, org.tensorflow.proto.CostGraphDef.Node.InputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.InputInfoOrBuilder>( + inputInfo_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + inputInfo_ = null; + } + return inputInfoBuilder_; + } + + private java.util.List outputInfo_ = + java.util.Collections.emptyList(); + private void ensureOutputInfoIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + outputInfo_ = new java.util.ArrayList(outputInfo_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder> outputInfoBuilder_; + + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public java.util.List getOutputInfoList() { + if (outputInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputInfo_); + } else { + return outputInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public int getOutputInfoCount() { + if (outputInfoBuilder_ == null) { + return outputInfo_.size(); + } else { + return outputInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo getOutputInfo(int index) { + if (outputInfoBuilder_ == null) { + return outputInfo_.get(index); + } else { + return outputInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder setOutputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.OutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputInfoIsMutable(); + outputInfo_.set(index, value); + onChanged(); + } else { + outputInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder setOutputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder builderForValue) { + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + outputInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + outputInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder addOutputInfo(org.tensorflow.proto.CostGraphDef.Node.OutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputInfoIsMutable(); + outputInfo_.add(value); + onChanged(); + } else { + outputInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder addOutputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.OutputInfo value) { + if (outputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputInfoIsMutable(); + outputInfo_.add(index, value); + onChanged(); + } else { + outputInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder addOutputInfo( + org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder builderForValue) { + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + outputInfo_.add(builderForValue.build()); + onChanged(); + } else { + outputInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder addOutputInfo( + int index, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder builderForValue) { + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + outputInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + outputInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder addAllOutputInfo( + java.lang.Iterable values) { + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputInfo_); + onChanged(); + } else { + outputInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder clearOutputInfo() { + if (outputInfoBuilder_ == null) { + outputInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + outputInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public Builder removeOutputInfo(int index) { + if (outputInfoBuilder_ == null) { + ensureOutputInfoIsMutable(); + outputInfo_.remove(index); + onChanged(); + } else { + outputInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder getOutputInfoBuilder( + int index) { + return getOutputInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder getOutputInfoOrBuilder( + int index) { + if (outputInfoBuilder_ == null) { + return outputInfo_.get(index); } else { + return outputInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public java.util.List + getOutputInfoOrBuilderList() { + if (outputInfoBuilder_ != null) { + return outputInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputInfo_); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder addOutputInfoBuilder() { + return getOutputInfoFieldBuilder().addBuilder( + org.tensorflow.proto.CostGraphDef.Node.OutputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder addOutputInfoBuilder( + int index) { + return getOutputInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node.OutputInfo output_info = 5; + */ + public java.util.List + getOutputInfoBuilderList() { + return getOutputInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder> + getOutputInfoFieldBuilder() { + if (outputInfoBuilder_ == null) { + outputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node.OutputInfo, org.tensorflow.proto.CostGraphDef.Node.OutputInfo.Builder, org.tensorflow.proto.CostGraphDef.Node.OutputInfoOrBuilder>( + outputInfo_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + outputInfo_ = null; + } + return outputInfoBuilder_; + } + + private long temporaryMemorySize_ ; + /** + *
    +       * Temporary memory used by this node.
    +       * 
    + * + * int64 temporary_memory_size = 6; + * @return The temporaryMemorySize. + */ + @java.lang.Override + public long getTemporaryMemorySize() { + return temporaryMemorySize_; + } + /** + *
    +       * Temporary memory used by this node.
    +       * 
    + * + * int64 temporary_memory_size = 6; + * @param value The temporaryMemorySize to set. + * @return This builder for chaining. + */ + public Builder setTemporaryMemorySize(long value) { + + temporaryMemorySize_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Temporary memory used by this node.
    +       * 
    + * + * int64 temporary_memory_size = 6; + * @return This builder for chaining. + */ + public Builder clearTemporaryMemorySize() { + bitField0_ = (bitField0_ & ~0x00000020); + temporaryMemorySize_ = 0L; + onChanged(); + return this; + } + + private long persistentMemorySize_ ; + /** + *
    +       * Persistent memory used by this node.
    +       * 
    + * + * int64 persistent_memory_size = 12; + * @return The persistentMemorySize. + */ + @java.lang.Override + public long getPersistentMemorySize() { + return persistentMemorySize_; + } + /** + *
    +       * Persistent memory used by this node.
    +       * 
    + * + * int64 persistent_memory_size = 12; + * @param value The persistentMemorySize to set. + * @return This builder for chaining. + */ + public Builder setPersistentMemorySize(long value) { + + persistentMemorySize_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Persistent memory used by this node.
    +       * 
    + * + * int64 persistent_memory_size = 12; + * @return This builder for chaining. + */ + public Builder clearPersistentMemorySize() { + bitField0_ = (bitField0_ & ~0x00000040); + persistentMemorySize_ = 0L; + onChanged(); + return this; + } + + private long hostTempMemorySize_ ; + /** + * int64 host_temp_memory_size = 10 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.host_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=52 + * @return The hostTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getHostTempMemorySize() { + return hostTempMemorySize_; + } + /** + * int64 host_temp_memory_size = 10 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.host_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=52 + * @param value The hostTempMemorySize to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setHostTempMemorySize(long value) { + + hostTempMemorySize_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int64 host_temp_memory_size = 10 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.host_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=52 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearHostTempMemorySize() { + bitField0_ = (bitField0_ & ~0x00000080); + hostTempMemorySize_ = 0L; + onChanged(); + return this; + } + + private long deviceTempMemorySize_ ; + /** + * int64 device_temp_memory_size = 11 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=53 + * @return The deviceTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemorySize() { + return deviceTempMemorySize_; + } + /** + * int64 device_temp_memory_size = 11 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=53 + * @param value The deviceTempMemorySize to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDeviceTempMemorySize(long value) { + + deviceTempMemorySize_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 device_temp_memory_size = 11 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=53 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDeviceTempMemorySize() { + bitField0_ = (bitField0_ & ~0x00000100); + deviceTempMemorySize_ = 0L; + onChanged(); + return this; + } + + private long devicePersistentMemorySize_ ; + /** + * int64 device_persistent_memory_size = 16 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=54 + * @return The devicePersistentMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemorySize() { + return devicePersistentMemorySize_; + } + /** + * int64 device_persistent_memory_size = 16 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=54 + * @param value The devicePersistentMemorySize to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDevicePersistentMemorySize(long value) { + + devicePersistentMemorySize_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int64 device_persistent_memory_size = 16 [deprecated = true]; + * @deprecated tensorflow.CostGraphDef.Node.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/cost_graph.proto;l=54 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDevicePersistentMemorySize() { + bitField0_ = (bitField0_ & ~0x00000200); + devicePersistentMemorySize_ = 0L; + onChanged(); + return this; + } + + private long computeCost_ ; + /** + *
    +       * Estimate of the computational cost of this node, in microseconds.
    +       * 
    + * + * int64 compute_cost = 9; + * @return The computeCost. + */ + @java.lang.Override + public long getComputeCost() { + return computeCost_; + } + /** + *
    +       * Estimate of the computational cost of this node, in microseconds.
    +       * 
    + * + * int64 compute_cost = 9; + * @param value The computeCost to set. + * @return This builder for chaining. + */ + public Builder setComputeCost(long value) { + + computeCost_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Estimate of the computational cost of this node, in microseconds.
    +       * 
    + * + * int64 compute_cost = 9; + * @return This builder for chaining. + */ + public Builder clearComputeCost() { + bitField0_ = (bitField0_ & ~0x00000400); + computeCost_ = 0L; + onChanged(); + return this; + } + + private long computeTime_ ; + /** + *
    +       * Analytical estimate of the computational cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 compute_time = 14; + * @return The computeTime. + */ + @java.lang.Override + public long getComputeTime() { + return computeTime_; + } + /** + *
    +       * Analytical estimate of the computational cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 compute_time = 14; + * @param value The computeTime to set. + * @return This builder for chaining. + */ + public Builder setComputeTime(long value) { + + computeTime_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Analytical estimate of the computational cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 compute_time = 14; + * @return This builder for chaining. + */ + public Builder clearComputeTime() { + bitField0_ = (bitField0_ & ~0x00000800); + computeTime_ = 0L; + onChanged(); + return this; + } + + private long memoryTime_ ; + /** + *
    +       * Analytical estimate of the memory access cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 memory_time = 15; + * @return The memoryTime. + */ + @java.lang.Override + public long getMemoryTime() { + return memoryTime_; + } + /** + *
    +       * Analytical estimate of the memory access cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 memory_time = 15; + * @param value The memoryTime to set. + * @return This builder for chaining. + */ + public Builder setMemoryTime(long value) { + + memoryTime_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * Analytical estimate of the memory access cost of this node, in
    +       * microseconds.
    +       * 
    + * + * int64 memory_time = 15; + * @return This builder for chaining. + */ + public Builder clearMemoryTime() { + bitField0_ = (bitField0_ & ~0x00001000); + memoryTime_ = 0L; + onChanged(); + return this; + } + + private boolean isFinal_ ; + /** + *
    +       * If true, the output is permanent: it can't be discarded, because this
    +       * node is part of the "final output". Nodes may depend on final nodes.
    +       * 
    + * + * bool is_final = 7; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + /** + *
    +       * If true, the output is permanent: it can't be discarded, because this
    +       * node is part of the "final output". Nodes may depend on final nodes.
    +       * 
    + * + * bool is_final = 7; + * @param value The isFinal to set. + * @return This builder for chaining. + */ + public Builder setIsFinal(boolean value) { + + isFinal_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * If true, the output is permanent: it can't be discarded, because this
    +       * node is part of the "final output". Nodes may depend on final nodes.
    +       * 
    + * + * bool is_final = 7; + * @return This builder for chaining. + */ + public Builder clearIsFinal() { + bitField0_ = (bitField0_ & ~0x00002000); + isFinal_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList controlInput_ = emptyIntList(); + private void ensureControlInputIsMutable() { + if (!controlInput_.isModifiable()) { + controlInput_ = makeMutableCopy(controlInput_); + } + bitField0_ |= 0x00004000; + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @return A list containing the controlInput. + */ + public java.util.List + getControlInputList() { + controlInput_.makeImmutable(); + return controlInput_; + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @return The count of controlInput. + */ + public int getControlInputCount() { + return controlInput_.size(); + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @param index The index of the element to return. + * @return The controlInput at the given index. + */ + public int getControlInput(int index) { + return controlInput_.getInt(index); + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @param index The index to set the value at. + * @param value The controlInput to set. + * @return This builder for chaining. + */ + public Builder setControlInput( + int index, int value) { + + ensureControlInputIsMutable(); + controlInput_.setInt(index, value); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @param value The controlInput to add. + * @return This builder for chaining. + */ + public Builder addControlInput(int value) { + + ensureControlInputIsMutable(); + controlInput_.addInt(value); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @param values The controlInput to add. + * @return This builder for chaining. + */ + public Builder addAllControlInput( + java.lang.Iterable values) { + ensureControlInputIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, controlInput_); + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Ids of the control inputs for this node.
    +       * 
    + * + * repeated int32 control_input = 8; + * @return This builder for chaining. + */ + public Builder clearControlInput() { + controlInput_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + + private boolean inaccurate_ ; + /** + *
    +       * Are the costs inaccurate?
    +       * 
    + * + * bool inaccurate = 17; + * @return The inaccurate. + */ + @java.lang.Override + public boolean getInaccurate() { + return inaccurate_; + } + /** + *
    +       * Are the costs inaccurate?
    +       * 
    + * + * bool inaccurate = 17; + * @param value The inaccurate to set. + * @return This builder for chaining. + */ + public Builder setInaccurate(boolean value) { + + inaccurate_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +       * Are the costs inaccurate?
    +       * 
    + * + * bool inaccurate = 17; + * @return This builder for chaining. + */ + public Builder clearInaccurate() { + bitField0_ = (bitField0_ & ~0x00008000); + inaccurate_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CostGraphDef.Node) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.Node) + private static final org.tensorflow.proto.CostGraphDef.Node DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CostGraphDef.Node(); + } + + public static org.tensorflow.proto.CostGraphDef.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CostGraphDef.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AggregatedCostOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef.AggregatedCost) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Aggregated cost value.
    +     * 
    + * + * float cost = 1; + * @return The cost. + */ + float getCost(); + + /** + *
    +     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +     * 
    + * + * string dimension = 2; + * @return The dimension. + */ + java.lang.String getDimension(); + /** + *
    +     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +     * 
    + * + * string dimension = 2; + * @return The bytes for dimension. + */ + com.google.protobuf.ByteString + getDimensionBytes(); + } + /** + *
    +   * Total cost of this graph, typically used for balancing decisions.
    +   * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.AggregatedCost} + */ + public static final class AggregatedCost extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CostGraphDef.AggregatedCost) + AggregatedCostOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AggregatedCost.class.getName()); + } + // Use AggregatedCost.newBuilder() to construct. + private AggregatedCost(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AggregatedCost() { + dimension_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.AggregatedCost.class, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder.class); + } + + public static final int COST_FIELD_NUMBER = 1; + private float cost_ = 0F; + /** + *
    +     * Aggregated cost value.
    +     * 
    + * + * float cost = 1; + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + + public static final int DIMENSION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object dimension_ = ""; + /** + *
    +     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +     * 
    + * + * string dimension = 2; + * @return The dimension. + */ + @java.lang.Override + public java.lang.String getDimension() { + java.lang.Object ref = dimension_; + 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(); + dimension_ = s; + return s; + } + } + /** + *
    +     * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +     * 
    + * + * string dimension = 2; + * @return The bytes for dimension. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDimensionBytes() { + java.lang.Object ref = dimension_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dimension_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (java.lang.Float.floatToRawIntBits(cost_) != 0) { + output.writeFloat(1, cost_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dimension_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, dimension_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(cost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, cost_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dimension_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, dimension_); + } + size += getUnknownFields().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.CostGraphDef.AggregatedCost)) { + return super.equals(obj); + } + org.tensorflow.proto.CostGraphDef.AggregatedCost other = (org.tensorflow.proto.CostGraphDef.AggregatedCost) obj; + + if (java.lang.Float.floatToIntBits(getCost()) + != java.lang.Float.floatToIntBits( + other.getCost())) return false; + if (!getDimension() + .equals(other.getDimension())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + COST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getCost()); + hash = (37 * hash) + DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + getDimension().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost 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.CostGraphDef.AggregatedCost parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef.AggregatedCost parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CostGraphDef.AggregatedCost 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Total cost of this graph, typically used for balancing decisions.
    +     * 
    + * + * Protobuf type {@code tensorflow.CostGraphDef.AggregatedCost} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef.AggregatedCost) + org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.AggregatedCost.class, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder.class); + } + + // Construct using org.tensorflow.proto.CostGraphDef.AggregatedCost.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cost_ = 0F; + dimension_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.AggregatedCost getDefaultInstanceForType() { + return org.tensorflow.proto.CostGraphDef.AggregatedCost.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.AggregatedCost build() { + org.tensorflow.proto.CostGraphDef.AggregatedCost result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.AggregatedCost buildPartial() { + org.tensorflow.proto.CostGraphDef.AggregatedCost result = new org.tensorflow.proto.CostGraphDef.AggregatedCost(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.CostGraphDef.AggregatedCost result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cost_ = cost_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dimension_ = dimension_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CostGraphDef.AggregatedCost) { + return mergeFrom((org.tensorflow.proto.CostGraphDef.AggregatedCost)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CostGraphDef.AggregatedCost other) { + if (other == org.tensorflow.proto.CostGraphDef.AggregatedCost.getDefaultInstance()) return this; + if (other.getCost() != 0F) { + setCost(other.getCost()); + } + if (!other.getDimension().isEmpty()) { + dimension_ = other.dimension_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + cost_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 18: { + dimension_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private float cost_ ; + /** + *
    +       * Aggregated cost value.
    +       * 
    + * + * float cost = 1; + * @return The cost. + */ + @java.lang.Override + public float getCost() { + return cost_; + } + /** + *
    +       * Aggregated cost value.
    +       * 
    + * + * float cost = 1; + * @param value The cost to set. + * @return This builder for chaining. + */ + public Builder setCost(float value) { + + cost_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Aggregated cost value.
    +       * 
    + * + * float cost = 1; + * @return This builder for chaining. + */ + public Builder clearCost() { + bitField0_ = (bitField0_ & ~0x00000001); + cost_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object dimension_ = ""; + /** + *
    +       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +       * 
    + * + * string dimension = 2; + * @return The dimension. + */ + public java.lang.String getDimension() { + java.lang.Object ref = dimension_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dimension_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +       * 
    + * + * string dimension = 2; + * @return The bytes for dimension. + */ + public com.google.protobuf.ByteString + getDimensionBytes() { + java.lang.Object ref = dimension_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dimension_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +       * 
    + * + * string dimension = 2; + * @param value The dimension to set. + * @return This builder for chaining. + */ + public Builder setDimension( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + dimension_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +       * 
    + * + * string dimension = 2; + * @return This builder for chaining. + */ + public Builder clearDimension() { + dimension_ = getDefaultInstance().getDimension(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
    +       * 
    + * + * string dimension = 2; + * @param value The bytes for dimension to set. + * @return This builder for chaining. + */ + public Builder setDimensionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + dimension_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CostGraphDef.AggregatedCost) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef.AggregatedCost) + private static final org.tensorflow.proto.CostGraphDef.AggregatedCost DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CostGraphDef.AggregatedCost(); + } + + public static org.tensorflow.proto.CostGraphDef.AggregatedCost getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AggregatedCost parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CostGraphDef.AggregatedCost getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NODE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List node_; + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + @java.lang.Override + public java.util.List getNodeList() { + return node_; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + @java.lang.Override + public java.util.List + getNodeOrBuilderList() { + return node_; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + @java.lang.Override + public int getNodeCount() { + return node_.size(); + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.Node getNode(int index) { + return node_.get(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.NodeOrBuilder getNodeOrBuilder( + int index) { + return node_.get(index); + } + + public static final int COST_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List cost_; + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + @java.lang.Override + public java.util.List getCostList() { + return cost_; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + @java.lang.Override + public java.util.List + getCostOrBuilderList() { + return cost_; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + @java.lang.Override + public int getCostCount() { + return cost_.size(); + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.AggregatedCost getCost(int index) { + return cost_.get(index); + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( + int index) { + return cost_.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 { + for (int i = 0; i < node_.size(); i++) { + output.writeMessage(1, node_.get(i)); + } + for (int i = 0; i < cost_.size(); i++) { + output.writeMessage(2, cost_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < node_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, node_.get(i)); + } + for (int i = 0; i < cost_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, cost_.get(i)); + } + size += getUnknownFields().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.CostGraphDef)) { + return super.equals(obj); + } + org.tensorflow.proto.CostGraphDef other = (org.tensorflow.proto.CostGraphDef) obj; + + if (!getNodeList() + .equals(other.getNodeList())) return false; + if (!getCostList() + .equals(other.getCostList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodeCount() > 0) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNodeList().hashCode(); + } + if (getCostCount() > 0) { + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + getCostList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.CostGraphDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef 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.CostGraphDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef 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.CostGraphDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.CostGraphDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.CostGraphDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.CostGraphDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.CostGraphDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.CostGraphDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.CostGraphDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.CostGraphDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CostGraphDef) + org.tensorflow.proto.CostGraphDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.CostGraphDef.class, org.tensorflow.proto.CostGraphDef.Builder.class); + } + + // Construct using org.tensorflow.proto.CostGraphDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + } else { + node_ = null; + nodeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (costBuilder_ == null) { + cost_ = java.util.Collections.emptyList(); + } else { + cost_ = null; + costBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.CostGraphProtos.internal_static_tensorflow_CostGraphDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef getDefaultInstanceForType() { + return org.tensorflow.proto.CostGraphDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef build() { + org.tensorflow.proto.CostGraphDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.CostGraphDef buildPartial() { + org.tensorflow.proto.CostGraphDef result = new org.tensorflow.proto.CostGraphDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.CostGraphDef result) { + if (nodeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + node_ = java.util.Collections.unmodifiableList(node_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.build(); + } + if (costBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + cost_ = java.util.Collections.unmodifiableList(cost_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.cost_ = cost_; + } else { + result.cost_ = costBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.CostGraphDef result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.CostGraphDef) { + return mergeFrom((org.tensorflow.proto.CostGraphDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.CostGraphDef other) { + if (other == org.tensorflow.proto.CostGraphDef.getDefaultInstance()) return this; + if (nodeBuilder_ == null) { + if (!other.node_.isEmpty()) { + if (node_.isEmpty()) { + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodeIsMutable(); + node_.addAll(other.node_); + } + onChanged(); + } + } else { + if (!other.node_.isEmpty()) { + if (nodeBuilder_.isEmpty()) { + nodeBuilder_.dispose(); + nodeBuilder_ = null; + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + nodeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeFieldBuilder() : null; + } else { + nodeBuilder_.addAllMessages(other.node_); + } + } + } + if (costBuilder_ == null) { + if (!other.cost_.isEmpty()) { + if (cost_.isEmpty()) { + cost_ = other.cost_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCostIsMutable(); + cost_.addAll(other.cost_); + } + onChanged(); + } + } else { + if (!other.cost_.isEmpty()) { + if (costBuilder_.isEmpty()) { + costBuilder_.dispose(); + costBuilder_ = null; + cost_ = other.cost_; + bitField0_ = (bitField0_ & ~0x00000002); + costBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCostFieldBuilder() : null; + } else { + costBuilder_.addAllMessages(other.cost_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.CostGraphDef.Node m = + input.readMessage( + org.tensorflow.proto.CostGraphDef.Node.parser(), + extensionRegistry); + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(m); + } else { + nodeBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + org.tensorflow.proto.CostGraphDef.AggregatedCost m = + input.readMessage( + org.tensorflow.proto.CostGraphDef.AggregatedCost.parser(), + extensionRegistry); + if (costBuilder_ == null) { + ensureCostIsMutable(); + cost_.add(m); + } else { + costBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List node_ = + java.util.Collections.emptyList(); + private void ensureNodeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + node_ = new java.util.ArrayList(node_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node, org.tensorflow.proto.CostGraphDef.Node.Builder, org.tensorflow.proto.CostGraphDef.NodeOrBuilder> nodeBuilder_; + + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public java.util.List getNodeList() { + if (nodeBuilder_ == null) { + return java.util.Collections.unmodifiableList(node_); + } else { + return nodeBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public int getNodeCount() { + if (nodeBuilder_ == null) { + return node_.size(); + } else { + return nodeBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public org.tensorflow.proto.CostGraphDef.Node getNode(int index) { + if (nodeBuilder_ == null) { + return node_.get(index); + } else { + return nodeBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder setNode( + int index, org.tensorflow.proto.CostGraphDef.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.set(index, value); + onChanged(); + } else { + nodeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder setNode( + int index, org.tensorflow.proto.CostGraphDef.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder addNode(org.tensorflow.proto.CostGraphDef.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(value); + onChanged(); + } else { + nodeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder addNode( + int index, org.tensorflow.proto.CostGraphDef.Node value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(index, value); + onChanged(); + } else { + nodeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder addNode( + org.tensorflow.proto.CostGraphDef.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder addNode( + int index, org.tensorflow.proto.CostGraphDef.Node.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder addAllNode( + java.lang.Iterable values) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, node_); + onChanged(); + } else { + nodeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodeBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public Builder removeNode(int index) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.remove(index); + onChanged(); + } else { + nodeBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public org.tensorflow.proto.CostGraphDef.Node.Builder getNodeBuilder( + int index) { + return getNodeFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public org.tensorflow.proto.CostGraphDef.NodeOrBuilder getNodeOrBuilder( + int index) { + if (nodeBuilder_ == null) { + return node_.get(index); } else { + return nodeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public java.util.List + getNodeOrBuilderList() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(node_); + } + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public org.tensorflow.proto.CostGraphDef.Node.Builder addNodeBuilder() { + return getNodeFieldBuilder().addBuilder( + org.tensorflow.proto.CostGraphDef.Node.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public org.tensorflow.proto.CostGraphDef.Node.Builder addNodeBuilder( + int index) { + return getNodeFieldBuilder().addBuilder( + index, org.tensorflow.proto.CostGraphDef.Node.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + public java.util.List + getNodeBuilderList() { + return getNodeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node, org.tensorflow.proto.CostGraphDef.Node.Builder, org.tensorflow.proto.CostGraphDef.NodeOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.Node, org.tensorflow.proto.CostGraphDef.Node.Builder, org.tensorflow.proto.CostGraphDef.NodeOrBuilder>( + node_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + node_ = null; + } + return nodeBuilder_; + } + + private java.util.List cost_ = + java.util.Collections.emptyList(); + private void ensureCostIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + cost_ = new java.util.ArrayList(cost_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.AggregatedCost, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder> costBuilder_; + + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public java.util.List getCostList() { + if (costBuilder_ == null) { + return java.util.Collections.unmodifiableList(cost_); + } else { + return costBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public int getCostCount() { + if (costBuilder_ == null) { + return cost_.size(); + } else { + return costBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public org.tensorflow.proto.CostGraphDef.AggregatedCost getCost(int index) { + if (costBuilder_ == null) { + return cost_.get(index); + } else { + return costBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder setCost( + int index, org.tensorflow.proto.CostGraphDef.AggregatedCost value) { + if (costBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCostIsMutable(); + cost_.set(index, value); + onChanged(); + } else { + costBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder setCost( + int index, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder builderForValue) { + if (costBuilder_ == null) { + ensureCostIsMutable(); + cost_.set(index, builderForValue.build()); + onChanged(); + } else { + costBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder addCost(org.tensorflow.proto.CostGraphDef.AggregatedCost value) { + if (costBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCostIsMutable(); + cost_.add(value); + onChanged(); + } else { + costBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder addCost( + int index, org.tensorflow.proto.CostGraphDef.AggregatedCost value) { + if (costBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCostIsMutable(); + cost_.add(index, value); + onChanged(); + } else { + costBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder addCost( + org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder builderForValue) { + if (costBuilder_ == null) { + ensureCostIsMutable(); + cost_.add(builderForValue.build()); + onChanged(); + } else { + costBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder addCost( + int index, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder builderForValue) { + if (costBuilder_ == null) { + ensureCostIsMutable(); + cost_.add(index, builderForValue.build()); + onChanged(); + } else { + costBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder addAllCost( + java.lang.Iterable values) { + if (costBuilder_ == null) { + ensureCostIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, cost_); + onChanged(); + } else { + costBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder clearCost() { + if (costBuilder_ == null) { + cost_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + costBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public Builder removeCost(int index) { + if (costBuilder_ == null) { + ensureCostIsMutable(); + cost_.remove(index); + onChanged(); + } else { + costBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder getCostBuilder( + int index) { + return getCostFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( + int index) { + if (costBuilder_ == null) { + return cost_.get(index); } else { + return costBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public java.util.List + getCostOrBuilderList() { + if (costBuilder_ != null) { + return costBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cost_); + } + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder addCostBuilder() { + return getCostFieldBuilder().addBuilder( + org.tensorflow.proto.CostGraphDef.AggregatedCost.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder addCostBuilder( + int index) { + return getCostFieldBuilder().addBuilder( + index, org.tensorflow.proto.CostGraphDef.AggregatedCost.getDefaultInstance()); + } + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + public java.util.List + getCostBuilderList() { + return getCostFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.AggregatedCost, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder> + getCostFieldBuilder() { + if (costBuilder_ == null) { + costBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.CostGraphDef.AggregatedCost, org.tensorflow.proto.CostGraphDef.AggregatedCost.Builder, org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder>( + cost_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + cost_ = null; + } + return costBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CostGraphDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CostGraphDef) + private static final org.tensorflow.proto.CostGraphDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.CostGraphDef(); + } + + public static org.tensorflow.proto.CostGraphDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CostGraphDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.CostGraphDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDefOrBuilder.java new file mode 100644 index 00000000000..ad2f98d6283 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphDefOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/cost_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface CostGraphDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CostGraphDef) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + java.util.List + getNodeList(); + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + org.tensorflow.proto.CostGraphDef.Node getNode(int index); + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + int getNodeCount(); + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + java.util.List + getNodeOrBuilderList(); + /** + * repeated .tensorflow.CostGraphDef.Node node = 1; + */ + org.tensorflow.proto.CostGraphDef.NodeOrBuilder getNodeOrBuilder( + int index); + + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + java.util.List + getCostList(); + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + org.tensorflow.proto.CostGraphDef.AggregatedCost getCost(int index); + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + int getCostCount(); + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + java.util.List + getCostOrBuilderList(); + /** + * repeated .tensorflow.CostGraphDef.AggregatedCost cost = 2; + */ + org.tensorflow.proto.CostGraphDef.AggregatedCostOrBuilder getCostOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphProtos.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphProtos.java index b115a24c302..b99348c8a2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/CostGraphProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/CostGraphProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/cost_graph.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class CostGraphProtos { private CostGraphProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CostGraphProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,27 +28,27 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CostGraphDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CostGraphDef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CostGraphDef_Node_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -72,50 +83,51 @@ public static void registerAllExtensions( "ut_port\030\002 \001(\003\022+\n\005shape\030\003 \001(\0132\034.tensorflo" + "w.TensorShapeProto\022#\n\005dtype\030\004 \001(\0162\024.tens" + "orflow.DataType\0321\n\016AggregatedCost\022\014\n\004cos" + - "t\030\001 \001(\002\022\021\n\tdimension\030\002 \001(\tB\211\001\n\036org.tenso" + - "rflow.proto.frameworkB\017CostGraphProtosP\001" + - "ZQgithub.com/tensorflow/tensorflow/tenso" + - "rflow/go/core/framework/cost_graph_go_pr" + - "oto\370\001\001b\006proto3" + "t\030\001 \001(\002\022\021\n\tdimension\030\002 \001(\tB\177\n\024org.tensor" + + "flow.protoB\017CostGraphProtosP\001ZQgithub.co" + + "m/tensorflow/tensorflow/tensorflow/go/co" + + "re/framework/cost_graph_go_proto\370\001\001b\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), }); internal_static_tensorflow_CostGraphDef_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_CostGraphDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CostGraphDef_descriptor, new java.lang.String[] { "Node", "Cost", }); internal_static_tensorflow_CostGraphDef_Node_descriptor = internal_static_tensorflow_CostGraphDef_descriptor.getNestedTypes().get(0); internal_static_tensorflow_CostGraphDef_Node_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CostGraphDef_Node_descriptor, new java.lang.String[] { "Name", "Device", "Id", "InputInfo", "OutputInfo", "TemporaryMemorySize", "PersistentMemorySize", "HostTempMemorySize", "DeviceTempMemorySize", "DevicePersistentMemorySize", "ComputeCost", "ComputeTime", "MemoryTime", "IsFinal", "ControlInput", "Inaccurate", }); internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor = internal_static_tensorflow_CostGraphDef_Node_descriptor.getNestedTypes().get(0); internal_static_tensorflow_CostGraphDef_Node_InputInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CostGraphDef_Node_InputInfo_descriptor, new java.lang.String[] { "PrecedingNode", "PrecedingPort", }); internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor = internal_static_tensorflow_CostGraphDef_Node_descriptor.getNestedTypes().get(1); internal_static_tensorflow_CostGraphDef_Node_OutputInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CostGraphDef_Node_OutputInfo_descriptor, new java.lang.String[] { "Size", "AliasInputPort", "Shape", "Dtype", }); internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor = internal_static_tensorflow_CostGraphDef_descriptor.getNestedTypes().get(1); internal_static_tensorflow_CostGraphDef_AggregatedCost_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_CostGraphDef_AggregatedCost_descriptor, new java.lang.String[] { "Cost", "Dimension", }); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataClass.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataClass.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataClass.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataClass.java index eb7123c795d..829ae281b70 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DataClass.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataClass.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/summary.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; /** * Protobuf enum {@code tensorflow.DataClass} @@ -49,6 +51,15 @@ public enum DataClass UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DataClass.class.getName()); + } /** *
        * Unknown data class, used (implicitly) for legacy data. Will not be
    @@ -98,6 +109,8 @@ public final int getNumber() {
       }
     
       /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
        * @deprecated Use {@link #forNumber(int)} instead.
        */
       @java.lang.Deprecated
    @@ -105,6 +118,10 @@ public static DataClass valueOf(int value) {
         return forNumber(value);
       }
     
    +  /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
    +   */
       public static DataClass forNumber(int value) {
         switch (value) {
           case 0: return DATA_CLASS_UNKNOWN;
    @@ -129,6 +146,10 @@ public DataClass findValueByNumber(int number) {
     
       public final com.google.protobuf.Descriptors.EnumValueDescriptor
           getValueDescriptor() {
    +    if (this == UNRECOGNIZED) {
    +      throw new java.lang.IllegalStateException(
    +          "Can't get the descriptor of an unrecognized enum value.");
    +    }
         return getDescriptor().getValues().get(ordinal());
       }
       public final com.google.protobuf.Descriptors.EnumDescriptor
    @@ -137,7 +158,7 @@ public DataClass findValueByNumber(int number) {
       }
       public static final com.google.protobuf.Descriptors.EnumDescriptor
           getDescriptor() {
    -    return org.tensorflow.proto.framework.SummaryProtos.getDescriptor().getEnumTypes().get(0);
    +    return org.tensorflow.proto.SummaryProtos.getDescriptor().getEnumTypes().get(0);
       }
     
       private static final DataClass[] VALUES = values();
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataType.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataType.java
    new file mode 100644
    index 00000000000..efc05c83db4
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DataType.java
    @@ -0,0 +1,840 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/types.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * (== suppress_warning documentation-presence ==)
    + * LINT.IfChange
    + * 
    + * + * Protobuf enum {@code tensorflow.DataType} + */ +public enum DataType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +   * Not a legal value for DataType.  Used to indicate a DataType field
    +   * has not been set.
    +   * 
    + * + * DT_INVALID = 0; + */ + DT_INVALID(0), + /** + *
    +   * Data types that all computation devices are expected to be
    +   * capable to support.
    +   * 
    + * + * DT_FLOAT = 1; + */ + DT_FLOAT(1), + /** + * DT_DOUBLE = 2; + */ + DT_DOUBLE(2), + /** + * DT_INT32 = 3; + */ + DT_INT32(3), + /** + * DT_UINT8 = 4; + */ + DT_UINT8(4), + /** + * DT_INT16 = 5; + */ + DT_INT16(5), + /** + * DT_INT8 = 6; + */ + DT_INT8(6), + /** + * DT_STRING = 7; + */ + DT_STRING(7), + /** + *
    +   * Single-precision complex
    +   * 
    + * + * DT_COMPLEX64 = 8; + */ + DT_COMPLEX64(8), + /** + * DT_INT64 = 9; + */ + DT_INT64(9), + /** + * DT_BOOL = 10; + */ + DT_BOOL(10), + /** + *
    +   * Quantized int8
    +   * 
    + * + * DT_QINT8 = 11; + */ + DT_QINT8(11), + /** + *
    +   * Quantized uint8
    +   * 
    + * + * DT_QUINT8 = 12; + */ + DT_QUINT8(12), + /** + *
    +   * Quantized int32
    +   * 
    + * + * DT_QINT32 = 13; + */ + DT_QINT32(13), + /** + *
    +   * Float32 truncated to 16 bits.
    +   * 
    + * + * DT_BFLOAT16 = 14; + */ + DT_BFLOAT16(14), + /** + *
    +   * Quantized int16
    +   * 
    + * + * DT_QINT16 = 15; + */ + DT_QINT16(15), + /** + *
    +   * Quantized uint16
    +   * 
    + * + * DT_QUINT16 = 16; + */ + DT_QUINT16(16), + /** + * DT_UINT16 = 17; + */ + DT_UINT16(17), + /** + *
    +   * Double-precision complex
    +   * 
    + * + * DT_COMPLEX128 = 18; + */ + DT_COMPLEX128(18), + /** + * DT_HALF = 19; + */ + DT_HALF(19), + /** + * DT_RESOURCE = 20; + */ + DT_RESOURCE(20), + /** + *
    +   * Arbitrary C++ data types
    +   * 
    + * + * DT_VARIANT = 21; + */ + DT_VARIANT(21), + /** + * DT_UINT32 = 22; + */ + DT_UINT32(22), + /** + * DT_UINT64 = 23; + */ + DT_UINT64(23), + /** + *
    +   * 5 exponent bits, 2 mantissa bits.
    +   * 
    + * + * DT_FLOAT8_E5M2 = 24; + */ + DT_FLOAT8_E5M2(24), + /** + *
    +   * 4 exponent bits, 3 mantissa bits, finite-only, with
    +   * 
    + * + * DT_FLOAT8_E4M3FN = 25; + */ + DT_FLOAT8_E4M3FN(25), + /** + *
    +   * 2 NaNs (0bS1111111).
    +   * 
    + * + * DT_FLOAT8_E4M3FNUZ = 26; + */ + DT_FLOAT8_E4M3FNUZ(26), + /** + *
    +   * with NaN.
    +   * 
    + * + * DT_FLOAT8_E4M3B11FNUZ = 27; + */ + DT_FLOAT8_E4M3B11FNUZ(27), + /** + *
    +   * bias, finite-only, with NaNs.
    +   * 
    + * + * DT_FLOAT8_E5M2FNUZ = 28; + */ + DT_FLOAT8_E5M2FNUZ(28), + /** + * DT_INT4 = 29; + */ + DT_INT4(29), + /** + * DT_UINT4 = 30; + */ + DT_UINT4(30), + /** + * DT_INT2 = 31; + */ + DT_INT2(31), + /** + * DT_UINT2 = 32; + */ + DT_UINT2(32), + /** + *
    +   * Do not use!  These are only for TF1's obsolete reference Variables.
    +   * Every enum above should have a corresponding value below (verified by
    +   * types_test).
    +   * 
    + * + * DT_FLOAT_REF = 101; + */ + DT_FLOAT_REF(101), + /** + * DT_DOUBLE_REF = 102; + */ + DT_DOUBLE_REF(102), + /** + * DT_INT32_REF = 103; + */ + DT_INT32_REF(103), + /** + * DT_UINT8_REF = 104; + */ + DT_UINT8_REF(104), + /** + * DT_INT16_REF = 105; + */ + DT_INT16_REF(105), + /** + * DT_INT8_REF = 106; + */ + DT_INT8_REF(106), + /** + * DT_STRING_REF = 107; + */ + DT_STRING_REF(107), + /** + * DT_COMPLEX64_REF = 108; + */ + DT_COMPLEX64_REF(108), + /** + * DT_INT64_REF = 109; + */ + DT_INT64_REF(109), + /** + * DT_BOOL_REF = 110; + */ + DT_BOOL_REF(110), + /** + * DT_QINT8_REF = 111; + */ + DT_QINT8_REF(111), + /** + * DT_QUINT8_REF = 112; + */ + DT_QUINT8_REF(112), + /** + * DT_QINT32_REF = 113; + */ + DT_QINT32_REF(113), + /** + * DT_BFLOAT16_REF = 114; + */ + DT_BFLOAT16_REF(114), + /** + * DT_QINT16_REF = 115; + */ + DT_QINT16_REF(115), + /** + * DT_QUINT16_REF = 116; + */ + DT_QUINT16_REF(116), + /** + * DT_UINT16_REF = 117; + */ + DT_UINT16_REF(117), + /** + * DT_COMPLEX128_REF = 118; + */ + DT_COMPLEX128_REF(118), + /** + * DT_HALF_REF = 119; + */ + DT_HALF_REF(119), + /** + * DT_RESOURCE_REF = 120; + */ + DT_RESOURCE_REF(120), + /** + * DT_VARIANT_REF = 121; + */ + DT_VARIANT_REF(121), + /** + * DT_UINT32_REF = 122; + */ + DT_UINT32_REF(122), + /** + * DT_UINT64_REF = 123; + */ + DT_UINT64_REF(123), + /** + * DT_FLOAT8_E5M2_REF = 124; + */ + DT_FLOAT8_E5M2_REF(124), + /** + * DT_FLOAT8_E4M3FN_REF = 125; + */ + DT_FLOAT8_E4M3FN_REF(125), + /** + * DT_FLOAT8_E4M3FNUZ_REF = 126; + */ + DT_FLOAT8_E4M3FNUZ_REF(126), + /** + * DT_FLOAT8_E4M3B11FNUZ_REF = 127; + */ + DT_FLOAT8_E4M3B11FNUZ_REF(127), + /** + * DT_FLOAT8_E5M2FNUZ_REF = 128; + */ + DT_FLOAT8_E5M2FNUZ_REF(128), + /** + * DT_INT4_REF = 129; + */ + DT_INT4_REF(129), + /** + * DT_UINT4_REF = 130; + */ + DT_UINT4_REF(130), + /** + * DT_INT2_REF = 131; + */ + DT_INT2_REF(131), + /** + * DT_UINT2_REF = 132; + */ + DT_UINT2_REF(132), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DataType.class.getName()); + } + /** + *
    +   * Not a legal value for DataType.  Used to indicate a DataType field
    +   * has not been set.
    +   * 
    + * + * DT_INVALID = 0; + */ + public static final int DT_INVALID_VALUE = 0; + /** + *
    +   * Data types that all computation devices are expected to be
    +   * capable to support.
    +   * 
    + * + * DT_FLOAT = 1; + */ + public static final int DT_FLOAT_VALUE = 1; + /** + * DT_DOUBLE = 2; + */ + public static final int DT_DOUBLE_VALUE = 2; + /** + * DT_INT32 = 3; + */ + public static final int DT_INT32_VALUE = 3; + /** + * DT_UINT8 = 4; + */ + public static final int DT_UINT8_VALUE = 4; + /** + * DT_INT16 = 5; + */ + public static final int DT_INT16_VALUE = 5; + /** + * DT_INT8 = 6; + */ + public static final int DT_INT8_VALUE = 6; + /** + * DT_STRING = 7; + */ + public static final int DT_STRING_VALUE = 7; + /** + *
    +   * Single-precision complex
    +   * 
    + * + * DT_COMPLEX64 = 8; + */ + public static final int DT_COMPLEX64_VALUE = 8; + /** + * DT_INT64 = 9; + */ + public static final int DT_INT64_VALUE = 9; + /** + * DT_BOOL = 10; + */ + public static final int DT_BOOL_VALUE = 10; + /** + *
    +   * Quantized int8
    +   * 
    + * + * DT_QINT8 = 11; + */ + public static final int DT_QINT8_VALUE = 11; + /** + *
    +   * Quantized uint8
    +   * 
    + * + * DT_QUINT8 = 12; + */ + public static final int DT_QUINT8_VALUE = 12; + /** + *
    +   * Quantized int32
    +   * 
    + * + * DT_QINT32 = 13; + */ + public static final int DT_QINT32_VALUE = 13; + /** + *
    +   * Float32 truncated to 16 bits.
    +   * 
    + * + * DT_BFLOAT16 = 14; + */ + public static final int DT_BFLOAT16_VALUE = 14; + /** + *
    +   * Quantized int16
    +   * 
    + * + * DT_QINT16 = 15; + */ + public static final int DT_QINT16_VALUE = 15; + /** + *
    +   * Quantized uint16
    +   * 
    + * + * DT_QUINT16 = 16; + */ + public static final int DT_QUINT16_VALUE = 16; + /** + * DT_UINT16 = 17; + */ + public static final int DT_UINT16_VALUE = 17; + /** + *
    +   * Double-precision complex
    +   * 
    + * + * DT_COMPLEX128 = 18; + */ + public static final int DT_COMPLEX128_VALUE = 18; + /** + * DT_HALF = 19; + */ + public static final int DT_HALF_VALUE = 19; + /** + * DT_RESOURCE = 20; + */ + public static final int DT_RESOURCE_VALUE = 20; + /** + *
    +   * Arbitrary C++ data types
    +   * 
    + * + * DT_VARIANT = 21; + */ + public static final int DT_VARIANT_VALUE = 21; + /** + * DT_UINT32 = 22; + */ + public static final int DT_UINT32_VALUE = 22; + /** + * DT_UINT64 = 23; + */ + public static final int DT_UINT64_VALUE = 23; + /** + *
    +   * 5 exponent bits, 2 mantissa bits.
    +   * 
    + * + * DT_FLOAT8_E5M2 = 24; + */ + public static final int DT_FLOAT8_E5M2_VALUE = 24; + /** + *
    +   * 4 exponent bits, 3 mantissa bits, finite-only, with
    +   * 
    + * + * DT_FLOAT8_E4M3FN = 25; + */ + public static final int DT_FLOAT8_E4M3FN_VALUE = 25; + /** + *
    +   * 2 NaNs (0bS1111111).
    +   * 
    + * + * DT_FLOAT8_E4M3FNUZ = 26; + */ + public static final int DT_FLOAT8_E4M3FNUZ_VALUE = 26; + /** + *
    +   * with NaN.
    +   * 
    + * + * DT_FLOAT8_E4M3B11FNUZ = 27; + */ + public static final int DT_FLOAT8_E4M3B11FNUZ_VALUE = 27; + /** + *
    +   * bias, finite-only, with NaNs.
    +   * 
    + * + * DT_FLOAT8_E5M2FNUZ = 28; + */ + public static final int DT_FLOAT8_E5M2FNUZ_VALUE = 28; + /** + * DT_INT4 = 29; + */ + public static final int DT_INT4_VALUE = 29; + /** + * DT_UINT4 = 30; + */ + public static final int DT_UINT4_VALUE = 30; + /** + * DT_INT2 = 31; + */ + public static final int DT_INT2_VALUE = 31; + /** + * DT_UINT2 = 32; + */ + public static final int DT_UINT2_VALUE = 32; + /** + *
    +   * Do not use!  These are only for TF1's obsolete reference Variables.
    +   * Every enum above should have a corresponding value below (verified by
    +   * types_test).
    +   * 
    + * + * DT_FLOAT_REF = 101; + */ + public static final int DT_FLOAT_REF_VALUE = 101; + /** + * DT_DOUBLE_REF = 102; + */ + public static final int DT_DOUBLE_REF_VALUE = 102; + /** + * DT_INT32_REF = 103; + */ + public static final int DT_INT32_REF_VALUE = 103; + /** + * DT_UINT8_REF = 104; + */ + public static final int DT_UINT8_REF_VALUE = 104; + /** + * DT_INT16_REF = 105; + */ + public static final int DT_INT16_REF_VALUE = 105; + /** + * DT_INT8_REF = 106; + */ + public static final int DT_INT8_REF_VALUE = 106; + /** + * DT_STRING_REF = 107; + */ + public static final int DT_STRING_REF_VALUE = 107; + /** + * DT_COMPLEX64_REF = 108; + */ + public static final int DT_COMPLEX64_REF_VALUE = 108; + /** + * DT_INT64_REF = 109; + */ + public static final int DT_INT64_REF_VALUE = 109; + /** + * DT_BOOL_REF = 110; + */ + public static final int DT_BOOL_REF_VALUE = 110; + /** + * DT_QINT8_REF = 111; + */ + public static final int DT_QINT8_REF_VALUE = 111; + /** + * DT_QUINT8_REF = 112; + */ + public static final int DT_QUINT8_REF_VALUE = 112; + /** + * DT_QINT32_REF = 113; + */ + public static final int DT_QINT32_REF_VALUE = 113; + /** + * DT_BFLOAT16_REF = 114; + */ + public static final int DT_BFLOAT16_REF_VALUE = 114; + /** + * DT_QINT16_REF = 115; + */ + public static final int DT_QINT16_REF_VALUE = 115; + /** + * DT_QUINT16_REF = 116; + */ + public static final int DT_QUINT16_REF_VALUE = 116; + /** + * DT_UINT16_REF = 117; + */ + public static final int DT_UINT16_REF_VALUE = 117; + /** + * DT_COMPLEX128_REF = 118; + */ + public static final int DT_COMPLEX128_REF_VALUE = 118; + /** + * DT_HALF_REF = 119; + */ + public static final int DT_HALF_REF_VALUE = 119; + /** + * DT_RESOURCE_REF = 120; + */ + public static final int DT_RESOURCE_REF_VALUE = 120; + /** + * DT_VARIANT_REF = 121; + */ + public static final int DT_VARIANT_REF_VALUE = 121; + /** + * DT_UINT32_REF = 122; + */ + public static final int DT_UINT32_REF_VALUE = 122; + /** + * DT_UINT64_REF = 123; + */ + public static final int DT_UINT64_REF_VALUE = 123; + /** + * DT_FLOAT8_E5M2_REF = 124; + */ + public static final int DT_FLOAT8_E5M2_REF_VALUE = 124; + /** + * DT_FLOAT8_E4M3FN_REF = 125; + */ + public static final int DT_FLOAT8_E4M3FN_REF_VALUE = 125; + /** + * DT_FLOAT8_E4M3FNUZ_REF = 126; + */ + public static final int DT_FLOAT8_E4M3FNUZ_REF_VALUE = 126; + /** + * DT_FLOAT8_E4M3B11FNUZ_REF = 127; + */ + public static final int DT_FLOAT8_E4M3B11FNUZ_REF_VALUE = 127; + /** + * DT_FLOAT8_E5M2FNUZ_REF = 128; + */ + public static final int DT_FLOAT8_E5M2FNUZ_REF_VALUE = 128; + /** + * DT_INT4_REF = 129; + */ + public static final int DT_INT4_REF_VALUE = 129; + /** + * DT_UINT4_REF = 130; + */ + public static final int DT_UINT4_REF_VALUE = 130; + /** + * DT_INT2_REF = 131; + */ + public static final int DT_INT2_REF_VALUE = 131; + /** + * DT_UINT2_REF = 132; + */ + public static final int DT_UINT2_REF_VALUE = 132; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataType forNumber(int value) { + switch (value) { + case 0: return DT_INVALID; + case 1: return DT_FLOAT; + case 2: return DT_DOUBLE; + case 3: return DT_INT32; + case 4: return DT_UINT8; + case 5: return DT_INT16; + case 6: return DT_INT8; + case 7: return DT_STRING; + case 8: return DT_COMPLEX64; + case 9: return DT_INT64; + case 10: return DT_BOOL; + case 11: return DT_QINT8; + case 12: return DT_QUINT8; + case 13: return DT_QINT32; + case 14: return DT_BFLOAT16; + case 15: return DT_QINT16; + case 16: return DT_QUINT16; + case 17: return DT_UINT16; + case 18: return DT_COMPLEX128; + case 19: return DT_HALF; + case 20: return DT_RESOURCE; + case 21: return DT_VARIANT; + case 22: return DT_UINT32; + case 23: return DT_UINT64; + case 24: return DT_FLOAT8_E5M2; + case 25: return DT_FLOAT8_E4M3FN; + case 26: return DT_FLOAT8_E4M3FNUZ; + case 27: return DT_FLOAT8_E4M3B11FNUZ; + case 28: return DT_FLOAT8_E5M2FNUZ; + case 29: return DT_INT4; + case 30: return DT_UINT4; + case 31: return DT_INT2; + case 32: return DT_UINT2; + case 101: return DT_FLOAT_REF; + case 102: return DT_DOUBLE_REF; + case 103: return DT_INT32_REF; + case 104: return DT_UINT8_REF; + case 105: return DT_INT16_REF; + case 106: return DT_INT8_REF; + case 107: return DT_STRING_REF; + case 108: return DT_COMPLEX64_REF; + case 109: return DT_INT64_REF; + case 110: return DT_BOOL_REF; + case 111: return DT_QINT8_REF; + case 112: return DT_QUINT8_REF; + case 113: return DT_QINT32_REF; + case 114: return DT_BFLOAT16_REF; + case 115: return DT_QINT16_REF; + case 116: return DT_QUINT16_REF; + case 117: return DT_UINT16_REF; + case 118: return DT_COMPLEX128_REF; + case 119: return DT_HALF_REF; + case 120: return DT_RESOURCE_REF; + case 121: return DT_VARIANT_REF; + case 122: return DT_UINT32_REF; + case 123: return DT_UINT64_REF; + case 124: return DT_FLOAT8_E5M2_REF; + case 125: return DT_FLOAT8_E4M3FN_REF; + case 126: return DT_FLOAT8_E4M3FNUZ_REF; + case 127: return DT_FLOAT8_E4M3B11FNUZ_REF; + case 128: return DT_FLOAT8_E5M2FNUZ_REF; + case 129: return DT_INT4_REF; + case 130: return DT_UINT4_REF; + case 131: return DT_INT2_REF; + case 132: return DT_UINT2_REF; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + DataType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataType findValueByNumber(int number) { + return DataType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.TypesProtos.getDescriptor().getEnumTypes().get(0); + } + + private static final DataType[] VALUES = values(); + + public static DataType 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 DataType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.DataType) +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEvent.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEvent.java new file mode 100644 index 00000000000..8b27fc51240 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEvent.java @@ -0,0 +1,2917 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * An Event related to the debugging of a TensorFlow program.
    + * 
    + * + * Protobuf type {@code tensorflow.DebugEvent} + */ +public final class DebugEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebugEvent) + DebugEventOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugEvent.class.getName()); + } + // Use DebugEvent.newBuilder() to construct. + private DebugEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebugEvent() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugEvent.class, org.tensorflow.proto.DebugEvent.Builder.class); + } + + private int whatCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object what_; + public enum WhatCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DEBUG_METADATA(3), + SOURCE_FILE(4), + STACK_FRAME_WITH_ID(6), + GRAPH_OP_CREATION(7), + DEBUGGED_GRAPH(8), + EXECUTION(9), + GRAPH_EXECUTION_TRACE(10), + GRAPH_ID(11), + DEBUGGED_DEVICE(12), + WHAT_NOT_SET(0); + private final int value; + private WhatCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WhatCase valueOf(int value) { + return forNumber(value); + } + + public static WhatCase forNumber(int value) { + switch (value) { + case 3: return DEBUG_METADATA; + case 4: return SOURCE_FILE; + case 6: return STACK_FRAME_WITH_ID; + case 7: return GRAPH_OP_CREATION; + case 8: return DEBUGGED_GRAPH; + case 9: return EXECUTION; + case 10: return GRAPH_EXECUTION_TRACE; + case 11: return GRAPH_ID; + case 12: return DEBUGGED_DEVICE; + case 0: return WHAT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public WhatCase + getWhatCase() { + return WhatCase.forNumber( + whatCase_); + } + + public static final int WALL_TIME_FIELD_NUMBER = 1; + private double wallTime_ = 0D; + /** + *
    +   * Timestamp in seconds (with microsecond precision).
    +   * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + + public static final int STEP_FIELD_NUMBER = 2; + private long step_ = 0L; + /** + *
    +   * Step of training (if available).
    +   * 
    + * + * int64 step = 2; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + + public static final int DEBUG_METADATA_FIELD_NUMBER = 3; + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return Whether the debugMetadata field is set. + */ + @java.lang.Override + public boolean hasDebugMetadata() { + return whatCase_ == 3; + } + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return The debugMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.DebugMetadata getDebugMetadata() { + if (whatCase_ == 3) { + return (org.tensorflow.proto.DebugMetadata) what_; + } + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + @java.lang.Override + public org.tensorflow.proto.DebugMetadataOrBuilder getDebugMetadataOrBuilder() { + if (whatCase_ == 3) { + return (org.tensorflow.proto.DebugMetadata) what_; + } + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + + public static final int SOURCE_FILE_FIELD_NUMBER = 4; + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return Whether the sourceFile field is set. + */ + @java.lang.Override + public boolean hasSourceFile() { + return whatCase_ == 4; + } + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return The sourceFile. + */ + @java.lang.Override + public org.tensorflow.proto.SourceFile getSourceFile() { + if (whatCase_ == 4) { + return (org.tensorflow.proto.SourceFile) what_; + } + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + @java.lang.Override + public org.tensorflow.proto.SourceFileOrBuilder getSourceFileOrBuilder() { + if (whatCase_ == 4) { + return (org.tensorflow.proto.SourceFile) what_; + } + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + + public static final int STACK_FRAME_WITH_ID_FIELD_NUMBER = 6; + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return Whether the stackFrameWithId field is set. + */ + @java.lang.Override + public boolean hasStackFrameWithId() { + return whatCase_ == 6; + } + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return The stackFrameWithId. + */ + @java.lang.Override + public org.tensorflow.proto.StackFrameWithId getStackFrameWithId() { + if (whatCase_ == 6) { + return (org.tensorflow.proto.StackFrameWithId) what_; + } + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + @java.lang.Override + public org.tensorflow.proto.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder() { + if (whatCase_ == 6) { + return (org.tensorflow.proto.StackFrameWithId) what_; + } + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + + public static final int GRAPH_OP_CREATION_FIELD_NUMBER = 7; + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return Whether the graphOpCreation field is set. + */ + @java.lang.Override + public boolean hasGraphOpCreation() { + return whatCase_ == 7; + } + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return The graphOpCreation. + */ + @java.lang.Override + public org.tensorflow.proto.GraphOpCreation getGraphOpCreation() { + if (whatCase_ == 7) { + return (org.tensorflow.proto.GraphOpCreation) what_; + } + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + @java.lang.Override + public org.tensorflow.proto.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder() { + if (whatCase_ == 7) { + return (org.tensorflow.proto.GraphOpCreation) what_; + } + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + + public static final int DEBUGGED_GRAPH_FIELD_NUMBER = 8; + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return Whether the debuggedGraph field is set. + */ + @java.lang.Override + public boolean hasDebuggedGraph() { + return whatCase_ == 8; + } + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return The debuggedGraph. + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedGraph getDebuggedGraph() { + if (whatCase_ == 8) { + return (org.tensorflow.proto.DebuggedGraph) what_; + } + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder() { + if (whatCase_ == 8) { + return (org.tensorflow.proto.DebuggedGraph) what_; + } + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + + public static final int EXECUTION_FIELD_NUMBER = 9; + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + * @return Whether the execution field is set. + */ + @java.lang.Override + public boolean hasExecution() { + return whatCase_ == 9; + } + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + * @return The execution. + */ + @java.lang.Override + public org.tensorflow.proto.Execution getExecution() { + if (whatCase_ == 9) { + return (org.tensorflow.proto.Execution) what_; + } + return org.tensorflow.proto.Execution.getDefaultInstance(); + } + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + */ + @java.lang.Override + public org.tensorflow.proto.ExecutionOrBuilder getExecutionOrBuilder() { + if (whatCase_ == 9) { + return (org.tensorflow.proto.Execution) what_; + } + return org.tensorflow.proto.Execution.getDefaultInstance(); + } + + public static final int GRAPH_EXECUTION_TRACE_FIELD_NUMBER = 10; + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return Whether the graphExecutionTrace field is set. + */ + @java.lang.Override + public boolean hasGraphExecutionTrace() { + return whatCase_ == 10; + } + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return The graphExecutionTrace. + */ + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTrace getGraphExecutionTrace() { + if (whatCase_ == 10) { + return (org.tensorflow.proto.GraphExecutionTrace) what_; + } + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder() { + if (whatCase_ == 10) { + return (org.tensorflow.proto.GraphExecutionTrace) what_; + } + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + + public static final int GRAPH_ID_FIELD_NUMBER = 11; + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return Whether the graphId field is set. + */ + public boolean hasGraphId() { + return whatCase_ == 11; + } + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return The graphId. + */ + public java.lang.String getGraphId() { + java.lang.Object ref = ""; + if (whatCase_ == 11) { + ref = what_; + } + 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(); + if (whatCase_ == 11) { + what_ = s; + } + return s; + } + } + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return The bytes for graphId. + */ + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = ""; + if (whatCase_ == 11) { + ref = what_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (whatCase_ == 11) { + what_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEBUGGED_DEVICE_FIELD_NUMBER = 12; + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return Whether the debuggedDevice field is set. + */ + @java.lang.Override + public boolean hasDebuggedDevice() { + return whatCase_ == 12; + } + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return The debuggedDevice. + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedDevice getDebuggedDevice() { + if (whatCase_ == 12) { + return (org.tensorflow.proto.DebuggedDevice) what_; + } + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder() { + if (whatCase_ == 12) { + return (org.tensorflow.proto.DebuggedDevice) what_; + } + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + + 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 (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + output.writeDouble(1, wallTime_); + } + if (step_ != 0L) { + output.writeInt64(2, step_); + } + if (whatCase_ == 3) { + output.writeMessage(3, (org.tensorflow.proto.DebugMetadata) what_); + } + if (whatCase_ == 4) { + output.writeMessage(4, (org.tensorflow.proto.SourceFile) what_); + } + if (whatCase_ == 6) { + output.writeMessage(6, (org.tensorflow.proto.StackFrameWithId) what_); + } + if (whatCase_ == 7) { + output.writeMessage(7, (org.tensorflow.proto.GraphOpCreation) what_); + } + if (whatCase_ == 8) { + output.writeMessage(8, (org.tensorflow.proto.DebuggedGraph) what_); + } + if (whatCase_ == 9) { + output.writeMessage(9, (org.tensorflow.proto.Execution) what_); + } + if (whatCase_ == 10) { + output.writeMessage(10, (org.tensorflow.proto.GraphExecutionTrace) what_); + } + if (whatCase_ == 11) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, what_); + } + if (whatCase_ == 12) { + output.writeMessage(12, (org.tensorflow.proto.DebuggedDevice) what_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, wallTime_); + } + if (step_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, step_); + } + if (whatCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (org.tensorflow.proto.DebugMetadata) what_); + } + if (whatCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (org.tensorflow.proto.SourceFile) what_); + } + if (whatCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (org.tensorflow.proto.StackFrameWithId) what_); + } + if (whatCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (org.tensorflow.proto.GraphOpCreation) what_); + } + if (whatCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (org.tensorflow.proto.DebuggedGraph) what_); + } + if (whatCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, (org.tensorflow.proto.Execution) what_); + } + if (whatCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (org.tensorflow.proto.GraphExecutionTrace) what_); + } + if (whatCase_ == 11) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, what_); + } + if (whatCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, (org.tensorflow.proto.DebuggedDevice) what_); + } + size += getUnknownFields().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.DebugEvent)) { + return super.equals(obj); + } + org.tensorflow.proto.DebugEvent other = (org.tensorflow.proto.DebugEvent) obj; + + if (java.lang.Double.doubleToLongBits(getWallTime()) + != java.lang.Double.doubleToLongBits( + other.getWallTime())) return false; + if (getStep() + != other.getStep()) return false; + if (!getWhatCase().equals(other.getWhatCase())) return false; + switch (whatCase_) { + case 3: + if (!getDebugMetadata() + .equals(other.getDebugMetadata())) return false; + break; + case 4: + if (!getSourceFile() + .equals(other.getSourceFile())) return false; + break; + case 6: + if (!getStackFrameWithId() + .equals(other.getStackFrameWithId())) return false; + break; + case 7: + if (!getGraphOpCreation() + .equals(other.getGraphOpCreation())) return false; + break; + case 8: + if (!getDebuggedGraph() + .equals(other.getDebuggedGraph())) return false; + break; + case 9: + if (!getExecution() + .equals(other.getExecution())) return false; + break; + case 10: + if (!getGraphExecutionTrace() + .equals(other.getGraphExecutionTrace())) return false; + break; + case 11: + if (!getGraphId() + .equals(other.getGraphId())) return false; + break; + case 12: + if (!getDebuggedDevice() + .equals(other.getDebuggedDevice())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WALL_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getWallTime())); + hash = (37 * hash) + STEP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStep()); + switch (whatCase_) { + case 3: + hash = (37 * hash) + DEBUG_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getDebugMetadata().hashCode(); + break; + case 4: + hash = (37 * hash) + SOURCE_FILE_FIELD_NUMBER; + hash = (53 * hash) + getSourceFile().hashCode(); + break; + case 6: + hash = (37 * hash) + STACK_FRAME_WITH_ID_FIELD_NUMBER; + hash = (53 * hash) + getStackFrameWithId().hashCode(); + break; + case 7: + hash = (37 * hash) + GRAPH_OP_CREATION_FIELD_NUMBER; + hash = (53 * hash) + getGraphOpCreation().hashCode(); + break; + case 8: + hash = (37 * hash) + DEBUGGED_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + getDebuggedGraph().hashCode(); + break; + case 9: + hash = (37 * hash) + EXECUTION_FIELD_NUMBER; + hash = (53 * hash) + getExecution().hashCode(); + break; + case 10: + hash = (37 * hash) + GRAPH_EXECUTION_TRACE_FIELD_NUMBER; + hash = (53 * hash) + getGraphExecutionTrace().hashCode(); + break; + case 11: + hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; + hash = (53 * hash) + getGraphId().hashCode(); + break; + case 12: + hash = (37 * hash) + DEBUGGED_DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDebuggedDevice().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebugEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugEvent 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.DebugEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugEvent 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.DebugEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebugEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebugEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebugEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebugEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebugEvent 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * An Event related to the debugging of a TensorFlow program.
    +   * 
    + * + * Protobuf type {@code tensorflow.DebugEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebugEvent) + org.tensorflow.proto.DebugEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugEvent.class, org.tensorflow.proto.DebugEvent.Builder.class); + } + + // Construct using org.tensorflow.proto.DebugEvent.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + wallTime_ = 0D; + step_ = 0L; + if (debugMetadataBuilder_ != null) { + debugMetadataBuilder_.clear(); + } + if (sourceFileBuilder_ != null) { + sourceFileBuilder_.clear(); + } + if (stackFrameWithIdBuilder_ != null) { + stackFrameWithIdBuilder_.clear(); + } + if (graphOpCreationBuilder_ != null) { + graphOpCreationBuilder_.clear(); + } + if (debuggedGraphBuilder_ != null) { + debuggedGraphBuilder_.clear(); + } + if (executionBuilder_ != null) { + executionBuilder_.clear(); + } + if (graphExecutionTraceBuilder_ != null) { + graphExecutionTraceBuilder_.clear(); + } + if (debuggedDeviceBuilder_ != null) { + debuggedDeviceBuilder_.clear(); + } + whatCase_ = 0; + what_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugEvent_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebugEvent getDefaultInstanceForType() { + return org.tensorflow.proto.DebugEvent.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebugEvent build() { + org.tensorflow.proto.DebugEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebugEvent buildPartial() { + org.tensorflow.proto.DebugEvent result = new org.tensorflow.proto.DebugEvent(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebugEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.wallTime_ = wallTime_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.step_ = step_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.DebugEvent result) { + result.whatCase_ = whatCase_; + result.what_ = this.what_; + if (whatCase_ == 3 && + debugMetadataBuilder_ != null) { + result.what_ = debugMetadataBuilder_.build(); + } + if (whatCase_ == 4 && + sourceFileBuilder_ != null) { + result.what_ = sourceFileBuilder_.build(); + } + if (whatCase_ == 6 && + stackFrameWithIdBuilder_ != null) { + result.what_ = stackFrameWithIdBuilder_.build(); + } + if (whatCase_ == 7 && + graphOpCreationBuilder_ != null) { + result.what_ = graphOpCreationBuilder_.build(); + } + if (whatCase_ == 8 && + debuggedGraphBuilder_ != null) { + result.what_ = debuggedGraphBuilder_.build(); + } + if (whatCase_ == 9 && + executionBuilder_ != null) { + result.what_ = executionBuilder_.build(); + } + if (whatCase_ == 10 && + graphExecutionTraceBuilder_ != null) { + result.what_ = graphExecutionTraceBuilder_.build(); + } + if (whatCase_ == 12 && + debuggedDeviceBuilder_ != null) { + result.what_ = debuggedDeviceBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebugEvent) { + return mergeFrom((org.tensorflow.proto.DebugEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebugEvent other) { + if (other == org.tensorflow.proto.DebugEvent.getDefaultInstance()) return this; + if (other.getWallTime() != 0D) { + setWallTime(other.getWallTime()); + } + if (other.getStep() != 0L) { + setStep(other.getStep()); + } + switch (other.getWhatCase()) { + case DEBUG_METADATA: { + mergeDebugMetadata(other.getDebugMetadata()); + break; + } + case SOURCE_FILE: { + mergeSourceFile(other.getSourceFile()); + break; + } + case STACK_FRAME_WITH_ID: { + mergeStackFrameWithId(other.getStackFrameWithId()); + break; + } + case GRAPH_OP_CREATION: { + mergeGraphOpCreation(other.getGraphOpCreation()); + break; + } + case DEBUGGED_GRAPH: { + mergeDebuggedGraph(other.getDebuggedGraph()); + break; + } + case EXECUTION: { + mergeExecution(other.getExecution()); + break; + } + case GRAPH_EXECUTION_TRACE: { + mergeGraphExecutionTrace(other.getGraphExecutionTrace()); + break; + } + case GRAPH_ID: { + whatCase_ = 11; + what_ = other.what_; + onChanged(); + break; + } + case DEBUGGED_DEVICE: { + mergeDebuggedDevice(other.getDebuggedDevice()); + break; + } + case WHAT_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + wallTime_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 16: { + step_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getDebugMetadataFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 3; + break; + } // case 26 + case 34: { + input.readMessage( + getSourceFileFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 4; + break; + } // case 34 + case 50: { + input.readMessage( + getStackFrameWithIdFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 6; + break; + } // case 50 + case 58: { + input.readMessage( + getGraphOpCreationFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 7; + break; + } // case 58 + case 66: { + input.readMessage( + getDebuggedGraphFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 8; + break; + } // case 66 + case 74: { + input.readMessage( + getExecutionFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 9; + break; + } // case 74 + case 82: { + input.readMessage( + getGraphExecutionTraceFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 10; + break; + } // case 82 + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + whatCase_ = 11; + what_ = s; + break; + } // case 90 + case 98: { + input.readMessage( + getDebuggedDeviceFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 12; + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int whatCase_ = 0; + private java.lang.Object what_; + public WhatCase + getWhatCase() { + return WhatCase.forNumber( + whatCase_); + } + + public Builder clearWhat() { + whatCase_ = 0; + what_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private double wallTime_ ; + /** + *
    +     * Timestamp in seconds (with microsecond precision).
    +     * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + /** + *
    +     * Timestamp in seconds (with microsecond precision).
    +     * 
    + * + * double wall_time = 1; + * @param value The wallTime to set. + * @return This builder for chaining. + */ + public Builder setWallTime(double value) { + + wallTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Timestamp in seconds (with microsecond precision).
    +     * 
    + * + * double wall_time = 1; + * @return This builder for chaining. + */ + public Builder clearWallTime() { + bitField0_ = (bitField0_ & ~0x00000001); + wallTime_ = 0D; + onChanged(); + return this; + } + + private long step_ ; + /** + *
    +     * Step of training (if available).
    +     * 
    + * + * int64 step = 2; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + /** + *
    +     * Step of training (if available).
    +     * 
    + * + * int64 step = 2; + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep(long value) { + + step_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Step of training (if available).
    +     * 
    + * + * int64 step = 2; + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000002); + step_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugMetadata, org.tensorflow.proto.DebugMetadata.Builder, org.tensorflow.proto.DebugMetadataOrBuilder> debugMetadataBuilder_; + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return Whether the debugMetadata field is set. + */ + @java.lang.Override + public boolean hasDebugMetadata() { + return whatCase_ == 3; + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return The debugMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.DebugMetadata getDebugMetadata() { + if (debugMetadataBuilder_ == null) { + if (whatCase_ == 3) { + return (org.tensorflow.proto.DebugMetadata) what_; + } + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } else { + if (whatCase_ == 3) { + return debugMetadataBuilder_.getMessage(); + } + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + public Builder setDebugMetadata(org.tensorflow.proto.DebugMetadata value) { + if (debugMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + debugMetadataBuilder_.setMessage(value); + } + whatCase_ = 3; + return this; + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + public Builder setDebugMetadata( + org.tensorflow.proto.DebugMetadata.Builder builderForValue) { + if (debugMetadataBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + debugMetadataBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 3; + return this; + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + public Builder mergeDebugMetadata(org.tensorflow.proto.DebugMetadata value) { + if (debugMetadataBuilder_ == null) { + if (whatCase_ == 3 && + what_ != org.tensorflow.proto.DebugMetadata.getDefaultInstance()) { + what_ = org.tensorflow.proto.DebugMetadata.newBuilder((org.tensorflow.proto.DebugMetadata) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 3) { + debugMetadataBuilder_.mergeFrom(value); + } else { + debugMetadataBuilder_.setMessage(value); + } + } + whatCase_ = 3; + return this; + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + public Builder clearDebugMetadata() { + if (debugMetadataBuilder_ == null) { + if (whatCase_ == 3) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 3) { + whatCase_ = 0; + what_ = null; + } + debugMetadataBuilder_.clear(); + } + return this; + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + public org.tensorflow.proto.DebugMetadata.Builder getDebugMetadataBuilder() { + return getDebugMetadataFieldBuilder().getBuilder(); + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + @java.lang.Override + public org.tensorflow.proto.DebugMetadataOrBuilder getDebugMetadataOrBuilder() { + if ((whatCase_ == 3) && (debugMetadataBuilder_ != null)) { + return debugMetadataBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 3) { + return (org.tensorflow.proto.DebugMetadata) what_; + } + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + } + /** + *
    +     * Metadata related to this debugging data.
    +     * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugMetadata, org.tensorflow.proto.DebugMetadata.Builder, org.tensorflow.proto.DebugMetadataOrBuilder> + getDebugMetadataFieldBuilder() { + if (debugMetadataBuilder_ == null) { + if (!(whatCase_ == 3)) { + what_ = org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + debugMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugMetadata, org.tensorflow.proto.DebugMetadata.Builder, org.tensorflow.proto.DebugMetadataOrBuilder>( + (org.tensorflow.proto.DebugMetadata) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 3; + onChanged(); + return debugMetadataBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceFile, org.tensorflow.proto.SourceFile.Builder, org.tensorflow.proto.SourceFileOrBuilder> sourceFileBuilder_; + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return Whether the sourceFile field is set. + */ + @java.lang.Override + public boolean hasSourceFile() { + return whatCase_ == 4; + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return The sourceFile. + */ + @java.lang.Override + public org.tensorflow.proto.SourceFile getSourceFile() { + if (sourceFileBuilder_ == null) { + if (whatCase_ == 4) { + return (org.tensorflow.proto.SourceFile) what_; + } + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } else { + if (whatCase_ == 4) { + return sourceFileBuilder_.getMessage(); + } + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + public Builder setSourceFile(org.tensorflow.proto.SourceFile value) { + if (sourceFileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + sourceFileBuilder_.setMessage(value); + } + whatCase_ = 4; + return this; + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + public Builder setSourceFile( + org.tensorflow.proto.SourceFile.Builder builderForValue) { + if (sourceFileBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + sourceFileBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 4; + return this; + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + public Builder mergeSourceFile(org.tensorflow.proto.SourceFile value) { + if (sourceFileBuilder_ == null) { + if (whatCase_ == 4 && + what_ != org.tensorflow.proto.SourceFile.getDefaultInstance()) { + what_ = org.tensorflow.proto.SourceFile.newBuilder((org.tensorflow.proto.SourceFile) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 4) { + sourceFileBuilder_.mergeFrom(value); + } else { + sourceFileBuilder_.setMessage(value); + } + } + whatCase_ = 4; + return this; + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + public Builder clearSourceFile() { + if (sourceFileBuilder_ == null) { + if (whatCase_ == 4) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 4) { + whatCase_ = 0; + what_ = null; + } + sourceFileBuilder_.clear(); + } + return this; + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + public org.tensorflow.proto.SourceFile.Builder getSourceFileBuilder() { + return getSourceFileFieldBuilder().getBuilder(); + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + @java.lang.Override + public org.tensorflow.proto.SourceFileOrBuilder getSourceFileOrBuilder() { + if ((whatCase_ == 4) && (sourceFileBuilder_ != null)) { + return sourceFileBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 4) { + return (org.tensorflow.proto.SourceFile) what_; + } + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + } + /** + *
    +     * The content of a source file.
    +     * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceFile, org.tensorflow.proto.SourceFile.Builder, org.tensorflow.proto.SourceFileOrBuilder> + getSourceFileFieldBuilder() { + if (sourceFileBuilder_ == null) { + if (!(whatCase_ == 4)) { + what_ = org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + sourceFileBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceFile, org.tensorflow.proto.SourceFile.Builder, org.tensorflow.proto.SourceFileOrBuilder>( + (org.tensorflow.proto.SourceFile) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 4; + onChanged(); + return sourceFileBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StackFrameWithId, org.tensorflow.proto.StackFrameWithId.Builder, org.tensorflow.proto.StackFrameWithIdOrBuilder> stackFrameWithIdBuilder_; + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return Whether the stackFrameWithId field is set. + */ + @java.lang.Override + public boolean hasStackFrameWithId() { + return whatCase_ == 6; + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return The stackFrameWithId. + */ + @java.lang.Override + public org.tensorflow.proto.StackFrameWithId getStackFrameWithId() { + if (stackFrameWithIdBuilder_ == null) { + if (whatCase_ == 6) { + return (org.tensorflow.proto.StackFrameWithId) what_; + } + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } else { + if (whatCase_ == 6) { + return stackFrameWithIdBuilder_.getMessage(); + } + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + public Builder setStackFrameWithId(org.tensorflow.proto.StackFrameWithId value) { + if (stackFrameWithIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + stackFrameWithIdBuilder_.setMessage(value); + } + whatCase_ = 6; + return this; + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + public Builder setStackFrameWithId( + org.tensorflow.proto.StackFrameWithId.Builder builderForValue) { + if (stackFrameWithIdBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + stackFrameWithIdBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 6; + return this; + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + public Builder mergeStackFrameWithId(org.tensorflow.proto.StackFrameWithId value) { + if (stackFrameWithIdBuilder_ == null) { + if (whatCase_ == 6 && + what_ != org.tensorflow.proto.StackFrameWithId.getDefaultInstance()) { + what_ = org.tensorflow.proto.StackFrameWithId.newBuilder((org.tensorflow.proto.StackFrameWithId) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 6) { + stackFrameWithIdBuilder_.mergeFrom(value); + } else { + stackFrameWithIdBuilder_.setMessage(value); + } + } + whatCase_ = 6; + return this; + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + public Builder clearStackFrameWithId() { + if (stackFrameWithIdBuilder_ == null) { + if (whatCase_ == 6) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 6) { + whatCase_ = 0; + what_ = null; + } + stackFrameWithIdBuilder_.clear(); + } + return this; + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + public org.tensorflow.proto.StackFrameWithId.Builder getStackFrameWithIdBuilder() { + return getStackFrameWithIdFieldBuilder().getBuilder(); + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + @java.lang.Override + public org.tensorflow.proto.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder() { + if ((whatCase_ == 6) && (stackFrameWithIdBuilder_ != null)) { + return stackFrameWithIdBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 6) { + return (org.tensorflow.proto.StackFrameWithId) what_; + } + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + } + /** + *
    +     * A stack frame (filename, line number and column number, function name and
    +     * code string) with ID.
    +     * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StackFrameWithId, org.tensorflow.proto.StackFrameWithId.Builder, org.tensorflow.proto.StackFrameWithIdOrBuilder> + getStackFrameWithIdFieldBuilder() { + if (stackFrameWithIdBuilder_ == null) { + if (!(whatCase_ == 6)) { + what_ = org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + stackFrameWithIdBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StackFrameWithId, org.tensorflow.proto.StackFrameWithId.Builder, org.tensorflow.proto.StackFrameWithIdOrBuilder>( + (org.tensorflow.proto.StackFrameWithId) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 6; + onChanged(); + return stackFrameWithIdBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOpCreation, org.tensorflow.proto.GraphOpCreation.Builder, org.tensorflow.proto.GraphOpCreationOrBuilder> graphOpCreationBuilder_; + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return Whether the graphOpCreation field is set. + */ + @java.lang.Override + public boolean hasGraphOpCreation() { + return whatCase_ == 7; + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return The graphOpCreation. + */ + @java.lang.Override + public org.tensorflow.proto.GraphOpCreation getGraphOpCreation() { + if (graphOpCreationBuilder_ == null) { + if (whatCase_ == 7) { + return (org.tensorflow.proto.GraphOpCreation) what_; + } + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } else { + if (whatCase_ == 7) { + return graphOpCreationBuilder_.getMessage(); + } + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + public Builder setGraphOpCreation(org.tensorflow.proto.GraphOpCreation value) { + if (graphOpCreationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + graphOpCreationBuilder_.setMessage(value); + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + public Builder setGraphOpCreation( + org.tensorflow.proto.GraphOpCreation.Builder builderForValue) { + if (graphOpCreationBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + graphOpCreationBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + public Builder mergeGraphOpCreation(org.tensorflow.proto.GraphOpCreation value) { + if (graphOpCreationBuilder_ == null) { + if (whatCase_ == 7 && + what_ != org.tensorflow.proto.GraphOpCreation.getDefaultInstance()) { + what_ = org.tensorflow.proto.GraphOpCreation.newBuilder((org.tensorflow.proto.GraphOpCreation) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 7) { + graphOpCreationBuilder_.mergeFrom(value); + } else { + graphOpCreationBuilder_.setMessage(value); + } + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + public Builder clearGraphOpCreation() { + if (graphOpCreationBuilder_ == null) { + if (whatCase_ == 7) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 7) { + whatCase_ = 0; + what_ = null; + } + graphOpCreationBuilder_.clear(); + } + return this; + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + public org.tensorflow.proto.GraphOpCreation.Builder getGraphOpCreationBuilder() { + return getGraphOpCreationFieldBuilder().getBuilder(); + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + @java.lang.Override + public org.tensorflow.proto.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder() { + if ((whatCase_ == 7) && (graphOpCreationBuilder_ != null)) { + return graphOpCreationBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 7) { + return (org.tensorflow.proto.GraphOpCreation) what_; + } + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + } + /** + *
    +     * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +     * a Python function).
    +     * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOpCreation, org.tensorflow.proto.GraphOpCreation.Builder, org.tensorflow.proto.GraphOpCreationOrBuilder> + getGraphOpCreationFieldBuilder() { + if (graphOpCreationBuilder_ == null) { + if (!(whatCase_ == 7)) { + what_ = org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + graphOpCreationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphOpCreation, org.tensorflow.proto.GraphOpCreation.Builder, org.tensorflow.proto.GraphOpCreationOrBuilder>( + (org.tensorflow.proto.GraphOpCreation) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 7; + onChanged(); + return graphOpCreationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedGraph, org.tensorflow.proto.DebuggedGraph.Builder, org.tensorflow.proto.DebuggedGraphOrBuilder> debuggedGraphBuilder_; + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return Whether the debuggedGraph field is set. + */ + @java.lang.Override + public boolean hasDebuggedGraph() { + return whatCase_ == 8; + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return The debuggedGraph. + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedGraph getDebuggedGraph() { + if (debuggedGraphBuilder_ == null) { + if (whatCase_ == 8) { + return (org.tensorflow.proto.DebuggedGraph) what_; + } + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } else { + if (whatCase_ == 8) { + return debuggedGraphBuilder_.getMessage(); + } + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + public Builder setDebuggedGraph(org.tensorflow.proto.DebuggedGraph value) { + if (debuggedGraphBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + debuggedGraphBuilder_.setMessage(value); + } + whatCase_ = 8; + return this; + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + public Builder setDebuggedGraph( + org.tensorflow.proto.DebuggedGraph.Builder builderForValue) { + if (debuggedGraphBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + debuggedGraphBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 8; + return this; + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + public Builder mergeDebuggedGraph(org.tensorflow.proto.DebuggedGraph value) { + if (debuggedGraphBuilder_ == null) { + if (whatCase_ == 8 && + what_ != org.tensorflow.proto.DebuggedGraph.getDefaultInstance()) { + what_ = org.tensorflow.proto.DebuggedGraph.newBuilder((org.tensorflow.proto.DebuggedGraph) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 8) { + debuggedGraphBuilder_.mergeFrom(value); + } else { + debuggedGraphBuilder_.setMessage(value); + } + } + whatCase_ = 8; + return this; + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + public Builder clearDebuggedGraph() { + if (debuggedGraphBuilder_ == null) { + if (whatCase_ == 8) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 8) { + whatCase_ = 0; + what_ = null; + } + debuggedGraphBuilder_.clear(); + } + return this; + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + public org.tensorflow.proto.DebuggedGraph.Builder getDebuggedGraphBuilder() { + return getDebuggedGraphFieldBuilder().getBuilder(); + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder() { + if ((whatCase_ == 8) && (debuggedGraphBuilder_ != null)) { + return debuggedGraphBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 8) { + return (org.tensorflow.proto.DebuggedGraph) what_; + } + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + } + /** + *
    +     * Information about a debugged graph.
    +     * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedGraph, org.tensorflow.proto.DebuggedGraph.Builder, org.tensorflow.proto.DebuggedGraphOrBuilder> + getDebuggedGraphFieldBuilder() { + if (debuggedGraphBuilder_ == null) { + if (!(whatCase_ == 8)) { + what_ = org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + debuggedGraphBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedGraph, org.tensorflow.proto.DebuggedGraph.Builder, org.tensorflow.proto.DebuggedGraphOrBuilder>( + (org.tensorflow.proto.DebuggedGraph) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 8; + onChanged(); + return debuggedGraphBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Execution, org.tensorflow.proto.Execution.Builder, org.tensorflow.proto.ExecutionOrBuilder> executionBuilder_; + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + * @return Whether the execution field is set. + */ + @java.lang.Override + public boolean hasExecution() { + return whatCase_ == 9; + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + * @return The execution. + */ + @java.lang.Override + public org.tensorflow.proto.Execution getExecution() { + if (executionBuilder_ == null) { + if (whatCase_ == 9) { + return (org.tensorflow.proto.Execution) what_; + } + return org.tensorflow.proto.Execution.getDefaultInstance(); + } else { + if (whatCase_ == 9) { + return executionBuilder_.getMessage(); + } + return org.tensorflow.proto.Execution.getDefaultInstance(); + } + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + public Builder setExecution(org.tensorflow.proto.Execution value) { + if (executionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + executionBuilder_.setMessage(value); + } + whatCase_ = 9; + return this; + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + public Builder setExecution( + org.tensorflow.proto.Execution.Builder builderForValue) { + if (executionBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + executionBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 9; + return this; + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + public Builder mergeExecution(org.tensorflow.proto.Execution value) { + if (executionBuilder_ == null) { + if (whatCase_ == 9 && + what_ != org.tensorflow.proto.Execution.getDefaultInstance()) { + what_ = org.tensorflow.proto.Execution.newBuilder((org.tensorflow.proto.Execution) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 9) { + executionBuilder_.mergeFrom(value); + } else { + executionBuilder_.setMessage(value); + } + } + whatCase_ = 9; + return this; + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + public Builder clearExecution() { + if (executionBuilder_ == null) { + if (whatCase_ == 9) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 9) { + whatCase_ = 0; + what_ = null; + } + executionBuilder_.clear(); + } + return this; + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + public org.tensorflow.proto.Execution.Builder getExecutionBuilder() { + return getExecutionFieldBuilder().getBuilder(); + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + @java.lang.Override + public org.tensorflow.proto.ExecutionOrBuilder getExecutionOrBuilder() { + if ((whatCase_ == 9) && (executionBuilder_ != null)) { + return executionBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 9) { + return (org.tensorflow.proto.Execution) what_; + } + return org.tensorflow.proto.Execution.getDefaultInstance(); + } + } + /** + *
    +     * Execution of an op or a Graph (e.g., a tf.function).
    +     * 
    + * + * .tensorflow.Execution execution = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Execution, org.tensorflow.proto.Execution.Builder, org.tensorflow.proto.ExecutionOrBuilder> + getExecutionFieldBuilder() { + if (executionBuilder_ == null) { + if (!(whatCase_ == 9)) { + what_ = org.tensorflow.proto.Execution.getDefaultInstance(); + } + executionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Execution, org.tensorflow.proto.Execution.Builder, org.tensorflow.proto.ExecutionOrBuilder>( + (org.tensorflow.proto.Execution) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 9; + onChanged(); + return executionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphExecutionTrace, org.tensorflow.proto.GraphExecutionTrace.Builder, org.tensorflow.proto.GraphExecutionTraceOrBuilder> graphExecutionTraceBuilder_; + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return Whether the graphExecutionTrace field is set. + */ + @java.lang.Override + public boolean hasGraphExecutionTrace() { + return whatCase_ == 10; + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return The graphExecutionTrace. + */ + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTrace getGraphExecutionTrace() { + if (graphExecutionTraceBuilder_ == null) { + if (whatCase_ == 10) { + return (org.tensorflow.proto.GraphExecutionTrace) what_; + } + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } else { + if (whatCase_ == 10) { + return graphExecutionTraceBuilder_.getMessage(); + } + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + public Builder setGraphExecutionTrace(org.tensorflow.proto.GraphExecutionTrace value) { + if (graphExecutionTraceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + graphExecutionTraceBuilder_.setMessage(value); + } + whatCase_ = 10; + return this; + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + public Builder setGraphExecutionTrace( + org.tensorflow.proto.GraphExecutionTrace.Builder builderForValue) { + if (graphExecutionTraceBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + graphExecutionTraceBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 10; + return this; + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + public Builder mergeGraphExecutionTrace(org.tensorflow.proto.GraphExecutionTrace value) { + if (graphExecutionTraceBuilder_ == null) { + if (whatCase_ == 10 && + what_ != org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance()) { + what_ = org.tensorflow.proto.GraphExecutionTrace.newBuilder((org.tensorflow.proto.GraphExecutionTrace) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 10) { + graphExecutionTraceBuilder_.mergeFrom(value); + } else { + graphExecutionTraceBuilder_.setMessage(value); + } + } + whatCase_ = 10; + return this; + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + public Builder clearGraphExecutionTrace() { + if (graphExecutionTraceBuilder_ == null) { + if (whatCase_ == 10) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 10) { + whatCase_ = 0; + what_ = null; + } + graphExecutionTraceBuilder_.clear(); + } + return this; + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + public org.tensorflow.proto.GraphExecutionTrace.Builder getGraphExecutionTraceBuilder() { + return getGraphExecutionTraceFieldBuilder().getBuilder(); + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder() { + if ((whatCase_ == 10) && (graphExecutionTraceBuilder_ != null)) { + return graphExecutionTraceBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 10) { + return (org.tensorflow.proto.GraphExecutionTrace) what_; + } + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + } + /** + *
    +     * A graph execution trace: Contains information about the intermediate
    +     * tensors computed during the graph execution.
    +     * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphExecutionTrace, org.tensorflow.proto.GraphExecutionTrace.Builder, org.tensorflow.proto.GraphExecutionTraceOrBuilder> + getGraphExecutionTraceFieldBuilder() { + if (graphExecutionTraceBuilder_ == null) { + if (!(whatCase_ == 10)) { + what_ = org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + graphExecutionTraceBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphExecutionTrace, org.tensorflow.proto.GraphExecutionTrace.Builder, org.tensorflow.proto.GraphExecutionTraceOrBuilder>( + (org.tensorflow.proto.GraphExecutionTrace) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 10; + onChanged(); + return graphExecutionTraceBuilder_; + } + + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @return Whether the graphId field is set. + */ + @java.lang.Override + public boolean hasGraphId() { + return whatCase_ == 11; + } + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @return The graphId. + */ + @java.lang.Override + public java.lang.String getGraphId() { + java.lang.Object ref = ""; + if (whatCase_ == 11) { + ref = what_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (whatCase_ == 11) { + what_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @return The bytes for graphId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = ""; + if (whatCase_ == 11) { + ref = what_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (whatCase_ == 11) { + what_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @param value The graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + whatCase_ = 11; + what_ = value; + onChanged(); + return this; + } + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @return This builder for chaining. + */ + public Builder clearGraphId() { + if (whatCase_ == 11) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + return this; + } + /** + *
    +     * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +     * to the execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 11; + * @param value The bytes for graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + whatCase_ = 11; + what_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedDevice, org.tensorflow.proto.DebuggedDevice.Builder, org.tensorflow.proto.DebuggedDeviceOrBuilder> debuggedDeviceBuilder_; + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return Whether the debuggedDevice field is set. + */ + @java.lang.Override + public boolean hasDebuggedDevice() { + return whatCase_ == 12; + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return The debuggedDevice. + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedDevice getDebuggedDevice() { + if (debuggedDeviceBuilder_ == null) { + if (whatCase_ == 12) { + return (org.tensorflow.proto.DebuggedDevice) what_; + } + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } else { + if (whatCase_ == 12) { + return debuggedDeviceBuilder_.getMessage(); + } + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + public Builder setDebuggedDevice(org.tensorflow.proto.DebuggedDevice value) { + if (debuggedDeviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + debuggedDeviceBuilder_.setMessage(value); + } + whatCase_ = 12; + return this; + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + public Builder setDebuggedDevice( + org.tensorflow.proto.DebuggedDevice.Builder builderForValue) { + if (debuggedDeviceBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + debuggedDeviceBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 12; + return this; + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + public Builder mergeDebuggedDevice(org.tensorflow.proto.DebuggedDevice value) { + if (debuggedDeviceBuilder_ == null) { + if (whatCase_ == 12 && + what_ != org.tensorflow.proto.DebuggedDevice.getDefaultInstance()) { + what_ = org.tensorflow.proto.DebuggedDevice.newBuilder((org.tensorflow.proto.DebuggedDevice) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 12) { + debuggedDeviceBuilder_.mergeFrom(value); + } else { + debuggedDeviceBuilder_.setMessage(value); + } + } + whatCase_ = 12; + return this; + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + public Builder clearDebuggedDevice() { + if (debuggedDeviceBuilder_ == null) { + if (whatCase_ == 12) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 12) { + whatCase_ = 0; + what_ = null; + } + debuggedDeviceBuilder_.clear(); + } + return this; + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + public org.tensorflow.proto.DebuggedDevice.Builder getDebuggedDeviceBuilder() { + return getDebuggedDeviceFieldBuilder().getBuilder(); + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder() { + if ((whatCase_ == 12) && (debuggedDeviceBuilder_ != null)) { + return debuggedDeviceBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 12) { + return (org.tensorflow.proto.DebuggedDevice) what_; + } + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + } + /** + *
    +     * A device on which debugger-instrumented ops and/or tensors reside.
    +     * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedDevice, org.tensorflow.proto.DebuggedDevice.Builder, org.tensorflow.proto.DebuggedDeviceOrBuilder> + getDebuggedDeviceFieldBuilder() { + if (debuggedDeviceBuilder_ == null) { + if (!(whatCase_ == 12)) { + what_ = org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + debuggedDeviceBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebuggedDevice, org.tensorflow.proto.DebuggedDevice.Builder, org.tensorflow.proto.DebuggedDeviceOrBuilder>( + (org.tensorflow.proto.DebuggedDevice) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 12; + onChanged(); + return debuggedDeviceBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebugEvent) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebugEvent) + private static final org.tensorflow.proto.DebugEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebugEvent(); + } + + public static org.tensorflow.proto.DebugEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebugEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebugEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventOrBuilder.java new file mode 100644 index 00000000000..1b36f8a0ba4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventOrBuilder.java @@ -0,0 +1,290 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface DebugEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.DebugEvent) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Timestamp in seconds (with microsecond precision).
    +   * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + double getWallTime(); + + /** + *
    +   * Step of training (if available).
    +   * 
    + * + * int64 step = 2; + * @return The step. + */ + long getStep(); + + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return Whether the debugMetadata field is set. + */ + boolean hasDebugMetadata(); + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + * @return The debugMetadata. + */ + org.tensorflow.proto.DebugMetadata getDebugMetadata(); + /** + *
    +   * Metadata related to this debugging data.
    +   * 
    + * + * .tensorflow.DebugMetadata debug_metadata = 3; + */ + org.tensorflow.proto.DebugMetadataOrBuilder getDebugMetadataOrBuilder(); + + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return Whether the sourceFile field is set. + */ + boolean hasSourceFile(); + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + * @return The sourceFile. + */ + org.tensorflow.proto.SourceFile getSourceFile(); + /** + *
    +   * The content of a source file.
    +   * 
    + * + * .tensorflow.SourceFile source_file = 4; + */ + org.tensorflow.proto.SourceFileOrBuilder getSourceFileOrBuilder(); + + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return Whether the stackFrameWithId field is set. + */ + boolean hasStackFrameWithId(); + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + * @return The stackFrameWithId. + */ + org.tensorflow.proto.StackFrameWithId getStackFrameWithId(); + /** + *
    +   * A stack frame (filename, line number and column number, function name and
    +   * code string) with ID.
    +   * 
    + * + * .tensorflow.StackFrameWithId stack_frame_with_id = 6; + */ + org.tensorflow.proto.StackFrameWithIdOrBuilder getStackFrameWithIdOrBuilder(); + + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return Whether the graphOpCreation field is set. + */ + boolean hasGraphOpCreation(); + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + * @return The graphOpCreation. + */ + org.tensorflow.proto.GraphOpCreation getGraphOpCreation(); + /** + *
    +   * The creation of an op within a graph (e.g., a FuncGraph compiled from
    +   * a Python function).
    +   * 
    + * + * .tensorflow.GraphOpCreation graph_op_creation = 7; + */ + org.tensorflow.proto.GraphOpCreationOrBuilder getGraphOpCreationOrBuilder(); + + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return Whether the debuggedGraph field is set. + */ + boolean hasDebuggedGraph(); + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + * @return The debuggedGraph. + */ + org.tensorflow.proto.DebuggedGraph getDebuggedGraph(); + /** + *
    +   * Information about a debugged graph.
    +   * 
    + * + * .tensorflow.DebuggedGraph debugged_graph = 8; + */ + org.tensorflow.proto.DebuggedGraphOrBuilder getDebuggedGraphOrBuilder(); + + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + * @return Whether the execution field is set. + */ + boolean hasExecution(); + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + * @return The execution. + */ + org.tensorflow.proto.Execution getExecution(); + /** + *
    +   * Execution of an op or a Graph (e.g., a tf.function).
    +   * 
    + * + * .tensorflow.Execution execution = 9; + */ + org.tensorflow.proto.ExecutionOrBuilder getExecutionOrBuilder(); + + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return Whether the graphExecutionTrace field is set. + */ + boolean hasGraphExecutionTrace(); + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + * @return The graphExecutionTrace. + */ + org.tensorflow.proto.GraphExecutionTrace getGraphExecutionTrace(); + /** + *
    +   * A graph execution trace: Contains information about the intermediate
    +   * tensors computed during the graph execution.
    +   * 
    + * + * .tensorflow.GraphExecutionTrace graph_execution_trace = 10; + */ + org.tensorflow.proto.GraphExecutionTraceOrBuilder getGraphExecutionTraceOrBuilder(); + + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return Whether the graphId field is set. + */ + boolean hasGraphId(); + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return The graphId. + */ + java.lang.String getGraphId(); + /** + *
    +   * The ID of the graph (i.e., FuncGraph) executed here: applicable only
    +   * to the execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 11; + * @return The bytes for graphId. + */ + com.google.protobuf.ByteString + getGraphIdBytes(); + + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return Whether the debuggedDevice field is set. + */ + boolean hasDebuggedDevice(); + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + * @return The debuggedDevice. + */ + org.tensorflow.proto.DebuggedDevice getDebuggedDevice(); + /** + *
    +   * A device on which debugger-instrumented ops and/or tensors reside.
    +   * 
    + * + * .tensorflow.DebuggedDevice debugged_device = 12; + */ + org.tensorflow.proto.DebuggedDeviceOrBuilder getDebuggedDeviceOrBuilder(); + + org.tensorflow.proto.DebugEvent.WhatCase getWhatCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventProtos.java new file mode 100644 index 00000000000..1c92bcac9f3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugEventProtos.java @@ -0,0 +1,217 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class DebugEventProtos { + private DebugEventProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugEventProtos.class.getName()); + } + 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_DebugEvent_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DebugEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DebugMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DebugMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SourceFile_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SourceFile_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_StackFrameWithId_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_StackFrameWithId_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CodeLocation_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CodeLocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphOpCreation_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphOpCreation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DebuggedGraph_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DebuggedGraph_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DebuggedDevice_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DebuggedDevice_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_Execution_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_Execution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphExecutionTrace_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphExecutionTrace_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/debug_event.p" + + "roto\022\ntensorflow\0320tensorflow/core/framew" + + "ork/graph_debug_info.proto\032&tensorflow/c" + + "ore/framework/tensor.proto\"\376\003\n\nDebugEven" + + "t\022\021\n\twall_time\030\001 \001(\001\022\014\n\004step\030\002 \001(\003\0223\n\016de" + + "bug_metadata\030\003 \001(\0132\031.tensorflow.DebugMet" + + "adataH\000\022-\n\013source_file\030\004 \001(\0132\026.tensorflo" + + "w.SourceFileH\000\022;\n\023stack_frame_with_id\030\006 " + + "\001(\0132\034.tensorflow.StackFrameWithIdH\000\0228\n\021g" + + "raph_op_creation\030\007 \001(\0132\033.tensorflow.Grap" + + "hOpCreationH\000\0223\n\016debugged_graph\030\010 \001(\0132\031." + + "tensorflow.DebuggedGraphH\000\022*\n\texecution\030" + + "\t \001(\0132\025.tensorflow.ExecutionH\000\022@\n\025graph_" + + "execution_trace\030\n \001(\0132\037.tensorflow.Graph" + + "ExecutionTraceH\000\022\022\n\010graph_id\030\013 \001(\tH\000\0225\n\017" + + "debugged_device\030\014 \001(\0132\032.tensorflow.Debug" + + "gedDeviceH\000B\006\n\004what\"W\n\rDebugMetadata\022\032\n\022" + + "tensorflow_version\030\001 \001(\t\022\024\n\014file_version" + + "\030\002 \001(\t\022\024\n\014tfdbg_run_id\030\003 \001(\t\"A\n\nSourceFi" + + "le\022\021\n\tfile_path\030\001 \001(\t\022\021\n\thost_name\030\002 \001(\t" + + "\022\r\n\005lines\030\003 \003(\t\"]\n\020StackFrameWithId\022\n\n\002i" + + "d\030\001 \001(\t\022=\n\rfile_line_col\030\002 \001(\0132&.tensorf" + + "low.GraphDebugInfo.FileLineCol\":\n\014CodeLo" + + "cation\022\021\n\thost_name\030\001 \001(\t\022\027\n\017stack_frame" + + "_ids\030\002 \003(\t\"\344\001\n\017GraphOpCreation\022\017\n\007op_typ" + + "e\030\001 \001(\t\022\017\n\007op_name\030\002 \001(\t\022\022\n\ngraph_name\030\003" + + " \001(\t\022\020\n\010graph_id\030\004 \001(\t\022\023\n\013device_name\030\005 " + + "\001(\t\022\023\n\013input_names\030\006 \003(\t\022\023\n\013num_outputs\030" + + "\007 \001(\005\022/\n\rcode_location\030\010 \001(\0132\030.tensorflo" + + "w.CodeLocation\022\031\n\021output_tensor_ids\030\t \003(" + + "\005\"\245\001\n\rDebuggedGraph\022\020\n\010graph_id\030\001 \001(\t\022\022\n" + + "\ngraph_name\030\002 \001(\t\022\030\n\020instrumented_ops\030\003 " + + "\003(\t\022\032\n\022original_graph_def\030\004 \001(\014\022\036\n\026instr" + + "umented_graph_def\030\005 \001(\014\022\030\n\020outer_context" + + "_id\030\006 \001(\t\"8\n\016DebuggedDevice\022\023\n\013device_na" + + "me\030\001 \001(\t\022\021\n\tdevice_id\030\002 \001(\005\"\263\002\n\tExecutio" + + "n\022\017\n\007op_type\030\001 \001(\t\022\023\n\013num_outputs\030\002 \001(\005\022" + + "\020\n\010graph_id\030\003 \001(\t\022\030\n\020input_tensor_ids\030\004 " + + "\003(\003\022\031\n\021output_tensor_ids\030\005 \003(\003\0226\n\021tensor" + + "_debug_mode\030\006 \001(\0162\033.tensorflow.TensorDeb" + + "ugMode\022.\n\rtensor_protos\030\007 \003(\0132\027.tensorfl" + + "ow.TensorProto\022/\n\rcode_location\030\010 \001(\0132\030." + + "tensorflow.CodeLocation\022 \n\030output_tensor" + + "_device_ids\030\t \003(\005\"\321\001\n\023GraphExecutionTrac" + + "e\022\030\n\020tfdbg_context_id\030\001 \001(\t\022\017\n\007op_name\030\002" + + " \001(\t\022\023\n\013output_slot\030\003 \001(\005\0226\n\021tensor_debu" + + "g_mode\030\004 \001(\0162\033.tensorflow.TensorDebugMod" + + "e\022-\n\014tensor_proto\030\005 \001(\0132\027.tensorflow.Ten" + + "sorProto\022\023\n\013device_name\030\006 \001(\t*\266\001\n\017Tensor" + + "DebugMode\022\017\n\013UNSPECIFIED\020\000\022\r\n\tNO_TENSOR\020" + + "\001\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_NUMER" + + "ICS\020\006\022\017\n\013FULL_TENSOR\020\007\022\036\n\032REDUCE_INF_NAN" + + "_THREE_SLOTS\020\010B\204\001\n\024org.tensorflow.protoB" + + "\020DebugEventProtosP\001ZUgithub.com/tensorfl" + + "ow/tensorflow/tensorflow/go/core/protobu" + + "f/for_core_protos_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.GraphDebugInfoProtos.getDescriptor(), + org.tensorflow.proto.TensorProtos.getDescriptor(), + }); + internal_static_tensorflow_DebugEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_DebugEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DebugEvent_descriptor, + new java.lang.String[] { "WallTime", "Step", "DebugMetadata", "SourceFile", "StackFrameWithId", "GraphOpCreation", "DebuggedGraph", "Execution", "GraphExecutionTrace", "GraphId", "DebuggedDevice", "What", }); + internal_static_tensorflow_DebugMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_DebugMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DebugMetadata_descriptor, + new java.lang.String[] { "TensorflowVersion", "FileVersion", "TfdbgRunId", }); + internal_static_tensorflow_SourceFile_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_SourceFile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SourceFile_descriptor, + new java.lang.String[] { "FilePath", "HostName", "Lines", }); + internal_static_tensorflow_StackFrameWithId_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_StackFrameWithId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_StackFrameWithId_descriptor, + new java.lang.String[] { "Id", "FileLineCol", }); + internal_static_tensorflow_CodeLocation_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_CodeLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CodeLocation_descriptor, + new java.lang.String[] { "HostName", "StackFrameIds", }); + internal_static_tensorflow_GraphOpCreation_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_GraphOpCreation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphOpCreation_descriptor, + new java.lang.String[] { "OpType", "OpName", "GraphName", "GraphId", "DeviceName", "InputNames", "NumOutputs", "CodeLocation", "OutputTensorIds", }); + internal_static_tensorflow_DebuggedGraph_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_DebuggedGraph_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DebuggedGraph_descriptor, + new java.lang.String[] { "GraphId", "GraphName", "InstrumentedOps", "OriginalGraphDef", "InstrumentedGraphDef", "OuterContextId", }); + internal_static_tensorflow_DebuggedDevice_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_tensorflow_DebuggedDevice_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DebuggedDevice_descriptor, + new java.lang.String[] { "DeviceName", "DeviceId", }); + internal_static_tensorflow_Execution_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_tensorflow_Execution_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_Execution_descriptor, + new java.lang.String[] { "OpType", "NumOutputs", "GraphId", "InputTensorIds", "OutputTensorIds", "TensorDebugMode", "TensorProtos", "CodeLocation", "OutputTensorDeviceIds", }); + internal_static_tensorflow_GraphExecutionTrace_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphExecutionTrace_descriptor, + new java.lang.String[] { "TfdbgContextId", "OpName", "OutputSlot", "TensorDebugMode", "TensorProto", "DeviceName", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.GraphDebugInfoProtos.getDescriptor(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadata.java new file mode 100644 index 00000000000..8f70d7c9067 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadata.java @@ -0,0 +1,893 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Metadata about the debugger and the debugged TensorFlow program.
    + * 
    + * + * Protobuf type {@code tensorflow.DebugMetadata} + */ +public final class DebugMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebugMetadata) + DebugMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugMetadata.class.getName()); + } + // Use DebugMetadata.newBuilder() to construct. + private DebugMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebugMetadata() { + tensorflowVersion_ = ""; + fileVersion_ = ""; + tfdbgRunId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugMetadata.class, org.tensorflow.proto.DebugMetadata.Builder.class); + } + + public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object tensorflowVersion_ = ""; + /** + *
    +   * Version of TensorFlow.
    +   * 
    + * + * string tensorflow_version = 1; + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + 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(); + tensorflowVersion_ = s; + return s; + } + } + /** + *
    +   * Version of TensorFlow.
    +   * 
    + * + * string tensorflow_version = 1; + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_VERSION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object fileVersion_ = ""; + /** + *
    +   * Version of the DebugEvent file format.
    +   * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +   * 
    + * + * string file_version = 2; + * @return The fileVersion. + */ + @java.lang.Override + public java.lang.String getFileVersion() { + java.lang.Object ref = fileVersion_; + 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(); + fileVersion_ = s; + return s; + } + } + /** + *
    +   * Version of the DebugEvent file format.
    +   * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +   * 
    + * + * string file_version = 2; + * @return The bytes for fileVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFileVersionBytes() { + java.lang.Object ref = fileVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TFDBG_RUN_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object tfdbgRunId_ = ""; + /** + *
    +   * A unique ID for the current run of tfdbg.
    +   * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +   * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +   * have the same ID.
    +   * 
    + * + * string tfdbg_run_id = 3; + * @return The tfdbgRunId. + */ + @java.lang.Override + public java.lang.String getTfdbgRunId() { + java.lang.Object ref = tfdbgRunId_; + 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(); + tfdbgRunId_ = s; + return s; + } + } + /** + *
    +   * A unique ID for the current run of tfdbg.
    +   * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +   * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +   * have the same ID.
    +   * 
    + * + * string tfdbg_run_id = 3; + * @return The bytes for tfdbgRunId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTfdbgRunIdBytes() { + java.lang.Object ref = tfdbgRunId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfdbgRunId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fileVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, fileVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfdbgRunId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, tfdbgRunId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fileVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, fileVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfdbgRunId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, tfdbgRunId_); + } + size += getUnknownFields().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.DebugMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.DebugMetadata other = (org.tensorflow.proto.DebugMetadata) obj; + + if (!getTensorflowVersion() + .equals(other.getTensorflowVersion())) return false; + if (!getFileVersion() + .equals(other.getFileVersion())) return false; + if (!getTfdbgRunId() + .equals(other.getTfdbgRunId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (37 * hash) + FILE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getFileVersion().hashCode(); + hash = (37 * hash) + TFDBG_RUN_ID_FIELD_NUMBER; + hash = (53 * hash) + getTfdbgRunId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebugMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugMetadata 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.DebugMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugMetadata 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.DebugMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebugMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebugMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebugMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebugMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebugMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Metadata about the debugger and the debugged TensorFlow program.
    +   * 
    + * + * Protobuf type {@code tensorflow.DebugMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebugMetadata) + org.tensorflow.proto.DebugMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugMetadata.class, org.tensorflow.proto.DebugMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.DebugMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tensorflowVersion_ = ""; + fileVersion_ = ""; + tfdbgRunId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebugMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebugMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.DebugMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebugMetadata build() { + org.tensorflow.proto.DebugMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebugMetadata buildPartial() { + org.tensorflow.proto.DebugMetadata result = new org.tensorflow.proto.DebugMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebugMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tensorflowVersion_ = tensorflowVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileVersion_ = fileVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tfdbgRunId_ = tfdbgRunId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebugMetadata) { + return mergeFrom((org.tensorflow.proto.DebugMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebugMetadata other) { + if (other == org.tensorflow.proto.DebugMetadata.getDefaultInstance()) return this; + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFileVersion().isEmpty()) { + fileVersion_ = other.fileVersion_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTfdbgRunId().isEmpty()) { + tfdbgRunId_ = other.tfdbgRunId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tensorflowVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + fileVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + tfdbgRunId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object tensorflowVersion_ = ""; + /** + *
    +     * Version of TensorFlow.
    +     * 
    + * + * string tensorflow_version = 1; + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Version of TensorFlow.
    +     * 
    + * + * string tensorflow_version = 1; + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Version of TensorFlow.
    +     * 
    + * + * string tensorflow_version = 1; + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tensorflowVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Version of TensorFlow.
    +     * 
    + * + * string tensorflow_version = 1; + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Version of TensorFlow.
    +     * 
    + * + * string tensorflow_version = 1; + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tensorflowVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object fileVersion_ = ""; + /** + *
    +     * Version of the DebugEvent file format.
    +     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +     * 
    + * + * string file_version = 2; + * @return The fileVersion. + */ + public java.lang.String getFileVersion() { + java.lang.Object ref = fileVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Version of the DebugEvent file format.
    +     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +     * 
    + * + * string file_version = 2; + * @return The bytes for fileVersion. + */ + public com.google.protobuf.ByteString + getFileVersionBytes() { + java.lang.Object ref = fileVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Version of the DebugEvent file format.
    +     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +     * 
    + * + * string file_version = 2; + * @param value The fileVersion to set. + * @return This builder for chaining. + */ + public Builder setFileVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fileVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Version of the DebugEvent file format.
    +     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +     * 
    + * + * string file_version = 2; + * @return This builder for chaining. + */ + public Builder clearFileVersion() { + fileVersion_ = getDefaultInstance().getFileVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Version of the DebugEvent file format.
    +     * Has a format of "debug.Event:<number>", e.g., "debug.Event:1".
    +     * 
    + * + * string file_version = 2; + * @param value The bytes for fileVersion to set. + * @return This builder for chaining. + */ + public Builder setFileVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fileVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object tfdbgRunId_ = ""; + /** + *
    +     * A unique ID for the current run of tfdbg.
    +     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +     * have the same ID.
    +     * 
    + * + * string tfdbg_run_id = 3; + * @return The tfdbgRunId. + */ + public java.lang.String getTfdbgRunId() { + java.lang.Object ref = tfdbgRunId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tfdbgRunId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A unique ID for the current run of tfdbg.
    +     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +     * have the same ID.
    +     * 
    + * + * string tfdbg_run_id = 3; + * @return The bytes for tfdbgRunId. + */ + public com.google.protobuf.ByteString + getTfdbgRunIdBytes() { + java.lang.Object ref = tfdbgRunId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfdbgRunId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A unique ID for the current run of tfdbg.
    +     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +     * have the same ID.
    +     * 
    + * + * string tfdbg_run_id = 3; + * @param value The tfdbgRunId to set. + * @return This builder for chaining. + */ + public Builder setTfdbgRunId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tfdbgRunId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * A unique ID for the current run of tfdbg.
    +     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +     * have the same ID.
    +     * 
    + * + * string tfdbg_run_id = 3; + * @return This builder for chaining. + */ + public Builder clearTfdbgRunId() { + tfdbgRunId_ = getDefaultInstance().getTfdbgRunId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * A unique ID for the current run of tfdbg.
    +     * A run of tfdbg is defined as a TensorFlow job instrumented by tfdbg.
    +     * Multiple hosts in a distributed TensorFlow job instrumented by tfdbg
    +     * have the same ID.
    +     * 
    + * + * string tfdbg_run_id = 3; + * @param value The bytes for tfdbgRunId to set. + * @return This builder for chaining. + */ + public Builder setTfdbgRunIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tfdbgRunId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebugMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebugMetadata) + private static final org.tensorflow.proto.DebugMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebugMetadata(); + } + + public static org.tensorflow.proto.DebugMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebugMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebugMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadataOrBuilder.java similarity index 85% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadataOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadataOrBuilder.java index 91015599f7d..20d753b7194 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebugMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugMetadataOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface DebugMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebugMetadata) @@ -13,6 +15,7 @@ public interface DebugMetadataOrBuilder extends *
    * * string tensorflow_version = 1; + * @return The tensorflowVersion. */ java.lang.String getTensorflowVersion(); /** @@ -21,6 +24,7 @@ public interface DebugMetadataOrBuilder extends * * * string tensorflow_version = 1; + * @return The bytes for tensorflowVersion. */ com.google.protobuf.ByteString getTensorflowVersionBytes(); @@ -32,6 +36,7 @@ public interface DebugMetadataOrBuilder extends * * * string file_version = 2; + * @return The fileVersion. */ java.lang.String getFileVersion(); /** @@ -41,6 +46,7 @@ public interface DebugMetadataOrBuilder extends * * * string file_version = 2; + * @return The bytes for fileVersion. */ com.google.protobuf.ByteString getFileVersionBytes(); @@ -54,6 +60,7 @@ public interface DebugMetadataOrBuilder extends * * * string tfdbg_run_id = 3; + * @return The tfdbgRunId. */ java.lang.String getTfdbgRunId(); /** @@ -65,6 +72,7 @@ public interface DebugMetadataOrBuilder extends * * * string tfdbg_run_id = 3; + * @return The bytes for tfdbgRunId. */ com.google.protobuf.ByteString getTfdbgRunIdBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptions.java new file mode 100644 index 00000000000..2e7f0fdfeda --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptions.java @@ -0,0 +1,1005 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Options for initializing DebuggerState in TensorFlow Debugger (tfdbg).
    + * 
    + * + * Protobuf type {@code tensorflow.DebugOptions} + */ +public final class DebugOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebugOptions) + DebugOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugOptions.class.getName()); + } + // Use DebugOptions.newBuilder() to construct. + private DebugOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebugOptions() { + debugTensorWatchOpts_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugOptions.class, org.tensorflow.proto.DebugOptions.Builder.class); + } + + public static final int DEBUG_TENSOR_WATCH_OPTS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List debugTensorWatchOpts_; + /** + *
    +   * Debugging options
    +   * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + @java.lang.Override + public java.util.List getDebugTensorWatchOptsList() { + return debugTensorWatchOpts_; + } + /** + *
    +   * Debugging options
    +   * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + @java.lang.Override + public java.util.List + getDebugTensorWatchOptsOrBuilderList() { + return debugTensorWatchOpts_; + } + /** + *
    +   * Debugging options
    +   * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + @java.lang.Override + public int getDebugTensorWatchOptsCount() { + return debugTensorWatchOpts_.size(); + } + /** + *
    +   * Debugging options
    +   * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + @java.lang.Override + public org.tensorflow.proto.DebugTensorWatch getDebugTensorWatchOpts(int index) { + return debugTensorWatchOpts_.get(index); + } + /** + *
    +   * Debugging options
    +   * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + @java.lang.Override + public org.tensorflow.proto.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder( + int index) { + return debugTensorWatchOpts_.get(index); + } + + public static final int GLOBAL_STEP_FIELD_NUMBER = 10; + private long globalStep_ = 0L; + /** + *
    +   * Caller-specified global step count.
    +   * Note that this is distinct from the session run count and the executor
    +   * step count.
    +   * 
    + * + * int64 global_step = 10; + * @return The globalStep. + */ + @java.lang.Override + public long getGlobalStep() { + return globalStep_; + } + + public static final int RESET_DISK_BYTE_USAGE_FIELD_NUMBER = 11; + private boolean resetDiskByteUsage_ = false; + /** + *
    +   * Whether the total disk usage of tfdbg is to be reset to zero
    +   * in this Session.run call. This is used by wrappers and hooks
    +   * such as the local CLI ones to indicate that the dumped tensors
    +   * are cleaned up from the disk after each Session.run.
    +   * 
    + * + * bool reset_disk_byte_usage = 11; + * @return The resetDiskByteUsage. + */ + @java.lang.Override + public boolean getResetDiskByteUsage() { + return resetDiskByteUsage_; + } + + 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 { + for (int i = 0; i < debugTensorWatchOpts_.size(); i++) { + output.writeMessage(4, debugTensorWatchOpts_.get(i)); + } + if (globalStep_ != 0L) { + output.writeInt64(10, globalStep_); + } + if (resetDiskByteUsage_ != false) { + output.writeBool(11, resetDiskByteUsage_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < debugTensorWatchOpts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, debugTensorWatchOpts_.get(i)); + } + if (globalStep_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, globalStep_); + } + if (resetDiskByteUsage_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, resetDiskByteUsage_); + } + size += getUnknownFields().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.DebugOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.DebugOptions other = (org.tensorflow.proto.DebugOptions) obj; + + if (!getDebugTensorWatchOptsList() + .equals(other.getDebugTensorWatchOptsList())) return false; + if (getGlobalStep() + != other.getGlobalStep()) return false; + if (getResetDiskByteUsage() + != other.getResetDiskByteUsage()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDebugTensorWatchOptsCount() > 0) { + hash = (37 * hash) + DEBUG_TENSOR_WATCH_OPTS_FIELD_NUMBER; + hash = (53 * hash) + getDebugTensorWatchOptsList().hashCode(); + } + hash = (37 * hash) + GLOBAL_STEP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGlobalStep()); + hash = (37 * hash) + RESET_DISK_BYTE_USAGE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getResetDiskByteUsage()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebugOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugOptions 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.DebugOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugOptions 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.DebugOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebugOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebugOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebugOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebugOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebugOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Options for initializing DebuggerState in TensorFlow Debugger (tfdbg).
    +   * 
    + * + * Protobuf type {@code tensorflow.DebugOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebugOptions) + org.tensorflow.proto.DebugOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugOptions.class, org.tensorflow.proto.DebugOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.DebugOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (debugTensorWatchOptsBuilder_ == null) { + debugTensorWatchOpts_ = java.util.Collections.emptyList(); + } else { + debugTensorWatchOpts_ = null; + debugTensorWatchOptsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + globalStep_ = 0L; + resetDiskByteUsage_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebugOptions getDefaultInstanceForType() { + return org.tensorflow.proto.DebugOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebugOptions build() { + org.tensorflow.proto.DebugOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebugOptions buildPartial() { + org.tensorflow.proto.DebugOptions result = new org.tensorflow.proto.DebugOptions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.DebugOptions result) { + if (debugTensorWatchOptsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + debugTensorWatchOpts_ = java.util.Collections.unmodifiableList(debugTensorWatchOpts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.debugTensorWatchOpts_ = debugTensorWatchOpts_; + } else { + result.debugTensorWatchOpts_ = debugTensorWatchOptsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.DebugOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.globalStep_ = globalStep_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resetDiskByteUsage_ = resetDiskByteUsage_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebugOptions) { + return mergeFrom((org.tensorflow.proto.DebugOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebugOptions other) { + if (other == org.tensorflow.proto.DebugOptions.getDefaultInstance()) return this; + if (debugTensorWatchOptsBuilder_ == null) { + if (!other.debugTensorWatchOpts_.isEmpty()) { + if (debugTensorWatchOpts_.isEmpty()) { + debugTensorWatchOpts_ = other.debugTensorWatchOpts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.addAll(other.debugTensorWatchOpts_); + } + onChanged(); + } + } else { + if (!other.debugTensorWatchOpts_.isEmpty()) { + if (debugTensorWatchOptsBuilder_.isEmpty()) { + debugTensorWatchOptsBuilder_.dispose(); + debugTensorWatchOptsBuilder_ = null; + debugTensorWatchOpts_ = other.debugTensorWatchOpts_; + bitField0_ = (bitField0_ & ~0x00000001); + debugTensorWatchOptsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDebugTensorWatchOptsFieldBuilder() : null; + } else { + debugTensorWatchOptsBuilder_.addAllMessages(other.debugTensorWatchOpts_); + } + } + } + if (other.getGlobalStep() != 0L) { + setGlobalStep(other.getGlobalStep()); + } + if (other.getResetDiskByteUsage() != false) { + setResetDiskByteUsage(other.getResetDiskByteUsage()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 34: { + org.tensorflow.proto.DebugTensorWatch m = + input.readMessage( + org.tensorflow.proto.DebugTensorWatch.parser(), + extensionRegistry); + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.add(m); + } else { + debugTensorWatchOptsBuilder_.addMessage(m); + } + break; + } // case 34 + case 80: { + globalStep_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 80 + case 88: { + resetDiskByteUsage_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 88 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List debugTensorWatchOpts_ = + java.util.Collections.emptyList(); + private void ensureDebugTensorWatchOptsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + debugTensorWatchOpts_ = new java.util.ArrayList(debugTensorWatchOpts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebugTensorWatch, org.tensorflow.proto.DebugTensorWatch.Builder, org.tensorflow.proto.DebugTensorWatchOrBuilder> debugTensorWatchOptsBuilder_; + + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public java.util.List getDebugTensorWatchOptsList() { + if (debugTensorWatchOptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(debugTensorWatchOpts_); + } else { + return debugTensorWatchOptsBuilder_.getMessageList(); + } + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public int getDebugTensorWatchOptsCount() { + if (debugTensorWatchOptsBuilder_ == null) { + return debugTensorWatchOpts_.size(); + } else { + return debugTensorWatchOptsBuilder_.getCount(); + } + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public org.tensorflow.proto.DebugTensorWatch getDebugTensorWatchOpts(int index) { + if (debugTensorWatchOptsBuilder_ == null) { + return debugTensorWatchOpts_.get(index); + } else { + return debugTensorWatchOptsBuilder_.getMessage(index); + } + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder setDebugTensorWatchOpts( + int index, org.tensorflow.proto.DebugTensorWatch value) { + if (debugTensorWatchOptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.set(index, value); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder setDebugTensorWatchOpts( + int index, org.tensorflow.proto.DebugTensorWatch.Builder builderForValue) { + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.set(index, builderForValue.build()); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder addDebugTensorWatchOpts(org.tensorflow.proto.DebugTensorWatch value) { + if (debugTensorWatchOptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.add(value); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder addDebugTensorWatchOpts( + int index, org.tensorflow.proto.DebugTensorWatch value) { + if (debugTensorWatchOptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.add(index, value); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder addDebugTensorWatchOpts( + org.tensorflow.proto.DebugTensorWatch.Builder builderForValue) { + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.add(builderForValue.build()); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder addDebugTensorWatchOpts( + int index, org.tensorflow.proto.DebugTensorWatch.Builder builderForValue) { + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.add(index, builderForValue.build()); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder addAllDebugTensorWatchOpts( + java.lang.Iterable values) { + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, debugTensorWatchOpts_); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder clearDebugTensorWatchOpts() { + if (debugTensorWatchOptsBuilder_ == null) { + debugTensorWatchOpts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public Builder removeDebugTensorWatchOpts(int index) { + if (debugTensorWatchOptsBuilder_ == null) { + ensureDebugTensorWatchOptsIsMutable(); + debugTensorWatchOpts_.remove(index); + onChanged(); + } else { + debugTensorWatchOptsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public org.tensorflow.proto.DebugTensorWatch.Builder getDebugTensorWatchOptsBuilder( + int index) { + return getDebugTensorWatchOptsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public org.tensorflow.proto.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder( + int index) { + if (debugTensorWatchOptsBuilder_ == null) { + return debugTensorWatchOpts_.get(index); } else { + return debugTensorWatchOptsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public java.util.List + getDebugTensorWatchOptsOrBuilderList() { + if (debugTensorWatchOptsBuilder_ != null) { + return debugTensorWatchOptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(debugTensorWatchOpts_); + } + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public org.tensorflow.proto.DebugTensorWatch.Builder addDebugTensorWatchOptsBuilder() { + return getDebugTensorWatchOptsFieldBuilder().addBuilder( + org.tensorflow.proto.DebugTensorWatch.getDefaultInstance()); + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public org.tensorflow.proto.DebugTensorWatch.Builder addDebugTensorWatchOptsBuilder( + int index) { + return getDebugTensorWatchOptsFieldBuilder().addBuilder( + index, org.tensorflow.proto.DebugTensorWatch.getDefaultInstance()); + } + /** + *
    +     * Debugging options
    +     * 
    + * + * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; + */ + public java.util.List + getDebugTensorWatchOptsBuilderList() { + return getDebugTensorWatchOptsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebugTensorWatch, org.tensorflow.proto.DebugTensorWatch.Builder, org.tensorflow.proto.DebugTensorWatchOrBuilder> + getDebugTensorWatchOptsFieldBuilder() { + if (debugTensorWatchOptsBuilder_ == null) { + debugTensorWatchOptsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebugTensorWatch, org.tensorflow.proto.DebugTensorWatch.Builder, org.tensorflow.proto.DebugTensorWatchOrBuilder>( + debugTensorWatchOpts_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + debugTensorWatchOpts_ = null; + } + return debugTensorWatchOptsBuilder_; + } + + private long globalStep_ ; + /** + *
    +     * Caller-specified global step count.
    +     * Note that this is distinct from the session run count and the executor
    +     * step count.
    +     * 
    + * + * int64 global_step = 10; + * @return The globalStep. + */ + @java.lang.Override + public long getGlobalStep() { + return globalStep_; + } + /** + *
    +     * Caller-specified global step count.
    +     * Note that this is distinct from the session run count and the executor
    +     * step count.
    +     * 
    + * + * int64 global_step = 10; + * @param value The globalStep to set. + * @return This builder for chaining. + */ + public Builder setGlobalStep(long value) { + + globalStep_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Caller-specified global step count.
    +     * Note that this is distinct from the session run count and the executor
    +     * step count.
    +     * 
    + * + * int64 global_step = 10; + * @return This builder for chaining. + */ + public Builder clearGlobalStep() { + bitField0_ = (bitField0_ & ~0x00000002); + globalStep_ = 0L; + onChanged(); + return this; + } + + private boolean resetDiskByteUsage_ ; + /** + *
    +     * Whether the total disk usage of tfdbg is to be reset to zero
    +     * in this Session.run call. This is used by wrappers and hooks
    +     * such as the local CLI ones to indicate that the dumped tensors
    +     * are cleaned up from the disk after each Session.run.
    +     * 
    + * + * bool reset_disk_byte_usage = 11; + * @return The resetDiskByteUsage. + */ + @java.lang.Override + public boolean getResetDiskByteUsage() { + return resetDiskByteUsage_; + } + /** + *
    +     * Whether the total disk usage of tfdbg is to be reset to zero
    +     * in this Session.run call. This is used by wrappers and hooks
    +     * such as the local CLI ones to indicate that the dumped tensors
    +     * are cleaned up from the disk after each Session.run.
    +     * 
    + * + * bool reset_disk_byte_usage = 11; + * @param value The resetDiskByteUsage to set. + * @return This builder for chaining. + */ + public Builder setResetDiskByteUsage(boolean value) { + + resetDiskByteUsage_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Whether the total disk usage of tfdbg is to be reset to zero
    +     * in this Session.run call. This is used by wrappers and hooks
    +     * such as the local CLI ones to indicate that the dumped tensors
    +     * are cleaned up from the disk after each Session.run.
    +     * 
    + * + * bool reset_disk_byte_usage = 11; + * @return This builder for chaining. + */ + public Builder clearResetDiskByteUsage() { + bitField0_ = (bitField0_ & ~0x00000004); + resetDiskByteUsage_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebugOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebugOptions) + private static final org.tensorflow.proto.DebugOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebugOptions(); + } + + public static org.tensorflow.proto.DebugOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebugOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebugOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptionsOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptionsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptionsOrBuilder.java index 65f0407737a..ac859a7de1d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugOptionsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugOptionsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface DebugOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebugOptions) @@ -14,7 +16,7 @@ public interface DebugOptionsOrBuilder extends * * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4; */ - java.util.List + java.util.List getDebugTensorWatchOptsList(); /** *
    @@ -23,7 +25,7 @@ public interface DebugOptionsOrBuilder extends
        *
        * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4;
        */
    -  org.tensorflow.proto.framework.DebugTensorWatch getDebugTensorWatchOpts(int index);
    +  org.tensorflow.proto.DebugTensorWatch getDebugTensorWatchOpts(int index);
       /**
        * 
        * Debugging options
    @@ -39,7 +41,7 @@ public interface DebugOptionsOrBuilder extends
        *
        * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4;
        */
    -  java.util.List 
    +  java.util.List 
           getDebugTensorWatchOptsOrBuilderList();
       /**
        * 
    @@ -48,7 +50,7 @@ public interface DebugOptionsOrBuilder extends
        *
        * repeated .tensorflow.DebugTensorWatch debug_tensor_watch_opts = 4;
        */
    -  org.tensorflow.proto.framework.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder(
    +  org.tensorflow.proto.DebugTensorWatchOrBuilder getDebugTensorWatchOptsOrBuilder(
           int index);
     
       /**
    @@ -59,6 +61,7 @@ org.tensorflow.proto.framework.DebugTensorWatchOrBuilder getDebugTensorWatchOpts
        * 
    * * int64 global_step = 10; + * @return The globalStep. */ long getGlobalStep(); @@ -71,6 +74,7 @@ org.tensorflow.proto.framework.DebugTensorWatchOrBuilder getDebugTensorWatchOpts *
    * * bool reset_disk_byte_usage = 11; + * @return The resetDiskByteUsage. */ boolean getResetDiskByteUsage(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugProtos.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugProtos.java index 300d8a92351..ca250aff759 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebugProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class DebugProtos { private DebugProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,22 +28,22 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DebugTensorWatch_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DebugOptions_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DebugOptions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DebuggedSourceFile_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DebuggedSourceFiles_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -55,11 +66,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\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" + "2\036.tensorflow.DebuggedSourceFileB\177\n\024org." + + "tensorflow.protoB\013DebugProtosP\001ZUgithub." + + "com/tensorflow/tensorflow/tensorflow/go/" + + "core/protobuf/for_core_protos_go_proto\370\001" + + "\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -68,27 +79,28 @@ public static void registerAllExtensions( internal_static_tensorflow_DebugTensorWatch_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DebugTensorWatch_descriptor, new java.lang.String[] { "NodeName", "OutputSlot", "DebugOps", "DebugUrls", "TolerateDebugOpCreationFailures", }); internal_static_tensorflow_DebugOptions_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_DebugOptions_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DebugOptions_descriptor, new java.lang.String[] { "DebugTensorWatchOpts", "GlobalStep", "ResetDiskByteUsage", }); internal_static_tensorflow_DebuggedSourceFile_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DebuggedSourceFile_descriptor, new java.lang.String[] { "Host", "FilePath", "LastModified", "Bytes", "Lines", }); internal_static_tensorflow_DebuggedSourceFiles_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DebuggedSourceFiles_descriptor, new java.lang.String[] { "SourceFiles", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatch.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatch.java new file mode 100644 index 00000000000..e1fc459a203 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatch.java @@ -0,0 +1,1491 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Option for watching a node in TensorFlow Debugger (tfdbg).
    + * 
    + * + * Protobuf type {@code tensorflow.DebugTensorWatch} + */ +public final class DebugTensorWatch extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebugTensorWatch) + DebugTensorWatchOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebugTensorWatch.class.getName()); + } + // Use DebugTensorWatch.newBuilder() to construct. + private DebugTensorWatch(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebugTensorWatch() { + nodeName_ = ""; + debugOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + debugUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugTensorWatch.class, org.tensorflow.proto.DebugTensorWatch.Builder.class); + } + + public static final int NODE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object nodeName_ = ""; + /** + *
    +   * Name of the node to watch.
    +   * Use "*" for wildcard. But note: currently, regex is not supported in
    +   * general.
    +   * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + @java.lang.Override + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + 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(); + nodeName_ = s; + return s; + } + } + /** + *
    +   * Name of the node to watch.
    +   * Use "*" for wildcard. But note: currently, regex is not supported in
    +   * general.
    +   * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_SLOT_FIELD_NUMBER = 2; + private int outputSlot_ = 0; + /** + *
    +   * Output slot to watch.
    +   * The semantics of output_slot == -1 is that all outputs of the node
    +   * will be watched (i.e., a wildcard).
    +   * Other negative values of output_slot are invalid and will lead to
    +   * errors currently.
    +   * 
    + * + * int32 output_slot = 2; + * @return The outputSlot. + */ + @java.lang.Override + public int getOutputSlot() { + return outputSlot_; + } + + public static final int DEBUG_OPS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList debugOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @return A list containing the debugOps. + */ + public com.google.protobuf.ProtocolStringList + getDebugOpsList() { + return debugOps_; + } + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @return The count of debugOps. + */ + public int getDebugOpsCount() { + return debugOps_.size(); + } + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the element to return. + * @return The debugOps at the given index. + */ + public java.lang.String getDebugOps(int index) { + return debugOps_.get(index); + } + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the debugOps at the given index. + */ + public com.google.protobuf.ByteString + getDebugOpsBytes(int index) { + return debugOps_.getByteString(index); + } + + public static final int DEBUG_URLS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList debugUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @return A list containing the debugUrls. + */ + public com.google.protobuf.ProtocolStringList + getDebugUrlsList() { + return debugUrls_; + } + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @return The count of debugUrls. + */ + public int getDebugUrlsCount() { + return debugUrls_.size(); + } + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the element to return. + * @return The debugUrls at the given index. + */ + public java.lang.String getDebugUrls(int index) { + return debugUrls_.get(index); + } + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the value to return. + * @return The bytes of the debugUrls at the given index. + */ + public com.google.protobuf.ByteString + getDebugUrlsBytes(int index) { + return debugUrls_.getByteString(index); + } + + public static final int TOLERATE_DEBUG_OP_CREATION_FAILURES_FIELD_NUMBER = 5; + private boolean tolerateDebugOpCreationFailures_ = false; + /** + *
    +   * Do not error out if debug op creation fails (e.g., due to dtype
    +   * incompatibility). Instead, just log the failure.
    +   * 
    + * + * bool tolerate_debug_op_creation_failures = 5; + * @return The tolerateDebugOpCreationFailures. + */ + @java.lang.Override + public boolean getTolerateDebugOpCreationFailures() { + return tolerateDebugOpCreationFailures_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(nodeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, nodeName_); + } + if (outputSlot_ != 0) { + output.writeInt32(2, outputSlot_); + } + for (int i = 0; i < debugOps_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, debugOps_.getRaw(i)); + } + for (int i = 0; i < debugUrls_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, debugUrls_.getRaw(i)); + } + if (tolerateDebugOpCreationFailures_ != false) { + output.writeBool(5, tolerateDebugOpCreationFailures_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nodeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, nodeName_); + } + if (outputSlot_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, outputSlot_); + } + { + int dataSize = 0; + for (int i = 0; i < debugOps_.size(); i++) { + dataSize += computeStringSizeNoTag(debugOps_.getRaw(i)); + } + size += dataSize; + size += 1 * getDebugOpsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < debugUrls_.size(); i++) { + dataSize += computeStringSizeNoTag(debugUrls_.getRaw(i)); + } + size += dataSize; + size += 1 * getDebugUrlsList().size(); + } + if (tolerateDebugOpCreationFailures_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, tolerateDebugOpCreationFailures_); + } + size += getUnknownFields().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.DebugTensorWatch)) { + return super.equals(obj); + } + org.tensorflow.proto.DebugTensorWatch other = (org.tensorflow.proto.DebugTensorWatch) obj; + + if (!getNodeName() + .equals(other.getNodeName())) return false; + if (getOutputSlot() + != other.getOutputSlot()) return false; + if (!getDebugOpsList() + .equals(other.getDebugOpsList())) return false; + if (!getDebugUrlsList() + .equals(other.getDebugUrlsList())) return false; + if (getTolerateDebugOpCreationFailures() + != other.getTolerateDebugOpCreationFailures()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNodeName().hashCode(); + hash = (37 * hash) + OUTPUT_SLOT_FIELD_NUMBER; + hash = (53 * hash) + getOutputSlot(); + if (getDebugOpsCount() > 0) { + hash = (37 * hash) + DEBUG_OPS_FIELD_NUMBER; + hash = (53 * hash) + getDebugOpsList().hashCode(); + } + if (getDebugUrlsCount() > 0) { + hash = (37 * hash) + DEBUG_URLS_FIELD_NUMBER; + hash = (53 * hash) + getDebugUrlsList().hashCode(); + } + hash = (37 * hash) + TOLERATE_DEBUG_OP_CREATION_FAILURES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTolerateDebugOpCreationFailures()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebugTensorWatch parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugTensorWatch 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.DebugTensorWatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugTensorWatch 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.DebugTensorWatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebugTensorWatch parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebugTensorWatch parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugTensorWatch parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebugTensorWatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebugTensorWatch parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebugTensorWatch parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebugTensorWatch parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebugTensorWatch 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Option for watching a node in TensorFlow Debugger (tfdbg).
    +   * 
    + * + * Protobuf type {@code tensorflow.DebugTensorWatch} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebugTensorWatch) + org.tensorflow.proto.DebugTensorWatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugTensorWatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebugTensorWatch.class, org.tensorflow.proto.DebugTensorWatch.Builder.class); + } + + // Construct using org.tensorflow.proto.DebugTensorWatch.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeName_ = ""; + outputSlot_ = 0; + debugOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + debugUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + tolerateDebugOpCreationFailures_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebugTensorWatch_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebugTensorWatch getDefaultInstanceForType() { + return org.tensorflow.proto.DebugTensorWatch.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebugTensorWatch build() { + org.tensorflow.proto.DebugTensorWatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebugTensorWatch buildPartial() { + org.tensorflow.proto.DebugTensorWatch result = new org.tensorflow.proto.DebugTensorWatch(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebugTensorWatch result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeName_ = nodeName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputSlot_ = outputSlot_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + debugOps_.makeImmutable(); + result.debugOps_ = debugOps_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + debugUrls_.makeImmutable(); + result.debugUrls_ = debugUrls_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tolerateDebugOpCreationFailures_ = tolerateDebugOpCreationFailures_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebugTensorWatch) { + return mergeFrom((org.tensorflow.proto.DebugTensorWatch)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebugTensorWatch other) { + if (other == org.tensorflow.proto.DebugTensorWatch.getDefaultInstance()) return this; + if (!other.getNodeName().isEmpty()) { + nodeName_ = other.nodeName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getOutputSlot() != 0) { + setOutputSlot(other.getOutputSlot()); + } + if (!other.debugOps_.isEmpty()) { + if (debugOps_.isEmpty()) { + debugOps_ = other.debugOps_; + bitField0_ |= 0x00000004; + } else { + ensureDebugOpsIsMutable(); + debugOps_.addAll(other.debugOps_); + } + onChanged(); + } + if (!other.debugUrls_.isEmpty()) { + if (debugUrls_.isEmpty()) { + debugUrls_ = other.debugUrls_; + bitField0_ |= 0x00000008; + } else { + ensureDebugUrlsIsMutable(); + debugUrls_.addAll(other.debugUrls_); + } + onChanged(); + } + if (other.getTolerateDebugOpCreationFailures() != false) { + setTolerateDebugOpCreationFailures(other.getTolerateDebugOpCreationFailures()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + nodeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + outputSlot_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureDebugOpsIsMutable(); + debugOps_.add(s); + break; + } // case 26 + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + ensureDebugUrlsIsMutable(); + debugUrls_.add(s); + break; + } // case 34 + case 40: { + tolerateDebugOpCreationFailures_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object nodeName_ = ""; + /** + *
    +     * Name of the node to watch.
    +     * Use "*" for wildcard. But note: currently, regex is not supported in
    +     * general.
    +     * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the node to watch.
    +     * Use "*" for wildcard. But note: currently, regex is not supported in
    +     * general.
    +     * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the node to watch.
    +     * Use "*" for wildcard. But note: currently, regex is not supported in
    +     * general.
    +     * 
    + * + * string node_name = 1; + * @param value The nodeName to set. + * @return This builder for chaining. + */ + public Builder setNodeName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + nodeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the node to watch.
    +     * Use "*" for wildcard. But note: currently, regex is not supported in
    +     * general.
    +     * 
    + * + * string node_name = 1; + * @return This builder for chaining. + */ + public Builder clearNodeName() { + nodeName_ = getDefaultInstance().getNodeName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the node to watch.
    +     * Use "*" for wildcard. But note: currently, regex is not supported in
    +     * general.
    +     * 
    + * + * string node_name = 1; + * @param value The bytes for nodeName to set. + * @return This builder for chaining. + */ + public Builder setNodeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + nodeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int outputSlot_ ; + /** + *
    +     * Output slot to watch.
    +     * The semantics of output_slot == -1 is that all outputs of the node
    +     * will be watched (i.e., a wildcard).
    +     * Other negative values of output_slot are invalid and will lead to
    +     * errors currently.
    +     * 
    + * + * int32 output_slot = 2; + * @return The outputSlot. + */ + @java.lang.Override + public int getOutputSlot() { + return outputSlot_; + } + /** + *
    +     * Output slot to watch.
    +     * The semantics of output_slot == -1 is that all outputs of the node
    +     * will be watched (i.e., a wildcard).
    +     * Other negative values of output_slot are invalid and will lead to
    +     * errors currently.
    +     * 
    + * + * int32 output_slot = 2; + * @param value The outputSlot to set. + * @return This builder for chaining. + */ + public Builder setOutputSlot(int value) { + + outputSlot_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Output slot to watch.
    +     * The semantics of output_slot == -1 is that all outputs of the node
    +     * will be watched (i.e., a wildcard).
    +     * Other negative values of output_slot are invalid and will lead to
    +     * errors currently.
    +     * 
    + * + * int32 output_slot = 2; + * @return This builder for chaining. + */ + public Builder clearOutputSlot() { + bitField0_ = (bitField0_ & ~0x00000002); + outputSlot_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList debugOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDebugOpsIsMutable() { + if (!debugOps_.isModifiable()) { + debugOps_ = new com.google.protobuf.LazyStringArrayList(debugOps_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @return A list containing the debugOps. + */ + public com.google.protobuf.ProtocolStringList + getDebugOpsList() { + debugOps_.makeImmutable(); + return debugOps_; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @return The count of debugOps. + */ + public int getDebugOpsCount() { + return debugOps_.size(); + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the element to return. + * @return The debugOps at the given index. + */ + public java.lang.String getDebugOps(int index) { + return debugOps_.get(index); + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the debugOps at the given index. + */ + public com.google.protobuf.ByteString + getDebugOpsBytes(int index) { + return debugOps_.getByteString(index); + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param index The index to set the value at. + * @param value The debugOps to set. + * @return This builder for chaining. + */ + public Builder setDebugOps( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDebugOpsIsMutable(); + debugOps_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param value The debugOps to add. + * @return This builder for chaining. + */ + public Builder addDebugOps( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDebugOpsIsMutable(); + debugOps_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param values The debugOps to add. + * @return This builder for chaining. + */ + public Builder addAllDebugOps( + java.lang.Iterable values) { + ensureDebugOpsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, debugOps_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @return This builder for chaining. + */ + public Builder clearDebugOps() { + debugOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Name(s) of the debugging op(s).
    +     * One or more than one probes on a tensor.
    +     * e.g., {"DebugIdentity", "DebugNanCount"}
    +     * 
    + * + * repeated string debug_ops = 3; + * @param value The bytes of the debugOps to add. + * @return This builder for chaining. + */ + public Builder addDebugOpsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDebugOpsIsMutable(); + debugOps_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList debugUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDebugUrlsIsMutable() { + if (!debugUrls_.isModifiable()) { + debugUrls_ = new com.google.protobuf.LazyStringArrayList(debugUrls_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @return A list containing the debugUrls. + */ + public com.google.protobuf.ProtocolStringList + getDebugUrlsList() { + debugUrls_.makeImmutable(); + return debugUrls_; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @return The count of debugUrls. + */ + public int getDebugUrlsCount() { + return debugUrls_.size(); + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the element to return. + * @return The debugUrls at the given index. + */ + public java.lang.String getDebugUrls(int index) { + return debugUrls_.get(index); + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the value to return. + * @return The bytes of the debugUrls at the given index. + */ + public com.google.protobuf.ByteString + getDebugUrlsBytes(int index) { + return debugUrls_.getByteString(index); + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param index The index to set the value at. + * @param value The debugUrls to set. + * @return This builder for chaining. + */ + public Builder setDebugUrls( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDebugUrlsIsMutable(); + debugUrls_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param value The debugUrls to add. + * @return This builder for chaining. + */ + public Builder addDebugUrls( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDebugUrlsIsMutable(); + debugUrls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param values The debugUrls to add. + * @return This builder for chaining. + */ + public Builder addAllDebugUrls( + java.lang.Iterable values) { + ensureDebugUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, debugUrls_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @return This builder for chaining. + */ + public Builder clearDebugUrls() { + debugUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
    +     * URL(s) for debug targets(s).
    +     *
    +     * Supported URL formats are:
    +     * - file:///foo/tfdbg_dump: Writes out Event content to file
    +     * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +     * already exist.
    +     * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +     * service running at localhost:11011 with the event.
    +     * - memcbk:///event_key: Routes tensors to clients using the
    +     * callback registered with the DebugCallbackRegistry for event_key.
    +     *
    +     * Each debug op listed in debug_ops will publish its output tensor (debug
    +     * signal) to all URLs in debug_urls.
    +     *
    +     * N.B. Session::Run() supports concurrent invocations of the same inputs
    +     * (feed keys), outputs and target nodes. If such concurrent invocations
    +     * are to be debugged, the callers of Session::Run() must use distinct
    +     * debug_urls to make sure that the streamed or dumped events do not overlap
    +     * among the invocations.
    +     * TODO(cais): More visible documentation of this in g3docs.
    +     * 
    + * + * repeated string debug_urls = 4; + * @param value The bytes of the debugUrls to add. + * @return This builder for chaining. + */ + public Builder addDebugUrlsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDebugUrlsIsMutable(); + debugUrls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean tolerateDebugOpCreationFailures_ ; + /** + *
    +     * Do not error out if debug op creation fails (e.g., due to dtype
    +     * incompatibility). Instead, just log the failure.
    +     * 
    + * + * bool tolerate_debug_op_creation_failures = 5; + * @return The tolerateDebugOpCreationFailures. + */ + @java.lang.Override + public boolean getTolerateDebugOpCreationFailures() { + return tolerateDebugOpCreationFailures_; + } + /** + *
    +     * Do not error out if debug op creation fails (e.g., due to dtype
    +     * incompatibility). Instead, just log the failure.
    +     * 
    + * + * bool tolerate_debug_op_creation_failures = 5; + * @param value The tolerateDebugOpCreationFailures to set. + * @return This builder for chaining. + */ + public Builder setTolerateDebugOpCreationFailures(boolean value) { + + tolerateDebugOpCreationFailures_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Do not error out if debug op creation fails (e.g., due to dtype
    +     * incompatibility). Instead, just log the failure.
    +     * 
    + * + * bool tolerate_debug_op_creation_failures = 5; + * @return This builder for chaining. + */ + public Builder clearTolerateDebugOpCreationFailures() { + bitField0_ = (bitField0_ & ~0x00000010); + tolerateDebugOpCreationFailures_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebugTensorWatch) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebugTensorWatch) + private static final org.tensorflow.proto.DebugTensorWatch DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebugTensorWatch(); + } + + public static org.tensorflow.proto.DebugTensorWatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebugTensorWatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebugTensorWatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatchOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatchOrBuilder.java new file mode 100644 index 00000000000..842457cd90f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebugTensorWatchOrBuilder.java @@ -0,0 +1,226 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface DebugTensorWatchOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.DebugTensorWatch) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Name of the node to watch.
    +   * Use "*" for wildcard. But note: currently, regex is not supported in
    +   * general.
    +   * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + java.lang.String getNodeName(); + /** + *
    +   * Name of the node to watch.
    +   * Use "*" for wildcard. But note: currently, regex is not supported in
    +   * general.
    +   * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + com.google.protobuf.ByteString + getNodeNameBytes(); + + /** + *
    +   * Output slot to watch.
    +   * The semantics of output_slot == -1 is that all outputs of the node
    +   * will be watched (i.e., a wildcard).
    +   * Other negative values of output_slot are invalid and will lead to
    +   * errors currently.
    +   * 
    + * + * int32 output_slot = 2; + * @return The outputSlot. + */ + int getOutputSlot(); + + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @return A list containing the debugOps. + */ + java.util.List + getDebugOpsList(); + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @return The count of debugOps. + */ + int getDebugOpsCount(); + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the element to return. + * @return The debugOps at the given index. + */ + java.lang.String getDebugOps(int index); + /** + *
    +   * Name(s) of the debugging op(s).
    +   * One or more than one probes on a tensor.
    +   * e.g., {"DebugIdentity", "DebugNanCount"}
    +   * 
    + * + * repeated string debug_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the debugOps at the given index. + */ + com.google.protobuf.ByteString + getDebugOpsBytes(int index); + + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @return A list containing the debugUrls. + */ + java.util.List + getDebugUrlsList(); + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @return The count of debugUrls. + */ + int getDebugUrlsCount(); + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the element to return. + * @return The debugUrls at the given index. + */ + java.lang.String getDebugUrls(int index); + /** + *
    +   * URL(s) for debug targets(s).
    +   *
    +   * Supported URL formats are:
    +   * - file:///foo/tfdbg_dump: Writes out Event content to file
    +   * /foo/tfdbg_dump.  Assumes all directories can be created if they don't
    +   * already exist.
    +   * - grpc://localhost:11011: Sends an RPC request to an EventListener
    +   * service running at localhost:11011 with the event.
    +   * - memcbk:///event_key: Routes tensors to clients using the
    +   * callback registered with the DebugCallbackRegistry for event_key.
    +   *
    +   * Each debug op listed in debug_ops will publish its output tensor (debug
    +   * signal) to all URLs in debug_urls.
    +   *
    +   * N.B. Session::Run() supports concurrent invocations of the same inputs
    +   * (feed keys), outputs and target nodes. If such concurrent invocations
    +   * are to be debugged, the callers of Session::Run() must use distinct
    +   * debug_urls to make sure that the streamed or dumped events do not overlap
    +   * among the invocations.
    +   * TODO(cais): More visible documentation of this in g3docs.
    +   * 
    + * + * repeated string debug_urls = 4; + * @param index The index of the value to return. + * @return The bytes of the debugUrls at the given index. + */ + com.google.protobuf.ByteString + getDebugUrlsBytes(int index); + + /** + *
    +   * Do not error out if debug op creation fails (e.g., due to dtype
    +   * incompatibility). Instead, just log the failure.
    +   * 
    + * + * bool tolerate_debug_op_creation_failures = 5; + * @return The tolerateDebugOpCreationFailures. + */ + boolean getTolerateDebugOpCreationFailures(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDevice.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDevice.java new file mode 100644 index 00000000000..d8d0b77e13c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDevice.java @@ -0,0 +1,631 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A device on which ops and/or tensors are instrumented by the debugger.
    + * 
    + * + * Protobuf type {@code tensorflow.DebuggedDevice} + */ +public final class DebuggedDevice extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebuggedDevice) + DebuggedDeviceOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebuggedDevice.class.getName()); + } + // Use DebuggedDevice.newBuilder() to construct. + private DebuggedDevice(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebuggedDevice() { + deviceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedDevice.class, org.tensorflow.proto.DebuggedDevice.Builder.class); + } + + public static final int DEVICE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceName_ = ""; + /** + *
    +   * Name of the device.
    +   * 
    + * + * string device_name = 1; + * @return The deviceName. + */ + @java.lang.Override + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + 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(); + deviceName_ = s; + return s; + } + } + /** + *
    +   * Name of the device.
    +   * 
    + * + * string device_name = 1; + * @return The bytes for deviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_ID_FIELD_NUMBER = 2; + private int deviceId_ = 0; + /** + *
    +   * A debugger-generated ID for the device. Guaranteed to be unique within
    +   * the scope of the debugged TensorFlow program, including single-host and
    +   * multi-host settings.
    +   * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    +   * 
    + * + * int32 device_id = 2; + * @return The deviceId. + */ + @java.lang.Override + public int getDeviceId() { + return deviceId_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceName_); + } + if (deviceId_ != 0) { + output.writeInt32(2, deviceId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceName_); + } + if (deviceId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, deviceId_); + } + size += getUnknownFields().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.DebuggedDevice)) { + return super.equals(obj); + } + org.tensorflow.proto.DebuggedDevice other = (org.tensorflow.proto.DebuggedDevice) obj; + + if (!getDeviceName() + .equals(other.getDeviceName())) return false; + if (getDeviceId() + != other.getDeviceId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDeviceName().hashCode(); + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebuggedDevice parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedDevice 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.DebuggedDevice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedDevice 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.DebuggedDevice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedDevice parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedDevice parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedDevice parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebuggedDevice parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebuggedDevice parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedDevice parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedDevice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebuggedDevice 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A device on which ops and/or tensors are instrumented by the debugger.
    +   * 
    + * + * Protobuf type {@code tensorflow.DebuggedDevice} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedDevice) + org.tensorflow.proto.DebuggedDeviceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedDevice.class, org.tensorflow.proto.DebuggedDevice.Builder.class); + } + + // Construct using org.tensorflow.proto.DebuggedDevice.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deviceName_ = ""; + deviceId_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedDevice_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedDevice getDefaultInstanceForType() { + return org.tensorflow.proto.DebuggedDevice.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedDevice build() { + org.tensorflow.proto.DebuggedDevice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedDevice buildPartial() { + org.tensorflow.proto.DebuggedDevice result = new org.tensorflow.proto.DebuggedDevice(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebuggedDevice result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deviceName_ = deviceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deviceId_ = deviceId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebuggedDevice) { + return mergeFrom((org.tensorflow.proto.DebuggedDevice)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebuggedDevice other) { + if (other == org.tensorflow.proto.DebuggedDevice.getDefaultInstance()) return this; + if (!other.getDeviceName().isEmpty()) { + deviceName_ = other.deviceName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getDeviceId() != 0) { + setDeviceId(other.getDeviceId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + deviceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + deviceId_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object deviceName_ = ""; + /** + *
    +     * Name of the device.
    +     * 
    + * + * string device_name = 1; + * @return The deviceName. + */ + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the device.
    +     * 
    + * + * string device_name = 1; + * @return The bytes for deviceName. + */ + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the device.
    +     * 
    + * + * string device_name = 1; + * @param value The deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the device.
    +     * 
    + * + * string device_name = 1; + * @return This builder for chaining. + */ + public Builder clearDeviceName() { + deviceName_ = getDefaultInstance().getDeviceName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the device.
    +     * 
    + * + * string device_name = 1; + * @param value The bytes for deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int deviceId_ ; + /** + *
    +     * A debugger-generated ID for the device. Guaranteed to be unique within
    +     * the scope of the debugged TensorFlow program, including single-host and
    +     * multi-host settings.
    +     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    +     * 
    + * + * int32 device_id = 2; + * @return The deviceId. + */ + @java.lang.Override + public int getDeviceId() { + return deviceId_; + } + /** + *
    +     * A debugger-generated ID for the device. Guaranteed to be unique within
    +     * the scope of the debugged TensorFlow program, including single-host and
    +     * multi-host settings.
    +     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    +     * 
    + * + * int32 device_id = 2; + * @param value The deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceId(int value) { + + deviceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * A debugger-generated ID for the device. Guaranteed to be unique within
    +     * the scope of the debugged TensorFlow program, including single-host and
    +     * multi-host settings.
    +     * TODO(cais): Test the uniqueness guarantee in multi-host settings.
    +     * 
    + * + * int32 device_id = 2; + * @return This builder for chaining. + */ + public Builder clearDeviceId() { + bitField0_ = (bitField0_ & ~0x00000002); + deviceId_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebuggedDevice) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebuggedDevice) + private static final org.tensorflow.proto.DebuggedDevice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebuggedDevice(); + } + + public static org.tensorflow.proto.DebuggedDevice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebuggedDevice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebuggedDevice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDeviceOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDeviceOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDeviceOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDeviceOrBuilder.java index 3915849b3ae..4544692e491 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedDeviceOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedDeviceOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface DebuggedDeviceOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebuggedDevice) @@ -13,6 +15,7 @@ public interface DebuggedDeviceOrBuilder extends *
    * * string device_name = 1; + * @return The deviceName. */ java.lang.String getDeviceName(); /** @@ -21,6 +24,7 @@ public interface DebuggedDeviceOrBuilder extends * * * string device_name = 1; + * @return The bytes for deviceName. */ com.google.protobuf.ByteString getDeviceNameBytes(); @@ -34,6 +38,7 @@ public interface DebuggedDeviceOrBuilder extends * * * int32 device_id = 2; + * @return The deviceId. */ int getDeviceId(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraph.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraph.java new file mode 100644 index 00000000000..d56c83a856d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraph.java @@ -0,0 +1,1296 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A debugger-instrumented graph.
    + * 
    + * + * Protobuf type {@code tensorflow.DebuggedGraph} + */ +public final class DebuggedGraph extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebuggedGraph) + DebuggedGraphOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebuggedGraph.class.getName()); + } + // Use DebuggedGraph.newBuilder() to construct. + private DebuggedGraph(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebuggedGraph() { + graphId_ = ""; + graphName_ = ""; + instrumentedOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; + instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; + outerContextId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedGraph.class, org.tensorflow.proto.DebuggedGraph.Builder.class); + } + + public static final int GRAPH_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object graphId_ = ""; + /** + *
    +   * An ID for the graph.
    +   * This can be used up to look up graph names. Generated by the debugger.
    +   * 
    + * + * string graph_id = 1; + * @return The graphId. + */ + @java.lang.Override + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + 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(); + graphId_ = s; + return s; + } + } + /** + *
    +   * An ID for the graph.
    +   * This can be used up to look up graph names. Generated by the debugger.
    +   * 
    + * + * string graph_id = 1; + * @return The bytes for graphId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRAPH_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object graphName_ = ""; + /** + *
    +   * Name of the graph (if available).
    +   * 
    + * + * string graph_name = 2; + * @return The graphName. + */ + @java.lang.Override + public java.lang.String getGraphName() { + java.lang.Object ref = graphName_; + 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(); + graphName_ = s; + return s; + } + } + /** + *
    +   * Name of the graph (if available).
    +   * 
    + * + * string graph_name = 2; + * @return The bytes for graphName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphNameBytes() { + java.lang.Object ref = graphName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTRUMENTED_OPS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList instrumentedOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Names of the instrumented ops. This can be used to look up op name
    +   * based on the numeric-summary tensors (2nd column).
    +   * 
    + * + * repeated string instrumented_ops = 3; + * @return A list containing the instrumentedOps. + */ + public com.google.protobuf.ProtocolStringList + getInstrumentedOpsList() { + return instrumentedOps_; + } + /** + *
    +   * Names of the instrumented ops. This can be used to look up op name
    +   * based on the numeric-summary tensors (2nd column).
    +   * 
    + * + * repeated string instrumented_ops = 3; + * @return The count of instrumentedOps. + */ + public int getInstrumentedOpsCount() { + return instrumentedOps_.size(); + } + /** + *
    +   * Names of the instrumented ops. This can be used to look up op name
    +   * based on the numeric-summary tensors (2nd column).
    +   * 
    + * + * repeated string instrumented_ops = 3; + * @param index The index of the element to return. + * @return The instrumentedOps at the given index. + */ + public java.lang.String getInstrumentedOps(int index) { + return instrumentedOps_.get(index); + } + /** + *
    +   * Names of the instrumented ops. This can be used to look up op name
    +   * based on the numeric-summary tensors (2nd column).
    +   * 
    + * + * repeated string instrumented_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the instrumentedOps at the given index. + */ + public com.google.protobuf.ByteString + getInstrumentedOpsBytes(int index) { + return instrumentedOps_.getByteString(index); + } + + public static final int ORIGINAL_GRAPH_DEF_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * Original (uninstrumented) GraphDef (if available).
    +   * 
    + * + * bytes original_graph_def = 4; + * @return The originalGraphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOriginalGraphDef() { + return originalGraphDef_; + } + + public static final int INSTRUMENTED_GRAPH_DEF_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * An encoded version of a GraphDef.
    +   * This graph may include the debugger-inserted ops.
    +   * 
    + * + * bytes instrumented_graph_def = 5; + * @return The instrumentedGraphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstrumentedGraphDef() { + return instrumentedGraphDef_; + } + + public static final int OUTER_CONTEXT_ID_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object outerContextId_ = ""; + /** + *
    +   * IDs of the immediate enclosing context (graph), if any.
    +   * 
    + * + * string outer_context_id = 6; + * @return The outerContextId. + */ + @java.lang.Override + public java.lang.String getOuterContextId() { + java.lang.Object ref = outerContextId_; + 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(); + outerContextId_ = s; + return s; + } + } + /** + *
    +   * IDs of the immediate enclosing context (graph), if any.
    +   * 
    + * + * string outer_context_id = 6; + * @return The bytes for outerContextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOuterContextIdBytes() { + java.lang.Object ref = outerContextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outerContextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, graphId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, graphName_); + } + for (int i = 0; i < instrumentedOps_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, instrumentedOps_.getRaw(i)); + } + if (!originalGraphDef_.isEmpty()) { + output.writeBytes(4, originalGraphDef_); + } + if (!instrumentedGraphDef_.isEmpty()) { + output.writeBytes(5, instrumentedGraphDef_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(outerContextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, outerContextId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, graphId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, graphName_); + } + { + int dataSize = 0; + for (int i = 0; i < instrumentedOps_.size(); i++) { + dataSize += computeStringSizeNoTag(instrumentedOps_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstrumentedOpsList().size(); + } + if (!originalGraphDef_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, originalGraphDef_); + } + if (!instrumentedGraphDef_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, instrumentedGraphDef_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(outerContextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, outerContextId_); + } + size += getUnknownFields().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.DebuggedGraph)) { + return super.equals(obj); + } + org.tensorflow.proto.DebuggedGraph other = (org.tensorflow.proto.DebuggedGraph) obj; + + if (!getGraphId() + .equals(other.getGraphId())) return false; + if (!getGraphName() + .equals(other.getGraphName())) return false; + if (!getInstrumentedOpsList() + .equals(other.getInstrumentedOpsList())) return false; + if (!getOriginalGraphDef() + .equals(other.getOriginalGraphDef())) return false; + if (!getInstrumentedGraphDef() + .equals(other.getInstrumentedGraphDef())) return false; + if (!getOuterContextId() + .equals(other.getOuterContextId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GRAPH_ID_FIELD_NUMBER; + hash = (53 * hash) + getGraphId().hashCode(); + hash = (37 * hash) + GRAPH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGraphName().hashCode(); + if (getInstrumentedOpsCount() > 0) { + hash = (37 * hash) + INSTRUMENTED_OPS_FIELD_NUMBER; + hash = (53 * hash) + getInstrumentedOpsList().hashCode(); + } + hash = (37 * hash) + ORIGINAL_GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getOriginalGraphDef().hashCode(); + hash = (37 * hash) + INSTRUMENTED_GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getInstrumentedGraphDef().hashCode(); + hash = (37 * hash) + OUTER_CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getOuterContextId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebuggedGraph parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedGraph 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.DebuggedGraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedGraph 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.DebuggedGraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedGraph parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedGraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedGraph parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebuggedGraph parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebuggedGraph parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedGraph parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedGraph parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebuggedGraph 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A debugger-instrumented graph.
    +   * 
    + * + * Protobuf type {@code tensorflow.DebuggedGraph} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedGraph) + org.tensorflow.proto.DebuggedGraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedGraph.class, org.tensorflow.proto.DebuggedGraph.Builder.class); + } + + // Construct using org.tensorflow.proto.DebuggedGraph.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + graphId_ = ""; + graphName_ = ""; + instrumentedOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; + instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; + outerContextId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_DebuggedGraph_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedGraph getDefaultInstanceForType() { + return org.tensorflow.proto.DebuggedGraph.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedGraph build() { + org.tensorflow.proto.DebuggedGraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedGraph buildPartial() { + org.tensorflow.proto.DebuggedGraph result = new org.tensorflow.proto.DebuggedGraph(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebuggedGraph result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.graphId_ = graphId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.graphName_ = graphName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + instrumentedOps_.makeImmutable(); + result.instrumentedOps_ = instrumentedOps_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.originalGraphDef_ = originalGraphDef_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.instrumentedGraphDef_ = instrumentedGraphDef_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.outerContextId_ = outerContextId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebuggedGraph) { + return mergeFrom((org.tensorflow.proto.DebuggedGraph)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebuggedGraph other) { + if (other == org.tensorflow.proto.DebuggedGraph.getDefaultInstance()) return this; + if (!other.getGraphId().isEmpty()) { + graphId_ = other.graphId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getGraphName().isEmpty()) { + graphName_ = other.graphName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.instrumentedOps_.isEmpty()) { + if (instrumentedOps_.isEmpty()) { + instrumentedOps_ = other.instrumentedOps_; + bitField0_ |= 0x00000004; + } else { + ensureInstrumentedOpsIsMutable(); + instrumentedOps_.addAll(other.instrumentedOps_); + } + onChanged(); + } + if (other.getOriginalGraphDef() != com.google.protobuf.ByteString.EMPTY) { + setOriginalGraphDef(other.getOriginalGraphDef()); + } + if (other.getInstrumentedGraphDef() != com.google.protobuf.ByteString.EMPTY) { + setInstrumentedGraphDef(other.getInstrumentedGraphDef()); + } + if (!other.getOuterContextId().isEmpty()) { + outerContextId_ = other.outerContextId_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + graphId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + graphName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureInstrumentedOpsIsMutable(); + instrumentedOps_.add(s); + break; + } // case 26 + case 34: { + originalGraphDef_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + instrumentedGraphDef_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + outerContextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object graphId_ = ""; + /** + *
    +     * An ID for the graph.
    +     * This can be used up to look up graph names. Generated by the debugger.
    +     * 
    + * + * string graph_id = 1; + * @return The graphId. + */ + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * An ID for the graph.
    +     * This can be used up to look up graph names. Generated by the debugger.
    +     * 
    + * + * string graph_id = 1; + * @return The bytes for graphId. + */ + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * An ID for the graph.
    +     * This can be used up to look up graph names. Generated by the debugger.
    +     * 
    + * + * string graph_id = 1; + * @param value The graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * An ID for the graph.
    +     * This can be used up to look up graph names. Generated by the debugger.
    +     * 
    + * + * string graph_id = 1; + * @return This builder for chaining. + */ + public Builder clearGraphId() { + graphId_ = getDefaultInstance().getGraphId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * An ID for the graph.
    +     * This can be used up to look up graph names. Generated by the debugger.
    +     * 
    + * + * string graph_id = 1; + * @param value The bytes for graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object graphName_ = ""; + /** + *
    +     * Name of the graph (if available).
    +     * 
    + * + * string graph_name = 2; + * @return The graphName. + */ + public java.lang.String getGraphName() { + java.lang.Object ref = graphName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the graph (if available).
    +     * 
    + * + * string graph_name = 2; + * @return The bytes for graphName. + */ + public com.google.protobuf.ByteString + getGraphNameBytes() { + java.lang.Object ref = graphName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the graph (if available).
    +     * 
    + * + * string graph_name = 2; + * @param value The graphName to set. + * @return This builder for chaining. + */ + public Builder setGraphName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the graph (if available).
    +     * 
    + * + * string graph_name = 2; + * @return This builder for chaining. + */ + public Builder clearGraphName() { + graphName_ = getDefaultInstance().getGraphName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the graph (if available).
    +     * 
    + * + * string graph_name = 2; + * @param value The bytes for graphName to set. + * @return This builder for chaining. + */ + public Builder setGraphNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList instrumentedOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureInstrumentedOpsIsMutable() { + if (!instrumentedOps_.isModifiable()) { + instrumentedOps_ = new com.google.protobuf.LazyStringArrayList(instrumentedOps_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @return A list containing the instrumentedOps. + */ + public com.google.protobuf.ProtocolStringList + getInstrumentedOpsList() { + instrumentedOps_.makeImmutable(); + return instrumentedOps_; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @return The count of instrumentedOps. + */ + public int getInstrumentedOpsCount() { + return instrumentedOps_.size(); + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param index The index of the element to return. + * @return The instrumentedOps at the given index. + */ + public java.lang.String getInstrumentedOps(int index) { + return instrumentedOps_.get(index); + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the instrumentedOps at the given index. + */ + public com.google.protobuf.ByteString + getInstrumentedOpsBytes(int index) { + return instrumentedOps_.getByteString(index); + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param index The index to set the value at. + * @param value The instrumentedOps to set. + * @return This builder for chaining. + */ + public Builder setInstrumentedOps( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInstrumentedOpsIsMutable(); + instrumentedOps_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param value The instrumentedOps to add. + * @return This builder for chaining. + */ + public Builder addInstrumentedOps( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInstrumentedOpsIsMutable(); + instrumentedOps_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param values The instrumentedOps to add. + * @return This builder for chaining. + */ + public Builder addAllInstrumentedOps( + java.lang.Iterable values) { + ensureInstrumentedOpsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, instrumentedOps_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @return This builder for chaining. + */ + public Builder clearInstrumentedOps() { + instrumentedOps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Names of the instrumented ops. This can be used to look up op name
    +     * based on the numeric-summary tensors (2nd column).
    +     * 
    + * + * repeated string instrumented_ops = 3; + * @param value The bytes of the instrumentedOps to add. + * @return This builder for chaining. + */ + public Builder addInstrumentedOpsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureInstrumentedOpsIsMutable(); + instrumentedOps_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString originalGraphDef_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Original (uninstrumented) GraphDef (if available).
    +     * 
    + * + * bytes original_graph_def = 4; + * @return The originalGraphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOriginalGraphDef() { + return originalGraphDef_; + } + /** + *
    +     * Original (uninstrumented) GraphDef (if available).
    +     * 
    + * + * bytes original_graph_def = 4; + * @param value The originalGraphDef to set. + * @return This builder for chaining. + */ + public Builder setOriginalGraphDef(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + originalGraphDef_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Original (uninstrumented) GraphDef (if available).
    +     * 
    + * + * bytes original_graph_def = 4; + * @return This builder for chaining. + */ + public Builder clearOriginalGraphDef() { + bitField0_ = (bitField0_ & ~0x00000008); + originalGraphDef_ = getDefaultInstance().getOriginalGraphDef(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString instrumentedGraphDef_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * An encoded version of a GraphDef.
    +     * This graph may include the debugger-inserted ops.
    +     * 
    + * + * bytes instrumented_graph_def = 5; + * @return The instrumentedGraphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstrumentedGraphDef() { + return instrumentedGraphDef_; + } + /** + *
    +     * An encoded version of a GraphDef.
    +     * This graph may include the debugger-inserted ops.
    +     * 
    + * + * bytes instrumented_graph_def = 5; + * @param value The instrumentedGraphDef to set. + * @return This builder for chaining. + */ + public Builder setInstrumentedGraphDef(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + instrumentedGraphDef_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * An encoded version of a GraphDef.
    +     * This graph may include the debugger-inserted ops.
    +     * 
    + * + * bytes instrumented_graph_def = 5; + * @return This builder for chaining. + */ + public Builder clearInstrumentedGraphDef() { + bitField0_ = (bitField0_ & ~0x00000010); + instrumentedGraphDef_ = getDefaultInstance().getInstrumentedGraphDef(); + onChanged(); + return this; + } + + private java.lang.Object outerContextId_ = ""; + /** + *
    +     * IDs of the immediate enclosing context (graph), if any.
    +     * 
    + * + * string outer_context_id = 6; + * @return The outerContextId. + */ + public java.lang.String getOuterContextId() { + java.lang.Object ref = outerContextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outerContextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * IDs of the immediate enclosing context (graph), if any.
    +     * 
    + * + * string outer_context_id = 6; + * @return The bytes for outerContextId. + */ + public com.google.protobuf.ByteString + getOuterContextIdBytes() { + java.lang.Object ref = outerContextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outerContextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * IDs of the immediate enclosing context (graph), if any.
    +     * 
    + * + * string outer_context_id = 6; + * @param value The outerContextId to set. + * @return This builder for chaining. + */ + public Builder setOuterContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + outerContextId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * IDs of the immediate enclosing context (graph), if any.
    +     * 
    + * + * string outer_context_id = 6; + * @return This builder for chaining. + */ + public Builder clearOuterContextId() { + outerContextId_ = getDefaultInstance().getOuterContextId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * IDs of the immediate enclosing context (graph), if any.
    +     * 
    + * + * string outer_context_id = 6; + * @param value The bytes for outerContextId to set. + * @return This builder for chaining. + */ + public Builder setOuterContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + outerContextId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebuggedGraph) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebuggedGraph) + private static final org.tensorflow.proto.DebuggedGraph DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebuggedGraph(); + } + + public static org.tensorflow.proto.DebuggedGraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebuggedGraph parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebuggedGraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraphOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraphOrBuilder.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraphOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraphOrBuilder.java index c5f78a334e6..e4115e8f5f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/DebuggedGraphOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedGraphOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface DebuggedGraphOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebuggedGraph) @@ -14,6 +16,7 @@ public interface DebuggedGraphOrBuilder extends * * * string graph_id = 1; + * @return The graphId. */ java.lang.String getGraphId(); /** @@ -23,6 +26,7 @@ public interface DebuggedGraphOrBuilder extends * * * string graph_id = 1; + * @return The bytes for graphId. */ com.google.protobuf.ByteString getGraphIdBytes(); @@ -33,6 +37,7 @@ public interface DebuggedGraphOrBuilder extends * * * string graph_name = 2; + * @return The graphName. */ java.lang.String getGraphName(); /** @@ -41,6 +46,7 @@ public interface DebuggedGraphOrBuilder extends * * * string graph_name = 2; + * @return The bytes for graphName. */ com.google.protobuf.ByteString getGraphNameBytes(); @@ -52,6 +58,7 @@ public interface DebuggedGraphOrBuilder extends * * * repeated string instrumented_ops = 3; + * @return A list containing the instrumentedOps. */ java.util.List getInstrumentedOpsList(); @@ -62,6 +69,7 @@ public interface DebuggedGraphOrBuilder extends * * * repeated string instrumented_ops = 3; + * @return The count of instrumentedOps. */ int getInstrumentedOpsCount(); /** @@ -71,6 +79,8 @@ public interface DebuggedGraphOrBuilder extends * * * repeated string instrumented_ops = 3; + * @param index The index of the element to return. + * @return The instrumentedOps at the given index. */ java.lang.String getInstrumentedOps(int index); /** @@ -80,6 +90,8 @@ public interface DebuggedGraphOrBuilder extends * * * repeated string instrumented_ops = 3; + * @param index The index of the value to return. + * @return The bytes of the instrumentedOps at the given index. */ com.google.protobuf.ByteString getInstrumentedOpsBytes(int index); @@ -90,6 +102,7 @@ public interface DebuggedGraphOrBuilder extends * * * bytes original_graph_def = 4; + * @return The originalGraphDef. */ com.google.protobuf.ByteString getOriginalGraphDef(); @@ -100,6 +113,7 @@ public interface DebuggedGraphOrBuilder extends * * * bytes instrumented_graph_def = 5; + * @return The instrumentedGraphDef. */ com.google.protobuf.ByteString getInstrumentedGraphDef(); @@ -109,6 +123,7 @@ public interface DebuggedGraphOrBuilder extends * * * string outer_context_id = 6; + * @return The outerContextId. */ java.lang.String getOuterContextId(); /** @@ -117,6 +132,7 @@ public interface DebuggedGraphOrBuilder extends * * * string outer_context_id = 6; + * @return The bytes for outerContextId. */ com.google.protobuf.ByteString getOuterContextIdBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFile.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFile.java new file mode 100644 index 00000000000..66704f19966 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFile.java @@ -0,0 +1,1100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.DebuggedSourceFile} + */ +public final class DebuggedSourceFile extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebuggedSourceFile) + DebuggedSourceFileOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebuggedSourceFile.class.getName()); + } + // Use DebuggedSourceFile.newBuilder() to construct. + private DebuggedSourceFile(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebuggedSourceFile() { + host_ = ""; + filePath_ = ""; + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedSourceFile.class, org.tensorflow.proto.DebuggedSourceFile.Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + /** + *
    +   * The host name on which a source code file is located.
    +   * 
    + * + * string host = 1; + * @return The host. + */ + @java.lang.Override + public java.lang.String getHost() { + java.lang.Object ref = host_; + 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(); + host_ = s; + return s; + } + } + /** + *
    +   * The host name on which a source code file is located.
    +   * 
    + * + * string host = 1; + * @return The bytes for host. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_PATH_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object filePath_ = ""; + /** + *
    +   * Path to the source code file.
    +   * 
    + * + * string file_path = 2; + * @return The filePath. + */ + @java.lang.Override + public java.lang.String getFilePath() { + java.lang.Object ref = filePath_; + 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(); + filePath_ = s; + return s; + } + } + /** + *
    +   * Path to the source code file.
    +   * 
    + * + * string file_path = 2; + * @return The bytes for filePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilePathBytes() { + java.lang.Object ref = filePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_MODIFIED_FIELD_NUMBER = 3; + private long lastModified_ = 0L; + /** + *
    +   * The timestamp at which the source code file is last modified.
    +   * 
    + * + * int64 last_modified = 3; + * @return The lastModified. + */ + @java.lang.Override + public long getLastModified() { + return lastModified_; + } + + public static final int BYTES_FIELD_NUMBER = 4; + private long bytes_ = 0L; + /** + *
    +   * Byte size of the file.
    +   * 
    + * + * int64 bytes = 4; + * @return The bytes. + */ + @java.lang.Override + public long getBytes() { + return bytes_; + } + + public static final int LINES_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Line-by-line content of the source code file.
    +   * 
    + * + * repeated string lines = 5; + * @return A list containing the lines. + */ + public com.google.protobuf.ProtocolStringList + getLinesList() { + return lines_; + } + /** + *
    +   * Line-by-line content of the source code file.
    +   * 
    + * + * repeated string lines = 5; + * @return The count of lines. + */ + public int getLinesCount() { + return lines_.size(); + } + /** + *
    +   * Line-by-line content of the source code file.
    +   * 
    + * + * repeated string lines = 5; + * @param index The index of the element to return. + * @return The lines at the given index. + */ + public java.lang.String getLines(int index) { + return lines_.get(index); + } + /** + *
    +   * Line-by-line content of the source code file.
    +   * 
    + * + * repeated string lines = 5; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. + */ + public com.google.protobuf.ByteString + getLinesBytes(int index) { + return lines_.getByteString(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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, filePath_); + } + if (lastModified_ != 0L) { + output.writeInt64(3, lastModified_); + } + if (bytes_ != 0L) { + output.writeInt64(4, bytes_); + } + for (int i = 0; i < lines_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, lines_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, host_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filePath_); + } + if (lastModified_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, lastModified_); + } + if (bytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, bytes_); + } + { + int dataSize = 0; + for (int i = 0; i < lines_.size(); i++) { + dataSize += computeStringSizeNoTag(lines_.getRaw(i)); + } + size += dataSize; + size += 1 * getLinesList().size(); + } + size += getUnknownFields().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.DebuggedSourceFile)) { + return super.equals(obj); + } + org.tensorflow.proto.DebuggedSourceFile other = (org.tensorflow.proto.DebuggedSourceFile) obj; + + if (!getHost() + .equals(other.getHost())) return false; + if (!getFilePath() + .equals(other.getFilePath())) return false; + if (getLastModified() + != other.getLastModified()) return false; + if (getBytes() + != other.getBytes()) return false; + if (!getLinesList() + .equals(other.getLinesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFilePath().hashCode(); + hash = (37 * hash) + LAST_MODIFIED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLastModified()); + hash = (37 * hash) + BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBytes()); + if (getLinesCount() > 0) { + hash = (37 * hash) + LINES_FIELD_NUMBER; + hash = (53 * hash) + getLinesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebuggedSourceFile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFile 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.DebuggedSourceFile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFile 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.DebuggedSourceFile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedSourceFile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedSourceFile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebuggedSourceFile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebuggedSourceFile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedSourceFile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedSourceFile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebuggedSourceFile 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DebuggedSourceFile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedSourceFile) + org.tensorflow.proto.DebuggedSourceFileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedSourceFile.class, org.tensorflow.proto.DebuggedSourceFile.Builder.class); + } + + // Construct using org.tensorflow.proto.DebuggedSourceFile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + filePath_ = ""; + lastModified_ = 0L; + bytes_ = 0L; + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFile_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFile getDefaultInstanceForType() { + return org.tensorflow.proto.DebuggedSourceFile.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFile build() { + org.tensorflow.proto.DebuggedSourceFile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFile buildPartial() { + org.tensorflow.proto.DebuggedSourceFile result = new org.tensorflow.proto.DebuggedSourceFile(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DebuggedSourceFile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filePath_ = filePath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lastModified_ = lastModified_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bytes_ = bytes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + lines_.makeImmutable(); + result.lines_ = lines_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebuggedSourceFile) { + return mergeFrom((org.tensorflow.proto.DebuggedSourceFile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebuggedSourceFile other) { + if (other == org.tensorflow.proto.DebuggedSourceFile.getDefaultInstance()) return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilePath().isEmpty()) { + filePath_ = other.filePath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getLastModified() != 0L) { + setLastModified(other.getLastModified()); + } + if (other.getBytes() != 0L) { + setBytes(other.getBytes()); + } + if (!other.lines_.isEmpty()) { + if (lines_.isEmpty()) { + lines_ = other.lines_; + bitField0_ |= 0x00000010; + } else { + ensureLinesIsMutable(); + lines_.addAll(other.lines_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + filePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + lastModified_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + bytes_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + ensureLinesIsMutable(); + lines_.add(s); + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object host_ = ""; + /** + *
    +     * The host name on which a source code file is located.
    +     * 
    + * + * string host = 1; + * @return The host. + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The host name on which a source code file is located.
    +     * 
    + * + * string host = 1; + * @return The bytes for host. + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The host name on which a source code file is located.
    +     * 
    + * + * string host = 1; + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The host name on which a source code file is located.
    +     * 
    + * + * string host = 1; + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The host name on which a source code file is located.
    +     * 
    + * + * string host = 1; + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filePath_ = ""; + /** + *
    +     * Path to the source code file.
    +     * 
    + * + * string file_path = 2; + * @return The filePath. + */ + public java.lang.String getFilePath() { + java.lang.Object ref = filePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Path to the source code file.
    +     * 
    + * + * string file_path = 2; + * @return The bytes for filePath. + */ + public com.google.protobuf.ByteString + getFilePathBytes() { + java.lang.Object ref = filePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Path to the source code file.
    +     * 
    + * + * string file_path = 2; + * @param value The filePath to set. + * @return This builder for chaining. + */ + public Builder setFilePath( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + filePath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Path to the source code file.
    +     * 
    + * + * string file_path = 2; + * @return This builder for chaining. + */ + public Builder clearFilePath() { + filePath_ = getDefaultInstance().getFilePath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Path to the source code file.
    +     * 
    + * + * string file_path = 2; + * @param value The bytes for filePath to set. + * @return This builder for chaining. + */ + public Builder setFilePathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + filePath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long lastModified_ ; + /** + *
    +     * The timestamp at which the source code file is last modified.
    +     * 
    + * + * int64 last_modified = 3; + * @return The lastModified. + */ + @java.lang.Override + public long getLastModified() { + return lastModified_; + } + /** + *
    +     * The timestamp at which the source code file is last modified.
    +     * 
    + * + * int64 last_modified = 3; + * @param value The lastModified to set. + * @return This builder for chaining. + */ + public Builder setLastModified(long value) { + + lastModified_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The timestamp at which the source code file is last modified.
    +     * 
    + * + * int64 last_modified = 3; + * @return This builder for chaining. + */ + public Builder clearLastModified() { + bitField0_ = (bitField0_ & ~0x00000004); + lastModified_ = 0L; + onChanged(); + return this; + } + + private long bytes_ ; + /** + *
    +     * Byte size of the file.
    +     * 
    + * + * int64 bytes = 4; + * @return The bytes. + */ + @java.lang.Override + public long getBytes() { + return bytes_; + } + /** + *
    +     * Byte size of the file.
    +     * 
    + * + * int64 bytes = 4; + * @param value The bytes to set. + * @return This builder for chaining. + */ + public Builder setBytes(long value) { + + bytes_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Byte size of the file.
    +     * 
    + * + * int64 bytes = 4; + * @return This builder for chaining. + */ + public Builder clearBytes() { + bitField0_ = (bitField0_ & ~0x00000008); + bytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureLinesIsMutable() { + if (!lines_.isModifiable()) { + lines_ = new com.google.protobuf.LazyStringArrayList(lines_); + } + bitField0_ |= 0x00000010; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @return A list containing the lines. + */ + public com.google.protobuf.ProtocolStringList + getLinesList() { + lines_.makeImmutable(); + return lines_; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @return The count of lines. + */ + public int getLinesCount() { + return lines_.size(); + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param index The index of the element to return. + * @return The lines at the given index. + */ + public java.lang.String getLines(int index) { + return lines_.get(index); + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. + */ + public com.google.protobuf.ByteString + getLinesBytes(int index) { + return lines_.getByteString(index); + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param index The index to set the value at. + * @param value The lines to set. + * @return This builder for chaining. + */ + public Builder setLines( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLinesIsMutable(); + lines_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param value The lines to add. + * @return This builder for chaining. + */ + public Builder addLines( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLinesIsMutable(); + lines_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param values The lines to add. + * @return This builder for chaining. + */ + public Builder addAllLines( + java.lang.Iterable values) { + ensureLinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lines_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @return This builder for chaining. + */ + public Builder clearLines() { + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the source code file.
    +     * 
    + * + * repeated string lines = 5; + * @param value The bytes of the lines to add. + * @return This builder for chaining. + */ + public Builder addLinesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureLinesIsMutable(); + lines_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebuggedSourceFile) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebuggedSourceFile) + private static final org.tensorflow.proto.DebuggedSourceFile DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebuggedSourceFile(); + } + + public static org.tensorflow.proto.DebuggedSourceFile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebuggedSourceFile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebuggedSourceFile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFileOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFileOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFileOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFileOrBuilder.java index 1a855dc8a07..7ef7f4bae46 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFileOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFileOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface DebuggedSourceFileOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebuggedSourceFile) @@ -13,6 +15,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * string host = 1; + * @return The host. */ java.lang.String getHost(); /** @@ -21,6 +24,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * string host = 1; + * @return The bytes for host. */ com.google.protobuf.ByteString getHostBytes(); @@ -31,6 +35,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * string file_path = 2; + * @return The filePath. */ java.lang.String getFilePath(); /** @@ -39,6 +44,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * string file_path = 2; + * @return The bytes for filePath. */ com.google.protobuf.ByteString getFilePathBytes(); @@ -49,6 +55,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * int64 last_modified = 3; + * @return The lastModified. */ long getLastModified(); @@ -58,6 +65,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * int64 bytes = 4; + * @return The bytes. */ long getBytes(); @@ -67,6 +75,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * repeated string lines = 5; + * @return A list containing the lines. */ java.util.List getLinesList(); @@ -76,6 +85,7 @@ public interface DebuggedSourceFileOrBuilder extends * * * repeated string lines = 5; + * @return The count of lines. */ int getLinesCount(); /** @@ -84,6 +94,8 @@ public interface DebuggedSourceFileOrBuilder extends * * * repeated string lines = 5; + * @param index The index of the element to return. + * @return The lines at the given index. */ java.lang.String getLines(int index); /** @@ -92,6 +104,8 @@ public interface DebuggedSourceFileOrBuilder extends * * * repeated string lines = 5; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. */ com.google.protobuf.ByteString getLinesBytes(int index); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFiles.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFiles.java new file mode 100644 index 00000000000..878ca2718a3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFiles.java @@ -0,0 +1,811 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.DebuggedSourceFiles} + */ +public final class DebuggedSourceFiles extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DebuggedSourceFiles) + DebuggedSourceFilesOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DebuggedSourceFiles.class.getName()); + } + // Use DebuggedSourceFiles.newBuilder() to construct. + private DebuggedSourceFiles(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DebuggedSourceFiles() { + sourceFiles_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedSourceFiles.class, org.tensorflow.proto.DebuggedSourceFiles.Builder.class); + } + + public static final int SOURCE_FILES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List sourceFiles_; + /** + *
    +   * A collection of source code files.
    +   * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + @java.lang.Override + public java.util.List getSourceFilesList() { + return sourceFiles_; + } + /** + *
    +   * A collection of source code files.
    +   * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + @java.lang.Override + public java.util.List + getSourceFilesOrBuilderList() { + return sourceFiles_; + } + /** + *
    +   * A collection of source code files.
    +   * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + @java.lang.Override + public int getSourceFilesCount() { + return sourceFiles_.size(); + } + /** + *
    +   * A collection of source code files.
    +   * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFile getSourceFiles(int index) { + return sourceFiles_.get(index); + } + /** + *
    +   * A collection of source code files.
    +   * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder( + int index) { + return sourceFiles_.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 { + for (int i = 0; i < sourceFiles_.size(); i++) { + output.writeMessage(1, sourceFiles_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sourceFiles_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, sourceFiles_.get(i)); + } + size += getUnknownFields().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.DebuggedSourceFiles)) { + return super.equals(obj); + } + org.tensorflow.proto.DebuggedSourceFiles other = (org.tensorflow.proto.DebuggedSourceFiles) obj; + + if (!getSourceFilesList() + .equals(other.getSourceFilesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSourceFilesCount() > 0) { + hash = (37 * hash) + SOURCE_FILES_FIELD_NUMBER; + hash = (53 * hash) + getSourceFilesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFiles 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.DebuggedSourceFiles parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFiles 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.DebuggedSourceFiles parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DebuggedSourceFiles parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DebuggedSourceFiles parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DebuggedSourceFiles parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DebuggedSourceFiles 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DebuggedSourceFiles} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DebuggedSourceFiles) + org.tensorflow.proto.DebuggedSourceFilesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DebuggedSourceFiles.class, org.tensorflow.proto.DebuggedSourceFiles.Builder.class); + } + + // Construct using org.tensorflow.proto.DebuggedSourceFiles.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sourceFilesBuilder_ == null) { + sourceFiles_ = java.util.Collections.emptyList(); + } else { + sourceFiles_ = null; + sourceFilesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugProtos.internal_static_tensorflow_DebuggedSourceFiles_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFiles getDefaultInstanceForType() { + return org.tensorflow.proto.DebuggedSourceFiles.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFiles build() { + org.tensorflow.proto.DebuggedSourceFiles result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DebuggedSourceFiles buildPartial() { + org.tensorflow.proto.DebuggedSourceFiles result = new org.tensorflow.proto.DebuggedSourceFiles(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.DebuggedSourceFiles result) { + if (sourceFilesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sourceFiles_ = java.util.Collections.unmodifiableList(sourceFiles_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sourceFiles_ = sourceFiles_; + } else { + result.sourceFiles_ = sourceFilesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.DebuggedSourceFiles result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DebuggedSourceFiles) { + return mergeFrom((org.tensorflow.proto.DebuggedSourceFiles)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DebuggedSourceFiles other) { + if (other == org.tensorflow.proto.DebuggedSourceFiles.getDefaultInstance()) return this; + if (sourceFilesBuilder_ == null) { + if (!other.sourceFiles_.isEmpty()) { + if (sourceFiles_.isEmpty()) { + sourceFiles_ = other.sourceFiles_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSourceFilesIsMutable(); + sourceFiles_.addAll(other.sourceFiles_); + } + onChanged(); + } + } else { + if (!other.sourceFiles_.isEmpty()) { + if (sourceFilesBuilder_.isEmpty()) { + sourceFilesBuilder_.dispose(); + sourceFilesBuilder_ = null; + sourceFiles_ = other.sourceFiles_; + bitField0_ = (bitField0_ & ~0x00000001); + sourceFilesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSourceFilesFieldBuilder() : null; + } else { + sourceFilesBuilder_.addAllMessages(other.sourceFiles_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.DebuggedSourceFile m = + input.readMessage( + org.tensorflow.proto.DebuggedSourceFile.parser(), + extensionRegistry); + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + sourceFiles_.add(m); + } else { + sourceFilesBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List sourceFiles_ = + java.util.Collections.emptyList(); + private void ensureSourceFilesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sourceFiles_ = new java.util.ArrayList(sourceFiles_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebuggedSourceFile, org.tensorflow.proto.DebuggedSourceFile.Builder, org.tensorflow.proto.DebuggedSourceFileOrBuilder> sourceFilesBuilder_; + + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public java.util.List getSourceFilesList() { + if (sourceFilesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sourceFiles_); + } else { + return sourceFilesBuilder_.getMessageList(); + } + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public int getSourceFilesCount() { + if (sourceFilesBuilder_ == null) { + return sourceFiles_.size(); + } else { + return sourceFilesBuilder_.getCount(); + } + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public org.tensorflow.proto.DebuggedSourceFile getSourceFiles(int index) { + if (sourceFilesBuilder_ == null) { + return sourceFiles_.get(index); + } else { + return sourceFilesBuilder_.getMessage(index); + } + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder setSourceFiles( + int index, org.tensorflow.proto.DebuggedSourceFile value) { + if (sourceFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceFilesIsMutable(); + sourceFiles_.set(index, value); + onChanged(); + } else { + sourceFilesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder setSourceFiles( + int index, org.tensorflow.proto.DebuggedSourceFile.Builder builderForValue) { + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + sourceFiles_.set(index, builderForValue.build()); + onChanged(); + } else { + sourceFilesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder addSourceFiles(org.tensorflow.proto.DebuggedSourceFile value) { + if (sourceFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceFilesIsMutable(); + sourceFiles_.add(value); + onChanged(); + } else { + sourceFilesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder addSourceFiles( + int index, org.tensorflow.proto.DebuggedSourceFile value) { + if (sourceFilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceFilesIsMutable(); + sourceFiles_.add(index, value); + onChanged(); + } else { + sourceFilesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder addSourceFiles( + org.tensorflow.proto.DebuggedSourceFile.Builder builderForValue) { + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + sourceFiles_.add(builderForValue.build()); + onChanged(); + } else { + sourceFilesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder addSourceFiles( + int index, org.tensorflow.proto.DebuggedSourceFile.Builder builderForValue) { + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + sourceFiles_.add(index, builderForValue.build()); + onChanged(); + } else { + sourceFilesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder addAllSourceFiles( + java.lang.Iterable values) { + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sourceFiles_); + onChanged(); + } else { + sourceFilesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder clearSourceFiles() { + if (sourceFilesBuilder_ == null) { + sourceFiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sourceFilesBuilder_.clear(); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public Builder removeSourceFiles(int index) { + if (sourceFilesBuilder_ == null) { + ensureSourceFilesIsMutable(); + sourceFiles_.remove(index); + onChanged(); + } else { + sourceFilesBuilder_.remove(index); + } + return this; + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public org.tensorflow.proto.DebuggedSourceFile.Builder getSourceFilesBuilder( + int index) { + return getSourceFilesFieldBuilder().getBuilder(index); + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public org.tensorflow.proto.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder( + int index) { + if (sourceFilesBuilder_ == null) { + return sourceFiles_.get(index); } else { + return sourceFilesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public java.util.List + getSourceFilesOrBuilderList() { + if (sourceFilesBuilder_ != null) { + return sourceFilesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sourceFiles_); + } + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public org.tensorflow.proto.DebuggedSourceFile.Builder addSourceFilesBuilder() { + return getSourceFilesFieldBuilder().addBuilder( + org.tensorflow.proto.DebuggedSourceFile.getDefaultInstance()); + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public org.tensorflow.proto.DebuggedSourceFile.Builder addSourceFilesBuilder( + int index) { + return getSourceFilesFieldBuilder().addBuilder( + index, org.tensorflow.proto.DebuggedSourceFile.getDefaultInstance()); + } + /** + *
    +     * A collection of source code files.
    +     * 
    + * + * repeated .tensorflow.DebuggedSourceFile source_files = 1; + */ + public java.util.List + getSourceFilesBuilderList() { + return getSourceFilesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebuggedSourceFile, org.tensorflow.proto.DebuggedSourceFile.Builder, org.tensorflow.proto.DebuggedSourceFileOrBuilder> + getSourceFilesFieldBuilder() { + if (sourceFilesBuilder_ == null) { + sourceFilesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DebuggedSourceFile, org.tensorflow.proto.DebuggedSourceFile.Builder, org.tensorflow.proto.DebuggedSourceFileOrBuilder>( + sourceFiles_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sourceFiles_ = null; + } + return sourceFilesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DebuggedSourceFiles) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DebuggedSourceFiles) + private static final org.tensorflow.proto.DebuggedSourceFiles DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DebuggedSourceFiles(); + } + + public static org.tensorflow.proto.DebuggedSourceFiles getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebuggedSourceFiles parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DebuggedSourceFiles getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFilesOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFilesOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFilesOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFilesOrBuilder.java index 3afc8e4f78f..143f2983d0f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DebuggedSourceFilesOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DebuggedSourceFilesOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface DebuggedSourceFilesOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DebuggedSourceFiles) @@ -14,7 +16,7 @@ public interface DebuggedSourceFilesOrBuilder extends * * repeated .tensorflow.DebuggedSourceFile source_files = 1; */ - java.util.List + java.util.List getSourceFilesList(); /** *
    @@ -23,7 +25,7 @@ public interface DebuggedSourceFilesOrBuilder extends
        *
        * repeated .tensorflow.DebuggedSourceFile source_files = 1;
        */
    -  org.tensorflow.proto.framework.DebuggedSourceFile getSourceFiles(int index);
    +  org.tensorflow.proto.DebuggedSourceFile getSourceFiles(int index);
       /**
        * 
        * A collection of source code files.
    @@ -39,7 +41,7 @@ public interface DebuggedSourceFilesOrBuilder extends
        *
        * repeated .tensorflow.DebuggedSourceFile source_files = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getSourceFilesOrBuilderList();
       /**
        * 
    @@ -48,6 +50,6 @@ public interface DebuggedSourceFilesOrBuilder extends
        *
        * repeated .tensorflow.DebuggedSourceFile source_files = 1;
        */
    -  org.tensorflow.proto.framework.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder(
    +  org.tensorflow.proto.DebuggedSourceFileOrBuilder getSourceFilesOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributes.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributes.java
    new file mode 100644
    index 00000000000..47dfd9b5b6f
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributes.java
    @@ -0,0 +1,1371 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/device_attributes.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.DeviceAttributes}
    + */
    +public final class DeviceAttributes extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.DeviceAttributes)
    +    DeviceAttributesOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      DeviceAttributes.class.getName());
    +  }
    +  // Use DeviceAttributes.newBuilder() to construct.
    +  private DeviceAttributes(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private DeviceAttributes() {
    +    name_ = "";
    +    deviceType_ = "";
    +    physicalDeviceDesc_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.DeviceAttributes.class, org.tensorflow.proto.DeviceAttributes.Builder.class);
    +  }
    +
    +  private int bitField0_;
    +  public static final int NAME_FIELD_NUMBER = 1;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +  /**
    +   * 
    +   * Fully specified name of the device within a cluster.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Fully specified name of the device within a cluster.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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_TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceType_ = ""; + /** + *
    +   * String representation of device_type.
    +   * 
    + * + * string device_type = 2; + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + *
    +   * String representation of device_type.
    +   * 
    + * + * string device_type = 2; + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MEMORY_LIMIT_FIELD_NUMBER = 4; + private long memoryLimit_ = 0L; + /** + *
    +   * Memory capacity of device in bytes.
    +   * 
    + * + * int64 memory_limit = 4; + * @return The memoryLimit. + */ + @java.lang.Override + public long getMemoryLimit() { + return memoryLimit_; + } + + public static final int LOCALITY_FIELD_NUMBER = 5; + private org.tensorflow.proto.DeviceLocality locality_; + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return Whether the locality field is set. + */ + @java.lang.Override + public boolean hasLocality() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return The locality. + */ + @java.lang.Override + public org.tensorflow.proto.DeviceLocality getLocality() { + return locality_ == null ? org.tensorflow.proto.DeviceLocality.getDefaultInstance() : locality_; + } + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + @java.lang.Override + public org.tensorflow.proto.DeviceLocalityOrBuilder getLocalityOrBuilder() { + return locality_ == null ? org.tensorflow.proto.DeviceLocality.getDefaultInstance() : locality_; + } + + public static final int INCARNATION_FIELD_NUMBER = 6; + private long incarnation_ = 0L; + /** + *
    +   * A device is assigned a global unique number each time it is
    +   * initialized. "incarnation" should never be 0.
    +   * 
    + * + * fixed64 incarnation = 6; + * @return The incarnation. + */ + @java.lang.Override + public long getIncarnation() { + return incarnation_; + } + + public static final int PHYSICAL_DEVICE_DESC_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object physicalDeviceDesc_ = ""; + /** + *
    +   * String representation of the physical device that this device maps to.
    +   * 
    + * + * string physical_device_desc = 7; + * @return The physicalDeviceDesc. + */ + @java.lang.Override + public java.lang.String getPhysicalDeviceDesc() { + java.lang.Object ref = physicalDeviceDesc_; + 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(); + physicalDeviceDesc_ = s; + return s; + } + } + /** + *
    +   * String representation of the physical device that this device maps to.
    +   * 
    + * + * string physical_device_desc = 7; + * @return The bytes for physicalDeviceDesc. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPhysicalDeviceDescBytes() { + java.lang.Object ref = physicalDeviceDesc_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + physicalDeviceDesc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int XLA_GLOBAL_ID_FIELD_NUMBER = 8; + private long xlaGlobalId_ = 0L; + /** + *
    +   * A physical device ID for use in XLA DeviceAssignments, unique across
    +   * clients in a multi-client setup. Set to -1 if unavailable, non-negative
    +   * otherwise.
    +   * 
    + * + * int64 xla_global_id = 8; + * @return The xlaGlobalId. + */ + @java.lang.Override + public long getXlaGlobalId() { + return xlaGlobalId_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, deviceType_); + } + if (memoryLimit_ != 0L) { + output.writeInt64(4, memoryLimit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getLocality()); + } + if (incarnation_ != 0L) { + output.writeFixed64(6, incarnation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(physicalDeviceDesc_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, physicalDeviceDesc_); + } + if (xlaGlobalId_ != 0L) { + output.writeInt64(8, xlaGlobalId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, deviceType_); + } + if (memoryLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, memoryLimit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getLocality()); + } + if (incarnation_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(6, incarnation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(physicalDeviceDesc_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, physicalDeviceDesc_); + } + if (xlaGlobalId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, xlaGlobalId_); + } + size += getUnknownFields().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.DeviceAttributes)) { + return super.equals(obj); + } + org.tensorflow.proto.DeviceAttributes other = (org.tensorflow.proto.DeviceAttributes) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDeviceType() + .equals(other.getDeviceType())) return false; + if (getMemoryLimit() + != other.getMemoryLimit()) return false; + if (hasLocality() != other.hasLocality()) return false; + if (hasLocality()) { + if (!getLocality() + .equals(other.getLocality())) return false; + } + if (getIncarnation() + != other.getIncarnation()) return false; + if (!getPhysicalDeviceDesc() + .equals(other.getPhysicalDeviceDesc())) return false; + if (getXlaGlobalId() + != other.getXlaGlobalId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + hash = (37 * hash) + MEMORY_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemoryLimit()); + if (hasLocality()) { + hash = (37 * hash) + LOCALITY_FIELD_NUMBER; + hash = (53 * hash) + getLocality().hashCode(); + } + hash = (37 * hash) + INCARNATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIncarnation()); + hash = (37 * hash) + PHYSICAL_DEVICE_DESC_FIELD_NUMBER; + hash = (53 * hash) + getPhysicalDeviceDesc().hashCode(); + hash = (37 * hash) + XLA_GLOBAL_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getXlaGlobalId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DeviceAttributes parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceAttributes 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.DeviceAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceAttributes 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.DeviceAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceAttributes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DeviceAttributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceAttributes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DeviceAttributes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DeviceAttributes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DeviceAttributes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceAttributes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DeviceAttributes 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DeviceAttributes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DeviceAttributes) + org.tensorflow.proto.DeviceAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DeviceAttributes.class, org.tensorflow.proto.DeviceAttributes.Builder.class); + } + + // Construct using org.tensorflow.proto.DeviceAttributes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getLocalityFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + deviceType_ = ""; + memoryLimit_ = 0L; + locality_ = null; + if (localityBuilder_ != null) { + localityBuilder_.dispose(); + localityBuilder_ = null; + } + incarnation_ = 0L; + physicalDeviceDesc_ = ""; + xlaGlobalId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceAttributes_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceAttributes getDefaultInstanceForType() { + return org.tensorflow.proto.DeviceAttributes.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DeviceAttributes build() { + org.tensorflow.proto.DeviceAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceAttributes buildPartial() { + org.tensorflow.proto.DeviceAttributes result = new org.tensorflow.proto.DeviceAttributes(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DeviceAttributes result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deviceType_ = deviceType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.memoryLimit_ = memoryLimit_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.locality_ = localityBuilder_ == null + ? locality_ + : localityBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.incarnation_ = incarnation_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.physicalDeviceDesc_ = physicalDeviceDesc_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.xlaGlobalId_ = xlaGlobalId_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DeviceAttributes) { + return mergeFrom((org.tensorflow.proto.DeviceAttributes)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DeviceAttributes other) { + if (other == org.tensorflow.proto.DeviceAttributes.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getMemoryLimit() != 0L) { + setMemoryLimit(other.getMemoryLimit()); + } + if (other.hasLocality()) { + mergeLocality(other.getLocality()); + } + if (other.getIncarnation() != 0L) { + setIncarnation(other.getIncarnation()); + } + if (!other.getPhysicalDeviceDesc().isEmpty()) { + physicalDeviceDesc_ = other.physicalDeviceDesc_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getXlaGlobalId() != 0L) { + setXlaGlobalId(other.getXlaGlobalId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + deviceType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: { + memoryLimit_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: { + input.readMessage( + getLocalityFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 49: { + incarnation_ = input.readFixed64(); + bitField0_ |= 0x00000010; + break; + } // case 49 + case 58: { + physicalDeviceDesc_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 64: { + xlaGlobalId_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 64 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Fully specified name of the device within a cluster.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Fully specified name of the device within a cluster.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Fully specified name of the device within a cluster.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Fully specified name of the device within a cluster.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Fully specified name of the device within a cluster.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deviceType_ = ""; + /** + *
    +     * String representation of device_type.
    +     * 
    + * + * string device_type = 2; + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * String representation of device_type.
    +     * 
    + * + * string device_type = 2; + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * String representation of device_type.
    +     * 
    + * + * string device_type = 2; + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * String representation of device_type.
    +     * 
    + * + * string device_type = 2; + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + deviceType_ = getDefaultInstance().getDeviceType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * String representation of device_type.
    +     * 
    + * + * string device_type = 2; + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long memoryLimit_ ; + /** + *
    +     * Memory capacity of device in bytes.
    +     * 
    + * + * int64 memory_limit = 4; + * @return The memoryLimit. + */ + @java.lang.Override + public long getMemoryLimit() { + return memoryLimit_; + } + /** + *
    +     * Memory capacity of device in bytes.
    +     * 
    + * + * int64 memory_limit = 4; + * @param value The memoryLimit to set. + * @return This builder for chaining. + */ + public Builder setMemoryLimit(long value) { + + memoryLimit_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Memory capacity of device in bytes.
    +     * 
    + * + * int64 memory_limit = 4; + * @return This builder for chaining. + */ + public Builder clearMemoryLimit() { + bitField0_ = (bitField0_ & ~0x00000004); + memoryLimit_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.DeviceLocality locality_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DeviceLocality, org.tensorflow.proto.DeviceLocality.Builder, org.tensorflow.proto.DeviceLocalityOrBuilder> localityBuilder_; + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return Whether the locality field is set. + */ + public boolean hasLocality() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return The locality. + */ + public org.tensorflow.proto.DeviceLocality getLocality() { + if (localityBuilder_ == null) { + return locality_ == null ? org.tensorflow.proto.DeviceLocality.getDefaultInstance() : locality_; + } else { + return localityBuilder_.getMessage(); + } + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public Builder setLocality(org.tensorflow.proto.DeviceLocality value) { + if (localityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + locality_ = value; + } else { + localityBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public Builder setLocality( + org.tensorflow.proto.DeviceLocality.Builder builderForValue) { + if (localityBuilder_ == null) { + locality_ = builderForValue.build(); + } else { + localityBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public Builder mergeLocality(org.tensorflow.proto.DeviceLocality value) { + if (localityBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + locality_ != null && + locality_ != org.tensorflow.proto.DeviceLocality.getDefaultInstance()) { + getLocalityBuilder().mergeFrom(value); + } else { + locality_ = value; + } + } else { + localityBuilder_.mergeFrom(value); + } + if (locality_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public Builder clearLocality() { + bitField0_ = (bitField0_ & ~0x00000008); + locality_ = null; + if (localityBuilder_ != null) { + localityBuilder_.dispose(); + localityBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public org.tensorflow.proto.DeviceLocality.Builder getLocalityBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getLocalityFieldBuilder().getBuilder(); + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + public org.tensorflow.proto.DeviceLocalityOrBuilder getLocalityOrBuilder() { + if (localityBuilder_ != null) { + return localityBuilder_.getMessageOrBuilder(); + } else { + return locality_ == null ? + org.tensorflow.proto.DeviceLocality.getDefaultInstance() : locality_; + } + } + /** + *
    +     * Platform-specific data about device that may be useful
    +     * for supporting efficient data transfers.
    +     * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DeviceLocality, org.tensorflow.proto.DeviceLocality.Builder, org.tensorflow.proto.DeviceLocalityOrBuilder> + getLocalityFieldBuilder() { + if (localityBuilder_ == null) { + localityBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DeviceLocality, org.tensorflow.proto.DeviceLocality.Builder, org.tensorflow.proto.DeviceLocalityOrBuilder>( + getLocality(), + getParentForChildren(), + isClean()); + locality_ = null; + } + return localityBuilder_; + } + + private long incarnation_ ; + /** + *
    +     * A device is assigned a global unique number each time it is
    +     * initialized. "incarnation" should never be 0.
    +     * 
    + * + * fixed64 incarnation = 6; + * @return The incarnation. + */ + @java.lang.Override + public long getIncarnation() { + return incarnation_; + } + /** + *
    +     * A device is assigned a global unique number each time it is
    +     * initialized. "incarnation" should never be 0.
    +     * 
    + * + * fixed64 incarnation = 6; + * @param value The incarnation to set. + * @return This builder for chaining. + */ + public Builder setIncarnation(long value) { + + incarnation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * A device is assigned a global unique number each time it is
    +     * initialized. "incarnation" should never be 0.
    +     * 
    + * + * fixed64 incarnation = 6; + * @return This builder for chaining. + */ + public Builder clearIncarnation() { + bitField0_ = (bitField0_ & ~0x00000010); + incarnation_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object physicalDeviceDesc_ = ""; + /** + *
    +     * String representation of the physical device that this device maps to.
    +     * 
    + * + * string physical_device_desc = 7; + * @return The physicalDeviceDesc. + */ + public java.lang.String getPhysicalDeviceDesc() { + java.lang.Object ref = physicalDeviceDesc_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + physicalDeviceDesc_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * String representation of the physical device that this device maps to.
    +     * 
    + * + * string physical_device_desc = 7; + * @return The bytes for physicalDeviceDesc. + */ + public com.google.protobuf.ByteString + getPhysicalDeviceDescBytes() { + java.lang.Object ref = physicalDeviceDesc_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + physicalDeviceDesc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * String representation of the physical device that this device maps to.
    +     * 
    + * + * string physical_device_desc = 7; + * @param value The physicalDeviceDesc to set. + * @return This builder for chaining. + */ + public Builder setPhysicalDeviceDesc( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + physicalDeviceDesc_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * String representation of the physical device that this device maps to.
    +     * 
    + * + * string physical_device_desc = 7; + * @return This builder for chaining. + */ + public Builder clearPhysicalDeviceDesc() { + physicalDeviceDesc_ = getDefaultInstance().getPhysicalDeviceDesc(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * String representation of the physical device that this device maps to.
    +     * 
    + * + * string physical_device_desc = 7; + * @param value The bytes for physicalDeviceDesc to set. + * @return This builder for chaining. + */ + public Builder setPhysicalDeviceDescBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + physicalDeviceDesc_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private long xlaGlobalId_ ; + /** + *
    +     * A physical device ID for use in XLA DeviceAssignments, unique across
    +     * clients in a multi-client setup. Set to -1 if unavailable, non-negative
    +     * otherwise.
    +     * 
    + * + * int64 xla_global_id = 8; + * @return The xlaGlobalId. + */ + @java.lang.Override + public long getXlaGlobalId() { + return xlaGlobalId_; + } + /** + *
    +     * A physical device ID for use in XLA DeviceAssignments, unique across
    +     * clients in a multi-client setup. Set to -1 if unavailable, non-negative
    +     * otherwise.
    +     * 
    + * + * int64 xla_global_id = 8; + * @param value The xlaGlobalId to set. + * @return This builder for chaining. + */ + public Builder setXlaGlobalId(long value) { + + xlaGlobalId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * A physical device ID for use in XLA DeviceAssignments, unique across
    +     * clients in a multi-client setup. Set to -1 if unavailable, non-negative
    +     * otherwise.
    +     * 
    + * + * int64 xla_global_id = 8; + * @return This builder for chaining. + */ + public Builder clearXlaGlobalId() { + bitField0_ = (bitField0_ & ~0x00000040); + xlaGlobalId_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DeviceAttributes) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DeviceAttributes) + private static final org.tensorflow.proto.DeviceAttributes DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DeviceAttributes(); + } + + public static org.tensorflow.proto.DeviceAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DeviceAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesOrBuilder.java new file mode 100644 index 00000000000..4215a2a77bf --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesOrBuilder.java @@ -0,0 +1,134 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface DeviceAttributesOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.DeviceAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Fully specified name of the device within a cluster.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * Fully specified name of the device within a cluster.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +   * String representation of device_type.
    +   * 
    + * + * string device_type = 2; + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + *
    +   * String representation of device_type.
    +   * 
    + * + * string device_type = 2; + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString + getDeviceTypeBytes(); + + /** + *
    +   * Memory capacity of device in bytes.
    +   * 
    + * + * int64 memory_limit = 4; + * @return The memoryLimit. + */ + long getMemoryLimit(); + + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return Whether the locality field is set. + */ + boolean hasLocality(); + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + * @return The locality. + */ + org.tensorflow.proto.DeviceLocality getLocality(); + /** + *
    +   * Platform-specific data about device that may be useful
    +   * for supporting efficient data transfers.
    +   * 
    + * + * .tensorflow.DeviceLocality locality = 5; + */ + org.tensorflow.proto.DeviceLocalityOrBuilder getLocalityOrBuilder(); + + /** + *
    +   * A device is assigned a global unique number each time it is
    +   * initialized. "incarnation" should never be 0.
    +   * 
    + * + * fixed64 incarnation = 6; + * @return The incarnation. + */ + long getIncarnation(); + + /** + *
    +   * String representation of the physical device that this device maps to.
    +   * 
    + * + * string physical_device_desc = 7; + * @return The physicalDeviceDesc. + */ + java.lang.String getPhysicalDeviceDesc(); + /** + *
    +   * String representation of the physical device that this device maps to.
    +   * 
    + * + * string physical_device_desc = 7; + * @return The bytes for physicalDeviceDesc. + */ + com.google.protobuf.ByteString + getPhysicalDeviceDescBytes(); + + /** + *
    +   * A physical device ID for use in XLA DeviceAssignments, unique across
    +   * clients in a multi-client setup. Set to -1 if unavailable, non-negative
    +   * otherwise.
    +   * 
    + * + * int64 xla_global_id = 8; + * @return The xlaGlobalId. + */ + long getXlaGlobalId(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesProtos.java new file mode 100644 index 00000000000..fcfebe652af --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceAttributesProtos.java @@ -0,0 +1,106 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class DeviceAttributesProtos { + private DeviceAttributesProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceAttributesProtos.class.getName()); + } + 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_InterconnectLink_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_InterconnectLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_LocalLinks_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_LocalLinks_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DeviceLocality_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DeviceLocality_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DeviceAttributes_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DeviceAttributes_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n1tensorflow/core/framework/device_attri" + + "butes.proto\022\ntensorflow\"E\n\020InterconnectL" + + "ink\022\021\n\tdevice_id\030\001 \001(\005\022\014\n\004type\030\002 \001(\t\022\020\n\010" + + "strength\030\003 \001(\005\"8\n\nLocalLinks\022*\n\004link\030\001 \003" + + "(\0132\034.tensorflow.InterconnectLink\"Z\n\016Devi" + + "ceLocality\022\016\n\006bus_id\030\001 \001(\005\022\021\n\tnuma_node\030" + + "\002 \001(\005\022%\n\005links\030\003 \001(\0132\026.tensorflow.LocalL" + + "inks\"\303\001\n\020DeviceAttributes\022\014\n\004name\030\001 \001(\t\022" + + "\023\n\013device_type\030\002 \001(\t\022\024\n\014memory_limit\030\004 \001" + + "(\003\022,\n\010locality\030\005 \001(\0132\032.tensorflow.Device" + + "Locality\022\023\n\013incarnation\030\006 \001(\006\022\034\n\024physica" + + "l_device_desc\030\007 \001(\t\022\025\n\rxla_global_id\030\010 \001" + + "(\003B\215\001\n\024org.tensorflow.protoB\026DeviceAttri" + + "butesProtosP\001ZXgithub.com/tensorflow/ten" + + "sorflow/tensorflow/go/core/framework/dev" + + "ice_attributes_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_InterconnectLink_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_InterconnectLink_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_InterconnectLink_descriptor, + new java.lang.String[] { "DeviceId", "Type", "Strength", }); + internal_static_tensorflow_LocalLinks_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_LocalLinks_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_LocalLinks_descriptor, + new java.lang.String[] { "Link", }); + internal_static_tensorflow_DeviceLocality_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_DeviceLocality_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DeviceLocality_descriptor, + new java.lang.String[] { "BusId", "NumaNode", "Links", }); + internal_static_tensorflow_DeviceAttributes_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_DeviceAttributes_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DeviceAttributes_descriptor, + new java.lang.String[] { "Name", "DeviceType", "MemoryLimit", "Locality", "Incarnation", "PhysicalDeviceDesc", "XlaGlobalId", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceFiltersProtos.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceFiltersProtos.java index bd1b5639915..c8e12f949a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/DeviceFiltersProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceFiltersProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.distruntime; +package org.tensorflow.proto; public final class DeviceFiltersProtos { private DeviceFiltersProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceFiltersProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,22 +28,22 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_TaskDeviceFilters_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_JobDeviceFilters_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_JobDeviceFilters_TasksEntry_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_JobDeviceFilters_TasksEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ClusterDeviceFilters_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -51,11 +62,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\223\001\n org.tensorflow." + - "proto.distruntimeB\023DeviceFiltersProtosP\001" + - "ZUgithub.com/tensorflow/tensorflow/tenso" + - "rflow/go/core/protobuf/for_core_protos_g" + - "o_proto\370\001\001b\006proto3" + "low.JobDeviceFiltersB\207\001\n\024org.tensorflow." + + "protoB\023DeviceFiltersProtosP\001ZUgithub.com" + + "/tensorflow/tensorflow/tensorflow/go/cor" + + "e/protobuf/for_core_protos_go_proto\370\001\001b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -64,27 +75,28 @@ public static void registerAllExtensions( internal_static_tensorflow_TaskDeviceFilters_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_TaskDeviceFilters_descriptor, new java.lang.String[] { "DeviceFilters", }); internal_static_tensorflow_JobDeviceFilters_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_JobDeviceFilters_descriptor, new java.lang.String[] { "Name", "Tasks", }); internal_static_tensorflow_JobDeviceFilters_TasksEntry_descriptor = internal_static_tensorflow_JobDeviceFilters_descriptor.getNestedTypes().get(0); internal_static_tensorflow_JobDeviceFilters_TasksEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_JobDeviceFilters_TasksEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_tensorflow_ClusterDeviceFilters_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_ClusterDeviceFilters_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ClusterDeviceFilters_descriptor, new java.lang.String[] { "Jobs", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocality.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocality.java new file mode 100644 index 00000000000..518cc8fd33b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocality.java @@ -0,0 +1,774 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.DeviceLocality} + */ +public final class DeviceLocality extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DeviceLocality) + DeviceLocalityOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceLocality.class.getName()); + } + // Use DeviceLocality.newBuilder() to construct. + private DeviceLocality(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DeviceLocality() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DeviceLocality.class, org.tensorflow.proto.DeviceLocality.Builder.class); + } + + private int bitField0_; + public static final int BUS_ID_FIELD_NUMBER = 1; + private int busId_ = 0; + /** + *
    +   * Optional bus locality of device.  Default value of 0 means
    +   * no specific locality.  Specific localities are indexed from 1.
    +   * 
    + * + * int32 bus_id = 1; + * @return The busId. + */ + @java.lang.Override + public int getBusId() { + return busId_; + } + + public static final int NUMA_NODE_FIELD_NUMBER = 2; + private int numaNode_ = 0; + /** + *
    +   * Optional NUMA locality of device.
    +   * 
    + * + * int32 numa_node = 2; + * @return The numaNode. + */ + @java.lang.Override + public int getNumaNode() { + return numaNode_; + } + + public static final int LINKS_FIELD_NUMBER = 3; + private org.tensorflow.proto.LocalLinks links_; + /** + *
    +   * Optional local interconnect links to other devices.
    +   * 
    + * + * .tensorflow.LocalLinks links = 3; + * @return Whether the links field is set. + */ + @java.lang.Override + public boolean hasLinks() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Optional local interconnect links to other devices.
    +   * 
    + * + * .tensorflow.LocalLinks links = 3; + * @return The links. + */ + @java.lang.Override + public org.tensorflow.proto.LocalLinks getLinks() { + return links_ == null ? org.tensorflow.proto.LocalLinks.getDefaultInstance() : links_; + } + /** + *
    +   * Optional local interconnect links to other devices.
    +   * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + @java.lang.Override + public org.tensorflow.proto.LocalLinksOrBuilder getLinksOrBuilder() { + return links_ == null ? org.tensorflow.proto.LocalLinks.getDefaultInstance() : links_; + } + + 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 (busId_ != 0) { + output.writeInt32(1, busId_); + } + if (numaNode_ != 0) { + output.writeInt32(2, numaNode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getLinks()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (busId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, busId_); + } + if (numaNode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, numaNode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getLinks()); + } + size += getUnknownFields().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.DeviceLocality)) { + return super.equals(obj); + } + org.tensorflow.proto.DeviceLocality other = (org.tensorflow.proto.DeviceLocality) obj; + + if (getBusId() + != other.getBusId()) return false; + if (getNumaNode() + != other.getNumaNode()) return false; + if (hasLinks() != other.hasLinks()) return false; + if (hasLinks()) { + if (!getLinks() + .equals(other.getLinks())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BUS_ID_FIELD_NUMBER; + hash = (53 * hash) + getBusId(); + hash = (37 * hash) + NUMA_NODE_FIELD_NUMBER; + hash = (53 * hash) + getNumaNode(); + if (hasLinks()) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinks().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DeviceLocality parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceLocality 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.DeviceLocality parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceLocality 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.DeviceLocality parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceLocality parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DeviceLocality parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceLocality parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DeviceLocality parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DeviceLocality parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DeviceLocality parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceLocality parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DeviceLocality 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DeviceLocality} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DeviceLocality) + org.tensorflow.proto.DeviceLocalityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DeviceLocality.class, org.tensorflow.proto.DeviceLocality.Builder.class); + } + + // Construct using org.tensorflow.proto.DeviceLocality.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + busId_ = 0; + numaNode_ = 0; + links_ = null; + if (linksBuilder_ != null) { + linksBuilder_.dispose(); + linksBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_DeviceLocality_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceLocality getDefaultInstanceForType() { + return org.tensorflow.proto.DeviceLocality.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DeviceLocality build() { + org.tensorflow.proto.DeviceLocality result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceLocality buildPartial() { + org.tensorflow.proto.DeviceLocality result = new org.tensorflow.proto.DeviceLocality(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DeviceLocality result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.busId_ = busId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numaNode_ = numaNode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.links_ = linksBuilder_ == null + ? links_ + : linksBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DeviceLocality) { + return mergeFrom((org.tensorflow.proto.DeviceLocality)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DeviceLocality other) { + if (other == org.tensorflow.proto.DeviceLocality.getDefaultInstance()) return this; + if (other.getBusId() != 0) { + setBusId(other.getBusId()); + } + if (other.getNumaNode() != 0) { + setNumaNode(other.getNumaNode()); + } + if (other.hasLinks()) { + mergeLinks(other.getLinks()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + busId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + numaNode_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getLinksFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int busId_ ; + /** + *
    +     * Optional bus locality of device.  Default value of 0 means
    +     * no specific locality.  Specific localities are indexed from 1.
    +     * 
    + * + * int32 bus_id = 1; + * @return The busId. + */ + @java.lang.Override + public int getBusId() { + return busId_; + } + /** + *
    +     * Optional bus locality of device.  Default value of 0 means
    +     * no specific locality.  Specific localities are indexed from 1.
    +     * 
    + * + * int32 bus_id = 1; + * @param value The busId to set. + * @return This builder for chaining. + */ + public Builder setBusId(int value) { + + busId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Optional bus locality of device.  Default value of 0 means
    +     * no specific locality.  Specific localities are indexed from 1.
    +     * 
    + * + * int32 bus_id = 1; + * @return This builder for chaining. + */ + public Builder clearBusId() { + bitField0_ = (bitField0_ & ~0x00000001); + busId_ = 0; + onChanged(); + return this; + } + + private int numaNode_ ; + /** + *
    +     * Optional NUMA locality of device.
    +     * 
    + * + * int32 numa_node = 2; + * @return The numaNode. + */ + @java.lang.Override + public int getNumaNode() { + return numaNode_; + } + /** + *
    +     * Optional NUMA locality of device.
    +     * 
    + * + * int32 numa_node = 2; + * @param value The numaNode to set. + * @return This builder for chaining. + */ + public Builder setNumaNode(int value) { + + numaNode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Optional NUMA locality of device.
    +     * 
    + * + * int32 numa_node = 2; + * @return This builder for chaining. + */ + public Builder clearNumaNode() { + bitField0_ = (bitField0_ & ~0x00000002); + numaNode_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.LocalLinks links_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LocalLinks, org.tensorflow.proto.LocalLinks.Builder, org.tensorflow.proto.LocalLinksOrBuilder> linksBuilder_; + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + * @return Whether the links field is set. + */ + public boolean hasLinks() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + * @return The links. + */ + public org.tensorflow.proto.LocalLinks getLinks() { + if (linksBuilder_ == null) { + return links_ == null ? org.tensorflow.proto.LocalLinks.getDefaultInstance() : links_; + } else { + return linksBuilder_.getMessage(); + } + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public Builder setLinks(org.tensorflow.proto.LocalLinks value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + links_ = value; + } else { + linksBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public Builder setLinks( + org.tensorflow.proto.LocalLinks.Builder builderForValue) { + if (linksBuilder_ == null) { + links_ = builderForValue.build(); + } else { + linksBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public Builder mergeLinks(org.tensorflow.proto.LocalLinks value) { + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + links_ != null && + links_ != org.tensorflow.proto.LocalLinks.getDefaultInstance()) { + getLinksBuilder().mergeFrom(value); + } else { + links_ = value; + } + } else { + linksBuilder_.mergeFrom(value); + } + if (links_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public Builder clearLinks() { + bitField0_ = (bitField0_ & ~0x00000004); + links_ = null; + if (linksBuilder_ != null) { + linksBuilder_.dispose(); + linksBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public org.tensorflow.proto.LocalLinks.Builder getLinksBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getLinksFieldBuilder().getBuilder(); + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + public org.tensorflow.proto.LocalLinksOrBuilder getLinksOrBuilder() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilder(); + } else { + return links_ == null ? + org.tensorflow.proto.LocalLinks.getDefaultInstance() : links_; + } + } + /** + *
    +     * Optional local interconnect links to other devices.
    +     * 
    + * + * .tensorflow.LocalLinks links = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LocalLinks, org.tensorflow.proto.LocalLinks.Builder, org.tensorflow.proto.LocalLinksOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LocalLinks, org.tensorflow.proto.LocalLinks.Builder, org.tensorflow.proto.LocalLinksOrBuilder>( + getLinks(), + getParentForChildren(), + isClean()); + links_ = null; + } + return linksBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DeviceLocality) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DeviceLocality) + private static final org.tensorflow.proto.DeviceLocality DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DeviceLocality(); + } + + public static org.tensorflow.proto.DeviceLocality getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceLocality parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DeviceLocality getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocalityOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocalityOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocalityOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocalityOrBuilder.java index cfb7b2c5287..b236260b347 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceLocalityOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceLocalityOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface DeviceLocalityOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DeviceLocality) @@ -14,6 +16,7 @@ public interface DeviceLocalityOrBuilder extends *
    * * int32 bus_id = 1; + * @return The busId. */ int getBusId(); @@ -23,6 +26,7 @@ public interface DeviceLocalityOrBuilder extends *
    * * int32 numa_node = 2; + * @return The numaNode. */ int getNumaNode(); @@ -32,6 +36,7 @@ public interface DeviceLocalityOrBuilder extends *
    * * .tensorflow.LocalLinks links = 3; + * @return Whether the links field is set. */ boolean hasLinks(); /** @@ -40,8 +45,9 @@ public interface DeviceLocalityOrBuilder extends * * * .tensorflow.LocalLinks links = 3; + * @return The links. */ - org.tensorflow.proto.framework.LocalLinks getLinks(); + org.tensorflow.proto.LocalLinks getLinks(); /** *
        * Optional local interconnect links to other devices.
    @@ -49,5 +55,5 @@ public interface DeviceLocalityOrBuilder extends
        *
        * .tensorflow.LocalLinks links = 3;
        */
    -  org.tensorflow.proto.framework.LocalLinksOrBuilder getLinksOrBuilder();
    +  org.tensorflow.proto.LocalLinksOrBuilder getLinksOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DevicePropertiesProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DevicePropertiesProtos.java
    new file mode 100644
    index 00000000000..c02de359e02
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DevicePropertiesProtos.java
    @@ -0,0 +1,2964 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/device_properties.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class DevicePropertiesProtos {
    +  private DevicePropertiesProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      DevicePropertiesProtos.class.getName());
    +  }
    +  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 DevicePropertiesOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.DeviceProperties)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * 
    +     * Device type (CPU, GPU, ...)
    +     * 
    + * + * string type = 1; + * @return The type. + */ + java.lang.String getType(); + /** + *
    +     * Device type (CPU, GPU, ...)
    +     * 
    + * + * string type = 1; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
    +     * Vendor (Intel, nvidia, ...)
    +     * 
    + * + * string vendor = 2; + * @return The vendor. + */ + java.lang.String getVendor(); + /** + *
    +     * Vendor (Intel, nvidia, ...)
    +     * 
    + * + * string vendor = 2; + * @return The bytes for vendor. + */ + com.google.protobuf.ByteString + getVendorBytes(); + + /** + *
    +     * Model (Haswell, K40, ...)
    +     * 
    + * + * string model = 3; + * @return The model. + */ + java.lang.String getModel(); + /** + *
    +     * Model (Haswell, K40, ...)
    +     * 
    + * + * string model = 3; + * @return The bytes for model. + */ + com.google.protobuf.ByteString + getModelBytes(); + + /** + *
    +     * Core Frequency in Mhz
    +     * 
    + * + * int64 frequency = 4; + * @return The frequency. + */ + long getFrequency(); + + /** + *
    +     * Number of cores
    +     * 
    + * + * int64 num_cores = 5; + * @return The numCores. + */ + long getNumCores(); + + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + int getEnvironmentCount(); + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + boolean containsEnvironment( + java.lang.String key); + /** + * Use {@link #getEnvironmentMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getEnvironment(); + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + java.util.Map + getEnvironmentMap(); + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + /* nullable */ +java.lang.String getEnvironmentOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + java.lang.String getEnvironmentOrThrow( + java.lang.String key); + + /** + *
    +     * Number of registers per core.
    +     * 
    + * + * int64 num_registers = 7; + * @return The numRegisters. + */ + long getNumRegisters(); + + /** + *
    +     * L1 cache size in bytes
    +     * 
    + * + * int64 l1_cache_size = 8; + * @return The l1CacheSize. + */ + long getL1CacheSize(); + + /** + *
    +     * L2 cache size in bytes
    +     * 
    + * + * int64 l2_cache_size = 9; + * @return The l2CacheSize. + */ + long getL2CacheSize(); + + /** + *
    +     * L3 cache size in bytes
    +     * 
    + * + * int64 l3_cache_size = 10; + * @return The l3CacheSize. + */ + long getL3CacheSize(); + + /** + *
    +     * Shared memory size per multiprocessor in bytes. This field is
    +     * applicable to GPUs only.
    +     * 
    + * + * int64 shared_memory_size_per_multiprocessor = 11; + * @return The sharedMemorySizePerMultiprocessor. + */ + long getSharedMemorySizePerMultiprocessor(); + + /** + *
    +     * Memory size in bytes
    +     * 
    + * + * int64 memory_size = 12; + * @return The memorySize. + */ + long getMemorySize(); + + /** + *
    +     * Memory bandwidth in KB/s
    +     * 
    + * + * int64 bandwidth = 13; + * @return The bandwidth. + */ + long getBandwidth(); + } + /** + * Protobuf type {@code tensorflow.DeviceProperties} + */ + public static final class DeviceProperties extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DeviceProperties) + DevicePropertiesOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceProperties.class.getName()); + } + // Use DeviceProperties.newBuilder() to construct. + private DeviceProperties(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DeviceProperties() { + type_ = ""; + vendor_ = ""; + model_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetEnvironment(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.class, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + *
    +     * Device type (CPU, GPU, ...)
    +     * 
    + * + * string type = 1; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + *
    +     * Device type (CPU, GPU, ...)
    +     * 
    + * + * string type = 1; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VENDOR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object vendor_ = ""; + /** + *
    +     * Vendor (Intel, nvidia, ...)
    +     * 
    + * + * string vendor = 2; + * @return The vendor. + */ + @java.lang.Override + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + 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(); + vendor_ = s; + return s; + } + } + /** + *
    +     * Vendor (Intel, nvidia, ...)
    +     * 
    + * + * string vendor = 2; + * @return The bytes for vendor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + *
    +     * Model (Haswell, K40, ...)
    +     * 
    + * + * string model = 3; + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
    +     * Model (Haswell, K40, ...)
    +     * 
    + * + * string model = 3; + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FREQUENCY_FIELD_NUMBER = 4; + private long frequency_ = 0L; + /** + *
    +     * Core Frequency in Mhz
    +     * 
    + * + * int64 frequency = 4; + * @return The frequency. + */ + @java.lang.Override + public long getFrequency() { + return frequency_; + } + + public static final int NUM_CORES_FIELD_NUMBER = 5; + private long numCores_ = 0L; + /** + *
    +     * Number of cores
    +     * 
    + * + * int64 num_cores = 5; + * @return The numCores. + */ + @java.lang.Override + public long getNumCores() { + return numCores_; + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 6; + private static final class EnvironmentDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> environment_; + private com.google.protobuf.MapField + internalGetEnvironment() { + if (environment_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentDefaultEntryHolder.defaultEntry); + } + return environment_; + } + public int getEnvironmentCount() { + return internalGetEnvironment().getMap().size(); + } + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public boolean containsEnvironment( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetEnvironment().getMap().containsKey(key); + } + /** + * Use {@link #getEnvironmentMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironment() { + return getEnvironmentMap(); + } + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentMap() { + return internalGetEnvironment().getMap(); + } + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getEnvironmentOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvironment().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +     * cudnn 5.1)
    +     * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvironment().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NUM_REGISTERS_FIELD_NUMBER = 7; + private long numRegisters_ = 0L; + /** + *
    +     * Number of registers per core.
    +     * 
    + * + * int64 num_registers = 7; + * @return The numRegisters. + */ + @java.lang.Override + public long getNumRegisters() { + return numRegisters_; + } + + public static final int L1_CACHE_SIZE_FIELD_NUMBER = 8; + private long l1CacheSize_ = 0L; + /** + *
    +     * L1 cache size in bytes
    +     * 
    + * + * int64 l1_cache_size = 8; + * @return The l1CacheSize. + */ + @java.lang.Override + public long getL1CacheSize() { + return l1CacheSize_; + } + + public static final int L2_CACHE_SIZE_FIELD_NUMBER = 9; + private long l2CacheSize_ = 0L; + /** + *
    +     * L2 cache size in bytes
    +     * 
    + * + * int64 l2_cache_size = 9; + * @return The l2CacheSize. + */ + @java.lang.Override + public long getL2CacheSize() { + return l2CacheSize_; + } + + public static final int L3_CACHE_SIZE_FIELD_NUMBER = 10; + private long l3CacheSize_ = 0L; + /** + *
    +     * L3 cache size in bytes
    +     * 
    + * + * int64 l3_cache_size = 10; + * @return The l3CacheSize. + */ + @java.lang.Override + public long getL3CacheSize() { + return l3CacheSize_; + } + + public static final int SHARED_MEMORY_SIZE_PER_MULTIPROCESSOR_FIELD_NUMBER = 11; + private long sharedMemorySizePerMultiprocessor_ = 0L; + /** + *
    +     * Shared memory size per multiprocessor in bytes. This field is
    +     * applicable to GPUs only.
    +     * 
    + * + * int64 shared_memory_size_per_multiprocessor = 11; + * @return The sharedMemorySizePerMultiprocessor. + */ + @java.lang.Override + public long getSharedMemorySizePerMultiprocessor() { + return sharedMemorySizePerMultiprocessor_; + } + + public static final int MEMORY_SIZE_FIELD_NUMBER = 12; + private long memorySize_ = 0L; + /** + *
    +     * Memory size in bytes
    +     * 
    + * + * int64 memory_size = 12; + * @return The memorySize. + */ + @java.lang.Override + public long getMemorySize() { + return memorySize_; + } + + public static final int BANDWIDTH_FIELD_NUMBER = 13; + private long bandwidth_ = 0L; + /** + *
    +     * Memory bandwidth in KB/s
    +     * 
    + * + * int64 bandwidth = 13; + * @return The bandwidth. + */ + @java.lang.Override + public long getBandwidth() { + return bandwidth_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, vendor_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, model_); + } + if (frequency_ != 0L) { + output.writeInt64(4, frequency_); + } + if (numCores_ != 0L) { + output.writeInt64(5, numCores_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetEnvironment(), + EnvironmentDefaultEntryHolder.defaultEntry, + 6); + if (numRegisters_ != 0L) { + output.writeInt64(7, numRegisters_); + } + if (l1CacheSize_ != 0L) { + output.writeInt64(8, l1CacheSize_); + } + if (l2CacheSize_ != 0L) { + output.writeInt64(9, l2CacheSize_); + } + if (l3CacheSize_ != 0L) { + output.writeInt64(10, l3CacheSize_); + } + if (sharedMemorySizePerMultiprocessor_ != 0L) { + output.writeInt64(11, sharedMemorySizePerMultiprocessor_); + } + if (memorySize_ != 0L) { + output.writeInt64(12, memorySize_); + } + if (bandwidth_ != 0L) { + output.writeInt64(13, bandwidth_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, vendor_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, model_); + } + if (frequency_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, frequency_); + } + if (numCores_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, numCores_); + } + for (java.util.Map.Entry entry + : internalGetEnvironment().getMap().entrySet()) { + com.google.protobuf.MapEntry + environment__ = EnvironmentDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, environment__); + } + if (numRegisters_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, numRegisters_); + } + if (l1CacheSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, l1CacheSize_); + } + if (l2CacheSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, l2CacheSize_); + } + if (l3CacheSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, l3CacheSize_); + } + if (sharedMemorySizePerMultiprocessor_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, sharedMemorySizePerMultiprocessor_); + } + if (memorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, memorySize_); + } + if (bandwidth_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(13, bandwidth_); + } + size += getUnknownFields().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.DevicePropertiesProtos.DeviceProperties)) { + return super.equals(obj); + } + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties other = (org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties) obj; + + if (!getType() + .equals(other.getType())) return false; + if (!getVendor() + .equals(other.getVendor())) return false; + if (!getModel() + .equals(other.getModel())) return false; + if (getFrequency() + != other.getFrequency()) return false; + if (getNumCores() + != other.getNumCores()) return false; + if (!internalGetEnvironment().equals( + other.internalGetEnvironment())) return false; + if (getNumRegisters() + != other.getNumRegisters()) return false; + if (getL1CacheSize() + != other.getL1CacheSize()) return false; + if (getL2CacheSize() + != other.getL2CacheSize()) return false; + if (getL3CacheSize() + != other.getL3CacheSize()) return false; + if (getSharedMemorySizePerMultiprocessor() + != other.getSharedMemorySizePerMultiprocessor()) return false; + if (getMemorySize() + != other.getMemorySize()) return false; + if (getBandwidth() + != other.getBandwidth()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + VENDOR_FIELD_NUMBER; + hash = (53 * hash) + getVendor().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFrequency()); + hash = (37 * hash) + NUM_CORES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumCores()); + if (!internalGetEnvironment().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironment().hashCode(); + } + hash = (37 * hash) + NUM_REGISTERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumRegisters()); + hash = (37 * hash) + L1_CACHE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getL1CacheSize()); + hash = (37 * hash) + L2_CACHE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getL2CacheSize()); + hash = (37 * hash) + L3_CACHE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getL3CacheSize()); + hash = (37 * hash) + SHARED_MEMORY_SIZE_PER_MULTIPROCESSOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSharedMemorySizePerMultiprocessor()); + hash = (37 * hash) + MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemorySize()); + hash = (37 * hash) + BANDWIDTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBandwidth()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties 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.DevicePropertiesProtos.DeviceProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties 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.DevicePropertiesProtos.DeviceProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DevicePropertiesProtos.DeviceProperties 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DeviceProperties} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DeviceProperties) + org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetEnvironment(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableEnvironment(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.class, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder.class); + } + + // Construct using org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = ""; + vendor_ = ""; + model_ = ""; + frequency_ = 0L; + numCores_ = 0L; + internalGetMutableEnvironment().clear(); + numRegisters_ = 0L; + l1CacheSize_ = 0L; + l2CacheSize_ = 0L; + l3CacheSize_ = 0L; + sharedMemorySizePerMultiprocessor_ = 0L; + memorySize_ = 0L; + bandwidth_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_DeviceProperties_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getDefaultInstanceForType() { + return org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties build() { + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties buildPartial() { + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties result = new org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.vendor_ = vendor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.model_ = model_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.frequency_ = frequency_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.numCores_ = numCores_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.environment_ = internalGetEnvironment(); + result.environment_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.numRegisters_ = numRegisters_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.l1CacheSize_ = l1CacheSize_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.l2CacheSize_ = l2CacheSize_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.l3CacheSize_ = l3CacheSize_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sharedMemorySizePerMultiprocessor_ = sharedMemorySizePerMultiprocessor_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.memorySize_ = memorySize_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.bandwidth_ = bandwidth_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties) { + return mergeFrom((org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties other) { + if (other == org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getVendor().isEmpty()) { + vendor_ = other.vendor_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getFrequency() != 0L) { + setFrequency(other.getFrequency()); + } + if (other.getNumCores() != 0L) { + setNumCores(other.getNumCores()); + } + internalGetMutableEnvironment().mergeFrom( + other.internalGetEnvironment()); + bitField0_ |= 0x00000020; + if (other.getNumRegisters() != 0L) { + setNumRegisters(other.getNumRegisters()); + } + if (other.getL1CacheSize() != 0L) { + setL1CacheSize(other.getL1CacheSize()); + } + if (other.getL2CacheSize() != 0L) { + setL2CacheSize(other.getL2CacheSize()); + } + if (other.getL3CacheSize() != 0L) { + setL3CacheSize(other.getL3CacheSize()); + } + if (other.getSharedMemorySizePerMultiprocessor() != 0L) { + setSharedMemorySizePerMultiprocessor(other.getSharedMemorySizePerMultiprocessor()); + } + if (other.getMemorySize() != 0L) { + setMemorySize(other.getMemorySize()); + } + if (other.getBandwidth() != 0L) { + setBandwidth(other.getBandwidth()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + vendor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + frequency_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + numCores_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + com.google.protobuf.MapEntry + environment__ = input.readMessage( + EnvironmentDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableEnvironment().getMutableMap().put( + environment__.getKey(), environment__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + numRegisters_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + l1CacheSize_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + l2CacheSize_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + l3CacheSize_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + sharedMemorySizePerMultiprocessor_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + memorySize_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + bandwidth_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 104 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + *
    +       * Device type (CPU, GPU, ...)
    +       * 
    + * + * string type = 1; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Device type (CPU, GPU, ...)
    +       * 
    + * + * string type = 1; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Device type (CPU, GPU, ...)
    +       * 
    + * + * string type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Device type (CPU, GPU, ...)
    +       * 
    + * + * string type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Device type (CPU, GPU, ...)
    +       * 
    + * + * string type = 1; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object vendor_ = ""; + /** + *
    +       * Vendor (Intel, nvidia, ...)
    +       * 
    + * + * string vendor = 2; + * @return The vendor. + */ + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vendor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Vendor (Intel, nvidia, ...)
    +       * 
    + * + * string vendor = 2; + * @return The bytes for vendor. + */ + public com.google.protobuf.ByteString + getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Vendor (Intel, nvidia, ...)
    +       * 
    + * + * string vendor = 2; + * @param value The vendor to set. + * @return This builder for chaining. + */ + public Builder setVendor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + vendor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Vendor (Intel, nvidia, ...)
    +       * 
    + * + * string vendor = 2; + * @return This builder for chaining. + */ + public Builder clearVendor() { + vendor_ = getDefaultInstance().getVendor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Vendor (Intel, nvidia, ...)
    +       * 
    + * + * string vendor = 2; + * @param value The bytes for vendor to set. + * @return This builder for chaining. + */ + public Builder setVendorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + vendor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + *
    +       * Model (Haswell, K40, ...)
    +       * 
    + * + * string model = 3; + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Model (Haswell, K40, ...)
    +       * 
    + * + * string model = 3; + * @return The bytes for model. + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Model (Haswell, K40, ...)
    +       * 
    + * + * string model = 3; + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Model (Haswell, K40, ...)
    +       * 
    + * + * string model = 3; + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Model (Haswell, K40, ...)
    +       * 
    + * + * string model = 3; + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long frequency_ ; + /** + *
    +       * Core Frequency in Mhz
    +       * 
    + * + * int64 frequency = 4; + * @return The frequency. + */ + @java.lang.Override + public long getFrequency() { + return frequency_; + } + /** + *
    +       * Core Frequency in Mhz
    +       * 
    + * + * int64 frequency = 4; + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency(long value) { + + frequency_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Core Frequency in Mhz
    +       * 
    + * + * int64 frequency = 4; + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000008); + frequency_ = 0L; + onChanged(); + return this; + } + + private long numCores_ ; + /** + *
    +       * Number of cores
    +       * 
    + * + * int64 num_cores = 5; + * @return The numCores. + */ + @java.lang.Override + public long getNumCores() { + return numCores_; + } + /** + *
    +       * Number of cores
    +       * 
    + * + * int64 num_cores = 5; + * @param value The numCores to set. + * @return This builder for chaining. + */ + public Builder setNumCores(long value) { + + numCores_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Number of cores
    +       * 
    + * + * int64 num_cores = 5; + * @return This builder for chaining. + */ + public Builder clearNumCores() { + bitField0_ = (bitField0_ & ~0x00000010); + numCores_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> environment_; + private com.google.protobuf.MapField + internalGetEnvironment() { + if (environment_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentDefaultEntryHolder.defaultEntry); + } + return environment_; + } + private com.google.protobuf.MapField + internalGetMutableEnvironment() { + if (environment_ == null) { + environment_ = com.google.protobuf.MapField.newMapField( + EnvironmentDefaultEntryHolder.defaultEntry); + } + if (!environment_.isMutable()) { + environment_ = environment_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return environment_; + } + public int getEnvironmentCount() { + return internalGetEnvironment().getMap().size(); + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public boolean containsEnvironment( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetEnvironment().getMap().containsKey(key); + } + /** + * Use {@link #getEnvironmentMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironment() { + return getEnvironmentMap(); + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentMap() { + return internalGetEnvironment().getMap(); + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getEnvironmentOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvironment().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvironment().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearEnvironment() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableEnvironment().getMutableMap() + .clear(); + return this; + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + public Builder removeEnvironment( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableEnvironment().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableEnvironment() { + bitField0_ |= 0x00000020; + return internalGetMutableEnvironment().getMutableMap(); + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + public Builder putEnvironment( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableEnvironment().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +       * Version of the tools and libraries used with this device (e.g. gcc 4.9,
    +       * cudnn 5.1)
    +       * 
    + * + * map<string, string> environment = 6; + */ + public Builder putAllEnvironment( + java.util.Map values) { + internalGetMutableEnvironment().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private long numRegisters_ ; + /** + *
    +       * Number of registers per core.
    +       * 
    + * + * int64 num_registers = 7; + * @return The numRegisters. + */ + @java.lang.Override + public long getNumRegisters() { + return numRegisters_; + } + /** + *
    +       * Number of registers per core.
    +       * 
    + * + * int64 num_registers = 7; + * @param value The numRegisters to set. + * @return This builder for chaining. + */ + public Builder setNumRegisters(long value) { + + numRegisters_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Number of registers per core.
    +       * 
    + * + * int64 num_registers = 7; + * @return This builder for chaining. + */ + public Builder clearNumRegisters() { + bitField0_ = (bitField0_ & ~0x00000040); + numRegisters_ = 0L; + onChanged(); + return this; + } + + private long l1CacheSize_ ; + /** + *
    +       * L1 cache size in bytes
    +       * 
    + * + * int64 l1_cache_size = 8; + * @return The l1CacheSize. + */ + @java.lang.Override + public long getL1CacheSize() { + return l1CacheSize_; + } + /** + *
    +       * L1 cache size in bytes
    +       * 
    + * + * int64 l1_cache_size = 8; + * @param value The l1CacheSize to set. + * @return This builder for chaining. + */ + public Builder setL1CacheSize(long value) { + + l1CacheSize_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * L1 cache size in bytes
    +       * 
    + * + * int64 l1_cache_size = 8; + * @return This builder for chaining. + */ + public Builder clearL1CacheSize() { + bitField0_ = (bitField0_ & ~0x00000080); + l1CacheSize_ = 0L; + onChanged(); + return this; + } + + private long l2CacheSize_ ; + /** + *
    +       * L2 cache size in bytes
    +       * 
    + * + * int64 l2_cache_size = 9; + * @return The l2CacheSize. + */ + @java.lang.Override + public long getL2CacheSize() { + return l2CacheSize_; + } + /** + *
    +       * L2 cache size in bytes
    +       * 
    + * + * int64 l2_cache_size = 9; + * @param value The l2CacheSize to set. + * @return This builder for chaining. + */ + public Builder setL2CacheSize(long value) { + + l2CacheSize_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * L2 cache size in bytes
    +       * 
    + * + * int64 l2_cache_size = 9; + * @return This builder for chaining. + */ + public Builder clearL2CacheSize() { + bitField0_ = (bitField0_ & ~0x00000100); + l2CacheSize_ = 0L; + onChanged(); + return this; + } + + private long l3CacheSize_ ; + /** + *
    +       * L3 cache size in bytes
    +       * 
    + * + * int64 l3_cache_size = 10; + * @return The l3CacheSize. + */ + @java.lang.Override + public long getL3CacheSize() { + return l3CacheSize_; + } + /** + *
    +       * L3 cache size in bytes
    +       * 
    + * + * int64 l3_cache_size = 10; + * @param value The l3CacheSize to set. + * @return This builder for chaining. + */ + public Builder setL3CacheSize(long value) { + + l3CacheSize_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * L3 cache size in bytes
    +       * 
    + * + * int64 l3_cache_size = 10; + * @return This builder for chaining. + */ + public Builder clearL3CacheSize() { + bitField0_ = (bitField0_ & ~0x00000200); + l3CacheSize_ = 0L; + onChanged(); + return this; + } + + private long sharedMemorySizePerMultiprocessor_ ; + /** + *
    +       * Shared memory size per multiprocessor in bytes. This field is
    +       * applicable to GPUs only.
    +       * 
    + * + * int64 shared_memory_size_per_multiprocessor = 11; + * @return The sharedMemorySizePerMultiprocessor. + */ + @java.lang.Override + public long getSharedMemorySizePerMultiprocessor() { + return sharedMemorySizePerMultiprocessor_; + } + /** + *
    +       * Shared memory size per multiprocessor in bytes. This field is
    +       * applicable to GPUs only.
    +       * 
    + * + * int64 shared_memory_size_per_multiprocessor = 11; + * @param value The sharedMemorySizePerMultiprocessor to set. + * @return This builder for chaining. + */ + public Builder setSharedMemorySizePerMultiprocessor(long value) { + + sharedMemorySizePerMultiprocessor_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Shared memory size per multiprocessor in bytes. This field is
    +       * applicable to GPUs only.
    +       * 
    + * + * int64 shared_memory_size_per_multiprocessor = 11; + * @return This builder for chaining. + */ + public Builder clearSharedMemorySizePerMultiprocessor() { + bitField0_ = (bitField0_ & ~0x00000400); + sharedMemorySizePerMultiprocessor_ = 0L; + onChanged(); + return this; + } + + private long memorySize_ ; + /** + *
    +       * Memory size in bytes
    +       * 
    + * + * int64 memory_size = 12; + * @return The memorySize. + */ + @java.lang.Override + public long getMemorySize() { + return memorySize_; + } + /** + *
    +       * Memory size in bytes
    +       * 
    + * + * int64 memory_size = 12; + * @param value The memorySize to set. + * @return This builder for chaining. + */ + public Builder setMemorySize(long value) { + + memorySize_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * Memory size in bytes
    +       * 
    + * + * int64 memory_size = 12; + * @return This builder for chaining. + */ + public Builder clearMemorySize() { + bitField0_ = (bitField0_ & ~0x00000800); + memorySize_ = 0L; + onChanged(); + return this; + } + + private long bandwidth_ ; + /** + *
    +       * Memory bandwidth in KB/s
    +       * 
    + * + * int64 bandwidth = 13; + * @return The bandwidth. + */ + @java.lang.Override + public long getBandwidth() { + return bandwidth_; + } + /** + *
    +       * Memory bandwidth in KB/s
    +       * 
    + * + * int64 bandwidth = 13; + * @param value The bandwidth to set. + * @return This builder for chaining. + */ + public Builder setBandwidth(long value) { + + bandwidth_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * Memory bandwidth in KB/s
    +       * 
    + * + * int64 bandwidth = 13; + * @return This builder for chaining. + */ + public Builder clearBandwidth() { + bitField0_ = (bitField0_ & ~0x00001000); + bandwidth_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DeviceProperties) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DeviceProperties) + private static final org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties(); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DevicePropertiesProtos.DeviceProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NamedDeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NamedDevice) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .tensorflow.DeviceProperties properties = 2; + * @return Whether the properties field is set. + */ + boolean hasProperties(); + /** + * .tensorflow.DeviceProperties properties = 2; + * @return The properties. + */ + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getProperties(); + /** + * .tensorflow.DeviceProperties properties = 2; + */ + org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getPropertiesOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.NamedDevice} + */ + public static final class NamedDevice extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NamedDevice) + NamedDeviceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NamedDevice.class.getName()); + } + // Use NamedDevice.newBuilder() to construct. + private NamedDevice(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NamedDevice() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.class, org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 PROPERTIES_FIELD_NUMBER = 2; + private org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties properties_; + /** + * .tensorflow.DeviceProperties properties = 2; + * @return Whether the properties field is set. + */ + @java.lang.Override + public boolean hasProperties() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.DeviceProperties properties = 2; + * @return The properties. + */ + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getProperties() { + return properties_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : properties_; + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getPropertiesOrBuilder() { + return properties_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : properties_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getProperties()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getProperties()); + } + size += getUnknownFields().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.DevicePropertiesProtos.NamedDevice)) { + return super.equals(obj); + } + org.tensorflow.proto.DevicePropertiesProtos.NamedDevice other = (org.tensorflow.proto.DevicePropertiesProtos.NamedDevice) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasProperties() != other.hasProperties()) return false; + if (hasProperties()) { + if (!getProperties() + .equals(other.getProperties())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasProperties()) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getProperties().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice 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.DevicePropertiesProtos.NamedDevice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice 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.DevicePropertiesProtos.NamedDevice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DevicePropertiesProtos.NamedDevice 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.NamedDevice} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NamedDevice) + org.tensorflow.proto.DevicePropertiesProtos.NamedDeviceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.class, org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.Builder.class); + } + + // Construct using org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPropertiesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + properties_ = null; + if (propertiesBuilder_ != null) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DevicePropertiesProtos.internal_static_tensorflow_NamedDevice_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.NamedDevice getDefaultInstanceForType() { + return org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.NamedDevice build() { + org.tensorflow.proto.DevicePropertiesProtos.NamedDevice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.NamedDevice buildPartial() { + org.tensorflow.proto.DevicePropertiesProtos.NamedDevice result = new org.tensorflow.proto.DevicePropertiesProtos.NamedDevice(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.DevicePropertiesProtos.NamedDevice result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.properties_ = propertiesBuilder_ == null + ? properties_ + : propertiesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DevicePropertiesProtos.NamedDevice) { + return mergeFrom((org.tensorflow.proto.DevicePropertiesProtos.NamedDevice)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DevicePropertiesProtos.NamedDevice other) { + if (other == org.tensorflow.proto.DevicePropertiesProtos.NamedDevice.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasProperties()) { + mergeProperties(other.getProperties()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getPropertiesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties properties_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder> propertiesBuilder_; + /** + * .tensorflow.DeviceProperties properties = 2; + * @return Whether the properties field is set. + */ + public boolean hasProperties() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.DeviceProperties properties = 2; + * @return The properties. + */ + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getProperties() { + if (propertiesBuilder_ == null) { + return properties_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : properties_; + } else { + return propertiesBuilder_.getMessage(); + } + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public Builder setProperties(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + properties_ = value; + } else { + propertiesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public Builder setProperties( + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder builderForValue) { + if (propertiesBuilder_ == null) { + properties_ = builderForValue.build(); + } else { + propertiesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public Builder mergeProperties(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties value) { + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + properties_ != null && + properties_ != org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance()) { + getPropertiesBuilder().mergeFrom(value); + } else { + properties_ = value; + } + } else { + propertiesBuilder_.mergeFrom(value); + } + if (properties_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public Builder clearProperties() { + bitField0_ = (bitField0_ & ~0x00000002); + properties_ = null; + if (propertiesBuilder_ != null) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder getPropertiesBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPropertiesFieldBuilder().getBuilder(); + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + public org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getPropertiesOrBuilder() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilder(); + } else { + return properties_ == null ? + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : properties_; + } + } + /** + * .tensorflow.DeviceProperties properties = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder>( + getProperties(), + getParentForChildren(), + isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NamedDevice) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NamedDevice) + private static final org.tensorflow.proto.DevicePropertiesProtos.NamedDevice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DevicePropertiesProtos.NamedDevice(); + } + + public static org.tensorflow.proto.DevicePropertiesProtos.NamedDevice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NamedDevice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DevicePropertiesProtos.NamedDevice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DeviceProperties_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DeviceProperties_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DeviceProperties_EnvironmentEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NamedDevice_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NamedDevice_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0tensorflow/core/protobuf/device_proper" + + "ties.proto\022\ntensorflow\"\220\003\n\020DevicePropert" + + "ies\022\014\n\004type\030\001 \001(\t\022\016\n\006vendor\030\002 \001(\t\022\r\n\005mod" + + "el\030\003 \001(\t\022\021\n\tfrequency\030\004 \001(\003\022\021\n\tnum_cores" + + "\030\005 \001(\003\022B\n\013environment\030\006 \003(\0132-.tensorflow" + + ".DeviceProperties.EnvironmentEntry\022\025\n\rnu" + + "m_registers\030\007 \001(\003\022\025\n\rl1_cache_size\030\010 \001(\003" + + "\022\025\n\rl2_cache_size\030\t \001(\003\022\025\n\rl3_cache_size" + + "\030\n \001(\003\022-\n%shared_memory_size_per_multipr" + + "ocessor\030\013 \001(\003\022\023\n\013memory_size\030\014 \001(\003\022\021\n\tba" + + "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\210\001\n\024org.tensorf" + + "low.protoB\026DevicePropertiesProtosZUgithu" + + "b.com/tensorflow/tensorflow/tensorflow/g" + + "o/core/protobuf/for_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_DeviceProperties_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_DeviceProperties_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DeviceProperties_descriptor, + new java.lang.String[] { "Type", "Vendor", "Model", "Frequency", "NumCores", "Environment", "NumRegisters", "L1CacheSize", "L2CacheSize", "L3CacheSize", "SharedMemorySizePerMultiprocessor", "MemorySize", "Bandwidth", }); + internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor = + internal_static_tensorflow_DeviceProperties_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_DeviceProperties_EnvironmentEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DeviceProperties_EnvironmentEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_NamedDevice_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_NamedDevice_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NamedDevice_descriptor, + new java.lang.String[] { "Name", "Properties", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStats.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStats.java new file mode 100644 index 00000000000..5796f59a3a5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStats.java @@ -0,0 +1,1178 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.DeviceStepStats} + */ +public final class DeviceStepStats extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DeviceStepStats) + DeviceStepStatsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceStepStats.class.getName()); + } + // Use DeviceStepStats.newBuilder() to construct. + private DeviceStepStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DeviceStepStats() { + device_ = ""; + nodeStats_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetThreadNames(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DeviceStepStats.class, org.tensorflow.proto.DeviceStepStats.Builder.class); + } + + public static final int DEVICE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + * string device = 1; + * @return The device. + */ + @java.lang.Override + 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 = 1; + * @return The bytes for device. + */ + @java.lang.Override + 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 NODE_STATS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List nodeStats_; + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + @java.lang.Override + public java.util.List getNodeStatsList() { + return nodeStats_; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + @java.lang.Override + public java.util.List + getNodeStatsOrBuilderList() { + return nodeStats_; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + @java.lang.Override + public int getNodeStatsCount() { + return nodeStats_.size(); + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + @java.lang.Override + public org.tensorflow.proto.NodeExecStats getNodeStats(int index) { + return nodeStats_.get(index); + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + @java.lang.Override + public org.tensorflow.proto.NodeExecStatsOrBuilder getNodeStatsOrBuilder( + int index) { + return nodeStats_.get(index); + } + + public static final int THREAD_NAMES_FIELD_NUMBER = 3; + private static final class ThreadNamesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.UINT32, + 0, + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.String> threadNames_; + private com.google.protobuf.MapField + internalGetThreadNames() { + if (threadNames_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ThreadNamesDefaultEntryHolder.defaultEntry); + } + return threadNames_; + } + public int getThreadNamesCount() { + return internalGetThreadNames().getMap().size(); + } + /** + *
    +   * Its key is thread id.
    +   * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public boolean containsThreadNames( + int key) { + + return internalGetThreadNames().getMap().containsKey(key); + } + /** + * Use {@link #getThreadNamesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getThreadNames() { + return getThreadNamesMap(); + } + /** + *
    +   * Its key is thread id.
    +   * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public java.util.Map getThreadNamesMap() { + return internalGetThreadNames().getMap(); + } + /** + *
    +   * Its key is thread id.
    +   * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getThreadNamesOrDefault( + int key, + /* nullable */ +java.lang.String defaultValue) { + + java.util.Map map = + internalGetThreadNames().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Its key is thread id.
    +   * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public java.lang.String getThreadNamesOrThrow( + int key) { + + java.util.Map map = + internalGetThreadNames().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, device_); + } + for (int i = 0; i < nodeStats_.size(); i++) { + output.writeMessage(2, nodeStats_.get(i)); + } + com.google.protobuf.GeneratedMessage + .serializeIntegerMapTo( + output, + internalGetThreadNames(), + ThreadNamesDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, device_); + } + for (int i = 0; i < nodeStats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, nodeStats_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetThreadNames().getMap().entrySet()) { + com.google.protobuf.MapEntry + threadNames__ = ThreadNamesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, threadNames__); + } + size += getUnknownFields().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.DeviceStepStats)) { + return super.equals(obj); + } + org.tensorflow.proto.DeviceStepStats other = (org.tensorflow.proto.DeviceStepStats) obj; + + if (!getDevice() + .equals(other.getDevice())) return false; + if (!getNodeStatsList() + .equals(other.getNodeStatsList())) return false; + if (!internalGetThreadNames().equals( + other.internalGetThreadNames())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + if (getNodeStatsCount() > 0) { + hash = (37 * hash) + NODE_STATS_FIELD_NUMBER; + hash = (53 * hash) + getNodeStatsList().hashCode(); + } + if (!internalGetThreadNames().getMap().isEmpty()) { + hash = (37 * hash) + THREAD_NAMES_FIELD_NUMBER; + hash = (53 * hash) + internalGetThreadNames().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.DeviceStepStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceStepStats 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.DeviceStepStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceStepStats 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.DeviceStepStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.DeviceStepStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.DeviceStepStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceStepStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.DeviceStepStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.DeviceStepStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.DeviceStepStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.DeviceStepStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DeviceStepStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.DeviceStepStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DeviceStepStats) + org.tensorflow.proto.DeviceStepStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetThreadNames(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableThreadNames(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.DeviceStepStats.class, org.tensorflow.proto.DeviceStepStats.Builder.class); + } + + // Construct using org.tensorflow.proto.DeviceStepStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + device_ = ""; + if (nodeStatsBuilder_ == null) { + nodeStats_ = java.util.Collections.emptyList(); + } else { + nodeStats_ = null; + nodeStatsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableThreadNames().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceStepStats getDefaultInstanceForType() { + return org.tensorflow.proto.DeviceStepStats.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.DeviceStepStats build() { + org.tensorflow.proto.DeviceStepStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.DeviceStepStats buildPartial() { + org.tensorflow.proto.DeviceStepStats result = new org.tensorflow.proto.DeviceStepStats(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.DeviceStepStats result) { + if (nodeStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + nodeStats_ = java.util.Collections.unmodifiableList(nodeStats_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.nodeStats_ = nodeStats_; + } else { + result.nodeStats_ = nodeStatsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.DeviceStepStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.device_ = device_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.threadNames_ = internalGetThreadNames(); + result.threadNames_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.DeviceStepStats) { + return mergeFrom((org.tensorflow.proto.DeviceStepStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.DeviceStepStats other) { + if (other == org.tensorflow.proto.DeviceStepStats.getDefaultInstance()) return this; + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (nodeStatsBuilder_ == null) { + if (!other.nodeStats_.isEmpty()) { + if (nodeStats_.isEmpty()) { + nodeStats_ = other.nodeStats_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNodeStatsIsMutable(); + nodeStats_.addAll(other.nodeStats_); + } + onChanged(); + } + } else { + if (!other.nodeStats_.isEmpty()) { + if (nodeStatsBuilder_.isEmpty()) { + nodeStatsBuilder_.dispose(); + nodeStatsBuilder_ = null; + nodeStats_ = other.nodeStats_; + bitField0_ = (bitField0_ & ~0x00000002); + nodeStatsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeStatsFieldBuilder() : null; + } else { + nodeStatsBuilder_.addAllMessages(other.nodeStats_); + } + } + } + internalGetMutableThreadNames().mergeFrom( + other.internalGetThreadNames()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.NodeExecStats m = + input.readMessage( + org.tensorflow.proto.NodeExecStats.parser(), + extensionRegistry); + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + nodeStats_.add(m); + } else { + nodeStatsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + threadNames__ = input.readMessage( + ThreadNamesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableThreadNames().getMutableMap().put( + threadNames__.getKey(), threadNames__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object device_ = ""; + /** + * string device = 1; + * @return The device. + */ + 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 = 1; + * @return The bytes for device. + */ + 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 = 1; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string device = 1; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string device = 1; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List nodeStats_ = + java.util.Collections.emptyList(); + private void ensureNodeStatsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + nodeStats_ = new java.util.ArrayList(nodeStats_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeExecStats, org.tensorflow.proto.NodeExecStats.Builder, org.tensorflow.proto.NodeExecStatsOrBuilder> nodeStatsBuilder_; + + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public java.util.List getNodeStatsList() { + if (nodeStatsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeStats_); + } else { + return nodeStatsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public int getNodeStatsCount() { + if (nodeStatsBuilder_ == null) { + return nodeStats_.size(); + } else { + return nodeStatsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public org.tensorflow.proto.NodeExecStats getNodeStats(int index) { + if (nodeStatsBuilder_ == null) { + return nodeStats_.get(index); + } else { + return nodeStatsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder setNodeStats( + int index, org.tensorflow.proto.NodeExecStats value) { + if (nodeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeStatsIsMutable(); + nodeStats_.set(index, value); + onChanged(); + } else { + nodeStatsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder setNodeStats( + int index, org.tensorflow.proto.NodeExecStats.Builder builderForValue) { + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + nodeStats_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeStatsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder addNodeStats(org.tensorflow.proto.NodeExecStats value) { + if (nodeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeStatsIsMutable(); + nodeStats_.add(value); + onChanged(); + } else { + nodeStatsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder addNodeStats( + int index, org.tensorflow.proto.NodeExecStats value) { + if (nodeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeStatsIsMutable(); + nodeStats_.add(index, value); + onChanged(); + } else { + nodeStatsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder addNodeStats( + org.tensorflow.proto.NodeExecStats.Builder builderForValue) { + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + nodeStats_.add(builderForValue.build()); + onChanged(); + } else { + nodeStatsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder addNodeStats( + int index, org.tensorflow.proto.NodeExecStats.Builder builderForValue) { + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + nodeStats_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeStatsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder addAllNodeStats( + java.lang.Iterable values) { + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeStats_); + onChanged(); + } else { + nodeStatsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder clearNodeStats() { + if (nodeStatsBuilder_ == null) { + nodeStats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + nodeStatsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public Builder removeNodeStats(int index) { + if (nodeStatsBuilder_ == null) { + ensureNodeStatsIsMutable(); + nodeStats_.remove(index); + onChanged(); + } else { + nodeStatsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public org.tensorflow.proto.NodeExecStats.Builder getNodeStatsBuilder( + int index) { + return getNodeStatsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public org.tensorflow.proto.NodeExecStatsOrBuilder getNodeStatsOrBuilder( + int index) { + if (nodeStatsBuilder_ == null) { + return nodeStats_.get(index); } else { + return nodeStatsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public java.util.List + getNodeStatsOrBuilderList() { + if (nodeStatsBuilder_ != null) { + return nodeStatsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeStats_); + } + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public org.tensorflow.proto.NodeExecStats.Builder addNodeStatsBuilder() { + return getNodeStatsFieldBuilder().addBuilder( + org.tensorflow.proto.NodeExecStats.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public org.tensorflow.proto.NodeExecStats.Builder addNodeStatsBuilder( + int index) { + return getNodeStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.NodeExecStats.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeExecStats node_stats = 2; + */ + public java.util.List + getNodeStatsBuilderList() { + return getNodeStatsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeExecStats, org.tensorflow.proto.NodeExecStats.Builder, org.tensorflow.proto.NodeExecStatsOrBuilder> + getNodeStatsFieldBuilder() { + if (nodeStatsBuilder_ == null) { + nodeStatsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeExecStats, org.tensorflow.proto.NodeExecStats.Builder, org.tensorflow.proto.NodeExecStatsOrBuilder>( + nodeStats_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + nodeStats_ = null; + } + return nodeStatsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.String> threadNames_; + private com.google.protobuf.MapField + internalGetThreadNames() { + if (threadNames_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ThreadNamesDefaultEntryHolder.defaultEntry); + } + return threadNames_; + } + private com.google.protobuf.MapField + internalGetMutableThreadNames() { + if (threadNames_ == null) { + threadNames_ = com.google.protobuf.MapField.newMapField( + ThreadNamesDefaultEntryHolder.defaultEntry); + } + if (!threadNames_.isMutable()) { + threadNames_ = threadNames_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return threadNames_; + } + public int getThreadNamesCount() { + return internalGetThreadNames().getMap().size(); + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public boolean containsThreadNames( + int key) { + + return internalGetThreadNames().getMap().containsKey(key); + } + /** + * Use {@link #getThreadNamesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getThreadNames() { + return getThreadNamesMap(); + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public java.util.Map getThreadNamesMap() { + return internalGetThreadNames().getMap(); + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getThreadNamesOrDefault( + int key, + /* nullable */ +java.lang.String defaultValue) { + + java.util.Map map = + internalGetThreadNames().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + @java.lang.Override + public java.lang.String getThreadNamesOrThrow( + int key) { + + java.util.Map map = + internalGetThreadNames().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearThreadNames() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableThreadNames().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + public Builder removeThreadNames( + int key) { + + internalGetMutableThreadNames().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableThreadNames() { + bitField0_ |= 0x00000004; + return internalGetMutableThreadNames().getMutableMap(); + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + public Builder putThreadNames( + int key, + java.lang.String value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableThreadNames().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
    +     * Its key is thread id.
    +     * 
    + * + * map<uint32, string> thread_names = 3; + */ + public Builder putAllThreadNames( + java.util.Map values) { + internalGetMutableThreadNames().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DeviceStepStats) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DeviceStepStats) + private static final org.tensorflow.proto.DeviceStepStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.DeviceStepStats(); + } + + public static org.tensorflow.proto.DeviceStepStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceStepStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DeviceStepStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStatsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStatsOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStatsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStatsOrBuilder.java index d53ab25f2e0..40b250d1ab8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/DeviceStepStatsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/DeviceStepStatsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface DeviceStepStatsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.DeviceStepStats) @@ -9,10 +11,12 @@ public interface DeviceStepStatsOrBuilder extends /** * string device = 1; + * @return The device. */ java.lang.String getDevice(); /** * string device = 1; + * @return The bytes for device. */ com.google.protobuf.ByteString getDeviceBytes(); @@ -20,12 +24,12 @@ public interface DeviceStepStatsOrBuilder extends /** * repeated .tensorflow.NodeExecStats node_stats = 2; */ - java.util.List + java.util.List getNodeStatsList(); /** * repeated .tensorflow.NodeExecStats node_stats = 2; */ - org.tensorflow.proto.framework.NodeExecStats getNodeStats(int index); + org.tensorflow.proto.NodeExecStats getNodeStats(int index); /** * repeated .tensorflow.NodeExecStats node_stats = 2; */ @@ -33,12 +37,12 @@ public interface DeviceStepStatsOrBuilder extends /** * repeated .tensorflow.NodeExecStats node_stats = 2; */ - java.util.List + java.util.List getNodeStatsOrBuilderList(); /** * repeated .tensorflow.NodeExecStats node_stats = 2; */ - org.tensorflow.proto.framework.NodeExecStatsOrBuilder getNodeStatsOrBuilder( + org.tensorflow.proto.NodeExecStatsOrBuilder getNodeStatsOrBuilder( int index); /** @@ -80,10 +84,11 @@ boolean containsThreadNames( * * map<uint32, string> thread_names = 3; */ - - java.lang.String getThreadNamesOrDefault( + /* nullable */ +java.lang.String getThreadNamesOrDefault( int key, - java.lang.String defaultValue); + /* nullable */ +java.lang.String defaultValue); /** *
        * Its key is thread id.
    @@ -91,7 +96,6 @@ java.lang.String getThreadNamesOrDefault(
        *
        * map<uint32, string> thread_names = 3;
        */
    -
       java.lang.String getThreadNamesOrThrow(
           int key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValue.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValue.java
    new file mode 100644
    index 00000000000..95d9ec9af7c
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValue.java
    @@ -0,0 +1,706 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/test_log.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.EntryValue}
    + */
    +public final class EntryValue extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.EntryValue)
    +    EntryValueOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      EntryValue.class.getName());
    +  }
    +  // Use EntryValue.newBuilder() to construct.
    +  private EntryValue(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private EntryValue() {
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_EntryValue_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.EntryValue.class, org.tensorflow.proto.EntryValue.Builder.class);
    +  }
    +
    +  private int kindCase_ = 0;
    +  @SuppressWarnings("serial")
    +  private java.lang.Object kind_;
    +  public enum KindCase
    +      implements com.google.protobuf.Internal.EnumLite,
    +          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    +    DOUBLE_VALUE(1),
    +    STRING_VALUE(2),
    +    KIND_NOT_SET(0);
    +    private final int value;
    +    private KindCase(int value) {
    +      this.value = value;
    +    }
    +    /**
    +     * @param value The number of the enum to look for.
    +     * @return The enum associated with the given number.
    +     * @deprecated Use {@link #forNumber(int)} instead.
    +     */
    +    @java.lang.Deprecated
    +    public static KindCase valueOf(int value) {
    +      return forNumber(value);
    +    }
    +
    +    public static KindCase forNumber(int value) {
    +      switch (value) {
    +        case 1: return DOUBLE_VALUE;
    +        case 2: return STRING_VALUE;
    +        case 0: return KIND_NOT_SET;
    +        default: return null;
    +      }
    +    }
    +    public int getNumber() {
    +      return this.value;
    +    }
    +  };
    +
    +  public KindCase
    +  getKindCase() {
    +    return KindCase.forNumber(
    +        kindCase_);
    +  }
    +
    +  public static final int DOUBLE_VALUE_FIELD_NUMBER = 1;
    +  /**
    +   * double double_value = 1;
    +   * @return Whether the doubleValue field is set.
    +   */
    +  @java.lang.Override
    +  public boolean hasDoubleValue() {
    +    return kindCase_ == 1;
    +  }
    +  /**
    +   * double double_value = 1;
    +   * @return The doubleValue.
    +   */
    +  @java.lang.Override
    +  public double getDoubleValue() {
    +    if (kindCase_ == 1) {
    +      return (java.lang.Double) kind_;
    +    }
    +    return 0D;
    +  }
    +
    +  public static final int STRING_VALUE_FIELD_NUMBER = 2;
    +  /**
    +   * string string_value = 2;
    +   * @return Whether the stringValue field is set.
    +   */
    +  public boolean hasStringValue() {
    +    return kindCase_ == 2;
    +  }
    +  /**
    +   * string string_value = 2;
    +   * @return The stringValue.
    +   */
    +  public java.lang.String getStringValue() {
    +    java.lang.Object ref = "";
    +    if (kindCase_ == 2) {
    +      ref = kind_;
    +    }
    +    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();
    +      if (kindCase_ == 2) {
    +        kind_ = s;
    +      }
    +      return s;
    +    }
    +  }
    +  /**
    +   * string string_value = 2;
    +   * @return The bytes for stringValue.
    +   */
    +  public com.google.protobuf.ByteString
    +      getStringValueBytes() {
    +    java.lang.Object ref = "";
    +    if (kindCase_ == 2) {
    +      ref = kind_;
    +    }
    +    if (ref instanceof java.lang.String) {
    +      com.google.protobuf.ByteString b = 
    +          com.google.protobuf.ByteString.copyFromUtf8(
    +              (java.lang.String) ref);
    +      if (kindCase_ == 2) {
    +        kind_ = b;
    +      }
    +      return b;
    +    } else {
    +      return (com.google.protobuf.ByteString) ref;
    +    }
    +  }
    +
    +  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 (kindCase_ == 1) {
    +      output.writeDouble(
    +          1, (double)((java.lang.Double) kind_));
    +    }
    +    if (kindCase_ == 2) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 2, kind_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (kindCase_ == 1) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeDoubleSize(
    +            1, (double)((java.lang.Double) kind_));
    +    }
    +    if (kindCase_ == 2) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kind_);
    +    }
    +    size += getUnknownFields().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.EntryValue)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.EntryValue other = (org.tensorflow.proto.EntryValue) obj;
    +
    +    if (!getKindCase().equals(other.getKindCase())) return false;
    +    switch (kindCase_) {
    +      case 1:
    +        if (java.lang.Double.doubleToLongBits(getDoubleValue())
    +            != java.lang.Double.doubleToLongBits(
    +                other.getDoubleValue())) return false;
    +        break;
    +      case 2:
    +        if (!getStringValue()
    +            .equals(other.getStringValue())) return false;
    +        break;
    +      case 0:
    +      default:
    +    }
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    +    return true;
    +  }
    +
    +  @java.lang.Override
    +  public int hashCode() {
    +    if (memoizedHashCode != 0) {
    +      return memoizedHashCode;
    +    }
    +    int hash = 41;
    +    hash = (19 * hash) + getDescriptor().hashCode();
    +    switch (kindCase_) {
    +      case 1:
    +        hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER;
    +        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
    +            java.lang.Double.doubleToLongBits(getDoubleValue()));
    +        break;
    +      case 2:
    +        hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER;
    +        hash = (53 * hash) + getStringValue().hashCode();
    +        break;
    +      case 0:
    +      default:
    +    }
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.EntryValue parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.EntryValue 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.EntryValue parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.EntryValue 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.EntryValue parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.EntryValue parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.EntryValue parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.EntryValue parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.EntryValue parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.EntryValue parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.EntryValue parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.EntryValue parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.EntryValue 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.EntryValue}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.EntryValue)
    +      org.tensorflow.proto.EntryValueOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_EntryValue_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.EntryValue.class, org.tensorflow.proto.EntryValue.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.EntryValue.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      kindCase_ = 0;
    +      kind_ = null;
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_EntryValue_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.EntryValue getDefaultInstanceForType() {
    +      return org.tensorflow.proto.EntryValue.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.EntryValue build() {
    +      org.tensorflow.proto.EntryValue result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.EntryValue buildPartial() {
    +      org.tensorflow.proto.EntryValue result = new org.tensorflow.proto.EntryValue(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      buildPartialOneofs(result);
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.EntryValue result) {
    +      int from_bitField0_ = bitField0_;
    +    }
    +
    +    private void buildPartialOneofs(org.tensorflow.proto.EntryValue result) {
    +      result.kindCase_ = kindCase_;
    +      result.kind_ = this.kind_;
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.EntryValue) {
    +        return mergeFrom((org.tensorflow.proto.EntryValue)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.EntryValue other) {
    +      if (other == org.tensorflow.proto.EntryValue.getDefaultInstance()) return this;
    +      switch (other.getKindCase()) {
    +        case DOUBLE_VALUE: {
    +          setDoubleValue(other.getDoubleValue());
    +          break;
    +        }
    +        case STRING_VALUE: {
    +          kindCase_ = 2;
    +          kind_ = other.kind_;
    +          onChanged();
    +          break;
    +        }
    +        case KIND_NOT_SET: {
    +          break;
    +        }
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 9: {
    +              kind_ = input.readDouble();
    +              kindCase_ = 1;
    +              break;
    +            } // case 9
    +            case 18: {
    +              java.lang.String s = input.readStringRequireUtf8();
    +              kindCase_ = 2;
    +              kind_ = s;
    +              break;
    +            } // case 18
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int kindCase_ = 0;
    +    private java.lang.Object kind_;
    +    public KindCase
    +        getKindCase() {
    +      return KindCase.forNumber(
    +          kindCase_);
    +    }
    +
    +    public Builder clearKind() {
    +      kindCase_ = 0;
    +      kind_ = null;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private int bitField0_;
    +
    +    /**
    +     * double double_value = 1;
    +     * @return Whether the doubleValue field is set.
    +     */
    +    public boolean hasDoubleValue() {
    +      return kindCase_ == 1;
    +    }
    +    /**
    +     * double double_value = 1;
    +     * @return The doubleValue.
    +     */
    +    public double getDoubleValue() {
    +      if (kindCase_ == 1) {
    +        return (java.lang.Double) kind_;
    +      }
    +      return 0D;
    +    }
    +    /**
    +     * double double_value = 1;
    +     * @param value The doubleValue to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDoubleValue(double value) {
    +
    +      kindCase_ = 1;
    +      kind_ = value;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * double double_value = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDoubleValue() {
    +      if (kindCase_ == 1) {
    +        kindCase_ = 0;
    +        kind_ = null;
    +        onChanged();
    +      }
    +      return this;
    +    }
    +
    +    /**
    +     * string string_value = 2;
    +     * @return Whether the stringValue field is set.
    +     */
    +    @java.lang.Override
    +    public boolean hasStringValue() {
    +      return kindCase_ == 2;
    +    }
    +    /**
    +     * string string_value = 2;
    +     * @return The stringValue.
    +     */
    +    @java.lang.Override
    +    public java.lang.String getStringValue() {
    +      java.lang.Object ref = "";
    +      if (kindCase_ == 2) {
    +        ref = kind_;
    +      }
    +      if (!(ref instanceof java.lang.String)) {
    +        com.google.protobuf.ByteString bs =
    +            (com.google.protobuf.ByteString) ref;
    +        java.lang.String s = bs.toStringUtf8();
    +        if (kindCase_ == 2) {
    +          kind_ = s;
    +        }
    +        return s;
    +      } else {
    +        return (java.lang.String) ref;
    +      }
    +    }
    +    /**
    +     * string string_value = 2;
    +     * @return The bytes for stringValue.
    +     */
    +    @java.lang.Override
    +    public com.google.protobuf.ByteString
    +        getStringValueBytes() {
    +      java.lang.Object ref = "";
    +      if (kindCase_ == 2) {
    +        ref = kind_;
    +      }
    +      if (ref instanceof String) {
    +        com.google.protobuf.ByteString b = 
    +            com.google.protobuf.ByteString.copyFromUtf8(
    +                (java.lang.String) ref);
    +        if (kindCase_ == 2) {
    +          kind_ = b;
    +        }
    +        return b;
    +      } else {
    +        return (com.google.protobuf.ByteString) ref;
    +      }
    +    }
    +    /**
    +     * string string_value = 2;
    +     * @param value The stringValue to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setStringValue(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      kindCase_ = 2;
    +      kind_ = value;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string string_value = 2;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearStringValue() {
    +      if (kindCase_ == 2) {
    +        kindCase_ = 0;
    +        kind_ = null;
    +        onChanged();
    +      }
    +      return this;
    +    }
    +    /**
    +     * string string_value = 2;
    +     * @param value The bytes for stringValue to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setStringValueBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      kindCase_ = 2;
    +      kind_ = value;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.EntryValue)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.EntryValue)
    +  private static final org.tensorflow.proto.EntryValue DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.EntryValue();
    +  }
    +
    +  public static org.tensorflow.proto.EntryValue getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public EntryValue parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.EntryValue getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValueOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValueOrBuilder.java
    new file mode 100644
    index 00000000000..19578965697
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EntryValueOrBuilder.java
    @@ -0,0 +1,41 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/test_log.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface EntryValueOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.EntryValue)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * double double_value = 1;
    +   * @return Whether the doubleValue field is set.
    +   */
    +  boolean hasDoubleValue();
    +  /**
    +   * double double_value = 1;
    +   * @return The doubleValue.
    +   */
    +  double getDoubleValue();
    +
    +  /**
    +   * string string_value = 2;
    +   * @return Whether the stringValue field is set.
    +   */
    +  boolean hasStringValue();
    +  /**
    +   * string string_value = 2;
    +   * @return The stringValue.
    +   */
    +  java.lang.String getStringValue();
    +  /**
    +   * string string_value = 2;
    +   * @return The bytes for stringValue.
    +   */
    +  com.google.protobuf.ByteString
    +      getStringValueBytes();
    +
    +  org.tensorflow.proto.EntryValue.KindCase getKindCase();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ErrorCodes.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ErrorCodes.java
    new file mode 100644
    index 00000000000..c717a8b23e5
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ErrorCodes.java
    @@ -0,0 +1,52 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/lib/core/error_codes.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class ErrorCodes {
    +  private ErrorCodes() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      ErrorCodes.class.getName());
    +  }
    +  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 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/lib/core/error_codes.p" +
    +      "roto\022\ntensorflow\032\"xla/tsl/protobuf/error" +
    +      "_codes.protoB\026\n\024org.tensorflow.protoP\000b\006" +
    +      "proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor(),
    +        });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Event.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Event.java
    new file mode 100644
    index 00000000000..f8700f4727a
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Event.java
    @@ -0,0 +1,2392 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing an event that happened during
    + * the execution of a Brain model.
    + * 
    + * + * Protobuf type {@code tensorflow.Event} + */ +public final class Event extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Event) + EventOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Event.class.getName()); + } + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Event() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Event.class, org.tensorflow.proto.Event.Builder.class); + } + + private int bitField0_; + private int whatCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object what_; + public enum WhatCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FILE_VERSION(3), + GRAPH_DEF(4), + SUMMARY(5), + @java.lang.Deprecated LOG_MESSAGE(6), + SESSION_LOG(7), + TAGGED_RUN_METADATA(8), + META_GRAPH_DEF(9), + WHAT_NOT_SET(0); + private final int value; + private WhatCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WhatCase valueOf(int value) { + return forNumber(value); + } + + public static WhatCase forNumber(int value) { + switch (value) { + case 3: return FILE_VERSION; + case 4: return GRAPH_DEF; + case 5: return SUMMARY; + case 6: return LOG_MESSAGE; + case 7: return SESSION_LOG; + case 8: return TAGGED_RUN_METADATA; + case 9: return META_GRAPH_DEF; + case 0: return WHAT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public WhatCase + getWhatCase() { + return WhatCase.forNumber( + whatCase_); + } + + public static final int WALL_TIME_FIELD_NUMBER = 1; + private double wallTime_ = 0D; + /** + *
    +   * Timestamp of the event.
    +   * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + + public static final int STEP_FIELD_NUMBER = 2; + private long step_ = 0L; + /** + *
    +   * Global step of the event.
    +   * 
    + * + * int64 step = 2; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + + public static final int FILE_VERSION_FIELD_NUMBER = 3; + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return Whether the fileVersion field is set. + */ + public boolean hasFileVersion() { + return whatCase_ == 3; + } + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return The fileVersion. + */ + public java.lang.String getFileVersion() { + java.lang.Object ref = ""; + if (whatCase_ == 3) { + ref = what_; + } + 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(); + if (whatCase_ == 3) { + what_ = s; + } + return s; + } + } + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return The bytes for fileVersion. + */ + public com.google.protobuf.ByteString + getFileVersionBytes() { + java.lang.Object ref = ""; + if (whatCase_ == 3) { + ref = what_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (whatCase_ == 3) { + what_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRAPH_DEF_FIELD_NUMBER = 4; + /** + *
    +   * An encoded version of a GraphDef.
    +   * 
    + * + * bytes graph_def = 4; + * @return Whether the graphDef field is set. + */ + @java.lang.Override + public boolean hasGraphDef() { + return whatCase_ == 4; + } + /** + *
    +   * An encoded version of a GraphDef.
    +   * 
    + * + * bytes graph_def = 4; + * @return The graphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGraphDef() { + if (whatCase_ == 4) { + return (com.google.protobuf.ByteString) what_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int SUMMARY_FIELD_NUMBER = 5; + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return whatCase_ == 5; + } + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + * @return The summary. + */ + @java.lang.Override + public org.tensorflow.proto.Summary getSummary() { + if (whatCase_ == 5) { + return (org.tensorflow.proto.Summary) what_; + } + return org.tensorflow.proto.Summary.getDefaultInstance(); + } + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SummaryOrBuilder getSummaryOrBuilder() { + if (whatCase_ == 5) { + return (org.tensorflow.proto.Summary) what_; + } + return org.tensorflow.proto.Summary.getDefaultInstance(); + } + + public static final int LOG_MESSAGE_FIELD_NUMBER = 6; + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return Whether the logMessage field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasLogMessage() { + return whatCase_ == 6; + } + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return The logMessage. + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.LogMessage getLogMessage() { + if (whatCase_ == 6) { + return (org.tensorflow.proto.LogMessage) what_; + } + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.LogMessageOrBuilder getLogMessageOrBuilder() { + if (whatCase_ == 6) { + return (org.tensorflow.proto.LogMessage) what_; + } + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + + public static final int SESSION_LOG_FIELD_NUMBER = 7; + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return Whether the sessionLog field is set. + */ + @java.lang.Override + public boolean hasSessionLog() { + return whatCase_ == 7; + } + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return The sessionLog. + */ + @java.lang.Override + public org.tensorflow.proto.SessionLog getSessionLog() { + if (whatCase_ == 7) { + return (org.tensorflow.proto.SessionLog) what_; + } + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + @java.lang.Override + public org.tensorflow.proto.SessionLogOrBuilder getSessionLogOrBuilder() { + if (whatCase_ == 7) { + return (org.tensorflow.proto.SessionLog) what_; + } + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + + public static final int TAGGED_RUN_METADATA_FIELD_NUMBER = 8; + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return Whether the taggedRunMetadata field is set. + */ + @java.lang.Override + public boolean hasTaggedRunMetadata() { + return whatCase_ == 8; + } + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return The taggedRunMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadata getTaggedRunMetadata() { + if (whatCase_ == 8) { + return (org.tensorflow.proto.TaggedRunMetadata) what_; + } + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder() { + if (whatCase_ == 8) { + return (org.tensorflow.proto.TaggedRunMetadata) what_; + } + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + + public static final int META_GRAPH_DEF_FIELD_NUMBER = 9; + /** + *
    +   * An encoded version of a MetaGraphDef.
    +   * 
    + * + * bytes meta_graph_def = 9; + * @return Whether the metaGraphDef field is set. + */ + @java.lang.Override + public boolean hasMetaGraphDef() { + return whatCase_ == 9; + } + /** + *
    +   * An encoded version of a MetaGraphDef.
    +   * 
    + * + * bytes meta_graph_def = 9; + * @return The metaGraphDef. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetaGraphDef() { + if (whatCase_ == 9) { + return (com.google.protobuf.ByteString) what_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int SOURCE_METADATA_FIELD_NUMBER = 10; + private org.tensorflow.proto.SourceMetadata sourceMetadata_; + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return Whether the sourceMetadata field is set. + */ + @java.lang.Override + public boolean hasSourceMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return The sourceMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.SourceMetadata getSourceMetadata() { + return sourceMetadata_ == null ? org.tensorflow.proto.SourceMetadata.getDefaultInstance() : sourceMetadata_; + } + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + @java.lang.Override + public org.tensorflow.proto.SourceMetadataOrBuilder getSourceMetadataOrBuilder() { + return sourceMetadata_ == null ? org.tensorflow.proto.SourceMetadata.getDefaultInstance() : sourceMetadata_; + } + + 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 (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + output.writeDouble(1, wallTime_); + } + if (step_ != 0L) { + output.writeInt64(2, step_); + } + if (whatCase_ == 3) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, what_); + } + if (whatCase_ == 4) { + output.writeBytes( + 4, (com.google.protobuf.ByteString) what_); + } + if (whatCase_ == 5) { + output.writeMessage(5, (org.tensorflow.proto.Summary) what_); + } + if (whatCase_ == 6) { + output.writeMessage(6, (org.tensorflow.proto.LogMessage) what_); + } + if (whatCase_ == 7) { + output.writeMessage(7, (org.tensorflow.proto.SessionLog) what_); + } + if (whatCase_ == 8) { + output.writeMessage(8, (org.tensorflow.proto.TaggedRunMetadata) what_); + } + if (whatCase_ == 9) { + output.writeBytes( + 9, (com.google.protobuf.ByteString) what_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getSourceMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(wallTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, wallTime_); + } + if (step_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, step_); + } + if (whatCase_ == 3) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, what_); + } + if (whatCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 4, (com.google.protobuf.ByteString) what_); + } + if (whatCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (org.tensorflow.proto.Summary) what_); + } + if (whatCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (org.tensorflow.proto.LogMessage) what_); + } + if (whatCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (org.tensorflow.proto.SessionLog) what_); + } + if (whatCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (org.tensorflow.proto.TaggedRunMetadata) what_); + } + if (whatCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 9, (com.google.protobuf.ByteString) what_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getSourceMetadata()); + } + size += getUnknownFields().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.Event)) { + return super.equals(obj); + } + org.tensorflow.proto.Event other = (org.tensorflow.proto.Event) obj; + + if (java.lang.Double.doubleToLongBits(getWallTime()) + != java.lang.Double.doubleToLongBits( + other.getWallTime())) return false; + if (getStep() + != other.getStep()) return false; + if (hasSourceMetadata() != other.hasSourceMetadata()) return false; + if (hasSourceMetadata()) { + if (!getSourceMetadata() + .equals(other.getSourceMetadata())) return false; + } + if (!getWhatCase().equals(other.getWhatCase())) return false; + switch (whatCase_) { + case 3: + if (!getFileVersion() + .equals(other.getFileVersion())) return false; + break; + case 4: + if (!getGraphDef() + .equals(other.getGraphDef())) return false; + break; + case 5: + if (!getSummary() + .equals(other.getSummary())) return false; + break; + case 6: + if (!getLogMessage() + .equals(other.getLogMessage())) return false; + break; + case 7: + if (!getSessionLog() + .equals(other.getSessionLog())) return false; + break; + case 8: + if (!getTaggedRunMetadata() + .equals(other.getTaggedRunMetadata())) return false; + break; + case 9: + if (!getMetaGraphDef() + .equals(other.getMetaGraphDef())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WALL_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getWallTime())); + hash = (37 * hash) + STEP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStep()); + if (hasSourceMetadata()) { + hash = (37 * hash) + SOURCE_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getSourceMetadata().hashCode(); + } + switch (whatCase_) { + case 3: + hash = (37 * hash) + FILE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getFileVersion().hashCode(); + break; + case 4: + hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getGraphDef().hashCode(); + break; + case 5: + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + break; + case 6: + hash = (37 * hash) + LOG_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getLogMessage().hashCode(); + break; + case 7: + hash = (37 * hash) + SESSION_LOG_FIELD_NUMBER; + hash = (53 * hash) + getSessionLog().hashCode(); + break; + case 8: + hash = (37 * hash) + TAGGED_RUN_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTaggedRunMetadata().hashCode(); + break; + case 9: + hash = (37 * hash) + META_GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getMetaGraphDef().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Event parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Event 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.Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Event 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.Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Event parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Event parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Event parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Event parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Event parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Event parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Event 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing an event that happened during
    +   * the execution of a Brain model.
    +   * 
    + * + * Protobuf type {@code tensorflow.Event} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Event) + org.tensorflow.proto.EventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Event.class, org.tensorflow.proto.Event.Builder.class); + } + + // Construct using org.tensorflow.proto.Event.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSourceMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + wallTime_ = 0D; + step_ = 0L; + if (summaryBuilder_ != null) { + summaryBuilder_.clear(); + } + if (logMessageBuilder_ != null) { + logMessageBuilder_.clear(); + } + if (sessionLogBuilder_ != null) { + sessionLogBuilder_.clear(); + } + if (taggedRunMetadataBuilder_ != null) { + taggedRunMetadataBuilder_.clear(); + } + sourceMetadata_ = null; + if (sourceMetadataBuilder_ != null) { + sourceMetadataBuilder_.dispose(); + sourceMetadataBuilder_ = null; + } + whatCase_ = 0; + what_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_Event_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Event getDefaultInstanceForType() { + return org.tensorflow.proto.Event.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Event build() { + org.tensorflow.proto.Event result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Event buildPartial() { + org.tensorflow.proto.Event result = new org.tensorflow.proto.Event(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Event result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.wallTime_ = wallTime_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.step_ = step_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sourceMetadata_ = sourceMetadataBuilder_ == null + ? sourceMetadata_ + : sourceMetadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.Event result) { + result.whatCase_ = whatCase_; + result.what_ = this.what_; + if (whatCase_ == 5 && + summaryBuilder_ != null) { + result.what_ = summaryBuilder_.build(); + } + if (whatCase_ == 6 && + logMessageBuilder_ != null) { + result.what_ = logMessageBuilder_.build(); + } + if (whatCase_ == 7 && + sessionLogBuilder_ != null) { + result.what_ = sessionLogBuilder_.build(); + } + if (whatCase_ == 8 && + taggedRunMetadataBuilder_ != null) { + result.what_ = taggedRunMetadataBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Event) { + return mergeFrom((org.tensorflow.proto.Event)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Event other) { + if (other == org.tensorflow.proto.Event.getDefaultInstance()) return this; + if (other.getWallTime() != 0D) { + setWallTime(other.getWallTime()); + } + if (other.getStep() != 0L) { + setStep(other.getStep()); + } + if (other.hasSourceMetadata()) { + mergeSourceMetadata(other.getSourceMetadata()); + } + switch (other.getWhatCase()) { + case FILE_VERSION: { + whatCase_ = 3; + what_ = other.what_; + onChanged(); + break; + } + case GRAPH_DEF: { + setGraphDef(other.getGraphDef()); + break; + } + case SUMMARY: { + mergeSummary(other.getSummary()); + break; + } + case LOG_MESSAGE: { + mergeLogMessage(other.getLogMessage()); + break; + } + case SESSION_LOG: { + mergeSessionLog(other.getSessionLog()); + break; + } + case TAGGED_RUN_METADATA: { + mergeTaggedRunMetadata(other.getTaggedRunMetadata()); + break; + } + case META_GRAPH_DEF: { + setMetaGraphDef(other.getMetaGraphDef()); + break; + } + case WHAT_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + wallTime_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 16: { + step_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + whatCase_ = 3; + what_ = s; + break; + } // case 26 + case 34: { + what_ = input.readBytes(); + whatCase_ = 4; + break; + } // case 34 + case 42: { + input.readMessage( + getSummaryFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 5; + break; + } // case 42 + case 50: { + input.readMessage( + getLogMessageFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 6; + break; + } // case 50 + case 58: { + input.readMessage( + getSessionLogFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 7; + break; + } // case 58 + case 66: { + input.readMessage( + getTaggedRunMetadataFieldBuilder().getBuilder(), + extensionRegistry); + whatCase_ = 8; + break; + } // case 66 + case 74: { + what_ = input.readBytes(); + whatCase_ = 9; + break; + } // case 74 + case 82: { + input.readMessage( + getSourceMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int whatCase_ = 0; + private java.lang.Object what_; + public WhatCase + getWhatCase() { + return WhatCase.forNumber( + whatCase_); + } + + public Builder clearWhat() { + whatCase_ = 0; + what_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private double wallTime_ ; + /** + *
    +     * Timestamp of the event.
    +     * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + @java.lang.Override + public double getWallTime() { + return wallTime_; + } + /** + *
    +     * Timestamp of the event.
    +     * 
    + * + * double wall_time = 1; + * @param value The wallTime to set. + * @return This builder for chaining. + */ + public Builder setWallTime(double value) { + + wallTime_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Timestamp of the event.
    +     * 
    + * + * double wall_time = 1; + * @return This builder for chaining. + */ + public Builder clearWallTime() { + bitField0_ = (bitField0_ & ~0x00000001); + wallTime_ = 0D; + onChanged(); + return this; + } + + private long step_ ; + /** + *
    +     * Global step of the event.
    +     * 
    + * + * int64 step = 2; + * @return The step. + */ + @java.lang.Override + public long getStep() { + return step_; + } + /** + *
    +     * Global step of the event.
    +     * 
    + * + * int64 step = 2; + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep(long value) { + + step_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Global step of the event.
    +     * 
    + * + * int64 step = 2; + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000002); + step_ = 0L; + onChanged(); + return this; + } + + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @return Whether the fileVersion field is set. + */ + @java.lang.Override + public boolean hasFileVersion() { + return whatCase_ == 3; + } + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @return The fileVersion. + */ + @java.lang.Override + public java.lang.String getFileVersion() { + java.lang.Object ref = ""; + if (whatCase_ == 3) { + ref = what_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (whatCase_ == 3) { + what_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @return The bytes for fileVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFileVersionBytes() { + java.lang.Object ref = ""; + if (whatCase_ == 3) { + ref = what_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (whatCase_ == 3) { + what_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @param value The fileVersion to set. + * @return This builder for chaining. + */ + public Builder setFileVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + whatCase_ = 3; + what_ = value; + onChanged(); + return this; + } + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @return This builder for chaining. + */ + public Builder clearFileVersion() { + if (whatCase_ == 3) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + return this; + } + /** + *
    +     * An event file was started, with the specified version.
    +     * This is use to identify the contents of the record IO files
    +     * easily.  Current version is "brain.Event:2".  All versions
    +     * start with "brain.Event:".
    +     * 
    + * + * string file_version = 3; + * @param value The bytes for fileVersion to set. + * @return This builder for chaining. + */ + public Builder setFileVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + whatCase_ = 3; + what_ = value; + onChanged(); + return this; + } + + /** + *
    +     * An encoded version of a GraphDef.
    +     * 
    + * + * bytes graph_def = 4; + * @return Whether the graphDef field is set. + */ + public boolean hasGraphDef() { + return whatCase_ == 4; + } + /** + *
    +     * An encoded version of a GraphDef.
    +     * 
    + * + * bytes graph_def = 4; + * @return The graphDef. + */ + public com.google.protobuf.ByteString getGraphDef() { + if (whatCase_ == 4) { + return (com.google.protobuf.ByteString) what_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
    +     * An encoded version of a GraphDef.
    +     * 
    + * + * bytes graph_def = 4; + * @param value The graphDef to set. + * @return This builder for chaining. + */ + public Builder setGraphDef(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + whatCase_ = 4; + what_ = value; + onChanged(); + return this; + } + /** + *
    +     * An encoded version of a GraphDef.
    +     * 
    + * + * bytes graph_def = 4; + * @return This builder for chaining. + */ + public Builder clearGraphDef() { + if (whatCase_ == 4) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Summary, org.tensorflow.proto.Summary.Builder, org.tensorflow.proto.SummaryOrBuilder> summaryBuilder_; + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + * @return Whether the summary field is set. + */ + @java.lang.Override + public boolean hasSummary() { + return whatCase_ == 5; + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + * @return The summary. + */ + @java.lang.Override + public org.tensorflow.proto.Summary getSummary() { + if (summaryBuilder_ == null) { + if (whatCase_ == 5) { + return (org.tensorflow.proto.Summary) what_; + } + return org.tensorflow.proto.Summary.getDefaultInstance(); + } else { + if (whatCase_ == 5) { + return summaryBuilder_.getMessage(); + } + return org.tensorflow.proto.Summary.getDefaultInstance(); + } + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + public Builder setSummary(org.tensorflow.proto.Summary value) { + if (summaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + summaryBuilder_.setMessage(value); + } + whatCase_ = 5; + return this; + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + public Builder setSummary( + org.tensorflow.proto.Summary.Builder builderForValue) { + if (summaryBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + summaryBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 5; + return this; + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + public Builder mergeSummary(org.tensorflow.proto.Summary value) { + if (summaryBuilder_ == null) { + if (whatCase_ == 5 && + what_ != org.tensorflow.proto.Summary.getDefaultInstance()) { + what_ = org.tensorflow.proto.Summary.newBuilder((org.tensorflow.proto.Summary) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 5) { + summaryBuilder_.mergeFrom(value); + } else { + summaryBuilder_.setMessage(value); + } + } + whatCase_ = 5; + return this; + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + public Builder clearSummary() { + if (summaryBuilder_ == null) { + if (whatCase_ == 5) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 5) { + whatCase_ = 0; + what_ = null; + } + summaryBuilder_.clear(); + } + return this; + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + public org.tensorflow.proto.Summary.Builder getSummaryBuilder() { + return getSummaryFieldBuilder().getBuilder(); + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SummaryOrBuilder getSummaryOrBuilder() { + if ((whatCase_ == 5) && (summaryBuilder_ != null)) { + return summaryBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 5) { + return (org.tensorflow.proto.Summary) what_; + } + return org.tensorflow.proto.Summary.getDefaultInstance(); + } + } + /** + *
    +     * A summary was generated.
    +     * 
    + * + * .tensorflow.Summary summary = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Summary, org.tensorflow.proto.Summary.Builder, org.tensorflow.proto.SummaryOrBuilder> + getSummaryFieldBuilder() { + if (summaryBuilder_ == null) { + if (!(whatCase_ == 5)) { + what_ = org.tensorflow.proto.Summary.getDefaultInstance(); + } + summaryBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Summary, org.tensorflow.proto.Summary.Builder, org.tensorflow.proto.SummaryOrBuilder>( + (org.tensorflow.proto.Summary) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 5; + onChanged(); + return summaryBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LogMessage, org.tensorflow.proto.LogMessage.Builder, org.tensorflow.proto.LogMessageOrBuilder> logMessageBuilder_; + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return Whether the logMessage field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasLogMessage() { + return whatCase_ == 6; + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return The logMessage. + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.LogMessage getLogMessage() { + if (logMessageBuilder_ == null) { + if (whatCase_ == 6) { + return (org.tensorflow.proto.LogMessage) what_; + } + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } else { + if (whatCase_ == 6) { + return logMessageBuilder_.getMessage(); + } + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated public Builder setLogMessage(org.tensorflow.proto.LogMessage value) { + if (logMessageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + logMessageBuilder_.setMessage(value); + } + whatCase_ = 6; + return this; + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated public Builder setLogMessage( + org.tensorflow.proto.LogMessage.Builder builderForValue) { + if (logMessageBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + logMessageBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 6; + return this; + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated public Builder mergeLogMessage(org.tensorflow.proto.LogMessage value) { + if (logMessageBuilder_ == null) { + if (whatCase_ == 6 && + what_ != org.tensorflow.proto.LogMessage.getDefaultInstance()) { + what_ = org.tensorflow.proto.LogMessage.newBuilder((org.tensorflow.proto.LogMessage) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 6) { + logMessageBuilder_.mergeFrom(value); + } else { + logMessageBuilder_.setMessage(value); + } + } + whatCase_ = 6; + return this; + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated public Builder clearLogMessage() { + if (logMessageBuilder_ == null) { + if (whatCase_ == 6) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 6) { + whatCase_ = 0; + what_ = null; + } + logMessageBuilder_.clear(); + } + return this; + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated public org.tensorflow.proto.LogMessage.Builder getLogMessageBuilder() { + return getLogMessageFieldBuilder().getBuilder(); + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.LogMessageOrBuilder getLogMessageOrBuilder() { + if ((whatCase_ == 6) && (logMessageBuilder_ != null)) { + return logMessageBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 6) { + return (org.tensorflow.proto.LogMessage) what_; + } + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + } + /** + *
    +     * The user output a log message. This was theoretically used by the defunct
    +     * tensorboard_logging module, which has since been removed; this field is
    +     * now deprecated and should not be used.
    +     * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LogMessage, org.tensorflow.proto.LogMessage.Builder, org.tensorflow.proto.LogMessageOrBuilder> + getLogMessageFieldBuilder() { + if (logMessageBuilder_ == null) { + if (!(whatCase_ == 6)) { + what_ = org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + logMessageBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.LogMessage, org.tensorflow.proto.LogMessage.Builder, org.tensorflow.proto.LogMessageOrBuilder>( + (org.tensorflow.proto.LogMessage) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 6; + onChanged(); + return logMessageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionLog, org.tensorflow.proto.SessionLog.Builder, org.tensorflow.proto.SessionLogOrBuilder> sessionLogBuilder_; + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return Whether the sessionLog field is set. + */ + @java.lang.Override + public boolean hasSessionLog() { + return whatCase_ == 7; + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return The sessionLog. + */ + @java.lang.Override + public org.tensorflow.proto.SessionLog getSessionLog() { + if (sessionLogBuilder_ == null) { + if (whatCase_ == 7) { + return (org.tensorflow.proto.SessionLog) what_; + } + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } else { + if (whatCase_ == 7) { + return sessionLogBuilder_.getMessage(); + } + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + public Builder setSessionLog(org.tensorflow.proto.SessionLog value) { + if (sessionLogBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + sessionLogBuilder_.setMessage(value); + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + public Builder setSessionLog( + org.tensorflow.proto.SessionLog.Builder builderForValue) { + if (sessionLogBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + sessionLogBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + public Builder mergeSessionLog(org.tensorflow.proto.SessionLog value) { + if (sessionLogBuilder_ == null) { + if (whatCase_ == 7 && + what_ != org.tensorflow.proto.SessionLog.getDefaultInstance()) { + what_ = org.tensorflow.proto.SessionLog.newBuilder((org.tensorflow.proto.SessionLog) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 7) { + sessionLogBuilder_.mergeFrom(value); + } else { + sessionLogBuilder_.setMessage(value); + } + } + whatCase_ = 7; + return this; + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + public Builder clearSessionLog() { + if (sessionLogBuilder_ == null) { + if (whatCase_ == 7) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 7) { + whatCase_ = 0; + what_ = null; + } + sessionLogBuilder_.clear(); + } + return this; + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + public org.tensorflow.proto.SessionLog.Builder getSessionLogBuilder() { + return getSessionLogFieldBuilder().getBuilder(); + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + @java.lang.Override + public org.tensorflow.proto.SessionLogOrBuilder getSessionLogOrBuilder() { + if ((whatCase_ == 7) && (sessionLogBuilder_ != null)) { + return sessionLogBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 7) { + return (org.tensorflow.proto.SessionLog) what_; + } + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + } + /** + *
    +     * The state of the session which can be used for restarting after crashes.
    +     * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionLog, org.tensorflow.proto.SessionLog.Builder, org.tensorflow.proto.SessionLogOrBuilder> + getSessionLogFieldBuilder() { + if (sessionLogBuilder_ == null) { + if (!(whatCase_ == 7)) { + what_ = org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + sessionLogBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionLog, org.tensorflow.proto.SessionLog.Builder, org.tensorflow.proto.SessionLogOrBuilder>( + (org.tensorflow.proto.SessionLog) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 7; + onChanged(); + return sessionLogBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TaggedRunMetadata, org.tensorflow.proto.TaggedRunMetadata.Builder, org.tensorflow.proto.TaggedRunMetadataOrBuilder> taggedRunMetadataBuilder_; + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return Whether the taggedRunMetadata field is set. + */ + @java.lang.Override + public boolean hasTaggedRunMetadata() { + return whatCase_ == 8; + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return The taggedRunMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadata getTaggedRunMetadata() { + if (taggedRunMetadataBuilder_ == null) { + if (whatCase_ == 8) { + return (org.tensorflow.proto.TaggedRunMetadata) what_; + } + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } else { + if (whatCase_ == 8) { + return taggedRunMetadataBuilder_.getMessage(); + } + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + public Builder setTaggedRunMetadata(org.tensorflow.proto.TaggedRunMetadata value) { + if (taggedRunMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + what_ = value; + onChanged(); + } else { + taggedRunMetadataBuilder_.setMessage(value); + } + whatCase_ = 8; + return this; + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + public Builder setTaggedRunMetadata( + org.tensorflow.proto.TaggedRunMetadata.Builder builderForValue) { + if (taggedRunMetadataBuilder_ == null) { + what_ = builderForValue.build(); + onChanged(); + } else { + taggedRunMetadataBuilder_.setMessage(builderForValue.build()); + } + whatCase_ = 8; + return this; + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + public Builder mergeTaggedRunMetadata(org.tensorflow.proto.TaggedRunMetadata value) { + if (taggedRunMetadataBuilder_ == null) { + if (whatCase_ == 8 && + what_ != org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance()) { + what_ = org.tensorflow.proto.TaggedRunMetadata.newBuilder((org.tensorflow.proto.TaggedRunMetadata) what_) + .mergeFrom(value).buildPartial(); + } else { + what_ = value; + } + onChanged(); + } else { + if (whatCase_ == 8) { + taggedRunMetadataBuilder_.mergeFrom(value); + } else { + taggedRunMetadataBuilder_.setMessage(value); + } + } + whatCase_ = 8; + return this; + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + public Builder clearTaggedRunMetadata() { + if (taggedRunMetadataBuilder_ == null) { + if (whatCase_ == 8) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + } else { + if (whatCase_ == 8) { + whatCase_ = 0; + what_ = null; + } + taggedRunMetadataBuilder_.clear(); + } + return this; + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + public org.tensorflow.proto.TaggedRunMetadata.Builder getTaggedRunMetadataBuilder() { + return getTaggedRunMetadataFieldBuilder().getBuilder(); + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder() { + if ((whatCase_ == 8) && (taggedRunMetadataBuilder_ != null)) { + return taggedRunMetadataBuilder_.getMessageOrBuilder(); + } else { + if (whatCase_ == 8) { + return (org.tensorflow.proto.TaggedRunMetadata) what_; + } + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + } + /** + *
    +     * The metadata returned by running a session.run() call.
    +     * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TaggedRunMetadata, org.tensorflow.proto.TaggedRunMetadata.Builder, org.tensorflow.proto.TaggedRunMetadataOrBuilder> + getTaggedRunMetadataFieldBuilder() { + if (taggedRunMetadataBuilder_ == null) { + if (!(whatCase_ == 8)) { + what_ = org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + taggedRunMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TaggedRunMetadata, org.tensorflow.proto.TaggedRunMetadata.Builder, org.tensorflow.proto.TaggedRunMetadataOrBuilder>( + (org.tensorflow.proto.TaggedRunMetadata) what_, + getParentForChildren(), + isClean()); + what_ = null; + } + whatCase_ = 8; + onChanged(); + return taggedRunMetadataBuilder_; + } + + /** + *
    +     * An encoded version of a MetaGraphDef.
    +     * 
    + * + * bytes meta_graph_def = 9; + * @return Whether the metaGraphDef field is set. + */ + public boolean hasMetaGraphDef() { + return whatCase_ == 9; + } + /** + *
    +     * An encoded version of a MetaGraphDef.
    +     * 
    + * + * bytes meta_graph_def = 9; + * @return The metaGraphDef. + */ + public com.google.protobuf.ByteString getMetaGraphDef() { + if (whatCase_ == 9) { + return (com.google.protobuf.ByteString) what_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
    +     * An encoded version of a MetaGraphDef.
    +     * 
    + * + * bytes meta_graph_def = 9; + * @param value The metaGraphDef to set. + * @return This builder for chaining. + */ + public Builder setMetaGraphDef(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + whatCase_ = 9; + what_ = value; + onChanged(); + return this; + } + /** + *
    +     * An encoded version of a MetaGraphDef.
    +     * 
    + * + * bytes meta_graph_def = 9; + * @return This builder for chaining. + */ + public Builder clearMetaGraphDef() { + if (whatCase_ == 9) { + whatCase_ = 0; + what_ = null; + onChanged(); + } + return this; + } + + private org.tensorflow.proto.SourceMetadata sourceMetadata_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceMetadata, org.tensorflow.proto.SourceMetadata.Builder, org.tensorflow.proto.SourceMetadataOrBuilder> sourceMetadataBuilder_; + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return Whether the sourceMetadata field is set. + */ + public boolean hasSourceMetadata() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return The sourceMetadata. + */ + public org.tensorflow.proto.SourceMetadata getSourceMetadata() { + if (sourceMetadataBuilder_ == null) { + return sourceMetadata_ == null ? org.tensorflow.proto.SourceMetadata.getDefaultInstance() : sourceMetadata_; + } else { + return sourceMetadataBuilder_.getMessage(); + } + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public Builder setSourceMetadata(org.tensorflow.proto.SourceMetadata value) { + if (sourceMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceMetadata_ = value; + } else { + sourceMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public Builder setSourceMetadata( + org.tensorflow.proto.SourceMetadata.Builder builderForValue) { + if (sourceMetadataBuilder_ == null) { + sourceMetadata_ = builderForValue.build(); + } else { + sourceMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public Builder mergeSourceMetadata(org.tensorflow.proto.SourceMetadata value) { + if (sourceMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + sourceMetadata_ != null && + sourceMetadata_ != org.tensorflow.proto.SourceMetadata.getDefaultInstance()) { + getSourceMetadataBuilder().mergeFrom(value); + } else { + sourceMetadata_ = value; + } + } else { + sourceMetadataBuilder_.mergeFrom(value); + } + if (sourceMetadata_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public Builder clearSourceMetadata() { + bitField0_ = (bitField0_ & ~0x00000200); + sourceMetadata_ = null; + if (sourceMetadataBuilder_ != null) { + sourceMetadataBuilder_.dispose(); + sourceMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public org.tensorflow.proto.SourceMetadata.Builder getSourceMetadataBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getSourceMetadataFieldBuilder().getBuilder(); + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + public org.tensorflow.proto.SourceMetadataOrBuilder getSourceMetadataOrBuilder() { + if (sourceMetadataBuilder_ != null) { + return sourceMetadataBuilder_.getMessageOrBuilder(); + } else { + return sourceMetadata_ == null ? + org.tensorflow.proto.SourceMetadata.getDefaultInstance() : sourceMetadata_; + } + } + /** + *
    +     * Information of the source that writes the events, this is only logged in
    +     * the very first event along with the `file_version` field.
    +     * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceMetadata, org.tensorflow.proto.SourceMetadata.Builder, org.tensorflow.proto.SourceMetadataOrBuilder> + getSourceMetadataFieldBuilder() { + if (sourceMetadataBuilder_ == null) { + sourceMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SourceMetadata, org.tensorflow.proto.SourceMetadata.Builder, org.tensorflow.proto.SourceMetadataOrBuilder>( + getSourceMetadata(), + getParentForChildren(), + isClean()); + sourceMetadata_ = null; + } + return sourceMetadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Event) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Event) + private static final org.tensorflow.proto.Event DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Event(); + } + + public static org.tensorflow.proto.Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Event parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Event getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventOrBuilder.java new file mode 100644 index 00000000000..61a590cfd66 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventOrBuilder.java @@ -0,0 +1,257 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface EventOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.Event) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Timestamp of the event.
    +   * 
    + * + * double wall_time = 1; + * @return The wallTime. + */ + double getWallTime(); + + /** + *
    +   * Global step of the event.
    +   * 
    + * + * int64 step = 2; + * @return The step. + */ + long getStep(); + + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return Whether the fileVersion field is set. + */ + boolean hasFileVersion(); + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return The fileVersion. + */ + java.lang.String getFileVersion(); + /** + *
    +   * An event file was started, with the specified version.
    +   * This is use to identify the contents of the record IO files
    +   * easily.  Current version is "brain.Event:2".  All versions
    +   * start with "brain.Event:".
    +   * 
    + * + * string file_version = 3; + * @return The bytes for fileVersion. + */ + com.google.protobuf.ByteString + getFileVersionBytes(); + + /** + *
    +   * An encoded version of a GraphDef.
    +   * 
    + * + * bytes graph_def = 4; + * @return Whether the graphDef field is set. + */ + boolean hasGraphDef(); + /** + *
    +   * An encoded version of a GraphDef.
    +   * 
    + * + * bytes graph_def = 4; + * @return The graphDef. + */ + com.google.protobuf.ByteString getGraphDef(); + + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + * @return Whether the summary field is set. + */ + boolean hasSummary(); + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + * @return The summary. + */ + org.tensorflow.proto.Summary getSummary(); + /** + *
    +   * A summary was generated.
    +   * 
    + * + * .tensorflow.Summary summary = 5; + */ + org.tensorflow.proto.SummaryOrBuilder getSummaryOrBuilder(); + + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return Whether the logMessage field is set. + */ + @java.lang.Deprecated boolean hasLogMessage(); + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + * @deprecated tensorflow.Event.log_message is deprecated. + * See tensorflow/core/util/event.proto;l=34 + * @return The logMessage. + */ + @java.lang.Deprecated org.tensorflow.proto.LogMessage getLogMessage(); + /** + *
    +   * The user output a log message. This was theoretically used by the defunct
    +   * tensorboard_logging module, which has since been removed; this field is
    +   * now deprecated and should not be used.
    +   * 
    + * + * .tensorflow.LogMessage log_message = 6 [deprecated = true]; + */ + @java.lang.Deprecated org.tensorflow.proto.LogMessageOrBuilder getLogMessageOrBuilder(); + + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return Whether the sessionLog field is set. + */ + boolean hasSessionLog(); + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + * @return The sessionLog. + */ + org.tensorflow.proto.SessionLog getSessionLog(); + /** + *
    +   * The state of the session which can be used for restarting after crashes.
    +   * 
    + * + * .tensorflow.SessionLog session_log = 7; + */ + org.tensorflow.proto.SessionLogOrBuilder getSessionLogOrBuilder(); + + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return Whether the taggedRunMetadata field is set. + */ + boolean hasTaggedRunMetadata(); + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + * @return The taggedRunMetadata. + */ + org.tensorflow.proto.TaggedRunMetadata getTaggedRunMetadata(); + /** + *
    +   * The metadata returned by running a session.run() call.
    +   * 
    + * + * .tensorflow.TaggedRunMetadata tagged_run_metadata = 8; + */ + org.tensorflow.proto.TaggedRunMetadataOrBuilder getTaggedRunMetadataOrBuilder(); + + /** + *
    +   * An encoded version of a MetaGraphDef.
    +   * 
    + * + * bytes meta_graph_def = 9; + * @return Whether the metaGraphDef field is set. + */ + boolean hasMetaGraphDef(); + /** + *
    +   * An encoded version of a MetaGraphDef.
    +   * 
    + * + * bytes meta_graph_def = 9; + * @return The metaGraphDef. + */ + com.google.protobuf.ByteString getMetaGraphDef(); + + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return Whether the sourceMetadata field is set. + */ + boolean hasSourceMetadata(); + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + * @return The sourceMetadata. + */ + org.tensorflow.proto.SourceMetadata getSourceMetadata(); + /** + *
    +   * Information of the source that writes the events, this is only logged in
    +   * the very first event along with the `file_version` field.
    +   * 
    + * + * .tensorflow.SourceMetadata source_metadata = 10; + */ + org.tensorflow.proto.SourceMetadataOrBuilder getSourceMetadataOrBuilder(); + + org.tensorflow.proto.Event.WhatCase getWhatCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventProtos.java new file mode 100644 index 00000000000..ec026ec2e7f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/EventProtos.java @@ -0,0 +1,188 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class EventProtos { + private EventProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + EventProtos.class.getName()); + } + 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_Event_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_Event_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SourceMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SourceMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_LogMessage_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_LogMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SessionLog_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SessionLog_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TaggedRunMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_WatchdogConfig_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_WatchdogConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RequestedExitCode_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RequestedExitCode_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_WorkerHeartbeatRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_WorkerHeartbeatResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_WorkerHeartbeatResponse_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/util/event.proto\022\ntens" + + "orflow\032\'tensorflow/core/framework/summar" + + "y.proto\"\364\002\n\005Event\022\021\n\twall_time\030\001 \001(\001\022\014\n\004" + + "step\030\002 \001(\003\022\026\n\014file_version\030\003 \001(\tH\000\022\023\n\tgr" + + "aph_def\030\004 \001(\014H\000\022&\n\007summary\030\005 \001(\0132\023.tenso" + + "rflow.SummaryH\000\0221\n\013log_message\030\006 \001(\0132\026.t" + + "ensorflow.LogMessageB\002\030\001H\000\022-\n\013session_lo" + + "g\030\007 \001(\0132\026.tensorflow.SessionLogH\000\022<\n\023tag" + + "ged_run_metadata\030\010 \001(\0132\035.tensorflow.Tagg" + + "edRunMetadataH\000\022\030\n\016meta_graph_def\030\t \001(\014H" + + "\000\0223\n\017source_metadata\030\n \001(\0132\032.tensorflow." + + "SourceMetadataB\006\n\004what\" \n\016SourceMetadata" + + "\022\016\n\006writer\030\001 \001(\t\"\241\001\n\nLogMessage\022+\n\005level" + + "\030\001 \001(\0162\034.tensorflow.LogMessage.Level\022\017\n\007" + + "message\030\002 \001(\t\"Q\n\005Level\022\013\n\007UNKNOWN\020\000\022\r\n\tD" + + "EBUGGING\020\n\022\010\n\004INFO\020\024\022\010\n\004WARN\020\036\022\t\n\005ERROR\020" + + "(\022\t\n\005FATAL\0202\032\002\030\001:\002\030\001\"\266\001\n\nSessionLog\0224\n\006s" + + "tatus\030\001 \001(\0162$.tensorflow.SessionLog.Sess" + + "ionStatus\022\027\n\017checkpoint_path\030\002 \001(\t\022\013\n\003ms" + + "g\030\003 \001(\t\"L\n\rSessionStatus\022\026\n\022STATUS_UNSPE" + + "CIFIED\020\000\022\t\n\005START\020\001\022\010\n\004STOP\020\002\022\016\n\nCHECKPO" + + "INT\020\003\"6\n\021TaggedRunMetadata\022\013\n\003tag\030\001 \001(\t\022" + + "\024\n\014run_metadata\030\002 \001(\014\"$\n\016WatchdogConfig\022" + + "\022\n\ntimeout_ms\030\001 \001(\003\"&\n\021RequestedExitCode" + + "\022\021\n\texit_code\030\001 \001(\005\"\266\001\n\026WorkerHeartbeatR" + + "equest\0225\n\rshutdown_mode\030\001 \001(\0162\036.tensorfl" + + "ow.WorkerShutdownMode\0223\n\017watchdog_config" + + "\030\002 \001(\0132\032.tensorflow.WatchdogConfig\0220\n\tex" + + "it_code\030\003 \001(\0132\035.tensorflow.RequestedExit" + + "Code\"\203\001\n\027WorkerHeartbeatResponse\022/\n\rheal" + + "th_status\030\001 \001(\0162\030.tensorflow.WorkerHealt" + + "h\022%\n\nworker_log\030\002 \003(\0132\021.tensorflow.Event" + + "\022\020\n\010hostname\030\003 \001(\t*[\n\014WorkerHealth\022\006\n\002OK" + + "\020\000\022\034\n\030RECEIVED_SHUTDOWN_SIGNAL\020\001\022\022\n\016INTE" + + "RNAL_ERROR\020\002\022\021\n\rSHUTTING_DOWN\020\003*k\n\022Worke" + + "rShutdownMode\022\013\n\007DEFAULT\020\000\022\022\n\016NOT_CONFIG" + + "URED\020\001\022\030\n\024WAIT_FOR_COORDINATOR\020\002\022\032\n\026SHUT" + + "DOWN_AFTER_TIMEOUT\020\003Bq\n\024org.tensorflow.p" + + "rotoB\013EventProtosP\001ZGgithub.com/tensorfl" + + "ow/tensorflow/tensorflow/go/core/util/ev" + + "ent_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.SummaryProtos.getDescriptor(), + }); + internal_static_tensorflow_Event_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_Event_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_Event_descriptor, + new java.lang.String[] { "WallTime", "Step", "FileVersion", "GraphDef", "Summary", "LogMessage", "SessionLog", "TaggedRunMetadata", "MetaGraphDef", "SourceMetadata", "What", }); + internal_static_tensorflow_SourceMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_SourceMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SourceMetadata_descriptor, + new java.lang.String[] { "Writer", }); + internal_static_tensorflow_LogMessage_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_LogMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_LogMessage_descriptor, + new java.lang.String[] { "Level", "Message", }); + internal_static_tensorflow_SessionLog_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_SessionLog_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SessionLog_descriptor, + new java.lang.String[] { "Status", "CheckpointPath", "Msg", }); + internal_static_tensorflow_TaggedRunMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TaggedRunMetadata_descriptor, + new java.lang.String[] { "Tag", "RunMetadata", }); + internal_static_tensorflow_WatchdogConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_WatchdogConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_WatchdogConfig_descriptor, + new java.lang.String[] { "TimeoutMs", }); + internal_static_tensorflow_RequestedExitCode_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_RequestedExitCode_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RequestedExitCode_descriptor, + new java.lang.String[] { "ExitCode", }); + internal_static_tensorflow_WorkerHeartbeatRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_WorkerHeartbeatRequest_descriptor, + new java.lang.String[] { "ShutdownMode", "WatchdogConfig", "ExitCode", }); + internal_static_tensorflow_WorkerHeartbeatResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_WorkerHeartbeatResponse_descriptor, + new java.lang.String[] { "HealthStatus", "WorkerLog", "Hostname", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.SummaryProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Example.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Example.java new file mode 100644 index 00000000000..4f1f03853ec --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Example.java @@ -0,0 +1,558 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.Example} + */ +public final class Example extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Example) + ExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Example.class.getName()); + } + // Use Example.newBuilder() to construct. + private Example(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Example() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Example.class, org.tensorflow.proto.Example.Builder.class); + } + + private int bitField0_; + public static final int FEATURES_FIELD_NUMBER = 1; + private org.tensorflow.proto.Features features_; + /** + * .tensorflow.Features features = 1; + * @return Whether the features field is set. + */ + @java.lang.Override + public boolean hasFeatures() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.Features features = 1; + * @return The features. + */ + @java.lang.Override + public org.tensorflow.proto.Features getFeatures() { + return features_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : features_; + } + /** + * .tensorflow.Features features = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeaturesOrBuilder getFeaturesOrBuilder() { + return features_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : features_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getFeatures()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getFeatures()); + } + size += getUnknownFields().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.Example)) { + return super.equals(obj); + } + org.tensorflow.proto.Example other = (org.tensorflow.proto.Example) obj; + + if (hasFeatures() != other.hasFeatures()) return false; + if (hasFeatures()) { + if (!getFeatures() + .equals(other.getFeatures())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFeatures()) { + hash = (37 * hash) + FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getFeatures().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Example parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Example 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.Example parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Example 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.Example parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Example parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Example parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Example parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Example parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Example parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Example parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Example parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Example 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.Example} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Example) + org.tensorflow.proto.ExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_Example_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_Example_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Example.class, org.tensorflow.proto.Example.Builder.class); + } + + // Construct using org.tensorflow.proto.Example.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFeaturesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + features_ = null; + if (featuresBuilder_ != null) { + featuresBuilder_.dispose(); + featuresBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_Example_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Example getDefaultInstanceForType() { + return org.tensorflow.proto.Example.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Example build() { + org.tensorflow.proto.Example result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Example buildPartial() { + org.tensorflow.proto.Example result = new org.tensorflow.proto.Example(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Example result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.features_ = featuresBuilder_ == null + ? features_ + : featuresBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Example) { + return mergeFrom((org.tensorflow.proto.Example)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Example other) { + if (other == org.tensorflow.proto.Example.getDefaultInstance()) return this; + if (other.hasFeatures()) { + mergeFeatures(other.getFeatures()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getFeaturesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.Features features_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder> featuresBuilder_; + /** + * .tensorflow.Features features = 1; + * @return Whether the features field is set. + */ + public boolean hasFeatures() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.Features features = 1; + * @return The features. + */ + public org.tensorflow.proto.Features getFeatures() { + if (featuresBuilder_ == null) { + return features_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : features_; + } else { + return featuresBuilder_.getMessage(); + } + } + /** + * .tensorflow.Features features = 1; + */ + public Builder setFeatures(org.tensorflow.proto.Features value) { + if (featuresBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + features_ = value; + } else { + featuresBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.Features features = 1; + */ + public Builder setFeatures( + org.tensorflow.proto.Features.Builder builderForValue) { + if (featuresBuilder_ == null) { + features_ = builderForValue.build(); + } else { + featuresBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.Features features = 1; + */ + public Builder mergeFeatures(org.tensorflow.proto.Features value) { + if (featuresBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + features_ != null && + features_ != org.tensorflow.proto.Features.getDefaultInstance()) { + getFeaturesBuilder().mergeFrom(value); + } else { + features_ = value; + } + } else { + featuresBuilder_.mergeFrom(value); + } + if (features_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.Features features = 1; + */ + public Builder clearFeatures() { + bitField0_ = (bitField0_ & ~0x00000001); + features_ = null; + if (featuresBuilder_ != null) { + featuresBuilder_.dispose(); + featuresBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.Features features = 1; + */ + public org.tensorflow.proto.Features.Builder getFeaturesBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getFeaturesFieldBuilder().getBuilder(); + } + /** + * .tensorflow.Features features = 1; + */ + public org.tensorflow.proto.FeaturesOrBuilder getFeaturesOrBuilder() { + if (featuresBuilder_ != null) { + return featuresBuilder_.getMessageOrBuilder(); + } else { + return features_ == null ? + org.tensorflow.proto.Features.getDefaultInstance() : features_; + } + } + /** + * .tensorflow.Features features = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder> + getFeaturesFieldBuilder() { + if (featuresBuilder_ == null) { + featuresBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder>( + getFeatures(), + getParentForChildren(), + isClean()); + features_ = null; + } + return featuresBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Example) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Example) + private static final org.tensorflow.proto.Example DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Example(); + } + + public static org.tensorflow.proto.Example getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Example parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Example getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleOrBuilder.java new file mode 100644 index 00000000000..090e50da446 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.Example) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.Features features = 1; + * @return Whether the features field is set. + */ + boolean hasFeatures(); + /** + * .tensorflow.Features features = 1; + * @return The features. + */ + org.tensorflow.proto.Features getFeatures(); + /** + * .tensorflow.Features features = 1; + */ + org.tensorflow.proto.FeaturesOrBuilder getFeaturesOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfiguration.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfiguration.java new file mode 100644 index 00000000000..a74f6f6df59 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfiguration.java @@ -0,0 +1,671 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.ExampleParserConfiguration} + */ +public final class ExampleParserConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ExampleParserConfiguration) + ExampleParserConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ExampleParserConfiguration.class.getName()); + } + // Use ExampleParserConfiguration.newBuilder() to construct. + private ExampleParserConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ExampleParserConfiguration() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFeatureMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ExampleParserConfiguration.class, org.tensorflow.proto.ExampleParserConfiguration.Builder.class); + } + + public static final int FEATURE_MAP_FIELD_NUMBER = 1; + private static final class FeatureMapDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.FeatureConfiguration> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.FeatureConfiguration.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.FeatureConfiguration> featureMap_; + private com.google.protobuf.MapField + internalGetFeatureMap() { + if (featureMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeatureMapDefaultEntryHolder.defaultEntry); + } + return featureMap_; + } + public int getFeatureMapCount() { + return internalGetFeatureMap().getMap().size(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public boolean containsFeatureMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeatureMap().getMap().containsKey(key); + } + /** + * Use {@link #getFeatureMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeatureMap() { + return getFeatureMapMap(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public java.util.Map getFeatureMapMap() { + return internalGetFeatureMap().getMap(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FeatureConfiguration getFeatureMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.FeatureConfiguration defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeatureMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration getFeatureMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeatureMap().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFeatureMap(), + FeatureMapDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetFeatureMap().getMap().entrySet()) { + com.google.protobuf.MapEntry + featureMap__ = FeatureMapDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, featureMap__); + } + size += getUnknownFields().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.ExampleParserConfiguration)) { + return super.equals(obj); + } + org.tensorflow.proto.ExampleParserConfiguration other = (org.tensorflow.proto.ExampleParserConfiguration) obj; + + if (!internalGetFeatureMap().equals( + other.internalGetFeatureMap())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFeatureMap().getMap().isEmpty()) { + hash = (37 * hash) + FEATURE_MAP_FIELD_NUMBER; + hash = (53 * hash) + internalGetFeatureMap().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ExampleParserConfiguration 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.ExampleParserConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ExampleParserConfiguration 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.ExampleParserConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ExampleParserConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ExampleParserConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ExampleParserConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ExampleParserConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ExampleParserConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ExampleParserConfiguration) + org.tensorflow.proto.ExampleParserConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFeatureMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableFeatureMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ExampleParserConfiguration.class, org.tensorflow.proto.ExampleParserConfiguration.Builder.class); + } + + // Construct using org.tensorflow.proto.ExampleParserConfiguration.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableFeatureMap().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_ExampleParserConfiguration_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ExampleParserConfiguration getDefaultInstanceForType() { + return org.tensorflow.proto.ExampleParserConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ExampleParserConfiguration build() { + org.tensorflow.proto.ExampleParserConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ExampleParserConfiguration buildPartial() { + org.tensorflow.proto.ExampleParserConfiguration result = new org.tensorflow.proto.ExampleParserConfiguration(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ExampleParserConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.featureMap_ = internalGetFeatureMap().build(FeatureMapDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ExampleParserConfiguration) { + return mergeFrom((org.tensorflow.proto.ExampleParserConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ExampleParserConfiguration other) { + if (other == org.tensorflow.proto.ExampleParserConfiguration.getDefaultInstance()) return this; + internalGetMutableFeatureMap().mergeFrom( + other.internalGetFeatureMap()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + featureMap__ = input.readMessage( + FeatureMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFeatureMap().ensureBuilderMap().put( + featureMap__.getKey(), featureMap__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class FeatureMapConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration build(org.tensorflow.proto.FeatureConfigurationOrBuilder val) { + if (val instanceof org.tensorflow.proto.FeatureConfiguration) { return (org.tensorflow.proto.FeatureConfiguration) val; } + return ((org.tensorflow.proto.FeatureConfiguration.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FeatureMapDefaultEntryHolder.defaultEntry; + } + }; + private static final FeatureMapConverter featureMapConverter = new FeatureMapConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.FeatureConfigurationOrBuilder, org.tensorflow.proto.FeatureConfiguration, org.tensorflow.proto.FeatureConfiguration.Builder> featureMap_; + private com.google.protobuf.MapFieldBuilder + internalGetFeatureMap() { + if (featureMap_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(featureMapConverter); + } + return featureMap_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFeatureMap() { + if (featureMap_ == null) { + featureMap_ = new com.google.protobuf.MapFieldBuilder<>(featureMapConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return featureMap_; + } + public int getFeatureMapCount() { + return internalGetFeatureMap().ensureBuilderMap().size(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public boolean containsFeatureMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeatureMap().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFeatureMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeatureMap() { + return getFeatureMapMap(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public java.util.Map getFeatureMapMap() { + return internalGetFeatureMap().getImmutableMap(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FeatureConfiguration getFeatureMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.FeatureConfiguration defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeatureMap().ensureBuilderMap(); + return map.containsKey(key) ? featureMapConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration getFeatureMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeatureMap().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return featureMapConverter.build(map.get(key)); + } + public Builder clearFeatureMap() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableFeatureMap().clear(); + return this; + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + public Builder removeFeatureMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFeatureMap().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFeatureMap() { + bitField0_ |= 0x00000001; + return internalGetMutableFeatureMap().ensureMessageMap(); + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + public Builder putFeatureMap( + java.lang.String key, + org.tensorflow.proto.FeatureConfiguration value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFeatureMap().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + public Builder putAllFeatureMap( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFeatureMap().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + public org.tensorflow.proto.FeatureConfiguration.Builder putFeatureMapBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableFeatureMap().ensureBuilderMap(); + org.tensorflow.proto.FeatureConfigurationOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.FeatureConfiguration.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.FeatureConfiguration) { + entry = ((org.tensorflow.proto.FeatureConfiguration) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.FeatureConfiguration.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ExampleParserConfiguration) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ExampleParserConfiguration) + private static final org.tensorflow.proto.ExampleParserConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ExampleParserConfiguration(); + } + + public static org.tensorflow.proto.ExampleParserConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExampleParserConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ExampleParserConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationOrBuilder.java new file mode 100644 index 00000000000..1f35e0642bc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ExampleParserConfigurationOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ExampleParserConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + int getFeatureMapCount(); + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + boolean containsFeatureMap( + java.lang.String key); + /** + * Use {@link #getFeatureMapMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFeatureMap(); + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + java.util.Map + getFeatureMapMap(); + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + /* nullable */ +org.tensorflow.proto.FeatureConfiguration getFeatureMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.FeatureConfiguration defaultValue); + /** + * map<string, .tensorflow.FeatureConfiguration> feature_map = 1; + */ + org.tensorflow.proto.FeatureConfiguration getFeatureMapOrThrow( + java.lang.String key); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationProtos.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationProtos.java index 9bc45ea35c4..4d14ee3d4b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/ExampleParserConfigurationProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleParserConfigurationProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.example; +package org.tensorflow.proto; public final class ExampleParserConfigurationProtos { private ExampleParserConfigurationProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ExampleParserConfigurationProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,27 +28,27 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_VarLenFeatureProto_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_FixedLenFeatureProto_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_FeatureConfiguration_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ExampleParserConfiguration_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -70,53 +81,53 @@ public static void registerAllExtensions( "(\01326.tensorflow.ExampleParserConfigurati" + "on.FeatureMapEntry\032S\n\017FeatureMapEntry\022\013\n" + "\003key\030\001 \001(\t\022/\n\005value\030\002 \001(\0132 .tensorflow.F" + - "eatureConfiguration:\0028\001B\250\001\n\034org.tensorfl" + - "ow.proto.exampleB ExampleParserConfigura" + - "tionProtosP\001Zagithub.com/tensorflow/tens" + - "orflow/tensorflow/go/core/example/exampl" + - "e_parser_configuration_go_proto\370\001\001b\006prot" + - "o3" + "eatureConfiguration:\0028\001B\240\001\n\024org.tensorfl" + + "ow.protoB ExampleParserConfigurationProt" + + "osP\001Zagithub.com/tensorflow/tensorflow/t" + + "ensorflow/go/core/example/example_parser" + + "_configuration_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(), - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), }); internal_static_tensorflow_VarLenFeatureProto_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_VarLenFeatureProto_descriptor, new java.lang.String[] { "Dtype", "ValuesOutputTensorName", "IndicesOutputTensorName", "ShapesOutputTensorName", }); internal_static_tensorflow_FixedLenFeatureProto_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_FixedLenFeatureProto_descriptor, new java.lang.String[] { "Dtype", "Shape", "DefaultValue", "ValuesOutputTensorName", }); internal_static_tensorflow_FeatureConfiguration_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_FeatureConfiguration_descriptor, new java.lang.String[] { "FixedLenFeature", "VarLenFeature", "Config", }); internal_static_tensorflow_ExampleParserConfiguration_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_ExampleParserConfiguration_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ExampleParserConfiguration_descriptor, new java.lang.String[] { "FeatureMap", }); internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_descriptor = internal_static_tensorflow_ExampleParserConfiguration_descriptor.getNestedTypes().get(0); internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_ExampleParserConfiguration_FeatureMapEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - org.tensorflow.proto.framework.TensorProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorShapeProtos.getDescriptor(); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleProtos.java new file mode 100644 index 00000000000..46f3017c277 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExampleProtos.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ExampleProtos { + private ExampleProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ExampleProtos.class.getName()); + } + 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_Example_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_Example_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SequenceExample_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SequenceExample_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/example/example.proto\022" + + "\ntensorflow\032%tensorflow/core/example/fea" + + "ture.proto\"1\n\007Example\022&\n\010features\030\001 \001(\0132" + + "\024.tensorflow.Features\"i\n\017SequenceExample" + + "\022%\n\007context\030\001 \001(\0132\024.tensorflow.Features\022" + + "/\n\rfeature_lists\030\002 \001(\0132\030.tensorflow.Feat" + + "ureListsB\177\n\024org.tensorflow.protoB\rExampl" + + "eProtosP\001ZSgithub.com/tensorflow/tensorf" + + "low/tensorflow/go/core/example/example_p" + + "rotos_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.FeatureProtos.getDescriptor(), + }); + internal_static_tensorflow_Example_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_Example_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_Example_descriptor, + new java.lang.String[] { "Features", }); + internal_static_tensorflow_SequenceExample_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_SequenceExample_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SequenceExample_descriptor, + new java.lang.String[] { "Context", "FeatureLists", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.FeatureProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Execution.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Execution.java new file mode 100644 index 00000000000..46793096670 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Execution.java @@ -0,0 +1,2307 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Data relating to the eager execution of an op or a Graph.
    + * For a op that generates N output tensors (N >= 0), only one
    + * Execution proto will be used to describe the execution event.
    + * 
    + * + * Protobuf type {@code tensorflow.Execution} + */ +public final class Execution extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Execution) + ExecutionOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Execution.class.getName()); + } + // Use Execution.newBuilder() to construct. + private Execution(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Execution() { + opType_ = ""; + graphId_ = ""; + inputTensorIds_ = emptyLongList(); + outputTensorIds_ = emptyLongList(); + tensorDebugMode_ = 0; + tensorProtos_ = java.util.Collections.emptyList(); + outputTensorDeviceIds_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Execution.class, org.tensorflow.proto.Execution.Builder.class); + } + + private int bitField0_; + public static final int OP_TYPE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object opType_ = ""; + /** + *
    +   * Op type (e.g., "MatMul").
    +   * In the case of a Graph, this is the name of the Graph.
    +   * 
    + * + * string op_type = 1; + * @return The opType. + */ + @java.lang.Override + public java.lang.String getOpType() { + java.lang.Object ref = opType_; + 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(); + opType_ = s; + return s; + } + } + /** + *
    +   * Op type (e.g., "MatMul").
    +   * In the case of a Graph, this is the name of the Graph.
    +   * 
    + * + * string op_type = 1; + * @return The bytes for opType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpTypeBytes() { + java.lang.Object ref = opType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUM_OUTPUTS_FIELD_NUMBER = 2; + private int numOutputs_ = 0; + /** + *
    +   * Number of output tensors.
    +   * 
    + * + * int32 num_outputs = 2; + * @return The numOutputs. + */ + @java.lang.Override + public int getNumOutputs() { + return numOutputs_; + } + + public static final int GRAPH_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object graphId_ = ""; + /** + *
    +   * The graph that's executed: applicable only to the eager
    +   * execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 3; + * @return The graphId. + */ + @java.lang.Override + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + 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(); + graphId_ = s; + return s; + } + } + /** + *
    +   * The graph that's executed: applicable only to the eager
    +   * execution of a FuncGraph.
    +   * 
    + * + * string graph_id = 3; + * @return The bytes for graphId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_TENSOR_IDS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList inputTensorIds_ = + emptyLongList(); + /** + *
    +   * IDs of the input tensors (if available).
    +   * 
    + * + * repeated int64 input_tensor_ids = 4; + * @return A list containing the inputTensorIds. + */ + @java.lang.Override + public java.util.List + getInputTensorIdsList() { + return inputTensorIds_; + } + /** + *
    +   * IDs of the input tensors (if available).
    +   * 
    + * + * repeated int64 input_tensor_ids = 4; + * @return The count of inputTensorIds. + */ + public int getInputTensorIdsCount() { + return inputTensorIds_.size(); + } + /** + *
    +   * IDs of the input tensors (if available).
    +   * 
    + * + * repeated int64 input_tensor_ids = 4; + * @param index The index of the element to return. + * @return The inputTensorIds at the given index. + */ + public long getInputTensorIds(int index) { + return inputTensorIds_.getLong(index); + } + private int inputTensorIdsMemoizedSerializedSize = -1; + + public static final int OUTPUT_TENSOR_IDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList outputTensorIds_ = + emptyLongList(); + /** + *
    +   * IDs of the output tensors (if availbable).
    +   * If specified, must have the same length as tensor_protos.
    +   * 
    + * + * repeated int64 output_tensor_ids = 5; + * @return A list containing the outputTensorIds. + */ + @java.lang.Override + public java.util.List + getOutputTensorIdsList() { + return outputTensorIds_; + } + /** + *
    +   * IDs of the output tensors (if availbable).
    +   * If specified, must have the same length as tensor_protos.
    +   * 
    + * + * repeated int64 output_tensor_ids = 5; + * @return The count of outputTensorIds. + */ + public int getOutputTensorIdsCount() { + return outputTensorIds_.size(); + } + /** + *
    +   * IDs of the output tensors (if availbable).
    +   * If specified, must have the same length as tensor_protos.
    +   * 
    + * + * repeated int64 output_tensor_ids = 5; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. + */ + public long getOutputTensorIds(int index) { + return outputTensorIds_.getLong(index); + } + private int outputTensorIdsMemoizedSerializedSize = -1; + + public static final int TENSOR_DEBUG_MODE_FIELD_NUMBER = 6; + private int tensorDebugMode_ = 0; + /** + *
    +   * Type of the tensor value encapsulated in this proto.
    +   * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The enum numeric value on the wire for tensorDebugMode. + */ + @java.lang.Override public int getTensorDebugModeValue() { + return tensorDebugMode_; + } + /** + *
    +   * Type of the tensor value encapsulated in this proto.
    +   * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The tensorDebugMode. + */ + @java.lang.Override public org.tensorflow.proto.TensorDebugMode getTensorDebugMode() { + org.tensorflow.proto.TensorDebugMode result = org.tensorflow.proto.TensorDebugMode.forNumber(tensorDebugMode_); + return result == null ? org.tensorflow.proto.TensorDebugMode.UNRECOGNIZED : result; + } + + public static final int TENSOR_PROTOS_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List tensorProtos_; + /** + *
    +   * Output Tensor values in the type described by `tensor_value_type`.
    +   * The length of this should match `num_outputs`.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + @java.lang.Override + public java.util.List getTensorProtosList() { + return tensorProtos_; + } + /** + *
    +   * Output Tensor values in the type described by `tensor_value_type`.
    +   * The length of this should match `num_outputs`.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + @java.lang.Override + public java.util.List + getTensorProtosOrBuilderList() { + return tensorProtos_; + } + /** + *
    +   * Output Tensor values in the type described by `tensor_value_type`.
    +   * The length of this should match `num_outputs`.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + @java.lang.Override + public int getTensorProtosCount() { + return tensorProtos_.size(); + } + /** + *
    +   * Output Tensor values in the type described by `tensor_value_type`.
    +   * The length of this should match `num_outputs`.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensorProtos(int index) { + return tensorProtos_.get(index); + } + /** + *
    +   * Output Tensor values in the type described by `tensor_value_type`.
    +   * The length of this should match `num_outputs`.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorProtosOrBuilder( + int index) { + return tensorProtos_.get(index); + } + + public static final int CODE_LOCATION_FIELD_NUMBER = 8; + private org.tensorflow.proto.CodeLocation codeLocation_; + /** + *
    +   * Stack trace of the eager execution.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. + */ + @java.lang.Override + public boolean hasCodeLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Stack trace of the eager execution.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. + */ + @java.lang.Override + public org.tensorflow.proto.CodeLocation getCodeLocation() { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + /** + *
    +   * Stack trace of the eager execution.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + @java.lang.Override + public org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder() { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + + public static final int OUTPUT_TENSOR_DEVICE_IDS_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList outputTensorDeviceIds_ = + emptyIntList(); + /** + *
    +   * Debugged-generated IDs of the devices on which the output tensors reside.
    +   * To look up details about the device (e.g., name), cross-reference this
    +   * field with the DebuggedDevice messages.
    +   * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @return A list containing the outputTensorDeviceIds. + */ + @java.lang.Override + public java.util.List + getOutputTensorDeviceIdsList() { + return outputTensorDeviceIds_; + } + /** + *
    +   * Debugged-generated IDs of the devices on which the output tensors reside.
    +   * To look up details about the device (e.g., name), cross-reference this
    +   * field with the DebuggedDevice messages.
    +   * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @return The count of outputTensorDeviceIds. + */ + public int getOutputTensorDeviceIdsCount() { + return outputTensorDeviceIds_.size(); + } + /** + *
    +   * Debugged-generated IDs of the devices on which the output tensors reside.
    +   * To look up details about the device (e.g., name), cross-reference this
    +   * field with the DebuggedDevice messages.
    +   * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorDeviceIds at the given index. + */ + public int getOutputTensorDeviceIds(int index) { + return outputTensorDeviceIds_.getInt(index); + } + private int outputTensorDeviceIdsMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, opType_); + } + if (numOutputs_ != 0) { + output.writeInt32(2, numOutputs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, graphId_); + } + if (getInputTensorIdsList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(inputTensorIdsMemoizedSerializedSize); + } + for (int i = 0; i < inputTensorIds_.size(); i++) { + output.writeInt64NoTag(inputTensorIds_.getLong(i)); + } + if (getOutputTensorIdsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(outputTensorIdsMemoizedSerializedSize); + } + for (int i = 0; i < outputTensorIds_.size(); i++) { + output.writeInt64NoTag(outputTensorIds_.getLong(i)); + } + if (tensorDebugMode_ != org.tensorflow.proto.TensorDebugMode.UNSPECIFIED.getNumber()) { + output.writeEnum(6, tensorDebugMode_); + } + for (int i = 0; i < tensorProtos_.size(); i++) { + output.writeMessage(7, tensorProtos_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getCodeLocation()); + } + if (getOutputTensorDeviceIdsList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(outputTensorDeviceIdsMemoizedSerializedSize); + } + for (int i = 0; i < outputTensorDeviceIds_.size(); i++) { + output.writeInt32NoTag(outputTensorDeviceIds_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, opType_); + } + if (numOutputs_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, numOutputs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, graphId_); + } + { + int dataSize = 0; + for (int i = 0; i < inputTensorIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(inputTensorIds_.getLong(i)); + } + size += dataSize; + if (!getInputTensorIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + inputTensorIdsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < outputTensorIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(outputTensorIds_.getLong(i)); + } + size += dataSize; + if (!getOutputTensorIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + outputTensorIdsMemoizedSerializedSize = dataSize; + } + if (tensorDebugMode_ != org.tensorflow.proto.TensorDebugMode.UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, tensorDebugMode_); + } + for (int i = 0; i < tensorProtos_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, tensorProtos_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getCodeLocation()); + } + { + int dataSize = 0; + for (int i = 0; i < outputTensorDeviceIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(outputTensorDeviceIds_.getInt(i)); + } + size += dataSize; + if (!getOutputTensorDeviceIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + outputTensorDeviceIdsMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.Execution)) { + return super.equals(obj); + } + org.tensorflow.proto.Execution other = (org.tensorflow.proto.Execution) obj; + + if (!getOpType() + .equals(other.getOpType())) return false; + if (getNumOutputs() + != other.getNumOutputs()) return false; + if (!getGraphId() + .equals(other.getGraphId())) return false; + if (!getInputTensorIdsList() + .equals(other.getInputTensorIdsList())) return false; + if (!getOutputTensorIdsList() + .equals(other.getOutputTensorIdsList())) return false; + if (tensorDebugMode_ != other.tensorDebugMode_) return false; + if (!getTensorProtosList() + .equals(other.getTensorProtosList())) return false; + if (hasCodeLocation() != other.hasCodeLocation()) return false; + if (hasCodeLocation()) { + if (!getCodeLocation() + .equals(other.getCodeLocation())) return false; + } + if (!getOutputTensorDeviceIdsList() + .equals(other.getOutputTensorDeviceIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getOpType().hashCode(); + hash = (37 * hash) + NUM_OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getNumOutputs(); + hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; + hash = (53 * hash) + getGraphId().hashCode(); + if (getInputTensorIdsCount() > 0) { + hash = (37 * hash) + INPUT_TENSOR_IDS_FIELD_NUMBER; + hash = (53 * hash) + getInputTensorIdsList().hashCode(); + } + if (getOutputTensorIdsCount() > 0) { + hash = (37 * hash) + OUTPUT_TENSOR_IDS_FIELD_NUMBER; + hash = (53 * hash) + getOutputTensorIdsList().hashCode(); + } + hash = (37 * hash) + TENSOR_DEBUG_MODE_FIELD_NUMBER; + hash = (53 * hash) + tensorDebugMode_; + if (getTensorProtosCount() > 0) { + hash = (37 * hash) + TENSOR_PROTOS_FIELD_NUMBER; + hash = (53 * hash) + getTensorProtosList().hashCode(); + } + if (hasCodeLocation()) { + hash = (37 * hash) + CODE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getCodeLocation().hashCode(); + } + if (getOutputTensorDeviceIdsCount() > 0) { + hash = (37 * hash) + OUTPUT_TENSOR_DEVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getOutputTensorDeviceIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Execution parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Execution 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.Execution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Execution 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.Execution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Execution parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Execution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Execution parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Execution parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Execution parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Execution parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Execution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Execution 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Data relating to the eager execution of an op or a Graph.
    +   * For a op that generates N output tensors (N >= 0), only one
    +   * Execution proto will be used to describe the execution event.
    +   * 
    + * + * Protobuf type {@code tensorflow.Execution} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Execution) + org.tensorflow.proto.ExecutionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Execution.class, org.tensorflow.proto.Execution.Builder.class); + } + + // Construct using org.tensorflow.proto.Execution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorProtosFieldBuilder(); + getCodeLocationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + opType_ = ""; + numOutputs_ = 0; + graphId_ = ""; + inputTensorIds_ = emptyLongList(); + outputTensorIds_ = emptyLongList(); + tensorDebugMode_ = 0; + if (tensorProtosBuilder_ == null) { + tensorProtos_ = java.util.Collections.emptyList(); + } else { + tensorProtos_ = null; + tensorProtosBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + codeLocation_ = null; + if (codeLocationBuilder_ != null) { + codeLocationBuilder_.dispose(); + codeLocationBuilder_ = null; + } + outputTensorDeviceIds_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_Execution_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Execution getDefaultInstanceForType() { + return org.tensorflow.proto.Execution.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Execution build() { + org.tensorflow.proto.Execution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Execution buildPartial() { + org.tensorflow.proto.Execution result = new org.tensorflow.proto.Execution(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.Execution result) { + if (tensorProtosBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + tensorProtos_ = java.util.Collections.unmodifiableList(tensorProtos_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.tensorProtos_ = tensorProtos_; + } else { + result.tensorProtos_ = tensorProtosBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.Execution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.opType_ = opType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numOutputs_ = numOutputs_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.graphId_ = graphId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + inputTensorIds_.makeImmutable(); + result.inputTensorIds_ = inputTensorIds_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + outputTensorIds_.makeImmutable(); + result.outputTensorIds_ = outputTensorIds_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.tensorDebugMode_ = tensorDebugMode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.codeLocation_ = codeLocationBuilder_ == null + ? codeLocation_ + : codeLocationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + outputTensorDeviceIds_.makeImmutable(); + result.outputTensorDeviceIds_ = outputTensorDeviceIds_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Execution) { + return mergeFrom((org.tensorflow.proto.Execution)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Execution other) { + if (other == org.tensorflow.proto.Execution.getDefaultInstance()) return this; + if (!other.getOpType().isEmpty()) { + opType_ = other.opType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNumOutputs() != 0) { + setNumOutputs(other.getNumOutputs()); + } + if (!other.getGraphId().isEmpty()) { + graphId_ = other.graphId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.inputTensorIds_.isEmpty()) { + if (inputTensorIds_.isEmpty()) { + inputTensorIds_ = other.inputTensorIds_; + inputTensorIds_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensureInputTensorIdsIsMutable(); + inputTensorIds_.addAll(other.inputTensorIds_); + } + onChanged(); + } + if (!other.outputTensorIds_.isEmpty()) { + if (outputTensorIds_.isEmpty()) { + outputTensorIds_ = other.outputTensorIds_; + outputTensorIds_.makeImmutable(); + bitField0_ |= 0x00000010; + } else { + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addAll(other.outputTensorIds_); + } + onChanged(); + } + if (other.tensorDebugMode_ != 0) { + setTensorDebugModeValue(other.getTensorDebugModeValue()); + } + if (tensorProtosBuilder_ == null) { + if (!other.tensorProtos_.isEmpty()) { + if (tensorProtos_.isEmpty()) { + tensorProtos_ = other.tensorProtos_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureTensorProtosIsMutable(); + tensorProtos_.addAll(other.tensorProtos_); + } + onChanged(); + } + } else { + if (!other.tensorProtos_.isEmpty()) { + if (tensorProtosBuilder_.isEmpty()) { + tensorProtosBuilder_.dispose(); + tensorProtosBuilder_ = null; + tensorProtos_ = other.tensorProtos_; + bitField0_ = (bitField0_ & ~0x00000040); + tensorProtosBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorProtosFieldBuilder() : null; + } else { + tensorProtosBuilder_.addAllMessages(other.tensorProtos_); + } + } + } + if (other.hasCodeLocation()) { + mergeCodeLocation(other.getCodeLocation()); + } + if (!other.outputTensorDeviceIds_.isEmpty()) { + if (outputTensorDeviceIds_.isEmpty()) { + outputTensorDeviceIds_ = other.outputTensorDeviceIds_; + outputTensorDeviceIds_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureOutputTensorDeviceIdsIsMutable(); + outputTensorDeviceIds_.addAll(other.outputTensorDeviceIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + opType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + numOutputs_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + graphId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + long v = input.readInt64(); + ensureInputTensorIdsIsMutable(); + inputTensorIds_.addLong(v); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInputTensorIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + inputTensorIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 34 + case 40: { + long v = input.readInt64(); + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addLong(v); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputTensorIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputTensorIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 42 + case 48: { + tensorDebugMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + org.tensorflow.proto.TensorProto m = + input.readMessage( + org.tensorflow.proto.TensorProto.parser(), + extensionRegistry); + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + tensorProtos_.add(m); + } else { + tensorProtosBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + input.readMessage( + getCodeLocationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: { + int v = input.readInt32(); + ensureOutputTensorDeviceIdsIsMutable(); + outputTensorDeviceIds_.addInt(v); + break; + } // case 72 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputTensorDeviceIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputTensorDeviceIds_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object opType_ = ""; + /** + *
    +     * Op type (e.g., "MatMul").
    +     * In the case of a Graph, this is the name of the Graph.
    +     * 
    + * + * string op_type = 1; + * @return The opType. + */ + public java.lang.String getOpType() { + java.lang.Object ref = opType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Op type (e.g., "MatMul").
    +     * In the case of a Graph, this is the name of the Graph.
    +     * 
    + * + * string op_type = 1; + * @return The bytes for opType. + */ + public com.google.protobuf.ByteString + getOpTypeBytes() { + java.lang.Object ref = opType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Op type (e.g., "MatMul").
    +     * In the case of a Graph, this is the name of the Graph.
    +     * 
    + * + * string op_type = 1; + * @param value The opType to set. + * @return This builder for chaining. + */ + public Builder setOpType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Op type (e.g., "MatMul").
    +     * In the case of a Graph, this is the name of the Graph.
    +     * 
    + * + * string op_type = 1; + * @return This builder for chaining. + */ + public Builder clearOpType() { + opType_ = getDefaultInstance().getOpType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Op type (e.g., "MatMul").
    +     * In the case of a Graph, this is the name of the Graph.
    +     * 
    + * + * string op_type = 1; + * @param value The bytes for opType to set. + * @return This builder for chaining. + */ + public Builder setOpTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int numOutputs_ ; + /** + *
    +     * Number of output tensors.
    +     * 
    + * + * int32 num_outputs = 2; + * @return The numOutputs. + */ + @java.lang.Override + public int getNumOutputs() { + return numOutputs_; + } + /** + *
    +     * Number of output tensors.
    +     * 
    + * + * int32 num_outputs = 2; + * @param value The numOutputs to set. + * @return This builder for chaining. + */ + public Builder setNumOutputs(int value) { + + numOutputs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Number of output tensors.
    +     * 
    + * + * int32 num_outputs = 2; + * @return This builder for chaining. + */ + public Builder clearNumOutputs() { + bitField0_ = (bitField0_ & ~0x00000002); + numOutputs_ = 0; + onChanged(); + return this; + } + + private java.lang.Object graphId_ = ""; + /** + *
    +     * The graph that's executed: applicable only to the eager
    +     * execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 3; + * @return The graphId. + */ + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The graph that's executed: applicable only to the eager
    +     * execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 3; + * @return The bytes for graphId. + */ + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The graph that's executed: applicable only to the eager
    +     * execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 3; + * @param value The graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The graph that's executed: applicable only to the eager
    +     * execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 3; + * @return This builder for chaining. + */ + public Builder clearGraphId() { + graphId_ = getDefaultInstance().getGraphId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * The graph that's executed: applicable only to the eager
    +     * execution of a FuncGraph.
    +     * 
    + * + * string graph_id = 3; + * @param value The bytes for graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList inputTensorIds_ = emptyLongList(); + private void ensureInputTensorIdsIsMutable() { + if (!inputTensorIds_.isModifiable()) { + inputTensorIds_ = makeMutableCopy(inputTensorIds_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @return A list containing the inputTensorIds. + */ + public java.util.List + getInputTensorIdsList() { + inputTensorIds_.makeImmutable(); + return inputTensorIds_; + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @return The count of inputTensorIds. + */ + public int getInputTensorIdsCount() { + return inputTensorIds_.size(); + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @param index The index of the element to return. + * @return The inputTensorIds at the given index. + */ + public long getInputTensorIds(int index) { + return inputTensorIds_.getLong(index); + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @param index The index to set the value at. + * @param value The inputTensorIds to set. + * @return This builder for chaining. + */ + public Builder setInputTensorIds( + int index, long value) { + + ensureInputTensorIdsIsMutable(); + inputTensorIds_.setLong(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @param value The inputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addInputTensorIds(long value) { + + ensureInputTensorIdsIsMutable(); + inputTensorIds_.addLong(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @param values The inputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addAllInputTensorIds( + java.lang.Iterable values) { + ensureInputTensorIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputTensorIds_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * IDs of the input tensors (if available).
    +     * 
    + * + * repeated int64 input_tensor_ids = 4; + * @return This builder for chaining. + */ + public Builder clearInputTensorIds() { + inputTensorIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList outputTensorIds_ = emptyLongList(); + private void ensureOutputTensorIdsIsMutable() { + if (!outputTensorIds_.isModifiable()) { + outputTensorIds_ = makeMutableCopy(outputTensorIds_); + } + bitField0_ |= 0x00000010; + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @return A list containing the outputTensorIds. + */ + public java.util.List + getOutputTensorIdsList() { + outputTensorIds_.makeImmutable(); + return outputTensorIds_; + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @return The count of outputTensorIds. + */ + public int getOutputTensorIdsCount() { + return outputTensorIds_.size(); + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. + */ + public long getOutputTensorIds(int index) { + return outputTensorIds_.getLong(index); + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @param index The index to set the value at. + * @param value The outputTensorIds to set. + * @return This builder for chaining. + */ + public Builder setOutputTensorIds( + int index, long value) { + + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.setLong(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @param value The outputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addOutputTensorIds(long value) { + + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addLong(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @param values The outputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addAllOutputTensorIds( + java.lang.Iterable values) { + ensureOutputTensorIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputTensorIds_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * IDs of the output tensors (if availbable).
    +     * If specified, must have the same length as tensor_protos.
    +     * 
    + * + * repeated int64 output_tensor_ids = 5; + * @return This builder for chaining. + */ + public Builder clearOutputTensorIds() { + outputTensorIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + private int tensorDebugMode_ = 0; + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The enum numeric value on the wire for tensorDebugMode. + */ + @java.lang.Override public int getTensorDebugModeValue() { + return tensorDebugMode_; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @param value The enum numeric value on the wire for tensorDebugMode to set. + * @return This builder for chaining. + */ + public Builder setTensorDebugModeValue(int value) { + tensorDebugMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The tensorDebugMode. + */ + @java.lang.Override + public org.tensorflow.proto.TensorDebugMode getTensorDebugMode() { + org.tensorflow.proto.TensorDebugMode result = org.tensorflow.proto.TensorDebugMode.forNumber(tensorDebugMode_); + return result == null ? org.tensorflow.proto.TensorDebugMode.UNRECOGNIZED : result; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @param value The tensorDebugMode to set. + * @return This builder for chaining. + */ + public Builder setTensorDebugMode(org.tensorflow.proto.TensorDebugMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + tensorDebugMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return This builder for chaining. + */ + public Builder clearTensorDebugMode() { + bitField0_ = (bitField0_ & ~0x00000020); + tensorDebugMode_ = 0; + onChanged(); + return this; + } + + private java.util.List tensorProtos_ = + java.util.Collections.emptyList(); + private void ensureTensorProtosIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + tensorProtos_ = new java.util.ArrayList(tensorProtos_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorProtosBuilder_; + + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public java.util.List getTensorProtosList() { + if (tensorProtosBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensorProtos_); + } else { + return tensorProtosBuilder_.getMessageList(); + } + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public int getTensorProtosCount() { + if (tensorProtosBuilder_ == null) { + return tensorProtos_.size(); + } else { + return tensorProtosBuilder_.getCount(); + } + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public org.tensorflow.proto.TensorProto getTensorProtos(int index) { + if (tensorProtosBuilder_ == null) { + return tensorProtos_.get(index); + } else { + return tensorProtosBuilder_.getMessage(index); + } + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder setTensorProtos( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorProtosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorProtosIsMutable(); + tensorProtos_.set(index, value); + onChanged(); + } else { + tensorProtosBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder setTensorProtos( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + tensorProtos_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorProtosBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder addTensorProtos(org.tensorflow.proto.TensorProto value) { + if (tensorProtosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorProtosIsMutable(); + tensorProtos_.add(value); + onChanged(); + } else { + tensorProtosBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder addTensorProtos( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorProtosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorProtosIsMutable(); + tensorProtos_.add(index, value); + onChanged(); + } else { + tensorProtosBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder addTensorProtos( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + tensorProtos_.add(builderForValue.build()); + onChanged(); + } else { + tensorProtosBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder addTensorProtos( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + tensorProtos_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorProtosBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder addAllTensorProtos( + java.lang.Iterable values) { + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensorProtos_); + onChanged(); + } else { + tensorProtosBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder clearTensorProtos() { + if (tensorProtosBuilder_ == null) { + tensorProtos_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + tensorProtosBuilder_.clear(); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public Builder removeTensorProtos(int index) { + if (tensorProtosBuilder_ == null) { + ensureTensorProtosIsMutable(); + tensorProtos_.remove(index); + onChanged(); + } else { + tensorProtosBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorProtosBuilder( + int index) { + return getTensorProtosFieldBuilder().getBuilder(index); + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorProtosOrBuilder( + int index) { + if (tensorProtosBuilder_ == null) { + return tensorProtos_.get(index); } else { + return tensorProtosBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public java.util.List + getTensorProtosOrBuilderList() { + if (tensorProtosBuilder_ != null) { + return tensorProtosBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensorProtos_); + } + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorProtosBuilder() { + return getTensorProtosFieldBuilder().addBuilder( + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorProtosBuilder( + int index) { + return getTensorProtosFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +     * Output Tensor values in the type described by `tensor_value_type`.
    +     * The length of this should match `num_outputs`.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensor_protos = 7; + */ + public java.util.List + getTensorProtosBuilderList() { + return getTensorProtosFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorProtosFieldBuilder() { + if (tensorProtosBuilder_ == null) { + tensorProtosBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + tensorProtos_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + tensorProtos_ = null; + } + return tensorProtosBuilder_; + } + + private org.tensorflow.proto.CodeLocation codeLocation_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder> codeLocationBuilder_; + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. + */ + public boolean hasCodeLocation() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. + */ + public org.tensorflow.proto.CodeLocation getCodeLocation() { + if (codeLocationBuilder_ == null) { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } else { + return codeLocationBuilder_.getMessage(); + } + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder setCodeLocation(org.tensorflow.proto.CodeLocation value) { + if (codeLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + codeLocation_ = value; + } else { + codeLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder setCodeLocation( + org.tensorflow.proto.CodeLocation.Builder builderForValue) { + if (codeLocationBuilder_ == null) { + codeLocation_ = builderForValue.build(); + } else { + codeLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder mergeCodeLocation(org.tensorflow.proto.CodeLocation value) { + if (codeLocationBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + codeLocation_ != null && + codeLocation_ != org.tensorflow.proto.CodeLocation.getDefaultInstance()) { + getCodeLocationBuilder().mergeFrom(value); + } else { + codeLocation_ = value; + } + } else { + codeLocationBuilder_.mergeFrom(value); + } + if (codeLocation_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder clearCodeLocation() { + bitField0_ = (bitField0_ & ~0x00000080); + codeLocation_ = null; + if (codeLocationBuilder_ != null) { + codeLocationBuilder_.dispose(); + codeLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public org.tensorflow.proto.CodeLocation.Builder getCodeLocationBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCodeLocationFieldBuilder().getBuilder(); + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder() { + if (codeLocationBuilder_ != null) { + return codeLocationBuilder_.getMessageOrBuilder(); + } else { + return codeLocation_ == null ? + org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + } + /** + *
    +     * Stack trace of the eager execution.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder> + getCodeLocationFieldBuilder() { + if (codeLocationBuilder_ == null) { + codeLocationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder>( + getCodeLocation(), + getParentForChildren(), + isClean()); + codeLocation_ = null; + } + return codeLocationBuilder_; + } + + private com.google.protobuf.Internal.IntList outputTensorDeviceIds_ = emptyIntList(); + private void ensureOutputTensorDeviceIdsIsMutable() { + if (!outputTensorDeviceIds_.isModifiable()) { + outputTensorDeviceIds_ = makeMutableCopy(outputTensorDeviceIds_); + } + bitField0_ |= 0x00000100; + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @return A list containing the outputTensorDeviceIds. + */ + public java.util.List + getOutputTensorDeviceIdsList() { + outputTensorDeviceIds_.makeImmutable(); + return outputTensorDeviceIds_; + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @return The count of outputTensorDeviceIds. + */ + public int getOutputTensorDeviceIdsCount() { + return outputTensorDeviceIds_.size(); + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorDeviceIds at the given index. + */ + public int getOutputTensorDeviceIds(int index) { + return outputTensorDeviceIds_.getInt(index); + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @param index The index to set the value at. + * @param value The outputTensorDeviceIds to set. + * @return This builder for chaining. + */ + public Builder setOutputTensorDeviceIds( + int index, int value) { + + ensureOutputTensorDeviceIdsIsMutable(); + outputTensorDeviceIds_.setInt(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @param value The outputTensorDeviceIds to add. + * @return This builder for chaining. + */ + public Builder addOutputTensorDeviceIds(int value) { + + ensureOutputTensorDeviceIdsIsMutable(); + outputTensorDeviceIds_.addInt(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @param values The outputTensorDeviceIds to add. + * @return This builder for chaining. + */ + public Builder addAllOutputTensorDeviceIds( + java.lang.Iterable values) { + ensureOutputTensorDeviceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputTensorDeviceIds_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Debugged-generated IDs of the devices on which the output tensors reside.
    +     * To look up details about the device (e.g., name), cross-reference this
    +     * field with the DebuggedDevice messages.
    +     * 
    + * + * repeated int32 output_tensor_device_ids = 9; + * @return This builder for chaining. + */ + public Builder clearOutputTensorDeviceIds() { + outputTensorDeviceIds_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Execution) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Execution) + private static final org.tensorflow.proto.Execution DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Execution(); + } + + public static org.tensorflow.proto.Execution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Execution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Execution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/ExecutionOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExecutionOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/ExecutionOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExecutionOrBuilder.java index c08db8762e5..1e95b376148 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/ExecutionOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ExecutionOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface ExecutionOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.Execution) @@ -14,6 +16,7 @@ public interface ExecutionOrBuilder extends *
    * * string op_type = 1; + * @return The opType. */ java.lang.String getOpType(); /** @@ -23,6 +26,7 @@ public interface ExecutionOrBuilder extends *
    * * string op_type = 1; + * @return The bytes for opType. */ com.google.protobuf.ByteString getOpTypeBytes(); @@ -33,6 +37,7 @@ public interface ExecutionOrBuilder extends * * * int32 num_outputs = 2; + * @return The numOutputs. */ int getNumOutputs(); @@ -43,6 +48,7 @@ public interface ExecutionOrBuilder extends * * * string graph_id = 3; + * @return The graphId. */ java.lang.String getGraphId(); /** @@ -52,6 +58,7 @@ public interface ExecutionOrBuilder extends * * * string graph_id = 3; + * @return The bytes for graphId. */ com.google.protobuf.ByteString getGraphIdBytes(); @@ -62,6 +69,7 @@ public interface ExecutionOrBuilder extends * * * repeated int64 input_tensor_ids = 4; + * @return A list containing the inputTensorIds. */ java.util.List getInputTensorIdsList(); /** @@ -70,6 +78,7 @@ public interface ExecutionOrBuilder extends * * * repeated int64 input_tensor_ids = 4; + * @return The count of inputTensorIds. */ int getInputTensorIdsCount(); /** @@ -78,6 +87,8 @@ public interface ExecutionOrBuilder extends * * * repeated int64 input_tensor_ids = 4; + * @param index The index of the element to return. + * @return The inputTensorIds at the given index. */ long getInputTensorIds(int index); @@ -88,6 +99,7 @@ public interface ExecutionOrBuilder extends * * * repeated int64 output_tensor_ids = 5; + * @return A list containing the outputTensorIds. */ java.util.List getOutputTensorIdsList(); /** @@ -97,6 +109,7 @@ public interface ExecutionOrBuilder extends * * * repeated int64 output_tensor_ids = 5; + * @return The count of outputTensorIds. */ int getOutputTensorIdsCount(); /** @@ -106,6 +119,8 @@ public interface ExecutionOrBuilder extends * * * repeated int64 output_tensor_ids = 5; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. */ long getOutputTensorIds(int index); @@ -115,6 +130,7 @@ public interface ExecutionOrBuilder extends * * * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The enum numeric value on the wire for tensorDebugMode. */ int getTensorDebugModeValue(); /** @@ -123,8 +139,9 @@ public interface ExecutionOrBuilder extends * * * .tensorflow.TensorDebugMode tensor_debug_mode = 6; + * @return The tensorDebugMode. */ - org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode(); + org.tensorflow.proto.TensorDebugMode getTensorDebugMode(); /** *
    @@ -134,7 +151,7 @@ public interface ExecutionOrBuilder extends
        *
        * repeated .tensorflow.TensorProto tensor_protos = 7;
        */
    -  java.util.List 
    +  java.util.List 
           getTensorProtosList();
       /**
        * 
    @@ -144,7 +161,7 @@ public interface ExecutionOrBuilder extends
        *
        * repeated .tensorflow.TensorProto tensor_protos = 7;
        */
    -  org.tensorflow.proto.framework.TensorProto getTensorProtos(int index);
    +  org.tensorflow.proto.TensorProto getTensorProtos(int index);
       /**
        * 
        * Output Tensor values in the type described by `tensor_value_type`.
    @@ -162,7 +179,7 @@ public interface ExecutionOrBuilder extends
        *
        * repeated .tensorflow.TensorProto tensor_protos = 7;
        */
    -  java.util.List 
    +  java.util.List 
           getTensorProtosOrBuilderList();
       /**
        * 
    @@ -172,7 +189,7 @@ public interface ExecutionOrBuilder extends
        *
        * repeated .tensorflow.TensorProto tensor_protos = 7;
        */
    -  org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder(
    +  org.tensorflow.proto.TensorProtoOrBuilder getTensorProtosOrBuilder(
           int index);
     
       /**
    @@ -181,6 +198,7 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder(
        * 
    * * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. */ boolean hasCodeLocation(); /** @@ -189,8 +207,9 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder( *
    * * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. */ - org.tensorflow.proto.util.CodeLocation getCodeLocation(); + org.tensorflow.proto.CodeLocation getCodeLocation(); /** *
        * Stack trace of the eager execution.
    @@ -198,7 +217,7 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder(
        *
        * .tensorflow.CodeLocation code_location = 8;
        */
    -  org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder();
    +  org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder();
     
       /**
        * 
    @@ -208,6 +227,7 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder(
        * 
    * * repeated int32 output_tensor_device_ids = 9; + * @return A list containing the outputTensorDeviceIds. */ java.util.List getOutputTensorDeviceIdsList(); /** @@ -218,6 +238,7 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder( *
    * * repeated int32 output_tensor_device_ids = 9; + * @return The count of outputTensorDeviceIds. */ int getOutputTensorDeviceIdsCount(); /** @@ -228,6 +249,8 @@ org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtosOrBuilder( *
    * * repeated int32 output_tensor_device_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorDeviceIds at the given index. */ int getOutputTensorDeviceIds(int index); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Feature.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Feature.java new file mode 100644 index 00000000000..000c9bda934 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Feature.java @@ -0,0 +1,1072 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Containers for non-sequential data.
    + * 
    + * + * Protobuf type {@code tensorflow.Feature} + */ +public final class Feature extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Feature) + FeatureOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Feature.class.getName()); + } + // Use Feature.newBuilder() to construct. + private Feature(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Feature() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Feature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Feature.class, org.tensorflow.proto.Feature.Builder.class); + } + + private int kindCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object kind_; + public enum KindCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BYTES_LIST(1), + FLOAT_LIST(2), + INT64_LIST(3), + KIND_NOT_SET(0); + private final int value; + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: return BYTES_LIST; + case 2: return FLOAT_LIST; + case 3: return INT64_LIST; + case 0: return KIND_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public static final int BYTES_LIST_FIELD_NUMBER = 1; + /** + * .tensorflow.BytesList bytes_list = 1; + * @return Whether the bytesList field is set. + */ + @java.lang.Override + public boolean hasBytesList() { + return kindCase_ == 1; + } + /** + * .tensorflow.BytesList bytes_list = 1; + * @return The bytesList. + */ + @java.lang.Override + public org.tensorflow.proto.BytesList getBytesList() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.BytesList) kind_; + } + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.BytesListOrBuilder getBytesListOrBuilder() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.BytesList) kind_; + } + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } + + public static final int FLOAT_LIST_FIELD_NUMBER = 2; + /** + * .tensorflow.FloatList float_list = 2; + * @return Whether the floatList field is set. + */ + @java.lang.Override + public boolean hasFloatList() { + return kindCase_ == 2; + } + /** + * .tensorflow.FloatList float_list = 2; + * @return The floatList. + */ + @java.lang.Override + public org.tensorflow.proto.FloatList getFloatList() { + if (kindCase_ == 2) { + return (org.tensorflow.proto.FloatList) kind_; + } + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } + /** + * .tensorflow.FloatList float_list = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FloatListOrBuilder getFloatListOrBuilder() { + if (kindCase_ == 2) { + return (org.tensorflow.proto.FloatList) kind_; + } + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } + + public static final int INT64_LIST_FIELD_NUMBER = 3; + /** + * .tensorflow.Int64List int64_list = 3; + * @return Whether the int64List field is set. + */ + @java.lang.Override + public boolean hasInt64List() { + return kindCase_ == 3; + } + /** + * .tensorflow.Int64List int64_list = 3; + * @return The int64List. + */ + @java.lang.Override + public org.tensorflow.proto.Int64List getInt64List() { + if (kindCase_ == 3) { + return (org.tensorflow.proto.Int64List) kind_; + } + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + @java.lang.Override + public org.tensorflow.proto.Int64ListOrBuilder getInt64ListOrBuilder() { + if (kindCase_ == 3) { + return (org.tensorflow.proto.Int64List) kind_; + } + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.BytesList) kind_); + } + if (kindCase_ == 2) { + output.writeMessage(2, (org.tensorflow.proto.FloatList) kind_); + } + if (kindCase_ == 3) { + output.writeMessage(3, (org.tensorflow.proto.Int64List) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.BytesList) kind_); + } + if (kindCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.tensorflow.proto.FloatList) kind_); + } + if (kindCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (org.tensorflow.proto.Int64List) kind_); + } + size += getUnknownFields().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.Feature)) { + return super.equals(obj); + } + org.tensorflow.proto.Feature other = (org.tensorflow.proto.Feature) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getBytesList() + .equals(other.getBytesList())) return false; + break; + case 2: + if (!getFloatList() + .equals(other.getFloatList())) return false; + break; + case 3: + if (!getInt64List() + .equals(other.getInt64List())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + BYTES_LIST_FIELD_NUMBER; + hash = (53 * hash) + getBytesList().hashCode(); + break; + case 2: + hash = (37 * hash) + FLOAT_LIST_FIELD_NUMBER; + hash = (53 * hash) + getFloatList().hashCode(); + break; + case 3: + hash = (37 * hash) + INT64_LIST_FIELD_NUMBER; + hash = (53 * hash) + getInt64List().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Feature parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Feature 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.Feature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Feature 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.Feature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Feature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Feature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Feature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Feature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Feature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Feature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Feature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Feature 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Containers for non-sequential data.
    +   * 
    + * + * Protobuf type {@code tensorflow.Feature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Feature) + org.tensorflow.proto.FeatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Feature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Feature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Feature.class, org.tensorflow.proto.Feature.Builder.class); + } + + // Construct using org.tensorflow.proto.Feature.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bytesListBuilder_ != null) { + bytesListBuilder_.clear(); + } + if (floatListBuilder_ != null) { + floatListBuilder_.clear(); + } + if (int64ListBuilder_ != null) { + int64ListBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Feature_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Feature getDefaultInstanceForType() { + return org.tensorflow.proto.Feature.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Feature build() { + org.tensorflow.proto.Feature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Feature buildPartial() { + org.tensorflow.proto.Feature result = new org.tensorflow.proto.Feature(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Feature result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.Feature result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && + bytesListBuilder_ != null) { + result.kind_ = bytesListBuilder_.build(); + } + if (kindCase_ == 2 && + floatListBuilder_ != null) { + result.kind_ = floatListBuilder_.build(); + } + if (kindCase_ == 3 && + int64ListBuilder_ != null) { + result.kind_ = int64ListBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Feature) { + return mergeFrom((org.tensorflow.proto.Feature)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Feature other) { + if (other == org.tensorflow.proto.Feature.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case BYTES_LIST: { + mergeBytesList(other.getBytesList()); + break; + } + case FLOAT_LIST: { + mergeFloatList(other.getFloatList()); + break; + } + case INT64_LIST: { + mergeInt64List(other.getInt64List()); + break; + } + case KIND_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getBytesListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + getFloatListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + getInt64ListFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int kindCase_ = 0; + private java.lang.Object kind_; + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BytesList, org.tensorflow.proto.BytesList.Builder, org.tensorflow.proto.BytesListOrBuilder> bytesListBuilder_; + /** + * .tensorflow.BytesList bytes_list = 1; + * @return Whether the bytesList field is set. + */ + @java.lang.Override + public boolean hasBytesList() { + return kindCase_ == 1; + } + /** + * .tensorflow.BytesList bytes_list = 1; + * @return The bytesList. + */ + @java.lang.Override + public org.tensorflow.proto.BytesList getBytesList() { + if (bytesListBuilder_ == null) { + if (kindCase_ == 1) { + return (org.tensorflow.proto.BytesList) kind_; + } + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return bytesListBuilder_.getMessage(); + } + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + public Builder setBytesList(org.tensorflow.proto.BytesList value) { + if (bytesListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + bytesListBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + public Builder setBytesList( + org.tensorflow.proto.BytesList.Builder builderForValue) { + if (bytesListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + bytesListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + public Builder mergeBytesList(org.tensorflow.proto.BytesList value) { + if (bytesListBuilder_ == null) { + if (kindCase_ == 1 && + kind_ != org.tensorflow.proto.BytesList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.BytesList.newBuilder((org.tensorflow.proto.BytesList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + bytesListBuilder_.mergeFrom(value); + } else { + bytesListBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + public Builder clearBytesList() { + if (bytesListBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + bytesListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + public org.tensorflow.proto.BytesList.Builder getBytesListBuilder() { + return getBytesListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.BytesListOrBuilder getBytesListOrBuilder() { + if ((kindCase_ == 1) && (bytesListBuilder_ != null)) { + return bytesListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (org.tensorflow.proto.BytesList) kind_; + } + return org.tensorflow.proto.BytesList.getDefaultInstance(); + } + } + /** + * .tensorflow.BytesList bytes_list = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BytesList, org.tensorflow.proto.BytesList.Builder, org.tensorflow.proto.BytesListOrBuilder> + getBytesListFieldBuilder() { + if (bytesListBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = org.tensorflow.proto.BytesList.getDefaultInstance(); + } + bytesListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BytesList, org.tensorflow.proto.BytesList.Builder, org.tensorflow.proto.BytesListOrBuilder>( + (org.tensorflow.proto.BytesList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return bytesListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FloatList, org.tensorflow.proto.FloatList.Builder, org.tensorflow.proto.FloatListOrBuilder> floatListBuilder_; + /** + * .tensorflow.FloatList float_list = 2; + * @return Whether the floatList field is set. + */ + @java.lang.Override + public boolean hasFloatList() { + return kindCase_ == 2; + } + /** + * .tensorflow.FloatList float_list = 2; + * @return The floatList. + */ + @java.lang.Override + public org.tensorflow.proto.FloatList getFloatList() { + if (floatListBuilder_ == null) { + if (kindCase_ == 2) { + return (org.tensorflow.proto.FloatList) kind_; + } + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } else { + if (kindCase_ == 2) { + return floatListBuilder_.getMessage(); + } + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } + } + /** + * .tensorflow.FloatList float_list = 2; + */ + public Builder setFloatList(org.tensorflow.proto.FloatList value) { + if (floatListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + floatListBuilder_.setMessage(value); + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.FloatList float_list = 2; + */ + public Builder setFloatList( + org.tensorflow.proto.FloatList.Builder builderForValue) { + if (floatListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + floatListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.FloatList float_list = 2; + */ + public Builder mergeFloatList(org.tensorflow.proto.FloatList value) { + if (floatListBuilder_ == null) { + if (kindCase_ == 2 && + kind_ != org.tensorflow.proto.FloatList.getDefaultInstance()) { + kind_ = org.tensorflow.proto.FloatList.newBuilder((org.tensorflow.proto.FloatList) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 2) { + floatListBuilder_.mergeFrom(value); + } else { + floatListBuilder_.setMessage(value); + } + } + kindCase_ = 2; + return this; + } + /** + * .tensorflow.FloatList float_list = 2; + */ + public Builder clearFloatList() { + if (floatListBuilder_ == null) { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + } + floatListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.FloatList float_list = 2; + */ + public org.tensorflow.proto.FloatList.Builder getFloatListBuilder() { + return getFloatListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.FloatList float_list = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FloatListOrBuilder getFloatListOrBuilder() { + if ((kindCase_ == 2) && (floatListBuilder_ != null)) { + return floatListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 2) { + return (org.tensorflow.proto.FloatList) kind_; + } + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } + } + /** + * .tensorflow.FloatList float_list = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FloatList, org.tensorflow.proto.FloatList.Builder, org.tensorflow.proto.FloatListOrBuilder> + getFloatListFieldBuilder() { + if (floatListBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = org.tensorflow.proto.FloatList.getDefaultInstance(); + } + floatListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FloatList, org.tensorflow.proto.FloatList.Builder, org.tensorflow.proto.FloatListOrBuilder>( + (org.tensorflow.proto.FloatList) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 2; + onChanged(); + return floatListBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Int64List, org.tensorflow.proto.Int64List.Builder, org.tensorflow.proto.Int64ListOrBuilder> int64ListBuilder_; + /** + * .tensorflow.Int64List int64_list = 3; + * @return Whether the int64List field is set. + */ + @java.lang.Override + public boolean hasInt64List() { + return kindCase_ == 3; + } + /** + * .tensorflow.Int64List int64_list = 3; + * @return The int64List. + */ + @java.lang.Override + public org.tensorflow.proto.Int64List getInt64List() { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3) { + return (org.tensorflow.proto.Int64List) kind_; + } + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } else { + if (kindCase_ == 3) { + return int64ListBuilder_.getMessage(); + } + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + public Builder setInt64List(org.tensorflow.proto.Int64List value) { + if (int64ListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + int64ListBuilder_.setMessage(value); + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + public Builder setInt64List( + org.tensorflow.proto.Int64List.Builder builderForValue) { + if (int64ListBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + int64ListBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + public Builder mergeInt64List(org.tensorflow.proto.Int64List value) { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3 && + kind_ != org.tensorflow.proto.Int64List.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Int64List.newBuilder((org.tensorflow.proto.Int64List) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 3) { + int64ListBuilder_.mergeFrom(value); + } else { + int64ListBuilder_.setMessage(value); + } + } + kindCase_ = 3; + return this; + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + public Builder clearInt64List() { + if (int64ListBuilder_ == null) { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + } + int64ListBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + public org.tensorflow.proto.Int64List.Builder getInt64ListBuilder() { + return getInt64ListFieldBuilder().getBuilder(); + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + @java.lang.Override + public org.tensorflow.proto.Int64ListOrBuilder getInt64ListOrBuilder() { + if ((kindCase_ == 3) && (int64ListBuilder_ != null)) { + return int64ListBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 3) { + return (org.tensorflow.proto.Int64List) kind_; + } + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } + } + /** + * .tensorflow.Int64List int64_list = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Int64List, org.tensorflow.proto.Int64List.Builder, org.tensorflow.proto.Int64ListOrBuilder> + getInt64ListFieldBuilder() { + if (int64ListBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = org.tensorflow.proto.Int64List.getDefaultInstance(); + } + int64ListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Int64List, org.tensorflow.proto.Int64List.Builder, org.tensorflow.proto.Int64ListOrBuilder>( + (org.tensorflow.proto.Int64List) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 3; + onChanged(); + return int64ListBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Feature) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Feature) + private static final org.tensorflow.proto.Feature DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Feature(); + } + + public static org.tensorflow.proto.Feature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Feature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Feature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfiguration.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfiguration.java new file mode 100644 index 00000000000..98a591ecedb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfiguration.java @@ -0,0 +1,856 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.FeatureConfiguration} + */ +public final class FeatureConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FeatureConfiguration) + FeatureConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FeatureConfiguration.class.getName()); + } + // Use FeatureConfiguration.newBuilder() to construct. + private FeatureConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FeatureConfiguration() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureConfiguration.class, org.tensorflow.proto.FeatureConfiguration.Builder.class); + } + + private int configCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object config_; + public enum ConfigCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FIXED_LEN_FEATURE(1), + VAR_LEN_FEATURE(2), + CONFIG_NOT_SET(0); + private final int value; + private ConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 1: return FIXED_LEN_FEATURE; + case 2: return VAR_LEN_FEATURE; + case 0: return CONFIG_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ConfigCase + getConfigCase() { + return ConfigCase.forNumber( + configCase_); + } + + public static final int FIXED_LEN_FEATURE_FIELD_NUMBER = 1; + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return Whether the fixedLenFeature field is set. + */ + @java.lang.Override + public boolean hasFixedLenFeature() { + return configCase_ == 1; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return The fixedLenFeature. + */ + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProto getFixedLenFeature() { + if (configCase_ == 1) { + return (org.tensorflow.proto.FixedLenFeatureProto) config_; + } + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder() { + if (configCase_ == 1) { + return (org.tensorflow.proto.FixedLenFeatureProto) config_; + } + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + + public static final int VAR_LEN_FEATURE_FIELD_NUMBER = 2; + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return Whether the varLenFeature field is set. + */ + @java.lang.Override + public boolean hasVarLenFeature() { + return configCase_ == 2; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return The varLenFeature. + */ + @java.lang.Override + public org.tensorflow.proto.VarLenFeatureProto getVarLenFeature() { + if (configCase_ == 2) { + return (org.tensorflow.proto.VarLenFeatureProto) config_; + } + return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + @java.lang.Override + public org.tensorflow.proto.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder() { + if (configCase_ == 2) { + return (org.tensorflow.proto.VarLenFeatureProto) config_; + } + return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } + + 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 (configCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.FixedLenFeatureProto) config_); + } + if (configCase_ == 2) { + output.writeMessage(2, (org.tensorflow.proto.VarLenFeatureProto) config_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (configCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.FixedLenFeatureProto) config_); + } + if (configCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (org.tensorflow.proto.VarLenFeatureProto) config_); + } + size += getUnknownFields().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.FeatureConfiguration)) { + return super.equals(obj); + } + org.tensorflow.proto.FeatureConfiguration other = (org.tensorflow.proto.FeatureConfiguration) obj; + + if (!getConfigCase().equals(other.getConfigCase())) return false; + switch (configCase_) { + case 1: + if (!getFixedLenFeature() + .equals(other.getFixedLenFeature())) return false; + break; + case 2: + if (!getVarLenFeature() + .equals(other.getVarLenFeature())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (configCase_) { + case 1: + hash = (37 * hash) + FIXED_LEN_FEATURE_FIELD_NUMBER; + hash = (53 * hash) + getFixedLenFeature().hashCode(); + break; + case 2: + hash = (37 * hash) + VAR_LEN_FEATURE_FIELD_NUMBER; + hash = (53 * hash) + getVarLenFeature().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FeatureConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureConfiguration 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.FeatureConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureConfiguration 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.FeatureConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FeatureConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FeatureConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FeatureConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FeatureConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FeatureConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.FeatureConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FeatureConfiguration) + org.tensorflow.proto.FeatureConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureConfiguration.class, org.tensorflow.proto.FeatureConfiguration.Builder.class); + } + + // Construct using org.tensorflow.proto.FeatureConfiguration.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fixedLenFeatureBuilder_ != null) { + fixedLenFeatureBuilder_.clear(); + } + if (varLenFeatureBuilder_ != null) { + varLenFeatureBuilder_.clear(); + } + configCase_ = 0; + config_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FeatureConfiguration_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration getDefaultInstanceForType() { + return org.tensorflow.proto.FeatureConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration build() { + org.tensorflow.proto.FeatureConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureConfiguration buildPartial() { + org.tensorflow.proto.FeatureConfiguration result = new org.tensorflow.proto.FeatureConfiguration(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FeatureConfiguration result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.FeatureConfiguration result) { + result.configCase_ = configCase_; + result.config_ = this.config_; + if (configCase_ == 1 && + fixedLenFeatureBuilder_ != null) { + result.config_ = fixedLenFeatureBuilder_.build(); + } + if (configCase_ == 2 && + varLenFeatureBuilder_ != null) { + result.config_ = varLenFeatureBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FeatureConfiguration) { + return mergeFrom((org.tensorflow.proto.FeatureConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FeatureConfiguration other) { + if (other == org.tensorflow.proto.FeatureConfiguration.getDefaultInstance()) return this; + switch (other.getConfigCase()) { + case FIXED_LEN_FEATURE: { + mergeFixedLenFeature(other.getFixedLenFeature()); + break; + } + case VAR_LEN_FEATURE: { + mergeVarLenFeature(other.getVarLenFeature()); + break; + } + case CONFIG_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getFixedLenFeatureFieldBuilder().getBuilder(), + extensionRegistry); + configCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + getVarLenFeatureFieldBuilder().getBuilder(), + extensionRegistry); + configCase_ = 2; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int configCase_ = 0; + private java.lang.Object config_; + public ConfigCase + getConfigCase() { + return ConfigCase.forNumber( + configCase_); + } + + public Builder clearConfig() { + configCase_ = 0; + config_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FixedLenFeatureProto, org.tensorflow.proto.FixedLenFeatureProto.Builder, org.tensorflow.proto.FixedLenFeatureProtoOrBuilder> fixedLenFeatureBuilder_; + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return Whether the fixedLenFeature field is set. + */ + @java.lang.Override + public boolean hasFixedLenFeature() { + return configCase_ == 1; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return The fixedLenFeature. + */ + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProto getFixedLenFeature() { + if (fixedLenFeatureBuilder_ == null) { + if (configCase_ == 1) { + return (org.tensorflow.proto.FixedLenFeatureProto) config_; + } + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } else { + if (configCase_ == 1) { + return fixedLenFeatureBuilder_.getMessage(); + } + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + public Builder setFixedLenFeature(org.tensorflow.proto.FixedLenFeatureProto value) { + if (fixedLenFeatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + fixedLenFeatureBuilder_.setMessage(value); + } + configCase_ = 1; + return this; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + public Builder setFixedLenFeature( + org.tensorflow.proto.FixedLenFeatureProto.Builder builderForValue) { + if (fixedLenFeatureBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + fixedLenFeatureBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 1; + return this; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + public Builder mergeFixedLenFeature(org.tensorflow.proto.FixedLenFeatureProto value) { + if (fixedLenFeatureBuilder_ == null) { + if (configCase_ == 1 && + config_ != org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance()) { + config_ = org.tensorflow.proto.FixedLenFeatureProto.newBuilder((org.tensorflow.proto.FixedLenFeatureProto) config_) + .mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 1) { + fixedLenFeatureBuilder_.mergeFrom(value); + } else { + fixedLenFeatureBuilder_.setMessage(value); + } + } + configCase_ = 1; + return this; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + public Builder clearFixedLenFeature() { + if (fixedLenFeatureBuilder_ == null) { + if (configCase_ == 1) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 1) { + configCase_ = 0; + config_ = null; + } + fixedLenFeatureBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + public org.tensorflow.proto.FixedLenFeatureProto.Builder getFixedLenFeatureBuilder() { + return getFixedLenFeatureFieldBuilder().getBuilder(); + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder() { + if ((configCase_ == 1) && (fixedLenFeatureBuilder_ != null)) { + return fixedLenFeatureBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 1) { + return (org.tensorflow.proto.FixedLenFeatureProto) config_; + } + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + } + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FixedLenFeatureProto, org.tensorflow.proto.FixedLenFeatureProto.Builder, org.tensorflow.proto.FixedLenFeatureProtoOrBuilder> + getFixedLenFeatureFieldBuilder() { + if (fixedLenFeatureBuilder_ == null) { + if (!(configCase_ == 1)) { + config_ = org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + fixedLenFeatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FixedLenFeatureProto, org.tensorflow.proto.FixedLenFeatureProto.Builder, org.tensorflow.proto.FixedLenFeatureProtoOrBuilder>( + (org.tensorflow.proto.FixedLenFeatureProto) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 1; + onChanged(); + return fixedLenFeatureBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VarLenFeatureProto, org.tensorflow.proto.VarLenFeatureProto.Builder, org.tensorflow.proto.VarLenFeatureProtoOrBuilder> varLenFeatureBuilder_; + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return Whether the varLenFeature field is set. + */ + @java.lang.Override + public boolean hasVarLenFeature() { + return configCase_ == 2; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return The varLenFeature. + */ + @java.lang.Override + public org.tensorflow.proto.VarLenFeatureProto getVarLenFeature() { + if (varLenFeatureBuilder_ == null) { + if (configCase_ == 2) { + return (org.tensorflow.proto.VarLenFeatureProto) config_; + } + return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } else { + if (configCase_ == 2) { + return varLenFeatureBuilder_.getMessage(); + } + return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + public Builder setVarLenFeature(org.tensorflow.proto.VarLenFeatureProto value) { + if (varLenFeatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + varLenFeatureBuilder_.setMessage(value); + } + configCase_ = 2; + return this; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + public Builder setVarLenFeature( + org.tensorflow.proto.VarLenFeatureProto.Builder builderForValue) { + if (varLenFeatureBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + varLenFeatureBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 2; + return this; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + public Builder mergeVarLenFeature(org.tensorflow.proto.VarLenFeatureProto value) { + if (varLenFeatureBuilder_ == null) { + if (configCase_ == 2 && + config_ != org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance()) { + config_ = org.tensorflow.proto.VarLenFeatureProto.newBuilder((org.tensorflow.proto.VarLenFeatureProto) config_) + .mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 2) { + varLenFeatureBuilder_.mergeFrom(value); + } else { + varLenFeatureBuilder_.setMessage(value); + } + } + configCase_ = 2; + return this; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + public Builder clearVarLenFeature() { + if (varLenFeatureBuilder_ == null) { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + } + varLenFeatureBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + public org.tensorflow.proto.VarLenFeatureProto.Builder getVarLenFeatureBuilder() { + return getVarLenFeatureFieldBuilder().getBuilder(); + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + @java.lang.Override + public org.tensorflow.proto.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder() { + if ((configCase_ == 2) && (varLenFeatureBuilder_ != null)) { + return varLenFeatureBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 2) { + return (org.tensorflow.proto.VarLenFeatureProto) config_; + } + return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } + } + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VarLenFeatureProto, org.tensorflow.proto.VarLenFeatureProto.Builder, org.tensorflow.proto.VarLenFeatureProtoOrBuilder> + getVarLenFeatureFieldBuilder() { + if (varLenFeatureBuilder_ == null) { + if (!(configCase_ == 2)) { + config_ = org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance(); + } + varLenFeatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VarLenFeatureProto, org.tensorflow.proto.VarLenFeatureProto.Builder, org.tensorflow.proto.VarLenFeatureProtoOrBuilder>( + (org.tensorflow.proto.VarLenFeatureProto) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 2; + onChanged(); + return varLenFeatureBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FeatureConfiguration) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FeatureConfiguration) + private static final org.tensorflow.proto.FeatureConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FeatureConfiguration(); + } + + public static org.tensorflow.proto.FeatureConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FeatureConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfigurationOrBuilder.java new file mode 100644 index 00000000000..7b6b97b7815 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureConfigurationOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FeatureConfigurationOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FeatureConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return Whether the fixedLenFeature field is set. + */ + boolean hasFixedLenFeature(); + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + * @return The fixedLenFeature. + */ + org.tensorflow.proto.FixedLenFeatureProto getFixedLenFeature(); + /** + * .tensorflow.FixedLenFeatureProto fixed_len_feature = 1; + */ + org.tensorflow.proto.FixedLenFeatureProtoOrBuilder getFixedLenFeatureOrBuilder(); + + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return Whether the varLenFeature field is set. + */ + boolean hasVarLenFeature(); + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + * @return The varLenFeature. + */ + org.tensorflow.proto.VarLenFeatureProto getVarLenFeature(); + /** + * .tensorflow.VarLenFeatureProto var_len_feature = 2; + */ + org.tensorflow.proto.VarLenFeatureProtoOrBuilder getVarLenFeatureOrBuilder(); + + org.tensorflow.proto.FeatureConfiguration.ConfigCase getConfigCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureList.java new file mode 100644 index 00000000000..ee7c362045d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureList.java @@ -0,0 +1,739 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Containers for sequential data.
    + *
    + * A FeatureList contains lists of Features.  These may hold zero or more
    + * Feature values.
    + *
    + * FeatureLists are organized into categories by name.  The FeatureLists message
    + * contains the mapping from name to FeatureList.
    + * 
    + * + * Protobuf type {@code tensorflow.FeatureList} + */ +public final class FeatureList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FeatureList) + FeatureListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FeatureList.class.getName()); + } + // Use FeatureList.newBuilder() to construct. + private FeatureList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FeatureList() { + feature_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureList.class, org.tensorflow.proto.FeatureList.Builder.class); + } + + public static final int FEATURE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List feature_; + /** + * repeated .tensorflow.Feature feature = 1; + */ + @java.lang.Override + public java.util.List getFeatureList() { + return feature_; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + @java.lang.Override + public java.util.List + getFeatureOrBuilderList() { + return feature_; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + @java.lang.Override + public int getFeatureCount() { + return feature_.size(); + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Feature getFeature(int index) { + return feature_.get(index); + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureOrBuilder getFeatureOrBuilder( + int index) { + return feature_.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 { + for (int i = 0; i < feature_.size(); i++) { + output.writeMessage(1, feature_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < feature_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, feature_.get(i)); + } + size += getUnknownFields().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.FeatureList)) { + return super.equals(obj); + } + org.tensorflow.proto.FeatureList other = (org.tensorflow.proto.FeatureList) obj; + + if (!getFeatureList() + .equals(other.getFeatureList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFeatureCount() > 0) { + hash = (37 * hash) + FEATURE_FIELD_NUMBER; + hash = (53 * hash) + getFeatureList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FeatureList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureList 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.FeatureList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureList 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.FeatureList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FeatureList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FeatureList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FeatureList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FeatureList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FeatureList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Containers for sequential data.
    +   *
    +   * A FeatureList contains lists of Features.  These may hold zero or more
    +   * Feature values.
    +   *
    +   * FeatureLists are organized into categories by name.  The FeatureLists message
    +   * contains the mapping from name to FeatureList.
    +   * 
    + * + * Protobuf type {@code tensorflow.FeatureList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FeatureList) + org.tensorflow.proto.FeatureListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureList.class, org.tensorflow.proto.FeatureList.Builder.class); + } + + // Construct using org.tensorflow.proto.FeatureList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (featureBuilder_ == null) { + feature_ = java.util.Collections.emptyList(); + } else { + feature_ = null; + featureBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureList getDefaultInstanceForType() { + return org.tensorflow.proto.FeatureList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FeatureList build() { + org.tensorflow.proto.FeatureList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureList buildPartial() { + org.tensorflow.proto.FeatureList result = new org.tensorflow.proto.FeatureList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.FeatureList result) { + if (featureBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + feature_ = java.util.Collections.unmodifiableList(feature_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.feature_ = feature_; + } else { + result.feature_ = featureBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.FeatureList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FeatureList) { + return mergeFrom((org.tensorflow.proto.FeatureList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FeatureList other) { + if (other == org.tensorflow.proto.FeatureList.getDefaultInstance()) return this; + if (featureBuilder_ == null) { + if (!other.feature_.isEmpty()) { + if (feature_.isEmpty()) { + feature_ = other.feature_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFeatureIsMutable(); + feature_.addAll(other.feature_); + } + onChanged(); + } + } else { + if (!other.feature_.isEmpty()) { + if (featureBuilder_.isEmpty()) { + featureBuilder_.dispose(); + featureBuilder_ = null; + feature_ = other.feature_; + bitField0_ = (bitField0_ & ~0x00000001); + featureBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFeatureFieldBuilder() : null; + } else { + featureBuilder_.addAllMessages(other.feature_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.Feature m = + input.readMessage( + org.tensorflow.proto.Feature.parser(), + extensionRegistry); + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + feature_.add(m); + } else { + featureBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List feature_ = + java.util.Collections.emptyList(); + private void ensureFeatureIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + feature_ = new java.util.ArrayList(feature_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Feature, org.tensorflow.proto.Feature.Builder, org.tensorflow.proto.FeatureOrBuilder> featureBuilder_; + + /** + * repeated .tensorflow.Feature feature = 1; + */ + public java.util.List getFeatureList() { + if (featureBuilder_ == null) { + return java.util.Collections.unmodifiableList(feature_); + } else { + return featureBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public int getFeatureCount() { + if (featureBuilder_ == null) { + return feature_.size(); + } else { + return featureBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public org.tensorflow.proto.Feature getFeature(int index) { + if (featureBuilder_ == null) { + return feature_.get(index); + } else { + return featureBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder setFeature( + int index, org.tensorflow.proto.Feature value) { + if (featureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeatureIsMutable(); + feature_.set(index, value); + onChanged(); + } else { + featureBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder setFeature( + int index, org.tensorflow.proto.Feature.Builder builderForValue) { + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + feature_.set(index, builderForValue.build()); + onChanged(); + } else { + featureBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder addFeature(org.tensorflow.proto.Feature value) { + if (featureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeatureIsMutable(); + feature_.add(value); + onChanged(); + } else { + featureBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder addFeature( + int index, org.tensorflow.proto.Feature value) { + if (featureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeatureIsMutable(); + feature_.add(index, value); + onChanged(); + } else { + featureBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder addFeature( + org.tensorflow.proto.Feature.Builder builderForValue) { + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + feature_.add(builderForValue.build()); + onChanged(); + } else { + featureBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder addFeature( + int index, org.tensorflow.proto.Feature.Builder builderForValue) { + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + feature_.add(index, builderForValue.build()); + onChanged(); + } else { + featureBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder addAllFeature( + java.lang.Iterable values) { + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, feature_); + onChanged(); + } else { + featureBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder clearFeature() { + if (featureBuilder_ == null) { + feature_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + featureBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public Builder removeFeature(int index) { + if (featureBuilder_ == null) { + ensureFeatureIsMutable(); + feature_.remove(index); + onChanged(); + } else { + featureBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public org.tensorflow.proto.Feature.Builder getFeatureBuilder( + int index) { + return getFeatureFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public org.tensorflow.proto.FeatureOrBuilder getFeatureOrBuilder( + int index) { + if (featureBuilder_ == null) { + return feature_.get(index); } else { + return featureBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public java.util.List + getFeatureOrBuilderList() { + if (featureBuilder_ != null) { + return featureBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(feature_); + } + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public org.tensorflow.proto.Feature.Builder addFeatureBuilder() { + return getFeatureFieldBuilder().addBuilder( + org.tensorflow.proto.Feature.getDefaultInstance()); + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public org.tensorflow.proto.Feature.Builder addFeatureBuilder( + int index) { + return getFeatureFieldBuilder().addBuilder( + index, org.tensorflow.proto.Feature.getDefaultInstance()); + } + /** + * repeated .tensorflow.Feature feature = 1; + */ + public java.util.List + getFeatureBuilderList() { + return getFeatureFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Feature, org.tensorflow.proto.Feature.Builder, org.tensorflow.proto.FeatureOrBuilder> + getFeatureFieldBuilder() { + if (featureBuilder_ == null) { + featureBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Feature, org.tensorflow.proto.Feature.Builder, org.tensorflow.proto.FeatureOrBuilder>( + feature_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + feature_ = null; + } + return featureBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FeatureList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FeatureList) + private static final org.tensorflow.proto.FeatureList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FeatureList(); + } + + public static org.tensorflow.proto.FeatureList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FeatureList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListOrBuilder.java new file mode 100644 index 00000000000..c777d2f0a4d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FeatureListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FeatureList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.Feature feature = 1; + */ + java.util.List + getFeatureList(); + /** + * repeated .tensorflow.Feature feature = 1; + */ + org.tensorflow.proto.Feature getFeature(int index); + /** + * repeated .tensorflow.Feature feature = 1; + */ + int getFeatureCount(); + /** + * repeated .tensorflow.Feature feature = 1; + */ + java.util.List + getFeatureOrBuilderList(); + /** + * repeated .tensorflow.Feature feature = 1; + */ + org.tensorflow.proto.FeatureOrBuilder getFeatureOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureLists.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureLists.java new file mode 100644 index 00000000000..f69d92ebbcb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureLists.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.FeatureLists} + */ +public final class FeatureLists extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FeatureLists) + FeatureListsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FeatureLists.class.getName()); + } + // Use FeatureLists.newBuilder() to construct. + private FeatureLists(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FeatureLists() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFeatureList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureLists.class, org.tensorflow.proto.FeatureLists.Builder.class); + } + + public static final int FEATURE_LIST_FIELD_NUMBER = 1; + private static final class FeatureListDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.FeatureList> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.FeatureList.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.FeatureList> featureList_; + private com.google.protobuf.MapField + internalGetFeatureList() { + if (featureList_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeatureListDefaultEntryHolder.defaultEntry); + } + return featureList_; + } + public int getFeatureListCount() { + return internalGetFeatureList().getMap().size(); + } + /** + *
    +   * Map from feature name to feature list.
    +   * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public boolean containsFeatureList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeatureList().getMap().containsKey(key); + } + /** + * Use {@link #getFeatureListMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeatureList() { + return getFeatureListMap(); + } + /** + *
    +   * Map from feature name to feature list.
    +   * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public java.util.Map getFeatureListMap() { + return internalGetFeatureList().getMap(); + } + /** + *
    +   * Map from feature name to feature list.
    +   * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FeatureList getFeatureListOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.FeatureList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeatureList().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Map from feature name to feature list.
    +   * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureList getFeatureListOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeatureList().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFeatureList(), + FeatureListDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetFeatureList().getMap().entrySet()) { + com.google.protobuf.MapEntry + featureList__ = FeatureListDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, featureList__); + } + size += getUnknownFields().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.FeatureLists)) { + return super.equals(obj); + } + org.tensorflow.proto.FeatureLists other = (org.tensorflow.proto.FeatureLists) obj; + + if (!internalGetFeatureList().equals( + other.internalGetFeatureList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFeatureList().getMap().isEmpty()) { + hash = (37 * hash) + FEATURE_LIST_FIELD_NUMBER; + hash = (53 * hash) + internalGetFeatureList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FeatureLists parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureLists 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.FeatureLists parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureLists 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.FeatureLists parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FeatureLists parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FeatureLists parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureLists parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FeatureLists parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FeatureLists parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FeatureLists parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FeatureLists parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FeatureLists 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.FeatureLists} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FeatureLists) + org.tensorflow.proto.FeatureListsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFeatureList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableFeatureList(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FeatureLists.class, org.tensorflow.proto.FeatureLists.Builder.class); + } + + // Construct using org.tensorflow.proto.FeatureLists.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableFeatureList().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FeatureLists_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureLists getDefaultInstanceForType() { + return org.tensorflow.proto.FeatureLists.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FeatureLists build() { + org.tensorflow.proto.FeatureLists result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FeatureLists buildPartial() { + org.tensorflow.proto.FeatureLists result = new org.tensorflow.proto.FeatureLists(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FeatureLists result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.featureList_ = internalGetFeatureList().build(FeatureListDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FeatureLists) { + return mergeFrom((org.tensorflow.proto.FeatureLists)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FeatureLists other) { + if (other == org.tensorflow.proto.FeatureLists.getDefaultInstance()) return this; + internalGetMutableFeatureList().mergeFrom( + other.internalGetFeatureList()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + featureList__ = input.readMessage( + FeatureListDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFeatureList().ensureBuilderMap().put( + featureList__.getKey(), featureList__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class FeatureListConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.FeatureList build(org.tensorflow.proto.FeatureListOrBuilder val) { + if (val instanceof org.tensorflow.proto.FeatureList) { return (org.tensorflow.proto.FeatureList) val; } + return ((org.tensorflow.proto.FeatureList.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FeatureListDefaultEntryHolder.defaultEntry; + } + }; + private static final FeatureListConverter featureListConverter = new FeatureListConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.FeatureListOrBuilder, org.tensorflow.proto.FeatureList, org.tensorflow.proto.FeatureList.Builder> featureList_; + private com.google.protobuf.MapFieldBuilder + internalGetFeatureList() { + if (featureList_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(featureListConverter); + } + return featureList_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFeatureList() { + if (featureList_ == null) { + featureList_ = new com.google.protobuf.MapFieldBuilder<>(featureListConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return featureList_; + } + public int getFeatureListCount() { + return internalGetFeatureList().ensureBuilderMap().size(); + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public boolean containsFeatureList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeatureList().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFeatureListMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeatureList() { + return getFeatureListMap(); + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public java.util.Map getFeatureListMap() { + return internalGetFeatureList().getImmutableMap(); + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FeatureList getFeatureListOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.FeatureList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeatureList().ensureBuilderMap(); + return map.containsKey(key) ? featureListConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureList getFeatureListOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeatureList().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return featureListConverter.build(map.get(key)); + } + public Builder clearFeatureList() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableFeatureList().clear(); + return this; + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + public Builder removeFeatureList( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFeatureList().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFeatureList() { + bitField0_ |= 0x00000001; + return internalGetMutableFeatureList().ensureMessageMap(); + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + public Builder putFeatureList( + java.lang.String key, + org.tensorflow.proto.FeatureList value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFeatureList().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + public Builder putAllFeatureList( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFeatureList().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Map from feature name to feature list.
    +     * 
    + * + * map<string, .tensorflow.FeatureList> feature_list = 1; + */ + public org.tensorflow.proto.FeatureList.Builder putFeatureListBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableFeatureList().ensureBuilderMap(); + org.tensorflow.proto.FeatureListOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.FeatureList.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.FeatureList) { + entry = ((org.tensorflow.proto.FeatureList) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.FeatureList.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FeatureLists) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FeatureLists) + private static final org.tensorflow.proto.FeatureLists DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FeatureLists(); + } + + public static org.tensorflow.proto.FeatureLists getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FeatureLists parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FeatureLists getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListsOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListsOrBuilder.java index 9f582b998ce..d42e63918ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeatureListsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureListsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.example; +package org.tensorflow.proto; public interface FeatureListsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.FeatureLists) @@ -28,7 +30,7 @@ boolean containsFeatureList( * Use {@link #getFeatureListMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getFeatureList(); /** *
    @@ -37,7 +39,7 @@ boolean containsFeatureList(
        *
        * map<string, .tensorflow.FeatureList> feature_list = 1;
        */
    -  java.util.Map
    +  java.util.Map
       getFeatureListMap();
       /**
        * 
    @@ -46,10 +48,11 @@ boolean containsFeatureList(
        *
        * map<string, .tensorflow.FeatureList> feature_list = 1;
        */
    -
    -  org.tensorflow.proto.example.FeatureList getFeatureListOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.FeatureList getFeatureListOrDefault(
           java.lang.String key,
    -      org.tensorflow.proto.example.FeatureList defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.FeatureList defaultValue);
       /**
        * 
        * Map from feature name to feature list.
    @@ -57,7 +60,6 @@ org.tensorflow.proto.example.FeatureList getFeatureListOrDefault(
        *
        * map<string, .tensorflow.FeatureList> feature_list = 1;
        */
    -
    -  org.tensorflow.proto.example.FeatureList getFeatureListOrThrow(
    +  org.tensorflow.proto.FeatureList getFeatureListOrThrow(
           java.lang.String key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureOrBuilder.java
    new file mode 100644
    index 00000000000..04375d60edf
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureOrBuilder.java
    @@ -0,0 +1,58 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/example/feature.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface FeatureOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.Feature)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * .tensorflow.BytesList bytes_list = 1;
    +   * @return Whether the bytesList field is set.
    +   */
    +  boolean hasBytesList();
    +  /**
    +   * .tensorflow.BytesList bytes_list = 1;
    +   * @return The bytesList.
    +   */
    +  org.tensorflow.proto.BytesList getBytesList();
    +  /**
    +   * .tensorflow.BytesList bytes_list = 1;
    +   */
    +  org.tensorflow.proto.BytesListOrBuilder getBytesListOrBuilder();
    +
    +  /**
    +   * .tensorflow.FloatList float_list = 2;
    +   * @return Whether the floatList field is set.
    +   */
    +  boolean hasFloatList();
    +  /**
    +   * .tensorflow.FloatList float_list = 2;
    +   * @return The floatList.
    +   */
    +  org.tensorflow.proto.FloatList getFloatList();
    +  /**
    +   * .tensorflow.FloatList float_list = 2;
    +   */
    +  org.tensorflow.proto.FloatListOrBuilder getFloatListOrBuilder();
    +
    +  /**
    +   * .tensorflow.Int64List int64_list = 3;
    +   * @return Whether the int64List field is set.
    +   */
    +  boolean hasInt64List();
    +  /**
    +   * .tensorflow.Int64List int64_list = 3;
    +   * @return The int64List.
    +   */
    +  org.tensorflow.proto.Int64List getInt64List();
    +  /**
    +   * .tensorflow.Int64List int64_list = 3;
    +   */
    +  org.tensorflow.proto.Int64ListOrBuilder getInt64ListOrBuilder();
    +
    +  org.tensorflow.proto.Feature.KindCase getKindCase();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureProtos.java
    new file mode 100644
    index 00000000000..056432bdb1a
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeatureProtos.java
    @@ -0,0 +1,165 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/example/feature.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class FeatureProtos {
    +  private FeatureProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      FeatureProtos.class.getName());
    +  }
    +  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_BytesList_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_BytesList_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_FloatList_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_FloatList_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Int64List_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Int64List_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Feature_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Feature_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Features_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Features_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Features_FeatureEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Features_FeatureEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_FeatureList_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_FeatureList_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_FeatureLists_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_FeatureLists_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_FeatureLists_FeatureListEntry_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/example/feature.proto\022" +
    +      "\ntensorflow\"\032\n\tBytesList\022\r\n\005value\030\001 \003(\014\"" +
    +      "\036\n\tFloatList\022\021\n\005value\030\001 \003(\002B\002\020\001\" \n\tInt64" +
    +      "List\022\023\n\005value\030\001 \003(\003B\004\020\0010\001\"\230\001\n\007Feature\022+\n" +
    +      "\nbytes_list\030\001 \001(\0132\025.tensorflow.BytesList" +
    +      "H\000\022+\n\nfloat_list\030\002 \001(\0132\025.tensorflow.Floa" +
    +      "tListH\000\022+\n\nint64_list\030\003 \001(\0132\025.tensorflow" +
    +      ".Int64ListH\000B\006\n\004kind\"\203\001\n\010Features\0222\n\007fea" +
    +      "ture\030\001 \003(\0132!.tensorflow.Features.Feature" +
    +      "Entry\032C\n\014FeatureEntry\022\013\n\003key\030\001 \001(\t\022\"\n\005va" +
    +      "lue\030\002 \001(\0132\023.tensorflow.Feature:\0028\001\"3\n\013Fe" +
    +      "atureList\022$\n\007feature\030\001 \003(\0132\023.tensorflow." +
    +      "Feature\"\234\001\n\014FeatureLists\022?\n\014feature_list" +
    +      "\030\001 \003(\0132).tensorflow.FeatureLists.Feature" +
    +      "ListEntry\032K\n\020FeatureListEntry\022\013\n\003key\030\001 \001" +
    +      "(\t\022&\n\005value\030\002 \001(\0132\027.tensorflow.FeatureLi" +
    +      "st:\0028\001B\177\n\024org.tensorflow.protoB\rFeatureP" +
    +      "rotosP\001ZSgithub.com/tensorflow/tensorflo" +
    +      "w/tensorflow/go/core/example/example_pro" +
    +      "tos_go_proto\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +        });
    +    internal_static_tensorflow_BytesList_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_BytesList_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_BytesList_descriptor,
    +        new java.lang.String[] { "Value", });
    +    internal_static_tensorflow_FloatList_descriptor =
    +      getDescriptor().getMessageTypes().get(1);
    +    internal_static_tensorflow_FloatList_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_FloatList_descriptor,
    +        new java.lang.String[] { "Value", });
    +    internal_static_tensorflow_Int64List_descriptor =
    +      getDescriptor().getMessageTypes().get(2);
    +    internal_static_tensorflow_Int64List_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Int64List_descriptor,
    +        new java.lang.String[] { "Value", });
    +    internal_static_tensorflow_Feature_descriptor =
    +      getDescriptor().getMessageTypes().get(3);
    +    internal_static_tensorflow_Feature_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Feature_descriptor,
    +        new java.lang.String[] { "BytesList", "FloatList", "Int64List", "Kind", });
    +    internal_static_tensorflow_Features_descriptor =
    +      getDescriptor().getMessageTypes().get(4);
    +    internal_static_tensorflow_Features_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Features_descriptor,
    +        new java.lang.String[] { "Feature", });
    +    internal_static_tensorflow_Features_FeatureEntry_descriptor =
    +      internal_static_tensorflow_Features_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_Features_FeatureEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Features_FeatureEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    internal_static_tensorflow_FeatureList_descriptor =
    +      getDescriptor().getMessageTypes().get(5);
    +    internal_static_tensorflow_FeatureList_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_FeatureList_descriptor,
    +        new java.lang.String[] { "Feature", });
    +    internal_static_tensorflow_FeatureLists_descriptor =
    +      getDescriptor().getMessageTypes().get(6);
    +    internal_static_tensorflow_FeatureLists_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_FeatureLists_descriptor,
    +        new java.lang.String[] { "FeatureList", });
    +    internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor =
    +      internal_static_tensorflow_FeatureLists_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_FeatureLists_FeatureListEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_FeatureLists_FeatureListEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    descriptor.resolveAllFeaturesImmutable();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Features.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Features.java
    new file mode 100644
    index 00000000000..09565c43a05
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Features.java
    @@ -0,0 +1,719 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/example/feature.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.Features}
    + */
    +public final class Features extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.Features)
    +    FeaturesOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      Features.class.getName());
    +  }
    +  // Use Features.newBuilder() to construct.
    +  private Features(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private Features() {
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_descriptor;
    +  }
    +
    +  @SuppressWarnings({"rawtypes"})
    +  @java.lang.Override
    +  protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
    +      int number) {
    +    switch (number) {
    +      case 1:
    +        return internalGetFeature();
    +      default:
    +        throw new RuntimeException(
    +            "Invalid map field number: " + number);
    +    }
    +  }
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.Features.class, org.tensorflow.proto.Features.Builder.class);
    +  }
    +
    +  public static final int FEATURE_FIELD_NUMBER = 1;
    +  private static final class FeatureDefaultEntryHolder {
    +    static final com.google.protobuf.MapEntry<
    +        java.lang.String, org.tensorflow.proto.Feature> defaultEntry =
    +            com.google.protobuf.MapEntry
    +            .newDefaultInstance(
    +                org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_FeatureEntry_descriptor, 
    +                com.google.protobuf.WireFormat.FieldType.STRING,
    +                "",
    +                com.google.protobuf.WireFormat.FieldType.MESSAGE,
    +                org.tensorflow.proto.Feature.getDefaultInstance());
    +  }
    +  @SuppressWarnings("serial")
    +  private com.google.protobuf.MapField<
    +      java.lang.String, org.tensorflow.proto.Feature> feature_;
    +  private com.google.protobuf.MapField
    +  internalGetFeature() {
    +    if (feature_ == null) {
    +      return com.google.protobuf.MapField.emptyMapField(
    +          FeatureDefaultEntryHolder.defaultEntry);
    +    }
    +    return feature_;
    +  }
    +  public int getFeatureCount() {
    +    return internalGetFeature().getMap().size();
    +  }
    +  /**
    +   * 
    +   * Map from feature name to feature.
    +   * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public boolean containsFeature( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeature().getMap().containsKey(key); + } + /** + * Use {@link #getFeatureMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeature() { + return getFeatureMap(); + } + /** + *
    +   * Map from feature name to feature.
    +   * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public java.util.Map getFeatureMap() { + return internalGetFeature().getMap(); + } + /** + *
    +   * Map from feature name to feature.
    +   * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.Feature getFeatureOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.Feature defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeature().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Map from feature name to feature.
    +   * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Feature getFeatureOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFeature().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFeature(), + FeatureDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetFeature().getMap().entrySet()) { + com.google.protobuf.MapEntry + feature__ = FeatureDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, feature__); + } + size += getUnknownFields().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.Features)) { + return super.equals(obj); + } + org.tensorflow.proto.Features other = (org.tensorflow.proto.Features) obj; + + if (!internalGetFeature().equals( + other.internalGetFeature())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFeature().getMap().isEmpty()) { + hash = (37 * hash) + FEATURE_FIELD_NUMBER; + hash = (53 * hash) + internalGetFeature().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Features parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Features 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.Features parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Features 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.Features parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Features parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Features parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Features parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Features parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Features parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Features parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Features parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Features 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.Features} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Features) + org.tensorflow.proto.FeaturesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFeature(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableFeature(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Features.class, org.tensorflow.proto.Features.Builder.class); + } + + // Construct using org.tensorflow.proto.Features.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableFeature().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Features_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Features getDefaultInstanceForType() { + return org.tensorflow.proto.Features.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Features build() { + org.tensorflow.proto.Features result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Features buildPartial() { + org.tensorflow.proto.Features result = new org.tensorflow.proto.Features(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Features result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.feature_ = internalGetFeature().build(FeatureDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Features) { + return mergeFrom((org.tensorflow.proto.Features)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Features other) { + if (other == org.tensorflow.proto.Features.getDefaultInstance()) return this; + internalGetMutableFeature().mergeFrom( + other.internalGetFeature()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + feature__ = input.readMessage( + FeatureDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFeature().ensureBuilderMap().put( + feature__.getKey(), feature__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class FeatureConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.Feature build(org.tensorflow.proto.FeatureOrBuilder val) { + if (val instanceof org.tensorflow.proto.Feature) { return (org.tensorflow.proto.Feature) val; } + return ((org.tensorflow.proto.Feature.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FeatureDefaultEntryHolder.defaultEntry; + } + }; + private static final FeatureConverter featureConverter = new FeatureConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.FeatureOrBuilder, org.tensorflow.proto.Feature, org.tensorflow.proto.Feature.Builder> feature_; + private com.google.protobuf.MapFieldBuilder + internalGetFeature() { + if (feature_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(featureConverter); + } + return feature_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFeature() { + if (feature_ == null) { + feature_ = new com.google.protobuf.MapFieldBuilder<>(featureConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return feature_; + } + public int getFeatureCount() { + return internalGetFeature().ensureBuilderMap().size(); + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public boolean containsFeature( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFeature().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFeatureMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFeature() { + return getFeatureMap(); + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public java.util.Map getFeatureMap() { + return internalGetFeature().getImmutableMap(); + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.Feature getFeatureOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.Feature defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeature().ensureBuilderMap(); + return map.containsKey(key) ? featureConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Feature getFeatureOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFeature().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return featureConverter.build(map.get(key)); + } + public Builder clearFeature() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableFeature().clear(); + return this; + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + public Builder removeFeature( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFeature().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFeature() { + bitField0_ |= 0x00000001; + return internalGetMutableFeature().ensureMessageMap(); + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + public Builder putFeature( + java.lang.String key, + org.tensorflow.proto.Feature value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFeature().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + public Builder putAllFeature( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFeature().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Map from feature name to feature.
    +     * 
    + * + * map<string, .tensorflow.Feature> feature = 1; + */ + public org.tensorflow.proto.Feature.Builder putFeatureBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableFeature().ensureBuilderMap(); + org.tensorflow.proto.FeatureOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.Feature.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.Feature) { + entry = ((org.tensorflow.proto.Feature) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.Feature.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Features) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Features) + private static final org.tensorflow.proto.Features DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Features(); + } + + public static org.tensorflow.proto.Features getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Features parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Features getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeaturesOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeaturesOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeaturesOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeaturesOrBuilder.java index 2ee80ee66a0..ccc86b2da95 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/example/FeaturesOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FeaturesOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.example; +package org.tensorflow.proto; public interface FeaturesOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.Features) @@ -28,7 +30,7 @@ boolean containsFeature( * Use {@link #getFeatureMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getFeature(); /** *
    @@ -37,7 +39,7 @@ boolean containsFeature(
        *
        * map<string, .tensorflow.Feature> feature = 1;
        */
    -  java.util.Map
    +  java.util.Map
       getFeatureMap();
       /**
        * 
    @@ -46,10 +48,11 @@ boolean containsFeature(
        *
        * map<string, .tensorflow.Feature> feature = 1;
        */
    -
    -  org.tensorflow.proto.example.Feature getFeatureOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.Feature getFeatureOrDefault(
           java.lang.String key,
    -      org.tensorflow.proto.example.Feature defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.Feature defaultValue);
       /**
        * 
        * Map from feature name to feature.
    @@ -57,7 +60,6 @@ org.tensorflow.proto.example.Feature getFeatureOrDefault(
        *
        * map<string, .tensorflow.Feature> feature = 1;
        */
    -
    -  org.tensorflow.proto.example.Feature getFeatureOrThrow(
    +  org.tensorflow.proto.Feature getFeatureOrThrow(
           java.lang.String key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDef.java
    new file mode 100644
    index 00000000000..d26cf3ac830
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDef.java
    @@ -0,0 +1,1199 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/fingerprint.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing a SavedModel Fingerprint.
    + *
    + * If there are multiple MetaGraphDefs in the SavedModel, the FingerprintDef
    + * corresponds to the first one.
    + * 
    + * + * Protobuf type {@code tensorflow.FingerprintDef} + */ +public final class FingerprintDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FingerprintDef) + FingerprintDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FingerprintDef.class.getName()); + } + // Use FingerprintDef.newBuilder() to construct. + private FingerprintDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FingerprintDef() { + uuid_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FingerprintProtos.internal_static_tensorflow_FingerprintDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FingerprintProtos.internal_static_tensorflow_FingerprintDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FingerprintDef.class, org.tensorflow.proto.FingerprintDef.Builder.class); + } + + private int bitField0_; + public static final int SAVED_MODEL_CHECKSUM_FIELD_NUMBER = 1; + private long savedModelChecksum_ = 0L; + /** + *
    +   * Hash of the saved_model.pb, referred to as a "checksum".
    +   * 
    + * + * uint64 saved_model_checksum = 1; + * @return The savedModelChecksum. + */ + @java.lang.Override + public long getSavedModelChecksum() { + return savedModelChecksum_; + } + + public static final int GRAPH_DEF_PROGRAM_HASH_FIELD_NUMBER = 2; + private long graphDefProgramHash_ = 0L; + /** + *
    +   * Hash of regularized graph_def.
    +   * 
    + * + * uint64 graph_def_program_hash = 2; + * @return The graphDefProgramHash. + */ + @java.lang.Override + public long getGraphDefProgramHash() { + return graphDefProgramHash_; + } + + public static final int SIGNATURE_DEF_HASH_FIELD_NUMBER = 3; + private long signatureDefHash_ = 0L; + /** + *
    +   * Hash of the regularized (sorted) SignatureDefs.
    +   * 
    + * + * uint64 signature_def_hash = 3; + * @return The signatureDefHash. + */ + @java.lang.Override + public long getSignatureDefHash() { + return signatureDefHash_; + } + + public static final int SAVED_OBJECT_GRAPH_HASH_FIELD_NUMBER = 4; + private long savedObjectGraphHash_ = 0L; + /** + *
    +   * Hash of the regularized SavedObjectGraph.
    +   * 
    + * + * uint64 saved_object_graph_hash = 4; + * @return The savedObjectGraphHash. + */ + @java.lang.Override + public long getSavedObjectGraphHash() { + return savedObjectGraphHash_; + } + + public static final int CHECKPOINT_HASH_FIELD_NUMBER = 5; + private long checkpointHash_ = 0L; + /** + *
    +   * Hash of the checkpoint.
    +   * 
    + * + * uint64 checkpoint_hash = 5; + * @return The checkpointHash. + */ + @java.lang.Override + public long getCheckpointHash() { + return checkpointHash_; + } + + public static final int UUID_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object uuid_ = ""; + /** + *
    +   * An UUID for the model, chosen at random, not related to the hashes.
    +   * 
    + * + * string uuid = 7; + * @return The uuid. + */ + @java.lang.Override + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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(); + uuid_ = s; + return s; + } + } + /** + *
    +   * An UUID for the model, chosen at random, not related to the hashes.
    +   * 
    + * + * string uuid = 7; + * @return The bytes for uuid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 6; + private org.tensorflow.proto.VersionDef version_; + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + * @return The version. + */ + @java.lang.Override + public org.tensorflow.proto.VersionDef getVersion() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + */ + @java.lang.Override + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + + 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 (savedModelChecksum_ != 0L) { + output.writeUInt64(1, savedModelChecksum_); + } + if (graphDefProgramHash_ != 0L) { + output.writeUInt64(2, graphDefProgramHash_); + } + if (signatureDefHash_ != 0L) { + output.writeUInt64(3, signatureDefHash_); + } + if (savedObjectGraphHash_ != 0L) { + output.writeUInt64(4, savedObjectGraphHash_); + } + if (checkpointHash_ != 0L) { + output.writeUInt64(5, checkpointHash_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getVersion()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uuid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, uuid_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (savedModelChecksum_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, savedModelChecksum_); + } + if (graphDefProgramHash_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, graphDefProgramHash_); + } + if (signatureDefHash_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, signatureDefHash_); + } + if (savedObjectGraphHash_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, savedObjectGraphHash_); + } + if (checkpointHash_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, checkpointHash_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getVersion()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uuid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, uuid_); + } + size += getUnknownFields().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.FingerprintDef)) { + return super.equals(obj); + } + org.tensorflow.proto.FingerprintDef other = (org.tensorflow.proto.FingerprintDef) obj; + + if (getSavedModelChecksum() + != other.getSavedModelChecksum()) return false; + if (getGraphDefProgramHash() + != other.getGraphDefProgramHash()) return false; + if (getSignatureDefHash() + != other.getSignatureDefHash()) return false; + if (getSavedObjectGraphHash() + != other.getSavedObjectGraphHash()) return false; + if (getCheckpointHash() + != other.getCheckpointHash()) return false; + if (!getUuid() + .equals(other.getUuid())) return false; + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion() + .equals(other.getVersion())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SAVED_MODEL_CHECKSUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSavedModelChecksum()); + hash = (37 * hash) + GRAPH_DEF_PROGRAM_HASH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGraphDefProgramHash()); + hash = (37 * hash) + SIGNATURE_DEF_HASH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSignatureDefHash()); + hash = (37 * hash) + SAVED_OBJECT_GRAPH_HASH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSavedObjectGraphHash()); + hash = (37 * hash) + CHECKPOINT_HASH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCheckpointHash()); + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FingerprintDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FingerprintDef 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.FingerprintDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FingerprintDef 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.FingerprintDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FingerprintDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FingerprintDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FingerprintDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FingerprintDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FingerprintDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FingerprintDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FingerprintDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FingerprintDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a SavedModel Fingerprint.
    +   *
    +   * If there are multiple MetaGraphDefs in the SavedModel, the FingerprintDef
    +   * corresponds to the first one.
    +   * 
    + * + * Protobuf type {@code tensorflow.FingerprintDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FingerprintDef) + org.tensorflow.proto.FingerprintDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FingerprintProtos.internal_static_tensorflow_FingerprintDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FingerprintProtos.internal_static_tensorflow_FingerprintDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FingerprintDef.class, org.tensorflow.proto.FingerprintDef.Builder.class); + } + + // Construct using org.tensorflow.proto.FingerprintDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + savedModelChecksum_ = 0L; + graphDefProgramHash_ = 0L; + signatureDefHash_ = 0L; + savedObjectGraphHash_ = 0L; + checkpointHash_ = 0L; + uuid_ = ""; + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FingerprintProtos.internal_static_tensorflow_FingerprintDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FingerprintDef getDefaultInstanceForType() { + return org.tensorflow.proto.FingerprintDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FingerprintDef build() { + org.tensorflow.proto.FingerprintDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FingerprintDef buildPartial() { + org.tensorflow.proto.FingerprintDef result = new org.tensorflow.proto.FingerprintDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FingerprintDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.savedModelChecksum_ = savedModelChecksum_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.graphDefProgramHash_ = graphDefProgramHash_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.signatureDefHash_ = signatureDefHash_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.savedObjectGraphHash_ = savedObjectGraphHash_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.checkpointHash_ = checkpointHash_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.uuid_ = uuid_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.version_ = versionBuilder_ == null + ? version_ + : versionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FingerprintDef) { + return mergeFrom((org.tensorflow.proto.FingerprintDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FingerprintDef other) { + if (other == org.tensorflow.proto.FingerprintDef.getDefaultInstance()) return this; + if (other.getSavedModelChecksum() != 0L) { + setSavedModelChecksum(other.getSavedModelChecksum()); + } + if (other.getGraphDefProgramHash() != 0L) { + setGraphDefProgramHash(other.getGraphDefProgramHash()); + } + if (other.getSignatureDefHash() != 0L) { + setSignatureDefHash(other.getSignatureDefHash()); + } + if (other.getSavedObjectGraphHash() != 0L) { + setSavedObjectGraphHash(other.getSavedObjectGraphHash()); + } + if (other.getCheckpointHash() != 0L) { + setCheckpointHash(other.getCheckpointHash()); + } + if (!other.getUuid().isEmpty()) { + uuid_ = other.uuid_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + savedModelChecksum_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + graphDefProgramHash_ = input.readUInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + signatureDefHash_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + savedObjectGraphHash_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + checkpointHash_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + input.readMessage( + getVersionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: { + uuid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long savedModelChecksum_ ; + /** + *
    +     * Hash of the saved_model.pb, referred to as a "checksum".
    +     * 
    + * + * uint64 saved_model_checksum = 1; + * @return The savedModelChecksum. + */ + @java.lang.Override + public long getSavedModelChecksum() { + return savedModelChecksum_; + } + /** + *
    +     * Hash of the saved_model.pb, referred to as a "checksum".
    +     * 
    + * + * uint64 saved_model_checksum = 1; + * @param value The savedModelChecksum to set. + * @return This builder for chaining. + */ + public Builder setSavedModelChecksum(long value) { + + savedModelChecksum_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Hash of the saved_model.pb, referred to as a "checksum".
    +     * 
    + * + * uint64 saved_model_checksum = 1; + * @return This builder for chaining. + */ + public Builder clearSavedModelChecksum() { + bitField0_ = (bitField0_ & ~0x00000001); + savedModelChecksum_ = 0L; + onChanged(); + return this; + } + + private long graphDefProgramHash_ ; + /** + *
    +     * Hash of regularized graph_def.
    +     * 
    + * + * uint64 graph_def_program_hash = 2; + * @return The graphDefProgramHash. + */ + @java.lang.Override + public long getGraphDefProgramHash() { + return graphDefProgramHash_; + } + /** + *
    +     * Hash of regularized graph_def.
    +     * 
    + * + * uint64 graph_def_program_hash = 2; + * @param value The graphDefProgramHash to set. + * @return This builder for chaining. + */ + public Builder setGraphDefProgramHash(long value) { + + graphDefProgramHash_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Hash of regularized graph_def.
    +     * 
    + * + * uint64 graph_def_program_hash = 2; + * @return This builder for chaining. + */ + public Builder clearGraphDefProgramHash() { + bitField0_ = (bitField0_ & ~0x00000002); + graphDefProgramHash_ = 0L; + onChanged(); + return this; + } + + private long signatureDefHash_ ; + /** + *
    +     * Hash of the regularized (sorted) SignatureDefs.
    +     * 
    + * + * uint64 signature_def_hash = 3; + * @return The signatureDefHash. + */ + @java.lang.Override + public long getSignatureDefHash() { + return signatureDefHash_; + } + /** + *
    +     * Hash of the regularized (sorted) SignatureDefs.
    +     * 
    + * + * uint64 signature_def_hash = 3; + * @param value The signatureDefHash to set. + * @return This builder for chaining. + */ + public Builder setSignatureDefHash(long value) { + + signatureDefHash_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Hash of the regularized (sorted) SignatureDefs.
    +     * 
    + * + * uint64 signature_def_hash = 3; + * @return This builder for chaining. + */ + public Builder clearSignatureDefHash() { + bitField0_ = (bitField0_ & ~0x00000004); + signatureDefHash_ = 0L; + onChanged(); + return this; + } + + private long savedObjectGraphHash_ ; + /** + *
    +     * Hash of the regularized SavedObjectGraph.
    +     * 
    + * + * uint64 saved_object_graph_hash = 4; + * @return The savedObjectGraphHash. + */ + @java.lang.Override + public long getSavedObjectGraphHash() { + return savedObjectGraphHash_; + } + /** + *
    +     * Hash of the regularized SavedObjectGraph.
    +     * 
    + * + * uint64 saved_object_graph_hash = 4; + * @param value The savedObjectGraphHash to set. + * @return This builder for chaining. + */ + public Builder setSavedObjectGraphHash(long value) { + + savedObjectGraphHash_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Hash of the regularized SavedObjectGraph.
    +     * 
    + * + * uint64 saved_object_graph_hash = 4; + * @return This builder for chaining. + */ + public Builder clearSavedObjectGraphHash() { + bitField0_ = (bitField0_ & ~0x00000008); + savedObjectGraphHash_ = 0L; + onChanged(); + return this; + } + + private long checkpointHash_ ; + /** + *
    +     * Hash of the checkpoint.
    +     * 
    + * + * uint64 checkpoint_hash = 5; + * @return The checkpointHash. + */ + @java.lang.Override + public long getCheckpointHash() { + return checkpointHash_; + } + /** + *
    +     * Hash of the checkpoint.
    +     * 
    + * + * uint64 checkpoint_hash = 5; + * @param value The checkpointHash to set. + * @return This builder for chaining. + */ + public Builder setCheckpointHash(long value) { + + checkpointHash_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Hash of the checkpoint.
    +     * 
    + * + * uint64 checkpoint_hash = 5; + * @return This builder for chaining. + */ + public Builder clearCheckpointHash() { + bitField0_ = (bitField0_ & ~0x00000010); + checkpointHash_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object uuid_ = ""; + /** + *
    +     * An UUID for the model, chosen at random, not related to the hashes.
    +     * 
    + * + * string uuid = 7; + * @return The uuid. + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uuid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * An UUID for the model, chosen at random, not related to the hashes.
    +     * 
    + * + * string uuid = 7; + * @return The bytes for uuid. + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * An UUID for the model, chosen at random, not related to the hashes.
    +     * 
    + * + * string uuid = 7; + * @param value The uuid to set. + * @return This builder for chaining. + */ + public Builder setUuid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + uuid_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * An UUID for the model, chosen at random, not related to the hashes.
    +     * 
    + * + * string uuid = 7; + * @return This builder for chaining. + */ + public Builder clearUuid() { + uuid_ = getDefaultInstance().getUuid(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * An UUID for the model, chosen at random, not related to the hashes.
    +     * 
    + * + * string uuid = 7; + * @param value The bytes for uuid to set. + * @return This builder for chaining. + */ + public Builder setUuidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + uuid_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private org.tensorflow.proto.VersionDef version_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> versionBuilder_; + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + * @return The version. + */ + public org.tensorflow.proto.VersionDef getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public Builder setVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public Builder setVersion( + org.tensorflow.proto.VersionDef.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public Builder mergeVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + version_ != null && + version_ != org.tensorflow.proto.VersionDef.getDefaultInstance()) { + getVersionBuilder().mergeFrom(value); + } else { + version_ = value; + } + } else { + versionBuilder_.mergeFrom(value); + } + if (version_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000040); + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public org.tensorflow.proto.VersionDef.Builder getVersionBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + } + /** + *
    +     * Version specification of the fingerprint.
    +     * 
    + * + * .tensorflow.VersionDef version = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FingerprintDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FingerprintDef) + private static final org.tensorflow.proto.FingerprintDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FingerprintDef(); + } + + public static org.tensorflow.proto.FingerprintDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FingerprintDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FingerprintDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDefOrBuilder.java new file mode 100644 index 00000000000..1dc0c870f7d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintDefOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/fingerprint.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FingerprintDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FingerprintDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Hash of the saved_model.pb, referred to as a "checksum".
    +   * 
    + * + * uint64 saved_model_checksum = 1; + * @return The savedModelChecksum. + */ + long getSavedModelChecksum(); + + /** + *
    +   * Hash of regularized graph_def.
    +   * 
    + * + * uint64 graph_def_program_hash = 2; + * @return The graphDefProgramHash. + */ + long getGraphDefProgramHash(); + + /** + *
    +   * Hash of the regularized (sorted) SignatureDefs.
    +   * 
    + * + * uint64 signature_def_hash = 3; + * @return The signatureDefHash. + */ + long getSignatureDefHash(); + + /** + *
    +   * Hash of the regularized SavedObjectGraph.
    +   * 
    + * + * uint64 saved_object_graph_hash = 4; + * @return The savedObjectGraphHash. + */ + long getSavedObjectGraphHash(); + + /** + *
    +   * Hash of the checkpoint.
    +   * 
    + * + * uint64 checkpoint_hash = 5; + * @return The checkpointHash. + */ + long getCheckpointHash(); + + /** + *
    +   * An UUID for the model, chosen at random, not related to the hashes.
    +   * 
    + * + * string uuid = 7; + * @return The uuid. + */ + java.lang.String getUuid(); + /** + *
    +   * An UUID for the model, chosen at random, not related to the hashes.
    +   * 
    + * + * string uuid = 7; + * @return The bytes for uuid. + */ + com.google.protobuf.ByteString + getUuidBytes(); + + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + * @return The version. + */ + org.tensorflow.proto.VersionDef getVersion(); + /** + *
    +   * Version specification of the fingerprint.
    +   * 
    + * + * .tensorflow.VersionDef version = 6; + */ + org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintProtos.java new file mode 100644 index 00000000000..734b9b30e63 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FingerprintProtos.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/fingerprint.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class FingerprintProtos { + private FingerprintProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FingerprintProtos.class.getName()); + } + 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_FingerprintDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_FingerprintDef_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/fingerprint.p" + + "roto\022\ntensorflow\032(tensorflow/core/framew" + + "ork/versions.proto\"\333\001\n\016FingerprintDef\022\034\n" + + "\024saved_model_checksum\030\001 \001(\004\022\036\n\026graph_def" + + "_program_hash\030\002 \001(\004\022\032\n\022signature_def_has" + + "h\030\003 \001(\004\022\037\n\027saved_object_graph_hash\030\004 \001(\004" + + "\022\027\n\017checkpoint_hash\030\005 \001(\004\022\014\n\004uuid\030\007 \001(\t\022" + + "\'\n\007version\030\006 \001(\0132\026.tensorflow.VersionDef" + + "B\205\001\n\024org.tensorflow.protoB\021FingerprintPr" + + "otosP\001ZUgithub.com/tensorflow/tensorflow" + + "/tensorflow/go/core/protobuf/for_core_pr" + + "otos_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.VersionsProtos.getDescriptor(), + }); + internal_static_tensorflow_FingerprintDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_FingerprintDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_FingerprintDef_descriptor, + new java.lang.String[] { "SavedModelChecksum", "GraphDefProgramHash", "SignatureDefHash", "SavedObjectGraphHash", "CheckpointHash", "Uuid", "Version", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.VersionsProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProto.java new file mode 100644 index 00000000000..70708dadbba --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProto.java @@ -0,0 +1,973 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.FixedLenFeatureProto} + */ +public final class FixedLenFeatureProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FixedLenFeatureProto) + FixedLenFeatureProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FixedLenFeatureProto.class.getName()); + } + // Use FixedLenFeatureProto.newBuilder() to construct. + private FixedLenFeatureProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FixedLenFeatureProto() { + dtype_ = 0; + valuesOutputTensorName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FixedLenFeatureProto.class, org.tensorflow.proto.FixedLenFeatureProto.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorProto defaultValue_; + /** + * .tensorflow.TensorProto default_value = 3; + * @return Whether the defaultValue field is set. + */ + @java.lang.Override + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorProto default_value = 3; + * @return The defaultValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getDefaultValue() { + return defaultValue_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : defaultValue_; + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getDefaultValueOrBuilder() { + return defaultValue_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : defaultValue_; + } + + public static final int VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object valuesOutputTensorName_ = ""; + /** + * string values_output_tensor_name = 4; + * @return The valuesOutputTensorName. + */ + @java.lang.Override + public java.lang.String getValuesOutputTensorName() { + java.lang.Object ref = valuesOutputTensorName_; + 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(); + valuesOutputTensorName_ = s; + return s; + } + } + /** + * string values_output_tensor_name = 4; + * @return The bytes for valuesOutputTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValuesOutputTensorNameBytes() { + java.lang.Object ref = valuesOutputTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valuesOutputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesOutputTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, valuesOutputTensorName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesOutputTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, valuesOutputTensorName_); + } + size += getUnknownFields().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.FixedLenFeatureProto)) { + return super.equals(obj); + } + org.tensorflow.proto.FixedLenFeatureProto other = (org.tensorflow.proto.FixedLenFeatureProto) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (hasDefaultValue() != other.hasDefaultValue()) return false; + if (hasDefaultValue()) { + if (!getDefaultValue() + .equals(other.getDefaultValue())) return false; + } + if (!getValuesOutputTensorName() + .equals(other.getValuesOutputTensorName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + if (hasDefaultValue()) { + hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultValue().hashCode(); + } + hash = (37 * hash) + VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getValuesOutputTensorName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FixedLenFeatureProto 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.FixedLenFeatureProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FixedLenFeatureProto 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.FixedLenFeatureProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FixedLenFeatureProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FixedLenFeatureProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FixedLenFeatureProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FixedLenFeatureProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.FixedLenFeatureProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FixedLenFeatureProto) + org.tensorflow.proto.FixedLenFeatureProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FixedLenFeatureProto.class, org.tensorflow.proto.FixedLenFeatureProto.Builder.class); + } + + // Construct using org.tensorflow.proto.FixedLenFeatureProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getDefaultValueFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + valuesOutputTensorName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_FixedLenFeatureProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProto getDefaultInstanceForType() { + return org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProto build() { + org.tensorflow.proto.FixedLenFeatureProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FixedLenFeatureProto buildPartial() { + org.tensorflow.proto.FixedLenFeatureProto result = new org.tensorflow.proto.FixedLenFeatureProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FixedLenFeatureProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.defaultValue_ = defaultValueBuilder_ == null + ? defaultValue_ + : defaultValueBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.valuesOutputTensorName_ = valuesOutputTensorName_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FixedLenFeatureProto) { + return mergeFrom((org.tensorflow.proto.FixedLenFeatureProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FixedLenFeatureProto other) { + if (other == org.tensorflow.proto.FixedLenFeatureProto.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.hasDefaultValue()) { + mergeDefaultValue(other.getDefaultValue()); + } + if (!other.getValuesOutputTensorName().isEmpty()) { + valuesOutputTensorName_ = other.valuesOutputTensorName_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getDefaultValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + valuesOutputTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private org.tensorflow.proto.TensorProto defaultValue_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> defaultValueBuilder_; + /** + * .tensorflow.TensorProto default_value = 3; + * @return Whether the defaultValue field is set. + */ + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.TensorProto default_value = 3; + * @return The defaultValue. + */ + public org.tensorflow.proto.TensorProto getDefaultValue() { + if (defaultValueBuilder_ == null) { + return defaultValue_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : defaultValue_; + } else { + return defaultValueBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public Builder setDefaultValue(org.tensorflow.proto.TensorProto value) { + if (defaultValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultValue_ = value; + } else { + defaultValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public Builder setDefaultValue( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (defaultValueBuilder_ == null) { + defaultValue_ = builderForValue.build(); + } else { + defaultValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public Builder mergeDefaultValue(org.tensorflow.proto.TensorProto value) { + if (defaultValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + defaultValue_ != null && + defaultValue_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getDefaultValueBuilder().mergeFrom(value); + } else { + defaultValue_ = value; + } + } else { + defaultValueBuilder_.mergeFrom(value); + } + if (defaultValue_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public Builder clearDefaultValue() { + bitField0_ = (bitField0_ & ~0x00000004); + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public org.tensorflow.proto.TensorProto.Builder getDefaultValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDefaultValueFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getDefaultValueOrBuilder() { + if (defaultValueBuilder_ != null) { + return defaultValueBuilder_.getMessageOrBuilder(); + } else { + return defaultValue_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : defaultValue_; + } + } + /** + * .tensorflow.TensorProto default_value = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getDefaultValueFieldBuilder() { + if (defaultValueBuilder_ == null) { + defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getDefaultValue(), + getParentForChildren(), + isClean()); + defaultValue_ = null; + } + return defaultValueBuilder_; + } + + private java.lang.Object valuesOutputTensorName_ = ""; + /** + * string values_output_tensor_name = 4; + * @return The valuesOutputTensorName. + */ + public java.lang.String getValuesOutputTensorName() { + java.lang.Object ref = valuesOutputTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valuesOutputTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string values_output_tensor_name = 4; + * @return The bytes for valuesOutputTensorName. + */ + public com.google.protobuf.ByteString + getValuesOutputTensorNameBytes() { + java.lang.Object ref = valuesOutputTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valuesOutputTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string values_output_tensor_name = 4; + * @param value The valuesOutputTensorName to set. + * @return This builder for chaining. + */ + public Builder setValuesOutputTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valuesOutputTensorName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * string values_output_tensor_name = 4; + * @return This builder for chaining. + */ + public Builder clearValuesOutputTensorName() { + valuesOutputTensorName_ = getDefaultInstance().getValuesOutputTensorName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * string values_output_tensor_name = 4; + * @param value The bytes for valuesOutputTensorName to set. + * @return This builder for chaining. + */ + public Builder setValuesOutputTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valuesOutputTensorName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FixedLenFeatureProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FixedLenFeatureProto) + private static final org.tensorflow.proto.FixedLenFeatureProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FixedLenFeatureProto(); + } + + public static org.tensorflow.proto.FixedLenFeatureProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FixedLenFeatureProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FixedLenFeatureProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProtoOrBuilder.java new file mode 100644 index 00000000000..e49042cfcae --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FixedLenFeatureProtoOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example_parser_configuration.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FixedLenFeatureProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FixedLenFeatureProto) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * .tensorflow.TensorProto default_value = 3; + * @return Whether the defaultValue field is set. + */ + boolean hasDefaultValue(); + /** + * .tensorflow.TensorProto default_value = 3; + * @return The defaultValue. + */ + org.tensorflow.proto.TensorProto getDefaultValue(); + /** + * .tensorflow.TensorProto default_value = 3; + */ + org.tensorflow.proto.TensorProtoOrBuilder getDefaultValueOrBuilder(); + + /** + * string values_output_tensor_name = 4; + * @return The valuesOutputTensorName. + */ + java.lang.String getValuesOutputTensorName(); + /** + * string values_output_tensor_name = 4; + * @return The bytes for valuesOutputTensorName. + */ + com.google.protobuf.ByteString + getValuesOutputTensorNameBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatList.java new file mode 100644 index 00000000000..5997a988c59 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatList.java @@ -0,0 +1,544 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.FloatList} + */ +public final class FloatList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FloatList) + FloatListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FloatList.class.getName()); + } + // Use FloatList.newBuilder() to construct. + private FloatList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FloatList() { + value_ = emptyFloatList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FloatList.class, org.tensorflow.proto.FloatList.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList value_ = + emptyFloatList(); + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeFloatNoTag(value_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getValueList().size(); + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.FloatList)) { + return super.equals(obj); + } + org.tensorflow.proto.FloatList other = (org.tensorflow.proto.FloatList) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FloatList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FloatList 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.FloatList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FloatList 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.FloatList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FloatList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FloatList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FloatList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FloatList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FloatList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FloatList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FloatList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FloatList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.FloatList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FloatList) + org.tensorflow.proto.FloatListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FloatList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FloatList.class, org.tensorflow.proto.FloatList.Builder.class); + } + + // Construct using org.tensorflow.proto.FloatList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyFloatList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_FloatList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FloatList getDefaultInstanceForType() { + return org.tensorflow.proto.FloatList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FloatList build() { + org.tensorflow.proto.FloatList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FloatList buildPartial() { + org.tensorflow.proto.FloatList result = new org.tensorflow.proto.FloatList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FloatList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FloatList) { + return mergeFrom((org.tensorflow.proto.FloatList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FloatList other) { + if (other == org.tensorflow.proto.FloatList.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + float v = input.readFloat(); + ensureValueIsMutable(); + value_.addFloat(v); + break; + } // case 13 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureValueIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + value_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + private void ensureValueIsMutable(int capacity) { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_, capacity); + } + bitField0_ |= 0x00000001; + } + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + /** + * repeated float value = 1 [packed = true]; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, float value) { + + ensureValueIsMutable(); + value_.setFloat(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(float value) { + + ensureValueIsMutable(); + value_.addFloat(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated float value = 1 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FloatList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FloatList) + private static final org.tensorflow.proto.FloatList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FloatList(); + } + + public static org.tensorflow.proto.FloatList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FloatList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FloatList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatListOrBuilder.java new file mode 100644 index 00000000000..3a09beb22bb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FloatListOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FloatListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FloatList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated float value = 1 [packed = true]; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated float value = 1 [packed = true]; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated float value = 1 [packed = true]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + float getValue(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDef.java new file mode 100644 index 00000000000..52b9cac7116 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDef.java @@ -0,0 +1,1233 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/full_type.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Highly experimental and very likely to change.
    + * This encoding uses tags instead of dedicated messages for regularity. In
    + * particular the encoding imposes no restrictions on what the parameters of any
    + * type should be, which in particular needs to be true for type symbols.
    + * 
    + * + * Protobuf type {@code tensorflow.FullTypeDef} + */ +public final class FullTypeDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FullTypeDef) + FullTypeDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FullTypeDef.class.getName()); + } + // Use FullTypeDef.newBuilder() to construct. + private FullTypeDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FullTypeDef() { + typeId_ = 0; + args_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FullTypeProtos.internal_static_tensorflow_FullTypeDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FullTypeDef.class, org.tensorflow.proto.FullTypeDef.Builder.class); + } + + private int attrCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object attr_; + public enum AttrCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + S(3), + I(4), + ATTR_NOT_SET(0); + private final int value; + private AttrCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AttrCase valueOf(int value) { + return forNumber(value); + } + + public static AttrCase forNumber(int value) { + switch (value) { + case 3: return S; + case 4: return I; + case 0: return ATTR_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public AttrCase + getAttrCase() { + return AttrCase.forNumber( + attrCase_); + } + + public static final int TYPE_ID_FIELD_NUMBER = 1; + private int typeId_ = 0; + /** + *
    +   * The principal type represented by this object. This may be a concrete type
    +   * (Tensor, Dataset) a type variable (used for dependent types) a type
    +   * symbol (Any, Union). See FullTypeId for details.
    +   * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The enum numeric value on the wire for typeId. + */ + @java.lang.Override public int getTypeIdValue() { + return typeId_; + } + /** + *
    +   * The principal type represented by this object. This may be a concrete type
    +   * (Tensor, Dataset) a type variable (used for dependent types) a type
    +   * symbol (Any, Union). See FullTypeId for details.
    +   * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The typeId. + */ + @java.lang.Override public org.tensorflow.proto.FullTypeId getTypeId() { + org.tensorflow.proto.FullTypeId result = org.tensorflow.proto.FullTypeId.forNumber(typeId_); + return result == null ? org.tensorflow.proto.FullTypeId.UNRECOGNIZED : result; + } + + public static final int ARGS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List args_; + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + @java.lang.Override + public java.util.List getArgsList() { + return args_; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + @java.lang.Override + public java.util.List + getArgsOrBuilderList() { + return args_; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + @java.lang.Override + public int getArgsCount() { + return args_.size(); + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDef getArgs(int index) { + return args_.get(index); + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDefOrBuilder getArgsOrBuilder( + int index) { + return args_.get(index); + } + + public static final int S_FIELD_NUMBER = 3; + /** + * string s = 3; + * @return Whether the s field is set. + */ + public boolean hasS() { + return attrCase_ == 3; + } + /** + * string s = 3; + * @return The s. + */ + public java.lang.String getS() { + java.lang.Object ref = ""; + if (attrCase_ == 3) { + ref = attr_; + } + 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(); + if (attrCase_ == 3) { + attr_ = s; + } + return s; + } + } + /** + * string s = 3; + * @return The bytes for s. + */ + public com.google.protobuf.ByteString + getSBytes() { + java.lang.Object ref = ""; + if (attrCase_ == 3) { + ref = attr_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (attrCase_ == 3) { + attr_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int I_FIELD_NUMBER = 4; + /** + *
    +   * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +   * 
    + * + * int64 i = 4; + * @return Whether the i field is set. + */ + @java.lang.Override + public boolean hasI() { + return attrCase_ == 4; + } + /** + *
    +   * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +   * 
    + * + * int64 i = 4; + * @return The i. + */ + @java.lang.Override + public long getI() { + if (attrCase_ == 4) { + return (java.lang.Long) attr_; + } + return 0L; + } + + 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 (typeId_ != org.tensorflow.proto.FullTypeId.TFT_UNSET.getNumber()) { + output.writeEnum(1, typeId_); + } + for (int i = 0; i < args_.size(); i++) { + output.writeMessage(2, args_.get(i)); + } + if (attrCase_ == 3) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, attr_); + } + if (attrCase_ == 4) { + output.writeInt64( + 4, (long)((java.lang.Long) attr_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeId_ != org.tensorflow.proto.FullTypeId.TFT_UNSET.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, typeId_); + } + for (int i = 0; i < args_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, args_.get(i)); + } + if (attrCase_ == 3) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, attr_); + } + if (attrCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 4, (long)((java.lang.Long) attr_)); + } + size += getUnknownFields().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.FullTypeDef)) { + return super.equals(obj); + } + org.tensorflow.proto.FullTypeDef other = (org.tensorflow.proto.FullTypeDef) obj; + + if (typeId_ != other.typeId_) return false; + if (!getArgsList() + .equals(other.getArgsList())) return false; + if (!getAttrCase().equals(other.getAttrCase())) return false; + switch (attrCase_) { + case 3: + if (!getS() + .equals(other.getS())) return false; + break; + case 4: + if (getI() + != other.getI()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_ID_FIELD_NUMBER; + hash = (53 * hash) + typeId_; + if (getArgsCount() > 0) { + hash = (37 * hash) + ARGS_FIELD_NUMBER; + hash = (53 * hash) + getArgsList().hashCode(); + } + switch (attrCase_) { + case 3: + hash = (37 * hash) + S_FIELD_NUMBER; + hash = (53 * hash) + getS().hashCode(); + break; + case 4: + hash = (37 * hash) + I_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getI()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FullTypeDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FullTypeDef 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.FullTypeDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FullTypeDef 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.FullTypeDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FullTypeDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FullTypeDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FullTypeDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FullTypeDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FullTypeDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FullTypeDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FullTypeDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FullTypeDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Highly experimental and very likely to change.
    +   * This encoding uses tags instead of dedicated messages for regularity. In
    +   * particular the encoding imposes no restrictions on what the parameters of any
    +   * type should be, which in particular needs to be true for type symbols.
    +   * 
    + * + * Protobuf type {@code tensorflow.FullTypeDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FullTypeDef) + org.tensorflow.proto.FullTypeDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FullTypeProtos.internal_static_tensorflow_FullTypeDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FullTypeDef.class, org.tensorflow.proto.FullTypeDef.Builder.class); + } + + // Construct using org.tensorflow.proto.FullTypeDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeId_ = 0; + if (argsBuilder_ == null) { + args_ = java.util.Collections.emptyList(); + } else { + args_ = null; + argsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + attrCase_ = 0; + attr_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FullTypeProtos.internal_static_tensorflow_FullTypeDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FullTypeDef getDefaultInstanceForType() { + return org.tensorflow.proto.FullTypeDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FullTypeDef build() { + org.tensorflow.proto.FullTypeDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FullTypeDef buildPartial() { + org.tensorflow.proto.FullTypeDef result = new org.tensorflow.proto.FullTypeDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.FullTypeDef result) { + if (argsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + args_ = java.util.Collections.unmodifiableList(args_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.args_ = args_; + } else { + result.args_ = argsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.FullTypeDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeId_ = typeId_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.FullTypeDef result) { + result.attrCase_ = attrCase_; + result.attr_ = this.attr_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FullTypeDef) { + return mergeFrom((org.tensorflow.proto.FullTypeDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FullTypeDef other) { + if (other == org.tensorflow.proto.FullTypeDef.getDefaultInstance()) return this; + if (other.typeId_ != 0) { + setTypeIdValue(other.getTypeIdValue()); + } + if (argsBuilder_ == null) { + if (!other.args_.isEmpty()) { + if (args_.isEmpty()) { + args_ = other.args_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureArgsIsMutable(); + args_.addAll(other.args_); + } + onChanged(); + } + } else { + if (!other.args_.isEmpty()) { + if (argsBuilder_.isEmpty()) { + argsBuilder_.dispose(); + argsBuilder_ = null; + args_ = other.args_; + bitField0_ = (bitField0_ & ~0x00000002); + argsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getArgsFieldBuilder() : null; + } else { + argsBuilder_.addAllMessages(other.args_); + } + } + } + switch (other.getAttrCase()) { + case S: { + attrCase_ = 3; + attr_ = other.attr_; + onChanged(); + break; + } + case I: { + setI(other.getI()); + break; + } + case ATTR_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + typeId_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + org.tensorflow.proto.FullTypeDef m = + input.readMessage( + org.tensorflow.proto.FullTypeDef.parser(), + extensionRegistry); + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + args_.add(m); + } else { + argsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + attrCase_ = 3; + attr_ = s; + break; + } // case 26 + case 32: { + attr_ = input.readInt64(); + attrCase_ = 4; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int attrCase_ = 0; + private java.lang.Object attr_; + public AttrCase + getAttrCase() { + return AttrCase.forNumber( + attrCase_); + } + + public Builder clearAttr() { + attrCase_ = 0; + attr_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int typeId_ = 0; + /** + *
    +     * The principal type represented by this object. This may be a concrete type
    +     * (Tensor, Dataset) a type variable (used for dependent types) a type
    +     * symbol (Any, Union). See FullTypeId for details.
    +     * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The enum numeric value on the wire for typeId. + */ + @java.lang.Override public int getTypeIdValue() { + return typeId_; + } + /** + *
    +     * The principal type represented by this object. This may be a concrete type
    +     * (Tensor, Dataset) a type variable (used for dependent types) a type
    +     * symbol (Any, Union). See FullTypeId for details.
    +     * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @param value The enum numeric value on the wire for typeId to set. + * @return This builder for chaining. + */ + public Builder setTypeIdValue(int value) { + typeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The principal type represented by this object. This may be a concrete type
    +     * (Tensor, Dataset) a type variable (used for dependent types) a type
    +     * symbol (Any, Union). See FullTypeId for details.
    +     * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The typeId. + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeId getTypeId() { + org.tensorflow.proto.FullTypeId result = org.tensorflow.proto.FullTypeId.forNumber(typeId_); + return result == null ? org.tensorflow.proto.FullTypeId.UNRECOGNIZED : result; + } + /** + *
    +     * The principal type represented by this object. This may be a concrete type
    +     * (Tensor, Dataset) a type variable (used for dependent types) a type
    +     * symbol (Any, Union). See FullTypeId for details.
    +     * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @param value The typeId to set. + * @return This builder for chaining. + */ + public Builder setTypeId(org.tensorflow.proto.FullTypeId value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + typeId_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * The principal type represented by this object. This may be a concrete type
    +     * (Tensor, Dataset) a type variable (used for dependent types) a type
    +     * symbol (Any, Union). See FullTypeId for details.
    +     * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return This builder for chaining. + */ + public Builder clearTypeId() { + bitField0_ = (bitField0_ & ~0x00000001); + typeId_ = 0; + onChanged(); + return this; + } + + private java.util.List args_ = + java.util.Collections.emptyList(); + private void ensureArgsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + args_ = new java.util.ArrayList(args_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> argsBuilder_; + + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public java.util.List getArgsList() { + if (argsBuilder_ == null) { + return java.util.Collections.unmodifiableList(args_); + } else { + return argsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public int getArgsCount() { + if (argsBuilder_ == null) { + return args_.size(); + } else { + return argsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public org.tensorflow.proto.FullTypeDef getArgs(int index) { + if (argsBuilder_ == null) { + return args_.get(index); + } else { + return argsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder setArgs( + int index, org.tensorflow.proto.FullTypeDef value) { + if (argsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.set(index, value); + onChanged(); + } else { + argsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder setArgs( + int index, org.tensorflow.proto.FullTypeDef.Builder builderForValue) { + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + args_.set(index, builderForValue.build()); + onChanged(); + } else { + argsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder addArgs(org.tensorflow.proto.FullTypeDef value) { + if (argsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.add(value); + onChanged(); + } else { + argsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder addArgs( + int index, org.tensorflow.proto.FullTypeDef value) { + if (argsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.add(index, value); + onChanged(); + } else { + argsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder addArgs( + org.tensorflow.proto.FullTypeDef.Builder builderForValue) { + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + args_.add(builderForValue.build()); + onChanged(); + } else { + argsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder addArgs( + int index, org.tensorflow.proto.FullTypeDef.Builder builderForValue) { + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + args_.add(index, builderForValue.build()); + onChanged(); + } else { + argsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder addAllArgs( + java.lang.Iterable values) { + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, args_); + onChanged(); + } else { + argsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder clearArgs() { + if (argsBuilder_ == null) { + args_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + argsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public Builder removeArgs(int index) { + if (argsBuilder_ == null) { + ensureArgsIsMutable(); + args_.remove(index); + onChanged(); + } else { + argsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public org.tensorflow.proto.FullTypeDef.Builder getArgsBuilder( + int index) { + return getArgsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public org.tensorflow.proto.FullTypeDefOrBuilder getArgsOrBuilder( + int index) { + if (argsBuilder_ == null) { + return args_.get(index); } else { + return argsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public java.util.List + getArgsOrBuilderList() { + if (argsBuilder_ != null) { + return argsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(args_); + } + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public org.tensorflow.proto.FullTypeDef.Builder addArgsBuilder() { + return getArgsFieldBuilder().addBuilder( + org.tensorflow.proto.FullTypeDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public org.tensorflow.proto.FullTypeDef.Builder addArgsBuilder( + int index) { + return getArgsFieldBuilder().addBuilder( + index, org.tensorflow.proto.FullTypeDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + public java.util.List + getArgsBuilderList() { + return getArgsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> + getArgsFieldBuilder() { + if (argsBuilder_ == null) { + argsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder>( + args_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + args_ = null; + } + return argsBuilder_; + } + + /** + * string s = 3; + * @return Whether the s field is set. + */ + @java.lang.Override + public boolean hasS() { + return attrCase_ == 3; + } + /** + * string s = 3; + * @return The s. + */ + @java.lang.Override + public java.lang.String getS() { + java.lang.Object ref = ""; + if (attrCase_ == 3) { + ref = attr_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (attrCase_ == 3) { + attr_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string s = 3; + * @return The bytes for s. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSBytes() { + java.lang.Object ref = ""; + if (attrCase_ == 3) { + ref = attr_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (attrCase_ == 3) { + attr_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string s = 3; + * @param value The s to set. + * @return This builder for chaining. + */ + public Builder setS( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + attrCase_ = 3; + attr_ = value; + onChanged(); + return this; + } + /** + * string s = 3; + * @return This builder for chaining. + */ + public Builder clearS() { + if (attrCase_ == 3) { + attrCase_ = 0; + attr_ = null; + onChanged(); + } + return this; + } + /** + * string s = 3; + * @param value The bytes for s to set. + * @return This builder for chaining. + */ + public Builder setSBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + attrCase_ = 3; + attr_ = value; + onChanged(); + return this; + } + + /** + *
    +     * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +     * 
    + * + * int64 i = 4; + * @return Whether the i field is set. + */ + public boolean hasI() { + return attrCase_ == 4; + } + /** + *
    +     * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +     * 
    + * + * int64 i = 4; + * @return The i. + */ + public long getI() { + if (attrCase_ == 4) { + return (java.lang.Long) attr_; + } + return 0L; + } + /** + *
    +     * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +     * 
    + * + * int64 i = 4; + * @param value The i to set. + * @return This builder for chaining. + */ + public Builder setI(long value) { + + attrCase_ = 4; + attr_ = value; + onChanged(); + return this; + } + /** + *
    +     * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +     * 
    + * + * int64 i = 4; + * @return This builder for chaining. + */ + public Builder clearI() { + if (attrCase_ == 4) { + attrCase_ = 0; + attr_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FullTypeDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FullTypeDef) + private static final org.tensorflow.proto.FullTypeDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FullTypeDef(); + } + + public static org.tensorflow.proto.FullTypeDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FullTypeDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FullTypeDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDefOrBuilder.java new file mode 100644 index 00000000000..7c071d4dcde --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeDefOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/full_type.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FullTypeDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FullTypeDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * The principal type represented by this object. This may be a concrete type
    +   * (Tensor, Dataset) a type variable (used for dependent types) a type
    +   * symbol (Any, Union). See FullTypeId for details.
    +   * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The enum numeric value on the wire for typeId. + */ + int getTypeIdValue(); + /** + *
    +   * The principal type represented by this object. This may be a concrete type
    +   * (Tensor, Dataset) a type variable (used for dependent types) a type
    +   * symbol (Any, Union). See FullTypeId for details.
    +   * 
    + * + * .tensorflow.FullTypeId type_id = 1; + * @return The typeId. + */ + org.tensorflow.proto.FullTypeId getTypeId(); + + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + java.util.List + getArgsList(); + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + org.tensorflow.proto.FullTypeDef getArgs(int index); + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + int getArgsCount(); + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + java.util.List + getArgsOrBuilderList(); + /** + * repeated .tensorflow.FullTypeDef args = 2; + */ + org.tensorflow.proto.FullTypeDefOrBuilder getArgsOrBuilder( + int index); + + /** + * string s = 3; + * @return Whether the s field is set. + */ + boolean hasS(); + /** + * string s = 3; + * @return The s. + */ + java.lang.String getS(); + /** + * string s = 3; + * @return The bytes for s. + */ + com.google.protobuf.ByteString + getSBytes(); + + /** + *
    +   * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +   * 
    + * + * int64 i = 4; + * @return Whether the i field is set. + */ + boolean hasI(); + /** + *
    +   * TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
    +   * 
    + * + * int64 i = 4; + * @return The i. + */ + long getI(); + + org.tensorflow.proto.FullTypeDef.AttrCase getAttrCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeId.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeId.java new file mode 100644 index 00000000000..5f532bfd4e5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeId.java @@ -0,0 +1,957 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/full_type.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * LINT.IfChange
    + * Experimental. Represents the complete type information of a TensorFlow value.
    + * 
    + * + * Protobuf enum {@code tensorflow.FullTypeId} + */ +public enum FullTypeId + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +   * The default represents an uninitialized values.
    +   * 
    + * + * TFT_UNSET = 0; + */ + TFT_UNSET(0), + /** + *
    +   * Type variables may serve as placeholder for any other type ID in type
    +   * templates.
    +   *
    +   * Examples:
    +   * TFT_DATASET[TFT_VAR["T"]] is a Dataset returning a type indicated by "T".
    +   * TFT_TENSOR[TFT_VAR["T"]] is a Tensor of n element type indicated by "T".
    +   * TFT_TENSOR[TFT_VAR["T"]], TFT_TENSOR[TFT_VAR["T"]] are two tensors of
    +   * identical element types.
    +   * TFT_TENSOR[TFT_VAR["P"]], TFT_TENSOR[TFT_VAR["Q"]] are two tensors of
    +   * independent element types.
    +   * 
    + * + * TFT_VAR = 1; + */ + TFT_VAR(1), + /** + *
    +   * Wildcard type. Describes a parameter of unknown type. In TensorFlow, that
    +   * can mean either a "Top" type (accepts any type), or a dynamically typed
    +   * object whose type is unknown in context.
    +   * Important: "unknown" does not necessarily mean undeterminable!
    +   * 
    + * + * TFT_ANY = 2; + */ + TFT_ANY(2), + /** + *
    +   * The algebraic product type. This is an algebraic type that may be used just
    +   * for logical grouping. Not to confused with TFT_TUPLE which describes a
    +   * concrete object of several elements.
    +   *
    +   * Example:
    +   * TFT_DATASET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]]]
    +   * is a Dataset producing two tensors, an integer one and a float one.
    +   * 
    + * + * TFT_PRODUCT = 3; + */ + TFT_PRODUCT(3), + /** + *
    +   * Represents a named field, with the name stored in the attribute.
    +   *
    +   * Parametrization:
    +   * TFT_NAMED[<type>]{<name>}
    +   * * <type> is the type of the field
    +   * * <name> is the field name, as string (thpugh can theoretically be an int
    +   * as well)
    +   *
    +   * Example:
    +   * TFT_RECORD[
    +   * TFT_NAMED[TFT_TENSOR[TFT_INT32]]{'foo'},
    +   * TFT_NAMED[TFT_TENSOR[TFT_FLOAT32]]{'bar'},
    +   * ]
    +   * is a structure with two fields, an int tensor "foo" and a float tensor
    +   * "bar".
    +   * 
    + * + * TFT_NAMED = 4; + */ + TFT_NAMED(4), + /** + *
    +   * Template definition. Expands the variables by repeating a template as
    +   * arguments of container.
    +   *
    +   * Parametrization:
    +   * TFT_FOR_EACH[<container_type>, <template>, <expansions>]
    +   * * <container_type> is the type of the container that the template will be
    +   * expanded into
    +   * * <template> is any type definition that potentially contains type
    +   * variables
    +   * * <expansions> is a TFT_VAR and may include more types in the future
    +   *
    +   * Example:
    +   * TFT_FOR_EACH[
    +   * TFT_PRODUCT,
    +   * TFT_TENSOR[TFT_VAR["t"]],
    +   * TFT_VAR["t"]
    +   * ]
    +   * will substitute a T = TFT_INT32 to TFT_PRODUCT[TFT_TENSOR[TFT_INT32]]
    +   * and a T = (TFT_INT32, TFT_INT64) to
    +   * TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_INT64]].
    +   * 
    + * + * TFT_FOR_EACH = 20; + */ + TFT_FOR_EACH(20), + /** + *
    +   * Callable types describe functions and ops.
    +   *
    +   * Parametrization:
    +   * TFT_CALLABLE[<arg type>, <return type>]
    +   * * <arg type> is the type of the arguments; TFT_PRODUCT represents
    +   * multiple
    +   * arguments.
    +   * * <return type> is the return type; TFT_PRODUCT represents multiple
    +   * return values (that means that callables returning multiple things
    +   * don't necessarily return a single tuple).
    +   *
    +   * Example:
    +   * TFT_CALLABLE[
    +   * TFT_ANY,
    +   * TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]],
    +   * ]
    +   * is a callable with unspecified (for now) input arguments, and
    +   * two return values of type tensor.
    +   * 
    + * + * TFT_CALLABLE = 100; + */ + TFT_CALLABLE(100), + /** + *
    +   * The usual Tensor. This is a parametric type.
    +   *
    +   * Parametrization:
    +   * TFT_TENSOR[<element type>, <shape type>]
    +   * * <element type> is currently limited to one of the element types
    +   * defined below.
    +   * * <shape type> is not yet defined, and may only be TFT_UNKNOWN for now.
    +   *
    +   * A TFT_SHAPE type will be defined in the future.
    +   *
    +   * Example:
    +   * TFT_TENSOR[TFT_INT32, TFT_UNKNOWN]
    +   * is a Tensor of int32 element type and unknown shape.
    +   *
    +   * TODO(mdan): Define TFT_SHAPE and add more examples.
    +   * 
    + * + * TFT_TENSOR = 1000; + */ + TFT_TENSOR(1000), + /** + *
    +   * Array (or tensorflow::TensorList in the variant type registry).
    +   * Note: this is not to be confused with the deprecated `TensorArray*` ops
    +   * which are not supported by FullType.
    +   * This type represents a random-access list whose elements can be
    +   * described by a single type. Although immutable, Array is expected to
    +   * support efficient mutation semantics (i.e. element update) in the
    +   * user-facing API.
    +   * The element type may be generic or even TFT_ANY for a heterogenous list.
    +   *
    +   * Parametrization:
    +   * TFT_ARRAY[<element type>]
    +   * * <element type> may be any concrete type.
    +   *
    +   * Examples:
    +   * TFT_ARRAY[TFT_TENSOR[TFT_INT32]] is a TensorArray holding int32 Tensors
    +   * of any shape.
    +   * TFT_ARRAY[TFT_TENSOR[TFT_UNKNOWN]] is a TensorArray holding Tensors of
    +   * mixed element types.
    +   * TFT_ARRAY[TFT_UNKNOWN] is a TensorArray holding any element type.
    +   * TFT_ARRAY[] is equivalent to TFT_ARRAY[TFT_UNKNOWN].
    +   * TFT_ARRAY[TFT_ARRAY[]] is an array or arrays (of unknown types).
    +   * 
    + * + * TFT_ARRAY = 1001; + */ + TFT_ARRAY(1001), + /** + *
    +   * Optional (or tensorflow::OptionalVariant in the variant type registry).
    +   * This type represents a value that may either hold an element of a single
    +   * specified type, or nothing at all.
    +   *
    +   * Parametrization:
    +   * TFT_OPTIONAL[<element type>]
    +   * * <element type> may be any concrete type.
    +   *
    +   * Examples:
    +   * TFT_OPTIONAL[TFT_TENSOR[TFT_INT32]] is an Optional holding an int32
    +   * Tensor of any shape.
    +   * 
    + * + * TFT_OPTIONAL = 1002; + */ + TFT_OPTIONAL(1002), + /** + *
    +   * Literal types describe compile-time constant values.
    +   * Literal types may also participate in dependent types.
    +   *
    +   * Parametrization:
    +   * TFT_LITERAL[<value type>]{<value>}
    +   * * <value type> may be any concrete type compatible that can hold <value>
    +   * * <value> is the type's attribute, and holds the actual literal value
    +   *
    +   * Examples:
    +   * TFT_LITERAL[TFT_INT32]{1} is the compile-time constant 1.
    +   * 
    + * + * TFT_LITERAL = 1003; + */ + TFT_LITERAL(1003), + /** + *
    +   * Encoding types describe a value of a certain type, encoded as a different
    +   * type.
    +   *
    +   * Parametrization:
    +   * TFT_ENCODED[<encoded type>, <encoding type>]
    +   * * <encoded type> may be any type
    +   * * <encoding type> may be any type
    +   *
    +   * Examples:
    +   * TFT_ENCODING[TFT_INT32, TFT_STRING] is an integer encoded as string.
    +   * 
    + * + * TFT_ENCODED = 1004; + */ + TFT_ENCODED(1004), + /** + *
    +   * The type of "shape tensors" where the runtime value is the shape of
    +   * some tensor(s), i.e. the output of tf.shape.
    +   * Shape tensors have special, host-only placement, in contrast to
    +   * TFT_TENSOR[TFT_INT32] which is the type of a normal numeric tensor
    +   * with no special placement.
    +   *
    +   * Examples:
    +   * TFT_SHAPE_TENSOR[TFT_INT32] is the most common
    +   * TFT_SHAPE_TENSOR[TFT_INT64] is also allowed
    +   * 
    + * + * TFT_SHAPE_TENSOR = 1005; + */ + TFT_SHAPE_TENSOR(1005), + /** + *
    +   * The bool element type.
    +   * TODO(mdan): Quantized types, legacy representations (e.g. ref)
    +   * 
    + * + * TFT_BOOL = 200; + */ + TFT_BOOL(200), + /** + *
    +   * Integer element types.
    +   * 
    + * + * TFT_UINT8 = 201; + */ + TFT_UINT8(201), + /** + * TFT_UINT16 = 202; + */ + TFT_UINT16(202), + /** + * TFT_UINT32 = 203; + */ + TFT_UINT32(203), + /** + * TFT_UINT64 = 204; + */ + TFT_UINT64(204), + /** + * TFT_INT8 = 205; + */ + TFT_INT8(205), + /** + * TFT_INT16 = 206; + */ + TFT_INT16(206), + /** + * TFT_INT32 = 207; + */ + TFT_INT32(207), + /** + * TFT_INT64 = 208; + */ + TFT_INT64(208), + /** + *
    +   * Floating-point element types.
    +   * 
    + * + * TFT_HALF = 209; + */ + TFT_HALF(209), + /** + * TFT_FLOAT = 210; + */ + TFT_FLOAT(210), + /** + * TFT_DOUBLE = 211; + */ + TFT_DOUBLE(211), + /** + * TFT_BFLOAT16 = 215; + */ + TFT_BFLOAT16(215), + /** + *
    +   * Complex element types.
    +   * TODO(mdan): Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
    +   * 
    + * + * TFT_COMPLEX64 = 212; + */ + TFT_COMPLEX64(212), + /** + * TFT_COMPLEX128 = 213; + */ + TFT_COMPLEX128(213), + /** + *
    +   * The string element type.
    +   * 
    + * + * TFT_STRING = 214; + */ + TFT_STRING(214), + /** + *
    +   * Datasets created by tf.data ops and APIs. Datasets have generator/iterable
    +   * semantics, that is, one can construct an iterator from them. Like
    +   * Array, they are considered to return elements that can be described
    +   * by a single type. Unlike Array, they do not support random access or
    +   * mutation, and can potentially produce an infinite number of elements.
    +   * A datasets can produce logical structures (e.g. multiple elements). This
    +   * is expressed using TFT_PRODUCT.
    +   *
    +   *
    +   * Parametrization: TFT_DATASET[<element type>].
    +   * * <element type> may be a concrete type or a type symbol. It represents
    +   * the data type of the elements produced by the dataset.
    +   *
    +   * Examples:
    +   * TFT_DATSET[TFT_TENSOR[TFT_INT32]] is a Dataset producing single int32
    +   * Tensors of unknown shape.
    +   * TFT_DATSET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT32]] is
    +   * a Dataset producing pairs of Tensors, one integer and one float.
    +   * Note: The high ID number is to prepare for the eventuality that Datasets
    +   * will be supported by user types in the future.
    +   * 
    + * + * TFT_DATASET = 10102; + */ + TFT_DATASET(10102), + /** + *
    +   * A ragged tensor created by tf.ragged ops and APIs.
    +   *
    +   * Parametrization: TFT_RAGGED[<element_type>].
    +   * 
    + * + * TFT_RAGGED = 10103; + */ + TFT_RAGGED(10103), + /** + *
    +   * Iterators created by tf.data ops and APIs. Very similar to Datasets, except
    +   * they are mutable.
    +   *
    +   *
    +   * Parametrization: TFT_ITERATOR[<element type>].
    +   * * <element type> may be a concrete type or a type symbol. It represents
    +   * the data type of the elements produced by the dataset.
    +   * 
    + * + * TFT_ITERATOR = 10104; + */ + TFT_ITERATOR(10104), + /** + *
    +   * A mutex lock tensor, produced by tf.raw_ops.MutexLock.
    +   * Unlike strict execution models, where ownership of a lock is denoted by
    +   * "running after the lock has been acquired", in non-strict mode, lock
    +   * ownership is in the true sense: "the op argument representing the lock is
    +   * available".
    +   * Mutex locks are the dynamic counterpart of control dependencies.
    +   * TODO(mdan): Properly document this thing.
    +   *
    +   * Parametrization: TFT_MUTEX_LOCK[].
    +   * 
    + * + * TFT_MUTEX_LOCK = 10202; + */ + TFT_MUTEX_LOCK(10202), + /** + *
    +   * The equivalent of a Tensor with DT_VARIANT dtype, kept here to simplify
    +   * translation. This type should not normally appear after type inference.
    +   * Note that LEGACY_VARIANT != ANY: TENSOR[INT32] is a subtype of ANY, but is
    +   * not a subtype of LEGACY_VARIANT.
    +   * 
    + * + * TFT_LEGACY_VARIANT = 10203; + */ + TFT_LEGACY_VARIANT(10203), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FullTypeId.class.getName()); + } + /** + *
    +   * The default represents an uninitialized values.
    +   * 
    + * + * TFT_UNSET = 0; + */ + public static final int TFT_UNSET_VALUE = 0; + /** + *
    +   * Type variables may serve as placeholder for any other type ID in type
    +   * templates.
    +   *
    +   * Examples:
    +   * TFT_DATASET[TFT_VAR["T"]] is a Dataset returning a type indicated by "T".
    +   * TFT_TENSOR[TFT_VAR["T"]] is a Tensor of n element type indicated by "T".
    +   * TFT_TENSOR[TFT_VAR["T"]], TFT_TENSOR[TFT_VAR["T"]] are two tensors of
    +   * identical element types.
    +   * TFT_TENSOR[TFT_VAR["P"]], TFT_TENSOR[TFT_VAR["Q"]] are two tensors of
    +   * independent element types.
    +   * 
    + * + * TFT_VAR = 1; + */ + public static final int TFT_VAR_VALUE = 1; + /** + *
    +   * Wildcard type. Describes a parameter of unknown type. In TensorFlow, that
    +   * can mean either a "Top" type (accepts any type), or a dynamically typed
    +   * object whose type is unknown in context.
    +   * Important: "unknown" does not necessarily mean undeterminable!
    +   * 
    + * + * TFT_ANY = 2; + */ + public static final int TFT_ANY_VALUE = 2; + /** + *
    +   * The algebraic product type. This is an algebraic type that may be used just
    +   * for logical grouping. Not to confused with TFT_TUPLE which describes a
    +   * concrete object of several elements.
    +   *
    +   * Example:
    +   * TFT_DATASET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]]]
    +   * is a Dataset producing two tensors, an integer one and a float one.
    +   * 
    + * + * TFT_PRODUCT = 3; + */ + public static final int TFT_PRODUCT_VALUE = 3; + /** + *
    +   * Represents a named field, with the name stored in the attribute.
    +   *
    +   * Parametrization:
    +   * TFT_NAMED[<type>]{<name>}
    +   * * <type> is the type of the field
    +   * * <name> is the field name, as string (thpugh can theoretically be an int
    +   * as well)
    +   *
    +   * Example:
    +   * TFT_RECORD[
    +   * TFT_NAMED[TFT_TENSOR[TFT_INT32]]{'foo'},
    +   * TFT_NAMED[TFT_TENSOR[TFT_FLOAT32]]{'bar'},
    +   * ]
    +   * is a structure with two fields, an int tensor "foo" and a float tensor
    +   * "bar".
    +   * 
    + * + * TFT_NAMED = 4; + */ + public static final int TFT_NAMED_VALUE = 4; + /** + *
    +   * Template definition. Expands the variables by repeating a template as
    +   * arguments of container.
    +   *
    +   * Parametrization:
    +   * TFT_FOR_EACH[<container_type>, <template>, <expansions>]
    +   * * <container_type> is the type of the container that the template will be
    +   * expanded into
    +   * * <template> is any type definition that potentially contains type
    +   * variables
    +   * * <expansions> is a TFT_VAR and may include more types in the future
    +   *
    +   * Example:
    +   * TFT_FOR_EACH[
    +   * TFT_PRODUCT,
    +   * TFT_TENSOR[TFT_VAR["t"]],
    +   * TFT_VAR["t"]
    +   * ]
    +   * will substitute a T = TFT_INT32 to TFT_PRODUCT[TFT_TENSOR[TFT_INT32]]
    +   * and a T = (TFT_INT32, TFT_INT64) to
    +   * TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_INT64]].
    +   * 
    + * + * TFT_FOR_EACH = 20; + */ + public static final int TFT_FOR_EACH_VALUE = 20; + /** + *
    +   * Callable types describe functions and ops.
    +   *
    +   * Parametrization:
    +   * TFT_CALLABLE[<arg type>, <return type>]
    +   * * <arg type> is the type of the arguments; TFT_PRODUCT represents
    +   * multiple
    +   * arguments.
    +   * * <return type> is the return type; TFT_PRODUCT represents multiple
    +   * return values (that means that callables returning multiple things
    +   * don't necessarily return a single tuple).
    +   *
    +   * Example:
    +   * TFT_CALLABLE[
    +   * TFT_ANY,
    +   * TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT64]],
    +   * ]
    +   * is a callable with unspecified (for now) input arguments, and
    +   * two return values of type tensor.
    +   * 
    + * + * TFT_CALLABLE = 100; + */ + public static final int TFT_CALLABLE_VALUE = 100; + /** + *
    +   * The usual Tensor. This is a parametric type.
    +   *
    +   * Parametrization:
    +   * TFT_TENSOR[<element type>, <shape type>]
    +   * * <element type> is currently limited to one of the element types
    +   * defined below.
    +   * * <shape type> is not yet defined, and may only be TFT_UNKNOWN for now.
    +   *
    +   * A TFT_SHAPE type will be defined in the future.
    +   *
    +   * Example:
    +   * TFT_TENSOR[TFT_INT32, TFT_UNKNOWN]
    +   * is a Tensor of int32 element type and unknown shape.
    +   *
    +   * TODO(mdan): Define TFT_SHAPE and add more examples.
    +   * 
    + * + * TFT_TENSOR = 1000; + */ + public static final int TFT_TENSOR_VALUE = 1000; + /** + *
    +   * Array (or tensorflow::TensorList in the variant type registry).
    +   * Note: this is not to be confused with the deprecated `TensorArray*` ops
    +   * which are not supported by FullType.
    +   * This type represents a random-access list whose elements can be
    +   * described by a single type. Although immutable, Array is expected to
    +   * support efficient mutation semantics (i.e. element update) in the
    +   * user-facing API.
    +   * The element type may be generic or even TFT_ANY for a heterogenous list.
    +   *
    +   * Parametrization:
    +   * TFT_ARRAY[<element type>]
    +   * * <element type> may be any concrete type.
    +   *
    +   * Examples:
    +   * TFT_ARRAY[TFT_TENSOR[TFT_INT32]] is a TensorArray holding int32 Tensors
    +   * of any shape.
    +   * TFT_ARRAY[TFT_TENSOR[TFT_UNKNOWN]] is a TensorArray holding Tensors of
    +   * mixed element types.
    +   * TFT_ARRAY[TFT_UNKNOWN] is a TensorArray holding any element type.
    +   * TFT_ARRAY[] is equivalent to TFT_ARRAY[TFT_UNKNOWN].
    +   * TFT_ARRAY[TFT_ARRAY[]] is an array or arrays (of unknown types).
    +   * 
    + * + * TFT_ARRAY = 1001; + */ + public static final int TFT_ARRAY_VALUE = 1001; + /** + *
    +   * Optional (or tensorflow::OptionalVariant in the variant type registry).
    +   * This type represents a value that may either hold an element of a single
    +   * specified type, or nothing at all.
    +   *
    +   * Parametrization:
    +   * TFT_OPTIONAL[<element type>]
    +   * * <element type> may be any concrete type.
    +   *
    +   * Examples:
    +   * TFT_OPTIONAL[TFT_TENSOR[TFT_INT32]] is an Optional holding an int32
    +   * Tensor of any shape.
    +   * 
    + * + * TFT_OPTIONAL = 1002; + */ + public static final int TFT_OPTIONAL_VALUE = 1002; + /** + *
    +   * Literal types describe compile-time constant values.
    +   * Literal types may also participate in dependent types.
    +   *
    +   * Parametrization:
    +   * TFT_LITERAL[<value type>]{<value>}
    +   * * <value type> may be any concrete type compatible that can hold <value>
    +   * * <value> is the type's attribute, and holds the actual literal value
    +   *
    +   * Examples:
    +   * TFT_LITERAL[TFT_INT32]{1} is the compile-time constant 1.
    +   * 
    + * + * TFT_LITERAL = 1003; + */ + public static final int TFT_LITERAL_VALUE = 1003; + /** + *
    +   * Encoding types describe a value of a certain type, encoded as a different
    +   * type.
    +   *
    +   * Parametrization:
    +   * TFT_ENCODED[<encoded type>, <encoding type>]
    +   * * <encoded type> may be any type
    +   * * <encoding type> may be any type
    +   *
    +   * Examples:
    +   * TFT_ENCODING[TFT_INT32, TFT_STRING] is an integer encoded as string.
    +   * 
    + * + * TFT_ENCODED = 1004; + */ + public static final int TFT_ENCODED_VALUE = 1004; + /** + *
    +   * The type of "shape tensors" where the runtime value is the shape of
    +   * some tensor(s), i.e. the output of tf.shape.
    +   * Shape tensors have special, host-only placement, in contrast to
    +   * TFT_TENSOR[TFT_INT32] which is the type of a normal numeric tensor
    +   * with no special placement.
    +   *
    +   * Examples:
    +   * TFT_SHAPE_TENSOR[TFT_INT32] is the most common
    +   * TFT_SHAPE_TENSOR[TFT_INT64] is also allowed
    +   * 
    + * + * TFT_SHAPE_TENSOR = 1005; + */ + public static final int TFT_SHAPE_TENSOR_VALUE = 1005; + /** + *
    +   * The bool element type.
    +   * TODO(mdan): Quantized types, legacy representations (e.g. ref)
    +   * 
    + * + * TFT_BOOL = 200; + */ + public static final int TFT_BOOL_VALUE = 200; + /** + *
    +   * Integer element types.
    +   * 
    + * + * TFT_UINT8 = 201; + */ + public static final int TFT_UINT8_VALUE = 201; + /** + * TFT_UINT16 = 202; + */ + public static final int TFT_UINT16_VALUE = 202; + /** + * TFT_UINT32 = 203; + */ + public static final int TFT_UINT32_VALUE = 203; + /** + * TFT_UINT64 = 204; + */ + public static final int TFT_UINT64_VALUE = 204; + /** + * TFT_INT8 = 205; + */ + public static final int TFT_INT8_VALUE = 205; + /** + * TFT_INT16 = 206; + */ + public static final int TFT_INT16_VALUE = 206; + /** + * TFT_INT32 = 207; + */ + public static final int TFT_INT32_VALUE = 207; + /** + * TFT_INT64 = 208; + */ + public static final int TFT_INT64_VALUE = 208; + /** + *
    +   * Floating-point element types.
    +   * 
    + * + * TFT_HALF = 209; + */ + public static final int TFT_HALF_VALUE = 209; + /** + * TFT_FLOAT = 210; + */ + public static final int TFT_FLOAT_VALUE = 210; + /** + * TFT_DOUBLE = 211; + */ + public static final int TFT_DOUBLE_VALUE = 211; + /** + * TFT_BFLOAT16 = 215; + */ + public static final int TFT_BFLOAT16_VALUE = 215; + /** + *
    +   * Complex element types.
    +   * TODO(mdan): Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
    +   * 
    + * + * TFT_COMPLEX64 = 212; + */ + public static final int TFT_COMPLEX64_VALUE = 212; + /** + * TFT_COMPLEX128 = 213; + */ + public static final int TFT_COMPLEX128_VALUE = 213; + /** + *
    +   * The string element type.
    +   * 
    + * + * TFT_STRING = 214; + */ + public static final int TFT_STRING_VALUE = 214; + /** + *
    +   * Datasets created by tf.data ops and APIs. Datasets have generator/iterable
    +   * semantics, that is, one can construct an iterator from them. Like
    +   * Array, they are considered to return elements that can be described
    +   * by a single type. Unlike Array, they do not support random access or
    +   * mutation, and can potentially produce an infinite number of elements.
    +   * A datasets can produce logical structures (e.g. multiple elements). This
    +   * is expressed using TFT_PRODUCT.
    +   *
    +   *
    +   * Parametrization: TFT_DATASET[<element type>].
    +   * * <element type> may be a concrete type or a type symbol. It represents
    +   * the data type of the elements produced by the dataset.
    +   *
    +   * Examples:
    +   * TFT_DATSET[TFT_TENSOR[TFT_INT32]] is a Dataset producing single int32
    +   * Tensors of unknown shape.
    +   * TFT_DATSET[TFT_PRODUCT[TFT_TENSOR[TFT_INT32], TFT_TENSOR[TFT_FLOAT32]] is
    +   * a Dataset producing pairs of Tensors, one integer and one float.
    +   * Note: The high ID number is to prepare for the eventuality that Datasets
    +   * will be supported by user types in the future.
    +   * 
    + * + * TFT_DATASET = 10102; + */ + public static final int TFT_DATASET_VALUE = 10102; + /** + *
    +   * A ragged tensor created by tf.ragged ops and APIs.
    +   *
    +   * Parametrization: TFT_RAGGED[<element_type>].
    +   * 
    + * + * TFT_RAGGED = 10103; + */ + public static final int TFT_RAGGED_VALUE = 10103; + /** + *
    +   * Iterators created by tf.data ops and APIs. Very similar to Datasets, except
    +   * they are mutable.
    +   *
    +   *
    +   * Parametrization: TFT_ITERATOR[<element type>].
    +   * * <element type> may be a concrete type or a type symbol. It represents
    +   * the data type of the elements produced by the dataset.
    +   * 
    + * + * TFT_ITERATOR = 10104; + */ + public static final int TFT_ITERATOR_VALUE = 10104; + /** + *
    +   * A mutex lock tensor, produced by tf.raw_ops.MutexLock.
    +   * Unlike strict execution models, where ownership of a lock is denoted by
    +   * "running after the lock has been acquired", in non-strict mode, lock
    +   * ownership is in the true sense: "the op argument representing the lock is
    +   * available".
    +   * Mutex locks are the dynamic counterpart of control dependencies.
    +   * TODO(mdan): Properly document this thing.
    +   *
    +   * Parametrization: TFT_MUTEX_LOCK[].
    +   * 
    + * + * TFT_MUTEX_LOCK = 10202; + */ + public static final int TFT_MUTEX_LOCK_VALUE = 10202; + /** + *
    +   * The equivalent of a Tensor with DT_VARIANT dtype, kept here to simplify
    +   * translation. This type should not normally appear after type inference.
    +   * Note that LEGACY_VARIANT != ANY: TENSOR[INT32] is a subtype of ANY, but is
    +   * not a subtype of LEGACY_VARIANT.
    +   * 
    + * + * TFT_LEGACY_VARIANT = 10203; + */ + public static final int TFT_LEGACY_VARIANT_VALUE = 10203; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FullTypeId valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static FullTypeId forNumber(int value) { + switch (value) { + case 0: return TFT_UNSET; + case 1: return TFT_VAR; + case 2: return TFT_ANY; + case 3: return TFT_PRODUCT; + case 4: return TFT_NAMED; + case 20: return TFT_FOR_EACH; + case 100: return TFT_CALLABLE; + case 1000: return TFT_TENSOR; + case 1001: return TFT_ARRAY; + case 1002: return TFT_OPTIONAL; + case 1003: return TFT_LITERAL; + case 1004: return TFT_ENCODED; + case 1005: return TFT_SHAPE_TENSOR; + case 200: return TFT_BOOL; + case 201: return TFT_UINT8; + case 202: return TFT_UINT16; + case 203: return TFT_UINT32; + case 204: return TFT_UINT64; + case 205: return TFT_INT8; + case 206: return TFT_INT16; + case 207: return TFT_INT32; + case 208: return TFT_INT64; + case 209: return TFT_HALF; + case 210: return TFT_FLOAT; + case 211: return TFT_DOUBLE; + case 215: return TFT_BFLOAT16; + case 212: return TFT_COMPLEX64; + case 213: return TFT_COMPLEX128; + case 214: return TFT_STRING; + case 10102: return TFT_DATASET; + case 10103: return TFT_RAGGED; + case 10104: return TFT_ITERATOR; + case 10202: return TFT_MUTEX_LOCK; + case 10203: return TFT_LEGACY_VARIANT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + FullTypeId> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public FullTypeId findValueByNumber(int number) { + return FullTypeId.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.FullTypeProtos.getDescriptor().getEnumTypes().get(0); + } + + private static final FullTypeId[] VALUES = values(); + + public static FullTypeId 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 FullTypeId(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.FullTypeId) +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeProtos.java new file mode 100644 index 00000000000..83bd2f467bd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FullTypeProtos.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/full_type.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class FullTypeProtos { + private FullTypeProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FullTypeProtos.class.getName()); + } + 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_FullTypeDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_FullTypeDef_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/framework/full_type.pr" + + "oto\022\ntensorflow\"\177\n\013FullTypeDef\022\'\n\007type_i" + + "d\030\001 \001(\0162\026.tensorflow.FullTypeId\022%\n\004args\030" + + "\002 \003(\0132\027.tensorflow.FullTypeDef\022\013\n\001s\030\003 \001(" + + "\tH\000\022\013\n\001i\030\004 \001(\003H\000B\006\n\004attr*\332\004\n\nFullTypeId\022" + + "\r\n\tTFT_UNSET\020\000\022\013\n\007TFT_VAR\020\001\022\013\n\007TFT_ANY\020\002" + + "\022\017\n\013TFT_PRODUCT\020\003\022\r\n\tTFT_NAMED\020\004\022\020\n\014TFT_" + + "FOR_EACH\020\024\022\020\n\014TFT_CALLABLE\020d\022\017\n\nTFT_TENS" + + "OR\020\350\007\022\016\n\tTFT_ARRAY\020\351\007\022\021\n\014TFT_OPTIONAL\020\352\007" + + "\022\020\n\013TFT_LITERAL\020\353\007\022\020\n\013TFT_ENCODED\020\354\007\022\025\n\020" + + "TFT_SHAPE_TENSOR\020\355\007\022\r\n\010TFT_BOOL\020\310\001\022\016\n\tTF" + + "T_UINT8\020\311\001\022\017\n\nTFT_UINT16\020\312\001\022\017\n\nTFT_UINT3" + + "2\020\313\001\022\017\n\nTFT_UINT64\020\314\001\022\r\n\010TFT_INT8\020\315\001\022\016\n\t" + + "TFT_INT16\020\316\001\022\016\n\tTFT_INT32\020\317\001\022\016\n\tTFT_INT6" + + "4\020\320\001\022\r\n\010TFT_HALF\020\321\001\022\016\n\tTFT_FLOAT\020\322\001\022\017\n\nT" + + "FT_DOUBLE\020\323\001\022\021\n\014TFT_BFLOAT16\020\327\001\022\022\n\rTFT_C" + + "OMPLEX64\020\324\001\022\023\n\016TFT_COMPLEX128\020\325\001\022\017\n\nTFT_" + + "STRING\020\326\001\022\020\n\013TFT_DATASET\020\366N\022\017\n\nTFT_RAGGE" + + "D\020\367N\022\021\n\014TFT_ITERATOR\020\370N\022\023\n\016TFT_MUTEX_LOC" + + "K\020\332O\022\027\n\022TFT_LEGACY_VARIANT\020\333OB}\n\024org.ten" + + "sorflow.protoB\016FullTypeProtosP\001ZPgithub." + + "com/tensorflow/tensorflow/tensorflow/go/" + + "core/framework/full_type_go_proto\370\001\001b\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_FullTypeDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_FullTypeDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_FullTypeDef_descriptor, + new java.lang.String[] { "TypeId", "Args", "S", "I", "Attr", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDef.java new file mode 100644 index 00000000000..aa45a3eb8d2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDef.java @@ -0,0 +1,3464 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A function can be instantiated when the runtime can bind every attr
    + * with a value. When a GraphDef has a call to a function, it must
    + * have binding for every attr defined in the signature.
    + *
    + * TODO(zhifengc):
    + * * device spec, etc.
    + * 
    + * + * Protobuf type {@code tensorflow.FunctionDef} + */ +public final class FunctionDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FunctionDef) + FunctionDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FunctionDef.class.getName()); + } + // Use FunctionDef.newBuilder() to construct. + private FunctionDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FunctionDef() { + nodeDef_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAttr(); + case 7: + return internalGetArgAttr(); + case 8: + return internalGetResourceArgUniqueId(); + case 4: + return internalGetRet(); + case 6: + return internalGetControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDef.class, org.tensorflow.proto.FunctionDef.Builder.class); + } + + public interface ArgAttrsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FunctionDef.ArgAttrs) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + int getAttrCount(); + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + boolean containsAttr( + java.lang.String key); + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttr(); + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + java.util.Map + getAttrMap(); + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue); + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key); + } + /** + *
    +   * Attributes for function arguments. These attributes are the same set of
    +   * valid attributes as to _Arg nodes.
    +   * 
    + * + * Protobuf type {@code tensorflow.FunctionDef.ArgAttrs} + */ + public static final class ArgAttrs extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FunctionDef.ArgAttrs) + ArgAttrsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ArgAttrs.class.getName()); + } + // Use ArgAttrs.newBuilder() to construct. + private ArgAttrs(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ArgAttrs() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDef.ArgAttrs.class, org.tensorflow.proto.FunctionDef.ArgAttrs.Builder.class); + } + + public static final int ATTR_FIELD_NUMBER = 1; + private static final class AttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> attr_; + private com.google.protobuf.MapField + internalGetAttr() { + if (attr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttrDefaultEntryHolder.defaultEntry); + } + return attr_; + } + public int getAttrCount() { + return internalGetAttr().getMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().getMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAttr(), + AttrDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, attr__); + } + size += getUnknownFields().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.FunctionDef.ArgAttrs)) { + return super.equals(obj); + } + org.tensorflow.proto.FunctionDef.ArgAttrs other = (org.tensorflow.proto.FunctionDef.ArgAttrs) obj; + + if (!internalGetAttr().equals( + other.internalGetAttr())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetAttr().getMap().isEmpty()) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttr().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs 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.FunctionDef.ArgAttrs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDef.ArgAttrs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FunctionDef.ArgAttrs 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Attributes for function arguments. These attributes are the same set of
    +     * valid attributes as to _Arg nodes.
    +     * 
    + * + * Protobuf type {@code tensorflow.FunctionDef.ArgAttrs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDef.ArgAttrs) + org.tensorflow.proto.FunctionDef.ArgAttrsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDef.ArgAttrs.class, org.tensorflow.proto.FunctionDef.ArgAttrs.Builder.class); + } + + // Construct using org.tensorflow.proto.FunctionDef.ArgAttrs.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableAttr().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs getDefaultInstanceForType() { + return org.tensorflow.proto.FunctionDef.ArgAttrs.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs build() { + org.tensorflow.proto.FunctionDef.ArgAttrs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs buildPartial() { + org.tensorflow.proto.FunctionDef.ArgAttrs result = new org.tensorflow.proto.FunctionDef.ArgAttrs(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.FunctionDef.ArgAttrs result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attr_ = internalGetAttr().build(AttrDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FunctionDef.ArgAttrs) { + return mergeFrom((org.tensorflow.proto.FunctionDef.ArgAttrs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FunctionDef.ArgAttrs other) { + if (other == org.tensorflow.proto.FunctionDef.ArgAttrs.getDefaultInstance()) return this; + internalGetMutableAttr().mergeFrom( + other.internalGetAttr()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + attr__ = input.readMessage( + AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAttr().ensureBuilderMap().put( + attr__.getKey(), attr__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class AttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AttrDefaultEntryHolder.defaultEntry; + } + }; + private static final AttrConverter attrConverter = new AttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> attr_; + private com.google.protobuf.MapFieldBuilder + internalGetAttr() { + if (attr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + return attr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAttr() { + if (attr_ == null) { + attr_ = new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return attr_; + } + public int getAttrCount() { + return internalGetAttr().ensureBuilderMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getImmutableMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + return map.containsKey(key) ? attrConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attrConverter.build(map.get(key)); + } + public Builder clearAttr() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableAttr().clear(); + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + public Builder removeAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttr() { + bitField0_ |= 0x00000001; + return internalGetMutableAttr().ensureMessageMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + public Builder putAttr( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + public Builder putAllAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 1; + */ + public org.tensorflow.proto.AttrValue.Builder putAttrBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAttr().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FunctionDef.ArgAttrs) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef.ArgAttrs) + private static final org.tensorflow.proto.FunctionDef.ArgAttrs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FunctionDef.ArgAttrs(); + } + + public static org.tensorflow.proto.FunctionDef.ArgAttrs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArgAttrs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FunctionDef.ArgAttrs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int SIGNATURE_FIELD_NUMBER = 1; + private org.tensorflow.proto.OpDef signature_; + /** + *
    +   * The definition of the function's name, arguments, return values,
    +   * attrs etc.
    +   * 
    + * + * .tensorflow.OpDef signature = 1; + * @return Whether the signature field is set. + */ + @java.lang.Override + public boolean hasSignature() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The definition of the function's name, arguments, return values,
    +   * attrs etc.
    +   * 
    + * + * .tensorflow.OpDef signature = 1; + * @return The signature. + */ + @java.lang.Override + public org.tensorflow.proto.OpDef getSignature() { + return signature_ == null ? org.tensorflow.proto.OpDef.getDefaultInstance() : signature_; + } + /** + *
    +   * The definition of the function's name, arguments, return values,
    +   * attrs etc.
    +   * 
    + * + * .tensorflow.OpDef signature = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpDefOrBuilder getSignatureOrBuilder() { + return signature_ == null ? org.tensorflow.proto.OpDef.getDefaultInstance() : signature_; + } + + public static final int ATTR_FIELD_NUMBER = 5; + private static final class AttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_AttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> attr_; + private com.google.protobuf.MapField + internalGetAttr() { + if (attr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttrDefaultEntryHolder.defaultEntry); + } + return attr_; + } + public int getAttrCount() { + return internalGetAttr().getMap().size(); + } + /** + *
    +   * Attributes specific to this function definition.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().getMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +   * Attributes specific to this function definition.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getMap(); + } + /** + *
    +   * Attributes specific to this function definition.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Attributes specific to this function definition.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ARG_ATTR_FIELD_NUMBER = 7; + private static final class ArgAttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, org.tensorflow.proto.FunctionDef.ArgAttrs> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ArgAttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.UINT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.FunctionDef.ArgAttrs.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, org.tensorflow.proto.FunctionDef.ArgAttrs> argAttr_; + private com.google.protobuf.MapField + internalGetArgAttr() { + if (argAttr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ArgAttrDefaultEntryHolder.defaultEntry); + } + return argAttr_; + } + public int getArgAttrCount() { + return internalGetArgAttr().getMap().size(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public boolean containsArgAttr( + int key) { + + return internalGetArgAttr().getMap().containsKey(key); + } + /** + * Use {@link #getArgAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getArgAttr() { + return getArgAttrMap(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public java.util.Map getArgAttrMap() { + return internalGetArgAttr().getMap(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrDefault( + int key, + /* nullable */ +org.tensorflow.proto.FunctionDef.ArgAttrs defaultValue) { + + java.util.Map map = + internalGetArgAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrThrow( + int key) { + + java.util.Map map = + internalGetArgAttr().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RESOURCE_ARG_UNIQUE_ID_FIELD_NUMBER = 8; + private static final class ResourceArgUniqueIdDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.UINT32, + 0, + com.google.protobuf.WireFormat.FieldType.UINT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> resourceArgUniqueId_; + private com.google.protobuf.MapField + internalGetResourceArgUniqueId() { + if (resourceArgUniqueId_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); + } + return resourceArgUniqueId_; + } + public int getResourceArgUniqueIdCount() { + return internalGetResourceArgUniqueId().getMap().size(); + } + /** + *
    +   * Unique IDs for each resource argument, used to track aliasing resources. If
    +   * Argument A and Argument B alias each other, then
    +   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +   *
    +   * If this field is empty, none of the arguments could alias; otherwise, every
    +   * resource argument should have an entry in this field.
    +   *
    +   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +   * "_resource_arg_unique_id" attribute.
    +   * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public boolean containsResourceArgUniqueId( + int key) { + + return internalGetResourceArgUniqueId().getMap().containsKey(key); + } + /** + * Use {@link #getResourceArgUniqueIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getResourceArgUniqueId() { + return getResourceArgUniqueIdMap(); + } + /** + *
    +   * Unique IDs for each resource argument, used to track aliasing resources. If
    +   * Argument A and Argument B alias each other, then
    +   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +   *
    +   * If this field is empty, none of the arguments could alias; otherwise, every
    +   * resource argument should have an entry in this field.
    +   *
    +   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +   * "_resource_arg_unique_id" attribute.
    +   * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public java.util.Map getResourceArgUniqueIdMap() { + return internalGetResourceArgUniqueId().getMap(); + } + /** + *
    +   * Unique IDs for each resource argument, used to track aliasing resources. If
    +   * Argument A and Argument B alias each other, then
    +   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +   *
    +   * If this field is empty, none of the arguments could alias; otherwise, every
    +   * resource argument should have an entry in this field.
    +   *
    +   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +   * "_resource_arg_unique_id" attribute.
    +   * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public int getResourceArgUniqueIdOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetResourceArgUniqueId().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Unique IDs for each resource argument, used to track aliasing resources. If
    +   * Argument A and Argument B alias each other, then
    +   * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +   *
    +   * If this field is empty, none of the arguments could alias; otherwise, every
    +   * resource argument should have an entry in this field.
    +   *
    +   * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +   * "_resource_arg_unique_id" attribute.
    +   * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public int getResourceArgUniqueIdOrThrow( + int key) { + + java.util.Map map = + internalGetResourceArgUniqueId().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NODE_DEF_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List nodeDef_; + /** + *
    +   * By convention, "op" in node_def is resolved by consulting with a
    +   * user-defined library first. If not resolved, "func" is assumed to
    +   * be a builtin op.
    +   * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + @java.lang.Override + public java.util.List getNodeDefList() { + return nodeDef_; + } + /** + *
    +   * By convention, "op" in node_def is resolved by consulting with a
    +   * user-defined library first. If not resolved, "func" is assumed to
    +   * be a builtin op.
    +   * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + @java.lang.Override + public java.util.List + getNodeDefOrBuilderList() { + return nodeDef_; + } + /** + *
    +   * By convention, "op" in node_def is resolved by consulting with a
    +   * user-defined library first. If not resolved, "func" is assumed to
    +   * be a builtin op.
    +   * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + @java.lang.Override + public int getNodeDefCount() { + return nodeDef_.size(); + } + /** + *
    +   * By convention, "op" in node_def is resolved by consulting with a
    +   * user-defined library first. If not resolved, "func" is assumed to
    +   * be a builtin op.
    +   * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + @java.lang.Override + public org.tensorflow.proto.NodeDef getNodeDef(int index) { + return nodeDef_.get(index); + } + /** + *
    +   * By convention, "op" in node_def is resolved by consulting with a
    +   * user-defined library first. If not resolved, "func" is assumed to
    +   * be a builtin op.
    +   * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + @java.lang.Override + public org.tensorflow.proto.NodeDefOrBuilder getNodeDefOrBuilder( + int index) { + return nodeDef_.get(index); + } + + public static final int RET_FIELD_NUMBER = 4; + private static final class RetDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_RetEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> ret_; + private com.google.protobuf.MapField + internalGetRet() { + if (ret_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RetDefaultEntryHolder.defaultEntry); + } + return ret_; + } + public int getRetCount() { + return internalGetRet().getMap().size(); + } + /** + *
    +   * A mapping from the output arg names from `signature` to the
    +   * outputs from `node_def` that should be returned by the function.
    +   * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public boolean containsRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetRet().getMap().containsKey(key); + } + /** + * Use {@link #getRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRet() { + return getRetMap(); + } + /** + *
    +   * A mapping from the output arg names from `signature` to the
    +   * outputs from `node_def` that should be returned by the function.
    +   * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public java.util.Map getRetMap() { + return internalGetRet().getMap(); + } + /** + *
    +   * A mapping from the output arg names from `signature` to the
    +   * outputs from `node_def` that should be returned by the function.
    +   * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * A mapping from the output arg names from `signature` to the
    +   * outputs from `node_def` that should be returned by the function.
    +   * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public java.lang.String getRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRet().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CONTROL_RET_FIELD_NUMBER = 6; + private static final class ControlRetDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_ControlRetEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> controlRet_; + private com.google.protobuf.MapField + internalGetControlRet() { + if (controlRet_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ControlRetDefaultEntryHolder.defaultEntry); + } + return controlRet_; + } + public int getControlRetCount() { + return internalGetControlRet().getMap().size(); + } + /** + *
    +   * A mapping from control output names from `signature` to node names in
    +   * `node_def` which should be control outputs of this function.
    +   * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public boolean containsControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetControlRet().getMap().containsKey(key); + } + /** + * Use {@link #getControlRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getControlRet() { + return getControlRetMap(); + } + /** + *
    +   * A mapping from control output names from `signature` to node names in
    +   * `node_def` which should be control outputs of this function.
    +   * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public java.util.Map getControlRetMap() { + return internalGetControlRet().getMap(); + } + /** + *
    +   * A mapping from control output names from `signature` to node names in
    +   * `node_def` which should be control outputs of this function.
    +   * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getControlRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetControlRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * A mapping from control output names from `signature` to node names in
    +   * `node_def` which should be control outputs of this function.
    +   * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public java.lang.String getControlRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetControlRet().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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSignature()); + } + for (int i = 0; i < nodeDef_.size(); i++) { + output.writeMessage(3, nodeDef_.get(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetRet(), + RetDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAttr(), + AttrDefaultEntryHolder.defaultEntry, + 5); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetControlRet(), + ControlRetDefaultEntryHolder.defaultEntry, + 6); + com.google.protobuf.GeneratedMessage + .serializeIntegerMapTo( + output, + internalGetArgAttr(), + ArgAttrDefaultEntryHolder.defaultEntry, + 7); + com.google.protobuf.GeneratedMessage + .serializeIntegerMapTo( + output, + internalGetResourceArgUniqueId(), + ResourceArgUniqueIdDefaultEntryHolder.defaultEntry, + 8); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSignature()); + } + for (int i = 0; i < nodeDef_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, nodeDef_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetRet().getMap().entrySet()) { + com.google.protobuf.MapEntry + ret__ = RetDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, ret__); + } + for (java.util.Map.Entry entry + : internalGetAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, attr__); + } + for (java.util.Map.Entry entry + : internalGetControlRet().getMap().entrySet()) { + com.google.protobuf.MapEntry + controlRet__ = ControlRetDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, controlRet__); + } + for (java.util.Map.Entry entry + : internalGetArgAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + argAttr__ = ArgAttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, argAttr__); + } + for (java.util.Map.Entry entry + : internalGetResourceArgUniqueId().getMap().entrySet()) { + com.google.protobuf.MapEntry + resourceArgUniqueId__ = ResourceArgUniqueIdDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, resourceArgUniqueId__); + } + size += getUnknownFields().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.FunctionDef)) { + return super.equals(obj); + } + org.tensorflow.proto.FunctionDef other = (org.tensorflow.proto.FunctionDef) obj; + + if (hasSignature() != other.hasSignature()) return false; + if (hasSignature()) { + if (!getSignature() + .equals(other.getSignature())) return false; + } + if (!internalGetAttr().equals( + other.internalGetAttr())) return false; + if (!internalGetArgAttr().equals( + other.internalGetArgAttr())) return false; + if (!internalGetResourceArgUniqueId().equals( + other.internalGetResourceArgUniqueId())) return false; + if (!getNodeDefList() + .equals(other.getNodeDefList())) return false; + if (!internalGetRet().equals( + other.internalGetRet())) return false; + if (!internalGetControlRet().equals( + other.internalGetControlRet())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + if (!internalGetAttr().getMap().isEmpty()) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttr().hashCode(); + } + if (!internalGetArgAttr().getMap().isEmpty()) { + hash = (37 * hash) + ARG_ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetArgAttr().hashCode(); + } + if (!internalGetResourceArgUniqueId().getMap().isEmpty()) { + hash = (37 * hash) + RESOURCE_ARG_UNIQUE_ID_FIELD_NUMBER; + hash = (53 * hash) + internalGetResourceArgUniqueId().hashCode(); + } + if (getNodeDefCount() > 0) { + hash = (37 * hash) + NODE_DEF_FIELD_NUMBER; + hash = (53 * hash) + getNodeDefList().hashCode(); + } + if (!internalGetRet().getMap().isEmpty()) { + hash = (37 * hash) + RET_FIELD_NUMBER; + hash = (53 * hash) + internalGetRet().hashCode(); + } + if (!internalGetControlRet().getMap().isEmpty()) { + hash = (37 * hash) + CONTROL_RET_FIELD_NUMBER; + hash = (53 * hash) + internalGetControlRet().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FunctionDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef 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.FunctionDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef 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.FunctionDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FunctionDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FunctionDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FunctionDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A function can be instantiated when the runtime can bind every attr
    +   * with a value. When a GraphDef has a call to a function, it must
    +   * have binding for every attr defined in the signature.
    +   *
    +   * TODO(zhifengc):
    +   * * device spec, etc.
    +   * 
    + * + * Protobuf type {@code tensorflow.FunctionDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDef) + org.tensorflow.proto.FunctionDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAttr(); + case 7: + return internalGetArgAttr(); + case 8: + return internalGetResourceArgUniqueId(); + case 4: + return internalGetRet(); + case 6: + return internalGetControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAttr(); + case 7: + return internalGetMutableArgAttr(); + case 8: + return internalGetMutableResourceArgUniqueId(); + case 4: + return internalGetMutableRet(); + case 6: + return internalGetMutableControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDef.class, org.tensorflow.proto.FunctionDef.Builder.class); + } + + // Construct using org.tensorflow.proto.FunctionDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSignatureFieldBuilder(); + getNodeDefFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + signature_ = null; + if (signatureBuilder_ != null) { + signatureBuilder_.dispose(); + signatureBuilder_ = null; + } + internalGetMutableAttr().clear(); + internalGetMutableArgAttr().clear(); + internalGetMutableResourceArgUniqueId().clear(); + if (nodeDefBuilder_ == null) { + nodeDef_ = java.util.Collections.emptyList(); + } else { + nodeDef_ = null; + nodeDefBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableRet().clear(); + internalGetMutableControlRet().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef getDefaultInstanceForType() { + return org.tensorflow.proto.FunctionDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef build() { + org.tensorflow.proto.FunctionDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDef buildPartial() { + org.tensorflow.proto.FunctionDef result = new org.tensorflow.proto.FunctionDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.FunctionDef result) { + if (nodeDefBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.nodeDef_ = nodeDef_; + } else { + result.nodeDef_ = nodeDefBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.FunctionDef result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.signature_ = signatureBuilder_ == null + ? signature_ + : signatureBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attr_ = internalGetAttr().build(AttrDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.argAttr_ = internalGetArgAttr().build(ArgAttrDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.resourceArgUniqueId_ = internalGetResourceArgUniqueId(); + result.resourceArgUniqueId_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.ret_ = internalGetRet(); + result.ret_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.controlRet_ = internalGetControlRet(); + result.controlRet_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FunctionDef) { + return mergeFrom((org.tensorflow.proto.FunctionDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FunctionDef other) { + if (other == org.tensorflow.proto.FunctionDef.getDefaultInstance()) return this; + if (other.hasSignature()) { + mergeSignature(other.getSignature()); + } + internalGetMutableAttr().mergeFrom( + other.internalGetAttr()); + bitField0_ |= 0x00000002; + internalGetMutableArgAttr().mergeFrom( + other.internalGetArgAttr()); + bitField0_ |= 0x00000004; + internalGetMutableResourceArgUniqueId().mergeFrom( + other.internalGetResourceArgUniqueId()); + bitField0_ |= 0x00000008; + if (nodeDefBuilder_ == null) { + if (!other.nodeDef_.isEmpty()) { + if (nodeDef_.isEmpty()) { + nodeDef_ = other.nodeDef_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureNodeDefIsMutable(); + nodeDef_.addAll(other.nodeDef_); + } + onChanged(); + } + } else { + if (!other.nodeDef_.isEmpty()) { + if (nodeDefBuilder_.isEmpty()) { + nodeDefBuilder_.dispose(); + nodeDefBuilder_ = null; + nodeDef_ = other.nodeDef_; + bitField0_ = (bitField0_ & ~0x00000010); + nodeDefBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeDefFieldBuilder() : null; + } else { + nodeDefBuilder_.addAllMessages(other.nodeDef_); + } + } + } + internalGetMutableRet().mergeFrom( + other.internalGetRet()); + bitField0_ |= 0x00000020; + internalGetMutableControlRet().mergeFrom( + other.internalGetControlRet()); + bitField0_ |= 0x00000040; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getSignatureFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: { + org.tensorflow.proto.NodeDef m = + input.readMessage( + org.tensorflow.proto.NodeDef.parser(), + extensionRegistry); + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + nodeDef_.add(m); + } else { + nodeDefBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + ret__ = input.readMessage( + RetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableRet().getMutableMap().put( + ret__.getKey(), ret__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + attr__ = input.readMessage( + AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAttr().ensureBuilderMap().put( + attr__.getKey(), attr__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 42 + case 50: { + com.google.protobuf.MapEntry + controlRet__ = input.readMessage( + ControlRetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableControlRet().getMutableMap().put( + controlRet__.getKey(), controlRet__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: { + com.google.protobuf.MapEntry + argAttr__ = input.readMessage( + ArgAttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableArgAttr().ensureBuilderMap().put( + argAttr__.getKey(), argAttr__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 58 + case 66: { + com.google.protobuf.MapEntry + resourceArgUniqueId__ = input.readMessage( + ResourceArgUniqueIdDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableResourceArgUniqueId().getMutableMap().put( + resourceArgUniqueId__.getKey(), resourceArgUniqueId__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.OpDef signature_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder> signatureBuilder_; + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + * @return Whether the signature field is set. + */ + public boolean hasSignature() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + * @return The signature. + */ + public org.tensorflow.proto.OpDef getSignature() { + if (signatureBuilder_ == null) { + return signature_ == null ? org.tensorflow.proto.OpDef.getDefaultInstance() : signature_; + } else { + return signatureBuilder_.getMessage(); + } + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public Builder setSignature(org.tensorflow.proto.OpDef value) { + if (signatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + signature_ = value; + } else { + signatureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public Builder setSignature( + org.tensorflow.proto.OpDef.Builder builderForValue) { + if (signatureBuilder_ == null) { + signature_ = builderForValue.build(); + } else { + signatureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public Builder mergeSignature(org.tensorflow.proto.OpDef value) { + if (signatureBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + signature_ != null && + signature_ != org.tensorflow.proto.OpDef.getDefaultInstance()) { + getSignatureBuilder().mergeFrom(value); + } else { + signature_ = value; + } + } else { + signatureBuilder_.mergeFrom(value); + } + if (signature_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000001); + signature_ = null; + if (signatureBuilder_ != null) { + signatureBuilder_.dispose(); + signatureBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public org.tensorflow.proto.OpDef.Builder getSignatureBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSignatureFieldBuilder().getBuilder(); + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + public org.tensorflow.proto.OpDefOrBuilder getSignatureOrBuilder() { + if (signatureBuilder_ != null) { + return signatureBuilder_.getMessageOrBuilder(); + } else { + return signature_ == null ? + org.tensorflow.proto.OpDef.getDefaultInstance() : signature_; + } + } + /** + *
    +     * The definition of the function's name, arguments, return values,
    +     * attrs etc.
    +     * 
    + * + * .tensorflow.OpDef signature = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder> + getSignatureFieldBuilder() { + if (signatureBuilder_ == null) { + signatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder>( + getSignature(), + getParentForChildren(), + isClean()); + signature_ = null; + } + return signatureBuilder_; + } + + private static final class AttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AttrDefaultEntryHolder.defaultEntry; + } + }; + private static final AttrConverter attrConverter = new AttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> attr_; + private com.google.protobuf.MapFieldBuilder + internalGetAttr() { + if (attr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + return attr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAttr() { + if (attr_ == null) { + attr_ = new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return attr_; + } + public int getAttrCount() { + return internalGetAttr().ensureBuilderMap().size(); + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getImmutableMap(); + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + return map.containsKey(key) ? attrConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attrConverter.build(map.get(key)); + } + public Builder clearAttr() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableAttr().clear(); + return this; + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder removeAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttr() { + bitField0_ |= 0x00000002; + return internalGetMutableAttr().ensureMessageMap(); + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder putAttr( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder putAllAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Attributes specific to this function definition.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public org.tensorflow.proto.AttrValue.Builder putAttrBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAttr().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + private static final class ArgAttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs build(org.tensorflow.proto.FunctionDef.ArgAttrsOrBuilder val) { + if (val instanceof org.tensorflow.proto.FunctionDef.ArgAttrs) { return (org.tensorflow.proto.FunctionDef.ArgAttrs) val; } + return ((org.tensorflow.proto.FunctionDef.ArgAttrs.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return ArgAttrDefaultEntryHolder.defaultEntry; + } + }; + private static final ArgAttrConverter argAttrConverter = new ArgAttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Integer, org.tensorflow.proto.FunctionDef.ArgAttrsOrBuilder, org.tensorflow.proto.FunctionDef.ArgAttrs, org.tensorflow.proto.FunctionDef.ArgAttrs.Builder> argAttr_; + private com.google.protobuf.MapFieldBuilder + internalGetArgAttr() { + if (argAttr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(argAttrConverter); + } + return argAttr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableArgAttr() { + if (argAttr_ == null) { + argAttr_ = new com.google.protobuf.MapFieldBuilder<>(argAttrConverter); + } + bitField0_ |= 0x00000004; + onChanged(); + return argAttr_; + } + public int getArgAttrCount() { + return internalGetArgAttr().ensureBuilderMap().size(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public boolean containsArgAttr( + int key) { + + return internalGetArgAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getArgAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getArgAttr() { + return getArgAttrMap(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public java.util.Map getArgAttrMap() { + return internalGetArgAttr().getImmutableMap(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrDefault( + int key, + /* nullable */ +org.tensorflow.proto.FunctionDef.ArgAttrs defaultValue) { + + java.util.Map map = internalGetMutableArgAttr().ensureBuilderMap(); + return map.containsKey(key) ? argAttrConverter.build(map.get(key)) : defaultValue; + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrThrow( + int key) { + + java.util.Map map = internalGetMutableArgAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return argAttrConverter.build(map.get(key)); + } + public Builder clearArgAttr() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableArgAttr().clear(); + return this; + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + public Builder removeArgAttr( + int key) { + + internalGetMutableArgAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableArgAttr() { + bitField0_ |= 0x00000004; + return internalGetMutableArgAttr().ensureMessageMap(); + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + public Builder putArgAttr( + int key, + org.tensorflow.proto.FunctionDef.ArgAttrs value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableArgAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + public Builder putAllArgAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableArgAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + /** + * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7; + */ + public org.tensorflow.proto.FunctionDef.ArgAttrs.Builder putArgAttrBuilderIfAbsent( + int key) { + java.util.Map builderMap = internalGetMutableArgAttr().ensureBuilderMap(); + org.tensorflow.proto.FunctionDef.ArgAttrsOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.FunctionDef.ArgAttrs.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.FunctionDef.ArgAttrs) { + entry = ((org.tensorflow.proto.FunctionDef.ArgAttrs) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.FunctionDef.ArgAttrs.Builder) entry; + } + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> resourceArgUniqueId_; + private com.google.protobuf.MapField + internalGetResourceArgUniqueId() { + if (resourceArgUniqueId_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); + } + return resourceArgUniqueId_; + } + private com.google.protobuf.MapField + internalGetMutableResourceArgUniqueId() { + if (resourceArgUniqueId_ == null) { + resourceArgUniqueId_ = com.google.protobuf.MapField.newMapField( + ResourceArgUniqueIdDefaultEntryHolder.defaultEntry); + } + if (!resourceArgUniqueId_.isMutable()) { + resourceArgUniqueId_ = resourceArgUniqueId_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return resourceArgUniqueId_; + } + public int getResourceArgUniqueIdCount() { + return internalGetResourceArgUniqueId().getMap().size(); + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public boolean containsResourceArgUniqueId( + int key) { + + return internalGetResourceArgUniqueId().getMap().containsKey(key); + } + /** + * Use {@link #getResourceArgUniqueIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getResourceArgUniqueId() { + return getResourceArgUniqueIdMap(); + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public java.util.Map getResourceArgUniqueIdMap() { + return internalGetResourceArgUniqueId().getMap(); + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public int getResourceArgUniqueIdOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetResourceArgUniqueId().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + @java.lang.Override + public int getResourceArgUniqueIdOrThrow( + int key) { + + java.util.Map map = + internalGetResourceArgUniqueId().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearResourceArgUniqueId() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableResourceArgUniqueId().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + public Builder removeResourceArgUniqueId( + int key) { + + internalGetMutableResourceArgUniqueId().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableResourceArgUniqueId() { + bitField0_ |= 0x00000008; + return internalGetMutableResourceArgUniqueId().getMutableMap(); + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + public Builder putResourceArgUniqueId( + int key, + int value) { + + + internalGetMutableResourceArgUniqueId().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * Unique IDs for each resource argument, used to track aliasing resources. If
    +     * Argument A and Argument B alias each other, then
    +     * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +     *
    +     * If this field is empty, none of the arguments could alias; otherwise, every
    +     * resource argument should have an entry in this field.
    +     *
    +     * When instantiated, the unique IDs will be attached to the _Arg nodes'
    +     * "_resource_arg_unique_id" attribute.
    +     * 
    + * + * map<uint32, uint32> resource_arg_unique_id = 8; + */ + public Builder putAllResourceArgUniqueId( + java.util.Map values) { + internalGetMutableResourceArgUniqueId().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private java.util.List nodeDef_ = + java.util.Collections.emptyList(); + private void ensureNodeDefIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + nodeDef_ = new java.util.ArrayList(nodeDef_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder> nodeDefBuilder_; + + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public java.util.List getNodeDefList() { + if (nodeDefBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeDef_); + } else { + return nodeDefBuilder_.getMessageList(); + } + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public int getNodeDefCount() { + if (nodeDefBuilder_ == null) { + return nodeDef_.size(); + } else { + return nodeDefBuilder_.getCount(); + } + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public org.tensorflow.proto.NodeDef getNodeDef(int index) { + if (nodeDefBuilder_ == null) { + return nodeDef_.get(index); + } else { + return nodeDefBuilder_.getMessage(index); + } + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder setNodeDef( + int index, org.tensorflow.proto.NodeDef value) { + if (nodeDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeDefIsMutable(); + nodeDef_.set(index, value); + onChanged(); + } else { + nodeDefBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder setNodeDef( + int index, org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + nodeDef_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeDefBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder addNodeDef(org.tensorflow.proto.NodeDef value) { + if (nodeDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeDefIsMutable(); + nodeDef_.add(value); + onChanged(); + } else { + nodeDefBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder addNodeDef( + int index, org.tensorflow.proto.NodeDef value) { + if (nodeDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeDefIsMutable(); + nodeDef_.add(index, value); + onChanged(); + } else { + nodeDefBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder addNodeDef( + org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + nodeDef_.add(builderForValue.build()); + onChanged(); + } else { + nodeDefBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder addNodeDef( + int index, org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + nodeDef_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeDefBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder addAllNodeDef( + java.lang.Iterable values) { + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeDef_); + onChanged(); + } else { + nodeDefBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder clearNodeDef() { + if (nodeDefBuilder_ == null) { + nodeDef_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + nodeDefBuilder_.clear(); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public Builder removeNodeDef(int index) { + if (nodeDefBuilder_ == null) { + ensureNodeDefIsMutable(); + nodeDef_.remove(index); + onChanged(); + } else { + nodeDefBuilder_.remove(index); + } + return this; + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public org.tensorflow.proto.NodeDef.Builder getNodeDefBuilder( + int index) { + return getNodeDefFieldBuilder().getBuilder(index); + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public org.tensorflow.proto.NodeDefOrBuilder getNodeDefOrBuilder( + int index) { + if (nodeDefBuilder_ == null) { + return nodeDef_.get(index); } else { + return nodeDefBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public java.util.List + getNodeDefOrBuilderList() { + if (nodeDefBuilder_ != null) { + return nodeDefBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeDef_); + } + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public org.tensorflow.proto.NodeDef.Builder addNodeDefBuilder() { + return getNodeDefFieldBuilder().addBuilder( + org.tensorflow.proto.NodeDef.getDefaultInstance()); + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public org.tensorflow.proto.NodeDef.Builder addNodeDefBuilder( + int index) { + return getNodeDefFieldBuilder().addBuilder( + index, org.tensorflow.proto.NodeDef.getDefaultInstance()); + } + /** + *
    +     * By convention, "op" in node_def is resolved by consulting with a
    +     * user-defined library first. If not resolved, "func" is assumed to
    +     * be a builtin op.
    +     * 
    + * + * repeated .tensorflow.NodeDef node_def = 3; + */ + public java.util.List + getNodeDefBuilderList() { + return getNodeDefFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder> + getNodeDefFieldBuilder() { + if (nodeDefBuilder_ == null) { + nodeDefBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder>( + nodeDef_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + nodeDef_ = null; + } + return nodeDefBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> ret_; + private com.google.protobuf.MapField + internalGetRet() { + if (ret_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RetDefaultEntryHolder.defaultEntry); + } + return ret_; + } + private com.google.protobuf.MapField + internalGetMutableRet() { + if (ret_ == null) { + ret_ = com.google.protobuf.MapField.newMapField( + RetDefaultEntryHolder.defaultEntry); + } + if (!ret_.isMutable()) { + ret_ = ret_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return ret_; + } + public int getRetCount() { + return internalGetRet().getMap().size(); + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public boolean containsRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetRet().getMap().containsKey(key); + } + /** + * Use {@link #getRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRet() { + return getRetMap(); + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public java.util.Map getRetMap() { + return internalGetRet().getMap(); + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + @java.lang.Override + public java.lang.String getRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetRet().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearRet() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableRet().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + public Builder removeRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableRet().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableRet() { + bitField0_ |= 0x00000020; + return internalGetMutableRet().getMutableMap(); + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + public Builder putRet( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableRet().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + *
    +     * A mapping from the output arg names from `signature` to the
    +     * outputs from `node_def` that should be returned by the function.
    +     * 
    + * + * map<string, string> ret = 4; + */ + public Builder putAllRet( + java.util.Map values) { + internalGetMutableRet().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> controlRet_; + private com.google.protobuf.MapField + internalGetControlRet() { + if (controlRet_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ControlRetDefaultEntryHolder.defaultEntry); + } + return controlRet_; + } + private com.google.protobuf.MapField + internalGetMutableControlRet() { + if (controlRet_ == null) { + controlRet_ = com.google.protobuf.MapField.newMapField( + ControlRetDefaultEntryHolder.defaultEntry); + } + if (!controlRet_.isMutable()) { + controlRet_ = controlRet_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return controlRet_; + } + public int getControlRetCount() { + return internalGetControlRet().getMap().size(); + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public boolean containsControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetControlRet().getMap().containsKey(key); + } + /** + * Use {@link #getControlRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getControlRet() { + return getControlRetMap(); + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public java.util.Map getControlRetMap() { + return internalGetControlRet().getMap(); + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getControlRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetControlRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + @java.lang.Override + public java.lang.String getControlRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetControlRet().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearControlRet() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableControlRet().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + public Builder removeControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableControlRet().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableControlRet() { + bitField0_ |= 0x00000040; + return internalGetMutableControlRet().getMutableMap(); + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + public Builder putControlRet( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableControlRet().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000040; + return this; + } + /** + *
    +     * A mapping from control output names from `signature` to node names in
    +     * `node_def` which should be control outputs of this function.
    +     * 
    + * + * map<string, string> control_ret = 6; + */ + public Builder putAllControlRet( + java.util.Map values) { + internalGetMutableControlRet().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FunctionDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef) + private static final org.tensorflow.proto.FunctionDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FunctionDef(); + } + + public static org.tensorflow.proto.FunctionDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FunctionDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibrary.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibrary.java new file mode 100644 index 00000000000..13f92728ca4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibrary.java @@ -0,0 +1,1427 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A library is a set of named functions.
    + * 
    + * + * Protobuf type {@code tensorflow.FunctionDefLibrary} + */ +public final class FunctionDefLibrary extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FunctionDefLibrary) + FunctionDefLibraryOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FunctionDefLibrary.class.getName()); + } + // Use FunctionDefLibrary.newBuilder() to construct. + private FunctionDefLibrary(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FunctionDefLibrary() { + function_ = java.util.Collections.emptyList(); + gradient_ = java.util.Collections.emptyList(); + registeredGradients_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDefLibrary.class, org.tensorflow.proto.FunctionDefLibrary.Builder.class); + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List function_; + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + @java.lang.Override + public java.util.List getFunctionList() { + return function_; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + @java.lang.Override + public java.util.List + getFunctionOrBuilderList() { + return function_; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + @java.lang.Override + public int getFunctionCount() { + return function_.size(); + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDef getFunction(int index) { + return function_.get(index); + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDefOrBuilder getFunctionOrBuilder( + int index) { + return function_.get(index); + } + + public static final int GRADIENT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List gradient_; + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + @java.lang.Override + public java.util.List getGradientList() { + return gradient_; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + @java.lang.Override + public java.util.List + getGradientOrBuilderList() { + return gradient_; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + @java.lang.Override + public int getGradientCount() { + return gradient_.size(); + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GradientDef getGradient(int index) { + return gradient_.get(index); + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GradientDefOrBuilder getGradientOrBuilder( + int index) { + return gradient_.get(index); + } + + public static final int REGISTERED_GRADIENTS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List registeredGradients_; + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + @java.lang.Override + public java.util.List getRegisteredGradientsList() { + return registeredGradients_; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + @java.lang.Override + public java.util.List + getRegisteredGradientsOrBuilderList() { + return registeredGradients_; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + @java.lang.Override + public int getRegisteredGradientsCount() { + return registeredGradients_.size(); + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + @java.lang.Override + public org.tensorflow.proto.RegisteredGradient getRegisteredGradients(int index) { + return registeredGradients_.get(index); + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + @java.lang.Override + public org.tensorflow.proto.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( + int index) { + return registeredGradients_.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 { + for (int i = 0; i < function_.size(); i++) { + output.writeMessage(1, function_.get(i)); + } + for (int i = 0; i < gradient_.size(); i++) { + output.writeMessage(2, gradient_.get(i)); + } + for (int i = 0; i < registeredGradients_.size(); i++) { + output.writeMessage(3, registeredGradients_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < function_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, function_.get(i)); + } + for (int i = 0; i < gradient_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, gradient_.get(i)); + } + for (int i = 0; i < registeredGradients_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, registeredGradients_.get(i)); + } + size += getUnknownFields().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.FunctionDefLibrary)) { + return super.equals(obj); + } + org.tensorflow.proto.FunctionDefLibrary other = (org.tensorflow.proto.FunctionDefLibrary) obj; + + if (!getFunctionList() + .equals(other.getFunctionList())) return false; + if (!getGradientList() + .equals(other.getGradientList())) return false; + if (!getRegisteredGradientsList() + .equals(other.getRegisteredGradientsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFunctionCount() > 0) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunctionList().hashCode(); + } + if (getGradientCount() > 0) { + hash = (37 * hash) + GRADIENT_FIELD_NUMBER; + hash = (53 * hash) + getGradientList().hashCode(); + } + if (getRegisteredGradientsCount() > 0) { + hash = (37 * hash) + REGISTERED_GRADIENTS_FIELD_NUMBER; + hash = (53 * hash) + getRegisteredGradientsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.FunctionDefLibrary parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDefLibrary 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.FunctionDefLibrary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDefLibrary 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.FunctionDefLibrary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.FunctionDefLibrary parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDefLibrary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDefLibrary parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.FunctionDefLibrary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.FunctionDefLibrary parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.FunctionDefLibrary parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.FunctionDefLibrary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.FunctionDefLibrary 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A library is a set of named functions.
    +   * 
    + * + * Protobuf type {@code tensorflow.FunctionDefLibrary} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDefLibrary) + org.tensorflow.proto.FunctionDefLibraryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.FunctionDefLibrary.class, org.tensorflow.proto.FunctionDefLibrary.Builder.class); + } + + // Construct using org.tensorflow.proto.FunctionDefLibrary.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (functionBuilder_ == null) { + function_ = java.util.Collections.emptyList(); + } else { + function_ = null; + functionBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (gradientBuilder_ == null) { + gradient_ = java.util.Collections.emptyList(); + } else { + gradient_ = null; + gradientBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (registeredGradientsBuilder_ == null) { + registeredGradients_ = java.util.Collections.emptyList(); + } else { + registeredGradients_ = null; + registeredGradientsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_FunctionDefLibrary_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDefLibrary getDefaultInstanceForType() { + return org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDefLibrary build() { + org.tensorflow.proto.FunctionDefLibrary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.FunctionDefLibrary buildPartial() { + org.tensorflow.proto.FunctionDefLibrary result = new org.tensorflow.proto.FunctionDefLibrary(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.FunctionDefLibrary result) { + if (functionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + function_ = java.util.Collections.unmodifiableList(function_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + if (gradientBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + gradient_ = java.util.Collections.unmodifiableList(gradient_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.gradient_ = gradient_; + } else { + result.gradient_ = gradientBuilder_.build(); + } + if (registeredGradientsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + registeredGradients_ = java.util.Collections.unmodifiableList(registeredGradients_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.registeredGradients_ = registeredGradients_; + } else { + result.registeredGradients_ = registeredGradientsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.FunctionDefLibrary result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.FunctionDefLibrary) { + return mergeFrom((org.tensorflow.proto.FunctionDefLibrary)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.FunctionDefLibrary other) { + if (other == org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance()) return this; + if (functionBuilder_ == null) { + if (!other.function_.isEmpty()) { + if (function_.isEmpty()) { + function_ = other.function_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionIsMutable(); + function_.addAll(other.function_); + } + onChanged(); + } + } else { + if (!other.function_.isEmpty()) { + if (functionBuilder_.isEmpty()) { + functionBuilder_.dispose(); + functionBuilder_ = null; + function_ = other.function_; + bitField0_ = (bitField0_ & ~0x00000001); + functionBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFunctionFieldBuilder() : null; + } else { + functionBuilder_.addAllMessages(other.function_); + } + } + } + if (gradientBuilder_ == null) { + if (!other.gradient_.isEmpty()) { + if (gradient_.isEmpty()) { + gradient_ = other.gradient_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureGradientIsMutable(); + gradient_.addAll(other.gradient_); + } + onChanged(); + } + } else { + if (!other.gradient_.isEmpty()) { + if (gradientBuilder_.isEmpty()) { + gradientBuilder_.dispose(); + gradientBuilder_ = null; + gradient_ = other.gradient_; + bitField0_ = (bitField0_ & ~0x00000002); + gradientBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getGradientFieldBuilder() : null; + } else { + gradientBuilder_.addAllMessages(other.gradient_); + } + } + } + if (registeredGradientsBuilder_ == null) { + if (!other.registeredGradients_.isEmpty()) { + if (registeredGradients_.isEmpty()) { + registeredGradients_ = other.registeredGradients_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.addAll(other.registeredGradients_); + } + onChanged(); + } + } else { + if (!other.registeredGradients_.isEmpty()) { + if (registeredGradientsBuilder_.isEmpty()) { + registeredGradientsBuilder_.dispose(); + registeredGradientsBuilder_ = null; + registeredGradients_ = other.registeredGradients_; + bitField0_ = (bitField0_ & ~0x00000004); + registeredGradientsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getRegisteredGradientsFieldBuilder() : null; + } else { + registeredGradientsBuilder_.addAllMessages(other.registeredGradients_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.FunctionDef m = + input.readMessage( + org.tensorflow.proto.FunctionDef.parser(), + extensionRegistry); + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + function_.add(m); + } else { + functionBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + org.tensorflow.proto.GradientDef m = + input.readMessage( + org.tensorflow.proto.GradientDef.parser(), + extensionRegistry); + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + gradient_.add(m); + } else { + gradientBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + org.tensorflow.proto.RegisteredGradient m = + input.readMessage( + org.tensorflow.proto.RegisteredGradient.parser(), + extensionRegistry); + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.add(m); + } else { + registeredGradientsBuilder_.addMessage(m); + } + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List function_ = + java.util.Collections.emptyList(); + private void ensureFunctionIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + function_ = new java.util.ArrayList(function_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FunctionDef, org.tensorflow.proto.FunctionDef.Builder, org.tensorflow.proto.FunctionDefOrBuilder> functionBuilder_; + + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public java.util.List getFunctionList() { + if (functionBuilder_ == null) { + return java.util.Collections.unmodifiableList(function_); + } else { + return functionBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public int getFunctionCount() { + if (functionBuilder_ == null) { + return function_.size(); + } else { + return functionBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public org.tensorflow.proto.FunctionDef getFunction(int index) { + if (functionBuilder_ == null) { + return function_.get(index); + } else { + return functionBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder setFunction( + int index, org.tensorflow.proto.FunctionDef value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.set(index, value); + onChanged(); + } else { + functionBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder setFunction( + int index, org.tensorflow.proto.FunctionDef.Builder builderForValue) { + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + function_.set(index, builderForValue.build()); + onChanged(); + } else { + functionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder addFunction(org.tensorflow.proto.FunctionDef value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(value); + onChanged(); + } else { + functionBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder addFunction( + int index, org.tensorflow.proto.FunctionDef value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionIsMutable(); + function_.add(index, value); + onChanged(); + } else { + functionBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder addFunction( + org.tensorflow.proto.FunctionDef.Builder builderForValue) { + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + function_.add(builderForValue.build()); + onChanged(); + } else { + functionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder addFunction( + int index, org.tensorflow.proto.FunctionDef.Builder builderForValue) { + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + function_.add(index, builderForValue.build()); + onChanged(); + } else { + functionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder addAllFunction( + java.lang.Iterable values) { + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, function_); + onChanged(); + } else { + functionBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + functionBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public Builder removeFunction(int index) { + if (functionBuilder_ == null) { + ensureFunctionIsMutable(); + function_.remove(index); + onChanged(); + } else { + functionBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public org.tensorflow.proto.FunctionDef.Builder getFunctionBuilder( + int index) { + return getFunctionFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public org.tensorflow.proto.FunctionDefOrBuilder getFunctionOrBuilder( + int index) { + if (functionBuilder_ == null) { + return function_.get(index); } else { + return functionBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public java.util.List + getFunctionOrBuilderList() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(function_); + } + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public org.tensorflow.proto.FunctionDef.Builder addFunctionBuilder() { + return getFunctionFieldBuilder().addBuilder( + org.tensorflow.proto.FunctionDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public org.tensorflow.proto.FunctionDef.Builder addFunctionBuilder( + int index) { + return getFunctionFieldBuilder().addBuilder( + index, org.tensorflow.proto.FunctionDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + public java.util.List + getFunctionBuilderList() { + return getFunctionFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FunctionDef, org.tensorflow.proto.FunctionDef.Builder, org.tensorflow.proto.FunctionDefOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.FunctionDef, org.tensorflow.proto.FunctionDef.Builder, org.tensorflow.proto.FunctionDefOrBuilder>( + function_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + function_ = null; + } + return functionBuilder_; + } + + private java.util.List gradient_ = + java.util.Collections.emptyList(); + private void ensureGradientIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + gradient_ = new java.util.ArrayList(gradient_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GradientDef, org.tensorflow.proto.GradientDef.Builder, org.tensorflow.proto.GradientDefOrBuilder> gradientBuilder_; + + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public java.util.List getGradientList() { + if (gradientBuilder_ == null) { + return java.util.Collections.unmodifiableList(gradient_); + } else { + return gradientBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public int getGradientCount() { + if (gradientBuilder_ == null) { + return gradient_.size(); + } else { + return gradientBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public org.tensorflow.proto.GradientDef getGradient(int index) { + if (gradientBuilder_ == null) { + return gradient_.get(index); + } else { + return gradientBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder setGradient( + int index, org.tensorflow.proto.GradientDef value) { + if (gradientBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradientIsMutable(); + gradient_.set(index, value); + onChanged(); + } else { + gradientBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder setGradient( + int index, org.tensorflow.proto.GradientDef.Builder builderForValue) { + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + gradient_.set(index, builderForValue.build()); + onChanged(); + } else { + gradientBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder addGradient(org.tensorflow.proto.GradientDef value) { + if (gradientBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradientIsMutable(); + gradient_.add(value); + onChanged(); + } else { + gradientBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder addGradient( + int index, org.tensorflow.proto.GradientDef value) { + if (gradientBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGradientIsMutable(); + gradient_.add(index, value); + onChanged(); + } else { + gradientBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder addGradient( + org.tensorflow.proto.GradientDef.Builder builderForValue) { + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + gradient_.add(builderForValue.build()); + onChanged(); + } else { + gradientBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder addGradient( + int index, org.tensorflow.proto.GradientDef.Builder builderForValue) { + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + gradient_.add(index, builderForValue.build()); + onChanged(); + } else { + gradientBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder addAllGradient( + java.lang.Iterable values) { + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, gradient_); + onChanged(); + } else { + gradientBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder clearGradient() { + if (gradientBuilder_ == null) { + gradient_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + gradientBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public Builder removeGradient(int index) { + if (gradientBuilder_ == null) { + ensureGradientIsMutable(); + gradient_.remove(index); + onChanged(); + } else { + gradientBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public org.tensorflow.proto.GradientDef.Builder getGradientBuilder( + int index) { + return getGradientFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public org.tensorflow.proto.GradientDefOrBuilder getGradientOrBuilder( + int index) { + if (gradientBuilder_ == null) { + return gradient_.get(index); } else { + return gradientBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public java.util.List + getGradientOrBuilderList() { + if (gradientBuilder_ != null) { + return gradientBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(gradient_); + } + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public org.tensorflow.proto.GradientDef.Builder addGradientBuilder() { + return getGradientFieldBuilder().addBuilder( + org.tensorflow.proto.GradientDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public org.tensorflow.proto.GradientDef.Builder addGradientBuilder( + int index) { + return getGradientFieldBuilder().addBuilder( + index, org.tensorflow.proto.GradientDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + public java.util.List + getGradientBuilderList() { + return getGradientFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GradientDef, org.tensorflow.proto.GradientDef.Builder, org.tensorflow.proto.GradientDefOrBuilder> + getGradientFieldBuilder() { + if (gradientBuilder_ == null) { + gradientBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GradientDef, org.tensorflow.proto.GradientDef.Builder, org.tensorflow.proto.GradientDefOrBuilder>( + gradient_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + gradient_ = null; + } + return gradientBuilder_; + } + + private java.util.List registeredGradients_ = + java.util.Collections.emptyList(); + private void ensureRegisteredGradientsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + registeredGradients_ = new java.util.ArrayList(registeredGradients_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RegisteredGradient, org.tensorflow.proto.RegisteredGradient.Builder, org.tensorflow.proto.RegisteredGradientOrBuilder> registeredGradientsBuilder_; + + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public java.util.List getRegisteredGradientsList() { + if (registeredGradientsBuilder_ == null) { + return java.util.Collections.unmodifiableList(registeredGradients_); + } else { + return registeredGradientsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public int getRegisteredGradientsCount() { + if (registeredGradientsBuilder_ == null) { + return registeredGradients_.size(); + } else { + return registeredGradientsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public org.tensorflow.proto.RegisteredGradient getRegisteredGradients(int index) { + if (registeredGradientsBuilder_ == null) { + return registeredGradients_.get(index); + } else { + return registeredGradientsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder setRegisteredGradients( + int index, org.tensorflow.proto.RegisteredGradient value) { + if (registeredGradientsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegisteredGradientsIsMutable(); + registeredGradients_.set(index, value); + onChanged(); + } else { + registeredGradientsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder setRegisteredGradients( + int index, org.tensorflow.proto.RegisteredGradient.Builder builderForValue) { + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.set(index, builderForValue.build()); + onChanged(); + } else { + registeredGradientsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder addRegisteredGradients(org.tensorflow.proto.RegisteredGradient value) { + if (registeredGradientsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegisteredGradientsIsMutable(); + registeredGradients_.add(value); + onChanged(); + } else { + registeredGradientsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder addRegisteredGradients( + int index, org.tensorflow.proto.RegisteredGradient value) { + if (registeredGradientsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegisteredGradientsIsMutable(); + registeredGradients_.add(index, value); + onChanged(); + } else { + registeredGradientsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder addRegisteredGradients( + org.tensorflow.proto.RegisteredGradient.Builder builderForValue) { + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.add(builderForValue.build()); + onChanged(); + } else { + registeredGradientsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder addRegisteredGradients( + int index, org.tensorflow.proto.RegisteredGradient.Builder builderForValue) { + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.add(index, builderForValue.build()); + onChanged(); + } else { + registeredGradientsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder addAllRegisteredGradients( + java.lang.Iterable values) { + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, registeredGradients_); + onChanged(); + } else { + registeredGradientsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder clearRegisteredGradients() { + if (registeredGradientsBuilder_ == null) { + registeredGradients_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + registeredGradientsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public Builder removeRegisteredGradients(int index) { + if (registeredGradientsBuilder_ == null) { + ensureRegisteredGradientsIsMutable(); + registeredGradients_.remove(index); + onChanged(); + } else { + registeredGradientsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public org.tensorflow.proto.RegisteredGradient.Builder getRegisteredGradientsBuilder( + int index) { + return getRegisteredGradientsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public org.tensorflow.proto.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( + int index) { + if (registeredGradientsBuilder_ == null) { + return registeredGradients_.get(index); } else { + return registeredGradientsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public java.util.List + getRegisteredGradientsOrBuilderList() { + if (registeredGradientsBuilder_ != null) { + return registeredGradientsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(registeredGradients_); + } + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public org.tensorflow.proto.RegisteredGradient.Builder addRegisteredGradientsBuilder() { + return getRegisteredGradientsFieldBuilder().addBuilder( + org.tensorflow.proto.RegisteredGradient.getDefaultInstance()); + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public org.tensorflow.proto.RegisteredGradient.Builder addRegisteredGradientsBuilder( + int index) { + return getRegisteredGradientsFieldBuilder().addBuilder( + index, org.tensorflow.proto.RegisteredGradient.getDefaultInstance()); + } + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + public java.util.List + getRegisteredGradientsBuilderList() { + return getRegisteredGradientsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RegisteredGradient, org.tensorflow.proto.RegisteredGradient.Builder, org.tensorflow.proto.RegisteredGradientOrBuilder> + getRegisteredGradientsFieldBuilder() { + if (registeredGradientsBuilder_ == null) { + registeredGradientsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RegisteredGradient, org.tensorflow.proto.RegisteredGradient.Builder, org.tensorflow.proto.RegisteredGradientOrBuilder>( + registeredGradients_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + registeredGradients_ = null; + } + return registeredGradientsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FunctionDefLibrary) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionDefLibrary) + private static final org.tensorflow.proto.FunctionDefLibrary DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.FunctionDefLibrary(); + } + + public static org.tensorflow.proto.FunctionDefLibrary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionDefLibrary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FunctionDefLibrary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibraryOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibraryOrBuilder.java new file mode 100644 index 00000000000..5dfb6aefc69 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefLibraryOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface FunctionDefLibraryOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FunctionDefLibrary) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + java.util.List + getFunctionList(); + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + org.tensorflow.proto.FunctionDef getFunction(int index); + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + int getFunctionCount(); + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + java.util.List + getFunctionOrBuilderList(); + /** + * repeated .tensorflow.FunctionDef function = 1; + */ + org.tensorflow.proto.FunctionDefOrBuilder getFunctionOrBuilder( + int index); + + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + java.util.List + getGradientList(); + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + org.tensorflow.proto.GradientDef getGradient(int index); + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + int getGradientCount(); + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + java.util.List + getGradientOrBuilderList(); + /** + * repeated .tensorflow.GradientDef gradient = 2; + */ + org.tensorflow.proto.GradientDefOrBuilder getGradientOrBuilder( + int index); + + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + java.util.List + getRegisteredGradientsList(); + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + org.tensorflow.proto.RegisteredGradient getRegisteredGradients(int index); + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + int getRegisteredGradientsCount(); + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + java.util.List + getRegisteredGradientsOrBuilderList(); + /** + * repeated .tensorflow.RegisteredGradient registered_gradients = 3; + */ + org.tensorflow.proto.RegisteredGradientOrBuilder getRegisteredGradientsOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefOrBuilder.java similarity index 87% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefOrBuilder.java index ebae0875f50..cd87f92a585 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface FunctionDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.FunctionDef) @@ -14,6 +16,7 @@ public interface FunctionDefOrBuilder extends *
    * * .tensorflow.OpDef signature = 1; + * @return Whether the signature field is set. */ boolean hasSignature(); /** @@ -23,8 +26,9 @@ public interface FunctionDefOrBuilder extends *
    * * .tensorflow.OpDef signature = 1; + * @return The signature. */ - org.tensorflow.proto.framework.OpDef getSignature(); + org.tensorflow.proto.OpDef getSignature(); /** *
        * The definition of the function's name, arguments, return values,
    @@ -33,7 +37,7 @@ public interface FunctionDefOrBuilder extends
        *
        * .tensorflow.OpDef signature = 1;
        */
    -  org.tensorflow.proto.framework.OpDefOrBuilder getSignatureOrBuilder();
    +  org.tensorflow.proto.OpDefOrBuilder getSignatureOrBuilder();
     
       /**
        * 
    @@ -56,7 +60,7 @@ boolean containsAttr(
        * Use {@link #getAttrMap()} instead.
        */
       @java.lang.Deprecated
    -  java.util.Map
    +  java.util.Map
       getAttr();
       /**
        * 
    @@ -65,7 +69,7 @@ boolean containsAttr(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -  java.util.Map
    +  java.util.Map
       getAttrMap();
       /**
        * 
    @@ -74,10 +78,11 @@ boolean containsAttr(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -
    -  org.tensorflow.proto.framework.AttrValue getAttrOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.AttrValue getAttrOrDefault(
           java.lang.String key,
    -      org.tensorflow.proto.framework.AttrValue defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.AttrValue defaultValue);
       /**
        * 
        * Attributes specific to this function definition.
    @@ -85,8 +90,7 @@ org.tensorflow.proto.framework.AttrValue getAttrOrDefault(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -
    -  org.tensorflow.proto.framework.AttrValue getAttrOrThrow(
    +  org.tensorflow.proto.AttrValue getAttrOrThrow(
           java.lang.String key);
     
       /**
    @@ -102,25 +106,25 @@ boolean containsArgAttr(
        * Use {@link #getArgAttrMap()} instead.
        */
       @java.lang.Deprecated
    -  java.util.Map
    +  java.util.Map
       getArgAttr();
       /**
        * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7;
        */
    -  java.util.Map
    +  java.util.Map
       getArgAttrMap();
       /**
        * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7;
        */
    -
    -  org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrDefault(
           int key,
    -      org.tensorflow.proto.framework.FunctionDef.ArgAttrs defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.FunctionDef.ArgAttrs defaultValue);
       /**
        * map<uint32, .tensorflow.FunctionDef.ArgAttrs> arg_attr = 7;
        */
    -
    -  org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrThrow(
    +  org.tensorflow.proto.FunctionDef.ArgAttrs getArgAttrOrThrow(
           int key);
     
       /**
    @@ -128,8 +132,10 @@ org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrThrow(
        * Unique IDs for each resource argument, used to track aliasing resources. If
        * Argument A and Argument B alias each other, then
        * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
    +   *
        * If this field is empty, none of the arguments could alias; otherwise, every
        * resource argument should have an entry in this field.
    +   *
        * When instantiated, the unique IDs will be attached to the _Arg nodes'
        * "_resource_arg_unique_id" attribute.
        * 
    @@ -142,8 +148,10 @@ org.tensorflow.proto.framework.FunctionDef.ArgAttrs getArgAttrOrThrow( * Unique IDs for each resource argument, used to track aliasing resources. If * Argument A and Argument B alias each other, then * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index]. + * * If this field is empty, none of the arguments could alias; otherwise, every * resource argument should have an entry in this field. + * * When instantiated, the unique IDs will be attached to the _Arg nodes' * "_resource_arg_unique_id" attribute. *
    @@ -163,8 +171,10 @@ boolean containsResourceArgUniqueId( * Unique IDs for each resource argument, used to track aliasing resources. If * Argument A and Argument B alias each other, then * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index]. + * * If this field is empty, none of the arguments could alias; otherwise, every * resource argument should have an entry in this field. + * * When instantiated, the unique IDs will be attached to the _Arg nodes' * "_resource_arg_unique_id" attribute. *
    @@ -178,15 +188,16 @@ boolean containsResourceArgUniqueId( * Unique IDs for each resource argument, used to track aliasing resources. If * Argument A and Argument B alias each other, then * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index]. + * * If this field is empty, none of the arguments could alias; otherwise, every * resource argument should have an entry in this field. + * * When instantiated, the unique IDs will be attached to the _Arg nodes' * "_resource_arg_unique_id" attribute. *
    * * map<uint32, uint32> resource_arg_unique_id = 8; */ - int getResourceArgUniqueIdOrDefault( int key, int defaultValue); @@ -195,15 +206,16 @@ int getResourceArgUniqueIdOrDefault( * Unique IDs for each resource argument, used to track aliasing resources. If * Argument A and Argument B alias each other, then * resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index]. + * * If this field is empty, none of the arguments could alias; otherwise, every * resource argument should have an entry in this field. + * * When instantiated, the unique IDs will be attached to the _Arg nodes' * "_resource_arg_unique_id" attribute. *
    * * map<uint32, uint32> resource_arg_unique_id = 8; */ - int getResourceArgUniqueIdOrThrow( int key); @@ -216,7 +228,7 @@ int getResourceArgUniqueIdOrThrow( * * repeated .tensorflow.NodeDef node_def = 3; */ - java.util.List + java.util.List getNodeDefList(); /** *
    @@ -227,7 +239,7 @@ int getResourceArgUniqueIdOrThrow(
        *
        * repeated .tensorflow.NodeDef node_def = 3;
        */
    -  org.tensorflow.proto.framework.NodeDef getNodeDef(int index);
    +  org.tensorflow.proto.NodeDef getNodeDef(int index);
       /**
        * 
        * By convention, "op" in node_def is resolved by consulting with a
    @@ -247,7 +259,7 @@ int getResourceArgUniqueIdOrThrow(
        *
        * repeated .tensorflow.NodeDef node_def = 3;
        */
    -  java.util.List 
    +  java.util.List 
           getNodeDefOrBuilderList();
       /**
        * 
    @@ -258,7 +270,7 @@ int getResourceArgUniqueIdOrThrow(
        *
        * repeated .tensorflow.NodeDef node_def = 3;
        */
    -  org.tensorflow.proto.framework.NodeDefOrBuilder getNodeDefOrBuilder(
    +  org.tensorflow.proto.NodeDefOrBuilder getNodeDefOrBuilder(
           int index);
     
       /**
    @@ -304,10 +316,11 @@ boolean containsRet(
        *
        * map<string, string> ret = 4;
        */
    -
    -  java.lang.String getRetOrDefault(
    +  /* nullable */
    +java.lang.String getRetOrDefault(
           java.lang.String key,
    -      java.lang.String defaultValue);
    +      /* nullable */
    +java.lang.String defaultValue);
       /**
        * 
        * A mapping from the output arg names from `signature` to the
    @@ -316,7 +329,6 @@ java.lang.String getRetOrDefault(
        *
        * map<string, string> ret = 4;
        */
    -
       java.lang.String getRetOrThrow(
           java.lang.String key);
     
    @@ -363,10 +375,11 @@ boolean containsControlRet(
        *
        * map<string, string> control_ret = 6;
        */
    -
    -  java.lang.String getControlRetOrDefault(
    +  /* nullable */
    +java.lang.String getControlRetOrDefault(
           java.lang.String key,
    -      java.lang.String defaultValue);
    +      /* nullable */
    +java.lang.String defaultValue);
       /**
        * 
        * A mapping from control output names from `signature` to node names in
    @@ -375,7 +388,6 @@ java.lang.String getControlRetOrDefault(
        *
        * map<string, string> control_ret = 6;
        */
    -
       java.lang.String getControlRetOrThrow(
           java.lang.String key);
     }
    diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionProtos.java
    similarity index 80%
    rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java
    rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionProtos.java
    index a29149a8179..202accf0318 100644
    --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/FunctionProtos.java
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/FunctionProtos.java
    @@ -1,10 +1,21 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
     // source: tensorflow/core/framework/function.proto
    +// Protobuf Java Version: 4.28.3
     
    -package org.tensorflow.proto.framework;
    +package org.tensorflow.proto;
     
     public final class FunctionProtos {
       private FunctionProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      FunctionProtos.class.getName());
    +  }
       public static void registerAllExtensions(
           com.google.protobuf.ExtensionRegistryLite registry) {
       }
    @@ -17,57 +28,57 @@ public static void registerAllExtensions(
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDefLibrary_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_AttrEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_AttrEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_ArgAttrEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_ArgAttrEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_RetEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_RetEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_FunctionDef_ControlRetEntry_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_FunctionDef_ControlRetEntry_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_GradientDef_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_GradientDef_fieldAccessorTable;
       static final com.google.protobuf.Descriptors.Descriptor
         internal_static_tensorflow_RegisteredGradient_descriptor;
       static final 
    -    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internal_static_tensorflow_RegisteredGradient_fieldAccessorTable;
     
       public static com.google.protobuf.Descriptors.FileDescriptor
    @@ -111,87 +122,88 @@ public static void registerAllExtensions(
           "ntDef\022\025\n\rfunction_name\030\001 \001(\t\022\025\n\rgradient" +
           "_func\030\002 \001(\t\"G\n\022RegisteredGradient\022\025\n\rgra" +
           "dient_func\030\001 \001(\t\022\032\n\022registered_op_type\030\002" +
    -      " \001(\tB\206\001\n\036org.tensorflow.proto.frameworkB" +
    -      "\016FunctionProtosP\001ZOgithub.com/tensorflow" +
    -      "/tensorflow/tensorflow/go/core/framework" +
    -      "/function_go_proto\370\001\001b\006proto3"
    +      " \001(\tB|\n\024org.tensorflow.protoB\016FunctionPr" +
    +      "otosP\001ZOgithub.com/tensorflow/tensorflow" +
    +      "/tensorflow/go/core/framework/function_g" +
    +      "o_proto\370\001\001b\006proto3"
         };
         descriptor = com.google.protobuf.Descriptors.FileDescriptor
           .internalBuildGeneratedFileFrom(descriptorData,
             new com.google.protobuf.Descriptors.FileDescriptor[] {
    -          org.tensorflow.proto.framework.AttrValueProtos.getDescriptor(),
    -          org.tensorflow.proto.framework.NodeProto.getDescriptor(),
    -          org.tensorflow.proto.framework.OpDefProtos.getDescriptor(),
    +          org.tensorflow.proto.AttrValueProtos.getDescriptor(),
    +          org.tensorflow.proto.NodeProto.getDescriptor(),
    +          org.tensorflow.proto.OpDefProtos.getDescriptor(),
             });
         internal_static_tensorflow_FunctionDefLibrary_descriptor =
           getDescriptor().getMessageTypes().get(0);
         internal_static_tensorflow_FunctionDefLibrary_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDefLibrary_descriptor,
             new java.lang.String[] { "Function", "Gradient", "RegisteredGradients", });
         internal_static_tensorflow_FunctionDef_descriptor =
           getDescriptor().getMessageTypes().get(1);
         internal_static_tensorflow_FunctionDef_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_descriptor,
             new java.lang.String[] { "Signature", "Attr", "ArgAttr", "ResourceArgUniqueId", "NodeDef", "Ret", "ControlRet", });
         internal_static_tensorflow_FunctionDef_AttrEntry_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(0);
         internal_static_tensorflow_FunctionDef_AttrEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_AttrEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(1);
         internal_static_tensorflow_FunctionDef_ArgAttrs_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor,
             new java.lang.String[] { "Attr", });
         internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_descriptor =
           internal_static_tensorflow_FunctionDef_ArgAttrs_descriptor.getNestedTypes().get(0);
         internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_ArgAttrs_AttrEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_FunctionDef_ArgAttrEntry_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(2);
         internal_static_tensorflow_FunctionDef_ArgAttrEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_ArgAttrEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(3);
         internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_ResourceArgUniqueIdEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_FunctionDef_RetEntry_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(4);
         internal_static_tensorflow_FunctionDef_RetEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_RetEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_FunctionDef_ControlRetEntry_descriptor =
           internal_static_tensorflow_FunctionDef_descriptor.getNestedTypes().get(5);
         internal_static_tensorflow_FunctionDef_ControlRetEntry_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_FunctionDef_ControlRetEntry_descriptor,
             new java.lang.String[] { "Key", "Value", });
         internal_static_tensorflow_GradientDef_descriptor =
           getDescriptor().getMessageTypes().get(2);
         internal_static_tensorflow_GradientDef_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_GradientDef_descriptor,
             new java.lang.String[] { "FunctionName", "GradientFunc", });
         internal_static_tensorflow_RegisteredGradient_descriptor =
           getDescriptor().getMessageTypes().get(3);
         internal_static_tensorflow_RegisteredGradient_fieldAccessorTable = new
    -      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
             internal_static_tensorflow_RegisteredGradient_descriptor,
             new java.lang.String[] { "GradientFunc", "RegisteredOpType", });
    -    org.tensorflow.proto.framework.AttrValueProtos.getDescriptor();
    -    org.tensorflow.proto.framework.NodeProto.getDescriptor();
    -    org.tensorflow.proto.framework.OpDefProtos.getDescriptor();
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.AttrValueProtos.getDescriptor();
    +    org.tensorflow.proto.NodeProto.getDescriptor();
    +    org.tensorflow.proto.OpDefProtos.getDescriptor();
       }
     
       // @@protoc_insertion_point(outer_class_scope)
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfo.java
    new file mode 100644
    index 00000000000..32cf218ca81
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfo.java
    @@ -0,0 +1,857 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/test_log.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.GPUInfo}
    + */
    +public final class GPUInfo extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.GPUInfo)
    +    GPUInfoOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      GPUInfo.class.getName());
    +  }
    +  // Use GPUInfo.newBuilder() to construct.
    +  private GPUInfo(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private GPUInfo() {
    +    model_ = "";
    +    uuid_ = "";
    +    busId_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_GPUInfo_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.GPUInfo.class, org.tensorflow.proto.GPUInfo.Builder.class);
    +  }
    +
    +  public static final int MODEL_FIELD_NUMBER = 1;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object model_ = "";
    +  /**
    +   * 
    +   * e.g. "Tesla K40c"
    +   * 
    + * + * string model = 1; + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
    +   * e.g. "Tesla K40c"
    +   * 
    + * + * string model = 1; + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UUID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object uuid_ = ""; + /** + *
    +   * Final entry in output of "nvidia-smi -L"
    +   * 
    + * + * string uuid = 2; + * @return The uuid. + */ + @java.lang.Override + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + 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(); + uuid_ = s; + return s; + } + } + /** + *
    +   * Final entry in output of "nvidia-smi -L"
    +   * 
    + * + * string uuid = 2; + * @return The bytes for uuid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUS_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object busId_ = ""; + /** + *
    +   * e.g. "0000:04:00.0"
    +   * 
    + * + * string bus_id = 3; + * @return The busId. + */ + @java.lang.Override + public java.lang.String getBusId() { + java.lang.Object ref = busId_; + 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(); + busId_ = s; + return s; + } + } + /** + *
    +   * e.g. "0000:04:00.0"
    +   * 
    + * + * string bus_id = 3; + * @return The bytes for busId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBusIdBytes() { + java.lang.Object ref = busId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + busId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, model_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uuid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uuid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(busId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, busId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, model_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uuid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uuid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(busId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, busId_); + } + size += getUnknownFields().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.GPUInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GPUInfo other = (org.tensorflow.proto.GPUInfo) obj; + + if (!getModel() + .equals(other.getModel())) return false; + if (!getUuid() + .equals(other.getUuid())) return false; + if (!getBusId() + .equals(other.getBusId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + UUID_FIELD_NUMBER; + hash = (53 * hash) + getUuid().hashCode(); + hash = (37 * hash) + BUS_ID_FIELD_NUMBER; + hash = (53 * hash) + getBusId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GPUInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUInfo 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.GPUInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUInfo 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.GPUInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GPUInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GPUInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GPUInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GPUInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GPUInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GPUInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GPUInfo) + org.tensorflow.proto.GPUInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_GPUInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUInfo.class, org.tensorflow.proto.GPUInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GPUInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + model_ = ""; + uuid_ = ""; + busId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_GPUInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GPUInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GPUInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GPUInfo build() { + org.tensorflow.proto.GPUInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GPUInfo buildPartial() { + org.tensorflow.proto.GPUInfo result = new org.tensorflow.proto.GPUInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GPUInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.model_ = model_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uuid_ = uuid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.busId_ = busId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GPUInfo) { + return mergeFrom((org.tensorflow.proto.GPUInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GPUInfo other) { + if (other == org.tensorflow.proto.GPUInfo.getDefaultInstance()) return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUuid().isEmpty()) { + uuid_ = other.uuid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getBusId().isEmpty()) { + busId_ = other.busId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + uuid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + busId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object model_ = ""; + /** + *
    +     * e.g. "Tesla K40c"
    +     * 
    + * + * string model = 1; + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. "Tesla K40c"
    +     * 
    + * + * string model = 1; + * @return The bytes for model. + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. "Tesla K40c"
    +     * 
    + * + * string model = 1; + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + model_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * e.g. "Tesla K40c"
    +     * 
    + * + * string model = 1; + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * e.g. "Tesla K40c"
    +     * 
    + * + * string model = 1; + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object uuid_ = ""; + /** + *
    +     * Final entry in output of "nvidia-smi -L"
    +     * 
    + * + * string uuid = 2; + * @return The uuid. + */ + public java.lang.String getUuid() { + java.lang.Object ref = uuid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uuid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Final entry in output of "nvidia-smi -L"
    +     * 
    + * + * string uuid = 2; + * @return The bytes for uuid. + */ + public com.google.protobuf.ByteString + getUuidBytes() { + java.lang.Object ref = uuid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uuid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Final entry in output of "nvidia-smi -L"
    +     * 
    + * + * string uuid = 2; + * @param value The uuid to set. + * @return This builder for chaining. + */ + public Builder setUuid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + uuid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Final entry in output of "nvidia-smi -L"
    +     * 
    + * + * string uuid = 2; + * @return This builder for chaining. + */ + public Builder clearUuid() { + uuid_ = getDefaultInstance().getUuid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Final entry in output of "nvidia-smi -L"
    +     * 
    + * + * string uuid = 2; + * @param value The bytes for uuid to set. + * @return This builder for chaining. + */ + public Builder setUuidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + uuid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object busId_ = ""; + /** + *
    +     * e.g. "0000:04:00.0"
    +     * 
    + * + * string bus_id = 3; + * @return The busId. + */ + public java.lang.String getBusId() { + java.lang.Object ref = busId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + busId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. "0000:04:00.0"
    +     * 
    + * + * string bus_id = 3; + * @return The bytes for busId. + */ + public com.google.protobuf.ByteString + getBusIdBytes() { + java.lang.Object ref = busId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + busId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. "0000:04:00.0"
    +     * 
    + * + * string bus_id = 3; + * @param value The busId to set. + * @return This builder for chaining. + */ + public Builder setBusId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + busId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * e.g. "0000:04:00.0"
    +     * 
    + * + * string bus_id = 3; + * @return This builder for chaining. + */ + public Builder clearBusId() { + busId_ = getDefaultInstance().getBusId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * e.g. "0000:04:00.0"
    +     * 
    + * + * string bus_id = 3; + * @param value The bytes for busId to set. + * @return This builder for chaining. + */ + public Builder setBusIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + busId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GPUInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GPUInfo) + private static final org.tensorflow.proto.GPUInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GPUInfo(); + } + + public static org.tensorflow.proto.GPUInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GPUInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GPUInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfoOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfoOrBuilder.java index 44985f7d574..0520a0f68fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/GPUInfoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUInfoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface GPUInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GPUInfo) @@ -13,6 +15,7 @@ public interface GPUInfoOrBuilder extends *
    * * string model = 1; + * @return The model. */ java.lang.String getModel(); /** @@ -21,6 +24,7 @@ public interface GPUInfoOrBuilder extends *
    * * string model = 1; + * @return The bytes for model. */ com.google.protobuf.ByteString getModelBytes(); @@ -31,6 +35,7 @@ public interface GPUInfoOrBuilder extends *
    * * string uuid = 2; + * @return The uuid. */ java.lang.String getUuid(); /** @@ -39,6 +44,7 @@ public interface GPUInfoOrBuilder extends *
    * * string uuid = 2; + * @return The bytes for uuid. */ com.google.protobuf.ByteString getUuidBytes(); @@ -49,6 +55,7 @@ public interface GPUInfoOrBuilder extends *
    * * string bus_id = 3; + * @return The busId. */ java.lang.String getBusId(); /** @@ -57,6 +64,7 @@ public interface GPUInfoOrBuilder extends *
    * * string bus_id = 3; + * @return The bytes for busId. */ com.google.protobuf.ByteString getBusIdBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptions.java new file mode 100644 index 00000000000..b63a758033d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptions.java @@ -0,0 +1,7822 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GPUOptions} + */ +public final class GPUOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions) + GPUOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GPUOptions.class.getName()); + } + // Use GPUOptions.newBuilder() to construct. + private GPUOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GPUOptions() { + allocatorType_ = ""; + visibleDeviceList_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.class, org.tensorflow.proto.GPUOptions.Builder.class); + } + + public interface ExperimentalOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions.Experimental) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + java.util.List + getVirtualDevicesList(); + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index); + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + int getVirtualDevicesCount(); + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + java.util.List + getVirtualDevicesOrBuilderList(); + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( + int index); + + /** + *
    +     * The number of virtual devices to create on each visible GPU. The
    +     * available memory will be split equally among all virtual devices. If the
    +     * field `memory_limit_mb` in `VirtualDevices` is not empty, this field will
    +     * be ignored.
    +     * 
    + * + * int32 num_virtual_devices_per_gpu = 15; + * @return The numVirtualDevicesPerGpu. + */ + int getNumVirtualDevicesPerGpu(); + + /** + *
    +     * If true, uses CUDA unified memory for memory allocations. If
    +     * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    +     * memory is used regardless of the value for this field. See comments for
    +     * per_process_gpu_memory_fraction field for more details and requirements
    +     * of the unified memory. This option is useful to oversubscribe memory if
    +     * multiple processes are sharing a single GPU while individually using less
    +     * than 1.0 per process memory fraction.
    +     * 
    + * + * bool use_unified_memory = 2; + * @return The useUnifiedMemory. + */ + boolean getUseUnifiedMemory(); + + /** + *
    +     * If > 1, the number of device-to-device copy streams to create
    +     * for each GPUDevice.  Default value is 0, which is automatically
    +     * converted to 1.
    +     * 
    + * + * int32 num_dev_to_dev_copy_streams = 3; + * @return The numDevToDevCopyStreams. + */ + int getNumDevToDevCopyStreams(); + + /** + *
    +     * If non-empty, defines a good GPU ring order on a single worker based on
    +     * device interconnect.  This assumes that all workers have the same GPU
    +     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +     * This ring order is used by the RingReducer implementation of
    +     * CollectiveReduce, and serves as an override to automatic ring order
    +     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +     * 
    + * + * string collective_ring_order = 4; + * @return The collectiveRingOrder. + */ + java.lang.String getCollectiveRingOrder(); + /** + *
    +     * If non-empty, defines a good GPU ring order on a single worker based on
    +     * device interconnect.  This assumes that all workers have the same GPU
    +     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +     * This ring order is used by the RingReducer implementation of
    +     * CollectiveReduce, and serves as an override to automatic ring order
    +     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +     * 
    + * + * string collective_ring_order = 4; + * @return The bytes for collectiveRingOrder. + */ + com.google.protobuf.ByteString + getCollectiveRingOrderBytes(); + + /** + *
    +     * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    +     * keep track of when GPU memory is freed and when kernels actually
    +     * complete so that we can know when a nominally free memory chunk
    +     * is really not subject to pending use.
    +     * 
    + * + * bool timestamped_allocator = 5; + * @return The timestampedAllocator. + */ + boolean getTimestampedAllocator(); + + /** + *
    +     * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    +     * Note that timestamped_allocator is only effective if some tracking is
    +     * specified.
    +     *
    +     * If kernel_tracker_max_interval = n > 0, then a tracking event
    +     * is inserted after every n kernels without an event.
    +     * 
    + * + * int32 kernel_tracker_max_interval = 7; + * @return The kernelTrackerMaxInterval. + */ + int getKernelTrackerMaxInterval(); + + /** + *
    +     * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    +     * inserted after every series of kernels allocating a sum of
    +     * memory >= n.  If one kernel allocates b * n bytes, then one
    +     * event will be inserted after it, but it will count as b against
    +     * the pending limit.
    +     * 
    + * + * int32 kernel_tracker_max_bytes = 8; + * @return The kernelTrackerMaxBytes. + */ + int getKernelTrackerMaxBytes(); + + /** + *
    +     * If kernel_tracker_max_pending > 0 then no more than this many
    +     * tracking events can be outstanding at a time.  An attempt to
    +     * launch an additional kernel will stall until an event
    +     * completes.
    +     * 
    + * + * int32 kernel_tracker_max_pending = 9; + * @return The kernelTrackerMaxPending. + */ + int getKernelTrackerMaxPending(); + + /** + *
    +     * BFC Allocator can return an allocated chunk of memory upto 2x the
    +     * requested size. For virtual devices with tight memory constraints, and
    +     * proportionately large allocation requests, this can lead to a significant
    +     * reduction in available memory. The threshold below controls when a chunk
    +     * should be split if the chunk size exceeds requested memory size. It is
    +     * expressed as a fraction of total available memory for the tf device. For
    +     * example setting it to 0.05 would imply a chunk needs to be split if its
    +     * size exceeds the requested memory by 5% of the total virtual device/gpu
    +     * memory size.
    +     * 
    + * + * double internal_fragmentation_fraction = 10; + * @return The internalFragmentationFraction. + */ + double getInternalFragmentationFraction(); + + /** + *
    +     * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    +     * 
    + * + * bool use_cuda_malloc_async = 11; + * @return The useCudaMallocAsync. + */ + boolean getUseCudaMallocAsync(); + + /** + *
    +     * By default, BFCAllocator may sleep when it runs out of memory, in the
    +     * hopes that another thread will free up memory in the meantime.  Setting
    +     * this to true disables the sleep; instead we'll OOM immediately.
    +     * 
    + * + * bool disallow_retry_on_allocation_failure = 12; + * @return The disallowRetryOnAllocationFailure. + */ + boolean getDisallowRetryOnAllocationFailure(); + + /** + *
    +     * Memory limit for "GPU host allocator", aka pinned memory allocator.  This
    +     * can also be set via the envvar TF_GPU_HOST_MEM_LIMIT_IN_MB.
    +     * 
    + * + * float gpu_host_mem_limit_in_mb = 13; + * @return The gpuHostMemLimitInMb. + */ + float getGpuHostMemLimitInMb(); + + /** + *
    +     * If true, then the host allocator allocates its max memory all upfront and
    +     * never grows.  This can be useful for latency-sensitive systems, because
    +     * growing the GPU host memory pool can be expensive.
    +     *
    +     * You probably only want to use this in combination with
    +     * gpu_host_mem_limit_in_mb, because the default GPU host memory limit is
    +     * quite high.
    +     * 
    + * + * bool gpu_host_mem_disallow_growth = 14; + * @return The gpuHostMemDisallowGrowth. + */ + boolean getGpuHostMemDisallowGrowth(); + + /** + *
    +     * Memory limit for gpu system. This can also be set by
    +     * TF_DEVICE_MIN_SYS_MEMORY_IN_MB, which takes precedence over
    +     * gpu_system_memory_size_in_mb. With this, user can configure the gpu
    +     * system memory size for better resource estimation of multi-tenancy(one
    +     * gpu with multiple model) use case.
    +     * 
    + * + * int32 gpu_system_memory_size_in_mb = 16; + * @return The gpuSystemMemorySizeInMb. + */ + int getGpuSystemMemorySizeInMb(); + + /** + *
    +     * If true, save information needed for created a PjRt GPU client for
    +     * creating a client with remote devices.
    +     * 
    + * + * bool populate_pjrt_gpu_client_creation_info = 17; + * @return The populatePjrtGpuClientCreationInfo. + */ + boolean getPopulatePjrtGpuClientCreationInfo(); + + /** + *
    +     * node_id for use when creating a PjRt GPU client with remote devices,
    +     * which enumerates jobs*tasks from a ServerDef.
    +     * 
    + * + * int32 node_id = 18; + * @return The nodeId. + */ + int getNodeId(); + + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return Whether the streamMergeOptions field is set. + */ + boolean hasStreamMergeOptions(); + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return The streamMergeOptions. + */ + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions getStreamMergeOptions(); + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder getStreamMergeOptionsOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.GPUOptions.Experimental} + */ + public static final class Experimental extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions.Experimental) + ExperimentalOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Experimental.class.getName()); + } + // Use Experimental.newBuilder() to construct. + private Experimental(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Experimental() { + virtualDevices_ = java.util.Collections.emptyList(); + collectiveRingOrder_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.class, org.tensorflow.proto.GPUOptions.Experimental.Builder.class); + } + + public interface VirtualDevicesOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions.Experimental.VirtualDevices) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @return A list containing the memoryLimitMb. + */ + java.util.List getMemoryLimitMbList(); + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @return The count of memoryLimitMb. + */ + int getMemoryLimitMbCount(); + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @param index The index of the element to return. + * @return The memoryLimitMb at the given index. + */ + float getMemoryLimitMb(int index); + + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @return A list containing the priority. + */ + java.util.List getPriorityList(); + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @return The count of priority. + */ + int getPriorityCount(); + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @param index The index of the element to return. + * @return The priority at the given index. + */ + int getPriority(int index); + + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @return A list containing the deviceOrdinal. + */ + java.util.List getDeviceOrdinalList(); + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @return The count of deviceOrdinal. + */ + int getDeviceOrdinalCount(); + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @param index The index of the element to return. + * @return The deviceOrdinal at the given index. + */ + int getDeviceOrdinal(int index); + } + /** + *
    +     * Configuration for breaking down a visible GPU into multiple "virtual"
    +     * devices.
    +     * 
    + * + * Protobuf type {@code tensorflow.GPUOptions.Experimental.VirtualDevices} + */ + public static final class VirtualDevices extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions.Experimental.VirtualDevices) + VirtualDevicesOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VirtualDevices.class.getName()); + } + // Use VirtualDevices.newBuilder() to construct. + private VirtualDevices(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private VirtualDevices() { + memoryLimitMb_ = emptyFloatList(); + priority_ = emptyIntList(); + deviceOrdinal_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.class, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder.class); + } + + public static final int MEMORY_LIMIT_MB_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList memoryLimitMb_ = + emptyFloatList(); + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @return A list containing the memoryLimitMb. + */ + @java.lang.Override + public java.util.List + getMemoryLimitMbList() { + return memoryLimitMb_; + } + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @return The count of memoryLimitMb. + */ + public int getMemoryLimitMbCount() { + return memoryLimitMb_.size(); + } + /** + *
    +       * Per "virtual" device memory limit, in MB. The number of elements in
    +       * the list is the number of virtual devices to create on the
    +       * corresponding visible GPU (see "virtual_devices" below).
    +       * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +       * single virtual device taking all available memory from the device.
    +       *
    +       * For the concept of "visible" and "virtual" GPU, see the comments for
    +       * "visible_device_list" above for more information.
    +       * 
    + * + * repeated float memory_limit_mb = 1; + * @param index The index of the element to return. + * @return The memoryLimitMb at the given index. + */ + public float getMemoryLimitMb(int index) { + return memoryLimitMb_.getFloat(index); + } + private int memoryLimitMbMemoizedSerializedSize = -1; + + public static final int PRIORITY_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList priority_ = + emptyIntList(); + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @return A list containing the priority. + */ + @java.lang.Override + public java.util.List + getPriorityList() { + return priority_; + } + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @return The count of priority. + */ + public int getPriorityCount() { + return priority_.size(); + } + /** + *
    +       * Priority values to use with the virtual devices. Use the cuda function
    +       * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +       * priority.
    +       *
    +       * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +       * least priority and -1 for greatest priority.
    +       *
    +       * If this field is not specified, then the virtual devices will be
    +       * created with the default. If this field has values set, then the size
    +       * of this must match with the above memory_limit_mb.
    +       * 
    + * + * repeated int32 priority = 2; + * @param index The index of the element to return. + * @return The priority at the given index. + */ + public int getPriority(int index) { + return priority_.getInt(index); + } + private int priorityMemoizedSerializedSize = -1; + + public static final int DEVICE_ORDINAL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList deviceOrdinal_ = + emptyIntList(); + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @return A list containing the deviceOrdinal. + */ + @java.lang.Override + public java.util.List + getDeviceOrdinalList() { + return deviceOrdinal_; + } + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @return The count of deviceOrdinal. + */ + public int getDeviceOrdinalCount() { + return deviceOrdinal_.size(); + } + /** + *
    +       * Virtual Device ordinal number determines the device ID of the device.
    +       * A Virtual device with a lower ordinal number always receives the a
    +       * smaller device id. The phyiscal device id and location in the
    +       * virtual device list is used to break ties.
    +       * 
    + * + * repeated int32 device_ordinal = 3; + * @param index The index of the element to return. + * @return The deviceOrdinal at the given index. + */ + public int getDeviceOrdinal(int index) { + return deviceOrdinal_.getInt(index); + } + private int deviceOrdinalMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getMemoryLimitMbList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(memoryLimitMbMemoizedSerializedSize); + } + for (int i = 0; i < memoryLimitMb_.size(); i++) { + output.writeFloatNoTag(memoryLimitMb_.getFloat(i)); + } + if (getPriorityList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(priorityMemoizedSerializedSize); + } + for (int i = 0; i < priority_.size(); i++) { + output.writeInt32NoTag(priority_.getInt(i)); + } + if (getDeviceOrdinalList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(deviceOrdinalMemoizedSerializedSize); + } + for (int i = 0; i < deviceOrdinal_.size(); i++) { + output.writeInt32NoTag(deviceOrdinal_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getMemoryLimitMbList().size(); + size += dataSize; + if (!getMemoryLimitMbList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + memoryLimitMbMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < priority_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(priority_.getInt(i)); + } + size += dataSize; + if (!getPriorityList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + priorityMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < deviceOrdinal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(deviceOrdinal_.getInt(i)); + } + size += dataSize; + if (!getDeviceOrdinalList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + deviceOrdinalMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.GPUOptions.Experimental.VirtualDevices)) { + return super.equals(obj); + } + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices other = (org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices) obj; + + if (!getMemoryLimitMbList() + .equals(other.getMemoryLimitMbList())) return false; + if (!getPriorityList() + .equals(other.getPriorityList())) return false; + if (!getDeviceOrdinalList() + .equals(other.getDeviceOrdinalList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMemoryLimitMbCount() > 0) { + hash = (37 * hash) + MEMORY_LIMIT_MB_FIELD_NUMBER; + hash = (53 * hash) + getMemoryLimitMbList().hashCode(); + } + if (getPriorityCount() > 0) { + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriorityList().hashCode(); + } + if (getDeviceOrdinalCount() > 0) { + hash = (37 * hash) + DEVICE_ORDINAL_FIELD_NUMBER; + hash = (53 * hash) + getDeviceOrdinalList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices 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.GPUOptions.Experimental.VirtualDevices parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GPUOptions.Experimental.VirtualDevices 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Configuration for breaking down a visible GPU into multiple "virtual"
    +       * devices.
    +       * 
    + * + * Protobuf type {@code tensorflow.GPUOptions.Experimental.VirtualDevices} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions.Experimental.VirtualDevices) + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.class, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder.class); + } + + // Construct using org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + memoryLimitMb_ = emptyFloatList(); + priority_ = emptyIntList(); + deviceOrdinal_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_VirtualDevices_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices getDefaultInstanceForType() { + return org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices build() { + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices buildPartial() { + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices result = new org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + memoryLimitMb_.makeImmutable(); + result.memoryLimitMb_ = memoryLimitMb_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + priority_.makeImmutable(); + result.priority_ = priority_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + deviceOrdinal_.makeImmutable(); + result.deviceOrdinal_ = deviceOrdinal_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices) { + return mergeFrom((org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices other) { + if (other == org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()) return this; + if (!other.memoryLimitMb_.isEmpty()) { + if (memoryLimitMb_.isEmpty()) { + memoryLimitMb_ = other.memoryLimitMb_; + memoryLimitMb_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureMemoryLimitMbIsMutable(); + memoryLimitMb_.addAll(other.memoryLimitMb_); + } + onChanged(); + } + if (!other.priority_.isEmpty()) { + if (priority_.isEmpty()) { + priority_ = other.priority_; + priority_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensurePriorityIsMutable(); + priority_.addAll(other.priority_); + } + onChanged(); + } + if (!other.deviceOrdinal_.isEmpty()) { + if (deviceOrdinal_.isEmpty()) { + deviceOrdinal_ = other.deviceOrdinal_; + deviceOrdinal_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureDeviceOrdinalIsMutable(); + deviceOrdinal_.addAll(other.deviceOrdinal_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + float v = input.readFloat(); + ensureMemoryLimitMbIsMutable(); + memoryLimitMb_.addFloat(v); + break; + } // case 13 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureMemoryLimitMbIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + memoryLimitMb_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 10 + case 16: { + int v = input.readInt32(); + ensurePriorityIsMutable(); + priority_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensurePriorityIsMutable(); + while (input.getBytesUntilLimit() > 0) { + priority_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 18 + case 24: { + int v = input.readInt32(); + ensureDeviceOrdinalIsMutable(); + deviceOrdinal_.addInt(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureDeviceOrdinalIsMutable(); + while (input.getBytesUntilLimit() > 0) { + deviceOrdinal_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.FloatList memoryLimitMb_ = emptyFloatList(); + private void ensureMemoryLimitMbIsMutable() { + if (!memoryLimitMb_.isModifiable()) { + memoryLimitMb_ = makeMutableCopy(memoryLimitMb_); + } + bitField0_ |= 0x00000001; + } + private void ensureMemoryLimitMbIsMutable(int capacity) { + if (!memoryLimitMb_.isModifiable()) { + memoryLimitMb_ = makeMutableCopy(memoryLimitMb_, capacity); + } + bitField0_ |= 0x00000001; + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @return A list containing the memoryLimitMb. + */ + public java.util.List + getMemoryLimitMbList() { + memoryLimitMb_.makeImmutable(); + return memoryLimitMb_; + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @return The count of memoryLimitMb. + */ + public int getMemoryLimitMbCount() { + return memoryLimitMb_.size(); + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @param index The index of the element to return. + * @return The memoryLimitMb at the given index. + */ + public float getMemoryLimitMb(int index) { + return memoryLimitMb_.getFloat(index); + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @param index The index to set the value at. + * @param value The memoryLimitMb to set. + * @return This builder for chaining. + */ + public Builder setMemoryLimitMb( + int index, float value) { + + ensureMemoryLimitMbIsMutable(); + memoryLimitMb_.setFloat(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @param value The memoryLimitMb to add. + * @return This builder for chaining. + */ + public Builder addMemoryLimitMb(float value) { + + ensureMemoryLimitMbIsMutable(); + memoryLimitMb_.addFloat(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @param values The memoryLimitMb to add. + * @return This builder for chaining. + */ + public Builder addAllMemoryLimitMb( + java.lang.Iterable values) { + ensureMemoryLimitMbIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, memoryLimitMb_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Per "virtual" device memory limit, in MB. The number of elements in
    +         * the list is the number of virtual devices to create on the
    +         * corresponding visible GPU (see "virtual_devices" below).
    +         * If empty and `num_virtual_devices_per_gpu` is not set, it will create
    +         * single virtual device taking all available memory from the device.
    +         *
    +         * For the concept of "visible" and "virtual" GPU, see the comments for
    +         * "visible_device_list" above for more information.
    +         * 
    + * + * repeated float memory_limit_mb = 1; + * @return This builder for chaining. + */ + public Builder clearMemoryLimitMb() { + memoryLimitMb_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList priority_ = emptyIntList(); + private void ensurePriorityIsMutable() { + if (!priority_.isModifiable()) { + priority_ = makeMutableCopy(priority_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @return A list containing the priority. + */ + public java.util.List + getPriorityList() { + priority_.makeImmutable(); + return priority_; + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @return The count of priority. + */ + public int getPriorityCount() { + return priority_.size(); + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @param index The index of the element to return. + * @return The priority at the given index. + */ + public int getPriority(int index) { + return priority_.getInt(index); + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @param index The index to set the value at. + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority( + int index, int value) { + + ensurePriorityIsMutable(); + priority_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @param value The priority to add. + * @return This builder for chaining. + */ + public Builder addPriority(int value) { + + ensurePriorityIsMutable(); + priority_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @param values The priority to add. + * @return This builder for chaining. + */ + public Builder addAllPriority( + java.lang.Iterable values) { + ensurePriorityIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, priority_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Priority values to use with the virtual devices. Use the cuda function
    +         * cudaDeviceGetStreamPriorityRange to query for valid range of values for
    +         * priority.
    +         *
    +         * On a P4000 GPU with cuda 10.1, the priority range reported was 0 for
    +         * least priority and -1 for greatest priority.
    +         *
    +         * If this field is not specified, then the virtual devices will be
    +         * created with the default. If this field has values set, then the size
    +         * of this must match with the above memory_limit_mb.
    +         * 
    + * + * repeated int32 priority = 2; + * @return This builder for chaining. + */ + public Builder clearPriority() { + priority_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList deviceOrdinal_ = emptyIntList(); + private void ensureDeviceOrdinalIsMutable() { + if (!deviceOrdinal_.isModifiable()) { + deviceOrdinal_ = makeMutableCopy(deviceOrdinal_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @return A list containing the deviceOrdinal. + */ + public java.util.List + getDeviceOrdinalList() { + deviceOrdinal_.makeImmutable(); + return deviceOrdinal_; + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @return The count of deviceOrdinal. + */ + public int getDeviceOrdinalCount() { + return deviceOrdinal_.size(); + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @param index The index of the element to return. + * @return The deviceOrdinal at the given index. + */ + public int getDeviceOrdinal(int index) { + return deviceOrdinal_.getInt(index); + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @param index The index to set the value at. + * @param value The deviceOrdinal to set. + * @return This builder for chaining. + */ + public Builder setDeviceOrdinal( + int index, int value) { + + ensureDeviceOrdinalIsMutable(); + deviceOrdinal_.setInt(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @param value The deviceOrdinal to add. + * @return This builder for chaining. + */ + public Builder addDeviceOrdinal(int value) { + + ensureDeviceOrdinalIsMutable(); + deviceOrdinal_.addInt(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @param values The deviceOrdinal to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceOrdinal( + java.lang.Iterable values) { + ensureDeviceOrdinalIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceOrdinal_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * Virtual Device ordinal number determines the device ID of the device.
    +         * A Virtual device with a lower ordinal number always receives the a
    +         * smaller device id. The phyiscal device id and location in the
    +         * virtual device list is used to break ties.
    +         * 
    + * + * repeated int32 device_ordinal = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceOrdinal() { + deviceOrdinal_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GPUOptions.Experimental.VirtualDevices) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions.Experimental.VirtualDevices) + private static final org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices(); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VirtualDevices parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GPUOptions.Experimental.VirtualDevices getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StreamMergeOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions.Experimental.StreamMergeOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * If true, the compute stream will be used for host_to_device copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream to finish. There is
    +       * also no need to wait for the copy to complete before executing the
    +       * callback function.
    +       * 
    + * + * bool merge_host_to_device_stream = 1; + * @return The mergeHostToDeviceStream. + */ + boolean getMergeHostToDeviceStream(); + + /** + *
    +       * If true, the compute stream will be used for device_to_host copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream to finish.
    +       * 
    + * + * bool merge_device_to_host_stream = 2; + * @return The mergeDeviceToHostStream. + */ + boolean getMergeDeviceToHostStream(); + + /** + *
    +       * If true, the compute stream will be used for device_to_device copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream of the sending device
    +       * to finish. There is also no need to wait for the compute stream of the
    +       * receiving device to finish if the copy is within the same device.
    +       * 
    + * + * bool merge_device_to_device_stream = 3; + * @return The mergeDeviceToDeviceStream. + */ + boolean getMergeDeviceToDeviceStream(); + } + /** + *
    +     * Whether to merge data transfer streams into the compute stream in the
    +     * same stream group. Stream merging helps reduce the overhead caused by
    +     * stream synchronization, especially when data transfers are frequent. For
    +     * example, setting "merge_host_to_device_stream = true" will make the
    +     * compute stream responsible for both computation and host to device memory
    +     * copy.
    +     * 
    + * + * Protobuf type {@code tensorflow.GPUOptions.Experimental.StreamMergeOptions} + */ + public static final class StreamMergeOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GPUOptions.Experimental.StreamMergeOptions) + StreamMergeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StreamMergeOptions.class.getName()); + } + // Use StreamMergeOptions.newBuilder() to construct. + private StreamMergeOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StreamMergeOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.class, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder.class); + } + + public static final int MERGE_HOST_TO_DEVICE_STREAM_FIELD_NUMBER = 1; + private boolean mergeHostToDeviceStream_ = false; + /** + *
    +       * If true, the compute stream will be used for host_to_device copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream to finish. There is
    +       * also no need to wait for the copy to complete before executing the
    +       * callback function.
    +       * 
    + * + * bool merge_host_to_device_stream = 1; + * @return The mergeHostToDeviceStream. + */ + @java.lang.Override + public boolean getMergeHostToDeviceStream() { + return mergeHostToDeviceStream_; + } + + public static final int MERGE_DEVICE_TO_HOST_STREAM_FIELD_NUMBER = 2; + private boolean mergeDeviceToHostStream_ = false; + /** + *
    +       * If true, the compute stream will be used for device_to_host copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream to finish.
    +       * 
    + * + * bool merge_device_to_host_stream = 2; + * @return The mergeDeviceToHostStream. + */ + @java.lang.Override + public boolean getMergeDeviceToHostStream() { + return mergeDeviceToHostStream_; + } + + public static final int MERGE_DEVICE_TO_DEVICE_STREAM_FIELD_NUMBER = 3; + private boolean mergeDeviceToDeviceStream_ = false; + /** + *
    +       * If true, the compute stream will be used for device_to_device copy as
    +       * well. It's no longer necessary to record an event before the copy to
    +       * let the copy stream wait for the compute stream of the sending device
    +       * to finish. There is also no need to wait for the compute stream of the
    +       * receiving device to finish if the copy is within the same device.
    +       * 
    + * + * bool merge_device_to_device_stream = 3; + * @return The mergeDeviceToDeviceStream. + */ + @java.lang.Override + public boolean getMergeDeviceToDeviceStream() { + return mergeDeviceToDeviceStream_; + } + + 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 (mergeHostToDeviceStream_ != false) { + output.writeBool(1, mergeHostToDeviceStream_); + } + if (mergeDeviceToHostStream_ != false) { + output.writeBool(2, mergeDeviceToHostStream_); + } + if (mergeDeviceToDeviceStream_ != false) { + output.writeBool(3, mergeDeviceToDeviceStream_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mergeHostToDeviceStream_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, mergeHostToDeviceStream_); + } + if (mergeDeviceToHostStream_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, mergeDeviceToHostStream_); + } + if (mergeDeviceToDeviceStream_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, mergeDeviceToDeviceStream_); + } + size += getUnknownFields().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.GPUOptions.Experimental.StreamMergeOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions other = (org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions) obj; + + if (getMergeHostToDeviceStream() + != other.getMergeHostToDeviceStream()) return false; + if (getMergeDeviceToHostStream() + != other.getMergeDeviceToHostStream()) return false; + if (getMergeDeviceToDeviceStream() + != other.getMergeDeviceToDeviceStream()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MERGE_HOST_TO_DEVICE_STREAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMergeHostToDeviceStream()); + hash = (37 * hash) + MERGE_DEVICE_TO_HOST_STREAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMergeDeviceToHostStream()); + hash = (37 * hash) + MERGE_DEVICE_TO_DEVICE_STREAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMergeDeviceToDeviceStream()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions 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.GPUOptions.Experimental.StreamMergeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions 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.GPUOptions.Experimental.StreamMergeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GPUOptions.Experimental.StreamMergeOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Whether to merge data transfer streams into the compute stream in the
    +       * same stream group. Stream merging helps reduce the overhead caused by
    +       * stream synchronization, especially when data transfers are frequent. For
    +       * example, setting "merge_host_to_device_stream = true" will make the
    +       * compute stream responsible for both computation and host to device memory
    +       * copy.
    +       * 
    + * + * Protobuf type {@code tensorflow.GPUOptions.Experimental.StreamMergeOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions.Experimental.StreamMergeOptions) + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.class, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mergeHostToDeviceStream_ = false; + mergeDeviceToHostStream_ = false; + mergeDeviceToDeviceStream_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_StreamMergeOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions getDefaultInstanceForType() { + return org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions build() { + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions buildPartial() { + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions result = new org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mergeHostToDeviceStream_ = mergeHostToDeviceStream_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mergeDeviceToHostStream_ = mergeDeviceToHostStream_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mergeDeviceToDeviceStream_ = mergeDeviceToDeviceStream_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions) { + return mergeFrom((org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions other) { + if (other == org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance()) return this; + if (other.getMergeHostToDeviceStream() != false) { + setMergeHostToDeviceStream(other.getMergeHostToDeviceStream()); + } + if (other.getMergeDeviceToHostStream() != false) { + setMergeDeviceToHostStream(other.getMergeDeviceToHostStream()); + } + if (other.getMergeDeviceToDeviceStream() != false) { + setMergeDeviceToDeviceStream(other.getMergeDeviceToDeviceStream()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + mergeHostToDeviceStream_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + mergeDeviceToHostStream_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + mergeDeviceToDeviceStream_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean mergeHostToDeviceStream_ ; + /** + *
    +         * If true, the compute stream will be used for host_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish. There is
    +         * also no need to wait for the copy to complete before executing the
    +         * callback function.
    +         * 
    + * + * bool merge_host_to_device_stream = 1; + * @return The mergeHostToDeviceStream. + */ + @java.lang.Override + public boolean getMergeHostToDeviceStream() { + return mergeHostToDeviceStream_; + } + /** + *
    +         * If true, the compute stream will be used for host_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish. There is
    +         * also no need to wait for the copy to complete before executing the
    +         * callback function.
    +         * 
    + * + * bool merge_host_to_device_stream = 1; + * @param value The mergeHostToDeviceStream to set. + * @return This builder for chaining. + */ + public Builder setMergeHostToDeviceStream(boolean value) { + + mergeHostToDeviceStream_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * If true, the compute stream will be used for host_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish. There is
    +         * also no need to wait for the copy to complete before executing the
    +         * callback function.
    +         * 
    + * + * bool merge_host_to_device_stream = 1; + * @return This builder for chaining. + */ + public Builder clearMergeHostToDeviceStream() { + bitField0_ = (bitField0_ & ~0x00000001); + mergeHostToDeviceStream_ = false; + onChanged(); + return this; + } + + private boolean mergeDeviceToHostStream_ ; + /** + *
    +         * If true, the compute stream will be used for device_to_host copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish.
    +         * 
    + * + * bool merge_device_to_host_stream = 2; + * @return The mergeDeviceToHostStream. + */ + @java.lang.Override + public boolean getMergeDeviceToHostStream() { + return mergeDeviceToHostStream_; + } + /** + *
    +         * If true, the compute stream will be used for device_to_host copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish.
    +         * 
    + * + * bool merge_device_to_host_stream = 2; + * @param value The mergeDeviceToHostStream to set. + * @return This builder for chaining. + */ + public Builder setMergeDeviceToHostStream(boolean value) { + + mergeDeviceToHostStream_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * If true, the compute stream will be used for device_to_host copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream to finish.
    +         * 
    + * + * bool merge_device_to_host_stream = 2; + * @return This builder for chaining. + */ + public Builder clearMergeDeviceToHostStream() { + bitField0_ = (bitField0_ & ~0x00000002); + mergeDeviceToHostStream_ = false; + onChanged(); + return this; + } + + private boolean mergeDeviceToDeviceStream_ ; + /** + *
    +         * If true, the compute stream will be used for device_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream of the sending device
    +         * to finish. There is also no need to wait for the compute stream of the
    +         * receiving device to finish if the copy is within the same device.
    +         * 
    + * + * bool merge_device_to_device_stream = 3; + * @return The mergeDeviceToDeviceStream. + */ + @java.lang.Override + public boolean getMergeDeviceToDeviceStream() { + return mergeDeviceToDeviceStream_; + } + /** + *
    +         * If true, the compute stream will be used for device_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream of the sending device
    +         * to finish. There is also no need to wait for the compute stream of the
    +         * receiving device to finish if the copy is within the same device.
    +         * 
    + * + * bool merge_device_to_device_stream = 3; + * @param value The mergeDeviceToDeviceStream to set. + * @return This builder for chaining. + */ + public Builder setMergeDeviceToDeviceStream(boolean value) { + + mergeDeviceToDeviceStream_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * If true, the compute stream will be used for device_to_device copy as
    +         * well. It's no longer necessary to record an event before the copy to
    +         * let the copy stream wait for the compute stream of the sending device
    +         * to finish. There is also no need to wait for the compute stream of the
    +         * receiving device to finish if the copy is within the same device.
    +         * 
    + * + * bool merge_device_to_device_stream = 3; + * @return This builder for chaining. + */ + public Builder clearMergeDeviceToDeviceStream() { + bitField0_ = (bitField0_ & ~0x00000004); + mergeDeviceToDeviceStream_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GPUOptions.Experimental.StreamMergeOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions.Experimental.StreamMergeOptions) + private static final org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions(); + } + + public static org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamMergeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GPUOptions.Experimental.StreamMergeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VIRTUAL_DEVICES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List virtualDevices_; + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + @java.lang.Override + public java.util.List getVirtualDevicesList() { + return virtualDevices_; + } + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + @java.lang.Override + public java.util.List + getVirtualDevicesOrBuilderList() { + return virtualDevices_; + } + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + @java.lang.Override + public int getVirtualDevicesCount() { + return virtualDevices_.size(); + } + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index) { + return virtualDevices_.get(index); + } + /** + *
    +     * The multi virtual device settings. If empty (not set), it will create
    +     * single virtual device on each visible GPU, according to the settings
    +     * in "visible_device_list" above. Otherwise, the number of elements in the
    +     * list must be the same as the number of visible GPUs (after
    +     * "visible_device_list" filtering if it is set), and the string represented
    +     * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +     * devices and have the <id> field assigned sequentially starting from 0,
    +     * according to the order of the virtual devices determined by
    +     * device_ordinal and the location in the virtual device list.
    +     *
    +     * For example,
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +     * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +     * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +     *
    +     * but
    +     * visible_device_list = "1,0"
    +     * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +     * device_ordinal: 10 device_ordinal: 20}
    +     * will create 4 virtual devices as:
    +     * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +     * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +     * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +     * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +     *
    +     * NOTE:
    +     * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +     * at the same time.
    +     * 2. Currently this setting is per-process, not per-session. Using
    +     * different settings in different sessions within same process will
    +     * result in undefined behavior.
    +     * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( + int index) { + return virtualDevices_.get(index); + } + + public static final int NUM_VIRTUAL_DEVICES_PER_GPU_FIELD_NUMBER = 15; + private int numVirtualDevicesPerGpu_ = 0; + /** + *
    +     * The number of virtual devices to create on each visible GPU. The
    +     * available memory will be split equally among all virtual devices. If the
    +     * field `memory_limit_mb` in `VirtualDevices` is not empty, this field will
    +     * be ignored.
    +     * 
    + * + * int32 num_virtual_devices_per_gpu = 15; + * @return The numVirtualDevicesPerGpu. + */ + @java.lang.Override + public int getNumVirtualDevicesPerGpu() { + return numVirtualDevicesPerGpu_; + } + + public static final int USE_UNIFIED_MEMORY_FIELD_NUMBER = 2; + private boolean useUnifiedMemory_ = false; + /** + *
    +     * If true, uses CUDA unified memory for memory allocations. If
    +     * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    +     * memory is used regardless of the value for this field. See comments for
    +     * per_process_gpu_memory_fraction field for more details and requirements
    +     * of the unified memory. This option is useful to oversubscribe memory if
    +     * multiple processes are sharing a single GPU while individually using less
    +     * than 1.0 per process memory fraction.
    +     * 
    + * + * bool use_unified_memory = 2; + * @return The useUnifiedMemory. + */ + @java.lang.Override + public boolean getUseUnifiedMemory() { + return useUnifiedMemory_; + } + + public static final int NUM_DEV_TO_DEV_COPY_STREAMS_FIELD_NUMBER = 3; + private int numDevToDevCopyStreams_ = 0; + /** + *
    +     * If > 1, the number of device-to-device copy streams to create
    +     * for each GPUDevice.  Default value is 0, which is automatically
    +     * converted to 1.
    +     * 
    + * + * int32 num_dev_to_dev_copy_streams = 3; + * @return The numDevToDevCopyStreams. + */ + @java.lang.Override + public int getNumDevToDevCopyStreams() { + return numDevToDevCopyStreams_; + } + + public static final int COLLECTIVE_RING_ORDER_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object collectiveRingOrder_ = ""; + /** + *
    +     * If non-empty, defines a good GPU ring order on a single worker based on
    +     * device interconnect.  This assumes that all workers have the same GPU
    +     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +     * This ring order is used by the RingReducer implementation of
    +     * CollectiveReduce, and serves as an override to automatic ring order
    +     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +     * 
    + * + * string collective_ring_order = 4; + * @return The collectiveRingOrder. + */ + @java.lang.Override + public java.lang.String getCollectiveRingOrder() { + java.lang.Object ref = collectiveRingOrder_; + 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(); + collectiveRingOrder_ = s; + return s; + } + } + /** + *
    +     * If non-empty, defines a good GPU ring order on a single worker based on
    +     * device interconnect.  This assumes that all workers have the same GPU
    +     * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +     * This ring order is used by the RingReducer implementation of
    +     * CollectiveReduce, and serves as an override to automatic ring order
    +     * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +     * 
    + * + * string collective_ring_order = 4; + * @return The bytes for collectiveRingOrder. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCollectiveRingOrderBytes() { + java.lang.Object ref = collectiveRingOrder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + collectiveRingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMPED_ALLOCATOR_FIELD_NUMBER = 5; + private boolean timestampedAllocator_ = false; + /** + *
    +     * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    +     * keep track of when GPU memory is freed and when kernels actually
    +     * complete so that we can know when a nominally free memory chunk
    +     * is really not subject to pending use.
    +     * 
    + * + * bool timestamped_allocator = 5; + * @return The timestampedAllocator. + */ + @java.lang.Override + public boolean getTimestampedAllocator() { + return timestampedAllocator_; + } + + public static final int KERNEL_TRACKER_MAX_INTERVAL_FIELD_NUMBER = 7; + private int kernelTrackerMaxInterval_ = 0; + /** + *
    +     * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    +     * Note that timestamped_allocator is only effective if some tracking is
    +     * specified.
    +     *
    +     * If kernel_tracker_max_interval = n > 0, then a tracking event
    +     * is inserted after every n kernels without an event.
    +     * 
    + * + * int32 kernel_tracker_max_interval = 7; + * @return The kernelTrackerMaxInterval. + */ + @java.lang.Override + public int getKernelTrackerMaxInterval() { + return kernelTrackerMaxInterval_; + } + + public static final int KERNEL_TRACKER_MAX_BYTES_FIELD_NUMBER = 8; + private int kernelTrackerMaxBytes_ = 0; + /** + *
    +     * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    +     * inserted after every series of kernels allocating a sum of
    +     * memory >= n.  If one kernel allocates b * n bytes, then one
    +     * event will be inserted after it, but it will count as b against
    +     * the pending limit.
    +     * 
    + * + * int32 kernel_tracker_max_bytes = 8; + * @return The kernelTrackerMaxBytes. + */ + @java.lang.Override + public int getKernelTrackerMaxBytes() { + return kernelTrackerMaxBytes_; + } + + public static final int KERNEL_TRACKER_MAX_PENDING_FIELD_NUMBER = 9; + private int kernelTrackerMaxPending_ = 0; + /** + *
    +     * If kernel_tracker_max_pending > 0 then no more than this many
    +     * tracking events can be outstanding at a time.  An attempt to
    +     * launch an additional kernel will stall until an event
    +     * completes.
    +     * 
    + * + * int32 kernel_tracker_max_pending = 9; + * @return The kernelTrackerMaxPending. + */ + @java.lang.Override + public int getKernelTrackerMaxPending() { + return kernelTrackerMaxPending_; + } + + public static final int INTERNAL_FRAGMENTATION_FRACTION_FIELD_NUMBER = 10; + private double internalFragmentationFraction_ = 0D; + /** + *
    +     * BFC Allocator can return an allocated chunk of memory upto 2x the
    +     * requested size. For virtual devices with tight memory constraints, and
    +     * proportionately large allocation requests, this can lead to a significant
    +     * reduction in available memory. The threshold below controls when a chunk
    +     * should be split if the chunk size exceeds requested memory size. It is
    +     * expressed as a fraction of total available memory for the tf device. For
    +     * example setting it to 0.05 would imply a chunk needs to be split if its
    +     * size exceeds the requested memory by 5% of the total virtual device/gpu
    +     * memory size.
    +     * 
    + * + * double internal_fragmentation_fraction = 10; + * @return The internalFragmentationFraction. + */ + @java.lang.Override + public double getInternalFragmentationFraction() { + return internalFragmentationFraction_; + } + + public static final int USE_CUDA_MALLOC_ASYNC_FIELD_NUMBER = 11; + private boolean useCudaMallocAsync_ = false; + /** + *
    +     * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    +     * 
    + * + * bool use_cuda_malloc_async = 11; + * @return The useCudaMallocAsync. + */ + @java.lang.Override + public boolean getUseCudaMallocAsync() { + return useCudaMallocAsync_; + } + + public static final int DISALLOW_RETRY_ON_ALLOCATION_FAILURE_FIELD_NUMBER = 12; + private boolean disallowRetryOnAllocationFailure_ = false; + /** + *
    +     * By default, BFCAllocator may sleep when it runs out of memory, in the
    +     * hopes that another thread will free up memory in the meantime.  Setting
    +     * this to true disables the sleep; instead we'll OOM immediately.
    +     * 
    + * + * bool disallow_retry_on_allocation_failure = 12; + * @return The disallowRetryOnAllocationFailure. + */ + @java.lang.Override + public boolean getDisallowRetryOnAllocationFailure() { + return disallowRetryOnAllocationFailure_; + } + + public static final int GPU_HOST_MEM_LIMIT_IN_MB_FIELD_NUMBER = 13; + private float gpuHostMemLimitInMb_ = 0F; + /** + *
    +     * Memory limit for "GPU host allocator", aka pinned memory allocator.  This
    +     * can also be set via the envvar TF_GPU_HOST_MEM_LIMIT_IN_MB.
    +     * 
    + * + * float gpu_host_mem_limit_in_mb = 13; + * @return The gpuHostMemLimitInMb. + */ + @java.lang.Override + public float getGpuHostMemLimitInMb() { + return gpuHostMemLimitInMb_; + } + + public static final int GPU_HOST_MEM_DISALLOW_GROWTH_FIELD_NUMBER = 14; + private boolean gpuHostMemDisallowGrowth_ = false; + /** + *
    +     * If true, then the host allocator allocates its max memory all upfront and
    +     * never grows.  This can be useful for latency-sensitive systems, because
    +     * growing the GPU host memory pool can be expensive.
    +     *
    +     * You probably only want to use this in combination with
    +     * gpu_host_mem_limit_in_mb, because the default GPU host memory limit is
    +     * quite high.
    +     * 
    + * + * bool gpu_host_mem_disallow_growth = 14; + * @return The gpuHostMemDisallowGrowth. + */ + @java.lang.Override + public boolean getGpuHostMemDisallowGrowth() { + return gpuHostMemDisallowGrowth_; + } + + public static final int GPU_SYSTEM_MEMORY_SIZE_IN_MB_FIELD_NUMBER = 16; + private int gpuSystemMemorySizeInMb_ = 0; + /** + *
    +     * Memory limit for gpu system. This can also be set by
    +     * TF_DEVICE_MIN_SYS_MEMORY_IN_MB, which takes precedence over
    +     * gpu_system_memory_size_in_mb. With this, user can configure the gpu
    +     * system memory size for better resource estimation of multi-tenancy(one
    +     * gpu with multiple model) use case.
    +     * 
    + * + * int32 gpu_system_memory_size_in_mb = 16; + * @return The gpuSystemMemorySizeInMb. + */ + @java.lang.Override + public int getGpuSystemMemorySizeInMb() { + return gpuSystemMemorySizeInMb_; + } + + public static final int POPULATE_PJRT_GPU_CLIENT_CREATION_INFO_FIELD_NUMBER = 17; + private boolean populatePjrtGpuClientCreationInfo_ = false; + /** + *
    +     * If true, save information needed for created a PjRt GPU client for
    +     * creating a client with remote devices.
    +     * 
    + * + * bool populate_pjrt_gpu_client_creation_info = 17; + * @return The populatePjrtGpuClientCreationInfo. + */ + @java.lang.Override + public boolean getPopulatePjrtGpuClientCreationInfo() { + return populatePjrtGpuClientCreationInfo_; + } + + public static final int NODE_ID_FIELD_NUMBER = 18; + private int nodeId_ = 0; + /** + *
    +     * node_id for use when creating a PjRt GPU client with remote devices,
    +     * which enumerates jobs*tasks from a ServerDef.
    +     * 
    + * + * int32 node_id = 18; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int STREAM_MERGE_OPTIONS_FIELD_NUMBER = 19; + private org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions streamMergeOptions_; + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return Whether the streamMergeOptions field is set. + */ + @java.lang.Override + public boolean hasStreamMergeOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return The streamMergeOptions. + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions getStreamMergeOptions() { + return streamMergeOptions_ == null ? org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance() : streamMergeOptions_; + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder getStreamMergeOptionsOrBuilder() { + return streamMergeOptions_ == null ? org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance() : streamMergeOptions_; + } + + 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 { + for (int i = 0; i < virtualDevices_.size(); i++) { + output.writeMessage(1, virtualDevices_.get(i)); + } + if (useUnifiedMemory_ != false) { + output.writeBool(2, useUnifiedMemory_); + } + if (numDevToDevCopyStreams_ != 0) { + output.writeInt32(3, numDevToDevCopyStreams_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collectiveRingOrder_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, collectiveRingOrder_); + } + if (timestampedAllocator_ != false) { + output.writeBool(5, timestampedAllocator_); + } + if (kernelTrackerMaxInterval_ != 0) { + output.writeInt32(7, kernelTrackerMaxInterval_); + } + if (kernelTrackerMaxBytes_ != 0) { + output.writeInt32(8, kernelTrackerMaxBytes_); + } + if (kernelTrackerMaxPending_ != 0) { + output.writeInt32(9, kernelTrackerMaxPending_); + } + if (java.lang.Double.doubleToRawLongBits(internalFragmentationFraction_) != 0) { + output.writeDouble(10, internalFragmentationFraction_); + } + if (useCudaMallocAsync_ != false) { + output.writeBool(11, useCudaMallocAsync_); + } + if (disallowRetryOnAllocationFailure_ != false) { + output.writeBool(12, disallowRetryOnAllocationFailure_); + } + if (java.lang.Float.floatToRawIntBits(gpuHostMemLimitInMb_) != 0) { + output.writeFloat(13, gpuHostMemLimitInMb_); + } + if (gpuHostMemDisallowGrowth_ != false) { + output.writeBool(14, gpuHostMemDisallowGrowth_); + } + if (numVirtualDevicesPerGpu_ != 0) { + output.writeInt32(15, numVirtualDevicesPerGpu_); + } + if (gpuSystemMemorySizeInMb_ != 0) { + output.writeInt32(16, gpuSystemMemorySizeInMb_); + } + if (populatePjrtGpuClientCreationInfo_ != false) { + output.writeBool(17, populatePjrtGpuClientCreationInfo_); + } + if (nodeId_ != 0) { + output.writeInt32(18, nodeId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(19, getStreamMergeOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < virtualDevices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, virtualDevices_.get(i)); + } + if (useUnifiedMemory_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, useUnifiedMemory_); + } + if (numDevToDevCopyStreams_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, numDevToDevCopyStreams_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(collectiveRingOrder_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, collectiveRingOrder_); + } + if (timestampedAllocator_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, timestampedAllocator_); + } + if (kernelTrackerMaxInterval_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, kernelTrackerMaxInterval_); + } + if (kernelTrackerMaxBytes_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, kernelTrackerMaxBytes_); + } + if (kernelTrackerMaxPending_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, kernelTrackerMaxPending_); + } + if (java.lang.Double.doubleToRawLongBits(internalFragmentationFraction_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(10, internalFragmentationFraction_); + } + if (useCudaMallocAsync_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, useCudaMallocAsync_); + } + if (disallowRetryOnAllocationFailure_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, disallowRetryOnAllocationFailure_); + } + if (java.lang.Float.floatToRawIntBits(gpuHostMemLimitInMb_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(13, gpuHostMemLimitInMb_); + } + if (gpuHostMemDisallowGrowth_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, gpuHostMemDisallowGrowth_); + } + if (numVirtualDevicesPerGpu_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, numVirtualDevicesPerGpu_); + } + if (gpuSystemMemorySizeInMb_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(16, gpuSystemMemorySizeInMb_); + } + if (populatePjrtGpuClientCreationInfo_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, populatePjrtGpuClientCreationInfo_); + } + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, nodeId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getStreamMergeOptions()); + } + size += getUnknownFields().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.GPUOptions.Experimental)) { + return super.equals(obj); + } + org.tensorflow.proto.GPUOptions.Experimental other = (org.tensorflow.proto.GPUOptions.Experimental) obj; + + if (!getVirtualDevicesList() + .equals(other.getVirtualDevicesList())) return false; + if (getNumVirtualDevicesPerGpu() + != other.getNumVirtualDevicesPerGpu()) return false; + if (getUseUnifiedMemory() + != other.getUseUnifiedMemory()) return false; + if (getNumDevToDevCopyStreams() + != other.getNumDevToDevCopyStreams()) return false; + if (!getCollectiveRingOrder() + .equals(other.getCollectiveRingOrder())) return false; + if (getTimestampedAllocator() + != other.getTimestampedAllocator()) return false; + if (getKernelTrackerMaxInterval() + != other.getKernelTrackerMaxInterval()) return false; + if (getKernelTrackerMaxBytes() + != other.getKernelTrackerMaxBytes()) return false; + if (getKernelTrackerMaxPending() + != other.getKernelTrackerMaxPending()) return false; + if (java.lang.Double.doubleToLongBits(getInternalFragmentationFraction()) + != java.lang.Double.doubleToLongBits( + other.getInternalFragmentationFraction())) return false; + if (getUseCudaMallocAsync() + != other.getUseCudaMallocAsync()) return false; + if (getDisallowRetryOnAllocationFailure() + != other.getDisallowRetryOnAllocationFailure()) return false; + if (java.lang.Float.floatToIntBits(getGpuHostMemLimitInMb()) + != java.lang.Float.floatToIntBits( + other.getGpuHostMemLimitInMb())) return false; + if (getGpuHostMemDisallowGrowth() + != other.getGpuHostMemDisallowGrowth()) return false; + if (getGpuSystemMemorySizeInMb() + != other.getGpuSystemMemorySizeInMb()) return false; + if (getPopulatePjrtGpuClientCreationInfo() + != other.getPopulatePjrtGpuClientCreationInfo()) return false; + if (getNodeId() + != other.getNodeId()) return false; + if (hasStreamMergeOptions() != other.hasStreamMergeOptions()) return false; + if (hasStreamMergeOptions()) { + if (!getStreamMergeOptions() + .equals(other.getStreamMergeOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVirtualDevicesCount() > 0) { + hash = (37 * hash) + VIRTUAL_DEVICES_FIELD_NUMBER; + hash = (53 * hash) + getVirtualDevicesList().hashCode(); + } + hash = (37 * hash) + NUM_VIRTUAL_DEVICES_PER_GPU_FIELD_NUMBER; + hash = (53 * hash) + getNumVirtualDevicesPerGpu(); + hash = (37 * hash) + USE_UNIFIED_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseUnifiedMemory()); + hash = (37 * hash) + NUM_DEV_TO_DEV_COPY_STREAMS_FIELD_NUMBER; + hash = (53 * hash) + getNumDevToDevCopyStreams(); + hash = (37 * hash) + COLLECTIVE_RING_ORDER_FIELD_NUMBER; + hash = (53 * hash) + getCollectiveRingOrder().hashCode(); + hash = (37 * hash) + TIMESTAMPED_ALLOCATOR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTimestampedAllocator()); + hash = (37 * hash) + KERNEL_TRACKER_MAX_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getKernelTrackerMaxInterval(); + hash = (37 * hash) + KERNEL_TRACKER_MAX_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getKernelTrackerMaxBytes(); + hash = (37 * hash) + KERNEL_TRACKER_MAX_PENDING_FIELD_NUMBER; + hash = (53 * hash) + getKernelTrackerMaxPending(); + hash = (37 * hash) + INTERNAL_FRAGMENTATION_FRACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getInternalFragmentationFraction())); + hash = (37 * hash) + USE_CUDA_MALLOC_ASYNC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseCudaMallocAsync()); + hash = (37 * hash) + DISALLOW_RETRY_ON_ALLOCATION_FAILURE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisallowRetryOnAllocationFailure()); + hash = (37 * hash) + GPU_HOST_MEM_LIMIT_IN_MB_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getGpuHostMemLimitInMb()); + hash = (37 * hash) + GPU_HOST_MEM_DISALLOW_GROWTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getGpuHostMemDisallowGrowth()); + hash = (37 * hash) + GPU_SYSTEM_MEMORY_SIZE_IN_MB_FIELD_NUMBER; + hash = (53 * hash) + getGpuSystemMemorySizeInMb(); + hash = (37 * hash) + POPULATE_PJRT_GPU_CLIENT_CREATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPopulatePjrtGpuClientCreationInfo()); + hash = (37 * hash) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + if (hasStreamMergeOptions()) { + hash = (37 * hash) + STREAM_MERGE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getStreamMergeOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental 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.GPUOptions.Experimental parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental 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.GPUOptions.Experimental parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GPUOptions.Experimental parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GPUOptions.Experimental parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions.Experimental parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GPUOptions.Experimental 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GPUOptions.Experimental} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions.Experimental) + org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.Experimental.class, org.tensorflow.proto.GPUOptions.Experimental.Builder.class); + } + + // Construct using org.tensorflow.proto.GPUOptions.Experimental.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getVirtualDevicesFieldBuilder(); + getStreamMergeOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (virtualDevicesBuilder_ == null) { + virtualDevices_ = java.util.Collections.emptyList(); + } else { + virtualDevices_ = null; + virtualDevicesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + numVirtualDevicesPerGpu_ = 0; + useUnifiedMemory_ = false; + numDevToDevCopyStreams_ = 0; + collectiveRingOrder_ = ""; + timestampedAllocator_ = false; + kernelTrackerMaxInterval_ = 0; + kernelTrackerMaxBytes_ = 0; + kernelTrackerMaxPending_ = 0; + internalFragmentationFraction_ = 0D; + useCudaMallocAsync_ = false; + disallowRetryOnAllocationFailure_ = false; + gpuHostMemLimitInMb_ = 0F; + gpuHostMemDisallowGrowth_ = false; + gpuSystemMemorySizeInMb_ = 0; + populatePjrtGpuClientCreationInfo_ = false; + nodeId_ = 0; + streamMergeOptions_ = null; + if (streamMergeOptionsBuilder_ != null) { + streamMergeOptionsBuilder_.dispose(); + streamMergeOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_Experimental_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental getDefaultInstanceForType() { + return org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental build() { + org.tensorflow.proto.GPUOptions.Experimental result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental buildPartial() { + org.tensorflow.proto.GPUOptions.Experimental result = new org.tensorflow.proto.GPUOptions.Experimental(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.GPUOptions.Experimental result) { + if (virtualDevicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + virtualDevices_ = java.util.Collections.unmodifiableList(virtualDevices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.virtualDevices_ = virtualDevices_; + } else { + result.virtualDevices_ = virtualDevicesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.GPUOptions.Experimental result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numVirtualDevicesPerGpu_ = numVirtualDevicesPerGpu_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.useUnifiedMemory_ = useUnifiedMemory_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.numDevToDevCopyStreams_ = numDevToDevCopyStreams_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.collectiveRingOrder_ = collectiveRingOrder_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.timestampedAllocator_ = timestampedAllocator_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.kernelTrackerMaxInterval_ = kernelTrackerMaxInterval_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.kernelTrackerMaxBytes_ = kernelTrackerMaxBytes_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.kernelTrackerMaxPending_ = kernelTrackerMaxPending_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.internalFragmentationFraction_ = internalFragmentationFraction_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.useCudaMallocAsync_ = useCudaMallocAsync_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.disallowRetryOnAllocationFailure_ = disallowRetryOnAllocationFailure_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.gpuHostMemLimitInMb_ = gpuHostMemLimitInMb_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.gpuHostMemDisallowGrowth_ = gpuHostMemDisallowGrowth_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.gpuSystemMemorySizeInMb_ = gpuSystemMemorySizeInMb_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.populatePjrtGpuClientCreationInfo_ = populatePjrtGpuClientCreationInfo_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.nodeId_ = nodeId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00020000) != 0)) { + result.streamMergeOptions_ = streamMergeOptionsBuilder_ == null + ? streamMergeOptions_ + : streamMergeOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GPUOptions.Experimental) { + return mergeFrom((org.tensorflow.proto.GPUOptions.Experimental)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GPUOptions.Experimental other) { + if (other == org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance()) return this; + if (virtualDevicesBuilder_ == null) { + if (!other.virtualDevices_.isEmpty()) { + if (virtualDevices_.isEmpty()) { + virtualDevices_ = other.virtualDevices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVirtualDevicesIsMutable(); + virtualDevices_.addAll(other.virtualDevices_); + } + onChanged(); + } + } else { + if (!other.virtualDevices_.isEmpty()) { + if (virtualDevicesBuilder_.isEmpty()) { + virtualDevicesBuilder_.dispose(); + virtualDevicesBuilder_ = null; + virtualDevices_ = other.virtualDevices_; + bitField0_ = (bitField0_ & ~0x00000001); + virtualDevicesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getVirtualDevicesFieldBuilder() : null; + } else { + virtualDevicesBuilder_.addAllMessages(other.virtualDevices_); + } + } + } + if (other.getNumVirtualDevicesPerGpu() != 0) { + setNumVirtualDevicesPerGpu(other.getNumVirtualDevicesPerGpu()); + } + if (other.getUseUnifiedMemory() != false) { + setUseUnifiedMemory(other.getUseUnifiedMemory()); + } + if (other.getNumDevToDevCopyStreams() != 0) { + setNumDevToDevCopyStreams(other.getNumDevToDevCopyStreams()); + } + if (!other.getCollectiveRingOrder().isEmpty()) { + collectiveRingOrder_ = other.collectiveRingOrder_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getTimestampedAllocator() != false) { + setTimestampedAllocator(other.getTimestampedAllocator()); + } + if (other.getKernelTrackerMaxInterval() != 0) { + setKernelTrackerMaxInterval(other.getKernelTrackerMaxInterval()); + } + if (other.getKernelTrackerMaxBytes() != 0) { + setKernelTrackerMaxBytes(other.getKernelTrackerMaxBytes()); + } + if (other.getKernelTrackerMaxPending() != 0) { + setKernelTrackerMaxPending(other.getKernelTrackerMaxPending()); + } + if (other.getInternalFragmentationFraction() != 0D) { + setInternalFragmentationFraction(other.getInternalFragmentationFraction()); + } + if (other.getUseCudaMallocAsync() != false) { + setUseCudaMallocAsync(other.getUseCudaMallocAsync()); + } + if (other.getDisallowRetryOnAllocationFailure() != false) { + setDisallowRetryOnAllocationFailure(other.getDisallowRetryOnAllocationFailure()); + } + if (other.getGpuHostMemLimitInMb() != 0F) { + setGpuHostMemLimitInMb(other.getGpuHostMemLimitInMb()); + } + if (other.getGpuHostMemDisallowGrowth() != false) { + setGpuHostMemDisallowGrowth(other.getGpuHostMemDisallowGrowth()); + } + if (other.getGpuSystemMemorySizeInMb() != 0) { + setGpuSystemMemorySizeInMb(other.getGpuSystemMemorySizeInMb()); + } + if (other.getPopulatePjrtGpuClientCreationInfo() != false) { + setPopulatePjrtGpuClientCreationInfo(other.getPopulatePjrtGpuClientCreationInfo()); + } + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (other.hasStreamMergeOptions()) { + mergeStreamMergeOptions(other.getStreamMergeOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices m = + input.readMessage( + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.parser(), + extensionRegistry); + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + virtualDevices_.add(m); + } else { + virtualDevicesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: { + useUnifiedMemory_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 16 + case 24: { + numDevToDevCopyStreams_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: { + collectiveRingOrder_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 40: { + timestampedAllocator_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 56: { + kernelTrackerMaxInterval_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + kernelTrackerMaxBytes_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + kernelTrackerMaxPending_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 81: { + internalFragmentationFraction_ = input.readDouble(); + bitField0_ |= 0x00000200; + break; + } // case 81 + case 88: { + useCudaMallocAsync_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + disallowRetryOnAllocationFailure_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 109: { + gpuHostMemLimitInMb_ = input.readFloat(); + bitField0_ |= 0x00001000; + break; + } // case 109 + case 112: { + gpuHostMemDisallowGrowth_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + numVirtualDevicesPerGpu_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 120 + case 128: { + gpuSystemMemorySizeInMb_ = input.readInt32(); + bitField0_ |= 0x00004000; + break; + } // case 128 + case 136: { + populatePjrtGpuClientCreationInfo_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 136 + case 144: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00010000; + break; + } // case 144 + case 154: { + input.readMessage( + getStreamMergeOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 154 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List virtualDevices_ = + java.util.Collections.emptyList(); + private void ensureVirtualDevicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + virtualDevices_ = new java.util.ArrayList(virtualDevices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder> virtualDevicesBuilder_; + + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public java.util.List getVirtualDevicesList() { + if (virtualDevicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(virtualDevices_); + } else { + return virtualDevicesBuilder_.getMessageList(); + } + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public int getVirtualDevicesCount() { + if (virtualDevicesBuilder_ == null) { + return virtualDevices_.size(); + } else { + return virtualDevicesBuilder_.getCount(); + } + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices getVirtualDevices(int index) { + if (virtualDevicesBuilder_ == null) { + return virtualDevices_.get(index); + } else { + return virtualDevicesBuilder_.getMessage(index); + } + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder setVirtualDevices( + int index, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices value) { + if (virtualDevicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVirtualDevicesIsMutable(); + virtualDevices_.set(index, value); + onChanged(); + } else { + virtualDevicesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder setVirtualDevices( + int index, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + virtualDevices_.set(index, builderForValue.build()); + onChanged(); + } else { + virtualDevicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder addVirtualDevices(org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices value) { + if (virtualDevicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVirtualDevicesIsMutable(); + virtualDevices_.add(value); + onChanged(); + } else { + virtualDevicesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder addVirtualDevices( + int index, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices value) { + if (virtualDevicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVirtualDevicesIsMutable(); + virtualDevices_.add(index, value); + onChanged(); + } else { + virtualDevicesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder addVirtualDevices( + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + virtualDevices_.add(builderForValue.build()); + onChanged(); + } else { + virtualDevicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder addVirtualDevices( + int index, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder builderForValue) { + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + virtualDevices_.add(index, builderForValue.build()); + onChanged(); + } else { + virtualDevicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder addAllVirtualDevices( + java.lang.Iterable values) { + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, virtualDevices_); + onChanged(); + } else { + virtualDevicesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder clearVirtualDevices() { + if (virtualDevicesBuilder_ == null) { + virtualDevices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + virtualDevicesBuilder_.clear(); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public Builder removeVirtualDevices(int index) { + if (virtualDevicesBuilder_ == null) { + ensureVirtualDevicesIsMutable(); + virtualDevices_.remove(index); + onChanged(); + } else { + virtualDevicesBuilder_.remove(index); + } + return this; + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder getVirtualDevicesBuilder( + int index) { + return getVirtualDevicesFieldBuilder().getBuilder(index); + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder getVirtualDevicesOrBuilder( + int index) { + if (virtualDevicesBuilder_ == null) { + return virtualDevices_.get(index); } else { + return virtualDevicesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public java.util.List + getVirtualDevicesOrBuilderList() { + if (virtualDevicesBuilder_ != null) { + return virtualDevicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(virtualDevices_); + } + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder addVirtualDevicesBuilder() { + return getVirtualDevicesFieldBuilder().addBuilder( + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()); + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder addVirtualDevicesBuilder( + int index) { + return getVirtualDevicesFieldBuilder().addBuilder( + index, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.getDefaultInstance()); + } + /** + *
    +       * The multi virtual device settings. If empty (not set), it will create
    +       * single virtual device on each visible GPU, according to the settings
    +       * in "visible_device_list" above. Otherwise, the number of elements in the
    +       * list must be the same as the number of visible GPUs (after
    +       * "visible_device_list" filtering if it is set), and the string represented
    +       * device names (e.g. /device:GPU:<id>) will refer to the virtual
    +       * devices and have the <id> field assigned sequentially starting from 0,
    +       * according to the order of the virtual devices determined by
    +       * device_ordinal and the location in the virtual device list.
    +       *
    +       * For example,
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB }
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB }
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory
    +       * /device:GPU:1 -> visible GPU 1 with 2GB memory
    +       * /device:GPU:2 -> visible GPU 0 with 3GB memory
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory
    +       *
    +       * but
    +       * visible_device_list = "1,0"
    +       * virtual_devices { memory_limit: 1GB memory_limit: 2GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * virtual_devices { memory_limit: 3GB memory_limit: 4GB
    +       * device_ordinal: 10 device_ordinal: 20}
    +       * will create 4 virtual devices as:
    +       * /device:GPU:0 -> visible GPU 1 with 1GB memory  (ordinal 10)
    +       * /device:GPU:1 -> visible GPU 0 with 3GB memory  (ordinal 10)
    +       * /device:GPU:2 -> visible GPU 1 with 2GB memory  (ordinal 20)
    +       * /device:GPU:3 -> visible GPU 0 with 4GB memory  (ordinal 20)
    +       *
    +       * NOTE:
    +       * 1. It's invalid to set both this and "per_process_gpu_memory_fraction"
    +       * at the same time.
    +       * 2. Currently this setting is per-process, not per-session. Using
    +       * different settings in different sessions within same process will
    +       * result in undefined behavior.
    +       * 
    + * + * repeated .tensorflow.GPUOptions.Experimental.VirtualDevices virtual_devices = 1; + */ + public java.util.List + getVirtualDevicesBuilderList() { + return getVirtualDevicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder> + getVirtualDevicesFieldBuilder() { + if (virtualDevicesBuilder_ == null) { + virtualDevicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevices.Builder, org.tensorflow.proto.GPUOptions.Experimental.VirtualDevicesOrBuilder>( + virtualDevices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + virtualDevices_ = null; + } + return virtualDevicesBuilder_; + } + + private int numVirtualDevicesPerGpu_ ; + /** + *
    +       * The number of virtual devices to create on each visible GPU. The
    +       * available memory will be split equally among all virtual devices. If the
    +       * field `memory_limit_mb` in `VirtualDevices` is not empty, this field will
    +       * be ignored.
    +       * 
    + * + * int32 num_virtual_devices_per_gpu = 15; + * @return The numVirtualDevicesPerGpu. + */ + @java.lang.Override + public int getNumVirtualDevicesPerGpu() { + return numVirtualDevicesPerGpu_; + } + /** + *
    +       * The number of virtual devices to create on each visible GPU. The
    +       * available memory will be split equally among all virtual devices. If the
    +       * field `memory_limit_mb` in `VirtualDevices` is not empty, this field will
    +       * be ignored.
    +       * 
    + * + * int32 num_virtual_devices_per_gpu = 15; + * @param value The numVirtualDevicesPerGpu to set. + * @return This builder for chaining. + */ + public Builder setNumVirtualDevicesPerGpu(int value) { + + numVirtualDevicesPerGpu_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The number of virtual devices to create on each visible GPU. The
    +       * available memory will be split equally among all virtual devices. If the
    +       * field `memory_limit_mb` in `VirtualDevices` is not empty, this field will
    +       * be ignored.
    +       * 
    + * + * int32 num_virtual_devices_per_gpu = 15; + * @return This builder for chaining. + */ + public Builder clearNumVirtualDevicesPerGpu() { + bitField0_ = (bitField0_ & ~0x00000002); + numVirtualDevicesPerGpu_ = 0; + onChanged(); + return this; + } + + private boolean useUnifiedMemory_ ; + /** + *
    +       * If true, uses CUDA unified memory for memory allocations. If
    +       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    +       * memory is used regardless of the value for this field. See comments for
    +       * per_process_gpu_memory_fraction field for more details and requirements
    +       * of the unified memory. This option is useful to oversubscribe memory if
    +       * multiple processes are sharing a single GPU while individually using less
    +       * than 1.0 per process memory fraction.
    +       * 
    + * + * bool use_unified_memory = 2; + * @return The useUnifiedMemory. + */ + @java.lang.Override + public boolean getUseUnifiedMemory() { + return useUnifiedMemory_; + } + /** + *
    +       * If true, uses CUDA unified memory for memory allocations. If
    +       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    +       * memory is used regardless of the value for this field. See comments for
    +       * per_process_gpu_memory_fraction field for more details and requirements
    +       * of the unified memory. This option is useful to oversubscribe memory if
    +       * multiple processes are sharing a single GPU while individually using less
    +       * than 1.0 per process memory fraction.
    +       * 
    + * + * bool use_unified_memory = 2; + * @param value The useUnifiedMemory to set. + * @return This builder for chaining. + */ + public Builder setUseUnifiedMemory(boolean value) { + + useUnifiedMemory_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * If true, uses CUDA unified memory for memory allocations. If
    +       * per_process_gpu_memory_fraction option is greater than 1.0, then unified
    +       * memory is used regardless of the value for this field. See comments for
    +       * per_process_gpu_memory_fraction field for more details and requirements
    +       * of the unified memory. This option is useful to oversubscribe memory if
    +       * multiple processes are sharing a single GPU while individually using less
    +       * than 1.0 per process memory fraction.
    +       * 
    + * + * bool use_unified_memory = 2; + * @return This builder for chaining. + */ + public Builder clearUseUnifiedMemory() { + bitField0_ = (bitField0_ & ~0x00000004); + useUnifiedMemory_ = false; + onChanged(); + return this; + } + + private int numDevToDevCopyStreams_ ; + /** + *
    +       * If > 1, the number of device-to-device copy streams to create
    +       * for each GPUDevice.  Default value is 0, which is automatically
    +       * converted to 1.
    +       * 
    + * + * int32 num_dev_to_dev_copy_streams = 3; + * @return The numDevToDevCopyStreams. + */ + @java.lang.Override + public int getNumDevToDevCopyStreams() { + return numDevToDevCopyStreams_; + } + /** + *
    +       * If > 1, the number of device-to-device copy streams to create
    +       * for each GPUDevice.  Default value is 0, which is automatically
    +       * converted to 1.
    +       * 
    + * + * int32 num_dev_to_dev_copy_streams = 3; + * @param value The numDevToDevCopyStreams to set. + * @return This builder for chaining. + */ + public Builder setNumDevToDevCopyStreams(int value) { + + numDevToDevCopyStreams_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * If > 1, the number of device-to-device copy streams to create
    +       * for each GPUDevice.  Default value is 0, which is automatically
    +       * converted to 1.
    +       * 
    + * + * int32 num_dev_to_dev_copy_streams = 3; + * @return This builder for chaining. + */ + public Builder clearNumDevToDevCopyStreams() { + bitField0_ = (bitField0_ & ~0x00000008); + numDevToDevCopyStreams_ = 0; + onChanged(); + return this; + } + + private java.lang.Object collectiveRingOrder_ = ""; + /** + *
    +       * If non-empty, defines a good GPU ring order on a single worker based on
    +       * device interconnect.  This assumes that all workers have the same GPU
    +       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +       * This ring order is used by the RingReducer implementation of
    +       * CollectiveReduce, and serves as an override to automatic ring order
    +       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +       * 
    + * + * string collective_ring_order = 4; + * @return The collectiveRingOrder. + */ + public java.lang.String getCollectiveRingOrder() { + java.lang.Object ref = collectiveRingOrder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectiveRingOrder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * If non-empty, defines a good GPU ring order on a single worker based on
    +       * device interconnect.  This assumes that all workers have the same GPU
    +       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +       * This ring order is used by the RingReducer implementation of
    +       * CollectiveReduce, and serves as an override to automatic ring order
    +       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +       * 
    + * + * string collective_ring_order = 4; + * @return The bytes for collectiveRingOrder. + */ + public com.google.protobuf.ByteString + getCollectiveRingOrderBytes() { + java.lang.Object ref = collectiveRingOrder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + collectiveRingOrder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * If non-empty, defines a good GPU ring order on a single worker based on
    +       * device interconnect.  This assumes that all workers have the same GPU
    +       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +       * This ring order is used by the RingReducer implementation of
    +       * CollectiveReduce, and serves as an override to automatic ring order
    +       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +       * 
    + * + * string collective_ring_order = 4; + * @param value The collectiveRingOrder to set. + * @return This builder for chaining. + */ + public Builder setCollectiveRingOrder( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + collectiveRingOrder_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * If non-empty, defines a good GPU ring order on a single worker based on
    +       * device interconnect.  This assumes that all workers have the same GPU
    +       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +       * This ring order is used by the RingReducer implementation of
    +       * CollectiveReduce, and serves as an override to automatic ring order
    +       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +       * 
    + * + * string collective_ring_order = 4; + * @return This builder for chaining. + */ + public Builder clearCollectiveRingOrder() { + collectiveRingOrder_ = getDefaultInstance().getCollectiveRingOrder(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * If non-empty, defines a good GPU ring order on a single worker based on
    +       * device interconnect.  This assumes that all workers have the same GPU
    +       * topology.  Specify as a comma-separated string, e.g. "3,2,1,0,7,6,5,4".
    +       * This ring order is used by the RingReducer implementation of
    +       * CollectiveReduce, and serves as an override to automatic ring order
    +       * generation in OrderTaskDeviceMap() during CollectiveParam resolution.
    +       * 
    + * + * string collective_ring_order = 4; + * @param value The bytes for collectiveRingOrder to set. + * @return This builder for chaining. + */ + public Builder setCollectiveRingOrderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + collectiveRingOrder_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean timestampedAllocator_ ; + /** + *
    +       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    +       * keep track of when GPU memory is freed and when kernels actually
    +       * complete so that we can know when a nominally free memory chunk
    +       * is really not subject to pending use.
    +       * 
    + * + * bool timestamped_allocator = 5; + * @return The timestampedAllocator. + */ + @java.lang.Override + public boolean getTimestampedAllocator() { + return timestampedAllocator_; + } + /** + *
    +       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    +       * keep track of when GPU memory is freed and when kernels actually
    +       * complete so that we can know when a nominally free memory chunk
    +       * is really not subject to pending use.
    +       * 
    + * + * bool timestamped_allocator = 5; + * @param value The timestampedAllocator to set. + * @return This builder for chaining. + */ + public Builder setTimestampedAllocator(boolean value) { + + timestampedAllocator_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * If true then extra work is done by GPUDevice and GPUBFCAllocator to
    +       * keep track of when GPU memory is freed and when kernels actually
    +       * complete so that we can know when a nominally free memory chunk
    +       * is really not subject to pending use.
    +       * 
    + * + * bool timestamped_allocator = 5; + * @return This builder for chaining. + */ + public Builder clearTimestampedAllocator() { + bitField0_ = (bitField0_ & ~0x00000020); + timestampedAllocator_ = false; + onChanged(); + return this; + } + + private int kernelTrackerMaxInterval_ ; + /** + *
    +       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    +       * Note that timestamped_allocator is only effective if some tracking is
    +       * specified.
    +       *
    +       * If kernel_tracker_max_interval = n > 0, then a tracking event
    +       * is inserted after every n kernels without an event.
    +       * 
    + * + * int32 kernel_tracker_max_interval = 7; + * @return The kernelTrackerMaxInterval. + */ + @java.lang.Override + public int getKernelTrackerMaxInterval() { + return kernelTrackerMaxInterval_; + } + /** + *
    +       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    +       * Note that timestamped_allocator is only effective if some tracking is
    +       * specified.
    +       *
    +       * If kernel_tracker_max_interval = n > 0, then a tracking event
    +       * is inserted after every n kernels without an event.
    +       * 
    + * + * int32 kernel_tracker_max_interval = 7; + * @param value The kernelTrackerMaxInterval to set. + * @return This builder for chaining. + */ + public Builder setKernelTrackerMaxInterval(int value) { + + kernelTrackerMaxInterval_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Parameters for GPUKernelTracker.  By default no kernel tracking is done.
    +       * Note that timestamped_allocator is only effective if some tracking is
    +       * specified.
    +       *
    +       * If kernel_tracker_max_interval = n > 0, then a tracking event
    +       * is inserted after every n kernels without an event.
    +       * 
    + * + * int32 kernel_tracker_max_interval = 7; + * @return This builder for chaining. + */ + public Builder clearKernelTrackerMaxInterval() { + bitField0_ = (bitField0_ & ~0x00000040); + kernelTrackerMaxInterval_ = 0; + onChanged(); + return this; + } + + private int kernelTrackerMaxBytes_ ; + /** + *
    +       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    +       * inserted after every series of kernels allocating a sum of
    +       * memory >= n.  If one kernel allocates b * n bytes, then one
    +       * event will be inserted after it, but it will count as b against
    +       * the pending limit.
    +       * 
    + * + * int32 kernel_tracker_max_bytes = 8; + * @return The kernelTrackerMaxBytes. + */ + @java.lang.Override + public int getKernelTrackerMaxBytes() { + return kernelTrackerMaxBytes_; + } + /** + *
    +       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    +       * inserted after every series of kernels allocating a sum of
    +       * memory >= n.  If one kernel allocates b * n bytes, then one
    +       * event will be inserted after it, but it will count as b against
    +       * the pending limit.
    +       * 
    + * + * int32 kernel_tracker_max_bytes = 8; + * @param value The kernelTrackerMaxBytes to set. + * @return This builder for chaining. + */ + public Builder setKernelTrackerMaxBytes(int value) { + + kernelTrackerMaxBytes_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * If kernel_tracker_max_bytes = n > 0, then a tracking event is
    +       * inserted after every series of kernels allocating a sum of
    +       * memory >= n.  If one kernel allocates b * n bytes, then one
    +       * event will be inserted after it, but it will count as b against
    +       * the pending limit.
    +       * 
    + * + * int32 kernel_tracker_max_bytes = 8; + * @return This builder for chaining. + */ + public Builder clearKernelTrackerMaxBytes() { + bitField0_ = (bitField0_ & ~0x00000080); + kernelTrackerMaxBytes_ = 0; + onChanged(); + return this; + } + + private int kernelTrackerMaxPending_ ; + /** + *
    +       * If kernel_tracker_max_pending > 0 then no more than this many
    +       * tracking events can be outstanding at a time.  An attempt to
    +       * launch an additional kernel will stall until an event
    +       * completes.
    +       * 
    + * + * int32 kernel_tracker_max_pending = 9; + * @return The kernelTrackerMaxPending. + */ + @java.lang.Override + public int getKernelTrackerMaxPending() { + return kernelTrackerMaxPending_; + } + /** + *
    +       * If kernel_tracker_max_pending > 0 then no more than this many
    +       * tracking events can be outstanding at a time.  An attempt to
    +       * launch an additional kernel will stall until an event
    +       * completes.
    +       * 
    + * + * int32 kernel_tracker_max_pending = 9; + * @param value The kernelTrackerMaxPending to set. + * @return This builder for chaining. + */ + public Builder setKernelTrackerMaxPending(int value) { + + kernelTrackerMaxPending_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * If kernel_tracker_max_pending > 0 then no more than this many
    +       * tracking events can be outstanding at a time.  An attempt to
    +       * launch an additional kernel will stall until an event
    +       * completes.
    +       * 
    + * + * int32 kernel_tracker_max_pending = 9; + * @return This builder for chaining. + */ + public Builder clearKernelTrackerMaxPending() { + bitField0_ = (bitField0_ & ~0x00000100); + kernelTrackerMaxPending_ = 0; + onChanged(); + return this; + } + + private double internalFragmentationFraction_ ; + /** + *
    +       * BFC Allocator can return an allocated chunk of memory upto 2x the
    +       * requested size. For virtual devices with tight memory constraints, and
    +       * proportionately large allocation requests, this can lead to a significant
    +       * reduction in available memory. The threshold below controls when a chunk
    +       * should be split if the chunk size exceeds requested memory size. It is
    +       * expressed as a fraction of total available memory for the tf device. For
    +       * example setting it to 0.05 would imply a chunk needs to be split if its
    +       * size exceeds the requested memory by 5% of the total virtual device/gpu
    +       * memory size.
    +       * 
    + * + * double internal_fragmentation_fraction = 10; + * @return The internalFragmentationFraction. + */ + @java.lang.Override + public double getInternalFragmentationFraction() { + return internalFragmentationFraction_; + } + /** + *
    +       * BFC Allocator can return an allocated chunk of memory upto 2x the
    +       * requested size. For virtual devices with tight memory constraints, and
    +       * proportionately large allocation requests, this can lead to a significant
    +       * reduction in available memory. The threshold below controls when a chunk
    +       * should be split if the chunk size exceeds requested memory size. It is
    +       * expressed as a fraction of total available memory for the tf device. For
    +       * example setting it to 0.05 would imply a chunk needs to be split if its
    +       * size exceeds the requested memory by 5% of the total virtual device/gpu
    +       * memory size.
    +       * 
    + * + * double internal_fragmentation_fraction = 10; + * @param value The internalFragmentationFraction to set. + * @return This builder for chaining. + */ + public Builder setInternalFragmentationFraction(double value) { + + internalFragmentationFraction_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * BFC Allocator can return an allocated chunk of memory upto 2x the
    +       * requested size. For virtual devices with tight memory constraints, and
    +       * proportionately large allocation requests, this can lead to a significant
    +       * reduction in available memory. The threshold below controls when a chunk
    +       * should be split if the chunk size exceeds requested memory size. It is
    +       * expressed as a fraction of total available memory for the tf device. For
    +       * example setting it to 0.05 would imply a chunk needs to be split if its
    +       * size exceeds the requested memory by 5% of the total virtual device/gpu
    +       * memory size.
    +       * 
    + * + * double internal_fragmentation_fraction = 10; + * @return This builder for chaining. + */ + public Builder clearInternalFragmentationFraction() { + bitField0_ = (bitField0_ & ~0x00000200); + internalFragmentationFraction_ = 0D; + onChanged(); + return this; + } + + private boolean useCudaMallocAsync_ ; + /** + *
    +       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    +       * 
    + * + * bool use_cuda_malloc_async = 11; + * @return The useCudaMallocAsync. + */ + @java.lang.Override + public boolean getUseCudaMallocAsync() { + return useCudaMallocAsync_; + } + /** + *
    +       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    +       * 
    + * + * bool use_cuda_malloc_async = 11; + * @param value The useCudaMallocAsync to set. + * @return This builder for chaining. + */ + public Builder setUseCudaMallocAsync(boolean value) { + + useCudaMallocAsync_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * When true, use CUDA cudaMallocAsync API instead of TF gpu allocator.
    +       * 
    + * + * bool use_cuda_malloc_async = 11; + * @return This builder for chaining. + */ + public Builder clearUseCudaMallocAsync() { + bitField0_ = (bitField0_ & ~0x00000400); + useCudaMallocAsync_ = false; + onChanged(); + return this; + } + + private boolean disallowRetryOnAllocationFailure_ ; + /** + *
    +       * By default, BFCAllocator may sleep when it runs out of memory, in the
    +       * hopes that another thread will free up memory in the meantime.  Setting
    +       * this to true disables the sleep; instead we'll OOM immediately.
    +       * 
    + * + * bool disallow_retry_on_allocation_failure = 12; + * @return The disallowRetryOnAllocationFailure. + */ + @java.lang.Override + public boolean getDisallowRetryOnAllocationFailure() { + return disallowRetryOnAllocationFailure_; + } + /** + *
    +       * By default, BFCAllocator may sleep when it runs out of memory, in the
    +       * hopes that another thread will free up memory in the meantime.  Setting
    +       * this to true disables the sleep; instead we'll OOM immediately.
    +       * 
    + * + * bool disallow_retry_on_allocation_failure = 12; + * @param value The disallowRetryOnAllocationFailure to set. + * @return This builder for chaining. + */ + public Builder setDisallowRetryOnAllocationFailure(boolean value) { + + disallowRetryOnAllocationFailure_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * By default, BFCAllocator may sleep when it runs out of memory, in the
    +       * hopes that another thread will free up memory in the meantime.  Setting
    +       * this to true disables the sleep; instead we'll OOM immediately.
    +       * 
    + * + * bool disallow_retry_on_allocation_failure = 12; + * @return This builder for chaining. + */ + public Builder clearDisallowRetryOnAllocationFailure() { + bitField0_ = (bitField0_ & ~0x00000800); + disallowRetryOnAllocationFailure_ = false; + onChanged(); + return this; + } + + private float gpuHostMemLimitInMb_ ; + /** + *
    +       * Memory limit for "GPU host allocator", aka pinned memory allocator.  This
    +       * can also be set via the envvar TF_GPU_HOST_MEM_LIMIT_IN_MB.
    +       * 
    + * + * float gpu_host_mem_limit_in_mb = 13; + * @return The gpuHostMemLimitInMb. + */ + @java.lang.Override + public float getGpuHostMemLimitInMb() { + return gpuHostMemLimitInMb_; + } + /** + *
    +       * Memory limit for "GPU host allocator", aka pinned memory allocator.  This
    +       * can also be set via the envvar TF_GPU_HOST_MEM_LIMIT_IN_MB.
    +       * 
    + * + * float gpu_host_mem_limit_in_mb = 13; + * @param value The gpuHostMemLimitInMb to set. + * @return This builder for chaining. + */ + public Builder setGpuHostMemLimitInMb(float value) { + + gpuHostMemLimitInMb_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * Memory limit for "GPU host allocator", aka pinned memory allocator.  This
    +       * can also be set via the envvar TF_GPU_HOST_MEM_LIMIT_IN_MB.
    +       * 
    + * + * float gpu_host_mem_limit_in_mb = 13; + * @return This builder for chaining. + */ + public Builder clearGpuHostMemLimitInMb() { + bitField0_ = (bitField0_ & ~0x00001000); + gpuHostMemLimitInMb_ = 0F; + onChanged(); + return this; + } + + private boolean gpuHostMemDisallowGrowth_ ; + /** + *
    +       * If true, then the host allocator allocates its max memory all upfront and
    +       * never grows.  This can be useful for latency-sensitive systems, because
    +       * growing the GPU host memory pool can be expensive.
    +       *
    +       * You probably only want to use this in combination with
    +       * gpu_host_mem_limit_in_mb, because the default GPU host memory limit is
    +       * quite high.
    +       * 
    + * + * bool gpu_host_mem_disallow_growth = 14; + * @return The gpuHostMemDisallowGrowth. + */ + @java.lang.Override + public boolean getGpuHostMemDisallowGrowth() { + return gpuHostMemDisallowGrowth_; + } + /** + *
    +       * If true, then the host allocator allocates its max memory all upfront and
    +       * never grows.  This can be useful for latency-sensitive systems, because
    +       * growing the GPU host memory pool can be expensive.
    +       *
    +       * You probably only want to use this in combination with
    +       * gpu_host_mem_limit_in_mb, because the default GPU host memory limit is
    +       * quite high.
    +       * 
    + * + * bool gpu_host_mem_disallow_growth = 14; + * @param value The gpuHostMemDisallowGrowth to set. + * @return This builder for chaining. + */ + public Builder setGpuHostMemDisallowGrowth(boolean value) { + + gpuHostMemDisallowGrowth_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * If true, then the host allocator allocates its max memory all upfront and
    +       * never grows.  This can be useful for latency-sensitive systems, because
    +       * growing the GPU host memory pool can be expensive.
    +       *
    +       * You probably only want to use this in combination with
    +       * gpu_host_mem_limit_in_mb, because the default GPU host memory limit is
    +       * quite high.
    +       * 
    + * + * bool gpu_host_mem_disallow_growth = 14; + * @return This builder for chaining. + */ + public Builder clearGpuHostMemDisallowGrowth() { + bitField0_ = (bitField0_ & ~0x00002000); + gpuHostMemDisallowGrowth_ = false; + onChanged(); + return this; + } + + private int gpuSystemMemorySizeInMb_ ; + /** + *
    +       * Memory limit for gpu system. This can also be set by
    +       * TF_DEVICE_MIN_SYS_MEMORY_IN_MB, which takes precedence over
    +       * gpu_system_memory_size_in_mb. With this, user can configure the gpu
    +       * system memory size for better resource estimation of multi-tenancy(one
    +       * gpu with multiple model) use case.
    +       * 
    + * + * int32 gpu_system_memory_size_in_mb = 16; + * @return The gpuSystemMemorySizeInMb. + */ + @java.lang.Override + public int getGpuSystemMemorySizeInMb() { + return gpuSystemMemorySizeInMb_; + } + /** + *
    +       * Memory limit for gpu system. This can also be set by
    +       * TF_DEVICE_MIN_SYS_MEMORY_IN_MB, which takes precedence over
    +       * gpu_system_memory_size_in_mb. With this, user can configure the gpu
    +       * system memory size for better resource estimation of multi-tenancy(one
    +       * gpu with multiple model) use case.
    +       * 
    + * + * int32 gpu_system_memory_size_in_mb = 16; + * @param value The gpuSystemMemorySizeInMb to set. + * @return This builder for chaining. + */ + public Builder setGpuSystemMemorySizeInMb(int value) { + + gpuSystemMemorySizeInMb_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * Memory limit for gpu system. This can also be set by
    +       * TF_DEVICE_MIN_SYS_MEMORY_IN_MB, which takes precedence over
    +       * gpu_system_memory_size_in_mb. With this, user can configure the gpu
    +       * system memory size for better resource estimation of multi-tenancy(one
    +       * gpu with multiple model) use case.
    +       * 
    + * + * int32 gpu_system_memory_size_in_mb = 16; + * @return This builder for chaining. + */ + public Builder clearGpuSystemMemorySizeInMb() { + bitField0_ = (bitField0_ & ~0x00004000); + gpuSystemMemorySizeInMb_ = 0; + onChanged(); + return this; + } + + private boolean populatePjrtGpuClientCreationInfo_ ; + /** + *
    +       * If true, save information needed for created a PjRt GPU client for
    +       * creating a client with remote devices.
    +       * 
    + * + * bool populate_pjrt_gpu_client_creation_info = 17; + * @return The populatePjrtGpuClientCreationInfo. + */ + @java.lang.Override + public boolean getPopulatePjrtGpuClientCreationInfo() { + return populatePjrtGpuClientCreationInfo_; + } + /** + *
    +       * If true, save information needed for created a PjRt GPU client for
    +       * creating a client with remote devices.
    +       * 
    + * + * bool populate_pjrt_gpu_client_creation_info = 17; + * @param value The populatePjrtGpuClientCreationInfo to set. + * @return This builder for chaining. + */ + public Builder setPopulatePjrtGpuClientCreationInfo(boolean value) { + + populatePjrtGpuClientCreationInfo_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +       * If true, save information needed for created a PjRt GPU client for
    +       * creating a client with remote devices.
    +       * 
    + * + * bool populate_pjrt_gpu_client_creation_info = 17; + * @return This builder for chaining. + */ + public Builder clearPopulatePjrtGpuClientCreationInfo() { + bitField0_ = (bitField0_ & ~0x00008000); + populatePjrtGpuClientCreationInfo_ = false; + onChanged(); + return this; + } + + private int nodeId_ ; + /** + *
    +       * node_id for use when creating a PjRt GPU client with remote devices,
    +       * which enumerates jobs*tasks from a ServerDef.
    +       * 
    + * + * int32 node_id = 18; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + *
    +       * node_id for use when creating a PjRt GPU client with remote devices,
    +       * which enumerates jobs*tasks from a ServerDef.
    +       * 
    + * + * int32 node_id = 18; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +       * node_id for use when creating a PjRt GPU client with remote devices,
    +       * which enumerates jobs*tasks from a ServerDef.
    +       * 
    + * + * int32 node_id = 18; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00010000); + nodeId_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions streamMergeOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder> streamMergeOptionsBuilder_; + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return Whether the streamMergeOptions field is set. + */ + public boolean hasStreamMergeOptions() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + * @return The streamMergeOptions. + */ + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions getStreamMergeOptions() { + if (streamMergeOptionsBuilder_ == null) { + return streamMergeOptions_ == null ? org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance() : streamMergeOptions_; + } else { + return streamMergeOptionsBuilder_.getMessage(); + } + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public Builder setStreamMergeOptions(org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions value) { + if (streamMergeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamMergeOptions_ = value; + } else { + streamMergeOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public Builder setStreamMergeOptions( + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder builderForValue) { + if (streamMergeOptionsBuilder_ == null) { + streamMergeOptions_ = builderForValue.build(); + } else { + streamMergeOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public Builder mergeStreamMergeOptions(org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions value) { + if (streamMergeOptionsBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) && + streamMergeOptions_ != null && + streamMergeOptions_ != org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance()) { + getStreamMergeOptionsBuilder().mergeFrom(value); + } else { + streamMergeOptions_ = value; + } + } else { + streamMergeOptionsBuilder_.mergeFrom(value); + } + if (streamMergeOptions_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public Builder clearStreamMergeOptions() { + bitField0_ = (bitField0_ & ~0x00020000); + streamMergeOptions_ = null; + if (streamMergeOptionsBuilder_ != null) { + streamMergeOptionsBuilder_.dispose(); + streamMergeOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder getStreamMergeOptionsBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getStreamMergeOptionsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + public org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder getStreamMergeOptionsOrBuilder() { + if (streamMergeOptionsBuilder_ != null) { + return streamMergeOptionsBuilder_.getMessageOrBuilder(); + } else { + return streamMergeOptions_ == null ? + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.getDefaultInstance() : streamMergeOptions_; + } + } + /** + * .tensorflow.GPUOptions.Experimental.StreamMergeOptions stream_merge_options = 19; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder> + getStreamMergeOptionsFieldBuilder() { + if (streamMergeOptionsBuilder_ == null) { + streamMergeOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptions.Builder, org.tensorflow.proto.GPUOptions.Experimental.StreamMergeOptionsOrBuilder>( + getStreamMergeOptions(), + getParentForChildren(), + isClean()); + streamMergeOptions_ = null; + } + return streamMergeOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GPUOptions.Experimental) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions.Experimental) + private static final org.tensorflow.proto.GPUOptions.Experimental DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GPUOptions.Experimental(); + } + + public static org.tensorflow.proto.GPUOptions.Experimental getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Experimental parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GPUOptions.Experimental getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int PER_PROCESS_GPU_MEMORY_FRACTION_FIELD_NUMBER = 1; + private double perProcessGpuMemoryFraction_ = 0D; + /** + *
    +   * Fraction of the total GPU memory to allocate for each process.
    +   * 1 means to allocate all of the GPU memory, 0.5 means the process
    +   * allocates up to ~50% of the total GPU memory.
    +   *
    +   * GPU memory is pre-allocated unless the allow_growth option is enabled.
    +   *
    +   * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    +   * the amount of memory available on the GPU device by using host memory as a
    +   * swap space. Accessing memory not available on the device will be
    +   * significantly slower as that would require memory transfer between the host
    +   * and the device. Options to reduce the memory requirement should be
    +   * considered before enabling this option as this may come with a negative
    +   * performance impact. Oversubscription using the unified memory requires
    +   * Pascal class or newer GPUs and it is currently only supported on the Linux
    +   * operating system. See
    +   * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    +   * for the detailed requirements.
    +   * 
    + * + * double per_process_gpu_memory_fraction = 1; + * @return The perProcessGpuMemoryFraction. + */ + @java.lang.Override + public double getPerProcessGpuMemoryFraction() { + return perProcessGpuMemoryFraction_; + } + + public static final int ALLOW_GROWTH_FIELD_NUMBER = 4; + private boolean allowGrowth_ = false; + /** + *
    +   * If true, the allocator does not pre-allocate the entire specified
    +   * GPU memory region, instead starting small and growing as needed.
    +   * 
    + * + * bool allow_growth = 4; + * @return The allowGrowth. + */ + @java.lang.Override + public boolean getAllowGrowth() { + return allowGrowth_; + } + + public static final int ALLOCATOR_TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorType_ = ""; + /** + *
    +   * The type of GPU allocation strategy to use.
    +   *
    +   * Allowed values:
    +   * "": The empty string (default) uses a system-chosen default
    +   * which may change over time.
    +   *
    +   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +   * version of dlmalloc.
    +   * 
    + * + * string allocator_type = 2; + * @return The allocatorType. + */ + @java.lang.Override + public java.lang.String getAllocatorType() { + java.lang.Object ref = allocatorType_; + 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(); + allocatorType_ = s; + return s; + } + } + /** + *
    +   * The type of GPU allocation strategy to use.
    +   *
    +   * Allowed values:
    +   * "": The empty string (default) uses a system-chosen default
    +   * which may change over time.
    +   *
    +   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +   * version of dlmalloc.
    +   * 
    + * + * string allocator_type = 2; + * @return The bytes for allocatorType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorTypeBytes() { + java.lang.Object ref = allocatorType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFERRED_DELETION_BYTES_FIELD_NUMBER = 3; + private long deferredDeletionBytes_ = 0L; + /** + *
    +   * Delay deletion of up to this many bytes to reduce the number of
    +   * interactions with gpu driver code.  If 0, the system chooses
    +   * a reasonable default (several MBs).
    +   * 
    + * + * int64 deferred_deletion_bytes = 3; + * @return The deferredDeletionBytes. + */ + @java.lang.Override + public long getDeferredDeletionBytes() { + return deferredDeletionBytes_; + } + + public static final int VISIBLE_DEVICE_LIST_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object visibleDeviceList_ = ""; + /** + *
    +   * A comma-separated list of GPU ids that determines the 'visible'
    +   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +   * can see 8 GPU devices in the process, and one wanted to map
    +   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +   * then one would specify this field as "5,3".  This field is similar in
    +   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +   * it applies to the visible GPU devices in the process.
    +   *
    +   * NOTE:
    +   * 1. The GPU driver provides the process with the visible GPUs
    +   * in an order which is not guaranteed to have any correlation to
    +   * the *physical* GPU id in the machine.  This field is used for
    +   * remapping "visible" to "virtual", which means this operates only
    +   * after the process starts.  Users are required to use vendor
    +   * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +   * physical to visible device mapping prior to invoking TensorFlow.
    +   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +   * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +   * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +   * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +   * for more information.
    +   * 3. The visible_device_list is also used for PluggableDevice. And
    +   * different types of PluggableDevices share this field. In that case,
    +   * the pluggable_device_type is used to distinguish them, making the
    +   * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +   * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +   * 
    + * + * string visible_device_list = 5; + * @return The visibleDeviceList. + */ + @java.lang.Override + public java.lang.String getVisibleDeviceList() { + java.lang.Object ref = visibleDeviceList_; + 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(); + visibleDeviceList_ = s; + return s; + } + } + /** + *
    +   * A comma-separated list of GPU ids that determines the 'visible'
    +   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +   * can see 8 GPU devices in the process, and one wanted to map
    +   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +   * then one would specify this field as "5,3".  This field is similar in
    +   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +   * it applies to the visible GPU devices in the process.
    +   *
    +   * NOTE:
    +   * 1. The GPU driver provides the process with the visible GPUs
    +   * in an order which is not guaranteed to have any correlation to
    +   * the *physical* GPU id in the machine.  This field is used for
    +   * remapping "visible" to "virtual", which means this operates only
    +   * after the process starts.  Users are required to use vendor
    +   * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +   * physical to visible device mapping prior to invoking TensorFlow.
    +   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +   * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +   * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +   * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +   * for more information.
    +   * 3. The visible_device_list is also used for PluggableDevice. And
    +   * different types of PluggableDevices share this field. In that case,
    +   * the pluggable_device_type is used to distinguish them, making the
    +   * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +   * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +   * 
    + * + * string visible_device_list = 5; + * @return The bytes for visibleDeviceList. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVisibleDeviceListBytes() { + java.lang.Object ref = visibleDeviceList_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + visibleDeviceList_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLLING_ACTIVE_DELAY_USECS_FIELD_NUMBER = 6; + private int pollingActiveDelayUsecs_ = 0; + /** + *
    +   * In the event polling loop sleep this many microseconds between
    +   * PollEvents calls, when the queue is not empty.  If value is not
    +   * set or set to 0, gets set to a non-zero default.
    +   * 
    + * + * int32 polling_active_delay_usecs = 6; + * @return The pollingActiveDelayUsecs. + */ + @java.lang.Override + public int getPollingActiveDelayUsecs() { + return pollingActiveDelayUsecs_; + } + + public static final int POLLING_INACTIVE_DELAY_MSECS_FIELD_NUMBER = 7; + private int pollingInactiveDelayMsecs_ = 0; + /** + *
    +   * This field is deprecated and ignored.
    +   * 
    + * + * int32 polling_inactive_delay_msecs = 7; + * @return The pollingInactiveDelayMsecs. + */ + @java.lang.Override + public int getPollingInactiveDelayMsecs() { + return pollingInactiveDelayMsecs_; + } + + public static final int FORCE_GPU_COMPATIBLE_FIELD_NUMBER = 8; + private boolean forceGpuCompatible_ = false; + /** + *
    +   * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    +   * enabling this option forces all CPU tensors to be allocated with Cuda
    +   * pinned memory. Normally, TensorFlow will infer which tensors should be
    +   * allocated as the pinned memory. But in case where the inference is
    +   * incomplete, this option can significantly speed up the cross-device memory
    +   * copy performance as long as it fits the memory.
    +   * Note that this option is not something that should be
    +   * enabled by default for unknown or very large models, since all Cuda pinned
    +   * memory is unpageable, having too much pinned memory might negatively impact
    +   * the overall host system performance.
    +   * 
    + * + * bool force_gpu_compatible = 8; + * @return The forceGpuCompatible. + */ + @java.lang.Override + public boolean getForceGpuCompatible() { + return forceGpuCompatible_; + } + + public static final int EXPERIMENTAL_FIELD_NUMBER = 9; + private org.tensorflow.proto.GPUOptions.Experimental experimental_; + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return Whether the experimental field is set. + */ + @java.lang.Override + public boolean hasExperimental() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return The experimental. + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.Experimental getExperimental() { + return experimental_ == null ? org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance() : experimental_; + } + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + @java.lang.Override + public org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { + return experimental_ == null ? org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance() : experimental_; + } + + 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 (java.lang.Double.doubleToRawLongBits(perProcessGpuMemoryFraction_) != 0) { + output.writeDouble(1, perProcessGpuMemoryFraction_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, allocatorType_); + } + if (deferredDeletionBytes_ != 0L) { + output.writeInt64(3, deferredDeletionBytes_); + } + if (allowGrowth_ != false) { + output.writeBool(4, allowGrowth_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(visibleDeviceList_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, visibleDeviceList_); + } + if (pollingActiveDelayUsecs_ != 0) { + output.writeInt32(6, pollingActiveDelayUsecs_); + } + if (pollingInactiveDelayMsecs_ != 0) { + output.writeInt32(7, pollingInactiveDelayMsecs_); + } + if (forceGpuCompatible_ != false) { + output.writeBool(8, forceGpuCompatible_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getExperimental()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(perProcessGpuMemoryFraction_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, perProcessGpuMemoryFraction_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, allocatorType_); + } + if (deferredDeletionBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, deferredDeletionBytes_); + } + if (allowGrowth_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, allowGrowth_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(visibleDeviceList_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, visibleDeviceList_); + } + if (pollingActiveDelayUsecs_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, pollingActiveDelayUsecs_); + } + if (pollingInactiveDelayMsecs_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, pollingInactiveDelayMsecs_); + } + if (forceGpuCompatible_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, forceGpuCompatible_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getExperimental()); + } + size += getUnknownFields().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.GPUOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.GPUOptions other = (org.tensorflow.proto.GPUOptions) obj; + + if (java.lang.Double.doubleToLongBits(getPerProcessGpuMemoryFraction()) + != java.lang.Double.doubleToLongBits( + other.getPerProcessGpuMemoryFraction())) return false; + if (getAllowGrowth() + != other.getAllowGrowth()) return false; + if (!getAllocatorType() + .equals(other.getAllocatorType())) return false; + if (getDeferredDeletionBytes() + != other.getDeferredDeletionBytes()) return false; + if (!getVisibleDeviceList() + .equals(other.getVisibleDeviceList())) return false; + if (getPollingActiveDelayUsecs() + != other.getPollingActiveDelayUsecs()) return false; + if (getPollingInactiveDelayMsecs() + != other.getPollingInactiveDelayMsecs()) return false; + if (getForceGpuCompatible() + != other.getForceGpuCompatible()) return false; + if (hasExperimental() != other.hasExperimental()) return false; + if (hasExperimental()) { + if (!getExperimental() + .equals(other.getExperimental())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PER_PROCESS_GPU_MEMORY_FRACTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPerProcessGpuMemoryFraction())); + hash = (37 * hash) + ALLOW_GROWTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowGrowth()); + hash = (37 * hash) + ALLOCATOR_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorType().hashCode(); + hash = (37 * hash) + DEFERRED_DELETION_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDeferredDeletionBytes()); + hash = (37 * hash) + VISIBLE_DEVICE_LIST_FIELD_NUMBER; + hash = (53 * hash) + getVisibleDeviceList().hashCode(); + hash = (37 * hash) + POLLING_ACTIVE_DELAY_USECS_FIELD_NUMBER; + hash = (53 * hash) + getPollingActiveDelayUsecs(); + hash = (37 * hash) + POLLING_INACTIVE_DELAY_MSECS_FIELD_NUMBER; + hash = (53 * hash) + getPollingInactiveDelayMsecs(); + hash = (37 * hash) + FORCE_GPU_COMPATIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getForceGpuCompatible()); + if (hasExperimental()) { + hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; + hash = (53 * hash) + getExperimental().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GPUOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions 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.GPUOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions 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.GPUOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GPUOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GPUOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GPUOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GPUOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GPUOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GPUOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GPUOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GPUOptions) + org.tensorflow.proto.GPUOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GPUOptions.class, org.tensorflow.proto.GPUOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.GPUOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getExperimentalFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + perProcessGpuMemoryFraction_ = 0D; + allowGrowth_ = false; + allocatorType_ = ""; + deferredDeletionBytes_ = 0L; + visibleDeviceList_ = ""; + pollingActiveDelayUsecs_ = 0; + pollingInactiveDelayMsecs_ = 0; + forceGpuCompatible_ = false; + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GPUOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions getDefaultInstanceForType() { + return org.tensorflow.proto.GPUOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions build() { + org.tensorflow.proto.GPUOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GPUOptions buildPartial() { + org.tensorflow.proto.GPUOptions result = new org.tensorflow.proto.GPUOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GPUOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.perProcessGpuMemoryFraction_ = perProcessGpuMemoryFraction_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowGrowth_ = allowGrowth_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allocatorType_ = allocatorType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deferredDeletionBytes_ = deferredDeletionBytes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.visibleDeviceList_ = visibleDeviceList_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pollingActiveDelayUsecs_ = pollingActiveDelayUsecs_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pollingInactiveDelayMsecs_ = pollingInactiveDelayMsecs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.forceGpuCompatible_ = forceGpuCompatible_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000100) != 0)) { + result.experimental_ = experimentalBuilder_ == null + ? experimental_ + : experimentalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GPUOptions) { + return mergeFrom((org.tensorflow.proto.GPUOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GPUOptions other) { + if (other == org.tensorflow.proto.GPUOptions.getDefaultInstance()) return this; + if (other.getPerProcessGpuMemoryFraction() != 0D) { + setPerProcessGpuMemoryFraction(other.getPerProcessGpuMemoryFraction()); + } + if (other.getAllowGrowth() != false) { + setAllowGrowth(other.getAllowGrowth()); + } + if (!other.getAllocatorType().isEmpty()) { + allocatorType_ = other.allocatorType_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDeferredDeletionBytes() != 0L) { + setDeferredDeletionBytes(other.getDeferredDeletionBytes()); + } + if (!other.getVisibleDeviceList().isEmpty()) { + visibleDeviceList_ = other.visibleDeviceList_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getPollingActiveDelayUsecs() != 0) { + setPollingActiveDelayUsecs(other.getPollingActiveDelayUsecs()); + } + if (other.getPollingInactiveDelayMsecs() != 0) { + setPollingInactiveDelayMsecs(other.getPollingInactiveDelayMsecs()); + } + if (other.getForceGpuCompatible() != false) { + setForceGpuCompatible(other.getForceGpuCompatible()); + } + if (other.hasExperimental()) { + mergeExperimental(other.getExperimental()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + perProcessGpuMemoryFraction_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 18: { + allocatorType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: { + deferredDeletionBytes_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 32: { + allowGrowth_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 32 + case 42: { + visibleDeviceList_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + pollingActiveDelayUsecs_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + pollingInactiveDelayMsecs_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + forceGpuCompatible_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: { + input.readMessage( + getExperimentalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double perProcessGpuMemoryFraction_ ; + /** + *
    +     * Fraction of the total GPU memory to allocate for each process.
    +     * 1 means to allocate all of the GPU memory, 0.5 means the process
    +     * allocates up to ~50% of the total GPU memory.
    +     *
    +     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    +     *
    +     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    +     * the amount of memory available on the GPU device by using host memory as a
    +     * swap space. Accessing memory not available on the device will be
    +     * significantly slower as that would require memory transfer between the host
    +     * and the device. Options to reduce the memory requirement should be
    +     * considered before enabling this option as this may come with a negative
    +     * performance impact. Oversubscription using the unified memory requires
    +     * Pascal class or newer GPUs and it is currently only supported on the Linux
    +     * operating system. See
    +     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    +     * for the detailed requirements.
    +     * 
    + * + * double per_process_gpu_memory_fraction = 1; + * @return The perProcessGpuMemoryFraction. + */ + @java.lang.Override + public double getPerProcessGpuMemoryFraction() { + return perProcessGpuMemoryFraction_; + } + /** + *
    +     * Fraction of the total GPU memory to allocate for each process.
    +     * 1 means to allocate all of the GPU memory, 0.5 means the process
    +     * allocates up to ~50% of the total GPU memory.
    +     *
    +     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    +     *
    +     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    +     * the amount of memory available on the GPU device by using host memory as a
    +     * swap space. Accessing memory not available on the device will be
    +     * significantly slower as that would require memory transfer between the host
    +     * and the device. Options to reduce the memory requirement should be
    +     * considered before enabling this option as this may come with a negative
    +     * performance impact. Oversubscription using the unified memory requires
    +     * Pascal class or newer GPUs and it is currently only supported on the Linux
    +     * operating system. See
    +     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    +     * for the detailed requirements.
    +     * 
    + * + * double per_process_gpu_memory_fraction = 1; + * @param value The perProcessGpuMemoryFraction to set. + * @return This builder for chaining. + */ + public Builder setPerProcessGpuMemoryFraction(double value) { + + perProcessGpuMemoryFraction_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Fraction of the total GPU memory to allocate for each process.
    +     * 1 means to allocate all of the GPU memory, 0.5 means the process
    +     * allocates up to ~50% of the total GPU memory.
    +     *
    +     * GPU memory is pre-allocated unless the allow_growth option is enabled.
    +     *
    +     * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    +     * the amount of memory available on the GPU device by using host memory as a
    +     * swap space. Accessing memory not available on the device will be
    +     * significantly slower as that would require memory transfer between the host
    +     * and the device. Options to reduce the memory requirement should be
    +     * considered before enabling this option as this may come with a negative
    +     * performance impact. Oversubscription using the unified memory requires
    +     * Pascal class or newer GPUs and it is currently only supported on the Linux
    +     * operating system. See
    +     * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    +     * for the detailed requirements.
    +     * 
    + * + * double per_process_gpu_memory_fraction = 1; + * @return This builder for chaining. + */ + public Builder clearPerProcessGpuMemoryFraction() { + bitField0_ = (bitField0_ & ~0x00000001); + perProcessGpuMemoryFraction_ = 0D; + onChanged(); + return this; + } + + private boolean allowGrowth_ ; + /** + *
    +     * If true, the allocator does not pre-allocate the entire specified
    +     * GPU memory region, instead starting small and growing as needed.
    +     * 
    + * + * bool allow_growth = 4; + * @return The allowGrowth. + */ + @java.lang.Override + public boolean getAllowGrowth() { + return allowGrowth_; + } + /** + *
    +     * If true, the allocator does not pre-allocate the entire specified
    +     * GPU memory region, instead starting small and growing as needed.
    +     * 
    + * + * bool allow_growth = 4; + * @param value The allowGrowth to set. + * @return This builder for chaining. + */ + public Builder setAllowGrowth(boolean value) { + + allowGrowth_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If true, the allocator does not pre-allocate the entire specified
    +     * GPU memory region, instead starting small and growing as needed.
    +     * 
    + * + * bool allow_growth = 4; + * @return This builder for chaining. + */ + public Builder clearAllowGrowth() { + bitField0_ = (bitField0_ & ~0x00000002); + allowGrowth_ = false; + onChanged(); + return this; + } + + private java.lang.Object allocatorType_ = ""; + /** + *
    +     * The type of GPU allocation strategy to use.
    +     *
    +     * Allowed values:
    +     * "": The empty string (default) uses a system-chosen default
    +     * which may change over time.
    +     *
    +     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +     * version of dlmalloc.
    +     * 
    + * + * string allocator_type = 2; + * @return The allocatorType. + */ + public java.lang.String getAllocatorType() { + java.lang.Object ref = allocatorType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The type of GPU allocation strategy to use.
    +     *
    +     * Allowed values:
    +     * "": The empty string (default) uses a system-chosen default
    +     * which may change over time.
    +     *
    +     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +     * version of dlmalloc.
    +     * 
    + * + * string allocator_type = 2; + * @return The bytes for allocatorType. + */ + public com.google.protobuf.ByteString + getAllocatorTypeBytes() { + java.lang.Object ref = allocatorType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The type of GPU allocation strategy to use.
    +     *
    +     * Allowed values:
    +     * "": The empty string (default) uses a system-chosen default
    +     * which may change over time.
    +     *
    +     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +     * version of dlmalloc.
    +     * 
    + * + * string allocator_type = 2; + * @param value The allocatorType to set. + * @return This builder for chaining. + */ + public Builder setAllocatorType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The type of GPU allocation strategy to use.
    +     *
    +     * Allowed values:
    +     * "": The empty string (default) uses a system-chosen default
    +     * which may change over time.
    +     *
    +     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +     * version of dlmalloc.
    +     * 
    + * + * string allocator_type = 2; + * @return This builder for chaining. + */ + public Builder clearAllocatorType() { + allocatorType_ = getDefaultInstance().getAllocatorType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * The type of GPU allocation strategy to use.
    +     *
    +     * Allowed values:
    +     * "": The empty string (default) uses a system-chosen default
    +     * which may change over time.
    +     *
    +     * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +     * version of dlmalloc.
    +     * 
    + * + * string allocator_type = 2; + * @param value The bytes for allocatorType to set. + * @return This builder for chaining. + */ + public Builder setAllocatorTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long deferredDeletionBytes_ ; + /** + *
    +     * Delay deletion of up to this many bytes to reduce the number of
    +     * interactions with gpu driver code.  If 0, the system chooses
    +     * a reasonable default (several MBs).
    +     * 
    + * + * int64 deferred_deletion_bytes = 3; + * @return The deferredDeletionBytes. + */ + @java.lang.Override + public long getDeferredDeletionBytes() { + return deferredDeletionBytes_; + } + /** + *
    +     * Delay deletion of up to this many bytes to reduce the number of
    +     * interactions with gpu driver code.  If 0, the system chooses
    +     * a reasonable default (several MBs).
    +     * 
    + * + * int64 deferred_deletion_bytes = 3; + * @param value The deferredDeletionBytes to set. + * @return This builder for chaining. + */ + public Builder setDeferredDeletionBytes(long value) { + + deferredDeletionBytes_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Delay deletion of up to this many bytes to reduce the number of
    +     * interactions with gpu driver code.  If 0, the system chooses
    +     * a reasonable default (several MBs).
    +     * 
    + * + * int64 deferred_deletion_bytes = 3; + * @return This builder for chaining. + */ + public Builder clearDeferredDeletionBytes() { + bitField0_ = (bitField0_ & ~0x00000008); + deferredDeletionBytes_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object visibleDeviceList_ = ""; + /** + *
    +     * A comma-separated list of GPU ids that determines the 'visible'
    +     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +     * can see 8 GPU devices in the process, and one wanted to map
    +     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +     * then one would specify this field as "5,3".  This field is similar in
    +     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +     * it applies to the visible GPU devices in the process.
    +     *
    +     * NOTE:
    +     * 1. The GPU driver provides the process with the visible GPUs
    +     * in an order which is not guaranteed to have any correlation to
    +     * the *physical* GPU id in the machine.  This field is used for
    +     * remapping "visible" to "virtual", which means this operates only
    +     * after the process starts.  Users are required to use vendor
    +     * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +     * physical to visible device mapping prior to invoking TensorFlow.
    +     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +     * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +     * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +     * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +     * for more information.
    +     * 3. The visible_device_list is also used for PluggableDevice. And
    +     * different types of PluggableDevices share this field. In that case,
    +     * the pluggable_device_type is used to distinguish them, making the
    +     * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +     * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +     * 
    + * + * string visible_device_list = 5; + * @return The visibleDeviceList. + */ + public java.lang.String getVisibleDeviceList() { + java.lang.Object ref = visibleDeviceList_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + visibleDeviceList_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A comma-separated list of GPU ids that determines the 'visible'
    +     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +     * can see 8 GPU devices in the process, and one wanted to map
    +     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +     * then one would specify this field as "5,3".  This field is similar in
    +     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +     * it applies to the visible GPU devices in the process.
    +     *
    +     * NOTE:
    +     * 1. The GPU driver provides the process with the visible GPUs
    +     * in an order which is not guaranteed to have any correlation to
    +     * the *physical* GPU id in the machine.  This field is used for
    +     * remapping "visible" to "virtual", which means this operates only
    +     * after the process starts.  Users are required to use vendor
    +     * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +     * physical to visible device mapping prior to invoking TensorFlow.
    +     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +     * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +     * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +     * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +     * for more information.
    +     * 3. The visible_device_list is also used for PluggableDevice. And
    +     * different types of PluggableDevices share this field. In that case,
    +     * the pluggable_device_type is used to distinguish them, making the
    +     * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +     * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +     * 
    + * + * string visible_device_list = 5; + * @return The bytes for visibleDeviceList. + */ + public com.google.protobuf.ByteString + getVisibleDeviceListBytes() { + java.lang.Object ref = visibleDeviceList_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + visibleDeviceList_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A comma-separated list of GPU ids that determines the 'visible'
    +     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +     * can see 8 GPU devices in the process, and one wanted to map
    +     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +     * then one would specify this field as "5,3".  This field is similar in
    +     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +     * it applies to the visible GPU devices in the process.
    +     *
    +     * NOTE:
    +     * 1. The GPU driver provides the process with the visible GPUs
    +     * in an order which is not guaranteed to have any correlation to
    +     * the *physical* GPU id in the machine.  This field is used for
    +     * remapping "visible" to "virtual", which means this operates only
    +     * after the process starts.  Users are required to use vendor
    +     * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +     * physical to visible device mapping prior to invoking TensorFlow.
    +     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +     * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +     * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +     * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +     * for more information.
    +     * 3. The visible_device_list is also used for PluggableDevice. And
    +     * different types of PluggableDevices share this field. In that case,
    +     * the pluggable_device_type is used to distinguish them, making the
    +     * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +     * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +     * 
    + * + * string visible_device_list = 5; + * @param value The visibleDeviceList to set. + * @return This builder for chaining. + */ + public Builder setVisibleDeviceList( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + visibleDeviceList_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * A comma-separated list of GPU ids that determines the 'visible'
    +     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +     * can see 8 GPU devices in the process, and one wanted to map
    +     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +     * then one would specify this field as "5,3".  This field is similar in
    +     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +     * it applies to the visible GPU devices in the process.
    +     *
    +     * NOTE:
    +     * 1. The GPU driver provides the process with the visible GPUs
    +     * in an order which is not guaranteed to have any correlation to
    +     * the *physical* GPU id in the machine.  This field is used for
    +     * remapping "visible" to "virtual", which means this operates only
    +     * after the process starts.  Users are required to use vendor
    +     * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +     * physical to visible device mapping prior to invoking TensorFlow.
    +     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +     * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +     * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +     * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +     * for more information.
    +     * 3. The visible_device_list is also used for PluggableDevice. And
    +     * different types of PluggableDevices share this field. In that case,
    +     * the pluggable_device_type is used to distinguish them, making the
    +     * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +     * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +     * 
    + * + * string visible_device_list = 5; + * @return This builder for chaining. + */ + public Builder clearVisibleDeviceList() { + visibleDeviceList_ = getDefaultInstance().getVisibleDeviceList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * A comma-separated list of GPU ids that determines the 'visible'
    +     * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +     * can see 8 GPU devices in the process, and one wanted to map
    +     * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +     * then one would specify this field as "5,3".  This field is similar in
    +     * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +     * it applies to the visible GPU devices in the process.
    +     *
    +     * NOTE:
    +     * 1. The GPU driver provides the process with the visible GPUs
    +     * in an order which is not guaranteed to have any correlation to
    +     * the *physical* GPU id in the machine.  This field is used for
    +     * remapping "visible" to "virtual", which means this operates only
    +     * after the process starts.  Users are required to use vendor
    +     * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +     * physical to visible device mapping prior to invoking TensorFlow.
    +     * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +     * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +     * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +     * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +     * for more information.
    +     * 3. The visible_device_list is also used for PluggableDevice. And
    +     * different types of PluggableDevices share this field. In that case,
    +     * the pluggable_device_type is used to distinguish them, making the
    +     * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +     * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +     * 
    + * + * string visible_device_list = 5; + * @param value The bytes for visibleDeviceList to set. + * @return This builder for chaining. + */ + public Builder setVisibleDeviceListBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + visibleDeviceList_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int pollingActiveDelayUsecs_ ; + /** + *
    +     * In the event polling loop sleep this many microseconds between
    +     * PollEvents calls, when the queue is not empty.  If value is not
    +     * set or set to 0, gets set to a non-zero default.
    +     * 
    + * + * int32 polling_active_delay_usecs = 6; + * @return The pollingActiveDelayUsecs. + */ + @java.lang.Override + public int getPollingActiveDelayUsecs() { + return pollingActiveDelayUsecs_; + } + /** + *
    +     * In the event polling loop sleep this many microseconds between
    +     * PollEvents calls, when the queue is not empty.  If value is not
    +     * set or set to 0, gets set to a non-zero default.
    +     * 
    + * + * int32 polling_active_delay_usecs = 6; + * @param value The pollingActiveDelayUsecs to set. + * @return This builder for chaining. + */ + public Builder setPollingActiveDelayUsecs(int value) { + + pollingActiveDelayUsecs_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * In the event polling loop sleep this many microseconds between
    +     * PollEvents calls, when the queue is not empty.  If value is not
    +     * set or set to 0, gets set to a non-zero default.
    +     * 
    + * + * int32 polling_active_delay_usecs = 6; + * @return This builder for chaining. + */ + public Builder clearPollingActiveDelayUsecs() { + bitField0_ = (bitField0_ & ~0x00000020); + pollingActiveDelayUsecs_ = 0; + onChanged(); + return this; + } + + private int pollingInactiveDelayMsecs_ ; + /** + *
    +     * This field is deprecated and ignored.
    +     * 
    + * + * int32 polling_inactive_delay_msecs = 7; + * @return The pollingInactiveDelayMsecs. + */ + @java.lang.Override + public int getPollingInactiveDelayMsecs() { + return pollingInactiveDelayMsecs_; + } + /** + *
    +     * This field is deprecated and ignored.
    +     * 
    + * + * int32 polling_inactive_delay_msecs = 7; + * @param value The pollingInactiveDelayMsecs to set. + * @return This builder for chaining. + */ + public Builder setPollingInactiveDelayMsecs(int value) { + + pollingInactiveDelayMsecs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * This field is deprecated and ignored.
    +     * 
    + * + * int32 polling_inactive_delay_msecs = 7; + * @return This builder for chaining. + */ + public Builder clearPollingInactiveDelayMsecs() { + bitField0_ = (bitField0_ & ~0x00000040); + pollingInactiveDelayMsecs_ = 0; + onChanged(); + return this; + } + + private boolean forceGpuCompatible_ ; + /** + *
    +     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    +     * enabling this option forces all CPU tensors to be allocated with Cuda
    +     * pinned memory. Normally, TensorFlow will infer which tensors should be
    +     * allocated as the pinned memory. But in case where the inference is
    +     * incomplete, this option can significantly speed up the cross-device memory
    +     * copy performance as long as it fits the memory.
    +     * Note that this option is not something that should be
    +     * enabled by default for unknown or very large models, since all Cuda pinned
    +     * memory is unpageable, having too much pinned memory might negatively impact
    +     * the overall host system performance.
    +     * 
    + * + * bool force_gpu_compatible = 8; + * @return The forceGpuCompatible. + */ + @java.lang.Override + public boolean getForceGpuCompatible() { + return forceGpuCompatible_; + } + /** + *
    +     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    +     * enabling this option forces all CPU tensors to be allocated with Cuda
    +     * pinned memory. Normally, TensorFlow will infer which tensors should be
    +     * allocated as the pinned memory. But in case where the inference is
    +     * incomplete, this option can significantly speed up the cross-device memory
    +     * copy performance as long as it fits the memory.
    +     * Note that this option is not something that should be
    +     * enabled by default for unknown or very large models, since all Cuda pinned
    +     * memory is unpageable, having too much pinned memory might negatively impact
    +     * the overall host system performance.
    +     * 
    + * + * bool force_gpu_compatible = 8; + * @param value The forceGpuCompatible to set. + * @return This builder for chaining. + */ + public Builder setForceGpuCompatible(boolean value) { + + forceGpuCompatible_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    +     * enabling this option forces all CPU tensors to be allocated with Cuda
    +     * pinned memory. Normally, TensorFlow will infer which tensors should be
    +     * allocated as the pinned memory. But in case where the inference is
    +     * incomplete, this option can significantly speed up the cross-device memory
    +     * copy performance as long as it fits the memory.
    +     * Note that this option is not something that should be
    +     * enabled by default for unknown or very large models, since all Cuda pinned
    +     * memory is unpageable, having too much pinned memory might negatively impact
    +     * the overall host system performance.
    +     * 
    + * + * bool force_gpu_compatible = 8; + * @return This builder for chaining. + */ + public Builder clearForceGpuCompatible() { + bitField0_ = (bitField0_ & ~0x00000080); + forceGpuCompatible_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.GPUOptions.Experimental experimental_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental, org.tensorflow.proto.GPUOptions.Experimental.Builder, org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder> experimentalBuilder_; + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return Whether the experimental field is set. + */ + public boolean hasExperimental() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return The experimental. + */ + public org.tensorflow.proto.GPUOptions.Experimental getExperimental() { + if (experimentalBuilder_ == null) { + return experimental_ == null ? org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance() : experimental_; + } else { + return experimentalBuilder_.getMessage(); + } + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public Builder setExperimental(org.tensorflow.proto.GPUOptions.Experimental value) { + if (experimentalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimental_ = value; + } else { + experimentalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public Builder setExperimental( + org.tensorflow.proto.GPUOptions.Experimental.Builder builderForValue) { + if (experimentalBuilder_ == null) { + experimental_ = builderForValue.build(); + } else { + experimentalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public Builder mergeExperimental(org.tensorflow.proto.GPUOptions.Experimental value) { + if (experimentalBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + experimental_ != null && + experimental_ != org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance()) { + getExperimentalBuilder().mergeFrom(value); + } else { + experimental_ = value; + } + } else { + experimentalBuilder_.mergeFrom(value); + } + if (experimental_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public Builder clearExperimental() { + bitField0_ = (bitField0_ & ~0x00000100); + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public org.tensorflow.proto.GPUOptions.Experimental.Builder getExperimentalBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getExperimentalFieldBuilder().getBuilder(); + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + public org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { + if (experimentalBuilder_ != null) { + return experimentalBuilder_.getMessageOrBuilder(); + } else { + return experimental_ == null ? + org.tensorflow.proto.GPUOptions.Experimental.getDefaultInstance() : experimental_; + } + } + /** + *
    +     * Everything inside experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/versions.
    +     * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental, org.tensorflow.proto.GPUOptions.Experimental.Builder, org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder> + getExperimentalFieldBuilder() { + if (experimentalBuilder_ == null) { + experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GPUOptions.Experimental, org.tensorflow.proto.GPUOptions.Experimental.Builder, org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder>( + getExperimental(), + getParentForChildren(), + isClean()); + experimental_ = null; + } + return experimentalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GPUOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GPUOptions) + private static final org.tensorflow.proto.GPUOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GPUOptions(); + } + + public static org.tensorflow.proto.GPUOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GPUOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GPUOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptionsOrBuilder.java new file mode 100644 index 00000000000..a1d86d2d9c9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GPUOptionsOrBuilder.java @@ -0,0 +1,238 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GPUOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GPUOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Fraction of the total GPU memory to allocate for each process.
    +   * 1 means to allocate all of the GPU memory, 0.5 means the process
    +   * allocates up to ~50% of the total GPU memory.
    +   *
    +   * GPU memory is pre-allocated unless the allow_growth option is enabled.
    +   *
    +   * If greater than 1.0, uses CUDA unified memory to potentially oversubscribe
    +   * the amount of memory available on the GPU device by using host memory as a
    +   * swap space. Accessing memory not available on the device will be
    +   * significantly slower as that would require memory transfer between the host
    +   * and the device. Options to reduce the memory requirement should be
    +   * considered before enabling this option as this may come with a negative
    +   * performance impact. Oversubscription using the unified memory requires
    +   * Pascal class or newer GPUs and it is currently only supported on the Linux
    +   * operating system. See
    +   * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
    +   * for the detailed requirements.
    +   * 
    + * + * double per_process_gpu_memory_fraction = 1; + * @return The perProcessGpuMemoryFraction. + */ + double getPerProcessGpuMemoryFraction(); + + /** + *
    +   * If true, the allocator does not pre-allocate the entire specified
    +   * GPU memory region, instead starting small and growing as needed.
    +   * 
    + * + * bool allow_growth = 4; + * @return The allowGrowth. + */ + boolean getAllowGrowth(); + + /** + *
    +   * The type of GPU allocation strategy to use.
    +   *
    +   * Allowed values:
    +   * "": The empty string (default) uses a system-chosen default
    +   * which may change over time.
    +   *
    +   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +   * version of dlmalloc.
    +   * 
    + * + * string allocator_type = 2; + * @return The allocatorType. + */ + java.lang.String getAllocatorType(); + /** + *
    +   * The type of GPU allocation strategy to use.
    +   *
    +   * Allowed values:
    +   * "": The empty string (default) uses a system-chosen default
    +   * which may change over time.
    +   *
    +   * "BFC": A "Best-fit with coalescing" algorithm, simplified from a
    +   * version of dlmalloc.
    +   * 
    + * + * string allocator_type = 2; + * @return The bytes for allocatorType. + */ + com.google.protobuf.ByteString + getAllocatorTypeBytes(); + + /** + *
    +   * Delay deletion of up to this many bytes to reduce the number of
    +   * interactions with gpu driver code.  If 0, the system chooses
    +   * a reasonable default (several MBs).
    +   * 
    + * + * int64 deferred_deletion_bytes = 3; + * @return The deferredDeletionBytes. + */ + long getDeferredDeletionBytes(); + + /** + *
    +   * A comma-separated list of GPU ids that determines the 'visible'
    +   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +   * can see 8 GPU devices in the process, and one wanted to map
    +   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +   * then one would specify this field as "5,3".  This field is similar in
    +   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +   * it applies to the visible GPU devices in the process.
    +   *
    +   * NOTE:
    +   * 1. The GPU driver provides the process with the visible GPUs
    +   * in an order which is not guaranteed to have any correlation to
    +   * the *physical* GPU id in the machine.  This field is used for
    +   * remapping "visible" to "virtual", which means this operates only
    +   * after the process starts.  Users are required to use vendor
    +   * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +   * physical to visible device mapping prior to invoking TensorFlow.
    +   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +   * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +   * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +   * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +   * for more information.
    +   * 3. The visible_device_list is also used for PluggableDevice. And
    +   * different types of PluggableDevices share this field. In that case,
    +   * the pluggable_device_type is used to distinguish them, making the
    +   * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +   * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +   * 
    + * + * string visible_device_list = 5; + * @return The visibleDeviceList. + */ + java.lang.String getVisibleDeviceList(); + /** + *
    +   * A comma-separated list of GPU ids that determines the 'visible'
    +   * to 'virtual' mapping of GPU devices.  For example, if TensorFlow
    +   * can see 8 GPU devices in the process, and one wanted to map
    +   * visible GPU devices 5 and 3 as "/device:GPU:0", and "/device:GPU:1",
    +   * then one would specify this field as "5,3".  This field is similar in
    +   * spirit to the CUDA_VISIBLE_DEVICES environment variable, except
    +   * it applies to the visible GPU devices in the process.
    +   *
    +   * NOTE:
    +   * 1. The GPU driver provides the process with the visible GPUs
    +   * in an order which is not guaranteed to have any correlation to
    +   * the *physical* GPU id in the machine.  This field is used for
    +   * remapping "visible" to "virtual", which means this operates only
    +   * after the process starts.  Users are required to use vendor
    +   * specific mechanisms (e.g., CUDA_VISIBLE_DEVICES) to control the
    +   * physical to visible device mapping prior to invoking TensorFlow.
    +   * 2. In the code, the ids in this list are also called "platform GPU id"s,
    +   * and the 'virtual' ids of GPU devices (i.e. the ids in the device
    +   * name "/device:GPU:<id>") are also called "TF GPU id"s. Please
    +   * refer to third_party/tensorflow/core/common_runtime/gpu/gpu_id.h
    +   * for more information.
    +   * 3. The visible_device_list is also used for PluggableDevice. And
    +   * different types of PluggableDevices share this field. In that case,
    +   * the pluggable_device_type is used to distinguish them, making the
    +   * visible_device_list a list of <pluggable_device_type>:<device_index>,
    +   * e.g. "PluggableDeviceA:0,PluggableDeviceA:1,PluggableDeviceB:0".
    +   * 
    + * + * string visible_device_list = 5; + * @return The bytes for visibleDeviceList. + */ + com.google.protobuf.ByteString + getVisibleDeviceListBytes(); + + /** + *
    +   * In the event polling loop sleep this many microseconds between
    +   * PollEvents calls, when the queue is not empty.  If value is not
    +   * set or set to 0, gets set to a non-zero default.
    +   * 
    + * + * int32 polling_active_delay_usecs = 6; + * @return The pollingActiveDelayUsecs. + */ + int getPollingActiveDelayUsecs(); + + /** + *
    +   * This field is deprecated and ignored.
    +   * 
    + * + * int32 polling_inactive_delay_msecs = 7; + * @return The pollingInactiveDelayMsecs. + */ + int getPollingInactiveDelayMsecs(); + + /** + *
    +   * Force all tensors to be gpu_compatible. On a GPU-enabled TensorFlow,
    +   * enabling this option forces all CPU tensors to be allocated with Cuda
    +   * pinned memory. Normally, TensorFlow will infer which tensors should be
    +   * allocated as the pinned memory. But in case where the inference is
    +   * incomplete, this option can significantly speed up the cross-device memory
    +   * copy performance as long as it fits the memory.
    +   * Note that this option is not something that should be
    +   * enabled by default for unknown or very large models, since all Cuda pinned
    +   * memory is unpageable, having too much pinned memory might negatively impact
    +   * the overall host system performance.
    +   * 
    + * + * bool force_gpu_compatible = 8; + * @return The forceGpuCompatible. + */ + boolean getForceGpuCompatible(); + + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return Whether the experimental field is set. + */ + boolean hasExperimental(); + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + * @return The experimental. + */ + org.tensorflow.proto.GPUOptions.Experimental getExperimental(); + /** + *
    +   * Everything inside experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/versions.
    +   * 
    + * + * .tensorflow.GPUOptions.Experimental experimental = 9; + */ + org.tensorflow.proto.GPUOptions.ExperimentalOrBuilder getExperimentalOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDef.java new file mode 100644 index 00000000000..c7c4781cb88 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDef.java @@ -0,0 +1,735 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * GradientDef defines the gradient function of a function defined in
    + * a function library.
    + *
    + * A gradient function g (specified by gradient_func) for a function f
    + * (specified by function_name) must follow the following:
    + *
    + * The function 'f' must be a numerical function which takes N inputs
    + * and produces M outputs. Its gradient function 'g', which is a
    + * function taking N + M inputs and produces N outputs.
    + *
    + * I.e. if we have
    + * (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
    + * then, g is
    + * (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
    + * dL/dy1, dL/dy2, ..., dL/dy_M),
    + * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
    + * loss function). dL/dx_i is the partial derivative of L with respect
    + * to x_i.
    + * 
    + * + * Protobuf type {@code tensorflow.GradientDef} + */ +public final class GradientDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GradientDef) + GradientDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GradientDef.class.getName()); + } + // Use GradientDef.newBuilder() to construct. + private GradientDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GradientDef() { + functionName_ = ""; + gradientFunc_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_GradientDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GradientDef.class, org.tensorflow.proto.GradientDef.Builder.class); + } + + public static final int FUNCTION_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object functionName_ = ""; + /** + *
    +   * The function name.
    +   * 
    + * + * string function_name = 1; + * @return The functionName. + */ + @java.lang.Override + public java.lang.String getFunctionName() { + java.lang.Object ref = functionName_; + 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(); + functionName_ = s; + return s; + } + } + /** + *
    +   * The function name.
    +   * 
    + * + * string function_name = 1; + * @return The bytes for functionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFunctionNameBytes() { + java.lang.Object ref = functionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + functionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRADIENT_FUNC_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object gradientFunc_ = ""; + /** + *
    +   * The gradient function's name.
    +   * 
    + * + * string gradient_func = 2; + * @return The gradientFunc. + */ + @java.lang.Override + public java.lang.String getGradientFunc() { + java.lang.Object ref = gradientFunc_; + 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(); + gradientFunc_ = s; + return s; + } + } + /** + *
    +   * The gradient function's name.
    +   * 
    + * + * string gradient_func = 2; + * @return The bytes for gradientFunc. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGradientFuncBytes() { + java.lang.Object ref = gradientFunc_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradientFunc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(functionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, functionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gradientFunc_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, gradientFunc_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(functionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, functionName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gradientFunc_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, gradientFunc_); + } + size += getUnknownFields().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.GradientDef)) { + return super.equals(obj); + } + org.tensorflow.proto.GradientDef other = (org.tensorflow.proto.GradientDef) obj; + + if (!getFunctionName() + .equals(other.getFunctionName())) return false; + if (!getGradientFunc() + .equals(other.getGradientFunc())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FUNCTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFunctionName().hashCode(); + hash = (37 * hash) + GRADIENT_FUNC_FIELD_NUMBER; + hash = (53 * hash) + getGradientFunc().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GradientDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GradientDef 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.GradientDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GradientDef 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.GradientDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GradientDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GradientDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GradientDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GradientDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GradientDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GradientDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GradientDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GradientDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * GradientDef defines the gradient function of a function defined in
    +   * a function library.
    +   *
    +   * A gradient function g (specified by gradient_func) for a function f
    +   * (specified by function_name) must follow the following:
    +   *
    +   * The function 'f' must be a numerical function which takes N inputs
    +   * and produces M outputs. Its gradient function 'g', which is a
    +   * function taking N + M inputs and produces N outputs.
    +   *
    +   * I.e. if we have
    +   * (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
    +   * then, g is
    +   * (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
    +   * dL/dy1, dL/dy2, ..., dL/dy_M),
    +   * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
    +   * loss function). dL/dx_i is the partial derivative of L with respect
    +   * to x_i.
    +   * 
    + * + * Protobuf type {@code tensorflow.GradientDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GradientDef) + org.tensorflow.proto.GradientDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_GradientDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GradientDef.class, org.tensorflow.proto.GradientDef.Builder.class); + } + + // Construct using org.tensorflow.proto.GradientDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + functionName_ = ""; + gradientFunc_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_GradientDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GradientDef getDefaultInstanceForType() { + return org.tensorflow.proto.GradientDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GradientDef build() { + org.tensorflow.proto.GradientDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GradientDef buildPartial() { + org.tensorflow.proto.GradientDef result = new org.tensorflow.proto.GradientDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GradientDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.functionName_ = functionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.gradientFunc_ = gradientFunc_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GradientDef) { + return mergeFrom((org.tensorflow.proto.GradientDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GradientDef other) { + if (other == org.tensorflow.proto.GradientDef.getDefaultInstance()) return this; + if (!other.getFunctionName().isEmpty()) { + functionName_ = other.functionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getGradientFunc().isEmpty()) { + gradientFunc_ = other.gradientFunc_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + functionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + gradientFunc_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object functionName_ = ""; + /** + *
    +     * The function name.
    +     * 
    + * + * string function_name = 1; + * @return The functionName. + */ + public java.lang.String getFunctionName() { + java.lang.Object ref = functionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The function name.
    +     * 
    + * + * string function_name = 1; + * @return The bytes for functionName. + */ + public com.google.protobuf.ByteString + getFunctionNameBytes() { + java.lang.Object ref = functionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + functionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The function name.
    +     * 
    + * + * string function_name = 1; + * @param value The functionName to set. + * @return This builder for chaining. + */ + public Builder setFunctionName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + functionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The function name.
    +     * 
    + * + * string function_name = 1; + * @return This builder for chaining. + */ + public Builder clearFunctionName() { + functionName_ = getDefaultInstance().getFunctionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The function name.
    +     * 
    + * + * string function_name = 1; + * @param value The bytes for functionName to set. + * @return This builder for chaining. + */ + public Builder setFunctionNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + functionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object gradientFunc_ = ""; + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 2; + * @return The gradientFunc. + */ + public java.lang.String getGradientFunc() { + java.lang.Object ref = gradientFunc_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradientFunc_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 2; + * @return The bytes for gradientFunc. + */ + public com.google.protobuf.ByteString + getGradientFuncBytes() { + java.lang.Object ref = gradientFunc_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradientFunc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 2; + * @param value The gradientFunc to set. + * @return This builder for chaining. + */ + public Builder setGradientFunc( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + gradientFunc_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 2; + * @return This builder for chaining. + */ + public Builder clearGradientFunc() { + gradientFunc_ = getDefaultInstance().getGradientFunc(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 2; + * @param value The bytes for gradientFunc to set. + * @return This builder for chaining. + */ + public Builder setGradientFuncBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + gradientFunc_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GradientDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GradientDef) + private static final org.tensorflow.proto.GradientDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GradientDef(); + } + + public static org.tensorflow.proto.GradientDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GradientDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GradientDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDefOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDefOrBuilder.java index 9437941de35..4d6181be00b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GradientDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GradientDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface GradientDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GradientDef) @@ -13,6 +15,7 @@ public interface GradientDefOrBuilder extends *
    * * string function_name = 1; + * @return The functionName. */ java.lang.String getFunctionName(); /** @@ -21,6 +24,7 @@ public interface GradientDefOrBuilder extends *
    * * string function_name = 1; + * @return The bytes for functionName. */ com.google.protobuf.ByteString getFunctionNameBytes(); @@ -31,6 +35,7 @@ public interface GradientDefOrBuilder extends *
    * * string gradient_func = 2; + * @return The gradientFunc. */ java.lang.String getGradientFunc(); /** @@ -39,6 +44,7 @@ public interface GradientDefOrBuilder extends *
    * * string gradient_func = 2; + * @return The bytes for gradientFunc. */ com.google.protobuf.ByteString getGradientFuncBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfo.java new file mode 100644 index 00000000000..0c193e2f6eb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfo.java @@ -0,0 +1,4280 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_debug_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphDebugInfo} + */ +public final class GraphDebugInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo) + GraphDebugInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphDebugInfo.class.getName()); + } + // Use GraphDebugInfo.newBuilder() to construct. + private GraphDebugInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphDebugInfo() { + files_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetFramesById(); + case 6: + return internalGetTracesById(); + case 2: + return internalGetTraces(); + case 5: + return internalGetNameToTraceId(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.class, org.tensorflow.proto.GraphDebugInfo.Builder.class); + } + + public interface FileLineColOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo.FileLineCol) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * File name index, which can be used to retrieve the file name string from
    +     * `files`. The value should be between 0 and (len(files)-1)
    +     * 
    + * + * optional int32 file_index = 1; + * @return Whether the fileIndex field is set. + */ + boolean hasFileIndex(); + /** + *
    +     * File name index, which can be used to retrieve the file name string from
    +     * `files`. The value should be between 0 and (len(files)-1)
    +     * 
    + * + * optional int32 file_index = 1; + * @return The fileIndex. + */ + int getFileIndex(); + + /** + *
    +     * Line number in the file.
    +     * 
    + * + * optional int32 line = 2; + * @return Whether the line field is set. + */ + boolean hasLine(); + /** + *
    +     * Line number in the file.
    +     * 
    + * + * optional int32 line = 2; + * @return The line. + */ + int getLine(); + + /** + *
    +     * Col number in the file line.
    +     * 
    + * + * optional int32 col = 3; + * @return Whether the col field is set. + */ + boolean hasCol(); + /** + *
    +     * Col number in the file line.
    +     * 
    + * + * optional int32 col = 3; + * @return The col. + */ + int getCol(); + + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return Whether the func field is set. + */ + boolean hasFunc(); + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return The func. + */ + java.lang.String getFunc(); + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return The bytes for func. + */ + com.google.protobuf.ByteString + getFuncBytes(); + + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return Whether the code field is set. + */ + boolean hasCode(); + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return The code. + */ + java.lang.String getCode(); + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return The bytes for code. + */ + com.google.protobuf.ByteString + getCodeBytes(); + } + /** + *
    +   * This represents a file/line location in the source code.
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphDebugInfo.FileLineCol} + */ + public static final class FileLineCol extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo.FileLineCol) + FileLineColOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FileLineCol.class.getName()); + } + // Use FileLineCol.newBuilder() to construct. + private FileLineCol(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FileLineCol() { + func_ = ""; + code_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.class, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder.class); + } + + private int bitField0_; + public static final int FILE_INDEX_FIELD_NUMBER = 1; + private int fileIndex_ = 0; + /** + *
    +     * File name index, which can be used to retrieve the file name string from
    +     * `files`. The value should be between 0 and (len(files)-1)
    +     * 
    + * + * optional int32 file_index = 1; + * @return Whether the fileIndex field is set. + */ + @java.lang.Override + public boolean hasFileIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * File name index, which can be used to retrieve the file name string from
    +     * `files`. The value should be between 0 and (len(files)-1)
    +     * 
    + * + * optional int32 file_index = 1; + * @return The fileIndex. + */ + @java.lang.Override + public int getFileIndex() { + return fileIndex_; + } + + public static final int LINE_FIELD_NUMBER = 2; + private int line_ = 0; + /** + *
    +     * Line number in the file.
    +     * 
    + * + * optional int32 line = 2; + * @return Whether the line field is set. + */ + @java.lang.Override + public boolean hasLine() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Line number in the file.
    +     * 
    + * + * optional int32 line = 2; + * @return The line. + */ + @java.lang.Override + public int getLine() { + return line_; + } + + public static final int COL_FIELD_NUMBER = 3; + private int col_ = 0; + /** + *
    +     * Col number in the file line.
    +     * 
    + * + * optional int32 col = 3; + * @return Whether the col field is set. + */ + @java.lang.Override + public boolean hasCol() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Col number in the file line.
    +     * 
    + * + * optional int32 col = 3; + * @return The col. + */ + @java.lang.Override + public int getCol() { + return col_; + } + + public static final int FUNC_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object func_ = ""; + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return Whether the func field is set. + */ + @java.lang.Override + public boolean hasFunc() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return The func. + */ + @java.lang.Override + public java.lang.String getFunc() { + java.lang.Object ref = func_; + 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(); + if (bs.isValidUtf8()) { + func_ = s; + } + return s; + } + } + /** + *
    +     * Name of function contains the file line.
    +     * 
    + * + * optional string func = 4; + * @return The bytes for func. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFuncBytes() { + java.lang.Object ref = func_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + func_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return Whether the code field is set. + */ + @java.lang.Override + public boolean hasCode() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return The code. + */ + @java.lang.Override + public java.lang.String getCode() { + java.lang.Object ref = code_; + 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(); + if (bs.isValidUtf8()) { + code_ = s; + } + return s; + } + } + /** + *
    +     * Source code contained in this file line.
    +     * 
    + * + * optional string code = 5; + * @return The bytes for code. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, fileIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, line_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, col_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, func_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, code_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, fileIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, line_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, col_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, func_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, code_); + } + size += getUnknownFields().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.GraphDebugInfo.FileLineCol)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphDebugInfo.FileLineCol other = (org.tensorflow.proto.GraphDebugInfo.FileLineCol) obj; + + if (hasFileIndex() != other.hasFileIndex()) return false; + if (hasFileIndex()) { + if (getFileIndex() + != other.getFileIndex()) return false; + } + if (hasLine() != other.hasLine()) return false; + if (hasLine()) { + if (getLine() + != other.getLine()) return false; + } + if (hasCol() != other.hasCol()) return false; + if (hasCol()) { + if (getCol() + != other.getCol()) return false; + } + if (hasFunc() != other.hasFunc()) return false; + if (hasFunc()) { + if (!getFunc() + .equals(other.getFunc())) return false; + } + if (hasCode() != other.hasCode()) return false; + if (hasCode()) { + if (!getCode() + .equals(other.getCode())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFileIndex()) { + hash = (37 * hash) + FILE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getFileIndex(); + } + if (hasLine()) { + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + getLine(); + } + if (hasCol()) { + hash = (37 * hash) + COL_FIELD_NUMBER; + hash = (53 * hash) + getCol(); + } + if (hasFunc()) { + hash = (37 * hash) + FUNC_FIELD_NUMBER; + hash = (53 * hash) + getFunc().hashCode(); + } + if (hasCode()) { + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol 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.GraphDebugInfo.FileLineCol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphDebugInfo.FileLineCol 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * This represents a file/line location in the source code.
    +     * 
    + * + * Protobuf type {@code tensorflow.GraphDebugInfo.FileLineCol} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo.FileLineCol) + org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.class, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphDebugInfo.FileLineCol.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fileIndex_ = 0; + line_ = 0; + col_ = 0; + func_ = ""; + code_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getDefaultInstanceForType() { + return org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol build() { + org.tensorflow.proto.GraphDebugInfo.FileLineCol result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol buildPartial() { + org.tensorflow.proto.GraphDebugInfo.FileLineCol result = new org.tensorflow.proto.GraphDebugInfo.FileLineCol(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphDebugInfo.FileLineCol result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fileIndex_ = fileIndex_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.line_ = line_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.col_ = col_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.func_ = func_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.code_ = code_; + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphDebugInfo.FileLineCol) { + return mergeFrom((org.tensorflow.proto.GraphDebugInfo.FileLineCol)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphDebugInfo.FileLineCol other) { + if (other == org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance()) return this; + if (other.hasFileIndex()) { + setFileIndex(other.getFileIndex()); + } + if (other.hasLine()) { + setLine(other.getLine()); + } + if (other.hasCol()) { + setCol(other.getCol()); + } + if (other.hasFunc()) { + func_ = other.func_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCode()) { + code_ = other.code_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + fileIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + line_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + col_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + func_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + code_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int fileIndex_ ; + /** + *
    +       * File name index, which can be used to retrieve the file name string from
    +       * `files`. The value should be between 0 and (len(files)-1)
    +       * 
    + * + * optional int32 file_index = 1; + * @return Whether the fileIndex field is set. + */ + @java.lang.Override + public boolean hasFileIndex() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * File name index, which can be used to retrieve the file name string from
    +       * `files`. The value should be between 0 and (len(files)-1)
    +       * 
    + * + * optional int32 file_index = 1; + * @return The fileIndex. + */ + @java.lang.Override + public int getFileIndex() { + return fileIndex_; + } + /** + *
    +       * File name index, which can be used to retrieve the file name string from
    +       * `files`. The value should be between 0 and (len(files)-1)
    +       * 
    + * + * optional int32 file_index = 1; + * @param value The fileIndex to set. + * @return This builder for chaining. + */ + public Builder setFileIndex(int value) { + + fileIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * File name index, which can be used to retrieve the file name string from
    +       * `files`. The value should be between 0 and (len(files)-1)
    +       * 
    + * + * optional int32 file_index = 1; + * @return This builder for chaining. + */ + public Builder clearFileIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + fileIndex_ = 0; + onChanged(); + return this; + } + + private int line_ ; + /** + *
    +       * Line number in the file.
    +       * 
    + * + * optional int32 line = 2; + * @return Whether the line field is set. + */ + @java.lang.Override + public boolean hasLine() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Line number in the file.
    +       * 
    + * + * optional int32 line = 2; + * @return The line. + */ + @java.lang.Override + public int getLine() { + return line_; + } + /** + *
    +       * Line number in the file.
    +       * 
    + * + * optional int32 line = 2; + * @param value The line to set. + * @return This builder for chaining. + */ + public Builder setLine(int value) { + + line_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Line number in the file.
    +       * 
    + * + * optional int32 line = 2; + * @return This builder for chaining. + */ + public Builder clearLine() { + bitField0_ = (bitField0_ & ~0x00000002); + line_ = 0; + onChanged(); + return this; + } + + private int col_ ; + /** + *
    +       * Col number in the file line.
    +       * 
    + * + * optional int32 col = 3; + * @return Whether the col field is set. + */ + @java.lang.Override + public boolean hasCol() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * Col number in the file line.
    +       * 
    + * + * optional int32 col = 3; + * @return The col. + */ + @java.lang.Override + public int getCol() { + return col_; + } + /** + *
    +       * Col number in the file line.
    +       * 
    + * + * optional int32 col = 3; + * @param value The col to set. + * @return This builder for chaining. + */ + public Builder setCol(int value) { + + col_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Col number in the file line.
    +       * 
    + * + * optional int32 col = 3; + * @return This builder for chaining. + */ + public Builder clearCol() { + bitField0_ = (bitField0_ & ~0x00000004); + col_ = 0; + onChanged(); + return this; + } + + private java.lang.Object func_ = ""; + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @return Whether the func field is set. + */ + public boolean hasFunc() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @return The func. + */ + public java.lang.String getFunc() { + java.lang.Object ref = func_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + func_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @return The bytes for func. + */ + public com.google.protobuf.ByteString + getFuncBytes() { + java.lang.Object ref = func_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + func_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @param value The func to set. + * @return This builder for chaining. + */ + public Builder setFunc( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + func_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @return This builder for chaining. + */ + public Builder clearFunc() { + func_ = getDefaultInstance().getFunc(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * Name of function contains the file line.
    +       * 
    + * + * optional string func = 4; + * @param value The bytes for func to set. + * @return This builder for chaining. + */ + public Builder setFuncBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + func_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @return Whether the code field is set. + */ + public boolean hasCode() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @return The code. + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + code_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @return The bytes for code. + */ + public com.google.protobuf.ByteString + getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + code_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * Source code contained in this file line.
    +       * 
    + * + * optional string code = 5; + * @param value The bytes for code to set. + * @return This builder for chaining. + */ + public Builder setCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + code_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphDebugInfo.FileLineCol) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo.FileLineCol) + private static final org.tensorflow.proto.GraphDebugInfo.FileLineCol DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphDebugInfo.FileLineCol(); + } + + public static org.tensorflow.proto.GraphDebugInfo.FileLineCol getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileLineCol parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphDebugInfo.FileLineCol getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StackTraceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo.StackTrace) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + java.util.List + getFileLineColsList(); + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCols(int index); + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + int getFileLineColsCount(); + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + java.util.List + getFileLineColsOrBuilderList(); + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( + int index); + + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return A list containing the frameId. + */ + java.util.List getFrameIdList(); + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return The count of frameId. + */ + int getFrameIdCount(); + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param index The index of the element to return. + * @return The frameId at the given index. + */ + long getFrameId(int index); + } + /** + *
    +   * This represents a stack trace which is a ordered list of `FileLineCol`.
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphDebugInfo.StackTrace} + */ + public static final class StackTrace extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphDebugInfo.StackTrace) + StackTraceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StackTrace.class.getName()); + } + // Use StackTrace.newBuilder() to construct. + private StackTrace(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StackTrace() { + fileLineCols_ = java.util.Collections.emptyList(); + frameId_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.StackTrace.class, org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder.class); + } + + public static final int FILE_LINE_COLS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List fileLineCols_; + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + @java.lang.Override + public java.util.List getFileLineColsList() { + return fileLineCols_; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + @java.lang.Override + public java.util.List + getFileLineColsOrBuilderList() { + return fileLineCols_; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + @java.lang.Override + public int getFileLineColsCount() { + return fileLineCols_.size(); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCols(int index) { + return fileLineCols_.get(index); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( + int index) { + return fileLineCols_.get(index); + } + + public static final int FRAME_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList frameId_ = + emptyLongList(); + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return A list containing the frameId. + */ + @java.lang.Override + public java.util.List + getFrameIdList() { + return frameId_; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return The count of frameId. + */ + public int getFrameIdCount() { + return frameId_.size(); + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param index The index of the element to return. + * @return The frameId at the given index. + */ + public long getFrameId(int index) { + return frameId_.getLong(index); + } + private int frameIdMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + for (int i = 0; i < fileLineCols_.size(); i++) { + output.writeMessage(1, fileLineCols_.get(i)); + } + if (getFrameIdList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(frameIdMemoizedSerializedSize); + } + for (int i = 0; i < frameId_.size(); i++) { + output.writeFixed64NoTag(frameId_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < fileLineCols_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, fileLineCols_.get(i)); + } + { + int dataSize = 0; + dataSize = 8 * getFrameIdList().size(); + size += dataSize; + if (!getFrameIdList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + frameIdMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.GraphDebugInfo.StackTrace)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphDebugInfo.StackTrace other = (org.tensorflow.proto.GraphDebugInfo.StackTrace) obj; + + if (!getFileLineColsList() + .equals(other.getFileLineColsList())) return false; + if (!getFrameIdList() + .equals(other.getFrameIdList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFileLineColsCount() > 0) { + hash = (37 * hash) + FILE_LINE_COLS_FIELD_NUMBER; + hash = (53 * hash) + getFileLineColsList().hashCode(); + } + if (getFrameIdCount() > 0) { + hash = (37 * hash) + FRAME_ID_FIELD_NUMBER; + hash = (53 * hash) + getFrameIdList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace 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.GraphDebugInfo.StackTrace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo.StackTrace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphDebugInfo.StackTrace 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * This represents a stack trace which is a ordered list of `FileLineCol`.
    +     * 
    + * + * Protobuf type {@code tensorflow.GraphDebugInfo.StackTrace} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo.StackTrace) + org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.StackTrace.class, org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphDebugInfo.StackTrace.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fileLineColsBuilder_ == null) { + fileLineCols_ = java.util.Collections.emptyList(); + } else { + fileLineCols_ = null; + fileLineColsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + frameId_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace getDefaultInstanceForType() { + return org.tensorflow.proto.GraphDebugInfo.StackTrace.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace build() { + org.tensorflow.proto.GraphDebugInfo.StackTrace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace buildPartial() { + org.tensorflow.proto.GraphDebugInfo.StackTrace result = new org.tensorflow.proto.GraphDebugInfo.StackTrace(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.GraphDebugInfo.StackTrace result) { + if (fileLineColsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fileLineCols_ = java.util.Collections.unmodifiableList(fileLineCols_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fileLineCols_ = fileLineCols_; + } else { + result.fileLineCols_ = fileLineColsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.GraphDebugInfo.StackTrace result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + frameId_.makeImmutable(); + result.frameId_ = frameId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphDebugInfo.StackTrace) { + return mergeFrom((org.tensorflow.proto.GraphDebugInfo.StackTrace)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphDebugInfo.StackTrace other) { + if (other == org.tensorflow.proto.GraphDebugInfo.StackTrace.getDefaultInstance()) return this; + if (fileLineColsBuilder_ == null) { + if (!other.fileLineCols_.isEmpty()) { + if (fileLineCols_.isEmpty()) { + fileLineCols_ = other.fileLineCols_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFileLineColsIsMutable(); + fileLineCols_.addAll(other.fileLineCols_); + } + onChanged(); + } + } else { + if (!other.fileLineCols_.isEmpty()) { + if (fileLineColsBuilder_.isEmpty()) { + fileLineColsBuilder_.dispose(); + fileLineColsBuilder_ = null; + fileLineCols_ = other.fileLineCols_; + bitField0_ = (bitField0_ & ~0x00000001); + fileLineColsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFileLineColsFieldBuilder() : null; + } else { + fileLineColsBuilder_.addAllMessages(other.fileLineCols_); + } + } + } + if (!other.frameId_.isEmpty()) { + if (frameId_.isEmpty()) { + frameId_ = other.frameId_; + frameId_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureFrameIdIsMutable(); + frameId_.addAll(other.frameId_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.GraphDebugInfo.FileLineCol m = + input.readMessage( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.parser(), + extensionRegistry); + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + fileLineCols_.add(m); + } else { + fileLineColsBuilder_.addMessage(m); + } + break; + } // case 10 + case 17: { + long v = input.readFixed64(); + ensureFrameIdIsMutable(); + frameId_.addLong(v); + break; + } // case 17 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureFrameIdIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + frameId_.addLong(input.readFixed64()); + } + input.popLimit(limit); + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List fileLineCols_ = + java.util.Collections.emptyList(); + private void ensureFileLineColsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fileLineCols_ = new java.util.ArrayList(fileLineCols_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder> fileLineColsBuilder_; + + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public java.util.List getFileLineColsList() { + if (fileLineColsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fileLineCols_); + } else { + return fileLineColsBuilder_.getMessageList(); + } + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public int getFileLineColsCount() { + if (fileLineColsBuilder_ == null) { + return fileLineCols_.size(); + } else { + return fileLineColsBuilder_.getCount(); + } + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCols(int index) { + if (fileLineColsBuilder_ == null) { + return fileLineCols_.get(index); + } else { + return fileLineColsBuilder_.getMessage(index); + } + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder setFileLineCols( + int index, org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + if (fileLineColsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileLineColsIsMutable(); + fileLineCols_.set(index, value); + onChanged(); + } else { + fileLineColsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder setFileLineCols( + int index, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder builderForValue) { + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + fileLineCols_.set(index, builderForValue.build()); + onChanged(); + } else { + fileLineColsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder addFileLineCols(org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + if (fileLineColsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileLineColsIsMutable(); + fileLineCols_.add(value); + onChanged(); + } else { + fileLineColsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder addFileLineCols( + int index, org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + if (fileLineColsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileLineColsIsMutable(); + fileLineCols_.add(index, value); + onChanged(); + } else { + fileLineColsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder addFileLineCols( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder builderForValue) { + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + fileLineCols_.add(builderForValue.build()); + onChanged(); + } else { + fileLineColsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder addFileLineCols( + int index, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder builderForValue) { + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + fileLineCols_.add(index, builderForValue.build()); + onChanged(); + } else { + fileLineColsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder addAllFileLineCols( + java.lang.Iterable values) { + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fileLineCols_); + onChanged(); + } else { + fileLineColsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder clearFileLineCols() { + if (fileLineColsBuilder_ == null) { + fileLineCols_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fileLineColsBuilder_.clear(); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public Builder removeFileLineCols(int index) { + if (fileLineColsBuilder_ == null) { + ensureFileLineColsIsMutable(); + fileLineCols_.remove(index); + onChanged(); + } else { + fileLineColsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder getFileLineColsBuilder( + int index) { + return getFileLineColsFieldBuilder().getBuilder(index); + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColsOrBuilder( + int index) { + if (fileLineColsBuilder_ == null) { + return fileLineCols_.get(index); } else { + return fileLineColsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public java.util.List + getFileLineColsOrBuilderList() { + if (fileLineColsBuilder_ != null) { + return fileLineColsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fileLineCols_); + } + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder addFileLineColsBuilder() { + return getFileLineColsFieldBuilder().addBuilder( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance()); + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder addFileLineColsBuilder( + int index) { + return getFileLineColsFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance()); + } + /** + *
    +       * Deprecated.
    +       * 
    + * + * repeated .tensorflow.GraphDebugInfo.FileLineCol file_line_cols = 1; + */ + public java.util.List + getFileLineColsBuilderList() { + return getFileLineColsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder> + getFileLineColsFieldBuilder() { + if (fileLineColsBuilder_ == null) { + fileLineColsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder>( + fileLineCols_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + fileLineCols_ = null; + } + return fileLineColsBuilder_; + } + + private com.google.protobuf.Internal.LongList frameId_ = emptyLongList(); + private void ensureFrameIdIsMutable() { + if (!frameId_.isModifiable()) { + frameId_ = makeMutableCopy(frameId_); + } + bitField0_ |= 0x00000002; + } + private void ensureFrameIdIsMutable(int capacity) { + if (!frameId_.isModifiable()) { + frameId_ = makeMutableCopy(frameId_, capacity); + } + bitField0_ |= 0x00000002; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return A list containing the frameId. + */ + public java.util.List + getFrameIdList() { + frameId_.makeImmutable(); + return frameId_; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return The count of frameId. + */ + public int getFrameIdCount() { + return frameId_.size(); + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param index The index of the element to return. + * @return The frameId at the given index. + */ + public long getFrameId(int index) { + return frameId_.getLong(index); + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param index The index to set the value at. + * @param value The frameId to set. + * @return This builder for chaining. + */ + public Builder setFrameId( + int index, long value) { + + ensureFrameIdIsMutable(); + frameId_.setLong(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param value The frameId to add. + * @return This builder for chaining. + */ + public Builder addFrameId(long value) { + + ensureFrameIdIsMutable(); + frameId_.addLong(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @param values The frameId to add. + * @return This builder for chaining. + */ + public Builder addAllFrameId( + java.lang.Iterable values) { + ensureFrameIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frameId_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated fixed64 frame_id = 2 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearFrameId() { + frameId_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphDebugInfo.StackTrace) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo.StackTrace) + private static final org.tensorflow.proto.GraphDebugInfo.StackTrace DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphDebugInfo.StackTrace(); + } + + public static org.tensorflow.proto.GraphDebugInfo.StackTrace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StackTrace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphDebugInfo.StackTrace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int FILES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList files_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @return A list containing the files. + */ + public com.google.protobuf.ProtocolStringList + getFilesList() { + return files_; + } + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @return The count of files. + */ + public int getFilesCount() { + return files_.size(); + } + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @param index The index of the element to return. + * @return The files at the given index. + */ + public java.lang.String getFiles(int index) { + return files_.get(index); + } + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @param index The index of the value to return. + * @return The bytes of the files at the given index. + */ + public com.google.protobuf.ByteString + getFilesBytes(int index) { + return files_.getByteString(index); + } + + public static final int FRAMES_BY_ID_FIELD_NUMBER = 4; + private static final class FramesByIdDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.FileLineCol> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.FIXED64, + 0L, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.FileLineCol> framesById_; + private com.google.protobuf.MapField + internalGetFramesById() { + if (framesById_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FramesByIdDefaultEntryHolder.defaultEntry); + } + return framesById_; + } + public int getFramesByIdCount() { + return internalGetFramesById().getMap().size(); + } + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public boolean containsFramesById( + long key) { + + return internalGetFramesById().getMap().containsKey(key); + } + /** + * Use {@link #getFramesByIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFramesById() { + return getFramesByIdMap(); + } + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public java.util.Map getFramesByIdMap() { + return internalGetFramesById().getMap(); + } + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol defaultValue) { + + java.util.Map map = + internalGetFramesById().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrThrow( + long key) { + + java.util.Map map = + internalGetFramesById().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TRACES_BY_ID_FIELD_NUMBER = 6; + private static final class TracesByIdDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.StackTrace> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.FIXED64, + 0L, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.GraphDebugInfo.StackTrace.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.StackTrace> tracesById_; + private com.google.protobuf.MapField + internalGetTracesById() { + if (tracesById_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TracesByIdDefaultEntryHolder.defaultEntry); + } + return tracesById_; + } + public int getTracesByIdCount() { + return internalGetTracesById().getMap().size(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public boolean containsTracesById( + long key) { + + return internalGetTracesById().getMap().containsKey(key); + } + /** + * Use {@link #getTracesByIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTracesById() { + return getTracesByIdMap(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public java.util.Map getTracesByIdMap() { + return internalGetTracesById().getMap(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue) { + + java.util.Map map = + internalGetTracesById().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrThrow( + long key) { + + java.util.Map map = + internalGetTracesById().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TRACES_FIELD_NUMBER = 2; + private static final class TracesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.GraphDebugInfo.StackTrace> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.GraphDebugInfo.StackTrace.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.GraphDebugInfo.StackTrace> traces_; + private com.google.protobuf.MapField + internalGetTraces() { + if (traces_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TracesDefaultEntryHolder.defaultEntry); + } + return traces_; + } + public int getTracesCount() { + return internalGetTraces().getMap().size(); + } + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public boolean containsTraces( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetTraces().getMap().containsKey(key); + } + /** + * Use {@link #getTracesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTraces() { + return getTracesMap(); + } + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public java.util.Map getTracesMap() { + return internalGetTraces().getMap(); + } + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTraces().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTraces().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NAME_TO_TRACE_ID_FIELD_NUMBER = 5; + private static final class NameToTraceIdDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.Long> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.FIXED64, + 0L); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> nameToTraceId_; + private com.google.protobuf.MapField + internalGetNameToTraceId() { + if (nameToTraceId_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NameToTraceIdDefaultEntryHolder.defaultEntry); + } + return nameToTraceId_; + } + public int getNameToTraceIdCount() { + return internalGetNameToTraceId().getMap().size(); + } + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public boolean containsNameToTraceId( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetNameToTraceId().getMap().containsKey(key); + } + /** + * Use {@link #getNameToTraceIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNameToTraceId() { + return getNameToTraceIdMap(); + } + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public java.util.Map getNameToTraceIdMap() { + return internalGetNameToTraceId().getMap(); + } + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public long getNameToTraceIdOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNameToTraceId().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public long getNameToTraceIdOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNameToTraceId().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 { + for (int i = 0; i < files_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, files_.getRaw(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetTraces(), + TracesDefaultEntryHolder.defaultEntry, + 2); + com.google.protobuf.GeneratedMessage + .serializeLongMapTo( + output, + internalGetFramesById(), + FramesByIdDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetNameToTraceId(), + NameToTraceIdDefaultEntryHolder.defaultEntry, + 5); + com.google.protobuf.GeneratedMessage + .serializeLongMapTo( + output, + internalGetTracesById(), + TracesByIdDefaultEntryHolder.defaultEntry, + 6); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < files_.size(); i++) { + dataSize += computeStringSizeNoTag(files_.getRaw(i)); + } + size += dataSize; + size += 1 * getFilesList().size(); + } + for (java.util.Map.Entry entry + : internalGetTraces().getMap().entrySet()) { + com.google.protobuf.MapEntry + traces__ = TracesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, traces__); + } + for (java.util.Map.Entry entry + : internalGetFramesById().getMap().entrySet()) { + com.google.protobuf.MapEntry + framesById__ = FramesByIdDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, framesById__); + } + for (java.util.Map.Entry entry + : internalGetNameToTraceId().getMap().entrySet()) { + com.google.protobuf.MapEntry + nameToTraceId__ = NameToTraceIdDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, nameToTraceId__); + } + for (java.util.Map.Entry entry + : internalGetTracesById().getMap().entrySet()) { + com.google.protobuf.MapEntry + tracesById__ = TracesByIdDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, tracesById__); + } + size += getUnknownFields().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.GraphDebugInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphDebugInfo other = (org.tensorflow.proto.GraphDebugInfo) obj; + + if (!getFilesList() + .equals(other.getFilesList())) return false; + if (!internalGetFramesById().equals( + other.internalGetFramesById())) return false; + if (!internalGetTracesById().equals( + other.internalGetTracesById())) return false; + if (!internalGetTraces().equals( + other.internalGetTraces())) return false; + if (!internalGetNameToTraceId().equals( + other.internalGetNameToTraceId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFilesCount() > 0) { + hash = (37 * hash) + FILES_FIELD_NUMBER; + hash = (53 * hash) + getFilesList().hashCode(); + } + if (!internalGetFramesById().getMap().isEmpty()) { + hash = (37 * hash) + FRAMES_BY_ID_FIELD_NUMBER; + hash = (53 * hash) + internalGetFramesById().hashCode(); + } + if (!internalGetTracesById().getMap().isEmpty()) { + hash = (37 * hash) + TRACES_BY_ID_FIELD_NUMBER; + hash = (53 * hash) + internalGetTracesById().hashCode(); + } + if (!internalGetTraces().getMap().isEmpty()) { + hash = (37 * hash) + TRACES_FIELD_NUMBER; + hash = (53 * hash) + internalGetTraces().hashCode(); + } + if (!internalGetNameToTraceId().getMap().isEmpty()) { + hash = (37 * hash) + NAME_TO_TRACE_ID_FIELD_NUMBER; + hash = (53 * hash) + internalGetNameToTraceId().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphDebugInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo 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.GraphDebugInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo 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.GraphDebugInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDebugInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphDebugInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphDebugInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphDebugInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDebugInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphDebugInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphDebugInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphDebugInfo) + org.tensorflow.proto.GraphDebugInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetFramesById(); + case 6: + return internalGetTracesById(); + case 2: + return internalGetTraces(); + case 5: + return internalGetNameToTraceId(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableFramesById(); + case 6: + return internalGetMutableTracesById(); + case 2: + return internalGetMutableTraces(); + case 5: + return internalGetMutableNameToTraceId(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDebugInfo.class, org.tensorflow.proto.GraphDebugInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphDebugInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + files_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + internalGetMutableFramesById().clear(); + internalGetMutableTracesById().clear(); + internalGetMutableTraces().clear(); + internalGetMutableNameToTraceId().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphDebugInfoProtos.internal_static_tensorflow_GraphDebugInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GraphDebugInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo build() { + org.tensorflow.proto.GraphDebugInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo buildPartial() { + org.tensorflow.proto.GraphDebugInfo result = new org.tensorflow.proto.GraphDebugInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphDebugInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + files_.makeImmutable(); + result.files_ = files_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.framesById_ = internalGetFramesById().build(FramesByIdDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tracesById_ = internalGetTracesById().build(TracesByIdDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.traces_ = internalGetTraces().build(TracesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.nameToTraceId_ = internalGetNameToTraceId(); + result.nameToTraceId_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphDebugInfo) { + return mergeFrom((org.tensorflow.proto.GraphDebugInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphDebugInfo other) { + if (other == org.tensorflow.proto.GraphDebugInfo.getDefaultInstance()) return this; + if (!other.files_.isEmpty()) { + if (files_.isEmpty()) { + files_ = other.files_; + bitField0_ |= 0x00000001; + } else { + ensureFilesIsMutable(); + files_.addAll(other.files_); + } + onChanged(); + } + internalGetMutableFramesById().mergeFrom( + other.internalGetFramesById()); + bitField0_ |= 0x00000002; + internalGetMutableTracesById().mergeFrom( + other.internalGetTracesById()); + bitField0_ |= 0x00000004; + internalGetMutableTraces().mergeFrom( + other.internalGetTraces()); + bitField0_ |= 0x00000008; + internalGetMutableNameToTraceId().mergeFrom( + other.internalGetNameToTraceId()); + bitField0_ |= 0x00000010; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + ensureFilesIsMutable(); + files_.add(bs); + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + traces__ = input.readMessage( + TracesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTraces().ensureBuilderMap().put( + traces__.getKey(), traces__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 34: { + com.google.protobuf.MapEntry + framesById__ = input.readMessage( + FramesByIdDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFramesById().ensureBuilderMap().put( + framesById__.getKey(), framesById__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + nameToTraceId__ = input.readMessage( + NameToTraceIdDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableNameToTraceId().getMutableMap().put( + nameToTraceId__.getKey(), nameToTraceId__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + com.google.protobuf.MapEntry + tracesById__ = input.readMessage( + TracesByIdDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTracesById().ensureBuilderMap().put( + tracesById__.getKey(), tracesById__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList files_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFilesIsMutable() { + if (!files_.isModifiable()) { + files_ = new com.google.protobuf.LazyStringArrayList(files_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @return A list containing the files. + */ + public com.google.protobuf.ProtocolStringList + getFilesList() { + files_.makeImmutable(); + return files_; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @return The count of files. + */ + public int getFilesCount() { + return files_.size(); + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param index The index of the element to return. + * @return The files at the given index. + */ + public java.lang.String getFiles(int index) { + return files_.get(index); + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param index The index of the value to return. + * @return The bytes of the files at the given index. + */ + public com.google.protobuf.ByteString + getFilesBytes(int index) { + return files_.getByteString(index); + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param index The index to set the value at. + * @param value The files to set. + * @return This builder for chaining. + */ + public Builder setFiles( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFilesIsMutable(); + files_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param value The files to add. + * @return This builder for chaining. + */ + public Builder addFiles( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFilesIsMutable(); + files_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param values The files to add. + * @return This builder for chaining. + */ + public Builder addAllFiles( + java.lang.Iterable values) { + ensureFilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, files_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @return This builder for chaining. + */ + public Builder clearFiles() { + files_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
    +     * This stores all the source code file names and can be indexed by the
    +     * `file_index`.
    +     * 
    + * + * repeated string files = 1; + * @param value The bytes of the files to add. + * @return This builder for chaining. + */ + public Builder addFilesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureFilesIsMutable(); + files_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class FramesByIdConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol build(org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder val) { + if (val instanceof org.tensorflow.proto.GraphDebugInfo.FileLineCol) { return (org.tensorflow.proto.GraphDebugInfo.FileLineCol) val; } + return ((org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FramesByIdDefaultEntryHolder.defaultEntry; + } + }; + private static final FramesByIdConverter framesByIdConverter = new FramesByIdConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder, org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder> framesById_; + private com.google.protobuf.MapFieldBuilder + internalGetFramesById() { + if (framesById_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(framesByIdConverter); + } + return framesById_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFramesById() { + if (framesById_ == null) { + framesById_ = new com.google.protobuf.MapFieldBuilder<>(framesByIdConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return framesById_; + } + public int getFramesByIdCount() { + return internalGetFramesById().ensureBuilderMap().size(); + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public boolean containsFramesById( + long key) { + + return internalGetFramesById().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFramesByIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFramesById() { + return getFramesByIdMap(); + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public java.util.Map getFramesByIdMap() { + return internalGetFramesById().getImmutableMap(); + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol defaultValue) { + + java.util.Map map = internalGetMutableFramesById().ensureBuilderMap(); + return map.containsKey(key) ? framesByIdConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrThrow( + long key) { + + java.util.Map map = internalGetMutableFramesById().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return framesByIdConverter.build(map.get(key)); + } + public Builder clearFramesById() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableFramesById().clear(); + return this; + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + public Builder removeFramesById( + long key) { + + internalGetMutableFramesById().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFramesById() { + bitField0_ |= 0x00000002; + return internalGetMutableFramesById().ensureMessageMap(); + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + public Builder putFramesById( + long key, + org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFramesById().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + public Builder putAllFramesById( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFramesById().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Stack traces and frames are uniqueified during construction. These maps
    +     * index from the unique id for a frame/trace to the value.
    +     * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder putFramesByIdBuilderIfAbsent( + long key) { + java.util.Map builderMap = internalGetMutableFramesById().ensureBuilderMap(); + org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.GraphDebugInfo.FileLineCol.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.GraphDebugInfo.FileLineCol) { + entry = ((org.tensorflow.proto.GraphDebugInfo.FileLineCol) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder) entry; + } + + private static final class TracesByIdConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace build(org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder val) { + if (val instanceof org.tensorflow.proto.GraphDebugInfo.StackTrace) { return (org.tensorflow.proto.GraphDebugInfo.StackTrace) val; } + return ((org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return TracesByIdDefaultEntryHolder.defaultEntry; + } + }; + private static final TracesByIdConverter tracesByIdConverter = new TracesByIdConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Long, org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder, org.tensorflow.proto.GraphDebugInfo.StackTrace, org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder> tracesById_; + private com.google.protobuf.MapFieldBuilder + internalGetTracesById() { + if (tracesById_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(tracesByIdConverter); + } + return tracesById_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableTracesById() { + if (tracesById_ == null) { + tracesById_ = new com.google.protobuf.MapFieldBuilder<>(tracesByIdConverter); + } + bitField0_ |= 0x00000004; + onChanged(); + return tracesById_; + } + public int getTracesByIdCount() { + return internalGetTracesById().ensureBuilderMap().size(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public boolean containsTracesById( + long key) { + + return internalGetTracesById().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getTracesByIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTracesById() { + return getTracesByIdMap(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public java.util.Map getTracesByIdMap() { + return internalGetTracesById().getImmutableMap(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue) { + + java.util.Map map = internalGetMutableTracesById().ensureBuilderMap(); + return map.containsKey(key) ? tracesByIdConverter.build(map.get(key)) : defaultValue; + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrThrow( + long key) { + + java.util.Map map = internalGetMutableTracesById().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return tracesByIdConverter.build(map.get(key)); + } + public Builder clearTracesById() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableTracesById().clear(); + return this; + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + public Builder removeTracesById( + long key) { + + internalGetMutableTracesById().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTracesById() { + bitField0_ |= 0x00000004; + return internalGetMutableTracesById().ensureMessageMap(); + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + public Builder putTracesById( + long key, + org.tensorflow.proto.GraphDebugInfo.StackTrace value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableTracesById().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + public Builder putAllTracesById( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableTracesById().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + public org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder putTracesByIdBuilderIfAbsent( + long key) { + java.util.Map builderMap = internalGetMutableTracesById().ensureBuilderMap(); + org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.GraphDebugInfo.StackTrace.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.GraphDebugInfo.StackTrace) { + entry = ((org.tensorflow.proto.GraphDebugInfo.StackTrace) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder) entry; + } + + private static final class TracesConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace build(org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder val) { + if (val instanceof org.tensorflow.proto.GraphDebugInfo.StackTrace) { return (org.tensorflow.proto.GraphDebugInfo.StackTrace) val; } + return ((org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return TracesDefaultEntryHolder.defaultEntry; + } + }; + private static final TracesConverter tracesConverter = new TracesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder, org.tensorflow.proto.GraphDebugInfo.StackTrace, org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder> traces_; + private com.google.protobuf.MapFieldBuilder + internalGetTraces() { + if (traces_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(tracesConverter); + } + return traces_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableTraces() { + if (traces_ == null) { + traces_ = new com.google.protobuf.MapFieldBuilder<>(tracesConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return traces_; + } + public int getTracesCount() { + return internalGetTraces().ensureBuilderMap().size(); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public boolean containsTraces( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetTraces().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getTracesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTraces() { + return getTracesMap(); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public java.util.Map getTracesMap() { + return internalGetTraces().getImmutableMap(); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableTraces().ensureBuilderMap(); + return map.containsKey(key) ? tracesConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableTraces().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return tracesConverter.build(map.get(key)); + } + public Builder clearTraces() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableTraces().clear(); + return this; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + public Builder removeTraces( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableTraces().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTraces() { + bitField0_ |= 0x00000008; + return internalGetMutableTraces().ensureMessageMap(); + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + public Builder putTraces( + java.lang.String key, + org.tensorflow.proto.GraphDebugInfo.StackTrace value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableTraces().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + public Builder putAllTraces( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableTraces().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * Deprecated.
    +     * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + public org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder putTracesBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableTraces().ensureBuilderMap(); + org.tensorflow.proto.GraphDebugInfo.StackTraceOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.GraphDebugInfo.StackTrace.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.GraphDebugInfo.StackTrace) { + entry = ((org.tensorflow.proto.GraphDebugInfo.StackTrace) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.GraphDebugInfo.StackTrace.Builder) entry; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.Long> nameToTraceId_; + private com.google.protobuf.MapField + internalGetNameToTraceId() { + if (nameToTraceId_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NameToTraceIdDefaultEntryHolder.defaultEntry); + } + return nameToTraceId_; + } + private com.google.protobuf.MapField + internalGetMutableNameToTraceId() { + if (nameToTraceId_ == null) { + nameToTraceId_ = com.google.protobuf.MapField.newMapField( + NameToTraceIdDefaultEntryHolder.defaultEntry); + } + if (!nameToTraceId_.isMutable()) { + nameToTraceId_ = nameToTraceId_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return nameToTraceId_; + } + public int getNameToTraceIdCount() { + return internalGetNameToTraceId().getMap().size(); + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public boolean containsNameToTraceId( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetNameToTraceId().getMap().containsKey(key); + } + /** + * Use {@link #getNameToTraceIdMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNameToTraceId() { + return getNameToTraceIdMap(); + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public java.util.Map getNameToTraceIdMap() { + return internalGetNameToTraceId().getMap(); + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public long getNameToTraceIdOrDefault( + java.lang.String key, + long defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNameToTraceId().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + @java.lang.Override + public long getNameToTraceIdOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNameToTraceId().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearNameToTraceId() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableNameToTraceId().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + public Builder removeNameToTraceId( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableNameToTraceId().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableNameToTraceId() { + bitField0_ |= 0x00000010; + return internalGetMutableNameToTraceId().getMutableMap(); + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + public Builder putNameToTraceId( + java.lang.String key, + long value) { + if (key == null) { throw new NullPointerException("map key"); } + + internalGetMutableNameToTraceId().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +     * This maps a node name to a trace id contained in `traces_by_id`.
    +     *
    +     * The map key is a mangling of the containing function and op name with
    +     * syntax:
    +     * op.name '@' func_name
    +     * For ops in the top-level graph, the func_name is the empty string and hence
    +     * the `@` may be ommitted.
    +     * Note that op names are restricted to a small number of characters which
    +     * exclude '@', making it impossible to collide keys of this form. Function
    +     * names accept a much wider set of characters.
    +     * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +     * func_name), but this is not supported with protocol buffers.
    +     * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + public Builder putAllNameToTraceId( + java.util.Map values) { + internalGetMutableNameToTraceId().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphDebugInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphDebugInfo) + private static final org.tensorflow.proto.GraphDebugInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphDebugInfo(); + } + + public static org.tensorflow.proto.GraphDebugInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphDebugInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphDebugInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoOrBuilder.java new file mode 100644 index 00000000000..1219fa49740 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoOrBuilder.java @@ -0,0 +1,310 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_debug_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphDebugInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphDebugInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @return A list containing the files. + */ + java.util.List + getFilesList(); + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @return The count of files. + */ + int getFilesCount(); + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @param index The index of the element to return. + * @return The files at the given index. + */ + java.lang.String getFiles(int index); + /** + *
    +   * This stores all the source code file names and can be indexed by the
    +   * `file_index`.
    +   * 
    + * + * repeated string files = 1; + * @param index The index of the value to return. + * @return The bytes of the files at the given index. + */ + com.google.protobuf.ByteString + getFilesBytes(int index); + + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + int getFramesByIdCount(); + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + boolean containsFramesById( + long key); + /** + * Use {@link #getFramesByIdMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFramesById(); + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + java.util.Map + getFramesByIdMap(); + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.FileLineCol defaultValue); + /** + *
    +   * Stack traces and frames are uniqueified during construction. These maps
    +   * index from the unique id for a frame/trace to the value.
    +   * 
    + * + * map<fixed64, .tensorflow.GraphDebugInfo.FileLineCol> frames_by_id = 4; + */ + org.tensorflow.proto.GraphDebugInfo.FileLineCol getFramesByIdOrThrow( + long key); + + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + int getTracesByIdCount(); + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + boolean containsTracesById( + long key); + /** + * Use {@link #getTracesByIdMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getTracesById(); + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + java.util.Map + getTracesByIdMap(); + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue); + /** + * map<fixed64, .tensorflow.GraphDebugInfo.StackTrace> traces_by_id = 6; + */ + org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesByIdOrThrow( + long key); + + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + int getTracesCount(); + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + boolean containsTraces( + java.lang.String key); + /** + * Use {@link #getTracesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getTraces(); + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + java.util.Map + getTracesMap(); + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.GraphDebugInfo.StackTrace defaultValue); + /** + *
    +   * Deprecated.
    +   * 
    + * + * map<string, .tensorflow.GraphDebugInfo.StackTrace> traces = 2; + */ + org.tensorflow.proto.GraphDebugInfo.StackTrace getTracesOrThrow( + java.lang.String key); + + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + int getNameToTraceIdCount(); + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + boolean containsNameToTraceId( + java.lang.String key); + /** + * Use {@link #getNameToTraceIdMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getNameToTraceId(); + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + java.util.Map + getNameToTraceIdMap(); + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + long getNameToTraceIdOrDefault( + java.lang.String key, + long defaultValue); + /** + *
    +   * This maps a node name to a trace id contained in `traces_by_id`.
    +   *
    +   * The map key is a mangling of the containing function and op name with
    +   * syntax:
    +   * op.name '@' func_name
    +   * For ops in the top-level graph, the func_name is the empty string and hence
    +   * the `@` may be ommitted.
    +   * Note that op names are restricted to a small number of characters which
    +   * exclude '@', making it impossible to collide keys of this form. Function
    +   * names accept a much wider set of characters.
    +   * It would be preferable to avoid mangling and use a tuple key of (op.name,
    +   * func_name), but this is not supported with protocol buffers.
    +   * 
    + * + * map<string, fixed64> name_to_trace_id = 5; + */ + long getNameToTraceIdOrThrow( + java.lang.String key); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoProtos.java new file mode 100644 index 00000000000..65504f7b57b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDebugInfoProtos.java @@ -0,0 +1,149 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_debug_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class GraphDebugInfoProtos { + private GraphDebugInfoProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphDebugInfoProtos.class.getName()); + } + 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_GraphDebugInfo_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_TracesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0tensorflow/core/framework/graph_debug_" + + "info.proto\022\ntensorflow\"\243\006\n\016GraphDebugInf" + + "o\022\r\n\005files\030\001 \003(\t\022@\n\014frames_by_id\030\004 \003(\0132*" + + ".tensorflow.GraphDebugInfo.FramesByIdEnt" + + "ry\022@\n\014traces_by_id\030\006 \003(\0132*.tensorflow.Gr" + + "aphDebugInfo.TracesByIdEntry\0226\n\006traces\030\002" + + " \003(\0132&.tensorflow.GraphDebugInfo.TracesE" + + "ntry\022G\n\020name_to_trace_id\030\005 \003(\0132-.tensorf" + + "low.GraphDebugInfo.NameToTraceIdEntry\032X\n" + + "\013FileLineCol\022\022\n\nfile_index\030\001 \001(\005\022\014\n\004line" + + "\030\002 \001(\005\022\013\n\003col\030\003 \001(\005\022\014\n\004func\030\004 \001(\t\022\014\n\004cod" + + "e\030\005 \001(\t\032b\n\nStackTrace\022>\n\016file_line_cols\030" + + "\001 \003(\0132&.tensorflow.GraphDebugInfo.FileLi" + + "neCol\022\024\n\010frame_id\030\002 \003(\006B\002\020\001\032Y\n\017FramesByI" + + "dEntry\022\013\n\003key\030\001 \001(\006\0225\n\005value\030\002 \001(\0132&.ten" + + "sorflow.GraphDebugInfo.FileLineCol:\0028\001\032X" + + "\n\017TracesByIdEntry\022\013\n\003key\030\001 \001(\006\0224\n\005value\030" + + "\002 \001(\0132%.tensorflow.GraphDebugInfo.StackT" + + "race:\0028\001\032T\n\013TracesEntry\022\013\n\003key\030\001 \001(\t\0224\n\005" + + "value\030\002 \001(\0132%.tensorflow.GraphDebugInfo." + + "StackTrace:\0028\001\0324\n\022NameToTraceIdEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\006:\0028\001B\210\001\n\024org.ten" + + "sorflow.protoB\024GraphDebugInfoProtosP\001ZUg" + + "ithub.com/tensorflow/tensorflow/tensorfl" + + "ow/go/core/protobuf/for_core_protos_go_p" + + "roto\370\001\001" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_GraphDebugInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_GraphDebugInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_descriptor, + new java.lang.String[] { "Files", "FramesById", "TracesById", "Traces", "NameToTraceId", }); + internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_GraphDebugInfo_FileLineCol_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_FileLineCol_descriptor, + new java.lang.String[] { "FileIndex", "Line", "Col", "Func", "Code", }); + internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_GraphDebugInfo_StackTrace_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_StackTrace_descriptor, + new java.lang.String[] { "FileLineCols", "FrameId", }); + internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_FramesByIdEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(3); + internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_TracesByIdEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(4); + internal_static_tensorflow_GraphDebugInfo_TracesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_TracesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_descriptor = + internal_static_tensorflow_GraphDebugInfo_descriptor.getNestedTypes().get(5); + internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_GraphDebugInfo_NameToTraceIdEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDef.java new file mode 100644 index 00000000000..412913cf499 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDef.java @@ -0,0 +1,1857 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Represents the graph of operations
    + * 
    + * + * Protobuf type {@code tensorflow.GraphDef} + */ +public final class GraphDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphDef) + GraphDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphDef.class.getName()); + } + // Use GraphDef.newBuilder() to construct. + private GraphDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphDef() { + node_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphProtos.internal_static_tensorflow_GraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDef.class, org.tensorflow.proto.GraphDef.Builder.class); + } + + private int bitField0_; + public static final int NODE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List node_; + /** + * repeated .tensorflow.NodeDef node = 1; + */ + @java.lang.Override + public java.util.List getNodeList() { + return node_; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + @java.lang.Override + public java.util.List + getNodeOrBuilderList() { + return node_; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + @java.lang.Override + public int getNodeCount() { + return node_.size(); + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + @java.lang.Override + public org.tensorflow.proto.NodeDef getNode(int index) { + return node_.get(index); + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + @java.lang.Override + public org.tensorflow.proto.NodeDefOrBuilder getNodeOrBuilder( + int index) { + return node_.get(index); + } + + public static final int VERSIONS_FIELD_NUMBER = 4; + private org.tensorflow.proto.VersionDef versions_; + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return Whether the versions field is set. + */ + @java.lang.Override + public boolean hasVersions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return The versions. + */ + @java.lang.Override + public org.tensorflow.proto.VersionDef getVersions() { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + @java.lang.Override + public org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder() { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + + public static final int VERSION_FIELD_NUMBER = 3; + private int version_ = 0; + /** + *
    +   * Deprecated single version field; use versions above instead.  Since all
    +   * GraphDef changes before "versions" was introduced were forward
    +   * compatible, this field is entirely ignored.
    +   * 
    + * + * int32 version = 3 [deprecated = true]; + * @deprecated tensorflow.GraphDef.version is deprecated. + * See tensorflow/core/framework/graph.proto;l=27 + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated public int getVersion() { + return version_; + } + + public static final int LIBRARY_FIELD_NUMBER = 2; + private org.tensorflow.proto.FunctionDefLibrary library_; + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return Whether the library field is set. + */ + @java.lang.Override + public boolean hasLibrary() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return The library. + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDefLibrary getLibrary() { + return library_ == null ? org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance() : library_; + } + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FunctionDefLibraryOrBuilder getLibraryOrBuilder() { + return library_ == null ? org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance() : library_; + } + + public static final int DEBUG_INFO_FIELD_NUMBER = 5; + private org.tensorflow.proto.GraphDebugInfo debugInfo_; + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return Whether the debugInfo field is set. + */ + @java.lang.Override + public boolean hasDebugInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return The debugInfo. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo getDebugInfo() { + return debugInfo_ == null ? org.tensorflow.proto.GraphDebugInfo.getDefaultInstance() : debugInfo_; + } + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfoOrBuilder getDebugInfoOrBuilder() { + return debugInfo_ == null ? org.tensorflow.proto.GraphDebugInfo.getDefaultInstance() : debugInfo_; + } + + 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 { + for (int i = 0; i < node_.size(); i++) { + output.writeMessage(1, node_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getLibrary()); + } + if (version_ != 0) { + output.writeInt32(3, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getVersions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getDebugInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < node_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, node_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLibrary()); + } + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getVersions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getDebugInfo()); + } + size += getUnknownFields().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.GraphDef)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphDef other = (org.tensorflow.proto.GraphDef) obj; + + if (!getNodeList() + .equals(other.getNodeList())) return false; + if (hasVersions() != other.hasVersions()) return false; + if (hasVersions()) { + if (!getVersions() + .equals(other.getVersions())) return false; + } + if (getVersion() + != other.getVersion()) return false; + if (hasLibrary() != other.hasLibrary()) return false; + if (hasLibrary()) { + if (!getLibrary() + .equals(other.getLibrary())) return false; + } + if (hasDebugInfo() != other.hasDebugInfo()) return false; + if (hasDebugInfo()) { + if (!getDebugInfo() + .equals(other.getDebugInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodeCount() > 0) { + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNodeList().hashCode(); + } + if (hasVersions()) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersions().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + if (hasLibrary()) { + hash = (37 * hash) + LIBRARY_FIELD_NUMBER; + hash = (53 * hash) + getLibrary().hashCode(); + } + if (hasDebugInfo()) { + hash = (37 * hash) + DEBUG_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDebugInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDef 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.GraphDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDef 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.GraphDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Represents the graph of operations
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphDef) + org.tensorflow.proto.GraphDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphProtos.internal_static_tensorflow_GraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphDef.class, org.tensorflow.proto.GraphDef.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getNodeFieldBuilder(); + getVersionsFieldBuilder(); + getLibraryFieldBuilder(); + getDebugInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + } else { + node_ = null; + nodeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + versions_ = null; + if (versionsBuilder_ != null) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + } + version_ = 0; + library_ = null; + if (libraryBuilder_ != null) { + libraryBuilder_.dispose(); + libraryBuilder_ = null; + } + debugInfo_ = null; + if (debugInfoBuilder_ != null) { + debugInfoBuilder_.dispose(); + debugInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphProtos.internal_static_tensorflow_GraphDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDef getDefaultInstanceForType() { + return org.tensorflow.proto.GraphDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphDef build() { + org.tensorflow.proto.GraphDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphDef buildPartial() { + org.tensorflow.proto.GraphDef result = new org.tensorflow.proto.GraphDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.GraphDef result) { + if (nodeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + node_ = java.util.Collections.unmodifiableList(node_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.node_ = node_; + } else { + result.node_ = nodeBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.GraphDef result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.versions_ = versionsBuilder_ == null + ? versions_ + : versionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.library_ = libraryBuilder_ == null + ? library_ + : libraryBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.debugInfo_ = debugInfoBuilder_ == null + ? debugInfo_ + : debugInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphDef) { + return mergeFrom((org.tensorflow.proto.GraphDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphDef other) { + if (other == org.tensorflow.proto.GraphDef.getDefaultInstance()) return this; + if (nodeBuilder_ == null) { + if (!other.node_.isEmpty()) { + if (node_.isEmpty()) { + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodeIsMutable(); + node_.addAll(other.node_); + } + onChanged(); + } + } else { + if (!other.node_.isEmpty()) { + if (nodeBuilder_.isEmpty()) { + nodeBuilder_.dispose(); + nodeBuilder_ = null; + node_ = other.node_; + bitField0_ = (bitField0_ & ~0x00000001); + nodeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeFieldBuilder() : null; + } else { + nodeBuilder_.addAllMessages(other.node_); + } + } + } + if (other.hasVersions()) { + mergeVersions(other.getVersions()); + } + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + if (other.hasLibrary()) { + mergeLibrary(other.getLibrary()); + } + if (other.hasDebugInfo()) { + mergeDebugInfo(other.getDebugInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.NodeDef m = + input.readMessage( + org.tensorflow.proto.NodeDef.parser(), + extensionRegistry); + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(m); + } else { + nodeBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + input.readMessage( + getLibraryFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 24: { + version_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getVersionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 34 + case 42: { + input.readMessage( + getDebugInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List node_ = + java.util.Collections.emptyList(); + private void ensureNodeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + node_ = new java.util.ArrayList(node_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder> nodeBuilder_; + + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public java.util.List getNodeList() { + if (nodeBuilder_ == null) { + return java.util.Collections.unmodifiableList(node_); + } else { + return nodeBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public int getNodeCount() { + if (nodeBuilder_ == null) { + return node_.size(); + } else { + return nodeBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public org.tensorflow.proto.NodeDef getNode(int index) { + if (nodeBuilder_ == null) { + return node_.get(index); + } else { + return nodeBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder setNode( + int index, org.tensorflow.proto.NodeDef value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.set(index, value); + onChanged(); + } else { + nodeBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder setNode( + int index, org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder addNode(org.tensorflow.proto.NodeDef value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(value); + onChanged(); + } else { + nodeBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder addNode( + int index, org.tensorflow.proto.NodeDef value) { + if (nodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeIsMutable(); + node_.add(index, value); + onChanged(); + } else { + nodeBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder addNode( + org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder addNode( + int index, org.tensorflow.proto.NodeDef.Builder builderForValue) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder addAllNode( + java.lang.Iterable values) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, node_); + onChanged(); + } else { + nodeBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder clearNode() { + if (nodeBuilder_ == null) { + node_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodeBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public Builder removeNode(int index) { + if (nodeBuilder_ == null) { + ensureNodeIsMutable(); + node_.remove(index); + onChanged(); + } else { + nodeBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public org.tensorflow.proto.NodeDef.Builder getNodeBuilder( + int index) { + return getNodeFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public org.tensorflow.proto.NodeDefOrBuilder getNodeOrBuilder( + int index) { + if (nodeBuilder_ == null) { + return node_.get(index); } else { + return nodeBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public java.util.List + getNodeOrBuilderList() { + if (nodeBuilder_ != null) { + return nodeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(node_); + } + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public org.tensorflow.proto.NodeDef.Builder addNodeBuilder() { + return getNodeFieldBuilder().addBuilder( + org.tensorflow.proto.NodeDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public org.tensorflow.proto.NodeDef.Builder addNodeBuilder( + int index) { + return getNodeFieldBuilder().addBuilder( + index, org.tensorflow.proto.NodeDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeDef node = 1; + */ + public java.util.List + getNodeBuilderList() { + return getNodeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder> + getNodeFieldBuilder() { + if (nodeBuilder_ == null) { + nodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeDef, org.tensorflow.proto.NodeDef.Builder, org.tensorflow.proto.NodeDefOrBuilder>( + node_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + node_ = null; + } + return nodeBuilder_; + } + + private org.tensorflow.proto.VersionDef versions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> versionsBuilder_; + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return Whether the versions field is set. + */ + public boolean hasVersions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return The versions. + */ + public org.tensorflow.proto.VersionDef getVersions() { + if (versionsBuilder_ == null) { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } else { + return versionsBuilder_.getMessage(); + } + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public Builder setVersions(org.tensorflow.proto.VersionDef value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versions_ = value; + } else { + versionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public Builder setVersions( + org.tensorflow.proto.VersionDef.Builder builderForValue) { + if (versionsBuilder_ == null) { + versions_ = builderForValue.build(); + } else { + versionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public Builder mergeVersions(org.tensorflow.proto.VersionDef value) { + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + versions_ != null && + versions_ != org.tensorflow.proto.VersionDef.getDefaultInstance()) { + getVersionsBuilder().mergeFrom(value); + } else { + versions_ = value; + } + } else { + versionsBuilder_.mergeFrom(value); + } + if (versions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public Builder clearVersions() { + bitField0_ = (bitField0_ & ~0x00000002); + versions_ = null; + if (versionsBuilder_ != null) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public org.tensorflow.proto.VersionDef.Builder getVersionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getVersionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + public org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilder(); + } else { + return versions_ == null ? + org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + } + /** + *
    +     * Compatibility versions of the graph.  See core/public/version.h for version
    +     * history.  The GraphDef version is distinct from the TensorFlow version, and
    +     * each release of TensorFlow will support a range of GraphDef versions.
    +     * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder>( + getVersions(), + getParentForChildren(), + isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + private int version_ ; + /** + *
    +     * Deprecated single version field; use versions above instead.  Since all
    +     * GraphDef changes before "versions" was introduced were forward
    +     * compatible, this field is entirely ignored.
    +     * 
    + * + * int32 version = 3 [deprecated = true]; + * @deprecated tensorflow.GraphDef.version is deprecated. + * See tensorflow/core/framework/graph.proto;l=27 + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated public int getVersion() { + return version_; + } + /** + *
    +     * Deprecated single version field; use versions above instead.  Since all
    +     * GraphDef changes before "versions" was introduced were forward
    +     * compatible, this field is entirely ignored.
    +     * 
    + * + * int32 version = 3 [deprecated = true]; + * @deprecated tensorflow.GraphDef.version is deprecated. + * See tensorflow/core/framework/graph.proto;l=27 + * @param value The version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setVersion(int value) { + + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Deprecated single version field; use versions above instead.  Since all
    +     * GraphDef changes before "versions" was introduced were forward
    +     * compatible, this field is entirely ignored.
    +     * 
    + * + * int32 version = 3 [deprecated = true]; + * @deprecated tensorflow.GraphDef.version is deprecated. + * See tensorflow/core/framework/graph.proto;l=27 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + version_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.FunctionDefLibrary library_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FunctionDefLibrary, org.tensorflow.proto.FunctionDefLibrary.Builder, org.tensorflow.proto.FunctionDefLibraryOrBuilder> libraryBuilder_; + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return Whether the library field is set. + */ + public boolean hasLibrary() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return The library. + */ + public org.tensorflow.proto.FunctionDefLibrary getLibrary() { + if (libraryBuilder_ == null) { + return library_ == null ? org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance() : library_; + } else { + return libraryBuilder_.getMessage(); + } + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public Builder setLibrary(org.tensorflow.proto.FunctionDefLibrary value) { + if (libraryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + library_ = value; + } else { + libraryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public Builder setLibrary( + org.tensorflow.proto.FunctionDefLibrary.Builder builderForValue) { + if (libraryBuilder_ == null) { + library_ = builderForValue.build(); + } else { + libraryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public Builder mergeLibrary(org.tensorflow.proto.FunctionDefLibrary value) { + if (libraryBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + library_ != null && + library_ != org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance()) { + getLibraryBuilder().mergeFrom(value); + } else { + library_ = value; + } + } else { + libraryBuilder_.mergeFrom(value); + } + if (library_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public Builder clearLibrary() { + bitField0_ = (bitField0_ & ~0x00000008); + library_ = null; + if (libraryBuilder_ != null) { + libraryBuilder_.dispose(); + libraryBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public org.tensorflow.proto.FunctionDefLibrary.Builder getLibraryBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getLibraryFieldBuilder().getBuilder(); + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + public org.tensorflow.proto.FunctionDefLibraryOrBuilder getLibraryOrBuilder() { + if (libraryBuilder_ != null) { + return libraryBuilder_.getMessageOrBuilder(); + } else { + return library_ == null ? + org.tensorflow.proto.FunctionDefLibrary.getDefaultInstance() : library_; + } + } + /** + *
    +     * "library" provides user-defined functions.
    +     *
    +     * Naming:
    +     * * library.function.name are in a flat namespace.
    +     * NOTE: We may need to change it to be hierarchical to support
    +     * different orgs. E.g.,
    +     * { "/google/nn", { ... }},
    +     * { "/google/vision", { ... }}
    +     * { "/org_foo/module_bar", { ... }}
    +     * map<string, FunctionDefLib> named_lib;
    +     * * If node[i].op is the name of one function in "library",
    +     * node[i] is deemed as a function call. Otherwise, node[i].op
    +     * must be a primitive operation supported by the runtime.
    +     *
    +     *
    +     * Function call semantics:
    +     *
    +     * * The callee may start execution as soon as some of its inputs
    +     * are ready. The caller may want to use Tuple() mechanism to
    +     * ensure all inputs are ready in the same time.
    +     *
    +     * * The consumer of return values may start executing as soon as
    +     * the return values the consumer depends on are ready.  The
    +     * consumer may want to use Tuple() mechanism to ensure the
    +     * consumer does not start until all return values of the callee
    +     * function are ready.
    +     * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FunctionDefLibrary, org.tensorflow.proto.FunctionDefLibrary.Builder, org.tensorflow.proto.FunctionDefLibraryOrBuilder> + getLibraryFieldBuilder() { + if (libraryBuilder_ == null) { + libraryBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FunctionDefLibrary, org.tensorflow.proto.FunctionDefLibrary.Builder, org.tensorflow.proto.FunctionDefLibraryOrBuilder>( + getLibrary(), + getParentForChildren(), + isClean()); + library_ = null; + } + return libraryBuilder_; + } + + private org.tensorflow.proto.GraphDebugInfo debugInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo, org.tensorflow.proto.GraphDebugInfo.Builder, org.tensorflow.proto.GraphDebugInfoOrBuilder> debugInfoBuilder_; + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return Whether the debugInfo field is set. + */ + public boolean hasDebugInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return The debugInfo. + */ + public org.tensorflow.proto.GraphDebugInfo getDebugInfo() { + if (debugInfoBuilder_ == null) { + return debugInfo_ == null ? org.tensorflow.proto.GraphDebugInfo.getDefaultInstance() : debugInfo_; + } else { + return debugInfoBuilder_.getMessage(); + } + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public Builder setDebugInfo(org.tensorflow.proto.GraphDebugInfo value) { + if (debugInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + debugInfo_ = value; + } else { + debugInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public Builder setDebugInfo( + org.tensorflow.proto.GraphDebugInfo.Builder builderForValue) { + if (debugInfoBuilder_ == null) { + debugInfo_ = builderForValue.build(); + } else { + debugInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public Builder mergeDebugInfo(org.tensorflow.proto.GraphDebugInfo value) { + if (debugInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + debugInfo_ != null && + debugInfo_ != org.tensorflow.proto.GraphDebugInfo.getDefaultInstance()) { + getDebugInfoBuilder().mergeFrom(value); + } else { + debugInfo_ = value; + } + } else { + debugInfoBuilder_.mergeFrom(value); + } + if (debugInfo_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public Builder clearDebugInfo() { + bitField0_ = (bitField0_ & ~0x00000010); + debugInfo_ = null; + if (debugInfoBuilder_ != null) { + debugInfoBuilder_.dispose(); + debugInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public org.tensorflow.proto.GraphDebugInfo.Builder getDebugInfoBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDebugInfoFieldBuilder().getBuilder(); + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + public org.tensorflow.proto.GraphDebugInfoOrBuilder getDebugInfoOrBuilder() { + if (debugInfoBuilder_ != null) { + return debugInfoBuilder_.getMessageOrBuilder(); + } else { + return debugInfo_ == null ? + org.tensorflow.proto.GraphDebugInfo.getDefaultInstance() : debugInfo_; + } + } + /** + *
    +     * Stack traces for the nodes in this graph.
    +     * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo, org.tensorflow.proto.GraphDebugInfo.Builder, org.tensorflow.proto.GraphDebugInfoOrBuilder> + getDebugInfoFieldBuilder() { + if (debugInfoBuilder_ == null) { + debugInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo, org.tensorflow.proto.GraphDebugInfo.Builder, org.tensorflow.proto.GraphDebugInfoOrBuilder>( + getDebugInfo(), + getParentForChildren(), + isClean()); + debugInfo_ = null; + } + return debugInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphDef) + private static final org.tensorflow.proto.GraphDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphDef(); + } + + public static org.tensorflow.proto.GraphDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDefOrBuilder.java new file mode 100644 index 00000000000..aae20baf2ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphDefOrBuilder.java @@ -0,0 +1,211 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphDef) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.NodeDef node = 1; + */ + java.util.List + getNodeList(); + /** + * repeated .tensorflow.NodeDef node = 1; + */ + org.tensorflow.proto.NodeDef getNode(int index); + /** + * repeated .tensorflow.NodeDef node = 1; + */ + int getNodeCount(); + /** + * repeated .tensorflow.NodeDef node = 1; + */ + java.util.List + getNodeOrBuilderList(); + /** + * repeated .tensorflow.NodeDef node = 1; + */ + org.tensorflow.proto.NodeDefOrBuilder getNodeOrBuilder( + int index); + + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return Whether the versions field is set. + */ + boolean hasVersions(); + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + * @return The versions. + */ + org.tensorflow.proto.VersionDef getVersions(); + /** + *
    +   * Compatibility versions of the graph.  See core/public/version.h for version
    +   * history.  The GraphDef version is distinct from the TensorFlow version, and
    +   * each release of TensorFlow will support a range of GraphDef versions.
    +   * 
    + * + * .tensorflow.VersionDef versions = 4; + */ + org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder(); + + /** + *
    +   * Deprecated single version field; use versions above instead.  Since all
    +   * GraphDef changes before "versions" was introduced were forward
    +   * compatible, this field is entirely ignored.
    +   * 
    + * + * int32 version = 3 [deprecated = true]; + * @deprecated tensorflow.GraphDef.version is deprecated. + * See tensorflow/core/framework/graph.proto;l=27 + * @return The version. + */ + @java.lang.Deprecated int getVersion(); + + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return Whether the library field is set. + */ + boolean hasLibrary(); + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + * @return The library. + */ + org.tensorflow.proto.FunctionDefLibrary getLibrary(); + /** + *
    +   * "library" provides user-defined functions.
    +   *
    +   * Naming:
    +   * * library.function.name are in a flat namespace.
    +   * NOTE: We may need to change it to be hierarchical to support
    +   * different orgs. E.g.,
    +   * { "/google/nn", { ... }},
    +   * { "/google/vision", { ... }}
    +   * { "/org_foo/module_bar", { ... }}
    +   * map<string, FunctionDefLib> named_lib;
    +   * * If node[i].op is the name of one function in "library",
    +   * node[i] is deemed as a function call. Otherwise, node[i].op
    +   * must be a primitive operation supported by the runtime.
    +   *
    +   *
    +   * Function call semantics:
    +   *
    +   * * The callee may start execution as soon as some of its inputs
    +   * are ready. The caller may want to use Tuple() mechanism to
    +   * ensure all inputs are ready in the same time.
    +   *
    +   * * The consumer of return values may start executing as soon as
    +   * the return values the consumer depends on are ready.  The
    +   * consumer may want to use Tuple() mechanism to ensure the
    +   * consumer does not start until all return values of the callee
    +   * function are ready.
    +   * 
    + * + * .tensorflow.FunctionDefLibrary library = 2; + */ + org.tensorflow.proto.FunctionDefLibraryOrBuilder getLibraryOrBuilder(); + + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return Whether the debugInfo field is set. + */ + boolean hasDebugInfo(); + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + * @return The debugInfo. + */ + org.tensorflow.proto.GraphDebugInfo getDebugInfo(); + /** + *
    +   * Stack traces for the nodes in this graph.
    +   * 
    + * + * .tensorflow.GraphDebugInfo debug_info = 5; + */ + org.tensorflow.proto.GraphDebugInfoOrBuilder getDebugInfoOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTrace.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTrace.java new file mode 100644 index 00000000000..6295c31c0b3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTrace.java @@ -0,0 +1,1362 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Data relating to an execution of a Graph (e.g., an eager execution of a
    + * FuncGraph).
    + * The values of the intermediate tensors computed in the graph are recorded
    + * in this proto. A graph execution may correspond to one or more pieces of
    + * `GraphExecutionTrace`, depending on whether the instrumented tensor values
    + * are summarized in an aggregated or separate fashion.
    + * 
    + * + * Protobuf type {@code tensorflow.GraphExecutionTrace} + */ +public final class GraphExecutionTrace extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphExecutionTrace) + GraphExecutionTraceOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphExecutionTrace.class.getName()); + } + // Use GraphExecutionTrace.newBuilder() to construct. + private GraphExecutionTrace(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphExecutionTrace() { + tfdbgContextId_ = ""; + opName_ = ""; + tensorDebugMode_ = 0; + deviceName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphExecutionTrace.class, org.tensorflow.proto.GraphExecutionTrace.Builder.class); + } + + private int bitField0_; + public static final int TFDBG_CONTEXT_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object tfdbgContextId_ = ""; + /** + *
    +   * Unique ID of the context that the executed op(s) belong to (e.g., a
    +   * compiled concrete tf.function).
    +   * 
    + * + * string tfdbg_context_id = 1; + * @return The tfdbgContextId. + */ + @java.lang.Override + public java.lang.String getTfdbgContextId() { + java.lang.Object ref = tfdbgContextId_; + 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(); + tfdbgContextId_ = s; + return s; + } + } + /** + *
    +   * Unique ID of the context that the executed op(s) belong to (e.g., a
    +   * compiled concrete tf.function).
    +   * 
    + * + * string tfdbg_context_id = 1; + * @return The bytes for tfdbgContextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTfdbgContextIdBytes() { + java.lang.Object ref = tfdbgContextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfdbgContextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OP_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object opName_ = ""; + /** + *
    +   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +   * level).
    +   * 
    + * + * string op_name = 2; + * @return The opName. + */ + @java.lang.Override + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + 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(); + opName_ = s; + return s; + } + } + /** + *
    +   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +   * level).
    +   * 
    + * + * string op_name = 2; + * @return The bytes for opName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_SLOT_FIELD_NUMBER = 3; + private int outputSlot_ = 0; + /** + *
    +   * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    +   * trace level).
    +   * 
    + * + * int32 output_slot = 3; + * @return The outputSlot. + */ + @java.lang.Override + public int getOutputSlot() { + return outputSlot_; + } + + public static final int TENSOR_DEBUG_MODE_FIELD_NUMBER = 4; + private int tensorDebugMode_ = 0; + /** + *
    +   * Type of the tensor value encapsulated in this proto.
    +   * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The enum numeric value on the wire for tensorDebugMode. + */ + @java.lang.Override public int getTensorDebugModeValue() { + return tensorDebugMode_; + } + /** + *
    +   * Type of the tensor value encapsulated in this proto.
    +   * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The tensorDebugMode. + */ + @java.lang.Override public org.tensorflow.proto.TensorDebugMode getTensorDebugMode() { + org.tensorflow.proto.TensorDebugMode result = org.tensorflow.proto.TensorDebugMode.forNumber(tensorDebugMode_); + return result == null ? org.tensorflow.proto.TensorDebugMode.UNRECOGNIZED : result; + } + + public static final int TENSOR_PROTO_FIELD_NUMBER = 5; + private org.tensorflow.proto.TensorProto tensorProto_; + /** + *
    +   * Tensor value in the type described by `tensor_value_type`.
    +   * This tensor may summarize the value of a single intermediate op of the
    +   * graph, or those of multiple intermediate tensors.
    +   * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + * @return Whether the tensorProto field is set. + */ + @java.lang.Override + public boolean hasTensorProto() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Tensor value in the type described by `tensor_value_type`.
    +   * This tensor may summarize the value of a single intermediate op of the
    +   * graph, or those of multiple intermediate tensors.
    +   * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + * @return The tensorProto. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensorProto() { + return tensorProto_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensorProto_; + } + /** + *
    +   * Tensor value in the type described by `tensor_value_type`.
    +   * This tensor may summarize the value of a single intermediate op of the
    +   * graph, or those of multiple intermediate tensors.
    +   * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorProtoOrBuilder() { + return tensorProto_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensorProto_; + } + + public static final int DEVICE_NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceName_ = ""; + /** + *
    +   * Name of the device that the op belongs to.
    +   * 
    + * + * string device_name = 6; + * @return The deviceName. + */ + @java.lang.Override + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + 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(); + deviceName_ = s; + return s; + } + } + /** + *
    +   * Name of the device that the op belongs to.
    +   * 
    + * + * string device_name = 6; + * @return The bytes for deviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfdbgContextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tfdbgContextId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, opName_); + } + if (outputSlot_ != 0) { + output.writeInt32(3, outputSlot_); + } + if (tensorDebugMode_ != org.tensorflow.proto.TensorDebugMode.UNSPECIFIED.getNumber()) { + output.writeEnum(4, tensorDebugMode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getTensorProto()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, deviceName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfdbgContextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tfdbgContextId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, opName_); + } + if (outputSlot_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, outputSlot_); + } + if (tensorDebugMode_ != org.tensorflow.proto.TensorDebugMode.UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, tensorDebugMode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getTensorProto()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, deviceName_); + } + size += getUnknownFields().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.GraphExecutionTrace)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphExecutionTrace other = (org.tensorflow.proto.GraphExecutionTrace) obj; + + if (!getTfdbgContextId() + .equals(other.getTfdbgContextId())) return false; + if (!getOpName() + .equals(other.getOpName())) return false; + if (getOutputSlot() + != other.getOutputSlot()) return false; + if (tensorDebugMode_ != other.tensorDebugMode_) return false; + if (hasTensorProto() != other.hasTensorProto()) return false; + if (hasTensorProto()) { + if (!getTensorProto() + .equals(other.getTensorProto())) return false; + } + if (!getDeviceName() + .equals(other.getDeviceName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TFDBG_CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getTfdbgContextId().hashCode(); + hash = (37 * hash) + OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOpName().hashCode(); + hash = (37 * hash) + OUTPUT_SLOT_FIELD_NUMBER; + hash = (53 * hash) + getOutputSlot(); + hash = (37 * hash) + TENSOR_DEBUG_MODE_FIELD_NUMBER; + hash = (53 * hash) + tensorDebugMode_; + if (hasTensorProto()) { + hash = (37 * hash) + TENSOR_PROTO_FIELD_NUMBER; + hash = (53 * hash) + getTensorProto().hashCode(); + } + hash = (37 * hash) + DEVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDeviceName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphExecutionTrace parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphExecutionTrace 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.GraphExecutionTrace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphExecutionTrace 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.GraphExecutionTrace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphExecutionTrace parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphExecutionTrace parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphExecutionTrace parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphExecutionTrace parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphExecutionTrace parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphExecutionTrace parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphExecutionTrace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphExecutionTrace 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Data relating to an execution of a Graph (e.g., an eager execution of a
    +   * FuncGraph).
    +   * The values of the intermediate tensors computed in the graph are recorded
    +   * in this proto. A graph execution may correspond to one or more pieces of
    +   * `GraphExecutionTrace`, depending on whether the instrumented tensor values
    +   * are summarized in an aggregated or separate fashion.
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphExecutionTrace} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphExecutionTrace) + org.tensorflow.proto.GraphExecutionTraceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphExecutionTrace.class, org.tensorflow.proto.GraphExecutionTrace.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphExecutionTrace.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorProtoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tfdbgContextId_ = ""; + opName_ = ""; + outputSlot_ = 0; + tensorDebugMode_ = 0; + tensorProto_ = null; + if (tensorProtoBuilder_ != null) { + tensorProtoBuilder_.dispose(); + tensorProtoBuilder_ = null; + } + deviceName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTrace getDefaultInstanceForType() { + return org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTrace build() { + org.tensorflow.proto.GraphExecutionTrace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphExecutionTrace buildPartial() { + org.tensorflow.proto.GraphExecutionTrace result = new org.tensorflow.proto.GraphExecutionTrace(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphExecutionTrace result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tfdbgContextId_ = tfdbgContextId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.opName_ = opName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputSlot_ = outputSlot_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tensorDebugMode_ = tensorDebugMode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tensorProto_ = tensorProtoBuilder_ == null + ? tensorProto_ + : tensorProtoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deviceName_ = deviceName_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphExecutionTrace) { + return mergeFrom((org.tensorflow.proto.GraphExecutionTrace)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphExecutionTrace other) { + if (other == org.tensorflow.proto.GraphExecutionTrace.getDefaultInstance()) return this; + if (!other.getTfdbgContextId().isEmpty()) { + tfdbgContextId_ = other.tfdbgContextId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOpName().isEmpty()) { + opName_ = other.opName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getOutputSlot() != 0) { + setOutputSlot(other.getOutputSlot()); + } + if (other.tensorDebugMode_ != 0) { + setTensorDebugModeValue(other.getTensorDebugModeValue()); + } + if (other.hasTensorProto()) { + mergeTensorProto(other.getTensorProto()); + } + if (!other.getDeviceName().isEmpty()) { + deviceName_ = other.deviceName_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tfdbgContextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + opName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + outputSlot_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + tensorDebugMode_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + getTensorProtoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + deviceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object tfdbgContextId_ = ""; + /** + *
    +     * Unique ID of the context that the executed op(s) belong to (e.g., a
    +     * compiled concrete tf.function).
    +     * 
    + * + * string tfdbg_context_id = 1; + * @return The tfdbgContextId. + */ + public java.lang.String getTfdbgContextId() { + java.lang.Object ref = tfdbgContextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tfdbgContextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Unique ID of the context that the executed op(s) belong to (e.g., a
    +     * compiled concrete tf.function).
    +     * 
    + * + * string tfdbg_context_id = 1; + * @return The bytes for tfdbgContextId. + */ + public com.google.protobuf.ByteString + getTfdbgContextIdBytes() { + java.lang.Object ref = tfdbgContextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfdbgContextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Unique ID of the context that the executed op(s) belong to (e.g., a
    +     * compiled concrete tf.function).
    +     * 
    + * + * string tfdbg_context_id = 1; + * @param value The tfdbgContextId to set. + * @return This builder for chaining. + */ + public Builder setTfdbgContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tfdbgContextId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Unique ID of the context that the executed op(s) belong to (e.g., a
    +     * compiled concrete tf.function).
    +     * 
    + * + * string tfdbg_context_id = 1; + * @return This builder for chaining. + */ + public Builder clearTfdbgContextId() { + tfdbgContextId_ = getDefaultInstance().getTfdbgContextId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Unique ID of the context that the executed op(s) belong to (e.g., a
    +     * compiled concrete tf.function).
    +     * 
    + * + * string tfdbg_context_id = 1; + * @param value The bytes for tfdbgContextId to set. + * @return This builder for chaining. + */ + public Builder setTfdbgContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tfdbgContextId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object opName_ = ""; + /** + *
    +     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +     * level).
    +     * 
    + * + * string op_name = 2; + * @return The opName. + */ + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +     * level).
    +     * 
    + * + * string op_name = 2; + * @return The bytes for opName. + */ + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +     * level).
    +     * 
    + * + * string op_name = 2; + * @param value The opName to set. + * @return This builder for chaining. + */ + public Builder setOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +     * level).
    +     * 
    + * + * string op_name = 2; + * @return This builder for chaining. + */ + public Builder clearOpName() { + opName_ = getDefaultInstance().getOpName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
    +     * level).
    +     * 
    + * + * string op_name = 2; + * @param value The bytes for opName to set. + * @return This builder for chaining. + */ + public Builder setOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int outputSlot_ ; + /** + *
    +     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    +     * trace level).
    +     * 
    + * + * int32 output_slot = 3; + * @return The outputSlot. + */ + @java.lang.Override + public int getOutputSlot() { + return outputSlot_; + } + /** + *
    +     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    +     * trace level).
    +     * 
    + * + * int32 output_slot = 3; + * @param value The outputSlot to set. + * @return This builder for chaining. + */ + public Builder setOutputSlot(int value) { + + outputSlot_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
    +     * trace level).
    +     * 
    + * + * int32 output_slot = 3; + * @return This builder for chaining. + */ + public Builder clearOutputSlot() { + bitField0_ = (bitField0_ & ~0x00000004); + outputSlot_ = 0; + onChanged(); + return this; + } + + private int tensorDebugMode_ = 0; + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The enum numeric value on the wire for tensorDebugMode. + */ + @java.lang.Override public int getTensorDebugModeValue() { + return tensorDebugMode_; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @param value The enum numeric value on the wire for tensorDebugMode to set. + * @return This builder for chaining. + */ + public Builder setTensorDebugModeValue(int value) { + tensorDebugMode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The tensorDebugMode. + */ + @java.lang.Override + public org.tensorflow.proto.TensorDebugMode getTensorDebugMode() { + org.tensorflow.proto.TensorDebugMode result = org.tensorflow.proto.TensorDebugMode.forNumber(tensorDebugMode_); + return result == null ? org.tensorflow.proto.TensorDebugMode.UNRECOGNIZED : result; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @param value The tensorDebugMode to set. + * @return This builder for chaining. + */ + public Builder setTensorDebugMode(org.tensorflow.proto.TensorDebugMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + tensorDebugMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor value encapsulated in this proto.
    +     * 
    + * + * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return This builder for chaining. + */ + public Builder clearTensorDebugMode() { + bitField0_ = (bitField0_ & ~0x00000008); + tensorDebugMode_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorProto tensorProto_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorProtoBuilder_; + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + * @return Whether the tensorProto field is set. + */ + public boolean hasTensorProto() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + * @return The tensorProto. + */ + public org.tensorflow.proto.TensorProto getTensorProto() { + if (tensorProtoBuilder_ == null) { + return tensorProto_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensorProto_; + } else { + return tensorProtoBuilder_.getMessage(); + } + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public Builder setTensorProto(org.tensorflow.proto.TensorProto value) { + if (tensorProtoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorProto_ = value; + } else { + tensorProtoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public Builder setTensorProto( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorProtoBuilder_ == null) { + tensorProto_ = builderForValue.build(); + } else { + tensorProtoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public Builder mergeTensorProto(org.tensorflow.proto.TensorProto value) { + if (tensorProtoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + tensorProto_ != null && + tensorProto_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getTensorProtoBuilder().mergeFrom(value); + } else { + tensorProto_ = value; + } + } else { + tensorProtoBuilder_.mergeFrom(value); + } + if (tensorProto_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public Builder clearTensorProto() { + bitField0_ = (bitField0_ & ~0x00000010); + tensorProto_ = null; + if (tensorProtoBuilder_ != null) { + tensorProtoBuilder_.dispose(); + tensorProtoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorProtoBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getTensorProtoFieldBuilder().getBuilder(); + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorProtoOrBuilder() { + if (tensorProtoBuilder_ != null) { + return tensorProtoBuilder_.getMessageOrBuilder(); + } else { + return tensorProto_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : tensorProto_; + } + } + /** + *
    +     * Tensor value in the type described by `tensor_value_type`.
    +     * This tensor may summarize the value of a single intermediate op of the
    +     * graph, or those of multiple intermediate tensors.
    +     * 
    + * + * .tensorflow.TensorProto tensor_proto = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorProtoFieldBuilder() { + if (tensorProtoBuilder_ == null) { + tensorProtoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getTensorProto(), + getParentForChildren(), + isClean()); + tensorProto_ = null; + } + return tensorProtoBuilder_; + } + + private java.lang.Object deviceName_ = ""; + /** + *
    +     * Name of the device that the op belongs to.
    +     * 
    + * + * string device_name = 6; + * @return The deviceName. + */ + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the device that the op belongs to.
    +     * 
    + * + * string device_name = 6; + * @return The bytes for deviceName. + */ + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the device that the op belongs to.
    +     * 
    + * + * string device_name = 6; + * @param value The deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Name of the device that the op belongs to.
    +     * 
    + * + * string device_name = 6; + * @return This builder for chaining. + */ + public Builder clearDeviceName() { + deviceName_ = getDefaultInstance().getDeviceName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * Name of the device that the op belongs to.
    +     * 
    + * + * string device_name = 6; + * @param value The bytes for deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphExecutionTrace) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphExecutionTrace) + private static final org.tensorflow.proto.GraphExecutionTrace DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphExecutionTrace(); + } + + public static org.tensorflow.proto.GraphExecutionTrace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphExecutionTrace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphExecutionTrace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTraceOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTraceOrBuilder.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTraceOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTraceOrBuilder.java index d83c52096e3..8ee56f2d353 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphExecutionTraceOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphExecutionTraceOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface GraphExecutionTraceOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GraphExecutionTrace) @@ -14,6 +16,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * string tfdbg_context_id = 1; + * @return The tfdbgContextId. */ java.lang.String getTfdbgContextId(); /** @@ -23,6 +26,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * string tfdbg_context_id = 1; + * @return The bytes for tfdbgContextId. */ com.google.protobuf.ByteString getTfdbgContextIdBytes(); @@ -34,6 +38,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * string op_name = 2; + * @return The opName. */ java.lang.String getOpName(); /** @@ -43,6 +48,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * string op_name = 2; + * @return The bytes for opName. */ com.google.protobuf.ByteString getOpNameBytes(); @@ -54,6 +60,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * int32 output_slot = 3; + * @return The outputSlot. */ int getOutputSlot(); @@ -63,6 +70,7 @@ public interface GraphExecutionTraceOrBuilder extends * * * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The enum numeric value on the wire for tensorDebugMode. */ int getTensorDebugModeValue(); /** @@ -71,8 +79,9 @@ public interface GraphExecutionTraceOrBuilder extends * * * .tensorflow.TensorDebugMode tensor_debug_mode = 4; + * @return The tensorDebugMode. */ - org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode(); + org.tensorflow.proto.TensorDebugMode getTensorDebugMode(); /** *
    @@ -82,6 +91,7 @@ public interface GraphExecutionTraceOrBuilder extends
        * 
    * * .tensorflow.TensorProto tensor_proto = 5; + * @return Whether the tensorProto field is set. */ boolean hasTensorProto(); /** @@ -92,8 +102,9 @@ public interface GraphExecutionTraceOrBuilder extends * * * .tensorflow.TensorProto tensor_proto = 5; + * @return The tensorProto. */ - org.tensorflow.proto.framework.TensorProto getTensorProto(); + org.tensorflow.proto.TensorProto getTensorProto(); /** *
        * Tensor value in the type described by `tensor_value_type`.
    @@ -103,7 +114,7 @@ public interface GraphExecutionTraceOrBuilder extends
        *
        * .tensorflow.TensorProto tensor_proto = 5;
        */
    -  org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtoOrBuilder();
    +  org.tensorflow.proto.TensorProtoOrBuilder getTensorProtoOrBuilder();
     
       /**
        * 
    @@ -111,6 +122,7 @@ public interface GraphExecutionTraceOrBuilder extends
        * 
    * * string device_name = 6; + * @return The deviceName. */ java.lang.String getDeviceName(); /** @@ -119,6 +131,7 @@ public interface GraphExecutionTraceOrBuilder extends *
    * * string device_name = 6; + * @return The bytes for deviceName. */ com.google.protobuf.ByteString getDeviceNameBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreation.java new file mode 100644 index 00000000000..1cfdf8f521b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreation.java @@ -0,0 +1,1979 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * The creation of an op in a TensorFlow Graph (e.g., FuncGraph in TF2).
    + * 
    + * + * Protobuf type {@code tensorflow.GraphOpCreation} + */ +public final class GraphOpCreation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphOpCreation) + GraphOpCreationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphOpCreation.class.getName()); + } + // Use GraphOpCreation.newBuilder() to construct. + private GraphOpCreation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphOpCreation() { + opType_ = ""; + opName_ = ""; + graphName_ = ""; + graphId_ = ""; + deviceName_ = ""; + inputNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + outputTensorIds_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphOpCreation.class, org.tensorflow.proto.GraphOpCreation.Builder.class); + } + + private int bitField0_; + public static final int OP_TYPE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object opType_ = ""; + /** + *
    +   * Type of the op (e.g., "MatMul").
    +   * 
    + * + * string op_type = 1; + * @return The opType. + */ + @java.lang.Override + public java.lang.String getOpType() { + java.lang.Object ref = opType_; + 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(); + opType_ = s; + return s; + } + } + /** + *
    +   * Type of the op (e.g., "MatMul").
    +   * 
    + * + * string op_type = 1; + * @return The bytes for opType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpTypeBytes() { + java.lang.Object ref = opType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OP_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object opName_ = ""; + /** + *
    +   * Name of the op (e.g., "Dense/MatMul_1").
    +   * 
    + * + * string op_name = 2; + * @return The opName. + */ + @java.lang.Override + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + 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(); + opName_ = s; + return s; + } + } + /** + *
    +   * Name of the op (e.g., "Dense/MatMul_1").
    +   * 
    + * + * string op_name = 2; + * @return The bytes for opName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRAPH_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object graphName_ = ""; + /** + *
    +   * Name of the graph that the op is a part of (if available).
    +   * 
    + * + * string graph_name = 3; + * @return The graphName. + */ + @java.lang.Override + public java.lang.String getGraphName() { + java.lang.Object ref = graphName_; + 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(); + graphName_ = s; + return s; + } + } + /** + *
    +   * Name of the graph that the op is a part of (if available).
    +   * 
    + * + * string graph_name = 3; + * @return The bytes for graphName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphNameBytes() { + java.lang.Object ref = graphName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRAPH_ID_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object graphId_ = ""; + /** + *
    +   * Unique ID of the graph (generated by debugger).
    +   * This is the ID of the immediately-enclosing graph.
    +   * 
    + * + * string graph_id = 4; + * @return The graphId. + */ + @java.lang.Override + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + 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(); + graphId_ = s; + return s; + } + } + /** + *
    +   * Unique ID of the graph (generated by debugger).
    +   * This is the ID of the immediately-enclosing graph.
    +   * 
    + * + * string graph_id = 4; + * @return The bytes for graphId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_NAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceName_ = ""; + /** + *
    +   * Name of the device that the op is assigned to (if available).
    +   * 
    + * + * string device_name = 5; + * @return The deviceName. + */ + @java.lang.Override + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + 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(); + deviceName_ = s; + return s; + } + } + /** + *
    +   * Name of the device that the op is assigned to (if available).
    +   * 
    + * + * string device_name = 5; + * @return The bytes for deviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_NAMES_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList inputNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Names of the input tensors to the op.
    +   * 
    + * + * repeated string input_names = 6; + * @return A list containing the inputNames. + */ + public com.google.protobuf.ProtocolStringList + getInputNamesList() { + return inputNames_; + } + /** + *
    +   * Names of the input tensors to the op.
    +   * 
    + * + * repeated string input_names = 6; + * @return The count of inputNames. + */ + public int getInputNamesCount() { + return inputNames_.size(); + } + /** + *
    +   * Names of the input tensors to the op.
    +   * 
    + * + * repeated string input_names = 6; + * @param index The index of the element to return. + * @return The inputNames at the given index. + */ + public java.lang.String getInputNames(int index) { + return inputNames_.get(index); + } + /** + *
    +   * Names of the input tensors to the op.
    +   * 
    + * + * repeated string input_names = 6; + * @param index The index of the value to return. + * @return The bytes of the inputNames at the given index. + */ + public com.google.protobuf.ByteString + getInputNamesBytes(int index) { + return inputNames_.getByteString(index); + } + + public static final int NUM_OUTPUTS_FIELD_NUMBER = 7; + private int numOutputs_ = 0; + /** + *
    +   * Number of output tensors emitted by the op.
    +   * 
    + * + * int32 num_outputs = 7; + * @return The numOutputs. + */ + @java.lang.Override + public int getNumOutputs() { + return numOutputs_; + } + + public static final int CODE_LOCATION_FIELD_NUMBER = 8; + private org.tensorflow.proto.CodeLocation codeLocation_; + /** + *
    +   * The unique ID for code location (stack trace) of the op's creation.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. + */ + @java.lang.Override + public boolean hasCodeLocation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The unique ID for code location (stack trace) of the op's creation.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. + */ + @java.lang.Override + public org.tensorflow.proto.CodeLocation getCodeLocation() { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + /** + *
    +   * The unique ID for code location (stack trace) of the op's creation.
    +   * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + @java.lang.Override + public org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder() { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + + public static final int OUTPUT_TENSOR_IDS_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList outputTensorIds_ = + emptyIntList(); + /** + *
    +   * Unique IDs for the output tensors of this op.
    +   * 
    + * + * repeated int32 output_tensor_ids = 9; + * @return A list containing the outputTensorIds. + */ + @java.lang.Override + public java.util.List + getOutputTensorIdsList() { + return outputTensorIds_; + } + /** + *
    +   * Unique IDs for the output tensors of this op.
    +   * 
    + * + * repeated int32 output_tensor_ids = 9; + * @return The count of outputTensorIds. + */ + public int getOutputTensorIdsCount() { + return outputTensorIds_.size(); + } + /** + *
    +   * Unique IDs for the output tensors of this op.
    +   * 
    + * + * repeated int32 output_tensor_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. + */ + public int getOutputTensorIds(int index) { + return outputTensorIds_.getInt(index); + } + private int outputTensorIdsMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, opType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, opName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, graphName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, graphId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, deviceName_); + } + for (int i = 0; i < inputNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, inputNames_.getRaw(i)); + } + if (numOutputs_ != 0) { + output.writeInt32(7, numOutputs_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getCodeLocation()); + } + if (getOutputTensorIdsList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(outputTensorIdsMemoizedSerializedSize); + } + for (int i = 0; i < outputTensorIds_.size(); i++) { + output.writeInt32NoTag(outputTensorIds_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, opType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, opName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, graphName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, graphId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, deviceName_); + } + { + int dataSize = 0; + for (int i = 0; i < inputNames_.size(); i++) { + dataSize += computeStringSizeNoTag(inputNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputNamesList().size(); + } + if (numOutputs_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, numOutputs_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getCodeLocation()); + } + { + int dataSize = 0; + for (int i = 0; i < outputTensorIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(outputTensorIds_.getInt(i)); + } + size += dataSize; + if (!getOutputTensorIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + outputTensorIdsMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.GraphOpCreation)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphOpCreation other = (org.tensorflow.proto.GraphOpCreation) obj; + + if (!getOpType() + .equals(other.getOpType())) return false; + if (!getOpName() + .equals(other.getOpName())) return false; + if (!getGraphName() + .equals(other.getGraphName())) return false; + if (!getGraphId() + .equals(other.getGraphId())) return false; + if (!getDeviceName() + .equals(other.getDeviceName())) return false; + if (!getInputNamesList() + .equals(other.getInputNamesList())) return false; + if (getNumOutputs() + != other.getNumOutputs()) return false; + if (hasCodeLocation() != other.hasCodeLocation()) return false; + if (hasCodeLocation()) { + if (!getCodeLocation() + .equals(other.getCodeLocation())) return false; + } + if (!getOutputTensorIdsList() + .equals(other.getOutputTensorIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getOpType().hashCode(); + hash = (37 * hash) + OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getOpName().hashCode(); + hash = (37 * hash) + GRAPH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGraphName().hashCode(); + hash = (37 * hash) + GRAPH_ID_FIELD_NUMBER; + hash = (53 * hash) + getGraphId().hashCode(); + hash = (37 * hash) + DEVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDeviceName().hashCode(); + if (getInputNamesCount() > 0) { + hash = (37 * hash) + INPUT_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getInputNamesList().hashCode(); + } + hash = (37 * hash) + NUM_OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getNumOutputs(); + if (hasCodeLocation()) { + hash = (37 * hash) + CODE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getCodeLocation().hashCode(); + } + if (getOutputTensorIdsCount() > 0) { + hash = (37 * hash) + OUTPUT_TENSOR_IDS_FIELD_NUMBER; + hash = (53 * hash) + getOutputTensorIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphOpCreation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOpCreation 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.GraphOpCreation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOpCreation 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.GraphOpCreation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOpCreation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphOpCreation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphOpCreation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphOpCreation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphOpCreation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphOpCreation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphOpCreation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphOpCreation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * The creation of an op in a TensorFlow Graph (e.g., FuncGraph in TF2).
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphOpCreation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphOpCreation) + org.tensorflow.proto.GraphOpCreationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphOpCreation.class, org.tensorflow.proto.GraphOpCreation.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphOpCreation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getCodeLocationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + opType_ = ""; + opName_ = ""; + graphName_ = ""; + graphId_ = ""; + deviceName_ = ""; + inputNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + numOutputs_ = 0; + codeLocation_ = null; + if (codeLocationBuilder_ != null) { + codeLocationBuilder_.dispose(); + codeLocationBuilder_ = null; + } + outputTensorIds_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_GraphOpCreation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphOpCreation getDefaultInstanceForType() { + return org.tensorflow.proto.GraphOpCreation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphOpCreation build() { + org.tensorflow.proto.GraphOpCreation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphOpCreation buildPartial() { + org.tensorflow.proto.GraphOpCreation result = new org.tensorflow.proto.GraphOpCreation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphOpCreation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.opType_ = opType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.opName_ = opName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.graphName_ = graphName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.graphId_ = graphId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deviceName_ = deviceName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + inputNames_.makeImmutable(); + result.inputNames_ = inputNames_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.numOutputs_ = numOutputs_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.codeLocation_ = codeLocationBuilder_ == null + ? codeLocation_ + : codeLocationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + outputTensorIds_.makeImmutable(); + result.outputTensorIds_ = outputTensorIds_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphOpCreation) { + return mergeFrom((org.tensorflow.proto.GraphOpCreation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphOpCreation other) { + if (other == org.tensorflow.proto.GraphOpCreation.getDefaultInstance()) return this; + if (!other.getOpType().isEmpty()) { + opType_ = other.opType_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOpName().isEmpty()) { + opName_ = other.opName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getGraphName().isEmpty()) { + graphName_ = other.graphName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getGraphId().isEmpty()) { + graphId_ = other.graphId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getDeviceName().isEmpty()) { + deviceName_ = other.deviceName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.inputNames_.isEmpty()) { + if (inputNames_.isEmpty()) { + inputNames_ = other.inputNames_; + bitField0_ |= 0x00000020; + } else { + ensureInputNamesIsMutable(); + inputNames_.addAll(other.inputNames_); + } + onChanged(); + } + if (other.getNumOutputs() != 0) { + setNumOutputs(other.getNumOutputs()); + } + if (other.hasCodeLocation()) { + mergeCodeLocation(other.getCodeLocation()); + } + if (!other.outputTensorIds_.isEmpty()) { + if (outputTensorIds_.isEmpty()) { + outputTensorIds_ = other.outputTensorIds_; + outputTensorIds_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addAll(other.outputTensorIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + opType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + opName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + graphName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + graphId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + deviceName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + ensureInputNamesIsMutable(); + inputNames_.add(s); + break; + } // case 50 + case 56: { + numOutputs_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + input.readMessage( + getCodeLocationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: { + int v = input.readInt32(); + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addInt(v); + break; + } // case 72 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputTensorIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputTensorIds_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object opType_ = ""; + /** + *
    +     * Type of the op (e.g., "MatMul").
    +     * 
    + * + * string op_type = 1; + * @return The opType. + */ + public java.lang.String getOpType() { + java.lang.Object ref = opType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Type of the op (e.g., "MatMul").
    +     * 
    + * + * string op_type = 1; + * @return The bytes for opType. + */ + public com.google.protobuf.ByteString + getOpTypeBytes() { + java.lang.Object ref = opType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Type of the op (e.g., "MatMul").
    +     * 
    + * + * string op_type = 1; + * @param value The opType to set. + * @return This builder for chaining. + */ + public Builder setOpType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Type of the op (e.g., "MatMul").
    +     * 
    + * + * string op_type = 1; + * @return This builder for chaining. + */ + public Builder clearOpType() { + opType_ = getDefaultInstance().getOpType(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Type of the op (e.g., "MatMul").
    +     * 
    + * + * string op_type = 1; + * @param value The bytes for opType to set. + * @return This builder for chaining. + */ + public Builder setOpTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object opName_ = ""; + /** + *
    +     * Name of the op (e.g., "Dense/MatMul_1").
    +     * 
    + * + * string op_name = 2; + * @return The opName. + */ + public java.lang.String getOpName() { + java.lang.Object ref = opName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the op (e.g., "Dense/MatMul_1").
    +     * 
    + * + * string op_name = 2; + * @return The bytes for opName. + */ + public com.google.protobuf.ByteString + getOpNameBytes() { + java.lang.Object ref = opName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the op (e.g., "Dense/MatMul_1").
    +     * 
    + * + * string op_name = 2; + * @param value The opName to set. + * @return This builder for chaining. + */ + public Builder setOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the op (e.g., "Dense/MatMul_1").
    +     * 
    + * + * string op_name = 2; + * @return This builder for chaining. + */ + public Builder clearOpName() { + opName_ = getDefaultInstance().getOpName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the op (e.g., "Dense/MatMul_1").
    +     * 
    + * + * string op_name = 2; + * @param value The bytes for opName to set. + * @return This builder for chaining. + */ + public Builder setOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object graphName_ = ""; + /** + *
    +     * Name of the graph that the op is a part of (if available).
    +     * 
    + * + * string graph_name = 3; + * @return The graphName. + */ + public java.lang.String getGraphName() { + java.lang.Object ref = graphName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the graph that the op is a part of (if available).
    +     * 
    + * + * string graph_name = 3; + * @return The bytes for graphName. + */ + public com.google.protobuf.ByteString + getGraphNameBytes() { + java.lang.Object ref = graphName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the graph that the op is a part of (if available).
    +     * 
    + * + * string graph_name = 3; + * @param value The graphName to set. + * @return This builder for chaining. + */ + public Builder setGraphName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name of the graph that the op is a part of (if available).
    +     * 
    + * + * string graph_name = 3; + * @return This builder for chaining. + */ + public Builder clearGraphName() { + graphName_ = getDefaultInstance().getGraphName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Name of the graph that the op is a part of (if available).
    +     * 
    + * + * string graph_name = 3; + * @param value The bytes for graphName to set. + * @return This builder for chaining. + */ + public Builder setGraphNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object graphId_ = ""; + /** + *
    +     * Unique ID of the graph (generated by debugger).
    +     * This is the ID of the immediately-enclosing graph.
    +     * 
    + * + * string graph_id = 4; + * @return The graphId. + */ + public java.lang.String getGraphId() { + java.lang.Object ref = graphId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Unique ID of the graph (generated by debugger).
    +     * This is the ID of the immediately-enclosing graph.
    +     * 
    + * + * string graph_id = 4; + * @return The bytes for graphId. + */ + public com.google.protobuf.ByteString + getGraphIdBytes() { + java.lang.Object ref = graphId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Unique ID of the graph (generated by debugger).
    +     * This is the ID of the immediately-enclosing graph.
    +     * 
    + * + * string graph_id = 4; + * @param value The graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Unique ID of the graph (generated by debugger).
    +     * This is the ID of the immediately-enclosing graph.
    +     * 
    + * + * string graph_id = 4; + * @return This builder for chaining. + */ + public Builder clearGraphId() { + graphId_ = getDefaultInstance().getGraphId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * Unique ID of the graph (generated by debugger).
    +     * This is the ID of the immediately-enclosing graph.
    +     * 
    + * + * string graph_id = 4; + * @param value The bytes for graphId to set. + * @return This builder for chaining. + */ + public Builder setGraphIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object deviceName_ = ""; + /** + *
    +     * Name of the device that the op is assigned to (if available).
    +     * 
    + * + * string device_name = 5; + * @return The deviceName. + */ + public java.lang.String getDeviceName() { + java.lang.Object ref = deviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the device that the op is assigned to (if available).
    +     * 
    + * + * string device_name = 5; + * @return The bytes for deviceName. + */ + public com.google.protobuf.ByteString + getDeviceNameBytes() { + java.lang.Object ref = deviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the device that the op is assigned to (if available).
    +     * 
    + * + * string device_name = 5; + * @param value The deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Name of the device that the op is assigned to (if available).
    +     * 
    + * + * string device_name = 5; + * @return This builder for chaining. + */ + public Builder clearDeviceName() { + deviceName_ = getDefaultInstance().getDeviceName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * Name of the device that the op is assigned to (if available).
    +     * 
    + * + * string device_name = 5; + * @param value The bytes for deviceName to set. + * @return This builder for chaining. + */ + public Builder setDeviceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList inputNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureInputNamesIsMutable() { + if (!inputNames_.isModifiable()) { + inputNames_ = new com.google.protobuf.LazyStringArrayList(inputNames_); + } + bitField0_ |= 0x00000020; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @return A list containing the inputNames. + */ + public com.google.protobuf.ProtocolStringList + getInputNamesList() { + inputNames_.makeImmutable(); + return inputNames_; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @return The count of inputNames. + */ + public int getInputNamesCount() { + return inputNames_.size(); + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param index The index of the element to return. + * @return The inputNames at the given index. + */ + public java.lang.String getInputNames(int index) { + return inputNames_.get(index); + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param index The index of the value to return. + * @return The bytes of the inputNames at the given index. + */ + public com.google.protobuf.ByteString + getInputNamesBytes(int index) { + return inputNames_.getByteString(index); + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param index The index to set the value at. + * @param value The inputNames to set. + * @return This builder for chaining. + */ + public Builder setInputNames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputNamesIsMutable(); + inputNames_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param value The inputNames to add. + * @return This builder for chaining. + */ + public Builder addInputNames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputNamesIsMutable(); + inputNames_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param values The inputNames to add. + * @return This builder for chaining. + */ + public Builder addAllInputNames( + java.lang.Iterable values) { + ensureInputNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputNames_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @return This builder for chaining. + */ + public Builder clearInputNames() { + inputNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020);; + onChanged(); + return this; + } + /** + *
    +     * Names of the input tensors to the op.
    +     * 
    + * + * repeated string input_names = 6; + * @param value The bytes of the inputNames to add. + * @return This builder for chaining. + */ + public Builder addInputNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureInputNamesIsMutable(); + inputNames_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int numOutputs_ ; + /** + *
    +     * Number of output tensors emitted by the op.
    +     * 
    + * + * int32 num_outputs = 7; + * @return The numOutputs. + */ + @java.lang.Override + public int getNumOutputs() { + return numOutputs_; + } + /** + *
    +     * Number of output tensors emitted by the op.
    +     * 
    + * + * int32 num_outputs = 7; + * @param value The numOutputs to set. + * @return This builder for chaining. + */ + public Builder setNumOutputs(int value) { + + numOutputs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Number of output tensors emitted by the op.
    +     * 
    + * + * int32 num_outputs = 7; + * @return This builder for chaining. + */ + public Builder clearNumOutputs() { + bitField0_ = (bitField0_ & ~0x00000040); + numOutputs_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.CodeLocation codeLocation_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder> codeLocationBuilder_; + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. + */ + public boolean hasCodeLocation() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. + */ + public org.tensorflow.proto.CodeLocation getCodeLocation() { + if (codeLocationBuilder_ == null) { + return codeLocation_ == null ? org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } else { + return codeLocationBuilder_.getMessage(); + } + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder setCodeLocation(org.tensorflow.proto.CodeLocation value) { + if (codeLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + codeLocation_ = value; + } else { + codeLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder setCodeLocation( + org.tensorflow.proto.CodeLocation.Builder builderForValue) { + if (codeLocationBuilder_ == null) { + codeLocation_ = builderForValue.build(); + } else { + codeLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder mergeCodeLocation(org.tensorflow.proto.CodeLocation value) { + if (codeLocationBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + codeLocation_ != null && + codeLocation_ != org.tensorflow.proto.CodeLocation.getDefaultInstance()) { + getCodeLocationBuilder().mergeFrom(value); + } else { + codeLocation_ = value; + } + } else { + codeLocationBuilder_.mergeFrom(value); + } + if (codeLocation_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public Builder clearCodeLocation() { + bitField0_ = (bitField0_ & ~0x00000080); + codeLocation_ = null; + if (codeLocationBuilder_ != null) { + codeLocationBuilder_.dispose(); + codeLocationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public org.tensorflow.proto.CodeLocation.Builder getCodeLocationBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getCodeLocationFieldBuilder().getBuilder(); + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + public org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder() { + if (codeLocationBuilder_ != null) { + return codeLocationBuilder_.getMessageOrBuilder(); + } else { + return codeLocation_ == null ? + org.tensorflow.proto.CodeLocation.getDefaultInstance() : codeLocation_; + } + } + /** + *
    +     * The unique ID for code location (stack trace) of the op's creation.
    +     * 
    + * + * .tensorflow.CodeLocation code_location = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder> + getCodeLocationFieldBuilder() { + if (codeLocationBuilder_ == null) { + codeLocationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CodeLocation, org.tensorflow.proto.CodeLocation.Builder, org.tensorflow.proto.CodeLocationOrBuilder>( + getCodeLocation(), + getParentForChildren(), + isClean()); + codeLocation_ = null; + } + return codeLocationBuilder_; + } + + private com.google.protobuf.Internal.IntList outputTensorIds_ = emptyIntList(); + private void ensureOutputTensorIdsIsMutable() { + if (!outputTensorIds_.isModifiable()) { + outputTensorIds_ = makeMutableCopy(outputTensorIds_); + } + bitField0_ |= 0x00000100; + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @return A list containing the outputTensorIds. + */ + public java.util.List + getOutputTensorIdsList() { + outputTensorIds_.makeImmutable(); + return outputTensorIds_; + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @return The count of outputTensorIds. + */ + public int getOutputTensorIdsCount() { + return outputTensorIds_.size(); + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. + */ + public int getOutputTensorIds(int index) { + return outputTensorIds_.getInt(index); + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @param index The index to set the value at. + * @param value The outputTensorIds to set. + * @return This builder for chaining. + */ + public Builder setOutputTensorIds( + int index, int value) { + + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.setInt(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @param value The outputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addOutputTensorIds(int value) { + + ensureOutputTensorIdsIsMutable(); + outputTensorIds_.addInt(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @param values The outputTensorIds to add. + * @return This builder for chaining. + */ + public Builder addAllOutputTensorIds( + java.lang.Iterable values) { + ensureOutputTensorIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputTensorIds_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Unique IDs for the output tensors of this op.
    +     * 
    + * + * repeated int32 output_tensor_ids = 9; + * @return This builder for chaining. + */ + public Builder clearOutputTensorIds() { + outputTensorIds_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphOpCreation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphOpCreation) + private static final org.tensorflow.proto.GraphOpCreation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphOpCreation(); + } + + public static org.tensorflow.proto.GraphOpCreation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphOpCreation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphOpCreation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreationOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreationOrBuilder.java index 60abaf9cdfe..f2a77fe07be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/GraphOpCreationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOpCreationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface GraphOpCreationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GraphOpCreation) @@ -13,6 +15,7 @@ public interface GraphOpCreationOrBuilder extends * * * string op_type = 1; + * @return The opType. */ java.lang.String getOpType(); /** @@ -21,6 +24,7 @@ public interface GraphOpCreationOrBuilder extends * * * string op_type = 1; + * @return The bytes for opType. */ com.google.protobuf.ByteString getOpTypeBytes(); @@ -31,6 +35,7 @@ public interface GraphOpCreationOrBuilder extends * * * string op_name = 2; + * @return The opName. */ java.lang.String getOpName(); /** @@ -39,6 +44,7 @@ public interface GraphOpCreationOrBuilder extends * * * string op_name = 2; + * @return The bytes for opName. */ com.google.protobuf.ByteString getOpNameBytes(); @@ -49,6 +55,7 @@ public interface GraphOpCreationOrBuilder extends * * * string graph_name = 3; + * @return The graphName. */ java.lang.String getGraphName(); /** @@ -57,6 +64,7 @@ public interface GraphOpCreationOrBuilder extends * * * string graph_name = 3; + * @return The bytes for graphName. */ com.google.protobuf.ByteString getGraphNameBytes(); @@ -68,6 +76,7 @@ public interface GraphOpCreationOrBuilder extends * * * string graph_id = 4; + * @return The graphId. */ java.lang.String getGraphId(); /** @@ -77,6 +86,7 @@ public interface GraphOpCreationOrBuilder extends * * * string graph_id = 4; + * @return The bytes for graphId. */ com.google.protobuf.ByteString getGraphIdBytes(); @@ -87,6 +97,7 @@ public interface GraphOpCreationOrBuilder extends * * * string device_name = 5; + * @return The deviceName. */ java.lang.String getDeviceName(); /** @@ -95,6 +106,7 @@ public interface GraphOpCreationOrBuilder extends * * * string device_name = 5; + * @return The bytes for deviceName. */ com.google.protobuf.ByteString getDeviceNameBytes(); @@ -105,6 +117,7 @@ public interface GraphOpCreationOrBuilder extends * * * repeated string input_names = 6; + * @return A list containing the inputNames. */ java.util.List getInputNamesList(); @@ -114,6 +127,7 @@ public interface GraphOpCreationOrBuilder extends * * * repeated string input_names = 6; + * @return The count of inputNames. */ int getInputNamesCount(); /** @@ -122,6 +136,8 @@ public interface GraphOpCreationOrBuilder extends * * * repeated string input_names = 6; + * @param index The index of the element to return. + * @return The inputNames at the given index. */ java.lang.String getInputNames(int index); /** @@ -130,6 +146,8 @@ public interface GraphOpCreationOrBuilder extends * * * repeated string input_names = 6; + * @param index The index of the value to return. + * @return The bytes of the inputNames at the given index. */ com.google.protobuf.ByteString getInputNamesBytes(int index); @@ -140,6 +158,7 @@ public interface GraphOpCreationOrBuilder extends * * * int32 num_outputs = 7; + * @return The numOutputs. */ int getNumOutputs(); @@ -149,6 +168,7 @@ public interface GraphOpCreationOrBuilder extends * * * .tensorflow.CodeLocation code_location = 8; + * @return Whether the codeLocation field is set. */ boolean hasCodeLocation(); /** @@ -157,8 +177,9 @@ public interface GraphOpCreationOrBuilder extends * * * .tensorflow.CodeLocation code_location = 8; + * @return The codeLocation. */ - org.tensorflow.proto.util.CodeLocation getCodeLocation(); + org.tensorflow.proto.CodeLocation getCodeLocation(); /** *
        * The unique ID for code location (stack trace) of the op's creation.
    @@ -166,7 +187,7 @@ public interface GraphOpCreationOrBuilder extends
        *
        * .tensorflow.CodeLocation code_location = 8;
        */
    -  org.tensorflow.proto.util.CodeLocationOrBuilder getCodeLocationOrBuilder();
    +  org.tensorflow.proto.CodeLocationOrBuilder getCodeLocationOrBuilder();
     
       /**
        * 
    @@ -174,6 +195,7 @@ public interface GraphOpCreationOrBuilder extends
        * 
    * * repeated int32 output_tensor_ids = 9; + * @return A list containing the outputTensorIds. */ java.util.List getOutputTensorIdsList(); /** @@ -182,6 +204,7 @@ public interface GraphOpCreationOrBuilder extends *
    * * repeated int32 output_tensor_ids = 9; + * @return The count of outputTensorIds. */ int getOutputTensorIdsCount(); /** @@ -190,6 +213,8 @@ public interface GraphOpCreationOrBuilder extends * * * repeated int32 output_tensor_ids = 9; + * @param index The index of the element to return. + * @return The outputTensorIds at the given index. */ int getOutputTensorIds(int index); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptions.java new file mode 100644 index 00000000000..db16e305ded --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptions.java @@ -0,0 +1,1491 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphOptions} + */ +public final class GraphOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphOptions) + GraphOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphOptions.class.getName()); + } + // Use GraphOptions.newBuilder() to construct. + private GraphOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphOptions.class, org.tensorflow.proto.GraphOptions.Builder.class); + } + + private int bitField0_; + public static final int ENABLE_RECV_SCHEDULING_FIELD_NUMBER = 2; + private boolean enableRecvScheduling_ = false; + /** + *
    +   * If true, use control flow to schedule the activation of Recv nodes.
    +   * (Currently ignored.)
    +   * 
    + * + * bool enable_recv_scheduling = 2; + * @return The enableRecvScheduling. + */ + @java.lang.Override + public boolean getEnableRecvScheduling() { + return enableRecvScheduling_; + } + + public static final int OPTIMIZER_OPTIONS_FIELD_NUMBER = 3; + private org.tensorflow.proto.OptimizerOptions optimizerOptions_; + /** + *
    +   * Options controlling how graph is optimized.
    +   * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return Whether the optimizerOptions field is set. + */ + @java.lang.Override + public boolean hasOptimizerOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Options controlling how graph is optimized.
    +   * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return The optimizerOptions. + */ + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions getOptimizerOptions() { + return optimizerOptions_ == null ? org.tensorflow.proto.OptimizerOptions.getDefaultInstance() : optimizerOptions_; + } + /** + *
    +   * Options controlling how graph is optimized.
    +   * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + @java.lang.Override + public org.tensorflow.proto.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() { + return optimizerOptions_ == null ? org.tensorflow.proto.OptimizerOptions.getDefaultInstance() : optimizerOptions_; + } + + public static final int BUILD_COST_MODEL_FIELD_NUMBER = 4; + private long buildCostModel_ = 0L; + /** + *
    +   * The number of steps to run before returning a cost model detailing
    +   * the memory usage and performance of each node of the graph. 0 means
    +   * no cost model.
    +   * 
    + * + * int64 build_cost_model = 4; + * @return The buildCostModel. + */ + @java.lang.Override + public long getBuildCostModel() { + return buildCostModel_; + } + + public static final int BUILD_COST_MODEL_AFTER_FIELD_NUMBER = 9; + private long buildCostModelAfter_ = 0L; + /** + *
    +   * The number of steps to skip before collecting statistics for the
    +   * cost model.
    +   * 
    + * + * int64 build_cost_model_after = 9; + * @return The buildCostModelAfter. + */ + @java.lang.Override + public long getBuildCostModelAfter() { + return buildCostModelAfter_; + } + + public static final int INFER_SHAPES_FIELD_NUMBER = 5; + private boolean inferShapes_ = false; + /** + *
    +   * Annotate each Node with Op output shape data, to the extent it can
    +   * be statically inferred.
    +   * 
    + * + * bool infer_shapes = 5; + * @return The inferShapes. + */ + @java.lang.Override + public boolean getInferShapes() { + return inferShapes_; + } + + public static final int PLACE_PRUNED_GRAPH_FIELD_NUMBER = 6; + private boolean placePrunedGraph_ = false; + /** + *
    +   * Only place the subgraphs that are run, rather than the entire graph.
    +   *
    +   * This is useful for interactive graph building, where one might
    +   * produce graphs that cannot be placed during the debugging
    +   * process.  In particular, it allows the client to continue work in
    +   * a session after adding a node to a graph whose placement
    +   * constraints are unsatisfiable.
    +   * 
    + * + * bool place_pruned_graph = 6; + * @return The placePrunedGraph. + */ + @java.lang.Override + public boolean getPlacePrunedGraph() { + return placePrunedGraph_; + } + + public static final int ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER = 7; + private boolean enableBfloat16Sendrecv_ = false; + /** + *
    +   * If true, transfer float values between processes as bfloat16.
    +   * 
    + * + * bool enable_bfloat16_sendrecv = 7; + * @return The enableBfloat16Sendrecv. + */ + @java.lang.Override + public boolean getEnableBfloat16Sendrecv() { + return enableBfloat16Sendrecv_; + } + + public static final int TIMELINE_STEP_FIELD_NUMBER = 8; + private int timelineStep_ = 0; + /** + *
    +   * If > 0, record a timeline every this many steps.
    +   * EXPERIMENTAL: This currently has no effect in MasterSession.
    +   * 
    + * + * int32 timeline_step = 8; + * @return The timelineStep. + */ + @java.lang.Override + public int getTimelineStep() { + return timelineStep_; + } + + public static final int REWRITE_OPTIONS_FIELD_NUMBER = 10; + private org.tensorflow.proto.RewriterConfig rewriteOptions_; + /** + *
    +   * Options that control the type and amount of graph rewriting.
    +   * Not currently configurable via the public Python API (i.e. there is no API
    +   * stability guarantee if you import RewriterConfig explicitly).
    +   * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + * @return Whether the rewriteOptions field is set. + */ + @java.lang.Override + public boolean hasRewriteOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * Options that control the type and amount of graph rewriting.
    +   * Not currently configurable via the public Python API (i.e. there is no API
    +   * stability guarantee if you import RewriterConfig explicitly).
    +   * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + * @return The rewriteOptions. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig getRewriteOptions() { + return rewriteOptions_ == null ? org.tensorflow.proto.RewriterConfig.getDefaultInstance() : rewriteOptions_; + } + /** + *
    +   * Options that control the type and amount of graph rewriting.
    +   * Not currently configurable via the public Python API (i.e. there is no API
    +   * stability guarantee if you import RewriterConfig explicitly).
    +   * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() { + return rewriteOptions_ == null ? org.tensorflow.proto.RewriterConfig.getDefaultInstance() : rewriteOptions_; + } + + 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 (enableRecvScheduling_ != false) { + output.writeBool(2, enableRecvScheduling_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getOptimizerOptions()); + } + if (buildCostModel_ != 0L) { + output.writeInt64(4, buildCostModel_); + } + if (inferShapes_ != false) { + output.writeBool(5, inferShapes_); + } + if (placePrunedGraph_ != false) { + output.writeBool(6, placePrunedGraph_); + } + if (enableBfloat16Sendrecv_ != false) { + output.writeBool(7, enableBfloat16Sendrecv_); + } + if (timelineStep_ != 0) { + output.writeInt32(8, timelineStep_); + } + if (buildCostModelAfter_ != 0L) { + output.writeInt64(9, buildCostModelAfter_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getRewriteOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableRecvScheduling_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, enableRecvScheduling_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getOptimizerOptions()); + } + if (buildCostModel_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, buildCostModel_); + } + if (inferShapes_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, inferShapes_); + } + if (placePrunedGraph_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, placePrunedGraph_); + } + if (enableBfloat16Sendrecv_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, enableBfloat16Sendrecv_); + } + if (timelineStep_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, timelineStep_); + } + if (buildCostModelAfter_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, buildCostModelAfter_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getRewriteOptions()); + } + size += getUnknownFields().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.GraphOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphOptions other = (org.tensorflow.proto.GraphOptions) obj; + + if (getEnableRecvScheduling() + != other.getEnableRecvScheduling()) return false; + if (hasOptimizerOptions() != other.hasOptimizerOptions()) return false; + if (hasOptimizerOptions()) { + if (!getOptimizerOptions() + .equals(other.getOptimizerOptions())) return false; + } + if (getBuildCostModel() + != other.getBuildCostModel()) return false; + if (getBuildCostModelAfter() + != other.getBuildCostModelAfter()) return false; + if (getInferShapes() + != other.getInferShapes()) return false; + if (getPlacePrunedGraph() + != other.getPlacePrunedGraph()) return false; + if (getEnableBfloat16Sendrecv() + != other.getEnableBfloat16Sendrecv()) return false; + if (getTimelineStep() + != other.getTimelineStep()) return false; + if (hasRewriteOptions() != other.hasRewriteOptions()) return false; + if (hasRewriteOptions()) { + if (!getRewriteOptions() + .equals(other.getRewriteOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ENABLE_RECV_SCHEDULING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableRecvScheduling()); + if (hasOptimizerOptions()) { + hash = (37 * hash) + OPTIMIZER_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptimizerOptions().hashCode(); + } + hash = (37 * hash) + BUILD_COST_MODEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBuildCostModel()); + hash = (37 * hash) + BUILD_COST_MODEL_AFTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBuildCostModelAfter()); + hash = (37 * hash) + INFER_SHAPES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInferShapes()); + hash = (37 * hash) + PLACE_PRUNED_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPlacePrunedGraph()); + hash = (37 * hash) + ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableBfloat16Sendrecv()); + hash = (37 * hash) + TIMELINE_STEP_FIELD_NUMBER; + hash = (53 * hash) + getTimelineStep(); + if (hasRewriteOptions()) { + hash = (37 * hash) + REWRITE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRewriteOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOptions 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.GraphOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOptions 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.GraphOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphOptions) + org.tensorflow.proto.GraphOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphOptions.class, org.tensorflow.proto.GraphOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getOptimizerOptionsFieldBuilder(); + getRewriteOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enableRecvScheduling_ = false; + optimizerOptions_ = null; + if (optimizerOptionsBuilder_ != null) { + optimizerOptionsBuilder_.dispose(); + optimizerOptionsBuilder_ = null; + } + buildCostModel_ = 0L; + buildCostModelAfter_ = 0L; + inferShapes_ = false; + placePrunedGraph_ = false; + enableBfloat16Sendrecv_ = false; + timelineStep_ = 0; + rewriteOptions_ = null; + if (rewriteOptionsBuilder_ != null) { + rewriteOptionsBuilder_.dispose(); + rewriteOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphOptions getDefaultInstanceForType() { + return org.tensorflow.proto.GraphOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphOptions build() { + org.tensorflow.proto.GraphOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphOptions buildPartial() { + org.tensorflow.proto.GraphOptions result = new org.tensorflow.proto.GraphOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enableRecvScheduling_ = enableRecvScheduling_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.optimizerOptions_ = optimizerOptionsBuilder_ == null + ? optimizerOptions_ + : optimizerOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.buildCostModel_ = buildCostModel_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.buildCostModelAfter_ = buildCostModelAfter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.inferShapes_ = inferShapes_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.placePrunedGraph_ = placePrunedGraph_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.enableBfloat16Sendrecv_ = enableBfloat16Sendrecv_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.timelineStep_ = timelineStep_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.rewriteOptions_ = rewriteOptionsBuilder_ == null + ? rewriteOptions_ + : rewriteOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphOptions) { + return mergeFrom((org.tensorflow.proto.GraphOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphOptions other) { + if (other == org.tensorflow.proto.GraphOptions.getDefaultInstance()) return this; + if (other.getEnableRecvScheduling() != false) { + setEnableRecvScheduling(other.getEnableRecvScheduling()); + } + if (other.hasOptimizerOptions()) { + mergeOptimizerOptions(other.getOptimizerOptions()); + } + if (other.getBuildCostModel() != 0L) { + setBuildCostModel(other.getBuildCostModel()); + } + if (other.getBuildCostModelAfter() != 0L) { + setBuildCostModelAfter(other.getBuildCostModelAfter()); + } + if (other.getInferShapes() != false) { + setInferShapes(other.getInferShapes()); + } + if (other.getPlacePrunedGraph() != false) { + setPlacePrunedGraph(other.getPlacePrunedGraph()); + } + if (other.getEnableBfloat16Sendrecv() != false) { + setEnableBfloat16Sendrecv(other.getEnableBfloat16Sendrecv()); + } + if (other.getTimelineStep() != 0) { + setTimelineStep(other.getTimelineStep()); + } + if (other.hasRewriteOptions()) { + mergeRewriteOptions(other.getRewriteOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: { + enableRecvScheduling_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 26: { + input.readMessage( + getOptimizerOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: { + buildCostModel_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: { + inferShapes_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + placePrunedGraph_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + enableBfloat16Sendrecv_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + timelineStep_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + buildCostModelAfter_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 72 + case 82: { + input.readMessage( + getRewriteOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 82 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean enableRecvScheduling_ ; + /** + *
    +     * If true, use control flow to schedule the activation of Recv nodes.
    +     * (Currently ignored.)
    +     * 
    + * + * bool enable_recv_scheduling = 2; + * @return The enableRecvScheduling. + */ + @java.lang.Override + public boolean getEnableRecvScheduling() { + return enableRecvScheduling_; + } + /** + *
    +     * If true, use control flow to schedule the activation of Recv nodes.
    +     * (Currently ignored.)
    +     * 
    + * + * bool enable_recv_scheduling = 2; + * @param value The enableRecvScheduling to set. + * @return This builder for chaining. + */ + public Builder setEnableRecvScheduling(boolean value) { + + enableRecvScheduling_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * If true, use control flow to schedule the activation of Recv nodes.
    +     * (Currently ignored.)
    +     * 
    + * + * bool enable_recv_scheduling = 2; + * @return This builder for chaining. + */ + public Builder clearEnableRecvScheduling() { + bitField0_ = (bitField0_ & ~0x00000001); + enableRecvScheduling_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.OptimizerOptions optimizerOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OptimizerOptions, org.tensorflow.proto.OptimizerOptions.Builder, org.tensorflow.proto.OptimizerOptionsOrBuilder> optimizerOptionsBuilder_; + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return Whether the optimizerOptions field is set. + */ + public boolean hasOptimizerOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return The optimizerOptions. + */ + public org.tensorflow.proto.OptimizerOptions getOptimizerOptions() { + if (optimizerOptionsBuilder_ == null) { + return optimizerOptions_ == null ? org.tensorflow.proto.OptimizerOptions.getDefaultInstance() : optimizerOptions_; + } else { + return optimizerOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public Builder setOptimizerOptions(org.tensorflow.proto.OptimizerOptions value) { + if (optimizerOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + optimizerOptions_ = value; + } else { + optimizerOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public Builder setOptimizerOptions( + org.tensorflow.proto.OptimizerOptions.Builder builderForValue) { + if (optimizerOptionsBuilder_ == null) { + optimizerOptions_ = builderForValue.build(); + } else { + optimizerOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public Builder mergeOptimizerOptions(org.tensorflow.proto.OptimizerOptions value) { + if (optimizerOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + optimizerOptions_ != null && + optimizerOptions_ != org.tensorflow.proto.OptimizerOptions.getDefaultInstance()) { + getOptimizerOptionsBuilder().mergeFrom(value); + } else { + optimizerOptions_ = value; + } + } else { + optimizerOptionsBuilder_.mergeFrom(value); + } + if (optimizerOptions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public Builder clearOptimizerOptions() { + bitField0_ = (bitField0_ & ~0x00000002); + optimizerOptions_ = null; + if (optimizerOptionsBuilder_ != null) { + optimizerOptionsBuilder_.dispose(); + optimizerOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public org.tensorflow.proto.OptimizerOptions.Builder getOptimizerOptionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getOptimizerOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + public org.tensorflow.proto.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() { + if (optimizerOptionsBuilder_ != null) { + return optimizerOptionsBuilder_.getMessageOrBuilder(); + } else { + return optimizerOptions_ == null ? + org.tensorflow.proto.OptimizerOptions.getDefaultInstance() : optimizerOptions_; + } + } + /** + *
    +     * Options controlling how graph is optimized.
    +     * 
    + * + * .tensorflow.OptimizerOptions optimizer_options = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OptimizerOptions, org.tensorflow.proto.OptimizerOptions.Builder, org.tensorflow.proto.OptimizerOptionsOrBuilder> + getOptimizerOptionsFieldBuilder() { + if (optimizerOptionsBuilder_ == null) { + optimizerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OptimizerOptions, org.tensorflow.proto.OptimizerOptions.Builder, org.tensorflow.proto.OptimizerOptionsOrBuilder>( + getOptimizerOptions(), + getParentForChildren(), + isClean()); + optimizerOptions_ = null; + } + return optimizerOptionsBuilder_; + } + + private long buildCostModel_ ; + /** + *
    +     * The number of steps to run before returning a cost model detailing
    +     * the memory usage and performance of each node of the graph. 0 means
    +     * no cost model.
    +     * 
    + * + * int64 build_cost_model = 4; + * @return The buildCostModel. + */ + @java.lang.Override + public long getBuildCostModel() { + return buildCostModel_; + } + /** + *
    +     * The number of steps to run before returning a cost model detailing
    +     * the memory usage and performance of each node of the graph. 0 means
    +     * no cost model.
    +     * 
    + * + * int64 build_cost_model = 4; + * @param value The buildCostModel to set. + * @return This builder for chaining. + */ + public Builder setBuildCostModel(long value) { + + buildCostModel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The number of steps to run before returning a cost model detailing
    +     * the memory usage and performance of each node of the graph. 0 means
    +     * no cost model.
    +     * 
    + * + * int64 build_cost_model = 4; + * @return This builder for chaining. + */ + public Builder clearBuildCostModel() { + bitField0_ = (bitField0_ & ~0x00000004); + buildCostModel_ = 0L; + onChanged(); + return this; + } + + private long buildCostModelAfter_ ; + /** + *
    +     * The number of steps to skip before collecting statistics for the
    +     * cost model.
    +     * 
    + * + * int64 build_cost_model_after = 9; + * @return The buildCostModelAfter. + */ + @java.lang.Override + public long getBuildCostModelAfter() { + return buildCostModelAfter_; + } + /** + *
    +     * The number of steps to skip before collecting statistics for the
    +     * cost model.
    +     * 
    + * + * int64 build_cost_model_after = 9; + * @param value The buildCostModelAfter to set. + * @return This builder for chaining. + */ + public Builder setBuildCostModelAfter(long value) { + + buildCostModelAfter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The number of steps to skip before collecting statistics for the
    +     * cost model.
    +     * 
    + * + * int64 build_cost_model_after = 9; + * @return This builder for chaining. + */ + public Builder clearBuildCostModelAfter() { + bitField0_ = (bitField0_ & ~0x00000008); + buildCostModelAfter_ = 0L; + onChanged(); + return this; + } + + private boolean inferShapes_ ; + /** + *
    +     * Annotate each Node with Op output shape data, to the extent it can
    +     * be statically inferred.
    +     * 
    + * + * bool infer_shapes = 5; + * @return The inferShapes. + */ + @java.lang.Override + public boolean getInferShapes() { + return inferShapes_; + } + /** + *
    +     * Annotate each Node with Op output shape data, to the extent it can
    +     * be statically inferred.
    +     * 
    + * + * bool infer_shapes = 5; + * @param value The inferShapes to set. + * @return This builder for chaining. + */ + public Builder setInferShapes(boolean value) { + + inferShapes_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Annotate each Node with Op output shape data, to the extent it can
    +     * be statically inferred.
    +     * 
    + * + * bool infer_shapes = 5; + * @return This builder for chaining. + */ + public Builder clearInferShapes() { + bitField0_ = (bitField0_ & ~0x00000010); + inferShapes_ = false; + onChanged(); + return this; + } + + private boolean placePrunedGraph_ ; + /** + *
    +     * Only place the subgraphs that are run, rather than the entire graph.
    +     *
    +     * This is useful for interactive graph building, where one might
    +     * produce graphs that cannot be placed during the debugging
    +     * process.  In particular, it allows the client to continue work in
    +     * a session after adding a node to a graph whose placement
    +     * constraints are unsatisfiable.
    +     * 
    + * + * bool place_pruned_graph = 6; + * @return The placePrunedGraph. + */ + @java.lang.Override + public boolean getPlacePrunedGraph() { + return placePrunedGraph_; + } + /** + *
    +     * Only place the subgraphs that are run, rather than the entire graph.
    +     *
    +     * This is useful for interactive graph building, where one might
    +     * produce graphs that cannot be placed during the debugging
    +     * process.  In particular, it allows the client to continue work in
    +     * a session after adding a node to a graph whose placement
    +     * constraints are unsatisfiable.
    +     * 
    + * + * bool place_pruned_graph = 6; + * @param value The placePrunedGraph to set. + * @return This builder for chaining. + */ + public Builder setPlacePrunedGraph(boolean value) { + + placePrunedGraph_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Only place the subgraphs that are run, rather than the entire graph.
    +     *
    +     * This is useful for interactive graph building, where one might
    +     * produce graphs that cannot be placed during the debugging
    +     * process.  In particular, it allows the client to continue work in
    +     * a session after adding a node to a graph whose placement
    +     * constraints are unsatisfiable.
    +     * 
    + * + * bool place_pruned_graph = 6; + * @return This builder for chaining. + */ + public Builder clearPlacePrunedGraph() { + bitField0_ = (bitField0_ & ~0x00000020); + placePrunedGraph_ = false; + onChanged(); + return this; + } + + private boolean enableBfloat16Sendrecv_ ; + /** + *
    +     * If true, transfer float values between processes as bfloat16.
    +     * 
    + * + * bool enable_bfloat16_sendrecv = 7; + * @return The enableBfloat16Sendrecv. + */ + @java.lang.Override + public boolean getEnableBfloat16Sendrecv() { + return enableBfloat16Sendrecv_; + } + /** + *
    +     * If true, transfer float values between processes as bfloat16.
    +     * 
    + * + * bool enable_bfloat16_sendrecv = 7; + * @param value The enableBfloat16Sendrecv to set. + * @return This builder for chaining. + */ + public Builder setEnableBfloat16Sendrecv(boolean value) { + + enableBfloat16Sendrecv_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * If true, transfer float values between processes as bfloat16.
    +     * 
    + * + * bool enable_bfloat16_sendrecv = 7; + * @return This builder for chaining. + */ + public Builder clearEnableBfloat16Sendrecv() { + bitField0_ = (bitField0_ & ~0x00000040); + enableBfloat16Sendrecv_ = false; + onChanged(); + return this; + } + + private int timelineStep_ ; + /** + *
    +     * If > 0, record a timeline every this many steps.
    +     * EXPERIMENTAL: This currently has no effect in MasterSession.
    +     * 
    + * + * int32 timeline_step = 8; + * @return The timelineStep. + */ + @java.lang.Override + public int getTimelineStep() { + return timelineStep_; + } + /** + *
    +     * If > 0, record a timeline every this many steps.
    +     * EXPERIMENTAL: This currently has no effect in MasterSession.
    +     * 
    + * + * int32 timeline_step = 8; + * @param value The timelineStep to set. + * @return This builder for chaining. + */ + public Builder setTimelineStep(int value) { + + timelineStep_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * If > 0, record a timeline every this many steps.
    +     * EXPERIMENTAL: This currently has no effect in MasterSession.
    +     * 
    + * + * int32 timeline_step = 8; + * @return This builder for chaining. + */ + public Builder clearTimelineStep() { + bitField0_ = (bitField0_ & ~0x00000080); + timelineStep_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.RewriterConfig rewriteOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RewriterConfig, org.tensorflow.proto.RewriterConfig.Builder, org.tensorflow.proto.RewriterConfigOrBuilder> rewriteOptionsBuilder_; + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + * @return Whether the rewriteOptions field is set. + */ + public boolean hasRewriteOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + * @return The rewriteOptions. + */ + public org.tensorflow.proto.RewriterConfig getRewriteOptions() { + if (rewriteOptionsBuilder_ == null) { + return rewriteOptions_ == null ? org.tensorflow.proto.RewriterConfig.getDefaultInstance() : rewriteOptions_; + } else { + return rewriteOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public Builder setRewriteOptions(org.tensorflow.proto.RewriterConfig value) { + if (rewriteOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rewriteOptions_ = value; + } else { + rewriteOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public Builder setRewriteOptions( + org.tensorflow.proto.RewriterConfig.Builder builderForValue) { + if (rewriteOptionsBuilder_ == null) { + rewriteOptions_ = builderForValue.build(); + } else { + rewriteOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public Builder mergeRewriteOptions(org.tensorflow.proto.RewriterConfig value) { + if (rewriteOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + rewriteOptions_ != null && + rewriteOptions_ != org.tensorflow.proto.RewriterConfig.getDefaultInstance()) { + getRewriteOptionsBuilder().mergeFrom(value); + } else { + rewriteOptions_ = value; + } + } else { + rewriteOptionsBuilder_.mergeFrom(value); + } + if (rewriteOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public Builder clearRewriteOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + rewriteOptions_ = null; + if (rewriteOptionsBuilder_ != null) { + rewriteOptionsBuilder_.dispose(); + rewriteOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public org.tensorflow.proto.RewriterConfig.Builder getRewriteOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getRewriteOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + public org.tensorflow.proto.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() { + if (rewriteOptionsBuilder_ != null) { + return rewriteOptionsBuilder_.getMessageOrBuilder(); + } else { + return rewriteOptions_ == null ? + org.tensorflow.proto.RewriterConfig.getDefaultInstance() : rewriteOptions_; + } + } + /** + *
    +     * Options that control the type and amount of graph rewriting.
    +     * Not currently configurable via the public Python API (i.e. there is no API
    +     * stability guarantee if you import RewriterConfig explicitly).
    +     * 
    + * + * .tensorflow.RewriterConfig rewrite_options = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RewriterConfig, org.tensorflow.proto.RewriterConfig.Builder, org.tensorflow.proto.RewriterConfigOrBuilder> + getRewriteOptionsFieldBuilder() { + if (rewriteOptionsBuilder_ == null) { + rewriteOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RewriterConfig, org.tensorflow.proto.RewriterConfig.Builder, org.tensorflow.proto.RewriterConfigOrBuilder>( + getRewriteOptions(), + getParentForChildren(), + isClean()); + rewriteOptions_ = null; + } + return rewriteOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphOptions) + private static final org.tensorflow.proto.GraphOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphOptions(); + } + + public static org.tensorflow.proto.GraphOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptionsOrBuilder.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptionsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptionsOrBuilder.java index bc373a1f956..7f2113d9509 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphOptionsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphOptionsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface GraphOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GraphOptions) @@ -14,6 +16,7 @@ public interface GraphOptionsOrBuilder extends * * * bool enable_recv_scheduling = 2; + * @return The enableRecvScheduling. */ boolean getEnableRecvScheduling(); @@ -23,6 +26,7 @@ public interface GraphOptionsOrBuilder extends * * * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return Whether the optimizerOptions field is set. */ boolean hasOptimizerOptions(); /** @@ -31,8 +35,9 @@ public interface GraphOptionsOrBuilder extends * * * .tensorflow.OptimizerOptions optimizer_options = 3; + * @return The optimizerOptions. */ - org.tensorflow.proto.framework.OptimizerOptions getOptimizerOptions(); + org.tensorflow.proto.OptimizerOptions getOptimizerOptions(); /** *
        * Options controlling how graph is optimized.
    @@ -40,7 +45,7 @@ public interface GraphOptionsOrBuilder extends
        *
        * .tensorflow.OptimizerOptions optimizer_options = 3;
        */
    -  org.tensorflow.proto.framework.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder();
    +  org.tensorflow.proto.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder();
     
       /**
        * 
    @@ -50,6 +55,7 @@ public interface GraphOptionsOrBuilder extends
        * 
    * * int64 build_cost_model = 4; + * @return The buildCostModel. */ long getBuildCostModel(); @@ -60,6 +66,7 @@ public interface GraphOptionsOrBuilder extends *
    * * int64 build_cost_model_after = 9; + * @return The buildCostModelAfter. */ long getBuildCostModelAfter(); @@ -70,12 +77,14 @@ public interface GraphOptionsOrBuilder extends * * * bool infer_shapes = 5; + * @return The inferShapes. */ boolean getInferShapes(); /** *
        * Only place the subgraphs that are run, rather than the entire graph.
    +   *
        * This is useful for interactive graph building, where one might
        * produce graphs that cannot be placed during the debugging
        * process.  In particular, it allows the client to continue work in
    @@ -84,6 +93,7 @@ public interface GraphOptionsOrBuilder extends
        * 
    * * bool place_pruned_graph = 6; + * @return The placePrunedGraph. */ boolean getPlacePrunedGraph(); @@ -93,6 +103,7 @@ public interface GraphOptionsOrBuilder extends * * * bool enable_bfloat16_sendrecv = 7; + * @return The enableBfloat16Sendrecv. */ boolean getEnableBfloat16Sendrecv(); @@ -103,6 +114,7 @@ public interface GraphOptionsOrBuilder extends * * * int32 timeline_step = 8; + * @return The timelineStep. */ int getTimelineStep(); @@ -114,6 +126,7 @@ public interface GraphOptionsOrBuilder extends * * * .tensorflow.RewriterConfig rewrite_options = 10; + * @return Whether the rewriteOptions field is set. */ boolean hasRewriteOptions(); /** @@ -124,8 +137,9 @@ public interface GraphOptionsOrBuilder extends * * * .tensorflow.RewriterConfig rewrite_options = 10; + * @return The rewriteOptions. */ - org.tensorflow.proto.framework.RewriterConfig getRewriteOptions(); + org.tensorflow.proto.RewriterConfig getRewriteOptions(); /** *
        * Options that control the type and amount of graph rewriting.
    @@ -135,5 +149,5 @@ public interface GraphOptionsOrBuilder extends
        *
        * .tensorflow.RewriterConfig rewrite_options = 10;
        */
    -  org.tensorflow.proto.framework.RewriterConfigOrBuilder getRewriteOptionsOrBuilder();
    +  org.tensorflow.proto.RewriterConfigOrBuilder getRewriteOptionsOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphProtos.java
    new file mode 100644
    index 00000000000..213acdde175
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphProtos.java
    @@ -0,0 +1,80 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class GraphProtos {
    +  private GraphProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      GraphProtos.class.getName());
    +  }
    +  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_GraphDef_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_GraphDef_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/framework/graph.proto\022" +
    +      "\ntensorflow\032(tensorflow/core/framework/f" +
    +      "unction.proto\0320tensorflow/core/framework" +
    +      "/graph_debug_info.proto\032(tensorflow/core" +
    +      "/framework/node_def.proto\032(tensorflow/co" +
    +      "re/framework/versions.proto\"\315\001\n\010GraphDef" +
    +      "\022!\n\004node\030\001 \003(\0132\023.tensorflow.NodeDef\022(\n\010v" +
    +      "ersions\030\004 \001(\0132\026.tensorflow.VersionDef\022\023\n" +
    +      "\007version\030\003 \001(\005B\002\030\001\022/\n\007library\030\002 \001(\0132\036.te" +
    +      "nsorflow.FunctionDefLibrary\022.\n\ndebug_inf" +
    +      "o\030\005 \001(\0132\032.tensorflow.GraphDebugInfoBv\n\024o" +
    +      "rg.tensorflow.protoB\013GraphProtosP\001ZLgith" +
    +      "ub.com/tensorflow/tensorflow/tensorflow/" +
    +      "go/core/framework/graph_go_proto\370\001\001b\006pro" +
    +      "to3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.FunctionProtos.getDescriptor(),
    +          org.tensorflow.proto.GraphDebugInfoProtos.getDescriptor(),
    +          org.tensorflow.proto.NodeProto.getDescriptor(),
    +          org.tensorflow.proto.VersionsProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_GraphDef_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_GraphDef_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_GraphDef_descriptor,
    +        new java.lang.String[] { "Node", "Versions", "Version", "Library", "DebugInfo", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.FunctionProtos.getDescriptor();
    +    org.tensorflow.proto.GraphDebugInfoProtos.getDescriptor();
    +    org.tensorflow.proto.NodeProto.getDescriptor();
    +    org.tensorflow.proto.VersionsProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfo.java
    new file mode 100644
    index 00000000000..4c40a27b902
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfo.java
    @@ -0,0 +1,903 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.GraphTransferConstNodeInfo}
    + */
    +public final class GraphTransferConstNodeInfo extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferConstNodeInfo)
    +    GraphTransferConstNodeInfoOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      GraphTransferConstNodeInfo.class.getName());
    +  }
    +  // Use GraphTransferConstNodeInfo.newBuilder() to construct.
    +  private GraphTransferConstNodeInfo(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private GraphTransferConstNodeInfo() {
    +    name_ = "";
    +    shape_ = emptyLongList();
    +    data_ = com.google.protobuf.ByteString.EMPTY;
    +    dtype_ = 0;
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.GraphTransferConstNodeInfo.class, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder.class);
    +  }
    +
    +  public static final int NAME_FIELD_NUMBER = 1;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  @java.lang.Override
    +  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;
    +    }
    +  }
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  @java.lang.Override
    +  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 NODE_ID_FIELD_NUMBER = 2;
    +  private int nodeId_ = 0;
    +  /**
    +   * int32 node_id = 2;
    +   * @return The nodeId.
    +   */
    +  @java.lang.Override
    +  public int getNodeId() {
    +    return nodeId_;
    +  }
    +
    +  public static final int SHAPE_FIELD_NUMBER = 3;
    +  @SuppressWarnings("serial")
    +  private com.google.protobuf.Internal.LongList shape_ =
    +      emptyLongList();
    +  /**
    +   * repeated int64 shape = 3;
    +   * @return A list containing the shape.
    +   */
    +  @java.lang.Override
    +  public java.util.List
    +      getShapeList() {
    +    return shape_;
    +  }
    +  /**
    +   * repeated int64 shape = 3;
    +   * @return The count of shape.
    +   */
    +  public int getShapeCount() {
    +    return shape_.size();
    +  }
    +  /**
    +   * repeated int64 shape = 3;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  public long getShape(int index) {
    +    return shape_.getLong(index);
    +  }
    +  private int shapeMemoizedSerializedSize = -1;
    +
    +  public static final int DATA_FIELD_NUMBER = 4;
    +  private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
    +  /**
    +   * bytes data = 4;
    +   * @return The data.
    +   */
    +  @java.lang.Override
    +  public com.google.protobuf.ByteString getData() {
    +    return data_;
    +  }
    +
    +  public static final int DTYPE_FIELD_NUMBER = 5;
    +  private int dtype_ = 0;
    +  /**
    +   * .tensorflow.DataType dtype = 5;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  @java.lang.Override public int getDtypeValue() {
    +    return dtype_;
    +  }
    +  /**
    +   * .tensorflow.DataType dtype = 5;
    +   * @return The dtype.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +    org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +    return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +  }
    +
    +  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 {
    +    getSerializedSize();
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
    +    }
    +    if (nodeId_ != 0) {
    +      output.writeInt32(2, nodeId_);
    +    }
    +    if (getShapeList().size() > 0) {
    +      output.writeUInt32NoTag(26);
    +      output.writeUInt32NoTag(shapeMemoizedSerializedSize);
    +    }
    +    for (int i = 0; i < shape_.size(); i++) {
    +      output.writeInt64NoTag(shape_.getLong(i));
    +    }
    +    if (!data_.isEmpty()) {
    +      output.writeBytes(4, data_);
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      output.writeEnum(5, dtype_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
    +    }
    +    if (nodeId_ != 0) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeInt32Size(2, nodeId_);
    +    }
    +    {
    +      int dataSize = 0;
    +      for (int i = 0; i < shape_.size(); i++) {
    +        dataSize += com.google.protobuf.CodedOutputStream
    +          .computeInt64SizeNoTag(shape_.getLong(i));
    +      }
    +      size += dataSize;
    +      if (!getShapeList().isEmpty()) {
    +        size += 1;
    +        size += com.google.protobuf.CodedOutputStream
    +            .computeInt32SizeNoTag(dataSize);
    +      }
    +      shapeMemoizedSerializedSize = dataSize;
    +    }
    +    if (!data_.isEmpty()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeBytesSize(4, data_);
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(5, dtype_);
    +    }
    +    size += getUnknownFields().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.GraphTransferConstNodeInfo)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.GraphTransferConstNodeInfo other = (org.tensorflow.proto.GraphTransferConstNodeInfo) obj;
    +
    +    if (!getName()
    +        .equals(other.getName())) return false;
    +    if (getNodeId()
    +        != other.getNodeId()) return false;
    +    if (!getShapeList()
    +        .equals(other.getShapeList())) return false;
    +    if (!getData()
    +        .equals(other.getData())) return false;
    +    if (dtype_ != other.dtype_) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER;
    +    hash = (53 * hash) + getNodeId();
    +    if (getShapeCount() > 0) {
    +      hash = (37 * hash) + SHAPE_FIELD_NUMBER;
    +      hash = (53 * hash) + getShapeList().hashCode();
    +    }
    +    hash = (37 * hash) + DATA_FIELD_NUMBER;
    +    hash = (53 * hash) + getData().hashCode();
    +    hash = (37 * hash) + DTYPE_FIELD_NUMBER;
    +    hash = (53 * hash) + dtype_;
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo 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.GraphTransferConstNodeInfo parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.GraphTransferConstNodeInfo 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.GraphTransferConstNodeInfo}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferConstNodeInfo)
    +      org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.GraphTransferConstNodeInfo.class, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.GraphTransferConstNodeInfo.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      name_ = "";
    +      nodeId_ = 0;
    +      shape_ = emptyLongList();
    +      data_ = com.google.protobuf.ByteString.EMPTY;
    +      dtype_ = 0;
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferConstNodeInfo getDefaultInstanceForType() {
    +      return org.tensorflow.proto.GraphTransferConstNodeInfo.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferConstNodeInfo build() {
    +      org.tensorflow.proto.GraphTransferConstNodeInfo result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferConstNodeInfo buildPartial() {
    +      org.tensorflow.proto.GraphTransferConstNodeInfo result = new org.tensorflow.proto.GraphTransferConstNodeInfo(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.GraphTransferConstNodeInfo result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.nodeId_ = nodeId_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        shape_.makeImmutable();
    +        result.shape_ = shape_;
    +      }
    +      if (((from_bitField0_ & 0x00000008) != 0)) {
    +        result.data_ = data_;
    +      }
    +      if (((from_bitField0_ & 0x00000010) != 0)) {
    +        result.dtype_ = dtype_;
    +      }
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.GraphTransferConstNodeInfo) {
    +        return mergeFrom((org.tensorflow.proto.GraphTransferConstNodeInfo)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.GraphTransferConstNodeInfo other) {
    +      if (other == org.tensorflow.proto.GraphTransferConstNodeInfo.getDefaultInstance()) return this;
    +      if (!other.getName().isEmpty()) {
    +        name_ = other.name_;
    +        bitField0_ |= 0x00000001;
    +        onChanged();
    +      }
    +      if (other.getNodeId() != 0) {
    +        setNodeId(other.getNodeId());
    +      }
    +      if (!other.shape_.isEmpty()) {
    +        if (shape_.isEmpty()) {
    +          shape_ = other.shape_;
    +          shape_.makeImmutable();
    +          bitField0_ |= 0x00000004;
    +        } else {
    +          ensureShapeIsMutable();
    +          shape_.addAll(other.shape_);
    +        }
    +        onChanged();
    +      }
    +      if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
    +        setData(other.getData());
    +      }
    +      if (other.dtype_ != 0) {
    +        setDtypeValue(other.getDtypeValue());
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 10: {
    +              name_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 10
    +            case 16: {
    +              nodeId_ = input.readInt32();
    +              bitField0_ |= 0x00000002;
    +              break;
    +            } // case 16
    +            case 24: {
    +              long v = input.readInt64();
    +              ensureShapeIsMutable();
    +              shape_.addLong(v);
    +              break;
    +            } // case 24
    +            case 26: {
    +              int length = input.readRawVarint32();
    +              int limit = input.pushLimit(length);
    +              ensureShapeIsMutable();
    +              while (input.getBytesUntilLimit() > 0) {
    +                shape_.addLong(input.readInt64());
    +              }
    +              input.popLimit(limit);
    +              break;
    +            } // case 26
    +            case 34: {
    +              data_ = input.readBytes();
    +              bitField0_ |= 0x00000008;
    +              break;
    +            } // case 34
    +            case 40: {
    +              dtype_ = input.readEnum();
    +              bitField0_ |= 0x00000010;
    +              break;
    +            } // case 40
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private java.lang.Object name_ = "";
    +    /**
    +     * string name = 1;
    +     * @return The name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @return The bytes for name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearName() {
    +      name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The bytes for name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private int nodeId_ ;
    +    /**
    +     * int32 node_id = 2;
    +     * @return The nodeId.
    +     */
    +    @java.lang.Override
    +    public int getNodeId() {
    +      return nodeId_;
    +    }
    +    /**
    +     * int32 node_id = 2;
    +     * @param value The nodeId to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setNodeId(int value) {
    +
    +      nodeId_ = value;
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * int32 node_id = 2;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearNodeId() {
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      nodeId_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private com.google.protobuf.Internal.LongList shape_ = emptyLongList();
    +    private void ensureShapeIsMutable() {
    +      if (!shape_.isModifiable()) {
    +        shape_ = makeMutableCopy(shape_);
    +      }
    +      bitField0_ |= 0x00000004;
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @return A list containing the shape.
    +     */
    +    public java.util.List
    +        getShapeList() {
    +      shape_.makeImmutable();
    +      return shape_;
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @return The count of shape.
    +     */
    +    public int getShapeCount() {
    +      return shape_.size();
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @param index The index of the element to return.
    +     * @return The shape at the given index.
    +     */
    +    public long getShape(int index) {
    +      return shape_.getLong(index);
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @param index The index to set the value at.
    +     * @param value The shape to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShape(
    +        int index, long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.setLong(index, value);
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @param value The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addShape(long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.addLong(value);
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @param values The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addAllShape(
    +        java.lang.Iterable values) {
    +      ensureShapeIsMutable();
    +      com.google.protobuf.AbstractMessageLite.Builder.addAll(
    +          values, shape_);
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 3;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearShape() {
    +      shape_ = emptyLongList();
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      onChanged();
    +      return this;
    +    }
    +
    +    private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
    +    /**
    +     * bytes data = 4;
    +     * @return The data.
    +     */
    +    @java.lang.Override
    +    public com.google.protobuf.ByteString getData() {
    +      return data_;
    +    }
    +    /**
    +     * bytes data = 4;
    +     * @param value The data to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setData(com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      data_ = value;
    +      bitField0_ |= 0x00000008;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * bytes data = 4;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearData() {
    +      bitField0_ = (bitField0_ & ~0x00000008);
    +      data_ = getDefaultInstance().getData();
    +      onChanged();
    +      return this;
    +    }
    +
    +    private int dtype_ = 0;
    +    /**
    +     * .tensorflow.DataType dtype = 5;
    +     * @return The enum numeric value on the wire for dtype.
    +     */
    +    @java.lang.Override public int getDtypeValue() {
    +      return dtype_;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 5;
    +     * @param value The enum numeric value on the wire for dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtypeValue(int value) {
    +      dtype_ = value;
    +      bitField0_ |= 0x00000010;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 5;
    +     * @return The dtype.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.DataType getDtype() {
    +      org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +      return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 5;
    +     * @param value The dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtype(org.tensorflow.proto.DataType value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000010;
    +      dtype_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 5;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDtype() {
    +      bitField0_ = (bitField0_ & ~0x00000010);
    +      dtype_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferConstNodeInfo)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferConstNodeInfo)
    +  private static final org.tensorflow.proto.GraphTransferConstNodeInfo DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferConstNodeInfo();
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferConstNodeInfo getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public GraphTransferConstNodeInfo parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.GraphTransferConstNodeInfo getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfoOrBuilder.java
    new file mode 100644
    index 00000000000..642428d772f
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferConstNodeInfoOrBuilder.java
    @@ -0,0 +1,63 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface GraphTransferConstNodeInfoOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferConstNodeInfo)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  java.lang.String getName();
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  com.google.protobuf.ByteString
    +      getNameBytes();
    +
    +  /**
    +   * int32 node_id = 2;
    +   * @return The nodeId.
    +   */
    +  int getNodeId();
    +
    +  /**
    +   * repeated int64 shape = 3;
    +   * @return A list containing the shape.
    +   */
    +  java.util.List getShapeList();
    +  /**
    +   * repeated int64 shape = 3;
    +   * @return The count of shape.
    +   */
    +  int getShapeCount();
    +  /**
    +   * repeated int64 shape = 3;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  long getShape(int index);
    +
    +  /**
    +   * bytes data = 4;
    +   * @return The data.
    +   */
    +  com.google.protobuf.ByteString getData();
    +
    +  /**
    +   * .tensorflow.DataType dtype = 5;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  int getDtypeValue();
    +  /**
    +   * .tensorflow.DataType dtype = 5;
    +   * @return The dtype.
    +   */
    +  org.tensorflow.proto.DataType getDtype();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfo.java
    new file mode 100644
    index 00000000000..2c57c86a711
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfo.java
    @@ -0,0 +1,770 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.GraphTransferGraphInputNodeInfo}
    + */
    +public final class GraphTransferGraphInputNodeInfo extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferGraphInputNodeInfo)
    +    GraphTransferGraphInputNodeInfoOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      GraphTransferGraphInputNodeInfo.class.getName());
    +  }
    +  // Use GraphTransferGraphInputNodeInfo.newBuilder() to construct.
    +  private GraphTransferGraphInputNodeInfo(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private GraphTransferGraphInputNodeInfo() {
    +    name_ = "";
    +    shape_ = emptyLongList();
    +    dtype_ = 0;
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.GraphTransferGraphInputNodeInfo.class, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder.class);
    +  }
    +
    +  public static final int NAME_FIELD_NUMBER = 1;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  @java.lang.Override
    +  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;
    +    }
    +  }
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  @java.lang.Override
    +  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 SHAPE_FIELD_NUMBER = 2;
    +  @SuppressWarnings("serial")
    +  private com.google.protobuf.Internal.LongList shape_ =
    +      emptyLongList();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return A list containing the shape.
    +   */
    +  @java.lang.Override
    +  public java.util.List
    +      getShapeList() {
    +    return shape_;
    +  }
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return The count of shape.
    +   */
    +  public int getShapeCount() {
    +    return shape_.size();
    +  }
    +  /**
    +   * repeated int64 shape = 2;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  public long getShape(int index) {
    +    return shape_.getLong(index);
    +  }
    +  private int shapeMemoizedSerializedSize = -1;
    +
    +  public static final int DTYPE_FIELD_NUMBER = 3;
    +  private int dtype_ = 0;
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  @java.lang.Override public int getDtypeValue() {
    +    return dtype_;
    +  }
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The dtype.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +    org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +    return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +  }
    +
    +  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 {
    +    getSerializedSize();
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
    +    }
    +    if (getShapeList().size() > 0) {
    +      output.writeUInt32NoTag(18);
    +      output.writeUInt32NoTag(shapeMemoizedSerializedSize);
    +    }
    +    for (int i = 0; i < shape_.size(); i++) {
    +      output.writeInt64NoTag(shape_.getLong(i));
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      output.writeEnum(3, dtype_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
    +    }
    +    {
    +      int dataSize = 0;
    +      for (int i = 0; i < shape_.size(); i++) {
    +        dataSize += com.google.protobuf.CodedOutputStream
    +          .computeInt64SizeNoTag(shape_.getLong(i));
    +      }
    +      size += dataSize;
    +      if (!getShapeList().isEmpty()) {
    +        size += 1;
    +        size += com.google.protobuf.CodedOutputStream
    +            .computeInt32SizeNoTag(dataSize);
    +      }
    +      shapeMemoizedSerializedSize = dataSize;
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(3, dtype_);
    +    }
    +    size += getUnknownFields().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.GraphTransferGraphInputNodeInfo)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.GraphTransferGraphInputNodeInfo other = (org.tensorflow.proto.GraphTransferGraphInputNodeInfo) obj;
    +
    +    if (!getName()
    +        .equals(other.getName())) return false;
    +    if (!getShapeList()
    +        .equals(other.getShapeList())) return false;
    +    if (dtype_ != other.dtype_) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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();
    +    if (getShapeCount() > 0) {
    +      hash = (37 * hash) + SHAPE_FIELD_NUMBER;
    +      hash = (53 * hash) + getShapeList().hashCode();
    +    }
    +    hash = (37 * hash) + DTYPE_FIELD_NUMBER;
    +    hash = (53 * hash) + dtype_;
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo 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.GraphTransferGraphInputNodeInfo parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.GraphTransferGraphInputNodeInfo 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.GraphTransferGraphInputNodeInfo}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferGraphInputNodeInfo)
    +      org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.GraphTransferGraphInputNodeInfo.class, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.GraphTransferGraphInputNodeInfo.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      name_ = "";
    +      shape_ = emptyLongList();
    +      dtype_ = 0;
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphInputNodeInfo getDefaultInstanceForType() {
    +      return org.tensorflow.proto.GraphTransferGraphInputNodeInfo.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphInputNodeInfo build() {
    +      org.tensorflow.proto.GraphTransferGraphInputNodeInfo result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphInputNodeInfo buildPartial() {
    +      org.tensorflow.proto.GraphTransferGraphInputNodeInfo result = new org.tensorflow.proto.GraphTransferGraphInputNodeInfo(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.GraphTransferGraphInputNodeInfo result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        shape_.makeImmutable();
    +        result.shape_ = shape_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.dtype_ = dtype_;
    +      }
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.GraphTransferGraphInputNodeInfo) {
    +        return mergeFrom((org.tensorflow.proto.GraphTransferGraphInputNodeInfo)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.GraphTransferGraphInputNodeInfo other) {
    +      if (other == org.tensorflow.proto.GraphTransferGraphInputNodeInfo.getDefaultInstance()) return this;
    +      if (!other.getName().isEmpty()) {
    +        name_ = other.name_;
    +        bitField0_ |= 0x00000001;
    +        onChanged();
    +      }
    +      if (!other.shape_.isEmpty()) {
    +        if (shape_.isEmpty()) {
    +          shape_ = other.shape_;
    +          shape_.makeImmutable();
    +          bitField0_ |= 0x00000002;
    +        } else {
    +          ensureShapeIsMutable();
    +          shape_.addAll(other.shape_);
    +        }
    +        onChanged();
    +      }
    +      if (other.dtype_ != 0) {
    +        setDtypeValue(other.getDtypeValue());
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 10: {
    +              name_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 10
    +            case 16: {
    +              long v = input.readInt64();
    +              ensureShapeIsMutable();
    +              shape_.addLong(v);
    +              break;
    +            } // case 16
    +            case 18: {
    +              int length = input.readRawVarint32();
    +              int limit = input.pushLimit(length);
    +              ensureShapeIsMutable();
    +              while (input.getBytesUntilLimit() > 0) {
    +                shape_.addLong(input.readInt64());
    +              }
    +              input.popLimit(limit);
    +              break;
    +            } // case 18
    +            case 24: {
    +              dtype_ = input.readEnum();
    +              bitField0_ |= 0x00000004;
    +              break;
    +            } // case 24
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private java.lang.Object name_ = "";
    +    /**
    +     * string name = 1;
    +     * @return The name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @return The bytes for name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearName() {
    +      name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The bytes for name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private com.google.protobuf.Internal.LongList shape_ = emptyLongList();
    +    private void ensureShapeIsMutable() {
    +      if (!shape_.isModifiable()) {
    +        shape_ = makeMutableCopy(shape_);
    +      }
    +      bitField0_ |= 0x00000002;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return A list containing the shape.
    +     */
    +    public java.util.List
    +        getShapeList() {
    +      shape_.makeImmutable();
    +      return shape_;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return The count of shape.
    +     */
    +    public int getShapeCount() {
    +      return shape_.size();
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param index The index of the element to return.
    +     * @return The shape at the given index.
    +     */
    +    public long getShape(int index) {
    +      return shape_.getLong(index);
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param index The index to set the value at.
    +     * @param value The shape to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShape(
    +        int index, long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.setLong(index, value);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param value The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addShape(long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.addLong(value);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param values The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addAllShape(
    +        java.lang.Iterable values) {
    +      ensureShapeIsMutable();
    +      com.google.protobuf.AbstractMessageLite.Builder.addAll(
    +          values, shape_);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearShape() {
    +      shape_ = emptyLongList();
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      onChanged();
    +      return this;
    +    }
    +
    +    private int dtype_ = 0;
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return The enum numeric value on the wire for dtype.
    +     */
    +    @java.lang.Override public int getDtypeValue() {
    +      return dtype_;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @param value The enum numeric value on the wire for dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtypeValue(int value) {
    +      dtype_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return The dtype.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.DataType getDtype() {
    +      org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +      return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @param value The dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtype(org.tensorflow.proto.DataType value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000004;
    +      dtype_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDtype() {
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      dtype_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferGraphInputNodeInfo)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferGraphInputNodeInfo)
    +  private static final org.tensorflow.proto.GraphTransferGraphInputNodeInfo DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferGraphInputNodeInfo();
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphInputNodeInfo getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public GraphTransferGraphInputNodeInfo parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.GraphTransferGraphInputNodeInfo getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfoOrBuilder.java
    new file mode 100644
    index 00000000000..3b063adca63
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphInputNodeInfoOrBuilder.java
    @@ -0,0 +1,51 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface GraphTransferGraphInputNodeInfoOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferGraphInputNodeInfo)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  java.lang.String getName();
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  com.google.protobuf.ByteString
    +      getNameBytes();
    +
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return A list containing the shape.
    +   */
    +  java.util.List getShapeList();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return The count of shape.
    +   */
    +  int getShapeCount();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  long getShape(int index);
    +
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  int getDtypeValue();
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The dtype.
    +   */
    +  org.tensorflow.proto.DataType getDtype();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfo.java
    new file mode 100644
    index 00000000000..2968ce25539
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfo.java
    @@ -0,0 +1,770 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.GraphTransferGraphOutputNodeInfo}
    + */
    +public final class GraphTransferGraphOutputNodeInfo extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferGraphOutputNodeInfo)
    +    GraphTransferGraphOutputNodeInfoOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      GraphTransferGraphOutputNodeInfo.class.getName());
    +  }
    +  // Use GraphTransferGraphOutputNodeInfo.newBuilder() to construct.
    +  private GraphTransferGraphOutputNodeInfo(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private GraphTransferGraphOutputNodeInfo() {
    +    name_ = "";
    +    shape_ = emptyLongList();
    +    dtype_ = 0;
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.class, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder.class);
    +  }
    +
    +  public static final int NAME_FIELD_NUMBER = 1;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  @java.lang.Override
    +  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;
    +    }
    +  }
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  @java.lang.Override
    +  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 SHAPE_FIELD_NUMBER = 2;
    +  @SuppressWarnings("serial")
    +  private com.google.protobuf.Internal.LongList shape_ =
    +      emptyLongList();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return A list containing the shape.
    +   */
    +  @java.lang.Override
    +  public java.util.List
    +      getShapeList() {
    +    return shape_;
    +  }
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return The count of shape.
    +   */
    +  public int getShapeCount() {
    +    return shape_.size();
    +  }
    +  /**
    +   * repeated int64 shape = 2;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  public long getShape(int index) {
    +    return shape_.getLong(index);
    +  }
    +  private int shapeMemoizedSerializedSize = -1;
    +
    +  public static final int DTYPE_FIELD_NUMBER = 3;
    +  private int dtype_ = 0;
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  @java.lang.Override public int getDtypeValue() {
    +    return dtype_;
    +  }
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The dtype.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +    org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +    return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +  }
    +
    +  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 {
    +    getSerializedSize();
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
    +    }
    +    if (getShapeList().size() > 0) {
    +      output.writeUInt32NoTag(18);
    +      output.writeUInt32NoTag(shapeMemoizedSerializedSize);
    +    }
    +    for (int i = 0; i < shape_.size(); i++) {
    +      output.writeInt64NoTag(shape_.getLong(i));
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      output.writeEnum(3, dtype_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
    +    }
    +    {
    +      int dataSize = 0;
    +      for (int i = 0; i < shape_.size(); i++) {
    +        dataSize += com.google.protobuf.CodedOutputStream
    +          .computeInt64SizeNoTag(shape_.getLong(i));
    +      }
    +      size += dataSize;
    +      if (!getShapeList().isEmpty()) {
    +        size += 1;
    +        size += com.google.protobuf.CodedOutputStream
    +            .computeInt32SizeNoTag(dataSize);
    +      }
    +      shapeMemoizedSerializedSize = dataSize;
    +    }
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(3, dtype_);
    +    }
    +    size += getUnknownFields().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.GraphTransferGraphOutputNodeInfo)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.GraphTransferGraphOutputNodeInfo other = (org.tensorflow.proto.GraphTransferGraphOutputNodeInfo) obj;
    +
    +    if (!getName()
    +        .equals(other.getName())) return false;
    +    if (!getShapeList()
    +        .equals(other.getShapeList())) return false;
    +    if (dtype_ != other.dtype_) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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();
    +    if (getShapeCount() > 0) {
    +      hash = (37 * hash) + SHAPE_FIELD_NUMBER;
    +      hash = (53 * hash) + getShapeList().hashCode();
    +    }
    +    hash = (37 * hash) + DTYPE_FIELD_NUMBER;
    +    hash = (53 * hash) + dtype_;
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo 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.GraphTransferGraphOutputNodeInfo parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.GraphTransferGraphOutputNodeInfo 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.GraphTransferGraphOutputNodeInfo}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferGraphOutputNodeInfo)
    +      org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.class, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      name_ = "";
    +      shape_ = emptyLongList();
    +      dtype_ = 0;
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo getDefaultInstanceForType() {
    +      return org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo build() {
    +      org.tensorflow.proto.GraphTransferGraphOutputNodeInfo result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo buildPartial() {
    +      org.tensorflow.proto.GraphTransferGraphOutputNodeInfo result = new org.tensorflow.proto.GraphTransferGraphOutputNodeInfo(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.GraphTransferGraphOutputNodeInfo result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        shape_.makeImmutable();
    +        result.shape_ = shape_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.dtype_ = dtype_;
    +      }
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.GraphTransferGraphOutputNodeInfo) {
    +        return mergeFrom((org.tensorflow.proto.GraphTransferGraphOutputNodeInfo)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.GraphTransferGraphOutputNodeInfo other) {
    +      if (other == org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.getDefaultInstance()) return this;
    +      if (!other.getName().isEmpty()) {
    +        name_ = other.name_;
    +        bitField0_ |= 0x00000001;
    +        onChanged();
    +      }
    +      if (!other.shape_.isEmpty()) {
    +        if (shape_.isEmpty()) {
    +          shape_ = other.shape_;
    +          shape_.makeImmutable();
    +          bitField0_ |= 0x00000002;
    +        } else {
    +          ensureShapeIsMutable();
    +          shape_.addAll(other.shape_);
    +        }
    +        onChanged();
    +      }
    +      if (other.dtype_ != 0) {
    +        setDtypeValue(other.getDtypeValue());
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 10: {
    +              name_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 10
    +            case 16: {
    +              long v = input.readInt64();
    +              ensureShapeIsMutable();
    +              shape_.addLong(v);
    +              break;
    +            } // case 16
    +            case 18: {
    +              int length = input.readRawVarint32();
    +              int limit = input.pushLimit(length);
    +              ensureShapeIsMutable();
    +              while (input.getBytesUntilLimit() > 0) {
    +                shape_.addLong(input.readInt64());
    +              }
    +              input.popLimit(limit);
    +              break;
    +            } // case 18
    +            case 24: {
    +              dtype_ = input.readEnum();
    +              bitField0_ |= 0x00000004;
    +              break;
    +            } // case 24
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private java.lang.Object name_ = "";
    +    /**
    +     * string name = 1;
    +     * @return The name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @return The bytes for name.
    +     */
    +    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;
    +      }
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearName() {
    +      name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string name = 1;
    +     * @param value The bytes for name to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      name_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private com.google.protobuf.Internal.LongList shape_ = emptyLongList();
    +    private void ensureShapeIsMutable() {
    +      if (!shape_.isModifiable()) {
    +        shape_ = makeMutableCopy(shape_);
    +      }
    +      bitField0_ |= 0x00000002;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return A list containing the shape.
    +     */
    +    public java.util.List
    +        getShapeList() {
    +      shape_.makeImmutable();
    +      return shape_;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return The count of shape.
    +     */
    +    public int getShapeCount() {
    +      return shape_.size();
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param index The index of the element to return.
    +     * @return The shape at the given index.
    +     */
    +    public long getShape(int index) {
    +      return shape_.getLong(index);
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param index The index to set the value at.
    +     * @param value The shape to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShape(
    +        int index, long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.setLong(index, value);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param value The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addShape(long value) {
    +
    +      ensureShapeIsMutable();
    +      shape_.addLong(value);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @param values The shape to add.
    +     * @return This builder for chaining.
    +     */
    +    public Builder addAllShape(
    +        java.lang.Iterable values) {
    +      ensureShapeIsMutable();
    +      com.google.protobuf.AbstractMessageLite.Builder.addAll(
    +          values, shape_);
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * repeated int64 shape = 2;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearShape() {
    +      shape_ = emptyLongList();
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      onChanged();
    +      return this;
    +    }
    +
    +    private int dtype_ = 0;
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return The enum numeric value on the wire for dtype.
    +     */
    +    @java.lang.Override public int getDtypeValue() {
    +      return dtype_;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @param value The enum numeric value on the wire for dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtypeValue(int value) {
    +      dtype_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return The dtype.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.DataType getDtype() {
    +      org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +      return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @param value The dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtype(org.tensorflow.proto.DataType value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000004;
    +      dtype_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 3;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDtype() {
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      dtype_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferGraphOutputNodeInfo)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferGraphOutputNodeInfo)
    +  private static final org.tensorflow.proto.GraphTransferGraphOutputNodeInfo DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferGraphOutputNodeInfo();
    +  }
    +
    +  public static org.tensorflow.proto.GraphTransferGraphOutputNodeInfo getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public GraphTransferGraphOutputNodeInfo parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.GraphTransferGraphOutputNodeInfo getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfoOrBuilder.java
    new file mode 100644
    index 00000000000..f645fdf04f7
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferGraphOutputNodeInfoOrBuilder.java
    @@ -0,0 +1,51 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface GraphTransferGraphOutputNodeInfoOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferGraphOutputNodeInfo)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * string name = 1;
    +   * @return The name.
    +   */
    +  java.lang.String getName();
    +  /**
    +   * string name = 1;
    +   * @return The bytes for name.
    +   */
    +  com.google.protobuf.ByteString
    +      getNameBytes();
    +
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return A list containing the shape.
    +   */
    +  java.util.List getShapeList();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @return The count of shape.
    +   */
    +  int getShapeCount();
    +  /**
    +   * repeated int64 shape = 2;
    +   * @param index The index of the element to return.
    +   * @return The shape at the given index.
    +   */
    +  long getShape(int index);
    +
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  int getDtypeValue();
    +  /**
    +   * .tensorflow.DataType dtype = 3;
    +   * @return The dtype.
    +   */
    +  org.tensorflow.proto.DataType getDtype();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfo.java
    new file mode 100644
    index 00000000000..b5bf73cd37c
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfo.java
    @@ -0,0 +1,2812 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/graph_transfer_info.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing a handle to a tensorflow resource. Handles are
    + * not valid across executions, but can be serialized back and forth from within
    + * a single run.
    + * 
    + * + * Protobuf type {@code tensorflow.GraphTransferInfo} + */ +public final class GraphTransferInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferInfo) + GraphTransferInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferInfo.class.getName()); + } + // Use GraphTransferInfo.newBuilder() to construct. + private GraphTransferInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphTransferInfo() { + nodeInfo_ = java.util.Collections.emptyList(); + constNodeInfo_ = java.util.Collections.emptyList(); + nodeInputInfo_ = java.util.Collections.emptyList(); + nodeOutputInfo_ = java.util.Collections.emptyList(); + graphInputNodeInfo_ = java.util.Collections.emptyList(); + graphOutputNodeInfo_ = java.util.Collections.emptyList(); + destination_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferInfo.class, org.tensorflow.proto.GraphTransferInfo.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.GraphTransferInfo.Destination} + */ + public enum Destination + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NOP = 0; + */ + NOP(0), + /** + * HEXAGON = 1; + */ + HEXAGON(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Destination.class.getName()); + } + /** + * NOP = 0; + */ + public static final int NOP_VALUE = 0; + /** + * HEXAGON = 1; + */ + public static final int HEXAGON_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Destination valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Destination forNumber(int value) { + switch (value) { + case 0: return NOP; + case 1: return HEXAGON; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Destination> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Destination findValueByNumber(int number) { + return Destination.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.GraphTransferInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Destination[] VALUES = values(); + + public static Destination 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 Destination(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.GraphTransferInfo.Destination) + } + + public static final int NODE_INFO_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List nodeInfo_; + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + @java.lang.Override + public java.util.List getNodeInfoList() { + return nodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + @java.lang.Override + public java.util.List + getNodeInfoOrBuilderList() { + return nodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + @java.lang.Override + public int getNodeInfoCount() { + return nodeInfo_.size(); + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInfo getNodeInfo(int index) { + return nodeInfo_.get(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( + int index) { + return nodeInfo_.get(index); + } + + public static final int CONST_NODE_INFO_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List constNodeInfo_; + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + @java.lang.Override + public java.util.List getConstNodeInfoList() { + return constNodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + @java.lang.Override + public java.util.List + getConstNodeInfoOrBuilderList() { + return constNodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + @java.lang.Override + public int getConstNodeInfoCount() { + return constNodeInfo_.size(); + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferConstNodeInfo getConstNodeInfo(int index) { + return constNodeInfo_.get(index); + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( + int index) { + return constNodeInfo_.get(index); + } + + public static final int NODE_INPUT_INFO_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List nodeInputInfo_; + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + @java.lang.Override + public java.util.List getNodeInputInfoList() { + return nodeInputInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + @java.lang.Override + public java.util.List + getNodeInputInfoOrBuilderList() { + return nodeInputInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + @java.lang.Override + public int getNodeInputInfoCount() { + return nodeInputInfo_.size(); + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputInfo getNodeInputInfo(int index) { + return nodeInputInfo_.get(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( + int index) { + return nodeInputInfo_.get(index); + } + + public static final int NODE_OUTPUT_INFO_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List nodeOutputInfo_; + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + @java.lang.Override + public java.util.List getNodeOutputInfoList() { + return nodeOutputInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + @java.lang.Override + public java.util.List + getNodeOutputInfoOrBuilderList() { + return nodeOutputInfo_; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + @java.lang.Override + public int getNodeOutputInfoCount() { + return nodeOutputInfo_.size(); + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeOutputInfo getNodeOutputInfo(int index) { + return nodeOutputInfo_.get(index); + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( + int index) { + return nodeOutputInfo_.get(index); + } + + public static final int GRAPH_INPUT_NODE_INFO_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List graphInputNodeInfo_; + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + @java.lang.Override + public java.util.List getGraphInputNodeInfoList() { + return graphInputNodeInfo_; + } + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + @java.lang.Override + public java.util.List + getGraphInputNodeInfoOrBuilderList() { + return graphInputNodeInfo_; + } + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + @java.lang.Override + public int getGraphInputNodeInfoCount() { + return graphInputNodeInfo_.size(); + } + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index) { + return graphInputNodeInfo_.get(index); + } + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( + int index) { + return graphInputNodeInfo_.get(index); + } + + public static final int GRAPH_OUTPUT_NODE_INFO_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List graphOutputNodeInfo_; + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + @java.lang.Override + public java.util.List getGraphOutputNodeInfoList() { + return graphOutputNodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + @java.lang.Override + public java.util.List + getGraphOutputNodeInfoOrBuilderList() { + return graphOutputNodeInfo_; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + @java.lang.Override + public int getGraphOutputNodeInfoCount() { + return graphOutputNodeInfo_.size(); + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index) { + return graphOutputNodeInfo_.get(index); + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( + int index) { + return graphOutputNodeInfo_.get(index); + } + + public static final int DESTINATION_FIELD_NUMBER = 7; + private int destination_ = 0; + /** + *
    +   * Destination of graph transfer
    +   * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override public int getDestinationValue() { + return destination_; + } + /** + *
    +   * Destination of graph transfer
    +   * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The destination. + */ + @java.lang.Override public org.tensorflow.proto.GraphTransferInfo.Destination getDestination() { + org.tensorflow.proto.GraphTransferInfo.Destination result = org.tensorflow.proto.GraphTransferInfo.Destination.forNumber(destination_); + return result == null ? org.tensorflow.proto.GraphTransferInfo.Destination.UNRECOGNIZED : result; + } + + 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 { + for (int i = 0; i < nodeInfo_.size(); i++) { + output.writeMessage(1, nodeInfo_.get(i)); + } + for (int i = 0; i < constNodeInfo_.size(); i++) { + output.writeMessage(2, constNodeInfo_.get(i)); + } + for (int i = 0; i < nodeInputInfo_.size(); i++) { + output.writeMessage(3, nodeInputInfo_.get(i)); + } + for (int i = 0; i < nodeOutputInfo_.size(); i++) { + output.writeMessage(4, nodeOutputInfo_.get(i)); + } + for (int i = 0; i < graphInputNodeInfo_.size(); i++) { + output.writeMessage(5, graphInputNodeInfo_.get(i)); + } + for (int i = 0; i < graphOutputNodeInfo_.size(); i++) { + output.writeMessage(6, graphOutputNodeInfo_.get(i)); + } + if (destination_ != org.tensorflow.proto.GraphTransferInfo.Destination.NOP.getNumber()) { + output.writeEnum(7, destination_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodeInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, nodeInfo_.get(i)); + } + for (int i = 0; i < constNodeInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, constNodeInfo_.get(i)); + } + for (int i = 0; i < nodeInputInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, nodeInputInfo_.get(i)); + } + for (int i = 0; i < nodeOutputInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, nodeOutputInfo_.get(i)); + } + for (int i = 0; i < graphInputNodeInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, graphInputNodeInfo_.get(i)); + } + for (int i = 0; i < graphOutputNodeInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, graphOutputNodeInfo_.get(i)); + } + if (destination_ != org.tensorflow.proto.GraphTransferInfo.Destination.NOP.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, destination_); + } + size += getUnknownFields().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.GraphTransferInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphTransferInfo other = (org.tensorflow.proto.GraphTransferInfo) obj; + + if (!getNodeInfoList() + .equals(other.getNodeInfoList())) return false; + if (!getConstNodeInfoList() + .equals(other.getConstNodeInfoList())) return false; + if (!getNodeInputInfoList() + .equals(other.getNodeInputInfoList())) return false; + if (!getNodeOutputInfoList() + .equals(other.getNodeOutputInfoList())) return false; + if (!getGraphInputNodeInfoList() + .equals(other.getGraphInputNodeInfoList())) return false; + if (!getGraphOutputNodeInfoList() + .equals(other.getGraphOutputNodeInfoList())) return false; + if (destination_ != other.destination_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodeInfoCount() > 0) { + hash = (37 * hash) + NODE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNodeInfoList().hashCode(); + } + if (getConstNodeInfoCount() > 0) { + hash = (37 * hash) + CONST_NODE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getConstNodeInfoList().hashCode(); + } + if (getNodeInputInfoCount() > 0) { + hash = (37 * hash) + NODE_INPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNodeInputInfoList().hashCode(); + } + if (getNodeOutputInfoCount() > 0) { + hash = (37 * hash) + NODE_OUTPUT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getNodeOutputInfoList().hashCode(); + } + if (getGraphInputNodeInfoCount() > 0) { + hash = (37 * hash) + GRAPH_INPUT_NODE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getGraphInputNodeInfoList().hashCode(); + } + if (getGraphOutputNodeInfoCount() > 0) { + hash = (37 * hash) + GRAPH_OUTPUT_NODE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getGraphOutputNodeInfoList().hashCode(); + } + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + destination_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphTransferInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferInfo 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.GraphTransferInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferInfo 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.GraphTransferInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphTransferInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphTransferInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphTransferInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a handle to a tensorflow resource. Handles are
    +   * not valid across executions, but can be serialized back and forth from within
    +   * a single run.
    +   * 
    + * + * Protobuf type {@code tensorflow.GraphTransferInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferInfo) + org.tensorflow.proto.GraphTransferInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferInfo.class, org.tensorflow.proto.GraphTransferInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphTransferInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodeInfoBuilder_ == null) { + nodeInfo_ = java.util.Collections.emptyList(); + } else { + nodeInfo_ = null; + nodeInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (constNodeInfoBuilder_ == null) { + constNodeInfo_ = java.util.Collections.emptyList(); + } else { + constNodeInfo_ = null; + constNodeInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (nodeInputInfoBuilder_ == null) { + nodeInputInfo_ = java.util.Collections.emptyList(); + } else { + nodeInputInfo_ = null; + nodeInputInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (nodeOutputInfoBuilder_ == null) { + nodeOutputInfo_ = java.util.Collections.emptyList(); + } else { + nodeOutputInfo_ = null; + nodeOutputInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (graphInputNodeInfoBuilder_ == null) { + graphInputNodeInfo_ = java.util.Collections.emptyList(); + } else { + graphInputNodeInfo_ = null; + graphInputNodeInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (graphOutputNodeInfoBuilder_ == null) { + graphOutputNodeInfo_ = java.util.Collections.emptyList(); + } else { + graphOutputNodeInfo_ = null; + graphOutputNodeInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + destination_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GraphTransferInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferInfo build() { + org.tensorflow.proto.GraphTransferInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferInfo buildPartial() { + org.tensorflow.proto.GraphTransferInfo result = new org.tensorflow.proto.GraphTransferInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.GraphTransferInfo result) { + if (nodeInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodeInfo_ = java.util.Collections.unmodifiableList(nodeInfo_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodeInfo_ = nodeInfo_; + } else { + result.nodeInfo_ = nodeInfoBuilder_.build(); + } + if (constNodeInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + constNodeInfo_ = java.util.Collections.unmodifiableList(constNodeInfo_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.constNodeInfo_ = constNodeInfo_; + } else { + result.constNodeInfo_ = constNodeInfoBuilder_.build(); + } + if (nodeInputInfoBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + nodeInputInfo_ = java.util.Collections.unmodifiableList(nodeInputInfo_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.nodeInputInfo_ = nodeInputInfo_; + } else { + result.nodeInputInfo_ = nodeInputInfoBuilder_.build(); + } + if (nodeOutputInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + nodeOutputInfo_ = java.util.Collections.unmodifiableList(nodeOutputInfo_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.nodeOutputInfo_ = nodeOutputInfo_; + } else { + result.nodeOutputInfo_ = nodeOutputInfoBuilder_.build(); + } + if (graphInputNodeInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + graphInputNodeInfo_ = java.util.Collections.unmodifiableList(graphInputNodeInfo_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.graphInputNodeInfo_ = graphInputNodeInfo_; + } else { + result.graphInputNodeInfo_ = graphInputNodeInfoBuilder_.build(); + } + if (graphOutputNodeInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + graphOutputNodeInfo_ = java.util.Collections.unmodifiableList(graphOutputNodeInfo_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.graphOutputNodeInfo_ = graphOutputNodeInfo_; + } else { + result.graphOutputNodeInfo_ = graphOutputNodeInfoBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.GraphTransferInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.destination_ = destination_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphTransferInfo) { + return mergeFrom((org.tensorflow.proto.GraphTransferInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphTransferInfo other) { + if (other == org.tensorflow.proto.GraphTransferInfo.getDefaultInstance()) return this; + if (nodeInfoBuilder_ == null) { + if (!other.nodeInfo_.isEmpty()) { + if (nodeInfo_.isEmpty()) { + nodeInfo_ = other.nodeInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodeInfoIsMutable(); + nodeInfo_.addAll(other.nodeInfo_); + } + onChanged(); + } + } else { + if (!other.nodeInfo_.isEmpty()) { + if (nodeInfoBuilder_.isEmpty()) { + nodeInfoBuilder_.dispose(); + nodeInfoBuilder_ = null; + nodeInfo_ = other.nodeInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + nodeInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeInfoFieldBuilder() : null; + } else { + nodeInfoBuilder_.addAllMessages(other.nodeInfo_); + } + } + } + if (constNodeInfoBuilder_ == null) { + if (!other.constNodeInfo_.isEmpty()) { + if (constNodeInfo_.isEmpty()) { + constNodeInfo_ = other.constNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.addAll(other.constNodeInfo_); + } + onChanged(); + } + } else { + if (!other.constNodeInfo_.isEmpty()) { + if (constNodeInfoBuilder_.isEmpty()) { + constNodeInfoBuilder_.dispose(); + constNodeInfoBuilder_ = null; + constNodeInfo_ = other.constNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + constNodeInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getConstNodeInfoFieldBuilder() : null; + } else { + constNodeInfoBuilder_.addAllMessages(other.constNodeInfo_); + } + } + } + if (nodeInputInfoBuilder_ == null) { + if (!other.nodeInputInfo_.isEmpty()) { + if (nodeInputInfo_.isEmpty()) { + nodeInputInfo_ = other.nodeInputInfo_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.addAll(other.nodeInputInfo_); + } + onChanged(); + } + } else { + if (!other.nodeInputInfo_.isEmpty()) { + if (nodeInputInfoBuilder_.isEmpty()) { + nodeInputInfoBuilder_.dispose(); + nodeInputInfoBuilder_ = null; + nodeInputInfo_ = other.nodeInputInfo_; + bitField0_ = (bitField0_ & ~0x00000004); + nodeInputInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeInputInfoFieldBuilder() : null; + } else { + nodeInputInfoBuilder_.addAllMessages(other.nodeInputInfo_); + } + } + } + if (nodeOutputInfoBuilder_ == null) { + if (!other.nodeOutputInfo_.isEmpty()) { + if (nodeOutputInfo_.isEmpty()) { + nodeOutputInfo_ = other.nodeOutputInfo_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.addAll(other.nodeOutputInfo_); + } + onChanged(); + } + } else { + if (!other.nodeOutputInfo_.isEmpty()) { + if (nodeOutputInfoBuilder_.isEmpty()) { + nodeOutputInfoBuilder_.dispose(); + nodeOutputInfoBuilder_ = null; + nodeOutputInfo_ = other.nodeOutputInfo_; + bitField0_ = (bitField0_ & ~0x00000008); + nodeOutputInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeOutputInfoFieldBuilder() : null; + } else { + nodeOutputInfoBuilder_.addAllMessages(other.nodeOutputInfo_); + } + } + } + if (graphInputNodeInfoBuilder_ == null) { + if (!other.graphInputNodeInfo_.isEmpty()) { + if (graphInputNodeInfo_.isEmpty()) { + graphInputNodeInfo_ = other.graphInputNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.addAll(other.graphInputNodeInfo_); + } + onChanged(); + } + } else { + if (!other.graphInputNodeInfo_.isEmpty()) { + if (graphInputNodeInfoBuilder_.isEmpty()) { + graphInputNodeInfoBuilder_.dispose(); + graphInputNodeInfoBuilder_ = null; + graphInputNodeInfo_ = other.graphInputNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + graphInputNodeInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getGraphInputNodeInfoFieldBuilder() : null; + } else { + graphInputNodeInfoBuilder_.addAllMessages(other.graphInputNodeInfo_); + } + } + } + if (graphOutputNodeInfoBuilder_ == null) { + if (!other.graphOutputNodeInfo_.isEmpty()) { + if (graphOutputNodeInfo_.isEmpty()) { + graphOutputNodeInfo_ = other.graphOutputNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.addAll(other.graphOutputNodeInfo_); + } + onChanged(); + } + } else { + if (!other.graphOutputNodeInfo_.isEmpty()) { + if (graphOutputNodeInfoBuilder_.isEmpty()) { + graphOutputNodeInfoBuilder_.dispose(); + graphOutputNodeInfoBuilder_ = null; + graphOutputNodeInfo_ = other.graphOutputNodeInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + graphOutputNodeInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getGraphOutputNodeInfoFieldBuilder() : null; + } else { + graphOutputNodeInfoBuilder_.addAllMessages(other.graphOutputNodeInfo_); + } + } + } + if (other.destination_ != 0) { + setDestinationValue(other.getDestinationValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.GraphTransferNodeInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferNodeInfo.parser(), + extensionRegistry); + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + nodeInfo_.add(m); + } else { + nodeInfoBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + org.tensorflow.proto.GraphTransferConstNodeInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferConstNodeInfo.parser(), + extensionRegistry); + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.add(m); + } else { + constNodeInfoBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + org.tensorflow.proto.GraphTransferNodeInputInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferNodeInputInfo.parser(), + extensionRegistry); + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.add(m); + } else { + nodeInputInfoBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + org.tensorflow.proto.GraphTransferNodeOutputInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferNodeOutputInfo.parser(), + extensionRegistry); + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.add(m); + } else { + nodeOutputInfoBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + org.tensorflow.proto.GraphTransferGraphInputNodeInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferGraphInputNodeInfo.parser(), + extensionRegistry); + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.add(m); + } else { + graphInputNodeInfoBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo m = + input.readMessage( + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.parser(), + extensionRegistry); + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.add(m); + } else { + graphOutputNodeInfoBuilder_.addMessage(m); + } + break; + } // case 50 + case 56: { + destination_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List nodeInfo_ = + java.util.Collections.emptyList(); + private void ensureNodeInfoIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodeInfo_ = new java.util.ArrayList(nodeInfo_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInfo, org.tensorflow.proto.GraphTransferNodeInfo.Builder, org.tensorflow.proto.GraphTransferNodeInfoOrBuilder> nodeInfoBuilder_; + + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public java.util.List getNodeInfoList() { + if (nodeInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeInfo_); + } else { + return nodeInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public int getNodeInfoCount() { + if (nodeInfoBuilder_ == null) { + return nodeInfo_.size(); + } else { + return nodeInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public org.tensorflow.proto.GraphTransferNodeInfo getNodeInfo(int index) { + if (nodeInfoBuilder_ == null) { + return nodeInfo_.get(index); + } else { + return nodeInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder setNodeInfo( + int index, org.tensorflow.proto.GraphTransferNodeInfo value) { + if (nodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInfoIsMutable(); + nodeInfo_.set(index, value); + onChanged(); + } else { + nodeInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder setNodeInfo( + int index, org.tensorflow.proto.GraphTransferNodeInfo.Builder builderForValue) { + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + nodeInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder addNodeInfo(org.tensorflow.proto.GraphTransferNodeInfo value) { + if (nodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInfoIsMutable(); + nodeInfo_.add(value); + onChanged(); + } else { + nodeInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder addNodeInfo( + int index, org.tensorflow.proto.GraphTransferNodeInfo value) { + if (nodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInfoIsMutable(); + nodeInfo_.add(index, value); + onChanged(); + } else { + nodeInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder addNodeInfo( + org.tensorflow.proto.GraphTransferNodeInfo.Builder builderForValue) { + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + nodeInfo_.add(builderForValue.build()); + onChanged(); + } else { + nodeInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder addNodeInfo( + int index, org.tensorflow.proto.GraphTransferNodeInfo.Builder builderForValue) { + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + nodeInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder addAllNodeInfo( + java.lang.Iterable values) { + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeInfo_); + onChanged(); + } else { + nodeInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder clearNodeInfo() { + if (nodeInfoBuilder_ == null) { + nodeInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodeInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public Builder removeNodeInfo(int index) { + if (nodeInfoBuilder_ == null) { + ensureNodeInfoIsMutable(); + nodeInfo_.remove(index); + onChanged(); + } else { + nodeInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public org.tensorflow.proto.GraphTransferNodeInfo.Builder getNodeInfoBuilder( + int index) { + return getNodeInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public org.tensorflow.proto.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( + int index) { + if (nodeInfoBuilder_ == null) { + return nodeInfo_.get(index); } else { + return nodeInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public java.util.List + getNodeInfoOrBuilderList() { + if (nodeInfoBuilder_ != null) { + return nodeInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeInfo_); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public org.tensorflow.proto.GraphTransferNodeInfo.Builder addNodeInfoBuilder() { + return getNodeInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public org.tensorflow.proto.GraphTransferNodeInfo.Builder addNodeInfoBuilder( + int index) { + return getNodeInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + public java.util.List + getNodeInfoBuilderList() { + return getNodeInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInfo, org.tensorflow.proto.GraphTransferNodeInfo.Builder, org.tensorflow.proto.GraphTransferNodeInfoOrBuilder> + getNodeInfoFieldBuilder() { + if (nodeInfoBuilder_ == null) { + nodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInfo, org.tensorflow.proto.GraphTransferNodeInfo.Builder, org.tensorflow.proto.GraphTransferNodeInfoOrBuilder>( + nodeInfo_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nodeInfo_ = null; + } + return nodeInfoBuilder_; + } + + private java.util.List constNodeInfo_ = + java.util.Collections.emptyList(); + private void ensureConstNodeInfoIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + constNodeInfo_ = new java.util.ArrayList(constNodeInfo_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferConstNodeInfo, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder> constNodeInfoBuilder_; + + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public java.util.List getConstNodeInfoList() { + if (constNodeInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(constNodeInfo_); + } else { + return constNodeInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public int getConstNodeInfoCount() { + if (constNodeInfoBuilder_ == null) { + return constNodeInfo_.size(); + } else { + return constNodeInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public org.tensorflow.proto.GraphTransferConstNodeInfo getConstNodeInfo(int index) { + if (constNodeInfoBuilder_ == null) { + return constNodeInfo_.get(index); + } else { + return constNodeInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder setConstNodeInfo( + int index, org.tensorflow.proto.GraphTransferConstNodeInfo value) { + if (constNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstNodeInfoIsMutable(); + constNodeInfo_.set(index, value); + onChanged(); + } else { + constNodeInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder setConstNodeInfo( + int index, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder builderForValue) { + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + constNodeInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder addConstNodeInfo(org.tensorflow.proto.GraphTransferConstNodeInfo value) { + if (constNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstNodeInfoIsMutable(); + constNodeInfo_.add(value); + onChanged(); + } else { + constNodeInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder addConstNodeInfo( + int index, org.tensorflow.proto.GraphTransferConstNodeInfo value) { + if (constNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstNodeInfoIsMutable(); + constNodeInfo_.add(index, value); + onChanged(); + } else { + constNodeInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder addConstNodeInfo( + org.tensorflow.proto.GraphTransferConstNodeInfo.Builder builderForValue) { + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.add(builderForValue.build()); + onChanged(); + } else { + constNodeInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder addConstNodeInfo( + int index, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder builderForValue) { + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + constNodeInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder addAllConstNodeInfo( + java.lang.Iterable values) { + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, constNodeInfo_); + onChanged(); + } else { + constNodeInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder clearConstNodeInfo() { + if (constNodeInfoBuilder_ == null) { + constNodeInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + constNodeInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public Builder removeConstNodeInfo(int index) { + if (constNodeInfoBuilder_ == null) { + ensureConstNodeInfoIsMutable(); + constNodeInfo_.remove(index); + onChanged(); + } else { + constNodeInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public org.tensorflow.proto.GraphTransferConstNodeInfo.Builder getConstNodeInfoBuilder( + int index) { + return getConstNodeInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( + int index) { + if (constNodeInfoBuilder_ == null) { + return constNodeInfo_.get(index); } else { + return constNodeInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public java.util.List + getConstNodeInfoOrBuilderList() { + if (constNodeInfoBuilder_ != null) { + return constNodeInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(constNodeInfo_); + } + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public org.tensorflow.proto.GraphTransferConstNodeInfo.Builder addConstNodeInfoBuilder() { + return getConstNodeInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferConstNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public org.tensorflow.proto.GraphTransferConstNodeInfo.Builder addConstNodeInfoBuilder( + int index) { + return getConstNodeInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferConstNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + public java.util.List + getConstNodeInfoBuilderList() { + return getConstNodeInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferConstNodeInfo, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder> + getConstNodeInfoFieldBuilder() { + if (constNodeInfoBuilder_ == null) { + constNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferConstNodeInfo, org.tensorflow.proto.GraphTransferConstNodeInfo.Builder, org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder>( + constNodeInfo_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + constNodeInfo_ = null; + } + return constNodeInfoBuilder_; + } + + private java.util.List nodeInputInfo_ = + java.util.Collections.emptyList(); + private void ensureNodeInputInfoIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + nodeInputInfo_ = new java.util.ArrayList(nodeInputInfo_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInputInfo, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder> nodeInputInfoBuilder_; + + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public java.util.List getNodeInputInfoList() { + if (nodeInputInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeInputInfo_); + } else { + return nodeInputInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public int getNodeInputInfoCount() { + if (nodeInputInfoBuilder_ == null) { + return nodeInputInfo_.size(); + } else { + return nodeInputInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public org.tensorflow.proto.GraphTransferNodeInputInfo getNodeInputInfo(int index) { + if (nodeInputInfoBuilder_ == null) { + return nodeInputInfo_.get(index); + } else { + return nodeInputInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder setNodeInputInfo( + int index, org.tensorflow.proto.GraphTransferNodeInputInfo value) { + if (nodeInputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.set(index, value); + onChanged(); + } else { + nodeInputInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder setNodeInputInfo( + int index, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder builderForValue) { + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeInputInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder addNodeInputInfo(org.tensorflow.proto.GraphTransferNodeInputInfo value) { + if (nodeInputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.add(value); + onChanged(); + } else { + nodeInputInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder addNodeInputInfo( + int index, org.tensorflow.proto.GraphTransferNodeInputInfo value) { + if (nodeInputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.add(index, value); + onChanged(); + } else { + nodeInputInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder addNodeInputInfo( + org.tensorflow.proto.GraphTransferNodeInputInfo.Builder builderForValue) { + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.add(builderForValue.build()); + onChanged(); + } else { + nodeInputInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder addNodeInputInfo( + int index, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder builderForValue) { + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeInputInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder addAllNodeInputInfo( + java.lang.Iterable values) { + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeInputInfo_); + onChanged(); + } else { + nodeInputInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder clearNodeInputInfo() { + if (nodeInputInfoBuilder_ == null) { + nodeInputInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + nodeInputInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public Builder removeNodeInputInfo(int index) { + if (nodeInputInfoBuilder_ == null) { + ensureNodeInputInfoIsMutable(); + nodeInputInfo_.remove(index); + onChanged(); + } else { + nodeInputInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public org.tensorflow.proto.GraphTransferNodeInputInfo.Builder getNodeInputInfoBuilder( + int index) { + return getNodeInputInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( + int index) { + if (nodeInputInfoBuilder_ == null) { + return nodeInputInfo_.get(index); } else { + return nodeInputInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public java.util.List + getNodeInputInfoOrBuilderList() { + if (nodeInputInfoBuilder_ != null) { + return nodeInputInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeInputInfo_); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public org.tensorflow.proto.GraphTransferNodeInputInfo.Builder addNodeInputInfoBuilder() { + return getNodeInputInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferNodeInputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public org.tensorflow.proto.GraphTransferNodeInputInfo.Builder addNodeInputInfoBuilder( + int index) { + return getNodeInputInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferNodeInputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + public java.util.List + getNodeInputInfoBuilderList() { + return getNodeInputInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInputInfo, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder> + getNodeInputInfoFieldBuilder() { + if (nodeInputInfoBuilder_ == null) { + nodeInputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInputInfo, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder, org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder>( + nodeInputInfo_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + nodeInputInfo_ = null; + } + return nodeInputInfoBuilder_; + } + + private java.util.List nodeOutputInfo_ = + java.util.Collections.emptyList(); + private void ensureNodeOutputInfoIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + nodeOutputInfo_ = new java.util.ArrayList(nodeOutputInfo_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeOutputInfo, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder> nodeOutputInfoBuilder_; + + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public java.util.List getNodeOutputInfoList() { + if (nodeOutputInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeOutputInfo_); + } else { + return nodeOutputInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public int getNodeOutputInfoCount() { + if (nodeOutputInfoBuilder_ == null) { + return nodeOutputInfo_.size(); + } else { + return nodeOutputInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public org.tensorflow.proto.GraphTransferNodeOutputInfo getNodeOutputInfo(int index) { + if (nodeOutputInfoBuilder_ == null) { + return nodeOutputInfo_.get(index); + } else { + return nodeOutputInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder setNodeOutputInfo( + int index, org.tensorflow.proto.GraphTransferNodeOutputInfo value) { + if (nodeOutputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.set(index, value); + onChanged(); + } else { + nodeOutputInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder setNodeOutputInfo( + int index, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder builderForValue) { + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeOutputInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder addNodeOutputInfo(org.tensorflow.proto.GraphTransferNodeOutputInfo value) { + if (nodeOutputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.add(value); + onChanged(); + } else { + nodeOutputInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder addNodeOutputInfo( + int index, org.tensorflow.proto.GraphTransferNodeOutputInfo value) { + if (nodeOutputInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.add(index, value); + onChanged(); + } else { + nodeOutputInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder addNodeOutputInfo( + org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder builderForValue) { + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.add(builderForValue.build()); + onChanged(); + } else { + nodeOutputInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder addNodeOutputInfo( + int index, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder builderForValue) { + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeOutputInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder addAllNodeOutputInfo( + java.lang.Iterable values) { + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeOutputInfo_); + onChanged(); + } else { + nodeOutputInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder clearNodeOutputInfo() { + if (nodeOutputInfoBuilder_ == null) { + nodeOutputInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + nodeOutputInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public Builder removeNodeOutputInfo(int index) { + if (nodeOutputInfoBuilder_ == null) { + ensureNodeOutputInfoIsMutable(); + nodeOutputInfo_.remove(index); + onChanged(); + } else { + nodeOutputInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder getNodeOutputInfoBuilder( + int index) { + return getNodeOutputInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( + int index) { + if (nodeOutputInfoBuilder_ == null) { + return nodeOutputInfo_.get(index); } else { + return nodeOutputInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public java.util.List + getNodeOutputInfoOrBuilderList() { + if (nodeOutputInfoBuilder_ != null) { + return nodeOutputInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeOutputInfo_); + } + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder addNodeOutputInfoBuilder() { + return getNodeOutputInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferNodeOutputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder addNodeOutputInfoBuilder( + int index) { + return getNodeOutputInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferNodeOutputInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + public java.util.List + getNodeOutputInfoBuilderList() { + return getNodeOutputInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeOutputInfo, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder> + getNodeOutputInfoFieldBuilder() { + if (nodeOutputInfoBuilder_ == null) { + nodeOutputInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeOutputInfo, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder, org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder>( + nodeOutputInfo_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + nodeOutputInfo_ = null; + } + return nodeOutputInfoBuilder_; + } + + private java.util.List graphInputNodeInfo_ = + java.util.Collections.emptyList(); + private void ensureGraphInputNodeInfoIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + graphInputNodeInfo_ = new java.util.ArrayList(graphInputNodeInfo_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder> graphInputNodeInfoBuilder_; + + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public java.util.List getGraphInputNodeInfoList() { + if (graphInputNodeInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(graphInputNodeInfo_); + } else { + return graphInputNodeInfoBuilder_.getMessageList(); + } + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public int getGraphInputNodeInfoCount() { + if (graphInputNodeInfoBuilder_ == null) { + return graphInputNodeInfo_.size(); + } else { + return graphInputNodeInfoBuilder_.getCount(); + } + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public org.tensorflow.proto.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index) { + if (graphInputNodeInfoBuilder_ == null) { + return graphInputNodeInfo_.get(index); + } else { + return graphInputNodeInfoBuilder_.getMessage(index); + } + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder setGraphInputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphInputNodeInfo value) { + if (graphInputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.set(index, value); + onChanged(); + } else { + graphInputNodeInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder setGraphInputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder builderForValue) { + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + graphInputNodeInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder addGraphInputNodeInfo(org.tensorflow.proto.GraphTransferGraphInputNodeInfo value) { + if (graphInputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.add(value); + onChanged(); + } else { + graphInputNodeInfoBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder addGraphInputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphInputNodeInfo value) { + if (graphInputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.add(index, value); + onChanged(); + } else { + graphInputNodeInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder addGraphInputNodeInfo( + org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder builderForValue) { + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.add(builderForValue.build()); + onChanged(); + } else { + graphInputNodeInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder addGraphInputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder builderForValue) { + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + graphInputNodeInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder addAllGraphInputNodeInfo( + java.lang.Iterable values) { + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, graphInputNodeInfo_); + onChanged(); + } else { + graphInputNodeInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder clearGraphInputNodeInfo() { + if (graphInputNodeInfoBuilder_ == null) { + graphInputNodeInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + graphInputNodeInfoBuilder_.clear(); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public Builder removeGraphInputNodeInfo(int index) { + if (graphInputNodeInfoBuilder_ == null) { + ensureGraphInputNodeInfoIsMutable(); + graphInputNodeInfo_.remove(index); + onChanged(); + } else { + graphInputNodeInfoBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder getGraphInputNodeInfoBuilder( + int index) { + return getGraphInputNodeInfoFieldBuilder().getBuilder(index); + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( + int index) { + if (graphInputNodeInfoBuilder_ == null) { + return graphInputNodeInfo_.get(index); } else { + return graphInputNodeInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public java.util.List + getGraphInputNodeInfoOrBuilderList() { + if (graphInputNodeInfoBuilder_ != null) { + return graphInputNodeInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(graphInputNodeInfo_); + } + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder addGraphInputNodeInfoBuilder() { + return getGraphInputNodeInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferGraphInputNodeInfo.getDefaultInstance()); + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder addGraphInputNodeInfoBuilder( + int index) { + return getGraphInputNodeInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.getDefaultInstance()); + } + /** + *
    +     * Input Node parameters of transferred graph
    +     * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + public java.util.List + getGraphInputNodeInfoBuilderList() { + return getGraphInputNodeInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder> + getGraphInputNodeInfoFieldBuilder() { + if (graphInputNodeInfoBuilder_ == null) { + graphInputNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphInputNodeInfo, org.tensorflow.proto.GraphTransferGraphInputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder>( + graphInputNodeInfo_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + graphInputNodeInfo_ = null; + } + return graphInputNodeInfoBuilder_; + } + + private java.util.List graphOutputNodeInfo_ = + java.util.Collections.emptyList(); + private void ensureGraphOutputNodeInfoIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + graphOutputNodeInfo_ = new java.util.ArrayList(graphOutputNodeInfo_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder> graphOutputNodeInfoBuilder_; + + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public java.util.List getGraphOutputNodeInfoList() { + if (graphOutputNodeInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(graphOutputNodeInfo_); + } else { + return graphOutputNodeInfoBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public int getGraphOutputNodeInfoCount() { + if (graphOutputNodeInfoBuilder_ == null) { + return graphOutputNodeInfo_.size(); + } else { + return graphOutputNodeInfoBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index) { + if (graphOutputNodeInfoBuilder_ == null) { + return graphOutputNodeInfo_.get(index); + } else { + return graphOutputNodeInfoBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder setGraphOutputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo value) { + if (graphOutputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.set(index, value); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder setGraphOutputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder addGraphOutputNodeInfo(org.tensorflow.proto.GraphTransferGraphOutputNodeInfo value) { + if (graphOutputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.add(value); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder addGraphOutputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo value) { + if (graphOutputNodeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.add(index, value); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder addGraphOutputNodeInfo( + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.add(builderForValue.build()); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder addGraphOutputNodeInfo( + int index, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder builderForValue) { + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder addAllGraphOutputNodeInfo( + java.lang.Iterable values) { + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, graphOutputNodeInfo_); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder clearGraphOutputNodeInfo() { + if (graphOutputNodeInfoBuilder_ == null) { + graphOutputNodeInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public Builder removeGraphOutputNodeInfo(int index) { + if (graphOutputNodeInfoBuilder_ == null) { + ensureGraphOutputNodeInfoIsMutable(); + graphOutputNodeInfo_.remove(index); + onChanged(); + } else { + graphOutputNodeInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder getGraphOutputNodeInfoBuilder( + int index) { + return getGraphOutputNodeInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( + int index) { + if (graphOutputNodeInfoBuilder_ == null) { + return graphOutputNodeInfo_.get(index); } else { + return graphOutputNodeInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public java.util.List + getGraphOutputNodeInfoOrBuilderList() { + if (graphOutputNodeInfoBuilder_ != null) { + return graphOutputNodeInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(graphOutputNodeInfo_); + } + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder addGraphOutputNodeInfoBuilder() { + return getGraphOutputNodeInfoFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder addGraphOutputNodeInfoBuilder( + int index) { + return getGraphOutputNodeInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + public java.util.List + getGraphOutputNodeInfoBuilderList() { + return getGraphOutputNodeInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder> + getGraphOutputNodeInfoFieldBuilder() { + if (graphOutputNodeInfoBuilder_ == null) { + graphOutputNodeInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo, org.tensorflow.proto.GraphTransferGraphOutputNodeInfo.Builder, org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder>( + graphOutputNodeInfo_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + graphOutputNodeInfo_ = null; + } + return graphOutputNodeInfoBuilder_; + } + + private int destination_ = 0; + /** + *
    +     * Destination of graph transfer
    +     * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override public int getDestinationValue() { + return destination_; + } + /** + *
    +     * Destination of graph transfer
    +     * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @param value The enum numeric value on the wire for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationValue(int value) { + destination_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Destination of graph transfer
    +     * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The destination. + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferInfo.Destination getDestination() { + org.tensorflow.proto.GraphTransferInfo.Destination result = org.tensorflow.proto.GraphTransferInfo.Destination.forNumber(destination_); + return result == null ? org.tensorflow.proto.GraphTransferInfo.Destination.UNRECOGNIZED : result; + } + /** + *
    +     * Destination of graph transfer
    +     * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(org.tensorflow.proto.GraphTransferInfo.Destination value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + destination_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Destination of graph transfer
    +     * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return This builder for chaining. + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000040); + destination_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferInfo) + private static final org.tensorflow.proto.GraphTransferInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferInfo(); + } + + public static org.tensorflow.proto.GraphTransferInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphTransferInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphTransferInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoOrBuilder.java new file mode 100644 index 00000000000..037aa6c37d2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoOrBuilder.java @@ -0,0 +1,194 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphTransferInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + java.util.List + getNodeInfoList(); + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + org.tensorflow.proto.GraphTransferNodeInfo getNodeInfo(int index); + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + int getNodeInfoCount(); + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + java.util.List + getNodeInfoOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferNodeInfo node_info = 1; + */ + org.tensorflow.proto.GraphTransferNodeInfoOrBuilder getNodeInfoOrBuilder( + int index); + + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + java.util.List + getConstNodeInfoList(); + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + org.tensorflow.proto.GraphTransferConstNodeInfo getConstNodeInfo(int index); + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + int getConstNodeInfoCount(); + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + java.util.List + getConstNodeInfoOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferConstNodeInfo const_node_info = 2; + */ + org.tensorflow.proto.GraphTransferConstNodeInfoOrBuilder getConstNodeInfoOrBuilder( + int index); + + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + java.util.List + getNodeInputInfoList(); + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + org.tensorflow.proto.GraphTransferNodeInputInfo getNodeInputInfo(int index); + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + int getNodeInputInfoCount(); + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + java.util.List + getNodeInputInfoOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferNodeInputInfo node_input_info = 3; + */ + org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder getNodeInputInfoOrBuilder( + int index); + + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + java.util.List + getNodeOutputInfoList(); + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + org.tensorflow.proto.GraphTransferNodeOutputInfo getNodeOutputInfo(int index); + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + int getNodeOutputInfoCount(); + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + java.util.List + getNodeOutputInfoOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferNodeOutputInfo node_output_info = 4; + */ + org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder getNodeOutputInfoOrBuilder( + int index); + + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + java.util.List + getGraphInputNodeInfoList(); + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + org.tensorflow.proto.GraphTransferGraphInputNodeInfo getGraphInputNodeInfo(int index); + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + int getGraphInputNodeInfoCount(); + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + java.util.List + getGraphInputNodeInfoOrBuilderList(); + /** + *
    +   * Input Node parameters of transferred graph
    +   * 
    + * + * repeated .tensorflow.GraphTransferGraphInputNodeInfo graph_input_node_info = 5; + */ + org.tensorflow.proto.GraphTransferGraphInputNodeInfoOrBuilder getGraphInputNodeInfoOrBuilder( + int index); + + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + java.util.List + getGraphOutputNodeInfoList(); + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + org.tensorflow.proto.GraphTransferGraphOutputNodeInfo getGraphOutputNodeInfo(int index); + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + int getGraphOutputNodeInfoCount(); + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + java.util.List + getGraphOutputNodeInfoOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferGraphOutputNodeInfo graph_output_node_info = 6; + */ + org.tensorflow.proto.GraphTransferGraphOutputNodeInfoOrBuilder getGraphOutputNodeInfoOrBuilder( + int index); + + /** + *
    +   * Destination of graph transfer
    +   * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The enum numeric value on the wire for destination. + */ + int getDestinationValue(); + /** + *
    +   * Destination of graph transfer
    +   * 
    + * + * .tensorflow.GraphTransferInfo.Destination destination = 7; + * @return The destination. + */ + org.tensorflow.proto.GraphTransferInfo.Destination getDestination(); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoProto.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoProto.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoProto.java index 750526c8897..2bc9df9dcf6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferInfoProto.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferInfoProto.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class GraphTransferInfoProto { private GraphTransferInfoProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferInfoProto.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,42 +28,42 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferNodeInput_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferNodeInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_GraphTransferInfo_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -96,67 +107,67 @@ public static void registerAllExtensions( "_info\030\006 \003(\0132,.tensorflow.GraphTransferGr" + "aphOutputNodeInfo\022>\n\013destination\030\007 \001(\0162)" + ".tensorflow.GraphTransferInfo.Destinatio" + - "n\"#\n\013Destination\022\007\n\003NOP\020\000\022\013\n\007HEXAGON\020\001B\231" + - "\001\n\036org.tensorflow.proto.frameworkB\026Graph" + - "TransferInfoProtoP\001ZZgithub.com/tensorfl" + - "ow/tensorflow/tensorflow/go/core/framewo" + - "rk/graph_transfer_info_go_proto\370\001\001b\006prot" + - "o3" + "n\"#\n\013Destination\022\007\n\003NOP\020\000\022\013\n\007HEXAGON\020\001B\217" + + "\001\n\024org.tensorflow.protoB\026GraphTransferIn" + + "foProtoP\001ZZgithub.com/tensorflow/tensorf" + + "low/tensorflow/go/core/framework/graph_t" + + "ransfer_info_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TypesProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), }); internal_static_tensorflow_GraphTransferNodeInput_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferNodeInput_descriptor, new java.lang.String[] { "NodeId", "OutputPort", }); internal_static_tensorflow_GraphTransferNodeInfo_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferNodeInfo_descriptor, new java.lang.String[] { "Name", "NodeId", "TypeName", "SocOpId", "PaddingId", "InputCount", "OutputCount", }); internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_GraphTransferConstNodeInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferConstNodeInfo_descriptor, new java.lang.String[] { "Name", "NodeId", "Shape", "Data", "Dtype", }); internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor, new java.lang.String[] { "NodeId", "NodeInput", }); internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor, new java.lang.String[] { "NodeId", "MaxByteSize", }); internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_tensorflow_GraphTransferGraphInputNodeInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferGraphInputNodeInfo_descriptor, new java.lang.String[] { "Name", "Shape", "Dtype", }); internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferGraphOutputNodeInfo_descriptor, new java.lang.String[] { "Name", "Shape", "Dtype", }); internal_static_tensorflow_GraphTransferInfo_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_tensorflow_GraphTransferInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_GraphTransferInfo_descriptor, new java.lang.String[] { "NodeInfo", "ConstNodeInfo", "NodeInputInfo", "NodeOutputInfo", "GraphInputNodeInfo", "GraphOutputNodeInfo", "Destination", }); - org.tensorflow.proto.framework.TypesProtos.getDescriptor(); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TypesProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfo.java new file mode 100644 index 00000000000..9dba76360d4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfo.java @@ -0,0 +1,967 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphTransferNodeInfo} + */ +public final class GraphTransferNodeInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInfo) + GraphTransferNodeInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferNodeInfo.class.getName()); + } + // Use GraphTransferNodeInfo.newBuilder() to construct. + private GraphTransferNodeInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphTransferNodeInfo() { + name_ = ""; + typeName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInfo.class, org.tensorflow.proto.GraphTransferNodeInfo.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 NODE_ID_FIELD_NUMBER = 2; + private int nodeId_ = 0; + /** + * int32 node_id = 2; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int TYPE_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object typeName_ = ""; + /** + * string type_name = 3; + * @return The typeName. + */ + @java.lang.Override + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + 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(); + typeName_ = s; + return s; + } + } + /** + * string type_name = 3; + * @return The bytes for typeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOC_OP_ID_FIELD_NUMBER = 4; + private int socOpId_ = 0; + /** + * int32 soc_op_id = 4; + * @return The socOpId. + */ + @java.lang.Override + public int getSocOpId() { + return socOpId_; + } + + public static final int PADDING_ID_FIELD_NUMBER = 5; + private int paddingId_ = 0; + /** + * int32 padding_id = 5; + * @return The paddingId. + */ + @java.lang.Override + public int getPaddingId() { + return paddingId_; + } + + public static final int INPUT_COUNT_FIELD_NUMBER = 6; + private int inputCount_ = 0; + /** + * int32 input_count = 6; + * @return The inputCount. + */ + @java.lang.Override + public int getInputCount() { + return inputCount_; + } + + public static final int OUTPUT_COUNT_FIELD_NUMBER = 7; + private int outputCount_ = 0; + /** + * int32 output_count = 7; + * @return The outputCount. + */ + @java.lang.Override + public int getOutputCount() { + return outputCount_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (nodeId_ != 0) { + output.writeInt32(2, nodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, typeName_); + } + if (socOpId_ != 0) { + output.writeInt32(4, socOpId_); + } + if (paddingId_ != 0) { + output.writeInt32(5, paddingId_); + } + if (inputCount_ != 0) { + output.writeInt32(6, inputCount_); + } + if (outputCount_ != 0) { + output.writeInt32(7, outputCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, nodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, typeName_); + } + if (socOpId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, socOpId_); + } + if (paddingId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, paddingId_); + } + if (inputCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, inputCount_); + } + if (outputCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, outputCount_); + } + size += getUnknownFields().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.GraphTransferNodeInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphTransferNodeInfo other = (org.tensorflow.proto.GraphTransferNodeInfo) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getNodeId() + != other.getNodeId()) return false; + if (!getTypeName() + .equals(other.getTypeName())) return false; + if (getSocOpId() + != other.getSocOpId()) return false; + if (getPaddingId() + != other.getPaddingId()) return false; + if (getInputCount() + != other.getInputCount()) return false; + if (getOutputCount() + != other.getOutputCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + hash = (37 * hash) + TYPE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTypeName().hashCode(); + hash = (37 * hash) + SOC_OP_ID_FIELD_NUMBER; + hash = (53 * hash) + getSocOpId(); + hash = (37 * hash) + PADDING_ID_FIELD_NUMBER; + hash = (53 * hash) + getPaddingId(); + hash = (37 * hash) + INPUT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getInputCount(); + hash = (37 * hash) + OUTPUT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getOutputCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInfo 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.GraphTransferNodeInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphTransferNodeInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphTransferNodeInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphTransferNodeInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphTransferNodeInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInfo) + org.tensorflow.proto.GraphTransferNodeInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInfo.class, org.tensorflow.proto.GraphTransferNodeInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphTransferNodeInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + nodeId_ = 0; + typeName_ = ""; + socOpId_ = 0; + paddingId_ = 0; + inputCount_ = 0; + outputCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GraphTransferNodeInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInfo build() { + org.tensorflow.proto.GraphTransferNodeInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInfo buildPartial() { + org.tensorflow.proto.GraphTransferNodeInfo result = new org.tensorflow.proto.GraphTransferNodeInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphTransferNodeInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nodeId_ = nodeId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.typeName_ = typeName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.socOpId_ = socOpId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.paddingId_ = paddingId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.inputCount_ = inputCount_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.outputCount_ = outputCount_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphTransferNodeInfo) { + return mergeFrom((org.tensorflow.proto.GraphTransferNodeInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphTransferNodeInfo other) { + if (other == org.tensorflow.proto.GraphTransferNodeInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (!other.getTypeName().isEmpty()) { + typeName_ = other.typeName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getSocOpId() != 0) { + setSocOpId(other.getSocOpId()); + } + if (other.getPaddingId() != 0) { + setPaddingId(other.getPaddingId()); + } + if (other.getInputCount() != 0) { + setInputCount(other.getInputCount()); + } + if (other.getOutputCount() != 0) { + setOutputCount(other.getOutputCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + typeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + socOpId_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + paddingId_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + inputCount_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + outputCount_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int nodeId_ ; + /** + * int32 node_id = 2; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + * int32 node_id = 2; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 node_id = 2; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00000002); + nodeId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object typeName_ = ""; + /** + * string type_name = 3; + * @return The typeName. + */ + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string type_name = 3; + * @return The bytes for typeName. + */ + public com.google.protobuf.ByteString + getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string type_name = 3; + * @param value The typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + typeName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string type_name = 3; + * @return This builder for chaining. + */ + public Builder clearTypeName() { + typeName_ = getDefaultInstance().getTypeName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string type_name = 3; + * @param value The bytes for typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + typeName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int socOpId_ ; + /** + * int32 soc_op_id = 4; + * @return The socOpId. + */ + @java.lang.Override + public int getSocOpId() { + return socOpId_; + } + /** + * int32 soc_op_id = 4; + * @param value The socOpId to set. + * @return This builder for chaining. + */ + public Builder setSocOpId(int value) { + + socOpId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 soc_op_id = 4; + * @return This builder for chaining. + */ + public Builder clearSocOpId() { + bitField0_ = (bitField0_ & ~0x00000008); + socOpId_ = 0; + onChanged(); + return this; + } + + private int paddingId_ ; + /** + * int32 padding_id = 5; + * @return The paddingId. + */ + @java.lang.Override + public int getPaddingId() { + return paddingId_; + } + /** + * int32 padding_id = 5; + * @param value The paddingId to set. + * @return This builder for chaining. + */ + public Builder setPaddingId(int value) { + + paddingId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 padding_id = 5; + * @return This builder for chaining. + */ + public Builder clearPaddingId() { + bitField0_ = (bitField0_ & ~0x00000010); + paddingId_ = 0; + onChanged(); + return this; + } + + private int inputCount_ ; + /** + * int32 input_count = 6; + * @return The inputCount. + */ + @java.lang.Override + public int getInputCount() { + return inputCount_; + } + /** + * int32 input_count = 6; + * @param value The inputCount to set. + * @return This builder for chaining. + */ + public Builder setInputCount(int value) { + + inputCount_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 input_count = 6; + * @return This builder for chaining. + */ + public Builder clearInputCount() { + bitField0_ = (bitField0_ & ~0x00000020); + inputCount_ = 0; + onChanged(); + return this; + } + + private int outputCount_ ; + /** + * int32 output_count = 7; + * @return The outputCount. + */ + @java.lang.Override + public int getOutputCount() { + return outputCount_; + } + /** + * int32 output_count = 7; + * @param value The outputCount to set. + * @return This builder for chaining. + */ + public Builder setOutputCount(int value) { + + outputCount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 output_count = 7; + * @return This builder for chaining. + */ + public Builder clearOutputCount() { + bitField0_ = (bitField0_ & ~0x00000040); + outputCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferNodeInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInfo) + private static final org.tensorflow.proto.GraphTransferNodeInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferNodeInfo(); + } + + public static org.tensorflow.proto.GraphTransferNodeInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphTransferNodeInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphTransferNodeInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfoOrBuilder.java new file mode 100644 index 00000000000..01ef2545a87 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInfoOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphTransferNodeInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int32 node_id = 2; + * @return The nodeId. + */ + int getNodeId(); + + /** + * string type_name = 3; + * @return The typeName. + */ + java.lang.String getTypeName(); + /** + * string type_name = 3; + * @return The bytes for typeName. + */ + com.google.protobuf.ByteString + getTypeNameBytes(); + + /** + * int32 soc_op_id = 4; + * @return The socOpId. + */ + int getSocOpId(); + + /** + * int32 padding_id = 5; + * @return The paddingId. + */ + int getPaddingId(); + + /** + * int32 input_count = 6; + * @return The inputCount. + */ + int getInputCount(); + + /** + * int32 output_count = 7; + * @return The outputCount. + */ + int getOutputCount(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInput.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInput.java new file mode 100644 index 00000000000..0400ad21f83 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInput.java @@ -0,0 +1,497 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphTransferNodeInput} + */ +public final class GraphTransferNodeInput extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInput) + GraphTransferNodeInputOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferNodeInput.class.getName()); + } + // Use GraphTransferNodeInput.newBuilder() to construct. + private GraphTransferNodeInput(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphTransferNodeInput() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInput.class, org.tensorflow.proto.GraphTransferNodeInput.Builder.class); + } + + public static final int NODE_ID_FIELD_NUMBER = 1; + private int nodeId_ = 0; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int OUTPUT_PORT_FIELD_NUMBER = 2; + private int outputPort_ = 0; + /** + * int32 output_port = 2; + * @return The outputPort. + */ + @java.lang.Override + public int getOutputPort() { + return outputPort_; + } + + 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 (nodeId_ != 0) { + output.writeInt32(1, nodeId_); + } + if (outputPort_ != 0) { + output.writeInt32(2, outputPort_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nodeId_); + } + if (outputPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, outputPort_); + } + size += getUnknownFields().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.GraphTransferNodeInput)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphTransferNodeInput other = (org.tensorflow.proto.GraphTransferNodeInput) obj; + + if (getNodeId() + != other.getNodeId()) return false; + if (getOutputPort() + != other.getOutputPort()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + hash = (37 * hash) + OUTPUT_PORT_FIELD_NUMBER; + hash = (53 * hash) + getOutputPort(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInput 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.GraphTransferNodeInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInput 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.GraphTransferNodeInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphTransferNodeInput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphTransferNodeInput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphTransferNodeInput 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphTransferNodeInput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInput) + org.tensorflow.proto.GraphTransferNodeInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInput.class, org.tensorflow.proto.GraphTransferNodeInput.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphTransferNodeInput.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeId_ = 0; + outputPort_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInput_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInput getDefaultInstanceForType() { + return org.tensorflow.proto.GraphTransferNodeInput.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInput build() { + org.tensorflow.proto.GraphTransferNodeInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInput buildPartial() { + org.tensorflow.proto.GraphTransferNodeInput result = new org.tensorflow.proto.GraphTransferNodeInput(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphTransferNodeInput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeId_ = nodeId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputPort_ = outputPort_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphTransferNodeInput) { + return mergeFrom((org.tensorflow.proto.GraphTransferNodeInput)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphTransferNodeInput other) { + if (other == org.tensorflow.proto.GraphTransferNodeInput.getDefaultInstance()) return this; + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (other.getOutputPort() != 0) { + setOutputPort(other.getOutputPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + outputPort_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int nodeId_ ; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + * int32 node_id = 1; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 node_id = 1; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeId_ = 0; + onChanged(); + return this; + } + + private int outputPort_ ; + /** + * int32 output_port = 2; + * @return The outputPort. + */ + @java.lang.Override + public int getOutputPort() { + return outputPort_; + } + /** + * int32 output_port = 2; + * @param value The outputPort to set. + * @return This builder for chaining. + */ + public Builder setOutputPort(int value) { + + outputPort_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 output_port = 2; + * @return This builder for chaining. + */ + public Builder clearOutputPort() { + bitField0_ = (bitField0_ & ~0x00000002); + outputPort_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferNodeInput) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInput) + private static final org.tensorflow.proto.GraphTransferNodeInput DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferNodeInput(); + } + + public static org.tensorflow.proto.GraphTransferNodeInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphTransferNodeInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphTransferNodeInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfo.java new file mode 100644 index 00000000000..93f82e0e8c8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfo.java @@ -0,0 +1,785 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphTransferNodeInputInfo} + */ +public final class GraphTransferNodeInputInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeInputInfo) + GraphTransferNodeInputInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferNodeInputInfo.class.getName()); + } + // Use GraphTransferNodeInputInfo.newBuilder() to construct. + private GraphTransferNodeInputInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphTransferNodeInputInfo() { + nodeInput_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInputInfo.class, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder.class); + } + + public static final int NODE_ID_FIELD_NUMBER = 1; + private int nodeId_ = 0; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int NODE_INPUT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List nodeInput_; + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + @java.lang.Override + public java.util.List getNodeInputList() { + return nodeInput_; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + @java.lang.Override + public java.util.List + getNodeInputOrBuilderList() { + return nodeInput_; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + @java.lang.Override + public int getNodeInputCount() { + return nodeInput_.size(); + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInput getNodeInput(int index) { + return nodeInput_.get(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( + int index) { + return nodeInput_.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 { + if (nodeId_ != 0) { + output.writeInt32(1, nodeId_); + } + for (int i = 0; i < nodeInput_.size(); i++) { + output.writeMessage(2, nodeInput_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nodeId_); + } + for (int i = 0; i < nodeInput_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, nodeInput_.get(i)); + } + size += getUnknownFields().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.GraphTransferNodeInputInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphTransferNodeInputInfo other = (org.tensorflow.proto.GraphTransferNodeInputInfo) obj; + + if (getNodeId() + != other.getNodeId()) return false; + if (!getNodeInputList() + .equals(other.getNodeInputList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + if (getNodeInputCount() > 0) { + hash = (37 * hash) + NODE_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getNodeInputList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo 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.GraphTransferNodeInputInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeInputInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphTransferNodeInputInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphTransferNodeInputInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeInputInfo) + org.tensorflow.proto.GraphTransferNodeInputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeInputInfo.class, org.tensorflow.proto.GraphTransferNodeInputInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphTransferNodeInputInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeId_ = 0; + if (nodeInputBuilder_ == null) { + nodeInput_ = java.util.Collections.emptyList(); + } else { + nodeInput_ = null; + nodeInputBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeInputInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GraphTransferNodeInputInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputInfo build() { + org.tensorflow.proto.GraphTransferNodeInputInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeInputInfo buildPartial() { + org.tensorflow.proto.GraphTransferNodeInputInfo result = new org.tensorflow.proto.GraphTransferNodeInputInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.GraphTransferNodeInputInfo result) { + if (nodeInputBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + nodeInput_ = java.util.Collections.unmodifiableList(nodeInput_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.nodeInput_ = nodeInput_; + } else { + result.nodeInput_ = nodeInputBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.GraphTransferNodeInputInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeId_ = nodeId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphTransferNodeInputInfo) { + return mergeFrom((org.tensorflow.proto.GraphTransferNodeInputInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphTransferNodeInputInfo other) { + if (other == org.tensorflow.proto.GraphTransferNodeInputInfo.getDefaultInstance()) return this; + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (nodeInputBuilder_ == null) { + if (!other.nodeInput_.isEmpty()) { + if (nodeInput_.isEmpty()) { + nodeInput_ = other.nodeInput_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNodeInputIsMutable(); + nodeInput_.addAll(other.nodeInput_); + } + onChanged(); + } + } else { + if (!other.nodeInput_.isEmpty()) { + if (nodeInputBuilder_.isEmpty()) { + nodeInputBuilder_.dispose(); + nodeInputBuilder_ = null; + nodeInput_ = other.nodeInput_; + bitField0_ = (bitField0_ & ~0x00000002); + nodeInputBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodeInputFieldBuilder() : null; + } else { + nodeInputBuilder_.addAllMessages(other.nodeInput_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + org.tensorflow.proto.GraphTransferNodeInput m = + input.readMessage( + org.tensorflow.proto.GraphTransferNodeInput.parser(), + extensionRegistry); + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + nodeInput_.add(m); + } else { + nodeInputBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int nodeId_ ; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + * int32 node_id = 1; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 node_id = 1; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeId_ = 0; + onChanged(); + return this; + } + + private java.util.List nodeInput_ = + java.util.Collections.emptyList(); + private void ensureNodeInputIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + nodeInput_ = new java.util.ArrayList(nodeInput_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInput, org.tensorflow.proto.GraphTransferNodeInput.Builder, org.tensorflow.proto.GraphTransferNodeInputOrBuilder> nodeInputBuilder_; + + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public java.util.List getNodeInputList() { + if (nodeInputBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodeInput_); + } else { + return nodeInputBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public int getNodeInputCount() { + if (nodeInputBuilder_ == null) { + return nodeInput_.size(); + } else { + return nodeInputBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public org.tensorflow.proto.GraphTransferNodeInput getNodeInput(int index) { + if (nodeInputBuilder_ == null) { + return nodeInput_.get(index); + } else { + return nodeInputBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder setNodeInput( + int index, org.tensorflow.proto.GraphTransferNodeInput value) { + if (nodeInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputIsMutable(); + nodeInput_.set(index, value); + onChanged(); + } else { + nodeInputBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder setNodeInput( + int index, org.tensorflow.proto.GraphTransferNodeInput.Builder builderForValue) { + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + nodeInput_.set(index, builderForValue.build()); + onChanged(); + } else { + nodeInputBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder addNodeInput(org.tensorflow.proto.GraphTransferNodeInput value) { + if (nodeInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputIsMutable(); + nodeInput_.add(value); + onChanged(); + } else { + nodeInputBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder addNodeInput( + int index, org.tensorflow.proto.GraphTransferNodeInput value) { + if (nodeInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodeInputIsMutable(); + nodeInput_.add(index, value); + onChanged(); + } else { + nodeInputBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder addNodeInput( + org.tensorflow.proto.GraphTransferNodeInput.Builder builderForValue) { + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + nodeInput_.add(builderForValue.build()); + onChanged(); + } else { + nodeInputBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder addNodeInput( + int index, org.tensorflow.proto.GraphTransferNodeInput.Builder builderForValue) { + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + nodeInput_.add(index, builderForValue.build()); + onChanged(); + } else { + nodeInputBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder addAllNodeInput( + java.lang.Iterable values) { + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodeInput_); + onChanged(); + } else { + nodeInputBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder clearNodeInput() { + if (nodeInputBuilder_ == null) { + nodeInput_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + nodeInputBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public Builder removeNodeInput(int index) { + if (nodeInputBuilder_ == null) { + ensureNodeInputIsMutable(); + nodeInput_.remove(index); + onChanged(); + } else { + nodeInputBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public org.tensorflow.proto.GraphTransferNodeInput.Builder getNodeInputBuilder( + int index) { + return getNodeInputFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public org.tensorflow.proto.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( + int index) { + if (nodeInputBuilder_ == null) { + return nodeInput_.get(index); } else { + return nodeInputBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public java.util.List + getNodeInputOrBuilderList() { + if (nodeInputBuilder_ != null) { + return nodeInputBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodeInput_); + } + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public org.tensorflow.proto.GraphTransferNodeInput.Builder addNodeInputBuilder() { + return getNodeInputFieldBuilder().addBuilder( + org.tensorflow.proto.GraphTransferNodeInput.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public org.tensorflow.proto.GraphTransferNodeInput.Builder addNodeInputBuilder( + int index) { + return getNodeInputFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphTransferNodeInput.getDefaultInstance()); + } + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + public java.util.List + getNodeInputBuilderList() { + return getNodeInputFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInput, org.tensorflow.proto.GraphTransferNodeInput.Builder, org.tensorflow.proto.GraphTransferNodeInputOrBuilder> + getNodeInputFieldBuilder() { + if (nodeInputBuilder_ == null) { + nodeInputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphTransferNodeInput, org.tensorflow.proto.GraphTransferNodeInput.Builder, org.tensorflow.proto.GraphTransferNodeInputOrBuilder>( + nodeInput_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + nodeInput_ = null; + } + return nodeInputBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferNodeInputInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeInputInfo) + private static final org.tensorflow.proto.GraphTransferNodeInputInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferNodeInputInfo(); + } + + public static org.tensorflow.proto.GraphTransferNodeInputInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphTransferNodeInputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphTransferNodeInputInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfoOrBuilder.java new file mode 100644 index 00000000000..391ca3f1e24 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputInfoOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphTransferNodeInputInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 node_id = 1; + * @return The nodeId. + */ + int getNodeId(); + + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + java.util.List + getNodeInputList(); + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + org.tensorflow.proto.GraphTransferNodeInput getNodeInput(int index); + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + int getNodeInputCount(); + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + java.util.List + getNodeInputOrBuilderList(); + /** + * repeated .tensorflow.GraphTransferNodeInput node_input = 2; + */ + org.tensorflow.proto.GraphTransferNodeInputOrBuilder getNodeInputOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputOrBuilder.java index 971ffed8443..dd8ac32649e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/GraphTransferNodeInputOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeInputOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface GraphTransferNodeInputOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeInput) @@ -9,11 +11,13 @@ public interface GraphTransferNodeInputOrBuilder extends /** * int32 node_id = 1; + * @return The nodeId. */ int getNodeId(); /** * int32 output_port = 2; + * @return The outputPort. */ int getOutputPort(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfo.java new file mode 100644 index 00000000000..b42b3fb547c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfo.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.GraphTransferNodeOutputInfo} + */ +public final class GraphTransferNodeOutputInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.GraphTransferNodeOutputInfo) + GraphTransferNodeOutputInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GraphTransferNodeOutputInfo.class.getName()); + } + // Use GraphTransferNodeOutputInfo.newBuilder() to construct. + private GraphTransferNodeOutputInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GraphTransferNodeOutputInfo() { + maxByteSize_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeOutputInfo.class, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder.class); + } + + public static final int NODE_ID_FIELD_NUMBER = 1; + private int nodeId_ = 0; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int MAX_BYTE_SIZE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList maxByteSize_ = + emptyIntList(); + /** + * repeated int32 max_byte_size = 2; + * @return A list containing the maxByteSize. + */ + @java.lang.Override + public java.util.List + getMaxByteSizeList() { + return maxByteSize_; + } + /** + * repeated int32 max_byte_size = 2; + * @return The count of maxByteSize. + */ + public int getMaxByteSizeCount() { + return maxByteSize_.size(); + } + /** + * repeated int32 max_byte_size = 2; + * @param index The index of the element to return. + * @return The maxByteSize at the given index. + */ + public int getMaxByteSize(int index) { + return maxByteSize_.getInt(index); + } + private int maxByteSizeMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (nodeId_ != 0) { + output.writeInt32(1, nodeId_); + } + if (getMaxByteSizeList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(maxByteSizeMemoizedSerializedSize); + } + for (int i = 0; i < maxByteSize_.size(); i++) { + output.writeInt32NoTag(maxByteSize_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nodeId_); + } + { + int dataSize = 0; + for (int i = 0; i < maxByteSize_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(maxByteSize_.getInt(i)); + } + size += dataSize; + if (!getMaxByteSizeList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + maxByteSizeMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.GraphTransferNodeOutputInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.GraphTransferNodeOutputInfo other = (org.tensorflow.proto.GraphTransferNodeOutputInfo) obj; + + if (getNodeId() + != other.getNodeId()) return false; + if (!getMaxByteSizeList() + .equals(other.getMaxByteSizeList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + if (getMaxByteSizeCount() > 0) { + hash = (37 * hash) + MAX_BYTE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getMaxByteSizeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo 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.GraphTransferNodeOutputInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.GraphTransferNodeOutputInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.GraphTransferNodeOutputInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.GraphTransferNodeOutputInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.GraphTransferNodeOutputInfo) + org.tensorflow.proto.GraphTransferNodeOutputInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.GraphTransferNodeOutputInfo.class, org.tensorflow.proto.GraphTransferNodeOutputInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.GraphTransferNodeOutputInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeId_ = 0; + maxByteSize_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.GraphTransferInfoProto.internal_static_tensorflow_GraphTransferNodeOutputInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeOutputInfo getDefaultInstanceForType() { + return org.tensorflow.proto.GraphTransferNodeOutputInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeOutputInfo build() { + org.tensorflow.proto.GraphTransferNodeOutputInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.GraphTransferNodeOutputInfo buildPartial() { + org.tensorflow.proto.GraphTransferNodeOutputInfo result = new org.tensorflow.proto.GraphTransferNodeOutputInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.GraphTransferNodeOutputInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeId_ = nodeId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + maxByteSize_.makeImmutable(); + result.maxByteSize_ = maxByteSize_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.GraphTransferNodeOutputInfo) { + return mergeFrom((org.tensorflow.proto.GraphTransferNodeOutputInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.GraphTransferNodeOutputInfo other) { + if (other == org.tensorflow.proto.GraphTransferNodeOutputInfo.getDefaultInstance()) return this; + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (!other.maxByteSize_.isEmpty()) { + if (maxByteSize_.isEmpty()) { + maxByteSize_ = other.maxByteSize_; + maxByteSize_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureMaxByteSizeIsMutable(); + maxByteSize_.addAll(other.maxByteSize_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + int v = input.readInt32(); + ensureMaxByteSizeIsMutable(); + maxByteSize_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureMaxByteSizeIsMutable(); + while (input.getBytesUntilLimit() > 0) { + maxByteSize_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int nodeId_ ; + /** + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + * int32 node_id = 1; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 node_id = 1; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeId_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList maxByteSize_ = emptyIntList(); + private void ensureMaxByteSizeIsMutable() { + if (!maxByteSize_.isModifiable()) { + maxByteSize_ = makeMutableCopy(maxByteSize_); + } + bitField0_ |= 0x00000002; + } + /** + * repeated int32 max_byte_size = 2; + * @return A list containing the maxByteSize. + */ + public java.util.List + getMaxByteSizeList() { + maxByteSize_.makeImmutable(); + return maxByteSize_; + } + /** + * repeated int32 max_byte_size = 2; + * @return The count of maxByteSize. + */ + public int getMaxByteSizeCount() { + return maxByteSize_.size(); + } + /** + * repeated int32 max_byte_size = 2; + * @param index The index of the element to return. + * @return The maxByteSize at the given index. + */ + public int getMaxByteSize(int index) { + return maxByteSize_.getInt(index); + } + /** + * repeated int32 max_byte_size = 2; + * @param index The index to set the value at. + * @param value The maxByteSize to set. + * @return This builder for chaining. + */ + public Builder setMaxByteSize( + int index, int value) { + + ensureMaxByteSizeIsMutable(); + maxByteSize_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 max_byte_size = 2; + * @param value The maxByteSize to add. + * @return This builder for chaining. + */ + public Builder addMaxByteSize(int value) { + + ensureMaxByteSizeIsMutable(); + maxByteSize_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 max_byte_size = 2; + * @param values The maxByteSize to add. + * @return This builder for chaining. + */ + public Builder addAllMaxByteSize( + java.lang.Iterable values) { + ensureMaxByteSizeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, maxByteSize_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 max_byte_size = 2; + * @return This builder for chaining. + */ + public Builder clearMaxByteSize() { + maxByteSize_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.GraphTransferNodeOutputInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.GraphTransferNodeOutputInfo) + private static final org.tensorflow.proto.GraphTransferNodeOutputInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.GraphTransferNodeOutputInfo(); + } + + public static org.tensorflow.proto.GraphTransferNodeOutputInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GraphTransferNodeOutputInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GraphTransferNodeOutputInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfoOrBuilder.java new file mode 100644 index 00000000000..562283cc21f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/GraphTransferNodeOutputInfoOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/graph_transfer_info.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface GraphTransferNodeOutputInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.GraphTransferNodeOutputInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 node_id = 1; + * @return The nodeId. + */ + int getNodeId(); + + /** + * repeated int32 max_byte_size = 2; + * @return A list containing the maxByteSize. + */ + java.util.List getMaxByteSizeList(); + /** + * repeated int32 max_byte_size = 2; + * @return The count of maxByteSize. + */ + int getMaxByteSizeCount(); + /** + * repeated int32 max_byte_size = 2; + * @param index The index of the element to return. + * @return The maxByteSize at the given index. + */ + int getMaxByteSize(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Histogram.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Histogram.java new file mode 100644 index 00000000000..5567c346630 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Histogram.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/histogram.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class Histogram { + private Histogram() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Histogram.class.getName()); + } + 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_HistogramProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_HistogramProto_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 xla/tsl/protobuf/histogram.proto\022\ntens" + + "orflow\"\207\001\n\016HistogramProto\022\013\n\003min\030\001 \001(\001\022\013" + + "\n\003max\030\002 \001(\001\022\013\n\003num\030\003 \001(\001\022\013\n\003sum\030\004 \001(\001\022\023\n" + + "\013sum_squares\030\005 \001(\001\022\030\n\014bucket_limit\030\006 \003(\001" + + "B\002\020\001\022\022\n\006bucket\030\007 \003(\001B\002\020\001BX\n\024org.tensorfl" + + "ow.protoP\001Z;github.com/google/tsl/tsl/go" + + "/core/protobuf/summary_go_proto\370\001\001b\006prot" + + "o3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_HistogramProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_HistogramProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_HistogramProto_descriptor, + new java.lang.String[] { "Min", "Max", "Num", "Sum", "SumSquares", "BucketLimit", "Bucket", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProto.java new file mode 100644 index 00000000000..669741c85a8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProto.java @@ -0,0 +1,1152 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/histogram.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Serialization format for histogram module in
    + * tsl/lib/histogram/histogram.h
    + * 
    + * + * Protobuf type {@code tensorflow.HistogramProto} + */ +public final class HistogramProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.HistogramProto) + HistogramProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + HistogramProto.class.getName()); + } + // Use HistogramProto.newBuilder() to construct. + private HistogramProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private HistogramProto() { + bucketLimit_ = emptyDoubleList(); + bucket_ = emptyDoubleList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Histogram.internal_static_tensorflow_HistogramProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Histogram.internal_static_tensorflow_HistogramProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.HistogramProto.class, org.tensorflow.proto.HistogramProto.Builder.class); + } + + public static final int MIN_FIELD_NUMBER = 1; + private double min_ = 0D; + /** + * double min = 1; + * @return The min. + */ + @java.lang.Override + public double getMin() { + return min_; + } + + public static final int MAX_FIELD_NUMBER = 2; + private double max_ = 0D; + /** + * double max = 2; + * @return The max. + */ + @java.lang.Override + public double getMax() { + return max_; + } + + public static final int NUM_FIELD_NUMBER = 3; + private double num_ = 0D; + /** + * double num = 3; + * @return The num. + */ + @java.lang.Override + public double getNum() { + return num_; + } + + public static final int SUM_FIELD_NUMBER = 4; + private double sum_ = 0D; + /** + * double sum = 4; + * @return The sum. + */ + @java.lang.Override + public double getSum() { + return sum_; + } + + public static final int SUM_SQUARES_FIELD_NUMBER = 5; + private double sumSquares_ = 0D; + /** + * double sum_squares = 5; + * @return The sumSquares. + */ + @java.lang.Override + public double getSumSquares() { + return sumSquares_; + } + + public static final int BUCKET_LIMIT_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList bucketLimit_ = + emptyDoubleList(); + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return A list containing the bucketLimit. + */ + @java.lang.Override + public java.util.List + getBucketLimitList() { + return bucketLimit_; + } + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return The count of bucketLimit. + */ + public int getBucketLimitCount() { + return bucketLimit_.size(); + } + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param index The index of the element to return. + * @return The bucketLimit at the given index. + */ + public double getBucketLimit(int index) { + return bucketLimit_.getDouble(index); + } + private int bucketLimitMemoizedSerializedSize = -1; + + public static final int BUCKET_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList bucket_ = + emptyDoubleList(); + /** + * repeated double bucket = 7 [packed = true]; + * @return A list containing the bucket. + */ + @java.lang.Override + public java.util.List + getBucketList() { + return bucket_; + } + /** + * repeated double bucket = 7 [packed = true]; + * @return The count of bucket. + */ + public int getBucketCount() { + return bucket_.size(); + } + /** + * repeated double bucket = 7 [packed = true]; + * @param index The index of the element to return. + * @return The bucket at the given index. + */ + public double getBucket(int index) { + return bucket_.getDouble(index); + } + private int bucketMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (java.lang.Double.doubleToRawLongBits(min_) != 0) { + output.writeDouble(1, min_); + } + if (java.lang.Double.doubleToRawLongBits(max_) != 0) { + output.writeDouble(2, max_); + } + if (java.lang.Double.doubleToRawLongBits(num_) != 0) { + output.writeDouble(3, num_); + } + if (java.lang.Double.doubleToRawLongBits(sum_) != 0) { + output.writeDouble(4, sum_); + } + if (java.lang.Double.doubleToRawLongBits(sumSquares_) != 0) { + output.writeDouble(5, sumSquares_); + } + if (getBucketLimitList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(bucketLimitMemoizedSerializedSize); + } + for (int i = 0; i < bucketLimit_.size(); i++) { + output.writeDoubleNoTag(bucketLimit_.getDouble(i)); + } + if (getBucketList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(bucketMemoizedSerializedSize); + } + for (int i = 0; i < bucket_.size(); i++) { + output.writeDoubleNoTag(bucket_.getDouble(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(min_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, min_); + } + if (java.lang.Double.doubleToRawLongBits(max_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, max_); + } + if (java.lang.Double.doubleToRawLongBits(num_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, num_); + } + if (java.lang.Double.doubleToRawLongBits(sum_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, sum_); + } + if (java.lang.Double.doubleToRawLongBits(sumSquares_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(5, sumSquares_); + } + { + int dataSize = 0; + dataSize = 8 * getBucketLimitList().size(); + size += dataSize; + if (!getBucketLimitList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + bucketLimitMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getBucketList().size(); + size += dataSize; + if (!getBucketList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + bucketMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.HistogramProto)) { + return super.equals(obj); + } + org.tensorflow.proto.HistogramProto other = (org.tensorflow.proto.HistogramProto) obj; + + if (java.lang.Double.doubleToLongBits(getMin()) + != java.lang.Double.doubleToLongBits( + other.getMin())) return false; + if (java.lang.Double.doubleToLongBits(getMax()) + != java.lang.Double.doubleToLongBits( + other.getMax())) return false; + if (java.lang.Double.doubleToLongBits(getNum()) + != java.lang.Double.doubleToLongBits( + other.getNum())) return false; + if (java.lang.Double.doubleToLongBits(getSum()) + != java.lang.Double.doubleToLongBits( + other.getSum())) return false; + if (java.lang.Double.doubleToLongBits(getSumSquares()) + != java.lang.Double.doubleToLongBits( + other.getSumSquares())) return false; + if (!getBucketLimitList() + .equals(other.getBucketLimitList())) return false; + if (!getBucketList() + .equals(other.getBucketList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMin())); + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMax())); + hash = (37 * hash) + NUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getNum())); + hash = (37 * hash) + SUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSum())); + hash = (37 * hash) + SUM_SQUARES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSumSquares())); + if (getBucketLimitCount() > 0) { + hash = (37 * hash) + BUCKET_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getBucketLimitList().hashCode(); + } + if (getBucketCount() > 0) { + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucketList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.HistogramProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.HistogramProto 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.HistogramProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.HistogramProto 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.HistogramProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.HistogramProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.HistogramProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.HistogramProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.HistogramProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.HistogramProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.HistogramProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.HistogramProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.HistogramProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Serialization format for histogram module in
    +   * tsl/lib/histogram/histogram.h
    +   * 
    + * + * Protobuf type {@code tensorflow.HistogramProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.HistogramProto) + org.tensorflow.proto.HistogramProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Histogram.internal_static_tensorflow_HistogramProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Histogram.internal_static_tensorflow_HistogramProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.HistogramProto.class, org.tensorflow.proto.HistogramProto.Builder.class); + } + + // Construct using org.tensorflow.proto.HistogramProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + min_ = 0D; + max_ = 0D; + num_ = 0D; + sum_ = 0D; + sumSquares_ = 0D; + bucketLimit_ = emptyDoubleList(); + bucket_ = emptyDoubleList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Histogram.internal_static_tensorflow_HistogramProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.HistogramProto getDefaultInstanceForType() { + return org.tensorflow.proto.HistogramProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.HistogramProto build() { + org.tensorflow.proto.HistogramProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.HistogramProto buildPartial() { + org.tensorflow.proto.HistogramProto result = new org.tensorflow.proto.HistogramProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.HistogramProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.min_ = min_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.max_ = max_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.num_ = num_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sum_ = sum_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sumSquares_ = sumSquares_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + bucketLimit_.makeImmutable(); + result.bucketLimit_ = bucketLimit_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + bucket_.makeImmutable(); + result.bucket_ = bucket_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.HistogramProto) { + return mergeFrom((org.tensorflow.proto.HistogramProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.HistogramProto other) { + if (other == org.tensorflow.proto.HistogramProto.getDefaultInstance()) return this; + if (other.getMin() != 0D) { + setMin(other.getMin()); + } + if (other.getMax() != 0D) { + setMax(other.getMax()); + } + if (other.getNum() != 0D) { + setNum(other.getNum()); + } + if (other.getSum() != 0D) { + setSum(other.getSum()); + } + if (other.getSumSquares() != 0D) { + setSumSquares(other.getSumSquares()); + } + if (!other.bucketLimit_.isEmpty()) { + if (bucketLimit_.isEmpty()) { + bucketLimit_ = other.bucketLimit_; + bucketLimit_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureBucketLimitIsMutable(); + bucketLimit_.addAll(other.bucketLimit_); + } + onChanged(); + } + if (!other.bucket_.isEmpty()) { + if (bucket_.isEmpty()) { + bucket_ = other.bucket_; + bucket_.makeImmutable(); + bitField0_ |= 0x00000040; + } else { + ensureBucketIsMutable(); + bucket_.addAll(other.bucket_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + min_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 17: { + max_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 25: { + num_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + sum_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 41: { + sumSquares_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 49: { + double v = input.readDouble(); + ensureBucketLimitIsMutable(); + bucketLimit_.addDouble(v); + break; + } // case 49 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureBucketLimitIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + bucketLimit_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 50 + case 57: { + double v = input.readDouble(); + ensureBucketIsMutable(); + bucket_.addDouble(v); + break; + } // case 57 + case 58: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureBucketIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + bucket_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double min_ ; + /** + * double min = 1; + * @return The min. + */ + @java.lang.Override + public double getMin() { + return min_; + } + /** + * double min = 1; + * @param value The min to set. + * @return This builder for chaining. + */ + public Builder setMin(double value) { + + min_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double min = 1; + * @return This builder for chaining. + */ + public Builder clearMin() { + bitField0_ = (bitField0_ & ~0x00000001); + min_ = 0D; + onChanged(); + return this; + } + + private double max_ ; + /** + * double max = 2; + * @return The max. + */ + @java.lang.Override + public double getMax() { + return max_; + } + /** + * double max = 2; + * @param value The max to set. + * @return This builder for chaining. + */ + public Builder setMax(double value) { + + max_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * double max = 2; + * @return This builder for chaining. + */ + public Builder clearMax() { + bitField0_ = (bitField0_ & ~0x00000002); + max_ = 0D; + onChanged(); + return this; + } + + private double num_ ; + /** + * double num = 3; + * @return The num. + */ + @java.lang.Override + public double getNum() { + return num_; + } + /** + * double num = 3; + * @param value The num to set. + * @return This builder for chaining. + */ + public Builder setNum(double value) { + + num_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * double num = 3; + * @return This builder for chaining. + */ + public Builder clearNum() { + bitField0_ = (bitField0_ & ~0x00000004); + num_ = 0D; + onChanged(); + return this; + } + + private double sum_ ; + /** + * double sum = 4; + * @return The sum. + */ + @java.lang.Override + public double getSum() { + return sum_; + } + /** + * double sum = 4; + * @param value The sum to set. + * @return This builder for chaining. + */ + public Builder setSum(double value) { + + sum_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * double sum = 4; + * @return This builder for chaining. + */ + public Builder clearSum() { + bitField0_ = (bitField0_ & ~0x00000008); + sum_ = 0D; + onChanged(); + return this; + } + + private double sumSquares_ ; + /** + * double sum_squares = 5; + * @return The sumSquares. + */ + @java.lang.Override + public double getSumSquares() { + return sumSquares_; + } + /** + * double sum_squares = 5; + * @param value The sumSquares to set. + * @return This builder for chaining. + */ + public Builder setSumSquares(double value) { + + sumSquares_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * double sum_squares = 5; + * @return This builder for chaining. + */ + public Builder clearSumSquares() { + bitField0_ = (bitField0_ & ~0x00000010); + sumSquares_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList bucketLimit_ = emptyDoubleList(); + private void ensureBucketLimitIsMutable() { + if (!bucketLimit_.isModifiable()) { + bucketLimit_ = makeMutableCopy(bucketLimit_); + } + bitField0_ |= 0x00000020; + } + private void ensureBucketLimitIsMutable(int capacity) { + if (!bucketLimit_.isModifiable()) { + bucketLimit_ = makeMutableCopy(bucketLimit_, capacity); + } + bitField0_ |= 0x00000020; + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return A list containing the bucketLimit. + */ + public java.util.List + getBucketLimitList() { + bucketLimit_.makeImmutable(); + return bucketLimit_; + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return The count of bucketLimit. + */ + public int getBucketLimitCount() { + return bucketLimit_.size(); + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param index The index of the element to return. + * @return The bucketLimit at the given index. + */ + public double getBucketLimit(int index) { + return bucketLimit_.getDouble(index); + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param index The index to set the value at. + * @param value The bucketLimit to set. + * @return This builder for chaining. + */ + public Builder setBucketLimit( + int index, double value) { + + ensureBucketLimitIsMutable(); + bucketLimit_.setDouble(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param value The bucketLimit to add. + * @return This builder for chaining. + */ + public Builder addBucketLimit(double value) { + + ensureBucketLimitIsMutable(); + bucketLimit_.addDouble(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param values The bucketLimit to add. + * @return This builder for chaining. + */ + public Builder addAllBucketLimit( + java.lang.Iterable values) { + ensureBucketLimitIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bucketLimit_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Parallel arrays encoding the bucket boundaries and the bucket values.
    +     * bucket(i) is the count for the bucket i.  The range for
    +     * a bucket is:
    +     * i == 0:  -DBL_MAX .. bucket_limit(0)
    +     * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +     * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearBucketLimit() { + bucketLimit_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList bucket_ = emptyDoubleList(); + private void ensureBucketIsMutable() { + if (!bucket_.isModifiable()) { + bucket_ = makeMutableCopy(bucket_); + } + bitField0_ |= 0x00000040; + } + private void ensureBucketIsMutable(int capacity) { + if (!bucket_.isModifiable()) { + bucket_ = makeMutableCopy(bucket_, capacity); + } + bitField0_ |= 0x00000040; + } + /** + * repeated double bucket = 7 [packed = true]; + * @return A list containing the bucket. + */ + public java.util.List + getBucketList() { + bucket_.makeImmutable(); + return bucket_; + } + /** + * repeated double bucket = 7 [packed = true]; + * @return The count of bucket. + */ + public int getBucketCount() { + return bucket_.size(); + } + /** + * repeated double bucket = 7 [packed = true]; + * @param index The index of the element to return. + * @return The bucket at the given index. + */ + public double getBucket(int index) { + return bucket_.getDouble(index); + } + /** + * repeated double bucket = 7 [packed = true]; + * @param index The index to set the value at. + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket( + int index, double value) { + + ensureBucketIsMutable(); + bucket_.setDouble(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * repeated double bucket = 7 [packed = true]; + * @param value The bucket to add. + * @return This builder for chaining. + */ + public Builder addBucket(double value) { + + ensureBucketIsMutable(); + bucket_.addDouble(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * repeated double bucket = 7 [packed = true]; + * @param values The bucket to add. + * @return This builder for chaining. + */ + public Builder addAllBucket( + java.lang.Iterable values) { + ensureBucketIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bucket_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * repeated double bucket = 7 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.HistogramProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.HistogramProto) + private static final org.tensorflow.proto.HistogramProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.HistogramProto(); + } + + public static org.tensorflow.proto.HistogramProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HistogramProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.HistogramProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProtoOrBuilder.java new file mode 100644 index 00000000000..9c644fa0611 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/HistogramProtoOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/histogram.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface HistogramProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.HistogramProto) + com.google.protobuf.MessageOrBuilder { + + /** + * double min = 1; + * @return The min. + */ + double getMin(); + + /** + * double max = 2; + * @return The max. + */ + double getMax(); + + /** + * double num = 3; + * @return The num. + */ + double getNum(); + + /** + * double sum = 4; + * @return The sum. + */ + double getSum(); + + /** + * double sum_squares = 5; + * @return The sumSquares. + */ + double getSumSquares(); + + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return A list containing the bucketLimit. + */ + java.util.List getBucketLimitList(); + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @return The count of bucketLimit. + */ + int getBucketLimitCount(); + /** + *
    +   * Parallel arrays encoding the bucket boundaries and the bucket values.
    +   * bucket(i) is the count for the bucket i.  The range for
    +   * a bucket is:
    +   * i == 0:  -DBL_MAX .. bucket_limit(0)
    +   * i != 0:  bucket_limit(i-1) .. bucket_limit(i)
    +   * 
    + * + * repeated double bucket_limit = 6 [packed = true]; + * @param index The index of the element to return. + * @return The bucketLimit at the given index. + */ + double getBucketLimit(int index); + + /** + * repeated double bucket = 7 [packed = true]; + * @return A list containing the bucket. + */ + java.util.List getBucketList(); + /** + * repeated double bucket = 7 [packed = true]; + * @return The count of bucket. + */ + int getBucketCount(); + /** + * repeated double bucket = 7 [packed = true]; + * @param index The index of the element to return. + * @return The bucket at the given index. + */ + double getBucket(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64List.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64List.java new file mode 100644 index 00000000000..82bf09b381d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64List.java @@ -0,0 +1,540 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.Int64List} + */ +public final class Int64List extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Int64List) + Int64ListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Int64List.class.getName()); + } + // Use Int64List.newBuilder() to construct. + private Int64List(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Int64List() { + value_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Int64List_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Int64List.class, org.tensorflow.proto.Int64List.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList value_ = + emptyLongList(); + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public long getValue(int index) { + return value_.getLong(index); + } + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeInt64NoTag(value_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(value_.getLong(i)); + } + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.Int64List)) { + return super.equals(obj); + } + org.tensorflow.proto.Int64List other = (org.tensorflow.proto.Int64List) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Int64List parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Int64List 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.Int64List parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Int64List 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.Int64List parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Int64List parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Int64List parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Int64List parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Int64List parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Int64List parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Int64List parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Int64List parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Int64List 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.Int64List} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Int64List) + org.tensorflow.proto.Int64ListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Int64List_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Int64List.class, org.tensorflow.proto.Int64List.Builder.class); + } + + // Construct using org.tensorflow.proto.Int64List.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FeatureProtos.internal_static_tensorflow_Int64List_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Int64List getDefaultInstanceForType() { + return org.tensorflow.proto.Int64List.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Int64List build() { + org.tensorflow.proto.Int64List result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Int64List buildPartial() { + org.tensorflow.proto.Int64List result = new org.tensorflow.proto.Int64List(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Int64List result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Int64List) { + return mergeFrom((org.tensorflow.proto.Int64List)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Int64List other) { + if (other == org.tensorflow.proto.Int64List.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readInt64(); + ensureValueIsMutable(); + value_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValueIsMutable(); + while (input.getBytesUntilLimit() > 0) { + value_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList value_ = emptyLongList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return A list containing the value. + */ + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public long getValue(int index) { + return value_.getLong(index); + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, long value) { + + ensureValueIsMutable(); + value_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue(long value) { + + ensureValueIsMutable(); + value_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Int64List) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Int64List) + private static final org.tensorflow.proto.Int64List DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Int64List(); + } + + public static org.tensorflow.proto.Int64List getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64List parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Int64List getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64ListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64ListOrBuilder.java new file mode 100644 index 00000000000..e1d8271d30d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Int64ListOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/feature.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface Int64ListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.Int64List) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated int64 value = 1 [packed = true, jstype = JS_STRING]; + * @param index The index of the element to return. + * @return The value at the given index. + */ + long getValue(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLink.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLink.java new file mode 100644 index 00000000000..e544fdbcd0e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLink.java @@ -0,0 +1,633 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.InterconnectLink} + */ +public final class InterconnectLink extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.InterconnectLink) + InterconnectLinkOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + InterconnectLink.class.getName()); + } + // Use InterconnectLink.newBuilder() to construct. + private InterconnectLink(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private InterconnectLink() { + type_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.InterconnectLink.class, org.tensorflow.proto.InterconnectLink.Builder.class); + } + + public static final int DEVICE_ID_FIELD_NUMBER = 1; + private int deviceId_ = 0; + /** + * int32 device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public int getDeviceId() { + return deviceId_; + } + + public static final int TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + * string type = 2; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * string type = 2; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STRENGTH_FIELD_NUMBER = 3; + private int strength_ = 0; + /** + * int32 strength = 3; + * @return The strength. + */ + @java.lang.Override + public int getStrength() { + return strength_; + } + + 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.writeInt32(1, deviceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + if (strength_ != 0) { + output.writeInt32(3, strength_); + } + getUnknownFields().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 + .computeInt32Size(1, deviceId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + if (strength_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, strength_); + } + size += getUnknownFields().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.InterconnectLink)) { + return super.equals(obj); + } + org.tensorflow.proto.InterconnectLink other = (org.tensorflow.proto.InterconnectLink) obj; + + if (getDeviceId() + != other.getDeviceId()) return false; + if (!getType() + .equals(other.getType())) return false; + if (getStrength() + != other.getStrength()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + STRENGTH_FIELD_NUMBER; + hash = (53 * hash) + getStrength(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.InterconnectLink parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.InterconnectLink 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.InterconnectLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.InterconnectLink 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.InterconnectLink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.InterconnectLink parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.InterconnectLink parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.InterconnectLink parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.InterconnectLink parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.InterconnectLink parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.InterconnectLink parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.InterconnectLink parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.InterconnectLink 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.InterconnectLink} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.InterconnectLink) + org.tensorflow.proto.InterconnectLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.InterconnectLink.class, org.tensorflow.proto.InterconnectLink.Builder.class); + } + + // Construct using org.tensorflow.proto.InterconnectLink.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deviceId_ = 0; + type_ = ""; + strength_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_InterconnectLink_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.InterconnectLink getDefaultInstanceForType() { + return org.tensorflow.proto.InterconnectLink.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.InterconnectLink build() { + org.tensorflow.proto.InterconnectLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.InterconnectLink buildPartial() { + org.tensorflow.proto.InterconnectLink result = new org.tensorflow.proto.InterconnectLink(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.InterconnectLink result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deviceId_ = deviceId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.strength_ = strength_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.InterconnectLink) { + return mergeFrom((org.tensorflow.proto.InterconnectLink)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.InterconnectLink other) { + if (other == org.tensorflow.proto.InterconnectLink.getDefaultInstance()) return this; + if (other.getDeviceId() != 0) { + setDeviceId(other.getDeviceId()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getStrength() != 0) { + setStrength(other.getStrength()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + deviceId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + strength_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int deviceId_ ; + /** + * int32 device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public int getDeviceId() { + return deviceId_; + } + /** + * int32 device_id = 1; + * @param value The deviceId to set. + * @return This builder for chaining. + */ + public Builder setDeviceId(int value) { + + deviceId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 device_id = 1; + * @return This builder for chaining. + */ + public Builder clearDeviceId() { + bitField0_ = (bitField0_ & ~0x00000001); + deviceId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * string type = 2; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string type = 2; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string type = 2; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int strength_ ; + /** + * int32 strength = 3; + * @return The strength. + */ + @java.lang.Override + public int getStrength() { + return strength_; + } + /** + * int32 strength = 3; + * @param value The strength to set. + * @return This builder for chaining. + */ + public Builder setStrength(int value) { + + strength_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 strength = 3; + * @return This builder for chaining. + */ + public Builder clearStrength() { + bitField0_ = (bitField0_ & ~0x00000004); + strength_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.InterconnectLink) + } + + // @@protoc_insertion_point(class_scope:tensorflow.InterconnectLink) + private static final org.tensorflow.proto.InterconnectLink DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.InterconnectLink(); + } + + public static org.tensorflow.proto.InterconnectLink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InterconnectLink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.InterconnectLink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLinkOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLinkOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLinkOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLinkOrBuilder.java index 61316cfa8cc..fa3786c27ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/InterconnectLinkOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/InterconnectLinkOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface InterconnectLinkOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.InterconnectLink) @@ -9,21 +11,25 @@ public interface InterconnectLinkOrBuilder extends /** * int32 device_id = 1; + * @return The deviceId. */ int getDeviceId(); /** * string type = 2; + * @return The type. */ java.lang.String getType(); /** * string type = 2; + * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); /** * int32 strength = 3; + * @return The strength. */ int getStrength(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDef.java new file mode 100644 index 00000000000..0e6e8660937 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDef.java @@ -0,0 +1,937 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/cluster.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines a single job in a TensorFlow cluster.
    + * 
    + * + * Protobuf type {@code tensorflow.JobDef} + */ +public final class JobDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.JobDef) + JobDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + JobDef.class.getName()); + } + // Use JobDef.newBuilder() to construct. + private JobDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private JobDef() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.JobDef.class, org.tensorflow.proto.JobDef.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * The name of this job.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 job.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 TASKS_FIELD_NUMBER = 2; + private static final class TasksDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_TasksEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.String> tasks_; + private com.google.protobuf.MapField + internalGetTasks() { + if (tasks_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TasksDefaultEntryHolder.defaultEntry); + } + return tasks_; + } + public int getTasksCount() { + return internalGetTasks().getMap().size(); + } + /** + *
    +   * Mapping from task ID to "hostname:port" string.
    +   *
    +   * If the `name` field contains "worker", and the `tasks` map contains a
    +   * mapping from 7 to "example.org:2222", then the device prefix
    +   * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
    +   * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public boolean containsTasks( + int key) { + + return internalGetTasks().getMap().containsKey(key); + } + /** + * Use {@link #getTasksMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTasks() { + return getTasksMap(); + } + /** + *
    +   * Mapping from task ID to "hostname:port" string.
    +   *
    +   * If the `name` field contains "worker", and the `tasks` map contains a
    +   * mapping from 7 to "example.org:2222", then the device prefix
    +   * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
    +   * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public java.util.Map getTasksMap() { + return internalGetTasks().getMap(); + } + /** + *
    +   * Mapping from task ID to "hostname:port" string.
    +   *
    +   * If the `name` field contains "worker", and the `tasks` map contains a
    +   * mapping from 7 to "example.org:2222", then the device prefix
    +   * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
    +   * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getTasksOrDefault( + int key, + /* nullable */ +java.lang.String defaultValue) { + + java.util.Map map = + internalGetTasks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Mapping from task ID to "hostname:port" string.
    +   *
    +   * If the `name` field contains "worker", and the `tasks` map contains a
    +   * mapping from 7 to "example.org:2222", then the device prefix
    +   * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
    +   * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public java.lang.String getTasksOrThrow( + int key) { + + java.util.Map map = + internalGetTasks().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessage + .serializeIntegerMapTo( + output, + internalGetTasks(), + TasksDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry + : internalGetTasks().getMap().entrySet()) { + com.google.protobuf.MapEntry + tasks__ = TasksDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, tasks__); + } + size += getUnknownFields().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.JobDef)) { + return super.equals(obj); + } + org.tensorflow.proto.JobDef other = (org.tensorflow.proto.JobDef) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!internalGetTasks().equals( + other.internalGetTasks())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (!internalGetTasks().getMap().isEmpty()) { + hash = (37 * hash) + TASKS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTasks().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.JobDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDef 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.JobDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDef 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.JobDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.JobDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.JobDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.JobDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.JobDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.JobDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.JobDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.JobDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines a single job in a TensorFlow cluster.
    +   * 
    + * + * Protobuf type {@code tensorflow.JobDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.JobDef) + org.tensorflow.proto.JobDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.JobDef.class, org.tensorflow.proto.JobDef.Builder.class); + } + + // Construct using org.tensorflow.proto.JobDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableTasks().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ClusterProtos.internal_static_tensorflow_JobDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.JobDef getDefaultInstanceForType() { + return org.tensorflow.proto.JobDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.JobDef build() { + org.tensorflow.proto.JobDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.JobDef buildPartial() { + org.tensorflow.proto.JobDef result = new org.tensorflow.proto.JobDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.JobDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tasks_ = internalGetTasks(); + result.tasks_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.JobDef) { + return mergeFrom((org.tensorflow.proto.JobDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.JobDef other) { + if (other == org.tensorflow.proto.JobDef.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableTasks().mergeFrom( + other.internalGetTasks()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + tasks__ = input.readMessage( + TasksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTasks().getMutableMap().put( + tasks__.getKey(), tasks__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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 job.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 job.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.String> tasks_; + private com.google.protobuf.MapField + internalGetTasks() { + if (tasks_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TasksDefaultEntryHolder.defaultEntry); + } + return tasks_; + } + private com.google.protobuf.MapField + internalGetMutableTasks() { + if (tasks_ == null) { + tasks_ = com.google.protobuf.MapField.newMapField( + TasksDefaultEntryHolder.defaultEntry); + } + if (!tasks_.isMutable()) { + tasks_ = tasks_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return tasks_; + } + public int getTasksCount() { + return internalGetTasks().getMap().size(); + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public boolean containsTasks( + int key) { + + return internalGetTasks().getMap().containsKey(key); + } + /** + * Use {@link #getTasksMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTasks() { + return getTasksMap(); + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public java.util.Map getTasksMap() { + return internalGetTasks().getMap(); + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getTasksOrDefault( + int key, + /* nullable */ +java.lang.String defaultValue) { + + java.util.Map map = + internalGetTasks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + @java.lang.Override + public java.lang.String getTasksOrThrow( + int key) { + + java.util.Map map = + internalGetTasks().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearTasks() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableTasks().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + public Builder removeTasks( + int key) { + + internalGetMutableTasks().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTasks() { + bitField0_ |= 0x00000002; + return internalGetMutableTasks().getMutableMap(); + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + public Builder putTasks( + int key, + java.lang.String value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableTasks().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Mapping from task ID to "hostname:port" string.
    +     *
    +     * If the `name` field contains "worker", and the `tasks` map contains a
    +     * mapping from 7 to "example.org:2222", then the device prefix
    +     * "/job:worker/task:7" will be assigned to "example.org:2222".
    +     *
    +     * If a job has multiple replicas, host-ports will be comma-delimited, with
    +     * one entry for each replica.
    +     * 
    + * + * map<int32, string> tasks = 2; + */ + public Builder putAllTasks( + java.util.Map values) { + internalGetMutableTasks().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.JobDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.JobDef) + private static final org.tensorflow.proto.JobDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.JobDef(); + } + + public static org.tensorflow.proto.JobDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.JobDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDefOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDefOrBuilder.java index a9c24b98a74..3de76e91c40 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/cluster.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.distruntime; +package org.tensorflow.proto; public interface JobDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.JobDef) @@ -13,6 +15,7 @@ public interface JobDefOrBuilder extends *
    * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -21,6 +24,7 @@ public interface JobDefOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -28,9 +32,13 @@ public interface JobDefOrBuilder extends /** *
        * Mapping from task ID to "hostname:port" string.
    +   *
        * If the `name` field contains "worker", and the `tasks` map contains a
        * mapping from 7 to "example.org:2222", then the device prefix
        * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
        * 
    * * map<int32, string> tasks = 2; @@ -39,9 +47,13 @@ public interface JobDefOrBuilder extends /** *
        * Mapping from task ID to "hostname:port" string.
    +   *
        * If the `name` field contains "worker", and the `tasks` map contains a
        * mapping from 7 to "example.org:2222", then the device prefix
        * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
        * 
    * * map<int32, string> tasks = 2; @@ -57,9 +69,13 @@ boolean containsTasks( /** *
        * Mapping from task ID to "hostname:port" string.
    +   *
        * If the `name` field contains "worker", and the `tasks` map contains a
        * mapping from 7 to "example.org:2222", then the device prefix
        * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
        * 
    * * map<int32, string> tasks = 2; @@ -69,28 +85,36 @@ boolean containsTasks( /** *
        * Mapping from task ID to "hostname:port" string.
    +   *
        * If the `name` field contains "worker", and the `tasks` map contains a
        * mapping from 7 to "example.org:2222", then the device prefix
        * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
        * 
    * * map<int32, string> tasks = 2; */ - - java.lang.String getTasksOrDefault( + /* nullable */ +java.lang.String getTasksOrDefault( int key, - java.lang.String defaultValue); + /* nullable */ +java.lang.String defaultValue); /** *
        * Mapping from task ID to "hostname:port" string.
    +   *
        * If the `name` field contains "worker", and the `tasks` map contains a
        * mapping from 7 to "example.org:2222", then the device prefix
        * "/job:worker/task:7" will be assigned to "example.org:2222".
    +   *
    +   * If a job has multiple replicas, host-ports will be comma-delimited, with
    +   * one entry for each replica.
        * 
    * * map<int32, string> tasks = 2; */ - java.lang.String getTasksOrThrow( int key); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFilters.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFilters.java new file mode 100644 index 00000000000..cbddbbfd0d0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFilters.java @@ -0,0 +1,891 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines the device filters for tasks in a job.
    + * 
    + * + * Protobuf type {@code tensorflow.JobDeviceFilters} + */ +public final class JobDeviceFilters extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.JobDeviceFilters) + JobDeviceFiltersOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + JobDeviceFilters.class.getName()); + } + // Use JobDeviceFilters.newBuilder() to construct. + private JobDeviceFilters(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private JobDeviceFilters() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.JobDeviceFilters.class, org.tensorflow.proto.JobDeviceFilters.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * The name of this job.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 job.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 TASKS_FIELD_NUMBER = 2; + private static final class TasksDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, org.tensorflow.proto.TaskDeviceFilters> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_TasksEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.TaskDeviceFilters.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, org.tensorflow.proto.TaskDeviceFilters> tasks_; + private com.google.protobuf.MapField + internalGetTasks() { + if (tasks_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TasksDefaultEntryHolder.defaultEntry); + } + return tasks_; + } + public int getTasksCount() { + return internalGetTasks().getMap().size(); + } + /** + *
    +   * Mapping from task ID to task device filters.
    +   * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public boolean containsTasks( + int key) { + + return internalGetTasks().getMap().containsKey(key); + } + /** + * Use {@link #getTasksMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTasks() { + return getTasksMap(); + } + /** + *
    +   * Mapping from task ID to task device filters.
    +   * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public java.util.Map getTasksMap() { + return internalGetTasks().getMap(); + } + /** + *
    +   * Mapping from task ID to task device filters.
    +   * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TaskDeviceFilters getTasksOrDefault( + int key, + /* nullable */ +org.tensorflow.proto.TaskDeviceFilters defaultValue) { + + java.util.Map map = + internalGetTasks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Mapping from task ID to task device filters.
    +   * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters getTasksOrThrow( + int key) { + + java.util.Map map = + internalGetTasks().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessage + .serializeIntegerMapTo( + output, + internalGetTasks(), + TasksDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry + : internalGetTasks().getMap().entrySet()) { + com.google.protobuf.MapEntry + tasks__ = TasksDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, tasks__); + } + size += getUnknownFields().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.JobDeviceFilters)) { + return super.equals(obj); + } + org.tensorflow.proto.JobDeviceFilters other = (org.tensorflow.proto.JobDeviceFilters) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!internalGetTasks().equals( + other.internalGetTasks())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (!internalGetTasks().getMap().isEmpty()) { + hash = (37 * hash) + TASKS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTasks().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.JobDeviceFilters parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDeviceFilters 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.JobDeviceFilters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDeviceFilters 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.JobDeviceFilters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.JobDeviceFilters parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.JobDeviceFilters parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.JobDeviceFilters parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.JobDeviceFilters parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.JobDeviceFilters parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.JobDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.JobDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.JobDeviceFilters 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines the device filters for tasks in a job.
    +   * 
    + * + * Protobuf type {@code tensorflow.JobDeviceFilters} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.JobDeviceFilters) + org.tensorflow.proto.JobDeviceFiltersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableTasks(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.JobDeviceFilters.class, org.tensorflow.proto.JobDeviceFilters.Builder.class); + } + + // Construct using org.tensorflow.proto.JobDeviceFilters.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableTasks().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_JobDeviceFilters_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.JobDeviceFilters getDefaultInstanceForType() { + return org.tensorflow.proto.JobDeviceFilters.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.JobDeviceFilters build() { + org.tensorflow.proto.JobDeviceFilters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.JobDeviceFilters buildPartial() { + org.tensorflow.proto.JobDeviceFilters result = new org.tensorflow.proto.JobDeviceFilters(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.JobDeviceFilters result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tasks_ = internalGetTasks().build(TasksDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.JobDeviceFilters) { + return mergeFrom((org.tensorflow.proto.JobDeviceFilters)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.JobDeviceFilters other) { + if (other == org.tensorflow.proto.JobDeviceFilters.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableTasks().mergeFrom( + other.internalGetTasks()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + tasks__ = input.readMessage( + TasksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTasks().ensureBuilderMap().put( + tasks__.getKey(), tasks__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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 job.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 job.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The name of this job.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class TasksConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters build(org.tensorflow.proto.TaskDeviceFiltersOrBuilder val) { + if (val instanceof org.tensorflow.proto.TaskDeviceFilters) { return (org.tensorflow.proto.TaskDeviceFilters) val; } + return ((org.tensorflow.proto.TaskDeviceFilters.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return TasksDefaultEntryHolder.defaultEntry; + } + }; + private static final TasksConverter tasksConverter = new TasksConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Integer, org.tensorflow.proto.TaskDeviceFiltersOrBuilder, org.tensorflow.proto.TaskDeviceFilters, org.tensorflow.proto.TaskDeviceFilters.Builder> tasks_; + private com.google.protobuf.MapFieldBuilder + internalGetTasks() { + if (tasks_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(tasksConverter); + } + return tasks_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableTasks() { + if (tasks_ == null) { + tasks_ = new com.google.protobuf.MapFieldBuilder<>(tasksConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return tasks_; + } + public int getTasksCount() { + return internalGetTasks().ensureBuilderMap().size(); + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public boolean containsTasks( + int key) { + + return internalGetTasks().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getTasksMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTasks() { + return getTasksMap(); + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public java.util.Map getTasksMap() { + return internalGetTasks().getImmutableMap(); + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TaskDeviceFilters getTasksOrDefault( + int key, + /* nullable */ +org.tensorflow.proto.TaskDeviceFilters defaultValue) { + + java.util.Map map = internalGetMutableTasks().ensureBuilderMap(); + return map.containsKey(key) ? tasksConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters getTasksOrThrow( + int key) { + + java.util.Map map = internalGetMutableTasks().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return tasksConverter.build(map.get(key)); + } + public Builder clearTasks() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableTasks().clear(); + return this; + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + public Builder removeTasks( + int key) { + + internalGetMutableTasks().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTasks() { + bitField0_ |= 0x00000002; + return internalGetMutableTasks().ensureMessageMap(); + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + public Builder putTasks( + int key, + org.tensorflow.proto.TaskDeviceFilters value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableTasks().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + public Builder putAllTasks( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableTasks().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Mapping from task ID to task device filters.
    +     * 
    + * + * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2; + */ + public org.tensorflow.proto.TaskDeviceFilters.Builder putTasksBuilderIfAbsent( + int key) { + java.util.Map builderMap = internalGetMutableTasks().ensureBuilderMap(); + org.tensorflow.proto.TaskDeviceFiltersOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.TaskDeviceFilters.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.TaskDeviceFilters) { + entry = ((org.tensorflow.proto.TaskDeviceFilters) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.TaskDeviceFilters.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.JobDeviceFilters) + } + + // @@protoc_insertion_point(class_scope:tensorflow.JobDeviceFilters) + private static final org.tensorflow.proto.JobDeviceFilters DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.JobDeviceFilters(); + } + + public static org.tensorflow.proto.JobDeviceFilters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public JobDeviceFilters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.JobDeviceFilters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFiltersOrBuilder.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFiltersOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFiltersOrBuilder.java index 92c3ba82935..3988b3ef971 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/JobDeviceFiltersOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/JobDeviceFiltersOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.distruntime; +package org.tensorflow.proto; public interface JobDeviceFiltersOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.JobDeviceFilters) @@ -13,6 +15,7 @@ public interface JobDeviceFiltersOrBuilder extends * * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -21,6 +24,7 @@ public interface JobDeviceFiltersOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -46,7 +50,7 @@ boolean containsTasks( * Use {@link #getTasksMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getTasks(); /** *
    @@ -55,7 +59,7 @@ boolean containsTasks(
        *
        * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2;
        */
    -  java.util.Map
    +  java.util.Map
       getTasksMap();
       /**
        * 
    @@ -64,10 +68,11 @@ boolean containsTasks(
        *
        * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2;
        */
    -
    -  org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.TaskDeviceFilters getTasksOrDefault(
           int key,
    -      org.tensorflow.proto.distruntime.TaskDeviceFilters defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.TaskDeviceFilters defaultValue);
       /**
        * 
        * Mapping from task ID to task device filters.
    @@ -75,7 +80,6 @@ org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrDefault(
        *
        * map<int32, .tensorflow.TaskDeviceFilters> tasks = 2;
        */
    -
    -  org.tensorflow.proto.distruntime.TaskDeviceFilters getTasksOrThrow(
    +  org.tensorflow.proto.TaskDeviceFilters getTasksOrThrow(
           int key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDef.java
    new file mode 100644
    index 00000000000..8efe1c1e228
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDef.java
    @@ -0,0 +1,2398 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/kernel_def.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.KernelDef}
    + */
    +public final class KernelDef extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.KernelDef)
    +    KernelDefOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      KernelDef.class.getName());
    +  }
    +  // Use KernelDef.newBuilder() to construct.
    +  private KernelDef(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private KernelDef() {
    +    op_ = "";
    +    deviceType_ = "";
    +    constraint_ = java.util.Collections.emptyList();
    +    hostMemoryArg_ =
    +        com.google.protobuf.LazyStringArrayList.emptyList();
    +    label_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.KernelDef.class, org.tensorflow.proto.KernelDef.Builder.class);
    +  }
    +
    +  public interface AttrConstraintOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.KernelDef.AttrConstraint)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * 
    +     * Name of an attr from the Op.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of an attr from the Op.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return Whether the allowedValues field is set. + */ + boolean hasAllowedValues(); + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return The allowedValues. + */ + org.tensorflow.proto.AttrValue getAllowedValues(); + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.KernelDef.AttrConstraint} + */ + public static final class AttrConstraint extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.KernelDef.AttrConstraint) + AttrConstraintOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AttrConstraint.class.getName()); + } + // Use AttrConstraint.newBuilder() to construct. + private AttrConstraint(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AttrConstraint() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.KernelDef.AttrConstraint.class, org.tensorflow.proto.KernelDef.AttrConstraint.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of an attr from the Op.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of an attr from the Op.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 ALLOWED_VALUES_FIELD_NUMBER = 2; + private org.tensorflow.proto.AttrValue allowedValues_; + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return Whether the allowedValues field is set. + */ + @java.lang.Override + public boolean hasAllowedValues() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return The allowedValues. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAllowedValues() { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + /** + *
    +     * A list of values that this kernel supports for this attr.
    +     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder() { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAllowedValues()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAllowedValues()); + } + size += getUnknownFields().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.KernelDef.AttrConstraint)) { + return super.equals(obj); + } + org.tensorflow.proto.KernelDef.AttrConstraint other = (org.tensorflow.proto.KernelDef.AttrConstraint) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasAllowedValues() != other.hasAllowedValues()) return false; + if (hasAllowedValues()) { + if (!getAllowedValues() + .equals(other.getAllowedValues())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasAllowedValues()) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValues().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint 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.KernelDef.AttrConstraint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.KernelDef.AttrConstraint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.KernelDef.AttrConstraint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelDef.AttrConstraint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.KernelDef.AttrConstraint 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.KernelDef.AttrConstraint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef.AttrConstraint) + org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.KernelDef.AttrConstraint.class, org.tensorflow.proto.KernelDef.AttrConstraint.Builder.class); + } + + // Construct using org.tensorflow.proto.KernelDef.AttrConstraint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getAllowedValuesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + allowedValues_ = null; + if (allowedValuesBuilder_ != null) { + allowedValuesBuilder_.dispose(); + allowedValuesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef.AttrConstraint getDefaultInstanceForType() { + return org.tensorflow.proto.KernelDef.AttrConstraint.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef.AttrConstraint build() { + org.tensorflow.proto.KernelDef.AttrConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef.AttrConstraint buildPartial() { + org.tensorflow.proto.KernelDef.AttrConstraint result = new org.tensorflow.proto.KernelDef.AttrConstraint(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.KernelDef.AttrConstraint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowedValues_ = allowedValuesBuilder_ == null + ? allowedValues_ + : allowedValuesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.KernelDef.AttrConstraint) { + return mergeFrom((org.tensorflow.proto.KernelDef.AttrConstraint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.KernelDef.AttrConstraint other) { + if (other == org.tensorflow.proto.KernelDef.AttrConstraint.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAllowedValues()) { + mergeAllowedValues(other.getAllowedValues()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getAllowedValuesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of an attr from the Op.
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of an attr from the Op.
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of an attr from the Op.
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Name of an attr from the Op.
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Name of an attr from the Op.
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.AttrValue allowedValues_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> allowedValuesBuilder_; + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return Whether the allowedValues field is set. + */ + public boolean hasAllowedValues() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + * @return The allowedValues. + */ + public org.tensorflow.proto.AttrValue getAllowedValues() { + if (allowedValuesBuilder_ == null) { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } else { + return allowedValuesBuilder_.getMessage(); + } + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public Builder setAllowedValues(org.tensorflow.proto.AttrValue value) { + if (allowedValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allowedValues_ = value; + } else { + allowedValuesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public Builder setAllowedValues( + org.tensorflow.proto.AttrValue.Builder builderForValue) { + if (allowedValuesBuilder_ == null) { + allowedValues_ = builderForValue.build(); + } else { + allowedValuesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public Builder mergeAllowedValues(org.tensorflow.proto.AttrValue value) { + if (allowedValuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + allowedValues_ != null && + allowedValues_ != org.tensorflow.proto.AttrValue.getDefaultInstance()) { + getAllowedValuesBuilder().mergeFrom(value); + } else { + allowedValues_ = value; + } + } else { + allowedValuesBuilder_.mergeFrom(value); + } + if (allowedValues_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public Builder clearAllowedValues() { + bitField0_ = (bitField0_ & ~0x00000002); + allowedValues_ = null; + if (allowedValuesBuilder_ != null) { + allowedValuesBuilder_.dispose(); + allowedValuesBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public org.tensorflow.proto.AttrValue.Builder getAllowedValuesBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAllowedValuesFieldBuilder().getBuilder(); + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + public org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder() { + if (allowedValuesBuilder_ != null) { + return allowedValuesBuilder_.getMessageOrBuilder(); + } else { + return allowedValues_ == null ? + org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + } + /** + *
    +       * A list of values that this kernel supports for this attr.
    +       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> + getAllowedValuesFieldBuilder() { + if (allowedValuesBuilder_ == null) { + allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder>( + getAllowedValues(), + getParentForChildren(), + isClean()); + allowedValues_ = null; + } + return allowedValuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.KernelDef.AttrConstraint) + } + + // @@protoc_insertion_point(class_scope:tensorflow.KernelDef.AttrConstraint) + private static final org.tensorflow.proto.KernelDef.AttrConstraint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.KernelDef.AttrConstraint(); + } + + public static org.tensorflow.proto.KernelDef.AttrConstraint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttrConstraint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.KernelDef.AttrConstraint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int OP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object op_ = ""; + /** + *
    +   * Must match the name of an Op.
    +   * 
    + * + * string op = 1; + * @return The op. + */ + @java.lang.Override + public java.lang.String getOp() { + java.lang.Object ref = op_; + 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(); + op_ = s; + return s; + } + } + /** + *
    +   * Must match the name of an Op.
    +   * 
    + * + * string op = 1; + * @return The bytes for op. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object deviceType_ = ""; + /** + *
    +   * Type of device this kernel runs on.
    +   * 
    + * + * string device_type = 2; + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + *
    +   * Type of device this kernel runs on.
    +   * 
    + * + * string device_type = 2; + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSTRAINT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List constraint_; + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + @java.lang.Override + public java.util.List getConstraintList() { + return constraint_; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + @java.lang.Override + public java.util.List + getConstraintOrBuilderList() { + return constraint_; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + @java.lang.Override + public int getConstraintCount() { + return constraint_.size(); + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + @java.lang.Override + public org.tensorflow.proto.KernelDef.AttrConstraint getConstraint(int index) { + return constraint_.get(index); + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + @java.lang.Override + public org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( + int index) { + return constraint_.get(index); + } + + public static final int HOST_MEMORY_ARG_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList hostMemoryArg_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Names of the Op's input_/output_args that reside in host memory
    +   * instead of device memory.
    +   * 
    + * + * repeated string host_memory_arg = 4; + * @return A list containing the hostMemoryArg. + */ + public com.google.protobuf.ProtocolStringList + getHostMemoryArgList() { + return hostMemoryArg_; + } + /** + *
    +   * Names of the Op's input_/output_args that reside in host memory
    +   * instead of device memory.
    +   * 
    + * + * repeated string host_memory_arg = 4; + * @return The count of hostMemoryArg. + */ + public int getHostMemoryArgCount() { + return hostMemoryArg_.size(); + } + /** + *
    +   * Names of the Op's input_/output_args that reside in host memory
    +   * instead of device memory.
    +   * 
    + * + * repeated string host_memory_arg = 4; + * @param index The index of the element to return. + * @return The hostMemoryArg at the given index. + */ + public java.lang.String getHostMemoryArg(int index) { + return hostMemoryArg_.get(index); + } + /** + *
    +   * Names of the Op's input_/output_args that reside in host memory
    +   * instead of device memory.
    +   * 
    + * + * repeated string host_memory_arg = 4; + * @param index The index of the value to return. + * @return The bytes of the hostMemoryArg at the given index. + */ + public com.google.protobuf.ByteString + getHostMemoryArgBytes(int index) { + return hostMemoryArg_.getByteString(index); + } + + public static final int LABEL_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object label_ = ""; + /** + *
    +   * This allows experimental kernels to be registered for an op that
    +   * won't be used unless the user specifies a "_kernel" attr with
    +   * value matching this.
    +   * 
    + * + * string label = 5; + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
    +   * This allows experimental kernels to be registered for an op that
    +   * won't be used unless the user specifies a "_kernel" attr with
    +   * value matching this.
    +   * 
    + * + * string label = 5; + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIORITY_FIELD_NUMBER = 6; + private int priority_ = 0; + /** + *
    +   * Prioritization of kernel amongst different devices. By default we assume
    +   * priority is 0. The higher the priority the better. By default (i.e. if
    +   * this is not set), we prefer GPU kernels over CPU.
    +   * 
    + * + * int32 priority = 6; + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, op_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, deviceType_); + } + for (int i = 0; i < constraint_.size(); i++) { + output.writeMessage(3, constraint_.get(i)); + } + for (int i = 0; i < hostMemoryArg_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, hostMemoryArg_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(label_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, label_); + } + if (priority_ != 0) { + output.writeInt32(6, priority_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, op_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, deviceType_); + } + for (int i = 0; i < constraint_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, constraint_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < hostMemoryArg_.size(); i++) { + dataSize += computeStringSizeNoTag(hostMemoryArg_.getRaw(i)); + } + size += dataSize; + size += 1 * getHostMemoryArgList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(label_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, label_); + } + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, priority_); + } + size += getUnknownFields().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.KernelDef)) { + return super.equals(obj); + } + org.tensorflow.proto.KernelDef other = (org.tensorflow.proto.KernelDef) obj; + + if (!getOp() + .equals(other.getOp())) return false; + if (!getDeviceType() + .equals(other.getDeviceType())) return false; + if (!getConstraintList() + .equals(other.getConstraintList())) return false; + if (!getHostMemoryArgList() + .equals(other.getHostMemoryArgList())) return false; + if (!getLabel() + .equals(other.getLabel())) return false; + if (getPriority() + != other.getPriority()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOp().hashCode(); + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + if (getConstraintCount() > 0) { + hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getConstraintList().hashCode(); + } + if (getHostMemoryArgCount() > 0) { + hash = (37 * hash) + HOST_MEMORY_ARG_FIELD_NUMBER; + hash = (53 * hash) + getHostMemoryArgList().hashCode(); + } + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.KernelDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef 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.KernelDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef 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.KernelDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.KernelDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.KernelDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.KernelDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.KernelDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.KernelDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.KernelDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef) + org.tensorflow.proto.KernelDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.KernelDef.class, org.tensorflow.proto.KernelDef.Builder.class); + } + + // Construct using org.tensorflow.proto.KernelDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + op_ = ""; + deviceType_ = ""; + if (constraintBuilder_ == null) { + constraint_ = java.util.Collections.emptyList(); + } else { + constraint_ = null; + constraintBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + hostMemoryArg_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + label_ = ""; + priority_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef getDefaultInstanceForType() { + return org.tensorflow.proto.KernelDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef build() { + org.tensorflow.proto.KernelDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.KernelDef buildPartial() { + org.tensorflow.proto.KernelDef result = new org.tensorflow.proto.KernelDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.KernelDef result) { + if (constraintBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + constraint_ = java.util.Collections.unmodifiableList(constraint_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.constraint_ = constraint_; + } else { + result.constraint_ = constraintBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.KernelDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.op_ = op_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deviceType_ = deviceType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + hostMemoryArg_.makeImmutable(); + result.hostMemoryArg_ = hostMemoryArg_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.label_ = label_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.priority_ = priority_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.KernelDef) { + return mergeFrom((org.tensorflow.proto.KernelDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.KernelDef other) { + if (other == org.tensorflow.proto.KernelDef.getDefaultInstance()) return this; + if (!other.getOp().isEmpty()) { + op_ = other.op_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (constraintBuilder_ == null) { + if (!other.constraint_.isEmpty()) { + if (constraint_.isEmpty()) { + constraint_ = other.constraint_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConstraintIsMutable(); + constraint_.addAll(other.constraint_); + } + onChanged(); + } + } else { + if (!other.constraint_.isEmpty()) { + if (constraintBuilder_.isEmpty()) { + constraintBuilder_.dispose(); + constraintBuilder_ = null; + constraint_ = other.constraint_; + bitField0_ = (bitField0_ & ~0x00000004); + constraintBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getConstraintFieldBuilder() : null; + } else { + constraintBuilder_.addAllMessages(other.constraint_); + } + } + } + if (!other.hostMemoryArg_.isEmpty()) { + if (hostMemoryArg_.isEmpty()) { + hostMemoryArg_ = other.hostMemoryArg_; + bitField0_ |= 0x00000008; + } else { + ensureHostMemoryArgIsMutable(); + hostMemoryArg_.addAll(other.hostMemoryArg_); + } + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getPriority() != 0) { + setPriority(other.getPriority()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + op_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + deviceType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + org.tensorflow.proto.KernelDef.AttrConstraint m = + input.readMessage( + org.tensorflow.proto.KernelDef.AttrConstraint.parser(), + extensionRegistry); + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + constraint_.add(m); + } else { + constraintBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + ensureHostMemoryArgIsMutable(); + hostMemoryArg_.add(s); + break; + } // case 34 + case 42: { + label_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + priority_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object op_ = ""; + /** + *
    +     * Must match the name of an Op.
    +     * 
    + * + * string op = 1; + * @return The op. + */ + public java.lang.String getOp() { + java.lang.Object ref = op_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + op_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Must match the name of an Op.
    +     * 
    + * + * string op = 1; + * @return The bytes for op. + */ + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Must match the name of an Op.
    +     * 
    + * + * string op = 1; + * @param value The op to set. + * @return This builder for chaining. + */ + public Builder setOp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + op_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Must match the name of an Op.
    +     * 
    + * + * string op = 1; + * @return This builder for chaining. + */ + public Builder clearOp() { + op_ = getDefaultInstance().getOp(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Must match the name of an Op.
    +     * 
    + * + * string op = 1; + * @param value The bytes for op to set. + * @return This builder for chaining. + */ + public Builder setOpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + op_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object deviceType_ = ""; + /** + *
    +     * Type of device this kernel runs on.
    +     * 
    + * + * string device_type = 2; + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Type of device this kernel runs on.
    +     * 
    + * + * string device_type = 2; + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Type of device this kernel runs on.
    +     * 
    + * + * string device_type = 2; + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + deviceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Type of device this kernel runs on.
    +     * 
    + * + * string device_type = 2; + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + deviceType_ = getDefaultInstance().getDeviceType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Type of device this kernel runs on.
    +     * 
    + * + * string device_type = 2; + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + deviceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List constraint_ = + java.util.Collections.emptyList(); + private void ensureConstraintIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + constraint_ = new java.util.ArrayList(constraint_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef.AttrConstraint, org.tensorflow.proto.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder> constraintBuilder_; + + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public java.util.List getConstraintList() { + if (constraintBuilder_ == null) { + return java.util.Collections.unmodifiableList(constraint_); + } else { + return constraintBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public int getConstraintCount() { + if (constraintBuilder_ == null) { + return constraint_.size(); + } else { + return constraintBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public org.tensorflow.proto.KernelDef.AttrConstraint getConstraint(int index) { + if (constraintBuilder_ == null) { + return constraint_.get(index); + } else { + return constraintBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder setConstraint( + int index, org.tensorflow.proto.KernelDef.AttrConstraint value) { + if (constraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintIsMutable(); + constraint_.set(index, value); + onChanged(); + } else { + constraintBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder setConstraint( + int index, org.tensorflow.proto.KernelDef.AttrConstraint.Builder builderForValue) { + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + constraint_.set(index, builderForValue.build()); + onChanged(); + } else { + constraintBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder addConstraint(org.tensorflow.proto.KernelDef.AttrConstraint value) { + if (constraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintIsMutable(); + constraint_.add(value); + onChanged(); + } else { + constraintBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder addConstraint( + int index, org.tensorflow.proto.KernelDef.AttrConstraint value) { + if (constraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConstraintIsMutable(); + constraint_.add(index, value); + onChanged(); + } else { + constraintBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder addConstraint( + org.tensorflow.proto.KernelDef.AttrConstraint.Builder builderForValue) { + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + constraint_.add(builderForValue.build()); + onChanged(); + } else { + constraintBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder addConstraint( + int index, org.tensorflow.proto.KernelDef.AttrConstraint.Builder builderForValue) { + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + constraint_.add(index, builderForValue.build()); + onChanged(); + } else { + constraintBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder addAllConstraint( + java.lang.Iterable values) { + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, constraint_); + onChanged(); + } else { + constraintBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder clearConstraint() { + if (constraintBuilder_ == null) { + constraint_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + constraintBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public Builder removeConstraint(int index) { + if (constraintBuilder_ == null) { + ensureConstraintIsMutable(); + constraint_.remove(index); + onChanged(); + } else { + constraintBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public org.tensorflow.proto.KernelDef.AttrConstraint.Builder getConstraintBuilder( + int index) { + return getConstraintFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( + int index) { + if (constraintBuilder_ == null) { + return constraint_.get(index); } else { + return constraintBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public java.util.List + getConstraintOrBuilderList() { + if (constraintBuilder_ != null) { + return constraintBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(constraint_); + } + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public org.tensorflow.proto.KernelDef.AttrConstraint.Builder addConstraintBuilder() { + return getConstraintFieldBuilder().addBuilder( + org.tensorflow.proto.KernelDef.AttrConstraint.getDefaultInstance()); + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public org.tensorflow.proto.KernelDef.AttrConstraint.Builder addConstraintBuilder( + int index) { + return getConstraintFieldBuilder().addBuilder( + index, org.tensorflow.proto.KernelDef.AttrConstraint.getDefaultInstance()); + } + /** + * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; + */ + public java.util.List + getConstraintBuilderList() { + return getConstraintFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef.AttrConstraint, org.tensorflow.proto.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder> + getConstraintFieldBuilder() { + if (constraintBuilder_ == null) { + constraintBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef.AttrConstraint, org.tensorflow.proto.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder>( + constraint_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + constraint_ = null; + } + return constraintBuilder_; + } + + private com.google.protobuf.LazyStringArrayList hostMemoryArg_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureHostMemoryArgIsMutable() { + if (!hostMemoryArg_.isModifiable()) { + hostMemoryArg_ = new com.google.protobuf.LazyStringArrayList(hostMemoryArg_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @return A list containing the hostMemoryArg. + */ + public com.google.protobuf.ProtocolStringList + getHostMemoryArgList() { + hostMemoryArg_.makeImmutable(); + return hostMemoryArg_; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @return The count of hostMemoryArg. + */ + public int getHostMemoryArgCount() { + return hostMemoryArg_.size(); + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param index The index of the element to return. + * @return The hostMemoryArg at the given index. + */ + public java.lang.String getHostMemoryArg(int index) { + return hostMemoryArg_.get(index); + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param index The index of the value to return. + * @return The bytes of the hostMemoryArg at the given index. + */ + public com.google.protobuf.ByteString + getHostMemoryArgBytes(int index) { + return hostMemoryArg_.getByteString(index); + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param index The index to set the value at. + * @param value The hostMemoryArg to set. + * @return This builder for chaining. + */ + public Builder setHostMemoryArg( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureHostMemoryArgIsMutable(); + hostMemoryArg_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param value The hostMemoryArg to add. + * @return This builder for chaining. + */ + public Builder addHostMemoryArg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureHostMemoryArgIsMutable(); + hostMemoryArg_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param values The hostMemoryArg to add. + * @return This builder for chaining. + */ + public Builder addAllHostMemoryArg( + java.lang.Iterable values) { + ensureHostMemoryArgIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, hostMemoryArg_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @return This builder for chaining. + */ + public Builder clearHostMemoryArg() { + hostMemoryArg_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
    +     * Names of the Op's input_/output_args that reside in host memory
    +     * instead of device memory.
    +     * 
    + * + * repeated string host_memory_arg = 4; + * @param value The bytes of the hostMemoryArg to add. + * @return This builder for chaining. + */ + public Builder addHostMemoryArgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureHostMemoryArgIsMutable(); + hostMemoryArg_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
    +     * This allows experimental kernels to be registered for an op that
    +     * won't be used unless the user specifies a "_kernel" attr with
    +     * value matching this.
    +     * 
    + * + * string label = 5; + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * This allows experimental kernels to be registered for an op that
    +     * won't be used unless the user specifies a "_kernel" attr with
    +     * value matching this.
    +     * 
    + * + * string label = 5; + * @return The bytes for label. + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * This allows experimental kernels to be registered for an op that
    +     * won't be used unless the user specifies a "_kernel" attr with
    +     * value matching this.
    +     * 
    + * + * string label = 5; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + label_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * This allows experimental kernels to be registered for an op that
    +     * won't be used unless the user specifies a "_kernel" attr with
    +     * value matching this.
    +     * 
    + * + * string label = 5; + * @return This builder for chaining. + */ + public Builder clearLabel() { + label_ = getDefaultInstance().getLabel(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * This allows experimental kernels to be registered for an op that
    +     * won't be used unless the user specifies a "_kernel" attr with
    +     * value matching this.
    +     * 
    + * + * string label = 5; + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + label_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int priority_ ; + /** + *
    +     * Prioritization of kernel amongst different devices. By default we assume
    +     * priority is 0. The higher the priority the better. By default (i.e. if
    +     * this is not set), we prefer GPU kernels over CPU.
    +     * 
    + * + * int32 priority = 6; + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + /** + *
    +     * Prioritization of kernel amongst different devices. By default we assume
    +     * priority is 0. The higher the priority the better. By default (i.e. if
    +     * this is not set), we prefer GPU kernels over CPU.
    +     * 
    + * + * int32 priority = 6; + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(int value) { + + priority_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Prioritization of kernel amongst different devices. By default we assume
    +     * priority is 0. The higher the priority the better. By default (i.e. if
    +     * this is not set), we prefer GPU kernels over CPU.
    +     * 
    + * + * int32 priority = 6; + * @return This builder for chaining. + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00000020); + priority_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.KernelDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.KernelDef) + private static final org.tensorflow.proto.KernelDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.KernelDef(); + } + + public static org.tensorflow.proto.KernelDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KernelDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.KernelDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefOrBuilder.java index 2d62f81acc3..33d6bc783ed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/KernelDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/kernel_def.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface KernelDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.KernelDef) @@ -13,6 +15,7 @@ public interface KernelDefOrBuilder extends *
    * * string op = 1; + * @return The op. */ java.lang.String getOp(); /** @@ -21,6 +24,7 @@ public interface KernelDefOrBuilder extends *
    * * string op = 1; + * @return The bytes for op. */ com.google.protobuf.ByteString getOpBytes(); @@ -31,6 +35,7 @@ public interface KernelDefOrBuilder extends *
    * * string device_type = 2; + * @return The deviceType. */ java.lang.String getDeviceType(); /** @@ -39,6 +44,7 @@ public interface KernelDefOrBuilder extends * * * string device_type = 2; + * @return The bytes for deviceType. */ com.google.protobuf.ByteString getDeviceTypeBytes(); @@ -46,12 +52,12 @@ public interface KernelDefOrBuilder extends /** * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; */ - java.util.List + java.util.List getConstraintList(); /** * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; */ - org.tensorflow.proto.framework.KernelDef.AttrConstraint getConstraint(int index); + org.tensorflow.proto.KernelDef.AttrConstraint getConstraint(int index); /** * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; */ @@ -59,12 +65,12 @@ public interface KernelDefOrBuilder extends /** * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; */ - java.util.List + java.util.List getConstraintOrBuilderList(); /** * repeated .tensorflow.KernelDef.AttrConstraint constraint = 3; */ - org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( + org.tensorflow.proto.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder( int index); /** @@ -74,6 +80,7 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * repeated string host_memory_arg = 4; + * @return A list containing the hostMemoryArg. */ java.util.List getHostMemoryArgList(); @@ -84,6 +91,7 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * repeated string host_memory_arg = 4; + * @return The count of hostMemoryArg. */ int getHostMemoryArgCount(); /** @@ -93,6 +101,8 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * repeated string host_memory_arg = 4; + * @param index The index of the element to return. + * @return The hostMemoryArg at the given index. */ java.lang.String getHostMemoryArg(int index); /** @@ -102,6 +112,8 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * repeated string host_memory_arg = 4; + * @param index The index of the value to return. + * @return The bytes of the hostMemoryArg at the given index. */ com.google.protobuf.ByteString getHostMemoryArgBytes(int index); @@ -114,6 +126,7 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * string label = 5; + * @return The label. */ java.lang.String getLabel(); /** @@ -124,6 +137,7 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * string label = 5; + * @return The bytes for label. */ com.google.protobuf.ByteString getLabelBytes(); @@ -136,6 +150,7 @@ org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOr * * * int32 priority = 6; + * @return The priority. */ int getPriority(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefProtos.java new file mode 100644 index 00000000000..6186e35bccd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelDefProtos.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/kernel_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class KernelDefProtos { + private KernelDefProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + KernelDefProtos.class.getName()); + } + 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_KernelDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_KernelDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_KernelDef_AttrConstraint_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_KernelList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_KernelList_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/framework/kernel_def.p" + + "roto\022\ntensorflow\032*tensorflow/core/framew" + + "ork/attr_value.proto\"\357\001\n\tKernelDef\022\n\n\002op" + + "\030\001 \001(\t\022\023\n\013device_type\030\002 \001(\t\0228\n\nconstrain" + + "t\030\003 \003(\0132$.tensorflow.KernelDef.AttrConst" + + "raint\022\027\n\017host_memory_arg\030\004 \003(\t\022\r\n\005label\030" + + "\005 \001(\t\022\020\n\010priority\030\006 \001(\005\032M\n\016AttrConstrain" + + "t\022\014\n\004name\030\001 \001(\t\022-\n\016allowed_values\030\002 \001(\0132" + + "\025.tensorflow.AttrValue\"3\n\nKernelList\022%\n\006" + + "kernel\030\001 \003(\0132\025.tensorflow.KernelDefB\177\n\024o" + + "rg.tensorflow.protoB\017KernelDefProtosP\001ZQ" + + "github.com/tensorflow/tensorflow/tensorf" + + "low/go/core/framework/kernel_def_go_prot" + + "o\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + }); + internal_static_tensorflow_KernelDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_KernelDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_KernelDef_descriptor, + new java.lang.String[] { "Op", "DeviceType", "Constraint", "HostMemoryArg", "Label", "Priority", }); + internal_static_tensorflow_KernelDef_AttrConstraint_descriptor = + internal_static_tensorflow_KernelDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_KernelDef_AttrConstraint_descriptor, + new java.lang.String[] { "Name", "AllowedValues", }); + internal_static_tensorflow_KernelList_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_KernelList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_KernelList_descriptor, + new java.lang.String[] { "Kernel", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelList.java new file mode 100644 index 00000000000..add0709c673 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelList.java @@ -0,0 +1,727 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/kernel_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A collection of KernelDefs
    + * 
    + * + * Protobuf type {@code tensorflow.KernelList} + */ +public final class KernelList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.KernelList) + KernelListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + KernelList.class.getName()); + } + // Use KernelList.newBuilder() to construct. + private KernelList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private KernelList() { + kernel_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.KernelList.class, org.tensorflow.proto.KernelList.Builder.class); + } + + public static final int KERNEL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List kernel_; + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + @java.lang.Override + public java.util.List getKernelList() { + return kernel_; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + @java.lang.Override + public java.util.List + getKernelOrBuilderList() { + return kernel_; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + @java.lang.Override + public int getKernelCount() { + return kernel_.size(); + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + @java.lang.Override + public org.tensorflow.proto.KernelDef getKernel(int index) { + return kernel_.get(index); + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + @java.lang.Override + public org.tensorflow.proto.KernelDefOrBuilder getKernelOrBuilder( + int index) { + return kernel_.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 { + for (int i = 0; i < kernel_.size(); i++) { + output.writeMessage(1, kernel_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < kernel_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kernel_.get(i)); + } + size += getUnknownFields().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.KernelList)) { + return super.equals(obj); + } + org.tensorflow.proto.KernelList other = (org.tensorflow.proto.KernelList) obj; + + if (!getKernelList() + .equals(other.getKernelList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getKernelCount() > 0) { + hash = (37 * hash) + KERNEL_FIELD_NUMBER; + hash = (53 * hash) + getKernelList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.KernelList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelList 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.KernelList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelList 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.KernelList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.KernelList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.KernelList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.KernelList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.KernelList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.KernelList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.KernelList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.KernelList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A collection of KernelDefs
    +   * 
    + * + * Protobuf type {@code tensorflow.KernelList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.KernelList) + org.tensorflow.proto.KernelListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.KernelList.class, org.tensorflow.proto.KernelList.Builder.class); + } + + // Construct using org.tensorflow.proto.KernelList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (kernelBuilder_ == null) { + kernel_ = java.util.Collections.emptyList(); + } else { + kernel_ = null; + kernelBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.KernelDefProtos.internal_static_tensorflow_KernelList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.KernelList getDefaultInstanceForType() { + return org.tensorflow.proto.KernelList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.KernelList build() { + org.tensorflow.proto.KernelList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.KernelList buildPartial() { + org.tensorflow.proto.KernelList result = new org.tensorflow.proto.KernelList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.KernelList result) { + if (kernelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kernel_ = java.util.Collections.unmodifiableList(kernel_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kernel_ = kernel_; + } else { + result.kernel_ = kernelBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.KernelList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.KernelList) { + return mergeFrom((org.tensorflow.proto.KernelList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.KernelList other) { + if (other == org.tensorflow.proto.KernelList.getDefaultInstance()) return this; + if (kernelBuilder_ == null) { + if (!other.kernel_.isEmpty()) { + if (kernel_.isEmpty()) { + kernel_ = other.kernel_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKernelIsMutable(); + kernel_.addAll(other.kernel_); + } + onChanged(); + } + } else { + if (!other.kernel_.isEmpty()) { + if (kernelBuilder_.isEmpty()) { + kernelBuilder_.dispose(); + kernelBuilder_ = null; + kernel_ = other.kernel_; + bitField0_ = (bitField0_ & ~0x00000001); + kernelBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getKernelFieldBuilder() : null; + } else { + kernelBuilder_.addAllMessages(other.kernel_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.KernelDef m = + input.readMessage( + org.tensorflow.proto.KernelDef.parser(), + extensionRegistry); + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + kernel_.add(m); + } else { + kernelBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List kernel_ = + java.util.Collections.emptyList(); + private void ensureKernelIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kernel_ = new java.util.ArrayList(kernel_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef, org.tensorflow.proto.KernelDef.Builder, org.tensorflow.proto.KernelDefOrBuilder> kernelBuilder_; + + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public java.util.List getKernelList() { + if (kernelBuilder_ == null) { + return java.util.Collections.unmodifiableList(kernel_); + } else { + return kernelBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public int getKernelCount() { + if (kernelBuilder_ == null) { + return kernel_.size(); + } else { + return kernelBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public org.tensorflow.proto.KernelDef getKernel(int index) { + if (kernelBuilder_ == null) { + return kernel_.get(index); + } else { + return kernelBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder setKernel( + int index, org.tensorflow.proto.KernelDef value) { + if (kernelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelIsMutable(); + kernel_.set(index, value); + onChanged(); + } else { + kernelBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder setKernel( + int index, org.tensorflow.proto.KernelDef.Builder builderForValue) { + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + kernel_.set(index, builderForValue.build()); + onChanged(); + } else { + kernelBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder addKernel(org.tensorflow.proto.KernelDef value) { + if (kernelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelIsMutable(); + kernel_.add(value); + onChanged(); + } else { + kernelBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder addKernel( + int index, org.tensorflow.proto.KernelDef value) { + if (kernelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKernelIsMutable(); + kernel_.add(index, value); + onChanged(); + } else { + kernelBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder addKernel( + org.tensorflow.proto.KernelDef.Builder builderForValue) { + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + kernel_.add(builderForValue.build()); + onChanged(); + } else { + kernelBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder addKernel( + int index, org.tensorflow.proto.KernelDef.Builder builderForValue) { + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + kernel_.add(index, builderForValue.build()); + onChanged(); + } else { + kernelBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder addAllKernel( + java.lang.Iterable values) { + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kernel_); + onChanged(); + } else { + kernelBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder clearKernel() { + if (kernelBuilder_ == null) { + kernel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kernelBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public Builder removeKernel(int index) { + if (kernelBuilder_ == null) { + ensureKernelIsMutable(); + kernel_.remove(index); + onChanged(); + } else { + kernelBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public org.tensorflow.proto.KernelDef.Builder getKernelBuilder( + int index) { + return getKernelFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public org.tensorflow.proto.KernelDefOrBuilder getKernelOrBuilder( + int index) { + if (kernelBuilder_ == null) { + return kernel_.get(index); } else { + return kernelBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public java.util.List + getKernelOrBuilderList() { + if (kernelBuilder_ != null) { + return kernelBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kernel_); + } + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public org.tensorflow.proto.KernelDef.Builder addKernelBuilder() { + return getKernelFieldBuilder().addBuilder( + org.tensorflow.proto.KernelDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public org.tensorflow.proto.KernelDef.Builder addKernelBuilder( + int index) { + return getKernelFieldBuilder().addBuilder( + index, org.tensorflow.proto.KernelDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + public java.util.List + getKernelBuilderList() { + return getKernelFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef, org.tensorflow.proto.KernelDef.Builder, org.tensorflow.proto.KernelDefOrBuilder> + getKernelFieldBuilder() { + if (kernelBuilder_ == null) { + kernelBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.KernelDef, org.tensorflow.proto.KernelDef.Builder, org.tensorflow.proto.KernelDefOrBuilder>( + kernel_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kernel_ = null; + } + return kernelBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.KernelList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.KernelList) + private static final org.tensorflow.proto.KernelList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.KernelList(); + } + + public static org.tensorflow.proto.KernelList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KernelList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.KernelList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelListOrBuilder.java new file mode 100644 index 00000000000..ef703603a2b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/KernelListOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/kernel_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface KernelListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.KernelList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + java.util.List + getKernelList(); + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + org.tensorflow.proto.KernelDef getKernel(int index); + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + int getKernelCount(); + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + java.util.List + getKernelOrBuilderList(); + /** + * repeated .tensorflow.KernelDef kernel = 1; + */ + org.tensorflow.proto.KernelDefOrBuilder getKernelOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinks.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinks.java new file mode 100644 index 00000000000..d17b6ea169f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinks.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.LocalLinks} + */ +public final class LocalLinks extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.LocalLinks) + LocalLinksOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LocalLinks.class.getName()); + } + // Use LocalLinks.newBuilder() to construct. + private LocalLinks(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LocalLinks() { + link_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.LocalLinks.class, org.tensorflow.proto.LocalLinks.Builder.class); + } + + public static final int LINK_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List link_; + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + @java.lang.Override + public java.util.List getLinkList() { + return link_; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + @java.lang.Override + public java.util.List + getLinkOrBuilderList() { + return link_; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + @java.lang.Override + public int getLinkCount() { + return link_.size(); + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + @java.lang.Override + public org.tensorflow.proto.InterconnectLink getLink(int index) { + return link_.get(index); + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + @java.lang.Override + public org.tensorflow.proto.InterconnectLinkOrBuilder getLinkOrBuilder( + int index) { + return link_.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 { + for (int i = 0; i < link_.size(); i++) { + output.writeMessage(1, link_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < link_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, link_.get(i)); + } + size += getUnknownFields().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.LocalLinks)) { + return super.equals(obj); + } + org.tensorflow.proto.LocalLinks other = (org.tensorflow.proto.LocalLinks) obj; + + if (!getLinkList() + .equals(other.getLinkList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLinkCount() > 0) { + hash = (37 * hash) + LINK_FIELD_NUMBER; + hash = (53 * hash) + getLinkList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.LocalLinks parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LocalLinks 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.LocalLinks parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LocalLinks 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.LocalLinks parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LocalLinks parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.LocalLinks parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.LocalLinks parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.LocalLinks parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.LocalLinks parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.LocalLinks parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.LocalLinks parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.LocalLinks 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.LocalLinks} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.LocalLinks) + org.tensorflow.proto.LocalLinksOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.LocalLinks.class, org.tensorflow.proto.LocalLinks.Builder.class); + } + + // Construct using org.tensorflow.proto.LocalLinks.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (linkBuilder_ == null) { + link_ = java.util.Collections.emptyList(); + } else { + link_ = null; + linkBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceAttributesProtos.internal_static_tensorflow_LocalLinks_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.LocalLinks getDefaultInstanceForType() { + return org.tensorflow.proto.LocalLinks.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.LocalLinks build() { + org.tensorflow.proto.LocalLinks result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.LocalLinks buildPartial() { + org.tensorflow.proto.LocalLinks result = new org.tensorflow.proto.LocalLinks(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.LocalLinks result) { + if (linkBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + link_ = java.util.Collections.unmodifiableList(link_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.link_ = link_; + } else { + result.link_ = linkBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.LocalLinks result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.LocalLinks) { + return mergeFrom((org.tensorflow.proto.LocalLinks)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.LocalLinks other) { + if (other == org.tensorflow.proto.LocalLinks.getDefaultInstance()) return this; + if (linkBuilder_ == null) { + if (!other.link_.isEmpty()) { + if (link_.isEmpty()) { + link_ = other.link_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinkIsMutable(); + link_.addAll(other.link_); + } + onChanged(); + } + } else { + if (!other.link_.isEmpty()) { + if (linkBuilder_.isEmpty()) { + linkBuilder_.dispose(); + linkBuilder_ = null; + link_ = other.link_; + bitField0_ = (bitField0_ & ~0x00000001); + linkBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLinkFieldBuilder() : null; + } else { + linkBuilder_.addAllMessages(other.link_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.InterconnectLink m = + input.readMessage( + org.tensorflow.proto.InterconnectLink.parser(), + extensionRegistry); + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.add(m); + } else { + linkBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List link_ = + java.util.Collections.emptyList(); + private void ensureLinkIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + link_ = new java.util.ArrayList(link_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.InterconnectLink, org.tensorflow.proto.InterconnectLink.Builder, org.tensorflow.proto.InterconnectLinkOrBuilder> linkBuilder_; + + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public java.util.List getLinkList() { + if (linkBuilder_ == null) { + return java.util.Collections.unmodifiableList(link_); + } else { + return linkBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public int getLinkCount() { + if (linkBuilder_ == null) { + return link_.size(); + } else { + return linkBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public org.tensorflow.proto.InterconnectLink getLink(int index) { + if (linkBuilder_ == null) { + return link_.get(index); + } else { + return linkBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder setLink( + int index, org.tensorflow.proto.InterconnectLink value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.set(index, value); + onChanged(); + } else { + linkBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder setLink( + int index, org.tensorflow.proto.InterconnectLink.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.set(index, builderForValue.build()); + onChanged(); + } else { + linkBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder addLink(org.tensorflow.proto.InterconnectLink value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.add(value); + onChanged(); + } else { + linkBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder addLink( + int index, org.tensorflow.proto.InterconnectLink value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIsMutable(); + link_.add(index, value); + onChanged(); + } else { + linkBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder addLink( + org.tensorflow.proto.InterconnectLink.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.add(builderForValue.build()); + onChanged(); + } else { + linkBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder addLink( + int index, org.tensorflow.proto.InterconnectLink.Builder builderForValue) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.add(index, builderForValue.build()); + onChanged(); + } else { + linkBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder addAllLink( + java.lang.Iterable values) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, link_); + onChanged(); + } else { + linkBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder clearLink() { + if (linkBuilder_ == null) { + link_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linkBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public Builder removeLink(int index) { + if (linkBuilder_ == null) { + ensureLinkIsMutable(); + link_.remove(index); + onChanged(); + } else { + linkBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public org.tensorflow.proto.InterconnectLink.Builder getLinkBuilder( + int index) { + return getLinkFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public org.tensorflow.proto.InterconnectLinkOrBuilder getLinkOrBuilder( + int index) { + if (linkBuilder_ == null) { + return link_.get(index); } else { + return linkBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public java.util.List + getLinkOrBuilderList() { + if (linkBuilder_ != null) { + return linkBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(link_); + } + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public org.tensorflow.proto.InterconnectLink.Builder addLinkBuilder() { + return getLinkFieldBuilder().addBuilder( + org.tensorflow.proto.InterconnectLink.getDefaultInstance()); + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public org.tensorflow.proto.InterconnectLink.Builder addLinkBuilder( + int index) { + return getLinkFieldBuilder().addBuilder( + index, org.tensorflow.proto.InterconnectLink.getDefaultInstance()); + } + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + public java.util.List + getLinkBuilderList() { + return getLinkFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.InterconnectLink, org.tensorflow.proto.InterconnectLink.Builder, org.tensorflow.proto.InterconnectLinkOrBuilder> + getLinkFieldBuilder() { + if (linkBuilder_ == null) { + linkBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.InterconnectLink, org.tensorflow.proto.InterconnectLink.Builder, org.tensorflow.proto.InterconnectLinkOrBuilder>( + link_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + link_ = null; + } + return linkBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.LocalLinks) + } + + // @@protoc_insertion_point(class_scope:tensorflow.LocalLinks) + private static final org.tensorflow.proto.LocalLinks DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.LocalLinks(); + } + + public static org.tensorflow.proto.LocalLinks getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalLinks parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LocalLinks getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinksOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinksOrBuilder.java new file mode 100644 index 00000000000..408b99a6c97 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LocalLinksOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/device_attributes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface LocalLinksOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.LocalLinks) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + java.util.List + getLinkList(); + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + org.tensorflow.proto.InterconnectLink getLink(int index); + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + int getLinkCount(); + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + java.util.List + getLinkOrBuilderList(); + /** + * repeated .tensorflow.InterconnectLink link = 1; + */ + org.tensorflow.proto.InterconnectLinkOrBuilder getLinkOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogMemoryProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMemoryProtos.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogMemoryProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMemoryProtos.java index 4cef19ad6fe..847171ae16e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/LogMemoryProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMemoryProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class LogMemoryProtos { private LogMemoryProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LogMemoryProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,32 +28,32 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogStep_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogStep_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogTensorOutput_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogRawAllocation_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -71,54 +82,55 @@ public static void registerAllExtensions( "ocator_name\030\006 \001(\t\"\177\n\030MemoryLogRawDealloc" + "ation\022\017\n\007step_id\030\001 \001(\003\022\021\n\toperation\030\002 \001(" + "\t\022\025\n\rallocation_id\030\003 \001(\003\022\026\n\016allocator_na" + - "me\030\004 \001(\t\022\020\n\010deferred\030\005 \001(\010B\211\001\n\036org.tenso" + - "rflow.proto.frameworkB\017LogMemoryProtosP\001" + - "ZQgithub.com/tensorflow/tensorflow/tenso" + - "rflow/go/core/framework/log_memory_go_pr" + - "oto\370\001\001b\006proto3" + "me\030\004 \001(\t\022\020\n\010deferred\030\005 \001(\010B\177\n\024org.tensor" + + "flow.protoB\017LogMemoryProtosP\001ZQgithub.co" + + "m/tensorflow/tensorflow/tensorflow/go/co" + + "re/framework/log_memory_go_proto\370\001\001b\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.TensorDescriptionProtos.getDescriptor(), + org.tensorflow.proto.TensorDescriptionProtos.getDescriptor(), }); internal_static_tensorflow_MemoryLogStep_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_MemoryLogStep_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogStep_descriptor, new java.lang.String[] { "StepId", "Handle", }); internal_static_tensorflow_MemoryLogTensorAllocation_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogTensorAllocation_descriptor, new java.lang.String[] { "StepId", "KernelName", "Tensor", }); internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor, new java.lang.String[] { "AllocationId", "AllocatorName", }); internal_static_tensorflow_MemoryLogTensorOutput_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogTensorOutput_descriptor, new java.lang.String[] { "StepId", "KernelName", "Index", "Tensor", }); internal_static_tensorflow_MemoryLogRawAllocation_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogRawAllocation_descriptor, new java.lang.String[] { "StepId", "Operation", "NumBytes", "Ptr", "AllocationId", "AllocatorName", }); internal_static_tensorflow_MemoryLogRawDeallocation_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryLogRawDeallocation_descriptor, new java.lang.String[] { "StepId", "Operation", "AllocationId", "AllocatorName", "Deferred", }); - org.tensorflow.proto.framework.TensorDescriptionProtos.getDescriptor(); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorDescriptionProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessage.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessage.java new file mode 100644 index 00000000000..d18b8648fbd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessage.java @@ -0,0 +1,776 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer used for logging messages to the events file.
    + *
    + * This was theoretically used by the defunct tensorboard_logging module, which
    + * has been removed; this message is now deprecated and should not be used.
    + * 
    + * + * Protobuf type {@code tensorflow.LogMessage} + */ +@java.lang.Deprecated public final class LogMessage extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.LogMessage) + LogMessageOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LogMessage.class.getName()); + } + // Use LogMessage.newBuilder() to construct. + private LogMessage(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LogMessage() { + level_ = 0; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_LogMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_LogMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.LogMessage.class, org.tensorflow.proto.LogMessage.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.LogMessage.Level} + */ + @java.lang.Deprecated public enum Level + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
    +     * Note: The logging level 10 cannot be named DEBUG. Some software
    +     * projects compile their C/C++ code with -DDEBUG in debug builds. So the
    +     * C++ code generated from this file should not have an identifier named
    +     * DEBUG.
    +     * 
    + * + * DEBUGGING = 10; + */ + DEBUGGING(10), + /** + * INFO = 20; + */ + INFO(20), + /** + * WARN = 30; + */ + WARN(30), + /** + * ERROR = 40; + */ + ERROR(40), + /** + * FATAL = 50; + */ + FATAL(50), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Level.class.getName()); + } + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
    +     * Note: The logging level 10 cannot be named DEBUG. Some software
    +     * projects compile their C/C++ code with -DDEBUG in debug builds. So the
    +     * C++ code generated from this file should not have an identifier named
    +     * DEBUG.
    +     * 
    + * + * DEBUGGING = 10; + */ + public static final int DEBUGGING_VALUE = 10; + /** + * INFO = 20; + */ + public static final int INFO_VALUE = 20; + /** + * WARN = 30; + */ + public static final int WARN_VALUE = 30; + /** + * ERROR = 40; + */ + public static final int ERROR_VALUE = 40; + /** + * FATAL = 50; + */ + public static final int FATAL_VALUE = 50; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Level valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Level forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 10: return DEBUGGING; + case 20: return INFO; + case 30: return WARN; + case 40: return ERROR; + case 50: return FATAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Level> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Level findValueByNumber(int number) { + return Level.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.LogMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final Level[] VALUES = values(); + + public static Level 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 Level(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.LogMessage.Level) + } + + public static final int LEVEL_FIELD_NUMBER = 1; + private int level_ = 0; + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The enum numeric value on the wire for level. + */ + @java.lang.Override public int getLevelValue() { + return level_; + } + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The level. + */ + @java.lang.Override public org.tensorflow.proto.LogMessage.Level getLevel() { + org.tensorflow.proto.LogMessage.Level result = org.tensorflow.proto.LogMessage.Level.forNumber(level_); + return result == null ? org.tensorflow.proto.LogMessage.Level.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (level_ != org.tensorflow.proto.LogMessage.Level.UNKNOWN.getNumber()) { + output.writeEnum(1, level_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (level_ != org.tensorflow.proto.LogMessage.Level.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, level_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); + } + size += getUnknownFields().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.LogMessage)) { + return super.equals(obj); + } + org.tensorflow.proto.LogMessage other = (org.tensorflow.proto.LogMessage) obj; + + if (level_ != other.level_) return false; + if (!getMessage() + .equals(other.getMessage())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LEVEL_FIELD_NUMBER; + hash = (53 * hash) + level_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.LogMessage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LogMessage 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.LogMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LogMessage 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.LogMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.LogMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.LogMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.LogMessage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.LogMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.LogMessage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.LogMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.LogMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.LogMessage 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer used for logging messages to the events file.
    +   *
    +   * This was theoretically used by the defunct tensorboard_logging module, which
    +   * has been removed; this message is now deprecated and should not be used.
    +   * 
    + * + * Protobuf type {@code tensorflow.LogMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.LogMessage) + org.tensorflow.proto.LogMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_LogMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_LogMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.LogMessage.class, org.tensorflow.proto.LogMessage.Builder.class); + } + + // Construct using org.tensorflow.proto.LogMessage.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + level_ = 0; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_LogMessage_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.LogMessage getDefaultInstanceForType() { + return org.tensorflow.proto.LogMessage.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.LogMessage build() { + org.tensorflow.proto.LogMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.LogMessage buildPartial() { + org.tensorflow.proto.LogMessage result = new org.tensorflow.proto.LogMessage(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.LogMessage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.level_ = level_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.LogMessage) { + return mergeFrom((org.tensorflow.proto.LogMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.LogMessage other) { + if (other == org.tensorflow.proto.LogMessage.getDefaultInstance()) return this; + if (other.level_ != 0) { + setLevelValue(other.getLevelValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + level_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int level_ = 0; + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The enum numeric value on the wire for level. + */ + @java.lang.Override public int getLevelValue() { + return level_; + } + /** + * .tensorflow.LogMessage.Level level = 1; + * @param value The enum numeric value on the wire for level to set. + * @return This builder for chaining. + */ + public Builder setLevelValue(int value) { + level_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The level. + */ + @java.lang.Override + public org.tensorflow.proto.LogMessage.Level getLevel() { + org.tensorflow.proto.LogMessage.Level result = org.tensorflow.proto.LogMessage.Level.forNumber(level_); + return result == null ? org.tensorflow.proto.LogMessage.Level.UNRECOGNIZED : result; + } + /** + * .tensorflow.LogMessage.Level level = 1; + * @param value The level to set. + * @return This builder for chaining. + */ + public Builder setLevel(org.tensorflow.proto.LogMessage.Level value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + level_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.LogMessage.Level level = 1; + * @return This builder for chaining. + */ + public Builder clearLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + level_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * string message = 2; + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string message = 2; + * @return The bytes for message. + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.LogMessage) + } + + // @@protoc_insertion_point(class_scope:tensorflow.LogMessage) + private static final org.tensorflow.proto.LogMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.LogMessage(); + } + + public static org.tensorflow.proto.LogMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.LogMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessageOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessageOrBuilder.java new file mode 100644 index 00000000000..4174158b973 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/LogMessageOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +@java.lang.Deprecated public interface LogMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.LogMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The enum numeric value on the wire for level. + */ + int getLevelValue(); + /** + * .tensorflow.LogMessage.Level level = 1; + * @return The level. + */ + org.tensorflow.proto.LogMessage.Level getLevel(); + + /** + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfiguration.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfiguration.java new file mode 100644 index 00000000000..9d7cc47a571 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfiguration.java @@ -0,0 +1,2242 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MachineConfiguration} + */ +public final class MachineConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MachineConfiguration) + MachineConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MachineConfiguration.class.getName()); + } + // Use MachineConfiguration.newBuilder() to construct. + private MachineConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MachineConfiguration() { + hostname_ = ""; + serialIdentifier_ = ""; + deviceInfo_ = java.util.Collections.emptyList(); + availableDeviceInfo_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MachineConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MachineConfiguration.class, org.tensorflow.proto.MachineConfiguration.Builder.class); + } + + private int bitField0_; + public static final int HOSTNAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object hostname_ = ""; + /** + *
    +   * Host name of machine that ran the benchmark.
    +   * 
    + * + * string hostname = 1; + * @return The hostname. + */ + @java.lang.Override + public java.lang.String getHostname() { + java.lang.Object ref = hostname_; + 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(); + hostname_ = s; + return s; + } + } + /** + *
    +   * Host name of machine that ran the benchmark.
    +   * 
    + * + * string hostname = 1; + * @return The bytes for hostname. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHostnameBytes() { + java.lang.Object ref = hostname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIAL_IDENTIFIER_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object serialIdentifier_ = ""; + /** + *
    +   * Unique serial number of the machine.
    +   * 
    + * + * string serial_identifier = 7; + * @return The serialIdentifier. + */ + @java.lang.Override + public java.lang.String getSerialIdentifier() { + java.lang.Object ref = serialIdentifier_; + 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(); + serialIdentifier_ = s; + return s; + } + } + /** + *
    +   * Unique serial number of the machine.
    +   * 
    + * + * string serial_identifier = 7; + * @return The bytes for serialIdentifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSerialIdentifierBytes() { + java.lang.Object ref = serialIdentifier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialIdentifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PLATFORM_INFO_FIELD_NUMBER = 2; + private org.tensorflow.proto.PlatformInfo platformInfo_; + /** + *
    +   * Additional platform information.
    +   * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + * @return Whether the platformInfo field is set. + */ + @java.lang.Override + public boolean hasPlatformInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Additional platform information.
    +   * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + * @return The platformInfo. + */ + @java.lang.Override + public org.tensorflow.proto.PlatformInfo getPlatformInfo() { + return platformInfo_ == null ? org.tensorflow.proto.PlatformInfo.getDefaultInstance() : platformInfo_; + } + /** + *
    +   * Additional platform information.
    +   * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + @java.lang.Override + public org.tensorflow.proto.PlatformInfoOrBuilder getPlatformInfoOrBuilder() { + return platformInfo_ == null ? org.tensorflow.proto.PlatformInfo.getDefaultInstance() : platformInfo_; + } + + public static final int CPU_INFO_FIELD_NUMBER = 3; + private org.tensorflow.proto.CPUInfo cpuInfo_; + /** + *
    +   * CPU Information.
    +   * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + * @return Whether the cpuInfo field is set. + */ + @java.lang.Override + public boolean hasCpuInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * CPU Information.
    +   * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + * @return The cpuInfo. + */ + @java.lang.Override + public org.tensorflow.proto.CPUInfo getCpuInfo() { + return cpuInfo_ == null ? org.tensorflow.proto.CPUInfo.getDefaultInstance() : cpuInfo_; + } + /** + *
    +   * CPU Information.
    +   * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + @java.lang.Override + public org.tensorflow.proto.CPUInfoOrBuilder getCpuInfoOrBuilder() { + return cpuInfo_ == null ? org.tensorflow.proto.CPUInfo.getDefaultInstance() : cpuInfo_; + } + + public static final int DEVICE_INFO_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List deviceInfo_; + /** + *
    +   * Other devices that are attached and relevant (e.g. GPUInfo).
    +   * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + @java.lang.Override + public java.util.List getDeviceInfoList() { + return deviceInfo_; + } + /** + *
    +   * Other devices that are attached and relevant (e.g. GPUInfo).
    +   * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + @java.lang.Override + public java.util.List + getDeviceInfoOrBuilderList() { + return deviceInfo_; + } + /** + *
    +   * Other devices that are attached and relevant (e.g. GPUInfo).
    +   * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + @java.lang.Override + public int getDeviceInfoCount() { + return deviceInfo_.size(); + } + /** + *
    +   * Other devices that are attached and relevant (e.g. GPUInfo).
    +   * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + @java.lang.Override + public com.google.protobuf.Any getDeviceInfo(int index) { + return deviceInfo_.get(index); + } + /** + *
    +   * Other devices that are attached and relevant (e.g. GPUInfo).
    +   * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder( + int index) { + return deviceInfo_.get(index); + } + + public static final int AVAILABLE_DEVICE_INFO_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List availableDeviceInfo_; + /** + *
    +   * Devices accessible to the test (e.g. as given by list_local_devices).
    +   * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + @java.lang.Override + public java.util.List getAvailableDeviceInfoList() { + return availableDeviceInfo_; + } + /** + *
    +   * Devices accessible to the test (e.g. as given by list_local_devices).
    +   * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + @java.lang.Override + public java.util.List + getAvailableDeviceInfoOrBuilderList() { + return availableDeviceInfo_; + } + /** + *
    +   * Devices accessible to the test (e.g. as given by list_local_devices).
    +   * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + @java.lang.Override + public int getAvailableDeviceInfoCount() { + return availableDeviceInfo_.size(); + } + /** + *
    +   * Devices accessible to the test (e.g. as given by list_local_devices).
    +   * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AvailableDeviceInfo getAvailableDeviceInfo(int index) { + return availableDeviceInfo_.get(index); + } + /** + *
    +   * Devices accessible to the test (e.g. as given by list_local_devices).
    +   * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder( + int index) { + return availableDeviceInfo_.get(index); + } + + public static final int MEMORY_INFO_FIELD_NUMBER = 6; + private org.tensorflow.proto.MemoryInfo memoryInfo_; + /** + * .tensorflow.MemoryInfo memory_info = 6; + * @return Whether the memoryInfo field is set. + */ + @java.lang.Override + public boolean hasMemoryInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + * @return The memoryInfo. + */ + @java.lang.Override + public org.tensorflow.proto.MemoryInfo getMemoryInfo() { + return memoryInfo_ == null ? org.tensorflow.proto.MemoryInfo.getDefaultInstance() : memoryInfo_; + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + @java.lang.Override + public org.tensorflow.proto.MemoryInfoOrBuilder getMemoryInfoOrBuilder() { + return memoryInfo_ == null ? org.tensorflow.proto.MemoryInfo.getDefaultInstance() : memoryInfo_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostname_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, hostname_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPlatformInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCpuInfo()); + } + for (int i = 0; i < deviceInfo_.size(); i++) { + output.writeMessage(4, deviceInfo_.get(i)); + } + for (int i = 0; i < availableDeviceInfo_.size(); i++) { + output.writeMessage(5, availableDeviceInfo_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getMemoryInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serialIdentifier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, serialIdentifier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostname_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, hostname_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPlatformInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCpuInfo()); + } + for (int i = 0; i < deviceInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, deviceInfo_.get(i)); + } + for (int i = 0; i < availableDeviceInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, availableDeviceInfo_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getMemoryInfo()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serialIdentifier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, serialIdentifier_); + } + size += getUnknownFields().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.MachineConfiguration)) { + return super.equals(obj); + } + org.tensorflow.proto.MachineConfiguration other = (org.tensorflow.proto.MachineConfiguration) obj; + + if (!getHostname() + .equals(other.getHostname())) return false; + if (!getSerialIdentifier() + .equals(other.getSerialIdentifier())) return false; + if (hasPlatformInfo() != other.hasPlatformInfo()) return false; + if (hasPlatformInfo()) { + if (!getPlatformInfo() + .equals(other.getPlatformInfo())) return false; + } + if (hasCpuInfo() != other.hasCpuInfo()) return false; + if (hasCpuInfo()) { + if (!getCpuInfo() + .equals(other.getCpuInfo())) return false; + } + if (!getDeviceInfoList() + .equals(other.getDeviceInfoList())) return false; + if (!getAvailableDeviceInfoList() + .equals(other.getAvailableDeviceInfoList())) return false; + if (hasMemoryInfo() != other.hasMemoryInfo()) return false; + if (hasMemoryInfo()) { + if (!getMemoryInfo() + .equals(other.getMemoryInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOSTNAME_FIELD_NUMBER; + hash = (53 * hash) + getHostname().hashCode(); + hash = (37 * hash) + SERIAL_IDENTIFIER_FIELD_NUMBER; + hash = (53 * hash) + getSerialIdentifier().hashCode(); + if (hasPlatformInfo()) { + hash = (37 * hash) + PLATFORM_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPlatformInfo().hashCode(); + } + if (hasCpuInfo()) { + hash = (37 * hash) + CPU_INFO_FIELD_NUMBER; + hash = (53 * hash) + getCpuInfo().hashCode(); + } + if (getDeviceInfoCount() > 0) { + hash = (37 * hash) + DEVICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getDeviceInfoList().hashCode(); + } + if (getAvailableDeviceInfoCount() > 0) { + hash = (37 * hash) + AVAILABLE_DEVICE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getAvailableDeviceInfoList().hashCode(); + } + if (hasMemoryInfo()) { + hash = (37 * hash) + MEMORY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getMemoryInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MachineConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MachineConfiguration 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.MachineConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MachineConfiguration 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.MachineConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MachineConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MachineConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MachineConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MachineConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MachineConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MachineConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MachineConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MachineConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MachineConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MachineConfiguration) + org.tensorflow.proto.MachineConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MachineConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MachineConfiguration.class, org.tensorflow.proto.MachineConfiguration.Builder.class); + } + + // Construct using org.tensorflow.proto.MachineConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPlatformInfoFieldBuilder(); + getCpuInfoFieldBuilder(); + getDeviceInfoFieldBuilder(); + getAvailableDeviceInfoFieldBuilder(); + getMemoryInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostname_ = ""; + serialIdentifier_ = ""; + platformInfo_ = null; + if (platformInfoBuilder_ != null) { + platformInfoBuilder_.dispose(); + platformInfoBuilder_ = null; + } + cpuInfo_ = null; + if (cpuInfoBuilder_ != null) { + cpuInfoBuilder_.dispose(); + cpuInfoBuilder_ = null; + } + if (deviceInfoBuilder_ == null) { + deviceInfo_ = java.util.Collections.emptyList(); + } else { + deviceInfo_ = null; + deviceInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (availableDeviceInfoBuilder_ == null) { + availableDeviceInfo_ = java.util.Collections.emptyList(); + } else { + availableDeviceInfo_ = null; + availableDeviceInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + memoryInfo_ = null; + if (memoryInfoBuilder_ != null) { + memoryInfoBuilder_.dispose(); + memoryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MachineConfiguration_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MachineConfiguration getDefaultInstanceForType() { + return org.tensorflow.proto.MachineConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MachineConfiguration build() { + org.tensorflow.proto.MachineConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MachineConfiguration buildPartial() { + org.tensorflow.proto.MachineConfiguration result = new org.tensorflow.proto.MachineConfiguration(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.MachineConfiguration result) { + if (deviceInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + deviceInfo_ = java.util.Collections.unmodifiableList(deviceInfo_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.deviceInfo_ = deviceInfo_; + } else { + result.deviceInfo_ = deviceInfoBuilder_.build(); + } + if (availableDeviceInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + availableDeviceInfo_ = java.util.Collections.unmodifiableList(availableDeviceInfo_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.availableDeviceInfo_ = availableDeviceInfo_; + } else { + result.availableDeviceInfo_ = availableDeviceInfoBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.MachineConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostname_ = hostname_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serialIdentifier_ = serialIdentifier_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.platformInfo_ = platformInfoBuilder_ == null + ? platformInfo_ + : platformInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cpuInfo_ = cpuInfoBuilder_ == null + ? cpuInfo_ + : cpuInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.memoryInfo_ = memoryInfoBuilder_ == null + ? memoryInfo_ + : memoryInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MachineConfiguration) { + return mergeFrom((org.tensorflow.proto.MachineConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MachineConfiguration other) { + if (other == org.tensorflow.proto.MachineConfiguration.getDefaultInstance()) return this; + if (!other.getHostname().isEmpty()) { + hostname_ = other.hostname_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSerialIdentifier().isEmpty()) { + serialIdentifier_ = other.serialIdentifier_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPlatformInfo()) { + mergePlatformInfo(other.getPlatformInfo()); + } + if (other.hasCpuInfo()) { + mergeCpuInfo(other.getCpuInfo()); + } + if (deviceInfoBuilder_ == null) { + if (!other.deviceInfo_.isEmpty()) { + if (deviceInfo_.isEmpty()) { + deviceInfo_ = other.deviceInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureDeviceInfoIsMutable(); + deviceInfo_.addAll(other.deviceInfo_); + } + onChanged(); + } + } else { + if (!other.deviceInfo_.isEmpty()) { + if (deviceInfoBuilder_.isEmpty()) { + deviceInfoBuilder_.dispose(); + deviceInfoBuilder_ = null; + deviceInfo_ = other.deviceInfo_; + bitField0_ = (bitField0_ & ~0x00000010); + deviceInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDeviceInfoFieldBuilder() : null; + } else { + deviceInfoBuilder_.addAllMessages(other.deviceInfo_); + } + } + } + if (availableDeviceInfoBuilder_ == null) { + if (!other.availableDeviceInfo_.isEmpty()) { + if (availableDeviceInfo_.isEmpty()) { + availableDeviceInfo_ = other.availableDeviceInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.addAll(other.availableDeviceInfo_); + } + onChanged(); + } + } else { + if (!other.availableDeviceInfo_.isEmpty()) { + if (availableDeviceInfoBuilder_.isEmpty()) { + availableDeviceInfoBuilder_.dispose(); + availableDeviceInfoBuilder_ = null; + availableDeviceInfo_ = other.availableDeviceInfo_; + bitField0_ = (bitField0_ & ~0x00000020); + availableDeviceInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAvailableDeviceInfoFieldBuilder() : null; + } else { + availableDeviceInfoBuilder_.addAllMessages(other.availableDeviceInfo_); + } + } + } + if (other.hasMemoryInfo()) { + mergeMemoryInfo(other.getMemoryInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + hostname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getPlatformInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: { + input.readMessage( + getCpuInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: { + com.google.protobuf.Any m = + input.readMessage( + com.google.protobuf.Any.parser(), + extensionRegistry); + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + deviceInfo_.add(m); + } else { + deviceInfoBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + org.tensorflow.proto.AvailableDeviceInfo m = + input.readMessage( + org.tensorflow.proto.AvailableDeviceInfo.parser(), + extensionRegistry); + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.add(m); + } else { + availableDeviceInfoBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + input.readMessage( + getMemoryInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: { + serialIdentifier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object hostname_ = ""; + /** + *
    +     * Host name of machine that ran the benchmark.
    +     * 
    + * + * string hostname = 1; + * @return The hostname. + */ + public java.lang.String getHostname() { + java.lang.Object ref = hostname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Host name of machine that ran the benchmark.
    +     * 
    + * + * string hostname = 1; + * @return The bytes for hostname. + */ + public com.google.protobuf.ByteString + getHostnameBytes() { + java.lang.Object ref = hostname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Host name of machine that ran the benchmark.
    +     * 
    + * + * string hostname = 1; + * @param value The hostname to set. + * @return This builder for chaining. + */ + public Builder setHostname( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + hostname_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Host name of machine that ran the benchmark.
    +     * 
    + * + * string hostname = 1; + * @return This builder for chaining. + */ + public Builder clearHostname() { + hostname_ = getDefaultInstance().getHostname(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Host name of machine that ran the benchmark.
    +     * 
    + * + * string hostname = 1; + * @param value The bytes for hostname to set. + * @return This builder for chaining. + */ + public Builder setHostnameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + hostname_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object serialIdentifier_ = ""; + /** + *
    +     * Unique serial number of the machine.
    +     * 
    + * + * string serial_identifier = 7; + * @return The serialIdentifier. + */ + public java.lang.String getSerialIdentifier() { + java.lang.Object ref = serialIdentifier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serialIdentifier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Unique serial number of the machine.
    +     * 
    + * + * string serial_identifier = 7; + * @return The bytes for serialIdentifier. + */ + public com.google.protobuf.ByteString + getSerialIdentifierBytes() { + java.lang.Object ref = serialIdentifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serialIdentifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Unique serial number of the machine.
    +     * 
    + * + * string serial_identifier = 7; + * @param value The serialIdentifier to set. + * @return This builder for chaining. + */ + public Builder setSerialIdentifier( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + serialIdentifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Unique serial number of the machine.
    +     * 
    + * + * string serial_identifier = 7; + * @return This builder for chaining. + */ + public Builder clearSerialIdentifier() { + serialIdentifier_ = getDefaultInstance().getSerialIdentifier(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Unique serial number of the machine.
    +     * 
    + * + * string serial_identifier = 7; + * @param value The bytes for serialIdentifier to set. + * @return This builder for chaining. + */ + public Builder setSerialIdentifierBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + serialIdentifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private org.tensorflow.proto.PlatformInfo platformInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.PlatformInfo, org.tensorflow.proto.PlatformInfo.Builder, org.tensorflow.proto.PlatformInfoOrBuilder> platformInfoBuilder_; + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + * @return Whether the platformInfo field is set. + */ + public boolean hasPlatformInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + * @return The platformInfo. + */ + public org.tensorflow.proto.PlatformInfo getPlatformInfo() { + if (platformInfoBuilder_ == null) { + return platformInfo_ == null ? org.tensorflow.proto.PlatformInfo.getDefaultInstance() : platformInfo_; + } else { + return platformInfoBuilder_.getMessage(); + } + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public Builder setPlatformInfo(org.tensorflow.proto.PlatformInfo value) { + if (platformInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + platformInfo_ = value; + } else { + platformInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public Builder setPlatformInfo( + org.tensorflow.proto.PlatformInfo.Builder builderForValue) { + if (platformInfoBuilder_ == null) { + platformInfo_ = builderForValue.build(); + } else { + platformInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public Builder mergePlatformInfo(org.tensorflow.proto.PlatformInfo value) { + if (platformInfoBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + platformInfo_ != null && + platformInfo_ != org.tensorflow.proto.PlatformInfo.getDefaultInstance()) { + getPlatformInfoBuilder().mergeFrom(value); + } else { + platformInfo_ = value; + } + } else { + platformInfoBuilder_.mergeFrom(value); + } + if (platformInfo_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public Builder clearPlatformInfo() { + bitField0_ = (bitField0_ & ~0x00000004); + platformInfo_ = null; + if (platformInfoBuilder_ != null) { + platformInfoBuilder_.dispose(); + platformInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public org.tensorflow.proto.PlatformInfo.Builder getPlatformInfoBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPlatformInfoFieldBuilder().getBuilder(); + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + public org.tensorflow.proto.PlatformInfoOrBuilder getPlatformInfoOrBuilder() { + if (platformInfoBuilder_ != null) { + return platformInfoBuilder_.getMessageOrBuilder(); + } else { + return platformInfo_ == null ? + org.tensorflow.proto.PlatformInfo.getDefaultInstance() : platformInfo_; + } + } + /** + *
    +     * Additional platform information.
    +     * 
    + * + * .tensorflow.PlatformInfo platform_info = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.PlatformInfo, org.tensorflow.proto.PlatformInfo.Builder, org.tensorflow.proto.PlatformInfoOrBuilder> + getPlatformInfoFieldBuilder() { + if (platformInfoBuilder_ == null) { + platformInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.PlatformInfo, org.tensorflow.proto.PlatformInfo.Builder, org.tensorflow.proto.PlatformInfoOrBuilder>( + getPlatformInfo(), + getParentForChildren(), + isClean()); + platformInfo_ = null; + } + return platformInfoBuilder_; + } + + private org.tensorflow.proto.CPUInfo cpuInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CPUInfo, org.tensorflow.proto.CPUInfo.Builder, org.tensorflow.proto.CPUInfoOrBuilder> cpuInfoBuilder_; + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + * @return Whether the cpuInfo field is set. + */ + public boolean hasCpuInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + * @return The cpuInfo. + */ + public org.tensorflow.proto.CPUInfo getCpuInfo() { + if (cpuInfoBuilder_ == null) { + return cpuInfo_ == null ? org.tensorflow.proto.CPUInfo.getDefaultInstance() : cpuInfo_; + } else { + return cpuInfoBuilder_.getMessage(); + } + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public Builder setCpuInfo(org.tensorflow.proto.CPUInfo value) { + if (cpuInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cpuInfo_ = value; + } else { + cpuInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public Builder setCpuInfo( + org.tensorflow.proto.CPUInfo.Builder builderForValue) { + if (cpuInfoBuilder_ == null) { + cpuInfo_ = builderForValue.build(); + } else { + cpuInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public Builder mergeCpuInfo(org.tensorflow.proto.CPUInfo value) { + if (cpuInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + cpuInfo_ != null && + cpuInfo_ != org.tensorflow.proto.CPUInfo.getDefaultInstance()) { + getCpuInfoBuilder().mergeFrom(value); + } else { + cpuInfo_ = value; + } + } else { + cpuInfoBuilder_.mergeFrom(value); + } + if (cpuInfo_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public Builder clearCpuInfo() { + bitField0_ = (bitField0_ & ~0x00000008); + cpuInfo_ = null; + if (cpuInfoBuilder_ != null) { + cpuInfoBuilder_.dispose(); + cpuInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public org.tensorflow.proto.CPUInfo.Builder getCpuInfoBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCpuInfoFieldBuilder().getBuilder(); + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + public org.tensorflow.proto.CPUInfoOrBuilder getCpuInfoOrBuilder() { + if (cpuInfoBuilder_ != null) { + return cpuInfoBuilder_.getMessageOrBuilder(); + } else { + return cpuInfo_ == null ? + org.tensorflow.proto.CPUInfo.getDefaultInstance() : cpuInfo_; + } + } + /** + *
    +     * CPU Information.
    +     * 
    + * + * .tensorflow.CPUInfo cpu_info = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CPUInfo, org.tensorflow.proto.CPUInfo.Builder, org.tensorflow.proto.CPUInfoOrBuilder> + getCpuInfoFieldBuilder() { + if (cpuInfoBuilder_ == null) { + cpuInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CPUInfo, org.tensorflow.proto.CPUInfo.Builder, org.tensorflow.proto.CPUInfoOrBuilder>( + getCpuInfo(), + getParentForChildren(), + isClean()); + cpuInfo_ = null; + } + return cpuInfoBuilder_; + } + + private java.util.List deviceInfo_ = + java.util.Collections.emptyList(); + private void ensureDeviceInfoIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + deviceInfo_ = new java.util.ArrayList(deviceInfo_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> deviceInfoBuilder_; + + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public java.util.List getDeviceInfoList() { + if (deviceInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceInfo_); + } else { + return deviceInfoBuilder_.getMessageList(); + } + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public int getDeviceInfoCount() { + if (deviceInfoBuilder_ == null) { + return deviceInfo_.size(); + } else { + return deviceInfoBuilder_.getCount(); + } + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public com.google.protobuf.Any getDeviceInfo(int index) { + if (deviceInfoBuilder_ == null) { + return deviceInfo_.get(index); + } else { + return deviceInfoBuilder_.getMessage(index); + } + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder setDeviceInfo( + int index, com.google.protobuf.Any value) { + if (deviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceInfoIsMutable(); + deviceInfo_.set(index, value); + onChanged(); + } else { + deviceInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder setDeviceInfo( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + deviceInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder addDeviceInfo(com.google.protobuf.Any value) { + if (deviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceInfoIsMutable(); + deviceInfo_.add(value); + onChanged(); + } else { + deviceInfoBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder addDeviceInfo( + int index, com.google.protobuf.Any value) { + if (deviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceInfoIsMutable(); + deviceInfo_.add(index, value); + onChanged(); + } else { + deviceInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder addDeviceInfo( + com.google.protobuf.Any.Builder builderForValue) { + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + deviceInfo_.add(builderForValue.build()); + onChanged(); + } else { + deviceInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder addDeviceInfo( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + deviceInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder addAllDeviceInfo( + java.lang.Iterable values) { + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceInfo_); + onChanged(); + } else { + deviceInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder clearDeviceInfo() { + if (deviceInfoBuilder_ == null) { + deviceInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + deviceInfoBuilder_.clear(); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public Builder removeDeviceInfo(int index) { + if (deviceInfoBuilder_ == null) { + ensureDeviceInfoIsMutable(); + deviceInfo_.remove(index); + onChanged(); + } else { + deviceInfoBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public com.google.protobuf.Any.Builder getDeviceInfoBuilder( + int index) { + return getDeviceInfoFieldBuilder().getBuilder(index); + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder( + int index) { + if (deviceInfoBuilder_ == null) { + return deviceInfo_.get(index); } else { + return deviceInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public java.util.List + getDeviceInfoOrBuilderList() { + if (deviceInfoBuilder_ != null) { + return deviceInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceInfo_); + } + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public com.google.protobuf.Any.Builder addDeviceInfoBuilder() { + return getDeviceInfoFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public com.google.protobuf.Any.Builder addDeviceInfoBuilder( + int index) { + return getDeviceInfoFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
    +     * Other devices that are attached and relevant (e.g. GPUInfo).
    +     * 
    + * + * repeated .google.protobuf.Any device_info = 4; + */ + public java.util.List + getDeviceInfoBuilderList() { + return getDeviceInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDeviceInfoFieldBuilder() { + if (deviceInfoBuilder_ == null) { + deviceInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + deviceInfo_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + deviceInfo_ = null; + } + return deviceInfoBuilder_; + } + + private java.util.List availableDeviceInfo_ = + java.util.Collections.emptyList(); + private void ensureAvailableDeviceInfoIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + availableDeviceInfo_ = new java.util.ArrayList(availableDeviceInfo_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AvailableDeviceInfo, org.tensorflow.proto.AvailableDeviceInfo.Builder, org.tensorflow.proto.AvailableDeviceInfoOrBuilder> availableDeviceInfoBuilder_; + + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public java.util.List getAvailableDeviceInfoList() { + if (availableDeviceInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(availableDeviceInfo_); + } else { + return availableDeviceInfoBuilder_.getMessageList(); + } + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public int getAvailableDeviceInfoCount() { + if (availableDeviceInfoBuilder_ == null) { + return availableDeviceInfo_.size(); + } else { + return availableDeviceInfoBuilder_.getCount(); + } + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public org.tensorflow.proto.AvailableDeviceInfo getAvailableDeviceInfo(int index) { + if (availableDeviceInfoBuilder_ == null) { + return availableDeviceInfo_.get(index); + } else { + return availableDeviceInfoBuilder_.getMessage(index); + } + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder setAvailableDeviceInfo( + int index, org.tensorflow.proto.AvailableDeviceInfo value) { + if (availableDeviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.set(index, value); + onChanged(); + } else { + availableDeviceInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder setAvailableDeviceInfo( + int index, org.tensorflow.proto.AvailableDeviceInfo.Builder builderForValue) { + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + availableDeviceInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder addAvailableDeviceInfo(org.tensorflow.proto.AvailableDeviceInfo value) { + if (availableDeviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.add(value); + onChanged(); + } else { + availableDeviceInfoBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder addAvailableDeviceInfo( + int index, org.tensorflow.proto.AvailableDeviceInfo value) { + if (availableDeviceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.add(index, value); + onChanged(); + } else { + availableDeviceInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder addAvailableDeviceInfo( + org.tensorflow.proto.AvailableDeviceInfo.Builder builderForValue) { + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.add(builderForValue.build()); + onChanged(); + } else { + availableDeviceInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder addAvailableDeviceInfo( + int index, org.tensorflow.proto.AvailableDeviceInfo.Builder builderForValue) { + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + availableDeviceInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder addAllAvailableDeviceInfo( + java.lang.Iterable values) { + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, availableDeviceInfo_); + onChanged(); + } else { + availableDeviceInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder clearAvailableDeviceInfo() { + if (availableDeviceInfoBuilder_ == null) { + availableDeviceInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + availableDeviceInfoBuilder_.clear(); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public Builder removeAvailableDeviceInfo(int index) { + if (availableDeviceInfoBuilder_ == null) { + ensureAvailableDeviceInfoIsMutable(); + availableDeviceInfo_.remove(index); + onChanged(); + } else { + availableDeviceInfoBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public org.tensorflow.proto.AvailableDeviceInfo.Builder getAvailableDeviceInfoBuilder( + int index) { + return getAvailableDeviceInfoFieldBuilder().getBuilder(index); + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public org.tensorflow.proto.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder( + int index) { + if (availableDeviceInfoBuilder_ == null) { + return availableDeviceInfo_.get(index); } else { + return availableDeviceInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public java.util.List + getAvailableDeviceInfoOrBuilderList() { + if (availableDeviceInfoBuilder_ != null) { + return availableDeviceInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(availableDeviceInfo_); + } + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public org.tensorflow.proto.AvailableDeviceInfo.Builder addAvailableDeviceInfoBuilder() { + return getAvailableDeviceInfoFieldBuilder().addBuilder( + org.tensorflow.proto.AvailableDeviceInfo.getDefaultInstance()); + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public org.tensorflow.proto.AvailableDeviceInfo.Builder addAvailableDeviceInfoBuilder( + int index) { + return getAvailableDeviceInfoFieldBuilder().addBuilder( + index, org.tensorflow.proto.AvailableDeviceInfo.getDefaultInstance()); + } + /** + *
    +     * Devices accessible to the test (e.g. as given by list_local_devices).
    +     * 
    + * + * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5; + */ + public java.util.List + getAvailableDeviceInfoBuilderList() { + return getAvailableDeviceInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AvailableDeviceInfo, org.tensorflow.proto.AvailableDeviceInfo.Builder, org.tensorflow.proto.AvailableDeviceInfoOrBuilder> + getAvailableDeviceInfoFieldBuilder() { + if (availableDeviceInfoBuilder_ == null) { + availableDeviceInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AvailableDeviceInfo, org.tensorflow.proto.AvailableDeviceInfo.Builder, org.tensorflow.proto.AvailableDeviceInfoOrBuilder>( + availableDeviceInfo_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + availableDeviceInfo_ = null; + } + return availableDeviceInfoBuilder_; + } + + private org.tensorflow.proto.MemoryInfo memoryInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryInfo, org.tensorflow.proto.MemoryInfo.Builder, org.tensorflow.proto.MemoryInfoOrBuilder> memoryInfoBuilder_; + /** + * .tensorflow.MemoryInfo memory_info = 6; + * @return Whether the memoryInfo field is set. + */ + public boolean hasMemoryInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + * @return The memoryInfo. + */ + public org.tensorflow.proto.MemoryInfo getMemoryInfo() { + if (memoryInfoBuilder_ == null) { + return memoryInfo_ == null ? org.tensorflow.proto.MemoryInfo.getDefaultInstance() : memoryInfo_; + } else { + return memoryInfoBuilder_.getMessage(); + } + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public Builder setMemoryInfo(org.tensorflow.proto.MemoryInfo value) { + if (memoryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + memoryInfo_ = value; + } else { + memoryInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public Builder setMemoryInfo( + org.tensorflow.proto.MemoryInfo.Builder builderForValue) { + if (memoryInfoBuilder_ == null) { + memoryInfo_ = builderForValue.build(); + } else { + memoryInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public Builder mergeMemoryInfo(org.tensorflow.proto.MemoryInfo value) { + if (memoryInfoBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + memoryInfo_ != null && + memoryInfo_ != org.tensorflow.proto.MemoryInfo.getDefaultInstance()) { + getMemoryInfoBuilder().mergeFrom(value); + } else { + memoryInfo_ = value; + } + } else { + memoryInfoBuilder_.mergeFrom(value); + } + if (memoryInfo_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public Builder clearMemoryInfo() { + bitField0_ = (bitField0_ & ~0x00000040); + memoryInfo_ = null; + if (memoryInfoBuilder_ != null) { + memoryInfoBuilder_.dispose(); + memoryInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public org.tensorflow.proto.MemoryInfo.Builder getMemoryInfoBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getMemoryInfoFieldBuilder().getBuilder(); + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + public org.tensorflow.proto.MemoryInfoOrBuilder getMemoryInfoOrBuilder() { + if (memoryInfoBuilder_ != null) { + return memoryInfoBuilder_.getMessageOrBuilder(); + } else { + return memoryInfo_ == null ? + org.tensorflow.proto.MemoryInfo.getDefaultInstance() : memoryInfo_; + } + } + /** + * .tensorflow.MemoryInfo memory_info = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryInfo, org.tensorflow.proto.MemoryInfo.Builder, org.tensorflow.proto.MemoryInfoOrBuilder> + getMemoryInfoFieldBuilder() { + if (memoryInfoBuilder_ == null) { + memoryInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryInfo, org.tensorflow.proto.MemoryInfo.Builder, org.tensorflow.proto.MemoryInfoOrBuilder>( + getMemoryInfo(), + getParentForChildren(), + isClean()); + memoryInfo_ = null; + } + return memoryInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MachineConfiguration) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MachineConfiguration) + private static final org.tensorflow.proto.MachineConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MachineConfiguration(); + } + + public static org.tensorflow.proto.MachineConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MachineConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MachineConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfigurationOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfigurationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfigurationOrBuilder.java index 8b0f5f6f884..05929ab4e94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MachineConfigurationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MachineConfigurationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface MachineConfigurationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MachineConfiguration) @@ -13,6 +15,7 @@ public interface MachineConfigurationOrBuilder extends * * * string hostname = 1; + * @return The hostname. */ java.lang.String getHostname(); /** @@ -21,6 +24,7 @@ public interface MachineConfigurationOrBuilder extends * * * string hostname = 1; + * @return The bytes for hostname. */ com.google.protobuf.ByteString getHostnameBytes(); @@ -31,6 +35,7 @@ public interface MachineConfigurationOrBuilder extends * * * string serial_identifier = 7; + * @return The serialIdentifier. */ java.lang.String getSerialIdentifier(); /** @@ -39,6 +44,7 @@ public interface MachineConfigurationOrBuilder extends * * * string serial_identifier = 7; + * @return The bytes for serialIdentifier. */ com.google.protobuf.ByteString getSerialIdentifierBytes(); @@ -49,6 +55,7 @@ public interface MachineConfigurationOrBuilder extends * * * .tensorflow.PlatformInfo platform_info = 2; + * @return Whether the platformInfo field is set. */ boolean hasPlatformInfo(); /** @@ -57,8 +64,9 @@ public interface MachineConfigurationOrBuilder extends * * * .tensorflow.PlatformInfo platform_info = 2; + * @return The platformInfo. */ - org.tensorflow.proto.util.testlog.PlatformInfo getPlatformInfo(); + org.tensorflow.proto.PlatformInfo getPlatformInfo(); /** *
        * Additional platform information.
    @@ -66,7 +74,7 @@ public interface MachineConfigurationOrBuilder extends
        *
        * .tensorflow.PlatformInfo platform_info = 2;
        */
    -  org.tensorflow.proto.util.testlog.PlatformInfoOrBuilder getPlatformInfoOrBuilder();
    +  org.tensorflow.proto.PlatformInfoOrBuilder getPlatformInfoOrBuilder();
     
       /**
        * 
    @@ -74,6 +82,7 @@ public interface MachineConfigurationOrBuilder extends
        * 
    * * .tensorflow.CPUInfo cpu_info = 3; + * @return Whether the cpuInfo field is set. */ boolean hasCpuInfo(); /** @@ -82,8 +91,9 @@ public interface MachineConfigurationOrBuilder extends *
    * * .tensorflow.CPUInfo cpu_info = 3; + * @return The cpuInfo. */ - org.tensorflow.proto.util.testlog.CPUInfo getCpuInfo(); + org.tensorflow.proto.CPUInfo getCpuInfo(); /** *
        * CPU Information.
    @@ -91,7 +101,7 @@ public interface MachineConfigurationOrBuilder extends
        *
        * .tensorflow.CPUInfo cpu_info = 3;
        */
    -  org.tensorflow.proto.util.testlog.CPUInfoOrBuilder getCpuInfoOrBuilder();
    +  org.tensorflow.proto.CPUInfoOrBuilder getCpuInfoOrBuilder();
     
       /**
        * 
    @@ -144,7 +154,7 @@ com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder(
        *
        * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5;
        */
    -  java.util.List 
    +  java.util.List 
           getAvailableDeviceInfoList();
       /**
        * 
    @@ -153,7 +163,7 @@ com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder(
        *
        * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5;
        */
    -  org.tensorflow.proto.util.testlog.AvailableDeviceInfo getAvailableDeviceInfo(int index);
    +  org.tensorflow.proto.AvailableDeviceInfo getAvailableDeviceInfo(int index);
       /**
        * 
        * Devices accessible to the test (e.g. as given by list_local_devices).
    @@ -169,7 +179,7 @@ com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder(
        *
        * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5;
        */
    -  java.util.List 
    +  java.util.List 
           getAvailableDeviceInfoOrBuilderList();
       /**
        * 
    @@ -178,19 +188,21 @@ com.google.protobuf.AnyOrBuilder getDeviceInfoOrBuilder(
        *
        * repeated .tensorflow.AvailableDeviceInfo available_device_info = 5;
        */
    -  org.tensorflow.proto.util.testlog.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder(
    +  org.tensorflow.proto.AvailableDeviceInfoOrBuilder getAvailableDeviceInfoOrBuilder(
           int index);
     
       /**
        * .tensorflow.MemoryInfo memory_info = 6;
    +   * @return Whether the memoryInfo field is set.
        */
       boolean hasMemoryInfo();
       /**
        * .tensorflow.MemoryInfo memory_info = 6;
    +   * @return The memoryInfo.
        */
    -  org.tensorflow.proto.util.testlog.MemoryInfo getMemoryInfo();
    +  org.tensorflow.proto.MemoryInfo getMemoryInfo();
       /**
        * .tensorflow.MemoryInfo memory_info = 6;
        */
    -  org.tensorflow.proto.util.testlog.MemoryInfoOrBuilder getMemoryInfoOrBuilder();
    +  org.tensorflow.proto.MemoryInfoOrBuilder getMemoryInfoOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemmappedFileSystem.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemmappedFileSystem.java
    new file mode 100644
    index 00000000000..e76113f6643
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemmappedFileSystem.java
    @@ -0,0 +1,1487 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/memmapped_file_system.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class MemmappedFileSystem {
    +  private MemmappedFileSystem() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      MemmappedFileSystem.class.getName());
    +  }
    +  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 MemmappedFileSystemDirectoryElementOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.MemmappedFileSystemDirectoryElement)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * uint64 offset = 1;
    +     * @return The offset.
    +     */
    +    long getOffset();
    +
    +    /**
    +     * string name = 2;
    +     * @return The name.
    +     */
    +    java.lang.String getName();
    +    /**
    +     * string name = 2;
    +     * @return The bytes for name.
    +     */
    +    com.google.protobuf.ByteString
    +        getNameBytes();
    +
    +    /**
    +     * uint64 length = 3;
    +     * @return The length.
    +     */
    +    long getLength();
    +  }
    +  /**
    +   * 
    +   * A message that describes one region of memmapped file.
    +   * 
    + * + * Protobuf type {@code tensorflow.MemmappedFileSystemDirectoryElement} + */ + public static final class MemmappedFileSystemDirectoryElement extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemmappedFileSystemDirectoryElement) + MemmappedFileSystemDirectoryElementOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemmappedFileSystemDirectoryElement.class.getName()); + } + // Use MemmappedFileSystemDirectoryElement.newBuilder() to construct. + private MemmappedFileSystemDirectoryElement(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemmappedFileSystemDirectoryElement() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.class, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder.class); + } + + public static final int OFFSET_FIELD_NUMBER = 1; + private long offset_ = 0L; + /** + * uint64 offset = 1; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 LENGTH_FIELD_NUMBER = 3; + private long length_ = 0L; + /** + * uint64 length = 3; + * @return The length. + */ + @java.lang.Override + public long getLength() { + return length_; + } + + 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 (offset_ != 0L) { + output.writeUInt64(1, offset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (length_ != 0L) { + output.writeUInt64(3, length_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, offset_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (length_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, length_); + } + size += getUnknownFields().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.MemmappedFileSystem.MemmappedFileSystemDirectoryElement)) { + return super.equals(obj); + } + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement other = (org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement) obj; + + if (getOffset() + != other.getOffset()) return false; + if (!getName() + .equals(other.getName())) return false; + if (getLength() + != other.getLength()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffset()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLength()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement 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.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemmappedFileSystem.MemmappedFileSystemDirectoryElement 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A message that describes one region of memmapped file.
    +     * 
    + * + * Protobuf type {@code tensorflow.MemmappedFileSystemDirectoryElement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemmappedFileSystemDirectoryElement) + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.class, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder.class); + } + + // Construct using org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + offset_ = 0L; + name_ = ""; + length_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getDefaultInstanceForType() { + return org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement build() { + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement buildPartial() { + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement result = new org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.length_ = length_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement) { + return mergeFrom((org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement other) { + if (other == org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.getDefaultInstance()) return this; + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getLength() != 0L) { + setLength(other.getLength()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + offset_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + length_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long offset_ ; + /** + * uint64 offset = 1; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + /** + * uint64 offset = 1; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(long value) { + + offset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * uint64 offset = 1; + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long length_ ; + /** + * uint64 length = 3; + * @return The length. + */ + @java.lang.Override + public long getLength() { + return length_; + } + /** + * uint64 length = 3; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLength(long value) { + + length_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * uint64 length = 3; + * @return This builder for chaining. + */ + public Builder clearLength() { + bitField0_ = (bitField0_ & ~0x00000004); + length_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemmappedFileSystemDirectoryElement) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectoryElement) + private static final org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement(); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemmappedFileSystemDirectoryElement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MemmappedFileSystemDirectoryOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MemmappedFileSystemDirectory) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + java.util.List + getElementList(); + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getElement(int index); + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + int getElementCount(); + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + java.util.List + getElementOrBuilderList(); + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( + int index); + } + /** + *
    +   * A directory of regions in a memmapped file.
    +   * 
    + * + * Protobuf type {@code tensorflow.MemmappedFileSystemDirectory} + */ + public static final class MemmappedFileSystemDirectory extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemmappedFileSystemDirectory) + MemmappedFileSystemDirectoryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemmappedFileSystemDirectory.class.getName()); + } + // Use MemmappedFileSystemDirectory.newBuilder() to construct. + private MemmappedFileSystemDirectory(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemmappedFileSystemDirectory() { + element_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.class, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.Builder.class); + } + + public static final int ELEMENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List element_; + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + @java.lang.Override + public java.util.List getElementList() { + return element_; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + @java.lang.Override + public java.util.List + getElementOrBuilderList() { + return element_; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + @java.lang.Override + public int getElementCount() { + return element_.size(); + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getElement(int index) { + return element_.get(index); + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( + int index) { + return element_.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 { + for (int i = 0; i < element_.size(); i++) { + output.writeMessage(1, element_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < element_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, element_.get(i)); + } + size += getUnknownFields().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.MemmappedFileSystem.MemmappedFileSystemDirectory)) { + return super.equals(obj); + } + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory other = (org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory) obj; + + if (!getElementList() + .equals(other.getElementList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getElementCount() > 0) { + hash = (37 * hash) + ELEMENT_FIELD_NUMBER; + hash = (53 * hash) + getElementList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory 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.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory 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.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemmappedFileSystem.MemmappedFileSystemDirectory 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A directory of regions in a memmapped file.
    +     * 
    + * + * Protobuf type {@code tensorflow.MemmappedFileSystemDirectory} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemmappedFileSystemDirectory) + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.class, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.Builder.class); + } + + // Construct using org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (elementBuilder_ == null) { + element_ = java.util.Collections.emptyList(); + } else { + element_ = null; + elementBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MemmappedFileSystem.internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory getDefaultInstanceForType() { + return org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory build() { + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory buildPartial() { + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory result = new org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory result) { + if (elementBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + element_ = java.util.Collections.unmodifiableList(element_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.element_ = element_; + } else { + result.element_ = elementBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory) { + return mergeFrom((org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory other) { + if (other == org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory.getDefaultInstance()) return this; + if (elementBuilder_ == null) { + if (!other.element_.isEmpty()) { + if (element_.isEmpty()) { + element_ = other.element_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureElementIsMutable(); + element_.addAll(other.element_); + } + onChanged(); + } + } else { + if (!other.element_.isEmpty()) { + if (elementBuilder_.isEmpty()) { + elementBuilder_.dispose(); + elementBuilder_ = null; + element_ = other.element_; + bitField0_ = (bitField0_ & ~0x00000001); + elementBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getElementFieldBuilder() : null; + } else { + elementBuilder_.addAllMessages(other.element_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement m = + input.readMessage( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.parser(), + extensionRegistry); + if (elementBuilder_ == null) { + ensureElementIsMutable(); + element_.add(m); + } else { + elementBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List element_ = + java.util.Collections.emptyList(); + private void ensureElementIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + element_ = new java.util.ArrayList(element_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder> elementBuilder_; + + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public java.util.List getElementList() { + if (elementBuilder_ == null) { + return java.util.Collections.unmodifiableList(element_); + } else { + return elementBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public int getElementCount() { + if (elementBuilder_ == null) { + return element_.size(); + } else { + return elementBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement getElement(int index) { + if (elementBuilder_ == null) { + return element_.get(index); + } else { + return elementBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder setElement( + int index, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement value) { + if (elementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureElementIsMutable(); + element_.set(index, value); + onChanged(); + } else { + elementBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder setElement( + int index, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder builderForValue) { + if (elementBuilder_ == null) { + ensureElementIsMutable(); + element_.set(index, builderForValue.build()); + onChanged(); + } else { + elementBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder addElement(org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement value) { + if (elementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureElementIsMutable(); + element_.add(value); + onChanged(); + } else { + elementBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder addElement( + int index, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement value) { + if (elementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureElementIsMutable(); + element_.add(index, value); + onChanged(); + } else { + elementBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder addElement( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder builderForValue) { + if (elementBuilder_ == null) { + ensureElementIsMutable(); + element_.add(builderForValue.build()); + onChanged(); + } else { + elementBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder addElement( + int index, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder builderForValue) { + if (elementBuilder_ == null) { + ensureElementIsMutable(); + element_.add(index, builderForValue.build()); + onChanged(); + } else { + elementBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder addAllElement( + java.lang.Iterable values) { + if (elementBuilder_ == null) { + ensureElementIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, element_); + onChanged(); + } else { + elementBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder clearElement() { + if (elementBuilder_ == null) { + element_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + elementBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public Builder removeElement(int index) { + if (elementBuilder_ == null) { + ensureElementIsMutable(); + element_.remove(index); + onChanged(); + } else { + elementBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder getElementBuilder( + int index) { + return getElementFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder getElementOrBuilder( + int index) { + if (elementBuilder_ == null) { + return element_.get(index); } else { + return elementBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public java.util.List + getElementOrBuilderList() { + if (elementBuilder_ != null) { + return elementBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(element_); + } + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder addElementBuilder() { + return getElementFieldBuilder().addBuilder( + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.getDefaultInstance()); + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder addElementBuilder( + int index) { + return getElementFieldBuilder().addBuilder( + index, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.getDefaultInstance()); + } + /** + * repeated .tensorflow.MemmappedFileSystemDirectoryElement element = 1; + */ + public java.util.List + getElementBuilderList() { + return getElementFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder> + getElementFieldBuilder() { + if (elementBuilder_ == null) { + elementBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElement.Builder, org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectoryElementOrBuilder>( + element_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + element_ = null; + } + return elementBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemmappedFileSystemDirectory) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemmappedFileSystemDirectory) + private static final org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory(); + } + + public static org.tensorflow.proto.MemmappedFileSystem.MemmappedFileSystemDirectory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemmappedFileSystemDirectory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemmappedFileSystem.MemmappedFileSystemDirectory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0tensorflow/core/util/memmapped_file_sy" + + "stem.proto\022\ntensorflow\"S\n#MemmappedFileS" + + "ystemDirectoryElement\022\016\n\006offset\030\001 \001(\004\022\014\n" + + "\004name\030\002 \001(\t\022\016\n\006length\030\003 \001(\004\"`\n\034Memmapped" + + "FileSystemDirectory\022@\n\007element\030\001 \003(\0132/.t" + + "ensorflow.MemmappedFileSystemDirectoryEl" + + "ementB\031\n\024org.tensorflow.proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_MemmappedFileSystemDirectoryElement_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MemmappedFileSystemDirectoryElement_descriptor, + new java.lang.String[] { "Offset", "Name", "Length", }); + internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_MemmappedFileSystemDirectory_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MemmappedFileSystemDirectory_descriptor, + new java.lang.String[] { "Element", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfo.java new file mode 100644 index 00000000000..7154821aa85 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfo.java @@ -0,0 +1,531 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryInfo} + */ +public final class MemoryInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryInfo) + MemoryInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryInfo.class.getName()); + } + // Use MemoryInfo.newBuilder() to construct. + private MemoryInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryInfo() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MemoryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryInfo.class, org.tensorflow.proto.MemoryInfo.Builder.class); + } + + public static final int TOTAL_FIELD_NUMBER = 1; + private long total_ = 0L; + /** + *
    +   * Total virtual memory in bytes
    +   * 
    + * + * int64 total = 1; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return total_; + } + + public static final int AVAILABLE_FIELD_NUMBER = 2; + private long available_ = 0L; + /** + *
    +   * Immediately available memory in bytes
    +   * 
    + * + * int64 available = 2; + * @return The available. + */ + @java.lang.Override + public long getAvailable() { + return available_; + } + + 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 (total_ != 0L) { + output.writeInt64(1, total_); + } + if (available_ != 0L) { + output.writeInt64(2, available_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (total_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, total_); + } + if (available_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, available_); + } + size += getUnknownFields().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.MemoryInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryInfo other = (org.tensorflow.proto.MemoryInfo) obj; + + if (getTotal() + != other.getTotal()) return false; + if (getAvailable() + != other.getAvailable()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOTAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotal()); + hash = (37 * hash) + AVAILABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAvailable()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryInfo 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.MemoryInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryInfo 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.MemoryInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryInfo) + org.tensorflow.proto.MemoryInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MemoryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryInfo.class, org.tensorflow.proto.MemoryInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + total_ = 0L; + available_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MemoryInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryInfo getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryInfo build() { + org.tensorflow.proto.MemoryInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryInfo buildPartial() { + org.tensorflow.proto.MemoryInfo result = new org.tensorflow.proto.MemoryInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.total_ = total_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.available_ = available_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryInfo) { + return mergeFrom((org.tensorflow.proto.MemoryInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryInfo other) { + if (other == org.tensorflow.proto.MemoryInfo.getDefaultInstance()) return this; + if (other.getTotal() != 0L) { + setTotal(other.getTotal()); + } + if (other.getAvailable() != 0L) { + setAvailable(other.getAvailable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + total_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + available_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long total_ ; + /** + *
    +     * Total virtual memory in bytes
    +     * 
    + * + * int64 total = 1; + * @return The total. + */ + @java.lang.Override + public long getTotal() { + return total_; + } + /** + *
    +     * Total virtual memory in bytes
    +     * 
    + * + * int64 total = 1; + * @param value The total to set. + * @return This builder for chaining. + */ + public Builder setTotal(long value) { + + total_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Total virtual memory in bytes
    +     * 
    + * + * int64 total = 1; + * @return This builder for chaining. + */ + public Builder clearTotal() { + bitField0_ = (bitField0_ & ~0x00000001); + total_ = 0L; + onChanged(); + return this; + } + + private long available_ ; + /** + *
    +     * Immediately available memory in bytes
    +     * 
    + * + * int64 available = 2; + * @return The available. + */ + @java.lang.Override + public long getAvailable() { + return available_; + } + /** + *
    +     * Immediately available memory in bytes
    +     * 
    + * + * int64 available = 2; + * @param value The available to set. + * @return This builder for chaining. + */ + public Builder setAvailable(long value) { + + available_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Immediately available memory in bytes
    +     * 
    + * + * int64 available = 2; + * @return This builder for chaining. + */ + public Builder clearAvailable() { + bitField0_ = (bitField0_ & ~0x00000002); + available_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryInfo) + private static final org.tensorflow.proto.MemoryInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryInfo(); + } + + public static org.tensorflow.proto.MemoryInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfoOrBuilder.java new file mode 100644 index 00000000000..15da16855ac --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryInfoOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface MemoryInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MemoryInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Total virtual memory in bytes
    +   * 
    + * + * int64 total = 1; + * @return The total. + */ + long getTotal(); + + /** + *
    +   * Immediately available memory in bytes
    +   * 
    + * + * int64 available = 2; + * @return The available. + */ + long getAvailable(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocation.java new file mode 100644 index 00000000000..1f7d254c4cd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocation.java @@ -0,0 +1,1029 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryLogRawAllocation} + */ +public final class MemoryLogRawAllocation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogRawAllocation) + MemoryLogRawAllocationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryLogRawAllocation.class.getName()); + } + // Use MemoryLogRawAllocation.newBuilder() to construct. + private MemoryLogRawAllocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryLogRawAllocation() { + operation_ = ""; + allocatorName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogRawAllocation.class, org.tensorflow.proto.MemoryLogRawAllocation.Builder.class); + } + + public static final int STEP_ID_FIELD_NUMBER = 1; + private long stepId_ = 0L; + /** + *
    +   * Process-unique step id.
    +   * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + public static final int OPERATION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** + *
    +   * Name of the operation making the allocation.
    +   * 
    + * + * string operation = 2; + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + *
    +   * Name of the operation making the allocation.
    +   * 
    + * + * string operation = 2; + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUM_BYTES_FIELD_NUMBER = 3; + private long numBytes_ = 0L; + /** + *
    +   * Number of bytes in the allocation.
    +   * 
    + * + * int64 num_bytes = 3; + * @return The numBytes. + */ + @java.lang.Override + public long getNumBytes() { + return numBytes_; + } + + public static final int PTR_FIELD_NUMBER = 4; + private long ptr_ = 0L; + /** + *
    +   * Address of the allocation.
    +   * 
    + * + * uint64 ptr = 4; + * @return The ptr. + */ + @java.lang.Override + public long getPtr() { + return ptr_; + } + + public static final int ALLOCATION_ID_FIELD_NUMBER = 5; + private long allocationId_ = 0L; + /** + *
    +   * Id of the tensor buffer being allocated, used to match to a
    +   * corresponding deallocation.
    +   * 
    + * + * int64 allocation_id = 5; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 6; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 6; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (stepId_ != 0L) { + output.writeInt64(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, operation_); + } + if (numBytes_ != 0L) { + output.writeInt64(3, numBytes_); + } + if (ptr_ != 0L) { + output.writeUInt64(4, ptr_); + } + if (allocationId_ != 0L) { + output.writeInt64(5, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, allocatorName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, operation_); + } + if (numBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, numBytes_); + } + if (ptr_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, ptr_); + } + if (allocationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, allocatorName_); + } + size += getUnknownFields().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.MemoryLogRawAllocation)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogRawAllocation other = (org.tensorflow.proto.MemoryLogRawAllocation) obj; + + if (getStepId() + != other.getStepId()) return false; + if (!getOperation() + .equals(other.getOperation())) return false; + if (getNumBytes() + != other.getNumBytes()) return false; + if (getPtr() + != other.getPtr()) return false; + if (getAllocationId() + != other.getAllocationId()) return false; + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + NUM_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumBytes()); + hash = (37 * hash) + PTR_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPtr()); + hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocationId()); + hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawAllocation 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.MemoryLogRawAllocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogRawAllocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogRawAllocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogRawAllocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogRawAllocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogRawAllocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogRawAllocation) + org.tensorflow.proto.MemoryLogRawAllocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogRawAllocation.class, org.tensorflow.proto.MemoryLogRawAllocation.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogRawAllocation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepId_ = 0L; + operation_ = ""; + numBytes_ = 0L; + ptr_ = 0L; + allocationId_ = 0L; + allocatorName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawAllocation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawAllocation getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogRawAllocation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawAllocation build() { + org.tensorflow.proto.MemoryLogRawAllocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawAllocation buildPartial() { + org.tensorflow.proto.MemoryLogRawAllocation result = new org.tensorflow.proto.MemoryLogRawAllocation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogRawAllocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepId_ = stepId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.numBytes_ = numBytes_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ptr_ = ptr_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allocationId_ = allocationId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.allocatorName_ = allocatorName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogRawAllocation) { + return mergeFrom((org.tensorflow.proto.MemoryLogRawAllocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogRawAllocation other) { + if (other == org.tensorflow.proto.MemoryLogRawAllocation.getDefaultInstance()) return this; + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getNumBytes() != 0L) { + setNumBytes(other.getNumBytes()); + } + if (other.getPtr() != 0L) { + setPtr(other.getPtr()); + } + if (other.getAllocationId() != 0L) { + setAllocationId(other.getAllocationId()); + } + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + stepId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + numBytes_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + ptr_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + allocationId_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long stepId_ ; + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000001); + stepId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object operation_ = ""; + /** + *
    +     * Name of the operation making the allocation.
    +     * 
    + * + * string operation = 2; + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the operation making the allocation.
    +     * 
    + * + * string operation = 2; + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the operation making the allocation.
    +     * 
    + * + * string operation = 2; + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + operation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the operation making the allocation.
    +     * 
    + * + * string operation = 2; + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the operation making the allocation.
    +     * 
    + * + * string operation = 2; + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long numBytes_ ; + /** + *
    +     * Number of bytes in the allocation.
    +     * 
    + * + * int64 num_bytes = 3; + * @return The numBytes. + */ + @java.lang.Override + public long getNumBytes() { + return numBytes_; + } + /** + *
    +     * Number of bytes in the allocation.
    +     * 
    + * + * int64 num_bytes = 3; + * @param value The numBytes to set. + * @return This builder for chaining. + */ + public Builder setNumBytes(long value) { + + numBytes_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Number of bytes in the allocation.
    +     * 
    + * + * int64 num_bytes = 3; + * @return This builder for chaining. + */ + public Builder clearNumBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + numBytes_ = 0L; + onChanged(); + return this; + } + + private long ptr_ ; + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 4; + * @return The ptr. + */ + @java.lang.Override + public long getPtr() { + return ptr_; + } + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 4; + * @param value The ptr to set. + * @return This builder for chaining. + */ + public Builder setPtr(long value) { + + ptr_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Address of the allocation.
    +     * 
    + * + * uint64 ptr = 4; + * @return This builder for chaining. + */ + public Builder clearPtr() { + bitField0_ = (bitField0_ & ~0x00000008); + ptr_ = 0L; + onChanged(); + return this; + } + + private long allocationId_ ; + /** + *
    +     * Id of the tensor buffer being allocated, used to match to a
    +     * corresponding deallocation.
    +     * 
    + * + * int64 allocation_id = 5; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + /** + *
    +     * Id of the tensor buffer being allocated, used to match to a
    +     * corresponding deallocation.
    +     * 
    + * + * int64 allocation_id = 5; + * @param value The allocationId to set. + * @return This builder for chaining. + */ + public Builder setAllocationId(long value) { + + allocationId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Id of the tensor buffer being allocated, used to match to a
    +     * corresponding deallocation.
    +     * 
    + * + * int64 allocation_id = 5; + * @return This builder for chaining. + */ + public Builder clearAllocationId() { + bitField0_ = (bitField0_ & ~0x00000010); + allocationId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object allocatorName_ = ""; + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 6; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 6; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 6; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 6; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 6; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogRawAllocation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogRawAllocation) + private static final org.tensorflow.proto.MemoryLogRawAllocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogRawAllocation(); + } + + public static org.tensorflow.proto.MemoryLogRawAllocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogRawAllocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogRawAllocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocationOrBuilder.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocationOrBuilder.java index d8cabb6c9d4..82a9160572d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawAllocationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawAllocationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogRawAllocationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogRawAllocation) @@ -13,6 +15,7 @@ public interface MemoryLogRawAllocationOrBuilder extends *
    * * int64 step_id = 1; + * @return The stepId. */ long getStepId(); @@ -22,6 +25,7 @@ public interface MemoryLogRawAllocationOrBuilder extends *
    * * string operation = 2; + * @return The operation. */ java.lang.String getOperation(); /** @@ -30,6 +34,7 @@ public interface MemoryLogRawAllocationOrBuilder extends *
    * * string operation = 2; + * @return The bytes for operation. */ com.google.protobuf.ByteString getOperationBytes(); @@ -40,6 +45,7 @@ public interface MemoryLogRawAllocationOrBuilder extends *
    * * int64 num_bytes = 3; + * @return The numBytes. */ long getNumBytes(); @@ -49,6 +55,7 @@ public interface MemoryLogRawAllocationOrBuilder extends *
    * * uint64 ptr = 4; + * @return The ptr. */ long getPtr(); @@ -59,6 +66,7 @@ public interface MemoryLogRawAllocationOrBuilder extends * * * int64 allocation_id = 5; + * @return The allocationId. */ long getAllocationId(); @@ -68,6 +76,7 @@ public interface MemoryLogRawAllocationOrBuilder extends * * * string allocator_name = 6; + * @return The allocatorName. */ java.lang.String getAllocatorName(); /** @@ -76,6 +85,7 @@ public interface MemoryLogRawAllocationOrBuilder extends * * * string allocator_name = 6; + * @return The bytes for allocatorName. */ com.google.protobuf.ByteString getAllocatorNameBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocation.java new file mode 100644 index 00000000000..1215138ec89 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocation.java @@ -0,0 +1,950 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryLogRawDeallocation} + */ +public final class MemoryLogRawDeallocation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogRawDeallocation) + MemoryLogRawDeallocationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryLogRawDeallocation.class.getName()); + } + // Use MemoryLogRawDeallocation.newBuilder() to construct. + private MemoryLogRawDeallocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryLogRawDeallocation() { + operation_ = ""; + allocatorName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogRawDeallocation.class, org.tensorflow.proto.MemoryLogRawDeallocation.Builder.class); + } + + public static final int STEP_ID_FIELD_NUMBER = 1; + private long stepId_ = 0L; + /** + *
    +   * Process-unique step id.
    +   * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + public static final int OPERATION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** + *
    +   * Name of the operation making the deallocation.
    +   * 
    + * + * string operation = 2; + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + *
    +   * Name of the operation making the deallocation.
    +   * 
    + * + * string operation = 2; + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOCATION_ID_FIELD_NUMBER = 3; + private long allocationId_ = 0L; + /** + *
    +   * Id of the tensor buffer being deallocated, used to match to a
    +   * corresponding allocation.
    +   * 
    + * + * int64 allocation_id = 3; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 4; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 4; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFERRED_FIELD_NUMBER = 5; + private boolean deferred_ = false; + /** + *
    +   * True if the deallocation is queued and will be performed later,
    +   * e.g. for GPU lazy freeing of buffers.
    +   * 
    + * + * bool deferred = 5; + * @return The deferred. + */ + @java.lang.Override + public boolean getDeferred() { + return deferred_; + } + + 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 (stepId_ != 0L) { + output.writeInt64(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, operation_); + } + if (allocationId_ != 0L) { + output.writeInt64(3, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, allocatorName_); + } + if (deferred_ != false) { + output.writeBool(5, deferred_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, operation_); + } + if (allocationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, allocatorName_); + } + if (deferred_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, deferred_); + } + size += getUnknownFields().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.MemoryLogRawDeallocation)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogRawDeallocation other = (org.tensorflow.proto.MemoryLogRawDeallocation) obj; + + if (getStepId() + != other.getStepId()) return false; + if (!getOperation() + .equals(other.getOperation())) return false; + if (getAllocationId() + != other.getAllocationId()) return false; + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (getDeferred() + != other.getDeferred()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (37 * hash) + ALLOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocationId()); + hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + hash = (37 * hash) + DEFERRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDeferred()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation 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.MemoryLogRawDeallocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogRawDeallocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogRawDeallocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogRawDeallocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogRawDeallocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogRawDeallocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogRawDeallocation) + org.tensorflow.proto.MemoryLogRawDeallocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogRawDeallocation.class, org.tensorflow.proto.MemoryLogRawDeallocation.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogRawDeallocation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepId_ = 0L; + operation_ = ""; + allocationId_ = 0L; + allocatorName_ = ""; + deferred_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogRawDeallocation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawDeallocation getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogRawDeallocation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawDeallocation build() { + org.tensorflow.proto.MemoryLogRawDeallocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogRawDeallocation buildPartial() { + org.tensorflow.proto.MemoryLogRawDeallocation result = new org.tensorflow.proto.MemoryLogRawDeallocation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogRawDeallocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepId_ = stepId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allocationId_ = allocationId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allocatorName_ = allocatorName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deferred_ = deferred_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogRawDeallocation) { + return mergeFrom((org.tensorflow.proto.MemoryLogRawDeallocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogRawDeallocation other) { + if (other == org.tensorflow.proto.MemoryLogRawDeallocation.getDefaultInstance()) return this; + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getAllocationId() != 0L) { + setAllocationId(other.getAllocationId()); + } + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getDeferred() != false) { + setDeferred(other.getDeferred()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + stepId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + allocationId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + deferred_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long stepId_ ; + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000001); + stepId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object operation_ = ""; + /** + *
    +     * Name of the operation making the deallocation.
    +     * 
    + * + * string operation = 2; + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the operation making the deallocation.
    +     * 
    + * + * string operation = 2; + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the operation making the deallocation.
    +     * 
    + * + * string operation = 2; + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + operation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the operation making the deallocation.
    +     * 
    + * + * string operation = 2; + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the operation making the deallocation.
    +     * 
    + * + * string operation = 2; + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long allocationId_ ; + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 3; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 3; + * @param value The allocationId to set. + * @return This builder for chaining. + */ + public Builder setAllocationId(long value) { + + allocationId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 3; + * @return This builder for chaining. + */ + public Builder clearAllocationId() { + bitField0_ = (bitField0_ & ~0x00000004); + allocationId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object allocatorName_ = ""; + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 4; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 4; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 4; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 4; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 4; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean deferred_ ; + /** + *
    +     * True if the deallocation is queued and will be performed later,
    +     * e.g. for GPU lazy freeing of buffers.
    +     * 
    + * + * bool deferred = 5; + * @return The deferred. + */ + @java.lang.Override + public boolean getDeferred() { + return deferred_; + } + /** + *
    +     * True if the deallocation is queued and will be performed later,
    +     * e.g. for GPU lazy freeing of buffers.
    +     * 
    + * + * bool deferred = 5; + * @param value The deferred to set. + * @return This builder for chaining. + */ + public Builder setDeferred(boolean value) { + + deferred_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * True if the deallocation is queued and will be performed later,
    +     * e.g. for GPU lazy freeing of buffers.
    +     * 
    + * + * bool deferred = 5; + * @return This builder for chaining. + */ + public Builder clearDeferred() { + bitField0_ = (bitField0_ & ~0x00000010); + deferred_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogRawDeallocation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogRawDeallocation) + private static final org.tensorflow.proto.MemoryLogRawDeallocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogRawDeallocation(); + } + + public static org.tensorflow.proto.MemoryLogRawDeallocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogRawDeallocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogRawDeallocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocationOrBuilder.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocationOrBuilder.java index e8f66fff55c..485bb3ff60d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogRawDeallocationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogRawDeallocationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogRawDeallocationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogRawDeallocation) @@ -13,6 +15,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * int64 step_id = 1; + * @return The stepId. */ long getStepId(); @@ -22,6 +25,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * string operation = 2; + * @return The operation. */ java.lang.String getOperation(); /** @@ -30,6 +34,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * string operation = 2; + * @return The bytes for operation. */ com.google.protobuf.ByteString getOperationBytes(); @@ -41,6 +46,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * int64 allocation_id = 3; + * @return The allocationId. */ long getAllocationId(); @@ -50,6 +56,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * string allocator_name = 4; + * @return The allocatorName. */ java.lang.String getAllocatorName(); /** @@ -58,6 +65,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * string allocator_name = 4; + * @return The bytes for allocatorName. */ com.google.protobuf.ByteString getAllocatorNameBytes(); @@ -69,6 +77,7 @@ public interface MemoryLogRawDeallocationOrBuilder extends * * * bool deferred = 5; + * @return The deferred. */ boolean getDeferred(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStep.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStep.java new file mode 100644 index 00000000000..0f191d9751d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStep.java @@ -0,0 +1,612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryLogStep} + */ +public final class MemoryLogStep extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogStep) + MemoryLogStepOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryLogStep.class.getName()); + } + // Use MemoryLogStep.newBuilder() to construct. + private MemoryLogStep(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryLogStep() { + handle_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogStep.class, org.tensorflow.proto.MemoryLogStep.Builder.class); + } + + public static final int STEP_ID_FIELD_NUMBER = 1; + private long stepId_ = 0L; + /** + *
    +   * Process-unique step id.
    +   * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + public static final int HANDLE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object handle_ = ""; + /** + *
    +   * Handle describing the feeds and fetches of the step.
    +   * 
    + * + * string handle = 2; + * @return The handle. + */ + @java.lang.Override + public java.lang.String getHandle() { + java.lang.Object ref = handle_; + 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(); + handle_ = s; + return s; + } + } + /** + *
    +   * Handle describing the feeds and fetches of the step.
    +   * 
    + * + * string handle = 2; + * @return The bytes for handle. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHandleBytes() { + java.lang.Object ref = handle_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + handle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (stepId_ != 0L) { + output.writeInt64(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(handle_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, handle_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(handle_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, handle_); + } + size += getUnknownFields().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.MemoryLogStep)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogStep other = (org.tensorflow.proto.MemoryLogStep) obj; + + if (getStepId() + != other.getStepId()) return false; + if (!getHandle() + .equals(other.getHandle())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (37 * hash) + HANDLE_FIELD_NUMBER; + hash = (53 * hash) + getHandle().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogStep parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogStep 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.MemoryLogStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogStep 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.MemoryLogStep parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogStep parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogStep parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogStep parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogStep parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogStep parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogStep parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogStep parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogStep 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogStep} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogStep) + org.tensorflow.proto.MemoryLogStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogStep.class, org.tensorflow.proto.MemoryLogStep.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogStep.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepId_ = 0L; + handle_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogStep_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogStep getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogStep.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogStep build() { + org.tensorflow.proto.MemoryLogStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogStep buildPartial() { + org.tensorflow.proto.MemoryLogStep result = new org.tensorflow.proto.MemoryLogStep(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogStep result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepId_ = stepId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.handle_ = handle_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogStep) { + return mergeFrom((org.tensorflow.proto.MemoryLogStep)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogStep other) { + if (other == org.tensorflow.proto.MemoryLogStep.getDefaultInstance()) return this; + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + if (!other.getHandle().isEmpty()) { + handle_ = other.handle_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + stepId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + handle_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long stepId_ ; + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000001); + stepId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object handle_ = ""; + /** + *
    +     * Handle describing the feeds and fetches of the step.
    +     * 
    + * + * string handle = 2; + * @return The handle. + */ + public java.lang.String getHandle() { + java.lang.Object ref = handle_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + handle_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Handle describing the feeds and fetches of the step.
    +     * 
    + * + * string handle = 2; + * @return The bytes for handle. + */ + public com.google.protobuf.ByteString + getHandleBytes() { + java.lang.Object ref = handle_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + handle_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Handle describing the feeds and fetches of the step.
    +     * 
    + * + * string handle = 2; + * @param value The handle to set. + * @return This builder for chaining. + */ + public Builder setHandle( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + handle_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Handle describing the feeds and fetches of the step.
    +     * 
    + * + * string handle = 2; + * @return This builder for chaining. + */ + public Builder clearHandle() { + handle_ = getDefaultInstance().getHandle(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Handle describing the feeds and fetches of the step.
    +     * 
    + * + * string handle = 2; + * @param value The bytes for handle to set. + * @return This builder for chaining. + */ + public Builder setHandleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + handle_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogStep) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogStep) + private static final org.tensorflow.proto.MemoryLogStep DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogStep(); + } + + public static org.tensorflow.proto.MemoryLogStep getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogStep parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogStep getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStepOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStepOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStepOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStepOrBuilder.java index 3e8a13645c1..39d7ad3312b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogStepOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogStepOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogStepOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogStep) @@ -13,6 +15,7 @@ public interface MemoryLogStepOrBuilder extends * * * int64 step_id = 1; + * @return The stepId. */ long getStepId(); @@ -22,6 +25,7 @@ public interface MemoryLogStepOrBuilder extends * * * string handle = 2; + * @return The handle. */ java.lang.String getHandle(); /** @@ -30,6 +34,7 @@ public interface MemoryLogStepOrBuilder extends * * * string handle = 2; + * @return The bytes for handle. */ com.google.protobuf.ByteString getHandleBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocation.java new file mode 100644 index 00000000000..a2f153d0515 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocation.java @@ -0,0 +1,860 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryLogTensorAllocation} + */ +public final class MemoryLogTensorAllocation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorAllocation) + MemoryLogTensorAllocationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryLogTensorAllocation.class.getName()); + } + // Use MemoryLogTensorAllocation.newBuilder() to construct. + private MemoryLogTensorAllocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryLogTensorAllocation() { + kernelName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogTensorAllocation.class, org.tensorflow.proto.MemoryLogTensorAllocation.Builder.class); + } + + private int bitField0_; + public static final int STEP_ID_FIELD_NUMBER = 1; + private long stepId_ = 0L; + /** + *
    +   * Process-unique step id.
    +   * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + public static final int KERNEL_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object kernelName_ = ""; + /** + *
    +   * Name of the kernel making the allocation as set in GraphDef,
    +   * e.g., "affine2/weights/Assign".
    +   * 
    + * + * string kernel_name = 2; + * @return The kernelName. + */ + @java.lang.Override + public java.lang.String getKernelName() { + java.lang.Object ref = kernelName_; + 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(); + kernelName_ = s; + return s; + } + } + /** + *
    +   * Name of the kernel making the allocation as set in GraphDef,
    +   * e.g., "affine2/weights/Assign".
    +   * 
    + * + * string kernel_name = 2; + * @return The bytes for kernelName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKernelNameBytes() { + java.lang.Object ref = kernelName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kernelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENSOR_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorDescription tensor_; + /** + *
    +   * Allocated tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 3; + * @return Whether the tensor field is set. + */ + @java.lang.Override + public boolean hasTensor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Allocated tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 3; + * @return The tensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescription getTensor() { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + /** + *
    +   * Allocated tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder() { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + + 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 (stepId_ != 0L) { + output.writeInt64(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kernelName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kernelName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTensor()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kernelName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kernelName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTensor()); + } + size += getUnknownFields().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.MemoryLogTensorAllocation)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogTensorAllocation other = (org.tensorflow.proto.MemoryLogTensorAllocation) obj; + + if (getStepId() + != other.getStepId()) return false; + if (!getKernelName() + .equals(other.getKernelName())) return false; + if (hasTensor() != other.hasTensor()) return false; + if (hasTensor()) { + if (!getTensor() + .equals(other.getTensor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (37 * hash) + KERNEL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKernelName().hashCode(); + if (hasTensor()) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensor().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation 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.MemoryLogTensorAllocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogTensorAllocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogTensorAllocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorAllocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogTensorAllocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogTensorAllocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorAllocation) + org.tensorflow.proto.MemoryLogTensorAllocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogTensorAllocation.class, org.tensorflow.proto.MemoryLogTensorAllocation.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogTensorAllocation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepId_ = 0L; + kernelName_ = ""; + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorAllocation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorAllocation getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogTensorAllocation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorAllocation build() { + org.tensorflow.proto.MemoryLogTensorAllocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorAllocation buildPartial() { + org.tensorflow.proto.MemoryLogTensorAllocation result = new org.tensorflow.proto.MemoryLogTensorAllocation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogTensorAllocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepId_ = stepId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kernelName_ = kernelName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tensor_ = tensorBuilder_ == null + ? tensor_ + : tensorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogTensorAllocation) { + return mergeFrom((org.tensorflow.proto.MemoryLogTensorAllocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogTensorAllocation other) { + if (other == org.tensorflow.proto.MemoryLogTensorAllocation.getDefaultInstance()) return this; + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + if (!other.getKernelName().isEmpty()) { + kernelName_ = other.kernelName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasTensor()) { + mergeTensor(other.getTensor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + stepId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + kernelName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getTensorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long stepId_ ; + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000001); + stepId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kernelName_ = ""; + /** + *
    +     * Name of the kernel making the allocation as set in GraphDef,
    +     * e.g., "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return The kernelName. + */ + public java.lang.String getKernelName() { + java.lang.Object ref = kernelName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kernelName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the kernel making the allocation as set in GraphDef,
    +     * e.g., "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return The bytes for kernelName. + */ + public com.google.protobuf.ByteString + getKernelNameBytes() { + java.lang.Object ref = kernelName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kernelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the kernel making the allocation as set in GraphDef,
    +     * e.g., "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @param value The kernelName to set. + * @return This builder for chaining. + */ + public Builder setKernelName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + kernelName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the kernel making the allocation as set in GraphDef,
    +     * e.g., "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return This builder for chaining. + */ + public Builder clearKernelName() { + kernelName_ = getDefaultInstance().getKernelName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the kernel making the allocation as set in GraphDef,
    +     * e.g., "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @param value The bytes for kernelName to set. + * @return This builder for chaining. + */ + public Builder setKernelNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + kernelName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorDescription tensor_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> tensorBuilder_; + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + * @return Whether the tensor field is set. + */ + public boolean hasTensor() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + * @return The tensor. + */ + public org.tensorflow.proto.TensorDescription getTensor() { + if (tensorBuilder_ == null) { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } else { + return tensorBuilder_.getMessage(); + } + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public Builder setTensor(org.tensorflow.proto.TensorDescription value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensor_ = value; + } else { + tensorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public Builder setTensor( + org.tensorflow.proto.TensorDescription.Builder builderForValue) { + if (tensorBuilder_ == null) { + tensor_ = builderForValue.build(); + } else { + tensorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public Builder mergeTensor(org.tensorflow.proto.TensorDescription value) { + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + tensor_ != null && + tensor_ != org.tensorflow.proto.TensorDescription.getDefaultInstance()) { + getTensorBuilder().mergeFrom(value); + } else { + tensor_ = value; + } + } else { + tensorBuilder_.mergeFrom(value); + } + if (tensor_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public Builder clearTensor() { + bitField0_ = (bitField0_ & ~0x00000004); + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public org.tensorflow.proto.TensorDescription.Builder getTensorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getTensorFieldBuilder().getBuilder(); + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilder(); + } else { + return tensor_ == null ? + org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + } + /** + *
    +     * Allocated tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder>( + getTensor(), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogTensorAllocation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorAllocation) + private static final org.tensorflow.proto.MemoryLogTensorAllocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogTensorAllocation(); + } + + public static org.tensorflow.proto.MemoryLogTensorAllocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogTensorAllocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogTensorAllocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocationOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocationOrBuilder.java index 1b3a3732149..c8c3c7dd79f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorAllocationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorAllocationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogTensorAllocationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogTensorAllocation) @@ -13,6 +15,7 @@ public interface MemoryLogTensorAllocationOrBuilder extends * * * int64 step_id = 1; + * @return The stepId. */ long getStepId(); @@ -23,6 +26,7 @@ public interface MemoryLogTensorAllocationOrBuilder extends * * * string kernel_name = 2; + * @return The kernelName. */ java.lang.String getKernelName(); /** @@ -32,6 +36,7 @@ public interface MemoryLogTensorAllocationOrBuilder extends * * * string kernel_name = 2; + * @return The bytes for kernelName. */ com.google.protobuf.ByteString getKernelNameBytes(); @@ -42,6 +47,7 @@ public interface MemoryLogTensorAllocationOrBuilder extends * * * .tensorflow.TensorDescription tensor = 3; + * @return Whether the tensor field is set. */ boolean hasTensor(); /** @@ -50,8 +56,9 @@ public interface MemoryLogTensorAllocationOrBuilder extends * * * .tensorflow.TensorDescription tensor = 3; + * @return The tensor. */ - org.tensorflow.proto.framework.TensorDescription getTensor(); + org.tensorflow.proto.TensorDescription getTensor(); /** *
        * Allocated tensor details.
    @@ -59,5 +66,5 @@ public interface MemoryLogTensorAllocationOrBuilder extends
        *
        * .tensorflow.TensorDescription tensor = 3;
        */
    -  org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder();
    +  org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocation.java
    new file mode 100644
    index 00000000000..2cd7114b7f1
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocation.java
    @@ -0,0 +1,616 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/log_memory.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.MemoryLogTensorDeallocation}
    + */
    +public final class MemoryLogTensorDeallocation extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorDeallocation)
    +    MemoryLogTensorDeallocationOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      MemoryLogTensorDeallocation.class.getName());
    +  }
    +  // Use MemoryLogTensorDeallocation.newBuilder() to construct.
    +  private MemoryLogTensorDeallocation(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private MemoryLogTensorDeallocation() {
    +    allocatorName_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.MemoryLogTensorDeallocation.class, org.tensorflow.proto.MemoryLogTensorDeallocation.Builder.class);
    +  }
    +
    +  public static final int ALLOCATION_ID_FIELD_NUMBER = 1;
    +  private long allocationId_ = 0L;
    +  /**
    +   * 
    +   * Id of the tensor buffer being deallocated, used to match to a
    +   * corresponding allocation.
    +   * 
    + * + * int64 allocation_id = 1; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + + public static final int ALLOCATOR_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object allocatorName_ = ""; + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 2; + * @return The allocatorName. + */ + @java.lang.Override + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + 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(); + allocatorName_ = s; + return s; + } + } + /** + *
    +   * Name of the allocator used.
    +   * 
    + * + * string allocator_name = 2; + * @return The bytes for allocatorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (allocationId_ != 0L) { + output.writeInt64(1, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, allocatorName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (allocationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, allocationId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(allocatorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, allocatorName_); + } + size += getUnknownFields().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.MemoryLogTensorDeallocation)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogTensorDeallocation other = (org.tensorflow.proto.MemoryLogTensorDeallocation) obj; + + if (getAllocationId() + != other.getAllocationId()) return false; + if (!getAllocatorName() + .equals(other.getAllocatorName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALLOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllocationId()); + hash = (37 * hash) + ALLOCATOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAllocatorName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation 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.MemoryLogTensorDeallocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorDeallocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogTensorDeallocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogTensorDeallocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorDeallocation) + org.tensorflow.proto.MemoryLogTensorDeallocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogTensorDeallocation.class, org.tensorflow.proto.MemoryLogTensorDeallocation.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogTensorDeallocation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allocationId_ = 0L; + allocatorName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorDeallocation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorDeallocation getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogTensorDeallocation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorDeallocation build() { + org.tensorflow.proto.MemoryLogTensorDeallocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorDeallocation buildPartial() { + org.tensorflow.proto.MemoryLogTensorDeallocation result = new org.tensorflow.proto.MemoryLogTensorDeallocation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogTensorDeallocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.allocationId_ = allocationId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allocatorName_ = allocatorName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogTensorDeallocation) { + return mergeFrom((org.tensorflow.proto.MemoryLogTensorDeallocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogTensorDeallocation other) { + if (other == org.tensorflow.proto.MemoryLogTensorDeallocation.getDefaultInstance()) return this; + if (other.getAllocationId() != 0L) { + setAllocationId(other.getAllocationId()); + } + if (!other.getAllocatorName().isEmpty()) { + allocatorName_ = other.allocatorName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + allocationId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + allocatorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long allocationId_ ; + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 1; + * @return The allocationId. + */ + @java.lang.Override + public long getAllocationId() { + return allocationId_; + } + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 1; + * @param value The allocationId to set. + * @return This builder for chaining. + */ + public Builder setAllocationId(long value) { + + allocationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Id of the tensor buffer being deallocated, used to match to a
    +     * corresponding allocation.
    +     * 
    + * + * int64 allocation_id = 1; + * @return This builder for chaining. + */ + public Builder clearAllocationId() { + bitField0_ = (bitField0_ & ~0x00000001); + allocationId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object allocatorName_ = ""; + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 2; + * @return The allocatorName. + */ + public java.lang.String getAllocatorName() { + java.lang.Object ref = allocatorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + allocatorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 2; + * @return The bytes for allocatorName. + */ + public com.google.protobuf.ByteString + getAllocatorNameBytes() { + java.lang.Object ref = allocatorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + allocatorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 2; + * @param value The allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + allocatorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 2; + * @return This builder for chaining. + */ + public Builder clearAllocatorName() { + allocatorName_ = getDefaultInstance().getAllocatorName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the allocator used.
    +     * 
    + * + * string allocator_name = 2; + * @param value The bytes for allocatorName to set. + * @return This builder for chaining. + */ + public Builder setAllocatorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + allocatorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogTensorDeallocation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorDeallocation) + private static final org.tensorflow.proto.MemoryLogTensorDeallocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogTensorDeallocation(); + } + + public static org.tensorflow.proto.MemoryLogTensorDeallocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogTensorDeallocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogTensorDeallocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocationOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocationOrBuilder.java index 7d45248a17a..e3e45595114 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorDeallocationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorDeallocationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogTensorDeallocationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogTensorDeallocation) @@ -14,6 +16,7 @@ public interface MemoryLogTensorDeallocationOrBuilder extends *
    * * int64 allocation_id = 1; + * @return The allocationId. */ long getAllocationId(); @@ -23,6 +26,7 @@ public interface MemoryLogTensorDeallocationOrBuilder extends * * * string allocator_name = 2; + * @return The allocatorName. */ java.lang.String getAllocatorName(); /** @@ -31,6 +35,7 @@ public interface MemoryLogTensorDeallocationOrBuilder extends * * * string allocator_name = 2; + * @return The bytes for allocatorName. */ com.google.protobuf.ByteString getAllocatorNameBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutput.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutput.java new file mode 100644 index 00000000000..2916c4a1637 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutput.java @@ -0,0 +1,942 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MemoryLogTensorOutput} + */ +public final class MemoryLogTensorOutput extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryLogTensorOutput) + MemoryLogTensorOutputOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryLogTensorOutput.class.getName()); + } + // Use MemoryLogTensorOutput.newBuilder() to construct. + private MemoryLogTensorOutput(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryLogTensorOutput() { + kernelName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogTensorOutput.class, org.tensorflow.proto.MemoryLogTensorOutput.Builder.class); + } + + private int bitField0_; + public static final int STEP_ID_FIELD_NUMBER = 1; + private long stepId_ = 0L; + /** + *
    +   * Process-unique step id.
    +   * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + + public static final int KERNEL_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object kernelName_ = ""; + /** + *
    +   * Name of the kernel producing an output as set in GraphDef, e.g.,
    +   * "affine2/weights/Assign".
    +   * 
    + * + * string kernel_name = 2; + * @return The kernelName. + */ + @java.lang.Override + public java.lang.String getKernelName() { + java.lang.Object ref = kernelName_; + 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(); + kernelName_ = s; + return s; + } + } + /** + *
    +   * Name of the kernel producing an output as set in GraphDef, e.g.,
    +   * "affine2/weights/Assign".
    +   * 
    + * + * string kernel_name = 2; + * @return The bytes for kernelName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKernelNameBytes() { + java.lang.Object ref = kernelName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kernelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 3; + private int index_ = 0; + /** + *
    +   * Index of the output being set.
    +   * 
    + * + * int32 index = 3; + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + + public static final int TENSOR_FIELD_NUMBER = 4; + private org.tensorflow.proto.TensorDescription tensor_; + /** + *
    +   * Output tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 4; + * @return Whether the tensor field is set. + */ + @java.lang.Override + public boolean hasTensor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Output tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 4; + * @return The tensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescription getTensor() { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + /** + *
    +   * Output tensor details.
    +   * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder() { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + + 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 (stepId_ != 0L) { + output.writeInt64(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kernelName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, kernelName_); + } + if (index_ != 0) { + output.writeInt32(3, index_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getTensor()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stepId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, stepId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kernelName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, kernelName_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, index_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getTensor()); + } + size += getUnknownFields().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.MemoryLogTensorOutput)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryLogTensorOutput other = (org.tensorflow.proto.MemoryLogTensorOutput) obj; + + if (getStepId() + != other.getStepId()) return false; + if (!getKernelName() + .equals(other.getKernelName())) return false; + if (getIndex() + != other.getIndex()) return false; + if (hasTensor() != other.hasTensor()) return false; + if (hasTensor()) { + if (!getTensor() + .equals(other.getTensor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STEP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStepId()); + hash = (37 * hash) + KERNEL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKernelName().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + if (hasTensor()) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensor().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorOutput 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.MemoryLogTensorOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryLogTensorOutput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryLogTensorOutput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryLogTensorOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryLogTensorOutput 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MemoryLogTensorOutput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryLogTensorOutput) + org.tensorflow.proto.MemoryLogTensorOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryLogTensorOutput.class, org.tensorflow.proto.MemoryLogTensorOutput.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryLogTensorOutput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepId_ = 0L; + kernelName_ = ""; + index_ = 0; + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.LogMemoryProtos.internal_static_tensorflow_MemoryLogTensorOutput_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorOutput getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryLogTensorOutput.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorOutput build() { + org.tensorflow.proto.MemoryLogTensorOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryLogTensorOutput buildPartial() { + org.tensorflow.proto.MemoryLogTensorOutput result = new org.tensorflow.proto.MemoryLogTensorOutput(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryLogTensorOutput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepId_ = stepId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kernelName_ = kernelName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.index_ = index_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tensor_ = tensorBuilder_ == null + ? tensor_ + : tensorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryLogTensorOutput) { + return mergeFrom((org.tensorflow.proto.MemoryLogTensorOutput)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryLogTensorOutput other) { + if (other == org.tensorflow.proto.MemoryLogTensorOutput.getDefaultInstance()) return this; + if (other.getStepId() != 0L) { + setStepId(other.getStepId()); + } + if (!other.getKernelName().isEmpty()) { + kernelName_ = other.kernelName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + if (other.hasTensor()) { + mergeTensor(other.getTensor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + stepId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + kernelName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + index_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getTensorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long stepId_ ; + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return The stepId. + */ + @java.lang.Override + public long getStepId() { + return stepId_; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @param value The stepId to set. + * @return This builder for chaining. + */ + public Builder setStepId(long value) { + + stepId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Process-unique step id.
    +     * 
    + * + * int64 step_id = 1; + * @return This builder for chaining. + */ + public Builder clearStepId() { + bitField0_ = (bitField0_ & ~0x00000001); + stepId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object kernelName_ = ""; + /** + *
    +     * Name of the kernel producing an output as set in GraphDef, e.g.,
    +     * "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return The kernelName. + */ + public java.lang.String getKernelName() { + java.lang.Object ref = kernelName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kernelName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the kernel producing an output as set in GraphDef, e.g.,
    +     * "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return The bytes for kernelName. + */ + public com.google.protobuf.ByteString + getKernelNameBytes() { + java.lang.Object ref = kernelName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kernelName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the kernel producing an output as set in GraphDef, e.g.,
    +     * "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @param value The kernelName to set. + * @return This builder for chaining. + */ + public Builder setKernelName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + kernelName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the kernel producing an output as set in GraphDef, e.g.,
    +     * "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @return This builder for chaining. + */ + public Builder clearKernelName() { + kernelName_ = getDefaultInstance().getKernelName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the kernel producing an output as set in GraphDef, e.g.,
    +     * "affine2/weights/Assign".
    +     * 
    + * + * string kernel_name = 2; + * @param value The bytes for kernelName to set. + * @return This builder for chaining. + */ + public Builder setKernelNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + kernelName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int index_ ; + /** + *
    +     * Index of the output being set.
    +     * 
    + * + * int32 index = 3; + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + /** + *
    +     * Index of the output being set.
    +     * 
    + * + * int32 index = 3; + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + index_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Index of the output being set.
    +     * 
    + * + * int32 index = 3; + * @return This builder for chaining. + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + index_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorDescription tensor_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> tensorBuilder_; + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + * @return Whether the tensor field is set. + */ + public boolean hasTensor() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + * @return The tensor. + */ + public org.tensorflow.proto.TensorDescription getTensor() { + if (tensorBuilder_ == null) { + return tensor_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } else { + return tensorBuilder_.getMessage(); + } + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public Builder setTensor(org.tensorflow.proto.TensorDescription value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensor_ = value; + } else { + tensorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public Builder setTensor( + org.tensorflow.proto.TensorDescription.Builder builderForValue) { + if (tensorBuilder_ == null) { + tensor_ = builderForValue.build(); + } else { + tensorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public Builder mergeTensor(org.tensorflow.proto.TensorDescription value) { + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + tensor_ != null && + tensor_ != org.tensorflow.proto.TensorDescription.getDefaultInstance()) { + getTensorBuilder().mergeFrom(value); + } else { + tensor_ = value; + } + } else { + tensorBuilder_.mergeFrom(value); + } + if (tensor_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public Builder clearTensor() { + bitField0_ = (bitField0_ & ~0x00000008); + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public org.tensorflow.proto.TensorDescription.Builder getTensorBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getTensorFieldBuilder().getBuilder(); + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilder(); + } else { + return tensor_ == null ? + org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensor_; + } + } + /** + *
    +     * Output tensor details.
    +     * 
    + * + * .tensorflow.TensorDescription tensor = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder>( + getTensor(), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryLogTensorOutput) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryLogTensorOutput) + private static final org.tensorflow.proto.MemoryLogTensorOutput DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryLogTensorOutput(); + } + + public static org.tensorflow.proto.MemoryLogTensorOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryLogTensorOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryLogTensorOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutputOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutputOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutputOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutputOrBuilder.java index b9275e22f7e..b85bb1491aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/MemoryLogTensorOutputOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryLogTensorOutputOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/log_memory.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface MemoryLogTensorOutputOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MemoryLogTensorOutput) @@ -13,6 +15,7 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * int64 step_id = 1; + * @return The stepId. */ long getStepId(); @@ -23,6 +26,7 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * string kernel_name = 2; + * @return The kernelName. */ java.lang.String getKernelName(); /** @@ -32,6 +36,7 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * string kernel_name = 2; + * @return The bytes for kernelName. */ com.google.protobuf.ByteString getKernelNameBytes(); @@ -42,6 +47,7 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * int32 index = 3; + * @return The index. */ int getIndex(); @@ -51,6 +57,7 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * .tensorflow.TensorDescription tensor = 4; + * @return Whether the tensor field is set. */ boolean hasTensor(); /** @@ -59,8 +66,9 @@ public interface MemoryLogTensorOutputOrBuilder extends * * * .tensorflow.TensorDescription tensor = 4; + * @return The tensor. */ - org.tensorflow.proto.framework.TensorDescription getTensor(); + org.tensorflow.proto.TensorDescription getTensor(); /** *
        * Output tensor details.
    @@ -68,5 +76,5 @@ public interface MemoryLogTensorOutputOrBuilder extends
        *
        * .tensorflow.TensorDescription tensor = 4;
        */
    -  org.tensorflow.proto.framework.TensorDescriptionOrBuilder getTensorOrBuilder();
    +  org.tensorflow.proto.TensorDescriptionOrBuilder getTensorOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStats.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStats.java
    new file mode 100644
    index 00000000000..dbb3b986b34
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStats.java
    @@ -0,0 +1,1026 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/step_stats.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * For memory tracking.
    + * 
    + * + * Protobuf type {@code tensorflow.MemoryStats} + */ +public final class MemoryStats extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MemoryStats) + MemoryStatsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemoryStats.class.getName()); + } + // Use MemoryStats.newBuilder() to construct. + private MemoryStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MemoryStats() { + persistentTensorAllocIds_ = emptyLongList(); + devicePersistentTensorAllocIds_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_MemoryStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryStats.class, org.tensorflow.proto.MemoryStats.Builder.class); + } + + public static final int TEMP_MEMORY_SIZE_FIELD_NUMBER = 1; + private long tempMemorySize_ = 0L; + /** + * int64 temp_memory_size = 1; + * @return The tempMemorySize. + */ + @java.lang.Override + public long getTempMemorySize() { + return tempMemorySize_; + } + + public static final int PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 3; + private long persistentMemorySize_ = 0L; + /** + * int64 persistent_memory_size = 3; + * @return The persistentMemorySize. + */ + @java.lang.Override + public long getPersistentMemorySize() { + return persistentMemorySize_; + } + + public static final int PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList persistentTensorAllocIds_ = + emptyLongList(); + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return A list containing the persistentTensorAllocIds. + */ + @java.lang.Override + public java.util.List + getPersistentTensorAllocIdsList() { + return persistentTensorAllocIds_; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return The count of persistentTensorAllocIds. + */ + public int getPersistentTensorAllocIdsCount() { + return persistentTensorAllocIds_.size(); + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param index The index of the element to return. + * @return The persistentTensorAllocIds at the given index. + */ + public long getPersistentTensorAllocIds(int index) { + return persistentTensorAllocIds_.getLong(index); + } + private int persistentTensorAllocIdsMemoizedSerializedSize = -1; + + public static final int DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER = 2; + private long deviceTempMemorySize_ = 0L; + /** + * int64 device_temp_memory_size = 2 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=48 + * @return The deviceTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemorySize() { + return deviceTempMemorySize_; + } + + public static final int DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER = 4; + private long devicePersistentMemorySize_ = 0L; + /** + * int64 device_persistent_memory_size = 4 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=49 + * @return The devicePersistentMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemorySize() { + return devicePersistentMemorySize_; + } + + public static final int DEVICE_PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList devicePersistentTensorAllocIds_ = + emptyLongList(); + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return A list containing the devicePersistentTensorAllocIds. + */ + @java.lang.Override + @java.lang.Deprecated public java.util.List + getDevicePersistentTensorAllocIdsList() { + return devicePersistentTensorAllocIds_; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return The count of devicePersistentTensorAllocIds. + */ + @java.lang.Deprecated public int getDevicePersistentTensorAllocIdsCount() { + return devicePersistentTensorAllocIds_.size(); + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param index The index of the element to return. + * @return The devicePersistentTensorAllocIds at the given index. + */ + @java.lang.Deprecated public long getDevicePersistentTensorAllocIds(int index) { + return devicePersistentTensorAllocIds_.getLong(index); + } + private int devicePersistentTensorAllocIdsMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (tempMemorySize_ != 0L) { + output.writeInt64(1, tempMemorySize_); + } + if (deviceTempMemorySize_ != 0L) { + output.writeInt64(2, deviceTempMemorySize_); + } + if (persistentMemorySize_ != 0L) { + output.writeInt64(3, persistentMemorySize_); + } + if (devicePersistentMemorySize_ != 0L) { + output.writeInt64(4, devicePersistentMemorySize_); + } + if (getPersistentTensorAllocIdsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(persistentTensorAllocIdsMemoizedSerializedSize); + } + for (int i = 0; i < persistentTensorAllocIds_.size(); i++) { + output.writeInt64NoTag(persistentTensorAllocIds_.getLong(i)); + } + if (getDevicePersistentTensorAllocIdsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(devicePersistentTensorAllocIdsMemoizedSerializedSize); + } + for (int i = 0; i < devicePersistentTensorAllocIds_.size(); i++) { + output.writeInt64NoTag(devicePersistentTensorAllocIds_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tempMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, tempMemorySize_); + } + if (deviceTempMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, deviceTempMemorySize_); + } + if (persistentMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, persistentMemorySize_); + } + if (devicePersistentMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, devicePersistentMemorySize_); + } + { + int dataSize = 0; + for (int i = 0; i < persistentTensorAllocIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(persistentTensorAllocIds_.getLong(i)); + } + size += dataSize; + if (!getPersistentTensorAllocIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + persistentTensorAllocIdsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < devicePersistentTensorAllocIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(devicePersistentTensorAllocIds_.getLong(i)); + } + size += dataSize; + if (!getDevicePersistentTensorAllocIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + devicePersistentTensorAllocIdsMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.MemoryStats)) { + return super.equals(obj); + } + org.tensorflow.proto.MemoryStats other = (org.tensorflow.proto.MemoryStats) obj; + + if (getTempMemorySize() + != other.getTempMemorySize()) return false; + if (getPersistentMemorySize() + != other.getPersistentMemorySize()) return false; + if (!getPersistentTensorAllocIdsList() + .equals(other.getPersistentTensorAllocIdsList())) return false; + if (getDeviceTempMemorySize() + != other.getDeviceTempMemorySize()) return false; + if (getDevicePersistentMemorySize() + != other.getDevicePersistentMemorySize()) return false; + if (!getDevicePersistentTensorAllocIdsList() + .equals(other.getDevicePersistentTensorAllocIdsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TEMP_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTempMemorySize()); + hash = (37 * hash) + PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPersistentMemorySize()); + if (getPersistentTensorAllocIdsCount() > 0) { + hash = (37 * hash) + PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPersistentTensorAllocIdsList().hashCode(); + } + hash = (37 * hash) + DEVICE_TEMP_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDeviceTempMemorySize()); + hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDevicePersistentMemorySize()); + if (getDevicePersistentTensorAllocIdsCount() > 0) { + hash = (37 * hash) + DEVICE_PERSISTENT_TENSOR_ALLOC_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDevicePersistentTensorAllocIdsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MemoryStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryStats 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.MemoryStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryStats 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.MemoryStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MemoryStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MemoryStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MemoryStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MemoryStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MemoryStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MemoryStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MemoryStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * For memory tracking.
    +   * 
    + * + * Protobuf type {@code tensorflow.MemoryStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MemoryStats) + org.tensorflow.proto.MemoryStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_MemoryStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MemoryStats.class, org.tensorflow.proto.MemoryStats.Builder.class); + } + + // Construct using org.tensorflow.proto.MemoryStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tempMemorySize_ = 0L; + persistentMemorySize_ = 0L; + persistentTensorAllocIds_ = emptyLongList(); + deviceTempMemorySize_ = 0L; + devicePersistentMemorySize_ = 0L; + devicePersistentTensorAllocIds_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_MemoryStats_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryStats getDefaultInstanceForType() { + return org.tensorflow.proto.MemoryStats.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MemoryStats build() { + org.tensorflow.proto.MemoryStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MemoryStats buildPartial() { + org.tensorflow.proto.MemoryStats result = new org.tensorflow.proto.MemoryStats(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MemoryStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tempMemorySize_ = tempMemorySize_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.persistentMemorySize_ = persistentMemorySize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + persistentTensorAllocIds_.makeImmutable(); + result.persistentTensorAllocIds_ = persistentTensorAllocIds_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deviceTempMemorySize_ = deviceTempMemorySize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.devicePersistentMemorySize_ = devicePersistentMemorySize_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + devicePersistentTensorAllocIds_.makeImmutable(); + result.devicePersistentTensorAllocIds_ = devicePersistentTensorAllocIds_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MemoryStats) { + return mergeFrom((org.tensorflow.proto.MemoryStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MemoryStats other) { + if (other == org.tensorflow.proto.MemoryStats.getDefaultInstance()) return this; + if (other.getTempMemorySize() != 0L) { + setTempMemorySize(other.getTempMemorySize()); + } + if (other.getPersistentMemorySize() != 0L) { + setPersistentMemorySize(other.getPersistentMemorySize()); + } + if (!other.persistentTensorAllocIds_.isEmpty()) { + if (persistentTensorAllocIds_.isEmpty()) { + persistentTensorAllocIds_ = other.persistentTensorAllocIds_; + persistentTensorAllocIds_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensurePersistentTensorAllocIdsIsMutable(); + persistentTensorAllocIds_.addAll(other.persistentTensorAllocIds_); + } + onChanged(); + } + if (other.getDeviceTempMemorySize() != 0L) { + setDeviceTempMemorySize(other.getDeviceTempMemorySize()); + } + if (other.getDevicePersistentMemorySize() != 0L) { + setDevicePersistentMemorySize(other.getDevicePersistentMemorySize()); + } + if (!other.devicePersistentTensorAllocIds_.isEmpty()) { + if (devicePersistentTensorAllocIds_.isEmpty()) { + devicePersistentTensorAllocIds_ = other.devicePersistentTensorAllocIds_; + devicePersistentTensorAllocIds_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureDevicePersistentTensorAllocIdsIsMutable(); + devicePersistentTensorAllocIds_.addAll(other.devicePersistentTensorAllocIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + tempMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + deviceTempMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 24: { + persistentMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: { + devicePersistentMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 40: { + long v = input.readInt64(); + ensurePersistentTensorAllocIdsIsMutable(); + persistentTensorAllocIds_.addLong(v); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensurePersistentTensorAllocIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + persistentTensorAllocIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 42 + case 48: { + long v = input.readInt64(); + ensureDevicePersistentTensorAllocIdsIsMutable(); + devicePersistentTensorAllocIds_.addLong(v); + break; + } // case 48 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureDevicePersistentTensorAllocIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + devicePersistentTensorAllocIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long tempMemorySize_ ; + /** + * int64 temp_memory_size = 1; + * @return The tempMemorySize. + */ + @java.lang.Override + public long getTempMemorySize() { + return tempMemorySize_; + } + /** + * int64 temp_memory_size = 1; + * @param value The tempMemorySize to set. + * @return This builder for chaining. + */ + public Builder setTempMemorySize(long value) { + + tempMemorySize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 temp_memory_size = 1; + * @return This builder for chaining. + */ + public Builder clearTempMemorySize() { + bitField0_ = (bitField0_ & ~0x00000001); + tempMemorySize_ = 0L; + onChanged(); + return this; + } + + private long persistentMemorySize_ ; + /** + * int64 persistent_memory_size = 3; + * @return The persistentMemorySize. + */ + @java.lang.Override + public long getPersistentMemorySize() { + return persistentMemorySize_; + } + /** + * int64 persistent_memory_size = 3; + * @param value The persistentMemorySize to set. + * @return This builder for chaining. + */ + public Builder setPersistentMemorySize(long value) { + + persistentMemorySize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 persistent_memory_size = 3; + * @return This builder for chaining. + */ + public Builder clearPersistentMemorySize() { + bitField0_ = (bitField0_ & ~0x00000002); + persistentMemorySize_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList persistentTensorAllocIds_ = emptyLongList(); + private void ensurePersistentTensorAllocIdsIsMutable() { + if (!persistentTensorAllocIds_.isModifiable()) { + persistentTensorAllocIds_ = makeMutableCopy(persistentTensorAllocIds_); + } + bitField0_ |= 0x00000004; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return A list containing the persistentTensorAllocIds. + */ + public java.util.List + getPersistentTensorAllocIdsList() { + persistentTensorAllocIds_.makeImmutable(); + return persistentTensorAllocIds_; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return The count of persistentTensorAllocIds. + */ + public int getPersistentTensorAllocIdsCount() { + return persistentTensorAllocIds_.size(); + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param index The index of the element to return. + * @return The persistentTensorAllocIds at the given index. + */ + public long getPersistentTensorAllocIds(int index) { + return persistentTensorAllocIds_.getLong(index); + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param index The index to set the value at. + * @param value The persistentTensorAllocIds to set. + * @return This builder for chaining. + */ + public Builder setPersistentTensorAllocIds( + int index, long value) { + + ensurePersistentTensorAllocIdsIsMutable(); + persistentTensorAllocIds_.setLong(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param value The persistentTensorAllocIds to add. + * @return This builder for chaining. + */ + public Builder addPersistentTensorAllocIds(long value) { + + ensurePersistentTensorAllocIdsIsMutable(); + persistentTensorAllocIds_.addLong(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param values The persistentTensorAllocIds to add. + * @return This builder for chaining. + */ + public Builder addAllPersistentTensorAllocIds( + java.lang.Iterable values) { + ensurePersistentTensorAllocIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, persistentTensorAllocIds_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return This builder for chaining. + */ + public Builder clearPersistentTensorAllocIds() { + persistentTensorAllocIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private long deviceTempMemorySize_ ; + /** + * int64 device_temp_memory_size = 2 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=48 + * @return The deviceTempMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemorySize() { + return deviceTempMemorySize_; + } + /** + * int64 device_temp_memory_size = 2 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=48 + * @param value The deviceTempMemorySize to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDeviceTempMemorySize(long value) { + + deviceTempMemorySize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 device_temp_memory_size = 2 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=48 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDeviceTempMemorySize() { + bitField0_ = (bitField0_ & ~0x00000008); + deviceTempMemorySize_ = 0L; + onChanged(); + return this; + } + + private long devicePersistentMemorySize_ ; + /** + * int64 device_persistent_memory_size = 4 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=49 + * @return The devicePersistentMemorySize. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemorySize() { + return devicePersistentMemorySize_; + } + /** + * int64 device_persistent_memory_size = 4 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=49 + * @param value The devicePersistentMemorySize to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDevicePersistentMemorySize(long value) { + + devicePersistentMemorySize_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 device_persistent_memory_size = 4 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=49 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDevicePersistentMemorySize() { + bitField0_ = (bitField0_ & ~0x00000010); + devicePersistentMemorySize_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList devicePersistentTensorAllocIds_ = emptyLongList(); + private void ensureDevicePersistentTensorAllocIdsIsMutable() { + if (!devicePersistentTensorAllocIds_.isModifiable()) { + devicePersistentTensorAllocIds_ = makeMutableCopy(devicePersistentTensorAllocIds_); + } + bitField0_ |= 0x00000020; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return A list containing the devicePersistentTensorAllocIds. + */ + @java.lang.Deprecated public java.util.List + getDevicePersistentTensorAllocIdsList() { + devicePersistentTensorAllocIds_.makeImmutable(); + return devicePersistentTensorAllocIds_; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return The count of devicePersistentTensorAllocIds. + */ + @java.lang.Deprecated public int getDevicePersistentTensorAllocIdsCount() { + return devicePersistentTensorAllocIds_.size(); + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param index The index of the element to return. + * @return The devicePersistentTensorAllocIds at the given index. + */ + @java.lang.Deprecated public long getDevicePersistentTensorAllocIds(int index) { + return devicePersistentTensorAllocIds_.getLong(index); + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param index The index to set the value at. + * @param value The devicePersistentTensorAllocIds to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDevicePersistentTensorAllocIds( + int index, long value) { + + ensureDevicePersistentTensorAllocIdsIsMutable(); + devicePersistentTensorAllocIds_.setLong(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param value The devicePersistentTensorAllocIds to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder addDevicePersistentTensorAllocIds(long value) { + + ensureDevicePersistentTensorAllocIdsIsMutable(); + devicePersistentTensorAllocIds_.addLong(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param values The devicePersistentTensorAllocIds to add. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder addAllDevicePersistentTensorAllocIds( + java.lang.Iterable values) { + ensureDevicePersistentTensorAllocIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, devicePersistentTensorAllocIds_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDevicePersistentTensorAllocIds() { + devicePersistentTensorAllocIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MemoryStats) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MemoryStats) + private static final org.tensorflow.proto.MemoryStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MemoryStats(); + } + + public static org.tensorflow.proto.MemoryStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MemoryStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MemoryStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStatsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStatsOrBuilder.java new file mode 100644 index 00000000000..3c04e6831dd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MemoryStatsOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface MemoryStatsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MemoryStats) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 temp_memory_size = 1; + * @return The tempMemorySize. + */ + long getTempMemorySize(); + + /** + * int64 persistent_memory_size = 3; + * @return The persistentMemorySize. + */ + long getPersistentMemorySize(); + + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return A list containing the persistentTensorAllocIds. + */ + java.util.List getPersistentTensorAllocIdsList(); + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @return The count of persistentTensorAllocIds. + */ + int getPersistentTensorAllocIdsCount(); + /** + * repeated int64 persistent_tensor_alloc_ids = 5; + * @param index The index of the element to return. + * @return The persistentTensorAllocIds at the given index. + */ + long getPersistentTensorAllocIds(int index); + + /** + * int64 device_temp_memory_size = 2 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_temp_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=48 + * @return The deviceTempMemorySize. + */ + @java.lang.Deprecated long getDeviceTempMemorySize(); + + /** + * int64 device_persistent_memory_size = 4 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_memory_size is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=49 + * @return The devicePersistentMemorySize. + */ + @java.lang.Deprecated long getDevicePersistentMemorySize(); + + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return A list containing the devicePersistentTensorAllocIds. + */ + @java.lang.Deprecated java.util.List getDevicePersistentTensorAllocIdsList(); + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @return The count of devicePersistentTensorAllocIds. + */ + @java.lang.Deprecated int getDevicePersistentTensorAllocIdsCount(); + /** + * repeated int64 device_persistent_tensor_alloc_ids = 6 [deprecated = true]; + * @deprecated tensorflow.MemoryStats.device_persistent_tensor_alloc_ids is deprecated. + * See tensorflow/core/framework/step_stats.proto;l=50 + * @param index The index of the element to return. + * @return The devicePersistentTensorAllocIds at the given index. + */ + @java.lang.Deprecated long getDevicePersistentTensorAllocIds(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDef.java new file mode 100644 index 00000000000..8dfe44e7a05 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDef.java @@ -0,0 +1,4805 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer containing the following which are necessary to restart
    + * training, run inference. It can be used to serialize/de-serialize memory
    + * objects necessary for running computation in a graph when crossing the
    + * process boundary. It can be used for long term storage of graphs,
    + * cross-language execution of graphs, etc.
    + * MetaInfoDef
    + * GraphDef
    + * SaverDef
    + * CollectionDef
    + * TensorInfo
    + * SignatureDef
    + * 
    + * + * Protobuf type {@code tensorflow.MetaGraphDef} + */ +public final class MetaGraphDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MetaGraphDef) + MetaGraphDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MetaGraphDef.class.getName()); + } + // Use MetaGraphDef.newBuilder() to construct. + private MetaGraphDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetaGraphDef() { + assetFileDef_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetCollectionDef(); + case 5: + return internalGetSignatureDef(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetaGraphDef.class, org.tensorflow.proto.MetaGraphDef.Builder.class); + } + + public interface MetaInfoDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MetaGraphDef.MetaInfoDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * User specified Version string. Can be the name of the model and revision,
    +     * steps this model has been trained to, etc.
    +     * 
    + * + * string meta_graph_version = 1; + * @return The metaGraphVersion. + */ + java.lang.String getMetaGraphVersion(); + /** + *
    +     * User specified Version string. Can be the name of the model and revision,
    +     * steps this model has been trained to, etc.
    +     * 
    + * + * string meta_graph_version = 1; + * @return The bytes for metaGraphVersion. + */ + com.google.protobuf.ByteString + getMetaGraphVersionBytes(); + + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return Whether the strippedOpList field is set. + */ + boolean hasStrippedOpList(); + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return The strippedOpList. + */ + org.tensorflow.proto.OpList getStrippedOpList(); + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + org.tensorflow.proto.OpListOrBuilder getStrippedOpListOrBuilder(); + + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + * @return Whether the anyInfo field is set. + */ + boolean hasAnyInfo(); + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + * @return The anyInfo. + */ + com.google.protobuf.Any getAnyInfo(); + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + */ + com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder(); + + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @return A list containing the tags. + */ + java.util.List + getTagsList(); + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @return The count of tags. + */ + int getTagsCount(); + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString + getTagsBytes(int index); + + /** + *
    +     * The __version__ string of the tensorflow build used to write this graph.
    +     * This will be populated by the framework, which will overwrite any user
    +     * supplied value.
    +     * 
    + * + * string tensorflow_version = 5; + * @return The tensorflowVersion. + */ + java.lang.String getTensorflowVersion(); + /** + *
    +     * The __version__ string of the tensorflow build used to write this graph.
    +     * This will be populated by the framework, which will overwrite any user
    +     * supplied value.
    +     * 
    + * + * string tensorflow_version = 5; + * @return The bytes for tensorflowVersion. + */ + com.google.protobuf.ByteString + getTensorflowVersionBytes(); + + /** + *
    +     * The __git_version__ string of the tensorflow build used to write this
    +     * graph. This will be populated by the framework, which will overwrite any
    +     * user supplied value.
    +     * 
    + * + * string tensorflow_git_version = 6; + * @return The tensorflowGitVersion. + */ + java.lang.String getTensorflowGitVersion(); + /** + *
    +     * The __git_version__ string of the tensorflow build used to write this
    +     * graph. This will be populated by the framework, which will overwrite any
    +     * user supplied value.
    +     * 
    + * + * string tensorflow_git_version = 6; + * @return The bytes for tensorflowGitVersion. + */ + com.google.protobuf.ByteString + getTensorflowGitVersionBytes(); + + /** + *
    +     * A flag to denote whether default-valued attrs have been stripped from
    +     * the nodes in this graph_def.
    +     * 
    + * + * bool stripped_default_attrs = 7; + * @return The strippedDefaultAttrs. + */ + boolean getStrippedDefaultAttrs(); + + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + int getFunctionAliasesCount(); + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + boolean containsFunctionAliases( + java.lang.String key); + /** + * Use {@link #getFunctionAliasesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFunctionAliases(); + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + java.util.Map + getFunctionAliasesMap(); + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + /* nullable */ +java.lang.String getFunctionAliasesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + java.lang.String getFunctionAliasesOrThrow( + java.lang.String key); + } + /** + *
    +   * Meta information regarding the graph to be exported.  To be used by users
    +   * of this protocol buffer to encode information regarding their meta graph.
    +   * 
    + * + * Protobuf type {@code tensorflow.MetaGraphDef.MetaInfoDef} + */ + public static final class MetaInfoDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MetaGraphDef.MetaInfoDef) + MetaInfoDefOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MetaInfoDef.class.getName()); + } + // Use MetaInfoDef.newBuilder() to construct. + private MetaInfoDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetaInfoDef() { + metaGraphVersion_ = ""; + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + tensorflowVersion_ = ""; + tensorflowGitVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetFunctionAliases(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetaGraphDef.MetaInfoDef.class, org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder.class); + } + + private int bitField0_; + public static final int META_GRAPH_VERSION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object metaGraphVersion_ = ""; + /** + *
    +     * User specified Version string. Can be the name of the model and revision,
    +     * steps this model has been trained to, etc.
    +     * 
    + * + * string meta_graph_version = 1; + * @return The metaGraphVersion. + */ + @java.lang.Override + public java.lang.String getMetaGraphVersion() { + java.lang.Object ref = metaGraphVersion_; + 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(); + metaGraphVersion_ = s; + return s; + } + } + /** + *
    +     * User specified Version string. Can be the name of the model and revision,
    +     * steps this model has been trained to, etc.
    +     * 
    + * + * string meta_graph_version = 1; + * @return The bytes for metaGraphVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMetaGraphVersionBytes() { + java.lang.Object ref = metaGraphVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metaGraphVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STRIPPED_OP_LIST_FIELD_NUMBER = 2; + private org.tensorflow.proto.OpList strippedOpList_; + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return Whether the strippedOpList field is set. + */ + @java.lang.Override + public boolean hasStrippedOpList() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return The strippedOpList. + */ + @java.lang.Override + public org.tensorflow.proto.OpList getStrippedOpList() { + return strippedOpList_ == null ? org.tensorflow.proto.OpList.getDefaultInstance() : strippedOpList_; + } + /** + *
    +     * A copy of the OpDefs used by the producer of this graph_def.
    +     * Descriptions and Ops not used in graph_def are stripped out.
    +     * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + @java.lang.Override + public org.tensorflow.proto.OpListOrBuilder getStrippedOpListOrBuilder() { + return strippedOpList_ == null ? org.tensorflow.proto.OpList.getDefaultInstance() : strippedOpList_; + } + + public static final int ANY_INFO_FIELD_NUMBER = 3; + private com.google.protobuf.Any anyInfo_; + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + * @return Whether the anyInfo field is set. + */ + @java.lang.Override + public boolean hasAnyInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + * @return The anyInfo. + */ + @java.lang.Override + public com.google.protobuf.Any getAnyInfo() { + return anyInfo_ == null ? com.google.protobuf.Any.getDefaultInstance() : anyInfo_; + } + /** + *
    +     * A serialized protobuf. Can be the time this meta graph is created, or
    +     * modified, or name of the model.
    +     * 
    + * + * .google.protobuf.Any any_info = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder() { + return anyInfo_ == null ? com.google.protobuf.Any.getDefaultInstance() : anyInfo_; + } + + public static final int TAGS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList + getTagsList() { + return tags_; + } + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + *
    +     * User supplied tag(s) on the meta_graph and included graph_def.
    +     *
    +     * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +     * Examples: "train", "serve", "gpu", "tpu", etc.
    +     * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +     * specific use-case or runtime environment.
    +     * 
    + * + * repeated string tags = 4; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString + getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int TENSORFLOW_VERSION_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object tensorflowVersion_ = ""; + /** + *
    +     * The __version__ string of the tensorflow build used to write this graph.
    +     * This will be populated by the framework, which will overwrite any user
    +     * supplied value.
    +     * 
    + * + * string tensorflow_version = 5; + * @return The tensorflowVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + 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(); + tensorflowVersion_ = s; + return s; + } + } + /** + *
    +     * The __version__ string of the tensorflow build used to write this graph.
    +     * This will be populated by the framework, which will overwrite any user
    +     * supplied value.
    +     * 
    + * + * string tensorflow_version = 5; + * @return The bytes for tensorflowVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TENSORFLOW_GIT_VERSION_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object tensorflowGitVersion_ = ""; + /** + *
    +     * The __git_version__ string of the tensorflow build used to write this
    +     * graph. This will be populated by the framework, which will overwrite any
    +     * user supplied value.
    +     * 
    + * + * string tensorflow_git_version = 6; + * @return The tensorflowGitVersion. + */ + @java.lang.Override + public java.lang.String getTensorflowGitVersion() { + java.lang.Object ref = tensorflowGitVersion_; + 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(); + tensorflowGitVersion_ = s; + return s; + } + } + /** + *
    +     * The __git_version__ string of the tensorflow build used to write this
    +     * graph. This will be populated by the framework, which will overwrite any
    +     * user supplied value.
    +     * 
    + * + * string tensorflow_git_version = 6; + * @return The bytes for tensorflowGitVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTensorflowGitVersionBytes() { + java.lang.Object ref = tensorflowGitVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowGitVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STRIPPED_DEFAULT_ATTRS_FIELD_NUMBER = 7; + private boolean strippedDefaultAttrs_ = false; + /** + *
    +     * A flag to denote whether default-valued attrs have been stripped from
    +     * the nodes in this graph_def.
    +     * 
    + * + * bool stripped_default_attrs = 7; + * @return The strippedDefaultAttrs. + */ + @java.lang.Override + public boolean getStrippedDefaultAttrs() { + return strippedDefaultAttrs_; + } + + public static final int FUNCTION_ALIASES_FIELD_NUMBER = 8; + private static final class FunctionAliasesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> functionAliases_; + private com.google.protobuf.MapField + internalGetFunctionAliases() { + if (functionAliases_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FunctionAliasesDefaultEntryHolder.defaultEntry); + } + return functionAliases_; + } + public int getFunctionAliasesCount() { + return internalGetFunctionAliases().getMap().size(); + } + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public boolean containsFunctionAliases( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFunctionAliases().getMap().containsKey(key); + } + /** + * Use {@link #getFunctionAliasesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFunctionAliases() { + return getFunctionAliasesMap(); + } + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public java.util.Map getFunctionAliasesMap() { + return internalGetFunctionAliases().getMap(); + } + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFunctionAliasesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFunctionAliases().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * FunctionDef name to aliases mapping.
    +     * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public java.lang.String getFunctionAliasesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFunctionAliases().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(metaGraphVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, metaGraphVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStrippedOpList()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getAnyInfo()); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, tags_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowGitVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, tensorflowGitVersion_); + } + if (strippedDefaultAttrs_ != false) { + output.writeBool(7, strippedDefaultAttrs_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFunctionAliases(), + FunctionAliasesDefaultEntryHolder.defaultEntry, + 8); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metaGraphVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, metaGraphVersion_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getStrippedOpList()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getAnyInfo()); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, tensorflowVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tensorflowGitVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, tensorflowGitVersion_); + } + if (strippedDefaultAttrs_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, strippedDefaultAttrs_); + } + for (java.util.Map.Entry entry + : internalGetFunctionAliases().getMap().entrySet()) { + com.google.protobuf.MapEntry + functionAliases__ = FunctionAliasesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, functionAliases__); + } + size += getUnknownFields().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.MetaGraphDef.MetaInfoDef)) { + return super.equals(obj); + } + org.tensorflow.proto.MetaGraphDef.MetaInfoDef other = (org.tensorflow.proto.MetaGraphDef.MetaInfoDef) obj; + + if (!getMetaGraphVersion() + .equals(other.getMetaGraphVersion())) return false; + if (hasStrippedOpList() != other.hasStrippedOpList()) return false; + if (hasStrippedOpList()) { + if (!getStrippedOpList() + .equals(other.getStrippedOpList())) return false; + } + if (hasAnyInfo() != other.hasAnyInfo()) return false; + if (hasAnyInfo()) { + if (!getAnyInfo() + .equals(other.getAnyInfo())) return false; + } + if (!getTagsList() + .equals(other.getTagsList())) return false; + if (!getTensorflowVersion() + .equals(other.getTensorflowVersion())) return false; + if (!getTensorflowGitVersion() + .equals(other.getTensorflowGitVersion())) return false; + if (getStrippedDefaultAttrs() + != other.getStrippedDefaultAttrs()) return false; + if (!internalGetFunctionAliases().equals( + other.internalGetFunctionAliases())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + META_GRAPH_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMetaGraphVersion().hashCode(); + if (hasStrippedOpList()) { + hash = (37 * hash) + STRIPPED_OP_LIST_FIELD_NUMBER; + hash = (53 * hash) + getStrippedOpList().hashCode(); + } + if (hasAnyInfo()) { + hash = (37 * hash) + ANY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getAnyInfo().hashCode(); + } + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + hash = (37 * hash) + TENSORFLOW_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowVersion().hashCode(); + hash = (37 * hash) + TENSORFLOW_GIT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTensorflowGitVersion().hashCode(); + hash = (37 * hash) + STRIPPED_DEFAULT_ATTRS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStrippedDefaultAttrs()); + if (!internalGetFunctionAliases().getMap().isEmpty()) { + hash = (37 * hash) + FUNCTION_ALIASES_FIELD_NUMBER; + hash = (53 * hash) + internalGetFunctionAliases().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef 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.MetaGraphDef.MetaInfoDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MetaGraphDef.MetaInfoDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Meta information regarding the graph to be exported.  To be used by users
    +     * of this protocol buffer to encode information regarding their meta graph.
    +     * 
    + * + * Protobuf type {@code tensorflow.MetaGraphDef.MetaInfoDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MetaGraphDef.MetaInfoDef) + org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetFunctionAliases(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetMutableFunctionAliases(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetaGraphDef.MetaInfoDef.class, org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder.class); + } + + // Construct using org.tensorflow.proto.MetaGraphDef.MetaInfoDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getStrippedOpListFieldBuilder(); + getAnyInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metaGraphVersion_ = ""; + strippedOpList_ = null; + if (strippedOpListBuilder_ != null) { + strippedOpListBuilder_.dispose(); + strippedOpListBuilder_ = null; + } + anyInfo_ = null; + if (anyInfoBuilder_ != null) { + anyInfoBuilder_.dispose(); + anyInfoBuilder_ = null; + } + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + tensorflowVersion_ = ""; + tensorflowGitVersion_ = ""; + strippedDefaultAttrs_ = false; + internalGetMutableFunctionAliases().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef getDefaultInstanceForType() { + return org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef build() { + org.tensorflow.proto.MetaGraphDef.MetaInfoDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef buildPartial() { + org.tensorflow.proto.MetaGraphDef.MetaInfoDef result = new org.tensorflow.proto.MetaGraphDef.MetaInfoDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MetaGraphDef.MetaInfoDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metaGraphVersion_ = metaGraphVersion_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.strippedOpList_ = strippedOpListBuilder_ == null + ? strippedOpList_ + : strippedOpListBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.anyInfo_ = anyInfoBuilder_ == null + ? anyInfo_ + : anyInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + tags_.makeImmutable(); + result.tags_ = tags_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tensorflowVersion_ = tensorflowVersion_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.tensorflowGitVersion_ = tensorflowGitVersion_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.strippedDefaultAttrs_ = strippedDefaultAttrs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.functionAliases_ = internalGetFunctionAliases(); + result.functionAliases_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MetaGraphDef.MetaInfoDef) { + return mergeFrom((org.tensorflow.proto.MetaGraphDef.MetaInfoDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MetaGraphDef.MetaInfoDef other) { + if (other == org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance()) return this; + if (!other.getMetaGraphVersion().isEmpty()) { + metaGraphVersion_ = other.metaGraphVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasStrippedOpList()) { + mergeStrippedOpList(other.getStrippedOpList()); + } + if (other.hasAnyInfo()) { + mergeAnyInfo(other.getAnyInfo()); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ |= 0x00000008; + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (!other.getTensorflowVersion().isEmpty()) { + tensorflowVersion_ = other.tensorflowVersion_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getTensorflowGitVersion().isEmpty()) { + tensorflowGitVersion_ = other.tensorflowGitVersion_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getStrippedDefaultAttrs() != false) { + setStrippedDefaultAttrs(other.getStrippedDefaultAttrs()); + } + internalGetMutableFunctionAliases().mergeFrom( + other.internalGetFunctionAliases()); + bitField0_ |= 0x00000080; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + metaGraphVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getStrippedOpListFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getAnyInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + ensureTagsIsMutable(); + tags_.add(s); + break; + } // case 34 + case 42: { + tensorflowVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + tensorflowGitVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: { + strippedDefaultAttrs_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: { + com.google.protobuf.MapEntry + functionAliases__ = input.readMessage( + FunctionAliasesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFunctionAliases().getMutableMap().put( + functionAliases__.getKey(), functionAliases__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object metaGraphVersion_ = ""; + /** + *
    +       * User specified Version string. Can be the name of the model and revision,
    +       * steps this model has been trained to, etc.
    +       * 
    + * + * string meta_graph_version = 1; + * @return The metaGraphVersion. + */ + public java.lang.String getMetaGraphVersion() { + java.lang.Object ref = metaGraphVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metaGraphVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * User specified Version string. Can be the name of the model and revision,
    +       * steps this model has been trained to, etc.
    +       * 
    + * + * string meta_graph_version = 1; + * @return The bytes for metaGraphVersion. + */ + public com.google.protobuf.ByteString + getMetaGraphVersionBytes() { + java.lang.Object ref = metaGraphVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metaGraphVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * User specified Version string. Can be the name of the model and revision,
    +       * steps this model has been trained to, etc.
    +       * 
    + * + * string meta_graph_version = 1; + * @param value The metaGraphVersion to set. + * @return This builder for chaining. + */ + public Builder setMetaGraphVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + metaGraphVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * User specified Version string. Can be the name of the model and revision,
    +       * steps this model has been trained to, etc.
    +       * 
    + * + * string meta_graph_version = 1; + * @return This builder for chaining. + */ + public Builder clearMetaGraphVersion() { + metaGraphVersion_ = getDefaultInstance().getMetaGraphVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * User specified Version string. Can be the name of the model and revision,
    +       * steps this model has been trained to, etc.
    +       * 
    + * + * string meta_graph_version = 1; + * @param value The bytes for metaGraphVersion to set. + * @return This builder for chaining. + */ + public Builder setMetaGraphVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + metaGraphVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.OpList strippedOpList_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpList, org.tensorflow.proto.OpList.Builder, org.tensorflow.proto.OpListOrBuilder> strippedOpListBuilder_; + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return Whether the strippedOpList field is set. + */ + public boolean hasStrippedOpList() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + * @return The strippedOpList. + */ + public org.tensorflow.proto.OpList getStrippedOpList() { + if (strippedOpListBuilder_ == null) { + return strippedOpList_ == null ? org.tensorflow.proto.OpList.getDefaultInstance() : strippedOpList_; + } else { + return strippedOpListBuilder_.getMessage(); + } + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public Builder setStrippedOpList(org.tensorflow.proto.OpList value) { + if (strippedOpListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + strippedOpList_ = value; + } else { + strippedOpListBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public Builder setStrippedOpList( + org.tensorflow.proto.OpList.Builder builderForValue) { + if (strippedOpListBuilder_ == null) { + strippedOpList_ = builderForValue.build(); + } else { + strippedOpListBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public Builder mergeStrippedOpList(org.tensorflow.proto.OpList value) { + if (strippedOpListBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + strippedOpList_ != null && + strippedOpList_ != org.tensorflow.proto.OpList.getDefaultInstance()) { + getStrippedOpListBuilder().mergeFrom(value); + } else { + strippedOpList_ = value; + } + } else { + strippedOpListBuilder_.mergeFrom(value); + } + if (strippedOpList_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public Builder clearStrippedOpList() { + bitField0_ = (bitField0_ & ~0x00000002); + strippedOpList_ = null; + if (strippedOpListBuilder_ != null) { + strippedOpListBuilder_.dispose(); + strippedOpListBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public org.tensorflow.proto.OpList.Builder getStrippedOpListBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStrippedOpListFieldBuilder().getBuilder(); + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + public org.tensorflow.proto.OpListOrBuilder getStrippedOpListOrBuilder() { + if (strippedOpListBuilder_ != null) { + return strippedOpListBuilder_.getMessageOrBuilder(); + } else { + return strippedOpList_ == null ? + org.tensorflow.proto.OpList.getDefaultInstance() : strippedOpList_; + } + } + /** + *
    +       * A copy of the OpDefs used by the producer of this graph_def.
    +       * Descriptions and Ops not used in graph_def are stripped out.
    +       * 
    + * + * .tensorflow.OpList stripped_op_list = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpList, org.tensorflow.proto.OpList.Builder, org.tensorflow.proto.OpListOrBuilder> + getStrippedOpListFieldBuilder() { + if (strippedOpListBuilder_ == null) { + strippedOpListBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpList, org.tensorflow.proto.OpList.Builder, org.tensorflow.proto.OpListOrBuilder>( + getStrippedOpList(), + getParentForChildren(), + isClean()); + strippedOpList_ = null; + } + return strippedOpListBuilder_; + } + + private com.google.protobuf.Any anyInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> anyInfoBuilder_; + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + * @return Whether the anyInfo field is set. + */ + public boolean hasAnyInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + * @return The anyInfo. + */ + public com.google.protobuf.Any getAnyInfo() { + if (anyInfoBuilder_ == null) { + return anyInfo_ == null ? com.google.protobuf.Any.getDefaultInstance() : anyInfo_; + } else { + return anyInfoBuilder_.getMessage(); + } + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public Builder setAnyInfo(com.google.protobuf.Any value) { + if (anyInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + anyInfo_ = value; + } else { + anyInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public Builder setAnyInfo( + com.google.protobuf.Any.Builder builderForValue) { + if (anyInfoBuilder_ == null) { + anyInfo_ = builderForValue.build(); + } else { + anyInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public Builder mergeAnyInfo(com.google.protobuf.Any value) { + if (anyInfoBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + anyInfo_ != null && + anyInfo_ != com.google.protobuf.Any.getDefaultInstance()) { + getAnyInfoBuilder().mergeFrom(value); + } else { + anyInfo_ = value; + } + } else { + anyInfoBuilder_.mergeFrom(value); + } + if (anyInfo_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public Builder clearAnyInfo() { + bitField0_ = (bitField0_ & ~0x00000004); + anyInfo_ = null; + if (anyInfoBuilder_ != null) { + anyInfoBuilder_.dispose(); + anyInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public com.google.protobuf.Any.Builder getAnyInfoBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAnyInfoFieldBuilder().getBuilder(); + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + public com.google.protobuf.AnyOrBuilder getAnyInfoOrBuilder() { + if (anyInfoBuilder_ != null) { + return anyInfoBuilder_.getMessageOrBuilder(); + } else { + return anyInfo_ == null ? + com.google.protobuf.Any.getDefaultInstance() : anyInfo_; + } + } + /** + *
    +       * A serialized protobuf. Can be the time this meta graph is created, or
    +       * modified, or name of the model.
    +       * 
    + * + * .google.protobuf.Any any_info = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getAnyInfoFieldBuilder() { + if (anyInfoBuilder_ == null) { + anyInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getAnyInfo(), + getParentForChildren(), + isClean()); + anyInfo_ = null; + } + return anyInfoBuilder_; + } + + private com.google.protobuf.LazyStringArrayList tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureTagsIsMutable() { + if (!tags_.isModifiable()) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList + getTagsList() { + tags_.makeImmutable(); + return tags_; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString + getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTagsIsMutable(); + tags_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags( + java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tags_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
    +       * User supplied tag(s) on the meta_graph and included graph_def.
    +       *
    +       * MetaGraphDefs should be tagged with their capabilities or use-cases.
    +       * Examples: "train", "serve", "gpu", "tpu", etc.
    +       * These tags enable loaders to access the MetaGraph(s) appropriate for a
    +       * specific use-case or runtime environment.
    +       * 
    + * + * repeated string tags = 4; + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object tensorflowVersion_ = ""; + /** + *
    +       * The __version__ string of the tensorflow build used to write this graph.
    +       * This will be populated by the framework, which will overwrite any user
    +       * supplied value.
    +       * 
    + * + * string tensorflow_version = 5; + * @return The tensorflowVersion. + */ + public java.lang.String getTensorflowVersion() { + java.lang.Object ref = tensorflowVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The __version__ string of the tensorflow build used to write this graph.
    +       * This will be populated by the framework, which will overwrite any user
    +       * supplied value.
    +       * 
    + * + * string tensorflow_version = 5; + * @return The bytes for tensorflowVersion. + */ + public com.google.protobuf.ByteString + getTensorflowVersionBytes() { + java.lang.Object ref = tensorflowVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The __version__ string of the tensorflow build used to write this graph.
    +       * This will be populated by the framework, which will overwrite any user
    +       * supplied value.
    +       * 
    + * + * string tensorflow_version = 5; + * @param value The tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tensorflowVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * The __version__ string of the tensorflow build used to write this graph.
    +       * This will be populated by the framework, which will overwrite any user
    +       * supplied value.
    +       * 
    + * + * string tensorflow_version = 5; + * @return This builder for chaining. + */ + public Builder clearTensorflowVersion() { + tensorflowVersion_ = getDefaultInstance().getTensorflowVersion(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * The __version__ string of the tensorflow build used to write this graph.
    +       * This will be populated by the framework, which will overwrite any user
    +       * supplied value.
    +       * 
    + * + * string tensorflow_version = 5; + * @param value The bytes for tensorflowVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tensorflowVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object tensorflowGitVersion_ = ""; + /** + *
    +       * The __git_version__ string of the tensorflow build used to write this
    +       * graph. This will be populated by the framework, which will overwrite any
    +       * user supplied value.
    +       * 
    + * + * string tensorflow_git_version = 6; + * @return The tensorflowGitVersion. + */ + public java.lang.String getTensorflowGitVersion() { + java.lang.Object ref = tensorflowGitVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tensorflowGitVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The __git_version__ string of the tensorflow build used to write this
    +       * graph. This will be populated by the framework, which will overwrite any
    +       * user supplied value.
    +       * 
    + * + * string tensorflow_git_version = 6; + * @return The bytes for tensorflowGitVersion. + */ + public com.google.protobuf.ByteString + getTensorflowGitVersionBytes() { + java.lang.Object ref = tensorflowGitVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tensorflowGitVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The __git_version__ string of the tensorflow build used to write this
    +       * graph. This will be populated by the framework, which will overwrite any
    +       * user supplied value.
    +       * 
    + * + * string tensorflow_git_version = 6; + * @param value The tensorflowGitVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowGitVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tensorflowGitVersion_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The __git_version__ string of the tensorflow build used to write this
    +       * graph. This will be populated by the framework, which will overwrite any
    +       * user supplied value.
    +       * 
    + * + * string tensorflow_git_version = 6; + * @return This builder for chaining. + */ + public Builder clearTensorflowGitVersion() { + tensorflowGitVersion_ = getDefaultInstance().getTensorflowGitVersion(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +       * The __git_version__ string of the tensorflow build used to write this
    +       * graph. This will be populated by the framework, which will overwrite any
    +       * user supplied value.
    +       * 
    + * + * string tensorflow_git_version = 6; + * @param value The bytes for tensorflowGitVersion to set. + * @return This builder for chaining. + */ + public Builder setTensorflowGitVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tensorflowGitVersion_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean strippedDefaultAttrs_ ; + /** + *
    +       * A flag to denote whether default-valued attrs have been stripped from
    +       * the nodes in this graph_def.
    +       * 
    + * + * bool stripped_default_attrs = 7; + * @return The strippedDefaultAttrs. + */ + @java.lang.Override + public boolean getStrippedDefaultAttrs() { + return strippedDefaultAttrs_; + } + /** + *
    +       * A flag to denote whether default-valued attrs have been stripped from
    +       * the nodes in this graph_def.
    +       * 
    + * + * bool stripped_default_attrs = 7; + * @param value The strippedDefaultAttrs to set. + * @return This builder for chaining. + */ + public Builder setStrippedDefaultAttrs(boolean value) { + + strippedDefaultAttrs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * A flag to denote whether default-valued attrs have been stripped from
    +       * the nodes in this graph_def.
    +       * 
    + * + * bool stripped_default_attrs = 7; + * @return This builder for chaining. + */ + public Builder clearStrippedDefaultAttrs() { + bitField0_ = (bitField0_ & ~0x00000040); + strippedDefaultAttrs_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> functionAliases_; + private com.google.protobuf.MapField + internalGetFunctionAliases() { + if (functionAliases_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FunctionAliasesDefaultEntryHolder.defaultEntry); + } + return functionAliases_; + } + private com.google.protobuf.MapField + internalGetMutableFunctionAliases() { + if (functionAliases_ == null) { + functionAliases_ = com.google.protobuf.MapField.newMapField( + FunctionAliasesDefaultEntryHolder.defaultEntry); + } + if (!functionAliases_.isMutable()) { + functionAliases_ = functionAliases_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return functionAliases_; + } + public int getFunctionAliasesCount() { + return internalGetFunctionAliases().getMap().size(); + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public boolean containsFunctionAliases( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFunctionAliases().getMap().containsKey(key); + } + /** + * Use {@link #getFunctionAliasesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFunctionAliases() { + return getFunctionAliasesMap(); + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public java.util.Map getFunctionAliasesMap() { + return internalGetFunctionAliases().getMap(); + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getFunctionAliasesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFunctionAliases().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + @java.lang.Override + public java.lang.String getFunctionAliasesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFunctionAliases().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearFunctionAliases() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableFunctionAliases().getMutableMap() + .clear(); + return this; + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + public Builder removeFunctionAliases( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFunctionAliases().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFunctionAliases() { + bitField0_ |= 0x00000080; + return internalGetMutableFunctionAliases().getMutableMap(); + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + public Builder putFunctionAliases( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFunctionAliases().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000080; + return this; + } + /** + *
    +       * FunctionDef name to aliases mapping.
    +       * 
    + * + * map<string, string> function_aliases = 8; + */ + public Builder putAllFunctionAliases( + java.util.Map values) { + internalGetMutableFunctionAliases().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000080; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MetaGraphDef.MetaInfoDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MetaGraphDef.MetaInfoDef) + private static final org.tensorflow.proto.MetaGraphDef.MetaInfoDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MetaGraphDef.MetaInfoDef(); + } + + public static org.tensorflow.proto.MetaGraphDef.MetaInfoDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetaInfoDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MetaGraphDef.MetaInfoDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int META_INFO_DEF_FIELD_NUMBER = 1; + private org.tensorflow.proto.MetaGraphDef.MetaInfoDef metaInfoDef_; + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return Whether the metaInfoDef field is set. + */ + @java.lang.Override + public boolean hasMetaInfoDef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return The metaInfoDef. + */ + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef getMetaInfoDef() { + return metaInfoDef_ == null ? org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder() { + return metaInfoDef_ == null ? org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; + } + + public static final int GRAPH_DEF_FIELD_NUMBER = 2; + private org.tensorflow.proto.GraphDef graphDef_; + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return Whether the graphDef field is set. + */ + @java.lang.Override + public boolean hasGraphDef() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return The graphDef. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getGraphDef() { + return graphDef_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : graphDef_; + } + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getGraphDefOrBuilder() { + return graphDef_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : graphDef_; + } + + public static final int SAVER_DEF_FIELD_NUMBER = 3; + private org.tensorflow.proto.SaverDef saverDef_; + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return Whether the saverDef field is set. + */ + @java.lang.Override + public boolean hasSaverDef() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return The saverDef. + */ + @java.lang.Override + public org.tensorflow.proto.SaverDef getSaverDef() { + return saverDef_ == null ? org.tensorflow.proto.SaverDef.getDefaultInstance() : saverDef_; + } + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + @java.lang.Override + public org.tensorflow.proto.SaverDefOrBuilder getSaverDefOrBuilder() { + return saverDef_ == null ? org.tensorflow.proto.SaverDef.getDefaultInstance() : saverDef_; + } + + public static final int COLLECTION_DEF_FIELD_NUMBER = 4; + private static final class CollectionDefDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.CollectionDef> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.CollectionDef.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.CollectionDef> collectionDef_; + private com.google.protobuf.MapField + internalGetCollectionDef() { + if (collectionDef_ == null) { + return com.google.protobuf.MapField.emptyMapField( + CollectionDefDefaultEntryHolder.defaultEntry); + } + return collectionDef_; + } + public int getCollectionDefCount() { + return internalGetCollectionDef().getMap().size(); + } + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public boolean containsCollectionDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetCollectionDef().getMap().containsKey(key); + } + /** + * Use {@link #getCollectionDefMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCollectionDef() { + return getCollectionDefMap(); + } + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public java.util.Map getCollectionDefMap() { + return internalGetCollectionDef().getMap(); + } + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.CollectionDef getCollectionDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.CollectionDef defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCollectionDef().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef getCollectionDefOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetCollectionDef().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SIGNATURE_DEF_FIELD_NUMBER = 5; + private static final class SignatureDefDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.SignatureDef> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.SignatureDef.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.SignatureDef> signatureDef_; + private com.google.protobuf.MapField + internalGetSignatureDef() { + if (signatureDef_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SignatureDefDefaultEntryHolder.defaultEntry); + } + return signatureDef_; + } + public int getSignatureDefCount() { + return internalGetSignatureDef().getMap().size(); + } + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public boolean containsSignatureDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSignatureDef().getMap().containsKey(key); + } + /** + * Use {@link #getSignatureDefMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSignatureDef() { + return getSignatureDefMap(); + } + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public java.util.Map getSignatureDefMap() { + return internalGetSignatureDef().getMap(); + } + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SignatureDef getSignatureDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SignatureDef defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSignatureDef().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SignatureDef getSignatureDefOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSignatureDef().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ASSET_FILE_DEF_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List assetFileDef_; + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + @java.lang.Override + public java.util.List getAssetFileDefList() { + return assetFileDef_; + } + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + @java.lang.Override + public java.util.List + getAssetFileDefOrBuilderList() { + return assetFileDef_; + } + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + @java.lang.Override + public int getAssetFileDefCount() { + return assetFileDef_.size(); + } + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AssetFileDef getAssetFileDef(int index) { + return assetFileDef_.get(index); + } + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AssetFileDefOrBuilder getAssetFileDefOrBuilder( + int index) { + return assetFileDef_.get(index); + } + + public static final int OBJECT_GRAPH_DEF_FIELD_NUMBER = 7; + private org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph objectGraphDef_; + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return Whether the objectGraphDef field is set. + */ + @java.lang.Override + public boolean hasObjectGraphDef() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return The objectGraphDef. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph getObjectGraphDef() { + return objectGraphDef_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; + } + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder() { + return objectGraphDef_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMetaInfoDef()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getGraphDef()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getSaverDef()); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetCollectionDef(), + CollectionDefDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetSignatureDef(), + SignatureDefDefaultEntryHolder.defaultEntry, + 5); + for (int i = 0; i < assetFileDef_.size(); i++) { + output.writeMessage(6, assetFileDef_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getObjectGraphDef()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getMetaInfoDef()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getGraphDef()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getSaverDef()); + } + for (java.util.Map.Entry entry + : internalGetCollectionDef().getMap().entrySet()) { + com.google.protobuf.MapEntry + collectionDef__ = CollectionDefDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, collectionDef__); + } + for (java.util.Map.Entry entry + : internalGetSignatureDef().getMap().entrySet()) { + com.google.protobuf.MapEntry + signatureDef__ = SignatureDefDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, signatureDef__); + } + for (int i = 0; i < assetFileDef_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, assetFileDef_.get(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getObjectGraphDef()); + } + size += getUnknownFields().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.MetaGraphDef)) { + return super.equals(obj); + } + org.tensorflow.proto.MetaGraphDef other = (org.tensorflow.proto.MetaGraphDef) obj; + + if (hasMetaInfoDef() != other.hasMetaInfoDef()) return false; + if (hasMetaInfoDef()) { + if (!getMetaInfoDef() + .equals(other.getMetaInfoDef())) return false; + } + if (hasGraphDef() != other.hasGraphDef()) return false; + if (hasGraphDef()) { + if (!getGraphDef() + .equals(other.getGraphDef())) return false; + } + if (hasSaverDef() != other.hasSaverDef()) return false; + if (hasSaverDef()) { + if (!getSaverDef() + .equals(other.getSaverDef())) return false; + } + if (!internalGetCollectionDef().equals( + other.internalGetCollectionDef())) return false; + if (!internalGetSignatureDef().equals( + other.internalGetSignatureDef())) return false; + if (!getAssetFileDefList() + .equals(other.getAssetFileDefList())) return false; + if (hasObjectGraphDef() != other.hasObjectGraphDef()) return false; + if (hasObjectGraphDef()) { + if (!getObjectGraphDef() + .equals(other.getObjectGraphDef())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMetaInfoDef()) { + hash = (37 * hash) + META_INFO_DEF_FIELD_NUMBER; + hash = (53 * hash) + getMetaInfoDef().hashCode(); + } + if (hasGraphDef()) { + hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getGraphDef().hashCode(); + } + if (hasSaverDef()) { + hash = (37 * hash) + SAVER_DEF_FIELD_NUMBER; + hash = (53 * hash) + getSaverDef().hashCode(); + } + if (!internalGetCollectionDef().getMap().isEmpty()) { + hash = (37 * hash) + COLLECTION_DEF_FIELD_NUMBER; + hash = (53 * hash) + internalGetCollectionDef().hashCode(); + } + if (!internalGetSignatureDef().getMap().isEmpty()) { + hash = (37 * hash) + SIGNATURE_DEF_FIELD_NUMBER; + hash = (53 * hash) + internalGetSignatureDef().hashCode(); + } + if (getAssetFileDefCount() > 0) { + hash = (37 * hash) + ASSET_FILE_DEF_FIELD_NUMBER; + hash = (53 * hash) + getAssetFileDefList().hashCode(); + } + if (hasObjectGraphDef()) { + hash = (37 * hash) + OBJECT_GRAPH_DEF_FIELD_NUMBER; + hash = (53 * hash) + getObjectGraphDef().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MetaGraphDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef 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.MetaGraphDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef 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.MetaGraphDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetaGraphDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MetaGraphDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetaGraphDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MetaGraphDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MetaGraphDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MetaGraphDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetaGraphDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MetaGraphDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer containing the following which are necessary to restart
    +   * training, run inference. It can be used to serialize/de-serialize memory
    +   * objects necessary for running computation in a graph when crossing the
    +   * process boundary. It can be used for long term storage of graphs,
    +   * cross-language execution of graphs, etc.
    +   * MetaInfoDef
    +   * GraphDef
    +   * SaverDef
    +   * CollectionDef
    +   * TensorInfo
    +   * SignatureDef
    +   * 
    + * + * Protobuf type {@code tensorflow.MetaGraphDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MetaGraphDef) + org.tensorflow.proto.MetaGraphDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetCollectionDef(); + case 5: + return internalGetSignatureDef(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableCollectionDef(); + case 5: + return internalGetMutableSignatureDef(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetaGraphDef.class, org.tensorflow.proto.MetaGraphDef.Builder.class); + } + + // Construct using org.tensorflow.proto.MetaGraphDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMetaInfoDefFieldBuilder(); + getGraphDefFieldBuilder(); + getSaverDefFieldBuilder(); + getAssetFileDefFieldBuilder(); + getObjectGraphDefFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metaInfoDef_ = null; + if (metaInfoDefBuilder_ != null) { + metaInfoDefBuilder_.dispose(); + metaInfoDefBuilder_ = null; + } + graphDef_ = null; + if (graphDefBuilder_ != null) { + graphDefBuilder_.dispose(); + graphDefBuilder_ = null; + } + saverDef_ = null; + if (saverDefBuilder_ != null) { + saverDefBuilder_.dispose(); + saverDefBuilder_ = null; + } + internalGetMutableCollectionDef().clear(); + internalGetMutableSignatureDef().clear(); + if (assetFileDefBuilder_ == null) { + assetFileDef_ = java.util.Collections.emptyList(); + } else { + assetFileDef_ = null; + assetFileDefBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + objectGraphDef_ = null; + if (objectGraphDefBuilder_ != null) { + objectGraphDefBuilder_.dispose(); + objectGraphDefBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_MetaGraphDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef getDefaultInstanceForType() { + return org.tensorflow.proto.MetaGraphDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef build() { + org.tensorflow.proto.MetaGraphDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef buildPartial() { + org.tensorflow.proto.MetaGraphDef result = new org.tensorflow.proto.MetaGraphDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.MetaGraphDef result) { + if (assetFileDefBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + assetFileDef_ = java.util.Collections.unmodifiableList(assetFileDef_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.assetFileDef_ = assetFileDef_; + } else { + result.assetFileDef_ = assetFileDefBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.MetaGraphDef result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metaInfoDef_ = metaInfoDefBuilder_ == null + ? metaInfoDef_ + : metaInfoDefBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.graphDef_ = graphDefBuilder_ == null + ? graphDef_ + : graphDefBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.saverDef_ = saverDefBuilder_ == null + ? saverDef_ + : saverDefBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.collectionDef_ = internalGetCollectionDef().build(CollectionDefDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.signatureDef_ = internalGetSignatureDef().build(SignatureDefDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.objectGraphDef_ = objectGraphDefBuilder_ == null + ? objectGraphDef_ + : objectGraphDefBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MetaGraphDef) { + return mergeFrom((org.tensorflow.proto.MetaGraphDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MetaGraphDef other) { + if (other == org.tensorflow.proto.MetaGraphDef.getDefaultInstance()) return this; + if (other.hasMetaInfoDef()) { + mergeMetaInfoDef(other.getMetaInfoDef()); + } + if (other.hasGraphDef()) { + mergeGraphDef(other.getGraphDef()); + } + if (other.hasSaverDef()) { + mergeSaverDef(other.getSaverDef()); + } + internalGetMutableCollectionDef().mergeFrom( + other.internalGetCollectionDef()); + bitField0_ |= 0x00000008; + internalGetMutableSignatureDef().mergeFrom( + other.internalGetSignatureDef()); + bitField0_ |= 0x00000010; + if (assetFileDefBuilder_ == null) { + if (!other.assetFileDef_.isEmpty()) { + if (assetFileDef_.isEmpty()) { + assetFileDef_ = other.assetFileDef_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureAssetFileDefIsMutable(); + assetFileDef_.addAll(other.assetFileDef_); + } + onChanged(); + } + } else { + if (!other.assetFileDef_.isEmpty()) { + if (assetFileDefBuilder_.isEmpty()) { + assetFileDefBuilder_.dispose(); + assetFileDefBuilder_ = null; + assetFileDef_ = other.assetFileDef_; + bitField0_ = (bitField0_ & ~0x00000020); + assetFileDefBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAssetFileDefFieldBuilder() : null; + } else { + assetFileDefBuilder_.addAllMessages(other.assetFileDef_); + } + } + } + if (other.hasObjectGraphDef()) { + mergeObjectGraphDef(other.getObjectGraphDef()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getMetaInfoDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getGraphDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getSaverDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + collectionDef__ = input.readMessage( + CollectionDefDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableCollectionDef().ensureBuilderMap().put( + collectionDef__.getKey(), collectionDef__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + signatureDef__ = input.readMessage( + SignatureDefDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSignatureDef().ensureBuilderMap().put( + signatureDef__.getKey(), signatureDef__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + org.tensorflow.proto.AssetFileDef m = + input.readMessage( + org.tensorflow.proto.AssetFileDef.parser(), + extensionRegistry); + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + assetFileDef_.add(m); + } else { + assetFileDefBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: { + input.readMessage( + getObjectGraphDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.MetaGraphDef.MetaInfoDef metaInfoDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder> metaInfoDefBuilder_; + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return Whether the metaInfoDef field is set. + */ + public boolean hasMetaInfoDef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return The metaInfoDef. + */ + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef getMetaInfoDef() { + if (metaInfoDefBuilder_ == null) { + return metaInfoDef_ == null ? org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; + } else { + return metaInfoDefBuilder_.getMessage(); + } + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public Builder setMetaInfoDef(org.tensorflow.proto.MetaGraphDef.MetaInfoDef value) { + if (metaInfoDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metaInfoDef_ = value; + } else { + metaInfoDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public Builder setMetaInfoDef( + org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder builderForValue) { + if (metaInfoDefBuilder_ == null) { + metaInfoDef_ = builderForValue.build(); + } else { + metaInfoDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public Builder mergeMetaInfoDef(org.tensorflow.proto.MetaGraphDef.MetaInfoDef value) { + if (metaInfoDefBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + metaInfoDef_ != null && + metaInfoDef_ != org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance()) { + getMetaInfoDefBuilder().mergeFrom(value); + } else { + metaInfoDef_ = value; + } + } else { + metaInfoDefBuilder_.mergeFrom(value); + } + if (metaInfoDef_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public Builder clearMetaInfoDef() { + bitField0_ = (bitField0_ & ~0x00000001); + metaInfoDef_ = null; + if (metaInfoDefBuilder_ != null) { + metaInfoDefBuilder_.dispose(); + metaInfoDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder getMetaInfoDefBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetaInfoDefFieldBuilder().getBuilder(); + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + public org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder() { + if (metaInfoDefBuilder_ != null) { + return metaInfoDefBuilder_.getMessageOrBuilder(); + } else { + return metaInfoDef_ == null ? + org.tensorflow.proto.MetaGraphDef.MetaInfoDef.getDefaultInstance() : metaInfoDef_; + } + } + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder> + getMetaInfoDefFieldBuilder() { + if (metaInfoDefBuilder_ == null) { + metaInfoDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MetaGraphDef.MetaInfoDef, org.tensorflow.proto.MetaGraphDef.MetaInfoDef.Builder, org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder>( + getMetaInfoDef(), + getParentForChildren(), + isClean()); + metaInfoDef_ = null; + } + return metaInfoDefBuilder_; + } + + private org.tensorflow.proto.GraphDef graphDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> graphDefBuilder_; + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return Whether the graphDef field is set. + */ + public boolean hasGraphDef() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return The graphDef. + */ + public org.tensorflow.proto.GraphDef getGraphDef() { + if (graphDefBuilder_ == null) { + return graphDef_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : graphDef_; + } else { + return graphDefBuilder_.getMessage(); + } + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public Builder setGraphDef(org.tensorflow.proto.GraphDef value) { + if (graphDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + graphDef_ = value; + } else { + graphDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public Builder setGraphDef( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (graphDefBuilder_ == null) { + graphDef_ = builderForValue.build(); + } else { + graphDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public Builder mergeGraphDef(org.tensorflow.proto.GraphDef value) { + if (graphDefBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + graphDef_ != null && + graphDef_ != org.tensorflow.proto.GraphDef.getDefaultInstance()) { + getGraphDefBuilder().mergeFrom(value); + } else { + graphDef_ = value; + } + } else { + graphDefBuilder_.mergeFrom(value); + } + if (graphDef_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public Builder clearGraphDef() { + bitField0_ = (bitField0_ & ~0x00000002); + graphDef_ = null; + if (graphDefBuilder_ != null) { + graphDefBuilder_.dispose(); + graphDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public org.tensorflow.proto.GraphDef.Builder getGraphDefBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getGraphDefFieldBuilder().getBuilder(); + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + public org.tensorflow.proto.GraphDefOrBuilder getGraphDefOrBuilder() { + if (graphDefBuilder_ != null) { + return graphDefBuilder_.getMessageOrBuilder(); + } else { + return graphDef_ == null ? + org.tensorflow.proto.GraphDef.getDefaultInstance() : graphDef_; + } + } + /** + *
    +     * GraphDef.
    +     * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getGraphDefFieldBuilder() { + if (graphDefBuilder_ == null) { + graphDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + getGraphDef(), + getParentForChildren(), + isClean()); + graphDef_ = null; + } + return graphDefBuilder_; + } + + private org.tensorflow.proto.SaverDef saverDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaverDef, org.tensorflow.proto.SaverDef.Builder, org.tensorflow.proto.SaverDefOrBuilder> saverDefBuilder_; + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return Whether the saverDef field is set. + */ + public boolean hasSaverDef() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return The saverDef. + */ + public org.tensorflow.proto.SaverDef getSaverDef() { + if (saverDefBuilder_ == null) { + return saverDef_ == null ? org.tensorflow.proto.SaverDef.getDefaultInstance() : saverDef_; + } else { + return saverDefBuilder_.getMessage(); + } + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public Builder setSaverDef(org.tensorflow.proto.SaverDef value) { + if (saverDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + saverDef_ = value; + } else { + saverDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public Builder setSaverDef( + org.tensorflow.proto.SaverDef.Builder builderForValue) { + if (saverDefBuilder_ == null) { + saverDef_ = builderForValue.build(); + } else { + saverDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public Builder mergeSaverDef(org.tensorflow.proto.SaverDef value) { + if (saverDefBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + saverDef_ != null && + saverDef_ != org.tensorflow.proto.SaverDef.getDefaultInstance()) { + getSaverDefBuilder().mergeFrom(value); + } else { + saverDef_ = value; + } + } else { + saverDefBuilder_.mergeFrom(value); + } + if (saverDef_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public Builder clearSaverDef() { + bitField0_ = (bitField0_ & ~0x00000004); + saverDef_ = null; + if (saverDefBuilder_ != null) { + saverDefBuilder_.dispose(); + saverDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public org.tensorflow.proto.SaverDef.Builder getSaverDefBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getSaverDefFieldBuilder().getBuilder(); + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + public org.tensorflow.proto.SaverDefOrBuilder getSaverDefOrBuilder() { + if (saverDefBuilder_ != null) { + return saverDefBuilder_.getMessageOrBuilder(); + } else { + return saverDef_ == null ? + org.tensorflow.proto.SaverDef.getDefaultInstance() : saverDef_; + } + } + /** + *
    +     * SaverDef.
    +     * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaverDef, org.tensorflow.proto.SaverDef.Builder, org.tensorflow.proto.SaverDefOrBuilder> + getSaverDefFieldBuilder() { + if (saverDefBuilder_ == null) { + saverDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaverDef, org.tensorflow.proto.SaverDef.Builder, org.tensorflow.proto.SaverDefOrBuilder>( + getSaverDef(), + getParentForChildren(), + isClean()); + saverDef_ = null; + } + return saverDefBuilder_; + } + + private static final class CollectionDefConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.CollectionDef build(org.tensorflow.proto.CollectionDefOrBuilder val) { + if (val instanceof org.tensorflow.proto.CollectionDef) { return (org.tensorflow.proto.CollectionDef) val; } + return ((org.tensorflow.proto.CollectionDef.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return CollectionDefDefaultEntryHolder.defaultEntry; + } + }; + private static final CollectionDefConverter collectionDefConverter = new CollectionDefConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.CollectionDefOrBuilder, org.tensorflow.proto.CollectionDef, org.tensorflow.proto.CollectionDef.Builder> collectionDef_; + private com.google.protobuf.MapFieldBuilder + internalGetCollectionDef() { + if (collectionDef_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(collectionDefConverter); + } + return collectionDef_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableCollectionDef() { + if (collectionDef_ == null) { + collectionDef_ = new com.google.protobuf.MapFieldBuilder<>(collectionDefConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return collectionDef_; + } + public int getCollectionDefCount() { + return internalGetCollectionDef().ensureBuilderMap().size(); + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public boolean containsCollectionDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetCollectionDef().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getCollectionDefMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getCollectionDef() { + return getCollectionDefMap(); + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public java.util.Map getCollectionDefMap() { + return internalGetCollectionDef().getImmutableMap(); + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.CollectionDef getCollectionDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.CollectionDef defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableCollectionDef().ensureBuilderMap(); + return map.containsKey(key) ? collectionDefConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CollectionDef getCollectionDefOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableCollectionDef().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return collectionDefConverter.build(map.get(key)); + } + public Builder clearCollectionDef() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableCollectionDef().clear(); + return this; + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + public Builder removeCollectionDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableCollectionDef().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableCollectionDef() { + bitField0_ |= 0x00000008; + return internalGetMutableCollectionDef().ensureMessageMap(); + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + public Builder putCollectionDef( + java.lang.String key, + org.tensorflow.proto.CollectionDef value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableCollectionDef().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + public Builder putAllCollectionDef( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableCollectionDef().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * collection_def: Map from collection name to collections.
    +     * See CollectionDef section for details.
    +     * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + public org.tensorflow.proto.CollectionDef.Builder putCollectionDefBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableCollectionDef().ensureBuilderMap(); + org.tensorflow.proto.CollectionDefOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.CollectionDef.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.CollectionDef) { + entry = ((org.tensorflow.proto.CollectionDef) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.CollectionDef.Builder) entry; + } + + private static final class SignatureDefConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.SignatureDef build(org.tensorflow.proto.SignatureDefOrBuilder val) { + if (val instanceof org.tensorflow.proto.SignatureDef) { return (org.tensorflow.proto.SignatureDef) val; } + return ((org.tensorflow.proto.SignatureDef.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return SignatureDefDefaultEntryHolder.defaultEntry; + } + }; + private static final SignatureDefConverter signatureDefConverter = new SignatureDefConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.SignatureDefOrBuilder, org.tensorflow.proto.SignatureDef, org.tensorflow.proto.SignatureDef.Builder> signatureDef_; + private com.google.protobuf.MapFieldBuilder + internalGetSignatureDef() { + if (signatureDef_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(signatureDefConverter); + } + return signatureDef_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableSignatureDef() { + if (signatureDef_ == null) { + signatureDef_ = new com.google.protobuf.MapFieldBuilder<>(signatureDefConverter); + } + bitField0_ |= 0x00000010; + onChanged(); + return signatureDef_; + } + public int getSignatureDefCount() { + return internalGetSignatureDef().ensureBuilderMap().size(); + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public boolean containsSignatureDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSignatureDef().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getSignatureDefMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSignatureDef() { + return getSignatureDefMap(); + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public java.util.Map getSignatureDefMap() { + return internalGetSignatureDef().getImmutableMap(); + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SignatureDef getSignatureDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SignatureDef defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSignatureDef().ensureBuilderMap(); + return map.containsKey(key) ? signatureDefConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SignatureDef getSignatureDefOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSignatureDef().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return signatureDefConverter.build(map.get(key)); + } + public Builder clearSignatureDef() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableSignatureDef().clear(); + return this; + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + public Builder removeSignatureDef( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSignatureDef().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSignatureDef() { + bitField0_ |= 0x00000010; + return internalGetMutableSignatureDef().ensureMessageMap(); + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + public Builder putSignatureDef( + java.lang.String key, + org.tensorflow.proto.SignatureDef value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableSignatureDef().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + public Builder putAllSignatureDef( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableSignatureDef().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +     * signature_def: Map from user supplied key for a signature to a single
    +     * SignatureDef.
    +     * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + public org.tensorflow.proto.SignatureDef.Builder putSignatureDefBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableSignatureDef().ensureBuilderMap(); + org.tensorflow.proto.SignatureDefOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.SignatureDef.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.SignatureDef) { + entry = ((org.tensorflow.proto.SignatureDef) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.SignatureDef.Builder) entry; + } + + private java.util.List assetFileDef_ = + java.util.Collections.emptyList(); + private void ensureAssetFileDefIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + assetFileDef_ = new java.util.ArrayList(assetFileDef_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AssetFileDef, org.tensorflow.proto.AssetFileDef.Builder, org.tensorflow.proto.AssetFileDefOrBuilder> assetFileDefBuilder_; + + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public java.util.List getAssetFileDefList() { + if (assetFileDefBuilder_ == null) { + return java.util.Collections.unmodifiableList(assetFileDef_); + } else { + return assetFileDefBuilder_.getMessageList(); + } + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public int getAssetFileDefCount() { + if (assetFileDefBuilder_ == null) { + return assetFileDef_.size(); + } else { + return assetFileDefBuilder_.getCount(); + } + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public org.tensorflow.proto.AssetFileDef getAssetFileDef(int index) { + if (assetFileDefBuilder_ == null) { + return assetFileDef_.get(index); + } else { + return assetFileDefBuilder_.getMessage(index); + } + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder setAssetFileDef( + int index, org.tensorflow.proto.AssetFileDef value) { + if (assetFileDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetFileDefIsMutable(); + assetFileDef_.set(index, value); + onChanged(); + } else { + assetFileDefBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder setAssetFileDef( + int index, org.tensorflow.proto.AssetFileDef.Builder builderForValue) { + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + assetFileDef_.set(index, builderForValue.build()); + onChanged(); + } else { + assetFileDefBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder addAssetFileDef(org.tensorflow.proto.AssetFileDef value) { + if (assetFileDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetFileDefIsMutable(); + assetFileDef_.add(value); + onChanged(); + } else { + assetFileDefBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder addAssetFileDef( + int index, org.tensorflow.proto.AssetFileDef value) { + if (assetFileDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetFileDefIsMutable(); + assetFileDef_.add(index, value); + onChanged(); + } else { + assetFileDefBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder addAssetFileDef( + org.tensorflow.proto.AssetFileDef.Builder builderForValue) { + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + assetFileDef_.add(builderForValue.build()); + onChanged(); + } else { + assetFileDefBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder addAssetFileDef( + int index, org.tensorflow.proto.AssetFileDef.Builder builderForValue) { + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + assetFileDef_.add(index, builderForValue.build()); + onChanged(); + } else { + assetFileDefBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder addAllAssetFileDef( + java.lang.Iterable values) { + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, assetFileDef_); + onChanged(); + } else { + assetFileDefBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder clearAssetFileDef() { + if (assetFileDefBuilder_ == null) { + assetFileDef_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + assetFileDefBuilder_.clear(); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public Builder removeAssetFileDef(int index) { + if (assetFileDefBuilder_ == null) { + ensureAssetFileDefIsMutable(); + assetFileDef_.remove(index); + onChanged(); + } else { + assetFileDefBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public org.tensorflow.proto.AssetFileDef.Builder getAssetFileDefBuilder( + int index) { + return getAssetFileDefFieldBuilder().getBuilder(index); + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public org.tensorflow.proto.AssetFileDefOrBuilder getAssetFileDefOrBuilder( + int index) { + if (assetFileDefBuilder_ == null) { + return assetFileDef_.get(index); } else { + return assetFileDefBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public java.util.List + getAssetFileDefOrBuilderList() { + if (assetFileDefBuilder_ != null) { + return assetFileDefBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(assetFileDef_); + } + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public org.tensorflow.proto.AssetFileDef.Builder addAssetFileDefBuilder() { + return getAssetFileDefFieldBuilder().addBuilder( + org.tensorflow.proto.AssetFileDef.getDefaultInstance()); + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public org.tensorflow.proto.AssetFileDef.Builder addAssetFileDefBuilder( + int index) { + return getAssetFileDefFieldBuilder().addBuilder( + index, org.tensorflow.proto.AssetFileDef.getDefaultInstance()); + } + /** + *
    +     * Asset file def to be used with the defined graph.
    +     * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + public java.util.List + getAssetFileDefBuilderList() { + return getAssetFileDefFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AssetFileDef, org.tensorflow.proto.AssetFileDef.Builder, org.tensorflow.proto.AssetFileDefOrBuilder> + getAssetFileDefFieldBuilder() { + if (assetFileDefBuilder_ == null) { + assetFileDefBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AssetFileDef, org.tensorflow.proto.AssetFileDef.Builder, org.tensorflow.proto.AssetFileDefOrBuilder>( + assetFileDef_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + assetFileDef_ = null; + } + return assetFileDefBuilder_; + } + + private org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph objectGraphDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder> objectGraphDefBuilder_; + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return Whether the objectGraphDef field is set. + */ + public boolean hasObjectGraphDef() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return The objectGraphDef. + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph getObjectGraphDef() { + if (objectGraphDefBuilder_ == null) { + return objectGraphDef_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; + } else { + return objectGraphDefBuilder_.getMessage(); + } + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public Builder setObjectGraphDef(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph value) { + if (objectGraphDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + objectGraphDef_ = value; + } else { + objectGraphDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public Builder setObjectGraphDef( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder builderForValue) { + if (objectGraphDefBuilder_ == null) { + objectGraphDef_ = builderForValue.build(); + } else { + objectGraphDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public Builder mergeObjectGraphDef(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph value) { + if (objectGraphDefBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + objectGraphDef_ != null && + objectGraphDef_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance()) { + getObjectGraphDefBuilder().mergeFrom(value); + } else { + objectGraphDef_ = value; + } + } else { + objectGraphDefBuilder_.mergeFrom(value); + } + if (objectGraphDef_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public Builder clearObjectGraphDef() { + bitField0_ = (bitField0_ & ~0x00000040); + objectGraphDef_ = null; + if (objectGraphDefBuilder_ != null) { + objectGraphDefBuilder_.dispose(); + objectGraphDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder getObjectGraphDefBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getObjectGraphDefFieldBuilder().getBuilder(); + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder() { + if (objectGraphDefBuilder_ != null) { + return objectGraphDefBuilder_.getMessageOrBuilder(); + } else { + return objectGraphDef_ == null ? + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance() : objectGraphDef_; + } + } + /** + *
    +     * Extra information about the structure of functions and stateful objects.
    +     * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder> + getObjectGraphDefFieldBuilder() { + if (objectGraphDefBuilder_ == null) { + objectGraphDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder>( + getObjectGraphDef(), + getParentForChildren(), + isClean()); + objectGraphDef_ = null; + } + return objectGraphDefBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MetaGraphDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MetaGraphDef) + private static final org.tensorflow.proto.MetaGraphDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MetaGraphDef(); + } + + public static org.tensorflow.proto.MetaGraphDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetaGraphDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MetaGraphDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDefOrBuilder.java new file mode 100644 index 00000000000..510b6c87bbc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphDefOrBuilder.java @@ -0,0 +1,269 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface MetaGraphDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.MetaGraphDef) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return Whether the metaInfoDef field is set. + */ + boolean hasMetaInfoDef(); + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + * @return The metaInfoDef. + */ + org.tensorflow.proto.MetaGraphDef.MetaInfoDef getMetaInfoDef(); + /** + * .tensorflow.MetaGraphDef.MetaInfoDef meta_info_def = 1; + */ + org.tensorflow.proto.MetaGraphDef.MetaInfoDefOrBuilder getMetaInfoDefOrBuilder(); + + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return Whether the graphDef field is set. + */ + boolean hasGraphDef(); + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + * @return The graphDef. + */ + org.tensorflow.proto.GraphDef getGraphDef(); + /** + *
    +   * GraphDef.
    +   * 
    + * + * .tensorflow.GraphDef graph_def = 2; + */ + org.tensorflow.proto.GraphDefOrBuilder getGraphDefOrBuilder(); + + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return Whether the saverDef field is set. + */ + boolean hasSaverDef(); + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + * @return The saverDef. + */ + org.tensorflow.proto.SaverDef getSaverDef(); + /** + *
    +   * SaverDef.
    +   * 
    + * + * .tensorflow.SaverDef saver_def = 3; + */ + org.tensorflow.proto.SaverDefOrBuilder getSaverDefOrBuilder(); + + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + int getCollectionDefCount(); + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + boolean containsCollectionDef( + java.lang.String key); + /** + * Use {@link #getCollectionDefMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getCollectionDef(); + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + java.util.Map + getCollectionDefMap(); + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + /* nullable */ +org.tensorflow.proto.CollectionDef getCollectionDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.CollectionDef defaultValue); + /** + *
    +   * collection_def: Map from collection name to collections.
    +   * See CollectionDef section for details.
    +   * 
    + * + * map<string, .tensorflow.CollectionDef> collection_def = 4; + */ + org.tensorflow.proto.CollectionDef getCollectionDefOrThrow( + java.lang.String key); + + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + int getSignatureDefCount(); + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + boolean containsSignatureDef( + java.lang.String key); + /** + * Use {@link #getSignatureDefMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSignatureDef(); + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + java.util.Map + getSignatureDefMap(); + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + /* nullable */ +org.tensorflow.proto.SignatureDef getSignatureDefOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SignatureDef defaultValue); + /** + *
    +   * signature_def: Map from user supplied key for a signature to a single
    +   * SignatureDef.
    +   * 
    + * + * map<string, .tensorflow.SignatureDef> signature_def = 5; + */ + org.tensorflow.proto.SignatureDef getSignatureDefOrThrow( + java.lang.String key); + + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + java.util.List + getAssetFileDefList(); + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + org.tensorflow.proto.AssetFileDef getAssetFileDef(int index); + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + int getAssetFileDefCount(); + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + java.util.List + getAssetFileDefOrBuilderList(); + /** + *
    +   * Asset file def to be used with the defined graph.
    +   * 
    + * + * repeated .tensorflow.AssetFileDef asset_file_def = 6; + */ + org.tensorflow.proto.AssetFileDefOrBuilder getAssetFileDefOrBuilder( + int index); + + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return Whether the objectGraphDef field is set. + */ + boolean hasObjectGraphDef(); + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + * @return The objectGraphDef. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph getObjectGraphDef(); + /** + *
    +   * Extra information about the structure of functions and stateful objects.
    +   * 
    + * + * .tensorflow.SavedObjectGraph object_graph_def = 7; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder getObjectGraphDefOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphProtos.java new file mode 100644 index 00000000000..eb8242aed48 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetaGraphProtos.java @@ -0,0 +1,347 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class MetaGraphProtos { + private MetaGraphProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MetaGraphProtos.class.getName()); + } + 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_MetaGraphDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MetaGraphDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_NodeList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_BytesList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_Int64List_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_FloatList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CollectionDef_AnyList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorInfo_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorInfo_CooSparse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SignatureDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SignatureDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SignatureDef_InputsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SignatureDef_InputsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SignatureDef_OutputsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SignatureDef_DefaultsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SignatureDef_DefaultsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_AssetFileDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_AssetFileDef_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/meta_graph.pr" + + "oto\022\ntensorflow\032\031google/protobuf/any.pro" + + "to\032%tensorflow/core/framework/graph.prot" + + "o\032&tensorflow/core/framework/op_def.prot" + + "o\032&tensorflow/core/framework/tensor.prot" + + "o\032,tensorflow/core/framework/tensor_shap" + + "e.proto\032%tensorflow/core/framework/types" + + ".proto\0321tensorflow/core/protobuf/saved_o" + + "bject_graph.proto\032$tensorflow/core/proto" + + "buf/saver.proto\032%tensorflow/core/protobu" + + "f/struct.proto\"\250\007\n\014MetaGraphDef\022;\n\rmeta_" + + "info_def\030\001 \001(\0132$.tensorflow.MetaGraphDef" + + ".MetaInfoDef\022\'\n\tgraph_def\030\002 \001(\0132\024.tensor" + + "flow.GraphDef\022\'\n\tsaver_def\030\003 \001(\0132\024.tenso" + + "rflow.SaverDef\022C\n\016collection_def\030\004 \003(\0132+" + + ".tensorflow.MetaGraphDef.CollectionDefEn" + + "try\022A\n\rsignature_def\030\005 \003(\0132*.tensorflow." + + "MetaGraphDef.SignatureDefEntry\0220\n\016asset_" + + "file_def\030\006 \003(\0132\030.tensorflow.AssetFileDef" + + "\0226\n\020object_graph_def\030\007 \001(\0132\034.tensorflow." + + "SavedObjectGraph\032\366\002\n\013MetaInfoDef\022\032\n\022meta" + + "_graph_version\030\001 \001(\t\022,\n\020stripped_op_list" + + "\030\002 \001(\0132\022.tensorflow.OpList\022&\n\010any_info\030\003" + + " \001(\0132\024.google.protobuf.Any\022\014\n\004tags\030\004 \003(\t" + + "\022\032\n\022tensorflow_version\030\005 \001(\t\022\036\n\026tensorfl" + + "ow_git_version\030\006 \001(\t\022\036\n\026stripped_default" + + "_attrs\030\007 \001(\010\022S\n\020function_aliases\030\010 \003(\01329" + + ".tensorflow.MetaGraphDef.MetaInfoDef.Fun" + + "ctionAliasesEntry\0326\n\024FunctionAliasesEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032O\n\022Col" + + "lectionDefEntry\022\013\n\003key\030\001 \001(\t\022(\n\005value\030\002 " + + "\001(\0132\031.tensorflow.CollectionDef:\0028\001\032M\n\021Si" + + "gnatureDefEntry\022\013\n\003key\030\001 \001(\t\022\'\n\005value\030\002 " + + "\001(\0132\030.tensorflow.SignatureDef:\0028\001\"\337\003\n\rCo" + + "llectionDef\0227\n\tnode_list\030\001 \001(\0132\".tensorf" + + "low.CollectionDef.NodeListH\000\0229\n\nbytes_li" + + "st\030\002 \001(\0132#.tensorflow.CollectionDef.Byte" + + "sListH\000\0229\n\nint64_list\030\003 \001(\0132#.tensorflow" + + ".CollectionDef.Int64ListH\000\0229\n\nfloat_list" + + "\030\004 \001(\0132#.tensorflow.CollectionDef.FloatL" + + "istH\000\0225\n\010any_list\030\005 \001(\0132!.tensorflow.Col" + + "lectionDef.AnyListH\000\032\031\n\010NodeList\022\r\n\005valu" + + "e\030\001 \003(\t\032\032\n\tBytesList\022\r\n\005value\030\001 \003(\014\032\036\n\tI" + + "nt64List\022\021\n\005value\030\001 \003(\003B\002\020\001\032\036\n\tFloatList" + + "\022\021\n\005value\030\001 \003(\002B\002\020\001\032.\n\007AnyList\022#\n\005value\030" + + "\001 \003(\0132\024.google.protobuf.AnyB\006\n\004kind\"\321\003\n\n" + + "TensorInfo\022\016\n\004name\030\001 \001(\tH\000\0226\n\ncoo_sparse" + + "\030\004 \001(\0132 .tensorflow.TensorInfo.CooSparse" + + "H\000\022B\n\020composite_tensor\030\005 \001(\0132&.tensorflo" + + "w.TensorInfo.CompositeTensorH\000\022#\n\005dtype\030" + + "\002 \001(\0162\024.tensorflow.DataType\0222\n\014tensor_sh" + + "ape\030\003 \001(\0132\034.tensorflow.TensorShapeProto\032" + + "e\n\tCooSparse\022\032\n\022values_tensor_name\030\001 \001(\t" + + "\022\033\n\023indices_tensor_name\030\002 \001(\t\022\037\n\027dense_s" + + "hape_tensor_name\030\003 \001(\t\032k\n\017CompositeTenso" + + "r\022,\n\ttype_spec\030\001 \001(\0132\031.tensorflow.TypeSp" + + "ecProto\022*\n\ncomponents\030\002 \003(\0132\026.tensorflow" + + ".TensorInfoB\n\n\010encoding\"\244\003\n\014SignatureDef" + + "\0224\n\006inputs\030\001 \003(\0132$.tensorflow.SignatureD" + + "ef.InputsEntry\0226\n\007outputs\030\002 \003(\0132%.tensor" + + "flow.SignatureDef.OutputsEntry\022\023\n\013method" + + "_name\030\003 \001(\t\0228\n\010defaults\030\004 \003(\0132&.tensorfl" + + "ow.SignatureDef.DefaultsEntry\032E\n\013InputsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.tenso" + + "rflow.TensorInfo:\0028\001\032F\n\014OutputsEntry\022\013\n\003" + + "key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.tensorflow.Te" + + "nsorInfo:\0028\001\032H\n\rDefaultsEntry\022\013\n\003key\030\001 \001" + + "(\t\022&\n\005value\030\002 \001(\0132\027.tensorflow.TensorPro" + + "to:\0028\001\"M\n\014AssetFileDef\022+\n\013tensor_info\030\001 " + + "\001(\0132\026.tensorflow.TensorInfo\022\020\n\010filename\030" + + "\002 \001(\tB\203\001\n\024org.tensorflow.protoB\017MetaGrap" + + "hProtosP\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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + org.tensorflow.proto.GraphProtos.getDescriptor(), + org.tensorflow.proto.OpDefProtos.getDescriptor(), + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + org.tensorflow.proto.SavedObjectGraphOuterClass.getDescriptor(), + org.tensorflow.proto.SaverProtos.getDescriptor(), + org.tensorflow.proto.Struct.getDescriptor(), + }); + internal_static_tensorflow_MetaGraphDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_MetaGraphDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MetaGraphDef_descriptor, + new java.lang.String[] { "MetaInfoDef", "GraphDef", "SaverDef", "CollectionDef", "SignatureDef", "AssetFileDef", "ObjectGraphDef", }); + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor = + internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor, + new java.lang.String[] { "MetaGraphVersion", "StrippedOpList", "AnyInfo", "Tags", "TensorflowVersion", "TensorflowGitVersion", "StrippedDefaultAttrs", "FunctionAliases", }); + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor = + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MetaGraphDef_MetaInfoDef_FunctionAliasesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor = + internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MetaGraphDef_CollectionDefEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor = + internal_static_tensorflow_MetaGraphDef_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_MetaGraphDef_SignatureDefEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_CollectionDef_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_CollectionDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_descriptor, + new java.lang.String[] { "NodeList", "BytesList", "Int64List", "FloatList", "AnyList", "Kind", }); + internal_static_tensorflow_CollectionDef_NodeList_descriptor = + internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_CollectionDef_NodeList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_NodeList_descriptor, + new java.lang.String[] { "Value", }); + internal_static_tensorflow_CollectionDef_BytesList_descriptor = + internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_CollectionDef_BytesList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_BytesList_descriptor, + new java.lang.String[] { "Value", }); + internal_static_tensorflow_CollectionDef_Int64List_descriptor = + internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_CollectionDef_Int64List_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_Int64List_descriptor, + new java.lang.String[] { "Value", }); + internal_static_tensorflow_CollectionDef_FloatList_descriptor = + internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(3); + internal_static_tensorflow_CollectionDef_FloatList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_FloatList_descriptor, + new java.lang.String[] { "Value", }); + internal_static_tensorflow_CollectionDef_AnyList_descriptor = + internal_static_tensorflow_CollectionDef_descriptor.getNestedTypes().get(4); + internal_static_tensorflow_CollectionDef_AnyList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CollectionDef_AnyList_descriptor, + new java.lang.String[] { "Value", }); + internal_static_tensorflow_TensorInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_TensorInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorInfo_descriptor, + new java.lang.String[] { "Name", "CooSparse", "CompositeTensor", "Dtype", "TensorShape", "Encoding", }); + internal_static_tensorflow_TensorInfo_CooSparse_descriptor = + internal_static_tensorflow_TensorInfo_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorInfo_CooSparse_descriptor, + new java.lang.String[] { "ValuesTensorName", "IndicesTensorName", "DenseShapeTensorName", }); + internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor = + internal_static_tensorflow_TensorInfo_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor, + new java.lang.String[] { "TypeSpec", "Components", }); + internal_static_tensorflow_SignatureDef_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_SignatureDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SignatureDef_descriptor, + new java.lang.String[] { "Inputs", "Outputs", "MethodName", "Defaults", }); + internal_static_tensorflow_SignatureDef_InputsEntry_descriptor = + internal_static_tensorflow_SignatureDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_SignatureDef_InputsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SignatureDef_InputsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor = + internal_static_tensorflow_SignatureDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_SignatureDef_OutputsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_SignatureDef_DefaultsEntry_descriptor = + internal_static_tensorflow_SignatureDef_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_SignatureDef_DefaultsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SignatureDef_DefaultsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_AssetFileDef_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_AssetFileDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_AssetFileDef_descriptor, + new java.lang.String[] { "TensorInfo", "Filename", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.AnyProto.getDescriptor(); + org.tensorflow.proto.GraphProtos.getDescriptor(); + org.tensorflow.proto.OpDefProtos.getDescriptor(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + org.tensorflow.proto.SavedObjectGraphOuterClass.getDescriptor(); + org.tensorflow.proto.SaverProtos.getDescriptor(); + org.tensorflow.proto.Struct.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntry.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntry.java new file mode 100644 index 00000000000..b0190343737 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntry.java @@ -0,0 +1,1087 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.MetricEntry} + */ +public final class MetricEntry extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.MetricEntry) + MetricEntryOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MetricEntry.class.getName()); + } + // Use MetricEntry.newBuilder() to construct. + private MetricEntry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MetricEntry() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MetricEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetricEntry.class, org.tensorflow.proto.MetricEntry.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Metric name
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Metric name
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 VALUE_FIELD_NUMBER = 2; + private double value_ = 0D; + /** + *
    +   * Metric value
    +   * 
    + * + * double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int MIN_VALUE_FIELD_NUMBER = 3; + private com.google.protobuf.DoubleValue minValue_; + /** + *
    +   * The minimum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + * @return Whether the minValue field is set. + */ + @java.lang.Override + public boolean hasMinValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The minimum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + * @return The minValue. + */ + @java.lang.Override + public com.google.protobuf.DoubleValue getMinValue() { + return minValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; + } + /** + *
    +   * The minimum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + @java.lang.Override + public com.google.protobuf.DoubleValueOrBuilder getMinValueOrBuilder() { + return minValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; + } + + public static final int MAX_VALUE_FIELD_NUMBER = 4; + private com.google.protobuf.DoubleValue maxValue_; + /** + *
    +   * The maximum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + * @return Whether the maxValue field is set. + */ + @java.lang.Override + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The maximum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + * @return The maxValue. + */ + @java.lang.Override + public com.google.protobuf.DoubleValue getMaxValue() { + return maxValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; + } + /** + *
    +   * The maximum acceptable value for the metric if specified
    +   * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + @java.lang.Override + public com.google.protobuf.DoubleValueOrBuilder getMaxValueOrBuilder() { + return maxValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(2, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getMaxValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, value_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMinValue()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getMaxValue()); + } + size += getUnknownFields().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.MetricEntry)) { + return super.equals(obj); + } + org.tensorflow.proto.MetricEntry other = (org.tensorflow.proto.MetricEntry) obj; + + if (!getName() + .equals(other.getName())) return false; + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + if (hasMinValue() != other.hasMinValue()) return false; + if (hasMinValue()) { + if (!getMinValue() + .equals(other.getMinValue())) return false; + } + if (hasMaxValue() != other.hasMaxValue()) return false; + if (hasMaxValue()) { + if (!getMaxValue() + .equals(other.getMaxValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + if (hasMinValue()) { + hash = (37 * hash) + MIN_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMinValue().hashCode(); + } + if (hasMaxValue()) { + hash = (37 * hash) + MAX_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getMaxValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.MetricEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetricEntry 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.MetricEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetricEntry 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.MetricEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.MetricEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.MetricEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetricEntry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.MetricEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.MetricEntry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.MetricEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.MetricEntry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.MetricEntry 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.MetricEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.MetricEntry) + org.tensorflow.proto.MetricEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MetricEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.MetricEntry.class, org.tensorflow.proto.MetricEntry.Builder.class); + } + + // Construct using org.tensorflow.proto.MetricEntry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMinValueFieldBuilder(); + getMaxValueFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = 0D; + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_MetricEntry_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.MetricEntry getDefaultInstanceForType() { + return org.tensorflow.proto.MetricEntry.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.MetricEntry build() { + org.tensorflow.proto.MetricEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.MetricEntry buildPartial() { + org.tensorflow.proto.MetricEntry result = new org.tensorflow.proto.MetricEntry(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.MetricEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.minValue_ = minValueBuilder_ == null + ? minValue_ + : minValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.maxValue_ = maxValueBuilder_ == null + ? maxValue_ + : maxValueBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.MetricEntry) { + return mergeFrom((org.tensorflow.proto.MetricEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.MetricEntry other) { + if (other == org.tensorflow.proto.MetricEntry.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (other.hasMinValue()) { + mergeMinValue(other.getMinValue()); + } + if (other.hasMaxValue()) { + mergeMaxValue(other.getMaxValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: { + value_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 26: { + input.readMessage( + getMinValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getMaxValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Metric name
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Metric name
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Metric name
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Metric name
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Metric name
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double value_ ; + /** + *
    +     * Metric value
    +     * 
    + * + * double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + *
    +     * Metric value
    +     * 
    + * + * double value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Metric value
    +     * 
    + * + * double value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.DoubleValue minValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> minValueBuilder_; + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + * @return Whether the minValue field is set. + */ + public boolean hasMinValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + * @return The minValue. + */ + public com.google.protobuf.DoubleValue getMinValue() { + if (minValueBuilder_ == null) { + return minValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; + } else { + return minValueBuilder_.getMessage(); + } + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public Builder setMinValue(com.google.protobuf.DoubleValue value) { + if (minValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minValue_ = value; + } else { + minValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public Builder setMinValue( + com.google.protobuf.DoubleValue.Builder builderForValue) { + if (minValueBuilder_ == null) { + minValue_ = builderForValue.build(); + } else { + minValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public Builder mergeMinValue(com.google.protobuf.DoubleValue value) { + if (minValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + minValue_ != null && + minValue_ != com.google.protobuf.DoubleValue.getDefaultInstance()) { + getMinValueBuilder().mergeFrom(value); + } else { + minValue_ = value; + } + } else { + minValueBuilder_.mergeFrom(value); + } + if (minValue_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public Builder clearMinValue() { + bitField0_ = (bitField0_ & ~0x00000004); + minValue_ = null; + if (minValueBuilder_ != null) { + minValueBuilder_.dispose(); + minValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public com.google.protobuf.DoubleValue.Builder getMinValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getMinValueFieldBuilder().getBuilder(); + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + public com.google.protobuf.DoubleValueOrBuilder getMinValueOrBuilder() { + if (minValueBuilder_ != null) { + return minValueBuilder_.getMessageOrBuilder(); + } else { + return minValue_ == null ? + com.google.protobuf.DoubleValue.getDefaultInstance() : minValue_; + } + } + /** + *
    +     * The minimum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue min_value = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> + getMinValueFieldBuilder() { + if (minValueBuilder_ == null) { + minValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder>( + getMinValue(), + getParentForChildren(), + isClean()); + minValue_ = null; + } + return minValueBuilder_; + } + + private com.google.protobuf.DoubleValue maxValue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> maxValueBuilder_; + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + * @return Whether the maxValue field is set. + */ + public boolean hasMaxValue() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + * @return The maxValue. + */ + public com.google.protobuf.DoubleValue getMaxValue() { + if (maxValueBuilder_ == null) { + return maxValue_ == null ? com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; + } else { + return maxValueBuilder_.getMessage(); + } + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public Builder setMaxValue(com.google.protobuf.DoubleValue value) { + if (maxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxValue_ = value; + } else { + maxValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public Builder setMaxValue( + com.google.protobuf.DoubleValue.Builder builderForValue) { + if (maxValueBuilder_ == null) { + maxValue_ = builderForValue.build(); + } else { + maxValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public Builder mergeMaxValue(com.google.protobuf.DoubleValue value) { + if (maxValueBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + maxValue_ != null && + maxValue_ != com.google.protobuf.DoubleValue.getDefaultInstance()) { + getMaxValueBuilder().mergeFrom(value); + } else { + maxValue_ = value; + } + } else { + maxValueBuilder_.mergeFrom(value); + } + if (maxValue_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public Builder clearMaxValue() { + bitField0_ = (bitField0_ & ~0x00000008); + maxValue_ = null; + if (maxValueBuilder_ != null) { + maxValueBuilder_.dispose(); + maxValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public com.google.protobuf.DoubleValue.Builder getMaxValueBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getMaxValueFieldBuilder().getBuilder(); + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + public com.google.protobuf.DoubleValueOrBuilder getMaxValueOrBuilder() { + if (maxValueBuilder_ != null) { + return maxValueBuilder_.getMessageOrBuilder(); + } else { + return maxValue_ == null ? + com.google.protobuf.DoubleValue.getDefaultInstance() : maxValue_; + } + } + /** + *
    +     * The maximum acceptable value for the metric if specified
    +     * 
    + * + * .google.protobuf.DoubleValue max_value = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder> + getMaxValueFieldBuilder() { + if (maxValueBuilder_ == null) { + maxValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.DoubleValue, com.google.protobuf.DoubleValue.Builder, com.google.protobuf.DoubleValueOrBuilder>( + getMaxValue(), + getParentForChildren(), + isClean()); + maxValue_ = null; + } + return maxValueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.MetricEntry) + } + + // @@protoc_insertion_point(class_scope:tensorflow.MetricEntry) + private static final org.tensorflow.proto.MetricEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.MetricEntry(); + } + + public static org.tensorflow.proto.MetricEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MetricEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.MetricEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntryOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntryOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntryOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntryOrBuilder.java index eeb12bca8a9..3d0eec363a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/MetricEntryOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/MetricEntryOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface MetricEntryOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.MetricEntry) @@ -13,6 +15,7 @@ public interface MetricEntryOrBuilder extends *
    * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -21,6 +24,7 @@ public interface MetricEntryOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -31,6 +35,7 @@ public interface MetricEntryOrBuilder extends * * * double value = 2; + * @return The value. */ double getValue(); @@ -40,6 +45,7 @@ public interface MetricEntryOrBuilder extends * * * .google.protobuf.DoubleValue min_value = 3; + * @return Whether the minValue field is set. */ boolean hasMinValue(); /** @@ -48,6 +54,7 @@ public interface MetricEntryOrBuilder extends * * * .google.protobuf.DoubleValue min_value = 3; + * @return The minValue. */ com.google.protobuf.DoubleValue getMinValue(); /** @@ -65,6 +72,7 @@ public interface MetricEntryOrBuilder extends * * * .google.protobuf.DoubleValue max_value = 4; + * @return Whether the maxValue field is set. */ boolean hasMaxValue(); /** @@ -73,6 +81,7 @@ public interface MetricEntryOrBuilder extends * * * .google.protobuf.DoubleValue max_value = 4; + * @return The maxValue. */ com.google.protobuf.DoubleValue getMaxValue(); /** diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrList.java new file mode 100644 index 00000000000..b79641012af --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrList.java @@ -0,0 +1,817 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/attr_value.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A list of attr names and their values. The whole list is attached
    + * with a string name.  E.g., MatMul[T=float].
    + * 
    + * + * Protobuf type {@code tensorflow.NameAttrList} + */ +public final class NameAttrList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NameAttrList) + NameAttrListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NameAttrList.class.getName()); + } + // Use NameAttrList.newBuilder() to construct. + private NameAttrList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NameAttrList() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NameAttrList.class, org.tensorflow.proto.NameAttrList.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 ATTR_FIELD_NUMBER = 2; + private static final class AttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_AttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> attr_; + private com.google.protobuf.MapField + internalGetAttr() { + if (attr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttrDefaultEntryHolder.defaultEntry); + } + return attr_; + } + public int getAttrCount() { + return internalGetAttr().getMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().getMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAttr(), + AttrDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry + : internalGetAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attr__); + } + size += getUnknownFields().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.NameAttrList)) { + return super.equals(obj); + } + org.tensorflow.proto.NameAttrList other = (org.tensorflow.proto.NameAttrList) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!internalGetAttr().equals( + other.internalGetAttr())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (!internalGetAttr().getMap().isEmpty()) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttr().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NameAttrList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NameAttrList 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.NameAttrList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NameAttrList 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.NameAttrList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NameAttrList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NameAttrList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NameAttrList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NameAttrList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NameAttrList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NameAttrList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NameAttrList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NameAttrList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A list of attr names and their values. The whole list is attached
    +   * with a string name.  E.g., MatMul[T=float].
    +   * 
    + * + * Protobuf type {@code tensorflow.NameAttrList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NameAttrList) + org.tensorflow.proto.NameAttrListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NameAttrList.class, org.tensorflow.proto.NameAttrList.Builder.class); + } + + // Construct using org.tensorflow.proto.NameAttrList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableAttr().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.AttrValueProtos.internal_static_tensorflow_NameAttrList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NameAttrList getDefaultInstanceForType() { + return org.tensorflow.proto.NameAttrList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NameAttrList build() { + org.tensorflow.proto.NameAttrList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NameAttrList buildPartial() { + org.tensorflow.proto.NameAttrList result = new org.tensorflow.proto.NameAttrList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.NameAttrList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attr_ = internalGetAttr().build(AttrDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NameAttrList) { + return mergeFrom((org.tensorflow.proto.NameAttrList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NameAttrList other) { + if (other == org.tensorflow.proto.NameAttrList.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableAttr().mergeFrom( + other.internalGetAttr()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + attr__ = input.readMessage( + AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAttr().ensureBuilderMap().put( + attr__.getKey(), attr__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class AttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AttrDefaultEntryHolder.defaultEntry; + } + }; + private static final AttrConverter attrConverter = new AttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> attr_; + private com.google.protobuf.MapFieldBuilder + internalGetAttr() { + if (attr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + return attr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAttr() { + if (attr_ == null) { + attr_ = new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return attr_; + } + public int getAttrCount() { + return internalGetAttr().ensureBuilderMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getImmutableMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + return map.containsKey(key) ? attrConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attrConverter.build(map.get(key)); + } + public Builder clearAttr() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableAttr().clear(); + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder removeAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttr() { + bitField0_ |= 0x00000002; + return internalGetMutableAttr().ensureMessageMap(); + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder putAttr( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder putAllAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public org.tensorflow.proto.AttrValue.Builder putAttrBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAttr().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NameAttrList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NameAttrList) + private static final org.tensorflow.proto.NameAttrList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NameAttrList(); + } + + public static org.tensorflow.proto.NameAttrList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NameAttrList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NameAttrList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrListOrBuilder.java new file mode 100644 index 00000000000..132bb9b6aa8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NameAttrListOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/attr_value.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface NameAttrListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NameAttrList) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + int getAttrCount(); + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + boolean containsAttr( + java.lang.String key); + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttr(); + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + java.util.Map + getAttrMap(); + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue); + /** + * map<string, .tensorflow.AttrValue> attr = 2; + */ + org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProto.java new file mode 100644 index 00000000000..ac9667ae7b8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProto.java @@ -0,0 +1,838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/named_tensor.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A pair of tensor name and tensor values.
    + * 
    + * + * Protobuf type {@code tensorflow.NamedTensorProto} + */ +public final class NamedTensorProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NamedTensorProto) + NamedTensorProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NamedTensorProto.class.getName()); + } + // Use NamedTensorProto.newBuilder() to construct. + private NamedTensorProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NamedTensorProto() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NamedTensorProto.class, org.tensorflow.proto.NamedTensorProto.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 TENSOR_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorProto tensor_; + /** + *
    +   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +   * directly using the protobuf field accessors.
    +   *
    +   * The client specifies whether the returned tensor values should be
    +   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +   * compact form in tensor.tensor_content.
    +   * 
    + * + * .tensorflow.TensorProto tensor = 2; + * @return Whether the tensor field is set. + */ + @java.lang.Override + public boolean hasTensor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +   * directly using the protobuf field accessors.
    +   *
    +   * The client specifies whether the returned tensor values should be
    +   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +   * compact form in tensor.tensor_content.
    +   * 
    + * + * .tensorflow.TensorProto tensor = 2; + * @return The tensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensor() { + return tensor_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensor_; + } + /** + *
    +   * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +   * directly using the protobuf field accessors.
    +   *
    +   * The client specifies whether the returned tensor values should be
    +   * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +   * compact form in tensor.tensor_content.
    +   * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder() { + return tensor_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensor_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTensor()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTensor()); + } + size += getUnknownFields().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.NamedTensorProto)) { + return super.equals(obj); + } + org.tensorflow.proto.NamedTensorProto other = (org.tensorflow.proto.NamedTensorProto) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasTensor() != other.hasTensor()) return false; + if (hasTensor()) { + if (!getTensor() + .equals(other.getTensor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasTensor()) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensor().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NamedTensorProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NamedTensorProto 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.NamedTensorProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NamedTensorProto 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.NamedTensorProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NamedTensorProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NamedTensorProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NamedTensorProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NamedTensorProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NamedTensorProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NamedTensorProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NamedTensorProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NamedTensorProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A pair of tensor name and tensor values.
    +   * 
    + * + * Protobuf type {@code tensorflow.NamedTensorProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NamedTensorProto) + org.tensorflow.proto.NamedTensorProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NamedTensorProto.class, org.tensorflow.proto.NamedTensorProto.Builder.class); + } + + // Construct using org.tensorflow.proto.NamedTensorProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.NamedTensorProtos.internal_static_tensorflow_NamedTensorProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NamedTensorProto getDefaultInstanceForType() { + return org.tensorflow.proto.NamedTensorProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NamedTensorProto build() { + org.tensorflow.proto.NamedTensorProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NamedTensorProto buildPartial() { + org.tensorflow.proto.NamedTensorProto result = new org.tensorflow.proto.NamedTensorProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.NamedTensorProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tensor_ = tensorBuilder_ == null + ? tensor_ + : tensorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NamedTensorProto) { + return mergeFrom((org.tensorflow.proto.NamedTensorProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NamedTensorProto other) { + if (other == org.tensorflow.proto.NamedTensorProto.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTensor()) { + mergeTensor(other.getTensor()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getTensorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorProto tensor_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorBuilder_; + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + * @return Whether the tensor field is set. + */ + public boolean hasTensor() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + * @return The tensor. + */ + public org.tensorflow.proto.TensorProto getTensor() { + if (tensorBuilder_ == null) { + return tensor_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : tensor_; + } else { + return tensorBuilder_.getMessage(); + } + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public Builder setTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensor_ = value; + } else { + tensorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public Builder setTensor( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + tensor_ = builderForValue.build(); + } else { + tensorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public Builder mergeTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + tensor_ != null && + tensor_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getTensorBuilder().mergeFrom(value); + } else { + tensor_ = value; + } + } else { + tensorBuilder_.mergeFrom(value); + } + if (tensor_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public Builder clearTensor() { + bitField0_ = (bitField0_ & ~0x00000002); + tensor_ = null; + if (tensorBuilder_ != null) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTensorFieldBuilder().getBuilder(); + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilder(); + } else { + return tensor_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : tensor_; + } + } + /** + *
    +     * The client can populate a TensorProto using a tensorflow::Tensor`, or
    +     * directly using the protobuf field accessors.
    +     *
    +     * The client specifies whether the returned tensor values should be
    +     * filled tensor fields (float_val, int_val, etc.) or encoded in a
    +     * compact form in tensor.tensor_content.
    +     * 
    + * + * .tensorflow.TensorProto tensor = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getTensor(), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NamedTensorProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NamedTensorProto) + private static final org.tensorflow.proto.NamedTensorProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NamedTensorProto(); + } + + public static org.tensorflow.proto.NamedTensorProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NamedTensorProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NamedTensorProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtoOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtoOrBuilder.java index 41b758b2f91..236bd5974fe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NamedTensorProtoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/named_tensor.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface NamedTensorProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.NamedTensorProto) @@ -13,6 +15,7 @@ public interface NamedTensorProtoOrBuilder extends * * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -21,6 +24,7 @@ public interface NamedTensorProtoOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -29,30 +33,35 @@ public interface NamedTensorProtoOrBuilder extends *
        * The client can populate a TensorProto using a tensorflow::Tensor`, or
        * directly using the protobuf field accessors.
    +   *
        * The client specifies whether the returned tensor values should be
        * filled tensor fields (float_val, int_val, etc.) or encoded in a
        * compact form in tensor.tensor_content.
        * 
    * * .tensorflow.TensorProto tensor = 2; + * @return Whether the tensor field is set. */ boolean hasTensor(); /** *
        * The client can populate a TensorProto using a tensorflow::Tensor`, or
        * directly using the protobuf field accessors.
    +   *
        * The client specifies whether the returned tensor values should be
        * filled tensor fields (float_val, int_val, etc.) or encoded in a
        * compact form in tensor.tensor_content.
        * 
    * * .tensorflow.TensorProto tensor = 2; + * @return The tensor. */ - org.tensorflow.proto.framework.TensorProto getTensor(); + org.tensorflow.proto.TensorProto getTensor(); /** *
        * The client can populate a TensorProto using a tensorflow::Tensor`, or
        * directly using the protobuf field accessors.
    +   *
        * The client specifies whether the returned tensor values should be
        * filled tensor fields (float_val, int_val, etc.) or encoded in a
        * compact form in tensor.tensor_content.
    @@ -60,5 +69,5 @@ public interface NamedTensorProtoOrBuilder extends
        *
        * .tensorflow.TensorProto tensor = 2;
        */
    -  org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorOrBuilder();
    +  org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtos.java
    new file mode 100644
    index 00000000000..bbc43be0671
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NamedTensorProtos.java
    @@ -0,0 +1,67 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/named_tensor.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class NamedTensorProtos {
    +  private NamedTensorProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      NamedTensorProtos.class.getName());
    +  }
    +  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_NamedTensorProto_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_NamedTensorProto_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/named_tensor." +
    +      "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\205\001\n\024org.tensorflow.protoB\021N" +
    +      "amedTensorProtosP\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,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.TensorProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_NamedTensorProto_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_NamedTensorProto_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_NamedTensorProto_descriptor,
    +        new java.lang.String[] { "Name", "Tensor", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.TensorProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDef.java
    new file mode 100644
    index 00000000000..c6490a052ac
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDef.java
    @@ -0,0 +1,3430 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/node_def.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.NodeDef}
    + */
    +public final class NodeDef extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.NodeDef)
    +    NodeDefOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      NodeDef.class.getName());
    +  }
    +  // Use NodeDef.newBuilder() to construct.
    +  private NodeDef(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private NodeDef() {
    +    name_ = "";
    +    op_ = "";
    +    input_ =
    +        com.google.protobuf.LazyStringArrayList.emptyList();
    +    device_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_descriptor;
    +  }
    +
    +  @SuppressWarnings({"rawtypes"})
    +  @java.lang.Override
    +  protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
    +      int number) {
    +    switch (number) {
    +      case 5:
    +        return internalGetAttr();
    +      default:
    +        throw new RuntimeException(
    +            "Invalid map field number: " + number);
    +    }
    +  }
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.NodeDef.class, org.tensorflow.proto.NodeDef.Builder.class);
    +  }
    +
    +  public interface ExperimentalDebugInfoOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.NodeDef.ExperimentalDebugInfo)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * 
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @return A list containing the originalNodeNames. + */ + java.util.List + getOriginalNodeNamesList(); + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @return The count of originalNodeNames. + */ + int getOriginalNodeNamesCount(); + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the element to return. + * @return The originalNodeNames at the given index. + */ + java.lang.String getOriginalNodeNames(int index); + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the value to return. + * @return The bytes of the originalNodeNames at the given index. + */ + com.google.protobuf.ByteString + getOriginalNodeNamesBytes(int index); + + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @return A list containing the originalFuncNames. + */ + java.util.List + getOriginalFuncNamesList(); + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @return The count of originalFuncNames. + */ + int getOriginalFuncNamesCount(); + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the element to return. + * @return The originalFuncNames at the given index. + */ + java.lang.String getOriginalFuncNames(int index); + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the value to return. + * @return The bytes of the originalFuncNames at the given index. + */ + com.google.protobuf.ByteString + getOriginalFuncNamesBytes(int index); + } + /** + * Protobuf type {@code tensorflow.NodeDef.ExperimentalDebugInfo} + */ + public static final class ExperimentalDebugInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NodeDef.ExperimentalDebugInfo) + ExperimentalDebugInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ExperimentalDebugInfo.class.getName()); + } + // Use ExperimentalDebugInfo.newBuilder() to construct. + private ExperimentalDebugInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ExperimentalDebugInfo() { + originalNodeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + originalFuncNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.class, org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder.class); + } + + public static final int ORIGINAL_NODE_NAMES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList originalNodeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @return A list containing the originalNodeNames. + */ + public com.google.protobuf.ProtocolStringList + getOriginalNodeNamesList() { + return originalNodeNames_; + } + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @return The count of originalNodeNames. + */ + public int getOriginalNodeNamesCount() { + return originalNodeNames_.size(); + } + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the element to return. + * @return The originalNodeNames at the given index. + */ + public java.lang.String getOriginalNodeNames(int index) { + return originalNodeNames_.get(index); + } + /** + *
    +     * Opaque string inserted into error messages created by the runtime.
    +     *
    +     * This is intended to store the list of names of the nodes from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +     * be {A, B}. This information can be used to map errors originating at the
    +     * current node to some top level source code.
    +     * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the value to return. + * @return The bytes of the originalNodeNames at the given index. + */ + public com.google.protobuf.ByteString + getOriginalNodeNamesBytes(int index) { + return originalNodeNames_.getByteString(index); + } + + public static final int ORIGINAL_FUNC_NAMES_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList originalFuncNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @return A list containing the originalFuncNames. + */ + public com.google.protobuf.ProtocolStringList + getOriginalFuncNamesList() { + return originalFuncNames_; + } + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @return The count of originalFuncNames. + */ + public int getOriginalFuncNamesCount() { + return originalFuncNames_.size(); + } + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the element to return. + * @return The originalFuncNames at the given index. + */ + public java.lang.String getOriginalFuncNames(int index) { + return originalFuncNames_.get(index); + } + /** + *
    +     * This is intended to store the list of names of the functions from the
    +     * original graph that this node was derived. For example if this node, say
    +     * C, was result of a fusion of node A in function FA and node B in function
    +     * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +     * level graph, the `original_func` is empty. This information, with the
    +     * `original_node_names` can be used to map errors originating at the
    +     * current ndoe to some top level source code.
    +     * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the value to return. + * @return The bytes of the originalFuncNames at the given index. + */ + public com.google.protobuf.ByteString + getOriginalFuncNamesBytes(int index) { + return originalFuncNames_.getByteString(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 { + for (int i = 0; i < originalNodeNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, originalNodeNames_.getRaw(i)); + } + for (int i = 0; i < originalFuncNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, originalFuncNames_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < originalNodeNames_.size(); i++) { + dataSize += computeStringSizeNoTag(originalNodeNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getOriginalNodeNamesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < originalFuncNames_.size(); i++) { + dataSize += computeStringSizeNoTag(originalFuncNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getOriginalFuncNamesList().size(); + } + size += getUnknownFields().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.NodeDef.ExperimentalDebugInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo other = (org.tensorflow.proto.NodeDef.ExperimentalDebugInfo) obj; + + if (!getOriginalNodeNamesList() + .equals(other.getOriginalNodeNamesList())) return false; + if (!getOriginalFuncNamesList() + .equals(other.getOriginalFuncNamesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOriginalNodeNamesCount() > 0) { + hash = (37 * hash) + ORIGINAL_NODE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getOriginalNodeNamesList().hashCode(); + } + if (getOriginalFuncNamesCount() > 0) { + hash = (37 * hash) + ORIGINAL_FUNC_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getOriginalFuncNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo 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.NodeDef.ExperimentalDebugInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NodeDef.ExperimentalDebugInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.NodeDef.ExperimentalDebugInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NodeDef.ExperimentalDebugInfo) + org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.class, org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalNodeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + originalFuncNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo getDefaultInstanceForType() { + return org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo build() { + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo buildPartial() { + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo result = new org.tensorflow.proto.NodeDef.ExperimentalDebugInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.NodeDef.ExperimentalDebugInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + originalNodeNames_.makeImmutable(); + result.originalNodeNames_ = originalNodeNames_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + originalFuncNames_.makeImmutable(); + result.originalFuncNames_ = originalFuncNames_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NodeDef.ExperimentalDebugInfo) { + return mergeFrom((org.tensorflow.proto.NodeDef.ExperimentalDebugInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NodeDef.ExperimentalDebugInfo other) { + if (other == org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance()) return this; + if (!other.originalNodeNames_.isEmpty()) { + if (originalNodeNames_.isEmpty()) { + originalNodeNames_ = other.originalNodeNames_; + bitField0_ |= 0x00000001; + } else { + ensureOriginalNodeNamesIsMutable(); + originalNodeNames_.addAll(other.originalNodeNames_); + } + onChanged(); + } + if (!other.originalFuncNames_.isEmpty()) { + if (originalFuncNames_.isEmpty()) { + originalFuncNames_ = other.originalFuncNames_; + bitField0_ |= 0x00000002; + } else { + ensureOriginalFuncNamesIsMutable(); + originalFuncNames_.addAll(other.originalFuncNames_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureOriginalNodeNamesIsMutable(); + originalNodeNames_.add(s); + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureOriginalFuncNamesIsMutable(); + originalFuncNames_.add(s); + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList originalNodeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureOriginalNodeNamesIsMutable() { + if (!originalNodeNames_.isModifiable()) { + originalNodeNames_ = new com.google.protobuf.LazyStringArrayList(originalNodeNames_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @return A list containing the originalNodeNames. + */ + public com.google.protobuf.ProtocolStringList + getOriginalNodeNamesList() { + originalNodeNames_.makeImmutable(); + return originalNodeNames_; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @return The count of originalNodeNames. + */ + public int getOriginalNodeNamesCount() { + return originalNodeNames_.size(); + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the element to return. + * @return The originalNodeNames at the given index. + */ + public java.lang.String getOriginalNodeNames(int index) { + return originalNodeNames_.get(index); + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param index The index of the value to return. + * @return The bytes of the originalNodeNames at the given index. + */ + public com.google.protobuf.ByteString + getOriginalNodeNamesBytes(int index) { + return originalNodeNames_.getByteString(index); + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param index The index to set the value at. + * @param value The originalNodeNames to set. + * @return This builder for chaining. + */ + public Builder setOriginalNodeNames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOriginalNodeNamesIsMutable(); + originalNodeNames_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param value The originalNodeNames to add. + * @return This builder for chaining. + */ + public Builder addOriginalNodeNames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOriginalNodeNamesIsMutable(); + originalNodeNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param values The originalNodeNames to add. + * @return This builder for chaining. + */ + public Builder addAllOriginalNodeNames( + java.lang.Iterable values) { + ensureOriginalNodeNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, originalNodeNames_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @return This builder for chaining. + */ + public Builder clearOriginalNodeNames() { + originalNodeNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
    +       * Opaque string inserted into error messages created by the runtime.
    +       *
    +       * This is intended to store the list of names of the nodes from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of 2 nodes A and B, then 'original_node' would
    +       * be {A, B}. This information can be used to map errors originating at the
    +       * current node to some top level source code.
    +       * 
    + * + * repeated string original_node_names = 1; + * @param value The bytes of the originalNodeNames to add. + * @return This builder for chaining. + */ + public Builder addOriginalNodeNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureOriginalNodeNamesIsMutable(); + originalNodeNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList originalFuncNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureOriginalFuncNamesIsMutable() { + if (!originalFuncNames_.isModifiable()) { + originalFuncNames_ = new com.google.protobuf.LazyStringArrayList(originalFuncNames_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @return A list containing the originalFuncNames. + */ + public com.google.protobuf.ProtocolStringList + getOriginalFuncNamesList() { + originalFuncNames_.makeImmutable(); + return originalFuncNames_; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @return The count of originalFuncNames. + */ + public int getOriginalFuncNamesCount() { + return originalFuncNames_.size(); + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the element to return. + * @return The originalFuncNames at the given index. + */ + public java.lang.String getOriginalFuncNames(int index) { + return originalFuncNames_.get(index); + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param index The index of the value to return. + * @return The bytes of the originalFuncNames at the given index. + */ + public com.google.protobuf.ByteString + getOriginalFuncNamesBytes(int index) { + return originalFuncNames_.getByteString(index); + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param index The index to set the value at. + * @param value The originalFuncNames to set. + * @return This builder for chaining. + */ + public Builder setOriginalFuncNames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOriginalFuncNamesIsMutable(); + originalFuncNames_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param value The originalFuncNames to add. + * @return This builder for chaining. + */ + public Builder addOriginalFuncNames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOriginalFuncNamesIsMutable(); + originalFuncNames_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param values The originalFuncNames to add. + * @return This builder for chaining. + */ + public Builder addAllOriginalFuncNames( + java.lang.Iterable values) { + ensureOriginalFuncNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, originalFuncNames_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @return This builder for chaining. + */ + public Builder clearOriginalFuncNames() { + originalFuncNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +       * This is intended to store the list of names of the functions from the
    +       * original graph that this node was derived. For example if this node, say
    +       * C, was result of a fusion of node A in function FA and node B in function
    +       * FB, then `original_funcs` would be {FA, FB}. If the node is in the top
    +       * level graph, the `original_func` is empty. This information, with the
    +       * `original_node_names` can be used to map errors originating at the
    +       * current ndoe to some top level source code.
    +       * 
    + * + * repeated string original_func_names = 2; + * @param value The bytes of the originalFuncNames to add. + * @return This builder for chaining. + */ + public Builder addOriginalFuncNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureOriginalFuncNamesIsMutable(); + originalFuncNames_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NodeDef.ExperimentalDebugInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NodeDef.ExperimentalDebugInfo) + private static final org.tensorflow.proto.NodeDef.ExperimentalDebugInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NodeDef.ExperimentalDebugInfo(); + } + + public static org.tensorflow.proto.NodeDef.ExperimentalDebugInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExperimentalDebugInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NodeDef.ExperimentalDebugInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * The name given to this operator. Used for naming inputs,
    +   * logging, visualization, etc.  Unique within a single GraphDef.
    +   * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 given to this operator. Used for naming inputs,
    +   * logging, visualization, etc.  Unique within a single GraphDef.
    +   * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 OP_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object op_ = ""; + /** + *
    +   * The operation name.  There may be custom parameters in attrs.
    +   * Op names starting with an underscore are reserved for internal use.
    +   * 
    + * + * string op = 2; + * @return The op. + */ + @java.lang.Override + public java.lang.String getOp() { + java.lang.Object ref = op_; + 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(); + op_ = s; + return s; + } + } + /** + *
    +   * The operation name.  There may be custom parameters in attrs.
    +   * Op names starting with an underscore are reserved for internal use.
    +   * 
    + * + * string op = 2; + * @return The bytes for op. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList input_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Each input is "node:src_output" with "node" being a string name and
    +   * "src_output" indicating which output tensor to use from "node". If
    +   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +   * may optionally be followed by control inputs that have the format
    +   * "^node".
    +   * 
    + * + * repeated string input = 3; + * @return A list containing the input. + */ + public com.google.protobuf.ProtocolStringList + getInputList() { + return input_; + } + /** + *
    +   * Each input is "node:src_output" with "node" being a string name and
    +   * "src_output" indicating which output tensor to use from "node". If
    +   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +   * may optionally be followed by control inputs that have the format
    +   * "^node".
    +   * 
    + * + * repeated string input = 3; + * @return The count of input. + */ + public int getInputCount() { + return input_.size(); + } + /** + *
    +   * Each input is "node:src_output" with "node" being a string name and
    +   * "src_output" indicating which output tensor to use from "node". If
    +   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +   * may optionally be followed by control inputs that have the format
    +   * "^node".
    +   * 
    + * + * repeated string input = 3; + * @param index The index of the element to return. + * @return The input at the given index. + */ + public java.lang.String getInput(int index) { + return input_.get(index); + } + /** + *
    +   * Each input is "node:src_output" with "node" being a string name and
    +   * "src_output" indicating which output tensor to use from "node". If
    +   * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +   * may optionally be followed by control inputs that have the format
    +   * "^node".
    +   * 
    + * + * repeated string input = 3; + * @param index The index of the value to return. + * @return The bytes of the input at the given index. + */ + public com.google.protobuf.ByteString + getInputBytes(int index) { + return input_.getByteString(index); + } + + public static final int DEVICE_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + *
    +   * A (possibly partial) specification for the device on which this
    +   * node should be placed.
    +   * The expected syntax for this string is as follows:
    +   *
    +   * DEVICE_SPEC ::= PARTIAL_SPEC
    +   *
    +   * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +   * CONSTRAINT ::= ("job:" JOB_NAME)
    +   * | ("replica:" [1-9][0-9]*)
    +   * | ("task:" [1-9][0-9]*)
    +   * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +   *
    +   * Valid values for this string include:
    +   * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +   * * "/job:worker/device:GPU:3"                   (partial specification)
    +   * * ""                                    (no specification)
    +   *
    +   * If the constraints do not resolve to a single device (or if this
    +   * field is empty or not present), the runtime will attempt to
    +   * choose a device automatically.
    +   * 
    + * + * string device = 4; + * @return The device. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * A (possibly partial) specification for the device on which this
    +   * node should be placed.
    +   * The expected syntax for this string is as follows:
    +   *
    +   * DEVICE_SPEC ::= PARTIAL_SPEC
    +   *
    +   * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +   * CONSTRAINT ::= ("job:" JOB_NAME)
    +   * | ("replica:" [1-9][0-9]*)
    +   * | ("task:" [1-9][0-9]*)
    +   * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +   *
    +   * Valid values for this string include:
    +   * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +   * * "/job:worker/device:GPU:3"                   (partial specification)
    +   * * ""                                    (no specification)
    +   *
    +   * If the constraints do not resolve to a single device (or if this
    +   * field is empty or not present), the runtime will attempt to
    +   * choose a device automatically.
    +   * 
    + * + * string device = 4; + * @return The bytes for device. + */ + @java.lang.Override + 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 ATTR_FIELD_NUMBER = 5; + private static final class AttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_AttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> attr_; + private com.google.protobuf.MapField + internalGetAttr() { + if (attr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttrDefaultEntryHolder.defaultEntry); + } + return attr_; + } + public int getAttrCount() { + return internalGetAttr().getMap().size(); + } + /** + *
    +   * Operation-specific graph-construction-time configuration.
    +   * Note that this should include all attrs defined in the
    +   * corresponding OpDef, including those with a value matching
    +   * the default -- this allows the default to change and makes
    +   * NodeDefs easier to interpret on their own.  However, if
    +   * an attr with a default is not specified in this list, the
    +   * default will be used.
    +   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +   * one of the names from the corresponding OpDef's attr field).
    +   * The values must have a type matching the corresponding OpDef
    +   * attr's type field.
    +   * TODO(josh11b): Add some examples here showing best practices.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().getMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +   * Operation-specific graph-construction-time configuration.
    +   * Note that this should include all attrs defined in the
    +   * corresponding OpDef, including those with a value matching
    +   * the default -- this allows the default to change and makes
    +   * NodeDefs easier to interpret on their own.  However, if
    +   * an attr with a default is not specified in this list, the
    +   * default will be used.
    +   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +   * one of the names from the corresponding OpDef's attr field).
    +   * The values must have a type matching the corresponding OpDef
    +   * attr's type field.
    +   * TODO(josh11b): Add some examples here showing best practices.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getMap(); + } + /** + *
    +   * Operation-specific graph-construction-time configuration.
    +   * Note that this should include all attrs defined in the
    +   * corresponding OpDef, including those with a value matching
    +   * the default -- this allows the default to change and makes
    +   * NodeDefs easier to interpret on their own.  However, if
    +   * an attr with a default is not specified in this list, the
    +   * default will be used.
    +   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +   * one of the names from the corresponding OpDef's attr field).
    +   * The values must have a type matching the corresponding OpDef
    +   * attr's type field.
    +   * TODO(josh11b): Add some examples here showing best practices.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Operation-specific graph-construction-time configuration.
    +   * Note that this should include all attrs defined in the
    +   * corresponding OpDef, including those with a value matching
    +   * the default -- this allows the default to change and makes
    +   * NodeDefs easier to interpret on their own.  However, if
    +   * an attr with a default is not specified in this list, the
    +   * default will be used.
    +   * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +   * one of the names from the corresponding OpDef's attr field).
    +   * The values must have a type matching the corresponding OpDef
    +   * attr's type field.
    +   * TODO(josh11b): Add some examples here showing best practices.
    +   * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int EXPERIMENTAL_DEBUG_INFO_FIELD_NUMBER = 6; + private org.tensorflow.proto.NodeDef.ExperimentalDebugInfo experimentalDebugInfo_; + /** + *
    +   * This stores debug information associated with the node.
    +   * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return Whether the experimentalDebugInfo field is set. + */ + @java.lang.Override + public boolean hasExperimentalDebugInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * This stores debug information associated with the node.
    +   * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return The experimentalDebugInfo. + */ + @java.lang.Override + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo() { + return experimentalDebugInfo_ == null ? org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; + } + /** + *
    +   * This stores debug information associated with the node.
    +   * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + @java.lang.Override + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder() { + return experimentalDebugInfo_ == null ? org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; + } + + public static final int EXPERIMENTAL_TYPE_FIELD_NUMBER = 7; + private org.tensorflow.proto.FullTypeDef experimentalType_; + /** + *
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return Whether the experimentalType field is set. + */ + @java.lang.Override + public boolean hasExperimentalType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return The experimentalType. + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDef getExperimentalType() { + return experimentalType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalType_; + } + /** + *
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalTypeOrBuilder() { + return experimentalType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalType_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, op_); + } + for (int i = 0; i < input_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, input_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, device_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAttr(), + AttrDefaultEntryHolder.defaultEntry, + 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getExperimentalDebugInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getExperimentalType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, op_); + } + { + int dataSize = 0; + for (int i = 0; i < input_.size(); i++) { + dataSize += computeStringSizeNoTag(input_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, device_); + } + for (java.util.Map.Entry entry + : internalGetAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, attr__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getExperimentalDebugInfo()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getExperimentalType()); + } + size += getUnknownFields().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.NodeDef)) { + return super.equals(obj); + } + org.tensorflow.proto.NodeDef other = (org.tensorflow.proto.NodeDef) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getOp() + .equals(other.getOp())) return false; + if (!getInputList() + .equals(other.getInputList())) return false; + if (!getDevice() + .equals(other.getDevice())) return false; + if (!internalGetAttr().equals( + other.internalGetAttr())) return false; + if (hasExperimentalDebugInfo() != other.hasExperimentalDebugInfo()) return false; + if (hasExperimentalDebugInfo()) { + if (!getExperimentalDebugInfo() + .equals(other.getExperimentalDebugInfo())) return false; + } + if (hasExperimentalType() != other.hasExperimentalType()) return false; + if (hasExperimentalType()) { + if (!getExperimentalType() + .equals(other.getExperimentalType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOp().hashCode(); + if (getInputCount() > 0) { + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + getInputList().hashCode(); + } + hash = (37 * hash) + DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + if (!internalGetAttr().getMap().isEmpty()) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttr().hashCode(); + } + if (hasExperimentalDebugInfo()) { + hash = (37 * hash) + EXPERIMENTAL_DEBUG_INFO_FIELD_NUMBER; + hash = (53 * hash) + getExperimentalDebugInfo().hashCode(); + } + if (hasExperimentalType()) { + hash = (37 * hash) + EXPERIMENTAL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getExperimentalType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NodeDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef 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.NodeDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef 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.NodeDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NodeDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NodeDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NodeDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NodeDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NodeDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.NodeDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NodeDef) + org.tensorflow.proto.NodeDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeDef.class, org.tensorflow.proto.NodeDef.Builder.class); + } + + // Construct using org.tensorflow.proto.NodeDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getExperimentalDebugInfoFieldBuilder(); + getExperimentalTypeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + op_ = ""; + input_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + device_ = ""; + internalGetMutableAttr().clear(); + experimentalDebugInfo_ = null; + if (experimentalDebugInfoBuilder_ != null) { + experimentalDebugInfoBuilder_.dispose(); + experimentalDebugInfoBuilder_ = null; + } + experimentalType_ = null; + if (experimentalTypeBuilder_ != null) { + experimentalTypeBuilder_.dispose(); + experimentalTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.NodeProto.internal_static_tensorflow_NodeDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef getDefaultInstanceForType() { + return org.tensorflow.proto.NodeDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef build() { + org.tensorflow.proto.NodeDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NodeDef buildPartial() { + org.tensorflow.proto.NodeDef result = new org.tensorflow.proto.NodeDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.NodeDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.op_ = op_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + input_.makeImmutable(); + result.input_ = input_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.device_ = device_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.attr_ = internalGetAttr().build(AttrDefaultEntryHolder.defaultEntry); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.experimentalDebugInfo_ = experimentalDebugInfoBuilder_ == null + ? experimentalDebugInfo_ + : experimentalDebugInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.experimentalType_ = experimentalTypeBuilder_ == null + ? experimentalType_ + : experimentalTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NodeDef) { + return mergeFrom((org.tensorflow.proto.NodeDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NodeDef other) { + if (other == org.tensorflow.proto.NodeDef.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOp().isEmpty()) { + op_ = other.op_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.input_.isEmpty()) { + if (input_.isEmpty()) { + input_ = other.input_; + bitField0_ |= 0x00000004; + } else { + ensureInputIsMutable(); + input_.addAll(other.input_); + } + onChanged(); + } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAttr().mergeFrom( + other.internalGetAttr()); + bitField0_ |= 0x00000010; + if (other.hasExperimentalDebugInfo()) { + mergeExperimentalDebugInfo(other.getExperimentalDebugInfo()); + } + if (other.hasExperimentalType()) { + mergeExperimentalType(other.getExperimentalType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + op_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureInputIsMutable(); + input_.add(s); + break; + } // case 26 + case 34: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + attr__ = input.readMessage( + AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAttr().ensureBuilderMap().put( + attr__.getKey(), attr__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + input.readMessage( + getExperimentalDebugInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + input.readMessage( + getExperimentalTypeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * The name given to this operator. Used for naming inputs,
    +     * logging, visualization, etc.  Unique within a single GraphDef.
    +     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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 given to this operator. Used for naming inputs,
    +     * logging, visualization, etc.  Unique within a single GraphDef.
    +     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 given to this operator. Used for naming inputs,
    +     * logging, visualization, etc.  Unique within a single GraphDef.
    +     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The name given to this operator. Used for naming inputs,
    +     * logging, visualization, etc.  Unique within a single GraphDef.
    +     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The name given to this operator. Used for naming inputs,
    +     * logging, visualization, etc.  Unique within a single GraphDef.
    +     * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_>./]*".
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object op_ = ""; + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * Op names starting with an underscore are reserved for internal use.
    +     * 
    + * + * string op = 2; + * @return The op. + */ + public java.lang.String getOp() { + java.lang.Object ref = op_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + op_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * Op names starting with an underscore are reserved for internal use.
    +     * 
    + * + * string op = 2; + * @return The bytes for op. + */ + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * Op names starting with an underscore are reserved for internal use.
    +     * 
    + * + * string op = 2; + * @param value The op to set. + * @return This builder for chaining. + */ + public Builder setOp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + op_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * Op names starting with an underscore are reserved for internal use.
    +     * 
    + * + * string op = 2; + * @return This builder for chaining. + */ + public Builder clearOp() { + op_ = getDefaultInstance().getOp(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * Op names starting with an underscore are reserved for internal use.
    +     * 
    + * + * string op = 2; + * @param value The bytes for op to set. + * @return This builder for chaining. + */ + public Builder setOpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + op_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList input_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureInputIsMutable() { + if (!input_.isModifiable()) { + input_ = new com.google.protobuf.LazyStringArrayList(input_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @return A list containing the input. + */ + public com.google.protobuf.ProtocolStringList + getInputList() { + input_.makeImmutable(); + return input_; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @return The count of input. + */ + public int getInputCount() { + return input_.size(); + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param index The index of the element to return. + * @return The input at the given index. + */ + public java.lang.String getInput(int index) { + return input_.get(index); + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param index The index of the value to return. + * @return The bytes of the input at the given index. + */ + public com.google.protobuf.ByteString + getInputBytes(int index) { + return input_.getByteString(index); + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param index The index to set the value at. + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputIsMutable(); + input_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param value The input to add. + * @return This builder for chaining. + */ + public Builder addInput( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputIsMutable(); + input_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param values The input to add. + * @return This builder for chaining. + */ + public Builder addAllInput( + java.lang.Iterable values) { + ensureInputIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, input_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @return This builder for chaining. + */ + public Builder clearInput() { + input_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Each input is "node:src_output" with "node" being a string name and
    +     * "src_output" indicating which output tensor to use from "node". If
    +     * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
    +     * may optionally be followed by control inputs that have the format
    +     * "^node".
    +     * 
    + * + * repeated string input = 3; + * @param value The bytes of the input to add. + * @return This builder for chaining. + */ + public Builder addInputBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureInputIsMutable(); + input_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object device_ = ""; + /** + *
    +     * A (possibly partial) specification for the device on which this
    +     * node should be placed.
    +     * The expected syntax for this string is as follows:
    +     *
    +     * DEVICE_SPEC ::= PARTIAL_SPEC
    +     *
    +     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +     * CONSTRAINT ::= ("job:" JOB_NAME)
    +     * | ("replica:" [1-9][0-9]*)
    +     * | ("task:" [1-9][0-9]*)
    +     * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +     *
    +     * Valid values for this string include:
    +     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +     * * "/job:worker/device:GPU:3"                   (partial specification)
    +     * * ""                                    (no specification)
    +     *
    +     * If the constraints do not resolve to a single device (or if this
    +     * field is empty or not present), the runtime will attempt to
    +     * choose a device automatically.
    +     * 
    + * + * string device = 4; + * @return The device. + */ + 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; + } + } + /** + *
    +     * A (possibly partial) specification for the device on which this
    +     * node should be placed.
    +     * The expected syntax for this string is as follows:
    +     *
    +     * DEVICE_SPEC ::= PARTIAL_SPEC
    +     *
    +     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +     * CONSTRAINT ::= ("job:" JOB_NAME)
    +     * | ("replica:" [1-9][0-9]*)
    +     * | ("task:" [1-9][0-9]*)
    +     * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +     *
    +     * Valid values for this string include:
    +     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +     * * "/job:worker/device:GPU:3"                   (partial specification)
    +     * * ""                                    (no specification)
    +     *
    +     * If the constraints do not resolve to a single device (or if this
    +     * field is empty or not present), the runtime will attempt to
    +     * choose a device automatically.
    +     * 
    + * + * string device = 4; + * @return The bytes for device. + */ + 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; + } + } + /** + *
    +     * A (possibly partial) specification for the device on which this
    +     * node should be placed.
    +     * The expected syntax for this string is as follows:
    +     *
    +     * DEVICE_SPEC ::= PARTIAL_SPEC
    +     *
    +     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +     * CONSTRAINT ::= ("job:" JOB_NAME)
    +     * | ("replica:" [1-9][0-9]*)
    +     * | ("task:" [1-9][0-9]*)
    +     * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +     *
    +     * Valid values for this string include:
    +     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +     * * "/job:worker/device:GPU:3"                   (partial specification)
    +     * * ""                                    (no specification)
    +     *
    +     * If the constraints do not resolve to a single device (or if this
    +     * field is empty or not present), the runtime will attempt to
    +     * choose a device automatically.
    +     * 
    + * + * string device = 4; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * A (possibly partial) specification for the device on which this
    +     * node should be placed.
    +     * The expected syntax for this string is as follows:
    +     *
    +     * DEVICE_SPEC ::= PARTIAL_SPEC
    +     *
    +     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +     * CONSTRAINT ::= ("job:" JOB_NAME)
    +     * | ("replica:" [1-9][0-9]*)
    +     * | ("task:" [1-9][0-9]*)
    +     * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +     *
    +     * Valid values for this string include:
    +     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +     * * "/job:worker/device:GPU:3"                   (partial specification)
    +     * * ""                                    (no specification)
    +     *
    +     * If the constraints do not resolve to a single device (or if this
    +     * field is empty or not present), the runtime will attempt to
    +     * choose a device automatically.
    +     * 
    + * + * string device = 4; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * A (possibly partial) specification for the device on which this
    +     * node should be placed.
    +     * The expected syntax for this string is as follows:
    +     *
    +     * DEVICE_SPEC ::= PARTIAL_SPEC
    +     *
    +     * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
    +     * CONSTRAINT ::= ("job:" JOB_NAME)
    +     * | ("replica:" [1-9][0-9]*)
    +     * | ("task:" [1-9][0-9]*)
    +     * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
    +     *
    +     * Valid values for this string include:
    +     * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
    +     * * "/job:worker/device:GPU:3"                   (partial specification)
    +     * * ""                                    (no specification)
    +     *
    +     * If the constraints do not resolve to a single device (or if this
    +     * field is empty or not present), the runtime will attempt to
    +     * choose a device automatically.
    +     * 
    + * + * string device = 4; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private static final class AttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AttrDefaultEntryHolder.defaultEntry; + } + }; + private static final AttrConverter attrConverter = new AttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> attr_; + private com.google.protobuf.MapFieldBuilder + internalGetAttr() { + if (attr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + return attr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAttr() { + if (attr_ == null) { + attr_ = new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + bitField0_ |= 0x00000010; + onChanged(); + return attr_; + } + public int getAttrCount() { + return internalGetAttr().ensureBuilderMap().size(); + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getImmutableMap(); + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + return map.containsKey(key) ? attrConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attrConverter.build(map.get(key)); + } + public Builder clearAttr() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAttr().clear(); + return this; + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder removeAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttr() { + bitField0_ |= 0x00000010; + return internalGetMutableAttr().ensureMessageMap(); + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder putAttr( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public Builder putAllAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +     * Operation-specific graph-construction-time configuration.
    +     * Note that this should include all attrs defined in the
    +     * corresponding OpDef, including those with a value matching
    +     * the default -- this allows the default to change and makes
    +     * NodeDefs easier to interpret on their own.  However, if
    +     * an attr with a default is not specified in this list, the
    +     * default will be used.
    +     * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
    +     * one of the names from the corresponding OpDef's attr field).
    +     * The values must have a type matching the corresponding OpDef
    +     * attr's type field.
    +     * TODO(josh11b): Add some examples here showing best practices.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 5; + */ + public org.tensorflow.proto.AttrValue.Builder putAttrBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAttr().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + private org.tensorflow.proto.NodeDef.ExperimentalDebugInfo experimentalDebugInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder> experimentalDebugInfoBuilder_; + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return Whether the experimentalDebugInfo field is set. + */ + public boolean hasExperimentalDebugInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return The experimentalDebugInfo. + */ + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo() { + if (experimentalDebugInfoBuilder_ == null) { + return experimentalDebugInfo_ == null ? org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; + } else { + return experimentalDebugInfoBuilder_.getMessage(); + } + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public Builder setExperimentalDebugInfo(org.tensorflow.proto.NodeDef.ExperimentalDebugInfo value) { + if (experimentalDebugInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimentalDebugInfo_ = value; + } else { + experimentalDebugInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public Builder setExperimentalDebugInfo( + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder builderForValue) { + if (experimentalDebugInfoBuilder_ == null) { + experimentalDebugInfo_ = builderForValue.build(); + } else { + experimentalDebugInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public Builder mergeExperimentalDebugInfo(org.tensorflow.proto.NodeDef.ExperimentalDebugInfo value) { + if (experimentalDebugInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + experimentalDebugInfo_ != null && + experimentalDebugInfo_ != org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance()) { + getExperimentalDebugInfoBuilder().mergeFrom(value); + } else { + experimentalDebugInfo_ = value; + } + } else { + experimentalDebugInfoBuilder_.mergeFrom(value); + } + if (experimentalDebugInfo_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public Builder clearExperimentalDebugInfo() { + bitField0_ = (bitField0_ & ~0x00000020); + experimentalDebugInfo_ = null; + if (experimentalDebugInfoBuilder_ != null) { + experimentalDebugInfoBuilder_.dispose(); + experimentalDebugInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder getExperimentalDebugInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getExperimentalDebugInfoFieldBuilder().getBuilder(); + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + public org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder() { + if (experimentalDebugInfoBuilder_ != null) { + return experimentalDebugInfoBuilder_.getMessageOrBuilder(); + } else { + return experimentalDebugInfo_ == null ? + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.getDefaultInstance() : experimentalDebugInfo_; + } + } + /** + *
    +     * This stores debug information associated with the node.
    +     * 
    + * + * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder> + getExperimentalDebugInfoFieldBuilder() { + if (experimentalDebugInfoBuilder_ == null) { + experimentalDebugInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo, org.tensorflow.proto.NodeDef.ExperimentalDebugInfo.Builder, org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder>( + getExperimentalDebugInfo(), + getParentForChildren(), + isClean()); + experimentalDebugInfo_ = null; + } + return experimentalDebugInfoBuilder_; + } + + private org.tensorflow.proto.FullTypeDef experimentalType_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> experimentalTypeBuilder_; + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return Whether the experimentalType field is set. + */ + public boolean hasExperimentalType() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return The experimentalType. + */ + public org.tensorflow.proto.FullTypeDef getExperimentalType() { + if (experimentalTypeBuilder_ == null) { + return experimentalType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalType_; + } else { + return experimentalTypeBuilder_.getMessage(); + } + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public Builder setExperimentalType(org.tensorflow.proto.FullTypeDef value) { + if (experimentalTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimentalType_ = value; + } else { + experimentalTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public Builder setExperimentalType( + org.tensorflow.proto.FullTypeDef.Builder builderForValue) { + if (experimentalTypeBuilder_ == null) { + experimentalType_ = builderForValue.build(); + } else { + experimentalTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public Builder mergeExperimentalType(org.tensorflow.proto.FullTypeDef value) { + if (experimentalTypeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + experimentalType_ != null && + experimentalType_ != org.tensorflow.proto.FullTypeDef.getDefaultInstance()) { + getExperimentalTypeBuilder().mergeFrom(value); + } else { + experimentalType_ = value; + } + } else { + experimentalTypeBuilder_.mergeFrom(value); + } + if (experimentalType_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public Builder clearExperimentalType() { + bitField0_ = (bitField0_ & ~0x00000040); + experimentalType_ = null; + if (experimentalTypeBuilder_ != null) { + experimentalTypeBuilder_.dispose(); + experimentalTypeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public org.tensorflow.proto.FullTypeDef.Builder getExperimentalTypeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getExperimentalTypeFieldBuilder().getBuilder(); + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + public org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalTypeOrBuilder() { + if (experimentalTypeBuilder_ != null) { + return experimentalTypeBuilder_.getMessageOrBuilder(); + } else { + return experimentalType_ == null ? + org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalType_; + } + } + /** + *
    +     * The complete type of this node. Experimental and subject to change.
    +     * Currently, the field only contains the return types of the node. That will
    +     * extend in the future to contain the entire signature of the node, as a
    +     * function type.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> + getExperimentalTypeFieldBuilder() { + if (experimentalTypeBuilder_ == null) { + experimentalTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder>( + getExperimentalType(), + getParentForChildren(), + isClean()); + experimentalType_ = null; + } + return experimentalTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NodeDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NodeDef) + private static final org.tensorflow.proto.NodeDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NodeDef(); + } + + public static org.tensorflow.proto.NodeDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NodeDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDefOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDefOrBuilder.java index 43971913d97..481d28e251a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/NodeDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/node_def.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface NodeDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.NodeDef) @@ -15,6 +17,7 @@ public interface NodeDefOrBuilder extends *
    * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -25,6 +28,7 @@ public interface NodeDefOrBuilder extends * * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -36,6 +40,7 @@ public interface NodeDefOrBuilder extends * * * string op = 2; + * @return The op. */ java.lang.String getOp(); /** @@ -45,6 +50,7 @@ public interface NodeDefOrBuilder extends * * * string op = 2; + * @return The bytes for op. */ com.google.protobuf.ByteString getOpBytes(); @@ -59,6 +65,7 @@ public interface NodeDefOrBuilder extends * * * repeated string input = 3; + * @return A list containing the input. */ java.util.List getInputList(); @@ -72,6 +79,7 @@ public interface NodeDefOrBuilder extends * * * repeated string input = 3; + * @return The count of input. */ int getInputCount(); /** @@ -84,6 +92,8 @@ public interface NodeDefOrBuilder extends * * * repeated string input = 3; + * @param index The index of the element to return. + * @return The input at the given index. */ java.lang.String getInput(int index); /** @@ -96,6 +106,8 @@ public interface NodeDefOrBuilder extends * * * repeated string input = 3; + * @param index The index of the value to return. + * @return The bytes of the input at the given index. */ com.google.protobuf.ByteString getInputBytes(int index); @@ -105,22 +117,27 @@ public interface NodeDefOrBuilder extends * A (possibly partial) specification for the device on which this * node should be placed. * The expected syntax for this string is as follows: + * * DEVICE_SPEC ::= PARTIAL_SPEC + * * PARTIAL_SPEC ::= ("/" CONSTRAINT) * * CONSTRAINT ::= ("job:" JOB_NAME) - * | ("replica:" [1-9][0-9]*) - * | ("task:" [1-9][0-9]*) - * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") ) + * | ("replica:" [1-9][0-9]*) + * | ("task:" [1-9][0-9]*) + * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") ) + * * Valid values for this string include: * * "/job:worker/replica:0/task:1/device:GPU:3" (full specification) * * "/job:worker/device:GPU:3" (partial specification) * * "" (no specification) + * * If the constraints do not resolve to a single device (or if this * field is empty or not present), the runtime will attempt to * choose a device automatically. * * * string device = 4; + * @return The device. */ java.lang.String getDevice(); /** @@ -128,22 +145,27 @@ public interface NodeDefOrBuilder extends * A (possibly partial) specification for the device on which this * node should be placed. * The expected syntax for this string is as follows: + * * DEVICE_SPEC ::= PARTIAL_SPEC + * * PARTIAL_SPEC ::= ("/" CONSTRAINT) * * CONSTRAINT ::= ("job:" JOB_NAME) - * | ("replica:" [1-9][0-9]*) - * | ("task:" [1-9][0-9]*) - * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") ) + * | ("replica:" [1-9][0-9]*) + * | ("task:" [1-9][0-9]*) + * | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") ) + * * Valid values for this string include: * * "/job:worker/replica:0/task:1/device:GPU:3" (full specification) * * "/job:worker/device:GPU:3" (partial specification) * * "" (no specification) + * * If the constraints do not resolve to a single device (or if this * field is empty or not present), the runtime will attempt to * choose a device automatically. * * * string device = 4; + * @return The bytes for device. */ com.google.protobuf.ByteString getDeviceBytes(); @@ -191,7 +213,7 @@ boolean containsAttr( * Use {@link #getAttrMap()} instead. */ @java.lang.Deprecated - java.util.Map + java.util.Map getAttr(); /** *
    @@ -211,7 +233,7 @@ boolean containsAttr(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -  java.util.Map
    +  java.util.Map
       getAttrMap();
       /**
        * 
    @@ -231,10 +253,11 @@ boolean containsAttr(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -
    -  org.tensorflow.proto.framework.AttrValue getAttrOrDefault(
    +  /* nullable */
    +org.tensorflow.proto.AttrValue getAttrOrDefault(
           java.lang.String key,
    -      org.tensorflow.proto.framework.AttrValue defaultValue);
    +      /* nullable */
    +org.tensorflow.proto.AttrValue defaultValue);
       /**
        * 
        * Operation-specific graph-construction-time configuration.
    @@ -253,8 +276,7 @@ org.tensorflow.proto.framework.AttrValue getAttrOrDefault(
        *
        * map<string, .tensorflow.AttrValue> attr = 5;
        */
    -
    -  org.tensorflow.proto.framework.AttrValue getAttrOrThrow(
    +  org.tensorflow.proto.AttrValue getAttrOrThrow(
           java.lang.String key);
     
       /**
    @@ -263,6 +285,7 @@ org.tensorflow.proto.framework.AttrValue getAttrOrThrow(
        * 
    * * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return Whether the experimentalDebugInfo field is set. */ boolean hasExperimentalDebugInfo(); /** @@ -271,8 +294,9 @@ org.tensorflow.proto.framework.AttrValue getAttrOrThrow( *
    * * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6; + * @return The experimentalDebugInfo. */ - org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo(); + org.tensorflow.proto.NodeDef.ExperimentalDebugInfo getExperimentalDebugInfo(); /** *
        * This stores debug information associated with the node.
    @@ -280,5 +304,41 @@ org.tensorflow.proto.framework.AttrValue getAttrOrThrow(
        *
        * .tensorflow.NodeDef.ExperimentalDebugInfo experimental_debug_info = 6;
        */
    -  org.tensorflow.proto.framework.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder();
    +  org.tensorflow.proto.NodeDef.ExperimentalDebugInfoOrBuilder getExperimentalDebugInfoOrBuilder();
    +
    +  /**
    +   * 
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return Whether the experimentalType field is set. + */ + boolean hasExperimentalType(); + /** + *
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + * @return The experimentalType. + */ + org.tensorflow.proto.FullTypeDef getExperimentalType(); + /** + *
    +   * The complete type of this node. Experimental and subject to change.
    +   * Currently, the field only contains the return types of the node. That will
    +   * extend in the future to contain the entire signature of the node, as a
    +   * function type.
    +   * 
    + * + * .tensorflow.FullTypeDef experimental_type = 7; + */ + org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalTypeOrBuilder(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStats.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStats.java new file mode 100644 index 00000000000..64c5fad07c0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStats.java @@ -0,0 +1,2680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Time/size stats recorded for a single execution of a graph node.
    + * 
    + * + * Protobuf type {@code tensorflow.NodeExecStats} + */ +public final class NodeExecStats extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NodeExecStats) + NodeExecStatsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeExecStats.class.getName()); + } + // Use NodeExecStats.newBuilder() to construct. + private NodeExecStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NodeExecStats() { + nodeName_ = ""; + memory_ = java.util.Collections.emptyList(); + output_ = java.util.Collections.emptyList(); + timelineLabel_ = ""; + referencedTensor_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeExecStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeExecStats.class, org.tensorflow.proto.NodeExecStats.Builder.class); + } + + private int bitField0_; + public static final int NODE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object nodeName_ = ""; + /** + *
    +   * TODO(tucker): Use some more compact form of node identity than
    +   * the full string name.  Either all processes should agree on a
    +   * global id (cost_id?) for each node, or we should use a hash of
    +   * the name.
    +   * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + @java.lang.Override + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + 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(); + nodeName_ = s; + return s; + } + } + /** + *
    +   * TODO(tucker): Use some more compact form of node identity than
    +   * the full string name.  Either all processes should agree on a
    +   * global id (cost_id?) for each node, or we should use a hash of
    +   * the name.
    +   * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALL_START_MICROS_FIELD_NUMBER = 2; + private long allStartMicros_ = 0L; + /** + * int64 all_start_micros = 2; + * @return The allStartMicros. + */ + @java.lang.Override + public long getAllStartMicros() { + return allStartMicros_; + } + + public static final int OP_START_REL_MICROS_FIELD_NUMBER = 3; + private long opStartRelMicros_ = 0L; + /** + * int64 op_start_rel_micros = 3; + * @return The opStartRelMicros. + */ + @java.lang.Override + public long getOpStartRelMicros() { + return opStartRelMicros_; + } + + public static final int OP_END_REL_MICROS_FIELD_NUMBER = 4; + private long opEndRelMicros_ = 0L; + /** + * int64 op_end_rel_micros = 4; + * @return The opEndRelMicros. + */ + @java.lang.Override + public long getOpEndRelMicros() { + return opEndRelMicros_; + } + + public static final int ALL_END_REL_MICROS_FIELD_NUMBER = 5; + private long allEndRelMicros_ = 0L; + /** + * int64 all_end_rel_micros = 5; + * @return The allEndRelMicros. + */ + @java.lang.Override + public long getAllEndRelMicros() { + return allEndRelMicros_; + } + + public static final int MEMORY_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List memory_; + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + @java.lang.Override + public java.util.List getMemoryList() { + return memory_; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + @java.lang.Override + public java.util.List + getMemoryOrBuilderList() { + return memory_; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + @java.lang.Override + public int getMemoryCount() { + return memory_.size(); + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AllocatorMemoryUsed getMemory(int index) { + return memory_.get(index); + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + @java.lang.Override + public org.tensorflow.proto.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( + int index) { + return memory_.get(index); + } + + public static final int OUTPUT_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List output_; + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + @java.lang.Override + public java.util.List getOutputList() { + return output_; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + @java.lang.Override + public java.util.List + getOutputOrBuilderList() { + return output_; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + @java.lang.Override + public int getOutputCount() { + return output_.size(); + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + @java.lang.Override + public org.tensorflow.proto.NodeOutput getOutput(int index) { + return output_.get(index); + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + @java.lang.Override + public org.tensorflow.proto.NodeOutputOrBuilder getOutputOrBuilder( + int index) { + return output_.get(index); + } + + public static final int TIMELINE_LABEL_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object timelineLabel_ = ""; + /** + * string timeline_label = 8; + * @return The timelineLabel. + */ + @java.lang.Override + public java.lang.String getTimelineLabel() { + java.lang.Object ref = timelineLabel_; + 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(); + timelineLabel_ = s; + return s; + } + } + /** + * string timeline_label = 8; + * @return The bytes for timelineLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimelineLabelBytes() { + java.lang.Object ref = timelineLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timelineLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCHEDULED_MICROS_FIELD_NUMBER = 9; + private long scheduledMicros_ = 0L; + /** + * int64 scheduled_micros = 9; + * @return The scheduledMicros. + */ + @java.lang.Override + public long getScheduledMicros() { + return scheduledMicros_; + } + + public static final int THREAD_ID_FIELD_NUMBER = 10; + private int threadId_ = 0; + /** + * uint32 thread_id = 10; + * @return The threadId. + */ + @java.lang.Override + public int getThreadId() { + return threadId_; + } + + public static final int REFERENCED_TENSOR_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List referencedTensor_; + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + @java.lang.Override + public java.util.List getReferencedTensorList() { + return referencedTensor_; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + @java.lang.Override + public java.util.List + getReferencedTensorOrBuilderList() { + return referencedTensor_; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + @java.lang.Override + public int getReferencedTensorCount() { + return referencedTensor_.size(); + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + @java.lang.Override + public org.tensorflow.proto.AllocationDescription getReferencedTensor(int index) { + return referencedTensor_.get(index); + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + @java.lang.Override + public org.tensorflow.proto.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( + int index) { + return referencedTensor_.get(index); + } + + public static final int MEMORY_STATS_FIELD_NUMBER = 12; + private org.tensorflow.proto.MemoryStats memoryStats_; + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return Whether the memoryStats field is set. + */ + @java.lang.Override + public boolean hasMemoryStats() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return The memoryStats. + */ + @java.lang.Override + public org.tensorflow.proto.MemoryStats getMemoryStats() { + return memoryStats_ == null ? org.tensorflow.proto.MemoryStats.getDefaultInstance() : memoryStats_; + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + @java.lang.Override + public org.tensorflow.proto.MemoryStatsOrBuilder getMemoryStatsOrBuilder() { + return memoryStats_ == null ? org.tensorflow.proto.MemoryStats.getDefaultInstance() : memoryStats_; + } + + public static final int ALL_START_NANOS_FIELD_NUMBER = 13; + private long allStartNanos_ = 0L; + /** + * int64 all_start_nanos = 13; + * @return The allStartNanos. + */ + @java.lang.Override + public long getAllStartNanos() { + return allStartNanos_; + } + + public static final int OP_START_REL_NANOS_FIELD_NUMBER = 14; + private long opStartRelNanos_ = 0L; + /** + * int64 op_start_rel_nanos = 14; + * @return The opStartRelNanos. + */ + @java.lang.Override + public long getOpStartRelNanos() { + return opStartRelNanos_; + } + + public static final int OP_END_REL_NANOS_FIELD_NUMBER = 15; + private long opEndRelNanos_ = 0L; + /** + * int64 op_end_rel_nanos = 15; + * @return The opEndRelNanos. + */ + @java.lang.Override + public long getOpEndRelNanos() { + return opEndRelNanos_; + } + + public static final int ALL_END_REL_NANOS_FIELD_NUMBER = 16; + private long allEndRelNanos_ = 0L; + /** + * int64 all_end_rel_nanos = 16; + * @return The allEndRelNanos. + */ + @java.lang.Override + public long getAllEndRelNanos() { + return allEndRelNanos_; + } + + public static final int SCHEDULED_NANOS_FIELD_NUMBER = 17; + private long scheduledNanos_ = 0L; + /** + * int64 scheduled_nanos = 17; + * @return The scheduledNanos. + */ + @java.lang.Override + public long getScheduledNanos() { + return scheduledNanos_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(nodeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, nodeName_); + } + if (allStartMicros_ != 0L) { + output.writeInt64(2, allStartMicros_); + } + if (opStartRelMicros_ != 0L) { + output.writeInt64(3, opStartRelMicros_); + } + if (opEndRelMicros_ != 0L) { + output.writeInt64(4, opEndRelMicros_); + } + if (allEndRelMicros_ != 0L) { + output.writeInt64(5, allEndRelMicros_); + } + for (int i = 0; i < memory_.size(); i++) { + output.writeMessage(6, memory_.get(i)); + } + for (int i = 0; i < output_.size(); i++) { + output.writeMessage(7, output_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timelineLabel_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, timelineLabel_); + } + if (scheduledMicros_ != 0L) { + output.writeInt64(9, scheduledMicros_); + } + if (threadId_ != 0) { + output.writeUInt32(10, threadId_); + } + for (int i = 0; i < referencedTensor_.size(); i++) { + output.writeMessage(11, referencedTensor_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(12, getMemoryStats()); + } + if (allStartNanos_ != 0L) { + output.writeInt64(13, allStartNanos_); + } + if (opStartRelNanos_ != 0L) { + output.writeInt64(14, opStartRelNanos_); + } + if (opEndRelNanos_ != 0L) { + output.writeInt64(15, opEndRelNanos_); + } + if (allEndRelNanos_ != 0L) { + output.writeInt64(16, allEndRelNanos_); + } + if (scheduledNanos_ != 0L) { + output.writeInt64(17, scheduledNanos_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nodeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, nodeName_); + } + if (allStartMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, allStartMicros_); + } + if (opStartRelMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, opStartRelMicros_); + } + if (opEndRelMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, opEndRelMicros_); + } + if (allEndRelMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, allEndRelMicros_); + } + for (int i = 0; i < memory_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, memory_.get(i)); + } + for (int i = 0; i < output_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, output_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(timelineLabel_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, timelineLabel_); + } + if (scheduledMicros_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, scheduledMicros_); + } + if (threadId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(10, threadId_); + } + for (int i = 0; i < referencedTensor_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, referencedTensor_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, getMemoryStats()); + } + if (allStartNanos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(13, allStartNanos_); + } + if (opStartRelNanos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(14, opStartRelNanos_); + } + if (opEndRelNanos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(15, opEndRelNanos_); + } + if (allEndRelNanos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(16, allEndRelNanos_); + } + if (scheduledNanos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(17, scheduledNanos_); + } + size += getUnknownFields().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.NodeExecStats)) { + return super.equals(obj); + } + org.tensorflow.proto.NodeExecStats other = (org.tensorflow.proto.NodeExecStats) obj; + + if (!getNodeName() + .equals(other.getNodeName())) return false; + if (getAllStartMicros() + != other.getAllStartMicros()) return false; + if (getOpStartRelMicros() + != other.getOpStartRelMicros()) return false; + if (getOpEndRelMicros() + != other.getOpEndRelMicros()) return false; + if (getAllEndRelMicros() + != other.getAllEndRelMicros()) return false; + if (!getMemoryList() + .equals(other.getMemoryList())) return false; + if (!getOutputList() + .equals(other.getOutputList())) return false; + if (!getTimelineLabel() + .equals(other.getTimelineLabel())) return false; + if (getScheduledMicros() + != other.getScheduledMicros()) return false; + if (getThreadId() + != other.getThreadId()) return false; + if (!getReferencedTensorList() + .equals(other.getReferencedTensorList())) return false; + if (hasMemoryStats() != other.hasMemoryStats()) return false; + if (hasMemoryStats()) { + if (!getMemoryStats() + .equals(other.getMemoryStats())) return false; + } + if (getAllStartNanos() + != other.getAllStartNanos()) return false; + if (getOpStartRelNanos() + != other.getOpStartRelNanos()) return false; + if (getOpEndRelNanos() + != other.getOpEndRelNanos()) return false; + if (getAllEndRelNanos() + != other.getAllEndRelNanos()) return false; + if (getScheduledNanos() + != other.getScheduledNanos()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNodeName().hashCode(); + hash = (37 * hash) + ALL_START_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllStartMicros()); + hash = (37 * hash) + OP_START_REL_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpStartRelMicros()); + hash = (37 * hash) + OP_END_REL_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpEndRelMicros()); + hash = (37 * hash) + ALL_END_REL_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllEndRelMicros()); + if (getMemoryCount() > 0) { + hash = (37 * hash) + MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getMemoryList().hashCode(); + } + if (getOutputCount() > 0) { + hash = (37 * hash) + OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getOutputList().hashCode(); + } + hash = (37 * hash) + TIMELINE_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getTimelineLabel().hashCode(); + hash = (37 * hash) + SCHEDULED_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getScheduledMicros()); + hash = (37 * hash) + THREAD_ID_FIELD_NUMBER; + hash = (53 * hash) + getThreadId(); + if (getReferencedTensorCount() > 0) { + hash = (37 * hash) + REFERENCED_TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getReferencedTensorList().hashCode(); + } + if (hasMemoryStats()) { + hash = (37 * hash) + MEMORY_STATS_FIELD_NUMBER; + hash = (53 * hash) + getMemoryStats().hashCode(); + } + hash = (37 * hash) + ALL_START_NANOS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllStartNanos()); + hash = (37 * hash) + OP_START_REL_NANOS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpStartRelNanos()); + hash = (37 * hash) + OP_END_REL_NANOS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpEndRelNanos()); + hash = (37 * hash) + ALL_END_REL_NANOS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getAllEndRelNanos()); + hash = (37 * hash) + SCHEDULED_NANOS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getScheduledNanos()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NodeExecStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeExecStats 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.NodeExecStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeExecStats 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.NodeExecStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeExecStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NodeExecStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeExecStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NodeExecStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NodeExecStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NodeExecStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeExecStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NodeExecStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Time/size stats recorded for a single execution of a graph node.
    +   * 
    + * + * Protobuf type {@code tensorflow.NodeExecStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NodeExecStats) + org.tensorflow.proto.NodeExecStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeExecStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeExecStats.class, org.tensorflow.proto.NodeExecStats.Builder.class); + } + + // Construct using org.tensorflow.proto.NodeExecStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMemoryFieldBuilder(); + getOutputFieldBuilder(); + getReferencedTensorFieldBuilder(); + getMemoryStatsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeName_ = ""; + allStartMicros_ = 0L; + opStartRelMicros_ = 0L; + opEndRelMicros_ = 0L; + allEndRelMicros_ = 0L; + if (memoryBuilder_ == null) { + memory_ = java.util.Collections.emptyList(); + } else { + memory_ = null; + memoryBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (outputBuilder_ == null) { + output_ = java.util.Collections.emptyList(); + } else { + output_ = null; + outputBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + timelineLabel_ = ""; + scheduledMicros_ = 0L; + threadId_ = 0; + if (referencedTensorBuilder_ == null) { + referencedTensor_ = java.util.Collections.emptyList(); + } else { + referencedTensor_ = null; + referencedTensorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + memoryStats_ = null; + if (memoryStatsBuilder_ != null) { + memoryStatsBuilder_.dispose(); + memoryStatsBuilder_ = null; + } + allStartNanos_ = 0L; + opStartRelNanos_ = 0L; + opEndRelNanos_ = 0L; + allEndRelNanos_ = 0L; + scheduledNanos_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeExecStats_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NodeExecStats getDefaultInstanceForType() { + return org.tensorflow.proto.NodeExecStats.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NodeExecStats build() { + org.tensorflow.proto.NodeExecStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NodeExecStats buildPartial() { + org.tensorflow.proto.NodeExecStats result = new org.tensorflow.proto.NodeExecStats(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.NodeExecStats result) { + if (memoryBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + memory_ = java.util.Collections.unmodifiableList(memory_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.memory_ = memory_; + } else { + result.memory_ = memoryBuilder_.build(); + } + if (outputBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + output_ = java.util.Collections.unmodifiableList(output_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.output_ = output_; + } else { + result.output_ = outputBuilder_.build(); + } + if (referencedTensorBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + referencedTensor_ = java.util.Collections.unmodifiableList(referencedTensor_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.referencedTensor_ = referencedTensor_; + } else { + result.referencedTensor_ = referencedTensorBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.NodeExecStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeName_ = nodeName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allStartMicros_ = allStartMicros_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.opStartRelMicros_ = opStartRelMicros_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.opEndRelMicros_ = opEndRelMicros_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.allEndRelMicros_ = allEndRelMicros_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.timelineLabel_ = timelineLabel_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.scheduledMicros_ = scheduledMicros_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.threadId_ = threadId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000800) != 0)) { + result.memoryStats_ = memoryStatsBuilder_ == null + ? memoryStats_ + : memoryStatsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.allStartNanos_ = allStartNanos_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.opStartRelNanos_ = opStartRelNanos_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.opEndRelNanos_ = opEndRelNanos_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.allEndRelNanos_ = allEndRelNanos_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.scheduledNanos_ = scheduledNanos_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NodeExecStats) { + return mergeFrom((org.tensorflow.proto.NodeExecStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NodeExecStats other) { + if (other == org.tensorflow.proto.NodeExecStats.getDefaultInstance()) return this; + if (!other.getNodeName().isEmpty()) { + nodeName_ = other.nodeName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAllStartMicros() != 0L) { + setAllStartMicros(other.getAllStartMicros()); + } + if (other.getOpStartRelMicros() != 0L) { + setOpStartRelMicros(other.getOpStartRelMicros()); + } + if (other.getOpEndRelMicros() != 0L) { + setOpEndRelMicros(other.getOpEndRelMicros()); + } + if (other.getAllEndRelMicros() != 0L) { + setAllEndRelMicros(other.getAllEndRelMicros()); + } + if (memoryBuilder_ == null) { + if (!other.memory_.isEmpty()) { + if (memory_.isEmpty()) { + memory_ = other.memory_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureMemoryIsMutable(); + memory_.addAll(other.memory_); + } + onChanged(); + } + } else { + if (!other.memory_.isEmpty()) { + if (memoryBuilder_.isEmpty()) { + memoryBuilder_.dispose(); + memoryBuilder_ = null; + memory_ = other.memory_; + bitField0_ = (bitField0_ & ~0x00000020); + memoryBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMemoryFieldBuilder() : null; + } else { + memoryBuilder_.addAllMessages(other.memory_); + } + } + } + if (outputBuilder_ == null) { + if (!other.output_.isEmpty()) { + if (output_.isEmpty()) { + output_ = other.output_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureOutputIsMutable(); + output_.addAll(other.output_); + } + onChanged(); + } + } else { + if (!other.output_.isEmpty()) { + if (outputBuilder_.isEmpty()) { + outputBuilder_.dispose(); + outputBuilder_ = null; + output_ = other.output_; + bitField0_ = (bitField0_ & ~0x00000040); + outputBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutputFieldBuilder() : null; + } else { + outputBuilder_.addAllMessages(other.output_); + } + } + } + if (!other.getTimelineLabel().isEmpty()) { + timelineLabel_ = other.timelineLabel_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getScheduledMicros() != 0L) { + setScheduledMicros(other.getScheduledMicros()); + } + if (other.getThreadId() != 0) { + setThreadId(other.getThreadId()); + } + if (referencedTensorBuilder_ == null) { + if (!other.referencedTensor_.isEmpty()) { + if (referencedTensor_.isEmpty()) { + referencedTensor_ = other.referencedTensor_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureReferencedTensorIsMutable(); + referencedTensor_.addAll(other.referencedTensor_); + } + onChanged(); + } + } else { + if (!other.referencedTensor_.isEmpty()) { + if (referencedTensorBuilder_.isEmpty()) { + referencedTensorBuilder_.dispose(); + referencedTensorBuilder_ = null; + referencedTensor_ = other.referencedTensor_; + bitField0_ = (bitField0_ & ~0x00000400); + referencedTensorBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getReferencedTensorFieldBuilder() : null; + } else { + referencedTensorBuilder_.addAllMessages(other.referencedTensor_); + } + } + } + if (other.hasMemoryStats()) { + mergeMemoryStats(other.getMemoryStats()); + } + if (other.getAllStartNanos() != 0L) { + setAllStartNanos(other.getAllStartNanos()); + } + if (other.getOpStartRelNanos() != 0L) { + setOpStartRelNanos(other.getOpStartRelNanos()); + } + if (other.getOpEndRelNanos() != 0L) { + setOpEndRelNanos(other.getOpEndRelNanos()); + } + if (other.getAllEndRelNanos() != 0L) { + setAllEndRelNanos(other.getAllEndRelNanos()); + } + if (other.getScheduledNanos() != 0L) { + setScheduledNanos(other.getScheduledNanos()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + nodeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + allStartMicros_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + opStartRelMicros_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + opEndRelMicros_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + allEndRelMicros_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + org.tensorflow.proto.AllocatorMemoryUsed m = + input.readMessage( + org.tensorflow.proto.AllocatorMemoryUsed.parser(), + extensionRegistry); + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + memory_.add(m); + } else { + memoryBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: { + org.tensorflow.proto.NodeOutput m = + input.readMessage( + org.tensorflow.proto.NodeOutput.parser(), + extensionRegistry); + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + output_.add(m); + } else { + outputBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + timelineLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: { + scheduledMicros_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + threadId_ = input.readUInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: { + org.tensorflow.proto.AllocationDescription m = + input.readMessage( + org.tensorflow.proto.AllocationDescription.parser(), + extensionRegistry); + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + referencedTensor_.add(m); + } else { + referencedTensorBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: { + input.readMessage( + getMemoryStatsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: { + allStartNanos_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + opStartRelNanos_ = input.readInt64(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + opEndRelNanos_ = input.readInt64(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 128: { + allEndRelNanos_ = input.readInt64(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + scheduledNanos_ = input.readInt64(); + bitField0_ |= 0x00010000; + break; + } // case 136 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object nodeName_ = ""; + /** + *
    +     * TODO(tucker): Use some more compact form of node identity than
    +     * the full string name.  Either all processes should agree on a
    +     * global id (cost_id?) for each node, or we should use a hash of
    +     * the name.
    +     * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + public java.lang.String getNodeName() { + java.lang.Object ref = nodeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nodeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * TODO(tucker): Use some more compact form of node identity than
    +     * the full string name.  Either all processes should agree on a
    +     * global id (cost_id?) for each node, or we should use a hash of
    +     * the name.
    +     * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + public com.google.protobuf.ByteString + getNodeNameBytes() { + java.lang.Object ref = nodeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nodeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * TODO(tucker): Use some more compact form of node identity than
    +     * the full string name.  Either all processes should agree on a
    +     * global id (cost_id?) for each node, or we should use a hash of
    +     * the name.
    +     * 
    + * + * string node_name = 1; + * @param value The nodeName to set. + * @return This builder for chaining. + */ + public Builder setNodeName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + nodeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * TODO(tucker): Use some more compact form of node identity than
    +     * the full string name.  Either all processes should agree on a
    +     * global id (cost_id?) for each node, or we should use a hash of
    +     * the name.
    +     * 
    + * + * string node_name = 1; + * @return This builder for chaining. + */ + public Builder clearNodeName() { + nodeName_ = getDefaultInstance().getNodeName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * TODO(tucker): Use some more compact form of node identity than
    +     * the full string name.  Either all processes should agree on a
    +     * global id (cost_id?) for each node, or we should use a hash of
    +     * the name.
    +     * 
    + * + * string node_name = 1; + * @param value The bytes for nodeName to set. + * @return This builder for chaining. + */ + public Builder setNodeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + nodeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long allStartMicros_ ; + /** + * int64 all_start_micros = 2; + * @return The allStartMicros. + */ + @java.lang.Override + public long getAllStartMicros() { + return allStartMicros_; + } + /** + * int64 all_start_micros = 2; + * @param value The allStartMicros to set. + * @return This builder for chaining. + */ + public Builder setAllStartMicros(long value) { + + allStartMicros_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 all_start_micros = 2; + * @return This builder for chaining. + */ + public Builder clearAllStartMicros() { + bitField0_ = (bitField0_ & ~0x00000002); + allStartMicros_ = 0L; + onChanged(); + return this; + } + + private long opStartRelMicros_ ; + /** + * int64 op_start_rel_micros = 3; + * @return The opStartRelMicros. + */ + @java.lang.Override + public long getOpStartRelMicros() { + return opStartRelMicros_; + } + /** + * int64 op_start_rel_micros = 3; + * @param value The opStartRelMicros to set. + * @return This builder for chaining. + */ + public Builder setOpStartRelMicros(long value) { + + opStartRelMicros_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 op_start_rel_micros = 3; + * @return This builder for chaining. + */ + public Builder clearOpStartRelMicros() { + bitField0_ = (bitField0_ & ~0x00000004); + opStartRelMicros_ = 0L; + onChanged(); + return this; + } + + private long opEndRelMicros_ ; + /** + * int64 op_end_rel_micros = 4; + * @return The opEndRelMicros. + */ + @java.lang.Override + public long getOpEndRelMicros() { + return opEndRelMicros_; + } + /** + * int64 op_end_rel_micros = 4; + * @param value The opEndRelMicros to set. + * @return This builder for chaining. + */ + public Builder setOpEndRelMicros(long value) { + + opEndRelMicros_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 op_end_rel_micros = 4; + * @return This builder for chaining. + */ + public Builder clearOpEndRelMicros() { + bitField0_ = (bitField0_ & ~0x00000008); + opEndRelMicros_ = 0L; + onChanged(); + return this; + } + + private long allEndRelMicros_ ; + /** + * int64 all_end_rel_micros = 5; + * @return The allEndRelMicros. + */ + @java.lang.Override + public long getAllEndRelMicros() { + return allEndRelMicros_; + } + /** + * int64 all_end_rel_micros = 5; + * @param value The allEndRelMicros to set. + * @return This builder for chaining. + */ + public Builder setAllEndRelMicros(long value) { + + allEndRelMicros_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 all_end_rel_micros = 5; + * @return This builder for chaining. + */ + public Builder clearAllEndRelMicros() { + bitField0_ = (bitField0_ & ~0x00000010); + allEndRelMicros_ = 0L; + onChanged(); + return this; + } + + private java.util.List memory_ = + java.util.Collections.emptyList(); + private void ensureMemoryIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + memory_ = new java.util.ArrayList(memory_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocatorMemoryUsed, org.tensorflow.proto.AllocatorMemoryUsed.Builder, org.tensorflow.proto.AllocatorMemoryUsedOrBuilder> memoryBuilder_; + + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public java.util.List getMemoryList() { + if (memoryBuilder_ == null) { + return java.util.Collections.unmodifiableList(memory_); + } else { + return memoryBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public int getMemoryCount() { + if (memoryBuilder_ == null) { + return memory_.size(); + } else { + return memoryBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public org.tensorflow.proto.AllocatorMemoryUsed getMemory(int index) { + if (memoryBuilder_ == null) { + return memory_.get(index); + } else { + return memoryBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder setMemory( + int index, org.tensorflow.proto.AllocatorMemoryUsed value) { + if (memoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMemoryIsMutable(); + memory_.set(index, value); + onChanged(); + } else { + memoryBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder setMemory( + int index, org.tensorflow.proto.AllocatorMemoryUsed.Builder builderForValue) { + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + memory_.set(index, builderForValue.build()); + onChanged(); + } else { + memoryBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder addMemory(org.tensorflow.proto.AllocatorMemoryUsed value) { + if (memoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMemoryIsMutable(); + memory_.add(value); + onChanged(); + } else { + memoryBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder addMemory( + int index, org.tensorflow.proto.AllocatorMemoryUsed value) { + if (memoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMemoryIsMutable(); + memory_.add(index, value); + onChanged(); + } else { + memoryBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder addMemory( + org.tensorflow.proto.AllocatorMemoryUsed.Builder builderForValue) { + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + memory_.add(builderForValue.build()); + onChanged(); + } else { + memoryBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder addMemory( + int index, org.tensorflow.proto.AllocatorMemoryUsed.Builder builderForValue) { + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + memory_.add(index, builderForValue.build()); + onChanged(); + } else { + memoryBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder addAllMemory( + java.lang.Iterable values) { + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, memory_); + onChanged(); + } else { + memoryBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder clearMemory() { + if (memoryBuilder_ == null) { + memory_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + memoryBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public Builder removeMemory(int index) { + if (memoryBuilder_ == null) { + ensureMemoryIsMutable(); + memory_.remove(index); + onChanged(); + } else { + memoryBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public org.tensorflow.proto.AllocatorMemoryUsed.Builder getMemoryBuilder( + int index) { + return getMemoryFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public org.tensorflow.proto.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( + int index) { + if (memoryBuilder_ == null) { + return memory_.get(index); } else { + return memoryBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public java.util.List + getMemoryOrBuilderList() { + if (memoryBuilder_ != null) { + return memoryBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(memory_); + } + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public org.tensorflow.proto.AllocatorMemoryUsed.Builder addMemoryBuilder() { + return getMemoryFieldBuilder().addBuilder( + org.tensorflow.proto.AllocatorMemoryUsed.getDefaultInstance()); + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public org.tensorflow.proto.AllocatorMemoryUsed.Builder addMemoryBuilder( + int index) { + return getMemoryFieldBuilder().addBuilder( + index, org.tensorflow.proto.AllocatorMemoryUsed.getDefaultInstance()); + } + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + public java.util.List + getMemoryBuilderList() { + return getMemoryFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocatorMemoryUsed, org.tensorflow.proto.AllocatorMemoryUsed.Builder, org.tensorflow.proto.AllocatorMemoryUsedOrBuilder> + getMemoryFieldBuilder() { + if (memoryBuilder_ == null) { + memoryBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocatorMemoryUsed, org.tensorflow.proto.AllocatorMemoryUsed.Builder, org.tensorflow.proto.AllocatorMemoryUsedOrBuilder>( + memory_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + memory_ = null; + } + return memoryBuilder_; + } + + private java.util.List output_ = + java.util.Collections.emptyList(); + private void ensureOutputIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + output_ = new java.util.ArrayList(output_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeOutput, org.tensorflow.proto.NodeOutput.Builder, org.tensorflow.proto.NodeOutputOrBuilder> outputBuilder_; + + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public java.util.List getOutputList() { + if (outputBuilder_ == null) { + return java.util.Collections.unmodifiableList(output_); + } else { + return outputBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public int getOutputCount() { + if (outputBuilder_ == null) { + return output_.size(); + } else { + return outputBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public org.tensorflow.proto.NodeOutput getOutput(int index) { + if (outputBuilder_ == null) { + return output_.get(index); + } else { + return outputBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder setOutput( + int index, org.tensorflow.proto.NodeOutput value) { + if (outputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputIsMutable(); + output_.set(index, value); + onChanged(); + } else { + outputBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder setOutput( + int index, org.tensorflow.proto.NodeOutput.Builder builderForValue) { + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + output_.set(index, builderForValue.build()); + onChanged(); + } else { + outputBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder addOutput(org.tensorflow.proto.NodeOutput value) { + if (outputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputIsMutable(); + output_.add(value); + onChanged(); + } else { + outputBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder addOutput( + int index, org.tensorflow.proto.NodeOutput value) { + if (outputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputIsMutable(); + output_.add(index, value); + onChanged(); + } else { + outputBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder addOutput( + org.tensorflow.proto.NodeOutput.Builder builderForValue) { + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + output_.add(builderForValue.build()); + onChanged(); + } else { + outputBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder addOutput( + int index, org.tensorflow.proto.NodeOutput.Builder builderForValue) { + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + output_.add(index, builderForValue.build()); + onChanged(); + } else { + outputBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder addAllOutput( + java.lang.Iterable values) { + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, output_); + onChanged(); + } else { + outputBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder clearOutput() { + if (outputBuilder_ == null) { + output_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + outputBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public Builder removeOutput(int index) { + if (outputBuilder_ == null) { + ensureOutputIsMutable(); + output_.remove(index); + onChanged(); + } else { + outputBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public org.tensorflow.proto.NodeOutput.Builder getOutputBuilder( + int index) { + return getOutputFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public org.tensorflow.proto.NodeOutputOrBuilder getOutputOrBuilder( + int index) { + if (outputBuilder_ == null) { + return output_.get(index); } else { + return outputBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public java.util.List + getOutputOrBuilderList() { + if (outputBuilder_ != null) { + return outputBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(output_); + } + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public org.tensorflow.proto.NodeOutput.Builder addOutputBuilder() { + return getOutputFieldBuilder().addBuilder( + org.tensorflow.proto.NodeOutput.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public org.tensorflow.proto.NodeOutput.Builder addOutputBuilder( + int index) { + return getOutputFieldBuilder().addBuilder( + index, org.tensorflow.proto.NodeOutput.getDefaultInstance()); + } + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + public java.util.List + getOutputBuilderList() { + return getOutputFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeOutput, org.tensorflow.proto.NodeOutput.Builder, org.tensorflow.proto.NodeOutputOrBuilder> + getOutputFieldBuilder() { + if (outputBuilder_ == null) { + outputBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.NodeOutput, org.tensorflow.proto.NodeOutput.Builder, org.tensorflow.proto.NodeOutputOrBuilder>( + output_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + output_ = null; + } + return outputBuilder_; + } + + private java.lang.Object timelineLabel_ = ""; + /** + * string timeline_label = 8; + * @return The timelineLabel. + */ + public java.lang.String getTimelineLabel() { + java.lang.Object ref = timelineLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timelineLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string timeline_label = 8; + * @return The bytes for timelineLabel. + */ + public com.google.protobuf.ByteString + getTimelineLabelBytes() { + java.lang.Object ref = timelineLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timelineLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string timeline_label = 8; + * @param value The timelineLabel to set. + * @return This builder for chaining. + */ + public Builder setTimelineLabel( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + timelineLabel_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * string timeline_label = 8; + * @return This builder for chaining. + */ + public Builder clearTimelineLabel() { + timelineLabel_ = getDefaultInstance().getTimelineLabel(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * string timeline_label = 8; + * @param value The bytes for timelineLabel to set. + * @return This builder for chaining. + */ + public Builder setTimelineLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + timelineLabel_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private long scheduledMicros_ ; + /** + * int64 scheduled_micros = 9; + * @return The scheduledMicros. + */ + @java.lang.Override + public long getScheduledMicros() { + return scheduledMicros_; + } + /** + * int64 scheduled_micros = 9; + * @param value The scheduledMicros to set. + * @return This builder for chaining. + */ + public Builder setScheduledMicros(long value) { + + scheduledMicros_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 scheduled_micros = 9; + * @return This builder for chaining. + */ + public Builder clearScheduledMicros() { + bitField0_ = (bitField0_ & ~0x00000100); + scheduledMicros_ = 0L; + onChanged(); + return this; + } + + private int threadId_ ; + /** + * uint32 thread_id = 10; + * @return The threadId. + */ + @java.lang.Override + public int getThreadId() { + return threadId_; + } + /** + * uint32 thread_id = 10; + * @param value The threadId to set. + * @return This builder for chaining. + */ + public Builder setThreadId(int value) { + + threadId_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * uint32 thread_id = 10; + * @return This builder for chaining. + */ + public Builder clearThreadId() { + bitField0_ = (bitField0_ & ~0x00000200); + threadId_ = 0; + onChanged(); + return this; + } + + private java.util.List referencedTensor_ = + java.util.Collections.emptyList(); + private void ensureReferencedTensorIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + referencedTensor_ = new java.util.ArrayList(referencedTensor_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder> referencedTensorBuilder_; + + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public java.util.List getReferencedTensorList() { + if (referencedTensorBuilder_ == null) { + return java.util.Collections.unmodifiableList(referencedTensor_); + } else { + return referencedTensorBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public int getReferencedTensorCount() { + if (referencedTensorBuilder_ == null) { + return referencedTensor_.size(); + } else { + return referencedTensorBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public org.tensorflow.proto.AllocationDescription getReferencedTensor(int index) { + if (referencedTensorBuilder_ == null) { + return referencedTensor_.get(index); + } else { + return referencedTensorBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder setReferencedTensor( + int index, org.tensorflow.proto.AllocationDescription value) { + if (referencedTensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTensorIsMutable(); + referencedTensor_.set(index, value); + onChanged(); + } else { + referencedTensorBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder setReferencedTensor( + int index, org.tensorflow.proto.AllocationDescription.Builder builderForValue) { + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + referencedTensor_.set(index, builderForValue.build()); + onChanged(); + } else { + referencedTensorBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder addReferencedTensor(org.tensorflow.proto.AllocationDescription value) { + if (referencedTensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTensorIsMutable(); + referencedTensor_.add(value); + onChanged(); + } else { + referencedTensorBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder addReferencedTensor( + int index, org.tensorflow.proto.AllocationDescription value) { + if (referencedTensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTensorIsMutable(); + referencedTensor_.add(index, value); + onChanged(); + } else { + referencedTensorBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder addReferencedTensor( + org.tensorflow.proto.AllocationDescription.Builder builderForValue) { + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + referencedTensor_.add(builderForValue.build()); + onChanged(); + } else { + referencedTensorBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder addReferencedTensor( + int index, org.tensorflow.proto.AllocationDescription.Builder builderForValue) { + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + referencedTensor_.add(index, builderForValue.build()); + onChanged(); + } else { + referencedTensorBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder addAllReferencedTensor( + java.lang.Iterable values) { + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, referencedTensor_); + onChanged(); + } else { + referencedTensorBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder clearReferencedTensor() { + if (referencedTensorBuilder_ == null) { + referencedTensor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + referencedTensorBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public Builder removeReferencedTensor(int index) { + if (referencedTensorBuilder_ == null) { + ensureReferencedTensorIsMutable(); + referencedTensor_.remove(index); + onChanged(); + } else { + referencedTensorBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public org.tensorflow.proto.AllocationDescription.Builder getReferencedTensorBuilder( + int index) { + return getReferencedTensorFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public org.tensorflow.proto.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( + int index) { + if (referencedTensorBuilder_ == null) { + return referencedTensor_.get(index); } else { + return referencedTensorBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public java.util.List + getReferencedTensorOrBuilderList() { + if (referencedTensorBuilder_ != null) { + return referencedTensorBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(referencedTensor_); + } + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public org.tensorflow.proto.AllocationDescription.Builder addReferencedTensorBuilder() { + return getReferencedTensorFieldBuilder().addBuilder( + org.tensorflow.proto.AllocationDescription.getDefaultInstance()); + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public org.tensorflow.proto.AllocationDescription.Builder addReferencedTensorBuilder( + int index) { + return getReferencedTensorFieldBuilder().addBuilder( + index, org.tensorflow.proto.AllocationDescription.getDefaultInstance()); + } + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + public java.util.List + getReferencedTensorBuilderList() { + return getReferencedTensorFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder> + getReferencedTensorFieldBuilder() { + if (referencedTensorBuilder_ == null) { + referencedTensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder>( + referencedTensor_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + referencedTensor_ = null; + } + return referencedTensorBuilder_; + } + + private org.tensorflow.proto.MemoryStats memoryStats_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryStats, org.tensorflow.proto.MemoryStats.Builder, org.tensorflow.proto.MemoryStatsOrBuilder> memoryStatsBuilder_; + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return Whether the memoryStats field is set. + */ + public boolean hasMemoryStats() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return The memoryStats. + */ + public org.tensorflow.proto.MemoryStats getMemoryStats() { + if (memoryStatsBuilder_ == null) { + return memoryStats_ == null ? org.tensorflow.proto.MemoryStats.getDefaultInstance() : memoryStats_; + } else { + return memoryStatsBuilder_.getMessage(); + } + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public Builder setMemoryStats(org.tensorflow.proto.MemoryStats value) { + if (memoryStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + memoryStats_ = value; + } else { + memoryStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public Builder setMemoryStats( + org.tensorflow.proto.MemoryStats.Builder builderForValue) { + if (memoryStatsBuilder_ == null) { + memoryStats_ = builderForValue.build(); + } else { + memoryStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public Builder mergeMemoryStats(org.tensorflow.proto.MemoryStats value) { + if (memoryStatsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) && + memoryStats_ != null && + memoryStats_ != org.tensorflow.proto.MemoryStats.getDefaultInstance()) { + getMemoryStatsBuilder().mergeFrom(value); + } else { + memoryStats_ = value; + } + } else { + memoryStatsBuilder_.mergeFrom(value); + } + if (memoryStats_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public Builder clearMemoryStats() { + bitField0_ = (bitField0_ & ~0x00000800); + memoryStats_ = null; + if (memoryStatsBuilder_ != null) { + memoryStatsBuilder_.dispose(); + memoryStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public org.tensorflow.proto.MemoryStats.Builder getMemoryStatsBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getMemoryStatsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + public org.tensorflow.proto.MemoryStatsOrBuilder getMemoryStatsOrBuilder() { + if (memoryStatsBuilder_ != null) { + return memoryStatsBuilder_.getMessageOrBuilder(); + } else { + return memoryStats_ == null ? + org.tensorflow.proto.MemoryStats.getDefaultInstance() : memoryStats_; + } + } + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryStats, org.tensorflow.proto.MemoryStats.Builder, org.tensorflow.proto.MemoryStatsOrBuilder> + getMemoryStatsFieldBuilder() { + if (memoryStatsBuilder_ == null) { + memoryStatsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MemoryStats, org.tensorflow.proto.MemoryStats.Builder, org.tensorflow.proto.MemoryStatsOrBuilder>( + getMemoryStats(), + getParentForChildren(), + isClean()); + memoryStats_ = null; + } + return memoryStatsBuilder_; + } + + private long allStartNanos_ ; + /** + * int64 all_start_nanos = 13; + * @return The allStartNanos. + */ + @java.lang.Override + public long getAllStartNanos() { + return allStartNanos_; + } + /** + * int64 all_start_nanos = 13; + * @param value The allStartNanos to set. + * @return This builder for chaining. + */ + public Builder setAllStartNanos(long value) { + + allStartNanos_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int64 all_start_nanos = 13; + * @return This builder for chaining. + */ + public Builder clearAllStartNanos() { + bitField0_ = (bitField0_ & ~0x00001000); + allStartNanos_ = 0L; + onChanged(); + return this; + } + + private long opStartRelNanos_ ; + /** + * int64 op_start_rel_nanos = 14; + * @return The opStartRelNanos. + */ + @java.lang.Override + public long getOpStartRelNanos() { + return opStartRelNanos_; + } + /** + * int64 op_start_rel_nanos = 14; + * @param value The opStartRelNanos to set. + * @return This builder for chaining. + */ + public Builder setOpStartRelNanos(long value) { + + opStartRelNanos_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * int64 op_start_rel_nanos = 14; + * @return This builder for chaining. + */ + public Builder clearOpStartRelNanos() { + bitField0_ = (bitField0_ & ~0x00002000); + opStartRelNanos_ = 0L; + onChanged(); + return this; + } + + private long opEndRelNanos_ ; + /** + * int64 op_end_rel_nanos = 15; + * @return The opEndRelNanos. + */ + @java.lang.Override + public long getOpEndRelNanos() { + return opEndRelNanos_; + } + /** + * int64 op_end_rel_nanos = 15; + * @param value The opEndRelNanos to set. + * @return This builder for chaining. + */ + public Builder setOpEndRelNanos(long value) { + + opEndRelNanos_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int64 op_end_rel_nanos = 15; + * @return This builder for chaining. + */ + public Builder clearOpEndRelNanos() { + bitField0_ = (bitField0_ & ~0x00004000); + opEndRelNanos_ = 0L; + onChanged(); + return this; + } + + private long allEndRelNanos_ ; + /** + * int64 all_end_rel_nanos = 16; + * @return The allEndRelNanos. + */ + @java.lang.Override + public long getAllEndRelNanos() { + return allEndRelNanos_; + } + /** + * int64 all_end_rel_nanos = 16; + * @param value The allEndRelNanos to set. + * @return This builder for chaining. + */ + public Builder setAllEndRelNanos(long value) { + + allEndRelNanos_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * int64 all_end_rel_nanos = 16; + * @return This builder for chaining. + */ + public Builder clearAllEndRelNanos() { + bitField0_ = (bitField0_ & ~0x00008000); + allEndRelNanos_ = 0L; + onChanged(); + return this; + } + + private long scheduledNanos_ ; + /** + * int64 scheduled_nanos = 17; + * @return The scheduledNanos. + */ + @java.lang.Override + public long getScheduledNanos() { + return scheduledNanos_; + } + /** + * int64 scheduled_nanos = 17; + * @param value The scheduledNanos to set. + * @return This builder for chaining. + */ + public Builder setScheduledNanos(long value) { + + scheduledNanos_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int64 scheduled_nanos = 17; + * @return This builder for chaining. + */ + public Builder clearScheduledNanos() { + bitField0_ = (bitField0_ & ~0x00010000); + scheduledNanos_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NodeExecStats) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NodeExecStats) + private static final org.tensorflow.proto.NodeExecStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NodeExecStats(); + } + + public static org.tensorflow.proto.NodeExecStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeExecStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NodeExecStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStatsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStatsOrBuilder.java new file mode 100644 index 00000000000..96407c0f8eb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeExecStatsOrBuilder.java @@ -0,0 +1,202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface NodeExecStatsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NodeExecStats) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * TODO(tucker): Use some more compact form of node identity than
    +   * the full string name.  Either all processes should agree on a
    +   * global id (cost_id?) for each node, or we should use a hash of
    +   * the name.
    +   * 
    + * + * string node_name = 1; + * @return The nodeName. + */ + java.lang.String getNodeName(); + /** + *
    +   * TODO(tucker): Use some more compact form of node identity than
    +   * the full string name.  Either all processes should agree on a
    +   * global id (cost_id?) for each node, or we should use a hash of
    +   * the name.
    +   * 
    + * + * string node_name = 1; + * @return The bytes for nodeName. + */ + com.google.protobuf.ByteString + getNodeNameBytes(); + + /** + * int64 all_start_micros = 2; + * @return The allStartMicros. + */ + long getAllStartMicros(); + + /** + * int64 op_start_rel_micros = 3; + * @return The opStartRelMicros. + */ + long getOpStartRelMicros(); + + /** + * int64 op_end_rel_micros = 4; + * @return The opEndRelMicros. + */ + long getOpEndRelMicros(); + + /** + * int64 all_end_rel_micros = 5; + * @return The allEndRelMicros. + */ + long getAllEndRelMicros(); + + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + java.util.List + getMemoryList(); + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + org.tensorflow.proto.AllocatorMemoryUsed getMemory(int index); + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + int getMemoryCount(); + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + java.util.List + getMemoryOrBuilderList(); + /** + * repeated .tensorflow.AllocatorMemoryUsed memory = 6; + */ + org.tensorflow.proto.AllocatorMemoryUsedOrBuilder getMemoryOrBuilder( + int index); + + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + java.util.List + getOutputList(); + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + org.tensorflow.proto.NodeOutput getOutput(int index); + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + int getOutputCount(); + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + java.util.List + getOutputOrBuilderList(); + /** + * repeated .tensorflow.NodeOutput output = 7; + */ + org.tensorflow.proto.NodeOutputOrBuilder getOutputOrBuilder( + int index); + + /** + * string timeline_label = 8; + * @return The timelineLabel. + */ + java.lang.String getTimelineLabel(); + /** + * string timeline_label = 8; + * @return The bytes for timelineLabel. + */ + com.google.protobuf.ByteString + getTimelineLabelBytes(); + + /** + * int64 scheduled_micros = 9; + * @return The scheduledMicros. + */ + long getScheduledMicros(); + + /** + * uint32 thread_id = 10; + * @return The threadId. + */ + int getThreadId(); + + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + java.util.List + getReferencedTensorList(); + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + org.tensorflow.proto.AllocationDescription getReferencedTensor(int index); + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + int getReferencedTensorCount(); + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + java.util.List + getReferencedTensorOrBuilderList(); + /** + * repeated .tensorflow.AllocationDescription referenced_tensor = 11; + */ + org.tensorflow.proto.AllocationDescriptionOrBuilder getReferencedTensorOrBuilder( + int index); + + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return Whether the memoryStats field is set. + */ + boolean hasMemoryStats(); + /** + * .tensorflow.MemoryStats memory_stats = 12; + * @return The memoryStats. + */ + org.tensorflow.proto.MemoryStats getMemoryStats(); + /** + * .tensorflow.MemoryStats memory_stats = 12; + */ + org.tensorflow.proto.MemoryStatsOrBuilder getMemoryStatsOrBuilder(); + + /** + * int64 all_start_nanos = 13; + * @return The allStartNanos. + */ + long getAllStartNanos(); + + /** + * int64 op_start_rel_nanos = 14; + * @return The opStartRelNanos. + */ + long getOpStartRelNanos(); + + /** + * int64 op_end_rel_nanos = 15; + * @return The opEndRelNanos. + */ + long getOpEndRelNanos(); + + /** + * int64 all_end_rel_nanos = 16; + * @return The allEndRelNanos. + */ + long getAllEndRelNanos(); + + /** + * int64 scheduled_nanos = 17; + * @return The scheduledNanos. + */ + long getScheduledNanos(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutput.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutput.java new file mode 100644 index 00000000000..d7d647f0d7c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutput.java @@ -0,0 +1,632 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Output sizes recorded for a single execution of a graph node.
    + * 
    + * + * Protobuf type {@code tensorflow.NodeOutput} + */ +public final class NodeOutput extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NodeOutput) + NodeOutputOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeOutput.class.getName()); + } + // Use NodeOutput.newBuilder() to construct. + private NodeOutput(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NodeOutput() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeOutput.class, org.tensorflow.proto.NodeOutput.Builder.class); + } + + private int bitField0_; + public static final int SLOT_FIELD_NUMBER = 1; + private int slot_ = 0; + /** + * int32 slot = 1; + * @return The slot. + */ + @java.lang.Override + public int getSlot() { + return slot_; + } + + public static final int TENSOR_DESCRIPTION_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorDescription tensorDescription_; + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return Whether the tensorDescription field is set. + */ + @java.lang.Override + public boolean hasTensorDescription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return The tensorDescription. + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescription getTensorDescription() { + return tensorDescription_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensorDescription_; + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder() { + return tensorDescription_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensorDescription_; + } + + 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 (slot_ != 0) { + output.writeInt32(1, slot_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTensorDescription()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (slot_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, slot_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTensorDescription()); + } + size += getUnknownFields().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.NodeOutput)) { + return super.equals(obj); + } + org.tensorflow.proto.NodeOutput other = (org.tensorflow.proto.NodeOutput) obj; + + if (getSlot() + != other.getSlot()) return false; + if (hasTensorDescription() != other.hasTensorDescription()) return false; + if (hasTensorDescription()) { + if (!getTensorDescription() + .equals(other.getTensorDescription())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SLOT_FIELD_NUMBER; + hash = (53 * hash) + getSlot(); + if (hasTensorDescription()) { + hash = (37 * hash) + TENSOR_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getTensorDescription().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.NodeOutput parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeOutput 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.NodeOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeOutput 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.NodeOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.NodeOutput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.NodeOutput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeOutput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.NodeOutput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.NodeOutput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.NodeOutput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.NodeOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.NodeOutput 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Output sizes recorded for a single execution of a graph node.
    +   * 
    + * + * Protobuf type {@code tensorflow.NodeOutput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NodeOutput) + org.tensorflow.proto.NodeOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.NodeOutput.class, org.tensorflow.proto.NodeOutput.Builder.class); + } + + // Construct using org.tensorflow.proto.NodeOutput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorDescriptionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + slot_ = 0; + tensorDescription_ = null; + if (tensorDescriptionBuilder_ != null) { + tensorDescriptionBuilder_.dispose(); + tensorDescriptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_NodeOutput_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.NodeOutput getDefaultInstanceForType() { + return org.tensorflow.proto.NodeOutput.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.NodeOutput build() { + org.tensorflow.proto.NodeOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.NodeOutput buildPartial() { + org.tensorflow.proto.NodeOutput result = new org.tensorflow.proto.NodeOutput(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.NodeOutput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.slot_ = slot_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tensorDescription_ = tensorDescriptionBuilder_ == null + ? tensorDescription_ + : tensorDescriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.NodeOutput) { + return mergeFrom((org.tensorflow.proto.NodeOutput)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.NodeOutput other) { + if (other == org.tensorflow.proto.NodeOutput.getDefaultInstance()) return this; + if (other.getSlot() != 0) { + setSlot(other.getSlot()); + } + if (other.hasTensorDescription()) { + mergeTensorDescription(other.getTensorDescription()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + slot_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 26: { + input.readMessage( + getTensorDescriptionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int slot_ ; + /** + * int32 slot = 1; + * @return The slot. + */ + @java.lang.Override + public int getSlot() { + return slot_; + } + /** + * int32 slot = 1; + * @param value The slot to set. + * @return This builder for chaining. + */ + public Builder setSlot(int value) { + + slot_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 slot = 1; + * @return This builder for chaining. + */ + public Builder clearSlot() { + bitField0_ = (bitField0_ & ~0x00000001); + slot_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorDescription tensorDescription_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> tensorDescriptionBuilder_; + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return Whether the tensorDescription field is set. + */ + public boolean hasTensorDescription() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return The tensorDescription. + */ + public org.tensorflow.proto.TensorDescription getTensorDescription() { + if (tensorDescriptionBuilder_ == null) { + return tensorDescription_ == null ? org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensorDescription_; + } else { + return tensorDescriptionBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public Builder setTensorDescription(org.tensorflow.proto.TensorDescription value) { + if (tensorDescriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorDescription_ = value; + } else { + tensorDescriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public Builder setTensorDescription( + org.tensorflow.proto.TensorDescription.Builder builderForValue) { + if (tensorDescriptionBuilder_ == null) { + tensorDescription_ = builderForValue.build(); + } else { + tensorDescriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public Builder mergeTensorDescription(org.tensorflow.proto.TensorDescription value) { + if (tensorDescriptionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + tensorDescription_ != null && + tensorDescription_ != org.tensorflow.proto.TensorDescription.getDefaultInstance()) { + getTensorDescriptionBuilder().mergeFrom(value); + } else { + tensorDescription_ = value; + } + } else { + tensorDescriptionBuilder_.mergeFrom(value); + } + if (tensorDescription_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public Builder clearTensorDescription() { + bitField0_ = (bitField0_ & ~0x00000002); + tensorDescription_ = null; + if (tensorDescriptionBuilder_ != null) { + tensorDescriptionBuilder_.dispose(); + tensorDescriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public org.tensorflow.proto.TensorDescription.Builder getTensorDescriptionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTensorDescriptionFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + public org.tensorflow.proto.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder() { + if (tensorDescriptionBuilder_ != null) { + return tensorDescriptionBuilder_.getMessageOrBuilder(); + } else { + return tensorDescription_ == null ? + org.tensorflow.proto.TensorDescription.getDefaultInstance() : tensorDescription_; + } + } + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder> + getTensorDescriptionFieldBuilder() { + if (tensorDescriptionBuilder_ == null) { + tensorDescriptionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorDescription, org.tensorflow.proto.TensorDescription.Builder, org.tensorflow.proto.TensorDescriptionOrBuilder>( + getTensorDescription(), + getParentForChildren(), + isClean()); + tensorDescription_ = null; + } + return tensorDescriptionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NodeOutput) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NodeOutput) + private static final org.tensorflow.proto.NodeOutput DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.NodeOutput(); + } + + public static org.tensorflow.proto.NodeOutput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.NodeOutput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutputOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutputOrBuilder.java new file mode 100644 index 00000000000..544c48d05df --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeOutputOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface NodeOutputOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NodeOutput) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 slot = 1; + * @return The slot. + */ + int getSlot(); + + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return Whether the tensorDescription field is set. + */ + boolean hasTensorDescription(); + /** + * .tensorflow.TensorDescription tensor_description = 3; + * @return The tensorDescription. + */ + org.tensorflow.proto.TensorDescription getTensorDescription(); + /** + * .tensorflow.TensorDescription tensor_description = 3; + */ + org.tensorflow.proto.TensorDescriptionOrBuilder getTensorDescriptionOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeProto.java new file mode 100644 index 00000000000..8e3f1a3aed9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/NodeProto.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/node_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class NodeProto { + private NodeProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeProto.class.getName()); + } + 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_NodeDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NodeDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NodeDef_AttrEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NodeDef_AttrEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_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/framework/node_def.pro" + + "to\022\ntensorflow\032*tensorflow/core/framewor" + + "k/attr_value.proto\032)tensorflow/core/fram" + + "ework/full_type.proto\"\206\003\n\007NodeDef\022\014\n\004nam" + + "e\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006de" + + "vice\030\004 \001(\t\022+\n\004attr\030\005 \003(\0132\035.tensorflow.No" + + "deDef.AttrEntry\022J\n\027experimental_debug_in" + + "fo\030\006 \001(\0132).tensorflow.NodeDef.Experiment" + + "alDebugInfo\0222\n\021experimental_type\030\007 \001(\0132\027" + + ".tensorflow.FullTypeDef\032B\n\tAttrEntry\022\013\n\003" + + "key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensorflow.At" + + "trValue:\0028\001\032Q\n\025ExperimentalDebugInfo\022\033\n\023" + + "original_node_names\030\001 \003(\t\022\033\n\023original_fu" + + "nc_names\030\002 \003(\tBw\n\024org.tensorflow.protoB\t" + + "NodeProtoP\001ZOgithub.com/tensorflow/tenso" + + "rflow/tensorflow/go/core/framework/node_" + + "def_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + org.tensorflow.proto.FullTypeProtos.getDescriptor(), + }); + internal_static_tensorflow_NodeDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_NodeDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NodeDef_descriptor, + new java.lang.String[] { "Name", "Op", "Input", "Device", "Attr", "ExperimentalDebugInfo", "ExperimentalType", }); + internal_static_tensorflow_NodeDef_AttrEntry_descriptor = + internal_static_tensorflow_NodeDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_NodeDef_AttrEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NodeDef_AttrEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor = + internal_static_tensorflow_NodeDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NodeDef_ExperimentalDebugInfo_descriptor, + new java.lang.String[] { "OriginalNodeNames", "OriginalFuncNames", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + org.tensorflow.proto.FullTypeProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDef.java new file mode 100644 index 00000000000..e24a3dd5e36 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDef.java @@ -0,0 +1,7360 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    + * using the "op" field which should match the name of a OpDef.
    + * LINT.IfChange
    + * 
    + * + * Protobuf type {@code tensorflow.OpDef} + */ +public final class OpDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpDef) + OpDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpDef.class.getName()); + } + // Use OpDef.newBuilder() to construct. + private OpDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpDef() { + name_ = ""; + inputArg_ = java.util.Collections.emptyList(); + outputArg_ = java.util.Collections.emptyList(); + controlOutput_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + attr_ = java.util.Collections.emptyList(); + summary_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.class, org.tensorflow.proto.OpDef.Builder.class); + } + + public interface ArgDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.ArgDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Human readable description.
    +     * 
    + * + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +     * Human readable description.
    +     * 
    + * + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
    +     * Describes the type of one or more tensors that are accepted/produced
    +     * by this input/output arg.  The only legal combinations are:
    +     * * For a single tensor: either the "type" field is set or the
    +     * "type_attr" field is set to the name of an attr with type "type".
    +     * * For a sequence of tensors with the same type: the "number_attr"
    +     * field will be set to the name of an attr with type "int", and
    +     * either the "type" or "type_attr" field will be set as for
    +     * single tensors.
    +     * * For a sequence of tensors, the "type_list_attr" field will be set
    +     * to the name of an attr with type "list(type)".
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + *
    +     * Describes the type of one or more tensors that are accepted/produced
    +     * by this input/output arg.  The only legal combinations are:
    +     * * For a single tensor: either the "type" field is set or the
    +     * "type_attr" field is set to the name of an attr with type "type".
    +     * * For a sequence of tensors with the same type: the "number_attr"
    +     * field will be set to the name of an attr with type "int", and
    +     * either the "type" or "type_attr" field will be set as for
    +     * single tensors.
    +     * * For a sequence of tensors, the "type_list_attr" field will be set
    +     * to the name of an attr with type "list(type)".
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + org.tensorflow.proto.DataType getType(); + + /** + *
    +     * if specified, attr must have type "type"
    +     * 
    + * + * string type_attr = 4; + * @return The typeAttr. + */ + java.lang.String getTypeAttr(); + /** + *
    +     * if specified, attr must have type "type"
    +     * 
    + * + * string type_attr = 4; + * @return The bytes for typeAttr. + */ + com.google.protobuf.ByteString + getTypeAttrBytes(); + + /** + *
    +     * if specified, attr must have type "int"
    +     * 
    + * + * string number_attr = 5; + * @return The numberAttr. + */ + java.lang.String getNumberAttr(); + /** + *
    +     * if specified, attr must have type "int"
    +     * 
    + * + * string number_attr = 5; + * @return The bytes for numberAttr. + */ + com.google.protobuf.ByteString + getNumberAttrBytes(); + + /** + *
    +     * If specified, attr must have type "list(type)", and none of
    +     * type, type_attr, and number_attr may be specified.
    +     * 
    + * + * string type_list_attr = 6; + * @return The typeListAttr. + */ + java.lang.String getTypeListAttr(); + /** + *
    +     * If specified, attr must have type "list(type)", and none of
    +     * type, type_attr, and number_attr may be specified.
    +     * 
    + * + * string type_list_attr = 6; + * @return The bytes for typeListAttr. + */ + com.google.protobuf.ByteString + getTypeListAttrBytes(); + + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + java.util.List + getHandleDataList(); + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getHandleData(int index); + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + int getHandleDataCount(); + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + java.util.List + getHandleDataOrBuilderList(); + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( + int index); + + /** + *
    +     * For inputs: if true, the inputs are required to be refs.
    +     * By default, inputs can be either refs or non-refs.
    +     * For outputs: if true, outputs are refs, otherwise they are not.
    +     * 
    + * + * bool is_ref = 16; + * @return The isRef. + */ + boolean getIsRef(); + + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return Whether the experimentalFullType field is set. + */ + boolean hasExperimentalFullType(); + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return The experimentalFullType. + */ + org.tensorflow.proto.FullTypeDef getExperimentalFullType(); + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder(); + } + /** + *
    +   * For describing inputs and outputs.
    +   * 
    + * + * Protobuf type {@code tensorflow.OpDef.ArgDef} + */ + public static final class ArgDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpDef.ArgDef) + ArgDefOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ArgDef.class.getName()); + } + // Use ArgDef.newBuilder() to construct. + private ArgDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ArgDef() { + name_ = ""; + description_ = ""; + type_ = 0; + typeAttr_ = ""; + numberAttr_ = ""; + typeListAttr_ = ""; + handleData_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.ArgDef.class, org.tensorflow.proto.OpDef.ArgDef.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 DESCRIPTION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +     * Human readable description.
    +     * 
    + * + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +     * Human readable description.
    +     * 
    + * + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + *
    +     * Describes the type of one or more tensors that are accepted/produced
    +     * by this input/output arg.  The only legal combinations are:
    +     * * For a single tensor: either the "type" field is set or the
    +     * "type_attr" field is set to the name of an attr with type "type".
    +     * * For a sequence of tensors with the same type: the "number_attr"
    +     * field will be set to the name of an attr with type "int", and
    +     * either the "type" or "type_attr" field will be set as for
    +     * single tensors.
    +     * * For a sequence of tensors, the "type_list_attr" field will be set
    +     * to the name of an attr with type "list(type)".
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
    +     * Describes the type of one or more tensors that are accepted/produced
    +     * by this input/output arg.  The only legal combinations are:
    +     * * For a single tensor: either the "type" field is set or the
    +     * "type_attr" field is set to the name of an attr with type "type".
    +     * * For a sequence of tensors with the same type: the "number_attr"
    +     * field will be set to the name of an attr with type "int", and
    +     * either the "type" or "type_attr" field will be set as for
    +     * single tensors.
    +     * * For a sequence of tensors, the "type_list_attr" field will be set
    +     * to the name of an attr with type "list(type)".
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + @java.lang.Override public org.tensorflow.proto.DataType getType() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(type_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int TYPE_ATTR_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object typeAttr_ = ""; + /** + *
    +     * if specified, attr must have type "type"
    +     * 
    + * + * string type_attr = 4; + * @return The typeAttr. + */ + @java.lang.Override + public java.lang.String getTypeAttr() { + java.lang.Object ref = typeAttr_; + 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(); + typeAttr_ = s; + return s; + } + } + /** + *
    +     * if specified, attr must have type "type"
    +     * 
    + * + * string type_attr = 4; + * @return The bytes for typeAttr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeAttrBytes() { + java.lang.Object ref = typeAttr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUMBER_ATTR_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object numberAttr_ = ""; + /** + *
    +     * if specified, attr must have type "int"
    +     * 
    + * + * string number_attr = 5; + * @return The numberAttr. + */ + @java.lang.Override + public java.lang.String getNumberAttr() { + java.lang.Object ref = numberAttr_; + 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(); + numberAttr_ = s; + return s; + } + } + /** + *
    +     * if specified, attr must have type "int"
    +     * 
    + * + * string number_attr = 5; + * @return The bytes for numberAttr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNumberAttrBytes() { + java.lang.Object ref = numberAttr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + numberAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_LIST_ATTR_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object typeListAttr_ = ""; + /** + *
    +     * If specified, attr must have type "list(type)", and none of
    +     * type, type_attr, and number_attr may be specified.
    +     * 
    + * + * string type_list_attr = 6; + * @return The typeListAttr. + */ + @java.lang.Override + public java.lang.String getTypeListAttr() { + java.lang.Object ref = typeListAttr_; + 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(); + typeListAttr_ = s; + return s; + } + } + /** + *
    +     * If specified, attr must have type "list(type)", and none of
    +     * type, type_attr, and number_attr may be specified.
    +     * 
    + * + * string type_list_attr = 6; + * @return The bytes for typeListAttr. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeListAttrBytes() { + java.lang.Object ref = typeListAttr_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeListAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HANDLE_DATA_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List handleData_; + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + @java.lang.Override + public java.util.List getHandleDataList() { + return handleData_; + } + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + @java.lang.Override + public java.util.List + getHandleDataOrBuilderList() { + return handleData_; + } + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + @java.lang.Override + public int getHandleDataCount() { + return handleData_.size(); + } + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getHandleData(int index) { + return handleData_.get(index); + } + /** + *
    +     * The handle data for resource inputs.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( + int index) { + return handleData_.get(index); + } + + public static final int IS_REF_FIELD_NUMBER = 16; + private boolean isRef_ = false; + /** + *
    +     * For inputs: if true, the inputs are required to be refs.
    +     * By default, inputs can be either refs or non-refs.
    +     * For outputs: if true, outputs are refs, otherwise they are not.
    +     * 
    + * + * bool is_ref = 16; + * @return The isRef. + */ + @java.lang.Override + public boolean getIsRef() { + return isRef_; + } + + public static final int EXPERIMENTAL_FULL_TYPE_FIELD_NUMBER = 17; + private org.tensorflow.proto.FullTypeDef experimentalFullType_; + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return Whether the experimentalFullType field is set. + */ + @java.lang.Override + public boolean hasExperimentalFullType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return The experimentalFullType. + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDef getExperimentalFullType() { + return experimentalFullType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalFullType_; + } + /** + *
    +     * Experimental. Full type declaration for this argument.
    +     * The full type specification combines type, type_attr, type_list_attr,
    +     * etc. into a unified representation.
    +     * This declaration may contain non-concrete types (for example,
    +     * Tensor<TypeVar<'T'>> is a valid type declaration.
    +     *
    +     * Note: this is a transient field. The long-term aim is to represent the
    +     * entire OpDef as a single type: a callable. In that context, this field is
    +     * just the type of a single argument.
    +     * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + @java.lang.Override + public org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder() { + return experimentalFullType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalFullType_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (type_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(3, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeAttr_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, typeAttr_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(numberAttr_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, numberAttr_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeListAttr_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, typeListAttr_); + } + for (int i = 0; i < handleData_.size(); i++) { + output.writeMessage(7, handleData_.get(i)); + } + if (isRef_ != false) { + output.writeBool(16, isRef_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(17, getExperimentalFullType()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (type_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeAttr_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, typeAttr_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(numberAttr_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, numberAttr_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeListAttr_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, typeListAttr_); + } + for (int i = 0; i < handleData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, handleData_.get(i)); + } + if (isRef_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, isRef_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getExperimentalFullType()); + } + size += getUnknownFields().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.OpDef.ArgDef)) { + return super.equals(obj); + } + org.tensorflow.proto.OpDef.ArgDef other = (org.tensorflow.proto.OpDef.ArgDef) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (type_ != other.type_) return false; + if (!getTypeAttr() + .equals(other.getTypeAttr())) return false; + if (!getNumberAttr() + .equals(other.getNumberAttr())) return false; + if (!getTypeListAttr() + .equals(other.getTypeListAttr())) return false; + if (!getHandleDataList() + .equals(other.getHandleDataList())) return false; + if (getIsRef() + != other.getIsRef()) return false; + if (hasExperimentalFullType() != other.hasExperimentalFullType()) return false; + if (hasExperimentalFullType()) { + if (!getExperimentalFullType() + .equals(other.getExperimentalFullType())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + TYPE_ATTR_FIELD_NUMBER; + hash = (53 * hash) + getTypeAttr().hashCode(); + hash = (37 * hash) + NUMBER_ATTR_FIELD_NUMBER; + hash = (53 * hash) + getNumberAttr().hashCode(); + hash = (37 * hash) + TYPE_LIST_ATTR_FIELD_NUMBER; + hash = (53 * hash) + getTypeListAttr().hashCode(); + if (getHandleDataCount() > 0) { + hash = (37 * hash) + HANDLE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getHandleDataList().hashCode(); + } + hash = (37 * hash) + IS_REF_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsRef()); + if (hasExperimentalFullType()) { + hash = (37 * hash) + EXPERIMENTAL_FULL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getExperimentalFullType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpDef.ArgDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.ArgDef 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.OpDef.ArgDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.ArgDef 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.OpDef.ArgDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.ArgDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpDef.ArgDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef.ArgDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpDef.ArgDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpDef.ArgDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpDef.ArgDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef.ArgDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpDef.ArgDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * For describing inputs and outputs.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpDef.ArgDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.ArgDef) + org.tensorflow.proto.OpDef.ArgDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.ArgDef.class, org.tensorflow.proto.OpDef.ArgDef.Builder.class); + } + + // Construct using org.tensorflow.proto.OpDef.ArgDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getHandleDataFieldBuilder(); + getExperimentalFullTypeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + type_ = 0; + typeAttr_ = ""; + numberAttr_ = ""; + typeListAttr_ = ""; + if (handleDataBuilder_ == null) { + handleData_ = java.util.Collections.emptyList(); + } else { + handleData_ = null; + handleDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + isRef_ = false; + experimentalFullType_ = null; + if (experimentalFullTypeBuilder_ != null) { + experimentalFullTypeBuilder_.dispose(); + experimentalFullTypeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_ArgDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDef getDefaultInstanceForType() { + return org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDef build() { + org.tensorflow.proto.OpDef.ArgDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDef buildPartial() { + org.tensorflow.proto.OpDef.ArgDef result = new org.tensorflow.proto.OpDef.ArgDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OpDef.ArgDef result) { + if (handleDataBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + handleData_ = java.util.Collections.unmodifiableList(handleData_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.handleData_ = handleData_; + } else { + result.handleData_ = handleDataBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.OpDef.ArgDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.typeAttr_ = typeAttr_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.numberAttr_ = numberAttr_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.typeListAttr_ = typeListAttr_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.isRef_ = isRef_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000100) != 0)) { + result.experimentalFullType_ = experimentalFullTypeBuilder_ == null + ? experimentalFullType_ + : experimentalFullTypeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpDef.ArgDef) { + return mergeFrom((org.tensorflow.proto.OpDef.ArgDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpDef.ArgDef other) { + if (other == org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getTypeAttr().isEmpty()) { + typeAttr_ = other.typeAttr_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getNumberAttr().isEmpty()) { + numberAttr_ = other.numberAttr_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getTypeListAttr().isEmpty()) { + typeListAttr_ = other.typeListAttr_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (handleDataBuilder_ == null) { + if (!other.handleData_.isEmpty()) { + if (handleData_.isEmpty()) { + handleData_ = other.handleData_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureHandleDataIsMutable(); + handleData_.addAll(other.handleData_); + } + onChanged(); + } + } else { + if (!other.handleData_.isEmpty()) { + if (handleDataBuilder_.isEmpty()) { + handleDataBuilder_.dispose(); + handleDataBuilder_ = null; + handleData_ = other.handleData_; + bitField0_ = (bitField0_ & ~0x00000040); + handleDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getHandleDataFieldBuilder() : null; + } else { + handleDataBuilder_.addAllMessages(other.handleData_); + } + } + } + if (other.getIsRef() != false) { + setIsRef(other.getIsRef()); + } + if (other.hasExperimentalFullType()) { + mergeExperimentalFullType(other.getExperimentalFullType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + type_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + typeAttr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + numberAttr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + typeListAttr_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape m = + input.readMessage( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.parser(), + extensionRegistry); + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + handleData_.add(m); + } else { + handleDataBuilder_.addMessage(m); + } + break; + } // case 58 + case 128: { + isRef_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 128 + case 138: { + input.readMessage( + getExperimentalFullTypeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 138 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Name for the input/output.  Should match the regexp "[a-z][a-z0-9_]*".
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
    +       * Human readable description.
    +       * 
    + * + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Human readable description.
    +       * 
    + * + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Human readable description.
    +       * 
    + * + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Human readable description.
    +       * 
    + * + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Human readable description.
    +       * 
    + * + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int type_ = 0; + /** + *
    +       * Describes the type of one or more tensors that are accepted/produced
    +       * by this input/output arg.  The only legal combinations are:
    +       * * For a single tensor: either the "type" field is set or the
    +       * "type_attr" field is set to the name of an attr with type "type".
    +       * * For a sequence of tensors with the same type: the "number_attr"
    +       * field will be set to the name of an attr with type "int", and
    +       * either the "type" or "type_attr" field will be set as for
    +       * single tensors.
    +       * * For a sequence of tensors, the "type_list_attr" field will be set
    +       * to the name of an attr with type "list(type)".
    +       * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
    +       * Describes the type of one or more tensors that are accepted/produced
    +       * by this input/output arg.  The only legal combinations are:
    +       * * For a single tensor: either the "type" field is set or the
    +       * "type_attr" field is set to the name of an attr with type "type".
    +       * * For a sequence of tensors with the same type: the "number_attr"
    +       * field will be set to the name of an attr with type "int", and
    +       * either the "type" or "type_attr" field will be set as for
    +       * single tensors.
    +       * * For a sequence of tensors, the "type_list_attr" field will be set
    +       * to the name of an attr with type "list(type)".
    +       * 
    + * + * .tensorflow.DataType type = 3; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Describes the type of one or more tensors that are accepted/produced
    +       * by this input/output arg.  The only legal combinations are:
    +       * * For a single tensor: either the "type" field is set or the
    +       * "type_attr" field is set to the name of an attr with type "type".
    +       * * For a sequence of tensors with the same type: the "number_attr"
    +       * field will be set to the name of an attr with type "int", and
    +       * either the "type" or "type_attr" field will be set as for
    +       * single tensors.
    +       * * For a sequence of tensors, the "type_list_attr" field will be set
    +       * to the name of an attr with type "list(type)".
    +       * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getType() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(type_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +       * Describes the type of one or more tensors that are accepted/produced
    +       * by this input/output arg.  The only legal combinations are:
    +       * * For a single tensor: either the "type" field is set or the
    +       * "type_attr" field is set to the name of an attr with type "type".
    +       * * For a sequence of tensors with the same type: the "number_attr"
    +       * field will be set to the name of an attr with type "int", and
    +       * either the "type" or "type_attr" field will be set as for
    +       * single tensors.
    +       * * For a sequence of tensors, the "type_list_attr" field will be set
    +       * to the name of an attr with type "list(type)".
    +       * 
    + * + * .tensorflow.DataType type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Describes the type of one or more tensors that are accepted/produced
    +       * by this input/output arg.  The only legal combinations are:
    +       * * For a single tensor: either the "type" field is set or the
    +       * "type_attr" field is set to the name of an attr with type "type".
    +       * * For a sequence of tensors with the same type: the "number_attr"
    +       * field will be set to the name of an attr with type "int", and
    +       * either the "type" or "type_attr" field will be set as for
    +       * single tensors.
    +       * * For a sequence of tensors, the "type_list_attr" field will be set
    +       * to the name of an attr with type "list(type)".
    +       * 
    + * + * .tensorflow.DataType type = 3; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object typeAttr_ = ""; + /** + *
    +       * if specified, attr must have type "type"
    +       * 
    + * + * string type_attr = 4; + * @return The typeAttr. + */ + public java.lang.String getTypeAttr() { + java.lang.Object ref = typeAttr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeAttr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * if specified, attr must have type "type"
    +       * 
    + * + * string type_attr = 4; + * @return The bytes for typeAttr. + */ + public com.google.protobuf.ByteString + getTypeAttrBytes() { + java.lang.Object ref = typeAttr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * if specified, attr must have type "type"
    +       * 
    + * + * string type_attr = 4; + * @param value The typeAttr to set. + * @return This builder for chaining. + */ + public Builder setTypeAttr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + typeAttr_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * if specified, attr must have type "type"
    +       * 
    + * + * string type_attr = 4; + * @return This builder for chaining. + */ + public Builder clearTypeAttr() { + typeAttr_ = getDefaultInstance().getTypeAttr(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * if specified, attr must have type "type"
    +       * 
    + * + * string type_attr = 4; + * @param value The bytes for typeAttr to set. + * @return This builder for chaining. + */ + public Builder setTypeAttrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + typeAttr_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object numberAttr_ = ""; + /** + *
    +       * if specified, attr must have type "int"
    +       * 
    + * + * string number_attr = 5; + * @return The numberAttr. + */ + public java.lang.String getNumberAttr() { + java.lang.Object ref = numberAttr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + numberAttr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * if specified, attr must have type "int"
    +       * 
    + * + * string number_attr = 5; + * @return The bytes for numberAttr. + */ + public com.google.protobuf.ByteString + getNumberAttrBytes() { + java.lang.Object ref = numberAttr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + numberAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * if specified, attr must have type "int"
    +       * 
    + * + * string number_attr = 5; + * @param value The numberAttr to set. + * @return This builder for chaining. + */ + public Builder setNumberAttr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + numberAttr_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * if specified, attr must have type "int"
    +       * 
    + * + * string number_attr = 5; + * @return This builder for chaining. + */ + public Builder clearNumberAttr() { + numberAttr_ = getDefaultInstance().getNumberAttr(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * if specified, attr must have type "int"
    +       * 
    + * + * string number_attr = 5; + * @param value The bytes for numberAttr to set. + * @return This builder for chaining. + */ + public Builder setNumberAttrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + numberAttr_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object typeListAttr_ = ""; + /** + *
    +       * If specified, attr must have type "list(type)", and none of
    +       * type, type_attr, and number_attr may be specified.
    +       * 
    + * + * string type_list_attr = 6; + * @return The typeListAttr. + */ + public java.lang.String getTypeListAttr() { + java.lang.Object ref = typeListAttr_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeListAttr_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * If specified, attr must have type "list(type)", and none of
    +       * type, type_attr, and number_attr may be specified.
    +       * 
    + * + * string type_list_attr = 6; + * @return The bytes for typeListAttr. + */ + public com.google.protobuf.ByteString + getTypeListAttrBytes() { + java.lang.Object ref = typeListAttr_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeListAttr_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * If specified, attr must have type "list(type)", and none of
    +       * type, type_attr, and number_attr may be specified.
    +       * 
    + * + * string type_list_attr = 6; + * @param value The typeListAttr to set. + * @return This builder for chaining. + */ + public Builder setTypeListAttr( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + typeListAttr_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * If specified, attr must have type "list(type)", and none of
    +       * type, type_attr, and number_attr may be specified.
    +       * 
    + * + * string type_list_attr = 6; + * @return This builder for chaining. + */ + public Builder clearTypeListAttr() { + typeListAttr_ = getDefaultInstance().getTypeListAttr(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +       * If specified, attr must have type "list(type)", and none of
    +       * type, type_attr, and number_attr may be specified.
    +       * 
    + * + * string type_list_attr = 6; + * @param value The bytes for typeListAttr to set. + * @return This builder for chaining. + */ + public Builder setTypeListAttrBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + typeListAttr_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.util.List handleData_ = + java.util.Collections.emptyList(); + private void ensureHandleDataIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + handleData_ = new java.util.ArrayList(handleData_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder> handleDataBuilder_; + + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public java.util.List getHandleDataList() { + if (handleDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(handleData_); + } else { + return handleDataBuilder_.getMessageList(); + } + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public int getHandleDataCount() { + if (handleDataBuilder_ == null) { + return handleData_.size(); + } else { + return handleDataBuilder_.getCount(); + } + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getHandleData(int index) { + if (handleDataBuilder_ == null) { + return handleData_.get(index); + } else { + return handleDataBuilder_.getMessage(index); + } + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder setHandleData( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (handleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHandleDataIsMutable(); + handleData_.set(index, value); + onChanged(); + } else { + handleDataBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder setHandleData( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + handleData_.set(index, builderForValue.build()); + onChanged(); + } else { + handleDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder addHandleData(org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (handleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHandleDataIsMutable(); + handleData_.add(value); + onChanged(); + } else { + handleDataBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder addHandleData( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (handleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHandleDataIsMutable(); + handleData_.add(index, value); + onChanged(); + } else { + handleDataBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder addHandleData( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + handleData_.add(builderForValue.build()); + onChanged(); + } else { + handleDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder addHandleData( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + handleData_.add(index, builderForValue.build()); + onChanged(); + } else { + handleDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder addAllHandleData( + java.lang.Iterable values) { + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, handleData_); + onChanged(); + } else { + handleDataBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder clearHandleData() { + if (handleDataBuilder_ == null) { + handleData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + handleDataBuilder_.clear(); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public Builder removeHandleData(int index) { + if (handleDataBuilder_ == null) { + ensureHandleDataIsMutable(); + handleData_.remove(index); + onChanged(); + } else { + handleDataBuilder_.remove(index); + } + return this; + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder getHandleDataBuilder( + int index) { + return getHandleDataFieldBuilder().getBuilder(index); + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getHandleDataOrBuilder( + int index) { + if (handleDataBuilder_ == null) { + return handleData_.get(index); } else { + return handleDataBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public java.util.List + getHandleDataOrBuilderList() { + if (handleDataBuilder_ != null) { + return handleDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(handleData_); + } + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder addHandleDataBuilder() { + return getHandleDataFieldBuilder().addBuilder( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder addHandleDataBuilder( + int index) { + return getHandleDataFieldBuilder().addBuilder( + index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); + } + /** + *
    +       * The handle data for resource inputs.
    +       * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape handle_data = 7; + */ + public java.util.List + getHandleDataBuilderList() { + return getHandleDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder> + getHandleDataFieldBuilder() { + if (handleDataBuilder_ == null) { + handleDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder>( + handleData_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + handleData_ = null; + } + return handleDataBuilder_; + } + + private boolean isRef_ ; + /** + *
    +       * For inputs: if true, the inputs are required to be refs.
    +       * By default, inputs can be either refs or non-refs.
    +       * For outputs: if true, outputs are refs, otherwise they are not.
    +       * 
    + * + * bool is_ref = 16; + * @return The isRef. + */ + @java.lang.Override + public boolean getIsRef() { + return isRef_; + } + /** + *
    +       * For inputs: if true, the inputs are required to be refs.
    +       * By default, inputs can be either refs or non-refs.
    +       * For outputs: if true, outputs are refs, otherwise they are not.
    +       * 
    + * + * bool is_ref = 16; + * @param value The isRef to set. + * @return This builder for chaining. + */ + public Builder setIsRef(boolean value) { + + isRef_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * For inputs: if true, the inputs are required to be refs.
    +       * By default, inputs can be either refs or non-refs.
    +       * For outputs: if true, outputs are refs, otherwise they are not.
    +       * 
    + * + * bool is_ref = 16; + * @return This builder for chaining. + */ + public Builder clearIsRef() { + bitField0_ = (bitField0_ & ~0x00000080); + isRef_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.FullTypeDef experimentalFullType_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> experimentalFullTypeBuilder_; + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return Whether the experimentalFullType field is set. + */ + public boolean hasExperimentalFullType() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + * @return The experimentalFullType. + */ + public org.tensorflow.proto.FullTypeDef getExperimentalFullType() { + if (experimentalFullTypeBuilder_ == null) { + return experimentalFullType_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalFullType_; + } else { + return experimentalFullTypeBuilder_.getMessage(); + } + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public Builder setExperimentalFullType(org.tensorflow.proto.FullTypeDef value) { + if (experimentalFullTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimentalFullType_ = value; + } else { + experimentalFullTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public Builder setExperimentalFullType( + org.tensorflow.proto.FullTypeDef.Builder builderForValue) { + if (experimentalFullTypeBuilder_ == null) { + experimentalFullType_ = builderForValue.build(); + } else { + experimentalFullTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public Builder mergeExperimentalFullType(org.tensorflow.proto.FullTypeDef value) { + if (experimentalFullTypeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + experimentalFullType_ != null && + experimentalFullType_ != org.tensorflow.proto.FullTypeDef.getDefaultInstance()) { + getExperimentalFullTypeBuilder().mergeFrom(value); + } else { + experimentalFullType_ = value; + } + } else { + experimentalFullTypeBuilder_.mergeFrom(value); + } + if (experimentalFullType_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public Builder clearExperimentalFullType() { + bitField0_ = (bitField0_ & ~0x00000100); + experimentalFullType_ = null; + if (experimentalFullTypeBuilder_ != null) { + experimentalFullTypeBuilder_.dispose(); + experimentalFullTypeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public org.tensorflow.proto.FullTypeDef.Builder getExperimentalFullTypeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getExperimentalFullTypeFieldBuilder().getBuilder(); + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + public org.tensorflow.proto.FullTypeDefOrBuilder getExperimentalFullTypeOrBuilder() { + if (experimentalFullTypeBuilder_ != null) { + return experimentalFullTypeBuilder_.getMessageOrBuilder(); + } else { + return experimentalFullType_ == null ? + org.tensorflow.proto.FullTypeDef.getDefaultInstance() : experimentalFullType_; + } + } + /** + *
    +       * Experimental. Full type declaration for this argument.
    +       * The full type specification combines type, type_attr, type_list_attr,
    +       * etc. into a unified representation.
    +       * This declaration may contain non-concrete types (for example,
    +       * Tensor<TypeVar<'T'>> is a valid type declaration.
    +       *
    +       * Note: this is a transient field. The long-term aim is to represent the
    +       * entire OpDef as a single type: a callable. In that context, this field is
    +       * just the type of a single argument.
    +       * 
    + * + * .tensorflow.FullTypeDef experimental_full_type = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> + getExperimentalFullTypeFieldBuilder() { + if (experimentalFullTypeBuilder_ == null) { + experimentalFullTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder>( + getExperimentalFullType(), + getParentForChildren(), + isClean()); + experimentalFullType_ = null; + } + return experimentalFullTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpDef.ArgDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef.ArgDef) + private static final org.tensorflow.proto.OpDef.ArgDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpDef.ArgDef(); + } + + public static org.tensorflow.proto.OpDef.ArgDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ArgDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpDef.ArgDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AttrDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpDef.AttrDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * A descriptive name for the argument.  May be used, e.g. by the
    +     * Python client, as a keyword argument name, and so should match
    +     * the regexp "[a-z][a-z0-9_]+".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * A descriptive name for the argument.  May be used, e.g. by the
    +     * Python client, as a keyword argument name, and so should match
    +     * the regexp "[a-z][a-z0-9_]+".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * One of the type names from attr_value.proto ("string", "list(string)",
    +     * "int", etc.).
    +     * 
    + * + * string type = 2; + * @return The type. + */ + java.lang.String getType(); + /** + *
    +     * One of the type names from attr_value.proto ("string", "list(string)",
    +     * "int", etc.).
    +     * 
    + * + * string type = 2; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + boolean hasDefaultValue(); + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + org.tensorflow.proto.AttrValue getDefaultValue(); + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder(); + + /** + *
    +     * Human-readable description.
    +     * 
    + * + * string description = 4; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +     * Human-readable description.
    +     * 
    + * + * string description = 4; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
    +     * For type == "int", this is a minimum value.  For "list(___)"
    +     * types, this is the minimum length.
    +     * 
    + * + * bool has_minimum = 5; + * @return The hasMinimum. + */ + boolean getHasMinimum(); + + /** + * int64 minimum = 6; + * @return The minimum. + */ + long getMinimum(); + + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return Whether the allowedValues field is set. + */ + boolean hasAllowedValues(); + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return The allowedValues. + */ + org.tensorflow.proto.AttrValue getAllowedValues(); + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder(); + } + /** + *
    +   * Description of the graph-construction-time configuration of this
    +   * Op.  That is to say, this describes the attr fields that will
    +   * be specified in the NodeDef.
    +   * 
    + * + * Protobuf type {@code tensorflow.OpDef.AttrDef} + */ + public static final class AttrDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpDef.AttrDef) + AttrDefOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AttrDef.class.getName()); + } + // Use AttrDef.newBuilder() to construct. + private AttrDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AttrDef() { + name_ = ""; + type_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.AttrDef.class, org.tensorflow.proto.OpDef.AttrDef.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * A descriptive name for the argument.  May be used, e.g. by the
    +     * Python client, as a keyword argument name, and so should match
    +     * the regexp "[a-z][a-z0-9_]+".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * A descriptive name for the argument.  May be used, e.g. by the
    +     * Python client, as a keyword argument name, and so should match
    +     * the regexp "[a-z][a-z0-9_]+".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + *
    +     * One of the type names from attr_value.proto ("string", "list(string)",
    +     * "int", etc.).
    +     * 
    + * + * string type = 2; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + *
    +     * One of the type names from attr_value.proto ("string", "list(string)",
    +     * "int", etc.).
    +     * 
    + * + * string type = 2; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULT_VALUE_FIELD_NUMBER = 3; + private org.tensorflow.proto.AttrValue defaultValue_; + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + @java.lang.Override + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getDefaultValue() { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + /** + *
    +     * A reasonable default for this attribute if the user does not supply
    +     * a value.  If not specified, the user must supply a value.
    +     * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder() { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +     * Human-readable description.
    +     * 
    + * + * string description = 4; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +     * Human-readable description.
    +     * 
    + * + * string description = 4; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HAS_MINIMUM_FIELD_NUMBER = 5; + private boolean hasMinimum_ = false; + /** + *
    +     * For type == "int", this is a minimum value.  For "list(___)"
    +     * types, this is the minimum length.
    +     * 
    + * + * bool has_minimum = 5; + * @return The hasMinimum. + */ + @java.lang.Override + public boolean getHasMinimum() { + return hasMinimum_; + } + + public static final int MINIMUM_FIELD_NUMBER = 6; + private long minimum_ = 0L; + /** + * int64 minimum = 6; + * @return The minimum. + */ + @java.lang.Override + public long getMinimum() { + return minimum_; + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 7; + private org.tensorflow.proto.AttrValue allowedValues_; + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return Whether the allowedValues field is set. + */ + @java.lang.Override + public boolean hasAllowedValues() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return The allowedValues. + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAllowedValues() { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + /** + *
    +     * The set of allowed values.  Has type that is the "list" version
    +     * of the "type" field above (uses the "list" field of AttrValue).
    +     * If type == "type" or "list(type)" above, then the "type" field
    +     * of "allowed_values.list" has the set of allowed DataTypes.
    +     * If type == "string" or "list(string)", then the "s" field of
    +     * "allowed_values.list" has the set of allowed strings.
    +     * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder() { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, description_); + } + if (hasMinimum_ != false) { + output.writeBool(5, hasMinimum_); + } + if (minimum_ != 0L) { + output.writeInt64(6, minimum_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getAllowedValues()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDefaultValue()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, description_); + } + if (hasMinimum_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, hasMinimum_); + } + if (minimum_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, minimum_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getAllowedValues()); + } + size += getUnknownFields().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.OpDef.AttrDef)) { + return super.equals(obj); + } + org.tensorflow.proto.OpDef.AttrDef other = (org.tensorflow.proto.OpDef.AttrDef) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (hasDefaultValue() != other.hasDefaultValue()) return false; + if (hasDefaultValue()) { + if (!getDefaultValue() + .equals(other.getDefaultValue())) return false; + } + if (!getDescription() + .equals(other.getDescription())) return false; + if (getHasMinimum() + != other.getHasMinimum()) return false; + if (getMinimum() + != other.getMinimum()) return false; + if (hasAllowedValues() != other.hasAllowedValues()) return false; + if (hasAllowedValues()) { + if (!getAllowedValues() + .equals(other.getAllowedValues())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (hasDefaultValue()) { + hash = (37 * hash) + DEFAULT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultValue().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + HAS_MINIMUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHasMinimum()); + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinimum()); + if (hasAllowedValues()) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValues().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpDef.AttrDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.AttrDef 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.OpDef.AttrDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.AttrDef 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.OpDef.AttrDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef.AttrDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpDef.AttrDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef.AttrDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpDef.AttrDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpDef.AttrDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpDef.AttrDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef.AttrDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpDef.AttrDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Description of the graph-construction-time configuration of this
    +     * Op.  That is to say, this describes the attr fields that will
    +     * be specified in the NodeDef.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpDef.AttrDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpDef.AttrDef) + org.tensorflow.proto.OpDef.AttrDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.AttrDef.class, org.tensorflow.proto.OpDef.AttrDef.Builder.class); + } + + // Construct using org.tensorflow.proto.OpDef.AttrDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getDefaultValueFieldBuilder(); + getAllowedValuesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + description_ = ""; + hasMinimum_ = false; + minimum_ = 0L; + allowedValues_ = null; + if (allowedValuesBuilder_ != null) { + allowedValuesBuilder_.dispose(); + allowedValuesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_AttrDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.AttrDef getDefaultInstanceForType() { + return org.tensorflow.proto.OpDef.AttrDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.AttrDef build() { + org.tensorflow.proto.OpDef.AttrDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef.AttrDef buildPartial() { + org.tensorflow.proto.OpDef.AttrDef result = new org.tensorflow.proto.OpDef.AttrDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpDef.AttrDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.defaultValue_ = defaultValueBuilder_ == null + ? defaultValue_ + : defaultValueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.hasMinimum_ = hasMinimum_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.minimum_ = minimum_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.allowedValues_ = allowedValuesBuilder_ == null + ? allowedValues_ + : allowedValuesBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpDef.AttrDef) { + return mergeFrom((org.tensorflow.proto.OpDef.AttrDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpDef.AttrDef other) { + if (other == org.tensorflow.proto.OpDef.AttrDef.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDefaultValue()) { + mergeDefaultValue(other.getDefaultValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getHasMinimum() != false) { + setHasMinimum(other.getHasMinimum()); + } + if (other.getMinimum() != 0L) { + setMinimum(other.getMinimum()); + } + if (other.hasAllowedValues()) { + mergeAllowedValues(other.getAllowedValues()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getDefaultValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + hasMinimum_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + minimum_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: { + input.readMessage( + getAllowedValuesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * A descriptive name for the argument.  May be used, e.g. by the
    +       * Python client, as a keyword argument name, and so should match
    +       * the regexp "[a-z][a-z0-9_]+".
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * A descriptive name for the argument.  May be used, e.g. by the
    +       * Python client, as a keyword argument name, and so should match
    +       * the regexp "[a-z][a-z0-9_]+".
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * A descriptive name for the argument.  May be used, e.g. by the
    +       * Python client, as a keyword argument name, and so should match
    +       * the regexp "[a-z][a-z0-9_]+".
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * A descriptive name for the argument.  May be used, e.g. by the
    +       * Python client, as a keyword argument name, and so should match
    +       * the regexp "[a-z][a-z0-9_]+".
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * A descriptive name for the argument.  May be used, e.g. by the
    +       * Python client, as a keyword argument name, and so should match
    +       * the regexp "[a-z][a-z0-9_]+".
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + *
    +       * One of the type names from attr_value.proto ("string", "list(string)",
    +       * "int", etc.).
    +       * 
    + * + * string type = 2; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * One of the type names from attr_value.proto ("string", "list(string)",
    +       * "int", etc.).
    +       * 
    + * + * string type = 2; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * One of the type names from attr_value.proto ("string", "list(string)",
    +       * "int", etc.).
    +       * 
    + * + * string type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * One of the type names from attr_value.proto ("string", "list(string)",
    +       * "int", etc.).
    +       * 
    + * + * string type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * One of the type names from attr_value.proto ("string", "list(string)",
    +       * "int", etc.).
    +       * 
    + * + * string type = 2; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private org.tensorflow.proto.AttrValue defaultValue_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> defaultValueBuilder_; + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return Whether the defaultValue field is set. + */ + public boolean hasDefaultValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + * @return The defaultValue. + */ + public org.tensorflow.proto.AttrValue getDefaultValue() { + if (defaultValueBuilder_ == null) { + return defaultValue_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } else { + return defaultValueBuilder_.getMessage(); + } + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder setDefaultValue(org.tensorflow.proto.AttrValue value) { + if (defaultValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultValue_ = value; + } else { + defaultValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder setDefaultValue( + org.tensorflow.proto.AttrValue.Builder builderForValue) { + if (defaultValueBuilder_ == null) { + defaultValue_ = builderForValue.build(); + } else { + defaultValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder mergeDefaultValue(org.tensorflow.proto.AttrValue value) { + if (defaultValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + defaultValue_ != null && + defaultValue_ != org.tensorflow.proto.AttrValue.getDefaultInstance()) { + getDefaultValueBuilder().mergeFrom(value); + } else { + defaultValue_ = value; + } + } else { + defaultValueBuilder_.mergeFrom(value); + } + if (defaultValue_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public Builder clearDefaultValue() { + bitField0_ = (bitField0_ & ~0x00000004); + defaultValue_ = null; + if (defaultValueBuilder_ != null) { + defaultValueBuilder_.dispose(); + defaultValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public org.tensorflow.proto.AttrValue.Builder getDefaultValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDefaultValueFieldBuilder().getBuilder(); + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + public org.tensorflow.proto.AttrValueOrBuilder getDefaultValueOrBuilder() { + if (defaultValueBuilder_ != null) { + return defaultValueBuilder_.getMessageOrBuilder(); + } else { + return defaultValue_ == null ? + org.tensorflow.proto.AttrValue.getDefaultInstance() : defaultValue_; + } + } + /** + *
    +       * A reasonable default for this attribute if the user does not supply
    +       * a value.  If not specified, the user must supply a value.
    +       * 
    + * + * .tensorflow.AttrValue default_value = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> + getDefaultValueFieldBuilder() { + if (defaultValueBuilder_ == null) { + defaultValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder>( + getDefaultValue(), + getParentForChildren(), + isClean()); + defaultValue_ = null; + } + return defaultValueBuilder_; + } + + private java.lang.Object description_ = ""; + /** + *
    +       * Human-readable description.
    +       * 
    + * + * string description = 4; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Human-readable description.
    +       * 
    + * + * string description = 4; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Human-readable description.
    +       * 
    + * + * string description = 4; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Human-readable description.
    +       * 
    + * + * string description = 4; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * Human-readable description.
    +       * 
    + * + * string description = 4; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean hasMinimum_ ; + /** + *
    +       * For type == "int", this is a minimum value.  For "list(___)"
    +       * types, this is the minimum length.
    +       * 
    + * + * bool has_minimum = 5; + * @return The hasMinimum. + */ + @java.lang.Override + public boolean getHasMinimum() { + return hasMinimum_; + } + /** + *
    +       * For type == "int", this is a minimum value.  For "list(___)"
    +       * types, this is the minimum length.
    +       * 
    + * + * bool has_minimum = 5; + * @param value The hasMinimum to set. + * @return This builder for chaining. + */ + public Builder setHasMinimum(boolean value) { + + hasMinimum_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * For type == "int", this is a minimum value.  For "list(___)"
    +       * types, this is the minimum length.
    +       * 
    + * + * bool has_minimum = 5; + * @return This builder for chaining. + */ + public Builder clearHasMinimum() { + bitField0_ = (bitField0_ & ~0x00000010); + hasMinimum_ = false; + onChanged(); + return this; + } + + private long minimum_ ; + /** + * int64 minimum = 6; + * @return The minimum. + */ + @java.lang.Override + public long getMinimum() { + return minimum_; + } + /** + * int64 minimum = 6; + * @param value The minimum to set. + * @return This builder for chaining. + */ + public Builder setMinimum(long value) { + + minimum_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int64 minimum = 6; + * @return This builder for chaining. + */ + public Builder clearMinimum() { + bitField0_ = (bitField0_ & ~0x00000020); + minimum_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.AttrValue allowedValues_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> allowedValuesBuilder_; + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return Whether the allowedValues field is set. + */ + public boolean hasAllowedValues() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + * @return The allowedValues. + */ + public org.tensorflow.proto.AttrValue getAllowedValues() { + if (allowedValuesBuilder_ == null) { + return allowedValues_ == null ? org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } else { + return allowedValuesBuilder_.getMessage(); + } + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public Builder setAllowedValues(org.tensorflow.proto.AttrValue value) { + if (allowedValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allowedValues_ = value; + } else { + allowedValuesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public Builder setAllowedValues( + org.tensorflow.proto.AttrValue.Builder builderForValue) { + if (allowedValuesBuilder_ == null) { + allowedValues_ = builderForValue.build(); + } else { + allowedValuesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public Builder mergeAllowedValues(org.tensorflow.proto.AttrValue value) { + if (allowedValuesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + allowedValues_ != null && + allowedValues_ != org.tensorflow.proto.AttrValue.getDefaultInstance()) { + getAllowedValuesBuilder().mergeFrom(value); + } else { + allowedValues_ = value; + } + } else { + allowedValuesBuilder_.mergeFrom(value); + } + if (allowedValues_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public Builder clearAllowedValues() { + bitField0_ = (bitField0_ & ~0x00000040); + allowedValues_ = null; + if (allowedValuesBuilder_ != null) { + allowedValuesBuilder_.dispose(); + allowedValuesBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public org.tensorflow.proto.AttrValue.Builder getAllowedValuesBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getAllowedValuesFieldBuilder().getBuilder(); + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + public org.tensorflow.proto.AttrValueOrBuilder getAllowedValuesOrBuilder() { + if (allowedValuesBuilder_ != null) { + return allowedValuesBuilder_.getMessageOrBuilder(); + } else { + return allowedValues_ == null ? + org.tensorflow.proto.AttrValue.getDefaultInstance() : allowedValues_; + } + } + /** + *
    +       * The set of allowed values.  Has type that is the "list" version
    +       * of the "type" field above (uses the "list" field of AttrValue).
    +       * If type == "type" or "list(type)" above, then the "type" field
    +       * of "allowed_values.list" has the set of allowed DataTypes.
    +       * If type == "string" or "list(string)", then the "s" field of
    +       * "allowed_values.list" has the set of allowed strings.
    +       * 
    + * + * .tensorflow.AttrValue allowed_values = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder> + getAllowedValuesFieldBuilder() { + if (allowedValuesBuilder_ == null) { + allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder, org.tensorflow.proto.AttrValueOrBuilder>( + getAllowedValues(), + getParentForChildren(), + isClean()); + allowedValues_ = null; + } + return allowedValuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpDef.AttrDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef.AttrDef) + private static final org.tensorflow.proto.OpDef.AttrDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpDef.AttrDef(); + } + + public static org.tensorflow.proto.OpDef.AttrDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttrDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpDef.AttrDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Op names starting with an underscore are reserved for internal use.
    +   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Op names starting with an underscore are reserved for internal use.
    +   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 INPUT_ARG_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List inputArg_; + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + @java.lang.Override + public java.util.List getInputArgList() { + return inputArg_; + } + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + @java.lang.Override + public java.util.List + getInputArgOrBuilderList() { + return inputArg_; + } + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + @java.lang.Override + public int getInputArgCount() { + return inputArg_.size(); + } + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDef getInputArg(int index) { + return inputArg_.get(index); + } + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDefOrBuilder getInputArgOrBuilder( + int index) { + return inputArg_.get(index); + } + + public static final int OUTPUT_ARG_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List outputArg_; + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + @java.lang.Override + public java.util.List getOutputArgList() { + return outputArg_; + } + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + @java.lang.Override + public java.util.List + getOutputArgOrBuilderList() { + return outputArg_; + } + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + @java.lang.Override + public int getOutputArgCount() { + return outputArg_.size(); + } + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDef getOutputArg(int index) { + return outputArg_.get(index); + } + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( + int index) { + return outputArg_.get(index); + } + + public static final int CONTROL_OUTPUT_FIELD_NUMBER = 20; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList controlOutput_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @return A list containing the controlOutput. + */ + public com.google.protobuf.ProtocolStringList + getControlOutputList() { + return controlOutput_; + } + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @return The count of controlOutput. + */ + public int getControlOutputCount() { + return controlOutput_.size(); + } + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @param index The index of the element to return. + * @return The controlOutput at the given index. + */ + public java.lang.String getControlOutput(int index) { + return controlOutput_.get(index); + } + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @param index The index of the value to return. + * @return The bytes of the controlOutput at the given index. + */ + public com.google.protobuf.ByteString + getControlOutputBytes(int index) { + return controlOutput_.getByteString(index); + } + + public static final int ATTR_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List attr_; + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + @java.lang.Override + public java.util.List getAttrList() { + return attr_; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + @java.lang.Override + public java.util.List + getAttrOrBuilderList() { + return attr_; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + @java.lang.Override + public int getAttrCount() { + return attr_.size(); + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.AttrDef getAttr(int index) { + return attr_.get(index); + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef.AttrDefOrBuilder getAttrOrBuilder( + int index) { + return attr_.get(index); + } + + public static final int DEPRECATION_FIELD_NUMBER = 8; + private org.tensorflow.proto.OpDeprecation deprecation_; + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return Whether the deprecation field is set. + */ + @java.lang.Override + public boolean hasDeprecation() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return The deprecation. + */ + @java.lang.Override + public org.tensorflow.proto.OpDeprecation getDeprecation() { + return deprecation_ == null ? org.tensorflow.proto.OpDeprecation.getDefaultInstance() : deprecation_; + } + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + @java.lang.Override + public org.tensorflow.proto.OpDeprecationOrBuilder getDeprecationOrBuilder() { + return deprecation_ == null ? org.tensorflow.proto.OpDeprecation.getDefaultInstance() : deprecation_; + } + + public static final int SUMMARY_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object summary_ = ""; + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 5; + * @return The summary. + */ + @java.lang.Override + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + 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(); + summary_ = s; + return s; + } + } + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 5; + * @return The bytes for summary. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 6; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 6; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_COMMUTATIVE_FIELD_NUMBER = 18; + private boolean isCommutative_ = false; + /** + *
    +   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    +   * 
    + * + * bool is_commutative = 18; + * @return The isCommutative. + */ + @java.lang.Override + public boolean getIsCommutative() { + return isCommutative_; + } + + public static final int IS_AGGREGATE_FIELD_NUMBER = 16; + private boolean isAggregate_ = false; + /** + *
    +   * If is_aggregate is true, then this operation accepts N >= 2
    +   * inputs and produces 1 output all of the same type.  Should be
    +   * associative and commutative, and produce output with the same
    +   * shape as the input.  The optimizer may replace an aggregate op
    +   * taking input from multiple devices with a tree of aggregate ops
    +   * that aggregate locally within each device (and possibly within
    +   * groups of nearby devices) before communicating.
    +   * TODO(josh11b): Implement that optimization.
    +   * 
    + * + * bool is_aggregate = 16; + * @return The isAggregate. + */ + @java.lang.Override + public boolean getIsAggregate() { + return isAggregate_; + } + + public static final int IS_STATEFUL_FIELD_NUMBER = 17; + private boolean isStateful_ = false; + /** + *
    +   * Ops are marked as stateful if their behavior depends on some state beyond
    +   * their input tensors (e.g. variable reading op) or if they have
    +   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    +   * must always produce the same output for the same input and have
    +   * no side-effects.
    +   *
    +   * By default Ops may be moved between devices.  Stateful ops should
    +   * either not be moved, or should only be moved if that state can also
    +   * be moved (e.g. via some sort of save / restore).
    +   * Stateful ops are guaranteed to never be optimized away by Common
    +   * Subexpression Elimination (CSE).
    +   * 
    + * + * bool is_stateful = 17; + * @return The isStateful. + */ + @java.lang.Override + public boolean getIsStateful() { + return isStateful_; + } + + public static final int ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER = 19; + private boolean allowsUninitializedInput_ = false; + /** + *
    +   * By default, all inputs to an Op must be initialized Tensors.  Ops
    +   * that may initialize tensors for the first time should set this
    +   * field to true, to allow the Op to take an uninitialized Tensor as
    +   * input.
    +   * 
    + * + * bool allows_uninitialized_input = 19; + * @return The allowsUninitializedInput. + */ + @java.lang.Override + public boolean getAllowsUninitializedInput() { + return allowsUninitializedInput_; + } + + public static final int IS_DISTRIBUTED_COMMUNICATION_FIELD_NUMBER = 21; + private boolean isDistributedCommunication_ = false; + /** + *
    +   * Indicates whether the op implementation uses distributed communication.
    +   * If True, the op is allowed to return errors for network disconnection and
    +   * trigger TF network failure handling logics.
    +   * 
    + * + * bool is_distributed_communication = 21; + * @return The isDistributedCommunication. + */ + @java.lang.Override + public boolean getIsDistributedCommunication() { + return isDistributedCommunication_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < inputArg_.size(); i++) { + output.writeMessage(2, inputArg_.get(i)); + } + for (int i = 0; i < outputArg_.size(); i++) { + output.writeMessage(3, outputArg_.get(i)); + } + for (int i = 0; i < attr_.size(); i++) { + output.writeMessage(4, attr_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, summary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getDeprecation()); + } + if (isAggregate_ != false) { + output.writeBool(16, isAggregate_); + } + if (isStateful_ != false) { + output.writeBool(17, isStateful_); + } + if (isCommutative_ != false) { + output.writeBool(18, isCommutative_); + } + if (allowsUninitializedInput_ != false) { + output.writeBool(19, allowsUninitializedInput_); + } + for (int i = 0; i < controlOutput_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 20, controlOutput_.getRaw(i)); + } + if (isDistributedCommunication_ != false) { + output.writeBool(21, isDistributedCommunication_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < inputArg_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, inputArg_.get(i)); + } + for (int i = 0; i < outputArg_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, outputArg_.get(i)); + } + for (int i = 0; i < attr_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attr_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, summary_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getDeprecation()); + } + if (isAggregate_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, isAggregate_); + } + if (isStateful_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(17, isStateful_); + } + if (isCommutative_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(18, isCommutative_); + } + if (allowsUninitializedInput_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(19, allowsUninitializedInput_); + } + { + int dataSize = 0; + for (int i = 0; i < controlOutput_.size(); i++) { + dataSize += computeStringSizeNoTag(controlOutput_.getRaw(i)); + } + size += dataSize; + size += 2 * getControlOutputList().size(); + } + if (isDistributedCommunication_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, isDistributedCommunication_); + } + size += getUnknownFields().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.OpDef)) { + return super.equals(obj); + } + org.tensorflow.proto.OpDef other = (org.tensorflow.proto.OpDef) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getInputArgList() + .equals(other.getInputArgList())) return false; + if (!getOutputArgList() + .equals(other.getOutputArgList())) return false; + if (!getControlOutputList() + .equals(other.getControlOutputList())) return false; + if (!getAttrList() + .equals(other.getAttrList())) return false; + if (hasDeprecation() != other.hasDeprecation()) return false; + if (hasDeprecation()) { + if (!getDeprecation() + .equals(other.getDeprecation())) return false; + } + if (!getSummary() + .equals(other.getSummary())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (getIsCommutative() + != other.getIsCommutative()) return false; + if (getIsAggregate() + != other.getIsAggregate()) return false; + if (getIsStateful() + != other.getIsStateful()) return false; + if (getAllowsUninitializedInput() + != other.getAllowsUninitializedInput()) return false; + if (getIsDistributedCommunication() + != other.getIsDistributedCommunication()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getInputArgCount() > 0) { + hash = (37 * hash) + INPUT_ARG_FIELD_NUMBER; + hash = (53 * hash) + getInputArgList().hashCode(); + } + if (getOutputArgCount() > 0) { + hash = (37 * hash) + OUTPUT_ARG_FIELD_NUMBER; + hash = (53 * hash) + getOutputArgList().hashCode(); + } + if (getControlOutputCount() > 0) { + hash = (37 * hash) + CONTROL_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getControlOutputList().hashCode(); + } + if (getAttrCount() > 0) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + getAttrList().hashCode(); + } + if (hasDeprecation()) { + hash = (37 * hash) + DEPRECATION_FIELD_NUMBER; + hash = (53 * hash) + getDeprecation().hashCode(); + } + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + IS_COMMUTATIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsCommutative()); + hash = (37 * hash) + IS_AGGREGATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsAggregate()); + hash = (37 * hash) + IS_STATEFUL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsStateful()); + hash = (37 * hash) + ALLOWS_UNINITIALIZED_INPUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllowsUninitializedInput()); + hash = (37 * hash) + IS_DISTRIBUTED_COMMUNICATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsDistributedCommunication()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef 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.OpDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef 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.OpDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines an operation. A NodeDef in a GraphDef specifies an Op by
    +   * using the "op" field which should match the name of a OpDef.
    +   * LINT.IfChange
    +   * 
    + * + * Protobuf type {@code tensorflow.OpDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpDef) + org.tensorflow.proto.OpDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDef.class, org.tensorflow.proto.OpDef.Builder.class); + } + + // Construct using org.tensorflow.proto.OpDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getInputArgFieldBuilder(); + getOutputArgFieldBuilder(); + getAttrFieldBuilder(); + getDeprecationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (inputArgBuilder_ == null) { + inputArg_ = java.util.Collections.emptyList(); + } else { + inputArg_ = null; + inputArgBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (outputArgBuilder_ == null) { + outputArg_ = java.util.Collections.emptyList(); + } else { + outputArg_ = null; + outputArgBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + controlOutput_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + if (attrBuilder_ == null) { + attr_ = java.util.Collections.emptyList(); + } else { + attr_ = null; + attrBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + deprecation_ = null; + if (deprecationBuilder_ != null) { + deprecationBuilder_.dispose(); + deprecationBuilder_ = null; + } + summary_ = ""; + description_ = ""; + isCommutative_ = false; + isAggregate_ = false; + isStateful_ = false; + allowsUninitializedInput_ = false; + isDistributedCommunication_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef getDefaultInstanceForType() { + return org.tensorflow.proto.OpDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpDef build() { + org.tensorflow.proto.OpDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpDef buildPartial() { + org.tensorflow.proto.OpDef result = new org.tensorflow.proto.OpDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OpDef result) { + if (inputArgBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + inputArg_ = java.util.Collections.unmodifiableList(inputArg_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.inputArg_ = inputArg_; + } else { + result.inputArg_ = inputArgBuilder_.build(); + } + if (outputArgBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + outputArg_ = java.util.Collections.unmodifiableList(outputArg_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.outputArg_ = outputArg_; + } else { + result.outputArg_ = outputArgBuilder_.build(); + } + if (attrBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + attr_ = java.util.Collections.unmodifiableList(attr_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.attr_ = attr_; + } else { + result.attr_ = attrBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.OpDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + controlOutput_.makeImmutable(); + result.controlOutput_ = controlOutput_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deprecation_ = deprecationBuilder_ == null + ? deprecation_ + : deprecationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.summary_ = summary_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.isCommutative_ = isCommutative_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.isAggregate_ = isAggregate_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.isStateful_ = isStateful_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.allowsUninitializedInput_ = allowsUninitializedInput_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.isDistributedCommunication_ = isDistributedCommunication_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpDef) { + return mergeFrom((org.tensorflow.proto.OpDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpDef other) { + if (other == org.tensorflow.proto.OpDef.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (inputArgBuilder_ == null) { + if (!other.inputArg_.isEmpty()) { + if (inputArg_.isEmpty()) { + inputArg_ = other.inputArg_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInputArgIsMutable(); + inputArg_.addAll(other.inputArg_); + } + onChanged(); + } + } else { + if (!other.inputArg_.isEmpty()) { + if (inputArgBuilder_.isEmpty()) { + inputArgBuilder_.dispose(); + inputArgBuilder_ = null; + inputArg_ = other.inputArg_; + bitField0_ = (bitField0_ & ~0x00000002); + inputArgBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getInputArgFieldBuilder() : null; + } else { + inputArgBuilder_.addAllMessages(other.inputArg_); + } + } + } + if (outputArgBuilder_ == null) { + if (!other.outputArg_.isEmpty()) { + if (outputArg_.isEmpty()) { + outputArg_ = other.outputArg_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureOutputArgIsMutable(); + outputArg_.addAll(other.outputArg_); + } + onChanged(); + } + } else { + if (!other.outputArg_.isEmpty()) { + if (outputArgBuilder_.isEmpty()) { + outputArgBuilder_.dispose(); + outputArgBuilder_ = null; + outputArg_ = other.outputArg_; + bitField0_ = (bitField0_ & ~0x00000004); + outputArgBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutputArgFieldBuilder() : null; + } else { + outputArgBuilder_.addAllMessages(other.outputArg_); + } + } + } + if (!other.controlOutput_.isEmpty()) { + if (controlOutput_.isEmpty()) { + controlOutput_ = other.controlOutput_; + bitField0_ |= 0x00000008; + } else { + ensureControlOutputIsMutable(); + controlOutput_.addAll(other.controlOutput_); + } + onChanged(); + } + if (attrBuilder_ == null) { + if (!other.attr_.isEmpty()) { + if (attr_.isEmpty()) { + attr_ = other.attr_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureAttrIsMutable(); + attr_.addAll(other.attr_); + } + onChanged(); + } + } else { + if (!other.attr_.isEmpty()) { + if (attrBuilder_.isEmpty()) { + attrBuilder_.dispose(); + attrBuilder_ = null; + attr_ = other.attr_; + bitField0_ = (bitField0_ & ~0x00000010); + attrBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAttrFieldBuilder() : null; + } else { + attrBuilder_.addAllMessages(other.attr_); + } + } + } + if (other.hasDeprecation()) { + mergeDeprecation(other.getDeprecation()); + } + if (!other.getSummary().isEmpty()) { + summary_ = other.summary_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getIsCommutative() != false) { + setIsCommutative(other.getIsCommutative()); + } + if (other.getIsAggregate() != false) { + setIsAggregate(other.getIsAggregate()); + } + if (other.getIsStateful() != false) { + setIsStateful(other.getIsStateful()); + } + if (other.getAllowsUninitializedInput() != false) { + setAllowsUninitializedInput(other.getAllowsUninitializedInput()); + } + if (other.getIsDistributedCommunication() != false) { + setIsDistributedCommunication(other.getIsDistributedCommunication()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.OpDef.ArgDef m = + input.readMessage( + org.tensorflow.proto.OpDef.ArgDef.parser(), + extensionRegistry); + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + inputArg_.add(m); + } else { + inputArgBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + org.tensorflow.proto.OpDef.ArgDef m = + input.readMessage( + org.tensorflow.proto.OpDef.ArgDef.parser(), + extensionRegistry); + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + outputArg_.add(m); + } else { + outputArgBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + org.tensorflow.proto.OpDef.AttrDef m = + input.readMessage( + org.tensorflow.proto.OpDef.AttrDef.parser(), + extensionRegistry); + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(m); + } else { + attrBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + summary_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 42 + case 50: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 66: { + input.readMessage( + getDeprecationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 128: { + isAggregate_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 128 + case 136: { + isStateful_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 136 + case 144: { + isCommutative_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 144 + case 152: { + allowsUninitializedInput_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 152 + case 162: { + java.lang.String s = input.readStringRequireUtf8(); + ensureControlOutputIsMutable(); + controlOutput_.add(s); + break; + } // case 162 + case 168: { + isDistributedCommunication_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 168 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Op names starting with an underscore are reserved for internal use.
    +     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Op names starting with an underscore are reserved for internal use.
    +     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Op names starting with an underscore are reserved for internal use.
    +     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Op names starting with an underscore are reserved for internal use.
    +     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Op names starting with an underscore are reserved for internal use.
    +     * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List inputArg_ = + java.util.Collections.emptyList(); + private void ensureInputArgIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + inputArg_ = new java.util.ArrayList(inputArg_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder> inputArgBuilder_; + + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public java.util.List getInputArgList() { + if (inputArgBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputArg_); + } else { + return inputArgBuilder_.getMessageList(); + } + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public int getInputArgCount() { + if (inputArgBuilder_ == null) { + return inputArg_.size(); + } else { + return inputArgBuilder_.getCount(); + } + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public org.tensorflow.proto.OpDef.ArgDef getInputArg(int index) { + if (inputArgBuilder_ == null) { + return inputArg_.get(index); + } else { + return inputArgBuilder_.getMessage(index); + } + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder setInputArg( + int index, org.tensorflow.proto.OpDef.ArgDef value) { + if (inputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputArgIsMutable(); + inputArg_.set(index, value); + onChanged(); + } else { + inputArgBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder setInputArg( + int index, org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + inputArg_.set(index, builderForValue.build()); + onChanged(); + } else { + inputArgBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder addInputArg(org.tensorflow.proto.OpDef.ArgDef value) { + if (inputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputArgIsMutable(); + inputArg_.add(value); + onChanged(); + } else { + inputArgBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder addInputArg( + int index, org.tensorflow.proto.OpDef.ArgDef value) { + if (inputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputArgIsMutable(); + inputArg_.add(index, value); + onChanged(); + } else { + inputArgBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder addInputArg( + org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + inputArg_.add(builderForValue.build()); + onChanged(); + } else { + inputArgBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder addInputArg( + int index, org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + inputArg_.add(index, builderForValue.build()); + onChanged(); + } else { + inputArgBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder addAllInputArg( + java.lang.Iterable values) { + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputArg_); + onChanged(); + } else { + inputArgBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder clearInputArg() { + if (inputArgBuilder_ == null) { + inputArg_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + inputArgBuilder_.clear(); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public Builder removeInputArg(int index) { + if (inputArgBuilder_ == null) { + ensureInputArgIsMutable(); + inputArg_.remove(index); + onChanged(); + } else { + inputArgBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder getInputArgBuilder( + int index) { + return getInputArgFieldBuilder().getBuilder(index); + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public org.tensorflow.proto.OpDef.ArgDefOrBuilder getInputArgOrBuilder( + int index) { + if (inputArgBuilder_ == null) { + return inputArg_.get(index); } else { + return inputArgBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public java.util.List + getInputArgOrBuilderList() { + if (inputArgBuilder_ != null) { + return inputArgBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputArg_); + } + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder addInputArgBuilder() { + return getInputArgFieldBuilder().addBuilder( + org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance()); + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder addInputArgBuilder( + int index) { + return getInputArgFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance()); + } + /** + *
    +     * Description of the input(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + public java.util.List + getInputArgBuilderList() { + return getInputArgFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder> + getInputArgFieldBuilder() { + if (inputArgBuilder_ == null) { + inputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder>( + inputArg_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + inputArg_ = null; + } + return inputArgBuilder_; + } + + private java.util.List outputArg_ = + java.util.Collections.emptyList(); + private void ensureOutputArgIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + outputArg_ = new java.util.ArrayList(outputArg_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder> outputArgBuilder_; + + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public java.util.List getOutputArgList() { + if (outputArgBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputArg_); + } else { + return outputArgBuilder_.getMessageList(); + } + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public int getOutputArgCount() { + if (outputArgBuilder_ == null) { + return outputArg_.size(); + } else { + return outputArgBuilder_.getCount(); + } + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public org.tensorflow.proto.OpDef.ArgDef getOutputArg(int index) { + if (outputArgBuilder_ == null) { + return outputArg_.get(index); + } else { + return outputArgBuilder_.getMessage(index); + } + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder setOutputArg( + int index, org.tensorflow.proto.OpDef.ArgDef value) { + if (outputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputArgIsMutable(); + outputArg_.set(index, value); + onChanged(); + } else { + outputArgBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder setOutputArg( + int index, org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + outputArg_.set(index, builderForValue.build()); + onChanged(); + } else { + outputArgBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder addOutputArg(org.tensorflow.proto.OpDef.ArgDef value) { + if (outputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputArgIsMutable(); + outputArg_.add(value); + onChanged(); + } else { + outputArgBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder addOutputArg( + int index, org.tensorflow.proto.OpDef.ArgDef value) { + if (outputArgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputArgIsMutable(); + outputArg_.add(index, value); + onChanged(); + } else { + outputArgBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder addOutputArg( + org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + outputArg_.add(builderForValue.build()); + onChanged(); + } else { + outputArgBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder addOutputArg( + int index, org.tensorflow.proto.OpDef.ArgDef.Builder builderForValue) { + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + outputArg_.add(index, builderForValue.build()); + onChanged(); + } else { + outputArgBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder addAllOutputArg( + java.lang.Iterable values) { + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputArg_); + onChanged(); + } else { + outputArgBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder clearOutputArg() { + if (outputArgBuilder_ == null) { + outputArg_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + outputArgBuilder_.clear(); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public Builder removeOutputArg(int index) { + if (outputArgBuilder_ == null) { + ensureOutputArgIsMutable(); + outputArg_.remove(index); + onChanged(); + } else { + outputArgBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder getOutputArgBuilder( + int index) { + return getOutputArgFieldBuilder().getBuilder(index); + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public org.tensorflow.proto.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( + int index) { + if (outputArgBuilder_ == null) { + return outputArg_.get(index); } else { + return outputArgBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public java.util.List + getOutputArgOrBuilderList() { + if (outputArgBuilder_ != null) { + return outputArgBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputArg_); + } + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder addOutputArgBuilder() { + return getOutputArgFieldBuilder().addBuilder( + org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance()); + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public org.tensorflow.proto.OpDef.ArgDef.Builder addOutputArgBuilder( + int index) { + return getOutputArgFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpDef.ArgDef.getDefaultInstance()); + } + /** + *
    +     * Description of the output(s).
    +     * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + public java.util.List + getOutputArgBuilderList() { + return getOutputArgFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder> + getOutputArgFieldBuilder() { + if (outputArgBuilder_ == null) { + outputArgBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.ArgDef, org.tensorflow.proto.OpDef.ArgDef.Builder, org.tensorflow.proto.OpDef.ArgDefOrBuilder>( + outputArg_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + outputArg_ = null; + } + return outputArgBuilder_; + } + + private com.google.protobuf.LazyStringArrayList controlOutput_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureControlOutputIsMutable() { + if (!controlOutput_.isModifiable()) { + controlOutput_ = new com.google.protobuf.LazyStringArrayList(controlOutput_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @return A list containing the controlOutput. + */ + public com.google.protobuf.ProtocolStringList + getControlOutputList() { + controlOutput_.makeImmutable(); + return controlOutput_; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @return The count of controlOutput. + */ + public int getControlOutputCount() { + return controlOutput_.size(); + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param index The index of the element to return. + * @return The controlOutput at the given index. + */ + public java.lang.String getControlOutput(int index) { + return controlOutput_.get(index); + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param index The index of the value to return. + * @return The bytes of the controlOutput at the given index. + */ + public com.google.protobuf.ByteString + getControlOutputBytes(int index) { + return controlOutput_.getByteString(index); + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param index The index to set the value at. + * @param value The controlOutput to set. + * @return This builder for chaining. + */ + public Builder setControlOutput( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureControlOutputIsMutable(); + controlOutput_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param value The controlOutput to add. + * @return This builder for chaining. + */ + public Builder addControlOutput( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureControlOutputIsMutable(); + controlOutput_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param values The controlOutput to add. + * @return This builder for chaining. + */ + public Builder addAllControlOutput( + java.lang.Iterable values) { + ensureControlOutputIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, controlOutput_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @return This builder for chaining. + */ + public Builder clearControlOutput() { + controlOutput_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
    +     * Named control outputs for this operation. Useful only for composite
    +     * operations (i.e. functions) which want to name different control outputs.
    +     * 
    + * + * repeated string control_output = 20; + * @param value The bytes of the controlOutput to add. + * @return This builder for chaining. + */ + public Builder addControlOutputBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureControlOutputIsMutable(); + controlOutput_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List attr_ = + java.util.Collections.emptyList(); + private void ensureAttrIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + attr_ = new java.util.ArrayList(attr_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.AttrDef, org.tensorflow.proto.OpDef.AttrDef.Builder, org.tensorflow.proto.OpDef.AttrDefOrBuilder> attrBuilder_; + + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public java.util.List getAttrList() { + if (attrBuilder_ == null) { + return java.util.Collections.unmodifiableList(attr_); + } else { + return attrBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public int getAttrCount() { + if (attrBuilder_ == null) { + return attr_.size(); + } else { + return attrBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public org.tensorflow.proto.OpDef.AttrDef getAttr(int index) { + if (attrBuilder_ == null) { + return attr_.get(index); + } else { + return attrBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder setAttr( + int index, org.tensorflow.proto.OpDef.AttrDef value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.set(index, value); + onChanged(); + } else { + attrBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder setAttr( + int index, org.tensorflow.proto.OpDef.AttrDef.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.set(index, builderForValue.build()); + onChanged(); + } else { + attrBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder addAttr(org.tensorflow.proto.OpDef.AttrDef value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.add(value); + onChanged(); + } else { + attrBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder addAttr( + int index, org.tensorflow.proto.OpDef.AttrDef value) { + if (attrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttrIsMutable(); + attr_.add(index, value); + onChanged(); + } else { + attrBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder addAttr( + org.tensorflow.proto.OpDef.AttrDef.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(builderForValue.build()); + onChanged(); + } else { + attrBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder addAttr( + int index, org.tensorflow.proto.OpDef.AttrDef.Builder builderForValue) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.add(index, builderForValue.build()); + onChanged(); + } else { + attrBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder addAllAttr( + java.lang.Iterable values) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, attr_); + onChanged(); + } else { + attrBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder clearAttr() { + if (attrBuilder_ == null) { + attr_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + attrBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public Builder removeAttr(int index) { + if (attrBuilder_ == null) { + ensureAttrIsMutable(); + attr_.remove(index); + onChanged(); + } else { + attrBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public org.tensorflow.proto.OpDef.AttrDef.Builder getAttrBuilder( + int index) { + return getAttrFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public org.tensorflow.proto.OpDef.AttrDefOrBuilder getAttrOrBuilder( + int index) { + if (attrBuilder_ == null) { + return attr_.get(index); } else { + return attrBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public java.util.List + getAttrOrBuilderList() { + if (attrBuilder_ != null) { + return attrBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attr_); + } + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public org.tensorflow.proto.OpDef.AttrDef.Builder addAttrBuilder() { + return getAttrFieldBuilder().addBuilder( + org.tensorflow.proto.OpDef.AttrDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public org.tensorflow.proto.OpDef.AttrDef.Builder addAttrBuilder( + int index) { + return getAttrFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpDef.AttrDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + public java.util.List + getAttrBuilderList() { + return getAttrFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.AttrDef, org.tensorflow.proto.OpDef.AttrDef.Builder, org.tensorflow.proto.OpDef.AttrDefOrBuilder> + getAttrFieldBuilder() { + if (attrBuilder_ == null) { + attrBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef.AttrDef, org.tensorflow.proto.OpDef.AttrDef.Builder, org.tensorflow.proto.OpDef.AttrDefOrBuilder>( + attr_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + attr_ = null; + } + return attrBuilder_; + } + + private org.tensorflow.proto.OpDeprecation deprecation_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDeprecation, org.tensorflow.proto.OpDeprecation.Builder, org.tensorflow.proto.OpDeprecationOrBuilder> deprecationBuilder_; + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return Whether the deprecation field is set. + */ + public boolean hasDeprecation() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return The deprecation. + */ + public org.tensorflow.proto.OpDeprecation getDeprecation() { + if (deprecationBuilder_ == null) { + return deprecation_ == null ? org.tensorflow.proto.OpDeprecation.getDefaultInstance() : deprecation_; + } else { + return deprecationBuilder_.getMessage(); + } + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public Builder setDeprecation(org.tensorflow.proto.OpDeprecation value) { + if (deprecationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deprecation_ = value; + } else { + deprecationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public Builder setDeprecation( + org.tensorflow.proto.OpDeprecation.Builder builderForValue) { + if (deprecationBuilder_ == null) { + deprecation_ = builderForValue.build(); + } else { + deprecationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public Builder mergeDeprecation(org.tensorflow.proto.OpDeprecation value) { + if (deprecationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + deprecation_ != null && + deprecation_ != org.tensorflow.proto.OpDeprecation.getDefaultInstance()) { + getDeprecationBuilder().mergeFrom(value); + } else { + deprecation_ = value; + } + } else { + deprecationBuilder_.mergeFrom(value); + } + if (deprecation_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public Builder clearDeprecation() { + bitField0_ = (bitField0_ & ~0x00000020); + deprecation_ = null; + if (deprecationBuilder_ != null) { + deprecationBuilder_.dispose(); + deprecationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public org.tensorflow.proto.OpDeprecation.Builder getDeprecationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDeprecationFieldBuilder().getBuilder(); + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + public org.tensorflow.proto.OpDeprecationOrBuilder getDeprecationOrBuilder() { + if (deprecationBuilder_ != null) { + return deprecationBuilder_.getMessageOrBuilder(); + } else { + return deprecation_ == null ? + org.tensorflow.proto.OpDeprecation.getDefaultInstance() : deprecation_; + } + } + /** + *
    +     * Optional deprecation based on GraphDef versions.
    +     * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDeprecation, org.tensorflow.proto.OpDeprecation.Builder, org.tensorflow.proto.OpDeprecationOrBuilder> + getDeprecationFieldBuilder() { + if (deprecationBuilder_ == null) { + deprecationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpDeprecation, org.tensorflow.proto.OpDeprecation.Builder, org.tensorflow.proto.OpDeprecationOrBuilder>( + getDeprecation(), + getParentForChildren(), + isClean()); + deprecation_ = null; + } + return deprecationBuilder_; + } + + private java.lang.Object summary_ = ""; + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 5; + * @return The summary. + */ + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summary_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 5; + * @return The bytes for summary. + */ + public com.google.protobuf.ByteString + getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 5; + * @param value The summary to set. + * @return This builder for chaining. + */ + public Builder setSummary( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + summary_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 5; + * @return This builder for chaining. + */ + public Builder clearSummary() { + summary_ = getDefaultInstance().getSummary(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + *
    +     * One-line human-readable description of what the Op does.
    +     * 
    + * + * string summary = 5; + * @param value The bytes for summary to set. + * @return This builder for chaining. + */ + public Builder setSummaryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + summary_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 6; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 6; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 6; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 6; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + *
    +     * Additional, longer human-readable description of what the Op does.
    +     * 
    + * + * string description = 6; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean isCommutative_ ; + /** + *
    +     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    +     * 
    + * + * bool is_commutative = 18; + * @return The isCommutative. + */ + @java.lang.Override + public boolean getIsCommutative() { + return isCommutative_; + } + /** + *
    +     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    +     * 
    + * + * bool is_commutative = 18; + * @param value The isCommutative to set. + * @return This builder for chaining. + */ + public Builder setIsCommutative(boolean value) { + + isCommutative_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    +     * 
    + * + * bool is_commutative = 18; + * @return This builder for chaining. + */ + public Builder clearIsCommutative() { + bitField0_ = (bitField0_ & ~0x00000100); + isCommutative_ = false; + onChanged(); + return this; + } + + private boolean isAggregate_ ; + /** + *
    +     * If is_aggregate is true, then this operation accepts N >= 2
    +     * inputs and produces 1 output all of the same type.  Should be
    +     * associative and commutative, and produce output with the same
    +     * shape as the input.  The optimizer may replace an aggregate op
    +     * taking input from multiple devices with a tree of aggregate ops
    +     * that aggregate locally within each device (and possibly within
    +     * groups of nearby devices) before communicating.
    +     * TODO(josh11b): Implement that optimization.
    +     * 
    + * + * bool is_aggregate = 16; + * @return The isAggregate. + */ + @java.lang.Override + public boolean getIsAggregate() { + return isAggregate_; + } + /** + *
    +     * If is_aggregate is true, then this operation accepts N >= 2
    +     * inputs and produces 1 output all of the same type.  Should be
    +     * associative and commutative, and produce output with the same
    +     * shape as the input.  The optimizer may replace an aggregate op
    +     * taking input from multiple devices with a tree of aggregate ops
    +     * that aggregate locally within each device (and possibly within
    +     * groups of nearby devices) before communicating.
    +     * TODO(josh11b): Implement that optimization.
    +     * 
    + * + * bool is_aggregate = 16; + * @param value The isAggregate to set. + * @return This builder for chaining. + */ + public Builder setIsAggregate(boolean value) { + + isAggregate_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * If is_aggregate is true, then this operation accepts N >= 2
    +     * inputs and produces 1 output all of the same type.  Should be
    +     * associative and commutative, and produce output with the same
    +     * shape as the input.  The optimizer may replace an aggregate op
    +     * taking input from multiple devices with a tree of aggregate ops
    +     * that aggregate locally within each device (and possibly within
    +     * groups of nearby devices) before communicating.
    +     * TODO(josh11b): Implement that optimization.
    +     * 
    + * + * bool is_aggregate = 16; + * @return This builder for chaining. + */ + public Builder clearIsAggregate() { + bitField0_ = (bitField0_ & ~0x00000200); + isAggregate_ = false; + onChanged(); + return this; + } + + private boolean isStateful_ ; + /** + *
    +     * Ops are marked as stateful if their behavior depends on some state beyond
    +     * their input tensors (e.g. variable reading op) or if they have
    +     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    +     * must always produce the same output for the same input and have
    +     * no side-effects.
    +     *
    +     * By default Ops may be moved between devices.  Stateful ops should
    +     * either not be moved, or should only be moved if that state can also
    +     * be moved (e.g. via some sort of save / restore).
    +     * Stateful ops are guaranteed to never be optimized away by Common
    +     * Subexpression Elimination (CSE).
    +     * 
    + * + * bool is_stateful = 17; + * @return The isStateful. + */ + @java.lang.Override + public boolean getIsStateful() { + return isStateful_; + } + /** + *
    +     * Ops are marked as stateful if their behavior depends on some state beyond
    +     * their input tensors (e.g. variable reading op) or if they have
    +     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    +     * must always produce the same output for the same input and have
    +     * no side-effects.
    +     *
    +     * By default Ops may be moved between devices.  Stateful ops should
    +     * either not be moved, or should only be moved if that state can also
    +     * be moved (e.g. via some sort of save / restore).
    +     * Stateful ops are guaranteed to never be optimized away by Common
    +     * Subexpression Elimination (CSE).
    +     * 
    + * + * bool is_stateful = 17; + * @param value The isStateful to set. + * @return This builder for chaining. + */ + public Builder setIsStateful(boolean value) { + + isStateful_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Ops are marked as stateful if their behavior depends on some state beyond
    +     * their input tensors (e.g. variable reading op) or if they have
    +     * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    +     * must always produce the same output for the same input and have
    +     * no side-effects.
    +     *
    +     * By default Ops may be moved between devices.  Stateful ops should
    +     * either not be moved, or should only be moved if that state can also
    +     * be moved (e.g. via some sort of save / restore).
    +     * Stateful ops are guaranteed to never be optimized away by Common
    +     * Subexpression Elimination (CSE).
    +     * 
    + * + * bool is_stateful = 17; + * @return This builder for chaining. + */ + public Builder clearIsStateful() { + bitField0_ = (bitField0_ & ~0x00000400); + isStateful_ = false; + onChanged(); + return this; + } + + private boolean allowsUninitializedInput_ ; + /** + *
    +     * By default, all inputs to an Op must be initialized Tensors.  Ops
    +     * that may initialize tensors for the first time should set this
    +     * field to true, to allow the Op to take an uninitialized Tensor as
    +     * input.
    +     * 
    + * + * bool allows_uninitialized_input = 19; + * @return The allowsUninitializedInput. + */ + @java.lang.Override + public boolean getAllowsUninitializedInput() { + return allowsUninitializedInput_; + } + /** + *
    +     * By default, all inputs to an Op must be initialized Tensors.  Ops
    +     * that may initialize tensors for the first time should set this
    +     * field to true, to allow the Op to take an uninitialized Tensor as
    +     * input.
    +     * 
    + * + * bool allows_uninitialized_input = 19; + * @param value The allowsUninitializedInput to set. + * @return This builder for chaining. + */ + public Builder setAllowsUninitializedInput(boolean value) { + + allowsUninitializedInput_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * By default, all inputs to an Op must be initialized Tensors.  Ops
    +     * that may initialize tensors for the first time should set this
    +     * field to true, to allow the Op to take an uninitialized Tensor as
    +     * input.
    +     * 
    + * + * bool allows_uninitialized_input = 19; + * @return This builder for chaining. + */ + public Builder clearAllowsUninitializedInput() { + bitField0_ = (bitField0_ & ~0x00000800); + allowsUninitializedInput_ = false; + onChanged(); + return this; + } + + private boolean isDistributedCommunication_ ; + /** + *
    +     * Indicates whether the op implementation uses distributed communication.
    +     * If True, the op is allowed to return errors for network disconnection and
    +     * trigger TF network failure handling logics.
    +     * 
    + * + * bool is_distributed_communication = 21; + * @return The isDistributedCommunication. + */ + @java.lang.Override + public boolean getIsDistributedCommunication() { + return isDistributedCommunication_; + } + /** + *
    +     * Indicates whether the op implementation uses distributed communication.
    +     * If True, the op is allowed to return errors for network disconnection and
    +     * trigger TF network failure handling logics.
    +     * 
    + * + * bool is_distributed_communication = 21; + * @param value The isDistributedCommunication to set. + * @return This builder for chaining. + */ + public Builder setIsDistributedCommunication(boolean value) { + + isDistributedCommunication_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * Indicates whether the op implementation uses distributed communication.
    +     * If True, the op is allowed to return errors for network disconnection and
    +     * trigger TF network failure handling logics.
    +     * 
    + * + * bool is_distributed_communication = 21; + * @return This builder for chaining. + */ + public Builder clearIsDistributedCommunication() { + bitField0_ = (bitField0_ & ~0x00001000); + isDistributedCommunication_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpDef) + private static final org.tensorflow.proto.OpDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpDef(); + } + + public static org.tensorflow.proto.OpDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefOrBuilder.java new file mode 100644 index 00000000000..598ed6ae27c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefOrBuilder.java @@ -0,0 +1,329 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface OpDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Op names starting with an underscore are reserved for internal use.
    +   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +   * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * Op names starting with an underscore are reserved for internal use.
    +   * Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9>_]*".
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + java.util.List + getInputArgList(); + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + org.tensorflow.proto.OpDef.ArgDef getInputArg(int index); + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + int getInputArgCount(); + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + java.util.List + getInputArgOrBuilderList(); + /** + *
    +   * Description of the input(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef input_arg = 2; + */ + org.tensorflow.proto.OpDef.ArgDefOrBuilder getInputArgOrBuilder( + int index); + + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + java.util.List + getOutputArgList(); + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + org.tensorflow.proto.OpDef.ArgDef getOutputArg(int index); + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + int getOutputArgCount(); + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + java.util.List + getOutputArgOrBuilderList(); + /** + *
    +   * Description of the output(s).
    +   * 
    + * + * repeated .tensorflow.OpDef.ArgDef output_arg = 3; + */ + org.tensorflow.proto.OpDef.ArgDefOrBuilder getOutputArgOrBuilder( + int index); + + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @return A list containing the controlOutput. + */ + java.util.List + getControlOutputList(); + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @return The count of controlOutput. + */ + int getControlOutputCount(); + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @param index The index of the element to return. + * @return The controlOutput at the given index. + */ + java.lang.String getControlOutput(int index); + /** + *
    +   * Named control outputs for this operation. Useful only for composite
    +   * operations (i.e. functions) which want to name different control outputs.
    +   * 
    + * + * repeated string control_output = 20; + * @param index The index of the value to return. + * @return The bytes of the controlOutput at the given index. + */ + com.google.protobuf.ByteString + getControlOutputBytes(int index); + + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + java.util.List + getAttrList(); + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + org.tensorflow.proto.OpDef.AttrDef getAttr(int index); + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + int getAttrCount(); + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + java.util.List + getAttrOrBuilderList(); + /** + * repeated .tensorflow.OpDef.AttrDef attr = 4; + */ + org.tensorflow.proto.OpDef.AttrDefOrBuilder getAttrOrBuilder( + int index); + + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return Whether the deprecation field is set. + */ + boolean hasDeprecation(); + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + * @return The deprecation. + */ + org.tensorflow.proto.OpDeprecation getDeprecation(); + /** + *
    +   * Optional deprecation based on GraphDef versions.
    +   * 
    + * + * .tensorflow.OpDeprecation deprecation = 8; + */ + org.tensorflow.proto.OpDeprecationOrBuilder getDeprecationOrBuilder(); + + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 5; + * @return The summary. + */ + java.lang.String getSummary(); + /** + *
    +   * One-line human-readable description of what the Op does.
    +   * 
    + * + * string summary = 5; + * @return The bytes for summary. + */ + com.google.protobuf.ByteString + getSummaryBytes(); + + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 6; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +   * Additional, longer human-readable description of what the Op does.
    +   * 
    + * + * string description = 6; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
    +   * True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
    +   * 
    + * + * bool is_commutative = 18; + * @return The isCommutative. + */ + boolean getIsCommutative(); + + /** + *
    +   * If is_aggregate is true, then this operation accepts N >= 2
    +   * inputs and produces 1 output all of the same type.  Should be
    +   * associative and commutative, and produce output with the same
    +   * shape as the input.  The optimizer may replace an aggregate op
    +   * taking input from multiple devices with a tree of aggregate ops
    +   * that aggregate locally within each device (and possibly within
    +   * groups of nearby devices) before communicating.
    +   * TODO(josh11b): Implement that optimization.
    +   * 
    + * + * bool is_aggregate = 16; + * @return The isAggregate. + */ + boolean getIsAggregate(); + + /** + *
    +   * Ops are marked as stateful if their behavior depends on some state beyond
    +   * their input tensors (e.g. variable reading op) or if they have
    +   * a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
    +   * must always produce the same output for the same input and have
    +   * no side-effects.
    +   *
    +   * By default Ops may be moved between devices.  Stateful ops should
    +   * either not be moved, or should only be moved if that state can also
    +   * be moved (e.g. via some sort of save / restore).
    +   * Stateful ops are guaranteed to never be optimized away by Common
    +   * Subexpression Elimination (CSE).
    +   * 
    + * + * bool is_stateful = 17; + * @return The isStateful. + */ + boolean getIsStateful(); + + /** + *
    +   * By default, all inputs to an Op must be initialized Tensors.  Ops
    +   * that may initialize tensors for the first time should set this
    +   * field to true, to allow the Op to take an uninitialized Tensor as
    +   * input.
    +   * 
    + * + * bool allows_uninitialized_input = 19; + * @return The allowsUninitializedInput. + */ + boolean getAllowsUninitializedInput(); + + /** + *
    +   * Indicates whether the op implementation uses distributed communication.
    +   * If True, the op is allowed to return errors for network disconnection and
    +   * trigger TF network failure handling logics.
    +   * 
    + * + * bool is_distributed_communication = 21; + * @return The isDistributedCommunication. + */ + boolean getIsDistributedCommunication(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefProtos.java new file mode 100644 index 00000000000..a840147d89e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDefProtos.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class OpDefProtos { + private OpDefProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpDefProtos.class.getName()); + } + 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_OpDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpDef_ArgDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpDef_AttrDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpDeprecation_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpDeprecation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpList_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/framework/op_def.proto" + + "\022\ntensorflow\032*tensorflow/core/framework/" + + "attr_value.proto\032)tensorflow/core/framew" + + "ork/full_type.proto\032/tensorflow/core/fra" + + "mework/resource_handle.proto\032%tensorflow" + + "/core/framework/types.proto\"\363\006\n\005OpDef\022\014\n" + + "\004name\030\001 \001(\t\022+\n\tinput_arg\030\002 \003(\0132\030.tensorf" + + "low.OpDef.ArgDef\022,\n\noutput_arg\030\003 \003(\0132\030.t" + + "ensorflow.OpDef.ArgDef\022\026\n\016control_output" + + "\030\024 \003(\t\022\'\n\004attr\030\004 \003(\0132\031.tensorflow.OpDef." + + "AttrDef\022.\n\013deprecation\030\010 \001(\0132\031.tensorflo" + + "w.OpDeprecation\022\017\n\007summary\030\005 \001(\t\022\023\n\013desc" + + "ription\030\006 \001(\t\022\026\n\016is_commutative\030\022 \001(\010\022\024\n" + + "\014is_aggregate\030\020 \001(\010\022\023\n\013is_stateful\030\021 \001(\010" + + "\022\"\n\032allows_uninitialized_input\030\023 \001(\010\022$\n\034" + + "is_distributed_communication\030\025 \001(\010\032\234\002\n\006A" + + "rgDef\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 \001(\t" + + "\022\"\n\004type\030\003 \001(\0162\024.tensorflow.DataType\022\021\n\t" + + "type_attr\030\004 \001(\t\022\023\n\013number_attr\030\005 \001(\t\022\026\n\016" + + "type_list_attr\030\006 \001(\t\022B\n\013handle_data\030\007 \003(" + + "\0132-.tensorflow.ResourceHandleProto.Dtype" + + "AndShape\022\016\n\006is_ref\030\020 \001(\010\0227\n\026experimental" + + "_full_type\030\021 \001(\0132\027.tensorflow.FullTypeDe" + + "f\032\275\001\n\007AttrDef\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(" + + "\t\022,\n\rdefault_value\030\003 \001(\0132\025.tensorflow.At" + + "trValue\022\023\n\013description\030\004 \001(\t\022\023\n\013has_mini" + + "mum\030\005 \001(\010\022\017\n\007minimum\030\006 \001(\003\022-\n\016allowed_va" + + "lues\030\007 \001(\0132\025.tensorflow.AttrValue\"5\n\rOpD" + + "eprecation\022\017\n\007version\030\001 \001(\005\022\023\n\013explanati" + + "on\030\002 \001(\t\"\'\n\006OpList\022\035\n\002op\030\001 \003(\0132\021.tensorf" + + "low.OpDefBw\n\024org.tensorflow.protoB\013OpDef" + + "ProtosP\001ZMgithub.com/tensorflow/tensorfl" + + "ow/tensorflow/go/core/framework/op_def_g" + + "o_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + org.tensorflow.proto.FullTypeProtos.getDescriptor(), + org.tensorflow.proto.ResourceHandle.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_OpDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_OpDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpDef_descriptor, + new java.lang.String[] { "Name", "InputArg", "OutputArg", "ControlOutput", "Attr", "Deprecation", "Summary", "Description", "IsCommutative", "IsAggregate", "IsStateful", "AllowsUninitializedInput", "IsDistributedCommunication", }); + internal_static_tensorflow_OpDef_ArgDef_descriptor = + internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_OpDef_ArgDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpDef_ArgDef_descriptor, + new java.lang.String[] { "Name", "Description", "Type", "TypeAttr", "NumberAttr", "TypeListAttr", "HandleData", "IsRef", "ExperimentalFullType", }); + internal_static_tensorflow_OpDef_AttrDef_descriptor = + internal_static_tensorflow_OpDef_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_OpDef_AttrDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpDef_AttrDef_descriptor, + new java.lang.String[] { "Name", "Type", "DefaultValue", "Description", "HasMinimum", "Minimum", "AllowedValues", }); + internal_static_tensorflow_OpDeprecation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_OpDeprecation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpDeprecation_descriptor, + new java.lang.String[] { "Version", "Explanation", }); + internal_static_tensorflow_OpList_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_OpList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpList_descriptor, + new java.lang.String[] { "Op", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + org.tensorflow.proto.FullTypeProtos.getDescriptor(); + org.tensorflow.proto.ResourceHandle.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecation.java new file mode 100644 index 00000000000..984020421f7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecation.java @@ -0,0 +1,619 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Information about version-dependent deprecation of an op
    + * 
    + * + * Protobuf type {@code tensorflow.OpDeprecation} + */ +public final class OpDeprecation extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpDeprecation) + OpDeprecationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpDeprecation.class.getName()); + } + // Use OpDeprecation.newBuilder() to construct. + private OpDeprecation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpDeprecation() { + explanation_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDeprecation.class, org.tensorflow.proto.OpDeprecation.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private int version_ = 0; + /** + *
    +   * First GraphDef version at which the op is disallowed.
    +   * 
    + * + * int32 version = 1; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + + public static final int EXPLANATION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object explanation_ = ""; + /** + *
    +   * Explanation of why it was deprecated and what to use instead.
    +   * 
    + * + * string explanation = 2; + * @return The explanation. + */ + @java.lang.Override + public java.lang.String getExplanation() { + java.lang.Object ref = explanation_; + 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(); + explanation_ = s; + return s; + } + } + /** + *
    +   * Explanation of why it was deprecated and what to use instead.
    +   * 
    + * + * string explanation = 2; + * @return The bytes for explanation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (version_ != 0) { + output.writeInt32(1, version_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(explanation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, explanation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, version_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(explanation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, explanation_); + } + size += getUnknownFields().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.OpDeprecation)) { + return super.equals(obj); + } + org.tensorflow.proto.OpDeprecation other = (org.tensorflow.proto.OpDeprecation) obj; + + if (getVersion() + != other.getVersion()) return false; + if (!getExplanation() + .equals(other.getExplanation())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; + hash = (53 * hash) + getExplanation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpDeprecation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDeprecation 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.OpDeprecation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDeprecation 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.OpDeprecation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpDeprecation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpDeprecation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDeprecation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpDeprecation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpDeprecation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpDeprecation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpDeprecation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpDeprecation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Information about version-dependent deprecation of an op
    +   * 
    + * + * Protobuf type {@code tensorflow.OpDeprecation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpDeprecation) + org.tensorflow.proto.OpDeprecationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDeprecation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpDeprecation.class, org.tensorflow.proto.OpDeprecation.Builder.class); + } + + // Construct using org.tensorflow.proto.OpDeprecation.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + version_ = 0; + explanation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpDeprecation_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpDeprecation getDefaultInstanceForType() { + return org.tensorflow.proto.OpDeprecation.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpDeprecation build() { + org.tensorflow.proto.OpDeprecation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpDeprecation buildPartial() { + org.tensorflow.proto.OpDeprecation result = new org.tensorflow.proto.OpDeprecation(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpDeprecation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.explanation_ = explanation_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpDeprecation) { + return mergeFrom((org.tensorflow.proto.OpDeprecation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpDeprecation other) { + if (other == org.tensorflow.proto.OpDeprecation.getDefaultInstance()) return this; + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + if (!other.getExplanation().isEmpty()) { + explanation_ = other.explanation_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + version_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + explanation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int version_ ; + /** + *
    +     * First GraphDef version at which the op is disallowed.
    +     * 
    + * + * int32 version = 1; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + /** + *
    +     * First GraphDef version at which the op is disallowed.
    +     * 
    + * + * int32 version = 1; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(int value) { + + version_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * First GraphDef version at which the op is disallowed.
    +     * 
    + * + * int32 version = 1; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + onChanged(); + return this; + } + + private java.lang.Object explanation_ = ""; + /** + *
    +     * Explanation of why it was deprecated and what to use instead.
    +     * 
    + * + * string explanation = 2; + * @return The explanation. + */ + public java.lang.String getExplanation() { + java.lang.Object ref = explanation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + explanation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Explanation of why it was deprecated and what to use instead.
    +     * 
    + * + * string explanation = 2; + * @return The bytes for explanation. + */ + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Explanation of why it was deprecated and what to use instead.
    +     * 
    + * + * string explanation = 2; + * @param value The explanation to set. + * @return This builder for chaining. + */ + public Builder setExplanation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + explanation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Explanation of why it was deprecated and what to use instead.
    +     * 
    + * + * string explanation = 2; + * @return This builder for chaining. + */ + public Builder clearExplanation() { + explanation_ = getDefaultInstance().getExplanation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Explanation of why it was deprecated and what to use instead.
    +     * 
    + * + * string explanation = 2; + * @param value The bytes for explanation to set. + * @return This builder for chaining. + */ + public Builder setExplanationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + explanation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpDeprecation) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpDeprecation) + private static final org.tensorflow.proto.OpDeprecation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpDeprecation(); + } + + public static org.tensorflow.proto.OpDeprecation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpDeprecation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpDeprecation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecationOrBuilder.java new file mode 100644 index 00000000000..e88fe5daf67 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpDeprecationOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface OpDeprecationOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpDeprecation) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * First GraphDef version at which the op is disallowed.
    +   * 
    + * + * int32 version = 1; + * @return The version. + */ + int getVersion(); + + /** + *
    +   * Explanation of why it was deprecated and what to use instead.
    +   * 
    + * + * string explanation = 2; + * @return The explanation. + */ + java.lang.String getExplanation(); + /** + *
    +   * Explanation of why it was deprecated and what to use instead.
    +   * 
    + * + * string explanation = 2; + * @return The bytes for explanation. + */ + com.google.protobuf.ByteString + getExplanationBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpList.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpList.java new file mode 100644 index 00000000000..6af1a400c7c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpList.java @@ -0,0 +1,727 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A collection of OpDefs
    + * 
    + * + * Protobuf type {@code tensorflow.OpList} + */ +public final class OpList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpList) + OpListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpList.class.getName()); + } + // Use OpList.newBuilder() to construct. + private OpList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpList() { + op_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpList.class, org.tensorflow.proto.OpList.Builder.class); + } + + public static final int OP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List op_; + /** + * repeated .tensorflow.OpDef op = 1; + */ + @java.lang.Override + public java.util.List getOpList() { + return op_; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + @java.lang.Override + public java.util.List + getOpOrBuilderList() { + return op_; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + @java.lang.Override + public int getOpCount() { + return op_.size(); + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpDef getOp(int index) { + return op_.get(index); + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpDefOrBuilder getOpOrBuilder( + int index) { + return op_.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 { + for (int i = 0; i < op_.size(); i++) { + output.writeMessage(1, op_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < op_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, op_.get(i)); + } + size += getUnknownFields().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.OpList)) { + return super.equals(obj); + } + org.tensorflow.proto.OpList other = (org.tensorflow.proto.OpList) obj; + + if (!getOpList() + .equals(other.getOpList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOpCount() > 0) { + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOpList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpList 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.OpList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpList 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.OpList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A collection of OpDefs
    +   * 
    + * + * Protobuf type {@code tensorflow.OpList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpList) + org.tensorflow.proto.OpListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpList.class, org.tensorflow.proto.OpList.Builder.class); + } + + // Construct using org.tensorflow.proto.OpList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (opBuilder_ == null) { + op_ = java.util.Collections.emptyList(); + } else { + op_ = null; + opBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpDefProtos.internal_static_tensorflow_OpList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpList getDefaultInstanceForType() { + return org.tensorflow.proto.OpList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpList build() { + org.tensorflow.proto.OpList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpList buildPartial() { + org.tensorflow.proto.OpList result = new org.tensorflow.proto.OpList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OpList result) { + if (opBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + op_ = java.util.Collections.unmodifiableList(op_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.op_ = op_; + } else { + result.op_ = opBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.OpList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpList) { + return mergeFrom((org.tensorflow.proto.OpList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpList other) { + if (other == org.tensorflow.proto.OpList.getDefaultInstance()) return this; + if (opBuilder_ == null) { + if (!other.op_.isEmpty()) { + if (op_.isEmpty()) { + op_ = other.op_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOpIsMutable(); + op_.addAll(other.op_); + } + onChanged(); + } + } else { + if (!other.op_.isEmpty()) { + if (opBuilder_.isEmpty()) { + opBuilder_.dispose(); + opBuilder_ = null; + op_ = other.op_; + bitField0_ = (bitField0_ & ~0x00000001); + opBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOpFieldBuilder() : null; + } else { + opBuilder_.addAllMessages(other.op_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.OpDef m = + input.readMessage( + org.tensorflow.proto.OpDef.parser(), + extensionRegistry); + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(m); + } else { + opBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List op_ = + java.util.Collections.emptyList(); + private void ensureOpIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + op_ = new java.util.ArrayList(op_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder> opBuilder_; + + /** + * repeated .tensorflow.OpDef op = 1; + */ + public java.util.List getOpList() { + if (opBuilder_ == null) { + return java.util.Collections.unmodifiableList(op_); + } else { + return opBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public int getOpCount() { + if (opBuilder_ == null) { + return op_.size(); + } else { + return opBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public org.tensorflow.proto.OpDef getOp(int index) { + if (opBuilder_ == null) { + return op_.get(index); + } else { + return opBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder setOp( + int index, org.tensorflow.proto.OpDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.set(index, value); + onChanged(); + } else { + opBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder setOp( + int index, org.tensorflow.proto.OpDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.set(index, builderForValue.build()); + onChanged(); + } else { + opBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder addOp(org.tensorflow.proto.OpDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.add(value); + onChanged(); + } else { + opBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder addOp( + int index, org.tensorflow.proto.OpDef value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpIsMutable(); + op_.add(index, value); + onChanged(); + } else { + opBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder addOp( + org.tensorflow.proto.OpDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(builderForValue.build()); + onChanged(); + } else { + opBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder addOp( + int index, org.tensorflow.proto.OpDef.Builder builderForValue) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.add(index, builderForValue.build()); + onChanged(); + } else { + opBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder addAllOp( + java.lang.Iterable values) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, op_); + onChanged(); + } else { + opBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder clearOp() { + if (opBuilder_ == null) { + op_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + opBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public Builder removeOp(int index) { + if (opBuilder_ == null) { + ensureOpIsMutable(); + op_.remove(index); + onChanged(); + } else { + opBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public org.tensorflow.proto.OpDef.Builder getOpBuilder( + int index) { + return getOpFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public org.tensorflow.proto.OpDefOrBuilder getOpOrBuilder( + int index) { + if (opBuilder_ == null) { + return op_.get(index); } else { + return opBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public java.util.List + getOpOrBuilderList() { + if (opBuilder_ != null) { + return opBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(op_); + } + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public org.tensorflow.proto.OpDef.Builder addOpBuilder() { + return getOpFieldBuilder().addBuilder( + org.tensorflow.proto.OpDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public org.tensorflow.proto.OpDef.Builder addOpBuilder( + int index) { + return getOpFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpDef.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpDef op = 1; + */ + public java.util.List + getOpBuilderList() { + return getOpFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder> + getOpFieldBuilder() { + if (opBuilder_ == null) { + opBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpDef, org.tensorflow.proto.OpDef.Builder, org.tensorflow.proto.OpDefOrBuilder>( + op_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + op_ = null; + } + return opBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpList) + private static final org.tensorflow.proto.OpList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpList(); + } + + public static org.tensorflow.proto.OpList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpListOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpListOrBuilder.java new file mode 100644 index 00000000000..5e13bc021f6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpListOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/op_def.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface OpListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.OpDef op = 1; + */ + java.util.List + getOpList(); + /** + * repeated .tensorflow.OpDef op = 1; + */ + org.tensorflow.proto.OpDef getOp(int index); + /** + * repeated .tensorflow.OpDef op = 1; + */ + int getOpCount(); + /** + * repeated .tensorflow.OpDef op = 1; + */ + java.util.List + getOpOrBuilderList(); + /** + * repeated .tensorflow.OpDef op = 1; + */ + org.tensorflow.proto.OpDefOrBuilder getOpOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpPerformanceData.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpPerformanceData.java new file mode 100644 index 00000000000..a6c88007b41 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OpPerformanceData.java @@ -0,0 +1,8981 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/grappler/costs/op_performance_data.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class OpPerformanceData { + private OpPerformanceData() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpPerformanceData.class.getName()); + } + 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 SessionInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SessionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 intra_op_parallelism = 1; + * @return The intraOpParallelism. + */ + long getIntraOpParallelism(); + } + /** + *
    +   * Description of the session when an op is run.
    +   * 
    + * + * Protobuf type {@code tensorflow.SessionInfo} + */ + public static final class SessionInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SessionInfo) + SessionInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SessionInfo.class.getName()); + } + // Use SessionInfo.newBuilder() to construct. + private SessionInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SessionInfo() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_SessionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_SessionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.SessionInfo.class, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder.class); + } + + public static final int INTRA_OP_PARALLELISM_FIELD_NUMBER = 1; + private long intraOpParallelism_ = 0L; + /** + * int64 intra_op_parallelism = 1; + * @return The intraOpParallelism. + */ + @java.lang.Override + public long getIntraOpParallelism() { + return intraOpParallelism_; + } + + 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 (intraOpParallelism_ != 0L) { + output.writeInt64(1, intraOpParallelism_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (intraOpParallelism_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, intraOpParallelism_); + } + size += getUnknownFields().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.OpPerformanceData.SessionInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.SessionInfo other = (org.tensorflow.proto.OpPerformanceData.SessionInfo) obj; + + if (getIntraOpParallelism() + != other.getIntraOpParallelism()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INTRA_OP_PARALLELISM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIntraOpParallelism()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo 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.OpPerformanceData.SessionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo 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.OpPerformanceData.SessionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.SessionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.SessionInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Description of the session when an op is run.
    +     * 
    + * + * Protobuf type {@code tensorflow.SessionInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SessionInfo) + org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_SessionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_SessionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.SessionInfo.class, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.SessionInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + intraOpParallelism_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_SessionInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.SessionInfo getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.SessionInfo build() { + org.tensorflow.proto.OpPerformanceData.SessionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.SessionInfo buildPartial() { + org.tensorflow.proto.OpPerformanceData.SessionInfo result = new org.tensorflow.proto.OpPerformanceData.SessionInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.SessionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.intraOpParallelism_ = intraOpParallelism_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.SessionInfo) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.SessionInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.SessionInfo other) { + if (other == org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance()) return this; + if (other.getIntraOpParallelism() != 0L) { + setIntraOpParallelism(other.getIntraOpParallelism()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + intraOpParallelism_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long intraOpParallelism_ ; + /** + * int64 intra_op_parallelism = 1; + * @return The intraOpParallelism. + */ + @java.lang.Override + public long getIntraOpParallelism() { + return intraOpParallelism_; + } + /** + * int64 intra_op_parallelism = 1; + * @param value The intraOpParallelism to set. + * @return This builder for chaining. + */ + public Builder setIntraOpParallelism(long value) { + + intraOpParallelism_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 intra_op_parallelism = 1; + * @return This builder for chaining. + */ + public Builder clearIntraOpParallelism() { + bitField0_ = (bitField0_ & ~0x00000001); + intraOpParallelism_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SessionInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SessionInfo) + private static final org.tensorflow.proto.OpPerformanceData.SessionInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.SessionInfo(); + } + + public static org.tensorflow.proto.OpPerformanceData.SessionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.SessionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OpInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * 
    + * + * string op = 1; + * @return The op. + */ + java.lang.String getOp(); + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * 
    + * + * string op = 1; + * @return The bytes for op. + */ + com.google.protobuf.ByteString + getOpBytes(); + + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + int getAttrCount(); + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + boolean containsAttr( + java.lang.String key); + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAttr(); + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + java.util.Map + getAttrMap(); + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue); + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key); + + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + java.util.List + getInputsList(); + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getInputs(int index); + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + int getInputsCount(); + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + java.util.List + getInputsOrBuilderList(); + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( + int index); + + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + java.util.List + getOutputsList(); + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getOutputs(int index); + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + int getOutputsCount(); + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + java.util.List + getOutputsOrBuilderList(); + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( + int index); + + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return Whether the device field is set. + */ + boolean hasDevice(); + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return The device. + */ + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getDevice(); + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getDeviceOrBuilder(); + + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return Whether the sessionInfo field is set. + */ + boolean hasSessionInfo(); + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return The sessionInfo. + */ + org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo(); + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder(); + } + /** + *
    +   * Description of an operation as well as the parameters expected to impact its
    +   * performance.
    +   * 
    + * + * Protobuf type {@code tensorflow.OpInfo} + */ + public static final class OpInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpInfo) + OpInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpInfo.class.getName()); + } + // Use OpInfo.newBuilder() to construct. + private OpInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpInfo() { + op_ = ""; + inputs_ = java.util.Collections.emptyList(); + outputs_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpInfo.class, org.tensorflow.proto.OpPerformanceData.OpInfo.Builder.class); + } + + public interface TensorPropertiesOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpInfo.TensorProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * .tensorflow.TensorProto value = 3; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * .tensorflow.TensorProto value = 3; + * @return The value. + */ + org.tensorflow.proto.TensorProto getValue(); + /** + * .tensorflow.TensorProto value = 3; + */ + org.tensorflow.proto.TensorProtoOrBuilder getValueOrBuilder(); + } + /** + *
    +     * Input data types, shapes and values if known.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpInfo.TensorProperties} + */ + public static final class TensorProperties extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpInfo.TensorProperties) + TensorPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorProperties.class.getName()); + } + // Use TensorProperties.newBuilder() to construct. + private TensorProperties(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorProperties() { + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.class, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int VALUE_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorProto value_; + /** + * .tensorflow.TensorProto value = 3; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorProto value = 3; + * @return The value. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getValue() { + return value_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : value_; + } + /** + * .tensorflow.TensorProto value = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getValueOrBuilder() { + return value_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : value_; + } + + 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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getValue()); + } + size += getUnknownFields().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.OpPerformanceData.OpInfo.TensorProperties)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties other = (org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue() + .equals(other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties 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.OpPerformanceData.OpInfo.TensorProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties 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.OpPerformanceData.OpInfo.TensorProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.OpInfo.TensorProperties 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Input data types, shapes and values if known.
    +       * 
    + * + * Protobuf type {@code tensorflow.OpInfo.TensorProperties} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpInfo.TensorProperties) + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.class, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getValueFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_TensorProperties_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties build() { + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties buildPartial() { + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties result = new org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.value_ = valueBuilder_ == null + ? value_ + : valueBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties other) { + if (other == org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private org.tensorflow.proto.TensorProto value_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> valueBuilder_; + /** + * .tensorflow.TensorProto value = 3; + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.TensorProto value = 3; + * @return The value. + */ + public org.tensorflow.proto.TensorProto getValue() { + if (valueBuilder_ == null) { + return value_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorProto value = 3; + */ + public Builder setValue(org.tensorflow.proto.TensorProto value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + } else { + valueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto value = 3; + */ + public Builder setValue( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto value = 3; + */ + public Builder mergeValue(org.tensorflow.proto.TensorProto value) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + value_ != null && + value_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getValueBuilder().mergeFrom(value); + } else { + value_ = value; + } + } else { + valueBuilder_.mergeFrom(value); + } + if (value_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorProto value = 3; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000004); + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto value = 3; + */ + public org.tensorflow.proto.TensorProto.Builder getValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorProto value = 3; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : value_; + } + } + /** + * .tensorflow.TensorProto value = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getValue(), + getParentForChildren(), + isClean()); + value_ = null; + } + return valueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpInfo.TensorProperties) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpInfo.TensorProperties) + private static final org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties(); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.OpInfo.TensorProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int OP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object op_ = ""; + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * 
    + * + * string op = 1; + * @return The op. + */ + @java.lang.Override + public java.lang.String getOp() { + java.lang.Object ref = op_; + 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(); + op_ = s; + return s; + } + } + /** + *
    +     * The operation name.  There may be custom parameters in attrs.
    +     * 
    + * + * string op = 1; + * @return The bytes for op. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTR_FIELD_NUMBER = 2; + private static final class AttrDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_AttrEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> attr_; + private com.google.protobuf.MapField + internalGetAttr() { + if (attr_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttrDefaultEntryHolder.defaultEntry); + } + return attr_; + } + public int getAttrCount() { + return internalGetAttr().getMap().size(); + } + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().getMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getMap(); + } + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Custom parameters impacting the behavior of the op.
    +     * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttr().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int INPUTS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List inputs_; + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + @java.lang.Override + public java.util.List getInputsList() { + return inputs_; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + @java.lang.Override + public java.util.List + getInputsOrBuilderList() { + return inputs_; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + @java.lang.Override + public int getInputsCount() { + return inputs_.size(); + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getInputs(int index) { + return inputs_.get(index); + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( + int index) { + return inputs_.get(index); + } + + public static final int OUTPUTS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List outputs_; + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + @java.lang.Override + public java.util.List getOutputsList() { + return outputs_; + } + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + @java.lang.Override + public java.util.List + getOutputsOrBuilderList() { + return outputs_; + } + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + @java.lang.Override + public int getOutputsCount() { + return outputs_.size(); + } + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getOutputs(int index) { + return outputs_.get(index); + } + /** + *
    +     * Optional description of the op outputs
    +     * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( + int index) { + return outputs_.get(index); + } + + public static final int DEVICE_FIELD_NUMBER = 4; + private org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties device_; + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return Whether the device field is set. + */ + @java.lang.Override + public boolean hasDevice() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return The device. + */ + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getDevice() { + return device_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : device_; + } + /** + *
    +     * Device on which the operation is run.
    +     * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + @java.lang.Override + public org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getDeviceOrBuilder() { + return device_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : device_; + } + + public static final int SESSION_INFO_FIELD_NUMBER = 6; + private org.tensorflow.proto.OpPerformanceData.SessionInfo sessionInfo_; + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return Whether the sessionInfo field is set. + */ + @java.lang.Override + public boolean hasSessionInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return The sessionInfo. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo() { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder() { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, op_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAttr(), + AttrDefaultEntryHolder.defaultEntry, + 2); + for (int i = 0; i < inputs_.size(); i++) { + output.writeMessage(3, inputs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getDevice()); + } + for (int i = 0; i < outputs_.size(); i++) { + output.writeMessage(5, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getSessionInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(op_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, op_); + } + for (java.util.Map.Entry entry + : internalGetAttr().getMap().entrySet()) { + com.google.protobuf.MapEntry + attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attr__); + } + for (int i = 0; i < inputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, inputs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getDevice()); + } + for (int i = 0; i < outputs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, outputs_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSessionInfo()); + } + size += getUnknownFields().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.OpPerformanceData.OpInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.OpInfo other = (org.tensorflow.proto.OpPerformanceData.OpInfo) obj; + + if (!getOp() + .equals(other.getOp())) return false; + if (!internalGetAttr().equals( + other.internalGetAttr())) return false; + if (!getInputsList() + .equals(other.getInputsList())) return false; + if (!getOutputsList() + .equals(other.getOutputsList())) return false; + if (hasDevice() != other.hasDevice()) return false; + if (hasDevice()) { + if (!getDevice() + .equals(other.getDevice())) return false; + } + if (hasSessionInfo() != other.hasSessionInfo()) return false; + if (hasSessionInfo()) { + if (!getSessionInfo() + .equals(other.getSessionInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOp().hashCode(); + if (!internalGetAttr().getMap().isEmpty()) { + hash = (37 * hash) + ATTR_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttr().hashCode(); + } + if (getInputsCount() > 0) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputsList().hashCode(); + } + if (getOutputsCount() > 0) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + getOutputsList().hashCode(); + } + if (hasDevice()) { + hash = (37 * hash) + DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + } + if (hasSessionInfo()) { + hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSessionInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo 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.OpPerformanceData.OpInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo 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.OpPerformanceData.OpInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.OpInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Description of an operation as well as the parameters expected to impact its
    +     * performance.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpInfo) + org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableAttr(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpInfo.class, org.tensorflow.proto.OpPerformanceData.OpInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.OpInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getInputsFieldBuilder(); + getOutputsFieldBuilder(); + getDeviceFieldBuilder(); + getSessionInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + op_ = ""; + internalGetMutableAttr().clear(); + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + } else { + inputs_ = null; + inputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + } else { + outputs_ = null; + outputsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + device_ = null; + if (deviceBuilder_ != null) { + deviceBuilder_.dispose(); + deviceBuilder_ = null; + } + sessionInfo_ = null; + if (sessionInfoBuilder_ != null) { + sessionInfoBuilder_.dispose(); + sessionInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo build() { + org.tensorflow.proto.OpPerformanceData.OpInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo buildPartial() { + org.tensorflow.proto.OpPerformanceData.OpInfo result = new org.tensorflow.proto.OpPerformanceData.OpInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OpPerformanceData.OpInfo result) { + if (inputsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + inputs_ = java.util.Collections.unmodifiableList(inputs_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.inputs_ = inputs_; + } else { + result.inputs_ = inputsBuilder_.build(); + } + if (outputsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + outputs_ = java.util.Collections.unmodifiableList(outputs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.outputs_ = outputs_; + } else { + result.outputs_ = outputsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.OpInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.op_ = op_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attr_ = internalGetAttr().build(AttrDefaultEntryHolder.defaultEntry); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.device_ = deviceBuilder_ == null + ? device_ + : deviceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sessionInfo_ = sessionInfoBuilder_ == null + ? sessionInfo_ + : sessionInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.OpInfo) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.OpInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.OpInfo other) { + if (other == org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance()) return this; + if (!other.getOp().isEmpty()) { + op_ = other.op_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableAttr().mergeFrom( + other.internalGetAttr()); + bitField0_ |= 0x00000002; + if (inputsBuilder_ == null) { + if (!other.inputs_.isEmpty()) { + if (inputs_.isEmpty()) { + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureInputsIsMutable(); + inputs_.addAll(other.inputs_); + } + onChanged(); + } + } else { + if (!other.inputs_.isEmpty()) { + if (inputsBuilder_.isEmpty()) { + inputsBuilder_.dispose(); + inputsBuilder_ = null; + inputs_ = other.inputs_; + bitField0_ = (bitField0_ & ~0x00000004); + inputsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getInputsFieldBuilder() : null; + } else { + inputsBuilder_.addAllMessages(other.inputs_); + } + } + } + if (outputsBuilder_ == null) { + if (!other.outputs_.isEmpty()) { + if (outputs_.isEmpty()) { + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureOutputsIsMutable(); + outputs_.addAll(other.outputs_); + } + onChanged(); + } + } else { + if (!other.outputs_.isEmpty()) { + if (outputsBuilder_.isEmpty()) { + outputsBuilder_.dispose(); + outputsBuilder_ = null; + outputs_ = other.outputs_; + bitField0_ = (bitField0_ & ~0x00000008); + outputsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOutputsFieldBuilder() : null; + } else { + outputsBuilder_.addAllMessages(other.outputs_); + } + } + } + if (other.hasDevice()) { + mergeDevice(other.getDevice()); + } + if (other.hasSessionInfo()) { + mergeSessionInfo(other.getSessionInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + op_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + attr__ = input.readMessage( + AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAttr().ensureBuilderMap().put( + attr__.getKey(), attr__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties m = + input.readMessage( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.parser(), + extensionRegistry); + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(m); + } else { + inputsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + input.readMessage( + getDeviceFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: { + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties m = + input.readMessage( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.parser(), + extensionRegistry); + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(m); + } else { + outputsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + input.readMessage( + getSessionInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object op_ = ""; + /** + *
    +       * The operation name.  There may be custom parameters in attrs.
    +       * 
    + * + * string op = 1; + * @return The op. + */ + public java.lang.String getOp() { + java.lang.Object ref = op_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + op_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The operation name.  There may be custom parameters in attrs.
    +       * 
    + * + * string op = 1; + * @return The bytes for op. + */ + public com.google.protobuf.ByteString + getOpBytes() { + java.lang.Object ref = op_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + op_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The operation name.  There may be custom parameters in attrs.
    +       * 
    + * + * string op = 1; + * @param value The op to set. + * @return This builder for chaining. + */ + public Builder setOp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + op_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The operation name.  There may be custom parameters in attrs.
    +       * 
    + * + * string op = 1; + * @return This builder for chaining. + */ + public Builder clearOp() { + op_ = getDefaultInstance().getOp(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * The operation name.  There may be custom parameters in attrs.
    +       * 
    + * + * string op = 1; + * @param value The bytes for op to set. + * @return This builder for chaining. + */ + public Builder setOpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + op_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class AttrConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AttrDefaultEntryHolder.defaultEntry; + } + }; + private static final AttrConverter attrConverter = new AttrConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> attr_; + private com.google.protobuf.MapFieldBuilder + internalGetAttr() { + if (attr_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + return attr_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAttr() { + if (attr_ == null) { + attr_ = new com.google.protobuf.MapFieldBuilder<>(attrConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return attr_; + } + public int getAttrCount() { + return internalGetAttr().ensureBuilderMap().size(); + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public boolean containsAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttr().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAttrMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAttr() { + return getAttrMap(); + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public java.util.Map getAttrMap() { + return internalGetAttr().getImmutableMap(); + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getAttrOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + return map.containsKey(key) ? attrConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getAttrOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAttr().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return attrConverter.build(map.get(key)); + } + public Builder clearAttr() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableAttr().clear(); + return this; + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder removeAttr( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttr().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAttr() { + bitField0_ |= 0x00000002; + return internalGetMutableAttr().ensureMessageMap(); + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder putAttr( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAttr().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public Builder putAllAttr( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAttr().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Custom parameters impacting the behavior of the op.
    +       * 
    + * + * map<string, .tensorflow.AttrValue> attr = 2; + */ + public org.tensorflow.proto.AttrValue.Builder putAttrBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAttr().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + private java.util.List inputs_ = + java.util.Collections.emptyList(); + private void ensureInputsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + inputs_ = new java.util.ArrayList(inputs_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder> inputsBuilder_; + + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public java.util.List getInputsList() { + if (inputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inputs_); + } else { + return inputsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public int getInputsCount() { + if (inputsBuilder_ == null) { + return inputs_.size(); + } else { + return inputsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getInputs(int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); + } else { + return inputsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder setInputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.set(index, value); + onChanged(); + } else { + inputsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder setInputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.set(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder addInputs(org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(value); + onChanged(); + } else { + inputsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder addInputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (inputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInputsIsMutable(); + inputs_.add(index, value); + onChanged(); + } else { + inputsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder addInputs( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder addInputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.add(index, builderForValue.build()); + onChanged(); + } else { + inputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder addAllInputs( + java.lang.Iterable values) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputs_); + onChanged(); + } else { + inputsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder clearInputs() { + if (inputsBuilder_ == null) { + inputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + inputsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public Builder removeInputs(int index) { + if (inputsBuilder_ == null) { + ensureInputsIsMutable(); + inputs_.remove(index); + onChanged(); + } else { + inputsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder getInputsBuilder( + int index) { + return getInputsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getInputsOrBuilder( + int index) { + if (inputsBuilder_ == null) { + return inputs_.get(index); } else { + return inputsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public java.util.List + getInputsOrBuilderList() { + if (inputsBuilder_ != null) { + return inputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inputs_); + } + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder addInputsBuilder() { + return getInputsFieldBuilder().addBuilder( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder addInputsBuilder( + int index) { + return getInputsFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpInfo.TensorProperties inputs = 3; + */ + public java.util.List + getInputsBuilderList() { + return getInputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder> + getInputsFieldBuilder() { + if (inputsBuilder_ == null) { + inputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder>( + inputs_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + inputs_ = null; + } + return inputsBuilder_; + } + + private java.util.List outputs_ = + java.util.Collections.emptyList(); + private void ensureOutputsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + outputs_ = new java.util.ArrayList(outputs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder> outputsBuilder_; + + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public java.util.List getOutputsList() { + if (outputsBuilder_ == null) { + return java.util.Collections.unmodifiableList(outputs_); + } else { + return outputsBuilder_.getMessageList(); + } + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public int getOutputsCount() { + if (outputsBuilder_ == null) { + return outputs_.size(); + } else { + return outputsBuilder_.getCount(); + } + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties getOutputs(int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); + } else { + return outputsBuilder_.getMessage(index); + } + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder setOutputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.set(index, value); + onChanged(); + } else { + outputsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder setOutputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.set(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder addOutputs(org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(value); + onChanged(); + } else { + outputsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder addOutputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties value) { + if (outputsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOutputsIsMutable(); + outputs_.add(index, value); + onChanged(); + } else { + outputsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder addOutputs( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder addOutputs( + int index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder builderForValue) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.add(index, builderForValue.build()); + onChanged(); + } else { + outputsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder addAllOutputs( + java.lang.Iterable values) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputs_); + onChanged(); + } else { + outputsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder clearOutputs() { + if (outputsBuilder_ == null) { + outputs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + outputsBuilder_.clear(); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public Builder removeOutputs(int index) { + if (outputsBuilder_ == null) { + ensureOutputsIsMutable(); + outputs_.remove(index); + onChanged(); + } else { + outputsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder getOutputsBuilder( + int index) { + return getOutputsFieldBuilder().getBuilder(index); + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder getOutputsOrBuilder( + int index) { + if (outputsBuilder_ == null) { + return outputs_.get(index); } else { + return outputsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public java.util.List + getOutputsOrBuilderList() { + if (outputsBuilder_ != null) { + return outputsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(outputs_); + } + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder addOutputsBuilder() { + return getOutputsFieldBuilder().addBuilder( + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance()); + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder addOutputsBuilder( + int index) { + return getOutputsFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.getDefaultInstance()); + } + /** + *
    +       * Optional description of the op outputs
    +       * 
    + * + * repeated .tensorflow.OpInfo.TensorProperties outputs = 5; + */ + public java.util.List + getOutputsBuilderList() { + return getOutputsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder> + getOutputsFieldBuilder() { + if (outputsBuilder_ == null) { + outputsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorProperties.Builder, org.tensorflow.proto.OpPerformanceData.OpInfo.TensorPropertiesOrBuilder>( + outputs_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + outputs_ = null; + } + return outputsBuilder_; + } + + private org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties device_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder> deviceBuilder_; + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return Whether the device field is set. + */ + public boolean hasDevice() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + * @return The device. + */ + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties getDevice() { + if (deviceBuilder_ == null) { + return device_ == null ? org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : device_; + } else { + return deviceBuilder_.getMessage(); + } + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public Builder setDevice(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties value) { + if (deviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + device_ = value; + } else { + deviceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public Builder setDevice( + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder builderForValue) { + if (deviceBuilder_ == null) { + device_ = builderForValue.build(); + } else { + deviceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public Builder mergeDevice(org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties value) { + if (deviceBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + device_ != null && + device_ != org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance()) { + getDeviceBuilder().mergeFrom(value); + } else { + device_ = value; + } + } else { + deviceBuilder_.mergeFrom(value); + } + if (device_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public Builder clearDevice() { + bitField0_ = (bitField0_ & ~0x00000010); + device_ = null; + if (deviceBuilder_ != null) { + deviceBuilder_.dispose(); + deviceBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder getDeviceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDeviceFieldBuilder().getBuilder(); + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + public org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder getDeviceOrBuilder() { + if (deviceBuilder_ != null) { + return deviceBuilder_.getMessageOrBuilder(); + } else { + return device_ == null ? + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.getDefaultInstance() : device_; + } + } + /** + *
    +       * Device on which the operation is run.
    +       * 
    + * + * .tensorflow.DeviceProperties device = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder> + getDeviceFieldBuilder() { + if (deviceBuilder_ == null) { + deviceBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties, org.tensorflow.proto.DevicePropertiesProtos.DeviceProperties.Builder, org.tensorflow.proto.DevicePropertiesProtos.DevicePropertiesOrBuilder>( + getDevice(), + getParentForChildren(), + isClean()); + device_ = null; + } + return deviceBuilder_; + } + + private org.tensorflow.proto.OpPerformanceData.SessionInfo sessionInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder> sessionInfoBuilder_; + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return Whether the sessionInfo field is set. + */ + public boolean hasSessionInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + * @return The sessionInfo. + */ + public org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo() { + if (sessionInfoBuilder_ == null) { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } else { + return sessionInfoBuilder_.getMessage(); + } + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public Builder setSessionInfo(org.tensorflow.proto.OpPerformanceData.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionInfo_ = value; + } else { + sessionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public Builder setSessionInfo( + org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder builderForValue) { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = builderForValue.build(); + } else { + sessionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public Builder mergeSessionInfo(org.tensorflow.proto.OpPerformanceData.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + sessionInfo_ != null && + sessionInfo_ != org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance()) { + getSessionInfoBuilder().mergeFrom(value); + } else { + sessionInfo_ = value; + } + } else { + sessionInfoBuilder_.mergeFrom(value); + } + if (sessionInfo_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public Builder clearSessionInfo() { + bitField0_ = (bitField0_ & ~0x00000020); + sessionInfo_ = null; + if (sessionInfoBuilder_ != null) { + sessionInfoBuilder_.dispose(); + sessionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder getSessionInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSessionInfoFieldBuilder().getBuilder(); + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + public org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder() { + if (sessionInfoBuilder_ != null) { + return sessionInfoBuilder_.getMessageOrBuilder(); + } else { + return sessionInfo_ == null ? + org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder> + getSessionInfoFieldBuilder() { + if (sessionInfoBuilder_ == null) { + sessionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder>( + getSessionInfo(), + getParentForChildren(), + isClean()); + sessionInfo_ = null; + } + return sessionInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpInfo) + private static final org.tensorflow.proto.OpPerformanceData.OpInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.OpInfo(); + } + + public static org.tensorflow.proto.OpPerformanceData.OpInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.OpInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NormalDistributionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NormalDistribution) + com.google.protobuf.MessageOrBuilder { + + /** + * double mu = 1; + * @return The mu. + */ + double getMu(); + + /** + * double sigma = 2; + * @return The sigma. + */ + double getSigma(); + } + /** + * Protobuf type {@code tensorflow.NormalDistribution} + */ + public static final class NormalDistribution extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NormalDistribution) + NormalDistributionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NormalDistribution.class.getName()); + } + // Use NormalDistribution.newBuilder() to construct. + private NormalDistribution(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NormalDistribution() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_NormalDistribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_NormalDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.NormalDistribution.class, org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder.class); + } + + public static final int MU_FIELD_NUMBER = 1; + private double mu_ = 0D; + /** + * double mu = 1; + * @return The mu. + */ + @java.lang.Override + public double getMu() { + return mu_; + } + + public static final int SIGMA_FIELD_NUMBER = 2; + private double sigma_ = 0D; + /** + * double sigma = 2; + * @return The sigma. + */ + @java.lang.Override + public double getSigma() { + return sigma_; + } + + 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 (java.lang.Double.doubleToRawLongBits(mu_) != 0) { + output.writeDouble(1, mu_); + } + if (java.lang.Double.doubleToRawLongBits(sigma_) != 0) { + output.writeDouble(2, sigma_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(mu_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, mu_); + } + if (java.lang.Double.doubleToRawLongBits(sigma_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, sigma_); + } + size += getUnknownFields().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.OpPerformanceData.NormalDistribution)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.NormalDistribution other = (org.tensorflow.proto.OpPerformanceData.NormalDistribution) obj; + + if (java.lang.Double.doubleToLongBits(getMu()) + != java.lang.Double.doubleToLongBits( + other.getMu())) return false; + if (java.lang.Double.doubleToLongBits(getSigma()) + != java.lang.Double.doubleToLongBits( + other.getSigma())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MU_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMu())); + hash = (37 * hash) + SIGMA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSigma())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution 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.OpPerformanceData.NormalDistribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution 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.OpPerformanceData.NormalDistribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.NormalDistribution 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.NormalDistribution} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NormalDistribution) + org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_NormalDistribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_NormalDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.NormalDistribution.class, org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.NormalDistribution.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mu_ = 0D; + sigma_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_NormalDistribution_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistribution getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistribution build() { + org.tensorflow.proto.OpPerformanceData.NormalDistribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistribution buildPartial() { + org.tensorflow.proto.OpPerformanceData.NormalDistribution result = new org.tensorflow.proto.OpPerformanceData.NormalDistribution(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.NormalDistribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mu_ = mu_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sigma_ = sigma_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.NormalDistribution) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.NormalDistribution)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.NormalDistribution other) { + if (other == org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance()) return this; + if (other.getMu() != 0D) { + setMu(other.getMu()); + } + if (other.getSigma() != 0D) { + setSigma(other.getSigma()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + mu_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 17: { + sigma_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double mu_ ; + /** + * double mu = 1; + * @return The mu. + */ + @java.lang.Override + public double getMu() { + return mu_; + } + /** + * double mu = 1; + * @param value The mu to set. + * @return This builder for chaining. + */ + public Builder setMu(double value) { + + mu_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double mu = 1; + * @return This builder for chaining. + */ + public Builder clearMu() { + bitField0_ = (bitField0_ & ~0x00000001); + mu_ = 0D; + onChanged(); + return this; + } + + private double sigma_ ; + /** + * double sigma = 2; + * @return The sigma. + */ + @java.lang.Override + public double getSigma() { + return sigma_; + } + /** + * double sigma = 2; + * @param value The sigma to set. + * @return This builder for chaining. + */ + public Builder setSigma(double value) { + + sigma_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * double sigma = 2; + * @return This builder for chaining. + */ + public Builder clearSigma() { + bitField0_ = (bitField0_ & ~0x00000002); + sigma_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NormalDistribution) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NormalDistribution) + private static final org.tensorflow.proto.OpPerformanceData.NormalDistribution DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.NormalDistribution(); + } + + public static org.tensorflow.proto.OpPerformanceData.NormalDistribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalDistribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.NormalDistribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LogNormalDistributionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.LogNormalDistribution) + com.google.protobuf.MessageOrBuilder { + + /** + * double mu = 1; + * @return The mu. + */ + double getMu(); + + /** + * double sigma = 2; + * @return The sigma. + */ + double getSigma(); + } + /** + * Protobuf type {@code tensorflow.LogNormalDistribution} + */ + public static final class LogNormalDistribution extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.LogNormalDistribution) + LogNormalDistributionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LogNormalDistribution.class.getName()); + } + // Use LogNormalDistribution.newBuilder() to construct. + private LogNormalDistribution(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LogNormalDistribution() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_LogNormalDistribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.class, org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder.class); + } + + public static final int MU_FIELD_NUMBER = 1; + private double mu_ = 0D; + /** + * double mu = 1; + * @return The mu. + */ + @java.lang.Override + public double getMu() { + return mu_; + } + + public static final int SIGMA_FIELD_NUMBER = 2; + private double sigma_ = 0D; + /** + * double sigma = 2; + * @return The sigma. + */ + @java.lang.Override + public double getSigma() { + return sigma_; + } + + 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 (java.lang.Double.doubleToRawLongBits(mu_) != 0) { + output.writeDouble(1, mu_); + } + if (java.lang.Double.doubleToRawLongBits(sigma_) != 0) { + output.writeDouble(2, sigma_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(mu_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, mu_); + } + if (java.lang.Double.doubleToRawLongBits(sigma_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, sigma_); + } + size += getUnknownFields().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.OpPerformanceData.LogNormalDistribution)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution other = (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) obj; + + if (java.lang.Double.doubleToLongBits(getMu()) + != java.lang.Double.doubleToLongBits( + other.getMu())) return false; + if (java.lang.Double.doubleToLongBits(getSigma()) + != java.lang.Double.doubleToLongBits( + other.getSigma())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + MU_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMu())); + hash = (37 * hash) + SIGMA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSigma())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution 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.OpPerformanceData.LogNormalDistribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution 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.OpPerformanceData.LogNormalDistribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.LogNormalDistribution 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.LogNormalDistribution} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.LogNormalDistribution) + org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_LogNormalDistribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.class, org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mu_ = 0D; + sigma_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_LogNormalDistribution_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution build() { + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution buildPartial() { + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution result = new org.tensorflow.proto.OpPerformanceData.LogNormalDistribution(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.LogNormalDistribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mu_ = mu_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sigma_ = sigma_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.LogNormalDistribution)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.LogNormalDistribution other) { + if (other == org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance()) return this; + if (other.getMu() != 0D) { + setMu(other.getMu()); + } + if (other.getSigma() != 0D) { + setSigma(other.getSigma()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: { + mu_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 17: { + sigma_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private double mu_ ; + /** + * double mu = 1; + * @return The mu. + */ + @java.lang.Override + public double getMu() { + return mu_; + } + /** + * double mu = 1; + * @param value The mu to set. + * @return This builder for chaining. + */ + public Builder setMu(double value) { + + mu_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double mu = 1; + * @return This builder for chaining. + */ + public Builder clearMu() { + bitField0_ = (bitField0_ & ~0x00000001); + mu_ = 0D; + onChanged(); + return this; + } + + private double sigma_ ; + /** + * double sigma = 2; + * @return The sigma. + */ + @java.lang.Override + public double getSigma() { + return sigma_; + } + /** + * double sigma = 2; + * @param value The sigma to set. + * @return This builder for chaining. + */ + public Builder setSigma(double value) { + + sigma_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * double sigma = 2; + * @return This builder for chaining. + */ + public Builder clearSigma() { + bitField0_ = (bitField0_ & ~0x00000002); + sigma_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.LogNormalDistribution) + } + + // @@protoc_insertion_point(class_scope:tensorflow.LogNormalDistribution) + private static final org.tensorflow.proto.OpPerformanceData.LogNormalDistribution DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.LogNormalDistribution(); + } + + public static org.tensorflow.proto.OpPerformanceData.LogNormalDistribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogNormalDistribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.LogNormalDistribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OpPerformanceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformance) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + * @return Whether the op field is set. + */ + boolean hasOp(); + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + * @return The op. + */ + org.tensorflow.proto.OpPerformanceData.OpInfo getOp(); + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + */ + org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder getOpOrBuilder(); + + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return Whether the sessionInfo field is set. + */ + @java.lang.Deprecated boolean hasSessionInfo(); + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return The sessionInfo. + */ + @java.lang.Deprecated org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo(); + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder(); + + /** + *
    +     * The node name (optional). Makes it easier to associate the performance data
    +     * with a specific graph node.
    +     * 
    + * + * string node = 5; + * @return The node. + */ + java.lang.String getNode(); + /** + *
    +     * The node name (optional). Makes it easier to associate the performance data
    +     * with a specific graph node.
    +     * 
    + * + * string node = 5; + * @return The bytes for node. + */ + com.google.protobuf.ByteString + getNodeBytes(); + + /** + *
    +     * Temporary memory used by this node (in bytes).
    +     * 
    + * + * int64 temporary_memory_size = 2; + * @return The temporaryMemorySize. + */ + long getTemporaryMemorySize(); + + /** + *
    +     * Time it takes to run the op (in nanoseconds).
    +     * 
    + * + * int64 compute_cost = 3; + * @return The computeCost. + */ + long getComputeCost(); + + /** + *
    +     * Analytical compute cost (in nanoseconds).
    +     * 
    + * + * int64 compute_time = 6; + * @return The computeTime. + */ + long getComputeTime(); + + /** + *
    +     * Analytical memory access cost (in nanoseconds).
    +     * 
    + * + * int64 memory_time = 7; + * @return The memoryTime. + */ + long getMemoryTime(); + + /** + *
    +     * Percentage of theoretical compute performance.
    +     * 
    + * + * double compute_efficiency = 4; + * @return The computeEfficiency. + */ + double getComputeEfficiency(); + + /** + *
    +     * Percentage of theoretical memory performance.
    +     * 
    + * + * double memory_efficiency = 8; + * @return The memoryEfficiency. + */ + double getMemoryEfficiency(); + + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return Whether the executionTimeNormal field is set. + */ + boolean hasExecutionTimeNormal(); + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return The executionTimeNormal. + */ + org.tensorflow.proto.OpPerformanceData.NormalDistribution getExecutionTimeNormal(); + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder(); + + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return Whether the executionTimeLogNormal field is set. + */ + boolean hasExecutionTimeLogNormal(); + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return The executionTimeLogNormal. + */ + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution getExecutionTimeLogNormal(); + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder(); + + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return Whether the opMemory field is set. + */ + boolean hasOpMemory(); + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return The opMemory. + */ + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory getOpMemory(); + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder(); + + org.tensorflow.proto.OpPerformanceData.OpPerformance.ExecutionTimeCase getExecutionTimeCase(); + } + /** + *
    +   * Performance data for tensorflow operations
    +   * 
    + * + * Protobuf type {@code tensorflow.OpPerformance} + */ + public static final class OpPerformance extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpPerformance) + OpPerformanceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpPerformance.class.getName()); + } + // Use OpPerformance.newBuilder() to construct. + private OpPerformance(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpPerformance() { + node_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformance.class, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder.class); + } + + public interface OpMemoryOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformance.OpMemory) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @return A list containing the outputMemory. + */ + java.util.List getOutputMemoryList(); + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @return The count of outputMemory. + */ + int getOutputMemoryCount(); + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @param index The index of the element to return. + * @return The outputMemory at the given index. + */ + long getOutputMemory(int index); + + /** + *
    +       * Temp and persistent memory allocated by this node.
    +       * 
    + * + * int64 temp_memory = 2; + * @return The tempMemory. + */ + long getTempMemory(); + + /** + * int64 persistent_memory = 4; + * @return The persistentMemory. + */ + long getPersistentMemory(); + + /** + * int64 device_temp_memory = 3 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_temp_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=114 + * @return The deviceTempMemory. + */ + @java.lang.Deprecated long getDeviceTempMemory(); + + /** + * int64 device_persistent_memory = 5 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_persistent_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=115 + * @return The devicePersistentMemory. + */ + @java.lang.Deprecated long getDevicePersistentMemory(); + } + /** + *
    +     * Memory usage data for a tensorflow operation.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpPerformance.OpMemory} + */ + public static final class OpMemory extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpPerformance.OpMemory) + OpMemoryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpMemory.class.getName()); + } + // Use OpMemory.newBuilder() to construct. + private OpMemory(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpMemory() { + outputMemory_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.class, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder.class); + } + + public static final int OUTPUT_MEMORY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList outputMemory_ = + emptyLongList(); + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @return A list containing the outputMemory. + */ + @java.lang.Override + public java.util.List + getOutputMemoryList() { + return outputMemory_; + } + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @return The count of outputMemory. + */ + public int getOutputMemoryCount() { + return outputMemory_.size(); + } + /** + *
    +       * The output information may have memory usage and output shapes.
    +       * 
    + * + * repeated int64 output_memory = 1; + * @param index The index of the element to return. + * @return The outputMemory at the given index. + */ + public long getOutputMemory(int index) { + return outputMemory_.getLong(index); + } + private int outputMemoryMemoizedSerializedSize = -1; + + public static final int TEMP_MEMORY_FIELD_NUMBER = 2; + private long tempMemory_ = 0L; + /** + *
    +       * Temp and persistent memory allocated by this node.
    +       * 
    + * + * int64 temp_memory = 2; + * @return The tempMemory. + */ + @java.lang.Override + public long getTempMemory() { + return tempMemory_; + } + + public static final int PERSISTENT_MEMORY_FIELD_NUMBER = 4; + private long persistentMemory_ = 0L; + /** + * int64 persistent_memory = 4; + * @return The persistentMemory. + */ + @java.lang.Override + public long getPersistentMemory() { + return persistentMemory_; + } + + public static final int DEVICE_TEMP_MEMORY_FIELD_NUMBER = 3; + private long deviceTempMemory_ = 0L; + /** + * int64 device_temp_memory = 3 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_temp_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=114 + * @return The deviceTempMemory. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemory() { + return deviceTempMemory_; + } + + public static final int DEVICE_PERSISTENT_MEMORY_FIELD_NUMBER = 5; + private long devicePersistentMemory_ = 0L; + /** + * int64 device_persistent_memory = 5 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_persistent_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=115 + * @return The devicePersistentMemory. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemory() { + return devicePersistentMemory_; + } + + 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 { + getSerializedSize(); + if (getOutputMemoryList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(outputMemoryMemoizedSerializedSize); + } + for (int i = 0; i < outputMemory_.size(); i++) { + output.writeInt64NoTag(outputMemory_.getLong(i)); + } + if (tempMemory_ != 0L) { + output.writeInt64(2, tempMemory_); + } + if (deviceTempMemory_ != 0L) { + output.writeInt64(3, deviceTempMemory_); + } + if (persistentMemory_ != 0L) { + output.writeInt64(4, persistentMemory_); + } + if (devicePersistentMemory_ != 0L) { + output.writeInt64(5, devicePersistentMemory_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < outputMemory_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(outputMemory_.getLong(i)); + } + size += dataSize; + if (!getOutputMemoryList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + outputMemoryMemoizedSerializedSize = dataSize; + } + if (tempMemory_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, tempMemory_); + } + if (deviceTempMemory_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, deviceTempMemory_); + } + if (persistentMemory_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, persistentMemory_); + } + if (devicePersistentMemory_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, devicePersistentMemory_); + } + size += getUnknownFields().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.OpPerformanceData.OpPerformance.OpMemory)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory other = (org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory) obj; + + if (!getOutputMemoryList() + .equals(other.getOutputMemoryList())) return false; + if (getTempMemory() + != other.getTempMemory()) return false; + if (getPersistentMemory() + != other.getPersistentMemory()) return false; + if (getDeviceTempMemory() + != other.getDeviceTempMemory()) return false; + if (getDevicePersistentMemory() + != other.getDevicePersistentMemory()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOutputMemoryCount() > 0) { + hash = (37 * hash) + OUTPUT_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getOutputMemoryList().hashCode(); + } + hash = (37 * hash) + TEMP_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTempMemory()); + hash = (37 * hash) + PERSISTENT_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPersistentMemory()); + hash = (37 * hash) + DEVICE_TEMP_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDeviceTempMemory()); + hash = (37 * hash) + DEVICE_PERSISTENT_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDevicePersistentMemory()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory 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.OpPerformanceData.OpPerformance.OpMemory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory 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.OpPerformanceData.OpPerformance.OpMemory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.OpPerformance.OpMemory 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Memory usage data for a tensorflow operation.
    +       * 
    + * + * Protobuf type {@code tensorflow.OpPerformance.OpMemory} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformance.OpMemory) + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.class, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputMemory_ = emptyLongList(); + tempMemory_ = 0L; + persistentMemory_ = 0L; + deviceTempMemory_ = 0L; + devicePersistentMemory_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_OpMemory_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory build() { + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory buildPartial() { + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory result = new org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + outputMemory_.makeImmutable(); + result.outputMemory_ = outputMemory_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tempMemory_ = tempMemory_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.persistentMemory_ = persistentMemory_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.deviceTempMemory_ = deviceTempMemory_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.devicePersistentMemory_ = devicePersistentMemory_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory other) { + if (other == org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance()) return this; + if (!other.outputMemory_.isEmpty()) { + if (outputMemory_.isEmpty()) { + outputMemory_ = other.outputMemory_; + outputMemory_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureOutputMemoryIsMutable(); + outputMemory_.addAll(other.outputMemory_); + } + onChanged(); + } + if (other.getTempMemory() != 0L) { + setTempMemory(other.getTempMemory()); + } + if (other.getPersistentMemory() != 0L) { + setPersistentMemory(other.getPersistentMemory()); + } + if (other.getDeviceTempMemory() != 0L) { + setDeviceTempMemory(other.getDeviceTempMemory()); + } + if (other.getDevicePersistentMemory() != 0L) { + setDevicePersistentMemory(other.getDevicePersistentMemory()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + long v = input.readInt64(); + ensureOutputMemoryIsMutable(); + outputMemory_.addLong(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputMemoryIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputMemory_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 10 + case 16: { + tempMemory_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + deviceTempMemory_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 32: { + persistentMemory_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: { + devicePersistentMemory_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.LongList outputMemory_ = emptyLongList(); + private void ensureOutputMemoryIsMutable() { + if (!outputMemory_.isModifiable()) { + outputMemory_ = makeMutableCopy(outputMemory_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @return A list containing the outputMemory. + */ + public java.util.List + getOutputMemoryList() { + outputMemory_.makeImmutable(); + return outputMemory_; + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @return The count of outputMemory. + */ + public int getOutputMemoryCount() { + return outputMemory_.size(); + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @param index The index of the element to return. + * @return The outputMemory at the given index. + */ + public long getOutputMemory(int index) { + return outputMemory_.getLong(index); + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @param index The index to set the value at. + * @param value The outputMemory to set. + * @return This builder for chaining. + */ + public Builder setOutputMemory( + int index, long value) { + + ensureOutputMemoryIsMutable(); + outputMemory_.setLong(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @param value The outputMemory to add. + * @return This builder for chaining. + */ + public Builder addOutputMemory(long value) { + + ensureOutputMemoryIsMutable(); + outputMemory_.addLong(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @param values The outputMemory to add. + * @return This builder for chaining. + */ + public Builder addAllOutputMemory( + java.lang.Iterable values) { + ensureOutputMemoryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputMemory_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * The output information may have memory usage and output shapes.
    +         * 
    + * + * repeated int64 output_memory = 1; + * @return This builder for chaining. + */ + public Builder clearOutputMemory() { + outputMemory_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private long tempMemory_ ; + /** + *
    +         * Temp and persistent memory allocated by this node.
    +         * 
    + * + * int64 temp_memory = 2; + * @return The tempMemory. + */ + @java.lang.Override + public long getTempMemory() { + return tempMemory_; + } + /** + *
    +         * Temp and persistent memory allocated by this node.
    +         * 
    + * + * int64 temp_memory = 2; + * @param value The tempMemory to set. + * @return This builder for chaining. + */ + public Builder setTempMemory(long value) { + + tempMemory_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Temp and persistent memory allocated by this node.
    +         * 
    + * + * int64 temp_memory = 2; + * @return This builder for chaining. + */ + public Builder clearTempMemory() { + bitField0_ = (bitField0_ & ~0x00000002); + tempMemory_ = 0L; + onChanged(); + return this; + } + + private long persistentMemory_ ; + /** + * int64 persistent_memory = 4; + * @return The persistentMemory. + */ + @java.lang.Override + public long getPersistentMemory() { + return persistentMemory_; + } + /** + * int64 persistent_memory = 4; + * @param value The persistentMemory to set. + * @return This builder for chaining. + */ + public Builder setPersistentMemory(long value) { + + persistentMemory_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 persistent_memory = 4; + * @return This builder for chaining. + */ + public Builder clearPersistentMemory() { + bitField0_ = (bitField0_ & ~0x00000004); + persistentMemory_ = 0L; + onChanged(); + return this; + } + + private long deviceTempMemory_ ; + /** + * int64 device_temp_memory = 3 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_temp_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=114 + * @return The deviceTempMemory. + */ + @java.lang.Override + @java.lang.Deprecated public long getDeviceTempMemory() { + return deviceTempMemory_; + } + /** + * int64 device_temp_memory = 3 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_temp_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=114 + * @param value The deviceTempMemory to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDeviceTempMemory(long value) { + + deviceTempMemory_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 device_temp_memory = 3 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_temp_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=114 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDeviceTempMemory() { + bitField0_ = (bitField0_ & ~0x00000008); + deviceTempMemory_ = 0L; + onChanged(); + return this; + } + + private long devicePersistentMemory_ ; + /** + * int64 device_persistent_memory = 5 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_persistent_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=115 + * @return The devicePersistentMemory. + */ + @java.lang.Override + @java.lang.Deprecated public long getDevicePersistentMemory() { + return devicePersistentMemory_; + } + /** + * int64 device_persistent_memory = 5 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_persistent_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=115 + * @param value The devicePersistentMemory to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDevicePersistentMemory(long value) { + + devicePersistentMemory_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 device_persistent_memory = 5 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.OpMemory.device_persistent_memory is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=115 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDevicePersistentMemory() { + bitField0_ = (bitField0_ & ~0x00000010); + devicePersistentMemory_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpPerformance.OpMemory) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpPerformance.OpMemory) + private static final org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory(); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpMemory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.OpPerformance.OpMemory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + private int executionTimeCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object executionTime_; + public enum ExecutionTimeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXECUTION_TIME_NORMAL(10), + EXECUTION_TIME_LOG_NORMAL(11), + EXECUTIONTIME_NOT_SET(0); + private final int value; + private ExecutionTimeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExecutionTimeCase valueOf(int value) { + return forNumber(value); + } + + public static ExecutionTimeCase forNumber(int value) { + switch (value) { + case 10: return EXECUTION_TIME_NORMAL; + case 11: return EXECUTION_TIME_LOG_NORMAL; + case 0: return EXECUTIONTIME_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ExecutionTimeCase + getExecutionTimeCase() { + return ExecutionTimeCase.forNumber( + executionTimeCase_); + } + + public static final int OP_FIELD_NUMBER = 1; + private org.tensorflow.proto.OpPerformanceData.OpInfo op_; + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + * @return Whether the op field is set. + */ + @java.lang.Override + public boolean hasOp() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + * @return The op. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfo getOp() { + return op_ == null ? org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance() : op_; + } + /** + *
    +     * The op
    +     * 
    + * + * .tensorflow.OpInfo op = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder getOpOrBuilder() { + return op_ == null ? org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance() : op_; + } + + public static final int SESSION_INFO_FIELD_NUMBER = 12; + private org.tensorflow.proto.OpPerformanceData.SessionInfo sessionInfo_; + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return Whether the sessionInfo field is set. + */ + @java.lang.Override + @java.lang.Deprecated public boolean hasSessionInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return The sessionInfo. + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo() { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + /** + *
    +     * Information about the session configs.
    +     * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Override + @java.lang.Deprecated public org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder() { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + + public static final int NODE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object node_ = ""; + /** + *
    +     * The node name (optional). Makes it easier to associate the performance data
    +     * with a specific graph node.
    +     * 
    + * + * string node = 5; + * @return The node. + */ + @java.lang.Override + public java.lang.String getNode() { + java.lang.Object ref = node_; + 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(); + node_ = s; + return s; + } + } + /** + *
    +     * The node name (optional). Makes it easier to associate the performance data
    +     * with a specific graph node.
    +     * 
    + * + * string node = 5; + * @return The bytes for node. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNodeBytes() { + java.lang.Object ref = node_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + node_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEMPORARY_MEMORY_SIZE_FIELD_NUMBER = 2; + private long temporaryMemorySize_ = 0L; + /** + *
    +     * Temporary memory used by this node (in bytes).
    +     * 
    + * + * int64 temporary_memory_size = 2; + * @return The temporaryMemorySize. + */ + @java.lang.Override + public long getTemporaryMemorySize() { + return temporaryMemorySize_; + } + + public static final int COMPUTE_COST_FIELD_NUMBER = 3; + private long computeCost_ = 0L; + /** + *
    +     * Time it takes to run the op (in nanoseconds).
    +     * 
    + * + * int64 compute_cost = 3; + * @return The computeCost. + */ + @java.lang.Override + public long getComputeCost() { + return computeCost_; + } + + public static final int COMPUTE_TIME_FIELD_NUMBER = 6; + private long computeTime_ = 0L; + /** + *
    +     * Analytical compute cost (in nanoseconds).
    +     * 
    + * + * int64 compute_time = 6; + * @return The computeTime. + */ + @java.lang.Override + public long getComputeTime() { + return computeTime_; + } + + public static final int MEMORY_TIME_FIELD_NUMBER = 7; + private long memoryTime_ = 0L; + /** + *
    +     * Analytical memory access cost (in nanoseconds).
    +     * 
    + * + * int64 memory_time = 7; + * @return The memoryTime. + */ + @java.lang.Override + public long getMemoryTime() { + return memoryTime_; + } + + public static final int COMPUTE_EFFICIENCY_FIELD_NUMBER = 4; + private double computeEfficiency_ = 0D; + /** + *
    +     * Percentage of theoretical compute performance.
    +     * 
    + * + * double compute_efficiency = 4; + * @return The computeEfficiency. + */ + @java.lang.Override + public double getComputeEfficiency() { + return computeEfficiency_; + } + + public static final int MEMORY_EFFICIENCY_FIELD_NUMBER = 8; + private double memoryEfficiency_ = 0D; + /** + *
    +     * Percentage of theoretical memory performance.
    +     * 
    + * + * double memory_efficiency = 8; + * @return The memoryEfficiency. + */ + @java.lang.Override + public double getMemoryEfficiency() { + return memoryEfficiency_; + } + + public static final int EXECUTION_TIME_NORMAL_FIELD_NUMBER = 10; + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return Whether the executionTimeNormal field is set. + */ + @java.lang.Override + public boolean hasExecutionTimeNormal() { + return executionTimeCase_ == 10; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return The executionTimeNormal. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistribution getExecutionTimeNormal() { + if (executionTimeCase_ == 10) { + return (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder() { + if (executionTimeCase_ == 10) { + return (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + + public static final int EXECUTION_TIME_LOG_NORMAL_FIELD_NUMBER = 11; + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return Whether the executionTimeLogNormal field is set. + */ + @java.lang.Override + public boolean hasExecutionTimeLogNormal() { + return executionTimeCase_ == 11; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return The executionTimeLogNormal. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution getExecutionTimeLogNormal() { + if (executionTimeCase_ == 11) { + return (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder() { + if (executionTimeCase_ == 11) { + return (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + + public static final int OP_MEMORY_FIELD_NUMBER = 9; + private org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory opMemory_; + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return Whether the opMemory field is set. + */ + @java.lang.Override + public boolean hasOpMemory() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return The opMemory. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory getOpMemory() { + return opMemory_ == null ? org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder() { + return opMemory_ == null ? org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOp()); + } + if (temporaryMemorySize_ != 0L) { + output.writeInt64(2, temporaryMemorySize_); + } + if (computeCost_ != 0L) { + output.writeInt64(3, computeCost_); + } + if (java.lang.Double.doubleToRawLongBits(computeEfficiency_) != 0) { + output.writeDouble(4, computeEfficiency_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(node_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, node_); + } + if (computeTime_ != 0L) { + output.writeInt64(6, computeTime_); + } + if (memoryTime_ != 0L) { + output.writeInt64(7, memoryTime_); + } + if (java.lang.Double.doubleToRawLongBits(memoryEfficiency_) != 0) { + output.writeDouble(8, memoryEfficiency_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getOpMemory()); + } + if (executionTimeCase_ == 10) { + output.writeMessage(10, (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_); + } + if (executionTimeCase_ == 11) { + output.writeMessage(11, (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(12, getSessionInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getOp()); + } + if (temporaryMemorySize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, temporaryMemorySize_); + } + if (computeCost_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, computeCost_); + } + if (java.lang.Double.doubleToRawLongBits(computeEfficiency_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, computeEfficiency_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(node_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, node_); + } + if (computeTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, computeTime_); + } + if (memoryTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, memoryTime_); + } + if (java.lang.Double.doubleToRawLongBits(memoryEfficiency_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(8, memoryEfficiency_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getOpMemory()); + } + if (executionTimeCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_); + } + if (executionTimeCase_ == 11) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, getSessionInfo()); + } + size += getUnknownFields().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.OpPerformanceData.OpPerformance)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.OpPerformance other = (org.tensorflow.proto.OpPerformanceData.OpPerformance) obj; + + if (hasOp() != other.hasOp()) return false; + if (hasOp()) { + if (!getOp() + .equals(other.getOp())) return false; + } + if (hasSessionInfo() != other.hasSessionInfo()) return false; + if (hasSessionInfo()) { + if (!getSessionInfo() + .equals(other.getSessionInfo())) return false; + } + if (!getNode() + .equals(other.getNode())) return false; + if (getTemporaryMemorySize() + != other.getTemporaryMemorySize()) return false; + if (getComputeCost() + != other.getComputeCost()) return false; + if (getComputeTime() + != other.getComputeTime()) return false; + if (getMemoryTime() + != other.getMemoryTime()) return false; + if (java.lang.Double.doubleToLongBits(getComputeEfficiency()) + != java.lang.Double.doubleToLongBits( + other.getComputeEfficiency())) return false; + if (java.lang.Double.doubleToLongBits(getMemoryEfficiency()) + != java.lang.Double.doubleToLongBits( + other.getMemoryEfficiency())) return false; + if (hasOpMemory() != other.hasOpMemory()) return false; + if (hasOpMemory()) { + if (!getOpMemory() + .equals(other.getOpMemory())) return false; + } + if (!getExecutionTimeCase().equals(other.getExecutionTimeCase())) return false; + switch (executionTimeCase_) { + case 10: + if (!getExecutionTimeNormal() + .equals(other.getExecutionTimeNormal())) return false; + break; + case 11: + if (!getExecutionTimeLogNormal() + .equals(other.getExecutionTimeLogNormal())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOp()) { + hash = (37 * hash) + OP_FIELD_NUMBER; + hash = (53 * hash) + getOp().hashCode(); + } + if (hasSessionInfo()) { + hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSessionInfo().hashCode(); + } + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNode().hashCode(); + hash = (37 * hash) + TEMPORARY_MEMORY_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTemporaryMemorySize()); + hash = (37 * hash) + COMPUTE_COST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getComputeCost()); + hash = (37 * hash) + COMPUTE_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getComputeTime()); + hash = (37 * hash) + MEMORY_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMemoryTime()); + hash = (37 * hash) + COMPUTE_EFFICIENCY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getComputeEfficiency())); + hash = (37 * hash) + MEMORY_EFFICIENCY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMemoryEfficiency())); + if (hasOpMemory()) { + hash = (37 * hash) + OP_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getOpMemory().hashCode(); + } + switch (executionTimeCase_) { + case 10: + hash = (37 * hash) + EXECUTION_TIME_NORMAL_FIELD_NUMBER; + hash = (53 * hash) + getExecutionTimeNormal().hashCode(); + break; + case 11: + hash = (37 * hash) + EXECUTION_TIME_LOG_NORMAL_FIELD_NUMBER; + hash = (53 * hash) + getExecutionTimeLogNormal().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance 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.OpPerformanceData.OpPerformance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance 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.OpPerformanceData.OpPerformance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.OpPerformance 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Performance data for tensorflow operations
    +     * 
    + * + * Protobuf type {@code tensorflow.OpPerformance} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformance) + org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformance.class, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.OpPerformance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getOpFieldBuilder(); + getSessionInfoFieldBuilder(); + getOpMemoryFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + op_ = null; + if (opBuilder_ != null) { + opBuilder_.dispose(); + opBuilder_ = null; + } + sessionInfo_ = null; + if (sessionInfoBuilder_ != null) { + sessionInfoBuilder_.dispose(); + sessionInfoBuilder_ = null; + } + node_ = ""; + temporaryMemorySize_ = 0L; + computeCost_ = 0L; + computeTime_ = 0L; + memoryTime_ = 0L; + computeEfficiency_ = 0D; + memoryEfficiency_ = 0D; + if (executionTimeNormalBuilder_ != null) { + executionTimeNormalBuilder_.clear(); + } + if (executionTimeLogNormalBuilder_ != null) { + executionTimeLogNormalBuilder_.clear(); + } + opMemory_ = null; + if (opMemoryBuilder_ != null) { + opMemoryBuilder_.dispose(); + opMemoryBuilder_ = null; + } + executionTimeCase_ = 0; + executionTime_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformance_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.OpPerformance.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance build() { + org.tensorflow.proto.OpPerformanceData.OpPerformance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance buildPartial() { + org.tensorflow.proto.OpPerformanceData.OpPerformance result = new org.tensorflow.proto.OpPerformanceData.OpPerformance(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.OpPerformance result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.op_ = opBuilder_ == null + ? op_ + : opBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sessionInfo_ = sessionInfoBuilder_ == null + ? sessionInfo_ + : sessionInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.node_ = node_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.temporaryMemorySize_ = temporaryMemorySize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.computeCost_ = computeCost_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.computeTime_ = computeTime_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.memoryTime_ = memoryTime_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.computeEfficiency_ = computeEfficiency_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.memoryEfficiency_ = memoryEfficiency_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.opMemory_ = opMemoryBuilder_ == null + ? opMemory_ + : opMemoryBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.OpPerformanceData.OpPerformance result) { + result.executionTimeCase_ = executionTimeCase_; + result.executionTime_ = this.executionTime_; + if (executionTimeCase_ == 10 && + executionTimeNormalBuilder_ != null) { + result.executionTime_ = executionTimeNormalBuilder_.build(); + } + if (executionTimeCase_ == 11 && + executionTimeLogNormalBuilder_ != null) { + result.executionTime_ = executionTimeLogNormalBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.OpPerformance) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.OpPerformance)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.OpPerformance other) { + if (other == org.tensorflow.proto.OpPerformanceData.OpPerformance.getDefaultInstance()) return this; + if (other.hasOp()) { + mergeOp(other.getOp()); + } + if (other.hasSessionInfo()) { + mergeSessionInfo(other.getSessionInfo()); + } + if (!other.getNode().isEmpty()) { + node_ = other.node_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getTemporaryMemorySize() != 0L) { + setTemporaryMemorySize(other.getTemporaryMemorySize()); + } + if (other.getComputeCost() != 0L) { + setComputeCost(other.getComputeCost()); + } + if (other.getComputeTime() != 0L) { + setComputeTime(other.getComputeTime()); + } + if (other.getMemoryTime() != 0L) { + setMemoryTime(other.getMemoryTime()); + } + if (other.getComputeEfficiency() != 0D) { + setComputeEfficiency(other.getComputeEfficiency()); + } + if (other.getMemoryEfficiency() != 0D) { + setMemoryEfficiency(other.getMemoryEfficiency()); + } + if (other.hasOpMemory()) { + mergeOpMemory(other.getOpMemory()); + } + switch (other.getExecutionTimeCase()) { + case EXECUTION_TIME_NORMAL: { + mergeExecutionTimeNormal(other.getExecutionTimeNormal()); + break; + } + case EXECUTION_TIME_LOG_NORMAL: { + mergeExecutionTimeLogNormal(other.getExecutionTimeLogNormal()); + break; + } + case EXECUTIONTIME_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getOpFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + temporaryMemorySize_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 24: { + computeCost_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 33: { + computeEfficiency_ = input.readDouble(); + bitField0_ |= 0x00000080; + break; + } // case 33 + case 42: { + node_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 48: { + computeTime_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + memoryTime_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 65: { + memoryEfficiency_ = input.readDouble(); + bitField0_ |= 0x00000100; + break; + } // case 65 + case 74: { + input.readMessage( + getOpMemoryFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 74 + case 82: { + input.readMessage( + getExecutionTimeNormalFieldBuilder().getBuilder(), + extensionRegistry); + executionTimeCase_ = 10; + break; + } // case 82 + case 90: { + input.readMessage( + getExecutionTimeLogNormalFieldBuilder().getBuilder(), + extensionRegistry); + executionTimeCase_ = 11; + break; + } // case 90 + case 98: { + input.readMessage( + getSessionInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int executionTimeCase_ = 0; + private java.lang.Object executionTime_; + public ExecutionTimeCase + getExecutionTimeCase() { + return ExecutionTimeCase.forNumber( + executionTimeCase_); + } + + public Builder clearExecutionTime() { + executionTimeCase_ = 0; + executionTime_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private org.tensorflow.proto.OpPerformanceData.OpInfo op_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo, org.tensorflow.proto.OpPerformanceData.OpInfo.Builder, org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder> opBuilder_; + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + * @return Whether the op field is set. + */ + public boolean hasOp() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + * @return The op. + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo getOp() { + if (opBuilder_ == null) { + return op_ == null ? org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance() : op_; + } else { + return opBuilder_.getMessage(); + } + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public Builder setOp(org.tensorflow.proto.OpPerformanceData.OpInfo value) { + if (opBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + op_ = value; + } else { + opBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public Builder setOp( + org.tensorflow.proto.OpPerformanceData.OpInfo.Builder builderForValue) { + if (opBuilder_ == null) { + op_ = builderForValue.build(); + } else { + opBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public Builder mergeOp(org.tensorflow.proto.OpPerformanceData.OpInfo value) { + if (opBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + op_ != null && + op_ != org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance()) { + getOpBuilder().mergeFrom(value); + } else { + op_ = value; + } + } else { + opBuilder_.mergeFrom(value); + } + if (op_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public Builder clearOp() { + bitField0_ = (bitField0_ & ~0x00000001); + op_ = null; + if (opBuilder_ != null) { + opBuilder_.dispose(); + opBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfo.Builder getOpBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getOpFieldBuilder().getBuilder(); + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder getOpOrBuilder() { + if (opBuilder_ != null) { + return opBuilder_.getMessageOrBuilder(); + } else { + return op_ == null ? + org.tensorflow.proto.OpPerformanceData.OpInfo.getDefaultInstance() : op_; + } + } + /** + *
    +       * The op
    +       * 
    + * + * .tensorflow.OpInfo op = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo, org.tensorflow.proto.OpPerformanceData.OpInfo.Builder, org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder> + getOpFieldBuilder() { + if (opBuilder_ == null) { + opBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpInfo, org.tensorflow.proto.OpPerformanceData.OpInfo.Builder, org.tensorflow.proto.OpPerformanceData.OpInfoOrBuilder>( + getOp(), + getParentForChildren(), + isClean()); + op_ = null; + } + return opBuilder_; + } + + private org.tensorflow.proto.OpPerformanceData.SessionInfo sessionInfo_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder> sessionInfoBuilder_; + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return Whether the sessionInfo field is set. + */ + @java.lang.Deprecated public boolean hasSessionInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + * @deprecated tensorflow.OpPerformance.session_info is deprecated. + * See tensorflow/core/grappler/costs/op_performance_data.proto;l=75 + * @return The sessionInfo. + */ + @java.lang.Deprecated public org.tensorflow.proto.OpPerformanceData.SessionInfo getSessionInfo() { + if (sessionInfoBuilder_ == null) { + return sessionInfo_ == null ? org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } else { + return sessionInfoBuilder_.getMessage(); + } + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public Builder setSessionInfo(org.tensorflow.proto.OpPerformanceData.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionInfo_ = value; + } else { + sessionInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public Builder setSessionInfo( + org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder builderForValue) { + if (sessionInfoBuilder_ == null) { + sessionInfo_ = builderForValue.build(); + } else { + sessionInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public Builder mergeSessionInfo(org.tensorflow.proto.OpPerformanceData.SessionInfo value) { + if (sessionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + sessionInfo_ != null && + sessionInfo_ != org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance()) { + getSessionInfoBuilder().mergeFrom(value); + } else { + sessionInfo_ = value; + } + } else { + sessionInfoBuilder_.mergeFrom(value); + } + if (sessionInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public Builder clearSessionInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + sessionInfo_ = null; + if (sessionInfoBuilder_ != null) { + sessionInfoBuilder_.dispose(); + sessionInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder getSessionInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSessionInfoFieldBuilder().getBuilder(); + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + @java.lang.Deprecated public org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder getSessionInfoOrBuilder() { + if (sessionInfoBuilder_ != null) { + return sessionInfoBuilder_.getMessageOrBuilder(); + } else { + return sessionInfo_ == null ? + org.tensorflow.proto.OpPerformanceData.SessionInfo.getDefaultInstance() : sessionInfo_; + } + } + /** + *
    +       * Information about the session configs.
    +       * 
    + * + * .tensorflow.SessionInfo session_info = 12 [deprecated = true]; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder> + getSessionInfoFieldBuilder() { + if (sessionInfoBuilder_ == null) { + sessionInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.SessionInfo, org.tensorflow.proto.OpPerformanceData.SessionInfo.Builder, org.tensorflow.proto.OpPerformanceData.SessionInfoOrBuilder>( + getSessionInfo(), + getParentForChildren(), + isClean()); + sessionInfo_ = null; + } + return sessionInfoBuilder_; + } + + private java.lang.Object node_ = ""; + /** + *
    +       * The node name (optional). Makes it easier to associate the performance data
    +       * with a specific graph node.
    +       * 
    + * + * string node = 5; + * @return The node. + */ + public java.lang.String getNode() { + java.lang.Object ref = node_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + node_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The node name (optional). Makes it easier to associate the performance data
    +       * with a specific graph node.
    +       * 
    + * + * string node = 5; + * @return The bytes for node. + */ + public com.google.protobuf.ByteString + getNodeBytes() { + java.lang.Object ref = node_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + node_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The node name (optional). Makes it easier to associate the performance data
    +       * with a specific graph node.
    +       * 
    + * + * string node = 5; + * @param value The node to set. + * @return This builder for chaining. + */ + public Builder setNode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + node_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The node name (optional). Makes it easier to associate the performance data
    +       * with a specific graph node.
    +       * 
    + * + * string node = 5; + * @return This builder for chaining. + */ + public Builder clearNode() { + node_ = getDefaultInstance().getNode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * The node name (optional). Makes it easier to associate the performance data
    +       * with a specific graph node.
    +       * 
    + * + * string node = 5; + * @param value The bytes for node to set. + * @return This builder for chaining. + */ + public Builder setNodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + node_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long temporaryMemorySize_ ; + /** + *
    +       * Temporary memory used by this node (in bytes).
    +       * 
    + * + * int64 temporary_memory_size = 2; + * @return The temporaryMemorySize. + */ + @java.lang.Override + public long getTemporaryMemorySize() { + return temporaryMemorySize_; + } + /** + *
    +       * Temporary memory used by this node (in bytes).
    +       * 
    + * + * int64 temporary_memory_size = 2; + * @param value The temporaryMemorySize to set. + * @return This builder for chaining. + */ + public Builder setTemporaryMemorySize(long value) { + + temporaryMemorySize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Temporary memory used by this node (in bytes).
    +       * 
    + * + * int64 temporary_memory_size = 2; + * @return This builder for chaining. + */ + public Builder clearTemporaryMemorySize() { + bitField0_ = (bitField0_ & ~0x00000008); + temporaryMemorySize_ = 0L; + onChanged(); + return this; + } + + private long computeCost_ ; + /** + *
    +       * Time it takes to run the op (in nanoseconds).
    +       * 
    + * + * int64 compute_cost = 3; + * @return The computeCost. + */ + @java.lang.Override + public long getComputeCost() { + return computeCost_; + } + /** + *
    +       * Time it takes to run the op (in nanoseconds).
    +       * 
    + * + * int64 compute_cost = 3; + * @param value The computeCost to set. + * @return This builder for chaining. + */ + public Builder setComputeCost(long value) { + + computeCost_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Time it takes to run the op (in nanoseconds).
    +       * 
    + * + * int64 compute_cost = 3; + * @return This builder for chaining. + */ + public Builder clearComputeCost() { + bitField0_ = (bitField0_ & ~0x00000010); + computeCost_ = 0L; + onChanged(); + return this; + } + + private long computeTime_ ; + /** + *
    +       * Analytical compute cost (in nanoseconds).
    +       * 
    + * + * int64 compute_time = 6; + * @return The computeTime. + */ + @java.lang.Override + public long getComputeTime() { + return computeTime_; + } + /** + *
    +       * Analytical compute cost (in nanoseconds).
    +       * 
    + * + * int64 compute_time = 6; + * @param value The computeTime to set. + * @return This builder for chaining. + */ + public Builder setComputeTime(long value) { + + computeTime_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Analytical compute cost (in nanoseconds).
    +       * 
    + * + * int64 compute_time = 6; + * @return This builder for chaining. + */ + public Builder clearComputeTime() { + bitField0_ = (bitField0_ & ~0x00000020); + computeTime_ = 0L; + onChanged(); + return this; + } + + private long memoryTime_ ; + /** + *
    +       * Analytical memory access cost (in nanoseconds).
    +       * 
    + * + * int64 memory_time = 7; + * @return The memoryTime. + */ + @java.lang.Override + public long getMemoryTime() { + return memoryTime_; + } + /** + *
    +       * Analytical memory access cost (in nanoseconds).
    +       * 
    + * + * int64 memory_time = 7; + * @param value The memoryTime to set. + * @return This builder for chaining. + */ + public Builder setMemoryTime(long value) { + + memoryTime_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Analytical memory access cost (in nanoseconds).
    +       * 
    + * + * int64 memory_time = 7; + * @return This builder for chaining. + */ + public Builder clearMemoryTime() { + bitField0_ = (bitField0_ & ~0x00000040); + memoryTime_ = 0L; + onChanged(); + return this; + } + + private double computeEfficiency_ ; + /** + *
    +       * Percentage of theoretical compute performance.
    +       * 
    + * + * double compute_efficiency = 4; + * @return The computeEfficiency. + */ + @java.lang.Override + public double getComputeEfficiency() { + return computeEfficiency_; + } + /** + *
    +       * Percentage of theoretical compute performance.
    +       * 
    + * + * double compute_efficiency = 4; + * @param value The computeEfficiency to set. + * @return This builder for chaining. + */ + public Builder setComputeEfficiency(double value) { + + computeEfficiency_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * Percentage of theoretical compute performance.
    +       * 
    + * + * double compute_efficiency = 4; + * @return This builder for chaining. + */ + public Builder clearComputeEfficiency() { + bitField0_ = (bitField0_ & ~0x00000080); + computeEfficiency_ = 0D; + onChanged(); + return this; + } + + private double memoryEfficiency_ ; + /** + *
    +       * Percentage of theoretical memory performance.
    +       * 
    + * + * double memory_efficiency = 8; + * @return The memoryEfficiency. + */ + @java.lang.Override + public double getMemoryEfficiency() { + return memoryEfficiency_; + } + /** + *
    +       * Percentage of theoretical memory performance.
    +       * 
    + * + * double memory_efficiency = 8; + * @param value The memoryEfficiency to set. + * @return This builder for chaining. + */ + public Builder setMemoryEfficiency(double value) { + + memoryEfficiency_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * Percentage of theoretical memory performance.
    +       * 
    + * + * double memory_efficiency = 8; + * @return This builder for chaining. + */ + public Builder clearMemoryEfficiency() { + bitField0_ = (bitField0_ & ~0x00000100); + memoryEfficiency_ = 0D; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.NormalDistribution, org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder> executionTimeNormalBuilder_; + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return Whether the executionTimeNormal field is set. + */ + @java.lang.Override + public boolean hasExecutionTimeNormal() { + return executionTimeCase_ == 10; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + * @return The executionTimeNormal. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistribution getExecutionTimeNormal() { + if (executionTimeNormalBuilder_ == null) { + if (executionTimeCase_ == 10) { + return (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } else { + if (executionTimeCase_ == 10) { + return executionTimeNormalBuilder_.getMessage(); + } + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + public Builder setExecutionTimeNormal(org.tensorflow.proto.OpPerformanceData.NormalDistribution value) { + if (executionTimeNormalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionTime_ = value; + onChanged(); + } else { + executionTimeNormalBuilder_.setMessage(value); + } + executionTimeCase_ = 10; + return this; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + public Builder setExecutionTimeNormal( + org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder builderForValue) { + if (executionTimeNormalBuilder_ == null) { + executionTime_ = builderForValue.build(); + onChanged(); + } else { + executionTimeNormalBuilder_.setMessage(builderForValue.build()); + } + executionTimeCase_ = 10; + return this; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + public Builder mergeExecutionTimeNormal(org.tensorflow.proto.OpPerformanceData.NormalDistribution value) { + if (executionTimeNormalBuilder_ == null) { + if (executionTimeCase_ == 10 && + executionTime_ != org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance()) { + executionTime_ = org.tensorflow.proto.OpPerformanceData.NormalDistribution.newBuilder((org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_) + .mergeFrom(value).buildPartial(); + } else { + executionTime_ = value; + } + onChanged(); + } else { + if (executionTimeCase_ == 10) { + executionTimeNormalBuilder_.mergeFrom(value); + } else { + executionTimeNormalBuilder_.setMessage(value); + } + } + executionTimeCase_ = 10; + return this; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + public Builder clearExecutionTimeNormal() { + if (executionTimeNormalBuilder_ == null) { + if (executionTimeCase_ == 10) { + executionTimeCase_ = 0; + executionTime_ = null; + onChanged(); + } + } else { + if (executionTimeCase_ == 10) { + executionTimeCase_ = 0; + executionTime_ = null; + } + executionTimeNormalBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + public org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder getExecutionTimeNormalBuilder() { + return getExecutionTimeNormalFieldBuilder().getBuilder(); + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder getExecutionTimeNormalOrBuilder() { + if ((executionTimeCase_ == 10) && (executionTimeNormalBuilder_ != null)) { + return executionTimeNormalBuilder_.getMessageOrBuilder(); + } else { + if (executionTimeCase_ == 10) { + return (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + } + /** + * .tensorflow.NormalDistribution execution_time_normal = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.NormalDistribution, org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder> + getExecutionTimeNormalFieldBuilder() { + if (executionTimeNormalBuilder_ == null) { + if (!(executionTimeCase_ == 10)) { + executionTime_ = org.tensorflow.proto.OpPerformanceData.NormalDistribution.getDefaultInstance(); + } + executionTimeNormalBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.NormalDistribution, org.tensorflow.proto.OpPerformanceData.NormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.NormalDistributionOrBuilder>( + (org.tensorflow.proto.OpPerformanceData.NormalDistribution) executionTime_, + getParentForChildren(), + isClean()); + executionTime_ = null; + } + executionTimeCase_ = 10; + onChanged(); + return executionTimeNormalBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution, org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder> executionTimeLogNormalBuilder_; + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return Whether the executionTimeLogNormal field is set. + */ + @java.lang.Override + public boolean hasExecutionTimeLogNormal() { + return executionTimeCase_ == 11; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + * @return The executionTimeLogNormal. + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution getExecutionTimeLogNormal() { + if (executionTimeLogNormalBuilder_ == null) { + if (executionTimeCase_ == 11) { + return (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } else { + if (executionTimeCase_ == 11) { + return executionTimeLogNormalBuilder_.getMessage(); + } + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + public Builder setExecutionTimeLogNormal(org.tensorflow.proto.OpPerformanceData.LogNormalDistribution value) { + if (executionTimeLogNormalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + executionTime_ = value; + onChanged(); + } else { + executionTimeLogNormalBuilder_.setMessage(value); + } + executionTimeCase_ = 11; + return this; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + public Builder setExecutionTimeLogNormal( + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder builderForValue) { + if (executionTimeLogNormalBuilder_ == null) { + executionTime_ = builderForValue.build(); + onChanged(); + } else { + executionTimeLogNormalBuilder_.setMessage(builderForValue.build()); + } + executionTimeCase_ = 11; + return this; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + public Builder mergeExecutionTimeLogNormal(org.tensorflow.proto.OpPerformanceData.LogNormalDistribution value) { + if (executionTimeLogNormalBuilder_ == null) { + if (executionTimeCase_ == 11 && + executionTime_ != org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance()) { + executionTime_ = org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.newBuilder((org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_) + .mergeFrom(value).buildPartial(); + } else { + executionTime_ = value; + } + onChanged(); + } else { + if (executionTimeCase_ == 11) { + executionTimeLogNormalBuilder_.mergeFrom(value); + } else { + executionTimeLogNormalBuilder_.setMessage(value); + } + } + executionTimeCase_ = 11; + return this; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + public Builder clearExecutionTimeLogNormal() { + if (executionTimeLogNormalBuilder_ == null) { + if (executionTimeCase_ == 11) { + executionTimeCase_ = 0; + executionTime_ = null; + onChanged(); + } + } else { + if (executionTimeCase_ == 11) { + executionTimeCase_ = 0; + executionTime_ = null; + } + executionTimeLogNormalBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + public org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder getExecutionTimeLogNormalBuilder() { + return getExecutionTimeLogNormalFieldBuilder().getBuilder(); + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder getExecutionTimeLogNormalOrBuilder() { + if ((executionTimeCase_ == 11) && (executionTimeLogNormalBuilder_ != null)) { + return executionTimeLogNormalBuilder_.getMessageOrBuilder(); + } else { + if (executionTimeCase_ == 11) { + return (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_; + } + return org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + } + /** + * .tensorflow.LogNormalDistribution execution_time_log_normal = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution, org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder> + getExecutionTimeLogNormalFieldBuilder() { + if (executionTimeLogNormalBuilder_ == null) { + if (!(executionTimeCase_ == 11)) { + executionTime_ = org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.getDefaultInstance(); + } + executionTimeLogNormalBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.LogNormalDistribution, org.tensorflow.proto.OpPerformanceData.LogNormalDistribution.Builder, org.tensorflow.proto.OpPerformanceData.LogNormalDistributionOrBuilder>( + (org.tensorflow.proto.OpPerformanceData.LogNormalDistribution) executionTime_, + getParentForChildren(), + isClean()); + executionTime_ = null; + } + executionTimeCase_ = 11; + onChanged(); + return executionTimeLogNormalBuilder_; + } + + private org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory opMemory_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder> opMemoryBuilder_; + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return Whether the opMemory field is set. + */ + public boolean hasOpMemory() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + * @return The opMemory. + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory getOpMemory() { + if (opMemoryBuilder_ == null) { + return opMemory_ == null ? org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; + } else { + return opMemoryBuilder_.getMessage(); + } + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public Builder setOpMemory(org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory value) { + if (opMemoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + opMemory_ = value; + } else { + opMemoryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public Builder setOpMemory( + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder builderForValue) { + if (opMemoryBuilder_ == null) { + opMemory_ = builderForValue.build(); + } else { + opMemoryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public Builder mergeOpMemory(org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory value) { + if (opMemoryBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) && + opMemory_ != null && + opMemory_ != org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance()) { + getOpMemoryBuilder().mergeFrom(value); + } else { + opMemory_ = value; + } + } else { + opMemoryBuilder_.mergeFrom(value); + } + if (opMemory_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public Builder clearOpMemory() { + bitField0_ = (bitField0_ & ~0x00000800); + opMemory_ = null; + if (opMemoryBuilder_ != null) { + opMemoryBuilder_.dispose(); + opMemoryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder getOpMemoryBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getOpMemoryFieldBuilder().getBuilder(); + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder getOpMemoryOrBuilder() { + if (opMemoryBuilder_ != null) { + return opMemoryBuilder_.getMessageOrBuilder(); + } else { + return opMemory_ == null ? + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.getDefaultInstance() : opMemory_; + } + } + /** + * .tensorflow.OpPerformance.OpMemory op_memory = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder> + getOpMemoryFieldBuilder() { + if (opMemoryBuilder_ == null) { + opMemoryBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemory.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformance.OpMemoryOrBuilder>( + getOpMemory(), + getParentForChildren(), + isClean()); + opMemory_ = null; + } + return opMemoryBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpPerformance) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpPerformance) + private static final org.tensorflow.proto.OpPerformanceData.OpPerformance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.OpPerformance(); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpPerformance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.OpPerformance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OpPerformanceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OpPerformanceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + java.util.List + getOpPerformanceList(); + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + org.tensorflow.proto.OpPerformanceData.OpPerformance getOpPerformance(int index); + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + int getOpPerformanceCount(); + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + java.util.List + getOpPerformanceOrBuilderList(); + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder getOpPerformanceOrBuilder( + int index); + } + /** + *
    +   * A collection of OpPerformance data points.
    +   * 
    + * + * Protobuf type {@code tensorflow.OpPerformanceList} + */ + public static final class OpPerformanceList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OpPerformanceList) + OpPerformanceListOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OpPerformanceList.class.getName()); + } + // Use OpPerformanceList.newBuilder() to construct. + private OpPerformanceList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpPerformanceList() { + opPerformance_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformanceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformanceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformanceList.class, org.tensorflow.proto.OpPerformanceData.OpPerformanceList.Builder.class); + } + + public static final int OP_PERFORMANCE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List opPerformance_; + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + @java.lang.Override + public java.util.List getOpPerformanceList() { + return opPerformance_; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + @java.lang.Override + public java.util.List + getOpPerformanceOrBuilderList() { + return opPerformance_; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + @java.lang.Override + public int getOpPerformanceCount() { + return opPerformance_.size(); + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformance getOpPerformance(int index) { + return opPerformance_.get(index); + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder getOpPerformanceOrBuilder( + int index) { + return opPerformance_.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 { + for (int i = 0; i < opPerformance_.size(); i++) { + output.writeMessage(1, opPerformance_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < opPerformance_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, opPerformance_.get(i)); + } + size += getUnknownFields().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.OpPerformanceData.OpPerformanceList)) { + return super.equals(obj); + } + org.tensorflow.proto.OpPerformanceData.OpPerformanceList other = (org.tensorflow.proto.OpPerformanceData.OpPerformanceList) obj; + + if (!getOpPerformanceList() + .equals(other.getOpPerformanceList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOpPerformanceCount() > 0) { + hash = (37 * hash) + OP_PERFORMANCE_FIELD_NUMBER; + hash = (53 * hash) + getOpPerformanceList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList 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.OpPerformanceData.OpPerformanceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList 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.OpPerformanceData.OpPerformanceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OpPerformanceData.OpPerformanceList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A collection of OpPerformance data points.
    +     * 
    + * + * Protobuf type {@code tensorflow.OpPerformanceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OpPerformanceList) + org.tensorflow.proto.OpPerformanceData.OpPerformanceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformanceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformanceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OpPerformanceData.OpPerformanceList.class, org.tensorflow.proto.OpPerformanceData.OpPerformanceList.Builder.class); + } + + // Construct using org.tensorflow.proto.OpPerformanceData.OpPerformanceList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (opPerformanceBuilder_ == null) { + opPerformance_ = java.util.Collections.emptyList(); + } else { + opPerformance_ = null; + opPerformanceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OpPerformanceData.internal_static_tensorflow_OpPerformanceList_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformanceList getDefaultInstanceForType() { + return org.tensorflow.proto.OpPerformanceData.OpPerformanceList.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformanceList build() { + org.tensorflow.proto.OpPerformanceData.OpPerformanceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OpPerformanceData.OpPerformanceList buildPartial() { + org.tensorflow.proto.OpPerformanceData.OpPerformanceList result = new org.tensorflow.proto.OpPerformanceData.OpPerformanceList(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OpPerformanceData.OpPerformanceList result) { + if (opPerformanceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + opPerformance_ = java.util.Collections.unmodifiableList(opPerformance_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.opPerformance_ = opPerformance_; + } else { + result.opPerformance_ = opPerformanceBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.OpPerformanceData.OpPerformanceList result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OpPerformanceData.OpPerformanceList) { + return mergeFrom((org.tensorflow.proto.OpPerformanceData.OpPerformanceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OpPerformanceData.OpPerformanceList other) { + if (other == org.tensorflow.proto.OpPerformanceData.OpPerformanceList.getDefaultInstance()) return this; + if (opPerformanceBuilder_ == null) { + if (!other.opPerformance_.isEmpty()) { + if (opPerformance_.isEmpty()) { + opPerformance_ = other.opPerformance_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOpPerformanceIsMutable(); + opPerformance_.addAll(other.opPerformance_); + } + onChanged(); + } + } else { + if (!other.opPerformance_.isEmpty()) { + if (opPerformanceBuilder_.isEmpty()) { + opPerformanceBuilder_.dispose(); + opPerformanceBuilder_ = null; + opPerformance_ = other.opPerformance_; + bitField0_ = (bitField0_ & ~0x00000001); + opPerformanceBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getOpPerformanceFieldBuilder() : null; + } else { + opPerformanceBuilder_.addAllMessages(other.opPerformance_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.OpPerformanceData.OpPerformance m = + input.readMessage( + org.tensorflow.proto.OpPerformanceData.OpPerformance.parser(), + extensionRegistry); + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + opPerformance_.add(m); + } else { + opPerformanceBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List opPerformance_ = + java.util.Collections.emptyList(); + private void ensureOpPerformanceIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + opPerformance_ = new java.util.ArrayList(opPerformance_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder> opPerformanceBuilder_; + + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public java.util.List getOpPerformanceList() { + if (opPerformanceBuilder_ == null) { + return java.util.Collections.unmodifiableList(opPerformance_); + } else { + return opPerformanceBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public int getOpPerformanceCount() { + if (opPerformanceBuilder_ == null) { + return opPerformance_.size(); + } else { + return opPerformanceBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance getOpPerformance(int index) { + if (opPerformanceBuilder_ == null) { + return opPerformance_.get(index); + } else { + return opPerformanceBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder setOpPerformance( + int index, org.tensorflow.proto.OpPerformanceData.OpPerformance value) { + if (opPerformanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpPerformanceIsMutable(); + opPerformance_.set(index, value); + onChanged(); + } else { + opPerformanceBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder setOpPerformance( + int index, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder builderForValue) { + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + opPerformance_.set(index, builderForValue.build()); + onChanged(); + } else { + opPerformanceBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder addOpPerformance(org.tensorflow.proto.OpPerformanceData.OpPerformance value) { + if (opPerformanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpPerformanceIsMutable(); + opPerformance_.add(value); + onChanged(); + } else { + opPerformanceBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder addOpPerformance( + int index, org.tensorflow.proto.OpPerformanceData.OpPerformance value) { + if (opPerformanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOpPerformanceIsMutable(); + opPerformance_.add(index, value); + onChanged(); + } else { + opPerformanceBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder addOpPerformance( + org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder builderForValue) { + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + opPerformance_.add(builderForValue.build()); + onChanged(); + } else { + opPerformanceBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder addOpPerformance( + int index, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder builderForValue) { + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + opPerformance_.add(index, builderForValue.build()); + onChanged(); + } else { + opPerformanceBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder addAllOpPerformance( + java.lang.Iterable values) { + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, opPerformance_); + onChanged(); + } else { + opPerformanceBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder clearOpPerformance() { + if (opPerformanceBuilder_ == null) { + opPerformance_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + opPerformanceBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public Builder removeOpPerformance(int index) { + if (opPerformanceBuilder_ == null) { + ensureOpPerformanceIsMutable(); + opPerformance_.remove(index); + onChanged(); + } else { + opPerformanceBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder getOpPerformanceBuilder( + int index) { + return getOpPerformanceFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder getOpPerformanceOrBuilder( + int index) { + if (opPerformanceBuilder_ == null) { + return opPerformance_.get(index); } else { + return opPerformanceBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public java.util.List + getOpPerformanceOrBuilderList() { + if (opPerformanceBuilder_ != null) { + return opPerformanceBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(opPerformance_); + } + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder addOpPerformanceBuilder() { + return getOpPerformanceFieldBuilder().addBuilder( + org.tensorflow.proto.OpPerformanceData.OpPerformance.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder addOpPerformanceBuilder( + int index) { + return getOpPerformanceFieldBuilder().addBuilder( + index, org.tensorflow.proto.OpPerformanceData.OpPerformance.getDefaultInstance()); + } + /** + * repeated .tensorflow.OpPerformance op_performance = 1; + */ + public java.util.List + getOpPerformanceBuilderList() { + return getOpPerformanceFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder> + getOpPerformanceFieldBuilder() { + if (opPerformanceBuilder_ == null) { + opPerformanceBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.OpPerformanceData.OpPerformance, org.tensorflow.proto.OpPerformanceData.OpPerformance.Builder, org.tensorflow.proto.OpPerformanceData.OpPerformanceOrBuilder>( + opPerformance_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + opPerformance_ = null; + } + return opPerformanceBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OpPerformanceList) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OpPerformanceList) + private static final org.tensorflow.proto.OpPerformanceData.OpPerformanceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OpPerformanceData.OpPerformanceList(); + } + + public static org.tensorflow.proto.OpPerformanceData.OpPerformanceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpPerformanceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OpPerformanceData.OpPerformanceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SessionInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SessionInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpInfo_AttrEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpInfo_AttrEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpInfo_TensorProperties_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NormalDistribution_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NormalDistribution_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_LogNormalDistribution_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpPerformance_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpPerformance_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpPerformance_OpMemory_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OpPerformanceList_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OpPerformanceList_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n8tensorflow/core/grappler/costs/op_perf" + + "ormance_data.proto\022\ntensorflow\032&tensorfl" + + "ow/core/framework/tensor.proto\032,tensorfl" + + "ow/core/framework/tensor_shape.proto\032%te" + + "nsorflow/core/framework/types.proto\032*ten" + + "sorflow/core/framework/attr_value.proto\032" + + "0tensorflow/core/protobuf/device_propert" + + "ies.proto\"+\n\013SessionInfo\022\034\n\024intra_op_par" + + "allelism\030\001 \001(\003\"\333\003\n\006OpInfo\022\n\n\002op\030\001 \001(\t\022*\n" + + "\004attr\030\002 \003(\0132\034.tensorflow.OpInfo.AttrEntr" + + "y\0223\n\006inputs\030\003 \003(\0132#.tensorflow.OpInfo.Te" + + "nsorProperties\0224\n\007outputs\030\005 \003(\0132#.tensor" + + "flow.OpInfo.TensorProperties\022,\n\006device\030\004" + + " \001(\0132\034.tensorflow.DeviceProperties\022-\n\014se" + + "ssion_info\030\006 \001(\0132\027.tensorflow.SessionInf" + + "o\032B\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001" + + "(\0132\025.tensorflow.AttrValue:\0028\001\032\214\001\n\020Tensor" + + "Properties\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.D" + + "ataType\022+\n\005shape\030\002 \001(\0132\034.tensorflow.Tens" + + "orShapeProto\022&\n\005value\030\003 \001(\0132\027.tensorflow" + + ".TensorProto\"/\n\022NormalDistribution\022\n\n\002mu" + + "\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"2\n\025LogNormalDistri" + + "bution\022\n\n\002mu\030\001 \001(\001\022\r\n\005sigma\030\002 \001(\001\"\363\004\n\rOp" + + "Performance\022\036\n\002op\030\001 \001(\0132\022.tensorflow.OpI" + + "nfo\0221\n\014session_info\030\014 \001(\0132\027.tensorflow.S" + + "essionInfoB\002\030\001\022\014\n\004node\030\005 \001(\t\022\035\n\025temporar" + + "y_memory_size\030\002 \001(\003\022\024\n\014compute_cost\030\003 \001(" + + "\003\022\024\n\014compute_time\030\006 \001(\003\022\023\n\013memory_time\030\007" + + " \001(\003\022\032\n\022compute_efficiency\030\004 \001(\001\022\031\n\021memo" + + "ry_efficiency\030\010 \001(\001\022?\n\025execution_time_no" + + "rmal\030\n \001(\0132\036.tensorflow.NormalDistributi" + + "onH\000\022F\n\031execution_time_log_normal\030\013 \001(\0132" + + "!.tensorflow.LogNormalDistributionH\000\0225\n\t" + + "op_memory\030\t \001(\0132\".tensorflow.OpPerforman" + + "ce.OpMemory\032\227\001\n\010OpMemory\022\025\n\routput_memor" + + "y\030\001 \003(\003\022\023\n\013temp_memory\030\002 \001(\003\022\031\n\021persiste" + + "nt_memory\030\004 \001(\003\022\036\n\022device_temp_memory\030\003 " + + "\001(\003B\002\030\001\022$\n\030device_persistent_memory\030\005 \001(" + + "\003B\002\030\001B\020\n\016execution_time\"F\n\021OpPerformance" + + "List\0221\n\016op_performance\030\001 \003(\0132\031.tensorflo" + + "w.OpPerformanceB\031\n\024org.tensorflow.proto\370" + + "\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + org.tensorflow.proto.DevicePropertiesProtos.getDescriptor(), + }); + internal_static_tensorflow_SessionInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_SessionInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SessionInfo_descriptor, + new java.lang.String[] { "IntraOpParallelism", }); + internal_static_tensorflow_OpInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_OpInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpInfo_descriptor, + new java.lang.String[] { "Op", "Attr", "Inputs", "Outputs", "Device", "SessionInfo", }); + internal_static_tensorflow_OpInfo_AttrEntry_descriptor = + internal_static_tensorflow_OpInfo_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_OpInfo_AttrEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpInfo_AttrEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_OpInfo_TensorProperties_descriptor = + internal_static_tensorflow_OpInfo_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_OpInfo_TensorProperties_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpInfo_TensorProperties_descriptor, + new java.lang.String[] { "Dtype", "Shape", "Value", }); + internal_static_tensorflow_NormalDistribution_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_NormalDistribution_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NormalDistribution_descriptor, + new java.lang.String[] { "Mu", "Sigma", }); + internal_static_tensorflow_LogNormalDistribution_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_LogNormalDistribution_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_LogNormalDistribution_descriptor, + new java.lang.String[] { "Mu", "Sigma", }); + internal_static_tensorflow_OpPerformance_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_OpPerformance_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpPerformance_descriptor, + new java.lang.String[] { "Op", "SessionInfo", "Node", "TemporaryMemorySize", "ComputeCost", "ComputeTime", "MemoryTime", "ComputeEfficiency", "MemoryEfficiency", "ExecutionTimeNormal", "ExecutionTimeLogNormal", "OpMemory", "ExecutionTime", }); + internal_static_tensorflow_OpPerformance_OpMemory_descriptor = + internal_static_tensorflow_OpPerformance_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_OpPerformance_OpMemory_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpPerformance_OpMemory_descriptor, + new java.lang.String[] { "OutputMemory", "TempMemory", "PersistentMemory", "DeviceTempMemory", "DevicePersistentMemory", }); + internal_static_tensorflow_OpPerformanceList_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_OpPerformanceList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OpPerformanceList_descriptor, + new java.lang.String[] { "OpPerformance", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + org.tensorflow.proto.DevicePropertiesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizedFunctionGraphOuterClass.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizedFunctionGraphOuterClass.java new file mode 100644 index 00000000000..324e2a3431c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizedFunctionGraphOuterClass.java @@ -0,0 +1,2267 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/optimized_function_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class OptimizedFunctionGraphOuterClass { + private OptimizedFunctionGraphOuterClass() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizedFunctionGraphOuterClass.class.getName()); + } + 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 OptimizedFunctionGraphOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OptimizedFunctionGraph) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Function name. It can be a human-readable SignatureDef's method name, or a
    +     * FunctionDef name.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Function name. It can be a human-readable SignatureDef's method name, or a
    +     * FunctionDef name.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return Whether the functionGraph field is set. + */ + boolean hasFunctionGraph(); + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return The functionGraph. + */ + org.tensorflow.proto.GraphDef getFunctionGraph(); + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + org.tensorflow.proto.GraphDefOrBuilder getFunctionGraphOrBuilder(); + + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + int getNodeNameToControlRetCount(); + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + boolean containsNodeNameToControlRet( + java.lang.String key); + /** + * Use {@link #getNodeNameToControlRetMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getNodeNameToControlRet(); + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + java.util.Map + getNodeNameToControlRetMap(); + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + /* nullable */ +java.lang.String getNodeNameToControlRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + java.lang.String getNodeNameToControlRetOrThrow( + java.lang.String key); + + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the retTypes. + */ + java.util.List getRetTypesList(); + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return The count of retTypes. + */ + int getRetTypesCount(); + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the element to return. + * @return The retTypes at the given index. + */ + org.tensorflow.proto.DataType getRetTypes(int index); + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the enum numeric values on the wire for retTypes. + */ + java.util.List + getRetTypesValueList(); + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of retTypes at the given index. + */ + int getRetTypesValue(int index); + + /** + *
    +     * Number of return nodes. This is an output of graph preprocessing.
    +     * 
    + * + * uint32 num_return_nodes = 5; + * @return The numReturnNodes. + */ + int getNumReturnNodes(); + + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The enum numeric value on the wire for source. + */ + int getSourceValue(); + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The source. + */ + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource getSource(); + + /** + *
    +     * Time (in microseconds) spent on running the graph optimization passes for
    +     * this function.
    +     * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return Whether the optimizationTimeUsecs field is set. + */ + boolean hasOptimizationTimeUsecs(); + /** + *
    +     * Time (in microseconds) spent on running the graph optimization passes for
    +     * this function.
    +     * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return The optimizationTimeUsecs. + */ + long getOptimizationTimeUsecs(); + } + /** + *
    +   * Optimized function graph after instantiation-related graph optimization
    +   * passes (up till before graph partitioning). The first half of the proto is
    +   * representing a GraphDef and the rest of the fields are extra information from
    +   * graph optimizations.
    +   * 
    + * + * Protobuf type {@code tensorflow.OptimizedFunctionGraph} + */ + public static final class OptimizedFunctionGraph extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OptimizedFunctionGraph) + OptimizedFunctionGraphOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizedFunctionGraph.class.getName()); + } + // Use OptimizedFunctionGraph.newBuilder() to construct. + private OptimizedFunctionGraph(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OptimizedFunctionGraph() { + name_ = ""; + retTypes_ = emptyIntList(); + source_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetNodeNameToControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.class, org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.Builder.class); + } + + /** + *
    +     * Enum for distinguishing the origin where the proto is created.
    +     *
    +     * AOT: proto is created in ahead-of-time environment, which can be different
    +     * from the environment where the graph is actually executed.
    +     *
    +     * JIT: proto is created in just-in-time execution, which has the same
    +     * environment as the one the graph is actually executed.
    +     * 
    + * + * Protobuf enum {@code tensorflow.OptimizedFunctionGraph.OptimizationSource} + */ + public enum OptimizationSource + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SOURCE_UNSPECIFIED = 0; + */ + SOURCE_UNSPECIFIED(0), + /** + * AOT = 1; + */ + AOT(1), + /** + * JIT = 2; + */ + JIT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizationSource.class.getName()); + } + /** + * SOURCE_UNSPECIFIED = 0; + */ + public static final int SOURCE_UNSPECIFIED_VALUE = 0; + /** + * AOT = 1; + */ + public static final int AOT_VALUE = 1; + /** + * JIT = 2; + */ + public static final int JIT_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptimizationSource valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OptimizationSource forNumber(int value) { + switch (value) { + case 0: return SOURCE_UNSPECIFIED; + case 1: return AOT; + case 2: return JIT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OptimizationSource> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OptimizationSource findValueByNumber(int number) { + return OptimizationSource.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.getDescriptor().getEnumTypes().get(0); + } + + private static final OptimizationSource[] VALUES = values(); + + public static OptimizationSource 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 OptimizationSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.OptimizedFunctionGraph.OptimizationSource) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Function name. It can be a human-readable SignatureDef's method name, or a
    +     * FunctionDef name.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Function name. It can be a human-readable SignatureDef's method name, or a
    +     * FunctionDef name.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 FUNCTION_GRAPH_FIELD_NUMBER = 2; + private org.tensorflow.proto.GraphDef functionGraph_; + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return Whether the functionGraph field is set. + */ + @java.lang.Override + public boolean hasFunctionGraph() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return The functionGraph. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getFunctionGraph() { + return functionGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : functionGraph_; + } + /** + *
    +     * Optimized function graph.
    +     * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getFunctionGraphOrBuilder() { + return functionGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : functionGraph_; + } + + public static final int NODE_NAME_TO_CONTROL_RET_FIELD_NUMBER = 3; + private static final class NodeNameToControlRetDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> nodeNameToControlRet_; + private com.google.protobuf.MapField + internalGetNodeNameToControlRet() { + if (nodeNameToControlRet_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NodeNameToControlRetDefaultEntryHolder.defaultEntry); + } + return nodeNameToControlRet_; + } + public int getNodeNameToControlRetCount() { + return internalGetNodeNameToControlRet().getMap().size(); + } + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public boolean containsNodeNameToControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetNodeNameToControlRet().getMap().containsKey(key); + } + /** + * Use {@link #getNodeNameToControlRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNodeNameToControlRet() { + return getNodeNameToControlRetMap(); + } + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public java.util.Map getNodeNameToControlRetMap() { + return internalGetNodeNameToControlRet().getMap(); + } + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getNodeNameToControlRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNodeNameToControlRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Maps from node name to control ret. This is an output from running TF/XLA
    +     * bridge.
    +     * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public java.lang.String getNodeNameToControlRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNodeNameToControlRet().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RET_TYPES_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList retTypes_; + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType> retTypes_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType>() { + public org.tensorflow.proto.DataType convert(int from) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(from); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + }; + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the retTypes. + */ + @java.lang.Override + public java.util.List getRetTypesList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(retTypes_, retTypes_converter_); + } + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return The count of retTypes. + */ + @java.lang.Override + public int getRetTypesCount() { + return retTypes_.size(); + } + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the element to return. + * @return The retTypes at the given index. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getRetTypes(int index) { + return retTypes_converter_.convert(retTypes_.getInt(index)); + } + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the enum numeric values on the wire for retTypes. + */ + @java.lang.Override + public java.util.List + getRetTypesValueList() { + return retTypes_; + } + /** + *
    +     * Return node types of the function. This is an output of graph
    +     * preprocessing.
    +     * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of retTypes at the given index. + */ + @java.lang.Override + public int getRetTypesValue(int index) { + return retTypes_.getInt(index); + } + private int retTypesMemoizedSerializedSize; + + public static final int NUM_RETURN_NODES_FIELD_NUMBER = 5; + private int numReturnNodes_ = 0; + /** + *
    +     * Number of return nodes. This is an output of graph preprocessing.
    +     * 
    + * + * uint32 num_return_nodes = 5; + * @return The numReturnNodes. + */ + @java.lang.Override + public int getNumReturnNodes() { + return numReturnNodes_; + } + + public static final int SOURCE_FIELD_NUMBER = 7; + private int source_ = 0; + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return Whether the source field is set. + */ + @java.lang.Override public boolean hasSource() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The enum numeric value on the wire for source. + */ + @java.lang.Override public int getSourceValue() { + return source_; + } + /** + *
    +     * Indicates the source environment where this proto is generated.
    +     * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The source. + */ + @java.lang.Override public org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource getSource() { + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource result = org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource.forNumber(source_); + return result == null ? org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource.UNRECOGNIZED : result; + } + + public static final int OPTIMIZATION_TIME_USECS_FIELD_NUMBER = 8; + private long optimizationTimeUsecs_ = 0L; + /** + *
    +     * Time (in microseconds) spent on running the graph optimization passes for
    +     * this function.
    +     * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return Whether the optimizationTimeUsecs field is set. + */ + @java.lang.Override + public boolean hasOptimizationTimeUsecs() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Time (in microseconds) spent on running the graph optimization passes for
    +     * this function.
    +     * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return The optimizationTimeUsecs. + */ + @java.lang.Override + public long getOptimizationTimeUsecs() { + return optimizationTimeUsecs_; + } + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFunctionGraph()); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetNodeNameToControlRet(), + NodeNameToControlRetDefaultEntryHolder.defaultEntry, + 3); + if (getRetTypesList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(retTypesMemoizedSerializedSize); + } + for (int i = 0; i < retTypes_.size(); i++) { + output.writeEnumNoTag(retTypes_.getInt(i)); + } + if (numReturnNodes_ != 0) { + output.writeUInt32(5, numReturnNodes_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeEnum(7, source_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeUInt64(8, optimizationTimeUsecs_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFunctionGraph()); + } + for (java.util.Map.Entry entry + : internalGetNodeNameToControlRet().getMap().entrySet()) { + com.google.protobuf.MapEntry + nodeNameToControlRet__ = NodeNameToControlRetDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, nodeNameToControlRet__); + } + { + int dataSize = 0; + for (int i = 0; i < retTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(retTypes_.getInt(i)); + } + size += dataSize; + if (!getRetTypesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }retTypesMemoizedSerializedSize = dataSize; + } + if (numReturnNodes_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, numReturnNodes_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, source_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(8, optimizationTimeUsecs_); + } + size += getUnknownFields().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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph)) { + return super.equals(obj); + } + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph other = (org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasFunctionGraph() != other.hasFunctionGraph()) return false; + if (hasFunctionGraph()) { + if (!getFunctionGraph() + .equals(other.getFunctionGraph())) return false; + } + if (!internalGetNodeNameToControlRet().equals( + other.internalGetNodeNameToControlRet())) return false; + if (!retTypes_.equals(other.retTypes_)) return false; + if (getNumReturnNodes() + != other.getNumReturnNodes()) return false; + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (source_ != other.source_) return false; + } + if (hasOptimizationTimeUsecs() != other.hasOptimizationTimeUsecs()) return false; + if (hasOptimizationTimeUsecs()) { + if (getOptimizationTimeUsecs() + != other.getOptimizationTimeUsecs()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasFunctionGraph()) { + hash = (37 * hash) + FUNCTION_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + getFunctionGraph().hashCode(); + } + if (!internalGetNodeNameToControlRet().getMap().isEmpty()) { + hash = (37 * hash) + NODE_NAME_TO_CONTROL_RET_FIELD_NUMBER; + hash = (53 * hash) + internalGetNodeNameToControlRet().hashCode(); + } + if (getRetTypesCount() > 0) { + hash = (37 * hash) + RET_TYPES_FIELD_NUMBER; + hash = (53 * hash) + retTypes_.hashCode(); + } + hash = (37 * hash) + NUM_RETURN_NODES_FIELD_NUMBER; + hash = (53 * hash) + getNumReturnNodes(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + source_; + } + if (hasOptimizationTimeUsecs()) { + hash = (37 * hash) + OPTIMIZATION_TIME_USECS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOptimizationTimeUsecs()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph 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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph 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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Optimized function graph after instantiation-related graph optimization
    +     * passes (up till before graph partitioning). The first half of the proto is
    +     * representing a GraphDef and the rest of the fields are extra information from
    +     * graph optimizations.
    +     * 
    + * + * Protobuf type {@code tensorflow.OptimizedFunctionGraph} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OptimizedFunctionGraph) + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetNodeNameToControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableNodeNameToControlRet(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.class, org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.Builder.class); + } + + // Construct using org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFunctionGraphFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + functionGraph_ = null; + if (functionGraphBuilder_ != null) { + functionGraphBuilder_.dispose(); + functionGraphBuilder_ = null; + } + internalGetMutableNodeNameToControlRet().clear(); + retTypes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000008); + numReturnNodes_ = 0; + source_ = 0; + optimizationTimeUsecs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.internal_static_tensorflow_OptimizedFunctionGraph_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph getDefaultInstanceForType() { + return org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph build() { + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph buildPartial() { + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph result = new org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph result) { + if (((bitField0_ & 0x00000008) != 0)) { + retTypes_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.retTypes_ = retTypes_; + } + + private void buildPartial0(org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.functionGraph_ = functionGraphBuilder_ == null + ? functionGraph_ + : functionGraphBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nodeNameToControlRet_ = internalGetNodeNameToControlRet(); + result.nodeNameToControlRet_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.numReturnNodes_ = numReturnNodes_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.source_ = source_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.optimizationTimeUsecs_ = optimizationTimeUsecs_; + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph) { + return mergeFrom((org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph other) { + if (other == org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFunctionGraph()) { + mergeFunctionGraph(other.getFunctionGraph()); + } + internalGetMutableNodeNameToControlRet().mergeFrom( + other.internalGetNodeNameToControlRet()); + bitField0_ |= 0x00000004; + if (!other.retTypes_.isEmpty()) { + if (retTypes_.isEmpty()) { + retTypes_ = other.retTypes_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureRetTypesIsMutable(); + retTypes_.addAll(other.retTypes_); + } + onChanged(); + } + if (other.getNumReturnNodes() != 0) { + setNumReturnNodes(other.getNumReturnNodes()); + } + if (other.hasSource()) { + setSource(other.getSource()); + } + if (other.hasOptimizationTimeUsecs()) { + setOptimizationTimeUsecs(other.getOptimizationTimeUsecs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getFunctionGraphFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + nodeNameToControlRet__ = input.readMessage( + NodeNameToControlRetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableNodeNameToControlRet().getMutableMap().put( + nodeNameToControlRet__.getKey(), nodeNameToControlRet__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + int tmpRaw = input.readEnum(); + ensureRetTypesIsMutable(); + retTypes_.addInt(tmpRaw); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureRetTypesIsMutable(); + retTypes_.addInt(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 34 + case 40: { + numReturnNodes_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 56: { + source_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 64: { + optimizationTimeUsecs_ = input.readUInt64(); + bitField0_ |= 0x00000040; + break; + } // case 64 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * Function name. It can be a human-readable SignatureDef's method name, or a
    +       * FunctionDef name.
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Function name. It can be a human-readable SignatureDef's method name, or a
    +       * FunctionDef name.
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Function name. It can be a human-readable SignatureDef's method name, or a
    +       * FunctionDef name.
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Function name. It can be a human-readable SignatureDef's method name, or a
    +       * FunctionDef name.
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Function name. It can be a human-readable SignatureDef's method name, or a
    +       * FunctionDef name.
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.GraphDef functionGraph_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> functionGraphBuilder_; + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return Whether the functionGraph field is set. + */ + public boolean hasFunctionGraph() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + * @return The functionGraph. + */ + public org.tensorflow.proto.GraphDef getFunctionGraph() { + if (functionGraphBuilder_ == null) { + return functionGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : functionGraph_; + } else { + return functionGraphBuilder_.getMessage(); + } + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public Builder setFunctionGraph(org.tensorflow.proto.GraphDef value) { + if (functionGraphBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + functionGraph_ = value; + } else { + functionGraphBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public Builder setFunctionGraph( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (functionGraphBuilder_ == null) { + functionGraph_ = builderForValue.build(); + } else { + functionGraphBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public Builder mergeFunctionGraph(org.tensorflow.proto.GraphDef value) { + if (functionGraphBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + functionGraph_ != null && + functionGraph_ != org.tensorflow.proto.GraphDef.getDefaultInstance()) { + getFunctionGraphBuilder().mergeFrom(value); + } else { + functionGraph_ = value; + } + } else { + functionGraphBuilder_.mergeFrom(value); + } + if (functionGraph_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public Builder clearFunctionGraph() { + bitField0_ = (bitField0_ & ~0x00000002); + functionGraph_ = null; + if (functionGraphBuilder_ != null) { + functionGraphBuilder_.dispose(); + functionGraphBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public org.tensorflow.proto.GraphDef.Builder getFunctionGraphBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFunctionGraphFieldBuilder().getBuilder(); + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + public org.tensorflow.proto.GraphDefOrBuilder getFunctionGraphOrBuilder() { + if (functionGraphBuilder_ != null) { + return functionGraphBuilder_.getMessageOrBuilder(); + } else { + return functionGraph_ == null ? + org.tensorflow.proto.GraphDef.getDefaultInstance() : functionGraph_; + } + } + /** + *
    +       * Optimized function graph.
    +       * 
    + * + * .tensorflow.GraphDef function_graph = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getFunctionGraphFieldBuilder() { + if (functionGraphBuilder_ == null) { + functionGraphBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + getFunctionGraph(), + getParentForChildren(), + isClean()); + functionGraph_ = null; + } + return functionGraphBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> nodeNameToControlRet_; + private com.google.protobuf.MapField + internalGetNodeNameToControlRet() { + if (nodeNameToControlRet_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NodeNameToControlRetDefaultEntryHolder.defaultEntry); + } + return nodeNameToControlRet_; + } + private com.google.protobuf.MapField + internalGetMutableNodeNameToControlRet() { + if (nodeNameToControlRet_ == null) { + nodeNameToControlRet_ = com.google.protobuf.MapField.newMapField( + NodeNameToControlRetDefaultEntryHolder.defaultEntry); + } + if (!nodeNameToControlRet_.isMutable()) { + nodeNameToControlRet_ = nodeNameToControlRet_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return nodeNameToControlRet_; + } + public int getNodeNameToControlRetCount() { + return internalGetNodeNameToControlRet().getMap().size(); + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public boolean containsNodeNameToControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetNodeNameToControlRet().getMap().containsKey(key); + } + /** + * Use {@link #getNodeNameToControlRetMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNodeNameToControlRet() { + return getNodeNameToControlRetMap(); + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public java.util.Map getNodeNameToControlRetMap() { + return internalGetNodeNameToControlRet().getMap(); + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getNodeNameToControlRetOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNodeNameToControlRet().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + @java.lang.Override + public java.lang.String getNodeNameToControlRetOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetNodeNameToControlRet().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearNodeNameToControlRet() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableNodeNameToControlRet().getMutableMap() + .clear(); + return this; + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + public Builder removeNodeNameToControlRet( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableNodeNameToControlRet().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableNodeNameToControlRet() { + bitField0_ |= 0x00000004; + return internalGetMutableNodeNameToControlRet().getMutableMap(); + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + public Builder putNodeNameToControlRet( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableNodeNameToControlRet().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
    +       * Maps from node name to control ret. This is an output from running TF/XLA
    +       * bridge.
    +       * 
    + * + * map<string, string> node_name_to_control_ret = 3; + */ + public Builder putAllNodeNameToControlRet( + java.util.Map values) { + internalGetMutableNodeNameToControlRet().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + private com.google.protobuf.Internal.IntList retTypes_ = + emptyIntList(); + private void ensureRetTypesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + retTypes_ = makeMutableCopy(retTypes_); + bitField0_ |= 0x00000008; + } + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the retTypes. + */ + public java.util.List getRetTypesList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(retTypes_, retTypes_converter_); + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return The count of retTypes. + */ + public int getRetTypesCount() { + return retTypes_.size(); + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the element to return. + * @return The retTypes at the given index. + */ + public org.tensorflow.proto.DataType getRetTypes(int index) { + return retTypes_converter_.convert(retTypes_.getInt(index)); + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index to set the value at. + * @param value The retTypes to set. + * @return This builder for chaining. + */ + public Builder setRetTypes( + int index, org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRetTypesIsMutable(); + retTypes_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param value The retTypes to add. + * @return This builder for chaining. + */ + public Builder addRetTypes(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRetTypesIsMutable(); + retTypes_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param values The retTypes to add. + * @return This builder for chaining. + */ + public Builder addAllRetTypes( + java.lang.Iterable values) { + ensureRetTypesIsMutable(); + for (org.tensorflow.proto.DataType value : values) { + retTypes_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return This builder for chaining. + */ + public Builder clearRetTypes() { + retTypes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @return A list containing the enum numeric values on the wire for retTypes. + */ + public java.util.List + getRetTypesValueList() { + return java.util.Collections.unmodifiableList(retTypes_); + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of retTypes at the given index. + */ + public int getRetTypesValue(int index) { + return retTypes_.getInt(index); + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for retTypes to set. + * @return This builder for chaining. + */ + public Builder setRetTypesValue( + int index, int value) { + ensureRetTypesIsMutable(); + retTypes_.setInt(index, value); + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param value The enum numeric value on the wire for retTypes to add. + * @return This builder for chaining. + */ + public Builder addRetTypesValue(int value) { + ensureRetTypesIsMutable(); + retTypes_.addInt(value); + onChanged(); + return this; + } + /** + *
    +       * Return node types of the function. This is an output of graph
    +       * preprocessing.
    +       * 
    + * + * repeated .tensorflow.DataType ret_types = 4; + * @param values The enum numeric values on the wire for retTypes to add. + * @return This builder for chaining. + */ + public Builder addAllRetTypesValue( + java.lang.Iterable values) { + ensureRetTypesIsMutable(); + for (int value : values) { + retTypes_.addInt(value); + } + onChanged(); + return this; + } + + private int numReturnNodes_ ; + /** + *
    +       * Number of return nodes. This is an output of graph preprocessing.
    +       * 
    + * + * uint32 num_return_nodes = 5; + * @return The numReturnNodes. + */ + @java.lang.Override + public int getNumReturnNodes() { + return numReturnNodes_; + } + /** + *
    +       * Number of return nodes. This is an output of graph preprocessing.
    +       * 
    + * + * uint32 num_return_nodes = 5; + * @param value The numReturnNodes to set. + * @return This builder for chaining. + */ + public Builder setNumReturnNodes(int value) { + + numReturnNodes_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Number of return nodes. This is an output of graph preprocessing.
    +       * 
    + * + * uint32 num_return_nodes = 5; + * @return This builder for chaining. + */ + public Builder clearNumReturnNodes() { + bitField0_ = (bitField0_ & ~0x00000010); + numReturnNodes_ = 0; + onChanged(); + return this; + } + + private int source_ = 0; + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return Whether the source field is set. + */ + @java.lang.Override public boolean hasSource() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The enum numeric value on the wire for source. + */ + @java.lang.Override public int getSourceValue() { + return source_; + } + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @param value The enum numeric value on the wire for source to set. + * @return This builder for chaining. + */ + public Builder setSourceValue(int value) { + source_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return The source. + */ + @java.lang.Override + public org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource getSource() { + org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource result = org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource.forNumber(source_); + return result == null ? org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource.UNRECOGNIZED : result; + } + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource(org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph.OptimizationSource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + source_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Indicates the source environment where this proto is generated.
    +       * 
    + * + * optional .tensorflow.OptimizedFunctionGraph.OptimizationSource source = 7; + * @return This builder for chaining. + */ + public Builder clearSource() { + bitField0_ = (bitField0_ & ~0x00000020); + source_ = 0; + onChanged(); + return this; + } + + private long optimizationTimeUsecs_ ; + /** + *
    +       * Time (in microseconds) spent on running the graph optimization passes for
    +       * this function.
    +       * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return Whether the optimizationTimeUsecs field is set. + */ + @java.lang.Override + public boolean hasOptimizationTimeUsecs() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +       * Time (in microseconds) spent on running the graph optimization passes for
    +       * this function.
    +       * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return The optimizationTimeUsecs. + */ + @java.lang.Override + public long getOptimizationTimeUsecs() { + return optimizationTimeUsecs_; + } + /** + *
    +       * Time (in microseconds) spent on running the graph optimization passes for
    +       * this function.
    +       * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @param value The optimizationTimeUsecs to set. + * @return This builder for chaining. + */ + public Builder setOptimizationTimeUsecs(long value) { + + optimizationTimeUsecs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Time (in microseconds) spent on running the graph optimization passes for
    +       * this function.
    +       * 
    + * + * optional uint64 optimization_time_usecs = 8; + * @return This builder for chaining. + */ + public Builder clearOptimizationTimeUsecs() { + bitField0_ = (bitField0_ & ~0x00000040); + optimizationTimeUsecs_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OptimizedFunctionGraph) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OptimizedFunctionGraph) + private static final org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph(); + } + + public static org.tensorflow.proto.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizedFunctionGraph parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OptimizedFunctionGraphOuterClass.OptimizedFunctionGraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OptimizedFunctionGraph_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OptimizedFunctionGraph_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n8tensorflow/core/framework/optimized_fu" + + "nction_graph.proto\022\ntensorflow\032%tensorfl" + + "ow/core/framework/graph.proto\032%tensorflo" + + "w/core/framework/types.proto\"\223\004\n\026Optimiz" + + "edFunctionGraph\022\014\n\004name\030\001 \001(\t\022,\n\016functio" + + "n_graph\030\002 \001(\0132\024.tensorflow.GraphDef\022^\n\030n" + + "ode_name_to_control_ret\030\003 \003(\0132<.tensorfl" + + "ow.OptimizedFunctionGraph.NodeNameToCont" + + "rolRetEntry\022\'\n\tret_types\030\004 \003(\0162\024.tensorf" + + "low.DataType\022\030\n\020num_return_nodes\030\005 \001(\r\022J" + + "\n\006source\030\007 \001(\01625.tensorflow.OptimizedFun" + + "ctionGraph.OptimizationSourceH\000\210\001\001\022$\n\027op" + + "timization_time_usecs\030\010 \001(\004H\001\210\001\001\032;\n\031Node" + + "NameToControlRetEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\">\n\022OptimizationSource\022\026\n\022S" + + "OURCE_UNSPECIFIED\020\000\022\007\n\003AOT\020\001\022\007\n\003JIT\020\002B\t\n" + + "\007_sourceB\032\n\030_optimization_time_usecsJ\004\010\006" + + "\020\007B\026\n\024org.tensorflow.protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.GraphProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_OptimizedFunctionGraph_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_OptimizedFunctionGraph_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OptimizedFunctionGraph_descriptor, + new java.lang.String[] { "Name", "FunctionGraph", "NodeNameToControlRet", "RetTypes", "NumReturnNodes", "Source", "OptimizationTimeUsecs", }); + internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_descriptor = + internal_static_tensorflow_OptimizedFunctionGraph_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_OptimizedFunctionGraph_NodeNameToControlRetEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.GraphProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptions.java new file mode 100644 index 00000000000..3db93f28f92 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptions.java @@ -0,0 +1,1359 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Options passed to the graph optimizer
    + * 
    + * + * Protobuf type {@code tensorflow.OptimizerOptions} + */ +public final class OptimizerOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.OptimizerOptions) + OptimizerOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizerOptions.class.getName()); + } + // Use OptimizerOptions.newBuilder() to construct. + private OptimizerOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OptimizerOptions() { + optLevel_ = 0; + globalJitLevel_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OptimizerOptions.class, org.tensorflow.proto.OptimizerOptions.Builder.class); + } + + /** + *
    +   * Optimization level
    +   * 
    + * + * Protobuf enum {@code tensorflow.OptimizerOptions.Level} + */ + public enum Level + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * L1 is the default level.
    +     * Optimization performed at L1 :
    +     * 1. Common subexpression elimination
    +     * 2. Constant folding
    +     * 
    + * + * L1 = 0; + */ + L1(0), + /** + *
    +     * No optimizations
    +     * 
    + * + * L0 = -1; + */ + L0(-1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Level.class.getName()); + } + /** + *
    +     * L1 is the default level.
    +     * Optimization performed at L1 :
    +     * 1. Common subexpression elimination
    +     * 2. Constant folding
    +     * 
    + * + * L1 = 0; + */ + public static final int L1_VALUE = 0; + /** + *
    +     * No optimizations
    +     * 
    + * + * L0 = -1; + */ + public static final int L0_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Level valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Level forNumber(int value) { + switch (value) { + case 0: return L1; + case -1: return L0; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Level> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Level findValueByNumber(int number) { + return Level.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.OptimizerOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final Level[] VALUES = values(); + + public static Level 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 Level(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.Level) + } + + /** + *
    +   * Control the use of the compiler/jit.  Experimental.
    +   * 
    + * + * Protobuf enum {@code tensorflow.OptimizerOptions.GlobalJitLevel} + */ + public enum GlobalJitLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * Default setting ("off" now, but later expected to be "on")
    +     * 
    + * + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * OFF = -1; + */ + OFF(-1), + /** + *
    +     * The following settings turn on compilation, with higher values being
    +     * more aggressive.  Higher values may reduce opportunities for parallelism
    +     * and may use more memory.  (At present, there is no distinction, but this
    +     * is expected to change.)
    +     * 
    + * + * ON_1 = 1; + */ + ON_1(1), + /** + * ON_2 = 2; + */ + ON_2(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GlobalJitLevel.class.getName()); + } + /** + *
    +     * Default setting ("off" now, but later expected to be "on")
    +     * 
    + * + * DEFAULT = 0; + */ + public static final int DEFAULT_VALUE = 0; + /** + * OFF = -1; + */ + public static final int OFF_VALUE = -1; + /** + *
    +     * The following settings turn on compilation, with higher values being
    +     * more aggressive.  Higher values may reduce opportunities for parallelism
    +     * and may use more memory.  (At present, there is no distinction, but this
    +     * is expected to change.)
    +     * 
    + * + * ON_1 = 1; + */ + public static final int ON_1_VALUE = 1; + /** + * ON_2 = 2; + */ + public static final int ON_2_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static GlobalJitLevel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static GlobalJitLevel forNumber(int value) { + switch (value) { + case 0: return DEFAULT; + case -1: return OFF; + case 1: return ON_1; + case 2: return ON_2; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + GlobalJitLevel> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public GlobalJitLevel findValueByNumber(int number) { + return GlobalJitLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.OptimizerOptions.getDescriptor().getEnumTypes().get(1); + } + + private static final GlobalJitLevel[] VALUES = values(); + + public static GlobalJitLevel 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 GlobalJitLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.GlobalJitLevel) + } + + public static final int DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER = 1; + private boolean doCommonSubexpressionElimination_ = false; + /** + *
    +   * If true, optimize the graph using common subexpression elimination.
    +   * Note: the optimization Level L1 will override this setting to true. So in
    +   * order to disable common subexpression elimination the opt_level has to be
    +   * set to L0.
    +   * 
    + * + * bool do_common_subexpression_elimination = 1; + * @return The doCommonSubexpressionElimination. + */ + @java.lang.Override + public boolean getDoCommonSubexpressionElimination() { + return doCommonSubexpressionElimination_; + } + + public static final int DO_CONSTANT_FOLDING_FIELD_NUMBER = 2; + private boolean doConstantFolding_ = false; + /** + *
    +   * If true, perform constant folding optimization on the graph.
    +   * Note: the optimization Level L1 will override this setting to true. So in
    +   * order to disable constant folding the opt_level has to be set to L0.
    +   * 
    + * + * bool do_constant_folding = 2; + * @return The doConstantFolding. + */ + @java.lang.Override + public boolean getDoConstantFolding() { + return doConstantFolding_; + } + + public static final int MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER = 6; + private long maxFoldedConstantInBytes_ = 0L; + /** + *
    +   * Constant folding optimization replaces tensors whose values can be
    +   * predetermined, with constant nodes. To avoid inserting too large constants,
    +   * the size of each constant created can be limited. If this value is zero, a
    +   * default limit of 10 MiB will be applied. If constant folding optimization
    +   * is disabled, this value is ignored.
    +   * 
    + * + * int64 max_folded_constant_in_bytes = 6; + * @return The maxFoldedConstantInBytes. + */ + @java.lang.Override + public long getMaxFoldedConstantInBytes() { + return maxFoldedConstantInBytes_; + } + + public static final int DO_FUNCTION_INLINING_FIELD_NUMBER = 4; + private boolean doFunctionInlining_ = false; + /** + *
    +   * If true, perform function inlining on the graph.
    +   * 
    + * + * bool do_function_inlining = 4; + * @return The doFunctionInlining. + */ + @java.lang.Override + public boolean getDoFunctionInlining() { + return doFunctionInlining_; + } + + public static final int OPT_LEVEL_FIELD_NUMBER = 3; + private int optLevel_ = 0; + /** + *
    +   * Overall optimization level. The actual optimizations applied will be the
    +   * logical OR of the flags that this level implies and any flags already set.
    +   * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The enum numeric value on the wire for optLevel. + */ + @java.lang.Override public int getOptLevelValue() { + return optLevel_; + } + /** + *
    +   * Overall optimization level. The actual optimizations applied will be the
    +   * logical OR of the flags that this level implies and any flags already set.
    +   * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The optLevel. + */ + @java.lang.Override public org.tensorflow.proto.OptimizerOptions.Level getOptLevel() { + org.tensorflow.proto.OptimizerOptions.Level result = org.tensorflow.proto.OptimizerOptions.Level.forNumber(optLevel_); + return result == null ? org.tensorflow.proto.OptimizerOptions.Level.UNRECOGNIZED : result; + } + + public static final int GLOBAL_JIT_LEVEL_FIELD_NUMBER = 5; + private int globalJitLevel_ = 0; + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The enum numeric value on the wire for globalJitLevel. + */ + @java.lang.Override public int getGlobalJitLevelValue() { + return globalJitLevel_; + } + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The globalJitLevel. + */ + @java.lang.Override public org.tensorflow.proto.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() { + org.tensorflow.proto.OptimizerOptions.GlobalJitLevel result = org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.forNumber(globalJitLevel_); + return result == null ? org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result; + } + + public static final int CPU_GLOBAL_JIT_FIELD_NUMBER = 7; + private boolean cpuGlobalJit_ = false; + /** + *
    +   * CPU code will be autoclustered only if global_jit_level >= ON_1 and either:
    +   * - this flag is true, or
    +   * - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
    +   * 
    + * + * bool cpu_global_jit = 7; + * @return The cpuGlobalJit. + */ + @java.lang.Override + public boolean getCpuGlobalJit() { + return cpuGlobalJit_; + } + + 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 (doCommonSubexpressionElimination_ != false) { + output.writeBool(1, doCommonSubexpressionElimination_); + } + if (doConstantFolding_ != false) { + output.writeBool(2, doConstantFolding_); + } + if (optLevel_ != org.tensorflow.proto.OptimizerOptions.Level.L1.getNumber()) { + output.writeEnum(3, optLevel_); + } + if (doFunctionInlining_ != false) { + output.writeBool(4, doFunctionInlining_); + } + if (globalJitLevel_ != org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) { + output.writeEnum(5, globalJitLevel_); + } + if (maxFoldedConstantInBytes_ != 0L) { + output.writeInt64(6, maxFoldedConstantInBytes_); + } + if (cpuGlobalJit_ != false) { + output.writeBool(7, cpuGlobalJit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (doCommonSubexpressionElimination_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, doCommonSubexpressionElimination_); + } + if (doConstantFolding_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, doConstantFolding_); + } + if (optLevel_ != org.tensorflow.proto.OptimizerOptions.Level.L1.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, optLevel_); + } + if (doFunctionInlining_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, doFunctionInlining_); + } + if (globalJitLevel_ != org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, globalJitLevel_); + } + if (maxFoldedConstantInBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, maxFoldedConstantInBytes_); + } + if (cpuGlobalJit_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, cpuGlobalJit_); + } + size += getUnknownFields().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.OptimizerOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.OptimizerOptions other = (org.tensorflow.proto.OptimizerOptions) obj; + + if (getDoCommonSubexpressionElimination() + != other.getDoCommonSubexpressionElimination()) return false; + if (getDoConstantFolding() + != other.getDoConstantFolding()) return false; + if (getMaxFoldedConstantInBytes() + != other.getMaxFoldedConstantInBytes()) return false; + if (getDoFunctionInlining() + != other.getDoFunctionInlining()) return false; + if (optLevel_ != other.optLevel_) return false; + if (globalJitLevel_ != other.globalJitLevel_) return false; + if (getCpuGlobalJit() + != other.getCpuGlobalJit()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDoCommonSubexpressionElimination()); + hash = (37 * hash) + DO_CONSTANT_FOLDING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDoConstantFolding()); + hash = (37 * hash) + MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxFoldedConstantInBytes()); + hash = (37 * hash) + DO_FUNCTION_INLINING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDoFunctionInlining()); + hash = (37 * hash) + OPT_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + optLevel_; + hash = (37 * hash) + GLOBAL_JIT_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + globalJitLevel_; + hash = (37 * hash) + CPU_GLOBAL_JIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCpuGlobalJit()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.OptimizerOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizerOptions 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.OptimizerOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizerOptions 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.OptimizerOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.OptimizerOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.OptimizerOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OptimizerOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.OptimizerOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.OptimizerOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.OptimizerOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.OptimizerOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.OptimizerOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Options passed to the graph optimizer
    +   * 
    + * + * Protobuf type {@code tensorflow.OptimizerOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.OptimizerOptions) + org.tensorflow.proto.OptimizerOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.OptimizerOptions.class, org.tensorflow.proto.OptimizerOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.OptimizerOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + doCommonSubexpressionElimination_ = false; + doConstantFolding_ = false; + maxFoldedConstantInBytes_ = 0L; + doFunctionInlining_ = false; + optLevel_ = 0; + globalJitLevel_ = 0; + cpuGlobalJit_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions getDefaultInstanceForType() { + return org.tensorflow.proto.OptimizerOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions build() { + org.tensorflow.proto.OptimizerOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions buildPartial() { + org.tensorflow.proto.OptimizerOptions result = new org.tensorflow.proto.OptimizerOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.OptimizerOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.doCommonSubexpressionElimination_ = doCommonSubexpressionElimination_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.doConstantFolding_ = doConstantFolding_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxFoldedConstantInBytes_ = maxFoldedConstantInBytes_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.doFunctionInlining_ = doFunctionInlining_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.optLevel_ = optLevel_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.globalJitLevel_ = globalJitLevel_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.cpuGlobalJit_ = cpuGlobalJit_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.OptimizerOptions) { + return mergeFrom((org.tensorflow.proto.OptimizerOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.OptimizerOptions other) { + if (other == org.tensorflow.proto.OptimizerOptions.getDefaultInstance()) return this; + if (other.getDoCommonSubexpressionElimination() != false) { + setDoCommonSubexpressionElimination(other.getDoCommonSubexpressionElimination()); + } + if (other.getDoConstantFolding() != false) { + setDoConstantFolding(other.getDoConstantFolding()); + } + if (other.getMaxFoldedConstantInBytes() != 0L) { + setMaxFoldedConstantInBytes(other.getMaxFoldedConstantInBytes()); + } + if (other.getDoFunctionInlining() != false) { + setDoFunctionInlining(other.getDoFunctionInlining()); + } + if (other.optLevel_ != 0) { + setOptLevelValue(other.getOptLevelValue()); + } + if (other.globalJitLevel_ != 0) { + setGlobalJitLevelValue(other.getGlobalJitLevelValue()); + } + if (other.getCpuGlobalJit() != false) { + setCpuGlobalJit(other.getCpuGlobalJit()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + doCommonSubexpressionElimination_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + doConstantFolding_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + optLevel_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 32: { + doFunctionInlining_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + globalJitLevel_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 48: { + maxFoldedConstantInBytes_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 48 + case 56: { + cpuGlobalJit_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean doCommonSubexpressionElimination_ ; + /** + *
    +     * If true, optimize the graph using common subexpression elimination.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable common subexpression elimination the opt_level has to be
    +     * set to L0.
    +     * 
    + * + * bool do_common_subexpression_elimination = 1; + * @return The doCommonSubexpressionElimination. + */ + @java.lang.Override + public boolean getDoCommonSubexpressionElimination() { + return doCommonSubexpressionElimination_; + } + /** + *
    +     * If true, optimize the graph using common subexpression elimination.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable common subexpression elimination the opt_level has to be
    +     * set to L0.
    +     * 
    + * + * bool do_common_subexpression_elimination = 1; + * @param value The doCommonSubexpressionElimination to set. + * @return This builder for chaining. + */ + public Builder setDoCommonSubexpressionElimination(boolean value) { + + doCommonSubexpressionElimination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * If true, optimize the graph using common subexpression elimination.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable common subexpression elimination the opt_level has to be
    +     * set to L0.
    +     * 
    + * + * bool do_common_subexpression_elimination = 1; + * @return This builder for chaining. + */ + public Builder clearDoCommonSubexpressionElimination() { + bitField0_ = (bitField0_ & ~0x00000001); + doCommonSubexpressionElimination_ = false; + onChanged(); + return this; + } + + private boolean doConstantFolding_ ; + /** + *
    +     * If true, perform constant folding optimization on the graph.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable constant folding the opt_level has to be set to L0.
    +     * 
    + * + * bool do_constant_folding = 2; + * @return The doConstantFolding. + */ + @java.lang.Override + public boolean getDoConstantFolding() { + return doConstantFolding_; + } + /** + *
    +     * If true, perform constant folding optimization on the graph.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable constant folding the opt_level has to be set to L0.
    +     * 
    + * + * bool do_constant_folding = 2; + * @param value The doConstantFolding to set. + * @return This builder for chaining. + */ + public Builder setDoConstantFolding(boolean value) { + + doConstantFolding_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If true, perform constant folding optimization on the graph.
    +     * Note: the optimization Level L1 will override this setting to true. So in
    +     * order to disable constant folding the opt_level has to be set to L0.
    +     * 
    + * + * bool do_constant_folding = 2; + * @return This builder for chaining. + */ + public Builder clearDoConstantFolding() { + bitField0_ = (bitField0_ & ~0x00000002); + doConstantFolding_ = false; + onChanged(); + return this; + } + + private long maxFoldedConstantInBytes_ ; + /** + *
    +     * Constant folding optimization replaces tensors whose values can be
    +     * predetermined, with constant nodes. To avoid inserting too large constants,
    +     * the size of each constant created can be limited. If this value is zero, a
    +     * default limit of 10 MiB will be applied. If constant folding optimization
    +     * is disabled, this value is ignored.
    +     * 
    + * + * int64 max_folded_constant_in_bytes = 6; + * @return The maxFoldedConstantInBytes. + */ + @java.lang.Override + public long getMaxFoldedConstantInBytes() { + return maxFoldedConstantInBytes_; + } + /** + *
    +     * Constant folding optimization replaces tensors whose values can be
    +     * predetermined, with constant nodes. To avoid inserting too large constants,
    +     * the size of each constant created can be limited. If this value is zero, a
    +     * default limit of 10 MiB will be applied. If constant folding optimization
    +     * is disabled, this value is ignored.
    +     * 
    + * + * int64 max_folded_constant_in_bytes = 6; + * @param value The maxFoldedConstantInBytes to set. + * @return This builder for chaining. + */ + public Builder setMaxFoldedConstantInBytes(long value) { + + maxFoldedConstantInBytes_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Constant folding optimization replaces tensors whose values can be
    +     * predetermined, with constant nodes. To avoid inserting too large constants,
    +     * the size of each constant created can be limited. If this value is zero, a
    +     * default limit of 10 MiB will be applied. If constant folding optimization
    +     * is disabled, this value is ignored.
    +     * 
    + * + * int64 max_folded_constant_in_bytes = 6; + * @return This builder for chaining. + */ + public Builder clearMaxFoldedConstantInBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + maxFoldedConstantInBytes_ = 0L; + onChanged(); + return this; + } + + private boolean doFunctionInlining_ ; + /** + *
    +     * If true, perform function inlining on the graph.
    +     * 
    + * + * bool do_function_inlining = 4; + * @return The doFunctionInlining. + */ + @java.lang.Override + public boolean getDoFunctionInlining() { + return doFunctionInlining_; + } + /** + *
    +     * If true, perform function inlining on the graph.
    +     * 
    + * + * bool do_function_inlining = 4; + * @param value The doFunctionInlining to set. + * @return This builder for chaining. + */ + public Builder setDoFunctionInlining(boolean value) { + + doFunctionInlining_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * If true, perform function inlining on the graph.
    +     * 
    + * + * bool do_function_inlining = 4; + * @return This builder for chaining. + */ + public Builder clearDoFunctionInlining() { + bitField0_ = (bitField0_ & ~0x00000008); + doFunctionInlining_ = false; + onChanged(); + return this; + } + + private int optLevel_ = 0; + /** + *
    +     * Overall optimization level. The actual optimizations applied will be the
    +     * logical OR of the flags that this level implies and any flags already set.
    +     * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The enum numeric value on the wire for optLevel. + */ + @java.lang.Override public int getOptLevelValue() { + return optLevel_; + } + /** + *
    +     * Overall optimization level. The actual optimizations applied will be the
    +     * logical OR of the flags that this level implies and any flags already set.
    +     * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @param value The enum numeric value on the wire for optLevel to set. + * @return This builder for chaining. + */ + public Builder setOptLevelValue(int value) { + optLevel_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Overall optimization level. The actual optimizations applied will be the
    +     * logical OR of the flags that this level implies and any flags already set.
    +     * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The optLevel. + */ + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions.Level getOptLevel() { + org.tensorflow.proto.OptimizerOptions.Level result = org.tensorflow.proto.OptimizerOptions.Level.forNumber(optLevel_); + return result == null ? org.tensorflow.proto.OptimizerOptions.Level.UNRECOGNIZED : result; + } + /** + *
    +     * Overall optimization level. The actual optimizations applied will be the
    +     * logical OR of the flags that this level implies and any flags already set.
    +     * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @param value The optLevel to set. + * @return This builder for chaining. + */ + public Builder setOptLevel(org.tensorflow.proto.OptimizerOptions.Level value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + optLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Overall optimization level. The actual optimizations applied will be the
    +     * logical OR of the flags that this level implies and any flags already set.
    +     * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return This builder for chaining. + */ + public Builder clearOptLevel() { + bitField0_ = (bitField0_ & ~0x00000010); + optLevel_ = 0; + onChanged(); + return this; + } + + private int globalJitLevel_ = 0; + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The enum numeric value on the wire for globalJitLevel. + */ + @java.lang.Override public int getGlobalJitLevelValue() { + return globalJitLevel_; + } + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @param value The enum numeric value on the wire for globalJitLevel to set. + * @return This builder for chaining. + */ + public Builder setGlobalJitLevelValue(int value) { + globalJitLevel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The globalJitLevel. + */ + @java.lang.Override + public org.tensorflow.proto.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() { + org.tensorflow.proto.OptimizerOptions.GlobalJitLevel result = org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.forNumber(globalJitLevel_); + return result == null ? org.tensorflow.proto.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result; + } + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @param value The globalJitLevel to set. + * @return This builder for chaining. + */ + public Builder setGlobalJitLevel(org.tensorflow.proto.OptimizerOptions.GlobalJitLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + globalJitLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return This builder for chaining. + */ + public Builder clearGlobalJitLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + globalJitLevel_ = 0; + onChanged(); + return this; + } + + private boolean cpuGlobalJit_ ; + /** + *
    +     * CPU code will be autoclustered only if global_jit_level >= ON_1 and either:
    +     * - this flag is true, or
    +     * - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
    +     * 
    + * + * bool cpu_global_jit = 7; + * @return The cpuGlobalJit. + */ + @java.lang.Override + public boolean getCpuGlobalJit() { + return cpuGlobalJit_; + } + /** + *
    +     * CPU code will be autoclustered only if global_jit_level >= ON_1 and either:
    +     * - this flag is true, or
    +     * - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
    +     * 
    + * + * bool cpu_global_jit = 7; + * @param value The cpuGlobalJit to set. + * @return This builder for chaining. + */ + public Builder setCpuGlobalJit(boolean value) { + + cpuGlobalJit_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * CPU code will be autoclustered only if global_jit_level >= ON_1 and either:
    +     * - this flag is true, or
    +     * - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
    +     * 
    + * + * bool cpu_global_jit = 7; + * @return This builder for chaining. + */ + public Builder clearCpuGlobalJit() { + bitField0_ = (bitField0_ & ~0x00000040); + cpuGlobalJit_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.OptimizerOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.OptimizerOptions) + private static final org.tensorflow.proto.OptimizerOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.OptimizerOptions(); + } + + public static org.tensorflow.proto.OptimizerOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizerOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.OptimizerOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptionsOrBuilder.java new file mode 100644 index 00000000000..0f08f0071ec --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/OptimizerOptionsOrBuilder.java @@ -0,0 +1,104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface OptimizerOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.OptimizerOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * If true, optimize the graph using common subexpression elimination.
    +   * Note: the optimization Level L1 will override this setting to true. So in
    +   * order to disable common subexpression elimination the opt_level has to be
    +   * set to L0.
    +   * 
    + * + * bool do_common_subexpression_elimination = 1; + * @return The doCommonSubexpressionElimination. + */ + boolean getDoCommonSubexpressionElimination(); + + /** + *
    +   * If true, perform constant folding optimization on the graph.
    +   * Note: the optimization Level L1 will override this setting to true. So in
    +   * order to disable constant folding the opt_level has to be set to L0.
    +   * 
    + * + * bool do_constant_folding = 2; + * @return The doConstantFolding. + */ + boolean getDoConstantFolding(); + + /** + *
    +   * Constant folding optimization replaces tensors whose values can be
    +   * predetermined, with constant nodes. To avoid inserting too large constants,
    +   * the size of each constant created can be limited. If this value is zero, a
    +   * default limit of 10 MiB will be applied. If constant folding optimization
    +   * is disabled, this value is ignored.
    +   * 
    + * + * int64 max_folded_constant_in_bytes = 6; + * @return The maxFoldedConstantInBytes. + */ + long getMaxFoldedConstantInBytes(); + + /** + *
    +   * If true, perform function inlining on the graph.
    +   * 
    + * + * bool do_function_inlining = 4; + * @return The doFunctionInlining. + */ + boolean getDoFunctionInlining(); + + /** + *
    +   * Overall optimization level. The actual optimizations applied will be the
    +   * logical OR of the flags that this level implies and any flags already set.
    +   * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The enum numeric value on the wire for optLevel. + */ + int getOptLevelValue(); + /** + *
    +   * Overall optimization level. The actual optimizations applied will be the
    +   * logical OR of the flags that this level implies and any flags already set.
    +   * 
    + * + * .tensorflow.OptimizerOptions.Level opt_level = 3; + * @return The optLevel. + */ + org.tensorflow.proto.OptimizerOptions.Level getOptLevel(); + + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The enum numeric value on the wire for globalJitLevel. + */ + int getGlobalJitLevelValue(); + /** + * .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5; + * @return The globalJitLevel. + */ + org.tensorflow.proto.OptimizerOptions.GlobalJitLevel getGlobalJitLevel(); + + /** + *
    +   * CPU code will be autoclustered only if global_jit_level >= ON_1 and either:
    +   * - this flag is true, or
    +   * - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
    +   * 
    + * + * bool cpu_global_jit = 7; + * @return The cpuGlobalJit. + */ + boolean getCpuGlobalJit(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfo.java new file mode 100644 index 00000000000..1f78bab992e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfo.java @@ -0,0 +1,1349 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.PlatformInfo} + */ +public final class PlatformInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.PlatformInfo) + PlatformInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + PlatformInfo.class.getName()); + } + // Use PlatformInfo.newBuilder() to construct. + private PlatformInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PlatformInfo() { + bits_ = ""; + linkage_ = ""; + machine_ = ""; + release_ = ""; + system_ = ""; + version_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_PlatformInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.PlatformInfo.class, org.tensorflow.proto.PlatformInfo.Builder.class); + } + + public static final int BITS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object bits_ = ""; + /** + *
    +   * e.g. '64bit'
    +   * 
    + * + * string bits = 1; + * @return The bits. + */ + @java.lang.Override + public java.lang.String getBits() { + java.lang.Object ref = bits_; + 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(); + bits_ = s; + return s; + } + } + /** + *
    +   * e.g. '64bit'
    +   * 
    + * + * string bits = 1; + * @return The bytes for bits. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBitsBytes() { + java.lang.Object ref = bits_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bits_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINKAGE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object linkage_ = ""; + /** + *
    +   * e.g. 'ELF'
    +   * 
    + * + * string linkage = 2; + * @return The linkage. + */ + @java.lang.Override + public java.lang.String getLinkage() { + java.lang.Object ref = linkage_; + 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(); + linkage_ = s; + return s; + } + } + /** + *
    +   * e.g. 'ELF'
    +   * 
    + * + * string linkage = 2; + * @return The bytes for linkage. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLinkageBytes() { + java.lang.Object ref = linkage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + linkage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MACHINE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object machine_ = ""; + /** + *
    +   * e.g. 'i386'
    +   * 
    + * + * string machine = 3; + * @return The machine. + */ + @java.lang.Override + public java.lang.String getMachine() { + java.lang.Object ref = machine_; + 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(); + machine_ = s; + return s; + } + } + /** + *
    +   * e.g. 'i386'
    +   * 
    + * + * string machine = 3; + * @return The bytes for machine. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMachineBytes() { + java.lang.Object ref = machine_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + machine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RELEASE_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object release_ = ""; + /** + *
    +   * e.g. '3.13.0-76-generic'
    +   * 
    + * + * string release = 4; + * @return The release. + */ + @java.lang.Override + public java.lang.String getRelease() { + java.lang.Object ref = release_; + 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(); + release_ = s; + return s; + } + } + /** + *
    +   * e.g. '3.13.0-76-generic'
    +   * 
    + * + * string release = 4; + * @return The bytes for release. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getReleaseBytes() { + java.lang.Object ref = release_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + release_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYSTEM_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object system_ = ""; + /** + *
    +   * e.g. 'Linux'
    +   * 
    + * + * string system = 5; + * @return The system. + */ + @java.lang.Override + public java.lang.String getSystem() { + java.lang.Object ref = system_; + 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(); + system_ = s; + return s; + } + } + /** + *
    +   * e.g. 'Linux'
    +   * 
    + * + * string system = 5; + * @return The bytes for system. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSystemBytes() { + java.lang.Object ref = system_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + system_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** + *
    +   * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +   * 
    + * + * string version = 6; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + *
    +   * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +   * 
    + * + * string version = 6; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(bits_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, bits_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linkage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, linkage_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(machine_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, machine_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(release_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, release_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(system_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, system_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, version_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bits_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, bits_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(linkage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, linkage_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(machine_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, machine_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(release_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, release_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(system_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, system_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, version_); + } + size += getUnknownFields().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.PlatformInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.PlatformInfo other = (org.tensorflow.proto.PlatformInfo) obj; + + if (!getBits() + .equals(other.getBits())) return false; + if (!getLinkage() + .equals(other.getLinkage())) return false; + if (!getMachine() + .equals(other.getMachine())) return false; + if (!getRelease() + .equals(other.getRelease())) return false; + if (!getSystem() + .equals(other.getSystem())) return false; + if (!getVersion() + .equals(other.getVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + BITS_FIELD_NUMBER; + hash = (53 * hash) + getBits().hashCode(); + hash = (37 * hash) + LINKAGE_FIELD_NUMBER; + hash = (53 * hash) + getLinkage().hashCode(); + hash = (37 * hash) + MACHINE_FIELD_NUMBER; + hash = (53 * hash) + getMachine().hashCode(); + hash = (37 * hash) + RELEASE_FIELD_NUMBER; + hash = (53 * hash) + getRelease().hashCode(); + hash = (37 * hash) + SYSTEM_FIELD_NUMBER; + hash = (53 * hash) + getSystem().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.PlatformInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.PlatformInfo 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.PlatformInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.PlatformInfo 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.PlatformInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.PlatformInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.PlatformInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.PlatformInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.PlatformInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.PlatformInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.PlatformInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.PlatformInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.PlatformInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.PlatformInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.PlatformInfo) + org.tensorflow.proto.PlatformInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_PlatformInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.PlatformInfo.class, org.tensorflow.proto.PlatformInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.PlatformInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bits_ = ""; + linkage_ = ""; + machine_ = ""; + release_ = ""; + system_ = ""; + version_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_PlatformInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.PlatformInfo getDefaultInstanceForType() { + return org.tensorflow.proto.PlatformInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.PlatformInfo build() { + org.tensorflow.proto.PlatformInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.PlatformInfo buildPartial() { + org.tensorflow.proto.PlatformInfo result = new org.tensorflow.proto.PlatformInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.PlatformInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bits_ = bits_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.linkage_ = linkage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.machine_ = machine_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.release_ = release_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.system_ = system_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.version_ = version_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.PlatformInfo) { + return mergeFrom((org.tensorflow.proto.PlatformInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.PlatformInfo other) { + if (other == org.tensorflow.proto.PlatformInfo.getDefaultInstance()) return this; + if (!other.getBits().isEmpty()) { + bits_ = other.bits_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLinkage().isEmpty()) { + linkage_ = other.linkage_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMachine().isEmpty()) { + machine_ = other.machine_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getRelease().isEmpty()) { + release_ = other.release_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getSystem().isEmpty()) { + system_ = other.system_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + bits_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + linkage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + machine_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + release_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + system_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object bits_ = ""; + /** + *
    +     * e.g. '64bit'
    +     * 
    + * + * string bits = 1; + * @return The bits. + */ + public java.lang.String getBits() { + java.lang.Object ref = bits_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bits_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. '64bit'
    +     * 
    + * + * string bits = 1; + * @return The bytes for bits. + */ + public com.google.protobuf.ByteString + getBitsBytes() { + java.lang.Object ref = bits_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bits_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. '64bit'
    +     * 
    + * + * string bits = 1; + * @param value The bits to set. + * @return This builder for chaining. + */ + public Builder setBits( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + bits_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * e.g. '64bit'
    +     * 
    + * + * string bits = 1; + * @return This builder for chaining. + */ + public Builder clearBits() { + bits_ = getDefaultInstance().getBits(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * e.g. '64bit'
    +     * 
    + * + * string bits = 1; + * @param value The bytes for bits to set. + * @return This builder for chaining. + */ + public Builder setBitsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + bits_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object linkage_ = ""; + /** + *
    +     * e.g. 'ELF'
    +     * 
    + * + * string linkage = 2; + * @return The linkage. + */ + public java.lang.String getLinkage() { + java.lang.Object ref = linkage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linkage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. 'ELF'
    +     * 
    + * + * string linkage = 2; + * @return The bytes for linkage. + */ + public com.google.protobuf.ByteString + getLinkageBytes() { + java.lang.Object ref = linkage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + linkage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. 'ELF'
    +     * 
    + * + * string linkage = 2; + * @param value The linkage to set. + * @return This builder for chaining. + */ + public Builder setLinkage( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + linkage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * e.g. 'ELF'
    +     * 
    + * + * string linkage = 2; + * @return This builder for chaining. + */ + public Builder clearLinkage() { + linkage_ = getDefaultInstance().getLinkage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * e.g. 'ELF'
    +     * 
    + * + * string linkage = 2; + * @param value The bytes for linkage to set. + * @return This builder for chaining. + */ + public Builder setLinkageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + linkage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object machine_ = ""; + /** + *
    +     * e.g. 'i386'
    +     * 
    + * + * string machine = 3; + * @return The machine. + */ + public java.lang.String getMachine() { + java.lang.Object ref = machine_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + machine_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. 'i386'
    +     * 
    + * + * string machine = 3; + * @return The bytes for machine. + */ + public com.google.protobuf.ByteString + getMachineBytes() { + java.lang.Object ref = machine_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + machine_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. 'i386'
    +     * 
    + * + * string machine = 3; + * @param value The machine to set. + * @return This builder for chaining. + */ + public Builder setMachine( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + machine_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * e.g. 'i386'
    +     * 
    + * + * string machine = 3; + * @return This builder for chaining. + */ + public Builder clearMachine() { + machine_ = getDefaultInstance().getMachine(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * e.g. 'i386'
    +     * 
    + * + * string machine = 3; + * @param value The bytes for machine to set. + * @return This builder for chaining. + */ + public Builder setMachineBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + machine_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object release_ = ""; + /** + *
    +     * e.g. '3.13.0-76-generic'
    +     * 
    + * + * string release = 4; + * @return The release. + */ + public java.lang.String getRelease() { + java.lang.Object ref = release_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + release_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. '3.13.0-76-generic'
    +     * 
    + * + * string release = 4; + * @return The bytes for release. + */ + public com.google.protobuf.ByteString + getReleaseBytes() { + java.lang.Object ref = release_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + release_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. '3.13.0-76-generic'
    +     * 
    + * + * string release = 4; + * @param value The release to set. + * @return This builder for chaining. + */ + public Builder setRelease( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + release_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * e.g. '3.13.0-76-generic'
    +     * 
    + * + * string release = 4; + * @return This builder for chaining. + */ + public Builder clearRelease() { + release_ = getDefaultInstance().getRelease(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * e.g. '3.13.0-76-generic'
    +     * 
    + * + * string release = 4; + * @param value The bytes for release to set. + * @return This builder for chaining. + */ + public Builder setReleaseBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + release_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object system_ = ""; + /** + *
    +     * e.g. 'Linux'
    +     * 
    + * + * string system = 5; + * @return The system. + */ + public java.lang.String getSystem() { + java.lang.Object ref = system_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + system_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. 'Linux'
    +     * 
    + * + * string system = 5; + * @return The bytes for system. + */ + public com.google.protobuf.ByteString + getSystemBytes() { + java.lang.Object ref = system_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + system_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. 'Linux'
    +     * 
    + * + * string system = 5; + * @param value The system to set. + * @return This builder for chaining. + */ + public Builder setSystem( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + system_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * e.g. 'Linux'
    +     * 
    + * + * string system = 5; + * @return This builder for chaining. + */ + public Builder clearSystem() { + system_ = getDefaultInstance().getSystem(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * e.g. 'Linux'
    +     * 
    + * + * string system = 5; + * @param value The bytes for system to set. + * @return This builder for chaining. + */ + public Builder setSystemBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + system_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + *
    +     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +     * 
    + * + * string version = 6; + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +     * 
    + * + * string version = 6; + * @return The bytes for version. + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +     * 
    + * + * string version = 6; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + version_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +     * 
    + * + * string version = 6; + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * e.g. '#120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016'
    +     * 
    + * + * string version = 6; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.PlatformInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.PlatformInfo) + private static final org.tensorflow.proto.PlatformInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.PlatformInfo(); + } + + public static org.tensorflow.proto.PlatformInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlatformInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.PlatformInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfoOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfoOrBuilder.java index 6a5089fa309..28ee5913d54 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/PlatformInfoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/PlatformInfoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface PlatformInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.PlatformInfo) @@ -13,6 +15,7 @@ public interface PlatformInfoOrBuilder extends *
    * * string bits = 1; + * @return The bits. */ java.lang.String getBits(); /** @@ -21,6 +24,7 @@ public interface PlatformInfoOrBuilder extends *
    * * string bits = 1; + * @return The bytes for bits. */ com.google.protobuf.ByteString getBitsBytes(); @@ -31,6 +35,7 @@ public interface PlatformInfoOrBuilder extends * * * string linkage = 2; + * @return The linkage. */ java.lang.String getLinkage(); /** @@ -39,6 +44,7 @@ public interface PlatformInfoOrBuilder extends * * * string linkage = 2; + * @return The bytes for linkage. */ com.google.protobuf.ByteString getLinkageBytes(); @@ -49,6 +55,7 @@ public interface PlatformInfoOrBuilder extends * * * string machine = 3; + * @return The machine. */ java.lang.String getMachine(); /** @@ -57,6 +64,7 @@ public interface PlatformInfoOrBuilder extends * * * string machine = 3; + * @return The bytes for machine. */ com.google.protobuf.ByteString getMachineBytes(); @@ -67,6 +75,7 @@ public interface PlatformInfoOrBuilder extends * * * string release = 4; + * @return The release. */ java.lang.String getRelease(); /** @@ -75,6 +84,7 @@ public interface PlatformInfoOrBuilder extends * * * string release = 4; + * @return The bytes for release. */ com.google.protobuf.ByteString getReleaseBytes(); @@ -85,6 +95,7 @@ public interface PlatformInfoOrBuilder extends * * * string system = 5; + * @return The system. */ java.lang.String getSystem(); /** @@ -93,6 +104,7 @@ public interface PlatformInfoOrBuilder extends * * * string system = 5; + * @return The bytes for system. */ com.google.protobuf.ByteString getSystemBytes(); @@ -103,6 +115,7 @@ public interface PlatformInfoOrBuilder extends * * * string version = 6; + * @return The version. */ java.lang.String getVersion(); /** @@ -111,6 +124,7 @@ public interface PlatformInfoOrBuilder extends * * * string version = 6; + * @return The bytes for version. */ com.google.protobuf.ByteString getVersionBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ProfilerOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ProfilerOptions.java new file mode 100644 index 00000000000..aaf846a8472 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ProfilerOptions.java @@ -0,0 +1,5199 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tsl/profiler/protobuf/profiler_options.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ProfilerOptions { + private ProfilerOptions() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ProfilerOptions.class.getName()); + } + 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 ProfileOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ProfileOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Some default value of option are not proto3 default value. Use this version
    +     * to determine if we should use default option value instead of proto3
    +     * default value.
    +     * 
    + * + * uint32 version = 5; + * @return The version. + */ + int getVersion(); + + /** + *
    +     * Device type to profile/trace: (version >= 1)
    +     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +     * DeviceType::CPU: only CPU will be profiled.
    +     * DeviceType::GPU: only CPU/GPU will be profiled.
    +     * DeviceType::TPU: only CPU/TPU will be profiled.
    +     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +     * will be profiled.
    +     * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The enum numeric value on the wire for deviceType. + */ + int getDeviceTypeValue(); + /** + *
    +     * Device type to profile/trace: (version >= 1)
    +     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +     * DeviceType::CPU: only CPU will be profiled.
    +     * DeviceType::GPU: only CPU/GPU will be profiled.
    +     * DeviceType::TPU: only CPU/TPU will be profiled.
    +     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +     * will be profiled.
    +     * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The deviceType. + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType getDeviceType(); + + /** + *
    +     * We don't collect the dataset ops by default for better trace-viewer
    +     * scalability. The caller can manually set this field to include the ops.
    +     * 
    + * + * bool include_dataset_ops = 1; + * @return The includeDatasetOps. + */ + boolean getIncludeDatasetOps(); + + /** + *
    +     * Levels of host tracing: (version >= 1)
    +     * - Level 0 is used to disable host traces.
    +     * - Level 1 enables tracing of only user instrumented (or default) TraceMe,
    +     * this is the default.
    +     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    +     * level program execution details (expensive TF ops, XLA ops, etc).
    +     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    +     * (low-level) program execution details (cheap TF ops, etc).
    +     * 
    + * + * uint32 host_tracer_level = 2; + * @return The hostTracerLevel. + */ + int getHostTracerLevel(); + + /** + *
    +     * Levels of device tracing: (version >= 1)
    +     * - Level 0 is used to disable device traces.
    +     * - Level 1 is used to enable device traces.
    +     * - More levels might be defined for specific device for controlling the
    +     * verbosity of the trace.
    +     * 
    + * + * uint32 device_tracer_level = 3; + * @return The deviceTracerLevel. + */ + int getDeviceTracerLevel(); + + /** + *
    +     * Whether enable python function calls tracing. Runtime overhead ensues if
    +     * enabled. Default off. (version >= 1)
    +     * 
    + * + * uint32 python_tracer_level = 4; + * @return The pythonTracerLevel. + */ + int getPythonTracerLevel(); + + /** + *
    +     * Whether serialize hlo_proto when XLA is used. (version >= 1)
    +     * 
    + * + * bool enable_hlo_proto = 7; + * @return The enableHloProto. + */ + boolean getEnableHloProto(); + + /** + *
    +     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
    +     * 
    + * + * uint64 start_timestamp_ns = 8; + * @return The startTimestampNs. + */ + long getStartTimestampNs(); + + /** + *
    +     * The local profiler collects `duration_ms` milliseconds of data. If the
    +     * value is 0, profiling continues until interrupted.
    +     * 
    + * + * uint64 duration_ms = 9; + * @return The durationMs. + */ + long getDurationMs(); + + /** + *
    +     * Directory to save profile data to. No-op when empty.
    +     * 
    + * + * string repository_path = 10; + * @return The repositoryPath. + */ + java.lang.String getRepositoryPath(); + /** + *
    +     * Directory to save profile data to. No-op when empty.
    +     * 
    + * + * string repository_path = 10; + * @return The bytes for repositoryPath. + */ + com.google.protobuf.ByteString + getRepositoryPathBytes(); + + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return Whether the traceOptions field is set. + */ + boolean hasTraceOptions(); + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return The traceOptions. + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions getTraceOptions(); + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder getTraceOptionsOrBuilder(); + + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + int getAdvancedConfigurationCount(); + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + boolean containsAdvancedConfiguration( + java.lang.String key); + /** + * Use {@link #getAdvancedConfigurationMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAdvancedConfiguration(); + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + java.util.Map + getAdvancedConfigurationMap(); + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue defaultValue); + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrThrow( + java.lang.String key); + + /** + * bool raise_error_on_start_failure = 13; + * @return The raiseErrorOnStartFailure. + */ + boolean getRaiseErrorOnStartFailure(); + } + /** + *
    +   * Next ID: 14
    +   * 
    + * + * Protobuf type {@code tensorflow.ProfileOptions} + */ + public static final class ProfileOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions) + ProfileOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ProfileOptions.class.getName()); + } + // Use ProfileOptions.newBuilder() to construct. + private ProfileOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ProfileOptions() { + deviceType_ = 0; + repositoryPath_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetAdvancedConfiguration(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.ProfileOptions.DeviceType} + */ + public enum DeviceType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNSPECIFIED = 0; + */ + UNSPECIFIED(0), + /** + * CPU = 1; + */ + CPU(1), + /** + * GPU = 2; + */ + GPU(2), + /** + * TPU = 3; + */ + TPU(3), + /** + * PLUGGABLE_DEVICE = 4; + */ + PLUGGABLE_DEVICE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeviceType.class.getName()); + } + /** + * UNSPECIFIED = 0; + */ + public static final int UNSPECIFIED_VALUE = 0; + /** + * CPU = 1; + */ + public static final int CPU_VALUE = 1; + /** + * GPU = 2; + */ + public static final int GPU_VALUE = 2; + /** + * TPU = 3; + */ + public static final int TPU_VALUE = 3; + /** + * PLUGGABLE_DEVICE = 4; + */ + public static final int PLUGGABLE_DEVICE_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DeviceType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DeviceType forNumber(int value) { + switch (value) { + case 0: return UNSPECIFIED; + case 1: return CPU; + case 2: return GPU; + case 3: return TPU; + case 4: return PLUGGABLE_DEVICE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + DeviceType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DeviceType findValueByNumber(int number) { + return DeviceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.ProfilerOptions.ProfileOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final DeviceType[] VALUES = values(); + + public static DeviceType 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 DeviceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.ProfileOptions.DeviceType) + } + + public interface TraceOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ProfileOptions.TraceOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Filter mask for TraceMe events. If the traceme_filter_mask is set, a
    +       * TraceMe event will be recorded if it passes the filter.
    +       * Only lowest 32 bits of the mask are used. The higher 32 bits are reserved
    +       * and won't be applied if set.
    +       * 
    + * + * uint64 host_traceme_filter_mask = 1; + * @return The hostTracemeFilterMask. + */ + long getHostTracemeFilterMask(); + } + /** + * Protobuf type {@code tensorflow.ProfileOptions.TraceOptions} + */ + public static final class TraceOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions.TraceOptions) + TraceOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TraceOptions.class.getName()); + } + // Use TraceOptions.newBuilder() to construct. + private TraceOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TraceOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_TraceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder.class); + } + + public static final int HOST_TRACEME_FILTER_MASK_FIELD_NUMBER = 1; + private long hostTracemeFilterMask_ = 0L; + /** + *
    +       * Filter mask for TraceMe events. If the traceme_filter_mask is set, a
    +       * TraceMe event will be recorded if it passes the filter.
    +       * Only lowest 32 bits of the mask are used. The higher 32 bits are reserved
    +       * and won't be applied if set.
    +       * 
    + * + * uint64 host_traceme_filter_mask = 1; + * @return The hostTracemeFilterMask. + */ + @java.lang.Override + public long getHostTracemeFilterMask() { + return hostTracemeFilterMask_; + } + + 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 (hostTracemeFilterMask_ != 0L) { + output.writeUInt64(1, hostTracemeFilterMask_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (hostTracemeFilterMask_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, hostTracemeFilterMask_); + } + size += getUnknownFields().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.ProfilerOptions.ProfileOptions.TraceOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions other = (org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions) obj; + + if (getHostTracemeFilterMask() + != other.getHostTracemeFilterMask()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOST_TRACEME_FILTER_MASK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHostTracemeFilterMask()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions 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.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions 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.ProfilerOptions.ProfileOptions.TraceOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ProfilerOptions.ProfileOptions.TraceOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ProfileOptions.TraceOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions.TraceOptions) + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_TraceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostTracemeFilterMask_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions getDefaultInstanceForType() { + return org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions build() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions buildPartial() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions result = new org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostTracemeFilterMask_ = hostTracemeFilterMask_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions) { + return mergeFrom((org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions other) { + if (other == org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance()) return this; + if (other.getHostTracemeFilterMask() != 0L) { + setHostTracemeFilterMask(other.getHostTracemeFilterMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + hostTracemeFilterMask_ = input.readUInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long hostTracemeFilterMask_ ; + /** + *
    +         * Filter mask for TraceMe events. If the traceme_filter_mask is set, a
    +         * TraceMe event will be recorded if it passes the filter.
    +         * Only lowest 32 bits of the mask are used. The higher 32 bits are reserved
    +         * and won't be applied if set.
    +         * 
    + * + * uint64 host_traceme_filter_mask = 1; + * @return The hostTracemeFilterMask. + */ + @java.lang.Override + public long getHostTracemeFilterMask() { + return hostTracemeFilterMask_; + } + /** + *
    +         * Filter mask for TraceMe events. If the traceme_filter_mask is set, a
    +         * TraceMe event will be recorded if it passes the filter.
    +         * Only lowest 32 bits of the mask are used. The higher 32 bits are reserved
    +         * and won't be applied if set.
    +         * 
    + * + * uint64 host_traceme_filter_mask = 1; + * @param value The hostTracemeFilterMask to set. + * @return This builder for chaining. + */ + public Builder setHostTracemeFilterMask(long value) { + + hostTracemeFilterMask_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Filter mask for TraceMe events. If the traceme_filter_mask is set, a
    +         * TraceMe event will be recorded if it passes the filter.
    +         * Only lowest 32 bits of the mask are used. The higher 32 bits are reserved
    +         * and won't be applied if set.
    +         * 
    + * + * uint64 host_traceme_filter_mask = 1; + * @return This builder for chaining. + */ + public Builder clearHostTracemeFilterMask() { + bitField0_ = (bitField0_ & ~0x00000001); + hostTracemeFilterMask_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ProfileOptions.TraceOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions.TraceOptions) + private static final org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions(); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TraceOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProfilerOptions.ProfileOptions.TraceOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AdvancedConfigValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ProfileOptions.AdvancedConfigValue) + com.google.protobuf.MessageOrBuilder { + + /** + * string string_value = 1; + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + * string string_value = 1; + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * string string_value = 1; + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + /** + * bool bool_value = 2; + * @return Whether the boolValue field is set. + */ + boolean hasBoolValue(); + /** + * bool bool_value = 2; + * @return The boolValue. + */ + boolean getBoolValue(); + + /** + * int64 int64_value = 3; + * @return Whether the int64Value field is set. + */ + boolean hasInt64Value(); + /** + * int64 int64_value = 3; + * @return The int64Value. + */ + long getInt64Value(); + + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.ValueCase getValueCase(); + } + /** + *
    +     * AdvancedConfigValue represents the configuration value, it can be one of
    +     * the following types: string, bool, int64, depending upon the config type.
    +     * 
    + * + * Protobuf type {@code tensorflow.ProfileOptions.AdvancedConfigValue} + */ + public static final class AdvancedConfigValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions.AdvancedConfigValue) + AdvancedConfigValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AdvancedConfigValue.class.getName()); + } + // Use AdvancedConfigValue.newBuilder() to construct. + private AdvancedConfigValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AdvancedConfigValue() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder.class); + } + + private int valueCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_VALUE(1), + BOOL_VALUE(2), + INT64_VALUE(3), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: return STRING_VALUE; + case 2: return BOOL_VALUE; + case 3: return INT64_VALUE; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int STRING_VALUE_FIELD_NUMBER = 1; + /** + * string string_value = 1; + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return valueCase_ == 1; + } + /** + * string string_value = 1; + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 1) { + ref = value_; + } + 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(); + if (valueCase_ == 1) { + value_ = s; + } + return s; + } + } + /** + * string string_value = 1; + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 1) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 1) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOL_VALUE_FIELD_NUMBER = 2; + /** + * bool bool_value = 2; + * @return Whether the boolValue field is set. + */ + @java.lang.Override + public boolean hasBoolValue() { + return valueCase_ == 2; + } + /** + * bool bool_value = 2; + * @return The boolValue. + */ + @java.lang.Override + public boolean getBoolValue() { + if (valueCase_ == 2) { + return (java.lang.Boolean) value_; + } + return false; + } + + public static final int INT64_VALUE_FIELD_NUMBER = 3; + /** + * int64 int64_value = 3; + * @return Whether the int64Value field is set. + */ + @java.lang.Override + public boolean hasInt64Value() { + return valueCase_ == 3; + } + /** + * int64 int64_value = 3; + * @return The int64Value. + */ + @java.lang.Override + public long getInt64Value() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + + 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 (valueCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); + } + if (valueCase_ == 2) { + output.writeBool( + 2, (boolean)((java.lang.Boolean) value_)); + } + if (valueCase_ == 3) { + output.writeInt64( + 3, (long)((java.lang.Long) value_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 2, (boolean)((java.lang.Boolean) value_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 3, (long)((java.lang.Long) value_)); + } + size += getUnknownFields().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.ProfilerOptions.ProfileOptions.AdvancedConfigValue)) { + return super.equals(obj); + } + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue other = (org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (!getStringValue() + .equals(other.getStringValue())) return false; + break; + case 2: + if (getBoolValue() + != other.getBoolValue()) return false; + break; + case 3: + if (getInt64Value() + != other.getInt64Value()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 2: + hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolValue()); + break; + case 3: + hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInt64Value()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue 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.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue 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.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ProfilerOptions.ProfileOptions.AdvancedConfigValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * AdvancedConfigValue represents the configuration value, it can be one of
    +       * the following types: string, bool, int64, depending upon the config type.
    +       * 
    + * + * Protobuf type {@code tensorflow.ProfileOptions.AdvancedConfigValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions.AdvancedConfigValue) + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder.class); + } + + // Construct using org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getDefaultInstanceForType() { + return org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue build() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue buildPartial() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue result = new org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) { + return mergeFrom((org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue other) { + if (other == org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case STRING_VALUE: { + valueCase_ = 1; + value_ = other.value_; + onChanged(); + break; + } + case BOOL_VALUE: { + setBoolValue(other.getBoolValue()); + break; + } + case INT64_VALUE: { + setInt64Value(other.getInt64Value()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + valueCase_ = 1; + value_ = s; + break; + } // case 10 + case 16: { + value_ = input.readBool(); + valueCase_ = 2; + break; + } // case 16 + case 24: { + value_ = input.readInt64(); + valueCase_ = 3; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string string_value = 1; + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return valueCase_ == 1; + } + /** + * string string_value = 1; + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 1) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 1) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string string_value = 1; + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 1) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 1) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string string_value = 1; + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + /** + * string string_value = 1; + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string string_value = 1; + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + + /** + * bool bool_value = 2; + * @return Whether the boolValue field is set. + */ + public boolean hasBoolValue() { + return valueCase_ == 2; + } + /** + * bool bool_value = 2; + * @return The boolValue. + */ + public boolean getBoolValue() { + if (valueCase_ == 2) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + * bool bool_value = 2; + * @param value The boolValue to set. + * @return This builder for chaining. + */ + public Builder setBoolValue(boolean value) { + + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * bool bool_value = 2; + * @return This builder for chaining. + */ + public Builder clearBoolValue() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * int64 int64_value = 3; + * @return Whether the int64Value field is set. + */ + public boolean hasInt64Value() { + return valueCase_ == 3; + } + /** + * int64 int64_value = 3; + * @return The int64Value. + */ + public long getInt64Value() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * int64 int64_value = 3; + * @param value The int64Value to set. + * @return This builder for chaining. + */ + public Builder setInt64Value(long value) { + + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * int64 int64_value = 3; + * @return This builder for chaining. + */ + public Builder clearInt64Value() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ProfileOptions.AdvancedConfigValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions.AdvancedConfigValue) + private static final org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue(); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AdvancedConfigValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProfilerOptions.ProfileOptions.AdvancedConfigValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VERSION_FIELD_NUMBER = 5; + private int version_ = 0; + /** + *
    +     * Some default value of option are not proto3 default value. Use this version
    +     * to determine if we should use default option value instead of proto3
    +     * default value.
    +     * 
    + * + * uint32 version = 5; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 6; + private int deviceType_ = 0; + /** + *
    +     * Device type to profile/trace: (version >= 1)
    +     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +     * DeviceType::CPU: only CPU will be profiled.
    +     * DeviceType::GPU: only CPU/GPU will be profiled.
    +     * DeviceType::TPU: only CPU/TPU will be profiled.
    +     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +     * will be profiled.
    +     * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The enum numeric value on the wire for deviceType. + */ + @java.lang.Override public int getDeviceTypeValue() { + return deviceType_; + } + /** + *
    +     * Device type to profile/trace: (version >= 1)
    +     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +     * DeviceType::CPU: only CPU will be profiled.
    +     * DeviceType::GPU: only CPU/GPU will be profiled.
    +     * DeviceType::TPU: only CPU/TPU will be profiled.
    +     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +     * will be profiled.
    +     * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The deviceType. + */ + @java.lang.Override public org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType getDeviceType() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType result = org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.forNumber(deviceType_); + return result == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.UNRECOGNIZED : result; + } + + public static final int INCLUDE_DATASET_OPS_FIELD_NUMBER = 1; + private boolean includeDatasetOps_ = false; + /** + *
    +     * We don't collect the dataset ops by default for better trace-viewer
    +     * scalability. The caller can manually set this field to include the ops.
    +     * 
    + * + * bool include_dataset_ops = 1; + * @return The includeDatasetOps. + */ + @java.lang.Override + public boolean getIncludeDatasetOps() { + return includeDatasetOps_; + } + + public static final int HOST_TRACER_LEVEL_FIELD_NUMBER = 2; + private int hostTracerLevel_ = 0; + /** + *
    +     * Levels of host tracing: (version >= 1)
    +     * - Level 0 is used to disable host traces.
    +     * - Level 1 enables tracing of only user instrumented (or default) TraceMe,
    +     * this is the default.
    +     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    +     * level program execution details (expensive TF ops, XLA ops, etc).
    +     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    +     * (low-level) program execution details (cheap TF ops, etc).
    +     * 
    + * + * uint32 host_tracer_level = 2; + * @return The hostTracerLevel. + */ + @java.lang.Override + public int getHostTracerLevel() { + return hostTracerLevel_; + } + + public static final int DEVICE_TRACER_LEVEL_FIELD_NUMBER = 3; + private int deviceTracerLevel_ = 0; + /** + *
    +     * Levels of device tracing: (version >= 1)
    +     * - Level 0 is used to disable device traces.
    +     * - Level 1 is used to enable device traces.
    +     * - More levels might be defined for specific device for controlling the
    +     * verbosity of the trace.
    +     * 
    + * + * uint32 device_tracer_level = 3; + * @return The deviceTracerLevel. + */ + @java.lang.Override + public int getDeviceTracerLevel() { + return deviceTracerLevel_; + } + + public static final int PYTHON_TRACER_LEVEL_FIELD_NUMBER = 4; + private int pythonTracerLevel_ = 0; + /** + *
    +     * Whether enable python function calls tracing. Runtime overhead ensues if
    +     * enabled. Default off. (version >= 1)
    +     * 
    + * + * uint32 python_tracer_level = 4; + * @return The pythonTracerLevel. + */ + @java.lang.Override + public int getPythonTracerLevel() { + return pythonTracerLevel_; + } + + public static final int ENABLE_HLO_PROTO_FIELD_NUMBER = 7; + private boolean enableHloProto_ = false; + /** + *
    +     * Whether serialize hlo_proto when XLA is used. (version >= 1)
    +     * 
    + * + * bool enable_hlo_proto = 7; + * @return The enableHloProto. + */ + @java.lang.Override + public boolean getEnableHloProto() { + return enableHloProto_; + } + + public static final int START_TIMESTAMP_NS_FIELD_NUMBER = 8; + private long startTimestampNs_ = 0L; + /** + *
    +     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
    +     * 
    + * + * uint64 start_timestamp_ns = 8; + * @return The startTimestampNs. + */ + @java.lang.Override + public long getStartTimestampNs() { + return startTimestampNs_; + } + + public static final int DURATION_MS_FIELD_NUMBER = 9; + private long durationMs_ = 0L; + /** + *
    +     * The local profiler collects `duration_ms` milliseconds of data. If the
    +     * value is 0, profiling continues until interrupted.
    +     * 
    + * + * uint64 duration_ms = 9; + * @return The durationMs. + */ + @java.lang.Override + public long getDurationMs() { + return durationMs_; + } + + public static final int REPOSITORY_PATH_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private volatile java.lang.Object repositoryPath_ = ""; + /** + *
    +     * Directory to save profile data to. No-op when empty.
    +     * 
    + * + * string repository_path = 10; + * @return The repositoryPath. + */ + @java.lang.Override + 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; + * @return The bytes for repositoryPath. + */ + @java.lang.Override + 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; + } + } + + public static final int TRACE_OPTIONS_FIELD_NUMBER = 11; + private org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions traceOptions_; + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return Whether the traceOptions field is set. + */ + @java.lang.Override + public boolean hasTraceOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return The traceOptions. + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions getTraceOptions() { + return traceOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance() : traceOptions_; + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder getTraceOptionsOrBuilder() { + return traceOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance() : traceOptions_; + } + + public static final int ADVANCED_CONFIGURATION_FIELD_NUMBER = 12; + private static final class AdvancedConfigurationDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue> advancedConfiguration_; + private com.google.protobuf.MapField + internalGetAdvancedConfiguration() { + if (advancedConfiguration_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AdvancedConfigurationDefaultEntryHolder.defaultEntry); + } + return advancedConfiguration_; + } + public int getAdvancedConfigurationCount() { + return internalGetAdvancedConfiguration().getMap().size(); + } + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public boolean containsAdvancedConfiguration( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAdvancedConfiguration().getMap().containsKey(key); + } + /** + * Use {@link #getAdvancedConfigurationMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAdvancedConfiguration() { + return getAdvancedConfigurationMap(); + } + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public java.util.Map getAdvancedConfigurationMap() { + return internalGetAdvancedConfiguration().getMap(); + } + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAdvancedConfiguration().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Advanced configuration for the profiler contains a map of config name to
    +     * config value. It gives the flexibility to pass any configuration to the
    +     * profiler. eg:
    +     * advanced_configuration {
    +     * key: "tpu_trace_mode"
    +     * value: {
    +     * int64_value: 2
    +     * }
    +     * }
    +     * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAdvancedConfiguration().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RAISE_ERROR_ON_START_FAILURE_FIELD_NUMBER = 13; + private boolean raiseErrorOnStartFailure_ = false; + /** + * bool raise_error_on_start_failure = 13; + * @return The raiseErrorOnStartFailure. + */ + @java.lang.Override + public boolean getRaiseErrorOnStartFailure() { + return raiseErrorOnStartFailure_; + } + + 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 (includeDatasetOps_ != false) { + output.writeBool(1, includeDatasetOps_); + } + if (hostTracerLevel_ != 0) { + output.writeUInt32(2, hostTracerLevel_); + } + if (deviceTracerLevel_ != 0) { + output.writeUInt32(3, deviceTracerLevel_); + } + if (pythonTracerLevel_ != 0) { + output.writeUInt32(4, pythonTracerLevel_); + } + if (version_ != 0) { + output.writeUInt32(5, version_); + } + if (deviceType_ != org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) { + output.writeEnum(6, deviceType_); + } + if (enableHloProto_ != false) { + output.writeBool(7, enableHloProto_); + } + if (startTimestampNs_ != 0L) { + output.writeUInt64(8, startTimestampNs_); + } + if (durationMs_ != 0L) { + output.writeUInt64(9, durationMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(repositoryPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, repositoryPath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(11, getTraceOptions()); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetAdvancedConfiguration(), + AdvancedConfigurationDefaultEntryHolder.defaultEntry, + 12); + if (raiseErrorOnStartFailure_ != false) { + output.writeBool(13, raiseErrorOnStartFailure_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (includeDatasetOps_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, includeDatasetOps_); + } + if (hostTracerLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, hostTracerLevel_); + } + if (deviceTracerLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, deviceTracerLevel_); + } + if (pythonTracerLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, pythonTracerLevel_); + } + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, version_); + } + if (deviceType_ != org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, deviceType_); + } + if (enableHloProto_ != false) { + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(repositoryPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, repositoryPath_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getTraceOptions()); + } + for (java.util.Map.Entry entry + : internalGetAdvancedConfiguration().getMap().entrySet()) { + com.google.protobuf.MapEntry + advancedConfiguration__ = AdvancedConfigurationDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, advancedConfiguration__); + } + if (raiseErrorOnStartFailure_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, raiseErrorOnStartFailure_); + } + size += getUnknownFields().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.ProfilerOptions.ProfileOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.ProfilerOptions.ProfileOptions other = (org.tensorflow.proto.ProfilerOptions.ProfileOptions) obj; + + if (getVersion() + != other.getVersion()) return false; + if (deviceType_ != other.deviceType_) return false; + if (getIncludeDatasetOps() + != other.getIncludeDatasetOps()) return false; + if (getHostTracerLevel() + != other.getHostTracerLevel()) return false; + if (getDeviceTracerLevel() + != other.getDeviceTracerLevel()) return false; + if (getPythonTracerLevel() + != 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 (hasTraceOptions() != other.hasTraceOptions()) return false; + if (hasTraceOptions()) { + if (!getTraceOptions() + .equals(other.getTraceOptions())) return false; + } + if (!internalGetAdvancedConfiguration().equals( + other.internalGetAdvancedConfiguration())) return false; + if (getRaiseErrorOnStartFailure() + != other.getRaiseErrorOnStartFailure()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + deviceType_; + hash = (37 * hash) + INCLUDE_DATASET_OPS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIncludeDatasetOps()); + hash = (37 * hash) + HOST_TRACER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getHostTracerLevel(); + hash = (37 * hash) + DEVICE_TRACER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getDeviceTracerLevel(); + hash = (37 * hash) + PYTHON_TRACER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getPythonTracerLevel(); + 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(); + if (hasTraceOptions()) { + hash = (37 * hash) + TRACE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTraceOptions().hashCode(); + } + if (!internalGetAdvancedConfiguration().getMap().isEmpty()) { + hash = (37 * hash) + ADVANCED_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + internalGetAdvancedConfiguration().hashCode(); + } + hash = (37 * hash) + RAISE_ERROR_ON_START_FAILURE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRaiseErrorOnStartFailure()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions 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.ProfilerOptions.ProfileOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions 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.ProfilerOptions.ProfileOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ProfilerOptions.ProfileOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Next ID: 14
    +     * 
    + * + * Protobuf type {@code tensorflow.ProfileOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions) + org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetAdvancedConfiguration(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 12: + return internalGetMutableAdvancedConfiguration(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.class, org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.ProfilerOptions.ProfileOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTraceOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + version_ = 0; + deviceType_ = 0; + includeDatasetOps_ = false; + hostTracerLevel_ = 0; + deviceTracerLevel_ = 0; + pythonTracerLevel_ = 0; + enableHloProto_ = false; + startTimestampNs_ = 0L; + durationMs_ = 0L; + repositoryPath_ = ""; + traceOptions_ = null; + if (traceOptionsBuilder_ != null) { + traceOptionsBuilder_.dispose(); + traceOptionsBuilder_ = null; + } + internalGetMutableAdvancedConfiguration().clear(); + raiseErrorOnStartFailure_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_ProfileOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions getDefaultInstanceForType() { + return org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions build() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions buildPartial() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions result = new org.tensorflow.proto.ProfilerOptions.ProfileOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ProfilerOptions.ProfileOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.deviceType_ = deviceType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.includeDatasetOps_ = includeDatasetOps_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.hostTracerLevel_ = hostTracerLevel_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.deviceTracerLevel_ = deviceTracerLevel_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pythonTracerLevel_ = pythonTracerLevel_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.enableHloProto_ = enableHloProto_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.startTimestampNs_ = startTimestampNs_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.durationMs_ = durationMs_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.repositoryPath_ = repositoryPath_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000400) != 0)) { + result.traceOptions_ = traceOptionsBuilder_ == null + ? traceOptions_ + : traceOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.advancedConfiguration_ = internalGetAdvancedConfiguration().build(AdvancedConfigurationDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.raiseErrorOnStartFailure_ = raiseErrorOnStartFailure_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ProfilerOptions.ProfileOptions) { + return mergeFrom((org.tensorflow.proto.ProfilerOptions.ProfileOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ProfilerOptions.ProfileOptions other) { + if (other == org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance()) return this; + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + if (other.deviceType_ != 0) { + setDeviceTypeValue(other.getDeviceTypeValue()); + } + if (other.getIncludeDatasetOps() != false) { + setIncludeDatasetOps(other.getIncludeDatasetOps()); + } + if (other.getHostTracerLevel() != 0) { + setHostTracerLevel(other.getHostTracerLevel()); + } + if (other.getDeviceTracerLevel() != 0) { + setDeviceTracerLevel(other.getDeviceTracerLevel()); + } + if (other.getPythonTracerLevel() != 0) { + setPythonTracerLevel(other.getPythonTracerLevel()); + } + 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_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasTraceOptions()) { + mergeTraceOptions(other.getTraceOptions()); + } + internalGetMutableAdvancedConfiguration().mergeFrom( + other.internalGetAdvancedConfiguration()); + bitField0_ |= 0x00000800; + if (other.getRaiseErrorOnStartFailure() != false) { + setRaiseErrorOnStartFailure(other.getRaiseErrorOnStartFailure()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + includeDatasetOps_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 8 + case 16: { + hostTracerLevel_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 24: { + deviceTracerLevel_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 32: { + pythonTracerLevel_ = input.readUInt32(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 40: { + version_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 40 + case 48: { + deviceType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 48 + case 56: { + enableHloProto_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + startTimestampNs_ = input.readUInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + durationMs_ = input.readUInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 82: { + repositoryPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: { + input.readMessage( + getTraceOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: { + com.google.protobuf.MapEntry + advancedConfiguration__ = input.readMessage( + AdvancedConfigurationDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableAdvancedConfiguration().ensureBuilderMap().put( + advancedConfiguration__.getKey(), advancedConfiguration__.getValue()); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: { + raiseErrorOnStartFailure_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int version_ ; + /** + *
    +       * Some default value of option are not proto3 default value. Use this version
    +       * to determine if we should use default option value instead of proto3
    +       * default value.
    +       * 
    + * + * uint32 version = 5; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + /** + *
    +       * Some default value of option are not proto3 default value. Use this version
    +       * to determine if we should use default option value instead of proto3
    +       * default value.
    +       * 
    + * + * uint32 version = 5; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(int value) { + + version_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Some default value of option are not proto3 default value. Use this version
    +       * to determine if we should use default option value instead of proto3
    +       * default value.
    +       * 
    + * + * uint32 version = 5; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + version_ = 0; + onChanged(); + return this; + } + + private int deviceType_ = 0; + /** + *
    +       * Device type to profile/trace: (version >= 1)
    +       * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +       * DeviceType::CPU: only CPU will be profiled.
    +       * DeviceType::GPU: only CPU/GPU will be profiled.
    +       * DeviceType::TPU: only CPU/TPU will be profiled.
    +       * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +       * will be profiled.
    +       * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The enum numeric value on the wire for deviceType. + */ + @java.lang.Override public int getDeviceTypeValue() { + return deviceType_; + } + /** + *
    +       * Device type to profile/trace: (version >= 1)
    +       * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +       * DeviceType::CPU: only CPU will be profiled.
    +       * DeviceType::GPU: only CPU/GPU will be profiled.
    +       * DeviceType::TPU: only CPU/TPU will be profiled.
    +       * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +       * will be profiled.
    +       * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @param value The enum numeric value on the wire for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeValue(int value) { + deviceType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Device type to profile/trace: (version >= 1)
    +       * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +       * DeviceType::CPU: only CPU will be profiled.
    +       * DeviceType::GPU: only CPU/GPU will be profiled.
    +       * DeviceType::TPU: only CPU/TPU will be profiled.
    +       * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +       * will be profiled.
    +       * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return The deviceType. + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType getDeviceType() { + org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType result = org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.forNumber(deviceType_); + return result == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType.UNRECOGNIZED : result; + } + /** + *
    +       * Device type to profile/trace: (version >= 1)
    +       * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +       * DeviceType::CPU: only CPU will be profiled.
    +       * DeviceType::GPU: only CPU/GPU will be profiled.
    +       * DeviceType::TPU: only CPU/TPU will be profiled.
    +       * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +       * will be profiled.
    +       * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType(org.tensorflow.proto.ProfilerOptions.ProfileOptions.DeviceType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + deviceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Device type to profile/trace: (version >= 1)
    +       * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
    +       * DeviceType::CPU: only CPU will be profiled.
    +       * DeviceType::GPU: only CPU/GPU will be profiled.
    +       * DeviceType::TPU: only CPU/TPU will be profiled.
    +       * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
    +       * will be profiled.
    +       * 
    + * + * .tensorflow.ProfileOptions.DeviceType device_type = 6; + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + bitField0_ = (bitField0_ & ~0x00000002); + deviceType_ = 0; + onChanged(); + return this; + } + + private boolean includeDatasetOps_ ; + /** + *
    +       * We don't collect the dataset ops by default for better trace-viewer
    +       * scalability. The caller can manually set this field to include the ops.
    +       * 
    + * + * bool include_dataset_ops = 1; + * @return The includeDatasetOps. + */ + @java.lang.Override + public boolean getIncludeDatasetOps() { + return includeDatasetOps_; + } + /** + *
    +       * We don't collect the dataset ops by default for better trace-viewer
    +       * scalability. The caller can manually set this field to include the ops.
    +       * 
    + * + * bool include_dataset_ops = 1; + * @param value The includeDatasetOps to set. + * @return This builder for chaining. + */ + public Builder setIncludeDatasetOps(boolean value) { + + includeDatasetOps_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * We don't collect the dataset ops by default for better trace-viewer
    +       * scalability. The caller can manually set this field to include the ops.
    +       * 
    + * + * bool include_dataset_ops = 1; + * @return This builder for chaining. + */ + public Builder clearIncludeDatasetOps() { + bitField0_ = (bitField0_ & ~0x00000004); + includeDatasetOps_ = false; + onChanged(); + return this; + } + + private int hostTracerLevel_ ; + /** + *
    +       * Levels of host tracing: (version >= 1)
    +       * - Level 0 is used to disable host traces.
    +       * - Level 1 enables tracing of only user instrumented (or default) TraceMe,
    +       * this is the default.
    +       * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    +       * level program execution details (expensive TF ops, XLA ops, etc).
    +       * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    +       * (low-level) program execution details (cheap TF ops, etc).
    +       * 
    + * + * uint32 host_tracer_level = 2; + * @return The hostTracerLevel. + */ + @java.lang.Override + public int getHostTracerLevel() { + return hostTracerLevel_; + } + /** + *
    +       * Levels of host tracing: (version >= 1)
    +       * - Level 0 is used to disable host traces.
    +       * - Level 1 enables tracing of only user instrumented (or default) TraceMe,
    +       * this is the default.
    +       * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    +       * level program execution details (expensive TF ops, XLA ops, etc).
    +       * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    +       * (low-level) program execution details (cheap TF ops, etc).
    +       * 
    + * + * uint32 host_tracer_level = 2; + * @param value The hostTracerLevel to set. + * @return This builder for chaining. + */ + public Builder setHostTracerLevel(int value) { + + hostTracerLevel_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Levels of host tracing: (version >= 1)
    +       * - Level 0 is used to disable host traces.
    +       * - Level 1 enables tracing of only user instrumented (or default) TraceMe,
    +       * this is the default.
    +       * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
    +       * level program execution details (expensive TF ops, XLA ops, etc).
    +       * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
    +       * (low-level) program execution details (cheap TF ops, etc).
    +       * 
    + * + * uint32 host_tracer_level = 2; + * @return This builder for chaining. + */ + public Builder clearHostTracerLevel() { + bitField0_ = (bitField0_ & ~0x00000008); + hostTracerLevel_ = 0; + onChanged(); + return this; + } + + private int deviceTracerLevel_ ; + /** + *
    +       * Levels of device tracing: (version >= 1)
    +       * - Level 0 is used to disable device traces.
    +       * - Level 1 is used to enable device traces.
    +       * - More levels might be defined for specific device for controlling the
    +       * verbosity of the trace.
    +       * 
    + * + * uint32 device_tracer_level = 3; + * @return The deviceTracerLevel. + */ + @java.lang.Override + public int getDeviceTracerLevel() { + return deviceTracerLevel_; + } + /** + *
    +       * Levels of device tracing: (version >= 1)
    +       * - Level 0 is used to disable device traces.
    +       * - Level 1 is used to enable device traces.
    +       * - More levels might be defined for specific device for controlling the
    +       * verbosity of the trace.
    +       * 
    + * + * uint32 device_tracer_level = 3; + * @param value The deviceTracerLevel to set. + * @return This builder for chaining. + */ + public Builder setDeviceTracerLevel(int value) { + + deviceTracerLevel_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Levels of device tracing: (version >= 1)
    +       * - Level 0 is used to disable device traces.
    +       * - Level 1 is used to enable device traces.
    +       * - More levels might be defined for specific device for controlling the
    +       * verbosity of the trace.
    +       * 
    + * + * uint32 device_tracer_level = 3; + * @return This builder for chaining. + */ + public Builder clearDeviceTracerLevel() { + bitField0_ = (bitField0_ & ~0x00000010); + deviceTracerLevel_ = 0; + onChanged(); + return this; + } + + private int pythonTracerLevel_ ; + /** + *
    +       * Whether enable python function calls tracing. Runtime overhead ensues if
    +       * enabled. Default off. (version >= 1)
    +       * 
    + * + * uint32 python_tracer_level = 4; + * @return The pythonTracerLevel. + */ + @java.lang.Override + public int getPythonTracerLevel() { + return pythonTracerLevel_; + } + /** + *
    +       * Whether enable python function calls tracing. Runtime overhead ensues if
    +       * enabled. Default off. (version >= 1)
    +       * 
    + * + * uint32 python_tracer_level = 4; + * @param value The pythonTracerLevel to set. + * @return This builder for chaining. + */ + public Builder setPythonTracerLevel(int value) { + + pythonTracerLevel_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Whether enable python function calls tracing. Runtime overhead ensues if
    +       * enabled. Default off. (version >= 1)
    +       * 
    + * + * uint32 python_tracer_level = 4; + * @return This builder for chaining. + */ + public Builder clearPythonTracerLevel() { + bitField0_ = (bitField0_ & ~0x00000020); + pythonTracerLevel_ = 0; + onChanged(); + return this; + } + + private boolean enableHloProto_ ; + /** + *
    +       * Whether serialize hlo_proto when XLA is used. (version >= 1)
    +       * 
    + * + * bool enable_hlo_proto = 7; + * @return The enableHloProto. + */ + @java.lang.Override + public boolean getEnableHloProto() { + return enableHloProto_; + } + /** + *
    +       * Whether serialize hlo_proto when XLA is used. (version >= 1)
    +       * 
    + * + * bool enable_hlo_proto = 7; + * @param value The enableHloProto to set. + * @return This builder for chaining. + */ + public Builder setEnableHloProto(boolean value) { + + enableHloProto_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * Whether serialize hlo_proto when XLA is used. (version >= 1)
    +       * 
    + * + * bool enable_hlo_proto = 7; + * @return This builder for chaining. + */ + public Builder clearEnableHloProto() { + bitField0_ = (bitField0_ & ~0x00000040); + enableHloProto_ = false; + onChanged(); + return this; + } + + private long startTimestampNs_ ; + /** + *
    +       * The local profiler starts profiling at this Unix timestamp in nanoseconds.
    +       * 
    + * + * uint64 start_timestamp_ns = 8; + * @return The startTimestampNs. + */ + @java.lang.Override + public long getStartTimestampNs() { + return startTimestampNs_; + } + /** + *
    +       * The local profiler starts profiling at this Unix timestamp in nanoseconds.
    +       * 
    + * + * uint64 start_timestamp_ns = 8; + * @param value The startTimestampNs to set. + * @return This builder for chaining. + */ + public Builder setStartTimestampNs(long value) { + + startTimestampNs_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * The local profiler starts profiling at this Unix timestamp in nanoseconds.
    +       * 
    + * + * uint64 start_timestamp_ns = 8; + * @return This builder for chaining. + */ + public Builder clearStartTimestampNs() { + bitField0_ = (bitField0_ & ~0x00000080); + 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; + * @return The durationMs. + */ + @java.lang.Override + 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; + * @param value The durationMs to set. + * @return This builder for chaining. + */ + public Builder setDurationMs(long value) { + + durationMs_ = value; + bitField0_ |= 0x00000100; + 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; + * @return This builder for chaining. + */ + public Builder clearDurationMs() { + bitField0_ = (bitField0_ & ~0x00000100); + durationMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object repositoryPath_ = ""; + /** + *
    +       * Directory to save profile data to. No-op when empty.
    +       * 
    + * + * string repository_path = 10; + * @return The repositoryPath. + */ + 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; + * @return The bytes for repositoryPath. + */ + 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; + * @param value The repositoryPath to set. + * @return This builder for chaining. + */ + public Builder setRepositoryPath( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + repositoryPath_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * Directory to save profile data to. No-op when empty.
    +       * 
    + * + * string repository_path = 10; + * @return This builder for chaining. + */ + public Builder clearRepositoryPath() { + repositoryPath_ = getDefaultInstance().getRepositoryPath(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + *
    +       * Directory to save profile data to. No-op when empty.
    +       * 
    + * + * string repository_path = 10; + * @param value The bytes for repositoryPath to set. + * @return This builder for chaining. + */ + public Builder setRepositoryPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + repositoryPath_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions traceOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder> traceOptionsBuilder_; + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return Whether the traceOptions field is set. + */ + public boolean hasTraceOptions() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + * @return The traceOptions. + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions getTraceOptions() { + if (traceOptionsBuilder_ == null) { + return traceOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance() : traceOptions_; + } else { + return traceOptionsBuilder_.getMessage(); + } + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public Builder setTraceOptions(org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions value) { + if (traceOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + traceOptions_ = value; + } else { + traceOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public Builder setTraceOptions( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder builderForValue) { + if (traceOptionsBuilder_ == null) { + traceOptions_ = builderForValue.build(); + } else { + traceOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public Builder mergeTraceOptions(org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions value) { + if (traceOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + traceOptions_ != null && + traceOptions_ != org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance()) { + getTraceOptionsBuilder().mergeFrom(value); + } else { + traceOptions_ = value; + } + } else { + traceOptionsBuilder_.mergeFrom(value); + } + if (traceOptions_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public Builder clearTraceOptions() { + bitField0_ = (bitField0_ & ~0x00000400); + traceOptions_ = null; + if (traceOptionsBuilder_ != null) { + traceOptionsBuilder_.dispose(); + traceOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder getTraceOptionsBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getTraceOptionsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder getTraceOptionsOrBuilder() { + if (traceOptionsBuilder_ != null) { + return traceOptionsBuilder_.getMessageOrBuilder(); + } else { + return traceOptions_ == null ? + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.getDefaultInstance() : traceOptions_; + } + } + /** + * .tensorflow.ProfileOptions.TraceOptions trace_options = 11; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder> + getTraceOptionsFieldBuilder() { + if (traceOptionsBuilder_ == null) { + traceOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptions.TraceOptionsOrBuilder>( + getTraceOptions(), + getParentForChildren(), + isClean()); + traceOptions_ = null; + } + return traceOptionsBuilder_; + } + + private static final class AdvancedConfigurationConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue build(org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) { return (org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) val; } + return ((org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return AdvancedConfigurationDefaultEntryHolder.defaultEntry; + } + }; + private static final AdvancedConfigurationConverter advancedConfigurationConverter = new AdvancedConfigurationConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValueOrBuilder, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue, org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder> advancedConfiguration_; + private com.google.protobuf.MapFieldBuilder + internalGetAdvancedConfiguration() { + if (advancedConfiguration_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(advancedConfigurationConverter); + } + return advancedConfiguration_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableAdvancedConfiguration() { + if (advancedConfiguration_ == null) { + advancedConfiguration_ = new com.google.protobuf.MapFieldBuilder<>(advancedConfigurationConverter); + } + bitField0_ |= 0x00000800; + onChanged(); + return advancedConfiguration_; + } + public int getAdvancedConfigurationCount() { + return internalGetAdvancedConfiguration().ensureBuilderMap().size(); + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public boolean containsAdvancedConfiguration( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAdvancedConfiguration().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getAdvancedConfigurationMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAdvancedConfiguration() { + return getAdvancedConfigurationMap(); + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public java.util.Map getAdvancedConfigurationMap() { + return internalGetAdvancedConfiguration().getImmutableMap(); + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAdvancedConfiguration().ensureBuilderMap(); + return map.containsKey(key) ? advancedConfigurationConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue getAdvancedConfigurationOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableAdvancedConfiguration().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return advancedConfigurationConverter.build(map.get(key)); + } + public Builder clearAdvancedConfiguration() { + bitField0_ = (bitField0_ & ~0x00000800); + internalGetMutableAdvancedConfiguration().clear(); + return this; + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + public Builder removeAdvancedConfiguration( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAdvancedConfiguration().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAdvancedConfiguration() { + bitField0_ |= 0x00000800; + return internalGetMutableAdvancedConfiguration().ensureMessageMap(); + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + public Builder putAdvancedConfiguration( + java.lang.String key, + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableAdvancedConfiguration().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000800; + return this; + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + public Builder putAllAdvancedConfiguration( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAdvancedConfiguration().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000800; + return this; + } + /** + *
    +       * Advanced configuration for the profiler contains a map of config name to
    +       * config value. It gives the flexibility to pass any configuration to the
    +       * profiler. eg:
    +       * advanced_configuration {
    +       * key: "tpu_trace_mode"
    +       * value: {
    +       * int64_value: 2
    +       * }
    +       * }
    +       * 
    + * + * map<string, .tensorflow.ProfileOptions.AdvancedConfigValue> advanced_configuration = 12; + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder putAdvancedConfigurationBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableAdvancedConfiguration().ensureBuilderMap(); + org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) { + entry = ((org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.ProfilerOptions.ProfileOptions.AdvancedConfigValue.Builder) entry; + } + + private boolean raiseErrorOnStartFailure_ ; + /** + * bool raise_error_on_start_failure = 13; + * @return The raiseErrorOnStartFailure. + */ + @java.lang.Override + public boolean getRaiseErrorOnStartFailure() { + return raiseErrorOnStartFailure_; + } + /** + * bool raise_error_on_start_failure = 13; + * @param value The raiseErrorOnStartFailure to set. + * @return This builder for chaining. + */ + public Builder setRaiseErrorOnStartFailure(boolean value) { + + raiseErrorOnStartFailure_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * bool raise_error_on_start_failure = 13; + * @return This builder for chaining. + */ + public Builder clearRaiseErrorOnStartFailure() { + bitField0_ = (bitField0_ & ~0x00001000); + raiseErrorOnStartFailure_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ProfileOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions) + private static final org.tensorflow.proto.ProfilerOptions.ProfileOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ProfilerOptions.ProfileOptions(); + } + + public static org.tensorflow.proto.ProfilerOptions.ProfileOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProfileOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProfilerOptions.ProfileOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + 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; + * @return Whether the profilerOptions field is set. + */ + boolean hasProfilerOptions(); + /** + *
    +     * Options for each local profiler.
    +     * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + * @return The profilerOptions. + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptions getProfilerOptions(); + /** + *
    +     * Options for each local profiler.
    +     * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder(); + + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @return A list containing the serviceAddresses. + */ + java.util.List + getServiceAddressesList(); + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @return The count of serviceAddresses. + */ + int getServiceAddressesCount(); + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @param index The index of the element to return. + * @return The serviceAddresses at the given index. + */ + java.lang.String getServiceAddresses(int index); + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @param index The index of the value to return. + * @return The bytes of the serviceAddresses at the given index. + */ + com.google.protobuf.ByteString + getServiceAddressesBytes(int index); + + /** + *
    +     * Unix timestamp of when the session was started.
    +     * 
    + * + * uint64 session_creation_timestamp_ns = 3; + * @return The sessionCreationTimestampNs. + */ + 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; + * @return The maxSessionDurationMs. + */ + long getMaxSessionDurationMs(); + + /** + *
    +     * Start of profiling is delayed by this much (in milliseconds).
    +     * 
    + * + * uint64 delay_ms = 5; + * @return The delayMs. + */ + long getDelayMs(); + } + /** + *
    +   * Options for remote profiler session manager.
    +   * Next ID: 6
    +   * 
    + * + * Protobuf type {@code tensorflow.RemoteProfilerSessionManagerOptions} + */ + public static final class RemoteProfilerSessionManagerOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RemoteProfilerSessionManagerOptions) + RemoteProfilerSessionManagerOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RemoteProfilerSessionManagerOptions.class.getName()); + } + // Use RemoteProfilerSessionManagerOptions.newBuilder() to construct. + private RemoteProfilerSessionManagerOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RemoteProfilerSessionManagerOptions() { + serviceAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.Builder.class); + } + + private int bitField0_; + public static final int PROFILER_OPTIONS_FIELD_NUMBER = 1; + private org.tensorflow.proto.ProfilerOptions.ProfileOptions profilerOptions_; + /** + *
    +     * Options for each local profiler.
    +     * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + * @return Whether the profilerOptions field is set. + */ + @java.lang.Override + public boolean hasProfilerOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Options for each local profiler.
    +     * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + * @return The profilerOptions. + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptions getProfilerOptions() { + return profilerOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance() : profilerOptions_; + } + /** + *
    +     * Options for each local profiler.
    +     * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() { + return profilerOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance() : profilerOptions_; + } + + public static final int SERVICE_ADDRESSES_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList serviceAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @return A list containing the serviceAddresses. + */ + public com.google.protobuf.ProtocolStringList + getServiceAddressesList() { + return serviceAddresses_; + } + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @return The count of serviceAddresses. + */ + public int getServiceAddressesCount() { + return serviceAddresses_.size(); + } + /** + *
    +     * List of servers to profile. Supported formats: host:port.
    +     * 
    + * + * repeated string service_addresses = 2; + * @param index The index of the element to return. + * @return The serviceAddresses at the given index. + */ + 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; + * @param index The index of the value to return. + * @return The bytes of the serviceAddresses at the given index. + */ + 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_ = 0L; + /** + *
    +     * Unix timestamp of when the session was started.
    +     * 
    + * + * uint64 session_creation_timestamp_ns = 3; + * @return The sessionCreationTimestampNs. + */ + @java.lang.Override + public long getSessionCreationTimestampNs() { + return sessionCreationTimestampNs_; + } + + public static final int MAX_SESSION_DURATION_MS_FIELD_NUMBER = 4; + private long maxSessionDurationMs_ = 0L; + /** + *
    +     * 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; + * @return The maxSessionDurationMs. + */ + @java.lang.Override + public long getMaxSessionDurationMs() { + return maxSessionDurationMs_; + } + + public static final int DELAY_MS_FIELD_NUMBER = 5; + private long delayMs_ = 0L; + /** + *
    +     * Start of profiling is delayed by this much (in milliseconds).
    +     * 
    + * + * uint64 delay_ms = 5; + * @return The delayMs. + */ + @java.lang.Override + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getProfilerOptions()); + } + for (int i = 0; i < serviceAddresses_.size(); i++) { + com.google.protobuf.GeneratedMessage.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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + 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 += getUnknownFields().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.ProfilerOptions.RemoteProfilerSessionManagerOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions other = (org.tensorflow.proto.ProfilerOptions.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.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.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.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.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ProfilerOptions.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.GeneratedMessage.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.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RemoteProfilerSessionManagerOptions) + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getProfilerOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + profilerOptions_ = null; + if (profilerOptionsBuilder_ != null) { + profilerOptionsBuilder_.dispose(); + profilerOptionsBuilder_ = null; + } + serviceAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + sessionCreationTimestampNs_ = 0L; + maxSessionDurationMs_ = 0L; + delayMs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ProfilerOptions.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() { + return org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions build() { + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions buildPartial() { + org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions result = new org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.profilerOptions_ = profilerOptionsBuilder_ == null + ? profilerOptions_ + : profilerOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + serviceAddresses_.makeImmutable(); + result.serviceAddresses_ = serviceAddresses_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sessionCreationTimestampNs_ = sessionCreationTimestampNs_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.maxSessionDurationMs_ = maxSessionDurationMs_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.delayMs_ = delayMs_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions) { + return mergeFrom((org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions other) { + if (other == org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions.getDefaultInstance()) return this; + if (other.hasProfilerOptions()) { + mergeProfilerOptions(other.getProfilerOptions()); + } + if (!other.serviceAddresses_.isEmpty()) { + if (serviceAddresses_.isEmpty()) { + serviceAddresses_ = other.serviceAddresses_; + bitField0_ |= 0x00000002; + } 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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getProfilerOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureServiceAddressesIsMutable(); + serviceAddresses_.add(s); + break; + } // case 18 + case 24: { + sessionCreationTimestampNs_ = input.readUInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + maxSessionDurationMs_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + delayMs_ = input.readUInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.ProfilerOptions.ProfileOptions profilerOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder> profilerOptionsBuilder_; + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + * @return Whether the profilerOptions field is set. + */ + public boolean hasProfilerOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + * @return The profilerOptions. + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions getProfilerOptions() { + if (profilerOptionsBuilder_ == null) { + return profilerOptions_ == null ? org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance() : profilerOptions_; + } else { + return profilerOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder setProfilerOptions(org.tensorflow.proto.ProfilerOptions.ProfileOptions value) { + if (profilerOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + profilerOptions_ = value; + } else { + profilerOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder setProfilerOptions( + org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder builderForValue) { + if (profilerOptionsBuilder_ == null) { + profilerOptions_ = builderForValue.build(); + } else { + profilerOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder mergeProfilerOptions(org.tensorflow.proto.ProfilerOptions.ProfileOptions value) { + if (profilerOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + profilerOptions_ != null && + profilerOptions_ != org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance()) { + getProfilerOptionsBuilder().mergeFrom(value); + } else { + profilerOptions_ = value; + } + } else { + profilerOptionsBuilder_.mergeFrom(value); + } + if (profilerOptions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public Builder clearProfilerOptions() { + bitField0_ = (bitField0_ & ~0x00000001); + profilerOptions_ = null; + if (profilerOptionsBuilder_ != null) { + profilerOptionsBuilder_.dispose(); + profilerOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder getProfilerOptionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getProfilerOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + public org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() { + if (profilerOptionsBuilder_ != null) { + return profilerOptionsBuilder_.getMessageOrBuilder(); + } else { + return profilerOptions_ == null ? + org.tensorflow.proto.ProfilerOptions.ProfileOptions.getDefaultInstance() : profilerOptions_; + } + } + /** + *
    +       * Options for each local profiler.
    +       * 
    + * + * .tensorflow.ProfileOptions profiler_options = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder> + getProfilerOptionsFieldBuilder() { + if (profilerOptionsBuilder_ == null) { + profilerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ProfilerOptions.ProfileOptions, org.tensorflow.proto.ProfilerOptions.ProfileOptions.Builder, org.tensorflow.proto.ProfilerOptions.ProfileOptionsOrBuilder>( + getProfilerOptions(), + getParentForChildren(), + isClean()); + profilerOptions_ = null; + } + return profilerOptionsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList serviceAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureServiceAddressesIsMutable() { + if (!serviceAddresses_.isModifiable()) { + serviceAddresses_ = new com.google.protobuf.LazyStringArrayList(serviceAddresses_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @return A list containing the serviceAddresses. + */ + public com.google.protobuf.ProtocolStringList + getServiceAddressesList() { + serviceAddresses_.makeImmutable(); + return serviceAddresses_; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @return The count of serviceAddresses. + */ + public int getServiceAddressesCount() { + return serviceAddresses_.size(); + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @param index The index of the element to return. + * @return The serviceAddresses at the given index. + */ + 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; + * @param index The index of the value to return. + * @return The bytes of the serviceAddresses at the given index. + */ + 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; + * @param index The index to set the value at. + * @param value The serviceAddresses to set. + * @return This builder for chaining. + */ + public Builder setServiceAddresses( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceAddressesIsMutable(); + serviceAddresses_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @param value The serviceAddresses to add. + * @return This builder for chaining. + */ + public Builder addServiceAddresses( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceAddressesIsMutable(); + serviceAddresses_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @param values The serviceAddresses to add. + * @return This builder for chaining. + */ + public Builder addAllServiceAddresses( + java.lang.Iterable values) { + ensureServiceAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceAddresses_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @return This builder for chaining. + */ + public Builder clearServiceAddresses() { + serviceAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +       * List of servers to profile. Supported formats: host:port.
    +       * 
    + * + * repeated string service_addresses = 2; + * @param value The bytes of the serviceAddresses to add. + * @return This builder for chaining. + */ + public Builder addServiceAddressesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureServiceAddressesIsMutable(); + serviceAddresses_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long sessionCreationTimestampNs_ ; + /** + *
    +       * Unix timestamp of when the session was started.
    +       * 
    + * + * uint64 session_creation_timestamp_ns = 3; + * @return The sessionCreationTimestampNs. + */ + @java.lang.Override + public long getSessionCreationTimestampNs() { + return sessionCreationTimestampNs_; + } + /** + *
    +       * Unix timestamp of when the session was started.
    +       * 
    + * + * uint64 session_creation_timestamp_ns = 3; + * @param value The sessionCreationTimestampNs to set. + * @return This builder for chaining. + */ + public Builder setSessionCreationTimestampNs(long value) { + + sessionCreationTimestampNs_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Unix timestamp of when the session was started.
    +       * 
    + * + * uint64 session_creation_timestamp_ns = 3; + * @return This builder for chaining. + */ + public Builder clearSessionCreationTimestampNs() { + bitField0_ = (bitField0_ & ~0x00000004); + 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; + * @return The maxSessionDurationMs. + */ + @java.lang.Override + 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; + * @param value The maxSessionDurationMs to set. + * @return This builder for chaining. + */ + public Builder setMaxSessionDurationMs(long value) { + + maxSessionDurationMs_ = value; + bitField0_ |= 0x00000008; + 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; + * @return This builder for chaining. + */ + public Builder clearMaxSessionDurationMs() { + bitField0_ = (bitField0_ & ~0x00000008); + maxSessionDurationMs_ = 0L; + onChanged(); + return this; + } + + private long delayMs_ ; + /** + *
    +       * Start of profiling is delayed by this much (in milliseconds).
    +       * 
    + * + * uint64 delay_ms = 5; + * @return The delayMs. + */ + @java.lang.Override + public long getDelayMs() { + return delayMs_; + } + /** + *
    +       * Start of profiling is delayed by this much (in milliseconds).
    +       * 
    + * + * uint64 delay_ms = 5; + * @param value The delayMs to set. + * @return This builder for chaining. + */ + public Builder setDelayMs(long value) { + + delayMs_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Start of profiling is delayed by this much (in milliseconds).
    +       * 
    + * + * uint64 delay_ms = 5; + * @return This builder for chaining. + */ + public Builder clearDelayMs() { + bitField0_ = (bitField0_ & ~0x00000010); + delayMs_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RemoteProfilerSessionManagerOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RemoteProfilerSessionManagerOptions) + private static final org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ProfilerOptions.RemoteProfilerSessionManagerOptions(); + } + + public static org.tensorflow.proto.ProfilerOptions.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ProfilerOptions.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ProfileOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ProfileOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ProfileOptions_TraceOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_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,tsl/profiler/protobuf/profiler_options" + + ".proto\022\ntensorflow\"\305\006\n\016ProfileOptions\022\017\n" + + "\007version\030\005 \001(\r\022:\n\013device_type\030\006 \001(\0162%.te" + + "nsorflow.ProfileOptions.DeviceType\022\033\n\023in" + + "clude_dataset_ops\030\001 \001(\010\022\031\n\021host_tracer_l" + + "evel\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\020enable_h" + + "lo_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_pa" + + "th\030\n \001(\t\022>\n\rtrace_options\030\013 \001(\0132\'.tensor" + + "flow.ProfileOptions.TraceOptions\022U\n\026adva" + + "nced_configuration\030\014 \003(\01325.tensorflow.Pr" + + "ofileOptions.AdvancedConfigurationEntry\022" + + "$\n\034raise_error_on_start_failure\030\r \001(\010\0320\n" + + "\014TraceOptions\022 \n\030host_traceme_filter_mas" + + "k\030\001 \001(\004\032c\n\023AdvancedConfigValue\022\026\n\014string" + + "_value\030\001 \001(\tH\000\022\024\n\nbool_value\030\002 \001(\010H\000\022\025\n\013" + + "int64_value\030\003 \001(\003H\000B\007\n\005value\032l\n\032Advanced" + + "ConfigurationEntry\022\013\n\003key\030\001 \001(\t\022=\n\005value" + + "\030\002 \001(\0132..tensorflow.ProfileOptions.Advan" + + "cedConfigValue:\0028\001\"N\n\nDeviceType\022\017\n\013UNSP" + + "ECIFIED\020\000\022\007\n\003CPU\020\001\022\007\n\003GPU\020\002\022\007\n\003TPU\020\003\022\024\n\020" + + "PLUGGABLE_DEVICE\020\004\"\320\001\n#RemoteProfilerSes" + + "sionManagerOptions\0224\n\020profiler_options\030\001" + + " \001(\0132\032.tensorflow.ProfileOptions\022\031\n\021serv" + + "ice_addresses\030\002 \003(\t\022%\n\035session_creation_" + + "timestamp_ns\030\003 \001(\004\022\037\n\027max_session_durati" + + "on_ms\030\004 \001(\004\022\020\n\010delay_ms\030\005 \001(\004B\026\n\024org.ten" + + "sorflow.protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_ProfileOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_ProfileOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ProfileOptions_descriptor, + new java.lang.String[] { "Version", "DeviceType", "IncludeDatasetOps", "HostTracerLevel", "DeviceTracerLevel", "PythonTracerLevel", "EnableHloProto", "StartTimestampNs", "DurationMs", "RepositoryPath", "TraceOptions", "AdvancedConfiguration", "RaiseErrorOnStartFailure", }); + internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor = + internal_static_tensorflow_ProfileOptions_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_ProfileOptions_TraceOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ProfileOptions_TraceOptions_descriptor, + new java.lang.String[] { "HostTracemeFilterMask", }); + internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor = + internal_static_tensorflow_ProfileOptions_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ProfileOptions_AdvancedConfigValue_descriptor, + new java.lang.String[] { "StringValue", "BoolValue", "Int64Value", "Value", }); + internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_descriptor = + internal_static_tensorflow_ProfileOptions_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ProfileOptions_AdvancedConfigurationEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor, + new java.lang.String[] { "ProfilerOptions", "ServiceAddresses", "SessionCreationTimestampNs", "MaxSessionDurationMs", "DelayMs", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDef.java new file mode 100644 index 00000000000..550c1c55a0b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDef.java @@ -0,0 +1,1453 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/queue_runner.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing a QueueRunner.
    + * 
    + * + * Protobuf type {@code tensorflow.QueueRunnerDef} + */ +public final class QueueRunnerDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.QueueRunnerDef) + QueueRunnerDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + QueueRunnerDef.class.getName()); + } + // Use QueueRunnerDef.newBuilder() to construct. + private QueueRunnerDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private QueueRunnerDef() { + queueName_ = ""; + enqueueOpName_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + closeOpName_ = ""; + cancelOpName_ = ""; + queueClosedExceptionTypes_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.QueueRunnerDef.class, org.tensorflow.proto.QueueRunnerDef.Builder.class); + } + + public static final int QUEUE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object queueName_ = ""; + /** + *
    +   * Queue name.
    +   * 
    + * + * string queue_name = 1; + * @return The queueName. + */ + @java.lang.Override + public java.lang.String getQueueName() { + java.lang.Object ref = queueName_; + 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(); + queueName_ = s; + return s; + } + } + /** + *
    +   * Queue name.
    +   * 
    + * + * string queue_name = 1; + * @return The bytes for queueName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getQueueNameBytes() { + java.lang.Object ref = queueName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + queueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENQUEUE_OP_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList enqueueOpName_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @return A list containing the enqueueOpName. + */ + public com.google.protobuf.ProtocolStringList + getEnqueueOpNameList() { + return enqueueOpName_; + } + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @return The count of enqueueOpName. + */ + public int getEnqueueOpNameCount() { + return enqueueOpName_.size(); + } + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the element to return. + * @return The enqueueOpName at the given index. + */ + public java.lang.String getEnqueueOpName(int index) { + return enqueueOpName_.get(index); + } + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the value to return. + * @return The bytes of the enqueueOpName at the given index. + */ + public com.google.protobuf.ByteString + getEnqueueOpNameBytes(int index) { + return enqueueOpName_.getByteString(index); + } + + public static final int CLOSE_OP_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object closeOpName_ = ""; + /** + *
    +   * The operation to run to close the queue.
    +   * 
    + * + * string close_op_name = 3; + * @return The closeOpName. + */ + @java.lang.Override + public java.lang.String getCloseOpName() { + java.lang.Object ref = closeOpName_; + 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(); + closeOpName_ = s; + return s; + } + } + /** + *
    +   * The operation to run to close the queue.
    +   * 
    + * + * string close_op_name = 3; + * @return The bytes for closeOpName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCloseOpNameBytes() { + java.lang.Object ref = closeOpName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + closeOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_OP_NAME_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object cancelOpName_ = ""; + /** + *
    +   * The operation to run to cancel the queue.
    +   * 
    + * + * string cancel_op_name = 4; + * @return The cancelOpName. + */ + @java.lang.Override + public java.lang.String getCancelOpName() { + java.lang.Object ref = cancelOpName_; + 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(); + cancelOpName_ = s; + return s; + } + } + /** + *
    +   * The operation to run to cancel the queue.
    +   * 
    + * + * string cancel_op_name = 4; + * @return The bytes for cancelOpName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCancelOpNameBytes() { + java.lang.Object ref = cancelOpName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cancelOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUEUE_CLOSED_EXCEPTION_TYPES_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList queueClosedExceptionTypes_; + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.error.Code> queueClosedExceptionTypes_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.error.Code>() { + public org.tensorflow.proto.error.Code convert(int from) { + org.tensorflow.proto.error.Code result = org.tensorflow.proto.error.Code.forNumber(from); + return result == null ? org.tensorflow.proto.error.Code.UNRECOGNIZED : result; + } + }; + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the queueClosedExceptionTypes. + */ + @java.lang.Override + public java.util.List getQueueClosedExceptionTypesList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.error.Code>(queueClosedExceptionTypes_, queueClosedExceptionTypes_converter_); + } + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return The count of queueClosedExceptionTypes. + */ + @java.lang.Override + public int getQueueClosedExceptionTypesCount() { + return queueClosedExceptionTypes_.size(); + } + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the element to return. + * @return The queueClosedExceptionTypes at the given index. + */ + @java.lang.Override + public org.tensorflow.proto.error.Code getQueueClosedExceptionTypes(int index) { + return queueClosedExceptionTypes_converter_.convert(queueClosedExceptionTypes_.getInt(index)); + } + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the enum numeric values on the wire for queueClosedExceptionTypes. + */ + @java.lang.Override + public java.util.List + getQueueClosedExceptionTypesValueList() { + return queueClosedExceptionTypes_; + } + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of queueClosedExceptionTypes at the given index. + */ + @java.lang.Override + public int getQueueClosedExceptionTypesValue(int index) { + return queueClosedExceptionTypes_.getInt(index); + } + private int queueClosedExceptionTypesMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(queueName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, queueName_); + } + for (int i = 0; i < enqueueOpName_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, enqueueOpName_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(closeOpName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, closeOpName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cancelOpName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, cancelOpName_); + } + if (getQueueClosedExceptionTypesList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(queueClosedExceptionTypesMemoizedSerializedSize); + } + for (int i = 0; i < queueClosedExceptionTypes_.size(); i++) { + output.writeEnumNoTag(queueClosedExceptionTypes_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(queueName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, queueName_); + } + { + int dataSize = 0; + for (int i = 0; i < enqueueOpName_.size(); i++) { + dataSize += computeStringSizeNoTag(enqueueOpName_.getRaw(i)); + } + size += dataSize; + size += 1 * getEnqueueOpNameList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(closeOpName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, closeOpName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cancelOpName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, cancelOpName_); + } + { + int dataSize = 0; + for (int i = 0; i < queueClosedExceptionTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(queueClosedExceptionTypes_.getInt(i)); + } + size += dataSize; + if (!getQueueClosedExceptionTypesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }queueClosedExceptionTypesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.QueueRunnerDef)) { + return super.equals(obj); + } + org.tensorflow.proto.QueueRunnerDef other = (org.tensorflow.proto.QueueRunnerDef) obj; + + if (!getQueueName() + .equals(other.getQueueName())) return false; + if (!getEnqueueOpNameList() + .equals(other.getEnqueueOpNameList())) return false; + if (!getCloseOpName() + .equals(other.getCloseOpName())) return false; + if (!getCancelOpName() + .equals(other.getCancelOpName())) return false; + if (!queueClosedExceptionTypes_.equals(other.queueClosedExceptionTypes_)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + QUEUE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getQueueName().hashCode(); + if (getEnqueueOpNameCount() > 0) { + hash = (37 * hash) + ENQUEUE_OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getEnqueueOpNameList().hashCode(); + } + hash = (37 * hash) + CLOSE_OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCloseOpName().hashCode(); + hash = (37 * hash) + CANCEL_OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCancelOpName().hashCode(); + if (getQueueClosedExceptionTypesCount() > 0) { + hash = (37 * hash) + QUEUE_CLOSED_EXCEPTION_TYPES_FIELD_NUMBER; + hash = (53 * hash) + queueClosedExceptionTypes_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.QueueRunnerDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.QueueRunnerDef 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.QueueRunnerDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.QueueRunnerDef 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.QueueRunnerDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.QueueRunnerDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.QueueRunnerDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.QueueRunnerDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.QueueRunnerDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.QueueRunnerDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.QueueRunnerDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.QueueRunnerDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.QueueRunnerDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a QueueRunner.
    +   * 
    + * + * Protobuf type {@code tensorflow.QueueRunnerDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.QueueRunnerDef) + org.tensorflow.proto.QueueRunnerDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.QueueRunnerDef.class, org.tensorflow.proto.QueueRunnerDef.Builder.class); + } + + // Construct using org.tensorflow.proto.QueueRunnerDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queueName_ = ""; + enqueueOpName_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + closeOpName_ = ""; + cancelOpName_ = ""; + queueClosedExceptionTypes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.QueueRunnerProtos.internal_static_tensorflow_QueueRunnerDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.QueueRunnerDef getDefaultInstanceForType() { + return org.tensorflow.proto.QueueRunnerDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.QueueRunnerDef build() { + org.tensorflow.proto.QueueRunnerDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.QueueRunnerDef buildPartial() { + org.tensorflow.proto.QueueRunnerDef result = new org.tensorflow.proto.QueueRunnerDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.QueueRunnerDef result) { + if (((bitField0_ & 0x00000010) != 0)) { + queueClosedExceptionTypes_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.queueClosedExceptionTypes_ = queueClosedExceptionTypes_; + } + + private void buildPartial0(org.tensorflow.proto.QueueRunnerDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queueName_ = queueName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + enqueueOpName_.makeImmutable(); + result.enqueueOpName_ = enqueueOpName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.closeOpName_ = closeOpName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cancelOpName_ = cancelOpName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.QueueRunnerDef) { + return mergeFrom((org.tensorflow.proto.QueueRunnerDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.QueueRunnerDef other) { + if (other == org.tensorflow.proto.QueueRunnerDef.getDefaultInstance()) return this; + if (!other.getQueueName().isEmpty()) { + queueName_ = other.queueName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.enqueueOpName_.isEmpty()) { + if (enqueueOpName_.isEmpty()) { + enqueueOpName_ = other.enqueueOpName_; + bitField0_ |= 0x00000002; + } else { + ensureEnqueueOpNameIsMutable(); + enqueueOpName_.addAll(other.enqueueOpName_); + } + onChanged(); + } + if (!other.getCloseOpName().isEmpty()) { + closeOpName_ = other.closeOpName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getCancelOpName().isEmpty()) { + cancelOpName_ = other.cancelOpName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.queueClosedExceptionTypes_.isEmpty()) { + if (queueClosedExceptionTypes_.isEmpty()) { + queueClosedExceptionTypes_ = other.queueClosedExceptionTypes_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.addAll(other.queueClosedExceptionTypes_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + queueName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureEnqueueOpNameIsMutable(); + enqueueOpName_.add(s); + break; + } // case 18 + case 26: { + closeOpName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + cancelOpName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + int tmpRaw = input.readEnum(); + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.addInt(tmpRaw); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.addInt(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object queueName_ = ""; + /** + *
    +     * Queue name.
    +     * 
    + * + * string queue_name = 1; + * @return The queueName. + */ + public java.lang.String getQueueName() { + java.lang.Object ref = queueName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + queueName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Queue name.
    +     * 
    + * + * string queue_name = 1; + * @return The bytes for queueName. + */ + public com.google.protobuf.ByteString + getQueueNameBytes() { + java.lang.Object ref = queueName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + queueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Queue name.
    +     * 
    + * + * string queue_name = 1; + * @param value The queueName to set. + * @return This builder for chaining. + */ + public Builder setQueueName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + queueName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Queue name.
    +     * 
    + * + * string queue_name = 1; + * @return This builder for chaining. + */ + public Builder clearQueueName() { + queueName_ = getDefaultInstance().getQueueName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Queue name.
    +     * 
    + * + * string queue_name = 1; + * @param value The bytes for queueName to set. + * @return This builder for chaining. + */ + public Builder setQueueNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + queueName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList enqueueOpName_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureEnqueueOpNameIsMutable() { + if (!enqueueOpName_.isModifiable()) { + enqueueOpName_ = new com.google.protobuf.LazyStringArrayList(enqueueOpName_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @return A list containing the enqueueOpName. + */ + public com.google.protobuf.ProtocolStringList + getEnqueueOpNameList() { + enqueueOpName_.makeImmutable(); + return enqueueOpName_; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @return The count of enqueueOpName. + */ + public int getEnqueueOpNameCount() { + return enqueueOpName_.size(); + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the element to return. + * @return The enqueueOpName at the given index. + */ + public java.lang.String getEnqueueOpName(int index) { + return enqueueOpName_.get(index); + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the value to return. + * @return The bytes of the enqueueOpName at the given index. + */ + public com.google.protobuf.ByteString + getEnqueueOpNameBytes(int index) { + return enqueueOpName_.getByteString(index); + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index to set the value at. + * @param value The enqueueOpName to set. + * @return This builder for chaining. + */ + public Builder setEnqueueOpName( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureEnqueueOpNameIsMutable(); + enqueueOpName_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param value The enqueueOpName to add. + * @return This builder for chaining. + */ + public Builder addEnqueueOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureEnqueueOpNameIsMutable(); + enqueueOpName_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param values The enqueueOpName to add. + * @return This builder for chaining. + */ + public Builder addAllEnqueueOpName( + java.lang.Iterable values) { + ensureEnqueueOpNameIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, enqueueOpName_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @return This builder for chaining. + */ + public Builder clearEnqueueOpName() { + enqueueOpName_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +     * A list of enqueue operations.
    +     * 
    + * + * repeated string enqueue_op_name = 2; + * @param value The bytes of the enqueueOpName to add. + * @return This builder for chaining. + */ + public Builder addEnqueueOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureEnqueueOpNameIsMutable(); + enqueueOpName_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object closeOpName_ = ""; + /** + *
    +     * The operation to run to close the queue.
    +     * 
    + * + * string close_op_name = 3; + * @return The closeOpName. + */ + public java.lang.String getCloseOpName() { + java.lang.Object ref = closeOpName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + closeOpName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The operation to run to close the queue.
    +     * 
    + * + * string close_op_name = 3; + * @return The bytes for closeOpName. + */ + public com.google.protobuf.ByteString + getCloseOpNameBytes() { + java.lang.Object ref = closeOpName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + closeOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The operation to run to close the queue.
    +     * 
    + * + * string close_op_name = 3; + * @param value The closeOpName to set. + * @return This builder for chaining. + */ + public Builder setCloseOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + closeOpName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The operation to run to close the queue.
    +     * 
    + * + * string close_op_name = 3; + * @return This builder for chaining. + */ + public Builder clearCloseOpName() { + closeOpName_ = getDefaultInstance().getCloseOpName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * The operation to run to close the queue.
    +     * 
    + * + * string close_op_name = 3; + * @param value The bytes for closeOpName to set. + * @return This builder for chaining. + */ + public Builder setCloseOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + closeOpName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object cancelOpName_ = ""; + /** + *
    +     * The operation to run to cancel the queue.
    +     * 
    + * + * string cancel_op_name = 4; + * @return The cancelOpName. + */ + public java.lang.String getCancelOpName() { + java.lang.Object ref = cancelOpName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cancelOpName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The operation to run to cancel the queue.
    +     * 
    + * + * string cancel_op_name = 4; + * @return The bytes for cancelOpName. + */ + public com.google.protobuf.ByteString + getCancelOpNameBytes() { + java.lang.Object ref = cancelOpName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cancelOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The operation to run to cancel the queue.
    +     * 
    + * + * string cancel_op_name = 4; + * @param value The cancelOpName to set. + * @return This builder for chaining. + */ + public Builder setCancelOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + cancelOpName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The operation to run to cancel the queue.
    +     * 
    + * + * string cancel_op_name = 4; + * @return This builder for chaining. + */ + public Builder clearCancelOpName() { + cancelOpName_ = getDefaultInstance().getCancelOpName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * The operation to run to cancel the queue.
    +     * 
    + * + * string cancel_op_name = 4; + * @param value The bytes for cancelOpName to set. + * @return This builder for chaining. + */ + public Builder setCancelOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + cancelOpName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList queueClosedExceptionTypes_ = + emptyIntList(); + private void ensureQueueClosedExceptionTypesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + queueClosedExceptionTypes_ = makeMutableCopy(queueClosedExceptionTypes_); + bitField0_ |= 0x00000010; + } + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the queueClosedExceptionTypes. + */ + public java.util.List getQueueClosedExceptionTypesList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.error.Code>(queueClosedExceptionTypes_, queueClosedExceptionTypes_converter_); + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return The count of queueClosedExceptionTypes. + */ + public int getQueueClosedExceptionTypesCount() { + return queueClosedExceptionTypes_.size(); + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the element to return. + * @return The queueClosedExceptionTypes at the given index. + */ + public org.tensorflow.proto.error.Code getQueueClosedExceptionTypes(int index) { + return queueClosedExceptionTypes_converter_.convert(queueClosedExceptionTypes_.getInt(index)); + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index to set the value at. + * @param value The queueClosedExceptionTypes to set. + * @return This builder for chaining. + */ + public Builder setQueueClosedExceptionTypes( + int index, org.tensorflow.proto.error.Code value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param value The queueClosedExceptionTypes to add. + * @return This builder for chaining. + */ + public Builder addQueueClosedExceptionTypes(org.tensorflow.proto.error.Code value) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param values The queueClosedExceptionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllQueueClosedExceptionTypes( + java.lang.Iterable values) { + ensureQueueClosedExceptionTypesIsMutable(); + for (org.tensorflow.proto.error.Code value : values) { + queueClosedExceptionTypes_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return This builder for chaining. + */ + public Builder clearQueueClosedExceptionTypes() { + queueClosedExceptionTypes_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the enum numeric values on the wire for queueClosedExceptionTypes. + */ + public java.util.List + getQueueClosedExceptionTypesValueList() { + return java.util.Collections.unmodifiableList(queueClosedExceptionTypes_); + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of queueClosedExceptionTypes at the given index. + */ + public int getQueueClosedExceptionTypesValue(int index) { + return queueClosedExceptionTypes_.getInt(index); + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for queueClosedExceptionTypes to set. + * @return This builder for chaining. + */ + public Builder setQueueClosedExceptionTypesValue( + int index, int value) { + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.setInt(index, value); + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param value The enum numeric value on the wire for queueClosedExceptionTypes to add. + * @return This builder for chaining. + */ + public Builder addQueueClosedExceptionTypesValue(int value) { + ensureQueueClosedExceptionTypesIsMutable(); + queueClosedExceptionTypes_.addInt(value); + onChanged(); + return this; + } + /** + *
    +     * A list of exception types considered to signal a safely closed queue
    +     * if raised during enqueue operations.
    +     * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param values The enum numeric values on the wire for queueClosedExceptionTypes to add. + * @return This builder for chaining. + */ + public Builder addAllQueueClosedExceptionTypesValue( + java.lang.Iterable values) { + ensureQueueClosedExceptionTypesIsMutable(); + for (int value : values) { + queueClosedExceptionTypes_.addInt(value); + } + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.QueueRunnerDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.QueueRunnerDef) + private static final org.tensorflow.proto.QueueRunnerDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.QueueRunnerDef(); + } + + public static org.tensorflow.proto.QueueRunnerDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueueRunnerDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.QueueRunnerDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDefOrBuilder.java new file mode 100644 index 00000000000..c4f232bf15d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerDefOrBuilder.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/queue_runner.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface QueueRunnerDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.QueueRunnerDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Queue name.
    +   * 
    + * + * string queue_name = 1; + * @return The queueName. + */ + java.lang.String getQueueName(); + /** + *
    +   * Queue name.
    +   * 
    + * + * string queue_name = 1; + * @return The bytes for queueName. + */ + com.google.protobuf.ByteString + getQueueNameBytes(); + + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @return A list containing the enqueueOpName. + */ + java.util.List + getEnqueueOpNameList(); + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @return The count of enqueueOpName. + */ + int getEnqueueOpNameCount(); + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the element to return. + * @return The enqueueOpName at the given index. + */ + java.lang.String getEnqueueOpName(int index); + /** + *
    +   * A list of enqueue operations.
    +   * 
    + * + * repeated string enqueue_op_name = 2; + * @param index The index of the value to return. + * @return The bytes of the enqueueOpName at the given index. + */ + com.google.protobuf.ByteString + getEnqueueOpNameBytes(int index); + + /** + *
    +   * The operation to run to close the queue.
    +   * 
    + * + * string close_op_name = 3; + * @return The closeOpName. + */ + java.lang.String getCloseOpName(); + /** + *
    +   * The operation to run to close the queue.
    +   * 
    + * + * string close_op_name = 3; + * @return The bytes for closeOpName. + */ + com.google.protobuf.ByteString + getCloseOpNameBytes(); + + /** + *
    +   * The operation to run to cancel the queue.
    +   * 
    + * + * string cancel_op_name = 4; + * @return The cancelOpName. + */ + java.lang.String getCancelOpName(); + /** + *
    +   * The operation to run to cancel the queue.
    +   * 
    + * + * string cancel_op_name = 4; + * @return The bytes for cancelOpName. + */ + com.google.protobuf.ByteString + getCancelOpNameBytes(); + + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the queueClosedExceptionTypes. + */ + java.util.List getQueueClosedExceptionTypesList(); + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return The count of queueClosedExceptionTypes. + */ + int getQueueClosedExceptionTypesCount(); + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the element to return. + * @return The queueClosedExceptionTypes at the given index. + */ + org.tensorflow.proto.error.Code getQueueClosedExceptionTypes(int index); + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @return A list containing the enum numeric values on the wire for queueClosedExceptionTypes. + */ + java.util.List + getQueueClosedExceptionTypesValueList(); + /** + *
    +   * A list of exception types considered to signal a safely closed queue
    +   * if raised during enqueue operations.
    +   * 
    + * + * repeated .tensorflow.error.Code queue_closed_exception_types = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of queueClosedExceptionTypes at the given index. + */ + int getQueueClosedExceptionTypesValue(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerProtos.java new file mode 100644 index 00000000000..23c75114991 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/QueueRunnerProtos.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/queue_runner.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class QueueRunnerProtos { + private QueueRunnerProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + QueueRunnerProtos.class.getName()); + } + 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_QueueRunnerDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_QueueRunnerDef_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/queue_runner." + + "proto\022\ntensorflow\032*tensorflow/core/proto" + + "buf/error_codes.proto\"\252\001\n\016QueueRunnerDef" + + "\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\205\001\n\024o" + + "rg.tensorflow.protoB\021QueueRunnerProtosP\001" + + "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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.error.dummy.ErrorCodes.getDescriptor(), + }); + internal_static_tensorflow_QueueRunnerDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_QueueRunnerDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_QueueRunnerDef_descriptor, + new java.lang.String[] { "QueueName", "EnqueueOpName", "CloseOpName", "CancelOpName", "QueueClosedExceptionTypes", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.error.dummy.ErrorCodes.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseProtos.java new file mode 100644 index 00000000000..07c85d130a3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseProtos.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/reader_base.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ReaderBaseProtos { + private ReaderBaseProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ReaderBaseProtos.class.getName()); + } + 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_ReaderBaseState_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ReaderBaseState_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/framework/reader_base." + + "proto\022\ntensorflow\"r\n\017ReaderBaseState\022\024\n\014" + + "work_started\030\001 \001(\003\022\025\n\rwork_finished\030\002 \001(" + + "\003\022\034\n\024num_records_produced\030\003 \001(\003\022\024\n\014curre" + + "nt_work\030\004 \001(\014B\201\001\n\024org.tensorflow.protoB\020" + + "ReaderBaseProtosP\001ZRgithub.com/tensorflo" + + "w/tensorflow/tensorflow/go/core/framewor" + + "k/reader_base_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_ReaderBaseState_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_ReaderBaseState_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ReaderBaseState_descriptor, + new java.lang.String[] { "WorkStarted", "WorkFinished", "NumRecordsProduced", "CurrentWork", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseState.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseState.java new file mode 100644 index 00000000000..4e619b9297c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseState.java @@ -0,0 +1,643 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/reader_base.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * For serializing and restoring the state of ReaderBase, see
    + * reader_base.h for details.
    + * 
    + * + * Protobuf type {@code tensorflow.ReaderBaseState} + */ +public final class ReaderBaseState extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ReaderBaseState) + ReaderBaseStateOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ReaderBaseState.class.getName()); + } + // Use ReaderBaseState.newBuilder() to construct. + private ReaderBaseState(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ReaderBaseState() { + currentWork_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ReaderBaseState.class, org.tensorflow.proto.ReaderBaseState.Builder.class); + } + + public static final int WORK_STARTED_FIELD_NUMBER = 1; + private long workStarted_ = 0L; + /** + * int64 work_started = 1; + * @return The workStarted. + */ + @java.lang.Override + public long getWorkStarted() { + return workStarted_; + } + + public static final int WORK_FINISHED_FIELD_NUMBER = 2; + private long workFinished_ = 0L; + /** + * int64 work_finished = 2; + * @return The workFinished. + */ + @java.lang.Override + public long getWorkFinished() { + return workFinished_; + } + + public static final int NUM_RECORDS_PRODUCED_FIELD_NUMBER = 3; + private long numRecordsProduced_ = 0L; + /** + * int64 num_records_produced = 3; + * @return The numRecordsProduced. + */ + @java.lang.Override + public long getNumRecordsProduced() { + return numRecordsProduced_; + } + + public static final int CURRENT_WORK_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString currentWork_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes current_work = 4; + * @return The currentWork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrentWork() { + return currentWork_; + } + + 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 (workStarted_ != 0L) { + output.writeInt64(1, workStarted_); + } + if (workFinished_ != 0L) { + output.writeInt64(2, workFinished_); + } + if (numRecordsProduced_ != 0L) { + output.writeInt64(3, numRecordsProduced_); + } + if (!currentWork_.isEmpty()) { + output.writeBytes(4, currentWork_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workStarted_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, workStarted_); + } + if (workFinished_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, workFinished_); + } + if (numRecordsProduced_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, numRecordsProduced_); + } + if (!currentWork_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, currentWork_); + } + size += getUnknownFields().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.ReaderBaseState)) { + return super.equals(obj); + } + org.tensorflow.proto.ReaderBaseState other = (org.tensorflow.proto.ReaderBaseState) obj; + + if (getWorkStarted() + != other.getWorkStarted()) return false; + if (getWorkFinished() + != other.getWorkFinished()) return false; + if (getNumRecordsProduced() + != other.getNumRecordsProduced()) return false; + if (!getCurrentWork() + .equals(other.getCurrentWork())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WORK_STARTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWorkStarted()); + hash = (37 * hash) + WORK_FINISHED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWorkFinished()); + hash = (37 * hash) + NUM_RECORDS_PRODUCED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumRecordsProduced()); + hash = (37 * hash) + CURRENT_WORK_FIELD_NUMBER; + hash = (53 * hash) + getCurrentWork().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ReaderBaseState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ReaderBaseState 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.ReaderBaseState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ReaderBaseState 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.ReaderBaseState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ReaderBaseState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ReaderBaseState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ReaderBaseState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ReaderBaseState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ReaderBaseState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ReaderBaseState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ReaderBaseState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ReaderBaseState 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * For serializing and restoring the state of ReaderBase, see
    +   * reader_base.h for details.
    +   * 
    + * + * Protobuf type {@code tensorflow.ReaderBaseState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ReaderBaseState) + org.tensorflow.proto.ReaderBaseStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ReaderBaseState.class, org.tensorflow.proto.ReaderBaseState.Builder.class); + } + + // Construct using org.tensorflow.proto.ReaderBaseState.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + workStarted_ = 0L; + workFinished_ = 0L; + numRecordsProduced_ = 0L; + currentWork_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ReaderBaseProtos.internal_static_tensorflow_ReaderBaseState_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ReaderBaseState getDefaultInstanceForType() { + return org.tensorflow.proto.ReaderBaseState.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ReaderBaseState build() { + org.tensorflow.proto.ReaderBaseState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ReaderBaseState buildPartial() { + org.tensorflow.proto.ReaderBaseState result = new org.tensorflow.proto.ReaderBaseState(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ReaderBaseState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.workStarted_ = workStarted_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.workFinished_ = workFinished_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.numRecordsProduced_ = numRecordsProduced_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.currentWork_ = currentWork_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ReaderBaseState) { + return mergeFrom((org.tensorflow.proto.ReaderBaseState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ReaderBaseState other) { + if (other == org.tensorflow.proto.ReaderBaseState.getDefaultInstance()) return this; + if (other.getWorkStarted() != 0L) { + setWorkStarted(other.getWorkStarted()); + } + if (other.getWorkFinished() != 0L) { + setWorkFinished(other.getWorkFinished()); + } + if (other.getNumRecordsProduced() != 0L) { + setNumRecordsProduced(other.getNumRecordsProduced()); + } + if (other.getCurrentWork() != com.google.protobuf.ByteString.EMPTY) { + setCurrentWork(other.getCurrentWork()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + workStarted_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + workFinished_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + numRecordsProduced_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + currentWork_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long workStarted_ ; + /** + * int64 work_started = 1; + * @return The workStarted. + */ + @java.lang.Override + public long getWorkStarted() { + return workStarted_; + } + /** + * int64 work_started = 1; + * @param value The workStarted to set. + * @return This builder for chaining. + */ + public Builder setWorkStarted(long value) { + + workStarted_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 work_started = 1; + * @return This builder for chaining. + */ + public Builder clearWorkStarted() { + bitField0_ = (bitField0_ & ~0x00000001); + workStarted_ = 0L; + onChanged(); + return this; + } + + private long workFinished_ ; + /** + * int64 work_finished = 2; + * @return The workFinished. + */ + @java.lang.Override + public long getWorkFinished() { + return workFinished_; + } + /** + * int64 work_finished = 2; + * @param value The workFinished to set. + * @return This builder for chaining. + */ + public Builder setWorkFinished(long value) { + + workFinished_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 work_finished = 2; + * @return This builder for chaining. + */ + public Builder clearWorkFinished() { + bitField0_ = (bitField0_ & ~0x00000002); + workFinished_ = 0L; + onChanged(); + return this; + } + + private long numRecordsProduced_ ; + /** + * int64 num_records_produced = 3; + * @return The numRecordsProduced. + */ + @java.lang.Override + public long getNumRecordsProduced() { + return numRecordsProduced_; + } + /** + * int64 num_records_produced = 3; + * @param value The numRecordsProduced to set. + * @return This builder for chaining. + */ + public Builder setNumRecordsProduced(long value) { + + numRecordsProduced_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 num_records_produced = 3; + * @return This builder for chaining. + */ + public Builder clearNumRecordsProduced() { + bitField0_ = (bitField0_ & ~0x00000004); + numRecordsProduced_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString currentWork_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes current_work = 4; + * @return The currentWork. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrentWork() { + return currentWork_; + } + /** + * bytes current_work = 4; + * @param value The currentWork to set. + * @return This builder for chaining. + */ + public Builder setCurrentWork(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + currentWork_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * bytes current_work = 4; + * @return This builder for chaining. + */ + public Builder clearCurrentWork() { + bitField0_ = (bitField0_ & ~0x00000008); + currentWork_ = getDefaultInstance().getCurrentWork(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ReaderBaseState) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ReaderBaseState) + private static final org.tensorflow.proto.ReaderBaseState DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ReaderBaseState(); + } + + public static org.tensorflow.proto.ReaderBaseState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReaderBaseState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ReaderBaseState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseStateOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseStateOrBuilder.java new file mode 100644 index 00000000000..e6b3261fb44 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ReaderBaseStateOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/reader_base.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ReaderBaseStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ReaderBaseState) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 work_started = 1; + * @return The workStarted. + */ + long getWorkStarted(); + + /** + * int64 work_finished = 2; + * @return The workFinished. + */ + long getWorkFinished(); + + /** + * int64 num_records_produced = 3; + * @return The numRecordsProduced. + */ + long getNumRecordsProduced(); + + /** + * bytes current_work = 4; + * @return The currentWork. + */ + com.google.protobuf.ByteString getCurrentWork(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradient.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradient.java new file mode 100644 index 00000000000..9131e5c26b6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradient.java @@ -0,0 +1,707 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * RegisteredGradient stores a gradient function that is registered in the
    + * gradients library and used in the ops of a function in the function library.
    + * Unlike GradientDef, these gradients are identified by op type, and not
    + * directly linked to any function.
    + * 
    + * + * Protobuf type {@code tensorflow.RegisteredGradient} + */ +public final class RegisteredGradient extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RegisteredGradient) + RegisteredGradientOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RegisteredGradient.class.getName()); + } + // Use RegisteredGradient.newBuilder() to construct. + private RegisteredGradient(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RegisteredGradient() { + gradientFunc_ = ""; + registeredOpType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_RegisteredGradient_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RegisteredGradient.class, org.tensorflow.proto.RegisteredGradient.Builder.class); + } + + public static final int GRADIENT_FUNC_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object gradientFunc_ = ""; + /** + *
    +   * The gradient function's name.
    +   * 
    + * + * string gradient_func = 1; + * @return The gradientFunc. + */ + @java.lang.Override + public java.lang.String getGradientFunc() { + java.lang.Object ref = gradientFunc_; + 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(); + gradientFunc_ = s; + return s; + } + } + /** + *
    +   * The gradient function's name.
    +   * 
    + * + * string gradient_func = 1; + * @return The bytes for gradientFunc. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGradientFuncBytes() { + java.lang.Object ref = gradientFunc_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradientFunc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGISTERED_OP_TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object registeredOpType_ = ""; + /** + *
    +   * The gradient function's registered op type.
    +   * 
    + * + * string registered_op_type = 2; + * @return The registeredOpType. + */ + @java.lang.Override + public java.lang.String getRegisteredOpType() { + java.lang.Object ref = registeredOpType_; + 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(); + registeredOpType_ = s; + return s; + } + } + /** + *
    +   * The gradient function's registered op type.
    +   * 
    + * + * string registered_op_type = 2; + * @return The bytes for registeredOpType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRegisteredOpTypeBytes() { + java.lang.Object ref = registeredOpType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredOpType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(gradientFunc_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, gradientFunc_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredOpType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, registeredOpType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(gradientFunc_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, gradientFunc_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredOpType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, registeredOpType_); + } + size += getUnknownFields().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.RegisteredGradient)) { + return super.equals(obj); + } + org.tensorflow.proto.RegisteredGradient other = (org.tensorflow.proto.RegisteredGradient) obj; + + if (!getGradientFunc() + .equals(other.getGradientFunc())) return false; + if (!getRegisteredOpType() + .equals(other.getRegisteredOpType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GRADIENT_FUNC_FIELD_NUMBER; + hash = (53 * hash) + getGradientFunc().hashCode(); + hash = (37 * hash) + REGISTERED_OP_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getRegisteredOpType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RegisteredGradient parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RegisteredGradient 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.RegisteredGradient parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RegisteredGradient 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.RegisteredGradient parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RegisteredGradient parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RegisteredGradient parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RegisteredGradient parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RegisteredGradient parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RegisteredGradient parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RegisteredGradient parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RegisteredGradient parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RegisteredGradient 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * RegisteredGradient stores a gradient function that is registered in the
    +   * gradients library and used in the ops of a function in the function library.
    +   * Unlike GradientDef, these gradients are identified by op type, and not
    +   * directly linked to any function.
    +   * 
    + * + * Protobuf type {@code tensorflow.RegisteredGradient} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RegisteredGradient) + org.tensorflow.proto.RegisteredGradientOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_RegisteredGradient_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RegisteredGradient.class, org.tensorflow.proto.RegisteredGradient.Builder.class); + } + + // Construct using org.tensorflow.proto.RegisteredGradient.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gradientFunc_ = ""; + registeredOpType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.FunctionProtos.internal_static_tensorflow_RegisteredGradient_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RegisteredGradient getDefaultInstanceForType() { + return org.tensorflow.proto.RegisteredGradient.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RegisteredGradient build() { + org.tensorflow.proto.RegisteredGradient result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RegisteredGradient buildPartial() { + org.tensorflow.proto.RegisteredGradient result = new org.tensorflow.proto.RegisteredGradient(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RegisteredGradient result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gradientFunc_ = gradientFunc_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.registeredOpType_ = registeredOpType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RegisteredGradient) { + return mergeFrom((org.tensorflow.proto.RegisteredGradient)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RegisteredGradient other) { + if (other == org.tensorflow.proto.RegisteredGradient.getDefaultInstance()) return this; + if (!other.getGradientFunc().isEmpty()) { + gradientFunc_ = other.gradientFunc_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRegisteredOpType().isEmpty()) { + registeredOpType_ = other.registeredOpType_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + gradientFunc_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + registeredOpType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object gradientFunc_ = ""; + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 1; + * @return The gradientFunc. + */ + public java.lang.String getGradientFunc() { + java.lang.Object ref = gradientFunc_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gradientFunc_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 1; + * @return The bytes for gradientFunc. + */ + public com.google.protobuf.ByteString + getGradientFuncBytes() { + java.lang.Object ref = gradientFunc_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gradientFunc_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 1; + * @param value The gradientFunc to set. + * @return This builder for chaining. + */ + public Builder setGradientFunc( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + gradientFunc_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 1; + * @return This builder for chaining. + */ + public Builder clearGradientFunc() { + gradientFunc_ = getDefaultInstance().getGradientFunc(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The gradient function's name.
    +     * 
    + * + * string gradient_func = 1; + * @param value The bytes for gradientFunc to set. + * @return This builder for chaining. + */ + public Builder setGradientFuncBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + gradientFunc_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object registeredOpType_ = ""; + /** + *
    +     * The gradient function's registered op type.
    +     * 
    + * + * string registered_op_type = 2; + * @return The registeredOpType. + */ + public java.lang.String getRegisteredOpType() { + java.lang.Object ref = registeredOpType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + registeredOpType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The gradient function's registered op type.
    +     * 
    + * + * string registered_op_type = 2; + * @return The bytes for registeredOpType. + */ + public com.google.protobuf.ByteString + getRegisteredOpTypeBytes() { + java.lang.Object ref = registeredOpType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredOpType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The gradient function's registered op type.
    +     * 
    + * + * string registered_op_type = 2; + * @param value The registeredOpType to set. + * @return This builder for chaining. + */ + public Builder setRegisteredOpType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + registeredOpType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The gradient function's registered op type.
    +     * 
    + * + * string registered_op_type = 2; + * @return This builder for chaining. + */ + public Builder clearRegisteredOpType() { + registeredOpType_ = getDefaultInstance().getRegisteredOpType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The gradient function's registered op type.
    +     * 
    + * + * string registered_op_type = 2; + * @param value The bytes for registeredOpType to set. + * @return This builder for chaining. + */ + public Builder setRegisteredOpTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + registeredOpType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RegisteredGradient) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RegisteredGradient) + private static final org.tensorflow.proto.RegisteredGradient DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RegisteredGradient(); + } + + public static org.tensorflow.proto.RegisteredGradient getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RegisteredGradient parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RegisteredGradient getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradientOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradientOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradientOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradientOrBuilder.java index d4b1a75ffe0..4ea34c7f055 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RegisteredGradientOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RegisteredGradientOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/function.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface RegisteredGradientOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.RegisteredGradient) @@ -13,6 +15,7 @@ public interface RegisteredGradientOrBuilder extends * * * string gradient_func = 1; + * @return The gradientFunc. */ java.lang.String getGradientFunc(); /** @@ -21,6 +24,7 @@ public interface RegisteredGradientOrBuilder extends * * * string gradient_func = 1; + * @return The bytes for gradientFunc. */ com.google.protobuf.ByteString getGradientFuncBytes(); @@ -31,6 +35,7 @@ public interface RegisteredGradientOrBuilder extends * * * string registered_op_type = 2; + * @return The registeredOpType. */ java.lang.String getRegisteredOpType(); /** @@ -39,6 +44,7 @@ public interface RegisteredGradientOrBuilder extends * * * string registered_op_type = 2; + * @return The bytes for registeredOpType. */ com.google.protobuf.ByteString getRegisteredOpTypeBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCode.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCode.java new file mode 100644 index 00000000000..f092bc9bf5a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCode.java @@ -0,0 +1,431 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.RequestedExitCode} + */ +public final class RequestedExitCode extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RequestedExitCode) + RequestedExitCodeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RequestedExitCode.class.getName()); + } + // Use RequestedExitCode.newBuilder() to construct. + private RequestedExitCode(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequestedExitCode() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_RequestedExitCode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RequestedExitCode.class, org.tensorflow.proto.RequestedExitCode.Builder.class); + } + + public static final int EXIT_CODE_FIELD_NUMBER = 1; + private int exitCode_ = 0; + /** + * int32 exit_code = 1; + * @return The exitCode. + */ + @java.lang.Override + public int getExitCode() { + return exitCode_; + } + + 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 (exitCode_ != 0) { + output.writeInt32(1, exitCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (exitCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, exitCode_); + } + size += getUnknownFields().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.RequestedExitCode)) { + return super.equals(obj); + } + org.tensorflow.proto.RequestedExitCode other = (org.tensorflow.proto.RequestedExitCode) obj; + + if (getExitCode() + != other.getExitCode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + EXIT_CODE_FIELD_NUMBER; + hash = (53 * hash) + getExitCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RequestedExitCode parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RequestedExitCode 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.RequestedExitCode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RequestedExitCode 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.RequestedExitCode parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RequestedExitCode parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RequestedExitCode parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RequestedExitCode parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RequestedExitCode parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RequestedExitCode parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RequestedExitCode parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RequestedExitCode parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequestedExitCode 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.RequestedExitCode} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RequestedExitCode) + org.tensorflow.proto.RequestedExitCodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_RequestedExitCode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RequestedExitCode.class, org.tensorflow.proto.RequestedExitCode.Builder.class); + } + + // Construct using org.tensorflow.proto.RequestedExitCode.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + exitCode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_RequestedExitCode_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RequestedExitCode getDefaultInstanceForType() { + return org.tensorflow.proto.RequestedExitCode.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RequestedExitCode build() { + org.tensorflow.proto.RequestedExitCode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RequestedExitCode buildPartial() { + org.tensorflow.proto.RequestedExitCode result = new org.tensorflow.proto.RequestedExitCode(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RequestedExitCode result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.exitCode_ = exitCode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RequestedExitCode) { + return mergeFrom((org.tensorflow.proto.RequestedExitCode)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RequestedExitCode other) { + if (other == org.tensorflow.proto.RequestedExitCode.getDefaultInstance()) return this; + if (other.getExitCode() != 0) { + setExitCode(other.getExitCode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + exitCode_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int exitCode_ ; + /** + * int32 exit_code = 1; + * @return The exitCode. + */ + @java.lang.Override + public int getExitCode() { + return exitCode_; + } + /** + * int32 exit_code = 1; + * @param value The exitCode to set. + * @return This builder for chaining. + */ + public Builder setExitCode(int value) { + + exitCode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 exit_code = 1; + * @return This builder for chaining. + */ + public Builder clearExitCode() { + bitField0_ = (bitField0_ & ~0x00000001); + exitCode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RequestedExitCode) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RequestedExitCode) + private static final org.tensorflow.proto.RequestedExitCode DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RequestedExitCode(); + } + + public static org.tensorflow.proto.RequestedExitCode getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestedExitCode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RequestedExitCode getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCodeOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCodeOrBuilder.java new file mode 100644 index 00000000000..787bd99ff65 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RequestedExitCodeOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface RequestedExitCodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RequestedExitCode) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 exit_code = 1; + * @return The exitCode. + */ + int getExitCode(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandle.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandle.java new file mode 100644 index 00000000000..e9469d731c9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandle.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/resource_handle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class ResourceHandle { + private ResourceHandle() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ResourceHandle.class.getName()); + } + 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_ResourceHandleProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_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/framework/resource_han" + + "dle.proto\022\ntensorflow\032,tensorflow/core/f" + + "ramework/tensor_shape.proto\032%tensorflow/" + + "core/framework/types.proto\"\245\002\n\023ResourceH" + + "andleProto\022\016\n\006device\030\001 \001(\t\022\021\n\tcontainer\030" + + "\002 \001(\t\022\014\n\004name\030\003 \001(\t\022\021\n\thash_code\030\004 \001(\004\022\027" + + "\n\017maybe_type_name\030\005 \001(\t\022H\n\021dtypes_and_sh" + + "apes\030\006 \003(\0132-.tensorflow.ResourceHandlePr" + + "oto.DtypeAndShape\032a\n\rDtypeAndShape\022#\n\005dt" + + "ype\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005shape" + + "\030\002 \001(\0132\034.tensorflow.TensorShapeProtoJ\004\010\007" + + "\020\010B\203\001\n\024org.tensorflow.protoB\016ResourceHan" + + "dleP\001ZVgithub.com/tensorflow/tensorflow/" + + "tensorflow/go/core/framework/resource_ha" + + "ndle_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_ResourceHandleProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ResourceHandleProto_descriptor, + new java.lang.String[] { "Device", "Container", "Name", "HashCode", "MaybeTypeName", "DtypesAndShapes", }); + internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor = + internal_static_tensorflow_ResourceHandleProto_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor, + new java.lang.String[] { "Dtype", "Shape", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProto.java new file mode 100644 index 00000000000..db1b56da824 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProto.java @@ -0,0 +1,2352 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/resource_handle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing a handle to a tensorflow resource. Handles are
    + * not valid across executions, but can be serialized back and forth from within
    + * a single run.
    + * 
    + * + * Protobuf type {@code tensorflow.ResourceHandleProto} + */ +public final class ResourceHandleProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto) + ResourceHandleProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ResourceHandleProto.class.getName()); + } + // Use ResourceHandleProto.newBuilder() to construct. + private ResourceHandleProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ResourceHandleProto() { + device_ = ""; + container_ = ""; + name_ = ""; + maybeTypeName_ = ""; + dtypesAndShapes_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ResourceHandleProto.class, org.tensorflow.proto.ResourceHandleProto.Builder.class); + } + + public interface DtypeAndShapeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto.DtypeAndShape) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + } + /** + *
    +   * Protocol buffer representing a pair of (data type, tensor shape).
    +   * 
    + * + * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} + */ + public static final class DtypeAndShape extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ResourceHandleProto.DtypeAndShape) + DtypeAndShapeOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DtypeAndShape.class.getName()); + } + // Use DtypeAndShape.newBuilder() to construct. + private DtypeAndShape(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DtypeAndShape() { + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.class, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + 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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + size += getUnknownFields().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.ResourceHandleProto.DtypeAndShape)) { + return super.equals(obj); + } + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape other = (org.tensorflow.proto.ResourceHandleProto.DtypeAndShape) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape 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.ResourceHandleProto.DtypeAndShape parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ResourceHandleProto.DtypeAndShape 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Protocol buffer representing a pair of (data type, tensor shape).
    +     * 
    + * + * Protobuf type {@code tensorflow.ResourceHandleProto.DtypeAndShape} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto.DtypeAndShape) + org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.class, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder.class); + } + + // Construct using org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_DtypeAndShape_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getDefaultInstanceForType() { + return org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape build() { + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape buildPartial() { + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape result = new org.tensorflow.proto.ResourceHandleProto.DtypeAndShape(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ResourceHandleProto.DtypeAndShape result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ResourceHandleProto.DtypeAndShape) { + return mergeFrom((org.tensorflow.proto.ResourceHandleProto.DtypeAndShape)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ResourceHandleProto.DtypeAndShape other) { + if (other == org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + *
    +       * Data type of the tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +       * Data type of the tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Data type of the tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +       * Data type of the tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Data type of the tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + *
    +       * Shape of the tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ResourceHandleProto.DtypeAndShape) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto.DtypeAndShape) + private static final org.tensorflow.proto.ResourceHandleProto.DtypeAndShape DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ResourceHandleProto.DtypeAndShape(); + } + + public static org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DtypeAndShape parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ResourceHandleProto.DtypeAndShape getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int DEVICE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + *
    +   * Unique name for the device containing the resource.
    +   * 
    + * + * string device = 1; + * @return The device. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Unique name for the device containing the resource.
    +   * 
    + * + * string device = 1; + * @return The bytes for device. + */ + @java.lang.Override + 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 CONTAINER_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object container_ = ""; + /** + *
    +   * Container in which this resource is placed.
    +   * 
    + * + * string container = 2; + * @return The container. + */ + @java.lang.Override + public java.lang.String getContainer() { + java.lang.Object ref = container_; + 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(); + container_ = s; + return s; + } + } + /** + *
    +   * Container in which this resource is placed.
    +   * 
    + * + * string container = 2; + * @return The bytes for container. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContainerBytes() { + java.lang.Object ref = container_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + container_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Unique name of this resource.
    +   * 
    + * + * string name = 3; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Unique name of this resource.
    +   * 
    + * + * string name = 3; + * @return The bytes for name. + */ + @java.lang.Override + 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 HASH_CODE_FIELD_NUMBER = 4; + private long hashCode_ = 0L; + /** + *
    +   * Hash code for the type of the resource. Is only valid in the same device
    +   * and in the same execution.
    +   * 
    + * + * uint64 hash_code = 4; + * @return The hashCode. + */ + @java.lang.Override + public long getHashCode() { + return hashCode_; + } + + public static final int MAYBE_TYPE_NAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object maybeTypeName_ = ""; + /** + *
    +   * For debug-only, the name of the type pointed to by this handle, if
    +   * available.
    +   * 
    + * + * string maybe_type_name = 5; + * @return The maybeTypeName. + */ + @java.lang.Override + public java.lang.String getMaybeTypeName() { + java.lang.Object ref = maybeTypeName_; + 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(); + maybeTypeName_ = s; + return s; + } + } + /** + *
    +   * For debug-only, the name of the type pointed to by this handle, if
    +   * available.
    +   * 
    + * + * string maybe_type_name = 5; + * @return The bytes for maybeTypeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMaybeTypeNameBytes() { + java.lang.Object ref = maybeTypeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maybeTypeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DTYPES_AND_SHAPES_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List dtypesAndShapes_; + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + @java.lang.Override + public java.util.List getDtypesAndShapesList() { + return dtypesAndShapes_; + } + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + @java.lang.Override + public java.util.List + getDtypesAndShapesOrBuilderList() { + return dtypesAndShapes_; + } + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + @java.lang.Override + public int getDtypesAndShapesCount() { + return dtypesAndShapes_.size(); + } + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index) { + return dtypesAndShapes_.get(index); + } + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( + int index) { + return dtypesAndShapes_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, device_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(container_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, container_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (hashCode_ != 0L) { + output.writeUInt64(4, hashCode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maybeTypeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, maybeTypeName_); + } + for (int i = 0; i < dtypesAndShapes_.size(); i++) { + output.writeMessage(6, dtypesAndShapes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, device_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(container_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, container_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (hashCode_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(4, hashCode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maybeTypeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, maybeTypeName_); + } + for (int i = 0; i < dtypesAndShapes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, dtypesAndShapes_.get(i)); + } + size += getUnknownFields().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.ResourceHandleProto)) { + return super.equals(obj); + } + org.tensorflow.proto.ResourceHandleProto other = (org.tensorflow.proto.ResourceHandleProto) obj; + + if (!getDevice() + .equals(other.getDevice())) return false; + if (!getContainer() + .equals(other.getContainer())) return false; + if (!getName() + .equals(other.getName())) return false; + if (getHashCode() + != other.getHashCode()) return false; + if (!getMaybeTypeName() + .equals(other.getMaybeTypeName())) return false; + if (!getDtypesAndShapesList() + .equals(other.getDtypesAndShapesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + hash = (37 * hash) + CONTAINER_FIELD_NUMBER; + hash = (53 * hash) + getContainer().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + HASH_CODE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getHashCode()); + hash = (37 * hash) + MAYBE_TYPE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaybeTypeName().hashCode(); + if (getDtypesAndShapesCount() > 0) { + hash = (37 * hash) + DTYPES_AND_SHAPES_FIELD_NUMBER; + hash = (53 * hash) + getDtypesAndShapesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ResourceHandleProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto 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.ResourceHandleProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto 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.ResourceHandleProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ResourceHandleProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ResourceHandleProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ResourceHandleProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ResourceHandleProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ResourceHandleProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ResourceHandleProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ResourceHandleProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ResourceHandleProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a handle to a tensorflow resource. Handles are
    +   * not valid across executions, but can be serialized back and forth from within
    +   * a single run.
    +   * 
    + * + * Protobuf type {@code tensorflow.ResourceHandleProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ResourceHandleProto) + org.tensorflow.proto.ResourceHandleProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ResourceHandleProto.class, org.tensorflow.proto.ResourceHandleProto.Builder.class); + } + + // Construct using org.tensorflow.proto.ResourceHandleProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + device_ = ""; + container_ = ""; + name_ = ""; + hashCode_ = 0L; + maybeTypeName_ = ""; + if (dtypesAndShapesBuilder_ == null) { + dtypesAndShapes_ = java.util.Collections.emptyList(); + } else { + dtypesAndShapes_ = null; + dtypesAndShapesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ResourceHandle.internal_static_tensorflow_ResourceHandleProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto getDefaultInstanceForType() { + return org.tensorflow.proto.ResourceHandleProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto build() { + org.tensorflow.proto.ResourceHandleProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto buildPartial() { + org.tensorflow.proto.ResourceHandleProto result = new org.tensorflow.proto.ResourceHandleProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.ResourceHandleProto result) { + if (dtypesAndShapesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + dtypesAndShapes_ = java.util.Collections.unmodifiableList(dtypesAndShapes_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.dtypesAndShapes_ = dtypesAndShapes_; + } else { + result.dtypesAndShapes_ = dtypesAndShapesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.ResourceHandleProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.device_ = device_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.container_ = container_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.hashCode_ = hashCode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.maybeTypeName_ = maybeTypeName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ResourceHandleProto) { + return mergeFrom((org.tensorflow.proto.ResourceHandleProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ResourceHandleProto other) { + if (other == org.tensorflow.proto.ResourceHandleProto.getDefaultInstance()) return this; + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContainer().isEmpty()) { + container_ = other.container_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getHashCode() != 0L) { + setHashCode(other.getHashCode()); + } + if (!other.getMaybeTypeName().isEmpty()) { + maybeTypeName_ = other.maybeTypeName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (dtypesAndShapesBuilder_ == null) { + if (!other.dtypesAndShapes_.isEmpty()) { + if (dtypesAndShapes_.isEmpty()) { + dtypesAndShapes_ = other.dtypesAndShapes_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.addAll(other.dtypesAndShapes_); + } + onChanged(); + } + } else { + if (!other.dtypesAndShapes_.isEmpty()) { + if (dtypesAndShapesBuilder_.isEmpty()) { + dtypesAndShapesBuilder_.dispose(); + dtypesAndShapesBuilder_ = null; + dtypesAndShapes_ = other.dtypesAndShapes_; + bitField0_ = (bitField0_ & ~0x00000020); + dtypesAndShapesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDtypesAndShapesFieldBuilder() : null; + } else { + dtypesAndShapesBuilder_.addAllMessages(other.dtypesAndShapes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + container_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + hashCode_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + maybeTypeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape m = + input.readMessage( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.parser(), + extensionRegistry); + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.add(m); + } else { + dtypesAndShapesBuilder_.addMessage(m); + } + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object device_ = ""; + /** + *
    +     * Unique name for the device containing the resource.
    +     * 
    + * + * string device = 1; + * @return The device. + */ + 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; + } + } + /** + *
    +     * Unique name for the device containing the resource.
    +     * 
    + * + * string device = 1; + * @return The bytes for device. + */ + 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; + } + } + /** + *
    +     * Unique name for the device containing the resource.
    +     * 
    + * + * string device = 1; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Unique name for the device containing the resource.
    +     * 
    + * + * string device = 1; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Unique name for the device containing the resource.
    +     * 
    + * + * string device = 1; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object container_ = ""; + /** + *
    +     * Container in which this resource is placed.
    +     * 
    + * + * string container = 2; + * @return The container. + */ + public java.lang.String getContainer() { + java.lang.Object ref = container_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + container_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Container in which this resource is placed.
    +     * 
    + * + * string container = 2; + * @return The bytes for container. + */ + public com.google.protobuf.ByteString + getContainerBytes() { + java.lang.Object ref = container_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + container_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Container in which this resource is placed.
    +     * 
    + * + * string container = 2; + * @param value The container to set. + * @return This builder for chaining. + */ + public Builder setContainer( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + container_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Container in which this resource is placed.
    +     * 
    + * + * string container = 2; + * @return This builder for chaining. + */ + public Builder clearContainer() { + container_ = getDefaultInstance().getContainer(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Container in which this resource is placed.
    +     * 
    + * + * string container = 2; + * @param value The bytes for container to set. + * @return This builder for chaining. + */ + public Builder setContainerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + container_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +     * Unique name of this resource.
    +     * 
    + * + * string name = 3; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Unique name of this resource.
    +     * 
    + * + * string name = 3; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Unique name of this resource.
    +     * 
    + * + * string name = 3; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Unique name of this resource.
    +     * 
    + * + * string name = 3; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Unique name of this resource.
    +     * 
    + * + * string name = 3; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long hashCode_ ; + /** + *
    +     * Hash code for the type of the resource. Is only valid in the same device
    +     * and in the same execution.
    +     * 
    + * + * uint64 hash_code = 4; + * @return The hashCode. + */ + @java.lang.Override + public long getHashCode() { + return hashCode_; + } + /** + *
    +     * Hash code for the type of the resource. Is only valid in the same device
    +     * and in the same execution.
    +     * 
    + * + * uint64 hash_code = 4; + * @param value The hashCode to set. + * @return This builder for chaining. + */ + public Builder setHashCode(long value) { + + hashCode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Hash code for the type of the resource. Is only valid in the same device
    +     * and in the same execution.
    +     * 
    + * + * uint64 hash_code = 4; + * @return This builder for chaining. + */ + public Builder clearHashCode() { + bitField0_ = (bitField0_ & ~0x00000008); + hashCode_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object maybeTypeName_ = ""; + /** + *
    +     * For debug-only, the name of the type pointed to by this handle, if
    +     * available.
    +     * 
    + * + * string maybe_type_name = 5; + * @return The maybeTypeName. + */ + public java.lang.String getMaybeTypeName() { + java.lang.Object ref = maybeTypeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maybeTypeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * For debug-only, the name of the type pointed to by this handle, if
    +     * available.
    +     * 
    + * + * string maybe_type_name = 5; + * @return The bytes for maybeTypeName. + */ + public com.google.protobuf.ByteString + getMaybeTypeNameBytes() { + java.lang.Object ref = maybeTypeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maybeTypeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * For debug-only, the name of the type pointed to by this handle, if
    +     * available.
    +     * 
    + * + * string maybe_type_name = 5; + * @param value The maybeTypeName to set. + * @return This builder for chaining. + */ + public Builder setMaybeTypeName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + maybeTypeName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * For debug-only, the name of the type pointed to by this handle, if
    +     * available.
    +     * 
    + * + * string maybe_type_name = 5; + * @return This builder for chaining. + */ + public Builder clearMaybeTypeName() { + maybeTypeName_ = getDefaultInstance().getMaybeTypeName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * For debug-only, the name of the type pointed to by this handle, if
    +     * available.
    +     * 
    + * + * string maybe_type_name = 5; + * @param value The bytes for maybeTypeName to set. + * @return This builder for chaining. + */ + public Builder setMaybeTypeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + maybeTypeName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.util.List dtypesAndShapes_ = + java.util.Collections.emptyList(); + private void ensureDtypesAndShapesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + dtypesAndShapes_ = new java.util.ArrayList(dtypesAndShapes_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder> dtypesAndShapesBuilder_; + + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public java.util.List getDtypesAndShapesList() { + if (dtypesAndShapesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dtypesAndShapes_); + } else { + return dtypesAndShapesBuilder_.getMessageList(); + } + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public int getDtypesAndShapesCount() { + if (dtypesAndShapesBuilder_ == null) { + return dtypesAndShapes_.size(); + } else { + return dtypesAndShapesBuilder_.getCount(); + } + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index) { + if (dtypesAndShapesBuilder_ == null) { + return dtypesAndShapes_.get(index); + } else { + return dtypesAndShapesBuilder_.getMessage(index); + } + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder setDtypesAndShapes( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (dtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.set(index, value); + onChanged(); + } else { + dtypesAndShapesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder setDtypesAndShapes( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.set(index, builderForValue.build()); + onChanged(); + } else { + dtypesAndShapesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder addDtypesAndShapes(org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (dtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.add(value); + onChanged(); + } else { + dtypesAndShapesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder addDtypesAndShapes( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape value) { + if (dtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.add(index, value); + onChanged(); + } else { + dtypesAndShapesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder addDtypesAndShapes( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.add(builderForValue.build()); + onChanged(); + } else { + dtypesAndShapesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder addDtypesAndShapes( + int index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder builderForValue) { + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.add(index, builderForValue.build()); + onChanged(); + } else { + dtypesAndShapesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder addAllDtypesAndShapes( + java.lang.Iterable values) { + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dtypesAndShapes_); + onChanged(); + } else { + dtypesAndShapesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder clearDtypesAndShapes() { + if (dtypesAndShapesBuilder_ == null) { + dtypesAndShapes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + dtypesAndShapesBuilder_.clear(); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public Builder removeDtypesAndShapes(int index) { + if (dtypesAndShapesBuilder_ == null) { + ensureDtypesAndShapesIsMutable(); + dtypesAndShapes_.remove(index); + onChanged(); + } else { + dtypesAndShapesBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder getDtypesAndShapesBuilder( + int index) { + return getDtypesAndShapesFieldBuilder().getBuilder(index); + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( + int index) { + if (dtypesAndShapesBuilder_ == null) { + return dtypesAndShapes_.get(index); } else { + return dtypesAndShapesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public java.util.List + getDtypesAndShapesOrBuilderList() { + if (dtypesAndShapesBuilder_ != null) { + return dtypesAndShapesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dtypesAndShapes_); + } + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder addDtypesAndShapesBuilder() { + return getDtypesAndShapesFieldBuilder().addBuilder( + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder addDtypesAndShapesBuilder( + int index) { + return getDtypesAndShapesFieldBuilder().addBuilder( + index, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.getDefaultInstance()); + } + /** + *
    +     * Data types and shapes for the underlying resource.
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + public java.util.List + getDtypesAndShapesBuilderList() { + return getDtypesAndShapesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder> + getDtypesAndShapesFieldBuilder() { + if (dtypesAndShapesBuilder_ == null) { + dtypesAndShapesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape, org.tensorflow.proto.ResourceHandleProto.DtypeAndShape.Builder, org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder>( + dtypesAndShapes_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + dtypesAndShapes_ = null; + } + return dtypesAndShapesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ResourceHandleProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto) + private static final org.tensorflow.proto.ResourceHandleProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ResourceHandleProto(); + } + + public static org.tensorflow.proto.ResourceHandleProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceHandleProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ResourceHandleProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProtoOrBuilder.java new file mode 100644 index 00000000000..3add868cb14 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ResourceHandleProtoOrBuilder.java @@ -0,0 +1,148 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/resource_handle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ResourceHandleProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ResourceHandleProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Unique name for the device containing the resource.
    +   * 
    + * + * string device = 1; + * @return The device. + */ + java.lang.String getDevice(); + /** + *
    +   * Unique name for the device containing the resource.
    +   * 
    + * + * string device = 1; + * @return The bytes for device. + */ + com.google.protobuf.ByteString + getDeviceBytes(); + + /** + *
    +   * Container in which this resource is placed.
    +   * 
    + * + * string container = 2; + * @return The container. + */ + java.lang.String getContainer(); + /** + *
    +   * Container in which this resource is placed.
    +   * 
    + * + * string container = 2; + * @return The bytes for container. + */ + com.google.protobuf.ByteString + getContainerBytes(); + + /** + *
    +   * Unique name of this resource.
    +   * 
    + * + * string name = 3; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * Unique name of this resource.
    +   * 
    + * + * string name = 3; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +   * Hash code for the type of the resource. Is only valid in the same device
    +   * and in the same execution.
    +   * 
    + * + * uint64 hash_code = 4; + * @return The hashCode. + */ + long getHashCode(); + + /** + *
    +   * For debug-only, the name of the type pointed to by this handle, if
    +   * available.
    +   * 
    + * + * string maybe_type_name = 5; + * @return The maybeTypeName. + */ + java.lang.String getMaybeTypeName(); + /** + *
    +   * For debug-only, the name of the type pointed to by this handle, if
    +   * available.
    +   * 
    + * + * string maybe_type_name = 5; + * @return The bytes for maybeTypeName. + */ + com.google.protobuf.ByteString + getMaybeTypeNameBytes(); + + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + java.util.List + getDtypesAndShapesList(); + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + org.tensorflow.proto.ResourceHandleProto.DtypeAndShape getDtypesAndShapes(int index); + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + int getDtypesAndShapesCount(); + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + java.util.List + getDtypesAndShapesOrBuilderList(); + /** + *
    +   * Data types and shapes for the underlying resource.
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto.DtypeAndShape dtypes_and_shapes = 6; + */ + org.tensorflow.proto.ResourceHandleProto.DtypeAndShapeOrBuilder getDtypesAndShapesOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfig.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfig.java new file mode 100644 index 00000000000..f5a2645ffb1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfig.java @@ -0,0 +1,7462 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Graph rewriting is experimental and subject to change, not covered by any
    + * API stability guarantees.
    + * 
    + * + * Protobuf type {@code tensorflow.RewriterConfig} + */ +public final class RewriterConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig) + RewriterConfigOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RewriterConfig.class.getName()); + } + // Use RewriterConfig.newBuilder() to construct. + private RewriterConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RewriterConfig() { + cpuLayoutConversion_ = 0; + layoutOptimizer_ = 0; + constantFolding_ = 0; + shapeOptimization_ = 0; + remapping_ = 0; + commonSubgraphElimination_ = 0; + arithmeticOptimization_ = 0; + dependencyOptimization_ = 0; + loopOptimization_ = 0; + functionOptimization_ = 0; + debugStripper_ = 0; + scopedAllocatorOptimization_ = 0; + pinToHostOptimization_ = 0; + implementationSelector_ = 0; + autoMixedPrecision_ = 0; + autoMixedPrecisionMkl_ = 0; + autoMixedPrecisionOnednnBfloat16_ = 0; + autoMixedPrecisionCpu_ = 0; + usePluginOptimizers_ = 0; + experimentalConditionalCodeMotion_ = 0; + metaOptimizerIterations_ = 0; + memoryOptimization_ = 0; + memoryOptimizerTargetNodeNameScope_ = ""; + optimizers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + customOptimizers_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RewriterConfig.class, org.tensorflow.proto.RewriterConfig.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.RewriterConfig.Toggle} + */ + public enum Toggle + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * ON = 1; + */ + ON(1), + /** + * OFF = 2; + */ + OFF(2), + /** + *
    +     * Enable some aggressive optimizations that use assumptions that TF graphs
    +     * may break. For example, assume the shape of a placeholder matches its
    +     * actual feed.
    +     * 
    + * + * AGGRESSIVE = 3; + */ + AGGRESSIVE(3), + /** + *
    +     * Run MLIR pass if there's one implemented in TFG, do nothing otherwise.
    +     * I.e., if there's no corresponding TFG pass, it's an OFF. This is supposed
    +     * to be mapped with `ON` and there's no `AGGRESSIVE` in MLIR pass now.
    +     * 
    + * + * EXPERIMENTAL_MLIR = 4; + */ + EXPERIMENTAL_MLIR(4), + /** + *
    +     * Run both MLIR and Grappler passes consecutively and MLIR pass will come
    +     * first.
    +     * 
    + * + * EXPERIMENTAL_BOTH = 5; + */ + EXPERIMENTAL_BOTH(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Toggle.class.getName()); + } + /** + * 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; + /** + *
    +     * Enable some aggressive optimizations that use assumptions that TF graphs
    +     * may break. For example, assume the shape of a placeholder matches its
    +     * actual feed.
    +     * 
    + * + * AGGRESSIVE = 3; + */ + public static final int AGGRESSIVE_VALUE = 3; + /** + *
    +     * Run MLIR pass if there's one implemented in TFG, do nothing otherwise.
    +     * I.e., if there's no corresponding TFG pass, it's an OFF. This is supposed
    +     * to be mapped with `ON` and there's no `AGGRESSIVE` in MLIR pass now.
    +     * 
    + * + * EXPERIMENTAL_MLIR = 4; + */ + public static final int EXPERIMENTAL_MLIR_VALUE = 4; + /** + *
    +     * Run both MLIR and Grappler passes consecutively and MLIR pass will come
    +     * first.
    +     * 
    + * + * EXPERIMENTAL_BOTH = 5; + */ + public static final int EXPERIMENTAL_BOTH_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Toggle valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Toggle forNumber(int value) { + switch (value) { + case 0: return DEFAULT; + case 1: return ON; + case 2: return OFF; + case 3: return AGGRESSIVE; + case 4: return EXPERIMENTAL_MLIR; + case 5: return EXPERIMENTAL_BOTH; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Toggle> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Toggle findValueByNumber(int number) { + return Toggle.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.RewriterConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final Toggle[] VALUES = values(); + + public static Toggle 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 Toggle(int value) { + this.value = 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), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CpuLayout.class.getName()); + } + /** + * 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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CpuLayout valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire 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() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.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
    +   * run them twice.
    +   * 
    + * + * Protobuf enum {@code tensorflow.RewriterConfig.NumIterationsType} + */ + public enum NumIterationsType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT_NUM_ITERS = 0; + */ + DEFAULT_NUM_ITERS(0), + /** + * ONE = 1; + */ + ONE(1), + /** + * TWO = 2; + */ + TWO(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NumIterationsType.class.getName()); + } + /** + * DEFAULT_NUM_ITERS = 0; + */ + public static final int DEFAULT_NUM_ITERS_VALUE = 0; + /** + * ONE = 1; + */ + public static final int ONE_VALUE = 1; + /** + * TWO = 2; + */ + public static final int TWO_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NumIterationsType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NumIterationsType forNumber(int value) { + switch (value) { + case 0: return DEFAULT_NUM_ITERS; + case 1: return ONE; + case 2: return TWO; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NumIterationsType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NumIterationsType findValueByNumber(int number) { + return NumIterationsType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.RewriterConfig.getDescriptor().getEnumTypes().get(2); + } + + private static final NumIterationsType[] VALUES = values(); + + public static NumIterationsType 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 NumIterationsType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.NumIterationsType) + } + + /** + * Protobuf enum {@code tensorflow.RewriterConfig.MemOptType} + */ + public enum MemOptType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * The default setting (SCHEDULING and SWAPPING HEURISTICS only)
    +     * 
    + * + * DEFAULT_MEM_OPT = 0; + */ + DEFAULT_MEM_OPT(0), + /** + *
    +     * Disabled in the meta-optimizer.
    +     * 
    + * + * NO_MEM_OPT = 1; + */ + NO_MEM_OPT(1), + /** + *
    +     * Driven by manual op-level annotations.
    +     * 
    + * + * MANUAL = 2; + */ + MANUAL(2), + /** + *
    +     * Swapping heuristic will move a tensor from the GPU to the CPU and move
    +     * it back when needed to reduce peak memory usage.
    +     * 
    + * + * SWAPPING_HEURISTICS = 4; + */ + SWAPPING_HEURISTICS(4), + /** + *
    +     * Recomputation heuristics will recompute ops (such as Relu activation)
    +     * during backprop instead of storing them, reducing peak memory usage.
    +     * 
    + * + * RECOMPUTATION_HEURISTICS = 5; + */ + RECOMPUTATION_HEURISTICS(5), + /** + *
    +     * Scheduling will split big ops such as AddN and try to enforce a schedule
    +     * of the new computations that decreases peak memory usage.
    +     * 
    + * + * SCHEDULING_HEURISTICS = 6; + */ + SCHEDULING_HEURISTICS(6), + /** + *
    +     * Use any combination of swapping and recomputation heuristics.
    +     * 
    + * + * HEURISTICS = 3; + */ + HEURISTICS(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + MemOptType.class.getName()); + } + /** + *
    +     * The default setting (SCHEDULING and SWAPPING HEURISTICS only)
    +     * 
    + * + * DEFAULT_MEM_OPT = 0; + */ + public static final int DEFAULT_MEM_OPT_VALUE = 0; + /** + *
    +     * Disabled in the meta-optimizer.
    +     * 
    + * + * NO_MEM_OPT = 1; + */ + public static final int NO_MEM_OPT_VALUE = 1; + /** + *
    +     * Driven by manual op-level annotations.
    +     * 
    + * + * MANUAL = 2; + */ + public static final int MANUAL_VALUE = 2; + /** + *
    +     * Swapping heuristic will move a tensor from the GPU to the CPU and move
    +     * it back when needed to reduce peak memory usage.
    +     * 
    + * + * SWAPPING_HEURISTICS = 4; + */ + public static final int SWAPPING_HEURISTICS_VALUE = 4; + /** + *
    +     * Recomputation heuristics will recompute ops (such as Relu activation)
    +     * during backprop instead of storing them, reducing peak memory usage.
    +     * 
    + * + * RECOMPUTATION_HEURISTICS = 5; + */ + public static final int RECOMPUTATION_HEURISTICS_VALUE = 5; + /** + *
    +     * Scheduling will split big ops such as AddN and try to enforce a schedule
    +     * of the new computations that decreases peak memory usage.
    +     * 
    + * + * SCHEDULING_HEURISTICS = 6; + */ + public static final int SCHEDULING_HEURISTICS_VALUE = 6; + /** + *
    +     * Use any combination of swapping and recomputation heuristics.
    +     * 
    + * + * HEURISTICS = 3; + */ + public static final int HEURISTICS_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MemOptType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MemOptType forNumber(int value) { + switch (value) { + case 0: return DEFAULT_MEM_OPT; + case 1: return NO_MEM_OPT; + case 2: return MANUAL; + case 4: return SWAPPING_HEURISTICS; + case 5: return RECOMPUTATION_HEURISTICS; + case 6: return SCHEDULING_HEURISTICS; + case 3: return HEURISTICS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MemOptType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MemOptType findValueByNumber(int number) { + return MemOptType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.RewriterConfig.getDescriptor().getEnumTypes().get(3); + } + + private static final MemOptType[] VALUES = values(); + + public static MemOptType 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 MemOptType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.MemOptType) + } + + public interface CustomGraphOptimizerOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RewriterConfig.CustomGraphOptimizer) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + int getParameterMapCount(); + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + boolean containsParameterMap( + java.lang.String key); + /** + * Use {@link #getParameterMapMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getParameterMap(); + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + java.util.Map + getParameterMapMap(); + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + /* nullable */ +org.tensorflow.proto.AttrValue getParameterMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue); + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + org.tensorflow.proto.AttrValue getParameterMapOrThrow( + java.lang.String key); + } + /** + *
    +   * Message to describe custom graph optimizer and its parameters
    +   * 
    + * + * Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer} + */ + public static final class CustomGraphOptimizer extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig.CustomGraphOptimizer) + CustomGraphOptimizerOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CustomGraphOptimizer.class.getName()); + } + // Use CustomGraphOptimizer.newBuilder() to construct. + private CustomGraphOptimizer(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CustomGraphOptimizer() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetParameterMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 PARAMETER_MAP_FIELD_NUMBER = 2; + private static final class ParameterMapDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.AttrValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.AttrValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.AttrValue> parameterMap_; + private com.google.protobuf.MapField + internalGetParameterMap() { + if (parameterMap_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ParameterMapDefaultEntryHolder.defaultEntry); + } + return parameterMap_; + } + public int getParameterMapCount() { + return internalGetParameterMap().getMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public boolean containsParameterMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetParameterMap().getMap().containsKey(key); + } + /** + * Use {@link #getParameterMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParameterMap() { + return getParameterMapMap(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public java.util.Map getParameterMapMap() { + return internalGetParameterMap().getMap(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getParameterMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetParameterMap().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getParameterMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetParameterMap().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetParameterMap(), + ParameterMapDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry + : internalGetParameterMap().getMap().entrySet()) { + com.google.protobuf.MapEntry + parameterMap__ = ParameterMapDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, parameterMap__); + } + size += getUnknownFields().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.RewriterConfig.CustomGraphOptimizer)) { + return super.equals(obj); + } + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer other = (org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!internalGetParameterMap().equals( + other.internalGetParameterMap())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (!internalGetParameterMap().getMap().isEmpty()) { + hash = (37 * hash) + PARAMETER_MAP_FIELD_NUMBER; + hash = (53 * hash) + internalGetParameterMap().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RewriterConfig.CustomGraphOptimizer 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Message to describe custom graph optimizer and its parameters
    +     * 
    + * + * Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig.CustomGraphOptimizer) + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetParameterMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableParameterMap(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder.class); + } + + // Construct using org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableParameterMap().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() { + return org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer build() { + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer buildPartial() { + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer result = new org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parameterMap_ = internalGetParameterMap().build(ParameterMapDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer) { + return mergeFrom((org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer other) { + if (other == org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableParameterMap().mergeFrom( + other.internalGetParameterMap()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + parameterMap__ = input.readMessage( + ParameterMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableParameterMap().ensureBuilderMap().put( + parameterMap__.getKey(), parameterMap__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class ParameterMapConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.AttrValue build(org.tensorflow.proto.AttrValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.AttrValue) { return (org.tensorflow.proto.AttrValue) val; } + return ((org.tensorflow.proto.AttrValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return ParameterMapDefaultEntryHolder.defaultEntry; + } + }; + private static final ParameterMapConverter parameterMapConverter = new ParameterMapConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.AttrValueOrBuilder, org.tensorflow.proto.AttrValue, org.tensorflow.proto.AttrValue.Builder> parameterMap_; + private com.google.protobuf.MapFieldBuilder + internalGetParameterMap() { + if (parameterMap_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(parameterMapConverter); + } + return parameterMap_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableParameterMap() { + if (parameterMap_ == null) { + parameterMap_ = new com.google.protobuf.MapFieldBuilder<>(parameterMapConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return parameterMap_; + } + public int getParameterMapCount() { + return internalGetParameterMap().ensureBuilderMap().size(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public boolean containsParameterMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetParameterMap().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getParameterMapMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getParameterMap() { + return getParameterMapMap(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public java.util.Map getParameterMapMap() { + return internalGetParameterMap().getImmutableMap(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.AttrValue getParameterMapOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.AttrValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableParameterMap().ensureBuilderMap(); + return map.containsKey(key) ? parameterMapConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + @java.lang.Override + public org.tensorflow.proto.AttrValue getParameterMapOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableParameterMap().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return parameterMapConverter.build(map.get(key)); + } + public Builder clearParameterMap() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableParameterMap().clear(); + return this; + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + public Builder removeParameterMap( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableParameterMap().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableParameterMap() { + bitField0_ |= 0x00000002; + return internalGetMutableParameterMap().ensureMessageMap(); + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + public Builder putParameterMap( + java.lang.String key, + org.tensorflow.proto.AttrValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableParameterMap().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + public Builder putAllParameterMap( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableParameterMap().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + * map<string, .tensorflow.AttrValue> parameter_map = 2; + */ + public org.tensorflow.proto.AttrValue.Builder putParameterMapBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableParameterMap().ensureBuilderMap(); + org.tensorflow.proto.AttrValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.AttrValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.AttrValue) { + entry = ((org.tensorflow.proto.AttrValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.AttrValue.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RewriterConfig.CustomGraphOptimizer) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig.CustomGraphOptimizer) + private static final org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer(); + } + + public static org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomGraphOptimizer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int CPU_LAYOUT_CONVERSION_FIELD_NUMBER = 50; + private int cpuLayoutConversion_ = 0; + /** + *
    +   * CPU Conversion settings between NHCW and NCHW.
    +   * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return The enum numeric value on the wire for cpuLayoutConversion. + */ + @java.lang.Override public int getCpuLayoutConversionValue() { + return cpuLayoutConversion_; + } + /** + *
    +   * CPU Conversion settings between NHCW and NCHW.
    +   * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return The cpuLayoutConversion. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.CpuLayout getCpuLayoutConversion() { + org.tensorflow.proto.RewriterConfig.CpuLayout result = org.tensorflow.proto.RewriterConfig.CpuLayout.forNumber(cpuLayoutConversion_); + return result == null ? org.tensorflow.proto.RewriterConfig.CpuLayout.UNRECOGNIZED : result; + } + + public static final int LAYOUT_OPTIMIZER_FIELD_NUMBER = 1; + private int layoutOptimizer_ = 0; + /** + *
    +   * Optimize tensor layouts (default is ON)
    +   * e.g. This will try to use NCHW layout on GPU which is faster.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The enum numeric value on the wire for layoutOptimizer. + */ + @java.lang.Override public int getLayoutOptimizerValue() { + return layoutOptimizer_; + } + /** + *
    +   * Optimize tensor layouts (default is ON)
    +   * e.g. This will try to use NCHW layout on GPU which is faster.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The layoutOptimizer. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getLayoutOptimizer() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(layoutOptimizer_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int CONSTANT_FOLDING_FIELD_NUMBER = 3; + private int constantFolding_ = 0; + /** + *
    +   * Fold constants (default is ON)
    +   * Statically infer the value of tensors when possible, and materialize the
    +   * result using constants.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The enum numeric value on the wire for constantFolding. + */ + @java.lang.Override public int getConstantFoldingValue() { + return constantFolding_; + } + /** + *
    +   * Fold constants (default is ON)
    +   * Statically infer the value of tensors when possible, and materialize the
    +   * result using constants.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The constantFolding. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getConstantFolding() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(constantFolding_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int SHAPE_OPTIMIZATION_FIELD_NUMBER = 13; + private int shapeOptimization_ = 0; + /** + *
    +   * Shape optimizations (default is ON)
    +   * Simplify computations made on shapes.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The enum numeric value on the wire for shapeOptimization. + */ + @java.lang.Override public int getShapeOptimizationValue() { + return shapeOptimization_; + } + /** + *
    +   * Shape optimizations (default is ON)
    +   * Simplify computations made on shapes.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The shapeOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getShapeOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(shapeOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int REMAPPING_FIELD_NUMBER = 14; + private int remapping_ = 0; + /** + *
    +   * Remapping (default is ON)
    +   * Remap subgraphs onto more efficient implementations.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The enum numeric value on the wire for remapping. + */ + @java.lang.Override public int getRemappingValue() { + return remapping_; + } + /** + *
    +   * Remapping (default is ON)
    +   * Remap subgraphs onto more efficient implementations.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The remapping. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getRemapping() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(remapping_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int COMMON_SUBGRAPH_ELIMINATION_FIELD_NUMBER = 24; + private int commonSubgraphElimination_ = 0; + /** + *
    +   * Common subgraph elimination (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The enum numeric value on the wire for commonSubgraphElimination. + */ + @java.lang.Override public int getCommonSubgraphEliminationValue() { + return commonSubgraphElimination_; + } + /** + *
    +   * Common subgraph elimination (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The commonSubgraphElimination. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getCommonSubgraphElimination() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(commonSubgraphElimination_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int ARITHMETIC_OPTIMIZATION_FIELD_NUMBER = 7; + private int arithmeticOptimization_ = 0; + /** + *
    +   * Arithmetic optimizations (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The enum numeric value on the wire for arithmeticOptimization. + */ + @java.lang.Override public int getArithmeticOptimizationValue() { + return arithmeticOptimization_; + } + /** + *
    +   * Arithmetic optimizations (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The arithmeticOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getArithmeticOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(arithmeticOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int DEPENDENCY_OPTIMIZATION_FIELD_NUMBER = 8; + private int dependencyOptimization_ = 0; + /** + *
    +   * Control dependency optimizations (default is ON).
    +   * Remove redundant control dependencies, which may enable other optimization.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The enum numeric value on the wire for dependencyOptimization. + */ + @java.lang.Override public int getDependencyOptimizationValue() { + return dependencyOptimization_; + } + /** + *
    +   * Control dependency optimizations (default is ON).
    +   * Remove redundant control dependencies, which may enable other optimization.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The dependencyOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getDependencyOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(dependencyOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int LOOP_OPTIMIZATION_FIELD_NUMBER = 9; + private int loopOptimization_ = 0; + /** + *
    +   * Loop optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The enum numeric value on the wire for loopOptimization. + */ + @java.lang.Override public int getLoopOptimizationValue() { + return loopOptimization_; + } + /** + *
    +   * Loop optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The loopOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getLoopOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(loopOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int FUNCTION_OPTIMIZATION_FIELD_NUMBER = 10; + private int functionOptimization_ = 0; + /** + *
    +   * Function optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The enum numeric value on the wire for functionOptimization. + */ + @java.lang.Override public int getFunctionOptimizationValue() { + return functionOptimization_; + } + /** + *
    +   * Function optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The functionOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getFunctionOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(functionOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int DEBUG_STRIPPER_FIELD_NUMBER = 11; + private int debugStripper_ = 0; + /** + *
    +   * Strips debug-related nodes from the graph (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The enum numeric value on the wire for debugStripper. + */ + @java.lang.Override public int getDebugStripperValue() { + return debugStripper_; + } + /** + *
    +   * Strips debug-related nodes from the graph (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The debugStripper. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getDebugStripper() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(debugStripper_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int DISABLE_MODEL_PRUNING_FIELD_NUMBER = 2; + private boolean disableModelPruning_ = false; + /** + *
    +   * If true, don't remove unnecessary ops from the graph
    +   * 
    + * + * bool disable_model_pruning = 2; + * @return The disableModelPruning. + */ + @java.lang.Override + public boolean getDisableModelPruning() { + return disableModelPruning_; + } + + public static final int SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER = 15; + private int scopedAllocatorOptimization_ = 0; + /** + *
    +   * Try to allocate some independent Op outputs contiguously in order to
    +   * merge or eliminate downstream Ops (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The enum numeric value on the wire for scopedAllocatorOptimization. + */ + @java.lang.Override public int getScopedAllocatorOptimizationValue() { + return scopedAllocatorOptimization_; + } + /** + *
    +   * Try to allocate some independent Op outputs contiguously in order to
    +   * merge or eliminate downstream Ops (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The scopedAllocatorOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getScopedAllocatorOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(scopedAllocatorOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER = 18; + private int pinToHostOptimization_ = 0; + /** + *
    +   * Force small ops onto the CPU (default is OFF).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The enum numeric value on the wire for pinToHostOptimization. + */ + @java.lang.Override public int getPinToHostOptimizationValue() { + return pinToHostOptimization_; + } + /** + *
    +   * Force small ops onto the CPU (default is OFF).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The pinToHostOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getPinToHostOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(pinToHostOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int IMPLEMENTATION_SELECTOR_FIELD_NUMBER = 22; + private int implementationSelector_ = 0; + /** + *
    +   * Enable the swap of kernel implementations based on the device placement
    +   * (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The enum numeric value on the wire for implementationSelector. + */ + @java.lang.Override public int getImplementationSelectorValue() { + return implementationSelector_; + } + /** + *
    +   * Enable the swap of kernel implementations based on the device placement
    +   * (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The implementationSelector. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getImplementationSelector() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(implementationSelector_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int AUTO_MIXED_PRECISION_FIELD_NUMBER = 23; + private int autoMixedPrecision_ = 0; + /** + *
    +   * Optimize data types for CUDA/oneDNN (default is OFF).
    +   * This will try to use float16 on GPU/CPU which is faster.
    +   * Note that this can change the numerical stability of the graph and may
    +   * require the use of loss scaling to maintain model convergence.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The enum numeric value on the wire for autoMixedPrecision. + */ + @java.lang.Override public int getAutoMixedPrecisionValue() { + return autoMixedPrecision_; + } + /** + *
    +   * Optimize data types for CUDA/oneDNN (default is OFF).
    +   * This will try to use float16 on GPU/CPU which is faster.
    +   * Note that this can change the numerical stability of the graph and may
    +   * require the use of loss scaling to maintain model convergence.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The autoMixedPrecision. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecision() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecision_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int AUTO_MIXED_PRECISION_MKL_FIELD_NUMBER = 25; + private int autoMixedPrecisionMkl_ = 0; + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is deprecated.
    +   * It is replaced by auto_mixed_precision_onednn_bfloat16
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The enum numeric value on the wire for autoMixedPrecisionMkl. + */ + @java.lang.Override public int getAutoMixedPrecisionMklValue() { + return autoMixedPrecisionMkl_; + } + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is deprecated.
    +   * It is replaced by auto_mixed_precision_onednn_bfloat16
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The autoMixedPrecisionMkl. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionMkl() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionMkl_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int AUTO_MIXED_PRECISION_ONEDNN_BFLOAT16_FIELD_NUMBER = 31; + private int autoMixedPrecisionOnednnBfloat16_ = 0; + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The enum numeric value on the wire for autoMixedPrecisionOnednnBfloat16. + */ + @java.lang.Override public int getAutoMixedPrecisionOnednnBfloat16Value() { + return autoMixedPrecisionOnednnBfloat16_; + } + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The autoMixedPrecisionOnednnBfloat16. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionOnednnBfloat16() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionOnednnBfloat16_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int AUTO_MIXED_PRECISION_CPU_FIELD_NUMBER = 29; + private int autoMixedPrecisionCpu_ = 0; + /** + *
    +   * Emulate a model using data type float16 on CPU (default is OFF).
    +   * This will try to emulate the float16 inputs and outputs of an operator
    +   * on CPU to have better correlation with float16 on GPU; however the
    +   * computation in the operator is based on float32.
    +   * Note that this can change the numerical stability of the graph.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The enum numeric value on the wire for autoMixedPrecisionCpu. + */ + @java.lang.Override public int getAutoMixedPrecisionCpuValue() { + return autoMixedPrecisionCpu_; + } + /** + *
    +   * Emulate a model using data type float16 on CPU (default is OFF).
    +   * This will try to emulate the float16 inputs and outputs of an operator
    +   * on CPU to have better correlation with float16 on GPU; however the
    +   * computation in the operator is based on float32.
    +   * Note that this can change the numerical stability of the graph.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The autoMixedPrecisionCpu. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionCpu() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionCpu_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int DISABLE_META_OPTIMIZER_FIELD_NUMBER = 19; + private boolean disableMetaOptimizer_ = false; + /** + *
    +   * Disable the entire meta optimizer (off by default).
    +   * 
    + * + * bool disable_meta_optimizer = 19; + * @return The disableMetaOptimizer. + */ + @java.lang.Override + public boolean getDisableMetaOptimizer() { + return disableMetaOptimizer_; + } + + public static final int DISABLE_TFG_OPTIMIZER_FIELD_NUMBER = 32; + private boolean disableTfgOptimizer_ = false; + /** + *
    +   * Disable the TFG optimizer (off by default).
    +   * 
    + * + * bool disable_tfg_optimizer = 32; + * @return The disableTfgOptimizer. + */ + @java.lang.Override + public boolean getDisableTfgOptimizer() { + return disableTfgOptimizer_; + } + + public static final int USE_PLUGIN_OPTIMIZERS_FIELD_NUMBER = 28; + private int usePluginOptimizers_ = 0; + /** + *
    +   * Optimizers registered by plugin (default is ON)
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The enum numeric value on the wire for usePluginOptimizers. + */ + @java.lang.Override public int getUsePluginOptimizersValue() { + return usePluginOptimizers_; + } + /** + *
    +   * Optimizers registered by plugin (default is ON)
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The usePluginOptimizers. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getUsePluginOptimizers() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(usePluginOptimizers_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int EXPERIMENTAL_CONDITIONAL_CODE_MOTION_FIELD_NUMBER = 30; + private int experimentalConditionalCodeMotion_ = 0; + /** + *
    +   * Conditional code motion (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The enum numeric value on the wire for experimentalConditionalCodeMotion. + */ + @java.lang.Override public int getExperimentalConditionalCodeMotionValue() { + return experimentalConditionalCodeMotion_; + } + /** + *
    +   * Conditional code motion (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The experimentalConditionalCodeMotion. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.Toggle getExperimentalConditionalCodeMotion() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(experimentalConditionalCodeMotion_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + + public static final int META_OPTIMIZER_ITERATIONS_FIELD_NUMBER = 12; + private int metaOptimizerIterations_ = 0; + /** + *
    +   * Controls how many times we run the optimizers in meta optimizer (default
    +   * is once).
    +   * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The enum numeric value on the wire for metaOptimizerIterations. + */ + @java.lang.Override public int getMetaOptimizerIterationsValue() { + return metaOptimizerIterations_; + } + /** + *
    +   * Controls how many times we run the optimizers in meta optimizer (default
    +   * is once).
    +   * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The metaOptimizerIterations. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.NumIterationsType getMetaOptimizerIterations() { + org.tensorflow.proto.RewriterConfig.NumIterationsType result = org.tensorflow.proto.RewriterConfig.NumIterationsType.forNumber(metaOptimizerIterations_); + return result == null ? org.tensorflow.proto.RewriterConfig.NumIterationsType.UNRECOGNIZED : result; + } + + public static final int MIN_GRAPH_NODES_FIELD_NUMBER = 17; + private int minGraphNodes_ = 0; + /** + *
    +   * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    +   * optimization is skipped.
    +   * 0 means the system picks an appropriate number.
    +   * < 0 means do not skip optimization.
    +   * 
    + * + * int32 min_graph_nodes = 17; + * @return The minGraphNodes. + */ + @java.lang.Override + public int getMinGraphNodes() { + return minGraphNodes_; + } + + public static final int EXPERIMENTAL_DISABLE_COMPRESSED_TENSOR_OPTIMIZATION_FIELD_NUMBER = 26; + private boolean experimentalDisableCompressedTensorOptimization_ = false; + /** + *
    +   * 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; + * @return The experimentalDisableCompressedTensorOptimization. + */ + @java.lang.Override + public boolean getExperimentalDisableCompressedTensorOptimization() { + return experimentalDisableCompressedTensorOptimization_; + } + + public static final int EXPERIMENTAL_DISABLE_FOLDING_QUANTIZATION_EMULATION_FIELD_NUMBER = 27; + private boolean experimentalDisableFoldingQuantizationEmulation_ = false; + /** + *
    +   * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    +   * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    +   * have to extract quantization configs (e.g. min/max range, number of bits,
    +   * and per-channel) from the quantization emulation ops. Note that this flag
    +   * is experimental and may be removed in the future. See b/174138564 for more
    +   * details.
    +   * 
    + * + * bool experimental_disable_folding_quantization_emulation = 27; + * @return The experimentalDisableFoldingQuantizationEmulation. + */ + @java.lang.Override + public boolean getExperimentalDisableFoldingQuantizationEmulation() { + return experimentalDisableFoldingQuantizationEmulation_; + } + + public static final int MEMORY_OPTIMIZATION_FIELD_NUMBER = 4; + private int memoryOptimization_ = 0; + /** + *
    +   * Configures memory optimization passes through the meta-optimizer. Has no
    +   * effect on manually requested memory optimization passes in the optimizers
    +   * field.
    +   * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The enum numeric value on the wire for memoryOptimization. + */ + @java.lang.Override public int getMemoryOptimizationValue() { + return memoryOptimization_; + } + /** + *
    +   * Configures memory optimization passes through the meta-optimizer. Has no
    +   * effect on manually requested memory optimization passes in the optimizers
    +   * field.
    +   * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The memoryOptimization. + */ + @java.lang.Override public org.tensorflow.proto.RewriterConfig.MemOptType getMemoryOptimization() { + org.tensorflow.proto.RewriterConfig.MemOptType result = org.tensorflow.proto.RewriterConfig.MemOptType.forNumber(memoryOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.MemOptType.UNRECOGNIZED : result; + } + + public static final int MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object memoryOptimizerTargetNodeNameScope_ = ""; + /** + *
    +   * A node name scope for node names which are valid outputs of recomputations.
    +   * Inputs to nodes that match this scope may be recomputed (subject either to
    +   * manual annotation of those input nodes or to manual annotation and
    +   * heuristics depending on memory_optimization), but the nodes themselves will
    +   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +   * can appear not just as a top-level scope. For example, if the value is
    +   * "gradients/", the default, it will match node name "gradients/foo",
    +   * "foo/gradients/bar", but not "foo_gradients/"
    +   * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The memoryOptimizerTargetNodeNameScope. + */ + @java.lang.Override + public java.lang.String getMemoryOptimizerTargetNodeNameScope() { + java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; + 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(); + memoryOptimizerTargetNodeNameScope_ = s; + return s; + } + } + /** + *
    +   * A node name scope for node names which are valid outputs of recomputations.
    +   * Inputs to nodes that match this scope may be recomputed (subject either to
    +   * manual annotation of those input nodes or to manual annotation and
    +   * heuristics depending on memory_optimization), but the nodes themselves will
    +   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +   * can appear not just as a top-level scope. For example, if the value is
    +   * "gradients/", the default, it will match node name "gradients/foo",
    +   * "foo/gradients/bar", but not "foo_gradients/"
    +   * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The bytes for memoryOptimizerTargetNodeNameScope. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMemoryOptimizerTargetNodeNameScopeBytes() { + java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memoryOptimizerTargetNodeNameScope_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int META_OPTIMIZER_TIMEOUT_MS_FIELD_NUMBER = 20; + private long metaOptimizerTimeoutMs_ = 0L; + /** + *
    +   * Maximum number of milliseconds to spend optimizing a single graph before
    +   * timing out. If less than or equal to 0 (default value) the optimizer will
    +   * never time out.
    +   * 
    + * + * int64 meta_optimizer_timeout_ms = 20; + * @return The metaOptimizerTimeoutMs. + */ + @java.lang.Override + public long getMetaOptimizerTimeoutMs() { + return metaOptimizerTimeoutMs_; + } + + public static final int AUTO_PARALLEL_FIELD_NUMBER = 5; + private org.tensorflow.proto.AutoParallelOptions autoParallel_; + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return Whether the autoParallel field is set. + */ + @java.lang.Override + public boolean hasAutoParallel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return The autoParallel. + */ + @java.lang.Override + public org.tensorflow.proto.AutoParallelOptions getAutoParallel() { + return autoParallel_ == null ? org.tensorflow.proto.AutoParallelOptions.getDefaultInstance() : autoParallel_; + } + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + @java.lang.Override + public org.tensorflow.proto.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() { + return autoParallel_ == null ? org.tensorflow.proto.AutoParallelOptions.getDefaultInstance() : autoParallel_; + } + + public static final int FAIL_ON_OPTIMIZER_ERRORS_FIELD_NUMBER = 21; + private boolean failOnOptimizerErrors_ = false; + /** + *
    +   * If true, any optimization pass failing will cause the MetaOptimizer to
    +   * stop with an error. By default - or when set to false, failing passes are
    +   * skipped silently.
    +   * 
    + * + * bool fail_on_optimizer_errors = 21; + * @return The failOnOptimizerErrors. + */ + @java.lang.Override + public boolean getFailOnOptimizerErrors() { + return failOnOptimizerErrors_; + } + + public static final int SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER = 16; + private org.tensorflow.proto.ScopedAllocatorOptions scopedAllocatorOpts_; + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return Whether the scopedAllocatorOpts field is set. + */ + @java.lang.Override + public boolean hasScopedAllocatorOpts() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return The scopedAllocatorOpts. + */ + @java.lang.Override + public org.tensorflow.proto.ScopedAllocatorOptions getScopedAllocatorOpts() { + return scopedAllocatorOpts_ == null ? org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + @java.lang.Override + public org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() { + return scopedAllocatorOpts_ == null ? org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; + } + + public static final int OPTIMIZERS_FIELD_NUMBER = 100; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList optimizers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @return A list containing the optimizers. + */ + public com.google.protobuf.ProtocolStringList + getOptimizersList() { + return optimizers_; + } + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @return The count of optimizers. + */ + public int getOptimizersCount() { + return optimizers_.size(); + } + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @param index The index of the element to return. + * @return The optimizers at the given index. + */ + public java.lang.String getOptimizers(int index) { + return optimizers_.get(index); + } + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @param index The index of the value to return. + * @return The bytes of the optimizers at the given index. + */ + public com.google.protobuf.ByteString + getOptimizersBytes(int index) { + return optimizers_.getByteString(index); + } + + public static final int CUSTOM_OPTIMIZERS_FIELD_NUMBER = 200; + @SuppressWarnings("serial") + private java.util.List customOptimizers_; + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + @java.lang.Override + public java.util.List getCustomOptimizersList() { + return customOptimizers_; + } + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + @java.lang.Override + public java.util.List + getCustomOptimizersOrBuilderList() { + return customOptimizers_; + } + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + @java.lang.Override + public int getCustomOptimizersCount() { + return customOptimizers_.size(); + } + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) { + return customOptimizers_.get(index); + } + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( + int index) { + return customOptimizers_.get(index); + } + + public static final int INTER_OPTIMIZER_VERIFIER_CONFIG_FIELD_NUMBER = 300; + private org.tensorflow.proto.VerifierConfig interOptimizerVerifierConfig_; + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return Whether the interOptimizerVerifierConfig field is set. + */ + @java.lang.Override + public boolean hasInterOptimizerVerifierConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return The interOptimizerVerifierConfig. + */ + @java.lang.Override + public org.tensorflow.proto.VerifierConfig getInterOptimizerVerifierConfig() { + return interOptimizerVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; + } + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + @java.lang.Override + public org.tensorflow.proto.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder() { + return interOptimizerVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; + } + + public static final int POST_OPTIMIZATION_VERIFIER_CONFIG_FIELD_NUMBER = 301; + private org.tensorflow.proto.VerifierConfig postOptimizationVerifierConfig_; + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return Whether the postOptimizationVerifierConfig field is set. + */ + @java.lang.Override + public boolean hasPostOptimizationVerifierConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return The postOptimizationVerifierConfig. + */ + @java.lang.Override + public org.tensorflow.proto.VerifierConfig getPostOptimizationVerifierConfig() { + return postOptimizationVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; + } + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + @java.lang.Override + public org.tensorflow.proto.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder() { + return postOptimizationVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; + } + + 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 (layoutOptimizer_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(1, layoutOptimizer_); + } + if (disableModelPruning_ != false) { + output.writeBool(2, disableModelPruning_); + } + if (constantFolding_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(3, constantFolding_); + } + if (memoryOptimization_ != org.tensorflow.proto.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) { + output.writeEnum(4, memoryOptimization_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getAutoParallel()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(memoryOptimizerTargetNodeNameScope_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, memoryOptimizerTargetNodeNameScope_); + } + if (arithmeticOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(7, arithmeticOptimization_); + } + if (dependencyOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(8, dependencyOptimization_); + } + if (loopOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(9, loopOptimization_); + } + if (functionOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(10, functionOptimization_); + } + if (debugStripper_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(11, debugStripper_); + } + if (metaOptimizerIterations_ != org.tensorflow.proto.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) { + output.writeEnum(12, metaOptimizerIterations_); + } + if (shapeOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(13, shapeOptimization_); + } + if (remapping_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(14, remapping_); + } + if (scopedAllocatorOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(15, scopedAllocatorOptimization_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(16, getScopedAllocatorOpts()); + } + if (minGraphNodes_ != 0) { + output.writeInt32(17, minGraphNodes_); + } + if (pinToHostOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(18, pinToHostOptimization_); + } + if (disableMetaOptimizer_ != false) { + output.writeBool(19, disableMetaOptimizer_); + } + if (metaOptimizerTimeoutMs_ != 0L) { + output.writeInt64(20, metaOptimizerTimeoutMs_); + } + if (failOnOptimizerErrors_ != false) { + output.writeBool(21, failOnOptimizerErrors_); + } + if (implementationSelector_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(22, implementationSelector_); + } + if (autoMixedPrecision_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(23, autoMixedPrecision_); + } + if (commonSubgraphElimination_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(24, commonSubgraphElimination_); + } + if (autoMixedPrecisionMkl_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(25, autoMixedPrecisionMkl_); + } + if (experimentalDisableCompressedTensorOptimization_ != false) { + output.writeBool(26, experimentalDisableCompressedTensorOptimization_); + } + if (experimentalDisableFoldingQuantizationEmulation_ != false) { + output.writeBool(27, experimentalDisableFoldingQuantizationEmulation_); + } + if (usePluginOptimizers_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(28, usePluginOptimizers_); + } + if (autoMixedPrecisionCpu_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(29, autoMixedPrecisionCpu_); + } + if (experimentalConditionalCodeMotion_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(30, experimentalConditionalCodeMotion_); + } + if (autoMixedPrecisionOnednnBfloat16_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(31, autoMixedPrecisionOnednnBfloat16_); + } + if (disableTfgOptimizer_ != false) { + output.writeBool(32, disableTfgOptimizer_); + } + if (cpuLayoutConversion_ != org.tensorflow.proto.RewriterConfig.CpuLayout.NO_CONVERSION_ON_CPU.getNumber()) { + output.writeEnum(50, cpuLayoutConversion_); + } + for (int i = 0; i < optimizers_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 100, optimizers_.getRaw(i)); + } + for (int i = 0; i < customOptimizers_.size(); i++) { + output.writeMessage(200, customOptimizers_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(300, getInterOptimizerVerifierConfig()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(301, getPostOptimizationVerifierConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (layoutOptimizer_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, layoutOptimizer_); + } + if (disableModelPruning_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, disableModelPruning_); + } + if (constantFolding_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, constantFolding_); + } + if (memoryOptimization_ != org.tensorflow.proto.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, memoryOptimization_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getAutoParallel()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(memoryOptimizerTargetNodeNameScope_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, memoryOptimizerTargetNodeNameScope_); + } + if (arithmeticOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, arithmeticOptimization_); + } + if (dependencyOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(8, dependencyOptimization_); + } + if (loopOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, loopOptimization_); + } + if (functionOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, functionOptimization_); + } + if (debugStripper_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(11, debugStripper_); + } + if (metaOptimizerIterations_ != org.tensorflow.proto.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(12, metaOptimizerIterations_); + } + if (shapeOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(13, shapeOptimization_); + } + if (remapping_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(14, remapping_); + } + if (scopedAllocatorOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(15, scopedAllocatorOptimization_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, getScopedAllocatorOpts()); + } + if (minGraphNodes_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, minGraphNodes_); + } + if (pinToHostOptimization_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(18, pinToHostOptimization_); + } + if (disableMetaOptimizer_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(19, disableMetaOptimizer_); + } + if (metaOptimizerTimeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(20, metaOptimizerTimeoutMs_); + } + if (failOnOptimizerErrors_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, failOnOptimizerErrors_); + } + if (implementationSelector_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(22, implementationSelector_); + } + if (autoMixedPrecision_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(23, autoMixedPrecision_); + } + if (commonSubgraphElimination_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(24, commonSubgraphElimination_); + } + if (autoMixedPrecisionMkl_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(25, autoMixedPrecisionMkl_); + } + if (experimentalDisableCompressedTensorOptimization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(26, experimentalDisableCompressedTensorOptimization_); + } + if (experimentalDisableFoldingQuantizationEmulation_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(27, experimentalDisableFoldingQuantizationEmulation_); + } + if (usePluginOptimizers_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(28, usePluginOptimizers_); + } + if (autoMixedPrecisionCpu_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(29, autoMixedPrecisionCpu_); + } + if (experimentalConditionalCodeMotion_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(30, experimentalConditionalCodeMotion_); + } + if (autoMixedPrecisionOnednnBfloat16_ != org.tensorflow.proto.RewriterConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(31, autoMixedPrecisionOnednnBfloat16_); + } + if (disableTfgOptimizer_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(32, disableTfgOptimizer_); + } + if (cpuLayoutConversion_ != org.tensorflow.proto.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++) { + dataSize += computeStringSizeNoTag(optimizers_.getRaw(i)); + } + size += dataSize; + size += 2 * getOptimizersList().size(); + } + for (int i = 0; i < customOptimizers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(200, customOptimizers_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(300, getInterOptimizerVerifierConfig()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(301, getPostOptimizationVerifierConfig()); + } + size += getUnknownFields().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.RewriterConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.RewriterConfig other = (org.tensorflow.proto.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; + if (remapping_ != other.remapping_) return false; + if (commonSubgraphElimination_ != other.commonSubgraphElimination_) return false; + if (arithmeticOptimization_ != other.arithmeticOptimization_) return false; + if (dependencyOptimization_ != other.dependencyOptimization_) return false; + if (loopOptimization_ != other.loopOptimization_) return false; + if (functionOptimization_ != other.functionOptimization_) return false; + if (debugStripper_ != other.debugStripper_) return false; + if (getDisableModelPruning() + != other.getDisableModelPruning()) return false; + if (scopedAllocatorOptimization_ != other.scopedAllocatorOptimization_) return false; + if (pinToHostOptimization_ != other.pinToHostOptimization_) return false; + if (implementationSelector_ != other.implementationSelector_) return false; + if (autoMixedPrecision_ != other.autoMixedPrecision_) return false; + if (autoMixedPrecisionMkl_ != other.autoMixedPrecisionMkl_) return false; + if (autoMixedPrecisionOnednnBfloat16_ != other.autoMixedPrecisionOnednnBfloat16_) return false; + if (autoMixedPrecisionCpu_ != other.autoMixedPrecisionCpu_) return false; + if (getDisableMetaOptimizer() + != other.getDisableMetaOptimizer()) return false; + if (getDisableTfgOptimizer() + != other.getDisableTfgOptimizer()) return false; + if (usePluginOptimizers_ != other.usePluginOptimizers_) return false; + if (experimentalConditionalCodeMotion_ != other.experimentalConditionalCodeMotion_) return false; + if (metaOptimizerIterations_ != other.metaOptimizerIterations_) return false; + if (getMinGraphNodes() + != other.getMinGraphNodes()) return false; + if (getExperimentalDisableCompressedTensorOptimization() + != other.getExperimentalDisableCompressedTensorOptimization()) return false; + if (getExperimentalDisableFoldingQuantizationEmulation() + != other.getExperimentalDisableFoldingQuantizationEmulation()) return false; + if (memoryOptimization_ != other.memoryOptimization_) return false; + if (!getMemoryOptimizerTargetNodeNameScope() + .equals(other.getMemoryOptimizerTargetNodeNameScope())) return false; + if (getMetaOptimizerTimeoutMs() + != other.getMetaOptimizerTimeoutMs()) return false; + if (hasAutoParallel() != other.hasAutoParallel()) return false; + if (hasAutoParallel()) { + if (!getAutoParallel() + .equals(other.getAutoParallel())) return false; + } + if (getFailOnOptimizerErrors() + != other.getFailOnOptimizerErrors()) return false; + if (hasScopedAllocatorOpts() != other.hasScopedAllocatorOpts()) return false; + if (hasScopedAllocatorOpts()) { + if (!getScopedAllocatorOpts() + .equals(other.getScopedAllocatorOpts())) return false; + } + if (!getOptimizersList() + .equals(other.getOptimizersList())) return false; + if (!getCustomOptimizersList() + .equals(other.getCustomOptimizersList())) return false; + if (hasInterOptimizerVerifierConfig() != other.hasInterOptimizerVerifierConfig()) return false; + if (hasInterOptimizerVerifierConfig()) { + if (!getInterOptimizerVerifierConfig() + .equals(other.getInterOptimizerVerifierConfig())) return false; + } + if (hasPostOptimizationVerifierConfig() != other.hasPostOptimizationVerifierConfig()) return false; + if (hasPostOptimizationVerifierConfig()) { + if (!getPostOptimizationVerifierConfig() + .equals(other.getPostOptimizationVerifierConfig())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + 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; + hash = (53 * hash) + constantFolding_; + hash = (37 * hash) + SHAPE_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + shapeOptimization_; + hash = (37 * hash) + REMAPPING_FIELD_NUMBER; + hash = (53 * hash) + remapping_; + hash = (37 * hash) + COMMON_SUBGRAPH_ELIMINATION_FIELD_NUMBER; + hash = (53 * hash) + commonSubgraphElimination_; + hash = (37 * hash) + ARITHMETIC_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + arithmeticOptimization_; + hash = (37 * hash) + DEPENDENCY_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + dependencyOptimization_; + hash = (37 * hash) + LOOP_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + loopOptimization_; + hash = (37 * hash) + FUNCTION_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + functionOptimization_; + hash = (37 * hash) + DEBUG_STRIPPER_FIELD_NUMBER; + hash = (53 * hash) + debugStripper_; + hash = (37 * hash) + DISABLE_MODEL_PRUNING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableModelPruning()); + hash = (37 * hash) + SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + scopedAllocatorOptimization_; + hash = (37 * hash) + PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + pinToHostOptimization_; + hash = (37 * hash) + IMPLEMENTATION_SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + implementationSelector_; + hash = (37 * hash) + AUTO_MIXED_PRECISION_FIELD_NUMBER; + hash = (53 * hash) + autoMixedPrecision_; + hash = (37 * hash) + AUTO_MIXED_PRECISION_MKL_FIELD_NUMBER; + hash = (53 * hash) + autoMixedPrecisionMkl_; + hash = (37 * hash) + AUTO_MIXED_PRECISION_ONEDNN_BFLOAT16_FIELD_NUMBER; + hash = (53 * hash) + autoMixedPrecisionOnednnBfloat16_; + hash = (37 * hash) + AUTO_MIXED_PRECISION_CPU_FIELD_NUMBER; + hash = (53 * hash) + autoMixedPrecisionCpu_; + hash = (37 * hash) + DISABLE_META_OPTIMIZER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableMetaOptimizer()); + hash = (37 * hash) + DISABLE_TFG_OPTIMIZER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableTfgOptimizer()); + hash = (37 * hash) + USE_PLUGIN_OPTIMIZERS_FIELD_NUMBER; + hash = (53 * hash) + usePluginOptimizers_; + hash = (37 * hash) + EXPERIMENTAL_CONDITIONAL_CODE_MOTION_FIELD_NUMBER; + hash = (53 * hash) + experimentalConditionalCodeMotion_; + hash = (37 * hash) + META_OPTIMIZER_ITERATIONS_FIELD_NUMBER; + 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) + EXPERIMENTAL_DISABLE_FOLDING_QUANTIZATION_EMULATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getExperimentalDisableFoldingQuantizationEmulation()); + hash = (37 * hash) + MEMORY_OPTIMIZATION_FIELD_NUMBER; + hash = (53 * hash) + memoryOptimization_; + hash = (37 * hash) + MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + getMemoryOptimizerTargetNodeNameScope().hashCode(); + hash = (37 * hash) + META_OPTIMIZER_TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMetaOptimizerTimeoutMs()); + if (hasAutoParallel()) { + hash = (37 * hash) + AUTO_PARALLEL_FIELD_NUMBER; + hash = (53 * hash) + getAutoParallel().hashCode(); + } + hash = (37 * hash) + FAIL_ON_OPTIMIZER_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFailOnOptimizerErrors()); + if (hasScopedAllocatorOpts()) { + hash = (37 * hash) + SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER; + hash = (53 * hash) + getScopedAllocatorOpts().hashCode(); + } + if (getOptimizersCount() > 0) { + hash = (37 * hash) + OPTIMIZERS_FIELD_NUMBER; + hash = (53 * hash) + getOptimizersList().hashCode(); + } + if (getCustomOptimizersCount() > 0) { + hash = (37 * hash) + CUSTOM_OPTIMIZERS_FIELD_NUMBER; + hash = (53 * hash) + getCustomOptimizersList().hashCode(); + } + if (hasInterOptimizerVerifierConfig()) { + hash = (37 * hash) + INTER_OPTIMIZER_VERIFIER_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getInterOptimizerVerifierConfig().hashCode(); + } + if (hasPostOptimizationVerifierConfig()) { + hash = (37 * hash) + POST_OPTIMIZATION_VERIFIER_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPostOptimizationVerifierConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RewriterConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig 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.RewriterConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig 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.RewriterConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RewriterConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RewriterConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RewriterConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RewriterConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RewriterConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RewriterConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RewriterConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RewriterConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Graph rewriting is experimental and subject to change, not covered by any
    +   * API stability guarantees.
    +   * 
    + * + * Protobuf type {@code tensorflow.RewriterConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig) + org.tensorflow.proto.RewriterConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RewriterConfig.class, org.tensorflow.proto.RewriterConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.RewriterConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getAutoParallelFieldBuilder(); + getScopedAllocatorOptsFieldBuilder(); + getCustomOptimizersFieldBuilder(); + getInterOptimizerVerifierConfigFieldBuilder(); + getPostOptimizationVerifierConfigFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + cpuLayoutConversion_ = 0; + layoutOptimizer_ = 0; + constantFolding_ = 0; + shapeOptimization_ = 0; + remapping_ = 0; + commonSubgraphElimination_ = 0; + arithmeticOptimization_ = 0; + dependencyOptimization_ = 0; + loopOptimization_ = 0; + functionOptimization_ = 0; + debugStripper_ = 0; + disableModelPruning_ = false; + scopedAllocatorOptimization_ = 0; + pinToHostOptimization_ = 0; + implementationSelector_ = 0; + autoMixedPrecision_ = 0; + autoMixedPrecisionMkl_ = 0; + autoMixedPrecisionOnednnBfloat16_ = 0; + autoMixedPrecisionCpu_ = 0; + disableMetaOptimizer_ = false; + disableTfgOptimizer_ = false; + usePluginOptimizers_ = 0; + experimentalConditionalCodeMotion_ = 0; + metaOptimizerIterations_ = 0; + minGraphNodes_ = 0; + experimentalDisableCompressedTensorOptimization_ = false; + experimentalDisableFoldingQuantizationEmulation_ = false; + memoryOptimization_ = 0; + memoryOptimizerTargetNodeNameScope_ = ""; + metaOptimizerTimeoutMs_ = 0L; + autoParallel_ = null; + if (autoParallelBuilder_ != null) { + autoParallelBuilder_.dispose(); + autoParallelBuilder_ = null; + } + failOnOptimizerErrors_ = false; + scopedAllocatorOpts_ = null; + if (scopedAllocatorOptsBuilder_ != null) { + scopedAllocatorOptsBuilder_.dispose(); + scopedAllocatorOptsBuilder_ = null; + } + optimizers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + if (customOptimizersBuilder_ == null) { + customOptimizers_ = java.util.Collections.emptyList(); + } else { + customOptimizers_ = null; + customOptimizersBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00000004); + interOptimizerVerifierConfig_ = null; + if (interOptimizerVerifierConfigBuilder_ != null) { + interOptimizerVerifierConfigBuilder_.dispose(); + interOptimizerVerifierConfigBuilder_ = null; + } + postOptimizationVerifierConfig_ = null; + if (postOptimizationVerifierConfigBuilder_ != null) { + postOptimizationVerifierConfigBuilder_.dispose(); + postOptimizationVerifierConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig getDefaultInstanceForType() { + return org.tensorflow.proto.RewriterConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig build() { + org.tensorflow.proto.RewriterConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RewriterConfig buildPartial() { + org.tensorflow.proto.RewriterConfig result = new org.tensorflow.proto.RewriterConfig(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + if (bitField1_ != 0) { buildPartial1(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.RewriterConfig result) { + if (customOptimizersBuilder_ == null) { + if (((bitField1_ & 0x00000004) != 0)) { + customOptimizers_ = java.util.Collections.unmodifiableList(customOptimizers_); + bitField1_ = (bitField1_ & ~0x00000004); + } + result.customOptimizers_ = customOptimizers_; + } else { + result.customOptimizers_ = customOptimizersBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.RewriterConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cpuLayoutConversion_ = cpuLayoutConversion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.layoutOptimizer_ = layoutOptimizer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.constantFolding_ = constantFolding_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.shapeOptimization_ = shapeOptimization_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.remapping_ = remapping_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.commonSubgraphElimination_ = commonSubgraphElimination_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.arithmeticOptimization_ = arithmeticOptimization_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dependencyOptimization_ = dependencyOptimization_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.loopOptimization_ = loopOptimization_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.functionOptimization_ = functionOptimization_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.debugStripper_ = debugStripper_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.disableModelPruning_ = disableModelPruning_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.scopedAllocatorOptimization_ = scopedAllocatorOptimization_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.pinToHostOptimization_ = pinToHostOptimization_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.implementationSelector_ = implementationSelector_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.autoMixedPrecision_ = autoMixedPrecision_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.autoMixedPrecisionMkl_ = autoMixedPrecisionMkl_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.autoMixedPrecisionOnednnBfloat16_ = autoMixedPrecisionOnednnBfloat16_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.autoMixedPrecisionCpu_ = autoMixedPrecisionCpu_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.disableMetaOptimizer_ = disableMetaOptimizer_; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.disableTfgOptimizer_ = disableTfgOptimizer_; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.usePluginOptimizers_ = usePluginOptimizers_; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.experimentalConditionalCodeMotion_ = experimentalConditionalCodeMotion_; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.metaOptimizerIterations_ = metaOptimizerIterations_; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.minGraphNodes_ = minGraphNodes_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.experimentalDisableCompressedTensorOptimization_ = experimentalDisableCompressedTensorOptimization_; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.experimentalDisableFoldingQuantizationEmulation_ = experimentalDisableFoldingQuantizationEmulation_; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.memoryOptimization_ = memoryOptimization_; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.memoryOptimizerTargetNodeNameScope_ = memoryOptimizerTargetNodeNameScope_; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.metaOptimizerTimeoutMs_ = metaOptimizerTimeoutMs_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x40000000) != 0)) { + result.autoParallel_ = autoParallelBuilder_ == null + ? autoParallel_ + : autoParallelBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.failOnOptimizerErrors_ = failOnOptimizerErrors_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(org.tensorflow.proto.RewriterConfig result) { + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000001) != 0)) { + result.scopedAllocatorOpts_ = scopedAllocatorOptsBuilder_ == null + ? scopedAllocatorOpts_ + : scopedAllocatorOptsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField1_ & 0x00000002) != 0)) { + optimizers_.makeImmutable(); + result.optimizers_ = optimizers_; + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.interOptimizerVerifierConfig_ = interOptimizerVerifierConfigBuilder_ == null + ? interOptimizerVerifierConfig_ + : interOptimizerVerifierConfigBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.postOptimizationVerifierConfig_ = postOptimizationVerifierConfigBuilder_ == null + ? postOptimizationVerifierConfig_ + : postOptimizationVerifierConfigBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RewriterConfig) { + return mergeFrom((org.tensorflow.proto.RewriterConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RewriterConfig other) { + if (other == org.tensorflow.proto.RewriterConfig.getDefaultInstance()) return this; + if (other.cpuLayoutConversion_ != 0) { + setCpuLayoutConversionValue(other.getCpuLayoutConversionValue()); + } + if (other.layoutOptimizer_ != 0) { + setLayoutOptimizerValue(other.getLayoutOptimizerValue()); + } + if (other.constantFolding_ != 0) { + setConstantFoldingValue(other.getConstantFoldingValue()); + } + if (other.shapeOptimization_ != 0) { + setShapeOptimizationValue(other.getShapeOptimizationValue()); + } + if (other.remapping_ != 0) { + setRemappingValue(other.getRemappingValue()); + } + if (other.commonSubgraphElimination_ != 0) { + setCommonSubgraphEliminationValue(other.getCommonSubgraphEliminationValue()); + } + if (other.arithmeticOptimization_ != 0) { + setArithmeticOptimizationValue(other.getArithmeticOptimizationValue()); + } + if (other.dependencyOptimization_ != 0) { + setDependencyOptimizationValue(other.getDependencyOptimizationValue()); + } + if (other.loopOptimization_ != 0) { + setLoopOptimizationValue(other.getLoopOptimizationValue()); + } + if (other.functionOptimization_ != 0) { + setFunctionOptimizationValue(other.getFunctionOptimizationValue()); + } + if (other.debugStripper_ != 0) { + setDebugStripperValue(other.getDebugStripperValue()); + } + if (other.getDisableModelPruning() != false) { + setDisableModelPruning(other.getDisableModelPruning()); + } + if (other.scopedAllocatorOptimization_ != 0) { + setScopedAllocatorOptimizationValue(other.getScopedAllocatorOptimizationValue()); + } + if (other.pinToHostOptimization_ != 0) { + setPinToHostOptimizationValue(other.getPinToHostOptimizationValue()); + } + if (other.implementationSelector_ != 0) { + setImplementationSelectorValue(other.getImplementationSelectorValue()); + } + if (other.autoMixedPrecision_ != 0) { + setAutoMixedPrecisionValue(other.getAutoMixedPrecisionValue()); + } + if (other.autoMixedPrecisionMkl_ != 0) { + setAutoMixedPrecisionMklValue(other.getAutoMixedPrecisionMklValue()); + } + if (other.autoMixedPrecisionOnednnBfloat16_ != 0) { + setAutoMixedPrecisionOnednnBfloat16Value(other.getAutoMixedPrecisionOnednnBfloat16Value()); + } + if (other.autoMixedPrecisionCpu_ != 0) { + setAutoMixedPrecisionCpuValue(other.getAutoMixedPrecisionCpuValue()); + } + if (other.getDisableMetaOptimizer() != false) { + setDisableMetaOptimizer(other.getDisableMetaOptimizer()); + } + if (other.getDisableTfgOptimizer() != false) { + setDisableTfgOptimizer(other.getDisableTfgOptimizer()); + } + if (other.usePluginOptimizers_ != 0) { + setUsePluginOptimizersValue(other.getUsePluginOptimizersValue()); + } + if (other.experimentalConditionalCodeMotion_ != 0) { + setExperimentalConditionalCodeMotionValue(other.getExperimentalConditionalCodeMotionValue()); + } + if (other.metaOptimizerIterations_ != 0) { + setMetaOptimizerIterationsValue(other.getMetaOptimizerIterationsValue()); + } + if (other.getMinGraphNodes() != 0) { + setMinGraphNodes(other.getMinGraphNodes()); + } + if (other.getExperimentalDisableCompressedTensorOptimization() != false) { + setExperimentalDisableCompressedTensorOptimization(other.getExperimentalDisableCompressedTensorOptimization()); + } + if (other.getExperimentalDisableFoldingQuantizationEmulation() != false) { + setExperimentalDisableFoldingQuantizationEmulation(other.getExperimentalDisableFoldingQuantizationEmulation()); + } + if (other.memoryOptimization_ != 0) { + setMemoryOptimizationValue(other.getMemoryOptimizationValue()); + } + if (!other.getMemoryOptimizerTargetNodeNameScope().isEmpty()) { + memoryOptimizerTargetNodeNameScope_ = other.memoryOptimizerTargetNodeNameScope_; + bitField0_ |= 0x10000000; + onChanged(); + } + if (other.getMetaOptimizerTimeoutMs() != 0L) { + setMetaOptimizerTimeoutMs(other.getMetaOptimizerTimeoutMs()); + } + if (other.hasAutoParallel()) { + mergeAutoParallel(other.getAutoParallel()); + } + if (other.getFailOnOptimizerErrors() != false) { + setFailOnOptimizerErrors(other.getFailOnOptimizerErrors()); + } + if (other.hasScopedAllocatorOpts()) { + mergeScopedAllocatorOpts(other.getScopedAllocatorOpts()); + } + if (!other.optimizers_.isEmpty()) { + if (optimizers_.isEmpty()) { + optimizers_ = other.optimizers_; + bitField1_ |= 0x00000002; + } else { + ensureOptimizersIsMutable(); + optimizers_.addAll(other.optimizers_); + } + onChanged(); + } + if (customOptimizersBuilder_ == null) { + if (!other.customOptimizers_.isEmpty()) { + if (customOptimizers_.isEmpty()) { + customOptimizers_ = other.customOptimizers_; + bitField1_ = (bitField1_ & ~0x00000004); + } else { + ensureCustomOptimizersIsMutable(); + customOptimizers_.addAll(other.customOptimizers_); + } + onChanged(); + } + } else { + if (!other.customOptimizers_.isEmpty()) { + if (customOptimizersBuilder_.isEmpty()) { + customOptimizersBuilder_.dispose(); + customOptimizersBuilder_ = null; + customOptimizers_ = other.customOptimizers_; + bitField1_ = (bitField1_ & ~0x00000004); + customOptimizersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCustomOptimizersFieldBuilder() : null; + } else { + customOptimizersBuilder_.addAllMessages(other.customOptimizers_); + } + } + } + if (other.hasInterOptimizerVerifierConfig()) { + mergeInterOptimizerVerifierConfig(other.getInterOptimizerVerifierConfig()); + } + if (other.hasPostOptimizationVerifierConfig()) { + mergePostOptimizationVerifierConfig(other.getPostOptimizationVerifierConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + layoutOptimizer_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 8 + case 16: { + disableModelPruning_ = input.readBool(); + bitField0_ |= 0x00000800; + break; + } // case 16 + case 24: { + constantFolding_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + memoryOptimization_ = input.readEnum(); + bitField0_ |= 0x08000000; + break; + } // case 32 + case 42: { + input.readMessage( + getAutoParallelFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x40000000; + break; + } // case 42 + case 50: { + memoryOptimizerTargetNodeNameScope_ = input.readStringRequireUtf8(); + bitField0_ |= 0x10000000; + break; + } // case 50 + case 56: { + arithmeticOptimization_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + dependencyOptimization_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + loopOptimization_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + functionOptimization_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + debugStripper_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + metaOptimizerIterations_ = input.readEnum(); + bitField0_ |= 0x00800000; + break; + } // case 96 + case 104: { + shapeOptimization_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 104 + case 112: { + remapping_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 112 + case 120: { + scopedAllocatorOptimization_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 120 + case 130: { + input.readMessage( + getScopedAllocatorOptsFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000001; + break; + } // case 130 + case 136: { + minGraphNodes_ = input.readInt32(); + bitField0_ |= 0x01000000; + break; + } // case 136 + case 144: { + pinToHostOptimization_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 144 + case 152: { + disableMetaOptimizer_ = input.readBool(); + bitField0_ |= 0x00080000; + break; + } // case 152 + case 160: { + metaOptimizerTimeoutMs_ = input.readInt64(); + bitField0_ |= 0x20000000; + break; + } // case 160 + case 168: { + failOnOptimizerErrors_ = input.readBool(); + bitField0_ |= 0x80000000; + break; + } // case 168 + case 176: { + implementationSelector_ = input.readEnum(); + bitField0_ |= 0x00004000; + break; + } // case 176 + case 184: { + autoMixedPrecision_ = input.readEnum(); + bitField0_ |= 0x00008000; + break; + } // case 184 + case 192: { + commonSubgraphElimination_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 192 + case 200: { + autoMixedPrecisionMkl_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 200 + case 208: { + experimentalDisableCompressedTensorOptimization_ = input.readBool(); + bitField0_ |= 0x02000000; + break; + } // case 208 + case 216: { + experimentalDisableFoldingQuantizationEmulation_ = input.readBool(); + bitField0_ |= 0x04000000; + break; + } // case 216 + case 224: { + usePluginOptimizers_ = input.readEnum(); + bitField0_ |= 0x00200000; + break; + } // case 224 + case 232: { + autoMixedPrecisionCpu_ = input.readEnum(); + bitField0_ |= 0x00040000; + break; + } // case 232 + case 240: { + experimentalConditionalCodeMotion_ = input.readEnum(); + bitField0_ |= 0x00400000; + break; + } // case 240 + case 248: { + autoMixedPrecisionOnednnBfloat16_ = input.readEnum(); + bitField0_ |= 0x00020000; + break; + } // case 248 + case 256: { + disableTfgOptimizer_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 256 + case 400: { + cpuLayoutConversion_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 400 + case 802: { + java.lang.String s = input.readStringRequireUtf8(); + ensureOptimizersIsMutable(); + optimizers_.add(s); + break; + } // case 802 + case 1602: { + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer m = + input.readMessage( + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.parser(), + extensionRegistry); + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + customOptimizers_.add(m); + } else { + customOptimizersBuilder_.addMessage(m); + } + break; + } // case 1602 + case 2402: { + input.readMessage( + getInterOptimizerVerifierConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000008; + break; + } // case 2402 + case 2410: { + input.readMessage( + getPostOptimizationVerifierConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField1_ |= 0x00000010; + break; + } // case 2410 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private int bitField1_; + + private int cpuLayoutConversion_ = 0; + /** + *
    +     * CPU Conversion settings between NHCW and NCHW.
    +     * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return The enum numeric value on the wire for cpuLayoutConversion. + */ + @java.lang.Override public int getCpuLayoutConversionValue() { + return cpuLayoutConversion_; + } + /** + *
    +     * CPU Conversion settings between NHCW and NCHW.
    +     * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @param value The enum numeric value on the wire for cpuLayoutConversion to set. + * @return This builder for chaining. + */ + public Builder setCpuLayoutConversionValue(int value) { + cpuLayoutConversion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * CPU Conversion settings between NHCW and NCHW.
    +     * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return The cpuLayoutConversion. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.CpuLayout getCpuLayoutConversion() { + org.tensorflow.proto.RewriterConfig.CpuLayout result = org.tensorflow.proto.RewriterConfig.CpuLayout.forNumber(cpuLayoutConversion_); + return result == null ? org.tensorflow.proto.RewriterConfig.CpuLayout.UNRECOGNIZED : result; + } + /** + *
    +     * CPU Conversion settings between NHCW and NCHW.
    +     * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @param value The cpuLayoutConversion to set. + * @return This builder for chaining. + */ + public Builder setCpuLayoutConversion(org.tensorflow.proto.RewriterConfig.CpuLayout value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + cpuLayoutConversion_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * CPU Conversion settings between NHCW and NCHW.
    +     * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return This builder for chaining. + */ + public Builder clearCpuLayoutConversion() { + bitField0_ = (bitField0_ & ~0x00000001); + cpuLayoutConversion_ = 0; + onChanged(); + return this; + } + + private int layoutOptimizer_ = 0; + /** + *
    +     * Optimize tensor layouts (default is ON)
    +     * e.g. This will try to use NCHW layout on GPU which is faster.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The enum numeric value on the wire for layoutOptimizer. + */ + @java.lang.Override public int getLayoutOptimizerValue() { + return layoutOptimizer_; + } + /** + *
    +     * Optimize tensor layouts (default is ON)
    +     * e.g. This will try to use NCHW layout on GPU which is faster.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @param value The enum numeric value on the wire for layoutOptimizer to set. + * @return This builder for chaining. + */ + public Builder setLayoutOptimizerValue(int value) { + layoutOptimizer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Optimize tensor layouts (default is ON)
    +     * e.g. This will try to use NCHW layout on GPU which is faster.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The layoutOptimizer. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getLayoutOptimizer() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(layoutOptimizer_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Optimize tensor layouts (default is ON)
    +     * e.g. This will try to use NCHW layout on GPU which is faster.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @param value The layoutOptimizer to set. + * @return This builder for chaining. + */ + public Builder setLayoutOptimizer(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + layoutOptimizer_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Optimize tensor layouts (default is ON)
    +     * e.g. This will try to use NCHW layout on GPU which is faster.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return This builder for chaining. + */ + public Builder clearLayoutOptimizer() { + bitField0_ = (bitField0_ & ~0x00000002); + layoutOptimizer_ = 0; + onChanged(); + return this; + } + + private int constantFolding_ = 0; + /** + *
    +     * Fold constants (default is ON)
    +     * Statically infer the value of tensors when possible, and materialize the
    +     * result using constants.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The enum numeric value on the wire for constantFolding. + */ + @java.lang.Override public int getConstantFoldingValue() { + return constantFolding_; + } + /** + *
    +     * Fold constants (default is ON)
    +     * Statically infer the value of tensors when possible, and materialize the
    +     * result using constants.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @param value The enum numeric value on the wire for constantFolding to set. + * @return This builder for chaining. + */ + public Builder setConstantFoldingValue(int value) { + constantFolding_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Fold constants (default is ON)
    +     * Statically infer the value of tensors when possible, and materialize the
    +     * result using constants.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The constantFolding. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getConstantFolding() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(constantFolding_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Fold constants (default is ON)
    +     * Statically infer the value of tensors when possible, and materialize the
    +     * result using constants.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @param value The constantFolding to set. + * @return This builder for chaining. + */ + public Builder setConstantFolding(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + constantFolding_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Fold constants (default is ON)
    +     * Statically infer the value of tensors when possible, and materialize the
    +     * result using constants.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return This builder for chaining. + */ + public Builder clearConstantFolding() { + bitField0_ = (bitField0_ & ~0x00000004); + constantFolding_ = 0; + onChanged(); + return this; + } + + private int shapeOptimization_ = 0; + /** + *
    +     * Shape optimizations (default is ON)
    +     * Simplify computations made on shapes.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The enum numeric value on the wire for shapeOptimization. + */ + @java.lang.Override public int getShapeOptimizationValue() { + return shapeOptimization_; + } + /** + *
    +     * Shape optimizations (default is ON)
    +     * Simplify computations made on shapes.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @param value The enum numeric value on the wire for shapeOptimization to set. + * @return This builder for chaining. + */ + public Builder setShapeOptimizationValue(int value) { + shapeOptimization_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Shape optimizations (default is ON)
    +     * Simplify computations made on shapes.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The shapeOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getShapeOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(shapeOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Shape optimizations (default is ON)
    +     * Simplify computations made on shapes.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @param value The shapeOptimization to set. + * @return This builder for chaining. + */ + public Builder setShapeOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + shapeOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Shape optimizations (default is ON)
    +     * Simplify computations made on shapes.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return This builder for chaining. + */ + public Builder clearShapeOptimization() { + bitField0_ = (bitField0_ & ~0x00000008); + shapeOptimization_ = 0; + onChanged(); + return this; + } + + private int remapping_ = 0; + /** + *
    +     * Remapping (default is ON)
    +     * Remap subgraphs onto more efficient implementations.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The enum numeric value on the wire for remapping. + */ + @java.lang.Override public int getRemappingValue() { + return remapping_; + } + /** + *
    +     * Remapping (default is ON)
    +     * Remap subgraphs onto more efficient implementations.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @param value The enum numeric value on the wire for remapping to set. + * @return This builder for chaining. + */ + public Builder setRemappingValue(int value) { + remapping_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Remapping (default is ON)
    +     * Remap subgraphs onto more efficient implementations.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The remapping. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getRemapping() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(remapping_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Remapping (default is ON)
    +     * Remap subgraphs onto more efficient implementations.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @param value The remapping to set. + * @return This builder for chaining. + */ + public Builder setRemapping(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + remapping_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Remapping (default is ON)
    +     * Remap subgraphs onto more efficient implementations.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return This builder for chaining. + */ + public Builder clearRemapping() { + bitField0_ = (bitField0_ & ~0x00000010); + remapping_ = 0; + onChanged(); + return this; + } + + private int commonSubgraphElimination_ = 0; + /** + *
    +     * Common subgraph elimination (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The enum numeric value on the wire for commonSubgraphElimination. + */ + @java.lang.Override public int getCommonSubgraphEliminationValue() { + return commonSubgraphElimination_; + } + /** + *
    +     * Common subgraph elimination (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @param value The enum numeric value on the wire for commonSubgraphElimination to set. + * @return This builder for chaining. + */ + public Builder setCommonSubgraphEliminationValue(int value) { + commonSubgraphElimination_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Common subgraph elimination (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The commonSubgraphElimination. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getCommonSubgraphElimination() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(commonSubgraphElimination_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Common subgraph elimination (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @param value The commonSubgraphElimination to set. + * @return This builder for chaining. + */ + public Builder setCommonSubgraphElimination(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + commonSubgraphElimination_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Common subgraph elimination (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return This builder for chaining. + */ + public Builder clearCommonSubgraphElimination() { + bitField0_ = (bitField0_ & ~0x00000020); + commonSubgraphElimination_ = 0; + onChanged(); + return this; + } + + private int arithmeticOptimization_ = 0; + /** + *
    +     * Arithmetic optimizations (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The enum numeric value on the wire for arithmeticOptimization. + */ + @java.lang.Override public int getArithmeticOptimizationValue() { + return arithmeticOptimization_; + } + /** + *
    +     * Arithmetic optimizations (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @param value The enum numeric value on the wire for arithmeticOptimization to set. + * @return This builder for chaining. + */ + public Builder setArithmeticOptimizationValue(int value) { + arithmeticOptimization_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Arithmetic optimizations (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The arithmeticOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getArithmeticOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(arithmeticOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Arithmetic optimizations (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @param value The arithmeticOptimization to set. + * @return This builder for chaining. + */ + public Builder setArithmeticOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + arithmeticOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Arithmetic optimizations (default is ON)
    +     * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return This builder for chaining. + */ + public Builder clearArithmeticOptimization() { + bitField0_ = (bitField0_ & ~0x00000040); + arithmeticOptimization_ = 0; + onChanged(); + return this; + } + + private int dependencyOptimization_ = 0; + /** + *
    +     * Control dependency optimizations (default is ON).
    +     * Remove redundant control dependencies, which may enable other optimization.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The enum numeric value on the wire for dependencyOptimization. + */ + @java.lang.Override public int getDependencyOptimizationValue() { + return dependencyOptimization_; + } + /** + *
    +     * Control dependency optimizations (default is ON).
    +     * Remove redundant control dependencies, which may enable other optimization.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @param value The enum numeric value on the wire for dependencyOptimization to set. + * @return This builder for chaining. + */ + public Builder setDependencyOptimizationValue(int value) { + dependencyOptimization_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Control dependency optimizations (default is ON).
    +     * Remove redundant control dependencies, which may enable other optimization.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The dependencyOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getDependencyOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(dependencyOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Control dependency optimizations (default is ON).
    +     * Remove redundant control dependencies, which may enable other optimization.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @param value The dependencyOptimization to set. + * @return This builder for chaining. + */ + public Builder setDependencyOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + dependencyOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Control dependency optimizations (default is ON).
    +     * Remove redundant control dependencies, which may enable other optimization.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return This builder for chaining. + */ + public Builder clearDependencyOptimization() { + bitField0_ = (bitField0_ & ~0x00000080); + dependencyOptimization_ = 0; + onChanged(); + return this; + } + + private int loopOptimization_ = 0; + /** + *
    +     * Loop optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The enum numeric value on the wire for loopOptimization. + */ + @java.lang.Override public int getLoopOptimizationValue() { + return loopOptimization_; + } + /** + *
    +     * Loop optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @param value The enum numeric value on the wire for loopOptimization to set. + * @return This builder for chaining. + */ + public Builder setLoopOptimizationValue(int value) { + loopOptimization_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Loop optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The loopOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getLoopOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(loopOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Loop optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @param value The loopOptimization to set. + * @return This builder for chaining. + */ + public Builder setLoopOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + loopOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Loop optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return This builder for chaining. + */ + public Builder clearLoopOptimization() { + bitField0_ = (bitField0_ & ~0x00000100); + loopOptimization_ = 0; + onChanged(); + return this; + } + + private int functionOptimization_ = 0; + /** + *
    +     * Function optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The enum numeric value on the wire for functionOptimization. + */ + @java.lang.Override public int getFunctionOptimizationValue() { + return functionOptimization_; + } + /** + *
    +     * Function optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @param value The enum numeric value on the wire for functionOptimization to set. + * @return This builder for chaining. + */ + public Builder setFunctionOptimizationValue(int value) { + functionOptimization_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Function optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The functionOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getFunctionOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(functionOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Function optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @param value The functionOptimization to set. + * @return This builder for chaining. + */ + public Builder setFunctionOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + functionOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Function optimizations (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return This builder for chaining. + */ + public Builder clearFunctionOptimization() { + bitField0_ = (bitField0_ & ~0x00000200); + functionOptimization_ = 0; + onChanged(); + return this; + } + + private int debugStripper_ = 0; + /** + *
    +     * Strips debug-related nodes from the graph (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The enum numeric value on the wire for debugStripper. + */ + @java.lang.Override public int getDebugStripperValue() { + return debugStripper_; + } + /** + *
    +     * Strips debug-related nodes from the graph (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @param value The enum numeric value on the wire for debugStripper to set. + * @return This builder for chaining. + */ + public Builder setDebugStripperValue(int value) { + debugStripper_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Strips debug-related nodes from the graph (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The debugStripper. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getDebugStripper() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(debugStripper_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Strips debug-related nodes from the graph (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @param value The debugStripper to set. + * @return This builder for chaining. + */ + public Builder setDebugStripper(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + debugStripper_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Strips debug-related nodes from the graph (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return This builder for chaining. + */ + public Builder clearDebugStripper() { + bitField0_ = (bitField0_ & ~0x00000400); + debugStripper_ = 0; + onChanged(); + return this; + } + + private boolean disableModelPruning_ ; + /** + *
    +     * If true, don't remove unnecessary ops from the graph
    +     * 
    + * + * bool disable_model_pruning = 2; + * @return The disableModelPruning. + */ + @java.lang.Override + public boolean getDisableModelPruning() { + return disableModelPruning_; + } + /** + *
    +     * If true, don't remove unnecessary ops from the graph
    +     * 
    + * + * bool disable_model_pruning = 2; + * @param value The disableModelPruning to set. + * @return This builder for chaining. + */ + public Builder setDisableModelPruning(boolean value) { + + disableModelPruning_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * If true, don't remove unnecessary ops from the graph
    +     * 
    + * + * bool disable_model_pruning = 2; + * @return This builder for chaining. + */ + public Builder clearDisableModelPruning() { + bitField0_ = (bitField0_ & ~0x00000800); + disableModelPruning_ = false; + onChanged(); + return this; + } + + private int scopedAllocatorOptimization_ = 0; + /** + *
    +     * Try to allocate some independent Op outputs contiguously in order to
    +     * merge or eliminate downstream Ops (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The enum numeric value on the wire for scopedAllocatorOptimization. + */ + @java.lang.Override public int getScopedAllocatorOptimizationValue() { + return scopedAllocatorOptimization_; + } + /** + *
    +     * Try to allocate some independent Op outputs contiguously in order to
    +     * merge or eliminate downstream Ops (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @param value The enum numeric value on the wire for scopedAllocatorOptimization to set. + * @return This builder for chaining. + */ + public Builder setScopedAllocatorOptimizationValue(int value) { + scopedAllocatorOptimization_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * Try to allocate some independent Op outputs contiguously in order to
    +     * merge or eliminate downstream Ops (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The scopedAllocatorOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getScopedAllocatorOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(scopedAllocatorOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Try to allocate some independent Op outputs contiguously in order to
    +     * merge or eliminate downstream Ops (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @param value The scopedAllocatorOptimization to set. + * @return This builder for chaining. + */ + public Builder setScopedAllocatorOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + scopedAllocatorOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Try to allocate some independent Op outputs contiguously in order to
    +     * merge or eliminate downstream Ops (off by default).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return This builder for chaining. + */ + public Builder clearScopedAllocatorOptimization() { + bitField0_ = (bitField0_ & ~0x00001000); + scopedAllocatorOptimization_ = 0; + onChanged(); + return this; + } + + private int pinToHostOptimization_ = 0; + /** + *
    +     * Force small ops onto the CPU (default is OFF).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The enum numeric value on the wire for pinToHostOptimization. + */ + @java.lang.Override public int getPinToHostOptimizationValue() { + return pinToHostOptimization_; + } + /** + *
    +     * Force small ops onto the CPU (default is OFF).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @param value The enum numeric value on the wire for pinToHostOptimization to set. + * @return This builder for chaining. + */ + public Builder setPinToHostOptimizationValue(int value) { + pinToHostOptimization_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +     * Force small ops onto the CPU (default is OFF).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The pinToHostOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getPinToHostOptimization() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(pinToHostOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Force small ops onto the CPU (default is OFF).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @param value The pinToHostOptimization to set. + * @return This builder for chaining. + */ + public Builder setPinToHostOptimization(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + pinToHostOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Force small ops onto the CPU (default is OFF).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return This builder for chaining. + */ + public Builder clearPinToHostOptimization() { + bitField0_ = (bitField0_ & ~0x00002000); + pinToHostOptimization_ = 0; + onChanged(); + return this; + } + + private int implementationSelector_ = 0; + /** + *
    +     * Enable the swap of kernel implementations based on the device placement
    +     * (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The enum numeric value on the wire for implementationSelector. + */ + @java.lang.Override public int getImplementationSelectorValue() { + return implementationSelector_; + } + /** + *
    +     * Enable the swap of kernel implementations based on the device placement
    +     * (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @param value The enum numeric value on the wire for implementationSelector to set. + * @return This builder for chaining. + */ + public Builder setImplementationSelectorValue(int value) { + implementationSelector_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +     * Enable the swap of kernel implementations based on the device placement
    +     * (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The implementationSelector. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getImplementationSelector() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(implementationSelector_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Enable the swap of kernel implementations based on the device placement
    +     * (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @param value The implementationSelector to set. + * @return This builder for chaining. + */ + public Builder setImplementationSelector(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + implementationSelector_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Enable the swap of kernel implementations based on the device placement
    +     * (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return This builder for chaining. + */ + public Builder clearImplementationSelector() { + bitField0_ = (bitField0_ & ~0x00004000); + implementationSelector_ = 0; + onChanged(); + return this; + } + + private int autoMixedPrecision_ = 0; + /** + *
    +     * Optimize data types for CUDA/oneDNN (default is OFF).
    +     * This will try to use float16 on GPU/CPU which is faster.
    +     * Note that this can change the numerical stability of the graph and may
    +     * require the use of loss scaling to maintain model convergence.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The enum numeric value on the wire for autoMixedPrecision. + */ + @java.lang.Override public int getAutoMixedPrecisionValue() { + return autoMixedPrecision_; + } + /** + *
    +     * Optimize data types for CUDA/oneDNN (default is OFF).
    +     * This will try to use float16 on GPU/CPU which is faster.
    +     * Note that this can change the numerical stability of the graph and may
    +     * require the use of loss scaling to maintain model convergence.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @param value The enum numeric value on the wire for autoMixedPrecision to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionValue(int value) { + autoMixedPrecision_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for CUDA/oneDNN (default is OFF).
    +     * This will try to use float16 on GPU/CPU which is faster.
    +     * Note that this can change the numerical stability of the graph and may
    +     * require the use of loss scaling to maintain model convergence.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The autoMixedPrecision. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecision() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecision_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Optimize data types for CUDA/oneDNN (default is OFF).
    +     * This will try to use float16 on GPU/CPU which is faster.
    +     * Note that this can change the numerical stability of the graph and may
    +     * require the use of loss scaling to maintain model convergence.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @param value The autoMixedPrecision to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecision(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + autoMixedPrecision_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for CUDA/oneDNN (default is OFF).
    +     * This will try to use float16 on GPU/CPU which is faster.
    +     * Note that this can change the numerical stability of the graph and may
    +     * require the use of loss scaling to maintain model convergence.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return This builder for chaining. + */ + public Builder clearAutoMixedPrecision() { + bitField0_ = (bitField0_ & ~0x00008000); + autoMixedPrecision_ = 0; + onChanged(); + return this; + } + + private int autoMixedPrecisionMkl_ = 0; + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is deprecated.
    +     * It is replaced by auto_mixed_precision_onednn_bfloat16
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The enum numeric value on the wire for autoMixedPrecisionMkl. + */ + @java.lang.Override public int getAutoMixedPrecisionMklValue() { + return autoMixedPrecisionMkl_; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is deprecated.
    +     * It is replaced by auto_mixed_precision_onednn_bfloat16
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @param value The enum numeric value on the wire for autoMixedPrecisionMkl to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionMklValue(int value) { + autoMixedPrecisionMkl_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is deprecated.
    +     * It is replaced by auto_mixed_precision_onednn_bfloat16
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The autoMixedPrecisionMkl. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionMkl() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionMkl_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is deprecated.
    +     * It is replaced by auto_mixed_precision_onednn_bfloat16
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @param value The autoMixedPrecisionMkl to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionMkl(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + autoMixedPrecisionMkl_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is deprecated.
    +     * It is replaced by auto_mixed_precision_onednn_bfloat16
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return This builder for chaining. + */ + public Builder clearAutoMixedPrecisionMkl() { + bitField0_ = (bitField0_ & ~0x00010000); + autoMixedPrecisionMkl_ = 0; + onChanged(); + return this; + } + + private int autoMixedPrecisionOnednnBfloat16_ = 0; + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The enum numeric value on the wire for autoMixedPrecisionOnednnBfloat16. + */ + @java.lang.Override public int getAutoMixedPrecisionOnednnBfloat16Value() { + return autoMixedPrecisionOnednnBfloat16_; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @param value The enum numeric value on the wire for autoMixedPrecisionOnednnBfloat16 to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionOnednnBfloat16Value(int value) { + autoMixedPrecisionOnednnBfloat16_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The autoMixedPrecisionOnednnBfloat16. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionOnednnBfloat16() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionOnednnBfloat16_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @param value The autoMixedPrecisionOnednnBfloat16 to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionOnednnBfloat16(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00020000; + autoMixedPrecisionOnednnBfloat16_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Optimize data types for oneDNN (default is OFF).
    +     * This will try to use bfloat16 on CPUs, which is faster.
    +     * Note that this can change the numerical stability of the graph.
    +     * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return This builder for chaining. + */ + public Builder clearAutoMixedPrecisionOnednnBfloat16() { + bitField0_ = (bitField0_ & ~0x00020000); + autoMixedPrecisionOnednnBfloat16_ = 0; + onChanged(); + return this; + } + + private int autoMixedPrecisionCpu_ = 0; + /** + *
    +     * Emulate a model using data type float16 on CPU (default is OFF).
    +     * This will try to emulate the float16 inputs and outputs of an operator
    +     * on CPU to have better correlation with float16 on GPU; however the
    +     * computation in the operator is based on float32.
    +     * Note that this can change the numerical stability of the graph.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The enum numeric value on the wire for autoMixedPrecisionCpu. + */ + @java.lang.Override public int getAutoMixedPrecisionCpuValue() { + return autoMixedPrecisionCpu_; + } + /** + *
    +     * Emulate a model using data type float16 on CPU (default is OFF).
    +     * This will try to emulate the float16 inputs and outputs of an operator
    +     * on CPU to have better correlation with float16 on GPU; however the
    +     * computation in the operator is based on float32.
    +     * Note that this can change the numerical stability of the graph.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @param value The enum numeric value on the wire for autoMixedPrecisionCpu to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionCpuValue(int value) { + autoMixedPrecisionCpu_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + *
    +     * Emulate a model using data type float16 on CPU (default is OFF).
    +     * This will try to emulate the float16 inputs and outputs of an operator
    +     * on CPU to have better correlation with float16 on GPU; however the
    +     * computation in the operator is based on float32.
    +     * Note that this can change the numerical stability of the graph.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The autoMixedPrecisionCpu. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionCpu() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(autoMixedPrecisionCpu_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Emulate a model using data type float16 on CPU (default is OFF).
    +     * This will try to emulate the float16 inputs and outputs of an operator
    +     * on CPU to have better correlation with float16 on GPU; however the
    +     * computation in the operator is based on float32.
    +     * Note that this can change the numerical stability of the graph.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @param value The autoMixedPrecisionCpu to set. + * @return This builder for chaining. + */ + public Builder setAutoMixedPrecisionCpu(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00040000; + autoMixedPrecisionCpu_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Emulate a model using data type float16 on CPU (default is OFF).
    +     * This will try to emulate the float16 inputs and outputs of an operator
    +     * on CPU to have better correlation with float16 on GPU; however the
    +     * computation in the operator is based on float32.
    +     * Note that this can change the numerical stability of the graph.
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return This builder for chaining. + */ + public Builder clearAutoMixedPrecisionCpu() { + bitField0_ = (bitField0_ & ~0x00040000); + autoMixedPrecisionCpu_ = 0; + onChanged(); + return this; + } + + private boolean disableMetaOptimizer_ ; + /** + *
    +     * Disable the entire meta optimizer (off by default).
    +     * 
    + * + * bool disable_meta_optimizer = 19; + * @return The disableMetaOptimizer. + */ + @java.lang.Override + public boolean getDisableMetaOptimizer() { + return disableMetaOptimizer_; + } + /** + *
    +     * Disable the entire meta optimizer (off by default).
    +     * 
    + * + * bool disable_meta_optimizer = 19; + * @param value The disableMetaOptimizer to set. + * @return This builder for chaining. + */ + public Builder setDisableMetaOptimizer(boolean value) { + + disableMetaOptimizer_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + *
    +     * Disable the entire meta optimizer (off by default).
    +     * 
    + * + * bool disable_meta_optimizer = 19; + * @return This builder for chaining. + */ + public Builder clearDisableMetaOptimizer() { + bitField0_ = (bitField0_ & ~0x00080000); + disableMetaOptimizer_ = false; + onChanged(); + return this; + } + + private boolean disableTfgOptimizer_ ; + /** + *
    +     * Disable the TFG optimizer (off by default).
    +     * 
    + * + * bool disable_tfg_optimizer = 32; + * @return The disableTfgOptimizer. + */ + @java.lang.Override + public boolean getDisableTfgOptimizer() { + return disableTfgOptimizer_; + } + /** + *
    +     * Disable the TFG optimizer (off by default).
    +     * 
    + * + * bool disable_tfg_optimizer = 32; + * @param value The disableTfgOptimizer to set. + * @return This builder for chaining. + */ + public Builder setDisableTfgOptimizer(boolean value) { + + disableTfgOptimizer_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + *
    +     * Disable the TFG optimizer (off by default).
    +     * 
    + * + * bool disable_tfg_optimizer = 32; + * @return This builder for chaining. + */ + public Builder clearDisableTfgOptimizer() { + bitField0_ = (bitField0_ & ~0x00100000); + disableTfgOptimizer_ = false; + onChanged(); + return this; + } + + private int usePluginOptimizers_ = 0; + /** + *
    +     * Optimizers registered by plugin (default is ON)
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The enum numeric value on the wire for usePluginOptimizers. + */ + @java.lang.Override public int getUsePluginOptimizersValue() { + return usePluginOptimizers_; + } + /** + *
    +     * Optimizers registered by plugin (default is ON)
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @param value The enum numeric value on the wire for usePluginOptimizers to set. + * @return This builder for chaining. + */ + public Builder setUsePluginOptimizersValue(int value) { + usePluginOptimizers_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + *
    +     * Optimizers registered by plugin (default is ON)
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The usePluginOptimizers. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getUsePluginOptimizers() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(usePluginOptimizers_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Optimizers registered by plugin (default is ON)
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @param value The usePluginOptimizers to set. + * @return This builder for chaining. + */ + public Builder setUsePluginOptimizers(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00200000; + usePluginOptimizers_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Optimizers registered by plugin (default is ON)
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return This builder for chaining. + */ + public Builder clearUsePluginOptimizers() { + bitField0_ = (bitField0_ & ~0x00200000); + usePluginOptimizers_ = 0; + onChanged(); + return this; + } + + private int experimentalConditionalCodeMotion_ = 0; + /** + *
    +     * Conditional code motion (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The enum numeric value on the wire for experimentalConditionalCodeMotion. + */ + @java.lang.Override public int getExperimentalConditionalCodeMotionValue() { + return experimentalConditionalCodeMotion_; + } + /** + *
    +     * Conditional code motion (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @param value The enum numeric value on the wire for experimentalConditionalCodeMotion to set. + * @return This builder for chaining. + */ + public Builder setExperimentalConditionalCodeMotionValue(int value) { + experimentalConditionalCodeMotion_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + *
    +     * Conditional code motion (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The experimentalConditionalCodeMotion. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.Toggle getExperimentalConditionalCodeMotion() { + org.tensorflow.proto.RewriterConfig.Toggle result = org.tensorflow.proto.RewriterConfig.Toggle.forNumber(experimentalConditionalCodeMotion_); + return result == null ? org.tensorflow.proto.RewriterConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Conditional code motion (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @param value The experimentalConditionalCodeMotion to set. + * @return This builder for chaining. + */ + public Builder setExperimentalConditionalCodeMotion(org.tensorflow.proto.RewriterConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00400000; + experimentalConditionalCodeMotion_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Conditional code motion (default is ON).
    +     * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return This builder for chaining. + */ + public Builder clearExperimentalConditionalCodeMotion() { + bitField0_ = (bitField0_ & ~0x00400000); + experimentalConditionalCodeMotion_ = 0; + onChanged(); + return this; + } + + private int metaOptimizerIterations_ = 0; + /** + *
    +     * Controls how many times we run the optimizers in meta optimizer (default
    +     * is once).
    +     * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The enum numeric value on the wire for metaOptimizerIterations. + */ + @java.lang.Override public int getMetaOptimizerIterationsValue() { + return metaOptimizerIterations_; + } + /** + *
    +     * Controls how many times we run the optimizers in meta optimizer (default
    +     * is once).
    +     * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @param value The enum numeric value on the wire for metaOptimizerIterations to set. + * @return This builder for chaining. + */ + public Builder setMetaOptimizerIterationsValue(int value) { + metaOptimizerIterations_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + *
    +     * Controls how many times we run the optimizers in meta optimizer (default
    +     * is once).
    +     * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The metaOptimizerIterations. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.NumIterationsType getMetaOptimizerIterations() { + org.tensorflow.proto.RewriterConfig.NumIterationsType result = org.tensorflow.proto.RewriterConfig.NumIterationsType.forNumber(metaOptimizerIterations_); + return result == null ? org.tensorflow.proto.RewriterConfig.NumIterationsType.UNRECOGNIZED : result; + } + /** + *
    +     * Controls how many times we run the optimizers in meta optimizer (default
    +     * is once).
    +     * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @param value The metaOptimizerIterations to set. + * @return This builder for chaining. + */ + public Builder setMetaOptimizerIterations(org.tensorflow.proto.RewriterConfig.NumIterationsType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00800000; + metaOptimizerIterations_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Controls how many times we run the optimizers in meta optimizer (default
    +     * is once).
    +     * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return This builder for chaining. + */ + public Builder clearMetaOptimizerIterations() { + bitField0_ = (bitField0_ & ~0x00800000); + metaOptimizerIterations_ = 0; + onChanged(); + return this; + } + + private int minGraphNodes_ ; + /** + *
    +     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    +     * optimization is skipped.
    +     * 0 means the system picks an appropriate number.
    +     * < 0 means do not skip optimization.
    +     * 
    + * + * int32 min_graph_nodes = 17; + * @return The minGraphNodes. + */ + @java.lang.Override + public int getMinGraphNodes() { + return minGraphNodes_; + } + /** + *
    +     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    +     * optimization is skipped.
    +     * 0 means the system picks an appropriate number.
    +     * < 0 means do not skip optimization.
    +     * 
    + * + * int32 min_graph_nodes = 17; + * @param value The minGraphNodes to set. + * @return This builder for chaining. + */ + public Builder setMinGraphNodes(int value) { + + minGraphNodes_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + *
    +     * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    +     * optimization is skipped.
    +     * 0 means the system picks an appropriate number.
    +     * < 0 means do not skip optimization.
    +     * 
    + * + * int32 min_graph_nodes = 17; + * @return This builder for chaining. + */ + public Builder clearMinGraphNodes() { + bitField0_ = (bitField0_ & ~0x01000000); + minGraphNodes_ = 0; + onChanged(); + 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; + * @return The experimentalDisableCompressedTensorOptimization. + */ + @java.lang.Override + 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; + * @param value The experimentalDisableCompressedTensorOptimization to set. + * @return This builder for chaining. + */ + public Builder setExperimentalDisableCompressedTensorOptimization(boolean value) { + + experimentalDisableCompressedTensorOptimization_ = value; + bitField0_ |= 0x02000000; + 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; + * @return This builder for chaining. + */ + public Builder clearExperimentalDisableCompressedTensorOptimization() { + bitField0_ = (bitField0_ & ~0x02000000); + experimentalDisableCompressedTensorOptimization_ = false; + onChanged(); + return this; + } + + private boolean experimentalDisableFoldingQuantizationEmulation_ ; + /** + *
    +     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    +     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    +     * have to extract quantization configs (e.g. min/max range, number of bits,
    +     * and per-channel) from the quantization emulation ops. Note that this flag
    +     * is experimental and may be removed in the future. See b/174138564 for more
    +     * details.
    +     * 
    + * + * bool experimental_disable_folding_quantization_emulation = 27; + * @return The experimentalDisableFoldingQuantizationEmulation. + */ + @java.lang.Override + public boolean getExperimentalDisableFoldingQuantizationEmulation() { + return experimentalDisableFoldingQuantizationEmulation_; + } + /** + *
    +     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    +     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    +     * have to extract quantization configs (e.g. min/max range, number of bits,
    +     * and per-channel) from the quantization emulation ops. Note that this flag
    +     * is experimental and may be removed in the future. See b/174138564 for more
    +     * details.
    +     * 
    + * + * bool experimental_disable_folding_quantization_emulation = 27; + * @param value The experimentalDisableFoldingQuantizationEmulation to set. + * @return This builder for chaining. + */ + public Builder setExperimentalDisableFoldingQuantizationEmulation(boolean value) { + + experimentalDisableFoldingQuantizationEmulation_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + *
    +     * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    +     * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    +     * have to extract quantization configs (e.g. min/max range, number of bits,
    +     * and per-channel) from the quantization emulation ops. Note that this flag
    +     * is experimental and may be removed in the future. See b/174138564 for more
    +     * details.
    +     * 
    + * + * bool experimental_disable_folding_quantization_emulation = 27; + * @return This builder for chaining. + */ + public Builder clearExperimentalDisableFoldingQuantizationEmulation() { + bitField0_ = (bitField0_ & ~0x04000000); + experimentalDisableFoldingQuantizationEmulation_ = false; + onChanged(); + return this; + } + + private int memoryOptimization_ = 0; + /** + *
    +     * Configures memory optimization passes through the meta-optimizer. Has no
    +     * effect on manually requested memory optimization passes in the optimizers
    +     * field.
    +     * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The enum numeric value on the wire for memoryOptimization. + */ + @java.lang.Override public int getMemoryOptimizationValue() { + return memoryOptimization_; + } + /** + *
    +     * Configures memory optimization passes through the meta-optimizer. Has no
    +     * effect on manually requested memory optimization passes in the optimizers
    +     * field.
    +     * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @param value The enum numeric value on the wire for memoryOptimization to set. + * @return This builder for chaining. + */ + public Builder setMemoryOptimizationValue(int value) { + memoryOptimization_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + *
    +     * Configures memory optimization passes through the meta-optimizer. Has no
    +     * effect on manually requested memory optimization passes in the optimizers
    +     * field.
    +     * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The memoryOptimization. + */ + @java.lang.Override + public org.tensorflow.proto.RewriterConfig.MemOptType getMemoryOptimization() { + org.tensorflow.proto.RewriterConfig.MemOptType result = org.tensorflow.proto.RewriterConfig.MemOptType.forNumber(memoryOptimization_); + return result == null ? org.tensorflow.proto.RewriterConfig.MemOptType.UNRECOGNIZED : result; + } + /** + *
    +     * Configures memory optimization passes through the meta-optimizer. Has no
    +     * effect on manually requested memory optimization passes in the optimizers
    +     * field.
    +     * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @param value The memoryOptimization to set. + * @return This builder for chaining. + */ + public Builder setMemoryOptimization(org.tensorflow.proto.RewriterConfig.MemOptType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x08000000; + memoryOptimization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Configures memory optimization passes through the meta-optimizer. Has no
    +     * effect on manually requested memory optimization passes in the optimizers
    +     * field.
    +     * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return This builder for chaining. + */ + public Builder clearMemoryOptimization() { + bitField0_ = (bitField0_ & ~0x08000000); + memoryOptimization_ = 0; + onChanged(); + return this; + } + + private java.lang.Object memoryOptimizerTargetNodeNameScope_ = ""; + /** + *
    +     * A node name scope for node names which are valid outputs of recomputations.
    +     * Inputs to nodes that match this scope may be recomputed (subject either to
    +     * manual annotation of those input nodes or to manual annotation and
    +     * heuristics depending on memory_optimization), but the nodes themselves will
    +     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +     * can appear not just as a top-level scope. For example, if the value is
    +     * "gradients/", the default, it will match node name "gradients/foo",
    +     * "foo/gradients/bar", but not "foo_gradients/"
    +     * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The memoryOptimizerTargetNodeNameScope. + */ + public java.lang.String getMemoryOptimizerTargetNodeNameScope() { + java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + memoryOptimizerTargetNodeNameScope_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A node name scope for node names which are valid outputs of recomputations.
    +     * Inputs to nodes that match this scope may be recomputed (subject either to
    +     * manual annotation of those input nodes or to manual annotation and
    +     * heuristics depending on memory_optimization), but the nodes themselves will
    +     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +     * can appear not just as a top-level scope. For example, if the value is
    +     * "gradients/", the default, it will match node name "gradients/foo",
    +     * "foo/gradients/bar", but not "foo_gradients/"
    +     * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The bytes for memoryOptimizerTargetNodeNameScope. + */ + public com.google.protobuf.ByteString + getMemoryOptimizerTargetNodeNameScopeBytes() { + java.lang.Object ref = memoryOptimizerTargetNodeNameScope_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + memoryOptimizerTargetNodeNameScope_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A node name scope for node names which are valid outputs of recomputations.
    +     * Inputs to nodes that match this scope may be recomputed (subject either to
    +     * manual annotation of those input nodes or to manual annotation and
    +     * heuristics depending on memory_optimization), but the nodes themselves will
    +     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +     * can appear not just as a top-level scope. For example, if the value is
    +     * "gradients/", the default, it will match node name "gradients/foo",
    +     * "foo/gradients/bar", but not "foo_gradients/"
    +     * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @param value The memoryOptimizerTargetNodeNameScope to set. + * @return This builder for chaining. + */ + public Builder setMemoryOptimizerTargetNodeNameScope( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + memoryOptimizerTargetNodeNameScope_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + /** + *
    +     * A node name scope for node names which are valid outputs of recomputations.
    +     * Inputs to nodes that match this scope may be recomputed (subject either to
    +     * manual annotation of those input nodes or to manual annotation and
    +     * heuristics depending on memory_optimization), but the nodes themselves will
    +     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +     * can appear not just as a top-level scope. For example, if the value is
    +     * "gradients/", the default, it will match node name "gradients/foo",
    +     * "foo/gradients/bar", but not "foo_gradients/"
    +     * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return This builder for chaining. + */ + public Builder clearMemoryOptimizerTargetNodeNameScope() { + memoryOptimizerTargetNodeNameScope_ = getDefaultInstance().getMemoryOptimizerTargetNodeNameScope(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + return this; + } + /** + *
    +     * A node name scope for node names which are valid outputs of recomputations.
    +     * Inputs to nodes that match this scope may be recomputed (subject either to
    +     * manual annotation of those input nodes or to manual annotation and
    +     * heuristics depending on memory_optimization), but the nodes themselves will
    +     * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +     * can appear not just as a top-level scope. For example, if the value is
    +     * "gradients/", the default, it will match node name "gradients/foo",
    +     * "foo/gradients/bar", but not "foo_gradients/"
    +     * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @param value The bytes for memoryOptimizerTargetNodeNameScope to set. + * @return This builder for chaining. + */ + public Builder setMemoryOptimizerTargetNodeNameScopeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + memoryOptimizerTargetNodeNameScope_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + private long metaOptimizerTimeoutMs_ ; + /** + *
    +     * Maximum number of milliseconds to spend optimizing a single graph before
    +     * timing out. If less than or equal to 0 (default value) the optimizer will
    +     * never time out.
    +     * 
    + * + * int64 meta_optimizer_timeout_ms = 20; + * @return The metaOptimizerTimeoutMs. + */ + @java.lang.Override + public long getMetaOptimizerTimeoutMs() { + return metaOptimizerTimeoutMs_; + } + /** + *
    +     * Maximum number of milliseconds to spend optimizing a single graph before
    +     * timing out. If less than or equal to 0 (default value) the optimizer will
    +     * never time out.
    +     * 
    + * + * int64 meta_optimizer_timeout_ms = 20; + * @param value The metaOptimizerTimeoutMs to set. + * @return This builder for chaining. + */ + public Builder setMetaOptimizerTimeoutMs(long value) { + + metaOptimizerTimeoutMs_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + /** + *
    +     * Maximum number of milliseconds to spend optimizing a single graph before
    +     * timing out. If less than or equal to 0 (default value) the optimizer will
    +     * never time out.
    +     * 
    + * + * int64 meta_optimizer_timeout_ms = 20; + * @return This builder for chaining. + */ + public Builder clearMetaOptimizerTimeoutMs() { + bitField0_ = (bitField0_ & ~0x20000000); + metaOptimizerTimeoutMs_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.AutoParallelOptions autoParallel_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AutoParallelOptions, org.tensorflow.proto.AutoParallelOptions.Builder, org.tensorflow.proto.AutoParallelOptionsOrBuilder> autoParallelBuilder_; + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return Whether the autoParallel field is set. + */ + public boolean hasAutoParallel() { + return ((bitField0_ & 0x40000000) != 0); + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return The autoParallel. + */ + public org.tensorflow.proto.AutoParallelOptions getAutoParallel() { + if (autoParallelBuilder_ == null) { + return autoParallel_ == null ? org.tensorflow.proto.AutoParallelOptions.getDefaultInstance() : autoParallel_; + } else { + return autoParallelBuilder_.getMessage(); + } + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public Builder setAutoParallel(org.tensorflow.proto.AutoParallelOptions value) { + if (autoParallelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autoParallel_ = value; + } else { + autoParallelBuilder_.setMessage(value); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public Builder setAutoParallel( + org.tensorflow.proto.AutoParallelOptions.Builder builderForValue) { + if (autoParallelBuilder_ == null) { + autoParallel_ = builderForValue.build(); + } else { + autoParallelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public Builder mergeAutoParallel(org.tensorflow.proto.AutoParallelOptions value) { + if (autoParallelBuilder_ == null) { + if (((bitField0_ & 0x40000000) != 0) && + autoParallel_ != null && + autoParallel_ != org.tensorflow.proto.AutoParallelOptions.getDefaultInstance()) { + getAutoParallelBuilder().mergeFrom(value); + } else { + autoParallel_ = value; + } + } else { + autoParallelBuilder_.mergeFrom(value); + } + if (autoParallel_ != null) { + bitField0_ |= 0x40000000; + onChanged(); + } + return this; + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public Builder clearAutoParallel() { + bitField0_ = (bitField0_ & ~0x40000000); + autoParallel_ = null; + if (autoParallelBuilder_ != null) { + autoParallelBuilder_.dispose(); + autoParallelBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public org.tensorflow.proto.AutoParallelOptions.Builder getAutoParallelBuilder() { + bitField0_ |= 0x40000000; + onChanged(); + return getAutoParallelFieldBuilder().getBuilder(); + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + public org.tensorflow.proto.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() { + if (autoParallelBuilder_ != null) { + return autoParallelBuilder_.getMessageOrBuilder(); + } else { + return autoParallel_ == null ? + org.tensorflow.proto.AutoParallelOptions.getDefaultInstance() : autoParallel_; + } + } + /** + *
    +     * Configures AutoParallel optimization passes either through the
    +     * meta-optimizer or when manually specified through the optimizers field.
    +     * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AutoParallelOptions, org.tensorflow.proto.AutoParallelOptions.Builder, org.tensorflow.proto.AutoParallelOptionsOrBuilder> + getAutoParallelFieldBuilder() { + if (autoParallelBuilder_ == null) { + autoParallelBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AutoParallelOptions, org.tensorflow.proto.AutoParallelOptions.Builder, org.tensorflow.proto.AutoParallelOptionsOrBuilder>( + getAutoParallel(), + getParentForChildren(), + isClean()); + autoParallel_ = null; + } + return autoParallelBuilder_; + } + + private boolean failOnOptimizerErrors_ ; + /** + *
    +     * If true, any optimization pass failing will cause the MetaOptimizer to
    +     * stop with an error. By default - or when set to false, failing passes are
    +     * skipped silently.
    +     * 
    + * + * bool fail_on_optimizer_errors = 21; + * @return The failOnOptimizerErrors. + */ + @java.lang.Override + public boolean getFailOnOptimizerErrors() { + return failOnOptimizerErrors_; + } + /** + *
    +     * If true, any optimization pass failing will cause the MetaOptimizer to
    +     * stop with an error. By default - or when set to false, failing passes are
    +     * skipped silently.
    +     * 
    + * + * bool fail_on_optimizer_errors = 21; + * @param value The failOnOptimizerErrors to set. + * @return This builder for chaining. + */ + public Builder setFailOnOptimizerErrors(boolean value) { + + failOnOptimizerErrors_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + *
    +     * If true, any optimization pass failing will cause the MetaOptimizer to
    +     * stop with an error. By default - or when set to false, failing passes are
    +     * skipped silently.
    +     * 
    + * + * bool fail_on_optimizer_errors = 21; + * @return This builder for chaining. + */ + public Builder clearFailOnOptimizerErrors() { + bitField0_ = (bitField0_ & ~0x80000000); + failOnOptimizerErrors_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.ScopedAllocatorOptions scopedAllocatorOpts_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ScopedAllocatorOptions, org.tensorflow.proto.ScopedAllocatorOptions.Builder, org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder> scopedAllocatorOptsBuilder_; + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return Whether the scopedAllocatorOpts field is set. + */ + public boolean hasScopedAllocatorOpts() { + return ((bitField1_ & 0x00000001) != 0); + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return The scopedAllocatorOpts. + */ + public org.tensorflow.proto.ScopedAllocatorOptions getScopedAllocatorOpts() { + if (scopedAllocatorOptsBuilder_ == null) { + return scopedAllocatorOpts_ == null ? org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; + } else { + return scopedAllocatorOptsBuilder_.getMessage(); + } + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public Builder setScopedAllocatorOpts(org.tensorflow.proto.ScopedAllocatorOptions value) { + if (scopedAllocatorOptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scopedAllocatorOpts_ = value; + } else { + scopedAllocatorOptsBuilder_.setMessage(value); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public Builder setScopedAllocatorOpts( + org.tensorflow.proto.ScopedAllocatorOptions.Builder builderForValue) { + if (scopedAllocatorOptsBuilder_ == null) { + scopedAllocatorOpts_ = builderForValue.build(); + } else { + scopedAllocatorOptsBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public Builder mergeScopedAllocatorOpts(org.tensorflow.proto.ScopedAllocatorOptions value) { + if (scopedAllocatorOptsBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0) && + scopedAllocatorOpts_ != null && + scopedAllocatorOpts_ != org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance()) { + getScopedAllocatorOptsBuilder().mergeFrom(value); + } else { + scopedAllocatorOpts_ = value; + } + } else { + scopedAllocatorOptsBuilder_.mergeFrom(value); + } + if (scopedAllocatorOpts_ != null) { + bitField1_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public Builder clearScopedAllocatorOpts() { + bitField1_ = (bitField1_ & ~0x00000001); + scopedAllocatorOpts_ = null; + if (scopedAllocatorOptsBuilder_ != null) { + scopedAllocatorOptsBuilder_.dispose(); + scopedAllocatorOptsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public org.tensorflow.proto.ScopedAllocatorOptions.Builder getScopedAllocatorOptsBuilder() { + bitField1_ |= 0x00000001; + onChanged(); + return getScopedAllocatorOptsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + public org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() { + if (scopedAllocatorOptsBuilder_ != null) { + return scopedAllocatorOptsBuilder_.getMessageOrBuilder(); + } else { + return scopedAllocatorOpts_ == null ? + org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_; + } + } + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ScopedAllocatorOptions, org.tensorflow.proto.ScopedAllocatorOptions.Builder, org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder> + getScopedAllocatorOptsFieldBuilder() { + if (scopedAllocatorOptsBuilder_ == null) { + scopedAllocatorOptsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ScopedAllocatorOptions, org.tensorflow.proto.ScopedAllocatorOptions.Builder, org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder>( + getScopedAllocatorOpts(), + getParentForChildren(), + isClean()); + scopedAllocatorOpts_ = null; + } + return scopedAllocatorOptsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList optimizers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureOptimizersIsMutable() { + if (!optimizers_.isModifiable()) { + optimizers_ = new com.google.protobuf.LazyStringArrayList(optimizers_); + } + bitField1_ |= 0x00000002; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @return A list containing the optimizers. + */ + public com.google.protobuf.ProtocolStringList + getOptimizersList() { + optimizers_.makeImmutable(); + return optimizers_; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @return The count of optimizers. + */ + public int getOptimizersCount() { + return optimizers_.size(); + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param index The index of the element to return. + * @return The optimizers at the given index. + */ + public java.lang.String getOptimizers(int index) { + return optimizers_.get(index); + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param index The index of the value to return. + * @return The bytes of the optimizers at the given index. + */ + public com.google.protobuf.ByteString + getOptimizersBytes(int index) { + return optimizers_.getByteString(index); + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param index The index to set the value at. + * @param value The optimizers to set. + * @return This builder for chaining. + */ + public Builder setOptimizers( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOptimizersIsMutable(); + optimizers_.set(index, value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param value The optimizers to add. + * @return This builder for chaining. + */ + public Builder addOptimizers( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOptimizersIsMutable(); + optimizers_.add(value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param values The optimizers to add. + * @return This builder for chaining. + */ + public Builder addAllOptimizers( + java.lang.Iterable values) { + ensureOptimizersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, optimizers_); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @return This builder for chaining. + */ + public Builder clearOptimizers() { + optimizers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +     * If non-empty, will use this as an alternative way to specify a list of
    +     * optimizations to turn on and the order of the optimizations (replacing the
    +     * meta-optimizer).
    +     *
    +     * Of the RewriterConfig options, only the AutoParallel configuration options
    +     * (the auto_parallel field) apply to manually requested optimization passes
    +     * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +     * not configurable (in contrast to memory optimization passes through the
    +     * meta-optimizer) and act only on manual op annotations.
    +     *
    +     * Custom optimizers (see custom_optimizers) that are not part of this
    +     * schedule will be run after - in the order that they were specified.
    +     * 
    + * + * repeated string optimizers = 100; + * @param value The bytes of the optimizers to add. + * @return This builder for chaining. + */ + public Builder addOptimizersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureOptimizersIsMutable(); + optimizers_.add(value); + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List customOptimizers_ = + java.util.Collections.emptyList(); + private void ensureCustomOptimizersIsMutable() { + if (!((bitField1_ & 0x00000004) != 0)) { + customOptimizers_ = new java.util.ArrayList(customOptimizers_); + bitField1_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder> customOptimizersBuilder_; + + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public java.util.List getCustomOptimizersList() { + if (customOptimizersBuilder_ == null) { + return java.util.Collections.unmodifiableList(customOptimizers_); + } else { + return customOptimizersBuilder_.getMessageList(); + } + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public int getCustomOptimizersCount() { + if (customOptimizersBuilder_ == null) { + return customOptimizers_.size(); + } else { + return customOptimizersBuilder_.getCount(); + } + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) { + if (customOptimizersBuilder_ == null) { + return customOptimizers_.get(index); + } else { + return customOptimizersBuilder_.getMessage(index); + } + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder setCustomOptimizers( + int index, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer value) { + if (customOptimizersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomOptimizersIsMutable(); + customOptimizers_.set(index, value); + onChanged(); + } else { + customOptimizersBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder setCustomOptimizers( + int index, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + customOptimizers_.set(index, builderForValue.build()); + onChanged(); + } else { + customOptimizersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder addCustomOptimizers(org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer value) { + if (customOptimizersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomOptimizersIsMutable(); + customOptimizers_.add(value); + onChanged(); + } else { + customOptimizersBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder addCustomOptimizers( + int index, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer value) { + if (customOptimizersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomOptimizersIsMutable(); + customOptimizers_.add(index, value); + onChanged(); + } else { + customOptimizersBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder addCustomOptimizers( + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + customOptimizers_.add(builderForValue.build()); + onChanged(); + } else { + customOptimizersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder addCustomOptimizers( + int index, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) { + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + customOptimizers_.add(index, builderForValue.build()); + onChanged(); + } else { + customOptimizersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder addAllCustomOptimizers( + java.lang.Iterable values) { + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customOptimizers_); + onChanged(); + } else { + customOptimizersBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder clearCustomOptimizers() { + if (customOptimizersBuilder_ == null) { + customOptimizers_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000004); + onChanged(); + } else { + customOptimizersBuilder_.clear(); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public Builder removeCustomOptimizers(int index) { + if (customOptimizersBuilder_ == null) { + ensureCustomOptimizersIsMutable(); + customOptimizers_.remove(index); + onChanged(); + } else { + customOptimizersBuilder_.remove(index); + } + return this; + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder getCustomOptimizersBuilder( + int index) { + return getCustomOptimizersFieldBuilder().getBuilder(index); + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( + int index) { + if (customOptimizersBuilder_ == null) { + return customOptimizers_.get(index); } else { + return customOptimizersBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public java.util.List + getCustomOptimizersOrBuilderList() { + if (customOptimizersBuilder_ != null) { + return customOptimizersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customOptimizers_); + } + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder() { + return getCustomOptimizersFieldBuilder().addBuilder( + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()); + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder( + int index) { + return getCustomOptimizersFieldBuilder().addBuilder( + index, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()); + } + /** + *
    +     * list of CustomGraphOptimizers to apply.
    +     * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + public java.util.List + getCustomOptimizersBuilderList() { + return getCustomOptimizersFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder> + getCustomOptimizersFieldBuilder() { + if (customOptimizersBuilder_ == null) { + customOptimizersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder>( + customOptimizers_, + ((bitField1_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + customOptimizers_ = null; + } + return customOptimizersBuilder_; + } + + private org.tensorflow.proto.VerifierConfig interOptimizerVerifierConfig_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder> interOptimizerVerifierConfigBuilder_; + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return Whether the interOptimizerVerifierConfig field is set. + */ + public boolean hasInterOptimizerVerifierConfig() { + return ((bitField1_ & 0x00000008) != 0); + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return The interOptimizerVerifierConfig. + */ + public org.tensorflow.proto.VerifierConfig getInterOptimizerVerifierConfig() { + if (interOptimizerVerifierConfigBuilder_ == null) { + return interOptimizerVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; + } else { + return interOptimizerVerifierConfigBuilder_.getMessage(); + } + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public Builder setInterOptimizerVerifierConfig(org.tensorflow.proto.VerifierConfig value) { + if (interOptimizerVerifierConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + interOptimizerVerifierConfig_ = value; + } else { + interOptimizerVerifierConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public Builder setInterOptimizerVerifierConfig( + org.tensorflow.proto.VerifierConfig.Builder builderForValue) { + if (interOptimizerVerifierConfigBuilder_ == null) { + interOptimizerVerifierConfig_ = builderForValue.build(); + } else { + interOptimizerVerifierConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public Builder mergeInterOptimizerVerifierConfig(org.tensorflow.proto.VerifierConfig value) { + if (interOptimizerVerifierConfigBuilder_ == null) { + if (((bitField1_ & 0x00000008) != 0) && + interOptimizerVerifierConfig_ != null && + interOptimizerVerifierConfig_ != org.tensorflow.proto.VerifierConfig.getDefaultInstance()) { + getInterOptimizerVerifierConfigBuilder().mergeFrom(value); + } else { + interOptimizerVerifierConfig_ = value; + } + } else { + interOptimizerVerifierConfigBuilder_.mergeFrom(value); + } + if (interOptimizerVerifierConfig_ != null) { + bitField1_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public Builder clearInterOptimizerVerifierConfig() { + bitField1_ = (bitField1_ & ~0x00000008); + interOptimizerVerifierConfig_ = null; + if (interOptimizerVerifierConfigBuilder_ != null) { + interOptimizerVerifierConfigBuilder_.dispose(); + interOptimizerVerifierConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public org.tensorflow.proto.VerifierConfig.Builder getInterOptimizerVerifierConfigBuilder() { + bitField1_ |= 0x00000008; + onChanged(); + return getInterOptimizerVerifierConfigFieldBuilder().getBuilder(); + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + public org.tensorflow.proto.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder() { + if (interOptimizerVerifierConfigBuilder_ != null) { + return interOptimizerVerifierConfigBuilder_.getMessageOrBuilder(); + } else { + return interOptimizerVerifierConfig_ == null ? + org.tensorflow.proto.VerifierConfig.getDefaultInstance() : interOptimizerVerifierConfig_; + } + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run after every optimizer.
    +     * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder> + getInterOptimizerVerifierConfigFieldBuilder() { + if (interOptimizerVerifierConfigBuilder_ == null) { + interOptimizerVerifierConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder>( + getInterOptimizerVerifierConfig(), + getParentForChildren(), + isClean()); + interOptimizerVerifierConfig_ = null; + } + return interOptimizerVerifierConfigBuilder_; + } + + private org.tensorflow.proto.VerifierConfig postOptimizationVerifierConfig_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder> postOptimizationVerifierConfigBuilder_; + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return Whether the postOptimizationVerifierConfig field is set. + */ + public boolean hasPostOptimizationVerifierConfig() { + return ((bitField1_ & 0x00000010) != 0); + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return The postOptimizationVerifierConfig. + */ + public org.tensorflow.proto.VerifierConfig getPostOptimizationVerifierConfig() { + if (postOptimizationVerifierConfigBuilder_ == null) { + return postOptimizationVerifierConfig_ == null ? org.tensorflow.proto.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; + } else { + return postOptimizationVerifierConfigBuilder_.getMessage(); + } + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public Builder setPostOptimizationVerifierConfig(org.tensorflow.proto.VerifierConfig value) { + if (postOptimizationVerifierConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postOptimizationVerifierConfig_ = value; + } else { + postOptimizationVerifierConfigBuilder_.setMessage(value); + } + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public Builder setPostOptimizationVerifierConfig( + org.tensorflow.proto.VerifierConfig.Builder builderForValue) { + if (postOptimizationVerifierConfigBuilder_ == null) { + postOptimizationVerifierConfig_ = builderForValue.build(); + } else { + postOptimizationVerifierConfigBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public Builder mergePostOptimizationVerifierConfig(org.tensorflow.proto.VerifierConfig value) { + if (postOptimizationVerifierConfigBuilder_ == null) { + if (((bitField1_ & 0x00000010) != 0) && + postOptimizationVerifierConfig_ != null && + postOptimizationVerifierConfig_ != org.tensorflow.proto.VerifierConfig.getDefaultInstance()) { + getPostOptimizationVerifierConfigBuilder().mergeFrom(value); + } else { + postOptimizationVerifierConfig_ = value; + } + } else { + postOptimizationVerifierConfigBuilder_.mergeFrom(value); + } + if (postOptimizationVerifierConfig_ != null) { + bitField1_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public Builder clearPostOptimizationVerifierConfig() { + bitField1_ = (bitField1_ & ~0x00000010); + postOptimizationVerifierConfig_ = null; + if (postOptimizationVerifierConfigBuilder_ != null) { + postOptimizationVerifierConfigBuilder_.dispose(); + postOptimizationVerifierConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public org.tensorflow.proto.VerifierConfig.Builder getPostOptimizationVerifierConfigBuilder() { + bitField1_ |= 0x00000010; + onChanged(); + return getPostOptimizationVerifierConfigFieldBuilder().getBuilder(); + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + public org.tensorflow.proto.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder() { + if (postOptimizationVerifierConfigBuilder_ != null) { + return postOptimizationVerifierConfigBuilder_.getMessageOrBuilder(); + } else { + return postOptimizationVerifierConfig_ == null ? + org.tensorflow.proto.VerifierConfig.getDefaultInstance() : postOptimizationVerifierConfig_; + } + } + /** + *
    +     * VerifierConfig specifying the verifiers to be run at the end, after all
    +     * optimizers have run.
    +     * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder> + getPostOptimizationVerifierConfigFieldBuilder() { + if (postOptimizationVerifierConfigBuilder_ == null) { + postOptimizationVerifierConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VerifierConfig, org.tensorflow.proto.VerifierConfig.Builder, org.tensorflow.proto.VerifierConfigOrBuilder>( + getPostOptimizationVerifierConfig(), + getParentForChildren(), + isClean()); + postOptimizationVerifierConfig_ = null; + } + return postOptimizationVerifierConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RewriterConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig) + private static final org.tensorflow.proto.RewriterConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RewriterConfig(); + } + + public static org.tensorflow.proto.RewriterConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RewriterConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RewriterConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigOrBuilder.java new file mode 100644 index 00000000000..b7e13584dda --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigOrBuilder.java @@ -0,0 +1,841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +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; + * @return The enum numeric value on the wire for cpuLayoutConversion. + */ + int getCpuLayoutConversionValue(); + /** + *
    +   * CPU Conversion settings between NHCW and NCHW.
    +   * 
    + * + * .tensorflow.RewriterConfig.CpuLayout cpu_layout_conversion = 50; + * @return The cpuLayoutConversion. + */ + org.tensorflow.proto.RewriterConfig.CpuLayout getCpuLayoutConversion(); + + /** + *
    +   * Optimize tensor layouts (default is ON)
    +   * e.g. This will try to use NCHW layout on GPU which is faster.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The enum numeric value on the wire for layoutOptimizer. + */ + int getLayoutOptimizerValue(); + /** + *
    +   * Optimize tensor layouts (default is ON)
    +   * e.g. This will try to use NCHW layout on GPU which is faster.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle layout_optimizer = 1; + * @return The layoutOptimizer. + */ + org.tensorflow.proto.RewriterConfig.Toggle getLayoutOptimizer(); + + /** + *
    +   * Fold constants (default is ON)
    +   * Statically infer the value of tensors when possible, and materialize the
    +   * result using constants.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The enum numeric value on the wire for constantFolding. + */ + int getConstantFoldingValue(); + /** + *
    +   * Fold constants (default is ON)
    +   * Statically infer the value of tensors when possible, and materialize the
    +   * result using constants.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle constant_folding = 3; + * @return The constantFolding. + */ + org.tensorflow.proto.RewriterConfig.Toggle getConstantFolding(); + + /** + *
    +   * Shape optimizations (default is ON)
    +   * Simplify computations made on shapes.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The enum numeric value on the wire for shapeOptimization. + */ + int getShapeOptimizationValue(); + /** + *
    +   * Shape optimizations (default is ON)
    +   * Simplify computations made on shapes.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle shape_optimization = 13; + * @return The shapeOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getShapeOptimization(); + + /** + *
    +   * Remapping (default is ON)
    +   * Remap subgraphs onto more efficient implementations.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The enum numeric value on the wire for remapping. + */ + int getRemappingValue(); + /** + *
    +   * Remapping (default is ON)
    +   * Remap subgraphs onto more efficient implementations.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle remapping = 14; + * @return The remapping. + */ + org.tensorflow.proto.RewriterConfig.Toggle getRemapping(); + + /** + *
    +   * Common subgraph elimination (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The enum numeric value on the wire for commonSubgraphElimination. + */ + int getCommonSubgraphEliminationValue(); + /** + *
    +   * Common subgraph elimination (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle common_subgraph_elimination = 24; + * @return The commonSubgraphElimination. + */ + org.tensorflow.proto.RewriterConfig.Toggle getCommonSubgraphElimination(); + + /** + *
    +   * Arithmetic optimizations (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The enum numeric value on the wire for arithmeticOptimization. + */ + int getArithmeticOptimizationValue(); + /** + *
    +   * Arithmetic optimizations (default is ON)
    +   * e.g. Simplify arithmetic ops; merge ops with same value (like constants).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7; + * @return The arithmeticOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getArithmeticOptimization(); + + /** + *
    +   * Control dependency optimizations (default is ON).
    +   * Remove redundant control dependencies, which may enable other optimization.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The enum numeric value on the wire for dependencyOptimization. + */ + int getDependencyOptimizationValue(); + /** + *
    +   * Control dependency optimizations (default is ON).
    +   * Remove redundant control dependencies, which may enable other optimization.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle dependency_optimization = 8; + * @return The dependencyOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getDependencyOptimization(); + + /** + *
    +   * Loop optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The enum numeric value on the wire for loopOptimization. + */ + int getLoopOptimizationValue(); + /** + *
    +   * Loop optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle loop_optimization = 9; + * @return The loopOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getLoopOptimization(); + + /** + *
    +   * Function optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The enum numeric value on the wire for functionOptimization. + */ + int getFunctionOptimizationValue(); + /** + *
    +   * Function optimizations (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle function_optimization = 10; + * @return The functionOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getFunctionOptimization(); + + /** + *
    +   * Strips debug-related nodes from the graph (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The enum numeric value on the wire for debugStripper. + */ + int getDebugStripperValue(); + /** + *
    +   * Strips debug-related nodes from the graph (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle debug_stripper = 11; + * @return The debugStripper. + */ + org.tensorflow.proto.RewriterConfig.Toggle getDebugStripper(); + + /** + *
    +   * If true, don't remove unnecessary ops from the graph
    +   * 
    + * + * bool disable_model_pruning = 2; + * @return The disableModelPruning. + */ + boolean getDisableModelPruning(); + + /** + *
    +   * Try to allocate some independent Op outputs contiguously in order to
    +   * merge or eliminate downstream Ops (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The enum numeric value on the wire for scopedAllocatorOptimization. + */ + int getScopedAllocatorOptimizationValue(); + /** + *
    +   * Try to allocate some independent Op outputs contiguously in order to
    +   * merge or eliminate downstream Ops (off by default).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15; + * @return The scopedAllocatorOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getScopedAllocatorOptimization(); + + /** + *
    +   * Force small ops onto the CPU (default is OFF).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The enum numeric value on the wire for pinToHostOptimization. + */ + int getPinToHostOptimizationValue(); + /** + *
    +   * Force small ops onto the CPU (default is OFF).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18; + * @return The pinToHostOptimization. + */ + org.tensorflow.proto.RewriterConfig.Toggle getPinToHostOptimization(); + + /** + *
    +   * Enable the swap of kernel implementations based on the device placement
    +   * (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The enum numeric value on the wire for implementationSelector. + */ + int getImplementationSelectorValue(); + /** + *
    +   * Enable the swap of kernel implementations based on the device placement
    +   * (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle implementation_selector = 22; + * @return The implementationSelector. + */ + org.tensorflow.proto.RewriterConfig.Toggle getImplementationSelector(); + + /** + *
    +   * Optimize data types for CUDA/oneDNN (default is OFF).
    +   * This will try to use float16 on GPU/CPU which is faster.
    +   * Note that this can change the numerical stability of the graph and may
    +   * require the use of loss scaling to maintain model convergence.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The enum numeric value on the wire for autoMixedPrecision. + */ + int getAutoMixedPrecisionValue(); + /** + *
    +   * Optimize data types for CUDA/oneDNN (default is OFF).
    +   * This will try to use float16 on GPU/CPU which is faster.
    +   * Note that this can change the numerical stability of the graph and may
    +   * require the use of loss scaling to maintain model convergence.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision = 23; + * @return The autoMixedPrecision. + */ + org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecision(); + + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is deprecated.
    +   * It is replaced by auto_mixed_precision_onednn_bfloat16
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The enum numeric value on the wire for autoMixedPrecisionMkl. + */ + int getAutoMixedPrecisionMklValue(); + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is deprecated.
    +   * It is replaced by auto_mixed_precision_onednn_bfloat16
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_mkl = 25; + * @return The autoMixedPrecisionMkl. + */ + org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionMkl(); + + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The enum numeric value on the wire for autoMixedPrecisionOnednnBfloat16. + */ + int getAutoMixedPrecisionOnednnBfloat16Value(); + /** + *
    +   * Optimize data types for oneDNN (default is OFF).
    +   * This will try to use bfloat16 on CPUs, which is faster.
    +   * Note that this can change the numerical stability of the graph.
    +   * Note: this is equivalent to the deprecated option auto_mixed_precision_mkl
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_onednn_bfloat16 = 31; + * @return The autoMixedPrecisionOnednnBfloat16. + */ + org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionOnednnBfloat16(); + + /** + *
    +   * Emulate a model using data type float16 on CPU (default is OFF).
    +   * This will try to emulate the float16 inputs and outputs of an operator
    +   * on CPU to have better correlation with float16 on GPU; however the
    +   * computation in the operator is based on float32.
    +   * Note that this can change the numerical stability of the graph.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The enum numeric value on the wire for autoMixedPrecisionCpu. + */ + int getAutoMixedPrecisionCpuValue(); + /** + *
    +   * Emulate a model using data type float16 on CPU (default is OFF).
    +   * This will try to emulate the float16 inputs and outputs of an operator
    +   * on CPU to have better correlation with float16 on GPU; however the
    +   * computation in the operator is based on float32.
    +   * Note that this can change the numerical stability of the graph.
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle auto_mixed_precision_cpu = 29; + * @return The autoMixedPrecisionCpu. + */ + org.tensorflow.proto.RewriterConfig.Toggle getAutoMixedPrecisionCpu(); + + /** + *
    +   * Disable the entire meta optimizer (off by default).
    +   * 
    + * + * bool disable_meta_optimizer = 19; + * @return The disableMetaOptimizer. + */ + boolean getDisableMetaOptimizer(); + + /** + *
    +   * Disable the TFG optimizer (off by default).
    +   * 
    + * + * bool disable_tfg_optimizer = 32; + * @return The disableTfgOptimizer. + */ + boolean getDisableTfgOptimizer(); + + /** + *
    +   * Optimizers registered by plugin (default is ON)
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The enum numeric value on the wire for usePluginOptimizers. + */ + int getUsePluginOptimizersValue(); + /** + *
    +   * Optimizers registered by plugin (default is ON)
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle use_plugin_optimizers = 28; + * @return The usePluginOptimizers. + */ + org.tensorflow.proto.RewriterConfig.Toggle getUsePluginOptimizers(); + + /** + *
    +   * Conditional code motion (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The enum numeric value on the wire for experimentalConditionalCodeMotion. + */ + int getExperimentalConditionalCodeMotionValue(); + /** + *
    +   * Conditional code motion (default is ON).
    +   * 
    + * + * .tensorflow.RewriterConfig.Toggle experimental_conditional_code_motion = 30; + * @return The experimentalConditionalCodeMotion. + */ + org.tensorflow.proto.RewriterConfig.Toggle getExperimentalConditionalCodeMotion(); + + /** + *
    +   * Controls how many times we run the optimizers in meta optimizer (default
    +   * is once).
    +   * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The enum numeric value on the wire for metaOptimizerIterations. + */ + int getMetaOptimizerIterationsValue(); + /** + *
    +   * Controls how many times we run the optimizers in meta optimizer (default
    +   * is once).
    +   * 
    + * + * .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12; + * @return The metaOptimizerIterations. + */ + org.tensorflow.proto.RewriterConfig.NumIterationsType getMetaOptimizerIterations(); + + /** + *
    +   * The minimum number of nodes in a graph to optimizer. For smaller graphs,
    +   * optimization is skipped.
    +   * 0 means the system picks an appropriate number.
    +   * < 0 means do not skip optimization.
    +   * 
    + * + * int32 min_graph_nodes = 17; + * @return The minGraphNodes. + */ + 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; + * @return The experimentalDisableCompressedTensorOptimization. + */ + boolean getExperimentalDisableCompressedTensorOptimization(); + + /** + *
    +   * Disable folding quantization emulation ops such as FakeQuantWithMinMax* and
    +   * QuantizeAndDequantize*. Some compilers (e.g. the TF-to-tflite converter)
    +   * have to extract quantization configs (e.g. min/max range, number of bits,
    +   * and per-channel) from the quantization emulation ops. Note that this flag
    +   * is experimental and may be removed in the future. See b/174138564 for more
    +   * details.
    +   * 
    + * + * bool experimental_disable_folding_quantization_emulation = 27; + * @return The experimentalDisableFoldingQuantizationEmulation. + */ + boolean getExperimentalDisableFoldingQuantizationEmulation(); + + /** + *
    +   * Configures memory optimization passes through the meta-optimizer. Has no
    +   * effect on manually requested memory optimization passes in the optimizers
    +   * field.
    +   * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The enum numeric value on the wire for memoryOptimization. + */ + int getMemoryOptimizationValue(); + /** + *
    +   * Configures memory optimization passes through the meta-optimizer. Has no
    +   * effect on manually requested memory optimization passes in the optimizers
    +   * field.
    +   * 
    + * + * .tensorflow.RewriterConfig.MemOptType memory_optimization = 4; + * @return The memoryOptimization. + */ + org.tensorflow.proto.RewriterConfig.MemOptType getMemoryOptimization(); + + /** + *
    +   * A node name scope for node names which are valid outputs of recomputations.
    +   * Inputs to nodes that match this scope may be recomputed (subject either to
    +   * manual annotation of those input nodes or to manual annotation and
    +   * heuristics depending on memory_optimization), but the nodes themselves will
    +   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +   * can appear not just as a top-level scope. For example, if the value is
    +   * "gradients/", the default, it will match node name "gradients/foo",
    +   * "foo/gradients/bar", but not "foo_gradients/"
    +   * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The memoryOptimizerTargetNodeNameScope. + */ + java.lang.String getMemoryOptimizerTargetNodeNameScope(); + /** + *
    +   * A node name scope for node names which are valid outputs of recomputations.
    +   * Inputs to nodes that match this scope may be recomputed (subject either to
    +   * manual annotation of those input nodes or to manual annotation and
    +   * heuristics depending on memory_optimization), but the nodes themselves will
    +   * not be recomputed. This matches any sub-scopes as well, meaning the scope
    +   * can appear not just as a top-level scope. For example, if the value is
    +   * "gradients/", the default, it will match node name "gradients/foo",
    +   * "foo/gradients/bar", but not "foo_gradients/"
    +   * 
    + * + * string memory_optimizer_target_node_name_scope = 6; + * @return The bytes for memoryOptimizerTargetNodeNameScope. + */ + com.google.protobuf.ByteString + getMemoryOptimizerTargetNodeNameScopeBytes(); + + /** + *
    +   * Maximum number of milliseconds to spend optimizing a single graph before
    +   * timing out. If less than or equal to 0 (default value) the optimizer will
    +   * never time out.
    +   * 
    + * + * int64 meta_optimizer_timeout_ms = 20; + * @return The metaOptimizerTimeoutMs. + */ + long getMetaOptimizerTimeoutMs(); + + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return Whether the autoParallel field is set. + */ + boolean hasAutoParallel(); + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + * @return The autoParallel. + */ + org.tensorflow.proto.AutoParallelOptions getAutoParallel(); + /** + *
    +   * Configures AutoParallel optimization passes either through the
    +   * meta-optimizer or when manually specified through the optimizers field.
    +   * 
    + * + * .tensorflow.AutoParallelOptions auto_parallel = 5; + */ + org.tensorflow.proto.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder(); + + /** + *
    +   * If true, any optimization pass failing will cause the MetaOptimizer to
    +   * stop with an error. By default - or when set to false, failing passes are
    +   * skipped silently.
    +   * 
    + * + * bool fail_on_optimizer_errors = 21; + * @return The failOnOptimizerErrors. + */ + boolean getFailOnOptimizerErrors(); + + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return Whether the scopedAllocatorOpts field is set. + */ + boolean hasScopedAllocatorOpts(); + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + * @return The scopedAllocatorOpts. + */ + org.tensorflow.proto.ScopedAllocatorOptions getScopedAllocatorOpts(); + /** + * .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16; + */ + org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder(); + + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @return A list containing the optimizers. + */ + java.util.List + getOptimizersList(); + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @return The count of optimizers. + */ + int getOptimizersCount(); + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @param index The index of the element to return. + * @return The optimizers at the given index. + */ + java.lang.String getOptimizers(int index); + /** + *
    +   * If non-empty, will use this as an alternative way to specify a list of
    +   * optimizations to turn on and the order of the optimizations (replacing the
    +   * meta-optimizer).
    +   *
    +   * Of the RewriterConfig options, only the AutoParallel configuration options
    +   * (the auto_parallel field) apply to manually requested optimization passes
    +   * ("autoparallel"). Memory optimization passes ("memory") invoked here are
    +   * not configurable (in contrast to memory optimization passes through the
    +   * meta-optimizer) and act only on manual op annotations.
    +   *
    +   * Custom optimizers (see custom_optimizers) that are not part of this
    +   * schedule will be run after - in the order that they were specified.
    +   * 
    + * + * repeated string optimizers = 100; + * @param index The index of the value to return. + * @return The bytes of the optimizers at the given index. + */ + com.google.protobuf.ByteString + getOptimizersBytes(int index); + + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + java.util.List + getCustomOptimizersList(); + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index); + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + int getCustomOptimizersCount(); + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + java.util.List + getCustomOptimizersOrBuilderList(); + /** + *
    +   * list of CustomGraphOptimizers to apply.
    +   * 
    + * + * repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200; + */ + org.tensorflow.proto.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder( + int index); + + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return Whether the interOptimizerVerifierConfig field is set. + */ + boolean hasInterOptimizerVerifierConfig(); + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + * @return The interOptimizerVerifierConfig. + */ + org.tensorflow.proto.VerifierConfig getInterOptimizerVerifierConfig(); + /** + *
    +   * VerifierConfig specifying the verifiers to be run after every optimizer.
    +   * 
    + * + * .tensorflow.VerifierConfig inter_optimizer_verifier_config = 300; + */ + org.tensorflow.proto.VerifierConfigOrBuilder getInterOptimizerVerifierConfigOrBuilder(); + + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return Whether the postOptimizationVerifierConfig field is set. + */ + boolean hasPostOptimizationVerifierConfig(); + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + * @return The postOptimizationVerifierConfig. + */ + org.tensorflow.proto.VerifierConfig getPostOptimizationVerifierConfig(); + /** + *
    +   * VerifierConfig specifying the verifiers to be run at the end, after all
    +   * optimizers have run.
    +   * 
    + * + * .tensorflow.VerifierConfig post_optimization_verifier_config = 301; + */ + org.tensorflow.proto.VerifierConfigOrBuilder getPostOptimizationVerifierConfigOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigProtos.java new file mode 100644 index 00000000000..d445dbfc551 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RewriterConfigProtos.java @@ -0,0 +1,187 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class RewriterConfigProtos { + private RewriterConfigProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RewriterConfigProtos.class.getName()); + } + 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_AutoParallelOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ScopedAllocatorOptions_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RewriterConfig_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RewriterConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_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/rewriter_conf" + + "ig.proto\022\ntensorflow\032*tensorflow/core/fr" + + "amework/attr_value.proto\032.tensorflow/cor" + + "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\026\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\022O\n$" + + "auto_mixed_precision_onednn_bfloat16\030\037 \001" + + "(\0162!.tensorflow.RewriterConfig.Toggle\022C\n" + + "\030auto_mixed_precision_cpu\030\035 \001(\0162!.tensor" + + "flow.RewriterConfig.Toggle\022\036\n\026disable_me" + + "ta_optimizer\030\023 \001(\010\022\035\n\025disable_tfg_optimi" + + "zer\030 \001(\010\022@\n\025use_plugin_optimizers\030\034 \001(\016" + + "2!.tensorflow.RewriterConfig.Toggle\022O\n$e" + + "xperimental_conditional_code_motion\030\036 \001(" + + "\0162!.tensorflow.RewriterConfig.Toggle\022O\n\031" + + "meta_optimizer_iterations\030\014 \001(\0162,.tensor" + + "flow.RewriterConfig.NumIterationsType\022\027\n" + + "\017min_graph_nodes\030\021 \001(\005\022;\n3experimental_d" + + "isable_compressed_tensor_optimization\030\032 " + + "\001(\010\022;\n3experimental_disable_folding_quan" + + "tization_emulation\030\033 \001(\010\022B\n\023memory_optim" + + "ization\030\004 \001(\0162%.tensorflow.RewriterConfi" + + "g.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(\0132" + + "\037.tensorflow.AutoParallelOptions\022 \n\030fail" + + "_on_optimizer_errors\030\025 \001(\010\022A\n\025scoped_all" + + "ocator_opts\030\020 \001(\0132\".tensorflow.ScopedAll" + + "ocatorOptions\022\022\n\noptimizers\030d \003(\t\022K\n\021cus" + + "tom_optimizers\030\310\001 \003(\0132/.tensorflow.Rewri" + + "terConfig.CustomGraphOptimizer\022D\n\037inter_" + + "optimizer_verifier_config\030\254\002 \001(\0132\032.tenso" + + "rflow.VerifierConfig\022F\n!post_optimizatio" + + "n_verifier_config\030\255\002 \001(\0132\032.tensorflow.Ve" + + "rifierConfig\032\312\001\n\024CustomGraphOptimizer\022\014\n" + + "\004name\030\001 \001(\t\022X\n\rparameter_map\030\002 \003(\0132A.ten" + + "sorflow.RewriterConfig.CustomGraphOptimi" + + "zer.ParameterMapEntry\032J\n\021ParameterMapEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensorf" + + "low.AttrValue:\0028\001\"d\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\022\025\n\021EXP" + + "ERIMENTAL_MLIR\020\004\022\025\n\021EXPERIMENTAL_BOTH\020\005\"" + + "I\n\tCpuLayout\022\030\n\024NO_CONVERSION_ON_CPU\020\000\022\020" + + "\n\014NCHW_TO_NHWC\020\001\022\020\n\014NHWC_TO_NCHW\020\002\"<\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\210\001\n\024org.tensorflow.pr" + + "otoB\024RewriterConfigProtosP\001ZUgithub.com/" + + "tensorflow/tensorflow/tensorflow/go/core" + + "/protobuf/for_core_protos_go_proto\370\001\001b\006p" + + "roto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AttrValueProtos.getDescriptor(), + org.tensorflow.proto.VerifierConfigProtos.getDescriptor(), + }); + internal_static_tensorflow_AutoParallelOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_AutoParallelOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_AutoParallelOptions_descriptor, + new java.lang.String[] { "Enable", "NumReplicas", }); + internal_static_tensorflow_ScopedAllocatorOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ScopedAllocatorOptions_descriptor, + new java.lang.String[] { "EnableOp", }); + internal_static_tensorflow_RewriterConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_RewriterConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RewriterConfig_descriptor, + new java.lang.String[] { "CpuLayoutConversion", "LayoutOptimizer", "ConstantFolding", "ShapeOptimization", "Remapping", "CommonSubgraphElimination", "ArithmeticOptimization", "DependencyOptimization", "LoopOptimization", "FunctionOptimization", "DebugStripper", "DisableModelPruning", "ScopedAllocatorOptimization", "PinToHostOptimization", "ImplementationSelector", "AutoMixedPrecision", "AutoMixedPrecisionMkl", "AutoMixedPrecisionOnednnBfloat16", "AutoMixedPrecisionCpu", "DisableMetaOptimizer", "DisableTfgOptimizer", "UsePluginOptimizers", "ExperimentalConditionalCodeMotion", "MetaOptimizerIterations", "MinGraphNodes", "ExperimentalDisableCompressedTensorOptimization", "ExperimentalDisableFoldingQuantizationEmulation", "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 + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor, + new java.lang.String[] { "Name", "ParameterMap", }); + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor = + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AttrValueProtos.getDescriptor(); + org.tensorflow.proto.VerifierConfigProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RpcOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RpcOptions.java new file mode 100644 index 00000000000..9dec7784f93 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RpcOptions.java @@ -0,0 +1,1158 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/rpc_options.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class RpcOptions { + private RpcOptions() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RpcOptions.class.getName()); + } + 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 RPCOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RPCOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * If true, always use RPC to contact the session target.
    +     *
    +     * If false (the default option), TensorFlow may use an optimized
    +     * transport for client-master communication that avoids the RPC
    +     * stack. This option is primarily for used testing the RPC stack.
    +     * 
    + * + * bool use_rpc_for_inprocess_master = 1; + * @return The useRpcForInprocessMaster. + */ + boolean getUseRpcForInprocessMaster(); + + /** + *
    +     * The compression algorithm to be used. One of "deflate", "gzip".
    +     * 
    + * + * string compression_algorithm = 2; + * @return The compressionAlgorithm. + */ + java.lang.String getCompressionAlgorithm(); + /** + *
    +     * The compression algorithm to be used. One of "deflate", "gzip".
    +     * 
    + * + * string compression_algorithm = 2; + * @return The bytes for compressionAlgorithm. + */ + com.google.protobuf.ByteString + getCompressionAlgorithmBytes(); + + /** + *
    +     * If compression_algorithm is set, the compression level to be used.
    +     * From 0 (no compression), up to 3.
    +     * 
    + * + * int32 compression_level = 3; + * @return The compressionLevel. + */ + int getCompressionLevel(); + + /** + *
    +     * Setting cache_rpc_response to true will enable sender side caching of
    +     * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    +     * requests . This is only necessary when the network fabric is experiencing a
    +     * significant error rate.  Without it we'll fail a step on an network error,
    +     * while with it we'll be able to complete long steps (like complex
    +     * initializations) in the face of some network errors during RecvTensor.
    +     * 
    + * + * bool cache_rpc_response = 4; + * @return The cacheRpcResponse. + */ + boolean getCacheRpcResponse(); + + /** + *
    +     * Disables TCP connection sharing when opening a new RPC channel.
    +     * 
    + * + * bool disable_session_connection_sharing = 5; + * @return The disableSessionConnectionSharing. + */ + boolean getDisableSessionConnectionSharing(); + + /** + *
    +     * Setting num_channels_per_target > 0 allows uses of multiple channels to
    +     * communicate to the same target. This can be used to improve the aggregate
    +     * throughput on high speed links (e.g 100G) where single connection is not
    +     * sufficient to maximize link utilization. Note that a single RPC only goes
    +     * on a single channel, this only helps in situations where there are multiple
    +     * transfers to the same target overlapping in time.
    +     * 
    + * + * int32 num_channels_per_target = 6; + * @return The numChannelsPerTarget. + */ + int getNumChannelsPerTarget(); + } + /** + *
    +   * RPC options for distributed runtime.
    +   * 
    + * + * Protobuf type {@code tensorflow.RPCOptions} + */ + public static final class RPCOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RPCOptions) + RPCOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RPCOptions.class.getName()); + } + // Use RPCOptions.newBuilder() to construct. + private RPCOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RPCOptions() { + compressionAlgorithm_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RpcOptions.internal_static_tensorflow_RPCOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RpcOptions.internal_static_tensorflow_RPCOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RpcOptions.RPCOptions.class, org.tensorflow.proto.RpcOptions.RPCOptions.Builder.class); + } + + public static final int USE_RPC_FOR_INPROCESS_MASTER_FIELD_NUMBER = 1; + private boolean useRpcForInprocessMaster_ = false; + /** + *
    +     * If true, always use RPC to contact the session target.
    +     *
    +     * If false (the default option), TensorFlow may use an optimized
    +     * transport for client-master communication that avoids the RPC
    +     * stack. This option is primarily for used testing the RPC stack.
    +     * 
    + * + * bool use_rpc_for_inprocess_master = 1; + * @return The useRpcForInprocessMaster. + */ + @java.lang.Override + public boolean getUseRpcForInprocessMaster() { + return useRpcForInprocessMaster_; + } + + public static final int COMPRESSION_ALGORITHM_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object compressionAlgorithm_ = ""; + /** + *
    +     * The compression algorithm to be used. One of "deflate", "gzip".
    +     * 
    + * + * string compression_algorithm = 2; + * @return The compressionAlgorithm. + */ + @java.lang.Override + public java.lang.String getCompressionAlgorithm() { + java.lang.Object ref = compressionAlgorithm_; + 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(); + compressionAlgorithm_ = s; + return s; + } + } + /** + *
    +     * The compression algorithm to be used. One of "deflate", "gzip".
    +     * 
    + * + * string compression_algorithm = 2; + * @return The bytes for compressionAlgorithm. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCompressionAlgorithmBytes() { + java.lang.Object ref = compressionAlgorithm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + compressionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMPRESSION_LEVEL_FIELD_NUMBER = 3; + private int compressionLevel_ = 0; + /** + *
    +     * If compression_algorithm is set, the compression level to be used.
    +     * From 0 (no compression), up to 3.
    +     * 
    + * + * int32 compression_level = 3; + * @return The compressionLevel. + */ + @java.lang.Override + public int getCompressionLevel() { + return compressionLevel_; + } + + public static final int CACHE_RPC_RESPONSE_FIELD_NUMBER = 4; + private boolean cacheRpcResponse_ = false; + /** + *
    +     * Setting cache_rpc_response to true will enable sender side caching of
    +     * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    +     * requests . This is only necessary when the network fabric is experiencing a
    +     * significant error rate.  Without it we'll fail a step on an network error,
    +     * while with it we'll be able to complete long steps (like complex
    +     * initializations) in the face of some network errors during RecvTensor.
    +     * 
    + * + * bool cache_rpc_response = 4; + * @return The cacheRpcResponse. + */ + @java.lang.Override + public boolean getCacheRpcResponse() { + return cacheRpcResponse_; + } + + public static final int DISABLE_SESSION_CONNECTION_SHARING_FIELD_NUMBER = 5; + private boolean disableSessionConnectionSharing_ = false; + /** + *
    +     * Disables TCP connection sharing when opening a new RPC channel.
    +     * 
    + * + * bool disable_session_connection_sharing = 5; + * @return The disableSessionConnectionSharing. + */ + @java.lang.Override + public boolean getDisableSessionConnectionSharing() { + return disableSessionConnectionSharing_; + } + + public static final int NUM_CHANNELS_PER_TARGET_FIELD_NUMBER = 6; + private int numChannelsPerTarget_ = 0; + /** + *
    +     * Setting num_channels_per_target > 0 allows uses of multiple channels to
    +     * communicate to the same target. This can be used to improve the aggregate
    +     * throughput on high speed links (e.g 100G) where single connection is not
    +     * sufficient to maximize link utilization. Note that a single RPC only goes
    +     * on a single channel, this only helps in situations where there are multiple
    +     * transfers to the same target overlapping in time.
    +     * 
    + * + * int32 num_channels_per_target = 6; + * @return The numChannelsPerTarget. + */ + @java.lang.Override + public int getNumChannelsPerTarget() { + return numChannelsPerTarget_; + } + + 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 (useRpcForInprocessMaster_ != false) { + output.writeBool(1, useRpcForInprocessMaster_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(compressionAlgorithm_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, compressionAlgorithm_); + } + if (compressionLevel_ != 0) { + output.writeInt32(3, compressionLevel_); + } + if (cacheRpcResponse_ != false) { + output.writeBool(4, cacheRpcResponse_); + } + if (disableSessionConnectionSharing_ != false) { + output.writeBool(5, disableSessionConnectionSharing_); + } + if (numChannelsPerTarget_ != 0) { + output.writeInt32(6, numChannelsPerTarget_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (useRpcForInprocessMaster_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, useRpcForInprocessMaster_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(compressionAlgorithm_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, compressionAlgorithm_); + } + if (compressionLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, compressionLevel_); + } + if (cacheRpcResponse_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, cacheRpcResponse_); + } + if (disableSessionConnectionSharing_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, disableSessionConnectionSharing_); + } + if (numChannelsPerTarget_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, numChannelsPerTarget_); + } + size += getUnknownFields().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.RpcOptions.RPCOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.RpcOptions.RPCOptions other = (org.tensorflow.proto.RpcOptions.RPCOptions) obj; + + if (getUseRpcForInprocessMaster() + != other.getUseRpcForInprocessMaster()) return false; + if (!getCompressionAlgorithm() + .equals(other.getCompressionAlgorithm())) return false; + if (getCompressionLevel() + != other.getCompressionLevel()) return false; + if (getCacheRpcResponse() + != other.getCacheRpcResponse()) return false; + if (getDisableSessionConnectionSharing() + != other.getDisableSessionConnectionSharing()) return false; + if (getNumChannelsPerTarget() + != other.getNumChannelsPerTarget()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + USE_RPC_FOR_INPROCESS_MASTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseRpcForInprocessMaster()); + hash = (37 * hash) + COMPRESSION_ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + getCompressionAlgorithm().hashCode(); + hash = (37 * hash) + COMPRESSION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getCompressionLevel(); + hash = (37 * hash) + CACHE_RPC_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCacheRpcResponse()); + hash = (37 * hash) + DISABLE_SESSION_CONNECTION_SHARING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDisableSessionConnectionSharing()); + hash = (37 * hash) + NUM_CHANNELS_PER_TARGET_FIELD_NUMBER; + hash = (53 * hash) + getNumChannelsPerTarget(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions 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.RpcOptions.RPCOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions 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.RpcOptions.RPCOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RpcOptions.RPCOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RpcOptions.RPCOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RpcOptions.RPCOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RpcOptions.RPCOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * RPC options for distributed runtime.
    +     * 
    + * + * Protobuf type {@code tensorflow.RPCOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RPCOptions) + org.tensorflow.proto.RpcOptions.RPCOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RpcOptions.internal_static_tensorflow_RPCOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RpcOptions.internal_static_tensorflow_RPCOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RpcOptions.RPCOptions.class, org.tensorflow.proto.RpcOptions.RPCOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.RpcOptions.RPCOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + useRpcForInprocessMaster_ = false; + compressionAlgorithm_ = ""; + compressionLevel_ = 0; + cacheRpcResponse_ = false; + disableSessionConnectionSharing_ = false; + numChannelsPerTarget_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.RpcOptions.internal_static_tensorflow_RPCOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RpcOptions.RPCOptions getDefaultInstanceForType() { + return org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RpcOptions.RPCOptions build() { + org.tensorflow.proto.RpcOptions.RPCOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RpcOptions.RPCOptions buildPartial() { + org.tensorflow.proto.RpcOptions.RPCOptions result = new org.tensorflow.proto.RpcOptions.RPCOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RpcOptions.RPCOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.useRpcForInprocessMaster_ = useRpcForInprocessMaster_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.compressionAlgorithm_ = compressionAlgorithm_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.compressionLevel_ = compressionLevel_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cacheRpcResponse_ = cacheRpcResponse_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disableSessionConnectionSharing_ = disableSessionConnectionSharing_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.numChannelsPerTarget_ = numChannelsPerTarget_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RpcOptions.RPCOptions) { + return mergeFrom((org.tensorflow.proto.RpcOptions.RPCOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RpcOptions.RPCOptions other) { + if (other == org.tensorflow.proto.RpcOptions.RPCOptions.getDefaultInstance()) return this; + if (other.getUseRpcForInprocessMaster() != false) { + setUseRpcForInprocessMaster(other.getUseRpcForInprocessMaster()); + } + if (!other.getCompressionAlgorithm().isEmpty()) { + compressionAlgorithm_ = other.compressionAlgorithm_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getCompressionLevel() != 0) { + setCompressionLevel(other.getCompressionLevel()); + } + if (other.getCacheRpcResponse() != false) { + setCacheRpcResponse(other.getCacheRpcResponse()); + } + if (other.getDisableSessionConnectionSharing() != false) { + setDisableSessionConnectionSharing(other.getDisableSessionConnectionSharing()); + } + if (other.getNumChannelsPerTarget() != 0) { + setNumChannelsPerTarget(other.getNumChannelsPerTarget()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + useRpcForInprocessMaster_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + compressionAlgorithm_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + compressionLevel_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + cacheRpcResponse_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + disableSessionConnectionSharing_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + numChannelsPerTarget_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean useRpcForInprocessMaster_ ; + /** + *
    +       * If true, always use RPC to contact the session target.
    +       *
    +       * If false (the default option), TensorFlow may use an optimized
    +       * transport for client-master communication that avoids the RPC
    +       * stack. This option is primarily for used testing the RPC stack.
    +       * 
    + * + * bool use_rpc_for_inprocess_master = 1; + * @return The useRpcForInprocessMaster. + */ + @java.lang.Override + public boolean getUseRpcForInprocessMaster() { + return useRpcForInprocessMaster_; + } + /** + *
    +       * If true, always use RPC to contact the session target.
    +       *
    +       * If false (the default option), TensorFlow may use an optimized
    +       * transport for client-master communication that avoids the RPC
    +       * stack. This option is primarily for used testing the RPC stack.
    +       * 
    + * + * bool use_rpc_for_inprocess_master = 1; + * @param value The useRpcForInprocessMaster to set. + * @return This builder for chaining. + */ + public Builder setUseRpcForInprocessMaster(boolean value) { + + useRpcForInprocessMaster_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * If true, always use RPC to contact the session target.
    +       *
    +       * If false (the default option), TensorFlow may use an optimized
    +       * transport for client-master communication that avoids the RPC
    +       * stack. This option is primarily for used testing the RPC stack.
    +       * 
    + * + * bool use_rpc_for_inprocess_master = 1; + * @return This builder for chaining. + */ + public Builder clearUseRpcForInprocessMaster() { + bitField0_ = (bitField0_ & ~0x00000001); + useRpcForInprocessMaster_ = false; + onChanged(); + return this; + } + + private java.lang.Object compressionAlgorithm_ = ""; + /** + *
    +       * The compression algorithm to be used. One of "deflate", "gzip".
    +       * 
    + * + * string compression_algorithm = 2; + * @return The compressionAlgorithm. + */ + public java.lang.String getCompressionAlgorithm() { + java.lang.Object ref = compressionAlgorithm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + compressionAlgorithm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The compression algorithm to be used. One of "deflate", "gzip".
    +       * 
    + * + * string compression_algorithm = 2; + * @return The bytes for compressionAlgorithm. + */ + public com.google.protobuf.ByteString + getCompressionAlgorithmBytes() { + java.lang.Object ref = compressionAlgorithm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + compressionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The compression algorithm to be used. One of "deflate", "gzip".
    +       * 
    + * + * string compression_algorithm = 2; + * @param value The compressionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setCompressionAlgorithm( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + compressionAlgorithm_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The compression algorithm to be used. One of "deflate", "gzip".
    +       * 
    + * + * string compression_algorithm = 2; + * @return This builder for chaining. + */ + public Builder clearCompressionAlgorithm() { + compressionAlgorithm_ = getDefaultInstance().getCompressionAlgorithm(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * The compression algorithm to be used. One of "deflate", "gzip".
    +       * 
    + * + * string compression_algorithm = 2; + * @param value The bytes for compressionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setCompressionAlgorithmBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + compressionAlgorithm_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int compressionLevel_ ; + /** + *
    +       * If compression_algorithm is set, the compression level to be used.
    +       * From 0 (no compression), up to 3.
    +       * 
    + * + * int32 compression_level = 3; + * @return The compressionLevel. + */ + @java.lang.Override + public int getCompressionLevel() { + return compressionLevel_; + } + /** + *
    +       * If compression_algorithm is set, the compression level to be used.
    +       * From 0 (no compression), up to 3.
    +       * 
    + * + * int32 compression_level = 3; + * @param value The compressionLevel to set. + * @return This builder for chaining. + */ + public Builder setCompressionLevel(int value) { + + compressionLevel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * If compression_algorithm is set, the compression level to be used.
    +       * From 0 (no compression), up to 3.
    +       * 
    + * + * int32 compression_level = 3; + * @return This builder for chaining. + */ + public Builder clearCompressionLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + compressionLevel_ = 0; + onChanged(); + return this; + } + + private boolean cacheRpcResponse_ ; + /** + *
    +       * Setting cache_rpc_response to true will enable sender side caching of
    +       * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    +       * requests . This is only necessary when the network fabric is experiencing a
    +       * significant error rate.  Without it we'll fail a step on an network error,
    +       * while with it we'll be able to complete long steps (like complex
    +       * initializations) in the face of some network errors during RecvTensor.
    +       * 
    + * + * bool cache_rpc_response = 4; + * @return The cacheRpcResponse. + */ + @java.lang.Override + public boolean getCacheRpcResponse() { + return cacheRpcResponse_; + } + /** + *
    +       * Setting cache_rpc_response to true will enable sender side caching of
    +       * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    +       * requests . This is only necessary when the network fabric is experiencing a
    +       * significant error rate.  Without it we'll fail a step on an network error,
    +       * while with it we'll be able to complete long steps (like complex
    +       * initializations) in the face of some network errors during RecvTensor.
    +       * 
    + * + * bool cache_rpc_response = 4; + * @param value The cacheRpcResponse to set. + * @return This builder for chaining. + */ + public Builder setCacheRpcResponse(boolean value) { + + cacheRpcResponse_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Setting cache_rpc_response to true will enable sender side caching of
    +       * response for RecvTensorAsync and RecvBufAsync to allow receiver to retry
    +       * requests . This is only necessary when the network fabric is experiencing a
    +       * significant error rate.  Without it we'll fail a step on an network error,
    +       * while with it we'll be able to complete long steps (like complex
    +       * initializations) in the face of some network errors during RecvTensor.
    +       * 
    + * + * bool cache_rpc_response = 4; + * @return This builder for chaining. + */ + public Builder clearCacheRpcResponse() { + bitField0_ = (bitField0_ & ~0x00000008); + cacheRpcResponse_ = false; + onChanged(); + return this; + } + + private boolean disableSessionConnectionSharing_ ; + /** + *
    +       * Disables TCP connection sharing when opening a new RPC channel.
    +       * 
    + * + * bool disable_session_connection_sharing = 5; + * @return The disableSessionConnectionSharing. + */ + @java.lang.Override + public boolean getDisableSessionConnectionSharing() { + return disableSessionConnectionSharing_; + } + /** + *
    +       * Disables TCP connection sharing when opening a new RPC channel.
    +       * 
    + * + * bool disable_session_connection_sharing = 5; + * @param value The disableSessionConnectionSharing to set. + * @return This builder for chaining. + */ + public Builder setDisableSessionConnectionSharing(boolean value) { + + disableSessionConnectionSharing_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Disables TCP connection sharing when opening a new RPC channel.
    +       * 
    + * + * bool disable_session_connection_sharing = 5; + * @return This builder for chaining. + */ + public Builder clearDisableSessionConnectionSharing() { + bitField0_ = (bitField0_ & ~0x00000010); + disableSessionConnectionSharing_ = false; + onChanged(); + return this; + } + + private int numChannelsPerTarget_ ; + /** + *
    +       * Setting num_channels_per_target > 0 allows uses of multiple channels to
    +       * communicate to the same target. This can be used to improve the aggregate
    +       * throughput on high speed links (e.g 100G) where single connection is not
    +       * sufficient to maximize link utilization. Note that a single RPC only goes
    +       * on a single channel, this only helps in situations where there are multiple
    +       * transfers to the same target overlapping in time.
    +       * 
    + * + * int32 num_channels_per_target = 6; + * @return The numChannelsPerTarget. + */ + @java.lang.Override + public int getNumChannelsPerTarget() { + return numChannelsPerTarget_; + } + /** + *
    +       * Setting num_channels_per_target > 0 allows uses of multiple channels to
    +       * communicate to the same target. This can be used to improve the aggregate
    +       * throughput on high speed links (e.g 100G) where single connection is not
    +       * sufficient to maximize link utilization. Note that a single RPC only goes
    +       * on a single channel, this only helps in situations where there are multiple
    +       * transfers to the same target overlapping in time.
    +       * 
    + * + * int32 num_channels_per_target = 6; + * @param value The numChannelsPerTarget to set. + * @return This builder for chaining. + */ + public Builder setNumChannelsPerTarget(int value) { + + numChannelsPerTarget_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Setting num_channels_per_target > 0 allows uses of multiple channels to
    +       * communicate to the same target. This can be used to improve the aggregate
    +       * throughput on high speed links (e.g 100G) where single connection is not
    +       * sufficient to maximize link utilization. Note that a single RPC only goes
    +       * on a single channel, this only helps in situations where there are multiple
    +       * transfers to the same target overlapping in time.
    +       * 
    + * + * int32 num_channels_per_target = 6; + * @return This builder for chaining. + */ + public Builder clearNumChannelsPerTarget() { + bitField0_ = (bitField0_ & ~0x00000020); + numChannelsPerTarget_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RPCOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RPCOptions) + private static final org.tensorflow.proto.RpcOptions.RPCOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RpcOptions.RPCOptions(); + } + + public static org.tensorflow.proto.RpcOptions.RPCOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RPCOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RpcOptions.RPCOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RPCOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RPCOptions_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\"xla/tsl/protobuf/rpc_options.proto\022\nte" + + "nsorflow\"\325\001\n\nRPCOptions\022$\n\034use_rpc_for_i" + + "nprocess_master\030\001 \001(\010\022\035\n\025compression_alg" + + "orithm\030\002 \001(\t\022\031\n\021compression_level\030\003 \001(\005\022" + + "\032\n\022cache_rpc_response\030\004 \001(\010\022*\n\"disable_s" + + "ession_connection_sharing\030\005 \001(\010\022\037\n\027num_c" + + "hannels_per_target\030\006 \001(\005BV\n\024org.tensorfl" + + "ow.protoZ>github.com/google/tsl/tsl/go/p" + + "rotobuf/for_core_protos_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_RPCOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_RPCOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RPCOptions_descriptor, + new java.lang.String[] { "UseRpcForInprocessMaster", "CompressionAlgorithm", "CompressionLevel", "CacheRpcResponse", "DisableSessionConnectionSharing", "NumChannelsPerTarget", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfiguration.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfiguration.java new file mode 100644 index 00000000000..801a0e56dd3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfiguration.java @@ -0,0 +1,885 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Run-specific items such as arguments to the test / benchmark.
    + * 
    + * + * Protobuf type {@code tensorflow.RunConfiguration} + */ +public final class RunConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunConfiguration) + RunConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RunConfiguration.class.getName()); + } + // Use RunConfiguration.newBuilder() to construct. + private RunConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RunConfiguration() { + argument_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetEnvVars(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunConfiguration.class, org.tensorflow.proto.RunConfiguration.Builder.class); + } + + public static final int ARGUMENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList argument_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string argument = 1; + * @return A list containing the argument. + */ + public com.google.protobuf.ProtocolStringList + getArgumentList() { + return argument_; + } + /** + * repeated string argument = 1; + * @return The count of argument. + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated string argument = 1; + * @param index The index of the element to return. + * @return The argument at the given index. + */ + public java.lang.String getArgument(int index) { + return argument_.get(index); + } + /** + * repeated string argument = 1; + * @param index The index of the value to return. + * @return The bytes of the argument at the given index. + */ + public com.google.protobuf.ByteString + getArgumentBytes(int index) { + return argument_.getByteString(index); + } + + public static final int ENV_VARS_FIELD_NUMBER = 2; + private static final class EnvVarsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> envVars_; + private com.google.protobuf.MapField + internalGetEnvVars() { + if (envVars_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvVarsDefaultEntryHolder.defaultEntry); + } + return envVars_; + } + public int getEnvVarsCount() { + return internalGetEnvVars().getMap().size(); + } + /** + *
    +   * Environment variables used to run the test/benchmark.
    +   * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public boolean containsEnvVars( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetEnvVars().getMap().containsKey(key); + } + /** + * Use {@link #getEnvVarsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvVars() { + return getEnvVarsMap(); + } + /** + *
    +   * Environment variables used to run the test/benchmark.
    +   * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public java.util.Map getEnvVarsMap() { + return internalGetEnvVars().getMap(); + } + /** + *
    +   * Environment variables used to run the test/benchmark.
    +   * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getEnvVarsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvVars().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Environment variables used to run the test/benchmark.
    +   * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public java.lang.String getEnvVarsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvVars().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 { + for (int i = 0; i < argument_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, argument_.getRaw(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetEnvVars(), + EnvVarsDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < argument_.size(); i++) { + dataSize += computeStringSizeNoTag(argument_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgumentList().size(); + } + for (java.util.Map.Entry entry + : internalGetEnvVars().getMap().entrySet()) { + com.google.protobuf.MapEntry + envVars__ = EnvVarsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, envVars__); + } + size += getUnknownFields().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.RunConfiguration)) { + return super.equals(obj); + } + org.tensorflow.proto.RunConfiguration other = (org.tensorflow.proto.RunConfiguration) obj; + + if (!getArgumentList() + .equals(other.getArgumentList())) return false; + if (!internalGetEnvVars().equals( + other.internalGetEnvVars())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getArgumentCount() > 0) { + hash = (37 * hash) + ARGUMENT_FIELD_NUMBER; + hash = (53 * hash) + getArgumentList().hashCode(); + } + if (!internalGetEnvVars().getMap().isEmpty()) { + hash = (37 * hash) + ENV_VARS_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvVars().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunConfiguration 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.RunConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunConfiguration 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.RunConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Run-specific items such as arguments to the test / benchmark.
    +   * 
    + * + * Protobuf type {@code tensorflow.RunConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunConfiguration) + org.tensorflow.proto.RunConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetEnvVars(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableEnvVars(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunConfiguration.class, org.tensorflow.proto.RunConfiguration.Builder.class); + } + + // Construct using org.tensorflow.proto.RunConfiguration.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + argument_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + internalGetMutableEnvVars().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_RunConfiguration_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunConfiguration getDefaultInstanceForType() { + return org.tensorflow.proto.RunConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunConfiguration build() { + org.tensorflow.proto.RunConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunConfiguration buildPartial() { + org.tensorflow.proto.RunConfiguration result = new org.tensorflow.proto.RunConfiguration(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RunConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + argument_.makeImmutable(); + result.argument_ = argument_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.envVars_ = internalGetEnvVars(); + result.envVars_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunConfiguration) { + return mergeFrom((org.tensorflow.proto.RunConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunConfiguration other) { + if (other == org.tensorflow.proto.RunConfiguration.getDefaultInstance()) return this; + if (!other.argument_.isEmpty()) { + if (argument_.isEmpty()) { + argument_ = other.argument_; + bitField0_ |= 0x00000001; + } else { + ensureArgumentIsMutable(); + argument_.addAll(other.argument_); + } + onChanged(); + } + internalGetMutableEnvVars().mergeFrom( + other.internalGetEnvVars()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureArgumentIsMutable(); + argument_.add(s); + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + envVars__ = input.readMessage( + EnvVarsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableEnvVars().getMutableMap().put( + envVars__.getKey(), envVars__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList argument_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureArgumentIsMutable() { + if (!argument_.isModifiable()) { + argument_ = new com.google.protobuf.LazyStringArrayList(argument_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string argument = 1; + * @return A list containing the argument. + */ + public com.google.protobuf.ProtocolStringList + getArgumentList() { + argument_.makeImmutable(); + return argument_; + } + /** + * repeated string argument = 1; + * @return The count of argument. + */ + public int getArgumentCount() { + return argument_.size(); + } + /** + * repeated string argument = 1; + * @param index The index of the element to return. + * @return The argument at the given index. + */ + public java.lang.String getArgument(int index) { + return argument_.get(index); + } + /** + * repeated string argument = 1; + * @param index The index of the value to return. + * @return The bytes of the argument at the given index. + */ + public com.google.protobuf.ByteString + getArgumentBytes(int index) { + return argument_.getByteString(index); + } + /** + * repeated string argument = 1; + * @param index The index to set the value at. + * @param value The argument to set. + * @return This builder for chaining. + */ + public Builder setArgument( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgumentIsMutable(); + argument_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string argument = 1; + * @param value The argument to add. + * @return This builder for chaining. + */ + public Builder addArgument( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgumentIsMutable(); + argument_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string argument = 1; + * @param values The argument to add. + * @return This builder for chaining. + */ + public Builder addAllArgument( + java.lang.Iterable values) { + ensureArgumentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, argument_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string argument = 1; + * @return This builder for chaining. + */ + public Builder clearArgument() { + argument_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string argument = 1; + * @param value The bytes of the argument to add. + * @return This builder for chaining. + */ + public Builder addArgumentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureArgumentIsMutable(); + argument_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> envVars_; + private com.google.protobuf.MapField + internalGetEnvVars() { + if (envVars_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvVarsDefaultEntryHolder.defaultEntry); + } + return envVars_; + } + private com.google.protobuf.MapField + internalGetMutableEnvVars() { + if (envVars_ == null) { + envVars_ = com.google.protobuf.MapField.newMapField( + EnvVarsDefaultEntryHolder.defaultEntry); + } + if (!envVars_.isMutable()) { + envVars_ = envVars_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return envVars_; + } + public int getEnvVarsCount() { + return internalGetEnvVars().getMap().size(); + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public boolean containsEnvVars( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetEnvVars().getMap().containsKey(key); + } + /** + * Use {@link #getEnvVarsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvVars() { + return getEnvVarsMap(); + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public java.util.Map getEnvVarsMap() { + return internalGetEnvVars().getMap(); + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getEnvVarsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvVars().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + @java.lang.Override + public java.lang.String getEnvVarsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetEnvVars().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearEnvVars() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableEnvVars().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + public Builder removeEnvVars( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableEnvVars().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableEnvVars() { + bitField0_ |= 0x00000002; + return internalGetMutableEnvVars().getMutableMap(); + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + public Builder putEnvVars( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableEnvVars().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Environment variables used to run the test/benchmark.
    +     * 
    + * + * map<string, string> env_vars = 2; + */ + public Builder putAllEnvVars( + java.util.Map values) { + internalGetMutableEnvVars().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunConfiguration) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunConfiguration) + private static final org.tensorflow.proto.RunConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunConfiguration(); + } + + public static org.tensorflow.proto.RunConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunConfiguration parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfigurationOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfigurationOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfigurationOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfigurationOrBuilder.java index 9150f64ee59..1183f95dccd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/testlog/RunConfigurationOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunConfigurationOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: tensorflow/core/util/test_log.proto +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util.testlog; +package org.tensorflow.proto; public interface RunConfigurationOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.RunConfiguration) @@ -9,19 +11,25 @@ public interface RunConfigurationOrBuilder extends /** * repeated string argument = 1; + * @return A list containing the argument. */ java.util.List getArgumentList(); /** * repeated string argument = 1; + * @return The count of argument. */ int getArgumentCount(); /** * repeated string argument = 1; + * @param index The index of the element to return. + * @return The argument at the given index. */ java.lang.String getArgument(int index); /** * repeated string argument = 1; + * @param index The index of the value to return. + * @return The bytes of the argument at the given index. */ com.google.protobuf.ByteString getArgumentBytes(int index); @@ -65,10 +73,11 @@ boolean containsEnvVars( * * map<string, string> env_vars = 2; */ - - java.lang.String getEnvVarsOrDefault( + /* nullable */ +java.lang.String getEnvVarsOrDefault( java.lang.String key, - java.lang.String defaultValue); + /* nullable */ +java.lang.String defaultValue); /** *
        * Environment variables used to run the test/benchmark.
    @@ -76,7 +85,6 @@ java.lang.String getEnvVarsOrDefault(
        *
        * map<string, string> env_vars = 2;
        */
    -
       java.lang.String getEnvVarsOrThrow(
           java.lang.String key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadata.java
    new file mode 100644
    index 00000000000..6fca6234f49
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadata.java
    @@ -0,0 +1,3462 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/config.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Metadata output (i.e., non-Tensor) for a single Run() call.
    + * 
    + * + * Protobuf type {@code tensorflow.RunMetadata} + */ +public final class RunMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunMetadata) + RunMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RunMetadata.class.getName()); + } + // Use RunMetadata.newBuilder() to construct. + private RunMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RunMetadata() { + partitionGraphs_ = java.util.Collections.emptyList(); + functionGraphs_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunMetadata.class, org.tensorflow.proto.RunMetadata.Builder.class); + } + + public interface FunctionGraphsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RunMetadata.FunctionGraphs) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + java.util.List + getPartitionGraphsList(); + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + org.tensorflow.proto.GraphDef getPartitionGraphs(int index); + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + int getPartitionGraphsCount(); + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + java.util.List + getPartitionGraphsOrBuilderList(); + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder( + int index); + + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return Whether the preOptimizationGraph field is set. + */ + boolean hasPreOptimizationGraph(); + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return The preOptimizationGraph. + */ + org.tensorflow.proto.GraphDef getPreOptimizationGraph(); + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + org.tensorflow.proto.GraphDefOrBuilder getPreOptimizationGraphOrBuilder(); + + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return Whether the postOptimizationGraph field is set. + */ + boolean hasPostOptimizationGraph(); + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return The postOptimizationGraph. + */ + org.tensorflow.proto.GraphDef getPostOptimizationGraph(); + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + org.tensorflow.proto.GraphDefOrBuilder getPostOptimizationGraphOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.RunMetadata.FunctionGraphs} + */ + public static final class FunctionGraphs extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunMetadata.FunctionGraphs) + FunctionGraphsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FunctionGraphs.class.getName()); + } + // Use FunctionGraphs.newBuilder() to construct. + private FunctionGraphs(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FunctionGraphs() { + partitionGraphs_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunMetadata.FunctionGraphs.class, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder.class); + } + + private int bitField0_; + public static final int PARTITION_GRAPHS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List partitionGraphs_; + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + @java.lang.Override + public java.util.List getPartitionGraphsList() { + return partitionGraphs_; + } + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + @java.lang.Override + public java.util.List + getPartitionGraphsOrBuilderList() { + return partitionGraphs_; + } + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + @java.lang.Override + public int getPartitionGraphsCount() { + return partitionGraphs_.size(); + } + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getPartitionGraphs(int index) { + return partitionGraphs_.get(index); + } + /** + *
    +     * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder( + int index) { + return partitionGraphs_.get(index); + } + + public static final int PRE_OPTIMIZATION_GRAPH_FIELD_NUMBER = 2; + private org.tensorflow.proto.GraphDef preOptimizationGraph_; + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return Whether the preOptimizationGraph field is set. + */ + @java.lang.Override + public boolean hasPreOptimizationGraph() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return The preOptimizationGraph. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getPreOptimizationGraph() { + return preOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : preOptimizationGraph_; + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getPreOptimizationGraphOrBuilder() { + return preOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : preOptimizationGraph_; + } + + public static final int POST_OPTIMIZATION_GRAPH_FIELD_NUMBER = 3; + private org.tensorflow.proto.GraphDef postOptimizationGraph_; + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return Whether the postOptimizationGraph field is set. + */ + @java.lang.Override + public boolean hasPostOptimizationGraph() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return The postOptimizationGraph. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getPostOptimizationGraph() { + return postOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : postOptimizationGraph_; + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getPostOptimizationGraphOrBuilder() { + return postOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : postOptimizationGraph_; + } + + 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 { + for (int i = 0; i < partitionGraphs_.size(); i++) { + output.writeMessage(1, partitionGraphs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPreOptimizationGraph()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getPostOptimizationGraph()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < partitionGraphs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, partitionGraphs_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPreOptimizationGraph()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getPostOptimizationGraph()); + } + size += getUnknownFields().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.RunMetadata.FunctionGraphs)) { + return super.equals(obj); + } + org.tensorflow.proto.RunMetadata.FunctionGraphs other = (org.tensorflow.proto.RunMetadata.FunctionGraphs) obj; + + if (!getPartitionGraphsList() + .equals(other.getPartitionGraphsList())) return false; + if (hasPreOptimizationGraph() != other.hasPreOptimizationGraph()) return false; + if (hasPreOptimizationGraph()) { + if (!getPreOptimizationGraph() + .equals(other.getPreOptimizationGraph())) return false; + } + if (hasPostOptimizationGraph() != other.hasPostOptimizationGraph()) return false; + if (hasPostOptimizationGraph()) { + if (!getPostOptimizationGraph() + .equals(other.getPostOptimizationGraph())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPartitionGraphsCount() > 0) { + hash = (37 * hash) + PARTITION_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + getPartitionGraphsList().hashCode(); + } + if (hasPreOptimizationGraph()) { + hash = (37 * hash) + PRE_OPTIMIZATION_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + getPreOptimizationGraph().hashCode(); + } + if (hasPostOptimizationGraph()) { + hash = (37 * hash) + POST_OPTIMIZATION_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + getPostOptimizationGraph().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs 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.RunMetadata.FunctionGraphs parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunMetadata.FunctionGraphs parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunMetadata.FunctionGraphs 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.RunMetadata.FunctionGraphs} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunMetadata.FunctionGraphs) + org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunMetadata.FunctionGraphs.class, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder.class); + } + + // Construct using org.tensorflow.proto.RunMetadata.FunctionGraphs.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPartitionGraphsFieldBuilder(); + getPreOptimizationGraphFieldBuilder(); + getPostOptimizationGraphFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (partitionGraphsBuilder_ == null) { + partitionGraphs_ = java.util.Collections.emptyList(); + } else { + partitionGraphs_ = null; + partitionGraphsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + preOptimizationGraph_ = null; + if (preOptimizationGraphBuilder_ != null) { + preOptimizationGraphBuilder_.dispose(); + preOptimizationGraphBuilder_ = null; + } + postOptimizationGraph_ = null; + if (postOptimizationGraphBuilder_ != null) { + postOptimizationGraphBuilder_.dispose(); + postOptimizationGraphBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_FunctionGraphs_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata.FunctionGraphs getDefaultInstanceForType() { + return org.tensorflow.proto.RunMetadata.FunctionGraphs.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata.FunctionGraphs build() { + org.tensorflow.proto.RunMetadata.FunctionGraphs result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata.FunctionGraphs buildPartial() { + org.tensorflow.proto.RunMetadata.FunctionGraphs result = new org.tensorflow.proto.RunMetadata.FunctionGraphs(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.RunMetadata.FunctionGraphs result) { + if (partitionGraphsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.partitionGraphs_ = partitionGraphs_; + } else { + result.partitionGraphs_ = partitionGraphsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.RunMetadata.FunctionGraphs result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.preOptimizationGraph_ = preOptimizationGraphBuilder_ == null + ? preOptimizationGraph_ + : preOptimizationGraphBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.postOptimizationGraph_ = postOptimizationGraphBuilder_ == null + ? postOptimizationGraph_ + : postOptimizationGraphBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunMetadata.FunctionGraphs) { + return mergeFrom((org.tensorflow.proto.RunMetadata.FunctionGraphs)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunMetadata.FunctionGraphs other) { + if (other == org.tensorflow.proto.RunMetadata.FunctionGraphs.getDefaultInstance()) return this; + if (partitionGraphsBuilder_ == null) { + if (!other.partitionGraphs_.isEmpty()) { + if (partitionGraphs_.isEmpty()) { + partitionGraphs_ = other.partitionGraphs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.addAll(other.partitionGraphs_); + } + onChanged(); + } + } else { + if (!other.partitionGraphs_.isEmpty()) { + if (partitionGraphsBuilder_.isEmpty()) { + partitionGraphsBuilder_.dispose(); + partitionGraphsBuilder_ = null; + partitionGraphs_ = other.partitionGraphs_; + bitField0_ = (bitField0_ & ~0x00000001); + partitionGraphsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPartitionGraphsFieldBuilder() : null; + } else { + partitionGraphsBuilder_.addAllMessages(other.partitionGraphs_); + } + } + } + if (other.hasPreOptimizationGraph()) { + mergePreOptimizationGraph(other.getPreOptimizationGraph()); + } + if (other.hasPostOptimizationGraph()) { + mergePostOptimizationGraph(other.getPostOptimizationGraph()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.GraphDef m = + input.readMessage( + org.tensorflow.proto.GraphDef.parser(), + extensionRegistry); + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(m); + } else { + partitionGraphsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + input.readMessage( + getPreOptimizationGraphFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getPostOptimizationGraphFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List partitionGraphs_ = + java.util.Collections.emptyList(); + private void ensurePartitionGraphsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + partitionGraphs_ = new java.util.ArrayList(partitionGraphs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> partitionGraphsBuilder_; + + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public java.util.List getPartitionGraphsList() { + if (partitionGraphsBuilder_ == null) { + return java.util.Collections.unmodifiableList(partitionGraphs_); + } else { + return partitionGraphsBuilder_.getMessageList(); + } + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public int getPartitionGraphsCount() { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.size(); + } else { + return partitionGraphsBuilder_.getCount(); + } + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public org.tensorflow.proto.GraphDef getPartitionGraphs(int index) { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.get(index); + } else { + return partitionGraphsBuilder_.getMessage(index); + } + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder setPartitionGraphs( + int index, org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.set(index, value); + onChanged(); + } else { + partitionGraphsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder setPartitionGraphs( + int index, org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.set(index, builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder addPartitionGraphs(org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(value); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder addPartitionGraphs( + int index, org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(index, value); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder addPartitionGraphs( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder addPartitionGraphs( + int index, org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(index, builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder addAllPartitionGraphs( + java.lang.Iterable values) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partitionGraphs_); + onChanged(); + } else { + partitionGraphsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder clearPartitionGraphs() { + if (partitionGraphsBuilder_ == null) { + partitionGraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + partitionGraphsBuilder_.clear(); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public Builder removePartitionGraphs(int index) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.remove(index); + onChanged(); + } else { + partitionGraphsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public org.tensorflow.proto.GraphDef.Builder getPartitionGraphsBuilder( + int index) { + return getPartitionGraphsFieldBuilder().getBuilder(index); + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder( + int index) { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.get(index); } else { + return partitionGraphsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public java.util.List + getPartitionGraphsOrBuilderList() { + if (partitionGraphsBuilder_ != null) { + return partitionGraphsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partitionGraphs_); + } + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public org.tensorflow.proto.GraphDef.Builder addPartitionGraphsBuilder() { + return getPartitionGraphsFieldBuilder().addBuilder( + org.tensorflow.proto.GraphDef.getDefaultInstance()); + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public org.tensorflow.proto.GraphDef.Builder addPartitionGraphsBuilder( + int index) { + return getPartitionGraphsFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphDef.getDefaultInstance()); + } + /** + *
    +       * TODO(nareshmodi): Include some sort of function/cache-key identifier?
    +       * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 1; + */ + public java.util.List + getPartitionGraphsBuilderList() { + return getPartitionGraphsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getPartitionGraphsFieldBuilder() { + if (partitionGraphsBuilder_ == null) { + partitionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + partitionGraphs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + partitionGraphs_ = null; + } + return partitionGraphsBuilder_; + } + + private org.tensorflow.proto.GraphDef preOptimizationGraph_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> preOptimizationGraphBuilder_; + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return Whether the preOptimizationGraph field is set. + */ + public boolean hasPreOptimizationGraph() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + * @return The preOptimizationGraph. + */ + public org.tensorflow.proto.GraphDef getPreOptimizationGraph() { + if (preOptimizationGraphBuilder_ == null) { + return preOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : preOptimizationGraph_; + } else { + return preOptimizationGraphBuilder_.getMessage(); + } + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public Builder setPreOptimizationGraph(org.tensorflow.proto.GraphDef value) { + if (preOptimizationGraphBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + preOptimizationGraph_ = value; + } else { + preOptimizationGraphBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public Builder setPreOptimizationGraph( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (preOptimizationGraphBuilder_ == null) { + preOptimizationGraph_ = builderForValue.build(); + } else { + preOptimizationGraphBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public Builder mergePreOptimizationGraph(org.tensorflow.proto.GraphDef value) { + if (preOptimizationGraphBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + preOptimizationGraph_ != null && + preOptimizationGraph_ != org.tensorflow.proto.GraphDef.getDefaultInstance()) { + getPreOptimizationGraphBuilder().mergeFrom(value); + } else { + preOptimizationGraph_ = value; + } + } else { + preOptimizationGraphBuilder_.mergeFrom(value); + } + if (preOptimizationGraph_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public Builder clearPreOptimizationGraph() { + bitField0_ = (bitField0_ & ~0x00000002); + preOptimizationGraph_ = null; + if (preOptimizationGraphBuilder_ != null) { + preOptimizationGraphBuilder_.dispose(); + preOptimizationGraphBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public org.tensorflow.proto.GraphDef.Builder getPreOptimizationGraphBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPreOptimizationGraphFieldBuilder().getBuilder(); + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + public org.tensorflow.proto.GraphDefOrBuilder getPreOptimizationGraphOrBuilder() { + if (preOptimizationGraphBuilder_ != null) { + return preOptimizationGraphBuilder_.getMessageOrBuilder(); + } else { + return preOptimizationGraph_ == null ? + org.tensorflow.proto.GraphDef.getDefaultInstance() : preOptimizationGraph_; + } + } + /** + * .tensorflow.GraphDef pre_optimization_graph = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getPreOptimizationGraphFieldBuilder() { + if (preOptimizationGraphBuilder_ == null) { + preOptimizationGraphBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + getPreOptimizationGraph(), + getParentForChildren(), + isClean()); + preOptimizationGraph_ = null; + } + return preOptimizationGraphBuilder_; + } + + private org.tensorflow.proto.GraphDef postOptimizationGraph_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> postOptimizationGraphBuilder_; + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return Whether the postOptimizationGraph field is set. + */ + public boolean hasPostOptimizationGraph() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + * @return The postOptimizationGraph. + */ + public org.tensorflow.proto.GraphDef getPostOptimizationGraph() { + if (postOptimizationGraphBuilder_ == null) { + return postOptimizationGraph_ == null ? org.tensorflow.proto.GraphDef.getDefaultInstance() : postOptimizationGraph_; + } else { + return postOptimizationGraphBuilder_.getMessage(); + } + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public Builder setPostOptimizationGraph(org.tensorflow.proto.GraphDef value) { + if (postOptimizationGraphBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postOptimizationGraph_ = value; + } else { + postOptimizationGraphBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public Builder setPostOptimizationGraph( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (postOptimizationGraphBuilder_ == null) { + postOptimizationGraph_ = builderForValue.build(); + } else { + postOptimizationGraphBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public Builder mergePostOptimizationGraph(org.tensorflow.proto.GraphDef value) { + if (postOptimizationGraphBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + postOptimizationGraph_ != null && + postOptimizationGraph_ != org.tensorflow.proto.GraphDef.getDefaultInstance()) { + getPostOptimizationGraphBuilder().mergeFrom(value); + } else { + postOptimizationGraph_ = value; + } + } else { + postOptimizationGraphBuilder_.mergeFrom(value); + } + if (postOptimizationGraph_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public Builder clearPostOptimizationGraph() { + bitField0_ = (bitField0_ & ~0x00000004); + postOptimizationGraph_ = null; + if (postOptimizationGraphBuilder_ != null) { + postOptimizationGraphBuilder_.dispose(); + postOptimizationGraphBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public org.tensorflow.proto.GraphDef.Builder getPostOptimizationGraphBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPostOptimizationGraphFieldBuilder().getBuilder(); + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + public org.tensorflow.proto.GraphDefOrBuilder getPostOptimizationGraphOrBuilder() { + if (postOptimizationGraphBuilder_ != null) { + return postOptimizationGraphBuilder_.getMessageOrBuilder(); + } else { + return postOptimizationGraph_ == null ? + org.tensorflow.proto.GraphDef.getDefaultInstance() : postOptimizationGraph_; + } + } + /** + * .tensorflow.GraphDef post_optimization_graph = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getPostOptimizationGraphFieldBuilder() { + if (postOptimizationGraphBuilder_ == null) { + postOptimizationGraphBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + getPostOptimizationGraph(), + getParentForChildren(), + isClean()); + postOptimizationGraph_ = null; + } + return postOptimizationGraphBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunMetadata.FunctionGraphs) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunMetadata.FunctionGraphs) + private static final org.tensorflow.proto.RunMetadata.FunctionGraphs DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunMetadata.FunctionGraphs(); + } + + public static org.tensorflow.proto.RunMetadata.FunctionGraphs getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionGraphs parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunMetadata.FunctionGraphs getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int STEP_STATS_FIELD_NUMBER = 1; + private org.tensorflow.proto.StepStats stepStats_; + /** + *
    +   * Statistics traced for this step. Populated if tracing is turned on via the
    +   * "RunOptions" proto.
    +   * EXPERIMENTAL: The format and set of events may change in future versions.
    +   * 
    + * + * .tensorflow.StepStats step_stats = 1; + * @return Whether the stepStats field is set. + */ + @java.lang.Override + public boolean hasStepStats() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Statistics traced for this step. Populated if tracing is turned on via the
    +   * "RunOptions" proto.
    +   * EXPERIMENTAL: The format and set of events may change in future versions.
    +   * 
    + * + * .tensorflow.StepStats step_stats = 1; + * @return The stepStats. + */ + @java.lang.Override + public org.tensorflow.proto.StepStats getStepStats() { + return stepStats_ == null ? org.tensorflow.proto.StepStats.getDefaultInstance() : stepStats_; + } + /** + *
    +   * Statistics traced for this step. Populated if tracing is turned on via the
    +   * "RunOptions" proto.
    +   * EXPERIMENTAL: The format and set of events may change in future versions.
    +   * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + @java.lang.Override + public org.tensorflow.proto.StepStatsOrBuilder getStepStatsOrBuilder() { + return stepStats_ == null ? org.tensorflow.proto.StepStats.getDefaultInstance() : stepStats_; + } + + public static final int COST_GRAPH_FIELD_NUMBER = 2; + private org.tensorflow.proto.CostGraphDef costGraph_; + /** + *
    +   * The cost graph for the computation defined by the run call.
    +   * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + * @return Whether the costGraph field is set. + */ + @java.lang.Override + public boolean hasCostGraph() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The cost graph for the computation defined by the run call.
    +   * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + * @return The costGraph. + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDef getCostGraph() { + return costGraph_ == null ? org.tensorflow.proto.CostGraphDef.getDefaultInstance() : costGraph_; + } + /** + *
    +   * The cost graph for the computation defined by the run call.
    +   * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + @java.lang.Override + public org.tensorflow.proto.CostGraphDefOrBuilder getCostGraphOrBuilder() { + return costGraph_ == null ? org.tensorflow.proto.CostGraphDef.getDefaultInstance() : costGraph_; + } + + public static final int PARTITION_GRAPHS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List partitionGraphs_; + /** + *
    +   * Graphs of the partitions executed by executors.
    +   * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + @java.lang.Override + public java.util.List getPartitionGraphsList() { + return partitionGraphs_; + } + /** + *
    +   * Graphs of the partitions executed by executors.
    +   * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + @java.lang.Override + public java.util.List + getPartitionGraphsOrBuilderList() { + return partitionGraphs_; + } + /** + *
    +   * Graphs of the partitions executed by executors.
    +   * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + @java.lang.Override + public int getPartitionGraphsCount() { + return partitionGraphs_.size(); + } + /** + *
    +   * Graphs of the partitions executed by executors.
    +   * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDef getPartitionGraphs(int index) { + return partitionGraphs_.get(index); + } + /** + *
    +   * Graphs of the partitions executed by executors.
    +   * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder( + int index) { + return partitionGraphs_.get(index); + } + + public static final int FUNCTION_GRAPHS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List functionGraphs_; + /** + *
    +   * This is only populated for graphs that are run as functions in TensorFlow
    +   * V2. There will be an entry below for each function that is traced.
    +   * The main use cases of the post_optimization_graph and the partition_graphs
    +   * is to give the caller insight into the graphs that were actually run by the
    +   * runtime. Additional information (such as those in step_stats) will match
    +   * these graphs.
    +   * We also include the pre_optimization_graph since it is usually easier to
    +   * read, and is helpful in situations where the caller wants to get a high
    +   * level idea of what the built graph looks like (since the various graph
    +   * optimization passes might change the structure of the graph significantly).
    +   * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + @java.lang.Override + public java.util.List getFunctionGraphsList() { + return functionGraphs_; + } + /** + *
    +   * This is only populated for graphs that are run as functions in TensorFlow
    +   * V2. There will be an entry below for each function that is traced.
    +   * The main use cases of the post_optimization_graph and the partition_graphs
    +   * is to give the caller insight into the graphs that were actually run by the
    +   * runtime. Additional information (such as those in step_stats) will match
    +   * these graphs.
    +   * We also include the pre_optimization_graph since it is usually easier to
    +   * read, and is helpful in situations where the caller wants to get a high
    +   * level idea of what the built graph looks like (since the various graph
    +   * optimization passes might change the structure of the graph significantly).
    +   * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + @java.lang.Override + public java.util.List + getFunctionGraphsOrBuilderList() { + return functionGraphs_; + } + /** + *
    +   * This is only populated for graphs that are run as functions in TensorFlow
    +   * V2. There will be an entry below for each function that is traced.
    +   * The main use cases of the post_optimization_graph and the partition_graphs
    +   * is to give the caller insight into the graphs that were actually run by the
    +   * runtime. Additional information (such as those in step_stats) will match
    +   * these graphs.
    +   * We also include the pre_optimization_graph since it is usually easier to
    +   * read, and is helpful in situations where the caller wants to get a high
    +   * level idea of what the built graph looks like (since the various graph
    +   * optimization passes might change the structure of the graph significantly).
    +   * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + @java.lang.Override + public int getFunctionGraphsCount() { + return functionGraphs_.size(); + } + /** + *
    +   * This is only populated for graphs that are run as functions in TensorFlow
    +   * V2. There will be an entry below for each function that is traced.
    +   * The main use cases of the post_optimization_graph and the partition_graphs
    +   * is to give the caller insight into the graphs that were actually run by the
    +   * runtime. Additional information (such as those in step_stats) will match
    +   * these graphs.
    +   * We also include the pre_optimization_graph since it is usually easier to
    +   * read, and is helpful in situations where the caller wants to get a high
    +   * level idea of what the built graph looks like (since the various graph
    +   * optimization passes might change the structure of the graph significantly).
    +   * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + @java.lang.Override + public org.tensorflow.proto.RunMetadata.FunctionGraphs getFunctionGraphs(int index) { + return functionGraphs_.get(index); + } + /** + *
    +   * This is only populated for graphs that are run as functions in TensorFlow
    +   * V2. There will be an entry below for each function that is traced.
    +   * The main use cases of the post_optimization_graph and the partition_graphs
    +   * is to give the caller insight into the graphs that were actually run by the
    +   * runtime. Additional information (such as those in step_stats) will match
    +   * these graphs.
    +   * We also include the pre_optimization_graph since it is usually easier to
    +   * read, and is helpful in situations where the caller wants to get a high
    +   * level idea of what the built graph looks like (since the various graph
    +   * optimization passes might change the structure of the graph significantly).
    +   * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + @java.lang.Override + public org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder( + int index) { + return functionGraphs_.get(index); + } + + public static final int SESSION_METADATA_FIELD_NUMBER = 5; + private org.tensorflow.proto.SessionMetadata sessionMetadata_; + /** + *
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return Whether the sessionMetadata field is set. + */ + @java.lang.Override + public boolean hasSessionMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return The sessionMetadata. + */ + @java.lang.Override + public org.tensorflow.proto.SessionMetadata getSessionMetadata() { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + /** + *
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStepStats()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getCostGraph()); + } + for (int i = 0; i < partitionGraphs_.size(); i++) { + output.writeMessage(3, partitionGraphs_.get(i)); + } + for (int i = 0; i < functionGraphs_.size(); i++) { + output.writeMessage(4, functionGraphs_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getSessionMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getStepStats()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getCostGraph()); + } + for (int i = 0; i < partitionGraphs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, partitionGraphs_.get(i)); + } + for (int i = 0; i < functionGraphs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, functionGraphs_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getSessionMetadata()); + } + size += getUnknownFields().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.RunMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.RunMetadata other = (org.tensorflow.proto.RunMetadata) obj; + + if (hasStepStats() != other.hasStepStats()) return false; + if (hasStepStats()) { + if (!getStepStats() + .equals(other.getStepStats())) return false; + } + if (hasCostGraph() != other.hasCostGraph()) return false; + if (hasCostGraph()) { + if (!getCostGraph() + .equals(other.getCostGraph())) return false; + } + if (!getPartitionGraphsList() + .equals(other.getPartitionGraphsList())) return false; + if (!getFunctionGraphsList() + .equals(other.getFunctionGraphsList())) return false; + if (hasSessionMetadata() != other.hasSessionMetadata()) return false; + if (hasSessionMetadata()) { + if (!getSessionMetadata() + .equals(other.getSessionMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStepStats()) { + hash = (37 * hash) + STEP_STATS_FIELD_NUMBER; + hash = (53 * hash) + getStepStats().hashCode(); + } + if (hasCostGraph()) { + hash = (37 * hash) + COST_GRAPH_FIELD_NUMBER; + hash = (53 * hash) + getCostGraph().hashCode(); + } + if (getPartitionGraphsCount() > 0) { + hash = (37 * hash) + PARTITION_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + getPartitionGraphsList().hashCode(); + } + if (getFunctionGraphsCount() > 0) { + hash = (37 * hash) + FUNCTION_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + getFunctionGraphsList().hashCode(); + } + if (hasSessionMetadata()) { + hash = (37 * hash) + SESSION_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getSessionMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata 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.RunMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata 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.RunMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Metadata output (i.e., non-Tensor) for a single Run() call.
    +   * 
    + * + * Protobuf type {@code tensorflow.RunMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunMetadata) + org.tensorflow.proto.RunMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunMetadata.class, org.tensorflow.proto.RunMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.RunMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getStepStatsFieldBuilder(); + getCostGraphFieldBuilder(); + getPartitionGraphsFieldBuilder(); + getFunctionGraphsFieldBuilder(); + getSessionMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stepStats_ = null; + if (stepStatsBuilder_ != null) { + stepStatsBuilder_.dispose(); + stepStatsBuilder_ = null; + } + costGraph_ = null; + if (costGraphBuilder_ != null) { + costGraphBuilder_.dispose(); + costGraphBuilder_ = null; + } + if (partitionGraphsBuilder_ == null) { + partitionGraphs_ = java.util.Collections.emptyList(); + } else { + partitionGraphs_ = null; + partitionGraphsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (functionGraphsBuilder_ == null) { + functionGraphs_ = java.util.Collections.emptyList(); + } else { + functionGraphs_ = null; + functionGraphsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + sessionMetadata_ = null; + if (sessionMetadataBuilder_ != null) { + sessionMetadataBuilder_.dispose(); + sessionMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.RunMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata build() { + org.tensorflow.proto.RunMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunMetadata buildPartial() { + org.tensorflow.proto.RunMetadata result = new org.tensorflow.proto.RunMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.RunMetadata result) { + if (partitionGraphsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + partitionGraphs_ = java.util.Collections.unmodifiableList(partitionGraphs_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.partitionGraphs_ = partitionGraphs_; + } else { + result.partitionGraphs_ = partitionGraphsBuilder_.build(); + } + if (functionGraphsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + functionGraphs_ = java.util.Collections.unmodifiableList(functionGraphs_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.functionGraphs_ = functionGraphs_; + } else { + result.functionGraphs_ = functionGraphsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.RunMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stepStats_ = stepStatsBuilder_ == null + ? stepStats_ + : stepStatsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.costGraph_ = costGraphBuilder_ == null + ? costGraph_ + : costGraphBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sessionMetadata_ = sessionMetadataBuilder_ == null + ? sessionMetadata_ + : sessionMetadataBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunMetadata) { + return mergeFrom((org.tensorflow.proto.RunMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunMetadata other) { + if (other == org.tensorflow.proto.RunMetadata.getDefaultInstance()) return this; + if (other.hasStepStats()) { + mergeStepStats(other.getStepStats()); + } + if (other.hasCostGraph()) { + mergeCostGraph(other.getCostGraph()); + } + if (partitionGraphsBuilder_ == null) { + if (!other.partitionGraphs_.isEmpty()) { + if (partitionGraphs_.isEmpty()) { + partitionGraphs_ = other.partitionGraphs_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.addAll(other.partitionGraphs_); + } + onChanged(); + } + } else { + if (!other.partitionGraphs_.isEmpty()) { + if (partitionGraphsBuilder_.isEmpty()) { + partitionGraphsBuilder_.dispose(); + partitionGraphsBuilder_ = null; + partitionGraphs_ = other.partitionGraphs_; + bitField0_ = (bitField0_ & ~0x00000004); + partitionGraphsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPartitionGraphsFieldBuilder() : null; + } else { + partitionGraphsBuilder_.addAllMessages(other.partitionGraphs_); + } + } + } + if (functionGraphsBuilder_ == null) { + if (!other.functionGraphs_.isEmpty()) { + if (functionGraphs_.isEmpty()) { + functionGraphs_ = other.functionGraphs_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureFunctionGraphsIsMutable(); + functionGraphs_.addAll(other.functionGraphs_); + } + onChanged(); + } + } else { + if (!other.functionGraphs_.isEmpty()) { + if (functionGraphsBuilder_.isEmpty()) { + functionGraphsBuilder_.dispose(); + functionGraphsBuilder_ = null; + functionGraphs_ = other.functionGraphs_; + bitField0_ = (bitField0_ & ~0x00000008); + functionGraphsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getFunctionGraphsFieldBuilder() : null; + } else { + functionGraphsBuilder_.addAllMessages(other.functionGraphs_); + } + } + } + if (other.hasSessionMetadata()) { + mergeSessionMetadata(other.getSessionMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getStepStatsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getCostGraphFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + org.tensorflow.proto.GraphDef m = + input.readMessage( + org.tensorflow.proto.GraphDef.parser(), + extensionRegistry); + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(m); + } else { + partitionGraphsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + org.tensorflow.proto.RunMetadata.FunctionGraphs m = + input.readMessage( + org.tensorflow.proto.RunMetadata.FunctionGraphs.parser(), + extensionRegistry); + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + functionGraphs_.add(m); + } else { + functionGraphsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + input.readMessage( + getSessionMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.StepStats stepStats_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StepStats, org.tensorflow.proto.StepStats.Builder, org.tensorflow.proto.StepStatsOrBuilder> stepStatsBuilder_; + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + * @return Whether the stepStats field is set. + */ + public boolean hasStepStats() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + * @return The stepStats. + */ + public org.tensorflow.proto.StepStats getStepStats() { + if (stepStatsBuilder_ == null) { + return stepStats_ == null ? org.tensorflow.proto.StepStats.getDefaultInstance() : stepStats_; + } else { + return stepStatsBuilder_.getMessage(); + } + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public Builder setStepStats(org.tensorflow.proto.StepStats value) { + if (stepStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stepStats_ = value; + } else { + stepStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public Builder setStepStats( + org.tensorflow.proto.StepStats.Builder builderForValue) { + if (stepStatsBuilder_ == null) { + stepStats_ = builderForValue.build(); + } else { + stepStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public Builder mergeStepStats(org.tensorflow.proto.StepStats value) { + if (stepStatsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + stepStats_ != null && + stepStats_ != org.tensorflow.proto.StepStats.getDefaultInstance()) { + getStepStatsBuilder().mergeFrom(value); + } else { + stepStats_ = value; + } + } else { + stepStatsBuilder_.mergeFrom(value); + } + if (stepStats_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public Builder clearStepStats() { + bitField0_ = (bitField0_ & ~0x00000001); + stepStats_ = null; + if (stepStatsBuilder_ != null) { + stepStatsBuilder_.dispose(); + stepStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public org.tensorflow.proto.StepStats.Builder getStepStatsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStepStatsFieldBuilder().getBuilder(); + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + public org.tensorflow.proto.StepStatsOrBuilder getStepStatsOrBuilder() { + if (stepStatsBuilder_ != null) { + return stepStatsBuilder_.getMessageOrBuilder(); + } else { + return stepStats_ == null ? + org.tensorflow.proto.StepStats.getDefaultInstance() : stepStats_; + } + } + /** + *
    +     * Statistics traced for this step. Populated if tracing is turned on via the
    +     * "RunOptions" proto.
    +     * EXPERIMENTAL: The format and set of events may change in future versions.
    +     * 
    + * + * .tensorflow.StepStats step_stats = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StepStats, org.tensorflow.proto.StepStats.Builder, org.tensorflow.proto.StepStatsOrBuilder> + getStepStatsFieldBuilder() { + if (stepStatsBuilder_ == null) { + stepStatsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.StepStats, org.tensorflow.proto.StepStats.Builder, org.tensorflow.proto.StepStatsOrBuilder>( + getStepStats(), + getParentForChildren(), + isClean()); + stepStats_ = null; + } + return stepStatsBuilder_; + } + + private org.tensorflow.proto.CostGraphDef costGraph_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CostGraphDef, org.tensorflow.proto.CostGraphDef.Builder, org.tensorflow.proto.CostGraphDefOrBuilder> costGraphBuilder_; + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + * @return Whether the costGraph field is set. + */ + public boolean hasCostGraph() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + * @return The costGraph. + */ + public org.tensorflow.proto.CostGraphDef getCostGraph() { + if (costGraphBuilder_ == null) { + return costGraph_ == null ? org.tensorflow.proto.CostGraphDef.getDefaultInstance() : costGraph_; + } else { + return costGraphBuilder_.getMessage(); + } + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public Builder setCostGraph(org.tensorflow.proto.CostGraphDef value) { + if (costGraphBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + costGraph_ = value; + } else { + costGraphBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public Builder setCostGraph( + org.tensorflow.proto.CostGraphDef.Builder builderForValue) { + if (costGraphBuilder_ == null) { + costGraph_ = builderForValue.build(); + } else { + costGraphBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public Builder mergeCostGraph(org.tensorflow.proto.CostGraphDef value) { + if (costGraphBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + costGraph_ != null && + costGraph_ != org.tensorflow.proto.CostGraphDef.getDefaultInstance()) { + getCostGraphBuilder().mergeFrom(value); + } else { + costGraph_ = value; + } + } else { + costGraphBuilder_.mergeFrom(value); + } + if (costGraph_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public Builder clearCostGraph() { + bitField0_ = (bitField0_ & ~0x00000002); + costGraph_ = null; + if (costGraphBuilder_ != null) { + costGraphBuilder_.dispose(); + costGraphBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public org.tensorflow.proto.CostGraphDef.Builder getCostGraphBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCostGraphFieldBuilder().getBuilder(); + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + public org.tensorflow.proto.CostGraphDefOrBuilder getCostGraphOrBuilder() { + if (costGraphBuilder_ != null) { + return costGraphBuilder_.getMessageOrBuilder(); + } else { + return costGraph_ == null ? + org.tensorflow.proto.CostGraphDef.getDefaultInstance() : costGraph_; + } + } + /** + *
    +     * The cost graph for the computation defined by the run call.
    +     * 
    + * + * .tensorflow.CostGraphDef cost_graph = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CostGraphDef, org.tensorflow.proto.CostGraphDef.Builder, org.tensorflow.proto.CostGraphDefOrBuilder> + getCostGraphFieldBuilder() { + if (costGraphBuilder_ == null) { + costGraphBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CostGraphDef, org.tensorflow.proto.CostGraphDef.Builder, org.tensorflow.proto.CostGraphDefOrBuilder>( + getCostGraph(), + getParentForChildren(), + isClean()); + costGraph_ = null; + } + return costGraphBuilder_; + } + + private java.util.List partitionGraphs_ = + java.util.Collections.emptyList(); + private void ensurePartitionGraphsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + partitionGraphs_ = new java.util.ArrayList(partitionGraphs_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> partitionGraphsBuilder_; + + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public java.util.List getPartitionGraphsList() { + if (partitionGraphsBuilder_ == null) { + return java.util.Collections.unmodifiableList(partitionGraphs_); + } else { + return partitionGraphsBuilder_.getMessageList(); + } + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public int getPartitionGraphsCount() { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.size(); + } else { + return partitionGraphsBuilder_.getCount(); + } + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public org.tensorflow.proto.GraphDef getPartitionGraphs(int index) { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.get(index); + } else { + return partitionGraphsBuilder_.getMessage(index); + } + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder setPartitionGraphs( + int index, org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.set(index, value); + onChanged(); + } else { + partitionGraphsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder setPartitionGraphs( + int index, org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.set(index, builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder addPartitionGraphs(org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(value); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder addPartitionGraphs( + int index, org.tensorflow.proto.GraphDef value) { + if (partitionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(index, value); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder addPartitionGraphs( + org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder addPartitionGraphs( + int index, org.tensorflow.proto.GraphDef.Builder builderForValue) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.add(index, builderForValue.build()); + onChanged(); + } else { + partitionGraphsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder addAllPartitionGraphs( + java.lang.Iterable values) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, partitionGraphs_); + onChanged(); + } else { + partitionGraphsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder clearPartitionGraphs() { + if (partitionGraphsBuilder_ == null) { + partitionGraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + partitionGraphsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public Builder removePartitionGraphs(int index) { + if (partitionGraphsBuilder_ == null) { + ensurePartitionGraphsIsMutable(); + partitionGraphs_.remove(index); + onChanged(); + } else { + partitionGraphsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public org.tensorflow.proto.GraphDef.Builder getPartitionGraphsBuilder( + int index) { + return getPartitionGraphsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder( + int index) { + if (partitionGraphsBuilder_ == null) { + return partitionGraphs_.get(index); } else { + return partitionGraphsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public java.util.List + getPartitionGraphsOrBuilderList() { + if (partitionGraphsBuilder_ != null) { + return partitionGraphsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(partitionGraphs_); + } + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public org.tensorflow.proto.GraphDef.Builder addPartitionGraphsBuilder() { + return getPartitionGraphsFieldBuilder().addBuilder( + org.tensorflow.proto.GraphDef.getDefaultInstance()); + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public org.tensorflow.proto.GraphDef.Builder addPartitionGraphsBuilder( + int index) { + return getPartitionGraphsFieldBuilder().addBuilder( + index, org.tensorflow.proto.GraphDef.getDefaultInstance()); + } + /** + *
    +     * Graphs of the partitions executed by executors.
    +     * 
    + * + * repeated .tensorflow.GraphDef partition_graphs = 3; + */ + public java.util.List + getPartitionGraphsBuilderList() { + return getPartitionGraphsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder> + getPartitionGraphsFieldBuilder() { + if (partitionGraphsBuilder_ == null) { + partitionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.GraphDef, org.tensorflow.proto.GraphDef.Builder, org.tensorflow.proto.GraphDefOrBuilder>( + partitionGraphs_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + partitionGraphs_ = null; + } + return partitionGraphsBuilder_; + } + + private java.util.List functionGraphs_ = + java.util.Collections.emptyList(); + private void ensureFunctionGraphsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + functionGraphs_ = new java.util.ArrayList(functionGraphs_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RunMetadata.FunctionGraphs, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder> functionGraphsBuilder_; + + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public java.util.List getFunctionGraphsList() { + if (functionGraphsBuilder_ == null) { + return java.util.Collections.unmodifiableList(functionGraphs_); + } else { + return functionGraphsBuilder_.getMessageList(); + } + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public int getFunctionGraphsCount() { + if (functionGraphsBuilder_ == null) { + return functionGraphs_.size(); + } else { + return functionGraphsBuilder_.getCount(); + } + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public org.tensorflow.proto.RunMetadata.FunctionGraphs getFunctionGraphs(int index) { + if (functionGraphsBuilder_ == null) { + return functionGraphs_.get(index); + } else { + return functionGraphsBuilder_.getMessage(index); + } + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder setFunctionGraphs( + int index, org.tensorflow.proto.RunMetadata.FunctionGraphs value) { + if (functionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionGraphsIsMutable(); + functionGraphs_.set(index, value); + onChanged(); + } else { + functionGraphsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder setFunctionGraphs( + int index, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder builderForValue) { + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + functionGraphs_.set(index, builderForValue.build()); + onChanged(); + } else { + functionGraphsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder addFunctionGraphs(org.tensorflow.proto.RunMetadata.FunctionGraphs value) { + if (functionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionGraphsIsMutable(); + functionGraphs_.add(value); + onChanged(); + } else { + functionGraphsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder addFunctionGraphs( + int index, org.tensorflow.proto.RunMetadata.FunctionGraphs value) { + if (functionGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionGraphsIsMutable(); + functionGraphs_.add(index, value); + onChanged(); + } else { + functionGraphsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder addFunctionGraphs( + org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder builderForValue) { + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + functionGraphs_.add(builderForValue.build()); + onChanged(); + } else { + functionGraphsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder addFunctionGraphs( + int index, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder builderForValue) { + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + functionGraphs_.add(index, builderForValue.build()); + onChanged(); + } else { + functionGraphsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder addAllFunctionGraphs( + java.lang.Iterable values) { + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, functionGraphs_); + onChanged(); + } else { + functionGraphsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder clearFunctionGraphs() { + if (functionGraphsBuilder_ == null) { + functionGraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + functionGraphsBuilder_.clear(); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public Builder removeFunctionGraphs(int index) { + if (functionGraphsBuilder_ == null) { + ensureFunctionGraphsIsMutable(); + functionGraphs_.remove(index); + onChanged(); + } else { + functionGraphsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder getFunctionGraphsBuilder( + int index) { + return getFunctionGraphsFieldBuilder().getBuilder(index); + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder( + int index) { + if (functionGraphsBuilder_ == null) { + return functionGraphs_.get(index); } else { + return functionGraphsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public java.util.List + getFunctionGraphsOrBuilderList() { + if (functionGraphsBuilder_ != null) { + return functionGraphsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(functionGraphs_); + } + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder addFunctionGraphsBuilder() { + return getFunctionGraphsFieldBuilder().addBuilder( + org.tensorflow.proto.RunMetadata.FunctionGraphs.getDefaultInstance()); + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder addFunctionGraphsBuilder( + int index) { + return getFunctionGraphsFieldBuilder().addBuilder( + index, org.tensorflow.proto.RunMetadata.FunctionGraphs.getDefaultInstance()); + } + /** + *
    +     * This is only populated for graphs that are run as functions in TensorFlow
    +     * V2. There will be an entry below for each function that is traced.
    +     * The main use cases of the post_optimization_graph and the partition_graphs
    +     * is to give the caller insight into the graphs that were actually run by the
    +     * runtime. Additional information (such as those in step_stats) will match
    +     * these graphs.
    +     * We also include the pre_optimization_graph since it is usually easier to
    +     * read, and is helpful in situations where the caller wants to get a high
    +     * level idea of what the built graph looks like (since the various graph
    +     * optimization passes might change the structure of the graph significantly).
    +     * 
    + * + * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4; + */ + public java.util.List + getFunctionGraphsBuilderList() { + return getFunctionGraphsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RunMetadata.FunctionGraphs, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder> + getFunctionGraphsFieldBuilder() { + if (functionGraphsBuilder_ == null) { + functionGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.RunMetadata.FunctionGraphs, org.tensorflow.proto.RunMetadata.FunctionGraphs.Builder, org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder>( + functionGraphs_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + functionGraphs_ = null; + } + return functionGraphsBuilder_; + } + + private org.tensorflow.proto.SessionMetadata sessionMetadata_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder> sessionMetadataBuilder_; + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return Whether the sessionMetadata field is set. + */ + public boolean hasSessionMetadata() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return The sessionMetadata. + */ + public org.tensorflow.proto.SessionMetadata getSessionMetadata() { + if (sessionMetadataBuilder_ == null) { + return sessionMetadata_ == null ? org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } else { + return sessionMetadataBuilder_.getMessage(); + } + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public Builder setSessionMetadata(org.tensorflow.proto.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionMetadata_ = value; + } else { + sessionMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public Builder setSessionMetadata( + org.tensorflow.proto.SessionMetadata.Builder builderForValue) { + if (sessionMetadataBuilder_ == null) { + sessionMetadata_ = builderForValue.build(); + } else { + sessionMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public Builder mergeSessionMetadata(org.tensorflow.proto.SessionMetadata value) { + if (sessionMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + sessionMetadata_ != null && + sessionMetadata_ != org.tensorflow.proto.SessionMetadata.getDefaultInstance()) { + getSessionMetadataBuilder().mergeFrom(value); + } else { + sessionMetadata_ = value; + } + } else { + sessionMetadataBuilder_.mergeFrom(value); + } + if (sessionMetadata_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public Builder clearSessionMetadata() { + bitField0_ = (bitField0_ & ~0x00000010); + sessionMetadata_ = null; + if (sessionMetadataBuilder_ != null) { + sessionMetadataBuilder_.dispose(); + sessionMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public org.tensorflow.proto.SessionMetadata.Builder getSessionMetadataBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSessionMetadataFieldBuilder().getBuilder(); + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + public org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder() { + if (sessionMetadataBuilder_ != null) { + return sessionMetadataBuilder_.getMessageOrBuilder(); + } else { + return sessionMetadata_ == null ? + org.tensorflow.proto.SessionMetadata.getDefaultInstance() : sessionMetadata_; + } + } + /** + *
    +     * Metadata about the session.
    +     * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder> + getSessionMetadataFieldBuilder() { + if (sessionMetadataBuilder_ == null) { + sessionMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SessionMetadata, org.tensorflow.proto.SessionMetadata.Builder, org.tensorflow.proto.SessionMetadataOrBuilder>( + getSessionMetadata(), + getParentForChildren(), + isClean()); + sessionMetadata_ = null; + } + return sessionMetadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunMetadata) + private static final org.tensorflow.proto.RunMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunMetadata(); + } + + public static org.tensorflow.proto.RunMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadataOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadataOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadataOrBuilder.java index 21e15741316..4c7e97243da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunMetadataOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface RunMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.RunMetadata) @@ -15,6 +17,7 @@ public interface RunMetadataOrBuilder extends *
    * * .tensorflow.StepStats step_stats = 1; + * @return Whether the stepStats field is set. */ boolean hasStepStats(); /** @@ -25,8 +28,9 @@ public interface RunMetadataOrBuilder extends * * * .tensorflow.StepStats step_stats = 1; + * @return The stepStats. */ - org.tensorflow.proto.framework.StepStats getStepStats(); + org.tensorflow.proto.StepStats getStepStats(); /** *
        * Statistics traced for this step. Populated if tracing is turned on via the
    @@ -36,7 +40,7 @@ public interface RunMetadataOrBuilder extends
        *
        * .tensorflow.StepStats step_stats = 1;
        */
    -  org.tensorflow.proto.framework.StepStatsOrBuilder getStepStatsOrBuilder();
    +  org.tensorflow.proto.StepStatsOrBuilder getStepStatsOrBuilder();
     
       /**
        * 
    @@ -44,6 +48,7 @@ public interface RunMetadataOrBuilder extends
        * 
    * * .tensorflow.CostGraphDef cost_graph = 2; + * @return Whether the costGraph field is set. */ boolean hasCostGraph(); /** @@ -52,8 +57,9 @@ public interface RunMetadataOrBuilder extends *
    * * .tensorflow.CostGraphDef cost_graph = 2; + * @return The costGraph. */ - org.tensorflow.proto.framework.CostGraphDef getCostGraph(); + org.tensorflow.proto.CostGraphDef getCostGraph(); /** *
        * The cost graph for the computation defined by the run call.
    @@ -61,7 +67,7 @@ public interface RunMetadataOrBuilder extends
        *
        * .tensorflow.CostGraphDef cost_graph = 2;
        */
    -  org.tensorflow.proto.framework.CostGraphDefOrBuilder getCostGraphOrBuilder();
    +  org.tensorflow.proto.CostGraphDefOrBuilder getCostGraphOrBuilder();
     
       /**
        * 
    @@ -70,7 +76,7 @@ public interface RunMetadataOrBuilder extends
        *
        * repeated .tensorflow.GraphDef partition_graphs = 3;
        */
    -  java.util.List 
    +  java.util.List 
           getPartitionGraphsList();
       /**
        * 
    @@ -79,7 +85,7 @@ public interface RunMetadataOrBuilder extends
        *
        * repeated .tensorflow.GraphDef partition_graphs = 3;
        */
    -  org.tensorflow.proto.framework.GraphDef getPartitionGraphs(int index);
    +  org.tensorflow.proto.GraphDef getPartitionGraphs(int index);
       /**
        * 
        * Graphs of the partitions executed by executors.
    @@ -95,7 +101,7 @@ public interface RunMetadataOrBuilder extends
        *
        * repeated .tensorflow.GraphDef partition_graphs = 3;
        */
    -  java.util.List 
    +  java.util.List 
           getPartitionGraphsOrBuilderList();
       /**
        * 
    @@ -104,7 +110,7 @@ public interface RunMetadataOrBuilder extends
        *
        * repeated .tensorflow.GraphDef partition_graphs = 3;
        */
    -  org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder(
    +  org.tensorflow.proto.GraphDefOrBuilder getPartitionGraphsOrBuilder(
           int index);
     
       /**
    @@ -123,7 +129,7 @@ org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder(
        *
        * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4;
        */
    -  java.util.List 
    +  java.util.List 
           getFunctionGraphsList();
       /**
        * 
    @@ -141,7 +147,7 @@ org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder(
        *
        * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4;
        */
    -  org.tensorflow.proto.framework.RunMetadata.FunctionGraphs getFunctionGraphs(int index);
    +  org.tensorflow.proto.RunMetadata.FunctionGraphs getFunctionGraphs(int index);
       /**
        * 
        * This is only populated for graphs that are run as functions in TensorFlow
    @@ -175,7 +181,7 @@ org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder(
        *
        * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4;
        */
    -  java.util.List 
    +  java.util.List 
           getFunctionGraphsOrBuilderList();
       /**
        * 
    @@ -193,6 +199,33 @@ org.tensorflow.proto.framework.GraphDefOrBuilder getPartitionGraphsOrBuilder(
        *
        * repeated .tensorflow.RunMetadata.FunctionGraphs function_graphs = 4;
        */
    -  org.tensorflow.proto.framework.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder(
    +  org.tensorflow.proto.RunMetadata.FunctionGraphsOrBuilder getFunctionGraphsOrBuilder(
           int index);
    +
    +  /**
    +   * 
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return Whether the sessionMetadata field is set. + */ + boolean hasSessionMetadata(); + /** + *
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + * @return The sessionMetadata. + */ + org.tensorflow.proto.SessionMetadata getSessionMetadata(); + /** + *
    +   * Metadata about the session.
    +   * 
    + * + * .tensorflow.SessionMetadata session_metadata = 5; + */ + org.tensorflow.proto.SessionMetadataOrBuilder getSessionMetadataOrBuilder(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptions.java new file mode 100644 index 00000000000..f7bbbdee26c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptions.java @@ -0,0 +1,2670 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Options for a single Run() call.
    + * 
    + * + * Protobuf type {@code tensorflow.RunOptions} + */ +public final class RunOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunOptions) + RunOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RunOptions.class.getName()); + } + // Use RunOptions.newBuilder() to construct. + private RunOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RunOptions() { + traceLevel_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.class, org.tensorflow.proto.RunOptions.Builder.class); + } + + /** + *
    +   * TODO(pbar) Turn this into a TraceOptions proto which allows
    +   * tracing to be controlled in a more orthogonal manner?
    +   * 
    + * + * Protobuf enum {@code tensorflow.RunOptions.TraceLevel} + */ + public enum TraceLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NO_TRACE = 0; + */ + NO_TRACE(0), + /** + * SOFTWARE_TRACE = 1; + */ + SOFTWARE_TRACE(1), + /** + * HARDWARE_TRACE = 2; + */ + HARDWARE_TRACE(2), + /** + * FULL_TRACE = 3; + */ + FULL_TRACE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TraceLevel.class.getName()); + } + /** + * NO_TRACE = 0; + */ + public static final int NO_TRACE_VALUE = 0; + /** + * SOFTWARE_TRACE = 1; + */ + public static final int SOFTWARE_TRACE_VALUE = 1; + /** + * HARDWARE_TRACE = 2; + */ + public static final int HARDWARE_TRACE_VALUE = 2; + /** + * FULL_TRACE = 3; + */ + public static final int FULL_TRACE_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TraceLevel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TraceLevel forNumber(int value) { + switch (value) { + case 0: return NO_TRACE; + case 1: return SOFTWARE_TRACE; + case 2: return HARDWARE_TRACE; + case 3: return FULL_TRACE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + TraceLevel> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TraceLevel findValueByNumber(int number) { + return TraceLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.RunOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final TraceLevel[] VALUES = values(); + + public static TraceLevel 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 TraceLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.RunOptions.TraceLevel) + } + + public interface ExperimentalOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions.Experimental) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * If non-zero, declares that this graph is going to use collective
    +     * ops and must synchronize step_ids with any other graph with this
    +     * same group_key value (in a distributed computation where tasks
    +     * run disjoint graphs).
    +     * 
    + * + * int64 collective_graph_key = 1; + * @return The collectiveGraphKey. + */ + long getCollectiveGraphKey(); + + /** + *
    +     * If true, then operations (using the inter-op pool) across all
    +     * session::run() calls will be centrally scheduled, optimizing for (median
    +     * and tail) latency.
    +     * Consider using this option for CPU-bound workloads like inference.
    +     * 
    + * + * bool use_run_handler_pool = 2; + * @return The useRunHandlerPool. + */ + boolean getUseRunHandlerPool(); + + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return Whether the runHandlerPoolOptions field is set. + */ + boolean hasRunHandlerPoolOptions(); + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return The runHandlerPoolOptions. + */ + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions(); + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder(); + } + /** + *
    +   * Everything inside Experimental is subject to change and is not subject
    +   * to API stability guarantees in
    +   * https://www.tensorflow.org/guide/version_compat.
    +   * 
    + * + * Protobuf type {@code tensorflow.RunOptions.Experimental} + */ + public static final class Experimental extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunOptions.Experimental) + ExperimentalOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Experimental.class.getName()); + } + // Use Experimental.newBuilder() to construct. + private Experimental(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Experimental() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.Experimental.class, org.tensorflow.proto.RunOptions.Experimental.Builder.class); + } + + public interface RunHandlerPoolOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Priority of the request. The run handler thread pool will schedule ops
    +       * based on the priority number. The larger number means higher priority.
    +       * 
    + * + * int64 priority = 1; + * @return The priority. + */ + long getPriority(); + } + /** + *
    +     * Options for run handler thread pool.
    +     * 
    + * + * Protobuf type {@code tensorflow.RunOptions.Experimental.RunHandlerPoolOptions} + */ + public static final class RunHandlerPoolOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) + RunHandlerPoolOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RunHandlerPoolOptions.class.getName()); + } + // Use RunHandlerPoolOptions.newBuilder() to construct. + private RunHandlerPoolOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RunHandlerPoolOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.class, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder.class); + } + + public static final int PRIORITY_FIELD_NUMBER = 1; + private long priority_ = 0L; + /** + *
    +       * Priority of the request. The run handler thread pool will schedule ops
    +       * based on the priority number. The larger number means higher priority.
    +       * 
    + * + * int64 priority = 1; + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + + 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 (priority_ != 0L) { + output.writeInt64(1, priority_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (priority_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, priority_); + } + size += getUnknownFields().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.RunOptions.Experimental.RunHandlerPoolOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions other = (org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions) obj; + + if (getPriority() + != other.getPriority()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPriority()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions 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.RunOptions.Experimental.RunHandlerPoolOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunOptions.Experimental.RunHandlerPoolOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Options for run handler thread pool.
    +       * 
    + * + * Protobuf type {@code tensorflow.RunOptions.Experimental.RunHandlerPoolOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.class, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + priority_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_RunHandlerPoolOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstanceForType() { + return org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions build() { + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions buildPartial() { + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions result = new org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.priority_ = priority_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions) { + return mergeFrom((org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions other) { + if (other == org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance()) return this; + if (other.getPriority() != 0L) { + setPriority(other.getPriority()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + priority_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long priority_ ; + /** + *
    +         * Priority of the request. The run handler thread pool will schedule ops
    +         * based on the priority number. The larger number means higher priority.
    +         * 
    + * + * int64 priority = 1; + * @return The priority. + */ + @java.lang.Override + public long getPriority() { + return priority_; + } + /** + *
    +         * Priority of the request. The run handler thread pool will schedule ops
    +         * based on the priority number. The larger number means higher priority.
    +         * 
    + * + * int64 priority = 1; + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(long value) { + + priority_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Priority of the request. The run handler thread pool will schedule ops
    +         * based on the priority number. The larger number means higher priority.
    +         * 
    + * + * int64 priority = 1; + * @return This builder for chaining. + */ + public Builder clearPriority() { + bitField0_ = (bitField0_ & ~0x00000001); + priority_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunOptions.Experimental.RunHandlerPoolOptions) + private static final org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions(); + } + + public static org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunHandlerPoolOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunOptions.Experimental.RunHandlerPoolOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int COLLECTIVE_GRAPH_KEY_FIELD_NUMBER = 1; + private long collectiveGraphKey_ = 0L; + /** + *
    +     * If non-zero, declares that this graph is going to use collective
    +     * ops and must synchronize step_ids with any other graph with this
    +     * same group_key value (in a distributed computation where tasks
    +     * run disjoint graphs).
    +     * 
    + * + * int64 collective_graph_key = 1; + * @return The collectiveGraphKey. + */ + @java.lang.Override + public long getCollectiveGraphKey() { + return collectiveGraphKey_; + } + + public static final int USE_RUN_HANDLER_POOL_FIELD_NUMBER = 2; + private boolean useRunHandlerPool_ = false; + /** + *
    +     * If true, then operations (using the inter-op pool) across all
    +     * session::run() calls will be centrally scheduled, optimizing for (median
    +     * and tail) latency.
    +     * Consider using this option for CPU-bound workloads like inference.
    +     * 
    + * + * bool use_run_handler_pool = 2; + * @return The useRunHandlerPool. + */ + @java.lang.Override + public boolean getUseRunHandlerPool() { + return useRunHandlerPool_; + } + + public static final int RUN_HANDLER_POOL_OPTIONS_FIELD_NUMBER = 3; + private org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions runHandlerPoolOptions_; + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return Whether the runHandlerPoolOptions field is set. + */ + @java.lang.Override + public boolean hasRunHandlerPoolOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return The runHandlerPoolOptions. + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions() { + return runHandlerPoolOptions_ == null ? org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder() { + return runHandlerPoolOptions_ == null ? org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; + } + + 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 (collectiveGraphKey_ != 0L) { + output.writeInt64(1, collectiveGraphKey_); + } + if (useRunHandlerPool_ != false) { + output.writeBool(2, useRunHandlerPool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRunHandlerPoolOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (collectiveGraphKey_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, collectiveGraphKey_); + } + if (useRunHandlerPool_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, useRunHandlerPool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getRunHandlerPoolOptions()); + } + size += getUnknownFields().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.RunOptions.Experimental)) { + return super.equals(obj); + } + org.tensorflow.proto.RunOptions.Experimental other = (org.tensorflow.proto.RunOptions.Experimental) obj; + + if (getCollectiveGraphKey() + != other.getCollectiveGraphKey()) return false; + if (getUseRunHandlerPool() + != other.getUseRunHandlerPool()) return false; + if (hasRunHandlerPoolOptions() != other.hasRunHandlerPoolOptions()) return false; + if (hasRunHandlerPoolOptions()) { + if (!getRunHandlerPoolOptions() + .equals(other.getRunHandlerPoolOptions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + COLLECTIVE_GRAPH_KEY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCollectiveGraphKey()); + hash = (37 * hash) + USE_RUN_HANDLER_POOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseRunHandlerPool()); + if (hasRunHandlerPoolOptions()) { + hash = (37 * hash) + RUN_HANDLER_POOL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getRunHandlerPoolOptions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunOptions.Experimental parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental 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.RunOptions.Experimental parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental 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.RunOptions.Experimental parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions.Experimental parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions.Experimental parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions.Experimental parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunOptions.Experimental parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunOptions.Experimental parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions.Experimental parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions.Experimental parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunOptions.Experimental 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Everything inside Experimental is subject to change and is not subject
    +     * to API stability guarantees in
    +     * https://www.tensorflow.org/guide/version_compat.
    +     * 
    + * + * Protobuf type {@code tensorflow.RunOptions.Experimental} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions.Experimental) + org.tensorflow.proto.RunOptions.ExperimentalOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.Experimental.class, org.tensorflow.proto.RunOptions.Experimental.Builder.class); + } + + // Construct using org.tensorflow.proto.RunOptions.Experimental.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getRunHandlerPoolOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + collectiveGraphKey_ = 0L; + useRunHandlerPool_ = false; + runHandlerPoolOptions_ = null; + if (runHandlerPoolOptionsBuilder_ != null) { + runHandlerPoolOptionsBuilder_.dispose(); + runHandlerPoolOptionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_Experimental_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental getDefaultInstanceForType() { + return org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental build() { + org.tensorflow.proto.RunOptions.Experimental result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental buildPartial() { + org.tensorflow.proto.RunOptions.Experimental result = new org.tensorflow.proto.RunOptions.Experimental(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RunOptions.Experimental result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.collectiveGraphKey_ = collectiveGraphKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.useRunHandlerPool_ = useRunHandlerPool_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.runHandlerPoolOptions_ = runHandlerPoolOptionsBuilder_ == null + ? runHandlerPoolOptions_ + : runHandlerPoolOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunOptions.Experimental) { + return mergeFrom((org.tensorflow.proto.RunOptions.Experimental)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunOptions.Experimental other) { + if (other == org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance()) return this; + if (other.getCollectiveGraphKey() != 0L) { + setCollectiveGraphKey(other.getCollectiveGraphKey()); + } + if (other.getUseRunHandlerPool() != false) { + setUseRunHandlerPool(other.getUseRunHandlerPool()); + } + if (other.hasRunHandlerPoolOptions()) { + mergeRunHandlerPoolOptions(other.getRunHandlerPoolOptions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + collectiveGraphKey_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + useRunHandlerPool_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + input.readMessage( + getRunHandlerPoolOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long collectiveGraphKey_ ; + /** + *
    +       * If non-zero, declares that this graph is going to use collective
    +       * ops and must synchronize step_ids with any other graph with this
    +       * same group_key value (in a distributed computation where tasks
    +       * run disjoint graphs).
    +       * 
    + * + * int64 collective_graph_key = 1; + * @return The collectiveGraphKey. + */ + @java.lang.Override + public long getCollectiveGraphKey() { + return collectiveGraphKey_; + } + /** + *
    +       * If non-zero, declares that this graph is going to use collective
    +       * ops and must synchronize step_ids with any other graph with this
    +       * same group_key value (in a distributed computation where tasks
    +       * run disjoint graphs).
    +       * 
    + * + * int64 collective_graph_key = 1; + * @param value The collectiveGraphKey to set. + * @return This builder for chaining. + */ + public Builder setCollectiveGraphKey(long value) { + + collectiveGraphKey_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * If non-zero, declares that this graph is going to use collective
    +       * ops and must synchronize step_ids with any other graph with this
    +       * same group_key value (in a distributed computation where tasks
    +       * run disjoint graphs).
    +       * 
    + * + * int64 collective_graph_key = 1; + * @return This builder for chaining. + */ + public Builder clearCollectiveGraphKey() { + bitField0_ = (bitField0_ & ~0x00000001); + collectiveGraphKey_ = 0L; + onChanged(); + return this; + } + + private boolean useRunHandlerPool_ ; + /** + *
    +       * If true, then operations (using the inter-op pool) across all
    +       * session::run() calls will be centrally scheduled, optimizing for (median
    +       * and tail) latency.
    +       * Consider using this option for CPU-bound workloads like inference.
    +       * 
    + * + * bool use_run_handler_pool = 2; + * @return The useRunHandlerPool. + */ + @java.lang.Override + public boolean getUseRunHandlerPool() { + return useRunHandlerPool_; + } + /** + *
    +       * If true, then operations (using the inter-op pool) across all
    +       * session::run() calls will be centrally scheduled, optimizing for (median
    +       * and tail) latency.
    +       * Consider using this option for CPU-bound workloads like inference.
    +       * 
    + * + * bool use_run_handler_pool = 2; + * @param value The useRunHandlerPool to set. + * @return This builder for chaining. + */ + public Builder setUseRunHandlerPool(boolean value) { + + useRunHandlerPool_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * If true, then operations (using the inter-op pool) across all
    +       * session::run() calls will be centrally scheduled, optimizing for (median
    +       * and tail) latency.
    +       * Consider using this option for CPU-bound workloads like inference.
    +       * 
    + * + * bool use_run_handler_pool = 2; + * @return This builder for chaining. + */ + public Builder clearUseRunHandlerPool() { + bitField0_ = (bitField0_ & ~0x00000002); + useRunHandlerPool_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions runHandlerPoolOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder> runHandlerPoolOptionsBuilder_; + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return Whether the runHandlerPoolOptions field is set. + */ + public boolean hasRunHandlerPoolOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + * @return The runHandlerPoolOptions. + */ + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions getRunHandlerPoolOptions() { + if (runHandlerPoolOptionsBuilder_ == null) { + return runHandlerPoolOptions_ == null ? org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; + } else { + return runHandlerPoolOptionsBuilder_.getMessage(); + } + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public Builder setRunHandlerPoolOptions(org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions value) { + if (runHandlerPoolOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runHandlerPoolOptions_ = value; + } else { + runHandlerPoolOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public Builder setRunHandlerPoolOptions( + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder builderForValue) { + if (runHandlerPoolOptionsBuilder_ == null) { + runHandlerPoolOptions_ = builderForValue.build(); + } else { + runHandlerPoolOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public Builder mergeRunHandlerPoolOptions(org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions value) { + if (runHandlerPoolOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + runHandlerPoolOptions_ != null && + runHandlerPoolOptions_ != org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance()) { + getRunHandlerPoolOptionsBuilder().mergeFrom(value); + } else { + runHandlerPoolOptions_ = value; + } + } else { + runHandlerPoolOptionsBuilder_.mergeFrom(value); + } + if (runHandlerPoolOptions_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public Builder clearRunHandlerPoolOptions() { + bitField0_ = (bitField0_ & ~0x00000004); + runHandlerPoolOptions_ = null; + if (runHandlerPoolOptionsBuilder_ != null) { + runHandlerPoolOptionsBuilder_.dispose(); + runHandlerPoolOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder getRunHandlerPoolOptionsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRunHandlerPoolOptionsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + public org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder getRunHandlerPoolOptionsOrBuilder() { + if (runHandlerPoolOptionsBuilder_ != null) { + return runHandlerPoolOptionsBuilder_.getMessageOrBuilder(); + } else { + return runHandlerPoolOptions_ == null ? + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.getDefaultInstance() : runHandlerPoolOptions_; + } + } + /** + * .tensorflow.RunOptions.Experimental.RunHandlerPoolOptions run_handler_pool_options = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder> + getRunHandlerPoolOptionsFieldBuilder() { + if (runHandlerPoolOptionsBuilder_ == null) { + runHandlerPoolOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptions.Builder, org.tensorflow.proto.RunOptions.Experimental.RunHandlerPoolOptionsOrBuilder>( + getRunHandlerPoolOptions(), + getParentForChildren(), + isClean()); + runHandlerPoolOptions_ = null; + } + return runHandlerPoolOptionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunOptions.Experimental) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunOptions.Experimental) + private static final org.tensorflow.proto.RunOptions.Experimental DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunOptions.Experimental(); + } + + public static org.tensorflow.proto.RunOptions.Experimental getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Experimental parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunOptions.Experimental getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int TRACE_LEVEL_FIELD_NUMBER = 1; + private int traceLevel_ = 0; + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The enum numeric value on the wire for traceLevel. + */ + @java.lang.Override public int getTraceLevelValue() { + return traceLevel_; + } + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The traceLevel. + */ + @java.lang.Override public org.tensorflow.proto.RunOptions.TraceLevel getTraceLevel() { + org.tensorflow.proto.RunOptions.TraceLevel result = org.tensorflow.proto.RunOptions.TraceLevel.forNumber(traceLevel_); + return result == null ? org.tensorflow.proto.RunOptions.TraceLevel.UNRECOGNIZED : result; + } + + public static final int TIMEOUT_IN_MS_FIELD_NUMBER = 2; + private long timeoutInMs_ = 0L; + /** + *
    +   * Time to wait for operation to complete in milliseconds.
    +   * 
    + * + * int64 timeout_in_ms = 2; + * @return The timeoutInMs. + */ + @java.lang.Override + public long getTimeoutInMs() { + return timeoutInMs_; + } + + public static final int INTER_OP_THREAD_POOL_FIELD_NUMBER = 3; + private int interOpThreadPool_ = 0; + /** + *
    +   * The thread pool to use, if session_inter_op_thread_pool is configured.
    +   * To use the caller thread set this to -1 - this uses the caller thread
    +   * to execute Session::Run() and thus avoids a context switch. Using the
    +   * caller thread to execute Session::Run() should be done ONLY for simple
    +   * graphs, where the overhead of an additional context switch is
    +   * comparable with the overhead of Session::Run().
    +   * 
    + * + * int32 inter_op_thread_pool = 3; + * @return The interOpThreadPool. + */ + @java.lang.Override + public int getInterOpThreadPool() { + return interOpThreadPool_; + } + + public static final int OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER = 5; + private boolean outputPartitionGraphs_ = false; + /** + *
    +   * Whether the partition graph(s) executed by the executor(s) should be
    +   * outputted via RunMetadata.
    +   * 
    + * + * bool output_partition_graphs = 5; + * @return The outputPartitionGraphs. + */ + @java.lang.Override + public boolean getOutputPartitionGraphs() { + return outputPartitionGraphs_; + } + + public static final int DEBUG_OPTIONS_FIELD_NUMBER = 6; + private org.tensorflow.proto.DebugOptions debugOptions_; + /** + *
    +   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +   * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + * @return Whether the debugOptions field is set. + */ + @java.lang.Override + public boolean hasDebugOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +   * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + * @return The debugOptions. + */ + @java.lang.Override + public org.tensorflow.proto.DebugOptions getDebugOptions() { + return debugOptions_ == null ? org.tensorflow.proto.DebugOptions.getDefaultInstance() : debugOptions_; + } + /** + *
    +   * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +   * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + @java.lang.Override + public org.tensorflow.proto.DebugOptionsOrBuilder getDebugOptionsOrBuilder() { + return debugOptions_ == null ? org.tensorflow.proto.DebugOptions.getDefaultInstance() : debugOptions_; + } + + public static final int REPORT_TENSOR_ALLOCATIONS_UPON_OOM_FIELD_NUMBER = 7; + private boolean reportTensorAllocationsUponOom_ = false; + /** + *
    +   * When enabled, causes tensor allocation information to be included in
    +   * the error message when the Run() call fails because the allocator ran
    +   * out of memory (OOM).
    +   *
    +   * Enabling this option can slow down the Run() call.
    +   * 
    + * + * bool report_tensor_allocations_upon_oom = 7; + * @return The reportTensorAllocationsUponOom. + */ + @java.lang.Override + public boolean getReportTensorAllocationsUponOom() { + return reportTensorAllocationsUponOom_; + } + + public static final int EXPERIMENTAL_FIELD_NUMBER = 8; + private org.tensorflow.proto.RunOptions.Experimental experimental_; + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + * @return Whether the experimental field is set. + */ + @java.lang.Override + public boolean hasExperimental() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + * @return The experimental. + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions.Experimental getExperimental() { + return experimental_ == null ? org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance() : experimental_; + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { + return experimental_ == null ? org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance() : experimental_; + } + + 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 (traceLevel_ != org.tensorflow.proto.RunOptions.TraceLevel.NO_TRACE.getNumber()) { + output.writeEnum(1, traceLevel_); + } + if (timeoutInMs_ != 0L) { + output.writeInt64(2, timeoutInMs_); + } + if (interOpThreadPool_ != 0) { + output.writeInt32(3, interOpThreadPool_); + } + if (outputPartitionGraphs_ != false) { + output.writeBool(5, outputPartitionGraphs_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getDebugOptions()); + } + if (reportTensorAllocationsUponOom_ != false) { + output.writeBool(7, reportTensorAllocationsUponOom_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getExperimental()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (traceLevel_ != org.tensorflow.proto.RunOptions.TraceLevel.NO_TRACE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, traceLevel_); + } + if (timeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, timeoutInMs_); + } + if (interOpThreadPool_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, interOpThreadPool_); + } + if (outputPartitionGraphs_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, outputPartitionGraphs_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getDebugOptions()); + } + if (reportTensorAllocationsUponOom_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, reportTensorAllocationsUponOom_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getExperimental()); + } + size += getUnknownFields().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.RunOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.RunOptions other = (org.tensorflow.proto.RunOptions) obj; + + if (traceLevel_ != other.traceLevel_) return false; + if (getTimeoutInMs() + != other.getTimeoutInMs()) return false; + if (getInterOpThreadPool() + != other.getInterOpThreadPool()) return false; + if (getOutputPartitionGraphs() + != other.getOutputPartitionGraphs()) return false; + if (hasDebugOptions() != other.hasDebugOptions()) return false; + if (hasDebugOptions()) { + if (!getDebugOptions() + .equals(other.getDebugOptions())) return false; + } + if (getReportTensorAllocationsUponOom() + != other.getReportTensorAllocationsUponOom()) return false; + if (hasExperimental() != other.hasExperimental()) return false; + if (hasExperimental()) { + if (!getExperimental() + .equals(other.getExperimental())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TRACE_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + traceLevel_; + hash = (37 * hash) + TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeoutInMs()); + hash = (37 * hash) + INTER_OP_THREAD_POOL_FIELD_NUMBER; + hash = (53 * hash) + getInterOpThreadPool(); + hash = (37 * hash) + OUTPUT_PARTITION_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getOutputPartitionGraphs()); + if (hasDebugOptions()) { + hash = (37 * hash) + DEBUG_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getDebugOptions().hashCode(); + } + hash = (37 * hash) + REPORT_TENSOR_ALLOCATIONS_UPON_OOM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getReportTensorAllocationsUponOom()); + if (hasExperimental()) { + hash = (37 * hash) + EXPERIMENTAL_FIELD_NUMBER; + hash = (53 * hash) + getExperimental().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.RunOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions 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.RunOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions 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.RunOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.RunOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.RunOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.RunOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.RunOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.RunOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RunOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Options for a single Run() call.
    +   * 
    + * + * Protobuf type {@code tensorflow.RunOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RunOptions) + org.tensorflow.proto.RunOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.RunOptions.class, org.tensorflow.proto.RunOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.RunOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getDebugOptionsFieldBuilder(); + getExperimentalFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + traceLevel_ = 0; + timeoutInMs_ = 0L; + interOpThreadPool_ = 0; + outputPartitionGraphs_ = false; + debugOptions_ = null; + if (debugOptionsBuilder_ != null) { + debugOptionsBuilder_.dispose(); + debugOptionsBuilder_ = null; + } + reportTensorAllocationsUponOom_ = false; + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_RunOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions getDefaultInstanceForType() { + return org.tensorflow.proto.RunOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions build() { + org.tensorflow.proto.RunOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.RunOptions buildPartial() { + org.tensorflow.proto.RunOptions result = new org.tensorflow.proto.RunOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.RunOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.traceLevel_ = traceLevel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timeoutInMs_ = timeoutInMs_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.interOpThreadPool_ = interOpThreadPool_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.outputPartitionGraphs_ = outputPartitionGraphs_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.debugOptions_ = debugOptionsBuilder_ == null + ? debugOptions_ + : debugOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.reportTensorAllocationsUponOom_ = reportTensorAllocationsUponOom_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.experimental_ = experimentalBuilder_ == null + ? experimental_ + : experimentalBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.RunOptions) { + return mergeFrom((org.tensorflow.proto.RunOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.RunOptions other) { + if (other == org.tensorflow.proto.RunOptions.getDefaultInstance()) return this; + if (other.traceLevel_ != 0) { + setTraceLevelValue(other.getTraceLevelValue()); + } + if (other.getTimeoutInMs() != 0L) { + setTimeoutInMs(other.getTimeoutInMs()); + } + if (other.getInterOpThreadPool() != 0) { + setInterOpThreadPool(other.getInterOpThreadPool()); + } + if (other.getOutputPartitionGraphs() != false) { + setOutputPartitionGraphs(other.getOutputPartitionGraphs()); + } + if (other.hasDebugOptions()) { + mergeDebugOptions(other.getDebugOptions()); + } + if (other.getReportTensorAllocationsUponOom() != false) { + setReportTensorAllocationsUponOom(other.getReportTensorAllocationsUponOom()); + } + if (other.hasExperimental()) { + mergeExperimental(other.getExperimental()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + traceLevel_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + timeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + interOpThreadPool_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 40: { + outputPartitionGraphs_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 50: { + input.readMessage( + getDebugOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 56: { + reportTensorAllocationsUponOom_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 56 + case 66: { + input.readMessage( + getExperimentalFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int traceLevel_ = 0; + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The enum numeric value on the wire for traceLevel. + */ + @java.lang.Override public int getTraceLevelValue() { + return traceLevel_; + } + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @param value The enum numeric value on the wire for traceLevel to set. + * @return This builder for chaining. + */ + public Builder setTraceLevelValue(int value) { + traceLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The traceLevel. + */ + @java.lang.Override + public org.tensorflow.proto.RunOptions.TraceLevel getTraceLevel() { + org.tensorflow.proto.RunOptions.TraceLevel result = org.tensorflow.proto.RunOptions.TraceLevel.forNumber(traceLevel_); + return result == null ? org.tensorflow.proto.RunOptions.TraceLevel.UNRECOGNIZED : result; + } + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @param value The traceLevel to set. + * @return This builder for chaining. + */ + public Builder setTraceLevel(org.tensorflow.proto.RunOptions.TraceLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + traceLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return This builder for chaining. + */ + public Builder clearTraceLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + traceLevel_ = 0; + onChanged(); + return this; + } + + private long timeoutInMs_ ; + /** + *
    +     * Time to wait for operation to complete in milliseconds.
    +     * 
    + * + * int64 timeout_in_ms = 2; + * @return The timeoutInMs. + */ + @java.lang.Override + public long getTimeoutInMs() { + return timeoutInMs_; + } + /** + *
    +     * Time to wait for operation to complete in milliseconds.
    +     * 
    + * + * int64 timeout_in_ms = 2; + * @param value The timeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setTimeoutInMs(long value) { + + timeoutInMs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Time to wait for operation to complete in milliseconds.
    +     * 
    + * + * int64 timeout_in_ms = 2; + * @return This builder for chaining. + */ + public Builder clearTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00000002); + timeoutInMs_ = 0L; + onChanged(); + return this; + } + + private int interOpThreadPool_ ; + /** + *
    +     * The thread pool to use, if session_inter_op_thread_pool is configured.
    +     * To use the caller thread set this to -1 - this uses the caller thread
    +     * to execute Session::Run() and thus avoids a context switch. Using the
    +     * caller thread to execute Session::Run() should be done ONLY for simple
    +     * graphs, where the overhead of an additional context switch is
    +     * comparable with the overhead of Session::Run().
    +     * 
    + * + * int32 inter_op_thread_pool = 3; + * @return The interOpThreadPool. + */ + @java.lang.Override + public int getInterOpThreadPool() { + return interOpThreadPool_; + } + /** + *
    +     * The thread pool to use, if session_inter_op_thread_pool is configured.
    +     * To use the caller thread set this to -1 - this uses the caller thread
    +     * to execute Session::Run() and thus avoids a context switch. Using the
    +     * caller thread to execute Session::Run() should be done ONLY for simple
    +     * graphs, where the overhead of an additional context switch is
    +     * comparable with the overhead of Session::Run().
    +     * 
    + * + * int32 inter_op_thread_pool = 3; + * @param value The interOpThreadPool to set. + * @return This builder for chaining. + */ + public Builder setInterOpThreadPool(int value) { + + interOpThreadPool_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The thread pool to use, if session_inter_op_thread_pool is configured.
    +     * To use the caller thread set this to -1 - this uses the caller thread
    +     * to execute Session::Run() and thus avoids a context switch. Using the
    +     * caller thread to execute Session::Run() should be done ONLY for simple
    +     * graphs, where the overhead of an additional context switch is
    +     * comparable with the overhead of Session::Run().
    +     * 
    + * + * int32 inter_op_thread_pool = 3; + * @return This builder for chaining. + */ + public Builder clearInterOpThreadPool() { + bitField0_ = (bitField0_ & ~0x00000004); + interOpThreadPool_ = 0; + onChanged(); + return this; + } + + private boolean outputPartitionGraphs_ ; + /** + *
    +     * Whether the partition graph(s) executed by the executor(s) should be
    +     * outputted via RunMetadata.
    +     * 
    + * + * bool output_partition_graphs = 5; + * @return The outputPartitionGraphs. + */ + @java.lang.Override + public boolean getOutputPartitionGraphs() { + return outputPartitionGraphs_; + } + /** + *
    +     * Whether the partition graph(s) executed by the executor(s) should be
    +     * outputted via RunMetadata.
    +     * 
    + * + * bool output_partition_graphs = 5; + * @param value The outputPartitionGraphs to set. + * @return This builder for chaining. + */ + public Builder setOutputPartitionGraphs(boolean value) { + + outputPartitionGraphs_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Whether the partition graph(s) executed by the executor(s) should be
    +     * outputted via RunMetadata.
    +     * 
    + * + * bool output_partition_graphs = 5; + * @return This builder for chaining. + */ + public Builder clearOutputPartitionGraphs() { + bitField0_ = (bitField0_ & ~0x00000008); + outputPartitionGraphs_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.DebugOptions debugOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugOptions, org.tensorflow.proto.DebugOptions.Builder, org.tensorflow.proto.DebugOptionsOrBuilder> debugOptionsBuilder_; + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + * @return Whether the debugOptions field is set. + */ + public boolean hasDebugOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + * @return The debugOptions. + */ + public org.tensorflow.proto.DebugOptions getDebugOptions() { + if (debugOptionsBuilder_ == null) { + return debugOptions_ == null ? org.tensorflow.proto.DebugOptions.getDefaultInstance() : debugOptions_; + } else { + return debugOptionsBuilder_.getMessage(); + } + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public Builder setDebugOptions(org.tensorflow.proto.DebugOptions value) { + if (debugOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + debugOptions_ = value; + } else { + debugOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public Builder setDebugOptions( + org.tensorflow.proto.DebugOptions.Builder builderForValue) { + if (debugOptionsBuilder_ == null) { + debugOptions_ = builderForValue.build(); + } else { + debugOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public Builder mergeDebugOptions(org.tensorflow.proto.DebugOptions value) { + if (debugOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + debugOptions_ != null && + debugOptions_ != org.tensorflow.proto.DebugOptions.getDefaultInstance()) { + getDebugOptionsBuilder().mergeFrom(value); + } else { + debugOptions_ = value; + } + } else { + debugOptionsBuilder_.mergeFrom(value); + } + if (debugOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public Builder clearDebugOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + debugOptions_ = null; + if (debugOptionsBuilder_ != null) { + debugOptionsBuilder_.dispose(); + debugOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public org.tensorflow.proto.DebugOptions.Builder getDebugOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDebugOptionsFieldBuilder().getBuilder(); + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + public org.tensorflow.proto.DebugOptionsOrBuilder getDebugOptionsOrBuilder() { + if (debugOptionsBuilder_ != null) { + return debugOptionsBuilder_.getMessageOrBuilder(); + } else { + return debugOptions_ == null ? + org.tensorflow.proto.DebugOptions.getDefaultInstance() : debugOptions_; + } + } + /** + *
    +     * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    +     * 
    + * + * .tensorflow.DebugOptions debug_options = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugOptions, org.tensorflow.proto.DebugOptions.Builder, org.tensorflow.proto.DebugOptionsOrBuilder> + getDebugOptionsFieldBuilder() { + if (debugOptionsBuilder_ == null) { + debugOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.DebugOptions, org.tensorflow.proto.DebugOptions.Builder, org.tensorflow.proto.DebugOptionsOrBuilder>( + getDebugOptions(), + getParentForChildren(), + isClean()); + debugOptions_ = null; + } + return debugOptionsBuilder_; + } + + private boolean reportTensorAllocationsUponOom_ ; + /** + *
    +     * When enabled, causes tensor allocation information to be included in
    +     * the error message when the Run() call fails because the allocator ran
    +     * out of memory (OOM).
    +     *
    +     * Enabling this option can slow down the Run() call.
    +     * 
    + * + * bool report_tensor_allocations_upon_oom = 7; + * @return The reportTensorAllocationsUponOom. + */ + @java.lang.Override + public boolean getReportTensorAllocationsUponOom() { + return reportTensorAllocationsUponOom_; + } + /** + *
    +     * When enabled, causes tensor allocation information to be included in
    +     * the error message when the Run() call fails because the allocator ran
    +     * out of memory (OOM).
    +     *
    +     * Enabling this option can slow down the Run() call.
    +     * 
    + * + * bool report_tensor_allocations_upon_oom = 7; + * @param value The reportTensorAllocationsUponOom to set. + * @return This builder for chaining. + */ + public Builder setReportTensorAllocationsUponOom(boolean value) { + + reportTensorAllocationsUponOom_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * When enabled, causes tensor allocation information to be included in
    +     * the error message when the Run() call fails because the allocator ran
    +     * out of memory (OOM).
    +     *
    +     * Enabling this option can slow down the Run() call.
    +     * 
    + * + * bool report_tensor_allocations_upon_oom = 7; + * @return This builder for chaining. + */ + public Builder clearReportTensorAllocationsUponOom() { + bitField0_ = (bitField0_ & ~0x00000020); + reportTensorAllocationsUponOom_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.RunOptions.Experimental experimental_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental, org.tensorflow.proto.RunOptions.Experimental.Builder, org.tensorflow.proto.RunOptions.ExperimentalOrBuilder> experimentalBuilder_; + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + * @return Whether the experimental field is set. + */ + public boolean hasExperimental() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + * @return The experimental. + */ + public org.tensorflow.proto.RunOptions.Experimental getExperimental() { + if (experimentalBuilder_ == null) { + return experimental_ == null ? org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance() : experimental_; + } else { + return experimentalBuilder_.getMessage(); + } + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public Builder setExperimental(org.tensorflow.proto.RunOptions.Experimental value) { + if (experimentalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimental_ = value; + } else { + experimentalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public Builder setExperimental( + org.tensorflow.proto.RunOptions.Experimental.Builder builderForValue) { + if (experimentalBuilder_ == null) { + experimental_ = builderForValue.build(); + } else { + experimentalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public Builder mergeExperimental(org.tensorflow.proto.RunOptions.Experimental value) { + if (experimentalBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + experimental_ != null && + experimental_ != org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance()) { + getExperimentalBuilder().mergeFrom(value); + } else { + experimental_ = value; + } + } else { + experimentalBuilder_.mergeFrom(value); + } + if (experimental_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public Builder clearExperimental() { + bitField0_ = (bitField0_ & ~0x00000040); + experimental_ = null; + if (experimentalBuilder_ != null) { + experimentalBuilder_.dispose(); + experimentalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public org.tensorflow.proto.RunOptions.Experimental.Builder getExperimentalBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getExperimentalFieldBuilder().getBuilder(); + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + public org.tensorflow.proto.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder() { + if (experimentalBuilder_ != null) { + return experimentalBuilder_.getMessageOrBuilder(); + } else { + return experimental_ == null ? + org.tensorflow.proto.RunOptions.Experimental.getDefaultInstance() : experimental_; + } + } + /** + * .tensorflow.RunOptions.Experimental experimental = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental, org.tensorflow.proto.RunOptions.Experimental.Builder, org.tensorflow.proto.RunOptions.ExperimentalOrBuilder> + getExperimentalFieldBuilder() { + if (experimentalBuilder_ == null) { + experimentalBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunOptions.Experimental, org.tensorflow.proto.RunOptions.Experimental.Builder, org.tensorflow.proto.RunOptions.ExperimentalOrBuilder>( + getExperimental(), + getParentForChildren(), + isClean()); + experimental_ = null; + } + return experimentalBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RunOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RunOptions) + private static final org.tensorflow.proto.RunOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.RunOptions(); + } + + public static org.tensorflow.proto.RunOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.RunOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptionsOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptionsOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptionsOrBuilder.java index c3f4a9d7205..7127867def4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RunOptionsOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/RunOptionsOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface RunOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.RunOptions) @@ -9,12 +11,14 @@ public interface RunOptionsOrBuilder extends /** * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The enum numeric value on the wire for traceLevel. */ int getTraceLevelValue(); /** * .tensorflow.RunOptions.TraceLevel trace_level = 1; + * @return The traceLevel. */ - org.tensorflow.proto.framework.RunOptions.TraceLevel getTraceLevel(); + org.tensorflow.proto.RunOptions.TraceLevel getTraceLevel(); /** *
    @@ -22,6 +26,7 @@ public interface RunOptionsOrBuilder extends
        * 
    * * int64 timeout_in_ms = 2; + * @return The timeoutInMs. */ long getTimeoutInMs(); @@ -36,6 +41,7 @@ public interface RunOptionsOrBuilder extends *
    * * int32 inter_op_thread_pool = 3; + * @return The interOpThreadPool. */ int getInterOpThreadPool(); @@ -46,6 +52,7 @@ public interface RunOptionsOrBuilder extends *
    * * bool output_partition_graphs = 5; + * @return The outputPartitionGraphs. */ boolean getOutputPartitionGraphs(); @@ -55,6 +62,7 @@ public interface RunOptionsOrBuilder extends *
    * * .tensorflow.DebugOptions debug_options = 6; + * @return Whether the debugOptions field is set. */ boolean hasDebugOptions(); /** @@ -63,8 +71,9 @@ public interface RunOptionsOrBuilder extends *
    * * .tensorflow.DebugOptions debug_options = 6; + * @return The debugOptions. */ - org.tensorflow.proto.framework.DebugOptions getDebugOptions(); + org.tensorflow.proto.DebugOptions getDebugOptions(); /** *
        * EXPERIMENTAL.  Options used to initialize DebuggerState, if enabled.
    @@ -72,30 +81,34 @@ public interface RunOptionsOrBuilder extends
        *
        * .tensorflow.DebugOptions debug_options = 6;
        */
    -  org.tensorflow.proto.framework.DebugOptionsOrBuilder getDebugOptionsOrBuilder();
    +  org.tensorflow.proto.DebugOptionsOrBuilder getDebugOptionsOrBuilder();
     
       /**
        * 
        * When enabled, causes tensor allocation information to be included in
        * the error message when the Run() call fails because the allocator ran
        * out of memory (OOM).
    +   *
        * Enabling this option can slow down the Run() call.
        * 
    * * bool report_tensor_allocations_upon_oom = 7; + * @return The reportTensorAllocationsUponOom. */ boolean getReportTensorAllocationsUponOom(); /** * .tensorflow.RunOptions.Experimental experimental = 8; + * @return Whether the experimental field is set. */ boolean hasExperimental(); /** * .tensorflow.RunOptions.Experimental experimental = 8; + * @return The experimental. */ - org.tensorflow.proto.framework.RunOptions.Experimental getExperimental(); + org.tensorflow.proto.RunOptions.Experimental getExperimental(); /** * .tensorflow.RunOptions.Experimental experimental = 8; */ - org.tensorflow.proto.framework.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder(); + org.tensorflow.proto.RunOptions.ExperimentalOrBuilder getExperimentalOrBuilder(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDef.java new file mode 100644 index 00000000000..94488b4eaab --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDef.java @@ -0,0 +1,1172 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/variable.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.SaveSliceInfoDef} + */ +public final class SaveSliceInfoDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SaveSliceInfoDef) + SaveSliceInfoDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SaveSliceInfoDef.class.getName()); + } + // Use SaveSliceInfoDef.newBuilder() to construct. + private SaveSliceInfoDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SaveSliceInfoDef() { + fullName_ = ""; + fullShape_ = emptyLongList(); + varOffset_ = emptyLongList(); + varShape_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SaveSliceInfoDef.class, org.tensorflow.proto.SaveSliceInfoDef.Builder.class); + } + + public static final int FULL_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object fullName_ = ""; + /** + *
    +   * Name of the full variable of which this is a slice.
    +   * 
    + * + * string full_name = 1; + * @return The fullName. + */ + @java.lang.Override + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + 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(); + fullName_ = s; + return s; + } + } + /** + *
    +   * Name of the full variable of which this is a slice.
    +   * 
    + * + * string full_name = 1; + * @return The bytes for fullName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULL_SHAPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList fullShape_ = + emptyLongList(); + /** + *
    +   * Shape of the full variable.
    +   * 
    + * + * repeated int64 full_shape = 2; + * @return A list containing the fullShape. + */ + @java.lang.Override + public java.util.List + getFullShapeList() { + return fullShape_; + } + /** + *
    +   * Shape of the full variable.
    +   * 
    + * + * repeated int64 full_shape = 2; + * @return The count of fullShape. + */ + public int getFullShapeCount() { + return fullShape_.size(); + } + /** + *
    +   * Shape of the full variable.
    +   * 
    + * + * repeated int64 full_shape = 2; + * @param index The index of the element to return. + * @return The fullShape at the given index. + */ + public long getFullShape(int index) { + return fullShape_.getLong(index); + } + private int fullShapeMemoizedSerializedSize = -1; + + public static final int VAR_OFFSET_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList varOffset_ = + emptyLongList(); + /** + *
    +   * Offset of this variable into the full variable.
    +   * 
    + * + * repeated int64 var_offset = 3; + * @return A list containing the varOffset. + */ + @java.lang.Override + public java.util.List + getVarOffsetList() { + return varOffset_; + } + /** + *
    +   * Offset of this variable into the full variable.
    +   * 
    + * + * repeated int64 var_offset = 3; + * @return The count of varOffset. + */ + public int getVarOffsetCount() { + return varOffset_.size(); + } + /** + *
    +   * Offset of this variable into the full variable.
    +   * 
    + * + * repeated int64 var_offset = 3; + * @param index The index of the element to return. + * @return The varOffset at the given index. + */ + public long getVarOffset(int index) { + return varOffset_.getLong(index); + } + private int varOffsetMemoizedSerializedSize = -1; + + public static final int VAR_SHAPE_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList varShape_ = + emptyLongList(); + /** + *
    +   * Shape of this variable.
    +   * 
    + * + * repeated int64 var_shape = 4; + * @return A list containing the varShape. + */ + @java.lang.Override + public java.util.List + getVarShapeList() { + return varShape_; + } + /** + *
    +   * Shape of this variable.
    +   * 
    + * + * repeated int64 var_shape = 4; + * @return The count of varShape. + */ + public int getVarShapeCount() { + return varShape_.size(); + } + /** + *
    +   * Shape of this variable.
    +   * 
    + * + * repeated int64 var_shape = 4; + * @param index The index of the element to return. + * @return The varShape at the given index. + */ + public long getVarShape(int index) { + return varShape_.getLong(index); + } + private int varShapeMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fullName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fullName_); + } + if (getFullShapeList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(fullShapeMemoizedSerializedSize); + } + for (int i = 0; i < fullShape_.size(); i++) { + output.writeInt64NoTag(fullShape_.getLong(i)); + } + if (getVarOffsetList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(varOffsetMemoizedSerializedSize); + } + for (int i = 0; i < varOffset_.size(); i++) { + output.writeInt64NoTag(varOffset_.getLong(i)); + } + if (getVarShapeList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(varShapeMemoizedSerializedSize); + } + for (int i = 0; i < varShape_.size(); i++) { + output.writeInt64NoTag(varShape_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fullName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fullName_); + } + { + int dataSize = 0; + for (int i = 0; i < fullShape_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(fullShape_.getLong(i)); + } + size += dataSize; + if (!getFullShapeList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + fullShapeMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < varOffset_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(varOffset_.getLong(i)); + } + size += dataSize; + if (!getVarOffsetList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + varOffsetMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < varShape_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(varShape_.getLong(i)); + } + size += dataSize; + if (!getVarShapeList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + varShapeMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.SaveSliceInfoDef)) { + return super.equals(obj); + } + org.tensorflow.proto.SaveSliceInfoDef other = (org.tensorflow.proto.SaveSliceInfoDef) obj; + + if (!getFullName() + .equals(other.getFullName())) return false; + if (!getFullShapeList() + .equals(other.getFullShapeList())) return false; + if (!getVarOffsetList() + .equals(other.getVarOffsetList())) return false; + if (!getVarShapeList() + .equals(other.getVarShapeList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FULL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFullName().hashCode(); + if (getFullShapeCount() > 0) { + hash = (37 * hash) + FULL_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getFullShapeList().hashCode(); + } + if (getVarOffsetCount() > 0) { + hash = (37 * hash) + VAR_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getVarOffsetList().hashCode(); + } + if (getVarShapeCount() > 0) { + hash = (37 * hash) + VAR_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getVarShapeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaveSliceInfoDef 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.SaveSliceInfoDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaveSliceInfoDef 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.SaveSliceInfoDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SaveSliceInfoDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SaveSliceInfoDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SaveSliceInfoDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SaveSliceInfoDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SaveSliceInfoDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SaveSliceInfoDef) + org.tensorflow.proto.SaveSliceInfoDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SaveSliceInfoDef.class, org.tensorflow.proto.SaveSliceInfoDef.Builder.class); + } + + // Construct using org.tensorflow.proto.SaveSliceInfoDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fullName_ = ""; + fullShape_ = emptyLongList(); + varOffset_ = emptyLongList(); + varShape_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_SaveSliceInfoDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SaveSliceInfoDef getDefaultInstanceForType() { + return org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SaveSliceInfoDef build() { + org.tensorflow.proto.SaveSliceInfoDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SaveSliceInfoDef buildPartial() { + org.tensorflow.proto.SaveSliceInfoDef result = new org.tensorflow.proto.SaveSliceInfoDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SaveSliceInfoDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fullName_ = fullName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + fullShape_.makeImmutable(); + result.fullShape_ = fullShape_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + varOffset_.makeImmutable(); + result.varOffset_ = varOffset_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + varShape_.makeImmutable(); + result.varShape_ = varShape_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SaveSliceInfoDef) { + return mergeFrom((org.tensorflow.proto.SaveSliceInfoDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SaveSliceInfoDef other) { + if (other == org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance()) return this; + if (!other.getFullName().isEmpty()) { + fullName_ = other.fullName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.fullShape_.isEmpty()) { + if (fullShape_.isEmpty()) { + fullShape_ = other.fullShape_; + fullShape_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureFullShapeIsMutable(); + fullShape_.addAll(other.fullShape_); + } + onChanged(); + } + if (!other.varOffset_.isEmpty()) { + if (varOffset_.isEmpty()) { + varOffset_ = other.varOffset_; + varOffset_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureVarOffsetIsMutable(); + varOffset_.addAll(other.varOffset_); + } + onChanged(); + } + if (!other.varShape_.isEmpty()) { + if (varShape_.isEmpty()) { + varShape_ = other.varShape_; + varShape_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensureVarShapeIsMutable(); + varShape_.addAll(other.varShape_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + fullName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + long v = input.readInt64(); + ensureFullShapeIsMutable(); + fullShape_.addLong(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureFullShapeIsMutable(); + while (input.getBytesUntilLimit() > 0) { + fullShape_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 18 + case 24: { + long v = input.readInt64(); + ensureVarOffsetIsMutable(); + varOffset_.addLong(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureVarOffsetIsMutable(); + while (input.getBytesUntilLimit() > 0) { + varOffset_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 26 + case 32: { + long v = input.readInt64(); + ensureVarShapeIsMutable(); + varShape_.addLong(v); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureVarShapeIsMutable(); + while (input.getBytesUntilLimit() > 0) { + varShape_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object fullName_ = ""; + /** + *
    +     * Name of the full variable of which this is a slice.
    +     * 
    + * + * string full_name = 1; + * @return The fullName. + */ + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the full variable of which this is a slice.
    +     * 
    + * + * string full_name = 1; + * @return The bytes for fullName. + */ + public com.google.protobuf.ByteString + getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the full variable of which this is a slice.
    +     * 
    + * + * string full_name = 1; + * @param value The fullName to set. + * @return This builder for chaining. + */ + public Builder setFullName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fullName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the full variable of which this is a slice.
    +     * 
    + * + * string full_name = 1; + * @return This builder for chaining. + */ + public Builder clearFullName() { + fullName_ = getDefaultInstance().getFullName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the full variable of which this is a slice.
    +     * 
    + * + * string full_name = 1; + * @param value The bytes for fullName to set. + * @return This builder for chaining. + */ + public Builder setFullNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fullName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList fullShape_ = emptyLongList(); + private void ensureFullShapeIsMutable() { + if (!fullShape_.isModifiable()) { + fullShape_ = makeMutableCopy(fullShape_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @return A list containing the fullShape. + */ + public java.util.List + getFullShapeList() { + fullShape_.makeImmutable(); + return fullShape_; + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @return The count of fullShape. + */ + public int getFullShapeCount() { + return fullShape_.size(); + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @param index The index of the element to return. + * @return The fullShape at the given index. + */ + public long getFullShape(int index) { + return fullShape_.getLong(index); + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @param index The index to set the value at. + * @param value The fullShape to set. + * @return This builder for chaining. + */ + public Builder setFullShape( + int index, long value) { + + ensureFullShapeIsMutable(); + fullShape_.setLong(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @param value The fullShape to add. + * @return This builder for chaining. + */ + public Builder addFullShape(long value) { + + ensureFullShapeIsMutable(); + fullShape_.addLong(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @param values The fullShape to add. + * @return This builder for chaining. + */ + public Builder addAllFullShape( + java.lang.Iterable values) { + ensureFullShapeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fullShape_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the full variable.
    +     * 
    + * + * repeated int64 full_shape = 2; + * @return This builder for chaining. + */ + public Builder clearFullShape() { + fullShape_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList varOffset_ = emptyLongList(); + private void ensureVarOffsetIsMutable() { + if (!varOffset_.isModifiable()) { + varOffset_ = makeMutableCopy(varOffset_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @return A list containing the varOffset. + */ + public java.util.List + getVarOffsetList() { + varOffset_.makeImmutable(); + return varOffset_; + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @return The count of varOffset. + */ + public int getVarOffsetCount() { + return varOffset_.size(); + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @param index The index of the element to return. + * @return The varOffset at the given index. + */ + public long getVarOffset(int index) { + return varOffset_.getLong(index); + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @param index The index to set the value at. + * @param value The varOffset to set. + * @return This builder for chaining. + */ + public Builder setVarOffset( + int index, long value) { + + ensureVarOffsetIsMutable(); + varOffset_.setLong(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @param value The varOffset to add. + * @return This builder for chaining. + */ + public Builder addVarOffset(long value) { + + ensureVarOffsetIsMutable(); + varOffset_.addLong(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @param values The varOffset to add. + * @return This builder for chaining. + */ + public Builder addAllVarOffset( + java.lang.Iterable values) { + ensureVarOffsetIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, varOffset_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Offset of this variable into the full variable.
    +     * 
    + * + * repeated int64 var_offset = 3; + * @return This builder for chaining. + */ + public Builder clearVarOffset() { + varOffset_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList varShape_ = emptyLongList(); + private void ensureVarShapeIsMutable() { + if (!varShape_.isModifiable()) { + varShape_ = makeMutableCopy(varShape_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @return A list containing the varShape. + */ + public java.util.List + getVarShapeList() { + varShape_.makeImmutable(); + return varShape_; + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @return The count of varShape. + */ + public int getVarShapeCount() { + return varShape_.size(); + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @param index The index of the element to return. + * @return The varShape at the given index. + */ + public long getVarShape(int index) { + return varShape_.getLong(index); + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @param index The index to set the value at. + * @param value The varShape to set. + * @return This builder for chaining. + */ + public Builder setVarShape( + int index, long value) { + + ensureVarShapeIsMutable(); + varShape_.setLong(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @param value The varShape to add. + * @return This builder for chaining. + */ + public Builder addVarShape(long value) { + + ensureVarShapeIsMutable(); + varShape_.addLong(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @param values The varShape to add. + * @return This builder for chaining. + */ + public Builder addAllVarShape( + java.lang.Iterable values) { + ensureVarShapeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, varShape_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Shape of this variable.
    +     * 
    + * + * repeated int64 var_shape = 4; + * @return This builder for chaining. + */ + public Builder clearVarShape() { + varShape_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SaveSliceInfoDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SaveSliceInfoDef) + private static final org.tensorflow.proto.SaveSliceInfoDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SaveSliceInfoDef(); + } + + public static org.tensorflow.proto.SaveSliceInfoDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SaveSliceInfoDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SaveSliceInfoDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDefOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDefOrBuilder.java index c06b53fbb61..b4cb42c9a44 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SaveSliceInfoDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaveSliceInfoDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/variable.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface SaveSliceInfoDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SaveSliceInfoDef) @@ -13,6 +15,7 @@ public interface SaveSliceInfoDefOrBuilder extends *
    * * string full_name = 1; + * @return The fullName. */ java.lang.String getFullName(); /** @@ -21,6 +24,7 @@ public interface SaveSliceInfoDefOrBuilder extends *
    * * string full_name = 1; + * @return The bytes for fullName. */ com.google.protobuf.ByteString getFullNameBytes(); @@ -31,6 +35,7 @@ public interface SaveSliceInfoDefOrBuilder extends *
    * * repeated int64 full_shape = 2; + * @return A list containing the fullShape. */ java.util.List getFullShapeList(); /** @@ -39,6 +44,7 @@ public interface SaveSliceInfoDefOrBuilder extends *
    * * repeated int64 full_shape = 2; + * @return The count of fullShape. */ int getFullShapeCount(); /** @@ -47,6 +53,8 @@ public interface SaveSliceInfoDefOrBuilder extends *
    * * repeated int64 full_shape = 2; + * @param index The index of the element to return. + * @return The fullShape at the given index. */ long getFullShape(int index); @@ -56,6 +64,7 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_offset = 3; + * @return A list containing the varOffset. */ java.util.List getVarOffsetList(); /** @@ -64,6 +73,7 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_offset = 3; + * @return The count of varOffset. */ int getVarOffsetCount(); /** @@ -72,6 +82,8 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_offset = 3; + * @param index The index of the element to return. + * @return The varOffset at the given index. */ long getVarOffset(int index); @@ -81,6 +93,7 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_shape = 4; + * @return A list containing the varShape. */ java.util.List getVarShapeList(); /** @@ -89,6 +102,7 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_shape = 4; + * @return The count of varShape. */ int getVarShapeCount(); /** @@ -97,6 +111,8 @@ public interface SaveSliceInfoDefOrBuilder extends * * * repeated int64 var_shape = 4; + * @param index The index of the element to return. + * @return The varShape at the given index. */ long getVarShape(int index); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModel.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModel.java new file mode 100644 index 00000000000..ff3c386eb60 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModel.java @@ -0,0 +1,912 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/saved_model.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * SavedModel is the high level serialization format for TensorFlow Models.
    + * See [todo: doc links, similar to session_bundle] for more information.
    + * 
    + * + * Protobuf type {@code tensorflow.SavedModel} + */ +public final class SavedModel extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedModel) + SavedModelOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedModel.class.getName()); + } + // Use SavedModel.newBuilder() to construct. + private SavedModel(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedModel() { + metaGraphs_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedModelProtos.internal_static_tensorflow_SavedModel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedModel.class, org.tensorflow.proto.SavedModel.Builder.class); + } + + public static final int SAVED_MODEL_SCHEMA_VERSION_FIELD_NUMBER = 1; + private long savedModelSchemaVersion_ = 0L; + /** + *
    +   * The schema version of the SavedModel instance. Used for versioning when
    +   * making future changes to the specification/implementation. Initial value
    +   * at release will be 1.
    +   * 
    + * + * int64 saved_model_schema_version = 1; + * @return The savedModelSchemaVersion. + */ + @java.lang.Override + public long getSavedModelSchemaVersion() { + return savedModelSchemaVersion_; + } + + public static final int META_GRAPHS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List metaGraphs_; + /** + *
    +   * One or more MetaGraphs.
    +   * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + @java.lang.Override + public java.util.List getMetaGraphsList() { + return metaGraphs_; + } + /** + *
    +   * One or more MetaGraphs.
    +   * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + @java.lang.Override + public java.util.List + getMetaGraphsOrBuilderList() { + return metaGraphs_; + } + /** + *
    +   * One or more MetaGraphs.
    +   * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + @java.lang.Override + public int getMetaGraphsCount() { + return metaGraphs_.size(); + } + /** + *
    +   * One or more MetaGraphs.
    +   * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + @java.lang.Override + public org.tensorflow.proto.MetaGraphDef getMetaGraphs(int index) { + return metaGraphs_.get(index); + } + /** + *
    +   * One or more MetaGraphs.
    +   * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + @java.lang.Override + public org.tensorflow.proto.MetaGraphDefOrBuilder getMetaGraphsOrBuilder( + int index) { + return metaGraphs_.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 { + if (savedModelSchemaVersion_ != 0L) { + output.writeInt64(1, savedModelSchemaVersion_); + } + for (int i = 0; i < metaGraphs_.size(); i++) { + output.writeMessage(2, metaGraphs_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (savedModelSchemaVersion_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, savedModelSchemaVersion_); + } + for (int i = 0; i < metaGraphs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, metaGraphs_.get(i)); + } + size += getUnknownFields().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.SavedModel)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedModel other = (org.tensorflow.proto.SavedModel) obj; + + if (getSavedModelSchemaVersion() + != other.getSavedModelSchemaVersion()) return false; + if (!getMetaGraphsList() + .equals(other.getMetaGraphsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SAVED_MODEL_SCHEMA_VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSavedModelSchemaVersion()); + if (getMetaGraphsCount() > 0) { + hash = (37 * hash) + META_GRAPHS_FIELD_NUMBER; + hash = (53 * hash) + getMetaGraphsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedModel parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedModel 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.SavedModel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedModel 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.SavedModel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedModel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedModel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedModel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedModel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedModel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedModel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedModel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedModel 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * SavedModel is the high level serialization format for TensorFlow Models.
    +   * See [todo: doc links, similar to session_bundle] for more information.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedModel} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedModel) + org.tensorflow.proto.SavedModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedModelProtos.internal_static_tensorflow_SavedModel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedModel.class, org.tensorflow.proto.SavedModel.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedModel.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + savedModelSchemaVersion_ = 0L; + if (metaGraphsBuilder_ == null) { + metaGraphs_ = java.util.Collections.emptyList(); + } else { + metaGraphs_ = null; + metaGraphsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedModelProtos.internal_static_tensorflow_SavedModel_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedModel getDefaultInstanceForType() { + return org.tensorflow.proto.SavedModel.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedModel build() { + org.tensorflow.proto.SavedModel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedModel buildPartial() { + org.tensorflow.proto.SavedModel result = new org.tensorflow.proto.SavedModel(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedModel result) { + if (metaGraphsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + metaGraphs_ = java.util.Collections.unmodifiableList(metaGraphs_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.metaGraphs_ = metaGraphs_; + } else { + result.metaGraphs_ = metaGraphsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedModel result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.savedModelSchemaVersion_ = savedModelSchemaVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedModel) { + return mergeFrom((org.tensorflow.proto.SavedModel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedModel other) { + if (other == org.tensorflow.proto.SavedModel.getDefaultInstance()) return this; + if (other.getSavedModelSchemaVersion() != 0L) { + setSavedModelSchemaVersion(other.getSavedModelSchemaVersion()); + } + if (metaGraphsBuilder_ == null) { + if (!other.metaGraphs_.isEmpty()) { + if (metaGraphs_.isEmpty()) { + metaGraphs_ = other.metaGraphs_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMetaGraphsIsMutable(); + metaGraphs_.addAll(other.metaGraphs_); + } + onChanged(); + } + } else { + if (!other.metaGraphs_.isEmpty()) { + if (metaGraphsBuilder_.isEmpty()) { + metaGraphsBuilder_.dispose(); + metaGraphsBuilder_ = null; + metaGraphs_ = other.metaGraphs_; + bitField0_ = (bitField0_ & ~0x00000002); + metaGraphsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMetaGraphsFieldBuilder() : null; + } else { + metaGraphsBuilder_.addAllMessages(other.metaGraphs_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + savedModelSchemaVersion_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + org.tensorflow.proto.MetaGraphDef m = + input.readMessage( + org.tensorflow.proto.MetaGraphDef.parser(), + extensionRegistry); + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + metaGraphs_.add(m); + } else { + metaGraphsBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long savedModelSchemaVersion_ ; + /** + *
    +     * The schema version of the SavedModel instance. Used for versioning when
    +     * making future changes to the specification/implementation. Initial value
    +     * at release will be 1.
    +     * 
    + * + * int64 saved_model_schema_version = 1; + * @return The savedModelSchemaVersion. + */ + @java.lang.Override + public long getSavedModelSchemaVersion() { + return savedModelSchemaVersion_; + } + /** + *
    +     * The schema version of the SavedModel instance. Used for versioning when
    +     * making future changes to the specification/implementation. Initial value
    +     * at release will be 1.
    +     * 
    + * + * int64 saved_model_schema_version = 1; + * @param value The savedModelSchemaVersion to set. + * @return This builder for chaining. + */ + public Builder setSavedModelSchemaVersion(long value) { + + savedModelSchemaVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The schema version of the SavedModel instance. Used for versioning when
    +     * making future changes to the specification/implementation. Initial value
    +     * at release will be 1.
    +     * 
    + * + * int64 saved_model_schema_version = 1; + * @return This builder for chaining. + */ + public Builder clearSavedModelSchemaVersion() { + bitField0_ = (bitField0_ & ~0x00000001); + savedModelSchemaVersion_ = 0L; + onChanged(); + return this; + } + + private java.util.List metaGraphs_ = + java.util.Collections.emptyList(); + private void ensureMetaGraphsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + metaGraphs_ = new java.util.ArrayList(metaGraphs_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetaGraphDef, org.tensorflow.proto.MetaGraphDef.Builder, org.tensorflow.proto.MetaGraphDefOrBuilder> metaGraphsBuilder_; + + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public java.util.List getMetaGraphsList() { + if (metaGraphsBuilder_ == null) { + return java.util.Collections.unmodifiableList(metaGraphs_); + } else { + return metaGraphsBuilder_.getMessageList(); + } + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public int getMetaGraphsCount() { + if (metaGraphsBuilder_ == null) { + return metaGraphs_.size(); + } else { + return metaGraphsBuilder_.getCount(); + } + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public org.tensorflow.proto.MetaGraphDef getMetaGraphs(int index) { + if (metaGraphsBuilder_ == null) { + return metaGraphs_.get(index); + } else { + return metaGraphsBuilder_.getMessage(index); + } + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder setMetaGraphs( + int index, org.tensorflow.proto.MetaGraphDef value) { + if (metaGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetaGraphsIsMutable(); + metaGraphs_.set(index, value); + onChanged(); + } else { + metaGraphsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder setMetaGraphs( + int index, org.tensorflow.proto.MetaGraphDef.Builder builderForValue) { + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + metaGraphs_.set(index, builderForValue.build()); + onChanged(); + } else { + metaGraphsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder addMetaGraphs(org.tensorflow.proto.MetaGraphDef value) { + if (metaGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetaGraphsIsMutable(); + metaGraphs_.add(value); + onChanged(); + } else { + metaGraphsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder addMetaGraphs( + int index, org.tensorflow.proto.MetaGraphDef value) { + if (metaGraphsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetaGraphsIsMutable(); + metaGraphs_.add(index, value); + onChanged(); + } else { + metaGraphsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder addMetaGraphs( + org.tensorflow.proto.MetaGraphDef.Builder builderForValue) { + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + metaGraphs_.add(builderForValue.build()); + onChanged(); + } else { + metaGraphsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder addMetaGraphs( + int index, org.tensorflow.proto.MetaGraphDef.Builder builderForValue) { + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + metaGraphs_.add(index, builderForValue.build()); + onChanged(); + } else { + metaGraphsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder addAllMetaGraphs( + java.lang.Iterable values) { + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, metaGraphs_); + onChanged(); + } else { + metaGraphsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder clearMetaGraphs() { + if (metaGraphsBuilder_ == null) { + metaGraphs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + metaGraphsBuilder_.clear(); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public Builder removeMetaGraphs(int index) { + if (metaGraphsBuilder_ == null) { + ensureMetaGraphsIsMutable(); + metaGraphs_.remove(index); + onChanged(); + } else { + metaGraphsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public org.tensorflow.proto.MetaGraphDef.Builder getMetaGraphsBuilder( + int index) { + return getMetaGraphsFieldBuilder().getBuilder(index); + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public org.tensorflow.proto.MetaGraphDefOrBuilder getMetaGraphsOrBuilder( + int index) { + if (metaGraphsBuilder_ == null) { + return metaGraphs_.get(index); } else { + return metaGraphsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public java.util.List + getMetaGraphsOrBuilderList() { + if (metaGraphsBuilder_ != null) { + return metaGraphsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metaGraphs_); + } + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public org.tensorflow.proto.MetaGraphDef.Builder addMetaGraphsBuilder() { + return getMetaGraphsFieldBuilder().addBuilder( + org.tensorflow.proto.MetaGraphDef.getDefaultInstance()); + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public org.tensorflow.proto.MetaGraphDef.Builder addMetaGraphsBuilder( + int index) { + return getMetaGraphsFieldBuilder().addBuilder( + index, org.tensorflow.proto.MetaGraphDef.getDefaultInstance()); + } + /** + *
    +     * One or more MetaGraphs.
    +     * 
    + * + * repeated .tensorflow.MetaGraphDef meta_graphs = 2; + */ + public java.util.List + getMetaGraphsBuilderList() { + return getMetaGraphsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetaGraphDef, org.tensorflow.proto.MetaGraphDef.Builder, org.tensorflow.proto.MetaGraphDefOrBuilder> + getMetaGraphsFieldBuilder() { + if (metaGraphsBuilder_ == null) { + metaGraphsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.MetaGraphDef, org.tensorflow.proto.MetaGraphDef.Builder, org.tensorflow.proto.MetaGraphDefOrBuilder>( + metaGraphs_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + metaGraphs_ = null; + } + return metaGraphsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedModel) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedModel) + private static final org.tensorflow.proto.SavedModel DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedModel(); + } + + public static org.tensorflow.proto.SavedModel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedModel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedModel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelOrBuilder.java index 9714aee34dd..eb43e5ed042 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SavedModelOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/saved_model.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface SavedModelOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SavedModel) @@ -15,6 +17,7 @@ public interface SavedModelOrBuilder extends * * * int64 saved_model_schema_version = 1; + * @return The savedModelSchemaVersion. */ long getSavedModelSchemaVersion(); @@ -25,7 +28,7 @@ public interface SavedModelOrBuilder extends * * repeated .tensorflow.MetaGraphDef meta_graphs = 2; */ - java.util.List + java.util.List getMetaGraphsList(); /** *
    @@ -34,7 +37,7 @@ public interface SavedModelOrBuilder extends
        *
        * repeated .tensorflow.MetaGraphDef meta_graphs = 2;
        */
    -  org.tensorflow.proto.framework.MetaGraphDef getMetaGraphs(int index);
    +  org.tensorflow.proto.MetaGraphDef getMetaGraphs(int index);
       /**
        * 
        * One or more MetaGraphs.
    @@ -50,7 +53,7 @@ public interface SavedModelOrBuilder extends
        *
        * repeated .tensorflow.MetaGraphDef meta_graphs = 2;
        */
    -  java.util.List 
    +  java.util.List 
           getMetaGraphsOrBuilderList();
       /**
        * 
    @@ -59,6 +62,6 @@ public interface SavedModelOrBuilder extends
        *
        * repeated .tensorflow.MetaGraphDef meta_graphs = 2;
        */
    -  org.tensorflow.proto.framework.MetaGraphDefOrBuilder getMetaGraphsOrBuilder(
    +  org.tensorflow.proto.MetaGraphDefOrBuilder getMetaGraphsOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelProtos.java
    new file mode 100644
    index 00000000000..8ccc28afce4
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedModelProtos.java
    @@ -0,0 +1,68 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/saved_model.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class SavedModelProtos {
    +  private SavedModelProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      SavedModelProtos.class.getName());
    +  }
    +  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_SavedModel_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SavedModel_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/saved_model.p" +
    +      "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\204\001\n" +
    +      "\024org.tensorflow.protoB\020SavedModelProtosP" +
    +      "\001ZUgithub.com/tensorflow/tensorflow/tens" +
    +      "orflow/go/core/protobuf/for_core_protos_" +
    +      "go_proto\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.MetaGraphProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_SavedModel_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_SavedModel_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SavedModel_descriptor,
    +        new java.lang.String[] { "SavedModelSchemaVersion", "MetaGraphs", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.MetaGraphProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedObjectGraphOuterClass.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedObjectGraphOuterClass.java
    new file mode 100644
    index 00000000000..b0a72357785
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedObjectGraphOuterClass.java
    @@ -0,0 +1,17035 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/saved_object_graph.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class SavedObjectGraphOuterClass {
    +  private SavedObjectGraphOuterClass() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      SavedObjectGraphOuterClass.class.getName());
    +  }
    +  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 SavedObjectGraphOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.SavedObjectGraph)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * 
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + java.util.List + getNodesList(); + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject getNodes(int index); + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + int getNodesCount(); + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + java.util.List + getNodesOrBuilderList(); + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder getNodesOrBuilder( + int index); + + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + int getConcreteFunctionsCount(); + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + boolean containsConcreteFunctions( + java.lang.String key); + /** + * Use {@link #getConcreteFunctionsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getConcreteFunctions(); + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + java.util.Map + getConcreteFunctionsMap(); + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction defaultValue); + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code tensorflow.SavedObjectGraph} + */ + public static final class SavedObjectGraph extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedObjectGraph) + SavedObjectGraphOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedObjectGraph.class.getName()); + } + // Use SavedObjectGraph.newBuilder() to construct. + private SavedObjectGraph(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedObjectGraph() { + nodes_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetConcreteFunctions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder.class); + } + + public static final int NODES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject getNodes(int index) { + return nodes_.get(index); + } + /** + *
    +     * Flattened list of objects in the object graph.
    +     *
    +     * The position of the object in this list indicates its id.
    +     * Nodes[0] is considered the root node.
    +     * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder getNodesOrBuilder( + int index) { + return nodes_.get(index); + } + + public static final int CONCRETE_FUNCTIONS_FIELD_NUMBER = 2; + private static final class ConcreteFunctionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction> concreteFunctions_; + private com.google.protobuf.MapField + internalGetConcreteFunctions() { + if (concreteFunctions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ConcreteFunctionsDefaultEntryHolder.defaultEntry); + } + return concreteFunctions_; + } + public int getConcreteFunctionsCount() { + return internalGetConcreteFunctions().getMap().size(); + } + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public boolean containsConcreteFunctions( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetConcreteFunctions().getMap().containsKey(key); + } + /** + * Use {@link #getConcreteFunctionsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getConcreteFunctions() { + return getConcreteFunctionsMap(); + } + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public java.util.Map getConcreteFunctionsMap() { + return internalGetConcreteFunctions().getMap(); + } + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetConcreteFunctions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Information about captures and output structures in concrete functions.
    +     * Referenced from SavedBareConcreteFunction and SavedFunction.
    +     * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetConcreteFunctions().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 { + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(1, nodes_.get(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetConcreteFunctions(), + ConcreteFunctionsDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, nodes_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetConcreteFunctions().getMap().entrySet()) { + com.google.protobuf.MapEntry + concreteFunctions__ = ConcreteFunctionsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, concreteFunctions__); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedObjectGraph)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph) obj; + + if (!getNodesList() + .equals(other.getNodesList())) return false; + if (!internalGetConcreteFunctions().equals( + other.internalGetConcreteFunctions())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + if (!internalGetConcreteFunctions().getMap().isEmpty()) { + hash = (37 * hash) + CONCRETE_FUNCTIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetConcreteFunctions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph 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.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph 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.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedObjectGraph 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SavedObjectGraph} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedObjectGraph) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetConcreteFunctions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableConcreteFunctions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableConcreteFunctions().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObjectGraph_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.concreteFunctions_ = internalGetConcreteFunctions().build(ConcreteFunctionsDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph.getDefaultInstance()) return this; + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodesFieldBuilder() : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + internalGetMutableConcreteFunctions().mergeFrom( + other.internalGetConcreteFunctions()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject m = + input.readMessage( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + concreteFunctions__ = input.readMessage( + ConcreteFunctionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableConcreteFunctions().ensureBuilderMap().put( + concreteFunctions__.getKey(), concreteFunctions__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder> nodesBuilder_; + + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder setNodes( + int index, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder setNodes( + int index, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder addNodes(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder addNodes( + int index, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder addNodes( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder addNodes( + int index, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder getNodesBuilder( + int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder addNodesBuilder() { + return getNodesFieldBuilder().addBuilder( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.getDefaultInstance()); + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder addNodesBuilder( + int index) { + return getNodesFieldBuilder().addBuilder( + index, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.getDefaultInstance()); + } + /** + *
    +       * Flattened list of objects in the object graph.
    +       *
    +       * The position of the object in this list indicates its id.
    +       * Nodes[0] is considered the root node.
    +       * 
    + * + * repeated .tensorflow.SavedObject nodes = 1; + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder>( + nodes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + private static final class ConcreteFunctionsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction build(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunctionOrBuilder val) { + if (val instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) { return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) val; } + return ((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return ConcreteFunctionsDefaultEntryHolder.defaultEntry; + } + }; + private static final ConcreteFunctionsConverter concreteFunctionsConverter = new ConcreteFunctionsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunctionOrBuilder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder> concreteFunctions_; + private com.google.protobuf.MapFieldBuilder + internalGetConcreteFunctions() { + if (concreteFunctions_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(concreteFunctionsConverter); + } + return concreteFunctions_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableConcreteFunctions() { + if (concreteFunctions_ == null) { + concreteFunctions_ = new com.google.protobuf.MapFieldBuilder<>(concreteFunctionsConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return concreteFunctions_; + } + public int getConcreteFunctionsCount() { + return internalGetConcreteFunctions().ensureBuilderMap().size(); + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public boolean containsConcreteFunctions( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetConcreteFunctions().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getConcreteFunctionsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getConcreteFunctions() { + return getConcreteFunctionsMap(); + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public java.util.Map getConcreteFunctionsMap() { + return internalGetConcreteFunctions().getImmutableMap(); + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableConcreteFunctions().ensureBuilderMap(); + return map.containsKey(key) ? concreteFunctionsConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getConcreteFunctionsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableConcreteFunctions().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return concreteFunctionsConverter.build(map.get(key)); + } + public Builder clearConcreteFunctions() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableConcreteFunctions().clear(); + return this; + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + public Builder removeConcreteFunctions( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableConcreteFunctions().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableConcreteFunctions() { + bitField0_ |= 0x00000002; + return internalGetMutableConcreteFunctions().ensureMessageMap(); + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + public Builder putConcreteFunctions( + java.lang.String key, + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableConcreteFunctions().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + public Builder putAllConcreteFunctions( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableConcreteFunctions().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Information about captures and output structures in concrete functions.
    +       * Referenced from SavedBareConcreteFunction and SavedFunction.
    +       * 
    + * + * map<string, .tensorflow.SavedConcreteFunction> concrete_functions = 2; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder putConcreteFunctionsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableConcreteFunctions().ensureBuilderMap(); + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunctionOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) { + entry = ((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedObjectGraph) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedObjectGraph) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectGraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedObjectGraph parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedObjectGraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedObjectOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedObject) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + java.util.List + getChildrenList(); + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index); + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + int getChildrenCount(); + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + java.util.List + getChildrenOrBuilderList(); + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index); + + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + java.util.List + getDependenciesList(); + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDependencies(int index); + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + int getDependenciesCount(); + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + java.util.List + getDependenciesOrBuilderList(); + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getDependenciesOrBuilder( + int index); + + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + java.util.List + getSlotVariablesList(); + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index); + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + int getSlotVariablesCount(); + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + java.util.List + getSlotVariablesOrBuilderList(); + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index); + + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return Whether the userObject field is set. + */ + boolean hasUserObject(); + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return The userObject. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject getUserObject(); + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder getUserObjectOrBuilder(); + + /** + * .tensorflow.SavedAsset asset = 5; + * @return Whether the asset field is set. + */ + boolean hasAsset(); + /** + * .tensorflow.SavedAsset asset = 5; + * @return The asset. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset getAsset(); + /** + * .tensorflow.SavedAsset asset = 5; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder getAssetOrBuilder(); + + /** + * .tensorflow.SavedFunction function = 6; + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * .tensorflow.SavedFunction function = 6; + * @return The function. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction getFunction(); + /** + * .tensorflow.SavedFunction function = 6; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder getFunctionOrBuilder(); + + /** + * .tensorflow.SavedVariable variable = 7; + * @return Whether the variable field is set. + */ + boolean hasVariable(); + /** + * .tensorflow.SavedVariable variable = 7; + * @return The variable. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable getVariable(); + /** + * .tensorflow.SavedVariable variable = 7; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder getVariableOrBuilder(); + + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return Whether the bareConcreteFunction field is set. + */ + boolean hasBareConcreteFunction(); + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return The bareConcreteFunction. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction getBareConcreteFunction(); + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder(); + + /** + * .tensorflow.SavedConstant constant = 9; + * @return Whether the constant field is set. + */ + boolean hasConstant(); + /** + * .tensorflow.SavedConstant constant = 9; + * @return The constant. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant getConstant(); + /** + * .tensorflow.SavedConstant constant = 9; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder getConstantOrBuilder(); + + /** + * .tensorflow.SavedResource resource = 10; + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * .tensorflow.SavedResource resource = 10; + * @return The resource. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource getResource(); + /** + * .tensorflow.SavedResource resource = 10; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder getResourceOrBuilder(); + + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return Whether the capturedTensor field is set. + */ + boolean hasCapturedTensor(); + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return The capturedTensor. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor getCapturedTensor(); + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder getCapturedTensorOrBuilder(); + + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + int getSaveableObjectsCount(); + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + boolean containsSaveableObjects( + java.lang.String key); + /** + * Use {@link #getSaveableObjectsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSaveableObjects(); + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + java.util.Map + getSaveableObjectsMap(); + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject defaultValue); + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrThrow( + java.lang.String key); + + /** + *
    +     * The name of the registered class of the form "{package}.{class_name}".
    +     * This field is used to search for the registered class at loading time.
    +     * 
    + * + * string registered_name = 13; + * @return The registeredName. + */ + java.lang.String getRegisteredName(); + /** + *
    +     * The name of the registered class of the form "{package}.{class_name}".
    +     * This field is used to search for the registered class at loading time.
    +     * 
    + * + * string registered_name = 13; + * @return The bytes for registeredName. + */ + com.google.protobuf.ByteString + getRegisteredNameBytes(); + + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return Whether the serializedUserProto field is set. + */ + boolean hasSerializedUserProto(); + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return The serializedUserProto. + */ + com.google.protobuf.Any getSerializedUserProto(); + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + com.google.protobuf.AnyOrBuilder getSerializedUserProtoOrBuilder(); + + /** + *
    +     * String name of the registered saver. At most one of `saveable_objects` or
    +     * `registered_saver` is defined for each SavedObject.
    +     * 
    + * + * string registered_saver = 16; + * @return The registeredSaver. + */ + java.lang.String getRegisteredSaver(); + /** + *
    +     * String name of the registered saver. At most one of `saveable_objects` or
    +     * `registered_saver` is defined for each SavedObject.
    +     * 
    + * + * string registered_saver = 16; + * @return The bytes for registeredSaver. + */ + com.google.protobuf.ByteString + getRegisteredSaverBytes(); + + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.KindCase getKindCase(); + } + /** + * Protobuf type {@code tensorflow.SavedObject} + */ + public static final class SavedObject extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedObject) + SavedObjectOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedObject.class.getName()); + } + // Use SavedObject.newBuilder() to construct. + private SavedObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedObject() { + children_ = java.util.Collections.emptyList(); + dependencies_ = java.util.Collections.emptyList(); + slotVariables_ = java.util.Collections.emptyList(); + registeredName_ = ""; + registeredSaver_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetSaveableObjects(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder.class); + } + + private int bitField0_; + private int kindCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object kind_; + public enum KindCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + USER_OBJECT(4), + ASSET(5), + FUNCTION(6), + VARIABLE(7), + BARE_CONCRETE_FUNCTION(8), + CONSTANT(9), + RESOURCE(10), + CAPTURED_TENSOR(12), + KIND_NOT_SET(0); + private final int value; + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 4: return USER_OBJECT; + case 5: return ASSET; + case 6: return FUNCTION; + case 7: return VARIABLE; + case 8: return BARE_CONCRETE_FUNCTION; + case 9: return CONSTANT; + case 10: return RESOURCE; + case 12: return CAPTURED_TENSOR; + case 0: return KIND_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public static final int CHILDREN_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List children_; + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public java.util.List getChildrenList() { + return children_; + } + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public java.util.List + getChildrenOrBuilderList() { + return children_; + } + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public int getChildrenCount() { + return children_.size(); + } + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { + return children_.get(index); + } + /** + *
    +     * Objects which this object depends on: named edges in the dependency
    +     * graph.
    +     *
    +     * Note: All kinds of SavedObject may have children, except
    +     * "constant" and "captured_tensor".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index) { + return children_.get(index); + } + + public static final int DEPENDENCIES_FIELD_NUMBER = 15; + @SuppressWarnings("serial") + private java.util.List dependencies_; + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + @java.lang.Override + public java.util.List getDependenciesList() { + return dependencies_; + } + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + @java.lang.Override + public java.util.List + getDependenciesOrBuilderList() { + return dependencies_; + } + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + @java.lang.Override + public int getDependenciesCount() { + return dependencies_.size(); + } + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDependencies(int index) { + return dependencies_.get(index); + } + /** + *
    +     * Ordered list of dependencies that must be loaded before this object.
    +     * SavedModel loads with the bottom-up approach, by first creating all objects
    +     * (in the order defined by the dependencies), then connecting the edges.
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getDependenciesOrBuilder( + int index) { + return dependencies_.get(index); + } + + public static final int SLOT_VARIABLES_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List slotVariables_; + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public java.util.List getSlotVariablesList() { + return slotVariables_; + } + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public java.util.List + getSlotVariablesOrBuilderList() { + return slotVariables_; + } + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public int getSlotVariablesCount() { + return slotVariables_.size(); + } + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { + return slotVariables_.get(index); + } + /** + *
    +     * Slot variables owned by this object. This describes the three-way
    +     * (optimizer, variable, slot variable) relationship; none of the three
    +     * depend on the others directly.
    +     *
    +     * Note: currently only valid if kind == "user_object".
    +     * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index) { + return slotVariables_.get(index); + } + + public static final int USER_OBJECT_FIELD_NUMBER = 4; + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return Whether the userObject field is set. + */ + @java.lang.Override + public boolean hasUserObject() { + return kindCase_ == 4; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return The userObject. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject getUserObject() { + if (kindCase_ == 4) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder getUserObjectOrBuilder() { + if (kindCase_ == 4) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + + public static final int ASSET_FIELD_NUMBER = 5; + /** + * .tensorflow.SavedAsset asset = 5; + * @return Whether the asset field is set. + */ + @java.lang.Override + public boolean hasAsset() { + return kindCase_ == 5; + } + /** + * .tensorflow.SavedAsset asset = 5; + * @return The asset. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset getAsset() { + if (kindCase_ == 5) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder getAssetOrBuilder() { + if (kindCase_ == 5) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + + public static final int FUNCTION_FIELD_NUMBER = 6; + /** + * .tensorflow.SavedFunction function = 6; + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return kindCase_ == 6; + } + /** + * .tensorflow.SavedFunction function = 6; + * @return The function. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction getFunction() { + if (kindCase_ == 6) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + /** + * .tensorflow.SavedFunction function = 6; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder getFunctionOrBuilder() { + if (kindCase_ == 6) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + + public static final int VARIABLE_FIELD_NUMBER = 7; + /** + * .tensorflow.SavedVariable variable = 7; + * @return Whether the variable field is set. + */ + @java.lang.Override + public boolean hasVariable() { + return kindCase_ == 7; + } + /** + * .tensorflow.SavedVariable variable = 7; + * @return The variable. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable getVariable() { + if (kindCase_ == 7) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder getVariableOrBuilder() { + if (kindCase_ == 7) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + + public static final int BARE_CONCRETE_FUNCTION_FIELD_NUMBER = 8; + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return Whether the bareConcreteFunction field is set. + */ + @java.lang.Override + public boolean hasBareConcreteFunction() { + return kindCase_ == 8; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return The bareConcreteFunction. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction getBareConcreteFunction() { + if (kindCase_ == 8) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder() { + if (kindCase_ == 8) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + + public static final int CONSTANT_FIELD_NUMBER = 9; + /** + * .tensorflow.SavedConstant constant = 9; + * @return Whether the constant field is set. + */ + @java.lang.Override + public boolean hasConstant() { + return kindCase_ == 9; + } + /** + * .tensorflow.SavedConstant constant = 9; + * @return The constant. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant getConstant() { + if (kindCase_ == 9) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder getConstantOrBuilder() { + if (kindCase_ == 9) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + + public static final int RESOURCE_FIELD_NUMBER = 10; + /** + * .tensorflow.SavedResource resource = 10; + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return kindCase_ == 10; + } + /** + * .tensorflow.SavedResource resource = 10; + * @return The resource. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource getResource() { + if (kindCase_ == 10) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + /** + * .tensorflow.SavedResource resource = 10; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder getResourceOrBuilder() { + if (kindCase_ == 10) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + + public static final int CAPTURED_TENSOR_FIELD_NUMBER = 12; + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return Whether the capturedTensor field is set. + */ + @java.lang.Override + public boolean hasCapturedTensor() { + return kindCase_ == 12; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return The capturedTensor. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor getCapturedTensor() { + if (kindCase_ == 12) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder getCapturedTensorOrBuilder() { + if (kindCase_ == 12) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + + public static final int SAVEABLE_OBJECTS_FIELD_NUMBER = 11; + private static final class SaveableObjectsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject> saveableObjects_; + private com.google.protobuf.MapField + internalGetSaveableObjects() { + if (saveableObjects_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SaveableObjectsDefaultEntryHolder.defaultEntry); + } + return saveableObjects_; + } + public int getSaveableObjectsCount() { + return internalGetSaveableObjects().getMap().size(); + } + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public boolean containsSaveableObjects( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSaveableObjects().getMap().containsKey(key); + } + /** + * Use {@link #getSaveableObjectsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSaveableObjects() { + return getSaveableObjectsMap(); + } + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public java.util.Map getSaveableObjectsMap() { + return internalGetSaveableObjects().getMap(); + } + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSaveableObjects().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Stores the functions used to save and restore this object. At most one of
    +     * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +     * See the comment below for the difference between SaveableObject and
    +     * registered savers.
    +     * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSaveableObjects().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int REGISTERED_NAME_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private volatile java.lang.Object registeredName_ = ""; + /** + *
    +     * The name of the registered class of the form "{package}.{class_name}".
    +     * This field is used to search for the registered class at loading time.
    +     * 
    + * + * string registered_name = 13; + * @return The registeredName. + */ + @java.lang.Override + public java.lang.String getRegisteredName() { + java.lang.Object ref = registeredName_; + 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(); + registeredName_ = s; + return s; + } + } + /** + *
    +     * The name of the registered class of the form "{package}.{class_name}".
    +     * This field is used to search for the registered class at loading time.
    +     * 
    + * + * string registered_name = 13; + * @return The bytes for registeredName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRegisteredNameBytes() { + java.lang.Object ref = registeredName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIALIZED_USER_PROTO_FIELD_NUMBER = 14; + private com.google.protobuf.Any serializedUserProto_; + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return Whether the serializedUserProto field is set. + */ + @java.lang.Override + public boolean hasSerializedUserProto() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return The serializedUserProto. + */ + @java.lang.Override + public com.google.protobuf.Any getSerializedUserProto() { + return serializedUserProto_ == null ? com.google.protobuf.Any.getDefaultInstance() : serializedUserProto_; + } + /** + *
    +     * The user-generated proto storing metadata for this object, to be passed to
    +     * the registered classes's _deserialize_from_proto method when this object is
    +     * loaded from the SavedModel.
    +     * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getSerializedUserProtoOrBuilder() { + return serializedUserProto_ == null ? com.google.protobuf.Any.getDefaultInstance() : serializedUserProto_; + } + + public static final int REGISTERED_SAVER_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private volatile java.lang.Object registeredSaver_ = ""; + /** + *
    +     * String name of the registered saver. At most one of `saveable_objects` or
    +     * `registered_saver` is defined for each SavedObject.
    +     * 
    + * + * string registered_saver = 16; + * @return The registeredSaver. + */ + @java.lang.Override + public java.lang.String getRegisteredSaver() { + java.lang.Object ref = registeredSaver_; + 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(); + registeredSaver_ = s; + return s; + } + } + /** + *
    +     * String name of the registered saver. At most one of `saveable_objects` or
    +     * `registered_saver` is defined for each SavedObject.
    +     * 
    + * + * string registered_saver = 16; + * @return The bytes for registeredSaver. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRegisteredSaverBytes() { + java.lang.Object ref = registeredSaver_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredSaver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + for (int i = 0; i < children_.size(); i++) { + output.writeMessage(1, children_.get(i)); + } + for (int i = 0; i < slotVariables_.size(); i++) { + output.writeMessage(3, slotVariables_.get(i)); + } + if (kindCase_ == 4) { + output.writeMessage(4, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_); + } + if (kindCase_ == 5) { + output.writeMessage(5, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_); + } + if (kindCase_ == 6) { + output.writeMessage(6, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_); + } + if (kindCase_ == 7) { + output.writeMessage(7, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_); + } + if (kindCase_ == 8) { + output.writeMessage(8, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_); + } + if (kindCase_ == 9) { + output.writeMessage(9, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_); + } + if (kindCase_ == 10) { + output.writeMessage(10, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetSaveableObjects(), + SaveableObjectsDefaultEntryHolder.defaultEntry, + 11); + if (kindCase_ == 12) { + output.writeMessage(12, (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, registeredName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(14, getSerializedUserProto()); + } + for (int i = 0; i < dependencies_.size(); i++) { + output.writeMessage(15, dependencies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredSaver_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, registeredSaver_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < children_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, children_.get(i)); + } + for (int i = 0; i < slotVariables_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, slotVariables_.get(i)); + } + if (kindCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_); + } + if (kindCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_); + } + if (kindCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_); + } + if (kindCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_); + } + if (kindCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_); + } + if (kindCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_); + } + if (kindCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_); + } + for (java.util.Map.Entry entry + : internalGetSaveableObjects().getMap().entrySet()) { + com.google.protobuf.MapEntry + saveableObjects__ = SaveableObjectsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, saveableObjects__); + } + if (kindCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, registeredName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getSerializedUserProto()); + } + for (int i = 0; i < dependencies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, dependencies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(registeredSaver_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, registeredSaver_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedObject)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject) obj; + + if (!getChildrenList() + .equals(other.getChildrenList())) return false; + if (!getDependenciesList() + .equals(other.getDependenciesList())) return false; + if (!getSlotVariablesList() + .equals(other.getSlotVariablesList())) return false; + if (!internalGetSaveableObjects().equals( + other.internalGetSaveableObjects())) return false; + if (!getRegisteredName() + .equals(other.getRegisteredName())) return false; + if (hasSerializedUserProto() != other.hasSerializedUserProto()) return false; + if (hasSerializedUserProto()) { + if (!getSerializedUserProto() + .equals(other.getSerializedUserProto())) return false; + } + if (!getRegisteredSaver() + .equals(other.getRegisteredSaver())) return false; + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 4: + if (!getUserObject() + .equals(other.getUserObject())) return false; + break; + case 5: + if (!getAsset() + .equals(other.getAsset())) return false; + break; + case 6: + if (!getFunction() + .equals(other.getFunction())) return false; + break; + case 7: + if (!getVariable() + .equals(other.getVariable())) return false; + break; + case 8: + if (!getBareConcreteFunction() + .equals(other.getBareConcreteFunction())) return false; + break; + case 9: + if (!getConstant() + .equals(other.getConstant())) return false; + break; + case 10: + if (!getResource() + .equals(other.getResource())) return false; + break; + case 12: + if (!getCapturedTensor() + .equals(other.getCapturedTensor())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getChildrenCount() > 0) { + hash = (37 * hash) + CHILDREN_FIELD_NUMBER; + hash = (53 * hash) + getChildrenList().hashCode(); + } + if (getDependenciesCount() > 0) { + hash = (37 * hash) + DEPENDENCIES_FIELD_NUMBER; + hash = (53 * hash) + getDependenciesList().hashCode(); + } + if (getSlotVariablesCount() > 0) { + hash = (37 * hash) + SLOT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getSlotVariablesList().hashCode(); + } + if (!internalGetSaveableObjects().getMap().isEmpty()) { + hash = (37 * hash) + SAVEABLE_OBJECTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetSaveableObjects().hashCode(); + } + hash = (37 * hash) + REGISTERED_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRegisteredName().hashCode(); + if (hasSerializedUserProto()) { + hash = (37 * hash) + SERIALIZED_USER_PROTO_FIELD_NUMBER; + hash = (53 * hash) + getSerializedUserProto().hashCode(); + } + hash = (37 * hash) + REGISTERED_SAVER_FIELD_NUMBER; + hash = (53 * hash) + getRegisteredSaver().hashCode(); + switch (kindCase_) { + case 4: + hash = (37 * hash) + USER_OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getUserObject().hashCode(); + break; + case 5: + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + break; + case 6: + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + break; + case 7: + hash = (37 * hash) + VARIABLE_FIELD_NUMBER; + hash = (53 * hash) + getVariable().hashCode(); + break; + case 8: + hash = (37 * hash) + BARE_CONCRETE_FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getBareConcreteFunction().hashCode(); + break; + case 9: + hash = (37 * hash) + CONSTANT_FIELD_NUMBER; + hash = (53 * hash) + getConstant().hashCode(); + break; + case 10: + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + break; + case 12: + hash = (37 * hash) + CAPTURED_TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getCapturedTensor().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject 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.SavedObjectGraphOuterClass.SavedObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject 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.SavedObjectGraphOuterClass.SavedObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedObject 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SavedObject} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedObject) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetSaveableObjects(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetMutableSaveableObjects(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getChildrenFieldBuilder(); + getDependenciesFieldBuilder(); + getSlotVariablesFieldBuilder(); + getSerializedUserProtoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + } else { + children_ = null; + childrenBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + } else { + dependencies_ = null; + dependenciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (slotVariablesBuilder_ == null) { + slotVariables_ = java.util.Collections.emptyList(); + } else { + slotVariables_ = null; + slotVariablesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (userObjectBuilder_ != null) { + userObjectBuilder_.clear(); + } + if (assetBuilder_ != null) { + assetBuilder_.clear(); + } + if (functionBuilder_ != null) { + functionBuilder_.clear(); + } + if (variableBuilder_ != null) { + variableBuilder_.clear(); + } + if (bareConcreteFunctionBuilder_ != null) { + bareConcreteFunctionBuilder_.clear(); + } + if (constantBuilder_ != null) { + constantBuilder_.clear(); + } + if (resourceBuilder_ != null) { + resourceBuilder_.clear(); + } + if (capturedTensorBuilder_ != null) { + capturedTensorBuilder_.clear(); + } + internalGetMutableSaveableObjects().clear(); + registeredName_ = ""; + serializedUserProto_ = null; + if (serializedUserProtoBuilder_ != null) { + serializedUserProtoBuilder_.dispose(); + serializedUserProtoBuilder_ = null; + } + registeredSaver_ = ""; + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedObject_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject result) { + if (childrenBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + children_ = java.util.Collections.unmodifiableList(children_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.children_ = children_; + } else { + result.children_ = childrenBuilder_.build(); + } + if (dependenciesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + dependencies_ = java.util.Collections.unmodifiableList(dependencies_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.dependencies_ = dependencies_; + } else { + result.dependencies_ = dependenciesBuilder_.build(); + } + if (slotVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.slotVariables_ = slotVariables_; + } else { + result.slotVariables_ = slotVariablesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000800) != 0)) { + result.saveableObjects_ = internalGetSaveableObjects().build(SaveableObjectsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.registeredName_ = registeredName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00002000) != 0)) { + result.serializedUserProto_ = serializedUserProtoBuilder_ == null + ? serializedUserProto_ + : serializedUserProtoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.registeredSaver_ = registeredSaver_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 4 && + userObjectBuilder_ != null) { + result.kind_ = userObjectBuilder_.build(); + } + if (kindCase_ == 5 && + assetBuilder_ != null) { + result.kind_ = assetBuilder_.build(); + } + if (kindCase_ == 6 && + functionBuilder_ != null) { + result.kind_ = functionBuilder_.build(); + } + if (kindCase_ == 7 && + variableBuilder_ != null) { + result.kind_ = variableBuilder_.build(); + } + if (kindCase_ == 8 && + bareConcreteFunctionBuilder_ != null) { + result.kind_ = bareConcreteFunctionBuilder_.build(); + } + if (kindCase_ == 9 && + constantBuilder_ != null) { + result.kind_ = constantBuilder_.build(); + } + if (kindCase_ == 10 && + resourceBuilder_ != null) { + result.kind_ = resourceBuilder_.build(); + } + if (kindCase_ == 12 && + capturedTensorBuilder_ != null) { + result.kind_ = capturedTensorBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject.getDefaultInstance()) return this; + if (childrenBuilder_ == null) { + if (!other.children_.isEmpty()) { + if (children_.isEmpty()) { + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChildrenIsMutable(); + children_.addAll(other.children_); + } + onChanged(); + } + } else { + if (!other.children_.isEmpty()) { + if (childrenBuilder_.isEmpty()) { + childrenBuilder_.dispose(); + childrenBuilder_ = null; + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000001); + childrenBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getChildrenFieldBuilder() : null; + } else { + childrenBuilder_.addAllMessages(other.children_); + } + } + } + if (dependenciesBuilder_ == null) { + if (!other.dependencies_.isEmpty()) { + if (dependencies_.isEmpty()) { + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDependenciesIsMutable(); + dependencies_.addAll(other.dependencies_); + } + onChanged(); + } + } else { + if (!other.dependencies_.isEmpty()) { + if (dependenciesBuilder_.isEmpty()) { + dependenciesBuilder_.dispose(); + dependenciesBuilder_ = null; + dependencies_ = other.dependencies_; + bitField0_ = (bitField0_ & ~0x00000002); + dependenciesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDependenciesFieldBuilder() : null; + } else { + dependenciesBuilder_.addAllMessages(other.dependencies_); + } + } + } + if (slotVariablesBuilder_ == null) { + if (!other.slotVariables_.isEmpty()) { + if (slotVariables_.isEmpty()) { + slotVariables_ = other.slotVariables_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSlotVariablesIsMutable(); + slotVariables_.addAll(other.slotVariables_); + } + onChanged(); + } + } else { + if (!other.slotVariables_.isEmpty()) { + if (slotVariablesBuilder_.isEmpty()) { + slotVariablesBuilder_.dispose(); + slotVariablesBuilder_ = null; + slotVariables_ = other.slotVariables_; + bitField0_ = (bitField0_ & ~0x00000004); + slotVariablesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSlotVariablesFieldBuilder() : null; + } else { + slotVariablesBuilder_.addAllMessages(other.slotVariables_); + } + } + } + internalGetMutableSaveableObjects().mergeFrom( + other.internalGetSaveableObjects()); + bitField0_ |= 0x00000800; + if (!other.getRegisteredName().isEmpty()) { + registeredName_ = other.registeredName_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (other.hasSerializedUserProto()) { + mergeSerializedUserProto(other.getSerializedUserProto()); + } + if (!other.getRegisteredSaver().isEmpty()) { + registeredSaver_ = other.registeredSaver_; + bitField0_ |= 0x00004000; + onChanged(); + } + switch (other.getKindCase()) { + case USER_OBJECT: { + mergeUserObject(other.getUserObject()); + break; + } + case ASSET: { + mergeAsset(other.getAsset()); + break; + } + case FUNCTION: { + mergeFunction(other.getFunction()); + break; + } + case VARIABLE: { + mergeVariable(other.getVariable()); + break; + } + case BARE_CONCRETE_FUNCTION: { + mergeBareConcreteFunction(other.getBareConcreteFunction()); + break; + } + case CONSTANT: { + mergeConstant(other.getConstant()); + break; + } + case RESOURCE: { + mergeResource(other.getResource()); + break; + } + case CAPTURED_TENSOR: { + mergeCapturedTensor(other.getCapturedTensor()); + break; + } + case KIND_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.parser(), + extensionRegistry); + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(m); + } else { + childrenBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.parser(), + extensionRegistry); + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(m); + } else { + slotVariablesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + input.readMessage( + getUserObjectFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: { + input.readMessage( + getAssetFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: { + input.readMessage( + getFunctionFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 58: { + input.readMessage( + getVariableFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 7; + break; + } // case 58 + case 66: { + input.readMessage( + getBareConcreteFunctionFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 8; + break; + } // case 66 + case 74: { + input.readMessage( + getConstantFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 9; + break; + } // case 74 + case 82: { + input.readMessage( + getResourceFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 10; + break; + } // case 82 + case 90: { + com.google.protobuf.MapEntry + saveableObjects__ = input.readMessage( + SaveableObjectsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSaveableObjects().ensureBuilderMap().put( + saveableObjects__.getKey(), saveableObjects__.getValue()); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: { + input.readMessage( + getCapturedTensorFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + case 106: { + registeredName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 114: { + input.readMessage( + getSerializedUserProtoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.parser(), + extensionRegistry); + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(m); + } else { + dependenciesBuilder_.addMessage(m); + } + break; + } // case 122 + case 130: { + registeredSaver_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 130 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int kindCase_ = 0; + private java.lang.Object kind_; + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.util.List children_ = + java.util.Collections.emptyList(); + private void ensureChildrenIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + children_ = new java.util.ArrayList(children_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> childrenBuilder_; + + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List getChildrenList() { + if (childrenBuilder_ == null) { + return java.util.Collections.unmodifiableList(children_); + } else { + return childrenBuilder_.getMessageList(); + } + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public int getChildrenCount() { + if (childrenBuilder_ == null) { + return children_.size(); + } else { + return childrenBuilder_.getCount(); + } + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { + if (childrenBuilder_ == null) { + return children_.get(index); + } else { + return childrenBuilder_.getMessage(index); + } + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder setChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.set(index, value); + onChanged(); + } else { + childrenBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder setChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.set(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(value); + onChanged(); + } else { + childrenBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(index, value); + onChanged(); + } else { + childrenBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addAllChildren( + java.lang.Iterable values) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, children_); + onChanged(); + } else { + childrenBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder clearChildren() { + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + childrenBuilder_.clear(); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder removeChildren(int index) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.remove(index); + onChanged(); + } else { + childrenBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder getChildrenBuilder( + int index) { + return getChildrenFieldBuilder().getBuilder(index); + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index) { + if (childrenBuilder_ == null) { + return children_.get(index); } else { + return childrenBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List + getChildrenOrBuilderList() { + if (childrenBuilder_ != null) { + return childrenBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(children_); + } + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder() { + return getChildrenFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder( + int index) { + return getChildrenFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +       * Objects which this object depends on: named edges in the dependency
    +       * graph.
    +       *
    +       * Note: All kinds of SavedObject may have children, except
    +       * "constant" and "captured_tensor".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List + getChildrenBuilderList() { + return getChildrenFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> + getChildrenFieldBuilder() { + if (childrenBuilder_ == null) { + childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder>( + children_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + children_ = null; + } + return childrenBuilder_; + } + + private java.util.List dependencies_ = + java.util.Collections.emptyList(); + private void ensureDependenciesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + dependencies_ = new java.util.ArrayList(dependencies_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> dependenciesBuilder_; + + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public java.util.List getDependenciesList() { + if (dependenciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dependencies_); + } else { + return dependenciesBuilder_.getMessageList(); + } + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public int getDependenciesCount() { + if (dependenciesBuilder_ == null) { + return dependencies_.size(); + } else { + return dependenciesBuilder_.getCount(); + } + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDependencies(int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); + } else { + return dependenciesBuilder_.getMessage(index); + } + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder setDependencies( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.set(index, value); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder setDependencies( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.set(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder addDependencies(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder addDependencies( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (dependenciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDependenciesIsMutable(); + dependencies_.add(index, value); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder addDependencies( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder addDependencies( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.add(index, builderForValue.build()); + onChanged(); + } else { + dependenciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder addAllDependencies( + java.lang.Iterable values) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dependencies_); + onChanged(); + } else { + dependenciesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder clearDependencies() { + if (dependenciesBuilder_ == null) { + dependencies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + dependenciesBuilder_.clear(); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public Builder removeDependencies(int index) { + if (dependenciesBuilder_ == null) { + ensureDependenciesIsMutable(); + dependencies_.remove(index); + onChanged(); + } else { + dependenciesBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder getDependenciesBuilder( + int index) { + return getDependenciesFieldBuilder().getBuilder(index); + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getDependenciesOrBuilder( + int index) { + if (dependenciesBuilder_ == null) { + return dependencies_.get(index); } else { + return dependenciesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public java.util.List + getDependenciesOrBuilderList() { + if (dependenciesBuilder_ != null) { + return dependenciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dependencies_); + } + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addDependenciesBuilder() { + return getDependenciesFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addDependenciesBuilder( + int index) { + return getDependenciesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +       * Ordered list of dependencies that must be loaded before this object.
    +       * SavedModel loads with the bottom-up approach, by first creating all objects
    +       * (in the order defined by the dependencies), then connecting the edges.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference dependencies = 15; + */ + public java.util.List + getDependenciesBuilderList() { + return getDependenciesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> + getDependenciesFieldBuilder() { + if (dependenciesBuilder_ == null) { + dependenciesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder>( + dependencies_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + dependencies_ = null; + } + return dependenciesBuilder_; + } + + private java.util.List slotVariables_ = + java.util.Collections.emptyList(); + private void ensureSlotVariablesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + slotVariables_ = new java.util.ArrayList(slotVariables_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> slotVariablesBuilder_; + + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List getSlotVariablesList() { + if (slotVariablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slotVariables_); + } else { + return slotVariablesBuilder_.getMessageList(); + } + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public int getSlotVariablesCount() { + if (slotVariablesBuilder_ == null) { + return slotVariables_.size(); + } else { + return slotVariablesBuilder_.getCount(); + } + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { + if (slotVariablesBuilder_ == null) { + return slotVariables_.get(index); + } else { + return slotVariablesBuilder_.getMessage(index); + } + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder setSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.set(index, value); + onChanged(); + } else { + slotVariablesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder setSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.set(index, builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.add(value); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.add(index, value); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(index, builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addAllSlotVariables( + java.lang.Iterable values) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slotVariables_); + onChanged(); + } else { + slotVariablesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder clearSlotVariables() { + if (slotVariablesBuilder_ == null) { + slotVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + slotVariablesBuilder_.clear(); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder removeSlotVariables(int index) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.remove(index); + onChanged(); + } else { + slotVariablesBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder getSlotVariablesBuilder( + int index) { + return getSlotVariablesFieldBuilder().getBuilder(index); + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index) { + if (slotVariablesBuilder_ == null) { + return slotVariables_.get(index); } else { + return slotVariablesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List + getSlotVariablesOrBuilderList() { + if (slotVariablesBuilder_ != null) { + return slotVariablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slotVariables_); + } + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder() { + return getSlotVariablesFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder( + int index) { + return getSlotVariablesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); + } + /** + *
    +       * Slot variables owned by this object. This describes the three-way
    +       * (optimizer, variable, slot variable) relationship; none of the three
    +       * depend on the others directly.
    +       *
    +       * Note: currently only valid if kind == "user_object".
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List + getSlotVariablesBuilderList() { + return getSlotVariablesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> + getSlotVariablesFieldBuilder() { + if (slotVariablesBuilder_ == null) { + slotVariablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder>( + slotVariables_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + slotVariables_ = null; + } + return slotVariablesBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder> userObjectBuilder_; + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return Whether the userObject field is set. + */ + @java.lang.Override + public boolean hasUserObject() { + return kindCase_ == 4; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + * @return The userObject. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject getUserObject() { + if (userObjectBuilder_ == null) { + if (kindCase_ == 4) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } else { + if (kindCase_ == 4) { + return userObjectBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + public Builder setUserObject(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject value) { + if (userObjectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + userObjectBuilder_.setMessage(value); + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + public Builder setUserObject( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder builderForValue) { + if (userObjectBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + userObjectBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + public Builder mergeUserObject(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject value) { + if (userObjectBuilder_ == null) { + if (kindCase_ == 4 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 4) { + userObjectBuilder_.mergeFrom(value); + } else { + userObjectBuilder_.setMessage(value); + } + } + kindCase_ = 4; + return this; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + public Builder clearUserObject() { + if (userObjectBuilder_ == null) { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + } + userObjectBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder getUserObjectBuilder() { + return getUserObjectFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder getUserObjectOrBuilder() { + if ((kindCase_ == 4) && (userObjectBuilder_ != null)) { + return userObjectBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 4) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedUserObject user_object = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder> + getUserObjectFieldBuilder() { + if (userObjectBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + userObjectBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 4; + onChanged(); + return userObjectBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder> assetBuilder_; + /** + * .tensorflow.SavedAsset asset = 5; + * @return Whether the asset field is set. + */ + @java.lang.Override + public boolean hasAsset() { + return kindCase_ == 5; + } + /** + * .tensorflow.SavedAsset asset = 5; + * @return The asset. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset getAsset() { + if (assetBuilder_ == null) { + if (kindCase_ == 5) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } else { + if (kindCase_ == 5) { + return assetBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + public Builder setAsset(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset value) { + if (assetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + assetBuilder_.setMessage(value); + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + public Builder setAsset( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder builderForValue) { + if (assetBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + assetBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + public Builder mergeAsset(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset value) { + if (assetBuilder_ == null) { + if (kindCase_ == 5 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 5) { + assetBuilder_.mergeFrom(value); + } else { + assetBuilder_.setMessage(value); + } + } + kindCase_ = 5; + return this; + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + public Builder clearAsset() { + if (assetBuilder_ == null) { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 5) { + kindCase_ = 0; + kind_ = null; + } + assetBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder getAssetBuilder() { + return getAssetFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder getAssetOrBuilder() { + if ((kindCase_ == 5) && (assetBuilder_ != null)) { + return assetBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 5) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedAsset asset = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + assetBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 5; + onChanged(); + return assetBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder> functionBuilder_; + /** + * .tensorflow.SavedFunction function = 6; + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return kindCase_ == 6; + } + /** + * .tensorflow.SavedFunction function = 6; + * @return The function. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction getFunction() { + if (functionBuilder_ == null) { + if (kindCase_ == 6) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } else { + if (kindCase_ == 6) { + return functionBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedFunction function = 6; + */ + public Builder setFunction(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + kindCase_ = 6; + return this; + } + /** + * .tensorflow.SavedFunction function = 6; + */ + public Builder setFunction( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder builderForValue) { + if (functionBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 6; + return this; + } + /** + * .tensorflow.SavedFunction function = 6; + */ + public Builder mergeFunction(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction value) { + if (functionBuilder_ == null) { + if (kindCase_ == 6 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 6) { + functionBuilder_.mergeFrom(value); + } else { + functionBuilder_.setMessage(value); + } + } + kindCase_ = 6; + return this; + } + /** + * .tensorflow.SavedFunction function = 6; + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 6) { + kindCase_ = 0; + kind_ = null; + } + functionBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedFunction function = 6; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder getFunctionBuilder() { + return getFunctionFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedFunction function = 6; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder getFunctionOrBuilder() { + if ((kindCase_ == 6) && (functionBuilder_ != null)) { + return functionBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 6) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedFunction function = 6; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + functionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 6; + onChanged(); + return functionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder> variableBuilder_; + /** + * .tensorflow.SavedVariable variable = 7; + * @return Whether the variable field is set. + */ + @java.lang.Override + public boolean hasVariable() { + return kindCase_ == 7; + } + /** + * .tensorflow.SavedVariable variable = 7; + * @return The variable. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable getVariable() { + if (variableBuilder_ == null) { + if (kindCase_ == 7) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } else { + if (kindCase_ == 7) { + return variableBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + public Builder setVariable(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable value) { + if (variableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + variableBuilder_.setMessage(value); + } + kindCase_ = 7; + return this; + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + public Builder setVariable( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder builderForValue) { + if (variableBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + variableBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 7; + return this; + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + public Builder mergeVariable(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable value) { + if (variableBuilder_ == null) { + if (kindCase_ == 7 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 7) { + variableBuilder_.mergeFrom(value); + } else { + variableBuilder_.setMessage(value); + } + } + kindCase_ = 7; + return this; + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + public Builder clearVariable() { + if (variableBuilder_ == null) { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 7) { + kindCase_ = 0; + kind_ = null; + } + variableBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder getVariableBuilder() { + return getVariableFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder getVariableOrBuilder() { + if ((kindCase_ == 7) && (variableBuilder_ != null)) { + return variableBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 7) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedVariable variable = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder> + getVariableFieldBuilder() { + if (variableBuilder_ == null) { + if (!(kindCase_ == 7)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + variableBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 7; + onChanged(); + return variableBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder> bareConcreteFunctionBuilder_; + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return Whether the bareConcreteFunction field is set. + */ + @java.lang.Override + public boolean hasBareConcreteFunction() { + return kindCase_ == 8; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + * @return The bareConcreteFunction. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction getBareConcreteFunction() { + if (bareConcreteFunctionBuilder_ == null) { + if (kindCase_ == 8) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } else { + if (kindCase_ == 8) { + return bareConcreteFunctionBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + public Builder setBareConcreteFunction(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction value) { + if (bareConcreteFunctionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + bareConcreteFunctionBuilder_.setMessage(value); + } + kindCase_ = 8; + return this; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + public Builder setBareConcreteFunction( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder builderForValue) { + if (bareConcreteFunctionBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + bareConcreteFunctionBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 8; + return this; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + public Builder mergeBareConcreteFunction(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction value) { + if (bareConcreteFunctionBuilder_ == null) { + if (kindCase_ == 8 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 8) { + bareConcreteFunctionBuilder_.mergeFrom(value); + } else { + bareConcreteFunctionBuilder_.setMessage(value); + } + } + kindCase_ = 8; + return this; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + public Builder clearBareConcreteFunction() { + if (bareConcreteFunctionBuilder_ == null) { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 8) { + kindCase_ = 0; + kind_ = null; + } + bareConcreteFunctionBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder getBareConcreteFunctionBuilder() { + return getBareConcreteFunctionFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder getBareConcreteFunctionOrBuilder() { + if ((kindCase_ == 8) && (bareConcreteFunctionBuilder_ != null)) { + return bareConcreteFunctionBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 8) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedBareConcreteFunction bare_concrete_function = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder> + getBareConcreteFunctionFieldBuilder() { + if (bareConcreteFunctionBuilder_ == null) { + if (!(kindCase_ == 8)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + bareConcreteFunctionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 8; + onChanged(); + return bareConcreteFunctionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder> constantBuilder_; + /** + * .tensorflow.SavedConstant constant = 9; + * @return Whether the constant field is set. + */ + @java.lang.Override + public boolean hasConstant() { + return kindCase_ == 9; + } + /** + * .tensorflow.SavedConstant constant = 9; + * @return The constant. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant getConstant() { + if (constantBuilder_ == null) { + if (kindCase_ == 9) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } else { + if (kindCase_ == 9) { + return constantBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + public Builder setConstant(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant value) { + if (constantBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + constantBuilder_.setMessage(value); + } + kindCase_ = 9; + return this; + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + public Builder setConstant( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder builderForValue) { + if (constantBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + constantBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 9; + return this; + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + public Builder mergeConstant(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant value) { + if (constantBuilder_ == null) { + if (kindCase_ == 9 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 9) { + constantBuilder_.mergeFrom(value); + } else { + constantBuilder_.setMessage(value); + } + } + kindCase_ = 9; + return this; + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + public Builder clearConstant() { + if (constantBuilder_ == null) { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 9) { + kindCase_ = 0; + kind_ = null; + } + constantBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder getConstantBuilder() { + return getConstantFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder getConstantOrBuilder() { + if ((kindCase_ == 9) && (constantBuilder_ != null)) { + return constantBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 9) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedConstant constant = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder> + getConstantFieldBuilder() { + if (constantBuilder_ == null) { + if (!(kindCase_ == 9)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + constantBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 9; + onChanged(); + return constantBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder> resourceBuilder_; + /** + * .tensorflow.SavedResource resource = 10; + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return kindCase_ == 10; + } + /** + * .tensorflow.SavedResource resource = 10; + * @return The resource. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource getResource() { + if (resourceBuilder_ == null) { + if (kindCase_ == 10) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } else { + if (kindCase_ == 10) { + return resourceBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedResource resource = 10; + */ + public Builder setResource(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + kindCase_ = 10; + return this; + } + /** + * .tensorflow.SavedResource resource = 10; + */ + public Builder setResource( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 10; + return this; + } + /** + * .tensorflow.SavedResource resource = 10; + */ + public Builder mergeResource(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource value) { + if (resourceBuilder_ == null) { + if (kindCase_ == 10 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 10) { + resourceBuilder_.mergeFrom(value); + } else { + resourceBuilder_.setMessage(value); + } + } + kindCase_ = 10; + return this; + } + /** + * .tensorflow.SavedResource resource = 10; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 10) { + kindCase_ = 0; + kind_ = null; + } + resourceBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.SavedResource resource = 10; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder getResourceBuilder() { + return getResourceFieldBuilder().getBuilder(); + } + /** + * .tensorflow.SavedResource resource = 10; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder getResourceOrBuilder() { + if ((kindCase_ == 10) && (resourceBuilder_ != null)) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 10) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + } + /** + * .tensorflow.SavedResource resource = 10; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + if (!(kindCase_ == 10)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 10; + onChanged(); + return resourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder> capturedTensorBuilder_; + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return Whether the capturedTensor field is set. + */ + @java.lang.Override + public boolean hasCapturedTensor() { + return kindCase_ == 12; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + * @return The capturedTensor. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor getCapturedTensor() { + if (capturedTensorBuilder_ == null) { + if (kindCase_ == 12) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } else { + if (kindCase_ == 12) { + return capturedTensorBuilder_.getMessage(); + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + public Builder setCapturedTensor(org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor value) { + if (capturedTensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + capturedTensorBuilder_.setMessage(value); + } + kindCase_ = 12; + return this; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + public Builder setCapturedTensor( + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder builderForValue) { + if (capturedTensorBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + capturedTensorBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 12; + return this; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + public Builder mergeCapturedTensor(org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor value) { + if (capturedTensorBuilder_ == null) { + if (kindCase_ == 12 && + kind_ != org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance()) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.newBuilder((org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 12) { + capturedTensorBuilder_.mergeFrom(value); + } else { + capturedTensorBuilder_.setMessage(value); + } + } + kindCase_ = 12; + return this; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + public Builder clearCapturedTensor() { + if (capturedTensorBuilder_ == null) { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + } + capturedTensorBuilder_.clear(); + } + return this; + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder getCapturedTensorBuilder() { + return getCapturedTensorFieldBuilder().getBuilder(); + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder getCapturedTensorOrBuilder() { + if ((kindCase_ == 12) && (capturedTensorBuilder_ != null)) { + return capturedTensorBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 12) { + return (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_; + } + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + } + /** + * .tensorflow.CapturedTensor captured_tensor = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder> + getCapturedTensorFieldBuilder() { + if (capturedTensorBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + capturedTensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder>( + (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 12; + onChanged(); + return capturedTensorBuilder_; + } + + private static final class SaveableObjectsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject build(org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObjectOrBuilder val) { + if (val instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) { return (org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) val; } + return ((org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return SaveableObjectsDefaultEntryHolder.defaultEntry; + } + }; + private static final SaveableObjectsConverter saveableObjectsConverter = new SaveableObjectsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObjectOrBuilder, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder> saveableObjects_; + private com.google.protobuf.MapFieldBuilder + internalGetSaveableObjects() { + if (saveableObjects_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(saveableObjectsConverter); + } + return saveableObjects_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableSaveableObjects() { + if (saveableObjects_ == null) { + saveableObjects_ = new com.google.protobuf.MapFieldBuilder<>(saveableObjectsConverter); + } + bitField0_ |= 0x00000800; + onChanged(); + return saveableObjects_; + } + public int getSaveableObjectsCount() { + return internalGetSaveableObjects().ensureBuilderMap().size(); + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public boolean containsSaveableObjects( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSaveableObjects().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getSaveableObjectsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSaveableObjects() { + return getSaveableObjectsMap(); + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public java.util.Map getSaveableObjectsMap() { + return internalGetSaveableObjects().getImmutableMap(); + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSaveableObjects().ensureBuilderMap(); + return map.containsKey(key) ? saveableObjectsConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getSaveableObjectsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSaveableObjects().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return saveableObjectsConverter.build(map.get(key)); + } + public Builder clearSaveableObjects() { + bitField0_ = (bitField0_ & ~0x00000800); + internalGetMutableSaveableObjects().clear(); + return this; + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + public Builder removeSaveableObjects( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSaveableObjects().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSaveableObjects() { + bitField0_ |= 0x00000800; + return internalGetMutableSaveableObjects().ensureMessageMap(); + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + public Builder putSaveableObjects( + java.lang.String key, + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableSaveableObjects().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000800; + return this; + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + public Builder putAllSaveableObjects( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableSaveableObjects().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000800; + return this; + } + /** + *
    +       * Stores the functions used to save and restore this object. At most one of
    +       * `saveable_objects` or `registered_saver` is defined for each SavedObject.
    +       * See the comment below for the difference between SaveableObject and
    +       * registered savers.
    +       * 
    + * + * map<string, .tensorflow.SaveableObject> saveable_objects = 11; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder putSaveableObjectsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableSaveableObjects().ensureBuilderMap(); + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObjectOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) { + entry = ((org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder) entry; + } + + private java.lang.Object registeredName_ = ""; + /** + *
    +       * The name of the registered class of the form "{package}.{class_name}".
    +       * This field is used to search for the registered class at loading time.
    +       * 
    + * + * string registered_name = 13; + * @return The registeredName. + */ + public java.lang.String getRegisteredName() { + java.lang.Object ref = registeredName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + registeredName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The name of the registered class of the form "{package}.{class_name}".
    +       * This field is used to search for the registered class at loading time.
    +       * 
    + * + * string registered_name = 13; + * @return The bytes for registeredName. + */ + public com.google.protobuf.ByteString + getRegisteredNameBytes() { + java.lang.Object ref = registeredName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The name of the registered class of the form "{package}.{class_name}".
    +       * This field is used to search for the registered class at loading time.
    +       * 
    + * + * string registered_name = 13; + * @param value The registeredName to set. + * @return This builder for chaining. + */ + public Builder setRegisteredName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + registeredName_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * The name of the registered class of the form "{package}.{class_name}".
    +       * This field is used to search for the registered class at loading time.
    +       * 
    + * + * string registered_name = 13; + * @return This builder for chaining. + */ + public Builder clearRegisteredName() { + registeredName_ = getDefaultInstance().getRegisteredName(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + *
    +       * The name of the registered class of the form "{package}.{class_name}".
    +       * This field is used to search for the registered class at loading time.
    +       * 
    + * + * string registered_name = 13; + * @param value The bytes for registeredName to set. + * @return This builder for chaining. + */ + public Builder setRegisteredNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + registeredName_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private com.google.protobuf.Any serializedUserProto_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> serializedUserProtoBuilder_; + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return Whether the serializedUserProto field is set. + */ + public boolean hasSerializedUserProto() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + * @return The serializedUserProto. + */ + public com.google.protobuf.Any getSerializedUserProto() { + if (serializedUserProtoBuilder_ == null) { + return serializedUserProto_ == null ? com.google.protobuf.Any.getDefaultInstance() : serializedUserProto_; + } else { + return serializedUserProtoBuilder_.getMessage(); + } + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public Builder setSerializedUserProto(com.google.protobuf.Any value) { + if (serializedUserProtoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serializedUserProto_ = value; + } else { + serializedUserProtoBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public Builder setSerializedUserProto( + com.google.protobuf.Any.Builder builderForValue) { + if (serializedUserProtoBuilder_ == null) { + serializedUserProto_ = builderForValue.build(); + } else { + serializedUserProtoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public Builder mergeSerializedUserProto(com.google.protobuf.Any value) { + if (serializedUserProtoBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + serializedUserProto_ != null && + serializedUserProto_ != com.google.protobuf.Any.getDefaultInstance()) { + getSerializedUserProtoBuilder().mergeFrom(value); + } else { + serializedUserProto_ = value; + } + } else { + serializedUserProtoBuilder_.mergeFrom(value); + } + if (serializedUserProto_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public Builder clearSerializedUserProto() { + bitField0_ = (bitField0_ & ~0x00002000); + serializedUserProto_ = null; + if (serializedUserProtoBuilder_ != null) { + serializedUserProtoBuilder_.dispose(); + serializedUserProtoBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public com.google.protobuf.Any.Builder getSerializedUserProtoBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getSerializedUserProtoFieldBuilder().getBuilder(); + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + public com.google.protobuf.AnyOrBuilder getSerializedUserProtoOrBuilder() { + if (serializedUserProtoBuilder_ != null) { + return serializedUserProtoBuilder_.getMessageOrBuilder(); + } else { + return serializedUserProto_ == null ? + com.google.protobuf.Any.getDefaultInstance() : serializedUserProto_; + } + } + /** + *
    +       * The user-generated proto storing metadata for this object, to be passed to
    +       * the registered classes's _deserialize_from_proto method when this object is
    +       * loaded from the SavedModel.
    +       * 
    + * + * .google.protobuf.Any serialized_user_proto = 14; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getSerializedUserProtoFieldBuilder() { + if (serializedUserProtoBuilder_ == null) { + serializedUserProtoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getSerializedUserProto(), + getParentForChildren(), + isClean()); + serializedUserProto_ = null; + } + return serializedUserProtoBuilder_; + } + + private java.lang.Object registeredSaver_ = ""; + /** + *
    +       * String name of the registered saver. At most one of `saveable_objects` or
    +       * `registered_saver` is defined for each SavedObject.
    +       * 
    + * + * string registered_saver = 16; + * @return The registeredSaver. + */ + public java.lang.String getRegisteredSaver() { + java.lang.Object ref = registeredSaver_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + registeredSaver_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * String name of the registered saver. At most one of `saveable_objects` or
    +       * `registered_saver` is defined for each SavedObject.
    +       * 
    + * + * string registered_saver = 16; + * @return The bytes for registeredSaver. + */ + public com.google.protobuf.ByteString + getRegisteredSaverBytes() { + java.lang.Object ref = registeredSaver_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + registeredSaver_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * String name of the registered saver. At most one of `saveable_objects` or
    +       * `registered_saver` is defined for each SavedObject.
    +       * 
    + * + * string registered_saver = 16; + * @param value The registeredSaver to set. + * @return This builder for chaining. + */ + public Builder setRegisteredSaver( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + registeredSaver_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +       * String name of the registered saver. At most one of `saveable_objects` or
    +       * `registered_saver` is defined for each SavedObject.
    +       * 
    + * + * string registered_saver = 16; + * @return This builder for chaining. + */ + public Builder clearRegisteredSaver() { + registeredSaver_ = getDefaultInstance().getRegisteredSaver(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + *
    +       * String name of the registered saver. At most one of `saveable_objects` or
    +       * `registered_saver` is defined for each SavedObject.
    +       * 
    + * + * string registered_saver = 16; + * @param value The bytes for registeredSaver to set. + * @return This builder for chaining. + */ + public Builder setRegisteredSaverBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + registeredSaver_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedObject) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedObject) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedUserObjectOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedUserObject) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Corresponds to a registration of the type to use in the loading program.
    +     * 
    + * + * string identifier = 1; + * @return The identifier. + */ + java.lang.String getIdentifier(); + /** + *
    +     * Corresponds to a registration of the type to use in the loading program.
    +     * 
    + * + * string identifier = 1; + * @return The bytes for identifier. + */ + com.google.protobuf.ByteString + getIdentifierBytes(); + + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + * @return Whether the version field is set. + */ + boolean hasVersion(); + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + * @return The version. + */ + org.tensorflow.proto.VersionDef getVersion(); + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + */ + org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder(); + + /** + *
    +     * Metadata for deserializing this object.
    +     *
    +     * Deprecated! At the time of deprecation, Keras was the only user of this
    +     * field, and its saving and loading code will be updated shortly.
    +     * Please save your application-specific metadata to a separate file.
    +     * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The metadata. + */ + @java.lang.Deprecated java.lang.String getMetadata(); + /** + *
    +     * Metadata for deserializing this object.
    +     *
    +     * Deprecated! At the time of deprecation, Keras was the only user of this
    +     * field, and its saving and loading code will be updated shortly.
    +     * Please save your application-specific metadata to a separate file.
    +     * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The bytes for metadata. + */ + @java.lang.Deprecated com.google.protobuf.ByteString + getMetadataBytes(); + } + /** + *
    +   * A SavedUserObject is an object (in the object-oriented language of the
    +   * TensorFlow program) of some user- or framework-defined class other than
    +   * those handled specifically by the other kinds of SavedObjects.
    +   *
    +   * This object cannot be evaluated as a tensor, and therefore cannot be bound
    +   * to an input of a function.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedUserObject} + */ + public static final class SavedUserObject extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedUserObject) + SavedUserObjectOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedUserObject.class.getName()); + } + // Use SavedUserObject.newBuilder() to construct. + private SavedUserObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedUserObject() { + identifier_ = ""; + metadata_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedUserObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedUserObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder.class); + } + + private int bitField0_; + public static final int IDENTIFIER_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object identifier_ = ""; + /** + *
    +     * Corresponds to a registration of the type to use in the loading program.
    +     * 
    + * + * string identifier = 1; + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + 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(); + identifier_ = s; + return s; + } + } + /** + *
    +     * Corresponds to a registration of the type to use in the loading program.
    +     * 
    + * + * string identifier = 1; + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private org.tensorflow.proto.VersionDef version_; + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + * @return Whether the version field is set. + */ + @java.lang.Override + public boolean hasVersion() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + * @return The version. + */ + @java.lang.Override + public org.tensorflow.proto.VersionDef getVersion() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + /** + *
    +     * Version information from the producer of this SavedUserObject.
    +     * 
    + * + * .tensorflow.VersionDef version = 2; + */ + @java.lang.Override + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object metadata_ = ""; + /** + *
    +     * Metadata for deserializing this object.
    +     *
    +     * Deprecated! At the time of deprecation, Keras was the only user of this
    +     * field, and its saving and loading code will be updated shortly.
    +     * Please save your application-specific metadata to a separate file.
    +     * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The metadata. + */ + @java.lang.Override + @java.lang.Deprecated public java.lang.String getMetadata() { + java.lang.Object ref = metadata_; + 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(); + metadata_ = s; + return s; + } + } + /** + *
    +     * Metadata for deserializing this object.
    +     *
    +     * Deprecated! At the time of deprecation, Keras was the only user of this
    +     * field, and its saving and loading code will be updated shortly.
    +     * Please save your application-specific metadata to a separate file.
    +     * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The bytes for metadata. + */ + @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString + getMetadataBytes() { + java.lang.Object ref = metadata_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metadata_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(identifier_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, identifier_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getVersion()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metadata_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, metadata_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(identifier_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, identifier_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getVersion()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metadata_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, metadata_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedUserObject)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) obj; + + if (!getIdentifier() + .equals(other.getIdentifier())) return false; + if (hasVersion() != other.hasVersion()) return false; + if (hasVersion()) { + if (!getVersion() + .equals(other.getVersion())) return false; + } + if (!getMetadata() + .equals(other.getMetadata())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + IDENTIFIER_FIELD_NUMBER; + hash = (53 * hash) + getIdentifier().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject 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.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject 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.SavedObjectGraphOuterClass.SavedUserObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedUserObject 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A SavedUserObject is an object (in the object-oriented language of the
    +     * TensorFlow program) of some user- or framework-defined class other than
    +     * those handled specifically by the other kinds of SavedObjects.
    +     *
    +     * This object cannot be evaluated as a tensor, and therefore cannot be bound
    +     * to an input of a function.
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedUserObject} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedUserObject) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedUserObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedUserObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getVersionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + identifier_ = ""; + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + metadata_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedUserObject_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.identifier_ = identifier_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = versionBuilder_ == null + ? version_ + : versionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = metadata_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject.getDefaultInstance()) return this; + if (!other.getIdentifier().isEmpty()) { + identifier_ = other.identifier_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + if (!other.getMetadata().isEmpty()) { + metadata_ = other.metadata_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + identifier_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getVersionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + metadata_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object identifier_ = ""; + /** + *
    +       * Corresponds to a registration of the type to use in the loading program.
    +       * 
    + * + * string identifier = 1; + * @return The identifier. + */ + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + identifier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Corresponds to a registration of the type to use in the loading program.
    +       * 
    + * + * string identifier = 1; + * @return The bytes for identifier. + */ + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Corresponds to a registration of the type to use in the loading program.
    +       * 
    + * + * string identifier = 1; + * @param value The identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifier( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + identifier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Corresponds to a registration of the type to use in the loading program.
    +       * 
    + * + * string identifier = 1; + * @return This builder for chaining. + */ + public Builder clearIdentifier() { + identifier_ = getDefaultInstance().getIdentifier(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Corresponds to a registration of the type to use in the loading program.
    +       * 
    + * + * string identifier = 1; + * @param value The bytes for identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifierBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + identifier_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.VersionDef version_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> versionBuilder_; + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + * @return Whether the version field is set. + */ + public boolean hasVersion() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + * @return The version. + */ + public org.tensorflow.proto.VersionDef getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public Builder setVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + } else { + versionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public Builder setVersion( + org.tensorflow.proto.VersionDef.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public Builder mergeVersion(org.tensorflow.proto.VersionDef value) { + if (versionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + version_ != null && + version_ != org.tensorflow.proto.VersionDef.getDefaultInstance()) { + getVersionBuilder().mergeFrom(value); + } else { + version_ = value; + } + } else { + versionBuilder_.mergeFrom(value); + } + if (version_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + version_ = null; + if (versionBuilder_ != null) { + versionBuilder_.dispose(); + versionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public org.tensorflow.proto.VersionDef.Builder getVersionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + public org.tensorflow.proto.VersionDefOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + org.tensorflow.proto.VersionDef.getDefaultInstance() : version_; + } + } + /** + *
    +       * Version information from the producer of this SavedUserObject.
    +       * 
    + * + * .tensorflow.VersionDef version = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + private java.lang.Object metadata_ = ""; + /** + *
    +       * Metadata for deserializing this object.
    +       *
    +       * Deprecated! At the time of deprecation, Keras was the only user of this
    +       * field, and its saving and loading code will be updated shortly.
    +       * Please save your application-specific metadata to a separate file.
    +       * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The metadata. + */ + @java.lang.Deprecated public java.lang.String getMetadata() { + java.lang.Object ref = metadata_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metadata_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Metadata for deserializing this object.
    +       *
    +       * Deprecated! At the time of deprecation, Keras was the only user of this
    +       * field, and its saving and loading code will be updated shortly.
    +       * Please save your application-specific metadata to a separate file.
    +       * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return The bytes for metadata. + */ + @java.lang.Deprecated public com.google.protobuf.ByteString + getMetadataBytes() { + java.lang.Object ref = metadata_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + metadata_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Metadata for deserializing this object.
    +       *
    +       * Deprecated! At the time of deprecation, Keras was the only user of this
    +       * field, and its saving and loading code will be updated shortly.
    +       * Please save your application-specific metadata to a separate file.
    +       * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @param value The metadata to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setMetadata( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + metadata_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Metadata for deserializing this object.
    +       *
    +       * Deprecated! At the time of deprecation, Keras was the only user of this
    +       * field, and its saving and loading code will be updated shortly.
    +       * Please save your application-specific metadata to a separate file.
    +       * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearMetadata() { + metadata_ = getDefaultInstance().getMetadata(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Metadata for deserializing this object.
    +       *
    +       * Deprecated! At the time of deprecation, Keras was the only user of this
    +       * field, and its saving and loading code will be updated shortly.
    +       * Please save your application-specific metadata to a separate file.
    +       * 
    + * + * string metadata = 3 [deprecated = true]; + * @deprecated tensorflow.SavedUserObject.metadata is deprecated. + * See tensorflow/core/protobuf/saved_object_graph.proto;l=123 + * @param value The bytes for metadata to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setMetadataBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + metadata_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedUserObject) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedUserObject) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedUserObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedUserObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedUserObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedAssetOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedAsset) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    +     *
    +     * Only the field `AssetFileDef.filename` is used. Other fields, such as
    +     * `AssetFileDef.tensor_info`, MUST be ignored.
    +     * 
    + * + * int32 asset_file_def_index = 1; + * @return The assetFileDefIndex. + */ + int getAssetFileDefIndex(); + } + /** + *
    +   * A SavedAsset points to an asset in the MetaGraph.
    +   *
    +   * When bound to a function this object evaluates to a tensor with the absolute
    +   * filename. Users should not depend on a particular part of the filename to
    +   * remain stable (e.g. basename could be changed).
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedAsset} + */ + public static final class SavedAsset extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedAsset) + SavedAssetOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedAsset.class.getName()); + } + // Use SavedAsset.newBuilder() to construct. + private SavedAsset(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedAsset() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedAsset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedAsset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder.class); + } + + public static final int ASSET_FILE_DEF_INDEX_FIELD_NUMBER = 1; + private int assetFileDefIndex_ = 0; + /** + *
    +     * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    +     *
    +     * Only the field `AssetFileDef.filename` is used. Other fields, such as
    +     * `AssetFileDef.tensor_info`, MUST be ignored.
    +     * 
    + * + * int32 asset_file_def_index = 1; + * @return The assetFileDefIndex. + */ + @java.lang.Override + public int getAssetFileDefIndex() { + return assetFileDefIndex_; + } + + 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 (assetFileDefIndex_ != 0) { + output.writeInt32(1, assetFileDefIndex_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (assetFileDefIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, assetFileDefIndex_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedAsset)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) obj; + + if (getAssetFileDefIndex() + != other.getAssetFileDefIndex()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ASSET_FILE_DEF_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getAssetFileDefIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset 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.SavedObjectGraphOuterClass.SavedAsset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset 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.SavedObjectGraphOuterClass.SavedAsset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedAsset 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A SavedAsset points to an asset in the MetaGraph.
    +     *
    +     * When bound to a function this object evaluates to a tensor with the absolute
    +     * filename. Users should not depend on a particular part of the filename to
    +     * remain stable (e.g. basename could be changed).
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedAsset} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedAsset) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedAsset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedAsset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + assetFileDefIndex_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedAsset_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.assetFileDefIndex_ = assetFileDefIndex_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset.getDefaultInstance()) return this; + if (other.getAssetFileDefIndex() != 0) { + setAssetFileDefIndex(other.getAssetFileDefIndex()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + assetFileDefIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int assetFileDefIndex_ ; + /** + *
    +       * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    +       *
    +       * Only the field `AssetFileDef.filename` is used. Other fields, such as
    +       * `AssetFileDef.tensor_info`, MUST be ignored.
    +       * 
    + * + * int32 asset_file_def_index = 1; + * @return The assetFileDefIndex. + */ + @java.lang.Override + public int getAssetFileDefIndex() { + return assetFileDefIndex_; + } + /** + *
    +       * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    +       *
    +       * Only the field `AssetFileDef.filename` is used. Other fields, such as
    +       * `AssetFileDef.tensor_info`, MUST be ignored.
    +       * 
    + * + * int32 asset_file_def_index = 1; + * @param value The assetFileDefIndex to set. + * @return This builder for chaining. + */ + public Builder setAssetFileDefIndex(int value) { + + assetFileDefIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Index into `MetaGraphDef.asset_file_def[]` that describes the Asset.
    +       *
    +       * Only the field `AssetFileDef.filename` is used. Other fields, such as
    +       * `AssetFileDef.tensor_info`, MUST be ignored.
    +       * 
    + * + * int32 asset_file_def_index = 1; + * @return This builder for chaining. + */ + public Builder clearAssetFileDefIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + assetFileDefIndex_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedAsset) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedAsset) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedAsset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedAsset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedAsset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedFunctionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedFunction) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string concrete_functions = 1; + * @return A list containing the concreteFunctions. + */ + java.util.List + getConcreteFunctionsList(); + /** + * repeated string concrete_functions = 1; + * @return The count of concreteFunctions. + */ + int getConcreteFunctionsCount(); + /** + * repeated string concrete_functions = 1; + * @param index The index of the element to return. + * @return The concreteFunctions at the given index. + */ + java.lang.String getConcreteFunctions(int index); + /** + * repeated string concrete_functions = 1; + * @param index The index of the value to return. + * @return The bytes of the concreteFunctions at the given index. + */ + com.google.protobuf.ByteString + getConcreteFunctionsBytes(int index); + + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return Whether the functionSpec field is set. + */ + boolean hasFunctionSpec(); + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return The functionSpec. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getFunctionSpec(); + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder(); + } + /** + *
    +   * A function with multiple signatures, possibly with non-Tensor arguments.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedFunction} + */ + public static final class SavedFunction extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedFunction) + SavedFunctionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedFunction.class.getName()); + } + // Use SavedFunction.newBuilder() to construct. + private SavedFunction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedFunction() { + concreteFunctions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder.class); + } + + private int bitField0_; + public static final int CONCRETE_FUNCTIONS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList concreteFunctions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string concrete_functions = 1; + * @return A list containing the concreteFunctions. + */ + public com.google.protobuf.ProtocolStringList + getConcreteFunctionsList() { + return concreteFunctions_; + } + /** + * repeated string concrete_functions = 1; + * @return The count of concreteFunctions. + */ + public int getConcreteFunctionsCount() { + return concreteFunctions_.size(); + } + /** + * repeated string concrete_functions = 1; + * @param index The index of the element to return. + * @return The concreteFunctions at the given index. + */ + public java.lang.String getConcreteFunctions(int index) { + return concreteFunctions_.get(index); + } + /** + * repeated string concrete_functions = 1; + * @param index The index of the value to return. + * @return The bytes of the concreteFunctions at the given index. + */ + public com.google.protobuf.ByteString + getConcreteFunctionsBytes(int index) { + return concreteFunctions_.getByteString(index); + } + + public static final int FUNCTION_SPEC_FIELD_NUMBER = 2; + private org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec functionSpec_; + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return Whether the functionSpec field is set. + */ + @java.lang.Override + public boolean hasFunctionSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return The functionSpec. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getFunctionSpec() { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance() : functionSpec_; + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance() : functionSpec_; + } + + 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 { + for (int i = 0; i < concreteFunctions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, concreteFunctions_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFunctionSpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < concreteFunctions_.size(); i++) { + dataSize += computeStringSizeNoTag(concreteFunctions_.getRaw(i)); + } + size += dataSize; + size += 1 * getConcreteFunctionsList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFunctionSpec()); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedFunction)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) obj; + + if (!getConcreteFunctionsList() + .equals(other.getConcreteFunctionsList())) return false; + if (hasFunctionSpec() != other.hasFunctionSpec()) return false; + if (hasFunctionSpec()) { + if (!getFunctionSpec() + .equals(other.getFunctionSpec())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConcreteFunctionsCount() > 0) { + hash = (37 * hash) + CONCRETE_FUNCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConcreteFunctionsList().hashCode(); + } + if (hasFunctionSpec()) { + hash = (37 * hash) + FUNCTION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getFunctionSpec().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction 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.SavedObjectGraphOuterClass.SavedFunction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction 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.SavedObjectGraphOuterClass.SavedFunction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedFunction 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A function with multiple signatures, possibly with non-Tensor arguments.
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedFunction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedFunction) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFunctionSpecFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + concreteFunctions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + functionSpec_ = null; + if (functionSpecBuilder_ != null) { + functionSpecBuilder_.dispose(); + functionSpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedFunction_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + concreteFunctions_.makeImmutable(); + result.concreteFunctions_ = concreteFunctions_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.functionSpec_ = functionSpecBuilder_ == null + ? functionSpec_ + : functionSpecBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction.getDefaultInstance()) return this; + if (!other.concreteFunctions_.isEmpty()) { + if (concreteFunctions_.isEmpty()) { + concreteFunctions_ = other.concreteFunctions_; + bitField0_ |= 0x00000001; + } else { + ensureConcreteFunctionsIsMutable(); + concreteFunctions_.addAll(other.concreteFunctions_); + } + onChanged(); + } + if (other.hasFunctionSpec()) { + mergeFunctionSpec(other.getFunctionSpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureConcreteFunctionsIsMutable(); + concreteFunctions_.add(s); + break; + } // case 10 + case 18: { + input.readMessage( + getFunctionSpecFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList concreteFunctions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureConcreteFunctionsIsMutable() { + if (!concreteFunctions_.isModifiable()) { + concreteFunctions_ = new com.google.protobuf.LazyStringArrayList(concreteFunctions_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string concrete_functions = 1; + * @return A list containing the concreteFunctions. + */ + public com.google.protobuf.ProtocolStringList + getConcreteFunctionsList() { + concreteFunctions_.makeImmutable(); + return concreteFunctions_; + } + /** + * repeated string concrete_functions = 1; + * @return The count of concreteFunctions. + */ + public int getConcreteFunctionsCount() { + return concreteFunctions_.size(); + } + /** + * repeated string concrete_functions = 1; + * @param index The index of the element to return. + * @return The concreteFunctions at the given index. + */ + public java.lang.String getConcreteFunctions(int index) { + return concreteFunctions_.get(index); + } + /** + * repeated string concrete_functions = 1; + * @param index The index of the value to return. + * @return The bytes of the concreteFunctions at the given index. + */ + public com.google.protobuf.ByteString + getConcreteFunctionsBytes(int index) { + return concreteFunctions_.getByteString(index); + } + /** + * repeated string concrete_functions = 1; + * @param index The index to set the value at. + * @param value The concreteFunctions to set. + * @return This builder for chaining. + */ + public Builder setConcreteFunctions( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureConcreteFunctionsIsMutable(); + concreteFunctions_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string concrete_functions = 1; + * @param value The concreteFunctions to add. + * @return This builder for chaining. + */ + public Builder addConcreteFunctions( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureConcreteFunctionsIsMutable(); + concreteFunctions_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string concrete_functions = 1; + * @param values The concreteFunctions to add. + * @return This builder for chaining. + */ + public Builder addAllConcreteFunctions( + java.lang.Iterable values) { + ensureConcreteFunctionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, concreteFunctions_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string concrete_functions = 1; + * @return This builder for chaining. + */ + public Builder clearConcreteFunctions() { + concreteFunctions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string concrete_functions = 1; + * @param value The bytes of the concreteFunctions to add. + * @return This builder for chaining. + */ + public Builder addConcreteFunctionsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureConcreteFunctionsIsMutable(); + concreteFunctions_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec functionSpec_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder> functionSpecBuilder_; + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return Whether the functionSpec field is set. + */ + public boolean hasFunctionSpec() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + * @return The functionSpec. + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getFunctionSpec() { + if (functionSpecBuilder_ == null) { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance() : functionSpec_; + } else { + return functionSpecBuilder_.getMessage(); + } + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public Builder setFunctionSpec(org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + functionSpec_ = value; + } else { + functionSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public Builder setFunctionSpec( + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder builderForValue) { + if (functionSpecBuilder_ == null) { + functionSpec_ = builderForValue.build(); + } else { + functionSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public Builder mergeFunctionSpec(org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + functionSpec_ != null && + functionSpec_ != org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance()) { + getFunctionSpecBuilder().mergeFrom(value); + } else { + functionSpec_ = value; + } + } else { + functionSpecBuilder_.mergeFrom(value); + } + if (functionSpec_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public Builder clearFunctionSpec() { + bitField0_ = (bitField0_ & ~0x00000002); + functionSpec_ = null; + if (functionSpecBuilder_ != null) { + functionSpecBuilder_.dispose(); + functionSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder getFunctionSpecBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFunctionSpecFieldBuilder().getBuilder(); + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + if (functionSpecBuilder_ != null) { + return functionSpecBuilder_.getMessageOrBuilder(); + } else { + return functionSpec_ == null ? + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance() : functionSpec_; + } + } + /** + * .tensorflow.FunctionSpec function_spec = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder> + getFunctionSpecFieldBuilder() { + if (functionSpecBuilder_ == null) { + functionSpecBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder>( + getFunctionSpec(), + getParentForChildren(), + isClean()); + functionSpec_ = null; + } + return functionSpecBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedFunction) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedFunction) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedFunction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedFunction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedFunction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CapturedTensorOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.CapturedTensor) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Name of captured tensor
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of captured tensor
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Name of concrete function which contains the computed graph tensor.
    +     * 
    + * + * string concrete_function = 2; + * @return The concreteFunction. + */ + java.lang.String getConcreteFunction(); + /** + *
    +     * Name of concrete function which contains the computed graph tensor.
    +     * 
    + * + * string concrete_function = 2; + * @return The bytes for concreteFunction. + */ + com.google.protobuf.ByteString + getConcreteFunctionBytes(); + } + /** + * Protobuf type {@code tensorflow.CapturedTensor} + */ + public static final class CapturedTensor extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.CapturedTensor) + CapturedTensorOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CapturedTensor.class.getName()); + } + // Use CapturedTensor.newBuilder() to construct. + private CapturedTensor(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CapturedTensor() { + name_ = ""; + concreteFunction_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_CapturedTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_CapturedTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.class, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of captured tensor
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of captured tensor
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 CONCRETE_FUNCTION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object concreteFunction_ = ""; + /** + *
    +     * Name of concrete function which contains the computed graph tensor.
    +     * 
    + * + * string concrete_function = 2; + * @return The concreteFunction. + */ + @java.lang.Override + public java.lang.String getConcreteFunction() { + java.lang.Object ref = concreteFunction_; + 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(); + concreteFunction_ = s; + return s; + } + } + /** + *
    +     * Name of concrete function which contains the computed graph tensor.
    +     * 
    + * + * string concrete_function = 2; + * @return The bytes for concreteFunction. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConcreteFunctionBytes() { + java.lang.Object ref = concreteFunction_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + concreteFunction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(concreteFunction_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, concreteFunction_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(concreteFunction_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, concreteFunction_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.CapturedTensor)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor other = (org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getConcreteFunction() + .equals(other.getConcreteFunction())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONCRETE_FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getConcreteFunction().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor 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.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor 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.SavedObjectGraphOuterClass.CapturedTensor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.CapturedTensor 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.CapturedTensor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.CapturedTensor) + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_CapturedTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_CapturedTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.class, org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + concreteFunction_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_CapturedTensor_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor result = new org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.concreteFunction_ = concreteFunction_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getConcreteFunction().isEmpty()) { + concreteFunction_ = other.concreteFunction_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + concreteFunction_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of captured tensor
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of captured tensor
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of captured tensor
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Name of captured tensor
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Name of captured tensor
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object concreteFunction_ = ""; + /** + *
    +       * Name of concrete function which contains the computed graph tensor.
    +       * 
    + * + * string concrete_function = 2; + * @return The concreteFunction. + */ + public java.lang.String getConcreteFunction() { + java.lang.Object ref = concreteFunction_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + concreteFunction_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Name of concrete function which contains the computed graph tensor.
    +       * 
    + * + * string concrete_function = 2; + * @return The bytes for concreteFunction. + */ + public com.google.protobuf.ByteString + getConcreteFunctionBytes() { + java.lang.Object ref = concreteFunction_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + concreteFunction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Name of concrete function which contains the computed graph tensor.
    +       * 
    + * + * string concrete_function = 2; + * @param value The concreteFunction to set. + * @return This builder for chaining. + */ + public Builder setConcreteFunction( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + concreteFunction_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Name of concrete function which contains the computed graph tensor.
    +       * 
    + * + * string concrete_function = 2; + * @return This builder for chaining. + */ + public Builder clearConcreteFunction() { + concreteFunction_ = getDefaultInstance().getConcreteFunction(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Name of concrete function which contains the computed graph tensor.
    +       * 
    + * + * string concrete_function = 2; + * @param value The bytes for concreteFunction to set. + * @return This builder for chaining. + */ + public Builder setConcreteFunctionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + concreteFunction_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.CapturedTensor) + } + + // @@protoc_insertion_point(class_scope:tensorflow.CapturedTensor) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.CapturedTensor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CapturedTensor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.CapturedTensor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedConcreteFunctionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedConcreteFunction) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 bound_inputs = 2; + * @return A list containing the boundInputs. + */ + java.util.List getBoundInputsList(); + /** + * repeated int32 bound_inputs = 2; + * @return The count of boundInputs. + */ + int getBoundInputsCount(); + /** + * repeated int32 bound_inputs = 2; + * @param index The index of the element to return. + * @return The boundInputs at the given index. + */ + int getBoundInputs(int index); + + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return Whether the canonicalizedInputSignature field is set. + */ + boolean hasCanonicalizedInputSignature(); + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return The canonicalizedInputSignature. + */ + org.tensorflow.proto.Struct.StructuredValue getCanonicalizedInputSignature(); + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder(); + + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return Whether the outputSignature field is set. + */ + boolean hasOutputSignature(); + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return The outputSignature. + */ + org.tensorflow.proto.Struct.StructuredValue getOutputSignature(); + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getOutputSignatureOrBuilder(); + } + /** + *
    +   * Stores low-level information about a concrete function. Referenced in either
    +   * a SavedFunction or a SavedBareConcreteFunction.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedConcreteFunction} + */ + public static final class SavedConcreteFunction extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedConcreteFunction) + SavedConcreteFunctionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedConcreteFunction.class.getName()); + } + // Use SavedConcreteFunction.newBuilder() to construct. + private SavedConcreteFunction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedConcreteFunction() { + boundInputs_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConcreteFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder.class); + } + + private int bitField0_; + public static final int BOUND_INPUTS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList boundInputs_ = + emptyIntList(); + /** + * repeated int32 bound_inputs = 2; + * @return A list containing the boundInputs. + */ + @java.lang.Override + public java.util.List + getBoundInputsList() { + return boundInputs_; + } + /** + * repeated int32 bound_inputs = 2; + * @return The count of boundInputs. + */ + public int getBoundInputsCount() { + return boundInputs_.size(); + } + /** + * repeated int32 bound_inputs = 2; + * @param index The index of the element to return. + * @return The boundInputs at the given index. + */ + public int getBoundInputs(int index) { + return boundInputs_.getInt(index); + } + private int boundInputsMemoizedSerializedSize = -1; + + public static final int CANONICALIZED_INPUT_SIGNATURE_FIELD_NUMBER = 3; + private org.tensorflow.proto.Struct.StructuredValue canonicalizedInputSignature_; + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return Whether the canonicalizedInputSignature field is set. + */ + @java.lang.Override + public boolean hasCanonicalizedInputSignature() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return The canonicalizedInputSignature. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getCanonicalizedInputSignature() { + return canonicalizedInputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; + } + /** + *
    +     * Input in canonicalized form that was received to create this concrete
    +     * function.
    +     * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder() { + return canonicalizedInputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; + } + + public static final int OUTPUT_SIGNATURE_FIELD_NUMBER = 4; + private org.tensorflow.proto.Struct.StructuredValue outputSignature_; + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return Whether the outputSignature field is set. + */ + @java.lang.Override + public boolean hasOutputSignature() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return The outputSignature. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getOutputSignature() { + return outputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : outputSignature_; + } + /** + *
    +     * Output that was the return value of this function after replacing all
    +     * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +     * be used to reconstruct the full structure from pure tensors.
    +     * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getOutputSignatureOrBuilder() { + return outputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : outputSignature_; + } + + 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 { + getSerializedSize(); + if (getBoundInputsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(boundInputsMemoizedSerializedSize); + } + for (int i = 0; i < boundInputs_.size(); i++) { + output.writeInt32NoTag(boundInputs_.getInt(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCanonicalizedInputSignature()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getOutputSignature()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < boundInputs_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(boundInputs_.getInt(i)); + } + size += dataSize; + if (!getBoundInputsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + boundInputsMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCanonicalizedInputSignature()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getOutputSignature()); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedConcreteFunction)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) obj; + + if (!getBoundInputsList() + .equals(other.getBoundInputsList())) return false; + if (hasCanonicalizedInputSignature() != other.hasCanonicalizedInputSignature()) return false; + if (hasCanonicalizedInputSignature()) { + if (!getCanonicalizedInputSignature() + .equals(other.getCanonicalizedInputSignature())) return false; + } + if (hasOutputSignature() != other.hasOutputSignature()) return false; + if (hasOutputSignature()) { + if (!getOutputSignature() + .equals(other.getOutputSignature())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBoundInputsCount() > 0) { + hash = (37 * hash) + BOUND_INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getBoundInputsList().hashCode(); + } + if (hasCanonicalizedInputSignature()) { + hash = (37 * hash) + CANONICALIZED_INPUT_SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getCanonicalizedInputSignature().hashCode(); + } + if (hasOutputSignature()) { + hash = (37 * hash) + OUTPUT_SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getOutputSignature().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction 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.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction 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.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedConcreteFunction 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Stores low-level information about a concrete function. Referenced in either
    +     * a SavedFunction or a SavedBareConcreteFunction.
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedConcreteFunction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedConcreteFunction) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConcreteFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getCanonicalizedInputSignatureFieldBuilder(); + getOutputSignatureFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + boundInputs_ = emptyIntList(); + canonicalizedInputSignature_ = null; + if (canonicalizedInputSignatureBuilder_ != null) { + canonicalizedInputSignatureBuilder_.dispose(); + canonicalizedInputSignatureBuilder_ = null; + } + outputSignature_ = null; + if (outputSignatureBuilder_ != null) { + outputSignatureBuilder_.dispose(); + outputSignatureBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConcreteFunction_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + boundInputs_.makeImmutable(); + result.boundInputs_ = boundInputs_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.canonicalizedInputSignature_ = canonicalizedInputSignatureBuilder_ == null + ? canonicalizedInputSignature_ + : canonicalizedInputSignatureBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputSignature_ = outputSignatureBuilder_ == null + ? outputSignature_ + : outputSignatureBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction.getDefaultInstance()) return this; + if (!other.boundInputs_.isEmpty()) { + if (boundInputs_.isEmpty()) { + boundInputs_ = other.boundInputs_; + boundInputs_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureBoundInputsIsMutable(); + boundInputs_.addAll(other.boundInputs_); + } + onChanged(); + } + if (other.hasCanonicalizedInputSignature()) { + mergeCanonicalizedInputSignature(other.getCanonicalizedInputSignature()); + } + if (other.hasOutputSignature()) { + mergeOutputSignature(other.getOutputSignature()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: { + int v = input.readInt32(); + ensureBoundInputsIsMutable(); + boundInputs_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureBoundInputsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + boundInputs_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 18 + case 26: { + input.readMessage( + getCanonicalizedInputSignatureFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: { + input.readMessage( + getOutputSignatureFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList boundInputs_ = emptyIntList(); + private void ensureBoundInputsIsMutable() { + if (!boundInputs_.isModifiable()) { + boundInputs_ = makeMutableCopy(boundInputs_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 bound_inputs = 2; + * @return A list containing the boundInputs. + */ + public java.util.List + getBoundInputsList() { + boundInputs_.makeImmutable(); + return boundInputs_; + } + /** + * repeated int32 bound_inputs = 2; + * @return The count of boundInputs. + */ + public int getBoundInputsCount() { + return boundInputs_.size(); + } + /** + * repeated int32 bound_inputs = 2; + * @param index The index of the element to return. + * @return The boundInputs at the given index. + */ + public int getBoundInputs(int index) { + return boundInputs_.getInt(index); + } + /** + * repeated int32 bound_inputs = 2; + * @param index The index to set the value at. + * @param value The boundInputs to set. + * @return This builder for chaining. + */ + public Builder setBoundInputs( + int index, int value) { + + ensureBoundInputsIsMutable(); + boundInputs_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 bound_inputs = 2; + * @param value The boundInputs to add. + * @return This builder for chaining. + */ + public Builder addBoundInputs(int value) { + + ensureBoundInputsIsMutable(); + boundInputs_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 bound_inputs = 2; + * @param values The boundInputs to add. + * @return This builder for chaining. + */ + public Builder addAllBoundInputs( + java.lang.Iterable values) { + ensureBoundInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, boundInputs_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 bound_inputs = 2; + * @return This builder for chaining. + */ + public Builder clearBoundInputs() { + boundInputs_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private org.tensorflow.proto.Struct.StructuredValue canonicalizedInputSignature_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> canonicalizedInputSignatureBuilder_; + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return Whether the canonicalizedInputSignature field is set. + */ + public boolean hasCanonicalizedInputSignature() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + * @return The canonicalizedInputSignature. + */ + public org.tensorflow.proto.Struct.StructuredValue getCanonicalizedInputSignature() { + if (canonicalizedInputSignatureBuilder_ == null) { + return canonicalizedInputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; + } else { + return canonicalizedInputSignatureBuilder_.getMessage(); + } + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public Builder setCanonicalizedInputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (canonicalizedInputSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + canonicalizedInputSignature_ = value; + } else { + canonicalizedInputSignatureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public Builder setCanonicalizedInputSignature( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (canonicalizedInputSignatureBuilder_ == null) { + canonicalizedInputSignature_ = builderForValue.build(); + } else { + canonicalizedInputSignatureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public Builder mergeCanonicalizedInputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (canonicalizedInputSignatureBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + canonicalizedInputSignature_ != null && + canonicalizedInputSignature_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getCanonicalizedInputSignatureBuilder().mergeFrom(value); + } else { + canonicalizedInputSignature_ = value; + } + } else { + canonicalizedInputSignatureBuilder_.mergeFrom(value); + } + if (canonicalizedInputSignature_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public Builder clearCanonicalizedInputSignature() { + bitField0_ = (bitField0_ & ~0x00000002); + canonicalizedInputSignature_ = null; + if (canonicalizedInputSignatureBuilder_ != null) { + canonicalizedInputSignatureBuilder_.dispose(); + canonicalizedInputSignatureBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getCanonicalizedInputSignatureBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCanonicalizedInputSignatureFieldBuilder().getBuilder(); + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getCanonicalizedInputSignatureOrBuilder() { + if (canonicalizedInputSignatureBuilder_ != null) { + return canonicalizedInputSignatureBuilder_.getMessageOrBuilder(); + } else { + return canonicalizedInputSignature_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : canonicalizedInputSignature_; + } + } + /** + *
    +       * Input in canonicalized form that was received to create this concrete
    +       * function.
    +       * 
    + * + * .tensorflow.StructuredValue canonicalized_input_signature = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getCanonicalizedInputSignatureFieldBuilder() { + if (canonicalizedInputSignatureBuilder_ == null) { + canonicalizedInputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getCanonicalizedInputSignature(), + getParentForChildren(), + isClean()); + canonicalizedInputSignature_ = null; + } + return canonicalizedInputSignatureBuilder_; + } + + private org.tensorflow.proto.Struct.StructuredValue outputSignature_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> outputSignatureBuilder_; + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return Whether the outputSignature field is set. + */ + public boolean hasOutputSignature() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + * @return The outputSignature. + */ + public org.tensorflow.proto.Struct.StructuredValue getOutputSignature() { + if (outputSignatureBuilder_ == null) { + return outputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : outputSignature_; + } else { + return outputSignatureBuilder_.getMessage(); + } + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public Builder setOutputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (outputSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputSignature_ = value; + } else { + outputSignatureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public Builder setOutputSignature( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (outputSignatureBuilder_ == null) { + outputSignature_ = builderForValue.build(); + } else { + outputSignatureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public Builder mergeOutputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (outputSignatureBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + outputSignature_ != null && + outputSignature_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getOutputSignatureBuilder().mergeFrom(value); + } else { + outputSignature_ = value; + } + } else { + outputSignatureBuilder_.mergeFrom(value); + } + if (outputSignature_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public Builder clearOutputSignature() { + bitField0_ = (bitField0_ & ~0x00000004); + outputSignature_ = null; + if (outputSignatureBuilder_ != null) { + outputSignatureBuilder_.dispose(); + outputSignatureBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getOutputSignatureBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOutputSignatureFieldBuilder().getBuilder(); + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getOutputSignatureOrBuilder() { + if (outputSignatureBuilder_ != null) { + return outputSignatureBuilder_.getMessageOrBuilder(); + } else { + return outputSignature_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : outputSignature_; + } + } + /** + *
    +       * Output that was the return value of this function after replacing all
    +       * Tensors with TensorSpecs. This can be an arbitrary nested function and will
    +       * be used to reconstruct the full structure from pure tensors.
    +       * 
    + * + * .tensorflow.StructuredValue output_signature = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getOutputSignatureFieldBuilder() { + if (outputSignatureBuilder_ == null) { + outputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getOutputSignature(), + getParentForChildren(), + isClean()); + outputSignature_ = null; + } + return outputSignatureBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedConcreteFunction) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedConcreteFunction) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConcreteFunction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedConcreteFunction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedConcreteFunction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedBareConcreteFunctionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedBareConcreteFunction) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Identifies a SavedConcreteFunction.
    +     * 
    + * + * string concrete_function_name = 1; + * @return The concreteFunctionName. + */ + java.lang.String getConcreteFunctionName(); + /** + *
    +     * Identifies a SavedConcreteFunction.
    +     * 
    + * + * string concrete_function_name = 1; + * @return The bytes for concreteFunctionName. + */ + com.google.protobuf.ByteString + getConcreteFunctionNameBytes(); + + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @return A list containing the argumentKeywords. + */ + java.util.List + getArgumentKeywordsList(); + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @return The count of argumentKeywords. + */ + int getArgumentKeywordsCount(); + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the element to return. + * @return The argumentKeywords at the given index. + */ + java.lang.String getArgumentKeywords(int index); + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the value to return. + * @return The bytes of the argumentKeywords at the given index. + */ + com.google.protobuf.ByteString + getArgumentKeywordsBytes(int index); + + /** + *
    +     * The prefix of `argument_keywords` which may be identified by position.
    +     * 
    + * + * int64 allowed_positional_arguments = 3; + * @return The allowedPositionalArguments. + */ + 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; + * @return Whether the functionSpec field is set. + */ + 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; + * @return The functionSpec. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.SavedBareConcreteFunction} + */ + public static final class SavedBareConcreteFunction extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedBareConcreteFunction) + SavedBareConcreteFunctionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedBareConcreteFunction.class.getName()); + } + // Use SavedBareConcreteFunction.newBuilder() to construct. + private SavedBareConcreteFunction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedBareConcreteFunction() { + concreteFunctionName_ = ""; + argumentKeywords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder.class); + } + + private int bitField0_; + public static final int CONCRETE_FUNCTION_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object concreteFunctionName_ = ""; + /** + *
    +     * Identifies a SavedConcreteFunction.
    +     * 
    + * + * string concrete_function_name = 1; + * @return The concreteFunctionName. + */ + @java.lang.Override + public java.lang.String getConcreteFunctionName() { + java.lang.Object ref = concreteFunctionName_; + 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(); + concreteFunctionName_ = s; + return s; + } + } + /** + *
    +     * Identifies a SavedConcreteFunction.
    +     * 
    + * + * string concrete_function_name = 1; + * @return The bytes for concreteFunctionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConcreteFunctionNameBytes() { + java.lang.Object ref = concreteFunctionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + concreteFunctionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARGUMENT_KEYWORDS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList argumentKeywords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @return A list containing the argumentKeywords. + */ + public com.google.protobuf.ProtocolStringList + getArgumentKeywordsList() { + return argumentKeywords_; + } + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @return The count of argumentKeywords. + */ + public int getArgumentKeywordsCount() { + return argumentKeywords_.size(); + } + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the element to return. + * @return The argumentKeywords at the given index. + */ + public java.lang.String getArgumentKeywords(int index) { + return argumentKeywords_.get(index); + } + /** + *
    +     * A sequence of unique strings, one per Tensor argument.
    +     * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the value to return. + * @return The bytes of the argumentKeywords at the given index. + */ + public com.google.protobuf.ByteString + getArgumentKeywordsBytes(int index) { + return argumentKeywords_.getByteString(index); + } + + public static final int ALLOWED_POSITIONAL_ARGUMENTS_FIELD_NUMBER = 3; + private long allowedPositionalArguments_ = 0L; + /** + *
    +     * The prefix of `argument_keywords` which may be identified by position.
    +     * 
    + * + * int64 allowed_positional_arguments = 3; + * @return The allowedPositionalArguments. + */ + @java.lang.Override + public long getAllowedPositionalArguments() { + return allowedPositionalArguments_; + } + + public static final int FUNCTION_SPEC_FIELD_NUMBER = 4; + private org.tensorflow.proto.SavedObjectGraphOuterClass.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; + * @return Whether the functionSpec field is set. + */ + @java.lang.Override + public boolean hasFunctionSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * 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; + * @return The functionSpec. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getFunctionSpec() { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.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; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance() : functionSpec_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(concreteFunctionName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, concreteFunctionName_); + } + for (int i = 0; i < argumentKeywords_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, argumentKeywords_.getRaw(i)); + } + if (allowedPositionalArguments_ != 0L) { + output.writeInt64(3, allowedPositionalArguments_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getFunctionSpec()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(concreteFunctionName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, concreteFunctionName_); + } + { + int dataSize = 0; + for (int i = 0; i < argumentKeywords_.size(); i++) { + dataSize += computeStringSizeNoTag(argumentKeywords_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgumentKeywordsList().size(); + } + if (allowedPositionalArguments_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, allowedPositionalArguments_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getFunctionSpec()); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedBareConcreteFunction)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) obj; + + if (!getConcreteFunctionName() + .equals(other.getConcreteFunctionName())) return false; + if (!getArgumentKeywordsList() + .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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONCRETE_FUNCTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConcreteFunctionName().hashCode(); + if (getArgumentKeywordsCount() > 0) { + hash = (37 * hash) + ARGUMENT_KEYWORDS_FIELD_NUMBER; + hash = (53 * hash) + getArgumentKeywordsList().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction 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.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction 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.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedBareConcreteFunction 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SavedBareConcreteFunction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedBareConcreteFunction) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFunctionSpecFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + concreteFunctionName_ = ""; + argumentKeywords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + allowedPositionalArguments_ = 0L; + functionSpec_ = null; + if (functionSpecBuilder_ != null) { + functionSpecBuilder_.dispose(); + functionSpecBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedBareConcreteFunction_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.concreteFunctionName_ = concreteFunctionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + argumentKeywords_.makeImmutable(); + result.argumentKeywords_ = argumentKeywords_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowedPositionalArguments_ = allowedPositionalArguments_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.functionSpec_ = functionSpecBuilder_ == null + ? functionSpec_ + : functionSpecBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction.getDefaultInstance()) return this; + if (!other.getConcreteFunctionName().isEmpty()) { + concreteFunctionName_ = other.concreteFunctionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.argumentKeywords_.isEmpty()) { + if (argumentKeywords_.isEmpty()) { + argumentKeywords_ = other.argumentKeywords_; + bitField0_ |= 0x00000002; + } else { + ensureArgumentKeywordsIsMutable(); + argumentKeywords_.addAll(other.argumentKeywords_); + } + onChanged(); + } + if (other.getAllowedPositionalArguments() != 0L) { + setAllowedPositionalArguments(other.getAllowedPositionalArguments()); + } + if (other.hasFunctionSpec()) { + mergeFunctionSpec(other.getFunctionSpec()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + concreteFunctionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureArgumentKeywordsIsMutable(); + argumentKeywords_.add(s); + break; + } // case 18 + case 24: { + allowedPositionalArguments_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getFunctionSpecFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object concreteFunctionName_ = ""; + /** + *
    +       * Identifies a SavedConcreteFunction.
    +       * 
    + * + * string concrete_function_name = 1; + * @return The concreteFunctionName. + */ + public java.lang.String getConcreteFunctionName() { + java.lang.Object ref = concreteFunctionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + concreteFunctionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Identifies a SavedConcreteFunction.
    +       * 
    + * + * string concrete_function_name = 1; + * @return The bytes for concreteFunctionName. + */ + public com.google.protobuf.ByteString + getConcreteFunctionNameBytes() { + java.lang.Object ref = concreteFunctionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + concreteFunctionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Identifies a SavedConcreteFunction.
    +       * 
    + * + * string concrete_function_name = 1; + * @param value The concreteFunctionName to set. + * @return This builder for chaining. + */ + public Builder setConcreteFunctionName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + concreteFunctionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Identifies a SavedConcreteFunction.
    +       * 
    + * + * string concrete_function_name = 1; + * @return This builder for chaining. + */ + public Builder clearConcreteFunctionName() { + concreteFunctionName_ = getDefaultInstance().getConcreteFunctionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Identifies a SavedConcreteFunction.
    +       * 
    + * + * string concrete_function_name = 1; + * @param value The bytes for concreteFunctionName to set. + * @return This builder for chaining. + */ + public Builder setConcreteFunctionNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + concreteFunctionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList argumentKeywords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureArgumentKeywordsIsMutable() { + if (!argumentKeywords_.isModifiable()) { + argumentKeywords_ = new com.google.protobuf.LazyStringArrayList(argumentKeywords_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @return A list containing the argumentKeywords. + */ + public com.google.protobuf.ProtocolStringList + getArgumentKeywordsList() { + argumentKeywords_.makeImmutable(); + return argumentKeywords_; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @return The count of argumentKeywords. + */ + public int getArgumentKeywordsCount() { + return argumentKeywords_.size(); + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the element to return. + * @return The argumentKeywords at the given index. + */ + public java.lang.String getArgumentKeywords(int index) { + return argumentKeywords_.get(index); + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param index The index of the value to return. + * @return The bytes of the argumentKeywords at the given index. + */ + public com.google.protobuf.ByteString + getArgumentKeywordsBytes(int index) { + return argumentKeywords_.getByteString(index); + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param index The index to set the value at. + * @param value The argumentKeywords to set. + * @return This builder for chaining. + */ + public Builder setArgumentKeywords( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgumentKeywordsIsMutable(); + argumentKeywords_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param value The argumentKeywords to add. + * @return This builder for chaining. + */ + public Builder addArgumentKeywords( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureArgumentKeywordsIsMutable(); + argumentKeywords_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param values The argumentKeywords to add. + * @return This builder for chaining. + */ + public Builder addAllArgumentKeywords( + java.lang.Iterable values) { + ensureArgumentKeywordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, argumentKeywords_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @return This builder for chaining. + */ + public Builder clearArgumentKeywords() { + argumentKeywords_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +       * A sequence of unique strings, one per Tensor argument.
    +       * 
    + * + * repeated string argument_keywords = 2; + * @param value The bytes of the argumentKeywords to add. + * @return This builder for chaining. + */ + public Builder addArgumentKeywordsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureArgumentKeywordsIsMutable(); + argumentKeywords_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long allowedPositionalArguments_ ; + /** + *
    +       * The prefix of `argument_keywords` which may be identified by position.
    +       * 
    + * + * int64 allowed_positional_arguments = 3; + * @return The allowedPositionalArguments. + */ + @java.lang.Override + public long getAllowedPositionalArguments() { + return allowedPositionalArguments_; + } + /** + *
    +       * The prefix of `argument_keywords` which may be identified by position.
    +       * 
    + * + * int64 allowed_positional_arguments = 3; + * @param value The allowedPositionalArguments to set. + * @return This builder for chaining. + */ + public Builder setAllowedPositionalArguments(long value) { + + allowedPositionalArguments_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The prefix of `argument_keywords` which may be identified by position.
    +       * 
    + * + * int64 allowed_positional_arguments = 3; + * @return This builder for chaining. + */ + public Builder clearAllowedPositionalArguments() { + bitField0_ = (bitField0_ & ~0x00000004); + allowedPositionalArguments_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec functionSpec_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.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; + * @return Whether the functionSpec field is set. + */ + public boolean hasFunctionSpec() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +       * 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; + * @return The functionSpec. + */ + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getFunctionSpec() { + if (functionSpecBuilder_ == null) { + return functionSpec_ == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + functionSpec_ = value; + } else { + functionSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + 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.SavedObjectGraphOuterClass.FunctionSpec.Builder builderForValue) { + if (functionSpecBuilder_ == null) { + functionSpec_ = builderForValue.build(); + } else { + functionSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + 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.SavedObjectGraphOuterClass.FunctionSpec value) { + if (functionSpecBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + functionSpec_ != null && + functionSpec_ != org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance()) { + getFunctionSpecBuilder().mergeFrom(value); + } else { + functionSpec_ = value; + } + } else { + functionSpecBuilder_.mergeFrom(value); + } + if (functionSpec_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + 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() { + bitField0_ = (bitField0_ & ~0x00000008); + functionSpec_ = null; + if (functionSpecBuilder_ != null) { + functionSpecBuilder_.dispose(); + functionSpecBuilder_ = null; + } + onChanged(); + 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.SavedObjectGraphOuterClass.FunctionSpec.Builder getFunctionSpecBuilder() { + bitField0_ |= 0x00000008; + 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.SavedObjectGraphOuterClass.FunctionSpecOrBuilder getFunctionSpecOrBuilder() { + if (functionSpecBuilder_ != null) { + return functionSpecBuilder_.getMessageOrBuilder(); + } else { + return functionSpec_ == null ? + org.tensorflow.proto.SavedObjectGraphOuterClass.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.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder> + getFunctionSpecFieldBuilder() { + if (functionSpecBuilder_ == null) { + functionSpecBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder>( + getFunctionSpec(), + getParentForChildren(), + isClean()); + functionSpec_ = null; + } + return functionSpecBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedBareConcreteFunction) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedBareConcreteFunction) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedBareConcreteFunction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedBareConcreteFunction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedBareConcreteFunction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedConstantOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedConstant) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +     * 
    + * + * string operation = 1; + * @return The operation. + */ + java.lang.String getOperation(); + /** + *
    +     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +     * 
    + * + * string operation = 1; + * @return The bytes for operation. + */ + com.google.protobuf.ByteString + getOperationBytes(); + } + /** + * Protobuf type {@code tensorflow.SavedConstant} + */ + public static final class SavedConstant extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedConstant) + SavedConstantOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedConstant.class.getName()); + } + // Use SavedConstant.newBuilder() to construct. + private SavedConstant(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedConstant() { + operation_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConstant_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConstant_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** + *
    +     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +     * 
    + * + * string operation = 1; + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + *
    +     * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +     * 
    + * + * string operation = 1; + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, operation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, operation_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedConstant)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) obj; + + if (!getOperation() + .equals(other.getOperation())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant 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.SavedObjectGraphOuterClass.SavedConstant parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant 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.SavedObjectGraphOuterClass.SavedConstant parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedConstant 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SavedConstant} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedConstant) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstantOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConstant_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConstant_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedConstant_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant.getDefaultInstance()) return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object operation_ = ""; + /** + *
    +       * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +       * 
    + * + * string operation = 1; + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +       * 
    + * + * string operation = 1; + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +       * 
    + * + * string operation = 1; + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +       * 
    + * + * string operation = 1; + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * An Operation name for a ConstantOp in this SavedObjectGraph's MetaGraph.
    +       * 
    + * + * string operation = 1; + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedConstant) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedConstant) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedConstant getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedConstant parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedConstant getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedVariableOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedVariable) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * bool trainable = 3; + * @return The trainable. + */ + boolean getTrainable(); + + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The enum numeric value on the wire for synchronization. + */ + int getSynchronizationValue(); + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The synchronization. + */ + org.tensorflow.proto.VariableSynchronization getSynchronization(); + + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The enum numeric value on the wire for aggregation. + */ + int getAggregationValue(); + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The aggregation. + */ + org.tensorflow.proto.VariableAggregation getAggregation(); + + /** + * string name = 6; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 6; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string device = 7; + * @return The device. + */ + java.lang.String getDevice(); + /** + * string device = 7; + * @return The bytes for device. + */ + 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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.SavedVariableOrBuilder getExperimentalDistributedVariableComponentsOrBuilder( + int index); + } + /** + *
    +   * Represents a Variable that is initialized by loading the contents from the
    +   * checkpoint.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedVariable} + */ + public static final class SavedVariable extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedVariable) + SavedVariableOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedVariable.class.getName()); + } + // Use SavedVariable.newBuilder() to construct. + private SavedVariable(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedVariable() { + dtype_ = 0; + synchronization_ = 0; + aggregation_ = 0; + name_ = ""; + device_ = ""; + experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedVariable_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedVariable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int TRAINABLE_FIELD_NUMBER = 3; + private boolean trainable_ = false; + /** + * bool trainable = 3; + * @return The trainable. + */ + @java.lang.Override + public boolean getTrainable() { + return trainable_; + } + + public static final int SYNCHRONIZATION_FIELD_NUMBER = 4; + private int synchronization_ = 0; + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The enum numeric value on the wire for synchronization. + */ + @java.lang.Override public int getSynchronizationValue() { + return synchronization_; + } + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The synchronization. + */ + @java.lang.Override public org.tensorflow.proto.VariableSynchronization getSynchronization() { + org.tensorflow.proto.VariableSynchronization result = org.tensorflow.proto.VariableSynchronization.forNumber(synchronization_); + return result == null ? org.tensorflow.proto.VariableSynchronization.UNRECOGNIZED : result; + } + + public static final int AGGREGATION_FIELD_NUMBER = 5; + private int aggregation_ = 0; + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The enum numeric value on the wire for aggregation. + */ + @java.lang.Override public int getAggregationValue() { + return aggregation_; + } + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The aggregation. + */ + @java.lang.Override public org.tensorflow.proto.VariableAggregation getAggregation() { + org.tensorflow.proto.VariableAggregation result = org.tensorflow.proto.VariableAggregation.forNumber(aggregation_); + return result == null ? org.tensorflow.proto.VariableAggregation.UNRECOGNIZED : result; + } + + public static final int NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 6; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 6; + * @return The bytes for name. + */ + @java.lang.Override + 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_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + * string device = 7; + * @return The device. + */ + @java.lang.Override + 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; + * @return The bytes for device. + */ + @java.lang.Override + 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; + @SuppressWarnings("serial") + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.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; + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder getExperimentalDistributedVariableComponentsOrBuilder( + int index) { + return experimentalDistributedVariableComponents_.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 { + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (trainable_ != false) { + output.writeBool(3, trainable_); + } + if (synchronization_ != org.tensorflow.proto.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { + output.writeEnum(4, synchronization_); + } + if (aggregation_ != org.tensorflow.proto.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { + output.writeEnum(5, aggregation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, device_); + } + for (int i = 0; i < experimentalDistributedVariableComponents_.size(); i++) { + output.writeMessage(8, experimentalDistributedVariableComponents_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (trainable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, trainable_); + } + if (synchronization_ != org.tensorflow.proto.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, synchronization_); + } + if (aggregation_ != org.tensorflow.proto.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, aggregation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, device_); + } + for (int i = 0; i < experimentalDistributedVariableComponents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, experimentalDistributedVariableComponents_.get(i)); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedVariable)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (getTrainable() + != other.getTrainable()) return false; + if (synchronization_ != other.synchronization_) return false; + 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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + TRAINABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTrainable()); + hash = (37 * hash) + SYNCHRONIZATION_FIELD_NUMBER; + hash = (53 * hash) + synchronization_; + hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable 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.SavedObjectGraphOuterClass.SavedVariable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable 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.SavedObjectGraphOuterClass.SavedVariable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedVariable 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a Variable that is initialized by loading the contents from the
    +     * checkpoint.
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedVariable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedVariable) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedVariable_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedVariable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getExperimentalDistributedVariableComponentsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + trainable_ = false; + synchronization_ = 0; + aggregation_ = 0; + name_ = ""; + device_ = ""; + if (experimentalDistributedVariableComponentsBuilder_ == null) { + experimentalDistributedVariableComponents_ = java.util.Collections.emptyList(); + } else { + experimentalDistributedVariableComponents_ = null; + experimentalDistributedVariableComponentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedVariable_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable result) { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + experimentalDistributedVariableComponents_ = java.util.Collections.unmodifiableList(experimentalDistributedVariableComponents_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.experimentalDistributedVariableComponents_ = experimentalDistributedVariableComponents_; + } else { + result.experimentalDistributedVariableComponents_ = experimentalDistributedVariableComponentsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trainable_ = trainable_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.synchronization_ = synchronization_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.aggregation_ = aggregation_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.device_ = device_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.getTrainable() != false) { + setTrainable(other.getTrainable()); + } + if (other.synchronization_ != 0) { + setSynchronizationValue(other.getSynchronizationValue()); + } + if (other.aggregation_ != 0) { + setAggregationValue(other.getAggregationValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (experimentalDistributedVariableComponentsBuilder_ == null) { + if (!other.experimentalDistributedVariableComponents_.isEmpty()) { + if (experimentalDistributedVariableComponents_.isEmpty()) { + experimentalDistributedVariableComponents_ = other.experimentalDistributedVariableComponents_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.addAll(other.experimentalDistributedVariableComponents_); + } + onChanged(); + } + } else { + if (!other.experimentalDistributedVariableComponents_.isEmpty()) { + if (experimentalDistributedVariableComponentsBuilder_.isEmpty()) { + experimentalDistributedVariableComponentsBuilder_.dispose(); + experimentalDistributedVariableComponentsBuilder_ = null; + experimentalDistributedVariableComponents_ = other.experimentalDistributedVariableComponents_; + bitField0_ = (bitField0_ & ~0x00000080); + experimentalDistributedVariableComponentsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExperimentalDistributedVariableComponentsFieldBuilder() : null; + } else { + experimentalDistributedVariableComponentsBuilder_.addAllMessages(other.experimentalDistributedVariableComponents_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + trainable_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + synchronization_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + aggregation_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable m = + input.readMessage( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.parser(), + extensionRegistry); + if (experimentalDistributedVariableComponentsBuilder_ == null) { + ensureExperimentalDistributedVariableComponentsIsMutable(); + experimentalDistributedVariableComponents_.add(m); + } else { + experimentalDistributedVariableComponentsBuilder_.addMessage(m); + } + break; + } // case 66 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private boolean trainable_ ; + /** + * bool trainable = 3; + * @return The trainable. + */ + @java.lang.Override + public boolean getTrainable() { + return trainable_; + } + /** + * bool trainable = 3; + * @param value The trainable to set. + * @return This builder for chaining. + */ + public Builder setTrainable(boolean value) { + + trainable_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * bool trainable = 3; + * @return This builder for chaining. + */ + public Builder clearTrainable() { + bitField0_ = (bitField0_ & ~0x00000004); + trainable_ = false; + onChanged(); + return this; + } + + private int synchronization_ = 0; + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The enum numeric value on the wire for synchronization. + */ + @java.lang.Override public int getSynchronizationValue() { + return synchronization_; + } + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @param value The enum numeric value on the wire for synchronization to set. + * @return This builder for chaining. + */ + public Builder setSynchronizationValue(int value) { + synchronization_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return The synchronization. + */ + @java.lang.Override + public org.tensorflow.proto.VariableSynchronization getSynchronization() { + org.tensorflow.proto.VariableSynchronization result = org.tensorflow.proto.VariableSynchronization.forNumber(synchronization_); + return result == null ? org.tensorflow.proto.VariableSynchronization.UNRECOGNIZED : result; + } + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @param value The synchronization to set. + * @return This builder for chaining. + */ + public Builder setSynchronization(org.tensorflow.proto.VariableSynchronization value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + synchronization_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.VariableSynchronization synchronization = 4; + * @return This builder for chaining. + */ + public Builder clearSynchronization() { + bitField0_ = (bitField0_ & ~0x00000008); + synchronization_ = 0; + onChanged(); + return this; + } + + private int aggregation_ = 0; + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The enum numeric value on the wire for aggregation. + */ + @java.lang.Override public int getAggregationValue() { + return aggregation_; + } + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @param value The enum numeric value on the wire for aggregation to set. + * @return This builder for chaining. + */ + public Builder setAggregationValue(int value) { + aggregation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return The aggregation. + */ + @java.lang.Override + public org.tensorflow.proto.VariableAggregation getAggregation() { + org.tensorflow.proto.VariableAggregation result = org.tensorflow.proto.VariableAggregation.forNumber(aggregation_); + return result == null ? org.tensorflow.proto.VariableAggregation.UNRECOGNIZED : result; + } + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @param value The aggregation to set. + * @return This builder for chaining. + */ + public Builder setAggregation(org.tensorflow.proto.VariableAggregation value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + aggregation_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.VariableAggregation aggregation = 5; + * @return This builder for chaining. + */ + public Builder clearAggregation() { + bitField0_ = (bitField0_ & ~0x00000010); + aggregation_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 6; + * @return The name. + */ + 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; + } + } + /** + * string name = 6; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 6; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string name = 6; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string name = 6; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object device_ = ""; + /** + * string device = 7; + * @return The device. + */ + 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; + * @return The bytes for device. + */ + 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; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string device = 7; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string device = 7; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.util.List experimentalDistributedVariableComponents_ = + java.util.Collections.emptyList(); + private void ensureExperimentalDistributedVariableComponentsIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + experimentalDistributedVariableComponents_ = new java.util.ArrayList(experimentalDistributedVariableComponents_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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_ & ~0x00000080); + 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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.SavedVariable.Builder addExperimentalDistributedVariableComponentsBuilder() { + return getExperimentalDistributedVariableComponentsFieldBuilder().addBuilder( + org.tensorflow.proto.SavedObjectGraphOuterClass.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.SavedObjectGraphOuterClass.SavedVariable.Builder addExperimentalDistributedVariableComponentsBuilder( + int index) { + return getExperimentalDistributedVariableComponentsFieldBuilder().addBuilder( + index, org.tensorflow.proto.SavedObjectGraphOuterClass.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.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder> + getExperimentalDistributedVariableComponentsFieldBuilder() { + if (experimentalDistributedVariableComponentsBuilder_ == null) { + experimentalDistributedVariableComponentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable.Builder, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariableOrBuilder>( + experimentalDistributedVariableComponents_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + experimentalDistributedVariableComponents_ = null; + } + return experimentalDistributedVariableComponentsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedVariable) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedVariable) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedVariable getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedVariable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedVariable getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FunctionSpecOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.FunctionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return Whether the fullargspec field is set. + */ + boolean hasFullargspec(); + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return The fullargspec. + */ + org.tensorflow.proto.Struct.StructuredValue getFullargspec(); + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getFullargspecOrBuilder(); + + /** + *
    +     * Whether this represents a class method.
    +     * 
    + * + * bool is_method = 2; + * @return The isMethod. + */ + boolean getIsMethod(); + + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return Whether the inputSignature field is set. + */ + boolean hasInputSignature(); + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return The inputSignature. + */ + org.tensorflow.proto.Struct.StructuredValue getInputSignature(); + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getInputSignatureOrBuilder(); + + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The enum numeric value on the wire for jitCompile. + */ + int getJitCompileValue(); + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The jitCompile. + */ + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile getJitCompile(); + } + /** + *
    +   * Represents `FunctionSpec` used in `Function`. This represents a
    +   * function that has been wrapped as a TensorFlow `Function`.
    +   * 
    + * + * Protobuf type {@code tensorflow.FunctionSpec} + */ + public static final class FunctionSpec extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.FunctionSpec) + FunctionSpecOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + FunctionSpec.class.getName()); + } + // Use FunctionSpec.newBuilder() to construct. + private FunctionSpec(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FunctionSpec() { + jitCompile_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_FunctionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_FunctionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.class, org.tensorflow.proto.SavedObjectGraphOuterClass.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.JitCompile} + */ + public enum JitCompile + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * ON = 1; + */ + ON(1), + /** + * OFF = 2; + */ + OFF(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + JitCompile.class.getName()); + } + /** + * 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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static JitCompile valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static JitCompile 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< + JitCompile> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public JitCompile findValueByNumber(int number) { + return JitCompile.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.SavedObjectGraphOuterClass.FunctionSpec.getDescriptor().getEnumTypes().get(0); + } + + private static final JitCompile[] VALUES = values(); + + public static JitCompile 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 JitCompile(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.FunctionSpec.JitCompile) + } + + private int bitField0_; + public static final int FULLARGSPEC_FIELD_NUMBER = 1; + private org.tensorflow.proto.Struct.StructuredValue fullargspec_; + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return Whether the fullargspec field is set. + */ + @java.lang.Override + public boolean hasFullargspec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return The fullargspec. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getFullargspec() { + return fullargspec_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : fullargspec_; + } + /** + *
    +     * Full arg spec from inspect.getfullargspec().
    +     * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getFullargspecOrBuilder() { + return fullargspec_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : fullargspec_; + } + + public static final int IS_METHOD_FIELD_NUMBER = 2; + private boolean isMethod_ = false; + /** + *
    +     * Whether this represents a class method.
    +     * 
    + * + * bool is_method = 2; + * @return The isMethod. + */ + @java.lang.Override + public boolean getIsMethod() { + return isMethod_; + } + + public static final int INPUT_SIGNATURE_FIELD_NUMBER = 5; + private org.tensorflow.proto.Struct.StructuredValue inputSignature_; + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return Whether the inputSignature field is set. + */ + @java.lang.Override + public boolean hasInputSignature() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return The inputSignature. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getInputSignature() { + return inputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : inputSignature_; + } + /** + *
    +     * The input signature, if specified.
    +     * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getInputSignatureOrBuilder() { + return inputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : inputSignature_; + } + + public static final int JIT_COMPILE_FIELD_NUMBER = 6; + private int jitCompile_ = 0; + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The enum numeric value on the wire for jitCompile. + */ + @java.lang.Override public int getJitCompileValue() { + return jitCompile_; + } + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The jitCompile. + */ + @java.lang.Override public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile getJitCompile() { + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile result = org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.forNumber(jitCompile_); + return result == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.UNRECOGNIZED : result; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getFullargspec()); + } + if (isMethod_ != false) { + output.writeBool(2, isMethod_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getInputSignature()); + } + if (jitCompile_ != org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.DEFAULT.getNumber()) { + output.writeEnum(6, jitCompile_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getFullargspec()); + } + if (isMethod_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, isMethod_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getInputSignature()); + } + if (jitCompile_ != org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, jitCompile_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.FunctionSpec)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec other = (org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec) obj; + + if (hasFullargspec() != other.hasFullargspec()) return false; + if (hasFullargspec()) { + if (!getFullargspec() + .equals(other.getFullargspec())) return false; + } + if (getIsMethod() + != other.getIsMethod()) return false; + if (hasInputSignature() != other.hasInputSignature()) return false; + if (hasInputSignature()) { + if (!getInputSignature() + .equals(other.getInputSignature())) return false; + } + if (jitCompile_ != other.jitCompile_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFullargspec()) { + hash = (37 * hash) + FULLARGSPEC_FIELD_NUMBER; + hash = (53 * hash) + getFullargspec().hashCode(); + } + hash = (37 * hash) + IS_METHOD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsMethod()); + if (hasInputSignature()) { + hash = (37 * hash) + INPUT_SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getInputSignature().hashCode(); + } + hash = (37 * hash) + JIT_COMPILE_FIELD_NUMBER; + hash = (53 * hash) + jitCompile_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec 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.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec 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.SavedObjectGraphOuterClass.FunctionSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.FunctionSpec 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents `FunctionSpec` used in `Function`. This represents a
    +     * function that has been wrapped as a TensorFlow `Function`.
    +     * 
    + * + * Protobuf type {@code tensorflow.FunctionSpec} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.FunctionSpec) + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_FunctionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_FunctionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.class, org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFullargspecFieldBuilder(); + getInputSignatureFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fullargspec_ = null; + if (fullargspecBuilder_ != null) { + fullargspecBuilder_.dispose(); + fullargspecBuilder_ = null; + } + isMethod_ = false; + inputSignature_ = null; + if (inputSignatureBuilder_ != null) { + inputSignatureBuilder_.dispose(); + inputSignatureBuilder_ = null; + } + jitCompile_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_FunctionSpec_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec result = new org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fullargspec_ = fullargspecBuilder_ == null + ? fullargspec_ + : fullargspecBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.isMethod_ = isMethod_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.inputSignature_ = inputSignatureBuilder_ == null + ? inputSignature_ + : inputSignatureBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.jitCompile_ = jitCompile_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.getDefaultInstance()) return this; + if (other.hasFullargspec()) { + mergeFullargspec(other.getFullargspec()); + } + if (other.getIsMethod() != false) { + setIsMethod(other.getIsMethod()); + } + if (other.hasInputSignature()) { + mergeInputSignature(other.getInputSignature()); + } + if (other.jitCompile_ != 0) { + setJitCompileValue(other.getJitCompileValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getFullargspecFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + isMethod_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 42: { + input.readMessage( + getInputSignatureFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 48: { + jitCompile_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.Struct.StructuredValue fullargspec_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> fullargspecBuilder_; + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return Whether the fullargspec field is set. + */ + public boolean hasFullargspec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + * @return The fullargspec. + */ + public org.tensorflow.proto.Struct.StructuredValue getFullargspec() { + if (fullargspecBuilder_ == null) { + return fullargspec_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : fullargspec_; + } else { + return fullargspecBuilder_.getMessage(); + } + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public Builder setFullargspec(org.tensorflow.proto.Struct.StructuredValue value) { + if (fullargspecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fullargspec_ = value; + } else { + fullargspecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public Builder setFullargspec( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (fullargspecBuilder_ == null) { + fullargspec_ = builderForValue.build(); + } else { + fullargspecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public Builder mergeFullargspec(org.tensorflow.proto.Struct.StructuredValue value) { + if (fullargspecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + fullargspec_ != null && + fullargspec_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getFullargspecBuilder().mergeFrom(value); + } else { + fullargspec_ = value; + } + } else { + fullargspecBuilder_.mergeFrom(value); + } + if (fullargspec_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public Builder clearFullargspec() { + bitField0_ = (bitField0_ & ~0x00000001); + fullargspec_ = null; + if (fullargspecBuilder_ != null) { + fullargspecBuilder_.dispose(); + fullargspecBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getFullargspecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getFullargspecFieldBuilder().getBuilder(); + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getFullargspecOrBuilder() { + if (fullargspecBuilder_ != null) { + return fullargspecBuilder_.getMessageOrBuilder(); + } else { + return fullargspec_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : fullargspec_; + } + } + /** + *
    +       * Full arg spec from inspect.getfullargspec().
    +       * 
    + * + * .tensorflow.StructuredValue fullargspec = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getFullargspecFieldBuilder() { + if (fullargspecBuilder_ == null) { + fullargspecBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getFullargspec(), + getParentForChildren(), + isClean()); + fullargspec_ = null; + } + return fullargspecBuilder_; + } + + private boolean isMethod_ ; + /** + *
    +       * Whether this represents a class method.
    +       * 
    + * + * bool is_method = 2; + * @return The isMethod. + */ + @java.lang.Override + public boolean getIsMethod() { + return isMethod_; + } + /** + *
    +       * Whether this represents a class method.
    +       * 
    + * + * bool is_method = 2; + * @param value The isMethod to set. + * @return This builder for chaining. + */ + public Builder setIsMethod(boolean value) { + + isMethod_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Whether this represents a class method.
    +       * 
    + * + * bool is_method = 2; + * @return This builder for chaining. + */ + public Builder clearIsMethod() { + bitField0_ = (bitField0_ & ~0x00000002); + isMethod_ = false; + onChanged(); + return this; + } + + private org.tensorflow.proto.Struct.StructuredValue inputSignature_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> inputSignatureBuilder_; + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return Whether the inputSignature field is set. + */ + public boolean hasInputSignature() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + * @return The inputSignature. + */ + public org.tensorflow.proto.Struct.StructuredValue getInputSignature() { + if (inputSignatureBuilder_ == null) { + return inputSignature_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : inputSignature_; + } else { + return inputSignatureBuilder_.getMessage(); + } + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public Builder setInputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (inputSignatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputSignature_ = value; + } else { + inputSignatureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public Builder setInputSignature( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (inputSignatureBuilder_ == null) { + inputSignature_ = builderForValue.build(); + } else { + inputSignatureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public Builder mergeInputSignature(org.tensorflow.proto.Struct.StructuredValue value) { + if (inputSignatureBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + inputSignature_ != null && + inputSignature_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getInputSignatureBuilder().mergeFrom(value); + } else { + inputSignature_ = value; + } + } else { + inputSignatureBuilder_.mergeFrom(value); + } + if (inputSignature_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public Builder clearInputSignature() { + bitField0_ = (bitField0_ & ~0x00000004); + inputSignature_ = null; + if (inputSignatureBuilder_ != null) { + inputSignatureBuilder_.dispose(); + inputSignatureBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getInputSignatureBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInputSignatureFieldBuilder().getBuilder(); + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getInputSignatureOrBuilder() { + if (inputSignatureBuilder_ != null) { + return inputSignatureBuilder_.getMessageOrBuilder(); + } else { + return inputSignature_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : inputSignature_; + } + } + /** + *
    +       * The input signature, if specified.
    +       * 
    + * + * .tensorflow.StructuredValue input_signature = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getInputSignatureFieldBuilder() { + if (inputSignatureBuilder_ == null) { + inputSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getInputSignature(), + getParentForChildren(), + isClean()); + inputSignature_ = null; + } + return inputSignatureBuilder_; + } + + private int jitCompile_ = 0; + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The enum numeric value on the wire for jitCompile. + */ + @java.lang.Override public int getJitCompileValue() { + return jitCompile_; + } + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @param value The enum numeric value on the wire for jitCompile to set. + * @return This builder for chaining. + */ + public Builder setJitCompileValue(int value) { + jitCompile_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return The jitCompile. + */ + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile getJitCompile() { + org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile result = org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.forNumber(jitCompile_); + return result == null ? org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile.UNRECOGNIZED : result; + } + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @param value The jitCompile to set. + * @return This builder for chaining. + */ + public Builder setJitCompile(org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec.JitCompile value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + jitCompile_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.FunctionSpec.JitCompile jit_compile = 6; + * @return This builder for chaining. + */ + public Builder clearJitCompile() { + bitField0_ = (bitField0_ & ~0x00000008); + jitCompile_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.FunctionSpec) + } + + // @@protoc_insertion_point(class_scope:tensorflow.FunctionSpec) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.FunctionSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FunctionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.FunctionSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SavedResourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedResource) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * A device specification indicating a required placement for the resource
    +     * creation function, e.g. "CPU". An empty string allows the user to select a
    +     * device.
    +     * 
    + * + * string device = 1; + * @return The device. + */ + java.lang.String getDevice(); + /** + *
    +     * A device specification indicating a required placement for the resource
    +     * creation function, e.g. "CPU". An empty string allows the user to select a
    +     * device.
    +     * 
    + * + * string device = 1; + * @return The bytes for device. + */ + com.google.protobuf.ByteString + getDeviceBytes(); + } + /** + *
    +   * A SavedResource represents a TF object that holds state during its lifetime.
    +   * An object of this type can have a reference to a:
    +   * create_resource() and an initialize() function.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedResource} + */ + public static final class SavedResource extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedResource) + SavedResourceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedResource.class.getName()); + } + // Use SavedResource.newBuilder() to construct. + private SavedResource(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedResource() { + device_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder.class); + } + + public static final int DEVICE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + *
    +     * A device specification indicating a required placement for the resource
    +     * creation function, e.g. "CPU". An empty string allows the user to select a
    +     * device.
    +     * 
    + * + * string device = 1; + * @return The device. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * A device specification indicating a required placement for the resource
    +     * creation function, e.g. "CPU". An empty string allows the user to select a
    +     * device.
    +     * 
    + * + * string device = 1; + * @return The bytes for device. + */ + @java.lang.Override + 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; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, device_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, device_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SavedResource)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) obj; + + if (!getDevice() + .equals(other.getDevice())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource 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.SavedObjectGraphOuterClass.SavedResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource 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.SavedObjectGraphOuterClass.SavedResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SavedResource 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A SavedResource represents a TF object that holds state during its lifetime.
    +     * An object of this type can have a reference to a:
    +     * create_resource() and an initialize() function.
    +     * 
    + * + * Protobuf type {@code tensorflow.SavedResource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedResource) + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + device_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SavedResource_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.device_ = device_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource.getDefaultInstance()) return this; + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object device_ = ""; + /** + *
    +       * A device specification indicating a required placement for the resource
    +       * creation function, e.g. "CPU". An empty string allows the user to select a
    +       * device.
    +       * 
    + * + * string device = 1; + * @return The device. + */ + 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; + } + } + /** + *
    +       * A device specification indicating a required placement for the resource
    +       * creation function, e.g. "CPU". An empty string allows the user to select a
    +       * device.
    +       * 
    + * + * string device = 1; + * @return The bytes for device. + */ + 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; + } + } + /** + *
    +       * A device specification indicating a required placement for the resource
    +       * creation function, e.g. "CPU". An empty string allows the user to select a
    +       * device.
    +       * 
    + * + * string device = 1; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * A device specification indicating a required placement for the resource
    +       * creation function, e.g. "CPU". An empty string allows the user to select a
    +       * device.
    +       * 
    + * + * string device = 1; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * A device specification indicating a required placement for the resource
    +       * creation function, e.g. "CPU". An empty string allows the user to select a
    +       * device.
    +       * 
    + * + * string device = 1; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedResource) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedResource) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SavedResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SavedResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SaveableObjectOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SaveableObject) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Node ids of concrete functions for saving and loading from a checkpoint.
    +     * These functions save and restore directly from tensors.
    +     * 
    + * + * int32 save_function = 2; + * @return The saveFunction. + */ + int getSaveFunction(); + + /** + * int32 restore_function = 3; + * @return The restoreFunction. + */ + int getRestoreFunction(); + } + /** + * Protobuf type {@code tensorflow.SaveableObject} + */ + public static final class SaveableObject extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SaveableObject) + SaveableObjectOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SaveableObject.class.getName()); + } + // Use SaveableObject.newBuilder() to construct. + private SaveableObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SaveableObject() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SaveableObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SaveableObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder.class); + } + + public static final int SAVE_FUNCTION_FIELD_NUMBER = 2; + private int saveFunction_ = 0; + /** + *
    +     * Node ids of concrete functions for saving and loading from a checkpoint.
    +     * These functions save and restore directly from tensors.
    +     * 
    + * + * int32 save_function = 2; + * @return The saveFunction. + */ + @java.lang.Override + public int getSaveFunction() { + return saveFunction_; + } + + public static final int RESTORE_FUNCTION_FIELD_NUMBER = 3; + private int restoreFunction_ = 0; + /** + * int32 restore_function = 3; + * @return The restoreFunction. + */ + @java.lang.Override + public int getRestoreFunction() { + return restoreFunction_; + } + + 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 (saveFunction_ != 0) { + output.writeInt32(2, saveFunction_); + } + if (restoreFunction_ != 0) { + output.writeInt32(3, restoreFunction_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (saveFunction_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, saveFunction_); + } + if (restoreFunction_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, restoreFunction_); + } + size += getUnknownFields().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.SavedObjectGraphOuterClass.SaveableObject)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject other = (org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) obj; + + if (getSaveFunction() + != other.getSaveFunction()) return false; + if (getRestoreFunction() + != other.getRestoreFunction()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SAVE_FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getSaveFunction(); + hash = (37 * hash) + RESTORE_FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getRestoreFunction(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject 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.SavedObjectGraphOuterClass.SaveableObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject 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.SavedObjectGraphOuterClass.SaveableObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedObjectGraphOuterClass.SaveableObject 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SaveableObject} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SaveableObject) + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SaveableObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SaveableObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.class, org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + saveFunction_ = 0; + restoreFunction_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.internal_static_tensorflow_SaveableObject_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getDefaultInstanceForType() { + return org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject build() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject buildPartial() { + org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject result = new org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.saveFunction_ = saveFunction_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.restoreFunction_ = restoreFunction_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject) { + return mergeFrom((org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject other) { + if (other == org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject.getDefaultInstance()) return this; + if (other.getSaveFunction() != 0) { + setSaveFunction(other.getSaveFunction()); + } + if (other.getRestoreFunction() != 0) { + setRestoreFunction(other.getRestoreFunction()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 16: { + saveFunction_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 16 + case 24: { + restoreFunction_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int saveFunction_ ; + /** + *
    +       * Node ids of concrete functions for saving and loading from a checkpoint.
    +       * These functions save and restore directly from tensors.
    +       * 
    + * + * int32 save_function = 2; + * @return The saveFunction. + */ + @java.lang.Override + public int getSaveFunction() { + return saveFunction_; + } + /** + *
    +       * Node ids of concrete functions for saving and loading from a checkpoint.
    +       * These functions save and restore directly from tensors.
    +       * 
    + * + * int32 save_function = 2; + * @param value The saveFunction to set. + * @return This builder for chaining. + */ + public Builder setSaveFunction(int value) { + + saveFunction_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Node ids of concrete functions for saving and loading from a checkpoint.
    +       * These functions save and restore directly from tensors.
    +       * 
    + * + * int32 save_function = 2; + * @return This builder for chaining. + */ + public Builder clearSaveFunction() { + bitField0_ = (bitField0_ & ~0x00000001); + saveFunction_ = 0; + onChanged(); + return this; + } + + private int restoreFunction_ ; + /** + * int32 restore_function = 3; + * @return The restoreFunction. + */ + @java.lang.Override + public int getRestoreFunction() { + return restoreFunction_; + } + /** + * int32 restore_function = 3; + * @param value The restoreFunction to set. + * @return This builder for chaining. + */ + public Builder setRestoreFunction(int value) { + + restoreFunction_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 restore_function = 3; + * @return This builder for chaining. + */ + public Builder clearRestoreFunction() { + bitField0_ = (bitField0_ & ~0x00000002); + restoreFunction_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SaveableObject) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SaveableObject) + private static final org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject(); + } + + public static org.tensorflow.proto.SavedObjectGraphOuterClass.SaveableObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SaveableObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedObjectGraphOuterClass.SaveableObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedObjectGraph_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedObject_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedObject_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedObject_SaveableObjectsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedUserObject_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedUserObject_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedAsset_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedAsset_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedFunction_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedFunction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_CapturedTensor_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_CapturedTensor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedConcreteFunction_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedBareConcreteFunction_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedConstant_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedConstant_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedVariable_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedVariable_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_FunctionSpec_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_FunctionSpec_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SavedResource_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SavedResource_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_SaveableObject_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SaveableObject_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n1tensorflow/core/protobuf/saved_object_" + + "graph.proto\022\ntensorflow\032\031google/protobuf" + + "/any.proto\032,tensorflow/core/framework/te" + + "nsor_shape.proto\032%tensorflow/core/framew" + + "ork/types.proto\032(tensorflow/core/framewo" + + "rk/variable.proto\032(tensorflow/core/frame" + + "work/versions.proto\032%tensorflow/core/pro" + + "tobuf/struct.proto\0325tensorflow/core/prot" + + "obuf/trackable_object_graph.proto\"\350\001\n\020Sa" + + "vedObjectGraph\022&\n\005nodes\030\001 \003(\0132\027.tensorfl" + + "ow.SavedObject\022O\n\022concrete_functions\030\002 \003" + + "(\01323.tensorflow.SavedObjectGraph.Concret" + + "eFunctionsEntry\032[\n\026ConcreteFunctionsEntr" + + "y\022\013\n\003key\030\001 \001(\t\0220\n\005value\030\002 \001(\0132!.tensorfl" + + "ow.SavedConcreteFunction:\0028\001\"\320\007\n\013SavedOb" + + "ject\022R\n\010children\030\001 \003(\0132@.tensorflow.Trac" + + "kableObjectGraph.TrackableObject.ObjectR" + + "eference\022V\n\014dependencies\030\017 \003(\0132@.tensorf" + + "low.TrackableObjectGraph.TrackableObject" + + ".ObjectReference\022^\n\016slot_variables\030\003 \003(\013" + + "2F.tensorflow.TrackableObjectGraph.Track" + + "ableObject.SlotVariableReference\0222\n\013user" + + "_object\030\004 \001(\0132\033.tensorflow.SavedUserObje" + + "ctH\000\022\'\n\005asset\030\005 \001(\0132\026.tensorflow.SavedAs" + + "setH\000\022-\n\010function\030\006 \001(\0132\031.tensorflow.Sav" + + "edFunctionH\000\022-\n\010variable\030\007 \001(\0132\031.tensorf" + + "low.SavedVariableH\000\022G\n\026bare_concrete_fun" + + "ction\030\010 \001(\0132%.tensorflow.SavedBareConcre" + + "teFunctionH\000\022-\n\010constant\030\t \001(\0132\031.tensorf" + + "low.SavedConstantH\000\022-\n\010resource\030\n \001(\0132\031." + + "tensorflow.SavedResourceH\000\0225\n\017captured_t" + + "ensor\030\014 \001(\0132\032.tensorflow.CapturedTensorH" + + "\000\022F\n\020saveable_objects\030\013 \003(\0132,.tensorflow" + + ".SavedObject.SaveableObjectsEntry\022\027\n\017reg" + + "istered_name\030\r \001(\t\0223\n\025serialized_user_pr" + + "oto\030\016 \001(\0132\024.google.protobuf.Any\022\030\n\020regis" + + "tered_saver\030\020 \001(\t\032R\n\024SaveableObjectsEntr" + + "y\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.tensorfl" + + "ow.SaveableObject:\0028\001B\006\n\004kindJ\004\010\002\020\003R\natt" + + "ributes\"d\n\017SavedUserObject\022\022\n\nidentifier" + + "\030\001 \001(\t\022\'\n\007version\030\002 \001(\0132\026.tensorflow.Ver" + + "sionDef\022\024\n\010metadata\030\003 \001(\tB\002\030\001\"*\n\nSavedAs" + + "set\022\034\n\024asset_file_def_index\030\001 \001(\005\"\\\n\rSav" + + "edFunction\022\032\n\022concrete_functions\030\001 \003(\t\022/" + + "\n\rfunction_spec\030\002 \001(\0132\030.tensorflow.Funct" + + "ionSpec\"9\n\016CapturedTensor\022\014\n\004name\030\001 \001(\t\022" + + "\031\n\021concrete_function\030\002 \001(\t\"\250\001\n\025SavedConc" + + "reteFunction\022\024\n\014bound_inputs\030\002 \003(\005\022B\n\035ca" + + "nonicalized_input_signature\030\003 \001(\0132\033.tens" + + "orflow.StructuredValue\0225\n\020output_signatu" + + "re\030\004 \001(\0132\033.tensorflow.StructuredValue\"\255\001" + + "\n\031SavedBareConcreteFunction\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\rSavedConstant\022\021\n\toperat" + + "ion\030\001 \001(\t\"\327\002\n\rSavedVariable\022#\n\005dtype\030\001 \001" + + "(\0162\024.tensorflow.DataType\022+\n\005shape\030\002 \001(\0132" + + "\034.tensorflow.TensorShapeProto\022\021\n\ttrainab" + + "le\030\003 \001(\010\022<\n\017synchronization\030\004 \001(\0162#.tens" + + "orflow.VariableSynchronization\0224\n\013aggreg" + + "ation\030\005 \001(\0162\037.tensorflow.VariableAggrega" + + "tion\022\014\n\004name\030\006 \001(\t\022\016\n\006device\030\007 \001(\t\022O\n,ex" + + "perimental_distributed_variable_componen" + + "ts\030\010 \003(\0132\031.tensorflow.SavedVariable\"\373\001\n\014" + + "FunctionSpec\0220\n\013fullargspec\030\001 \001(\0132\033.tens" + + "orflow.StructuredValue\022\021\n\tis_method\030\002 \001(" + + "\010\0224\n\017input_signature\030\005 \001(\0132\033.tensorflow." + + "StructuredValue\0228\n\013jit_compile\030\006 \001(\0162#.t" + + "ensorflow.FunctionSpec.JitCompile\"*\n\nJit" + + "Compile\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\006device\030\001 \001" + + "(\t\"A\n\016SaveableObject\022\025\n\rsave_function\030\002 " + + "\001(\005\022\030\n\020restore_function\030\003 \001(\005Bp\n\024org.ten" + + "sorflow.protoZUgithub.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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + org.tensorflow.proto.VariableProtos.getDescriptor(), + org.tensorflow.proto.VersionsProtos.getDescriptor(), + org.tensorflow.proto.Struct.getDescriptor(), + org.tensorflow.proto.TrackableObjectGraphOuterClass.getDescriptor(), + }); + internal_static_tensorflow_SavedObjectGraph_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_SavedObjectGraph_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedObjectGraph_descriptor, + new java.lang.String[] { "Nodes", "ConcreteFunctions", }); + internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor = + internal_static_tensorflow_SavedObjectGraph_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedObjectGraph_ConcreteFunctionsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_SavedObject_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_SavedObject_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedObject_descriptor, + new java.lang.String[] { "Children", "Dependencies", "SlotVariables", "UserObject", "Asset", "Function", "Variable", "BareConcreteFunction", "Constant", "Resource", "CapturedTensor", "SaveableObjects", "RegisteredName", "SerializedUserProto", "RegisteredSaver", "Kind", }); + internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor = + internal_static_tensorflow_SavedObject_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_SavedObject_SaveableObjectsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedObject_SaveableObjectsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_SavedUserObject_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_SavedUserObject_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedUserObject_descriptor, + new java.lang.String[] { "Identifier", "Version", "Metadata", }); + internal_static_tensorflow_SavedAsset_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_SavedAsset_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedAsset_descriptor, + new java.lang.String[] { "AssetFileDefIndex", }); + internal_static_tensorflow_SavedFunction_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_SavedFunction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedFunction_descriptor, + new java.lang.String[] { "ConcreteFunctions", "FunctionSpec", }); + internal_static_tensorflow_CapturedTensor_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_CapturedTensor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_CapturedTensor_descriptor, + new java.lang.String[] { "Name", "ConcreteFunction", }); + internal_static_tensorflow_SavedConcreteFunction_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_SavedConcreteFunction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedConcreteFunction_descriptor, + new java.lang.String[] { "BoundInputs", "CanonicalizedInputSignature", "OutputSignature", }); + internal_static_tensorflow_SavedBareConcreteFunction_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_tensorflow_SavedBareConcreteFunction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedBareConcreteFunction_descriptor, + new java.lang.String[] { "ConcreteFunctionName", "ArgumentKeywords", "AllowedPositionalArguments", "FunctionSpec", }); + internal_static_tensorflow_SavedConstant_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_tensorflow_SavedConstant_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedConstant_descriptor, + new java.lang.String[] { "Operation", }); + internal_static_tensorflow_SavedVariable_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_tensorflow_SavedVariable_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedVariable_descriptor, + new java.lang.String[] { "Dtype", "Shape", "Trainable", "Synchronization", "Aggregation", "Name", "Device", "ExperimentalDistributedVariableComponents", }); + internal_static_tensorflow_FunctionSpec_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_tensorflow_FunctionSpec_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_FunctionSpec_descriptor, + new java.lang.String[] { "Fullargspec", "IsMethod", "InputSignature", "JitCompile", }); + internal_static_tensorflow_SavedResource_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_tensorflow_SavedResource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SavedResource_descriptor, + new java.lang.String[] { "Device", }); + internal_static_tensorflow_SaveableObject_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_tensorflow_SaveableObject_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SaveableObject_descriptor, + new java.lang.String[] { "SaveFunction", "RestoreFunction", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.AnyProto.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + org.tensorflow.proto.VariableProtos.getDescriptor(); + org.tensorflow.proto.VersionsProtos.getDescriptor(); + org.tensorflow.proto.Struct.getDescriptor(); + org.tensorflow.proto.TrackableObjectGraphOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSlice.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSlice.java new file mode 100644 index 00000000000..f25165bb36a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSlice.java @@ -0,0 +1,1044 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Saved tensor slice: it stores the name of the tensors, the slice, and the
    + * raw data.
    + * 
    + * + * Protobuf type {@code tensorflow.SavedSlice} + */ +public final class SavedSlice extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedSlice) + SavedSliceOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedSlice.class.getName()); + } + // Use SavedSlice.newBuilder() to construct. + private SavedSlice(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedSlice() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedSlice.class, org.tensorflow.proto.SavedSlice.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Name of the tensor that this slice belongs to. This must be identical to
    +   * the name used to encode the key for this record.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Name of the tensor that this slice belongs to. This must be identical to
    +   * the name used to encode the key for this record.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 SLICE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorSliceProto slice_; + /** + *
    +   * Extent of the slice.  Must have one entry for each of the dimension of the
    +   * tensor that this slice belongs to.
    +   * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + * @return Whether the slice field is set. + */ + @java.lang.Override + public boolean hasSlice() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Extent of the slice.  Must have one entry for each of the dimension of the
    +   * tensor that this slice belongs to.
    +   * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + * @return The slice. + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto getSlice() { + return slice_ == null ? org.tensorflow.proto.TensorSliceProto.getDefaultInstance() : slice_; + } + /** + *
    +   * Extent of the slice.  Must have one entry for each of the dimension of the
    +   * tensor that this slice belongs to.
    +   * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder() { + return slice_ == null ? org.tensorflow.proto.TensorSliceProto.getDefaultInstance() : slice_; + } + + public static final int DATA_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorProto data_; + /** + *
    +   * The raw data of the slice is stored as a TensorProto. Only raw data are
    +   * stored (we don't fill in fields such as dtype or tensor_shape).
    +   * 
    + * + * .tensorflow.TensorProto data = 3; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The raw data of the slice is stored as a TensorProto. Only raw data are
    +   * stored (we don't fill in fields such as dtype or tensor_shape).
    +   * 
    + * + * .tensorflow.TensorProto data = 3; + * @return The data. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getData() { + return data_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : data_; + } + /** + *
    +   * The raw data of the slice is stored as a TensorProto. Only raw data are
    +   * stored (we don't fill in fields such as dtype or tensor_shape).
    +   * 
    + * + * .tensorflow.TensorProto data = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getDataOrBuilder() { + return data_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : data_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSlice()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getData()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSlice()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getData()); + } + size += getUnknownFields().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.SavedSlice)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedSlice other = (org.tensorflow.proto.SavedSlice) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasSlice() != other.hasSlice()) return false; + if (hasSlice()) { + if (!getSlice() + .equals(other.getSlice())) return false; + } + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasSlice()) { + hash = (37 * hash) + SLICE_FIELD_NUMBER; + hash = (53 * hash) + getSlice().hashCode(); + } + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedSlice parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSlice 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.SavedSlice parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSlice 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.SavedSlice parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSlice parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedSlice parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedSlice parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedSlice parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedSlice parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedSlice parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedSlice parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedSlice 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Saved tensor slice: it stores the name of the tensors, the slice, and the
    +   * raw data.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedSlice} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedSlice) + org.tensorflow.proto.SavedSliceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedSlice.class, org.tensorflow.proto.SavedSlice.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedSlice.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSliceFieldBuilder(); + getDataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + slice_ = null; + if (sliceBuilder_ != null) { + sliceBuilder_.dispose(); + sliceBuilder_ = null; + } + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSlice_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedSlice getDefaultInstanceForType() { + return org.tensorflow.proto.SavedSlice.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedSlice build() { + org.tensorflow.proto.SavedSlice result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedSlice buildPartial() { + org.tensorflow.proto.SavedSlice result = new org.tensorflow.proto.SavedSlice(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedSlice result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.slice_ = sliceBuilder_ == null + ? slice_ + : sliceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.data_ = dataBuilder_ == null + ? data_ + : dataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedSlice) { + return mergeFrom((org.tensorflow.proto.SavedSlice)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedSlice other) { + if (other == org.tensorflow.proto.SavedSlice.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSlice()) { + mergeSlice(other.getSlice()); + } + if (other.hasData()) { + mergeData(other.getData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getSliceFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getDataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Name of the tensor that this slice belongs to. This must be identical to
    +     * the name used to encode the key for this record.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor that this slice belongs to. This must be identical to
    +     * the name used to encode the key for this record.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor that this slice belongs to. This must be identical to
    +     * the name used to encode the key for this record.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor that this slice belongs to. This must be identical to
    +     * the name used to encode the key for this record.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor that this slice belongs to. This must be identical to
    +     * the name used to encode the key for this record.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorSliceProto slice_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> sliceBuilder_; + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + * @return Whether the slice field is set. + */ + public boolean hasSlice() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + * @return The slice. + */ + public org.tensorflow.proto.TensorSliceProto getSlice() { + if (sliceBuilder_ == null) { + return slice_ == null ? org.tensorflow.proto.TensorSliceProto.getDefaultInstance() : slice_; + } else { + return sliceBuilder_.getMessage(); + } + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public Builder setSlice(org.tensorflow.proto.TensorSliceProto value) { + if (sliceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + slice_ = value; + } else { + sliceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public Builder setSlice( + org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (sliceBuilder_ == null) { + slice_ = builderForValue.build(); + } else { + sliceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public Builder mergeSlice(org.tensorflow.proto.TensorSliceProto value) { + if (sliceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + slice_ != null && + slice_ != org.tensorflow.proto.TensorSliceProto.getDefaultInstance()) { + getSliceBuilder().mergeFrom(value); + } else { + slice_ = value; + } + } else { + sliceBuilder_.mergeFrom(value); + } + if (slice_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public Builder clearSlice() { + bitField0_ = (bitField0_ & ~0x00000002); + slice_ = null; + if (sliceBuilder_ != null) { + sliceBuilder_.dispose(); + sliceBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public org.tensorflow.proto.TensorSliceProto.Builder getSliceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSliceFieldBuilder().getBuilder(); + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder() { + if (sliceBuilder_ != null) { + return sliceBuilder_.getMessageOrBuilder(); + } else { + return slice_ == null ? + org.tensorflow.proto.TensorSliceProto.getDefaultInstance() : slice_; + } + } + /** + *
    +     * Extent of the slice.  Must have one entry for each of the dimension of the
    +     * tensor that this slice belongs to.
    +     * 
    + * + * .tensorflow.TensorSliceProto slice = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> + getSliceFieldBuilder() { + if (sliceBuilder_ == null) { + sliceBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder>( + getSlice(), + getParentForChildren(), + isClean()); + slice_ = null; + } + return sliceBuilder_; + } + + private org.tensorflow.proto.TensorProto data_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> dataBuilder_; + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + * @return Whether the data field is set. + */ + public boolean hasData() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + * @return The data. + */ + public org.tensorflow.proto.TensorProto getData() { + if (dataBuilder_ == null) { + return data_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public Builder setData(org.tensorflow.proto.TensorProto value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + } else { + dataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public Builder setData( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public Builder mergeData(org.tensorflow.proto.TensorProto value) { + if (dataBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + data_ != null && + data_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getDataBuilder().mergeFrom(value); + } else { + data_ = value; + } + } else { + dataBuilder_.mergeFrom(value); + } + if (data_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000004); + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public org.tensorflow.proto.TensorProto.Builder getDataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : data_; + } + } + /** + *
    +     * The raw data of the slice is stored as a TensorProto. Only raw data are
    +     * stored (we don't fill in fields such as dtype or tensor_shape).
    +     * 
    + * + * .tensorflow.TensorProto data = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedSlice) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedSlice) + private static final org.tensorflow.proto.SavedSlice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedSlice(); + } + + public static org.tensorflow.proto.SavedSlice getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedSlice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedSlice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMeta.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMeta.java new file mode 100644 index 00000000000..6718d0c6493 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMeta.java @@ -0,0 +1,1349 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Metadata describing the set of slices of the same tensor saved in a
    + * checkpoint file.
    + * 
    + * + * Protobuf type {@code tensorflow.SavedSliceMeta} + */ +public final class SavedSliceMeta extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedSliceMeta) + SavedSliceMetaOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedSliceMeta.class.getName()); + } + // Use SavedSliceMeta.newBuilder() to construct. + private SavedSliceMeta(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedSliceMeta() { + name_ = ""; + type_ = 0; + slice_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedSliceMeta.class, org.tensorflow.proto.SavedSliceMeta.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_ = 0; + /** + *
    +   * Type of the tensor
    +   * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
    +   * Type of the tensor
    +   * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + @java.lang.Override public org.tensorflow.proto.DataType getType() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(type_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SLICE_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List slice_; + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + @java.lang.Override + public java.util.List getSliceList() { + return slice_; + } + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + @java.lang.Override + public java.util.List + getSliceOrBuilderList() { + return slice_; + } + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + @java.lang.Override + public int getSliceCount() { + return slice_.size(); + } + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto getSlice(int index) { + return slice_.get(index); + } + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder( + int index) { + return slice_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (type_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(3, type_); + } + for (int i = 0; i < slice_.size(); i++) { + output.writeMessage(4, slice_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (type_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, type_); + } + for (int i = 0; i < slice_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, slice_.get(i)); + } + size += getUnknownFields().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.SavedSliceMeta)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedSliceMeta other = (org.tensorflow.proto.SavedSliceMeta) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (type_ != other.type_) return false; + if (!getSliceList() + .equals(other.getSliceList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (getSliceCount() > 0) { + hash = (37 * hash) + SLICE_FIELD_NUMBER; + hash = (53 * hash) + getSliceList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedSliceMeta parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSliceMeta 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.SavedSliceMeta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSliceMeta 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.SavedSliceMeta parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedSliceMeta parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedSliceMeta parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedSliceMeta parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedSliceMeta parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedSliceMeta parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedSliceMeta parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedSliceMeta parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedSliceMeta 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Metadata describing the set of slices of the same tensor saved in a
    +   * checkpoint file.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedSliceMeta} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedSliceMeta) + org.tensorflow.proto.SavedSliceMetaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedSliceMeta.class, org.tensorflow.proto.SavedSliceMeta.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedSliceMeta.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getSliceFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + type_ = 0; + if (sliceBuilder_ == null) { + slice_ = java.util.Collections.emptyList(); + } else { + slice_ = null; + sliceBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedSliceMeta_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedSliceMeta getDefaultInstanceForType() { + return org.tensorflow.proto.SavedSliceMeta.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedSliceMeta build() { + org.tensorflow.proto.SavedSliceMeta result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedSliceMeta buildPartial() { + org.tensorflow.proto.SavedSliceMeta result = new org.tensorflow.proto.SavedSliceMeta(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedSliceMeta result) { + if (sliceBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + slice_ = java.util.Collections.unmodifiableList(slice_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.slice_ = slice_; + } else { + result.slice_ = sliceBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedSliceMeta result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedSliceMeta) { + return mergeFrom((org.tensorflow.proto.SavedSliceMeta)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedSliceMeta other) { + if (other == org.tensorflow.proto.SavedSliceMeta.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (sliceBuilder_ == null) { + if (!other.slice_.isEmpty()) { + if (slice_.isEmpty()) { + slice_ = other.slice_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSliceIsMutable(); + slice_.addAll(other.slice_); + } + onChanged(); + } + } else { + if (!other.slice_.isEmpty()) { + if (sliceBuilder_.isEmpty()) { + sliceBuilder_.dispose(); + sliceBuilder_ = null; + slice_ = other.slice_; + bitField0_ = (bitField0_ & ~0x00000008); + sliceBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSliceFieldBuilder() : null; + } else { + sliceBuilder_.addAllMessages(other.slice_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + type_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + org.tensorflow.proto.TensorSliceProto m = + input.readMessage( + org.tensorflow.proto.TensorSliceProto.parser(), + extensionRegistry); + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + slice_.add(m); + } else { + sliceBuilder_.addMessage(m); + } + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + *
    +     * Shape of the tensor
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private int type_ = 0; + /** + *
    +     * Type of the tensor
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
    +     * Type of the tensor
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getType() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(type_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +     * Type of the tensor
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Type of the tensor
    +     * 
    + * + * .tensorflow.DataType type = 3; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000004); + type_ = 0; + onChanged(); + return this; + } + + private java.util.List slice_ = + java.util.Collections.emptyList(); + private void ensureSliceIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + slice_ = new java.util.ArrayList(slice_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> sliceBuilder_; + + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public java.util.List getSliceList() { + if (sliceBuilder_ == null) { + return java.util.Collections.unmodifiableList(slice_); + } else { + return sliceBuilder_.getMessageList(); + } + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public int getSliceCount() { + if (sliceBuilder_ == null) { + return slice_.size(); + } else { + return sliceBuilder_.getCount(); + } + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public org.tensorflow.proto.TensorSliceProto getSlice(int index) { + if (sliceBuilder_ == null) { + return slice_.get(index); + } else { + return sliceBuilder_.getMessage(index); + } + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder setSlice( + int index, org.tensorflow.proto.TensorSliceProto value) { + if (sliceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIsMutable(); + slice_.set(index, value); + onChanged(); + } else { + sliceBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder setSlice( + int index, org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + slice_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder addSlice(org.tensorflow.proto.TensorSliceProto value) { + if (sliceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIsMutable(); + slice_.add(value); + onChanged(); + } else { + sliceBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder addSlice( + int index, org.tensorflow.proto.TensorSliceProto value) { + if (sliceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceIsMutable(); + slice_.add(index, value); + onChanged(); + } else { + sliceBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder addSlice( + org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + slice_.add(builderForValue.build()); + onChanged(); + } else { + sliceBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder addSlice( + int index, org.tensorflow.proto.TensorSliceProto.Builder builderForValue) { + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + slice_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder addAllSlice( + java.lang.Iterable values) { + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slice_); + onChanged(); + } else { + sliceBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder clearSlice() { + if (sliceBuilder_ == null) { + slice_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + sliceBuilder_.clear(); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public Builder removeSlice(int index) { + if (sliceBuilder_ == null) { + ensureSliceIsMutable(); + slice_.remove(index); + onChanged(); + } else { + sliceBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public org.tensorflow.proto.TensorSliceProto.Builder getSliceBuilder( + int index) { + return getSliceFieldBuilder().getBuilder(index); + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder( + int index) { + if (sliceBuilder_ == null) { + return slice_.get(index); } else { + return sliceBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public java.util.List + getSliceOrBuilderList() { + if (sliceBuilder_ != null) { + return sliceBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slice_); + } + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public org.tensorflow.proto.TensorSliceProto.Builder addSliceBuilder() { + return getSliceFieldBuilder().addBuilder( + org.tensorflow.proto.TensorSliceProto.getDefaultInstance()); + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public org.tensorflow.proto.TensorSliceProto.Builder addSliceBuilder( + int index) { + return getSliceFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorSliceProto.getDefaultInstance()); + } + /** + *
    +     * Explicit list of slices saved in the checkpoint file.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + public java.util.List + getSliceBuilderList() { + return getSliceFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder> + getSliceFieldBuilder() { + if (sliceBuilder_ == null) { + sliceBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto, org.tensorflow.proto.TensorSliceProto.Builder, org.tensorflow.proto.TensorSliceProtoOrBuilder>( + slice_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + slice_ = null; + } + return sliceBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedSliceMeta) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedSliceMeta) + private static final org.tensorflow.proto.SavedSliceMeta DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedSliceMeta(); + } + + public static org.tensorflow.proto.SavedSliceMeta getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedSliceMeta parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedSliceMeta getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMetaOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMetaOrBuilder.java new file mode 100644 index 00000000000..b16e0be04c9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceMetaOrBuilder.java @@ -0,0 +1,121 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SavedSliceMetaOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SavedSliceMeta) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * Name of the tensor.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + *
    +   * Shape of the tensor
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + *
    +   * Type of the tensor
    +   * 
    + * + * .tensorflow.DataType type = 3; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + *
    +   * Type of the tensor
    +   * 
    + * + * .tensorflow.DataType type = 3; + * @return The type. + */ + org.tensorflow.proto.DataType getType(); + + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + java.util.List + getSliceList(); + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + org.tensorflow.proto.TensorSliceProto getSlice(int index); + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + int getSliceCount(); + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + java.util.List + getSliceOrBuilderList(); + /** + *
    +   * Explicit list of slices saved in the checkpoint file.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto slice = 4; + */ + org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceOrBuilder.java index bf76430d534..0b485f9caca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedSliceOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedSliceOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface SavedSliceOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SavedSlice) @@ -14,6 +16,7 @@ public interface SavedSliceOrBuilder extends *
    * * string name = 1; + * @return The name. */ java.lang.String getName(); /** @@ -23,6 +26,7 @@ public interface SavedSliceOrBuilder extends *
    * * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -34,6 +38,7 @@ public interface SavedSliceOrBuilder extends *
    * * .tensorflow.TensorSliceProto slice = 2; + * @return Whether the slice field is set. */ boolean hasSlice(); /** @@ -43,8 +48,9 @@ public interface SavedSliceOrBuilder extends * * * .tensorflow.TensorSliceProto slice = 2; + * @return The slice. */ - org.tensorflow.proto.framework.TensorSliceProto getSlice(); + org.tensorflow.proto.TensorSliceProto getSlice(); /** *
        * Extent of the slice.  Must have one entry for each of the dimension of the
    @@ -53,7 +59,7 @@ public interface SavedSliceOrBuilder extends
        *
        * .tensorflow.TensorSliceProto slice = 2;
        */
    -  org.tensorflow.proto.framework.TensorSliceProtoOrBuilder getSliceOrBuilder();
    +  org.tensorflow.proto.TensorSliceProtoOrBuilder getSliceOrBuilder();
     
       /**
        * 
    @@ -62,6 +68,7 @@ public interface SavedSliceOrBuilder extends
        * 
    * * .tensorflow.TensorProto data = 3; + * @return Whether the data field is set. */ boolean hasData(); /** @@ -71,8 +78,9 @@ public interface SavedSliceOrBuilder extends *
    * * .tensorflow.TensorProto data = 3; + * @return The data. */ - org.tensorflow.proto.framework.TensorProto getData(); + org.tensorflow.proto.TensorProto getData(); /** *
        * The raw data of the slice is stored as a TensorProto. Only raw data are
    @@ -81,5 +89,5 @@ public interface SavedSliceOrBuilder extends
        *
        * .tensorflow.TensorProto data = 3;
        */
    -  org.tensorflow.proto.framework.TensorProtoOrBuilder getDataOrBuilder();
    +  org.tensorflow.proto.TensorProtoOrBuilder getDataOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMeta.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMeta.java
    new file mode 100644
    index 00000000000..ebe9c66228b
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMeta.java
    @@ -0,0 +1,1075 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/saved_tensor_slice.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Metadata describing the set of tensor slices saved in a checkpoint file.
    + * It is always stored at the beginning of each checkpoint file.
    + * 
    + * + * Protobuf type {@code tensorflow.SavedTensorSliceMeta} + */ +public final class SavedTensorSliceMeta extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedTensorSliceMeta) + SavedTensorSliceMetaOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedTensorSliceMeta.class.getName()); + } + // Use SavedTensorSliceMeta.newBuilder() to construct. + private SavedTensorSliceMeta(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedTensorSliceMeta() { + tensor_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedTensorSliceMeta.class, org.tensorflow.proto.SavedTensorSliceMeta.Builder.class); + } + + private int bitField0_; + public static final int TENSOR_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List tensor_; + /** + *
    +   * Each SavedSliceMeta describes the slices for one tensor.
    +   * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + @java.lang.Override + public java.util.List getTensorList() { + return tensor_; + } + /** + *
    +   * Each SavedSliceMeta describes the slices for one tensor.
    +   * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + @java.lang.Override + public java.util.List + getTensorOrBuilderList() { + return tensor_; + } + /** + *
    +   * Each SavedSliceMeta describes the slices for one tensor.
    +   * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + @java.lang.Override + public int getTensorCount() { + return tensor_.size(); + } + /** + *
    +   * Each SavedSliceMeta describes the slices for one tensor.
    +   * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SavedSliceMeta getTensor(int index) { + return tensor_.get(index); + } + /** + *
    +   * Each SavedSliceMeta describes the slices for one tensor.
    +   * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SavedSliceMetaOrBuilder getTensorOrBuilder( + int index) { + return tensor_.get(index); + } + + public static final int VERSIONS_FIELD_NUMBER = 2; + private org.tensorflow.proto.VersionDef versions_; + /** + *
    +   * Compatibility version of this checkpoint.  See core/public/version.h
    +   * for version history.
    +   * 
    + * + * .tensorflow.VersionDef versions = 2; + * @return Whether the versions field is set. + */ + @java.lang.Override + public boolean hasVersions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Compatibility version of this checkpoint.  See core/public/version.h
    +   * for version history.
    +   * 
    + * + * .tensorflow.VersionDef versions = 2; + * @return The versions. + */ + @java.lang.Override + public org.tensorflow.proto.VersionDef getVersions() { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + /** + *
    +   * Compatibility version of this checkpoint.  See core/public/version.h
    +   * for version history.
    +   * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + @java.lang.Override + public org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder() { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + + 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 { + for (int i = 0; i < tensor_.size(); i++) { + output.writeMessage(1, tensor_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getVersions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tensor_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tensor_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getVersions()); + } + size += getUnknownFields().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.SavedTensorSliceMeta)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedTensorSliceMeta other = (org.tensorflow.proto.SavedTensorSliceMeta) obj; + + if (!getTensorList() + .equals(other.getTensorList())) return false; + if (hasVersions() != other.hasVersions()) return false; + if (hasVersions()) { + if (!getVersions() + .equals(other.getVersions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorCount() > 0) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensorList().hashCode(); + } + if (hasVersions()) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSliceMeta 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.SavedTensorSliceMeta parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedTensorSliceMeta parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedTensorSliceMeta parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedTensorSliceMeta parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedTensorSliceMeta 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Metadata describing the set of tensor slices saved in a checkpoint file.
    +   * It is always stored at the beginning of each checkpoint file.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedTensorSliceMeta} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedTensorSliceMeta) + org.tensorflow.proto.SavedTensorSliceMetaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedTensorSliceMeta.class, org.tensorflow.proto.SavedTensorSliceMeta.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedTensorSliceMeta.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorFieldBuilder(); + getVersionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + } else { + tensor_ = null; + tensorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + versions_ = null; + if (versionsBuilder_ != null) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSliceMeta_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSliceMeta getDefaultInstanceForType() { + return org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSliceMeta build() { + org.tensorflow.proto.SavedTensorSliceMeta result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSliceMeta buildPartial() { + org.tensorflow.proto.SavedTensorSliceMeta result = new org.tensorflow.proto.SavedTensorSliceMeta(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.SavedTensorSliceMeta result) { + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tensor_ = java.util.Collections.unmodifiableList(tensor_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tensor_ = tensor_; + } else { + result.tensor_ = tensorBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.SavedTensorSliceMeta result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.versions_ = versionsBuilder_ == null + ? versions_ + : versionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedTensorSliceMeta) { + return mergeFrom((org.tensorflow.proto.SavedTensorSliceMeta)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedTensorSliceMeta other) { + if (other == org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance()) return this; + if (tensorBuilder_ == null) { + if (!other.tensor_.isEmpty()) { + if (tensor_.isEmpty()) { + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTensorIsMutable(); + tensor_.addAll(other.tensor_); + } + onChanged(); + } + } else { + if (!other.tensor_.isEmpty()) { + if (tensorBuilder_.isEmpty()) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000001); + tensorBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorFieldBuilder() : null; + } else { + tensorBuilder_.addAllMessages(other.tensor_); + } + } + } + if (other.hasVersions()) { + mergeVersions(other.getVersions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.SavedSliceMeta m = + input.readMessage( + org.tensorflow.proto.SavedSliceMeta.parser(), + extensionRegistry); + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(m); + } else { + tensorBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + input.readMessage( + getVersionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List tensor_ = + java.util.Collections.emptyList(); + private void ensureTensorIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tensor_ = new java.util.ArrayList(tensor_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedSliceMeta, org.tensorflow.proto.SavedSliceMeta.Builder, org.tensorflow.proto.SavedSliceMetaOrBuilder> tensorBuilder_; + + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public java.util.List getTensorList() { + if (tensorBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensor_); + } else { + return tensorBuilder_.getMessageList(); + } + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public int getTensorCount() { + if (tensorBuilder_ == null) { + return tensor_.size(); + } else { + return tensorBuilder_.getCount(); + } + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public org.tensorflow.proto.SavedSliceMeta getTensor(int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); + } else { + return tensorBuilder_.getMessage(index); + } + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder setTensor( + int index, org.tensorflow.proto.SavedSliceMeta value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.set(index, value); + onChanged(); + } else { + tensorBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder setTensor( + int index, org.tensorflow.proto.SavedSliceMeta.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder addTensor(org.tensorflow.proto.SavedSliceMeta value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(value); + onChanged(); + } else { + tensorBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder addTensor( + int index, org.tensorflow.proto.SavedSliceMeta value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(index, value); + onChanged(); + } else { + tensorBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder addTensor( + org.tensorflow.proto.SavedSliceMeta.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder addTensor( + int index, org.tensorflow.proto.SavedSliceMeta.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder addAllTensor( + java.lang.Iterable values) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensor_); + onChanged(); + } else { + tensorBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder clearTensor() { + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tensorBuilder_.clear(); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public Builder removeTensor(int index) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.remove(index); + onChanged(); + } else { + tensorBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public org.tensorflow.proto.SavedSliceMeta.Builder getTensorBuilder( + int index) { + return getTensorFieldBuilder().getBuilder(index); + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public org.tensorflow.proto.SavedSliceMetaOrBuilder getTensorOrBuilder( + int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); } else { + return tensorBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public java.util.List + getTensorOrBuilderList() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensor_); + } + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public org.tensorflow.proto.SavedSliceMeta.Builder addTensorBuilder() { + return getTensorFieldBuilder().addBuilder( + org.tensorflow.proto.SavedSliceMeta.getDefaultInstance()); + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public org.tensorflow.proto.SavedSliceMeta.Builder addTensorBuilder( + int index) { + return getTensorFieldBuilder().addBuilder( + index, org.tensorflow.proto.SavedSliceMeta.getDefaultInstance()); + } + /** + *
    +     * Each SavedSliceMeta describes the slices for one tensor.
    +     * 
    + * + * repeated .tensorflow.SavedSliceMeta tensor = 1; + */ + public java.util.List + getTensorBuilderList() { + return getTensorFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedSliceMeta, org.tensorflow.proto.SavedSliceMeta.Builder, org.tensorflow.proto.SavedSliceMetaOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.SavedSliceMeta, org.tensorflow.proto.SavedSliceMeta.Builder, org.tensorflow.proto.SavedSliceMetaOrBuilder>( + tensor_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + private org.tensorflow.proto.VersionDef versions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> versionsBuilder_; + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + * @return Whether the versions field is set. + */ + public boolean hasVersions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + * @return The versions. + */ + public org.tensorflow.proto.VersionDef getVersions() { + if (versionsBuilder_ == null) { + return versions_ == null ? org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } else { + return versionsBuilder_.getMessage(); + } + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public Builder setVersions(org.tensorflow.proto.VersionDef value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versions_ = value; + } else { + versionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public Builder setVersions( + org.tensorflow.proto.VersionDef.Builder builderForValue) { + if (versionsBuilder_ == null) { + versions_ = builderForValue.build(); + } else { + versionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public Builder mergeVersions(org.tensorflow.proto.VersionDef value) { + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + versions_ != null && + versions_ != org.tensorflow.proto.VersionDef.getDefaultInstance()) { + getVersionsBuilder().mergeFrom(value); + } else { + versions_ = value; + } + } else { + versionsBuilder_.mergeFrom(value); + } + if (versions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public Builder clearVersions() { + bitField0_ = (bitField0_ & ~0x00000002); + versions_ = null; + if (versionsBuilder_ != null) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public org.tensorflow.proto.VersionDef.Builder getVersionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getVersionsFieldBuilder().getBuilder(); + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + public org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilder(); + } else { + return versions_ == null ? + org.tensorflow.proto.VersionDef.getDefaultInstance() : versions_; + } + } + /** + *
    +     * Compatibility version of this checkpoint.  See core/public/version.h
    +     * for version history.
    +     * 
    + * + * .tensorflow.VersionDef versions = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.VersionDef, org.tensorflow.proto.VersionDef.Builder, org.tensorflow.proto.VersionDefOrBuilder>( + getVersions(), + getParentForChildren(), + isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedTensorSliceMeta) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedTensorSliceMeta) + private static final org.tensorflow.proto.SavedTensorSliceMeta DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedTensorSliceMeta(); + } + + public static org.tensorflow.proto.SavedTensorSliceMeta getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedTensorSliceMeta parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedTensorSliceMeta getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMetaOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMetaOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMetaOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMetaOrBuilder.java index 464fc6423f6..bb69dc63e26 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSliceMetaOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceMetaOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface SavedTensorSliceMetaOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SavedTensorSliceMeta) @@ -14,7 +16,7 @@ public interface SavedTensorSliceMetaOrBuilder extends * * repeated .tensorflow.SavedSliceMeta tensor = 1; */ - java.util.List + java.util.List getTensorList(); /** *
    @@ -23,7 +25,7 @@ public interface SavedTensorSliceMetaOrBuilder extends
        *
        * repeated .tensorflow.SavedSliceMeta tensor = 1;
        */
    -  org.tensorflow.proto.util.SavedSliceMeta getTensor(int index);
    +  org.tensorflow.proto.SavedSliceMeta getTensor(int index);
       /**
        * 
        * Each SavedSliceMeta describes the slices for one tensor.
    @@ -39,7 +41,7 @@ public interface SavedTensorSliceMetaOrBuilder extends
        *
        * repeated .tensorflow.SavedSliceMeta tensor = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getTensorOrBuilderList();
       /**
        * 
    @@ -48,7 +50,7 @@ public interface SavedTensorSliceMetaOrBuilder extends
        *
        * repeated .tensorflow.SavedSliceMeta tensor = 1;
        */
    -  org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder(
    +  org.tensorflow.proto.SavedSliceMetaOrBuilder getTensorOrBuilder(
           int index);
     
       /**
    @@ -58,6 +60,7 @@ org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder(
        * 
    * * .tensorflow.VersionDef versions = 2; + * @return Whether the versions field is set. */ boolean hasVersions(); /** @@ -67,8 +70,9 @@ org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder( *
    * * .tensorflow.VersionDef versions = 2; + * @return The versions. */ - org.tensorflow.proto.framework.VersionDef getVersions(); + org.tensorflow.proto.VersionDef getVersions(); /** *
        * Compatibility version of this checkpoint.  See core/public/version.h
    @@ -77,5 +81,5 @@ org.tensorflow.proto.util.SavedSliceMetaOrBuilder getTensorOrBuilder(
        *
        * .tensorflow.VersionDef versions = 2;
        */
    -  org.tensorflow.proto.framework.VersionDefOrBuilder getVersionsOrBuilder();
    +  org.tensorflow.proto.VersionDefOrBuilder getVersionsOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceProtos.java
    new file mode 100644
    index 00000000000..57c5be9c252
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSliceProtos.java
    @@ -0,0 +1,121 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/saved_tensor_slice.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class SavedTensorSliceProtos {
    +  private SavedTensorSliceProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      SavedTensorSliceProtos.class.getName());
    +  }
    +  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_SavedSliceMeta_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_SavedTensorSliceMeta_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_SavedSlice_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SavedSlice_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_SavedTensorSlices_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SavedTensorSlices_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/util/saved_tensor_slic" +
    +      "e.proto\022\ntensorflow\032,tensorflow/core/fra" +
    +      "mework/tensor_shape.proto\032,tensorflow/co" +
    +      "re/framework/tensor_slice.proto\032&tensorf" +
    +      "low/core/framework/tensor.proto\032%tensorf" +
    +      "low/core/framework/types.proto\032(tensorfl" +
    +      "ow/core/framework/versions.proto\"\234\001\n\016Sav" +
    +      "edSliceMeta\022\014\n\004name\030\001 \001(\t\022+\n\005shape\030\002 \001(\013" +
    +      "2\034.tensorflow.TensorShapeProto\022\"\n\004type\030\003" +
    +      " \001(\0162\024.tensorflow.DataType\022+\n\005slice\030\004 \003(" +
    +      "\0132\034.tensorflow.TensorSliceProto\"l\n\024Saved" +
    +      "TensorSliceMeta\022*\n\006tensor\030\001 \003(\0132\032.tensor" +
    +      "flow.SavedSliceMeta\022(\n\010versions\030\002 \001(\0132\026." +
    +      "tensorflow.VersionDef\"n\n\nSavedSlice\022\014\n\004n" +
    +      "ame\030\001 \001(\t\022+\n\005slice\030\002 \001(\0132\034.tensorflow.Te" +
    +      "nsorSliceProto\022%\n\004data\030\003 \001(\0132\027.tensorflo" +
    +      "w.TensorProto\"i\n\021SavedTensorSlices\022.\n\004me" +
    +      "ta\030\001 \001(\0132 .tensorflow.SavedTensorSliceMe" +
    +      "ta\022$\n\004data\030\002 \001(\0132\026.tensorflow.SavedSlice" +
    +      "B3\n\024org.tensorflow.protoB\026SavedTensorSli" +
    +      "ceProtosP\001\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.TensorShapeProtos.getDescriptor(),
    +          org.tensorflow.proto.TensorSliceProtos.getDescriptor(),
    +          org.tensorflow.proto.TensorProtos.getDescriptor(),
    +          org.tensorflow.proto.TypesProtos.getDescriptor(),
    +          org.tensorflow.proto.VersionsProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_SavedSliceMeta_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_SavedSliceMeta_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SavedSliceMeta_descriptor,
    +        new java.lang.String[] { "Name", "Shape", "Type", "Slice", });
    +    internal_static_tensorflow_SavedTensorSliceMeta_descriptor =
    +      getDescriptor().getMessageTypes().get(1);
    +    internal_static_tensorflow_SavedTensorSliceMeta_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SavedTensorSliceMeta_descriptor,
    +        new java.lang.String[] { "Tensor", "Versions", });
    +    internal_static_tensorflow_SavedSlice_descriptor =
    +      getDescriptor().getMessageTypes().get(2);
    +    internal_static_tensorflow_SavedSlice_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SavedSlice_descriptor,
    +        new java.lang.String[] { "Name", "Slice", "Data", });
    +    internal_static_tensorflow_SavedTensorSlices_descriptor =
    +      getDescriptor().getMessageTypes().get(3);
    +    internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SavedTensorSlices_descriptor,
    +        new java.lang.String[] { "Meta", "Data", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.TensorShapeProtos.getDescriptor();
    +    org.tensorflow.proto.TensorSliceProtos.getDescriptor();
    +    org.tensorflow.proto.TensorProtos.getDescriptor();
    +    org.tensorflow.proto.TypesProtos.getDescriptor();
    +    org.tensorflow.proto.VersionsProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlices.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlices.java
    new file mode 100644
    index 00000000000..73a6edbc8d1
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlices.java
    @@ -0,0 +1,861 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/saved_tensor_slice.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Each record in a v3 checkpoint file is a serialized SavedTensorSlices
    + * message.
    + * 
    + * + * Protobuf type {@code tensorflow.SavedTensorSlices} + */ +public final class SavedTensorSlices extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SavedTensorSlices) + SavedTensorSlicesOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SavedTensorSlices.class.getName()); + } + // Use SavedTensorSlices.newBuilder() to construct. + private SavedTensorSlices(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SavedTensorSlices() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedTensorSlices.class, org.tensorflow.proto.SavedTensorSlices.Builder.class); + } + + private int bitField0_; + public static final int META_FIELD_NUMBER = 1; + private org.tensorflow.proto.SavedTensorSliceMeta meta_; + /** + *
    +   * This is only present at the first item of each checkpoint file and serves
    +   * as a table of contents, listing all the tensor slices saved in this file.
    +   * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return Whether the meta field is set. + */ + @java.lang.Override + public boolean hasMeta() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * This is only present at the first item of each checkpoint file and serves
    +   * as a table of contents, listing all the tensor slices saved in this file.
    +   * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return The meta. + */ + @java.lang.Override + public org.tensorflow.proto.SavedTensorSliceMeta getMeta() { + return meta_ == null ? org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance() : meta_; + } + /** + *
    +   * This is only present at the first item of each checkpoint file and serves
    +   * as a table of contents, listing all the tensor slices saved in this file.
    +   * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SavedTensorSliceMetaOrBuilder getMetaOrBuilder() { + return meta_ == null ? org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance() : meta_; + } + + public static final int DATA_FIELD_NUMBER = 2; + private org.tensorflow.proto.SavedSlice data_; + /** + *
    +   * This exists in all but the first item of each checkpoint file.
    +   * 
    + * + * .tensorflow.SavedSlice data = 2; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * This exists in all but the first item of each checkpoint file.
    +   * 
    + * + * .tensorflow.SavedSlice data = 2; + * @return The data. + */ + @java.lang.Override + public org.tensorflow.proto.SavedSlice getData() { + return data_ == null ? org.tensorflow.proto.SavedSlice.getDefaultInstance() : data_; + } + /** + *
    +   * This exists in all but the first item of each checkpoint file.
    +   * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + @java.lang.Override + public org.tensorflow.proto.SavedSliceOrBuilder getDataOrBuilder() { + return data_ == null ? org.tensorflow.proto.SavedSlice.getDefaultInstance() : data_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getMeta()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getData()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getMeta()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getData()); + } + size += getUnknownFields().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.SavedTensorSlices)) { + return super.equals(obj); + } + org.tensorflow.proto.SavedTensorSlices other = (org.tensorflow.proto.SavedTensorSlices) obj; + + if (hasMeta() != other.hasMeta()) return false; + if (hasMeta()) { + if (!getMeta() + .equals(other.getMeta())) return false; + } + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMeta()) { + hash = (37 * hash) + META_FIELD_NUMBER; + hash = (53 * hash) + getMeta().hashCode(); + } + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SavedTensorSlices parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSlices 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.SavedTensorSlices parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSlices 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.SavedTensorSlices parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SavedTensorSlices parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SavedTensorSlices parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedTensorSlices parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SavedTensorSlices parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SavedTensorSlices parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SavedTensorSlices parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SavedTensorSlices parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SavedTensorSlices 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Each record in a v3 checkpoint file is a serialized SavedTensorSlices
    +   * message.
    +   * 
    + * + * Protobuf type {@code tensorflow.SavedTensorSlices} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SavedTensorSlices) + org.tensorflow.proto.SavedTensorSlicesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SavedTensorSlices.class, org.tensorflow.proto.SavedTensorSlices.Builder.class); + } + + // Construct using org.tensorflow.proto.SavedTensorSlices.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMetaFieldBuilder(); + getDataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + meta_ = null; + if (metaBuilder_ != null) { + metaBuilder_.dispose(); + metaBuilder_ = null; + } + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SavedTensorSliceProtos.internal_static_tensorflow_SavedTensorSlices_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSlices getDefaultInstanceForType() { + return org.tensorflow.proto.SavedTensorSlices.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSlices build() { + org.tensorflow.proto.SavedTensorSlices result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SavedTensorSlices buildPartial() { + org.tensorflow.proto.SavedTensorSlices result = new org.tensorflow.proto.SavedTensorSlices(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SavedTensorSlices result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.meta_ = metaBuilder_ == null + ? meta_ + : metaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.data_ = dataBuilder_ == null + ? data_ + : dataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SavedTensorSlices) { + return mergeFrom((org.tensorflow.proto.SavedTensorSlices)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SavedTensorSlices other) { + if (other == org.tensorflow.proto.SavedTensorSlices.getDefaultInstance()) return this; + if (other.hasMeta()) { + mergeMeta(other.getMeta()); + } + if (other.hasData()) { + mergeData(other.getData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getMetaFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getDataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.SavedTensorSliceMeta meta_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedTensorSliceMeta, org.tensorflow.proto.SavedTensorSliceMeta.Builder, org.tensorflow.proto.SavedTensorSliceMetaOrBuilder> metaBuilder_; + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return Whether the meta field is set. + */ + public boolean hasMeta() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return The meta. + */ + public org.tensorflow.proto.SavedTensorSliceMeta getMeta() { + if (metaBuilder_ == null) { + return meta_ == null ? org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance() : meta_; + } else { + return metaBuilder_.getMessage(); + } + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public Builder setMeta(org.tensorflow.proto.SavedTensorSliceMeta value) { + if (metaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + meta_ = value; + } else { + metaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public Builder setMeta( + org.tensorflow.proto.SavedTensorSliceMeta.Builder builderForValue) { + if (metaBuilder_ == null) { + meta_ = builderForValue.build(); + } else { + metaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public Builder mergeMeta(org.tensorflow.proto.SavedTensorSliceMeta value) { + if (metaBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + meta_ != null && + meta_ != org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance()) { + getMetaBuilder().mergeFrom(value); + } else { + meta_ = value; + } + } else { + metaBuilder_.mergeFrom(value); + } + if (meta_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public Builder clearMeta() { + bitField0_ = (bitField0_ & ~0x00000001); + meta_ = null; + if (metaBuilder_ != null) { + metaBuilder_.dispose(); + metaBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public org.tensorflow.proto.SavedTensorSliceMeta.Builder getMetaBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMetaFieldBuilder().getBuilder(); + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + public org.tensorflow.proto.SavedTensorSliceMetaOrBuilder getMetaOrBuilder() { + if (metaBuilder_ != null) { + return metaBuilder_.getMessageOrBuilder(); + } else { + return meta_ == null ? + org.tensorflow.proto.SavedTensorSliceMeta.getDefaultInstance() : meta_; + } + } + /** + *
    +     * This is only present at the first item of each checkpoint file and serves
    +     * as a table of contents, listing all the tensor slices saved in this file.
    +     * 
    + * + * .tensorflow.SavedTensorSliceMeta meta = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedTensorSliceMeta, org.tensorflow.proto.SavedTensorSliceMeta.Builder, org.tensorflow.proto.SavedTensorSliceMetaOrBuilder> + getMetaFieldBuilder() { + if (metaBuilder_ == null) { + metaBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedTensorSliceMeta, org.tensorflow.proto.SavedTensorSliceMeta.Builder, org.tensorflow.proto.SavedTensorSliceMetaOrBuilder>( + getMeta(), + getParentForChildren(), + isClean()); + meta_ = null; + } + return metaBuilder_; + } + + private org.tensorflow.proto.SavedSlice data_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedSlice, org.tensorflow.proto.SavedSlice.Builder, org.tensorflow.proto.SavedSliceOrBuilder> dataBuilder_; + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + * @return Whether the data field is set. + */ + public boolean hasData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + * @return The data. + */ + public org.tensorflow.proto.SavedSlice getData() { + if (dataBuilder_ == null) { + return data_ == null ? org.tensorflow.proto.SavedSlice.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public Builder setData(org.tensorflow.proto.SavedSlice value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + } else { + dataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public Builder setData( + org.tensorflow.proto.SavedSlice.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public Builder mergeData(org.tensorflow.proto.SavedSlice value) { + if (dataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + data_ != null && + data_ != org.tensorflow.proto.SavedSlice.getDefaultInstance()) { + getDataBuilder().mergeFrom(value); + } else { + data_ = value; + } + } else { + dataBuilder_.mergeFrom(value); + } + if (data_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000002); + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public org.tensorflow.proto.SavedSlice.Builder getDataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + public org.tensorflow.proto.SavedSliceOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + org.tensorflow.proto.SavedSlice.getDefaultInstance() : data_; + } + } + /** + *
    +     * This exists in all but the first item of each checkpoint file.
    +     * 
    + * + * .tensorflow.SavedSlice data = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedSlice, org.tensorflow.proto.SavedSlice.Builder, org.tensorflow.proto.SavedSliceOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SavedSlice, org.tensorflow.proto.SavedSlice.Builder, org.tensorflow.proto.SavedSliceOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SavedTensorSlices) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SavedTensorSlices) + private static final org.tensorflow.proto.SavedTensorSlices DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SavedTensorSlices(); + } + + public static org.tensorflow.proto.SavedTensorSlices getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SavedTensorSlices parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SavedTensorSlices getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlicesOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlicesOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlicesOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlicesOrBuilder.java index f8b12b1c7dd..b22a704bc31 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SavedTensorSlicesOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SavedTensorSlicesOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/util/saved_tensor_slice.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface SavedTensorSlicesOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SavedTensorSlices) @@ -14,6 +16,7 @@ public interface SavedTensorSlicesOrBuilder extends *
    * * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return Whether the meta field is set. */ boolean hasMeta(); /** @@ -23,8 +26,9 @@ public interface SavedTensorSlicesOrBuilder extends *
    * * .tensorflow.SavedTensorSliceMeta meta = 1; + * @return The meta. */ - org.tensorflow.proto.util.SavedTensorSliceMeta getMeta(); + org.tensorflow.proto.SavedTensorSliceMeta getMeta(); /** *
        * This is only present at the first item of each checkpoint file and serves
    @@ -33,7 +37,7 @@ public interface SavedTensorSlicesOrBuilder extends
        *
        * .tensorflow.SavedTensorSliceMeta meta = 1;
        */
    -  org.tensorflow.proto.util.SavedTensorSliceMetaOrBuilder getMetaOrBuilder();
    +  org.tensorflow.proto.SavedTensorSliceMetaOrBuilder getMetaOrBuilder();
     
       /**
        * 
    @@ -41,6 +45,7 @@ public interface SavedTensorSlicesOrBuilder extends
        * 
    * * .tensorflow.SavedSlice data = 2; + * @return Whether the data field is set. */ boolean hasData(); /** @@ -49,8 +54,9 @@ public interface SavedTensorSlicesOrBuilder extends *
    * * .tensorflow.SavedSlice data = 2; + * @return The data. */ - org.tensorflow.proto.util.SavedSlice getData(); + org.tensorflow.proto.SavedSlice getData(); /** *
        * This exists in all but the first item of each checkpoint file.
    @@ -58,5 +64,5 @@ public interface SavedTensorSlicesOrBuilder extends
        *
        * .tensorflow.SavedSlice data = 2;
        */
    -  org.tensorflow.proto.util.SavedSliceOrBuilder getDataOrBuilder();
    +  org.tensorflow.proto.SavedSliceOrBuilder getDataOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDef.java
    new file mode 100644
    index 00000000000..c7940c18c50
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDef.java
    @@ -0,0 +1,1384 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/saver.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing the configuration of a Saver.
    + * 
    + * + * Protobuf type {@code tensorflow.SaverDef} + */ +public final class SaverDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SaverDef) + SaverDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SaverDef.class.getName()); + } + // Use SaverDef.newBuilder() to construct. + private SaverDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SaverDef() { + filenameTensorName_ = ""; + saveTensorName_ = ""; + restoreOpName_ = ""; + version_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SaverDef.class, org.tensorflow.proto.SaverDef.Builder.class); + } + + /** + *
    +   * A version number that identifies a different on-disk checkpoint format.
    +   * Usually, each subclass of BaseSaverBuilder works with a particular
    +   * version/format.  However, it is possible that the same builder may be
    +   * upgraded to support a newer checkpoint format in the future.
    +   * 
    + * + * Protobuf enum {@code tensorflow.SaverDef.CheckpointFormatVersion} + */ + public enum CheckpointFormatVersion + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * Internal legacy format.
    +     * 
    + * + * LEGACY = 0; + */ + LEGACY(0), + /** + *
    +     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
    +     * 
    + * + * V1 = 1; + */ + V1(1), + /** + *
    +     * Current format: more efficient.
    +     * 
    + * + * V2 = 2; + */ + V2(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CheckpointFormatVersion.class.getName()); + } + /** + *
    +     * Internal legacy format.
    +     * 
    + * + * LEGACY = 0; + */ + public static final int LEGACY_VALUE = 0; + /** + *
    +     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
    +     * 
    + * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + /** + *
    +     * Current format: more efficient.
    +     * 
    + * + * V2 = 2; + */ + public static final int V2_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CheckpointFormatVersion valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CheckpointFormatVersion forNumber(int value) { + switch (value) { + case 0: return LEGACY; + case 1: return V1; + case 2: return V2; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CheckpointFormatVersion> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CheckpointFormatVersion findValueByNumber(int number) { + return CheckpointFormatVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.SaverDef.getDescriptor().getEnumTypes().get(0); + } + + private static final CheckpointFormatVersion[] VALUES = values(); + + public static CheckpointFormatVersion 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 CheckpointFormatVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.SaverDef.CheckpointFormatVersion) + } + + public static final int FILENAME_TENSOR_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object filenameTensorName_ = ""; + /** + *
    +   * The name of the tensor in which to specify the filename when saving or
    +   * restoring a model checkpoint.
    +   * 
    + * + * string filename_tensor_name = 1; + * @return The filenameTensorName. + */ + @java.lang.Override + public java.lang.String getFilenameTensorName() { + java.lang.Object ref = filenameTensorName_; + 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(); + filenameTensorName_ = s; + return s; + } + } + /** + *
    +   * The name of the tensor in which to specify the filename when saving or
    +   * restoring a model checkpoint.
    +   * 
    + * + * string filename_tensor_name = 1; + * @return The bytes for filenameTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilenameTensorNameBytes() { + java.lang.Object ref = filenameTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filenameTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SAVE_TENSOR_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object saveTensorName_ = ""; + /** + *
    +   * The operation to run when saving a model checkpoint.
    +   * 
    + * + * string save_tensor_name = 2; + * @return The saveTensorName. + */ + @java.lang.Override + public java.lang.String getSaveTensorName() { + java.lang.Object ref = saveTensorName_; + 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(); + saveTensorName_ = s; + return s; + } + } + /** + *
    +   * The operation to run when saving a model checkpoint.
    +   * 
    + * + * string save_tensor_name = 2; + * @return The bytes for saveTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSaveTensorNameBytes() { + java.lang.Object ref = saveTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + saveTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESTORE_OP_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object restoreOpName_ = ""; + /** + *
    +   * The operation to run when restoring a model checkpoint.
    +   * 
    + * + * string restore_op_name = 3; + * @return The restoreOpName. + */ + @java.lang.Override + public java.lang.String getRestoreOpName() { + java.lang.Object ref = restoreOpName_; + 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(); + restoreOpName_ = s; + return s; + } + } + /** + *
    +   * The operation to run when restoring a model checkpoint.
    +   * 
    + * + * string restore_op_name = 3; + * @return The bytes for restoreOpName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRestoreOpNameBytes() { + java.lang.Object ref = restoreOpName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + restoreOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_TO_KEEP_FIELD_NUMBER = 4; + private int maxToKeep_ = 0; + /** + *
    +   * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    +   * 
    + * + * int32 max_to_keep = 4; + * @return The maxToKeep. + */ + @java.lang.Override + public int getMaxToKeep() { + return maxToKeep_; + } + + public static final int SHARDED_FIELD_NUMBER = 5; + private boolean sharded_ = false; + /** + *
    +   * Shard the save files, one per device that has Variable nodes.
    +   * 
    + * + * bool sharded = 5; + * @return The sharded. + */ + @java.lang.Override + public boolean getSharded() { + return sharded_; + } + + public static final int KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER = 6; + private float keepCheckpointEveryNHours_ = 0F; + /** + *
    +   * How often to keep an additional checkpoint. If not specified, only the last
    +   * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    +   * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    +   * for every n hours of training.
    +   * 
    + * + * float keep_checkpoint_every_n_hours = 6; + * @return The keepCheckpointEveryNHours. + */ + @java.lang.Override + public float getKeepCheckpointEveryNHours() { + return keepCheckpointEveryNHours_; + } + + public static final int VERSION_FIELD_NUMBER = 7; + private int version_ = 0; + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override public int getVersionValue() { + return version_; + } + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The version. + */ + @java.lang.Override public org.tensorflow.proto.SaverDef.CheckpointFormatVersion getVersion() { + org.tensorflow.proto.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.SaverDef.CheckpointFormatVersion.forNumber(version_); + return result == null ? org.tensorflow.proto.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(filenameTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filenameTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(saveTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, saveTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restoreOpName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, restoreOpName_); + } + if (maxToKeep_ != 0) { + output.writeInt32(4, maxToKeep_); + } + if (sharded_ != false) { + output.writeBool(5, sharded_); + } + if (java.lang.Float.floatToRawIntBits(keepCheckpointEveryNHours_) != 0) { + output.writeFloat(6, keepCheckpointEveryNHours_); + } + if (version_ != org.tensorflow.proto.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) { + output.writeEnum(7, version_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filenameTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filenameTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(saveTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, saveTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restoreOpName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, restoreOpName_); + } + if (maxToKeep_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, maxToKeep_); + } + if (sharded_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, sharded_); + } + if (java.lang.Float.floatToRawIntBits(keepCheckpointEveryNHours_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(6, keepCheckpointEveryNHours_); + } + if (version_ != org.tensorflow.proto.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, version_); + } + size += getUnknownFields().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.SaverDef)) { + return super.equals(obj); + } + org.tensorflow.proto.SaverDef other = (org.tensorflow.proto.SaverDef) obj; + + if (!getFilenameTensorName() + .equals(other.getFilenameTensorName())) return false; + if (!getSaveTensorName() + .equals(other.getSaveTensorName())) return false; + if (!getRestoreOpName() + .equals(other.getRestoreOpName())) return false; + if (getMaxToKeep() + != other.getMaxToKeep()) return false; + if (getSharded() + != other.getSharded()) return false; + if (java.lang.Float.floatToIntBits(getKeepCheckpointEveryNHours()) + != java.lang.Float.floatToIntBits( + other.getKeepCheckpointEveryNHours())) return false; + if (version_ != other.version_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILENAME_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFilenameTensorName().hashCode(); + hash = (37 * hash) + SAVE_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSaveTensorName().hashCode(); + hash = (37 * hash) + RESTORE_OP_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRestoreOpName().hashCode(); + hash = (37 * hash) + MAX_TO_KEEP_FIELD_NUMBER; + hash = (53 * hash) + getMaxToKeep(); + hash = (37 * hash) + SHARDED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSharded()); + hash = (37 * hash) + KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getKeepCheckpointEveryNHours()); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SaverDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaverDef 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.SaverDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaverDef 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.SaverDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SaverDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SaverDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SaverDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SaverDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SaverDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SaverDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SaverDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SaverDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing the configuration of a Saver.
    +   * 
    + * + * Protobuf type {@code tensorflow.SaverDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SaverDef) + org.tensorflow.proto.SaverDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SaverDef.class, org.tensorflow.proto.SaverDef.Builder.class); + } + + // Construct using org.tensorflow.proto.SaverDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filenameTensorName_ = ""; + saveTensorName_ = ""; + restoreOpName_ = ""; + maxToKeep_ = 0; + sharded_ = false; + keepCheckpointEveryNHours_ = 0F; + version_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SaverProtos.internal_static_tensorflow_SaverDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SaverDef getDefaultInstanceForType() { + return org.tensorflow.proto.SaverDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SaverDef build() { + org.tensorflow.proto.SaverDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SaverDef buildPartial() { + org.tensorflow.proto.SaverDef result = new org.tensorflow.proto.SaverDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SaverDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filenameTensorName_ = filenameTensorName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.saveTensorName_ = saveTensorName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.restoreOpName_ = restoreOpName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.maxToKeep_ = maxToKeep_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sharded_ = sharded_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.keepCheckpointEveryNHours_ = keepCheckpointEveryNHours_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.version_ = version_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SaverDef) { + return mergeFrom((org.tensorflow.proto.SaverDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SaverDef other) { + if (other == org.tensorflow.proto.SaverDef.getDefaultInstance()) return this; + if (!other.getFilenameTensorName().isEmpty()) { + filenameTensorName_ = other.filenameTensorName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSaveTensorName().isEmpty()) { + saveTensorName_ = other.saveTensorName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRestoreOpName().isEmpty()) { + restoreOpName_ = other.restoreOpName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getMaxToKeep() != 0) { + setMaxToKeep(other.getMaxToKeep()); + } + if (other.getSharded() != false) { + setSharded(other.getSharded()); + } + if (other.getKeepCheckpointEveryNHours() != 0F) { + setKeepCheckpointEveryNHours(other.getKeepCheckpointEveryNHours()); + } + if (other.version_ != 0) { + setVersionValue(other.getVersionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + filenameTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + saveTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + restoreOpName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + maxToKeep_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + sharded_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 53: { + keepCheckpointEveryNHours_ = input.readFloat(); + bitField0_ |= 0x00000020; + break; + } // case 53 + case 56: { + version_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object filenameTensorName_ = ""; + /** + *
    +     * The name of the tensor in which to specify the filename when saving or
    +     * restoring a model checkpoint.
    +     * 
    + * + * string filename_tensor_name = 1; + * @return The filenameTensorName. + */ + public java.lang.String getFilenameTensorName() { + java.lang.Object ref = filenameTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filenameTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The name of the tensor in which to specify the filename when saving or
    +     * restoring a model checkpoint.
    +     * 
    + * + * string filename_tensor_name = 1; + * @return The bytes for filenameTensorName. + */ + public com.google.protobuf.ByteString + getFilenameTensorNameBytes() { + java.lang.Object ref = filenameTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filenameTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The name of the tensor in which to specify the filename when saving or
    +     * restoring a model checkpoint.
    +     * 
    + * + * string filename_tensor_name = 1; + * @param value The filenameTensorName to set. + * @return This builder for chaining. + */ + public Builder setFilenameTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + filenameTensorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The name of the tensor in which to specify the filename when saving or
    +     * restoring a model checkpoint.
    +     * 
    + * + * string filename_tensor_name = 1; + * @return This builder for chaining. + */ + public Builder clearFilenameTensorName() { + filenameTensorName_ = getDefaultInstance().getFilenameTensorName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The name of the tensor in which to specify the filename when saving or
    +     * restoring a model checkpoint.
    +     * 
    + * + * string filename_tensor_name = 1; + * @param value The bytes for filenameTensorName to set. + * @return This builder for chaining. + */ + public Builder setFilenameTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + filenameTensorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object saveTensorName_ = ""; + /** + *
    +     * The operation to run when saving a model checkpoint.
    +     * 
    + * + * string save_tensor_name = 2; + * @return The saveTensorName. + */ + public java.lang.String getSaveTensorName() { + java.lang.Object ref = saveTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + saveTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The operation to run when saving a model checkpoint.
    +     * 
    + * + * string save_tensor_name = 2; + * @return The bytes for saveTensorName. + */ + public com.google.protobuf.ByteString + getSaveTensorNameBytes() { + java.lang.Object ref = saveTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + saveTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The operation to run when saving a model checkpoint.
    +     * 
    + * + * string save_tensor_name = 2; + * @param value The saveTensorName to set. + * @return This builder for chaining. + */ + public Builder setSaveTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + saveTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The operation to run when saving a model checkpoint.
    +     * 
    + * + * string save_tensor_name = 2; + * @return This builder for chaining. + */ + public Builder clearSaveTensorName() { + saveTensorName_ = getDefaultInstance().getSaveTensorName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The operation to run when saving a model checkpoint.
    +     * 
    + * + * string save_tensor_name = 2; + * @param value The bytes for saveTensorName to set. + * @return This builder for chaining. + */ + public Builder setSaveTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + saveTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object restoreOpName_ = ""; + /** + *
    +     * The operation to run when restoring a model checkpoint.
    +     * 
    + * + * string restore_op_name = 3; + * @return The restoreOpName. + */ + public java.lang.String getRestoreOpName() { + java.lang.Object ref = restoreOpName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + restoreOpName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The operation to run when restoring a model checkpoint.
    +     * 
    + * + * string restore_op_name = 3; + * @return The bytes for restoreOpName. + */ + public com.google.protobuf.ByteString + getRestoreOpNameBytes() { + java.lang.Object ref = restoreOpName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + restoreOpName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The operation to run when restoring a model checkpoint.
    +     * 
    + * + * string restore_op_name = 3; + * @param value The restoreOpName to set. + * @return This builder for chaining. + */ + public Builder setRestoreOpName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + restoreOpName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The operation to run when restoring a model checkpoint.
    +     * 
    + * + * string restore_op_name = 3; + * @return This builder for chaining. + */ + public Builder clearRestoreOpName() { + restoreOpName_ = getDefaultInstance().getRestoreOpName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * The operation to run when restoring a model checkpoint.
    +     * 
    + * + * string restore_op_name = 3; + * @param value The bytes for restoreOpName to set. + * @return This builder for chaining. + */ + public Builder setRestoreOpNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + restoreOpName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int maxToKeep_ ; + /** + *
    +     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    +     * 
    + * + * int32 max_to_keep = 4; + * @return The maxToKeep. + */ + @java.lang.Override + public int getMaxToKeep() { + return maxToKeep_; + } + /** + *
    +     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    +     * 
    + * + * int32 max_to_keep = 4; + * @param value The maxToKeep to set. + * @return This builder for chaining. + */ + public Builder setMaxToKeep(int value) { + + maxToKeep_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
    +     * 
    + * + * int32 max_to_keep = 4; + * @return This builder for chaining. + */ + public Builder clearMaxToKeep() { + bitField0_ = (bitField0_ & ~0x00000008); + maxToKeep_ = 0; + onChanged(); + return this; + } + + private boolean sharded_ ; + /** + *
    +     * Shard the save files, one per device that has Variable nodes.
    +     * 
    + * + * bool sharded = 5; + * @return The sharded. + */ + @java.lang.Override + public boolean getSharded() { + return sharded_; + } + /** + *
    +     * Shard the save files, one per device that has Variable nodes.
    +     * 
    + * + * bool sharded = 5; + * @param value The sharded to set. + * @return This builder for chaining. + */ + public Builder setSharded(boolean value) { + + sharded_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Shard the save files, one per device that has Variable nodes.
    +     * 
    + * + * bool sharded = 5; + * @return This builder for chaining. + */ + public Builder clearSharded() { + bitField0_ = (bitField0_ & ~0x00000010); + sharded_ = false; + onChanged(); + return this; + } + + private float keepCheckpointEveryNHours_ ; + /** + *
    +     * How often to keep an additional checkpoint. If not specified, only the last
    +     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    +     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    +     * for every n hours of training.
    +     * 
    + * + * float keep_checkpoint_every_n_hours = 6; + * @return The keepCheckpointEveryNHours. + */ + @java.lang.Override + public float getKeepCheckpointEveryNHours() { + return keepCheckpointEveryNHours_; + } + /** + *
    +     * How often to keep an additional checkpoint. If not specified, only the last
    +     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    +     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    +     * for every n hours of training.
    +     * 
    + * + * float keep_checkpoint_every_n_hours = 6; + * @param value The keepCheckpointEveryNHours to set. + * @return This builder for chaining. + */ + public Builder setKeepCheckpointEveryNHours(float value) { + + keepCheckpointEveryNHours_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * How often to keep an additional checkpoint. If not specified, only the last
    +     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
    +     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
    +     * for every n hours of training.
    +     * 
    + * + * float keep_checkpoint_every_n_hours = 6; + * @return This builder for chaining. + */ + public Builder clearKeepCheckpointEveryNHours() { + bitField0_ = (bitField0_ & ~0x00000020); + keepCheckpointEveryNHours_ = 0F; + onChanged(); + return this; + } + + private int version_ = 0; + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override public int getVersionValue() { + return version_; + } + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + public Builder setVersionValue(int value) { + version_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The version. + */ + @java.lang.Override + public org.tensorflow.proto.SaverDef.CheckpointFormatVersion getVersion() { + org.tensorflow.proto.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.SaverDef.CheckpointFormatVersion.forNumber(version_); + return result == null ? org.tensorflow.proto.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result; + } + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(org.tensorflow.proto.SaverDef.CheckpointFormatVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + version_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000040); + version_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SaverDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SaverDef) + private static final org.tensorflow.proto.SaverDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SaverDef(); + } + + public static org.tensorflow.proto.SaverDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SaverDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SaverDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDefOrBuilder.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDefOrBuilder.java index 6b2d7fa9e48..22751b6cd6c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SaverDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/saver.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface SaverDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SaverDef) @@ -14,6 +16,7 @@ public interface SaverDefOrBuilder extends *
    * * string filename_tensor_name = 1; + * @return The filenameTensorName. */ java.lang.String getFilenameTensorName(); /** @@ -23,6 +26,7 @@ public interface SaverDefOrBuilder extends *
    * * string filename_tensor_name = 1; + * @return The bytes for filenameTensorName. */ com.google.protobuf.ByteString getFilenameTensorNameBytes(); @@ -33,6 +37,7 @@ public interface SaverDefOrBuilder extends * * * string save_tensor_name = 2; + * @return The saveTensorName. */ java.lang.String getSaveTensorName(); /** @@ -41,6 +46,7 @@ public interface SaverDefOrBuilder extends * * * string save_tensor_name = 2; + * @return The bytes for saveTensorName. */ com.google.protobuf.ByteString getSaveTensorNameBytes(); @@ -51,6 +57,7 @@ public interface SaverDefOrBuilder extends * * * string restore_op_name = 3; + * @return The restoreOpName. */ java.lang.String getRestoreOpName(); /** @@ -59,6 +66,7 @@ public interface SaverDefOrBuilder extends * * * string restore_op_name = 3; + * @return The bytes for restoreOpName. */ com.google.protobuf.ByteString getRestoreOpNameBytes(); @@ -69,6 +77,7 @@ public interface SaverDefOrBuilder extends * * * int32 max_to_keep = 4; + * @return The maxToKeep. */ int getMaxToKeep(); @@ -78,6 +87,7 @@ public interface SaverDefOrBuilder extends * * * bool sharded = 5; + * @return The sharded. */ boolean getSharded(); @@ -90,15 +100,18 @@ public interface SaverDefOrBuilder extends * * * float keep_checkpoint_every_n_hours = 6; + * @return The keepCheckpointEveryNHours. */ float getKeepCheckpointEveryNHours(); /** * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The enum numeric value on the wire for version. */ int getVersionValue(); /** * .tensorflow.SaverDef.CheckpointFormatVersion version = 7; + * @return The version. */ - org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion getVersion(); + org.tensorflow.proto.SaverDef.CheckpointFormatVersion getVersion(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverProtos.java new file mode 100644 index 00000000000..09a24e9951c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SaverProtos.java @@ -0,0 +1,69 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/saver.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class SaverProtos { + private SaverProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SaverProtos.class.getName()); + } + 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_SaverDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SaverDef_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/saver.proto\022\n" + + "tensorflow\"\236\002\n\010SaverDef\022\034\n\024filename_tens" + + "or_name\030\001 \001(\t\022\030\n\020save_tensor_name\030\002 \001(\t\022" + + "\027\n\017restore_op_name\030\003 \001(\t\022\023\n\013max_to_keep\030" + + "\004 \001(\005\022\017\n\007sharded\030\005 \001(\010\022%\n\035keep_checkpoin" + + "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\002B\177\n\024org.tensorflow.pr" + + "otoB\013SaverProtosP\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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_SaverDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_SaverDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SaverDef_descriptor, + new java.lang.String[] { "FilenameTensorName", "SaveTensorName", "RestoreOpName", "MaxToKeep", "Sharded", "KeepCheckpointEveryNHours", "Version", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptions.java new file mode 100644 index 00000000000..688a251a612 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptions.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.ScopedAllocatorOptions} + */ +public final class ScopedAllocatorOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ScopedAllocatorOptions) + ScopedAllocatorOptionsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ScopedAllocatorOptions.class.getName()); + } + // Use ScopedAllocatorOptions.newBuilder() to construct. + private ScopedAllocatorOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ScopedAllocatorOptions() { + enableOp_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ScopedAllocatorOptions.class, org.tensorflow.proto.ScopedAllocatorOptions.Builder.class); + } + + public static final int ENABLE_OP_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList enableOp_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @return A list containing the enableOp. + */ + public com.google.protobuf.ProtocolStringList + getEnableOpList() { + return enableOp_; + } + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @return The count of enableOp. + */ + public int getEnableOpCount() { + return enableOp_.size(); + } + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @param index The index of the element to return. + * @return The enableOp at the given index. + */ + public java.lang.String getEnableOp(int index) { + return enableOp_.get(index); + } + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @param index The index of the value to return. + * @return The bytes of the enableOp at the given index. + */ + public com.google.protobuf.ByteString + getEnableOpBytes(int index) { + return enableOp_.getByteString(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 { + for (int i = 0; i < enableOp_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, enableOp_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < enableOp_.size(); i++) { + dataSize += computeStringSizeNoTag(enableOp_.getRaw(i)); + } + size += dataSize; + size += 1 * getEnableOpList().size(); + } + size += getUnknownFields().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.ScopedAllocatorOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.ScopedAllocatorOptions other = (org.tensorflow.proto.ScopedAllocatorOptions) obj; + + if (!getEnableOpList() + .equals(other.getEnableOpList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEnableOpCount() > 0) { + hash = (37 * hash) + ENABLE_OP_FIELD_NUMBER; + hash = (53 * hash) + getEnableOpList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ScopedAllocatorOptions 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.ScopedAllocatorOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ScopedAllocatorOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ScopedAllocatorOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ScopedAllocatorOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ScopedAllocatorOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ScopedAllocatorOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ScopedAllocatorOptions) + org.tensorflow.proto.ScopedAllocatorOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ScopedAllocatorOptions.class, org.tensorflow.proto.ScopedAllocatorOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.ScopedAllocatorOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enableOp_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.RewriterConfigProtos.internal_static_tensorflow_ScopedAllocatorOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ScopedAllocatorOptions getDefaultInstanceForType() { + return org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ScopedAllocatorOptions build() { + org.tensorflow.proto.ScopedAllocatorOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ScopedAllocatorOptions buildPartial() { + org.tensorflow.proto.ScopedAllocatorOptions result = new org.tensorflow.proto.ScopedAllocatorOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ScopedAllocatorOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + enableOp_.makeImmutable(); + result.enableOp_ = enableOp_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ScopedAllocatorOptions) { + return mergeFrom((org.tensorflow.proto.ScopedAllocatorOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ScopedAllocatorOptions other) { + if (other == org.tensorflow.proto.ScopedAllocatorOptions.getDefaultInstance()) return this; + if (!other.enableOp_.isEmpty()) { + if (enableOp_.isEmpty()) { + enableOp_ = other.enableOp_; + bitField0_ |= 0x00000001; + } else { + ensureEnableOpIsMutable(); + enableOp_.addAll(other.enableOp_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureEnableOpIsMutable(); + enableOp_.add(s); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList enableOp_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureEnableOpIsMutable() { + if (!enableOp_.isModifiable()) { + enableOp_ = new com.google.protobuf.LazyStringArrayList(enableOp_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @return A list containing the enableOp. + */ + public com.google.protobuf.ProtocolStringList + getEnableOpList() { + enableOp_.makeImmutable(); + return enableOp_; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @return The count of enableOp. + */ + public int getEnableOpCount() { + return enableOp_.size(); + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param index The index of the element to return. + * @return The enableOp at the given index. + */ + public java.lang.String getEnableOp(int index) { + return enableOp_.get(index); + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param index The index of the value to return. + * @return The bytes of the enableOp at the given index. + */ + public com.google.protobuf.ByteString + getEnableOpBytes(int index) { + return enableOp_.getByteString(index); + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param index The index to set the value at. + * @param value The enableOp to set. + * @return This builder for chaining. + */ + public Builder setEnableOp( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureEnableOpIsMutable(); + enableOp_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param value The enableOp to add. + * @return This builder for chaining. + */ + public Builder addEnableOp( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureEnableOpIsMutable(); + enableOp_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param values The enableOp to add. + * @return This builder for chaining. + */ + public Builder addAllEnableOp( + java.lang.Iterable values) { + ensureEnableOpIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, enableOp_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @return This builder for chaining. + */ + public Builder clearEnableOp() { + enableOp_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
    +     * If present, only perform optimization for these ops.
    +     * 
    + * + * repeated string enable_op = 1; + * @param value The bytes of the enableOp to add. + * @return This builder for chaining. + */ + public Builder addEnableOpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureEnableOpIsMutable(); + enableOp_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ScopedAllocatorOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ScopedAllocatorOptions) + private static final org.tensorflow.proto.ScopedAllocatorOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ScopedAllocatorOptions(); + } + + public static org.tensorflow.proto.ScopedAllocatorOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScopedAllocatorOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ScopedAllocatorOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptionsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptionsOrBuilder.java new file mode 100644 index 00000000000..34a7e2c7eaf --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ScopedAllocatorOptionsOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/rewriter_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ScopedAllocatorOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ScopedAllocatorOptions) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @return A list containing the enableOp. + */ + java.util.List + getEnableOpList(); + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @return The count of enableOp. + */ + int getEnableOpCount(); + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @param index The index of the element to return. + * @return The enableOp at the given index. + */ + java.lang.String getEnableOp(int index); + /** + *
    +   * If present, only perform optimization for these ops.
    +   * 
    + * + * repeated string enable_op = 1; + * @param index The index of the value to return. + * @return The bytes of the enableOp at the given index. + */ + com.google.protobuf.ByteString + getEnableOpBytes(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExample.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExample.java new file mode 100644 index 00000000000..37deaaff1a8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExample.java @@ -0,0 +1,743 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.SequenceExample} + */ +public final class SequenceExample extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SequenceExample) + SequenceExampleOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SequenceExample.class.getName()); + } + // Use SequenceExample.newBuilder() to construct. + private SequenceExample(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SequenceExample() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_SequenceExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SequenceExample.class, org.tensorflow.proto.SequenceExample.Builder.class); + } + + private int bitField0_; + public static final int CONTEXT_FIELD_NUMBER = 1; + private org.tensorflow.proto.Features context_; + /** + * .tensorflow.Features context = 1; + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.Features context = 1; + * @return The context. + */ + @java.lang.Override + public org.tensorflow.proto.Features getContext() { + return context_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : context_; + } + /** + * .tensorflow.Features context = 1; + */ + @java.lang.Override + public org.tensorflow.proto.FeaturesOrBuilder getContextOrBuilder() { + return context_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : context_; + } + + public static final int FEATURE_LISTS_FIELD_NUMBER = 2; + private org.tensorflow.proto.FeatureLists featureLists_; + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return Whether the featureLists field is set. + */ + @java.lang.Override + public boolean hasFeatureLists() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return The featureLists. + */ + @java.lang.Override + public org.tensorflow.proto.FeatureLists getFeatureLists() { + return featureLists_ == null ? org.tensorflow.proto.FeatureLists.getDefaultInstance() : featureLists_; + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + @java.lang.Override + public org.tensorflow.proto.FeatureListsOrBuilder getFeatureListsOrBuilder() { + return featureLists_ == null ? org.tensorflow.proto.FeatureLists.getDefaultInstance() : featureLists_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getContext()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getFeatureLists()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContext()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFeatureLists()); + } + size += getUnknownFields().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.SequenceExample)) { + return super.equals(obj); + } + org.tensorflow.proto.SequenceExample other = (org.tensorflow.proto.SequenceExample) obj; + + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext() + .equals(other.getContext())) return false; + } + if (hasFeatureLists() != other.hasFeatureLists()) return false; + if (hasFeatureLists()) { + if (!getFeatureLists() + .equals(other.getFeatureLists())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (hasFeatureLists()) { + hash = (37 * hash) + FEATURE_LISTS_FIELD_NUMBER; + hash = (53 * hash) + getFeatureLists().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SequenceExample parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SequenceExample 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.SequenceExample parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SequenceExample 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.SequenceExample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SequenceExample parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SequenceExample parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SequenceExample parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SequenceExample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SequenceExample parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SequenceExample parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SequenceExample parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SequenceExample 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SequenceExample} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SequenceExample) + org.tensorflow.proto.SequenceExampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_SequenceExample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SequenceExample.class, org.tensorflow.proto.SequenceExample.Builder.class); + } + + // Construct using org.tensorflow.proto.SequenceExample.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getContextFieldBuilder(); + getFeatureListsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + featureLists_ = null; + if (featureListsBuilder_ != null) { + featureListsBuilder_.dispose(); + featureListsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ExampleProtos.internal_static_tensorflow_SequenceExample_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SequenceExample getDefaultInstanceForType() { + return org.tensorflow.proto.SequenceExample.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SequenceExample build() { + org.tensorflow.proto.SequenceExample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SequenceExample buildPartial() { + org.tensorflow.proto.SequenceExample result = new org.tensorflow.proto.SequenceExample(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SequenceExample result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.context_ = contextBuilder_ == null + ? context_ + : contextBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.featureLists_ = featureListsBuilder_ == null + ? featureLists_ + : featureListsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SequenceExample) { + return mergeFrom((org.tensorflow.proto.SequenceExample)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SequenceExample other) { + if (other == org.tensorflow.proto.SequenceExample.getDefaultInstance()) return this; + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (other.hasFeatureLists()) { + mergeFeatureLists(other.getFeatureLists()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getContextFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getFeatureListsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.Features context_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder> contextBuilder_; + /** + * .tensorflow.Features context = 1; + * @return Whether the context field is set. + */ + public boolean hasContext() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.Features context = 1; + * @return The context. + */ + public org.tensorflow.proto.Features getContext() { + if (contextBuilder_ == null) { + return context_ == null ? org.tensorflow.proto.Features.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * .tensorflow.Features context = 1; + */ + public Builder setContext(org.tensorflow.proto.Features value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + } else { + contextBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.Features context = 1; + */ + public Builder setContext( + org.tensorflow.proto.Features.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.Features context = 1; + */ + public Builder mergeContext(org.tensorflow.proto.Features value) { + if (contextBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + context_ != null && + context_ != org.tensorflow.proto.Features.getDefaultInstance()) { + getContextBuilder().mergeFrom(value); + } else { + context_ = value; + } + } else { + contextBuilder_.mergeFrom(value); + } + if (context_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.Features context = 1; + */ + public Builder clearContext() { + bitField0_ = (bitField0_ & ~0x00000001); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); + contextBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.Features context = 1; + */ + public org.tensorflow.proto.Features.Builder getContextBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * .tensorflow.Features context = 1; + */ + public org.tensorflow.proto.FeaturesOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? + org.tensorflow.proto.Features.getDefaultInstance() : context_; + } + } + /** + * .tensorflow.Features context = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Features, org.tensorflow.proto.Features.Builder, org.tensorflow.proto.FeaturesOrBuilder>( + getContext(), + getParentForChildren(), + isClean()); + context_ = null; + } + return contextBuilder_; + } + + private org.tensorflow.proto.FeatureLists featureLists_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FeatureLists, org.tensorflow.proto.FeatureLists.Builder, org.tensorflow.proto.FeatureListsOrBuilder> featureListsBuilder_; + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return Whether the featureLists field is set. + */ + public boolean hasFeatureLists() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return The featureLists. + */ + public org.tensorflow.proto.FeatureLists getFeatureLists() { + if (featureListsBuilder_ == null) { + return featureLists_ == null ? org.tensorflow.proto.FeatureLists.getDefaultInstance() : featureLists_; + } else { + return featureListsBuilder_.getMessage(); + } + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public Builder setFeatureLists(org.tensorflow.proto.FeatureLists value) { + if (featureListsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + featureLists_ = value; + } else { + featureListsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public Builder setFeatureLists( + org.tensorflow.proto.FeatureLists.Builder builderForValue) { + if (featureListsBuilder_ == null) { + featureLists_ = builderForValue.build(); + } else { + featureListsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public Builder mergeFeatureLists(org.tensorflow.proto.FeatureLists value) { + if (featureListsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + featureLists_ != null && + featureLists_ != org.tensorflow.proto.FeatureLists.getDefaultInstance()) { + getFeatureListsBuilder().mergeFrom(value); + } else { + featureLists_ = value; + } + } else { + featureListsBuilder_.mergeFrom(value); + } + if (featureLists_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public Builder clearFeatureLists() { + bitField0_ = (bitField0_ & ~0x00000002); + featureLists_ = null; + if (featureListsBuilder_ != null) { + featureListsBuilder_.dispose(); + featureListsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public org.tensorflow.proto.FeatureLists.Builder getFeatureListsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFeatureListsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + public org.tensorflow.proto.FeatureListsOrBuilder getFeatureListsOrBuilder() { + if (featureListsBuilder_ != null) { + return featureListsBuilder_.getMessageOrBuilder(); + } else { + return featureLists_ == null ? + org.tensorflow.proto.FeatureLists.getDefaultInstance() : featureLists_; + } + } + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FeatureLists, org.tensorflow.proto.FeatureLists.Builder, org.tensorflow.proto.FeatureListsOrBuilder> + getFeatureListsFieldBuilder() { + if (featureListsBuilder_ == null) { + featureListsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.FeatureLists, org.tensorflow.proto.FeatureLists.Builder, org.tensorflow.proto.FeatureListsOrBuilder>( + getFeatureLists(), + getParentForChildren(), + isClean()); + featureLists_ = null; + } + return featureListsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SequenceExample) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SequenceExample) + private static final org.tensorflow.proto.SequenceExample DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SequenceExample(); + } + + public static org.tensorflow.proto.SequenceExample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequenceExample parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SequenceExample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExampleOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExampleOrBuilder.java new file mode 100644 index 00000000000..e38f99c7f8f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SequenceExampleOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/example/example.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SequenceExampleOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SequenceExample) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.Features context = 1; + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * .tensorflow.Features context = 1; + * @return The context. + */ + org.tensorflow.proto.Features getContext(); + /** + * .tensorflow.Features context = 1; + */ + org.tensorflow.proto.FeaturesOrBuilder getContextOrBuilder(); + + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return Whether the featureLists field is set. + */ + boolean hasFeatureLists(); + /** + * .tensorflow.FeatureLists feature_lists = 2; + * @return The featureLists. + */ + org.tensorflow.proto.FeatureLists getFeatureLists(); + /** + * .tensorflow.FeatureLists feature_lists = 2; + */ + org.tensorflow.proto.FeatureListsOrBuilder getFeatureListsOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDType.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDType.java new file mode 100644 index 00000000000..a1c9bf8580b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDType.java @@ -0,0 +1,467 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/types.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Represents a serialized tf.dtypes.Dtype
    + * 
    + * + * Protobuf type {@code tensorflow.SerializedDType} + */ +public final class SerializedDType extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SerializedDType) + SerializedDTypeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SerializedDType.class.getName()); + } + // Use SerializedDType.newBuilder() to construct. + private SerializedDType(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SerializedDType() { + datatype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TypesProtos.internal_static_tensorflow_SerializedDType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TypesProtos.internal_static_tensorflow_SerializedDType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SerializedDType.class, org.tensorflow.proto.SerializedDType.Builder.class); + } + + public static final int DATATYPE_FIELD_NUMBER = 1; + private int datatype_ = 0; + /** + * .tensorflow.DataType datatype = 1; + * @return The enum numeric value on the wire for datatype. + */ + @java.lang.Override public int getDatatypeValue() { + return datatype_; + } + /** + * .tensorflow.DataType datatype = 1; + * @return The datatype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDatatype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(datatype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + 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 (datatype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, datatype_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (datatype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, datatype_); + } + size += getUnknownFields().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.SerializedDType)) { + return super.equals(obj); + } + org.tensorflow.proto.SerializedDType other = (org.tensorflow.proto.SerializedDType) obj; + + if (datatype_ != other.datatype_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATATYPE_FIELD_NUMBER; + hash = (53 * hash) + datatype_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SerializedDType parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SerializedDType 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.SerializedDType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SerializedDType 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.SerializedDType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SerializedDType parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SerializedDType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SerializedDType parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SerializedDType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SerializedDType parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SerializedDType parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SerializedDType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SerializedDType 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Represents a serialized tf.dtypes.Dtype
    +   * 
    + * + * Protobuf type {@code tensorflow.SerializedDType} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SerializedDType) + org.tensorflow.proto.SerializedDTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TypesProtos.internal_static_tensorflow_SerializedDType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TypesProtos.internal_static_tensorflow_SerializedDType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SerializedDType.class, org.tensorflow.proto.SerializedDType.Builder.class); + } + + // Construct using org.tensorflow.proto.SerializedDType.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datatype_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TypesProtos.internal_static_tensorflow_SerializedDType_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SerializedDType getDefaultInstanceForType() { + return org.tensorflow.proto.SerializedDType.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SerializedDType build() { + org.tensorflow.proto.SerializedDType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SerializedDType buildPartial() { + org.tensorflow.proto.SerializedDType result = new org.tensorflow.proto.SerializedDType(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SerializedDType result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datatype_ = datatype_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SerializedDType) { + return mergeFrom((org.tensorflow.proto.SerializedDType)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SerializedDType other) { + if (other == org.tensorflow.proto.SerializedDType.getDefaultInstance()) return this; + if (other.datatype_ != 0) { + setDatatypeValue(other.getDatatypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + datatype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int datatype_ = 0; + /** + * .tensorflow.DataType datatype = 1; + * @return The enum numeric value on the wire for datatype. + */ + @java.lang.Override public int getDatatypeValue() { + return datatype_; + } + /** + * .tensorflow.DataType datatype = 1; + * @param value The enum numeric value on the wire for datatype to set. + * @return This builder for chaining. + */ + public Builder setDatatypeValue(int value) { + datatype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.DataType datatype = 1; + * @return The datatype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDatatype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(datatype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType datatype = 1; + * @param value The datatype to set. + * @return This builder for chaining. + */ + public Builder setDatatype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + datatype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType datatype = 1; + * @return This builder for chaining. + */ + public Builder clearDatatype() { + bitField0_ = (bitField0_ & ~0x00000001); + datatype_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SerializedDType) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SerializedDType) + private static final org.tensorflow.proto.SerializedDType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SerializedDType(); + } + + public static org.tensorflow.proto.SerializedDType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SerializedDType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SerializedDType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDTypeOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDTypeOrBuilder.java new file mode 100644 index 00000000000..ffadd4ef5f2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SerializedDTypeOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/types.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SerializedDTypeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SerializedDType) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.DataType datatype = 1; + * @return The enum numeric value on the wire for datatype. + */ + int getDatatypeValue(); + /** + * .tensorflow.DataType datatype = 1; + * @return The datatype. + */ + org.tensorflow.proto.DataType getDatatype(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDef.java new file mode 100644 index 00000000000..961f896b0c1 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDef.java @@ -0,0 +1,1713 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensorflow_server.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines the configuration of a single TensorFlow server.
    + * 
    + * + * Protobuf type {@code tensorflow.ServerDef} + */ +public final class ServerDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ServerDef) + ServerDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ServerDef.class.getName()); + } + // Use ServerDef.newBuilder() to construct. + private ServerDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ServerDef() { + jobName_ = ""; + protocol_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ServerProtos.internal_static_tensorflow_ServerDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ServerDef.class, org.tensorflow.proto.ServerDef.Builder.class); + } + + private int bitField0_; + public static final int CLUSTER_FIELD_NUMBER = 1; + private org.tensorflow.proto.ClusterDef cluster_; + /** + *
    +   * The cluster of which this server is a member.
    +   * 
    + * + * .tensorflow.ClusterDef cluster = 1; + * @return Whether the cluster field is set. + */ + @java.lang.Override + public boolean hasCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The cluster of which this server is a member.
    +   * 
    + * + * .tensorflow.ClusterDef cluster = 1; + * @return The cluster. + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDef getCluster() { + return cluster_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : cluster_; + } + /** + *
    +   * The cluster of which this server is a member.
    +   * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDefOrBuilder getClusterOrBuilder() { + return cluster_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : cluster_; + } + + public static final int JOB_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object jobName_ = ""; + /** + *
    +   * The name of the job of which this server is a member.
    +   *
    +   * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +   * that matches this name.
    +   * 
    + * + * string job_name = 2; + * @return The jobName. + */ + @java.lang.Override + public java.lang.String getJobName() { + java.lang.Object ref = jobName_; + 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(); + jobName_ = s; + return s; + } + } + /** + *
    +   * The name of the job of which this server is a member.
    +   *
    +   * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +   * that matches this name.
    +   * 
    + * + * string job_name = 2; + * @return The bytes for jobName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getJobNameBytes() { + java.lang.Object ref = jobName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + jobName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLICA_FIELD_NUMBER = 8; + private int replica_ = 0; + /** + *
    +   * Replica this server manages.
    +   * 
    + * + * int32 replica = 8; + * @return The replica. + */ + @java.lang.Override + public int getReplica() { + return replica_; + } + + public static final int TASK_INDEX_FIELD_NUMBER = 3; + private int taskIndex_ = 0; + /** + *
    +   * The task index of this server in its job.
    +   *
    +   * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    +   * and a mapping in its `tasks` field for this index.
    +   * 
    + * + * int32 task_index = 3; + * @return The taskIndex. + */ + @java.lang.Override + public int getTaskIndex() { + return taskIndex_; + } + + public static final int DEFAULT_SESSION_CONFIG_FIELD_NUMBER = 4; + private org.tensorflow.proto.ConfigProto defaultSessionConfig_; + /** + *
    +   * The default configuration for sessions that run on this server.
    +   * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + * @return Whether the defaultSessionConfig field is set. + */ + @java.lang.Override + public boolean hasDefaultSessionConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The default configuration for sessions that run on this server.
    +   * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + * @return The defaultSessionConfig. + */ + @java.lang.Override + public org.tensorflow.proto.ConfigProto getDefaultSessionConfig() { + return defaultSessionConfig_ == null ? org.tensorflow.proto.ConfigProto.getDefaultInstance() : defaultSessionConfig_; + } + /** + *
    +   * The default configuration for sessions that run on this server.
    +   * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + @java.lang.Override + public org.tensorflow.proto.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder() { + return defaultSessionConfig_ == null ? org.tensorflow.proto.ConfigProto.getDefaultInstance() : defaultSessionConfig_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** + *
    +   * The protocol to be used by this server.
    +   *
    +   * Acceptable values include: "grpc", "grpc+verbs".
    +   * 
    + * + * string protocol = 5; + * @return The protocol. + */ + @java.lang.Override + 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 to be used by this server.
    +   *
    +   * Acceptable values include: "grpc", "grpc+verbs".
    +   * 
    + * + * string protocol = 5; + * @return The bytes for protocol. + */ + @java.lang.Override + 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 PORT_FIELD_NUMBER = 6; + private int port_ = 0; + /** + *
    +   * The server port. If not set, then we identify the port from the job_name.
    +   * 
    + * + * int32 port = 6; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + public static final int CLUSTER_DEVICE_FILTERS_FIELD_NUMBER = 7; + private org.tensorflow.proto.ClusterDeviceFilters clusterDeviceFilters_; + /** + *
    +   * Device filters for remote tasks in the cluster.
    +   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +   * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return Whether the clusterDeviceFilters field is set. + */ + @java.lang.Override + public boolean hasClusterDeviceFilters() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * Device filters for remote tasks in the cluster.
    +   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +   * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return The clusterDeviceFilters. + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDeviceFilters getClusterDeviceFilters() { + return clusterDeviceFilters_ == null ? org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; + } + /** + *
    +   * Device filters for remote tasks in the cluster.
    +   * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +   * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + @java.lang.Override + public org.tensorflow.proto.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder() { + return clusterDeviceFilters_ == null ? org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCluster()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(jobName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, jobName_); + } + if (taskIndex_ != 0) { + output.writeInt32(3, taskIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getDefaultSessionConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, protocol_); + } + if (port_ != 0) { + output.writeInt32(6, port_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getClusterDeviceFilters()); + } + if (replica_ != 0) { + output.writeInt32(8, replica_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCluster()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(jobName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, jobName_); + } + if (taskIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, taskIndex_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getDefaultSessionConfig()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, protocol_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, port_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getClusterDeviceFilters()); + } + if (replica_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, replica_); + } + size += getUnknownFields().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.ServerDef)) { + return super.equals(obj); + } + org.tensorflow.proto.ServerDef other = (org.tensorflow.proto.ServerDef) obj; + + if (hasCluster() != other.hasCluster()) return false; + if (hasCluster()) { + if (!getCluster() + .equals(other.getCluster())) return false; + } + if (!getJobName() + .equals(other.getJobName())) return false; + if (getReplica() + != other.getReplica()) return false; + if (getTaskIndex() + != other.getTaskIndex()) return false; + if (hasDefaultSessionConfig() != other.hasDefaultSessionConfig()) return false; + if (hasDefaultSessionConfig()) { + if (!getDefaultSessionConfig() + .equals(other.getDefaultSessionConfig())) return false; + } + if (!getProtocol() + .equals(other.getProtocol())) return false; + if (getPort() + != other.getPort()) return false; + if (hasClusterDeviceFilters() != other.hasClusterDeviceFilters()) return false; + if (hasClusterDeviceFilters()) { + if (!getClusterDeviceFilters() + .equals(other.getClusterDeviceFilters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCluster()) { + hash = (37 * hash) + CLUSTER_FIELD_NUMBER; + hash = (53 * hash) + getCluster().hashCode(); + } + hash = (37 * hash) + JOB_NAME_FIELD_NUMBER; + hash = (53 * hash) + getJobName().hashCode(); + hash = (37 * hash) + REPLICA_FIELD_NUMBER; + hash = (53 * hash) + getReplica(); + hash = (37 * hash) + TASK_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getTaskIndex(); + if (hasDefaultSessionConfig()) { + hash = (37 * hash) + DEFAULT_SESSION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDefaultSessionConfig().hashCode(); + } + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + if (hasClusterDeviceFilters()) { + hash = (37 * hash) + CLUSTER_DEVICE_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getClusterDeviceFilters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ServerDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ServerDef 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.ServerDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ServerDef 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.ServerDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ServerDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ServerDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ServerDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ServerDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ServerDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ServerDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ServerDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ServerDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines the configuration of a single TensorFlow server.
    +   * 
    + * + * Protobuf type {@code tensorflow.ServerDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ServerDef) + org.tensorflow.proto.ServerDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ServerProtos.internal_static_tensorflow_ServerDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ServerDef.class, org.tensorflow.proto.ServerDef.Builder.class); + } + + // Construct using org.tensorflow.proto.ServerDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getClusterFieldBuilder(); + getDefaultSessionConfigFieldBuilder(); + getClusterDeviceFiltersFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + jobName_ = ""; + replica_ = 0; + taskIndex_ = 0; + defaultSessionConfig_ = null; + if (defaultSessionConfigBuilder_ != null) { + defaultSessionConfigBuilder_.dispose(); + defaultSessionConfigBuilder_ = null; + } + protocol_ = ""; + port_ = 0; + clusterDeviceFilters_ = null; + if (clusterDeviceFiltersBuilder_ != null) { + clusterDeviceFiltersBuilder_.dispose(); + clusterDeviceFiltersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ServerProtos.internal_static_tensorflow_ServerDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ServerDef getDefaultInstanceForType() { + return org.tensorflow.proto.ServerDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ServerDef build() { + org.tensorflow.proto.ServerDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ServerDef buildPartial() { + org.tensorflow.proto.ServerDef result = new org.tensorflow.proto.ServerDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ServerDef result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cluster_ = clusterBuilder_ == null + ? cluster_ + : clusterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.jobName_ = jobName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.replica_ = replica_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.taskIndex_ = taskIndex_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.defaultSessionConfig_ = defaultSessionConfigBuilder_ == null + ? defaultSessionConfig_ + : defaultSessionConfigBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.clusterDeviceFilters_ = clusterDeviceFiltersBuilder_ == null + ? clusterDeviceFilters_ + : clusterDeviceFiltersBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ServerDef) { + return mergeFrom((org.tensorflow.proto.ServerDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ServerDef other) { + if (other == org.tensorflow.proto.ServerDef.getDefaultInstance()) return this; + if (other.hasCluster()) { + mergeCluster(other.getCluster()); + } + if (!other.getJobName().isEmpty()) { + jobName_ = other.jobName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getReplica() != 0) { + setReplica(other.getReplica()); + } + if (other.getTaskIndex() != 0) { + setTaskIndex(other.getTaskIndex()); + } + if (other.hasDefaultSessionConfig()) { + mergeDefaultSessionConfig(other.getDefaultSessionConfig()); + } + if (!other.getProtocol().isEmpty()) { + protocol_ = other.protocol_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (other.hasClusterDeviceFilters()) { + mergeClusterDeviceFilters(other.getClusterDeviceFilters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getClusterFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + jobName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + taskIndex_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: { + input.readMessage( + getDefaultSessionConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: { + protocol_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 48: { + port_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: { + input.readMessage( + getClusterDeviceFiltersFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 64: { + replica_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 64 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.ClusterDef cluster_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder> clusterBuilder_; + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + * @return The cluster. + */ + public org.tensorflow.proto.ClusterDef getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null ? org.tensorflow.proto.ClusterDef.getDefaultInstance() : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public Builder setCluster(org.tensorflow.proto.ClusterDef value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public Builder setCluster( + org.tensorflow.proto.ClusterDef.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public Builder mergeCluster(org.tensorflow.proto.ClusterDef value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + cluster_ != null && + cluster_ != org.tensorflow.proto.ClusterDef.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + if (cluster_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public Builder clearCluster() { + bitField0_ = (bitField0_ & ~0x00000001); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); + clusterBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public org.tensorflow.proto.ClusterDef.Builder getClusterBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + public org.tensorflow.proto.ClusterDefOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null ? + org.tensorflow.proto.ClusterDef.getDefaultInstance() : cluster_; + } + } + /** + *
    +     * The cluster of which this server is a member.
    +     * 
    + * + * .tensorflow.ClusterDef cluster = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDef, org.tensorflow.proto.ClusterDef.Builder, org.tensorflow.proto.ClusterDefOrBuilder>( + getCluster(), + getParentForChildren(), + isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object jobName_ = ""; + /** + *
    +     * The name of the job of which this server is a member.
    +     *
    +     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +     * that matches this name.
    +     * 
    + * + * string job_name = 2; + * @return The jobName. + */ + public java.lang.String getJobName() { + java.lang.Object ref = jobName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jobName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The name of the job of which this server is a member.
    +     *
    +     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +     * that matches this name.
    +     * 
    + * + * string job_name = 2; + * @return The bytes for jobName. + */ + public com.google.protobuf.ByteString + getJobNameBytes() { + java.lang.Object ref = jobName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + jobName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The name of the job of which this server is a member.
    +     *
    +     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +     * that matches this name.
    +     * 
    + * + * string job_name = 2; + * @param value The jobName to set. + * @return This builder for chaining. + */ + public Builder setJobName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + jobName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The name of the job of which this server is a member.
    +     *
    +     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +     * that matches this name.
    +     * 
    + * + * string job_name = 2; + * @return This builder for chaining. + */ + public Builder clearJobName() { + jobName_ = getDefaultInstance().getJobName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The name of the job of which this server is a member.
    +     *
    +     * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
    +     * that matches this name.
    +     * 
    + * + * string job_name = 2; + * @param value The bytes for jobName to set. + * @return This builder for chaining. + */ + public Builder setJobNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + jobName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int replica_ ; + /** + *
    +     * Replica this server manages.
    +     * 
    + * + * int32 replica = 8; + * @return The replica. + */ + @java.lang.Override + public int getReplica() { + return replica_; + } + /** + *
    +     * Replica this server manages.
    +     * 
    + * + * int32 replica = 8; + * @param value The replica to set. + * @return This builder for chaining. + */ + public Builder setReplica(int value) { + + replica_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Replica this server manages.
    +     * 
    + * + * int32 replica = 8; + * @return This builder for chaining. + */ + public Builder clearReplica() { + bitField0_ = (bitField0_ & ~0x00000004); + replica_ = 0; + onChanged(); + return this; + } + + private int taskIndex_ ; + /** + *
    +     * The task index of this server in its job.
    +     *
    +     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    +     * and a mapping in its `tasks` field for this index.
    +     * 
    + * + * int32 task_index = 3; + * @return The taskIndex. + */ + @java.lang.Override + public int getTaskIndex() { + return taskIndex_; + } + /** + *
    +     * The task index of this server in its job.
    +     *
    +     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    +     * and a mapping in its `tasks` field for this index.
    +     * 
    + * + * int32 task_index = 3; + * @param value The taskIndex to set. + * @return This builder for chaining. + */ + public Builder setTaskIndex(int value) { + + taskIndex_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The task index of this server in its job.
    +     *
    +     * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
    +     * and a mapping in its `tasks` field for this index.
    +     * 
    + * + * int32 task_index = 3; + * @return This builder for chaining. + */ + public Builder clearTaskIndex() { + bitField0_ = (bitField0_ & ~0x00000008); + taskIndex_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.ConfigProto defaultSessionConfig_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto, org.tensorflow.proto.ConfigProto.Builder, org.tensorflow.proto.ConfigProtoOrBuilder> defaultSessionConfigBuilder_; + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + * @return Whether the defaultSessionConfig field is set. + */ + public boolean hasDefaultSessionConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + * @return The defaultSessionConfig. + */ + public org.tensorflow.proto.ConfigProto getDefaultSessionConfig() { + if (defaultSessionConfigBuilder_ == null) { + return defaultSessionConfig_ == null ? org.tensorflow.proto.ConfigProto.getDefaultInstance() : defaultSessionConfig_; + } else { + return defaultSessionConfigBuilder_.getMessage(); + } + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public Builder setDefaultSessionConfig(org.tensorflow.proto.ConfigProto value) { + if (defaultSessionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultSessionConfig_ = value; + } else { + defaultSessionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public Builder setDefaultSessionConfig( + org.tensorflow.proto.ConfigProto.Builder builderForValue) { + if (defaultSessionConfigBuilder_ == null) { + defaultSessionConfig_ = builderForValue.build(); + } else { + defaultSessionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public Builder mergeDefaultSessionConfig(org.tensorflow.proto.ConfigProto value) { + if (defaultSessionConfigBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + defaultSessionConfig_ != null && + defaultSessionConfig_ != org.tensorflow.proto.ConfigProto.getDefaultInstance()) { + getDefaultSessionConfigBuilder().mergeFrom(value); + } else { + defaultSessionConfig_ = value; + } + } else { + defaultSessionConfigBuilder_.mergeFrom(value); + } + if (defaultSessionConfig_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public Builder clearDefaultSessionConfig() { + bitField0_ = (bitField0_ & ~0x00000010); + defaultSessionConfig_ = null; + if (defaultSessionConfigBuilder_ != null) { + defaultSessionConfigBuilder_.dispose(); + defaultSessionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public org.tensorflow.proto.ConfigProto.Builder getDefaultSessionConfigBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDefaultSessionConfigFieldBuilder().getBuilder(); + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + public org.tensorflow.proto.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder() { + if (defaultSessionConfigBuilder_ != null) { + return defaultSessionConfigBuilder_.getMessageOrBuilder(); + } else { + return defaultSessionConfig_ == null ? + org.tensorflow.proto.ConfigProto.getDefaultInstance() : defaultSessionConfig_; + } + } + /** + *
    +     * The default configuration for sessions that run on this server.
    +     * 
    + * + * .tensorflow.ConfigProto default_session_config = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto, org.tensorflow.proto.ConfigProto.Builder, org.tensorflow.proto.ConfigProtoOrBuilder> + getDefaultSessionConfigFieldBuilder() { + if (defaultSessionConfigBuilder_ == null) { + defaultSessionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ConfigProto, org.tensorflow.proto.ConfigProto.Builder, org.tensorflow.proto.ConfigProtoOrBuilder>( + getDefaultSessionConfig(), + getParentForChildren(), + isClean()); + defaultSessionConfig_ = null; + } + return defaultSessionConfigBuilder_; + } + + private java.lang.Object protocol_ = ""; + /** + *
    +     * The protocol to be used by this server.
    +     *
    +     * Acceptable values include: "grpc", "grpc+verbs".
    +     * 
    + * + * string protocol = 5; + * @return The protocol. + */ + 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 to be used by this server.
    +     *
    +     * Acceptable values include: "grpc", "grpc+verbs".
    +     * 
    + * + * string protocol = 5; + * @return The bytes for protocol. + */ + 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 to be used by this server.
    +     *
    +     * Acceptable values include: "grpc", "grpc+verbs".
    +     * 
    + * + * string protocol = 5; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + protocol_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * The protocol to be used by this server.
    +     *
    +     * Acceptable values include: "grpc", "grpc+verbs".
    +     * 
    + * + * string protocol = 5; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * The protocol to be used by this server.
    +     *
    +     * Acceptable values include: "grpc", "grpc+verbs".
    +     * 
    + * + * string protocol = 5; + * @param value The bytes for protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + protocol_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int port_ ; + /** + *
    +     * The server port. If not set, then we identify the port from the job_name.
    +     * 
    + * + * int32 port = 6; + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + *
    +     * The server port. If not set, then we identify the port from the job_name.
    +     * 
    + * + * int32 port = 6; + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * The server port. If not set, then we identify the port from the job_name.
    +     * 
    + * + * int32 port = 6; + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000040); + port_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.ClusterDeviceFilters clusterDeviceFilters_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDeviceFilters, org.tensorflow.proto.ClusterDeviceFilters.Builder, org.tensorflow.proto.ClusterDeviceFiltersOrBuilder> clusterDeviceFiltersBuilder_; + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return Whether the clusterDeviceFilters field is set. + */ + public boolean hasClusterDeviceFilters() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return The clusterDeviceFilters. + */ + public org.tensorflow.proto.ClusterDeviceFilters getClusterDeviceFilters() { + if (clusterDeviceFiltersBuilder_ == null) { + return clusterDeviceFilters_ == null ? org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; + } else { + return clusterDeviceFiltersBuilder_.getMessage(); + } + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public Builder setClusterDeviceFilters(org.tensorflow.proto.ClusterDeviceFilters value) { + if (clusterDeviceFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + clusterDeviceFilters_ = value; + } else { + clusterDeviceFiltersBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public Builder setClusterDeviceFilters( + org.tensorflow.proto.ClusterDeviceFilters.Builder builderForValue) { + if (clusterDeviceFiltersBuilder_ == null) { + clusterDeviceFilters_ = builderForValue.build(); + } else { + clusterDeviceFiltersBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public Builder mergeClusterDeviceFilters(org.tensorflow.proto.ClusterDeviceFilters value) { + if (clusterDeviceFiltersBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + clusterDeviceFilters_ != null && + clusterDeviceFilters_ != org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance()) { + getClusterDeviceFiltersBuilder().mergeFrom(value); + } else { + clusterDeviceFilters_ = value; + } + } else { + clusterDeviceFiltersBuilder_.mergeFrom(value); + } + if (clusterDeviceFilters_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public Builder clearClusterDeviceFilters() { + bitField0_ = (bitField0_ & ~0x00000080); + clusterDeviceFilters_ = null; + if (clusterDeviceFiltersBuilder_ != null) { + clusterDeviceFiltersBuilder_.dispose(); + clusterDeviceFiltersBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public org.tensorflow.proto.ClusterDeviceFilters.Builder getClusterDeviceFiltersBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getClusterDeviceFiltersFieldBuilder().getBuilder(); + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + public org.tensorflow.proto.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder() { + if (clusterDeviceFiltersBuilder_ != null) { + return clusterDeviceFiltersBuilder_.getMessageOrBuilder(); + } else { + return clusterDeviceFilters_ == null ? + org.tensorflow.proto.ClusterDeviceFilters.getDefaultInstance() : clusterDeviceFilters_; + } + } + /** + *
    +     * Device filters for remote tasks in the cluster.
    +     * NOTE: This is an experimental feature and only effective in TensorFlow 2.x.
    +     * 
    + * + * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDeviceFilters, org.tensorflow.proto.ClusterDeviceFilters.Builder, org.tensorflow.proto.ClusterDeviceFiltersOrBuilder> + getClusterDeviceFiltersFieldBuilder() { + if (clusterDeviceFiltersBuilder_ == null) { + clusterDeviceFiltersBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ClusterDeviceFilters, org.tensorflow.proto.ClusterDeviceFilters.Builder, org.tensorflow.proto.ClusterDeviceFiltersOrBuilder>( + getClusterDeviceFilters(), + getParentForChildren(), + isClean()); + clusterDeviceFilters_ = null; + } + return clusterDeviceFiltersBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ServerDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ServerDef) + private static final org.tensorflow.proto.ServerDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ServerDef(); + } + + public static org.tensorflow.proto.ServerDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServerDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ServerDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDefOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDefOrBuilder.java index 6c1a12b002d..b6f191e3c59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/distruntime/ServerDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/tensorflow_server.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.distruntime; +package org.tensorflow.proto; public interface ServerDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.ServerDef) @@ -13,6 +15,7 @@ public interface ServerDefOrBuilder extends * * * .tensorflow.ClusterDef cluster = 1; + * @return Whether the cluster field is set. */ boolean hasCluster(); /** @@ -21,8 +24,9 @@ public interface ServerDefOrBuilder extends * * * .tensorflow.ClusterDef cluster = 1; + * @return The cluster. */ - org.tensorflow.proto.distruntime.ClusterDef getCluster(); + org.tensorflow.proto.ClusterDef getCluster(); /** *
        * The cluster of which this server is a member.
    @@ -30,38 +34,54 @@ public interface ServerDefOrBuilder extends
        *
        * .tensorflow.ClusterDef cluster = 1;
        */
    -  org.tensorflow.proto.distruntime.ClusterDefOrBuilder getClusterOrBuilder();
    +  org.tensorflow.proto.ClusterDefOrBuilder getClusterOrBuilder();
     
       /**
        * 
        * The name of the job of which this server is a member.
    +   *
        * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
        * that matches this name.
        * 
    * * string job_name = 2; + * @return The jobName. */ java.lang.String getJobName(); /** *
        * The name of the job of which this server is a member.
    +   *
        * NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
        * that matches this name.
        * 
    * * string job_name = 2; + * @return The bytes for jobName. */ com.google.protobuf.ByteString getJobNameBytes(); + /** + *
    +   * Replica this server manages.
    +   * 
    + * + * int32 replica = 8; + * @return The replica. + */ + int getReplica(); + /** *
        * The task index of this server in its job.
    +   *
        * NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
        * and a mapping in its `tasks` field for this index.
        * 
    * * int32 task_index = 3; + * @return The taskIndex. */ int getTaskIndex(); @@ -71,6 +91,7 @@ public interface ServerDefOrBuilder extends *
    * * .tensorflow.ConfigProto default_session_config = 4; + * @return Whether the defaultSessionConfig field is set. */ boolean hasDefaultSessionConfig(); /** @@ -79,8 +100,9 @@ public interface ServerDefOrBuilder extends * * * .tensorflow.ConfigProto default_session_config = 4; + * @return The defaultSessionConfig. */ - org.tensorflow.proto.framework.ConfigProto getDefaultSessionConfig(); + org.tensorflow.proto.ConfigProto getDefaultSessionConfig(); /** *
        * The default configuration for sessions that run on this server.
    @@ -88,24 +110,28 @@ public interface ServerDefOrBuilder extends
        *
        * .tensorflow.ConfigProto default_session_config = 4;
        */
    -  org.tensorflow.proto.framework.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder();
    +  org.tensorflow.proto.ConfigProtoOrBuilder getDefaultSessionConfigOrBuilder();
     
       /**
        * 
        * The protocol to be used by this server.
    +   *
        * Acceptable values include: "grpc", "grpc+verbs".
        * 
    * * string protocol = 5; + * @return The protocol. */ java.lang.String getProtocol(); /** *
        * The protocol to be used by this server.
    +   *
        * Acceptable values include: "grpc", "grpc+verbs".
        * 
    * * string protocol = 5; + * @return The bytes for protocol. */ com.google.protobuf.ByteString getProtocolBytes(); @@ -116,6 +142,7 @@ public interface ServerDefOrBuilder extends *
    * * int32 port = 6; + * @return The port. */ int getPort(); @@ -126,6 +153,7 @@ public interface ServerDefOrBuilder extends * * * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return Whether the clusterDeviceFilters field is set. */ boolean hasClusterDeviceFilters(); /** @@ -135,8 +163,9 @@ public interface ServerDefOrBuilder extends * * * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7; + * @return The clusterDeviceFilters. */ - org.tensorflow.proto.distruntime.ClusterDeviceFilters getClusterDeviceFilters(); + org.tensorflow.proto.ClusterDeviceFilters getClusterDeviceFilters(); /** *
        * Device filters for remote tasks in the cluster.
    @@ -145,5 +174,5 @@ public interface ServerDefOrBuilder extends
        *
        * .tensorflow.ClusterDeviceFilters cluster_device_filters = 7;
        */
    -  org.tensorflow.proto.distruntime.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder();
    +  org.tensorflow.proto.ClusterDeviceFiltersOrBuilder getClusterDeviceFiltersOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerProtos.java
    new file mode 100644
    index 00000000000..56fff5364e9
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ServerProtos.java
    @@ -0,0 +1,78 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/tensorflow_server.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class ServerProtos {
    +  private ServerProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      ServerProtos.class.getName());
    +  }
    +  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_ServerDef_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_ServerDef_fieldAccessorTable;
    +
    +  public static com.google.protobuf.Descriptors.FileDescriptor
    +      getDescriptor() {
    +    return descriptor;
    +  }
    +  private static  com.google.protobuf.Descriptors.FileDescriptor
    +      descriptor;
    +  static {
    +    java.lang.String[] descriptorData = {
    +      "\n0tensorflow/core/protobuf/tensorflow_se" +
    +      "rver.proto\022\ntensorflow\032&tensorflow/core/" +
    +      "protobuf/cluster.proto\032%tensorflow/core/" +
    +      "protobuf/config.proto\032-tensorflow/core/p" +
    +      "rotobuf/device_filters.proto\"\206\002\n\tServerD" +
    +      "ef\022\'\n\007cluster\030\001 \001(\0132\026.tensorflow.Cluster" +
    +      "Def\022\020\n\010job_name\030\002 \001(\t\022\017\n\007replica\030\010 \001(\005\022\022" +
    +      "\n\ntask_index\030\003 \001(\005\0227\n\026default_session_co" +
    +      "nfig\030\004 \001(\0132\027.tensorflow.ConfigProto\022\020\n\010p" +
    +      "rotocol\030\005 \001(\t\022\014\n\004port\030\006 \001(\005\022@\n\026cluster_d" +
    +      "evice_filters\030\007 \001(\0132 .tensorflow.Cluster" +
    +      "DeviceFiltersB\200\001\n\024org.tensorflow.protoB\014" +
    +      "ServerProtosP\001ZUgithub.com/tensorflow/te" +
    +      "nsorflow/tensorflow/go/core/protobuf/for" +
    +      "_core_protos_go_proto\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.ClusterProtos.getDescriptor(),
    +          org.tensorflow.proto.ConfigProtos.getDescriptor(),
    +          org.tensorflow.proto.DeviceFiltersProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_ServerDef_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_ServerDef_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_ServerDef_descriptor,
    +        new java.lang.String[] { "Cluster", "JobName", "Replica", "TaskIndex", "DefaultSessionConfig", "Protocol", "Port", "ClusterDeviceFilters", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.ClusterProtos.getDescriptor();
    +    org.tensorflow.proto.ConfigProtos.getDescriptor();
    +    org.tensorflow.proto.DeviceFiltersProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLog.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLog.java
    new file mode 100644
    index 00000000000..1bcf1d93e9a
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLog.java
    @@ -0,0 +1,902 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer used for logging session state.
    + * 
    + * + * Protobuf type {@code tensorflow.SessionLog} + */ +public final class SessionLog extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SessionLog) + SessionLogOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SessionLog.class.getName()); + } + // Use SessionLog.newBuilder() to construct. + private SessionLog(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SessionLog() { + status_ = 0; + checkpointPath_ = ""; + msg_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SessionLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SessionLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SessionLog.class, org.tensorflow.proto.SessionLog.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.SessionLog.SessionStatus} + */ + public enum SessionStatus + implements com.google.protobuf.ProtocolMessageEnum { + /** + * STATUS_UNSPECIFIED = 0; + */ + STATUS_UNSPECIFIED(0), + /** + * START = 1; + */ + START(1), + /** + * STOP = 2; + */ + STOP(2), + /** + * CHECKPOINT = 3; + */ + CHECKPOINT(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SessionStatus.class.getName()); + } + /** + * STATUS_UNSPECIFIED = 0; + */ + public static final int STATUS_UNSPECIFIED_VALUE = 0; + /** + * START = 1; + */ + public static final int START_VALUE = 1; + /** + * STOP = 2; + */ + public static final int STOP_VALUE = 2; + /** + * CHECKPOINT = 3; + */ + public static final int CHECKPOINT_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SessionStatus valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SessionStatus forNumber(int value) { + switch (value) { + case 0: return STATUS_UNSPECIFIED; + case 1: return START; + case 2: return STOP; + case 3: return CHECKPOINT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SessionStatus> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SessionStatus findValueByNumber(int number) { + return SessionStatus.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.SessionLog.getDescriptor().getEnumTypes().get(0); + } + + private static final SessionStatus[] VALUES = values(); + + public static SessionStatus 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 SessionStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.SessionLog.SessionStatus) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_ = 0; + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The status. + */ + @java.lang.Override public org.tensorflow.proto.SessionLog.SessionStatus getStatus() { + org.tensorflow.proto.SessionLog.SessionStatus result = org.tensorflow.proto.SessionLog.SessionStatus.forNumber(status_); + return result == null ? org.tensorflow.proto.SessionLog.SessionStatus.UNRECOGNIZED : result; + } + + public static final int CHECKPOINT_PATH_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object checkpointPath_ = ""; + /** + *
    +   * This checkpoint_path contains both the path and filename.
    +   * 
    + * + * string checkpoint_path = 2; + * @return The checkpointPath. + */ + @java.lang.Override + public java.lang.String getCheckpointPath() { + java.lang.Object ref = checkpointPath_; + 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(); + checkpointPath_ = s; + return s; + } + } + /** + *
    +   * This checkpoint_path contains both the path and filename.
    +   * 
    + * + * string checkpoint_path = 2; + * @return The bytes for checkpointPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCheckpointPathBytes() { + java.lang.Object ref = checkpointPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checkpointPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MSG_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object msg_ = ""; + /** + * string msg = 3; + * @return The msg. + */ + @java.lang.Override + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + 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(); + msg_ = s; + return s; + } + } + /** + * string msg = 3; + * @return The bytes for msg. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (status_ != org.tensorflow.proto.SessionLog.SessionStatus.STATUS_UNSPECIFIED.getNumber()) { + output.writeEnum(1, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkpointPath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, checkpointPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, msg_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != org.tensorflow.proto.SessionLog.SessionStatus.STATUS_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, status_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkpointPath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, checkpointPath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, msg_); + } + size += getUnknownFields().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.SessionLog)) { + return super.equals(obj); + } + org.tensorflow.proto.SessionLog other = (org.tensorflow.proto.SessionLog) obj; + + if (status_ != other.status_) return false; + if (!getCheckpointPath() + .equals(other.getCheckpointPath())) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (37 * hash) + CHECKPOINT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getCheckpointPath().hashCode(); + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SessionLog parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionLog 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.SessionLog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionLog 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.SessionLog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionLog parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SessionLog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SessionLog parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SessionLog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SessionLog parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SessionLog parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SessionLog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SessionLog 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer used for logging session state.
    +   * 
    + * + * Protobuf type {@code tensorflow.SessionLog} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SessionLog) + org.tensorflow.proto.SessionLogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SessionLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SessionLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SessionLog.class, org.tensorflow.proto.SessionLog.Builder.class); + } + + // Construct using org.tensorflow.proto.SessionLog.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = 0; + checkpointPath_ = ""; + msg_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SessionLog_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SessionLog getDefaultInstanceForType() { + return org.tensorflow.proto.SessionLog.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SessionLog build() { + org.tensorflow.proto.SessionLog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SessionLog buildPartial() { + org.tensorflow.proto.SessionLog result = new org.tensorflow.proto.SessionLog(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SessionLog result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.checkpointPath_ = checkpointPath_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.msg_ = msg_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SessionLog) { + return mergeFrom((org.tensorflow.proto.SessionLog)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SessionLog other) { + if (other == org.tensorflow.proto.SessionLog.getDefaultInstance()) return this; + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (!other.getCheckpointPath().isEmpty()) { + checkpointPath_ = other.checkpointPath_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + status_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + checkpointPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + msg_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int status_ = 0; + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The status. + */ + @java.lang.Override + public org.tensorflow.proto.SessionLog.SessionStatus getStatus() { + org.tensorflow.proto.SessionLog.SessionStatus result = org.tensorflow.proto.SessionLog.SessionStatus.forNumber(status_); + return result == null ? org.tensorflow.proto.SessionLog.SessionStatus.UNRECOGNIZED : result; + } + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(org.tensorflow.proto.SessionLog.SessionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = 0; + onChanged(); + return this; + } + + private java.lang.Object checkpointPath_ = ""; + /** + *
    +     * This checkpoint_path contains both the path and filename.
    +     * 
    + * + * string checkpoint_path = 2; + * @return The checkpointPath. + */ + public java.lang.String getCheckpointPath() { + java.lang.Object ref = checkpointPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checkpointPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * This checkpoint_path contains both the path and filename.
    +     * 
    + * + * string checkpoint_path = 2; + * @return The bytes for checkpointPath. + */ + public com.google.protobuf.ByteString + getCheckpointPathBytes() { + java.lang.Object ref = checkpointPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checkpointPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * This checkpoint_path contains both the path and filename.
    +     * 
    + * + * string checkpoint_path = 2; + * @param value The checkpointPath to set. + * @return This builder for chaining. + */ + public Builder setCheckpointPath( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + checkpointPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * This checkpoint_path contains both the path and filename.
    +     * 
    + * + * string checkpoint_path = 2; + * @return This builder for chaining. + */ + public Builder clearCheckpointPath() { + checkpointPath_ = getDefaultInstance().getCheckpointPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * This checkpoint_path contains both the path and filename.
    +     * 
    + * + * string checkpoint_path = 2; + * @param value The bytes for checkpointPath to set. + * @return This builder for chaining. + */ + public Builder setCheckpointPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + checkpointPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object msg_ = ""; + /** + * string msg = 3; + * @return The msg. + */ + public java.lang.String getMsg() { + java.lang.Object ref = msg_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string msg = 3; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + java.lang.Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string msg = 3; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + msg_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string msg = 3; + * @return This builder for chaining. + */ + public Builder clearMsg() { + msg_ = getDefaultInstance().getMsg(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string msg = 3; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + msg_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SessionLog) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SessionLog) + private static final org.tensorflow.proto.SessionLog DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SessionLog(); + } + + public static org.tensorflow.proto.SessionLog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionLog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionLog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLogOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLogOrBuilder.java new file mode 100644 index 00000000000..1c97f0c82e8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionLogOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SessionLogOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SessionLog) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * .tensorflow.SessionLog.SessionStatus status = 1; + * @return The status. + */ + org.tensorflow.proto.SessionLog.SessionStatus getStatus(); + + /** + *
    +   * This checkpoint_path contains both the path and filename.
    +   * 
    + * + * string checkpoint_path = 2; + * @return The checkpointPath. + */ + java.lang.String getCheckpointPath(); + /** + *
    +   * This checkpoint_path contains both the path and filename.
    +   * 
    + * + * string checkpoint_path = 2; + * @return The bytes for checkpointPath. + */ + com.google.protobuf.ByteString + getCheckpointPathBytes(); + + /** + * string msg = 3; + * @return The msg. + */ + java.lang.String getMsg(); + /** + * string msg = 3; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadata.java new file mode 100644 index 00000000000..3031e8e58cb --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadata.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Metadata about the session.
    + *
    + * This can be used by the runtime and the Ops for debugging, monitoring, etc.
    + *
    + * The (name, version) tuple is expected to be a unique identifier for
    + * sessions within the same process.
    + *
    + * NOTE: This is currently used and propagated only by the direct session.
    + * 
    + * + * Protobuf type {@code tensorflow.SessionMetadata} + */ +public final class SessionMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SessionMetadata) + SessionMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SessionMetadata.class.getName()); + } + // Use SessionMetadata.newBuilder() to construct. + private SessionMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SessionMetadata() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_SessionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SessionMetadata.class, org.tensorflow.proto.SessionMetadata.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 VERSION_FIELD_NUMBER = 2; + private long version_ = 0L; + /** + *
    +   * The version is optional. If set, needs to be >= 0.
    +   * 
    + * + * int64 version = 2; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (version_ != 0L) { + output.writeInt64(2, version_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (version_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, version_); + } + size += getUnknownFields().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.SessionMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.SessionMetadata other = (org.tensorflow.proto.SessionMetadata) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getVersion() + != other.getVersion()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVersion()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SessionMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionMetadata 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.SessionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionMetadata 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.SessionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SessionMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SessionMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SessionMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SessionMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SessionMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SessionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SessionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SessionMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Metadata about the session.
    +   *
    +   * This can be used by the runtime and the Ops for debugging, monitoring, etc.
    +   *
    +   * The (name, version) tuple is expected to be a unique identifier for
    +   * sessions within the same process.
    +   *
    +   * NOTE: This is currently used and propagated only by the direct session.
    +   * 
    + * + * Protobuf type {@code tensorflow.SessionMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SessionMetadata) + org.tensorflow.proto.SessionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_SessionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SessionMetadata.class, org.tensorflow.proto.SessionMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.SessionMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + version_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_SessionMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SessionMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.SessionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SessionMetadata build() { + org.tensorflow.proto.SessionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SessionMetadata buildPartial() { + org.tensorflow.proto.SessionMetadata result = new org.tensorflow.proto.SessionMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SessionMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = version_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SessionMetadata) { + return mergeFrom((org.tensorflow.proto.SessionMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SessionMetadata other) { + if (other == org.tensorflow.proto.SessionMetadata.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getVersion() != 0L) { + setVersion(other.getVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + version_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long version_ ; + /** + *
    +     * The version is optional. If set, needs to be >= 0.
    +     * 
    + * + * int64 version = 2; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + /** + *
    +     * The version is optional. If set, needs to be >= 0.
    +     * 
    + * + * int64 version = 2; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(long value) { + + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The version is optional. If set, needs to be >= 0.
    +     * 
    + * + * int64 version = 2; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + version_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SessionMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SessionMetadata) + private static final org.tensorflow.proto.SessionMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SessionMetadata(); + } + + public static org.tensorflow.proto.SessionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SessionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadataOrBuilder.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadataOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadataOrBuilder.java index eae7295e772..2401495d7e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SessionMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SessionMetadataOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface SessionMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SessionMetadata) @@ -9,10 +11,12 @@ public interface SessionMetadataOrBuilder extends /** * string name = 1; + * @return The name. */ java.lang.String getName(); /** * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString getNameBytes(); @@ -23,6 +27,7 @@ public interface SessionMetadataOrBuilder extends *
    * * int64 version = 2; + * @return The version. */ long getVersion(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDef.java new file mode 100644 index 00000000000..6e0faf13917 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDef.java @@ -0,0 +1,1587 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * SignatureDef defines the signature of a computation supported by a TensorFlow
    + * graph.
    + * 
    + * + * Protobuf type {@code tensorflow.SignatureDef} + */ +public final class SignatureDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SignatureDef) + SignatureDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SignatureDef.class.getName()); + } + // Use SignatureDef.newBuilder() to construct. + private SignatureDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SignatureDef() { + methodName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetInputs(); + case 2: + return internalGetOutputs(); + case 4: + return internalGetDefaults(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SignatureDef.class, org.tensorflow.proto.SignatureDef.Builder.class); + } + + public static final int INPUTS_FIELD_NUMBER = 1; + private static final class InputsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.TensorInfo> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_InputsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.TensorInfo.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.TensorInfo> inputs_; + private com.google.protobuf.MapField + internalGetInputs() { + if (inputs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + InputsDefaultEntryHolder.defaultEntry); + } + return inputs_; + } + public int getInputsCount() { + return internalGetInputs().getMap().size(); + } + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public boolean containsInputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetInputs().getMap().containsKey(key); + } + /** + * Use {@link #getInputsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getInputs() { + return getInputsMap(); + } + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public java.util.Map getInputsMap() { + return internalGetInputs().getMap(); + } + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorInfo getInputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetInputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getInputsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetInputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OUTPUTS_FIELD_NUMBER = 2; + private static final class OutputsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.TensorInfo> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_OutputsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.TensorInfo.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.TensorInfo> outputs_; + private com.google.protobuf.MapField + internalGetOutputs() { + if (outputs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + OutputsDefaultEntryHolder.defaultEntry); + } + return outputs_; + } + public int getOutputsCount() { + return internalGetOutputs().getMap().size(); + } + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public boolean containsOutputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetOutputs().getMap().containsKey(key); + } + /** + * Use {@link #getOutputsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getOutputs() { + return getOutputsMap(); + } + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public java.util.Map getOutputsMap() { + return internalGetOutputs().getMap(); + } + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorInfo getOutputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetOutputs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getOutputsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetOutputs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METHOD_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object methodName_ = ""; + /** + *
    +   * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +   * open-source TF Serving stopped checking by default since release 2.4.
    +   *
    +   * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +   * supporting a particular method. Multiple SignatureDefs in a single
    +   * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +   * computation).
    +   * 
    + * + * string method_name = 3; + * @return The methodName. + */ + @java.lang.Override + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + 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(); + methodName_ = s; + return s; + } + } + /** + *
    +   * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +   * open-source TF Serving stopped checking by default since release 2.4.
    +   *
    +   * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +   * supporting a particular method. Multiple SignatureDefs in a single
    +   * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +   * computation).
    +   * 
    + * + * string method_name = 3; + * @return The bytes for methodName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEFAULTS_FIELD_NUMBER = 4; + private static final class DefaultsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.TensorProto> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_DefaultsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.TensorProto> defaults_; + private com.google.protobuf.MapField + internalGetDefaults() { + if (defaults_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DefaultsDefaultEntryHolder.defaultEntry); + } + return defaults_; + } + public int getDefaultsCount() { + return internalGetDefaults().getMap().size(); + } + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public boolean containsDefaults( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDefaults().getMap().containsKey(key); + } + /** + * Use {@link #getDefaultsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDefaults() { + return getDefaultsMap(); + } + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public java.util.Map getDefaultsMap() { + return internalGetDefaults().getMap(); + } + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorProto getDefaultsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorProto defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDefaults().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getDefaultsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDefaults().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetInputs(), + InputsDefaultEntryHolder.defaultEntry, + 1); + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetOutputs(), + OutputsDefaultEntryHolder.defaultEntry, + 2); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(methodName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, methodName_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetDefaults(), + DefaultsDefaultEntryHolder.defaultEntry, + 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetInputs().getMap().entrySet()) { + com.google.protobuf.MapEntry + inputs__ = InputsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, inputs__); + } + for (java.util.Map.Entry entry + : internalGetOutputs().getMap().entrySet()) { + com.google.protobuf.MapEntry + outputs__ = OutputsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, outputs__); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(methodName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, methodName_); + } + for (java.util.Map.Entry entry + : internalGetDefaults().getMap().entrySet()) { + com.google.protobuf.MapEntry + defaults__ = DefaultsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, defaults__); + } + size += getUnknownFields().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.SignatureDef)) { + return super.equals(obj); + } + org.tensorflow.proto.SignatureDef other = (org.tensorflow.proto.SignatureDef) obj; + + if (!internalGetInputs().equals( + other.internalGetInputs())) return false; + if (!internalGetOutputs().equals( + other.internalGetOutputs())) return false; + if (!getMethodName() + .equals(other.getMethodName())) return false; + if (!internalGetDefaults().equals( + other.internalGetDefaults())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetInputs().getMap().isEmpty()) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetInputs().hashCode(); + } + if (!internalGetOutputs().getMap().isEmpty()) { + hash = (37 * hash) + OUTPUTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetOutputs().hashCode(); + } + hash = (37 * hash) + METHOD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMethodName().hashCode(); + if (!internalGetDefaults().getMap().isEmpty()) { + hash = (37 * hash) + DEFAULTS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDefaults().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SignatureDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SignatureDef 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.SignatureDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SignatureDef 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.SignatureDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SignatureDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SignatureDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SignatureDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SignatureDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SignatureDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SignatureDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SignatureDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SignatureDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * SignatureDef defines the signature of a computation supported by a TensorFlow
    +   * graph.
    +   * 
    + * + * Protobuf type {@code tensorflow.SignatureDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SignatureDef) + org.tensorflow.proto.SignatureDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetInputs(); + case 2: + return internalGetOutputs(); + case 4: + return internalGetDefaults(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableInputs(); + case 2: + return internalGetMutableOutputs(); + case 4: + return internalGetMutableDefaults(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SignatureDef.class, org.tensorflow.proto.SignatureDef.Builder.class); + } + + // Construct using org.tensorflow.proto.SignatureDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableInputs().clear(); + internalGetMutableOutputs().clear(); + methodName_ = ""; + internalGetMutableDefaults().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_SignatureDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SignatureDef getDefaultInstanceForType() { + return org.tensorflow.proto.SignatureDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SignatureDef build() { + org.tensorflow.proto.SignatureDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SignatureDef buildPartial() { + org.tensorflow.proto.SignatureDef result = new org.tensorflow.proto.SignatureDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SignatureDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputs_ = internalGetInputs().build(InputsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputs_ = internalGetOutputs().build(OutputsDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.methodName_ = methodName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.defaults_ = internalGetDefaults().build(DefaultsDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SignatureDef) { + return mergeFrom((org.tensorflow.proto.SignatureDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SignatureDef other) { + if (other == org.tensorflow.proto.SignatureDef.getDefaultInstance()) return this; + internalGetMutableInputs().mergeFrom( + other.internalGetInputs()); + bitField0_ |= 0x00000001; + internalGetMutableOutputs().mergeFrom( + other.internalGetOutputs()); + bitField0_ |= 0x00000002; + if (!other.getMethodName().isEmpty()) { + methodName_ = other.methodName_; + bitField0_ |= 0x00000004; + onChanged(); + } + internalGetMutableDefaults().mergeFrom( + other.internalGetDefaults()); + bitField0_ |= 0x00000008; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + inputs__ = input.readMessage( + InputsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableInputs().ensureBuilderMap().put( + inputs__.getKey(), inputs__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + outputs__ = input.readMessage( + OutputsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableOutputs().ensureBuilderMap().put( + outputs__.getKey(), outputs__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + methodName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + defaults__ = input.readMessage( + DefaultsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableDefaults().ensureBuilderMap().put( + defaults__.getKey(), defaults__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class InputsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.TensorInfo build(org.tensorflow.proto.TensorInfoOrBuilder val) { + if (val instanceof org.tensorflow.proto.TensorInfo) { return (org.tensorflow.proto.TensorInfo) val; } + return ((org.tensorflow.proto.TensorInfo.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return InputsDefaultEntryHolder.defaultEntry; + } + }; + private static final InputsConverter inputsConverter = new InputsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.TensorInfoOrBuilder, org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder> inputs_; + private com.google.protobuf.MapFieldBuilder + internalGetInputs() { + if (inputs_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(inputsConverter); + } + return inputs_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableInputs() { + if (inputs_ == null) { + inputs_ = new com.google.protobuf.MapFieldBuilder<>(inputsConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return inputs_; + } + public int getInputsCount() { + return internalGetInputs().ensureBuilderMap().size(); + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public boolean containsInputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetInputs().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getInputsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getInputs() { + return getInputsMap(); + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public java.util.Map getInputsMap() { + return internalGetInputs().getImmutableMap(); + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorInfo getInputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableInputs().ensureBuilderMap(); + return map.containsKey(key) ? inputsConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getInputsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableInputs().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return inputsConverter.build(map.get(key)); + } + public Builder clearInputs() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableInputs().clear(); + return this; + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + public Builder removeInputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableInputs().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableInputs() { + bitField0_ |= 0x00000001; + return internalGetMutableInputs().ensureMessageMap(); + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + public Builder putInputs( + java.lang.String key, + org.tensorflow.proto.TensorInfo value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableInputs().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + public Builder putAllInputs( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableInputs().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + *
    +     * Named input parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + public org.tensorflow.proto.TensorInfo.Builder putInputsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableInputs().ensureBuilderMap(); + org.tensorflow.proto.TensorInfoOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.TensorInfo.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.TensorInfo) { + entry = ((org.tensorflow.proto.TensorInfo) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.TensorInfo.Builder) entry; + } + + private static final class OutputsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.TensorInfo build(org.tensorflow.proto.TensorInfoOrBuilder val) { + if (val instanceof org.tensorflow.proto.TensorInfo) { return (org.tensorflow.proto.TensorInfo) val; } + return ((org.tensorflow.proto.TensorInfo.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return OutputsDefaultEntryHolder.defaultEntry; + } + }; + private static final OutputsConverter outputsConverter = new OutputsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.TensorInfoOrBuilder, org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder> outputs_; + private com.google.protobuf.MapFieldBuilder + internalGetOutputs() { + if (outputs_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(outputsConverter); + } + return outputs_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableOutputs() { + if (outputs_ == null) { + outputs_ = new com.google.protobuf.MapFieldBuilder<>(outputsConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return outputs_; + } + public int getOutputsCount() { + return internalGetOutputs().ensureBuilderMap().size(); + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public boolean containsOutputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetOutputs().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getOutputsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getOutputs() { + return getOutputsMap(); + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public java.util.Map getOutputsMap() { + return internalGetOutputs().getImmutableMap(); + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorInfo getOutputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableOutputs().ensureBuilderMap(); + return map.containsKey(key) ? outputsConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getOutputsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableOutputs().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return outputsConverter.build(map.get(key)); + } + public Builder clearOutputs() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableOutputs().clear(); + return this; + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + public Builder removeOutputs( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableOutputs().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableOutputs() { + bitField0_ |= 0x00000002; + return internalGetMutableOutputs().ensureMessageMap(); + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + public Builder putOutputs( + java.lang.String key, + org.tensorflow.proto.TensorInfo value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableOutputs().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + public Builder putAllOutputs( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableOutputs().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Named output parameters.
    +     * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + public org.tensorflow.proto.TensorInfo.Builder putOutputsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableOutputs().ensureBuilderMap(); + org.tensorflow.proto.TensorInfoOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.TensorInfo.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.TensorInfo) { + entry = ((org.tensorflow.proto.TensorInfo) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.TensorInfo.Builder) entry; + } + + private java.lang.Object methodName_ = ""; + /** + *
    +     * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +     * open-source TF Serving stopped checking by default since release 2.4.
    +     *
    +     * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +     * supporting a particular method. Multiple SignatureDefs in a single
    +     * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +     * computation).
    +     * 
    + * + * string method_name = 3; + * @return The methodName. + */ + public java.lang.String getMethodName() { + java.lang.Object ref = methodName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + methodName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +     * open-source TF Serving stopped checking by default since release 2.4.
    +     *
    +     * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +     * supporting a particular method. Multiple SignatureDefs in a single
    +     * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +     * computation).
    +     * 
    + * + * string method_name = 3; + * @return The bytes for methodName. + */ + public com.google.protobuf.ByteString + getMethodNameBytes() { + java.lang.Object ref = methodName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + methodName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +     * open-source TF Serving stopped checking by default since release 2.4.
    +     *
    +     * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +     * supporting a particular method. Multiple SignatureDefs in a single
    +     * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +     * computation).
    +     * 
    + * + * string method_name = 3; + * @param value The methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + methodName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +     * open-source TF Serving stopped checking by default since release 2.4.
    +     *
    +     * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +     * supporting a particular method. Multiple SignatureDefs in a single
    +     * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +     * computation).
    +     * 
    + * + * string method_name = 3; + * @return This builder for chaining. + */ + public Builder clearMethodName() { + methodName_ = getDefaultInstance().getMethodName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +     * open-source TF Serving stopped checking by default since release 2.4.
    +     *
    +     * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +     * supporting a particular method. Multiple SignatureDefs in a single
    +     * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +     * computation).
    +     * 
    + * + * string method_name = 3; + * @param value The bytes for methodName to set. + * @return This builder for chaining. + */ + public Builder setMethodNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + methodName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private static final class DefaultsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.TensorProto build(org.tensorflow.proto.TensorProtoOrBuilder val) { + if (val instanceof org.tensorflow.proto.TensorProto) { return (org.tensorflow.proto.TensorProto) val; } + return ((org.tensorflow.proto.TensorProto.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return DefaultsDefaultEntryHolder.defaultEntry; + } + }; + private static final DefaultsConverter defaultsConverter = new DefaultsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.TensorProtoOrBuilder, org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder> defaults_; + private com.google.protobuf.MapFieldBuilder + internalGetDefaults() { + if (defaults_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(defaultsConverter); + } + return defaults_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableDefaults() { + if (defaults_ == null) { + defaults_ = new com.google.protobuf.MapFieldBuilder<>(defaultsConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return defaults_; + } + public int getDefaultsCount() { + return internalGetDefaults().ensureBuilderMap().size(); + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public boolean containsDefaults( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDefaults().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getDefaultsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDefaults() { + return getDefaultsMap(); + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public java.util.Map getDefaultsMap() { + return internalGetDefaults().getImmutableMap(); + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.TensorProto getDefaultsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorProto defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableDefaults().ensureBuilderMap(); + return map.containsKey(key) ? defaultsConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getDefaultsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableDefaults().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return defaultsConverter.build(map.get(key)); + } + public Builder clearDefaults() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableDefaults().clear(); + return this; + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + public Builder removeDefaults( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableDefaults().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableDefaults() { + bitField0_ |= 0x00000008; + return internalGetMutableDefaults().ensureMessageMap(); + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + public Builder putDefaults( + java.lang.String key, + org.tensorflow.proto.TensorProto value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableDefaults().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + public Builder putAllDefaults( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableDefaults().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +     * Named input to corresponding default values if any.
    +     * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + public org.tensorflow.proto.TensorProto.Builder putDefaultsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableDefaults().ensureBuilderMap(); + org.tensorflow.proto.TensorProtoOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.TensorProto.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.TensorProto) { + entry = ((org.tensorflow.proto.TensorProto) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.TensorProto.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SignatureDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SignatureDef) + private static final org.tensorflow.proto.SignatureDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SignatureDef(); + } + + public static org.tensorflow.proto.SignatureDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignatureDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SignatureDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDefOrBuilder.java new file mode 100644 index 00000000000..0e581154587 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SignatureDefOrBuilder.java @@ -0,0 +1,205 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SignatureDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SignatureDef) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + int getInputsCount(); + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + boolean containsInputs( + java.lang.String key); + /** + * Use {@link #getInputsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getInputs(); + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + java.util.Map + getInputsMap(); + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + /* nullable */ +org.tensorflow.proto.TensorInfo getInputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue); + /** + *
    +   * Named input parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> inputs = 1; + */ + org.tensorflow.proto.TensorInfo getInputsOrThrow( + java.lang.String key); + + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + int getOutputsCount(); + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + boolean containsOutputs( + java.lang.String key); + /** + * Use {@link #getOutputsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getOutputs(); + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + java.util.Map + getOutputsMap(); + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + /* nullable */ +org.tensorflow.proto.TensorInfo getOutputsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorInfo defaultValue); + /** + *
    +   * Named output parameters.
    +   * 
    + * + * map<string, .tensorflow.TensorInfo> outputs = 2; + */ + org.tensorflow.proto.TensorInfo getOutputsOrThrow( + java.lang.String key); + + /** + *
    +   * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +   * open-source TF Serving stopped checking by default since release 2.4.
    +   *
    +   * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +   * supporting a particular method. Multiple SignatureDefs in a single
    +   * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +   * computation).
    +   * 
    + * + * string method_name = 3; + * @return The methodName. + */ + java.lang.String getMethodName(); + /** + *
    +   * Deprecated: TensorFlow 2 always sets this to a fixed value;
    +   * open-source TF Serving stopped checking by default since release 2.4.
    +   *
    +   * In TensorFlow 1, the method_name enabled users to mark a SignatureDef as
    +   * supporting a particular method. Multiple SignatureDefs in a single
    +   * MetaGraphDef could have the same method_name (e.g., to support multi-headed
    +   * computation).
    +   * 
    + * + * string method_name = 3; + * @return The bytes for methodName. + */ + com.google.protobuf.ByteString + getMethodNameBytes(); + + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + int getDefaultsCount(); + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + boolean containsDefaults( + java.lang.String key); + /** + * Use {@link #getDefaultsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getDefaults(); + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + java.util.Map + getDefaultsMap(); + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + /* nullable */ +org.tensorflow.proto.TensorProto getDefaultsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.TensorProto defaultValue); + /** + *
    +   * Named input to corresponding default values if any.
    +   * 
    + * + * map<string, .tensorflow.TensorProto> defaults = 4; + */ + org.tensorflow.proto.TensorProto getDefaultsOrThrow( + java.lang.String key); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFile.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFile.java new file mode 100644 index 00000000000..ea02bfde086 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFile.java @@ -0,0 +1,944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Content of a source file involved in the execution of the debugged TensorFlow
    + * program.
    + * 
    + * + * Protobuf type {@code tensorflow.SourceFile} + */ +public final class SourceFile extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SourceFile) + SourceFileOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SourceFile.class.getName()); + } + // Use SourceFile.newBuilder() to construct. + private SourceFile(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SourceFile() { + filePath_ = ""; + hostName_ = ""; + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_SourceFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SourceFile.class, org.tensorflow.proto.SourceFile.Builder.class); + } + + public static final int FILE_PATH_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object filePath_ = ""; + /** + *
    +   * Path to the file.
    +   * 
    + * + * string file_path = 1; + * @return The filePath. + */ + @java.lang.Override + public java.lang.String getFilePath() { + java.lang.Object ref = filePath_; + 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(); + filePath_ = s; + return s; + } + } + /** + *
    +   * Path to the file.
    +   * 
    + * + * string file_path = 1; + * @return The bytes for filePath. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFilePathBytes() { + java.lang.Object ref = filePath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object hostName_ = ""; + /** + *
    +   * Name of the host on which the file is located.
    +   * 
    + * + * string host_name = 2; + * @return The hostName. + */ + @java.lang.Override + public java.lang.String getHostName() { + java.lang.Object ref = hostName_; + 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(); + hostName_ = s; + return s; + } + } + /** + *
    +   * Name of the host on which the file is located.
    +   * 
    + * + * string host_name = 2; + * @return The bytes for hostName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHostNameBytes() { + java.lang.Object ref = hostName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINES_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Line-by-line content of the file.
    +   * 
    + * + * repeated string lines = 3; + * @return A list containing the lines. + */ + public com.google.protobuf.ProtocolStringList + getLinesList() { + return lines_; + } + /** + *
    +   * Line-by-line content of the file.
    +   * 
    + * + * repeated string lines = 3; + * @return The count of lines. + */ + public int getLinesCount() { + return lines_.size(); + } + /** + *
    +   * Line-by-line content of the file.
    +   * 
    + * + * repeated string lines = 3; + * @param index The index of the element to return. + * @return The lines at the given index. + */ + public java.lang.String getLines(int index) { + return lines_.get(index); + } + /** + *
    +   * Line-by-line content of the file.
    +   * 
    + * + * repeated string lines = 3; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. + */ + public com.google.protobuf.ByteString + getLinesBytes(int index) { + return lines_.getByteString(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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filePath_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, hostName_); + } + for (int i = 0; i < lines_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, lines_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filePath_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filePath_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, hostName_); + } + { + int dataSize = 0; + for (int i = 0; i < lines_.size(); i++) { + dataSize += computeStringSizeNoTag(lines_.getRaw(i)); + } + size += dataSize; + size += 1 * getLinesList().size(); + } + size += getUnknownFields().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.SourceFile)) { + return super.equals(obj); + } + org.tensorflow.proto.SourceFile other = (org.tensorflow.proto.SourceFile) obj; + + if (!getFilePath() + .equals(other.getFilePath())) return false; + if (!getHostName() + .equals(other.getHostName())) return false; + if (!getLinesList() + .equals(other.getLinesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FILE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFilePath().hashCode(); + hash = (37 * hash) + HOST_NAME_FIELD_NUMBER; + hash = (53 * hash) + getHostName().hashCode(); + if (getLinesCount() > 0) { + hash = (37 * hash) + LINES_FIELD_NUMBER; + hash = (53 * hash) + getLinesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SourceFile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceFile 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.SourceFile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceFile 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.SourceFile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceFile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SourceFile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SourceFile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SourceFile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SourceFile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SourceFile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SourceFile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SourceFile 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Content of a source file involved in the execution of the debugged TensorFlow
    +   * program.
    +   * 
    + * + * Protobuf type {@code tensorflow.SourceFile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SourceFile) + org.tensorflow.proto.SourceFileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_SourceFile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SourceFile.class, org.tensorflow.proto.SourceFile.Builder.class); + } + + // Construct using org.tensorflow.proto.SourceFile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filePath_ = ""; + hostName_ = ""; + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_SourceFile_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SourceFile getDefaultInstanceForType() { + return org.tensorflow.proto.SourceFile.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SourceFile build() { + org.tensorflow.proto.SourceFile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SourceFile buildPartial() { + org.tensorflow.proto.SourceFile result = new org.tensorflow.proto.SourceFile(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SourceFile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filePath_ = filePath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.hostName_ = hostName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + lines_.makeImmutable(); + result.lines_ = lines_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SourceFile) { + return mergeFrom((org.tensorflow.proto.SourceFile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SourceFile other) { + if (other == org.tensorflow.proto.SourceFile.getDefaultInstance()) return this; + if (!other.getFilePath().isEmpty()) { + filePath_ = other.filePath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getHostName().isEmpty()) { + hostName_ = other.hostName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.lines_.isEmpty()) { + if (lines_.isEmpty()) { + lines_ = other.lines_; + bitField0_ |= 0x00000004; + } else { + ensureLinesIsMutable(); + lines_.addAll(other.lines_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + filePath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + hostName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureLinesIsMutable(); + lines_.add(s); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object filePath_ = ""; + /** + *
    +     * Path to the file.
    +     * 
    + * + * string file_path = 1; + * @return The filePath. + */ + public java.lang.String getFilePath() { + java.lang.Object ref = filePath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filePath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Path to the file.
    +     * 
    + * + * string file_path = 1; + * @return The bytes for filePath. + */ + public com.google.protobuf.ByteString + getFilePathBytes() { + java.lang.Object ref = filePath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filePath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Path to the file.
    +     * 
    + * + * string file_path = 1; + * @param value The filePath to set. + * @return This builder for chaining. + */ + public Builder setFilePath( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + filePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Path to the file.
    +     * 
    + * + * string file_path = 1; + * @return This builder for chaining. + */ + public Builder clearFilePath() { + filePath_ = getDefaultInstance().getFilePath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Path to the file.
    +     * 
    + * + * string file_path = 1; + * @param value The bytes for filePath to set. + * @return This builder for chaining. + */ + public Builder setFilePathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + filePath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object hostName_ = ""; + /** + *
    +     * Name of the host on which the file is located.
    +     * 
    + * + * string host_name = 2; + * @return The hostName. + */ + public java.lang.String getHostName() { + java.lang.Object ref = hostName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the host on which the file is located.
    +     * 
    + * + * string host_name = 2; + * @return The bytes for hostName. + */ + public com.google.protobuf.ByteString + getHostNameBytes() { + java.lang.Object ref = hostName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the host on which the file is located.
    +     * 
    + * + * string host_name = 2; + * @param value The hostName to set. + * @return This builder for chaining. + */ + public Builder setHostName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + hostName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the host on which the file is located.
    +     * 
    + * + * string host_name = 2; + * @return This builder for chaining. + */ + public Builder clearHostName() { + hostName_ = getDefaultInstance().getHostName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the host on which the file is located.
    +     * 
    + * + * string host_name = 2; + * @param value The bytes for hostName to set. + * @return This builder for chaining. + */ + public Builder setHostNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + hostName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureLinesIsMutable() { + if (!lines_.isModifiable()) { + lines_ = new com.google.protobuf.LazyStringArrayList(lines_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @return A list containing the lines. + */ + public com.google.protobuf.ProtocolStringList + getLinesList() { + lines_.makeImmutable(); + return lines_; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @return The count of lines. + */ + public int getLinesCount() { + return lines_.size(); + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param index The index of the element to return. + * @return The lines at the given index. + */ + public java.lang.String getLines(int index) { + return lines_.get(index); + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. + */ + public com.google.protobuf.ByteString + getLinesBytes(int index) { + return lines_.getByteString(index); + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param index The index to set the value at. + * @param value The lines to set. + * @return This builder for chaining. + */ + public Builder setLines( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLinesIsMutable(); + lines_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param value The lines to add. + * @return This builder for chaining. + */ + public Builder addLines( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLinesIsMutable(); + lines_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param values The lines to add. + * @return This builder for chaining. + */ + public Builder addAllLines( + java.lang.Iterable values) { + ensureLinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lines_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @return This builder for chaining. + */ + public Builder clearLines() { + lines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +     * Line-by-line content of the file.
    +     * 
    + * + * repeated string lines = 3; + * @param value The bytes of the lines to add. + * @return This builder for chaining. + */ + public Builder addLinesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureLinesIsMutable(); + lines_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SourceFile) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SourceFile) + private static final org.tensorflow.proto.SourceFile DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SourceFile(); + } + + public static org.tensorflow.proto.SourceFile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceFile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SourceFile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFileOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFileOrBuilder.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFileOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFileOrBuilder.java index b05d03bfb81..b4ba2c5003a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/SourceFileOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceFileOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface SourceFileOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SourceFile) @@ -13,6 +15,7 @@ public interface SourceFileOrBuilder extends * * * string file_path = 1; + * @return The filePath. */ java.lang.String getFilePath(); /** @@ -21,6 +24,7 @@ public interface SourceFileOrBuilder extends * * * string file_path = 1; + * @return The bytes for filePath. */ com.google.protobuf.ByteString getFilePathBytes(); @@ -31,6 +35,7 @@ public interface SourceFileOrBuilder extends * * * string host_name = 2; + * @return The hostName. */ java.lang.String getHostName(); /** @@ -39,6 +44,7 @@ public interface SourceFileOrBuilder extends * * * string host_name = 2; + * @return The bytes for hostName. */ com.google.protobuf.ByteString getHostNameBytes(); @@ -49,6 +55,7 @@ public interface SourceFileOrBuilder extends * * * repeated string lines = 3; + * @return A list containing the lines. */ java.util.List getLinesList(); @@ -58,6 +65,7 @@ public interface SourceFileOrBuilder extends * * * repeated string lines = 3; + * @return The count of lines. */ int getLinesCount(); /** @@ -66,6 +74,8 @@ public interface SourceFileOrBuilder extends * * * repeated string lines = 3; + * @param index The index of the element to return. + * @return The lines at the given index. */ java.lang.String getLines(int index); /** @@ -74,6 +84,8 @@ public interface SourceFileOrBuilder extends * * * repeated string lines = 3; + * @param index The index of the value to return. + * @return The bytes of the lines at the given index. */ com.google.protobuf.ByteString getLinesBytes(int index); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadata.java new file mode 100644 index 00000000000..4ba484f32c5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadata.java @@ -0,0 +1,544 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Holds the information of the source that writes the events.
    + * 
    + * + * Protobuf type {@code tensorflow.SourceMetadata} + */ +public final class SourceMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SourceMetadata) + SourceMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SourceMetadata.class.getName()); + } + // Use SourceMetadata.newBuilder() to construct. + private SourceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SourceMetadata() { + writer_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SourceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SourceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SourceMetadata.class, org.tensorflow.proto.SourceMetadata.Builder.class); + } + + public static final int WRITER_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object writer_ = ""; + /** + *
    +   * Low level name of the summary writer, such as
    +   * `tensorflow.core.util.events_writer`.
    +   * 
    + * + * string writer = 1; + * @return The writer. + */ + @java.lang.Override + public java.lang.String getWriter() { + java.lang.Object ref = writer_; + 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(); + writer_ = s; + return s; + } + } + /** + *
    +   * Low level name of the summary writer, such as
    +   * `tensorflow.core.util.events_writer`.
    +   * 
    + * + * string writer = 1; + * @return The bytes for writer. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWriterBytes() { + java.lang.Object ref = writer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + writer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(writer_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, writer_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(writer_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, writer_); + } + size += getUnknownFields().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.SourceMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.SourceMetadata other = (org.tensorflow.proto.SourceMetadata) obj; + + if (!getWriter() + .equals(other.getWriter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + WRITER_FIELD_NUMBER; + hash = (53 * hash) + getWriter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SourceMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceMetadata 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.SourceMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceMetadata 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.SourceMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SourceMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SourceMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SourceMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SourceMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SourceMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SourceMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SourceMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SourceMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Holds the information of the source that writes the events.
    +   * 
    + * + * Protobuf type {@code tensorflow.SourceMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SourceMetadata) + org.tensorflow.proto.SourceMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SourceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SourceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SourceMetadata.class, org.tensorflow.proto.SourceMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.SourceMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + writer_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_SourceMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SourceMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.SourceMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SourceMetadata build() { + org.tensorflow.proto.SourceMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SourceMetadata buildPartial() { + org.tensorflow.proto.SourceMetadata result = new org.tensorflow.proto.SourceMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SourceMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.writer_ = writer_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SourceMetadata) { + return mergeFrom((org.tensorflow.proto.SourceMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SourceMetadata other) { + if (other == org.tensorflow.proto.SourceMetadata.getDefaultInstance()) return this; + if (!other.getWriter().isEmpty()) { + writer_ = other.writer_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + writer_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object writer_ = ""; + /** + *
    +     * Low level name of the summary writer, such as
    +     * `tensorflow.core.util.events_writer`.
    +     * 
    + * + * string writer = 1; + * @return The writer. + */ + public java.lang.String getWriter() { + java.lang.Object ref = writer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Low level name of the summary writer, such as
    +     * `tensorflow.core.util.events_writer`.
    +     * 
    + * + * string writer = 1; + * @return The bytes for writer. + */ + public com.google.protobuf.ByteString + getWriterBytes() { + java.lang.Object ref = writer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + writer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Low level name of the summary writer, such as
    +     * `tensorflow.core.util.events_writer`.
    +     * 
    + * + * string writer = 1; + * @param value The writer to set. + * @return This builder for chaining. + */ + public Builder setWriter( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + writer_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Low level name of the summary writer, such as
    +     * `tensorflow.core.util.events_writer`.
    +     * 
    + * + * string writer = 1; + * @return This builder for chaining. + */ + public Builder clearWriter() { + writer_ = getDefaultInstance().getWriter(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Low level name of the summary writer, such as
    +     * `tensorflow.core.util.events_writer`.
    +     * 
    + * + * string writer = 1; + * @param value The bytes for writer to set. + * @return This builder for chaining. + */ + public Builder setWriterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + writer_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SourceMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SourceMetadata) + private static final org.tensorflow.proto.SourceMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SourceMetadata(); + } + + public static org.tensorflow.proto.SourceMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SourceMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadataOrBuilder.java new file mode 100644 index 00000000000..7517f9cb4b6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SourceMetadataOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface SourceMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SourceMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Low level name of the summary writer, such as
    +   * `tensorflow.core.util.events_writer`.
    +   * 
    + * + * string writer = 1; + * @return The writer. + */ + java.lang.String getWriter(); + /** + *
    +   * Low level name of the summary writer, such as
    +   * `tensorflow.core.util.events_writer`.
    +   * 
    + * + * string writer = 1; + * @return The bytes for writer. + */ + com.google.protobuf.ByteString + getWriterBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithId.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithId.java new file mode 100644 index 00000000000..cb50e0e9abd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithId.java @@ -0,0 +1,802 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A stack frame with ID.
    + * 
    + * + * Protobuf type {@code tensorflow.StackFrameWithId} + */ +public final class StackFrameWithId extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.StackFrameWithId) + StackFrameWithIdOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StackFrameWithId.class.getName()); + } + // Use StackFrameWithId.newBuilder() to construct. + private StackFrameWithId(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StackFrameWithId() { + id_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StackFrameWithId.class, org.tensorflow.proto.StackFrameWithId.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + *
    +   * A unique ID for the stack frame: A UUID-like string.
    +   * 
    + * + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + *
    +   * A unique ID for the stack frame: A UUID-like string.
    +   * 
    + * + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_LINE_COL_FIELD_NUMBER = 2; + private org.tensorflow.proto.GraphDebugInfo.FileLineCol fileLineCol_; + /** + *
    +   * Stack frame, i.e., a frame of a stack trace, containing information
    +   * regarding the file name, line number, function name, code content
    +   * of the line, and column number (if available).
    +   * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return Whether the fileLineCol field is set. + */ + @java.lang.Override + public boolean hasFileLineCol() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Stack frame, i.e., a frame of a stack trace, containing information
    +   * regarding the file name, line number, function name, code content
    +   * of the line, and column number (if available).
    +   * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return The fileLineCol. + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCol() { + return fileLineCol_ == null ? org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; + } + /** + *
    +   * Stack frame, i.e., a frame of a stack trace, containing information
    +   * regarding the file name, line number, function name, code content
    +   * of the line, and column number (if available).
    +   * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + @java.lang.Override + public org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder() { + return fileLineCol_ == null ? org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFileLineCol()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFileLineCol()); + } + size += getUnknownFields().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.StackFrameWithId)) { + return super.equals(obj); + } + org.tensorflow.proto.StackFrameWithId other = (org.tensorflow.proto.StackFrameWithId) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasFileLineCol() != other.hasFileLineCol()) return false; + if (hasFileLineCol()) { + if (!getFileLineCol() + .equals(other.getFileLineCol())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasFileLineCol()) { + hash = (37 * hash) + FILE_LINE_COL_FIELD_NUMBER; + hash = (53 * hash) + getFileLineCol().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.StackFrameWithId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StackFrameWithId 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.StackFrameWithId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StackFrameWithId 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.StackFrameWithId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StackFrameWithId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.StackFrameWithId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StackFrameWithId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.StackFrameWithId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.StackFrameWithId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.StackFrameWithId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StackFrameWithId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.StackFrameWithId 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A stack frame with ID.
    +   * 
    + * + * Protobuf type {@code tensorflow.StackFrameWithId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.StackFrameWithId) + org.tensorflow.proto.StackFrameWithIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StackFrameWithId.class, org.tensorflow.proto.StackFrameWithId.Builder.class); + } + + // Construct using org.tensorflow.proto.StackFrameWithId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getFileLineColFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + fileLineCol_ = null; + if (fileLineColBuilder_ != null) { + fileLineColBuilder_.dispose(); + fileLineColBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DebugEventProtos.internal_static_tensorflow_StackFrameWithId_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.StackFrameWithId getDefaultInstanceForType() { + return org.tensorflow.proto.StackFrameWithId.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.StackFrameWithId build() { + org.tensorflow.proto.StackFrameWithId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.StackFrameWithId buildPartial() { + org.tensorflow.proto.StackFrameWithId result = new org.tensorflow.proto.StackFrameWithId(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.StackFrameWithId result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileLineCol_ = fileLineColBuilder_ == null + ? fileLineCol_ + : fileLineColBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.StackFrameWithId) { + return mergeFrom((org.tensorflow.proto.StackFrameWithId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.StackFrameWithId other) { + if (other == org.tensorflow.proto.StackFrameWithId.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFileLineCol()) { + mergeFileLineCol(other.getFileLineCol()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getFileLineColFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + *
    +     * A unique ID for the stack frame: A UUID-like string.
    +     * 
    + * + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A unique ID for the stack frame: A UUID-like string.
    +     * 
    + * + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A unique ID for the stack frame: A UUID-like string.
    +     * 
    + * + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * A unique ID for the stack frame: A UUID-like string.
    +     * 
    + * + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * A unique ID for the stack frame: A UUID-like string.
    +     * 
    + * + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.GraphDebugInfo.FileLineCol fileLineCol_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder> fileLineColBuilder_; + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return Whether the fileLineCol field is set. + */ + public boolean hasFileLineCol() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return The fileLineCol. + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCol() { + if (fileLineColBuilder_ == null) { + return fileLineCol_ == null ? org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; + } else { + return fileLineColBuilder_.getMessage(); + } + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public Builder setFileLineCol(org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + if (fileLineColBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fileLineCol_ = value; + } else { + fileLineColBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public Builder setFileLineCol( + org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder builderForValue) { + if (fileLineColBuilder_ == null) { + fileLineCol_ = builderForValue.build(); + } else { + fileLineColBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public Builder mergeFileLineCol(org.tensorflow.proto.GraphDebugInfo.FileLineCol value) { + if (fileLineColBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + fileLineCol_ != null && + fileLineCol_ != org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance()) { + getFileLineColBuilder().mergeFrom(value); + } else { + fileLineCol_ = value; + } + } else { + fileLineColBuilder_.mergeFrom(value); + } + if (fileLineCol_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public Builder clearFileLineCol() { + bitField0_ = (bitField0_ & ~0x00000002); + fileLineCol_ = null; + if (fileLineColBuilder_ != null) { + fileLineColBuilder_.dispose(); + fileLineColBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder getFileLineColBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFileLineColFieldBuilder().getBuilder(); + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + public org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder() { + if (fileLineColBuilder_ != null) { + return fileLineColBuilder_.getMessageOrBuilder(); + } else { + return fileLineCol_ == null ? + org.tensorflow.proto.GraphDebugInfo.FileLineCol.getDefaultInstance() : fileLineCol_; + } + } + /** + *
    +     * Stack frame, i.e., a frame of a stack trace, containing information
    +     * regarding the file name, line number, function name, code content
    +     * of the line, and column number (if available).
    +     * 
    + * + * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder> + getFileLineColFieldBuilder() { + if (fileLineColBuilder_ == null) { + fileLineColBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.GraphDebugInfo.FileLineCol, org.tensorflow.proto.GraphDebugInfo.FileLineCol.Builder, org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder>( + getFileLineCol(), + getParentForChildren(), + isClean()); + fileLineCol_ = null; + } + return fileLineColBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.StackFrameWithId) + } + + // @@protoc_insertion_point(class_scope:tensorflow.StackFrameWithId) + private static final org.tensorflow.proto.StackFrameWithId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.StackFrameWithId(); + } + + public static org.tensorflow.proto.StackFrameWithId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StackFrameWithId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StackFrameWithId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithIdOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithIdOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithIdOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithIdOrBuilder.java index b1132ff9e72..a75ee48a314 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/StackFrameWithIdOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StackFrameWithIdOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface StackFrameWithIdOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.StackFrameWithId) @@ -13,6 +15,7 @@ public interface StackFrameWithIdOrBuilder extends * * * string id = 1; + * @return The id. */ java.lang.String getId(); /** @@ -21,6 +24,7 @@ public interface StackFrameWithIdOrBuilder extends * * * string id = 1; + * @return The bytes for id. */ com.google.protobuf.ByteString getIdBytes(); @@ -33,6 +37,7 @@ public interface StackFrameWithIdOrBuilder extends * * * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return Whether the fileLineCol field is set. */ boolean hasFileLineCol(); /** @@ -43,8 +48,9 @@ public interface StackFrameWithIdOrBuilder extends * * * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2; + * @return The fileLineCol. */ - org.tensorflow.proto.framework.GraphDebugInfo.FileLineCol getFileLineCol(); + org.tensorflow.proto.GraphDebugInfo.FileLineCol getFileLineCol(); /** *
        * Stack frame, i.e., a frame of a stack trace, containing information
    @@ -54,5 +60,5 @@ public interface StackFrameWithIdOrBuilder extends
        *
        * .tensorflow.GraphDebugInfo.FileLineCol file_line_col = 2;
        */
    -  org.tensorflow.proto.framework.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder();
    +  org.tensorflow.proto.GraphDebugInfo.FileLineColOrBuilder getFileLineColOrBuilder();
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Status.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Status.java
    new file mode 100644
    index 00000000000..39e89e7969d
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Status.java
    @@ -0,0 +1,79 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/status.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class Status {
    +  private Status() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      Status.class.getName());
    +  }
    +  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_StatusProto_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_StatusProto_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_StatusProto_PayloadEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_StatusProto_PayloadEntry_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\035xla/tsl/protobuf/status.proto\022\ntensorf" +
    +      "low\032\"xla/tsl/protobuf/error_codes.proto\"" +
    +      "\253\001\n\013StatusProto\022$\n\004code\030\001 \001(\0162\026.tensorfl" +
    +      "ow.error.Code\022\017\n\007message\030\002 \001(\t\0225\n\007payloa" +
    +      "d\030\003 \003(\0132$.tensorflow.StatusProto.Payload" +
    +      "Entry\032.\n\014PayloadEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" +
    +      "lue\030\002 \001(\014:\0028\001B[\n\024org.tensorflow.protoP\001Z" +
    +      ">github.com/google/tsl/tsl/go/protobuf/f" +
    +      "or_core_protos_go_proto\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_StatusProto_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_StatusProto_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_StatusProto_descriptor,
    +        new java.lang.String[] { "Code", "Message", "Payload", });
    +    internal_static_tensorflow_StatusProto_PayloadEntry_descriptor =
    +      internal_static_tensorflow_StatusProto_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_StatusProto_PayloadEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_StatusProto_PayloadEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProto.java
    new file mode 100644
    index 00000000000..43cb0aec28b
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProto.java
    @@ -0,0 +1,991 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/status.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Wire-format for Status.
    + * Next tag: 4
    + * 
    + * + * Protobuf type {@code tensorflow.StatusProto} + */ +public final class StatusProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.StatusProto) + StatusProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StatusProto.class.getName()); + } + // Use StatusProto.newBuilder() to construct. + private StatusProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StatusProto() { + code_ = 0; + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetPayload(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StatusProto.class, org.tensorflow.proto.StatusProto.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + /** + *
    +   * Status code as defined in
    +   * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +   * 
    + * + * .tensorflow.error.Code code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override public int getCodeValue() { + return code_; + } + /** + *
    +   * Status code as defined in
    +   * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +   * 
    + * + * .tensorflow.error.Code code = 1; + * @return The code. + */ + @java.lang.Override public org.tensorflow.proto.error.Code getCode() { + org.tensorflow.proto.error.Code result = org.tensorflow.proto.error.Code.forNumber(code_); + return result == null ? org.tensorflow.proto.error.Code.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** + *
    +   * Detail error message.
    +   * 
    + * + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + *
    +   * Detail error message.
    +   * 
    + * + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYLOAD_FIELD_NUMBER = 3; + private static final class PayloadDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.protobuf.ByteString> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_PayloadEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.BYTES, + com.google.protobuf.ByteString.EMPTY); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.ByteString> payload_; + private com.google.protobuf.MapField + internalGetPayload() { + if (payload_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PayloadDefaultEntryHolder.defaultEntry); + } + return payload_; + } + public int getPayloadCount() { + return internalGetPayload().getMap().size(); + } + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public boolean containsPayload( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetPayload().getMap().containsKey(key); + } + /** + * Use {@link #getPayloadMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPayload() { + return getPayloadMap(); + } + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public java.util.Map getPayloadMap() { + return internalGetPayload().getMap(); + } + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public /* nullable */ +com.google.protobuf.ByteString getPayloadOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayload().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayload().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 (code_ != org.tensorflow.proto.error.Code.OK.getNumber()) { + output.writeEnum(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetPayload(), + PayloadDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != org.tensorflow.proto.error.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); + } + for (java.util.Map.Entry entry + : internalGetPayload().getMap().entrySet()) { + com.google.protobuf.MapEntry + payload__ = PayloadDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, payload__); + } + size += getUnknownFields().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.StatusProto)) { + return super.equals(obj); + } + org.tensorflow.proto.StatusProto other = (org.tensorflow.proto.StatusProto) obj; + + if (code_ != other.code_) return false; + if (!getMessage() + .equals(other.getMessage())) return false; + if (!internalGetPayload().equals( + other.internalGetPayload())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + if (!internalGetPayload().getMap().isEmpty()) { + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + internalGetPayload().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.StatusProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StatusProto 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.StatusProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StatusProto 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.StatusProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StatusProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.StatusProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StatusProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.StatusProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.StatusProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.StatusProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StatusProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.StatusProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Wire-format for Status.
    +   * Next tag: 4
    +   * 
    + * + * Protobuf type {@code tensorflow.StatusProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.StatusProto) + org.tensorflow.proto.StatusProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetPayload(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutablePayload(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StatusProto.class, org.tensorflow.proto.StatusProto.Builder.class); + } + + // Construct using org.tensorflow.proto.StatusProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + internalGetMutablePayload().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Status.internal_static_tensorflow_StatusProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.StatusProto getDefaultInstanceForType() { + return org.tensorflow.proto.StatusProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.StatusProto build() { + org.tensorflow.proto.StatusProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.StatusProto buildPartial() { + org.tensorflow.proto.StatusProto result = new org.tensorflow.proto.StatusProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.StatusProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.payload_ = internalGetPayload(); + result.payload_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.StatusProto) { + return mergeFrom((org.tensorflow.proto.StatusProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.StatusProto other) { + if (other == org.tensorflow.proto.StatusProto.getDefaultInstance()) return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutablePayload().mergeFrom( + other.internalGetPayload()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + code_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + payload__ = input.readMessage( + PayloadDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutablePayload().getMutableMap().put( + payload__.getKey(), payload__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int code_ = 0; + /** + *
    +     * Status code as defined in
    +     * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +     * 
    + * + * .tensorflow.error.Code code = 1; + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override public int getCodeValue() { + return code_; + } + /** + *
    +     * Status code as defined in
    +     * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +     * 
    + * + * .tensorflow.error.Code code = 1; + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Status code as defined in
    +     * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +     * 
    + * + * .tensorflow.error.Code code = 1; + * @return The code. + */ + @java.lang.Override + public org.tensorflow.proto.error.Code getCode() { + org.tensorflow.proto.error.Code result = org.tensorflow.proto.error.Code.forNumber(code_); + return result == null ? org.tensorflow.proto.error.Code.UNRECOGNIZED : result; + } + /** + *
    +     * Status code as defined in
    +     * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +     * 
    + * + * .tensorflow.error.Code code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(org.tensorflow.proto.error.Code value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Status code as defined in
    +     * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +     * 
    + * + * .tensorflow.error.Code code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + *
    +     * Detail error message.
    +     * 
    + * + * string message = 2; + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Detail error message.
    +     * 
    + * + * string message = 2; + * @return The bytes for message. + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Detail error message.
    +     * 
    + * + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Detail error message.
    +     * 
    + * + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Detail error message.
    +     * 
    + * + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.ByteString> payload_; + private com.google.protobuf.MapField + internalGetPayload() { + if (payload_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PayloadDefaultEntryHolder.defaultEntry); + } + return payload_; + } + private com.google.protobuf.MapField + internalGetMutablePayload() { + if (payload_ == null) { + payload_ = com.google.protobuf.MapField.newMapField( + PayloadDefaultEntryHolder.defaultEntry); + } + if (!payload_.isMutable()) { + payload_ = payload_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return payload_; + } + public int getPayloadCount() { + return internalGetPayload().getMap().size(); + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public boolean containsPayload( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetPayload().getMap().containsKey(key); + } + /** + * Use {@link #getPayloadMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPayload() { + return getPayloadMap(); + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public java.util.Map getPayloadMap() { + return internalGetPayload().getMap(); + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public /* nullable */ +com.google.protobuf.ByteString getPayloadOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayload().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayload().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutablePayload().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + public Builder removePayload( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutablePayload().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutablePayload() { + bitField0_ |= 0x00000004; + return internalGetMutablePayload().getMutableMap(); + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + public Builder putPayload( + java.lang.String key, + com.google.protobuf.ByteString value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutablePayload().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
    +     * Unique type URL -> value, like absl::Status payloads.
    +     * 
    + * + * map<string, bytes> payload = 3; + */ + public Builder putAllPayload( + java.util.Map values) { + internalGetMutablePayload().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.StatusProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.StatusProto) + private static final org.tensorflow.proto.StatusProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.StatusProto(); + } + + public static org.tensorflow.proto.StatusProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StatusProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StatusProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProtoOrBuilder.java new file mode 100644 index 00000000000..ca1ada631f8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StatusProtoOrBuilder.java @@ -0,0 +1,106 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/status.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface StatusProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.StatusProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Status code as defined in
    +   * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +   * 
    + * + * .tensorflow.error.Code code = 1; + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + *
    +   * Status code as defined in
    +   * tensorflow/compiler/xla/tsl/protobuf/error_codes.proto.
    +   * 
    + * + * .tensorflow.error.Code code = 1; + * @return The code. + */ + org.tensorflow.proto.error.Code getCode(); + + /** + *
    +   * Detail error message.
    +   * 
    + * + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + *
    +   * Detail error message.
    +   * 
    + * + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + int getPayloadCount(); + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + boolean containsPayload( + java.lang.String key); + /** + * Use {@link #getPayloadMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getPayload(); + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + java.util.Map + getPayloadMap(); + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + /* nullable */ +com.google.protobuf.ByteString getPayloadOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue); + /** + *
    +   * Unique type URL -> value, like absl::Status payloads.
    +   * 
    + * + * map<string, bytes> payload = 3; + */ + com.google.protobuf.ByteString getPayloadOrThrow( + java.lang.String key); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStats.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStats.java new file mode 100644 index 00000000000..2625199ba7b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStats.java @@ -0,0 +1,719 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.StepStats} + */ +public final class StepStats extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.StepStats) + StepStatsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StepStats.class.getName()); + } + // Use StepStats.newBuilder() to construct. + private StepStats(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StepStats() { + devStats_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_StepStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StepStats.class, org.tensorflow.proto.StepStats.Builder.class); + } + + public static final int DEV_STATS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List devStats_; + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + @java.lang.Override + public java.util.List getDevStatsList() { + return devStats_; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + @java.lang.Override + public java.util.List + getDevStatsOrBuilderList() { + return devStats_; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + @java.lang.Override + public int getDevStatsCount() { + return devStats_.size(); + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + @java.lang.Override + public org.tensorflow.proto.DeviceStepStats getDevStats(int index) { + return devStats_.get(index); + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + @java.lang.Override + public org.tensorflow.proto.DeviceStepStatsOrBuilder getDevStatsOrBuilder( + int index) { + return devStats_.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 { + for (int i = 0; i < devStats_.size(); i++) { + output.writeMessage(1, devStats_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < devStats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, devStats_.get(i)); + } + size += getUnknownFields().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.StepStats)) { + return super.equals(obj); + } + org.tensorflow.proto.StepStats other = (org.tensorflow.proto.StepStats) obj; + + if (!getDevStatsList() + .equals(other.getDevStatsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDevStatsCount() > 0) { + hash = (37 * hash) + DEV_STATS_FIELD_NUMBER; + hash = (53 * hash) + getDevStatsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.StepStats parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StepStats 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.StepStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StepStats 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.StepStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.StepStats parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.StepStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StepStats parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.StepStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.StepStats parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.StepStats parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.StepStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.StepStats 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.StepStats} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.StepStats) + org.tensorflow.proto.StepStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_StepStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.StepStats.class, org.tensorflow.proto.StepStats.Builder.class); + } + + // Construct using org.tensorflow.proto.StepStats.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (devStatsBuilder_ == null) { + devStats_ = java.util.Collections.emptyList(); + } else { + devStats_ = null; + devStatsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.StepStatsProtos.internal_static_tensorflow_StepStats_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.StepStats getDefaultInstanceForType() { + return org.tensorflow.proto.StepStats.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.StepStats build() { + org.tensorflow.proto.StepStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.StepStats buildPartial() { + org.tensorflow.proto.StepStats result = new org.tensorflow.proto.StepStats(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.StepStats result) { + if (devStatsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + devStats_ = java.util.Collections.unmodifiableList(devStats_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.devStats_ = devStats_; + } else { + result.devStats_ = devStatsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.StepStats result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.StepStats) { + return mergeFrom((org.tensorflow.proto.StepStats)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.StepStats other) { + if (other == org.tensorflow.proto.StepStats.getDefaultInstance()) return this; + if (devStatsBuilder_ == null) { + if (!other.devStats_.isEmpty()) { + if (devStats_.isEmpty()) { + devStats_ = other.devStats_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDevStatsIsMutable(); + devStats_.addAll(other.devStats_); + } + onChanged(); + } + } else { + if (!other.devStats_.isEmpty()) { + if (devStatsBuilder_.isEmpty()) { + devStatsBuilder_.dispose(); + devStatsBuilder_ = null; + devStats_ = other.devStats_; + bitField0_ = (bitField0_ & ~0x00000001); + devStatsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDevStatsFieldBuilder() : null; + } else { + devStatsBuilder_.addAllMessages(other.devStats_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.DeviceStepStats m = + input.readMessage( + org.tensorflow.proto.DeviceStepStats.parser(), + extensionRegistry); + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + devStats_.add(m); + } else { + devStatsBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List devStats_ = + java.util.Collections.emptyList(); + private void ensureDevStatsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + devStats_ = new java.util.ArrayList(devStats_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DeviceStepStats, org.tensorflow.proto.DeviceStepStats.Builder, org.tensorflow.proto.DeviceStepStatsOrBuilder> devStatsBuilder_; + + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public java.util.List getDevStatsList() { + if (devStatsBuilder_ == null) { + return java.util.Collections.unmodifiableList(devStats_); + } else { + return devStatsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public int getDevStatsCount() { + if (devStatsBuilder_ == null) { + return devStats_.size(); + } else { + return devStatsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public org.tensorflow.proto.DeviceStepStats getDevStats(int index) { + if (devStatsBuilder_ == null) { + return devStats_.get(index); + } else { + return devStatsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder setDevStats( + int index, org.tensorflow.proto.DeviceStepStats value) { + if (devStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevStatsIsMutable(); + devStats_.set(index, value); + onChanged(); + } else { + devStatsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder setDevStats( + int index, org.tensorflow.proto.DeviceStepStats.Builder builderForValue) { + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + devStats_.set(index, builderForValue.build()); + onChanged(); + } else { + devStatsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder addDevStats(org.tensorflow.proto.DeviceStepStats value) { + if (devStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevStatsIsMutable(); + devStats_.add(value); + onChanged(); + } else { + devStatsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder addDevStats( + int index, org.tensorflow.proto.DeviceStepStats value) { + if (devStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevStatsIsMutable(); + devStats_.add(index, value); + onChanged(); + } else { + devStatsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder addDevStats( + org.tensorflow.proto.DeviceStepStats.Builder builderForValue) { + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + devStats_.add(builderForValue.build()); + onChanged(); + } else { + devStatsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder addDevStats( + int index, org.tensorflow.proto.DeviceStepStats.Builder builderForValue) { + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + devStats_.add(index, builderForValue.build()); + onChanged(); + } else { + devStatsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder addAllDevStats( + java.lang.Iterable values) { + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, devStats_); + onChanged(); + } else { + devStatsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder clearDevStats() { + if (devStatsBuilder_ == null) { + devStats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + devStatsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public Builder removeDevStats(int index) { + if (devStatsBuilder_ == null) { + ensureDevStatsIsMutable(); + devStats_.remove(index); + onChanged(); + } else { + devStatsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public org.tensorflow.proto.DeviceStepStats.Builder getDevStatsBuilder( + int index) { + return getDevStatsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public org.tensorflow.proto.DeviceStepStatsOrBuilder getDevStatsOrBuilder( + int index) { + if (devStatsBuilder_ == null) { + return devStats_.get(index); } else { + return devStatsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public java.util.List + getDevStatsOrBuilderList() { + if (devStatsBuilder_ != null) { + return devStatsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(devStats_); + } + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public org.tensorflow.proto.DeviceStepStats.Builder addDevStatsBuilder() { + return getDevStatsFieldBuilder().addBuilder( + org.tensorflow.proto.DeviceStepStats.getDefaultInstance()); + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public org.tensorflow.proto.DeviceStepStats.Builder addDevStatsBuilder( + int index) { + return getDevStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.DeviceStepStats.getDefaultInstance()); + } + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + public java.util.List + getDevStatsBuilderList() { + return getDevStatsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DeviceStepStats, org.tensorflow.proto.DeviceStepStats.Builder, org.tensorflow.proto.DeviceStepStatsOrBuilder> + getDevStatsFieldBuilder() { + if (devStatsBuilder_ == null) { + devStatsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.DeviceStepStats, org.tensorflow.proto.DeviceStepStats.Builder, org.tensorflow.proto.DeviceStepStatsOrBuilder>( + devStats_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + devStats_ = null; + } + return devStatsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.StepStats) + } + + // @@protoc_insertion_point(class_scope:tensorflow.StepStats) + private static final org.tensorflow.proto.StepStats DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.StepStats(); + } + + public static org.tensorflow.proto.StepStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StepStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.StepStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsOrBuilder.java new file mode 100644 index 00000000000..3accebd26e9 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface StepStatsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.StepStats) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + java.util.List + getDevStatsList(); + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + org.tensorflow.proto.DeviceStepStats getDevStats(int index); + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + int getDevStatsCount(); + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + java.util.List + getDevStatsOrBuilderList(); + /** + * repeated .tensorflow.DeviceStepStats dev_stats = 1; + */ + org.tensorflow.proto.DeviceStepStatsOrBuilder getDevStatsOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsProtos.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsProtos.java index 15ef4a6b554..859a9f24f42 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/StepStatsProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/StepStatsProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/step_stats.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class StepStatsProtos { private StepStatsProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StepStatsProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,42 +28,42 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_AllocationRecord_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_AllocationRecord_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_AllocatorMemoryUsed_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_NodeOutput_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_NodeOutput_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_MemoryStats_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_MemoryStats_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_NodeExecStats_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_NodeExecStats_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DeviceStepStats_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DeviceStepStats_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_StepStats_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_StepStats_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -102,67 +113,68 @@ public static void registerAllExtensions( "mesEntry\0322\n\020ThreadNamesEntry\022\013\n\003key\030\001 \001(" + "\r\022\r\n\005value\030\002 \001(\t:\0028\001\";\n\tStepStats\022.\n\tdev" + "_stats\030\001 \003(\0132\033.tensorflow.DeviceStepStat" + - "sB\211\001\n\036org.tensorflow.proto.frameworkB\017St" + - "epStatsProtosP\001ZQgithub.com/tensorflow/t" + - "ensorflow/tensorflow/go/core/framework/s" + - "tep_stats_go_proto\370\001\001b\006proto3" + "sB\177\n\024org.tensorflow.protoB\017StepStatsProt" + + "osP\001ZQgithub.com/tensorflow/tensorflow/t" + + "ensorflow/go/core/framework/step_stats_g" + + "o_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.tensorflow.proto.framework.AllocationDescriptionProtos.getDescriptor(), - org.tensorflow.proto.framework.TensorDescriptionProtos.getDescriptor(), + org.tensorflow.proto.AllocationDescriptionProtos.getDescriptor(), + org.tensorflow.proto.TensorDescriptionProtos.getDescriptor(), }); internal_static_tensorflow_AllocationRecord_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_AllocationRecord_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_AllocationRecord_descriptor, new java.lang.String[] { "AllocMicros", "AllocBytes", }); internal_static_tensorflow_AllocatorMemoryUsed_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_AllocatorMemoryUsed_descriptor, new java.lang.String[] { "AllocatorName", "TotalBytes", "PeakBytes", "LiveBytes", "AllocationRecords", "AllocatorBytesInUse", }); internal_static_tensorflow_NodeOutput_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_tensorflow_NodeOutput_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_NodeOutput_descriptor, new java.lang.String[] { "Slot", "TensorDescription", }); internal_static_tensorflow_MemoryStats_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_tensorflow_MemoryStats_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_MemoryStats_descriptor, new java.lang.String[] { "TempMemorySize", "PersistentMemorySize", "PersistentTensorAllocIds", "DeviceTempMemorySize", "DevicePersistentMemorySize", "DevicePersistentTensorAllocIds", }); internal_static_tensorflow_NodeExecStats_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_tensorflow_NodeExecStats_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_NodeExecStats_descriptor, new java.lang.String[] { "NodeName", "AllStartMicros", "OpStartRelMicros", "OpEndRelMicros", "AllEndRelMicros", "Memory", "Output", "TimelineLabel", "ScheduledMicros", "ThreadId", "ReferencedTensor", "MemoryStats", "AllStartNanos", "OpStartRelNanos", "OpEndRelNanos", "AllEndRelNanos", "ScheduledNanos", }); internal_static_tensorflow_DeviceStepStats_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_tensorflow_DeviceStepStats_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DeviceStepStats_descriptor, new java.lang.String[] { "Device", "NodeStats", "ThreadNames", }); internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor = internal_static_tensorflow_DeviceStepStats_descriptor.getNestedTypes().get(0); internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_tensorflow_StepStats_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_tensorflow_StepStats_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_StepStats_descriptor, new java.lang.String[] { "DevStats", }); - org.tensorflow.proto.framework.AllocationDescriptionProtos.getDescriptor(); - org.tensorflow.proto.framework.TensorDescriptionProtos.getDescriptor(); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AllocationDescriptionProtos.getDescriptor(); + org.tensorflow.proto.TensorDescriptionProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Struct.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Struct.java new file mode 100644 index 00000000000..4c87522127d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Struct.java @@ -0,0 +1,12390 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/struct.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class Struct { + private Struct() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Struct.class.getName()); + } + 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 StructuredValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.StructuredValue) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return Whether the noneValue field is set. + */ + boolean hasNoneValue(); + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return The noneValue. + */ + org.tensorflow.proto.Struct.NoneValue getNoneValue(); + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + org.tensorflow.proto.Struct.NoneValueOrBuilder getNoneValueOrBuilder(); + + /** + *
    +     * Represents a double-precision floating-point value (a Python `float`).
    +     * 
    + * + * double float64_value = 11; + * @return Whether the float64Value field is set. + */ + boolean hasFloat64Value(); + /** + *
    +     * Represents a double-precision floating-point value (a Python `float`).
    +     * 
    + * + * double float64_value = 11; + * @return The float64Value. + */ + double getFloat64Value(); + + /** + *
    +     * Represents a signed integer value, limited to 64 bits.
    +     * Larger values from Python's arbitrary-precision integers are unsupported.
    +     * 
    + * + * sint64 int64_value = 12; + * @return Whether the int64Value field is set. + */ + boolean hasInt64Value(); + /** + *
    +     * Represents a signed integer value, limited to 64 bits.
    +     * Larger values from Python's arbitrary-precision integers are unsupported.
    +     * 
    + * + * sint64 int64_value = 12; + * @return The int64Value. + */ + long getInt64Value(); + + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + /** + *
    +     * Represents a boolean value.
    +     * 
    + * + * bool bool_value = 14; + * @return Whether the boolValue field is set. + */ + boolean hasBoolValue(); + /** + *
    +     * Represents a boolean value.
    +     * 
    + * + * bool bool_value = 14; + * @return The boolValue. + */ + boolean getBoolValue(); + + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return Whether the tensorShapeValue field is set. + */ + boolean hasTensorShapeValue(); + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return The tensorShapeValue. + */ + org.tensorflow.proto.TensorShapeProto getTensorShapeValue(); + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder(); + + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return Whether the tensorDtypeValue field is set. + */ + boolean hasTensorDtypeValue(); + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The enum numeric value on the wire for tensorDtypeValue. + */ + int getTensorDtypeValueValue(); + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The tensorDtypeValue. + */ + org.tensorflow.proto.DataType getTensorDtypeValue(); + + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return Whether the tensorSpecValue field is set. + */ + boolean hasTensorSpecValue(); + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return The tensorSpecValue. + */ + org.tensorflow.proto.Struct.TensorSpecProto getTensorSpecValue(); + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder(); + + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return Whether the typeSpecValue field is set. + */ + boolean hasTypeSpecValue(); + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return The typeSpecValue. + */ + org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecValue(); + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder(); + + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return Whether the boundedTensorSpecValue field is set. + */ + boolean hasBoundedTensorSpecValue(); + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return The boundedTensorSpecValue. + */ + org.tensorflow.proto.Struct.BoundedTensorSpecProto getBoundedTensorSpecValue(); + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder(); + + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return Whether the listValue field is set. + */ + boolean hasListValue(); + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return The listValue. + */ + org.tensorflow.proto.Struct.ListValue getListValue(); + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + org.tensorflow.proto.Struct.ListValueOrBuilder getListValueOrBuilder(); + + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return Whether the tupleValue field is set. + */ + boolean hasTupleValue(); + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return The tupleValue. + */ + org.tensorflow.proto.Struct.TupleValue getTupleValue(); + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + org.tensorflow.proto.Struct.TupleValueOrBuilder getTupleValueOrBuilder(); + + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return Whether the dictValue field is set. + */ + boolean hasDictValue(); + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return The dictValue. + */ + org.tensorflow.proto.Struct.DictValue getDictValue(); + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + org.tensorflow.proto.Struct.DictValueOrBuilder getDictValueOrBuilder(); + + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return Whether the namedTupleValue field is set. + */ + boolean hasNamedTupleValue(); + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return The namedTupleValue. + */ + org.tensorflow.proto.Struct.NamedTupleValue getNamedTupleValue(); + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + org.tensorflow.proto.Struct.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder(); + + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return Whether the tensorValue field is set. + */ + boolean hasTensorValue(); + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return The tensorValue. + */ + org.tensorflow.proto.TensorProto getTensorValue(); + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + org.tensorflow.proto.TensorProtoOrBuilder getTensorValueOrBuilder(); + + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return Whether the numpyValue field is set. + */ + boolean hasNumpyValue(); + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return The numpyValue. + */ + org.tensorflow.proto.TensorProto getNumpyValue(); + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + org.tensorflow.proto.TensorProtoOrBuilder getNumpyValueOrBuilder(); + + org.tensorflow.proto.Struct.StructuredValue.KindCase getKindCase(); + } + /** + *
    +   * `StructuredValue` represents a dynamically typed value representing various
    +   * data structures that are inspired by Python data structures typically used in
    +   * TensorFlow functions as inputs and outputs.
    +   *
    +   * For example when saving a Layer there may be a `training` argument. If the
    +   * user passes a boolean True/False, that switches between two concrete
    +   * TensorFlow functions. In order to switch between them in the same way after
    +   * loading the SavedModel, we need to represent "True" and "False".
    +   *
    +   * A more advanced example might be a function which takes a list of
    +   * dictionaries mapping from strings to Tensors. In order to map from
    +   * user-specified arguments `[{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]`
    +   * after load to the right saved TensorFlow function, we need to represent the
    +   * nested structure and the strings, recording that we have a trace for anything
    +   * matching `[{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([],
    +   * tf.float64)}]` as an example.
    +   *
    +   * Likewise functions may return nested structures of Tensors, for example
    +   * returning a dictionary mapping from strings to Tensors. In order for the
    +   * loaded function to return the same structure we need to serialize it.
    +   *
    +   * This is an ergonomic aid for working with loaded SavedModels, not a promise
    +   * to serialize all possible function signatures. For example we do not expect
    +   * to pickle generic Python objects, and ideally we'd stay language-agnostic.
    +   * 
    + * + * Protobuf type {@code tensorflow.StructuredValue} + */ + public static final class StructuredValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.StructuredValue) + StructuredValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + StructuredValue.class.getName()); + } + // Use StructuredValue.newBuilder() to construct. + private StructuredValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StructuredValue() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_StructuredValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_StructuredValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.StructuredValue.class, org.tensorflow.proto.Struct.StructuredValue.Builder.class); + } + + private int kindCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object kind_; + public enum KindCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NONE_VALUE(1), + FLOAT64_VALUE(11), + INT64_VALUE(12), + STRING_VALUE(13), + BOOL_VALUE(14), + TENSOR_SHAPE_VALUE(31), + TENSOR_DTYPE_VALUE(32), + TENSOR_SPEC_VALUE(33), + TYPE_SPEC_VALUE(34), + BOUNDED_TENSOR_SPEC_VALUE(35), + LIST_VALUE(51), + TUPLE_VALUE(52), + DICT_VALUE(53), + NAMED_TUPLE_VALUE(54), + TENSOR_VALUE(55), + NUMPY_VALUE(56), + KIND_NOT_SET(0); + private final int value; + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: return NONE_VALUE; + case 11: return FLOAT64_VALUE; + case 12: return INT64_VALUE; + case 13: return STRING_VALUE; + case 14: return BOOL_VALUE; + case 31: return TENSOR_SHAPE_VALUE; + case 32: return TENSOR_DTYPE_VALUE; + case 33: return TENSOR_SPEC_VALUE; + case 34: return TYPE_SPEC_VALUE; + case 35: return BOUNDED_TENSOR_SPEC_VALUE; + case 51: return LIST_VALUE; + case 52: return TUPLE_VALUE; + case 53: return DICT_VALUE; + case 54: return NAMED_TUPLE_VALUE; + case 55: return TENSOR_VALUE; + case 56: return NUMPY_VALUE; + case 0: return KIND_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public static final int NONE_VALUE_FIELD_NUMBER = 1; + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return Whether the noneValue field is set. + */ + @java.lang.Override + public boolean hasNoneValue() { + return kindCase_ == 1; + } + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return The noneValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValue getNoneValue() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.Struct.NoneValue) kind_; + } + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + /** + *
    +     * Represents None.
    +     * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValueOrBuilder getNoneValueOrBuilder() { + if (kindCase_ == 1) { + return (org.tensorflow.proto.Struct.NoneValue) kind_; + } + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + + public static final int FLOAT64_VALUE_FIELD_NUMBER = 11; + /** + *
    +     * Represents a double-precision floating-point value (a Python `float`).
    +     * 
    + * + * double float64_value = 11; + * @return Whether the float64Value field is set. + */ + @java.lang.Override + public boolean hasFloat64Value() { + return kindCase_ == 11; + } + /** + *
    +     * Represents a double-precision floating-point value (a Python `float`).
    +     * 
    + * + * double float64_value = 11; + * @return The float64Value. + */ + @java.lang.Override + public double getFloat64Value() { + if (kindCase_ == 11) { + return (java.lang.Double) kind_; + } + return 0D; + } + + public static final int INT64_VALUE_FIELD_NUMBER = 12; + /** + *
    +     * Represents a signed integer value, limited to 64 bits.
    +     * Larger values from Python's arbitrary-precision integers are unsupported.
    +     * 
    + * + * sint64 int64_value = 12; + * @return Whether the int64Value field is set. + */ + @java.lang.Override + public boolean hasInt64Value() { + return kindCase_ == 12; + } + /** + *
    +     * Represents a signed integer value, limited to 64 bits.
    +     * Larger values from Python's arbitrary-precision integers are unsupported.
    +     * 
    + * + * sint64 int64_value = 12; + * @return The int64Value. + */ + @java.lang.Override + public long getInt64Value() { + if (kindCase_ == 12) { + return (java.lang.Long) kind_; + } + return 0L; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 13; + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return kindCase_ == 13; + } + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 13) { + ref = kind_; + } + 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(); + if (kindCase_ == 13) { + kind_ = s; + } + return s; + } + } + /** + *
    +     * Represents a string of Unicode characters stored in a Python `str`.
    +     * In Python 3, this is exactly what type `str` is.
    +     * In Python 2, this is the UTF-8 encoding of the characters.
    +     * For strings with ASCII characters only (as often used in TensorFlow code)
    +     * there is effectively no difference between the language versions.
    +     * The obsolescent `unicode` type of Python 2 is not supported here.
    +     * 
    + * + * string string_value = 13; + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 13) { + ref = kind_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (kindCase_ == 13) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOL_VALUE_FIELD_NUMBER = 14; + /** + *
    +     * Represents a boolean value.
    +     * 
    + * + * bool bool_value = 14; + * @return Whether the boolValue field is set. + */ + @java.lang.Override + public boolean hasBoolValue() { + return kindCase_ == 14; + } + /** + *
    +     * Represents a boolean value.
    +     * 
    + * + * bool bool_value = 14; + * @return The boolValue. + */ + @java.lang.Override + public boolean getBoolValue() { + if (kindCase_ == 14) { + return (java.lang.Boolean) kind_; + } + return false; + } + + public static final int TENSOR_SHAPE_VALUE_FIELD_NUMBER = 31; + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return Whether the tensorShapeValue field is set. + */ + @java.lang.Override + public boolean hasTensorShapeValue() { + return kindCase_ == 31; + } + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return The tensorShapeValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShapeValue() { + if (kindCase_ == 31) { + return (org.tensorflow.proto.TensorShapeProto) kind_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + /** + *
    +     * Represents a TensorShape.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder() { + if (kindCase_ == 31) { + return (org.tensorflow.proto.TensorShapeProto) kind_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + + public static final int TENSOR_DTYPE_VALUE_FIELD_NUMBER = 32; + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return Whether the tensorDtypeValue field is set. + */ + public boolean hasTensorDtypeValue() { + return kindCase_ == 32; + } + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The enum numeric value on the wire for tensorDtypeValue. + */ + public int getTensorDtypeValueValue() { + if (kindCase_ == 32) { + return (java.lang.Integer) kind_; + } + return 0; + } + /** + *
    +     * Represents an enum value for dtype.
    +     * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The tensorDtypeValue. + */ + public org.tensorflow.proto.DataType getTensorDtypeValue() { + if (kindCase_ == 32) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber( + (java.lang.Integer) kind_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + return org.tensorflow.proto.DataType.DT_INVALID; + } + + public static final int TENSOR_SPEC_VALUE_FIELD_NUMBER = 33; + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return Whether the tensorSpecValue field is set. + */ + @java.lang.Override + public boolean hasTensorSpecValue() { + return kindCase_ == 33; + } + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return The tensorSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProto getTensorSpecValue() { + if (kindCase_ == 33) { + return (org.tensorflow.proto.Struct.TensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + /** + *
    +     * Represents a value for tf.TensorSpec.
    +     * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder() { + if (kindCase_ == 33) { + return (org.tensorflow.proto.Struct.TensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + + public static final int TYPE_SPEC_VALUE_FIELD_NUMBER = 34; + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return Whether the typeSpecValue field is set. + */ + @java.lang.Override + public boolean hasTypeSpecValue() { + return kindCase_ == 34; + } + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return The typeSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecValue() { + if (kindCase_ == 34) { + return (org.tensorflow.proto.Struct.TypeSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + /** + *
    +     * Represents a value for tf.TypeSpec.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder() { + if (kindCase_ == 34) { + return (org.tensorflow.proto.Struct.TypeSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + + public static final int BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER = 35; + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return Whether the boundedTensorSpecValue field is set. + */ + @java.lang.Override + public boolean hasBoundedTensorSpecValue() { + return kindCase_ == 35; + } + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return The boundedTensorSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProto getBoundedTensorSpecValue() { + if (kindCase_ == 35) { + return (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + /** + *
    +     * Represents a value for tf.BoundedTensorSpec.
    +     * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder() { + if (kindCase_ == 35) { + return (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + + public static final int LIST_VALUE_FIELD_NUMBER = 51; + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return Whether the listValue field is set. + */ + @java.lang.Override + public boolean hasListValue() { + return kindCase_ == 51; + } + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return The listValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.ListValue getListValue() { + if (kindCase_ == 51) { + return (org.tensorflow.proto.Struct.ListValue) kind_; + } + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + /** + *
    +     * Represents a list of `Value`.
    +     * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.ListValueOrBuilder getListValueOrBuilder() { + if (kindCase_ == 51) { + return (org.tensorflow.proto.Struct.ListValue) kind_; + } + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + + public static final int TUPLE_VALUE_FIELD_NUMBER = 52; + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return Whether the tupleValue field is set. + */ + @java.lang.Override + public boolean hasTupleValue() { + return kindCase_ == 52; + } + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return The tupleValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValue getTupleValue() { + if (kindCase_ == 52) { + return (org.tensorflow.proto.Struct.TupleValue) kind_; + } + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + /** + *
    +     * Represents a tuple of `Value`.
    +     * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValueOrBuilder getTupleValueOrBuilder() { + if (kindCase_ == 52) { + return (org.tensorflow.proto.Struct.TupleValue) kind_; + } + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + + public static final int DICT_VALUE_FIELD_NUMBER = 53; + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return Whether the dictValue field is set. + */ + @java.lang.Override + public boolean hasDictValue() { + return kindCase_ == 53; + } + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return The dictValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.DictValue getDictValue() { + if (kindCase_ == 53) { + return (org.tensorflow.proto.Struct.DictValue) kind_; + } + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + /** + *
    +     * Represents a dict `Value`.
    +     * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.DictValueOrBuilder getDictValueOrBuilder() { + if (kindCase_ == 53) { + return (org.tensorflow.proto.Struct.DictValue) kind_; + } + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + + public static final int NAMED_TUPLE_VALUE_FIELD_NUMBER = 54; + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return Whether the namedTupleValue field is set. + */ + @java.lang.Override + public boolean hasNamedTupleValue() { + return kindCase_ == 54; + } + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return The namedTupleValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValue getNamedTupleValue() { + if (kindCase_ == 54) { + return (org.tensorflow.proto.Struct.NamedTupleValue) kind_; + } + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder() { + if (kindCase_ == 54) { + return (org.tensorflow.proto.Struct.NamedTupleValue) kind_; + } + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + + public static final int TENSOR_VALUE_FIELD_NUMBER = 55; + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return Whether the tensorValue field is set. + */ + @java.lang.Override + public boolean hasTensorValue() { + return kindCase_ == 55; + } + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return The tensorValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensorValue() { + if (kindCase_ == 55) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + /** + *
    +     * Represents a value for tf.Tensor.
    +     * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorValueOrBuilder() { + if (kindCase_ == 55) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + + public static final int NUMPY_VALUE_FIELD_NUMBER = 56; + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return Whether the numpyValue field is set. + */ + @java.lang.Override + public boolean hasNumpyValue() { + return kindCase_ == 56; + } + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return The numpyValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getNumpyValue() { + if (kindCase_ == 56) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + /** + *
    +     * Represents a value for np.ndarray.
    +     * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getNumpyValueOrBuilder() { + if (kindCase_ == 56) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (org.tensorflow.proto.Struct.NoneValue) kind_); + } + if (kindCase_ == 11) { + output.writeDouble( + 11, (double)((java.lang.Double) kind_)); + } + if (kindCase_ == 12) { + output.writeSInt64( + 12, (long)((java.lang.Long) kind_)); + } + if (kindCase_ == 13) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, kind_); + } + if (kindCase_ == 14) { + output.writeBool( + 14, (boolean)((java.lang.Boolean) kind_)); + } + if (kindCase_ == 31) { + output.writeMessage(31, (org.tensorflow.proto.TensorShapeProto) kind_); + } + if (kindCase_ == 32) { + output.writeEnum(32, ((java.lang.Integer) kind_)); + } + if (kindCase_ == 33) { + output.writeMessage(33, (org.tensorflow.proto.Struct.TensorSpecProto) kind_); + } + if (kindCase_ == 34) { + output.writeMessage(34, (org.tensorflow.proto.Struct.TypeSpecProto) kind_); + } + if (kindCase_ == 35) { + output.writeMessage(35, (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_); + } + if (kindCase_ == 51) { + output.writeMessage(51, (org.tensorflow.proto.Struct.ListValue) kind_); + } + if (kindCase_ == 52) { + output.writeMessage(52, (org.tensorflow.proto.Struct.TupleValue) kind_); + } + if (kindCase_ == 53) { + output.writeMessage(53, (org.tensorflow.proto.Struct.DictValue) kind_); + } + if (kindCase_ == 54) { + output.writeMessage(54, (org.tensorflow.proto.Struct.NamedTupleValue) kind_); + } + if (kindCase_ == 55) { + output.writeMessage(55, (org.tensorflow.proto.TensorProto) kind_); + } + if (kindCase_ == 56) { + output.writeMessage(56, (org.tensorflow.proto.TensorProto) kind_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (org.tensorflow.proto.Struct.NoneValue) kind_); + } + if (kindCase_ == 11) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize( + 11, (double)((java.lang.Double) kind_)); + } + if (kindCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size( + 12, (long)((java.lang.Long) kind_)); + } + if (kindCase_ == 13) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, kind_); + } + if (kindCase_ == 14) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 14, (boolean)((java.lang.Boolean) kind_)); + } + if (kindCase_ == 31) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(31, (org.tensorflow.proto.TensorShapeProto) kind_); + } + if (kindCase_ == 32) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(32, ((java.lang.Integer) kind_)); + } + if (kindCase_ == 33) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(33, (org.tensorflow.proto.Struct.TensorSpecProto) kind_); + } + if (kindCase_ == 34) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(34, (org.tensorflow.proto.Struct.TypeSpecProto) kind_); + } + if (kindCase_ == 35) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(35, (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_); + } + if (kindCase_ == 51) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(51, (org.tensorflow.proto.Struct.ListValue) kind_); + } + if (kindCase_ == 52) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(52, (org.tensorflow.proto.Struct.TupleValue) kind_); + } + if (kindCase_ == 53) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(53, (org.tensorflow.proto.Struct.DictValue) kind_); + } + if (kindCase_ == 54) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(54, (org.tensorflow.proto.Struct.NamedTupleValue) kind_); + } + if (kindCase_ == 55) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(55, (org.tensorflow.proto.TensorProto) kind_); + } + if (kindCase_ == 56) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(56, (org.tensorflow.proto.TensorProto) kind_); + } + size += getUnknownFields().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.Struct.StructuredValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.StructuredValue other = (org.tensorflow.proto.Struct.StructuredValue) obj; + + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getNoneValue() + .equals(other.getNoneValue())) return false; + break; + case 11: + if (java.lang.Double.doubleToLongBits(getFloat64Value()) + != java.lang.Double.doubleToLongBits( + other.getFloat64Value())) return false; + break; + case 12: + if (getInt64Value() + != other.getInt64Value()) return false; + break; + case 13: + if (!getStringValue() + .equals(other.getStringValue())) return false; + break; + case 14: + if (getBoolValue() + != other.getBoolValue()) return false; + break; + case 31: + if (!getTensorShapeValue() + .equals(other.getTensorShapeValue())) return false; + break; + case 32: + if (getTensorDtypeValueValue() + != other.getTensorDtypeValueValue()) return false; + break; + case 33: + if (!getTensorSpecValue() + .equals(other.getTensorSpecValue())) return false; + break; + case 34: + if (!getTypeSpecValue() + .equals(other.getTypeSpecValue())) return false; + break; + case 35: + if (!getBoundedTensorSpecValue() + .equals(other.getBoundedTensorSpecValue())) return false; + break; + case 51: + if (!getListValue() + .equals(other.getListValue())) return false; + break; + case 52: + if (!getTupleValue() + .equals(other.getTupleValue())) return false; + break; + case 53: + if (!getDictValue() + .equals(other.getDictValue())) return false; + break; + case 54: + if (!getNamedTupleValue() + .equals(other.getNamedTupleValue())) return false; + break; + case 55: + if (!getTensorValue() + .equals(other.getTensorValue())) return false; + break; + case 56: + if (!getNumpyValue() + .equals(other.getNumpyValue())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (kindCase_) { + case 1: + hash = (37 * hash) + NONE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNoneValue().hashCode(); + break; + case 11: + hash = (37 * hash) + FLOAT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFloat64Value())); + break; + case 12: + hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInt64Value()); + break; + case 13: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 14: + hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolValue()); + break; + case 31: + hash = (37 * hash) + TENSOR_SHAPE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTensorShapeValue().hashCode(); + break; + case 32: + hash = (37 * hash) + TENSOR_DTYPE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTensorDtypeValueValue(); + break; + case 33: + hash = (37 * hash) + TENSOR_SPEC_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTensorSpecValue().hashCode(); + break; + case 34: + hash = (37 * hash) + TYPE_SPEC_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTypeSpecValue().hashCode(); + break; + case 35: + hash = (37 * hash) + BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getBoundedTensorSpecValue().hashCode(); + break; + case 51: + hash = (37 * hash) + LIST_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getListValue().hashCode(); + break; + case 52: + hash = (37 * hash) + TUPLE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTupleValue().hashCode(); + break; + case 53: + hash = (37 * hash) + DICT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getDictValue().hashCode(); + break; + case 54: + hash = (37 * hash) + NAMED_TUPLE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNamedTupleValue().hashCode(); + break; + case 55: + hash = (37 * hash) + TENSOR_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTensorValue().hashCode(); + break; + case 56: + hash = (37 * hash) + NUMPY_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getNumpyValue().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.StructuredValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.StructuredValue 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.Struct.StructuredValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.StructuredValue 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.Struct.StructuredValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.StructuredValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.StructuredValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.StructuredValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.StructuredValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.StructuredValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.StructuredValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.StructuredValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.StructuredValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * `StructuredValue` represents a dynamically typed value representing various
    +     * data structures that are inspired by Python data structures typically used in
    +     * TensorFlow functions as inputs and outputs.
    +     *
    +     * For example when saving a Layer there may be a `training` argument. If the
    +     * user passes a boolean True/False, that switches between two concrete
    +     * TensorFlow functions. In order to switch between them in the same way after
    +     * loading the SavedModel, we need to represent "True" and "False".
    +     *
    +     * A more advanced example might be a function which takes a list of
    +     * dictionaries mapping from strings to Tensors. In order to map from
    +     * user-specified arguments `[{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]`
    +     * after load to the right saved TensorFlow function, we need to represent the
    +     * nested structure and the strings, recording that we have a trace for anything
    +     * matching `[{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([],
    +     * tf.float64)}]` as an example.
    +     *
    +     * Likewise functions may return nested structures of Tensors, for example
    +     * returning a dictionary mapping from strings to Tensors. In order for the
    +     * loaded function to return the same structure we need to serialize it.
    +     *
    +     * This is an ergonomic aid for working with loaded SavedModels, not a promise
    +     * to serialize all possible function signatures. For example we do not expect
    +     * to pickle generic Python objects, and ideally we'd stay language-agnostic.
    +     * 
    + * + * Protobuf type {@code tensorflow.StructuredValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.StructuredValue) + org.tensorflow.proto.Struct.StructuredValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_StructuredValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_StructuredValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.StructuredValue.class, org.tensorflow.proto.Struct.StructuredValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.StructuredValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (noneValueBuilder_ != null) { + noneValueBuilder_.clear(); + } + if (tensorShapeValueBuilder_ != null) { + tensorShapeValueBuilder_.clear(); + } + if (tensorSpecValueBuilder_ != null) { + tensorSpecValueBuilder_.clear(); + } + if (typeSpecValueBuilder_ != null) { + typeSpecValueBuilder_.clear(); + } + if (boundedTensorSpecValueBuilder_ != null) { + boundedTensorSpecValueBuilder_.clear(); + } + if (listValueBuilder_ != null) { + listValueBuilder_.clear(); + } + if (tupleValueBuilder_ != null) { + tupleValueBuilder_.clear(); + } + if (dictValueBuilder_ != null) { + dictValueBuilder_.clear(); + } + if (namedTupleValueBuilder_ != null) { + namedTupleValueBuilder_.clear(); + } + if (tensorValueBuilder_ != null) { + tensorValueBuilder_.clear(); + } + if (numpyValueBuilder_ != null) { + numpyValueBuilder_.clear(); + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_StructuredValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue build() { + org.tensorflow.proto.Struct.StructuredValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue buildPartial() { + org.tensorflow.proto.Struct.StructuredValue result = new org.tensorflow.proto.Struct.StructuredValue(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.StructuredValue result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.Struct.StructuredValue result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && + noneValueBuilder_ != null) { + result.kind_ = noneValueBuilder_.build(); + } + if (kindCase_ == 31 && + tensorShapeValueBuilder_ != null) { + result.kind_ = tensorShapeValueBuilder_.build(); + } + if (kindCase_ == 33 && + tensorSpecValueBuilder_ != null) { + result.kind_ = tensorSpecValueBuilder_.build(); + } + if (kindCase_ == 34 && + typeSpecValueBuilder_ != null) { + result.kind_ = typeSpecValueBuilder_.build(); + } + if (kindCase_ == 35 && + boundedTensorSpecValueBuilder_ != null) { + result.kind_ = boundedTensorSpecValueBuilder_.build(); + } + if (kindCase_ == 51 && + listValueBuilder_ != null) { + result.kind_ = listValueBuilder_.build(); + } + if (kindCase_ == 52 && + tupleValueBuilder_ != null) { + result.kind_ = tupleValueBuilder_.build(); + } + if (kindCase_ == 53 && + dictValueBuilder_ != null) { + result.kind_ = dictValueBuilder_.build(); + } + if (kindCase_ == 54 && + namedTupleValueBuilder_ != null) { + result.kind_ = namedTupleValueBuilder_.build(); + } + if (kindCase_ == 55 && + tensorValueBuilder_ != null) { + result.kind_ = tensorValueBuilder_.build(); + } + if (kindCase_ == 56 && + numpyValueBuilder_ != null) { + result.kind_ = numpyValueBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.StructuredValue) { + return mergeFrom((org.tensorflow.proto.Struct.StructuredValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.StructuredValue other) { + if (other == org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) return this; + switch (other.getKindCase()) { + case NONE_VALUE: { + mergeNoneValue(other.getNoneValue()); + break; + } + case FLOAT64_VALUE: { + setFloat64Value(other.getFloat64Value()); + break; + } + case INT64_VALUE: { + setInt64Value(other.getInt64Value()); + break; + } + case STRING_VALUE: { + kindCase_ = 13; + kind_ = other.kind_; + onChanged(); + break; + } + case BOOL_VALUE: { + setBoolValue(other.getBoolValue()); + break; + } + case TENSOR_SHAPE_VALUE: { + mergeTensorShapeValue(other.getTensorShapeValue()); + break; + } + case TENSOR_DTYPE_VALUE: { + setTensorDtypeValueValue(other.getTensorDtypeValueValue()); + break; + } + case TENSOR_SPEC_VALUE: { + mergeTensorSpecValue(other.getTensorSpecValue()); + break; + } + case TYPE_SPEC_VALUE: { + mergeTypeSpecValue(other.getTypeSpecValue()); + break; + } + case BOUNDED_TENSOR_SPEC_VALUE: { + mergeBoundedTensorSpecValue(other.getBoundedTensorSpecValue()); + break; + } + case LIST_VALUE: { + mergeListValue(other.getListValue()); + break; + } + case TUPLE_VALUE: { + mergeTupleValue(other.getTupleValue()); + break; + } + case DICT_VALUE: { + mergeDictValue(other.getDictValue()); + break; + } + case NAMED_TUPLE_VALUE: { + mergeNamedTupleValue(other.getNamedTupleValue()); + break; + } + case TENSOR_VALUE: { + mergeTensorValue(other.getTensorValue()); + break; + } + case NUMPY_VALUE: { + mergeNumpyValue(other.getNumpyValue()); + break; + } + case KIND_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getNoneValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 89: { + kind_ = input.readDouble(); + kindCase_ = 11; + break; + } // case 89 + case 96: { + kind_ = input.readSInt64(); + kindCase_ = 12; + break; + } // case 96 + case 106: { + java.lang.String s = input.readStringRequireUtf8(); + kindCase_ = 13; + kind_ = s; + break; + } // case 106 + case 112: { + kind_ = input.readBool(); + kindCase_ = 14; + break; + } // case 112 + case 250: { + input.readMessage( + getTensorShapeValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 31; + break; + } // case 250 + case 256: { + int rawValue = input.readEnum(); + kindCase_ = 32; + kind_ = rawValue; + break; + } // case 256 + case 266: { + input.readMessage( + getTensorSpecValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 33; + break; + } // case 266 + case 274: { + input.readMessage( + getTypeSpecValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 34; + break; + } // case 274 + case 282: { + input.readMessage( + getBoundedTensorSpecValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 35; + break; + } // case 282 + case 410: { + input.readMessage( + getListValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 51; + break; + } // case 410 + case 418: { + input.readMessage( + getTupleValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 52; + break; + } // case 418 + case 426: { + input.readMessage( + getDictValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 53; + break; + } // case 426 + case 434: { + input.readMessage( + getNamedTupleValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 54; + break; + } // case 434 + case 442: { + input.readMessage( + getTensorValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 55; + break; + } // case 442 + case 450: { + input.readMessage( + getNumpyValueFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 56; + break; + } // case 450 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int kindCase_ = 0; + private java.lang.Object kind_; + public KindCase + getKindCase() { + return KindCase.forNumber( + kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NoneValue, org.tensorflow.proto.Struct.NoneValue.Builder, org.tensorflow.proto.Struct.NoneValueOrBuilder> noneValueBuilder_; + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return Whether the noneValue field is set. + */ + @java.lang.Override + public boolean hasNoneValue() { + return kindCase_ == 1; + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + * @return The noneValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValue getNoneValue() { + if (noneValueBuilder_ == null) { + if (kindCase_ == 1) { + return (org.tensorflow.proto.Struct.NoneValue) kind_; + } + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return noneValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + public Builder setNoneValue(org.tensorflow.proto.Struct.NoneValue value) { + if (noneValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + noneValueBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + public Builder setNoneValue( + org.tensorflow.proto.Struct.NoneValue.Builder builderForValue) { + if (noneValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + noneValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + public Builder mergeNoneValue(org.tensorflow.proto.Struct.NoneValue value) { + if (noneValueBuilder_ == null) { + if (kindCase_ == 1 && + kind_ != org.tensorflow.proto.Struct.NoneValue.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.NoneValue.newBuilder((org.tensorflow.proto.Struct.NoneValue) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + noneValueBuilder_.mergeFrom(value); + } else { + noneValueBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + public Builder clearNoneValue() { + if (noneValueBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + noneValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + public org.tensorflow.proto.Struct.NoneValue.Builder getNoneValueBuilder() { + return getNoneValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValueOrBuilder getNoneValueOrBuilder() { + if ((kindCase_ == 1) && (noneValueBuilder_ != null)) { + return noneValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (org.tensorflow.proto.Struct.NoneValue) kind_; + } + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents None.
    +       * 
    + * + * .tensorflow.NoneValue none_value = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NoneValue, org.tensorflow.proto.Struct.NoneValue.Builder, org.tensorflow.proto.Struct.NoneValueOrBuilder> + getNoneValueFieldBuilder() { + if (noneValueBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + noneValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NoneValue, org.tensorflow.proto.Struct.NoneValue.Builder, org.tensorflow.proto.Struct.NoneValueOrBuilder>( + (org.tensorflow.proto.Struct.NoneValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return noneValueBuilder_; + } + + /** + *
    +       * Represents a double-precision floating-point value (a Python `float`).
    +       * 
    + * + * double float64_value = 11; + * @return Whether the float64Value field is set. + */ + public boolean hasFloat64Value() { + return kindCase_ == 11; + } + /** + *
    +       * Represents a double-precision floating-point value (a Python `float`).
    +       * 
    + * + * double float64_value = 11; + * @return The float64Value. + */ + public double getFloat64Value() { + if (kindCase_ == 11) { + return (java.lang.Double) kind_; + } + return 0D; + } + /** + *
    +       * Represents a double-precision floating-point value (a Python `float`).
    +       * 
    + * + * double float64_value = 11; + * @param value The float64Value to set. + * @return This builder for chaining. + */ + public Builder setFloat64Value(double value) { + + kindCase_ = 11; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +       * Represents a double-precision floating-point value (a Python `float`).
    +       * 
    + * + * double float64_value = 11; + * @return This builder for chaining. + */ + public Builder clearFloat64Value() { + if (kindCase_ == 11) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + *
    +       * Represents a signed integer value, limited to 64 bits.
    +       * Larger values from Python's arbitrary-precision integers are unsupported.
    +       * 
    + * + * sint64 int64_value = 12; + * @return Whether the int64Value field is set. + */ + public boolean hasInt64Value() { + return kindCase_ == 12; + } + /** + *
    +       * Represents a signed integer value, limited to 64 bits.
    +       * Larger values from Python's arbitrary-precision integers are unsupported.
    +       * 
    + * + * sint64 int64_value = 12; + * @return The int64Value. + */ + public long getInt64Value() { + if (kindCase_ == 12) { + return (java.lang.Long) kind_; + } + return 0L; + } + /** + *
    +       * Represents a signed integer value, limited to 64 bits.
    +       * Larger values from Python's arbitrary-precision integers are unsupported.
    +       * 
    + * + * sint64 int64_value = 12; + * @param value The int64Value to set. + * @return This builder for chaining. + */ + public Builder setInt64Value(long value) { + + kindCase_ = 12; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +       * Represents a signed integer value, limited to 64 bits.
    +       * Larger values from Python's arbitrary-precision integers are unsupported.
    +       * 
    + * + * sint64 int64_value = 12; + * @return This builder for chaining. + */ + public Builder clearInt64Value() { + if (kindCase_ == 12) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return kindCase_ == 13; + } + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (kindCase_ == 13) { + ref = kind_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (kindCase_ == 13) { + kind_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (kindCase_ == 13) { + ref = kind_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (kindCase_ == 13) { + kind_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + kindCase_ = 13; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (kindCase_ == 13) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + /** + *
    +       * Represents a string of Unicode characters stored in a Python `str`.
    +       * In Python 3, this is exactly what type `str` is.
    +       * In Python 2, this is the UTF-8 encoding of the characters.
    +       * For strings with ASCII characters only (as often used in TensorFlow code)
    +       * there is effectively no difference between the language versions.
    +       * The obsolescent `unicode` type of Python 2 is not supported here.
    +       * 
    + * + * string string_value = 13; + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + kindCase_ = 13; + kind_ = value; + onChanged(); + return this; + } + + /** + *
    +       * Represents a boolean value.
    +       * 
    + * + * bool bool_value = 14; + * @return Whether the boolValue field is set. + */ + public boolean hasBoolValue() { + return kindCase_ == 14; + } + /** + *
    +       * Represents a boolean value.
    +       * 
    + * + * bool bool_value = 14; + * @return The boolValue. + */ + public boolean getBoolValue() { + if (kindCase_ == 14) { + return (java.lang.Boolean) kind_; + } + return false; + } + /** + *
    +       * Represents a boolean value.
    +       * 
    + * + * bool bool_value = 14; + * @param value The boolValue to set. + * @return This builder for chaining. + */ + public Builder setBoolValue(boolean value) { + + kindCase_ = 14; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +       * Represents a boolean value.
    +       * 
    + * + * bool bool_value = 14; + * @return This builder for chaining. + */ + public Builder clearBoolValue() { + if (kindCase_ == 14) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> tensorShapeValueBuilder_; + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return Whether the tensorShapeValue field is set. + */ + @java.lang.Override + public boolean hasTensorShapeValue() { + return kindCase_ == 31; + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + * @return The tensorShapeValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShapeValue() { + if (tensorShapeValueBuilder_ == null) { + if (kindCase_ == 31) { + return (org.tensorflow.proto.TensorShapeProto) kind_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } else { + if (kindCase_ == 31) { + return tensorShapeValueBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + public Builder setTensorShapeValue(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + tensorShapeValueBuilder_.setMessage(value); + } + kindCase_ = 31; + return this; + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + public Builder setTensorShapeValue( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (tensorShapeValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + tensorShapeValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 31; + return this; + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + public Builder mergeTensorShapeValue(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeValueBuilder_ == null) { + if (kindCase_ == 31 && + kind_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.TensorShapeProto.newBuilder((org.tensorflow.proto.TensorShapeProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 31) { + tensorShapeValueBuilder_.mergeFrom(value); + } else { + tensorShapeValueBuilder_.setMessage(value); + } + } + kindCase_ = 31; + return this; + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + public Builder clearTensorShapeValue() { + if (tensorShapeValueBuilder_ == null) { + if (kindCase_ == 31) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 31) { + kindCase_ = 0; + kind_ = null; + } + tensorShapeValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getTensorShapeValueBuilder() { + return getTensorShapeValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder() { + if ((kindCase_ == 31) && (tensorShapeValueBuilder_ != null)) { + return tensorShapeValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 31) { + return (org.tensorflow.proto.TensorShapeProto) kind_; + } + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a TensorShape.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape_value = 31; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getTensorShapeValueFieldBuilder() { + if (tensorShapeValueBuilder_ == null) { + if (!(kindCase_ == 31)) { + kind_ = org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + tensorShapeValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + (org.tensorflow.proto.TensorShapeProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 31; + onChanged(); + return tensorShapeValueBuilder_; + } + + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return Whether the tensorDtypeValue field is set. + */ + @java.lang.Override + public boolean hasTensorDtypeValue() { + return kindCase_ == 32; + } + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The enum numeric value on the wire for tensorDtypeValue. + */ + @java.lang.Override + public int getTensorDtypeValueValue() { + if (kindCase_ == 32) { + return ((java.lang.Integer) kind_).intValue(); + } + return 0; + } + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @param value The enum numeric value on the wire for tensorDtypeValue to set. + * @return This builder for chaining. + */ + public Builder setTensorDtypeValueValue(int value) { + kindCase_ = 32; + kind_ = value; + onChanged(); + return this; + } + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return The tensorDtypeValue. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getTensorDtypeValue() { + if (kindCase_ == 32) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber( + (java.lang.Integer) kind_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + return org.tensorflow.proto.DataType.DT_INVALID; + } + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @param value The tensorDtypeValue to set. + * @return This builder for chaining. + */ + public Builder setTensorDtypeValue(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + kindCase_ = 32; + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * Represents an enum value for dtype.
    +       * 
    + * + * .tensorflow.DataType tensor_dtype_value = 32; + * @return This builder for chaining. + */ + public Builder clearTensorDtypeValue() { + if (kindCase_ == 32) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TensorSpecProto, org.tensorflow.proto.Struct.TensorSpecProto.Builder, org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder> tensorSpecValueBuilder_; + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return Whether the tensorSpecValue field is set. + */ + @java.lang.Override + public boolean hasTensorSpecValue() { + return kindCase_ == 33; + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + * @return The tensorSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProto getTensorSpecValue() { + if (tensorSpecValueBuilder_ == null) { + if (kindCase_ == 33) { + return (org.tensorflow.proto.Struct.TensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } else { + if (kindCase_ == 33) { + return tensorSpecValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + public Builder setTensorSpecValue(org.tensorflow.proto.Struct.TensorSpecProto value) { + if (tensorSpecValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + tensorSpecValueBuilder_.setMessage(value); + } + kindCase_ = 33; + return this; + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + public Builder setTensorSpecValue( + org.tensorflow.proto.Struct.TensorSpecProto.Builder builderForValue) { + if (tensorSpecValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + tensorSpecValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 33; + return this; + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + public Builder mergeTensorSpecValue(org.tensorflow.proto.Struct.TensorSpecProto value) { + if (tensorSpecValueBuilder_ == null) { + if (kindCase_ == 33 && + kind_ != org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.TensorSpecProto.newBuilder((org.tensorflow.proto.Struct.TensorSpecProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 33) { + tensorSpecValueBuilder_.mergeFrom(value); + } else { + tensorSpecValueBuilder_.setMessage(value); + } + } + kindCase_ = 33; + return this; + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + public Builder clearTensorSpecValue() { + if (tensorSpecValueBuilder_ == null) { + if (kindCase_ == 33) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 33) { + kindCase_ = 0; + kind_ = null; + } + tensorSpecValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + public org.tensorflow.proto.Struct.TensorSpecProto.Builder getTensorSpecValueBuilder() { + return getTensorSpecValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder() { + if ((kindCase_ == 33) && (tensorSpecValueBuilder_ != null)) { + return tensorSpecValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 33) { + return (org.tensorflow.proto.Struct.TensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.TensorSpec.
    +       * 
    + * + * .tensorflow.TensorSpecProto tensor_spec_value = 33; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TensorSpecProto, org.tensorflow.proto.Struct.TensorSpecProto.Builder, org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder> + getTensorSpecValueFieldBuilder() { + if (tensorSpecValueBuilder_ == null) { + if (!(kindCase_ == 33)) { + kind_ = org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + tensorSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TensorSpecProto, org.tensorflow.proto.Struct.TensorSpecProto.Builder, org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder>( + (org.tensorflow.proto.Struct.TensorSpecProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 33; + onChanged(); + return tensorSpecValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> typeSpecValueBuilder_; + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return Whether the typeSpecValue field is set. + */ + @java.lang.Override + public boolean hasTypeSpecValue() { + return kindCase_ == 34; + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + * @return The typeSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpecValue() { + if (typeSpecValueBuilder_ == null) { + if (kindCase_ == 34) { + return (org.tensorflow.proto.Struct.TypeSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } else { + if (kindCase_ == 34) { + return typeSpecValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + public Builder setTypeSpecValue(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + typeSpecValueBuilder_.setMessage(value); + } + kindCase_ = 34; + return this; + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + public Builder setTypeSpecValue( + org.tensorflow.proto.Struct.TypeSpecProto.Builder builderForValue) { + if (typeSpecValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + typeSpecValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 34; + return this; + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + public Builder mergeTypeSpecValue(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecValueBuilder_ == null) { + if (kindCase_ == 34 && + kind_ != org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.TypeSpecProto.newBuilder((org.tensorflow.proto.Struct.TypeSpecProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 34) { + typeSpecValueBuilder_.mergeFrom(value); + } else { + typeSpecValueBuilder_.setMessage(value); + } + } + kindCase_ = 34; + return this; + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + public Builder clearTypeSpecValue() { + if (typeSpecValueBuilder_ == null) { + if (kindCase_ == 34) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 34) { + kindCase_ = 0; + kind_ = null; + } + typeSpecValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + public org.tensorflow.proto.Struct.TypeSpecProto.Builder getTypeSpecValueBuilder() { + return getTypeSpecValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder() { + if ((kindCase_ == 34) && (typeSpecValueBuilder_ != null)) { + return typeSpecValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 34) { + return (org.tensorflow.proto.Struct.TypeSpecProto) kind_; + } + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.TypeSpec.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec_value = 34; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> + getTypeSpecValueFieldBuilder() { + if (typeSpecValueBuilder_ == null) { + if (!(kindCase_ == 34)) { + kind_ = org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + typeSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder>( + (org.tensorflow.proto.Struct.TypeSpecProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 34; + onChanged(); + return typeSpecValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.BoundedTensorSpecProto, org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder, org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder> boundedTensorSpecValueBuilder_; + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return Whether the boundedTensorSpecValue field is set. + */ + @java.lang.Override + public boolean hasBoundedTensorSpecValue() { + return kindCase_ == 35; + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + * @return The boundedTensorSpecValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProto getBoundedTensorSpecValue() { + if (boundedTensorSpecValueBuilder_ == null) { + if (kindCase_ == 35) { + return (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } else { + if (kindCase_ == 35) { + return boundedTensorSpecValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + public Builder setBoundedTensorSpecValue(org.tensorflow.proto.Struct.BoundedTensorSpecProto value) { + if (boundedTensorSpecValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + boundedTensorSpecValueBuilder_.setMessage(value); + } + kindCase_ = 35; + return this; + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + public Builder setBoundedTensorSpecValue( + org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder builderForValue) { + if (boundedTensorSpecValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + boundedTensorSpecValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 35; + return this; + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + public Builder mergeBoundedTensorSpecValue(org.tensorflow.proto.Struct.BoundedTensorSpecProto value) { + if (boundedTensorSpecValueBuilder_ == null) { + if (kindCase_ == 35 && + kind_ != org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.BoundedTensorSpecProto.newBuilder((org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 35) { + boundedTensorSpecValueBuilder_.mergeFrom(value); + } else { + boundedTensorSpecValueBuilder_.setMessage(value); + } + } + kindCase_ = 35; + return this; + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + public Builder clearBoundedTensorSpecValue() { + if (boundedTensorSpecValueBuilder_ == null) { + if (kindCase_ == 35) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 35) { + kindCase_ = 0; + kind_ = null; + } + boundedTensorSpecValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + public org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder getBoundedTensorSpecValueBuilder() { + return getBoundedTensorSpecValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder() { + if ((kindCase_ == 35) && (boundedTensorSpecValueBuilder_ != null)) { + return boundedTensorSpecValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 35) { + return (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_; + } + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.BoundedTensorSpec.
    +       * 
    + * + * .tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.BoundedTensorSpecProto, org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder, org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder> + getBoundedTensorSpecValueFieldBuilder() { + if (boundedTensorSpecValueBuilder_ == null) { + if (!(kindCase_ == 35)) { + kind_ = org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + boundedTensorSpecValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.BoundedTensorSpecProto, org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder, org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder>( + (org.tensorflow.proto.Struct.BoundedTensorSpecProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 35; + onChanged(); + return boundedTensorSpecValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.ListValue, org.tensorflow.proto.Struct.ListValue.Builder, org.tensorflow.proto.Struct.ListValueOrBuilder> listValueBuilder_; + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return Whether the listValue field is set. + */ + @java.lang.Override + public boolean hasListValue() { + return kindCase_ == 51; + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + * @return The listValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.ListValue getListValue() { + if (listValueBuilder_ == null) { + if (kindCase_ == 51) { + return (org.tensorflow.proto.Struct.ListValue) kind_; + } + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } else { + if (kindCase_ == 51) { + return listValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + public Builder setListValue(org.tensorflow.proto.Struct.ListValue value) { + if (listValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + listValueBuilder_.setMessage(value); + } + kindCase_ = 51; + return this; + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + public Builder setListValue( + org.tensorflow.proto.Struct.ListValue.Builder builderForValue) { + if (listValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + listValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 51; + return this; + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + public Builder mergeListValue(org.tensorflow.proto.Struct.ListValue value) { + if (listValueBuilder_ == null) { + if (kindCase_ == 51 && + kind_ != org.tensorflow.proto.Struct.ListValue.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.ListValue.newBuilder((org.tensorflow.proto.Struct.ListValue) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 51) { + listValueBuilder_.mergeFrom(value); + } else { + listValueBuilder_.setMessage(value); + } + } + kindCase_ = 51; + return this; + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + public Builder clearListValue() { + if (listValueBuilder_ == null) { + if (kindCase_ == 51) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 51) { + kindCase_ = 0; + kind_ = null; + } + listValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + public org.tensorflow.proto.Struct.ListValue.Builder getListValueBuilder() { + return getListValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.ListValueOrBuilder getListValueOrBuilder() { + if ((kindCase_ == 51) && (listValueBuilder_ != null)) { + return listValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 51) { + return (org.tensorflow.proto.Struct.ListValue) kind_; + } + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a list of `Value`.
    +       * 
    + * + * .tensorflow.ListValue list_value = 51; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.ListValue, org.tensorflow.proto.Struct.ListValue.Builder, org.tensorflow.proto.Struct.ListValueOrBuilder> + getListValueFieldBuilder() { + if (listValueBuilder_ == null) { + if (!(kindCase_ == 51)) { + kind_ = org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + listValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.ListValue, org.tensorflow.proto.Struct.ListValue.Builder, org.tensorflow.proto.Struct.ListValueOrBuilder>( + (org.tensorflow.proto.Struct.ListValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 51; + onChanged(); + return listValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TupleValue, org.tensorflow.proto.Struct.TupleValue.Builder, org.tensorflow.proto.Struct.TupleValueOrBuilder> tupleValueBuilder_; + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return Whether the tupleValue field is set. + */ + @java.lang.Override + public boolean hasTupleValue() { + return kindCase_ == 52; + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + * @return The tupleValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValue getTupleValue() { + if (tupleValueBuilder_ == null) { + if (kindCase_ == 52) { + return (org.tensorflow.proto.Struct.TupleValue) kind_; + } + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } else { + if (kindCase_ == 52) { + return tupleValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + public Builder setTupleValue(org.tensorflow.proto.Struct.TupleValue value) { + if (tupleValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + tupleValueBuilder_.setMessage(value); + } + kindCase_ = 52; + return this; + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + public Builder setTupleValue( + org.tensorflow.proto.Struct.TupleValue.Builder builderForValue) { + if (tupleValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + tupleValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 52; + return this; + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + public Builder mergeTupleValue(org.tensorflow.proto.Struct.TupleValue value) { + if (tupleValueBuilder_ == null) { + if (kindCase_ == 52 && + kind_ != org.tensorflow.proto.Struct.TupleValue.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.TupleValue.newBuilder((org.tensorflow.proto.Struct.TupleValue) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 52) { + tupleValueBuilder_.mergeFrom(value); + } else { + tupleValueBuilder_.setMessage(value); + } + } + kindCase_ = 52; + return this; + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + public Builder clearTupleValue() { + if (tupleValueBuilder_ == null) { + if (kindCase_ == 52) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 52) { + kindCase_ = 0; + kind_ = null; + } + tupleValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + public org.tensorflow.proto.Struct.TupleValue.Builder getTupleValueBuilder() { + return getTupleValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValueOrBuilder getTupleValueOrBuilder() { + if ((kindCase_ == 52) && (tupleValueBuilder_ != null)) { + return tupleValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 52) { + return (org.tensorflow.proto.Struct.TupleValue) kind_; + } + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a tuple of `Value`.
    +       * 
    + * + * .tensorflow.TupleValue tuple_value = 52; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TupleValue, org.tensorflow.proto.Struct.TupleValue.Builder, org.tensorflow.proto.Struct.TupleValueOrBuilder> + getTupleValueFieldBuilder() { + if (tupleValueBuilder_ == null) { + if (!(kindCase_ == 52)) { + kind_ = org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + tupleValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TupleValue, org.tensorflow.proto.Struct.TupleValue.Builder, org.tensorflow.proto.Struct.TupleValueOrBuilder>( + (org.tensorflow.proto.Struct.TupleValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 52; + onChanged(); + return tupleValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.DictValue, org.tensorflow.proto.Struct.DictValue.Builder, org.tensorflow.proto.Struct.DictValueOrBuilder> dictValueBuilder_; + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return Whether the dictValue field is set. + */ + @java.lang.Override + public boolean hasDictValue() { + return kindCase_ == 53; + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + * @return The dictValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.DictValue getDictValue() { + if (dictValueBuilder_ == null) { + if (kindCase_ == 53) { + return (org.tensorflow.proto.Struct.DictValue) kind_; + } + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } else { + if (kindCase_ == 53) { + return dictValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + public Builder setDictValue(org.tensorflow.proto.Struct.DictValue value) { + if (dictValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + dictValueBuilder_.setMessage(value); + } + kindCase_ = 53; + return this; + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + public Builder setDictValue( + org.tensorflow.proto.Struct.DictValue.Builder builderForValue) { + if (dictValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + dictValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 53; + return this; + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + public Builder mergeDictValue(org.tensorflow.proto.Struct.DictValue value) { + if (dictValueBuilder_ == null) { + if (kindCase_ == 53 && + kind_ != org.tensorflow.proto.Struct.DictValue.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.DictValue.newBuilder((org.tensorflow.proto.Struct.DictValue) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 53) { + dictValueBuilder_.mergeFrom(value); + } else { + dictValueBuilder_.setMessage(value); + } + } + kindCase_ = 53; + return this; + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + public Builder clearDictValue() { + if (dictValueBuilder_ == null) { + if (kindCase_ == 53) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 53) { + kindCase_ = 0; + kind_ = null; + } + dictValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + public org.tensorflow.proto.Struct.DictValue.Builder getDictValueBuilder() { + return getDictValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.DictValueOrBuilder getDictValueOrBuilder() { + if ((kindCase_ == 53) && (dictValueBuilder_ != null)) { + return dictValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 53) { + return (org.tensorflow.proto.Struct.DictValue) kind_; + } + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents a dict `Value`.
    +       * 
    + * + * .tensorflow.DictValue dict_value = 53; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.DictValue, org.tensorflow.proto.Struct.DictValue.Builder, org.tensorflow.proto.Struct.DictValueOrBuilder> + getDictValueFieldBuilder() { + if (dictValueBuilder_ == null) { + if (!(kindCase_ == 53)) { + kind_ = org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + dictValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.DictValue, org.tensorflow.proto.Struct.DictValue.Builder, org.tensorflow.proto.Struct.DictValueOrBuilder>( + (org.tensorflow.proto.Struct.DictValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 53; + onChanged(); + return dictValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NamedTupleValue, org.tensorflow.proto.Struct.NamedTupleValue.Builder, org.tensorflow.proto.Struct.NamedTupleValueOrBuilder> namedTupleValueBuilder_; + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return Whether the namedTupleValue field is set. + */ + @java.lang.Override + public boolean hasNamedTupleValue() { + return kindCase_ == 54; + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + * @return The namedTupleValue. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValue getNamedTupleValue() { + if (namedTupleValueBuilder_ == null) { + if (kindCase_ == 54) { + return (org.tensorflow.proto.Struct.NamedTupleValue) kind_; + } + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } else { + if (kindCase_ == 54) { + return namedTupleValueBuilder_.getMessage(); + } + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + public Builder setNamedTupleValue(org.tensorflow.proto.Struct.NamedTupleValue value) { + if (namedTupleValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + namedTupleValueBuilder_.setMessage(value); + } + kindCase_ = 54; + return this; + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + public Builder setNamedTupleValue( + org.tensorflow.proto.Struct.NamedTupleValue.Builder builderForValue) { + if (namedTupleValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + namedTupleValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 54; + return this; + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + public Builder mergeNamedTupleValue(org.tensorflow.proto.Struct.NamedTupleValue value) { + if (namedTupleValueBuilder_ == null) { + if (kindCase_ == 54 && + kind_ != org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance()) { + kind_ = org.tensorflow.proto.Struct.NamedTupleValue.newBuilder((org.tensorflow.proto.Struct.NamedTupleValue) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 54) { + namedTupleValueBuilder_.mergeFrom(value); + } else { + namedTupleValueBuilder_.setMessage(value); + } + } + kindCase_ = 54; + return this; + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + public Builder clearNamedTupleValue() { + if (namedTupleValueBuilder_ == null) { + if (kindCase_ == 54) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 54) { + kindCase_ = 0; + kind_ = null; + } + namedTupleValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + public org.tensorflow.proto.Struct.NamedTupleValue.Builder getNamedTupleValueBuilder() { + return getNamedTupleValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValueOrBuilder getNamedTupleValueOrBuilder() { + if ((kindCase_ == 54) && (namedTupleValueBuilder_ != null)) { + return namedTupleValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 54) { + return (org.tensorflow.proto.Struct.NamedTupleValue) kind_; + } + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + } + /** + *
    +       * Represents Python's namedtuple.
    +       * 
    + * + * .tensorflow.NamedTupleValue named_tuple_value = 54; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NamedTupleValue, org.tensorflow.proto.Struct.NamedTupleValue.Builder, org.tensorflow.proto.Struct.NamedTupleValueOrBuilder> + getNamedTupleValueFieldBuilder() { + if (namedTupleValueBuilder_ == null) { + if (!(kindCase_ == 54)) { + kind_ = org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + namedTupleValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.NamedTupleValue, org.tensorflow.proto.Struct.NamedTupleValue.Builder, org.tensorflow.proto.Struct.NamedTupleValueOrBuilder>( + (org.tensorflow.proto.Struct.NamedTupleValue) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 54; + onChanged(); + return namedTupleValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorValueBuilder_; + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return Whether the tensorValue field is set. + */ + @java.lang.Override + public boolean hasTensorValue() { + return kindCase_ == 55; + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + * @return The tensorValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensorValue() { + if (tensorValueBuilder_ == null) { + if (kindCase_ == 55) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } else { + if (kindCase_ == 55) { + return tensorValueBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + public Builder setTensorValue(org.tensorflow.proto.TensorProto value) { + if (tensorValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + tensorValueBuilder_.setMessage(value); + } + kindCase_ = 55; + return this; + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + public Builder setTensorValue( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + tensorValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 55; + return this; + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + public Builder mergeTensorValue(org.tensorflow.proto.TensorProto value) { + if (tensorValueBuilder_ == null) { + if (kindCase_ == 55 && + kind_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.TensorProto.newBuilder((org.tensorflow.proto.TensorProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 55) { + tensorValueBuilder_.mergeFrom(value); + } else { + tensorValueBuilder_.setMessage(value); + } + } + kindCase_ = 55; + return this; + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + public Builder clearTensorValue() { + if (tensorValueBuilder_ == null) { + if (kindCase_ == 55) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 55) { + kindCase_ = 0; + kind_ = null; + } + tensorValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorValueBuilder() { + return getTensorValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorValueOrBuilder() { + if ((kindCase_ == 55) && (tensorValueBuilder_ != null)) { + return tensorValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 55) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for tf.Tensor.
    +       * 
    + * + * .tensorflow.TensorProto tensor_value = 55; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorValueFieldBuilder() { + if (tensorValueBuilder_ == null) { + if (!(kindCase_ == 55)) { + kind_ = org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + tensorValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + (org.tensorflow.proto.TensorProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 55; + onChanged(); + return tensorValueBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> numpyValueBuilder_; + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return Whether the numpyValue field is set. + */ + @java.lang.Override + public boolean hasNumpyValue() { + return kindCase_ == 56; + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + * @return The numpyValue. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getNumpyValue() { + if (numpyValueBuilder_ == null) { + if (kindCase_ == 56) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } else { + if (kindCase_ == 56) { + return numpyValueBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + public Builder setNumpyValue(org.tensorflow.proto.TensorProto value) { + if (numpyValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + numpyValueBuilder_.setMessage(value); + } + kindCase_ = 56; + return this; + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + public Builder setNumpyValue( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (numpyValueBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + numpyValueBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 56; + return this; + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + public Builder mergeNumpyValue(org.tensorflow.proto.TensorProto value) { + if (numpyValueBuilder_ == null) { + if (kindCase_ == 56 && + kind_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + kind_ = org.tensorflow.proto.TensorProto.newBuilder((org.tensorflow.proto.TensorProto) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 56) { + numpyValueBuilder_.mergeFrom(value); + } else { + numpyValueBuilder_.setMessage(value); + } + } + kindCase_ = 56; + return this; + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + public Builder clearNumpyValue() { + if (numpyValueBuilder_ == null) { + if (kindCase_ == 56) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 56) { + kindCase_ = 0; + kind_ = null; + } + numpyValueBuilder_.clear(); + } + return this; + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + public org.tensorflow.proto.TensorProto.Builder getNumpyValueBuilder() { + return getNumpyValueFieldBuilder().getBuilder(); + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getNumpyValueOrBuilder() { + if ((kindCase_ == 56) && (numpyValueBuilder_ != null)) { + return numpyValueBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 56) { + return (org.tensorflow.proto.TensorProto) kind_; + } + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + } + /** + *
    +       * Represents a value for np.ndarray.
    +       * 
    + * + * .tensorflow.TensorProto numpy_value = 56; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getNumpyValueFieldBuilder() { + if (numpyValueBuilder_ == null) { + if (!(kindCase_ == 56)) { + kind_ = org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + numpyValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + (org.tensorflow.proto.TensorProto) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 56; + onChanged(); + return numpyValueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.StructuredValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.StructuredValue) + private static final org.tensorflow.proto.Struct.StructuredValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.StructuredValue(); + } + + public static org.tensorflow.proto.Struct.StructuredValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StructuredValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.StructuredValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NoneValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NoneValue) + com.google.protobuf.MessageOrBuilder { + } + /** + *
    +   * Represents None.
    +   * 
    + * + * Protobuf type {@code tensorflow.NoneValue} + */ + public static final class NoneValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NoneValue) + NoneValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NoneValue.class.getName()); + } + // Use NoneValue.newBuilder() to construct. + private NoneValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NoneValue() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NoneValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NoneValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.NoneValue.class, org.tensorflow.proto.Struct.NoneValue.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.Struct.NoneValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.NoneValue other = (org.tensorflow.proto.Struct.NoneValue) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.NoneValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NoneValue 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.Struct.NoneValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NoneValue 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.Struct.NoneValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NoneValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.NoneValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.NoneValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.NoneValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.NoneValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.NoneValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.NoneValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.NoneValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents None.
    +     * 
    + * + * Protobuf type {@code tensorflow.NoneValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NoneValue) + org.tensorflow.proto.Struct.NoneValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NoneValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NoneValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.NoneValue.class, org.tensorflow.proto.Struct.NoneValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.NoneValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NoneValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.NoneValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValue build() { + org.tensorflow.proto.Struct.NoneValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NoneValue buildPartial() { + org.tensorflow.proto.Struct.NoneValue result = new org.tensorflow.proto.Struct.NoneValue(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.NoneValue) { + return mergeFrom((org.tensorflow.proto.Struct.NoneValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.NoneValue other) { + if (other == org.tensorflow.proto.Struct.NoneValue.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NoneValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NoneValue) + private static final org.tensorflow.proto.Struct.NoneValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.NoneValue(); + } + + public static org.tensorflow.proto.Struct.NoneValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NoneValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.NoneValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ListValue) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + java.util.List + getValuesList(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + org.tensorflow.proto.Struct.StructuredValue getValues(int index); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + int getValuesCount(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + java.util.List + getValuesOrBuilderList(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index); + } + /** + *
    +   * Represents a Python list.
    +   * 
    + * + * Protobuf type {@code tensorflow.ListValue} + */ + public static final class ListValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ListValue) + ListValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ListValue.class.getName()); + } + // Use ListValue.newBuilder() to construct. + private ListValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ListValue() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_ListValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_ListValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.ListValue.class, org.tensorflow.proto.Struct.ListValue.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List values_; + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getValues(int index) { + return values_.get(index); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index) { + return values_.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 { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().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.Struct.ListValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.ListValue other = (org.tensorflow.proto.Struct.ListValue) obj; + + if (!getValuesList() + .equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.ListValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.ListValue 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.Struct.ListValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.ListValue 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.Struct.ListValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.ListValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.ListValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.ListValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.ListValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.ListValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.ListValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.ListValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.ListValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a Python list.
    +     * 
    + * + * Protobuf type {@code tensorflow.ListValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ListValue) + org.tensorflow.proto.Struct.ListValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_ListValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_ListValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.ListValue.class, org.tensorflow.proto.Struct.ListValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.ListValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_ListValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.ListValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.ListValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.ListValue build() { + org.tensorflow.proto.Struct.ListValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.ListValue buildPartial() { + org.tensorflow.proto.Struct.ListValue result = new org.tensorflow.proto.Struct.ListValue(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.Struct.ListValue result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.Struct.ListValue result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.ListValue) { + return mergeFrom((org.tensorflow.proto.Struct.ListValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.ListValue other) { + if (other == org.tensorflow.proto.Struct.ListValue.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getValuesFieldBuilder() : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.Struct.StructuredValue m = + input.readMessage( + org.tensorflow.proto.Struct.StructuredValue.parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> valuesBuilder_; + + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues(org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getValuesBuilder( + int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder( + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder addValuesBuilder( + int index) { + return getValuesFieldBuilder().addBuilder( + index, org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + values_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ListValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ListValue) + private static final org.tensorflow.proto.Struct.ListValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.ListValue(); + } + + public static org.tensorflow.proto.Struct.ListValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.ListValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TupleValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TupleValue) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + java.util.List + getValuesList(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + org.tensorflow.proto.Struct.StructuredValue getValues(int index); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + int getValuesCount(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + java.util.List + getValuesOrBuilderList(); + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index); + } + /** + *
    +   * Represents a Python tuple.
    +   * 
    + * + * Protobuf type {@code tensorflow.TupleValue} + */ + public static final class TupleValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TupleValue) + TupleValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TupleValue.class.getName()); + } + // Use TupleValue.newBuilder() to construct. + private TupleValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TupleValue() { + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TupleValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TupleValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TupleValue.class, org.tensorflow.proto.Struct.TupleValue.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List values_; + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getValues(int index) { + return values_.get(index); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index) { + return values_.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 { + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(1, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, values_.get(i)); + } + size += getUnknownFields().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.Struct.TupleValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.TupleValue other = (org.tensorflow.proto.Struct.TupleValue) obj; + + if (!getValuesList() + .equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.TupleValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TupleValue 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.Struct.TupleValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TupleValue 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.Struct.TupleValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TupleValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TupleValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TupleValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.TupleValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.TupleValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TupleValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TupleValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.TupleValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a Python tuple.
    +     * 
    + * + * Protobuf type {@code tensorflow.TupleValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TupleValue) + org.tensorflow.proto.Struct.TupleValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TupleValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TupleValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TupleValue.class, org.tensorflow.proto.Struct.TupleValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.TupleValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TupleValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.TupleValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValue build() { + org.tensorflow.proto.Struct.TupleValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TupleValue buildPartial() { + org.tensorflow.proto.Struct.TupleValue result = new org.tensorflow.proto.Struct.TupleValue(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.Struct.TupleValue result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.Struct.TupleValue result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.TupleValue) { + return mergeFrom((org.tensorflow.proto.Struct.TupleValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.TupleValue other) { + if (other == org.tensorflow.proto.Struct.TupleValue.getDefaultInstance()) return this; + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000001); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getValuesFieldBuilder() : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.Struct.StructuredValue m = + input.readMessage( + org.tensorflow.proto.Struct.StructuredValue.parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List values_ = + java.util.Collections.emptyList(); + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> valuesBuilder_; + + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues(org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.StructuredValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getValuesBuilder( + int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder( + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder addValuesBuilder( + int index) { + return getValuesFieldBuilder().addBuilder( + index, org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.StructuredValue values = 1; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + values_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TupleValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TupleValue) + private static final org.tensorflow.proto.Struct.TupleValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.TupleValue(); + } + + public static org.tensorflow.proto.Struct.TupleValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TupleValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.TupleValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DictValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.DictValue) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + int getFieldsCount(); + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + boolean containsFields( + java.lang.String key); + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFields(); + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + java.util.Map + getFieldsMap(); + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + /* nullable */ +org.tensorflow.proto.Struct.StructuredValue getFieldsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.Struct.StructuredValue defaultValue); + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + org.tensorflow.proto.Struct.StructuredValue getFieldsOrThrow( + java.lang.String key); + } + /** + *
    +   * Represents a Python dict keyed by `str`.
    +   * The comment on Unicode from Value.string_value applies analogously.
    +   * 
    + * + * Protobuf type {@code tensorflow.DictValue} + */ + public static final class DictValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.DictValue) + DictValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DictValue.class.getName()); + } + // Use DictValue.newBuilder() to construct. + private DictValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DictValue() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.DictValue.class, org.tensorflow.proto.Struct.DictValue.Builder.class); + } + + public static final int FIELDS_FIELD_NUMBER = 1; + private static final class FieldsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, org.tensorflow.proto.Struct.StructuredValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_FieldsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, org.tensorflow.proto.Struct.StructuredValue> fields_; + private com.google.protobuf.MapField + internalGetFields() { + if (fields_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FieldsDefaultEntryHolder.defaultEntry); + } + return fields_; + } + public int getFieldsCount() { + return internalGetFields().getMap().size(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public boolean containsFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFields().getMap().containsKey(key); + } + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public java.util.Map getFieldsMap() { + return internalGetFields().getMap(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.Struct.StructuredValue getFieldsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.Struct.StructuredValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFields().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getFieldsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetFields().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetFields(), + FieldsDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetFields().getMap().entrySet()) { + com.google.protobuf.MapEntry + fields__ = FieldsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, fields__); + } + size += getUnknownFields().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.Struct.DictValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.DictValue other = (org.tensorflow.proto.Struct.DictValue) obj; + + if (!internalGetFields().equals( + other.internalGetFields())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetFields().getMap().isEmpty()) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + internalGetFields().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.DictValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.DictValue 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.Struct.DictValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.DictValue 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.Struct.DictValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.DictValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.DictValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.DictValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.DictValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.DictValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.DictValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.DictValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.DictValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a Python dict keyed by `str`.
    +     * The comment on Unicode from Value.string_value applies analogously.
    +     * 
    + * + * Protobuf type {@code tensorflow.DictValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.DictValue) + org.tensorflow.proto.Struct.DictValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableFields(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.DictValue.class, org.tensorflow.proto.Struct.DictValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.DictValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableFields().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_DictValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.DictValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.DictValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.DictValue build() { + org.tensorflow.proto.Struct.DictValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.DictValue buildPartial() { + org.tensorflow.proto.Struct.DictValue result = new org.tensorflow.proto.Struct.DictValue(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.DictValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fields_ = internalGetFields().build(FieldsDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.DictValue) { + return mergeFrom((org.tensorflow.proto.Struct.DictValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.DictValue other) { + if (other == org.tensorflow.proto.Struct.DictValue.getDefaultInstance()) return this; + internalGetMutableFields().mergeFrom( + other.internalGetFields()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + fields__ = input.readMessage( + FieldsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableFields().ensureBuilderMap().put( + fields__.getKey(), fields__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private static final class FieldsConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue build(org.tensorflow.proto.Struct.StructuredValueOrBuilder val) { + if (val instanceof org.tensorflow.proto.Struct.StructuredValue) { return (org.tensorflow.proto.Struct.StructuredValue) val; } + return ((org.tensorflow.proto.Struct.StructuredValue.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return FieldsDefaultEntryHolder.defaultEntry; + } + }; + private static final FieldsConverter fieldsConverter = new FieldsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, org.tensorflow.proto.Struct.StructuredValueOrBuilder, org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder> fields_; + private com.google.protobuf.MapFieldBuilder + internalGetFields() { + if (fields_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(fieldsConverter); + } + return fields_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableFields() { + if (fields_ == null) { + fields_ = new com.google.protobuf.MapFieldBuilder<>(fieldsConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return fields_; + } + public int getFieldsCount() { + return internalGetFields().ensureBuilderMap().size(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public boolean containsFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetFields().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getFieldsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getFields() { + return getFieldsMap(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public java.util.Map getFieldsMap() { + return internalGetFields().getImmutableMap(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.Struct.StructuredValue getFieldsOrDefault( + java.lang.String key, + /* nullable */ +org.tensorflow.proto.Struct.StructuredValue defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFields().ensureBuilderMap(); + return map.containsKey(key) ? fieldsConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getFieldsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableFields().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return fieldsConverter.build(map.get(key)); + } + public Builder clearFields() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableFields().clear(); + return this; + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + public Builder removeFields( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableFields().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFields() { + bitField0_ |= 0x00000001; + return internalGetMutableFields().ensureMessageMap(); + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + public Builder putFields( + java.lang.String key, + org.tensorflow.proto.Struct.StructuredValue value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableFields().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + public Builder putAllFields( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableFields().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .tensorflow.StructuredValue> fields = 1; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder putFieldsBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableFields().ensureBuilderMap(); + org.tensorflow.proto.Struct.StructuredValueOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.Struct.StructuredValue.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.Struct.StructuredValue) { + entry = ((org.tensorflow.proto.Struct.StructuredValue) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.Struct.StructuredValue.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.DictValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.DictValue) + private static final org.tensorflow.proto.Struct.DictValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.DictValue(); + } + + public static org.tensorflow.proto.Struct.DictValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DictValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.DictValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PairValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.PairValue) + com.google.protobuf.MessageOrBuilder { + + /** + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * .tensorflow.StructuredValue value = 2; + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * .tensorflow.StructuredValue value = 2; + * @return The value. + */ + org.tensorflow.proto.Struct.StructuredValue getValue(); + /** + * .tensorflow.StructuredValue value = 2; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getValueOrBuilder(); + } + /** + *
    +   * Represents a (key, value) pair.
    +   * 
    + * + * Protobuf type {@code tensorflow.PairValue} + */ + public static final class PairValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.PairValue) + PairValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + PairValue.class.getName()); + } + // Use PairValue.newBuilder() to construct. + private PairValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PairValue() { + key_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_PairValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_PairValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.PairValue.class, org.tensorflow.proto.Struct.PairValue.Builder.class); + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private org.tensorflow.proto.Struct.StructuredValue value_; + /** + * .tensorflow.StructuredValue value = 2; + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.StructuredValue value = 2; + * @return The value. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getValue() { + return value_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : value_; + } + /** + * .tensorflow.StructuredValue value = 2; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValueOrBuilder() { + return value_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : value_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getValue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getValue()); + } + size += getUnknownFields().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.Struct.PairValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.PairValue other = (org.tensorflow.proto.Struct.PairValue) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue() + .equals(other.getValue())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.PairValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.PairValue 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.Struct.PairValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.PairValue 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.Struct.PairValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.PairValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.PairValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.PairValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.PairValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.PairValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.PairValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.PairValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.PairValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a (key, value) pair.
    +     * 
    + * + * Protobuf type {@code tensorflow.PairValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.PairValue) + org.tensorflow.proto.Struct.PairValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_PairValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_PairValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.PairValue.class, org.tensorflow.proto.Struct.PairValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.PairValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValueFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_PairValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.PairValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.PairValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.PairValue build() { + org.tensorflow.proto.Struct.PairValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.PairValue buildPartial() { + org.tensorflow.proto.Struct.PairValue result = new org.tensorflow.proto.Struct.PairValue(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.PairValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = valueBuilder_ == null + ? value_ + : valueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.PairValue) { + return mergeFrom((org.tensorflow.proto.Struct.PairValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.PairValue other) { + if (other == org.tensorflow.proto.Struct.PairValue.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValue()) { + mergeValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getValueFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.Struct.StructuredValue value_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> valueBuilder_; + /** + * .tensorflow.StructuredValue value = 2; + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.StructuredValue value = 2; + * @return The value. + */ + public org.tensorflow.proto.Struct.StructuredValue getValue() { + if (valueBuilder_ == null) { + return value_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : value_; + } else { + return valueBuilder_.getMessage(); + } + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public Builder setValue(org.tensorflow.proto.Struct.StructuredValue value) { + if (valueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + } else { + valueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public Builder setValue( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (valueBuilder_ == null) { + value_ = builderForValue.build(); + } else { + valueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public Builder mergeValue(org.tensorflow.proto.Struct.StructuredValue value) { + if (valueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + value_ != null && + value_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getValueBuilder().mergeFrom(value); + } else { + value_ = value; + } + } else { + valueBuilder_.mergeFrom(value); + } + if (value_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = null; + if (valueBuilder_ != null) { + valueBuilder_.dispose(); + valueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getValueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getValueFieldBuilder().getBuilder(); + } + /** + * .tensorflow.StructuredValue value = 2; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getValueOrBuilder() { + if (valueBuilder_ != null) { + return valueBuilder_.getMessageOrBuilder(); + } else { + return value_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : value_; + } + } + /** + * .tensorflow.StructuredValue value = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getValueFieldBuilder() { + if (valueBuilder_ == null) { + valueBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getValue(), + getParentForChildren(), + isClean()); + value_ = null; + } + return valueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.PairValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.PairValue) + private static final org.tensorflow.proto.Struct.PairValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.PairValue(); + } + + public static org.tensorflow.proto.Struct.PairValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PairValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.PairValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NamedTupleValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.NamedTupleValue) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * repeated .tensorflow.PairValue values = 2; + */ + java.util.List + getValuesList(); + /** + * repeated .tensorflow.PairValue values = 2; + */ + org.tensorflow.proto.Struct.PairValue getValues(int index); + /** + * repeated .tensorflow.PairValue values = 2; + */ + int getValuesCount(); + /** + * repeated .tensorflow.PairValue values = 2; + */ + java.util.List + getValuesOrBuilderList(); + /** + * repeated .tensorflow.PairValue values = 2; + */ + org.tensorflow.proto.Struct.PairValueOrBuilder getValuesOrBuilder( + int index); + } + /** + *
    +   * Represents Python's namedtuple.
    +   * 
    + * + * Protobuf type {@code tensorflow.NamedTupleValue} + */ + public static final class NamedTupleValue extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.NamedTupleValue) + NamedTupleValueOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NamedTupleValue.class.getName()); + } + // Use NamedTupleValue.newBuilder() to construct. + private NamedTupleValue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private NamedTupleValue() { + name_ = ""; + values_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NamedTupleValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NamedTupleValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.NamedTupleValue.class, org.tensorflow.proto.Struct.NamedTupleValue.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 VALUES_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List values_; + /** + * repeated .tensorflow.PairValue values = 2; + */ + @java.lang.Override + public java.util.List getValuesList() { + return values_; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + @java.lang.Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + @java.lang.Override + public int getValuesCount() { + return values_.size(); + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.PairValue getValues(int index) { + return values_.get(index); + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.PairValueOrBuilder getValuesOrBuilder( + int index) { + return values_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(2, values_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, values_.get(i)); + } + size += getUnknownFields().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.Struct.NamedTupleValue)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.NamedTupleValue other = (org.tensorflow.proto.Struct.NamedTupleValue) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getValuesList() + .equals(other.getValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NamedTupleValue 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.Struct.NamedTupleValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NamedTupleValue 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.Struct.NamedTupleValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.NamedTupleValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.NamedTupleValue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.NamedTupleValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.NamedTupleValue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents Python's namedtuple.
    +     * 
    + * + * Protobuf type {@code tensorflow.NamedTupleValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.NamedTupleValue) + org.tensorflow.proto.Struct.NamedTupleValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NamedTupleValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NamedTupleValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.NamedTupleValue.class, org.tensorflow.proto.Struct.NamedTupleValue.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.NamedTupleValue.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + } else { + values_ = null; + valuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_NamedTupleValue_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValue getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValue build() { + org.tensorflow.proto.Struct.NamedTupleValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.NamedTupleValue buildPartial() { + org.tensorflow.proto.Struct.NamedTupleValue result = new org.tensorflow.proto.Struct.NamedTupleValue(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.Struct.NamedTupleValue result) { + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.Struct.NamedTupleValue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.NamedTupleValue) { + return mergeFrom((org.tensorflow.proto.Struct.NamedTupleValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.NamedTupleValue other) { + if (other == org.tensorflow.proto.Struct.NamedTupleValue.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + valuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getValuesFieldBuilder() : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.Struct.PairValue m = + input.readMessage( + org.tensorflow.proto.Struct.PairValue.parser(), + extensionRegistry); + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(m); + } else { + valuesBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List values_ = + java.util.Collections.emptyList(); + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.PairValue, org.tensorflow.proto.Struct.PairValue.Builder, org.tensorflow.proto.Struct.PairValueOrBuilder> valuesBuilder_; + + /** + * repeated .tensorflow.PairValue values = 2; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public org.tensorflow.proto.Struct.PairValue getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.PairValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder setValues( + int index, org.tensorflow.proto.Struct.PairValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder addValues(org.tensorflow.proto.Struct.PairValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.PairValue value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder addValues( + org.tensorflow.proto.Struct.PairValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder addValues( + int index, org.tensorflow.proto.Struct.PairValue.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder addAllValues( + java.lang.Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public org.tensorflow.proto.Struct.PairValue.Builder getValuesBuilder( + int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public org.tensorflow.proto.Struct.PairValueOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public org.tensorflow.proto.Struct.PairValue.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder( + org.tensorflow.proto.Struct.PairValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public org.tensorflow.proto.Struct.PairValue.Builder addValuesBuilder( + int index) { + return getValuesFieldBuilder().addBuilder( + index, org.tensorflow.proto.Struct.PairValue.getDefaultInstance()); + } + /** + * repeated .tensorflow.PairValue values = 2; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.PairValue, org.tensorflow.proto.Struct.PairValue.Builder, org.tensorflow.proto.Struct.PairValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.Struct.PairValue, org.tensorflow.proto.Struct.PairValue.Builder, org.tensorflow.proto.Struct.PairValueOrBuilder>( + values_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.NamedTupleValue) + } + + // @@protoc_insertion_point(class_scope:tensorflow.NamedTupleValue) + private static final org.tensorflow.proto.Struct.NamedTupleValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.NamedTupleValue(); + } + + public static org.tensorflow.proto.Struct.NamedTupleValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NamedTupleValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.NamedTupleValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TensorSpecProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorSpecProto) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + } + /** + *
    +   * A protobuf to represent tf.TensorSpec.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorSpecProto} + */ + public static final class TensorSpecProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorSpecProto) + TensorSpecProtoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorSpecProto.class.getName()); + } + // Use TensorSpecProto.newBuilder() to construct. + private TensorSpecProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorSpecProto() { + name_ = ""; + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TensorSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TensorSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TensorSpecProto.class, org.tensorflow.proto.Struct.TensorSpecProto.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int DTYPE_FIELD_NUMBER = 3; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(3, dtype_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, dtype_); + } + size += getUnknownFields().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.Struct.TensorSpecProto)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.TensorSpecProto other = (org.tensorflow.proto.Struct.TensorSpecProto) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (dtype_ != other.dtype_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TensorSpecProto 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.Struct.TensorSpecProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TensorSpecProto 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.Struct.TensorSpecProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.TensorSpecProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.TensorSpecProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TensorSpecProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.TensorSpecProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A protobuf to represent tf.TensorSpec.
    +     * 
    + * + * Protobuf type {@code tensorflow.TensorSpecProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorSpecProto) + org.tensorflow.proto.Struct.TensorSpecProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TensorSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TensorSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TensorSpecProto.class, org.tensorflow.proto.Struct.TensorSpecProto.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.TensorSpecProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + dtype_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TensorSpecProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProto getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProto build() { + org.tensorflow.proto.Struct.TensorSpecProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TensorSpecProto buildPartial() { + org.tensorflow.proto.Struct.TensorSpecProto result = new org.tensorflow.proto.Struct.TensorSpecProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.TensorSpecProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dtype_ = dtype_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.TensorSpecProto) { + return mergeFrom((org.tensorflow.proto.Struct.TensorSpecProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.TensorSpecProto other) { + if (other == org.tensorflow.proto.Struct.TensorSpecProto.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 3; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 3; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 3; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000004); + dtype_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorSpecProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorSpecProto) + private static final org.tensorflow.proto.Struct.TensorSpecProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.TensorSpecProto(); + } + + public static org.tensorflow.proto.Struct.TensorSpecProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorSpecProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.TensorSpecProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BoundedTensorSpecProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.BoundedTensorSpecProto) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + * .tensorflow.TensorProto minimum = 4; + * @return Whether the minimum field is set. + */ + boolean hasMinimum(); + /** + * .tensorflow.TensorProto minimum = 4; + * @return The minimum. + */ + org.tensorflow.proto.TensorProto getMinimum(); + /** + * .tensorflow.TensorProto minimum = 4; + */ + org.tensorflow.proto.TensorProtoOrBuilder getMinimumOrBuilder(); + + /** + * .tensorflow.TensorProto maximum = 5; + * @return Whether the maximum field is set. + */ + boolean hasMaximum(); + /** + * .tensorflow.TensorProto maximum = 5; + * @return The maximum. + */ + org.tensorflow.proto.TensorProto getMaximum(); + /** + * .tensorflow.TensorProto maximum = 5; + */ + org.tensorflow.proto.TensorProtoOrBuilder getMaximumOrBuilder(); + } + /** + *
    +   * A protobuf to represent tf.BoundedTensorSpec.
    +   * 
    + * + * Protobuf type {@code tensorflow.BoundedTensorSpecProto} + */ + public static final class BoundedTensorSpecProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.BoundedTensorSpecProto) + BoundedTensorSpecProtoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BoundedTensorSpecProto.class.getName()); + } + // Use BoundedTensorSpecProto.newBuilder() to construct. + private BoundedTensorSpecProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BoundedTensorSpecProto() { + name_ = ""; + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.BoundedTensorSpecProto.class, org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int DTYPE_FIELD_NUMBER = 3; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int MINIMUM_FIELD_NUMBER = 4; + private org.tensorflow.proto.TensorProto minimum_; + /** + * .tensorflow.TensorProto minimum = 4; + * @return Whether the minimum field is set. + */ + @java.lang.Override + public boolean hasMinimum() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorProto minimum = 4; + * @return The minimum. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getMinimum() { + return minimum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : minimum_; + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getMinimumOrBuilder() { + return minimum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : minimum_; + } + + public static final int MAXIMUM_FIELD_NUMBER = 5; + private org.tensorflow.proto.TensorProto maximum_; + /** + * .tensorflow.TensorProto maximum = 5; + * @return Whether the maximum field is set. + */ + @java.lang.Override + public boolean hasMaximum() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .tensorflow.TensorProto maximum = 5; + * @return The maximum. + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getMaximum() { + return maximum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : maximum_; + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getMaximumOrBuilder() { + return maximum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : maximum_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(3, dtype_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getMinimum()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getMaximum()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, dtype_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getMinimum()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getMaximum()); + } + size += getUnknownFields().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.Struct.BoundedTensorSpecProto)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.BoundedTensorSpecProto other = (org.tensorflow.proto.Struct.BoundedTensorSpecProto) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (dtype_ != other.dtype_) return false; + if (hasMinimum() != other.hasMinimum()) return false; + if (hasMinimum()) { + if (!getMinimum() + .equals(other.getMinimum())) return false; + } + if (hasMaximum() != other.hasMaximum()) return false; + if (hasMaximum()) { + if (!getMaximum() + .equals(other.getMaximum())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasMinimum()) { + hash = (37 * hash) + MINIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMinimum().hashCode(); + } + if (hasMaximum()) { + hash = (37 * hash) + MAXIMUM_FIELD_NUMBER; + hash = (53 * hash) + getMaximum().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto 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.Struct.BoundedTensorSpecProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto 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.Struct.BoundedTensorSpecProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.BoundedTensorSpecProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A protobuf to represent tf.BoundedTensorSpec.
    +     * 
    + * + * Protobuf type {@code tensorflow.BoundedTensorSpecProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.BoundedTensorSpecProto) + org.tensorflow.proto.Struct.BoundedTensorSpecProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.BoundedTensorSpecProto.class, org.tensorflow.proto.Struct.BoundedTensorSpecProto.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.BoundedTensorSpecProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getMinimumFieldBuilder(); + getMaximumFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + dtype_ = 0; + minimum_ = null; + if (minimumBuilder_ != null) { + minimumBuilder_.dispose(); + minimumBuilder_ = null; + } + maximum_ = null; + if (maximumBuilder_ != null) { + maximumBuilder_.dispose(); + maximumBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_BoundedTensorSpecProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProto getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProto build() { + org.tensorflow.proto.Struct.BoundedTensorSpecProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.BoundedTensorSpecProto buildPartial() { + org.tensorflow.proto.Struct.BoundedTensorSpecProto result = new org.tensorflow.proto.Struct.BoundedTensorSpecProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.BoundedTensorSpecProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dtype_ = dtype_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.minimum_ = minimumBuilder_ == null + ? minimum_ + : minimumBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.maximum_ = maximumBuilder_ == null + ? maximum_ + : maximumBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.BoundedTensorSpecProto) { + return mergeFrom((org.tensorflow.proto.Struct.BoundedTensorSpecProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.BoundedTensorSpecProto other) { + if (other == org.tensorflow.proto.Struct.BoundedTensorSpecProto.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasMinimum()) { + mergeMinimum(other.getMinimum()); + } + if (other.hasMaximum()) { + mergeMaximum(other.getMaximum()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getMinimumFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + input.readMessage( + getMaximumFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 3; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 3; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 3; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 3; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 3; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000004); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorProto minimum_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> minimumBuilder_; + /** + * .tensorflow.TensorProto minimum = 4; + * @return Whether the minimum field is set. + */ + public boolean hasMinimum() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .tensorflow.TensorProto minimum = 4; + * @return The minimum. + */ + public org.tensorflow.proto.TensorProto getMinimum() { + if (minimumBuilder_ == null) { + return minimum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : minimum_; + } else { + return minimumBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public Builder setMinimum(org.tensorflow.proto.TensorProto value) { + if (minimumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minimum_ = value; + } else { + minimumBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public Builder setMinimum( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (minimumBuilder_ == null) { + minimum_ = builderForValue.build(); + } else { + minimumBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public Builder mergeMinimum(org.tensorflow.proto.TensorProto value) { + if (minimumBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + minimum_ != null && + minimum_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getMinimumBuilder().mergeFrom(value); + } else { + minimum_ = value; + } + } else { + minimumBuilder_.mergeFrom(value); + } + if (minimum_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public Builder clearMinimum() { + bitField0_ = (bitField0_ & ~0x00000008); + minimum_ = null; + if (minimumBuilder_ != null) { + minimumBuilder_.dispose(); + minimumBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public org.tensorflow.proto.TensorProto.Builder getMinimumBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getMinimumFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getMinimumOrBuilder() { + if (minimumBuilder_ != null) { + return minimumBuilder_.getMessageOrBuilder(); + } else { + return minimum_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : minimum_; + } + } + /** + * .tensorflow.TensorProto minimum = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getMinimumFieldBuilder() { + if (minimumBuilder_ == null) { + minimumBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getMinimum(), + getParentForChildren(), + isClean()); + minimum_ = null; + } + return minimumBuilder_; + } + + private org.tensorflow.proto.TensorProto maximum_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> maximumBuilder_; + /** + * .tensorflow.TensorProto maximum = 5; + * @return Whether the maximum field is set. + */ + public boolean hasMaximum() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .tensorflow.TensorProto maximum = 5; + * @return The maximum. + */ + public org.tensorflow.proto.TensorProto getMaximum() { + if (maximumBuilder_ == null) { + return maximum_ == null ? org.tensorflow.proto.TensorProto.getDefaultInstance() : maximum_; + } else { + return maximumBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public Builder setMaximum(org.tensorflow.proto.TensorProto value) { + if (maximumBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maximum_ = value; + } else { + maximumBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public Builder setMaximum( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (maximumBuilder_ == null) { + maximum_ = builderForValue.build(); + } else { + maximumBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public Builder mergeMaximum(org.tensorflow.proto.TensorProto value) { + if (maximumBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + maximum_ != null && + maximum_ != org.tensorflow.proto.TensorProto.getDefaultInstance()) { + getMaximumBuilder().mergeFrom(value); + } else { + maximum_ = value; + } + } else { + maximumBuilder_.mergeFrom(value); + } + if (maximum_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public Builder clearMaximum() { + bitField0_ = (bitField0_ & ~0x00000010); + maximum_ = null; + if (maximumBuilder_ != null) { + maximumBuilder_.dispose(); + maximumBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public org.tensorflow.proto.TensorProto.Builder getMaximumBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getMaximumFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getMaximumOrBuilder() { + if (maximumBuilder_ != null) { + return maximumBuilder_.getMessageOrBuilder(); + } else { + return maximum_ == null ? + org.tensorflow.proto.TensorProto.getDefaultInstance() : maximum_; + } + } + /** + * .tensorflow.TensorProto maximum = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getMaximumFieldBuilder() { + if (maximumBuilder_ == null) { + maximumBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + getMaximum(), + getParentForChildren(), + isClean()); + maximum_ = null; + } + return maximumBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.BoundedTensorSpecProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.BoundedTensorSpecProto) + private static final org.tensorflow.proto.Struct.BoundedTensorSpecProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.BoundedTensorSpecProto(); + } + + public static org.tensorflow.proto.Struct.BoundedTensorSpecProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BoundedTensorSpecProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.BoundedTensorSpecProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TypeSpecProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TypeSpecProto) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The enum numeric value on the wire for typeSpecClass. + */ + int getTypeSpecClassValue(); + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The typeSpecClass. + */ + org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass getTypeSpecClass(); + + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return Whether the typeState field is set. + */ + boolean hasTypeState(); + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return The typeState. + */ + org.tensorflow.proto.Struct.StructuredValue getTypeState(); + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + org.tensorflow.proto.Struct.StructuredValueOrBuilder getTypeStateOrBuilder(); + + /** + *
    +     * The name of the TypeSpec class.
    +     * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +     * the one registered under this name. For types registered outside
    +     * core TensorFlow by an add-on library, that library must be loaded
    +     * before this value can be deserialized by nested_structure_coder.
    +     * * If type_spec_class specifies a particular TypeSpec class, this field is
    +     * redundant with the type_spec_class enum, and is only used for error
    +     * reporting in older binaries that do not know the tupe_spec_class enum.
    +     * 
    + * + * string type_spec_class_name = 3; + * @return The typeSpecClassName. + */ + java.lang.String getTypeSpecClassName(); + /** + *
    +     * The name of the TypeSpec class.
    +     * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +     * the one registered under this name. For types registered outside
    +     * core TensorFlow by an add-on library, that library must be loaded
    +     * before this value can be deserialized by nested_structure_coder.
    +     * * If type_spec_class specifies a particular TypeSpec class, this field is
    +     * redundant with the type_spec_class enum, and is only used for error
    +     * reporting in older binaries that do not know the tupe_spec_class enum.
    +     * 
    + * + * string type_spec_class_name = 3; + * @return The bytes for typeSpecClassName. + */ + com.google.protobuf.ByteString + getTypeSpecClassNameBytes(); + + /** + *
    +     * The number of flat tensor components required by this TypeSpec.
    +     * 
    + * + * int32 num_flat_components = 4; + * @return The numFlatComponents. + */ + int getNumFlatComponents(); + } + /** + *
    +   * Represents a tf.TypeSpec
    +   * 
    + * + * Protobuf type {@code tensorflow.TypeSpecProto} + */ + public static final class TypeSpecProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TypeSpecProto) + TypeSpecProtoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TypeSpecProto.class.getName()); + } + // Use TypeSpecProto.newBuilder() to construct. + private TypeSpecProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TypeSpecProto() { + typeSpecClass_ = 0; + typeSpecClassName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TypeSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TypeSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TypeSpecProto.class, org.tensorflow.proto.Struct.TypeSpecProto.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.TypeSpecProto.TypeSpecClass} + */ + public enum TypeSpecClass + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
    +       * tf.SparseTensorSpec
    +       * 
    + * + * SPARSE_TENSOR_SPEC = 1; + */ + SPARSE_TENSOR_SPEC(1), + /** + *
    +       * tf.IndexedSlicesSpec
    +       * 
    + * + * INDEXED_SLICES_SPEC = 2; + */ + INDEXED_SLICES_SPEC(2), + /** + *
    +       * tf.RaggedTensorSpec
    +       * 
    + * + * RAGGED_TENSOR_SPEC = 3; + */ + RAGGED_TENSOR_SPEC(3), + /** + *
    +       * tf.TensorArraySpec
    +       * 
    + * + * TENSOR_ARRAY_SPEC = 4; + */ + TENSOR_ARRAY_SPEC(4), + /** + *
    +       * tf.data.DatasetSpec
    +       * 
    + * + * DATA_DATASET_SPEC = 5; + */ + DATA_DATASET_SPEC(5), + /** + *
    +       * IteratorSpec from data/ops/iterator_ops.py
    +       * 
    + * + * DATA_ITERATOR_SPEC = 6; + */ + DATA_ITERATOR_SPEC(6), + /** + *
    +       * tf.OptionalSpec
    +       * 
    + * + * OPTIONAL_SPEC = 7; + */ + OPTIONAL_SPEC(7), + /** + *
    +       * PerReplicaSpec from distribute/values.py
    +       * 
    + * + * PER_REPLICA_SPEC = 8; + */ + PER_REPLICA_SPEC(8), + /** + *
    +       * tf.VariableSpec
    +       * 
    + * + * VARIABLE_SPEC = 9; + */ + VARIABLE_SPEC(9), + /** + *
    +       * RowPartitionSpec from ragged/row_partition.py
    +       * 
    + * + * ROW_PARTITION_SPEC = 10; + */ + ROW_PARTITION_SPEC(10), + /** + *
    +       * The type registered as type_spec_class_name.
    +       * 
    + * + * REGISTERED_TYPE_SPEC = 12; + */ + REGISTERED_TYPE_SPEC(12), + /** + *
    +       * Subclasses of tf.ExtensionType
    +       * 
    + * + * EXTENSION_TYPE_SPEC = 13; + */ + EXTENSION_TYPE_SPEC(13), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TypeSpecClass.class.getName()); + } + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
    +       * tf.SparseTensorSpec
    +       * 
    + * + * SPARSE_TENSOR_SPEC = 1; + */ + public static final int SPARSE_TENSOR_SPEC_VALUE = 1; + /** + *
    +       * tf.IndexedSlicesSpec
    +       * 
    + * + * INDEXED_SLICES_SPEC = 2; + */ + public static final int INDEXED_SLICES_SPEC_VALUE = 2; + /** + *
    +       * tf.RaggedTensorSpec
    +       * 
    + * + * RAGGED_TENSOR_SPEC = 3; + */ + public static final int RAGGED_TENSOR_SPEC_VALUE = 3; + /** + *
    +       * tf.TensorArraySpec
    +       * 
    + * + * TENSOR_ARRAY_SPEC = 4; + */ + public static final int TENSOR_ARRAY_SPEC_VALUE = 4; + /** + *
    +       * tf.data.DatasetSpec
    +       * 
    + * + * DATA_DATASET_SPEC = 5; + */ + public static final int DATA_DATASET_SPEC_VALUE = 5; + /** + *
    +       * IteratorSpec from data/ops/iterator_ops.py
    +       * 
    + * + * DATA_ITERATOR_SPEC = 6; + */ + public static final int DATA_ITERATOR_SPEC_VALUE = 6; + /** + *
    +       * tf.OptionalSpec
    +       * 
    + * + * OPTIONAL_SPEC = 7; + */ + public static final int OPTIONAL_SPEC_VALUE = 7; + /** + *
    +       * PerReplicaSpec from distribute/values.py
    +       * 
    + * + * PER_REPLICA_SPEC = 8; + */ + public static final int PER_REPLICA_SPEC_VALUE = 8; + /** + *
    +       * tf.VariableSpec
    +       * 
    + * + * VARIABLE_SPEC = 9; + */ + public static final int VARIABLE_SPEC_VALUE = 9; + /** + *
    +       * RowPartitionSpec from ragged/row_partition.py
    +       * 
    + * + * ROW_PARTITION_SPEC = 10; + */ + public static final int ROW_PARTITION_SPEC_VALUE = 10; + /** + *
    +       * The type registered as type_spec_class_name.
    +       * 
    + * + * REGISTERED_TYPE_SPEC = 12; + */ + public static final int REGISTERED_TYPE_SPEC_VALUE = 12; + /** + *
    +       * Subclasses of tf.ExtensionType
    +       * 
    + * + * EXTENSION_TYPE_SPEC = 13; + */ + public static final int EXTENSION_TYPE_SPEC_VALUE = 13; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeSpecClass valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TypeSpecClass forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return SPARSE_TENSOR_SPEC; + case 2: return INDEXED_SLICES_SPEC; + case 3: return RAGGED_TENSOR_SPEC; + case 4: return TENSOR_ARRAY_SPEC; + case 5: return DATA_DATASET_SPEC; + case 6: return DATA_ITERATOR_SPEC; + case 7: return OPTIONAL_SPEC; + case 8: return PER_REPLICA_SPEC; + case 9: return VARIABLE_SPEC; + case 10: return ROW_PARTITION_SPEC; + case 12: return REGISTERED_TYPE_SPEC; + case 13: return EXTENSION_TYPE_SPEC; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + TypeSpecClass> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TypeSpecClass findValueByNumber(int number) { + return TypeSpecClass.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.Struct.TypeSpecProto.getDescriptor().getEnumTypes().get(0); + } + + private static final TypeSpecClass[] VALUES = values(); + + public static TypeSpecClass 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 TypeSpecClass(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.TypeSpecProto.TypeSpecClass) + } + + private int bitField0_; + public static final int TYPE_SPEC_CLASS_FIELD_NUMBER = 1; + private int typeSpecClass_ = 0; + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The enum numeric value on the wire for typeSpecClass. + */ + @java.lang.Override public int getTypeSpecClassValue() { + return typeSpecClass_; + } + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The typeSpecClass. + */ + @java.lang.Override public org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass getTypeSpecClass() { + org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass result = org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.forNumber(typeSpecClass_); + return result == null ? org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.UNRECOGNIZED : result; + } + + public static final int TYPE_STATE_FIELD_NUMBER = 2; + private org.tensorflow.proto.Struct.StructuredValue typeState_; + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return Whether the typeState field is set. + */ + @java.lang.Override + public boolean hasTypeState() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return The typeState. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValue getTypeState() { + return typeState_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : typeState_; + } + /** + *
    +     * The value returned by TypeSpec._serialize().
    +     * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getTypeStateOrBuilder() { + return typeState_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : typeState_; + } + + public static final int TYPE_SPEC_CLASS_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object typeSpecClassName_ = ""; + /** + *
    +     * The name of the TypeSpec class.
    +     * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +     * the one registered under this name. For types registered outside
    +     * core TensorFlow by an add-on library, that library must be loaded
    +     * before this value can be deserialized by nested_structure_coder.
    +     * * If type_spec_class specifies a particular TypeSpec class, this field is
    +     * redundant with the type_spec_class enum, and is only used for error
    +     * reporting in older binaries that do not know the tupe_spec_class enum.
    +     * 
    + * + * string type_spec_class_name = 3; + * @return The typeSpecClassName. + */ + @java.lang.Override + public java.lang.String getTypeSpecClassName() { + java.lang.Object ref = typeSpecClassName_; + 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(); + typeSpecClassName_ = s; + return s; + } + } + /** + *
    +     * The name of the TypeSpec class.
    +     * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +     * the one registered under this name. For types registered outside
    +     * core TensorFlow by an add-on library, that library must be loaded
    +     * before this value can be deserialized by nested_structure_coder.
    +     * * If type_spec_class specifies a particular TypeSpec class, this field is
    +     * redundant with the type_spec_class enum, and is only used for error
    +     * reporting in older binaries that do not know the tupe_spec_class enum.
    +     * 
    + * + * string type_spec_class_name = 3; + * @return The bytes for typeSpecClassName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeSpecClassNameBytes() { + java.lang.Object ref = typeSpecClassName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeSpecClassName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUM_FLAT_COMPONENTS_FIELD_NUMBER = 4; + private int numFlatComponents_ = 0; + /** + *
    +     * The number of flat tensor components required by this TypeSpec.
    +     * 
    + * + * int32 num_flat_components = 4; + * @return The numFlatComponents. + */ + @java.lang.Override + public int getNumFlatComponents() { + return numFlatComponents_; + } + + 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 (typeSpecClass_ != org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.UNKNOWN.getNumber()) { + output.writeEnum(1, typeSpecClass_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTypeState()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeSpecClassName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, typeSpecClassName_); + } + if (numFlatComponents_ != 0) { + output.writeInt32(4, numFlatComponents_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeSpecClass_ != org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, typeSpecClass_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTypeState()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeSpecClassName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, typeSpecClassName_); + } + if (numFlatComponents_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, numFlatComponents_); + } + size += getUnknownFields().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.Struct.TypeSpecProto)) { + return super.equals(obj); + } + org.tensorflow.proto.Struct.TypeSpecProto other = (org.tensorflow.proto.Struct.TypeSpecProto) obj; + + if (typeSpecClass_ != other.typeSpecClass_) return false; + if (hasTypeState() != other.hasTypeState()) return false; + if (hasTypeState()) { + if (!getTypeState() + .equals(other.getTypeState())) return false; + } + if (!getTypeSpecClassName() + .equals(other.getTypeSpecClassName())) return false; + if (getNumFlatComponents() + != other.getNumFlatComponents()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_SPEC_CLASS_FIELD_NUMBER; + hash = (53 * hash) + typeSpecClass_; + if (hasTypeState()) { + hash = (37 * hash) + TYPE_STATE_FIELD_NUMBER; + hash = (53 * hash) + getTypeState().hashCode(); + } + hash = (37 * hash) + TYPE_SPEC_CLASS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTypeSpecClassName().hashCode(); + hash = (37 * hash) + NUM_FLAT_COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getNumFlatComponents(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TypeSpecProto 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.Struct.TypeSpecProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TypeSpecProto 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.Struct.TypeSpecProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Struct.TypeSpecProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Struct.TypeSpecProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Struct.TypeSpecProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Struct.TypeSpecProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Represents a tf.TypeSpec
    +     * 
    + * + * Protobuf type {@code tensorflow.TypeSpecProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TypeSpecProto) + org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TypeSpecProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TypeSpecProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Struct.TypeSpecProto.class, org.tensorflow.proto.Struct.TypeSpecProto.Builder.class); + } + + // Construct using org.tensorflow.proto.Struct.TypeSpecProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTypeStateFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeSpecClass_ = 0; + typeState_ = null; + if (typeStateBuilder_ != null) { + typeStateBuilder_.dispose(); + typeStateBuilder_ = null; + } + typeSpecClassName_ = ""; + numFlatComponents_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.Struct.internal_static_tensorflow_TypeSpecProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto getDefaultInstanceForType() { + return org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto build() { + org.tensorflow.proto.Struct.TypeSpecProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto buildPartial() { + org.tensorflow.proto.Struct.TypeSpecProto result = new org.tensorflow.proto.Struct.TypeSpecProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Struct.TypeSpecProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeSpecClass_ = typeSpecClass_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.typeState_ = typeStateBuilder_ == null + ? typeState_ + : typeStateBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.typeSpecClassName_ = typeSpecClassName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.numFlatComponents_ = numFlatComponents_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Struct.TypeSpecProto) { + return mergeFrom((org.tensorflow.proto.Struct.TypeSpecProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Struct.TypeSpecProto other) { + if (other == org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance()) return this; + if (other.typeSpecClass_ != 0) { + setTypeSpecClassValue(other.getTypeSpecClassValue()); + } + if (other.hasTypeState()) { + mergeTypeState(other.getTypeState()); + } + if (!other.getTypeSpecClassName().isEmpty()) { + typeSpecClassName_ = other.typeSpecClassName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getNumFlatComponents() != 0) { + setNumFlatComponents(other.getNumFlatComponents()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + typeSpecClass_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getTypeStateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + typeSpecClassName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + numFlatComponents_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int typeSpecClass_ = 0; + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The enum numeric value on the wire for typeSpecClass. + */ + @java.lang.Override public int getTypeSpecClassValue() { + return typeSpecClass_; + } + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @param value The enum numeric value on the wire for typeSpecClass to set. + * @return This builder for chaining. + */ + public Builder setTypeSpecClassValue(int value) { + typeSpecClass_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return The typeSpecClass. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass getTypeSpecClass() { + org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass result = org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.forNumber(typeSpecClass_); + return result == null ? org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass.UNRECOGNIZED : result; + } + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @param value The typeSpecClass to set. + * @return This builder for chaining. + */ + public Builder setTypeSpecClass(org.tensorflow.proto.Struct.TypeSpecProto.TypeSpecClass value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + typeSpecClass_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.TypeSpecProto.TypeSpecClass type_spec_class = 1; + * @return This builder for chaining. + */ + public Builder clearTypeSpecClass() { + bitField0_ = (bitField0_ & ~0x00000001); + typeSpecClass_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.Struct.StructuredValue typeState_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> typeStateBuilder_; + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return Whether the typeState field is set. + */ + public boolean hasTypeState() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + * @return The typeState. + */ + public org.tensorflow.proto.Struct.StructuredValue getTypeState() { + if (typeStateBuilder_ == null) { + return typeState_ == null ? org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : typeState_; + } else { + return typeStateBuilder_.getMessage(); + } + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public Builder setTypeState(org.tensorflow.proto.Struct.StructuredValue value) { + if (typeStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + typeState_ = value; + } else { + typeStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public Builder setTypeState( + org.tensorflow.proto.Struct.StructuredValue.Builder builderForValue) { + if (typeStateBuilder_ == null) { + typeState_ = builderForValue.build(); + } else { + typeStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public Builder mergeTypeState(org.tensorflow.proto.Struct.StructuredValue value) { + if (typeStateBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + typeState_ != null && + typeState_ != org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance()) { + getTypeStateBuilder().mergeFrom(value); + } else { + typeState_ = value; + } + } else { + typeStateBuilder_.mergeFrom(value); + } + if (typeState_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public Builder clearTypeState() { + bitField0_ = (bitField0_ & ~0x00000002); + typeState_ = null; + if (typeStateBuilder_ != null) { + typeStateBuilder_.dispose(); + typeStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public org.tensorflow.proto.Struct.StructuredValue.Builder getTypeStateBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTypeStateFieldBuilder().getBuilder(); + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + public org.tensorflow.proto.Struct.StructuredValueOrBuilder getTypeStateOrBuilder() { + if (typeStateBuilder_ != null) { + return typeStateBuilder_.getMessageOrBuilder(); + } else { + return typeState_ == null ? + org.tensorflow.proto.Struct.StructuredValue.getDefaultInstance() : typeState_; + } + } + /** + *
    +       * The value returned by TypeSpec._serialize().
    +       * 
    + * + * .tensorflow.StructuredValue type_state = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder> + getTypeStateFieldBuilder() { + if (typeStateBuilder_ == null) { + typeStateBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.StructuredValue, org.tensorflow.proto.Struct.StructuredValue.Builder, org.tensorflow.proto.Struct.StructuredValueOrBuilder>( + getTypeState(), + getParentForChildren(), + isClean()); + typeState_ = null; + } + return typeStateBuilder_; + } + + private java.lang.Object typeSpecClassName_ = ""; + /** + *
    +       * The name of the TypeSpec class.
    +       * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +       * the one registered under this name. For types registered outside
    +       * core TensorFlow by an add-on library, that library must be loaded
    +       * before this value can be deserialized by nested_structure_coder.
    +       * * If type_spec_class specifies a particular TypeSpec class, this field is
    +       * redundant with the type_spec_class enum, and is only used for error
    +       * reporting in older binaries that do not know the tupe_spec_class enum.
    +       * 
    + * + * string type_spec_class_name = 3; + * @return The typeSpecClassName. + */ + public java.lang.String getTypeSpecClassName() { + java.lang.Object ref = typeSpecClassName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeSpecClassName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The name of the TypeSpec class.
    +       * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +       * the one registered under this name. For types registered outside
    +       * core TensorFlow by an add-on library, that library must be loaded
    +       * before this value can be deserialized by nested_structure_coder.
    +       * * If type_spec_class specifies a particular TypeSpec class, this field is
    +       * redundant with the type_spec_class enum, and is only used for error
    +       * reporting in older binaries that do not know the tupe_spec_class enum.
    +       * 
    + * + * string type_spec_class_name = 3; + * @return The bytes for typeSpecClassName. + */ + public com.google.protobuf.ByteString + getTypeSpecClassNameBytes() { + java.lang.Object ref = typeSpecClassName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeSpecClassName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The name of the TypeSpec class.
    +       * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +       * the one registered under this name. For types registered outside
    +       * core TensorFlow by an add-on library, that library must be loaded
    +       * before this value can be deserialized by nested_structure_coder.
    +       * * If type_spec_class specifies a particular TypeSpec class, this field is
    +       * redundant with the type_spec_class enum, and is only used for error
    +       * reporting in older binaries that do not know the tupe_spec_class enum.
    +       * 
    + * + * string type_spec_class_name = 3; + * @param value The typeSpecClassName to set. + * @return This builder for chaining. + */ + public Builder setTypeSpecClassName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + typeSpecClassName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The name of the TypeSpec class.
    +       * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +       * the one registered under this name. For types registered outside
    +       * core TensorFlow by an add-on library, that library must be loaded
    +       * before this value can be deserialized by nested_structure_coder.
    +       * * If type_spec_class specifies a particular TypeSpec class, this field is
    +       * redundant with the type_spec_class enum, and is only used for error
    +       * reporting in older binaries that do not know the tupe_spec_class enum.
    +       * 
    + * + * string type_spec_class_name = 3; + * @return This builder for chaining. + */ + public Builder clearTypeSpecClassName() { + typeSpecClassName_ = getDefaultInstance().getTypeSpecClassName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * The name of the TypeSpec class.
    +       * * If type_spec_class == REGISTERED_TYPE_SPEC, the TypeSpec class is
    +       * the one registered under this name. For types registered outside
    +       * core TensorFlow by an add-on library, that library must be loaded
    +       * before this value can be deserialized by nested_structure_coder.
    +       * * If type_spec_class specifies a particular TypeSpec class, this field is
    +       * redundant with the type_spec_class enum, and is only used for error
    +       * reporting in older binaries that do not know the tupe_spec_class enum.
    +       * 
    + * + * string type_spec_class_name = 3; + * @param value The bytes for typeSpecClassName to set. + * @return This builder for chaining. + */ + public Builder setTypeSpecClassNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + typeSpecClassName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int numFlatComponents_ ; + /** + *
    +       * The number of flat tensor components required by this TypeSpec.
    +       * 
    + * + * int32 num_flat_components = 4; + * @return The numFlatComponents. + */ + @java.lang.Override + public int getNumFlatComponents() { + return numFlatComponents_; + } + /** + *
    +       * The number of flat tensor components required by this TypeSpec.
    +       * 
    + * + * int32 num_flat_components = 4; + * @param value The numFlatComponents to set. + * @return This builder for chaining. + */ + public Builder setNumFlatComponents(int value) { + + numFlatComponents_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * The number of flat tensor components required by this TypeSpec.
    +       * 
    + * + * int32 num_flat_components = 4; + * @return This builder for chaining. + */ + public Builder clearNumFlatComponents() { + bitField0_ = (bitField0_ & ~0x00000008); + numFlatComponents_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TypeSpecProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TypeSpecProto) + private static final org.tensorflow.proto.Struct.TypeSpecProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Struct.TypeSpecProto(); + } + + public static org.tensorflow.proto.Struct.TypeSpecProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TypeSpecProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Struct.TypeSpecProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_StructuredValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_StructuredValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NoneValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NoneValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_ListValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_ListValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TupleValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TupleValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DictValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DictValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_DictValue_FieldsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_DictValue_FieldsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_PairValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_PairValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_NamedTupleValue_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_NamedTupleValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorSpecProto_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorSpecProto_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_BoundedTensorSpecProto_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TypeSpecProto_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TypeSpecProto_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/struct.proto\022" + + "\ntensorflow\032&tensorflow/core/framework/t" + + "ensor.proto\032,tensorflow/core/framework/t" + + "ensor_shape.proto\032%tensorflow/core/frame" + + "work/types.proto\"\361\005\n\017StructuredValue\022+\n\n" + + "none_value\030\001 \001(\0132\025.tensorflow.NoneValueH" + + "\000\022\027\n\rfloat64_value\030\013 \001(\001H\000\022\025\n\013int64_valu" + + "e\030\014 \001(\022H\000\022\026\n\014string_value\030\r \001(\tH\000\022\024\n\nboo" + + "l_value\030\016 \001(\010H\000\022:\n\022tensor_shape_value\030\037 " + + "\001(\0132\034.tensorflow.TensorShapeProtoH\000\0222\n\022t" + + "ensor_dtype_value\030 \001(\0162\024.tensorflow.Dat" + + "aTypeH\000\0228\n\021tensor_spec_value\030! \001(\0132\033.ten" + + "sorflow.TensorSpecProtoH\000\0224\n\017type_spec_v" + + "alue\030\" \001(\0132\031.tensorflow.TypeSpecProtoH\000\022" + + "G\n\031bounded_tensor_spec_value\030# \001(\0132\".ten" + + "sorflow.BoundedTensorSpecProtoH\000\022+\n\nlist" + + "_value\0303 \001(\0132\025.tensorflow.ListValueH\000\022-\n" + + "\013tuple_value\0304 \001(\0132\026.tensorflow.TupleVal" + + "ueH\000\022+\n\ndict_value\0305 \001(\0132\025.tensorflow.Di" + + "ctValueH\000\0228\n\021named_tuple_value\0306 \001(\0132\033.t" + + "ensorflow.NamedTupleValueH\000\022/\n\014tensor_va" + + "lue\0307 \001(\0132\027.tensorflow.TensorProtoH\000\022.\n\013" + + "numpy_value\0308 \001(\0132\027.tensorflow.TensorPro" + + "toH\000B\006\n\004kind\"\013\n\tNoneValue\"8\n\tListValue\022+" + + "\n\006values\030\001 \003(\0132\033.tensorflow.StructuredVa" + + "lue\"9\n\nTupleValue\022+\n\006values\030\001 \003(\0132\033.tens" + + "orflow.StructuredValue\"\212\001\n\tDictValue\0221\n\006" + + "fields\030\001 \003(\0132!.tensorflow.DictValue.Fiel" + + "dsEntry\032J\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022*\n\005v" + + "alue\030\002 \001(\0132\033.tensorflow.StructuredValue:" + + "\0028\001\"D\n\tPairValue\022\013\n\003key\030\001 \001(\t\022*\n\005value\030\002" + + " \001(\0132\033.tensorflow.StructuredValue\"F\n\017Nam" + + "edTupleValue\022\014\n\004name\030\001 \001(\t\022%\n\006values\030\002 \003" + + "(\0132\025.tensorflow.PairValue\"q\n\017TensorSpecP" + + "roto\022\014\n\004name\030\001 \001(\t\022+\n\005shape\030\002 \001(\0132\034.tens" + + "orflow.TensorShapeProto\022#\n\005dtype\030\003 \001(\0162\024" + + ".tensorflow.DataType\"\314\001\n\026BoundedTensorSp" + + "ecProto\022\014\n\004name\030\001 \001(\t\022+\n\005shape\030\002 \001(\0132\034.t" + + "ensorflow.TensorShapeProto\022#\n\005dtype\030\003 \001(" + + "\0162\024.tensorflow.DataType\022(\n\007minimum\030\004 \001(\013" + + "2\027.tensorflow.TensorProto\022(\n\007maximum\030\005 \001" + + "(\0132\027.tensorflow.TensorProto\"\370\003\n\rTypeSpec" + + "Proto\022@\n\017type_spec_class\030\001 \001(\0162\'.tensorf" + + "low.TypeSpecProto.TypeSpecClass\022/\n\ntype_" + + "state\030\002 \001(\0132\033.tensorflow.StructuredValue" + + "\022\034\n\024type_spec_class_name\030\003 \001(\t\022\033\n\023num_fl" + + "at_components\030\004 \001(\005\"\270\002\n\rTypeSpecClass\022\013\n" + + "\007UNKNOWN\020\000\022\026\n\022SPARSE_TENSOR_SPEC\020\001\022\027\n\023IN" + + "DEXED_SLICES_SPEC\020\002\022\026\n\022RAGGED_TENSOR_SPE" + + "C\020\003\022\025\n\021TENSOR_ARRAY_SPEC\020\004\022\025\n\021DATA_DATAS" + + "ET_SPEC\020\005\022\026\n\022DATA_ITERATOR_SPEC\020\006\022\021\n\rOPT" + + "IONAL_SPEC\020\007\022\024\n\020PER_REPLICA_SPEC\020\010\022\021\n\rVA" + + "RIABLE_SPEC\020\t\022\026\n\022ROW_PARTITION_SPEC\020\n\022\030\n" + + "\024REGISTERED_TYPE_SPEC\020\014\022\027\n\023EXTENSION_TYP" + + "E_SPEC\020\r\"\004\010\013\020\013Bm\n\024org.tensorflow.protoZU" + + "github.com/tensorflow/tensorflow/tensorf" + + "low/go/core/protobuf/for_core_protos_go_" + + "protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_StructuredValue_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_StructuredValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_StructuredValue_descriptor, + new java.lang.String[] { "NoneValue", "Float64Value", "Int64Value", "StringValue", "BoolValue", "TensorShapeValue", "TensorDtypeValue", "TensorSpecValue", "TypeSpecValue", "BoundedTensorSpecValue", "ListValue", "TupleValue", "DictValue", "NamedTupleValue", "TensorValue", "NumpyValue", "Kind", }); + internal_static_tensorflow_NoneValue_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_NoneValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NoneValue_descriptor, + new java.lang.String[] { }); + internal_static_tensorflow_ListValue_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_ListValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_ListValue_descriptor, + new java.lang.String[] { "Values", }); + internal_static_tensorflow_TupleValue_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_TupleValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TupleValue_descriptor, + new java.lang.String[] { "Values", }); + internal_static_tensorflow_DictValue_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_DictValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DictValue_descriptor, + new java.lang.String[] { "Fields", }); + internal_static_tensorflow_DictValue_FieldsEntry_descriptor = + internal_static_tensorflow_DictValue_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_DictValue_FieldsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_DictValue_FieldsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_PairValue_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_PairValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_PairValue_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_NamedTupleValue_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_NamedTupleValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_NamedTupleValue_descriptor, + new java.lang.String[] { "Name", "Values", }); + internal_static_tensorflow_TensorSpecProto_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_tensorflow_TensorSpecProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorSpecProto_descriptor, + new java.lang.String[] { "Name", "Shape", "Dtype", }); + internal_static_tensorflow_BoundedTensorSpecProto_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_tensorflow_BoundedTensorSpecProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_BoundedTensorSpecProto_descriptor, + new java.lang.String[] { "Name", "Shape", "Dtype", "Minimum", "Maximum", }); + internal_static_tensorflow_TypeSpecProto_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_tensorflow_TypeSpecProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TypeSpecProto_descriptor, + new java.lang.String[] { "TypeSpecClass", "TypeState", "TypeSpecClassName", "NumFlatComponents", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Summary.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Summary.java new file mode 100644 index 00000000000..ee1bb65c4cd --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/Summary.java @@ -0,0 +1,4714 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/summary.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A Summary is a set of named values to be displayed by the
    + * visualizer.
    + *
    + * Summaries are produced regularly during training, as controlled by
    + * the "summary_interval_secs" attribute of the training operation.
    + * Summaries are also produced at the end of an evaluation.
    + * 
    + * + * Protobuf type {@code tensorflow.Summary} + */ +public final class Summary extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Summary) + SummaryOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Summary.class.getName()); + } + // Use Summary.newBuilder() to construct. + private Summary(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Summary() { + value_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Summary.class, org.tensorflow.proto.Summary.Builder.class); + } + + public interface ImageOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.Summary.Image) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Dimensions of the image.
    +     * 
    + * + * int32 height = 1; + * @return The height. + */ + int getHeight(); + + /** + * int32 width = 2; + * @return The width. + */ + int getWidth(); + + /** + *
    +     * Valid colorspace values are
    +     * 1 - grayscale
    +     * 2 - grayscale + alpha
    +     * 3 - RGB
    +     * 4 - RGBA
    +     * 5 - DIGITAL_YUV
    +     * 6 - BGRA
    +     * 
    + * + * int32 colorspace = 3; + * @return The colorspace. + */ + int getColorspace(); + + /** + *
    +     * Image data in encoded format.  All image formats supported by
    +     * image_codec::CoderUtil can be stored here.
    +     * 
    + * + * bytes encoded_image_string = 4; + * @return The encodedImageString. + */ + com.google.protobuf.ByteString getEncodedImageString(); + } + /** + * Protobuf type {@code tensorflow.Summary.Image} + */ + public static final class Image extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Summary.Image) + ImageOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Image.class.getName()); + } + // Use Image.newBuilder() to construct. + private Image(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Image() { + encodedImageString_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Summary.Image.class, org.tensorflow.proto.Summary.Image.Builder.class); + } + + public static final int HEIGHT_FIELD_NUMBER = 1; + private int height_ = 0; + /** + *
    +     * Dimensions of the image.
    +     * 
    + * + * int32 height = 1; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 2; + private int width_ = 0; + /** + * int32 width = 2; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + + public static final int COLORSPACE_FIELD_NUMBER = 3; + private int colorspace_ = 0; + /** + *
    +     * Valid colorspace values are
    +     * 1 - grayscale
    +     * 2 - grayscale + alpha
    +     * 3 - RGB
    +     * 4 - RGBA
    +     * 5 - DIGITAL_YUV
    +     * 6 - BGRA
    +     * 
    + * + * int32 colorspace = 3; + * @return The colorspace. + */ + @java.lang.Override + public int getColorspace() { + return colorspace_; + } + + public static final int ENCODED_IMAGE_STRING_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString encodedImageString_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Image data in encoded format.  All image formats supported by
    +     * image_codec::CoderUtil can be stored here.
    +     * 
    + * + * bytes encoded_image_string = 4; + * @return The encodedImageString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedImageString() { + return encodedImageString_; + } + + 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 (height_ != 0) { + output.writeInt32(1, height_); + } + if (width_ != 0) { + output.writeInt32(2, width_); + } + if (colorspace_ != 0) { + output.writeInt32(3, colorspace_); + } + if (!encodedImageString_.isEmpty()) { + output.writeBytes(4, encodedImageString_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, height_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, width_); + } + if (colorspace_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, colorspace_); + } + if (!encodedImageString_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, encodedImageString_); + } + size += getUnknownFields().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.Summary.Image)) { + return super.equals(obj); + } + org.tensorflow.proto.Summary.Image other = (org.tensorflow.proto.Summary.Image) obj; + + if (getHeight() + != other.getHeight()) return false; + if (getWidth() + != other.getWidth()) return false; + if (getColorspace() + != other.getColorspace()) return false; + if (!getEncodedImageString() + .equals(other.getEncodedImageString())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (37 * hash) + COLORSPACE_FIELD_NUMBER; + hash = (53 * hash) + getColorspace(); + hash = (37 * hash) + ENCODED_IMAGE_STRING_FIELD_NUMBER; + hash = (53 * hash) + getEncodedImageString().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Summary.Image parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Image 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.Summary.Image parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Image 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.Summary.Image parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Image parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Summary.Image parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Summary.Image parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Summary.Image parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Summary.Image parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Summary.Image parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Summary.Image parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Summary.Image 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.Summary.Image} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Summary.Image) + org.tensorflow.proto.Summary.ImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Image_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Summary.Image.class, org.tensorflow.proto.Summary.Image.Builder.class); + } + + // Construct using org.tensorflow.proto.Summary.Image.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + height_ = 0; + width_ = 0; + colorspace_ = 0; + encodedImageString_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Image_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Image getDefaultInstanceForType() { + return org.tensorflow.proto.Summary.Image.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Image build() { + org.tensorflow.proto.Summary.Image result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Image buildPartial() { + org.tensorflow.proto.Summary.Image result = new org.tensorflow.proto.Summary.Image(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Summary.Image result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.height_ = height_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.width_ = width_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.colorspace_ = colorspace_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.encodedImageString_ = encodedImageString_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Summary.Image) { + return mergeFrom((org.tensorflow.proto.Summary.Image)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Summary.Image other) { + if (other == org.tensorflow.proto.Summary.Image.getDefaultInstance()) return this; + if (other.getHeight() != 0) { + setHeight(other.getHeight()); + } + if (other.getWidth() != 0) { + setWidth(other.getWidth()); + } + if (other.getColorspace() != 0) { + setColorspace(other.getColorspace()); + } + if (other.getEncodedImageString() != com.google.protobuf.ByteString.EMPTY) { + setEncodedImageString(other.getEncodedImageString()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + height_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + width_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + colorspace_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + encodedImageString_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int height_ ; + /** + *
    +       * Dimensions of the image.
    +       * 
    + * + * int32 height = 1; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + /** + *
    +       * Dimensions of the image.
    +       * 
    + * + * int32 height = 1; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + + height_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Dimensions of the image.
    +       * 
    + * + * int32 height = 1; + * @return This builder for chaining. + */ + public Builder clearHeight() { + bitField0_ = (bitField0_ & ~0x00000001); + height_ = 0; + onChanged(); + return this; + } + + private int width_ ; + /** + * int32 width = 2; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + /** + * int32 width = 2; + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { + + width_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 width = 2; + * @return This builder for chaining. + */ + public Builder clearWidth() { + bitField0_ = (bitField0_ & ~0x00000002); + width_ = 0; + onChanged(); + return this; + } + + private int colorspace_ ; + /** + *
    +       * Valid colorspace values are
    +       * 1 - grayscale
    +       * 2 - grayscale + alpha
    +       * 3 - RGB
    +       * 4 - RGBA
    +       * 5 - DIGITAL_YUV
    +       * 6 - BGRA
    +       * 
    + * + * int32 colorspace = 3; + * @return The colorspace. + */ + @java.lang.Override + public int getColorspace() { + return colorspace_; + } + /** + *
    +       * Valid colorspace values are
    +       * 1 - grayscale
    +       * 2 - grayscale + alpha
    +       * 3 - RGB
    +       * 4 - RGBA
    +       * 5 - DIGITAL_YUV
    +       * 6 - BGRA
    +       * 
    + * + * int32 colorspace = 3; + * @param value The colorspace to set. + * @return This builder for chaining. + */ + public Builder setColorspace(int value) { + + colorspace_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Valid colorspace values are
    +       * 1 - grayscale
    +       * 2 - grayscale + alpha
    +       * 3 - RGB
    +       * 4 - RGBA
    +       * 5 - DIGITAL_YUV
    +       * 6 - BGRA
    +       * 
    + * + * int32 colorspace = 3; + * @return This builder for chaining. + */ + public Builder clearColorspace() { + bitField0_ = (bitField0_ & ~0x00000004); + colorspace_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString encodedImageString_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * Image data in encoded format.  All image formats supported by
    +       * image_codec::CoderUtil can be stored here.
    +       * 
    + * + * bytes encoded_image_string = 4; + * @return The encodedImageString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedImageString() { + return encodedImageString_; + } + /** + *
    +       * Image data in encoded format.  All image formats supported by
    +       * image_codec::CoderUtil can be stored here.
    +       * 
    + * + * bytes encoded_image_string = 4; + * @param value The encodedImageString to set. + * @return This builder for chaining. + */ + public Builder setEncodedImageString(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + encodedImageString_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Image data in encoded format.  All image formats supported by
    +       * image_codec::CoderUtil can be stored here.
    +       * 
    + * + * bytes encoded_image_string = 4; + * @return This builder for chaining. + */ + public Builder clearEncodedImageString() { + bitField0_ = (bitField0_ & ~0x00000008); + encodedImageString_ = getDefaultInstance().getEncodedImageString(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Summary.Image) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Summary.Image) + private static final org.tensorflow.proto.Summary.Image DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Summary.Image(); + } + + public static org.tensorflow.proto.Summary.Image getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Image parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Summary.Image getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AudioOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.Summary.Audio) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Sample rate of the audio in Hz.
    +     * 
    + * + * float sample_rate = 1; + * @return The sampleRate. + */ + float getSampleRate(); + + /** + *
    +     * Number of channels of audio.
    +     * 
    + * + * int64 num_channels = 2; + * @return The numChannels. + */ + long getNumChannels(); + + /** + *
    +     * Length of the audio in frames (samples per channel).
    +     * 
    + * + * int64 length_frames = 3; + * @return The lengthFrames. + */ + long getLengthFrames(); + + /** + *
    +     * Encoded audio data and its associated RFC 2045 content type (e.g.
    +     * "audio/wav").
    +     * 
    + * + * bytes encoded_audio_string = 4; + * @return The encodedAudioString. + */ + com.google.protobuf.ByteString getEncodedAudioString(); + + /** + * string content_type = 5; + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * string content_type = 5; + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString + getContentTypeBytes(); + } + /** + * Protobuf type {@code tensorflow.Summary.Audio} + */ + public static final class Audio extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.Summary.Audio) + AudioOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Audio.class.getName()); + } + // Use Audio.newBuilder() to construct. + private Audio(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Audio() { + encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; + contentType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Audio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Summary.Audio.class, org.tensorflow.proto.Summary.Audio.Builder.class); + } + + public static final int SAMPLE_RATE_FIELD_NUMBER = 1; + private float sampleRate_ = 0F; + /** + *
    +     * Sample rate of the audio in Hz.
    +     * 
    + * + * float sample_rate = 1; + * @return The sampleRate. + */ + @java.lang.Override + public float getSampleRate() { + return sampleRate_; + } + + public static final int NUM_CHANNELS_FIELD_NUMBER = 2; + private long numChannels_ = 0L; + /** + *
    +     * Number of channels of audio.
    +     * 
    + * + * int64 num_channels = 2; + * @return The numChannels. + */ + @java.lang.Override + public long getNumChannels() { + return numChannels_; + } + + public static final int LENGTH_FRAMES_FIELD_NUMBER = 3; + private long lengthFrames_ = 0L; + /** + *
    +     * Length of the audio in frames (samples per channel).
    +     * 
    + * + * int64 length_frames = 3; + * @return The lengthFrames. + */ + @java.lang.Override + public long getLengthFrames() { + return lengthFrames_; + } + + public static final int ENCODED_AUDIO_STRING_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Encoded audio data and its associated RFC 2045 content type (e.g.
    +     * "audio/wav").
    +     * 
    + * + * bytes encoded_audio_string = 4; + * @return The encodedAudioString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedAudioString() { + return encodedAudioString_; + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object contentType_ = ""; + /** + * string content_type = 5; + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + * string content_type = 5; + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (java.lang.Float.floatToRawIntBits(sampleRate_) != 0) { + output.writeFloat(1, sampleRate_); + } + if (numChannels_ != 0L) { + output.writeInt64(2, numChannels_); + } + if (lengthFrames_ != 0L) { + output.writeInt64(3, lengthFrames_); + } + if (!encodedAudioString_.isEmpty()) { + output.writeBytes(4, encodedAudioString_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contentType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, contentType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(sampleRate_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, sampleRate_); + } + if (numChannels_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, numChannels_); + } + if (lengthFrames_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, lengthFrames_); + } + if (!encodedAudioString_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, encodedAudioString_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contentType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, contentType_); + } + size += getUnknownFields().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.Summary.Audio)) { + return super.equals(obj); + } + org.tensorflow.proto.Summary.Audio other = (org.tensorflow.proto.Summary.Audio) obj; + + if (java.lang.Float.floatToIntBits(getSampleRate()) + != java.lang.Float.floatToIntBits( + other.getSampleRate())) return false; + if (getNumChannels() + != other.getNumChannels()) return false; + if (getLengthFrames() + != other.getLengthFrames()) return false; + if (!getEncodedAudioString() + .equals(other.getEncodedAudioString())) return false; + if (!getContentType() + .equals(other.getContentType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SAMPLE_RATE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSampleRate()); + hash = (37 * hash) + NUM_CHANNELS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumChannels()); + hash = (37 * hash) + LENGTH_FRAMES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLengthFrames()); + hash = (37 * hash) + ENCODED_AUDIO_STRING_FIELD_NUMBER; + hash = (53 * hash) + getEncodedAudioString().hashCode(); + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.Summary.Audio parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Audio 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.Summary.Audio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Audio 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.Summary.Audio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.Summary.Audio parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.Summary.Audio parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Summary.Audio parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.Summary.Audio parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.Summary.Audio parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.Summary.Audio parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.Summary.Audio parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Summary.Audio 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.Summary.Audio} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.Summary.Audio) + org.tensorflow.proto.Summary.AudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Audio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.Summary.Audio.class, org.tensorflow.proto.Summary.Audio.Builder.class); + } + + // Construct using org.tensorflow.proto.Summary.Audio.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sampleRate_ = 0F; + numChannels_ = 0L; + lengthFrames_ = 0L; + encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; + contentType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_Summary_Audio_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Audio getDefaultInstanceForType() { + return org.tensorflow.proto.Summary.Audio.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Audio build() { + org.tensorflow.proto.Summary.Audio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.Summary.Audio buildPartial() { + org.tensorflow.proto.Summary.Audio result = new org.tensorflow.proto.Summary.Audio(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.Summary.Audio result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sampleRate_ = sampleRate_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.numChannels_ = numChannels_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lengthFrames_ = lengthFrames_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.encodedAudioString_ = encodedAudioString_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.contentType_ = contentType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.Summary.Audio) { + return mergeFrom((org.tensorflow.proto.Summary.Audio)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.Summary.Audio other) { + if (other == org.tensorflow.proto.Summary.Audio.getDefaultInstance()) return this; + if (other.getSampleRate() != 0F) { + setSampleRate(other.getSampleRate()); + } + if (other.getNumChannels() != 0L) { + setNumChannels(other.getNumChannels()); + } + if (other.getLengthFrames() != 0L) { + setLengthFrames(other.getLengthFrames()); + } + if (other.getEncodedAudioString() != com.google.protobuf.ByteString.EMPTY) { + setEncodedAudioString(other.getEncodedAudioString()); + } + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + sampleRate_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 16: { + numChannels_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + lengthFrames_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + encodedAudioString_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + contentType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private float sampleRate_ ; + /** + *
    +       * Sample rate of the audio in Hz.
    +       * 
    + * + * float sample_rate = 1; + * @return The sampleRate. + */ + @java.lang.Override + public float getSampleRate() { + return sampleRate_; + } + /** + *
    +       * Sample rate of the audio in Hz.
    +       * 
    + * + * float sample_rate = 1; + * @param value The sampleRate to set. + * @return This builder for chaining. + */ + public Builder setSampleRate(float value) { + + sampleRate_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Sample rate of the audio in Hz.
    +       * 
    + * + * float sample_rate = 1; + * @return This builder for chaining. + */ + public Builder clearSampleRate() { + bitField0_ = (bitField0_ & ~0x00000001); + sampleRate_ = 0F; + onChanged(); + return this; + } + + private long numChannels_ ; + /** + *
    +       * Number of channels of audio.
    +       * 
    + * + * int64 num_channels = 2; + * @return The numChannels. + */ + @java.lang.Override + public long getNumChannels() { + return numChannels_; + } + /** + *
    +       * Number of channels of audio.
    +       * 
    + * + * int64 num_channels = 2; + * @param value The numChannels to set. + * @return This builder for chaining. + */ + public Builder setNumChannels(long value) { + + numChannels_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Number of channels of audio.
    +       * 
    + * + * int64 num_channels = 2; + * @return This builder for chaining. + */ + public Builder clearNumChannels() { + bitField0_ = (bitField0_ & ~0x00000002); + numChannels_ = 0L; + onChanged(); + return this; + } + + private long lengthFrames_ ; + /** + *
    +       * Length of the audio in frames (samples per channel).
    +       * 
    + * + * int64 length_frames = 3; + * @return The lengthFrames. + */ + @java.lang.Override + public long getLengthFrames() { + return lengthFrames_; + } + /** + *
    +       * Length of the audio in frames (samples per channel).
    +       * 
    + * + * int64 length_frames = 3; + * @param value The lengthFrames to set. + * @return This builder for chaining. + */ + public Builder setLengthFrames(long value) { + + lengthFrames_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Length of the audio in frames (samples per channel).
    +       * 
    + * + * int64 length_frames = 3; + * @return This builder for chaining. + */ + public Builder clearLengthFrames() { + bitField0_ = (bitField0_ & ~0x00000004); + lengthFrames_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString encodedAudioString_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * Encoded audio data and its associated RFC 2045 content type (e.g.
    +       * "audio/wav").
    +       * 
    + * + * bytes encoded_audio_string = 4; + * @return The encodedAudioString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncodedAudioString() { + return encodedAudioString_; + } + /** + *
    +       * Encoded audio data and its associated RFC 2045 content type (e.g.
    +       * "audio/wav").
    +       * 
    + * + * bytes encoded_audio_string = 4; + * @param value The encodedAudioString to set. + * @return This builder for chaining. + */ + public Builder setEncodedAudioString(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + encodedAudioString_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Encoded audio data and its associated RFC 2045 content type (e.g.
    +       * "audio/wav").
    +       * 
    + * + * bytes encoded_audio_string = 4; + * @return This builder for chaining. + */ + public Builder clearEncodedAudioString() { + bitField0_ = (bitField0_ & ~0x00000008); + encodedAudioString_ = getDefaultInstance().getEncodedAudioString(); + onChanged(); + return this; + } + + private java.lang.Object contentType_ = ""; + /** + * string content_type = 5; + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content_type = 5; + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content_type = 5; + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contentType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * string content_type = 5; + * @return This builder for chaining. + */ + public Builder clearContentType() { + contentType_ = getDefaultInstance().getContentType(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * string content_type = 5; + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contentType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.Summary.Audio) + } + + // @@protoc_insertion_point(class_scope:tensorflow.Summary.Audio) + private static final org.tensorflow.proto.Summary.Audio DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.Summary.Audio(); + } + + public static org.tensorflow.proto.Summary.Audio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
    * * string type_hint = 1; + * @return The typeHint. */ java.lang.String getTypeHint(); /** @@ -23,6 +26,7 @@ public interface SummaryDescriptionOrBuilder extends * * * string type_hint = 1; + * @return The bytes for typeHint. */ com.google.protobuf.ByteString getTypeHintBytes(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadata.java new file mode 100644 index 00000000000..5991e77f41c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadata.java @@ -0,0 +1,1731 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/summary.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * A SummaryMetadata encapsulates information on which plugins are able to make
    + * use of a certain summary value.
    + * 
    + * + * Protobuf type {@code tensorflow.SummaryMetadata} + */ +public final class SummaryMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SummaryMetadata) + SummaryMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SummaryMetadata.class.getName()); + } + // Use SummaryMetadata.newBuilder() to construct. + private SummaryMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SummaryMetadata() { + displayName_ = ""; + summaryDescription_ = ""; + dataClass_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SummaryMetadata.class, org.tensorflow.proto.SummaryMetadata.Builder.class); + } + + public interface PluginDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.SummaryMetadata.PluginData) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The name of the plugin this data pertains to.
    +     * 
    + * + * string plugin_name = 1; + * @return The pluginName. + */ + java.lang.String getPluginName(); + /** + *
    +     * The name of the plugin this data pertains to.
    +     * 
    + * + * string plugin_name = 1; + * @return The bytes for pluginName. + */ + com.google.protobuf.ByteString + getPluginNameBytes(); + + /** + *
    +     * The content to store for the plugin. The best practice is for this to be
    +     * a binary serialized protocol buffer.
    +     * 
    + * + * bytes content = 2; + * @return The content. + */ + com.google.protobuf.ByteString getContent(); + } + /** + * Protobuf type {@code tensorflow.SummaryMetadata.PluginData} + */ + public static final class PluginData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.SummaryMetadata.PluginData) + PluginDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + PluginData.class.getName()); + } + // Use PluginData.newBuilder() to construct. + private PluginData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PluginData() { + pluginName_ = ""; + content_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SummaryMetadata.PluginData.class, org.tensorflow.proto.SummaryMetadata.PluginData.Builder.class); + } + + public static final int PLUGIN_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object pluginName_ = ""; + /** + *
    +     * The name of the plugin this data pertains to.
    +     * 
    + * + * string plugin_name = 1; + * @return The pluginName. + */ + @java.lang.Override + public java.lang.String getPluginName() { + java.lang.Object ref = pluginName_; + 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(); + pluginName_ = s; + return s; + } + } + /** + *
    +     * The name of the plugin this data pertains to.
    +     * 
    + * + * string plugin_name = 1; + * @return The bytes for pluginName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPluginNameBytes() { + java.lang.Object ref = pluginName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pluginName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * The content to store for the plugin. The best practice is for this to be
    +     * a binary serialized protocol buffer.
    +     * 
    + * + * bytes content = 2; + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + return content_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(pluginName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, pluginName_); + } + if (!content_.isEmpty()) { + output.writeBytes(2, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pluginName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, pluginName_); + } + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, content_); + } + size += getUnknownFields().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.SummaryMetadata.PluginData)) { + return super.equals(obj); + } + org.tensorflow.proto.SummaryMetadata.PluginData other = (org.tensorflow.proto.SummaryMetadata.PluginData) obj; + + if (!getPluginName() + .equals(other.getPluginName())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PLUGIN_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPluginName().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData 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.SummaryMetadata.PluginData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SummaryMetadata.PluginData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SummaryMetadata.PluginData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SummaryMetadata.PluginData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SummaryMetadata.PluginData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.SummaryMetadata.PluginData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SummaryMetadata.PluginData) + org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SummaryMetadata.PluginData.class, org.tensorflow.proto.SummaryMetadata.PluginData.Builder.class); + } + + // Construct using org.tensorflow.proto.SummaryMetadata.PluginData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pluginName_ = ""; + content_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_PluginData_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata.PluginData getDefaultInstanceForType() { + return org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata.PluginData build() { + org.tensorflow.proto.SummaryMetadata.PluginData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata.PluginData buildPartial() { + org.tensorflow.proto.SummaryMetadata.PluginData result = new org.tensorflow.proto.SummaryMetadata.PluginData(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SummaryMetadata.PluginData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pluginName_ = pluginName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SummaryMetadata.PluginData) { + return mergeFrom((org.tensorflow.proto.SummaryMetadata.PluginData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SummaryMetadata.PluginData other) { + if (other == org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance()) return this; + if (!other.getPluginName().isEmpty()) { + pluginName_ = other.pluginName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + pluginName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + content_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object pluginName_ = ""; + /** + *
    +       * The name of the plugin this data pertains to.
    +       * 
    + * + * string plugin_name = 1; + * @return The pluginName. + */ + public java.lang.String getPluginName() { + java.lang.Object ref = pluginName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pluginName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The name of the plugin this data pertains to.
    +       * 
    + * + * string plugin_name = 1; + * @return The bytes for pluginName. + */ + public com.google.protobuf.ByteString + getPluginNameBytes() { + java.lang.Object ref = pluginName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pluginName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The name of the plugin this data pertains to.
    +       * 
    + * + * string plugin_name = 1; + * @param value The pluginName to set. + * @return This builder for chaining. + */ + public Builder setPluginName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pluginName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The name of the plugin this data pertains to.
    +       * 
    + * + * string plugin_name = 1; + * @return This builder for chaining. + */ + public Builder clearPluginName() { + pluginName_ = getDefaultInstance().getPluginName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * The name of the plugin this data pertains to.
    +       * 
    + * + * string plugin_name = 1; + * @param value The bytes for pluginName to set. + * @return This builder for chaining. + */ + public Builder setPluginNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pluginName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * The content to store for the plugin. The best practice is for this to be
    +       * a binary serialized protocol buffer.
    +       * 
    + * + * bytes content = 2; + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + *
    +       * The content to store for the plugin. The best practice is for this to be
    +       * a binary serialized protocol buffer.
    +       * 
    + * + * bytes content = 2; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The content to store for the plugin. The best practice is for this to be
    +       * a binary serialized protocol buffer.
    +       * 
    + * + * bytes content = 2; + * @return This builder for chaining. + */ + public Builder clearContent() { + bitField0_ = (bitField0_ & ~0x00000002); + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SummaryMetadata.PluginData) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SummaryMetadata.PluginData) + private static final org.tensorflow.proto.SummaryMetadata.PluginData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SummaryMetadata.PluginData(); + } + + public static org.tensorflow.proto.SummaryMetadata.PluginData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PluginData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SummaryMetadata.PluginData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int PLUGIN_DATA_FIELD_NUMBER = 1; + private org.tensorflow.proto.SummaryMetadata.PluginData pluginData_; + /** + *
    +   * Data that associates a summary with a certain plugin.
    +   * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return Whether the pluginData field is set. + */ + @java.lang.Override + public boolean hasPluginData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Data that associates a summary with a certain plugin.
    +   * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return The pluginData. + */ + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata.PluginData getPluginData() { + return pluginData_ == null ? org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; + } + /** + *
    +   * Data that associates a summary with a certain plugin.
    +   * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder() { + return pluginData_ == null ? org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + *
    +   * Display name for viewing in TensorBoard.
    +   * 
    + * + * string display_name = 2; + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + *
    +   * Display name for viewing in TensorBoard.
    +   * 
    + * + * string display_name = 2; + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUMMARY_DESCRIPTION_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object summaryDescription_ = ""; + /** + *
    +   * Longform readable description of the summary sequence. Markdown supported.
    +   * 
    + * + * string summary_description = 3; + * @return The summaryDescription. + */ + @java.lang.Override + public java.lang.String getSummaryDescription() { + java.lang.Object ref = summaryDescription_; + 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(); + summaryDescription_ = s; + return s; + } + } + /** + *
    +   * Longform readable description of the summary sequence. Markdown supported.
    +   * 
    + * + * string summary_description = 3; + * @return The bytes for summaryDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSummaryDescriptionBytes() { + java.lang.Object ref = summaryDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summaryDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_CLASS_FIELD_NUMBER = 4; + private int dataClass_ = 0; + /** + *
    +   * Class of data stored in this time series. Required for compatibility with
    +   * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +   * imposes constraints on the dtype and shape of the corresponding tensor
    +   * values. See `DataClass` docs for details.
    +   * 
    + * + * .tensorflow.DataClass data_class = 4; + * @return The enum numeric value on the wire for dataClass. + */ + @java.lang.Override public int getDataClassValue() { + return dataClass_; + } + /** + *
    +   * Class of data stored in this time series. Required for compatibility with
    +   * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +   * imposes constraints on the dtype and shape of the corresponding tensor
    +   * values. See `DataClass` docs for details.
    +   * 
    + * + * .tensorflow.DataClass data_class = 4; + * @return The dataClass. + */ + @java.lang.Override public org.tensorflow.proto.DataClass getDataClass() { + org.tensorflow.proto.DataClass result = org.tensorflow.proto.DataClass.forNumber(dataClass_); + return result == null ? org.tensorflow.proto.DataClass.UNRECOGNIZED : result; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPluginData()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summaryDescription_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, summaryDescription_); + } + if (dataClass_ != org.tensorflow.proto.DataClass.DATA_CLASS_UNKNOWN.getNumber()) { + output.writeEnum(4, dataClass_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPluginData()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summaryDescription_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, summaryDescription_); + } + if (dataClass_ != org.tensorflow.proto.DataClass.DATA_CLASS_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, dataClass_); + } + size += getUnknownFields().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.SummaryMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.SummaryMetadata other = (org.tensorflow.proto.SummaryMetadata) obj; + + if (hasPluginData() != other.hasPluginData()) return false; + if (hasPluginData()) { + if (!getPluginData() + .equals(other.getPluginData())) return false; + } + if (!getDisplayName() + .equals(other.getDisplayName())) return false; + if (!getSummaryDescription() + .equals(other.getSummaryDescription())) return false; + if (dataClass_ != other.dataClass_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPluginData()) { + hash = (37 * hash) + PLUGIN_DATA_FIELD_NUMBER; + hash = (53 * hash) + getPluginData().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + SUMMARY_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSummaryDescription().hashCode(); + hash = (37 * hash) + DATA_CLASS_FIELD_NUMBER; + hash = (53 * hash) + dataClass_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.SummaryMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata 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.SummaryMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata 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.SummaryMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.SummaryMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.SummaryMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SummaryMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.SummaryMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.SummaryMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.SummaryMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.SummaryMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.SummaryMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * A SummaryMetadata encapsulates information on which plugins are able to make
    +   * use of a certain summary value.
    +   * 
    + * + * Protobuf type {@code tensorflow.SummaryMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.SummaryMetadata) + org.tensorflow.proto.SummaryMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.SummaryMetadata.class, org.tensorflow.proto.SummaryMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.SummaryMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPluginDataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pluginData_ = null; + if (pluginDataBuilder_ != null) { + pluginDataBuilder_.dispose(); + pluginDataBuilder_ = null; + } + displayName_ = ""; + summaryDescription_ = ""; + dataClass_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.SummaryProtos.internal_static_tensorflow_SummaryMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.SummaryMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata build() { + org.tensorflow.proto.SummaryMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.SummaryMetadata buildPartial() { + org.tensorflow.proto.SummaryMetadata result = new org.tensorflow.proto.SummaryMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.SummaryMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pluginData_ = pluginDataBuilder_ == null + ? pluginData_ + : pluginDataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.summaryDescription_ = summaryDescription_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dataClass_ = dataClass_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.SummaryMetadata) { + return mergeFrom((org.tensorflow.proto.SummaryMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.SummaryMetadata other) { + if (other == org.tensorflow.proto.SummaryMetadata.getDefaultInstance()) return this; + if (other.hasPluginData()) { + mergePluginData(other.getPluginData()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSummaryDescription().isEmpty()) { + summaryDescription_ = other.summaryDescription_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.dataClass_ != 0) { + setDataClassValue(other.getDataClassValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getPluginDataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + summaryDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + dataClass_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.SummaryMetadata.PluginData pluginData_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SummaryMetadata.PluginData, org.tensorflow.proto.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder> pluginDataBuilder_; + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return Whether the pluginData field is set. + */ + public boolean hasPluginData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return The pluginData. + */ + public org.tensorflow.proto.SummaryMetadata.PluginData getPluginData() { + if (pluginDataBuilder_ == null) { + return pluginData_ == null ? org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; + } else { + return pluginDataBuilder_.getMessage(); + } + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public Builder setPluginData(org.tensorflow.proto.SummaryMetadata.PluginData value) { + if (pluginDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pluginData_ = value; + } else { + pluginDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public Builder setPluginData( + org.tensorflow.proto.SummaryMetadata.PluginData.Builder builderForValue) { + if (pluginDataBuilder_ == null) { + pluginData_ = builderForValue.build(); + } else { + pluginDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public Builder mergePluginData(org.tensorflow.proto.SummaryMetadata.PluginData value) { + if (pluginDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + pluginData_ != null && + pluginData_ != org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance()) { + getPluginDataBuilder().mergeFrom(value); + } else { + pluginData_ = value; + } + } else { + pluginDataBuilder_.mergeFrom(value); + } + if (pluginData_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public Builder clearPluginData() { + bitField0_ = (bitField0_ & ~0x00000001); + pluginData_ = null; + if (pluginDataBuilder_ != null) { + pluginDataBuilder_.dispose(); + pluginDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public org.tensorflow.proto.SummaryMetadata.PluginData.Builder getPluginDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPluginDataFieldBuilder().getBuilder(); + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + public org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder() { + if (pluginDataBuilder_ != null) { + return pluginDataBuilder_.getMessageOrBuilder(); + } else { + return pluginData_ == null ? + org.tensorflow.proto.SummaryMetadata.PluginData.getDefaultInstance() : pluginData_; + } + } + /** + *
    +     * Data that associates a summary with a certain plugin.
    +     * 
    + * + * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SummaryMetadata.PluginData, org.tensorflow.proto.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder> + getPluginDataFieldBuilder() { + if (pluginDataBuilder_ == null) { + pluginDataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SummaryMetadata.PluginData, org.tensorflow.proto.SummaryMetadata.PluginData.Builder, org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder>( + getPluginData(), + getParentForChildren(), + isClean()); + pluginData_ = null; + } + return pluginDataBuilder_; + } + + private java.lang.Object displayName_ = ""; + /** + *
    +     * Display name for viewing in TensorBoard.
    +     * 
    + * + * string display_name = 2; + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Display name for viewing in TensorBoard.
    +     * 
    + * + * string display_name = 2; + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Display name for viewing in TensorBoard.
    +     * 
    + * + * string display_name = 2; + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Display name for viewing in TensorBoard.
    +     * 
    + * + * string display_name = 2; + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Display name for viewing in TensorBoard.
    +     * 
    + * + * string display_name = 2; + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object summaryDescription_ = ""; + /** + *
    +     * Longform readable description of the summary sequence. Markdown supported.
    +     * 
    + * + * string summary_description = 3; + * @return The summaryDescription. + */ + public java.lang.String getSummaryDescription() { + java.lang.Object ref = summaryDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summaryDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Longform readable description of the summary sequence. Markdown supported.
    +     * 
    + * + * string summary_description = 3; + * @return The bytes for summaryDescription. + */ + public com.google.protobuf.ByteString + getSummaryDescriptionBytes() { + java.lang.Object ref = summaryDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + summaryDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Longform readable description of the summary sequence. Markdown supported.
    +     * 
    + * + * string summary_description = 3; + * @param value The summaryDescription to set. + * @return This builder for chaining. + */ + public Builder setSummaryDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + summaryDescription_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Longform readable description of the summary sequence. Markdown supported.
    +     * 
    + * + * string summary_description = 3; + * @return This builder for chaining. + */ + public Builder clearSummaryDescription() { + summaryDescription_ = getDefaultInstance().getSummaryDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Longform readable description of the summary sequence. Markdown supported.
    +     * 
    + * + * string summary_description = 3; + * @param value The bytes for summaryDescription to set. + * @return This builder for chaining. + */ + public Builder setSummaryDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + summaryDescription_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int dataClass_ = 0; + /** + *
    +     * Class of data stored in this time series. Required for compatibility with
    +     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +     * imposes constraints on the dtype and shape of the corresponding tensor
    +     * values. See `DataClass` docs for details.
    +     * 
    + * + * .tensorflow.DataClass data_class = 4; + * @return The enum numeric value on the wire for dataClass. + */ + @java.lang.Override public int getDataClassValue() { + return dataClass_; + } + /** + *
    +     * Class of data stored in this time series. Required for compatibility with
    +     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +     * imposes constraints on the dtype and shape of the corresponding tensor
    +     * values. See `DataClass` docs for details.
    +     * 
    + * + * .tensorflow.DataClass data_class = 4; + * @param value The enum numeric value on the wire for dataClass to set. + * @return This builder for chaining. + */ + public Builder setDataClassValue(int value) { + dataClass_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Class of data stored in this time series. Required for compatibility with
    +     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +     * imposes constraints on the dtype and shape of the corresponding tensor
    +     * values. See `DataClass` docs for details.
    +     * 
    + * + * .tensorflow.DataClass data_class = 4; + * @return The dataClass. + */ + @java.lang.Override + public org.tensorflow.proto.DataClass getDataClass() { + org.tensorflow.proto.DataClass result = org.tensorflow.proto.DataClass.forNumber(dataClass_); + return result == null ? org.tensorflow.proto.DataClass.UNRECOGNIZED : result; + } + /** + *
    +     * Class of data stored in this time series. Required for compatibility with
    +     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +     * imposes constraints on the dtype and shape of the corresponding tensor
    +     * values. See `DataClass` docs for details.
    +     * 
    + * + * .tensorflow.DataClass data_class = 4; + * @param value The dataClass to set. + * @return This builder for chaining. + */ + public Builder setDataClass(org.tensorflow.proto.DataClass value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + dataClass_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Class of data stored in this time series. Required for compatibility with
    +     * TensorBoard's generic data facilities (`DataProvider`, et al.). This value
    +     * imposes constraints on the dtype and shape of the corresponding tensor
    +     * values. See `DataClass` docs for details.
    +     * 
    + * + * .tensorflow.DataClass data_class = 4; + * @return This builder for chaining. + */ + public Builder clearDataClass() { + bitField0_ = (bitField0_ & ~0x00000008); + dataClass_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.SummaryMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.SummaryMetadata) + private static final org.tensorflow.proto.SummaryMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.SummaryMetadata(); + } + + public static org.tensorflow.proto.SummaryMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SummaryMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.SummaryMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadataOrBuilder.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadataOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadataOrBuilder.java index 9fd35f7d1de..a7c7adb8253 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryMetadataOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/summary.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface SummaryMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.SummaryMetadata) @@ -13,6 +15,7 @@ public interface SummaryMetadataOrBuilder extends * * * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return Whether the pluginData field is set. */ boolean hasPluginData(); /** @@ -21,8 +24,9 @@ public interface SummaryMetadataOrBuilder extends * * * .tensorflow.SummaryMetadata.PluginData plugin_data = 1; + * @return The pluginData. */ - org.tensorflow.proto.framework.SummaryMetadata.PluginData getPluginData(); + org.tensorflow.proto.SummaryMetadata.PluginData getPluginData(); /** *
        * Data that associates a summary with a certain plugin.
    @@ -30,7 +34,7 @@ public interface SummaryMetadataOrBuilder extends
        *
        * .tensorflow.SummaryMetadata.PluginData plugin_data = 1;
        */
    -  org.tensorflow.proto.framework.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder();
    +  org.tensorflow.proto.SummaryMetadata.PluginDataOrBuilder getPluginDataOrBuilder();
     
       /**
        * 
    @@ -38,6 +42,7 @@ public interface SummaryMetadataOrBuilder extends
        * 
    * * string display_name = 2; + * @return The displayName. */ java.lang.String getDisplayName(); /** @@ -46,6 +51,7 @@ public interface SummaryMetadataOrBuilder extends *
    * * string display_name = 2; + * @return The bytes for displayName. */ com.google.protobuf.ByteString getDisplayNameBytes(); @@ -56,6 +62,7 @@ public interface SummaryMetadataOrBuilder extends * * * string summary_description = 3; + * @return The summaryDescription. */ java.lang.String getSummaryDescription(); /** @@ -64,6 +71,7 @@ public interface SummaryMetadataOrBuilder extends * * * string summary_description = 3; + * @return The bytes for summaryDescription. */ com.google.protobuf.ByteString getSummaryDescriptionBytes(); @@ -77,6 +85,7 @@ public interface SummaryMetadataOrBuilder extends * * * .tensorflow.DataClass data_class = 4; + * @return The enum numeric value on the wire for dataClass. */ int getDataClassValue(); /** @@ -88,6 +97,7 @@ public interface SummaryMetadataOrBuilder extends * * * .tensorflow.DataClass data_class = 4; + * @return The dataClass. */ - org.tensorflow.proto.framework.DataClass getDataClass(); + org.tensorflow.proto.DataClass getDataClass(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryOrBuilder.java index 09de7983ac5..1477e151a96 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/SummaryOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/summary.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface SummaryOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.Summary) @@ -14,7 +16,7 @@ public interface SummaryOrBuilder extends * * repeated .tensorflow.Summary.Value value = 1; */ - java.util.List + java.util.List getValueList(); /** *
    @@ -23,7 +25,7 @@ public interface SummaryOrBuilder extends
        *
        * repeated .tensorflow.Summary.Value value = 1;
        */
    -  org.tensorflow.proto.framework.Summary.Value getValue(int index);
    +  org.tensorflow.proto.Summary.Value getValue(int index);
       /**
        * 
        * Set of values for the summary.
    @@ -39,7 +41,7 @@ public interface SummaryOrBuilder extends
        *
        * repeated .tensorflow.Summary.Value value = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getValueOrBuilderList();
       /**
        * 
    @@ -48,6 +50,6 @@ public interface SummaryOrBuilder extends
        *
        * repeated .tensorflow.Summary.Value value = 1;
        */
    -  org.tensorflow.proto.framework.Summary.ValueOrBuilder getValueOrBuilder(
    +  org.tensorflow.proto.Summary.ValueOrBuilder getValueOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryProtos.java
    new file mode 100644
    index 00000000000..17ee633adc7
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/SummaryProtos.java
    @@ -0,0 +1,159 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/summary.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class SummaryProtos {
    +  private SummaryProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      SummaryProtos.class.getName());
    +  }
    +  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_SummaryDescription_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SummaryDescription_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_SummaryMetadata_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SummaryMetadata_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_SummaryMetadata_PluginData_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Summary_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Summary_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Summary_Image_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Summary_Image_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Summary_Audio_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Summary_Audio_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_Summary_Value_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_Summary_Value_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/framework/summary.prot" +
    +      "o\022\ntensorflow\032 xla/tsl/protobuf/histogra" +
    +      "m.proto\032&tensorflow/core/framework/tenso" +
    +      "r.proto\"\'\n\022SummaryDescription\022\021\n\ttype_hi" +
    +      "nt\030\001 \001(\t\"\340\001\n\017SummaryMetadata\022;\n\013plugin_d" +
    +      "ata\030\001 \001(\0132&.tensorflow.SummaryMetadata.P" +
    +      "luginData\022\024\n\014display_name\030\002 \001(\t\022\033\n\023summa" +
    +      "ry_description\030\003 \001(\t\022)\n\ndata_class\030\004 \001(\016" +
    +      "2\025.tensorflow.DataClass\0322\n\nPluginData\022\023\n" +
    +      "\013plugin_name\030\001 \001(\t\022\017\n\007content\030\002 \001(\014\"\336\004\n\007" +
    +      "Summary\022(\n\005value\030\001 \003(\0132\031.tensorflow.Summ" +
    +      "ary.Value\032X\n\005Image\022\016\n\006height\030\001 \001(\005\022\r\n\005wi" +
    +      "dth\030\002 \001(\005\022\022\n\ncolorspace\030\003 \001(\005\022\034\n\024encoded" +
    +      "_image_string\030\004 \001(\014\032}\n\005Audio\022\023\n\013sample_r" +
    +      "ate\030\001 \001(\002\022\024\n\014num_channels\030\002 \001(\003\022\025\n\rlengt" +
    +      "h_frames\030\003 \001(\003\022\034\n\024encoded_audio_string\030\004" +
    +      " \001(\014\022\024\n\014content_type\030\005 \001(\t\032\317\002\n\005Value\022\021\n\t" +
    +      "node_name\030\007 \001(\t\022\013\n\003tag\030\001 \001(\t\022-\n\010metadata" +
    +      "\030\t \001(\0132\033.tensorflow.SummaryMetadata\022\026\n\014s" +
    +      "imple_value\030\002 \001(\002H\000\022&\n\034obsolete_old_styl" +
    +      "e_histogram\030\003 \001(\014H\000\022*\n\005image\030\004 \001(\0132\031.ten" +
    +      "sorflow.Summary.ImageH\000\022+\n\005histo\030\005 \001(\0132\032" +
    +      ".tensorflow.HistogramProtoH\000\022*\n\005audio\030\006 " +
    +      "\001(\0132\031.tensorflow.Summary.AudioH\000\022)\n\006tens" +
    +      "or\030\010 \001(\0132\027.tensorflow.TensorProtoH\000B\007\n\005v" +
    +      "alue*o\n\tDataClass\022\026\n\022DATA_CLASS_UNKNOWN\020" +
    +      "\000\022\025\n\021DATA_CLASS_SCALAR\020\001\022\025\n\021DATA_CLASS_T" +
    +      "ENSOR\020\002\022\034\n\030DATA_CLASS_BLOB_SEQUENCE\020\003Bz\n" +
    +      "\024org.tensorflow.protoB\rSummaryProtosP\001ZN" +
    +      "github.com/tensorflow/tensorflow/tensorf" +
    +      "low/go/core/framework/summary_go_proto\370\001" +
    +      "\001P\000b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.Histogram.getDescriptor(),
    +          org.tensorflow.proto.TensorProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_SummaryDescription_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_SummaryDescription_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SummaryDescription_descriptor,
    +        new java.lang.String[] { "TypeHint", });
    +    internal_static_tensorflow_SummaryMetadata_descriptor =
    +      getDescriptor().getMessageTypes().get(1);
    +    internal_static_tensorflow_SummaryMetadata_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SummaryMetadata_descriptor,
    +        new java.lang.String[] { "PluginData", "DisplayName", "SummaryDescription", "DataClass", });
    +    internal_static_tensorflow_SummaryMetadata_PluginData_descriptor =
    +      internal_static_tensorflow_SummaryMetadata_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_SummaryMetadata_PluginData_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_SummaryMetadata_PluginData_descriptor,
    +        new java.lang.String[] { "PluginName", "Content", });
    +    internal_static_tensorflow_Summary_descriptor =
    +      getDescriptor().getMessageTypes().get(2);
    +    internal_static_tensorflow_Summary_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Summary_descriptor,
    +        new java.lang.String[] { "Value", });
    +    internal_static_tensorflow_Summary_Image_descriptor =
    +      internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_Summary_Image_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Summary_Image_descriptor,
    +        new java.lang.String[] { "Height", "Width", "Colorspace", "EncodedImageString", });
    +    internal_static_tensorflow_Summary_Audio_descriptor =
    +      internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(1);
    +    internal_static_tensorflow_Summary_Audio_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Summary_Audio_descriptor,
    +        new java.lang.String[] { "SampleRate", "NumChannels", "LengthFrames", "EncodedAudioString", "ContentType", });
    +    internal_static_tensorflow_Summary_Value_descriptor =
    +      internal_static_tensorflow_Summary_descriptor.getNestedTypes().get(2);
    +    internal_static_tensorflow_Summary_Value_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_Summary_Value_descriptor,
    +        new java.lang.String[] { "NodeName", "Tag", "Metadata", "SimpleValue", "ObsoleteOldStyleHistogram", "Image", "Histo", "Audio", "Tensor", "Value", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.Histogram.getDescriptor();
    +    org.tensorflow.proto.TensorProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadata.java
    new file mode 100644
    index 00000000000..8fabbf0cbcf
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadata.java
    @@ -0,0 +1,624 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * For logging the metadata output for a single session.run() call.
    + * 
    + * + * Protobuf type {@code tensorflow.TaggedRunMetadata} + */ +public final class TaggedRunMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TaggedRunMetadata) + TaggedRunMetadataOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TaggedRunMetadata.class.getName()); + } + // Use TaggedRunMetadata.newBuilder() to construct. + private TaggedRunMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaggedRunMetadata() { + tag_ = ""; + runMetadata_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TaggedRunMetadata.class, org.tensorflow.proto.TaggedRunMetadata.Builder.class); + } + + public static final int TAG_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object tag_ = ""; + /** + *
    +   * Tag name associated with this metadata.
    +   * 
    + * + * string tag = 1; + * @return The tag. + */ + @java.lang.Override + public java.lang.String getTag() { + java.lang.Object ref = tag_; + 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(); + tag_ = s; + return s; + } + } + /** + *
    +   * Tag name associated with this metadata.
    +   * 
    + * + * string tag = 1; + * @return The bytes for tag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUN_METADATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString runMetadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    +   * deserialization.
    +   * 
    + * + * bytes run_metadata = 2; + * @return The runMetadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRunMetadata() { + return runMetadata_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(tag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tag_); + } + if (!runMetadata_.isEmpty()) { + output.writeBytes(2, runMetadata_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tag_); + } + if (!runMetadata_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, runMetadata_); + } + size += getUnknownFields().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.TaggedRunMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.TaggedRunMetadata other = (org.tensorflow.proto.TaggedRunMetadata) obj; + + if (!getTag() + .equals(other.getTag())) return false; + if (!getRunMetadata() + .equals(other.getRunMetadata())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TAG_FIELD_NUMBER; + hash = (53 * hash) + getTag().hashCode(); + hash = (37 * hash) + RUN_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRunMetadata().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TaggedRunMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaggedRunMetadata 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.TaggedRunMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaggedRunMetadata 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.TaggedRunMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaggedRunMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TaggedRunMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TaggedRunMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TaggedRunMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TaggedRunMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TaggedRunMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TaggedRunMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TaggedRunMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * For logging the metadata output for a single session.run() call.
    +   * 
    + * + * Protobuf type {@code tensorflow.TaggedRunMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TaggedRunMetadata) + org.tensorflow.proto.TaggedRunMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_TaggedRunMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TaggedRunMetadata.class, org.tensorflow.proto.TaggedRunMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.TaggedRunMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tag_ = ""; + runMetadata_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_TaggedRunMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadata build() { + org.tensorflow.proto.TaggedRunMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TaggedRunMetadata buildPartial() { + org.tensorflow.proto.TaggedRunMetadata result = new org.tensorflow.proto.TaggedRunMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TaggedRunMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tag_ = tag_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runMetadata_ = runMetadata_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TaggedRunMetadata) { + return mergeFrom((org.tensorflow.proto.TaggedRunMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TaggedRunMetadata other) { + if (other == org.tensorflow.proto.TaggedRunMetadata.getDefaultInstance()) return this; + if (!other.getTag().isEmpty()) { + tag_ = other.tag_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getRunMetadata() != com.google.protobuf.ByteString.EMPTY) { + setRunMetadata(other.getRunMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + tag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + runMetadata_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object tag_ = ""; + /** + *
    +     * Tag name associated with this metadata.
    +     * 
    + * + * string tag = 1; + * @return The tag. + */ + public java.lang.String getTag() { + java.lang.Object ref = tag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Tag name associated with this metadata.
    +     * 
    + * + * string tag = 1; + * @return The bytes for tag. + */ + public com.google.protobuf.ByteString + getTagBytes() { + java.lang.Object ref = tag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Tag name associated with this metadata.
    +     * 
    + * + * string tag = 1; + * @param value The tag to set. + * @return This builder for chaining. + */ + public Builder setTag( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Tag name associated with this metadata.
    +     * 
    + * + * string tag = 1; + * @return This builder for chaining. + */ + public Builder clearTag() { + tag_ = getDefaultInstance().getTag(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Tag name associated with this metadata.
    +     * 
    + * + * string tag = 1; + * @param value The bytes for tag to set. + * @return This builder for chaining. + */ + public Builder setTagBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tag_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString runMetadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    +     * deserialization.
    +     * 
    + * + * bytes run_metadata = 2; + * @return The runMetadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRunMetadata() { + return runMetadata_; + } + /** + *
    +     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    +     * deserialization.
    +     * 
    + * + * bytes run_metadata = 2; + * @param value The runMetadata to set. + * @return This builder for chaining. + */ + public Builder setRunMetadata(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + runMetadata_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Byte-encoded version of the `RunMetadata` proto in order to allow lazy
    +     * deserialization.
    +     * 
    + * + * bytes run_metadata = 2; + * @return This builder for chaining. + */ + public Builder clearRunMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + runMetadata_ = getDefaultInstance().getRunMetadata(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TaggedRunMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TaggedRunMetadata) + private static final org.tensorflow.proto.TaggedRunMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TaggedRunMetadata(); + } + + public static org.tensorflow.proto.TaggedRunMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaggedRunMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TaggedRunMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadataOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadataOrBuilder.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadataOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadataOrBuilder.java index d364543215c..a1b394e2b14 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TaggedRunMetadataOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaggedRunMetadataOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; public interface TaggedRunMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.TaggedRunMetadata) @@ -13,6 +15,7 @@ public interface TaggedRunMetadataOrBuilder extends *
    * * string tag = 1; + * @return The tag. */ java.lang.String getTag(); /** @@ -21,6 +24,7 @@ public interface TaggedRunMetadataOrBuilder extends *
    * * string tag = 1; + * @return The bytes for tag. */ com.google.protobuf.ByteString getTagBytes(); @@ -32,6 +36,7 @@ public interface TaggedRunMetadataOrBuilder extends *
    * * bytes run_metadata = 2; + * @return The runMetadata. */ com.google.protobuf.ByteString getRunMetadata(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFilters.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFilters.java new file mode 100644 index 00000000000..cb5547127cc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFilters.java @@ -0,0 +1,562 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines the device filters for a remote task.
    + * 
    + * + * Protobuf type {@code tensorflow.TaskDeviceFilters} + */ +public final class TaskDeviceFilters extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TaskDeviceFilters) + TaskDeviceFiltersOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TaskDeviceFilters.class.getName()); + } + // Use TaskDeviceFilters.newBuilder() to construct. + private TaskDeviceFilters(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskDeviceFilters() { + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TaskDeviceFilters.class, org.tensorflow.proto.TaskDeviceFilters.Builder.class); + } + + public static final int DEVICE_FILTERS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string device_filters = 1; + * @return A list containing the deviceFilters. + */ + public com.google.protobuf.ProtocolStringList + getDeviceFiltersList() { + return deviceFilters_; + } + /** + * repeated string device_filters = 1; + * @return The count of deviceFilters. + */ + public int getDeviceFiltersCount() { + return deviceFilters_.size(); + } + /** + * repeated string device_filters = 1; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. + */ + public java.lang.String getDeviceFilters(int index) { + return deviceFilters_.get(index); + } + /** + * repeated string device_filters = 1; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. + */ + public com.google.protobuf.ByteString + getDeviceFiltersBytes(int index) { + return deviceFilters_.getByteString(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 { + for (int i = 0; i < deviceFilters_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFilters_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < deviceFilters_.size(); i++) { + dataSize += computeStringSizeNoTag(deviceFilters_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeviceFiltersList().size(); + } + size += getUnknownFields().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.TaskDeviceFilters)) { + return super.equals(obj); + } + org.tensorflow.proto.TaskDeviceFilters other = (org.tensorflow.proto.TaskDeviceFilters) obj; + + if (!getDeviceFiltersList() + .equals(other.getDeviceFiltersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDeviceFiltersCount() > 0) { + hash = (37 * hash) + DEVICE_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceFiltersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TaskDeviceFilters parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaskDeviceFilters 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.TaskDeviceFilters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaskDeviceFilters 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.TaskDeviceFilters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TaskDeviceFilters parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TaskDeviceFilters parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TaskDeviceFilters parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TaskDeviceFilters parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TaskDeviceFilters parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TaskDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TaskDeviceFilters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TaskDeviceFilters 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines the device filters for a remote task.
    +   * 
    + * + * Protobuf type {@code tensorflow.TaskDeviceFilters} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TaskDeviceFilters) + org.tensorflow.proto.TaskDeviceFiltersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TaskDeviceFilters.class, org.tensorflow.proto.TaskDeviceFilters.Builder.class); + } + + // Construct using org.tensorflow.proto.TaskDeviceFilters.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.DeviceFiltersProtos.internal_static_tensorflow_TaskDeviceFilters_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters getDefaultInstanceForType() { + return org.tensorflow.proto.TaskDeviceFilters.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters build() { + org.tensorflow.proto.TaskDeviceFilters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TaskDeviceFilters buildPartial() { + org.tensorflow.proto.TaskDeviceFilters result = new org.tensorflow.proto.TaskDeviceFilters(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TaskDeviceFilters result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + deviceFilters_.makeImmutable(); + result.deviceFilters_ = deviceFilters_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TaskDeviceFilters) { + return mergeFrom((org.tensorflow.proto.TaskDeviceFilters)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TaskDeviceFilters other) { + if (other == org.tensorflow.proto.TaskDeviceFilters.getDefaultInstance()) return this; + if (!other.deviceFilters_.isEmpty()) { + if (deviceFilters_.isEmpty()) { + deviceFilters_ = other.deviceFilters_; + bitField0_ |= 0x00000001; + } else { + ensureDeviceFiltersIsMutable(); + deviceFilters_.addAll(other.deviceFilters_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(s); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDeviceFiltersIsMutable() { + if (!deviceFilters_.isModifiable()) { + deviceFilters_ = new com.google.protobuf.LazyStringArrayList(deviceFilters_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string device_filters = 1; + * @return A list containing the deviceFilters. + */ + public com.google.protobuf.ProtocolStringList + getDeviceFiltersList() { + deviceFilters_.makeImmutable(); + return deviceFilters_; + } + /** + * repeated string device_filters = 1; + * @return The count of deviceFilters. + */ + public int getDeviceFiltersCount() { + return deviceFilters_.size(); + } + /** + * repeated string device_filters = 1; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. + */ + public java.lang.String getDeviceFilters(int index) { + return deviceFilters_.get(index); + } + /** + * repeated string device_filters = 1; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. + */ + public com.google.protobuf.ByteString + getDeviceFiltersBytes(int index) { + return deviceFilters_.getByteString(index); + } + /** + * repeated string device_filters = 1; + * @param index The index to set the value at. + * @param value The deviceFilters to set. + * @return This builder for chaining. + */ + public Builder setDeviceFilters( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDeviceFiltersIsMutable(); + deviceFilters_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string device_filters = 1; + * @param value The deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addDeviceFilters( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string device_filters = 1; + * @param values The deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceFilters( + java.lang.Iterable values) { + ensureDeviceFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceFilters_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string device_filters = 1; + * @return This builder for chaining. + */ + public Builder clearDeviceFilters() { + deviceFilters_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string device_filters = 1; + * @param value The bytes of the deviceFilters to add. + * @return This builder for chaining. + */ + public Builder addDeviceFiltersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDeviceFiltersIsMutable(); + deviceFilters_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TaskDeviceFilters) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TaskDeviceFilters) + private static final org.tensorflow.proto.TaskDeviceFilters DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TaskDeviceFilters(); + } + + public static org.tensorflow.proto.TaskDeviceFilters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskDeviceFilters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TaskDeviceFilters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFiltersOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFiltersOrBuilder.java new file mode 100644 index 00000000000..abc76e76f7a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TaskDeviceFiltersOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/device_filters.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TaskDeviceFiltersOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TaskDeviceFilters) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string device_filters = 1; + * @return A list containing the deviceFilters. + */ + java.util.List + getDeviceFiltersList(); + /** + * repeated string device_filters = 1; + * @return The count of deviceFilters. + */ + int getDeviceFiltersCount(); + /** + * repeated string device_filters = 1; + * @param index The index of the element to return. + * @return The deviceFilters at the given index. + */ + java.lang.String getDeviceFilters(int index); + /** + * repeated string device_filters = 1; + * @param index The index of the value to return. + * @return The bytes of the deviceFilters at the given index. + */ + com.google.protobuf.ByteString + getDeviceFiltersBytes(int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorBundleProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorBundleProtos.java new file mode 100644 index 00000000000..ccdfaa8353b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorBundleProtos.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/tensor_bundle.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TensorBundleProtos { + private TensorBundleProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorBundleProtos.class.getName()); + } + 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_BundleHeaderProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_BundleEntryProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_BundleEntryProto_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/tensor_bundle" + + ".proto\022\ntensorflow\032,tensorflow/core/fram" + + "ework/tensor_shape.proto\032,tensorflow/cor" + + "e/framework/tensor_slice.proto\032%tensorfl" + + "ow/core/framework/types.proto\032(tensorflo" + + "w/core/framework/versions.proto\"\261\001\n\021Bund" + + "leHeaderProto\022\022\n\nnum_shards\030\001 \001(\005\022<\n\nend" + + "ianness\030\002 \001(\0162(.tensorflow.BundleHeaderP" + + "roto.Endianness\022\'\n\007version\030\003 \001(\0132\026.tenso" + + "rflow.VersionDef\"!\n\nEndianness\022\n\n\006LITTLE" + + "\020\000\022\007\n\003BIG\020\001\"\322\001\n\020BundleEntryProto\022#\n\005dtyp" + + "e\030\001 \001(\0162\024.tensorflow.DataType\022+\n\005shape\030\002" + + " \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\206\001\n\024org.tensorf" + + "low.protoB\022TensorBundleProtosP\001ZUgithub." + + "com/tensorflow/tensorflow/tensorflow/go/" + + "core/protobuf/for_core_protos_go_proto\370\001" + + "\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TensorSliceProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + org.tensorflow.proto.VersionsProtos.getDescriptor(), + }); + internal_static_tensorflow_BundleHeaderProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_BundleHeaderProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_BundleHeaderProto_descriptor, + new java.lang.String[] { "NumShards", "Endianness", "Version", }); + internal_static_tensorflow_BundleEntryProto_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_BundleEntryProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_BundleEntryProto_descriptor, + new java.lang.String[] { "Dtype", "Shape", "ShardId", "Offset", "Size", "Crc32C", "Slices", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TensorSliceProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + org.tensorflow.proto.VersionsProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnection.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnection.java new file mode 100644 index 00000000000..56f3100ea90 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnection.java @@ -0,0 +1,715 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Defines a connection between two tensors in a `GraphDef`.
    + * 
    + * + * Protobuf type {@code tensorflow.TensorConnection} + */ +public final class TensorConnection extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorConnection) + TensorConnectionOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorConnection.class.getName()); + } + // Use TensorConnection.newBuilder() to construct. + private TensorConnection(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorConnection() { + fromTensor_ = ""; + toTensor_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_TensorConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorConnection.class, org.tensorflow.proto.TensorConnection.Builder.class); + } + + public static final int FROM_TENSOR_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object fromTensor_ = ""; + /** + *
    +   * A tensor name. The value of this tensor will be substituted for
    +   * the tensor named in `to_tensor`.
    +   * 
    + * + * string from_tensor = 1; + * @return The fromTensor. + */ + @java.lang.Override + public java.lang.String getFromTensor() { + java.lang.Object ref = fromTensor_; + 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(); + fromTensor_ = s; + return s; + } + } + /** + *
    +   * A tensor name. The value of this tensor will be substituted for
    +   * the tensor named in `to_tensor`.
    +   * 
    + * + * string from_tensor = 1; + * @return The bytes for fromTensor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFromTensorBytes() { + java.lang.Object ref = fromTensor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fromTensor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TO_TENSOR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object toTensor_ = ""; + /** + *
    +   * A tensor name. The value of this tensor will be bound to the
    +   * value of the tensor named in `from_tensor`.
    +   * 
    + * + * string to_tensor = 2; + * @return The toTensor. + */ + @java.lang.Override + public java.lang.String getToTensor() { + java.lang.Object ref = toTensor_; + 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(); + toTensor_ = s; + return s; + } + } + /** + *
    +   * A tensor name. The value of this tensor will be bound to the
    +   * value of the tensor named in `from_tensor`.
    +   * 
    + * + * string to_tensor = 2; + * @return The bytes for toTensor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getToTensorBytes() { + java.lang.Object ref = toTensor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + toTensor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(fromTensor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fromTensor_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(toTensor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, toTensor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fromTensor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fromTensor_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(toTensor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, toTensor_); + } + size += getUnknownFields().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.TensorConnection)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorConnection other = (org.tensorflow.proto.TensorConnection) obj; + + if (!getFromTensor() + .equals(other.getFromTensor())) return false; + if (!getToTensor() + .equals(other.getToTensor())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FROM_TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getFromTensor().hashCode(); + hash = (37 * hash) + TO_TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getToTensor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorConnection parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorConnection 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.TensorConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorConnection 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.TensorConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorConnection parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorConnection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorConnection parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorConnection parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorConnection parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorConnection parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorConnection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorConnection 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Defines a connection between two tensors in a `GraphDef`.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorConnection} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorConnection) + org.tensorflow.proto.TensorConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_TensorConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorConnection.class, org.tensorflow.proto.TensorConnection.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorConnection.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fromTensor_ = ""; + toTensor_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_TensorConnection_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorConnection getDefaultInstanceForType() { + return org.tensorflow.proto.TensorConnection.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorConnection build() { + org.tensorflow.proto.TensorConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorConnection buildPartial() { + org.tensorflow.proto.TensorConnection result = new org.tensorflow.proto.TensorConnection(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fromTensor_ = fromTensor_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.toTensor_ = toTensor_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorConnection) { + return mergeFrom((org.tensorflow.proto.TensorConnection)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorConnection other) { + if (other == org.tensorflow.proto.TensorConnection.getDefaultInstance()) return this; + if (!other.getFromTensor().isEmpty()) { + fromTensor_ = other.fromTensor_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getToTensor().isEmpty()) { + toTensor_ = other.toTensor_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + fromTensor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + toTensor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object fromTensor_ = ""; + /** + *
    +     * A tensor name. The value of this tensor will be substituted for
    +     * the tensor named in `to_tensor`.
    +     * 
    + * + * string from_tensor = 1; + * @return The fromTensor. + */ + public java.lang.String getFromTensor() { + java.lang.Object ref = fromTensor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fromTensor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A tensor name. The value of this tensor will be substituted for
    +     * the tensor named in `to_tensor`.
    +     * 
    + * + * string from_tensor = 1; + * @return The bytes for fromTensor. + */ + public com.google.protobuf.ByteString + getFromTensorBytes() { + java.lang.Object ref = fromTensor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fromTensor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A tensor name. The value of this tensor will be substituted for
    +     * the tensor named in `to_tensor`.
    +     * 
    + * + * string from_tensor = 1; + * @param value The fromTensor to set. + * @return This builder for chaining. + */ + public Builder setFromTensor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fromTensor_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * A tensor name. The value of this tensor will be substituted for
    +     * the tensor named in `to_tensor`.
    +     * 
    + * + * string from_tensor = 1; + * @return This builder for chaining. + */ + public Builder clearFromTensor() { + fromTensor_ = getDefaultInstance().getFromTensor(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * A tensor name. The value of this tensor will be substituted for
    +     * the tensor named in `to_tensor`.
    +     * 
    + * + * string from_tensor = 1; + * @param value The bytes for fromTensor to set. + * @return This builder for chaining. + */ + public Builder setFromTensorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fromTensor_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object toTensor_ = ""; + /** + *
    +     * A tensor name. The value of this tensor will be bound to the
    +     * value of the tensor named in `from_tensor`.
    +     * 
    + * + * string to_tensor = 2; + * @return The toTensor. + */ + public java.lang.String getToTensor() { + java.lang.Object ref = toTensor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + toTensor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * A tensor name. The value of this tensor will be bound to the
    +     * value of the tensor named in `from_tensor`.
    +     * 
    + * + * string to_tensor = 2; + * @return The bytes for toTensor. + */ + public com.google.protobuf.ByteString + getToTensorBytes() { + java.lang.Object ref = toTensor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + toTensor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * A tensor name. The value of this tensor will be bound to the
    +     * value of the tensor named in `from_tensor`.
    +     * 
    + * + * string to_tensor = 2; + * @param value The toTensor to set. + * @return This builder for chaining. + */ + public Builder setToTensor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + toTensor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * A tensor name. The value of this tensor will be bound to the
    +     * value of the tensor named in `from_tensor`.
    +     * 
    + * + * string to_tensor = 2; + * @return This builder for chaining. + */ + public Builder clearToTensor() { + toTensor_ = getDefaultInstance().getToTensor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * A tensor name. The value of this tensor will be bound to the
    +     * value of the tensor named in `from_tensor`.
    +     * 
    + * + * string to_tensor = 2; + * @param value The bytes for toTensor to set. + * @return This builder for chaining. + */ + public Builder setToTensorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + toTensor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorConnection) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorConnection) + private static final org.tensorflow.proto.TensorConnection DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorConnection(); + } + + public static org.tensorflow.proto.TensorConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnectionOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnectionOrBuilder.java similarity index 84% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnectionOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnectionOrBuilder.java index 377a25aa7ad..a13b5780996 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorConnectionOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorConnectionOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface TensorConnectionOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.TensorConnection) @@ -14,6 +16,7 @@ public interface TensorConnectionOrBuilder extends * * * string from_tensor = 1; + * @return The fromTensor. */ java.lang.String getFromTensor(); /** @@ -23,6 +26,7 @@ public interface TensorConnectionOrBuilder extends * * * string from_tensor = 1; + * @return The bytes for fromTensor. */ com.google.protobuf.ByteString getFromTensorBytes(); @@ -34,6 +38,7 @@ public interface TensorConnectionOrBuilder extends * * * string to_tensor = 2; + * @return The toTensor. */ java.lang.String getToTensor(); /** @@ -43,6 +48,7 @@ public interface TensorConnectionOrBuilder extends * * * string to_tensor = 2; + * @return The bytes for toTensor. */ com.google.protobuf.ByteString getToTensorBytes(); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorDebugMode.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDebugMode.java similarity index 88% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorDebugMode.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDebugMode.java index 074b1ca74c5..982460ab7de 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/TensorDebugMode.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDebugMode.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/debug_event.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.util; +package org.tensorflow.proto; /** *
    @@ -95,11 +97,11 @@ public enum TensorDebugMode
        * 
        * Reduce the elements of a tensor to a rank-1 tensor of shape [3], in which
        * - the 1st element is -inf if any element of the tensor is -inf,
    -   *   or zero otherwise.
    +   * or zero otherwise.
        * - the 2nd element is +inf if any element of the tensor is +inf,
    -   *   or zero otherwise.
    +   * or zero otherwise.
        * - the 3rd element is nan if any element of the tensor is nan, or zero
    -   *   otherwise.
    +   * otherwise.
        * 
    * * REDUCE_INF_NAN_THREE_SLOTS = 8; @@ -108,6 +110,15 @@ public enum TensorDebugMode UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorDebugMode.class.getName()); + } /** * UNSPECIFIED = 0; */ @@ -189,11 +200,11 @@ public enum TensorDebugMode *
        * Reduce the elements of a tensor to a rank-1 tensor of shape [3], in which
        * - the 1st element is -inf if any element of the tensor is -inf,
    -   *   or zero otherwise.
    +   * or zero otherwise.
        * - the 2nd element is +inf if any element of the tensor is +inf,
    -   *   or zero otherwise.
    +   * or zero otherwise.
        * - the 3rd element is nan if any element of the tensor is nan, or zero
    -   *   otherwise.
    +   * otherwise.
        * 
    * * REDUCE_INF_NAN_THREE_SLOTS = 8; @@ -210,6 +221,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -217,6 +230,10 @@ public static TensorDebugMode valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static TensorDebugMode forNumber(int value) { switch (value) { case 0: return UNSPECIFIED; @@ -246,6 +263,10 @@ public TensorDebugMode findValueByNumber(int number) { public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor @@ -254,7 +275,7 @@ public TensorDebugMode findValueByNumber(int number) { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return org.tensorflow.proto.util.DebugEventProtos.getDescriptor().getEnumTypes().get(0); + return org.tensorflow.proto.DebugEventProtos.getDescriptor().getEnumTypes().get(0); } private static final TensorDebugMode[] VALUES = values(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescription.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescription.java new file mode 100644 index 00000000000..b91793b6788 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescription.java @@ -0,0 +1,961 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_description.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.TensorDescription} + */ +public final class TensorDescription extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorDescription) + TensorDescriptionOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorDescription.class.getName()); + } + // Use TensorDescription.newBuilder() to construct. + private TensorDescription(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorDescription() { + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorDescription.class, org.tensorflow.proto.TensorDescription.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + *
    +   * Data type of tensor elements
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +   * Data type of tensor elements
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int ALLOCATION_DESCRIPTION_FIELD_NUMBER = 4; + private org.tensorflow.proto.AllocationDescription allocationDescription_; + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return Whether the allocationDescription field is set. + */ + @java.lang.Override + public boolean hasAllocationDescription() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return The allocationDescription. + */ + @java.lang.Override + public org.tensorflow.proto.AllocationDescription getAllocationDescription() { + return allocationDescription_ == null ? org.tensorflow.proto.AllocationDescription.getDefaultInstance() : allocationDescription_; + } + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + @java.lang.Override + public org.tensorflow.proto.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder() { + return allocationDescription_ == null ? org.tensorflow.proto.AllocationDescription.getDefaultInstance() : allocationDescription_; + } + + 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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getAllocationDescription()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAllocationDescription()); + } + size += getUnknownFields().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.TensorDescription)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorDescription other = (org.tensorflow.proto.TensorDescription) obj; + + if (dtype_ != other.dtype_) return false; + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (hasAllocationDescription() != other.hasAllocationDescription()) return false; + if (hasAllocationDescription()) { + if (!getAllocationDescription() + .equals(other.getAllocationDescription())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + if (hasAllocationDescription()) { + hash = (37 * hash) + ALLOCATION_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getAllocationDescription().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorDescription parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorDescription 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.TensorDescription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorDescription 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.TensorDescription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorDescription parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorDescription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorDescription parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorDescription parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorDescription parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorDescription parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorDescription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorDescription 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TensorDescription} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorDescription) + org.tensorflow.proto.TensorDescriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorDescription.class, org.tensorflow.proto.TensorDescription.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorDescription.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getAllocationDescriptionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + allocationDescription_ = null; + if (allocationDescriptionBuilder_ != null) { + allocationDescriptionBuilder_.dispose(); + allocationDescriptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorDescriptionProtos.internal_static_tensorflow_TensorDescription_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorDescription getDefaultInstanceForType() { + return org.tensorflow.proto.TensorDescription.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorDescription build() { + org.tensorflow.proto.TensorDescription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorDescription buildPartial() { + org.tensorflow.proto.TensorDescription result = new org.tensorflow.proto.TensorDescription(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorDescription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allocationDescription_ = allocationDescriptionBuilder_ == null + ? allocationDescription_ + : allocationDescriptionBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorDescription) { + return mergeFrom((org.tensorflow.proto.TensorDescription)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorDescription other) { + if (other == org.tensorflow.proto.TensorDescription.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.hasAllocationDescription()) { + mergeAllocationDescription(other.getAllocationDescription()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: { + input.readMessage( + getAllocationDescriptionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + *
    +     * Data type of tensor elements
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * Data type of tensor elements
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Data type of tensor elements
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +     * Data type of tensor elements
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Data type of tensor elements
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000002); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + *
    +     * Shape of the tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private org.tensorflow.proto.AllocationDescription allocationDescription_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder> allocationDescriptionBuilder_; + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return Whether the allocationDescription field is set. + */ + public boolean hasAllocationDescription() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return The allocationDescription. + */ + public org.tensorflow.proto.AllocationDescription getAllocationDescription() { + if (allocationDescriptionBuilder_ == null) { + return allocationDescription_ == null ? org.tensorflow.proto.AllocationDescription.getDefaultInstance() : allocationDescription_; + } else { + return allocationDescriptionBuilder_.getMessage(); + } + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public Builder setAllocationDescription(org.tensorflow.proto.AllocationDescription value) { + if (allocationDescriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + allocationDescription_ = value; + } else { + allocationDescriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public Builder setAllocationDescription( + org.tensorflow.proto.AllocationDescription.Builder builderForValue) { + if (allocationDescriptionBuilder_ == null) { + allocationDescription_ = builderForValue.build(); + } else { + allocationDescriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public Builder mergeAllocationDescription(org.tensorflow.proto.AllocationDescription value) { + if (allocationDescriptionBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + allocationDescription_ != null && + allocationDescription_ != org.tensorflow.proto.AllocationDescription.getDefaultInstance()) { + getAllocationDescriptionBuilder().mergeFrom(value); + } else { + allocationDescription_ = value; + } + } else { + allocationDescriptionBuilder_.mergeFrom(value); + } + if (allocationDescription_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public Builder clearAllocationDescription() { + bitField0_ = (bitField0_ & ~0x00000004); + allocationDescription_ = null; + if (allocationDescriptionBuilder_ != null) { + allocationDescriptionBuilder_.dispose(); + allocationDescriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public org.tensorflow.proto.AllocationDescription.Builder getAllocationDescriptionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAllocationDescriptionFieldBuilder().getBuilder(); + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + public org.tensorflow.proto.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder() { + if (allocationDescriptionBuilder_ != null) { + return allocationDescriptionBuilder_.getMessageOrBuilder(); + } else { + return allocationDescription_ == null ? + org.tensorflow.proto.AllocationDescription.getDefaultInstance() : allocationDescription_; + } + } + /** + *
    +     * Information about the size and allocator used for the data
    +     * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder> + getAllocationDescriptionFieldBuilder() { + if (allocationDescriptionBuilder_ == null) { + allocationDescriptionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.AllocationDescription, org.tensorflow.proto.AllocationDescription.Builder, org.tensorflow.proto.AllocationDescriptionOrBuilder>( + getAllocationDescription(), + getParentForChildren(), + isClean()); + allocationDescription_ = null; + } + return allocationDescriptionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorDescription) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorDescription) + private static final org.tensorflow.proto.TensorDescription DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorDescription(); + } + + public static org.tensorflow.proto.TensorDescription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorDescription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorDescription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionOrBuilder.java new file mode 100644 index 00000000000..42e8478aab8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionOrBuilder.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_description.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TensorDescriptionOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorDescription) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Data type of tensor elements
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + *
    +   * Data type of tensor elements
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return Whether the shape field is set. + */ + boolean hasShape(); + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + * @return The shape. + */ + org.tensorflow.proto.TensorShapeProto getShape(); + /** + *
    +   * Shape of the tensor.
    +   * 
    + * + * .tensorflow.TensorShapeProto shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder(); + + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return Whether the allocationDescription field is set. + */ + boolean hasAllocationDescription(); + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + * @return The allocationDescription. + */ + org.tensorflow.proto.AllocationDescription getAllocationDescription(); + /** + *
    +   * Information about the size and allocator used for the data
    +   * 
    + * + * .tensorflow.AllocationDescription allocation_description = 4; + */ + org.tensorflow.proto.AllocationDescriptionOrBuilder getAllocationDescriptionOrBuilder(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionProtos.java new file mode 100644 index 00000000000..52dfca9d9b3 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorDescriptionProtos.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_description.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TensorDescriptionProtos { + private TensorDescriptionProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorDescriptionProtos.class.getName()); + } + 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_TensorDescription_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorDescription_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n2tensorflow/core/framework/tensor_descr" + + "iption.proto\022\ntensorflow\0326tensorflow/cor" + + "e/framework/allocation_description.proto" + + "\032,tensorflow/core/framework/tensor_shape" + + ".proto\032%tensorflow/core/framework/types." + + "proto\"\250\001\n\021TensorDescription\022#\n\005dtype\030\001 \001" + + "(\0162\024.tensorflow.DataType\022+\n\005shape\030\002 \001(\0132" + + "\034.tensorflow.TensorShapeProto\022A\n\026allocat" + + "ion_description\030\004 \001(\0132!.tensorflow.Alloc" + + "ationDescriptionB\217\001\n\024org.tensorflow.prot" + + "oB\027TensorDescriptionProtosP\001ZYgithub.com" + + "/tensorflow/tensorflow/tensorflow/go/cor" + + "e/framework/tensor_description_go_proto\370" + + "\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.AllocationDescriptionProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_TensorDescription_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_TensorDescription_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorDescription_descriptor, + new java.lang.String[] { "Dtype", "Shape", "AllocationDescription", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.AllocationDescriptionProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfo.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfo.java new file mode 100644 index 00000000000..1c2f1251ff7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfo.java @@ -0,0 +1,3635 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Information about a Tensor necessary for feeding or retrieval.
    + * 
    + * + * Protobuf type {@code tensorflow.TensorInfo} + */ +public final class TensorInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo) + TensorInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorInfo.class.getName()); + } + // Use TensorInfo.newBuilder() to construct. + private TensorInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorInfo() { + dtype_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.class, org.tensorflow.proto.TensorInfo.Builder.class); + } + + public interface CooSparseOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo.CooSparse) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +     * 
    + * + * string values_tensor_name = 1; + * @return The valuesTensorName. + */ + java.lang.String getValuesTensorName(); + /** + *
    +     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +     * 
    + * + * string values_tensor_name = 1; + * @return The bytes for valuesTensorName. + */ + com.google.protobuf.ByteString + getValuesTensorNameBytes(); + + /** + *
    +     * The indices Tensor must have dtype int64 and shape [?, ?].
    +     * 
    + * + * string indices_tensor_name = 2; + * @return The indicesTensorName. + */ + java.lang.String getIndicesTensorName(); + /** + *
    +     * The indices Tensor must have dtype int64 and shape [?, ?].
    +     * 
    + * + * string indices_tensor_name = 2; + * @return The bytes for indicesTensorName. + */ + com.google.protobuf.ByteString + getIndicesTensorNameBytes(); + + /** + *
    +     * The dynamic logical shape represented by the SparseTensor is recorded in
    +     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +     * 
    + * + * string dense_shape_tensor_name = 3; + * @return The denseShapeTensorName. + */ + java.lang.String getDenseShapeTensorName(); + /** + *
    +     * The dynamic logical shape represented by the SparseTensor is recorded in
    +     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +     * 
    + * + * string dense_shape_tensor_name = 3; + * @return The bytes for denseShapeTensorName. + */ + com.google.protobuf.ByteString + getDenseShapeTensorNameBytes(); + } + /** + *
    +   * For sparse tensors, The COO encoding stores a triple of values, indices,
    +   * and shape.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorInfo.CooSparse} + */ + public static final class CooSparse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo.CooSparse) + CooSparseOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CooSparse.class.getName()); + } + // Use CooSparse.newBuilder() to construct. + private CooSparse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CooSparse() { + valuesTensorName_ = ""; + indicesTensorName_ = ""; + denseShapeTensorName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.CooSparse.class, org.tensorflow.proto.TensorInfo.CooSparse.Builder.class); + } + + public static final int VALUES_TENSOR_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object valuesTensorName_ = ""; + /** + *
    +     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +     * 
    + * + * string values_tensor_name = 1; + * @return The valuesTensorName. + */ + @java.lang.Override + public java.lang.String getValuesTensorName() { + java.lang.Object ref = valuesTensorName_; + 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(); + valuesTensorName_ = s; + return s; + } + } + /** + *
    +     * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +     * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +     * 
    + * + * string values_tensor_name = 1; + * @return The bytes for valuesTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValuesTensorNameBytes() { + java.lang.Object ref = valuesTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valuesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDICES_TENSOR_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object indicesTensorName_ = ""; + /** + *
    +     * The indices Tensor must have dtype int64 and shape [?, ?].
    +     * 
    + * + * string indices_tensor_name = 2; + * @return The indicesTensorName. + */ + @java.lang.Override + public java.lang.String getIndicesTensorName() { + java.lang.Object ref = indicesTensorName_; + 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(); + indicesTensorName_ = s; + return s; + } + } + /** + *
    +     * The indices Tensor must have dtype int64 and shape [?, ?].
    +     * 
    + * + * string indices_tensor_name = 2; + * @return The bytes for indicesTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIndicesTensorNameBytes() { + java.lang.Object ref = indicesTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + indicesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object denseShapeTensorName_ = ""; + /** + *
    +     * The dynamic logical shape represented by the SparseTensor is recorded in
    +     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +     * 
    + * + * string dense_shape_tensor_name = 3; + * @return The denseShapeTensorName. + */ + @java.lang.Override + public java.lang.String getDenseShapeTensorName() { + java.lang.Object ref = denseShapeTensorName_; + 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(); + denseShapeTensorName_ = s; + return s; + } + } + /** + *
    +     * The dynamic logical shape represented by the SparseTensor is recorded in
    +     * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +     * 
    + * + * string dense_shape_tensor_name = 3; + * @return The bytes for denseShapeTensorName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDenseShapeTensorNameBytes() { + java.lang.Object ref = denseShapeTensorName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + denseShapeTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, valuesTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(indicesTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, indicesTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(denseShapeTensorName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, denseShapeTensorName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, valuesTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(indicesTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, indicesTensorName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(denseShapeTensorName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, denseShapeTensorName_); + } + size += getUnknownFields().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.TensorInfo.CooSparse)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorInfo.CooSparse other = (org.tensorflow.proto.TensorInfo.CooSparse) obj; + + if (!getValuesTensorName() + .equals(other.getValuesTensorName())) return false; + if (!getIndicesTensorName() + .equals(other.getIndicesTensorName())) return false; + if (!getDenseShapeTensorName() + .equals(other.getDenseShapeTensorName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VALUES_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getValuesTensorName().hashCode(); + hash = (37 * hash) + INDICES_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getIndicesTensorName().hashCode(); + hash = (37 * hash) + DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDenseShapeTensorName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CooSparse 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.TensorInfo.CooSparse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorInfo.CooSparse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorInfo.CooSparse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo.CooSparse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorInfo.CooSparse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * For sparse tensors, The COO encoding stores a triple of values, indices,
    +     * and shape.
    +     * 
    + * + * Protobuf type {@code tensorflow.TensorInfo.CooSparse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo.CooSparse) + org.tensorflow.proto.TensorInfo.CooSparseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.CooSparse.class, org.tensorflow.proto.TensorInfo.CooSparse.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorInfo.CooSparse.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + valuesTensorName_ = ""; + indicesTensorName_ = ""; + denseShapeTensorName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CooSparse_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparse getDefaultInstanceForType() { + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparse build() { + org.tensorflow.proto.TensorInfo.CooSparse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparse buildPartial() { + org.tensorflow.proto.TensorInfo.CooSparse result = new org.tensorflow.proto.TensorInfo.CooSparse(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorInfo.CooSparse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.valuesTensorName_ = valuesTensorName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.indicesTensorName_ = indicesTensorName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.denseShapeTensorName_ = denseShapeTensorName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorInfo.CooSparse) { + return mergeFrom((org.tensorflow.proto.TensorInfo.CooSparse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorInfo.CooSparse other) { + if (other == org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance()) return this; + if (!other.getValuesTensorName().isEmpty()) { + valuesTensorName_ = other.valuesTensorName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIndicesTensorName().isEmpty()) { + indicesTensorName_ = other.indicesTensorName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDenseShapeTensorName().isEmpty()) { + denseShapeTensorName_ = other.denseShapeTensorName_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + valuesTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + indicesTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + denseShapeTensorName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object valuesTensorName_ = ""; + /** + *
    +       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +       * 
    + * + * string values_tensor_name = 1; + * @return The valuesTensorName. + */ + public java.lang.String getValuesTensorName() { + java.lang.Object ref = valuesTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valuesTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +       * 
    + * + * string values_tensor_name = 1; + * @return The bytes for valuesTensorName. + */ + public com.google.protobuf.ByteString + getValuesTensorNameBytes() { + java.lang.Object ref = valuesTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + valuesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +       * 
    + * + * string values_tensor_name = 1; + * @param value The valuesTensorName to set. + * @return This builder for chaining. + */ + public Builder setValuesTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valuesTensorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +       * 
    + * + * string values_tensor_name = 1; + * @return This builder for chaining. + */ + public Builder clearValuesTensorName() { + valuesTensorName_ = getDefaultInstance().getValuesTensorName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * The shape of the values Tensor is [?].  Its dtype must be the dtype of
    +       * the SparseTensor as a whole, given in the enclosing TensorInfo.
    +       * 
    + * + * string values_tensor_name = 1; + * @param value The bytes for valuesTensorName to set. + * @return This builder for chaining. + */ + public Builder setValuesTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valuesTensorName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object indicesTensorName_ = ""; + /** + *
    +       * The indices Tensor must have dtype int64 and shape [?, ?].
    +       * 
    + * + * string indices_tensor_name = 2; + * @return The indicesTensorName. + */ + public java.lang.String getIndicesTensorName() { + java.lang.Object ref = indicesTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indicesTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The indices Tensor must have dtype int64 and shape [?, ?].
    +       * 
    + * + * string indices_tensor_name = 2; + * @return The bytes for indicesTensorName. + */ + public com.google.protobuf.ByteString + getIndicesTensorNameBytes() { + java.lang.Object ref = indicesTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + indicesTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The indices Tensor must have dtype int64 and shape [?, ?].
    +       * 
    + * + * string indices_tensor_name = 2; + * @param value The indicesTensorName to set. + * @return This builder for chaining. + */ + public Builder setIndicesTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + indicesTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The indices Tensor must have dtype int64 and shape [?, ?].
    +       * 
    + * + * string indices_tensor_name = 2; + * @return This builder for chaining. + */ + public Builder clearIndicesTensorName() { + indicesTensorName_ = getDefaultInstance().getIndicesTensorName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * The indices Tensor must have dtype int64 and shape [?, ?].
    +       * 
    + * + * string indices_tensor_name = 2; + * @param value The bytes for indicesTensorName to set. + * @return This builder for chaining. + */ + public Builder setIndicesTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + indicesTensorName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object denseShapeTensorName_ = ""; + /** + *
    +       * The dynamic logical shape represented by the SparseTensor is recorded in
    +       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +       * 
    + * + * string dense_shape_tensor_name = 3; + * @return The denseShapeTensorName. + */ + public java.lang.String getDenseShapeTensorName() { + java.lang.Object ref = denseShapeTensorName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + denseShapeTensorName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * The dynamic logical shape represented by the SparseTensor is recorded in
    +       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +       * 
    + * + * string dense_shape_tensor_name = 3; + * @return The bytes for denseShapeTensorName. + */ + public com.google.protobuf.ByteString + getDenseShapeTensorNameBytes() { + java.lang.Object ref = denseShapeTensorName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + denseShapeTensorName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * The dynamic logical shape represented by the SparseTensor is recorded in
    +       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +       * 
    + * + * string dense_shape_tensor_name = 3; + * @param value The denseShapeTensorName to set. + * @return This builder for chaining. + */ + public Builder setDenseShapeTensorName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + denseShapeTensorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The dynamic logical shape represented by the SparseTensor is recorded in
    +       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +       * 
    + * + * string dense_shape_tensor_name = 3; + * @return This builder for chaining. + */ + public Builder clearDenseShapeTensorName() { + denseShapeTensorName_ = getDefaultInstance().getDenseShapeTensorName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * The dynamic logical shape represented by the SparseTensor is recorded in
    +       * the Tensor referenced here.  It must have dtype int64 and shape [?].
    +       * 
    + * + * string dense_shape_tensor_name = 3; + * @param value The bytes for denseShapeTensorName to set. + * @return This builder for chaining. + */ + public Builder setDenseShapeTensorNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + denseShapeTensorName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorInfo.CooSparse) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo.CooSparse) + private static final org.tensorflow.proto.TensorInfo.CooSparse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorInfo.CooSparse(); + } + + public static org.tensorflow.proto.TensorInfo.CooSparse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CooSparse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorInfo.CooSparse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CompositeTensorOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo.CompositeTensor) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return Whether the typeSpec field is set. + */ + boolean hasTypeSpec(); + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return The typeSpec. + */ + org.tensorflow.proto.Struct.TypeSpecProto getTypeSpec(); + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecOrBuilder(); + + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + java.util.List + getComponentsList(); + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + org.tensorflow.proto.TensorInfo getComponents(int index); + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + int getComponentsCount(); + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + java.util.List + getComponentsOrBuilderList(); + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + org.tensorflow.proto.TensorInfoOrBuilder getComponentsOrBuilder( + int index); + } + /** + *
    +   * Generic encoding for composite tensors.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorInfo.CompositeTensor} + */ + public static final class CompositeTensor extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorInfo.CompositeTensor) + CompositeTensorOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CompositeTensor.class.getName()); + } + // Use CompositeTensor.newBuilder() to construct. + private CompositeTensor(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CompositeTensor() { + components_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.CompositeTensor.class, org.tensorflow.proto.TensorInfo.CompositeTensor.Builder.class); + } + + private int bitField0_; + public static final int TYPE_SPEC_FIELD_NUMBER = 1; + private org.tensorflow.proto.Struct.TypeSpecProto typeSpec_; + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return Whether the typeSpec field is set. + */ + @java.lang.Override + public boolean hasTypeSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return The typeSpec. + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpec() { + return typeSpec_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpec_; + } + /** + *
    +     * The serialized TypeSpec for the composite tensor.
    +     * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + @java.lang.Override + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecOrBuilder() { + return typeSpec_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpec_; + } + + public static final int COMPONENTS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List components_; + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + @java.lang.Override + public java.util.List getComponentsList() { + return components_; + } + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + @java.lang.Override + public java.util.List + getComponentsOrBuilderList() { + return components_; + } + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + @java.lang.Override + public int getComponentsCount() { + return components_.size(); + } + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo getComponents(int index) { + return components_.get(index); + } + /** + *
    +     * A TensorInfo for each flattened component tensor.
    +     * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfoOrBuilder getComponentsOrBuilder( + int index) { + return components_.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 { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTypeSpec()); + } + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(2, components_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTypeSpec()); + } + for (int i = 0; i < components_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, components_.get(i)); + } + size += getUnknownFields().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.TensorInfo.CompositeTensor)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorInfo.CompositeTensor other = (org.tensorflow.proto.TensorInfo.CompositeTensor) obj; + + if (hasTypeSpec() != other.hasTypeSpec()) return false; + if (hasTypeSpec()) { + if (!getTypeSpec() + .equals(other.getTypeSpec())) return false; + } + if (!getComponentsList() + .equals(other.getComponentsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTypeSpec()) { + hash = (37 * hash) + TYPE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getTypeSpec().hashCode(); + } + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor 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.TensorInfo.CompositeTensor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo.CompositeTensor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorInfo.CompositeTensor 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Generic encoding for composite tensors.
    +     * 
    + * + * Protobuf type {@code tensorflow.TensorInfo.CompositeTensor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo.CompositeTensor) + org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.CompositeTensor.class, org.tensorflow.proto.TensorInfo.CompositeTensor.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorInfo.CompositeTensor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTypeSpecFieldBuilder(); + getComponentsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeSpec_ = null; + if (typeSpecBuilder_ != null) { + typeSpecBuilder_.dispose(); + typeSpecBuilder_ = null; + } + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); + } else { + components_ = null; + componentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_CompositeTensor_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensor getDefaultInstanceForType() { + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensor build() { + org.tensorflow.proto.TensorInfo.CompositeTensor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensor buildPartial() { + org.tensorflow.proto.TensorInfo.CompositeTensor result = new org.tensorflow.proto.TensorInfo.CompositeTensor(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TensorInfo.CompositeTensor result) { + if (componentsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + components_ = java.util.Collections.unmodifiableList(components_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.components_ = components_; + } else { + result.components_ = componentsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TensorInfo.CompositeTensor result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeSpec_ = typeSpecBuilder_ == null + ? typeSpec_ + : typeSpecBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorInfo.CompositeTensor) { + return mergeFrom((org.tensorflow.proto.TensorInfo.CompositeTensor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorInfo.CompositeTensor other) { + if (other == org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance()) return this; + if (other.hasTypeSpec()) { + mergeTypeSpec(other.getTypeSpec()); + } + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureComponentsIsMutable(); + components_.addAll(other.components_); + } + onChanged(); + } + } else { + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; + bitField0_ = (bitField0_ & ~0x00000002); + componentsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getComponentsFieldBuilder() : null; + } else { + componentsBuilder_.addAllMessages(other.components_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getTypeSpecFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.TensorInfo m = + input.readMessage( + org.tensorflow.proto.TensorInfo.parser(), + extensionRegistry); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(m); + } else { + componentsBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.Struct.TypeSpecProto typeSpec_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> typeSpecBuilder_; + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return Whether the typeSpec field is set. + */ + public boolean hasTypeSpec() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + * @return The typeSpec. + */ + public org.tensorflow.proto.Struct.TypeSpecProto getTypeSpec() { + if (typeSpecBuilder_ == null) { + return typeSpec_ == null ? org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpec_; + } else { + return typeSpecBuilder_.getMessage(); + } + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public Builder setTypeSpec(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + typeSpec_ = value; + } else { + typeSpecBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public Builder setTypeSpec( + org.tensorflow.proto.Struct.TypeSpecProto.Builder builderForValue) { + if (typeSpecBuilder_ == null) { + typeSpec_ = builderForValue.build(); + } else { + typeSpecBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public Builder mergeTypeSpec(org.tensorflow.proto.Struct.TypeSpecProto value) { + if (typeSpecBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + typeSpec_ != null && + typeSpec_ != org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance()) { + getTypeSpecBuilder().mergeFrom(value); + } else { + typeSpec_ = value; + } + } else { + typeSpecBuilder_.mergeFrom(value); + } + if (typeSpec_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public Builder clearTypeSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + typeSpec_ = null; + if (typeSpecBuilder_ != null) { + typeSpecBuilder_.dispose(); + typeSpecBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public org.tensorflow.proto.Struct.TypeSpecProto.Builder getTypeSpecBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTypeSpecFieldBuilder().getBuilder(); + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + public org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder getTypeSpecOrBuilder() { + if (typeSpecBuilder_ != null) { + return typeSpecBuilder_.getMessageOrBuilder(); + } else { + return typeSpec_ == null ? + org.tensorflow.proto.Struct.TypeSpecProto.getDefaultInstance() : typeSpec_; + } + } + /** + *
    +       * The serialized TypeSpec for the composite tensor.
    +       * 
    + * + * .tensorflow.TypeSpecProto type_spec = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder> + getTypeSpecFieldBuilder() { + if (typeSpecBuilder_ == null) { + typeSpecBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.Struct.TypeSpecProto, org.tensorflow.proto.Struct.TypeSpecProto.Builder, org.tensorflow.proto.Struct.TypeSpecProtoOrBuilder>( + getTypeSpec(), + getParentForChildren(), + isClean()); + typeSpec_ = null; + } + return typeSpecBuilder_; + } + + private java.util.List components_ = + java.util.Collections.emptyList(); + private void ensureComponentsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + components_ = new java.util.ArrayList(components_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder> componentsBuilder_; + + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public java.util.List getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); + } else { + return componentsBuilder_.getMessageList(); + } + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); + } else { + return componentsBuilder_.getCount(); + } + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public org.tensorflow.proto.TensorInfo getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); + } else { + return componentsBuilder_.getMessage(index); + } + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder setComponents( + int index, org.tensorflow.proto.TensorInfo value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.set(index, value); + onChanged(); + } else { + componentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder setComponents( + int index, org.tensorflow.proto.TensorInfo.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder addComponents(org.tensorflow.proto.TensorInfo value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.add(value); + onChanged(); + } else { + componentsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder addComponents( + int index, org.tensorflow.proto.TensorInfo value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.add(index, value); + onChanged(); + } else { + componentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder addComponents( + org.tensorflow.proto.TensorInfo.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder addComponents( + int index, org.tensorflow.proto.TensorInfo.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder addAllComponents( + java.lang.Iterable values) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, components_); + onChanged(); + } else { + componentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + componentsBuilder_.clear(); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); + onChanged(); + } else { + componentsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public org.tensorflow.proto.TensorInfo.Builder getComponentsBuilder( + int index) { + return getComponentsFieldBuilder().getBuilder(index); + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public org.tensorflow.proto.TensorInfoOrBuilder getComponentsOrBuilder( + int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public java.util.List + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(components_); + } + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public org.tensorflow.proto.TensorInfo.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( + org.tensorflow.proto.TensorInfo.getDefaultInstance()); + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public org.tensorflow.proto.TensorInfo.Builder addComponentsBuilder( + int index) { + return getComponentsFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorInfo.getDefaultInstance()); + } + /** + *
    +       * A TensorInfo for each flattened component tensor.
    +       * 
    + * + * repeated .tensorflow.TensorInfo components = 2; + */ + public java.util.List + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder> + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorInfo, org.tensorflow.proto.TensorInfo.Builder, org.tensorflow.proto.TensorInfoOrBuilder>( + components_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + components_ = null; + } + return componentsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorInfo.CompositeTensor) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo.CompositeTensor) + private static final org.tensorflow.proto.TensorInfo.CompositeTensor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorInfo.CompositeTensor(); + } + + public static org.tensorflow.proto.TensorInfo.CompositeTensor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompositeTensor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorInfo.CompositeTensor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + private int encodingCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object encoding_; + public enum EncodingCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NAME(1), + COO_SPARSE(4), + COMPOSITE_TENSOR(5), + ENCODING_NOT_SET(0); + private final int value; + private EncodingCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncodingCase valueOf(int value) { + return forNumber(value); + } + + public static EncodingCase forNumber(int value) { + switch (value) { + case 1: return NAME; + case 4: return COO_SPARSE; + case 5: return COMPOSITE_TENSOR; + case 0: return ENCODING_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public EncodingCase + getEncodingCase() { + return EncodingCase.forNumber( + encodingCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return Whether the name field is set. + */ + public boolean hasName() { + return encodingCase_ == 1; + } + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = ""; + if (encodingCase_ == 1) { + ref = encoding_; + } + 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(); + if (encodingCase_ == 1) { + encoding_ = s; + } + return s; + } + } + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = ""; + if (encodingCase_ == 1) { + ref = encoding_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (encodingCase_ == 1) { + encoding_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COO_SPARSE_FIELD_NUMBER = 4; + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return Whether the cooSparse field is set. + */ + @java.lang.Override + public boolean hasCooSparse() { + return encodingCase_ == 4; + } + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return The cooSparse. + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparse getCooSparse() { + if (encodingCase_ == 4) { + return (org.tensorflow.proto.TensorInfo.CooSparse) encoding_; + } + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder() { + if (encodingCase_ == 4) { + return (org.tensorflow.proto.TensorInfo.CooSparse) encoding_; + } + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + + public static final int COMPOSITE_TENSOR_FIELD_NUMBER = 5; + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return Whether the compositeTensor field is set. + */ + @java.lang.Override + public boolean hasCompositeTensor() { + return encodingCase_ == 5; + } + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return The compositeTensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensor getCompositeTensor() { + if (encodingCase_ == 5) { + return (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_; + } + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder() { + if (encodingCase_ == 5) { + return (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_; + } + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + + public static final int DTYPE_FIELD_NUMBER = 2; + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 2; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 2; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int TENSOR_SHAPE_FIELD_NUMBER = 3; + private org.tensorflow.proto.TensorShapeProto tensorShape_; + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return Whether the tensorShape field is set. + */ + @java.lang.Override + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return The tensorShape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + + 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 (encodingCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, encoding_); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(2, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTensorShape()); + } + if (encodingCase_ == 4) { + output.writeMessage(4, (org.tensorflow.proto.TensorInfo.CooSparse) encoding_); + } + if (encodingCase_ == 5) { + output.writeMessage(5, (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encodingCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, encoding_); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTensorShape()); + } + if (encodingCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (org.tensorflow.proto.TensorInfo.CooSparse) encoding_); + } + if (encodingCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_); + } + size += getUnknownFields().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.TensorInfo)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorInfo other = (org.tensorflow.proto.TensorInfo) obj; + + if (dtype_ != other.dtype_) return false; + if (hasTensorShape() != other.hasTensorShape()) return false; + if (hasTensorShape()) { + if (!getTensorShape() + .equals(other.getTensorShape())) return false; + } + if (!getEncodingCase().equals(other.getEncodingCase())) return false; + switch (encodingCase_) { + case 1: + if (!getName() + .equals(other.getName())) return false; + break; + case 4: + if (!getCooSparse() + .equals(other.getCooSparse())) return false; + break; + case 5: + if (!getCompositeTensor() + .equals(other.getCompositeTensor())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasTensorShape()) { + hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getTensorShape().hashCode(); + } + switch (encodingCase_) { + case 1: + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + break; + case 4: + hash = (37 * hash) + COO_SPARSE_FIELD_NUMBER; + hash = (53 * hash) + getCooSparse().hashCode(); + break; + case 5: + hash = (37 * hash) + COMPOSITE_TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getCompositeTensor().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo 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.TensorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo 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.TensorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Information about a Tensor necessary for feeding or retrieval.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorInfo) + org.tensorflow.proto.TensorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorInfo.class, org.tensorflow.proto.TensorInfo.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (cooSparseBuilder_ != null) { + cooSparseBuilder_.clear(); + } + if (compositeTensorBuilder_ != null) { + compositeTensorBuilder_.clear(); + } + dtype_ = 0; + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + encodingCase_ = 0; + encoding_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.MetaGraphProtos.internal_static_tensorflow_TensorInfo_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo getDefaultInstanceForType() { + return org.tensorflow.proto.TensorInfo.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo build() { + org.tensorflow.proto.TensorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorInfo buildPartial() { + org.tensorflow.proto.TensorInfo result = new org.tensorflow.proto.TensorInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tensorShape_ = tensorShapeBuilder_ == null + ? tensorShape_ + : tensorShapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.TensorInfo result) { + result.encodingCase_ = encodingCase_; + result.encoding_ = this.encoding_; + if (encodingCase_ == 4 && + cooSparseBuilder_ != null) { + result.encoding_ = cooSparseBuilder_.build(); + } + if (encodingCase_ == 5 && + compositeTensorBuilder_ != null) { + result.encoding_ = compositeTensorBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorInfo) { + return mergeFrom((org.tensorflow.proto.TensorInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorInfo other) { + if (other == org.tensorflow.proto.TensorInfo.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasTensorShape()) { + mergeTensorShape(other.getTensorShape()); + } + switch (other.getEncodingCase()) { + case NAME: { + encodingCase_ = 1; + encoding_ = other.encoding_; + onChanged(); + break; + } + case COO_SPARSE: { + mergeCooSparse(other.getCooSparse()); + break; + } + case COMPOSITE_TENSOR: { + mergeCompositeTensor(other.getCompositeTensor()); + break; + } + case ENCODING_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + encodingCase_ = 1; + encoding_ = s; + break; + } // case 10 + case 16: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 16 + case 26: { + input.readMessage( + getTensorShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 34: { + input.readMessage( + getCooSparseFieldBuilder().getBuilder(), + extensionRegistry); + encodingCase_ = 4; + break; + } // case 34 + case 42: { + input.readMessage( + getCompositeTensorFieldBuilder().getBuilder(), + extensionRegistry); + encodingCase_ = 5; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int encodingCase_ = 0; + private java.lang.Object encoding_; + public EncodingCase + getEncodingCase() { + return EncodingCase.forNumber( + encodingCase_); + } + + public Builder clearEncoding() { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return encodingCase_ == 1; + } + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = ""; + if (encodingCase_ == 1) { + ref = encoding_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (encodingCase_ == 1) { + encoding_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = ""; + if (encodingCase_ == 1) { + ref = encoding_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (encodingCase_ == 1) { + encoding_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + encodingCase_ = 1; + encoding_ = value; + onChanged(); + return this; + } + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + if (encodingCase_ == 1) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + return this; + } + /** + *
    +     * For dense `Tensor`s, the name of the tensor in the graph.
    +     * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + encodingCase_ = 1; + encoding_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CooSparse, org.tensorflow.proto.TensorInfo.CooSparse.Builder, org.tensorflow.proto.TensorInfo.CooSparseOrBuilder> cooSparseBuilder_; + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return Whether the cooSparse field is set. + */ + @java.lang.Override + public boolean hasCooSparse() { + return encodingCase_ == 4; + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return The cooSparse. + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparse getCooSparse() { + if (cooSparseBuilder_ == null) { + if (encodingCase_ == 4) { + return (org.tensorflow.proto.TensorInfo.CooSparse) encoding_; + } + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } else { + if (encodingCase_ == 4) { + return cooSparseBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + public Builder setCooSparse(org.tensorflow.proto.TensorInfo.CooSparse value) { + if (cooSparseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + cooSparseBuilder_.setMessage(value); + } + encodingCase_ = 4; + return this; + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + public Builder setCooSparse( + org.tensorflow.proto.TensorInfo.CooSparse.Builder builderForValue) { + if (cooSparseBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + cooSparseBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 4; + return this; + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + public Builder mergeCooSparse(org.tensorflow.proto.TensorInfo.CooSparse value) { + if (cooSparseBuilder_ == null) { + if (encodingCase_ == 4 && + encoding_ != org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance()) { + encoding_ = org.tensorflow.proto.TensorInfo.CooSparse.newBuilder((org.tensorflow.proto.TensorInfo.CooSparse) encoding_) + .mergeFrom(value).buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 4) { + cooSparseBuilder_.mergeFrom(value); + } else { + cooSparseBuilder_.setMessage(value); + } + } + encodingCase_ = 4; + return this; + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + public Builder clearCooSparse() { + if (cooSparseBuilder_ == null) { + if (encodingCase_ == 4) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 4) { + encodingCase_ = 0; + encoding_ = null; + } + cooSparseBuilder_.clear(); + } + return this; + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + public org.tensorflow.proto.TensorInfo.CooSparse.Builder getCooSparseBuilder() { + return getCooSparseFieldBuilder().getBuilder(); + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder() { + if ((encodingCase_ == 4) && (cooSparseBuilder_ != null)) { + return cooSparseBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 4) { + return (org.tensorflow.proto.TensorInfo.CooSparse) encoding_; + } + return org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + } + /** + *
    +     * There are many possible encodings of sparse matrices
    +     * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +     * uses only the COO encoding.  This is supported and documented in the
    +     * SparseTensor Python class.
    +     * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CooSparse, org.tensorflow.proto.TensorInfo.CooSparse.Builder, org.tensorflow.proto.TensorInfo.CooSparseOrBuilder> + getCooSparseFieldBuilder() { + if (cooSparseBuilder_ == null) { + if (!(encodingCase_ == 4)) { + encoding_ = org.tensorflow.proto.TensorInfo.CooSparse.getDefaultInstance(); + } + cooSparseBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CooSparse, org.tensorflow.proto.TensorInfo.CooSparse.Builder, org.tensorflow.proto.TensorInfo.CooSparseOrBuilder>( + (org.tensorflow.proto.TensorInfo.CooSparse) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 4; + onChanged(); + return cooSparseBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CompositeTensor, org.tensorflow.proto.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder> compositeTensorBuilder_; + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return Whether the compositeTensor field is set. + */ + @java.lang.Override + public boolean hasCompositeTensor() { + return encodingCase_ == 5; + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return The compositeTensor. + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensor getCompositeTensor() { + if (compositeTensorBuilder_ == null) { + if (encodingCase_ == 5) { + return (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_; + } + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } else { + if (encodingCase_ == 5) { + return compositeTensorBuilder_.getMessage(); + } + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + public Builder setCompositeTensor(org.tensorflow.proto.TensorInfo.CompositeTensor value) { + if (compositeTensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encoding_ = value; + onChanged(); + } else { + compositeTensorBuilder_.setMessage(value); + } + encodingCase_ = 5; + return this; + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + public Builder setCompositeTensor( + org.tensorflow.proto.TensorInfo.CompositeTensor.Builder builderForValue) { + if (compositeTensorBuilder_ == null) { + encoding_ = builderForValue.build(); + onChanged(); + } else { + compositeTensorBuilder_.setMessage(builderForValue.build()); + } + encodingCase_ = 5; + return this; + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + public Builder mergeCompositeTensor(org.tensorflow.proto.TensorInfo.CompositeTensor value) { + if (compositeTensorBuilder_ == null) { + if (encodingCase_ == 5 && + encoding_ != org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance()) { + encoding_ = org.tensorflow.proto.TensorInfo.CompositeTensor.newBuilder((org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_) + .mergeFrom(value).buildPartial(); + } else { + encoding_ = value; + } + onChanged(); + } else { + if (encodingCase_ == 5) { + compositeTensorBuilder_.mergeFrom(value); + } else { + compositeTensorBuilder_.setMessage(value); + } + } + encodingCase_ = 5; + return this; + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + public Builder clearCompositeTensor() { + if (compositeTensorBuilder_ == null) { + if (encodingCase_ == 5) { + encodingCase_ = 0; + encoding_ = null; + onChanged(); + } + } else { + if (encodingCase_ == 5) { + encodingCase_ = 0; + encoding_ = null; + } + compositeTensorBuilder_.clear(); + } + return this; + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + public org.tensorflow.proto.TensorInfo.CompositeTensor.Builder getCompositeTensorBuilder() { + return getCompositeTensorFieldBuilder().getBuilder(); + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + @java.lang.Override + public org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder() { + if ((encodingCase_ == 5) && (compositeTensorBuilder_ != null)) { + return compositeTensorBuilder_.getMessageOrBuilder(); + } else { + if (encodingCase_ == 5) { + return (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_; + } + return org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + } + /** + *
    +     * Generic encoding for CompositeTensors.
    +     * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CompositeTensor, org.tensorflow.proto.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder> + getCompositeTensorFieldBuilder() { + if (compositeTensorBuilder_ == null) { + if (!(encodingCase_ == 5)) { + encoding_ = org.tensorflow.proto.TensorInfo.CompositeTensor.getDefaultInstance(); + } + compositeTensorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorInfo.CompositeTensor, org.tensorflow.proto.TensorInfo.CompositeTensor.Builder, org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder>( + (org.tensorflow.proto.TensorInfo.CompositeTensor) encoding_, + getParentForChildren(), + isClean()); + encoding_ = null; + } + encodingCase_ = 5; + onChanged(); + return compositeTensorBuilder_; + } + + private int dtype_ = 0; + /** + * .tensorflow.DataType dtype = 2; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + * .tensorflow.DataType dtype = 2; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 2; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + * .tensorflow.DataType dtype = 2; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.DataType dtype = 2; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000008); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto tensorShape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> tensorShapeBuilder_; + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return Whether the tensorShape field is set. + */ + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return The tensorShape. + */ + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + if (tensorShapeBuilder_ == null) { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } else { + return tensorShapeBuilder_.getMessage(); + } + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public Builder setTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorShape_ = value; + } else { + tensorShapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public Builder setTensorShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (tensorShapeBuilder_ == null) { + tensorShape_ = builderForValue.build(); + } else { + tensorShapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public Builder mergeTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + tensorShape_ != null && + tensorShape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getTensorShapeBuilder().mergeFrom(value); + } else { + tensorShape_ = value; + } + } else { + tensorShapeBuilder_.mergeFrom(value); + } + if (tensorShape_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public Builder clearTensorShape() { + bitField0_ = (bitField0_ & ~0x00000010); + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getTensorShapeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getTensorShapeFieldBuilder().getBuilder(); + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + if (tensorShapeBuilder_ != null) { + return tensorShapeBuilder_.getMessageOrBuilder(); + } else { + return tensorShape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + } + /** + *
    +     * The static shape should be recorded here, to the extent that it can
    +     * be known in advance.  In the case of a SparseTensor, this field describes
    +     * the logical shape of the represented tensor (aka dense_shape).
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getTensorShapeFieldBuilder() { + if (tensorShapeBuilder_ == null) { + tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getTensorShape(), + getParentForChildren(), + isClean()); + tensorShape_ = null; + } + return tensorShapeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorInfo) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorInfo) + private static final org.tensorflow.proto.TensorInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorInfo(); + } + + public static org.tensorflow.proto.TensorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfoOrBuilder.java new file mode 100644 index 00000000000..e6f8bc5266b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorInfoOrBuilder.java @@ -0,0 +1,149 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/meta_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TensorInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return Whether the name field is set. + */ + boolean hasName(); + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * For dense `Tensor`s, the name of the tensor in the graph.
    +   * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return Whether the cooSparse field is set. + */ + boolean hasCooSparse(); + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + * @return The cooSparse. + */ + org.tensorflow.proto.TensorInfo.CooSparse getCooSparse(); + /** + *
    +   * There are many possible encodings of sparse matrices
    +   * (https://en.wikipedia.org/wiki/Sparse_matrix).  Currently, TensorFlow
    +   * uses only the COO encoding.  This is supported and documented in the
    +   * SparseTensor Python class.
    +   * 
    + * + * .tensorflow.TensorInfo.CooSparse coo_sparse = 4; + */ + org.tensorflow.proto.TensorInfo.CooSparseOrBuilder getCooSparseOrBuilder(); + + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return Whether the compositeTensor field is set. + */ + boolean hasCompositeTensor(); + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + * @return The compositeTensor. + */ + org.tensorflow.proto.TensorInfo.CompositeTensor getCompositeTensor(); + /** + *
    +   * Generic encoding for CompositeTensors.
    +   * 
    + * + * .tensorflow.TensorInfo.CompositeTensor composite_tensor = 5; + */ + org.tensorflow.proto.TensorInfo.CompositeTensorOrBuilder getCompositeTensorOrBuilder(); + + /** + * .tensorflow.DataType dtype = 2; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + * .tensorflow.DataType dtype = 2; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return Whether the tensorShape field is set. + */ + boolean hasTensorShape(); + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + * @return The tensorShape. + */ + org.tensorflow.proto.TensorShapeProto getTensorShape(); + /** + *
    +   * The static shape should be recorded here, to the extent that it can
    +   * be known in advance.  In the case of a SparseTensor, this field describes
    +   * the logical shape of the represented tensor (aka dense_shape).
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 3; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); + + org.tensorflow.proto.TensorInfo.EncodingCase getEncodingCase(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProto.java new file mode 100644 index 00000000000..16963543fb5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProto.java @@ -0,0 +1,4295 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing a tensor.
    + * 
    + * + * Protobuf type {@code tensorflow.TensorProto} + */ +public final class TensorProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorProto) + TensorProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorProto.class.getName()); + } + // Use TensorProto.newBuilder() to construct. + private TensorProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorProto() { + dtype_ = 0; + tensorContent_ = com.google.protobuf.ByteString.EMPTY; + halfVal_ = emptyIntList(); + floatVal_ = emptyFloatList(); + doubleVal_ = emptyDoubleList(); + intVal_ = emptyIntList(); + stringVal_ = emptyList(com.google.protobuf.ByteString.class); + scomplexVal_ = emptyFloatList(); + int64Val_ = emptyLongList(); + boolVal_ = emptyBooleanList(); + dcomplexVal_ = emptyDoubleList(); + resourceHandleVal_ = java.util.Collections.emptyList(); + variantVal_ = java.util.Collections.emptyList(); + uint32Val_ = emptyIntList(); + uint64Val_ = emptyLongList(); + float8Val_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorProto.class, org.tensorflow.proto.TensorProto.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + *
    +   * Data type of the tensor.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +   * Data type of the tensor.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto tensorShape_; + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + @java.lang.Override + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + + public static final int VERSION_NUMBER_FIELD_NUMBER = 3; + private int versionNumber_ = 0; + /** + *
    +   * Version number.
    +   *
    +   * In version 0, if the "repeated xxx" representations contain only one
    +   * element, that element is repeated to fill the shape.  This makes it easy
    +   * to represent a constant Tensor with a single value.
    +   * 
    + * + * int32 version_number = 3; + * @return The versionNumber. + */ + @java.lang.Override + public int getVersionNumber() { + return versionNumber_; + } + + public static final int TENSOR_CONTENT_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString tensorContent_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    +   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    +   * can be used for all tensor types. The purpose of this representation is to
    +   * reduce serialization overhead during RPC call by avoiding serialization of
    +   * many repeated small items.
    +   * 
    + * + * bytes tensor_content = 4; + * @return The tensorContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorContent() { + return tensorContent_; + } + + public static final int HALF_VAL_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList halfVal_ = + emptyIntList(); + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return A list containing the halfVal. + */ + @java.lang.Override + public java.util.List + getHalfValList() { + return halfVal_; + } + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return The count of halfVal. + */ + public int getHalfValCount() { + return halfVal_.size(); + } + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param index The index of the element to return. + * @return The halfVal at the given index. + */ + public int getHalfVal(int index) { + return halfVal_.getInt(index); + } + private int halfValMemoizedSerializedSize = -1; + + public static final int FLOAT_VAL_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList floatVal_ = + emptyFloatList(); + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return A list containing the floatVal. + */ + @java.lang.Override + public java.util.List + getFloatValList() { + return floatVal_; + } + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return The count of floatVal. + */ + public int getFloatValCount() { + return floatVal_.size(); + } + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + public float getFloatVal(int index) { + return floatVal_.getFloat(index); + } + private int floatValMemoizedSerializedSize = -1; + + public static final int DOUBLE_VAL_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList doubleVal_ = + emptyDoubleList(); + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return A list containing the doubleVal. + */ + @java.lang.Override + public java.util.List + getDoubleValList() { + return doubleVal_; + } + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return The count of doubleVal. + */ + public int getDoubleValCount() { + return doubleVal_.size(); + } + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + public double getDoubleVal(int index) { + return doubleVal_.getDouble(index); + } + private int doubleValMemoizedSerializedSize = -1; + + public static final int INT_VAL_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList intVal_ = + emptyIntList(); + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return A list containing the intVal. + */ + @java.lang.Override + public java.util.List + getIntValList() { + return intVal_; + } + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return The count of intVal. + */ + public int getIntValCount() { + return intVal_.size(); + } + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + public int getIntVal(int index) { + return intVal_.getInt(index); + } + private int intValMemoizedSerializedSize = -1; + + public static final int STRING_VAL_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList stringVal_ = + emptyList(com.google.protobuf.ByteString.class); + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @return A list containing the stringVal. + */ + @java.lang.Override + public java.util.List + getStringValList() { + return stringVal_; + } + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @return The count of stringVal. + */ + public int getStringValCount() { + return stringVal_.size(); + } + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + public com.google.protobuf.ByteString getStringVal(int index) { + return stringVal_.get(index); + } + + public static final int SCOMPLEX_VAL_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList scomplexVal_ = + emptyFloatList(); + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return A list containing the scomplexVal. + */ + @java.lang.Override + public java.util.List + getScomplexValList() { + return scomplexVal_; + } + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return The count of scomplexVal. + */ + public int getScomplexValCount() { + return scomplexVal_.size(); + } + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param index The index of the element to return. + * @return The scomplexVal at the given index. + */ + public float getScomplexVal(int index) { + return scomplexVal_.getFloat(index); + } + private int scomplexValMemoizedSerializedSize = -1; + + public static final int INT64_VAL_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList int64Val_ = + emptyLongList(); + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return A list containing the int64Val. + */ + @java.lang.Override + public java.util.List + getInt64ValList() { + return int64Val_; + } + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return The count of int64Val. + */ + public int getInt64ValCount() { + return int64Val_.size(); + } + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + public long getInt64Val(int index) { + return int64Val_.getLong(index); + } + private int int64ValMemoizedSerializedSize = -1; + + public static final int BOOL_VAL_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.BooleanList boolVal_ = + emptyBooleanList(); + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return A list containing the boolVal. + */ + @java.lang.Override + public java.util.List + getBoolValList() { + return boolVal_; + } + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return The count of boolVal. + */ + public int getBoolValCount() { + return boolVal_.size(); + } + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + public boolean getBoolVal(int index) { + return boolVal_.getBoolean(index); + } + private int boolValMemoizedSerializedSize = -1; + + public static final int DCOMPLEX_VAL_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList dcomplexVal_ = + emptyDoubleList(); + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return A list containing the dcomplexVal. + */ + @java.lang.Override + public java.util.List + getDcomplexValList() { + return dcomplexVal_; + } + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return The count of dcomplexVal. + */ + public int getDcomplexValCount() { + return dcomplexVal_.size(); + } + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param index The index of the element to return. + * @return The dcomplexVal at the given index. + */ + public double getDcomplexVal(int index) { + return dcomplexVal_.getDouble(index); + } + private int dcomplexValMemoizedSerializedSize = -1; + + public static final int RESOURCE_HANDLE_VAL_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private java.util.List resourceHandleVal_; + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + @java.lang.Override + public java.util.List getResourceHandleValList() { + return resourceHandleVal_; + } + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + @java.lang.Override + public java.util.List + getResourceHandleValOrBuilderList() { + return resourceHandleVal_; + } + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + @java.lang.Override + public int getResourceHandleValCount() { + return resourceHandleVal_.size(); + } + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProto getResourceHandleVal(int index) { + return resourceHandleVal_.get(index); + } + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + @java.lang.Override + public org.tensorflow.proto.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( + int index) { + return resourceHandleVal_.get(index); + } + + public static final int VARIANT_VAL_FIELD_NUMBER = 15; + @SuppressWarnings("serial") + private java.util.List variantVal_; + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + @java.lang.Override + public java.util.List getVariantValList() { + return variantVal_; + } + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + @java.lang.Override + public java.util.List + getVariantValOrBuilderList() { + return variantVal_; + } + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + @java.lang.Override + public int getVariantValCount() { + return variantVal_.size(); + } + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + @java.lang.Override + public org.tensorflow.proto.VariantTensorDataProto getVariantVal(int index) { + return variantVal_.get(index); + } + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + @java.lang.Override + public org.tensorflow.proto.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( + int index) { + return variantVal_.get(index); + } + + public static final int UINT32_VAL_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList uint32Val_ = + emptyIntList(); + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return A list containing the uint32Val. + */ + @java.lang.Override + public java.util.List + getUint32ValList() { + return uint32Val_; + } + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return The count of uint32Val. + */ + public int getUint32ValCount() { + return uint32Val_.size(); + } + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param index The index of the element to return. + * @return The uint32Val at the given index. + */ + public int getUint32Val(int index) { + return uint32Val_.getInt(index); + } + private int uint32ValMemoizedSerializedSize = -1; + + public static final int UINT64_VAL_FIELD_NUMBER = 17; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList uint64Val_ = + emptyLongList(); + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return A list containing the uint64Val. + */ + @java.lang.Override + public java.util.List + getUint64ValList() { + return uint64Val_; + } + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return The count of uint64Val. + */ + public int getUint64ValCount() { + return uint64Val_.size(); + } + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + public long getUint64Val(int index) { + return uint64Val_.getLong(index); + } + private int uint64ValMemoizedSerializedSize = -1; + + public static final int FLOAT8_VAL_FIELD_NUMBER = 18; + private com.google.protobuf.ByteString float8Val_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * DT_FLOAT8_*, use variable-sized set of bytes
    +   * (i.e. the equivalent of repeated uint8, if such a thing existed).
    +   * 
    + * + * bytes float8_val = 18; + * @return The float8Val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFloat8Val() { + return float8Val_; + } + + 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 { + getSerializedSize(); + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTensorShape()); + } + if (versionNumber_ != 0) { + output.writeInt32(3, versionNumber_); + } + if (!tensorContent_.isEmpty()) { + output.writeBytes(4, tensorContent_); + } + if (getFloatValList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(floatValMemoizedSerializedSize); + } + for (int i = 0; i < floatVal_.size(); i++) { + output.writeFloatNoTag(floatVal_.getFloat(i)); + } + if (getDoubleValList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(doubleValMemoizedSerializedSize); + } + for (int i = 0; i < doubleVal_.size(); i++) { + output.writeDoubleNoTag(doubleVal_.getDouble(i)); + } + if (getIntValList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(intValMemoizedSerializedSize); + } + for (int i = 0; i < intVal_.size(); i++) { + output.writeInt32NoTag(intVal_.getInt(i)); + } + for (int i = 0; i < stringVal_.size(); i++) { + output.writeBytes(8, stringVal_.get(i)); + } + if (getScomplexValList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(scomplexValMemoizedSerializedSize); + } + for (int i = 0; i < scomplexVal_.size(); i++) { + output.writeFloatNoTag(scomplexVal_.getFloat(i)); + } + if (getInt64ValList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(int64ValMemoizedSerializedSize); + } + for (int i = 0; i < int64Val_.size(); i++) { + output.writeInt64NoTag(int64Val_.getLong(i)); + } + if (getBoolValList().size() > 0) { + output.writeUInt32NoTag(90); + output.writeUInt32NoTag(boolValMemoizedSerializedSize); + } + for (int i = 0; i < boolVal_.size(); i++) { + output.writeBoolNoTag(boolVal_.getBoolean(i)); + } + if (getDcomplexValList().size() > 0) { + output.writeUInt32NoTag(98); + output.writeUInt32NoTag(dcomplexValMemoizedSerializedSize); + } + for (int i = 0; i < dcomplexVal_.size(); i++) { + output.writeDoubleNoTag(dcomplexVal_.getDouble(i)); + } + if (getHalfValList().size() > 0) { + output.writeUInt32NoTag(106); + output.writeUInt32NoTag(halfValMemoizedSerializedSize); + } + for (int i = 0; i < halfVal_.size(); i++) { + output.writeInt32NoTag(halfVal_.getInt(i)); + } + for (int i = 0; i < resourceHandleVal_.size(); i++) { + output.writeMessage(14, resourceHandleVal_.get(i)); + } + for (int i = 0; i < variantVal_.size(); i++) { + output.writeMessage(15, variantVal_.get(i)); + } + if (getUint32ValList().size() > 0) { + output.writeUInt32NoTag(130); + output.writeUInt32NoTag(uint32ValMemoizedSerializedSize); + } + for (int i = 0; i < uint32Val_.size(); i++) { + output.writeUInt32NoTag(uint32Val_.getInt(i)); + } + if (getUint64ValList().size() > 0) { + output.writeUInt32NoTag(138); + output.writeUInt32NoTag(uint64ValMemoizedSerializedSize); + } + for (int i = 0; i < uint64Val_.size(); i++) { + output.writeUInt64NoTag(uint64Val_.getLong(i)); + } + if (!float8Val_.isEmpty()) { + output.writeBytes(18, float8Val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTensorShape()); + } + if (versionNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, versionNumber_); + } + if (!tensorContent_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, tensorContent_); + } + { + int dataSize = 0; + dataSize = 4 * getFloatValList().size(); + size += dataSize; + if (!getFloatValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + floatValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getDoubleValList().size(); + size += dataSize; + if (!getDoubleValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + doubleValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < intVal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(intVal_.getInt(i)); + } + size += dataSize; + if (!getIntValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + intValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < stringVal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(stringVal_.get(i)); + } + size += dataSize; + size += 1 * getStringValList().size(); + } + { + int dataSize = 0; + dataSize = 4 * getScomplexValList().size(); + size += dataSize; + if (!getScomplexValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + scomplexValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < int64Val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(int64Val_.getLong(i)); + } + size += dataSize; + if (!getInt64ValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + int64ValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 1 * getBoolValList().size(); + size += dataSize; + if (!getBoolValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + boolValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getDcomplexValList().size(); + size += dataSize; + if (!getDcomplexValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + dcomplexValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < halfVal_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(halfVal_.getInt(i)); + } + size += dataSize; + if (!getHalfValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + halfValMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < resourceHandleVal_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, resourceHandleVal_.get(i)); + } + for (int i = 0; i < variantVal_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, variantVal_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < uint32Val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(uint32Val_.getInt(i)); + } + size += dataSize; + if (!getUint32ValList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + uint32ValMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < uint64Val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(uint64Val_.getLong(i)); + } + size += dataSize; + if (!getUint64ValList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + uint64ValMemoizedSerializedSize = dataSize; + } + if (!float8Val_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(18, float8Val_); + } + size += getUnknownFields().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.TensorProto)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorProto other = (org.tensorflow.proto.TensorProto) obj; + + if (dtype_ != other.dtype_) return false; + if (hasTensorShape() != other.hasTensorShape()) return false; + if (hasTensorShape()) { + if (!getTensorShape() + .equals(other.getTensorShape())) return false; + } + if (getVersionNumber() + != other.getVersionNumber()) return false; + if (!getTensorContent() + .equals(other.getTensorContent())) return false; + if (!getHalfValList() + .equals(other.getHalfValList())) return false; + if (!getFloatValList() + .equals(other.getFloatValList())) return false; + if (!getDoubleValList() + .equals(other.getDoubleValList())) return false; + if (!getIntValList() + .equals(other.getIntValList())) return false; + if (!getStringValList() + .equals(other.getStringValList())) return false; + if (!getScomplexValList() + .equals(other.getScomplexValList())) return false; + if (!getInt64ValList() + .equals(other.getInt64ValList())) return false; + if (!getBoolValList() + .equals(other.getBoolValList())) return false; + if (!getDcomplexValList() + .equals(other.getDcomplexValList())) return false; + if (!getResourceHandleValList() + .equals(other.getResourceHandleValList())) return false; + if (!getVariantValList() + .equals(other.getVariantValList())) return false; + if (!getUint32ValList() + .equals(other.getUint32ValList())) return false; + if (!getUint64ValList() + .equals(other.getUint64ValList())) return false; + if (!getFloat8Val() + .equals(other.getFloat8Val())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasTensorShape()) { + hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getTensorShape().hashCode(); + } + hash = (37 * hash) + VERSION_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getVersionNumber(); + hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getTensorContent().hashCode(); + if (getHalfValCount() > 0) { + hash = (37 * hash) + HALF_VAL_FIELD_NUMBER; + hash = (53 * hash) + getHalfValList().hashCode(); + } + if (getFloatValCount() > 0) { + hash = (37 * hash) + FLOAT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getFloatValList().hashCode(); + } + if (getDoubleValCount() > 0) { + hash = (37 * hash) + DOUBLE_VAL_FIELD_NUMBER; + hash = (53 * hash) + getDoubleValList().hashCode(); + } + if (getIntValCount() > 0) { + hash = (37 * hash) + INT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getIntValList().hashCode(); + } + if (getStringValCount() > 0) { + hash = (37 * hash) + STRING_VAL_FIELD_NUMBER; + hash = (53 * hash) + getStringValList().hashCode(); + } + if (getScomplexValCount() > 0) { + hash = (37 * hash) + SCOMPLEX_VAL_FIELD_NUMBER; + hash = (53 * hash) + getScomplexValList().hashCode(); + } + if (getInt64ValCount() > 0) { + hash = (37 * hash) + INT64_VAL_FIELD_NUMBER; + hash = (53 * hash) + getInt64ValList().hashCode(); + } + if (getBoolValCount() > 0) { + hash = (37 * hash) + BOOL_VAL_FIELD_NUMBER; + hash = (53 * hash) + getBoolValList().hashCode(); + } + if (getDcomplexValCount() > 0) { + hash = (37 * hash) + DCOMPLEX_VAL_FIELD_NUMBER; + hash = (53 * hash) + getDcomplexValList().hashCode(); + } + if (getResourceHandleValCount() > 0) { + hash = (37 * hash) + RESOURCE_HANDLE_VAL_FIELD_NUMBER; + hash = (53 * hash) + getResourceHandleValList().hashCode(); + } + if (getVariantValCount() > 0) { + hash = (37 * hash) + VARIANT_VAL_FIELD_NUMBER; + hash = (53 * hash) + getVariantValList().hashCode(); + } + if (getUint32ValCount() > 0) { + hash = (37 * hash) + UINT32_VAL_FIELD_NUMBER; + hash = (53 * hash) + getUint32ValList().hashCode(); + } + if (getUint64ValCount() > 0) { + hash = (37 * hash) + UINT64_VAL_FIELD_NUMBER; + hash = (53 * hash) + getUint64ValList().hashCode(); + } + hash = (37 * hash) + FLOAT8_VAL_FIELD_NUMBER; + hash = (53 * hash) + getFloat8Val().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorProto 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.TensorProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorProto 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.TensorProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a tensor.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorProto) + org.tensorflow.proto.TensorProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_TensorProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorProto.class, org.tensorflow.proto.TensorProto.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorShapeFieldBuilder(); + getResourceHandleValFieldBuilder(); + getVariantValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + versionNumber_ = 0; + tensorContent_ = com.google.protobuf.ByteString.EMPTY; + halfVal_ = emptyIntList(); + floatVal_ = emptyFloatList(); + doubleVal_ = emptyDoubleList(); + intVal_ = emptyIntList(); + stringVal_ = emptyList(com.google.protobuf.ByteString.class); + scomplexVal_ = emptyFloatList(); + int64Val_ = emptyLongList(); + boolVal_ = emptyBooleanList(); + dcomplexVal_ = emptyDoubleList(); + if (resourceHandleValBuilder_ == null) { + resourceHandleVal_ = java.util.Collections.emptyList(); + } else { + resourceHandleVal_ = null; + resourceHandleValBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + if (variantValBuilder_ == null) { + variantVal_ = java.util.Collections.emptyList(); + } else { + variantVal_ = null; + variantValBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + uint32Val_ = emptyIntList(); + uint64Val_ = emptyLongList(); + float8Val_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_TensorProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorProto getDefaultInstanceForType() { + return org.tensorflow.proto.TensorProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorProto build() { + org.tensorflow.proto.TensorProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorProto buildPartial() { + org.tensorflow.proto.TensorProto result = new org.tensorflow.proto.TensorProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TensorProto result) { + if (resourceHandleValBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + resourceHandleVal_ = java.util.Collections.unmodifiableList(resourceHandleVal_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.resourceHandleVal_ = resourceHandleVal_; + } else { + result.resourceHandleVal_ = resourceHandleValBuilder_.build(); + } + if (variantValBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + variantVal_ = java.util.Collections.unmodifiableList(variantVal_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.variantVal_ = variantVal_; + } else { + result.variantVal_ = variantValBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TensorProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tensorShape_ = tensorShapeBuilder_ == null + ? tensorShape_ + : tensorShapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.versionNumber_ = versionNumber_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tensorContent_ = tensorContent_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + halfVal_.makeImmutable(); + result.halfVal_ = halfVal_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + floatVal_.makeImmutable(); + result.floatVal_ = floatVal_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + doubleVal_.makeImmutable(); + result.doubleVal_ = doubleVal_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + intVal_.makeImmutable(); + result.intVal_ = intVal_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + stringVal_.makeImmutable(); + result.stringVal_ = stringVal_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + scomplexVal_.makeImmutable(); + result.scomplexVal_ = scomplexVal_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + int64Val_.makeImmutable(); + result.int64Val_ = int64Val_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + boolVal_.makeImmutable(); + result.boolVal_ = boolVal_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + dcomplexVal_.makeImmutable(); + result.dcomplexVal_ = dcomplexVal_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + uint32Val_.makeImmutable(); + result.uint32Val_ = uint32Val_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + uint64Val_.makeImmutable(); + result.uint64Val_ = uint64Val_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.float8Val_ = float8Val_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorProto) { + return mergeFrom((org.tensorflow.proto.TensorProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorProto other) { + if (other == org.tensorflow.proto.TensorProto.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasTensorShape()) { + mergeTensorShape(other.getTensorShape()); + } + if (other.getVersionNumber() != 0) { + setVersionNumber(other.getVersionNumber()); + } + if (other.getTensorContent() != com.google.protobuf.ByteString.EMPTY) { + setTensorContent(other.getTensorContent()); + } + if (!other.halfVal_.isEmpty()) { + if (halfVal_.isEmpty()) { + halfVal_ = other.halfVal_; + halfVal_.makeImmutable(); + bitField0_ |= 0x00000010; + } else { + ensureHalfValIsMutable(); + halfVal_.addAll(other.halfVal_); + } + onChanged(); + } + if (!other.floatVal_.isEmpty()) { + if (floatVal_.isEmpty()) { + floatVal_ = other.floatVal_; + floatVal_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureFloatValIsMutable(); + floatVal_.addAll(other.floatVal_); + } + onChanged(); + } + if (!other.doubleVal_.isEmpty()) { + if (doubleVal_.isEmpty()) { + doubleVal_ = other.doubleVal_; + doubleVal_.makeImmutable(); + bitField0_ |= 0x00000040; + } else { + ensureDoubleValIsMutable(); + doubleVal_.addAll(other.doubleVal_); + } + onChanged(); + } + if (!other.intVal_.isEmpty()) { + if (intVal_.isEmpty()) { + intVal_ = other.intVal_; + intVal_.makeImmutable(); + bitField0_ |= 0x00000080; + } else { + ensureIntValIsMutable(); + intVal_.addAll(other.intVal_); + } + onChanged(); + } + if (!other.stringVal_.isEmpty()) { + if (stringVal_.isEmpty()) { + stringVal_ = other.stringVal_; + stringVal_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureStringValIsMutable(); + stringVal_.addAll(other.stringVal_); + } + onChanged(); + } + if (!other.scomplexVal_.isEmpty()) { + if (scomplexVal_.isEmpty()) { + scomplexVal_ = other.scomplexVal_; + scomplexVal_.makeImmutable(); + bitField0_ |= 0x00000200; + } else { + ensureScomplexValIsMutable(); + scomplexVal_.addAll(other.scomplexVal_); + } + onChanged(); + } + if (!other.int64Val_.isEmpty()) { + if (int64Val_.isEmpty()) { + int64Val_ = other.int64Val_; + int64Val_.makeImmutable(); + bitField0_ |= 0x00000400; + } else { + ensureInt64ValIsMutable(); + int64Val_.addAll(other.int64Val_); + } + onChanged(); + } + if (!other.boolVal_.isEmpty()) { + if (boolVal_.isEmpty()) { + boolVal_ = other.boolVal_; + boolVal_.makeImmutable(); + bitField0_ |= 0x00000800; + } else { + ensureBoolValIsMutable(); + boolVal_.addAll(other.boolVal_); + } + onChanged(); + } + if (!other.dcomplexVal_.isEmpty()) { + if (dcomplexVal_.isEmpty()) { + dcomplexVal_ = other.dcomplexVal_; + dcomplexVal_.makeImmutable(); + bitField0_ |= 0x00001000; + } else { + ensureDcomplexValIsMutable(); + dcomplexVal_.addAll(other.dcomplexVal_); + } + onChanged(); + } + if (resourceHandleValBuilder_ == null) { + if (!other.resourceHandleVal_.isEmpty()) { + if (resourceHandleVal_.isEmpty()) { + resourceHandleVal_ = other.resourceHandleVal_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.addAll(other.resourceHandleVal_); + } + onChanged(); + } + } else { + if (!other.resourceHandleVal_.isEmpty()) { + if (resourceHandleValBuilder_.isEmpty()) { + resourceHandleValBuilder_.dispose(); + resourceHandleValBuilder_ = null; + resourceHandleVal_ = other.resourceHandleVal_; + bitField0_ = (bitField0_ & ~0x00002000); + resourceHandleValBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getResourceHandleValFieldBuilder() : null; + } else { + resourceHandleValBuilder_.addAllMessages(other.resourceHandleVal_); + } + } + } + if (variantValBuilder_ == null) { + if (!other.variantVal_.isEmpty()) { + if (variantVal_.isEmpty()) { + variantVal_ = other.variantVal_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureVariantValIsMutable(); + variantVal_.addAll(other.variantVal_); + } + onChanged(); + } + } else { + if (!other.variantVal_.isEmpty()) { + if (variantValBuilder_.isEmpty()) { + variantValBuilder_.dispose(); + variantValBuilder_ = null; + variantVal_ = other.variantVal_; + bitField0_ = (bitField0_ & ~0x00004000); + variantValBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getVariantValFieldBuilder() : null; + } else { + variantValBuilder_.addAllMessages(other.variantVal_); + } + } + } + if (!other.uint32Val_.isEmpty()) { + if (uint32Val_.isEmpty()) { + uint32Val_ = other.uint32Val_; + uint32Val_.makeImmutable(); + bitField0_ |= 0x00008000; + } else { + ensureUint32ValIsMutable(); + uint32Val_.addAll(other.uint32Val_); + } + onChanged(); + } + if (!other.uint64Val_.isEmpty()) { + if (uint64Val_.isEmpty()) { + uint64Val_ = other.uint64Val_; + uint64Val_.makeImmutable(); + bitField0_ |= 0x00010000; + } else { + ensureUint64ValIsMutable(); + uint64Val_.addAll(other.uint64Val_); + } + onChanged(); + } + if (other.getFloat8Val() != com.google.protobuf.ByteString.EMPTY) { + setFloat8Val(other.getFloat8Val()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getTensorShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + versionNumber_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + tensorContent_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 45: { + float v = input.readFloat(); + ensureFloatValIsMutable(); + floatVal_.addFloat(v); + break; + } // case 45 + case 42: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureFloatValIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + floatVal_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 42 + case 49: { + double v = input.readDouble(); + ensureDoubleValIsMutable(); + doubleVal_.addDouble(v); + break; + } // case 49 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureDoubleValIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + doubleVal_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 50 + case 56: { + int v = input.readInt32(); + ensureIntValIsMutable(); + intVal_.addInt(v); + break; + } // case 56 + case 58: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureIntValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + intVal_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 58 + case 66: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureStringValIsMutable(); + stringVal_.add(v); + break; + } // case 66 + case 77: { + float v = input.readFloat(); + ensureScomplexValIsMutable(); + scomplexVal_.addFloat(v); + break; + } // case 77 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureScomplexValIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + scomplexVal_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 74 + case 80: { + long v = input.readInt64(); + ensureInt64ValIsMutable(); + int64Val_.addLong(v); + break; + } // case 80 + case 82: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInt64ValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + int64Val_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 82 + case 88: { + boolean v = input.readBool(); + ensureBoolValIsMutable(); + boolVal_.addBoolean(v); + break; + } // case 88 + case 90: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureBoolValIsMutable(alloc / 1); + while (input.getBytesUntilLimit() > 0) { + boolVal_.addBoolean(input.readBool()); + } + input.popLimit(limit); + break; + } // case 90 + case 97: { + double v = input.readDouble(); + ensureDcomplexValIsMutable(); + dcomplexVal_.addDouble(v); + break; + } // case 97 + case 98: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureDcomplexValIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + dcomplexVal_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 98 + case 104: { + int v = input.readInt32(); + ensureHalfValIsMutable(); + halfVal_.addInt(v); + break; + } // case 104 + case 106: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureHalfValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + halfVal_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 106 + case 114: { + org.tensorflow.proto.ResourceHandleProto m = + input.readMessage( + org.tensorflow.proto.ResourceHandleProto.parser(), + extensionRegistry); + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.add(m); + } else { + resourceHandleValBuilder_.addMessage(m); + } + break; + } // case 114 + case 122: { + org.tensorflow.proto.VariantTensorDataProto m = + input.readMessage( + org.tensorflow.proto.VariantTensorDataProto.parser(), + extensionRegistry); + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + variantVal_.add(m); + } else { + variantValBuilder_.addMessage(m); + } + break; + } // case 122 + case 128: { + int v = input.readUInt32(); + ensureUint32ValIsMutable(); + uint32Val_.addInt(v); + break; + } // case 128 + case 130: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureUint32ValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + uint32Val_.addInt(input.readUInt32()); + } + input.popLimit(limit); + break; + } // case 130 + case 136: { + long v = input.readUInt64(); + ensureUint64ValIsMutable(); + uint64Val_.addLong(v); + break; + } // case 136 + case 138: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureUint64ValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + uint64Val_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 138 + case 146: { + float8Val_ = input.readBytes(); + bitField0_ |= 0x00020000; + break; + } // case 146 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Data type of the tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto tensorShape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> tensorShapeBuilder_; + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + if (tensorShapeBuilder_ == null) { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } else { + return tensorShapeBuilder_.getMessage(); + } + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorShape_ = value; + } else { + tensorShapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (tensorShapeBuilder_ == null) { + tensorShape_ = builderForValue.build(); + } else { + tensorShapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder mergeTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + tensorShape_ != null && + tensorShape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getTensorShapeBuilder().mergeFrom(value); + } else { + tensorShape_ = value; + } + } else { + tensorShapeBuilder_.mergeFrom(value); + } + if (tensorShape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder clearTensorShape() { + bitField0_ = (bitField0_ & ~0x00000002); + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getTensorShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTensorShapeFieldBuilder().getBuilder(); + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + if (tensorShapeBuilder_ != null) { + return tensorShapeBuilder_.getMessageOrBuilder(); + } else { + return tensorShape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + } + /** + *
    +     * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getTensorShapeFieldBuilder() { + if (tensorShapeBuilder_ == null) { + tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getTensorShape(), + getParentForChildren(), + isClean()); + tensorShape_ = null; + } + return tensorShapeBuilder_; + } + + private int versionNumber_ ; + /** + *
    +     * Version number.
    +     *
    +     * In version 0, if the "repeated xxx" representations contain only one
    +     * element, that element is repeated to fill the shape.  This makes it easy
    +     * to represent a constant Tensor with a single value.
    +     * 
    + * + * int32 version_number = 3; + * @return The versionNumber. + */ + @java.lang.Override + public int getVersionNumber() { + return versionNumber_; + } + /** + *
    +     * Version number.
    +     *
    +     * In version 0, if the "repeated xxx" representations contain only one
    +     * element, that element is repeated to fill the shape.  This makes it easy
    +     * to represent a constant Tensor with a single value.
    +     * 
    + * + * int32 version_number = 3; + * @param value The versionNumber to set. + * @return This builder for chaining. + */ + public Builder setVersionNumber(int value) { + + versionNumber_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Version number.
    +     *
    +     * In version 0, if the "repeated xxx" representations contain only one
    +     * element, that element is repeated to fill the shape.  This makes it easy
    +     * to represent a constant Tensor with a single value.
    +     * 
    + * + * int32 version_number = 3; + * @return This builder for chaining. + */ + public Builder clearVersionNumber() { + bitField0_ = (bitField0_ & ~0x00000004); + versionNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString tensorContent_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    +     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    +     * can be used for all tensor types. The purpose of this representation is to
    +     * reduce serialization overhead during RPC call by avoiding serialization of
    +     * many repeated small items.
    +     * 
    + * + * bytes tensor_content = 4; + * @return The tensorContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTensorContent() { + return tensorContent_; + } + /** + *
    +     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    +     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    +     * can be used for all tensor types. The purpose of this representation is to
    +     * reduce serialization overhead during RPC call by avoiding serialization of
    +     * many repeated small items.
    +     * 
    + * + * bytes tensor_content = 4; + * @param value The tensorContent to set. + * @return This builder for chaining. + */ + public Builder setTensorContent(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + tensorContent_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    +     * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    +     * can be used for all tensor types. The purpose of this representation is to
    +     * reduce serialization overhead during RPC call by avoiding serialization of
    +     * many repeated small items.
    +     * 
    + * + * bytes tensor_content = 4; + * @return This builder for chaining. + */ + public Builder clearTensorContent() { + bitField0_ = (bitField0_ & ~0x00000008); + tensorContent_ = getDefaultInstance().getTensorContent(); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList halfVal_ = emptyIntList(); + private void ensureHalfValIsMutable() { + if (!halfVal_.isModifiable()) { + halfVal_ = makeMutableCopy(halfVal_); + } + bitField0_ |= 0x00000010; + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return A list containing the halfVal. + */ + public java.util.List + getHalfValList() { + halfVal_.makeImmutable(); + return halfVal_; + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return The count of halfVal. + */ + public int getHalfValCount() { + return halfVal_.size(); + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param index The index of the element to return. + * @return The halfVal at the given index. + */ + public int getHalfVal(int index) { + return halfVal_.getInt(index); + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param index The index to set the value at. + * @param value The halfVal to set. + * @return This builder for chaining. + */ + public Builder setHalfVal( + int index, int value) { + + ensureHalfValIsMutable(); + halfVal_.setInt(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param value The halfVal to add. + * @return This builder for chaining. + */ + public Builder addHalfVal(int value) { + + ensureHalfValIsMutable(); + halfVal_.addInt(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param values The halfVal to add. + * @return This builder for chaining. + */ + public Builder addAllHalfVal( + java.lang.Iterable values) { + ensureHalfValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, halfVal_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +     * have some pointless zero padding for each value here.
    +     * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearHalfVal() { + halfVal_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList floatVal_ = emptyFloatList(); + private void ensureFloatValIsMutable() { + if (!floatVal_.isModifiable()) { + floatVal_ = makeMutableCopy(floatVal_); + } + bitField0_ |= 0x00000020; + } + private void ensureFloatValIsMutable(int capacity) { + if (!floatVal_.isModifiable()) { + floatVal_ = makeMutableCopy(floatVal_, capacity); + } + bitField0_ |= 0x00000020; + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return A list containing the floatVal. + */ + public java.util.List + getFloatValList() { + floatVal_.makeImmutable(); + return floatVal_; + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return The count of floatVal. + */ + public int getFloatValCount() { + return floatVal_.size(); + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + public float getFloatVal(int index) { + return floatVal_.getFloat(index); + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param index The index to set the value at. + * @param value The floatVal to set. + * @return This builder for chaining. + */ + public Builder setFloatVal( + int index, float value) { + + ensureFloatValIsMutable(); + floatVal_.setFloat(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param value The floatVal to add. + * @return This builder for chaining. + */ + public Builder addFloatVal(float value) { + + ensureFloatValIsMutable(); + floatVal_.addFloat(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param values The floatVal to add. + * @return This builder for chaining. + */ + public Builder addAllFloatVal( + java.lang.Iterable values) { + ensureFloatValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, floatVal_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * DT_FLOAT.
    +     * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearFloatVal() { + floatVal_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList doubleVal_ = emptyDoubleList(); + private void ensureDoubleValIsMutable() { + if (!doubleVal_.isModifiable()) { + doubleVal_ = makeMutableCopy(doubleVal_); + } + bitField0_ |= 0x00000040; + } + private void ensureDoubleValIsMutable(int capacity) { + if (!doubleVal_.isModifiable()) { + doubleVal_ = makeMutableCopy(doubleVal_, capacity); + } + bitField0_ |= 0x00000040; + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return A list containing the doubleVal. + */ + public java.util.List + getDoubleValList() { + doubleVal_.makeImmutable(); + return doubleVal_; + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return The count of doubleVal. + */ + public int getDoubleValCount() { + return doubleVal_.size(); + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + public double getDoubleVal(int index) { + return doubleVal_.getDouble(index); + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param index The index to set the value at. + * @param value The doubleVal to set. + * @return This builder for chaining. + */ + public Builder setDoubleVal( + int index, double value) { + + ensureDoubleValIsMutable(); + doubleVal_.setDouble(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param value The doubleVal to add. + * @return This builder for chaining. + */ + public Builder addDoubleVal(double value) { + + ensureDoubleValIsMutable(); + doubleVal_.addDouble(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param values The doubleVal to add. + * @return This builder for chaining. + */ + public Builder addAllDoubleVal( + java.lang.Iterable values) { + ensureDoubleValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, doubleVal_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * DT_DOUBLE.
    +     * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearDoubleVal() { + doubleVal_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList intVal_ = emptyIntList(); + private void ensureIntValIsMutable() { + if (!intVal_.isModifiable()) { + intVal_ = makeMutableCopy(intVal_); + } + bitField0_ |= 0x00000080; + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return A list containing the intVal. + */ + public java.util.List + getIntValList() { + intVal_.makeImmutable(); + return intVal_; + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return The count of intVal. + */ + public int getIntValCount() { + return intVal_.size(); + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + public int getIntVal(int index) { + return intVal_.getInt(index); + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param index The index to set the value at. + * @param value The intVal to set. + * @return This builder for chaining. + */ + public Builder setIntVal( + int index, int value) { + + ensureIntValIsMutable(); + intVal_.setInt(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param value The intVal to add. + * @return This builder for chaining. + */ + public Builder addIntVal(int value) { + + ensureIntValIsMutable(); + intVal_.addInt(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param values The intVal to add. + * @return This builder for chaining. + */ + public Builder addAllIntVal( + java.lang.Iterable values) { + ensureIntValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, intVal_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +     * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearIntVal() { + intVal_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.ProtobufList stringVal_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureStringValIsMutable() { + if (!stringVal_.isModifiable()) { + stringVal_ = makeMutableCopy(stringVal_); + } + bitField0_ |= 0x00000100; + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @return A list containing the stringVal. + */ + public java.util.List + getStringValList() { + stringVal_.makeImmutable(); + return stringVal_; + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @return The count of stringVal. + */ + public int getStringValCount() { + return stringVal_.size(); + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + public com.google.protobuf.ByteString getStringVal(int index) { + return stringVal_.get(index); + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @param index The index to set the value at. + * @param value The stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringVal( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureStringValIsMutable(); + stringVal_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @param value The stringVal to add. + * @return This builder for chaining. + */ + public Builder addStringVal(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureStringValIsMutable(); + stringVal_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @param values The stringVal to add. + * @return This builder for chaining. + */ + public Builder addAllStringVal( + java.lang.Iterable values) { + ensureStringValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, stringVal_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * DT_STRING
    +     * 
    + * + * repeated bytes string_val = 8; + * @return This builder for chaining. + */ + public Builder clearStringVal() { + stringVal_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.FloatList scomplexVal_ = emptyFloatList(); + private void ensureScomplexValIsMutable() { + if (!scomplexVal_.isModifiable()) { + scomplexVal_ = makeMutableCopy(scomplexVal_); + } + bitField0_ |= 0x00000200; + } + private void ensureScomplexValIsMutable(int capacity) { + if (!scomplexVal_.isModifiable()) { + scomplexVal_ = makeMutableCopy(scomplexVal_, capacity); + } + bitField0_ |= 0x00000200; + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return A list containing the scomplexVal. + */ + public java.util.List + getScomplexValList() { + scomplexVal_.makeImmutable(); + return scomplexVal_; + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return The count of scomplexVal. + */ + public int getScomplexValCount() { + return scomplexVal_.size(); + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param index The index of the element to return. + * @return The scomplexVal at the given index. + */ + public float getScomplexVal(int index) { + return scomplexVal_.getFloat(index); + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param index The index to set the value at. + * @param value The scomplexVal to set. + * @return This builder for chaining. + */ + public Builder setScomplexVal( + int index, float value) { + + ensureScomplexValIsMutable(); + scomplexVal_.setFloat(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param value The scomplexVal to add. + * @return This builder for chaining. + */ + public Builder addScomplexVal(float value) { + + ensureScomplexValIsMutable(); + scomplexVal_.addFloat(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param values The scomplexVal to add. + * @return This builder for chaining. + */ + public Builder addAllScomplexVal( + java.lang.Iterable values) { + ensureScomplexValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, scomplexVal_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th single precision complex.
    +     * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearScomplexVal() { + scomplexVal_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList int64Val_ = emptyLongList(); + private void ensureInt64ValIsMutable() { + if (!int64Val_.isModifiable()) { + int64Val_ = makeMutableCopy(int64Val_); + } + bitField0_ |= 0x00000400; + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return A list containing the int64Val. + */ + public java.util.List + getInt64ValList() { + int64Val_.makeImmutable(); + return int64Val_; + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return The count of int64Val. + */ + public int getInt64ValCount() { + return int64Val_.size(); + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + public long getInt64Val(int index) { + return int64Val_.getLong(index); + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param index The index to set the value at. + * @param value The int64Val to set. + * @return This builder for chaining. + */ + public Builder setInt64Val( + int index, long value) { + + ensureInt64ValIsMutable(); + int64Val_.setLong(index, value); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param value The int64Val to add. + * @return This builder for chaining. + */ + public Builder addInt64Val(long value) { + + ensureInt64ValIsMutable(); + int64Val_.addLong(value); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param values The int64Val to add. + * @return This builder for chaining. + */ + public Builder addAllInt64Val( + java.lang.Iterable values) { + ensureInt64ValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, int64Val_); + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * DT_INT64
    +     * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearInt64Val() { + int64Val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.BooleanList boolVal_ = emptyBooleanList(); + private void ensureBoolValIsMutable() { + if (!boolVal_.isModifiable()) { + boolVal_ = makeMutableCopy(boolVal_); + } + bitField0_ |= 0x00000800; + } + private void ensureBoolValIsMutable(int capacity) { + if (!boolVal_.isModifiable()) { + boolVal_ = makeMutableCopy(boolVal_, capacity); + } + bitField0_ |= 0x00000800; + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return A list containing the boolVal. + */ + public java.util.List + getBoolValList() { + boolVal_.makeImmutable(); + return boolVal_; + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return The count of boolVal. + */ + public int getBoolValCount() { + return boolVal_.size(); + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + public boolean getBoolVal(int index) { + return boolVal_.getBoolean(index); + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param index The index to set the value at. + * @param value The boolVal to set. + * @return This builder for chaining. + */ + public Builder setBoolVal( + int index, boolean value) { + + ensureBoolValIsMutable(); + boolVal_.setBoolean(index, value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param value The boolVal to add. + * @return This builder for chaining. + */ + public Builder addBoolVal(boolean value) { + + ensureBoolValIsMutable(); + boolVal_.addBoolean(value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param values The boolVal to add. + * @return This builder for chaining. + */ + public Builder addAllBoolVal( + java.lang.Iterable values) { + ensureBoolValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, boolVal_); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * DT_BOOL
    +     * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearBoolVal() { + boolVal_ = emptyBooleanList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList dcomplexVal_ = emptyDoubleList(); + private void ensureDcomplexValIsMutable() { + if (!dcomplexVal_.isModifiable()) { + dcomplexVal_ = makeMutableCopy(dcomplexVal_); + } + bitField0_ |= 0x00001000; + } + private void ensureDcomplexValIsMutable(int capacity) { + if (!dcomplexVal_.isModifiable()) { + dcomplexVal_ = makeMutableCopy(dcomplexVal_, capacity); + } + bitField0_ |= 0x00001000; + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return A list containing the dcomplexVal. + */ + public java.util.List + getDcomplexValList() { + dcomplexVal_.makeImmutable(); + return dcomplexVal_; + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return The count of dcomplexVal. + */ + public int getDcomplexValCount() { + return dcomplexVal_.size(); + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param index The index of the element to return. + * @return The dcomplexVal at the given index. + */ + public double getDcomplexVal(int index) { + return dcomplexVal_.getDouble(index); + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param index The index to set the value at. + * @param value The dcomplexVal to set. + * @return This builder for chaining. + */ + public Builder setDcomplexVal( + int index, double value) { + + ensureDcomplexValIsMutable(); + dcomplexVal_.setDouble(index, value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param value The dcomplexVal to add. + * @return This builder for chaining. + */ + public Builder addDcomplexVal(double value) { + + ensureDcomplexValIsMutable(); + dcomplexVal_.addDouble(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param values The dcomplexVal to add. + * @return This builder for chaining. + */ + public Builder addAllDcomplexVal( + java.lang.Iterable values) { + ensureDcomplexValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dcomplexVal_); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +     * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +     * and imaginary parts of i-th double precision complex.
    +     * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearDcomplexVal() { + dcomplexVal_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + + private java.util.List resourceHandleVal_ = + java.util.Collections.emptyList(); + private void ensureResourceHandleValIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + resourceHandleVal_ = new java.util.ArrayList(resourceHandleVal_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto, org.tensorflow.proto.ResourceHandleProto.Builder, org.tensorflow.proto.ResourceHandleProtoOrBuilder> resourceHandleValBuilder_; + + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public java.util.List getResourceHandleValList() { + if (resourceHandleValBuilder_ == null) { + return java.util.Collections.unmodifiableList(resourceHandleVal_); + } else { + return resourceHandleValBuilder_.getMessageList(); + } + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public int getResourceHandleValCount() { + if (resourceHandleValBuilder_ == null) { + return resourceHandleVal_.size(); + } else { + return resourceHandleValBuilder_.getCount(); + } + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public org.tensorflow.proto.ResourceHandleProto getResourceHandleVal(int index) { + if (resourceHandleValBuilder_ == null) { + return resourceHandleVal_.get(index); + } else { + return resourceHandleValBuilder_.getMessage(index); + } + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder setResourceHandleVal( + int index, org.tensorflow.proto.ResourceHandleProto value) { + if (resourceHandleValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceHandleValIsMutable(); + resourceHandleVal_.set(index, value); + onChanged(); + } else { + resourceHandleValBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder setResourceHandleVal( + int index, org.tensorflow.proto.ResourceHandleProto.Builder builderForValue) { + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.set(index, builderForValue.build()); + onChanged(); + } else { + resourceHandleValBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder addResourceHandleVal(org.tensorflow.proto.ResourceHandleProto value) { + if (resourceHandleValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceHandleValIsMutable(); + resourceHandleVal_.add(value); + onChanged(); + } else { + resourceHandleValBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder addResourceHandleVal( + int index, org.tensorflow.proto.ResourceHandleProto value) { + if (resourceHandleValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceHandleValIsMutable(); + resourceHandleVal_.add(index, value); + onChanged(); + } else { + resourceHandleValBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder addResourceHandleVal( + org.tensorflow.proto.ResourceHandleProto.Builder builderForValue) { + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.add(builderForValue.build()); + onChanged(); + } else { + resourceHandleValBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder addResourceHandleVal( + int index, org.tensorflow.proto.ResourceHandleProto.Builder builderForValue) { + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.add(index, builderForValue.build()); + onChanged(); + } else { + resourceHandleValBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder addAllResourceHandleVal( + java.lang.Iterable values) { + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceHandleVal_); + onChanged(); + } else { + resourceHandleValBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder clearResourceHandleVal() { + if (resourceHandleValBuilder_ == null) { + resourceHandleVal_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + resourceHandleValBuilder_.clear(); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public Builder removeResourceHandleVal(int index) { + if (resourceHandleValBuilder_ == null) { + ensureResourceHandleValIsMutable(); + resourceHandleVal_.remove(index); + onChanged(); + } else { + resourceHandleValBuilder_.remove(index); + } + return this; + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public org.tensorflow.proto.ResourceHandleProto.Builder getResourceHandleValBuilder( + int index) { + return getResourceHandleValFieldBuilder().getBuilder(index); + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public org.tensorflow.proto.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( + int index) { + if (resourceHandleValBuilder_ == null) { + return resourceHandleVal_.get(index); } else { + return resourceHandleValBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public java.util.List + getResourceHandleValOrBuilderList() { + if (resourceHandleValBuilder_ != null) { + return resourceHandleValBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resourceHandleVal_); + } + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public org.tensorflow.proto.ResourceHandleProto.Builder addResourceHandleValBuilder() { + return getResourceHandleValFieldBuilder().addBuilder( + org.tensorflow.proto.ResourceHandleProto.getDefaultInstance()); + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public org.tensorflow.proto.ResourceHandleProto.Builder addResourceHandleValBuilder( + int index) { + return getResourceHandleValFieldBuilder().addBuilder( + index, org.tensorflow.proto.ResourceHandleProto.getDefaultInstance()); + } + /** + *
    +     * DT_RESOURCE
    +     * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + public java.util.List + getResourceHandleValBuilderList() { + return getResourceHandleValFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto, org.tensorflow.proto.ResourceHandleProto.Builder, org.tensorflow.proto.ResourceHandleProtoOrBuilder> + getResourceHandleValFieldBuilder() { + if (resourceHandleValBuilder_ == null) { + resourceHandleValBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ResourceHandleProto, org.tensorflow.proto.ResourceHandleProto.Builder, org.tensorflow.proto.ResourceHandleProtoOrBuilder>( + resourceHandleVal_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + resourceHandleVal_ = null; + } + return resourceHandleValBuilder_; + } + + private java.util.List variantVal_ = + java.util.Collections.emptyList(); + private void ensureVariantValIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + variantVal_ = new java.util.ArrayList(variantVal_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.VariantTensorDataProto, org.tensorflow.proto.VariantTensorDataProto.Builder, org.tensorflow.proto.VariantTensorDataProtoOrBuilder> variantValBuilder_; + + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public java.util.List getVariantValList() { + if (variantValBuilder_ == null) { + return java.util.Collections.unmodifiableList(variantVal_); + } else { + return variantValBuilder_.getMessageList(); + } + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public int getVariantValCount() { + if (variantValBuilder_ == null) { + return variantVal_.size(); + } else { + return variantValBuilder_.getCount(); + } + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public org.tensorflow.proto.VariantTensorDataProto getVariantVal(int index) { + if (variantValBuilder_ == null) { + return variantVal_.get(index); + } else { + return variantValBuilder_.getMessage(index); + } + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder setVariantVal( + int index, org.tensorflow.proto.VariantTensorDataProto value) { + if (variantValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantValIsMutable(); + variantVal_.set(index, value); + onChanged(); + } else { + variantValBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder setVariantVal( + int index, org.tensorflow.proto.VariantTensorDataProto.Builder builderForValue) { + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + variantVal_.set(index, builderForValue.build()); + onChanged(); + } else { + variantValBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder addVariantVal(org.tensorflow.proto.VariantTensorDataProto value) { + if (variantValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantValIsMutable(); + variantVal_.add(value); + onChanged(); + } else { + variantValBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder addVariantVal( + int index, org.tensorflow.proto.VariantTensorDataProto value) { + if (variantValBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVariantValIsMutable(); + variantVal_.add(index, value); + onChanged(); + } else { + variantValBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder addVariantVal( + org.tensorflow.proto.VariantTensorDataProto.Builder builderForValue) { + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + variantVal_.add(builderForValue.build()); + onChanged(); + } else { + variantValBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder addVariantVal( + int index, org.tensorflow.proto.VariantTensorDataProto.Builder builderForValue) { + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + variantVal_.add(index, builderForValue.build()); + onChanged(); + } else { + variantValBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder addAllVariantVal( + java.lang.Iterable values) { + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, variantVal_); + onChanged(); + } else { + variantValBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder clearVariantVal() { + if (variantValBuilder_ == null) { + variantVal_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + variantValBuilder_.clear(); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public Builder removeVariantVal(int index) { + if (variantValBuilder_ == null) { + ensureVariantValIsMutable(); + variantVal_.remove(index); + onChanged(); + } else { + variantValBuilder_.remove(index); + } + return this; + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public org.tensorflow.proto.VariantTensorDataProto.Builder getVariantValBuilder( + int index) { + return getVariantValFieldBuilder().getBuilder(index); + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public org.tensorflow.proto.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( + int index) { + if (variantValBuilder_ == null) { + return variantVal_.get(index); } else { + return variantValBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public java.util.List + getVariantValOrBuilderList() { + if (variantValBuilder_ != null) { + return variantValBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(variantVal_); + } + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public org.tensorflow.proto.VariantTensorDataProto.Builder addVariantValBuilder() { + return getVariantValFieldBuilder().addBuilder( + org.tensorflow.proto.VariantTensorDataProto.getDefaultInstance()); + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public org.tensorflow.proto.VariantTensorDataProto.Builder addVariantValBuilder( + int index) { + return getVariantValFieldBuilder().addBuilder( + index, org.tensorflow.proto.VariantTensorDataProto.getDefaultInstance()); + } + /** + *
    +     * DT_VARIANT
    +     * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + public java.util.List + getVariantValBuilderList() { + return getVariantValFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.VariantTensorDataProto, org.tensorflow.proto.VariantTensorDataProto.Builder, org.tensorflow.proto.VariantTensorDataProtoOrBuilder> + getVariantValFieldBuilder() { + if (variantValBuilder_ == null) { + variantValBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.VariantTensorDataProto, org.tensorflow.proto.VariantTensorDataProto.Builder, org.tensorflow.proto.VariantTensorDataProtoOrBuilder>( + variantVal_, + ((bitField0_ & 0x00004000) != 0), + getParentForChildren(), + isClean()); + variantVal_ = null; + } + return variantValBuilder_; + } + + private com.google.protobuf.Internal.IntList uint32Val_ = emptyIntList(); + private void ensureUint32ValIsMutable() { + if (!uint32Val_.isModifiable()) { + uint32Val_ = makeMutableCopy(uint32Val_); + } + bitField0_ |= 0x00008000; + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return A list containing the uint32Val. + */ + public java.util.List + getUint32ValList() { + uint32Val_.makeImmutable(); + return uint32Val_; + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return The count of uint32Val. + */ + public int getUint32ValCount() { + return uint32Val_.size(); + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param index The index of the element to return. + * @return The uint32Val at the given index. + */ + public int getUint32Val(int index) { + return uint32Val_.getInt(index); + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param index The index to set the value at. + * @param value The uint32Val to set. + * @return This builder for chaining. + */ + public Builder setUint32Val( + int index, int value) { + + ensureUint32ValIsMutable(); + uint32Val_.setInt(index, value); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param value The uint32Val to add. + * @return This builder for chaining. + */ + public Builder addUint32Val(int value) { + + ensureUint32ValIsMutable(); + uint32Val_.addInt(value); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param values The uint32Val to add. + * @return This builder for chaining. + */ + public Builder addAllUint32Val( + java.lang.Iterable values) { + ensureUint32ValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, uint32Val_); + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT32
    +     * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearUint32Val() { + uint32Val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList uint64Val_ = emptyLongList(); + private void ensureUint64ValIsMutable() { + if (!uint64Val_.isModifiable()) { + uint64Val_ = makeMutableCopy(uint64Val_); + } + bitField0_ |= 0x00010000; + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return A list containing the uint64Val. + */ + public java.util.List + getUint64ValList() { + uint64Val_.makeImmutable(); + return uint64Val_; + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return The count of uint64Val. + */ + public int getUint64ValCount() { + return uint64Val_.size(); + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + public long getUint64Val(int index) { + return uint64Val_.getLong(index); + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param index The index to set the value at. + * @param value The uint64Val to set. + * @return This builder for chaining. + */ + public Builder setUint64Val( + int index, long value) { + + ensureUint64ValIsMutable(); + uint64Val_.setLong(index, value); + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param value The uint64Val to add. + * @return This builder for chaining. + */ + public Builder addUint64Val(long value) { + + ensureUint64ValIsMutable(); + uint64Val_.addLong(value); + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param values The uint64Val to add. + * @return This builder for chaining. + */ + public Builder addAllUint64Val( + java.lang.Iterable values) { + ensureUint64ValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, uint64Val_); + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +     * DT_UINT64
    +     * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearUint64Val() { + uint64Val_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString float8Val_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * DT_FLOAT8_*, use variable-sized set of bytes
    +     * (i.e. the equivalent of repeated uint8, if such a thing existed).
    +     * 
    + * + * bytes float8_val = 18; + * @return The float8Val. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFloat8Val() { + return float8Val_; + } + /** + *
    +     * DT_FLOAT8_*, use variable-sized set of bytes
    +     * (i.e. the equivalent of repeated uint8, if such a thing existed).
    +     * 
    + * + * bytes float8_val = 18; + * @param value The float8Val to set. + * @return This builder for chaining. + */ + public Builder setFloat8Val(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + float8Val_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + *
    +     * DT_FLOAT8_*, use variable-sized set of bytes
    +     * (i.e. the equivalent of repeated uint8, if such a thing existed).
    +     * 
    + * + * bytes float8_val = 18; + * @return This builder for chaining. + */ + public Builder clearFloat8Val() { + bitField0_ = (bitField0_ & ~0x00020000); + float8Val_ = getDefaultInstance().getFloat8Val(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorProto) + private static final org.tensorflow.proto.TensorProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorProto(); + } + + public static org.tensorflow.proto.TensorProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtoOrBuilder.java new file mode 100644 index 00000000000..193c60a945a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtoOrBuilder.java @@ -0,0 +1,512 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TensorProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Data type of the tensor.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + *
    +   * Data type of the tensor.
    +   * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + boolean hasTensorShape(); + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + org.tensorflow.proto.TensorShapeProto getTensorShape(); + /** + *
    +   * Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
    +   * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); + + /** + *
    +   * Version number.
    +   *
    +   * In version 0, if the "repeated xxx" representations contain only one
    +   * element, that element is repeated to fill the shape.  This makes it easy
    +   * to represent a constant Tensor with a single value.
    +   * 
    + * + * int32 version_number = 3; + * @return The versionNumber. + */ + int getVersionNumber(); + + /** + *
    +   * Serialized raw tensor content from either Tensor::AsProtoTensorContent or
    +   * memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
    +   * can be used for all tensor types. The purpose of this representation is to
    +   * reduce serialization overhead during RPC call by avoiding serialization of
    +   * many repeated small items.
    +   * 
    + * + * bytes tensor_content = 4; + * @return The tensorContent. + */ + com.google.protobuf.ByteString getTensorContent(); + + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return A list containing the halfVal. + */ + java.util.List getHalfValList(); + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @return The count of halfVal. + */ + int getHalfValCount(); + /** + *
    +   * DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
    +   * have some pointless zero padding for each value here.
    +   * 
    + * + * repeated int32 half_val = 13 [packed = true]; + * @param index The index of the element to return. + * @return The halfVal at the given index. + */ + int getHalfVal(int index); + + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return A list containing the floatVal. + */ + java.util.List getFloatValList(); + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @return The count of floatVal. + */ + int getFloatValCount(); + /** + *
    +   * DT_FLOAT.
    +   * 
    + * + * repeated float float_val = 5 [packed = true]; + * @param index The index of the element to return. + * @return The floatVal at the given index. + */ + float getFloatVal(int index); + + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return A list containing the doubleVal. + */ + java.util.List getDoubleValList(); + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @return The count of doubleVal. + */ + int getDoubleValCount(); + /** + *
    +   * DT_DOUBLE.
    +   * 
    + * + * repeated double double_val = 6 [packed = true]; + * @param index The index of the element to return. + * @return The doubleVal at the given index. + */ + double getDoubleVal(int index); + + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return A list containing the intVal. + */ + java.util.List getIntValList(); + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @return The count of intVal. + */ + int getIntValCount(); + /** + *
    +   * DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
    +   * 
    + * + * repeated int32 int_val = 7 [packed = true]; + * @param index The index of the element to return. + * @return The intVal at the given index. + */ + int getIntVal(int index); + + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @return A list containing the stringVal. + */ + java.util.List getStringValList(); + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @return The count of stringVal. + */ + int getStringValCount(); + /** + *
    +   * DT_STRING
    +   * 
    + * + * repeated bytes string_val = 8; + * @param index The index of the element to return. + * @return The stringVal at the given index. + */ + com.google.protobuf.ByteString getStringVal(int index); + + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return A list containing the scomplexVal. + */ + java.util.List getScomplexValList(); + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @return The count of scomplexVal. + */ + int getScomplexValCount(); + /** + *
    +   * DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th single precision complex.
    +   * 
    + * + * repeated float scomplex_val = 9 [packed = true]; + * @param index The index of the element to return. + * @return The scomplexVal at the given index. + */ + float getScomplexVal(int index); + + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return A list containing the int64Val. + */ + java.util.List getInt64ValList(); + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @return The count of int64Val. + */ + int getInt64ValCount(); + /** + *
    +   * DT_INT64
    +   * 
    + * + * repeated int64 int64_val = 10 [packed = true]; + * @param index The index of the element to return. + * @return The int64Val at the given index. + */ + long getInt64Val(int index); + + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return A list containing the boolVal. + */ + java.util.List getBoolValList(); + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @return The count of boolVal. + */ + int getBoolValCount(); + /** + *
    +   * DT_BOOL
    +   * 
    + * + * repeated bool bool_val = 11 [packed = true]; + * @param index The index of the element to return. + * @return The boolVal at the given index. + */ + boolean getBoolVal(int index); + + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return A list containing the dcomplexVal. + */ + java.util.List getDcomplexValList(); + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @return The count of dcomplexVal. + */ + int getDcomplexValCount(); + /** + *
    +   * DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
    +   * and imaginary parts of i-th double precision complex.
    +   * 
    + * + * repeated double dcomplex_val = 12 [packed = true]; + * @param index The index of the element to return. + * @return The dcomplexVal at the given index. + */ + double getDcomplexVal(int index); + + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + java.util.List + getResourceHandleValList(); + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + org.tensorflow.proto.ResourceHandleProto getResourceHandleVal(int index); + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + int getResourceHandleValCount(); + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + java.util.List + getResourceHandleValOrBuilderList(); + /** + *
    +   * DT_RESOURCE
    +   * 
    + * + * repeated .tensorflow.ResourceHandleProto resource_handle_val = 14; + */ + org.tensorflow.proto.ResourceHandleProtoOrBuilder getResourceHandleValOrBuilder( + int index); + + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + java.util.List + getVariantValList(); + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + org.tensorflow.proto.VariantTensorDataProto getVariantVal(int index); + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + int getVariantValCount(); + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + java.util.List + getVariantValOrBuilderList(); + /** + *
    +   * DT_VARIANT
    +   * 
    + * + * repeated .tensorflow.VariantTensorDataProto variant_val = 15; + */ + org.tensorflow.proto.VariantTensorDataProtoOrBuilder getVariantValOrBuilder( + int index); + + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return A list containing the uint32Val. + */ + java.util.List getUint32ValList(); + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @return The count of uint32Val. + */ + int getUint32ValCount(); + /** + *
    +   * DT_UINT32
    +   * 
    + * + * repeated uint32 uint32_val = 16 [packed = true]; + * @param index The index of the element to return. + * @return The uint32Val at the given index. + */ + int getUint32Val(int index); + + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return A list containing the uint64Val. + */ + java.util.List getUint64ValList(); + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @return The count of uint64Val. + */ + int getUint64ValCount(); + /** + *
    +   * DT_UINT64
    +   * 
    + * + * repeated uint64 uint64_val = 17 [packed = true]; + * @param index The index of the element to return. + * @return The uint64Val at the given index. + */ + long getUint64Val(int index); + + /** + *
    +   * DT_FLOAT8_*, use variable-sized set of bytes
    +   * (i.e. the equivalent of repeated uint8, if such a thing existed).
    +   * 
    + * + * bytes float8_val = 18; + * @return The float8Val. + */ + com.google.protobuf.ByteString getFloat8Val(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtos.java new file mode 100644 index 00000000000..5641fea4fdc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorProtos.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TensorProtos { + private TensorProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorProtos.class.getName()); + } + 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_TensorProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_VariantTensorDataProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_VariantTensorDataProto_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/framework/tensor.proto" + + "\022\ntensorflow\032/tensorflow/core/framework/" + + "resource_handle.proto\032,tensorflow/core/f" + + "ramework/tensor_shape.proto\032%tensorflow/" + + "core/framework/types.proto\"\240\004\n\013TensorPro" + + "to\022#\n\005dtype\030\001 \001(\0162\024.tensorflow.DataType\022" + + "2\n\014tensor_shape\030\002 \001(\0132\034.tensorflow.Tenso" + + "rShapeProto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016t" + + "ensor_content\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020" + + "\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006" + + " \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_" + + "val\030\010 \003(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\ti" + + "nt64_val\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001" + + "\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001\022<\n\023resource_h" + + "andle_val\030\016 \003(\0132\037.tensorflow.ResourceHan" + + "dleProto\0227\n\013variant_val\030\017 \003(\0132\".tensorfl" + + "ow.VariantTensorDataProto\022\026\n\nuint32_val\030" + + "\020 \003(\rB\002\020\001\022\026\n\nuint64_val\030\021 \003(\004B\002\020\001\022\022\n\nflo" + + "at8_val\030\022 \001(\014\"g\n\026VariantTensorDataProto\022" + + "\021\n\ttype_name\030\001 \001(\t\022\020\n\010metadata\030\002 \001(\014\022(\n\007" + + "tensors\030\003 \003(\0132\027.tensorflow.TensorProtoBx" + + "\n\024org.tensorflow.protoB\014TensorProtosP\001ZM" + + "github.com/tensorflow/tensorflow/tensorf" + + "low/go/core/framework/tensor_go_proto\370\001\001" + + "b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.ResourceHandle.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_TensorProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_TensorProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorProto_descriptor, + new java.lang.String[] { "Dtype", "TensorShape", "VersionNumber", "TensorContent", "HalfVal", "FloatVal", "DoubleVal", "IntVal", "StringVal", "ScomplexVal", "Int64Val", "BoolVal", "DcomplexVal", "ResourceHandleVal", "VariantVal", "Uint32Val", "Uint64Val", "Float8Val", }); + internal_static_tensorflow_VariantTensorDataProto_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_VariantTensorDataProto_descriptor, + new java.lang.String[] { "TypeName", "Metadata", "Tensors", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.ResourceHandle.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProto.java new file mode 100644 index 00000000000..3e0f3a3387c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProto.java @@ -0,0 +1,1853 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_shape.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Dimensions of a tensor.
    + * 
    + * + * Protobuf type {@code tensorflow.TensorShapeProto} + */ +public final class TensorShapeProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto) + TensorShapeProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorShapeProto.class.getName()); + } + // Use TensorShapeProto.newBuilder() to construct. + private TensorShapeProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorShapeProto() { + dim_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorShapeProto.class, org.tensorflow.proto.TensorShapeProto.Builder.class); + } + + public interface DimOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto.Dim) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Size of the tensor in that dimension.
    +     * This value must be >= -1, but values of -1 are reserved for "unknown"
    +     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    +     * that work with TensorShapeProto may fail at runtime when deserializing
    +     * a TensorShapeProto containing a dim value of -1.
    +     * 
    + * + * int64 size = 1; + * @return The size. + */ + long getSize(); + + /** + *
    +     * Optional name of the tensor dimension.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Optional name of the tensor dimension.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + } + /** + *
    +   * One dimension of the tensor.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorShapeProto.Dim} + */ + public static final class Dim extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorShapeProto.Dim) + DimOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Dim.class.getName()); + } + // Use Dim.newBuilder() to construct. + private Dim(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Dim() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorShapeProto.Dim.class, org.tensorflow.proto.TensorShapeProto.Dim.Builder.class); + } + + public static final int SIZE_FIELD_NUMBER = 1; + private long size_ = 0L; + /** + *
    +     * Size of the tensor in that dimension.
    +     * This value must be >= -1, but values of -1 are reserved for "unknown"
    +     * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    +     * that work with TensorShapeProto may fail at runtime when deserializing
    +     * a TensorShapeProto containing a dim value of -1.
    +     * 
    + * + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Optional name of the tensor dimension.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Optional name of the tensor dimension.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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; + } + } + + 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 (size_ != 0L) { + output.writeInt64(1, size_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, size_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + size += getUnknownFields().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.TensorShapeProto.Dim)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorShapeProto.Dim other = (org.tensorflow.proto.TensorShapeProto.Dim) obj; + + if (getSize() + != other.getSize()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto.Dim 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.TensorShapeProto.Dim parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorShapeProto.Dim parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorShapeProto.Dim parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorShapeProto.Dim parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorShapeProto.Dim 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * One dimension of the tensor.
    +     * 
    + * + * Protobuf type {@code tensorflow.TensorShapeProto.Dim} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto.Dim) + org.tensorflow.proto.TensorShapeProto.DimOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorShapeProto.Dim.class, org.tensorflow.proto.TensorShapeProto.Dim.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorShapeProto.Dim.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + size_ = 0L; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_Dim_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto.Dim getDefaultInstanceForType() { + return org.tensorflow.proto.TensorShapeProto.Dim.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto.Dim build() { + org.tensorflow.proto.TensorShapeProto.Dim result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto.Dim buildPartial() { + org.tensorflow.proto.TensorShapeProto.Dim result = new org.tensorflow.proto.TensorShapeProto.Dim(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorShapeProto.Dim result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorShapeProto.Dim) { + return mergeFrom((org.tensorflow.proto.TensorShapeProto.Dim)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorShapeProto.Dim other) { + if (other == org.tensorflow.proto.TensorShapeProto.Dim.getDefaultInstance()) return this; + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + size_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long size_ ; + /** + *
    +       * Size of the tensor in that dimension.
    +       * This value must be >= -1, but values of -1 are reserved for "unknown"
    +       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    +       * that work with TensorShapeProto may fail at runtime when deserializing
    +       * a TensorShapeProto containing a dim value of -1.
    +       * 
    + * + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + *
    +       * Size of the tensor in that dimension.
    +       * This value must be >= -1, but values of -1 are reserved for "unknown"
    +       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    +       * that work with TensorShapeProto may fail at runtime when deserializing
    +       * a TensorShapeProto containing a dim value of -1.
    +       * 
    + * + * int64 size = 1; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Size of the tensor in that dimension.
    +       * This value must be >= -1, but values of -1 are reserved for "unknown"
    +       * shapes (values of -1 mean "unknown" dimension).  Certain wrappers
    +       * that work with TensorShapeProto may fail at runtime when deserializing
    +       * a TensorShapeProto containing a dim value of -1.
    +       * 
    + * + * int64 size = 1; + * @return This builder for chaining. + */ + public Builder clearSize() { + bitField0_ = (bitField0_ & ~0x00000001); + size_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +       * Optional name of the tensor dimension.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Optional name of the tensor dimension.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Optional name of the tensor dimension.
    +       * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Optional name of the tensor dimension.
    +       * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Optional name of the tensor dimension.
    +       * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorShapeProto.Dim) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto.Dim) + private static final org.tensorflow.proto.TensorShapeProto.Dim DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorShapeProto.Dim(); + } + + public static org.tensorflow.proto.TensorShapeProto.Dim getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dim parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorShapeProto.Dim getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int DIM_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List dim_; + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + @java.lang.Override + public java.util.List getDimList() { + return dim_; + } + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + @java.lang.Override + public java.util.List + getDimOrBuilderList() { + return dim_; + } + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + @java.lang.Override + public int getDimCount() { + return dim_.size(); + } + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto.Dim getDim(int index) { + return dim_.get(index); + } + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto.DimOrBuilder getDimOrBuilder( + int index) { + return dim_.get(index); + } + + public static final int UNKNOWN_RANK_FIELD_NUMBER = 3; + private boolean unknownRank_ = false; + /** + *
    +   * If true, the number of dimensions in the shape is unknown.
    +   *
    +   * If true, "dim.size()" must be 0.
    +   * 
    + * + * bool unknown_rank = 3; + * @return The unknownRank. + */ + @java.lang.Override + public boolean getUnknownRank() { + return unknownRank_; + } + + 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 { + for (int i = 0; i < dim_.size(); i++) { + output.writeMessage(2, dim_.get(i)); + } + if (unknownRank_ != false) { + output.writeBool(3, unknownRank_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dim_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, dim_.get(i)); + } + if (unknownRank_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, unknownRank_); + } + size += getUnknownFields().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.TensorShapeProto)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorShapeProto other = (org.tensorflow.proto.TensorShapeProto) obj; + + if (!getDimList() + .equals(other.getDimList())) return false; + if (getUnknownRank() + != other.getUnknownRank()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDimCount() > 0) { + hash = (37 * hash) + DIM_FIELD_NUMBER; + hash = (53 * hash) + getDimList().hashCode(); + } + hash = (37 * hash) + UNKNOWN_RANK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUnknownRank()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorShapeProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto 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.TensorShapeProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto 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.TensorShapeProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorShapeProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorShapeProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorShapeProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorShapeProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorShapeProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorShapeProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorShapeProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorShapeProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Dimensions of a tensor.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorShapeProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorShapeProto) + org.tensorflow.proto.TensorShapeProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorShapeProto.class, org.tensorflow.proto.TensorShapeProto.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorShapeProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dimBuilder_ == null) { + dim_ = java.util.Collections.emptyList(); + } else { + dim_ = null; + dimBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + unknownRank_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorShapeProtos.internal_static_tensorflow_TensorShapeProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getDefaultInstanceForType() { + return org.tensorflow.proto.TensorShapeProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto build() { + org.tensorflow.proto.TensorShapeProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto buildPartial() { + org.tensorflow.proto.TensorShapeProto result = new org.tensorflow.proto.TensorShapeProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TensorShapeProto result) { + if (dimBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dim_ = java.util.Collections.unmodifiableList(dim_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dim_ = dim_; + } else { + result.dim_ = dimBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TensorShapeProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unknownRank_ = unknownRank_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorShapeProto) { + return mergeFrom((org.tensorflow.proto.TensorShapeProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorShapeProto other) { + if (other == org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) return this; + if (dimBuilder_ == null) { + if (!other.dim_.isEmpty()) { + if (dim_.isEmpty()) { + dim_ = other.dim_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDimIsMutable(); + dim_.addAll(other.dim_); + } + onChanged(); + } + } else { + if (!other.dim_.isEmpty()) { + if (dimBuilder_.isEmpty()) { + dimBuilder_.dispose(); + dimBuilder_ = null; + dim_ = other.dim_; + bitField0_ = (bitField0_ & ~0x00000001); + dimBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDimFieldBuilder() : null; + } else { + dimBuilder_.addAllMessages(other.dim_); + } + } + } + if (other.getUnknownRank() != false) { + setUnknownRank(other.getUnknownRank()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + org.tensorflow.proto.TensorShapeProto.Dim m = + input.readMessage( + org.tensorflow.proto.TensorShapeProto.Dim.parser(), + extensionRegistry); + if (dimBuilder_ == null) { + ensureDimIsMutable(); + dim_.add(m); + } else { + dimBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: { + unknownRank_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List dim_ = + java.util.Collections.emptyList(); + private void ensureDimIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dim_ = new java.util.ArrayList(dim_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto.Dim, org.tensorflow.proto.TensorShapeProto.Dim.Builder, org.tensorflow.proto.TensorShapeProto.DimOrBuilder> dimBuilder_; + + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public java.util.List getDimList() { + if (dimBuilder_ == null) { + return java.util.Collections.unmodifiableList(dim_); + } else { + return dimBuilder_.getMessageList(); + } + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public int getDimCount() { + if (dimBuilder_ == null) { + return dim_.size(); + } else { + return dimBuilder_.getCount(); + } + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Dim getDim(int index) { + if (dimBuilder_ == null) { + return dim_.get(index); + } else { + return dimBuilder_.getMessage(index); + } + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder setDim( + int index, org.tensorflow.proto.TensorShapeProto.Dim value) { + if (dimBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimIsMutable(); + dim_.set(index, value); + onChanged(); + } else { + dimBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder setDim( + int index, org.tensorflow.proto.TensorShapeProto.Dim.Builder builderForValue) { + if (dimBuilder_ == null) { + ensureDimIsMutable(); + dim_.set(index, builderForValue.build()); + onChanged(); + } else { + dimBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder addDim(org.tensorflow.proto.TensorShapeProto.Dim value) { + if (dimBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimIsMutable(); + dim_.add(value); + onChanged(); + } else { + dimBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder addDim( + int index, org.tensorflow.proto.TensorShapeProto.Dim value) { + if (dimBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimIsMutable(); + dim_.add(index, value); + onChanged(); + } else { + dimBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder addDim( + org.tensorflow.proto.TensorShapeProto.Dim.Builder builderForValue) { + if (dimBuilder_ == null) { + ensureDimIsMutable(); + dim_.add(builderForValue.build()); + onChanged(); + } else { + dimBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder addDim( + int index, org.tensorflow.proto.TensorShapeProto.Dim.Builder builderForValue) { + if (dimBuilder_ == null) { + ensureDimIsMutable(); + dim_.add(index, builderForValue.build()); + onChanged(); + } else { + dimBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder addAllDim( + java.lang.Iterable values) { + if (dimBuilder_ == null) { + ensureDimIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, dim_); + onChanged(); + } else { + dimBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder clearDim() { + if (dimBuilder_ == null) { + dim_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dimBuilder_.clear(); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public Builder removeDim(int index) { + if (dimBuilder_ == null) { + ensureDimIsMutable(); + dim_.remove(index); + onChanged(); + } else { + dimBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Dim.Builder getDimBuilder( + int index) { + return getDimFieldBuilder().getBuilder(index); + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public org.tensorflow.proto.TensorShapeProto.DimOrBuilder getDimOrBuilder( + int index) { + if (dimBuilder_ == null) { + return dim_.get(index); } else { + return dimBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public java.util.List + getDimOrBuilderList() { + if (dimBuilder_ != null) { + return dimBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dim_); + } + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Dim.Builder addDimBuilder() { + return getDimFieldBuilder().addBuilder( + org.tensorflow.proto.TensorShapeProto.Dim.getDefaultInstance()); + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Dim.Builder addDimBuilder( + int index) { + return getDimFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorShapeProto.Dim.getDefaultInstance()); + } + /** + *
    +     * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +     * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +     * corresponds to a dimension of unknown size. The names are
    +     * optional.
    +     *
    +     * The order of entries in "dim" matters: It indicates the layout of the
    +     * values in the tensor in-memory representation.
    +     *
    +     * The first entry in "dim" is the outermost dimension used to layout the
    +     * values, the last entry is the innermost dimension.  This matches the
    +     * in-memory layout of RowMajor Eigen tensors.
    +     *
    +     * If "dim.size()" > 0, "unknown_rank" must be false.
    +     * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + public java.util.List + getDimBuilderList() { + return getDimFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto.Dim, org.tensorflow.proto.TensorShapeProto.Dim.Builder, org.tensorflow.proto.TensorShapeProto.DimOrBuilder> + getDimFieldBuilder() { + if (dimBuilder_ == null) { + dimBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorShapeProto.Dim, org.tensorflow.proto.TensorShapeProto.Dim.Builder, org.tensorflow.proto.TensorShapeProto.DimOrBuilder>( + dim_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + dim_ = null; + } + return dimBuilder_; + } + + private boolean unknownRank_ ; + /** + *
    +     * If true, the number of dimensions in the shape is unknown.
    +     *
    +     * If true, "dim.size()" must be 0.
    +     * 
    + * + * bool unknown_rank = 3; + * @return The unknownRank. + */ + @java.lang.Override + public boolean getUnknownRank() { + return unknownRank_; + } + /** + *
    +     * If true, the number of dimensions in the shape is unknown.
    +     *
    +     * If true, "dim.size()" must be 0.
    +     * 
    + * + * bool unknown_rank = 3; + * @param value The unknownRank to set. + * @return This builder for chaining. + */ + public Builder setUnknownRank(boolean value) { + + unknownRank_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * If true, the number of dimensions in the shape is unknown.
    +     *
    +     * If true, "dim.size()" must be 0.
    +     * 
    + * + * bool unknown_rank = 3; + * @return This builder for chaining. + */ + public Builder clearUnknownRank() { + bitField0_ = (bitField0_ & ~0x00000002); + unknownRank_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorShapeProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto) + private static final org.tensorflow.proto.TensorShapeProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorShapeProto(); + } + + public static org.tensorflow.proto.TensorShapeProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorShapeProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorShapeProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtoOrBuilder.java new file mode 100644 index 00000000000..abdb7c2a2dc --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtoOrBuilder.java @@ -0,0 +1,127 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_shape.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TensorShapeProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorShapeProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + java.util.List + getDimList(); + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + org.tensorflow.proto.TensorShapeProto.Dim getDim(int index); + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + int getDimCount(); + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + java.util.List + getDimOrBuilderList(); + /** + *
    +   * Dimensions of the tensor, such as {"input", 30}, {"output", 40}
    +   * for a 30 x 40 2D tensor.  If an entry has size -1, this
    +   * corresponds to a dimension of unknown size. The names are
    +   * optional.
    +   *
    +   * The order of entries in "dim" matters: It indicates the layout of the
    +   * values in the tensor in-memory representation.
    +   *
    +   * The first entry in "dim" is the outermost dimension used to layout the
    +   * values, the last entry is the innermost dimension.  This matches the
    +   * in-memory layout of RowMajor Eigen tensors.
    +   *
    +   * If "dim.size()" > 0, "unknown_rank" must be false.
    +   * 
    + * + * repeated .tensorflow.TensorShapeProto.Dim dim = 2; + */ + org.tensorflow.proto.TensorShapeProto.DimOrBuilder getDimOrBuilder( + int index); + + /** + *
    +   * If true, the number of dimensions in the shape is unknown.
    +   *
    +   * If true, "dim.size()" must be 0.
    +   * 
    + * + * bool unknown_rank = 3; + * @return The unknownRank. + */ + boolean getUnknownRank(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtos.java new file mode 100644 index 00000000000..0d6cdfd8d58 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorShapeProtos.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_shape.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TensorShapeProtos { + private TensorShapeProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorShapeProtos.class.getName()); + } + 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_TensorShapeProto_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorShapeProto_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TensorShapeProto_Dim_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TensorShapeProto_Dim_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/framework/tensor_shape" + + ".proto\022\ntensorflow\"z\n\020TensorShapeProto\022-" + + "\n\003dim\030\002 \003(\0132 .tensorflow.TensorShapeProt" + + "o.Dim\022\024\n\014unknown_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004si" + + "ze\030\001 \001(\003\022\014\n\004name\030\002 \001(\tB\203\001\n\024org.tensorflo" + + "w.protoB\021TensorShapeProtosP\001ZSgithub.com" + + "/tensorflow/tensorflow/tensorflow/go/cor" + + "e/framework/tensor_shape_go_proto\370\001\001b\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_TensorShapeProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_TensorShapeProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorShapeProto_descriptor, + new java.lang.String[] { "Dim", "UnknownRank", }); + internal_static_tensorflow_TensorShapeProto_Dim_descriptor = + internal_static_tensorflow_TensorShapeProto_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_TensorShapeProto_Dim_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TensorShapeProto_Dim_descriptor, + new java.lang.String[] { "Size", "Name", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProto.java new file mode 100644 index 00000000000..dde6d3207de --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProto.java @@ -0,0 +1,1554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor_slice.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Can only be interpreted if you know the corresponding TensorShape.
    + * 
    + * + * Protobuf type {@code tensorflow.TensorSliceProto} + */ +public final class TensorSliceProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorSliceProto) + TensorSliceProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorSliceProto.class.getName()); + } + // Use TensorSliceProto.newBuilder() to construct. + private TensorSliceProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorSliceProto() { + extent_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorSliceProto.class, org.tensorflow.proto.TensorSliceProto.Builder.class); + } + + public interface ExtentOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TensorSliceProto.Extent) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Start index of the slice, starting at 0.
    +     * 
    + * + * int64 start = 1; + * @return The start. + */ + long getStart(); + + /** + * int64 length = 2; + * @return Whether the length field is set. + */ + boolean hasLength(); + /** + * int64 length = 2; + * @return The length. + */ + long getLength(); + + org.tensorflow.proto.TensorSliceProto.Extent.HasLengthCase getHasLengthCase(); + } + /** + *
    +   * Extent of the slice in one dimension.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorSliceProto.Extent} + */ + public static final class Extent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TensorSliceProto.Extent) + ExtentOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Extent.class.getName()); + } + // Use Extent.newBuilder() to construct. + private Extent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Extent() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorSliceProto.Extent.class, org.tensorflow.proto.TensorSliceProto.Extent.Builder.class); + } + + private int hasLengthCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object hasLength_; + public enum HasLengthCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LENGTH(2), + HASLENGTH_NOT_SET(0); + private final int value; + private HasLengthCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HasLengthCase valueOf(int value) { + return forNumber(value); + } + + public static HasLengthCase forNumber(int value) { + switch (value) { + case 2: return LENGTH; + case 0: return HASLENGTH_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public HasLengthCase + getHasLengthCase() { + return HasLengthCase.forNumber( + hasLengthCase_); + } + + public static final int START_FIELD_NUMBER = 1; + private long start_ = 0L; + /** + *
    +     * Start index of the slice, starting at 0.
    +     * 
    + * + * int64 start = 1; + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + + public static final int LENGTH_FIELD_NUMBER = 2; + /** + * int64 length = 2; + * @return Whether the length field is set. + */ + @java.lang.Override + public boolean hasLength() { + return hasLengthCase_ == 2; + } + /** + * int64 length = 2; + * @return The length. + */ + @java.lang.Override + public long getLength() { + if (hasLengthCase_ == 2) { + return (java.lang.Long) hasLength_; + } + return 0L; + } + + 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 (start_ != 0L) { + output.writeInt64(1, start_); + } + if (hasLengthCase_ == 2) { + output.writeInt64( + 2, (long)((java.lang.Long) hasLength_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (start_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, start_); + } + if (hasLengthCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 2, (long)((java.lang.Long) hasLength_)); + } + size += getUnknownFields().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.TensorSliceProto.Extent)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorSliceProto.Extent other = (org.tensorflow.proto.TensorSliceProto.Extent) obj; + + if (getStart() + != other.getStart()) return false; + if (!getHasLengthCase().equals(other.getHasLengthCase())) return false; + switch (hasLengthCase_) { + case 2: + if (getLength() + != other.getLength()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStart()); + switch (hasLengthCase_) { + case 2: + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLength()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto.Extent 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.TensorSliceProto.Extent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorSliceProto.Extent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorSliceProto.Extent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorSliceProto.Extent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorSliceProto.Extent 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Extent of the slice in one dimension.
    +     * 
    + * + * Protobuf type {@code tensorflow.TensorSliceProto.Extent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorSliceProto.Extent) + org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorSliceProto.Extent.class, org.tensorflow.proto.TensorSliceProto.Extent.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorSliceProto.Extent.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + start_ = 0L; + hasLengthCase_ = 0; + hasLength_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_Extent_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto.Extent getDefaultInstanceForType() { + return org.tensorflow.proto.TensorSliceProto.Extent.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto.Extent build() { + org.tensorflow.proto.TensorSliceProto.Extent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto.Extent buildPartial() { + org.tensorflow.proto.TensorSliceProto.Extent result = new org.tensorflow.proto.TensorSliceProto.Extent(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TensorSliceProto.Extent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.start_ = start_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.TensorSliceProto.Extent result) { + result.hasLengthCase_ = hasLengthCase_; + result.hasLength_ = this.hasLength_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorSliceProto.Extent) { + return mergeFrom((org.tensorflow.proto.TensorSliceProto.Extent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorSliceProto.Extent other) { + if (other == org.tensorflow.proto.TensorSliceProto.Extent.getDefaultInstance()) return this; + if (other.getStart() != 0L) { + setStart(other.getStart()); + } + switch (other.getHasLengthCase()) { + case LENGTH: { + setLength(other.getLength()); + break; + } + case HASLENGTH_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + start_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + hasLength_ = input.readInt64(); + hasLengthCase_ = 2; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int hasLengthCase_ = 0; + private java.lang.Object hasLength_; + public HasLengthCase + getHasLengthCase() { + return HasLengthCase.forNumber( + hasLengthCase_); + } + + public Builder clearHasLength() { + hasLengthCase_ = 0; + hasLength_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private long start_ ; + /** + *
    +       * Start index of the slice, starting at 0.
    +       * 
    + * + * int64 start = 1; + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + /** + *
    +       * Start index of the slice, starting at 0.
    +       * 
    + * + * int64 start = 1; + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(long value) { + + start_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Start index of the slice, starting at 0.
    +       * 
    + * + * int64 start = 1; + * @return This builder for chaining. + */ + public Builder clearStart() { + bitField0_ = (bitField0_ & ~0x00000001); + start_ = 0L; + onChanged(); + return this; + } + + /** + * int64 length = 2; + * @return Whether the length field is set. + */ + public boolean hasLength() { + return hasLengthCase_ == 2; + } + /** + * int64 length = 2; + * @return The length. + */ + public long getLength() { + if (hasLengthCase_ == 2) { + return (java.lang.Long) hasLength_; + } + return 0L; + } + /** + * int64 length = 2; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLength(long value) { + + hasLengthCase_ = 2; + hasLength_ = value; + onChanged(); + return this; + } + /** + * int64 length = 2; + * @return This builder for chaining. + */ + public Builder clearLength() { + if (hasLengthCase_ == 2) { + hasLengthCase_ = 0; + hasLength_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorSliceProto.Extent) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorSliceProto.Extent) + private static final org.tensorflow.proto.TensorSliceProto.Extent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorSliceProto.Extent(); + } + + public static org.tensorflow.proto.TensorSliceProto.Extent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Extent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorSliceProto.Extent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int EXTENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List extent_; + /** + *
    +   * Extent of the slice in all tensor dimensions.
    +   *
    +   * Must have one entry for each of the dimension of the tensor that this
    +   * slice belongs to.  The order of sizes is the same as the order of
    +   * dimensions in the TensorShape.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + @java.lang.Override + public java.util.List getExtentList() { + return extent_; + } + /** + *
    +   * Extent of the slice in all tensor dimensions.
    +   *
    +   * Must have one entry for each of the dimension of the tensor that this
    +   * slice belongs to.  The order of sizes is the same as the order of
    +   * dimensions in the TensorShape.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + @java.lang.Override + public java.util.List + getExtentOrBuilderList() { + return extent_; + } + /** + *
    +   * Extent of the slice in all tensor dimensions.
    +   *
    +   * Must have one entry for each of the dimension of the tensor that this
    +   * slice belongs to.  The order of sizes is the same as the order of
    +   * dimensions in the TensorShape.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + @java.lang.Override + public int getExtentCount() { + return extent_.size(); + } + /** + *
    +   * Extent of the slice in all tensor dimensions.
    +   *
    +   * Must have one entry for each of the dimension of the tensor that this
    +   * slice belongs to.  The order of sizes is the same as the order of
    +   * dimensions in the TensorShape.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto.Extent getExtent(int index) { + return extent_.get(index); + } + /** + *
    +   * Extent of the slice in all tensor dimensions.
    +   *
    +   * Must have one entry for each of the dimension of the tensor that this
    +   * slice belongs to.  The order of sizes is the same as the order of
    +   * dimensions in the TensorShape.
    +   * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder( + int index) { + return extent_.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 { + for (int i = 0; i < extent_.size(); i++) { + output.writeMessage(1, extent_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < extent_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, extent_.get(i)); + } + size += getUnknownFields().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.TensorSliceProto)) { + return super.equals(obj); + } + org.tensorflow.proto.TensorSliceProto other = (org.tensorflow.proto.TensorSliceProto) obj; + + if (!getExtentList() + .equals(other.getExtentList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExtentCount() > 0) { + hash = (37 * hash) + EXTENT_FIELD_NUMBER; + hash = (53 * hash) + getExtentList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TensorSliceProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto 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.TensorSliceProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto 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.TensorSliceProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TensorSliceProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TensorSliceProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorSliceProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TensorSliceProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TensorSliceProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TensorSliceProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TensorSliceProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TensorSliceProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Can only be interpreted if you know the corresponding TensorShape.
    +   * 
    + * + * Protobuf type {@code tensorflow.TensorSliceProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TensorSliceProto) + org.tensorflow.proto.TensorSliceProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TensorSliceProto.class, org.tensorflow.proto.TensorSliceProto.Builder.class); + } + + // Construct using org.tensorflow.proto.TensorSliceProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (extentBuilder_ == null) { + extent_ = java.util.Collections.emptyList(); + } else { + extent_ = null; + extentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorSliceProtos.internal_static_tensorflow_TensorSliceProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto getDefaultInstanceForType() { + return org.tensorflow.proto.TensorSliceProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto build() { + org.tensorflow.proto.TensorSliceProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TensorSliceProto buildPartial() { + org.tensorflow.proto.TensorSliceProto result = new org.tensorflow.proto.TensorSliceProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TensorSliceProto result) { + if (extentBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + extent_ = java.util.Collections.unmodifiableList(extent_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.extent_ = extent_; + } else { + result.extent_ = extentBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TensorSliceProto result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TensorSliceProto) { + return mergeFrom((org.tensorflow.proto.TensorSliceProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TensorSliceProto other) { + if (other == org.tensorflow.proto.TensorSliceProto.getDefaultInstance()) return this; + if (extentBuilder_ == null) { + if (!other.extent_.isEmpty()) { + if (extent_.isEmpty()) { + extent_ = other.extent_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExtentIsMutable(); + extent_.addAll(other.extent_); + } + onChanged(); + } + } else { + if (!other.extent_.isEmpty()) { + if (extentBuilder_.isEmpty()) { + extentBuilder_.dispose(); + extentBuilder_ = null; + extent_ = other.extent_; + bitField0_ = (bitField0_ & ~0x00000001); + extentBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getExtentFieldBuilder() : null; + } else { + extentBuilder_.addAllMessages(other.extent_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TensorSliceProto.Extent m = + input.readMessage( + org.tensorflow.proto.TensorSliceProto.Extent.parser(), + extensionRegistry); + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + extent_.add(m); + } else { + extentBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List extent_ = + java.util.Collections.emptyList(); + private void ensureExtentIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + extent_ = new java.util.ArrayList(extent_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto.Extent, org.tensorflow.proto.TensorSliceProto.Extent.Builder, org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder> extentBuilder_; + + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public java.util.List getExtentList() { + if (extentBuilder_ == null) { + return java.util.Collections.unmodifiableList(extent_); + } else { + return extentBuilder_.getMessageList(); + } + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public int getExtentCount() { + if (extentBuilder_ == null) { + return extent_.size(); + } else { + return extentBuilder_.getCount(); + } + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public org.tensorflow.proto.TensorSliceProto.Extent getExtent(int index) { + if (extentBuilder_ == null) { + return extent_.get(index); + } else { + return extentBuilder_.getMessage(index); + } + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder setExtent( + int index, org.tensorflow.proto.TensorSliceProto.Extent value) { + if (extentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtentIsMutable(); + extent_.set(index, value); + onChanged(); + } else { + extentBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder setExtent( + int index, org.tensorflow.proto.TensorSliceProto.Extent.Builder builderForValue) { + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + extent_.set(index, builderForValue.build()); + onChanged(); + } else { + extentBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder addExtent(org.tensorflow.proto.TensorSliceProto.Extent value) { + if (extentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtentIsMutable(); + extent_.add(value); + onChanged(); + } else { + extentBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder addExtent( + int index, org.tensorflow.proto.TensorSliceProto.Extent value) { + if (extentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtentIsMutable(); + extent_.add(index, value); + onChanged(); + } else { + extentBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder addExtent( + org.tensorflow.proto.TensorSliceProto.Extent.Builder builderForValue) { + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + extent_.add(builderForValue.build()); + onChanged(); + } else { + extentBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder addExtent( + int index, org.tensorflow.proto.TensorSliceProto.Extent.Builder builderForValue) { + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + extent_.add(index, builderForValue.build()); + onChanged(); + } else { + extentBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder addAllExtent( + java.lang.Iterable values) { + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, extent_); + onChanged(); + } else { + extentBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder clearExtent() { + if (extentBuilder_ == null) { + extent_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + extentBuilder_.clear(); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public Builder removeExtent(int index) { + if (extentBuilder_ == null) { + ensureExtentIsMutable(); + extent_.remove(index); + onChanged(); + } else { + extentBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public org.tensorflow.proto.TensorSliceProto.Extent.Builder getExtentBuilder( + int index) { + return getExtentFieldBuilder().getBuilder(index); + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder( + int index) { + if (extentBuilder_ == null) { + return extent_.get(index); } else { + return extentBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public java.util.List + getExtentOrBuilderList() { + if (extentBuilder_ != null) { + return extentBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extent_); + } + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public org.tensorflow.proto.TensorSliceProto.Extent.Builder addExtentBuilder() { + return getExtentFieldBuilder().addBuilder( + org.tensorflow.proto.TensorSliceProto.Extent.getDefaultInstance()); + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public org.tensorflow.proto.TensorSliceProto.Extent.Builder addExtentBuilder( + int index) { + return getExtentFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorSliceProto.Extent.getDefaultInstance()); + } + /** + *
    +     * Extent of the slice in all tensor dimensions.
    +     *
    +     * Must have one entry for each of the dimension of the tensor that this
    +     * slice belongs to.  The order of sizes is the same as the order of
    +     * dimensions in the TensorShape.
    +     * 
    + * + * repeated .tensorflow.TensorSliceProto.Extent extent = 1; + */ + public java.util.List + getExtentBuilderList() { + return getExtentFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto.Extent, org.tensorflow.proto.TensorSliceProto.Extent.Builder, org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder> + getExtentFieldBuilder() { + if (extentBuilder_ == null) { + extentBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorSliceProto.Extent, org.tensorflow.proto.TensorSliceProto.Extent.Builder, org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder>( + extent_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + extent_ = null; + } + return extentBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TensorSliceProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TensorSliceProto) + private static final org.tensorflow.proto.TensorSliceProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TensorSliceProto(); + } + + public static org.tensorflow.proto.TensorSliceProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorSliceProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TensorSliceProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtoOrBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtoOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtoOrBuilder.java index 187cbc4962f..c288cadbbf0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/TensorSliceProtoOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtoOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/tensor_slice.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface TensorSliceProtoOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.TensorSliceProto) @@ -10,6 +12,7 @@ public interface TensorSliceProtoOrBuilder extends /** *
        * Extent of the slice in all tensor dimensions.
    +   *
        * Must have one entry for each of the dimension of the tensor that this
        * slice belongs to.  The order of sizes is the same as the order of
        * dimensions in the TensorShape.
    @@ -17,11 +20,12 @@ public interface TensorSliceProtoOrBuilder extends
        *
        * repeated .tensorflow.TensorSliceProto.Extent extent = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getExtentList();
       /**
        * 
        * Extent of the slice in all tensor dimensions.
    +   *
        * Must have one entry for each of the dimension of the tensor that this
        * slice belongs to.  The order of sizes is the same as the order of
        * dimensions in the TensorShape.
    @@ -29,10 +33,11 @@ public interface TensorSliceProtoOrBuilder extends
        *
        * repeated .tensorflow.TensorSliceProto.Extent extent = 1;
        */
    -  org.tensorflow.proto.framework.TensorSliceProto.Extent getExtent(int index);
    +  org.tensorflow.proto.TensorSliceProto.Extent getExtent(int index);
       /**
        * 
        * Extent of the slice in all tensor dimensions.
    +   *
        * Must have one entry for each of the dimension of the tensor that this
        * slice belongs to.  The order of sizes is the same as the order of
        * dimensions in the TensorShape.
    @@ -44,6 +49,7 @@ public interface TensorSliceProtoOrBuilder extends
       /**
        * 
        * Extent of the slice in all tensor dimensions.
    +   *
        * Must have one entry for each of the dimension of the tensor that this
        * slice belongs to.  The order of sizes is the same as the order of
        * dimensions in the TensorShape.
    @@ -51,11 +57,12 @@ public interface TensorSliceProtoOrBuilder extends
        *
        * repeated .tensorflow.TensorSliceProto.Extent extent = 1;
        */
    -  java.util.List 
    +  java.util.List 
           getExtentOrBuilderList();
       /**
        * 
        * Extent of the slice in all tensor dimensions.
    +   *
        * Must have one entry for each of the dimension of the tensor that this
        * slice belongs to.  The order of sizes is the same as the order of
        * dimensions in the TensorShape.
    @@ -63,6 +70,6 @@ public interface TensorSliceProtoOrBuilder extends
        *
        * repeated .tensorflow.TensorSliceProto.Extent extent = 1;
        */
    -  org.tensorflow.proto.framework.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder(
    +  org.tensorflow.proto.TensorSliceProto.ExtentOrBuilder getExtentOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtos.java
    new file mode 100644
    index 00000000000..fbbde962a98
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TensorSliceProtos.java
    @@ -0,0 +1,77 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/tensor_slice.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class TensorSliceProtos {
    +  private TensorSliceProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      TensorSliceProtos.class.getName());
    +  }
    +  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_TensorSliceProto_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_TensorSliceProto_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_TensorSliceProto_Extent_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_TensorSliceProto_Extent_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/framework/tensor_slice" +
    +      ".proto\022\ntensorflow\"\200\001\n\020TensorSliceProto\022" +
    +      "3\n\006extent\030\001 \003(\0132#.tensorflow.TensorSlice" +
    +      "Proto.Extent\0327\n\006Extent\022\r\n\005start\030\001 \001(\003\022\020\n" +
    +      "\006length\030\002 \001(\003H\000B\014\n\nhas_lengthB\203\001\n\024org.te" +
    +      "nsorflow.protoB\021TensorSliceProtosP\001ZSgit" +
    +      "hub.com/tensorflow/tensorflow/tensorflow" +
    +      "/go/core/framework/tensor_slice_go_proto" +
    +      "\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +        });
    +    internal_static_tensorflow_TensorSliceProto_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_TensorSliceProto_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_TensorSliceProto_descriptor,
    +        new java.lang.String[] { "Extent", });
    +    internal_static_tensorflow_TensorSliceProto_Extent_descriptor =
    +      internal_static_tensorflow_TensorSliceProto_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_TensorSliceProto_Extent_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_TensorSliceProto_Extent_descriptor,
    +        new java.lang.String[] { "Start", "Length", "HasLength", });
    +    descriptor.resolveAllFeaturesImmutable();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestLogProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestLogProtos.java
    new file mode 100644
    index 00000000000..4e6ef7c4896
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestLogProtos.java
    @@ -0,0 +1,299 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/test_log.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public final class TestLogProtos {
    +  private TestLogProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      TestLogProtos.class.getName());
    +  }
    +  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_EntryValue_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_EntryValue_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_MetricEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_MetricEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_BenchmarkEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_BenchmarkEntries_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_BuildConfiguration_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_BuildConfiguration_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_CommitId_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_CommitId_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_CPUInfo_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_CPUInfo_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_CPUInfo_CacheSizeEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_MemoryInfo_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_MemoryInfo_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_GPUInfo_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_GPUInfo_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_PlatformInfo_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_PlatformInfo_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_AvailableDeviceInfo_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_MachineConfiguration_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_MachineConfiguration_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_RunConfiguration_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_RunConfiguration_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_RunConfiguration_EnvVarsEntry_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_TestResults_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_TestResults_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\037xla/tsl/protobuf/test_log.proto\022\ntenso" +
    +      "rflow\032\031google/protobuf/any.proto\032\036google" +
    +      "/protobuf/wrappers.proto\"D\n\nEntryValue\022\026" +
    +      "\n\014double_value\030\001 \001(\001H\000\022\026\n\014string_value\030\002" +
    +      " \001(\tH\000B\006\n\004kind\"\214\001\n\013MetricEntry\022\014\n\004name\030\001" +
    +      " \001(\t\022\r\n\005value\030\002 \001(\001\022/\n\tmin_value\030\003 \001(\0132\034" +
    +      ".google.protobuf.DoubleValue\022/\n\tmax_valu" +
    +      "e\030\004 \001(\0132\034.google.protobuf.DoubleValue\"\217\002" +
    +      "\n\016BenchmarkEntry\022\014\n\004name\030\001 \001(\t\022\r\n\005iters\030" +
    +      "\002 \001(\003\022\020\n\010cpu_time\030\003 \001(\001\022\021\n\twall_time\030\004 \001" +
    +      "(\001\022\022\n\nthroughput\030\005 \001(\001\0226\n\006extras\030\006 \003(\0132&" +
    +      ".tensorflow.BenchmarkEntry.ExtrasEntry\022(" +
    +      "\n\007metrics\030\007 \003(\0132\027.tensorflow.MetricEntry" +
    +      "\032E\n\013ExtrasEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 " +
    +      "\001(\0132\026.tensorflow.EntryValue:\0028\001\"=\n\020Bench" +
    +      "markEntries\022)\n\005entry\030\001 \003(\0132\032.tensorflow." +
    +      "BenchmarkEntry\"B\n\022BuildConfiguration\022\014\n\004" +
    +      "mode\030\001 \001(\t\022\020\n\010cc_flags\030\002 \003(\t\022\014\n\004opts\030\003 \003" +
    +      "(\t\"f\n\010CommitId\022\024\n\nchangelist\030\001 \001(\003H\000\022\016\n\004" +
    +      "hash\030\002 \001(\tH\000\022\020\n\010snapshot\030\003 \001(\t\022\032\n\022pendin" +
    +      "g_changelist\030\004 \001(\003B\006\n\004kind\"\336\001\n\007CPUInfo\022\021" +
    +      "\n\tnum_cores\030\001 \001(\003\022\031\n\021num_cores_allowed\030\002" +
    +      " \001(\003\022\023\n\013mhz_per_cpu\030\003 \001(\001\022\020\n\010cpu_info\030\004 " +
    +      "\001(\t\022\024\n\014cpu_governor\030\005 \001(\t\0226\n\ncache_size\030" +
    +      "\006 \003(\0132\".tensorflow.CPUInfo.CacheSizeEntr" +
    +      "y\0320\n\016CacheSizeEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" +
    +      "e\030\002 \001(\003:\0028\001\".\n\nMemoryInfo\022\r\n\005total\030\001 \001(\003" +
    +      "\022\021\n\tavailable\030\002 \001(\003\"6\n\007GPUInfo\022\r\n\005model\030" +
    +      "\001 \001(\t\022\014\n\004uuid\030\002 \001(\t\022\016\n\006bus_id\030\003 \001(\t\"p\n\014P" +
    +      "latformInfo\022\014\n\004bits\030\001 \001(\t\022\017\n\007linkage\030\002 \001" +
    +      "(\t\022\017\n\007machine\030\003 \001(\t\022\017\n\007release\030\004 \001(\t\022\016\n\006" +
    +      "system\030\005 \001(\t\022\017\n\007version\030\006 \001(\t\"e\n\023Availab" +
    +      "leDeviceInfo\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t" +
    +      "\022\024\n\014memory_limit\030\003 \001(\003\022\034\n\024physical_descr" +
    +      "iption\030\004 \001(\t\"\263\002\n\024MachineConfiguration\022\020\n" +
    +      "\010hostname\030\001 \001(\t\022\031\n\021serial_identifier\030\007 \001" +
    +      "(\t\022/\n\rplatform_info\030\002 \001(\0132\030.tensorflow.P" +
    +      "latformInfo\022%\n\010cpu_info\030\003 \001(\0132\023.tensorfl" +
    +      "ow.CPUInfo\022)\n\013device_info\030\004 \003(\0132\024.google" +
    +      ".protobuf.Any\022>\n\025available_device_info\030\005" +
    +      " \003(\0132\037.tensorflow.AvailableDeviceInfo\022+\n" +
    +      "\013memory_info\030\006 \001(\0132\026.tensorflow.MemoryIn" +
    +      "fo\"\221\001\n\020RunConfiguration\022\020\n\010argument\030\001 \003(" +
    +      "\t\022;\n\010env_vars\030\002 \003(\0132).tensorflow.RunConf" +
    +      "iguration.EnvVarsEntry\032.\n\014EnvVarsEntry\022\013" +
    +      "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\320\004\n\013TestR" +
    +      "esults\022\016\n\006target\030\001 \001(\t\022-\n\007entries\030\002 \001(\0132" +
    +      "\034.tensorflow.BenchmarkEntries\022;\n\023build_c" +
    +      "onfiguration\030\003 \001(\0132\036.tensorflow.BuildCon" +
    +      "figuration\022\'\n\tcommit_id\030\004 \001(\0132\024.tensorfl" +
    +      "ow.CommitId\022\022\n\nstart_time\030\005 \001(\003\022\020\n\010run_t" +
    +      "ime\030\006 \001(\001\022?\n\025machine_configuration\030\007 \001(\013" +
    +      "2 .tensorflow.MachineConfiguration\0227\n\021ru" +
    +      "n_configuration\030\010 \001(\0132\034.tensorflow.RunCo" +
    +      "nfiguration\022\014\n\004name\030\t \001(\t\022=\n\016benchmark_t" +
    +      "ype\030\n \001(\0162%.tensorflow.TestResults.Bench" +
    +      "markType\022\020\n\010run_mode\030\013 \001(\t\022\022\n\ntf_version" +
    +      "\030\014 \001(\t\"\210\001\n\rBenchmarkType\022\013\n\007UNKNOWN\020\000\022\026\n" +
    +      "\022CPP_MICROBENCHMARK\020\001\022\024\n\020PYTHON_BENCHMAR" +
    +      "K\020\002\022\025\n\021ANDROID_BENCHMARK\020\003\022\022\n\016EDGE_BENCH" +
    +      "MARK\020\004\022\021\n\rIOS_BENCHMARK\020\005B*\n\024org.tensorf" +
    +      "low.protoB\rTestLogProtosP\001\370\001\001b\006proto3"
    +    };
    +    descriptor = com.google.protobuf.Descriptors.FileDescriptor
    +      .internalBuildGeneratedFileFrom(descriptorData,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          com.google.protobuf.AnyProto.getDescriptor(),
    +          com.google.protobuf.WrappersProto.getDescriptor(),
    +        });
    +    internal_static_tensorflow_EntryValue_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_EntryValue_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_EntryValue_descriptor,
    +        new java.lang.String[] { "DoubleValue", "StringValue", "Kind", });
    +    internal_static_tensorflow_MetricEntry_descriptor =
    +      getDescriptor().getMessageTypes().get(1);
    +    internal_static_tensorflow_MetricEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_MetricEntry_descriptor,
    +        new java.lang.String[] { "Name", "Value", "MinValue", "MaxValue", });
    +    internal_static_tensorflow_BenchmarkEntry_descriptor =
    +      getDescriptor().getMessageTypes().get(2);
    +    internal_static_tensorflow_BenchmarkEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_BenchmarkEntry_descriptor,
    +        new java.lang.String[] { "Name", "Iters", "CpuTime", "WallTime", "Throughput", "Extras", "Metrics", });
    +    internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor =
    +      internal_static_tensorflow_BenchmarkEntry_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_BenchmarkEntry_ExtrasEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    internal_static_tensorflow_BenchmarkEntries_descriptor =
    +      getDescriptor().getMessageTypes().get(3);
    +    internal_static_tensorflow_BenchmarkEntries_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_BenchmarkEntries_descriptor,
    +        new java.lang.String[] { "Entry", });
    +    internal_static_tensorflow_BuildConfiguration_descriptor =
    +      getDescriptor().getMessageTypes().get(4);
    +    internal_static_tensorflow_BuildConfiguration_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_BuildConfiguration_descriptor,
    +        new java.lang.String[] { "Mode", "CcFlags", "Opts", });
    +    internal_static_tensorflow_CommitId_descriptor =
    +      getDescriptor().getMessageTypes().get(5);
    +    internal_static_tensorflow_CommitId_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_CommitId_descriptor,
    +        new java.lang.String[] { "Changelist", "Hash", "Snapshot", "PendingChangelist", "Kind", });
    +    internal_static_tensorflow_CPUInfo_descriptor =
    +      getDescriptor().getMessageTypes().get(6);
    +    internal_static_tensorflow_CPUInfo_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_CPUInfo_descriptor,
    +        new java.lang.String[] { "NumCores", "NumCoresAllowed", "MhzPerCpu", "CpuInfo", "CpuGovernor", "CacheSize", });
    +    internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor =
    +      internal_static_tensorflow_CPUInfo_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_CPUInfo_CacheSizeEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_CPUInfo_CacheSizeEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    internal_static_tensorflow_MemoryInfo_descriptor =
    +      getDescriptor().getMessageTypes().get(7);
    +    internal_static_tensorflow_MemoryInfo_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_MemoryInfo_descriptor,
    +        new java.lang.String[] { "Total", "Available", });
    +    internal_static_tensorflow_GPUInfo_descriptor =
    +      getDescriptor().getMessageTypes().get(8);
    +    internal_static_tensorflow_GPUInfo_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_GPUInfo_descriptor,
    +        new java.lang.String[] { "Model", "Uuid", "BusId", });
    +    internal_static_tensorflow_PlatformInfo_descriptor =
    +      getDescriptor().getMessageTypes().get(9);
    +    internal_static_tensorflow_PlatformInfo_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_PlatformInfo_descriptor,
    +        new java.lang.String[] { "Bits", "Linkage", "Machine", "Release", "System", "Version", });
    +    internal_static_tensorflow_AvailableDeviceInfo_descriptor =
    +      getDescriptor().getMessageTypes().get(10);
    +    internal_static_tensorflow_AvailableDeviceInfo_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_AvailableDeviceInfo_descriptor,
    +        new java.lang.String[] { "Name", "Type", "MemoryLimit", "PhysicalDescription", });
    +    internal_static_tensorflow_MachineConfiguration_descriptor =
    +      getDescriptor().getMessageTypes().get(11);
    +    internal_static_tensorflow_MachineConfiguration_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_MachineConfiguration_descriptor,
    +        new java.lang.String[] { "Hostname", "SerialIdentifier", "PlatformInfo", "CpuInfo", "DeviceInfo", "AvailableDeviceInfo", "MemoryInfo", });
    +    internal_static_tensorflow_RunConfiguration_descriptor =
    +      getDescriptor().getMessageTypes().get(12);
    +    internal_static_tensorflow_RunConfiguration_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_RunConfiguration_descriptor,
    +        new java.lang.String[] { "Argument", "EnvVars", });
    +    internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor =
    +      internal_static_tensorflow_RunConfiguration_descriptor.getNestedTypes().get(0);
    +    internal_static_tensorflow_RunConfiguration_EnvVarsEntry_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_RunConfiguration_EnvVarsEntry_descriptor,
    +        new java.lang.String[] { "Key", "Value", });
    +    internal_static_tensorflow_TestResults_descriptor =
    +      getDescriptor().getMessageTypes().get(13);
    +    internal_static_tensorflow_TestResults_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_TestResults_descriptor,
    +        new java.lang.String[] { "Target", "Entries", "BuildConfiguration", "CommitId", "StartTime", "RunTime", "MachineConfiguration", "RunConfiguration", "Name", "BenchmarkType", "RunMode", "TfVersion", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    com.google.protobuf.AnyProto.getDescriptor();
    +    com.google.protobuf.WrappersProto.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResults.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResults.java
    new file mode 100644
    index 00000000000..673f570f56a
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResults.java
    @@ -0,0 +1,2682 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/test_log.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * The output of one benchmark / test run.  Each run contains a list of
    + * tests or benchmarks, stored as BenchmarkEntry messages.
    + *
    + * This message should be emitted by the reporter (which runs the
    + * test / BM in a subprocess and then reads the emitted BenchmarkEntry messages;
    + * usually from a serialized json file, finally collecting them along
    + * with additional information about the test run.
    + * 
    + * + * Protobuf type {@code tensorflow.TestResults} + */ +public final class TestResults extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TestResults) + TestResultsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TestResults.class.getName()); + } + // Use TestResults.newBuilder() to construct. + private TestResults(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TestResults() { + target_ = ""; + name_ = ""; + benchmarkType_ = 0; + runMode_ = ""; + tfVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_TestResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TestResults.class, org.tensorflow.proto.TestResults.Builder.class); + } + + /** + *
    +   * The type of benchmark.
    +   * 
    + * + * Protobuf enum {@code tensorflow.TestResults.BenchmarkType} + */ + public enum BenchmarkType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * Fallback for protos written before Type was introduced.
    +     * 
    + * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * CPP_MICROBENCHMARK = 1; + */ + CPP_MICROBENCHMARK(1), + /** + * PYTHON_BENCHMARK = 2; + */ + PYTHON_BENCHMARK(2), + /** + * ANDROID_BENCHMARK = 3; + */ + ANDROID_BENCHMARK(3), + /** + * EDGE_BENCHMARK = 4; + */ + EDGE_BENCHMARK(4), + /** + * IOS_BENCHMARK = 5; + */ + IOS_BENCHMARK(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + BenchmarkType.class.getName()); + } + /** + *
    +     * Fallback for protos written before Type was introduced.
    +     * 
    + * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * CPP_MICROBENCHMARK = 1; + */ + public static final int CPP_MICROBENCHMARK_VALUE = 1; + /** + * PYTHON_BENCHMARK = 2; + */ + public static final int PYTHON_BENCHMARK_VALUE = 2; + /** + * ANDROID_BENCHMARK = 3; + */ + public static final int ANDROID_BENCHMARK_VALUE = 3; + /** + * EDGE_BENCHMARK = 4; + */ + public static final int EDGE_BENCHMARK_VALUE = 4; + /** + * IOS_BENCHMARK = 5; + */ + public static final int IOS_BENCHMARK_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BenchmarkType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BenchmarkType forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return CPP_MICROBENCHMARK; + case 2: return PYTHON_BENCHMARK; + case 3: return ANDROID_BENCHMARK; + case 4: return EDGE_BENCHMARK; + case 5: return IOS_BENCHMARK; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BenchmarkType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BenchmarkType findValueByNumber(int number) { + return BenchmarkType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.TestResults.getDescriptor().getEnumTypes().get(0); + } + + private static final BenchmarkType[] VALUES = values(); + + public static BenchmarkType 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 BenchmarkType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.TestResults.BenchmarkType) + } + + private int bitField0_; + public static final int TARGET_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + *
    +   * The target of the run, e.g.:
    +   * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +   * 
    + * + * string target = 1; + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + *
    +   * The target of the run, e.g.:
    +   * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +   * 
    + * + * string target = 1; + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 2; + private org.tensorflow.proto.BenchmarkEntries entries_; + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return Whether the entries field is set. + */ + @java.lang.Override + public boolean hasEntries() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return The entries. + */ + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntries getEntries() { + return entries_ == null ? org.tensorflow.proto.BenchmarkEntries.getDefaultInstance() : entries_; + } + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + @java.lang.Override + public org.tensorflow.proto.BenchmarkEntriesOrBuilder getEntriesOrBuilder() { + return entries_ == null ? org.tensorflow.proto.BenchmarkEntries.getDefaultInstance() : entries_; + } + + public static final int BUILD_CONFIGURATION_FIELD_NUMBER = 3; + private org.tensorflow.proto.BuildConfiguration buildConfiguration_; + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return Whether the buildConfiguration field is set. + */ + @java.lang.Override + public boolean hasBuildConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return The buildConfiguration. + */ + @java.lang.Override + public org.tensorflow.proto.BuildConfiguration getBuildConfiguration() { + return buildConfiguration_ == null ? org.tensorflow.proto.BuildConfiguration.getDefaultInstance() : buildConfiguration_; + } + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + @java.lang.Override + public org.tensorflow.proto.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder() { + return buildConfiguration_ == null ? org.tensorflow.proto.BuildConfiguration.getDefaultInstance() : buildConfiguration_; + } + + public static final int COMMIT_ID_FIELD_NUMBER = 4; + private org.tensorflow.proto.CommitId commitId_; + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return Whether the commitId field is set. + */ + @java.lang.Override + public boolean hasCommitId() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return The commitId. + */ + @java.lang.Override + public org.tensorflow.proto.CommitId getCommitId() { + return commitId_ == null ? org.tensorflow.proto.CommitId.getDefaultInstance() : commitId_; + } + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + @java.lang.Override + public org.tensorflow.proto.CommitIdOrBuilder getCommitIdOrBuilder() { + return commitId_ == null ? org.tensorflow.proto.CommitId.getDefaultInstance() : commitId_; + } + + public static final int START_TIME_FIELD_NUMBER = 5; + private long startTime_ = 0L; + /** + *
    +   * The time the run started (in seconds of UTC time since Unix epoch)
    +   * 
    + * + * int64 start_time = 5; + * @return The startTime. + */ + @java.lang.Override + public long getStartTime() { + return startTime_; + } + + public static final int RUN_TIME_FIELD_NUMBER = 6; + private double runTime_ = 0D; + /** + *
    +   * The amount of time the total run took (wall time in seconds)
    +   * 
    + * + * double run_time = 6; + * @return The runTime. + */ + @java.lang.Override + public double getRunTime() { + return runTime_; + } + + public static final int MACHINE_CONFIGURATION_FIELD_NUMBER = 7; + private org.tensorflow.proto.MachineConfiguration machineConfiguration_; + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return Whether the machineConfiguration field is set. + */ + @java.lang.Override + public boolean hasMachineConfiguration() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return The machineConfiguration. + */ + @java.lang.Override + public org.tensorflow.proto.MachineConfiguration getMachineConfiguration() { + return machineConfiguration_ == null ? org.tensorflow.proto.MachineConfiguration.getDefaultInstance() : machineConfiguration_; + } + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + @java.lang.Override + public org.tensorflow.proto.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder() { + return machineConfiguration_ == null ? org.tensorflow.proto.MachineConfiguration.getDefaultInstance() : machineConfiguration_; + } + + public static final int RUN_CONFIGURATION_FIELD_NUMBER = 8; + private org.tensorflow.proto.RunConfiguration runConfiguration_; + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return Whether the runConfiguration field is set. + */ + @java.lang.Override + public boolean hasRunConfiguration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return The runConfiguration. + */ + @java.lang.Override + public org.tensorflow.proto.RunConfiguration getRunConfiguration() { + return runConfiguration_ == null ? org.tensorflow.proto.RunConfiguration.getDefaultInstance() : runConfiguration_; + } + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + @java.lang.Override + public org.tensorflow.proto.RunConfigurationOrBuilder getRunConfigurationOrBuilder() { + return runConfiguration_ == null ? org.tensorflow.proto.RunConfiguration.getDefaultInstance() : runConfiguration_; + } + + public static final int NAME_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +   * Benchmark target identifier.
    +   * 
    + * + * string name = 9; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Benchmark target identifier.
    +   * 
    + * + * string name = 9; + * @return The bytes for name. + */ + @java.lang.Override + 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 BENCHMARK_TYPE_FIELD_NUMBER = 10; + private int benchmarkType_ = 0; + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The enum numeric value on the wire for benchmarkType. + */ + @java.lang.Override public int getBenchmarkTypeValue() { + return benchmarkType_; + } + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The benchmarkType. + */ + @java.lang.Override public org.tensorflow.proto.TestResults.BenchmarkType getBenchmarkType() { + org.tensorflow.proto.TestResults.BenchmarkType result = org.tensorflow.proto.TestResults.BenchmarkType.forNumber(benchmarkType_); + return result == null ? org.tensorflow.proto.TestResults.BenchmarkType.UNRECOGNIZED : result; + } + + public static final int RUN_MODE_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private volatile java.lang.Object runMode_ = ""; + /** + *
    +   * Used for differentiating between continuous and debug builds.
    +   * Must be one of:
    +   * * cbuild: results from continuous build.
    +   * * presubmit: results from oneshot requests.
    +   * * culprit: results from culprit finder rerun.
    +   * 
    + * + * string run_mode = 11; + * @return The runMode. + */ + @java.lang.Override + public java.lang.String getRunMode() { + java.lang.Object ref = runMode_; + 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(); + runMode_ = s; + return s; + } + } + /** + *
    +   * Used for differentiating between continuous and debug builds.
    +   * Must be one of:
    +   * * cbuild: results from continuous build.
    +   * * presubmit: results from oneshot requests.
    +   * * culprit: results from culprit finder rerun.
    +   * 
    + * + * string run_mode = 11; + * @return The bytes for runMode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRunModeBytes() { + java.lang.Object ref = runMode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + runMode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TF_VERSION_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private volatile java.lang.Object tfVersion_ = ""; + /** + *
    +   * TensorFlow version this benchmark runs against.
    +   * This can be either set to full version or just the major version.
    +   * 
    + * + * string tf_version = 12; + * @return The tfVersion. + */ + @java.lang.Override + public java.lang.String getTfVersion() { + java.lang.Object ref = tfVersion_; + 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(); + tfVersion_ = s; + return s; + } + } + /** + *
    +   * TensorFlow version this benchmark runs against.
    +   * This can be either set to full version or just the major version.
    +   * 
    + * + * string tf_version = 12; + * @return The bytes for tfVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTfVersionBytes() { + java.lang.Object ref = tfVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, target_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEntries()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getBuildConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getCommitId()); + } + if (startTime_ != 0L) { + output.writeInt64(5, startTime_); + } + if (java.lang.Double.doubleToRawLongBits(runTime_) != 0) { + output.writeDouble(6, runTime_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getMachineConfiguration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(8, getRunConfiguration()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, name_); + } + if (benchmarkType_ != org.tensorflow.proto.TestResults.BenchmarkType.UNKNOWN.getNumber()) { + output.writeEnum(10, benchmarkType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(runMode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, runMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, tfVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, target_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getEntries()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getBuildConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCommitId()); + } + if (startTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, startTime_); + } + if (java.lang.Double.doubleToRawLongBits(runTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(6, runTime_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getMachineConfiguration()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getRunConfiguration()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, name_); + } + if (benchmarkType_ != org.tensorflow.proto.TestResults.BenchmarkType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, benchmarkType_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(runMode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, runMode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tfVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, tfVersion_); + } + size += getUnknownFields().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.TestResults)) { + return super.equals(obj); + } + org.tensorflow.proto.TestResults other = (org.tensorflow.proto.TestResults) obj; + + if (!getTarget() + .equals(other.getTarget())) return false; + if (hasEntries() != other.hasEntries()) return false; + if (hasEntries()) { + if (!getEntries() + .equals(other.getEntries())) return false; + } + if (hasBuildConfiguration() != other.hasBuildConfiguration()) return false; + if (hasBuildConfiguration()) { + if (!getBuildConfiguration() + .equals(other.getBuildConfiguration())) return false; + } + if (hasCommitId() != other.hasCommitId()) return false; + if (hasCommitId()) { + if (!getCommitId() + .equals(other.getCommitId())) return false; + } + if (getStartTime() + != other.getStartTime()) return false; + if (java.lang.Double.doubleToLongBits(getRunTime()) + != java.lang.Double.doubleToLongBits( + other.getRunTime())) return false; + if (hasMachineConfiguration() != other.hasMachineConfiguration()) return false; + if (hasMachineConfiguration()) { + if (!getMachineConfiguration() + .equals(other.getMachineConfiguration())) return false; + } + if (hasRunConfiguration() != other.hasRunConfiguration()) return false; + if (hasRunConfiguration()) { + if (!getRunConfiguration() + .equals(other.getRunConfiguration())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (benchmarkType_ != other.benchmarkType_) return false; + if (!getRunMode() + .equals(other.getRunMode())) return false; + if (!getTfVersion() + .equals(other.getTfVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + if (hasEntries()) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntries().hashCode(); + } + if (hasBuildConfiguration()) { + hash = (37 * hash) + BUILD_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getBuildConfiguration().hashCode(); + } + if (hasCommitId()) { + hash = (37 * hash) + COMMIT_ID_FIELD_NUMBER; + hash = (53 * hash) + getCommitId().hashCode(); + } + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTime()); + hash = (37 * hash) + RUN_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRunTime())); + if (hasMachineConfiguration()) { + hash = (37 * hash) + MACHINE_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getMachineConfiguration().hashCode(); + } + if (hasRunConfiguration()) { + hash = (37 * hash) + RUN_CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getRunConfiguration().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + BENCHMARK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + benchmarkType_; + hash = (37 * hash) + RUN_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRunMode().hashCode(); + hash = (37 * hash) + TF_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getTfVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TestResults parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TestResults 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.TestResults parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TestResults 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.TestResults parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TestResults parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TestResults parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TestResults parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TestResults parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TestResults parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TestResults parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TestResults parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TestResults 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * The output of one benchmark / test run.  Each run contains a list of
    +   * tests or benchmarks, stored as BenchmarkEntry messages.
    +   *
    +   * This message should be emitted by the reporter (which runs the
    +   * test / BM in a subprocess and then reads the emitted BenchmarkEntry messages;
    +   * usually from a serialized json file, finally collecting them along
    +   * with additional information about the test run.
    +   * 
    + * + * Protobuf type {@code tensorflow.TestResults} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TestResults) + org.tensorflow.proto.TestResultsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_TestResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TestResults.class, org.tensorflow.proto.TestResults.Builder.class); + } + + // Construct using org.tensorflow.proto.TestResults.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + getBuildConfigurationFieldBuilder(); + getCommitIdFieldBuilder(); + getMachineConfigurationFieldBuilder(); + getRunConfigurationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + target_ = ""; + entries_ = null; + if (entriesBuilder_ != null) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + } + buildConfiguration_ = null; + if (buildConfigurationBuilder_ != null) { + buildConfigurationBuilder_.dispose(); + buildConfigurationBuilder_ = null; + } + commitId_ = null; + if (commitIdBuilder_ != null) { + commitIdBuilder_.dispose(); + commitIdBuilder_ = null; + } + startTime_ = 0L; + runTime_ = 0D; + machineConfiguration_ = null; + if (machineConfigurationBuilder_ != null) { + machineConfigurationBuilder_.dispose(); + machineConfigurationBuilder_ = null; + } + runConfiguration_ = null; + if (runConfigurationBuilder_ != null) { + runConfigurationBuilder_.dispose(); + runConfigurationBuilder_ = null; + } + name_ = ""; + benchmarkType_ = 0; + runMode_ = ""; + tfVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TestLogProtos.internal_static_tensorflow_TestResults_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TestResults getDefaultInstanceForType() { + return org.tensorflow.proto.TestResults.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TestResults build() { + org.tensorflow.proto.TestResults result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TestResults buildPartial() { + org.tensorflow.proto.TestResults result = new org.tensorflow.proto.TestResults(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TestResults result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.target_ = target_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.entries_ = entriesBuilder_ == null + ? entries_ + : entriesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.buildConfiguration_ = buildConfigurationBuilder_ == null + ? buildConfiguration_ + : buildConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.commitId_ = commitIdBuilder_ == null + ? commitId_ + : commitIdBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.startTime_ = startTime_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.runTime_ = runTime_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.machineConfiguration_ = machineConfigurationBuilder_ == null + ? machineConfiguration_ + : machineConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.runConfiguration_ = runConfigurationBuilder_ == null + ? runConfiguration_ + : runConfigurationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.benchmarkType_ = benchmarkType_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.runMode_ = runMode_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.tfVersion_ = tfVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TestResults) { + return mergeFrom((org.tensorflow.proto.TestResults)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TestResults other) { + if (other == org.tensorflow.proto.TestResults.getDefaultInstance()) return this; + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEntries()) { + mergeEntries(other.getEntries()); + } + if (other.hasBuildConfiguration()) { + mergeBuildConfiguration(other.getBuildConfiguration()); + } + if (other.hasCommitId()) { + mergeCommitId(other.getCommitId()); + } + if (other.getStartTime() != 0L) { + setStartTime(other.getStartTime()); + } + if (other.getRunTime() != 0D) { + setRunTime(other.getRunTime()); + } + if (other.hasMachineConfiguration()) { + mergeMachineConfiguration(other.getMachineConfiguration()); + } + if (other.hasRunConfiguration()) { + mergeRunConfiguration(other.getRunConfiguration()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.benchmarkType_ != 0) { + setBenchmarkTypeValue(other.getBenchmarkTypeValue()); + } + if (!other.getRunMode().isEmpty()) { + runMode_ = other.runMode_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getTfVersion().isEmpty()) { + tfVersion_ = other.tfVersion_; + bitField0_ |= 0x00000800; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getEntriesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getBuildConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getCommitIdFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + startTime_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 49: { + runTime_ = input.readDouble(); + bitField0_ |= 0x00000020; + break; + } // case 49 + case 58: { + input.readMessage( + getMachineConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + input.readMessage( + getRunConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: { + benchmarkType_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: { + runMode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: { + tfVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object target_ = ""; + /** + *
    +     * The target of the run, e.g.:
    +     * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +     * 
    + * + * string target = 1; + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The target of the run, e.g.:
    +     * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +     * 
    + * + * string target = 1; + * @return The bytes for target. + */ + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The target of the run, e.g.:
    +     * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +     * 
    + * + * string target = 1; + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The target of the run, e.g.:
    +     * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +     * 
    + * + * string target = 1; + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * The target of the run, e.g.:
    +     * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +     * 
    + * + * string target = 1; + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private org.tensorflow.proto.BenchmarkEntries entries_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BenchmarkEntries, org.tensorflow.proto.BenchmarkEntries.Builder, org.tensorflow.proto.BenchmarkEntriesOrBuilder> entriesBuilder_; + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return Whether the entries field is set. + */ + public boolean hasEntries() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return The entries. + */ + public org.tensorflow.proto.BenchmarkEntries getEntries() { + if (entriesBuilder_ == null) { + return entries_ == null ? org.tensorflow.proto.BenchmarkEntries.getDefaultInstance() : entries_; + } else { + return entriesBuilder_.getMessage(); + } + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public Builder setEntries(org.tensorflow.proto.BenchmarkEntries value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entries_ = value; + } else { + entriesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public Builder setEntries( + org.tensorflow.proto.BenchmarkEntries.Builder builderForValue) { + if (entriesBuilder_ == null) { + entries_ = builderForValue.build(); + } else { + entriesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public Builder mergeEntries(org.tensorflow.proto.BenchmarkEntries value) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + entries_ != null && + entries_ != org.tensorflow.proto.BenchmarkEntries.getDefaultInstance()) { + getEntriesBuilder().mergeFrom(value); + } else { + entries_ = value; + } + } else { + entriesBuilder_.mergeFrom(value); + } + if (entries_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public Builder clearEntries() { + bitField0_ = (bitField0_ & ~0x00000002); + entries_ = null; + if (entriesBuilder_ != null) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public org.tensorflow.proto.BenchmarkEntries.Builder getEntriesBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEntriesFieldBuilder().getBuilder(); + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + public org.tensorflow.proto.BenchmarkEntriesOrBuilder getEntriesOrBuilder() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilder(); + } else { + return entries_ == null ? + org.tensorflow.proto.BenchmarkEntries.getDefaultInstance() : entries_; + } + } + /** + *
    +     * The list of tests or benchmarks in this run.
    +     * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BenchmarkEntries, org.tensorflow.proto.BenchmarkEntries.Builder, org.tensorflow.proto.BenchmarkEntriesOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BenchmarkEntries, org.tensorflow.proto.BenchmarkEntries.Builder, org.tensorflow.proto.BenchmarkEntriesOrBuilder>( + getEntries(), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private org.tensorflow.proto.BuildConfiguration buildConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BuildConfiguration, org.tensorflow.proto.BuildConfiguration.Builder, org.tensorflow.proto.BuildConfigurationOrBuilder> buildConfigurationBuilder_; + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return Whether the buildConfiguration field is set. + */ + public boolean hasBuildConfiguration() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return The buildConfiguration. + */ + public org.tensorflow.proto.BuildConfiguration getBuildConfiguration() { + if (buildConfigurationBuilder_ == null) { + return buildConfiguration_ == null ? org.tensorflow.proto.BuildConfiguration.getDefaultInstance() : buildConfiguration_; + } else { + return buildConfigurationBuilder_.getMessage(); + } + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public Builder setBuildConfiguration(org.tensorflow.proto.BuildConfiguration value) { + if (buildConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildConfiguration_ = value; + } else { + buildConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public Builder setBuildConfiguration( + org.tensorflow.proto.BuildConfiguration.Builder builderForValue) { + if (buildConfigurationBuilder_ == null) { + buildConfiguration_ = builderForValue.build(); + } else { + buildConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public Builder mergeBuildConfiguration(org.tensorflow.proto.BuildConfiguration value) { + if (buildConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + buildConfiguration_ != null && + buildConfiguration_ != org.tensorflow.proto.BuildConfiguration.getDefaultInstance()) { + getBuildConfigurationBuilder().mergeFrom(value); + } else { + buildConfiguration_ = value; + } + } else { + buildConfigurationBuilder_.mergeFrom(value); + } + if (buildConfiguration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public Builder clearBuildConfiguration() { + bitField0_ = (bitField0_ & ~0x00000004); + buildConfiguration_ = null; + if (buildConfigurationBuilder_ != null) { + buildConfigurationBuilder_.dispose(); + buildConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public org.tensorflow.proto.BuildConfiguration.Builder getBuildConfigurationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBuildConfigurationFieldBuilder().getBuilder(); + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + public org.tensorflow.proto.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder() { + if (buildConfigurationBuilder_ != null) { + return buildConfigurationBuilder_.getMessageOrBuilder(); + } else { + return buildConfiguration_ == null ? + org.tensorflow.proto.BuildConfiguration.getDefaultInstance() : buildConfiguration_; + } + } + /** + *
    +     * The configuration of the build (compiled opt? with cuda? any copts?)
    +     * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BuildConfiguration, org.tensorflow.proto.BuildConfiguration.Builder, org.tensorflow.proto.BuildConfigurationOrBuilder> + getBuildConfigurationFieldBuilder() { + if (buildConfigurationBuilder_ == null) { + buildConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.BuildConfiguration, org.tensorflow.proto.BuildConfiguration.Builder, org.tensorflow.proto.BuildConfigurationOrBuilder>( + getBuildConfiguration(), + getParentForChildren(), + isClean()); + buildConfiguration_ = null; + } + return buildConfigurationBuilder_; + } + + private org.tensorflow.proto.CommitId commitId_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CommitId, org.tensorflow.proto.CommitId.Builder, org.tensorflow.proto.CommitIdOrBuilder> commitIdBuilder_; + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return Whether the commitId field is set. + */ + public boolean hasCommitId() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return The commitId. + */ + public org.tensorflow.proto.CommitId getCommitId() { + if (commitIdBuilder_ == null) { + return commitId_ == null ? org.tensorflow.proto.CommitId.getDefaultInstance() : commitId_; + } else { + return commitIdBuilder_.getMessage(); + } + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public Builder setCommitId(org.tensorflow.proto.CommitId value) { + if (commitIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commitId_ = value; + } else { + commitIdBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public Builder setCommitId( + org.tensorflow.proto.CommitId.Builder builderForValue) { + if (commitIdBuilder_ == null) { + commitId_ = builderForValue.build(); + } else { + commitIdBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public Builder mergeCommitId(org.tensorflow.proto.CommitId value) { + if (commitIdBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + commitId_ != null && + commitId_ != org.tensorflow.proto.CommitId.getDefaultInstance()) { + getCommitIdBuilder().mergeFrom(value); + } else { + commitId_ = value; + } + } else { + commitIdBuilder_.mergeFrom(value); + } + if (commitId_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public Builder clearCommitId() { + bitField0_ = (bitField0_ & ~0x00000008); + commitId_ = null; + if (commitIdBuilder_ != null) { + commitIdBuilder_.dispose(); + commitIdBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public org.tensorflow.proto.CommitId.Builder getCommitIdBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCommitIdFieldBuilder().getBuilder(); + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + public org.tensorflow.proto.CommitIdOrBuilder getCommitIdOrBuilder() { + if (commitIdBuilder_ != null) { + return commitIdBuilder_.getMessageOrBuilder(); + } else { + return commitId_ == null ? + org.tensorflow.proto.CommitId.getDefaultInstance() : commitId_; + } + } + /** + *
    +     * The commit id (git hash or changelist)
    +     * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CommitId, org.tensorflow.proto.CommitId.Builder, org.tensorflow.proto.CommitIdOrBuilder> + getCommitIdFieldBuilder() { + if (commitIdBuilder_ == null) { + commitIdBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.CommitId, org.tensorflow.proto.CommitId.Builder, org.tensorflow.proto.CommitIdOrBuilder>( + getCommitId(), + getParentForChildren(), + isClean()); + commitId_ = null; + } + return commitIdBuilder_; + } + + private long startTime_ ; + /** + *
    +     * The time the run started (in seconds of UTC time since Unix epoch)
    +     * 
    + * + * int64 start_time = 5; + * @return The startTime. + */ + @java.lang.Override + public long getStartTime() { + return startTime_; + } + /** + *
    +     * The time the run started (in seconds of UTC time since Unix epoch)
    +     * 
    + * + * int64 start_time = 5; + * @param value The startTime to set. + * @return This builder for chaining. + */ + public Builder setStartTime(long value) { + + startTime_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * The time the run started (in seconds of UTC time since Unix epoch)
    +     * 
    + * + * int64 start_time = 5; + * @return This builder for chaining. + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = 0L; + onChanged(); + return this; + } + + private double runTime_ ; + /** + *
    +     * The amount of time the total run took (wall time in seconds)
    +     * 
    + * + * double run_time = 6; + * @return The runTime. + */ + @java.lang.Override + public double getRunTime() { + return runTime_; + } + /** + *
    +     * The amount of time the total run took (wall time in seconds)
    +     * 
    + * + * double run_time = 6; + * @param value The runTime to set. + * @return This builder for chaining. + */ + public Builder setRunTime(double value) { + + runTime_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * The amount of time the total run took (wall time in seconds)
    +     * 
    + * + * double run_time = 6; + * @return This builder for chaining. + */ + public Builder clearRunTime() { + bitField0_ = (bitField0_ & ~0x00000020); + runTime_ = 0D; + onChanged(); + return this; + } + + private org.tensorflow.proto.MachineConfiguration machineConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MachineConfiguration, org.tensorflow.proto.MachineConfiguration.Builder, org.tensorflow.proto.MachineConfigurationOrBuilder> machineConfigurationBuilder_; + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return Whether the machineConfiguration field is set. + */ + public boolean hasMachineConfiguration() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return The machineConfiguration. + */ + public org.tensorflow.proto.MachineConfiguration getMachineConfiguration() { + if (machineConfigurationBuilder_ == null) { + return machineConfiguration_ == null ? org.tensorflow.proto.MachineConfiguration.getDefaultInstance() : machineConfiguration_; + } else { + return machineConfigurationBuilder_.getMessage(); + } + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public Builder setMachineConfiguration(org.tensorflow.proto.MachineConfiguration value) { + if (machineConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + machineConfiguration_ = value; + } else { + machineConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public Builder setMachineConfiguration( + org.tensorflow.proto.MachineConfiguration.Builder builderForValue) { + if (machineConfigurationBuilder_ == null) { + machineConfiguration_ = builderForValue.build(); + } else { + machineConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public Builder mergeMachineConfiguration(org.tensorflow.proto.MachineConfiguration value) { + if (machineConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + machineConfiguration_ != null && + machineConfiguration_ != org.tensorflow.proto.MachineConfiguration.getDefaultInstance()) { + getMachineConfigurationBuilder().mergeFrom(value); + } else { + machineConfiguration_ = value; + } + } else { + machineConfigurationBuilder_.mergeFrom(value); + } + if (machineConfiguration_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public Builder clearMachineConfiguration() { + bitField0_ = (bitField0_ & ~0x00000040); + machineConfiguration_ = null; + if (machineConfigurationBuilder_ != null) { + machineConfigurationBuilder_.dispose(); + machineConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public org.tensorflow.proto.MachineConfiguration.Builder getMachineConfigurationBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getMachineConfigurationFieldBuilder().getBuilder(); + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + public org.tensorflow.proto.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder() { + if (machineConfigurationBuilder_ != null) { + return machineConfigurationBuilder_.getMessageOrBuilder(); + } else { + return machineConfiguration_ == null ? + org.tensorflow.proto.MachineConfiguration.getDefaultInstance() : machineConfiguration_; + } + } + /** + *
    +     * Machine-specific parameters (Platform and CPU info)
    +     * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MachineConfiguration, org.tensorflow.proto.MachineConfiguration.Builder, org.tensorflow.proto.MachineConfigurationOrBuilder> + getMachineConfigurationFieldBuilder() { + if (machineConfigurationBuilder_ == null) { + machineConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.MachineConfiguration, org.tensorflow.proto.MachineConfiguration.Builder, org.tensorflow.proto.MachineConfigurationOrBuilder>( + getMachineConfiguration(), + getParentForChildren(), + isClean()); + machineConfiguration_ = null; + } + return machineConfigurationBuilder_; + } + + private org.tensorflow.proto.RunConfiguration runConfiguration_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunConfiguration, org.tensorflow.proto.RunConfiguration.Builder, org.tensorflow.proto.RunConfigurationOrBuilder> runConfigurationBuilder_; + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return Whether the runConfiguration field is set. + */ + public boolean hasRunConfiguration() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return The runConfiguration. + */ + public org.tensorflow.proto.RunConfiguration getRunConfiguration() { + if (runConfigurationBuilder_ == null) { + return runConfiguration_ == null ? org.tensorflow.proto.RunConfiguration.getDefaultInstance() : runConfiguration_; + } else { + return runConfigurationBuilder_.getMessage(); + } + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public Builder setRunConfiguration(org.tensorflow.proto.RunConfiguration value) { + if (runConfigurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + runConfiguration_ = value; + } else { + runConfigurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public Builder setRunConfiguration( + org.tensorflow.proto.RunConfiguration.Builder builderForValue) { + if (runConfigurationBuilder_ == null) { + runConfiguration_ = builderForValue.build(); + } else { + runConfigurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public Builder mergeRunConfiguration(org.tensorflow.proto.RunConfiguration value) { + if (runConfigurationBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + runConfiguration_ != null && + runConfiguration_ != org.tensorflow.proto.RunConfiguration.getDefaultInstance()) { + getRunConfigurationBuilder().mergeFrom(value); + } else { + runConfiguration_ = value; + } + } else { + runConfigurationBuilder_.mergeFrom(value); + } + if (runConfiguration_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public Builder clearRunConfiguration() { + bitField0_ = (bitField0_ & ~0x00000080); + runConfiguration_ = null; + if (runConfigurationBuilder_ != null) { + runConfigurationBuilder_.dispose(); + runConfigurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public org.tensorflow.proto.RunConfiguration.Builder getRunConfigurationBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getRunConfigurationFieldBuilder().getBuilder(); + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + public org.tensorflow.proto.RunConfigurationOrBuilder getRunConfigurationOrBuilder() { + if (runConfigurationBuilder_ != null) { + return runConfigurationBuilder_.getMessageOrBuilder(); + } else { + return runConfiguration_ == null ? + org.tensorflow.proto.RunConfiguration.getDefaultInstance() : runConfiguration_; + } + } + /** + *
    +     * Run-specific parameters (arguments, etc)
    +     * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunConfiguration, org.tensorflow.proto.RunConfiguration.Builder, org.tensorflow.proto.RunConfigurationOrBuilder> + getRunConfigurationFieldBuilder() { + if (runConfigurationBuilder_ == null) { + runConfigurationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.RunConfiguration, org.tensorflow.proto.RunConfiguration.Builder, org.tensorflow.proto.RunConfigurationOrBuilder>( + getRunConfiguration(), + getParentForChildren(), + isClean()); + runConfiguration_ = null; + } + return runConfigurationBuilder_; + } + + private java.lang.Object name_ = ""; + /** + *
    +     * Benchmark target identifier.
    +     * 
    + * + * string name = 9; + * @return The name. + */ + 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; + } + } + /** + *
    +     * Benchmark target identifier.
    +     * 
    + * + * string name = 9; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +     * Benchmark target identifier.
    +     * 
    + * + * string name = 9; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Benchmark target identifier.
    +     * 
    + * + * string name = 9; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + *
    +     * Benchmark target identifier.
    +     * 
    + * + * string name = 9; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private int benchmarkType_ = 0; + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The enum numeric value on the wire for benchmarkType. + */ + @java.lang.Override public int getBenchmarkTypeValue() { + return benchmarkType_; + } + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @param value The enum numeric value on the wire for benchmarkType to set. + * @return This builder for chaining. + */ + public Builder setBenchmarkTypeValue(int value) { + benchmarkType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The benchmarkType. + */ + @java.lang.Override + public org.tensorflow.proto.TestResults.BenchmarkType getBenchmarkType() { + org.tensorflow.proto.TestResults.BenchmarkType result = org.tensorflow.proto.TestResults.BenchmarkType.forNumber(benchmarkType_); + return result == null ? org.tensorflow.proto.TestResults.BenchmarkType.UNRECOGNIZED : result; + } + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @param value The benchmarkType to set. + * @return This builder for chaining. + */ + public Builder setBenchmarkType(org.tensorflow.proto.TestResults.BenchmarkType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + benchmarkType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return This builder for chaining. + */ + public Builder clearBenchmarkType() { + bitField0_ = (bitField0_ & ~0x00000200); + benchmarkType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object runMode_ = ""; + /** + *
    +     * Used for differentiating between continuous and debug builds.
    +     * Must be one of:
    +     * * cbuild: results from continuous build.
    +     * * presubmit: results from oneshot requests.
    +     * * culprit: results from culprit finder rerun.
    +     * 
    + * + * string run_mode = 11; + * @return The runMode. + */ + public java.lang.String getRunMode() { + java.lang.Object ref = runMode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runMode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Used for differentiating between continuous and debug builds.
    +     * Must be one of:
    +     * * cbuild: results from continuous build.
    +     * * presubmit: results from oneshot requests.
    +     * * culprit: results from culprit finder rerun.
    +     * 
    + * + * string run_mode = 11; + * @return The bytes for runMode. + */ + public com.google.protobuf.ByteString + getRunModeBytes() { + java.lang.Object ref = runMode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + runMode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Used for differentiating between continuous and debug builds.
    +     * Must be one of:
    +     * * cbuild: results from continuous build.
    +     * * presubmit: results from oneshot requests.
    +     * * culprit: results from culprit finder rerun.
    +     * 
    + * + * string run_mode = 11; + * @param value The runMode to set. + * @return This builder for chaining. + */ + public Builder setRunMode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + runMode_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Used for differentiating between continuous and debug builds.
    +     * Must be one of:
    +     * * cbuild: results from continuous build.
    +     * * presubmit: results from oneshot requests.
    +     * * culprit: results from culprit finder rerun.
    +     * 
    + * + * string run_mode = 11; + * @return This builder for chaining. + */ + public Builder clearRunMode() { + runMode_ = getDefaultInstance().getRunMode(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + *
    +     * Used for differentiating between continuous and debug builds.
    +     * Must be one of:
    +     * * cbuild: results from continuous build.
    +     * * presubmit: results from oneshot requests.
    +     * * culprit: results from culprit finder rerun.
    +     * 
    + * + * string run_mode = 11; + * @param value The bytes for runMode to set. + * @return This builder for chaining. + */ + public Builder setRunModeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + runMode_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object tfVersion_ = ""; + /** + *
    +     * TensorFlow version this benchmark runs against.
    +     * This can be either set to full version or just the major version.
    +     * 
    + * + * string tf_version = 12; + * @return The tfVersion. + */ + public java.lang.String getTfVersion() { + java.lang.Object ref = tfVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tfVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * TensorFlow version this benchmark runs against.
    +     * This can be either set to full version or just the major version.
    +     * 
    + * + * string tf_version = 12; + * @return The bytes for tfVersion. + */ + public com.google.protobuf.ByteString + getTfVersionBytes() { + java.lang.Object ref = tfVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tfVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * TensorFlow version this benchmark runs against.
    +     * This can be either set to full version or just the major version.
    +     * 
    + * + * string tf_version = 12; + * @param value The tfVersion to set. + * @return This builder for chaining. + */ + public Builder setTfVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tfVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +     * TensorFlow version this benchmark runs against.
    +     * This can be either set to full version or just the major version.
    +     * 
    + * + * string tf_version = 12; + * @return This builder for chaining. + */ + public Builder clearTfVersion() { + tfVersion_ = getDefaultInstance().getTfVersion(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + *
    +     * TensorFlow version this benchmark runs against.
    +     * This can be either set to full version or just the major version.
    +     * 
    + * + * string tf_version = 12; + * @param value The bytes for tfVersion to set. + * @return This builder for chaining. + */ + public Builder setTfVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tfVersion_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TestResults) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TestResults) + private static final org.tensorflow.proto.TestResults DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TestResults(); + } + + public static org.tensorflow.proto.TestResults getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestResults parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TestResults getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResultsOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResultsOrBuilder.java new file mode 100644 index 00000000000..ec051f94716 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TestResultsOrBuilder.java @@ -0,0 +1,269 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/test_log.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface TestResultsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TestResults) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * The target of the run, e.g.:
    +   * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +   * 
    + * + * string target = 1; + * @return The target. + */ + java.lang.String getTarget(); + /** + *
    +   * The target of the run, e.g.:
    +   * //tensorflow/core:kernels_adjust_contrast_op_benchmark_test
    +   * 
    + * + * string target = 1; + * @return The bytes for target. + */ + com.google.protobuf.ByteString + getTargetBytes(); + + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return Whether the entries field is set. + */ + boolean hasEntries(); + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + * @return The entries. + */ + org.tensorflow.proto.BenchmarkEntries getEntries(); + /** + *
    +   * The list of tests or benchmarks in this run.
    +   * 
    + * + * .tensorflow.BenchmarkEntries entries = 2; + */ + org.tensorflow.proto.BenchmarkEntriesOrBuilder getEntriesOrBuilder(); + + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return Whether the buildConfiguration field is set. + */ + boolean hasBuildConfiguration(); + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + * @return The buildConfiguration. + */ + org.tensorflow.proto.BuildConfiguration getBuildConfiguration(); + /** + *
    +   * The configuration of the build (compiled opt? with cuda? any copts?)
    +   * 
    + * + * .tensorflow.BuildConfiguration build_configuration = 3; + */ + org.tensorflow.proto.BuildConfigurationOrBuilder getBuildConfigurationOrBuilder(); + + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return Whether the commitId field is set. + */ + boolean hasCommitId(); + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + * @return The commitId. + */ + org.tensorflow.proto.CommitId getCommitId(); + /** + *
    +   * The commit id (git hash or changelist)
    +   * 
    + * + * .tensorflow.CommitId commit_id = 4; + */ + org.tensorflow.proto.CommitIdOrBuilder getCommitIdOrBuilder(); + + /** + *
    +   * The time the run started (in seconds of UTC time since Unix epoch)
    +   * 
    + * + * int64 start_time = 5; + * @return The startTime. + */ + long getStartTime(); + + /** + *
    +   * The amount of time the total run took (wall time in seconds)
    +   * 
    + * + * double run_time = 6; + * @return The runTime. + */ + double getRunTime(); + + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return Whether the machineConfiguration field is set. + */ + boolean hasMachineConfiguration(); + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + * @return The machineConfiguration. + */ + org.tensorflow.proto.MachineConfiguration getMachineConfiguration(); + /** + *
    +   * Machine-specific parameters (Platform and CPU info)
    +   * 
    + * + * .tensorflow.MachineConfiguration machine_configuration = 7; + */ + org.tensorflow.proto.MachineConfigurationOrBuilder getMachineConfigurationOrBuilder(); + + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return Whether the runConfiguration field is set. + */ + boolean hasRunConfiguration(); + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + * @return The runConfiguration. + */ + org.tensorflow.proto.RunConfiguration getRunConfiguration(); + /** + *
    +   * Run-specific parameters (arguments, etc)
    +   * 
    + * + * .tensorflow.RunConfiguration run_configuration = 8; + */ + org.tensorflow.proto.RunConfigurationOrBuilder getRunConfigurationOrBuilder(); + + /** + *
    +   * Benchmark target identifier.
    +   * 
    + * + * string name = 9; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +   * Benchmark target identifier.
    +   * 
    + * + * string name = 9; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The enum numeric value on the wire for benchmarkType. + */ + int getBenchmarkTypeValue(); + /** + * .tensorflow.TestResults.BenchmarkType benchmark_type = 10; + * @return The benchmarkType. + */ + org.tensorflow.proto.TestResults.BenchmarkType getBenchmarkType(); + + /** + *
    +   * Used for differentiating between continuous and debug builds.
    +   * Must be one of:
    +   * * cbuild: results from continuous build.
    +   * * presubmit: results from oneshot requests.
    +   * * culprit: results from culprit finder rerun.
    +   * 
    + * + * string run_mode = 11; + * @return The runMode. + */ + java.lang.String getRunMode(); + /** + *
    +   * Used for differentiating between continuous and debug builds.
    +   * Must be one of:
    +   * * cbuild: results from continuous build.
    +   * * presubmit: results from oneshot requests.
    +   * * culprit: results from culprit finder rerun.
    +   * 
    + * + * string run_mode = 11; + * @return The bytes for runMode. + */ + com.google.protobuf.ByteString + getRunModeBytes(); + + /** + *
    +   * TensorFlow version this benchmark runs against.
    +   * This can be either set to full version or just the major version.
    +   * 
    + * + * string tf_version = 12; + * @return The tfVersion. + */ + java.lang.String getTfVersion(); + /** + *
    +   * TensorFlow version this benchmark runs against.
    +   * This can be either set to full version or just the major version.
    +   * 
    + * + * string tf_version = 12; + * @return The bytes for tfVersion. + */ + com.google.protobuf.ByteString + getTfVersionBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProto.java new file mode 100644 index 00000000000..b5618ce9bed --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProto.java @@ -0,0 +1,721 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.ThreadPoolOptionProto} + */ +public final class ThreadPoolOptionProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ThreadPoolOptionProto) + ThreadPoolOptionProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ThreadPoolOptionProto.class.getName()); + } + // Use ThreadPoolOptionProto.newBuilder() to construct. + private ThreadPoolOptionProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ThreadPoolOptionProto() { + globalName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ThreadPoolOptionProto.class, org.tensorflow.proto.ThreadPoolOptionProto.Builder.class); + } + + public static final int NUM_THREADS_FIELD_NUMBER = 1; + private int numThreads_ = 0; + /** + *
    +   * The number of threads in the pool.
    +   *
    +   * 0 means the system picks a value based on where this option proto is used
    +   * (see the declaration of the specific field for more info).
    +   * 
    + * + * int32 num_threads = 1; + * @return The numThreads. + */ + @java.lang.Override + public int getNumThreads() { + return numThreads_; + } + + public static final int GLOBAL_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object globalName_ = ""; + /** + *
    +   * The global name of the threadpool.
    +   *
    +   * If empty, then the threadpool is made and used according to the scope it's
    +   * in - e.g., for a session threadpool, it is used by that session only.
    +   *
    +   * If non-empty, then:
    +   * - a global threadpool associated with this name is looked
    +   * up or created. This allows, for example, sharing one threadpool across
    +   * many sessions (e.g., like the default behavior, if
    +   * inter_op_parallelism_threads is not configured), but still partitioning
    +   * into a large and small pool.
    +   * - if the threadpool for this global_name already exists, then it is an
    +   * error if the existing pool was created using a different num_threads
    +   * value as is specified on this call.
    +   * - threadpools created this way are never garbage collected.
    +   * 
    + * + * string global_name = 2; + * @return The globalName. + */ + @java.lang.Override + public java.lang.String getGlobalName() { + java.lang.Object ref = globalName_; + 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(); + globalName_ = s; + return s; + } + } + /** + *
    +   * The global name of the threadpool.
    +   *
    +   * If empty, then the threadpool is made and used according to the scope it's
    +   * in - e.g., for a session threadpool, it is used by that session only.
    +   *
    +   * If non-empty, then:
    +   * - a global threadpool associated with this name is looked
    +   * up or created. This allows, for example, sharing one threadpool across
    +   * many sessions (e.g., like the default behavior, if
    +   * inter_op_parallelism_threads is not configured), but still partitioning
    +   * into a large and small pool.
    +   * - if the threadpool for this global_name already exists, then it is an
    +   * error if the existing pool was created using a different num_threads
    +   * value as is specified on this call.
    +   * - threadpools created this way are never garbage collected.
    +   * 
    + * + * string global_name = 2; + * @return The bytes for globalName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGlobalNameBytes() { + java.lang.Object ref = globalName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + globalName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (numThreads_ != 0) { + output.writeInt32(1, numThreads_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(globalName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, globalName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numThreads_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, numThreads_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(globalName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, globalName_); + } + size += getUnknownFields().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.ThreadPoolOptionProto)) { + return super.equals(obj); + } + org.tensorflow.proto.ThreadPoolOptionProto other = (org.tensorflow.proto.ThreadPoolOptionProto) obj; + + if (getNumThreads() + != other.getNumThreads()) return false; + if (!getGlobalName() + .equals(other.getGlobalName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUM_THREADS_FIELD_NUMBER; + hash = (53 * hash) + getNumThreads(); + hash = (37 * hash) + GLOBAL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getGlobalName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ThreadPoolOptionProto 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.ThreadPoolOptionProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ThreadPoolOptionProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ThreadPoolOptionProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ThreadPoolOptionProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ThreadPoolOptionProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.ThreadPoolOptionProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ThreadPoolOptionProto) + org.tensorflow.proto.ThreadPoolOptionProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ThreadPoolOptionProto.class, org.tensorflow.proto.ThreadPoolOptionProto.Builder.class); + } + + // Construct using org.tensorflow.proto.ThreadPoolOptionProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numThreads_ = 0; + globalName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ConfigProtos.internal_static_tensorflow_ThreadPoolOptionProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ThreadPoolOptionProto getDefaultInstanceForType() { + return org.tensorflow.proto.ThreadPoolOptionProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ThreadPoolOptionProto build() { + org.tensorflow.proto.ThreadPoolOptionProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ThreadPoolOptionProto buildPartial() { + org.tensorflow.proto.ThreadPoolOptionProto result = new org.tensorflow.proto.ThreadPoolOptionProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ThreadPoolOptionProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numThreads_ = numThreads_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.globalName_ = globalName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ThreadPoolOptionProto) { + return mergeFrom((org.tensorflow.proto.ThreadPoolOptionProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ThreadPoolOptionProto other) { + if (other == org.tensorflow.proto.ThreadPoolOptionProto.getDefaultInstance()) return this; + if (other.getNumThreads() != 0) { + setNumThreads(other.getNumThreads()); + } + if (!other.getGlobalName().isEmpty()) { + globalName_ = other.globalName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + numThreads_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + globalName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int numThreads_ ; + /** + *
    +     * The number of threads in the pool.
    +     *
    +     * 0 means the system picks a value based on where this option proto is used
    +     * (see the declaration of the specific field for more info).
    +     * 
    + * + * int32 num_threads = 1; + * @return The numThreads. + */ + @java.lang.Override + public int getNumThreads() { + return numThreads_; + } + /** + *
    +     * The number of threads in the pool.
    +     *
    +     * 0 means the system picks a value based on where this option proto is used
    +     * (see the declaration of the specific field for more info).
    +     * 
    + * + * int32 num_threads = 1; + * @param value The numThreads to set. + * @return This builder for chaining. + */ + public Builder setNumThreads(int value) { + + numThreads_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The number of threads in the pool.
    +     *
    +     * 0 means the system picks a value based on where this option proto is used
    +     * (see the declaration of the specific field for more info).
    +     * 
    + * + * int32 num_threads = 1; + * @return This builder for chaining. + */ + public Builder clearNumThreads() { + bitField0_ = (bitField0_ & ~0x00000001); + numThreads_ = 0; + onChanged(); + return this; + } + + private java.lang.Object globalName_ = ""; + /** + *
    +     * The global name of the threadpool.
    +     *
    +     * If empty, then the threadpool is made and used according to the scope it's
    +     * in - e.g., for a session threadpool, it is used by that session only.
    +     *
    +     * If non-empty, then:
    +     * - a global threadpool associated with this name is looked
    +     * up or created. This allows, for example, sharing one threadpool across
    +     * many sessions (e.g., like the default behavior, if
    +     * inter_op_parallelism_threads is not configured), but still partitioning
    +     * into a large and small pool.
    +     * - if the threadpool for this global_name already exists, then it is an
    +     * error if the existing pool was created using a different num_threads
    +     * value as is specified on this call.
    +     * - threadpools created this way are never garbage collected.
    +     * 
    + * + * string global_name = 2; + * @return The globalName. + */ + public java.lang.String getGlobalName() { + java.lang.Object ref = globalName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + globalName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * The global name of the threadpool.
    +     *
    +     * If empty, then the threadpool is made and used according to the scope it's
    +     * in - e.g., for a session threadpool, it is used by that session only.
    +     *
    +     * If non-empty, then:
    +     * - a global threadpool associated with this name is looked
    +     * up or created. This allows, for example, sharing one threadpool across
    +     * many sessions (e.g., like the default behavior, if
    +     * inter_op_parallelism_threads is not configured), but still partitioning
    +     * into a large and small pool.
    +     * - if the threadpool for this global_name already exists, then it is an
    +     * error if the existing pool was created using a different num_threads
    +     * value as is specified on this call.
    +     * - threadpools created this way are never garbage collected.
    +     * 
    + * + * string global_name = 2; + * @return The bytes for globalName. + */ + public com.google.protobuf.ByteString + getGlobalNameBytes() { + java.lang.Object ref = globalName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + globalName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * The global name of the threadpool.
    +     *
    +     * If empty, then the threadpool is made and used according to the scope it's
    +     * in - e.g., for a session threadpool, it is used by that session only.
    +     *
    +     * If non-empty, then:
    +     * - a global threadpool associated with this name is looked
    +     * up or created. This allows, for example, sharing one threadpool across
    +     * many sessions (e.g., like the default behavior, if
    +     * inter_op_parallelism_threads is not configured), but still partitioning
    +     * into a large and small pool.
    +     * - if the threadpool for this global_name already exists, then it is an
    +     * error if the existing pool was created using a different num_threads
    +     * value as is specified on this call.
    +     * - threadpools created this way are never garbage collected.
    +     * 
    + * + * string global_name = 2; + * @param value The globalName to set. + * @return This builder for chaining. + */ + public Builder setGlobalName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + globalName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The global name of the threadpool.
    +     *
    +     * If empty, then the threadpool is made and used according to the scope it's
    +     * in - e.g., for a session threadpool, it is used by that session only.
    +     *
    +     * If non-empty, then:
    +     * - a global threadpool associated with this name is looked
    +     * up or created. This allows, for example, sharing one threadpool across
    +     * many sessions (e.g., like the default behavior, if
    +     * inter_op_parallelism_threads is not configured), but still partitioning
    +     * into a large and small pool.
    +     * - if the threadpool for this global_name already exists, then it is an
    +     * error if the existing pool was created using a different num_threads
    +     * value as is specified on this call.
    +     * - threadpools created this way are never garbage collected.
    +     * 
    + * + * string global_name = 2; + * @return This builder for chaining. + */ + public Builder clearGlobalName() { + globalName_ = getDefaultInstance().getGlobalName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * The global name of the threadpool.
    +     *
    +     * If empty, then the threadpool is made and used according to the scope it's
    +     * in - e.g., for a session threadpool, it is used by that session only.
    +     *
    +     * If non-empty, then:
    +     * - a global threadpool associated with this name is looked
    +     * up or created. This allows, for example, sharing one threadpool across
    +     * many sessions (e.g., like the default behavior, if
    +     * inter_op_parallelism_threads is not configured), but still partitioning
    +     * into a large and small pool.
    +     * - if the threadpool for this global_name already exists, then it is an
    +     * error if the existing pool was created using a different num_threads
    +     * value as is specified on this call.
    +     * - threadpools created this way are never garbage collected.
    +     * 
    + * + * string global_name = 2; + * @param value The bytes for globalName to set. + * @return This builder for chaining. + */ + public Builder setGlobalNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + globalName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ThreadPoolOptionProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ThreadPoolOptionProto) + private static final org.tensorflow.proto.ThreadPoolOptionProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ThreadPoolOptionProto(); + } + + public static org.tensorflow.proto.ThreadPoolOptionProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ThreadPoolOptionProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ThreadPoolOptionProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProtoOrBuilder.java new file mode 100644 index 00000000000..293e6914f9f --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ThreadPoolOptionProtoOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface ThreadPoolOptionProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.ThreadPoolOptionProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * The number of threads in the pool.
    +   *
    +   * 0 means the system picks a value based on where this option proto is used
    +   * (see the declaration of the specific field for more info).
    +   * 
    + * + * int32 num_threads = 1; + * @return The numThreads. + */ + int getNumThreads(); + + /** + *
    +   * The global name of the threadpool.
    +   *
    +   * If empty, then the threadpool is made and used according to the scope it's
    +   * in - e.g., for a session threadpool, it is used by that session only.
    +   *
    +   * If non-empty, then:
    +   * - a global threadpool associated with this name is looked
    +   * up or created. This allows, for example, sharing one threadpool across
    +   * many sessions (e.g., like the default behavior, if
    +   * inter_op_parallelism_threads is not configured), but still partitioning
    +   * into a large and small pool.
    +   * - if the threadpool for this global_name already exists, then it is an
    +   * error if the existing pool was created using a different num_threads
    +   * value as is specified on this call.
    +   * - threadpools created this way are never garbage collected.
    +   * 
    + * + * string global_name = 2; + * @return The globalName. + */ + java.lang.String getGlobalName(); + /** + *
    +   * The global name of the threadpool.
    +   *
    +   * If empty, then the threadpool is made and used according to the scope it's
    +   * in - e.g., for a session threadpool, it is used by that session only.
    +   *
    +   * If non-empty, then:
    +   * - a global threadpool associated with this name is looked
    +   * up or created. This allows, for example, sharing one threadpool across
    +   * many sessions (e.g., like the default behavior, if
    +   * inter_op_parallelism_threads is not configured), but still partitioning
    +   * into a large and small pool.
    +   * - if the threadpool for this global_name already exists, then it is an
    +   * error if the existing pool was created using a different num_threads
    +   * value as is specified on this call.
    +   * - threadpools created this way are never garbage collected.
    +   * 
    + * + * string global_name = 2; + * @return The bytes for globalName. + */ + com.google.protobuf.ByteString + getGlobalNameBytes(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TrackableObjectGraphOuterClass.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TrackableObjectGraphOuterClass.java new file mode 100644 index 00000000000..4ab6b3965d8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TrackableObjectGraphOuterClass.java @@ -0,0 +1,6367 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/trackable_object_graph.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TrackableObjectGraphOuterClass { + private TrackableObjectGraphOuterClass() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TrackableObjectGraphOuterClass.class.getName()); + } + 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 TrackableObjectGraphOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + java.util.List + getNodesList(); + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getNodes(int index); + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + int getNodesCount(); + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + java.util.List + getNodesOrBuilderList(); + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( + int index); + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph} + */ + public static final class TrackableObjectGraph extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph) + TrackableObjectGraphOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TrackableObjectGraph.class.getName()); + } + // Use TrackableObjectGraph.newBuilder() to construct. + private TrackableObjectGraph(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TrackableObjectGraph() { + nodes_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.Builder.class); + } + + public interface TrackableObjectOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + java.util.List + getChildrenList(); + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index); + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + int getChildrenCount(); + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + java.util.List + getChildrenOrBuilderList(); + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index); + + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + java.util.List + getAttributesList(); + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index); + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + int getAttributesCount(); + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + java.util.List + getAttributesOrBuilderList(); + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( + int index); + + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + java.util.List + getSlotVariablesList(); + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index); + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + int getSlotVariablesCount(); + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + java.util.List + getSlotVariablesOrBuilderList(); + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index); + + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return Whether the registeredSaver field is set. + */ + boolean hasRegisteredSaver(); + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return The registeredSaver. + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver getRegisteredSaver(); + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder getRegisteredSaverOrBuilder(); + + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return Whether the hasCheckpointValues field is set. + */ + boolean hasHasCheckpointValues(); + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return The hasCheckpointValues. + */ + com.google.protobuf.BoolValue getHasCheckpointValues(); + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + com.google.protobuf.BoolValueOrBuilder getHasCheckpointValuesOrBuilder(); + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject} + */ + public static final class TrackableObject extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject) + TrackableObjectOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TrackableObject.class.getName()); + } + // Use TrackableObject.newBuilder() to construct. + private TrackableObject(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TrackableObject() { + children_ = java.util.Collections.emptyList(); + attributes_ = java.util.Collections.emptyList(); + slotVariables_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder.class); + } + + public interface ObjectReferenceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the object
    +         * being referenced.
    +         * 
    + * + * int32 node_id = 1; + * @return The nodeId. + */ + int getNodeId(); + + /** + *
    +         * A user-provided name for the edge.
    +         * 
    + * + * string local_name = 2; + * @return The localName. + */ + java.lang.String getLocalName(); + /** + *
    +         * A user-provided name for the edge.
    +         * 
    + * + * string local_name = 2; + * @return The bytes for localName. + */ + com.google.protobuf.ByteString + getLocalNameBytes(); + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference} + */ + public static final class ObjectReference extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) + ObjectReferenceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ObjectReference.class.getName()); + } + // Use ObjectReference.newBuilder() to construct. + private ObjectReference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ObjectReference() { + localName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder.class); + } + + public static final int NODE_ID_FIELD_NUMBER = 1; + private int nodeId_ = 0; + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the object
    +         * being referenced.
    +         * 
    + * + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + + public static final int LOCAL_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object localName_ = ""; + /** + *
    +         * A user-provided name for the edge.
    +         * 
    + * + * string local_name = 2; + * @return The localName. + */ + @java.lang.Override + public java.lang.String getLocalName() { + java.lang.Object ref = localName_; + 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(); + localName_ = s; + return s; + } + } + /** + *
    +         * A user-provided name for the edge.
    +         * 
    + * + * string local_name = 2; + * @return The bytes for localName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLocalNameBytes() { + java.lang.Object ref = localName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (nodeId_ != 0) { + output.writeInt32(1, nodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(localName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, localName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, nodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(localName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, localName_); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference) obj; + + if (getNodeId() + != other.getNodeId()) return false; + if (!getLocalName() + .equals(other.getLocalName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNodeId(); + hash = (37 * hash) + LOCAL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLocalName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeId_ = 0; + localName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeId_ = nodeId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.localName_ = localName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()) return this; + if (other.getNodeId() != 0) { + setNodeId(other.getNodeId()); + } + if (!other.getLocalName().isEmpty()) { + localName_ = other.localName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + nodeId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + localName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int nodeId_ ; + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the object
    +           * being referenced.
    +           * 
    + * + * int32 node_id = 1; + * @return The nodeId. + */ + @java.lang.Override + public int getNodeId() { + return nodeId_; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the object
    +           * being referenced.
    +           * 
    + * + * int32 node_id = 1; + * @param value The nodeId to set. + * @return This builder for chaining. + */ + public Builder setNodeId(int value) { + + nodeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the object
    +           * being referenced.
    +           * 
    + * + * int32 node_id = 1; + * @return This builder for chaining. + */ + public Builder clearNodeId() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object localName_ = ""; + /** + *
    +           * A user-provided name for the edge.
    +           * 
    + * + * string local_name = 2; + * @return The localName. + */ + public java.lang.String getLocalName() { + java.lang.Object ref = localName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + localName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +           * A user-provided name for the edge.
    +           * 
    + * + * string local_name = 2; + * @return The bytes for localName. + */ + public com.google.protobuf.ByteString + getLocalNameBytes() { + java.lang.Object ref = localName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + localName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +           * A user-provided name for the edge.
    +           * 
    + * + * string local_name = 2; + * @param value The localName to set. + * @return This builder for chaining. + */ + public Builder setLocalName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + localName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +           * A user-provided name for the edge.
    +           * 
    + * + * string local_name = 2; + * @return This builder for chaining. + */ + public Builder clearLocalName() { + localName_ = getDefaultInstance().getLocalName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +           * A user-provided name for the edge.
    +           * 
    + * + * string local_name = 2; + * @param value The bytes for localName to set. + * @return This builder for chaining. + */ + public Builder setLocalNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + localName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SerializedTensorOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +         * A name for the Tensor. Simple variables have only one
    +         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +         * be restored on object creation as an optimization.
    +         * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +         * A name for the Tensor. Simple variables have only one
    +         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +         * be restored on object creation as an optimization.
    +         * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +         * The full name of the variable/tensor, if applicable. Used to allow
    +         * name-based loading of checkpoints which were saved using an
    +         * object-based API. Should match the checkpoint key which would have been
    +         * assigned by tf.train.Saver.
    +         * 
    + * + * string full_name = 2; + * @return The fullName. + */ + java.lang.String getFullName(); + /** + *
    +         * The full name of the variable/tensor, if applicable. Used to allow
    +         * name-based loading of checkpoints which were saved using an
    +         * object-based API. Should match the checkpoint key which would have been
    +         * assigned by tf.train.Saver.
    +         * 
    + * + * string full_name = 2; + * @return The bytes for fullName. + */ + com.google.protobuf.ByteString + getFullNameBytes(); + + /** + *
    +         * The generated name of the Tensor in the checkpoint.
    +         * 
    + * + * string checkpoint_key = 3; + * @return The checkpointKey. + */ + java.lang.String getCheckpointKey(); + /** + *
    +         * The generated name of the Tensor in the checkpoint.
    +         * 
    + * + * string checkpoint_key = 3; + * @return The bytes for checkpointKey. + */ + com.google.protobuf.ByteString + getCheckpointKeyBytes(); + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor} + */ + public static final class SerializedTensor extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) + SerializedTensorOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SerializedTensor.class.getName()); + } + // Use SerializedTensor.newBuilder() to construct. + private SerializedTensor(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SerializedTensor() { + name_ = ""; + fullName_ = ""; + checkpointKey_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +         * A name for the Tensor. Simple variables have only one
    +         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +         * be restored on object creation as an optimization.
    +         * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +         * A name for the Tensor. Simple variables have only one
    +         * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +         * be restored on object creation as an optimization.
    +         * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 FULL_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object fullName_ = ""; + /** + *
    +         * The full name of the variable/tensor, if applicable. Used to allow
    +         * name-based loading of checkpoints which were saved using an
    +         * object-based API. Should match the checkpoint key which would have been
    +         * assigned by tf.train.Saver.
    +         * 
    + * + * string full_name = 2; + * @return The fullName. + */ + @java.lang.Override + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + 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(); + fullName_ = s; + return s; + } + } + /** + *
    +         * The full name of the variable/tensor, if applicable. Used to allow
    +         * name-based loading of checkpoints which were saved using an
    +         * object-based API. Should match the checkpoint key which would have been
    +         * assigned by tf.train.Saver.
    +         * 
    + * + * string full_name = 2; + * @return The bytes for fullName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CHECKPOINT_KEY_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object checkpointKey_ = ""; + /** + *
    +         * The generated name of the Tensor in the checkpoint.
    +         * 
    + * + * string checkpoint_key = 3; + * @return The checkpointKey. + */ + @java.lang.Override + public java.lang.String getCheckpointKey() { + java.lang.Object ref = checkpointKey_; + 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(); + checkpointKey_ = s; + return s; + } + } + /** + *
    +         * The generated name of the Tensor in the checkpoint.
    +         * 
    + * + * string checkpoint_key = 3; + * @return The bytes for checkpointKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCheckpointKeyBytes() { + java.lang.Object ref = checkpointKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checkpointKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fullName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, fullName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkpointKey_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, checkpointKey_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fullName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, fullName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkpointKey_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, checkpointKey_); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getFullName() + .equals(other.getFullName())) return false; + if (!getCheckpointKey() + .equals(other.getCheckpointKey())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FULL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFullName().hashCode(); + hash = (37 * hash) + CHECKPOINT_KEY_FIELD_NUMBER; + hash = (53 * hash) + getCheckpointKey().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + fullName_ = ""; + checkpointKey_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fullName_ = fullName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.checkpointKey_ = checkpointKey_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFullName().isEmpty()) { + fullName_ = other.fullName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCheckpointKey().isEmpty()) { + checkpointKey_ = other.checkpointKey_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + fullName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + checkpointKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +           * A name for the Tensor. Simple variables have only one
    +           * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +           * be restored on object creation as an optimization.
    +           * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +           * A name for the Tensor. Simple variables have only one
    +           * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +           * be restored on object creation as an optimization.
    +           * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +           * A name for the Tensor. Simple variables have only one
    +           * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +           * be restored on object creation as an optimization.
    +           * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +           * A name for the Tensor. Simple variables have only one
    +           * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +           * be restored on object creation as an optimization.
    +           * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +           * A name for the Tensor. Simple variables have only one
    +           * `SerializedTensor` named "VARIABLE_VALUE" by convention. This value may
    +           * be restored on object creation as an optimization.
    +           * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object fullName_ = ""; + /** + *
    +           * The full name of the variable/tensor, if applicable. Used to allow
    +           * name-based loading of checkpoints which were saved using an
    +           * object-based API. Should match the checkpoint key which would have been
    +           * assigned by tf.train.Saver.
    +           * 
    + * + * string full_name = 2; + * @return The fullName. + */ + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +           * The full name of the variable/tensor, if applicable. Used to allow
    +           * name-based loading of checkpoints which were saved using an
    +           * object-based API. Should match the checkpoint key which would have been
    +           * assigned by tf.train.Saver.
    +           * 
    + * + * string full_name = 2; + * @return The bytes for fullName. + */ + public com.google.protobuf.ByteString + getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +           * The full name of the variable/tensor, if applicable. Used to allow
    +           * name-based loading of checkpoints which were saved using an
    +           * object-based API. Should match the checkpoint key which would have been
    +           * assigned by tf.train.Saver.
    +           * 
    + * + * string full_name = 2; + * @param value The fullName to set. + * @return This builder for chaining. + */ + public Builder setFullName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fullName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +           * The full name of the variable/tensor, if applicable. Used to allow
    +           * name-based loading of checkpoints which were saved using an
    +           * object-based API. Should match the checkpoint key which would have been
    +           * assigned by tf.train.Saver.
    +           * 
    + * + * string full_name = 2; + * @return This builder for chaining. + */ + public Builder clearFullName() { + fullName_ = getDefaultInstance().getFullName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +           * The full name of the variable/tensor, if applicable. Used to allow
    +           * name-based loading of checkpoints which were saved using an
    +           * object-based API. Should match the checkpoint key which would have been
    +           * assigned by tf.train.Saver.
    +           * 
    + * + * string full_name = 2; + * @param value The bytes for fullName to set. + * @return This builder for chaining. + */ + public Builder setFullNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fullName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object checkpointKey_ = ""; + /** + *
    +           * The generated name of the Tensor in the checkpoint.
    +           * 
    + * + * string checkpoint_key = 3; + * @return The checkpointKey. + */ + public java.lang.String getCheckpointKey() { + java.lang.Object ref = checkpointKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checkpointKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +           * The generated name of the Tensor in the checkpoint.
    +           * 
    + * + * string checkpoint_key = 3; + * @return The bytes for checkpointKey. + */ + public com.google.protobuf.ByteString + getCheckpointKeyBytes() { + java.lang.Object ref = checkpointKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checkpointKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +           * The generated name of the Tensor in the checkpoint.
    +           * 
    + * + * string checkpoint_key = 3; + * @param value The checkpointKey to set. + * @return This builder for chaining. + */ + public Builder setCheckpointKey( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + checkpointKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +           * The generated name of the Tensor in the checkpoint.
    +           * 
    + * + * string checkpoint_key = 3; + * @return This builder for chaining. + */ + public Builder clearCheckpointKey() { + checkpointKey_ = getDefaultInstance().getCheckpointKey(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +           * The generated name of the Tensor in the checkpoint.
    +           * 
    + * + * string checkpoint_key = 3; + * @param value The bytes for checkpointKey to set. + * @return This builder for chaining. + */ + public Builder setCheckpointKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + checkpointKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SerializedTensor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SlotVariableReferenceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the
    +         * variable object this slot was created for.
    +         * 
    + * + * int32 original_variable_node_id = 1; + * @return The originalVariableNodeId. + */ + int getOriginalVariableNodeId(); + + /** + *
    +         * The name of the slot (e.g. "m"/"v").
    +         * 
    + * + * string slot_name = 2; + * @return The slotName. + */ + java.lang.String getSlotName(); + /** + *
    +         * The name of the slot (e.g. "m"/"v").
    +         * 
    + * + * string slot_name = 2; + * @return The bytes for slotName. + */ + com.google.protobuf.ByteString + getSlotNameBytes(); + + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the
    +         * `Object` with the value of the slot variable.
    +         * 
    + * + * int32 slot_variable_node_id = 3; + * @return The slotVariableNodeId. + */ + int getSlotVariableNodeId(); + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference} + */ + public static final class SlotVariableReference extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) + SlotVariableReferenceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SlotVariableReference.class.getName()); + } + // Use SlotVariableReference.newBuilder() to construct. + private SlotVariableReference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SlotVariableReference() { + slotName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder.class); + } + + public static final int ORIGINAL_VARIABLE_NODE_ID_FIELD_NUMBER = 1; + private int originalVariableNodeId_ = 0; + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the
    +         * variable object this slot was created for.
    +         * 
    + * + * int32 original_variable_node_id = 1; + * @return The originalVariableNodeId. + */ + @java.lang.Override + public int getOriginalVariableNodeId() { + return originalVariableNodeId_; + } + + public static final int SLOT_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object slotName_ = ""; + /** + *
    +         * The name of the slot (e.g. "m"/"v").
    +         * 
    + * + * string slot_name = 2; + * @return The slotName. + */ + @java.lang.Override + public java.lang.String getSlotName() { + java.lang.Object ref = slotName_; + 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(); + slotName_ = s; + return s; + } + } + /** + *
    +         * The name of the slot (e.g. "m"/"v").
    +         * 
    + * + * string slot_name = 2; + * @return The bytes for slotName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSlotNameBytes() { + java.lang.Object ref = slotName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + slotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SLOT_VARIABLE_NODE_ID_FIELD_NUMBER = 3; + private int slotVariableNodeId_ = 0; + /** + *
    +         * An index into `TrackableObjectGraph.nodes`, indicating the
    +         * `Object` with the value of the slot variable.
    +         * 
    + * + * int32 slot_variable_node_id = 3; + * @return The slotVariableNodeId. + */ + @java.lang.Override + public int getSlotVariableNodeId() { + return slotVariableNodeId_; + } + + 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 (originalVariableNodeId_ != 0) { + output.writeInt32(1, originalVariableNodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(slotName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, slotName_); + } + if (slotVariableNodeId_ != 0) { + output.writeInt32(3, slotVariableNodeId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (originalVariableNodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, originalVariableNodeId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(slotName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, slotName_); + } + if (slotVariableNodeId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, slotVariableNodeId_); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference) obj; + + if (getOriginalVariableNodeId() + != other.getOriginalVariableNodeId()) return false; + if (!getSlotName() + .equals(other.getSlotName())) return false; + if (getSlotVariableNodeId() + != other.getSlotVariableNodeId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ORIGINAL_VARIABLE_NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getOriginalVariableNodeId(); + hash = (37 * hash) + SLOT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSlotName().hashCode(); + hash = (37 * hash) + SLOT_VARIABLE_NODE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSlotVariableNodeId(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + originalVariableNodeId_ = 0; + slotName_ = ""; + slotVariableNodeId_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalVariableNodeId_ = originalVariableNodeId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.slotName_ = slotName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.slotVariableNodeId_ = slotVariableNodeId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()) return this; + if (other.getOriginalVariableNodeId() != 0) { + setOriginalVariableNodeId(other.getOriginalVariableNodeId()); + } + if (!other.getSlotName().isEmpty()) { + slotName_ = other.slotName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getSlotVariableNodeId() != 0) { + setSlotVariableNodeId(other.getSlotVariableNodeId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + originalVariableNodeId_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + slotName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + slotVariableNodeId_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int originalVariableNodeId_ ; + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * variable object this slot was created for.
    +           * 
    + * + * int32 original_variable_node_id = 1; + * @return The originalVariableNodeId. + */ + @java.lang.Override + public int getOriginalVariableNodeId() { + return originalVariableNodeId_; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * variable object this slot was created for.
    +           * 
    + * + * int32 original_variable_node_id = 1; + * @param value The originalVariableNodeId to set. + * @return This builder for chaining. + */ + public Builder setOriginalVariableNodeId(int value) { + + originalVariableNodeId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * variable object this slot was created for.
    +           * 
    + * + * int32 original_variable_node_id = 1; + * @return This builder for chaining. + */ + public Builder clearOriginalVariableNodeId() { + bitField0_ = (bitField0_ & ~0x00000001); + originalVariableNodeId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object slotName_ = ""; + /** + *
    +           * The name of the slot (e.g. "m"/"v").
    +           * 
    + * + * string slot_name = 2; + * @return The slotName. + */ + public java.lang.String getSlotName() { + java.lang.Object ref = slotName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + slotName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +           * The name of the slot (e.g. "m"/"v").
    +           * 
    + * + * string slot_name = 2; + * @return The bytes for slotName. + */ + public com.google.protobuf.ByteString + getSlotNameBytes() { + java.lang.Object ref = slotName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + slotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +           * The name of the slot (e.g. "m"/"v").
    +           * 
    + * + * string slot_name = 2; + * @param value The slotName to set. + * @return This builder for chaining. + */ + public Builder setSlotName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + slotName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +           * The name of the slot (e.g. "m"/"v").
    +           * 
    + * + * string slot_name = 2; + * @return This builder for chaining. + */ + public Builder clearSlotName() { + slotName_ = getDefaultInstance().getSlotName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +           * The name of the slot (e.g. "m"/"v").
    +           * 
    + * + * string slot_name = 2; + * @param value The bytes for slotName to set. + * @return This builder for chaining. + */ + public Builder setSlotNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + slotName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int slotVariableNodeId_ ; + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * `Object` with the value of the slot variable.
    +           * 
    + * + * int32 slot_variable_node_id = 3; + * @return The slotVariableNodeId. + */ + @java.lang.Override + public int getSlotVariableNodeId() { + return slotVariableNodeId_; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * `Object` with the value of the slot variable.
    +           * 
    + * + * int32 slot_variable_node_id = 3; + * @param value The slotVariableNodeId to set. + * @return This builder for chaining. + */ + public Builder setSlotVariableNodeId(int value) { + + slotVariableNodeId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +           * An index into `TrackableObjectGraph.nodes`, indicating the
    +           * `Object` with the value of the slot variable.
    +           * 
    + * + * int32 slot_variable_node_id = 3; + * @return This builder for chaining. + */ + public Builder clearSlotVariableNodeId() { + bitField0_ = (bitField0_ & ~0x00000004); + slotVariableNodeId_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SlotVariableReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int CHILDREN_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List children_; + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public java.util.List getChildrenList() { + return children_; + } + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public java.util.List + getChildrenOrBuilderList() { + return children_; + } + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public int getChildrenCount() { + return children_.size(); + } + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { + return children_.get(index); + } + /** + *
    +       * Objects which this object depends on.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index) { + return children_.get(index); + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List attributes_; + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + @java.lang.Override + public java.util.List getAttributesList() { + return attributes_; + } + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + @java.lang.Override + public java.util.List + getAttributesOrBuilderList() { + return attributes_; + } + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + @java.lang.Override + public int getAttributesCount() { + return attributes_.size(); + } + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index) { + return attributes_.get(index); + } + /** + *
    +       * Serialized data specific to this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( + int index) { + return attributes_.get(index); + } + + public static final int SLOT_VARIABLES_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List slotVariables_; + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public java.util.List getSlotVariablesList() { + return slotVariables_; + } + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public java.util.List + getSlotVariablesOrBuilderList() { + return slotVariables_; + } + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public int getSlotVariablesCount() { + return slotVariables_.size(); + } + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { + return slotVariables_.get(index); + } + /** + *
    +       * Slot variables owned by this object.
    +       * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index) { + return slotVariables_.get(index); + } + + public static final int REGISTERED_SAVER_FIELD_NUMBER = 4; + private org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver registeredSaver_; + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return Whether the registeredSaver field is set. + */ + @java.lang.Override + public boolean hasRegisteredSaver() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return The registeredSaver. + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver getRegisteredSaver() { + return registeredSaver_ == null ? org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance() : registeredSaver_; + } + /** + *
    +       * The registered saver used to save this object. If this saver is not
    +       * present when loading the checkpoint, then loading will fail.
    +       * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder getRegisteredSaverOrBuilder() { + return registeredSaver_ == null ? org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance() : registeredSaver_; + } + + public static final int HAS_CHECKPOINT_VALUES_FIELD_NUMBER = 5; + private com.google.protobuf.BoolValue hasCheckpointValues_; + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return Whether the hasCheckpointValues field is set. + */ + @java.lang.Override + public boolean hasHasCheckpointValues() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return The hasCheckpointValues. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getHasCheckpointValues() { + return hasCheckpointValues_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : hasCheckpointValues_; + } + /** + *
    +       * Whether this object has checkpoint values or descendants with checkpoint
    +       * values. This is computed at save time to avoid traversing the entire
    +       * object graph proto when restoring (which also has to traverse the live
    +       * object graph).
    +       * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getHasCheckpointValuesOrBuilder() { + return hasCheckpointValues_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : hasCheckpointValues_; + } + + 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 { + for (int i = 0; i < children_.size(); i++) { + output.writeMessage(1, children_.get(i)); + } + for (int i = 0; i < attributes_.size(); i++) { + output.writeMessage(2, attributes_.get(i)); + } + for (int i = 0; i < slotVariables_.size(); i++) { + output.writeMessage(3, slotVariables_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getRegisteredSaver()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getHasCheckpointValues()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < children_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, children_.get(i)); + } + for (int i = 0; i < attributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, attributes_.get(i)); + } + for (int i = 0; i < slotVariables_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, slotVariables_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getRegisteredSaver()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getHasCheckpointValues()); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject) obj; + + if (!getChildrenList() + .equals(other.getChildrenList())) return false; + if (!getAttributesList() + .equals(other.getAttributesList())) return false; + if (!getSlotVariablesList() + .equals(other.getSlotVariablesList())) return false; + if (hasRegisteredSaver() != other.hasRegisteredSaver()) return false; + if (hasRegisteredSaver()) { + if (!getRegisteredSaver() + .equals(other.getRegisteredSaver())) return false; + } + if (hasHasCheckpointValues() != other.hasHasCheckpointValues()) return false; + if (hasHasCheckpointValues()) { + if (!getHasCheckpointValues() + .equals(other.getHasCheckpointValues())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getChildrenCount() > 0) { + hash = (37 * hash) + CHILDREN_FIELD_NUMBER; + hash = (53 * hash) + getChildrenList().hashCode(); + } + if (getAttributesCount() > 0) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributesList().hashCode(); + } + if (getSlotVariablesCount() > 0) { + hash = (37 * hash) + SLOT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getSlotVariablesList().hashCode(); + } + if (hasRegisteredSaver()) { + hash = (37 * hash) + REGISTERED_SAVER_FIELD_NUMBER; + hash = (53 * hash) + getRegisteredSaver().hashCode(); + } + if (hasHasCheckpointValues()) { + hash = (37 * hash) + HAS_CHECKPOINT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getHasCheckpointValues().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph.TrackableObject} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph.TrackableObject) + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getChildrenFieldBuilder(); + getAttributesFieldBuilder(); + getSlotVariablesFieldBuilder(); + getRegisteredSaverFieldBuilder(); + getHasCheckpointValuesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + } else { + children_ = null; + childrenBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + } else { + attributes_ = null; + attributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (slotVariablesBuilder_ == null) { + slotVariables_ = java.util.Collections.emptyList(); + } else { + slotVariables_ = null; + slotVariablesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + registeredSaver_ = null; + if (registeredSaverBuilder_ != null) { + registeredSaverBuilder_.dispose(); + registeredSaverBuilder_ = null; + } + hasCheckpointValues_ = null; + if (hasCheckpointValuesBuilder_ != null) { + hasCheckpointValuesBuilder_.dispose(); + hasCheckpointValuesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject result) { + if (childrenBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + children_ = java.util.Collections.unmodifiableList(children_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.children_ = children_; + } else { + result.children_ = childrenBuilder_.build(); + } + if (attributesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + attributes_ = java.util.Collections.unmodifiableList(attributes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.attributes_ = attributes_; + } else { + result.attributes_ = attributesBuilder_.build(); + } + if (slotVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + slotVariables_ = java.util.Collections.unmodifiableList(slotVariables_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.slotVariables_ = slotVariables_; + } else { + result.slotVariables_ = slotVariablesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.registeredSaver_ = registeredSaverBuilder_ == null + ? registeredSaver_ + : registeredSaverBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.hasCheckpointValues_ = hasCheckpointValuesBuilder_ == null + ? hasCheckpointValues_ + : hasCheckpointValuesBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.getDefaultInstance()) return this; + if (childrenBuilder_ == null) { + if (!other.children_.isEmpty()) { + if (children_.isEmpty()) { + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChildrenIsMutable(); + children_.addAll(other.children_); + } + onChanged(); + } + } else { + if (!other.children_.isEmpty()) { + if (childrenBuilder_.isEmpty()) { + childrenBuilder_.dispose(); + childrenBuilder_ = null; + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000001); + childrenBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getChildrenFieldBuilder() : null; + } else { + childrenBuilder_.addAllMessages(other.children_); + } + } + } + if (attributesBuilder_ == null) { + if (!other.attributes_.isEmpty()) { + if (attributes_.isEmpty()) { + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAttributesIsMutable(); + attributes_.addAll(other.attributes_); + } + onChanged(); + } + } else { + if (!other.attributes_.isEmpty()) { + if (attributesBuilder_.isEmpty()) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000002); + attributesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAttributesFieldBuilder() : null; + } else { + attributesBuilder_.addAllMessages(other.attributes_); + } + } + } + if (slotVariablesBuilder_ == null) { + if (!other.slotVariables_.isEmpty()) { + if (slotVariables_.isEmpty()) { + slotVariables_ = other.slotVariables_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSlotVariablesIsMutable(); + slotVariables_.addAll(other.slotVariables_); + } + onChanged(); + } + } else { + if (!other.slotVariables_.isEmpty()) { + if (slotVariablesBuilder_.isEmpty()) { + slotVariablesBuilder_.dispose(); + slotVariablesBuilder_ = null; + slotVariables_ = other.slotVariables_; + bitField0_ = (bitField0_ & ~0x00000004); + slotVariablesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getSlotVariablesFieldBuilder() : null; + } else { + slotVariablesBuilder_.addAllMessages(other.slotVariables_); + } + } + } + if (other.hasRegisteredSaver()) { + mergeRegisteredSaver(other.getRegisteredSaver()); + } + if (other.hasHasCheckpointValues()) { + mergeHasCheckpointValues(other.getHasCheckpointValues()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.parser(), + extensionRegistry); + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(m); + } else { + childrenBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.parser(), + extensionRegistry); + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(m); + } else { + attributesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.parser(), + extensionRegistry); + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(m); + } else { + slotVariablesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + input.readMessage( + getRegisteredSaverFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + input.readMessage( + getHasCheckpointValuesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List children_ = + java.util.Collections.emptyList(); + private void ensureChildrenIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + children_ = new java.util.ArrayList(children_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> childrenBuilder_; + + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List getChildrenList() { + if (childrenBuilder_ == null) { + return java.util.Collections.unmodifiableList(children_); + } else { + return childrenBuilder_.getMessageList(); + } + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public int getChildrenCount() { + if (childrenBuilder_ == null) { + return children_.size(); + } else { + return childrenBuilder_.getCount(); + } + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference getChildren(int index) { + if (childrenBuilder_ == null) { + return children_.get(index); + } else { + return childrenBuilder_.getMessage(index); + } + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder setChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.set(index, value); + onChanged(); + } else { + childrenBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder setChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.set(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(value); + onChanged(); + } else { + childrenBuilder_.addMessage(value); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(index, value); + onChanged(); + } else { + childrenBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addChildren( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder addAllChildren( + java.lang.Iterable values) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, children_); + onChanged(); + } else { + childrenBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder clearChildren() { + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + childrenBuilder_.clear(); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public Builder removeChildren(int index) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.remove(index); + onChanged(); + } else { + childrenBuilder_.remove(index); + } + return this; + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder getChildrenBuilder( + int index) { + return getChildrenFieldBuilder().getBuilder(index); + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder getChildrenOrBuilder( + int index) { + if (childrenBuilder_ == null) { + return children_.get(index); } else { + return childrenBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List + getChildrenOrBuilderList() { + if (childrenBuilder_ != null) { + return childrenBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(children_); + } + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder() { + return getChildrenFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder addChildrenBuilder( + int index) { + return getChildrenFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.getDefaultInstance()); + } + /** + *
    +         * Objects which this object depends on.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference children = 1; + */ + public java.util.List + getChildrenBuilderList() { + return getChildrenFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder> + getChildrenFieldBuilder() { + if (childrenBuilder_ == null) { + childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.ObjectReferenceOrBuilder>( + children_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + children_ = null; + } + return childrenBuilder_; + } + + private java.util.List attributes_ = + java.util.Collections.emptyList(); + private void ensureAttributesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + attributes_ = new java.util.ArrayList(attributes_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder> attributesBuilder_; + + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public java.util.List getAttributesList() { + if (attributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(attributes_); + } else { + return attributesBuilder_.getMessageList(); + } + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public int getAttributesCount() { + if (attributesBuilder_ == null) { + return attributes_.size(); + } else { + return attributesBuilder_.getCount(); + } + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor getAttributes(int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); + } else { + return attributesBuilder_.getMessage(index); + } + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder setAttributes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.set(index, value); + onChanged(); + } else { + attributesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder setAttributes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.set(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder addAttributes(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(value); + onChanged(); + } else { + attributesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder addAttributes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(index, value); + onChanged(); + } else { + attributesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder addAttributes( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder addAttributes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder addAllAttributes( + java.lang.Iterable values) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, attributes_); + onChanged(); + } else { + attributesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder clearAttributes() { + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + attributesBuilder_.clear(); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public Builder removeAttributes(int index) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.remove(index); + onChanged(); + } else { + attributesBuilder_.remove(index); + } + return this; + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder getAttributesBuilder( + int index) { + return getAttributesFieldBuilder().getBuilder(index); + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder getAttributesOrBuilder( + int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); } else { + return attributesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public java.util.List + getAttributesOrBuilderList() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attributes_); + } + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder addAttributesBuilder() { + return getAttributesFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()); + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder addAttributesBuilder( + int index) { + return getAttributesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.getDefaultInstance()); + } + /** + *
    +         * Serialized data specific to this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor attributes = 2; + */ + public java.util.List + getAttributesBuilderList() { + return getAttributesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensor.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SerializedTensorOrBuilder>( + attributes_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + attributes_ = null; + } + return attributesBuilder_; + } + + private java.util.List slotVariables_ = + java.util.Collections.emptyList(); + private void ensureSlotVariablesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + slotVariables_ = new java.util.ArrayList(slotVariables_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> slotVariablesBuilder_; + + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List getSlotVariablesList() { + if (slotVariablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slotVariables_); + } else { + return slotVariablesBuilder_.getMessageList(); + } + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public int getSlotVariablesCount() { + if (slotVariablesBuilder_ == null) { + return slotVariables_.size(); + } else { + return slotVariablesBuilder_.getCount(); + } + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference getSlotVariables(int index) { + if (slotVariablesBuilder_ == null) { + return slotVariables_.get(index); + } else { + return slotVariablesBuilder_.getMessage(index); + } + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder setSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.set(index, value); + onChanged(); + } else { + slotVariablesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder setSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.set(index, builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.add(value); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference value) { + if (slotVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlotVariablesIsMutable(); + slotVariables_.add(index, value); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addSlotVariables( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder builderForValue) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.add(index, builderForValue.build()); + onChanged(); + } else { + slotVariablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder addAllSlotVariables( + java.lang.Iterable values) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slotVariables_); + onChanged(); + } else { + slotVariablesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder clearSlotVariables() { + if (slotVariablesBuilder_ == null) { + slotVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + slotVariablesBuilder_.clear(); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public Builder removeSlotVariables(int index) { + if (slotVariablesBuilder_ == null) { + ensureSlotVariablesIsMutable(); + slotVariables_.remove(index); + onChanged(); + } else { + slotVariablesBuilder_.remove(index); + } + return this; + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder getSlotVariablesBuilder( + int index) { + return getSlotVariablesFieldBuilder().getBuilder(index); + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder getSlotVariablesOrBuilder( + int index) { + if (slotVariablesBuilder_ == null) { + return slotVariables_.get(index); } else { + return slotVariablesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List + getSlotVariablesOrBuilderList() { + if (slotVariablesBuilder_ != null) { + return slotVariablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(slotVariables_); + } + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder() { + return getSlotVariablesFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder addSlotVariablesBuilder( + int index) { + return getSlotVariablesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.getDefaultInstance()); + } + /** + *
    +         * Slot variables owned by this object.
    +         * 
    + * + * repeated .tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference slot_variables = 3; + */ + public java.util.List + getSlotVariablesBuilderList() { + return getSlotVariablesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder> + getSlotVariablesFieldBuilder() { + if (slotVariablesBuilder_ == null) { + slotVariablesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReference.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.SlotVariableReferenceOrBuilder>( + slotVariables_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + slotVariables_ = null; + } + return slotVariablesBuilder_; + } + + private org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver registeredSaver_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder> registeredSaverBuilder_; + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return Whether the registeredSaver field is set. + */ + public boolean hasRegisteredSaver() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + * @return The registeredSaver. + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver getRegisteredSaver() { + if (registeredSaverBuilder_ == null) { + return registeredSaver_ == null ? org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance() : registeredSaver_; + } else { + return registeredSaverBuilder_.getMessage(); + } + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public Builder setRegisteredSaver(org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver value) { + if (registeredSaverBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + registeredSaver_ = value; + } else { + registeredSaverBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public Builder setRegisteredSaver( + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder builderForValue) { + if (registeredSaverBuilder_ == null) { + registeredSaver_ = builderForValue.build(); + } else { + registeredSaverBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public Builder mergeRegisteredSaver(org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver value) { + if (registeredSaverBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + registeredSaver_ != null && + registeredSaver_ != org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance()) { + getRegisteredSaverBuilder().mergeFrom(value); + } else { + registeredSaver_ = value; + } + } else { + registeredSaverBuilder_.mergeFrom(value); + } + if (registeredSaver_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public Builder clearRegisteredSaver() { + bitField0_ = (bitField0_ & ~0x00000008); + registeredSaver_ = null; + if (registeredSaverBuilder_ != null) { + registeredSaverBuilder_.dispose(); + registeredSaverBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder getRegisteredSaverBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRegisteredSaverFieldBuilder().getBuilder(); + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder getRegisteredSaverOrBuilder() { + if (registeredSaverBuilder_ != null) { + return registeredSaverBuilder_.getMessageOrBuilder(); + } else { + return registeredSaver_ == null ? + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance() : registeredSaver_; + } + } + /** + *
    +         * The registered saver used to save this object. If this saver is not
    +         * present when loading the checkpoint, then loading will fail.
    +         * 
    + * + * .tensorflow.RegisteredSaver registered_saver = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder> + getRegisteredSaverFieldBuilder() { + if (registeredSaverBuilder_ == null) { + registeredSaverBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder>( + getRegisteredSaver(), + getParentForChildren(), + isClean()); + registeredSaver_ = null; + } + return registeredSaverBuilder_; + } + + private com.google.protobuf.BoolValue hasCheckpointValues_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> hasCheckpointValuesBuilder_; + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return Whether the hasCheckpointValues field is set. + */ + public boolean hasHasCheckpointValues() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + * @return The hasCheckpointValues. + */ + public com.google.protobuf.BoolValue getHasCheckpointValues() { + if (hasCheckpointValuesBuilder_ == null) { + return hasCheckpointValues_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : hasCheckpointValues_; + } else { + return hasCheckpointValuesBuilder_.getMessage(); + } + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public Builder setHasCheckpointValues(com.google.protobuf.BoolValue value) { + if (hasCheckpointValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hasCheckpointValues_ = value; + } else { + hasCheckpointValuesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public Builder setHasCheckpointValues( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (hasCheckpointValuesBuilder_ == null) { + hasCheckpointValues_ = builderForValue.build(); + } else { + hasCheckpointValuesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public Builder mergeHasCheckpointValues(com.google.protobuf.BoolValue value) { + if (hasCheckpointValuesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + hasCheckpointValues_ != null && + hasCheckpointValues_ != com.google.protobuf.BoolValue.getDefaultInstance()) { + getHasCheckpointValuesBuilder().mergeFrom(value); + } else { + hasCheckpointValues_ = value; + } + } else { + hasCheckpointValuesBuilder_.mergeFrom(value); + } + if (hasCheckpointValues_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public Builder clearHasCheckpointValues() { + bitField0_ = (bitField0_ & ~0x00000010); + hasCheckpointValues_ = null; + if (hasCheckpointValuesBuilder_ != null) { + hasCheckpointValuesBuilder_.dispose(); + hasCheckpointValuesBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public com.google.protobuf.BoolValue.Builder getHasCheckpointValuesBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getHasCheckpointValuesFieldBuilder().getBuilder(); + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + public com.google.protobuf.BoolValueOrBuilder getHasCheckpointValuesOrBuilder() { + if (hasCheckpointValuesBuilder_ != null) { + return hasCheckpointValuesBuilder_.getMessageOrBuilder(); + } else { + return hasCheckpointValues_ == null ? + com.google.protobuf.BoolValue.getDefaultInstance() : hasCheckpointValues_; + } + } + /** + *
    +         * Whether this object has checkpoint values or descendants with checkpoint
    +         * values. This is computed at save time to avoid traversing the entire
    +         * object graph proto when restoring (which also has to traverse the live
    +         * object graph).
    +         * 
    + * + * .google.protobuf.BoolValue has_checkpoint_values = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> + getHasCheckpointValuesFieldBuilder() { + if (hasCheckpointValuesBuilder_ == null) { + hasCheckpointValuesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( + getHasCheckpointValues(), + getParentForChildren(), + isClean()); + hasCheckpointValues_ = null; + } + return hasCheckpointValuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TrackableObjectGraph.TrackableObject) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph.TrackableObject) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrackableObject parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NODES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + @java.lang.Override + public java.util.List getNodesList() { + return nodes_; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + @java.lang.Override + public java.util.List + getNodesOrBuilderList() { + return nodes_; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getNodes(int index) { + return nodes_.get(index); + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( + int index) { + return nodes_.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 { + for (int i = 0; i < nodes_.size(); i++) { + output.writeMessage(1, nodes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, nodes_.get(i)); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.TrackableObjectGraph)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph) obj; + + if (!getNodesList() + .equals(other.getNodesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph 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.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph 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.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.TrackableObjectGraph 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.TrackableObjectGraph} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.TrackableObjectGraph) + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraphOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_TrackableObjectGraph_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.getDefaultInstance()) return this; + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + nodesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNodesFieldBuilder() : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject m = + input.readMessage( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List nodes_ = + java.util.Collections.emptyList(); + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodes_ = new java.util.ArrayList(nodes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder> nodesBuilder_; + + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public java.util.List getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder setNodes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder setNodes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder addNodes(org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder addNodes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder addNodes( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder addNodes( + int index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder addAllNodes( + java.lang.Iterable values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder getNodesBuilder( + int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder getNodesOrBuilder( + int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public java.util.List + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder addNodesBuilder() { + return getNodesFieldBuilder().addBuilder( + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.getDefaultInstance()); + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder addNodesBuilder( + int index) { + return getNodesFieldBuilder().addBuilder( + index, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.getDefaultInstance()); + } + /** + * repeated .tensorflow.TrackableObjectGraph.TrackableObject nodes = 1; + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObject.Builder, org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph.TrackableObjectOrBuilder>( + nodes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.TrackableObjectGraph) + } + + // @@protoc_insertion_point(class_scope:tensorflow.TrackableObjectGraph) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.TrackableObjectGraph getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TrackableObjectGraph parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.TrackableObjectGraph getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RegisteredSaverOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RegisteredSaver) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The name of the registered saver/restore function.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * The name of the registered saver/restore function.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Unique auto-generated name of the object.
    +     * 
    + * + * string object_name = 2; + * @return The objectName. + */ + java.lang.String getObjectName(); + /** + *
    +     * Unique auto-generated name of the object.
    +     * 
    + * + * string object_name = 2; + * @return The bytes for objectName. + */ + com.google.protobuf.ByteString + getObjectNameBytes(); + } + /** + * Protobuf type {@code tensorflow.RegisteredSaver} + */ + public static final class RegisteredSaver extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RegisteredSaver) + RegisteredSaverOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RegisteredSaver.class.getName()); + } + // Use RegisteredSaver.newBuilder() to construct. + private RegisteredSaver(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RegisteredSaver() { + name_ = ""; + objectName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_RegisteredSaver_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_RegisteredSaver_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * The name of the registered saver/restore function.
    +     * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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 registered saver/restore function.
    +     * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 OBJECT_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object objectName_ = ""; + /** + *
    +     * Unique auto-generated name of the object.
    +     * 
    + * + * string object_name = 2; + * @return The objectName. + */ + @java.lang.Override + public java.lang.String getObjectName() { + java.lang.Object ref = objectName_; + 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(); + objectName_ = s; + return s; + } + } + /** + *
    +     * Unique auto-generated name of the object.
    +     * 
    + * + * string object_name = 2; + * @return The bytes for objectName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getObjectNameBytes() { + java.lang.Object ref = objectName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + objectName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(objectName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, objectName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(objectName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, objectName_); + } + size += getUnknownFields().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.TrackableObjectGraphOuterClass.RegisteredSaver)) { + return super.equals(obj); + } + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver other = (org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getObjectName() + .equals(other.getObjectName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OBJECT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getObjectName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver 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.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver 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.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TrackableObjectGraphOuterClass.RegisteredSaver 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.RegisteredSaver} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RegisteredSaver) + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaverOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_RegisteredSaver_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_RegisteredSaver_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.class, org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.Builder.class); + } + + // Construct using org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + objectName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.internal_static_tensorflow_RegisteredSaver_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver getDefaultInstanceForType() { + return org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver build() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver buildPartial() { + org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver result = new org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.objectName_ = objectName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver) { + return mergeFrom((org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver other) { + if (other == org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getObjectName().isEmpty()) { + objectName_ = other.objectName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + objectName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +       * The name of the registered saver/restore function.
    +       * 
    + * + * string name = 1; + * @return The name. + */ + 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 registered saver/restore function.
    +       * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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 registered saver/restore function.
    +       * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The name of the registered saver/restore function.
    +       * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * The name of the registered saver/restore function.
    +       * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object objectName_ = ""; + /** + *
    +       * Unique auto-generated name of the object.
    +       * 
    + * + * string object_name = 2; + * @return The objectName. + */ + public java.lang.String getObjectName() { + java.lang.Object ref = objectName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + objectName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Unique auto-generated name of the object.
    +       * 
    + * + * string object_name = 2; + * @return The bytes for objectName. + */ + public com.google.protobuf.ByteString + getObjectNameBytes() { + java.lang.Object ref = objectName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + objectName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Unique auto-generated name of the object.
    +       * 
    + * + * string object_name = 2; + * @param value The objectName to set. + * @return This builder for chaining. + */ + public Builder setObjectName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + objectName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Unique auto-generated name of the object.
    +       * 
    + * + * string object_name = 2; + * @return This builder for chaining. + */ + public Builder clearObjectName() { + objectName_ = getDefaultInstance().getObjectName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Unique auto-generated name of the object.
    +       * 
    + * + * string object_name = 2; + * @param value The bytes for objectName to set. + * @return This builder for chaining. + */ + public Builder setObjectNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + objectName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RegisteredSaver) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RegisteredSaver) + private static final org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver(); + } + + public static org.tensorflow.proto.TrackableObjectGraphOuterClass.RegisteredSaver getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RegisteredSaver parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TrackableObjectGraphOuterClass.RegisteredSaver getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TrackableObjectGraph_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RegisteredSaver_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RegisteredSaver_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n5tensorflow/core/protobuf/trackable_obj" + + "ect_graph.proto\022\ntensorflow\032\036google/prot" + + "obuf/wrappers.proto\"\363\005\n\024TrackableObjectG" + + "raph\022?\n\005nodes\030\001 \003(\01320.tensorflow.Trackab" + + "leObjectGraph.TrackableObject\032\231\005\n\017Tracka" + + "bleObject\022R\n\010children\030\001 \003(\0132@.tensorflow" + + ".TrackableObjectGraph.TrackableObject.Ob" + + "jectReference\022U\n\nattributes\030\002 \003(\0132A.tens" + + "orflow.TrackableObjectGraph.TrackableObj" + + "ect.SerializedTensor\022^\n\016slot_variables\030\003" + + " \003(\0132F.tensorflow.TrackableObjectGraph.T" + + "rackableObject.SlotVariableReference\0225\n\020" + + "registered_saver\030\004 \001(\0132\033.tensorflow.Regi" + + "steredSaver\0229\n\025has_checkpoint_values\030\005 \001" + + "(\0132\032.google.protobuf.BoolValue\0326\n\017Object" + + "Reference\022\017\n\007node_id\030\001 \001(\005\022\022\n\nlocal_name" + + "\030\002 \001(\t\032c\n\020SerializedTensor\022\014\n\004name\030\001 \001(\t" + + "\022\021\n\tfull_name\030\002 \001(\t\022\026\n\016checkpoint_key\030\003 " + + "\001(\tJ\004\010\004\020\005R\020optional_restore\032l\n\025SlotVaria" + + "bleReference\022!\n\031original_variable_node_i" + + "d\030\001 \001(\005\022\021\n\tslot_name\030\002 \001(\t\022\035\n\025slot_varia" + + "ble_node_id\030\003 \001(\005\"4\n\017RegisteredSaver\022\014\n\004" + + "name\030\001 \001(\t\022\023\n\013object_name\030\002 \001(\tBp\n\024org.t" + + "ensorflow.protoZUgithub.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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_tensorflow_TrackableObjectGraph_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_TrackableObjectGraph_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TrackableObjectGraph_descriptor, + new java.lang.String[] { "Nodes", }); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor = + internal_static_tensorflow_TrackableObjectGraph_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor, + new java.lang.String[] { "Children", "Attributes", "SlotVariables", "RegisteredSaver", "HasCheckpointValues", }); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor = + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_ObjectReference_descriptor, + new java.lang.String[] { "NodeId", "LocalName", }); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor = + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SerializedTensor_descriptor, + new java.lang.String[] { "Name", "FullName", "CheckpointKey", }); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor = + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_TrackableObjectGraph_TrackableObject_SlotVariableReference_descriptor, + new java.lang.String[] { "OriginalVariableNodeId", "SlotName", "SlotVariableNodeId", }); + internal_static_tensorflow_RegisteredSaver_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_RegisteredSaver_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RegisteredSaver_descriptor, + new java.lang.String[] { "Name", "ObjectName", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TransportOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TransportOptions.java new file mode 100644 index 00000000000..6f2d3dbb71d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TransportOptions.java @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/transport_options.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TransportOptions { + private TransportOptions() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TransportOptions.class.getName()); + } + 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 RecvBufRespExtraOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.RecvBufRespExtra) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated bytes tensor_content = 1; + * @return A list containing the tensorContent. + */ + java.util.List getTensorContentList(); + /** + * repeated bytes tensor_content = 1; + * @return The count of tensorContent. + */ + int getTensorContentCount(); + /** + * repeated bytes tensor_content = 1; + * @param index The index of the element to return. + * @return The tensorContent at the given index. + */ + com.google.protobuf.ByteString getTensorContent(int index); + } + /** + *
    +   * Extra data needed on a non-RDMA RecvBufResponse.
    +   * 
    + * + * Protobuf type {@code tensorflow.RecvBufRespExtra} + */ + public static final class RecvBufRespExtra extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.RecvBufRespExtra) + RecvBufRespExtraOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + RecvBufRespExtra.class.getName()); + } + // Use RecvBufRespExtra.newBuilder() to construct. + private RecvBufRespExtra(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RecvBufRespExtra() { + tensorContent_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TransportOptions.RecvBufRespExtra.class, org.tensorflow.proto.TransportOptions.RecvBufRespExtra.Builder.class); + } + + public static final int TENSOR_CONTENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList tensorContent_ = + emptyList(com.google.protobuf.ByteString.class); + /** + * repeated bytes tensor_content = 1; + * @return A list containing the tensorContent. + */ + @java.lang.Override + public java.util.List + getTensorContentList() { + return tensorContent_; + } + /** + * repeated bytes tensor_content = 1; + * @return The count of tensorContent. + */ + public int getTensorContentCount() { + return tensorContent_.size(); + } + /** + * repeated bytes tensor_content = 1; + * @param index The index of the element to return. + * @return The tensorContent at the given index. + */ + public com.google.protobuf.ByteString getTensorContent(int index) { + return tensorContent_.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 { + for (int i = 0; i < tensorContent_.size(); i++) { + output.writeBytes(1, tensorContent_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < tensorContent_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(tensorContent_.get(i)); + } + size += dataSize; + size += 1 * getTensorContentList().size(); + } + size += getUnknownFields().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.TransportOptions.RecvBufRespExtra)) { + return super.equals(obj); + } + org.tensorflow.proto.TransportOptions.RecvBufRespExtra other = (org.tensorflow.proto.TransportOptions.RecvBufRespExtra) obj; + + if (!getTensorContentList() + .equals(other.getTensorContentList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorContentCount() > 0) { + hash = (37 * hash) + TENSOR_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getTensorContentList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra 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.TransportOptions.RecvBufRespExtra parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra 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.TransportOptions.RecvBufRespExtra parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.TransportOptions.RecvBufRespExtra 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Extra data needed on a non-RDMA RecvBufResponse.
    +     * 
    + * + * Protobuf type {@code tensorflow.RecvBufRespExtra} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.RecvBufRespExtra) + org.tensorflow.proto.TransportOptions.RecvBufRespExtraOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.TransportOptions.RecvBufRespExtra.class, org.tensorflow.proto.TransportOptions.RecvBufRespExtra.Builder.class); + } + + // Construct using org.tensorflow.proto.TransportOptions.RecvBufRespExtra.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tensorContent_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TransportOptions.internal_static_tensorflow_RecvBufRespExtra_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.TransportOptions.RecvBufRespExtra getDefaultInstanceForType() { + return org.tensorflow.proto.TransportOptions.RecvBufRespExtra.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.TransportOptions.RecvBufRespExtra build() { + org.tensorflow.proto.TransportOptions.RecvBufRespExtra result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.TransportOptions.RecvBufRespExtra buildPartial() { + org.tensorflow.proto.TransportOptions.RecvBufRespExtra result = new org.tensorflow.proto.TransportOptions.RecvBufRespExtra(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.TransportOptions.RecvBufRespExtra result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + tensorContent_.makeImmutable(); + result.tensorContent_ = tensorContent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.TransportOptions.RecvBufRespExtra) { + return mergeFrom((org.tensorflow.proto.TransportOptions.RecvBufRespExtra)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.TransportOptions.RecvBufRespExtra other) { + if (other == org.tensorflow.proto.TransportOptions.RecvBufRespExtra.getDefaultInstance()) return this; + if (!other.tensorContent_.isEmpty()) { + if (tensorContent_.isEmpty()) { + tensorContent_ = other.tensorContent_; + tensorContent_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureTensorContentIsMutable(); + tensorContent_.addAll(other.tensorContent_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString v = input.readBytes(); + ensureTensorContentIsMutable(); + tensorContent_.add(v); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.ProtobufList tensorContent_ = emptyList(com.google.protobuf.ByteString.class); + private void ensureTensorContentIsMutable() { + if (!tensorContent_.isModifiable()) { + tensorContent_ = makeMutableCopy(tensorContent_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated bytes tensor_content = 1; + * @return A list containing the tensorContent. + */ + public java.util.List + getTensorContentList() { + tensorContent_.makeImmutable(); + return tensorContent_; + } + /** + * repeated bytes tensor_content = 1; + * @return The count of tensorContent. + */ + public int getTensorContentCount() { + return tensorContent_.size(); + } + /** + * repeated bytes tensor_content = 1; + * @param index The index of the element to return. + * @return The tensorContent at the given index. + */ + public com.google.protobuf.ByteString getTensorContent(int index) { + return tensorContent_.get(index); + } + /** + * repeated bytes tensor_content = 1; + * @param index The index to set the value at. + * @param value The tensorContent to set. + * @return This builder for chaining. + */ + public Builder setTensorContent( + int index, com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureTensorContentIsMutable(); + tensorContent_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes tensor_content = 1; + * @param value The tensorContent to add. + * @return This builder for chaining. + */ + public Builder addTensorContent(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureTensorContentIsMutable(); + tensorContent_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes tensor_content = 1; + * @param values The tensorContent to add. + * @return This builder for chaining. + */ + public Builder addAllTensorContent( + java.lang.Iterable values) { + ensureTensorContentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensorContent_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated bytes tensor_content = 1; + * @return This builder for chaining. + */ + public Builder clearTensorContent() { + tensorContent_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.RecvBufRespExtra) + } + + // @@protoc_insertion_point(class_scope:tensorflow.RecvBufRespExtra) + private static final org.tensorflow.proto.TransportOptions.RecvBufRespExtra DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.TransportOptions.RecvBufRespExtra(); + } + + public static org.tensorflow.proto.TransportOptions.RecvBufRespExtra getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecvBufRespExtra parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.TransportOptions.RecvBufRespExtra getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_RecvBufRespExtra_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0tensorflow/core/protobuf/transport_opt" + + "ions.proto\022\ntensorflow\"*\n\020RecvBufRespExt" + + "ra\022\026\n\016tensor_content\030\001 \003(\014Bm\n\024org.tensor" + + "flow.protoZUgithub.com/tensorflow/tensor" + + "flow/tensorflow/go/core/protobuf/for_cor" + + "e_protos_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_RecvBufRespExtra_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_RecvBufRespExtra_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_RecvBufRespExtra_descriptor, + new java.lang.String[] { "TensorContent", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TypesProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TypesProtos.java new file mode 100644 index 00000000000..262c275afad --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/TypesProtos.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/types.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class TypesProtos { + private TypesProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TypesProtos.class.getName()); + } + 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_SerializedDType_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_SerializedDType_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/framework/types.proto\022" + + "\ntensorflow\"9\n\017SerializedDType\022&\n\010dataty" + + "pe\030\001 \001(\0162\024.tensorflow.DataType*\251\t\n\010DataT" + + "ype\022\016\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT_" + + "DOUBLE\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014\n\010" + + "DT_INT16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007\022\020" + + "\n\014DT_COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_BOO" + + "L\020\n\022\014\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT_Q" + + "INT32\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020\017\022" + + "\016\n\nDT_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_COM" + + "PLEX128\020\022\022\013\n\007DT_HALF\020\023\022\017\n\013DT_RESOURCE\020\024\022" + + "\016\n\nDT_VARIANT\020\025\022\r\n\tDT_UINT32\020\026\022\r\n\tDT_UIN" + + "T64\020\027\022\022\n\016DT_FLOAT8_E5M2\020\030\022\024\n\020DT_FLOAT8_E" + + "4M3FN\020\031\022\026\n\022DT_FLOAT8_E4M3FNUZ\020\032\022\031\n\025DT_FL" + + "OAT8_E4M3B11FNUZ\020\033\022\026\n\022DT_FLOAT8_E5M2FNUZ" + + "\020\034\022\013\n\007DT_INT4\020\035\022\014\n\010DT_UINT4\020\036\022\013\n\007DT_INT2" + + "\020\037\022\014\n\010DT_UINT2\020 \022\020\n\014DT_FLOAT_REF\020e\022\021\n\rDT" + + "_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022\020\n\014DT_UI" + + "NT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013DT_INT8_R" + + "EF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_COMPLEX64_" + + "REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BOOL_REF\020n" + + "\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_REF\020p\022\021\n" + + "\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_REF\020r\022\021\n" + + "\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_REF\020t\022\021\n\r" + + "DT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128_REF\020v\022\017" + + "\n\013DT_HALF_REF\020w\022\023\n\017DT_RESOURCE_REF\020x\022\022\n\016" + + "DT_VARIANT_REF\020y\022\021\n\rDT_UINT32_REF\020z\022\021\n\rD" + + "T_UINT64_REF\020{\022\026\n\022DT_FLOAT8_E5M2_REF\020|\022\030" + + "\n\024DT_FLOAT8_E4M3FN_REF\020}\022\032\n\026DT_FLOAT8_E4" + + "M3FNUZ_REF\020~\022\035\n\031DT_FLOAT8_E4M3B11FNUZ_RE" + + "F\020\177\022\033\n\026DT_FLOAT8_E5M2FNUZ_REF\020\200\001\022\020\n\013DT_I" + + "NT4_REF\020\201\001\022\021\n\014DT_UINT4_REF\020\202\001\022\020\n\013DT_INT2" + + "_REF\020\203\001\022\021\n\014DT_UINT2_REF\020\204\001Bv\n\024org.tensor" + + "flow.protoB\013TypesProtosP\001ZLgithub.com/te" + + "nsorflow/tensorflow/tensorflow/go/core/f" + + "ramework/types_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_SerializedDType_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_SerializedDType_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_SerializedDType_descriptor, + new java.lang.String[] { "Datatype", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/UniformQuantOpsAttr.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/UniformQuantOpsAttr.java new file mode 100644 index 00000000000..91595e4d9c8 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/UniformQuantOpsAttr.java @@ -0,0 +1,1771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/quantization/uniform_quant_ops_attr.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class UniformQuantOpsAttr { + private UniformQuantOpsAttr() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + UniformQuantOpsAttr.class.getName()); + } + 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 UniformQuantizedConvolutionDimensionNumbersAttrOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The dimension that represents batch in the input.
    +     * 
    + * + * int64 input_batch_dimension = 1; + * @return The inputBatchDimension. + */ + long getInputBatchDimension(); + + /** + *
    +     * The dimension that represents features in the input.
    +     * 
    + * + * int64 input_feature_dimension = 2; + * @return The inputFeatureDimension. + */ + long getInputFeatureDimension(); + + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return A list containing the inputSpatialDimensions. + */ + java.util.List getInputSpatialDimensionsList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return The count of inputSpatialDimensions. + */ + int getInputSpatialDimensionsCount(); + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param index The index of the element to return. + * @return The inputSpatialDimensions at the given index. + */ + long getInputSpatialDimensions(int index); + + /** + *
    +     * The dimension that represents input features in the kernel (rhs).
    +     * 
    + * + * int64 kernel_input_feature_dimension = 4; + * @return The kernelInputFeatureDimension. + */ + long getKernelInputFeatureDimension(); + + /** + *
    +     * The dimension that represents output features in the kernel (rhs).
    +     * 
    + * + * int64 kernel_output_feature_dimension = 5; + * @return The kernelOutputFeatureDimension. + */ + long getKernelOutputFeatureDimension(); + + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return A list containing the kernelSpatialDimensions. + */ + java.util.List getKernelSpatialDimensionsList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return The count of kernelSpatialDimensions. + */ + int getKernelSpatialDimensionsCount(); + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param index The index of the element to return. + * @return The kernelSpatialDimensions at the given index. + */ + long getKernelSpatialDimensions(int index); + + /** + *
    +     * The dimension that represents batch in the output.
    +     * 
    + * + * int64 output_batch_dimension = 7; + * @return The outputBatchDimension. + */ + long getOutputBatchDimension(); + + /** + *
    +     * The dimension that represents features in the output.
    +     * 
    + * + * int64 output_feature_dimension = 8; + * @return The outputFeatureDimension. + */ + long getOutputFeatureDimension(); + + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return A list containing the outputSpatialDimensions. + */ + java.util.List getOutputSpatialDimensionsList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return The count of outputSpatialDimensions. + */ + int getOutputSpatialDimensionsCount(); + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param index The index of the element to return. + * @return The outputSpatialDimensions at the given index. + */ + long getOutputSpatialDimensions(int index); + } + /** + *
    +   * Describes the dimension numbers for Convolution op. Corresponds to
    +   * ::mlir::mhlo::ConvDimensionNumbersAttr.
    +   * 
    + * + * Protobuf type {@code tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr} + */ + public static final class UniformQuantizedConvolutionDimensionNumbersAttr extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr) + UniformQuantizedConvolutionDimensionNumbersAttrOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + UniformQuantizedConvolutionDimensionNumbersAttr.class.getName()); + } + // Use UniformQuantizedConvolutionDimensionNumbersAttr.newBuilder() to construct. + private UniformQuantizedConvolutionDimensionNumbersAttr(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private UniformQuantizedConvolutionDimensionNumbersAttr() { + inputSpatialDimensions_ = emptyLongList(); + kernelSpatialDimensions_ = emptyLongList(); + outputSpatialDimensions_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.UniformQuantOpsAttr.internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.UniformQuantOpsAttr.internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.class, org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.Builder.class); + } + + public static final int INPUT_BATCH_DIMENSION_FIELD_NUMBER = 1; + private long inputBatchDimension_ = 0L; + /** + *
    +     * The dimension that represents batch in the input.
    +     * 
    + * + * int64 input_batch_dimension = 1; + * @return The inputBatchDimension. + */ + @java.lang.Override + public long getInputBatchDimension() { + return inputBatchDimension_; + } + + public static final int INPUT_FEATURE_DIMENSION_FIELD_NUMBER = 2; + private long inputFeatureDimension_ = 0L; + /** + *
    +     * The dimension that represents features in the input.
    +     * 
    + * + * int64 input_feature_dimension = 2; + * @return The inputFeatureDimension. + */ + @java.lang.Override + public long getInputFeatureDimension() { + return inputFeatureDimension_; + } + + public static final int INPUT_SPATIAL_DIMENSIONS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList inputSpatialDimensions_ = + emptyLongList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return A list containing the inputSpatialDimensions. + */ + @java.lang.Override + public java.util.List + getInputSpatialDimensionsList() { + return inputSpatialDimensions_; + } + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return The count of inputSpatialDimensions. + */ + public int getInputSpatialDimensionsCount() { + return inputSpatialDimensions_.size(); + } + /** + *
    +     * The dimensions that represents spatial dimensions in the input. Length must
    +     * be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param index The index of the element to return. + * @return The inputSpatialDimensions at the given index. + */ + public long getInputSpatialDimensions(int index) { + return inputSpatialDimensions_.getLong(index); + } + private int inputSpatialDimensionsMemoizedSerializedSize = -1; + + public static final int KERNEL_INPUT_FEATURE_DIMENSION_FIELD_NUMBER = 4; + private long kernelInputFeatureDimension_ = 0L; + /** + *
    +     * The dimension that represents input features in the kernel (rhs).
    +     * 
    + * + * int64 kernel_input_feature_dimension = 4; + * @return The kernelInputFeatureDimension. + */ + @java.lang.Override + public long getKernelInputFeatureDimension() { + return kernelInputFeatureDimension_; + } + + public static final int KERNEL_OUTPUT_FEATURE_DIMENSION_FIELD_NUMBER = 5; + private long kernelOutputFeatureDimension_ = 0L; + /** + *
    +     * The dimension that represents output features in the kernel (rhs).
    +     * 
    + * + * int64 kernel_output_feature_dimension = 5; + * @return The kernelOutputFeatureDimension. + */ + @java.lang.Override + public long getKernelOutputFeatureDimension() { + return kernelOutputFeatureDimension_; + } + + public static final int KERNEL_SPATIAL_DIMENSIONS_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList kernelSpatialDimensions_ = + emptyLongList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return A list containing the kernelSpatialDimensions. + */ + @java.lang.Override + public java.util.List + getKernelSpatialDimensionsList() { + return kernelSpatialDimensions_; + } + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return The count of kernelSpatialDimensions. + */ + public int getKernelSpatialDimensionsCount() { + return kernelSpatialDimensions_.size(); + } + /** + *
    +     * The dimensions that represents spatial dimensions in the kernel (rhs).
    +     * Length must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param index The index of the element to return. + * @return The kernelSpatialDimensions at the given index. + */ + public long getKernelSpatialDimensions(int index) { + return kernelSpatialDimensions_.getLong(index); + } + private int kernelSpatialDimensionsMemoizedSerializedSize = -1; + + public static final int OUTPUT_BATCH_DIMENSION_FIELD_NUMBER = 7; + private long outputBatchDimension_ = 0L; + /** + *
    +     * The dimension that represents batch in the output.
    +     * 
    + * + * int64 output_batch_dimension = 7; + * @return The outputBatchDimension. + */ + @java.lang.Override + public long getOutputBatchDimension() { + return outputBatchDimension_; + } + + public static final int OUTPUT_FEATURE_DIMENSION_FIELD_NUMBER = 8; + private long outputFeatureDimension_ = 0L; + /** + *
    +     * The dimension that represents features in the output.
    +     * 
    + * + * int64 output_feature_dimension = 8; + * @return The outputFeatureDimension. + */ + @java.lang.Override + public long getOutputFeatureDimension() { + return outputFeatureDimension_; + } + + public static final int OUTPUT_SPATIAL_DIMENSIONS_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList outputSpatialDimensions_ = + emptyLongList(); + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return A list containing the outputSpatialDimensions. + */ + @java.lang.Override + public java.util.List + getOutputSpatialDimensionsList() { + return outputSpatialDimensions_; + } + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return The count of outputSpatialDimensions. + */ + public int getOutputSpatialDimensionsCount() { + return outputSpatialDimensions_.size(); + } + /** + *
    +     * The dimensions that represents spatial dimensions in the output. Length
    +     * must be rank-2 for the tensor rank for Convolution op.
    +     * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param index The index of the element to return. + * @return The outputSpatialDimensions at the given index. + */ + public long getOutputSpatialDimensions(int index) { + return outputSpatialDimensions_.getLong(index); + } + private int outputSpatialDimensionsMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (inputBatchDimension_ != 0L) { + output.writeInt64(1, inputBatchDimension_); + } + if (inputFeatureDimension_ != 0L) { + output.writeInt64(2, inputFeatureDimension_); + } + if (getInputSpatialDimensionsList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(inputSpatialDimensionsMemoizedSerializedSize); + } + for (int i = 0; i < inputSpatialDimensions_.size(); i++) { + output.writeInt64NoTag(inputSpatialDimensions_.getLong(i)); + } + if (kernelInputFeatureDimension_ != 0L) { + output.writeInt64(4, kernelInputFeatureDimension_); + } + if (kernelOutputFeatureDimension_ != 0L) { + output.writeInt64(5, kernelOutputFeatureDimension_); + } + if (getKernelSpatialDimensionsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(kernelSpatialDimensionsMemoizedSerializedSize); + } + for (int i = 0; i < kernelSpatialDimensions_.size(); i++) { + output.writeInt64NoTag(kernelSpatialDimensions_.getLong(i)); + } + if (outputBatchDimension_ != 0L) { + output.writeInt64(7, outputBatchDimension_); + } + if (outputFeatureDimension_ != 0L) { + output.writeInt64(8, outputFeatureDimension_); + } + if (getOutputSpatialDimensionsList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(outputSpatialDimensionsMemoizedSerializedSize); + } + for (int i = 0; i < outputSpatialDimensions_.size(); i++) { + output.writeInt64NoTag(outputSpatialDimensions_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (inputBatchDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, inputBatchDimension_); + } + if (inputFeatureDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, inputFeatureDimension_); + } + { + int dataSize = 0; + for (int i = 0; i < inputSpatialDimensions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(inputSpatialDimensions_.getLong(i)); + } + size += dataSize; + if (!getInputSpatialDimensionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + inputSpatialDimensionsMemoizedSerializedSize = dataSize; + } + if (kernelInputFeatureDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, kernelInputFeatureDimension_); + } + if (kernelOutputFeatureDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, kernelOutputFeatureDimension_); + } + { + int dataSize = 0; + for (int i = 0; i < kernelSpatialDimensions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(kernelSpatialDimensions_.getLong(i)); + } + size += dataSize; + if (!getKernelSpatialDimensionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + kernelSpatialDimensionsMemoizedSerializedSize = dataSize; + } + if (outputBatchDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, outputBatchDimension_); + } + if (outputFeatureDimension_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, outputFeatureDimension_); + } + { + int dataSize = 0; + for (int i = 0; i < outputSpatialDimensions_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(outputSpatialDimensions_.getLong(i)); + } + size += dataSize; + if (!getOutputSpatialDimensionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + outputSpatialDimensionsMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr)) { + return super.equals(obj); + } + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr other = (org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr) obj; + + if (getInputBatchDimension() + != other.getInputBatchDimension()) return false; + if (getInputFeatureDimension() + != other.getInputFeatureDimension()) return false; + if (!getInputSpatialDimensionsList() + .equals(other.getInputSpatialDimensionsList())) return false; + if (getKernelInputFeatureDimension() + != other.getKernelInputFeatureDimension()) return false; + if (getKernelOutputFeatureDimension() + != other.getKernelOutputFeatureDimension()) return false; + if (!getKernelSpatialDimensionsList() + .equals(other.getKernelSpatialDimensionsList())) return false; + if (getOutputBatchDimension() + != other.getOutputBatchDimension()) return false; + if (getOutputFeatureDimension() + != other.getOutputFeatureDimension()) return false; + if (!getOutputSpatialDimensionsList() + .equals(other.getOutputSpatialDimensionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + INPUT_BATCH_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInputBatchDimension()); + hash = (37 * hash) + INPUT_FEATURE_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInputFeatureDimension()); + if (getInputSpatialDimensionsCount() > 0) { + hash = (37 * hash) + INPUT_SPATIAL_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getInputSpatialDimensionsList().hashCode(); + } + hash = (37 * hash) + KERNEL_INPUT_FEATURE_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getKernelInputFeatureDimension()); + hash = (37 * hash) + KERNEL_OUTPUT_FEATURE_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getKernelOutputFeatureDimension()); + if (getKernelSpatialDimensionsCount() > 0) { + hash = (37 * hash) + KERNEL_SPATIAL_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getKernelSpatialDimensionsList().hashCode(); + } + hash = (37 * hash) + OUTPUT_BATCH_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOutputBatchDimension()); + hash = (37 * hash) + OUTPUT_FEATURE_DIMENSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOutputFeatureDimension()); + if (getOutputSpatialDimensionsCount() > 0) { + hash = (37 * hash) + OUTPUT_SPATIAL_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getOutputSpatialDimensionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr 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.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr 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.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Describes the dimension numbers for Convolution op. Corresponds to
    +     * ::mlir::mhlo::ConvDimensionNumbersAttr.
    +     * 
    + * + * Protobuf type {@code tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr) + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttrOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.UniformQuantOpsAttr.internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.UniformQuantOpsAttr.internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.class, org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.Builder.class); + } + + // Construct using org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputBatchDimension_ = 0L; + inputFeatureDimension_ = 0L; + inputSpatialDimensions_ = emptyLongList(); + kernelInputFeatureDimension_ = 0L; + kernelOutputFeatureDimension_ = 0L; + kernelSpatialDimensions_ = emptyLongList(); + outputBatchDimension_ = 0L; + outputFeatureDimension_ = 0L; + outputSpatialDimensions_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.UniformQuantOpsAttr.internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr getDefaultInstanceForType() { + return org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr build() { + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr buildPartial() { + org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr result = new org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputBatchDimension_ = inputBatchDimension_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.inputFeatureDimension_ = inputFeatureDimension_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + inputSpatialDimensions_.makeImmutable(); + result.inputSpatialDimensions_ = inputSpatialDimensions_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.kernelInputFeatureDimension_ = kernelInputFeatureDimension_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.kernelOutputFeatureDimension_ = kernelOutputFeatureDimension_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + kernelSpatialDimensions_.makeImmutable(); + result.kernelSpatialDimensions_ = kernelSpatialDimensions_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.outputBatchDimension_ = outputBatchDimension_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.outputFeatureDimension_ = outputFeatureDimension_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + outputSpatialDimensions_.makeImmutable(); + result.outputSpatialDimensions_ = outputSpatialDimensions_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr) { + return mergeFrom((org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr other) { + if (other == org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr.getDefaultInstance()) return this; + if (other.getInputBatchDimension() != 0L) { + setInputBatchDimension(other.getInputBatchDimension()); + } + if (other.getInputFeatureDimension() != 0L) { + setInputFeatureDimension(other.getInputFeatureDimension()); + } + if (!other.inputSpatialDimensions_.isEmpty()) { + if (inputSpatialDimensions_.isEmpty()) { + inputSpatialDimensions_ = other.inputSpatialDimensions_; + inputSpatialDimensions_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureInputSpatialDimensionsIsMutable(); + inputSpatialDimensions_.addAll(other.inputSpatialDimensions_); + } + onChanged(); + } + if (other.getKernelInputFeatureDimension() != 0L) { + setKernelInputFeatureDimension(other.getKernelInputFeatureDimension()); + } + if (other.getKernelOutputFeatureDimension() != 0L) { + setKernelOutputFeatureDimension(other.getKernelOutputFeatureDimension()); + } + if (!other.kernelSpatialDimensions_.isEmpty()) { + if (kernelSpatialDimensions_.isEmpty()) { + kernelSpatialDimensions_ = other.kernelSpatialDimensions_; + kernelSpatialDimensions_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureKernelSpatialDimensionsIsMutable(); + kernelSpatialDimensions_.addAll(other.kernelSpatialDimensions_); + } + onChanged(); + } + if (other.getOutputBatchDimension() != 0L) { + setOutputBatchDimension(other.getOutputBatchDimension()); + } + if (other.getOutputFeatureDimension() != 0L) { + setOutputFeatureDimension(other.getOutputFeatureDimension()); + } + if (!other.outputSpatialDimensions_.isEmpty()) { + if (outputSpatialDimensions_.isEmpty()) { + outputSpatialDimensions_ = other.outputSpatialDimensions_; + outputSpatialDimensions_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureOutputSpatialDimensionsIsMutable(); + outputSpatialDimensions_.addAll(other.outputSpatialDimensions_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + inputBatchDimension_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + inputFeatureDimension_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + long v = input.readInt64(); + ensureInputSpatialDimensionsIsMutable(); + inputSpatialDimensions_.addLong(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInputSpatialDimensionsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + inputSpatialDimensions_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 26 + case 32: { + kernelInputFeatureDimension_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + kernelOutputFeatureDimension_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + long v = input.readInt64(); + ensureKernelSpatialDimensionsIsMutable(); + kernelSpatialDimensions_.addLong(v); + break; + } // case 48 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureKernelSpatialDimensionsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + kernelSpatialDimensions_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 50 + case 56: { + outputBatchDimension_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + outputFeatureDimension_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + long v = input.readInt64(); + ensureOutputSpatialDimensionsIsMutable(); + outputSpatialDimensions_.addLong(v); + break; + } // case 72 + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureOutputSpatialDimensionsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + outputSpatialDimensions_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 74 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long inputBatchDimension_ ; + /** + *
    +       * The dimension that represents batch in the input.
    +       * 
    + * + * int64 input_batch_dimension = 1; + * @return The inputBatchDimension. + */ + @java.lang.Override + public long getInputBatchDimension() { + return inputBatchDimension_; + } + /** + *
    +       * The dimension that represents batch in the input.
    +       * 
    + * + * int64 input_batch_dimension = 1; + * @param value The inputBatchDimension to set. + * @return This builder for chaining. + */ + public Builder setInputBatchDimension(long value) { + + inputBatchDimension_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents batch in the input.
    +       * 
    + * + * int64 input_batch_dimension = 1; + * @return This builder for chaining. + */ + public Builder clearInputBatchDimension() { + bitField0_ = (bitField0_ & ~0x00000001); + inputBatchDimension_ = 0L; + onChanged(); + return this; + } + + private long inputFeatureDimension_ ; + /** + *
    +       * The dimension that represents features in the input.
    +       * 
    + * + * int64 input_feature_dimension = 2; + * @return The inputFeatureDimension. + */ + @java.lang.Override + public long getInputFeatureDimension() { + return inputFeatureDimension_; + } + /** + *
    +       * The dimension that represents features in the input.
    +       * 
    + * + * int64 input_feature_dimension = 2; + * @param value The inputFeatureDimension to set. + * @return This builder for chaining. + */ + public Builder setInputFeatureDimension(long value) { + + inputFeatureDimension_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents features in the input.
    +       * 
    + * + * int64 input_feature_dimension = 2; + * @return This builder for chaining. + */ + public Builder clearInputFeatureDimension() { + bitField0_ = (bitField0_ & ~0x00000002); + inputFeatureDimension_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList inputSpatialDimensions_ = emptyLongList(); + private void ensureInputSpatialDimensionsIsMutable() { + if (!inputSpatialDimensions_.isModifiable()) { + inputSpatialDimensions_ = makeMutableCopy(inputSpatialDimensions_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return A list containing the inputSpatialDimensions. + */ + public java.util.List + getInputSpatialDimensionsList() { + inputSpatialDimensions_.makeImmutable(); + return inputSpatialDimensions_; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return The count of inputSpatialDimensions. + */ + public int getInputSpatialDimensionsCount() { + return inputSpatialDimensions_.size(); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param index The index of the element to return. + * @return The inputSpatialDimensions at the given index. + */ + public long getInputSpatialDimensions(int index) { + return inputSpatialDimensions_.getLong(index); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param index The index to set the value at. + * @param value The inputSpatialDimensions to set. + * @return This builder for chaining. + */ + public Builder setInputSpatialDimensions( + int index, long value) { + + ensureInputSpatialDimensionsIsMutable(); + inputSpatialDimensions_.setLong(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param value The inputSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addInputSpatialDimensions(long value) { + + ensureInputSpatialDimensionsIsMutable(); + inputSpatialDimensions_.addLong(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @param values The inputSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addAllInputSpatialDimensions( + java.lang.Iterable values) { + ensureInputSpatialDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputSpatialDimensions_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the input. Length must
    +       * be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 input_spatial_dimensions = 3; + * @return This builder for chaining. + */ + public Builder clearInputSpatialDimensions() { + inputSpatialDimensions_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private long kernelInputFeatureDimension_ ; + /** + *
    +       * The dimension that represents input features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_input_feature_dimension = 4; + * @return The kernelInputFeatureDimension. + */ + @java.lang.Override + public long getKernelInputFeatureDimension() { + return kernelInputFeatureDimension_; + } + /** + *
    +       * The dimension that represents input features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_input_feature_dimension = 4; + * @param value The kernelInputFeatureDimension to set. + * @return This builder for chaining. + */ + public Builder setKernelInputFeatureDimension(long value) { + + kernelInputFeatureDimension_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents input features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_input_feature_dimension = 4; + * @return This builder for chaining. + */ + public Builder clearKernelInputFeatureDimension() { + bitField0_ = (bitField0_ & ~0x00000008); + kernelInputFeatureDimension_ = 0L; + onChanged(); + return this; + } + + private long kernelOutputFeatureDimension_ ; + /** + *
    +       * The dimension that represents output features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_output_feature_dimension = 5; + * @return The kernelOutputFeatureDimension. + */ + @java.lang.Override + public long getKernelOutputFeatureDimension() { + return kernelOutputFeatureDimension_; + } + /** + *
    +       * The dimension that represents output features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_output_feature_dimension = 5; + * @param value The kernelOutputFeatureDimension to set. + * @return This builder for chaining. + */ + public Builder setKernelOutputFeatureDimension(long value) { + + kernelOutputFeatureDimension_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents output features in the kernel (rhs).
    +       * 
    + * + * int64 kernel_output_feature_dimension = 5; + * @return This builder for chaining. + */ + public Builder clearKernelOutputFeatureDimension() { + bitField0_ = (bitField0_ & ~0x00000010); + kernelOutputFeatureDimension_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList kernelSpatialDimensions_ = emptyLongList(); + private void ensureKernelSpatialDimensionsIsMutable() { + if (!kernelSpatialDimensions_.isModifiable()) { + kernelSpatialDimensions_ = makeMutableCopy(kernelSpatialDimensions_); + } + bitField0_ |= 0x00000020; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return A list containing the kernelSpatialDimensions. + */ + public java.util.List + getKernelSpatialDimensionsList() { + kernelSpatialDimensions_.makeImmutable(); + return kernelSpatialDimensions_; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return The count of kernelSpatialDimensions. + */ + public int getKernelSpatialDimensionsCount() { + return kernelSpatialDimensions_.size(); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param index The index of the element to return. + * @return The kernelSpatialDimensions at the given index. + */ + public long getKernelSpatialDimensions(int index) { + return kernelSpatialDimensions_.getLong(index); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param index The index to set the value at. + * @param value The kernelSpatialDimensions to set. + * @return This builder for chaining. + */ + public Builder setKernelSpatialDimensions( + int index, long value) { + + ensureKernelSpatialDimensionsIsMutable(); + kernelSpatialDimensions_.setLong(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param value The kernelSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addKernelSpatialDimensions(long value) { + + ensureKernelSpatialDimensionsIsMutable(); + kernelSpatialDimensions_.addLong(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @param values The kernelSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addAllKernelSpatialDimensions( + java.lang.Iterable values) { + ensureKernelSpatialDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kernelSpatialDimensions_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the kernel (rhs).
    +       * Length must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 kernel_spatial_dimensions = 6; + * @return This builder for chaining. + */ + public Builder clearKernelSpatialDimensions() { + kernelSpatialDimensions_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private long outputBatchDimension_ ; + /** + *
    +       * The dimension that represents batch in the output.
    +       * 
    + * + * int64 output_batch_dimension = 7; + * @return The outputBatchDimension. + */ + @java.lang.Override + public long getOutputBatchDimension() { + return outputBatchDimension_; + } + /** + *
    +       * The dimension that represents batch in the output.
    +       * 
    + * + * int64 output_batch_dimension = 7; + * @param value The outputBatchDimension to set. + * @return This builder for chaining. + */ + public Builder setOutputBatchDimension(long value) { + + outputBatchDimension_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents batch in the output.
    +       * 
    + * + * int64 output_batch_dimension = 7; + * @return This builder for chaining. + */ + public Builder clearOutputBatchDimension() { + bitField0_ = (bitField0_ & ~0x00000040); + outputBatchDimension_ = 0L; + onChanged(); + return this; + } + + private long outputFeatureDimension_ ; + /** + *
    +       * The dimension that represents features in the output.
    +       * 
    + * + * int64 output_feature_dimension = 8; + * @return The outputFeatureDimension. + */ + @java.lang.Override + public long getOutputFeatureDimension() { + return outputFeatureDimension_; + } + /** + *
    +       * The dimension that represents features in the output.
    +       * 
    + * + * int64 output_feature_dimension = 8; + * @param value The outputFeatureDimension to set. + * @return This builder for chaining. + */ + public Builder setOutputFeatureDimension(long value) { + + outputFeatureDimension_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * The dimension that represents features in the output.
    +       * 
    + * + * int64 output_feature_dimension = 8; + * @return This builder for chaining. + */ + public Builder clearOutputFeatureDimension() { + bitField0_ = (bitField0_ & ~0x00000080); + outputFeatureDimension_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList outputSpatialDimensions_ = emptyLongList(); + private void ensureOutputSpatialDimensionsIsMutable() { + if (!outputSpatialDimensions_.isModifiable()) { + outputSpatialDimensions_ = makeMutableCopy(outputSpatialDimensions_); + } + bitField0_ |= 0x00000100; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return A list containing the outputSpatialDimensions. + */ + public java.util.List + getOutputSpatialDimensionsList() { + outputSpatialDimensions_.makeImmutable(); + return outputSpatialDimensions_; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return The count of outputSpatialDimensions. + */ + public int getOutputSpatialDimensionsCount() { + return outputSpatialDimensions_.size(); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param index The index of the element to return. + * @return The outputSpatialDimensions at the given index. + */ + public long getOutputSpatialDimensions(int index) { + return outputSpatialDimensions_.getLong(index); + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param index The index to set the value at. + * @param value The outputSpatialDimensions to set. + * @return This builder for chaining. + */ + public Builder setOutputSpatialDimensions( + int index, long value) { + + ensureOutputSpatialDimensionsIsMutable(); + outputSpatialDimensions_.setLong(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param value The outputSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addOutputSpatialDimensions(long value) { + + ensureOutputSpatialDimensionsIsMutable(); + outputSpatialDimensions_.addLong(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @param values The outputSpatialDimensions to add. + * @return This builder for chaining. + */ + public Builder addAllOutputSpatialDimensions( + java.lang.Iterable values) { + ensureOutputSpatialDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputSpatialDimensions_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * The dimensions that represents spatial dimensions in the output. Length
    +       * must be rank-2 for the tensor rank for Convolution op.
    +       * 
    + * + * repeated int64 output_spatial_dimensions = 9; + * @return This builder for chaining. + */ + public Builder clearOutputSpatialDimensions() { + outputSpatialDimensions_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr) + } + + // @@protoc_insertion_point(class_scope:tensorflow.UniformQuantizedConvolutionDimensionNumbersAttr) + private static final org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr(); + } + + public static org.tensorflow.proto.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UniformQuantizedConvolutionDimensionNumbersAttr parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.UniformQuantOpsAttr.UniformQuantizedConvolutionDimensionNumbersAttr getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_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/util/quantization/unif" + + "orm_quant_ops_attr.proto\022\ntensorflow\"\354\002\n" + + "/UniformQuantizedConvolutionDimensionNum" + + "bersAttr\022\035\n\025input_batch_dimension\030\001 \001(\003\022" + + "\037\n\027input_feature_dimension\030\002 \001(\003\022 \n\030inpu" + + "t_spatial_dimensions\030\003 \003(\003\022&\n\036kernel_inp" + + "ut_feature_dimension\030\004 \001(\003\022\'\n\037kernel_out" + + "put_feature_dimension\030\005 \001(\003\022!\n\031kernel_sp" + + "atial_dimensions\030\006 \003(\003\022\036\n\026output_batch_d" + + "imension\030\007 \001(\003\022 \n\030output_feature_dimensi" + + "on\030\010 \001(\003\022!\n\031output_spatial_dimensions\030\t " + + "\003(\003Bm\n\024org.tensorflow.protoZUgithub.com/" + + "tensorflow/tensorflow/tensorflow/go/core" + + "/protobuf/for_core_protos_go_protob\006prot" + + "o3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_UniformQuantizedConvolutionDimensionNumbersAttr_descriptor, + new java.lang.String[] { "InputBatchDimension", "InputFeatureDimension", "InputSpatialDimensions", "KernelInputFeatureDimension", "KernelOutputFeatureDimension", "KernelSpatialDimensions", "OutputBatchDimension", "OutputFeatureDimension", "OutputSpatialDimensions", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDef.java new file mode 100644 index 00000000000..6245af89c8c --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDef.java @@ -0,0 +1,937 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing the values in ControlFlowContext.
    + * 
    + * + * Protobuf type {@code tensorflow.ValuesDef} + */ +public final class ValuesDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.ValuesDef) + ValuesDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ValuesDef.class.getName()); + } + // Use ValuesDef.newBuilder() to construct. + private ValuesDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ValuesDef() { + values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetExternalValues(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ValuesDef.class, org.tensorflow.proto.ValuesDef.Builder.class); + } + + public static final int VALUES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * Value names that have been seen in this context.
    +   * 
    + * + * repeated string values = 1; + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList + getValuesList() { + return values_; + } + /** + *
    +   * Value names that have been seen in this context.
    +   * 
    + * + * repeated string values = 1; + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + *
    +   * Value names that have been seen in this context.
    +   * 
    + * + * repeated string values = 1; + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + *
    +   * Value names that have been seen in this context.
    +   * 
    + * + * repeated string values = 1; + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString + getValuesBytes(int index) { + return values_.getByteString(index); + } + + public static final int EXTERNAL_VALUES_FIELD_NUMBER = 2; + private static final class ExternalValuesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_ExternalValuesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> externalValues_; + private com.google.protobuf.MapField + internalGetExternalValues() { + if (externalValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ExternalValuesDefaultEntryHolder.defaultEntry); + } + return externalValues_; + } + public int getExternalValuesCount() { + return internalGetExternalValues().getMap().size(); + } + /** + *
    +   * Value names referenced by but external to this context.
    +   * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public boolean containsExternalValues( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetExternalValues().getMap().containsKey(key); + } + /** + * Use {@link #getExternalValuesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getExternalValues() { + return getExternalValuesMap(); + } + /** + *
    +   * Value names referenced by but external to this context.
    +   * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public java.util.Map getExternalValuesMap() { + return internalGetExternalValues().getMap(); + } + /** + *
    +   * Value names referenced by but external to this context.
    +   * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getExternalValuesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExternalValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +   * Value names referenced by but external to this context.
    +   * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public java.lang.String getExternalValuesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExternalValues().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 { + for (int i = 0; i < values_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, values_.getRaw(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetExternalValues(), + ExternalValuesDefaultEntryHolder.defaultEntry, + 2); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < values_.size(); i++) { + dataSize += computeStringSizeNoTag(values_.getRaw(i)); + } + size += dataSize; + size += 1 * getValuesList().size(); + } + for (java.util.Map.Entry entry + : internalGetExternalValues().getMap().entrySet()) { + com.google.protobuf.MapEntry + externalValues__ = ExternalValuesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, externalValues__); + } + size += getUnknownFields().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.ValuesDef)) { + return super.equals(obj); + } + org.tensorflow.proto.ValuesDef other = (org.tensorflow.proto.ValuesDef) obj; + + if (!getValuesList() + .equals(other.getValuesList())) return false; + if (!internalGetExternalValues().equals( + other.internalGetExternalValues())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + if (!internalGetExternalValues().getMap().isEmpty()) { + hash = (37 * hash) + EXTERNAL_VALUES_FIELD_NUMBER; + hash = (53 * hash) + internalGetExternalValues().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.ValuesDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ValuesDef 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.ValuesDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ValuesDef 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.ValuesDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.ValuesDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.ValuesDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ValuesDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.ValuesDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.ValuesDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.ValuesDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.ValuesDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.ValuesDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing the values in ControlFlowContext.
    +   * 
    + * + * Protobuf type {@code tensorflow.ValuesDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.ValuesDef) + org.tensorflow.proto.ValuesDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetExternalValues(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableExternalValues(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.ValuesDef.class, org.tensorflow.proto.ValuesDef.Builder.class); + } + + // Construct using org.tensorflow.proto.ValuesDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + internalGetMutableExternalValues().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_ValuesDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.ValuesDef getDefaultInstanceForType() { + return org.tensorflow.proto.ValuesDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.ValuesDef build() { + org.tensorflow.proto.ValuesDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.ValuesDef buildPartial() { + org.tensorflow.proto.ValuesDef result = new org.tensorflow.proto.ValuesDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.ValuesDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + values_.makeImmutable(); + result.values_ = values_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.externalValues_ = internalGetExternalValues(); + result.externalValues_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.ValuesDef) { + return mergeFrom((org.tensorflow.proto.ValuesDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.ValuesDef other) { + if (other == org.tensorflow.proto.ValuesDef.getDefaultInstance()) return this; + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ |= 0x00000001; + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + internalGetMutableExternalValues().mergeFrom( + other.internalGetExternalValues()); + bitField0_ |= 0x00000002; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureValuesIsMutable(); + values_.add(s); + break; + } // case 10 + case 18: { + com.google.protobuf.MapEntry + externalValues__ = input.readMessage( + ExternalValuesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableExternalValues().getMutableMap().put( + externalValues__.getKey(), externalValues__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValuesIsMutable() { + if (!values_.isModifiable()) { + values_ = new com.google.protobuf.LazyStringArrayList(values_); + } + bitField0_ |= 0x00000001; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @return A list containing the values. + */ + public com.google.protobuf.ProtocolStringList + getValuesList() { + values_.makeImmutable(); + return values_; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @return The count of values. + */ + public int getValuesCount() { + return values_.size(); + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param index The index of the element to return. + * @return The values at the given index. + */ + public java.lang.String getValues(int index) { + return values_.get(index); + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param index The index of the value to return. + * @return The bytes of the values at the given index. + */ + public com.google.protobuf.ByteString + getValuesBytes(int index) { + return values_.getByteString(index); + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param index The index to set the value at. + * @param value The values to set. + * @return This builder for chaining. + */ + public Builder setValues( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValuesIsMutable(); + values_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param value The values to add. + * @return This builder for chaining. + */ + public Builder addValues( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param values The values to add. + * @return This builder for chaining. + */ + public Builder addAllValues( + java.lang.Iterable values) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, values_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @return This builder for chaining. + */ + public Builder clearValues() { + values_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
    +     * Value names that have been seen in this context.
    +     * 
    + * + * repeated string values = 1; + * @param value The bytes of the values to add. + * @return This builder for chaining. + */ + public Builder addValuesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureValuesIsMutable(); + values_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> externalValues_; + private com.google.protobuf.MapField + internalGetExternalValues() { + if (externalValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ExternalValuesDefaultEntryHolder.defaultEntry); + } + return externalValues_; + } + private com.google.protobuf.MapField + internalGetMutableExternalValues() { + if (externalValues_ == null) { + externalValues_ = com.google.protobuf.MapField.newMapField( + ExternalValuesDefaultEntryHolder.defaultEntry); + } + if (!externalValues_.isMutable()) { + externalValues_ = externalValues_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return externalValues_; + } + public int getExternalValuesCount() { + return internalGetExternalValues().getMap().size(); + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public boolean containsExternalValues( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetExternalValues().getMap().containsKey(key); + } + /** + * Use {@link #getExternalValuesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getExternalValues() { + return getExternalValuesMap(); + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public java.util.Map getExternalValuesMap() { + return internalGetExternalValues().getMap(); + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getExternalValuesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExternalValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + @java.lang.Override + public java.lang.String getExternalValuesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetExternalValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearExternalValues() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableExternalValues().getMutableMap() + .clear(); + return this; + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + public Builder removeExternalValues( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableExternalValues().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableExternalValues() { + bitField0_ |= 0x00000002; + return internalGetMutableExternalValues().getMutableMap(); + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + public Builder putExternalValues( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableExternalValues().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +     * Value names referenced by but external to this context.
    +     * 
    + * + * map<string, string> external_values = 2; + */ + public Builder putAllExternalValues( + java.util.Map values) { + internalGetMutableExternalValues().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.ValuesDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.ValuesDef) + private static final org.tensorflow.proto.ValuesDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.ValuesDef(); + } + + public static org.tensorflow.proto.ValuesDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ValuesDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.ValuesDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDefOrBuilder.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDefOrBuilder.java index d9135689d22..a664cecce7c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/ValuesDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/ValuesDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface ValuesDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.ValuesDef) @@ -13,6 +15,7 @@ public interface ValuesDefOrBuilder extends *
    * * repeated string values = 1; + * @return A list containing the values. */ java.util.List getValuesList(); @@ -22,6 +25,7 @@ public interface ValuesDefOrBuilder extends *
    * * repeated string values = 1; + * @return The count of values. */ int getValuesCount(); /** @@ -30,6 +34,8 @@ public interface ValuesDefOrBuilder extends *
    * * repeated string values = 1; + * @param index The index of the element to return. + * @return The values at the given index. */ java.lang.String getValues(int index); /** @@ -38,6 +44,8 @@ public interface ValuesDefOrBuilder extends *
    * * repeated string values = 1; + * @param index The index of the value to return. + * @return The bytes of the values at the given index. */ com.google.protobuf.ByteString getValuesBytes(int index); @@ -81,10 +89,11 @@ boolean containsExternalValues( * * map<string, string> external_values = 2; */ - - java.lang.String getExternalValuesOrDefault( + /* nullable */ +java.lang.String getExternalValuesOrDefault( java.lang.String key, - java.lang.String defaultValue); + /* nullable */ +java.lang.String defaultValue); /** *
        * Value names referenced by but external to this context.
    @@ -92,7 +101,6 @@ java.lang.String getExternalValuesOrDefault(
        *
        * map<string, string> external_values = 2;
        */
    -
       java.lang.String getExternalValuesOrThrow(
           java.lang.String key);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProto.java
    new file mode 100644
    index 00000000000..15f8a3ade51
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProto.java
    @@ -0,0 +1,867 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/example/example_parser_configuration.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.VarLenFeatureProto}
    + */
    +public final class VarLenFeatureProto extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.VarLenFeatureProto)
    +    VarLenFeatureProtoOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      VarLenFeatureProto.class.getName());
    +  }
    +  // Use VarLenFeatureProto.newBuilder() to construct.
    +  private VarLenFeatureProto(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private VarLenFeatureProto() {
    +    dtype_ = 0;
    +    valuesOutputTensorName_ = "";
    +    indicesOutputTensorName_ = "";
    +    shapesOutputTensorName_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.VarLenFeatureProto.class, org.tensorflow.proto.VarLenFeatureProto.Builder.class);
    +  }
    +
    +  public static final int DTYPE_FIELD_NUMBER = 1;
    +  private int dtype_ = 0;
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  @java.lang.Override public int getDtypeValue() {
    +    return dtype_;
    +  }
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The dtype.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +    org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +    return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +  }
    +
    +  public static final int VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 2;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object valuesOutputTensorName_ = "";
    +  /**
    +   * string values_output_tensor_name = 2;
    +   * @return The valuesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public java.lang.String getValuesOutputTensorName() {
    +    java.lang.Object ref = valuesOutputTensorName_;
    +    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();
    +      valuesOutputTensorName_ = s;
    +      return s;
    +    }
    +  }
    +  /**
    +   * string values_output_tensor_name = 2;
    +   * @return The bytes for valuesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public com.google.protobuf.ByteString
    +      getValuesOutputTensorNameBytes() {
    +    java.lang.Object ref = valuesOutputTensorName_;
    +    if (ref instanceof java.lang.String) {
    +      com.google.protobuf.ByteString b = 
    +          com.google.protobuf.ByteString.copyFromUtf8(
    +              (java.lang.String) ref);
    +      valuesOutputTensorName_ = b;
    +      return b;
    +    } else {
    +      return (com.google.protobuf.ByteString) ref;
    +    }
    +  }
    +
    +  public static final int INDICES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 3;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object indicesOutputTensorName_ = "";
    +  /**
    +   * string indices_output_tensor_name = 3;
    +   * @return The indicesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public java.lang.String getIndicesOutputTensorName() {
    +    java.lang.Object ref = indicesOutputTensorName_;
    +    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();
    +      indicesOutputTensorName_ = s;
    +      return s;
    +    }
    +  }
    +  /**
    +   * string indices_output_tensor_name = 3;
    +   * @return The bytes for indicesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public com.google.protobuf.ByteString
    +      getIndicesOutputTensorNameBytes() {
    +    java.lang.Object ref = indicesOutputTensorName_;
    +    if (ref instanceof java.lang.String) {
    +      com.google.protobuf.ByteString b = 
    +          com.google.protobuf.ByteString.copyFromUtf8(
    +              (java.lang.String) ref);
    +      indicesOutputTensorName_ = b;
    +      return b;
    +    } else {
    +      return (com.google.protobuf.ByteString) ref;
    +    }
    +  }
    +
    +  public static final int SHAPES_OUTPUT_TENSOR_NAME_FIELD_NUMBER = 4;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object shapesOutputTensorName_ = "";
    +  /**
    +   * string shapes_output_tensor_name = 4;
    +   * @return The shapesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public java.lang.String getShapesOutputTensorName() {
    +    java.lang.Object ref = shapesOutputTensorName_;
    +    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();
    +      shapesOutputTensorName_ = s;
    +      return s;
    +    }
    +  }
    +  /**
    +   * string shapes_output_tensor_name = 4;
    +   * @return The bytes for shapesOutputTensorName.
    +   */
    +  @java.lang.Override
    +  public com.google.protobuf.ByteString
    +      getShapesOutputTensorNameBytes() {
    +    java.lang.Object ref = shapesOutputTensorName_;
    +    if (ref instanceof java.lang.String) {
    +      com.google.protobuf.ByteString b = 
    +          com.google.protobuf.ByteString.copyFromUtf8(
    +              (java.lang.String) ref);
    +      shapesOutputTensorName_ = b;
    +      return b;
    +    } else {
    +      return (com.google.protobuf.ByteString) ref;
    +    }
    +  }
    +
    +  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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      output.writeEnum(1, dtype_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesOutputTensorName_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 2, valuesOutputTensorName_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(indicesOutputTensorName_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 3, indicesOutputTensorName_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(shapesOutputTensorName_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 4, shapesOutputTensorName_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(1, dtype_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuesOutputTensorName_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, valuesOutputTensorName_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(indicesOutputTensorName_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, indicesOutputTensorName_);
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(shapesOutputTensorName_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(4, shapesOutputTensorName_);
    +    }
    +    size += getUnknownFields().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.VarLenFeatureProto)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.VarLenFeatureProto other = (org.tensorflow.proto.VarLenFeatureProto) obj;
    +
    +    if (dtype_ != other.dtype_) return false;
    +    if (!getValuesOutputTensorName()
    +        .equals(other.getValuesOutputTensorName())) return false;
    +    if (!getIndicesOutputTensorName()
    +        .equals(other.getIndicesOutputTensorName())) return false;
    +    if (!getShapesOutputTensorName()
    +        .equals(other.getShapesOutputTensorName())) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER;
    +    hash = (53 * hash) + dtype_;
    +    hash = (37 * hash) + VALUES_OUTPUT_TENSOR_NAME_FIELD_NUMBER;
    +    hash = (53 * hash) + getValuesOutputTensorName().hashCode();
    +    hash = (37 * hash) + INDICES_OUTPUT_TENSOR_NAME_FIELD_NUMBER;
    +    hash = (53 * hash) + getIndicesOutputTensorName().hashCode();
    +    hash = (37 * hash) + SHAPES_OUTPUT_TENSOR_NAME_FIELD_NUMBER;
    +    hash = (53 * hash) + getShapesOutputTensorName().hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto 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.VarLenFeatureProto parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto 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.VarLenFeatureProto parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.VarLenFeatureProto parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.VarLenFeatureProto parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.VarLenFeatureProto parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.VarLenFeatureProto 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.VarLenFeatureProto}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.VarLenFeatureProto)
    +      org.tensorflow.proto.VarLenFeatureProtoOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.VarLenFeatureProto.class, org.tensorflow.proto.VarLenFeatureProto.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.VarLenFeatureProto.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      dtype_ = 0;
    +      valuesOutputTensorName_ = "";
    +      indicesOutputTensorName_ = "";
    +      shapesOutputTensorName_ = "";
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.ExampleParserConfigurationProtos.internal_static_tensorflow_VarLenFeatureProto_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.VarLenFeatureProto getDefaultInstanceForType() {
    +      return org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.VarLenFeatureProto build() {
    +      org.tensorflow.proto.VarLenFeatureProto result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.VarLenFeatureProto buildPartial() {
    +      org.tensorflow.proto.VarLenFeatureProto result = new org.tensorflow.proto.VarLenFeatureProto(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.VarLenFeatureProto result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.dtype_ = dtype_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.valuesOutputTensorName_ = valuesOutputTensorName_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.indicesOutputTensorName_ = indicesOutputTensorName_;
    +      }
    +      if (((from_bitField0_ & 0x00000008) != 0)) {
    +        result.shapesOutputTensorName_ = shapesOutputTensorName_;
    +      }
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.VarLenFeatureProto) {
    +        return mergeFrom((org.tensorflow.proto.VarLenFeatureProto)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.VarLenFeatureProto other) {
    +      if (other == org.tensorflow.proto.VarLenFeatureProto.getDefaultInstance()) return this;
    +      if (other.dtype_ != 0) {
    +        setDtypeValue(other.getDtypeValue());
    +      }
    +      if (!other.getValuesOutputTensorName().isEmpty()) {
    +        valuesOutputTensorName_ = other.valuesOutputTensorName_;
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
    +      if (!other.getIndicesOutputTensorName().isEmpty()) {
    +        indicesOutputTensorName_ = other.indicesOutputTensorName_;
    +        bitField0_ |= 0x00000004;
    +        onChanged();
    +      }
    +      if (!other.getShapesOutputTensorName().isEmpty()) {
    +        shapesOutputTensorName_ = other.shapesOutputTensorName_;
    +        bitField0_ |= 0x00000008;
    +        onChanged();
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 8: {
    +              dtype_ = input.readEnum();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 8
    +            case 18: {
    +              valuesOutputTensorName_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000002;
    +              break;
    +            } // case 18
    +            case 26: {
    +              indicesOutputTensorName_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000004;
    +              break;
    +            } // case 26
    +            case 34: {
    +              shapesOutputTensorName_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000008;
    +              break;
    +            } // case 34
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private int dtype_ = 0;
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return The enum numeric value on the wire for dtype.
    +     */
    +    @java.lang.Override public int getDtypeValue() {
    +      return dtype_;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @param value The enum numeric value on the wire for dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtypeValue(int value) {
    +      dtype_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return The dtype.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.DataType getDtype() {
    +      org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +      return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @param value The dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtype(org.tensorflow.proto.DataType value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000001;
    +      dtype_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDtype() {
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      dtype_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private java.lang.Object valuesOutputTensorName_ = "";
    +    /**
    +     * string values_output_tensor_name = 2;
    +     * @return The valuesOutputTensorName.
    +     */
    +    public java.lang.String getValuesOutputTensorName() {
    +      java.lang.Object ref = valuesOutputTensorName_;
    +      if (!(ref instanceof java.lang.String)) {
    +        com.google.protobuf.ByteString bs =
    +            (com.google.protobuf.ByteString) ref;
    +        java.lang.String s = bs.toStringUtf8();
    +        valuesOutputTensorName_ = s;
    +        return s;
    +      } else {
    +        return (java.lang.String) ref;
    +      }
    +    }
    +    /**
    +     * string values_output_tensor_name = 2;
    +     * @return The bytes for valuesOutputTensorName.
    +     */
    +    public com.google.protobuf.ByteString
    +        getValuesOutputTensorNameBytes() {
    +      java.lang.Object ref = valuesOutputTensorName_;
    +      if (ref instanceof String) {
    +        com.google.protobuf.ByteString b = 
    +            com.google.protobuf.ByteString.copyFromUtf8(
    +                (java.lang.String) ref);
    +        valuesOutputTensorName_ = b;
    +        return b;
    +      } else {
    +        return (com.google.protobuf.ByteString) ref;
    +      }
    +    }
    +    /**
    +     * string values_output_tensor_name = 2;
    +     * @param value The valuesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setValuesOutputTensorName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      valuesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string values_output_tensor_name = 2;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearValuesOutputTensorName() {
    +      valuesOutputTensorName_ = getDefaultInstance().getValuesOutputTensorName();
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string values_output_tensor_name = 2;
    +     * @param value The bytes for valuesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setValuesOutputTensorNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      valuesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private java.lang.Object indicesOutputTensorName_ = "";
    +    /**
    +     * string indices_output_tensor_name = 3;
    +     * @return The indicesOutputTensorName.
    +     */
    +    public java.lang.String getIndicesOutputTensorName() {
    +      java.lang.Object ref = indicesOutputTensorName_;
    +      if (!(ref instanceof java.lang.String)) {
    +        com.google.protobuf.ByteString bs =
    +            (com.google.protobuf.ByteString) ref;
    +        java.lang.String s = bs.toStringUtf8();
    +        indicesOutputTensorName_ = s;
    +        return s;
    +      } else {
    +        return (java.lang.String) ref;
    +      }
    +    }
    +    /**
    +     * string indices_output_tensor_name = 3;
    +     * @return The bytes for indicesOutputTensorName.
    +     */
    +    public com.google.protobuf.ByteString
    +        getIndicesOutputTensorNameBytes() {
    +      java.lang.Object ref = indicesOutputTensorName_;
    +      if (ref instanceof String) {
    +        com.google.protobuf.ByteString b = 
    +            com.google.protobuf.ByteString.copyFromUtf8(
    +                (java.lang.String) ref);
    +        indicesOutputTensorName_ = b;
    +        return b;
    +      } else {
    +        return (com.google.protobuf.ByteString) ref;
    +      }
    +    }
    +    /**
    +     * string indices_output_tensor_name = 3;
    +     * @param value The indicesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setIndicesOutputTensorName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      indicesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string indices_output_tensor_name = 3;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearIndicesOutputTensorName() {
    +      indicesOutputTensorName_ = getDefaultInstance().getIndicesOutputTensorName();
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string indices_output_tensor_name = 3;
    +     * @param value The bytes for indicesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setIndicesOutputTensorNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      indicesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private java.lang.Object shapesOutputTensorName_ = "";
    +    /**
    +     * string shapes_output_tensor_name = 4;
    +     * @return The shapesOutputTensorName.
    +     */
    +    public java.lang.String getShapesOutputTensorName() {
    +      java.lang.Object ref = shapesOutputTensorName_;
    +      if (!(ref instanceof java.lang.String)) {
    +        com.google.protobuf.ByteString bs =
    +            (com.google.protobuf.ByteString) ref;
    +        java.lang.String s = bs.toStringUtf8();
    +        shapesOutputTensorName_ = s;
    +        return s;
    +      } else {
    +        return (java.lang.String) ref;
    +      }
    +    }
    +    /**
    +     * string shapes_output_tensor_name = 4;
    +     * @return The bytes for shapesOutputTensorName.
    +     */
    +    public com.google.protobuf.ByteString
    +        getShapesOutputTensorNameBytes() {
    +      java.lang.Object ref = shapesOutputTensorName_;
    +      if (ref instanceof String) {
    +        com.google.protobuf.ByteString b = 
    +            com.google.protobuf.ByteString.copyFromUtf8(
    +                (java.lang.String) ref);
    +        shapesOutputTensorName_ = b;
    +        return b;
    +      } else {
    +        return (com.google.protobuf.ByteString) ref;
    +      }
    +    }
    +    /**
    +     * string shapes_output_tensor_name = 4;
    +     * @param value The shapesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShapesOutputTensorName(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      shapesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000008;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string shapes_output_tensor_name = 4;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearShapesOutputTensorName() {
    +      shapesOutputTensorName_ = getDefaultInstance().getShapesOutputTensorName();
    +      bitField0_ = (bitField0_ & ~0x00000008);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string shapes_output_tensor_name = 4;
    +     * @param value The bytes for shapesOutputTensorName to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShapesOutputTensorNameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      shapesOutputTensorName_ = value;
    +      bitField0_ |= 0x00000008;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.VarLenFeatureProto)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.VarLenFeatureProto)
    +  private static final org.tensorflow.proto.VarLenFeatureProto DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.VarLenFeatureProto();
    +  }
    +
    +  public static org.tensorflow.proto.VarLenFeatureProto getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public VarLenFeatureProto parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.VarLenFeatureProto getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProtoOrBuilder.java
    new file mode 100644
    index 00000000000..dfd0c8e932d
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VarLenFeatureProtoOrBuilder.java
    @@ -0,0 +1,58 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/example/example_parser_configuration.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface VarLenFeatureProtoOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.VarLenFeatureProto)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  int getDtypeValue();
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The dtype.
    +   */
    +  org.tensorflow.proto.DataType getDtype();
    +
    +  /**
    +   * string values_output_tensor_name = 2;
    +   * @return The valuesOutputTensorName.
    +   */
    +  java.lang.String getValuesOutputTensorName();
    +  /**
    +   * string values_output_tensor_name = 2;
    +   * @return The bytes for valuesOutputTensorName.
    +   */
    +  com.google.protobuf.ByteString
    +      getValuesOutputTensorNameBytes();
    +
    +  /**
    +   * string indices_output_tensor_name = 3;
    +   * @return The indicesOutputTensorName.
    +   */
    +  java.lang.String getIndicesOutputTensorName();
    +  /**
    +   * string indices_output_tensor_name = 3;
    +   * @return The bytes for indicesOutputTensorName.
    +   */
    +  com.google.protobuf.ByteString
    +      getIndicesOutputTensorNameBytes();
    +
    +  /**
    +   * string shapes_output_tensor_name = 4;
    +   * @return The shapesOutputTensorName.
    +   */
    +  java.lang.String getShapesOutputTensorName();
    +  /**
    +   * string shapes_output_tensor_name = 4;
    +   * @return The bytes for shapesOutputTensorName.
    +   */
    +  com.google.protobuf.ByteString
    +      getShapesOutputTensorNameBytes();
    +}
    diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableAggregation.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableAggregation.java
    similarity index 83%
    rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableAggregation.java
    rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableAggregation.java
    index 584cd9b19bd..1b2f657469d 100644
    --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableAggregation.java
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableAggregation.java
    @@ -1,7 +1,9 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
     // source: tensorflow/core/framework/variable.proto
    +// Protobuf Java Version: 4.28.3
     
    -package org.tensorflow.proto.framework;
    +package org.tensorflow.proto;
     
     /**
      * 
    @@ -51,6 +53,15 @@ public enum VariableAggregation
       UNRECOGNIZED(-1),
       ;
     
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      VariableAggregation.class.getName());
    +  }
       /**
        * 
        * `NONE`: This is the default, giving an error if you use a
    @@ -98,6 +109,8 @@ public final int getNumber() {
       }
     
       /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
        * @deprecated Use {@link #forNumber(int)} instead.
        */
       @java.lang.Deprecated
    @@ -105,6 +118,10 @@ public static VariableAggregation valueOf(int value) {
         return forNumber(value);
       }
     
    +  /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
    +   */
       public static VariableAggregation forNumber(int value) {
         switch (value) {
           case 0: return VARIABLE_AGGREGATION_NONE;
    @@ -129,6 +146,10 @@ public VariableAggregation findValueByNumber(int number) {
     
       public final com.google.protobuf.Descriptors.EnumValueDescriptor
           getValueDescriptor() {
    +    if (this == UNRECOGNIZED) {
    +      throw new java.lang.IllegalStateException(
    +          "Can't get the descriptor of an unrecognized enum value.");
    +    }
         return getDescriptor().getValues().get(ordinal());
       }
       public final com.google.protobuf.Descriptors.EnumDescriptor
    @@ -137,7 +158,7 @@ public VariableAggregation findValueByNumber(int number) {
       }
       public static final com.google.protobuf.Descriptors.EnumDescriptor
           getDescriptor() {
    -    return org.tensorflow.proto.framework.VariableProtos.getDescriptor().getEnumTypes().get(1);
    +    return org.tensorflow.proto.VariableProtos.getDescriptor().getEnumTypes().get(1);
       }
     
       private static final VariableAggregation[] VALUES = values();
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDef.java
    new file mode 100644
    index 00000000000..05fa166a1a0
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDef.java
    @@ -0,0 +1,1680 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/variable.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing a Variable.
    + * 
    + * + * Protobuf type {@code tensorflow.VariableDef} + */ +public final class VariableDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.VariableDef) + VariableDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VariableDef.class.getName()); + } + // Use VariableDef.newBuilder() to construct. + private VariableDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private VariableDef() { + variableName_ = ""; + initialValueName_ = ""; + initializerName_ = ""; + snapshotName_ = ""; + synchronization_ = 0; + aggregation_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_VariableDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VariableDef.class, org.tensorflow.proto.VariableDef.Builder.class); + } + + private int bitField0_; + public static final int VARIABLE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object variableName_ = ""; + /** + *
    +   * Name of the variable tensor.
    +   * 
    + * + * string variable_name = 1; + * @return The variableName. + */ + @java.lang.Override + public java.lang.String getVariableName() { + java.lang.Object ref = variableName_; + 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(); + variableName_ = s; + return s; + } + } + /** + *
    +   * Name of the variable tensor.
    +   * 
    + * + * string variable_name = 1; + * @return The bytes for variableName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVariableNameBytes() { + java.lang.Object ref = variableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + variableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INITIAL_VALUE_NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object initialValueName_ = ""; + /** + *
    +   * Name of the tensor holding the variable's initial value.
    +   * 
    + * + * string initial_value_name = 6; + * @return The initialValueName. + */ + @java.lang.Override + public java.lang.String getInitialValueName() { + java.lang.Object ref = initialValueName_; + 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(); + initialValueName_ = s; + return s; + } + } + /** + *
    +   * Name of the tensor holding the variable's initial value.
    +   * 
    + * + * string initial_value_name = 6; + * @return The bytes for initialValueName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInitialValueNameBytes() { + java.lang.Object ref = initialValueName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + initialValueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INITIALIZER_NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object initializerName_ = ""; + /** + *
    +   * Name of the initializer op.
    +   * 
    + * + * string initializer_name = 2; + * @return The initializerName. + */ + @java.lang.Override + public java.lang.String getInitializerName() { + java.lang.Object ref = initializerName_; + 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(); + initializerName_ = s; + return s; + } + } + /** + *
    +   * Name of the initializer op.
    +   * 
    + * + * string initializer_name = 2; + * @return The bytes for initializerName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getInitializerNameBytes() { + java.lang.Object ref = initializerName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + initializerName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object snapshotName_ = ""; + /** + *
    +   * Name of the snapshot tensor.
    +   * 
    + * + * string snapshot_name = 3; + * @return The snapshotName. + */ + @java.lang.Override + public java.lang.String getSnapshotName() { + java.lang.Object ref = snapshotName_; + 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(); + snapshotName_ = s; + return s; + } + } + /** + *
    +   * Name of the snapshot tensor.
    +   * 
    + * + * string snapshot_name = 3; + * @return The bytes for snapshotName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSnapshotNameBytes() { + java.lang.Object ref = snapshotName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + snapshotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SAVE_SLICE_INFO_DEF_FIELD_NUMBER = 4; + private org.tensorflow.proto.SaveSliceInfoDef saveSliceInfoDef_; + /** + *
    +   * Support for saving variables as slices of a larger variable.
    +   * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return Whether the saveSliceInfoDef field is set. + */ + @java.lang.Override + public boolean hasSaveSliceInfoDef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Support for saving variables as slices of a larger variable.
    +   * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return The saveSliceInfoDef. + */ + @java.lang.Override + public org.tensorflow.proto.SaveSliceInfoDef getSaveSliceInfoDef() { + return saveSliceInfoDef_ == null ? org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; + } + /** + *
    +   * Support for saving variables as slices of a larger variable.
    +   * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + @java.lang.Override + public org.tensorflow.proto.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder() { + return saveSliceInfoDef_ == null ? org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; + } + + public static final int IS_RESOURCE_FIELD_NUMBER = 5; + private boolean isResource_ = false; + /** + *
    +   * Whether to represent this as a ResourceVariable.
    +   * 
    + * + * bool is_resource = 5; + * @return The isResource. + */ + @java.lang.Override + public boolean getIsResource() { + return isResource_; + } + + public static final int TRAINABLE_FIELD_NUMBER = 7; + private boolean trainable_ = false; + /** + *
    +   * Whether this variable should be trained.
    +   * 
    + * + * bool trainable = 7; + * @return The trainable. + */ + @java.lang.Override + public boolean getTrainable() { + return trainable_; + } + + public static final int SYNCHRONIZATION_FIELD_NUMBER = 8; + private int synchronization_ = 0; + /** + *
    +   * Indicates when a distributed variable will be synced.
    +   * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @return The enum numeric value on the wire for synchronization. + */ + @java.lang.Override public int getSynchronizationValue() { + return synchronization_; + } + /** + *
    +   * Indicates when a distributed variable will be synced.
    +   * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @return The synchronization. + */ + @java.lang.Override public org.tensorflow.proto.VariableSynchronization getSynchronization() { + org.tensorflow.proto.VariableSynchronization result = org.tensorflow.proto.VariableSynchronization.forNumber(synchronization_); + return result == null ? org.tensorflow.proto.VariableSynchronization.UNRECOGNIZED : result; + } + + public static final int AGGREGATION_FIELD_NUMBER = 9; + private int aggregation_ = 0; + /** + *
    +   * Indicates how a distributed variable will be aggregated.
    +   * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @return The enum numeric value on the wire for aggregation. + */ + @java.lang.Override public int getAggregationValue() { + return aggregation_; + } + /** + *
    +   * Indicates how a distributed variable will be aggregated.
    +   * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @return The aggregation. + */ + @java.lang.Override public org.tensorflow.proto.VariableAggregation getAggregation() { + org.tensorflow.proto.VariableAggregation result = org.tensorflow.proto.VariableAggregation.forNumber(aggregation_); + return result == null ? org.tensorflow.proto.VariableAggregation.UNRECOGNIZED : result; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(variableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, variableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(initializerName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, initializerName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, snapshotName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getSaveSliceInfoDef()); + } + if (isResource_ != false) { + output.writeBool(5, isResource_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(initialValueName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, initialValueName_); + } + if (trainable_ != false) { + output.writeBool(7, trainable_); + } + if (synchronization_ != org.tensorflow.proto.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { + output.writeEnum(8, synchronization_); + } + if (aggregation_ != org.tensorflow.proto.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { + output.writeEnum(9, aggregation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(variableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, variableName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(initializerName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, initializerName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, snapshotName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getSaveSliceInfoDef()); + } + if (isResource_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, isResource_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(initialValueName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, initialValueName_); + } + if (trainable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, trainable_); + } + if (synchronization_ != org.tensorflow.proto.VariableSynchronization.VARIABLE_SYNCHRONIZATION_AUTO.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(8, synchronization_); + } + if (aggregation_ != org.tensorflow.proto.VariableAggregation.VARIABLE_AGGREGATION_NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, aggregation_); + } + size += getUnknownFields().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.VariableDef)) { + return super.equals(obj); + } + org.tensorflow.proto.VariableDef other = (org.tensorflow.proto.VariableDef) obj; + + if (!getVariableName() + .equals(other.getVariableName())) return false; + if (!getInitialValueName() + .equals(other.getInitialValueName())) return false; + if (!getInitializerName() + .equals(other.getInitializerName())) return false; + if (!getSnapshotName() + .equals(other.getSnapshotName())) return false; + if (hasSaveSliceInfoDef() != other.hasSaveSliceInfoDef()) return false; + if (hasSaveSliceInfoDef()) { + if (!getSaveSliceInfoDef() + .equals(other.getSaveSliceInfoDef())) return false; + } + if (getIsResource() + != other.getIsResource()) return false; + if (getTrainable() + != other.getTrainable()) return false; + if (synchronization_ != other.synchronization_) return false; + if (aggregation_ != other.aggregation_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VARIABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getVariableName().hashCode(); + hash = (37 * hash) + INITIAL_VALUE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInitialValueName().hashCode(); + hash = (37 * hash) + INITIALIZER_NAME_FIELD_NUMBER; + hash = (53 * hash) + getInitializerName().hashCode(); + hash = (37 * hash) + SNAPSHOT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotName().hashCode(); + if (hasSaveSliceInfoDef()) { + hash = (37 * hash) + SAVE_SLICE_INFO_DEF_FIELD_NUMBER; + hash = (53 * hash) + getSaveSliceInfoDef().hashCode(); + } + hash = (37 * hash) + IS_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsResource()); + hash = (37 * hash) + TRAINABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTrainable()); + hash = (37 * hash) + SYNCHRONIZATION_FIELD_NUMBER; + hash = (53 * hash) + synchronization_; + hash = (37 * hash) + AGGREGATION_FIELD_NUMBER; + hash = (53 * hash) + aggregation_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.VariableDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariableDef 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.VariableDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariableDef 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.VariableDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariableDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.VariableDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VariableDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.VariableDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.VariableDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.VariableDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VariableDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.VariableDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a Variable.
    +   * 
    + * + * Protobuf type {@code tensorflow.VariableDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.VariableDef) + org.tensorflow.proto.VariableDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_VariableDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VariableDef.class, org.tensorflow.proto.VariableDef.Builder.class); + } + + // Construct using org.tensorflow.proto.VariableDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getSaveSliceInfoDefFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + variableName_ = ""; + initialValueName_ = ""; + initializerName_ = ""; + snapshotName_ = ""; + saveSliceInfoDef_ = null; + if (saveSliceInfoDefBuilder_ != null) { + saveSliceInfoDefBuilder_.dispose(); + saveSliceInfoDefBuilder_ = null; + } + isResource_ = false; + trainable_ = false; + synchronization_ = 0; + aggregation_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.VariableProtos.internal_static_tensorflow_VariableDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.VariableDef getDefaultInstanceForType() { + return org.tensorflow.proto.VariableDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.VariableDef build() { + org.tensorflow.proto.VariableDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.VariableDef buildPartial() { + org.tensorflow.proto.VariableDef result = new org.tensorflow.proto.VariableDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.VariableDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.variableName_ = variableName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.initialValueName_ = initialValueName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.initializerName_ = initializerName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.snapshotName_ = snapshotName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.saveSliceInfoDef_ = saveSliceInfoDefBuilder_ == null + ? saveSliceInfoDef_ + : saveSliceInfoDefBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.isResource_ = isResource_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.trainable_ = trainable_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.synchronization_ = synchronization_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.aggregation_ = aggregation_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.VariableDef) { + return mergeFrom((org.tensorflow.proto.VariableDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.VariableDef other) { + if (other == org.tensorflow.proto.VariableDef.getDefaultInstance()) return this; + if (!other.getVariableName().isEmpty()) { + variableName_ = other.variableName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInitialValueName().isEmpty()) { + initialValueName_ = other.initialValueName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getInitializerName().isEmpty()) { + initializerName_ = other.initializerName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getSnapshotName().isEmpty()) { + snapshotName_ = other.snapshotName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasSaveSliceInfoDef()) { + mergeSaveSliceInfoDef(other.getSaveSliceInfoDef()); + } + if (other.getIsResource() != false) { + setIsResource(other.getIsResource()); + } + if (other.getTrainable() != false) { + setTrainable(other.getTrainable()); + } + if (other.synchronization_ != 0) { + setSynchronizationValue(other.getSynchronizationValue()); + } + if (other.aggregation_ != 0) { + setAggregationValue(other.getAggregationValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + variableName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + initializerName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: { + snapshotName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: { + input.readMessage( + getSaveSliceInfoDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 40: { + isResource_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 50: { + initialValueName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 50 + case 56: { + trainable_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + synchronization_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + aggregation_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object variableName_ = ""; + /** + *
    +     * Name of the variable tensor.
    +     * 
    + * + * string variable_name = 1; + * @return The variableName. + */ + public java.lang.String getVariableName() { + java.lang.Object ref = variableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + variableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the variable tensor.
    +     * 
    + * + * string variable_name = 1; + * @return The bytes for variableName. + */ + public com.google.protobuf.ByteString + getVariableNameBytes() { + java.lang.Object ref = variableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + variableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the variable tensor.
    +     * 
    + * + * string variable_name = 1; + * @param value The variableName to set. + * @return This builder for chaining. + */ + public Builder setVariableName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + variableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the variable tensor.
    +     * 
    + * + * string variable_name = 1; + * @return This builder for chaining. + */ + public Builder clearVariableName() { + variableName_ = getDefaultInstance().getVariableName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the variable tensor.
    +     * 
    + * + * string variable_name = 1; + * @param value The bytes for variableName to set. + * @return This builder for chaining. + */ + public Builder setVariableNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + variableName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object initialValueName_ = ""; + /** + *
    +     * Name of the tensor holding the variable's initial value.
    +     * 
    + * + * string initial_value_name = 6; + * @return The initialValueName. + */ + public java.lang.String getInitialValueName() { + java.lang.Object ref = initialValueName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + initialValueName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the tensor holding the variable's initial value.
    +     * 
    + * + * string initial_value_name = 6; + * @return The bytes for initialValueName. + */ + public com.google.protobuf.ByteString + getInitialValueNameBytes() { + java.lang.Object ref = initialValueName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + initialValueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the tensor holding the variable's initial value.
    +     * 
    + * + * string initial_value_name = 6; + * @param value The initialValueName to set. + * @return This builder for chaining. + */ + public Builder setInitialValueName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + initialValueName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor holding the variable's initial value.
    +     * 
    + * + * string initial_value_name = 6; + * @return This builder for chaining. + */ + public Builder clearInitialValueName() { + initialValueName_ = getDefaultInstance().getInitialValueName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +     * Name of the tensor holding the variable's initial value.
    +     * 
    + * + * string initial_value_name = 6; + * @param value The bytes for initialValueName to set. + * @return This builder for chaining. + */ + public Builder setInitialValueNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + initialValueName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object initializerName_ = ""; + /** + *
    +     * Name of the initializer op.
    +     * 
    + * + * string initializer_name = 2; + * @return The initializerName. + */ + public java.lang.String getInitializerName() { + java.lang.Object ref = initializerName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + initializerName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the initializer op.
    +     * 
    + * + * string initializer_name = 2; + * @return The bytes for initializerName. + */ + public com.google.protobuf.ByteString + getInitializerNameBytes() { + java.lang.Object ref = initializerName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + initializerName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the initializer op.
    +     * 
    + * + * string initializer_name = 2; + * @param value The initializerName to set. + * @return This builder for chaining. + */ + public Builder setInitializerName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + initializerName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Name of the initializer op.
    +     * 
    + * + * string initializer_name = 2; + * @return This builder for chaining. + */ + public Builder clearInitializerName() { + initializerName_ = getDefaultInstance().getInitializerName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Name of the initializer op.
    +     * 
    + * + * string initializer_name = 2; + * @param value The bytes for initializerName to set. + * @return This builder for chaining. + */ + public Builder setInitializerNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + initializerName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object snapshotName_ = ""; + /** + *
    +     * Name of the snapshot tensor.
    +     * 
    + * + * string snapshot_name = 3; + * @return The snapshotName. + */ + public java.lang.String getSnapshotName() { + java.lang.Object ref = snapshotName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + snapshotName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the snapshot tensor.
    +     * 
    + * + * string snapshot_name = 3; + * @return The bytes for snapshotName. + */ + public com.google.protobuf.ByteString + getSnapshotNameBytes() { + java.lang.Object ref = snapshotName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + snapshotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the snapshot tensor.
    +     * 
    + * + * string snapshot_name = 3; + * @param value The snapshotName to set. + * @return This builder for chaining. + */ + public Builder setSnapshotName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + snapshotName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Name of the snapshot tensor.
    +     * 
    + * + * string snapshot_name = 3; + * @return This builder for chaining. + */ + public Builder clearSnapshotName() { + snapshotName_ = getDefaultInstance().getSnapshotName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * Name of the snapshot tensor.
    +     * 
    + * + * string snapshot_name = 3; + * @param value The bytes for snapshotName to set. + * @return This builder for chaining. + */ + public Builder setSnapshotNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + snapshotName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private org.tensorflow.proto.SaveSliceInfoDef saveSliceInfoDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaveSliceInfoDef, org.tensorflow.proto.SaveSliceInfoDef.Builder, org.tensorflow.proto.SaveSliceInfoDefOrBuilder> saveSliceInfoDefBuilder_; + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return Whether the saveSliceInfoDef field is set. + */ + public boolean hasSaveSliceInfoDef() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return The saveSliceInfoDef. + */ + public org.tensorflow.proto.SaveSliceInfoDef getSaveSliceInfoDef() { + if (saveSliceInfoDefBuilder_ == null) { + return saveSliceInfoDef_ == null ? org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; + } else { + return saveSliceInfoDefBuilder_.getMessage(); + } + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public Builder setSaveSliceInfoDef(org.tensorflow.proto.SaveSliceInfoDef value) { + if (saveSliceInfoDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + saveSliceInfoDef_ = value; + } else { + saveSliceInfoDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public Builder setSaveSliceInfoDef( + org.tensorflow.proto.SaveSliceInfoDef.Builder builderForValue) { + if (saveSliceInfoDefBuilder_ == null) { + saveSliceInfoDef_ = builderForValue.build(); + } else { + saveSliceInfoDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public Builder mergeSaveSliceInfoDef(org.tensorflow.proto.SaveSliceInfoDef value) { + if (saveSliceInfoDefBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + saveSliceInfoDef_ != null && + saveSliceInfoDef_ != org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance()) { + getSaveSliceInfoDefBuilder().mergeFrom(value); + } else { + saveSliceInfoDef_ = value; + } + } else { + saveSliceInfoDefBuilder_.mergeFrom(value); + } + if (saveSliceInfoDef_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public Builder clearSaveSliceInfoDef() { + bitField0_ = (bitField0_ & ~0x00000010); + saveSliceInfoDef_ = null; + if (saveSliceInfoDefBuilder_ != null) { + saveSliceInfoDefBuilder_.dispose(); + saveSliceInfoDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public org.tensorflow.proto.SaveSliceInfoDef.Builder getSaveSliceInfoDefBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSaveSliceInfoDefFieldBuilder().getBuilder(); + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + public org.tensorflow.proto.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder() { + if (saveSliceInfoDefBuilder_ != null) { + return saveSliceInfoDefBuilder_.getMessageOrBuilder(); + } else { + return saveSliceInfoDef_ == null ? + org.tensorflow.proto.SaveSliceInfoDef.getDefaultInstance() : saveSliceInfoDef_; + } + } + /** + *
    +     * Support for saving variables as slices of a larger variable.
    +     * 
    + * + * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaveSliceInfoDef, org.tensorflow.proto.SaveSliceInfoDef.Builder, org.tensorflow.proto.SaveSliceInfoDefOrBuilder> + getSaveSliceInfoDefFieldBuilder() { + if (saveSliceInfoDefBuilder_ == null) { + saveSliceInfoDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.SaveSliceInfoDef, org.tensorflow.proto.SaveSliceInfoDef.Builder, org.tensorflow.proto.SaveSliceInfoDefOrBuilder>( + getSaveSliceInfoDef(), + getParentForChildren(), + isClean()); + saveSliceInfoDef_ = null; + } + return saveSliceInfoDefBuilder_; + } + + private boolean isResource_ ; + /** + *
    +     * Whether to represent this as a ResourceVariable.
    +     * 
    + * + * bool is_resource = 5; + * @return The isResource. + */ + @java.lang.Override + public boolean getIsResource() { + return isResource_; + } + /** + *
    +     * Whether to represent this as a ResourceVariable.
    +     * 
    + * + * bool is_resource = 5; + * @param value The isResource to set. + * @return This builder for chaining. + */ + public Builder setIsResource(boolean value) { + + isResource_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Whether to represent this as a ResourceVariable.
    +     * 
    + * + * bool is_resource = 5; + * @return This builder for chaining. + */ + public Builder clearIsResource() { + bitField0_ = (bitField0_ & ~0x00000020); + isResource_ = false; + onChanged(); + return this; + } + + private boolean trainable_ ; + /** + *
    +     * Whether this variable should be trained.
    +     * 
    + * + * bool trainable = 7; + * @return The trainable. + */ + @java.lang.Override + public boolean getTrainable() { + return trainable_; + } + /** + *
    +     * Whether this variable should be trained.
    +     * 
    + * + * bool trainable = 7; + * @param value The trainable to set. + * @return This builder for chaining. + */ + public Builder setTrainable(boolean value) { + + trainable_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Whether this variable should be trained.
    +     * 
    + * + * bool trainable = 7; + * @return This builder for chaining. + */ + public Builder clearTrainable() { + bitField0_ = (bitField0_ & ~0x00000040); + trainable_ = false; + onChanged(); + return this; + } + + private int synchronization_ = 0; + /** + *
    +     * Indicates when a distributed variable will be synced.
    +     * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @return The enum numeric value on the wire for synchronization. + */ + @java.lang.Override public int getSynchronizationValue() { + return synchronization_; + } + /** + *
    +     * Indicates when a distributed variable will be synced.
    +     * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @param value The enum numeric value on the wire for synchronization to set. + * @return This builder for chaining. + */ + public Builder setSynchronizationValue(int value) { + synchronization_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * Indicates when a distributed variable will be synced.
    +     * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @return The synchronization. + */ + @java.lang.Override + public org.tensorflow.proto.VariableSynchronization getSynchronization() { + org.tensorflow.proto.VariableSynchronization result = org.tensorflow.proto.VariableSynchronization.forNumber(synchronization_); + return result == null ? org.tensorflow.proto.VariableSynchronization.UNRECOGNIZED : result; + } + /** + *
    +     * Indicates when a distributed variable will be synced.
    +     * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @param value The synchronization to set. + * @return This builder for chaining. + */ + public Builder setSynchronization(org.tensorflow.proto.VariableSynchronization value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + synchronization_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Indicates when a distributed variable will be synced.
    +     * 
    + * + * .tensorflow.VariableSynchronization synchronization = 8; + * @return This builder for chaining. + */ + public Builder clearSynchronization() { + bitField0_ = (bitField0_ & ~0x00000080); + synchronization_ = 0; + onChanged(); + return this; + } + + private int aggregation_ = 0; + /** + *
    +     * Indicates how a distributed variable will be aggregated.
    +     * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @return The enum numeric value on the wire for aggregation. + */ + @java.lang.Override public int getAggregationValue() { + return aggregation_; + } + /** + *
    +     * Indicates how a distributed variable will be aggregated.
    +     * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @param value The enum numeric value on the wire for aggregation to set. + * @return This builder for chaining. + */ + public Builder setAggregationValue(int value) { + aggregation_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * Indicates how a distributed variable will be aggregated.
    +     * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @return The aggregation. + */ + @java.lang.Override + public org.tensorflow.proto.VariableAggregation getAggregation() { + org.tensorflow.proto.VariableAggregation result = org.tensorflow.proto.VariableAggregation.forNumber(aggregation_); + return result == null ? org.tensorflow.proto.VariableAggregation.UNRECOGNIZED : result; + } + /** + *
    +     * Indicates how a distributed variable will be aggregated.
    +     * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @param value The aggregation to set. + * @return This builder for chaining. + */ + public Builder setAggregation(org.tensorflow.proto.VariableAggregation value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + aggregation_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Indicates how a distributed variable will be aggregated.
    +     * 
    + * + * .tensorflow.VariableAggregation aggregation = 9; + * @return This builder for chaining. + */ + public Builder clearAggregation() { + bitField0_ = (bitField0_ & ~0x00000100); + aggregation_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.VariableDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.VariableDef) + private static final org.tensorflow.proto.VariableDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.VariableDef(); + } + + public static org.tensorflow.proto.VariableDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VariableDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VariableDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDefOrBuilder.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDefOrBuilder.java index 31cf5f0207a..c21be5ee951 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/variable.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface VariableDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.VariableDef) @@ -13,6 +15,7 @@ public interface VariableDefOrBuilder extends *
    * * string variable_name = 1; + * @return The variableName. */ java.lang.String getVariableName(); /** @@ -21,6 +24,7 @@ public interface VariableDefOrBuilder extends *
    * * string variable_name = 1; + * @return The bytes for variableName. */ com.google.protobuf.ByteString getVariableNameBytes(); @@ -31,6 +35,7 @@ public interface VariableDefOrBuilder extends *
    * * string initial_value_name = 6; + * @return The initialValueName. */ java.lang.String getInitialValueName(); /** @@ -39,6 +44,7 @@ public interface VariableDefOrBuilder extends *
    * * string initial_value_name = 6; + * @return The bytes for initialValueName. */ com.google.protobuf.ByteString getInitialValueNameBytes(); @@ -49,6 +55,7 @@ public interface VariableDefOrBuilder extends *
    * * string initializer_name = 2; + * @return The initializerName. */ java.lang.String getInitializerName(); /** @@ -57,6 +64,7 @@ public interface VariableDefOrBuilder extends * * * string initializer_name = 2; + * @return The bytes for initializerName. */ com.google.protobuf.ByteString getInitializerNameBytes(); @@ -67,6 +75,7 @@ public interface VariableDefOrBuilder extends * * * string snapshot_name = 3; + * @return The snapshotName. */ java.lang.String getSnapshotName(); /** @@ -75,6 +84,7 @@ public interface VariableDefOrBuilder extends * * * string snapshot_name = 3; + * @return The bytes for snapshotName. */ com.google.protobuf.ByteString getSnapshotNameBytes(); @@ -85,6 +95,7 @@ public interface VariableDefOrBuilder extends * * * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return Whether the saveSliceInfoDef field is set. */ boolean hasSaveSliceInfoDef(); /** @@ -93,8 +104,9 @@ public interface VariableDefOrBuilder extends * * * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4; + * @return The saveSliceInfoDef. */ - org.tensorflow.proto.framework.SaveSliceInfoDef getSaveSliceInfoDef(); + org.tensorflow.proto.SaveSliceInfoDef getSaveSliceInfoDef(); /** *
        * Support for saving variables as slices of a larger variable.
    @@ -102,7 +114,7 @@ public interface VariableDefOrBuilder extends
        *
        * .tensorflow.SaveSliceInfoDef save_slice_info_def = 4;
        */
    -  org.tensorflow.proto.framework.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder();
    +  org.tensorflow.proto.SaveSliceInfoDefOrBuilder getSaveSliceInfoDefOrBuilder();
     
       /**
        * 
    @@ -110,6 +122,7 @@ public interface VariableDefOrBuilder extends
        * 
    * * bool is_resource = 5; + * @return The isResource. */ boolean getIsResource(); @@ -119,6 +132,7 @@ public interface VariableDefOrBuilder extends *
    * * bool trainable = 7; + * @return The trainable. */ boolean getTrainable(); @@ -128,6 +142,7 @@ public interface VariableDefOrBuilder extends * * * .tensorflow.VariableSynchronization synchronization = 8; + * @return The enum numeric value on the wire for synchronization. */ int getSynchronizationValue(); /** @@ -136,8 +151,9 @@ public interface VariableDefOrBuilder extends * * * .tensorflow.VariableSynchronization synchronization = 8; + * @return The synchronization. */ - org.tensorflow.proto.framework.VariableSynchronization getSynchronization(); + org.tensorflow.proto.VariableSynchronization getSynchronization(); /** *
    @@ -145,6 +161,7 @@ public interface VariableDefOrBuilder extends
        * 
    * * .tensorflow.VariableAggregation aggregation = 9; + * @return The enum numeric value on the wire for aggregation. */ int getAggregationValue(); /** @@ -153,6 +170,7 @@ public interface VariableDefOrBuilder extends * * * .tensorflow.VariableAggregation aggregation = 9; + * @return The aggregation. */ - org.tensorflow.proto.framework.VariableAggregation getAggregation(); + org.tensorflow.proto.VariableAggregation getAggregation(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableProtos.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableProtos.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableProtos.java index 1d8c7d85e0a..0fcca6df742 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableProtos.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableProtos.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/variable.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public final class VariableProtos { private VariableProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VariableProtos.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -17,12 +28,12 @@ public static void registerAllExtensions( static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_VariableDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_VariableDef_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_tensorflow_SaveSliceInfoDef_descriptor; static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -53,11 +64,10 @@ public static void registerAllExtensions( "on\022\035\n\031VARIABLE_AGGREGATION_NONE\020\000\022\034\n\030VAR" + "IABLE_AGGREGATION_SUM\020\001\022\035\n\031VARIABLE_AGGR" + "EGATION_MEAN\020\002\022+\n\'VARIABLE_AGGREGATION_O" + - "NLY_FIRST_REPLICA\020\003B\206\001\n\036org.tensorflow.p" + - "roto.frameworkB\016VariableProtosP\001ZOgithub" + - ".com/tensorflow/tensorflow/tensorflow/go" + - "/core/framework/variable_go_proto\370\001\001b\006pr" + - "oto3" + "NLY_FIRST_REPLICA\020\003B|\n\024org.tensorflow.pr" + + "otoB\016VariableProtosP\001ZOgithub.com/tensor" + + "flow/tensorflow/tensorflow/go/core/frame" + + "work/variable_go_proto\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -66,15 +76,16 @@ public static void registerAllExtensions( internal_static_tensorflow_VariableDef_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_tensorflow_VariableDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_VariableDef_descriptor, new java.lang.String[] { "VariableName", "InitialValueName", "InitializerName", "SnapshotName", "SaveSliceInfoDef", "IsResource", "Trainable", "Synchronization", "Aggregation", }); internal_static_tensorflow_SaveSliceInfoDef_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_tensorflow_SaveSliceInfoDef_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_tensorflow_SaveSliceInfoDef_descriptor, new java.lang.String[] { "FullName", "FullShape", "VarOffset", "VarShape", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableSynchronization.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableSynchronization.java similarity index 84% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableSynchronization.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableSynchronization.java index b71b26cdcc1..3a618d402ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VariableSynchronization.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariableSynchronization.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/variable.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; /** *
    @@ -53,6 +55,15 @@ public enum VariableSynchronization
       UNRECOGNIZED(-1),
       ;
     
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      VariableSynchronization.class.getName());
    +  }
       /**
        * 
        * `AUTO`: Indicates that the synchronization will be determined by the
    @@ -102,6 +113,8 @@ public final int getNumber() {
       }
     
       /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
        * @deprecated Use {@link #forNumber(int)} instead.
        */
       @java.lang.Deprecated
    @@ -109,6 +122,10 @@ public static VariableSynchronization valueOf(int value) {
         return forNumber(value);
       }
     
    +  /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
    +   */
       public static VariableSynchronization forNumber(int value) {
         switch (value) {
           case 0: return VARIABLE_SYNCHRONIZATION_AUTO;
    @@ -133,6 +150,10 @@ public VariableSynchronization findValueByNumber(int number) {
     
       public final com.google.protobuf.Descriptors.EnumValueDescriptor
           getValueDescriptor() {
    +    if (this == UNRECOGNIZED) {
    +      throw new java.lang.IllegalStateException(
    +          "Can't get the descriptor of an unrecognized enum value.");
    +    }
         return getDescriptor().getValues().get(ordinal());
       }
       public final com.google.protobuf.Descriptors.EnumDescriptor
    @@ -141,7 +162,7 @@ public VariableSynchronization findValueByNumber(int number) {
       }
       public static final com.google.protobuf.Descriptors.EnumDescriptor
           getDescriptor() {
    -    return org.tensorflow.proto.framework.VariableProtos.getDescriptor().getEnumTypes().get(0);
    +    return org.tensorflow.proto.VariableProtos.getDescriptor().getEnumTypes().get(0);
       }
     
       private static final VariableSynchronization[] VALUES = values();
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProto.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProto.java
    new file mode 100644
    index 00000000000..50181e54d12
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProto.java
    @@ -0,0 +1,1066 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/tensor.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * 
    + * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    + * 
    + * + * Protobuf type {@code tensorflow.VariantTensorDataProto} + */ +public final class VariantTensorDataProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.VariantTensorDataProto) + VariantTensorDataProtoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VariantTensorDataProto.class.getName()); + } + // Use VariantTensorDataProto.newBuilder() to construct. + private VariantTensorDataProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private VariantTensorDataProto() { + typeName_ = ""; + metadata_ = com.google.protobuf.ByteString.EMPTY; + tensors_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VariantTensorDataProto.class, org.tensorflow.proto.VariantTensorDataProto.Builder.class); + } + + public static final int TYPE_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object typeName_ = ""; + /** + *
    +   * Name of the type of objects being serialized.
    +   * 
    + * + * string type_name = 1; + * @return The typeName. + */ + @java.lang.Override + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + 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(); + typeName_ = s; + return s; + } + } + /** + *
    +   * Name of the type of objects being serialized.
    +   * 
    + * + * string type_name = 1; + * @return The bytes for typeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +   * Portions of the object that are not Tensors.
    +   * 
    + * + * bytes metadata = 2; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetadata() { + return metadata_; + } + + public static final int TENSORS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List tensors_; + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + @java.lang.Override + public java.util.List getTensorsList() { + return tensors_; + } + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + @java.lang.Override + public java.util.List + getTensorsOrBuilderList() { + return tensors_; + } + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + @java.lang.Override + public int getTensorsCount() { + return tensors_.size(); + } + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensors(int index) { + return tensors_.get(index); + } + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorsOrBuilder( + int index) { + return tensors_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, typeName_); + } + if (!metadata_.isEmpty()) { + output.writeBytes(2, metadata_); + } + for (int i = 0; i < tensors_.size(); i++) { + output.writeMessage(3, tensors_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, typeName_); + } + if (!metadata_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, metadata_); + } + for (int i = 0; i < tensors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, tensors_.get(i)); + } + size += getUnknownFields().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.VariantTensorDataProto)) { + return super.equals(obj); + } + org.tensorflow.proto.VariantTensorDataProto other = (org.tensorflow.proto.VariantTensorDataProto) obj; + + if (!getTypeName() + .equals(other.getTypeName())) return false; + if (!getMetadata() + .equals(other.getMetadata())) return false; + if (!getTensorsList() + .equals(other.getTensorsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTypeName().hashCode(); + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + if (getTensorsCount() > 0) { + hash = (37 * hash) + TENSORS_FIELD_NUMBER; + hash = (53 * hash) + getTensorsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.VariantTensorDataProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariantTensorDataProto 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.VariantTensorDataProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariantTensorDataProto 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.VariantTensorDataProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VariantTensorDataProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.VariantTensorDataProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VariantTensorDataProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.VariantTensorDataProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.VariantTensorDataProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.VariantTensorDataProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VariantTensorDataProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.VariantTensorDataProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing the serialization format of DT_VARIANT tensors.
    +   * 
    + * + * Protobuf type {@code tensorflow.VariantTensorDataProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.VariantTensorDataProto) + org.tensorflow.proto.VariantTensorDataProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VariantTensorDataProto.class, org.tensorflow.proto.VariantTensorDataProto.Builder.class); + } + + // Construct using org.tensorflow.proto.VariantTensorDataProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeName_ = ""; + metadata_ = com.google.protobuf.ByteString.EMPTY; + if (tensorsBuilder_ == null) { + tensors_ = java.util.Collections.emptyList(); + } else { + tensors_ = null; + tensorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.TensorProtos.internal_static_tensorflow_VariantTensorDataProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.VariantTensorDataProto getDefaultInstanceForType() { + return org.tensorflow.proto.VariantTensorDataProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.VariantTensorDataProto build() { + org.tensorflow.proto.VariantTensorDataProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.VariantTensorDataProto buildPartial() { + org.tensorflow.proto.VariantTensorDataProto result = new org.tensorflow.proto.VariantTensorDataProto(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.VariantTensorDataProto result) { + if (tensorsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + tensors_ = java.util.Collections.unmodifiableList(tensors_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.tensors_ = tensors_; + } else { + result.tensors_ = tensorsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.VariantTensorDataProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeName_ = typeName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadata_ = metadata_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.VariantTensorDataProto) { + return mergeFrom((org.tensorflow.proto.VariantTensorDataProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.VariantTensorDataProto other) { + if (other == org.tensorflow.proto.VariantTensorDataProto.getDefaultInstance()) return this; + if (!other.getTypeName().isEmpty()) { + typeName_ = other.typeName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMetadata() != com.google.protobuf.ByteString.EMPTY) { + setMetadata(other.getMetadata()); + } + if (tensorsBuilder_ == null) { + if (!other.tensors_.isEmpty()) { + if (tensors_.isEmpty()) { + tensors_ = other.tensors_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureTensorsIsMutable(); + tensors_.addAll(other.tensors_); + } + onChanged(); + } + } else { + if (!other.tensors_.isEmpty()) { + if (tensorsBuilder_.isEmpty()) { + tensorsBuilder_.dispose(); + tensorsBuilder_ = null; + tensors_ = other.tensors_; + bitField0_ = (bitField0_ & ~0x00000004); + tensorsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorsFieldBuilder() : null; + } else { + tensorsBuilder_.addAllMessages(other.tensors_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + typeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + metadata_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + org.tensorflow.proto.TensorProto m = + input.readMessage( + org.tensorflow.proto.TensorProto.parser(), + extensionRegistry); + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + tensors_.add(m); + } else { + tensorsBuilder_.addMessage(m); + } + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object typeName_ = ""; + /** + *
    +     * Name of the type of objects being serialized.
    +     * 
    + * + * string type_name = 1; + * @return The typeName. + */ + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the type of objects being serialized.
    +     * 
    + * + * string type_name = 1; + * @return The bytes for typeName. + */ + public com.google.protobuf.ByteString + getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + typeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the type of objects being serialized.
    +     * 
    + * + * string type_name = 1; + * @param value The typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + typeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the type of objects being serialized.
    +     * 
    + * + * string type_name = 1; + * @return This builder for chaining. + */ + public Builder clearTypeName() { + typeName_ = getDefaultInstance().getTypeName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the type of objects being serialized.
    +     * 
    + * + * string type_name = 1; + * @param value The bytes for typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + typeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Portions of the object that are not Tensors.
    +     * 
    + * + * bytes metadata = 2; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetadata() { + return metadata_; + } + /** + *
    +     * Portions of the object that are not Tensors.
    +     * 
    + * + * bytes metadata = 2; + * @param value The metadata to set. + * @return This builder for chaining. + */ + public Builder setMetadata(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + metadata_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Portions of the object that are not Tensors.
    +     * 
    + * + * bytes metadata = 2; + * @return This builder for chaining. + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000002); + metadata_ = getDefaultInstance().getMetadata(); + onChanged(); + return this; + } + + private java.util.List tensors_ = + java.util.Collections.emptyList(); + private void ensureTensorsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + tensors_ = new java.util.ArrayList(tensors_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorsBuilder_; + + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public java.util.List getTensorsList() { + if (tensorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensors_); + } else { + return tensorsBuilder_.getMessageList(); + } + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public int getTensorsCount() { + if (tensorsBuilder_ == null) { + return tensors_.size(); + } else { + return tensorsBuilder_.getCount(); + } + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public org.tensorflow.proto.TensorProto getTensors(int index) { + if (tensorsBuilder_ == null) { + return tensors_.get(index); + } else { + return tensorsBuilder_.getMessage(index); + } + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder setTensors( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorsIsMutable(); + tensors_.set(index, value); + onChanged(); + } else { + tensorsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder setTensors( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + tensors_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder addTensors(org.tensorflow.proto.TensorProto value) { + if (tensorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorsIsMutable(); + tensors_.add(value); + onChanged(); + } else { + tensorsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder addTensors( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorsIsMutable(); + tensors_.add(index, value); + onChanged(); + } else { + tensorsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder addTensors( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + tensors_.add(builderForValue.build()); + onChanged(); + } else { + tensorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder addTensors( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + tensors_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder addAllTensors( + java.lang.Iterable values) { + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensors_); + onChanged(); + } else { + tensorsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder clearTensors() { + if (tensorsBuilder_ == null) { + tensors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + tensorsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public Builder removeTensors(int index) { + if (tensorsBuilder_ == null) { + ensureTensorsIsMutable(); + tensors_.remove(index); + onChanged(); + } else { + tensorsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorsBuilder( + int index) { + return getTensorsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorsOrBuilder( + int index) { + if (tensorsBuilder_ == null) { + return tensors_.get(index); } else { + return tensorsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public java.util.List + getTensorsOrBuilderList() { + if (tensorsBuilder_ != null) { + return tensorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensors_); + } + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorsBuilder() { + return getTensorsFieldBuilder().addBuilder( + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorsBuilder( + int index) { + return getTensorsFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + *
    +     * Tensors contained within objects being serialized.
    +     * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + public java.util.List + getTensorsBuilderList() { + return getTensorsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorsFieldBuilder() { + if (tensorsBuilder_ == null) { + tensorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + tensors_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + tensors_ = null; + } + return tensorsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.VariantTensorDataProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.VariantTensorDataProto) + private static final org.tensorflow.proto.VariantTensorDataProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.VariantTensorDataProto(); + } + + public static org.tensorflow.proto.VariantTensorDataProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VariantTensorDataProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VariantTensorDataProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProtoOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProtoOrBuilder.java new file mode 100644 index 00000000000..35d2a7a341b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VariantTensorDataProtoOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/tensor.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface VariantTensorDataProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.VariantTensorDataProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +   * Name of the type of objects being serialized.
    +   * 
    + * + * string type_name = 1; + * @return The typeName. + */ + java.lang.String getTypeName(); + /** + *
    +   * Name of the type of objects being serialized.
    +   * 
    + * + * string type_name = 1; + * @return The bytes for typeName. + */ + com.google.protobuf.ByteString + getTypeNameBytes(); + + /** + *
    +   * Portions of the object that are not Tensors.
    +   * 
    + * + * bytes metadata = 2; + * @return The metadata. + */ + com.google.protobuf.ByteString getMetadata(); + + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + java.util.List + getTensorsList(); + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + org.tensorflow.proto.TensorProto getTensors(int index); + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + int getTensorsCount(); + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + java.util.List + getTensorsOrBuilderList(); + /** + *
    +   * Tensors contained within objects being serialized.
    +   * 
    + * + * repeated .tensorflow.TensorProto tensors = 3; + */ + org.tensorflow.proto.TensorProtoOrBuilder getTensorsOrBuilder( + int index); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfig.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfig.java new file mode 100644 index 00000000000..c505dd32bab --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfig.java @@ -0,0 +1,708 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/verifier_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * The config for graph verifiers.
    + * 
    + * + * Protobuf type {@code tensorflow.VerifierConfig} + */ +public final class VerifierConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.VerifierConfig) + VerifierConfigOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VerifierConfig.class.getName()); + } + // Use VerifierConfig.newBuilder() to construct. + private VerifierConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private VerifierConfig() { + structureVerifier_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VerifierConfig.class, org.tensorflow.proto.VerifierConfig.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.VerifierConfig.Toggle} + */ + public enum Toggle + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * ON = 1; + */ + ON(1), + /** + * OFF = 2; + */ + OFF(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Toggle.class.getName()); + } + /** + * 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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Toggle valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Toggle 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< + Toggle> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Toggle findValueByNumber(int number) { + return Toggle.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.VerifierConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final Toggle[] VALUES = values(); + + public static Toggle 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 Toggle(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.VerifierConfig.Toggle) + } + + public static final int VERIFICATION_TIMEOUT_IN_MS_FIELD_NUMBER = 1; + private long verificationTimeoutInMs_ = 0L; + /** + *
    +   * Deadline for completion of all verification i.e. all the Toggle ON
    +   * verifiers must complete execution within this time.
    +   * 
    + * + * int64 verification_timeout_in_ms = 1; + * @return The verificationTimeoutInMs. + */ + @java.lang.Override + public long getVerificationTimeoutInMs() { + return verificationTimeoutInMs_; + } + + public static final int STRUCTURE_VERIFIER_FIELD_NUMBER = 2; + private int structureVerifier_ = 0; + /** + *
    +   * Perform structural validation on a tensorflow graph. Default is OFF.
    +   * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The enum numeric value on the wire for structureVerifier. + */ + @java.lang.Override public int getStructureVerifierValue() { + return structureVerifier_; + } + /** + *
    +   * Perform structural validation on a tensorflow graph. Default is OFF.
    +   * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The structureVerifier. + */ + @java.lang.Override public org.tensorflow.proto.VerifierConfig.Toggle getStructureVerifier() { + org.tensorflow.proto.VerifierConfig.Toggle result = org.tensorflow.proto.VerifierConfig.Toggle.forNumber(structureVerifier_); + return result == null ? org.tensorflow.proto.VerifierConfig.Toggle.UNRECOGNIZED : result; + } + + 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 (verificationTimeoutInMs_ != 0L) { + output.writeInt64(1, verificationTimeoutInMs_); + } + if (structureVerifier_ != org.tensorflow.proto.VerifierConfig.Toggle.DEFAULT.getNumber()) { + output.writeEnum(2, structureVerifier_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (verificationTimeoutInMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, verificationTimeoutInMs_); + } + if (structureVerifier_ != org.tensorflow.proto.VerifierConfig.Toggle.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, structureVerifier_); + } + size += getUnknownFields().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.VerifierConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.VerifierConfig other = (org.tensorflow.proto.VerifierConfig) obj; + + if (getVerificationTimeoutInMs() + != other.getVerificationTimeoutInMs()) return false; + if (structureVerifier_ != other.structureVerifier_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERIFICATION_TIMEOUT_IN_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVerificationTimeoutInMs()); + hash = (37 * hash) + STRUCTURE_VERIFIER_FIELD_NUMBER; + hash = (53 * hash) + structureVerifier_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.VerifierConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VerifierConfig 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.VerifierConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VerifierConfig 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.VerifierConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VerifierConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.VerifierConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VerifierConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.VerifierConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.VerifierConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.VerifierConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VerifierConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.VerifierConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * The config for graph verifiers.
    +   * 
    + * + * Protobuf type {@code tensorflow.VerifierConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.VerifierConfig) + org.tensorflow.proto.VerifierConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VerifierConfig.class, org.tensorflow.proto.VerifierConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.VerifierConfig.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + verificationTimeoutInMs_ = 0L; + structureVerifier_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.VerifierConfigProtos.internal_static_tensorflow_VerifierConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.VerifierConfig getDefaultInstanceForType() { + return org.tensorflow.proto.VerifierConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.VerifierConfig build() { + org.tensorflow.proto.VerifierConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.VerifierConfig buildPartial() { + org.tensorflow.proto.VerifierConfig result = new org.tensorflow.proto.VerifierConfig(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.VerifierConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.verificationTimeoutInMs_ = verificationTimeoutInMs_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.structureVerifier_ = structureVerifier_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.VerifierConfig) { + return mergeFrom((org.tensorflow.proto.VerifierConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.VerifierConfig other) { + if (other == org.tensorflow.proto.VerifierConfig.getDefaultInstance()) return this; + if (other.getVerificationTimeoutInMs() != 0L) { + setVerificationTimeoutInMs(other.getVerificationTimeoutInMs()); + } + if (other.structureVerifier_ != 0) { + setStructureVerifierValue(other.getStructureVerifierValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + verificationTimeoutInMs_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + structureVerifier_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long verificationTimeoutInMs_ ; + /** + *
    +     * Deadline for completion of all verification i.e. all the Toggle ON
    +     * verifiers must complete execution within this time.
    +     * 
    + * + * int64 verification_timeout_in_ms = 1; + * @return The verificationTimeoutInMs. + */ + @java.lang.Override + public long getVerificationTimeoutInMs() { + return verificationTimeoutInMs_; + } + /** + *
    +     * Deadline for completion of all verification i.e. all the Toggle ON
    +     * verifiers must complete execution within this time.
    +     * 
    + * + * int64 verification_timeout_in_ms = 1; + * @param value The verificationTimeoutInMs to set. + * @return This builder for chaining. + */ + public Builder setVerificationTimeoutInMs(long value) { + + verificationTimeoutInMs_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Deadline for completion of all verification i.e. all the Toggle ON
    +     * verifiers must complete execution within this time.
    +     * 
    + * + * int64 verification_timeout_in_ms = 1; + * @return This builder for chaining. + */ + public Builder clearVerificationTimeoutInMs() { + bitField0_ = (bitField0_ & ~0x00000001); + verificationTimeoutInMs_ = 0L; + onChanged(); + return this; + } + + private int structureVerifier_ = 0; + /** + *
    +     * Perform structural validation on a tensorflow graph. Default is OFF.
    +     * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The enum numeric value on the wire for structureVerifier. + */ + @java.lang.Override public int getStructureVerifierValue() { + return structureVerifier_; + } + /** + *
    +     * Perform structural validation on a tensorflow graph. Default is OFF.
    +     * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @param value The enum numeric value on the wire for structureVerifier to set. + * @return This builder for chaining. + */ + public Builder setStructureVerifierValue(int value) { + structureVerifier_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Perform structural validation on a tensorflow graph. Default is OFF.
    +     * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The structureVerifier. + */ + @java.lang.Override + public org.tensorflow.proto.VerifierConfig.Toggle getStructureVerifier() { + org.tensorflow.proto.VerifierConfig.Toggle result = org.tensorflow.proto.VerifierConfig.Toggle.forNumber(structureVerifier_); + return result == null ? org.tensorflow.proto.VerifierConfig.Toggle.UNRECOGNIZED : result; + } + /** + *
    +     * Perform structural validation on a tensorflow graph. Default is OFF.
    +     * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @param value The structureVerifier to set. + * @return This builder for chaining. + */ + public Builder setStructureVerifier(org.tensorflow.proto.VerifierConfig.Toggle value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + structureVerifier_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Perform structural validation on a tensorflow graph. Default is OFF.
    +     * 
    + * + * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return This builder for chaining. + */ + public Builder clearStructureVerifier() { + bitField0_ = (bitField0_ & ~0x00000002); + structureVerifier_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.VerifierConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.VerifierConfig) + private static final org.tensorflow.proto.VerifierConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.VerifierConfig(); + } + + public static org.tensorflow.proto.VerifierConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifierConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VerifierConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigOrBuilder.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigOrBuilder.java index 230a728e05f..73d458cfcba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VerifierConfigOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/verifier_config.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface VerifierConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.VerifierConfig) @@ -14,6 +16,7 @@ public interface VerifierConfigOrBuilder extends *
    * * int64 verification_timeout_in_ms = 1; + * @return The verificationTimeoutInMs. */ long getVerificationTimeoutInMs(); @@ -23,6 +26,7 @@ public interface VerifierConfigOrBuilder extends *
    * * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The enum numeric value on the wire for structureVerifier. */ int getStructureVerifierValue(); /** @@ -31,6 +35,7 @@ public interface VerifierConfigOrBuilder extends * * * .tensorflow.VerifierConfig.Toggle structure_verifier = 2; + * @return The structureVerifier. */ - org.tensorflow.proto.framework.VerifierConfig.Toggle getStructureVerifier(); + org.tensorflow.proto.VerifierConfig.Toggle getStructureVerifier(); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigProtos.java new file mode 100644 index 00000000000..90bb0857380 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VerifierConfigProtos.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/verifier_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class VerifierConfigProtos { + private VerifierConfigProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VerifierConfigProtos.class.getName()); + } + 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_VerifierConfig_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_VerifierConfig_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/verifier_conf" + + "ig.proto\022\ntensorflow\"\233\001\n\016VerifierConfig\022" + + "\"\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\210\001\n\024org.tensorflow.pr" + + "otoB\024VerifierConfigProtosP\001ZUgithub.com/" + + "tensorflow/tensorflow/tensorflow/go/core" + + "/protobuf/for_core_protos_go_proto\370\001\001b\006p" + + "roto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_VerifierConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_VerifierConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_VerifierConfig_descriptor, + new java.lang.String[] { "VerificationTimeoutInMs", "StructureVerifier", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDef.java new file mode 100644 index 00000000000..b9d81a5d931 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDef.java @@ -0,0 +1,774 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/versions.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Version information for a piece of serialized data
    + *
    + * There are different types of versions for each type of data
    + * (GraphDef, etc.), but they all have the same common shape
    + * described here.
    + *
    + * Each consumer has "consumer" and "min_producer" versions (specified
    + * elsewhere).  A consumer is allowed to consume this data if
    + *
    + * producer >= min_producer
    + * consumer >= min_consumer
    + * consumer not in bad_consumers
    + * 
    + * + * Protobuf type {@code tensorflow.VersionDef} + */ +public final class VersionDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.VersionDef) + VersionDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VersionDef.class.getName()); + } + // Use VersionDef.newBuilder() to construct. + private VersionDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private VersionDef() { + badConsumers_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VersionsProtos.internal_static_tensorflow_VersionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VersionDef.class, org.tensorflow.proto.VersionDef.Builder.class); + } + + public static final int PRODUCER_FIELD_NUMBER = 1; + private int producer_ = 0; + /** + *
    +   * The version of the code that produced this data.
    +   * 
    + * + * int32 producer = 1; + * @return The producer. + */ + @java.lang.Override + public int getProducer() { + return producer_; + } + + public static final int MIN_CONSUMER_FIELD_NUMBER = 2; + private int minConsumer_ = 0; + /** + *
    +   * Any consumer below this version is not allowed to consume this data.
    +   * 
    + * + * int32 min_consumer = 2; + * @return The minConsumer. + */ + @java.lang.Override + public int getMinConsumer() { + return minConsumer_; + } + + public static final int BAD_CONSUMERS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList badConsumers_ = + emptyIntList(); + /** + *
    +   * Specific consumer versions which are disallowed (e.g. due to bugs).
    +   * 
    + * + * repeated int32 bad_consumers = 3; + * @return A list containing the badConsumers. + */ + @java.lang.Override + public java.util.List + getBadConsumersList() { + return badConsumers_; + } + /** + *
    +   * Specific consumer versions which are disallowed (e.g. due to bugs).
    +   * 
    + * + * repeated int32 bad_consumers = 3; + * @return The count of badConsumers. + */ + public int getBadConsumersCount() { + return badConsumers_.size(); + } + /** + *
    +   * Specific consumer versions which are disallowed (e.g. due to bugs).
    +   * 
    + * + * repeated int32 bad_consumers = 3; + * @param index The index of the element to return. + * @return The badConsumers at the given index. + */ + public int getBadConsumers(int index) { + return badConsumers_.getInt(index); + } + private int badConsumersMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (producer_ != 0) { + output.writeInt32(1, producer_); + } + if (minConsumer_ != 0) { + output.writeInt32(2, minConsumer_); + } + if (getBadConsumersList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(badConsumersMemoizedSerializedSize); + } + for (int i = 0; i < badConsumers_.size(); i++) { + output.writeInt32NoTag(badConsumers_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (producer_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, producer_); + } + if (minConsumer_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minConsumer_); + } + { + int dataSize = 0; + for (int i = 0; i < badConsumers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(badConsumers_.getInt(i)); + } + size += dataSize; + if (!getBadConsumersList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + badConsumersMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.VersionDef)) { + return super.equals(obj); + } + org.tensorflow.proto.VersionDef other = (org.tensorflow.proto.VersionDef) obj; + + if (getProducer() + != other.getProducer()) return false; + if (getMinConsumer() + != other.getMinConsumer()) return false; + if (!getBadConsumersList() + .equals(other.getBadConsumersList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PRODUCER_FIELD_NUMBER; + hash = (53 * hash) + getProducer(); + hash = (37 * hash) + MIN_CONSUMER_FIELD_NUMBER; + hash = (53 * hash) + getMinConsumer(); + if (getBadConsumersCount() > 0) { + hash = (37 * hash) + BAD_CONSUMERS_FIELD_NUMBER; + hash = (53 * hash) + getBadConsumersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.VersionDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VersionDef 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.VersionDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VersionDef 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.VersionDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.VersionDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.VersionDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VersionDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.VersionDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.VersionDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.VersionDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.VersionDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.VersionDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Version information for a piece of serialized data
    +   *
    +   * There are different types of versions for each type of data
    +   * (GraphDef, etc.), but they all have the same common shape
    +   * described here.
    +   *
    +   * Each consumer has "consumer" and "min_producer" versions (specified
    +   * elsewhere).  A consumer is allowed to consume this data if
    +   *
    +   * producer >= min_producer
    +   * consumer >= min_consumer
    +   * consumer not in bad_consumers
    +   * 
    + * + * Protobuf type {@code tensorflow.VersionDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.VersionDef) + org.tensorflow.proto.VersionDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.VersionsProtos.internal_static_tensorflow_VersionDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.VersionDef.class, org.tensorflow.proto.VersionDef.Builder.class); + } + + // Construct using org.tensorflow.proto.VersionDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + producer_ = 0; + minConsumer_ = 0; + badConsumers_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.VersionsProtos.internal_static_tensorflow_VersionDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.VersionDef getDefaultInstanceForType() { + return org.tensorflow.proto.VersionDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.VersionDef build() { + org.tensorflow.proto.VersionDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.VersionDef buildPartial() { + org.tensorflow.proto.VersionDef result = new org.tensorflow.proto.VersionDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.VersionDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.producer_ = producer_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.minConsumer_ = minConsumer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + badConsumers_.makeImmutable(); + result.badConsumers_ = badConsumers_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.VersionDef) { + return mergeFrom((org.tensorflow.proto.VersionDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.VersionDef other) { + if (other == org.tensorflow.proto.VersionDef.getDefaultInstance()) return this; + if (other.getProducer() != 0) { + setProducer(other.getProducer()); + } + if (other.getMinConsumer() != 0) { + setMinConsumer(other.getMinConsumer()); + } + if (!other.badConsumers_.isEmpty()) { + if (badConsumers_.isEmpty()) { + badConsumers_ = other.badConsumers_; + badConsumers_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureBadConsumersIsMutable(); + badConsumers_.addAll(other.badConsumers_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + producer_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + minConsumer_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + int v = input.readInt32(); + ensureBadConsumersIsMutable(); + badConsumers_.addInt(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureBadConsumersIsMutable(); + while (input.getBytesUntilLimit() > 0) { + badConsumers_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int producer_ ; + /** + *
    +     * The version of the code that produced this data.
    +     * 
    + * + * int32 producer = 1; + * @return The producer. + */ + @java.lang.Override + public int getProducer() { + return producer_; + } + /** + *
    +     * The version of the code that produced this data.
    +     * 
    + * + * int32 producer = 1; + * @param value The producer to set. + * @return This builder for chaining. + */ + public Builder setProducer(int value) { + + producer_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The version of the code that produced this data.
    +     * 
    + * + * int32 producer = 1; + * @return This builder for chaining. + */ + public Builder clearProducer() { + bitField0_ = (bitField0_ & ~0x00000001); + producer_ = 0; + onChanged(); + return this; + } + + private int minConsumer_ ; + /** + *
    +     * Any consumer below this version is not allowed to consume this data.
    +     * 
    + * + * int32 min_consumer = 2; + * @return The minConsumer. + */ + @java.lang.Override + public int getMinConsumer() { + return minConsumer_; + } + /** + *
    +     * Any consumer below this version is not allowed to consume this data.
    +     * 
    + * + * int32 min_consumer = 2; + * @param value The minConsumer to set. + * @return This builder for chaining. + */ + public Builder setMinConsumer(int value) { + + minConsumer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * Any consumer below this version is not allowed to consume this data.
    +     * 
    + * + * int32 min_consumer = 2; + * @return This builder for chaining. + */ + public Builder clearMinConsumer() { + bitField0_ = (bitField0_ & ~0x00000002); + minConsumer_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList badConsumers_ = emptyIntList(); + private void ensureBadConsumersIsMutable() { + if (!badConsumers_.isModifiable()) { + badConsumers_ = makeMutableCopy(badConsumers_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @return A list containing the badConsumers. + */ + public java.util.List + getBadConsumersList() { + badConsumers_.makeImmutable(); + return badConsumers_; + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @return The count of badConsumers. + */ + public int getBadConsumersCount() { + return badConsumers_.size(); + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @param index The index of the element to return. + * @return The badConsumers at the given index. + */ + public int getBadConsumers(int index) { + return badConsumers_.getInt(index); + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @param index The index to set the value at. + * @param value The badConsumers to set. + * @return This builder for chaining. + */ + public Builder setBadConsumers( + int index, int value) { + + ensureBadConsumersIsMutable(); + badConsumers_.setInt(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @param value The badConsumers to add. + * @return This builder for chaining. + */ + public Builder addBadConsumers(int value) { + + ensureBadConsumersIsMutable(); + badConsumers_.addInt(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @param values The badConsumers to add. + * @return This builder for chaining. + */ + public Builder addAllBadConsumers( + java.lang.Iterable values) { + ensureBadConsumersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, badConsumers_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Specific consumer versions which are disallowed (e.g. due to bugs).
    +     * 
    + * + * repeated int32 bad_consumers = 3; + * @return This builder for chaining. + */ + public Builder clearBadConsumers() { + badConsumers_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.VersionDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.VersionDef) + private static final org.tensorflow.proto.VersionDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.VersionDef(); + } + + public static org.tensorflow.proto.VersionDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VersionDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.VersionDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDefOrBuilder.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDefOrBuilder.java index 519769551aa..46a49c23fd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/VersionDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/framework/versions.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface VersionDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.VersionDef) @@ -13,6 +15,7 @@ public interface VersionDefOrBuilder extends * * * int32 producer = 1; + * @return The producer. */ int getProducer(); @@ -22,6 +25,7 @@ public interface VersionDefOrBuilder extends * * * int32 min_consumer = 2; + * @return The minConsumer. */ int getMinConsumer(); @@ -31,6 +35,7 @@ public interface VersionDefOrBuilder extends * * * repeated int32 bad_consumers = 3; + * @return A list containing the badConsumers. */ java.util.List getBadConsumersList(); /** @@ -39,6 +44,7 @@ public interface VersionDefOrBuilder extends * * * repeated int32 bad_consumers = 3; + * @return The count of badConsumers. */ int getBadConsumersCount(); /** @@ -47,6 +53,8 @@ public interface VersionDefOrBuilder extends * * * repeated int32 bad_consumers = 3; + * @param index The index of the element to return. + * @return The badConsumers at the given index. */ int getBadConsumers(int index); } diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionsProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionsProtos.java new file mode 100644 index 00000000000..4ab034a3ac6 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/VersionsProtos.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/versions.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public final class VersionsProtos { + private VersionsProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + VersionsProtos.class.getName()); + } + 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_VersionDef_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_VersionDef_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/framework/versions.pro" + + "to\022\ntensorflow\"K\n\nVersionDef\022\020\n\010producer" + + "\030\001 \001(\005\022\024\n\014min_consumer\030\002 \001(\005\022\025\n\rbad_cons" + + "umers\030\003 \003(\005B|\n\024org.tensorflow.protoB\016Ver" + + "sionsProtosP\001ZOgithub.com/tensorflow/ten" + + "sorflow/tensorflow/go/core/framework/ver" + + "sions_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_VersionDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_VersionDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_VersionDef_descriptor, + new java.lang.String[] { "Producer", "MinConsumer", "BadConsumers", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfig.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfig.java new file mode 100644 index 00000000000..af3277bb62a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfig.java @@ -0,0 +1,432 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + * Protobuf type {@code tensorflow.WatchdogConfig} + */ +public final class WatchdogConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.WatchdogConfig) + WatchdogConfigOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + WatchdogConfig.class.getName()); + } + // Use WatchdogConfig.newBuilder() to construct. + private WatchdogConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WatchdogConfig() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WatchdogConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.WatchdogConfig.class, org.tensorflow.proto.WatchdogConfig.Builder.class); + } + + public static final int TIMEOUT_MS_FIELD_NUMBER = 1; + private long timeoutMs_ = 0L; + /** + * int64 timeout_ms = 1; + * @return The timeoutMs. + */ + @java.lang.Override + public long getTimeoutMs() { + return timeoutMs_; + } + + 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 (timeoutMs_ != 0L) { + output.writeInt64(1, timeoutMs_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, timeoutMs_); + } + size += getUnknownFields().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.WatchdogConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.WatchdogConfig other = (org.tensorflow.proto.WatchdogConfig) obj; + + if (getTimeoutMs() + != other.getTimeoutMs()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimeoutMs()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.WatchdogConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WatchdogConfig 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.WatchdogConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WatchdogConfig 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.WatchdogConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WatchdogConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.WatchdogConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.WatchdogConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.WatchdogConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.WatchdogConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.WatchdogConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.WatchdogConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.WatchdogConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.WatchdogConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.WatchdogConfig) + org.tensorflow.proto.WatchdogConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WatchdogConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.WatchdogConfig.class, org.tensorflow.proto.WatchdogConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.WatchdogConfig.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + timeoutMs_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WatchdogConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.WatchdogConfig getDefaultInstanceForType() { + return org.tensorflow.proto.WatchdogConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.WatchdogConfig build() { + org.tensorflow.proto.WatchdogConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.WatchdogConfig buildPartial() { + org.tensorflow.proto.WatchdogConfig result = new org.tensorflow.proto.WatchdogConfig(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.WatchdogConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timeoutMs_ = timeoutMs_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.WatchdogConfig) { + return mergeFrom((org.tensorflow.proto.WatchdogConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.WatchdogConfig other) { + if (other == org.tensorflow.proto.WatchdogConfig.getDefaultInstance()) return this; + if (other.getTimeoutMs() != 0L) { + setTimeoutMs(other.getTimeoutMs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + timeoutMs_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long timeoutMs_ ; + /** + * int64 timeout_ms = 1; + * @return The timeoutMs. + */ + @java.lang.Override + public long getTimeoutMs() { + return timeoutMs_; + } + /** + * int64 timeout_ms = 1; + * @param value The timeoutMs to set. + * @return This builder for chaining. + */ + public Builder setTimeoutMs(long value) { + + timeoutMs_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 timeout_ms = 1; + * @return This builder for chaining. + */ + public Builder clearTimeoutMs() { + bitField0_ = (bitField0_ & ~0x00000001); + timeoutMs_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.WatchdogConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.WatchdogConfig) + private static final org.tensorflow.proto.WatchdogConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.WatchdogConfig(); + } + + public static org.tensorflow.proto.WatchdogConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WatchdogConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.WatchdogConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfigOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfigOrBuilder.java new file mode 100644 index 00000000000..8f35890f360 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WatchdogConfigOrBuilder.java @@ -0,0 +1,17 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/util/event.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +public interface WatchdogConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.WatchdogConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 timeout_ms = 1; + * @return The timeoutMs. + */ + long getTimeoutMs(); +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDef.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDef.java new file mode 100644 index 00000000000..dde2953f58a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDef.java @@ -0,0 +1,2611 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto; + +/** + *
    + * Protocol buffer representing a WhileContext object.
    + * 
    + * + * Protobuf type {@code tensorflow.WhileContextDef} + */ +public final class WhileContextDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.WhileContextDef) + WhileContextDefOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + WhileContextDef.class.getName()); + } + // Use WhileContextDef.newBuilder() to construct. + private WhileContextDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WhileContextDef() { + contextName_ = ""; + pivotName_ = ""; + pivotForPredName_ = ""; + pivotForBodyName_ = ""; + loopExitNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + loopEnterNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + maximumIterationsName_ = ""; + nestedContexts_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.WhileContextDef.class, org.tensorflow.proto.WhileContextDef.Builder.class); + } + + private int bitField0_; + public static final int CONTEXT_NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object contextName_ = ""; + /** + *
    +   * Name of the context.
    +   * 
    + * + * string context_name = 1; + * @return The contextName. + */ + @java.lang.Override + public java.lang.String getContextName() { + java.lang.Object ref = contextName_; + 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(); + contextName_ = s; + return s; + } + } + /** + *
    +   * Name of the context.
    +   * 
    + * + * string context_name = 1; + * @return The bytes for contextName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextNameBytes() { + java.lang.Object ref = contextName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARALLEL_ITERATIONS_FIELD_NUMBER = 2; + private int parallelIterations_ = 0; + /** + *
    +   * The number of iterations allowed to run in parallel.
    +   * 
    + * + * int32 parallel_iterations = 2; + * @return The parallelIterations. + */ + @java.lang.Override + public int getParallelIterations() { + return parallelIterations_; + } + + public static final int BACK_PROP_FIELD_NUMBER = 3; + private boolean backProp_ = false; + /** + *
    +   * Whether backprop is enabled for this while loop.
    +   * 
    + * + * bool back_prop = 3; + * @return The backProp. + */ + @java.lang.Override + public boolean getBackProp() { + return backProp_; + } + + public static final int SWAP_MEMORY_FIELD_NUMBER = 4; + private boolean swapMemory_ = false; + /** + *
    +   * Whether GPU-CPU memory swap is enabled for this loop.
    +   * 
    + * + * bool swap_memory = 4; + * @return The swapMemory. + */ + @java.lang.Override + public boolean getSwapMemory() { + return swapMemory_; + } + + public static final int PIVOT_NAME_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object pivotName_ = ""; + /** + *
    +   * Name of the pivot tensor.
    +   * 
    + * + * string pivot_name = 5; + * @return The pivotName. + */ + @java.lang.Override + public java.lang.String getPivotName() { + java.lang.Object ref = pivotName_; + 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(); + pivotName_ = s; + return s; + } + } + /** + *
    +   * Name of the pivot tensor.
    +   * 
    + * + * string pivot_name = 5; + * @return The bytes for pivotName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPivotNameBytes() { + java.lang.Object ref = pivotName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PIVOT_FOR_PRED_NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object pivotForPredName_ = ""; + /** + *
    +   * Name of the pivot_for_pred tensor.
    +   * 
    + * + * string pivot_for_pred_name = 6; + * @return The pivotForPredName. + */ + @java.lang.Override + public java.lang.String getPivotForPredName() { + java.lang.Object ref = pivotForPredName_; + 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(); + pivotForPredName_ = s; + return s; + } + } + /** + *
    +   * Name of the pivot_for_pred tensor.
    +   * 
    + * + * string pivot_for_pred_name = 6; + * @return The bytes for pivotForPredName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPivotForPredNameBytes() { + java.lang.Object ref = pivotForPredName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotForPredName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PIVOT_FOR_BODY_NAME_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object pivotForBodyName_ = ""; + /** + *
    +   * Name of the pivot_for_body tensor.
    +   * 
    + * + * string pivot_for_body_name = 7; + * @return The pivotForBodyName. + */ + @java.lang.Override + public java.lang.String getPivotForBodyName() { + java.lang.Object ref = pivotForBodyName_; + 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(); + pivotForBodyName_ = s; + return s; + } + } + /** + *
    +   * Name of the pivot_for_body tensor.
    +   * 
    + * + * string pivot_for_body_name = 7; + * @return The bytes for pivotForBodyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPivotForBodyNameBytes() { + java.lang.Object ref = pivotForBodyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotForBodyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOOP_EXIT_NAMES_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList loopExitNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * List of names for exit tensors.
    +   * 
    + * + * repeated string loop_exit_names = 8; + * @return A list containing the loopExitNames. + */ + public com.google.protobuf.ProtocolStringList + getLoopExitNamesList() { + return loopExitNames_; + } + /** + *
    +   * List of names for exit tensors.
    +   * 
    + * + * repeated string loop_exit_names = 8; + * @return The count of loopExitNames. + */ + public int getLoopExitNamesCount() { + return loopExitNames_.size(); + } + /** + *
    +   * List of names for exit tensors.
    +   * 
    + * + * repeated string loop_exit_names = 8; + * @param index The index of the element to return. + * @return The loopExitNames at the given index. + */ + public java.lang.String getLoopExitNames(int index) { + return loopExitNames_.get(index); + } + /** + *
    +   * List of names for exit tensors.
    +   * 
    + * + * repeated string loop_exit_names = 8; + * @param index The index of the value to return. + * @return The bytes of the loopExitNames at the given index. + */ + public com.google.protobuf.ByteString + getLoopExitNamesBytes(int index) { + return loopExitNames_.getByteString(index); + } + + public static final int LOOP_ENTER_NAMES_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList loopEnterNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +   * List of names for enter tensors.
    +   * 
    + * + * repeated string loop_enter_names = 10; + * @return A list containing the loopEnterNames. + */ + public com.google.protobuf.ProtocolStringList + getLoopEnterNamesList() { + return loopEnterNames_; + } + /** + *
    +   * List of names for enter tensors.
    +   * 
    + * + * repeated string loop_enter_names = 10; + * @return The count of loopEnterNames. + */ + public int getLoopEnterNamesCount() { + return loopEnterNames_.size(); + } + /** + *
    +   * List of names for enter tensors.
    +   * 
    + * + * repeated string loop_enter_names = 10; + * @param index The index of the element to return. + * @return The loopEnterNames at the given index. + */ + public java.lang.String getLoopEnterNames(int index) { + return loopEnterNames_.get(index); + } + /** + *
    +   * List of names for enter tensors.
    +   * 
    + * + * repeated string loop_enter_names = 10; + * @param index The index of the value to return. + * @return The bytes of the loopEnterNames at the given index. + */ + public com.google.protobuf.ByteString + getLoopEnterNamesBytes(int index) { + return loopEnterNames_.getByteString(index); + } + + public static final int VALUES_DEF_FIELD_NUMBER = 9; + private org.tensorflow.proto.ValuesDef valuesDef_; + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 9; + * @return Whether the valuesDef field is set. + */ + @java.lang.Override + public boolean hasValuesDef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 9; + * @return The valuesDef. + */ + @java.lang.Override + public org.tensorflow.proto.ValuesDef getValuesDef() { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + /** + *
    +   * Values and external values in control flow context.
    +   * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + @java.lang.Override + public org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder() { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + + public static final int MAXIMUM_ITERATIONS_NAME_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private volatile java.lang.Object maximumIterationsName_ = ""; + /** + *
    +   * Optional name of the maximum_iterations tensor.
    +   * 
    + * + * string maximum_iterations_name = 11; + * @return The maximumIterationsName. + */ + @java.lang.Override + public java.lang.String getMaximumIterationsName() { + java.lang.Object ref = maximumIterationsName_; + 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(); + maximumIterationsName_ = s; + return s; + } + } + /** + *
    +   * Optional name of the maximum_iterations tensor.
    +   * 
    + * + * string maximum_iterations_name = 11; + * @return The bytes for maximumIterationsName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMaximumIterationsNameBytes() { + java.lang.Object ref = maximumIterationsName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maximumIterationsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NESTED_CONTEXTS_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List nestedContexts_; + /** + *
    +   * Contexts contained inside this context (e.g. nested whiles).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + @java.lang.Override + public java.util.List getNestedContextsList() { + return nestedContexts_; + } + /** + *
    +   * Contexts contained inside this context (e.g. nested whiles).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + @java.lang.Override + public java.util.List + getNestedContextsOrBuilderList() { + return nestedContexts_; + } + /** + *
    +   * Contexts contained inside this context (e.g. nested whiles).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + @java.lang.Override + public int getNestedContextsCount() { + return nestedContexts_.size(); + } + /** + *
    +   * Contexts contained inside this context (e.g. nested whiles).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index) { + return nestedContexts_.get(index); + } + /** + *
    +   * Contexts contained inside this context (e.g. nested whiles).
    +   * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + @java.lang.Override + public org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( + int index) { + return nestedContexts_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, contextName_); + } + if (parallelIterations_ != 0) { + output.writeInt32(2, parallelIterations_); + } + if (backProp_ != false) { + output.writeBool(3, backProp_); + } + if (swapMemory_ != false) { + output.writeBool(4, swapMemory_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, pivotName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotForPredName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, pivotForPredName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotForBodyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, pivotForBodyName_); + } + for (int i = 0; i < loopExitNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, loopExitNames_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getValuesDef()); + } + for (int i = 0; i < loopEnterNames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, loopEnterNames_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maximumIterationsName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, maximumIterationsName_); + } + for (int i = 0; i < nestedContexts_.size(); i++) { + output.writeMessage(12, nestedContexts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, contextName_); + } + if (parallelIterations_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, parallelIterations_); + } + if (backProp_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, backProp_); + } + if (swapMemory_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, swapMemory_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pivotName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotForPredName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, pivotForPredName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pivotForBodyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, pivotForBodyName_); + } + { + int dataSize = 0; + for (int i = 0; i < loopExitNames_.size(); i++) { + dataSize += computeStringSizeNoTag(loopExitNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getLoopExitNamesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getValuesDef()); + } + { + int dataSize = 0; + for (int i = 0; i < loopEnterNames_.size(); i++) { + dataSize += computeStringSizeNoTag(loopEnterNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getLoopEnterNamesList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(maximumIterationsName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, maximumIterationsName_); + } + for (int i = 0; i < nestedContexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, nestedContexts_.get(i)); + } + size += getUnknownFields().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.WhileContextDef)) { + return super.equals(obj); + } + org.tensorflow.proto.WhileContextDef other = (org.tensorflow.proto.WhileContextDef) obj; + + if (!getContextName() + .equals(other.getContextName())) return false; + if (getParallelIterations() + != other.getParallelIterations()) return false; + if (getBackProp() + != other.getBackProp()) return false; + if (getSwapMemory() + != other.getSwapMemory()) return false; + if (!getPivotName() + .equals(other.getPivotName())) return false; + if (!getPivotForPredName() + .equals(other.getPivotForPredName())) return false; + if (!getPivotForBodyName() + .equals(other.getPivotForBodyName())) return false; + if (!getLoopExitNamesList() + .equals(other.getLoopExitNamesList())) return false; + if (!getLoopEnterNamesList() + .equals(other.getLoopEnterNamesList())) return false; + if (hasValuesDef() != other.hasValuesDef()) return false; + if (hasValuesDef()) { + if (!getValuesDef() + .equals(other.getValuesDef())) return false; + } + if (!getMaximumIterationsName() + .equals(other.getMaximumIterationsName())) return false; + if (!getNestedContextsList() + .equals(other.getNestedContextsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONTEXT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getContextName().hashCode(); + hash = (37 * hash) + PARALLEL_ITERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getParallelIterations(); + hash = (37 * hash) + BACK_PROP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBackProp()); + hash = (37 * hash) + SWAP_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSwapMemory()); + hash = (37 * hash) + PIVOT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPivotName().hashCode(); + hash = (37 * hash) + PIVOT_FOR_PRED_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPivotForPredName().hashCode(); + hash = (37 * hash) + PIVOT_FOR_BODY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPivotForBodyName().hashCode(); + if (getLoopExitNamesCount() > 0) { + hash = (37 * hash) + LOOP_EXIT_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getLoopExitNamesList().hashCode(); + } + if (getLoopEnterNamesCount() > 0) { + hash = (37 * hash) + LOOP_ENTER_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getLoopEnterNamesList().hashCode(); + } + if (hasValuesDef()) { + hash = (37 * hash) + VALUES_DEF_FIELD_NUMBER; + hash = (53 * hash) + getValuesDef().hashCode(); + } + hash = (37 * hash) + MAXIMUM_ITERATIONS_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMaximumIterationsName().hashCode(); + if (getNestedContextsCount() > 0) { + hash = (37 * hash) + NESTED_CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getNestedContextsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.WhileContextDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WhileContextDef 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.WhileContextDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WhileContextDef 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.WhileContextDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.WhileContextDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.WhileContextDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.WhileContextDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.WhileContextDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.WhileContextDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.WhileContextDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.WhileContextDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.WhileContextDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +   * Protocol buffer representing a WhileContext object.
    +   * 
    + * + * Protobuf type {@code tensorflow.WhileContextDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.WhileContextDef) + org.tensorflow.proto.WhileContextDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.WhileContextDef.class, org.tensorflow.proto.WhileContextDef.Builder.class); + } + + // Construct using org.tensorflow.proto.WhileContextDef.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getValuesDefFieldBuilder(); + getNestedContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + contextName_ = ""; + parallelIterations_ = 0; + backProp_ = false; + swapMemory_ = false; + pivotName_ = ""; + pivotForPredName_ = ""; + pivotForBodyName_ = ""; + loopExitNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + loopEnterNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + valuesDef_ = null; + if (valuesDefBuilder_ != null) { + valuesDefBuilder_.dispose(); + valuesDefBuilder_ = null; + } + maximumIterationsName_ = ""; + if (nestedContextsBuilder_ == null) { + nestedContexts_ = java.util.Collections.emptyList(); + } else { + nestedContexts_ = null; + nestedContextsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.ControlFlowProtos.internal_static_tensorflow_WhileContextDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.WhileContextDef getDefaultInstanceForType() { + return org.tensorflow.proto.WhileContextDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.WhileContextDef build() { + org.tensorflow.proto.WhileContextDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.WhileContextDef buildPartial() { + org.tensorflow.proto.WhileContextDef result = new org.tensorflow.proto.WhileContextDef(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.WhileContextDef result) { + if (nestedContextsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + nestedContexts_ = java.util.Collections.unmodifiableList(nestedContexts_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.nestedContexts_ = nestedContexts_; + } else { + result.nestedContexts_ = nestedContextsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.WhileContextDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.contextName_ = contextName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parallelIterations_ = parallelIterations_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backProp_ = backProp_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.swapMemory_ = swapMemory_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pivotName_ = pivotName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pivotForPredName_ = pivotForPredName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pivotForBodyName_ = pivotForBodyName_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + loopExitNames_.makeImmutable(); + result.loopExitNames_ = loopExitNames_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + loopEnterNames_.makeImmutable(); + result.loopEnterNames_ = loopEnterNames_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.valuesDef_ = valuesDefBuilder_ == null + ? valuesDef_ + : valuesDefBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.maximumIterationsName_ = maximumIterationsName_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.WhileContextDef) { + return mergeFrom((org.tensorflow.proto.WhileContextDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.WhileContextDef other) { + if (other == org.tensorflow.proto.WhileContextDef.getDefaultInstance()) return this; + if (!other.getContextName().isEmpty()) { + contextName_ = other.contextName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getParallelIterations() != 0) { + setParallelIterations(other.getParallelIterations()); + } + if (other.getBackProp() != false) { + setBackProp(other.getBackProp()); + } + if (other.getSwapMemory() != false) { + setSwapMemory(other.getSwapMemory()); + } + if (!other.getPivotName().isEmpty()) { + pivotName_ = other.pivotName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getPivotForPredName().isEmpty()) { + pivotForPredName_ = other.pivotForPredName_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getPivotForBodyName().isEmpty()) { + pivotForBodyName_ = other.pivotForBodyName_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.loopExitNames_.isEmpty()) { + if (loopExitNames_.isEmpty()) { + loopExitNames_ = other.loopExitNames_; + bitField0_ |= 0x00000080; + } else { + ensureLoopExitNamesIsMutable(); + loopExitNames_.addAll(other.loopExitNames_); + } + onChanged(); + } + if (!other.loopEnterNames_.isEmpty()) { + if (loopEnterNames_.isEmpty()) { + loopEnterNames_ = other.loopEnterNames_; + bitField0_ |= 0x00000100; + } else { + ensureLoopEnterNamesIsMutable(); + loopEnterNames_.addAll(other.loopEnterNames_); + } + onChanged(); + } + if (other.hasValuesDef()) { + mergeValuesDef(other.getValuesDef()); + } + if (!other.getMaximumIterationsName().isEmpty()) { + maximumIterationsName_ = other.maximumIterationsName_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (nestedContextsBuilder_ == null) { + if (!other.nestedContexts_.isEmpty()) { + if (nestedContexts_.isEmpty()) { + nestedContexts_ = other.nestedContexts_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureNestedContextsIsMutable(); + nestedContexts_.addAll(other.nestedContexts_); + } + onChanged(); + } + } else { + if (!other.nestedContexts_.isEmpty()) { + if (nestedContextsBuilder_.isEmpty()) { + nestedContextsBuilder_.dispose(); + nestedContextsBuilder_ = null; + nestedContexts_ = other.nestedContexts_; + bitField0_ = (bitField0_ & ~0x00000800); + nestedContextsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getNestedContextsFieldBuilder() : null; + } else { + nestedContextsBuilder_.addAllMessages(other.nestedContexts_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + contextName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + parallelIterations_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + backProp_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + swapMemory_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + pivotName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + pivotForPredName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + pivotForBodyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + ensureLoopExitNamesIsMutable(); + loopExitNames_.add(s); + break; + } // case 66 + case 74: { + input.readMessage( + getValuesDefFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + ensureLoopEnterNamesIsMutable(); + loopEnterNames_.add(s); + break; + } // case 82 + case 90: { + maximumIterationsName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: { + org.tensorflow.proto.ControlFlowContextDef m = + input.readMessage( + org.tensorflow.proto.ControlFlowContextDef.parser(), + extensionRegistry); + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(m); + } else { + nestedContextsBuilder_.addMessage(m); + } + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object contextName_ = ""; + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return The contextName. + */ + public java.lang.String getContextName() { + java.lang.Object ref = contextName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return The bytes for contextName. + */ + public com.google.protobuf.ByteString + getContextNameBytes() { + java.lang.Object ref = contextName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @param value The contextName to set. + * @return This builder for chaining. + */ + public Builder setContextName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @return This builder for chaining. + */ + public Builder clearContextName() { + contextName_ = getDefaultInstance().getContextName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +     * Name of the context.
    +     * 
    + * + * string context_name = 1; + * @param value The bytes for contextName to set. + * @return This builder for chaining. + */ + public Builder setContextNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int parallelIterations_ ; + /** + *
    +     * The number of iterations allowed to run in parallel.
    +     * 
    + * + * int32 parallel_iterations = 2; + * @return The parallelIterations. + */ + @java.lang.Override + public int getParallelIterations() { + return parallelIterations_; + } + /** + *
    +     * The number of iterations allowed to run in parallel.
    +     * 
    + * + * int32 parallel_iterations = 2; + * @param value The parallelIterations to set. + * @return This builder for chaining. + */ + public Builder setParallelIterations(int value) { + + parallelIterations_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The number of iterations allowed to run in parallel.
    +     * 
    + * + * int32 parallel_iterations = 2; + * @return This builder for chaining. + */ + public Builder clearParallelIterations() { + bitField0_ = (bitField0_ & ~0x00000002); + parallelIterations_ = 0; + onChanged(); + return this; + } + + private boolean backProp_ ; + /** + *
    +     * Whether backprop is enabled for this while loop.
    +     * 
    + * + * bool back_prop = 3; + * @return The backProp. + */ + @java.lang.Override + public boolean getBackProp() { + return backProp_; + } + /** + *
    +     * Whether backprop is enabled for this while loop.
    +     * 
    + * + * bool back_prop = 3; + * @param value The backProp to set. + * @return This builder for chaining. + */ + public Builder setBackProp(boolean value) { + + backProp_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Whether backprop is enabled for this while loop.
    +     * 
    + * + * bool back_prop = 3; + * @return This builder for chaining. + */ + public Builder clearBackProp() { + bitField0_ = (bitField0_ & ~0x00000004); + backProp_ = false; + onChanged(); + return this; + } + + private boolean swapMemory_ ; + /** + *
    +     * Whether GPU-CPU memory swap is enabled for this loop.
    +     * 
    + * + * bool swap_memory = 4; + * @return The swapMemory. + */ + @java.lang.Override + public boolean getSwapMemory() { + return swapMemory_; + } + /** + *
    +     * Whether GPU-CPU memory swap is enabled for this loop.
    +     * 
    + * + * bool swap_memory = 4; + * @param value The swapMemory to set. + * @return This builder for chaining. + */ + public Builder setSwapMemory(boolean value) { + + swapMemory_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Whether GPU-CPU memory swap is enabled for this loop.
    +     * 
    + * + * bool swap_memory = 4; + * @return This builder for chaining. + */ + public Builder clearSwapMemory() { + bitField0_ = (bitField0_ & ~0x00000008); + swapMemory_ = false; + onChanged(); + return this; + } + + private java.lang.Object pivotName_ = ""; + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 5; + * @return The pivotName. + */ + public java.lang.String getPivotName() { + java.lang.Object ref = pivotName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pivotName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 5; + * @return The bytes for pivotName. + */ + public com.google.protobuf.ByteString + getPivotNameBytes() { + java.lang.Object ref = pivotName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 5; + * @param value The pivotName to set. + * @return This builder for chaining. + */ + public Builder setPivotName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pivotName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 5; + * @return This builder for chaining. + */ + public Builder clearPivotName() { + pivotName_ = getDefaultInstance().getPivotName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot tensor.
    +     * 
    + * + * string pivot_name = 5; + * @param value The bytes for pivotName to set. + * @return This builder for chaining. + */ + public Builder setPivotNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pivotName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object pivotForPredName_ = ""; + /** + *
    +     * Name of the pivot_for_pred tensor.
    +     * 
    + * + * string pivot_for_pred_name = 6; + * @return The pivotForPredName. + */ + public java.lang.String getPivotForPredName() { + java.lang.Object ref = pivotForPredName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pivotForPredName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the pivot_for_pred tensor.
    +     * 
    + * + * string pivot_for_pred_name = 6; + * @return The bytes for pivotForPredName. + */ + public com.google.protobuf.ByteString + getPivotForPredNameBytes() { + java.lang.Object ref = pivotForPredName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotForPredName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the pivot_for_pred tensor.
    +     * 
    + * + * string pivot_for_pred_name = 6; + * @param value The pivotForPredName to set. + * @return This builder for chaining. + */ + public Builder setPivotForPredName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pivotForPredName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot_for_pred tensor.
    +     * 
    + * + * string pivot_for_pred_name = 6; + * @return This builder for chaining. + */ + public Builder clearPivotForPredName() { + pivotForPredName_ = getDefaultInstance().getPivotForPredName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot_for_pred tensor.
    +     * 
    + * + * string pivot_for_pred_name = 6; + * @param value The bytes for pivotForPredName to set. + * @return This builder for chaining. + */ + public Builder setPivotForPredNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pivotForPredName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object pivotForBodyName_ = ""; + /** + *
    +     * Name of the pivot_for_body tensor.
    +     * 
    + * + * string pivot_for_body_name = 7; + * @return The pivotForBodyName. + */ + public java.lang.String getPivotForBodyName() { + java.lang.Object ref = pivotForBodyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pivotForBodyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Name of the pivot_for_body tensor.
    +     * 
    + * + * string pivot_for_body_name = 7; + * @return The bytes for pivotForBodyName. + */ + public com.google.protobuf.ByteString + getPivotForBodyNameBytes() { + java.lang.Object ref = pivotForBodyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pivotForBodyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Name of the pivot_for_body tensor.
    +     * 
    + * + * string pivot_for_body_name = 7; + * @param value The pivotForBodyName to set. + * @return This builder for chaining. + */ + public Builder setPivotForBodyName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + pivotForBodyName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot_for_body tensor.
    +     * 
    + * + * string pivot_for_body_name = 7; + * @return This builder for chaining. + */ + public Builder clearPivotForBodyName() { + pivotForBodyName_ = getDefaultInstance().getPivotForBodyName(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + *
    +     * Name of the pivot_for_body tensor.
    +     * 
    + * + * string pivot_for_body_name = 7; + * @param value The bytes for pivotForBodyName to set. + * @return This builder for chaining. + */ + public Builder setPivotForBodyNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + pivotForBodyName_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList loopExitNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureLoopExitNamesIsMutable() { + if (!loopExitNames_.isModifiable()) { + loopExitNames_ = new com.google.protobuf.LazyStringArrayList(loopExitNames_); + } + bitField0_ |= 0x00000080; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @return A list containing the loopExitNames. + */ + public com.google.protobuf.ProtocolStringList + getLoopExitNamesList() { + loopExitNames_.makeImmutable(); + return loopExitNames_; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @return The count of loopExitNames. + */ + public int getLoopExitNamesCount() { + return loopExitNames_.size(); + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param index The index of the element to return. + * @return The loopExitNames at the given index. + */ + public java.lang.String getLoopExitNames(int index) { + return loopExitNames_.get(index); + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param index The index of the value to return. + * @return The bytes of the loopExitNames at the given index. + */ + public com.google.protobuf.ByteString + getLoopExitNamesBytes(int index) { + return loopExitNames_.getByteString(index); + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param index The index to set the value at. + * @param value The loopExitNames to set. + * @return This builder for chaining. + */ + public Builder setLoopExitNames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLoopExitNamesIsMutable(); + loopExitNames_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param value The loopExitNames to add. + * @return This builder for chaining. + */ + public Builder addLoopExitNames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLoopExitNamesIsMutable(); + loopExitNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param values The loopExitNames to add. + * @return This builder for chaining. + */ + public Builder addAllLoopExitNames( + java.lang.Iterable values) { + ensureLoopExitNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, loopExitNames_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @return This builder for chaining. + */ + public Builder clearLoopExitNames() { + loopExitNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080);; + onChanged(); + return this; + } + /** + *
    +     * List of names for exit tensors.
    +     * 
    + * + * repeated string loop_exit_names = 8; + * @param value The bytes of the loopExitNames to add. + * @return This builder for chaining. + */ + public Builder addLoopExitNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureLoopExitNamesIsMutable(); + loopExitNames_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList loopEnterNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureLoopEnterNamesIsMutable() { + if (!loopEnterNames_.isModifiable()) { + loopEnterNames_ = new com.google.protobuf.LazyStringArrayList(loopEnterNames_); + } + bitField0_ |= 0x00000100; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @return A list containing the loopEnterNames. + */ + public com.google.protobuf.ProtocolStringList + getLoopEnterNamesList() { + loopEnterNames_.makeImmutable(); + return loopEnterNames_; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @return The count of loopEnterNames. + */ + public int getLoopEnterNamesCount() { + return loopEnterNames_.size(); + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param index The index of the element to return. + * @return The loopEnterNames at the given index. + */ + public java.lang.String getLoopEnterNames(int index) { + return loopEnterNames_.get(index); + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param index The index of the value to return. + * @return The bytes of the loopEnterNames at the given index. + */ + public com.google.protobuf.ByteString + getLoopEnterNamesBytes(int index) { + return loopEnterNames_.getByteString(index); + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param index The index to set the value at. + * @param value The loopEnterNames to set. + * @return This builder for chaining. + */ + public Builder setLoopEnterNames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLoopEnterNamesIsMutable(); + loopEnterNames_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param value The loopEnterNames to add. + * @return This builder for chaining. + */ + public Builder addLoopEnterNames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureLoopEnterNamesIsMutable(); + loopEnterNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param values The loopEnterNames to add. + * @return This builder for chaining. + */ + public Builder addAllLoopEnterNames( + java.lang.Iterable values) { + ensureLoopEnterNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, loopEnterNames_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @return This builder for chaining. + */ + public Builder clearLoopEnterNames() { + loopEnterNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100);; + onChanged(); + return this; + } + /** + *
    +     * List of names for enter tensors.
    +     * 
    + * + * repeated string loop_enter_names = 10; + * @param value The bytes of the loopEnterNames to add. + * @return This builder for chaining. + */ + public Builder addLoopEnterNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureLoopEnterNamesIsMutable(); + loopEnterNames_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private org.tensorflow.proto.ValuesDef valuesDef_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder> valuesDefBuilder_; + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + * @return Whether the valuesDef field is set. + */ + public boolean hasValuesDef() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + * @return The valuesDef. + */ + public org.tensorflow.proto.ValuesDef getValuesDef() { + if (valuesDefBuilder_ == null) { + return valuesDef_ == null ? org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } else { + return valuesDefBuilder_.getMessage(); + } + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public Builder setValuesDef(org.tensorflow.proto.ValuesDef value) { + if (valuesDefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valuesDef_ = value; + } else { + valuesDefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public Builder setValuesDef( + org.tensorflow.proto.ValuesDef.Builder builderForValue) { + if (valuesDefBuilder_ == null) { + valuesDef_ = builderForValue.build(); + } else { + valuesDefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public Builder mergeValuesDef(org.tensorflow.proto.ValuesDef value) { + if (valuesDefBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + valuesDef_ != null && + valuesDef_ != org.tensorflow.proto.ValuesDef.getDefaultInstance()) { + getValuesDefBuilder().mergeFrom(value); + } else { + valuesDef_ = value; + } + } else { + valuesDefBuilder_.mergeFrom(value); + } + if (valuesDef_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public Builder clearValuesDef() { + bitField0_ = (bitField0_ & ~0x00000200); + valuesDef_ = null; + if (valuesDefBuilder_ != null) { + valuesDefBuilder_.dispose(); + valuesDefBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public org.tensorflow.proto.ValuesDef.Builder getValuesDefBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getValuesDefFieldBuilder().getBuilder(); + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + public org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder() { + if (valuesDefBuilder_ != null) { + return valuesDefBuilder_.getMessageOrBuilder(); + } else { + return valuesDef_ == null ? + org.tensorflow.proto.ValuesDef.getDefaultInstance() : valuesDef_; + } + } + /** + *
    +     * Values and external values in control flow context.
    +     * 
    + * + * .tensorflow.ValuesDef values_def = 9; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder> + getValuesDefFieldBuilder() { + if (valuesDefBuilder_ == null) { + valuesDefBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.ValuesDef, org.tensorflow.proto.ValuesDef.Builder, org.tensorflow.proto.ValuesDefOrBuilder>( + getValuesDef(), + getParentForChildren(), + isClean()); + valuesDef_ = null; + } + return valuesDefBuilder_; + } + + private java.lang.Object maximumIterationsName_ = ""; + /** + *
    +     * Optional name of the maximum_iterations tensor.
    +     * 
    + * + * string maximum_iterations_name = 11; + * @return The maximumIterationsName. + */ + public java.lang.String getMaximumIterationsName() { + java.lang.Object ref = maximumIterationsName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maximumIterationsName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Optional name of the maximum_iterations tensor.
    +     * 
    + * + * string maximum_iterations_name = 11; + * @return The bytes for maximumIterationsName. + */ + public com.google.protobuf.ByteString + getMaximumIterationsNameBytes() { + java.lang.Object ref = maximumIterationsName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maximumIterationsName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Optional name of the maximum_iterations tensor.
    +     * 
    + * + * string maximum_iterations_name = 11; + * @param value The maximumIterationsName to set. + * @return This builder for chaining. + */ + public Builder setMaximumIterationsName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + maximumIterationsName_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +     * Optional name of the maximum_iterations tensor.
    +     * 
    + * + * string maximum_iterations_name = 11; + * @return This builder for chaining. + */ + public Builder clearMaximumIterationsName() { + maximumIterationsName_ = getDefaultInstance().getMaximumIterationsName(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + *
    +     * Optional name of the maximum_iterations tensor.
    +     * 
    + * + * string maximum_iterations_name = 11; + * @param value The bytes for maximumIterationsName to set. + * @return This builder for chaining. + */ + public Builder setMaximumIterationsNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + maximumIterationsName_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.util.List nestedContexts_ = + java.util.Collections.emptyList(); + private void ensureNestedContextsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + nestedContexts_ = new java.util.ArrayList(nestedContexts_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder> nestedContextsBuilder_; + + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public java.util.List getNestedContextsList() { + if (nestedContextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nestedContexts_); + } else { + return nestedContextsBuilder_.getMessageList(); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public int getNestedContextsCount() { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.size(); + } else { + return nestedContextsBuilder_.getCount(); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index) { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.get(index); + } else { + return nestedContextsBuilder_.getMessage(index); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder setNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.set(index, value); + onChanged(); + } else { + nestedContextsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder setNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.set(index, builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder addNestedContexts(org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.add(value); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder addNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef value) { + if (nestedContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNestedContextsIsMutable(); + nestedContexts_.add(index, value); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder addNestedContexts( + org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder addNestedContexts( + int index, org.tensorflow.proto.ControlFlowContextDef.Builder builderForValue) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.add(index, builderForValue.build()); + onChanged(); + } else { + nestedContextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder addAllNestedContexts( + java.lang.Iterable values) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nestedContexts_); + onChanged(); + } else { + nestedContextsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder clearNestedContexts() { + if (nestedContextsBuilder_ == null) { + nestedContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + nestedContextsBuilder_.clear(); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public Builder removeNestedContexts(int index) { + if (nestedContextsBuilder_ == null) { + ensureNestedContextsIsMutable(); + nestedContexts_.remove(index); + onChanged(); + } else { + nestedContextsBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder getNestedContextsBuilder( + int index) { + return getNestedContextsFieldBuilder().getBuilder(index); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder( + int index) { + if (nestedContextsBuilder_ == null) { + return nestedContexts_.get(index); } else { + return nestedContextsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public java.util.List + getNestedContextsOrBuilderList() { + if (nestedContextsBuilder_ != null) { + return nestedContextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nestedContexts_); + } + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder addNestedContextsBuilder() { + return getNestedContextsFieldBuilder().addBuilder( + org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance()); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public org.tensorflow.proto.ControlFlowContextDef.Builder addNestedContextsBuilder( + int index) { + return getNestedContextsFieldBuilder().addBuilder( + index, org.tensorflow.proto.ControlFlowContextDef.getDefaultInstance()); + } + /** + *
    +     * Contexts contained inside this context (e.g. nested whiles).
    +     * 
    + * + * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; + */ + public java.util.List + getNestedContextsBuilderList() { + return getNestedContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder> + getNestedContextsFieldBuilder() { + if (nestedContextsBuilder_ == null) { + nestedContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.ControlFlowContextDef, org.tensorflow.proto.ControlFlowContextDef.Builder, org.tensorflow.proto.ControlFlowContextDefOrBuilder>( + nestedContexts_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + nestedContexts_ = null; + } + return nestedContextsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.WhileContextDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.WhileContextDef) + private static final org.tensorflow.proto.WhileContextDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.WhileContextDef(); + } + + public static org.tensorflow.proto.WhileContextDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WhileContextDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.WhileContextDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDefOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDefOrBuilder.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDefOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDefOrBuilder.java index 6fd3e2639e1..1a2e27ced0e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/WhileContextDefOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WhileContextDefOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/control_flow.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto; public interface WhileContextDefOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.WhileContextDef) @@ -13,6 +15,7 @@ public interface WhileContextDefOrBuilder extends * * * string context_name = 1; + * @return The contextName. */ java.lang.String getContextName(); /** @@ -21,6 +24,7 @@ public interface WhileContextDefOrBuilder extends * * * string context_name = 1; + * @return The bytes for contextName. */ com.google.protobuf.ByteString getContextNameBytes(); @@ -31,6 +35,7 @@ public interface WhileContextDefOrBuilder extends * * * int32 parallel_iterations = 2; + * @return The parallelIterations. */ int getParallelIterations(); @@ -40,6 +45,7 @@ public interface WhileContextDefOrBuilder extends * * * bool back_prop = 3; + * @return The backProp. */ boolean getBackProp(); @@ -49,6 +55,7 @@ public interface WhileContextDefOrBuilder extends * * * bool swap_memory = 4; + * @return The swapMemory. */ boolean getSwapMemory(); @@ -58,6 +65,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_name = 5; + * @return The pivotName. */ java.lang.String getPivotName(); /** @@ -66,6 +74,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_name = 5; + * @return The bytes for pivotName. */ com.google.protobuf.ByteString getPivotNameBytes(); @@ -76,6 +85,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_for_pred_name = 6; + * @return The pivotForPredName. */ java.lang.String getPivotForPredName(); /** @@ -84,6 +94,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_for_pred_name = 6; + * @return The bytes for pivotForPredName. */ com.google.protobuf.ByteString getPivotForPredNameBytes(); @@ -94,6 +105,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_for_body_name = 7; + * @return The pivotForBodyName. */ java.lang.String getPivotForBodyName(); /** @@ -102,6 +114,7 @@ public interface WhileContextDefOrBuilder extends * * * string pivot_for_body_name = 7; + * @return The bytes for pivotForBodyName. */ com.google.protobuf.ByteString getPivotForBodyNameBytes(); @@ -112,6 +125,7 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_exit_names = 8; + * @return A list containing the loopExitNames. */ java.util.List getLoopExitNamesList(); @@ -121,6 +135,7 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_exit_names = 8; + * @return The count of loopExitNames. */ int getLoopExitNamesCount(); /** @@ -129,6 +144,8 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_exit_names = 8; + * @param index The index of the element to return. + * @return The loopExitNames at the given index. */ java.lang.String getLoopExitNames(int index); /** @@ -137,6 +154,8 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_exit_names = 8; + * @param index The index of the value to return. + * @return The bytes of the loopExitNames at the given index. */ com.google.protobuf.ByteString getLoopExitNamesBytes(int index); @@ -147,6 +166,7 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_enter_names = 10; + * @return A list containing the loopEnterNames. */ java.util.List getLoopEnterNamesList(); @@ -156,6 +176,7 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_enter_names = 10; + * @return The count of loopEnterNames. */ int getLoopEnterNamesCount(); /** @@ -164,6 +185,8 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_enter_names = 10; + * @param index The index of the element to return. + * @return The loopEnterNames at the given index. */ java.lang.String getLoopEnterNames(int index); /** @@ -172,6 +195,8 @@ public interface WhileContextDefOrBuilder extends * * * repeated string loop_enter_names = 10; + * @param index The index of the value to return. + * @return The bytes of the loopEnterNames at the given index. */ com.google.protobuf.ByteString getLoopEnterNamesBytes(int index); @@ -182,6 +207,7 @@ public interface WhileContextDefOrBuilder extends * * * .tensorflow.ValuesDef values_def = 9; + * @return Whether the valuesDef field is set. */ boolean hasValuesDef(); /** @@ -190,8 +216,9 @@ public interface WhileContextDefOrBuilder extends * * * .tensorflow.ValuesDef values_def = 9; + * @return The valuesDef. */ - org.tensorflow.proto.framework.ValuesDef getValuesDef(); + org.tensorflow.proto.ValuesDef getValuesDef(); /** *
        * Values and external values in control flow context.
    @@ -199,7 +226,7 @@ public interface WhileContextDefOrBuilder extends
        *
        * .tensorflow.ValuesDef values_def = 9;
        */
    -  org.tensorflow.proto.framework.ValuesDefOrBuilder getValuesDefOrBuilder();
    +  org.tensorflow.proto.ValuesDefOrBuilder getValuesDefOrBuilder();
     
       /**
        * 
    @@ -207,6 +234,7 @@ public interface WhileContextDefOrBuilder extends
        * 
    * * string maximum_iterations_name = 11; + * @return The maximumIterationsName. */ java.lang.String getMaximumIterationsName(); /** @@ -215,6 +243,7 @@ public interface WhileContextDefOrBuilder extends *
    * * string maximum_iterations_name = 11; + * @return The bytes for maximumIterationsName. */ com.google.protobuf.ByteString getMaximumIterationsNameBytes(); @@ -226,7 +255,7 @@ public interface WhileContextDefOrBuilder extends * * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12; */ - java.util.List + java.util.List getNestedContextsList(); /** *
    @@ -235,7 +264,7 @@ public interface WhileContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12;
        */
    -  org.tensorflow.proto.framework.ControlFlowContextDef getNestedContexts(int index);
    +  org.tensorflow.proto.ControlFlowContextDef getNestedContexts(int index);
       /**
        * 
        * Contexts contained inside this context (e.g. nested whiles).
    @@ -251,7 +280,7 @@ public interface WhileContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12;
        */
    -  java.util.List 
    +  java.util.List 
           getNestedContextsOrBuilderList();
       /**
        * 
    @@ -260,6 +289,6 @@ public interface WhileContextDefOrBuilder extends
        *
        * repeated .tensorflow.ControlFlowContextDef nested_contexts = 12;
        */
    -  org.tensorflow.proto.framework.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder(
    +  org.tensorflow.proto.ControlFlowContextDefOrBuilder getNestedContextsOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHealth.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHealth.java
    similarity index 78%
    rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHealth.java
    rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHealth.java
    index 268ecd3a6a0..842c0e8ac3a 100644
    --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerHealth.java
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHealth.java
    @@ -1,7 +1,9 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
     // source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
     
    -package org.tensorflow.proto.util;
    +package org.tensorflow.proto;
     
     /**
      * 
    @@ -39,6 +41,15 @@ public enum WorkerHealth
       UNRECOGNIZED(-1),
       ;
     
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      WorkerHealth.class.getName());
    +  }
       /**
        * 
        * By default a worker is healthy.
    @@ -74,6 +85,8 @@ public final int getNumber() {
       }
     
       /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
        * @deprecated Use {@link #forNumber(int)} instead.
        */
       @java.lang.Deprecated
    @@ -81,6 +94,10 @@ public static WorkerHealth valueOf(int value) {
         return forNumber(value);
       }
     
    +  /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
    +   */
       public static WorkerHealth forNumber(int value) {
         switch (value) {
           case 0: return OK;
    @@ -105,6 +122,10 @@ public WorkerHealth findValueByNumber(int number) {
     
       public final com.google.protobuf.Descriptors.EnumValueDescriptor
           getValueDescriptor() {
    +    if (this == UNRECOGNIZED) {
    +      throw new java.lang.IllegalStateException(
    +          "Can't get the descriptor of an unrecognized enum value.");
    +    }
         return getDescriptor().getValues().get(ordinal());
       }
       public final com.google.protobuf.Descriptors.EnumDescriptor
    @@ -113,7 +134,7 @@ public WorkerHealth findValueByNumber(int number) {
       }
       public static final com.google.protobuf.Descriptors.EnumDescriptor
           getDescriptor() {
    -    return org.tensorflow.proto.util.EventProtos.getDescriptor().getEnumTypes().get(0);
    +    return org.tensorflow.proto.EventProtos.getDescriptor().getEnumTypes().get(0);
       }
     
       private static final WorkerHealth[] VALUES = values();
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequest.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequest.java
    new file mode 100644
    index 00000000000..6459105c36b
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequest.java
    @@ -0,0 +1,837 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.WorkerHeartbeatRequest}
    + */
    +public final class WorkerHeartbeatRequest extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.WorkerHeartbeatRequest)
    +    WorkerHeartbeatRequestOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      WorkerHeartbeatRequest.class.getName());
    +  }
    +  // Use WorkerHeartbeatRequest.newBuilder() to construct.
    +  private WorkerHeartbeatRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private WorkerHeartbeatRequest() {
    +    shutdownMode_ = 0;
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.WorkerHeartbeatRequest.class, org.tensorflow.proto.WorkerHeartbeatRequest.Builder.class);
    +  }
    +
    +  private int bitField0_;
    +  public static final int SHUTDOWN_MODE_FIELD_NUMBER = 1;
    +  private int shutdownMode_ = 0;
    +  /**
    +   * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +   * @return The enum numeric value on the wire for shutdownMode.
    +   */
    +  @java.lang.Override public int getShutdownModeValue() {
    +    return shutdownMode_;
    +  }
    +  /**
    +   * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +   * @return The shutdownMode.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.WorkerShutdownMode getShutdownMode() {
    +    org.tensorflow.proto.WorkerShutdownMode result = org.tensorflow.proto.WorkerShutdownMode.forNumber(shutdownMode_);
    +    return result == null ? org.tensorflow.proto.WorkerShutdownMode.UNRECOGNIZED : result;
    +  }
    +
    +  public static final int WATCHDOG_CONFIG_FIELD_NUMBER = 2;
    +  private org.tensorflow.proto.WatchdogConfig watchdogConfig_;
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   * @return Whether the watchdogConfig field is set.
    +   */
    +  @java.lang.Override
    +  public boolean hasWatchdogConfig() {
    +    return ((bitField0_ & 0x00000001) != 0);
    +  }
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   * @return The watchdogConfig.
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.WatchdogConfig getWatchdogConfig() {
    +    return watchdogConfig_ == null ? org.tensorflow.proto.WatchdogConfig.getDefaultInstance() : watchdogConfig_;
    +  }
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder() {
    +    return watchdogConfig_ == null ? org.tensorflow.proto.WatchdogConfig.getDefaultInstance() : watchdogConfig_;
    +  }
    +
    +  public static final int EXIT_CODE_FIELD_NUMBER = 3;
    +  private org.tensorflow.proto.RequestedExitCode exitCode_;
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   * @return Whether the exitCode field is set.
    +   */
    +  @java.lang.Override
    +  public boolean hasExitCode() {
    +    return ((bitField0_ & 0x00000002) != 0);
    +  }
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   * @return The exitCode.
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.RequestedExitCode getExitCode() {
    +    return exitCode_ == null ? org.tensorflow.proto.RequestedExitCode.getDefaultInstance() : exitCode_;
    +  }
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.RequestedExitCodeOrBuilder getExitCodeOrBuilder() {
    +    return exitCode_ == null ? org.tensorflow.proto.RequestedExitCode.getDefaultInstance() : exitCode_;
    +  }
    +
    +  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 (shutdownMode_ != org.tensorflow.proto.WorkerShutdownMode.DEFAULT.getNumber()) {
    +      output.writeEnum(1, shutdownMode_);
    +    }
    +    if (((bitField0_ & 0x00000001) != 0)) {
    +      output.writeMessage(2, getWatchdogConfig());
    +    }
    +    if (((bitField0_ & 0x00000002) != 0)) {
    +      output.writeMessage(3, getExitCode());
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (shutdownMode_ != org.tensorflow.proto.WorkerShutdownMode.DEFAULT.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(1, shutdownMode_);
    +    }
    +    if (((bitField0_ & 0x00000001) != 0)) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeMessageSize(2, getWatchdogConfig());
    +    }
    +    if (((bitField0_ & 0x00000002) != 0)) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeMessageSize(3, getExitCode());
    +    }
    +    size += getUnknownFields().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.WorkerHeartbeatRequest)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.WorkerHeartbeatRequest other = (org.tensorflow.proto.WorkerHeartbeatRequest) obj;
    +
    +    if (shutdownMode_ != other.shutdownMode_) return false;
    +    if (hasWatchdogConfig() != other.hasWatchdogConfig()) return false;
    +    if (hasWatchdogConfig()) {
    +      if (!getWatchdogConfig()
    +          .equals(other.getWatchdogConfig())) return false;
    +    }
    +    if (hasExitCode() != other.hasExitCode()) return false;
    +    if (hasExitCode()) {
    +      if (!getExitCode()
    +          .equals(other.getExitCode())) return false;
    +    }
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SHUTDOWN_MODE_FIELD_NUMBER;
    +    hash = (53 * hash) + shutdownMode_;
    +    if (hasWatchdogConfig()) {
    +      hash = (37 * hash) + WATCHDOG_CONFIG_FIELD_NUMBER;
    +      hash = (53 * hash) + getWatchdogConfig().hashCode();
    +    }
    +    if (hasExitCode()) {
    +      hash = (37 * hash) + EXIT_CODE_FIELD_NUMBER;
    +      hash = (53 * hash) + getExitCode().hashCode();
    +    }
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest 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.WorkerHeartbeatRequest parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.WorkerHeartbeatRequest 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.WorkerHeartbeatRequest}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.WorkerHeartbeatRequest)
    +      org.tensorflow.proto.WorkerHeartbeatRequestOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.WorkerHeartbeatRequest.class, org.tensorflow.proto.WorkerHeartbeatRequest.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.WorkerHeartbeatRequest.newBuilder()
    +    private Builder() {
    +      maybeForceBuilderInitialization();
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +      maybeForceBuilderInitialization();
    +    }
    +    private void maybeForceBuilderInitialization() {
    +      if (com.google.protobuf.GeneratedMessage
    +              .alwaysUseFieldBuilders) {
    +        getWatchdogConfigFieldBuilder();
    +        getExitCodeFieldBuilder();
    +      }
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      shutdownMode_ = 0;
    +      watchdogConfig_ = null;
    +      if (watchdogConfigBuilder_ != null) {
    +        watchdogConfigBuilder_.dispose();
    +        watchdogConfigBuilder_ = null;
    +      }
    +      exitCode_ = null;
    +      if (exitCodeBuilder_ != null) {
    +        exitCodeBuilder_.dispose();
    +        exitCodeBuilder_ = null;
    +      }
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatRequest_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatRequest getDefaultInstanceForType() {
    +      return org.tensorflow.proto.WorkerHeartbeatRequest.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatRequest build() {
    +      org.tensorflow.proto.WorkerHeartbeatRequest result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatRequest buildPartial() {
    +      org.tensorflow.proto.WorkerHeartbeatRequest result = new org.tensorflow.proto.WorkerHeartbeatRequest(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.WorkerHeartbeatRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.shutdownMode_ = shutdownMode_;
    +      }
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.watchdogConfig_ = watchdogConfigBuilder_ == null
    +            ? watchdogConfig_
    +            : watchdogConfigBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.exitCode_ = exitCodeBuilder_ == null
    +            ? exitCode_
    +            : exitCodeBuilder_.build();
    +        to_bitField0_ |= 0x00000002;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.WorkerHeartbeatRequest) {
    +        return mergeFrom((org.tensorflow.proto.WorkerHeartbeatRequest)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.WorkerHeartbeatRequest other) {
    +      if (other == org.tensorflow.proto.WorkerHeartbeatRequest.getDefaultInstance()) return this;
    +      if (other.shutdownMode_ != 0) {
    +        setShutdownModeValue(other.getShutdownModeValue());
    +      }
    +      if (other.hasWatchdogConfig()) {
    +        mergeWatchdogConfig(other.getWatchdogConfig());
    +      }
    +      if (other.hasExitCode()) {
    +        mergeExitCode(other.getExitCode());
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 8: {
    +              shutdownMode_ = input.readEnum();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 8
    +            case 18: {
    +              input.readMessage(
    +                  getWatchdogConfigFieldBuilder().getBuilder(),
    +                  extensionRegistry);
    +              bitField0_ |= 0x00000002;
    +              break;
    +            } // case 18
    +            case 26: {
    +              input.readMessage(
    +                  getExitCodeFieldBuilder().getBuilder(),
    +                  extensionRegistry);
    +              bitField0_ |= 0x00000004;
    +              break;
    +            } // case 26
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private int shutdownMode_ = 0;
    +    /**
    +     * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +     * @return The enum numeric value on the wire for shutdownMode.
    +     */
    +    @java.lang.Override public int getShutdownModeValue() {
    +      return shutdownMode_;
    +    }
    +    /**
    +     * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +     * @param value The enum numeric value on the wire for shutdownMode to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShutdownModeValue(int value) {
    +      shutdownMode_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +     * @return The shutdownMode.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerShutdownMode getShutdownMode() {
    +      org.tensorflow.proto.WorkerShutdownMode result = org.tensorflow.proto.WorkerShutdownMode.forNumber(shutdownMode_);
    +      return result == null ? org.tensorflow.proto.WorkerShutdownMode.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +     * @param value The shutdownMode to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setShutdownMode(org.tensorflow.proto.WorkerShutdownMode value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000001;
    +      shutdownMode_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearShutdownMode() {
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      shutdownMode_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private org.tensorflow.proto.WatchdogConfig watchdogConfig_;
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.WatchdogConfig, org.tensorflow.proto.WatchdogConfig.Builder, org.tensorflow.proto.WatchdogConfigOrBuilder> watchdogConfigBuilder_;
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     * @return Whether the watchdogConfig field is set.
    +     */
    +    public boolean hasWatchdogConfig() {
    +      return ((bitField0_ & 0x00000002) != 0);
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     * @return The watchdogConfig.
    +     */
    +    public org.tensorflow.proto.WatchdogConfig getWatchdogConfig() {
    +      if (watchdogConfigBuilder_ == null) {
    +        return watchdogConfig_ == null ? org.tensorflow.proto.WatchdogConfig.getDefaultInstance() : watchdogConfig_;
    +      } else {
    +        return watchdogConfigBuilder_.getMessage();
    +      }
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public Builder setWatchdogConfig(org.tensorflow.proto.WatchdogConfig value) {
    +      if (watchdogConfigBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        watchdogConfig_ = value;
    +      } else {
    +        watchdogConfigBuilder_.setMessage(value);
    +      }
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public Builder setWatchdogConfig(
    +        org.tensorflow.proto.WatchdogConfig.Builder builderForValue) {
    +      if (watchdogConfigBuilder_ == null) {
    +        watchdogConfig_ = builderForValue.build();
    +      } else {
    +        watchdogConfigBuilder_.setMessage(builderForValue.build());
    +      }
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public Builder mergeWatchdogConfig(org.tensorflow.proto.WatchdogConfig value) {
    +      if (watchdogConfigBuilder_ == null) {
    +        if (((bitField0_ & 0x00000002) != 0) &&
    +          watchdogConfig_ != null &&
    +          watchdogConfig_ != org.tensorflow.proto.WatchdogConfig.getDefaultInstance()) {
    +          getWatchdogConfigBuilder().mergeFrom(value);
    +        } else {
    +          watchdogConfig_ = value;
    +        }
    +      } else {
    +        watchdogConfigBuilder_.mergeFrom(value);
    +      }
    +      if (watchdogConfig_ != null) {
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public Builder clearWatchdogConfig() {
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      watchdogConfig_ = null;
    +      if (watchdogConfigBuilder_ != null) {
    +        watchdogConfigBuilder_.dispose();
    +        watchdogConfigBuilder_ = null;
    +      }
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public org.tensorflow.proto.WatchdogConfig.Builder getWatchdogConfigBuilder() {
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return getWatchdogConfigFieldBuilder().getBuilder();
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    public org.tensorflow.proto.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder() {
    +      if (watchdogConfigBuilder_ != null) {
    +        return watchdogConfigBuilder_.getMessageOrBuilder();
    +      } else {
    +        return watchdogConfig_ == null ?
    +            org.tensorflow.proto.WatchdogConfig.getDefaultInstance() : watchdogConfig_;
    +      }
    +    }
    +    /**
    +     * .tensorflow.WatchdogConfig watchdog_config = 2;
    +     */
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.WatchdogConfig, org.tensorflow.proto.WatchdogConfig.Builder, org.tensorflow.proto.WatchdogConfigOrBuilder> 
    +        getWatchdogConfigFieldBuilder() {
    +      if (watchdogConfigBuilder_ == null) {
    +        watchdogConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.WatchdogConfig, org.tensorflow.proto.WatchdogConfig.Builder, org.tensorflow.proto.WatchdogConfigOrBuilder>(
    +                getWatchdogConfig(),
    +                getParentForChildren(),
    +                isClean());
    +        watchdogConfig_ = null;
    +      }
    +      return watchdogConfigBuilder_;
    +    }
    +
    +    private org.tensorflow.proto.RequestedExitCode exitCode_;
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.RequestedExitCode, org.tensorflow.proto.RequestedExitCode.Builder, org.tensorflow.proto.RequestedExitCodeOrBuilder> exitCodeBuilder_;
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     * @return Whether the exitCode field is set.
    +     */
    +    public boolean hasExitCode() {
    +      return ((bitField0_ & 0x00000004) != 0);
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     * @return The exitCode.
    +     */
    +    public org.tensorflow.proto.RequestedExitCode getExitCode() {
    +      if (exitCodeBuilder_ == null) {
    +        return exitCode_ == null ? org.tensorflow.proto.RequestedExitCode.getDefaultInstance() : exitCode_;
    +      } else {
    +        return exitCodeBuilder_.getMessage();
    +      }
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public Builder setExitCode(org.tensorflow.proto.RequestedExitCode value) {
    +      if (exitCodeBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        exitCode_ = value;
    +      } else {
    +        exitCodeBuilder_.setMessage(value);
    +      }
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public Builder setExitCode(
    +        org.tensorflow.proto.RequestedExitCode.Builder builderForValue) {
    +      if (exitCodeBuilder_ == null) {
    +        exitCode_ = builderForValue.build();
    +      } else {
    +        exitCodeBuilder_.setMessage(builderForValue.build());
    +      }
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public Builder mergeExitCode(org.tensorflow.proto.RequestedExitCode value) {
    +      if (exitCodeBuilder_ == null) {
    +        if (((bitField0_ & 0x00000004) != 0) &&
    +          exitCode_ != null &&
    +          exitCode_ != org.tensorflow.proto.RequestedExitCode.getDefaultInstance()) {
    +          getExitCodeBuilder().mergeFrom(value);
    +        } else {
    +          exitCode_ = value;
    +        }
    +      } else {
    +        exitCodeBuilder_.mergeFrom(value);
    +      }
    +      if (exitCode_ != null) {
    +        bitField0_ |= 0x00000004;
    +        onChanged();
    +      }
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public Builder clearExitCode() {
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      exitCode_ = null;
    +      if (exitCodeBuilder_ != null) {
    +        exitCodeBuilder_.dispose();
    +        exitCodeBuilder_ = null;
    +      }
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public org.tensorflow.proto.RequestedExitCode.Builder getExitCodeBuilder() {
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return getExitCodeFieldBuilder().getBuilder();
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    public org.tensorflow.proto.RequestedExitCodeOrBuilder getExitCodeOrBuilder() {
    +      if (exitCodeBuilder_ != null) {
    +        return exitCodeBuilder_.getMessageOrBuilder();
    +      } else {
    +        return exitCode_ == null ?
    +            org.tensorflow.proto.RequestedExitCode.getDefaultInstance() : exitCode_;
    +      }
    +    }
    +    /**
    +     * .tensorflow.RequestedExitCode exit_code = 3;
    +     */
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.RequestedExitCode, org.tensorflow.proto.RequestedExitCode.Builder, org.tensorflow.proto.RequestedExitCodeOrBuilder> 
    +        getExitCodeFieldBuilder() {
    +      if (exitCodeBuilder_ == null) {
    +        exitCodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.RequestedExitCode, org.tensorflow.proto.RequestedExitCode.Builder, org.tensorflow.proto.RequestedExitCodeOrBuilder>(
    +                getExitCode(),
    +                getParentForChildren(),
    +                isClean());
    +        exitCode_ = null;
    +      }
    +      return exitCodeBuilder_;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.WorkerHeartbeatRequest)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.WorkerHeartbeatRequest)
    +  private static final org.tensorflow.proto.WorkerHeartbeatRequest DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.WorkerHeartbeatRequest();
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatRequest getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public WorkerHeartbeatRequest parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.WorkerHeartbeatRequest getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequestOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequestOrBuilder.java
    new file mode 100644
    index 00000000000..c6acadaba4d
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatRequestOrBuilder.java
    @@ -0,0 +1,52 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface WorkerHeartbeatRequestOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.WorkerHeartbeatRequest)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +   * @return The enum numeric value on the wire for shutdownMode.
    +   */
    +  int getShutdownModeValue();
    +  /**
    +   * .tensorflow.WorkerShutdownMode shutdown_mode = 1;
    +   * @return The shutdownMode.
    +   */
    +  org.tensorflow.proto.WorkerShutdownMode getShutdownMode();
    +
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   * @return Whether the watchdogConfig field is set.
    +   */
    +  boolean hasWatchdogConfig();
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   * @return The watchdogConfig.
    +   */
    +  org.tensorflow.proto.WatchdogConfig getWatchdogConfig();
    +  /**
    +   * .tensorflow.WatchdogConfig watchdog_config = 2;
    +   */
    +  org.tensorflow.proto.WatchdogConfigOrBuilder getWatchdogConfigOrBuilder();
    +
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   * @return Whether the exitCode field is set.
    +   */
    +  boolean hasExitCode();
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   * @return The exitCode.
    +   */
    +  org.tensorflow.proto.RequestedExitCode getExitCode();
    +  /**
    +   * .tensorflow.RequestedExitCode exit_code = 3;
    +   */
    +  org.tensorflow.proto.RequestedExitCodeOrBuilder getExitCodeOrBuilder();
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponse.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponse.java
    new file mode 100644
    index 00000000000..fcaeeb0419c
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponse.java
    @@ -0,0 +1,949 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +/**
    + * Protobuf type {@code tensorflow.WorkerHeartbeatResponse}
    + */
    +public final class WorkerHeartbeatResponse extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.WorkerHeartbeatResponse)
    +    WorkerHeartbeatResponseOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      WorkerHeartbeatResponse.class.getName());
    +  }
    +  // Use WorkerHeartbeatResponse.newBuilder() to construct.
    +  private WorkerHeartbeatResponse(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private WorkerHeartbeatResponse() {
    +    healthStatus_ = 0;
    +    workerLog_ = java.util.Collections.emptyList();
    +    hostname_ = "";
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.WorkerHeartbeatResponse.class, org.tensorflow.proto.WorkerHeartbeatResponse.Builder.class);
    +  }
    +
    +  public static final int HEALTH_STATUS_FIELD_NUMBER = 1;
    +  private int healthStatus_ = 0;
    +  /**
    +   * .tensorflow.WorkerHealth health_status = 1;
    +   * @return The enum numeric value on the wire for healthStatus.
    +   */
    +  @java.lang.Override public int getHealthStatusValue() {
    +    return healthStatus_;
    +  }
    +  /**
    +   * .tensorflow.WorkerHealth health_status = 1;
    +   * @return The healthStatus.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.WorkerHealth getHealthStatus() {
    +    org.tensorflow.proto.WorkerHealth result = org.tensorflow.proto.WorkerHealth.forNumber(healthStatus_);
    +    return result == null ? org.tensorflow.proto.WorkerHealth.UNRECOGNIZED : result;
    +  }
    +
    +  public static final int WORKER_LOG_FIELD_NUMBER = 2;
    +  @SuppressWarnings("serial")
    +  private java.util.List workerLog_;
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  @java.lang.Override
    +  public java.util.List getWorkerLogList() {
    +    return workerLog_;
    +  }
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  @java.lang.Override
    +  public java.util.List 
    +      getWorkerLogOrBuilderList() {
    +    return workerLog_;
    +  }
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  @java.lang.Override
    +  public int getWorkerLogCount() {
    +    return workerLog_.size();
    +  }
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.Event getWorkerLog(int index) {
    +    return workerLog_.get(index);
    +  }
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.EventOrBuilder getWorkerLogOrBuilder(
    +      int index) {
    +    return workerLog_.get(index);
    +  }
    +
    +  public static final int HOSTNAME_FIELD_NUMBER = 3;
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object hostname_ = "";
    +  /**
    +   * string hostname = 3;
    +   * @return The hostname.
    +   */
    +  @java.lang.Override
    +  public java.lang.String getHostname() {
    +    java.lang.Object ref = hostname_;
    +    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();
    +      hostname_ = s;
    +      return s;
    +    }
    +  }
    +  /**
    +   * string hostname = 3;
    +   * @return The bytes for hostname.
    +   */
    +  @java.lang.Override
    +  public com.google.protobuf.ByteString
    +      getHostnameBytes() {
    +    java.lang.Object ref = hostname_;
    +    if (ref instanceof java.lang.String) {
    +      com.google.protobuf.ByteString b = 
    +          com.google.protobuf.ByteString.copyFromUtf8(
    +              (java.lang.String) ref);
    +      hostname_ = b;
    +      return b;
    +    } else {
    +      return (com.google.protobuf.ByteString) ref;
    +    }
    +  }
    +
    +  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 (healthStatus_ != org.tensorflow.proto.WorkerHealth.OK.getNumber()) {
    +      output.writeEnum(1, healthStatus_);
    +    }
    +    for (int i = 0; i < workerLog_.size(); i++) {
    +      output.writeMessage(2, workerLog_.get(i));
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostname_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 3, hostname_);
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (healthStatus_ != org.tensorflow.proto.WorkerHealth.OK.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(1, healthStatus_);
    +    }
    +    for (int i = 0; i < workerLog_.size(); i++) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeMessageSize(2, workerLog_.get(i));
    +    }
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(hostname_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, hostname_);
    +    }
    +    size += getUnknownFields().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.WorkerHeartbeatResponse)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.WorkerHeartbeatResponse other = (org.tensorflow.proto.WorkerHeartbeatResponse) obj;
    +
    +    if (healthStatus_ != other.healthStatus_) return false;
    +    if (!getWorkerLogList()
    +        .equals(other.getWorkerLogList())) return false;
    +    if (!getHostname()
    +        .equals(other.getHostname())) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HEALTH_STATUS_FIELD_NUMBER;
    +    hash = (53 * hash) + healthStatus_;
    +    if (getWorkerLogCount() > 0) {
    +      hash = (37 * hash) + WORKER_LOG_FIELD_NUMBER;
    +      hash = (53 * hash) + getWorkerLogList().hashCode();
    +    }
    +    hash = (37 * hash) + HOSTNAME_FIELD_NUMBER;
    +    hash = (53 * hash) + getHostname().hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse 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.WorkerHeartbeatResponse parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.WorkerHeartbeatResponse 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.WorkerHeartbeatResponse}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.WorkerHeartbeatResponse)
    +      org.tensorflow.proto.WorkerHeartbeatResponseOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.WorkerHeartbeatResponse.class, org.tensorflow.proto.WorkerHeartbeatResponse.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.WorkerHeartbeatResponse.newBuilder()
    +    private Builder() {
    +
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      healthStatus_ = 0;
    +      if (workerLogBuilder_ == null) {
    +        workerLog_ = java.util.Collections.emptyList();
    +      } else {
    +        workerLog_ = null;
    +        workerLogBuilder_.clear();
    +      }
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      hostname_ = "";
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.EventProtos.internal_static_tensorflow_WorkerHeartbeatResponse_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatResponse getDefaultInstanceForType() {
    +      return org.tensorflow.proto.WorkerHeartbeatResponse.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatResponse build() {
    +      org.tensorflow.proto.WorkerHeartbeatResponse result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHeartbeatResponse buildPartial() {
    +      org.tensorflow.proto.WorkerHeartbeatResponse result = new org.tensorflow.proto.WorkerHeartbeatResponse(this);
    +      buildPartialRepeatedFields(result);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartialRepeatedFields(org.tensorflow.proto.WorkerHeartbeatResponse result) {
    +      if (workerLogBuilder_ == null) {
    +        if (((bitField0_ & 0x00000002) != 0)) {
    +          workerLog_ = java.util.Collections.unmodifiableList(workerLog_);
    +          bitField0_ = (bitField0_ & ~0x00000002);
    +        }
    +        result.workerLog_ = workerLog_;
    +      } else {
    +        result.workerLog_ = workerLogBuilder_.build();
    +      }
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.WorkerHeartbeatResponse result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.healthStatus_ = healthStatus_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.hostname_ = hostname_;
    +      }
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.WorkerHeartbeatResponse) {
    +        return mergeFrom((org.tensorflow.proto.WorkerHeartbeatResponse)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.WorkerHeartbeatResponse other) {
    +      if (other == org.tensorflow.proto.WorkerHeartbeatResponse.getDefaultInstance()) return this;
    +      if (other.healthStatus_ != 0) {
    +        setHealthStatusValue(other.getHealthStatusValue());
    +      }
    +      if (workerLogBuilder_ == null) {
    +        if (!other.workerLog_.isEmpty()) {
    +          if (workerLog_.isEmpty()) {
    +            workerLog_ = other.workerLog_;
    +            bitField0_ = (bitField0_ & ~0x00000002);
    +          } else {
    +            ensureWorkerLogIsMutable();
    +            workerLog_.addAll(other.workerLog_);
    +          }
    +          onChanged();
    +        }
    +      } else {
    +        if (!other.workerLog_.isEmpty()) {
    +          if (workerLogBuilder_.isEmpty()) {
    +            workerLogBuilder_.dispose();
    +            workerLogBuilder_ = null;
    +            workerLog_ = other.workerLog_;
    +            bitField0_ = (bitField0_ & ~0x00000002);
    +            workerLogBuilder_ = 
    +              com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
    +                 getWorkerLogFieldBuilder() : null;
    +          } else {
    +            workerLogBuilder_.addAllMessages(other.workerLog_);
    +          }
    +        }
    +      }
    +      if (!other.getHostname().isEmpty()) {
    +        hostname_ = other.hostname_;
    +        bitField0_ |= 0x00000004;
    +        onChanged();
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 8: {
    +              healthStatus_ = input.readEnum();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 8
    +            case 18: {
    +              org.tensorflow.proto.Event m =
    +                  input.readMessage(
    +                      org.tensorflow.proto.Event.parser(),
    +                      extensionRegistry);
    +              if (workerLogBuilder_ == null) {
    +                ensureWorkerLogIsMutable();
    +                workerLog_.add(m);
    +              } else {
    +                workerLogBuilder_.addMessage(m);
    +              }
    +              break;
    +            } // case 18
    +            case 26: {
    +              hostname_ = input.readStringRequireUtf8();
    +              bitField0_ |= 0x00000004;
    +              break;
    +            } // case 26
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private int healthStatus_ = 0;
    +    /**
    +     * .tensorflow.WorkerHealth health_status = 1;
    +     * @return The enum numeric value on the wire for healthStatus.
    +     */
    +    @java.lang.Override public int getHealthStatusValue() {
    +      return healthStatus_;
    +    }
    +    /**
    +     * .tensorflow.WorkerHealth health_status = 1;
    +     * @param value The enum numeric value on the wire for healthStatus to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setHealthStatusValue(int value) {
    +      healthStatus_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WorkerHealth health_status = 1;
    +     * @return The healthStatus.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.WorkerHealth getHealthStatus() {
    +      org.tensorflow.proto.WorkerHealth result = org.tensorflow.proto.WorkerHealth.forNumber(healthStatus_);
    +      return result == null ? org.tensorflow.proto.WorkerHealth.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.WorkerHealth health_status = 1;
    +     * @param value The healthStatus to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setHealthStatus(org.tensorflow.proto.WorkerHealth value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000001;
    +      healthStatus_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.WorkerHealth health_status = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearHealthStatus() {
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      healthStatus_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private java.util.List workerLog_ =
    +      java.util.Collections.emptyList();
    +    private void ensureWorkerLogIsMutable() {
    +      if (!((bitField0_ & 0x00000002) != 0)) {
    +        workerLog_ = new java.util.ArrayList(workerLog_);
    +        bitField0_ |= 0x00000002;
    +       }
    +    }
    +
    +    private com.google.protobuf.RepeatedFieldBuilder<
    +        org.tensorflow.proto.Event, org.tensorflow.proto.Event.Builder, org.tensorflow.proto.EventOrBuilder> workerLogBuilder_;
    +
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public java.util.List getWorkerLogList() {
    +      if (workerLogBuilder_ == null) {
    +        return java.util.Collections.unmodifiableList(workerLog_);
    +      } else {
    +        return workerLogBuilder_.getMessageList();
    +      }
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public int getWorkerLogCount() {
    +      if (workerLogBuilder_ == null) {
    +        return workerLog_.size();
    +      } else {
    +        return workerLogBuilder_.getCount();
    +      }
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public org.tensorflow.proto.Event getWorkerLog(int index) {
    +      if (workerLogBuilder_ == null) {
    +        return workerLog_.get(index);
    +      } else {
    +        return workerLogBuilder_.getMessage(index);
    +      }
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder setWorkerLog(
    +        int index, org.tensorflow.proto.Event value) {
    +      if (workerLogBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        ensureWorkerLogIsMutable();
    +        workerLog_.set(index, value);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.setMessage(index, value);
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder setWorkerLog(
    +        int index, org.tensorflow.proto.Event.Builder builderForValue) {
    +      if (workerLogBuilder_ == null) {
    +        ensureWorkerLogIsMutable();
    +        workerLog_.set(index, builderForValue.build());
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.setMessage(index, builderForValue.build());
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder addWorkerLog(org.tensorflow.proto.Event value) {
    +      if (workerLogBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        ensureWorkerLogIsMutable();
    +        workerLog_.add(value);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.addMessage(value);
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder addWorkerLog(
    +        int index, org.tensorflow.proto.Event value) {
    +      if (workerLogBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        ensureWorkerLogIsMutable();
    +        workerLog_.add(index, value);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.addMessage(index, value);
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder addWorkerLog(
    +        org.tensorflow.proto.Event.Builder builderForValue) {
    +      if (workerLogBuilder_ == null) {
    +        ensureWorkerLogIsMutable();
    +        workerLog_.add(builderForValue.build());
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.addMessage(builderForValue.build());
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder addWorkerLog(
    +        int index, org.tensorflow.proto.Event.Builder builderForValue) {
    +      if (workerLogBuilder_ == null) {
    +        ensureWorkerLogIsMutable();
    +        workerLog_.add(index, builderForValue.build());
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.addMessage(index, builderForValue.build());
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder addAllWorkerLog(
    +        java.lang.Iterable values) {
    +      if (workerLogBuilder_ == null) {
    +        ensureWorkerLogIsMutable();
    +        com.google.protobuf.AbstractMessageLite.Builder.addAll(
    +            values, workerLog_);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.addAllMessages(values);
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder clearWorkerLog() {
    +      if (workerLogBuilder_ == null) {
    +        workerLog_ = java.util.Collections.emptyList();
    +        bitField0_ = (bitField0_ & ~0x00000002);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.clear();
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public Builder removeWorkerLog(int index) {
    +      if (workerLogBuilder_ == null) {
    +        ensureWorkerLogIsMutable();
    +        workerLog_.remove(index);
    +        onChanged();
    +      } else {
    +        workerLogBuilder_.remove(index);
    +      }
    +      return this;
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public org.tensorflow.proto.Event.Builder getWorkerLogBuilder(
    +        int index) {
    +      return getWorkerLogFieldBuilder().getBuilder(index);
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public org.tensorflow.proto.EventOrBuilder getWorkerLogOrBuilder(
    +        int index) {
    +      if (workerLogBuilder_ == null) {
    +        return workerLog_.get(index);  } else {
    +        return workerLogBuilder_.getMessageOrBuilder(index);
    +      }
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public java.util.List 
    +         getWorkerLogOrBuilderList() {
    +      if (workerLogBuilder_ != null) {
    +        return workerLogBuilder_.getMessageOrBuilderList();
    +      } else {
    +        return java.util.Collections.unmodifiableList(workerLog_);
    +      }
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public org.tensorflow.proto.Event.Builder addWorkerLogBuilder() {
    +      return getWorkerLogFieldBuilder().addBuilder(
    +          org.tensorflow.proto.Event.getDefaultInstance());
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public org.tensorflow.proto.Event.Builder addWorkerLogBuilder(
    +        int index) {
    +      return getWorkerLogFieldBuilder().addBuilder(
    +          index, org.tensorflow.proto.Event.getDefaultInstance());
    +    }
    +    /**
    +     * repeated .tensorflow.Event worker_log = 2;
    +     */
    +    public java.util.List 
    +         getWorkerLogBuilderList() {
    +      return getWorkerLogFieldBuilder().getBuilderList();
    +    }
    +    private com.google.protobuf.RepeatedFieldBuilder<
    +        org.tensorflow.proto.Event, org.tensorflow.proto.Event.Builder, org.tensorflow.proto.EventOrBuilder> 
    +        getWorkerLogFieldBuilder() {
    +      if (workerLogBuilder_ == null) {
    +        workerLogBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
    +            org.tensorflow.proto.Event, org.tensorflow.proto.Event.Builder, org.tensorflow.proto.EventOrBuilder>(
    +                workerLog_,
    +                ((bitField0_ & 0x00000002) != 0),
    +                getParentForChildren(),
    +                isClean());
    +        workerLog_ = null;
    +      }
    +      return workerLogBuilder_;
    +    }
    +
    +    private java.lang.Object hostname_ = "";
    +    /**
    +     * string hostname = 3;
    +     * @return The hostname.
    +     */
    +    public java.lang.String getHostname() {
    +      java.lang.Object ref = hostname_;
    +      if (!(ref instanceof java.lang.String)) {
    +        com.google.protobuf.ByteString bs =
    +            (com.google.protobuf.ByteString) ref;
    +        java.lang.String s = bs.toStringUtf8();
    +        hostname_ = s;
    +        return s;
    +      } else {
    +        return (java.lang.String) ref;
    +      }
    +    }
    +    /**
    +     * string hostname = 3;
    +     * @return The bytes for hostname.
    +     */
    +    public com.google.protobuf.ByteString
    +        getHostnameBytes() {
    +      java.lang.Object ref = hostname_;
    +      if (ref instanceof String) {
    +        com.google.protobuf.ByteString b = 
    +            com.google.protobuf.ByteString.copyFromUtf8(
    +                (java.lang.String) ref);
    +        hostname_ = b;
    +        return b;
    +      } else {
    +        return (com.google.protobuf.ByteString) ref;
    +      }
    +    }
    +    /**
    +     * string hostname = 3;
    +     * @param value The hostname to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setHostname(
    +        java.lang.String value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      hostname_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string hostname = 3;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearHostname() {
    +      hostname_ = getDefaultInstance().getHostname();
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * string hostname = 3;
    +     * @param value The bytes for hostname to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setHostnameBytes(
    +        com.google.protobuf.ByteString value) {
    +      if (value == null) { throw new NullPointerException(); }
    +      checkByteStringIsUtf8(value);
    +      hostname_ = value;
    +      bitField0_ |= 0x00000004;
    +      onChanged();
    +      return this;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.WorkerHeartbeatResponse)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.WorkerHeartbeatResponse)
    +  private static final org.tensorflow.proto.WorkerHeartbeatResponse DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.WorkerHeartbeatResponse();
    +  }
    +
    +  public static org.tensorflow.proto.WorkerHeartbeatResponse getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public WorkerHeartbeatResponse parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.WorkerHeartbeatResponse getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponseOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponseOrBuilder.java
    new file mode 100644
    index 00000000000..e3265649d84
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerHeartbeatResponseOrBuilder.java
    @@ -0,0 +1,58 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto;
    +
    +public interface WorkerHeartbeatResponseOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.WorkerHeartbeatResponse)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * .tensorflow.WorkerHealth health_status = 1;
    +   * @return The enum numeric value on the wire for healthStatus.
    +   */
    +  int getHealthStatusValue();
    +  /**
    +   * .tensorflow.WorkerHealth health_status = 1;
    +   * @return The healthStatus.
    +   */
    +  org.tensorflow.proto.WorkerHealth getHealthStatus();
    +
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  java.util.List 
    +      getWorkerLogList();
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  org.tensorflow.proto.Event getWorkerLog(int index);
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  int getWorkerLogCount();
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  java.util.List 
    +      getWorkerLogOrBuilderList();
    +  /**
    +   * repeated .tensorflow.Event worker_log = 2;
    +   */
    +  org.tensorflow.proto.EventOrBuilder getWorkerLogOrBuilder(
    +      int index);
    +
    +  /**
    +   * string hostname = 3;
    +   * @return The hostname.
    +   */
    +  java.lang.String getHostname();
    +  /**
    +   * string hostname = 3;
    +   * @return The bytes for hostname.
    +   */
    +  com.google.protobuf.ByteString
    +      getHostnameBytes();
    +}
    diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerShutdownMode.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerShutdownMode.java
    similarity index 78%
    rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerShutdownMode.java
    rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerShutdownMode.java
    index 41c4f45373c..13ac914fc60 100644
    --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/util/WorkerShutdownMode.java
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/WorkerShutdownMode.java
    @@ -1,7 +1,9 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
     // source: tensorflow/core/util/event.proto
    +// Protobuf Java Version: 4.28.3
     
    -package org.tensorflow.proto.util;
    +package org.tensorflow.proto;
     
     /**
      * 
    @@ -32,6 +34,15 @@ public enum WorkerShutdownMode
       UNRECOGNIZED(-1),
       ;
     
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      WorkerShutdownMode.class.getName());
    +  }
       /**
        * DEFAULT = 0;
        */
    @@ -59,6 +70,8 @@ public final int getNumber() {
       }
     
       /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
        * @deprecated Use {@link #forNumber(int)} instead.
        */
       @java.lang.Deprecated
    @@ -66,6 +79,10 @@ public static WorkerShutdownMode valueOf(int value) {
         return forNumber(value);
       }
     
    +  /**
    +   * @param value The numeric wire value of the corresponding enum entry.
    +   * @return The enum associated with the given numeric wire value.
    +   */
       public static WorkerShutdownMode forNumber(int value) {
         switch (value) {
           case 0: return DEFAULT;
    @@ -90,6 +107,10 @@ public WorkerShutdownMode findValueByNumber(int number) {
     
       public final com.google.protobuf.Descriptors.EnumValueDescriptor
           getValueDescriptor() {
    +    if (this == UNRECOGNIZED) {
    +      throw new java.lang.IllegalStateException(
    +          "Can't get the descriptor of an unrecognized enum value.");
    +    }
         return getDescriptor().getValues().get(ordinal());
       }
       public final com.google.protobuf.Descriptors.EnumDescriptor
    @@ -98,7 +119,7 @@ public WorkerShutdownMode findValueByNumber(int number) {
       }
       public static final com.google.protobuf.Descriptors.EnumDescriptor
           getDescriptor() {
    -    return org.tensorflow.proto.util.EventProtos.getDescriptor().getEnumTypes().get(1);
    +    return org.tensorflow.proto.EventProtos.getDescriptor().getEnumTypes().get(1);
       }
     
       private static final WorkerShutdownMode[] VALUES = values();
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/CppShapeInference.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/CppShapeInference.java
    new file mode 100644
    index 00000000000..4e2e3d02615
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/CppShapeInference.java
    @@ -0,0 +1,3433 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/framework/cpp_shape_inference.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto.core;
    +
    +public final class CppShapeInference {
    +  private CppShapeInference() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      CppShapeInference.class.getName());
    +  }
    +  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 CppShapeInferenceResultOrBuilder extends
    +      // @@protoc_insertion_point(interface_extends:tensorflow.core.CppShapeInferenceResult)
    +      com.google.protobuf.MessageOrBuilder {
    +
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 1;
    +     * @return Whether the shape field is set.
    +     */
    +    boolean hasShape();
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 1;
    +     * @return The shape.
    +     */
    +    org.tensorflow.proto.TensorShapeProto getShape();
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 1;
    +     */
    +    org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder();
    +
    +    /**
    +     * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4;
    +     * @return Whether the handleData field is set.
    +     */
    +    boolean hasHandleData();
    +    /**
    +     * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4;
    +     * @return The handleData.
    +     */
    +    org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData getHandleData();
    +    /**
    +     * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4;
    +     */
    +    org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder getHandleDataOrBuilder();
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.core.CppShapeInferenceResult}
    +   */
    +  public static final class CppShapeInferenceResult extends
    +      com.google.protobuf.GeneratedMessage implements
    +      // @@protoc_insertion_point(message_implements:tensorflow.core.CppShapeInferenceResult)
    +      CppShapeInferenceResultOrBuilder {
    +  private static final long serialVersionUID = 0L;
    +    static {
    +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +        /* major= */ 4,
    +        /* minor= */ 28,
    +        /* patch= */ 3,
    +        /* suffix= */ "",
    +        CppShapeInferenceResult.class.getName());
    +    }
    +    // Use CppShapeInferenceResult.newBuilder() to construct.
    +    private CppShapeInferenceResult(com.google.protobuf.GeneratedMessage.Builder builder) {
    +      super(builder);
    +    }
    +    private CppShapeInferenceResult() {
    +    }
    +
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.Builder.class);
    +    }
    +
    +    public interface HandleShapeAndTypeOrBuilder extends
    +        // @@protoc_insertion_point(interface_extends:tensorflow.core.CppShapeInferenceResult.HandleShapeAndType)
    +        com.google.protobuf.MessageOrBuilder {
    +
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       * @return Whether the shape field is set.
    +       */
    +      boolean hasShape();
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       * @return The shape.
    +       */
    +      org.tensorflow.proto.TensorShapeProto getShape();
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       */
    +      org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder();
    +
    +      /**
    +       * .tensorflow.DataType dtype = 2;
    +       * @return The enum numeric value on the wire for dtype.
    +       */
    +      int getDtypeValue();
    +      /**
    +       * .tensorflow.DataType dtype = 2;
    +       * @return The dtype.
    +       */
    +      org.tensorflow.proto.DataType getDtype();
    +
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       * @return Whether the type field is set.
    +       */
    +      boolean hasType();
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       * @return The type.
    +       */
    +      org.tensorflow.proto.FullTypeDef getType();
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       */
    +      org.tensorflow.proto.FullTypeDefOrBuilder getTypeOrBuilder();
    +    }
    +    /**
    +     * Protobuf type {@code tensorflow.core.CppShapeInferenceResult.HandleShapeAndType}
    +     */
    +    public static final class HandleShapeAndType extends
    +        com.google.protobuf.GeneratedMessage implements
    +        // @@protoc_insertion_point(message_implements:tensorflow.core.CppShapeInferenceResult.HandleShapeAndType)
    +        HandleShapeAndTypeOrBuilder {
    +    private static final long serialVersionUID = 0L;
    +      static {
    +        com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +          /* major= */ 4,
    +          /* minor= */ 28,
    +          /* patch= */ 3,
    +          /* suffix= */ "",
    +          HandleShapeAndType.class.getName());
    +      }
    +      // Use HandleShapeAndType.newBuilder() to construct.
    +      private HandleShapeAndType(com.google.protobuf.GeneratedMessage.Builder builder) {
    +        super(builder);
    +      }
    +      private HandleShapeAndType() {
    +        dtype_ = 0;
    +      }
    +
    +      public static final com.google.protobuf.Descriptors.Descriptor
    +          getDescriptor() {
    +        return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor;
    +      }
    +
    +      @java.lang.Override
    +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +          internalGetFieldAccessorTable() {
    +        return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_fieldAccessorTable
    +            .ensureFieldAccessorsInitialized(
    +                org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder.class);
    +      }
    +
    +      private int bitField0_;
    +      public static final int SHAPE_FIELD_NUMBER = 1;
    +      private org.tensorflow.proto.TensorShapeProto shape_;
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       * @return Whether the shape field is set.
    +       */
    +      @java.lang.Override
    +      public boolean hasShape() {
    +        return ((bitField0_ & 0x00000001) != 0);
    +      }
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       * @return The shape.
    +       */
    +      @java.lang.Override
    +      public org.tensorflow.proto.TensorShapeProto getShape() {
    +        return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +      }
    +      /**
    +       * .tensorflow.TensorShapeProto shape = 1;
    +       */
    +      @java.lang.Override
    +      public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() {
    +        return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +      }
    +
    +      public static final int DTYPE_FIELD_NUMBER = 2;
    +      private int dtype_ = 0;
    +      /**
    +       * .tensorflow.DataType dtype = 2;
    +       * @return The enum numeric value on the wire for dtype.
    +       */
    +      @java.lang.Override public int getDtypeValue() {
    +        return dtype_;
    +      }
    +      /**
    +       * .tensorflow.DataType dtype = 2;
    +       * @return The dtype.
    +       */
    +      @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +        org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +        return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +      }
    +
    +      public static final int TYPE_FIELD_NUMBER = 4;
    +      private org.tensorflow.proto.FullTypeDef type_;
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       * @return Whether the type field is set.
    +       */
    +      @java.lang.Override
    +      public boolean hasType() {
    +        return ((bitField0_ & 0x00000002) != 0);
    +      }
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       * @return The type.
    +       */
    +      @java.lang.Override
    +      public org.tensorflow.proto.FullTypeDef getType() {
    +        return type_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : type_;
    +      }
    +      /**
    +       * .tensorflow.FullTypeDef type = 4;
    +       */
    +      @java.lang.Override
    +      public org.tensorflow.proto.FullTypeDefOrBuilder getTypeOrBuilder() {
    +        return type_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : type_;
    +      }
    +
    +      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 (((bitField0_ & 0x00000001) != 0)) {
    +          output.writeMessage(1, getShape());
    +        }
    +        if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +          output.writeEnum(2, dtype_);
    +        }
    +        if (((bitField0_ & 0x00000002) != 0)) {
    +          output.writeMessage(4, getType());
    +        }
    +        getUnknownFields().writeTo(output);
    +      }
    +
    +      @java.lang.Override
    +      public int getSerializedSize() {
    +        int size = memoizedSize;
    +        if (size != -1) return size;
    +
    +        size = 0;
    +        if (((bitField0_ & 0x00000001) != 0)) {
    +          size += com.google.protobuf.CodedOutputStream
    +            .computeMessageSize(1, getShape());
    +        }
    +        if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +          size += com.google.protobuf.CodedOutputStream
    +            .computeEnumSize(2, dtype_);
    +        }
    +        if (((bitField0_ & 0x00000002) != 0)) {
    +          size += com.google.protobuf.CodedOutputStream
    +            .computeMessageSize(4, getType());
    +        }
    +        size += getUnknownFields().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.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType)) {
    +          return super.equals(obj);
    +        }
    +        org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType other = (org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType) obj;
    +
    +        if (hasShape() != other.hasShape()) return false;
    +        if (hasShape()) {
    +          if (!getShape()
    +              .equals(other.getShape())) return false;
    +        }
    +        if (dtype_ != other.dtype_) return false;
    +        if (hasType() != other.hasType()) return false;
    +        if (hasType()) {
    +          if (!getType()
    +              .equals(other.getType())) return false;
    +        }
    +        if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    +        return true;
    +      }
    +
    +      @java.lang.Override
    +      public int hashCode() {
    +        if (memoizedHashCode != 0) {
    +          return memoizedHashCode;
    +        }
    +        int hash = 41;
    +        hash = (19 * hash) + getDescriptor().hashCode();
    +        if (hasShape()) {
    +          hash = (37 * hash) + SHAPE_FIELD_NUMBER;
    +          hash = (53 * hash) + getShape().hashCode();
    +        }
    +        hash = (37 * hash) + DTYPE_FIELD_NUMBER;
    +        hash = (53 * hash) + dtype_;
    +        if (hasType()) {
    +          hash = (37 * hash) + TYPE_FIELD_NUMBER;
    +          hash = (53 * hash) + getType().hashCode();
    +        }
    +        hash = (29 * hash) + getUnknownFields().hashCode();
    +        memoizedHashCode = hash;
    +        return hash;
    +      }
    +
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          java.nio.ByteBuffer data)
    +          throws com.google.protobuf.InvalidProtocolBufferException {
    +        return PARSER.parseFrom(data);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType 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.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          com.google.protobuf.ByteString data)
    +          throws com.google.protobuf.InvalidProtocolBufferException {
    +        return PARSER.parseFrom(data);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType 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.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(byte[] data)
    +          throws com.google.protobuf.InvalidProtocolBufferException {
    +        return PARSER.parseFrom(data);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          byte[] data,
    +          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +          throws com.google.protobuf.InvalidProtocolBufferException {
    +        return PARSER.parseFrom(data, extensionRegistry);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(java.io.InputStream input)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .parseWithIOException(PARSER, input);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          java.io.InputStream input,
    +          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .parseWithIOException(PARSER, input, extensionRegistry);
    +      }
    +
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseDelimitedFrom(java.io.InputStream input)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .parseDelimitedWithIOException(PARSER, input);
    +      }
    +
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseDelimitedFrom(
    +          java.io.InputStream input,
    +          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          com.google.protobuf.CodedInputStream input)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .parseWithIOException(PARSER, input);
    +      }
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType parseFrom(
    +          com.google.protobuf.CodedInputStream input,
    +          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +          throws java.io.IOException {
    +        return com.google.protobuf.GeneratedMessage
    +            .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.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType 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.GeneratedMessage.BuilderParent parent) {
    +        Builder builder = new Builder(parent);
    +        return builder;
    +      }
    +      /**
    +       * Protobuf type {@code tensorflow.core.CppShapeInferenceResult.HandleShapeAndType}
    +       */
    +      public static final class Builder extends
    +          com.google.protobuf.GeneratedMessage.Builder implements
    +          // @@protoc_insertion_point(builder_implements:tensorflow.core.CppShapeInferenceResult.HandleShapeAndType)
    +          org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder {
    +        public static final com.google.protobuf.Descriptors.Descriptor
    +            getDescriptor() {
    +          return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor;
    +        }
    +
    +        @java.lang.Override
    +        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +            internalGetFieldAccessorTable() {
    +          return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_fieldAccessorTable
    +              .ensureFieldAccessorsInitialized(
    +                  org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder.class);
    +        }
    +
    +        // Construct using org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.newBuilder()
    +        private Builder() {
    +          maybeForceBuilderInitialization();
    +        }
    +
    +        private Builder(
    +            com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +          super(parent);
    +          maybeForceBuilderInitialization();
    +        }
    +        private void maybeForceBuilderInitialization() {
    +          if (com.google.protobuf.GeneratedMessage
    +                  .alwaysUseFieldBuilders) {
    +            getShapeFieldBuilder();
    +            getTypeFieldBuilder();
    +          }
    +        }
    +        @java.lang.Override
    +        public Builder clear() {
    +          super.clear();
    +          bitField0_ = 0;
    +          shape_ = null;
    +          if (shapeBuilder_ != null) {
    +            shapeBuilder_.dispose();
    +            shapeBuilder_ = null;
    +          }
    +          dtype_ = 0;
    +          type_ = null;
    +          if (typeBuilder_ != null) {
    +            typeBuilder_.dispose();
    +            typeBuilder_ = null;
    +          }
    +          return this;
    +        }
    +
    +        @java.lang.Override
    +        public com.google.protobuf.Descriptors.Descriptor
    +            getDescriptorForType() {
    +          return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor;
    +        }
    +
    +        @java.lang.Override
    +        public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getDefaultInstanceForType() {
    +          return org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.getDefaultInstance();
    +        }
    +
    +        @java.lang.Override
    +        public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType build() {
    +          org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType result = buildPartial();
    +          if (!result.isInitialized()) {
    +            throw newUninitializedMessageException(result);
    +          }
    +          return result;
    +        }
    +
    +        @java.lang.Override
    +        public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType buildPartial() {
    +          org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType result = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType(this);
    +          if (bitField0_ != 0) { buildPartial0(result); }
    +          onBuilt();
    +          return result;
    +        }
    +
    +        private void buildPartial0(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType result) {
    +          int from_bitField0_ = bitField0_;
    +          int to_bitField0_ = 0;
    +          if (((from_bitField0_ & 0x00000001) != 0)) {
    +            result.shape_ = shapeBuilder_ == null
    +                ? shape_
    +                : shapeBuilder_.build();
    +            to_bitField0_ |= 0x00000001;
    +          }
    +          if (((from_bitField0_ & 0x00000002) != 0)) {
    +            result.dtype_ = dtype_;
    +          }
    +          if (((from_bitField0_ & 0x00000004) != 0)) {
    +            result.type_ = typeBuilder_ == null
    +                ? type_
    +                : typeBuilder_.build();
    +            to_bitField0_ |= 0x00000002;
    +          }
    +          result.bitField0_ |= to_bitField0_;
    +        }
    +
    +        @java.lang.Override
    +        public Builder mergeFrom(com.google.protobuf.Message other) {
    +          if (other instanceof org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType) {
    +            return mergeFrom((org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType)other);
    +          } else {
    +            super.mergeFrom(other);
    +            return this;
    +          }
    +        }
    +
    +        public Builder mergeFrom(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType other) {
    +          if (other == org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.getDefaultInstance()) return this;
    +          if (other.hasShape()) {
    +            mergeShape(other.getShape());
    +          }
    +          if (other.dtype_ != 0) {
    +            setDtypeValue(other.getDtypeValue());
    +          }
    +          if (other.hasType()) {
    +            mergeType(other.getType());
    +          }
    +          this.mergeUnknownFields(other.getUnknownFields());
    +          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 {
    +          if (extensionRegistry == null) {
    +            throw new java.lang.NullPointerException();
    +          }
    +          try {
    +            boolean done = false;
    +            while (!done) {
    +              int tag = input.readTag();
    +              switch (tag) {
    +                case 0:
    +                  done = true;
    +                  break;
    +                case 10: {
    +                  input.readMessage(
    +                      getShapeFieldBuilder().getBuilder(),
    +                      extensionRegistry);
    +                  bitField0_ |= 0x00000001;
    +                  break;
    +                } // case 10
    +                case 16: {
    +                  dtype_ = input.readEnum();
    +                  bitField0_ |= 0x00000002;
    +                  break;
    +                } // case 16
    +                case 34: {
    +                  input.readMessage(
    +                      getTypeFieldBuilder().getBuilder(),
    +                      extensionRegistry);
    +                  bitField0_ |= 0x00000004;
    +                  break;
    +                } // case 34
    +                default: {
    +                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                    done = true; // was an endgroup tag
    +                  }
    +                  break;
    +                } // default:
    +              } // switch (tag)
    +            } // while (!done)
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.unwrapIOException();
    +          } finally {
    +            onChanged();
    +          } // finally
    +          return this;
    +        }
    +        private int bitField0_;
    +
    +        private org.tensorflow.proto.TensorShapeProto shape_;
    +        private com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_;
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         * @return Whether the shape field is set.
    +         */
    +        public boolean hasShape() {
    +          return ((bitField0_ & 0x00000001) != 0);
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         * @return The shape.
    +         */
    +        public org.tensorflow.proto.TensorShapeProto getShape() {
    +          if (shapeBuilder_ == null) {
    +            return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +          } else {
    +            return shapeBuilder_.getMessage();
    +          }
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public Builder setShape(org.tensorflow.proto.TensorShapeProto value) {
    +          if (shapeBuilder_ == null) {
    +            if (value == null) {
    +              throw new NullPointerException();
    +            }
    +            shape_ = value;
    +          } else {
    +            shapeBuilder_.setMessage(value);
    +          }
    +          bitField0_ |= 0x00000001;
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public Builder setShape(
    +            org.tensorflow.proto.TensorShapeProto.Builder builderForValue) {
    +          if (shapeBuilder_ == null) {
    +            shape_ = builderForValue.build();
    +          } else {
    +            shapeBuilder_.setMessage(builderForValue.build());
    +          }
    +          bitField0_ |= 0x00000001;
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) {
    +          if (shapeBuilder_ == null) {
    +            if (((bitField0_ & 0x00000001) != 0) &&
    +              shape_ != null &&
    +              shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) {
    +              getShapeBuilder().mergeFrom(value);
    +            } else {
    +              shape_ = value;
    +            }
    +          } else {
    +            shapeBuilder_.mergeFrom(value);
    +          }
    +          if (shape_ != null) {
    +            bitField0_ |= 0x00000001;
    +            onChanged();
    +          }
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public Builder clearShape() {
    +          bitField0_ = (bitField0_ & ~0x00000001);
    +          shape_ = null;
    +          if (shapeBuilder_ != null) {
    +            shapeBuilder_.dispose();
    +            shapeBuilder_ = null;
    +          }
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() {
    +          bitField0_ |= 0x00000001;
    +          onChanged();
    +          return getShapeFieldBuilder().getBuilder();
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() {
    +          if (shapeBuilder_ != null) {
    +            return shapeBuilder_.getMessageOrBuilder();
    +          } else {
    +            return shape_ == null ?
    +                org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +          }
    +        }
    +        /**
    +         * .tensorflow.TensorShapeProto shape = 1;
    +         */
    +        private com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> 
    +            getShapeFieldBuilder() {
    +          if (shapeBuilder_ == null) {
    +            shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
    +                org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>(
    +                    getShape(),
    +                    getParentForChildren(),
    +                    isClean());
    +            shape_ = null;
    +          }
    +          return shapeBuilder_;
    +        }
    +
    +        private int dtype_ = 0;
    +        /**
    +         * .tensorflow.DataType dtype = 2;
    +         * @return The enum numeric value on the wire for dtype.
    +         */
    +        @java.lang.Override public int getDtypeValue() {
    +          return dtype_;
    +        }
    +        /**
    +         * .tensorflow.DataType dtype = 2;
    +         * @param value The enum numeric value on the wire for dtype to set.
    +         * @return This builder for chaining.
    +         */
    +        public Builder setDtypeValue(int value) {
    +          dtype_ = value;
    +          bitField0_ |= 0x00000002;
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.DataType dtype = 2;
    +         * @return The dtype.
    +         */
    +        @java.lang.Override
    +        public org.tensorflow.proto.DataType getDtype() {
    +          org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +          return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +        }
    +        /**
    +         * .tensorflow.DataType dtype = 2;
    +         * @param value The dtype to set.
    +         * @return This builder for chaining.
    +         */
    +        public Builder setDtype(org.tensorflow.proto.DataType value) {
    +          if (value == null) {
    +            throw new NullPointerException();
    +          }
    +          bitField0_ |= 0x00000002;
    +          dtype_ = value.getNumber();
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.DataType dtype = 2;
    +         * @return This builder for chaining.
    +         */
    +        public Builder clearDtype() {
    +          bitField0_ = (bitField0_ & ~0x00000002);
    +          dtype_ = 0;
    +          onChanged();
    +          return this;
    +        }
    +
    +        private org.tensorflow.proto.FullTypeDef type_;
    +        private com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> typeBuilder_;
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         * @return Whether the type field is set.
    +         */
    +        public boolean hasType() {
    +          return ((bitField0_ & 0x00000004) != 0);
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         * @return The type.
    +         */
    +        public org.tensorflow.proto.FullTypeDef getType() {
    +          if (typeBuilder_ == null) {
    +            return type_ == null ? org.tensorflow.proto.FullTypeDef.getDefaultInstance() : type_;
    +          } else {
    +            return typeBuilder_.getMessage();
    +          }
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public Builder setType(org.tensorflow.proto.FullTypeDef value) {
    +          if (typeBuilder_ == null) {
    +            if (value == null) {
    +              throw new NullPointerException();
    +            }
    +            type_ = value;
    +          } else {
    +            typeBuilder_.setMessage(value);
    +          }
    +          bitField0_ |= 0x00000004;
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public Builder setType(
    +            org.tensorflow.proto.FullTypeDef.Builder builderForValue) {
    +          if (typeBuilder_ == null) {
    +            type_ = builderForValue.build();
    +          } else {
    +            typeBuilder_.setMessage(builderForValue.build());
    +          }
    +          bitField0_ |= 0x00000004;
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public Builder mergeType(org.tensorflow.proto.FullTypeDef value) {
    +          if (typeBuilder_ == null) {
    +            if (((bitField0_ & 0x00000004) != 0) &&
    +              type_ != null &&
    +              type_ != org.tensorflow.proto.FullTypeDef.getDefaultInstance()) {
    +              getTypeBuilder().mergeFrom(value);
    +            } else {
    +              type_ = value;
    +            }
    +          } else {
    +            typeBuilder_.mergeFrom(value);
    +          }
    +          if (type_ != null) {
    +            bitField0_ |= 0x00000004;
    +            onChanged();
    +          }
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public Builder clearType() {
    +          bitField0_ = (bitField0_ & ~0x00000004);
    +          type_ = null;
    +          if (typeBuilder_ != null) {
    +            typeBuilder_.dispose();
    +            typeBuilder_ = null;
    +          }
    +          onChanged();
    +          return this;
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public org.tensorflow.proto.FullTypeDef.Builder getTypeBuilder() {
    +          bitField0_ |= 0x00000004;
    +          onChanged();
    +          return getTypeFieldBuilder().getBuilder();
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        public org.tensorflow.proto.FullTypeDefOrBuilder getTypeOrBuilder() {
    +          if (typeBuilder_ != null) {
    +            return typeBuilder_.getMessageOrBuilder();
    +          } else {
    +            return type_ == null ?
    +                org.tensorflow.proto.FullTypeDef.getDefaultInstance() : type_;
    +          }
    +        }
    +        /**
    +         * .tensorflow.FullTypeDef type = 4;
    +         */
    +        private com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder> 
    +            getTypeFieldBuilder() {
    +          if (typeBuilder_ == null) {
    +            typeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
    +                org.tensorflow.proto.FullTypeDef, org.tensorflow.proto.FullTypeDef.Builder, org.tensorflow.proto.FullTypeDefOrBuilder>(
    +                    getType(),
    +                    getParentForChildren(),
    +                    isClean());
    +            type_ = null;
    +          }
    +          return typeBuilder_;
    +        }
    +
    +        // @@protoc_insertion_point(builder_scope:tensorflow.core.CppShapeInferenceResult.HandleShapeAndType)
    +      }
    +
    +      // @@protoc_insertion_point(class_scope:tensorflow.core.CppShapeInferenceResult.HandleShapeAndType)
    +      private static final org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType DEFAULT_INSTANCE;
    +      static {
    +        DEFAULT_INSTANCE = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType();
    +      }
    +
    +      public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getDefaultInstance() {
    +        return DEFAULT_INSTANCE;
    +      }
    +
    +      private static final com.google.protobuf.Parser
    +          PARSER = new com.google.protobuf.AbstractParser() {
    +        @java.lang.Override
    +        public HandleShapeAndType parsePartialFrom(
    +            com.google.protobuf.CodedInputStream input,
    +            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +            throws com.google.protobuf.InvalidProtocolBufferException {
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
    +        }
    +      };
    +
    +      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.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getDefaultInstanceForType() {
    +        return DEFAULT_INSTANCE;
    +      }
    +
    +    }
    +
    +    public interface HandleDataOrBuilder extends
    +        // @@protoc_insertion_point(interface_extends:tensorflow.core.CppShapeInferenceResult.HandleData)
    +        com.google.protobuf.MessageOrBuilder {
    +
    +      /**
    +       * bool is_set = 1;
    +       * @return The isSet.
    +       */
    +      boolean getIsSet();
    +
    +      /**
    +       * 
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + java.util.List + getShapeAndTypeList(); + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getShapeAndType(int index); + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + int getShapeAndTypeCount(); + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + java.util.List + getShapeAndTypeOrBuilderList(); + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder getShapeAndTypeOrBuilder( + int index); + } + /** + * Protobuf type {@code tensorflow.core.CppShapeInferenceResult.HandleData} + */ + public static final class HandleData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.core.CppShapeInferenceResult.HandleData) + HandleDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + HandleData.class.getName()); + } + // Use HandleData.newBuilder() to construct. + private HandleData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private HandleData() { + shapeAndType_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder.class); + } + + public static final int IS_SET_FIELD_NUMBER = 1; + private boolean isSet_ = false; + /** + * bool is_set = 1; + * @return The isSet. + */ + @java.lang.Override + public boolean getIsSet() { + return isSet_; + } + + public static final int SHAPE_AND_TYPE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List shapeAndType_; + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + @java.lang.Override + public java.util.List getShapeAndTypeList() { + return shapeAndType_; + } + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + @java.lang.Override + public java.util.List + getShapeAndTypeOrBuilderList() { + return shapeAndType_; + } + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + @java.lang.Override + public int getShapeAndTypeCount() { + return shapeAndType_.size(); + } + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getShapeAndType(int index) { + return shapeAndType_.get(index); + } + /** + *
    +       * Only valid if <is_set>.
    +       * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder getShapeAndTypeOrBuilder( + int index) { + return shapeAndType_.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 { + if (isSet_ != false) { + output.writeBool(1, isSet_); + } + for (int i = 0; i < shapeAndType_.size(); i++) { + output.writeMessage(2, shapeAndType_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (isSet_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, isSet_); + } + for (int i = 0; i < shapeAndType_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, shapeAndType_.get(i)); + } + size += getUnknownFields().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.core.CppShapeInference.CppShapeInferenceResult.HandleData)) { + return super.equals(obj); + } + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData other = (org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData) obj; + + if (getIsSet() + != other.getIsSet()) return false; + if (!getShapeAndTypeList() + .equals(other.getShapeAndTypeList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + IS_SET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsSet()); + if (getShapeAndTypeCount() > 0) { + hash = (37 * hash) + SHAPE_AND_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getShapeAndTypeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData 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.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData 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.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.core.CppShapeInference.CppShapeInferenceResult.HandleData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.core.CppShapeInferenceResult.HandleData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.core.CppShapeInferenceResult.HandleData) + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder.class); + } + + // Construct using org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + isSet_ = false; + if (shapeAndTypeBuilder_ == null) { + shapeAndType_ = java.util.Collections.emptyList(); + } else { + shapeAndType_ = null; + shapeAndTypeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData getDefaultInstanceForType() { + return org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData build() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData buildPartial() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData result = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData result) { + if (shapeAndTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + shapeAndType_ = java.util.Collections.unmodifiableList(shapeAndType_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.shapeAndType_ = shapeAndType_; + } else { + result.shapeAndType_ = shapeAndTypeBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.isSet_ = isSet_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData) { + return mergeFrom((org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData other) { + if (other == org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance()) return this; + if (other.getIsSet() != false) { + setIsSet(other.getIsSet()); + } + if (shapeAndTypeBuilder_ == null) { + if (!other.shapeAndType_.isEmpty()) { + if (shapeAndType_.isEmpty()) { + shapeAndType_ = other.shapeAndType_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureShapeAndTypeIsMutable(); + shapeAndType_.addAll(other.shapeAndType_); + } + onChanged(); + } + } else { + if (!other.shapeAndType_.isEmpty()) { + if (shapeAndTypeBuilder_.isEmpty()) { + shapeAndTypeBuilder_.dispose(); + shapeAndTypeBuilder_ = null; + shapeAndType_ = other.shapeAndType_; + bitField0_ = (bitField0_ & ~0x00000002); + shapeAndTypeBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getShapeAndTypeFieldBuilder() : null; + } else { + shapeAndTypeBuilder_.addAllMessages(other.shapeAndType_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + isSet_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType m = + input.readMessage( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.parser(), + extensionRegistry); + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + shapeAndType_.add(m); + } else { + shapeAndTypeBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean isSet_ ; + /** + * bool is_set = 1; + * @return The isSet. + */ + @java.lang.Override + public boolean getIsSet() { + return isSet_; + } + /** + * bool is_set = 1; + * @param value The isSet to set. + * @return This builder for chaining. + */ + public Builder setIsSet(boolean value) { + + isSet_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bool is_set = 1; + * @return This builder for chaining. + */ + public Builder clearIsSet() { + bitField0_ = (bitField0_ & ~0x00000001); + isSet_ = false; + onChanged(); + return this; + } + + private java.util.List shapeAndType_ = + java.util.Collections.emptyList(); + private void ensureShapeAndTypeIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + shapeAndType_ = new java.util.ArrayList(shapeAndType_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder> shapeAndTypeBuilder_; + + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public java.util.List getShapeAndTypeList() { + if (shapeAndTypeBuilder_ == null) { + return java.util.Collections.unmodifiableList(shapeAndType_); + } else { + return shapeAndTypeBuilder_.getMessageList(); + } + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public int getShapeAndTypeCount() { + if (shapeAndTypeBuilder_ == null) { + return shapeAndType_.size(); + } else { + return shapeAndTypeBuilder_.getCount(); + } + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType getShapeAndType(int index) { + if (shapeAndTypeBuilder_ == null) { + return shapeAndType_.get(index); + } else { + return shapeAndTypeBuilder_.getMessage(index); + } + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder setShapeAndType( + int index, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType value) { + if (shapeAndTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeAndTypeIsMutable(); + shapeAndType_.set(index, value); + onChanged(); + } else { + shapeAndTypeBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder setShapeAndType( + int index, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder builderForValue) { + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + shapeAndType_.set(index, builderForValue.build()); + onChanged(); + } else { + shapeAndTypeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder addShapeAndType(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType value) { + if (shapeAndTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeAndTypeIsMutable(); + shapeAndType_.add(value); + onChanged(); + } else { + shapeAndTypeBuilder_.addMessage(value); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder addShapeAndType( + int index, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType value) { + if (shapeAndTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShapeAndTypeIsMutable(); + shapeAndType_.add(index, value); + onChanged(); + } else { + shapeAndTypeBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder addShapeAndType( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder builderForValue) { + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + shapeAndType_.add(builderForValue.build()); + onChanged(); + } else { + shapeAndTypeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder addShapeAndType( + int index, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder builderForValue) { + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + shapeAndType_.add(index, builderForValue.build()); + onChanged(); + } else { + shapeAndTypeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder addAllShapeAndType( + java.lang.Iterable values) { + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, shapeAndType_); + onChanged(); + } else { + shapeAndTypeBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder clearShapeAndType() { + if (shapeAndTypeBuilder_ == null) { + shapeAndType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + shapeAndTypeBuilder_.clear(); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public Builder removeShapeAndType(int index) { + if (shapeAndTypeBuilder_ == null) { + ensureShapeAndTypeIsMutable(); + shapeAndType_.remove(index); + onChanged(); + } else { + shapeAndTypeBuilder_.remove(index); + } + return this; + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder getShapeAndTypeBuilder( + int index) { + return getShapeAndTypeFieldBuilder().getBuilder(index); + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder getShapeAndTypeOrBuilder( + int index) { + if (shapeAndTypeBuilder_ == null) { + return shapeAndType_.get(index); } else { + return shapeAndTypeBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public java.util.List + getShapeAndTypeOrBuilderList() { + if (shapeAndTypeBuilder_ != null) { + return shapeAndTypeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shapeAndType_); + } + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder addShapeAndTypeBuilder() { + return getShapeAndTypeFieldBuilder().addBuilder( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.getDefaultInstance()); + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder addShapeAndTypeBuilder( + int index) { + return getShapeAndTypeFieldBuilder().addBuilder( + index, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.getDefaultInstance()); + } + /** + *
    +         * Only valid if <is_set>.
    +         * 
    + * + * repeated .tensorflow.core.CppShapeInferenceResult.HandleShapeAndType shape_and_type = 2; + */ + public java.util.List + getShapeAndTypeBuilderList() { + return getShapeAndTypeFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder> + getShapeAndTypeFieldBuilder() { + if (shapeAndTypeBuilder_ == null) { + shapeAndTypeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndType.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleShapeAndTypeOrBuilder>( + shapeAndType_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + shapeAndType_ = null; + } + return shapeAndTypeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.core.CppShapeInferenceResult.HandleData) + } + + // @@protoc_insertion_point(class_scope:tensorflow.core.CppShapeInferenceResult.HandleData) + private static final org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData(); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HandleData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.core.CppShapeInference.CppShapeInferenceResult.HandleData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int SHAPE_FIELD_NUMBER = 1; + private org.tensorflow.proto.TensorShapeProto shape_; + /** + * .tensorflow.TensorShapeProto shape = 1; + * @return Whether the shape field is set. + */ + @java.lang.Override + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 1; + * @return The shape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getShape() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + + public static final int HANDLE_DATA_FIELD_NUMBER = 4; + private org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData handleData_; + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + * @return Whether the handleData field is set. + */ + @java.lang.Override + public boolean hasHandleData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + * @return The handleData. + */ + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData getHandleData() { + return handleData_ == null ? org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance() : handleData_; + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder getHandleDataOrBuilder() { + return handleData_ == null ? org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance() : handleData_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getHandleData()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getShape()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getHandleData()); + } + size += getUnknownFields().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.core.CppShapeInference.CppShapeInferenceResult)) { + return super.equals(obj); + } + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult other = (org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult) obj; + + if (hasShape() != other.hasShape()) return false; + if (hasShape()) { + if (!getShape() + .equals(other.getShape())) return false; + } + if (hasHandleData() != other.hasHandleData()) return false; + if (hasHandleData()) { + if (!getHandleData() + .equals(other.getHandleData())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasShape()) { + hash = (37 * hash) + SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getShape().hashCode(); + } + if (hasHandleData()) { + hash = (37 * hash) + HANDLE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getHandleData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult 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.core.CppShapeInference.CppShapeInferenceResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult 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.core.CppShapeInference.CppShapeInferenceResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.core.CppShapeInference.CppShapeInferenceResult 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.core.CppShapeInferenceResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.core.CppShapeInferenceResult) + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.Builder.class); + } + + // Construct using org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getShapeFieldBuilder(); + getHandleDataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + handleData_ = null; + if (handleDataBuilder_ != null) { + handleDataBuilder_.dispose(); + handleDataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceResult_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult getDefaultInstanceForType() { + return org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult build() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult buildPartial() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult result = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.shape_ = shapeBuilder_ == null + ? shape_ + : shapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.handleData_ = handleDataBuilder_ == null + ? handleData_ + : handleDataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult) { + return mergeFrom((org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult other) { + if (other == org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.getDefaultInstance()) return this; + if (other.hasShape()) { + mergeShape(other.getShape()); + } + if (other.hasHandleData()) { + mergeHandleData(other.getHandleData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 34: { + input.readMessage( + getHandleDataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.TensorShapeProto shape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_; + /** + * .tensorflow.TensorShapeProto shape = 1; + * @return Whether the shape field is set. + */ + public boolean hasShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto shape = 1; + * @return The shape. + */ + public org.tensorflow.proto.TensorShapeProto getShape() { + if (shapeBuilder_ == null) { + return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } else { + return shapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public Builder setShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shape_ = value; + } else { + shapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public Builder setShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (shapeBuilder_ == null) { + shape_ = builderForValue.build(); + } else { + shapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) { + if (shapeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + shape_ != null && + shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getShapeBuilder().mergeFrom(value); + } else { + shape_ = value; + } + } else { + shapeBuilder_.mergeFrom(value); + } + if (shape_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public Builder clearShape() { + bitField0_ = (bitField0_ & ~0x00000001); + shape_ = null; + if (shapeBuilder_ != null) { + shapeBuilder_.dispose(); + shapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() { + if (shapeBuilder_ != null) { + return shapeBuilder_.getMessageOrBuilder(); + } else { + return shape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_; + } + } + /** + * .tensorflow.TensorShapeProto shape = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getShapeFieldBuilder() { + if (shapeBuilder_ == null) { + shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getShape(), + getParentForChildren(), + isClean()); + shape_ = null; + } + return shapeBuilder_; + } + + private org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData handleData_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder> handleDataBuilder_; + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + * @return Whether the handleData field is set. + */ + public boolean hasHandleData() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + * @return The handleData. + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData getHandleData() { + if (handleDataBuilder_ == null) { + return handleData_ == null ? org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance() : handleData_; + } else { + return handleDataBuilder_.getMessage(); + } + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public Builder setHandleData(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData value) { + if (handleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + handleData_ = value; + } else { + handleDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public Builder setHandleData( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder builderForValue) { + if (handleDataBuilder_ == null) { + handleData_ = builderForValue.build(); + } else { + handleDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public Builder mergeHandleData(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData value) { + if (handleDataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + handleData_ != null && + handleData_ != org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance()) { + getHandleDataBuilder().mergeFrom(value); + } else { + handleData_ = value; + } + } else { + handleDataBuilder_.mergeFrom(value); + } + if (handleData_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public Builder clearHandleData() { + bitField0_ = (bitField0_ & ~0x00000002); + handleData_ = null; + if (handleDataBuilder_ != null) { + handleDataBuilder_.dispose(); + handleDataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder getHandleDataBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getHandleDataFieldBuilder().getBuilder(); + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder getHandleDataOrBuilder() { + if (handleDataBuilder_ != null) { + return handleDataBuilder_.getMessageOrBuilder(); + } else { + return handleData_ == null ? + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.getDefaultInstance() : handleData_; + } + } + /** + * .tensorflow.core.CppShapeInferenceResult.HandleData handle_data = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder> + getHandleDataFieldBuilder() { + if (handleDataBuilder_ == null) { + handleDataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleData.Builder, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult.HandleDataOrBuilder>( + getHandleData(), + getParentForChildren(), + isClean()); + handleData_ = null; + } + return handleDataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.core.CppShapeInferenceResult) + } + + // @@protoc_insertion_point(class_scope:tensorflow.core.CppShapeInferenceResult) + private static final org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult(); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CppShapeInferenceResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.core.CppShapeInference.CppShapeInferenceResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CppShapeInferenceInputsNeededOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.core.CppShapeInferenceInputsNeeded) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 input_tensors_needed = 1; + * @return A list containing the inputTensorsNeeded. + */ + java.util.List getInputTensorsNeededList(); + /** + * repeated int32 input_tensors_needed = 1; + * @return The count of inputTensorsNeeded. + */ + int getInputTensorsNeededCount(); + /** + * repeated int32 input_tensors_needed = 1; + * @param index The index of the element to return. + * @return The inputTensorsNeeded at the given index. + */ + int getInputTensorsNeeded(int index); + + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return A list containing the inputTensorsAsShapesNeeded. + */ + java.util.List getInputTensorsAsShapesNeededList(); + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return The count of inputTensorsAsShapesNeeded. + */ + int getInputTensorsAsShapesNeededCount(); + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param index The index of the element to return. + * @return The inputTensorsAsShapesNeeded at the given index. + */ + int getInputTensorsAsShapesNeeded(int index); + } + /** + * Protobuf type {@code tensorflow.core.CppShapeInferenceInputsNeeded} + */ + public static final class CppShapeInferenceInputsNeeded extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.core.CppShapeInferenceInputsNeeded) + CppShapeInferenceInputsNeededOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CppShapeInferenceInputsNeeded.class.getName()); + } + // Use CppShapeInferenceInputsNeeded.newBuilder() to construct. + private CppShapeInferenceInputsNeeded(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CppShapeInferenceInputsNeeded() { + inputTensorsNeeded_ = emptyIntList(); + inputTensorsAsShapesNeeded_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.Builder.class); + } + + public static final int INPUT_TENSORS_NEEDED_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList inputTensorsNeeded_ = + emptyIntList(); + /** + * repeated int32 input_tensors_needed = 1; + * @return A list containing the inputTensorsNeeded. + */ + @java.lang.Override + public java.util.List + getInputTensorsNeededList() { + return inputTensorsNeeded_; + } + /** + * repeated int32 input_tensors_needed = 1; + * @return The count of inputTensorsNeeded. + */ + public int getInputTensorsNeededCount() { + return inputTensorsNeeded_.size(); + } + /** + * repeated int32 input_tensors_needed = 1; + * @param index The index of the element to return. + * @return The inputTensorsNeeded at the given index. + */ + public int getInputTensorsNeeded(int index) { + return inputTensorsNeeded_.getInt(index); + } + private int inputTensorsNeededMemoizedSerializedSize = -1; + + public static final int INPUT_TENSORS_AS_SHAPES_NEEDED_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList inputTensorsAsShapesNeeded_ = + emptyIntList(); + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return A list containing the inputTensorsAsShapesNeeded. + */ + @java.lang.Override + public java.util.List + getInputTensorsAsShapesNeededList() { + return inputTensorsAsShapesNeeded_; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return The count of inputTensorsAsShapesNeeded. + */ + public int getInputTensorsAsShapesNeededCount() { + return inputTensorsAsShapesNeeded_.size(); + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param index The index of the element to return. + * @return The inputTensorsAsShapesNeeded at the given index. + */ + public int getInputTensorsAsShapesNeeded(int index) { + return inputTensorsAsShapesNeeded_.getInt(index); + } + private int inputTensorsAsShapesNeededMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getInputTensorsNeededList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(inputTensorsNeededMemoizedSerializedSize); + } + for (int i = 0; i < inputTensorsNeeded_.size(); i++) { + output.writeInt32NoTag(inputTensorsNeeded_.getInt(i)); + } + if (getInputTensorsAsShapesNeededList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(inputTensorsAsShapesNeededMemoizedSerializedSize); + } + for (int i = 0; i < inputTensorsAsShapesNeeded_.size(); i++) { + output.writeInt32NoTag(inputTensorsAsShapesNeeded_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < inputTensorsNeeded_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(inputTensorsNeeded_.getInt(i)); + } + size += dataSize; + if (!getInputTensorsNeededList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + inputTensorsNeededMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < inputTensorsAsShapesNeeded_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(inputTensorsAsShapesNeeded_.getInt(i)); + } + size += dataSize; + if (!getInputTensorsAsShapesNeededList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + inputTensorsAsShapesNeededMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.core.CppShapeInference.CppShapeInferenceInputsNeeded)) { + return super.equals(obj); + } + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded other = (org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded) obj; + + if (!getInputTensorsNeededList() + .equals(other.getInputTensorsNeededList())) return false; + if (!getInputTensorsAsShapesNeededList() + .equals(other.getInputTensorsAsShapesNeededList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInputTensorsNeededCount() > 0) { + hash = (37 * hash) + INPUT_TENSORS_NEEDED_FIELD_NUMBER; + hash = (53 * hash) + getInputTensorsNeededList().hashCode(); + } + if (getInputTensorsAsShapesNeededCount() > 0) { + hash = (37 * hash) + INPUT_TENSORS_AS_SHAPES_NEEDED_FIELD_NUMBER; + hash = (53 * hash) + getInputTensorsAsShapesNeededList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded 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.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded 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.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.core.CppShapeInference.CppShapeInferenceInputsNeeded 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.core.CppShapeInferenceInputsNeeded} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.core.CppShapeInferenceInputsNeeded) + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeededOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.class, org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.Builder.class); + } + + // Construct using org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputTensorsNeeded_ = emptyIntList(); + inputTensorsAsShapesNeeded_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.core.CppShapeInference.internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded getDefaultInstanceForType() { + return org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded build() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded buildPartial() { + org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded result = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + inputTensorsNeeded_.makeImmutable(); + result.inputTensorsNeeded_ = inputTensorsNeeded_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + inputTensorsAsShapesNeeded_.makeImmutable(); + result.inputTensorsAsShapesNeeded_ = inputTensorsAsShapesNeeded_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded) { + return mergeFrom((org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded other) { + if (other == org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded.getDefaultInstance()) return this; + if (!other.inputTensorsNeeded_.isEmpty()) { + if (inputTensorsNeeded_.isEmpty()) { + inputTensorsNeeded_ = other.inputTensorsNeeded_; + inputTensorsNeeded_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureInputTensorsNeededIsMutable(); + inputTensorsNeeded_.addAll(other.inputTensorsNeeded_); + } + onChanged(); + } + if (!other.inputTensorsAsShapesNeeded_.isEmpty()) { + if (inputTensorsAsShapesNeeded_.isEmpty()) { + inputTensorsAsShapesNeeded_ = other.inputTensorsAsShapesNeeded_; + inputTensorsAsShapesNeeded_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureInputTensorsAsShapesNeededIsMutable(); + inputTensorsAsShapesNeeded_.addAll(other.inputTensorsAsShapesNeeded_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureInputTensorsNeededIsMutable(); + inputTensorsNeeded_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInputTensorsNeededIsMutable(); + while (input.getBytesUntilLimit() > 0) { + inputTensorsNeeded_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + case 16: { + int v = input.readInt32(); + ensureInputTensorsAsShapesNeededIsMutable(); + inputTensorsAsShapesNeeded_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInputTensorsAsShapesNeededIsMutable(); + while (input.getBytesUntilLimit() > 0) { + inputTensorsAsShapesNeeded_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList inputTensorsNeeded_ = emptyIntList(); + private void ensureInputTensorsNeededIsMutable() { + if (!inputTensorsNeeded_.isModifiable()) { + inputTensorsNeeded_ = makeMutableCopy(inputTensorsNeeded_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 input_tensors_needed = 1; + * @return A list containing the inputTensorsNeeded. + */ + public java.util.List + getInputTensorsNeededList() { + inputTensorsNeeded_.makeImmutable(); + return inputTensorsNeeded_; + } + /** + * repeated int32 input_tensors_needed = 1; + * @return The count of inputTensorsNeeded. + */ + public int getInputTensorsNeededCount() { + return inputTensorsNeeded_.size(); + } + /** + * repeated int32 input_tensors_needed = 1; + * @param index The index of the element to return. + * @return The inputTensorsNeeded at the given index. + */ + public int getInputTensorsNeeded(int index) { + return inputTensorsNeeded_.getInt(index); + } + /** + * repeated int32 input_tensors_needed = 1; + * @param index The index to set the value at. + * @param value The inputTensorsNeeded to set. + * @return This builder for chaining. + */ + public Builder setInputTensorsNeeded( + int index, int value) { + + ensureInputTensorsNeededIsMutable(); + inputTensorsNeeded_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_needed = 1; + * @param value The inputTensorsNeeded to add. + * @return This builder for chaining. + */ + public Builder addInputTensorsNeeded(int value) { + + ensureInputTensorsNeededIsMutable(); + inputTensorsNeeded_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_needed = 1; + * @param values The inputTensorsNeeded to add. + * @return This builder for chaining. + */ + public Builder addAllInputTensorsNeeded( + java.lang.Iterable values) { + ensureInputTensorsNeededIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputTensorsNeeded_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_needed = 1; + * @return This builder for chaining. + */ + public Builder clearInputTensorsNeeded() { + inputTensorsNeeded_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList inputTensorsAsShapesNeeded_ = emptyIntList(); + private void ensureInputTensorsAsShapesNeededIsMutable() { + if (!inputTensorsAsShapesNeeded_.isModifiable()) { + inputTensorsAsShapesNeeded_ = makeMutableCopy(inputTensorsAsShapesNeeded_); + } + bitField0_ |= 0x00000002; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return A list containing the inputTensorsAsShapesNeeded. + */ + public java.util.List + getInputTensorsAsShapesNeededList() { + inputTensorsAsShapesNeeded_.makeImmutable(); + return inputTensorsAsShapesNeeded_; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return The count of inputTensorsAsShapesNeeded. + */ + public int getInputTensorsAsShapesNeededCount() { + return inputTensorsAsShapesNeeded_.size(); + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param index The index of the element to return. + * @return The inputTensorsAsShapesNeeded at the given index. + */ + public int getInputTensorsAsShapesNeeded(int index) { + return inputTensorsAsShapesNeeded_.getInt(index); + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param index The index to set the value at. + * @param value The inputTensorsAsShapesNeeded to set. + * @return This builder for chaining. + */ + public Builder setInputTensorsAsShapesNeeded( + int index, int value) { + + ensureInputTensorsAsShapesNeededIsMutable(); + inputTensorsAsShapesNeeded_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param value The inputTensorsAsShapesNeeded to add. + * @return This builder for chaining. + */ + public Builder addInputTensorsAsShapesNeeded(int value) { + + ensureInputTensorsAsShapesNeededIsMutable(); + inputTensorsAsShapesNeeded_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @param values The inputTensorsAsShapesNeeded to add. + * @return This builder for chaining. + */ + public Builder addAllInputTensorsAsShapesNeeded( + java.lang.Iterable values) { + ensureInputTensorsAsShapesNeededIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputTensorsAsShapesNeeded_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * repeated int32 input_tensors_as_shapes_needed = 2; + * @return This builder for chaining. + */ + public Builder clearInputTensorsAsShapesNeeded() { + inputTensorsAsShapesNeeded_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.core.CppShapeInferenceInputsNeeded) + } + + // @@protoc_insertion_point(class_scope:tensorflow.core.CppShapeInferenceInputsNeeded) + private static final org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded(); + } + + public static org.tensorflow.proto.core.CppShapeInference.CppShapeInferenceInputsNeeded getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CppShapeInferenceInputsNeeded parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.core.CppShapeInference.CppShapeInferenceInputsNeeded getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_core_CppShapeInferenceResult_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_core_CppShapeInferenceResult_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n3tensorflow/core/framework/cpp_shape_in" + + "ference.proto\022\017tensorflow.core\032)tensorfl" + + "ow/core/framework/full_type.proto\032,tenso" + + "rflow/core/framework/tensor_shape.proto\032" + + "%tensorflow/core/framework/types.proto\"\245" + + "\003\n\027CppShapeInferenceResult\022+\n\005shape\030\001 \001(" + + "\0132\034.tensorflow.TensorShapeProto\022H\n\013handl" + + "e_data\030\004 \001(\01323.tensorflow.core.CppShapeI" + + "nferenceResult.HandleData\032\223\001\n\022HandleShap" + + "eAndType\022+\n\005shape\030\001 \001(\0132\034.tensorflow.Ten" + + "sorShapeProto\022#\n\005dtype\030\002 \001(\0162\024.tensorflo" + + "w.DataType\022%\n\004type\030\004 \001(\0132\027.tensorflow.Fu" + + "llTypeDefJ\004\010\003\020\004\032q\n\nHandleData\022\016\n\006is_set\030" + + "\001 \001(\010\022S\n\016shape_and_type\030\002 \003(\0132;.tensorfl" + + "ow.core.CppShapeInferenceResult.HandleSh" + + "apeAndTypeJ\004\010\002\020\003J\004\010\003\020\004\"e\n\035CppShapeInfere" + + "nceInputsNeeded\022\034\n\024input_tensors_needed\030" + + "\001 \003(\005\022&\n\036input_tensors_as_shapes_needed\030" + + "\002 \003(\005B|\n\031org.tensorflow.proto.coreZ\\gith" + + "ub.com/tensorflow/tensorflow/tensorflow/" + + "go/python/framework/cpp_shape_inference_" + + "go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.FullTypeProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_core_CppShapeInferenceResult_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_core_CppShapeInferenceResult_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_core_CppShapeInferenceResult_descriptor, + new java.lang.String[] { "Shape", "HandleData", }); + internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor = + internal_static_tensorflow_core_CppShapeInferenceResult_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_core_CppShapeInferenceResult_HandleShapeAndType_descriptor, + new java.lang.String[] { "Shape", "Dtype", "Type", }); + internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor = + internal_static_tensorflow_core_CppShapeInferenceResult_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_core_CppShapeInferenceResult_HandleData_descriptor, + new java.lang.String[] { "IsSet", "ShapeAndType", }); + internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_core_CppShapeInferenceInputsNeeded_descriptor, + new java.lang.String[] { "InputTensorsNeeded", "InputTensorsAsShapesNeeded", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.FullTypeProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/platform/CorePlatformPayloads.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/platform/CorePlatformPayloads.java new file mode 100644 index 00000000000..9495889ac7d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/core/platform/CorePlatformPayloads.java @@ -0,0 +1,733 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/core_platform_payloads.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.core.platform; + +public final class CorePlatformPayloads { + private CorePlatformPayloads() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CorePlatformPayloads.class.getName()); + } + 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 ErrorSourceProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.core.platform.ErrorSourceProto) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The enum numeric value on the wire for errorSource. + */ + int getErrorSourceValue(); + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The errorSource. + */ + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource getErrorSource(); + } + /** + *
    +   * If included as a payload, this message contains the error source information
    +   * where the error was raised.
    +   * URI: "type.googleapis.com/tensorflow.core.platform.ErrorSourceProto"
    +   * 
    + * + * Protobuf type {@code tensorflow.core.platform.ErrorSourceProto} + */ + public static final class ErrorSourceProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.core.platform.ErrorSourceProto) + ErrorSourceProtoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ErrorSourceProto.class.getName()); + } + // Use ErrorSourceProto.newBuilder() to construct. + private ErrorSourceProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ErrorSourceProto() { + errorSource_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.internal_static_tensorflow_core_platform_ErrorSourceProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.class, org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.core.platform.ErrorSourceProto.ErrorSource} + */ + public enum ErrorSource + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * TPU_COMPILE_OP = 1; + */ + TPU_COMPILE_OP(1), + /** + *
    +       * Old bridge.
    +       * 
    + * + * TF_XLA_BRIDGE = 2; + */ + TF_XLA_BRIDGE(2), + /** + *
    +       * TPUBridge.
    +       * 
    + * + * MLIR_BRIDGE_PHASE_1 = 3; + */ + MLIR_BRIDGE_PHASE_1(3), + /** + *
    +       * LegalizeToHlo.
    +       * 
    + * + * MLIR_BRIDGE_PHASE_2 = 4; + */ + MLIR_BRIDGE_PHASE_2(4), + /** + *
    +       * eager::RemoteMgr.
    +       * 
    + * + * EAGER_REMOTE_MGR = 5; + */ + EAGER_REMOTE_MGR(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ErrorSource.class.getName()); + } + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * TPU_COMPILE_OP = 1; + */ + public static final int TPU_COMPILE_OP_VALUE = 1; + /** + *
    +       * Old bridge.
    +       * 
    + * + * TF_XLA_BRIDGE = 2; + */ + public static final int TF_XLA_BRIDGE_VALUE = 2; + /** + *
    +       * TPUBridge.
    +       * 
    + * + * MLIR_BRIDGE_PHASE_1 = 3; + */ + public static final int MLIR_BRIDGE_PHASE_1_VALUE = 3; + /** + *
    +       * LegalizeToHlo.
    +       * 
    + * + * MLIR_BRIDGE_PHASE_2 = 4; + */ + public static final int MLIR_BRIDGE_PHASE_2_VALUE = 4; + /** + *
    +       * eager::RemoteMgr.
    +       * 
    + * + * EAGER_REMOTE_MGR = 5; + */ + public static final int EAGER_REMOTE_MGR_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ErrorSource valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ErrorSource forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return TPU_COMPILE_OP; + case 2: return TF_XLA_BRIDGE; + case 3: return MLIR_BRIDGE_PHASE_1; + case 4: return MLIR_BRIDGE_PHASE_2; + case 5: return EAGER_REMOTE_MGR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ErrorSource> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ErrorSource findValueByNumber(int number) { + return ErrorSource.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.core.platform.CorePlatformPayloads.ErrorSourceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ErrorSource[] VALUES = values(); + + public static ErrorSource 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 ErrorSource(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.core.platform.ErrorSourceProto.ErrorSource) + } + + public static final int ERROR_SOURCE_FIELD_NUMBER = 1; + private int errorSource_ = 0; + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The enum numeric value on the wire for errorSource. + */ + @java.lang.Override public int getErrorSourceValue() { + return errorSource_; + } + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The errorSource. + */ + @java.lang.Override public org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource getErrorSource() { + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource result = org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.forNumber(errorSource_); + return result == null ? org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.UNRECOGNIZED : result; + } + + 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 (errorSource_ != org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.UNKNOWN.getNumber()) { + output.writeEnum(1, errorSource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (errorSource_ != org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, errorSource_); + } + size += getUnknownFields().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.core.platform.CorePlatformPayloads.ErrorSourceProto)) { + return super.equals(obj); + } + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto other = (org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto) obj; + + if (errorSource_ != other.errorSource_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ERROR_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + errorSource_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto 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.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto 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.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.core.platform.CorePlatformPayloads.ErrorSourceProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * If included as a payload, this message contains the error source information
    +     * where the error was raised.
    +     * URI: "type.googleapis.com/tensorflow.core.platform.ErrorSourceProto"
    +     * 
    + * + * Protobuf type {@code tensorflow.core.platform.ErrorSourceProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.core.platform.ErrorSourceProto) + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.internal_static_tensorflow_core_platform_ErrorSourceProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.class, org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.Builder.class); + } + + // Construct using org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + errorSource_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto getDefaultInstanceForType() { + return org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto build() { + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto buildPartial() { + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto result = new org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.errorSource_ = errorSource_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto) { + return mergeFrom((org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto other) { + if (other == org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.getDefaultInstance()) return this; + if (other.errorSource_ != 0) { + setErrorSourceValue(other.getErrorSourceValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + errorSource_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int errorSource_ = 0; + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The enum numeric value on the wire for errorSource. + */ + @java.lang.Override public int getErrorSourceValue() { + return errorSource_; + } + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @param value The enum numeric value on the wire for errorSource to set. + * @return This builder for chaining. + */ + public Builder setErrorSourceValue(int value) { + errorSource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return The errorSource. + */ + @java.lang.Override + public org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource getErrorSource() { + org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource result = org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.forNumber(errorSource_); + return result == null ? org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource.UNRECOGNIZED : result; + } + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @param value The errorSource to set. + * @return This builder for chaining. + */ + public Builder setErrorSource(org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto.ErrorSource value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + errorSource_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.core.platform.ErrorSourceProto.ErrorSource error_source = 1; + * @return This builder for chaining. + */ + public Builder clearErrorSource() { + bitField0_ = (bitField0_ & ~0x00000001); + errorSource_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.core.platform.ErrorSourceProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.core.platform.ErrorSourceProto) + private static final org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto(); + } + + public static org.tensorflow.proto.core.platform.CorePlatformPayloads.ErrorSourceProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorSourceProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.core.platform.CorePlatformPayloads.ErrorSourceProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_core_platform_ErrorSourceProto_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n5tensorflow/core/protobuf/core_platform" + + "_payloads.proto\022\030tensorflow.core.platfor" + + "m\"\354\001\n\020ErrorSourceProto\022L\n\014error_source\030\001" + + " \001(\01626.tensorflow.core.platform.ErrorSou" + + "rceProto.ErrorSource\"\211\001\n\013ErrorSource\022\013\n\007" + + "UNKNOWN\020\000\022\022\n\016TPU_COMPILE_OP\020\001\022\021\n\rTF_XLA_" + + "BRIDGE\020\002\022\027\n\023MLIR_BRIDGE_PHASE_1\020\003\022\027\n\023MLI" + + "R_BRIDGE_PHASE_2\020\004\022\024\n\020EAGER_REMOTE_MGR\020\005" + + "B~\n\"org.tensorflow.proto.core.platformZU" + + "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, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_core_platform_ErrorSourceProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_core_platform_ErrorSourceProto_descriptor, + new java.lang.String[] { "ErrorSource", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DataService.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DataService.java new file mode 100644 index 00000000000..1896f0356f2 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DataService.java @@ -0,0 +1,2926 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/data_service.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data; + +public final class DataService { + private DataService() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DataService.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + *
    +   * tf.data service deployment mode.
    +   * 
    + * + * Protobuf enum {@code tensorflow.data.DeploymentMode} + */ + public enum DeploymentMode + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEPLOYMENT_MODE_UNSPECIFIED = 0; + */ + DEPLOYMENT_MODE_UNSPECIFIED(0), + /** + *
    +     * tf.data service workers colocate with TF workers.
    +     * 
    + * + * DEPLOYMENT_MODE_COLOCATED = 1; + */ + DEPLOYMENT_MODE_COLOCATED(1), + /** + *
    +     * tf.data service workers run in dedicated tf.data hosts.
    +     * 
    + * + * DEPLOYMENT_MODE_REMOTE = 2; + */ + DEPLOYMENT_MODE_REMOTE(2), + /** + *
    +     * tf.data service workers run in colocated TF hosts and dedicated tf.data
    +     * hosts.
    +     * 
    + * + * DEPLOYMENT_MODE_HYBRID = 3; + */ + DEPLOYMENT_MODE_HYBRID(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DeploymentMode.class.getName()); + } + /** + * DEPLOYMENT_MODE_UNSPECIFIED = 0; + */ + public static final int DEPLOYMENT_MODE_UNSPECIFIED_VALUE = 0; + /** + *
    +     * tf.data service workers colocate with TF workers.
    +     * 
    + * + * DEPLOYMENT_MODE_COLOCATED = 1; + */ + public static final int DEPLOYMENT_MODE_COLOCATED_VALUE = 1; + /** + *
    +     * tf.data service workers run in dedicated tf.data hosts.
    +     * 
    + * + * DEPLOYMENT_MODE_REMOTE = 2; + */ + public static final int DEPLOYMENT_MODE_REMOTE_VALUE = 2; + /** + *
    +     * tf.data service workers run in colocated TF hosts and dedicated tf.data
    +     * hosts.
    +     * 
    + * + * DEPLOYMENT_MODE_HYBRID = 3; + */ + public static final int DEPLOYMENT_MODE_HYBRID_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DeploymentMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DeploymentMode forNumber(int value) { + switch (value) { + case 0: return DEPLOYMENT_MODE_UNSPECIFIED; + case 1: return DEPLOYMENT_MODE_COLOCATED; + case 2: return DEPLOYMENT_MODE_REMOTE; + case 3: return DEPLOYMENT_MODE_HYBRID; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + DeploymentMode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DeploymentMode findValueByNumber(int number) { + return DeploymentMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DataService.getDescriptor().getEnumTypes().get(0); + } + + private static final DeploymentMode[] VALUES = values(); + + public static DeploymentMode 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 DeploymentMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.DeploymentMode) + } + + public interface ProcessingModeDefOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.ProcessingModeDef) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The enum numeric value on the wire for shardingPolicy. + */ + int getShardingPolicyValue(); + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The shardingPolicy. + */ + org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy getShardingPolicy(); + } + /** + *
    +   * Next tag: 2
    +   * 
    + * + * Protobuf type {@code tensorflow.data.ProcessingModeDef} + */ + public static final class ProcessingModeDef extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.ProcessingModeDef) + ProcessingModeDefOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ProcessingModeDef.class.getName()); + } + // Use ProcessingModeDef.newBuilder() to construct. + private ProcessingModeDef(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ProcessingModeDef() { + shardingPolicy_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_ProcessingModeDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_ProcessingModeDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.ProcessingModeDef.class, org.tensorflow.proto.data.DataService.ProcessingModeDef.Builder.class); + } + + /** + *
    +     * Specifies how data is sharded among tf.data service workers.
    +     * 
    + * + * Protobuf enum {@code tensorflow.data.ProcessingModeDef.ShardingPolicy} + */ + public enum ShardingPolicy + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +       * No sharding will be performed. Each worker produces the entire dataset
    +       * without any sharding. With this mode, the best practice is to shuffle the
    +       * dataset nondeterministically so that workers process the dataset in
    +       * different orders.
    +       * 
    + * + * OFF = 0; + */ + OFF(0), + /** + *
    +       * The input dataset is dynamically split among workers at runtime. Each
    +       * worker gets the next split when it reads data from the dispatcher. There
    +       * is no fixed sharding with this mode.
    +       * 
    + * + * DYNAMIC = 1; + */ + DYNAMIC(1), + /** + *
    +       * The following are static sharding policies. The semantics are similar to
    +       * `tf.data.experimental.AutoShardPolicy`. These policies require:
    +       * * The tf.data service cluster has a fixed size, and you need to specify
    +       * the workers in DispatcherConfig.
    +       * * Each client only reads from the local tf.data service worker.
    +       *
    +       * Shards by input files (each worker will get a set of files to process).
    +       * When this option is selected, make sure that there is at least as many
    +       * files as workers. If there are fewer input files than workers, a runtime
    +       * error will be raised.
    +       * 
    + * + * FILE = 2; + */ + FILE(2), + /** + *
    +       * Shards by elements produced by the dataset. Each worker will process the
    +       * whole dataset and discard the portion that is not for itself. Note that
    +       * for this mode to correctly partitions the dataset elements, the dataset
    +       * needs to produce elements in a deterministic order.
    +       * 
    + * + * DATA = 3; + */ + DATA(3), + /** + *
    +       * Attempts FILE-based sharding, falling back to DATA-based sharding on
    +       * failures.
    +       * 
    + * + * FILE_OR_DATA = 4; + */ + FILE_OR_DATA(4), + /** + *
    +       * Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a
    +       * placeholder to replace with `shard(num_workers, worker_index)`.
    +       * 
    + * + * HINT = 5; + */ + HINT(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ShardingPolicy.class.getName()); + } + /** + *
    +       * No sharding will be performed. Each worker produces the entire dataset
    +       * without any sharding. With this mode, the best practice is to shuffle the
    +       * dataset nondeterministically so that workers process the dataset in
    +       * different orders.
    +       * 
    + * + * OFF = 0; + */ + public static final int OFF_VALUE = 0; + /** + *
    +       * The input dataset is dynamically split among workers at runtime. Each
    +       * worker gets the next split when it reads data from the dispatcher. There
    +       * is no fixed sharding with this mode.
    +       * 
    + * + * DYNAMIC = 1; + */ + public static final int DYNAMIC_VALUE = 1; + /** + *
    +       * The following are static sharding policies. The semantics are similar to
    +       * `tf.data.experimental.AutoShardPolicy`. These policies require:
    +       * * The tf.data service cluster has a fixed size, and you need to specify
    +       * the workers in DispatcherConfig.
    +       * * Each client only reads from the local tf.data service worker.
    +       *
    +       * Shards by input files (each worker will get a set of files to process).
    +       * When this option is selected, make sure that there is at least as many
    +       * files as workers. If there are fewer input files than workers, a runtime
    +       * error will be raised.
    +       * 
    + * + * FILE = 2; + */ + public static final int FILE_VALUE = 2; + /** + *
    +       * Shards by elements produced by the dataset. Each worker will process the
    +       * whole dataset and discard the portion that is not for itself. Note that
    +       * for this mode to correctly partitions the dataset elements, the dataset
    +       * needs to produce elements in a deterministic order.
    +       * 
    + * + * DATA = 3; + */ + public static final int DATA_VALUE = 3; + /** + *
    +       * Attempts FILE-based sharding, falling back to DATA-based sharding on
    +       * failures.
    +       * 
    + * + * FILE_OR_DATA = 4; + */ + public static final int FILE_OR_DATA_VALUE = 4; + /** + *
    +       * Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a
    +       * placeholder to replace with `shard(num_workers, worker_index)`.
    +       * 
    + * + * HINT = 5; + */ + public static final int HINT_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ShardingPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ShardingPolicy forNumber(int value) { + switch (value) { + case 0: return OFF; + case 1: return DYNAMIC; + case 2: return FILE; + case 3: return DATA; + case 4: return FILE_OR_DATA; + case 5: return HINT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ShardingPolicy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ShardingPolicy findValueByNumber(int number) { + return ShardingPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DataService.ProcessingModeDef.getDescriptor().getEnumTypes().get(0); + } + + private static final ShardingPolicy[] VALUES = values(); + + public static ShardingPolicy 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 ShardingPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.ProcessingModeDef.ShardingPolicy) + } + + public static final int SHARDING_POLICY_FIELD_NUMBER = 1; + private int shardingPolicy_ = 0; + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The enum numeric value on the wire for shardingPolicy. + */ + @java.lang.Override public int getShardingPolicyValue() { + return shardingPolicy_; + } + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The shardingPolicy. + */ + @java.lang.Override public org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy getShardingPolicy() { + org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy result = org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.forNumber(shardingPolicy_); + return result == null ? org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.UNRECOGNIZED : result; + } + + 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 (shardingPolicy_ != org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.OFF.getNumber()) { + output.writeEnum(1, shardingPolicy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (shardingPolicy_ != org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.OFF.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, shardingPolicy_); + } + size += getUnknownFields().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.DataService.ProcessingModeDef)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DataService.ProcessingModeDef other = (org.tensorflow.proto.data.DataService.ProcessingModeDef) obj; + + if (shardingPolicy_ != other.shardingPolicy_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SHARDING_POLICY_FIELD_NUMBER; + hash = (53 * hash) + shardingPolicy_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef 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.DataService.ProcessingModeDef parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef 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.DataService.ProcessingModeDef parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.ProcessingModeDef parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DataService.ProcessingModeDef 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Next tag: 2
    +     * 
    + * + * Protobuf type {@code tensorflow.data.ProcessingModeDef} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.ProcessingModeDef) + org.tensorflow.proto.data.DataService.ProcessingModeDefOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_ProcessingModeDef_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_ProcessingModeDef_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.ProcessingModeDef.class, org.tensorflow.proto.data.DataService.ProcessingModeDef.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DataService.ProcessingModeDef.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + shardingPolicy_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_ProcessingModeDef_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.ProcessingModeDef getDefaultInstanceForType() { + return org.tensorflow.proto.data.DataService.ProcessingModeDef.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.ProcessingModeDef build() { + org.tensorflow.proto.data.DataService.ProcessingModeDef result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.ProcessingModeDef buildPartial() { + org.tensorflow.proto.data.DataService.ProcessingModeDef result = new org.tensorflow.proto.data.DataService.ProcessingModeDef(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DataService.ProcessingModeDef result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.shardingPolicy_ = shardingPolicy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DataService.ProcessingModeDef) { + return mergeFrom((org.tensorflow.proto.data.DataService.ProcessingModeDef)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DataService.ProcessingModeDef other) { + if (other == org.tensorflow.proto.data.DataService.ProcessingModeDef.getDefaultInstance()) return this; + if (other.shardingPolicy_ != 0) { + setShardingPolicyValue(other.getShardingPolicyValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + shardingPolicy_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int shardingPolicy_ = 0; + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The enum numeric value on the wire for shardingPolicy. + */ + @java.lang.Override public int getShardingPolicyValue() { + return shardingPolicy_; + } + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @param value The enum numeric value on the wire for shardingPolicy to set. + * @return This builder for chaining. + */ + public Builder setShardingPolicyValue(int value) { + shardingPolicy_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return The shardingPolicy. + */ + @java.lang.Override + public org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy getShardingPolicy() { + org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy result = org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.forNumber(shardingPolicy_); + return result == null ? org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy.UNRECOGNIZED : result; + } + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @param value The shardingPolicy to set. + * @return This builder for chaining. + */ + public Builder setShardingPolicy(org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + shardingPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.ProcessingModeDef.ShardingPolicy sharding_policy = 1; + * @return This builder for chaining. + */ + public Builder clearShardingPolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + shardingPolicy_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.ProcessingModeDef) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.ProcessingModeDef) + private static final org.tensorflow.proto.data.DataService.ProcessingModeDef DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DataService.ProcessingModeDef(); + } + + public static org.tensorflow.proto.data.DataService.ProcessingModeDef getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProcessingModeDef parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DataService.ProcessingModeDef getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DataServiceMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.DataServiceMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Serialized element spec.
    +     * 
    + * + * bytes element_spec = 1; + * @return Whether the elementSpec field is set. + */ + boolean hasElementSpec(); + /** + *
    +     * Serialized element spec.
    +     * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + com.google.protobuf.ByteString getElementSpec(); + + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The enum numeric value on the wire for compression. + */ + int getCompressionValue(); + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The compression. + */ + org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression getCompression(); + + /** + *
    +     * Cardinality of the dataset.
    +     * 
    + * + * int64 cardinality = 3; + * @return The cardinality. + */ + long getCardinality(); + + org.tensorflow.proto.data.DataService.DataServiceMetadata.OptionalElementSpecCase getOptionalElementSpecCase(); + } + /** + *
    +   * Metadata related to tf.data service datasets.
    +   * Next tag: 4
    +   * 
    + * + * Protobuf type {@code tensorflow.data.DataServiceMetadata} + */ + public static final class DataServiceMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.DataServiceMetadata) + DataServiceMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DataServiceMetadata.class.getName()); + } + // Use DataServiceMetadata.newBuilder() to construct. + private DataServiceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DataServiceMetadata() { + compression_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.DataServiceMetadata.class, org.tensorflow.proto.data.DataService.DataServiceMetadata.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.data.DataServiceMetadata.Compression} + */ + public enum Compression + implements com.google.protobuf.ProtocolMessageEnum { + /** + * COMPRESSION_UNSPECIFIED = 0; + */ + COMPRESSION_UNSPECIFIED(0), + /** + *
    +       * No compression.
    +       * 
    + * + * COMPRESSION_OFF = 1; + */ + COMPRESSION_OFF(1), + /** + *
    +       * AUTO compression, either none or snappy compression as defined in
    +       * tensorflow/core/platform/snappy.h.
    +       * 
    + * + * COMPRESSION_SNAPPY = 2; + */ + COMPRESSION_SNAPPY(2), + /** + *
    +       * Forced a snappy compression as in tensorflow/core/platform/snappy.h.
    +       * 
    + * + * COMPRESSION_FORCED_SNAPPY = 3; + */ + COMPRESSION_FORCED_SNAPPY(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Compression.class.getName()); + } + /** + * COMPRESSION_UNSPECIFIED = 0; + */ + public static final int COMPRESSION_UNSPECIFIED_VALUE = 0; + /** + *
    +       * No compression.
    +       * 
    + * + * COMPRESSION_OFF = 1; + */ + public static final int COMPRESSION_OFF_VALUE = 1; + /** + *
    +       * AUTO compression, either none or snappy compression as defined in
    +       * tensorflow/core/platform/snappy.h.
    +       * 
    + * + * COMPRESSION_SNAPPY = 2; + */ + public static final int COMPRESSION_SNAPPY_VALUE = 2; + /** + *
    +       * Forced a snappy compression as in tensorflow/core/platform/snappy.h.
    +       * 
    + * + * COMPRESSION_FORCED_SNAPPY = 3; + */ + public static final int COMPRESSION_FORCED_SNAPPY_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Compression valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Compression forNumber(int value) { + switch (value) { + case 0: return COMPRESSION_UNSPECIFIED; + case 1: return COMPRESSION_OFF; + case 2: return COMPRESSION_SNAPPY; + case 3: return COMPRESSION_FORCED_SNAPPY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Compression> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Compression findValueByNumber(int number) { + return Compression.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DataService.DataServiceMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final Compression[] VALUES = values(); + + public static Compression 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 Compression(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.DataServiceMetadata.Compression) + } + + private int optionalElementSpecCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalElementSpec_; + public enum OptionalElementSpecCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ELEMENT_SPEC(1), + OPTIONALELEMENTSPEC_NOT_SET(0); + private final int value; + private OptionalElementSpecCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalElementSpecCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalElementSpecCase forNumber(int value) { + switch (value) { + case 1: return ELEMENT_SPEC; + case 0: return OPTIONALELEMENTSPEC_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalElementSpecCase + getOptionalElementSpecCase() { + return OptionalElementSpecCase.forNumber( + optionalElementSpecCase_); + } + + public static final int ELEMENT_SPEC_FIELD_NUMBER = 1; + /** + *
    +     * Serialized element spec.
    +     * 
    + * + * bytes element_spec = 1; + * @return Whether the elementSpec field is set. + */ + @java.lang.Override + public boolean hasElementSpec() { + return optionalElementSpecCase_ == 1; + } + /** + *
    +     * Serialized element spec.
    +     * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + @java.lang.Override + public com.google.protobuf.ByteString getElementSpec() { + if (optionalElementSpecCase_ == 1) { + return (com.google.protobuf.ByteString) optionalElementSpec_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int COMPRESSION_FIELD_NUMBER = 2; + private int compression_ = 0; + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The enum numeric value on the wire for compression. + */ + @java.lang.Override public int getCompressionValue() { + return compression_; + } + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The compression. + */ + @java.lang.Override public org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression getCompression() { + org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression result = org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.forNumber(compression_); + return result == null ? org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.UNRECOGNIZED : result; + } + + public static final int CARDINALITY_FIELD_NUMBER = 3; + private long cardinality_ = 0L; + /** + *
    +     * Cardinality of the dataset.
    +     * 
    + * + * int64 cardinality = 3; + * @return The cardinality. + */ + @java.lang.Override + public long getCardinality() { + return cardinality_; + } + + 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 (optionalElementSpecCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) optionalElementSpec_); + } + if (compression_ != org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.COMPRESSION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, compression_); + } + if (cardinality_ != 0L) { + output.writeInt64(3, cardinality_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalElementSpecCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) optionalElementSpec_); + } + if (compression_ != org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.COMPRESSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, compression_); + } + if (cardinality_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, cardinality_); + } + size += getUnknownFields().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.DataService.DataServiceMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DataService.DataServiceMetadata other = (org.tensorflow.proto.data.DataService.DataServiceMetadata) obj; + + if (compression_ != other.compression_) return false; + if (getCardinality() + != other.getCardinality()) return false; + if (!getOptionalElementSpecCase().equals(other.getOptionalElementSpecCase())) return false; + switch (optionalElementSpecCase_) { + case 1: + if (!getElementSpec() + .equals(other.getElementSpec())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + COMPRESSION_FIELD_NUMBER; + hash = (53 * hash) + compression_; + hash = (37 * hash) + CARDINALITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCardinality()); + switch (optionalElementSpecCase_) { + case 1: + hash = (37 * hash) + ELEMENT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getElementSpec().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata 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.DataService.DataServiceMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata 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.DataService.DataServiceMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.DataServiceMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DataService.DataServiceMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata related to tf.data service datasets.
    +     * Next tag: 4
    +     * 
    + * + * Protobuf type {@code tensorflow.data.DataServiceMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.DataServiceMetadata) + org.tensorflow.proto.data.DataService.DataServiceMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.DataServiceMetadata.class, org.tensorflow.proto.data.DataService.DataServiceMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DataService.DataServiceMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + compression_ = 0; + cardinality_ = 0L; + optionalElementSpecCase_ = 0; + optionalElementSpec_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.DataService.DataServiceMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceMetadata build() { + org.tensorflow.proto.data.DataService.DataServiceMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceMetadata buildPartial() { + org.tensorflow.proto.data.DataService.DataServiceMetadata result = new org.tensorflow.proto.data.DataService.DataServiceMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DataService.DataServiceMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.compression_ = compression_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cardinality_ = cardinality_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DataService.DataServiceMetadata result) { + result.optionalElementSpecCase_ = optionalElementSpecCase_; + result.optionalElementSpec_ = this.optionalElementSpec_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DataService.DataServiceMetadata) { + return mergeFrom((org.tensorflow.proto.data.DataService.DataServiceMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DataService.DataServiceMetadata other) { + if (other == org.tensorflow.proto.data.DataService.DataServiceMetadata.getDefaultInstance()) return this; + if (other.compression_ != 0) { + setCompressionValue(other.getCompressionValue()); + } + if (other.getCardinality() != 0L) { + setCardinality(other.getCardinality()); + } + switch (other.getOptionalElementSpecCase()) { + case ELEMENT_SPEC: { + setElementSpec(other.getElementSpec()); + break; + } + case OPTIONALELEMENTSPEC_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + optionalElementSpec_ = input.readBytes(); + optionalElementSpecCase_ = 1; + break; + } // case 10 + case 16: { + compression_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + cardinality_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalElementSpecCase_ = 0; + private java.lang.Object optionalElementSpec_; + public OptionalElementSpecCase + getOptionalElementSpecCase() { + return OptionalElementSpecCase.forNumber( + optionalElementSpecCase_); + } + + public Builder clearOptionalElementSpec() { + optionalElementSpecCase_ = 0; + optionalElementSpec_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + *
    +       * Serialized element spec.
    +       * 
    + * + * bytes element_spec = 1; + * @return Whether the elementSpec field is set. + */ + public boolean hasElementSpec() { + return optionalElementSpecCase_ == 1; + } + /** + *
    +       * Serialized element spec.
    +       * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + public com.google.protobuf.ByteString getElementSpec() { + if (optionalElementSpecCase_ == 1) { + return (com.google.protobuf.ByteString) optionalElementSpec_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
    +       * Serialized element spec.
    +       * 
    + * + * bytes element_spec = 1; + * @param value The elementSpec to set. + * @return This builder for chaining. + */ + public Builder setElementSpec(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + optionalElementSpecCase_ = 1; + optionalElementSpec_ = value; + onChanged(); + return this; + } + /** + *
    +       * Serialized element spec.
    +       * 
    + * + * bytes element_spec = 1; + * @return This builder for chaining. + */ + public Builder clearElementSpec() { + if (optionalElementSpecCase_ == 1) { + optionalElementSpecCase_ = 0; + optionalElementSpec_ = null; + onChanged(); + } + return this; + } + + private int compression_ = 0; + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The enum numeric value on the wire for compression. + */ + @java.lang.Override public int getCompressionValue() { + return compression_; + } + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @param value The enum numeric value on the wire for compression to set. + * @return This builder for chaining. + */ + public Builder setCompressionValue(int value) { + compression_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return The compression. + */ + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression getCompression() { + org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression result = org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.forNumber(compression_); + return result == null ? org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression.UNRECOGNIZED : result; + } + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @param value The compression to set. + * @return This builder for chaining. + */ + public Builder setCompression(org.tensorflow.proto.data.DataService.DataServiceMetadata.Compression value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + compression_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.DataServiceMetadata.Compression compression = 2; + * @return This builder for chaining. + */ + public Builder clearCompression() { + bitField0_ = (bitField0_ & ~0x00000002); + compression_ = 0; + onChanged(); + return this; + } + + private long cardinality_ ; + /** + *
    +       * Cardinality of the dataset.
    +       * 
    + * + * int64 cardinality = 3; + * @return The cardinality. + */ + @java.lang.Override + public long getCardinality() { + return cardinality_; + } + /** + *
    +       * Cardinality of the dataset.
    +       * 
    + * + * int64 cardinality = 3; + * @param value The cardinality to set. + * @return This builder for chaining. + */ + public Builder setCardinality(long value) { + + cardinality_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Cardinality of the dataset.
    +       * 
    + * + * int64 cardinality = 3; + * @return This builder for chaining. + */ + public Builder clearCardinality() { + bitField0_ = (bitField0_ & ~0x00000004); + cardinality_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.DataServiceMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.DataServiceMetadata) + private static final org.tensorflow.proto.data.DataService.DataServiceMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DataService.DataServiceMetadata(); + } + + public static org.tensorflow.proto.data.DataService.DataServiceMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataServiceMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DataService.DataServiceMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CrossTrainerCacheOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.CrossTrainerCacheOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * string trainer_id = 1; + * @return The trainerId. + */ + java.lang.String getTrainerId(); + /** + * string trainer_id = 1; + * @return The bytes for trainerId. + */ + com.google.protobuf.ByteString + getTrainerIdBytes(); + } + /** + * Protobuf type {@code tensorflow.data.CrossTrainerCacheOptions} + */ + public static final class CrossTrainerCacheOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.CrossTrainerCacheOptions) + CrossTrainerCacheOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CrossTrainerCacheOptions.class.getName()); + } + // Use CrossTrainerCacheOptions.newBuilder() to construct. + private CrossTrainerCacheOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CrossTrainerCacheOptions() { + trainerId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_CrossTrainerCacheOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.class, org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.Builder.class); + } + + public static final int TRAINER_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object trainerId_ = ""; + /** + * string trainer_id = 1; + * @return The trainerId. + */ + @java.lang.Override + public java.lang.String getTrainerId() { + java.lang.Object ref = trainerId_; + 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(); + trainerId_ = s; + return s; + } + } + /** + * string trainer_id = 1; + * @return The bytes for trainerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTrainerIdBytes() { + java.lang.Object ref = trainerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trainerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(trainerId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, trainerId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(trainerId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, trainerId_); + } + size += getUnknownFields().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.DataService.CrossTrainerCacheOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions other = (org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions) obj; + + if (!getTrainerId() + .equals(other.getTrainerId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TRAINER_ID_FIELD_NUMBER; + hash = (53 * hash) + getTrainerId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions 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.DataService.CrossTrainerCacheOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions 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.DataService.CrossTrainerCacheOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DataService.CrossTrainerCacheOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.data.CrossTrainerCacheOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.CrossTrainerCacheOptions) + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_CrossTrainerCacheOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.class, org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + trainerId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions build() { + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions buildPartial() { + org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions result = new org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.trainerId_ = trainerId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions) { + return mergeFrom((org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions other) { + if (other == org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions.getDefaultInstance()) return this; + if (!other.getTrainerId().isEmpty()) { + trainerId_ = other.trainerId_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + trainerId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object trainerId_ = ""; + /** + * string trainer_id = 1; + * @return The trainerId. + */ + public java.lang.String getTrainerId() { + java.lang.Object ref = trainerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trainerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string trainer_id = 1; + * @return The bytes for trainerId. + */ + public com.google.protobuf.ByteString + getTrainerIdBytes() { + java.lang.Object ref = trainerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trainerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string trainer_id = 1; + * @param value The trainerId to set. + * @return This builder for chaining. + */ + public Builder setTrainerId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + trainerId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string trainer_id = 1; + * @return This builder for chaining. + */ + public Builder clearTrainerId() { + trainerId_ = getDefaultInstance().getTrainerId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string trainer_id = 1; + * @param value The bytes for trainerId to set. + * @return This builder for chaining. + */ + public Builder setTrainerIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + trainerId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.CrossTrainerCacheOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.CrossTrainerCacheOptions) + private static final org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions(); + } + + public static org.tensorflow.proto.data.DataService.CrossTrainerCacheOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CrossTrainerCacheOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DataService.CrossTrainerCacheOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DataServiceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.DataServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The enum numeric value on the wire for deploymentMode. + */ + int getDeploymentModeValue(); + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The deploymentMode. + */ + org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode(); + } + /** + *
    +   * Data service config available to the client through GetDataServiceConfig RPC.
    +   * Next tag: 2
    +   * 
    + * + * Protobuf type {@code tensorflow.data.DataServiceConfig} + */ + public static final class DataServiceConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.DataServiceConfig) + DataServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DataServiceConfig.class.getName()); + } + // Use DataServiceConfig.newBuilder() to construct. + private DataServiceConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DataServiceConfig() { + deploymentMode_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.DataServiceConfig.class, org.tensorflow.proto.data.DataService.DataServiceConfig.Builder.class); + } + + public static final int DEPLOYMENT_MODE_FIELD_NUMBER = 1; + private int deploymentMode_ = 0; + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The enum numeric value on the wire for deploymentMode. + */ + @java.lang.Override public int getDeploymentModeValue() { + return deploymentMode_; + } + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The deploymentMode. + */ + @java.lang.Override public org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode() { + org.tensorflow.proto.data.DataService.DeploymentMode result = org.tensorflow.proto.data.DataService.DeploymentMode.forNumber(deploymentMode_); + return result == null ? org.tensorflow.proto.data.DataService.DeploymentMode.UNRECOGNIZED : result; + } + + 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 (deploymentMode_ != org.tensorflow.proto.data.DataService.DeploymentMode.DEPLOYMENT_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, deploymentMode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deploymentMode_ != org.tensorflow.proto.data.DataService.DeploymentMode.DEPLOYMENT_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, deploymentMode_); + } + size += getUnknownFields().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.DataService.DataServiceConfig)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DataService.DataServiceConfig other = (org.tensorflow.proto.data.DataService.DataServiceConfig) obj; + + if (deploymentMode_ != other.deploymentMode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DEPLOYMENT_MODE_FIELD_NUMBER; + hash = (53 * hash) + deploymentMode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig 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.DataService.DataServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig 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.DataService.DataServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DataService.DataServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DataService.DataServiceConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Data service config available to the client through GetDataServiceConfig RPC.
    +     * Next tag: 2
    +     * 
    + * + * Protobuf type {@code tensorflow.data.DataServiceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.DataServiceConfig) + org.tensorflow.proto.data.DataService.DataServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DataService.DataServiceConfig.class, org.tensorflow.proto.data.DataService.DataServiceConfig.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DataService.DataServiceConfig.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + deploymentMode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DataService.internal_static_tensorflow_data_DataServiceConfig_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceConfig getDefaultInstanceForType() { + return org.tensorflow.proto.data.DataService.DataServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceConfig build() { + org.tensorflow.proto.data.DataService.DataServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DataService.DataServiceConfig buildPartial() { + org.tensorflow.proto.data.DataService.DataServiceConfig result = new org.tensorflow.proto.data.DataService.DataServiceConfig(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DataService.DataServiceConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.deploymentMode_ = deploymentMode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DataService.DataServiceConfig) { + return mergeFrom((org.tensorflow.proto.data.DataService.DataServiceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DataService.DataServiceConfig other) { + if (other == org.tensorflow.proto.data.DataService.DataServiceConfig.getDefaultInstance()) return this; + if (other.deploymentMode_ != 0) { + setDeploymentModeValue(other.getDeploymentModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + deploymentMode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int deploymentMode_ = 0; + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The enum numeric value on the wire for deploymentMode. + */ + @java.lang.Override public int getDeploymentModeValue() { + return deploymentMode_; + } + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @param value The enum numeric value on the wire for deploymentMode to set. + * @return This builder for chaining. + */ + public Builder setDeploymentModeValue(int value) { + deploymentMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return The deploymentMode. + */ + @java.lang.Override + public org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode() { + org.tensorflow.proto.data.DataService.DeploymentMode result = org.tensorflow.proto.data.DataService.DeploymentMode.forNumber(deploymentMode_); + return result == null ? org.tensorflow.proto.data.DataService.DeploymentMode.UNRECOGNIZED : result; + } + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @param value The deploymentMode to set. + * @return This builder for chaining. + */ + public Builder setDeploymentMode(org.tensorflow.proto.data.DataService.DeploymentMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + deploymentMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.DeploymentMode deployment_mode = 1; + * @return This builder for chaining. + */ + public Builder clearDeploymentMode() { + bitField0_ = (bitField0_ & ~0x00000001); + deploymentMode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.DataServiceConfig) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.DataServiceConfig) + private static final org.tensorflow.proto.data.DataService.DataServiceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DataService.DataServiceConfig(); + } + + public static org.tensorflow.proto.data.DataService.DataServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DataService.DataServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_ProcessingModeDef_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_ProcessingModeDef_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_DataServiceMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_DataServiceMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_CrossTrainerCacheOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_DataServiceConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_DataServiceConfig_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_service." + + "proto\022\017tensorflow.data\"\267\001\n\021ProcessingMod" + + "eDef\022J\n\017sharding_policy\030\001 \001(\01621.tensorfl" + + "ow.data.ProcessingModeDef.ShardingPolicy" + + "\"V\n\016ShardingPolicy\022\007\n\003OFF\020\000\022\013\n\007DYNAMIC\020\001" + + "\022\010\n\004FILE\020\002\022\010\n\004DATA\020\003\022\020\n\014FILE_OR_DATA\020\004\022\010" + + "\n\004HINT\020\005\"\232\002\n\023DataServiceMetadata\022\026\n\014elem" + + "ent_spec\030\001 \001(\014H\000\022E\n\013compression\030\002 \001(\01620." + + "tensorflow.data.DataServiceMetadata.Comp" + + "ression\022\023\n\013cardinality\030\003 \001(\003\"v\n\013Compress" + + "ion\022\033\n\027COMPRESSION_UNSPECIFIED\020\000\022\023\n\017COMP" + + "RESSION_OFF\020\001\022\026\n\022COMPRESSION_SNAPPY\020\002\022\035\n" + + "\031COMPRESSION_FORCED_SNAPPY\020\003B\027\n\025optional" + + "_element_spec\".\n\030CrossTrainerCacheOption" + + "s\022\022\n\ntrainer_id\030\001 \001(\t\"M\n\021DataServiceConf" + + "ig\0228\n\017deployment_mode\030\001 \001(\0162\037.tensorflow" + + ".data.DeploymentMode*\210\001\n\016DeploymentMode\022" + + "\037\n\033DEPLOYMENT_MODE_UNSPECIFIED\020\000\022\035\n\031DEPL" + + "OYMENT_MODE_COLOCATED\020\001\022\032\n\026DEPLOYMENT_MO" + + "DE_REMOTE\020\002\022\032\n\026DEPLOYMENT_MODE_HYBRID\020\003B" + + "r\n\031org.tensorflow.proto.dataZUgithub.com" + + "/tensorflow/tensorflow/tensorflow/go/cor" + + "e/protobuf/for_core_protos_go_protob\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_data_ProcessingModeDef_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_ProcessingModeDef_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_ProcessingModeDef_descriptor, + new java.lang.String[] { "ShardingPolicy", }); + internal_static_tensorflow_data_DataServiceMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_DataServiceMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_DataServiceMetadata_descriptor, + new java.lang.String[] { "ElementSpec", "Compression", "Cardinality", "OptionalElementSpec", }); + internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_data_CrossTrainerCacheOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_CrossTrainerCacheOptions_descriptor, + new java.lang.String[] { "TrainerId", }); + internal_static_tensorflow_data_DataServiceConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_data_DataServiceConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_DataServiceConfig_descriptor, + new java.lang.String[] { "DeploymentMode", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/Dataset.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/Dataset.java new file mode 100644 index 00000000000..c381a210b70 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/Dataset.java @@ -0,0 +1,2980 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/dataset.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data; + +public final class Dataset { + private Dataset() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Dataset.class.getName()); + } + 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 CompressedComponentMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.CompressedComponentMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The dtype of the component tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + int getDtypeValue(); + /** + *
    +     * The dtype of the component tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + org.tensorflow.proto.DataType getDtype(); + + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + boolean hasTensorShape(); + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + org.tensorflow.proto.TensorShapeProto getTensorShape(); + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); + + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return A list containing the uncompressedBytes. + */ + java.util.List getUncompressedBytesList(); + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return The count of uncompressedBytes. + */ + int getUncompressedBytesCount(); + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param index The index of the element to return. + * @return The uncompressedBytes at the given index. + */ + long getUncompressedBytes(int index); + } + /** + *
    +   * Metadata describing a compressed component of a dataset element.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.CompressedComponentMetadata} + */ + public static final class CompressedComponentMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.CompressedComponentMetadata) + CompressedComponentMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CompressedComponentMetadata.class.getName()); + } + // Use CompressedComponentMetadata.newBuilder() to construct. + private CompressedComponentMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CompressedComponentMetadata() { + dtype_ = 0; + uncompressedBytes_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedComponentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedComponentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.class, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder.class); + } + + private int bitField0_; + public static final int DTYPE_FIELD_NUMBER = 1; + private int dtype_ = 0; + /** + *
    +     * The dtype of the component tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * The dtype of the component tensor.
    +     * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto tensorShape_; + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + @java.lang.Override + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + /** + *
    +     * The shape of the component tensor.
    +     * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + + public static final int UNCOMPRESSED_BYTES_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList uncompressedBytes_ = + emptyLongList(); + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return A list containing the uncompressedBytes. + */ + @java.lang.Override + public java.util.List + getUncompressedBytesList() { + return uncompressedBytes_; + } + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return The count of uncompressedBytes. + */ + public int getUncompressedBytesCount() { + return uncompressedBytes_.size(); + } + /** + *
    +     * The amount of uncompressed tensor data.
    +     * - For string tensors, there is an element for each string indicating the
    +     * size of the string.
    +     * - For all other tensors, there is a single element indicating the size of
    +     * the tensor.
    +     * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param index The index of the element to return. + * @return The uncompressedBytes at the given index. + */ + public long getUncompressedBytes(int index) { + return uncompressedBytes_.getLong(index); + } + private int uncompressedBytesMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTensorShape()); + } + if (getUncompressedBytesList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(uncompressedBytesMemoizedSerializedSize); + } + for (int i = 0; i < uncompressedBytes_.size(); i++) { + output.writeUInt64NoTag(uncompressedBytes_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, dtype_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTensorShape()); + } + { + int dataSize = 0; + for (int i = 0; i < uncompressedBytes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(uncompressedBytes_.getLong(i)); + } + size += dataSize; + if (!getUncompressedBytesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + uncompressedBytesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.Dataset.CompressedComponentMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata other = (org.tensorflow.proto.data.Dataset.CompressedComponentMetadata) obj; + + if (dtype_ != other.dtype_) return false; + if (hasTensorShape() != other.hasTensorShape()) return false; + if (hasTensorShape()) { + if (!getTensorShape() + .equals(other.getTensorShape())) return false; + } + if (!getUncompressedBytesList() + .equals(other.getUncompressedBytesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (hasTensorShape()) { + hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getTensorShape().hashCode(); + } + if (getUncompressedBytesCount() > 0) { + hash = (37 * hash) + UNCOMPRESSED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getUncompressedBytesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata 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.Dataset.CompressedComponentMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata 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.Dataset.CompressedComponentMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Dataset.CompressedComponentMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata describing a compressed component of a dataset element.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.CompressedComponentMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.CompressedComponentMetadata) + org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedComponentMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedComponentMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.class, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dtype_ = 0; + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + uncompressedBytes_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedComponentMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata build() { + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata buildPartial() { + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata result = new org.tensorflow.proto.data.Dataset.CompressedComponentMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.Dataset.CompressedComponentMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dtype_ = dtype_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tensorShape_ = tensorShapeBuilder_ == null + ? tensorShape_ + : tensorShapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + uncompressedBytes_.makeImmutable(); + result.uncompressedBytes_ = uncompressedBytes_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.Dataset.CompressedComponentMetadata) { + return mergeFrom((org.tensorflow.proto.data.Dataset.CompressedComponentMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.Dataset.CompressedComponentMetadata other) { + if (other == org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.getDefaultInstance()) return this; + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (other.hasTensorShape()) { + mergeTensorShape(other.getTensorShape()); + } + if (!other.uncompressedBytes_.isEmpty()) { + if (uncompressedBytes_.isEmpty()) { + uncompressedBytes_ = other.uncompressedBytes_; + uncompressedBytes_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureUncompressedBytesIsMutable(); + uncompressedBytes_.addAll(other.uncompressedBytes_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getTensorShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: { + long v = input.readUInt64(); + ensureUncompressedBytesIsMutable(); + uncompressedBytes_.addLong(v); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureUncompressedBytesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + uncompressedBytes_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int dtype_ = 0; + /** + *
    +       * The dtype of the component tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +       * The dtype of the component tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The dtype of the component tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +       * The dtype of the component tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * The dtype of the component tensor.
    +       * 
    + * + * .tensorflow.DataType dtype = 1; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000001); + dtype_ = 0; + onChanged(); + return this; + } + + private org.tensorflow.proto.TensorShapeProto tensorShape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> tensorShapeBuilder_; + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + if (tensorShapeBuilder_ == null) { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } else { + return tensorShapeBuilder_.getMessage(); + } + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorShape_ = value; + } else { + tensorShapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (tensorShapeBuilder_ == null) { + tensorShape_ = builderForValue.build(); + } else { + tensorShapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder mergeTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + tensorShape_ != null && + tensorShape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getTensorShapeBuilder().mergeFrom(value); + } else { + tensorShape_ = value; + } + } else { + tensorShapeBuilder_.mergeFrom(value); + } + if (tensorShape_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder clearTensorShape() { + bitField0_ = (bitField0_ & ~0x00000002); + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getTensorShapeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTensorShapeFieldBuilder().getBuilder(); + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + if (tensorShapeBuilder_ != null) { + return tensorShapeBuilder_.getMessageOrBuilder(); + } else { + return tensorShape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + } + /** + *
    +       * The shape of the component tensor.
    +       * 
    + * + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getTensorShapeFieldBuilder() { + if (tensorShapeBuilder_ == null) { + tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getTensorShape(), + getParentForChildren(), + isClean()); + tensorShape_ = null; + } + return tensorShapeBuilder_; + } + + private com.google.protobuf.Internal.LongList uncompressedBytes_ = emptyLongList(); + private void ensureUncompressedBytesIsMutable() { + if (!uncompressedBytes_.isModifiable()) { + uncompressedBytes_ = makeMutableCopy(uncompressedBytes_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return A list containing the uncompressedBytes. + */ + public java.util.List + getUncompressedBytesList() { + uncompressedBytes_.makeImmutable(); + return uncompressedBytes_; + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return The count of uncompressedBytes. + */ + public int getUncompressedBytesCount() { + return uncompressedBytes_.size(); + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param index The index of the element to return. + * @return The uncompressedBytes at the given index. + */ + public long getUncompressedBytes(int index) { + return uncompressedBytes_.getLong(index); + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param index The index to set the value at. + * @param value The uncompressedBytes to set. + * @return This builder for chaining. + */ + public Builder setUncompressedBytes( + int index, long value) { + + ensureUncompressedBytesIsMutable(); + uncompressedBytes_.setLong(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param value The uncompressedBytes to add. + * @return This builder for chaining. + */ + public Builder addUncompressedBytes(long value) { + + ensureUncompressedBytesIsMutable(); + uncompressedBytes_.addLong(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @param values The uncompressedBytes to add. + * @return This builder for chaining. + */ + public Builder addAllUncompressedBytes( + java.lang.Iterable values) { + ensureUncompressedBytesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, uncompressedBytes_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The amount of uncompressed tensor data.
    +       * - For string tensors, there is an element for each string indicating the
    +       * size of the string.
    +       * - For all other tensors, there is a single element indicating the size of
    +       * the tensor.
    +       * 
    + * + * repeated uint64 uncompressed_bytes = 4; + * @return This builder for chaining. + */ + public Builder clearUncompressedBytes() { + uncompressedBytes_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.CompressedComponentMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.CompressedComponentMetadata) + private static final org.tensorflow.proto.data.Dataset.CompressedComponentMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.Dataset.CompressedComponentMetadata(); + } + + public static org.tensorflow.proto.data.Dataset.CompressedComponentMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompressedComponentMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Dataset.CompressedComponentMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CompressedElementOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.CompressedElement) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Compressed tensor bytes for all components of the element.
    +     * 
    + * + * bytes data = 1; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + java.util.List + getComponentMetadataList(); + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata getComponentMetadata(int index); + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + int getComponentMetadataCount(); + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + java.util.List + getComponentMetadataOrBuilderList(); + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder getComponentMetadataOrBuilder( + int index); + + /** + *
    +     * Version of the CompressedElement. CompressedElements may be stored on disk
    +     * and read back by later versions of code, so we store a version number to
    +     * help readers understand which version they are reading. When you add a new
    +     * field to this proto, you need to increment kCompressedElementVersion in
    +     * tensorflow/core/data/compression_utils.cc.
    +     * 
    + * + * int32 version = 3; + * @return The version. + */ + int getVersion(); + } + /** + * Protobuf type {@code tensorflow.data.CompressedElement} + */ + public static final class CompressedElement extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.CompressedElement) + CompressedElementOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CompressedElement.class.getName()); + } + // Use CompressedElement.newBuilder() to construct. + private CompressedElement(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CompressedElement() { + data_ = com.google.protobuf.ByteString.EMPTY; + componentMetadata_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.CompressedElement.class, org.tensorflow.proto.data.Dataset.CompressedElement.Builder.class); + } + + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Compressed tensor bytes for all components of the element.
    +     * 
    + * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int COMPONENT_METADATA_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List componentMetadata_; + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + @java.lang.Override + public java.util.List getComponentMetadataList() { + return componentMetadata_; + } + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + @java.lang.Override + public java.util.List + getComponentMetadataOrBuilderList() { + return componentMetadata_; + } + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + @java.lang.Override + public int getComponentMetadataCount() { + return componentMetadata_.size(); + } + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata getComponentMetadata(int index) { + return componentMetadata_.get(index); + } + /** + *
    +     * Metadata for the components of the element.
    +     * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder getComponentMetadataOrBuilder( + int index) { + return componentMetadata_.get(index); + } + + public static final int VERSION_FIELD_NUMBER = 3; + private int version_ = 0; + /** + *
    +     * Version of the CompressedElement. CompressedElements may be stored on disk
    +     * and read back by later versions of code, so we store a version number to
    +     * help readers understand which version they are reading. When you add a new
    +     * field to this proto, you need to increment kCompressedElementVersion in
    +     * tensorflow/core/data/compression_utils.cc.
    +     * 
    + * + * int32 version = 3; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + + 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 (!data_.isEmpty()) { + output.writeBytes(1, data_); + } + for (int i = 0; i < componentMetadata_.size(); i++) { + output.writeMessage(2, componentMetadata_.get(i)); + } + if (version_ != 0) { + output.writeInt32(3, version_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, data_); + } + for (int i = 0; i < componentMetadata_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, componentMetadata_.get(i)); + } + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, version_); + } + size += getUnknownFields().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.Dataset.CompressedElement)) { + return super.equals(obj); + } + org.tensorflow.proto.data.Dataset.CompressedElement other = (org.tensorflow.proto.data.Dataset.CompressedElement) obj; + + if (!getData() + .equals(other.getData())) return false; + if (!getComponentMetadataList() + .equals(other.getComponentMetadataList())) return false; + if (getVersion() + != other.getVersion()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (getComponentMetadataCount() > 0) { + hash = (37 * hash) + COMPONENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getComponentMetadataList().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement 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.Dataset.CompressedElement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement 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.Dataset.CompressedElement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.Dataset.CompressedElement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.Dataset.CompressedElement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.CompressedElement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Dataset.CompressedElement 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.data.CompressedElement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.CompressedElement) + org.tensorflow.proto.data.Dataset.CompressedElementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.CompressedElement.class, org.tensorflow.proto.data.Dataset.CompressedElement.Builder.class); + } + + // Construct using org.tensorflow.proto.data.Dataset.CompressedElement.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + data_ = com.google.protobuf.ByteString.EMPTY; + if (componentMetadataBuilder_ == null) { + componentMetadata_ = java.util.Collections.emptyList(); + } else { + componentMetadata_ = null; + componentMetadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + version_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_CompressedElement_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedElement getDefaultInstanceForType() { + return org.tensorflow.proto.data.Dataset.CompressedElement.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedElement build() { + org.tensorflow.proto.data.Dataset.CompressedElement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.CompressedElement buildPartial() { + org.tensorflow.proto.data.Dataset.CompressedElement result = new org.tensorflow.proto.data.Dataset.CompressedElement(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.Dataset.CompressedElement result) { + if (componentMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + componentMetadata_ = java.util.Collections.unmodifiableList(componentMetadata_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.componentMetadata_ = componentMetadata_; + } else { + result.componentMetadata_ = componentMetadataBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.data.Dataset.CompressedElement result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.data_ = data_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.version_ = version_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.Dataset.CompressedElement) { + return mergeFrom((org.tensorflow.proto.data.Dataset.CompressedElement)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.Dataset.CompressedElement other) { + if (other == org.tensorflow.proto.data.Dataset.CompressedElement.getDefaultInstance()) return this; + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (componentMetadataBuilder_ == null) { + if (!other.componentMetadata_.isEmpty()) { + if (componentMetadata_.isEmpty()) { + componentMetadata_ = other.componentMetadata_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureComponentMetadataIsMutable(); + componentMetadata_.addAll(other.componentMetadata_); + } + onChanged(); + } + } else { + if (!other.componentMetadata_.isEmpty()) { + if (componentMetadataBuilder_.isEmpty()) { + componentMetadataBuilder_.dispose(); + componentMetadataBuilder_ = null; + componentMetadata_ = other.componentMetadata_; + bitField0_ = (bitField0_ & ~0x00000002); + componentMetadataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getComponentMetadataFieldBuilder() : null; + } else { + componentMetadataBuilder_.addAllMessages(other.componentMetadata_); + } + } + } + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + data_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata m = + input.readMessage( + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.parser(), + extensionRegistry); + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + componentMetadata_.add(m); + } else { + componentMetadataBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: { + version_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * Compressed tensor bytes for all components of the element.
    +       * 
    + * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
    +       * Compressed tensor bytes for all components of the element.
    +       * 
    + * + * bytes data = 1; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + data_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Compressed tensor bytes for all components of the element.
    +       * 
    + * + * bytes data = 1; + * @return This builder for chaining. + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000001); + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.util.List componentMetadata_ = + java.util.Collections.emptyList(); + private void ensureComponentMetadataIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + componentMetadata_ = new java.util.ArrayList(componentMetadata_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder, org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder> componentMetadataBuilder_; + + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public java.util.List getComponentMetadataList() { + if (componentMetadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(componentMetadata_); + } else { + return componentMetadataBuilder_.getMessageList(); + } + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public int getComponentMetadataCount() { + if (componentMetadataBuilder_ == null) { + return componentMetadata_.size(); + } else { + return componentMetadataBuilder_.getCount(); + } + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata getComponentMetadata(int index) { + if (componentMetadataBuilder_ == null) { + return componentMetadata_.get(index); + } else { + return componentMetadataBuilder_.getMessage(index); + } + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder setComponentMetadata( + int index, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata value) { + if (componentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentMetadataIsMutable(); + componentMetadata_.set(index, value); + onChanged(); + } else { + componentMetadataBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder setComponentMetadata( + int index, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder builderForValue) { + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + componentMetadata_.set(index, builderForValue.build()); + onChanged(); + } else { + componentMetadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder addComponentMetadata(org.tensorflow.proto.data.Dataset.CompressedComponentMetadata value) { + if (componentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentMetadataIsMutable(); + componentMetadata_.add(value); + onChanged(); + } else { + componentMetadataBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder addComponentMetadata( + int index, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata value) { + if (componentMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentMetadataIsMutable(); + componentMetadata_.add(index, value); + onChanged(); + } else { + componentMetadataBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder addComponentMetadata( + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder builderForValue) { + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + componentMetadata_.add(builderForValue.build()); + onChanged(); + } else { + componentMetadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder addComponentMetadata( + int index, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder builderForValue) { + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + componentMetadata_.add(index, builderForValue.build()); + onChanged(); + } else { + componentMetadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder addAllComponentMetadata( + java.lang.Iterable values) { + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, componentMetadata_); + onChanged(); + } else { + componentMetadataBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder clearComponentMetadata() { + if (componentMetadataBuilder_ == null) { + componentMetadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + componentMetadataBuilder_.clear(); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public Builder removeComponentMetadata(int index) { + if (componentMetadataBuilder_ == null) { + ensureComponentMetadataIsMutable(); + componentMetadata_.remove(index); + onChanged(); + } else { + componentMetadataBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder getComponentMetadataBuilder( + int index) { + return getComponentMetadataFieldBuilder().getBuilder(index); + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder getComponentMetadataOrBuilder( + int index) { + if (componentMetadataBuilder_ == null) { + return componentMetadata_.get(index); } else { + return componentMetadataBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public java.util.List + getComponentMetadataOrBuilderList() { + if (componentMetadataBuilder_ != null) { + return componentMetadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(componentMetadata_); + } + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder addComponentMetadataBuilder() { + return getComponentMetadataFieldBuilder().addBuilder( + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.getDefaultInstance()); + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder addComponentMetadataBuilder( + int index) { + return getComponentMetadataFieldBuilder().addBuilder( + index, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.getDefaultInstance()); + } + /** + *
    +       * Metadata for the components of the element.
    +       * 
    + * + * repeated .tensorflow.data.CompressedComponentMetadata component_metadata = 2; + */ + public java.util.List + getComponentMetadataBuilderList() { + return getComponentMetadataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder, org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder> + getComponentMetadataFieldBuilder() { + if (componentMetadataBuilder_ == null) { + componentMetadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.Dataset.CompressedComponentMetadata, org.tensorflow.proto.data.Dataset.CompressedComponentMetadata.Builder, org.tensorflow.proto.data.Dataset.CompressedComponentMetadataOrBuilder>( + componentMetadata_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + componentMetadata_ = null; + } + return componentMetadataBuilder_; + } + + private int version_ ; + /** + *
    +       * Version of the CompressedElement. CompressedElements may be stored on disk
    +       * and read back by later versions of code, so we store a version number to
    +       * help readers understand which version they are reading. When you add a new
    +       * field to this proto, you need to increment kCompressedElementVersion in
    +       * tensorflow/core/data/compression_utils.cc.
    +       * 
    + * + * int32 version = 3; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + /** + *
    +       * Version of the CompressedElement. CompressedElements may be stored on disk
    +       * and read back by later versions of code, so we store a version number to
    +       * help readers understand which version they are reading. When you add a new
    +       * field to this proto, you need to increment kCompressedElementVersion in
    +       * tensorflow/core/data/compression_utils.cc.
    +       * 
    + * + * int32 version = 3; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(int value) { + + version_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Version of the CompressedElement. CompressedElements may be stored on disk
    +       * and read back by later versions of code, so we store a version number to
    +       * help readers understand which version they are reading. When you add a new
    +       * field to this proto, you need to increment kCompressedElementVersion in
    +       * tensorflow/core/data/compression_utils.cc.
    +       * 
    + * + * int32 version = 3; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000004); + version_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.CompressedElement) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.CompressedElement) + private static final org.tensorflow.proto.data.Dataset.CompressedElement DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.Dataset.CompressedElement(); + } + + public static org.tensorflow.proto.data.Dataset.CompressedElement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CompressedElement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Dataset.CompressedElement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UncompressedElementOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.UncompressedElement) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.TensorProto components = 1; + */ + java.util.List + getComponentsList(); + /** + * repeated .tensorflow.TensorProto components = 1; + */ + org.tensorflow.proto.TensorProto getComponents(int index); + /** + * repeated .tensorflow.TensorProto components = 1; + */ + int getComponentsCount(); + /** + * repeated .tensorflow.TensorProto components = 1; + */ + java.util.List + getComponentsOrBuilderList(); + /** + * repeated .tensorflow.TensorProto components = 1; + */ + org.tensorflow.proto.TensorProtoOrBuilder getComponentsOrBuilder( + int index); + } + /** + *
    +   * An uncompressed dataset element.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.UncompressedElement} + */ + public static final class UncompressedElement extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.UncompressedElement) + UncompressedElementOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + UncompressedElement.class.getName()); + } + // Use UncompressedElement.newBuilder() to construct. + private UncompressedElement(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private UncompressedElement() { + components_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_UncompressedElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_UncompressedElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.UncompressedElement.class, org.tensorflow.proto.data.Dataset.UncompressedElement.Builder.class); + } + + public static final int COMPONENTS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List components_; + /** + * repeated .tensorflow.TensorProto components = 1; + */ + @java.lang.Override + public java.util.List getComponentsList() { + return components_; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + @java.lang.Override + public java.util.List + getComponentsOrBuilderList() { + return components_; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + @java.lang.Override + public int getComponentsCount() { + return components_.size(); + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getComponents(int index) { + return components_.get(index); + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getComponentsOrBuilder( + int index) { + return components_.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 { + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(1, components_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < components_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, components_.get(i)); + } + size += getUnknownFields().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.Dataset.UncompressedElement)) { + return super.equals(obj); + } + org.tensorflow.proto.data.Dataset.UncompressedElement other = (org.tensorflow.proto.data.Dataset.UncompressedElement) obj; + + if (!getComponentsList() + .equals(other.getComponentsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement 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.Dataset.UncompressedElement parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement 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.Dataset.UncompressedElement parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.Dataset.UncompressedElement parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Dataset.UncompressedElement 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * An uncompressed dataset element.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.UncompressedElement} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.UncompressedElement) + org.tensorflow.proto.data.Dataset.UncompressedElementOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_UncompressedElement_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_UncompressedElement_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.Dataset.UncompressedElement.class, org.tensorflow.proto.data.Dataset.UncompressedElement.Builder.class); + } + + // Construct using org.tensorflow.proto.data.Dataset.UncompressedElement.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); + } else { + components_ = null; + componentsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.Dataset.internal_static_tensorflow_data_UncompressedElement_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.UncompressedElement getDefaultInstanceForType() { + return org.tensorflow.proto.data.Dataset.UncompressedElement.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.UncompressedElement build() { + org.tensorflow.proto.data.Dataset.UncompressedElement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.Dataset.UncompressedElement buildPartial() { + org.tensorflow.proto.data.Dataset.UncompressedElement result = new org.tensorflow.proto.data.Dataset.UncompressedElement(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.Dataset.UncompressedElement result) { + if (componentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + components_ = java.util.Collections.unmodifiableList(components_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.components_ = components_; + } else { + result.components_ = componentsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.data.Dataset.UncompressedElement result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.Dataset.UncompressedElement) { + return mergeFrom((org.tensorflow.proto.data.Dataset.UncompressedElement)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.Dataset.UncompressedElement other) { + if (other == org.tensorflow.proto.data.Dataset.UncompressedElement.getDefaultInstance()) return this; + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureComponentsIsMutable(); + components_.addAll(other.components_); + } + onChanged(); + } + } else { + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; + bitField0_ = (bitField0_ & ~0x00000001); + componentsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getComponentsFieldBuilder() : null; + } else { + componentsBuilder_.addAllMessages(other.components_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TensorProto m = + input.readMessage( + org.tensorflow.proto.TensorProto.parser(), + extensionRegistry); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(m); + } else { + componentsBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List components_ = + java.util.Collections.emptyList(); + private void ensureComponentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + components_ = new java.util.ArrayList(components_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> componentsBuilder_; + + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public java.util.List getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); + } else { + return componentsBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); + } else { + return componentsBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public org.tensorflow.proto.TensorProto getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); + } else { + return componentsBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder setComponents( + int index, org.tensorflow.proto.TensorProto value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.set(index, value); + onChanged(); + } else { + componentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder setComponents( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder addComponents(org.tensorflow.proto.TensorProto value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.add(value); + onChanged(); + } else { + componentsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder addComponents( + int index, org.tensorflow.proto.TensorProto value) { + if (componentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComponentsIsMutable(); + components_.add(index, value); + onChanged(); + } else { + componentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder addComponents( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder addComponents( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); + onChanged(); + } else { + componentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder addAllComponents( + java.lang.Iterable values) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, components_); + onChanged(); + } else { + componentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + componentsBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); + onChanged(); + } else { + componentsBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public org.tensorflow.proto.TensorProto.Builder getComponentsBuilder( + int index) { + return getComponentsFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getComponentsOrBuilder( + int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public java.util.List + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(components_); + } + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public org.tensorflow.proto.TensorProto.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public org.tensorflow.proto.TensorProto.Builder addComponentsBuilder( + int index) { + return getComponentsFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + * repeated .tensorflow.TensorProto components = 1; + */ + public java.util.List + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + components_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + components_ = null; + } + return componentsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.UncompressedElement) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.UncompressedElement) + private static final org.tensorflow.proto.data.Dataset.UncompressedElement DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.Dataset.UncompressedElement(); + } + + public static org.tensorflow.proto.data.Dataset.UncompressedElement getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UncompressedElement parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Dataset.UncompressedElement getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_CompressedComponentMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_CompressedComponentMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_CompressedElement_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_CompressedElement_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_UncompressedElement_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_UncompressedElement_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/framework/dataset.prot" + + "o\022\017tensorflow.data\032&tensorflow/core/fram" + + "ework/tensor.proto\032,tensorflow/core/fram" + + "ework/tensor_shape.proto\032%tensorflow/cor" + + "e/framework/types.proto\"\230\001\n\033CompressedCo" + + "mponentMetadata\022#\n\005dtype\030\001 \001(\0162\024.tensorf" + + "low.DataType\0222\n\014tensor_shape\030\002 \001(\0132\034.ten" + + "sorflow.TensorShapeProto\022\032\n\022uncompressed" + + "_bytes\030\004 \003(\004J\004\010\003\020\004\"|\n\021CompressedElement\022" + + "\014\n\004data\030\001 \001(\014\022H\n\022component_metadata\030\002 \003(" + + "\0132,.tensorflow.data.CompressedComponentM" + + "etadata\022\017\n\007version\030\003 \001(\005\"B\n\023Uncompressed" + + "Element\022+\n\ncomponents\030\001 \003(\0132\027.tensorflow" + + ".TensorProtoB\036\n\031org.tensorflow.proto.dat" + + "a\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_data_CompressedComponentMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_CompressedComponentMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_CompressedComponentMetadata_descriptor, + new java.lang.String[] { "Dtype", "TensorShape", "UncompressedBytes", }); + internal_static_tensorflow_data_CompressedElement_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_CompressedElement_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_CompressedElement_descriptor, + new java.lang.String[] { "Data", "ComponentMetadata", "Version", }); + internal_static_tensorflow_data_UncompressedElement_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_data_UncompressedElement_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_UncompressedElement_descriptor, + new java.lang.String[] { "Components", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetMetadata.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetMetadata.java new file mode 100644 index 00000000000..984536f55e7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetMetadata.java @@ -0,0 +1,655 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/dataset_metadata.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data; + +public final class DatasetMetadata { + private DatasetMetadata() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DatasetMetadata.class.getName()); + } + 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 MetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.Metadata) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes name = 1; + * @return The name. + */ + com.google.protobuf.ByteString getName(); + + /** + * string data_service_address = 2; + * @return The dataServiceAddress. + */ + java.lang.String getDataServiceAddress(); + /** + * string data_service_address = 2; + * @return The bytes for dataServiceAddress. + */ + com.google.protobuf.ByteString + getDataServiceAddressBytes(); + } + /** + *
    +   * next: 3
    +   * 
    + * + * Protobuf type {@code tensorflow.data.Metadata} + */ + public static final class Metadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.Metadata) + MetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Metadata.class.getName()); + } + // Use Metadata.newBuilder() to construct. + private Metadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Metadata() { + name_ = com.google.protobuf.ByteString.EMPTY; + dataServiceAddress_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetMetadata.internal_static_tensorflow_data_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetMetadata.internal_static_tensorflow_data_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetMetadata.Metadata.class, org.tensorflow.proto.data.DatasetMetadata.Metadata.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString name_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes name = 1; + * @return The name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getName() { + return name_; + } + + public static final int DATA_SERVICE_ADDRESS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object dataServiceAddress_ = ""; + /** + * string data_service_address = 2; + * @return The dataServiceAddress. + */ + @java.lang.Override + public java.lang.String getDataServiceAddress() { + java.lang.Object ref = dataServiceAddress_; + 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(); + dataServiceAddress_ = s; + return s; + } + } + /** + * string data_service_address = 2; + * @return The bytes for dataServiceAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDataServiceAddressBytes() { + java.lang.Object ref = dataServiceAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataServiceAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!name_.isEmpty()) { + output.writeBytes(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataServiceAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, dataServiceAddress_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!name_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataServiceAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, dataServiceAddress_); + } + size += getUnknownFields().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.DatasetMetadata.Metadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetMetadata.Metadata other = (org.tensorflow.proto.data.DatasetMetadata.Metadata) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getDataServiceAddress() + .equals(other.getDataServiceAddress())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATA_SERVICE_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDataServiceAddress().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata 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.DatasetMetadata.Metadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata 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.DatasetMetadata.Metadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetMetadata.Metadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetMetadata.Metadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 3
    +     * 
    + * + * Protobuf type {@code tensorflow.data.Metadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.Metadata) + org.tensorflow.proto.data.DatasetMetadata.MetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetMetadata.internal_static_tensorflow_data_Metadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetMetadata.internal_static_tensorflow_data_Metadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetMetadata.Metadata.class, org.tensorflow.proto.data.DatasetMetadata.Metadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetMetadata.Metadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = com.google.protobuf.ByteString.EMPTY; + dataServiceAddress_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetMetadata.internal_static_tensorflow_data_Metadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetMetadata.Metadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetMetadata.Metadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetMetadata.Metadata build() { + org.tensorflow.proto.data.DatasetMetadata.Metadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetMetadata.Metadata buildPartial() { + org.tensorflow.proto.data.DatasetMetadata.Metadata result = new org.tensorflow.proto.data.DatasetMetadata.Metadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetMetadata.Metadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataServiceAddress_ = dataServiceAddress_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetMetadata.Metadata) { + return mergeFrom((org.tensorflow.proto.data.DatasetMetadata.Metadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetMetadata.Metadata other) { + if (other == org.tensorflow.proto.data.DatasetMetadata.Metadata.getDefaultInstance()) return this; + if (other.getName() != com.google.protobuf.ByteString.EMPTY) { + setName(other.getName()); + } + if (!other.getDataServiceAddress().isEmpty()) { + dataServiceAddress_ = other.dataServiceAddress_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + dataServiceAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString name_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes name = 1; + * @return The name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getName() { + return name_; + } + /** + * bytes name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * bytes name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + private java.lang.Object dataServiceAddress_ = ""; + /** + * string data_service_address = 2; + * @return The dataServiceAddress. + */ + public java.lang.String getDataServiceAddress() { + java.lang.Object ref = dataServiceAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataServiceAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string data_service_address = 2; + * @return The bytes for dataServiceAddress. + */ + public com.google.protobuf.ByteString + getDataServiceAddressBytes() { + java.lang.Object ref = dataServiceAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataServiceAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string data_service_address = 2; + * @param value The dataServiceAddress to set. + * @return This builder for chaining. + */ + public Builder setDataServiceAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + dataServiceAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string data_service_address = 2; + * @return This builder for chaining. + */ + public Builder clearDataServiceAddress() { + dataServiceAddress_ = getDefaultInstance().getDataServiceAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string data_service_address = 2; + * @param value The bytes for dataServiceAddress to set. + * @return This builder for chaining. + */ + public Builder setDataServiceAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + dataServiceAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.Metadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.Metadata) + private static final org.tensorflow.proto.data.DatasetMetadata.Metadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetMetadata.Metadata(); + } + + public static org.tensorflow.proto.data.DatasetMetadata.Metadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetMetadata.Metadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_Metadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_Metadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0tensorflow/core/framework/dataset_meta" + + "data.proto\022\017tensorflow.data\"6\n\010Metadata\022" + + "\014\n\004name\030\001 \001(\014\022\034\n\024data_service_address\030\002 " + + "\001(\tBt\n\031org.tensorflow.proto.dataZWgithub" + + ".com/tensorflow/tensorflow/tensorflow/go" + + "/core/framework/dataset_metadata_go_prot" + + "ob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_data_Metadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_Metadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_Metadata_descriptor, + new java.lang.String[] { "Name", "DataServiceAddress", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetOptions.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetOptions.java new file mode 100644 index 00000000000..da4fbd9787b --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/DatasetOptions.java @@ -0,0 +1,10193 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/dataset_options.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data; + +public final class DatasetOptions { + private DatasetOptions() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DatasetOptions.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + *
    +   * Represents the type of auto-sharding we enable.
    +   * 
    + * + * Protobuf enum {@code tensorflow.data.AutoShardPolicy} + */ + public enum AutoShardPolicy + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
    +     * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
    +     * 
    + * + * AUTO = 0; + */ + AUTO(0), + /** + *
    +     * FILE: Shards by input files (i.e. each worker will get a set of files to
    +     * process). When this option is selected, make sure that there is at least as
    +     * many files as workers. If there are fewer input files than workers, a
    +     * runtime error will be raised.
    +     * 
    + * + * FILE = 1; + */ + FILE(1), + /** + *
    +     * DATA: Shards by elements produced by the dataset. Each worker will process
    +     * the whole dataset and discard the portion that is not for itself. Note that
    +     * for this mode to correctly partitions the dataset elements, the dataset
    +     * needs to produce elements in a deterministic order.
    +     * 
    + * + * DATA = 2; + */ + DATA(2), + /** + *
    +     * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
    +     * as a placeholder to replace with `shard(num_workers, worker_index)`.
    +     * 
    + * + * HINT = 3; + */ + HINT(3), + /** + *
    +     * OFF: No sharding will be performed.
    +     * 
    + * + * OFF = -1; + */ + OFF(-1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AutoShardPolicy.class.getName()); + } + /** + *
    +     * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
    +     * 
    + * + * AUTO = 0; + */ + public static final int AUTO_VALUE = 0; + /** + *
    +     * FILE: Shards by input files (i.e. each worker will get a set of files to
    +     * process). When this option is selected, make sure that there is at least as
    +     * many files as workers. If there are fewer input files than workers, a
    +     * runtime error will be raised.
    +     * 
    + * + * FILE = 1; + */ + public static final int FILE_VALUE = 1; + /** + *
    +     * DATA: Shards by elements produced by the dataset. Each worker will process
    +     * the whole dataset and discard the portion that is not for itself. Note that
    +     * for this mode to correctly partitions the dataset elements, the dataset
    +     * needs to produce elements in a deterministic order.
    +     * 
    + * + * DATA = 2; + */ + public static final int DATA_VALUE = 2; + /** + *
    +     * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
    +     * as a placeholder to replace with `shard(num_workers, worker_index)`.
    +     * 
    + * + * HINT = 3; + */ + public static final int HINT_VALUE = 3; + /** + *
    +     * OFF: No sharding will be performed.
    +     * 
    + * + * OFF = -1; + */ + public static final int OFF_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AutoShardPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AutoShardPolicy forNumber(int value) { + switch (value) { + case 0: return AUTO; + case 1: return FILE; + case 2: return DATA; + case 3: return HINT; + case -1: return OFF; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AutoShardPolicy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AutoShardPolicy findValueByNumber(int number) { + return AutoShardPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DatasetOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final AutoShardPolicy[] VALUES = values(); + + public static AutoShardPolicy 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 AutoShardPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.AutoShardPolicy) + } + + /** + *
    +   * Represents how to handle external state during serialization.
    +   * 
    + * + * Protobuf enum {@code tensorflow.data.ExternalStatePolicy} + */ + public enum ExternalStatePolicy + implements com.google.protobuf.ProtocolMessageEnum { + /** + * POLICY_WARN = 0; + */ + POLICY_WARN(0), + /** + * POLICY_IGNORE = 1; + */ + POLICY_IGNORE(1), + /** + * POLICY_FAIL = 2; + */ + POLICY_FAIL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ExternalStatePolicy.class.getName()); + } + /** + * POLICY_WARN = 0; + */ + public static final int POLICY_WARN_VALUE = 0; + /** + * POLICY_IGNORE = 1; + */ + public static final int POLICY_IGNORE_VALUE = 1; + /** + * POLICY_FAIL = 2; + */ + public static final int POLICY_FAIL_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExternalStatePolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExternalStatePolicy forNumber(int value) { + switch (value) { + case 0: return POLICY_WARN; + case 1: return POLICY_IGNORE; + case 2: return POLICY_FAIL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ExternalStatePolicy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExternalStatePolicy findValueByNumber(int number) { + return ExternalStatePolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DatasetOptions.getDescriptor().getEnumTypes().get(1); + } + + private static final ExternalStatePolicy[] VALUES = values(); + + public static ExternalStatePolicy 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 ExternalStatePolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.ExternalStatePolicy) + } + + public interface AutotuneOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.AutotuneOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * bool enabled = 1; + * @return Whether the enabled field is set. + */ + boolean hasEnabled(); + /** + * bool enabled = 1; + * @return The enabled. + */ + boolean getEnabled(); + + /** + * int32 cpu_budget = 2; + * @return Whether the cpuBudget field is set. + */ + boolean hasCpuBudget(); + /** + * int32 cpu_budget = 2; + * @return The cpuBudget. + */ + int getCpuBudget(); + + /** + * int64 ram_budget = 3; + * @return Whether the ramBudget field is set. + */ + boolean hasRamBudget(); + /** + * int64 ram_budget = 3; + * @return The ramBudget. + */ + long getRamBudget(); + + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return Whether the autotuneAlgorithm field is set. + */ + boolean hasAutotuneAlgorithm(); + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The enum numeric value on the wire for autotuneAlgorithm. + */ + int getAutotuneAlgorithmValue(); + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The autotuneAlgorithm. + */ + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAutotuneAlgorithm(); + + /** + * int64 initial_parallelism = 5; + * @return Whether the initialParallelism field is set. + */ + boolean hasInitialParallelism(); + /** + * int64 initial_parallelism = 5; + * @return The initialParallelism. + */ + long getInitialParallelism(); + + /** + * int64 min_parallelism = 6; + * @return Whether the minParallelism field is set. + */ + boolean hasMinParallelism(); + /** + * int64 min_parallelism = 6; + * @return The minParallelism. + */ + long getMinParallelism(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalEnabledCase getOptionalEnabledCase(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalCpuBudgetCase getOptionalCpuBudgetCase(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalRamBudgetCase getOptionalRamBudgetCase(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalAutotuneAlgorithmCase getOptionalAutotuneAlgorithmCase(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalInitialParallelismCase getOptionalInitialParallelismCase(); + + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.OptionalMinParallelismCase getOptionalMinParallelismCase(); + } + /** + *
    +   * next: 7
    +   * 
    + * + * Protobuf type {@code tensorflow.data.AutotuneOptions} + */ + public static final class AutotuneOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.AutotuneOptions) + AutotuneOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AutotuneOptions.class.getName()); + } + // Use AutotuneOptions.newBuilder() to construct. + private AutotuneOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AutotuneOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_AutotuneOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_AutotuneOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.class, org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder.class); + } + + private int optionalEnabledCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalEnabled_; + public enum OptionalEnabledCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ENABLED(1), + OPTIONALENABLED_NOT_SET(0); + private final int value; + private OptionalEnabledCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalEnabledCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalEnabledCase forNumber(int value) { + switch (value) { + case 1: return ENABLED; + case 0: return OPTIONALENABLED_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalEnabledCase + getOptionalEnabledCase() { + return OptionalEnabledCase.forNumber( + optionalEnabledCase_); + } + + private int optionalCpuBudgetCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalCpuBudget_; + public enum OptionalCpuBudgetCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CPU_BUDGET(2), + OPTIONALCPUBUDGET_NOT_SET(0); + private final int value; + private OptionalCpuBudgetCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalCpuBudgetCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalCpuBudgetCase forNumber(int value) { + switch (value) { + case 2: return CPU_BUDGET; + case 0: return OPTIONALCPUBUDGET_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalCpuBudgetCase + getOptionalCpuBudgetCase() { + return OptionalCpuBudgetCase.forNumber( + optionalCpuBudgetCase_); + } + + private int optionalRamBudgetCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalRamBudget_; + public enum OptionalRamBudgetCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RAM_BUDGET(3), + OPTIONALRAMBUDGET_NOT_SET(0); + private final int value; + private OptionalRamBudgetCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalRamBudgetCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalRamBudgetCase forNumber(int value) { + switch (value) { + case 3: return RAM_BUDGET; + case 0: return OPTIONALRAMBUDGET_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalRamBudgetCase + getOptionalRamBudgetCase() { + return OptionalRamBudgetCase.forNumber( + optionalRamBudgetCase_); + } + + private int optionalAutotuneAlgorithmCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalAutotuneAlgorithm_; + public enum OptionalAutotuneAlgorithmCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTOTUNE_ALGORITHM(4), + OPTIONALAUTOTUNEALGORITHM_NOT_SET(0); + private final int value; + private OptionalAutotuneAlgorithmCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalAutotuneAlgorithmCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalAutotuneAlgorithmCase forNumber(int value) { + switch (value) { + case 4: return AUTOTUNE_ALGORITHM; + case 0: return OPTIONALAUTOTUNEALGORITHM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalAutotuneAlgorithmCase + getOptionalAutotuneAlgorithmCase() { + return OptionalAutotuneAlgorithmCase.forNumber( + optionalAutotuneAlgorithmCase_); + } + + private int optionalInitialParallelismCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalInitialParallelism_; + public enum OptionalInitialParallelismCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INITIAL_PARALLELISM(5), + OPTIONALINITIALPARALLELISM_NOT_SET(0); + private final int value; + private OptionalInitialParallelismCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalInitialParallelismCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalInitialParallelismCase forNumber(int value) { + switch (value) { + case 5: return INITIAL_PARALLELISM; + case 0: return OPTIONALINITIALPARALLELISM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalInitialParallelismCase + getOptionalInitialParallelismCase() { + return OptionalInitialParallelismCase.forNumber( + optionalInitialParallelismCase_); + } + + private int optionalMinParallelismCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMinParallelism_; + public enum OptionalMinParallelismCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MIN_PARALLELISM(6), + OPTIONALMINPARALLELISM_NOT_SET(0); + private final int value; + private OptionalMinParallelismCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMinParallelismCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMinParallelismCase forNumber(int value) { + switch (value) { + case 6: return MIN_PARALLELISM; + case 0: return OPTIONALMINPARALLELISM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMinParallelismCase + getOptionalMinParallelismCase() { + return OptionalMinParallelismCase.forNumber( + optionalMinParallelismCase_); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + /** + * bool enabled = 1; + * @return Whether the enabled field is set. + */ + @java.lang.Override + public boolean hasEnabled() { + return optionalEnabledCase_ == 1; + } + /** + * bool enabled = 1; + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + if (optionalEnabledCase_ == 1) { + return (java.lang.Boolean) optionalEnabled_; + } + return false; + } + + public static final int CPU_BUDGET_FIELD_NUMBER = 2; + /** + * int32 cpu_budget = 2; + * @return Whether the cpuBudget field is set. + */ + @java.lang.Override + public boolean hasCpuBudget() { + return optionalCpuBudgetCase_ == 2; + } + /** + * int32 cpu_budget = 2; + * @return The cpuBudget. + */ + @java.lang.Override + public int getCpuBudget() { + if (optionalCpuBudgetCase_ == 2) { + return (java.lang.Integer) optionalCpuBudget_; + } + return 0; + } + + public static final int RAM_BUDGET_FIELD_NUMBER = 3; + /** + * int64 ram_budget = 3; + * @return Whether the ramBudget field is set. + */ + @java.lang.Override + public boolean hasRamBudget() { + return optionalRamBudgetCase_ == 3; + } + /** + * int64 ram_budget = 3; + * @return The ramBudget. + */ + @java.lang.Override + public long getRamBudget() { + if (optionalRamBudgetCase_ == 3) { + return (java.lang.Long) optionalRamBudget_; + } + return 0L; + } + + public static final int AUTOTUNE_ALGORITHM_FIELD_NUMBER = 4; + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return Whether the autotuneAlgorithm field is set. + */ + public boolean hasAutotuneAlgorithm() { + return optionalAutotuneAlgorithmCase_ == 4; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The enum numeric value on the wire for autotuneAlgorithm. + */ + public int getAutotuneAlgorithmValue() { + if (optionalAutotuneAlgorithmCase_ == 4) { + return (java.lang.Integer) optionalAutotuneAlgorithm_; + } + return 0; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The autotuneAlgorithm. + */ + public org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAutotuneAlgorithm() { + if (optionalAutotuneAlgorithmCase_ == 4) { + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.forNumber( + (java.lang.Integer) optionalAutotuneAlgorithm_); + return result == null ? org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.UNRECOGNIZED : result; + } + return org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.DEFAULT; + } + + public static final int INITIAL_PARALLELISM_FIELD_NUMBER = 5; + /** + * int64 initial_parallelism = 5; + * @return Whether the initialParallelism field is set. + */ + @java.lang.Override + public boolean hasInitialParallelism() { + return optionalInitialParallelismCase_ == 5; + } + /** + * int64 initial_parallelism = 5; + * @return The initialParallelism. + */ + @java.lang.Override + public long getInitialParallelism() { + if (optionalInitialParallelismCase_ == 5) { + return (java.lang.Long) optionalInitialParallelism_; + } + return 0L; + } + + public static final int MIN_PARALLELISM_FIELD_NUMBER = 6; + /** + * int64 min_parallelism = 6; + * @return Whether the minParallelism field is set. + */ + @java.lang.Override + public boolean hasMinParallelism() { + return optionalMinParallelismCase_ == 6; + } + /** + * int64 min_parallelism = 6; + * @return The minParallelism. + */ + @java.lang.Override + public long getMinParallelism() { + if (optionalMinParallelismCase_ == 6) { + return (java.lang.Long) optionalMinParallelism_; + } + return 0L; + } + + 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 (optionalEnabledCase_ == 1) { + output.writeBool( + 1, (boolean)((java.lang.Boolean) optionalEnabled_)); + } + if (optionalCpuBudgetCase_ == 2) { + output.writeInt32( + 2, (int)((java.lang.Integer) optionalCpuBudget_)); + } + if (optionalRamBudgetCase_ == 3) { + output.writeInt64( + 3, (long)((java.lang.Long) optionalRamBudget_)); + } + if (optionalAutotuneAlgorithmCase_ == 4) { + output.writeEnum(4, ((java.lang.Integer) optionalAutotuneAlgorithm_)); + } + if (optionalInitialParallelismCase_ == 5) { + output.writeInt64( + 5, (long)((java.lang.Long) optionalInitialParallelism_)); + } + if (optionalMinParallelismCase_ == 6) { + output.writeInt64( + 6, (long)((java.lang.Long) optionalMinParallelism_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalEnabledCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 1, (boolean)((java.lang.Boolean) optionalEnabled_)); + } + if (optionalCpuBudgetCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 2, (int)((java.lang.Integer) optionalCpuBudget_)); + } + if (optionalRamBudgetCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 3, (long)((java.lang.Long) optionalRamBudget_)); + } + if (optionalAutotuneAlgorithmCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, ((java.lang.Integer) optionalAutotuneAlgorithm_)); + } + if (optionalInitialParallelismCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 5, (long)((java.lang.Long) optionalInitialParallelism_)); + } + if (optionalMinParallelismCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 6, (long)((java.lang.Long) optionalMinParallelism_)); + } + size += getUnknownFields().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.DatasetOptions.AutotuneOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions other = (org.tensorflow.proto.data.DatasetOptions.AutotuneOptions) obj; + + if (!getOptionalEnabledCase().equals(other.getOptionalEnabledCase())) return false; + switch (optionalEnabledCase_) { + case 1: + if (getEnabled() + != other.getEnabled()) return false; + break; + case 0: + default: + } + if (!getOptionalCpuBudgetCase().equals(other.getOptionalCpuBudgetCase())) return false; + switch (optionalCpuBudgetCase_) { + case 2: + if (getCpuBudget() + != other.getCpuBudget()) return false; + break; + case 0: + default: + } + if (!getOptionalRamBudgetCase().equals(other.getOptionalRamBudgetCase())) return false; + switch (optionalRamBudgetCase_) { + case 3: + if (getRamBudget() + != other.getRamBudget()) return false; + break; + case 0: + default: + } + if (!getOptionalAutotuneAlgorithmCase().equals(other.getOptionalAutotuneAlgorithmCase())) return false; + switch (optionalAutotuneAlgorithmCase_) { + case 4: + if (getAutotuneAlgorithmValue() + != other.getAutotuneAlgorithmValue()) return false; + break; + case 0: + default: + } + if (!getOptionalInitialParallelismCase().equals(other.getOptionalInitialParallelismCase())) return false; + switch (optionalInitialParallelismCase_) { + case 5: + if (getInitialParallelism() + != other.getInitialParallelism()) return false; + break; + case 0: + default: + } + if (!getOptionalMinParallelismCase().equals(other.getOptionalMinParallelismCase())) return false; + switch (optionalMinParallelismCase_) { + case 6: + if (getMinParallelism() + != other.getMinParallelism()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (optionalEnabledCase_) { + case 1: + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnabled()); + break; + case 0: + default: + } + switch (optionalCpuBudgetCase_) { + case 2: + hash = (37 * hash) + CPU_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + getCpuBudget(); + break; + case 0: + default: + } + switch (optionalRamBudgetCase_) { + case 3: + hash = (37 * hash) + RAM_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRamBudget()); + break; + case 0: + default: + } + switch (optionalAutotuneAlgorithmCase_) { + case 4: + hash = (37 * hash) + AUTOTUNE_ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + getAutotuneAlgorithmValue(); + break; + case 0: + default: + } + switch (optionalInitialParallelismCase_) { + case 5: + hash = (37 * hash) + INITIAL_PARALLELISM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInitialParallelism()); + break; + case 0: + default: + } + switch (optionalMinParallelismCase_) { + case 6: + hash = (37 * hash) + MIN_PARALLELISM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMinParallelism()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions 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.DatasetOptions.AutotuneOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions 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.DatasetOptions.AutotuneOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.AutotuneOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 7
    +     * 
    + * + * Protobuf type {@code tensorflow.data.AutotuneOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.AutotuneOptions) + org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_AutotuneOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_AutotuneOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.class, org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optionalEnabledCase_ = 0; + optionalEnabled_ = null; + optionalCpuBudgetCase_ = 0; + optionalCpuBudget_ = null; + optionalRamBudgetCase_ = 0; + optionalRamBudget_ = null; + optionalAutotuneAlgorithmCase_ = 0; + optionalAutotuneAlgorithm_ = null; + optionalInitialParallelismCase_ = 0; + optionalInitialParallelism_ = null; + optionalMinParallelismCase_ = 0; + optionalMinParallelism_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_AutotuneOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions build() { + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions result = new org.tensorflow.proto.data.DatasetOptions.AutotuneOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.AutotuneOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.AutotuneOptions result) { + result.optionalEnabledCase_ = optionalEnabledCase_; + result.optionalEnabled_ = this.optionalEnabled_; + result.optionalCpuBudgetCase_ = optionalCpuBudgetCase_; + result.optionalCpuBudget_ = this.optionalCpuBudget_; + result.optionalRamBudgetCase_ = optionalRamBudgetCase_; + result.optionalRamBudget_ = this.optionalRamBudget_; + result.optionalAutotuneAlgorithmCase_ = optionalAutotuneAlgorithmCase_; + result.optionalAutotuneAlgorithm_ = this.optionalAutotuneAlgorithm_; + result.optionalInitialParallelismCase_ = optionalInitialParallelismCase_; + result.optionalInitialParallelism_ = this.optionalInitialParallelism_; + result.optionalMinParallelismCase_ = optionalMinParallelismCase_; + result.optionalMinParallelism_ = this.optionalMinParallelism_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.AutotuneOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.AutotuneOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.AutotuneOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance()) return this; + switch (other.getOptionalEnabledCase()) { + case ENABLED: { + setEnabled(other.getEnabled()); + break; + } + case OPTIONALENABLED_NOT_SET: { + break; + } + } + switch (other.getOptionalCpuBudgetCase()) { + case CPU_BUDGET: { + setCpuBudget(other.getCpuBudget()); + break; + } + case OPTIONALCPUBUDGET_NOT_SET: { + break; + } + } + switch (other.getOptionalRamBudgetCase()) { + case RAM_BUDGET: { + setRamBudget(other.getRamBudget()); + break; + } + case OPTIONALRAMBUDGET_NOT_SET: { + break; + } + } + switch (other.getOptionalAutotuneAlgorithmCase()) { + case AUTOTUNE_ALGORITHM: { + setAutotuneAlgorithmValue(other.getAutotuneAlgorithmValue()); + break; + } + case OPTIONALAUTOTUNEALGORITHM_NOT_SET: { + break; + } + } + switch (other.getOptionalInitialParallelismCase()) { + case INITIAL_PARALLELISM: { + setInitialParallelism(other.getInitialParallelism()); + break; + } + case OPTIONALINITIALPARALLELISM_NOT_SET: { + break; + } + } + switch (other.getOptionalMinParallelismCase()) { + case MIN_PARALLELISM: { + setMinParallelism(other.getMinParallelism()); + break; + } + case OPTIONALMINPARALLELISM_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + optionalEnabled_ = input.readBool(); + optionalEnabledCase_ = 1; + break; + } // case 8 + case 16: { + optionalCpuBudget_ = input.readInt32(); + optionalCpuBudgetCase_ = 2; + break; + } // case 16 + case 24: { + optionalRamBudget_ = input.readInt64(); + optionalRamBudgetCase_ = 3; + break; + } // case 24 + case 32: { + int rawValue = input.readEnum(); + optionalAutotuneAlgorithmCase_ = 4; + optionalAutotuneAlgorithm_ = rawValue; + break; + } // case 32 + case 40: { + optionalInitialParallelism_ = input.readInt64(); + optionalInitialParallelismCase_ = 5; + break; + } // case 40 + case 48: { + optionalMinParallelism_ = input.readInt64(); + optionalMinParallelismCase_ = 6; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalEnabledCase_ = 0; + private java.lang.Object optionalEnabled_; + public OptionalEnabledCase + getOptionalEnabledCase() { + return OptionalEnabledCase.forNumber( + optionalEnabledCase_); + } + + public Builder clearOptionalEnabled() { + optionalEnabledCase_ = 0; + optionalEnabled_ = null; + onChanged(); + return this; + } + + private int optionalCpuBudgetCase_ = 0; + private java.lang.Object optionalCpuBudget_; + public OptionalCpuBudgetCase + getOptionalCpuBudgetCase() { + return OptionalCpuBudgetCase.forNumber( + optionalCpuBudgetCase_); + } + + public Builder clearOptionalCpuBudget() { + optionalCpuBudgetCase_ = 0; + optionalCpuBudget_ = null; + onChanged(); + return this; + } + + private int optionalRamBudgetCase_ = 0; + private java.lang.Object optionalRamBudget_; + public OptionalRamBudgetCase + getOptionalRamBudgetCase() { + return OptionalRamBudgetCase.forNumber( + optionalRamBudgetCase_); + } + + public Builder clearOptionalRamBudget() { + optionalRamBudgetCase_ = 0; + optionalRamBudget_ = null; + onChanged(); + return this; + } + + private int optionalAutotuneAlgorithmCase_ = 0; + private java.lang.Object optionalAutotuneAlgorithm_; + public OptionalAutotuneAlgorithmCase + getOptionalAutotuneAlgorithmCase() { + return OptionalAutotuneAlgorithmCase.forNumber( + optionalAutotuneAlgorithmCase_); + } + + public Builder clearOptionalAutotuneAlgorithm() { + optionalAutotuneAlgorithmCase_ = 0; + optionalAutotuneAlgorithm_ = null; + onChanged(); + return this; + } + + private int optionalInitialParallelismCase_ = 0; + private java.lang.Object optionalInitialParallelism_; + public OptionalInitialParallelismCase + getOptionalInitialParallelismCase() { + return OptionalInitialParallelismCase.forNumber( + optionalInitialParallelismCase_); + } + + public Builder clearOptionalInitialParallelism() { + optionalInitialParallelismCase_ = 0; + optionalInitialParallelism_ = null; + onChanged(); + return this; + } + + private int optionalMinParallelismCase_ = 0; + private java.lang.Object optionalMinParallelism_; + public OptionalMinParallelismCase + getOptionalMinParallelismCase() { + return OptionalMinParallelismCase.forNumber( + optionalMinParallelismCase_); + } + + public Builder clearOptionalMinParallelism() { + optionalMinParallelismCase_ = 0; + optionalMinParallelism_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * bool enabled = 1; + * @return Whether the enabled field is set. + */ + public boolean hasEnabled() { + return optionalEnabledCase_ == 1; + } + /** + * bool enabled = 1; + * @return The enabled. + */ + public boolean getEnabled() { + if (optionalEnabledCase_ == 1) { + return (java.lang.Boolean) optionalEnabled_; + } + return false; + } + /** + * bool enabled = 1; + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + optionalEnabledCase_ = 1; + optionalEnabled_ = value; + onChanged(); + return this; + } + /** + * bool enabled = 1; + * @return This builder for chaining. + */ + public Builder clearEnabled() { + if (optionalEnabledCase_ == 1) { + optionalEnabledCase_ = 0; + optionalEnabled_ = null; + onChanged(); + } + return this; + } + + /** + * int32 cpu_budget = 2; + * @return Whether the cpuBudget field is set. + */ + public boolean hasCpuBudget() { + return optionalCpuBudgetCase_ == 2; + } + /** + * int32 cpu_budget = 2; + * @return The cpuBudget. + */ + public int getCpuBudget() { + if (optionalCpuBudgetCase_ == 2) { + return (java.lang.Integer) optionalCpuBudget_; + } + return 0; + } + /** + * int32 cpu_budget = 2; + * @param value The cpuBudget to set. + * @return This builder for chaining. + */ + public Builder setCpuBudget(int value) { + + optionalCpuBudgetCase_ = 2; + optionalCpuBudget_ = value; + onChanged(); + return this; + } + /** + * int32 cpu_budget = 2; + * @return This builder for chaining. + */ + public Builder clearCpuBudget() { + if (optionalCpuBudgetCase_ == 2) { + optionalCpuBudgetCase_ = 0; + optionalCpuBudget_ = null; + onChanged(); + } + return this; + } + + /** + * int64 ram_budget = 3; + * @return Whether the ramBudget field is set. + */ + public boolean hasRamBudget() { + return optionalRamBudgetCase_ == 3; + } + /** + * int64 ram_budget = 3; + * @return The ramBudget. + */ + public long getRamBudget() { + if (optionalRamBudgetCase_ == 3) { + return (java.lang.Long) optionalRamBudget_; + } + return 0L; + } + /** + * int64 ram_budget = 3; + * @param value The ramBudget to set. + * @return This builder for chaining. + */ + public Builder setRamBudget(long value) { + + optionalRamBudgetCase_ = 3; + optionalRamBudget_ = value; + onChanged(); + return this; + } + /** + * int64 ram_budget = 3; + * @return This builder for chaining. + */ + public Builder clearRamBudget() { + if (optionalRamBudgetCase_ == 3) { + optionalRamBudgetCase_ = 0; + optionalRamBudget_ = null; + onChanged(); + } + return this; + } + + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return Whether the autotuneAlgorithm field is set. + */ + @java.lang.Override + public boolean hasAutotuneAlgorithm() { + return optionalAutotuneAlgorithmCase_ == 4; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The enum numeric value on the wire for autotuneAlgorithm. + */ + @java.lang.Override + public int getAutotuneAlgorithmValue() { + if (optionalAutotuneAlgorithmCase_ == 4) { + return ((java.lang.Integer) optionalAutotuneAlgorithm_).intValue(); + } + return 0; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @param value The enum numeric value on the wire for autotuneAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setAutotuneAlgorithmValue(int value) { + optionalAutotuneAlgorithmCase_ = 4; + optionalAutotuneAlgorithm_ = value; + onChanged(); + return this; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return The autotuneAlgorithm. + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAutotuneAlgorithm() { + if (optionalAutotuneAlgorithmCase_ == 4) { + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.forNumber( + (java.lang.Integer) optionalAutotuneAlgorithm_); + return result == null ? org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.UNRECOGNIZED : result; + } + return org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.DEFAULT; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @param value The autotuneAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setAutotuneAlgorithm(org.tensorflow.proto.data.model.Model.AutotuneAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } + optionalAutotuneAlgorithmCase_ = 4; + optionalAutotuneAlgorithm_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.model.AutotuneAlgorithm autotune_algorithm = 4; + * @return This builder for chaining. + */ + public Builder clearAutotuneAlgorithm() { + if (optionalAutotuneAlgorithmCase_ == 4) { + optionalAutotuneAlgorithmCase_ = 0; + optionalAutotuneAlgorithm_ = null; + onChanged(); + } + return this; + } + + /** + * int64 initial_parallelism = 5; + * @return Whether the initialParallelism field is set. + */ + public boolean hasInitialParallelism() { + return optionalInitialParallelismCase_ == 5; + } + /** + * int64 initial_parallelism = 5; + * @return The initialParallelism. + */ + public long getInitialParallelism() { + if (optionalInitialParallelismCase_ == 5) { + return (java.lang.Long) optionalInitialParallelism_; + } + return 0L; + } + /** + * int64 initial_parallelism = 5; + * @param value The initialParallelism to set. + * @return This builder for chaining. + */ + public Builder setInitialParallelism(long value) { + + optionalInitialParallelismCase_ = 5; + optionalInitialParallelism_ = value; + onChanged(); + return this; + } + /** + * int64 initial_parallelism = 5; + * @return This builder for chaining. + */ + public Builder clearInitialParallelism() { + if (optionalInitialParallelismCase_ == 5) { + optionalInitialParallelismCase_ = 0; + optionalInitialParallelism_ = null; + onChanged(); + } + return this; + } + + /** + * int64 min_parallelism = 6; + * @return Whether the minParallelism field is set. + */ + public boolean hasMinParallelism() { + return optionalMinParallelismCase_ == 6; + } + /** + * int64 min_parallelism = 6; + * @return The minParallelism. + */ + public long getMinParallelism() { + if (optionalMinParallelismCase_ == 6) { + return (java.lang.Long) optionalMinParallelism_; + } + return 0L; + } + /** + * int64 min_parallelism = 6; + * @param value The minParallelism to set. + * @return This builder for chaining. + */ + public Builder setMinParallelism(long value) { + + optionalMinParallelismCase_ = 6; + optionalMinParallelism_ = value; + onChanged(); + return this; + } + /** + * int64 min_parallelism = 6; + * @return This builder for chaining. + */ + public Builder clearMinParallelism() { + if (optionalMinParallelismCase_ == 6) { + optionalMinParallelismCase_ = 0; + optionalMinParallelism_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.AutotuneOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.AutotuneOptions) + private static final org.tensorflow.proto.data.DatasetOptions.AutotuneOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.AutotuneOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.AutotuneOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutotuneOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.AutotuneOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CardinalityOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.CardinalityOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The enum numeric value on the wire for computeLevel. + */ + int getComputeLevelValue(); + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The computeLevel. + */ + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel getComputeLevel(); + } + /** + *
    +   * next: 2
    +   * 
    + * + * Protobuf type {@code tensorflow.data.CardinalityOptions} + */ + public static final class CardinalityOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.CardinalityOptions) + CardinalityOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + CardinalityOptions.class.getName()); + } + // Use CardinalityOptions.newBuilder() to construct. + private CardinalityOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CardinalityOptions() { + computeLevel_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_CardinalityOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_CardinalityOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.class, org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.Builder.class); + } + + /** + * Protobuf enum {@code tensorflow.data.CardinalityOptions.ComputeLevel} + */ + public enum ComputeLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CARDINALITY_COMPUTE_UNSPECIFIED = 0; + */ + CARDINALITY_COMPUTE_UNSPECIFIED(0), + /** + *
    +       * Cardinality will only be computed if it can be determined in a cheap
    +       * manner (ie. without reading from file sources). If the cardinality would
    +       * be nontrivial to compute, Cardinality() will return UNKNOWN_CARDINALITY.
    +       * 
    + * + * CARDINALITY_COMPUTE_LOW = 1; + */ + CARDINALITY_COMPUTE_LOW(1), + /** + *
    +       * Moderate effort will be made to determine cardinality, such as reading
    +       * index data from source files. If significant work is needed to compute
    +       * cardinality (e.g. reading entire source file contents or executing user
    +       * defined functions), Cardinality() will return UNKNOWN_CARDINALITY.
    +       * 
    + * + * CARDINALITY_COMPUTE_MODERATE = 2; + */ + CARDINALITY_COMPUTE_MODERATE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ComputeLevel.class.getName()); + } + /** + * CARDINALITY_COMPUTE_UNSPECIFIED = 0; + */ + public static final int CARDINALITY_COMPUTE_UNSPECIFIED_VALUE = 0; + /** + *
    +       * Cardinality will only be computed if it can be determined in a cheap
    +       * manner (ie. without reading from file sources). If the cardinality would
    +       * be nontrivial to compute, Cardinality() will return UNKNOWN_CARDINALITY.
    +       * 
    + * + * CARDINALITY_COMPUTE_LOW = 1; + */ + public static final int CARDINALITY_COMPUTE_LOW_VALUE = 1; + /** + *
    +       * Moderate effort will be made to determine cardinality, such as reading
    +       * index data from source files. If significant work is needed to compute
    +       * cardinality (e.g. reading entire source file contents or executing user
    +       * defined functions), Cardinality() will return UNKNOWN_CARDINALITY.
    +       * 
    + * + * CARDINALITY_COMPUTE_MODERATE = 2; + */ + public static final int CARDINALITY_COMPUTE_MODERATE_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; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ComputeLevel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ComputeLevel forNumber(int value) { + switch (value) { + case 0: return CARDINALITY_COMPUTE_UNSPECIFIED; + case 1: return CARDINALITY_COMPUTE_LOW; + case 2: return CARDINALITY_COMPUTE_MODERATE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ComputeLevel> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ComputeLevel findValueByNumber(int number) { + return ComputeLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.DatasetOptions.CardinalityOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final ComputeLevel[] VALUES = values(); + + public static ComputeLevel 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 ComputeLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.CardinalityOptions.ComputeLevel) + } + + public static final int COMPUTE_LEVEL_FIELD_NUMBER = 1; + private int computeLevel_ = 0; + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The enum numeric value on the wire for computeLevel. + */ + @java.lang.Override public int getComputeLevelValue() { + return computeLevel_; + } + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The computeLevel. + */ + @java.lang.Override public org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel getComputeLevel() { + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel result = org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.forNumber(computeLevel_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.UNRECOGNIZED : result; + } + + 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 (computeLevel_ != org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.CARDINALITY_COMPUTE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, computeLevel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (computeLevel_ != org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.CARDINALITY_COMPUTE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, computeLevel_); + } + size += getUnknownFields().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.DatasetOptions.CardinalityOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions other = (org.tensorflow.proto.data.DatasetOptions.CardinalityOptions) obj; + + if (computeLevel_ != other.computeLevel_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + COMPUTE_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + computeLevel_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions 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.DatasetOptions.CardinalityOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions 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.DatasetOptions.CardinalityOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.CardinalityOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 2
    +     * 
    + * + * Protobuf type {@code tensorflow.data.CardinalityOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.CardinalityOptions) + org.tensorflow.proto.data.DatasetOptions.CardinalityOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_CardinalityOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_CardinalityOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.class, org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + computeLevel_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_CardinalityOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.CardinalityOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.CardinalityOptions build() { + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.CardinalityOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions result = new org.tensorflow.proto.data.DatasetOptions.CardinalityOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.CardinalityOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.computeLevel_ = computeLevel_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.CardinalityOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.CardinalityOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.CardinalityOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.getDefaultInstance()) return this; + if (other.computeLevel_ != 0) { + setComputeLevelValue(other.getComputeLevelValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + computeLevel_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int computeLevel_ = 0; + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The enum numeric value on the wire for computeLevel. + */ + @java.lang.Override public int getComputeLevelValue() { + return computeLevel_; + } + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @param value The enum numeric value on the wire for computeLevel to set. + * @return This builder for chaining. + */ + public Builder setComputeLevelValue(int value) { + computeLevel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return The computeLevel. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel getComputeLevel() { + org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel result = org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.forNumber(computeLevel_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel.UNRECOGNIZED : result; + } + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @param value The computeLevel to set. + * @return This builder for chaining. + */ + public Builder setComputeLevel(org.tensorflow.proto.data.DatasetOptions.CardinalityOptions.ComputeLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + computeLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.CardinalityOptions.ComputeLevel compute_level = 1; + * @return This builder for chaining. + */ + public Builder clearComputeLevel() { + bitField0_ = (bitField0_ & ~0x00000001); + computeLevel_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.CardinalityOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.CardinalityOptions) + private static final org.tensorflow.proto.data.DatasetOptions.CardinalityOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.CardinalityOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.CardinalityOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CardinalityOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.CardinalityOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributeOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.DistributeOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The enum numeric value on the wire for autoShardPolicy. + */ + int getAutoShardPolicyValue(); + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The autoShardPolicy. + */ + org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy getAutoShardPolicy(); + + /** + * int32 num_devices = 2; + * @return Whether the numDevices field is set. + */ + boolean hasNumDevices(); + /** + * int32 num_devices = 2; + * @return The numDevices. + */ + int getNumDevices(); + + org.tensorflow.proto.data.DatasetOptions.DistributeOptions.OptionalNumDevicesCase getOptionalNumDevicesCase(); + } + /** + *
    +   * next: 3
    +   * 
    + * + * Protobuf type {@code tensorflow.data.DistributeOptions} + */ + public static final class DistributeOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.DistributeOptions) + DistributeOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DistributeOptions.class.getName()); + } + // Use DistributeOptions.newBuilder() to construct. + private DistributeOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DistributeOptions() { + autoShardPolicy_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_DistributeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.DistributeOptions.class, org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder.class); + } + + private int optionalNumDevicesCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalNumDevices_; + public enum OptionalNumDevicesCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NUM_DEVICES(2), + OPTIONALNUMDEVICES_NOT_SET(0); + private final int value; + private OptionalNumDevicesCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalNumDevicesCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalNumDevicesCase forNumber(int value) { + switch (value) { + case 2: return NUM_DEVICES; + case 0: return OPTIONALNUMDEVICES_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalNumDevicesCase + getOptionalNumDevicesCase() { + return OptionalNumDevicesCase.forNumber( + optionalNumDevicesCase_); + } + + public static final int AUTO_SHARD_POLICY_FIELD_NUMBER = 1; + private int autoShardPolicy_ = 0; + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The enum numeric value on the wire for autoShardPolicy. + */ + @java.lang.Override public int getAutoShardPolicyValue() { + return autoShardPolicy_; + } + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The autoShardPolicy. + */ + @java.lang.Override public org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy getAutoShardPolicy() { + org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy result = org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.forNumber(autoShardPolicy_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.UNRECOGNIZED : result; + } + + public static final int NUM_DEVICES_FIELD_NUMBER = 2; + /** + * int32 num_devices = 2; + * @return Whether the numDevices field is set. + */ + @java.lang.Override + public boolean hasNumDevices() { + return optionalNumDevicesCase_ == 2; + } + /** + * int32 num_devices = 2; + * @return The numDevices. + */ + @java.lang.Override + public int getNumDevices() { + if (optionalNumDevicesCase_ == 2) { + return (java.lang.Integer) optionalNumDevices_; + } + return 0; + } + + 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 (autoShardPolicy_ != org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.AUTO.getNumber()) { + output.writeEnum(1, autoShardPolicy_); + } + if (optionalNumDevicesCase_ == 2) { + output.writeInt32( + 2, (int)((java.lang.Integer) optionalNumDevices_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (autoShardPolicy_ != org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.AUTO.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, autoShardPolicy_); + } + if (optionalNumDevicesCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 2, (int)((java.lang.Integer) optionalNumDevices_)); + } + size += getUnknownFields().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.DatasetOptions.DistributeOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.DistributeOptions other = (org.tensorflow.proto.data.DatasetOptions.DistributeOptions) obj; + + if (autoShardPolicy_ != other.autoShardPolicy_) return false; + if (!getOptionalNumDevicesCase().equals(other.getOptionalNumDevicesCase())) return false; + switch (optionalNumDevicesCase_) { + case 2: + if (getNumDevices() + != other.getNumDevices()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + AUTO_SHARD_POLICY_FIELD_NUMBER; + hash = (53 * hash) + autoShardPolicy_; + switch (optionalNumDevicesCase_) { + case 2: + hash = (37 * hash) + NUM_DEVICES_FIELD_NUMBER; + hash = (53 * hash) + getNumDevices(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions 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.DatasetOptions.DistributeOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions 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.DatasetOptions.DistributeOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.DistributeOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 3
    +     * 
    + * + * Protobuf type {@code tensorflow.data.DistributeOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.DistributeOptions) + org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_DistributeOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.DistributeOptions.class, org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.DistributeOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + autoShardPolicy_ = 0; + optionalNumDevicesCase_ = 0; + optionalNumDevices_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_DistributeOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions build() { + org.tensorflow.proto.data.DatasetOptions.DistributeOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.DistributeOptions result = new org.tensorflow.proto.data.DatasetOptions.DistributeOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.DistributeOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.autoShardPolicy_ = autoShardPolicy_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.DistributeOptions result) { + result.optionalNumDevicesCase_ = optionalNumDevicesCase_; + result.optionalNumDevices_ = this.optionalNumDevices_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.DistributeOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.DistributeOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.DistributeOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance()) return this; + if (other.autoShardPolicy_ != 0) { + setAutoShardPolicyValue(other.getAutoShardPolicyValue()); + } + switch (other.getOptionalNumDevicesCase()) { + case NUM_DEVICES: { + setNumDevices(other.getNumDevices()); + break; + } + case OPTIONALNUMDEVICES_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + autoShardPolicy_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + optionalNumDevices_ = input.readInt32(); + optionalNumDevicesCase_ = 2; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalNumDevicesCase_ = 0; + private java.lang.Object optionalNumDevices_; + public OptionalNumDevicesCase + getOptionalNumDevicesCase() { + return OptionalNumDevicesCase.forNumber( + optionalNumDevicesCase_); + } + + public Builder clearOptionalNumDevices() { + optionalNumDevicesCase_ = 0; + optionalNumDevices_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private int autoShardPolicy_ = 0; + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The enum numeric value on the wire for autoShardPolicy. + */ + @java.lang.Override public int getAutoShardPolicyValue() { + return autoShardPolicy_; + } + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @param value The enum numeric value on the wire for autoShardPolicy to set. + * @return This builder for chaining. + */ + public Builder setAutoShardPolicyValue(int value) { + autoShardPolicy_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return The autoShardPolicy. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy getAutoShardPolicy() { + org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy result = org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.forNumber(autoShardPolicy_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy.UNRECOGNIZED : result; + } + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @param value The autoShardPolicy to set. + * @return This builder for chaining. + */ + public Builder setAutoShardPolicy(org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + autoShardPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.AutoShardPolicy auto_shard_policy = 1; + * @return This builder for chaining. + */ + public Builder clearAutoShardPolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + autoShardPolicy_ = 0; + onChanged(); + return this; + } + + /** + * int32 num_devices = 2; + * @return Whether the numDevices field is set. + */ + public boolean hasNumDevices() { + return optionalNumDevicesCase_ == 2; + } + /** + * int32 num_devices = 2; + * @return The numDevices. + */ + public int getNumDevices() { + if (optionalNumDevicesCase_ == 2) { + return (java.lang.Integer) optionalNumDevices_; + } + return 0; + } + /** + * int32 num_devices = 2; + * @param value The numDevices to set. + * @return This builder for chaining. + */ + public Builder setNumDevices(int value) { + + optionalNumDevicesCase_ = 2; + optionalNumDevices_ = value; + onChanged(); + return this; + } + /** + * int32 num_devices = 2; + * @return This builder for chaining. + */ + public Builder clearNumDevices() { + if (optionalNumDevicesCase_ == 2) { + optionalNumDevicesCase_ = 0; + optionalNumDevices_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.DistributeOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.DistributeOptions) + private static final org.tensorflow.proto.data.DatasetOptions.DistributeOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.DistributeOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.DistributeOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributeOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.DistributeOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OptimizationOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.OptimizationOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * bool apply_default_optimizations = 1; + * @return Whether the applyDefaultOptimizations field is set. + */ + boolean hasApplyDefaultOptimizations(); + /** + * bool apply_default_optimizations = 1; + * @return The applyDefaultOptimizations. + */ + boolean getApplyDefaultOptimizations(); + + /** + * bool filter_fusion = 6; + * @return Whether the filterFusion field is set. + */ + boolean hasFilterFusion(); + /** + * bool filter_fusion = 6; + * @return The filterFusion. + */ + boolean getFilterFusion(); + + /** + * bool map_and_batch_fusion = 9; + * @return Whether the mapAndBatchFusion field is set. + */ + boolean hasMapAndBatchFusion(); + /** + * bool map_and_batch_fusion = 9; + * @return The mapAndBatchFusion. + */ + boolean getMapAndBatchFusion(); + + /** + * bool map_and_filter_fusion = 10; + * @return Whether the mapAndFilterFusion field is set. + */ + boolean hasMapAndFilterFusion(); + /** + * bool map_and_filter_fusion = 10; + * @return The mapAndFilterFusion. + */ + boolean getMapAndFilterFusion(); + + /** + * bool map_fusion = 11; + * @return Whether the mapFusion field is set. + */ + boolean hasMapFusion(); + /** + * bool map_fusion = 11; + * @return The mapFusion. + */ + boolean getMapFusion(); + + /** + * bool map_parallelization = 12; + * @return Whether the mapParallelization field is set. + */ + boolean hasMapParallelization(); + /** + * bool map_parallelization = 12; + * @return The mapParallelization. + */ + boolean getMapParallelization(); + + /** + * bool noop_elimination = 14; + * @return Whether the noopElimination field is set. + */ + boolean hasNoopElimination(); + /** + * bool noop_elimination = 14; + * @return The noopElimination. + */ + boolean getNoopElimination(); + + /** + * bool parallel_batch = 15; + * @return Whether the parallelBatch field is set. + */ + boolean hasParallelBatch(); + /** + * bool parallel_batch = 15; + * @return The parallelBatch. + */ + boolean getParallelBatch(); + + /** + * bool shuffle_and_repeat_fusion = 17; + * @return Whether the shuffleAndRepeatFusion field is set. + */ + boolean hasShuffleAndRepeatFusion(); + /** + * bool shuffle_and_repeat_fusion = 17; + * @return The shuffleAndRepeatFusion. + */ + boolean getShuffleAndRepeatFusion(); + + /** + * bool filter_parallelization = 18; + * @return Whether the filterParallelization field is set. + */ + boolean hasFilterParallelization(); + /** + * bool filter_parallelization = 18; + * @return The filterParallelization. + */ + boolean getFilterParallelization(); + + /** + * bool inject_prefetch = 19; + * @return Whether the injectPrefetch field is set. + */ + boolean hasInjectPrefetch(); + /** + * bool inject_prefetch = 19; + * @return The injectPrefetch. + */ + boolean getInjectPrefetch(); + + /** + * bool seq_interleave_prefetch = 21; + * @return Whether the seqInterleavePrefetch field is set. + */ + boolean hasSeqInterleavePrefetch(); + /** + * bool seq_interleave_prefetch = 21; + * @return The seqInterleavePrefetch. + */ + boolean getSeqInterleavePrefetch(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalApplyDefaultOptimizationsCase getOptionalApplyDefaultOptimizationsCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalFilterFusionCase getOptionalFilterFusionCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalMapAndBatchFusionCase getOptionalMapAndBatchFusionCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalMapAndFilterFusionCase getOptionalMapAndFilterFusionCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalMapFusionCase getOptionalMapFusionCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalMapParallelizationCase getOptionalMapParallelizationCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalNoopEliminationCase getOptionalNoopEliminationCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalParallelBatchCase getOptionalParallelBatchCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalShuffleAndRepeatFusionCase getOptionalShuffleAndRepeatFusionCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalFilterParallelizationCase getOptionalFilterParallelizationCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalInjectPrefetchCase getOptionalInjectPrefetchCase(); + + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.OptionalSeqInterleavePrefetchCase getOptionalSeqInterleavePrefetchCase(); + } + /** + *
    +   * next: 22
    +   * 
    + * + * Protobuf type {@code tensorflow.data.OptimizationOptions} + */ + public static final class OptimizationOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.OptimizationOptions) + OptimizationOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizationOptions.class.getName()); + } + // Use OptimizationOptions.newBuilder() to construct. + private OptimizationOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OptimizationOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_OptimizationOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.class, org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder.class); + } + + private int optionalApplyDefaultOptimizationsCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalApplyDefaultOptimizations_; + public enum OptionalApplyDefaultOptimizationsCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + APPLY_DEFAULT_OPTIMIZATIONS(1), + OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET(0); + private final int value; + private OptionalApplyDefaultOptimizationsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalApplyDefaultOptimizationsCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalApplyDefaultOptimizationsCase forNumber(int value) { + switch (value) { + case 1: return APPLY_DEFAULT_OPTIMIZATIONS; + case 0: return OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalApplyDefaultOptimizationsCase + getOptionalApplyDefaultOptimizationsCase() { + return OptionalApplyDefaultOptimizationsCase.forNumber( + optionalApplyDefaultOptimizationsCase_); + } + + private int optionalFilterFusionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalFilterFusion_; + public enum OptionalFilterFusionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FILTER_FUSION(6), + OPTIONALFILTERFUSION_NOT_SET(0); + private final int value; + private OptionalFilterFusionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalFilterFusionCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalFilterFusionCase forNumber(int value) { + switch (value) { + case 6: return FILTER_FUSION; + case 0: return OPTIONALFILTERFUSION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalFilterFusionCase + getOptionalFilterFusionCase() { + return OptionalFilterFusionCase.forNumber( + optionalFilterFusionCase_); + } + + private int optionalMapAndBatchFusionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMapAndBatchFusion_; + public enum OptionalMapAndBatchFusionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAP_AND_BATCH_FUSION(9), + OPTIONALMAPANDBATCHFUSION_NOT_SET(0); + private final int value; + private OptionalMapAndBatchFusionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMapAndBatchFusionCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMapAndBatchFusionCase forNumber(int value) { + switch (value) { + case 9: return MAP_AND_BATCH_FUSION; + case 0: return OPTIONALMAPANDBATCHFUSION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMapAndBatchFusionCase + getOptionalMapAndBatchFusionCase() { + return OptionalMapAndBatchFusionCase.forNumber( + optionalMapAndBatchFusionCase_); + } + + private int optionalMapAndFilterFusionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMapAndFilterFusion_; + public enum OptionalMapAndFilterFusionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAP_AND_FILTER_FUSION(10), + OPTIONALMAPANDFILTERFUSION_NOT_SET(0); + private final int value; + private OptionalMapAndFilterFusionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMapAndFilterFusionCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMapAndFilterFusionCase forNumber(int value) { + switch (value) { + case 10: return MAP_AND_FILTER_FUSION; + case 0: return OPTIONALMAPANDFILTERFUSION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMapAndFilterFusionCase + getOptionalMapAndFilterFusionCase() { + return OptionalMapAndFilterFusionCase.forNumber( + optionalMapAndFilterFusionCase_); + } + + private int optionalMapFusionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMapFusion_; + public enum OptionalMapFusionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAP_FUSION(11), + OPTIONALMAPFUSION_NOT_SET(0); + private final int value; + private OptionalMapFusionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMapFusionCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMapFusionCase forNumber(int value) { + switch (value) { + case 11: return MAP_FUSION; + case 0: return OPTIONALMAPFUSION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMapFusionCase + getOptionalMapFusionCase() { + return OptionalMapFusionCase.forNumber( + optionalMapFusionCase_); + } + + private int optionalMapParallelizationCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMapParallelization_; + public enum OptionalMapParallelizationCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAP_PARALLELIZATION(12), + OPTIONALMAPPARALLELIZATION_NOT_SET(0); + private final int value; + private OptionalMapParallelizationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMapParallelizationCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMapParallelizationCase forNumber(int value) { + switch (value) { + case 12: return MAP_PARALLELIZATION; + case 0: return OPTIONALMAPPARALLELIZATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMapParallelizationCase + getOptionalMapParallelizationCase() { + return OptionalMapParallelizationCase.forNumber( + optionalMapParallelizationCase_); + } + + private int optionalNoopEliminationCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalNoopElimination_; + public enum OptionalNoopEliminationCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + NOOP_ELIMINATION(14), + OPTIONALNOOPELIMINATION_NOT_SET(0); + private final int value; + private OptionalNoopEliminationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalNoopEliminationCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalNoopEliminationCase forNumber(int value) { + switch (value) { + case 14: return NOOP_ELIMINATION; + case 0: return OPTIONALNOOPELIMINATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalNoopEliminationCase + getOptionalNoopEliminationCase() { + return OptionalNoopEliminationCase.forNumber( + optionalNoopEliminationCase_); + } + + private int optionalParallelBatchCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalParallelBatch_; + public enum OptionalParallelBatchCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PARALLEL_BATCH(15), + OPTIONALPARALLELBATCH_NOT_SET(0); + private final int value; + private OptionalParallelBatchCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalParallelBatchCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalParallelBatchCase forNumber(int value) { + switch (value) { + case 15: return PARALLEL_BATCH; + case 0: return OPTIONALPARALLELBATCH_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalParallelBatchCase + getOptionalParallelBatchCase() { + return OptionalParallelBatchCase.forNumber( + optionalParallelBatchCase_); + } + + private int optionalShuffleAndRepeatFusionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalShuffleAndRepeatFusion_; + public enum OptionalShuffleAndRepeatFusionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SHUFFLE_AND_REPEAT_FUSION(17), + OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET(0); + private final int value; + private OptionalShuffleAndRepeatFusionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalShuffleAndRepeatFusionCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalShuffleAndRepeatFusionCase forNumber(int value) { + switch (value) { + case 17: return SHUFFLE_AND_REPEAT_FUSION; + case 0: return OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalShuffleAndRepeatFusionCase + getOptionalShuffleAndRepeatFusionCase() { + return OptionalShuffleAndRepeatFusionCase.forNumber( + optionalShuffleAndRepeatFusionCase_); + } + + private int optionalFilterParallelizationCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalFilterParallelization_; + public enum OptionalFilterParallelizationCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FILTER_PARALLELIZATION(18), + OPTIONALFILTERPARALLELIZATION_NOT_SET(0); + private final int value; + private OptionalFilterParallelizationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalFilterParallelizationCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalFilterParallelizationCase forNumber(int value) { + switch (value) { + case 18: return FILTER_PARALLELIZATION; + case 0: return OPTIONALFILTERPARALLELIZATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalFilterParallelizationCase + getOptionalFilterParallelizationCase() { + return OptionalFilterParallelizationCase.forNumber( + optionalFilterParallelizationCase_); + } + + private int optionalInjectPrefetchCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalInjectPrefetch_; + public enum OptionalInjectPrefetchCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INJECT_PREFETCH(19), + OPTIONALINJECTPREFETCH_NOT_SET(0); + private final int value; + private OptionalInjectPrefetchCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalInjectPrefetchCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalInjectPrefetchCase forNumber(int value) { + switch (value) { + case 19: return INJECT_PREFETCH; + case 0: return OPTIONALINJECTPREFETCH_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalInjectPrefetchCase + getOptionalInjectPrefetchCase() { + return OptionalInjectPrefetchCase.forNumber( + optionalInjectPrefetchCase_); + } + + private int optionalSeqInterleavePrefetchCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalSeqInterleavePrefetch_; + public enum OptionalSeqInterleavePrefetchCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SEQ_INTERLEAVE_PREFETCH(21), + OPTIONALSEQINTERLEAVEPREFETCH_NOT_SET(0); + private final int value; + private OptionalSeqInterleavePrefetchCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalSeqInterleavePrefetchCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalSeqInterleavePrefetchCase forNumber(int value) { + switch (value) { + case 21: return SEQ_INTERLEAVE_PREFETCH; + case 0: return OPTIONALSEQINTERLEAVEPREFETCH_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalSeqInterleavePrefetchCase + getOptionalSeqInterleavePrefetchCase() { + return OptionalSeqInterleavePrefetchCase.forNumber( + optionalSeqInterleavePrefetchCase_); + } + + public static final int APPLY_DEFAULT_OPTIMIZATIONS_FIELD_NUMBER = 1; + /** + * bool apply_default_optimizations = 1; + * @return Whether the applyDefaultOptimizations field is set. + */ + @java.lang.Override + public boolean hasApplyDefaultOptimizations() { + return optionalApplyDefaultOptimizationsCase_ == 1; + } + /** + * bool apply_default_optimizations = 1; + * @return The applyDefaultOptimizations. + */ + @java.lang.Override + public boolean getApplyDefaultOptimizations() { + if (optionalApplyDefaultOptimizationsCase_ == 1) { + return (java.lang.Boolean) optionalApplyDefaultOptimizations_; + } + return false; + } + + public static final int FILTER_FUSION_FIELD_NUMBER = 6; + /** + * bool filter_fusion = 6; + * @return Whether the filterFusion field is set. + */ + @java.lang.Override + public boolean hasFilterFusion() { + return optionalFilterFusionCase_ == 6; + } + /** + * bool filter_fusion = 6; + * @return The filterFusion. + */ + @java.lang.Override + public boolean getFilterFusion() { + if (optionalFilterFusionCase_ == 6) { + return (java.lang.Boolean) optionalFilterFusion_; + } + return false; + } + + public static final int MAP_AND_BATCH_FUSION_FIELD_NUMBER = 9; + /** + * bool map_and_batch_fusion = 9; + * @return Whether the mapAndBatchFusion field is set. + */ + @java.lang.Override + public boolean hasMapAndBatchFusion() { + return optionalMapAndBatchFusionCase_ == 9; + } + /** + * bool map_and_batch_fusion = 9; + * @return The mapAndBatchFusion. + */ + @java.lang.Override + public boolean getMapAndBatchFusion() { + if (optionalMapAndBatchFusionCase_ == 9) { + return (java.lang.Boolean) optionalMapAndBatchFusion_; + } + return false; + } + + public static final int MAP_AND_FILTER_FUSION_FIELD_NUMBER = 10; + /** + * bool map_and_filter_fusion = 10; + * @return Whether the mapAndFilterFusion field is set. + */ + @java.lang.Override + public boolean hasMapAndFilterFusion() { + return optionalMapAndFilterFusionCase_ == 10; + } + /** + * bool map_and_filter_fusion = 10; + * @return The mapAndFilterFusion. + */ + @java.lang.Override + public boolean getMapAndFilterFusion() { + if (optionalMapAndFilterFusionCase_ == 10) { + return (java.lang.Boolean) optionalMapAndFilterFusion_; + } + return false; + } + + public static final int MAP_FUSION_FIELD_NUMBER = 11; + /** + * bool map_fusion = 11; + * @return Whether the mapFusion field is set. + */ + @java.lang.Override + public boolean hasMapFusion() { + return optionalMapFusionCase_ == 11; + } + /** + * bool map_fusion = 11; + * @return The mapFusion. + */ + @java.lang.Override + public boolean getMapFusion() { + if (optionalMapFusionCase_ == 11) { + return (java.lang.Boolean) optionalMapFusion_; + } + return false; + } + + public static final int MAP_PARALLELIZATION_FIELD_NUMBER = 12; + /** + * bool map_parallelization = 12; + * @return Whether the mapParallelization field is set. + */ + @java.lang.Override + public boolean hasMapParallelization() { + return optionalMapParallelizationCase_ == 12; + } + /** + * bool map_parallelization = 12; + * @return The mapParallelization. + */ + @java.lang.Override + public boolean getMapParallelization() { + if (optionalMapParallelizationCase_ == 12) { + return (java.lang.Boolean) optionalMapParallelization_; + } + return false; + } + + public static final int NOOP_ELIMINATION_FIELD_NUMBER = 14; + /** + * bool noop_elimination = 14; + * @return Whether the noopElimination field is set. + */ + @java.lang.Override + public boolean hasNoopElimination() { + return optionalNoopEliminationCase_ == 14; + } + /** + * bool noop_elimination = 14; + * @return The noopElimination. + */ + @java.lang.Override + public boolean getNoopElimination() { + if (optionalNoopEliminationCase_ == 14) { + return (java.lang.Boolean) optionalNoopElimination_; + } + return false; + } + + public static final int PARALLEL_BATCH_FIELD_NUMBER = 15; + /** + * bool parallel_batch = 15; + * @return Whether the parallelBatch field is set. + */ + @java.lang.Override + public boolean hasParallelBatch() { + return optionalParallelBatchCase_ == 15; + } + /** + * bool parallel_batch = 15; + * @return The parallelBatch. + */ + @java.lang.Override + public boolean getParallelBatch() { + if (optionalParallelBatchCase_ == 15) { + return (java.lang.Boolean) optionalParallelBatch_; + } + return false; + } + + public static final int SHUFFLE_AND_REPEAT_FUSION_FIELD_NUMBER = 17; + /** + * bool shuffle_and_repeat_fusion = 17; + * @return Whether the shuffleAndRepeatFusion field is set. + */ + @java.lang.Override + public boolean hasShuffleAndRepeatFusion() { + return optionalShuffleAndRepeatFusionCase_ == 17; + } + /** + * bool shuffle_and_repeat_fusion = 17; + * @return The shuffleAndRepeatFusion. + */ + @java.lang.Override + public boolean getShuffleAndRepeatFusion() { + if (optionalShuffleAndRepeatFusionCase_ == 17) { + return (java.lang.Boolean) optionalShuffleAndRepeatFusion_; + } + return false; + } + + public static final int FILTER_PARALLELIZATION_FIELD_NUMBER = 18; + /** + * bool filter_parallelization = 18; + * @return Whether the filterParallelization field is set. + */ + @java.lang.Override + public boolean hasFilterParallelization() { + return optionalFilterParallelizationCase_ == 18; + } + /** + * bool filter_parallelization = 18; + * @return The filterParallelization. + */ + @java.lang.Override + public boolean getFilterParallelization() { + if (optionalFilterParallelizationCase_ == 18) { + return (java.lang.Boolean) optionalFilterParallelization_; + } + return false; + } + + public static final int INJECT_PREFETCH_FIELD_NUMBER = 19; + /** + * bool inject_prefetch = 19; + * @return Whether the injectPrefetch field is set. + */ + @java.lang.Override + public boolean hasInjectPrefetch() { + return optionalInjectPrefetchCase_ == 19; + } + /** + * bool inject_prefetch = 19; + * @return The injectPrefetch. + */ + @java.lang.Override + public boolean getInjectPrefetch() { + if (optionalInjectPrefetchCase_ == 19) { + return (java.lang.Boolean) optionalInjectPrefetch_; + } + return false; + } + + public static final int SEQ_INTERLEAVE_PREFETCH_FIELD_NUMBER = 21; + /** + * bool seq_interleave_prefetch = 21; + * @return Whether the seqInterleavePrefetch field is set. + */ + @java.lang.Override + public boolean hasSeqInterleavePrefetch() { + return optionalSeqInterleavePrefetchCase_ == 21; + } + /** + * bool seq_interleave_prefetch = 21; + * @return The seqInterleavePrefetch. + */ + @java.lang.Override + public boolean getSeqInterleavePrefetch() { + if (optionalSeqInterleavePrefetchCase_ == 21) { + return (java.lang.Boolean) optionalSeqInterleavePrefetch_; + } + return false; + } + + 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 (optionalApplyDefaultOptimizationsCase_ == 1) { + output.writeBool( + 1, (boolean)((java.lang.Boolean) optionalApplyDefaultOptimizations_)); + } + if (optionalFilterFusionCase_ == 6) { + output.writeBool( + 6, (boolean)((java.lang.Boolean) optionalFilterFusion_)); + } + if (optionalMapAndBatchFusionCase_ == 9) { + output.writeBool( + 9, (boolean)((java.lang.Boolean) optionalMapAndBatchFusion_)); + } + if (optionalMapAndFilterFusionCase_ == 10) { + output.writeBool( + 10, (boolean)((java.lang.Boolean) optionalMapAndFilterFusion_)); + } + if (optionalMapFusionCase_ == 11) { + output.writeBool( + 11, (boolean)((java.lang.Boolean) optionalMapFusion_)); + } + if (optionalMapParallelizationCase_ == 12) { + output.writeBool( + 12, (boolean)((java.lang.Boolean) optionalMapParallelization_)); + } + if (optionalNoopEliminationCase_ == 14) { + output.writeBool( + 14, (boolean)((java.lang.Boolean) optionalNoopElimination_)); + } + if (optionalParallelBatchCase_ == 15) { + output.writeBool( + 15, (boolean)((java.lang.Boolean) optionalParallelBatch_)); + } + if (optionalShuffleAndRepeatFusionCase_ == 17) { + output.writeBool( + 17, (boolean)((java.lang.Boolean) optionalShuffleAndRepeatFusion_)); + } + if (optionalFilterParallelizationCase_ == 18) { + output.writeBool( + 18, (boolean)((java.lang.Boolean) optionalFilterParallelization_)); + } + if (optionalInjectPrefetchCase_ == 19) { + output.writeBool( + 19, (boolean)((java.lang.Boolean) optionalInjectPrefetch_)); + } + if (optionalSeqInterleavePrefetchCase_ == 21) { + output.writeBool( + 21, (boolean)((java.lang.Boolean) optionalSeqInterleavePrefetch_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalApplyDefaultOptimizationsCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 1, (boolean)((java.lang.Boolean) optionalApplyDefaultOptimizations_)); + } + if (optionalFilterFusionCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 6, (boolean)((java.lang.Boolean) optionalFilterFusion_)); + } + if (optionalMapAndBatchFusionCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 9, (boolean)((java.lang.Boolean) optionalMapAndBatchFusion_)); + } + if (optionalMapAndFilterFusionCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 10, (boolean)((java.lang.Boolean) optionalMapAndFilterFusion_)); + } + if (optionalMapFusionCase_ == 11) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 11, (boolean)((java.lang.Boolean) optionalMapFusion_)); + } + if (optionalMapParallelizationCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 12, (boolean)((java.lang.Boolean) optionalMapParallelization_)); + } + if (optionalNoopEliminationCase_ == 14) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 14, (boolean)((java.lang.Boolean) optionalNoopElimination_)); + } + if (optionalParallelBatchCase_ == 15) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 15, (boolean)((java.lang.Boolean) optionalParallelBatch_)); + } + if (optionalShuffleAndRepeatFusionCase_ == 17) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 17, (boolean)((java.lang.Boolean) optionalShuffleAndRepeatFusion_)); + } + if (optionalFilterParallelizationCase_ == 18) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 18, (boolean)((java.lang.Boolean) optionalFilterParallelization_)); + } + if (optionalInjectPrefetchCase_ == 19) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 19, (boolean)((java.lang.Boolean) optionalInjectPrefetch_)); + } + if (optionalSeqInterleavePrefetchCase_ == 21) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 21, (boolean)((java.lang.Boolean) optionalSeqInterleavePrefetch_)); + } + size += getUnknownFields().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.DatasetOptions.OptimizationOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions other = (org.tensorflow.proto.data.DatasetOptions.OptimizationOptions) obj; + + if (!getOptionalApplyDefaultOptimizationsCase().equals(other.getOptionalApplyDefaultOptimizationsCase())) return false; + switch (optionalApplyDefaultOptimizationsCase_) { + case 1: + if (getApplyDefaultOptimizations() + != other.getApplyDefaultOptimizations()) return false; + break; + case 0: + default: + } + if (!getOptionalFilterFusionCase().equals(other.getOptionalFilterFusionCase())) return false; + switch (optionalFilterFusionCase_) { + case 6: + if (getFilterFusion() + != other.getFilterFusion()) return false; + break; + case 0: + default: + } + if (!getOptionalMapAndBatchFusionCase().equals(other.getOptionalMapAndBatchFusionCase())) return false; + switch (optionalMapAndBatchFusionCase_) { + case 9: + if (getMapAndBatchFusion() + != other.getMapAndBatchFusion()) return false; + break; + case 0: + default: + } + if (!getOptionalMapAndFilterFusionCase().equals(other.getOptionalMapAndFilterFusionCase())) return false; + switch (optionalMapAndFilterFusionCase_) { + case 10: + if (getMapAndFilterFusion() + != other.getMapAndFilterFusion()) return false; + break; + case 0: + default: + } + if (!getOptionalMapFusionCase().equals(other.getOptionalMapFusionCase())) return false; + switch (optionalMapFusionCase_) { + case 11: + if (getMapFusion() + != other.getMapFusion()) return false; + break; + case 0: + default: + } + if (!getOptionalMapParallelizationCase().equals(other.getOptionalMapParallelizationCase())) return false; + switch (optionalMapParallelizationCase_) { + case 12: + if (getMapParallelization() + != other.getMapParallelization()) return false; + break; + case 0: + default: + } + if (!getOptionalNoopEliminationCase().equals(other.getOptionalNoopEliminationCase())) return false; + switch (optionalNoopEliminationCase_) { + case 14: + if (getNoopElimination() + != other.getNoopElimination()) return false; + break; + case 0: + default: + } + if (!getOptionalParallelBatchCase().equals(other.getOptionalParallelBatchCase())) return false; + switch (optionalParallelBatchCase_) { + case 15: + if (getParallelBatch() + != other.getParallelBatch()) return false; + break; + case 0: + default: + } + if (!getOptionalShuffleAndRepeatFusionCase().equals(other.getOptionalShuffleAndRepeatFusionCase())) return false; + switch (optionalShuffleAndRepeatFusionCase_) { + case 17: + if (getShuffleAndRepeatFusion() + != other.getShuffleAndRepeatFusion()) return false; + break; + case 0: + default: + } + if (!getOptionalFilterParallelizationCase().equals(other.getOptionalFilterParallelizationCase())) return false; + switch (optionalFilterParallelizationCase_) { + case 18: + if (getFilterParallelization() + != other.getFilterParallelization()) return false; + break; + case 0: + default: + } + if (!getOptionalInjectPrefetchCase().equals(other.getOptionalInjectPrefetchCase())) return false; + switch (optionalInjectPrefetchCase_) { + case 19: + if (getInjectPrefetch() + != other.getInjectPrefetch()) return false; + break; + case 0: + default: + } + if (!getOptionalSeqInterleavePrefetchCase().equals(other.getOptionalSeqInterleavePrefetchCase())) return false; + switch (optionalSeqInterleavePrefetchCase_) { + case 21: + if (getSeqInterleavePrefetch() + != other.getSeqInterleavePrefetch()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (optionalApplyDefaultOptimizationsCase_) { + case 1: + hash = (37 * hash) + APPLY_DEFAULT_OPTIMIZATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getApplyDefaultOptimizations()); + break; + case 0: + default: + } + switch (optionalFilterFusionCase_) { + case 6: + hash = (37 * hash) + FILTER_FUSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFilterFusion()); + break; + case 0: + default: + } + switch (optionalMapAndBatchFusionCase_) { + case 9: + hash = (37 * hash) + MAP_AND_BATCH_FUSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMapAndBatchFusion()); + break; + case 0: + default: + } + switch (optionalMapAndFilterFusionCase_) { + case 10: + hash = (37 * hash) + MAP_AND_FILTER_FUSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMapAndFilterFusion()); + break; + case 0: + default: + } + switch (optionalMapFusionCase_) { + case 11: + hash = (37 * hash) + MAP_FUSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMapFusion()); + break; + case 0: + default: + } + switch (optionalMapParallelizationCase_) { + case 12: + hash = (37 * hash) + MAP_PARALLELIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getMapParallelization()); + break; + case 0: + default: + } + switch (optionalNoopEliminationCase_) { + case 14: + hash = (37 * hash) + NOOP_ELIMINATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getNoopElimination()); + break; + case 0: + default: + } + switch (optionalParallelBatchCase_) { + case 15: + hash = (37 * hash) + PARALLEL_BATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getParallelBatch()); + break; + case 0: + default: + } + switch (optionalShuffleAndRepeatFusionCase_) { + case 17: + hash = (37 * hash) + SHUFFLE_AND_REPEAT_FUSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getShuffleAndRepeatFusion()); + break; + case 0: + default: + } + switch (optionalFilterParallelizationCase_) { + case 18: + hash = (37 * hash) + FILTER_PARALLELIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFilterParallelization()); + break; + case 0: + default: + } + switch (optionalInjectPrefetchCase_) { + case 19: + hash = (37 * hash) + INJECT_PREFETCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInjectPrefetch()); + break; + case 0: + default: + } + switch (optionalSeqInterleavePrefetchCase_) { + case 21: + hash = (37 * hash) + SEQ_INTERLEAVE_PREFETCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSeqInterleavePrefetch()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions 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.DatasetOptions.OptimizationOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions 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.DatasetOptions.OptimizationOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.OptimizationOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 22
    +     * 
    + * + * Protobuf type {@code tensorflow.data.OptimizationOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.OptimizationOptions) + org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_OptimizationOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.class, org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optionalApplyDefaultOptimizationsCase_ = 0; + optionalApplyDefaultOptimizations_ = null; + optionalFilterFusionCase_ = 0; + optionalFilterFusion_ = null; + optionalMapAndBatchFusionCase_ = 0; + optionalMapAndBatchFusion_ = null; + optionalMapAndFilterFusionCase_ = 0; + optionalMapAndFilterFusion_ = null; + optionalMapFusionCase_ = 0; + optionalMapFusion_ = null; + optionalMapParallelizationCase_ = 0; + optionalMapParallelization_ = null; + optionalNoopEliminationCase_ = 0; + optionalNoopElimination_ = null; + optionalParallelBatchCase_ = 0; + optionalParallelBatch_ = null; + optionalShuffleAndRepeatFusionCase_ = 0; + optionalShuffleAndRepeatFusion_ = null; + optionalFilterParallelizationCase_ = 0; + optionalFilterParallelization_ = null; + optionalInjectPrefetchCase_ = 0; + optionalInjectPrefetch_ = null; + optionalSeqInterleavePrefetchCase_ = 0; + optionalSeqInterleavePrefetch_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_OptimizationOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions build() { + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions result = new org.tensorflow.proto.data.DatasetOptions.OptimizationOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.OptimizationOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.OptimizationOptions result) { + result.optionalApplyDefaultOptimizationsCase_ = optionalApplyDefaultOptimizationsCase_; + result.optionalApplyDefaultOptimizations_ = this.optionalApplyDefaultOptimizations_; + result.optionalFilterFusionCase_ = optionalFilterFusionCase_; + result.optionalFilterFusion_ = this.optionalFilterFusion_; + result.optionalMapAndBatchFusionCase_ = optionalMapAndBatchFusionCase_; + result.optionalMapAndBatchFusion_ = this.optionalMapAndBatchFusion_; + result.optionalMapAndFilterFusionCase_ = optionalMapAndFilterFusionCase_; + result.optionalMapAndFilterFusion_ = this.optionalMapAndFilterFusion_; + result.optionalMapFusionCase_ = optionalMapFusionCase_; + result.optionalMapFusion_ = this.optionalMapFusion_; + result.optionalMapParallelizationCase_ = optionalMapParallelizationCase_; + result.optionalMapParallelization_ = this.optionalMapParallelization_; + result.optionalNoopEliminationCase_ = optionalNoopEliminationCase_; + result.optionalNoopElimination_ = this.optionalNoopElimination_; + result.optionalParallelBatchCase_ = optionalParallelBatchCase_; + result.optionalParallelBatch_ = this.optionalParallelBatch_; + result.optionalShuffleAndRepeatFusionCase_ = optionalShuffleAndRepeatFusionCase_; + result.optionalShuffleAndRepeatFusion_ = this.optionalShuffleAndRepeatFusion_; + result.optionalFilterParallelizationCase_ = optionalFilterParallelizationCase_; + result.optionalFilterParallelization_ = this.optionalFilterParallelization_; + result.optionalInjectPrefetchCase_ = optionalInjectPrefetchCase_; + result.optionalInjectPrefetch_ = this.optionalInjectPrefetch_; + result.optionalSeqInterleavePrefetchCase_ = optionalSeqInterleavePrefetchCase_; + result.optionalSeqInterleavePrefetch_ = this.optionalSeqInterleavePrefetch_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.OptimizationOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.OptimizationOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.OptimizationOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance()) return this; + switch (other.getOptionalApplyDefaultOptimizationsCase()) { + case APPLY_DEFAULT_OPTIMIZATIONS: { + setApplyDefaultOptimizations(other.getApplyDefaultOptimizations()); + break; + } + case OPTIONALAPPLYDEFAULTOPTIMIZATIONS_NOT_SET: { + break; + } + } + switch (other.getOptionalFilterFusionCase()) { + case FILTER_FUSION: { + setFilterFusion(other.getFilterFusion()); + break; + } + case OPTIONALFILTERFUSION_NOT_SET: { + break; + } + } + switch (other.getOptionalMapAndBatchFusionCase()) { + case MAP_AND_BATCH_FUSION: { + setMapAndBatchFusion(other.getMapAndBatchFusion()); + break; + } + case OPTIONALMAPANDBATCHFUSION_NOT_SET: { + break; + } + } + switch (other.getOptionalMapAndFilterFusionCase()) { + case MAP_AND_FILTER_FUSION: { + setMapAndFilterFusion(other.getMapAndFilterFusion()); + break; + } + case OPTIONALMAPANDFILTERFUSION_NOT_SET: { + break; + } + } + switch (other.getOptionalMapFusionCase()) { + case MAP_FUSION: { + setMapFusion(other.getMapFusion()); + break; + } + case OPTIONALMAPFUSION_NOT_SET: { + break; + } + } + switch (other.getOptionalMapParallelizationCase()) { + case MAP_PARALLELIZATION: { + setMapParallelization(other.getMapParallelization()); + break; + } + case OPTIONALMAPPARALLELIZATION_NOT_SET: { + break; + } + } + switch (other.getOptionalNoopEliminationCase()) { + case NOOP_ELIMINATION: { + setNoopElimination(other.getNoopElimination()); + break; + } + case OPTIONALNOOPELIMINATION_NOT_SET: { + break; + } + } + switch (other.getOptionalParallelBatchCase()) { + case PARALLEL_BATCH: { + setParallelBatch(other.getParallelBatch()); + break; + } + case OPTIONALPARALLELBATCH_NOT_SET: { + break; + } + } + switch (other.getOptionalShuffleAndRepeatFusionCase()) { + case SHUFFLE_AND_REPEAT_FUSION: { + setShuffleAndRepeatFusion(other.getShuffleAndRepeatFusion()); + break; + } + case OPTIONALSHUFFLEANDREPEATFUSION_NOT_SET: { + break; + } + } + switch (other.getOptionalFilterParallelizationCase()) { + case FILTER_PARALLELIZATION: { + setFilterParallelization(other.getFilterParallelization()); + break; + } + case OPTIONALFILTERPARALLELIZATION_NOT_SET: { + break; + } + } + switch (other.getOptionalInjectPrefetchCase()) { + case INJECT_PREFETCH: { + setInjectPrefetch(other.getInjectPrefetch()); + break; + } + case OPTIONALINJECTPREFETCH_NOT_SET: { + break; + } + } + switch (other.getOptionalSeqInterleavePrefetchCase()) { + case SEQ_INTERLEAVE_PREFETCH: { + setSeqInterleavePrefetch(other.getSeqInterleavePrefetch()); + break; + } + case OPTIONALSEQINTERLEAVEPREFETCH_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + optionalApplyDefaultOptimizations_ = input.readBool(); + optionalApplyDefaultOptimizationsCase_ = 1; + break; + } // case 8 + case 48: { + optionalFilterFusion_ = input.readBool(); + optionalFilterFusionCase_ = 6; + break; + } // case 48 + case 72: { + optionalMapAndBatchFusion_ = input.readBool(); + optionalMapAndBatchFusionCase_ = 9; + break; + } // case 72 + case 80: { + optionalMapAndFilterFusion_ = input.readBool(); + optionalMapAndFilterFusionCase_ = 10; + break; + } // case 80 + case 88: { + optionalMapFusion_ = input.readBool(); + optionalMapFusionCase_ = 11; + break; + } // case 88 + case 96: { + optionalMapParallelization_ = input.readBool(); + optionalMapParallelizationCase_ = 12; + break; + } // case 96 + case 112: { + optionalNoopElimination_ = input.readBool(); + optionalNoopEliminationCase_ = 14; + break; + } // case 112 + case 120: { + optionalParallelBatch_ = input.readBool(); + optionalParallelBatchCase_ = 15; + break; + } // case 120 + case 136: { + optionalShuffleAndRepeatFusion_ = input.readBool(); + optionalShuffleAndRepeatFusionCase_ = 17; + break; + } // case 136 + case 144: { + optionalFilterParallelization_ = input.readBool(); + optionalFilterParallelizationCase_ = 18; + break; + } // case 144 + case 152: { + optionalInjectPrefetch_ = input.readBool(); + optionalInjectPrefetchCase_ = 19; + break; + } // case 152 + case 168: { + optionalSeqInterleavePrefetch_ = input.readBool(); + optionalSeqInterleavePrefetchCase_ = 21; + break; + } // case 168 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalApplyDefaultOptimizationsCase_ = 0; + private java.lang.Object optionalApplyDefaultOptimizations_; + public OptionalApplyDefaultOptimizationsCase + getOptionalApplyDefaultOptimizationsCase() { + return OptionalApplyDefaultOptimizationsCase.forNumber( + optionalApplyDefaultOptimizationsCase_); + } + + public Builder clearOptionalApplyDefaultOptimizations() { + optionalApplyDefaultOptimizationsCase_ = 0; + optionalApplyDefaultOptimizations_ = null; + onChanged(); + return this; + } + + private int optionalFilterFusionCase_ = 0; + private java.lang.Object optionalFilterFusion_; + public OptionalFilterFusionCase + getOptionalFilterFusionCase() { + return OptionalFilterFusionCase.forNumber( + optionalFilterFusionCase_); + } + + public Builder clearOptionalFilterFusion() { + optionalFilterFusionCase_ = 0; + optionalFilterFusion_ = null; + onChanged(); + return this; + } + + private int optionalMapAndBatchFusionCase_ = 0; + private java.lang.Object optionalMapAndBatchFusion_; + public OptionalMapAndBatchFusionCase + getOptionalMapAndBatchFusionCase() { + return OptionalMapAndBatchFusionCase.forNumber( + optionalMapAndBatchFusionCase_); + } + + public Builder clearOptionalMapAndBatchFusion() { + optionalMapAndBatchFusionCase_ = 0; + optionalMapAndBatchFusion_ = null; + onChanged(); + return this; + } + + private int optionalMapAndFilterFusionCase_ = 0; + private java.lang.Object optionalMapAndFilterFusion_; + public OptionalMapAndFilterFusionCase + getOptionalMapAndFilterFusionCase() { + return OptionalMapAndFilterFusionCase.forNumber( + optionalMapAndFilterFusionCase_); + } + + public Builder clearOptionalMapAndFilterFusion() { + optionalMapAndFilterFusionCase_ = 0; + optionalMapAndFilterFusion_ = null; + onChanged(); + return this; + } + + private int optionalMapFusionCase_ = 0; + private java.lang.Object optionalMapFusion_; + public OptionalMapFusionCase + getOptionalMapFusionCase() { + return OptionalMapFusionCase.forNumber( + optionalMapFusionCase_); + } + + public Builder clearOptionalMapFusion() { + optionalMapFusionCase_ = 0; + optionalMapFusion_ = null; + onChanged(); + return this; + } + + private int optionalMapParallelizationCase_ = 0; + private java.lang.Object optionalMapParallelization_; + public OptionalMapParallelizationCase + getOptionalMapParallelizationCase() { + return OptionalMapParallelizationCase.forNumber( + optionalMapParallelizationCase_); + } + + public Builder clearOptionalMapParallelization() { + optionalMapParallelizationCase_ = 0; + optionalMapParallelization_ = null; + onChanged(); + return this; + } + + private int optionalNoopEliminationCase_ = 0; + private java.lang.Object optionalNoopElimination_; + public OptionalNoopEliminationCase + getOptionalNoopEliminationCase() { + return OptionalNoopEliminationCase.forNumber( + optionalNoopEliminationCase_); + } + + public Builder clearOptionalNoopElimination() { + optionalNoopEliminationCase_ = 0; + optionalNoopElimination_ = null; + onChanged(); + return this; + } + + private int optionalParallelBatchCase_ = 0; + private java.lang.Object optionalParallelBatch_; + public OptionalParallelBatchCase + getOptionalParallelBatchCase() { + return OptionalParallelBatchCase.forNumber( + optionalParallelBatchCase_); + } + + public Builder clearOptionalParallelBatch() { + optionalParallelBatchCase_ = 0; + optionalParallelBatch_ = null; + onChanged(); + return this; + } + + private int optionalShuffleAndRepeatFusionCase_ = 0; + private java.lang.Object optionalShuffleAndRepeatFusion_; + public OptionalShuffleAndRepeatFusionCase + getOptionalShuffleAndRepeatFusionCase() { + return OptionalShuffleAndRepeatFusionCase.forNumber( + optionalShuffleAndRepeatFusionCase_); + } + + public Builder clearOptionalShuffleAndRepeatFusion() { + optionalShuffleAndRepeatFusionCase_ = 0; + optionalShuffleAndRepeatFusion_ = null; + onChanged(); + return this; + } + + private int optionalFilterParallelizationCase_ = 0; + private java.lang.Object optionalFilterParallelization_; + public OptionalFilterParallelizationCase + getOptionalFilterParallelizationCase() { + return OptionalFilterParallelizationCase.forNumber( + optionalFilterParallelizationCase_); + } + + public Builder clearOptionalFilterParallelization() { + optionalFilterParallelizationCase_ = 0; + optionalFilterParallelization_ = null; + onChanged(); + return this; + } + + private int optionalInjectPrefetchCase_ = 0; + private java.lang.Object optionalInjectPrefetch_; + public OptionalInjectPrefetchCase + getOptionalInjectPrefetchCase() { + return OptionalInjectPrefetchCase.forNumber( + optionalInjectPrefetchCase_); + } + + public Builder clearOptionalInjectPrefetch() { + optionalInjectPrefetchCase_ = 0; + optionalInjectPrefetch_ = null; + onChanged(); + return this; + } + + private int optionalSeqInterleavePrefetchCase_ = 0; + private java.lang.Object optionalSeqInterleavePrefetch_; + public OptionalSeqInterleavePrefetchCase + getOptionalSeqInterleavePrefetchCase() { + return OptionalSeqInterleavePrefetchCase.forNumber( + optionalSeqInterleavePrefetchCase_); + } + + public Builder clearOptionalSeqInterleavePrefetch() { + optionalSeqInterleavePrefetchCase_ = 0; + optionalSeqInterleavePrefetch_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * bool apply_default_optimizations = 1; + * @return Whether the applyDefaultOptimizations field is set. + */ + public boolean hasApplyDefaultOptimizations() { + return optionalApplyDefaultOptimizationsCase_ == 1; + } + /** + * bool apply_default_optimizations = 1; + * @return The applyDefaultOptimizations. + */ + public boolean getApplyDefaultOptimizations() { + if (optionalApplyDefaultOptimizationsCase_ == 1) { + return (java.lang.Boolean) optionalApplyDefaultOptimizations_; + } + return false; + } + /** + * bool apply_default_optimizations = 1; + * @param value The applyDefaultOptimizations to set. + * @return This builder for chaining. + */ + public Builder setApplyDefaultOptimizations(boolean value) { + + optionalApplyDefaultOptimizationsCase_ = 1; + optionalApplyDefaultOptimizations_ = value; + onChanged(); + return this; + } + /** + * bool apply_default_optimizations = 1; + * @return This builder for chaining. + */ + public Builder clearApplyDefaultOptimizations() { + if (optionalApplyDefaultOptimizationsCase_ == 1) { + optionalApplyDefaultOptimizationsCase_ = 0; + optionalApplyDefaultOptimizations_ = null; + onChanged(); + } + return this; + } + + /** + * bool filter_fusion = 6; + * @return Whether the filterFusion field is set. + */ + public boolean hasFilterFusion() { + return optionalFilterFusionCase_ == 6; + } + /** + * bool filter_fusion = 6; + * @return The filterFusion. + */ + public boolean getFilterFusion() { + if (optionalFilterFusionCase_ == 6) { + return (java.lang.Boolean) optionalFilterFusion_; + } + return false; + } + /** + * bool filter_fusion = 6; + * @param value The filterFusion to set. + * @return This builder for chaining. + */ + public Builder setFilterFusion(boolean value) { + + optionalFilterFusionCase_ = 6; + optionalFilterFusion_ = value; + onChanged(); + return this; + } + /** + * bool filter_fusion = 6; + * @return This builder for chaining. + */ + public Builder clearFilterFusion() { + if (optionalFilterFusionCase_ == 6) { + optionalFilterFusionCase_ = 0; + optionalFilterFusion_ = null; + onChanged(); + } + return this; + } + + /** + * bool map_and_batch_fusion = 9; + * @return Whether the mapAndBatchFusion field is set. + */ + public boolean hasMapAndBatchFusion() { + return optionalMapAndBatchFusionCase_ == 9; + } + /** + * bool map_and_batch_fusion = 9; + * @return The mapAndBatchFusion. + */ + public boolean getMapAndBatchFusion() { + if (optionalMapAndBatchFusionCase_ == 9) { + return (java.lang.Boolean) optionalMapAndBatchFusion_; + } + return false; + } + /** + * bool map_and_batch_fusion = 9; + * @param value The mapAndBatchFusion to set. + * @return This builder for chaining. + */ + public Builder setMapAndBatchFusion(boolean value) { + + optionalMapAndBatchFusionCase_ = 9; + optionalMapAndBatchFusion_ = value; + onChanged(); + return this; + } + /** + * bool map_and_batch_fusion = 9; + * @return This builder for chaining. + */ + public Builder clearMapAndBatchFusion() { + if (optionalMapAndBatchFusionCase_ == 9) { + optionalMapAndBatchFusionCase_ = 0; + optionalMapAndBatchFusion_ = null; + onChanged(); + } + return this; + } + + /** + * bool map_and_filter_fusion = 10; + * @return Whether the mapAndFilterFusion field is set. + */ + public boolean hasMapAndFilterFusion() { + return optionalMapAndFilterFusionCase_ == 10; + } + /** + * bool map_and_filter_fusion = 10; + * @return The mapAndFilterFusion. + */ + public boolean getMapAndFilterFusion() { + if (optionalMapAndFilterFusionCase_ == 10) { + return (java.lang.Boolean) optionalMapAndFilterFusion_; + } + return false; + } + /** + * bool map_and_filter_fusion = 10; + * @param value The mapAndFilterFusion to set. + * @return This builder for chaining. + */ + public Builder setMapAndFilterFusion(boolean value) { + + optionalMapAndFilterFusionCase_ = 10; + optionalMapAndFilterFusion_ = value; + onChanged(); + return this; + } + /** + * bool map_and_filter_fusion = 10; + * @return This builder for chaining. + */ + public Builder clearMapAndFilterFusion() { + if (optionalMapAndFilterFusionCase_ == 10) { + optionalMapAndFilterFusionCase_ = 0; + optionalMapAndFilterFusion_ = null; + onChanged(); + } + return this; + } + + /** + * bool map_fusion = 11; + * @return Whether the mapFusion field is set. + */ + public boolean hasMapFusion() { + return optionalMapFusionCase_ == 11; + } + /** + * bool map_fusion = 11; + * @return The mapFusion. + */ + public boolean getMapFusion() { + if (optionalMapFusionCase_ == 11) { + return (java.lang.Boolean) optionalMapFusion_; + } + return false; + } + /** + * bool map_fusion = 11; + * @param value The mapFusion to set. + * @return This builder for chaining. + */ + public Builder setMapFusion(boolean value) { + + optionalMapFusionCase_ = 11; + optionalMapFusion_ = value; + onChanged(); + return this; + } + /** + * bool map_fusion = 11; + * @return This builder for chaining. + */ + public Builder clearMapFusion() { + if (optionalMapFusionCase_ == 11) { + optionalMapFusionCase_ = 0; + optionalMapFusion_ = null; + onChanged(); + } + return this; + } + + /** + * bool map_parallelization = 12; + * @return Whether the mapParallelization field is set. + */ + public boolean hasMapParallelization() { + return optionalMapParallelizationCase_ == 12; + } + /** + * bool map_parallelization = 12; + * @return The mapParallelization. + */ + public boolean getMapParallelization() { + if (optionalMapParallelizationCase_ == 12) { + return (java.lang.Boolean) optionalMapParallelization_; + } + return false; + } + /** + * bool map_parallelization = 12; + * @param value The mapParallelization to set. + * @return This builder for chaining. + */ + public Builder setMapParallelization(boolean value) { + + optionalMapParallelizationCase_ = 12; + optionalMapParallelization_ = value; + onChanged(); + return this; + } + /** + * bool map_parallelization = 12; + * @return This builder for chaining. + */ + public Builder clearMapParallelization() { + if (optionalMapParallelizationCase_ == 12) { + optionalMapParallelizationCase_ = 0; + optionalMapParallelization_ = null; + onChanged(); + } + return this; + } + + /** + * bool noop_elimination = 14; + * @return Whether the noopElimination field is set. + */ + public boolean hasNoopElimination() { + return optionalNoopEliminationCase_ == 14; + } + /** + * bool noop_elimination = 14; + * @return The noopElimination. + */ + public boolean getNoopElimination() { + if (optionalNoopEliminationCase_ == 14) { + return (java.lang.Boolean) optionalNoopElimination_; + } + return false; + } + /** + * bool noop_elimination = 14; + * @param value The noopElimination to set. + * @return This builder for chaining. + */ + public Builder setNoopElimination(boolean value) { + + optionalNoopEliminationCase_ = 14; + optionalNoopElimination_ = value; + onChanged(); + return this; + } + /** + * bool noop_elimination = 14; + * @return This builder for chaining. + */ + public Builder clearNoopElimination() { + if (optionalNoopEliminationCase_ == 14) { + optionalNoopEliminationCase_ = 0; + optionalNoopElimination_ = null; + onChanged(); + } + return this; + } + + /** + * bool parallel_batch = 15; + * @return Whether the parallelBatch field is set. + */ + public boolean hasParallelBatch() { + return optionalParallelBatchCase_ == 15; + } + /** + * bool parallel_batch = 15; + * @return The parallelBatch. + */ + public boolean getParallelBatch() { + if (optionalParallelBatchCase_ == 15) { + return (java.lang.Boolean) optionalParallelBatch_; + } + return false; + } + /** + * bool parallel_batch = 15; + * @param value The parallelBatch to set. + * @return This builder for chaining. + */ + public Builder setParallelBatch(boolean value) { + + optionalParallelBatchCase_ = 15; + optionalParallelBatch_ = value; + onChanged(); + return this; + } + /** + * bool parallel_batch = 15; + * @return This builder for chaining. + */ + public Builder clearParallelBatch() { + if (optionalParallelBatchCase_ == 15) { + optionalParallelBatchCase_ = 0; + optionalParallelBatch_ = null; + onChanged(); + } + return this; + } + + /** + * bool shuffle_and_repeat_fusion = 17; + * @return Whether the shuffleAndRepeatFusion field is set. + */ + public boolean hasShuffleAndRepeatFusion() { + return optionalShuffleAndRepeatFusionCase_ == 17; + } + /** + * bool shuffle_and_repeat_fusion = 17; + * @return The shuffleAndRepeatFusion. + */ + public boolean getShuffleAndRepeatFusion() { + if (optionalShuffleAndRepeatFusionCase_ == 17) { + return (java.lang.Boolean) optionalShuffleAndRepeatFusion_; + } + return false; + } + /** + * bool shuffle_and_repeat_fusion = 17; + * @param value The shuffleAndRepeatFusion to set. + * @return This builder for chaining. + */ + public Builder setShuffleAndRepeatFusion(boolean value) { + + optionalShuffleAndRepeatFusionCase_ = 17; + optionalShuffleAndRepeatFusion_ = value; + onChanged(); + return this; + } + /** + * bool shuffle_and_repeat_fusion = 17; + * @return This builder for chaining. + */ + public Builder clearShuffleAndRepeatFusion() { + if (optionalShuffleAndRepeatFusionCase_ == 17) { + optionalShuffleAndRepeatFusionCase_ = 0; + optionalShuffleAndRepeatFusion_ = null; + onChanged(); + } + return this; + } + + /** + * bool filter_parallelization = 18; + * @return Whether the filterParallelization field is set. + */ + public boolean hasFilterParallelization() { + return optionalFilterParallelizationCase_ == 18; + } + /** + * bool filter_parallelization = 18; + * @return The filterParallelization. + */ + public boolean getFilterParallelization() { + if (optionalFilterParallelizationCase_ == 18) { + return (java.lang.Boolean) optionalFilterParallelization_; + } + return false; + } + /** + * bool filter_parallelization = 18; + * @param value The filterParallelization to set. + * @return This builder for chaining. + */ + public Builder setFilterParallelization(boolean value) { + + optionalFilterParallelizationCase_ = 18; + optionalFilterParallelization_ = value; + onChanged(); + return this; + } + /** + * bool filter_parallelization = 18; + * @return This builder for chaining. + */ + public Builder clearFilterParallelization() { + if (optionalFilterParallelizationCase_ == 18) { + optionalFilterParallelizationCase_ = 0; + optionalFilterParallelization_ = null; + onChanged(); + } + return this; + } + + /** + * bool inject_prefetch = 19; + * @return Whether the injectPrefetch field is set. + */ + public boolean hasInjectPrefetch() { + return optionalInjectPrefetchCase_ == 19; + } + /** + * bool inject_prefetch = 19; + * @return The injectPrefetch. + */ + public boolean getInjectPrefetch() { + if (optionalInjectPrefetchCase_ == 19) { + return (java.lang.Boolean) optionalInjectPrefetch_; + } + return false; + } + /** + * bool inject_prefetch = 19; + * @param value The injectPrefetch to set. + * @return This builder for chaining. + */ + public Builder setInjectPrefetch(boolean value) { + + optionalInjectPrefetchCase_ = 19; + optionalInjectPrefetch_ = value; + onChanged(); + return this; + } + /** + * bool inject_prefetch = 19; + * @return This builder for chaining. + */ + public Builder clearInjectPrefetch() { + if (optionalInjectPrefetchCase_ == 19) { + optionalInjectPrefetchCase_ = 0; + optionalInjectPrefetch_ = null; + onChanged(); + } + return this; + } + + /** + * bool seq_interleave_prefetch = 21; + * @return Whether the seqInterleavePrefetch field is set. + */ + public boolean hasSeqInterleavePrefetch() { + return optionalSeqInterleavePrefetchCase_ == 21; + } + /** + * bool seq_interleave_prefetch = 21; + * @return The seqInterleavePrefetch. + */ + public boolean getSeqInterleavePrefetch() { + if (optionalSeqInterleavePrefetchCase_ == 21) { + return (java.lang.Boolean) optionalSeqInterleavePrefetch_; + } + return false; + } + /** + * bool seq_interleave_prefetch = 21; + * @param value The seqInterleavePrefetch to set. + * @return This builder for chaining. + */ + public Builder setSeqInterleavePrefetch(boolean value) { + + optionalSeqInterleavePrefetchCase_ = 21; + optionalSeqInterleavePrefetch_ = value; + onChanged(); + return this; + } + /** + * bool seq_interleave_prefetch = 21; + * @return This builder for chaining. + */ + public Builder clearSeqInterleavePrefetch() { + if (optionalSeqInterleavePrefetchCase_ == 21) { + optionalSeqInterleavePrefetchCase_ = 0; + optionalSeqInterleavePrefetch_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.OptimizationOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.OptimizationOptions) + private static final org.tensorflow.proto.data.DatasetOptions.OptimizationOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.OptimizationOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.OptimizationOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizationOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.OptimizationOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.ServiceOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * bool pinned = 1; + * @return Whether the pinned field is set. + */ + boolean hasPinned(); + /** + * bool pinned = 1; + * @return The pinned. + */ + boolean getPinned(); + + org.tensorflow.proto.data.DatasetOptions.ServiceOptions.OptionalPinnedCase getOptionalPinnedCase(); + } + /** + *
    +   * next: 2
    +   * 
    + * + * Protobuf type {@code tensorflow.data.ServiceOptions} + */ + public static final class ServiceOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.ServiceOptions) + ServiceOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ServiceOptions.class.getName()); + } + // Use ServiceOptions.newBuilder() to construct. + private ServiceOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ServiceOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ServiceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ServiceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.ServiceOptions.class, org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder.class); + } + + private int optionalPinnedCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalPinned_; + public enum OptionalPinnedCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PINNED(1), + OPTIONALPINNED_NOT_SET(0); + private final int value; + private OptionalPinnedCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalPinnedCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalPinnedCase forNumber(int value) { + switch (value) { + case 1: return PINNED; + case 0: return OPTIONALPINNED_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalPinnedCase + getOptionalPinnedCase() { + return OptionalPinnedCase.forNumber( + optionalPinnedCase_); + } + + public static final int PINNED_FIELD_NUMBER = 1; + /** + * bool pinned = 1; + * @return Whether the pinned field is set. + */ + @java.lang.Override + public boolean hasPinned() { + return optionalPinnedCase_ == 1; + } + /** + * bool pinned = 1; + * @return The pinned. + */ + @java.lang.Override + public boolean getPinned() { + if (optionalPinnedCase_ == 1) { + return (java.lang.Boolean) optionalPinned_; + } + return false; + } + + 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 (optionalPinnedCase_ == 1) { + output.writeBool( + 1, (boolean)((java.lang.Boolean) optionalPinned_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalPinnedCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 1, (boolean)((java.lang.Boolean) optionalPinned_)); + } + size += getUnknownFields().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.DatasetOptions.ServiceOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.ServiceOptions other = (org.tensorflow.proto.data.DatasetOptions.ServiceOptions) obj; + + if (!getOptionalPinnedCase().equals(other.getOptionalPinnedCase())) return false; + switch (optionalPinnedCase_) { + case 1: + if (getPinned() + != other.getPinned()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (optionalPinnedCase_) { + case 1: + hash = (37 * hash) + PINNED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPinned()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions 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.DatasetOptions.ServiceOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions 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.DatasetOptions.ServiceOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.ServiceOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 2
    +     * 
    + * + * Protobuf type {@code tensorflow.data.ServiceOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.ServiceOptions) + org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ServiceOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ServiceOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.ServiceOptions.class, org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.ServiceOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optionalPinnedCase_ = 0; + optionalPinned_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ServiceOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions build() { + org.tensorflow.proto.data.DatasetOptions.ServiceOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.ServiceOptions result = new org.tensorflow.proto.data.DatasetOptions.ServiceOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.ServiceOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.ServiceOptions result) { + result.optionalPinnedCase_ = optionalPinnedCase_; + result.optionalPinned_ = this.optionalPinned_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.ServiceOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.ServiceOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.ServiceOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance()) return this; + switch (other.getOptionalPinnedCase()) { + case PINNED: { + setPinned(other.getPinned()); + break; + } + case OPTIONALPINNED_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + optionalPinned_ = input.readBool(); + optionalPinnedCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalPinnedCase_ = 0; + private java.lang.Object optionalPinned_; + public OptionalPinnedCase + getOptionalPinnedCase() { + return OptionalPinnedCase.forNumber( + optionalPinnedCase_); + } + + public Builder clearOptionalPinned() { + optionalPinnedCase_ = 0; + optionalPinned_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * bool pinned = 1; + * @return Whether the pinned field is set. + */ + public boolean hasPinned() { + return optionalPinnedCase_ == 1; + } + /** + * bool pinned = 1; + * @return The pinned. + */ + public boolean getPinned() { + if (optionalPinnedCase_ == 1) { + return (java.lang.Boolean) optionalPinned_; + } + return false; + } + /** + * bool pinned = 1; + * @param value The pinned to set. + * @return This builder for chaining. + */ + public Builder setPinned(boolean value) { + + optionalPinnedCase_ = 1; + optionalPinned_ = value; + onChanged(); + return this; + } + /** + * bool pinned = 1; + * @return This builder for chaining. + */ + public Builder clearPinned() { + if (optionalPinnedCase_ == 1) { + optionalPinnedCase_ = 0; + optionalPinned_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.ServiceOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.ServiceOptions) + private static final org.tensorflow.proto.data.DatasetOptions.ServiceOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.ServiceOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.ServiceOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.ServiceOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ThreadingOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.ThreadingOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 max_intra_op_parallelism = 1; + * @return Whether the maxIntraOpParallelism field is set. + */ + boolean hasMaxIntraOpParallelism(); + /** + * int32 max_intra_op_parallelism = 1; + * @return The maxIntraOpParallelism. + */ + int getMaxIntraOpParallelism(); + + /** + * int32 private_threadpool_size = 2; + * @return Whether the privateThreadpoolSize field is set. + */ + boolean hasPrivateThreadpoolSize(); + /** + * int32 private_threadpool_size = 2; + * @return The privateThreadpoolSize. + */ + int getPrivateThreadpoolSize(); + + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.OptionalMaxIntraOpParallelismCase getOptionalMaxIntraOpParallelismCase(); + + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.OptionalPrivateThreadpoolSizeCase getOptionalPrivateThreadpoolSizeCase(); + } + /** + *
    +   * next: 3
    +   * 
    + * + * Protobuf type {@code tensorflow.data.ThreadingOptions} + */ + public static final class ThreadingOptions extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.ThreadingOptions) + ThreadingOptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ThreadingOptions.class.getName()); + } + // Use ThreadingOptions.newBuilder() to construct. + private ThreadingOptions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ThreadingOptions() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ThreadingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.class, org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder.class); + } + + private int optionalMaxIntraOpParallelismCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalMaxIntraOpParallelism_; + public enum OptionalMaxIntraOpParallelismCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MAX_INTRA_OP_PARALLELISM(1), + OPTIONALMAXINTRAOPPARALLELISM_NOT_SET(0); + private final int value; + private OptionalMaxIntraOpParallelismCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalMaxIntraOpParallelismCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalMaxIntraOpParallelismCase forNumber(int value) { + switch (value) { + case 1: return MAX_INTRA_OP_PARALLELISM; + case 0: return OPTIONALMAXINTRAOPPARALLELISM_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalMaxIntraOpParallelismCase + getOptionalMaxIntraOpParallelismCase() { + return OptionalMaxIntraOpParallelismCase.forNumber( + optionalMaxIntraOpParallelismCase_); + } + + private int optionalPrivateThreadpoolSizeCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalPrivateThreadpoolSize_; + public enum OptionalPrivateThreadpoolSizeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRIVATE_THREADPOOL_SIZE(2), + OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET(0); + private final int value; + private OptionalPrivateThreadpoolSizeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalPrivateThreadpoolSizeCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalPrivateThreadpoolSizeCase forNumber(int value) { + switch (value) { + case 2: return PRIVATE_THREADPOOL_SIZE; + case 0: return OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalPrivateThreadpoolSizeCase + getOptionalPrivateThreadpoolSizeCase() { + return OptionalPrivateThreadpoolSizeCase.forNumber( + optionalPrivateThreadpoolSizeCase_); + } + + public static final int MAX_INTRA_OP_PARALLELISM_FIELD_NUMBER = 1; + /** + * int32 max_intra_op_parallelism = 1; + * @return Whether the maxIntraOpParallelism field is set. + */ + @java.lang.Override + public boolean hasMaxIntraOpParallelism() { + return optionalMaxIntraOpParallelismCase_ == 1; + } + /** + * int32 max_intra_op_parallelism = 1; + * @return The maxIntraOpParallelism. + */ + @java.lang.Override + public int getMaxIntraOpParallelism() { + if (optionalMaxIntraOpParallelismCase_ == 1) { + return (java.lang.Integer) optionalMaxIntraOpParallelism_; + } + return 0; + } + + public static final int PRIVATE_THREADPOOL_SIZE_FIELD_NUMBER = 2; + /** + * int32 private_threadpool_size = 2; + * @return Whether the privateThreadpoolSize field is set. + */ + @java.lang.Override + public boolean hasPrivateThreadpoolSize() { + return optionalPrivateThreadpoolSizeCase_ == 2; + } + /** + * int32 private_threadpool_size = 2; + * @return The privateThreadpoolSize. + */ + @java.lang.Override + public int getPrivateThreadpoolSize() { + if (optionalPrivateThreadpoolSizeCase_ == 2) { + return (java.lang.Integer) optionalPrivateThreadpoolSize_; + } + return 0; + } + + 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 (optionalMaxIntraOpParallelismCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) optionalMaxIntraOpParallelism_)); + } + if (optionalPrivateThreadpoolSizeCase_ == 2) { + output.writeInt32( + 2, (int)((java.lang.Integer) optionalPrivateThreadpoolSize_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalMaxIntraOpParallelismCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) optionalMaxIntraOpParallelism_)); + } + if (optionalPrivateThreadpoolSizeCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 2, (int)((java.lang.Integer) optionalPrivateThreadpoolSize_)); + } + size += getUnknownFields().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.DatasetOptions.ThreadingOptions)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions other = (org.tensorflow.proto.data.DatasetOptions.ThreadingOptions) obj; + + if (!getOptionalMaxIntraOpParallelismCase().equals(other.getOptionalMaxIntraOpParallelismCase())) return false; + switch (optionalMaxIntraOpParallelismCase_) { + case 1: + if (getMaxIntraOpParallelism() + != other.getMaxIntraOpParallelism()) return false; + break; + case 0: + default: + } + if (!getOptionalPrivateThreadpoolSizeCase().equals(other.getOptionalPrivateThreadpoolSizeCase())) return false; + switch (optionalPrivateThreadpoolSizeCase_) { + case 2: + if (getPrivateThreadpoolSize() + != other.getPrivateThreadpoolSize()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (optionalMaxIntraOpParallelismCase_) { + case 1: + hash = (37 * hash) + MAX_INTRA_OP_PARALLELISM_FIELD_NUMBER; + hash = (53 * hash) + getMaxIntraOpParallelism(); + break; + case 0: + default: + } + switch (optionalPrivateThreadpoolSizeCase_) { + case 2: + hash = (37 * hash) + PRIVATE_THREADPOOL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPrivateThreadpoolSize(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions 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.DatasetOptions.ThreadingOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions 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.DatasetOptions.ThreadingOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.ThreadingOptions 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * next: 3
    +     * 
    + * + * Protobuf type {@code tensorflow.data.ThreadingOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.ThreadingOptions) + org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ThreadingOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.class, org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + optionalMaxIntraOpParallelismCase_ = 0; + optionalMaxIntraOpParallelism_ = null; + optionalPrivateThreadpoolSizeCase_ = 0; + optionalPrivateThreadpoolSize_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_ThreadingOptions_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions build() { + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions buildPartial() { + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions result = new org.tensorflow.proto.data.DatasetOptions.ThreadingOptions(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.ThreadingOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.ThreadingOptions result) { + result.optionalMaxIntraOpParallelismCase_ = optionalMaxIntraOpParallelismCase_; + result.optionalMaxIntraOpParallelism_ = this.optionalMaxIntraOpParallelism_; + result.optionalPrivateThreadpoolSizeCase_ = optionalPrivateThreadpoolSizeCase_; + result.optionalPrivateThreadpoolSize_ = this.optionalPrivateThreadpoolSize_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.ThreadingOptions) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.ThreadingOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.ThreadingOptions other) { + if (other == org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance()) return this; + switch (other.getOptionalMaxIntraOpParallelismCase()) { + case MAX_INTRA_OP_PARALLELISM: { + setMaxIntraOpParallelism(other.getMaxIntraOpParallelism()); + break; + } + case OPTIONALMAXINTRAOPPARALLELISM_NOT_SET: { + break; + } + } + switch (other.getOptionalPrivateThreadpoolSizeCase()) { + case PRIVATE_THREADPOOL_SIZE: { + setPrivateThreadpoolSize(other.getPrivateThreadpoolSize()); + break; + } + case OPTIONALPRIVATETHREADPOOLSIZE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + optionalMaxIntraOpParallelism_ = input.readInt32(); + optionalMaxIntraOpParallelismCase_ = 1; + break; + } // case 8 + case 16: { + optionalPrivateThreadpoolSize_ = input.readInt32(); + optionalPrivateThreadpoolSizeCase_ = 2; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalMaxIntraOpParallelismCase_ = 0; + private java.lang.Object optionalMaxIntraOpParallelism_; + public OptionalMaxIntraOpParallelismCase + getOptionalMaxIntraOpParallelismCase() { + return OptionalMaxIntraOpParallelismCase.forNumber( + optionalMaxIntraOpParallelismCase_); + } + + public Builder clearOptionalMaxIntraOpParallelism() { + optionalMaxIntraOpParallelismCase_ = 0; + optionalMaxIntraOpParallelism_ = null; + onChanged(); + return this; + } + + private int optionalPrivateThreadpoolSizeCase_ = 0; + private java.lang.Object optionalPrivateThreadpoolSize_; + public OptionalPrivateThreadpoolSizeCase + getOptionalPrivateThreadpoolSizeCase() { + return OptionalPrivateThreadpoolSizeCase.forNumber( + optionalPrivateThreadpoolSizeCase_); + } + + public Builder clearOptionalPrivateThreadpoolSize() { + optionalPrivateThreadpoolSizeCase_ = 0; + optionalPrivateThreadpoolSize_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 max_intra_op_parallelism = 1; + * @return Whether the maxIntraOpParallelism field is set. + */ + public boolean hasMaxIntraOpParallelism() { + return optionalMaxIntraOpParallelismCase_ == 1; + } + /** + * int32 max_intra_op_parallelism = 1; + * @return The maxIntraOpParallelism. + */ + public int getMaxIntraOpParallelism() { + if (optionalMaxIntraOpParallelismCase_ == 1) { + return (java.lang.Integer) optionalMaxIntraOpParallelism_; + } + return 0; + } + /** + * int32 max_intra_op_parallelism = 1; + * @param value The maxIntraOpParallelism to set. + * @return This builder for chaining. + */ + public Builder setMaxIntraOpParallelism(int value) { + + optionalMaxIntraOpParallelismCase_ = 1; + optionalMaxIntraOpParallelism_ = value; + onChanged(); + return this; + } + /** + * int32 max_intra_op_parallelism = 1; + * @return This builder for chaining. + */ + public Builder clearMaxIntraOpParallelism() { + if (optionalMaxIntraOpParallelismCase_ == 1) { + optionalMaxIntraOpParallelismCase_ = 0; + optionalMaxIntraOpParallelism_ = null; + onChanged(); + } + return this; + } + + /** + * int32 private_threadpool_size = 2; + * @return Whether the privateThreadpoolSize field is set. + */ + public boolean hasPrivateThreadpoolSize() { + return optionalPrivateThreadpoolSizeCase_ == 2; + } + /** + * int32 private_threadpool_size = 2; + * @return The privateThreadpoolSize. + */ + public int getPrivateThreadpoolSize() { + if (optionalPrivateThreadpoolSizeCase_ == 2) { + return (java.lang.Integer) optionalPrivateThreadpoolSize_; + } + return 0; + } + /** + * int32 private_threadpool_size = 2; + * @param value The privateThreadpoolSize to set. + * @return This builder for chaining. + */ + public Builder setPrivateThreadpoolSize(int value) { + + optionalPrivateThreadpoolSizeCase_ = 2; + optionalPrivateThreadpoolSize_ = value; + onChanged(); + return this; + } + /** + * int32 private_threadpool_size = 2; + * @return This builder for chaining. + */ + public Builder clearPrivateThreadpoolSize() { + if (optionalPrivateThreadpoolSizeCase_ == 2) { + optionalPrivateThreadpoolSizeCase_ = 0; + optionalPrivateThreadpoolSize_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.ThreadingOptions) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.ThreadingOptions) + private static final org.tensorflow.proto.data.DatasetOptions.ThreadingOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.ThreadingOptions(); + } + + public static org.tensorflow.proto.data.DatasetOptions.ThreadingOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ThreadingOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.ThreadingOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.Options) + com.google.protobuf.MessageOrBuilder { + + /** + * string dataset_name = 10; + * @return Whether the datasetName field is set. + */ + boolean hasDatasetName(); + /** + * string dataset_name = 10; + * @return The datasetName. + */ + java.lang.String getDatasetName(); + /** + * string dataset_name = 10; + * @return The bytes for datasetName. + */ + com.google.protobuf.ByteString + getDatasetNameBytes(); + + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @return A list containing the frameworkType. + */ + java.util.List + getFrameworkTypeList(); + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @return The count of frameworkType. + */ + int getFrameworkTypeCount(); + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @param index The index of the element to return. + * @return The frameworkType at the given index. + */ + java.lang.String getFrameworkType(int index); + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @param index The index of the value to return. + * @return The bytes of the frameworkType at the given index. + */ + com.google.protobuf.ByteString + getFrameworkTypeBytes(int index); + + /** + * bool deterministic = 1; + * @return Whether the deterministic field is set. + */ + boolean hasDeterministic(); + /** + * bool deterministic = 1; + * @return The deterministic. + */ + boolean getDeterministic(); + + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return Whether the autotuneOptions field is set. + */ + boolean hasAutotuneOptions(); + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return The autotuneOptions. + */ + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions getAutotuneOptions(); + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder getAutotuneOptionsOrBuilder(); + + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return Whether the distributeOptions field is set. + */ + boolean hasDistributeOptions(); + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return The distributeOptions. + */ + org.tensorflow.proto.data.DatasetOptions.DistributeOptions getDistributeOptions(); + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder(); + + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return Whether the optimizationOptions field is set. + */ + boolean hasOptimizationOptions(); + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return The optimizationOptions. + */ + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions getOptimizationOptions(); + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder(); + + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return Whether the serviceOptions field is set. + */ + boolean hasServiceOptions(); + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return The serviceOptions. + */ + org.tensorflow.proto.data.DatasetOptions.ServiceOptions getServiceOptions(); + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder getServiceOptionsOrBuilder(); + + /** + * bool slack = 4; + * @return Whether the slack field is set. + */ + boolean hasSlack(); + /** + * bool slack = 4; + * @return The slack. + */ + boolean getSlack(); + + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return Whether the threadingOptions field is set. + */ + boolean hasThreadingOptions(); + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return The threadingOptions. + */ + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions getThreadingOptions(); + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder(); + + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return Whether the externalStatePolicy field is set. + */ + boolean hasExternalStatePolicy(); + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The enum numeric value on the wire for externalStatePolicy. + */ + int getExternalStatePolicyValue(); + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The externalStatePolicy. + */ + org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy getExternalStatePolicy(); + + /** + * bool symbolic_checkpoint = 8; + * @return Whether the symbolicCheckpoint field is set. + */ + boolean hasSymbolicCheckpoint(); + /** + * bool symbolic_checkpoint = 8; + * @return The symbolicCheckpoint. + */ + boolean getSymbolicCheckpoint(); + + /** + * bool warm_start = 9; + * @return Whether the warmStart field is set. + */ + boolean hasWarmStart(); + /** + * bool warm_start = 9; + * @return The warmStart. + */ + boolean getWarmStart(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalDatasetNameCase getOptionalDatasetNameCase(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalDeterministicCase getOptionalDeterministicCase(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalSlackCase getOptionalSlackCase(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalExternalStatePolicyCase getOptionalExternalStatePolicyCase(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalSymbolicCheckpointCase getOptionalSymbolicCheckpointCase(); + + org.tensorflow.proto.data.DatasetOptions.Options.OptionalWarmStartCase getOptionalWarmStartCase(); + } + /** + *
    +   * Message stored with Dataset objects to control how datasets are processed and
    +   * optimized.
    +   *
    +   * next: 13
    +   * 
    + * + * Protobuf type {@code tensorflow.data.Options} + */ + public static final class Options extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.Options) + OptionsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Options.class.getName()); + } + // Use Options.newBuilder() to construct. + private Options(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Options() { + frameworkType_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_Options_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_Options_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.Options.class, org.tensorflow.proto.data.DatasetOptions.Options.Builder.class); + } + + private int bitField0_; + private int optionalDatasetNameCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalDatasetName_; + public enum OptionalDatasetNameCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DATASET_NAME(10), + OPTIONALDATASETNAME_NOT_SET(0); + private final int value; + private OptionalDatasetNameCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalDatasetNameCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalDatasetNameCase forNumber(int value) { + switch (value) { + case 10: return DATASET_NAME; + case 0: return OPTIONALDATASETNAME_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalDatasetNameCase + getOptionalDatasetNameCase() { + return OptionalDatasetNameCase.forNumber( + optionalDatasetNameCase_); + } + + private int optionalDeterministicCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalDeterministic_; + public enum OptionalDeterministicCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DETERMINISTIC(1), + OPTIONALDETERMINISTIC_NOT_SET(0); + private final int value; + private OptionalDeterministicCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalDeterministicCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalDeterministicCase forNumber(int value) { + switch (value) { + case 1: return DETERMINISTIC; + case 0: return OPTIONALDETERMINISTIC_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalDeterministicCase + getOptionalDeterministicCase() { + return OptionalDeterministicCase.forNumber( + optionalDeterministicCase_); + } + + private int optionalSlackCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalSlack_; + public enum OptionalSlackCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SLACK(4), + OPTIONALSLACK_NOT_SET(0); + private final int value; + private OptionalSlackCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalSlackCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalSlackCase forNumber(int value) { + switch (value) { + case 4: return SLACK; + case 0: return OPTIONALSLACK_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalSlackCase + getOptionalSlackCase() { + return OptionalSlackCase.forNumber( + optionalSlackCase_); + } + + private int optionalExternalStatePolicyCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalExternalStatePolicy_; + public enum OptionalExternalStatePolicyCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXTERNAL_STATE_POLICY(6), + OPTIONALEXTERNALSTATEPOLICY_NOT_SET(0); + private final int value; + private OptionalExternalStatePolicyCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalExternalStatePolicyCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalExternalStatePolicyCase forNumber(int value) { + switch (value) { + case 6: return EXTERNAL_STATE_POLICY; + case 0: return OPTIONALEXTERNALSTATEPOLICY_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalExternalStatePolicyCase + getOptionalExternalStatePolicyCase() { + return OptionalExternalStatePolicyCase.forNumber( + optionalExternalStatePolicyCase_); + } + + private int optionalSymbolicCheckpointCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalSymbolicCheckpoint_; + public enum OptionalSymbolicCheckpointCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SYMBOLIC_CHECKPOINT(8), + OPTIONALSYMBOLICCHECKPOINT_NOT_SET(0); + private final int value; + private OptionalSymbolicCheckpointCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalSymbolicCheckpointCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalSymbolicCheckpointCase forNumber(int value) { + switch (value) { + case 8: return SYMBOLIC_CHECKPOINT; + case 0: return OPTIONALSYMBOLICCHECKPOINT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalSymbolicCheckpointCase + getOptionalSymbolicCheckpointCase() { + return OptionalSymbolicCheckpointCase.forNumber( + optionalSymbolicCheckpointCase_); + } + + private int optionalWarmStartCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object optionalWarmStart_; + public enum OptionalWarmStartCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + WARM_START(9), + OPTIONALWARMSTART_NOT_SET(0); + private final int value; + private OptionalWarmStartCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OptionalWarmStartCase valueOf(int value) { + return forNumber(value); + } + + public static OptionalWarmStartCase forNumber(int value) { + switch (value) { + case 9: return WARM_START; + case 0: return OPTIONALWARMSTART_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OptionalWarmStartCase + getOptionalWarmStartCase() { + return OptionalWarmStartCase.forNumber( + optionalWarmStartCase_); + } + + public static final int DATASET_NAME_FIELD_NUMBER = 10; + /** + * string dataset_name = 10; + * @return Whether the datasetName field is set. + */ + public boolean hasDatasetName() { + return optionalDatasetNameCase_ == 10; + } + /** + * string dataset_name = 10; + * @return The datasetName. + */ + public java.lang.String getDatasetName() { + java.lang.Object ref = ""; + if (optionalDatasetNameCase_ == 10) { + ref = optionalDatasetName_; + } + 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(); + if (optionalDatasetNameCase_ == 10) { + optionalDatasetName_ = s; + } + return s; + } + } + /** + * string dataset_name = 10; + * @return The bytes for datasetName. + */ + public com.google.protobuf.ByteString + getDatasetNameBytes() { + java.lang.Object ref = ""; + if (optionalDatasetNameCase_ == 10) { + ref = optionalDatasetName_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (optionalDatasetNameCase_ == 10) { + optionalDatasetName_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FRAMEWORK_TYPE_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList frameworkType_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @return A list containing the frameworkType. + */ + public com.google.protobuf.ProtocolStringList + getFrameworkTypeList() { + return frameworkType_; + } + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @return The count of frameworkType. + */ + public int getFrameworkTypeCount() { + return frameworkType_.size(); + } + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @param index The index of the element to return. + * @return The frameworkType at the given index. + */ + public java.lang.String getFrameworkType(int index) { + return frameworkType_.get(index); + } + /** + *
    +     * List of frameworks used to generate this dataset.
    +     * 
    + * + * repeated string framework_type = 11; + * @param index The index of the value to return. + * @return The bytes of the frameworkType at the given index. + */ + public com.google.protobuf.ByteString + getFrameworkTypeBytes(int index) { + return frameworkType_.getByteString(index); + } + + public static final int DETERMINISTIC_FIELD_NUMBER = 1; + /** + * bool deterministic = 1; + * @return Whether the deterministic field is set. + */ + @java.lang.Override + public boolean hasDeterministic() { + return optionalDeterministicCase_ == 1; + } + /** + * bool deterministic = 1; + * @return The deterministic. + */ + @java.lang.Override + public boolean getDeterministic() { + if (optionalDeterministicCase_ == 1) { + return (java.lang.Boolean) optionalDeterministic_; + } + return false; + } + + public static final int AUTOTUNE_OPTIONS_FIELD_NUMBER = 7; + private org.tensorflow.proto.data.DatasetOptions.AutotuneOptions autotuneOptions_; + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return Whether the autotuneOptions field is set. + */ + @java.lang.Override + public boolean hasAutotuneOptions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return The autotuneOptions. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions getAutotuneOptions() { + return autotuneOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance() : autotuneOptions_; + } + /** + *
    +     * The autotune options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder getAutotuneOptionsOrBuilder() { + return autotuneOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance() : autotuneOptions_; + } + + public static final int DISTRIBUTE_OPTIONS_FIELD_NUMBER = 2; + private org.tensorflow.proto.data.DatasetOptions.DistributeOptions distributeOptions_; + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return Whether the distributeOptions field is set. + */ + @java.lang.Override + public boolean hasDistributeOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return The distributeOptions. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions getDistributeOptions() { + return distributeOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance() : distributeOptions_; + } + /** + *
    +     * The distribution strategy options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() { + return distributeOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance() : distributeOptions_; + } + + public static final int OPTIMIZATION_OPTIONS_FIELD_NUMBER = 3; + private org.tensorflow.proto.data.DatasetOptions.OptimizationOptions optimizationOptions_; + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return Whether the optimizationOptions field is set. + */ + @java.lang.Override + public boolean hasOptimizationOptions() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return The optimizationOptions. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions getOptimizationOptions() { + return optimizationOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance() : optimizationOptions_; + } + /** + *
    +     * The optimization options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() { + return optimizationOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance() : optimizationOptions_; + } + + public static final int SERVICE_OPTIONS_FIELD_NUMBER = 12; + private org.tensorflow.proto.data.DatasetOptions.ServiceOptions serviceOptions_; + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return Whether the serviceOptions field is set. + */ + @java.lang.Override + public boolean hasServiceOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return The serviceOptions. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions getServiceOptions() { + return serviceOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance() : serviceOptions_; + } + /** + *
    +     * The tf.data service options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder getServiceOptionsOrBuilder() { + return serviceOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance() : serviceOptions_; + } + + public static final int SLACK_FIELD_NUMBER = 4; + /** + * bool slack = 4; + * @return Whether the slack field is set. + */ + @java.lang.Override + public boolean hasSlack() { + return optionalSlackCase_ == 4; + } + /** + * bool slack = 4; + * @return The slack. + */ + @java.lang.Override + public boolean getSlack() { + if (optionalSlackCase_ == 4) { + return (java.lang.Boolean) optionalSlack_; + } + return false; + } + + public static final int THREADING_OPTIONS_FIELD_NUMBER = 5; + private org.tensorflow.proto.data.DatasetOptions.ThreadingOptions threadingOptions_; + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return Whether the threadingOptions field is set. + */ + @java.lang.Override + public boolean hasThreadingOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return The threadingOptions. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions getThreadingOptions() { + return threadingOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance() : threadingOptions_; + } + /** + *
    +     * The threading options associated with the dataset.
    +     * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() { + return threadingOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance() : threadingOptions_; + } + + public static final int EXTERNAL_STATE_POLICY_FIELD_NUMBER = 6; + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return Whether the externalStatePolicy field is set. + */ + public boolean hasExternalStatePolicy() { + return optionalExternalStatePolicyCase_ == 6; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The enum numeric value on the wire for externalStatePolicy. + */ + public int getExternalStatePolicyValue() { + if (optionalExternalStatePolicyCase_ == 6) { + return (java.lang.Integer) optionalExternalStatePolicy_; + } + return 0; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The externalStatePolicy. + */ + public org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy getExternalStatePolicy() { + if (optionalExternalStatePolicyCase_ == 6) { + org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy result = org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.forNumber( + (java.lang.Integer) optionalExternalStatePolicy_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.UNRECOGNIZED : result; + } + return org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.POLICY_WARN; + } + + public static final int SYMBOLIC_CHECKPOINT_FIELD_NUMBER = 8; + /** + * bool symbolic_checkpoint = 8; + * @return Whether the symbolicCheckpoint field is set. + */ + @java.lang.Override + public boolean hasSymbolicCheckpoint() { + return optionalSymbolicCheckpointCase_ == 8; + } + /** + * bool symbolic_checkpoint = 8; + * @return The symbolicCheckpoint. + */ + @java.lang.Override + public boolean getSymbolicCheckpoint() { + if (optionalSymbolicCheckpointCase_ == 8) { + return (java.lang.Boolean) optionalSymbolicCheckpoint_; + } + return false; + } + + public static final int WARM_START_FIELD_NUMBER = 9; + /** + * bool warm_start = 9; + * @return Whether the warmStart field is set. + */ + @java.lang.Override + public boolean hasWarmStart() { + return optionalWarmStartCase_ == 9; + } + /** + * bool warm_start = 9; + * @return The warmStart. + */ + @java.lang.Override + public boolean getWarmStart() { + if (optionalWarmStartCase_ == 9) { + return (java.lang.Boolean) optionalWarmStart_; + } + return false; + } + + 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 (optionalDeterministicCase_ == 1) { + output.writeBool( + 1, (boolean)((java.lang.Boolean) optionalDeterministic_)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDistributeOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getOptimizationOptions()); + } + if (optionalSlackCase_ == 4) { + output.writeBool( + 4, (boolean)((java.lang.Boolean) optionalSlack_)); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(5, getThreadingOptions()); + } + if (optionalExternalStatePolicyCase_ == 6) { + output.writeEnum(6, ((java.lang.Integer) optionalExternalStatePolicy_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(7, getAutotuneOptions()); + } + if (optionalSymbolicCheckpointCase_ == 8) { + output.writeBool( + 8, (boolean)((java.lang.Boolean) optionalSymbolicCheckpoint_)); + } + if (optionalWarmStartCase_ == 9) { + output.writeBool( + 9, (boolean)((java.lang.Boolean) optionalWarmStart_)); + } + if (optionalDatasetNameCase_ == 10) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, optionalDatasetName_); + } + for (int i = 0; i < frameworkType_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, frameworkType_.getRaw(i)); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(12, getServiceOptions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (optionalDeterministicCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 1, (boolean)((java.lang.Boolean) optionalDeterministic_)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDistributeOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getOptimizationOptions()); + } + if (optionalSlackCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 4, (boolean)((java.lang.Boolean) optionalSlack_)); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getThreadingOptions()); + } + if (optionalExternalStatePolicyCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, ((java.lang.Integer) optionalExternalStatePolicy_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getAutotuneOptions()); + } + if (optionalSymbolicCheckpointCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 8, (boolean)((java.lang.Boolean) optionalSymbolicCheckpoint_)); + } + if (optionalWarmStartCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 9, (boolean)((java.lang.Boolean) optionalWarmStart_)); + } + if (optionalDatasetNameCase_ == 10) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, optionalDatasetName_); + } + { + int dataSize = 0; + for (int i = 0; i < frameworkType_.size(); i++) { + dataSize += computeStringSizeNoTag(frameworkType_.getRaw(i)); + } + size += dataSize; + size += 1 * getFrameworkTypeList().size(); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, getServiceOptions()); + } + size += getUnknownFields().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.DatasetOptions.Options)) { + return super.equals(obj); + } + org.tensorflow.proto.data.DatasetOptions.Options other = (org.tensorflow.proto.data.DatasetOptions.Options) obj; + + if (!getFrameworkTypeList() + .equals(other.getFrameworkTypeList())) return false; + if (hasAutotuneOptions() != other.hasAutotuneOptions()) return false; + if (hasAutotuneOptions()) { + if (!getAutotuneOptions() + .equals(other.getAutotuneOptions())) return false; + } + if (hasDistributeOptions() != other.hasDistributeOptions()) return false; + if (hasDistributeOptions()) { + if (!getDistributeOptions() + .equals(other.getDistributeOptions())) return false; + } + if (hasOptimizationOptions() != other.hasOptimizationOptions()) return false; + if (hasOptimizationOptions()) { + if (!getOptimizationOptions() + .equals(other.getOptimizationOptions())) return false; + } + if (hasServiceOptions() != other.hasServiceOptions()) return false; + if (hasServiceOptions()) { + if (!getServiceOptions() + .equals(other.getServiceOptions())) return false; + } + if (hasThreadingOptions() != other.hasThreadingOptions()) return false; + if (hasThreadingOptions()) { + if (!getThreadingOptions() + .equals(other.getThreadingOptions())) return false; + } + if (!getOptionalDatasetNameCase().equals(other.getOptionalDatasetNameCase())) return false; + switch (optionalDatasetNameCase_) { + case 10: + if (!getDatasetName() + .equals(other.getDatasetName())) return false; + break; + case 0: + default: + } + if (!getOptionalDeterministicCase().equals(other.getOptionalDeterministicCase())) return false; + switch (optionalDeterministicCase_) { + case 1: + if (getDeterministic() + != other.getDeterministic()) return false; + break; + case 0: + default: + } + if (!getOptionalSlackCase().equals(other.getOptionalSlackCase())) return false; + switch (optionalSlackCase_) { + case 4: + if (getSlack() + != other.getSlack()) return false; + break; + case 0: + default: + } + if (!getOptionalExternalStatePolicyCase().equals(other.getOptionalExternalStatePolicyCase())) return false; + switch (optionalExternalStatePolicyCase_) { + case 6: + if (getExternalStatePolicyValue() + != other.getExternalStatePolicyValue()) return false; + break; + case 0: + default: + } + if (!getOptionalSymbolicCheckpointCase().equals(other.getOptionalSymbolicCheckpointCase())) return false; + switch (optionalSymbolicCheckpointCase_) { + case 8: + if (getSymbolicCheckpoint() + != other.getSymbolicCheckpoint()) return false; + break; + case 0: + default: + } + if (!getOptionalWarmStartCase().equals(other.getOptionalWarmStartCase())) return false; + switch (optionalWarmStartCase_) { + case 9: + if (getWarmStart() + != other.getWarmStart()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFrameworkTypeCount() > 0) { + hash = (37 * hash) + FRAMEWORK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFrameworkTypeList().hashCode(); + } + if (hasAutotuneOptions()) { + hash = (37 * hash) + AUTOTUNE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getAutotuneOptions().hashCode(); + } + if (hasDistributeOptions()) { + hash = (37 * hash) + DISTRIBUTE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getDistributeOptions().hashCode(); + } + if (hasOptimizationOptions()) { + hash = (37 * hash) + OPTIMIZATION_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptimizationOptions().hashCode(); + } + if (hasServiceOptions()) { + hash = (37 * hash) + SERVICE_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getServiceOptions().hashCode(); + } + if (hasThreadingOptions()) { + hash = (37 * hash) + THREADING_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getThreadingOptions().hashCode(); + } + switch (optionalDatasetNameCase_) { + case 10: + hash = (37 * hash) + DATASET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDatasetName().hashCode(); + break; + case 0: + default: + } + switch (optionalDeterministicCase_) { + case 1: + hash = (37 * hash) + DETERMINISTIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getDeterministic()); + break; + case 0: + default: + } + switch (optionalSlackCase_) { + case 4: + hash = (37 * hash) + SLACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSlack()); + break; + case 0: + default: + } + switch (optionalExternalStatePolicyCase_) { + case 6: + hash = (37 * hash) + EXTERNAL_STATE_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getExternalStatePolicyValue(); + break; + case 0: + default: + } + switch (optionalSymbolicCheckpointCase_) { + case 8: + hash = (37 * hash) + SYMBOLIC_CHECKPOINT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSymbolicCheckpoint()); + break; + case 0: + default: + } + switch (optionalWarmStartCase_) { + case 9: + hash = (37 * hash) + WARM_START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWarmStart()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.Options 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.DatasetOptions.Options parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.Options 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.DatasetOptions.Options parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.DatasetOptions.Options parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.DatasetOptions.Options parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.DatasetOptions.Options parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.DatasetOptions.Options 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Message stored with Dataset objects to control how datasets are processed and
    +     * optimized.
    +     *
    +     * next: 13
    +     * 
    + * + * Protobuf type {@code tensorflow.data.Options} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.Options) + org.tensorflow.proto.data.DatasetOptions.OptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_Options_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_Options_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.DatasetOptions.Options.class, org.tensorflow.proto.data.DatasetOptions.Options.Builder.class); + } + + // Construct using org.tensorflow.proto.data.DatasetOptions.Options.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getAutotuneOptionsFieldBuilder(); + getDistributeOptionsFieldBuilder(); + getOptimizationOptionsFieldBuilder(); + getServiceOptionsFieldBuilder(); + getThreadingOptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + frameworkType_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + autotuneOptions_ = null; + if (autotuneOptionsBuilder_ != null) { + autotuneOptionsBuilder_.dispose(); + autotuneOptionsBuilder_ = null; + } + distributeOptions_ = null; + if (distributeOptionsBuilder_ != null) { + distributeOptionsBuilder_.dispose(); + distributeOptionsBuilder_ = null; + } + optimizationOptions_ = null; + if (optimizationOptionsBuilder_ != null) { + optimizationOptionsBuilder_.dispose(); + optimizationOptionsBuilder_ = null; + } + serviceOptions_ = null; + if (serviceOptionsBuilder_ != null) { + serviceOptionsBuilder_.dispose(); + serviceOptionsBuilder_ = null; + } + threadingOptions_ = null; + if (threadingOptionsBuilder_ != null) { + threadingOptionsBuilder_.dispose(); + threadingOptionsBuilder_ = null; + } + optionalDatasetNameCase_ = 0; + optionalDatasetName_ = null; + optionalDeterministicCase_ = 0; + optionalDeterministic_ = null; + optionalSlackCase_ = 0; + optionalSlack_ = null; + optionalExternalStatePolicyCase_ = 0; + optionalExternalStatePolicy_ = null; + optionalSymbolicCheckpointCase_ = 0; + optionalSymbolicCheckpoint_ = null; + optionalWarmStartCase_ = 0; + optionalWarmStart_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.DatasetOptions.internal_static_tensorflow_data_Options_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.Options getDefaultInstanceForType() { + return org.tensorflow.proto.data.DatasetOptions.Options.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.Options build() { + org.tensorflow.proto.data.DatasetOptions.Options result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.Options buildPartial() { + org.tensorflow.proto.data.DatasetOptions.Options result = new org.tensorflow.proto.data.DatasetOptions.Options(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.DatasetOptions.Options result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + frameworkType_.makeImmutable(); + result.frameworkType_ = frameworkType_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.autotuneOptions_ = autotuneOptionsBuilder_ == null + ? autotuneOptions_ + : autotuneOptionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.distributeOptions_ = distributeOptionsBuilder_ == null + ? distributeOptions_ + : distributeOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.optimizationOptions_ = optimizationOptionsBuilder_ == null + ? optimizationOptions_ + : optimizationOptionsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceOptions_ = serviceOptionsBuilder_ == null + ? serviceOptions_ + : serviceOptionsBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.threadingOptions_ = threadingOptionsBuilder_ == null + ? threadingOptions_ + : threadingOptionsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(org.tensorflow.proto.data.DatasetOptions.Options result) { + result.optionalDatasetNameCase_ = optionalDatasetNameCase_; + result.optionalDatasetName_ = this.optionalDatasetName_; + result.optionalDeterministicCase_ = optionalDeterministicCase_; + result.optionalDeterministic_ = this.optionalDeterministic_; + result.optionalSlackCase_ = optionalSlackCase_; + result.optionalSlack_ = this.optionalSlack_; + result.optionalExternalStatePolicyCase_ = optionalExternalStatePolicyCase_; + result.optionalExternalStatePolicy_ = this.optionalExternalStatePolicy_; + result.optionalSymbolicCheckpointCase_ = optionalSymbolicCheckpointCase_; + result.optionalSymbolicCheckpoint_ = this.optionalSymbolicCheckpoint_; + result.optionalWarmStartCase_ = optionalWarmStartCase_; + result.optionalWarmStart_ = this.optionalWarmStart_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.DatasetOptions.Options) { + return mergeFrom((org.tensorflow.proto.data.DatasetOptions.Options)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.DatasetOptions.Options other) { + if (other == org.tensorflow.proto.data.DatasetOptions.Options.getDefaultInstance()) return this; + if (!other.frameworkType_.isEmpty()) { + if (frameworkType_.isEmpty()) { + frameworkType_ = other.frameworkType_; + bitField0_ |= 0x00000002; + } else { + ensureFrameworkTypeIsMutable(); + frameworkType_.addAll(other.frameworkType_); + } + onChanged(); + } + if (other.hasAutotuneOptions()) { + mergeAutotuneOptions(other.getAutotuneOptions()); + } + if (other.hasDistributeOptions()) { + mergeDistributeOptions(other.getDistributeOptions()); + } + if (other.hasOptimizationOptions()) { + mergeOptimizationOptions(other.getOptimizationOptions()); + } + if (other.hasServiceOptions()) { + mergeServiceOptions(other.getServiceOptions()); + } + if (other.hasThreadingOptions()) { + mergeThreadingOptions(other.getThreadingOptions()); + } + switch (other.getOptionalDatasetNameCase()) { + case DATASET_NAME: { + optionalDatasetNameCase_ = 10; + optionalDatasetName_ = other.optionalDatasetName_; + onChanged(); + break; + } + case OPTIONALDATASETNAME_NOT_SET: { + break; + } + } + switch (other.getOptionalDeterministicCase()) { + case DETERMINISTIC: { + setDeterministic(other.getDeterministic()); + break; + } + case OPTIONALDETERMINISTIC_NOT_SET: { + break; + } + } + switch (other.getOptionalSlackCase()) { + case SLACK: { + setSlack(other.getSlack()); + break; + } + case OPTIONALSLACK_NOT_SET: { + break; + } + } + switch (other.getOptionalExternalStatePolicyCase()) { + case EXTERNAL_STATE_POLICY: { + setExternalStatePolicyValue(other.getExternalStatePolicyValue()); + break; + } + case OPTIONALEXTERNALSTATEPOLICY_NOT_SET: { + break; + } + } + switch (other.getOptionalSymbolicCheckpointCase()) { + case SYMBOLIC_CHECKPOINT: { + setSymbolicCheckpoint(other.getSymbolicCheckpoint()); + break; + } + case OPTIONALSYMBOLICCHECKPOINT_NOT_SET: { + break; + } + } + switch (other.getOptionalWarmStartCase()) { + case WARM_START: { + setWarmStart(other.getWarmStart()); + break; + } + case OPTIONALWARMSTART_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + optionalDeterministic_ = input.readBool(); + optionalDeterministicCase_ = 1; + break; + } // case 8 + case 18: { + input.readMessage( + getDistributeOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 18 + case 26: { + input.readMessage( + getOptimizationOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 26 + case 32: { + optionalSlack_ = input.readBool(); + optionalSlackCase_ = 4; + break; + } // case 32 + case 42: { + input.readMessage( + getThreadingOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 42 + case 48: { + int rawValue = input.readEnum(); + optionalExternalStatePolicyCase_ = 6; + optionalExternalStatePolicy_ = rawValue; + break; + } // case 48 + case 58: { + input.readMessage( + getAutotuneOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 58 + case 64: { + optionalSymbolicCheckpoint_ = input.readBool(); + optionalSymbolicCheckpointCase_ = 8; + break; + } // case 64 + case 72: { + optionalWarmStart_ = input.readBool(); + optionalWarmStartCase_ = 9; + break; + } // case 72 + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + optionalDatasetNameCase_ = 10; + optionalDatasetName_ = s; + break; + } // case 82 + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + ensureFrameworkTypeIsMutable(); + frameworkType_.add(s); + break; + } // case 90 + case 98: { + input.readMessage( + getServiceOptionsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 98 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int optionalDatasetNameCase_ = 0; + private java.lang.Object optionalDatasetName_; + public OptionalDatasetNameCase + getOptionalDatasetNameCase() { + return OptionalDatasetNameCase.forNumber( + optionalDatasetNameCase_); + } + + public Builder clearOptionalDatasetName() { + optionalDatasetNameCase_ = 0; + optionalDatasetName_ = null; + onChanged(); + return this; + } + + private int optionalDeterministicCase_ = 0; + private java.lang.Object optionalDeterministic_; + public OptionalDeterministicCase + getOptionalDeterministicCase() { + return OptionalDeterministicCase.forNumber( + optionalDeterministicCase_); + } + + public Builder clearOptionalDeterministic() { + optionalDeterministicCase_ = 0; + optionalDeterministic_ = null; + onChanged(); + return this; + } + + private int optionalSlackCase_ = 0; + private java.lang.Object optionalSlack_; + public OptionalSlackCase + getOptionalSlackCase() { + return OptionalSlackCase.forNumber( + optionalSlackCase_); + } + + public Builder clearOptionalSlack() { + optionalSlackCase_ = 0; + optionalSlack_ = null; + onChanged(); + return this; + } + + private int optionalExternalStatePolicyCase_ = 0; + private java.lang.Object optionalExternalStatePolicy_; + public OptionalExternalStatePolicyCase + getOptionalExternalStatePolicyCase() { + return OptionalExternalStatePolicyCase.forNumber( + optionalExternalStatePolicyCase_); + } + + public Builder clearOptionalExternalStatePolicy() { + optionalExternalStatePolicyCase_ = 0; + optionalExternalStatePolicy_ = null; + onChanged(); + return this; + } + + private int optionalSymbolicCheckpointCase_ = 0; + private java.lang.Object optionalSymbolicCheckpoint_; + public OptionalSymbolicCheckpointCase + getOptionalSymbolicCheckpointCase() { + return OptionalSymbolicCheckpointCase.forNumber( + optionalSymbolicCheckpointCase_); + } + + public Builder clearOptionalSymbolicCheckpoint() { + optionalSymbolicCheckpointCase_ = 0; + optionalSymbolicCheckpoint_ = null; + onChanged(); + return this; + } + + private int optionalWarmStartCase_ = 0; + private java.lang.Object optionalWarmStart_; + public OptionalWarmStartCase + getOptionalWarmStartCase() { + return OptionalWarmStartCase.forNumber( + optionalWarmStartCase_); + } + + public Builder clearOptionalWarmStart() { + optionalWarmStartCase_ = 0; + optionalWarmStart_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string dataset_name = 10; + * @return Whether the datasetName field is set. + */ + @java.lang.Override + public boolean hasDatasetName() { + return optionalDatasetNameCase_ == 10; + } + /** + * string dataset_name = 10; + * @return The datasetName. + */ + @java.lang.Override + public java.lang.String getDatasetName() { + java.lang.Object ref = ""; + if (optionalDatasetNameCase_ == 10) { + ref = optionalDatasetName_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (optionalDatasetNameCase_ == 10) { + optionalDatasetName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string dataset_name = 10; + * @return The bytes for datasetName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDatasetNameBytes() { + java.lang.Object ref = ""; + if (optionalDatasetNameCase_ == 10) { + ref = optionalDatasetName_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (optionalDatasetNameCase_ == 10) { + optionalDatasetName_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string dataset_name = 10; + * @param value The datasetName to set. + * @return This builder for chaining. + */ + public Builder setDatasetName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + optionalDatasetNameCase_ = 10; + optionalDatasetName_ = value; + onChanged(); + return this; + } + /** + * string dataset_name = 10; + * @return This builder for chaining. + */ + public Builder clearDatasetName() { + if (optionalDatasetNameCase_ == 10) { + optionalDatasetNameCase_ = 0; + optionalDatasetName_ = null; + onChanged(); + } + return this; + } + /** + * string dataset_name = 10; + * @param value The bytes for datasetName to set. + * @return This builder for chaining. + */ + public Builder setDatasetNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + optionalDatasetNameCase_ = 10; + optionalDatasetName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList frameworkType_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureFrameworkTypeIsMutable() { + if (!frameworkType_.isModifiable()) { + frameworkType_ = new com.google.protobuf.LazyStringArrayList(frameworkType_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @return A list containing the frameworkType. + */ + public com.google.protobuf.ProtocolStringList + getFrameworkTypeList() { + frameworkType_.makeImmutable(); + return frameworkType_; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @return The count of frameworkType. + */ + public int getFrameworkTypeCount() { + return frameworkType_.size(); + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param index The index of the element to return. + * @return The frameworkType at the given index. + */ + public java.lang.String getFrameworkType(int index) { + return frameworkType_.get(index); + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param index The index of the value to return. + * @return The bytes of the frameworkType at the given index. + */ + public com.google.protobuf.ByteString + getFrameworkTypeBytes(int index) { + return frameworkType_.getByteString(index); + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param index The index to set the value at. + * @param value The frameworkType to set. + * @return This builder for chaining. + */ + public Builder setFrameworkType( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFrameworkTypeIsMutable(); + frameworkType_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param value The frameworkType to add. + * @return This builder for chaining. + */ + public Builder addFrameworkType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureFrameworkTypeIsMutable(); + frameworkType_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param values The frameworkType to add. + * @return This builder for chaining. + */ + public Builder addAllFrameworkType( + java.lang.Iterable values) { + ensureFrameworkTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frameworkType_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @return This builder for chaining. + */ + public Builder clearFrameworkType() { + frameworkType_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +       * List of frameworks used to generate this dataset.
    +       * 
    + * + * repeated string framework_type = 11; + * @param value The bytes of the frameworkType to add. + * @return This builder for chaining. + */ + public Builder addFrameworkTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureFrameworkTypeIsMutable(); + frameworkType_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * bool deterministic = 1; + * @return Whether the deterministic field is set. + */ + public boolean hasDeterministic() { + return optionalDeterministicCase_ == 1; + } + /** + * bool deterministic = 1; + * @return The deterministic. + */ + public boolean getDeterministic() { + if (optionalDeterministicCase_ == 1) { + return (java.lang.Boolean) optionalDeterministic_; + } + return false; + } + /** + * bool deterministic = 1; + * @param value The deterministic to set. + * @return This builder for chaining. + */ + public Builder setDeterministic(boolean value) { + + optionalDeterministicCase_ = 1; + optionalDeterministic_ = value; + onChanged(); + return this; + } + /** + * bool deterministic = 1; + * @return This builder for chaining. + */ + public Builder clearDeterministic() { + if (optionalDeterministicCase_ == 1) { + optionalDeterministicCase_ = 0; + optionalDeterministic_ = null; + onChanged(); + } + return this; + } + + private org.tensorflow.proto.data.DatasetOptions.AutotuneOptions autotuneOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions, org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder, org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder> autotuneOptionsBuilder_; + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return Whether the autotuneOptions field is set. + */ + public boolean hasAutotuneOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + * @return The autotuneOptions. + */ + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions getAutotuneOptions() { + if (autotuneOptionsBuilder_ == null) { + return autotuneOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance() : autotuneOptions_; + } else { + return autotuneOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public Builder setAutotuneOptions(org.tensorflow.proto.data.DatasetOptions.AutotuneOptions value) { + if (autotuneOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + autotuneOptions_ = value; + } else { + autotuneOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public Builder setAutotuneOptions( + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder builderForValue) { + if (autotuneOptionsBuilder_ == null) { + autotuneOptions_ = builderForValue.build(); + } else { + autotuneOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public Builder mergeAutotuneOptions(org.tensorflow.proto.data.DatasetOptions.AutotuneOptions value) { + if (autotuneOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + autotuneOptions_ != null && + autotuneOptions_ != org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance()) { + getAutotuneOptionsBuilder().mergeFrom(value); + } else { + autotuneOptions_ = value; + } + } else { + autotuneOptionsBuilder_.mergeFrom(value); + } + if (autotuneOptions_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public Builder clearAutotuneOptions() { + bitField0_ = (bitField0_ & ~0x00000008); + autotuneOptions_ = null; + if (autotuneOptionsBuilder_ != null) { + autotuneOptionsBuilder_.dispose(); + autotuneOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder getAutotuneOptionsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAutotuneOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + public org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder getAutotuneOptionsOrBuilder() { + if (autotuneOptionsBuilder_ != null) { + return autotuneOptionsBuilder_.getMessageOrBuilder(); + } else { + return autotuneOptions_ == null ? + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.getDefaultInstance() : autotuneOptions_; + } + } + /** + *
    +       * The autotune options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.AutotuneOptions autotune_options = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions, org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder, org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder> + getAutotuneOptionsFieldBuilder() { + if (autotuneOptionsBuilder_ == null) { + autotuneOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.AutotuneOptions, org.tensorflow.proto.data.DatasetOptions.AutotuneOptions.Builder, org.tensorflow.proto.data.DatasetOptions.AutotuneOptionsOrBuilder>( + getAutotuneOptions(), + getParentForChildren(), + isClean()); + autotuneOptions_ = null; + } + return autotuneOptionsBuilder_; + } + + private org.tensorflow.proto.data.DatasetOptions.DistributeOptions distributeOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.DistributeOptions, org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder, org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder> distributeOptionsBuilder_; + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return Whether the distributeOptions field is set. + */ + public boolean hasDistributeOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + * @return The distributeOptions. + */ + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions getDistributeOptions() { + if (distributeOptionsBuilder_ == null) { + return distributeOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance() : distributeOptions_; + } else { + return distributeOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public Builder setDistributeOptions(org.tensorflow.proto.data.DatasetOptions.DistributeOptions value) { + if (distributeOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + distributeOptions_ = value; + } else { + distributeOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public Builder setDistributeOptions( + org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder builderForValue) { + if (distributeOptionsBuilder_ == null) { + distributeOptions_ = builderForValue.build(); + } else { + distributeOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public Builder mergeDistributeOptions(org.tensorflow.proto.data.DatasetOptions.DistributeOptions value) { + if (distributeOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + distributeOptions_ != null && + distributeOptions_ != org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance()) { + getDistributeOptionsBuilder().mergeFrom(value); + } else { + distributeOptions_ = value; + } + } else { + distributeOptionsBuilder_.mergeFrom(value); + } + if (distributeOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public Builder clearDistributeOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + distributeOptions_ = null; + if (distributeOptionsBuilder_ != null) { + distributeOptionsBuilder_.dispose(); + distributeOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder getDistributeOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDistributeOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + public org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder getDistributeOptionsOrBuilder() { + if (distributeOptionsBuilder_ != null) { + return distributeOptionsBuilder_.getMessageOrBuilder(); + } else { + return distributeOptions_ == null ? + org.tensorflow.proto.data.DatasetOptions.DistributeOptions.getDefaultInstance() : distributeOptions_; + } + } + /** + *
    +       * The distribution strategy options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.DistributeOptions distribute_options = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.DistributeOptions, org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder, org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder> + getDistributeOptionsFieldBuilder() { + if (distributeOptionsBuilder_ == null) { + distributeOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.DistributeOptions, org.tensorflow.proto.data.DatasetOptions.DistributeOptions.Builder, org.tensorflow.proto.data.DatasetOptions.DistributeOptionsOrBuilder>( + getDistributeOptions(), + getParentForChildren(), + isClean()); + distributeOptions_ = null; + } + return distributeOptionsBuilder_; + } + + private org.tensorflow.proto.data.DatasetOptions.OptimizationOptions optimizationOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions, org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder, org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder> optimizationOptionsBuilder_; + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return Whether the optimizationOptions field is set. + */ + public boolean hasOptimizationOptions() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + * @return The optimizationOptions. + */ + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions getOptimizationOptions() { + if (optimizationOptionsBuilder_ == null) { + return optimizationOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance() : optimizationOptions_; + } else { + return optimizationOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public Builder setOptimizationOptions(org.tensorflow.proto.data.DatasetOptions.OptimizationOptions value) { + if (optimizationOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + optimizationOptions_ = value; + } else { + optimizationOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public Builder setOptimizationOptions( + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder builderForValue) { + if (optimizationOptionsBuilder_ == null) { + optimizationOptions_ = builderForValue.build(); + } else { + optimizationOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public Builder mergeOptimizationOptions(org.tensorflow.proto.data.DatasetOptions.OptimizationOptions value) { + if (optimizationOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + optimizationOptions_ != null && + optimizationOptions_ != org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance()) { + getOptimizationOptionsBuilder().mergeFrom(value); + } else { + optimizationOptions_ = value; + } + } else { + optimizationOptionsBuilder_.mergeFrom(value); + } + if (optimizationOptions_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public Builder clearOptimizationOptions() { + bitField0_ = (bitField0_ & ~0x00000020); + optimizationOptions_ = null; + if (optimizationOptionsBuilder_ != null) { + optimizationOptionsBuilder_.dispose(); + optimizationOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder getOptimizationOptionsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getOptimizationOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + public org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder getOptimizationOptionsOrBuilder() { + if (optimizationOptionsBuilder_ != null) { + return optimizationOptionsBuilder_.getMessageOrBuilder(); + } else { + return optimizationOptions_ == null ? + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.getDefaultInstance() : optimizationOptions_; + } + } + /** + *
    +       * The optimization options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.OptimizationOptions optimization_options = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions, org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder, org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder> + getOptimizationOptionsFieldBuilder() { + if (optimizationOptionsBuilder_ == null) { + optimizationOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.OptimizationOptions, org.tensorflow.proto.data.DatasetOptions.OptimizationOptions.Builder, org.tensorflow.proto.data.DatasetOptions.OptimizationOptionsOrBuilder>( + getOptimizationOptions(), + getParentForChildren(), + isClean()); + optimizationOptions_ = null; + } + return optimizationOptionsBuilder_; + } + + private org.tensorflow.proto.data.DatasetOptions.ServiceOptions serviceOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ServiceOptions, org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder> serviceOptionsBuilder_; + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return Whether the serviceOptions field is set. + */ + public boolean hasServiceOptions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + * @return The serviceOptions. + */ + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions getServiceOptions() { + if (serviceOptionsBuilder_ == null) { + return serviceOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance() : serviceOptions_; + } else { + return serviceOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public Builder setServiceOptions(org.tensorflow.proto.data.DatasetOptions.ServiceOptions value) { + if (serviceOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceOptions_ = value; + } else { + serviceOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public Builder setServiceOptions( + org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder builderForValue) { + if (serviceOptionsBuilder_ == null) { + serviceOptions_ = builderForValue.build(); + } else { + serviceOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public Builder mergeServiceOptions(org.tensorflow.proto.data.DatasetOptions.ServiceOptions value) { + if (serviceOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + serviceOptions_ != null && + serviceOptions_ != org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance()) { + getServiceOptionsBuilder().mergeFrom(value); + } else { + serviceOptions_ = value; + } + } else { + serviceOptionsBuilder_.mergeFrom(value); + } + if (serviceOptions_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public Builder clearServiceOptions() { + bitField0_ = (bitField0_ & ~0x00000040); + serviceOptions_ = null; + if (serviceOptionsBuilder_ != null) { + serviceOptionsBuilder_.dispose(); + serviceOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder getServiceOptionsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getServiceOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + public org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder getServiceOptionsOrBuilder() { + if (serviceOptionsBuilder_ != null) { + return serviceOptionsBuilder_.getMessageOrBuilder(); + } else { + return serviceOptions_ == null ? + org.tensorflow.proto.data.DatasetOptions.ServiceOptions.getDefaultInstance() : serviceOptions_; + } + } + /** + *
    +       * The tf.data service options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ServiceOptions service_options = 12; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ServiceOptions, org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder> + getServiceOptionsFieldBuilder() { + if (serviceOptionsBuilder_ == null) { + serviceOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ServiceOptions, org.tensorflow.proto.data.DatasetOptions.ServiceOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ServiceOptionsOrBuilder>( + getServiceOptions(), + getParentForChildren(), + isClean()); + serviceOptions_ = null; + } + return serviceOptionsBuilder_; + } + + /** + * bool slack = 4; + * @return Whether the slack field is set. + */ + public boolean hasSlack() { + return optionalSlackCase_ == 4; + } + /** + * bool slack = 4; + * @return The slack. + */ + public boolean getSlack() { + if (optionalSlackCase_ == 4) { + return (java.lang.Boolean) optionalSlack_; + } + return false; + } + /** + * bool slack = 4; + * @param value The slack to set. + * @return This builder for chaining. + */ + public Builder setSlack(boolean value) { + + optionalSlackCase_ = 4; + optionalSlack_ = value; + onChanged(); + return this; + } + /** + * bool slack = 4; + * @return This builder for chaining. + */ + public Builder clearSlack() { + if (optionalSlackCase_ == 4) { + optionalSlackCase_ = 0; + optionalSlack_ = null; + onChanged(); + } + return this; + } + + private org.tensorflow.proto.data.DatasetOptions.ThreadingOptions threadingOptions_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions, org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder> threadingOptionsBuilder_; + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return Whether the threadingOptions field is set. + */ + public boolean hasThreadingOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + * @return The threadingOptions. + */ + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions getThreadingOptions() { + if (threadingOptionsBuilder_ == null) { + return threadingOptions_ == null ? org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance() : threadingOptions_; + } else { + return threadingOptionsBuilder_.getMessage(); + } + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public Builder setThreadingOptions(org.tensorflow.proto.data.DatasetOptions.ThreadingOptions value) { + if (threadingOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + threadingOptions_ = value; + } else { + threadingOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public Builder setThreadingOptions( + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder builderForValue) { + if (threadingOptionsBuilder_ == null) { + threadingOptions_ = builderForValue.build(); + } else { + threadingOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public Builder mergeThreadingOptions(org.tensorflow.proto.data.DatasetOptions.ThreadingOptions value) { + if (threadingOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) && + threadingOptions_ != null && + threadingOptions_ != org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance()) { + getThreadingOptionsBuilder().mergeFrom(value); + } else { + threadingOptions_ = value; + } + } else { + threadingOptionsBuilder_.mergeFrom(value); + } + if (threadingOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public Builder clearThreadingOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + threadingOptions_ = null; + if (threadingOptionsBuilder_ != null) { + threadingOptionsBuilder_.dispose(); + threadingOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder getThreadingOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getThreadingOptionsFieldBuilder().getBuilder(); + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + public org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder getThreadingOptionsOrBuilder() { + if (threadingOptionsBuilder_ != null) { + return threadingOptionsBuilder_.getMessageOrBuilder(); + } else { + return threadingOptions_ == null ? + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.getDefaultInstance() : threadingOptions_; + } + } + /** + *
    +       * The threading options associated with the dataset.
    +       * 
    + * + * .tensorflow.data.ThreadingOptions threading_options = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions, org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder> + getThreadingOptionsFieldBuilder() { + if (threadingOptionsBuilder_ == null) { + threadingOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.DatasetOptions.ThreadingOptions, org.tensorflow.proto.data.DatasetOptions.ThreadingOptions.Builder, org.tensorflow.proto.data.DatasetOptions.ThreadingOptionsOrBuilder>( + getThreadingOptions(), + getParentForChildren(), + isClean()); + threadingOptions_ = null; + } + return threadingOptionsBuilder_; + } + + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return Whether the externalStatePolicy field is set. + */ + @java.lang.Override + public boolean hasExternalStatePolicy() { + return optionalExternalStatePolicyCase_ == 6; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The enum numeric value on the wire for externalStatePolicy. + */ + @java.lang.Override + public int getExternalStatePolicyValue() { + if (optionalExternalStatePolicyCase_ == 6) { + return ((java.lang.Integer) optionalExternalStatePolicy_).intValue(); + } + return 0; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @param value The enum numeric value on the wire for externalStatePolicy to set. + * @return This builder for chaining. + */ + public Builder setExternalStatePolicyValue(int value) { + optionalExternalStatePolicyCase_ = 6; + optionalExternalStatePolicy_ = value; + onChanged(); + return this; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return The externalStatePolicy. + */ + @java.lang.Override + public org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy getExternalStatePolicy() { + if (optionalExternalStatePolicyCase_ == 6) { + org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy result = org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.forNumber( + (java.lang.Integer) optionalExternalStatePolicy_); + return result == null ? org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.UNRECOGNIZED : result; + } + return org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy.POLICY_WARN; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @param value The externalStatePolicy to set. + * @return This builder for chaining. + */ + public Builder setExternalStatePolicy(org.tensorflow.proto.data.DatasetOptions.ExternalStatePolicy value) { + if (value == null) { + throw new NullPointerException(); + } + optionalExternalStatePolicyCase_ = 6; + optionalExternalStatePolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .tensorflow.data.ExternalStatePolicy external_state_policy = 6; + * @return This builder for chaining. + */ + public Builder clearExternalStatePolicy() { + if (optionalExternalStatePolicyCase_ == 6) { + optionalExternalStatePolicyCase_ = 0; + optionalExternalStatePolicy_ = null; + onChanged(); + } + return this; + } + + /** + * bool symbolic_checkpoint = 8; + * @return Whether the symbolicCheckpoint field is set. + */ + public boolean hasSymbolicCheckpoint() { + return optionalSymbolicCheckpointCase_ == 8; + } + /** + * bool symbolic_checkpoint = 8; + * @return The symbolicCheckpoint. + */ + public boolean getSymbolicCheckpoint() { + if (optionalSymbolicCheckpointCase_ == 8) { + return (java.lang.Boolean) optionalSymbolicCheckpoint_; + } + return false; + } + /** + * bool symbolic_checkpoint = 8; + * @param value The symbolicCheckpoint to set. + * @return This builder for chaining. + */ + public Builder setSymbolicCheckpoint(boolean value) { + + optionalSymbolicCheckpointCase_ = 8; + optionalSymbolicCheckpoint_ = value; + onChanged(); + return this; + } + /** + * bool symbolic_checkpoint = 8; + * @return This builder for chaining. + */ + public Builder clearSymbolicCheckpoint() { + if (optionalSymbolicCheckpointCase_ == 8) { + optionalSymbolicCheckpointCase_ = 0; + optionalSymbolicCheckpoint_ = null; + onChanged(); + } + return this; + } + + /** + * bool warm_start = 9; + * @return Whether the warmStart field is set. + */ + public boolean hasWarmStart() { + return optionalWarmStartCase_ == 9; + } + /** + * bool warm_start = 9; + * @return The warmStart. + */ + public boolean getWarmStart() { + if (optionalWarmStartCase_ == 9) { + return (java.lang.Boolean) optionalWarmStart_; + } + return false; + } + /** + * bool warm_start = 9; + * @param value The warmStart to set. + * @return This builder for chaining. + */ + public Builder setWarmStart(boolean value) { + + optionalWarmStartCase_ = 9; + optionalWarmStart_ = value; + onChanged(); + return this; + } + /** + * bool warm_start = 9; + * @return This builder for chaining. + */ + public Builder clearWarmStart() { + if (optionalWarmStartCase_ == 9) { + optionalWarmStartCase_ = 0; + optionalWarmStart_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.Options) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.Options) + private static final org.tensorflow.proto.data.DatasetOptions.Options DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.DatasetOptions.Options(); + } + + public static org.tensorflow.proto.data.DatasetOptions.Options getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Options parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.DatasetOptions.Options getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_AutotuneOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_AutotuneOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_CardinalityOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_CardinalityOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_DistributeOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_OptimizationOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_ServiceOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_ServiceOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_ThreadingOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_Options_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_Options_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/framework/dataset_opti" + + "ons.proto\022\017tensorflow.data\032%tensorflow/c" + + "ore/framework/model.proto\"\357\002\n\017AutotuneOp" + + "tions\022\021\n\007enabled\030\001 \001(\010H\000\022\024\n\ncpu_budget\030\002" + + " \001(\005H\001\022\024\n\nram_budget\030\003 \001(\003H\002\022F\n\022autotune" + + "_algorithm\030\004 \001(\0162(.tensorflow.data.model" + + ".AutotuneAlgorithmH\003\022\035\n\023initial_parallel" + + "ism\030\005 \001(\003H\004\022\031\n\017min_parallelism\030\006 \001(\003H\005B\022" + + "\n\020optional_enabledB\025\n\023optional_cpu_budge" + + "tB\025\n\023optional_ram_budgetB\035\n\033optional_aut" + + "otune_algorithmB\036\n\034optional_initial_para" + + "llelismB\032\n\030optional_min_parallelism\"\321\001\n\022" + + "CardinalityOptions\022G\n\rcompute_level\030\001 \001(" + + "\01620.tensorflow.data.CardinalityOptions.C" + + "omputeLevel\"r\n\014ComputeLevel\022#\n\037CARDINALI" + + "TY_COMPUTE_UNSPECIFIED\020\000\022\033\n\027CARDINALITY_" + + "COMPUTE_LOW\020\001\022 \n\034CARDINALITY_COMPUTE_MOD" + + "ERATE\020\002\"\177\n\021DistributeOptions\022;\n\021auto_sha" + + "rd_policy\030\001 \001(\0162 .tensorflow.data.AutoSh" + + "ardPolicy\022\025\n\013num_devices\030\002 \001(\005H\000B\026\n\024opti" + + "onal_num_devices\"\271\006\n\023OptimizationOptions" + + "\022%\n\033apply_default_optimizations\030\001 \001(\010H\000\022" + + "\027\n\rfilter_fusion\030\006 \001(\010H\001\022\036\n\024map_and_batc" + + "h_fusion\030\t \001(\010H\002\022\037\n\025map_and_filter_fusio" + + "n\030\n \001(\010H\003\022\024\n\nmap_fusion\030\013 \001(\010H\004\022\035\n\023map_p" + + "arallelization\030\014 \001(\010H\005\022\032\n\020noop_eliminati" + + "on\030\016 \001(\010H\006\022\030\n\016parallel_batch\030\017 \001(\010H\007\022#\n\031" + + "shuffle_and_repeat_fusion\030\021 \001(\010H\010\022 \n\026fil" + + "ter_parallelization\030\022 \001(\010H\t\022\031\n\017inject_pr" + + "efetch\030\023 \001(\010H\n\022!\n\027seq_interleave_prefetc" + + "h\030\025 \001(\010H\013B&\n$optional_apply_default_opti" + + "mizationsB\030\n\026optional_filter_fusionB\037\n\035o" + + "ptional_map_and_batch_fusionB \n\036optional" + + "_map_and_filter_fusionB\025\n\023optional_map_f" + + "usionB\036\n\034optional_map_parallelizationB\033\n" + + "\031optional_noop_eliminationB\031\n\027optional_p" + + "arallel_batchB$\n\"optional_shuffle_and_re" + + "peat_fusionB!\n\037optional_filter_paralleli" + + "zationB\032\n\030optional_inject_prefetchB\"\n op" + + "tional_seq_interleave_prefetchJ\004\010\002\020\003J\004\010\003" + + "\020\004J\004\010\004\020\005J\004\010\005\020\006J\004\010\007\020\010J\004\010\010\020\tJ\004\010\r\020\016J\004\010\020\020\021J\004" + + "\010\024\020\025\"5\n\016ServiceOptions\022\020\n\006pinned\030\001 \001(\010H\000" + + "B\021\n\017optional_pinned\"\242\001\n\020ThreadingOptions" + + "\022\"\n\030max_intra_op_parallelism\030\001 \001(\005H\000\022!\n\027" + + "private_threadpool_size\030\002 \001(\005H\001B#\n!optio" + + "nal_max_intra_op_parallelismB\"\n optional" + + "_private_threadpool_size\"\265\005\n\007Options\022\026\n\014" + + "dataset_name\030\n \001(\tH\000\022\026\n\016framework_type\030\013" + + " \003(\t\022\027\n\rdeterministic\030\001 \001(\010H\001\022:\n\020autotun" + + "e_options\030\007 \001(\0132 .tensorflow.data.Autotu" + + "neOptions\022>\n\022distribute_options\030\002 \001(\0132\"." + + "tensorflow.data.DistributeOptions\022B\n\024opt" + + "imization_options\030\003 \001(\0132$.tensorflow.dat" + + "a.OptimizationOptions\0228\n\017service_options" + + "\030\014 \001(\0132\037.tensorflow.data.ServiceOptions\022" + + "\017\n\005slack\030\004 \001(\010H\002\022<\n\021threading_options\030\005 " + + "\001(\0132!.tensorflow.data.ThreadingOptions\022E" + + "\n\025external_state_policy\030\006 \001(\0162$.tensorfl" + + "ow.data.ExternalStatePolicyH\003\022\035\n\023symboli" + + "c_checkpoint\030\010 \001(\010H\004\022\024\n\nwarm_start\030\t \001(\010" + + "H\005B\027\n\025optional_dataset_nameB\030\n\026optional_" + + "deterministicB\020\n\016optional_slackB \n\036optio" + + "nal_external_state_policyB\036\n\034optional_sy" + + "mbolic_checkpointB\025\n\023optional_warm_start" + + "*K\n\017AutoShardPolicy\022\010\n\004AUTO\020\000\022\010\n\004FILE\020\001\022" + + "\010\n\004DATA\020\002\022\010\n\004HINT\020\003\022\020\n\003OFF\020\377\377\377\377\377\377\377\377\377\001*J\n" + + "\023ExternalStatePolicy\022\017\n\013POLICY_WARN\020\000\022\021\n" + + "\rPOLICY_IGNORE\020\001\022\017\n\013POLICY_FAIL\020\002Bs\n\031org" + + ".tensorflow.proto.dataZVgithub.com/tenso" + + "rflow/tensorflow/tensorflow/go/core/fram" + + "ework/dataset_options_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.data.model.Model.getDescriptor(), + }); + internal_static_tensorflow_data_AutotuneOptions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_AutotuneOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_AutotuneOptions_descriptor, + new java.lang.String[] { "Enabled", "CpuBudget", "RamBudget", "AutotuneAlgorithm", "InitialParallelism", "MinParallelism", "OptionalEnabled", "OptionalCpuBudget", "OptionalRamBudget", "OptionalAutotuneAlgorithm", "OptionalInitialParallelism", "OptionalMinParallelism", }); + internal_static_tensorflow_data_CardinalityOptions_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_CardinalityOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_CardinalityOptions_descriptor, + new java.lang.String[] { "ComputeLevel", }); + internal_static_tensorflow_data_DistributeOptions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_data_DistributeOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_DistributeOptions_descriptor, + new java.lang.String[] { "AutoShardPolicy", "NumDevices", "OptionalNumDevices", }); + internal_static_tensorflow_data_OptimizationOptions_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_data_OptimizationOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_OptimizationOptions_descriptor, + new java.lang.String[] { "ApplyDefaultOptimizations", "FilterFusion", "MapAndBatchFusion", "MapAndFilterFusion", "MapFusion", "MapParallelization", "NoopElimination", "ParallelBatch", "ShuffleAndRepeatFusion", "FilterParallelization", "InjectPrefetch", "SeqInterleavePrefetch", "OptionalApplyDefaultOptimizations", "OptionalFilterFusion", "OptionalMapAndBatchFusion", "OptionalMapAndFilterFusion", "OptionalMapFusion", "OptionalMapParallelization", "OptionalNoopElimination", "OptionalParallelBatch", "OptionalShuffleAndRepeatFusion", "OptionalFilterParallelization", "OptionalInjectPrefetch", "OptionalSeqInterleavePrefetch", }); + internal_static_tensorflow_data_ServiceOptions_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_data_ServiceOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_ServiceOptions_descriptor, + new java.lang.String[] { "Pinned", "OptionalPinned", }); + internal_static_tensorflow_data_ThreadingOptions_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_data_ThreadingOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_ThreadingOptions_descriptor, + new java.lang.String[] { "MaxIntraOpParallelism", "PrivateThreadpoolSize", "OptionalMaxIntraOpParallelism", "OptionalPrivateThreadpoolSize", }); + internal_static_tensorflow_data_Options_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_data_Options_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_Options_descriptor, + new java.lang.String[] { "DatasetName", "FrameworkType", "Deterministic", "AutotuneOptions", "DistributeOptions", "OptimizationOptions", "ServiceOptions", "Slack", "ThreadingOptions", "ExternalStatePolicy", "SymbolicCheckpoint", "WarmStart", "OptionalDatasetName", "OptionalDeterministic", "OptionalSlack", "OptionalExternalStatePolicy", "OptionalSymbolicCheckpoint", "OptionalWarmStart", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.data.model.Model.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java new file mode 100644 index 00000000000..1da009dbcf5 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/ServiceConfig.java @@ -0,0 +1,4564 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/service_config.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data.experimental; + +public final class ServiceConfig { + private ServiceConfig() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ServiceConfig.class.getName()); + } + 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; + * @return The port. + */ + long getPort(); + + /** + *
    +     * The protocol for the dispatcher to use when connecting to workers.
    +     * 
    + * + * string protocol = 2; + * @return The protocol. + */ + java.lang.String getProtocol(); + /** + *
    +     * The protocol for the dispatcher to use when connecting to workers.
    +     * 
    + * + * string protocol = 2; + * @return The bytes for protocol. + */ + 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; + * @return The workDir. + */ + 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; + * @return The bytes for workDir. + */ + 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; + * @return The faultTolerantMode. + */ + boolean getFaultTolerantMode(); + + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @return A list containing the workerAddresses. + */ + java.util.List + getWorkerAddressesList(); + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @return The count of workerAddresses. + */ + int getWorkerAddressesCount(); + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the element to return. + * @return The workerAddresses at the given index. + */ + java.lang.String getWorkerAddresses(int index); + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the value to return. + * @return The bytes of the workerAddresses at the given index. + */ + com.google.protobuf.ByteString + getWorkerAddressesBytes(int index); + + /** + *
    +     * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +     * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +     * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The enum numeric value on the wire for deploymentMode. + */ + int getDeploymentModeValue(); + /** + *
    +     * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +     * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +     * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The deploymentMode. + */ + org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode(); + + /** + *
    +     * How often the dispatcher should scan through to delete old and unused
    +     * jobs. A value of 0 indicates that the decision should be left up to the
    +     * runtime.
    +     * 
    + * + * int64 job_gc_check_interval_ms = 5; + * @return The jobGcCheckIntervalMs. + */ + long getJobGcCheckIntervalMs(); + + /** + *
    +     * How long a job needs to be unused before it becomes a candidate for garbage
    +     * collection. A value of -1 indicates that jobs should never be garbage
    +     * collected. A value of 0 indicates that the decision should be left up to
    +     * the runtime. Note: This does not apply to dynamic sharding unless users
    +     * explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
    +     * 
    + * + * int64 job_gc_timeout_ms = 6; + * @return The jobGcTimeoutMs. + */ + long getJobGcTimeoutMs(); + + /** + *
    +     * Whether dynamically sharded jobs should be eligible for garbage collection.
    +     * These jobs are not garbage collected by default, since if a job is garbage
    +     * collected and then re-created, it will revisit all data from the start. If
    +     * revisiting data is acceptible and you want automatic reclamation of
    +     * iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
    +     * 
    + * + * bool gc_dynamic_sharding_jobs = 11; + * @return The gcDynamicShardingJobs. + */ + boolean getGcDynamicShardingJobs(); + + /** + *
    +     * How long to wait before garbage-collecting a client that hasn't
    +     * heartbeated to the dispatcher. A value of 0 indicates that the timeout
    +     * should be left to the runtime.
    +     * 
    + * + * int64 client_timeout_ms = 8; + * @return The clientTimeoutMs. + */ + long getClientTimeoutMs(); + + /** + *
    +     * How long to wait for a worker to heartbeat before considering it missing.
    +     * A value of 0 indicates that the timeout should be left to the runtime.
    +     * 
    + * + * int64 worker_timeout_ms = 10; + * @return The workerTimeoutMs. + */ + long getWorkerTimeoutMs(); + + /** + *
    +     * The maximum number of snapshots that a worker can concurrently process at a
    +     * given point in time. This is a tradeoff between worker resource usage and
    +     * snapshot wall time. A value of 0 indicates that the decision should be left
    +     * up to the runtime.
    +     * 
    + * + * int64 worker_max_concurrent_snapshots = 12; + * @return The workerMaxConcurrentSnapshots. + */ + long getWorkerMaxConcurrentSnapshots(); + } + /** + *
    +   * Configuration for a tf.data service DispatchServer.
    +   * Next id: 13
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} + */ + public static final class DispatcherConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.DispatcherConfig) + DispatcherConfigOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DispatcherConfig.class.getName()); + } + // Use DispatcherConfig.newBuilder() to construct. + private DispatcherConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DispatcherConfig() { + protocol_ = ""; + workDir_ = ""; + workerAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + deploymentMode_ = 0; + } + + 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.GeneratedMessage.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_ = 0L; + /** + *
    +     * 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; + * @return The port. + */ + @java.lang.Override + public long getPort() { + return port_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** + *
    +     * The protocol for the dispatcher to use when connecting to workers.
    +     * 
    + * + * string protocol = 2; + * @return The protocol. + */ + @java.lang.Override + 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; + * @return The bytes for protocol. + */ + @java.lang.Override + 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; + @SuppressWarnings("serial") + 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; + * @return The workDir. + */ + @java.lang.Override + 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; + * @return The bytes for workDir. + */ + @java.lang.Override + 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_ = false; + /** + *
    +     * 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; + * @return The faultTolerantMode. + */ + @java.lang.Override + public boolean getFaultTolerantMode() { + return faultTolerantMode_; + } + + public static final int WORKER_ADDRESSES_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList workerAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @return A list containing the workerAddresses. + */ + public com.google.protobuf.ProtocolStringList + getWorkerAddressesList() { + return workerAddresses_; + } + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @return The count of workerAddresses. + */ + public int getWorkerAddressesCount() { + return workerAddresses_.size(); + } + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the element to return. + * @return The workerAddresses at the given index. + */ + public java.lang.String getWorkerAddresses(int index) { + return workerAddresses_.get(index); + } + /** + *
    +     * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +     * of worker addresses that will register with the dispatcher. The worker
    +     * addresses should be in the format "host" or "host:port", where "port" is an
    +     * integer, named port, or %port% to match any port.
    +     * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the value to return. + * @return The bytes of the workerAddresses at the given index. + */ + public com.google.protobuf.ByteString + getWorkerAddressesBytes(int index) { + return workerAddresses_.getByteString(index); + } + + public static final int DEPLOYMENT_MODE_FIELD_NUMBER = 9; + private int deploymentMode_ = 0; + /** + *
    +     * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +     * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +     * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The enum numeric value on the wire for deploymentMode. + */ + @java.lang.Override public int getDeploymentModeValue() { + return deploymentMode_; + } + /** + *
    +     * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +     * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +     * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The deploymentMode. + */ + @java.lang.Override public org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode() { + org.tensorflow.proto.data.DataService.DeploymentMode result = org.tensorflow.proto.data.DataService.DeploymentMode.forNumber(deploymentMode_); + return result == null ? org.tensorflow.proto.data.DataService.DeploymentMode.UNRECOGNIZED : result; + } + + public static final int JOB_GC_CHECK_INTERVAL_MS_FIELD_NUMBER = 5; + private long jobGcCheckIntervalMs_ = 0L; + /** + *
    +     * How often the dispatcher should scan through to delete old and unused
    +     * jobs. A value of 0 indicates that the decision should be left up to the
    +     * runtime.
    +     * 
    + * + * int64 job_gc_check_interval_ms = 5; + * @return The jobGcCheckIntervalMs. + */ + @java.lang.Override + public long getJobGcCheckIntervalMs() { + return jobGcCheckIntervalMs_; + } + + public static final int JOB_GC_TIMEOUT_MS_FIELD_NUMBER = 6; + private long jobGcTimeoutMs_ = 0L; + /** + *
    +     * How long a job needs to be unused before it becomes a candidate for garbage
    +     * collection. A value of -1 indicates that jobs should never be garbage
    +     * collected. A value of 0 indicates that the decision should be left up to
    +     * the runtime. Note: This does not apply to dynamic sharding unless users
    +     * explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
    +     * 
    + * + * int64 job_gc_timeout_ms = 6; + * @return The jobGcTimeoutMs. + */ + @java.lang.Override + public long getJobGcTimeoutMs() { + return jobGcTimeoutMs_; + } + + public static final int GC_DYNAMIC_SHARDING_JOBS_FIELD_NUMBER = 11; + private boolean gcDynamicShardingJobs_ = false; + /** + *
    +     * Whether dynamically sharded jobs should be eligible for garbage collection.
    +     * These jobs are not garbage collected by default, since if a job is garbage
    +     * collected and then re-created, it will revisit all data from the start. If
    +     * revisiting data is acceptible and you want automatic reclamation of
    +     * iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
    +     * 
    + * + * bool gc_dynamic_sharding_jobs = 11; + * @return The gcDynamicShardingJobs. + */ + @java.lang.Override + public boolean getGcDynamicShardingJobs() { + return gcDynamicShardingJobs_; + } + + public static final int CLIENT_TIMEOUT_MS_FIELD_NUMBER = 8; + private long clientTimeoutMs_ = 0L; + /** + *
    +     * How long to wait before garbage-collecting a client that hasn't
    +     * heartbeated to the dispatcher. A value of 0 indicates that the timeout
    +     * should be left to the runtime.
    +     * 
    + * + * int64 client_timeout_ms = 8; + * @return The clientTimeoutMs. + */ + @java.lang.Override + public long getClientTimeoutMs() { + return clientTimeoutMs_; + } + + public static final int WORKER_TIMEOUT_MS_FIELD_NUMBER = 10; + private long workerTimeoutMs_ = 0L; + /** + *
    +     * How long to wait for a worker to heartbeat before considering it missing.
    +     * A value of 0 indicates that the timeout should be left to the runtime.
    +     * 
    + * + * int64 worker_timeout_ms = 10; + * @return The workerTimeoutMs. + */ + @java.lang.Override + public long getWorkerTimeoutMs() { + return workerTimeoutMs_; + } + + public static final int WORKER_MAX_CONCURRENT_SNAPSHOTS_FIELD_NUMBER = 12; + private long workerMaxConcurrentSnapshots_ = 0L; + /** + *
    +     * The maximum number of snapshots that a worker can concurrently process at a
    +     * given point in time. This is a tradeoff between worker resource usage and
    +     * snapshot wall time. A value of 0 indicates that the decision should be left
    +     * up to the runtime.
    +     * 
    + * + * int64 worker_max_concurrent_snapshots = 12; + * @return The workerMaxConcurrentSnapshots. + */ + @java.lang.Override + public long getWorkerMaxConcurrentSnapshots() { + return workerMaxConcurrentSnapshots_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, protocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workDir_)) { + com.google.protobuf.GeneratedMessage.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_); + } + for (int i = 0; i < workerAddresses_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, workerAddresses_.getRaw(i)); + } + if (clientTimeoutMs_ != 0L) { + output.writeInt64(8, clientTimeoutMs_); + } + if (deploymentMode_ != org.tensorflow.proto.data.DataService.DeploymentMode.DEPLOYMENT_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, deploymentMode_); + } + if (workerTimeoutMs_ != 0L) { + output.writeInt64(10, workerTimeoutMs_); + } + if (gcDynamicShardingJobs_ != false) { + output.writeBool(11, gcDynamicShardingJobs_); + } + if (workerMaxConcurrentSnapshots_ != 0L) { + output.writeInt64(12, workerMaxConcurrentSnapshots_); + } + getUnknownFields().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, protocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workDir_)) { + size += com.google.protobuf.GeneratedMessage.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_); + } + { + int dataSize = 0; + for (int i = 0; i < workerAddresses_.size(); i++) { + dataSize += computeStringSizeNoTag(workerAddresses_.getRaw(i)); + } + size += dataSize; + size += 1 * getWorkerAddressesList().size(); + } + if (clientTimeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, clientTimeoutMs_); + } + if (deploymentMode_ != org.tensorflow.proto.data.DataService.DeploymentMode.DEPLOYMENT_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(9, deploymentMode_); + } + if (workerTimeoutMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, workerTimeoutMs_); + } + if (gcDynamicShardingJobs_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, gcDynamicShardingJobs_); + } + if (workerMaxConcurrentSnapshots_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, workerMaxConcurrentSnapshots_); + } + size += getUnknownFields().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 (!getWorkerAddressesList() + .equals(other.getWorkerAddressesList())) return false; + if (deploymentMode_ != other.deploymentMode_) return false; + if (getJobGcCheckIntervalMs() + != other.getJobGcCheckIntervalMs()) return false; + if (getJobGcTimeoutMs() + != other.getJobGcTimeoutMs()) return false; + if (getGcDynamicShardingJobs() + != other.getGcDynamicShardingJobs()) return false; + if (getClientTimeoutMs() + != other.getClientTimeoutMs()) return false; + if (getWorkerTimeoutMs() + != other.getWorkerTimeoutMs()) return false; + if (getWorkerMaxConcurrentSnapshots() + != other.getWorkerMaxConcurrentSnapshots()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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()); + if (getWorkerAddressesCount() > 0) { + hash = (37 * hash) + WORKER_ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getWorkerAddressesList().hashCode(); + } + hash = (37 * hash) + DEPLOYMENT_MODE_FIELD_NUMBER; + hash = (53 * hash) + deploymentMode_; + 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 = (37 * hash) + GC_DYNAMIC_SHARDING_JOBS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getGcDynamicShardingJobs()); + hash = (37 * hash) + CLIENT_TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getClientTimeoutMs()); + hash = (37 * hash) + WORKER_TIMEOUT_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWorkerTimeoutMs()); + hash = (37 * hash) + WORKER_MAX_CONCURRENT_SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWorkerMaxConcurrentSnapshots()); + hash = (29 * hash) + getUnknownFields().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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Configuration for a tf.data service DispatchServer.
    +     * Next id: 13
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.DispatcherConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + port_ = 0L; + protocol_ = ""; + workDir_ = ""; + faultTolerantMode_ = false; + workerAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + deploymentMode_ = 0; + jobGcCheckIntervalMs_ = 0L; + jobGcTimeoutMs_ = 0L; + gcDynamicShardingJobs_ = false; + clientTimeoutMs_ = 0L; + workerTimeoutMs_ = 0L; + workerMaxConcurrentSnapshots_ = 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); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.ServiceConfig.DispatcherConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.workDir_ = workDir_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.faultTolerantMode_ = faultTolerantMode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + workerAddresses_.makeImmutable(); + result.workerAddresses_ = workerAddresses_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deploymentMode_ = deploymentMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.jobGcCheckIntervalMs_ = jobGcCheckIntervalMs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.jobGcTimeoutMs_ = jobGcTimeoutMs_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.gcDynamicShardingJobs_ = gcDynamicShardingJobs_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.clientTimeoutMs_ = clientTimeoutMs_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.workerTimeoutMs_ = workerTimeoutMs_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.workerMaxConcurrentSnapshots_ = workerMaxConcurrentSnapshots_; + } + } + + @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_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getWorkDir().isEmpty()) { + workDir_ = other.workDir_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getFaultTolerantMode() != false) { + setFaultTolerantMode(other.getFaultTolerantMode()); + } + if (!other.workerAddresses_.isEmpty()) { + if (workerAddresses_.isEmpty()) { + workerAddresses_ = other.workerAddresses_; + bitField0_ |= 0x00000010; + } else { + ensureWorkerAddressesIsMutable(); + workerAddresses_.addAll(other.workerAddresses_); + } + onChanged(); + } + if (other.deploymentMode_ != 0) { + setDeploymentModeValue(other.getDeploymentModeValue()); + } + if (other.getJobGcCheckIntervalMs() != 0L) { + setJobGcCheckIntervalMs(other.getJobGcCheckIntervalMs()); + } + if (other.getJobGcTimeoutMs() != 0L) { + setJobGcTimeoutMs(other.getJobGcTimeoutMs()); + } + if (other.getGcDynamicShardingJobs() != false) { + setGcDynamicShardingJobs(other.getGcDynamicShardingJobs()); + } + if (other.getClientTimeoutMs() != 0L) { + setClientTimeoutMs(other.getClientTimeoutMs()); + } + if (other.getWorkerTimeoutMs() != 0L) { + setWorkerTimeoutMs(other.getWorkerTimeoutMs()); + } + if (other.getWorkerMaxConcurrentSnapshots() != 0L) { + setWorkerMaxConcurrentSnapshots(other.getWorkerMaxConcurrentSnapshots()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + port_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + protocol_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + workDir_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + faultTolerantMode_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + jobGcCheckIntervalMs_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 40 + case 48: { + jobGcTimeoutMs_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 48 + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + ensureWorkerAddressesIsMutable(); + workerAddresses_.add(s); + break; + } // case 58 + case 64: { + clientTimeoutMs_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 64 + case 72: { + deploymentMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 72 + case 80: { + workerTimeoutMs_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 80 + case 88: { + gcDynamicShardingJobs_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 88 + case 96: { + workerMaxConcurrentSnapshots_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + 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; + * @return The port. + */ + @java.lang.Override + 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; + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(long value) { + + port_ = value; + bitField0_ |= 0x00000001; + 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; + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000001); + port_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object protocol_ = ""; + /** + *
    +       * The protocol for the dispatcher to use when connecting to workers.
    +       * 
    + * + * string protocol = 2; + * @return The protocol. + */ + 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; + * @return The bytes for protocol. + */ + 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; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + protocol_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The protocol for the dispatcher to use when connecting to workers.
    +       * 
    + * + * string protocol = 2; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * The protocol for the dispatcher to use when connecting to workers.
    +       * 
    + * + * string protocol = 2; + * @param value The bytes for protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + protocol_ = value; + bitField0_ |= 0x00000002; + 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; + * @return The workDir. + */ + 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; + * @return The bytes for workDir. + */ + 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; + * @param value The workDir to set. + * @return This builder for chaining. + */ + public Builder setWorkDir( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + workDir_ = value; + bitField0_ |= 0x00000004; + 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; + * @return This builder for chaining. + */ + public Builder clearWorkDir() { + workDir_ = getDefaultInstance().getWorkDir(); + bitField0_ = (bitField0_ & ~0x00000004); + 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; + * @param value The bytes for workDir to set. + * @return This builder for chaining. + */ + public Builder setWorkDirBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + workDir_ = value; + bitField0_ |= 0x00000004; + 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; + * @return The faultTolerantMode. + */ + @java.lang.Override + 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; + * @param value The faultTolerantMode to set. + * @return This builder for chaining. + */ + public Builder setFaultTolerantMode(boolean value) { + + faultTolerantMode_ = value; + bitField0_ |= 0x00000008; + 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; + * @return This builder for chaining. + */ + public Builder clearFaultTolerantMode() { + bitField0_ = (bitField0_ & ~0x00000008); + faultTolerantMode_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList workerAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureWorkerAddressesIsMutable() { + if (!workerAddresses_.isModifiable()) { + workerAddresses_ = new com.google.protobuf.LazyStringArrayList(workerAddresses_); + } + bitField0_ |= 0x00000010; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @return A list containing the workerAddresses. + */ + public com.google.protobuf.ProtocolStringList + getWorkerAddressesList() { + workerAddresses_.makeImmutable(); + return workerAddresses_; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @return The count of workerAddresses. + */ + public int getWorkerAddressesCount() { + return workerAddresses_.size(); + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the element to return. + * @return The workerAddresses at the given index. + */ + public java.lang.String getWorkerAddresses(int index) { + return workerAddresses_.get(index); + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param index The index of the value to return. + * @return The bytes of the workerAddresses at the given index. + */ + public com.google.protobuf.ByteString + getWorkerAddressesBytes(int index) { + return workerAddresses_.getByteString(index); + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param index The index to set the value at. + * @param value The workerAddresses to set. + * @return This builder for chaining. + */ + public Builder setWorkerAddresses( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWorkerAddressesIsMutable(); + workerAddresses_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param value The workerAddresses to add. + * @return This builder for chaining. + */ + public Builder addWorkerAddresses( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWorkerAddressesIsMutable(); + workerAddresses_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param values The workerAddresses to add. + * @return This builder for chaining. + */ + public Builder addAllWorkerAddresses( + java.lang.Iterable values) { + ensureWorkerAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, workerAddresses_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @return This builder for chaining. + */ + public Builder clearWorkerAddresses() { + workerAddresses_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; + } + /** + *
    +       * (Optional.) If the job uses auto-sharding, it needs to specify a fixed list
    +       * of worker addresses that will register with the dispatcher. The worker
    +       * addresses should be in the format "host" or "host:port", where "port" is an
    +       * integer, named port, or %port% to match any port.
    +       * 
    + * + * repeated string worker_addresses = 7; + * @param value The bytes of the workerAddresses to add. + * @return This builder for chaining. + */ + public Builder addWorkerAddressesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureWorkerAddressesIsMutable(); + workerAddresses_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int deploymentMode_ = 0; + /** + *
    +       * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +       * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +       * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The enum numeric value on the wire for deploymentMode. + */ + @java.lang.Override public int getDeploymentModeValue() { + return deploymentMode_; + } + /** + *
    +       * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +       * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +       * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @param value The enum numeric value on the wire for deploymentMode to set. + * @return This builder for chaining. + */ + public Builder setDeploymentModeValue(int value) { + deploymentMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +       * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +       * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return The deploymentMode. + */ + @java.lang.Override + public org.tensorflow.proto.data.DataService.DeploymentMode getDeploymentMode() { + org.tensorflow.proto.data.DataService.DeploymentMode result = org.tensorflow.proto.data.DataService.DeploymentMode.forNumber(deploymentMode_); + return result == null ? org.tensorflow.proto.data.DataService.DeploymentMode.UNRECOGNIZED : result; + } + /** + *
    +       * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +       * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +       * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @param value The deploymentMode to set. + * @return This builder for chaining. + */ + public Builder setDeploymentMode(org.tensorflow.proto.data.DataService.DeploymentMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + deploymentMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +       * (Optional.) tf.data service deployment mode. Supported values are "REMOTE",
    +       * "COLOCATED", and "HYBRID". If unspecified, it is assumed to be "REMOTE".
    +       * 
    + * + * .tensorflow.data.DeploymentMode deployment_mode = 9; + * @return This builder for chaining. + */ + public Builder clearDeploymentMode() { + bitField0_ = (bitField0_ & ~0x00000020); + deploymentMode_ = 0; + onChanged(); + return this; + } + + private long jobGcCheckIntervalMs_ ; + /** + *
    +       * How often the dispatcher should scan through to delete old and unused
    +       * jobs. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 job_gc_check_interval_ms = 5; + * @return The jobGcCheckIntervalMs. + */ + @java.lang.Override + public long getJobGcCheckIntervalMs() { + return jobGcCheckIntervalMs_; + } + /** + *
    +       * How often the dispatcher should scan through to delete old and unused
    +       * jobs. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 job_gc_check_interval_ms = 5; + * @param value The jobGcCheckIntervalMs to set. + * @return This builder for chaining. + */ + public Builder setJobGcCheckIntervalMs(long value) { + + jobGcCheckIntervalMs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * How often the dispatcher should scan through to delete old and unused
    +       * jobs. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 job_gc_check_interval_ms = 5; + * @return This builder for chaining. + */ + public Builder clearJobGcCheckIntervalMs() { + bitField0_ = (bitField0_ & ~0x00000040); + jobGcCheckIntervalMs_ = 0L; + onChanged(); + return this; + } + + private long jobGcTimeoutMs_ ; + /** + *
    +       * How long a job needs to be unused before it becomes a candidate for garbage
    +       * collection. A value of -1 indicates that jobs should never be garbage
    +       * collected. A value of 0 indicates that the decision should be left up to
    +       * the runtime. Note: This does not apply to dynamic sharding unless users
    +       * explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
    +       * 
    + * + * int64 job_gc_timeout_ms = 6; + * @return The jobGcTimeoutMs. + */ + @java.lang.Override + public long getJobGcTimeoutMs() { + return jobGcTimeoutMs_; + } + /** + *
    +       * How long a job needs to be unused before it becomes a candidate for garbage
    +       * collection. A value of -1 indicates that jobs should never be garbage
    +       * collected. A value of 0 indicates that the decision should be left up to
    +       * the runtime. Note: This does not apply to dynamic sharding unless users
    +       * explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
    +       * 
    + * + * int64 job_gc_timeout_ms = 6; + * @param value The jobGcTimeoutMs to set. + * @return This builder for chaining. + */ + public Builder setJobGcTimeoutMs(long value) { + + jobGcTimeoutMs_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * How long a job needs to be unused before it becomes a candidate for garbage
    +       * collection. A value of -1 indicates that jobs should never be garbage
    +       * collected. A value of 0 indicates that the decision should be left up to
    +       * the runtime. Note: This does not apply to dynamic sharding unless users
    +       * explicitly opt-in by enabling `gc_dynamic_sharding_jobs` below.
    +       * 
    + * + * int64 job_gc_timeout_ms = 6; + * @return This builder for chaining. + */ + public Builder clearJobGcTimeoutMs() { + bitField0_ = (bitField0_ & ~0x00000080); + jobGcTimeoutMs_ = 0L; + onChanged(); + return this; + } + + private boolean gcDynamicShardingJobs_ ; + /** + *
    +       * Whether dynamically sharded jobs should be eligible for garbage collection.
    +       * These jobs are not garbage collected by default, since if a job is garbage
    +       * collected and then re-created, it will revisit all data from the start. If
    +       * revisiting data is acceptible and you want automatic reclamation of
    +       * iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
    +       * 
    + * + * bool gc_dynamic_sharding_jobs = 11; + * @return The gcDynamicShardingJobs. + */ + @java.lang.Override + public boolean getGcDynamicShardingJobs() { + return gcDynamicShardingJobs_; + } + /** + *
    +       * Whether dynamically sharded jobs should be eligible for garbage collection.
    +       * These jobs are not garbage collected by default, since if a job is garbage
    +       * collected and then re-created, it will revisit all data from the start. If
    +       * revisiting data is acceptible and you want automatic reclamation of
    +       * iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
    +       * 
    + * + * bool gc_dynamic_sharding_jobs = 11; + * @param value The gcDynamicShardingJobs to set. + * @return This builder for chaining. + */ + public Builder setGcDynamicShardingJobs(boolean value) { + + gcDynamicShardingJobs_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * Whether dynamically sharded jobs should be eligible for garbage collection.
    +       * These jobs are not garbage collected by default, since if a job is garbage
    +       * collected and then re-created, it will revisit all data from the start. If
    +       * revisiting data is acceptible and you want automatic reclamation of
    +       * iterator memory, set `gc_dynamic_sharding_jobs` to `true`.
    +       * 
    + * + * bool gc_dynamic_sharding_jobs = 11; + * @return This builder for chaining. + */ + public Builder clearGcDynamicShardingJobs() { + bitField0_ = (bitField0_ & ~0x00000100); + gcDynamicShardingJobs_ = false; + onChanged(); + return this; + } + + private long clientTimeoutMs_ ; + /** + *
    +       * How long to wait before garbage-collecting a client that hasn't
    +       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
    +       * should be left to the runtime.
    +       * 
    + * + * int64 client_timeout_ms = 8; + * @return The clientTimeoutMs. + */ + @java.lang.Override + public long getClientTimeoutMs() { + return clientTimeoutMs_; + } + /** + *
    +       * How long to wait before garbage-collecting a client that hasn't
    +       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
    +       * should be left to the runtime.
    +       * 
    + * + * int64 client_timeout_ms = 8; + * @param value The clientTimeoutMs to set. + * @return This builder for chaining. + */ + public Builder setClientTimeoutMs(long value) { + + clientTimeoutMs_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * How long to wait before garbage-collecting a client that hasn't
    +       * heartbeated to the dispatcher. A value of 0 indicates that the timeout
    +       * should be left to the runtime.
    +       * 
    + * + * int64 client_timeout_ms = 8; + * @return This builder for chaining. + */ + public Builder clearClientTimeoutMs() { + bitField0_ = (bitField0_ & ~0x00000200); + clientTimeoutMs_ = 0L; + onChanged(); + return this; + } + + private long workerTimeoutMs_ ; + /** + *
    +       * How long to wait for a worker to heartbeat before considering it missing.
    +       * A value of 0 indicates that the timeout should be left to the runtime.
    +       * 
    + * + * int64 worker_timeout_ms = 10; + * @return The workerTimeoutMs. + */ + @java.lang.Override + public long getWorkerTimeoutMs() { + return workerTimeoutMs_; + } + /** + *
    +       * How long to wait for a worker to heartbeat before considering it missing.
    +       * A value of 0 indicates that the timeout should be left to the runtime.
    +       * 
    + * + * int64 worker_timeout_ms = 10; + * @param value The workerTimeoutMs to set. + * @return This builder for chaining. + */ + public Builder setWorkerTimeoutMs(long value) { + + workerTimeoutMs_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * How long to wait for a worker to heartbeat before considering it missing.
    +       * A value of 0 indicates that the timeout should be left to the runtime.
    +       * 
    + * + * int64 worker_timeout_ms = 10; + * @return This builder for chaining. + */ + public Builder clearWorkerTimeoutMs() { + bitField0_ = (bitField0_ & ~0x00000400); + workerTimeoutMs_ = 0L; + onChanged(); + return this; + } + + private long workerMaxConcurrentSnapshots_ ; + /** + *
    +       * The maximum number of snapshots that a worker can concurrently process at a
    +       * given point in time. This is a tradeoff between worker resource usage and
    +       * snapshot wall time. A value of 0 indicates that the decision should be left
    +       * up to the runtime.
    +       * 
    + * + * int64 worker_max_concurrent_snapshots = 12; + * @return The workerMaxConcurrentSnapshots. + */ + @java.lang.Override + public long getWorkerMaxConcurrentSnapshots() { + return workerMaxConcurrentSnapshots_; + } + /** + *
    +       * The maximum number of snapshots that a worker can concurrently process at a
    +       * given point in time. This is a tradeoff between worker resource usage and
    +       * snapshot wall time. A value of 0 indicates that the decision should be left
    +       * up to the runtime.
    +       * 
    + * + * int64 worker_max_concurrent_snapshots = 12; + * @param value The workerMaxConcurrentSnapshots to set. + * @return This builder for chaining. + */ + public Builder setWorkerMaxConcurrentSnapshots(long value) { + + workerMaxConcurrentSnapshots_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * The maximum number of snapshots that a worker can concurrently process at a
    +       * given point in time. This is a tradeoff between worker resource usage and
    +       * snapshot wall time. A value of 0 indicates that the decision should be left
    +       * up to the runtime.
    +       * 
    + * + * int64 worker_max_concurrent_snapshots = 12; + * @return This builder for chaining. + */ + public Builder clearWorkerMaxConcurrentSnapshots() { + bitField0_ = (bitField0_ & ~0x00000800); + workerMaxConcurrentSnapshots_ = 0L; + onChanged(); + return this; + } + + // @@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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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; + * @return The port. + */ + long getPort(); + + /** + *
    +     * The protocol for the worker to use when connecting to the dispatcher.
    +     * 
    + * + * string protocol = 2; + * @return The protocol. + */ + java.lang.String getProtocol(); + /** + *
    +     * The protocol for the worker to use when connecting to the dispatcher.
    +     * 
    + * + * string protocol = 2; + * @return The bytes for protocol. + */ + com.google.protobuf.ByteString + getProtocolBytes(); + + /** + *
    +     * The address of the dispatcher to register with.
    +     * 
    + * + * string dispatcher_address = 3; + * @return The dispatcherAddress. + */ + java.lang.String getDispatcherAddress(); + /** + *
    +     * The address of the dispatcher to register with.
    +     * 
    + * + * string dispatcher_address = 3; + * @return The bytes for dispatcherAddress. + */ + 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; + * @return The workerAddress. + */ + 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; + * @return The bytes for workerAddress. + */ + com.google.protobuf.ByteString + getWorkerAddressBytes(); + + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @return A list containing the workerTags. + */ + java.util.List + getWorkerTagsList(); + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @return The count of workerTags. + */ + int getWorkerTagsCount(); + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the element to return. + * @return The workerTags at the given index. + */ + java.lang.String getWorkerTags(int index); + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the value to return. + * @return The bytes of the workerTags at the given index. + */ + com.google.protobuf.ByteString + getWorkerTagsBytes(int index); + + /** + *
    +     * How often the worker should heartbeat to the master. A value of 0 indicates
    +     * that the decision should be left up to the runtime.
    +     * 
    + * + * int64 heartbeat_interval_ms = 5; + * @return The heartbeatIntervalMs. + */ + long getHeartbeatIntervalMs(); + + /** + *
    +     * How long to retry requests to the dispatcher before giving up and reporting
    +     * an error. A value of 0 indicates that the decision should be left up to the
    +     * runtime.
    +     * 
    + * + * int64 dispatcher_timeout_ms = 6; + * @return The dispatcherTimeoutMs. + */ + long getDispatcherTimeoutMs(); + + /** + *
    +     * If set, the name of an alternative data transfer protocol for which the
    +     * worker starts an additional server ("data transfer server"); the trainer
    +     * can then get data from this server. If not set, no such server is started,
    +     * and the trainer can only get data from the regular worker server over
    +     * `protocol`.
    +     * 
    + * + * string data_transfer_protocol = 7; + * @return The dataTransferProtocol. + */ + java.lang.String getDataTransferProtocol(); + /** + *
    +     * If set, the name of an alternative data transfer protocol for which the
    +     * worker starts an additional server ("data transfer server"); the trainer
    +     * can then get data from this server. If not set, no such server is started,
    +     * and the trainer can only get data from the regular worker server over
    +     * `protocol`.
    +     * 
    + * + * string data_transfer_protocol = 7; + * @return The bytes for dataTransferProtocol. + */ + com.google.protobuf.ByteString + getDataTransferProtocolBytes(); + + /** + *
    +     * If `data_transfer_protocol` is set, the port to which the data transfer
    +     * server binds. If set to `0`, the server binds to any available port.
    +     * 
    + * + * int64 data_transfer_port = 13; + * @return The dataTransferPort. + */ + long getDataTransferPort(); + + /** + *
    +     * If `data_transfer_protocol` is set, the address of the data transfer
    +     * server. The substring "%dts_port%" can be used to represent -- and is
    +     * replaced with -- the bound port of the data transfer server; this is useful
    +     * when `data_transfer_port` is set to `0`.
    +     * 
    + * + * string data_transfer_address = 8; + * @return The dataTransferAddress. + */ + java.lang.String getDataTransferAddress(); + /** + *
    +     * If `data_transfer_protocol` is set, the address of the data transfer
    +     * server. The substring "%dts_port%" can be used to represent -- and is
    +     * replaced with -- the bound port of the data transfer server; this is useful
    +     * when `data_transfer_port` is set to `0`.
    +     * 
    + * + * string data_transfer_address = 8; + * @return The bytes for dataTransferAddress. + */ + com.google.protobuf.ByteString + getDataTransferAddressBytes(); + + /** + *
    +     * Maximum size of the cross-trainer cache in bytes. If enabled, make sure
    +     * your training job provides sufficient memory resources.
    +     * 
    + * + * int64 cross_trainer_cache_size_bytes = 11; + * @return The crossTrainerCacheSizeBytes. + */ + long getCrossTrainerCacheSizeBytes(); + + /** + *
    +     * The maximum size of a distributed snapshot chunk file. A value of 0
    +     * indicates that the decision should be left up to the runtime.
    +     * 
    + * + * int64 snapshot_max_chunk_size_bytes = 12; + * @return The snapshotMaxChunkSizeBytes. + */ + long getSnapshotMaxChunkSizeBytes(); + + /** + *
    +     * When shutting down a worker, how long to wait for the gRPC server to
    +     * process the final requests. This is used to achieve clean shutdown in unit
    +     * tests.
    +     * 
    + * + * int64 shutdown_quiet_period_ms = 9; + * @return The shutdownQuietPeriodMs. + */ + long getShutdownQuietPeriodMs(); + } + /** + *
    +   * Configuration for a tf.data service WorkerServer.
    +   * Next id: 14
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} + */ + public static final class WorkerConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.WorkerConfig) + WorkerConfigOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + WorkerConfig.class.getName()); + } + // Use WorkerConfig.newBuilder() to construct. + private WorkerConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WorkerConfig() { + protocol_ = ""; + dispatcherAddress_ = ""; + workerAddress_ = ""; + workerTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + dataTransferProtocol_ = ""; + dataTransferAddress_ = ""; + } + + 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.GeneratedMessage.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_ = 0L; + /** + *
    +     * 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; + * @return The port. + */ + @java.lang.Override + public long getPort() { + return port_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** + *
    +     * The protocol for the worker to use when connecting to the dispatcher.
    +     * 
    + * + * string protocol = 2; + * @return The protocol. + */ + @java.lang.Override + 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; + * @return The bytes for protocol. + */ + @java.lang.Override + 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; + @SuppressWarnings("serial") + private volatile java.lang.Object dispatcherAddress_ = ""; + /** + *
    +     * The address of the dispatcher to register with.
    +     * 
    + * + * string dispatcher_address = 3; + * @return The dispatcherAddress. + */ + @java.lang.Override + 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; + * @return The bytes for dispatcherAddress. + */ + @java.lang.Override + 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; + @SuppressWarnings("serial") + 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; + * @return The workerAddress. + */ + @java.lang.Override + 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; + * @return The bytes for workerAddress. + */ + @java.lang.Override + 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 WORKER_TAGS_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList workerTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @return A list containing the workerTags. + */ + public com.google.protobuf.ProtocolStringList + getWorkerTagsList() { + return workerTags_; + } + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @return The count of workerTags. + */ + public int getWorkerTagsCount() { + return workerTags_.size(); + } + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the element to return. + * @return The workerTags at the given index. + */ + public java.lang.String getWorkerTags(int index) { + return workerTags_.get(index); + } + /** + *
    +     * Tags attached to the worker. This allows reading from selected workers.
    +     * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +     * from the local tf.data worker if one exists, then from off-TF-host workers,
    +     * to avoid cross-TF-host reads.
    +     * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the value to return. + * @return The bytes of the workerTags at the given index. + */ + public com.google.protobuf.ByteString + getWorkerTagsBytes(int index) { + return workerTags_.getByteString(index); + } + + public static final int HEARTBEAT_INTERVAL_MS_FIELD_NUMBER = 5; + private long heartbeatIntervalMs_ = 0L; + /** + *
    +     * How often the worker should heartbeat to the master. A value of 0 indicates
    +     * that the decision should be left up to the runtime.
    +     * 
    + * + * int64 heartbeat_interval_ms = 5; + * @return The heartbeatIntervalMs. + */ + @java.lang.Override + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + + public static final int DISPATCHER_TIMEOUT_MS_FIELD_NUMBER = 6; + private long dispatcherTimeoutMs_ = 0L; + /** + *
    +     * How long to retry requests to the dispatcher before giving up and reporting
    +     * an error. A value of 0 indicates that the decision should be left up to the
    +     * runtime.
    +     * 
    + * + * int64 dispatcher_timeout_ms = 6; + * @return The dispatcherTimeoutMs. + */ + @java.lang.Override + public long getDispatcherTimeoutMs() { + return dispatcherTimeoutMs_; + } + + public static final int DATA_TRANSFER_PROTOCOL_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object dataTransferProtocol_ = ""; + /** + *
    +     * If set, the name of an alternative data transfer protocol for which the
    +     * worker starts an additional server ("data transfer server"); the trainer
    +     * can then get data from this server. If not set, no such server is started,
    +     * and the trainer can only get data from the regular worker server over
    +     * `protocol`.
    +     * 
    + * + * string data_transfer_protocol = 7; + * @return The dataTransferProtocol. + */ + @java.lang.Override + public java.lang.String getDataTransferProtocol() { + java.lang.Object ref = dataTransferProtocol_; + 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(); + dataTransferProtocol_ = s; + return s; + } + } + /** + *
    +     * If set, the name of an alternative data transfer protocol for which the
    +     * worker starts an additional server ("data transfer server"); the trainer
    +     * can then get data from this server. If not set, no such server is started,
    +     * and the trainer can only get data from the regular worker server over
    +     * `protocol`.
    +     * 
    + * + * string data_transfer_protocol = 7; + * @return The bytes for dataTransferProtocol. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDataTransferProtocolBytes() { + java.lang.Object ref = dataTransferProtocol_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataTransferProtocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_TRANSFER_PORT_FIELD_NUMBER = 13; + private long dataTransferPort_ = 0L; + /** + *
    +     * If `data_transfer_protocol` is set, the port to which the data transfer
    +     * server binds. If set to `0`, the server binds to any available port.
    +     * 
    + * + * int64 data_transfer_port = 13; + * @return The dataTransferPort. + */ + @java.lang.Override + public long getDataTransferPort() { + return dataTransferPort_; + } + + public static final int DATA_TRANSFER_ADDRESS_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private volatile java.lang.Object dataTransferAddress_ = ""; + /** + *
    +     * If `data_transfer_protocol` is set, the address of the data transfer
    +     * server. The substring "%dts_port%" can be used to represent -- and is
    +     * replaced with -- the bound port of the data transfer server; this is useful
    +     * when `data_transfer_port` is set to `0`.
    +     * 
    + * + * string data_transfer_address = 8; + * @return The dataTransferAddress. + */ + @java.lang.Override + public java.lang.String getDataTransferAddress() { + java.lang.Object ref = dataTransferAddress_; + 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(); + dataTransferAddress_ = s; + return s; + } + } + /** + *
    +     * If `data_transfer_protocol` is set, the address of the data transfer
    +     * server. The substring "%dts_port%" can be used to represent -- and is
    +     * replaced with -- the bound port of the data transfer server; this is useful
    +     * when `data_transfer_port` is set to `0`.
    +     * 
    + * + * string data_transfer_address = 8; + * @return The bytes for dataTransferAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDataTransferAddressBytes() { + java.lang.Object ref = dataTransferAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataTransferAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CROSS_TRAINER_CACHE_SIZE_BYTES_FIELD_NUMBER = 11; + private long crossTrainerCacheSizeBytes_ = 0L; + /** + *
    +     * Maximum size of the cross-trainer cache in bytes. If enabled, make sure
    +     * your training job provides sufficient memory resources.
    +     * 
    + * + * int64 cross_trainer_cache_size_bytes = 11; + * @return The crossTrainerCacheSizeBytes. + */ + @java.lang.Override + public long getCrossTrainerCacheSizeBytes() { + return crossTrainerCacheSizeBytes_; + } + + public static final int SNAPSHOT_MAX_CHUNK_SIZE_BYTES_FIELD_NUMBER = 12; + private long snapshotMaxChunkSizeBytes_ = 0L; + /** + *
    +     * The maximum size of a distributed snapshot chunk file. A value of 0
    +     * indicates that the decision should be left up to the runtime.
    +     * 
    + * + * int64 snapshot_max_chunk_size_bytes = 12; + * @return The snapshotMaxChunkSizeBytes. + */ + @java.lang.Override + public long getSnapshotMaxChunkSizeBytes() { + return snapshotMaxChunkSizeBytes_; + } + + public static final int SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER = 9; + private long shutdownQuietPeriodMs_ = 0L; + /** + *
    +     * When shutting down a worker, how long to wait for the gRPC server to
    +     * process the final requests. This is used to achieve clean shutdown in unit
    +     * tests.
    +     * 
    + * + * int64 shutdown_quiet_period_ms = 9; + * @return The shutdownQuietPeriodMs. + */ + @java.lang.Override + public long getShutdownQuietPeriodMs() { + return shutdownQuietPeriodMs_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, protocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dispatcherAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, dispatcherAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workerAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, workerAddress_); + } + if (heartbeatIntervalMs_ != 0L) { + output.writeInt64(5, heartbeatIntervalMs_); + } + if (dispatcherTimeoutMs_ != 0L) { + output.writeInt64(6, dispatcherTimeoutMs_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataTransferProtocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, dataTransferProtocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataTransferAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, dataTransferAddress_); + } + if (shutdownQuietPeriodMs_ != 0L) { + output.writeInt64(9, shutdownQuietPeriodMs_); + } + for (int i = 0; i < workerTags_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, workerTags_.getRaw(i)); + } + if (crossTrainerCacheSizeBytes_ != 0L) { + output.writeInt64(11, crossTrainerCacheSizeBytes_); + } + if (snapshotMaxChunkSizeBytes_ != 0L) { + output.writeInt64(12, snapshotMaxChunkSizeBytes_); + } + if (dataTransferPort_ != 0L) { + output.writeInt64(13, dataTransferPort_); + } + getUnknownFields().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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, protocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dispatcherAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, dispatcherAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workerAddress_)) { + size += com.google.protobuf.GeneratedMessage.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_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataTransferProtocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, dataTransferProtocol_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(dataTransferAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, dataTransferAddress_); + } + if (shutdownQuietPeriodMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, shutdownQuietPeriodMs_); + } + { + int dataSize = 0; + for (int i = 0; i < workerTags_.size(); i++) { + dataSize += computeStringSizeNoTag(workerTags_.getRaw(i)); + } + size += dataSize; + size += 1 * getWorkerTagsList().size(); + } + if (crossTrainerCacheSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, crossTrainerCacheSizeBytes_); + } + if (snapshotMaxChunkSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, snapshotMaxChunkSizeBytes_); + } + if (dataTransferPort_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(13, dataTransferPort_); + } + size += getUnknownFields().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 (!getWorkerTagsList() + .equals(other.getWorkerTagsList())) return false; + if (getHeartbeatIntervalMs() + != other.getHeartbeatIntervalMs()) return false; + if (getDispatcherTimeoutMs() + != other.getDispatcherTimeoutMs()) return false; + if (!getDataTransferProtocol() + .equals(other.getDataTransferProtocol())) return false; + if (getDataTransferPort() + != other.getDataTransferPort()) return false; + if (!getDataTransferAddress() + .equals(other.getDataTransferAddress())) return false; + if (getCrossTrainerCacheSizeBytes() + != other.getCrossTrainerCacheSizeBytes()) return false; + if (getSnapshotMaxChunkSizeBytes() + != other.getSnapshotMaxChunkSizeBytes()) return false; + if (getShutdownQuietPeriodMs() + != other.getShutdownQuietPeriodMs()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getWorkerTagsCount() > 0) { + hash = (37 * hash) + WORKER_TAGS_FIELD_NUMBER; + hash = (53 * hash) + getWorkerTagsList().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 = (37 * hash) + DATA_TRANSFER_PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getDataTransferProtocol().hashCode(); + hash = (37 * hash) + DATA_TRANSFER_PORT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDataTransferPort()); + hash = (37 * hash) + DATA_TRANSFER_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDataTransferAddress().hashCode(); + hash = (37 * hash) + CROSS_TRAINER_CACHE_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCrossTrainerCacheSizeBytes()); + hash = (37 * hash) + SNAPSHOT_MAX_CHUNK_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSnapshotMaxChunkSizeBytes()); + hash = (37 * hash) + SHUTDOWN_QUIET_PERIOD_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getShutdownQuietPeriodMs()); + hash = (29 * hash) + getUnknownFields().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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage + .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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Configuration for a tf.data service WorkerServer.
    +     * Next id: 14
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.WorkerConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + port_ = 0L; + protocol_ = ""; + dispatcherAddress_ = ""; + workerAddress_ = ""; + workerTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + heartbeatIntervalMs_ = 0L; + dispatcherTimeoutMs_ = 0L; + dataTransferProtocol_ = ""; + dataTransferPort_ = 0L; + dataTransferAddress_ = ""; + crossTrainerCacheSizeBytes_ = 0L; + snapshotMaxChunkSizeBytes_ = 0L; + shutdownQuietPeriodMs_ = 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); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.ServiceConfig.WorkerConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.dispatcherAddress_ = dispatcherAddress_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.workerAddress_ = workerAddress_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + workerTags_.makeImmutable(); + result.workerTags_ = workerTags_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.heartbeatIntervalMs_ = heartbeatIntervalMs_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.dispatcherTimeoutMs_ = dispatcherTimeoutMs_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.dataTransferProtocol_ = dataTransferProtocol_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.dataTransferPort_ = dataTransferPort_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.dataTransferAddress_ = dataTransferAddress_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.crossTrainerCacheSizeBytes_ = crossTrainerCacheSizeBytes_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.snapshotMaxChunkSizeBytes_ = snapshotMaxChunkSizeBytes_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.shutdownQuietPeriodMs_ = shutdownQuietPeriodMs_; + } + } + + @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_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDispatcherAddress().isEmpty()) { + dispatcherAddress_ = other.dispatcherAddress_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getWorkerAddress().isEmpty()) { + workerAddress_ = other.workerAddress_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.workerTags_.isEmpty()) { + if (workerTags_.isEmpty()) { + workerTags_ = other.workerTags_; + bitField0_ |= 0x00000010; + } else { + ensureWorkerTagsIsMutable(); + workerTags_.addAll(other.workerTags_); + } + onChanged(); + } + if (other.getHeartbeatIntervalMs() != 0L) { + setHeartbeatIntervalMs(other.getHeartbeatIntervalMs()); + } + if (other.getDispatcherTimeoutMs() != 0L) { + setDispatcherTimeoutMs(other.getDispatcherTimeoutMs()); + } + if (!other.getDataTransferProtocol().isEmpty()) { + dataTransferProtocol_ = other.dataTransferProtocol_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getDataTransferPort() != 0L) { + setDataTransferPort(other.getDataTransferPort()); + } + if (!other.getDataTransferAddress().isEmpty()) { + dataTransferAddress_ = other.dataTransferAddress_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.getCrossTrainerCacheSizeBytes() != 0L) { + setCrossTrainerCacheSizeBytes(other.getCrossTrainerCacheSizeBytes()); + } + if (other.getSnapshotMaxChunkSizeBytes() != 0L) { + setSnapshotMaxChunkSizeBytes(other.getSnapshotMaxChunkSizeBytes()); + } + if (other.getShutdownQuietPeriodMs() != 0L) { + setShutdownQuietPeriodMs(other.getShutdownQuietPeriodMs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + port_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + protocol_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + dispatcherAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + workerAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + heartbeatIntervalMs_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 48: { + dispatcherTimeoutMs_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 58: { + dataTransferProtocol_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: { + dataTransferAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 66 + case 72: { + shutdownQuietPeriodMs_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 72 + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + ensureWorkerTagsIsMutable(); + workerTags_.add(s); + break; + } // case 82 + case 88: { + crossTrainerCacheSizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + snapshotMaxChunkSizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + dataTransferPort_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 104 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + 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; + * @return The port. + */ + @java.lang.Override + 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; + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(long value) { + + port_ = value; + bitField0_ |= 0x00000001; + 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; + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000001); + 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; + * @return The protocol. + */ + 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; + * @return The bytes for protocol. + */ + 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; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + protocol_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * The protocol for the worker to use when connecting to the dispatcher.
    +       * 
    + * + * string protocol = 2; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * The protocol for the worker to use when connecting to the dispatcher.
    +       * 
    + * + * string protocol = 2; + * @param value The bytes for protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + protocol_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object dispatcherAddress_ = ""; + /** + *
    +       * The address of the dispatcher to register with.
    +       * 
    + * + * string dispatcher_address = 3; + * @return The dispatcherAddress. + */ + 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; + * @return The bytes for dispatcherAddress. + */ + 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; + * @param value The dispatcherAddress to set. + * @return This builder for chaining. + */ + public Builder setDispatcherAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + dispatcherAddress_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * The address of the dispatcher to register with.
    +       * 
    + * + * string dispatcher_address = 3; + * @return This builder for chaining. + */ + public Builder clearDispatcherAddress() { + dispatcherAddress_ = getDefaultInstance().getDispatcherAddress(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * The address of the dispatcher to register with.
    +       * 
    + * + * string dispatcher_address = 3; + * @param value The bytes for dispatcherAddress to set. + * @return This builder for chaining. + */ + public Builder setDispatcherAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + dispatcherAddress_ = value; + bitField0_ |= 0x00000004; + 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; + * @return The workerAddress. + */ + 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; + * @return The bytes for workerAddress. + */ + 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; + * @param value The workerAddress to set. + * @return This builder for chaining. + */ + public Builder setWorkerAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + workerAddress_ = value; + bitField0_ |= 0x00000008; + 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; + * @return This builder for chaining. + */ + public Builder clearWorkerAddress() { + workerAddress_ = getDefaultInstance().getWorkerAddress(); + bitField0_ = (bitField0_ & ~0x00000008); + 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; + * @param value The bytes for workerAddress to set. + * @return This builder for chaining. + */ + public Builder setWorkerAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + workerAddress_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList workerTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureWorkerTagsIsMutable() { + if (!workerTags_.isModifiable()) { + workerTags_ = new com.google.protobuf.LazyStringArrayList(workerTags_); + } + bitField0_ |= 0x00000010; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @return A list containing the workerTags. + */ + public com.google.protobuf.ProtocolStringList + getWorkerTagsList() { + workerTags_.makeImmutable(); + return workerTags_; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @return The count of workerTags. + */ + public int getWorkerTagsCount() { + return workerTags_.size(); + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the element to return. + * @return The workerTags at the given index. + */ + public java.lang.String getWorkerTags(int index) { + return workerTags_.get(index); + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param index The index of the value to return. + * @return The bytes of the workerTags at the given index. + */ + public com.google.protobuf.ByteString + getWorkerTagsBytes(int index) { + return workerTags_.getByteString(index); + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param index The index to set the value at. + * @param value The workerTags to set. + * @return This builder for chaining. + */ + public Builder setWorkerTags( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWorkerTagsIsMutable(); + workerTags_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param value The workerTags to add. + * @return This builder for chaining. + */ + public Builder addWorkerTags( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWorkerTagsIsMutable(); + workerTags_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param values The workerTags to add. + * @return This builder for chaining. + */ + public Builder addAllWorkerTags( + java.lang.Iterable values) { + ensureWorkerTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, workerTags_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @return This builder for chaining. + */ + public Builder clearWorkerTags() { + workerTags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; + } + /** + *
    +       * Tags attached to the worker. This allows reading from selected workers.
    +       * For example, by applying a "COLOCATED" tag, tf.data service is able to read
    +       * from the local tf.data worker if one exists, then from off-TF-host workers,
    +       * to avoid cross-TF-host reads.
    +       * 
    + * + * repeated string worker_tags = 10; + * @param value The bytes of the workerTags to add. + * @return This builder for chaining. + */ + public Builder addWorkerTagsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureWorkerTagsIsMutable(); + workerTags_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private long heartbeatIntervalMs_ ; + /** + *
    +       * How often the worker should heartbeat to the master. A value of 0 indicates
    +       * that the decision should be left up to the runtime.
    +       * 
    + * + * int64 heartbeat_interval_ms = 5; + * @return The heartbeatIntervalMs. + */ + @java.lang.Override + public long getHeartbeatIntervalMs() { + return heartbeatIntervalMs_; + } + /** + *
    +       * How often the worker should heartbeat to the master. A value of 0 indicates
    +       * that the decision should be left up to the runtime.
    +       * 
    + * + * int64 heartbeat_interval_ms = 5; + * @param value The heartbeatIntervalMs to set. + * @return This builder for chaining. + */ + public Builder setHeartbeatIntervalMs(long value) { + + heartbeatIntervalMs_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * How often the worker should heartbeat to the master. A value of 0 indicates
    +       * that the decision should be left up to the runtime.
    +       * 
    + * + * int64 heartbeat_interval_ms = 5; + * @return This builder for chaining. + */ + public Builder clearHeartbeatIntervalMs() { + bitField0_ = (bitField0_ & ~0x00000020); + heartbeatIntervalMs_ = 0L; + onChanged(); + return this; + } + + private long dispatcherTimeoutMs_ ; + /** + *
    +       * How long to retry requests to the dispatcher before giving up and reporting
    +       * an error. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 dispatcher_timeout_ms = 6; + * @return The dispatcherTimeoutMs. + */ + @java.lang.Override + public long getDispatcherTimeoutMs() { + return dispatcherTimeoutMs_; + } + /** + *
    +       * How long to retry requests to the dispatcher before giving up and reporting
    +       * an error. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 dispatcher_timeout_ms = 6; + * @param value The dispatcherTimeoutMs to set. + * @return This builder for chaining. + */ + public Builder setDispatcherTimeoutMs(long value) { + + dispatcherTimeoutMs_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +       * How long to retry requests to the dispatcher before giving up and reporting
    +       * an error. A value of 0 indicates that the decision should be left up to the
    +       * runtime.
    +       * 
    + * + * int64 dispatcher_timeout_ms = 6; + * @return This builder for chaining. + */ + public Builder clearDispatcherTimeoutMs() { + bitField0_ = (bitField0_ & ~0x00000040); + dispatcherTimeoutMs_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object dataTransferProtocol_ = ""; + /** + *
    +       * If set, the name of an alternative data transfer protocol for which the
    +       * worker starts an additional server ("data transfer server"); the trainer
    +       * can then get data from this server. If not set, no such server is started,
    +       * and the trainer can only get data from the regular worker server over
    +       * `protocol`.
    +       * 
    + * + * string data_transfer_protocol = 7; + * @return The dataTransferProtocol. + */ + public java.lang.String getDataTransferProtocol() { + java.lang.Object ref = dataTransferProtocol_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataTransferProtocol_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * If set, the name of an alternative data transfer protocol for which the
    +       * worker starts an additional server ("data transfer server"); the trainer
    +       * can then get data from this server. If not set, no such server is started,
    +       * and the trainer can only get data from the regular worker server over
    +       * `protocol`.
    +       * 
    + * + * string data_transfer_protocol = 7; + * @return The bytes for dataTransferProtocol. + */ + public com.google.protobuf.ByteString + getDataTransferProtocolBytes() { + java.lang.Object ref = dataTransferProtocol_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataTransferProtocol_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * If set, the name of an alternative data transfer protocol for which the
    +       * worker starts an additional server ("data transfer server"); the trainer
    +       * can then get data from this server. If not set, no such server is started,
    +       * and the trainer can only get data from the regular worker server over
    +       * `protocol`.
    +       * 
    + * + * string data_transfer_protocol = 7; + * @param value The dataTransferProtocol to set. + * @return This builder for chaining. + */ + public Builder setDataTransferProtocol( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + dataTransferProtocol_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +       * If set, the name of an alternative data transfer protocol for which the
    +       * worker starts an additional server ("data transfer server"); the trainer
    +       * can then get data from this server. If not set, no such server is started,
    +       * and the trainer can only get data from the regular worker server over
    +       * `protocol`.
    +       * 
    + * + * string data_transfer_protocol = 7; + * @return This builder for chaining. + */ + public Builder clearDataTransferProtocol() { + dataTransferProtocol_ = getDefaultInstance().getDataTransferProtocol(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + *
    +       * If set, the name of an alternative data transfer protocol for which the
    +       * worker starts an additional server ("data transfer server"); the trainer
    +       * can then get data from this server. If not set, no such server is started,
    +       * and the trainer can only get data from the regular worker server over
    +       * `protocol`.
    +       * 
    + * + * string data_transfer_protocol = 7; + * @param value The bytes for dataTransferProtocol to set. + * @return This builder for chaining. + */ + public Builder setDataTransferProtocolBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + dataTransferProtocol_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private long dataTransferPort_ ; + /** + *
    +       * If `data_transfer_protocol` is set, the port to which the data transfer
    +       * server binds. If set to `0`, the server binds to any available port.
    +       * 
    + * + * int64 data_transfer_port = 13; + * @return The dataTransferPort. + */ + @java.lang.Override + public long getDataTransferPort() { + return dataTransferPort_; + } + /** + *
    +       * If `data_transfer_protocol` is set, the port to which the data transfer
    +       * server binds. If set to `0`, the server binds to any available port.
    +       * 
    + * + * int64 data_transfer_port = 13; + * @param value The dataTransferPort to set. + * @return This builder for chaining. + */ + public Builder setDataTransferPort(long value) { + + dataTransferPort_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +       * If `data_transfer_protocol` is set, the port to which the data transfer
    +       * server binds. If set to `0`, the server binds to any available port.
    +       * 
    + * + * int64 data_transfer_port = 13; + * @return This builder for chaining. + */ + public Builder clearDataTransferPort() { + bitField0_ = (bitField0_ & ~0x00000100); + dataTransferPort_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object dataTransferAddress_ = ""; + /** + *
    +       * If `data_transfer_protocol` is set, the address of the data transfer
    +       * server. The substring "%dts_port%" can be used to represent -- and is
    +       * replaced with -- the bound port of the data transfer server; this is useful
    +       * when `data_transfer_port` is set to `0`.
    +       * 
    + * + * string data_transfer_address = 8; + * @return The dataTransferAddress. + */ + public java.lang.String getDataTransferAddress() { + java.lang.Object ref = dataTransferAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataTransferAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * If `data_transfer_protocol` is set, the address of the data transfer
    +       * server. The substring "%dts_port%" can be used to represent -- and is
    +       * replaced with -- the bound port of the data transfer server; this is useful
    +       * when `data_transfer_port` is set to `0`.
    +       * 
    + * + * string data_transfer_address = 8; + * @return The bytes for dataTransferAddress. + */ + public com.google.protobuf.ByteString + getDataTransferAddressBytes() { + java.lang.Object ref = dataTransferAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataTransferAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * If `data_transfer_protocol` is set, the address of the data transfer
    +       * server. The substring "%dts_port%" can be used to represent -- and is
    +       * replaced with -- the bound port of the data transfer server; this is useful
    +       * when `data_transfer_port` is set to `0`.
    +       * 
    + * + * string data_transfer_address = 8; + * @param value The dataTransferAddress to set. + * @return This builder for chaining. + */ + public Builder setDataTransferAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + dataTransferAddress_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +       * If `data_transfer_protocol` is set, the address of the data transfer
    +       * server. The substring "%dts_port%" can be used to represent -- and is
    +       * replaced with -- the bound port of the data transfer server; this is useful
    +       * when `data_transfer_port` is set to `0`.
    +       * 
    + * + * string data_transfer_address = 8; + * @return This builder for chaining. + */ + public Builder clearDataTransferAddress() { + dataTransferAddress_ = getDefaultInstance().getDataTransferAddress(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + *
    +       * If `data_transfer_protocol` is set, the address of the data transfer
    +       * server. The substring "%dts_port%" can be used to represent -- and is
    +       * replaced with -- the bound port of the data transfer server; this is useful
    +       * when `data_transfer_port` is set to `0`.
    +       * 
    + * + * string data_transfer_address = 8; + * @param value The bytes for dataTransferAddress to set. + * @return This builder for chaining. + */ + public Builder setDataTransferAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + dataTransferAddress_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private long crossTrainerCacheSizeBytes_ ; + /** + *
    +       * Maximum size of the cross-trainer cache in bytes. If enabled, make sure
    +       * your training job provides sufficient memory resources.
    +       * 
    + * + * int64 cross_trainer_cache_size_bytes = 11; + * @return The crossTrainerCacheSizeBytes. + */ + @java.lang.Override + public long getCrossTrainerCacheSizeBytes() { + return crossTrainerCacheSizeBytes_; + } + /** + *
    +       * Maximum size of the cross-trainer cache in bytes. If enabled, make sure
    +       * your training job provides sufficient memory resources.
    +       * 
    + * + * int64 cross_trainer_cache_size_bytes = 11; + * @param value The crossTrainerCacheSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setCrossTrainerCacheSizeBytes(long value) { + + crossTrainerCacheSizeBytes_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
    +       * Maximum size of the cross-trainer cache in bytes. If enabled, make sure
    +       * your training job provides sufficient memory resources.
    +       * 
    + * + * int64 cross_trainer_cache_size_bytes = 11; + * @return This builder for chaining. + */ + public Builder clearCrossTrainerCacheSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000400); + crossTrainerCacheSizeBytes_ = 0L; + onChanged(); + return this; + } + + private long snapshotMaxChunkSizeBytes_ ; + /** + *
    +       * The maximum size of a distributed snapshot chunk file. A value of 0
    +       * indicates that the decision should be left up to the runtime.
    +       * 
    + * + * int64 snapshot_max_chunk_size_bytes = 12; + * @return The snapshotMaxChunkSizeBytes. + */ + @java.lang.Override + public long getSnapshotMaxChunkSizeBytes() { + return snapshotMaxChunkSizeBytes_; + } + /** + *
    +       * The maximum size of a distributed snapshot chunk file. A value of 0
    +       * indicates that the decision should be left up to the runtime.
    +       * 
    + * + * int64 snapshot_max_chunk_size_bytes = 12; + * @param value The snapshotMaxChunkSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setSnapshotMaxChunkSizeBytes(long value) { + + snapshotMaxChunkSizeBytes_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +       * The maximum size of a distributed snapshot chunk file. A value of 0
    +       * indicates that the decision should be left up to the runtime.
    +       * 
    + * + * int64 snapshot_max_chunk_size_bytes = 12; + * @return This builder for chaining. + */ + public Builder clearSnapshotMaxChunkSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000800); + snapshotMaxChunkSizeBytes_ = 0L; + onChanged(); + return this; + } + + private long shutdownQuietPeriodMs_ ; + /** + *
    +       * When shutting down a worker, how long to wait for the gRPC server to
    +       * process the final requests. This is used to achieve clean shutdown in unit
    +       * tests.
    +       * 
    + * + * int64 shutdown_quiet_period_ms = 9; + * @return The shutdownQuietPeriodMs. + */ + @java.lang.Override + public long getShutdownQuietPeriodMs() { + return shutdownQuietPeriodMs_; + } + /** + *
    +       * When shutting down a worker, how long to wait for the gRPC server to
    +       * process the final requests. This is used to achieve clean shutdown in unit
    +       * tests.
    +       * 
    + * + * int64 shutdown_quiet_period_ms = 9; + * @param value The shutdownQuietPeriodMs to set. + * @return This builder for chaining. + */ + public Builder setShutdownQuietPeriodMs(long value) { + + shutdownQuietPeriodMs_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
    +       * When shutting down a worker, how long to wait for the gRPC server to
    +       * process the final requests. This is used to achieve clean shutdown in unit
    +       * tests.
    +       * 
    + * + * int64 shutdown_quiet_period_ms = 9; + * @return This builder for chaining. + */ + public Builder clearShutdownQuietPeriodMs() { + bitField0_ = (bitField0_ & ~0x00001000); + shutdownQuietPeriodMs_ = 0L; + onChanged(); + return this; + } + + // @@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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.GeneratedMessage.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.GeneratedMessage.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/service_confi" + + "g.proto\022\034tensorflow.data.experimental\032+t" + + "ensorflow/core/protobuf/data_service.pro" + + "to\"\363\002\n\020DispatcherConfig\022\014\n\004port\030\001 \001(\003\022\020\n" + + "\010protocol\030\002 \001(\t\022\020\n\010work_dir\030\003 \001(\t\022\033\n\023fau" + + "lt_tolerant_mode\030\004 \001(\010\022\030\n\020worker_address" + + "es\030\007 \003(\t\0228\n\017deployment_mode\030\t \001(\0162\037.tens" + + "orflow.data.DeploymentMode\022 \n\030job_gc_che" + + "ck_interval_ms\030\005 \001(\003\022\031\n\021job_gc_timeout_m" + + "s\030\006 \001(\003\022 \n\030gc_dynamic_sharding_jobs\030\013 \001(" + + "\010\022\031\n\021client_timeout_ms\030\010 \001(\003\022\031\n\021worker_t" + + "imeout_ms\030\n \001(\003\022\'\n\037worker_max_concurrent" + + "_snapshots\030\014 \001(\003\"\201\003\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\023\n" + + "\013worker_tags\030\n \003(\t\022\035\n\025heartbeat_interval" + + "_ms\030\005 \001(\003\022\035\n\025dispatcher_timeout_ms\030\006 \001(\003" + + "\022\036\n\026data_transfer_protocol\030\007 \001(\t\022\032\n\022data" + + "_transfer_port\030\r \001(\003\022\035\n\025data_transfer_ad" + + "dress\030\010 \001(\t\022&\n\036cross_trainer_cache_size_" + + "bytes\030\013 \001(\003\022%\n\035snapshot_max_chunk_size_b" + + "ytes\030\014 \001(\003\022 \n\030shutdown_quiet_period_ms\030\t" + + " \001(\003B\177\n&org.tensorflow.proto.data.experi" + + "mentalZUgithub.com/tensorflow/tensorflow" + + "/tensorflow/go/core/protobuf/for_core_pr" + + "otos_go_protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.data.DataService.getDescriptor(), + }); + internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_experimental_DispatcherConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_DispatcherConfig_descriptor, + new java.lang.String[] { "Port", "Protocol", "WorkDir", "FaultTolerantMode", "WorkerAddresses", "DeploymentMode", "JobGcCheckIntervalMs", "JobGcTimeoutMs", "GcDynamicShardingJobs", "ClientTimeoutMs", "WorkerTimeoutMs", "WorkerMaxConcurrentSnapshots", }); + internal_static_tensorflow_data_experimental_WorkerConfig_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_experimental_WorkerConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_WorkerConfig_descriptor, + new java.lang.String[] { "Port", "Protocol", "DispatcherAddress", "WorkerAddress", "WorkerTags", "HeartbeatIntervalMs", "DispatcherTimeoutMs", "DataTransferProtocol", "DataTransferPort", "DataTransferAddress", "CrossTrainerCacheSizeBytes", "SnapshotMaxChunkSizeBytes", "ShutdownQuietPeriodMs", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.data.DataService.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/Snapshot.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/Snapshot.java new file mode 100644 index 00000000000..f21a9672404 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/experimental/Snapshot.java @@ -0,0 +1,4443 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/snapshot.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data.experimental; + +public final class Snapshot { + private Snapshot() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Snapshot.class.getName()); + } + 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 SnapshotRecordOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotRecord) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + java.util.List + getTensorList(); + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + org.tensorflow.proto.TensorProto getTensor(int index); + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + int getTensorCount(); + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + java.util.List + getTensorOrBuilderList(); + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index); + } + /** + *
    +   * 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.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotRecord} + */ + public static final class SnapshotRecord extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotRecord) + SnapshotRecordOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SnapshotRecord.class.getName()); + } + // Use SnapshotRecord.newBuilder() to construct. + private SnapshotRecord(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SnapshotRecord() { + tensor_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.Builder.class); + } + + public static final int TENSOR_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List tensor_; + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + @java.lang.Override + public java.util.List getTensorList() { + return tensor_; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + @java.lang.Override + public java.util.List + getTensorOrBuilderList() { + return tensor_; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + @java.lang.Override + public int getTensorCount() { + return tensor_.size(); + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProto getTensor(int index) { + return tensor_.get(index); + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + @java.lang.Override + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index) { + return tensor_.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 { + for (int i = 0; i < tensor_.size(); i++) { + output.writeMessage(1, tensor_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tensor_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tensor_.get(i)); + } + size += getUnknownFields().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.Snapshot.SnapshotRecord)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord other = (org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord) obj; + + if (!getTensorList() + .equals(other.getTensorList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorCount() > 0) { + hash = (37 * hash) + TENSOR_FIELD_NUMBER; + hash = (53 * hash) + getTensorList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord 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.Snapshot.SnapshotRecord parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Snapshot.SnapshotRecord 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * 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.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotRecord} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotRecord) + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + } else { + tensor_ = null; + tensorBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord build() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord buildPartial() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord result = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord result) { + if (tensorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tensor_ = java.util.Collections.unmodifiableList(tensor_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tensor_ = tensor_; + } else { + result.tensor_ = tensorBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord) { + return mergeFrom((org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord other) { + if (other == org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord.getDefaultInstance()) return this; + if (tensorBuilder_ == null) { + if (!other.tensor_.isEmpty()) { + if (tensor_.isEmpty()) { + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTensorIsMutable(); + tensor_.addAll(other.tensor_); + } + onChanged(); + } + } else { + if (!other.tensor_.isEmpty()) { + if (tensorBuilder_.isEmpty()) { + tensorBuilder_.dispose(); + tensorBuilder_ = null; + tensor_ = other.tensor_; + bitField0_ = (bitField0_ & ~0x00000001); + tensorBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorFieldBuilder() : null; + } else { + tensorBuilder_.addAllMessages(other.tensor_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.TensorProto m = + input.readMessage( + org.tensorflow.proto.TensorProto.parser(), + extensionRegistry); + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(m); + } else { + tensorBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List tensor_ = + java.util.Collections.emptyList(); + private void ensureTensorIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tensor_ = new java.util.ArrayList(tensor_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> tensorBuilder_; + + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public java.util.List getTensorList() { + if (tensorBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensor_); + } else { + return tensorBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public int getTensorCount() { + if (tensorBuilder_ == null) { + return tensor_.size(); + } else { + return tensorBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public org.tensorflow.proto.TensorProto getTensor(int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); + } else { + return tensorBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder setTensor( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.set(index, value); + onChanged(); + } else { + tensorBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder setTensor( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder addTensor(org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(value); + onChanged(); + } else { + tensorBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder addTensor( + int index, org.tensorflow.proto.TensorProto value) { + if (tensorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorIsMutable(); + tensor_.add(index, value); + onChanged(); + } else { + tensorBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder addTensor( + org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder addTensor( + int index, org.tensorflow.proto.TensorProto.Builder builderForValue) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder addAllTensor( + java.lang.Iterable values) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensor_); + onChanged(); + } else { + tensorBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder clearTensor() { + if (tensorBuilder_ == null) { + tensor_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tensorBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public Builder removeTensor(int index) { + if (tensorBuilder_ == null) { + ensureTensorIsMutable(); + tensor_.remove(index); + onChanged(); + } else { + tensorBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public org.tensorflow.proto.TensorProto.Builder getTensorBuilder( + int index) { + return getTensorFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public org.tensorflow.proto.TensorProtoOrBuilder getTensorOrBuilder( + int index) { + if (tensorBuilder_ == null) { + return tensor_.get(index); } else { + return tensorBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public java.util.List + getTensorOrBuilderList() { + if (tensorBuilder_ != null) { + return tensorBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensor_); + } + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorBuilder() { + return getTensorFieldBuilder().addBuilder( + org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public org.tensorflow.proto.TensorProto.Builder addTensorBuilder( + int index) { + return getTensorFieldBuilder().addBuilder( + index, org.tensorflow.proto.TensorProto.getDefaultInstance()); + } + /** + * repeated .tensorflow.TensorProto tensor = 1; + */ + public java.util.List + getTensorBuilderList() { + return getTensorFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder> + getTensorFieldBuilder() { + if (tensorBuilder_ == null) { + tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.TensorProto, org.tensorflow.proto.TensorProto.Builder, org.tensorflow.proto.TensorProtoOrBuilder>( + tensor_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tensor_ = null; + } + return tensorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.SnapshotRecord) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotRecord) + private static final org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord(); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapshotRecord parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Snapshot.SnapshotRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SnapshotMetadataRecordOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotMetadataRecord) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Stores the fingerprint of the graph that describes the dataset that is
    +     * snapshotted.
    +     * 
    + * + * string graph_hash = 1; + * @return The graphHash. + */ + java.lang.String getGraphHash(); + /** + *
    +     * Stores the fingerprint of the graph that describes the dataset that is
    +     * snapshotted.
    +     * 
    + * + * string graph_hash = 1; + * @return The bytes for graphHash. + */ + com.google.protobuf.ByteString + getGraphHashBytes(); + + /** + *
    +     * Run ID that this snapshot corresponds to.
    +     * 
    + * + * string run_id = 2; + * @return The runId. + */ + java.lang.String getRunId(); + /** + *
    +     * Run ID that this snapshot corresponds to.
    +     * 
    + * + * string run_id = 2; + * @return The bytes for runId. + */ + com.google.protobuf.ByteString + getRunIdBytes(); + + /** + *
    +     * Time when we started creating this snapshot.
    +     * 
    + * + * int64 creation_timestamp = 3; + * @return The creationTimestamp. + */ + long getCreationTimestamp(); + + /** + *
    +     * Version of the snapshot data file format.
    +     * 
    + * + * int64 version = 4; + * @return The version. + */ + long getVersion(); + + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the dtype. + */ + java.util.List getDtypeList(); + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return The count of dtype. + */ + int getDtypeCount(); + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the element to return. + * @return The dtype at the given index. + */ + org.tensorflow.proto.DataType getDtype(int index); + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the enum numeric values on the wire for dtype. + */ + java.util.List + getDtypeValueList(); + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtype at the given index. + */ + int getDtypeValue(int index); + + /** + *
    +     * The number of elements in the snapshot.
    +     * 
    + * + * int64 num_elements = 6; + * @return The numElements. + */ + long getNumElements(); + + /** + * bool finalized = 1000; + * @return The finalized. + */ + boolean getFinalized(); + } + /** + *
    +   * This stores the metadata information present in each snapshot record.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotMetadataRecord} + */ + public static final class SnapshotMetadataRecord extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotMetadataRecord) + SnapshotMetadataRecordOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SnapshotMetadataRecord.class.getName()); + } + // Use SnapshotMetadataRecord.newBuilder() to construct. + private SnapshotMetadataRecord(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SnapshotMetadataRecord() { + graphHash_ = ""; + runId_ = ""; + dtype_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.Builder.class); + } + + public static final int GRAPH_HASH_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object graphHash_ = ""; + /** + *
    +     * Stores the fingerprint of the graph that describes the dataset that is
    +     * snapshotted.
    +     * 
    + * + * string graph_hash = 1; + * @return The graphHash. + */ + @java.lang.Override + public java.lang.String getGraphHash() { + java.lang.Object ref = graphHash_; + 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(); + graphHash_ = s; + return s; + } + } + /** + *
    +     * Stores the fingerprint of the graph that describes the dataset that is
    +     * snapshotted.
    +     * 
    + * + * string graph_hash = 1; + * @return The bytes for graphHash. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGraphHashBytes() { + java.lang.Object ref = graphHash_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUN_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object runId_ = ""; + /** + *
    +     * Run ID that this snapshot corresponds to.
    +     * 
    + * + * string run_id = 2; + * @return The runId. + */ + @java.lang.Override + public java.lang.String getRunId() { + java.lang.Object ref = runId_; + 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(); + runId_ = s; + return s; + } + } + /** + *
    +     * Run ID that this snapshot corresponds to.
    +     * 
    + * + * string run_id = 2; + * @return The bytes for runId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRunIdBytes() { + java.lang.Object ref = runId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + runId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 3; + private long creationTimestamp_ = 0L; + /** + *
    +     * Time when we started creating this snapshot.
    +     * 
    + * + * int64 creation_timestamp = 3; + * @return The creationTimestamp. + */ + @java.lang.Override + public long getCreationTimestamp() { + return creationTimestamp_; + } + + public static final int VERSION_FIELD_NUMBER = 4; + private long version_ = 0L; + /** + *
    +     * Version of the snapshot data file format.
    +     * 
    + * + * int64 version = 4; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + + public static final int DTYPE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList dtype_; + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType> dtype_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + org.tensorflow.proto.DataType>() { + public org.tensorflow.proto.DataType convert(int from) { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(from); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + }; + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the dtype. + */ + @java.lang.Override + public java.util.List getDtypeList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(dtype_, dtype_converter_); + } + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return The count of dtype. + */ + @java.lang.Override + public int getDtypeCount() { + return dtype_.size(); + } + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the element to return. + * @return The dtype at the given index. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype(int index) { + return dtype_converter_.convert(dtype_.getInt(index)); + } + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the enum numeric values on the wire for dtype. + */ + @java.lang.Override + public java.util.List + getDtypeValueList() { + return dtype_; + } + /** + *
    +     * A list of tensor dtype corresponding to each element of the snapshot.
    +     * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtype at the given index. + */ + @java.lang.Override + public int getDtypeValue(int index) { + return dtype_.getInt(index); + } + private int dtypeMemoizedSerializedSize; + + public static final int NUM_ELEMENTS_FIELD_NUMBER = 6; + private long numElements_ = 0L; + /** + *
    +     * The number of elements in the snapshot.
    +     * 
    + * + * int64 num_elements = 6; + * @return The numElements. + */ + @java.lang.Override + public long getNumElements() { + return numElements_; + } + + public static final int FINALIZED_FIELD_NUMBER = 1000; + private boolean finalized_ = false; + /** + * bool finalized = 1000; + * @return The finalized. + */ + @java.lang.Override + public boolean getFinalized() { + return finalized_; + } + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphHash_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, graphHash_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(runId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, runId_); + } + if (creationTimestamp_ != 0L) { + output.writeInt64(3, creationTimestamp_); + } + if (version_ != 0L) { + output.writeInt64(4, version_); + } + if (getDtypeList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(dtypeMemoizedSerializedSize); + } + for (int i = 0; i < dtype_.size(); i++) { + output.writeEnumNoTag(dtype_.getInt(i)); + } + if (numElements_ != 0L) { + output.writeInt64(6, numElements_); + } + if (finalized_ != false) { + output.writeBool(1000, finalized_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(graphHash_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, graphHash_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(runId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, runId_); + } + if (creationTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, creationTimestamp_); + } + if (version_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, version_); + } + { + int dataSize = 0; + for (int i = 0; i < dtype_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(dtype_.getInt(i)); + } + size += dataSize; + if (!getDtypeList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }dtypeMemoizedSerializedSize = dataSize; + } + if (numElements_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, numElements_); + } + if (finalized_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1000, finalized_); + } + size += getUnknownFields().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.Snapshot.SnapshotMetadataRecord)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord other = (org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord) obj; + + if (!getGraphHash() + .equals(other.getGraphHash())) return false; + if (!getRunId() + .equals(other.getRunId())) return false; + if (getCreationTimestamp() + != other.getCreationTimestamp()) return false; + if (getVersion() + != other.getVersion()) return false; + if (!dtype_.equals(other.dtype_)) return false; + if (getNumElements() + != other.getNumElements()) return false; + if (getFinalized() + != other.getFinalized()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + GRAPH_HASH_FIELD_NUMBER; + hash = (53 * hash) + getGraphHash().hashCode(); + hash = (37 * hash) + RUN_ID_FIELD_NUMBER; + hash = (53 * hash) + getRunId().hashCode(); + hash = (37 * hash) + CREATION_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCreationTimestamp()); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getVersion()); + if (getDtypeCount() > 0) { + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_.hashCode(); + } + hash = (37 * hash) + NUM_ELEMENTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumElements()); + hash = (37 * hash) + FINALIZED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinalized()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord 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.Snapshot.SnapshotMetadataRecord parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Snapshot.SnapshotMetadataRecord 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * This stores the metadata information present in each snapshot record.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotMetadataRecord} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotMetadataRecord) + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecordOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + graphHash_ = ""; + runId_ = ""; + creationTimestamp_ = 0L; + version_ = 0L; + dtype_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + numElements_ = 0L; + finalized_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord build() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord buildPartial() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord result = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord result) { + if (((bitField0_ & 0x00000010) != 0)) { + dtype_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.dtype_ = dtype_; + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.graphHash_ = graphHash_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runId_ = runId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.creationTimestamp_ = creationTimestamp_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.numElements_ = numElements_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.finalized_ = finalized_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord) { + return mergeFrom((org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord other) { + if (other == org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord.getDefaultInstance()) return this; + if (!other.getGraphHash().isEmpty()) { + graphHash_ = other.graphHash_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRunId().isEmpty()) { + runId_ = other.runId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getCreationTimestamp() != 0L) { + setCreationTimestamp(other.getCreationTimestamp()); + } + if (other.getVersion() != 0L) { + setVersion(other.getVersion()); + } + if (!other.dtype_.isEmpty()) { + if (dtype_.isEmpty()) { + dtype_ = other.dtype_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureDtypeIsMutable(); + dtype_.addAll(other.dtype_); + } + onChanged(); + } + if (other.getNumElements() != 0L) { + setNumElements(other.getNumElements()); + } + if (other.getFinalized() != false) { + setFinalized(other.getFinalized()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + graphHash_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + runId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + creationTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + version_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + int tmpRaw = input.readEnum(); + ensureDtypeIsMutable(); + dtype_.addInt(tmpRaw); + break; + } // case 40 + case 42: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureDtypeIsMutable(); + dtype_.addInt(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + case 48: { + numElements_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 8000: { + finalized_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 8000 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object graphHash_ = ""; + /** + *
    +       * Stores the fingerprint of the graph that describes the dataset that is
    +       * snapshotted.
    +       * 
    + * + * string graph_hash = 1; + * @return The graphHash. + */ + public java.lang.String getGraphHash() { + java.lang.Object ref = graphHash_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + graphHash_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Stores the fingerprint of the graph that describes the dataset that is
    +       * snapshotted.
    +       * 
    + * + * string graph_hash = 1; + * @return The bytes for graphHash. + */ + public com.google.protobuf.ByteString + getGraphHashBytes() { + java.lang.Object ref = graphHash_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + graphHash_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Stores the fingerprint of the graph that describes the dataset that is
    +       * snapshotted.
    +       * 
    + * + * string graph_hash = 1; + * @param value The graphHash to set. + * @return This builder for chaining. + */ + public Builder setGraphHash( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + graphHash_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Stores the fingerprint of the graph that describes the dataset that is
    +       * snapshotted.
    +       * 
    + * + * string graph_hash = 1; + * @return This builder for chaining. + */ + public Builder clearGraphHash() { + graphHash_ = getDefaultInstance().getGraphHash(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * Stores the fingerprint of the graph that describes the dataset that is
    +       * snapshotted.
    +       * 
    + * + * string graph_hash = 1; + * @param value The bytes for graphHash to set. + * @return This builder for chaining. + */ + public Builder setGraphHashBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + graphHash_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object runId_ = ""; + /** + *
    +       * Run ID that this snapshot corresponds to.
    +       * 
    + * + * string run_id = 2; + * @return The runId. + */ + public java.lang.String getRunId() { + java.lang.Object ref = runId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Run ID that this snapshot corresponds to.
    +       * 
    + * + * string run_id = 2; + * @return The bytes for runId. + */ + public com.google.protobuf.ByteString + getRunIdBytes() { + java.lang.Object ref = runId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + runId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Run ID that this snapshot corresponds to.
    +       * 
    + * + * string run_id = 2; + * @param value The runId to set. + * @return This builder for chaining. + */ + public Builder setRunId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + runId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Run ID that this snapshot corresponds to.
    +       * 
    + * + * string run_id = 2; + * @return This builder for chaining. + */ + public Builder clearRunId() { + runId_ = getDefaultInstance().getRunId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Run ID that this snapshot corresponds to.
    +       * 
    + * + * string run_id = 2; + * @param value The bytes for runId to set. + * @return This builder for chaining. + */ + public Builder setRunIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + runId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long creationTimestamp_ ; + /** + *
    +       * Time when we started creating this snapshot.
    +       * 
    + * + * int64 creation_timestamp = 3; + * @return The creationTimestamp. + */ + @java.lang.Override + public long getCreationTimestamp() { + return creationTimestamp_; + } + /** + *
    +       * Time when we started creating this snapshot.
    +       * 
    + * + * int64 creation_timestamp = 3; + * @param value The creationTimestamp to set. + * @return This builder for chaining. + */ + public Builder setCreationTimestamp(long value) { + + creationTimestamp_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Time when we started creating this snapshot.
    +       * 
    + * + * int64 creation_timestamp = 3; + * @return This builder for chaining. + */ + public Builder clearCreationTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + creationTimestamp_ = 0L; + onChanged(); + return this; + } + + private long version_ ; + /** + *
    +       * Version of the snapshot data file format.
    +       * 
    + * + * int64 version = 4; + * @return The version. + */ + @java.lang.Override + public long getVersion() { + return version_; + } + /** + *
    +       * Version of the snapshot data file format.
    +       * 
    + * + * int64 version = 4; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(long value) { + + version_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Version of the snapshot data file format.
    +       * 
    + * + * int64 version = 4; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000008); + version_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList dtype_ = + emptyIntList(); + private void ensureDtypeIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + dtype_ = makeMutableCopy(dtype_); + bitField0_ |= 0x00000010; + } + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the dtype. + */ + public java.util.List getDtypeList() { + return new com.google.protobuf.Internal.IntListAdapter< + org.tensorflow.proto.DataType>(dtype_, dtype_converter_); + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return The count of dtype. + */ + public int getDtypeCount() { + return dtype_.size(); + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the element to return. + * @return The dtype at the given index. + */ + public org.tensorflow.proto.DataType getDtype(int index) { + return dtype_converter_.convert(dtype_.getInt(index)); + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index to set the value at. + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype( + int index, org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtypeIsMutable(); + dtype_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param value The dtype to add. + * @return This builder for chaining. + */ + public Builder addDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtypeIsMutable(); + dtype_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param values The dtype to add. + * @return This builder for chaining. + */ + public Builder addAllDtype( + java.lang.Iterable values) { + ensureDtypeIsMutable(); + for (org.tensorflow.proto.DataType value : values) { + dtype_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return This builder for chaining. + */ + public Builder clearDtype() { + dtype_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @return A list containing the enum numeric values on the wire for dtype. + */ + public java.util.List + getDtypeValueList() { + return java.util.Collections.unmodifiableList(dtype_); + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtype at the given index. + */ + public int getDtypeValue(int index) { + return dtype_.getInt(index); + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue( + int index, int value) { + ensureDtypeIsMutable(); + dtype_.setInt(index, value); + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param value The enum numeric value on the wire for dtype to add. + * @return This builder for chaining. + */ + public Builder addDtypeValue(int value) { + ensureDtypeIsMutable(); + dtype_.addInt(value); + onChanged(); + return this; + } + /** + *
    +       * A list of tensor dtype corresponding to each element of the snapshot.
    +       * 
    + * + * repeated .tensorflow.DataType dtype = 5; + * @param values The enum numeric values on the wire for dtype to add. + * @return This builder for chaining. + */ + public Builder addAllDtypeValue( + java.lang.Iterable values) { + ensureDtypeIsMutable(); + for (int value : values) { + dtype_.addInt(value); + } + onChanged(); + return this; + } + + private long numElements_ ; + /** + *
    +       * The number of elements in the snapshot.
    +       * 
    + * + * int64 num_elements = 6; + * @return The numElements. + */ + @java.lang.Override + public long getNumElements() { + return numElements_; + } + /** + *
    +       * The number of elements in the snapshot.
    +       * 
    + * + * int64 num_elements = 6; + * @param value The numElements to set. + * @return This builder for chaining. + */ + public Builder setNumElements(long value) { + + numElements_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * The number of elements in the snapshot.
    +       * 
    + * + * int64 num_elements = 6; + * @return This builder for chaining. + */ + public Builder clearNumElements() { + bitField0_ = (bitField0_ & ~0x00000020); + numElements_ = 0L; + onChanged(); + return this; + } + + private boolean finalized_ ; + /** + * bool finalized = 1000; + * @return The finalized. + */ + @java.lang.Override + public boolean getFinalized() { + return finalized_; + } + /** + * bool finalized = 1000; + * @param value The finalized to set. + * @return This builder for chaining. + */ + public Builder setFinalized(boolean value) { + + finalized_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * bool finalized = 1000; + * @return This builder for chaining. + */ + public Builder clearFinalized() { + bitField0_ = (bitField0_ & ~0x00000040); + finalized_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.SnapshotMetadataRecord) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotMetadataRecord) + private static final org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord(); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotMetadataRecord getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapshotMetadataRecord parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Snapshot.SnapshotMetadataRecord getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TensorMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.TensorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + boolean hasTensorShape(); + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + org.tensorflow.proto.TensorShapeProto getTensorShape(); + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder(); + + /** + *
    +     * Number of uncompressed bytes used to store the tensor representation.
    +     * 
    + * + * int64 tensor_size_bytes = 3; + * @return The tensorSizeBytes. + */ + long getTensorSizeBytes(); + } + /** + *
    +   * Metadata for a single tensor in the Snapshot Record.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.TensorMetadata} + */ + public static final class TensorMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.TensorMetadata) + TensorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + TensorMetadata.class.getName()); + } + // Use TensorMetadata.newBuilder() to construct. + private TensorMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TensorMetadata() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder.class); + } + + private int bitField0_; + public static final int TENSOR_SHAPE_FIELD_NUMBER = 2; + private org.tensorflow.proto.TensorShapeProto tensorShape_; + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + @java.lang.Override + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + @java.lang.Override + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + + public static final int TENSOR_SIZE_BYTES_FIELD_NUMBER = 3; + private long tensorSizeBytes_ = 0L; + /** + *
    +     * Number of uncompressed bytes used to store the tensor representation.
    +     * 
    + * + * int64 tensor_size_bytes = 3; + * @return The tensorSizeBytes. + */ + @java.lang.Override + public long getTensorSizeBytes() { + return tensorSizeBytes_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getTensorShape()); + } + if (tensorSizeBytes_ != 0L) { + output.writeInt64(3, tensorSizeBytes_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTensorShape()); + } + if (tensorSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, tensorSizeBytes_); + } + size += getUnknownFields().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.Snapshot.TensorMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata other = (org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata) obj; + + if (hasTensorShape() != other.hasTensorShape()) return false; + if (hasTensorShape()) { + if (!getTensorShape() + .equals(other.getTensorShape())) return false; + } + if (getTensorSizeBytes() + != other.getTensorSizeBytes()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTensorShape()) { + hash = (37 * hash) + TENSOR_SHAPE_FIELD_NUMBER; + hash = (53 * hash) + getTensorShape().hashCode(); + } + hash = (37 * hash) + TENSOR_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTensorSizeBytes()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.TensorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.TensorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata 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.Snapshot.TensorMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Snapshot.TensorMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for a single tensor in the Snapshot Record.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.TensorMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.TensorMetadata) + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getTensorShapeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + tensorSizeBytes_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata build() { + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata buildPartial() { + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata result = new org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tensorShape_ = tensorShapeBuilder_ == null + ? tensorShape_ + : tensorShapeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tensorSizeBytes_ = tensorSizeBytes_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata) { + return mergeFrom((org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata other) { + if (other == org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.getDefaultInstance()) return this; + if (other.hasTensorShape()) { + mergeTensorShape(other.getTensorShape()); + } + if (other.getTensorSizeBytes() != 0L) { + setTensorSizeBytes(other.getTensorSizeBytes()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + input.readMessage( + getTensorShapeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 18 + case 24: { + tensorSizeBytes_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private org.tensorflow.proto.TensorShapeProto tensorShape_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> tensorShapeBuilder_; + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return Whether the tensorShape field is set. + */ + public boolean hasTensorShape() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + * @return The tensorShape. + */ + public org.tensorflow.proto.TensorShapeProto getTensorShape() { + if (tensorShapeBuilder_ == null) { + return tensorShape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } else { + return tensorShapeBuilder_.getMessage(); + } + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tensorShape_ = value; + } else { + tensorShapeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder setTensorShape( + org.tensorflow.proto.TensorShapeProto.Builder builderForValue) { + if (tensorShapeBuilder_ == null) { + tensorShape_ = builderForValue.build(); + } else { + tensorShapeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder mergeTensorShape(org.tensorflow.proto.TensorShapeProto value) { + if (tensorShapeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + tensorShape_ != null && + tensorShape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) { + getTensorShapeBuilder().mergeFrom(value); + } else { + tensorShape_ = value; + } + } else { + tensorShapeBuilder_.mergeFrom(value); + } + if (tensorShape_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public Builder clearTensorShape() { + bitField0_ = (bitField0_ & ~0x00000001); + tensorShape_ = null; + if (tensorShapeBuilder_ != null) { + tensorShapeBuilder_.dispose(); + tensorShapeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProto.Builder getTensorShapeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTensorShapeFieldBuilder().getBuilder(); + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + public org.tensorflow.proto.TensorShapeProtoOrBuilder getTensorShapeOrBuilder() { + if (tensorShapeBuilder_ != null) { + return tensorShapeBuilder_.getMessageOrBuilder(); + } else { + return tensorShape_ == null ? + org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : tensorShape_; + } + } + /** + * .tensorflow.TensorShapeProto tensor_shape = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> + getTensorShapeFieldBuilder() { + if (tensorShapeBuilder_ == null) { + tensorShapeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>( + getTensorShape(), + getParentForChildren(), + isClean()); + tensorShape_ = null; + } + return tensorShapeBuilder_; + } + + private long tensorSizeBytes_ ; + /** + *
    +       * Number of uncompressed bytes used to store the tensor representation.
    +       * 
    + * + * int64 tensor_size_bytes = 3; + * @return The tensorSizeBytes. + */ + @java.lang.Override + public long getTensorSizeBytes() { + return tensorSizeBytes_; + } + /** + *
    +       * Number of uncompressed bytes used to store the tensor representation.
    +       * 
    + * + * int64 tensor_size_bytes = 3; + * @param value The tensorSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setTensorSizeBytes(long value) { + + tensorSizeBytes_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Number of uncompressed bytes used to store the tensor representation.
    +       * 
    + * + * int64 tensor_size_bytes = 3; + * @return This builder for chaining. + */ + public Builder clearTensorSizeBytes() { + bitField0_ = (bitField0_ & ~0x00000002); + tensorSizeBytes_ = 0L; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.TensorMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.TensorMetadata) + private static final org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata(); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TensorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Snapshot.TensorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SnapshotTensorMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.SnapshotTensorMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + java.util.List + getTensorMetadataList(); + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata getTensorMetadata(int index); + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + int getTensorMetadataCount(); + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + java.util.List + getTensorMetadataOrBuilderList(); + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder getTensorMetadataOrBuilder( + int index); + } + /** + *
    +   * Metadata for all the tensors in a Snapshot Record.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotTensorMetadata} + */ + public static final class SnapshotTensorMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.SnapshotTensorMetadata) + SnapshotTensorMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + SnapshotTensorMetadata.class.getName()); + } + // Use SnapshotTensorMetadata.newBuilder() to construct. + private SnapshotTensorMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SnapshotTensorMetadata() { + tensorMetadata_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.Builder.class); + } + + public static final int TENSOR_METADATA_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List tensorMetadata_; + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + @java.lang.Override + public java.util.List getTensorMetadataList() { + return tensorMetadata_; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + @java.lang.Override + public java.util.List + getTensorMetadataOrBuilderList() { + return tensorMetadata_; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + @java.lang.Override + public int getTensorMetadataCount() { + return tensorMetadata_.size(); + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata getTensorMetadata(int index) { + return tensorMetadata_.get(index); + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder getTensorMetadataOrBuilder( + int index) { + return tensorMetadata_.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 { + for (int i = 0; i < tensorMetadata_.size(); i++) { + output.writeMessage(1, tensorMetadata_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tensorMetadata_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tensorMetadata_.get(i)); + } + size += getUnknownFields().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.Snapshot.SnapshotTensorMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata other = (org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata) obj; + + if (!getTensorMetadataList() + .equals(other.getTensorMetadataList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTensorMetadataCount() > 0) { + hash = (37 * hash) + TENSOR_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getTensorMetadataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.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.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata 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.Snapshot.SnapshotTensorMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Snapshot.SnapshotTensorMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for all the tensors in a Snapshot Record.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.SnapshotTensorMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.SnapshotTensorMetadata) + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (tensorMetadataBuilder_ == null) { + tensorMetadata_ = java.util.Collections.emptyList(); + } else { + tensorMetadata_ = null; + tensorMetadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata build() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata buildPartial() { + org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata result = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata result) { + if (tensorMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tensorMetadata_ = java.util.Collections.unmodifiableList(tensorMetadata_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tensorMetadata_ = tensorMetadata_; + } else { + result.tensorMetadata_ = tensorMetadataBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata) { + return mergeFrom((org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata other) { + if (other == org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata.getDefaultInstance()) return this; + if (tensorMetadataBuilder_ == null) { + if (!other.tensorMetadata_.isEmpty()) { + if (tensorMetadata_.isEmpty()) { + tensorMetadata_ = other.tensorMetadata_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTensorMetadataIsMutable(); + tensorMetadata_.addAll(other.tensorMetadata_); + } + onChanged(); + } + } else { + if (!other.tensorMetadata_.isEmpty()) { + if (tensorMetadataBuilder_.isEmpty()) { + tensorMetadataBuilder_.dispose(); + tensorMetadataBuilder_ = null; + tensorMetadata_ = other.tensorMetadata_; + bitField0_ = (bitField0_ & ~0x00000001); + tensorMetadataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTensorMetadataFieldBuilder() : null; + } else { + tensorMetadataBuilder_.addAllMessages(other.tensorMetadata_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata m = + input.readMessage( + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.parser(), + extensionRegistry); + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + tensorMetadata_.add(m); + } else { + tensorMetadataBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List tensorMetadata_ = + java.util.Collections.emptyList(); + private void ensureTensorMetadataIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tensorMetadata_ = new java.util.ArrayList(tensorMetadata_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder> tensorMetadataBuilder_; + + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public java.util.List getTensorMetadataList() { + if (tensorMetadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(tensorMetadata_); + } else { + return tensorMetadataBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public int getTensorMetadataCount() { + if (tensorMetadataBuilder_ == null) { + return tensorMetadata_.size(); + } else { + return tensorMetadataBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata getTensorMetadata(int index) { + if (tensorMetadataBuilder_ == null) { + return tensorMetadata_.get(index); + } else { + return tensorMetadataBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder setTensorMetadata( + int index, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata value) { + if (tensorMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorMetadataIsMutable(); + tensorMetadata_.set(index, value); + onChanged(); + } else { + tensorMetadataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder setTensorMetadata( + int index, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder builderForValue) { + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + tensorMetadata_.set(index, builderForValue.build()); + onChanged(); + } else { + tensorMetadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder addTensorMetadata(org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata value) { + if (tensorMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorMetadataIsMutable(); + tensorMetadata_.add(value); + onChanged(); + } else { + tensorMetadataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder addTensorMetadata( + int index, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata value) { + if (tensorMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTensorMetadataIsMutable(); + tensorMetadata_.add(index, value); + onChanged(); + } else { + tensorMetadataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder addTensorMetadata( + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder builderForValue) { + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + tensorMetadata_.add(builderForValue.build()); + onChanged(); + } else { + tensorMetadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder addTensorMetadata( + int index, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder builderForValue) { + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + tensorMetadata_.add(index, builderForValue.build()); + onChanged(); + } else { + tensorMetadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder addAllTensorMetadata( + java.lang.Iterable values) { + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tensorMetadata_); + onChanged(); + } else { + tensorMetadataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder clearTensorMetadata() { + if (tensorMetadataBuilder_ == null) { + tensorMetadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tensorMetadataBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public Builder removeTensorMetadata(int index) { + if (tensorMetadataBuilder_ == null) { + ensureTensorMetadataIsMutable(); + tensorMetadata_.remove(index); + onChanged(); + } else { + tensorMetadataBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder getTensorMetadataBuilder( + int index) { + return getTensorMetadataFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder getTensorMetadataOrBuilder( + int index) { + if (tensorMetadataBuilder_ == null) { + return tensorMetadata_.get(index); } else { + return tensorMetadataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public java.util.List + getTensorMetadataOrBuilderList() { + if (tensorMetadataBuilder_ != null) { + return tensorMetadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tensorMetadata_); + } + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder addTensorMetadataBuilder() { + return getTensorMetadataFieldBuilder().addBuilder( + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.getDefaultInstance()); + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder addTensorMetadataBuilder( + int index) { + return getTensorMetadataFieldBuilder().addBuilder( + index, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.getDefaultInstance()); + } + /** + * repeated .tensorflow.data.experimental.TensorMetadata tensor_metadata = 1; + */ + public java.util.List + getTensorMetadataBuilderList() { + return getTensorMetadataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder> + getTensorMetadataFieldBuilder() { + if (tensorMetadataBuilder_ == null) { + tensorMetadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadata.Builder, org.tensorflow.proto.data.experimental.Snapshot.TensorMetadataOrBuilder>( + tensorMetadata_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + tensorMetadata_ = null; + } + return tensorMetadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.SnapshotTensorMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.SnapshotTensorMetadata) + private static final org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata(); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.SnapshotTensorMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SnapshotTensorMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Snapshot.SnapshotTensorMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DistributedSnapshotMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.experimental.DistributedSnapshotMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * The element spec of the snapshotted dataset.
    +     * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + com.google.protobuf.ByteString getElementSpec(); + + /** + *
    +     * Whether and how to compress the snapshot.  Supported values are defined in
    +     * `tsl::io::compression`.  In particular, an empty string specifies not to
    +     * compress.
    +     * 
    + * + * string compression = 2; + * @return The compression. + */ + java.lang.String getCompression(); + /** + *
    +     * Whether and how to compress the snapshot.  Supported values are defined in
    +     * `tsl::io::compression`.  In particular, an empty string specifies not to
    +     * compress.
    +     * 
    + * + * string compression = 2; + * @return The bytes for compression. + */ + com.google.protobuf.ByteString + getCompressionBytes(); + } + /** + *
    +   * Metadata for a `tf.data.Dataset` distributed snapshot.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.experimental.DistributedSnapshotMetadata} + */ + public static final class DistributedSnapshotMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.experimental.DistributedSnapshotMetadata) + DistributedSnapshotMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DistributedSnapshotMetadata.class.getName()); + } + // Use DistributedSnapshotMetadata.newBuilder() to construct. + private DistributedSnapshotMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DistributedSnapshotMetadata() { + elementSpec_ = com.google.protobuf.ByteString.EMPTY; + compression_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.Builder.class); + } + + public static final int ELEMENT_SPEC_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString elementSpec_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * The element spec of the snapshotted dataset.
    +     * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + @java.lang.Override + public com.google.protobuf.ByteString getElementSpec() { + return elementSpec_; + } + + public static final int COMPRESSION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object compression_ = ""; + /** + *
    +     * Whether and how to compress the snapshot.  Supported values are defined in
    +     * `tsl::io::compression`.  In particular, an empty string specifies not to
    +     * compress.
    +     * 
    + * + * string compression = 2; + * @return The compression. + */ + @java.lang.Override + public java.lang.String getCompression() { + java.lang.Object ref = compression_; + 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(); + compression_ = s; + return s; + } + } + /** + *
    +     * Whether and how to compress the snapshot.  Supported values are defined in
    +     * `tsl::io::compression`.  In particular, an empty string specifies not to
    +     * compress.
    +     * 
    + * + * string compression = 2; + * @return The bytes for compression. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCompressionBytes() { + java.lang.Object ref = compression_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + compression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!elementSpec_.isEmpty()) { + output.writeBytes(1, elementSpec_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(compression_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, compression_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!elementSpec_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, elementSpec_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(compression_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, compression_); + } + size += getUnknownFields().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.Snapshot.DistributedSnapshotMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata other = (org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata) obj; + + if (!getElementSpec() + .equals(other.getElementSpec())) return false; + if (!getCompression() + .equals(other.getCompression())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ELEMENT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getElementSpec().hashCode(); + hash = (37 * hash) + COMPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getCompression().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata 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.Snapshot.DistributedSnapshotMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata 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.Snapshot.DistributedSnapshotMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata 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.Snapshot.DistributedSnapshotMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Snapshot.DistributedSnapshotMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for a `tf.data.Dataset` distributed snapshot.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.experimental.DistributedSnapshotMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.experimental.DistributedSnapshotMetadata) + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.class, org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + elementSpec_ = com.google.protobuf.ByteString.EMPTY; + compression_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.experimental.Snapshot.internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata build() { + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata buildPartial() { + org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata result = new org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.elementSpec_ = elementSpec_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.compression_ = compression_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata) { + return mergeFrom((org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata other) { + if (other == org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata.getDefaultInstance()) return this; + if (other.getElementSpec() != com.google.protobuf.ByteString.EMPTY) { + setElementSpec(other.getElementSpec()); + } + if (!other.getCompression().isEmpty()) { + compression_ = other.compression_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + elementSpec_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + compression_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString elementSpec_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * The element spec of the snapshotted dataset.
    +       * 
    + * + * bytes element_spec = 1; + * @return The elementSpec. + */ + @java.lang.Override + public com.google.protobuf.ByteString getElementSpec() { + return elementSpec_; + } + /** + *
    +       * The element spec of the snapshotted dataset.
    +       * 
    + * + * bytes element_spec = 1; + * @param value The elementSpec to set. + * @return This builder for chaining. + */ + public Builder setElementSpec(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + elementSpec_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * The element spec of the snapshotted dataset.
    +       * 
    + * + * bytes element_spec = 1; + * @return This builder for chaining. + */ + public Builder clearElementSpec() { + bitField0_ = (bitField0_ & ~0x00000001); + elementSpec_ = getDefaultInstance().getElementSpec(); + onChanged(); + return this; + } + + private java.lang.Object compression_ = ""; + /** + *
    +       * Whether and how to compress the snapshot.  Supported values are defined in
    +       * `tsl::io::compression`.  In particular, an empty string specifies not to
    +       * compress.
    +       * 
    + * + * string compression = 2; + * @return The compression. + */ + public java.lang.String getCompression() { + java.lang.Object ref = compression_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + compression_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Whether and how to compress the snapshot.  Supported values are defined in
    +       * `tsl::io::compression`.  In particular, an empty string specifies not to
    +       * compress.
    +       * 
    + * + * string compression = 2; + * @return The bytes for compression. + */ + public com.google.protobuf.ByteString + getCompressionBytes() { + java.lang.Object ref = compression_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + compression_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Whether and how to compress the snapshot.  Supported values are defined in
    +       * `tsl::io::compression`.  In particular, an empty string specifies not to
    +       * compress.
    +       * 
    + * + * string compression = 2; + * @param value The compression to set. + * @return This builder for chaining. + */ + public Builder setCompression( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + compression_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Whether and how to compress the snapshot.  Supported values are defined in
    +       * `tsl::io::compression`.  In particular, an empty string specifies not to
    +       * compress.
    +       * 
    + * + * string compression = 2; + * @return This builder for chaining. + */ + public Builder clearCompression() { + compression_ = getDefaultInstance().getCompression(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Whether and how to compress the snapshot.  Supported values are defined in
    +       * `tsl::io::compression`.  In particular, an empty string specifies not to
    +       * compress.
    +       * 
    + * + * string compression = 2; + * @param value The bytes for compression to set. + * @return This builder for chaining. + */ + public Builder setCompressionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + compression_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.experimental.DistributedSnapshotMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.experimental.DistributedSnapshotMetadata) + private static final org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata(); + } + + public static org.tensorflow.proto.data.experimental.Snapshot.DistributedSnapshotMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedSnapshotMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Snapshot.DistributedSnapshotMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_TensorMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_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/snapshot.prot" + + "o\022\034tensorflow.data.experimental\032&tensorf" + + "low/core/framework/tensor.proto\032,tensorf" + + "low/core/framework/tensor_shape.proto\032%t" + + "ensorflow/core/framework/types.proto\"9\n\016" + + "SnapshotRecord\022\'\n\006tensor\030\001 \003(\0132\027.tensorf" + + "low.TensorProto\"\270\001\n\026SnapshotMetadataReco" + + "rd\022\022\n\ngraph_hash\030\001 \001(\t\022\016\n\006run_id\030\002 \001(\t\022\032" + + "\n\022creation_timestamp\030\003 \001(\003\022\017\n\007version\030\004 " + + "\001(\003\022#\n\005dtype\030\005 \003(\0162\024.tensorflow.DataType" + + "\022\024\n\014num_elements\030\006 \001(\003\022\022\n\tfinalized\030\350\007 \001" + + "(\010\"_\n\016TensorMetadata\0222\n\014tensor_shape\030\002 \001" + + "(\0132\034.tensorflow.TensorShapeProto\022\031\n\021tens" + + "or_size_bytes\030\003 \001(\003\"_\n\026SnapshotTensorMet" + + "adata\022E\n\017tensor_metadata\030\001 \003(\0132,.tensorf" + + "low.data.experimental.TensorMetadata\"H\n\033" + + "DistributedSnapshotMetadata\022\024\n\014element_s" + + "pec\030\001 \001(\014\022\023\n\013compression\030\002 \001(\tB\177\n&org.te" + + "nsorflow.proto.data.experimentalZUgithub" + + ".com/tensorflow/tensorflow/tensorflow/go" + + "/core/protobuf/for_core_protos_go_protob" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.TensorProtos.getDescriptor(), + org.tensorflow.proto.TensorShapeProtos.getDescriptor(), + org.tensorflow.proto.TypesProtos.getDescriptor(), + }); + internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_experimental_SnapshotRecord_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_SnapshotRecord_descriptor, + new java.lang.String[] { "Tensor", }); + internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_SnapshotMetadataRecord_descriptor, + new java.lang.String[] { "GraphHash", "RunId", "CreationTimestamp", "Version", "Dtype", "NumElements", "Finalized", }); + internal_static_tensorflow_data_experimental_TensorMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_data_experimental_TensorMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_TensorMetadata_descriptor, + new java.lang.String[] { "TensorShape", "TensorSizeBytes", }); + internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_SnapshotTensorMetadata_descriptor, + new java.lang.String[] { "TensorMetadata", }); + internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_experimental_DistributedSnapshotMetadata_descriptor, + new java.lang.String[] { "ElementSpec", "Compression", }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.TensorProtos.getDescriptor(); + org.tensorflow.proto.TensorShapeProtos.getDescriptor(); + org.tensorflow.proto.TypesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/model/Model.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/model/Model.java new file mode 100644 index 00000000000..871c4585112 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/data/model/Model.java @@ -0,0 +1,6463 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/framework/model.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.data.model; + +public final class Model { + private Model() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Model.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + *
    +   * Class of a node in the performance model.
    +   * 
    + * + * Protobuf enum {@code tensorflow.data.model.NodeClass} + */ + public enum NodeClass + implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * INTERLEAVE_MANY = 1; + */ + INTERLEAVE_MANY(1), + /** + * ASYNC_INTERLEAVE_MANY = 2; + */ + ASYNC_INTERLEAVE_MANY(2), + /** + * KNOWN_RATIO = 3; + */ + KNOWN_RATIO(3), + /** + * ASYNC_KNOWN_RATIO = 4; + */ + ASYNC_KNOWN_RATIO(4), + /** + * UNKNOWN_RATIO = 5; + */ + UNKNOWN_RATIO(5), + /** + * ASYNC_UNKNOWN_RATIO = 6; + */ + ASYNC_UNKNOWN_RATIO(6), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeClass.class.getName()); + } + /** + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * INTERLEAVE_MANY = 1; + */ + public static final int INTERLEAVE_MANY_VALUE = 1; + /** + * ASYNC_INTERLEAVE_MANY = 2; + */ + public static final int ASYNC_INTERLEAVE_MANY_VALUE = 2; + /** + * KNOWN_RATIO = 3; + */ + public static final int KNOWN_RATIO_VALUE = 3; + /** + * ASYNC_KNOWN_RATIO = 4; + */ + public static final int ASYNC_KNOWN_RATIO_VALUE = 4; + /** + * UNKNOWN_RATIO = 5; + */ + public static final int UNKNOWN_RATIO_VALUE = 5; + /** + * ASYNC_UNKNOWN_RATIO = 6; + */ + public static final int ASYNC_UNKNOWN_RATIO_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NodeClass valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NodeClass forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return INTERLEAVE_MANY; + case 2: return ASYNC_INTERLEAVE_MANY; + case 3: return KNOWN_RATIO; + case 4: return ASYNC_KNOWN_RATIO; + case 5: return UNKNOWN_RATIO; + case 6: return ASYNC_UNKNOWN_RATIO; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NodeClass> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NodeClass findValueByNumber(int number) { + return NodeClass.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.model.Model.getDescriptor().getEnumTypes().get(0); + } + + private static final NodeClass[] VALUES = values(); + + public static NodeClass 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 NodeClass(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.model.NodeClass) + } + + /** + *
    +   * Algorithm used for model autotuning optimization.
    +   * 
    + * + * Protobuf enum {@code tensorflow.data.model.AutotuneAlgorithm} + */ + public enum AutotuneAlgorithm + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DEFAULT = 0; + */ + DEFAULT(0), + /** + * HILL_CLIMB = 1; + */ + HILL_CLIMB(1), + /** + * GRADIENT_DESCENT = 2; + */ + GRADIENT_DESCENT(2), + /** + * MAX_PARALLELISM = 3; + */ + MAX_PARALLELISM(3), + /** + * STAGE_BASED = 4; + */ + STAGE_BASED(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AutotuneAlgorithm.class.getName()); + } + /** + * DEFAULT = 0; + */ + public static final int DEFAULT_VALUE = 0; + /** + * HILL_CLIMB = 1; + */ + public static final int HILL_CLIMB_VALUE = 1; + /** + * GRADIENT_DESCENT = 2; + */ + public static final int GRADIENT_DESCENT_VALUE = 2; + /** + * MAX_PARALLELISM = 3; + */ + public static final int MAX_PARALLELISM_VALUE = 3; + /** + * STAGE_BASED = 4; + */ + public static final int STAGE_BASED_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AutotuneAlgorithm valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AutotuneAlgorithm forNumber(int value) { + switch (value) { + case 0: return DEFAULT; + case 1: return HILL_CLIMB; + case 2: return GRADIENT_DESCENT; + case 3: return MAX_PARALLELISM; + case 4: return STAGE_BASED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AutotuneAlgorithm> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AutotuneAlgorithm findValueByNumber(int number) { + return AutotuneAlgorithm.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + 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.data.model.Model.getDescriptor().getEnumTypes().get(1); + } + + private static final AutotuneAlgorithm[] VALUES = values(); + + public static AutotuneAlgorithm 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 AutotuneAlgorithm(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:tensorflow.data.model.AutotuneAlgorithm) + } + + public interface ModelProtoOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * User-defined name for the dataset. Empty if no name was set.
    +     * 
    + * + * string dataset_name = 7; + * @return The datasetName. + */ + java.lang.String getDatasetName(); + /** + *
    +     * User-defined name for the dataset. Empty if no name was set.
    +     * 
    + * + * string dataset_name = 7; + * @return The bytes for datasetName. + */ + com.google.protobuf.ByteString + getDatasetNameBytes(); + + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + int getNodesCount(); + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + boolean containsNodes( + long key); + /** + * Use {@link #getNodesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getNodes(); + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + java.util.Map + getNodesMap(); + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node defaultValue); + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrThrow( + long key); + + /** + *
    +     * ID of the output node of this model.
    +     * 
    + * + * int64 output = 2; + * @return The output. + */ + long getOutput(); + + /** + *
    +     * Counter for node IDs of this model.
    +     * 
    + * + * int64 id_counter = 3; + * @return The idCounter. + */ + long getIdCounter(); + + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return Whether the optimizationParams field is set. + */ + boolean hasOptimizationParams(); + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return The optimizationParams. + */ + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams getOptimizationParams(); + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder(); + + /** + * repeated uint64 gap_times = 6; + * @return A list containing the gapTimes. + */ + java.util.List getGapTimesList(); + /** + * repeated uint64 gap_times = 6; + * @return The count of gapTimes. + */ + int getGapTimesCount(); + /** + * repeated uint64 gap_times = 6; + * @param index The index of the element to return. + * @return The gapTimes at the given index. + */ + long getGapTimes(int index); + } + /** + *
    +   * Protocol buffer representing the data used by the autotuning modeling
    +   * framework.
    +   * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto} + */ + public static final class ModelProto extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto) + ModelProtoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ModelProto.class.getName()); + } + // Use ModelProto.newBuilder() to construct. + private ModelProto(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ModelProto() { + datasetName_ = ""; + gapTimes_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetNodes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.class, org.tensorflow.proto.data.model.Model.ModelProto.Builder.class); + } + + public interface NodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.Node) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Unique node ID.
    +       * 
    + * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
    +       * Human-readable name of the node.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +       * Human-readable name of the node.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +       * An indication whether autotuning is enabled for this node.
    +       * 
    + * + * bool autotune = 3; + * @return The autotune. + */ + boolean getAutotune(); + + /** + *
    +       * The number of bytes stored in this node's buffer.
    +       * 
    + * + * int64 buffered_bytes = 4; + * @return The bufferedBytes. + */ + long getBufferedBytes(); + + /** + *
    +       * The number of elements stored in this node's buffer.
    +       * 
    + * + * int64 buffered_elements = 5; + * @return The bufferedElements. + */ + long getBufferedElements(); + + /** + *
    +       * The number of bytes consumed by the node.
    +       * 
    + * + * int64 bytes_consumed = 6; + * @return The bytesConsumed. + */ + long getBytesConsumed(); + + /** + *
    +       * The number of bytes produced by the node.
    +       * 
    + * + * int64 bytes_produced = 7; + * @return The bytesProduced. + */ + long getBytesProduced(); + + /** + *
    +       * The number of elements produced by the node.
    +       * 
    + * + * int64 num_elements = 8; + * @return The numElements. + */ + long getNumElements(); + + /** + *
    +       * The aggregate processing time spent in this node in nanoseconds.
    +       * 
    + * + * int64 processing_time = 9; + * @return The processingTime. + */ + long getProcessingTime(); + + /** + *
    +       * An indication whether this node records metrics about produced and
    +       * consumed elements.
    +       * 
    + * + * bool record_metrics = 10; + * @return The recordMetrics. + */ + boolean getRecordMetrics(); + + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + java.util.List + getParametersList(); + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter getParameters(int index); + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + int getParametersCount(); + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + java.util.List + getParametersOrBuilderList(); + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( + int index); + + /** + *
    +       * Statistic of inputs processing time history.
    +       * 
    + * + * double input_processing_time_sum = 12; + * @return The inputProcessingTimeSum. + */ + double getInputProcessingTimeSum(); + + /** + * int64 input_processing_time_count = 13; + * @return The inputProcessingTimeCount. + */ + long getInputProcessingTimeCount(); + + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @return A list containing the inputs. + */ + java.util.List getInputsList(); + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @return The count of inputs. + */ + int getInputsCount(); + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @param index The index of the element to return. + * @return The inputs at the given index. + */ + long getInputs(int index); + + /** + *
    +       * Class of this node.
    +       * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The enum numeric value on the wire for nodeClass. + */ + int getNodeClassValue(); + /** + *
    +       * Class of this node.
    +       * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The nodeClass. + */ + org.tensorflow.proto.data.model.Model.NodeClass getNodeClass(); + + /** + *
    +       * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    +       * ASYNC_KNOWN_RATIO nodes.
    +       * 
    + * + * double ratio = 16; + * @return The ratio. + */ + double getRatio(); + + /** + *
    +       * Ratio identifies how many parallelism calls are introduced by one
    +       * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    +       * 
    + * + * double memory_ratio = 17; + * @return The memoryRatio. + */ + double getMemoryRatio(); + } + /** + *
    +     * General representation of a node in the model.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.Node} + */ + public static final class Node extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.Node) + NodeOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Node.class.getName()); + } + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Node() { + name_ = ""; + parameters_ = java.util.Collections.emptyList(); + inputs_ = emptyLongList(); + nodeClass_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.Node.class, org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder.class); + } + + public interface ParameterOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.Node.Parameter) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +         * Human-readable name of the parameter.
    +         * 
    + * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +         * Human-readable name of the parameter.
    +         * 
    + * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +         * Identifies the model value of the parameter. This can be different from
    +         * the actual value (e.g. during optimization search).
    +         * 
    + * + * double value = 2; + * @return The value. + */ + double getValue(); + + /** + *
    +         * The actual value of the parameter.
    +         * 
    + * + * double state_value = 3; + * @return The stateValue. + */ + double getStateValue(); + + /** + *
    +         * Minimum value of the parameter.
    +         * 
    + * + * double min = 4; + * @return The min. + */ + double getMin(); + + /** + *
    +         * Maximum value of the parameter.
    +         * 
    + * + * double max = 5; + * @return The max. + */ + double getMax(); + + /** + *
    +         * Identifies whether the parameter should participate in autotuning.
    +         * 
    + * + * bool tunable = 6; + * @return The tunable. + */ + boolean getTunable(); + } + /** + *
    +       * Represents a node parameter.
    +       * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.Node.Parameter} + */ + public static final class Parameter extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.Node.Parameter) + ParameterOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Parameter.class.getName()); + } + // Use Parameter.newBuilder() to construct. + private Parameter(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Parameter() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.class, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +         * Human-readable name of the parameter.
    +         * 
    + * + * string name = 1; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +         * Human-readable name of the parameter.
    +         * 
    + * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + 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 VALUE_FIELD_NUMBER = 2; + private double value_ = 0D; + /** + *
    +         * Identifies the model value of the parameter. This can be different from
    +         * the actual value (e.g. during optimization search).
    +         * 
    + * + * double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int STATE_VALUE_FIELD_NUMBER = 3; + private double stateValue_ = 0D; + /** + *
    +         * The actual value of the parameter.
    +         * 
    + * + * double state_value = 3; + * @return The stateValue. + */ + @java.lang.Override + public double getStateValue() { + return stateValue_; + } + + public static final int MIN_FIELD_NUMBER = 4; + private double min_ = 0D; + /** + *
    +         * Minimum value of the parameter.
    +         * 
    + * + * double min = 4; + * @return The min. + */ + @java.lang.Override + public double getMin() { + return min_; + } + + public static final int MAX_FIELD_NUMBER = 5; + private double max_ = 0D; + /** + *
    +         * Maximum value of the parameter.
    +         * 
    + * + * double max = 5; + * @return The max. + */ + @java.lang.Override + public double getMax() { + return max_; + } + + public static final int TUNABLE_FIELD_NUMBER = 6; + private boolean tunable_ = false; + /** + *
    +         * Identifies whether the parameter should participate in autotuning.
    +         * 
    + * + * bool tunable = 6; + * @return The tunable. + */ + @java.lang.Override + public boolean getTunable() { + return tunable_; + } + + 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(2, value_); + } + if (java.lang.Double.doubleToRawLongBits(stateValue_) != 0) { + output.writeDouble(3, stateValue_); + } + if (java.lang.Double.doubleToRawLongBits(min_) != 0) { + output.writeDouble(4, min_); + } + if (java.lang.Double.doubleToRawLongBits(max_) != 0) { + output.writeDouble(5, max_); + } + if (tunable_ != false) { + output.writeBool(6, tunable_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, value_); + } + if (java.lang.Double.doubleToRawLongBits(stateValue_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, stateValue_); + } + if (java.lang.Double.doubleToRawLongBits(min_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, min_); + } + if (java.lang.Double.doubleToRawLongBits(max_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(5, max_); + } + if (tunable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, tunable_); + } + size += getUnknownFields().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.model.Model.ModelProto.Node.Parameter)) { + return super.equals(obj); + } + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter other = (org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter) obj; + + if (!getName() + .equals(other.getName())) return false; + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits( + other.getValue())) return false; + if (java.lang.Double.doubleToLongBits(getStateValue()) + != java.lang.Double.doubleToLongBits( + other.getStateValue())) return false; + if (java.lang.Double.doubleToLongBits(getMin()) + != java.lang.Double.doubleToLongBits( + other.getMin())) return false; + if (java.lang.Double.doubleToLongBits(getMax()) + != java.lang.Double.doubleToLongBits( + other.getMax())) return false; + if (getTunable() + != other.getTunable()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getValue())); + hash = (37 * hash) + STATE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getStateValue())); + hash = (37 * hash) + MIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMin())); + hash = (37 * hash) + MAX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMax())); + hash = (37 * hash) + TUNABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTunable()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter 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.model.Model.ModelProto.Node.Parameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter 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.model.Model.ModelProto.Node.Parameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.model.Model.ModelProto.Node.Parameter 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +         * Represents a node parameter.
    +         * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.Node.Parameter} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.Node.Parameter) + org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.class, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder.class); + } + + // Construct using org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = 0D; + stateValue_ = 0D; + min_ = 0D; + max_ = 0D; + tunable_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter getDefaultInstanceForType() { + return org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter build() { + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter buildPartial() { + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter result = new org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.stateValue_ = stateValue_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.min_ = min_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.max_ = max_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.tunable_ = tunable_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter) { + return mergeFrom((org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter other) { + if (other == org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (other.getStateValue() != 0D) { + setStateValue(other.getStateValue()); + } + if (other.getMin() != 0D) { + setMin(other.getMin()); + } + if (other.getMax() != 0D) { + setMax(other.getMax()); + } + if (other.getTunable() != false) { + setTunable(other.getTunable()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: { + value_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 25: { + stateValue_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + min_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 41: { + max_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 48: { + tunable_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
    +           * Human-readable name of the parameter.
    +           * 
    + * + * string name = 1; + * @return The name. + */ + 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; + } + } + /** + *
    +           * Human-readable name of the parameter.
    +           * 
    + * + * string name = 1; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +           * Human-readable name of the parameter.
    +           * 
    + * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +           * Human-readable name of the parameter.
    +           * 
    + * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +           * Human-readable name of the parameter.
    +           * 
    + * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double value_ ; + /** + *
    +           * Identifies the model value of the parameter. This can be different from
    +           * the actual value (e.g. during optimization search).
    +           * 
    + * + * double value = 2; + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + *
    +           * Identifies the model value of the parameter. This can be different from
    +           * the actual value (e.g. during optimization search).
    +           * 
    + * + * double value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +           * Identifies the model value of the parameter. This can be different from
    +           * the actual value (e.g. during optimization search).
    +           * 
    + * + * double value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = 0D; + onChanged(); + return this; + } + + private double stateValue_ ; + /** + *
    +           * The actual value of the parameter.
    +           * 
    + * + * double state_value = 3; + * @return The stateValue. + */ + @java.lang.Override + public double getStateValue() { + return stateValue_; + } + /** + *
    +           * The actual value of the parameter.
    +           * 
    + * + * double state_value = 3; + * @param value The stateValue to set. + * @return This builder for chaining. + */ + public Builder setStateValue(double value) { + + stateValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +           * The actual value of the parameter.
    +           * 
    + * + * double state_value = 3; + * @return This builder for chaining. + */ + public Builder clearStateValue() { + bitField0_ = (bitField0_ & ~0x00000004); + stateValue_ = 0D; + onChanged(); + return this; + } + + private double min_ ; + /** + *
    +           * Minimum value of the parameter.
    +           * 
    + * + * double min = 4; + * @return The min. + */ + @java.lang.Override + public double getMin() { + return min_; + } + /** + *
    +           * Minimum value of the parameter.
    +           * 
    + * + * double min = 4; + * @param value The min to set. + * @return This builder for chaining. + */ + public Builder setMin(double value) { + + min_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +           * Minimum value of the parameter.
    +           * 
    + * + * double min = 4; + * @return This builder for chaining. + */ + public Builder clearMin() { + bitField0_ = (bitField0_ & ~0x00000008); + min_ = 0D; + onChanged(); + return this; + } + + private double max_ ; + /** + *
    +           * Maximum value of the parameter.
    +           * 
    + * + * double max = 5; + * @return The max. + */ + @java.lang.Override + public double getMax() { + return max_; + } + /** + *
    +           * Maximum value of the parameter.
    +           * 
    + * + * double max = 5; + * @param value The max to set. + * @return This builder for chaining. + */ + public Builder setMax(double value) { + + max_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +           * Maximum value of the parameter.
    +           * 
    + * + * double max = 5; + * @return This builder for chaining. + */ + public Builder clearMax() { + bitField0_ = (bitField0_ & ~0x00000010); + max_ = 0D; + onChanged(); + return this; + } + + private boolean tunable_ ; + /** + *
    +           * Identifies whether the parameter should participate in autotuning.
    +           * 
    + * + * bool tunable = 6; + * @return The tunable. + */ + @java.lang.Override + public boolean getTunable() { + return tunable_; + } + /** + *
    +           * Identifies whether the parameter should participate in autotuning.
    +           * 
    + * + * bool tunable = 6; + * @param value The tunable to set. + * @return This builder for chaining. + */ + public Builder setTunable(boolean value) { + + tunable_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +           * Identifies whether the parameter should participate in autotuning.
    +           * 
    + * + * bool tunable = 6; + * @return This builder for chaining. + */ + public Builder clearTunable() { + bitField0_ = (bitField0_ & ~0x00000020); + tunable_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.model.ModelProto.Node.Parameter) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.Node.Parameter) + private static final org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter(); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Parameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.model.Model.ModelProto.Node.Parameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
    +       * Unique node ID.
    +       * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +       * Human-readable name of the node.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +       * Human-readable name of the node.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 AUTOTUNE_FIELD_NUMBER = 3; + private boolean autotune_ = false; + /** + *
    +       * An indication whether autotuning is enabled for this node.
    +       * 
    + * + * bool autotune = 3; + * @return The autotune. + */ + @java.lang.Override + public boolean getAutotune() { + return autotune_; + } + + public static final int BUFFERED_BYTES_FIELD_NUMBER = 4; + private long bufferedBytes_ = 0L; + /** + *
    +       * The number of bytes stored in this node's buffer.
    +       * 
    + * + * int64 buffered_bytes = 4; + * @return The bufferedBytes. + */ + @java.lang.Override + public long getBufferedBytes() { + return bufferedBytes_; + } + + public static final int BUFFERED_ELEMENTS_FIELD_NUMBER = 5; + private long bufferedElements_ = 0L; + /** + *
    +       * The number of elements stored in this node's buffer.
    +       * 
    + * + * int64 buffered_elements = 5; + * @return The bufferedElements. + */ + @java.lang.Override + public long getBufferedElements() { + return bufferedElements_; + } + + public static final int BYTES_CONSUMED_FIELD_NUMBER = 6; + private long bytesConsumed_ = 0L; + /** + *
    +       * The number of bytes consumed by the node.
    +       * 
    + * + * int64 bytes_consumed = 6; + * @return The bytesConsumed. + */ + @java.lang.Override + public long getBytesConsumed() { + return bytesConsumed_; + } + + public static final int BYTES_PRODUCED_FIELD_NUMBER = 7; + private long bytesProduced_ = 0L; + /** + *
    +       * The number of bytes produced by the node.
    +       * 
    + * + * int64 bytes_produced = 7; + * @return The bytesProduced. + */ + @java.lang.Override + public long getBytesProduced() { + return bytesProduced_; + } + + public static final int NUM_ELEMENTS_FIELD_NUMBER = 8; + private long numElements_ = 0L; + /** + *
    +       * The number of elements produced by the node.
    +       * 
    + * + * int64 num_elements = 8; + * @return The numElements. + */ + @java.lang.Override + public long getNumElements() { + return numElements_; + } + + public static final int PROCESSING_TIME_FIELD_NUMBER = 9; + private long processingTime_ = 0L; + /** + *
    +       * The aggregate processing time spent in this node in nanoseconds.
    +       * 
    + * + * int64 processing_time = 9; + * @return The processingTime. + */ + @java.lang.Override + public long getProcessingTime() { + return processingTime_; + } + + public static final int RECORD_METRICS_FIELD_NUMBER = 10; + private boolean recordMetrics_ = false; + /** + *
    +       * An indication whether this node records metrics about produced and
    +       * consumed elements.
    +       * 
    + * + * bool record_metrics = 10; + * @return The recordMetrics. + */ + @java.lang.Override + public boolean getRecordMetrics() { + return recordMetrics_; + } + + public static final int PARAMETERS_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List parameters_; + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + @java.lang.Override + public java.util.List getParametersList() { + return parameters_; + } + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + @java.lang.Override + public java.util.List + getParametersOrBuilderList() { + return parameters_; + } + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + @java.lang.Override + public int getParametersCount() { + return parameters_.size(); + } + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter getParameters(int index) { + return parameters_.get(index); + } + /** + *
    +       * Parameters of this node.
    +       * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( + int index) { + return parameters_.get(index); + } + + public static final int INPUT_PROCESSING_TIME_SUM_FIELD_NUMBER = 12; + private double inputProcessingTimeSum_ = 0D; + /** + *
    +       * Statistic of inputs processing time history.
    +       * 
    + * + * double input_processing_time_sum = 12; + * @return The inputProcessingTimeSum. + */ + @java.lang.Override + public double getInputProcessingTimeSum() { + return inputProcessingTimeSum_; + } + + public static final int INPUT_PROCESSING_TIME_COUNT_FIELD_NUMBER = 13; + private long inputProcessingTimeCount_ = 0L; + /** + * int64 input_processing_time_count = 13; + * @return The inputProcessingTimeCount. + */ + @java.lang.Override + public long getInputProcessingTimeCount() { + return inputProcessingTimeCount_; + } + + public static final int INPUTS_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList inputs_ = + emptyLongList(); + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @return A list containing the inputs. + */ + @java.lang.Override + public java.util.List + getInputsList() { + return inputs_; + } + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @return The count of inputs. + */ + public int getInputsCount() { + return inputs_.size(); + } + /** + *
    +       * IDs of inputs of this node.
    +       * 
    + * + * repeated int64 inputs = 14; + * @param index The index of the element to return. + * @return The inputs at the given index. + */ + public long getInputs(int index) { + return inputs_.getLong(index); + } + private int inputsMemoizedSerializedSize = -1; + + public static final int NODE_CLASS_FIELD_NUMBER = 15; + private int nodeClass_ = 0; + /** + *
    +       * Class of this node.
    +       * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The enum numeric value on the wire for nodeClass. + */ + @java.lang.Override public int getNodeClassValue() { + return nodeClass_; + } + /** + *
    +       * Class of this node.
    +       * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The nodeClass. + */ + @java.lang.Override public org.tensorflow.proto.data.model.Model.NodeClass getNodeClass() { + org.tensorflow.proto.data.model.Model.NodeClass result = org.tensorflow.proto.data.model.Model.NodeClass.forNumber(nodeClass_); + return result == null ? org.tensorflow.proto.data.model.Model.NodeClass.UNRECOGNIZED : result; + } + + public static final int RATIO_FIELD_NUMBER = 16; + private double ratio_ = 0D; + /** + *
    +       * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    +       * ASYNC_KNOWN_RATIO nodes.
    +       * 
    + * + * double ratio = 16; + * @return The ratio. + */ + @java.lang.Override + public double getRatio() { + return ratio_; + } + + public static final int MEMORY_RATIO_FIELD_NUMBER = 17; + private double memoryRatio_ = 0D; + /** + *
    +       * Ratio identifies how many parallelism calls are introduced by one
    +       * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    +       * 
    + * + * double memory_ratio = 17; + * @return The memoryRatio. + */ + @java.lang.Override + public double getMemoryRatio() { + return memoryRatio_; + } + + 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 { + getSerializedSize(); + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (autotune_ != false) { + output.writeBool(3, autotune_); + } + if (bufferedBytes_ != 0L) { + output.writeInt64(4, bufferedBytes_); + } + if (bufferedElements_ != 0L) { + output.writeInt64(5, bufferedElements_); + } + if (bytesConsumed_ != 0L) { + output.writeInt64(6, bytesConsumed_); + } + if (bytesProduced_ != 0L) { + output.writeInt64(7, bytesProduced_); + } + if (numElements_ != 0L) { + output.writeInt64(8, numElements_); + } + if (processingTime_ != 0L) { + output.writeInt64(9, processingTime_); + } + if (recordMetrics_ != false) { + output.writeBool(10, recordMetrics_); + } + for (int i = 0; i < parameters_.size(); i++) { + output.writeMessage(11, parameters_.get(i)); + } + if (java.lang.Double.doubleToRawLongBits(inputProcessingTimeSum_) != 0) { + output.writeDouble(12, inputProcessingTimeSum_); + } + if (inputProcessingTimeCount_ != 0L) { + output.writeInt64(13, inputProcessingTimeCount_); + } + if (getInputsList().size() > 0) { + output.writeUInt32NoTag(114); + output.writeUInt32NoTag(inputsMemoizedSerializedSize); + } + for (int i = 0; i < inputs_.size(); i++) { + output.writeInt64NoTag(inputs_.getLong(i)); + } + if (nodeClass_ != org.tensorflow.proto.data.model.Model.NodeClass.UNKNOWN.getNumber()) { + output.writeEnum(15, nodeClass_); + } + if (java.lang.Double.doubleToRawLongBits(ratio_) != 0) { + output.writeDouble(16, ratio_); + } + if (java.lang.Double.doubleToRawLongBits(memoryRatio_) != 0) { + output.writeDouble(17, memoryRatio_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (autotune_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, autotune_); + } + if (bufferedBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, bufferedBytes_); + } + if (bufferedElements_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, bufferedElements_); + } + if (bytesConsumed_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, bytesConsumed_); + } + if (bytesProduced_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, bytesProduced_); + } + if (numElements_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, numElements_); + } + if (processingTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, processingTime_); + } + if (recordMetrics_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(10, recordMetrics_); + } + for (int i = 0; i < parameters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, parameters_.get(i)); + } + if (java.lang.Double.doubleToRawLongBits(inputProcessingTimeSum_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(12, inputProcessingTimeSum_); + } + if (inputProcessingTimeCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(13, inputProcessingTimeCount_); + } + { + int dataSize = 0; + for (int i = 0; i < inputs_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(inputs_.getLong(i)); + } + size += dataSize; + if (!getInputsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + inputsMemoizedSerializedSize = dataSize; + } + if (nodeClass_ != org.tensorflow.proto.data.model.Model.NodeClass.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(15, nodeClass_); + } + if (java.lang.Double.doubleToRawLongBits(ratio_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(16, ratio_); + } + if (java.lang.Double.doubleToRawLongBits(memoryRatio_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(17, memoryRatio_); + } + size += getUnknownFields().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.model.Model.ModelProto.Node)) { + return super.equals(obj); + } + org.tensorflow.proto.data.model.Model.ModelProto.Node other = (org.tensorflow.proto.data.model.Model.ModelProto.Node) obj; + + if (getId() + != other.getId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (getAutotune() + != other.getAutotune()) return false; + if (getBufferedBytes() + != other.getBufferedBytes()) return false; + if (getBufferedElements() + != other.getBufferedElements()) return false; + if (getBytesConsumed() + != other.getBytesConsumed()) return false; + if (getBytesProduced() + != other.getBytesProduced()) return false; + if (getNumElements() + != other.getNumElements()) return false; + if (getProcessingTime() + != other.getProcessingTime()) return false; + if (getRecordMetrics() + != other.getRecordMetrics()) return false; + if (!getParametersList() + .equals(other.getParametersList())) return false; + if (java.lang.Double.doubleToLongBits(getInputProcessingTimeSum()) + != java.lang.Double.doubleToLongBits( + other.getInputProcessingTimeSum())) return false; + if (getInputProcessingTimeCount() + != other.getInputProcessingTimeCount()) return false; + if (!getInputsList() + .equals(other.getInputsList())) return false; + if (nodeClass_ != other.nodeClass_) return false; + if (java.lang.Double.doubleToLongBits(getRatio()) + != java.lang.Double.doubleToLongBits( + other.getRatio())) return false; + if (java.lang.Double.doubleToLongBits(getMemoryRatio()) + != java.lang.Double.doubleToLongBits( + other.getMemoryRatio())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + AUTOTUNE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAutotune()); + hash = (37 * hash) + BUFFERED_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBufferedBytes()); + hash = (37 * hash) + BUFFERED_ELEMENTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBufferedElements()); + hash = (37 * hash) + BYTES_CONSUMED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBytesConsumed()); + hash = (37 * hash) + BYTES_PRODUCED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getBytesProduced()); + hash = (37 * hash) + NUM_ELEMENTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumElements()); + hash = (37 * hash) + PROCESSING_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getProcessingTime()); + hash = (37 * hash) + RECORD_METRICS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRecordMetrics()); + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (37 * hash) + INPUT_PROCESSING_TIME_SUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getInputProcessingTimeSum())); + hash = (37 * hash) + INPUT_PROCESSING_TIME_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInputProcessingTimeCount()); + if (getInputsCount() > 0) { + hash = (37 * hash) + INPUTS_FIELD_NUMBER; + hash = (53 * hash) + getInputsList().hashCode(); + } + hash = (37 * hash) + NODE_CLASS_FIELD_NUMBER; + hash = (53 * hash) + nodeClass_; + hash = (37 * hash) + RATIO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRatio())); + hash = (37 * hash) + MEMORY_RATIO_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getMemoryRatio())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node 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.model.Model.ModelProto.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node 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.model.Model.ModelProto.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.Node parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.model.Model.ModelProto.Node 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * General representation of a node in the model.
    +       * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.Node} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.Node) + org.tensorflow.proto.data.model.Model.ModelProto.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.Node.class, org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder.class); + } + + // Construct using org.tensorflow.proto.data.model.Model.ModelProto.Node.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + name_ = ""; + autotune_ = false; + bufferedBytes_ = 0L; + bufferedElements_ = 0L; + bytesConsumed_ = 0L; + bytesProduced_ = 0L; + numElements_ = 0L; + processingTime_ = 0L; + recordMetrics_ = false; + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + } else { + parameters_ = null; + parametersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + inputProcessingTimeSum_ = 0D; + inputProcessingTimeCount_ = 0L; + inputs_ = emptyLongList(); + nodeClass_ = 0; + ratio_ = 0D; + memoryRatio_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_Node_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node getDefaultInstanceForType() { + return org.tensorflow.proto.data.model.Model.ModelProto.Node.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node build() { + org.tensorflow.proto.data.model.Model.ModelProto.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node buildPartial() { + org.tensorflow.proto.data.model.Model.ModelProto.Node result = new org.tensorflow.proto.data.model.Model.ModelProto.Node(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.data.model.Model.ModelProto.Node result) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.data.model.Model.ModelProto.Node result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.autotune_ = autotune_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bufferedBytes_ = bufferedBytes_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bufferedElements_ = bufferedElements_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.bytesConsumed_ = bytesConsumed_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.bytesProduced_ = bytesProduced_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.numElements_ = numElements_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.processingTime_ = processingTime_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.recordMetrics_ = recordMetrics_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.inputProcessingTimeSum_ = inputProcessingTimeSum_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.inputProcessingTimeCount_ = inputProcessingTimeCount_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + inputs_.makeImmutable(); + result.inputs_ = inputs_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.nodeClass_ = nodeClass_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.ratio_ = ratio_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.memoryRatio_ = memoryRatio_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.model.Model.ModelProto.Node) { + return mergeFrom((org.tensorflow.proto.data.model.Model.ModelProto.Node)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.model.Model.ModelProto.Node other) { + if (other == org.tensorflow.proto.data.model.Model.ModelProto.Node.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getAutotune() != false) { + setAutotune(other.getAutotune()); + } + if (other.getBufferedBytes() != 0L) { + setBufferedBytes(other.getBufferedBytes()); + } + if (other.getBufferedElements() != 0L) { + setBufferedElements(other.getBufferedElements()); + } + if (other.getBytesConsumed() != 0L) { + setBytesConsumed(other.getBytesConsumed()); + } + if (other.getBytesProduced() != 0L) { + setBytesProduced(other.getBytesProduced()); + } + if (other.getNumElements() != 0L) { + setNumElements(other.getNumElements()); + } + if (other.getProcessingTime() != 0L) { + setProcessingTime(other.getProcessingTime()); + } + if (other.getRecordMetrics() != false) { + setRecordMetrics(other.getRecordMetrics()); + } + if (parametersBuilder_ == null) { + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + } else { + if (!other.parameters_.isEmpty()) { + if (parametersBuilder_.isEmpty()) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000400); + parametersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getParametersFieldBuilder() : null; + } else { + parametersBuilder_.addAllMessages(other.parameters_); + } + } + } + if (other.getInputProcessingTimeSum() != 0D) { + setInputProcessingTimeSum(other.getInputProcessingTimeSum()); + } + if (other.getInputProcessingTimeCount() != 0L) { + setInputProcessingTimeCount(other.getInputProcessingTimeCount()); + } + if (!other.inputs_.isEmpty()) { + if (inputs_.isEmpty()) { + inputs_ = other.inputs_; + inputs_.makeImmutable(); + bitField0_ |= 0x00002000; + } else { + ensureInputsIsMutable(); + inputs_.addAll(other.inputs_); + } + onChanged(); + } + if (other.nodeClass_ != 0) { + setNodeClassValue(other.getNodeClassValue()); + } + if (other.getRatio() != 0D) { + setRatio(other.getRatio()); + } + if (other.getMemoryRatio() != 0D) { + setMemoryRatio(other.getMemoryRatio()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + autotune_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + bufferedBytes_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + bufferedElements_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + bytesConsumed_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + bytesProduced_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + numElements_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + processingTime_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + recordMetrics_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: { + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter m = + input.readMessage( + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.parser(), + extensionRegistry); + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(m); + } else { + parametersBuilder_.addMessage(m); + } + break; + } // case 90 + case 97: { + inputProcessingTimeSum_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 97 + case 104: { + inputProcessingTimeCount_ = input.readInt64(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + long v = input.readInt64(); + ensureInputsIsMutable(); + inputs_.addLong(v); + break; + } // case 112 + case 114: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureInputsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + inputs_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 114 + case 120: { + nodeClass_ = input.readEnum(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 129: { + ratio_ = input.readDouble(); + bitField0_ |= 0x00008000; + break; + } // case 129 + case 137: { + memoryRatio_ = input.readDouble(); + bitField0_ |= 0x00010000; + break; + } // case 137 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
    +         * Unique node ID.
    +         * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
    +         * Unique node ID.
    +         * 
    + * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Unique node ID.
    +         * 
    + * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +         * Human-readable name of the node.
    +         * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +         * Human-readable name of the node.
    +         * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +         * Human-readable name of the node.
    +         * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Human-readable name of the node.
    +         * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +         * Human-readable name of the node.
    +         * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean autotune_ ; + /** + *
    +         * An indication whether autotuning is enabled for this node.
    +         * 
    + * + * bool autotune = 3; + * @return The autotune. + */ + @java.lang.Override + public boolean getAutotune() { + return autotune_; + } + /** + *
    +         * An indication whether autotuning is enabled for this node.
    +         * 
    + * + * bool autotune = 3; + * @param value The autotune to set. + * @return This builder for chaining. + */ + public Builder setAutotune(boolean value) { + + autotune_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * An indication whether autotuning is enabled for this node.
    +         * 
    + * + * bool autotune = 3; + * @return This builder for chaining. + */ + public Builder clearAutotune() { + bitField0_ = (bitField0_ & ~0x00000004); + autotune_ = false; + onChanged(); + return this; + } + + private long bufferedBytes_ ; + /** + *
    +         * The number of bytes stored in this node's buffer.
    +         * 
    + * + * int64 buffered_bytes = 4; + * @return The bufferedBytes. + */ + @java.lang.Override + public long getBufferedBytes() { + return bufferedBytes_; + } + /** + *
    +         * The number of bytes stored in this node's buffer.
    +         * 
    + * + * int64 buffered_bytes = 4; + * @param value The bufferedBytes to set. + * @return This builder for chaining. + */ + public Builder setBufferedBytes(long value) { + + bufferedBytes_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +         * The number of bytes stored in this node's buffer.
    +         * 
    + * + * int64 buffered_bytes = 4; + * @return This builder for chaining. + */ + public Builder clearBufferedBytes() { + bitField0_ = (bitField0_ & ~0x00000008); + bufferedBytes_ = 0L; + onChanged(); + return this; + } + + private long bufferedElements_ ; + /** + *
    +         * The number of elements stored in this node's buffer.
    +         * 
    + * + * int64 buffered_elements = 5; + * @return The bufferedElements. + */ + @java.lang.Override + public long getBufferedElements() { + return bufferedElements_; + } + /** + *
    +         * The number of elements stored in this node's buffer.
    +         * 
    + * + * int64 buffered_elements = 5; + * @param value The bufferedElements to set. + * @return This builder for chaining. + */ + public Builder setBufferedElements(long value) { + + bufferedElements_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +         * The number of elements stored in this node's buffer.
    +         * 
    + * + * int64 buffered_elements = 5; + * @return This builder for chaining. + */ + public Builder clearBufferedElements() { + bitField0_ = (bitField0_ & ~0x00000010); + bufferedElements_ = 0L; + onChanged(); + return this; + } + + private long bytesConsumed_ ; + /** + *
    +         * The number of bytes consumed by the node.
    +         * 
    + * + * int64 bytes_consumed = 6; + * @return The bytesConsumed. + */ + @java.lang.Override + public long getBytesConsumed() { + return bytesConsumed_; + } + /** + *
    +         * The number of bytes consumed by the node.
    +         * 
    + * + * int64 bytes_consumed = 6; + * @param value The bytesConsumed to set. + * @return This builder for chaining. + */ + public Builder setBytesConsumed(long value) { + + bytesConsumed_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +         * The number of bytes consumed by the node.
    +         * 
    + * + * int64 bytes_consumed = 6; + * @return This builder for chaining. + */ + public Builder clearBytesConsumed() { + bitField0_ = (bitField0_ & ~0x00000020); + bytesConsumed_ = 0L; + onChanged(); + return this; + } + + private long bytesProduced_ ; + /** + *
    +         * The number of bytes produced by the node.
    +         * 
    + * + * int64 bytes_produced = 7; + * @return The bytesProduced. + */ + @java.lang.Override + public long getBytesProduced() { + return bytesProduced_; + } + /** + *
    +         * The number of bytes produced by the node.
    +         * 
    + * + * int64 bytes_produced = 7; + * @param value The bytesProduced to set. + * @return This builder for chaining. + */ + public Builder setBytesProduced(long value) { + + bytesProduced_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
    +         * The number of bytes produced by the node.
    +         * 
    + * + * int64 bytes_produced = 7; + * @return This builder for chaining. + */ + public Builder clearBytesProduced() { + bitField0_ = (bitField0_ & ~0x00000040); + bytesProduced_ = 0L; + onChanged(); + return this; + } + + private long numElements_ ; + /** + *
    +         * The number of elements produced by the node.
    +         * 
    + * + * int64 num_elements = 8; + * @return The numElements. + */ + @java.lang.Override + public long getNumElements() { + return numElements_; + } + /** + *
    +         * The number of elements produced by the node.
    +         * 
    + * + * int64 num_elements = 8; + * @param value The numElements to set. + * @return This builder for chaining. + */ + public Builder setNumElements(long value) { + + numElements_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
    +         * The number of elements produced by the node.
    +         * 
    + * + * int64 num_elements = 8; + * @return This builder for chaining. + */ + public Builder clearNumElements() { + bitField0_ = (bitField0_ & ~0x00000080); + numElements_ = 0L; + onChanged(); + return this; + } + + private long processingTime_ ; + /** + *
    +         * The aggregate processing time spent in this node in nanoseconds.
    +         * 
    + * + * int64 processing_time = 9; + * @return The processingTime. + */ + @java.lang.Override + public long getProcessingTime() { + return processingTime_; + } + /** + *
    +         * The aggregate processing time spent in this node in nanoseconds.
    +         * 
    + * + * int64 processing_time = 9; + * @param value The processingTime to set. + * @return This builder for chaining. + */ + public Builder setProcessingTime(long value) { + + processingTime_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
    +         * The aggregate processing time spent in this node in nanoseconds.
    +         * 
    + * + * int64 processing_time = 9; + * @return This builder for chaining. + */ + public Builder clearProcessingTime() { + bitField0_ = (bitField0_ & ~0x00000100); + processingTime_ = 0L; + onChanged(); + return this; + } + + private boolean recordMetrics_ ; + /** + *
    +         * An indication whether this node records metrics about produced and
    +         * consumed elements.
    +         * 
    + * + * bool record_metrics = 10; + * @return The recordMetrics. + */ + @java.lang.Override + public boolean getRecordMetrics() { + return recordMetrics_; + } + /** + *
    +         * An indication whether this node records metrics about produced and
    +         * consumed elements.
    +         * 
    + * + * bool record_metrics = 10; + * @param value The recordMetrics to set. + * @return This builder for chaining. + */ + public Builder setRecordMetrics(boolean value) { + + recordMetrics_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
    +         * An indication whether this node records metrics about produced and
    +         * consumed elements.
    +         * 
    + * + * bool record_metrics = 10; + * @return This builder for chaining. + */ + public Builder clearRecordMetrics() { + bitField0_ = (bitField0_ & ~0x00000200); + recordMetrics_ = false; + onChanged(); + return this; + } + + private java.util.List parameters_ = + java.util.Collections.emptyList(); + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + parameters_ = new java.util.ArrayList(parameters_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder> parametersBuilder_; + + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public java.util.List getParametersList() { + if (parametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameters_); + } else { + return parametersBuilder_.getMessageList(); + } + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public int getParametersCount() { + if (parametersBuilder_ == null) { + return parameters_.size(); + } else { + return parametersBuilder_.getCount(); + } + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter getParameters(int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessage(index); + } + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder setParameters( + int index, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + } else { + parametersBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder setParameters( + int index, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.set(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder addParameters(org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + } else { + parametersBuilder_.addMessage(value); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder addParameters( + int index, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(index, value); + onChanged(); + } else { + parametersBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder addParameters( + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder addParameters( + int index, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder addAllParameters( + java.lang.Iterable values) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, parameters_); + onChanged(); + } else { + parametersBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + parametersBuilder_.clear(); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public Builder removeParameters(int index) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.remove(index); + onChanged(); + } else { + parametersBuilder_.remove(index); + } + return this; + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder getParametersBuilder( + int index) { + return getParametersFieldBuilder().getBuilder(index); + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder getParametersOrBuilder( + int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); } else { + return parametersBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public java.util.List + getParametersOrBuilderList() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameters_); + } + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder addParametersBuilder() { + return getParametersFieldBuilder().addBuilder( + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.getDefaultInstance()); + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder addParametersBuilder( + int index) { + return getParametersFieldBuilder().addBuilder( + index, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.getDefaultInstance()); + } + /** + *
    +         * Parameters of this node.
    +         * 
    + * + * repeated .tensorflow.data.model.ModelProto.Node.Parameter parameters = 11; + */ + public java.util.List + getParametersBuilderList() { + return getParametersFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder> + getParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter, org.tensorflow.proto.data.model.Model.ModelProto.Node.Parameter.Builder, org.tensorflow.proto.data.model.Model.ModelProto.Node.ParameterOrBuilder>( + parameters_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private double inputProcessingTimeSum_ ; + /** + *
    +         * Statistic of inputs processing time history.
    +         * 
    + * + * double input_processing_time_sum = 12; + * @return The inputProcessingTimeSum. + */ + @java.lang.Override + public double getInputProcessingTimeSum() { + return inputProcessingTimeSum_; + } + /** + *
    +         * Statistic of inputs processing time history.
    +         * 
    + * + * double input_processing_time_sum = 12; + * @param value The inputProcessingTimeSum to set. + * @return This builder for chaining. + */ + public Builder setInputProcessingTimeSum(double value) { + + inputProcessingTimeSum_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + *
    +         * Statistic of inputs processing time history.
    +         * 
    + * + * double input_processing_time_sum = 12; + * @return This builder for chaining. + */ + public Builder clearInputProcessingTimeSum() { + bitField0_ = (bitField0_ & ~0x00000800); + inputProcessingTimeSum_ = 0D; + onChanged(); + return this; + } + + private long inputProcessingTimeCount_ ; + /** + * int64 input_processing_time_count = 13; + * @return The inputProcessingTimeCount. + */ + @java.lang.Override + public long getInputProcessingTimeCount() { + return inputProcessingTimeCount_; + } + /** + * int64 input_processing_time_count = 13; + * @param value The inputProcessingTimeCount to set. + * @return This builder for chaining. + */ + public Builder setInputProcessingTimeCount(long value) { + + inputProcessingTimeCount_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int64 input_processing_time_count = 13; + * @return This builder for chaining. + */ + public Builder clearInputProcessingTimeCount() { + bitField0_ = (bitField0_ & ~0x00001000); + inputProcessingTimeCount_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList inputs_ = emptyLongList(); + private void ensureInputsIsMutable() { + if (!inputs_.isModifiable()) { + inputs_ = makeMutableCopy(inputs_); + } + bitField0_ |= 0x00002000; + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @return A list containing the inputs. + */ + public java.util.List + getInputsList() { + inputs_.makeImmutable(); + return inputs_; + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @return The count of inputs. + */ + public int getInputsCount() { + return inputs_.size(); + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @param index The index of the element to return. + * @return The inputs at the given index. + */ + public long getInputs(int index) { + return inputs_.getLong(index); + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @param index The index to set the value at. + * @param value The inputs to set. + * @return This builder for chaining. + */ + public Builder setInputs( + int index, long value) { + + ensureInputsIsMutable(); + inputs_.setLong(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @param value The inputs to add. + * @return This builder for chaining. + */ + public Builder addInputs(long value) { + + ensureInputsIsMutable(); + inputs_.addLong(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @param values The inputs to add. + * @return This builder for chaining. + */ + public Builder addAllInputs( + java.lang.Iterable values) { + ensureInputsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputs_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
    +         * IDs of inputs of this node.
    +         * 
    + * + * repeated int64 inputs = 14; + * @return This builder for chaining. + */ + public Builder clearInputs() { + inputs_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + private int nodeClass_ = 0; + /** + *
    +         * Class of this node.
    +         * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The enum numeric value on the wire for nodeClass. + */ + @java.lang.Override public int getNodeClassValue() { + return nodeClass_; + } + /** + *
    +         * Class of this node.
    +         * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @param value The enum numeric value on the wire for nodeClass to set. + * @return This builder for chaining. + */ + public Builder setNodeClassValue(int value) { + nodeClass_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + *
    +         * Class of this node.
    +         * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return The nodeClass. + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.NodeClass getNodeClass() { + org.tensorflow.proto.data.model.Model.NodeClass result = org.tensorflow.proto.data.model.Model.NodeClass.forNumber(nodeClass_); + return result == null ? org.tensorflow.proto.data.model.Model.NodeClass.UNRECOGNIZED : result; + } + /** + *
    +         * Class of this node.
    +         * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @param value The nodeClass to set. + * @return This builder for chaining. + */ + public Builder setNodeClass(org.tensorflow.proto.data.model.Model.NodeClass value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + nodeClass_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +         * Class of this node.
    +         * 
    + * + * .tensorflow.data.model.NodeClass node_class = 15; + * @return This builder for chaining. + */ + public Builder clearNodeClass() { + bitField0_ = (bitField0_ & ~0x00004000); + nodeClass_ = 0; + onChanged(); + return this; + } + + private double ratio_ ; + /** + *
    +         * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    +         * ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double ratio = 16; + * @return The ratio. + */ + @java.lang.Override + public double getRatio() { + return ratio_; + } + /** + *
    +         * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    +         * ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double ratio = 16; + * @param value The ratio to set. + * @return This builder for chaining. + */ + public Builder setRatio(double value) { + + ratio_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
    +         * Ratio of input to output elements. This is only used by KNOWN_RATIO and
    +         * ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double ratio = 16; + * @return This builder for chaining. + */ + public Builder clearRatio() { + bitField0_ = (bitField0_ & ~0x00008000); + ratio_ = 0D; + onChanged(); + return this; + } + + private double memoryRatio_ ; + /** + *
    +         * Ratio identifies how many parallelism calls are introduced by one
    +         * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double memory_ratio = 17; + * @return The memoryRatio. + */ + @java.lang.Override + public double getMemoryRatio() { + return memoryRatio_; + } + /** + *
    +         * Ratio identifies how many parallelism calls are introduced by one
    +         * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double memory_ratio = 17; + * @param value The memoryRatio to set. + * @return This builder for chaining. + */ + public Builder setMemoryRatio(double value) { + + memoryRatio_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + *
    +         * Ratio identifies how many parallelism calls are introduced by one
    +         * buffered element. This is only used by ASYNC_KNOWN_RATIO nodes.
    +         * 
    + * + * double memory_ratio = 17; + * @return This builder for chaining. + */ + public Builder clearMemoryRatio() { + bitField0_ = (bitField0_ & ~0x00010000); + memoryRatio_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.model.ModelProto.Node) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.Node) + private static final org.tensorflow.proto.data.model.Model.ModelProto.Node DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.Model.ModelProto.Node(); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.Node getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Node parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.model.Model.ModelProto.Node getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface OptimizationParamsOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.data.model.ModelProto.OptimizationParams) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +       * Algorithm used for autotuning optimization.
    +       * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The enum numeric value on the wire for algorithm. + */ + int getAlgorithmValue(); + /** + *
    +       * Algorithm used for autotuning optimization.
    +       * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The algorithm. + */ + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAlgorithm(); + + /** + *
    +       * Number of available logical threads.
    +       * 
    + * + * int64 cpu_budget = 2; + * @return The cpuBudget. + */ + long getCpuBudget(); + + /** + *
    +       * Amount of available memory in bytes.
    +       * 
    + * + * int64 ram_budget = 3; + * @return The ramBudget. + */ + long getRamBudget(); + + /** + *
    +       * Time between two consecutive `GetNext` calls to the iterator represented
    +       * by the output node.
    +       * 
    + * + * double model_input_time = 4; + * @return The modelInputTime. + */ + double getModelInputTime(); + } + /** + *
    +     * Contains parameters of the model autotuning optimization.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.OptimizationParams} + */ + public static final class OptimizationParams extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.data.model.ModelProto.OptimizationParams) + OptimizationParamsOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + OptimizationParams.class.getName()); + } + // Use OptimizationParams.newBuilder() to construct. + private OptimizationParams(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OptimizationParams() { + algorithm_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.class, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder.class); + } + + public static final int ALGORITHM_FIELD_NUMBER = 1; + private int algorithm_ = 0; + /** + *
    +       * Algorithm used for autotuning optimization.
    +       * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The enum numeric value on the wire for algorithm. + */ + @java.lang.Override public int getAlgorithmValue() { + return algorithm_; + } + /** + *
    +       * Algorithm used for autotuning optimization.
    +       * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The algorithm. + */ + @java.lang.Override public org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAlgorithm() { + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.forNumber(algorithm_); + return result == null ? org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.UNRECOGNIZED : result; + } + + public static final int CPU_BUDGET_FIELD_NUMBER = 2; + private long cpuBudget_ = 0L; + /** + *
    +       * Number of available logical threads.
    +       * 
    + * + * int64 cpu_budget = 2; + * @return The cpuBudget. + */ + @java.lang.Override + public long getCpuBudget() { + return cpuBudget_; + } + + public static final int RAM_BUDGET_FIELD_NUMBER = 3; + private long ramBudget_ = 0L; + /** + *
    +       * Amount of available memory in bytes.
    +       * 
    + * + * int64 ram_budget = 3; + * @return The ramBudget. + */ + @java.lang.Override + public long getRamBudget() { + return ramBudget_; + } + + public static final int MODEL_INPUT_TIME_FIELD_NUMBER = 4; + private double modelInputTime_ = 0D; + /** + *
    +       * Time between two consecutive `GetNext` calls to the iterator represented
    +       * by the output node.
    +       * 
    + * + * double model_input_time = 4; + * @return The modelInputTime. + */ + @java.lang.Override + public double getModelInputTime() { + return modelInputTime_; + } + + 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 (algorithm_ != org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.DEFAULT.getNumber()) { + output.writeEnum(1, algorithm_); + } + if (cpuBudget_ != 0L) { + output.writeInt64(2, cpuBudget_); + } + if (ramBudget_ != 0L) { + output.writeInt64(3, ramBudget_); + } + if (java.lang.Double.doubleToRawLongBits(modelInputTime_) != 0) { + output.writeDouble(4, modelInputTime_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (algorithm_ != org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, algorithm_); + } + if (cpuBudget_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, cpuBudget_); + } + if (ramBudget_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, ramBudget_); + } + if (java.lang.Double.doubleToRawLongBits(modelInputTime_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, modelInputTime_); + } + size += getUnknownFields().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.model.Model.ModelProto.OptimizationParams)) { + return super.equals(obj); + } + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams other = (org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams) obj; + + if (algorithm_ != other.algorithm_) return false; + if (getCpuBudget() + != other.getCpuBudget()) return false; + if (getRamBudget() + != other.getRamBudget()) return false; + if (java.lang.Double.doubleToLongBits(getModelInputTime()) + != java.lang.Double.doubleToLongBits( + other.getModelInputTime())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + algorithm_; + hash = (37 * hash) + CPU_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCpuBudget()); + hash = (37 * hash) + RAM_BUDGET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRamBudget()); + hash = (37 * hash) + MODEL_INPUT_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getModelInputTime())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams 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.model.Model.ModelProto.OptimizationParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams 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.model.Model.ModelProto.OptimizationParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.model.Model.ModelProto.OptimizationParams 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +       * Contains parameters of the model autotuning optimization.
    +       * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto.OptimizationParams} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto.OptimizationParams) + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.class, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder.class); + } + + // Construct using org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + algorithm_ = 0; + cpuBudget_ = 0L; + ramBudget_ = 0L; + modelInputTime_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams getDefaultInstanceForType() { + return org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams build() { + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams buildPartial() { + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams result = new org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.algorithm_ = algorithm_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cpuBudget_ = cpuBudget_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ramBudget_ = ramBudget_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.modelInputTime_ = modelInputTime_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams) { + return mergeFrom((org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams other) { + if (other == org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance()) return this; + if (other.algorithm_ != 0) { + setAlgorithmValue(other.getAlgorithmValue()); + } + if (other.getCpuBudget() != 0L) { + setCpuBudget(other.getCpuBudget()); + } + if (other.getRamBudget() != 0L) { + setRamBudget(other.getRamBudget()); + } + if (other.getModelInputTime() != 0D) { + setModelInputTime(other.getModelInputTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + algorithm_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + cpuBudget_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + ramBudget_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 33: { + modelInputTime_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int algorithm_ = 0; + /** + *
    +         * Algorithm used for autotuning optimization.
    +         * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The enum numeric value on the wire for algorithm. + */ + @java.lang.Override public int getAlgorithmValue() { + return algorithm_; + } + /** + *
    +         * Algorithm used for autotuning optimization.
    +         * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @param value The enum numeric value on the wire for algorithm to set. + * @return This builder for chaining. + */ + public Builder setAlgorithmValue(int value) { + algorithm_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +         * Algorithm used for autotuning optimization.
    +         * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return The algorithm. + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.AutotuneAlgorithm getAlgorithm() { + org.tensorflow.proto.data.model.Model.AutotuneAlgorithm result = org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.forNumber(algorithm_); + return result == null ? org.tensorflow.proto.data.model.Model.AutotuneAlgorithm.UNRECOGNIZED : result; + } + /** + *
    +         * Algorithm used for autotuning optimization.
    +         * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @param value The algorithm to set. + * @return This builder for chaining. + */ + public Builder setAlgorithm(org.tensorflow.proto.data.model.Model.AutotuneAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + algorithm_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +         * Algorithm used for autotuning optimization.
    +         * 
    + * + * .tensorflow.data.model.AutotuneAlgorithm algorithm = 1; + * @return This builder for chaining. + */ + public Builder clearAlgorithm() { + bitField0_ = (bitField0_ & ~0x00000001); + algorithm_ = 0; + onChanged(); + return this; + } + + private long cpuBudget_ ; + /** + *
    +         * Number of available logical threads.
    +         * 
    + * + * int64 cpu_budget = 2; + * @return The cpuBudget. + */ + @java.lang.Override + public long getCpuBudget() { + return cpuBudget_; + } + /** + *
    +         * Number of available logical threads.
    +         * 
    + * + * int64 cpu_budget = 2; + * @param value The cpuBudget to set. + * @return This builder for chaining. + */ + public Builder setCpuBudget(long value) { + + cpuBudget_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +         * Number of available logical threads.
    +         * 
    + * + * int64 cpu_budget = 2; + * @return This builder for chaining. + */ + public Builder clearCpuBudget() { + bitField0_ = (bitField0_ & ~0x00000002); + cpuBudget_ = 0L; + onChanged(); + return this; + } + + private long ramBudget_ ; + /** + *
    +         * Amount of available memory in bytes.
    +         * 
    + * + * int64 ram_budget = 3; + * @return The ramBudget. + */ + @java.lang.Override + public long getRamBudget() { + return ramBudget_; + } + /** + *
    +         * Amount of available memory in bytes.
    +         * 
    + * + * int64 ram_budget = 3; + * @param value The ramBudget to set. + * @return This builder for chaining. + */ + public Builder setRamBudget(long value) { + + ramBudget_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +         * Amount of available memory in bytes.
    +         * 
    + * + * int64 ram_budget = 3; + * @return This builder for chaining. + */ + public Builder clearRamBudget() { + bitField0_ = (bitField0_ & ~0x00000004); + ramBudget_ = 0L; + onChanged(); + return this; + } + + private double modelInputTime_ ; + /** + *
    +         * Time between two consecutive `GetNext` calls to the iterator represented
    +         * by the output node.
    +         * 
    + * + * double model_input_time = 4; + * @return The modelInputTime. + */ + @java.lang.Override + public double getModelInputTime() { + return modelInputTime_; + } + /** + *
    +         * Time between two consecutive `GetNext` calls to the iterator represented
    +         * by the output node.
    +         * 
    + * + * double model_input_time = 4; + * @param value The modelInputTime to set. + * @return This builder for chaining. + */ + public Builder setModelInputTime(double value) { + + modelInputTime_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +         * Time between two consecutive `GetNext` calls to the iterator represented
    +         * by the output node.
    +         * 
    + * + * double model_input_time = 4; + * @return This builder for chaining. + */ + public Builder clearModelInputTime() { + bitField0_ = (bitField0_ & ~0x00000008); + modelInputTime_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.model.ModelProto.OptimizationParams) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto.OptimizationParams) + private static final org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams(); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OptimizationParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.model.Model.ModelProto.OptimizationParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int DATASET_NAME_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object datasetName_ = ""; + /** + *
    +     * User-defined name for the dataset. Empty if no name was set.
    +     * 
    + * + * string dataset_name = 7; + * @return The datasetName. + */ + @java.lang.Override + public java.lang.String getDatasetName() { + java.lang.Object ref = datasetName_; + 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(); + datasetName_ = s; + return s; + } + } + /** + *
    +     * User-defined name for the dataset. Empty if no name was set.
    +     * 
    + * + * string dataset_name = 7; + * @return The bytes for datasetName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDatasetNameBytes() { + java.lang.Object ref = datasetName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + datasetName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODES_FIELD_NUMBER = 1; + private static final class NodesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, org.tensorflow.proto.data.model.Model.ModelProto.Node> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_NodesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT64, + 0L, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.data.model.Model.ModelProto.Node.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, org.tensorflow.proto.data.model.Model.ModelProto.Node> nodes_; + private com.google.protobuf.MapField + internalGetNodes() { + if (nodes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NodesDefaultEntryHolder.defaultEntry); + } + return nodes_; + } + public int getNodesCount() { + return internalGetNodes().getMap().size(); + } + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public boolean containsNodes( + long key) { + + return internalGetNodes().getMap().containsKey(key); + } + /** + * Use {@link #getNodesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNodes() { + return getNodesMap(); + } + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public java.util.Map getNodesMap() { + return internalGetNodes().getMap(); + } + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node defaultValue) { + + java.util.Map map = + internalGetNodes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * Map of node IDs to nodes of this model.
    +     * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrThrow( + long key) { + + java.util.Map map = + internalGetNodes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OUTPUT_FIELD_NUMBER = 2; + private long output_ = 0L; + /** + *
    +     * ID of the output node of this model.
    +     * 
    + * + * int64 output = 2; + * @return The output. + */ + @java.lang.Override + public long getOutput() { + return output_; + } + + public static final int ID_COUNTER_FIELD_NUMBER = 3; + private long idCounter_ = 0L; + /** + *
    +     * Counter for node IDs of this model.
    +     * 
    + * + * int64 id_counter = 3; + * @return The idCounter. + */ + @java.lang.Override + public long getIdCounter() { + return idCounter_; + } + + public static final int OPTIMIZATION_PARAMS_FIELD_NUMBER = 5; + private org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams optimizationParams_; + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return Whether the optimizationParams field is set. + */ + @java.lang.Override + public boolean hasOptimizationParams() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return The optimizationParams. + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams getOptimizationParams() { + return optimizationParams_ == null ? org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder() { + return optimizationParams_ == null ? org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; + } + + public static final int GAP_TIMES_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList gapTimes_ = + emptyLongList(); + /** + * repeated uint64 gap_times = 6; + * @return A list containing the gapTimes. + */ + @java.lang.Override + public java.util.List + getGapTimesList() { + return gapTimes_; + } + /** + * repeated uint64 gap_times = 6; + * @return The count of gapTimes. + */ + public int getGapTimesCount() { + return gapTimes_.size(); + } + /** + * repeated uint64 gap_times = 6; + * @param index The index of the element to return. + * @return The gapTimes at the given index. + */ + public long getGapTimes(int index) { + return gapTimes_.getLong(index); + } + private int gapTimesMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + com.google.protobuf.GeneratedMessage + .serializeLongMapTo( + output, + internalGetNodes(), + NodesDefaultEntryHolder.defaultEntry, + 1); + if (output_ != 0L) { + output.writeInt64(2, output_); + } + if (idCounter_ != 0L) { + output.writeInt64(3, idCounter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getOptimizationParams()); + } + if (getGapTimesList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(gapTimesMemoizedSerializedSize); + } + for (int i = 0; i < gapTimes_.size(); i++) { + output.writeUInt64NoTag(gapTimes_.getLong(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(datasetName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, datasetName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetNodes().getMap().entrySet()) { + com.google.protobuf.MapEntry + nodes__ = NodesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, nodes__); + } + if (output_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, output_); + } + if (idCounter_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, idCounter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getOptimizationParams()); + } + { + int dataSize = 0; + for (int i = 0; i < gapTimes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeUInt64SizeNoTag(gapTimes_.getLong(i)); + } + size += dataSize; + if (!getGapTimesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + gapTimesMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(datasetName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, datasetName_); + } + size += getUnknownFields().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.model.Model.ModelProto)) { + return super.equals(obj); + } + org.tensorflow.proto.data.model.Model.ModelProto other = (org.tensorflow.proto.data.model.Model.ModelProto) obj; + + if (!getDatasetName() + .equals(other.getDatasetName())) return false; + if (!internalGetNodes().equals( + other.internalGetNodes())) return false; + if (getOutput() + != other.getOutput()) return false; + if (getIdCounter() + != other.getIdCounter()) return false; + if (hasOptimizationParams() != other.hasOptimizationParams()) return false; + if (hasOptimizationParams()) { + if (!getOptimizationParams() + .equals(other.getOptimizationParams())) return false; + } + if (!getGapTimesList() + .equals(other.getGapTimesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATASET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDatasetName().hashCode(); + if (!internalGetNodes().getMap().isEmpty()) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + internalGetNodes().hashCode(); + } + hash = (37 * hash) + OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOutput()); + hash = (37 * hash) + ID_COUNTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIdCounter()); + if (hasOptimizationParams()) { + hash = (37 * hash) + OPTIMIZATION_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getOptimizationParams().hashCode(); + } + if (getGapTimesCount() > 0) { + hash = (37 * hash) + GAP_TIMES_FIELD_NUMBER; + hash = (53 * hash) + getGapTimesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto 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.model.Model.ModelProto parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto 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.model.Model.ModelProto parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.data.model.Model.ModelProto parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.model.Model.ModelProto 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Protocol buffer representing the data used by the autotuning modeling
    +     * framework.
    +     * 
    + * + * Protobuf type {@code tensorflow.data.model.ModelProto} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.data.model.ModelProto) + org.tensorflow.proto.data.model.Model.ModelProtoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetNodes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableNodes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.data.model.Model.ModelProto.class, org.tensorflow.proto.data.model.Model.ModelProto.Builder.class); + } + + // Construct using org.tensorflow.proto.data.model.Model.ModelProto.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getOptimizationParamsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasetName_ = ""; + internalGetMutableNodes().clear(); + output_ = 0L; + idCounter_ = 0L; + optimizationParams_ = null; + if (optimizationParamsBuilder_ != null) { + optimizationParamsBuilder_.dispose(); + optimizationParamsBuilder_ = null; + } + gapTimes_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.data.model.Model.internal_static_tensorflow_data_model_ModelProto_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto getDefaultInstanceForType() { + return org.tensorflow.proto.data.model.Model.ModelProto.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto build() { + org.tensorflow.proto.data.model.Model.ModelProto result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto buildPartial() { + org.tensorflow.proto.data.model.Model.ModelProto result = new org.tensorflow.proto.data.model.Model.ModelProto(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.data.model.Model.ModelProto result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasetName_ = datasetName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nodes_ = internalGetNodes().build(NodesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.output_ = output_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.idCounter_ = idCounter_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.optimizationParams_ = optimizationParamsBuilder_ == null + ? optimizationParams_ + : optimizationParamsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + gapTimes_.makeImmutable(); + result.gapTimes_ = gapTimes_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.data.model.Model.ModelProto) { + return mergeFrom((org.tensorflow.proto.data.model.Model.ModelProto)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.data.model.Model.ModelProto other) { + if (other == org.tensorflow.proto.data.model.Model.ModelProto.getDefaultInstance()) return this; + if (!other.getDatasetName().isEmpty()) { + datasetName_ = other.datasetName_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableNodes().mergeFrom( + other.internalGetNodes()); + bitField0_ |= 0x00000002; + if (other.getOutput() != 0L) { + setOutput(other.getOutput()); + } + if (other.getIdCounter() != 0L) { + setIdCounter(other.getIdCounter()); + } + if (other.hasOptimizationParams()) { + mergeOptimizationParams(other.getOptimizationParams()); + } + if (!other.gapTimes_.isEmpty()) { + if (gapTimes_.isEmpty()) { + gapTimes_ = other.gapTimes_; + gapTimes_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureGapTimesIsMutable(); + gapTimes_.addAll(other.gapTimes_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + nodes__ = input.readMessage( + NodesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableNodes().ensureBuilderMap().put( + nodes__.getKey(), nodes__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 16: { + output_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 16 + case 24: { + idCounter_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 42: { + input.readMessage( + getOptimizationParamsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: { + long v = input.readUInt64(); + ensureGapTimesIsMutable(); + gapTimes_.addLong(v); + break; + } // case 48 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureGapTimesIsMutable(); + while (input.getBytesUntilLimit() > 0) { + gapTimes_.addLong(input.readUInt64()); + } + input.popLimit(limit); + break; + } // case 50 + case 58: { + datasetName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object datasetName_ = ""; + /** + *
    +       * User-defined name for the dataset. Empty if no name was set.
    +       * 
    + * + * string dataset_name = 7; + * @return The datasetName. + */ + public java.lang.String getDatasetName() { + java.lang.Object ref = datasetName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * User-defined name for the dataset. Empty if no name was set.
    +       * 
    + * + * string dataset_name = 7; + * @return The bytes for datasetName. + */ + public com.google.protobuf.ByteString + getDatasetNameBytes() { + java.lang.Object ref = datasetName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + datasetName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * User-defined name for the dataset. Empty if no name was set.
    +       * 
    + * + * string dataset_name = 7; + * @param value The datasetName to set. + * @return This builder for chaining. + */ + public Builder setDatasetName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + datasetName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * User-defined name for the dataset. Empty if no name was set.
    +       * 
    + * + * string dataset_name = 7; + * @return This builder for chaining. + */ + public Builder clearDatasetName() { + datasetName_ = getDefaultInstance().getDatasetName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
    +       * User-defined name for the dataset. Empty if no name was set.
    +       * 
    + * + * string dataset_name = 7; + * @param value The bytes for datasetName to set. + * @return This builder for chaining. + */ + public Builder setDatasetNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + datasetName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class NodesConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node build(org.tensorflow.proto.data.model.Model.ModelProto.NodeOrBuilder val) { + if (val instanceof org.tensorflow.proto.data.model.Model.ModelProto.Node) { return (org.tensorflow.proto.data.model.Model.ModelProto.Node) val; } + return ((org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return NodesDefaultEntryHolder.defaultEntry; + } + }; + private static final NodesConverter nodesConverter = new NodesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Long, org.tensorflow.proto.data.model.Model.ModelProto.NodeOrBuilder, org.tensorflow.proto.data.model.Model.ModelProto.Node, org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder> nodes_; + private com.google.protobuf.MapFieldBuilder + internalGetNodes() { + if (nodes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(nodesConverter); + } + return nodes_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableNodes() { + if (nodes_ == null) { + nodes_ = new com.google.protobuf.MapFieldBuilder<>(nodesConverter); + } + bitField0_ |= 0x00000002; + onChanged(); + return nodes_; + } + public int getNodesCount() { + return internalGetNodes().ensureBuilderMap().size(); + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public boolean containsNodes( + long key) { + + return internalGetNodes().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getNodesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getNodes() { + return getNodesMap(); + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public java.util.Map getNodesMap() { + return internalGetNodes().getImmutableMap(); + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.data.model.Model.ModelProto.Node defaultValue) { + + java.util.Map map = internalGetMutableNodes().ensureBuilderMap(); + return map.containsKey(key) ? nodesConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.data.model.Model.ModelProto.Node getNodesOrThrow( + long key) { + + java.util.Map map = internalGetMutableNodes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return nodesConverter.build(map.get(key)); + } + public Builder clearNodes() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableNodes().clear(); + return this; + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + public Builder removeNodes( + long key) { + + internalGetMutableNodes().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableNodes() { + bitField0_ |= 0x00000002; + return internalGetMutableNodes().ensureMessageMap(); + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + public Builder putNodes( + long key, + org.tensorflow.proto.data.model.Model.ModelProto.Node value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableNodes().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + public Builder putAllNodes( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableNodes().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + *
    +       * Map of node IDs to nodes of this model.
    +       * 
    + * + * map<int64, .tensorflow.data.model.ModelProto.Node> nodes = 1; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder putNodesBuilderIfAbsent( + long key) { + java.util.Map builderMap = internalGetMutableNodes().ensureBuilderMap(); + org.tensorflow.proto.data.model.Model.ModelProto.NodeOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.data.model.Model.ModelProto.Node.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.data.model.Model.ModelProto.Node) { + entry = ((org.tensorflow.proto.data.model.Model.ModelProto.Node) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.data.model.Model.ModelProto.Node.Builder) entry; + } + + private long output_ ; + /** + *
    +       * ID of the output node of this model.
    +       * 
    + * + * int64 output = 2; + * @return The output. + */ + @java.lang.Override + public long getOutput() { + return output_; + } + /** + *
    +       * ID of the output node of this model.
    +       * 
    + * + * int64 output = 2; + * @param value The output to set. + * @return This builder for chaining. + */ + public Builder setOutput(long value) { + + output_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * ID of the output node of this model.
    +       * 
    + * + * int64 output = 2; + * @return This builder for chaining. + */ + public Builder clearOutput() { + bitField0_ = (bitField0_ & ~0x00000004); + output_ = 0L; + onChanged(); + return this; + } + + private long idCounter_ ; + /** + *
    +       * Counter for node IDs of this model.
    +       * 
    + * + * int64 id_counter = 3; + * @return The idCounter. + */ + @java.lang.Override + public long getIdCounter() { + return idCounter_; + } + /** + *
    +       * Counter for node IDs of this model.
    +       * 
    + * + * int64 id_counter = 3; + * @param value The idCounter to set. + * @return This builder for chaining. + */ + public Builder setIdCounter(long value) { + + idCounter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Counter for node IDs of this model.
    +       * 
    + * + * int64 id_counter = 3; + * @return This builder for chaining. + */ + public Builder clearIdCounter() { + bitField0_ = (bitField0_ & ~0x00000008); + idCounter_ = 0L; + onChanged(); + return this; + } + + private org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams optimizationParams_; + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder> optimizationParamsBuilder_; + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return Whether the optimizationParams field is set. + */ + public boolean hasOptimizationParams() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + * @return The optimizationParams. + */ + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams getOptimizationParams() { + if (optimizationParamsBuilder_ == null) { + return optimizationParams_ == null ? org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; + } else { + return optimizationParamsBuilder_.getMessage(); + } + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public Builder setOptimizationParams(org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams value) { + if (optimizationParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + optimizationParams_ = value; + } else { + optimizationParamsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public Builder setOptimizationParams( + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder builderForValue) { + if (optimizationParamsBuilder_ == null) { + optimizationParams_ = builderForValue.build(); + } else { + optimizationParamsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public Builder mergeOptimizationParams(org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams value) { + if (optimizationParamsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + optimizationParams_ != null && + optimizationParams_ != org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance()) { + getOptimizationParamsBuilder().mergeFrom(value); + } else { + optimizationParams_ = value; + } + } else { + optimizationParamsBuilder_.mergeFrom(value); + } + if (optimizationParams_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public Builder clearOptimizationParams() { + bitField0_ = (bitField0_ & ~0x00000010); + optimizationParams_ = null; + if (optimizationParamsBuilder_ != null) { + optimizationParamsBuilder_.dispose(); + optimizationParamsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder getOptimizationParamsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getOptimizationParamsFieldBuilder().getBuilder(); + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + public org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder getOptimizationParamsOrBuilder() { + if (optimizationParamsBuilder_ != null) { + return optimizationParamsBuilder_.getMessageOrBuilder(); + } else { + return optimizationParams_ == null ? + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.getDefaultInstance() : optimizationParams_; + } + } + /** + * .tensorflow.data.model.ModelProto.OptimizationParams optimization_params = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder> + getOptimizationParamsFieldBuilder() { + if (optimizationParamsBuilder_ == null) { + optimizationParamsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParams.Builder, org.tensorflow.proto.data.model.Model.ModelProto.OptimizationParamsOrBuilder>( + getOptimizationParams(), + getParentForChildren(), + isClean()); + optimizationParams_ = null; + } + return optimizationParamsBuilder_; + } + + private com.google.protobuf.Internal.LongList gapTimes_ = emptyLongList(); + private void ensureGapTimesIsMutable() { + if (!gapTimes_.isModifiable()) { + gapTimes_ = makeMutableCopy(gapTimes_); + } + bitField0_ |= 0x00000020; + } + /** + * repeated uint64 gap_times = 6; + * @return A list containing the gapTimes. + */ + public java.util.List + getGapTimesList() { + gapTimes_.makeImmutable(); + return gapTimes_; + } + /** + * repeated uint64 gap_times = 6; + * @return The count of gapTimes. + */ + public int getGapTimesCount() { + return gapTimes_.size(); + } + /** + * repeated uint64 gap_times = 6; + * @param index The index of the element to return. + * @return The gapTimes at the given index. + */ + public long getGapTimes(int index) { + return gapTimes_.getLong(index); + } + /** + * repeated uint64 gap_times = 6; + * @param index The index to set the value at. + * @param value The gapTimes to set. + * @return This builder for chaining. + */ + public Builder setGapTimes( + int index, long value) { + + ensureGapTimesIsMutable(); + gapTimes_.setLong(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated uint64 gap_times = 6; + * @param value The gapTimes to add. + * @return This builder for chaining. + */ + public Builder addGapTimes(long value) { + + ensureGapTimesIsMutable(); + gapTimes_.addLong(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated uint64 gap_times = 6; + * @param values The gapTimes to add. + * @return This builder for chaining. + */ + public Builder addAllGapTimes( + java.lang.Iterable values) { + ensureGapTimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, gapTimes_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * repeated uint64 gap_times = 6; + * @return This builder for chaining. + */ + public Builder clearGapTimes() { + gapTimes_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.data.model.ModelProto) + } + + // @@protoc_insertion_point(class_scope:tensorflow.data.model.ModelProto) + private static final org.tensorflow.proto.data.model.Model.ModelProto DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.data.model.Model.ModelProto(); + } + + public static org.tensorflow.proto.data.model.Model.ModelProto getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ModelProto parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.model.Model.ModelProto getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_model_ModelProto_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_model_ModelProto_Node_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_model_ModelProto_NodesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_model_ModelProto_NodesEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_data_model_ModelProto_OptimizationParams_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/framework/model.proto\022" + + "\025tensorflow.data.model\"\235\010\n\nModelProto\022\024\n" + + "\014dataset_name\030\007 \001(\t\022;\n\005nodes\030\001 \003(\0132,.ten" + + "sorflow.data.model.ModelProto.NodesEntry" + + "\022\016\n\006output\030\002 \001(\003\022\022\n\nid_counter\030\003 \001(\003\022Q\n\023" + + "optimization_params\030\005 \001(\01324.tensorflow.d" + + "ata.model.ModelProto.OptimizationParams\022" + + "\021\n\tgap_times\030\006 \003(\004\032\277\004\n\004Node\022\n\n\002id\030\001 \001(\003\022" + + "\014\n\004name\030\002 \001(\t\022\020\n\010autotune\030\003 \001(\010\022\026\n\016buffe" + + "red_bytes\030\004 \001(\003\022\031\n\021buffered_elements\030\005 \001" + + "(\003\022\026\n\016bytes_consumed\030\006 \001(\003\022\026\n\016bytes_prod" + + "uced\030\007 \001(\003\022\024\n\014num_elements\030\010 \001(\003\022\027\n\017proc" + + "essing_time\030\t \001(\003\022\026\n\016record_metrics\030\n \001(" + + "\010\022D\n\nparameters\030\013 \003(\01320.tensorflow.data." + + "model.ModelProto.Node.Parameter\022!\n\031input" + + "_processing_time_sum\030\014 \001(\001\022#\n\033input_proc" + + "essing_time_count\030\r \001(\003\022\016\n\006inputs\030\016 \003(\003\022" + + "4\n\nnode_class\030\017 \001(\0162 .tensorflow.data.mo" + + "del.NodeClass\022\r\n\005ratio\030\020 \001(\001\022\024\n\014memory_r" + + "atio\030\021 \001(\001\032h\n\tParameter\022\014\n\004name\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\001\022\023\n\013state_value\030\003 \001(\001\022\013\n\003min" + + "\030\004 \001(\001\022\013\n\003max\030\005 \001(\001\022\017\n\007tunable\030\006 \001(\010\032T\n\n" + + "NodesEntry\022\013\n\003key\030\001 \001(\003\0225\n\005value\030\002 \001(\0132&" + + ".tensorflow.data.model.ModelProto.Node:\002" + + "8\001\032\223\001\n\022OptimizationParams\022;\n\talgorithm\030\001" + + " \001(\0162(.tensorflow.data.model.AutotuneAlg" + + "orithm\022\022\n\ncpu_budget\030\002 \001(\003\022\022\n\nram_budget" + + "\030\003 \001(\003\022\030\n\020model_input_time\030\004 \001(\001J\004\010\004\020\005*\234" + + "\001\n\tNodeClass\022\013\n\007UNKNOWN\020\000\022\023\n\017INTERLEAVE_" + + "MANY\020\001\022\031\n\025ASYNC_INTERLEAVE_MANY\020\002\022\017\n\013KNO" + + "WN_RATIO\020\003\022\025\n\021ASYNC_KNOWN_RATIO\020\004\022\021\n\rUNK" + + "NOWN_RATIO\020\005\022\027\n\023ASYNC_UNKNOWN_RATIO\020\006*l\n" + + "\021AutotuneAlgorithm\022\013\n\007DEFAULT\020\000\022\016\n\nHILL_" + + "CLIMB\020\001\022\024\n\020GRADIENT_DESCENT\020\002\022\023\n\017MAX_PAR" + + "ALLELISM\020\003\022\017\n\013STAGE_BASED\020\004Br\n\037org.tenso" + + "rflow.proto.data.modelZLgithub.com/tenso" + + "rflow/tensorflow/tensorflow/go/core/fram" + + "ework/model_go_proto\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_data_model_ModelProto_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_data_model_ModelProto_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_model_ModelProto_descriptor, + new java.lang.String[] { "DatasetName", "Nodes", "Output", "IdCounter", "OptimizationParams", "GapTimes", }); + internal_static_tensorflow_data_model_ModelProto_Node_descriptor = + internal_static_tensorflow_data_model_ModelProto_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_data_model_ModelProto_Node_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_model_ModelProto_Node_descriptor, + new java.lang.String[] { "Id", "Name", "Autotune", "BufferedBytes", "BufferedElements", "BytesConsumed", "BytesProduced", "NumElements", "ProcessingTime", "RecordMetrics", "Parameters", "InputProcessingTimeSum", "InputProcessingTimeCount", "Inputs", "NodeClass", "Ratio", "MemoryRatio", }); + internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor = + internal_static_tensorflow_data_model_ModelProto_Node_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_data_model_ModelProto_Node_Parameter_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_model_ModelProto_Node_Parameter_descriptor, + new java.lang.String[] { "Name", "Value", "StateValue", "Min", "Max", "Tunable", }); + internal_static_tensorflow_data_model_ModelProto_NodesEntry_descriptor = + internal_static_tensorflow_data_model_ModelProto_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_data_model_ModelProto_NodesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_model_ModelProto_NodesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor = + internal_static_tensorflow_data_model_ModelProto_descriptor.getNestedTypes().get(2); + internal_static_tensorflow_data_model_ModelProto_OptimizationParams_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_data_model_ModelProto_OptimizationParams_descriptor, + new java.lang.String[] { "Algorithm", "CpuBudget", "RamBudget", "ModelInputTime", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/distributed_runtime/DistributedRuntimePayloads.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/distributed_runtime/DistributedRuntimePayloads.java new file mode 100644 index 00000000000..a7c20819032 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/distributed_runtime/DistributedRuntimePayloads.java @@ -0,0 +1,1524 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/distributed_runtime_payloads.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.distributed_runtime; + +public final class DistributedRuntimePayloads { + private DistributedRuntimePayloads() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DistributedRuntimePayloads.class.getName()); + } + 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 GrpcPayloadContainerOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.distributed_runtime.GrpcPayloadContainer) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, bytes> payloads = 1; + */ + int getPayloadsCount(); + /** + * map<string, bytes> payloads = 1; + */ + boolean containsPayloads( + java.lang.String key); + /** + * Use {@link #getPayloadsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getPayloads(); + /** + * map<string, bytes> payloads = 1; + */ + java.util.Map + getPayloadsMap(); + /** + * map<string, bytes> payloads = 1; + */ + /* nullable */ +com.google.protobuf.ByteString getPayloadsOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue); + /** + * map<string, bytes> payloads = 1; + */ + com.google.protobuf.ByteString getPayloadsOrThrow( + java.lang.String key); + } + /** + *
    +   * Used to serialize and transmit tensorflow::Status payloads through
    +   * grpc::Status `error_details` since grpc::Status lacks payload API.
    +   * TODO(b/204231601): Use GRPC API once supported.
    +   * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.GrpcPayloadContainer} + */ + public static final class GrpcPayloadContainer extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.distributed_runtime.GrpcPayloadContainer) + GrpcPayloadContainerOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GrpcPayloadContainer.class.getName()); + } + // Use GrpcPayloadContainer.newBuilder() to construct. + private GrpcPayloadContainer(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GrpcPayloadContainer() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetPayloads(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.Builder.class); + } + + public static final int PAYLOADS_FIELD_NUMBER = 1; + private static final class PayloadsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.protobuf.ByteString> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_PayloadsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.BYTES, + com.google.protobuf.ByteString.EMPTY); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.ByteString> payloads_; + private com.google.protobuf.MapField + internalGetPayloads() { + if (payloads_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PayloadsDefaultEntryHolder.defaultEntry); + } + return payloads_; + } + public int getPayloadsCount() { + return internalGetPayloads().getMap().size(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public boolean containsPayloads( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetPayloads().getMap().containsKey(key); + } + /** + * Use {@link #getPayloadsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPayloads() { + return getPayloadsMap(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public java.util.Map getPayloadsMap() { + return internalGetPayloads().getMap(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public /* nullable */ +com.google.protobuf.ByteString getPayloadsOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayloads().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayloads().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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetPayloads(), + PayloadsDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetPayloads().getMap().entrySet()) { + com.google.protobuf.MapEntry + payloads__ = PayloadsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, payloads__); + } + size += getUnknownFields().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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer)) { + return super.equals(obj); + } + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer other = (org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer) obj; + + if (!internalGetPayloads().equals( + other.internalGetPayloads())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetPayloads().getMap().isEmpty()) { + hash = (37 * hash) + PAYLOADS_FIELD_NUMBER; + hash = (53 * hash) + internalGetPayloads().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Used to serialize and transmit tensorflow::Status payloads through
    +     * grpc::Status `error_details` since grpc::Status lacks payload API.
    +     * TODO(b/204231601): Use GRPC API once supported.
    +     * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.GrpcPayloadContainer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.distributed_runtime.GrpcPayloadContainer) + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetPayloads(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutablePayloads(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.Builder.class); + } + + // Construct using org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutablePayloads().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer getDefaultInstanceForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer build() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer buildPartial() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer result = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.payloads_ = internalGetPayloads(); + result.payloads_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer) { + return mergeFrom((org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer other) { + if (other == org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer.getDefaultInstance()) return this; + internalGetMutablePayloads().mergeFrom( + other.internalGetPayloads()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + payloads__ = input.readMessage( + PayloadsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutablePayloads().getMutableMap().put( + payloads__.getKey(), payloads__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.ByteString> payloads_; + private com.google.protobuf.MapField + internalGetPayloads() { + if (payloads_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PayloadsDefaultEntryHolder.defaultEntry); + } + return payloads_; + } + private com.google.protobuf.MapField + internalGetMutablePayloads() { + if (payloads_ == null) { + payloads_ = com.google.protobuf.MapField.newMapField( + PayloadsDefaultEntryHolder.defaultEntry); + } + if (!payloads_.isMutable()) { + payloads_ = payloads_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return payloads_; + } + public int getPayloadsCount() { + return internalGetPayloads().getMap().size(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public boolean containsPayloads( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetPayloads().getMap().containsKey(key); + } + /** + * Use {@link #getPayloadsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getPayloads() { + return getPayloadsMap(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public java.util.Map getPayloadsMap() { + return internalGetPayloads().getMap(); + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public /* nullable */ +com.google.protobuf.ByteString getPayloadsOrDefault( + java.lang.String key, + /* nullable */ +com.google.protobuf.ByteString defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayloads().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, bytes> payloads = 1; + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetPayloads().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearPayloads() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutablePayloads().getMutableMap() + .clear(); + return this; + } + /** + * map<string, bytes> payloads = 1; + */ + public Builder removePayloads( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutablePayloads().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutablePayloads() { + bitField0_ |= 0x00000001; + return internalGetMutablePayloads().getMutableMap(); + } + /** + * map<string, bytes> payloads = 1; + */ + public Builder putPayloads( + java.lang.String key, + com.google.protobuf.ByteString value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutablePayloads().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, bytes> payloads = 1; + */ + public Builder putAllPayloads( + java.util.Map values) { + internalGetMutablePayloads().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.distributed_runtime.GrpcPayloadContainer) + } + + // @@protoc_insertion_point(class_scope:tensorflow.distributed_runtime.GrpcPayloadContainer) + private static final org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer(); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GrpcPayloadContainer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadContainer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GrpcPayloadsLostOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.distributed_runtime.GrpcPayloadsLost) + com.google.protobuf.MessageOrBuilder { + } + /** + *
    +   * If included as a payload, this message flags the Status to have lost payloads
    +   * during the GRPC transmission.
    +   * URI: "type.googleapis.com/tensorflow.distributed_runtime.GrpcPayloadsLost"
    +   * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.GrpcPayloadsLost} + */ + public static final class GrpcPayloadsLost extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.distributed_runtime.GrpcPayloadsLost) + GrpcPayloadsLostOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + GrpcPayloadsLost.class.getName()); + } + // Use GrpcPayloadsLost.newBuilder() to construct. + private GrpcPayloadsLost(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GrpcPayloadsLost() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost)) { + return super.equals(obj); + } + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost other = (org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * If included as a payload, this message flags the Status to have lost payloads
    +     * during the GRPC transmission.
    +     * URI: "type.googleapis.com/tensorflow.distributed_runtime.GrpcPayloadsLost"
    +     * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.GrpcPayloadsLost} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.distributed_runtime.GrpcPayloadsLost) + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLostOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.Builder.class); + } + + // Construct using org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost getDefaultInstanceForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost build() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost buildPartial() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost result = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost) { + return mergeFrom((org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost other) { + if (other == org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.distributed_runtime.GrpcPayloadsLost) + } + + // @@protoc_insertion_point(class_scope:tensorflow.distributed_runtime.GrpcPayloadsLost) + private static final org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost(); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GrpcPayloadsLost parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.distributed_runtime.DistributedRuntimePayloads.GrpcPayloadsLost getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WorkerPossiblyRestartedOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.distributed_runtime.WorkerPossiblyRestarted) + com.google.protobuf.MessageOrBuilder { + } + /** + *
    +   * If included as a payload, this message flags the Status to be a possible
    +   * outcome of a worker restart.
    +   * URI:
    +   * "type.googleapis.com/tensorflow.distributed_runtime.WorkerPossiblyRestarted"
    +   * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.WorkerPossiblyRestarted} + */ + public static final class WorkerPossiblyRestarted extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.distributed_runtime.WorkerPossiblyRestarted) + WorkerPossiblyRestartedOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + WorkerPossiblyRestarted.class.getName()); + } + // Use WorkerPossiblyRestarted.newBuilder() to construct. + private WorkerPossiblyRestarted(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WorkerPossiblyRestarted() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted)) { + return super.equals(obj); + } + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted other = (org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted 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.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted 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.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * If included as a payload, this message flags the Status to be a possible
    +     * outcome of a worker restart.
    +     * URI:
    +     * "type.googleapis.com/tensorflow.distributed_runtime.WorkerPossiblyRestarted"
    +     * 
    + * + * Protobuf type {@code tensorflow.distributed_runtime.WorkerPossiblyRestarted} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.distributed_runtime.WorkerPossiblyRestarted) + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestartedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.class, org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.Builder.class); + } + + // Construct using org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted getDefaultInstanceForType() { + return org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted build() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted buildPartial() { + org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted result = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted) { + return mergeFrom((org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted other) { + if (other == org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.distributed_runtime.WorkerPossiblyRestarted) + } + + // @@protoc_insertion_point(class_scope:tensorflow.distributed_runtime.WorkerPossiblyRestarted) + private static final org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted(); + } + + public static org.tensorflow.proto.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkerPossiblyRestarted parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.distributed_runtime.DistributedRuntimePayloads.WorkerPossiblyRestarted getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_PayloadsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_distributed_runtime_GrpcPayloadContainer_PayloadsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_distributed_runtime_GrpcPayloadsLost_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_distributed_runtime_WorkerPossiblyRestarted_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n3xla/tsl/protobuf/distributed_runtime_p" + + "ayloads.proto\022\036tensorflow.distributed_ru" + + "ntime\"\235\001\n\024GrpcPayloadContainer\022T\n\010payloa" + + "ds\030\001 \003(\0132B.tensorflow.distributed_runtim" + + "e.GrpcPayloadContainer.PayloadsEntry\032/\n\r" + + "PayloadsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" + + "\014:\0028\001\"\022\n\020GrpcPayloadsLost\"\031\n\027WorkerPossi" + + "blyRestartedBk\n(org.tensorflow.proto.dis" + + "tributed_runtimeZ builder) { + super(builder); + } + private RemoteTensorHandle() { + device_ = ""; + opDevice_ = ""; + dtype_ = 0; + resourceDtypesAndShapes_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.eager.RemoteTensorHandle.class, org.tensorflow.proto.eager.RemoteTensorHandle.Builder.class); + } + + public static final int OP_ID_FIELD_NUMBER = 1; + private long opId_ = 0L; + /** + *
    +   * The ID of the operation that produced this tensor.
    +   * 
    + * + * int64 op_id = 1; + * @return The opId. + */ + @java.lang.Override + public long getOpId() { + return opId_; + } + + public static final int OUTPUT_NUM_FIELD_NUMBER = 2; + private int outputNum_ = 0; + /** + *
    +   * The index into the outputs of the operation that produced this tensor.
    +   * 
    + * + * int32 output_num = 2; + * @return The outputNum. + */ + @java.lang.Override + public int getOutputNum() { + return outputNum_; + } + + public static final int DEVICE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object device_ = ""; + /** + *
    +   * Device where the tensor is located. Cannot be empty.
    +   * For multi-device functions, it's the default device passed to placer.
    +   * 
    + * + * string device = 3; + * @return The device. + */ + @java.lang.Override + 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; + } + } + /** + *
    +   * Device where the tensor is located. Cannot be empty.
    +   * For multi-device functions, it's the default device passed to placer.
    +   * 
    + * + * string device = 3; + * @return The bytes for device. + */ + @java.lang.Override + 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 OP_DEVICE_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object opDevice_ = ""; + /** + *
    +   * Device of the operation producing this tensor. Can be empty if the
    +   * operation producing this tensor is a multi-device function.
    +   * 
    + * + * string op_device = 4; + * @return The opDevice. + */ + @java.lang.Override + public java.lang.String getOpDevice() { + java.lang.Object ref = opDevice_; + 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(); + opDevice_ = s; + return s; + } + } + /** + *
    +   * Device of the operation producing this tensor. Can be empty if the
    +   * operation producing this tensor is a multi-device function.
    +   * 
    + * + * string op_device = 4; + * @return The bytes for opDevice. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpDeviceBytes() { + java.lang.Object ref = opDevice_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opDevice_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DTYPE_FIELD_NUMBER = 5; + private int dtype_ = 0; + /** + *
    +   * Tensor type.
    +   * 
    + * + * .tensorflow.DataType dtype = 5; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +   * Tensor type.
    +   * 
    + * + * .tensorflow.DataType dtype = 5; + * @return The dtype. + */ + @java.lang.Override public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + + public static final int RESOURCE_DTYPES_AND_SHAPES_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List resourceDtypesAndShapes_; + /** + *
    +   * Optional data types and shapes of a remote resource variable.
    +   * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + @java.lang.Override + public java.util.List getResourceDtypesAndShapesList() { + return resourceDtypesAndShapes_; + } + /** + *
    +   * Optional data types and shapes of a remote resource variable.
    +   * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + @java.lang.Override + public java.util.List + getResourceDtypesAndShapesOrBuilderList() { + return resourceDtypesAndShapes_; + } + /** + *
    +   * Optional data types and shapes of a remote resource variable.
    +   * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + @java.lang.Override + public int getResourceDtypesAndShapesCount() { + return resourceDtypesAndShapes_.size(); + } + /** + *
    +   * Optional data types and shapes of a remote resource variable.
    +   * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + @java.lang.Override + public org.tensorflow.proto.eager.ResourceDtypeAndShape getResourceDtypesAndShapes(int index) { + return resourceDtypesAndShapes_.get(index); + } + /** + *
    +   * Optional data types and shapes of a remote resource variable.
    +   * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + @java.lang.Override + public org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder( + int index) { + return resourceDtypesAndShapes_.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 { + if (opId_ != 0L) { + output.writeInt64(1, opId_); + } + if (outputNum_ != 0) { + output.writeInt32(2, outputNum_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, device_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opDevice_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, opDevice_); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + output.writeEnum(5, dtype_); + } + for (int i = 0; i < resourceDtypesAndShapes_.size(); i++) { + output.writeMessage(6, resourceDtypesAndShapes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (opId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, opId_); + } + if (outputNum_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, outputNum_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(device_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, device_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(opDevice_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, opDevice_); + } + if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, dtype_); + } + for (int i = 0; i < resourceDtypesAndShapes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, resourceDtypesAndShapes_.get(i)); + } + size += getUnknownFields().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.eager.RemoteTensorHandle)) { + return super.equals(obj); + } + org.tensorflow.proto.eager.RemoteTensorHandle other = (org.tensorflow.proto.eager.RemoteTensorHandle) obj; + + if (getOpId() + != other.getOpId()) return false; + if (getOutputNum() + != other.getOutputNum()) return false; + if (!getDevice() + .equals(other.getDevice())) return false; + if (!getOpDevice() + .equals(other.getOpDevice())) return false; + if (dtype_ != other.dtype_) return false; + if (!getResourceDtypesAndShapesList() + .equals(other.getResourceDtypesAndShapesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOpId()); + hash = (37 * hash) + OUTPUT_NUM_FIELD_NUMBER; + hash = (53 * hash) + getOutputNum(); + hash = (37 * hash) + DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getDevice().hashCode(); + hash = (37 * hash) + OP_DEVICE_FIELD_NUMBER; + hash = (53 * hash) + getOpDevice().hashCode(); + hash = (37 * hash) + DTYPE_FIELD_NUMBER; + hash = (53 * hash) + dtype_; + if (getResourceDtypesAndShapesCount() > 0) { + hash = (37 * hash) + RESOURCE_DTYPES_AND_SHAPES_FIELD_NUMBER; + hash = (53 * hash) + getResourceDtypesAndShapesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle 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.eager.RemoteTensorHandle parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle 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.eager.RemoteTensorHandle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.eager.RemoteTensorHandle parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.eager.RemoteTensorHandle parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.eager.RemoteTensorHandle parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.eager.RemoteTensorHandle 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code tensorflow.eager.RemoteTensorHandle} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.eager.RemoteTensorHandle) + org.tensorflow.proto.eager.RemoteTensorHandleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.eager.RemoteTensorHandle.class, org.tensorflow.proto.eager.RemoteTensorHandle.Builder.class); + } + + // Construct using org.tensorflow.proto.eager.RemoteTensorHandle.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + opId_ = 0L; + outputNum_ = 0; + device_ = ""; + opDevice_ = ""; + dtype_ = 0; + if (resourceDtypesAndShapesBuilder_ == null) { + resourceDtypesAndShapes_ = java.util.Collections.emptyList(); + } else { + resourceDtypesAndShapes_ = null; + resourceDtypesAndShapesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_RemoteTensorHandle_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.eager.RemoteTensorHandle getDefaultInstanceForType() { + return org.tensorflow.proto.eager.RemoteTensorHandle.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.eager.RemoteTensorHandle build() { + org.tensorflow.proto.eager.RemoteTensorHandle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.eager.RemoteTensorHandle buildPartial() { + org.tensorflow.proto.eager.RemoteTensorHandle result = new org.tensorflow.proto.eager.RemoteTensorHandle(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.eager.RemoteTensorHandle result) { + if (resourceDtypesAndShapesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + resourceDtypesAndShapes_ = java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.resourceDtypesAndShapes_ = resourceDtypesAndShapes_; + } else { + result.resourceDtypesAndShapes_ = resourceDtypesAndShapesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.eager.RemoteTensorHandle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.opId_ = opId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputNum_ = outputNum_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.device_ = device_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.opDevice_ = opDevice_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.dtype_ = dtype_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.eager.RemoteTensorHandle) { + return mergeFrom((org.tensorflow.proto.eager.RemoteTensorHandle)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.eager.RemoteTensorHandle other) { + if (other == org.tensorflow.proto.eager.RemoteTensorHandle.getDefaultInstance()) return this; + if (other.getOpId() != 0L) { + setOpId(other.getOpId()); + } + if (other.getOutputNum() != 0) { + setOutputNum(other.getOutputNum()); + } + if (!other.getDevice().isEmpty()) { + device_ = other.device_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getOpDevice().isEmpty()) { + opDevice_ = other.opDevice_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.dtype_ != 0) { + setDtypeValue(other.getDtypeValue()); + } + if (resourceDtypesAndShapesBuilder_ == null) { + if (!other.resourceDtypesAndShapes_.isEmpty()) { + if (resourceDtypesAndShapes_.isEmpty()) { + resourceDtypesAndShapes_ = other.resourceDtypesAndShapes_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.addAll(other.resourceDtypesAndShapes_); + } + onChanged(); + } + } else { + if (!other.resourceDtypesAndShapes_.isEmpty()) { + if (resourceDtypesAndShapesBuilder_.isEmpty()) { + resourceDtypesAndShapesBuilder_.dispose(); + resourceDtypesAndShapesBuilder_ = null; + resourceDtypesAndShapes_ = other.resourceDtypesAndShapes_; + bitField0_ = (bitField0_ & ~0x00000020); + resourceDtypesAndShapesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getResourceDtypesAndShapesFieldBuilder() : null; + } else { + resourceDtypesAndShapesBuilder_.addAllMessages(other.resourceDtypesAndShapes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + opId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + outputNum_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + device_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + opDevice_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + dtype_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + org.tensorflow.proto.eager.ResourceDtypeAndShape m = + input.readMessage( + org.tensorflow.proto.eager.ResourceDtypeAndShape.parser(), + extensionRegistry); + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.add(m); + } else { + resourceDtypesAndShapesBuilder_.addMessage(m); + } + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long opId_ ; + /** + *
    +     * The ID of the operation that produced this tensor.
    +     * 
    + * + * int64 op_id = 1; + * @return The opId. + */ + @java.lang.Override + public long getOpId() { + return opId_; + } + /** + *
    +     * The ID of the operation that produced this tensor.
    +     * 
    + * + * int64 op_id = 1; + * @param value The opId to set. + * @return This builder for chaining. + */ + public Builder setOpId(long value) { + + opId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +     * The ID of the operation that produced this tensor.
    +     * 
    + * + * int64 op_id = 1; + * @return This builder for chaining. + */ + public Builder clearOpId() { + bitField0_ = (bitField0_ & ~0x00000001); + opId_ = 0L; + onChanged(); + return this; + } + + private int outputNum_ ; + /** + *
    +     * The index into the outputs of the operation that produced this tensor.
    +     * 
    + * + * int32 output_num = 2; + * @return The outputNum. + */ + @java.lang.Override + public int getOutputNum() { + return outputNum_; + } + /** + *
    +     * The index into the outputs of the operation that produced this tensor.
    +     * 
    + * + * int32 output_num = 2; + * @param value The outputNum to set. + * @return This builder for chaining. + */ + public Builder setOutputNum(int value) { + + outputNum_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +     * The index into the outputs of the operation that produced this tensor.
    +     * 
    + * + * int32 output_num = 2; + * @return This builder for chaining. + */ + public Builder clearOutputNum() { + bitField0_ = (bitField0_ & ~0x00000002); + outputNum_ = 0; + onChanged(); + return this; + } + + private java.lang.Object device_ = ""; + /** + *
    +     * Device where the tensor is located. Cannot be empty.
    +     * For multi-device functions, it's the default device passed to placer.
    +     * 
    + * + * string device = 3; + * @return The device. + */ + 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; + } + } + /** + *
    +     * Device where the tensor is located. Cannot be empty.
    +     * For multi-device functions, it's the default device passed to placer.
    +     * 
    + * + * string device = 3; + * @return The bytes for device. + */ + 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; + } + } + /** + *
    +     * Device where the tensor is located. Cannot be empty.
    +     * For multi-device functions, it's the default device passed to placer.
    +     * 
    + * + * string device = 3; + * @param value The device to set. + * @return This builder for chaining. + */ + public Builder setDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + device_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +     * Device where the tensor is located. Cannot be empty.
    +     * For multi-device functions, it's the default device passed to placer.
    +     * 
    + * + * string device = 3; + * @return This builder for chaining. + */ + public Builder clearDevice() { + device_ = getDefaultInstance().getDevice(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +     * Device where the tensor is located. Cannot be empty.
    +     * For multi-device functions, it's the default device passed to placer.
    +     * 
    + * + * string device = 3; + * @param value The bytes for device to set. + * @return This builder for chaining. + */ + public Builder setDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + device_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object opDevice_ = ""; + /** + *
    +     * Device of the operation producing this tensor. Can be empty if the
    +     * operation producing this tensor is a multi-device function.
    +     * 
    + * + * string op_device = 4; + * @return The opDevice. + */ + public java.lang.String getOpDevice() { + java.lang.Object ref = opDevice_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + opDevice_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +     * Device of the operation producing this tensor. Can be empty if the
    +     * operation producing this tensor is a multi-device function.
    +     * 
    + * + * string op_device = 4; + * @return The bytes for opDevice. + */ + public com.google.protobuf.ByteString + getOpDeviceBytes() { + java.lang.Object ref = opDevice_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + opDevice_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +     * Device of the operation producing this tensor. Can be empty if the
    +     * operation producing this tensor is a multi-device function.
    +     * 
    + * + * string op_device = 4; + * @param value The opDevice to set. + * @return This builder for chaining. + */ + public Builder setOpDevice( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + opDevice_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +     * Device of the operation producing this tensor. Can be empty if the
    +     * operation producing this tensor is a multi-device function.
    +     * 
    + * + * string op_device = 4; + * @return This builder for chaining. + */ + public Builder clearOpDevice() { + opDevice_ = getDefaultInstance().getOpDevice(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +     * Device of the operation producing this tensor. Can be empty if the
    +     * operation producing this tensor is a multi-device function.
    +     * 
    + * + * string op_device = 4; + * @param value The bytes for opDevice to set. + * @return This builder for chaining. + */ + public Builder setOpDeviceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + opDevice_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int dtype_ = 0; + /** + *
    +     * Tensor type.
    +     * 
    + * + * .tensorflow.DataType dtype = 5; + * @return The enum numeric value on the wire for dtype. + */ + @java.lang.Override public int getDtypeValue() { + return dtype_; + } + /** + *
    +     * Tensor type.
    +     * 
    + * + * .tensorflow.DataType dtype = 5; + * @param value The enum numeric value on the wire for dtype to set. + * @return This builder for chaining. + */ + public Builder setDtypeValue(int value) { + dtype_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +     * Tensor type.
    +     * 
    + * + * .tensorflow.DataType dtype = 5; + * @return The dtype. + */ + @java.lang.Override + public org.tensorflow.proto.DataType getDtype() { + org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_); + return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result; + } + /** + *
    +     * Tensor type.
    +     * 
    + * + * .tensorflow.DataType dtype = 5; + * @param value The dtype to set. + * @return This builder for chaining. + */ + public Builder setDtype(org.tensorflow.proto.DataType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + dtype_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
    +     * Tensor type.
    +     * 
    + * + * .tensorflow.DataType dtype = 5; + * @return This builder for chaining. + */ + public Builder clearDtype() { + bitField0_ = (bitField0_ & ~0x00000010); + dtype_ = 0; + onChanged(); + return this; + } + + private java.util.List resourceDtypesAndShapes_ = + java.util.Collections.emptyList(); + private void ensureResourceDtypesAndShapesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + resourceDtypesAndShapes_ = new java.util.ArrayList(resourceDtypesAndShapes_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.eager.ResourceDtypeAndShape, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder, org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder> resourceDtypesAndShapesBuilder_; + + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public java.util.List getResourceDtypesAndShapesList() { + if (resourceDtypesAndShapesBuilder_ == null) { + return java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); + } else { + return resourceDtypesAndShapesBuilder_.getMessageList(); + } + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public int getResourceDtypesAndShapesCount() { + if (resourceDtypesAndShapesBuilder_ == null) { + return resourceDtypesAndShapes_.size(); + } else { + return resourceDtypesAndShapesBuilder_.getCount(); + } + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.eager.ResourceDtypeAndShape getResourceDtypesAndShapes(int index) { + if (resourceDtypesAndShapesBuilder_ == null) { + return resourceDtypesAndShapes_.get(index); + } else { + return resourceDtypesAndShapesBuilder_.getMessage(index); + } + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder setResourceDtypesAndShapes( + int index, org.tensorflow.proto.eager.ResourceDtypeAndShape value) { + if (resourceDtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.set(index, value); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder setResourceDtypesAndShapes( + int index, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder builderForValue) { + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.set(index, builderForValue.build()); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder addResourceDtypesAndShapes(org.tensorflow.proto.eager.ResourceDtypeAndShape value) { + if (resourceDtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.add(value); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder addResourceDtypesAndShapes( + int index, org.tensorflow.proto.eager.ResourceDtypeAndShape value) { + if (resourceDtypesAndShapesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.add(index, value); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder addResourceDtypesAndShapes( + org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder builderForValue) { + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.add(builderForValue.build()); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder addResourceDtypesAndShapes( + int index, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder builderForValue) { + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.add(index, builderForValue.build()); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder addAllResourceDtypesAndShapes( + java.lang.Iterable values) { + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceDtypesAndShapes_); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder clearResourceDtypesAndShapes() { + if (resourceDtypesAndShapesBuilder_ == null) { + resourceDtypesAndShapes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.clear(); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public Builder removeResourceDtypesAndShapes(int index) { + if (resourceDtypesAndShapesBuilder_ == null) { + ensureResourceDtypesAndShapesIsMutable(); + resourceDtypesAndShapes_.remove(index); + onChanged(); + } else { + resourceDtypesAndShapesBuilder_.remove(index); + } + return this; + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder getResourceDtypesAndShapesBuilder( + int index) { + return getResourceDtypesAndShapesFieldBuilder().getBuilder(index); + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder( + int index) { + if (resourceDtypesAndShapesBuilder_ == null) { + return resourceDtypesAndShapes_.get(index); } else { + return resourceDtypesAndShapesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public java.util.List + getResourceDtypesAndShapesOrBuilderList() { + if (resourceDtypesAndShapesBuilder_ != null) { + return resourceDtypesAndShapesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resourceDtypesAndShapes_); + } + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder addResourceDtypesAndShapesBuilder() { + return getResourceDtypesAndShapesFieldBuilder().addBuilder( + org.tensorflow.proto.eager.ResourceDtypeAndShape.getDefaultInstance()); + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder addResourceDtypesAndShapesBuilder( + int index) { + return getResourceDtypesAndShapesFieldBuilder().addBuilder( + index, org.tensorflow.proto.eager.ResourceDtypeAndShape.getDefaultInstance()); + } + /** + *
    +     * Optional data types and shapes of a remote resource variable.
    +     * 
    + * + * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6; + */ + public java.util.List + getResourceDtypesAndShapesBuilderList() { + return getResourceDtypesAndShapesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.eager.ResourceDtypeAndShape, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder, org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder> + getResourceDtypesAndShapesFieldBuilder() { + if (resourceDtypesAndShapesBuilder_ == null) { + resourceDtypesAndShapesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.eager.ResourceDtypeAndShape, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder, org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder>( + resourceDtypesAndShapes_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + resourceDtypesAndShapes_ = null; + } + return resourceDtypesAndShapesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.eager.RemoteTensorHandle) + } + + // @@protoc_insertion_point(class_scope:tensorflow.eager.RemoteTensorHandle) + private static final org.tensorflow.proto.eager.RemoteTensorHandle DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.eager.RemoteTensorHandle(); + } + + public static org.tensorflow.proto.eager.RemoteTensorHandle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RemoteTensorHandle parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.eager.RemoteTensorHandle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleOrBuilder.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleOrBuilder.java rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleOrBuilder.java index e9f1098f494..9eb4ee66050 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/RemoteTensorHandleOrBuilder.java +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleOrBuilder.java @@ -1,7 +1,9 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: tensorflow/core/protobuf/remote_tensor_handle.proto +// Protobuf Java Version: 4.28.3 -package org.tensorflow.proto.framework; +package org.tensorflow.proto.eager; public interface RemoteTensorHandleOrBuilder extends // @@protoc_insertion_point(interface_extends:tensorflow.eager.RemoteTensorHandle) @@ -13,6 +15,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * int64 op_id = 1; + * @return The opId. */ long getOpId(); @@ -22,6 +25,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * int32 output_num = 2; + * @return The outputNum. */ int getOutputNum(); @@ -32,6 +36,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * string device = 3; + * @return The device. */ java.lang.String getDevice(); /** @@ -41,6 +46,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * string device = 3; + * @return The bytes for device. */ com.google.protobuf.ByteString getDeviceBytes(); @@ -52,6 +58,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * string op_device = 4; + * @return The opDevice. */ java.lang.String getOpDevice(); /** @@ -61,6 +68,7 @@ public interface RemoteTensorHandleOrBuilder extends *
    * * string op_device = 4; + * @return The bytes for opDevice. */ com.google.protobuf.ByteString getOpDeviceBytes(); @@ -71,6 +79,7 @@ public interface RemoteTensorHandleOrBuilder extends * * * .tensorflow.DataType dtype = 5; + * @return The enum numeric value on the wire for dtype. */ int getDtypeValue(); /** @@ -79,8 +88,9 @@ public interface RemoteTensorHandleOrBuilder extends * * * .tensorflow.DataType dtype = 5; + * @return The dtype. */ - org.tensorflow.proto.framework.DataType getDtype(); + org.tensorflow.proto.DataType getDtype(); /** *
    @@ -89,7 +99,7 @@ public interface RemoteTensorHandleOrBuilder extends
        *
        * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
        */
    -  java.util.List 
    +  java.util.List 
           getResourceDtypesAndShapesList();
       /**
        * 
    @@ -98,7 +108,7 @@ public interface RemoteTensorHandleOrBuilder extends
        *
        * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
        */
    -  org.tensorflow.proto.framework.ResourceDtypeAndShape getResourceDtypesAndShapes(int index);
    +  org.tensorflow.proto.eager.ResourceDtypeAndShape getResourceDtypesAndShapes(int index);
       /**
        * 
        * Optional data types and shapes of a remote resource variable.
    @@ -114,7 +124,7 @@ public interface RemoteTensorHandleOrBuilder extends
        *
        * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
        */
    -  java.util.List 
    +  java.util.List 
           getResourceDtypesAndShapesOrBuilderList();
       /**
        * 
    @@ -123,6 +133,6 @@ public interface RemoteTensorHandleOrBuilder extends
        *
        * repeated .tensorflow.eager.ResourceDtypeAndShape resource_dtypes_and_shapes = 6;
        */
    -  org.tensorflow.proto.framework.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder(
    +  org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder getResourceDtypesAndShapesOrBuilder(
           int index);
     }
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleProtos.java
    new file mode 100644
    index 00000000000..45419a5c2bc
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/RemoteTensorHandleProtos.java
    @@ -0,0 +1,88 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/remote_tensor_handle.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto.eager;
    +
    +public final class RemoteTensorHandleProtos {
    +  private RemoteTensorHandleProtos() {}
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      RemoteTensorHandleProtos.class.getName());
    +  }
    +  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_eager_ResourceDtypeAndShape_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable;
    +  static final com.google.protobuf.Descriptors.Descriptor
    +    internal_static_tensorflow_eager_RemoteTensorHandle_descriptor;
    +  static final 
    +    com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable;
    +
    +  public static com.google.protobuf.Descriptors.FileDescriptor
    +      getDescriptor() {
    +    return descriptor;
    +  }
    +  private static  com.google.protobuf.Descriptors.FileDescriptor
    +      descriptor;
    +  static {
    +    java.lang.String[] descriptorData = {
    +      "\n3tensorflow/core/protobuf/remote_tensor" +
    +      "_handle.proto\022\020tensorflow.eager\032,tensorf" +
    +      "low/core/framework/tensor_shape.proto\032%t" +
    +      "ensorflow/core/framework/types.proto\"i\n\025" +
    +      "ResourceDtypeAndShape\022#\n\005dtype\030\001 \001(\0162\024.t" +
    +      "ensorflow.DataType\022+\n\005shape\030\002 \001(\0132\034.tens" +
    +      "orflow.TensorShapeProto\"\314\001\n\022RemoteTensor" +
    +      "Handle\022\r\n\005op_id\030\001 \001(\003\022\022\n\noutput_num\030\002 \001(" +
    +      "\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\222\001\n\032org.t" +
    +      "ensorflow.proto.eagerB\030RemoteTensorHandl" +
    +      "eProtosP\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,
    +        new com.google.protobuf.Descriptors.FileDescriptor[] {
    +          org.tensorflow.proto.TensorShapeProtos.getDescriptor(),
    +          org.tensorflow.proto.TypesProtos.getDescriptor(),
    +        });
    +    internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor =
    +      getDescriptor().getMessageTypes().get(0);
    +    internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor,
    +        new java.lang.String[] { "Dtype", "Shape", });
    +    internal_static_tensorflow_eager_RemoteTensorHandle_descriptor =
    +      getDescriptor().getMessageTypes().get(1);
    +    internal_static_tensorflow_eager_RemoteTensorHandle_fieldAccessorTable = new
    +      com.google.protobuf.GeneratedMessage.FieldAccessorTable(
    +        internal_static_tensorflow_eager_RemoteTensorHandle_descriptor,
    +        new java.lang.String[] { "OpId", "OutputNum", "Device", "OpDevice", "Dtype", "ResourceDtypesAndShapes", });
    +    descriptor.resolveAllFeaturesImmutable();
    +    org.tensorflow.proto.TensorShapeProtos.getDescriptor();
    +    org.tensorflow.proto.TypesProtos.getDescriptor();
    +  }
    +
    +  // @@protoc_insertion_point(outer_class_scope)
    +}
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShape.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShape.java
    new file mode 100644
    index 00000000000..5612cb28e21
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShape.java
    @@ -0,0 +1,652 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/remote_tensor_handle.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto.eager;
    +
    +/**
    + * Protobuf type {@code tensorflow.eager.ResourceDtypeAndShape}
    + */
    +public final class ResourceDtypeAndShape extends
    +    com.google.protobuf.GeneratedMessage implements
    +    // @@protoc_insertion_point(message_implements:tensorflow.eager.ResourceDtypeAndShape)
    +    ResourceDtypeAndShapeOrBuilder {
    +private static final long serialVersionUID = 0L;
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +      /* major= */ 4,
    +      /* minor= */ 28,
    +      /* patch= */ 3,
    +      /* suffix= */ "",
    +      ResourceDtypeAndShape.class.getName());
    +  }
    +  // Use ResourceDtypeAndShape.newBuilder() to construct.
    +  private ResourceDtypeAndShape(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
    +  }
    +  private ResourceDtypeAndShape() {
    +    dtype_ = 0;
    +  }
    +
    +  public static final com.google.protobuf.Descriptors.Descriptor
    +      getDescriptor() {
    +    return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor;
    +  }
    +
    +  @java.lang.Override
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +      internalGetFieldAccessorTable() {
    +    return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable
    +        .ensureFieldAccessorsInitialized(
    +            org.tensorflow.proto.eager.ResourceDtypeAndShape.class, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder.class);
    +  }
    +
    +  private int bitField0_;
    +  public static final int DTYPE_FIELD_NUMBER = 1;
    +  private int dtype_ = 0;
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  @java.lang.Override public int getDtypeValue() {
    +    return dtype_;
    +  }
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The dtype.
    +   */
    +  @java.lang.Override public org.tensorflow.proto.DataType getDtype() {
    +    org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +    return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +  }
    +
    +  public static final int SHAPE_FIELD_NUMBER = 2;
    +  private org.tensorflow.proto.TensorShapeProto shape_;
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   * @return Whether the shape field is set.
    +   */
    +  @java.lang.Override
    +  public boolean hasShape() {
    +    return ((bitField0_ & 0x00000001) != 0);
    +  }
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   * @return The shape.
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.TensorShapeProto getShape() {
    +    return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +  }
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   */
    +  @java.lang.Override
    +  public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() {
    +    return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +  }
    +
    +  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 (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      output.writeEnum(1, dtype_);
    +    }
    +    if (((bitField0_ & 0x00000001) != 0)) {
    +      output.writeMessage(2, getShape());
    +    }
    +    getUnknownFields().writeTo(output);
    +  }
    +
    +  @java.lang.Override
    +  public int getSerializedSize() {
    +    int size = memoizedSize;
    +    if (size != -1) return size;
    +
    +    size = 0;
    +    if (dtype_ != org.tensorflow.proto.DataType.DT_INVALID.getNumber()) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeEnumSize(1, dtype_);
    +    }
    +    if (((bitField0_ & 0x00000001) != 0)) {
    +      size += com.google.protobuf.CodedOutputStream
    +        .computeMessageSize(2, getShape());
    +    }
    +    size += getUnknownFields().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.eager.ResourceDtypeAndShape)) {
    +      return super.equals(obj);
    +    }
    +    org.tensorflow.proto.eager.ResourceDtypeAndShape other = (org.tensorflow.proto.eager.ResourceDtypeAndShape) obj;
    +
    +    if (dtype_ != other.dtype_) return false;
    +    if (hasShape() != other.hasShape()) return false;
    +    if (hasShape()) {
    +      if (!getShape()
    +          .equals(other.getShape())) return false;
    +    }
    +    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DTYPE_FIELD_NUMBER;
    +    hash = (53 * hash) + dtype_;
    +    if (hasShape()) {
    +      hash = (37 * hash) + SHAPE_FIELD_NUMBER;
    +      hash = (53 * hash) + getShape().hashCode();
    +    }
    +    hash = (29 * hash) + getUnknownFields().hashCode();
    +    memoizedHashCode = hash;
    +    return hash;
    +  }
    +
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(
    +      java.nio.ByteBuffer data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape 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.eager.ResourceDtypeAndShape parseFrom(
    +      com.google.protobuf.ByteString data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape 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.eager.ResourceDtypeAndShape parseFrom(byte[] data)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(
    +      byte[] data,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws com.google.protobuf.InvalidProtocolBufferException {
    +    return PARSER.parseFrom(data, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input, extensionRegistry);
    +  }
    +
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseDelimitedFrom(java.io.InputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input);
    +  }
    +
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseDelimitedFrom(
    +      java.io.InputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(
    +      com.google.protobuf.CodedInputStream input)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .parseWithIOException(PARSER, input);
    +  }
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape parseFrom(
    +      com.google.protobuf.CodedInputStream input,
    +      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +      throws java.io.IOException {
    +    return com.google.protobuf.GeneratedMessage
    +        .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.eager.ResourceDtypeAndShape 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.GeneratedMessage.BuilderParent parent) {
    +    Builder builder = new Builder(parent);
    +    return builder;
    +  }
    +  /**
    +   * Protobuf type {@code tensorflow.eager.ResourceDtypeAndShape}
    +   */
    +  public static final class Builder extends
    +      com.google.protobuf.GeneratedMessage.Builder implements
    +      // @@protoc_insertion_point(builder_implements:tensorflow.eager.ResourceDtypeAndShape)
    +      org.tensorflow.proto.eager.ResourceDtypeAndShapeOrBuilder {
    +    public static final com.google.protobuf.Descriptors.Descriptor
    +        getDescriptor() {
    +      return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
    +        internalGetFieldAccessorTable() {
    +      return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_fieldAccessorTable
    +          .ensureFieldAccessorsInitialized(
    +              org.tensorflow.proto.eager.ResourceDtypeAndShape.class, org.tensorflow.proto.eager.ResourceDtypeAndShape.Builder.class);
    +    }
    +
    +    // Construct using org.tensorflow.proto.eager.ResourceDtypeAndShape.newBuilder()
    +    private Builder() {
    +      maybeForceBuilderInitialization();
    +    }
    +
    +    private Builder(
    +        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    +      super(parent);
    +      maybeForceBuilderInitialization();
    +    }
    +    private void maybeForceBuilderInitialization() {
    +      if (com.google.protobuf.GeneratedMessage
    +              .alwaysUseFieldBuilders) {
    +        getShapeFieldBuilder();
    +      }
    +    }
    +    @java.lang.Override
    +    public Builder clear() {
    +      super.clear();
    +      bitField0_ = 0;
    +      dtype_ = 0;
    +      shape_ = null;
    +      if (shapeBuilder_ != null) {
    +        shapeBuilder_.dispose();
    +        shapeBuilder_ = null;
    +      }
    +      return this;
    +    }
    +
    +    @java.lang.Override
    +    public com.google.protobuf.Descriptors.Descriptor
    +        getDescriptorForType() {
    +      return org.tensorflow.proto.eager.RemoteTensorHandleProtos.internal_static_tensorflow_eager_ResourceDtypeAndShape_descriptor;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.eager.ResourceDtypeAndShape getDefaultInstanceForType() {
    +      return org.tensorflow.proto.eager.ResourceDtypeAndShape.getDefaultInstance();
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.eager.ResourceDtypeAndShape build() {
    +      org.tensorflow.proto.eager.ResourceDtypeAndShape result = buildPartial();
    +      if (!result.isInitialized()) {
    +        throw newUninitializedMessageException(result);
    +      }
    +      return result;
    +    }
    +
    +    @java.lang.Override
    +    public org.tensorflow.proto.eager.ResourceDtypeAndShape buildPartial() {
    +      org.tensorflow.proto.eager.ResourceDtypeAndShape result = new org.tensorflow.proto.eager.ResourceDtypeAndShape(this);
    +      if (bitField0_ != 0) { buildPartial0(result); }
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(org.tensorflow.proto.eager.ResourceDtypeAndShape result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.dtype_ = dtype_;
    +      }
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.shape_ = shapeBuilder_ == null
    +            ? shape_
    +            : shapeBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
    +    @java.lang.Override
    +    public Builder mergeFrom(com.google.protobuf.Message other) {
    +      if (other instanceof org.tensorflow.proto.eager.ResourceDtypeAndShape) {
    +        return mergeFrom((org.tensorflow.proto.eager.ResourceDtypeAndShape)other);
    +      } else {
    +        super.mergeFrom(other);
    +        return this;
    +      }
    +    }
    +
    +    public Builder mergeFrom(org.tensorflow.proto.eager.ResourceDtypeAndShape other) {
    +      if (other == org.tensorflow.proto.eager.ResourceDtypeAndShape.getDefaultInstance()) return this;
    +      if (other.dtype_ != 0) {
    +        setDtypeValue(other.getDtypeValue());
    +      }
    +      if (other.hasShape()) {
    +        mergeShape(other.getShape());
    +      }
    +      this.mergeUnknownFields(other.getUnknownFields());
    +      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 {
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
    +      try {
    +        boolean done = false;
    +        while (!done) {
    +          int tag = input.readTag();
    +          switch (tag) {
    +            case 0:
    +              done = true;
    +              break;
    +            case 8: {
    +              dtype_ = input.readEnum();
    +              bitField0_ |= 0x00000001;
    +              break;
    +            } // case 8
    +            case 18: {
    +              input.readMessage(
    +                  getShapeFieldBuilder().getBuilder(),
    +                  extensionRegistry);
    +              bitField0_ |= 0x00000002;
    +              break;
    +            } // case 18
    +            default: {
    +              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
    +                done = true; // was an endgroup tag
    +              }
    +              break;
    +            } // default:
    +          } // switch (tag)
    +        } // while (!done)
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.unwrapIOException();
    +      } finally {
    +        onChanged();
    +      } // finally
    +      return this;
    +    }
    +    private int bitField0_;
    +
    +    private int dtype_ = 0;
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return The enum numeric value on the wire for dtype.
    +     */
    +    @java.lang.Override public int getDtypeValue() {
    +      return dtype_;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @param value The enum numeric value on the wire for dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtypeValue(int value) {
    +      dtype_ = value;
    +      bitField0_ |= 0x00000001;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return The dtype.
    +     */
    +    @java.lang.Override
    +    public org.tensorflow.proto.DataType getDtype() {
    +      org.tensorflow.proto.DataType result = org.tensorflow.proto.DataType.forNumber(dtype_);
    +      return result == null ? org.tensorflow.proto.DataType.UNRECOGNIZED : result;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @param value The dtype to set.
    +     * @return This builder for chaining.
    +     */
    +    public Builder setDtype(org.tensorflow.proto.DataType value) {
    +      if (value == null) {
    +        throw new NullPointerException();
    +      }
    +      bitField0_ |= 0x00000001;
    +      dtype_ = value.getNumber();
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.DataType dtype = 1;
    +     * @return This builder for chaining.
    +     */
    +    public Builder clearDtype() {
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      dtype_ = 0;
    +      onChanged();
    +      return this;
    +    }
    +
    +    private org.tensorflow.proto.TensorShapeProto shape_;
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> shapeBuilder_;
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     * @return Whether the shape field is set.
    +     */
    +    public boolean hasShape() {
    +      return ((bitField0_ & 0x00000002) != 0);
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     * @return The shape.
    +     */
    +    public org.tensorflow.proto.TensorShapeProto getShape() {
    +      if (shapeBuilder_ == null) {
    +        return shape_ == null ? org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +      } else {
    +        return shapeBuilder_.getMessage();
    +      }
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public Builder setShape(org.tensorflow.proto.TensorShapeProto value) {
    +      if (shapeBuilder_ == null) {
    +        if (value == null) {
    +          throw new NullPointerException();
    +        }
    +        shape_ = value;
    +      } else {
    +        shapeBuilder_.setMessage(value);
    +      }
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public Builder setShape(
    +        org.tensorflow.proto.TensorShapeProto.Builder builderForValue) {
    +      if (shapeBuilder_ == null) {
    +        shape_ = builderForValue.build();
    +      } else {
    +        shapeBuilder_.setMessage(builderForValue.build());
    +      }
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public Builder mergeShape(org.tensorflow.proto.TensorShapeProto value) {
    +      if (shapeBuilder_ == null) {
    +        if (((bitField0_ & 0x00000002) != 0) &&
    +          shape_ != null &&
    +          shape_ != org.tensorflow.proto.TensorShapeProto.getDefaultInstance()) {
    +          getShapeBuilder().mergeFrom(value);
    +        } else {
    +          shape_ = value;
    +        }
    +      } else {
    +        shapeBuilder_.mergeFrom(value);
    +      }
    +      if (shape_ != null) {
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public Builder clearShape() {
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      shape_ = null;
    +      if (shapeBuilder_ != null) {
    +        shapeBuilder_.dispose();
    +        shapeBuilder_ = null;
    +      }
    +      onChanged();
    +      return this;
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public org.tensorflow.proto.TensorShapeProto.Builder getShapeBuilder() {
    +      bitField0_ |= 0x00000002;
    +      onChanged();
    +      return getShapeFieldBuilder().getBuilder();
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    public org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder() {
    +      if (shapeBuilder_ != null) {
    +        return shapeBuilder_.getMessageOrBuilder();
    +      } else {
    +        return shape_ == null ?
    +            org.tensorflow.proto.TensorShapeProto.getDefaultInstance() : shape_;
    +      }
    +    }
    +    /**
    +     * .tensorflow.TensorShapeProto shape = 2;
    +     */
    +    private com.google.protobuf.SingleFieldBuilder<
    +        org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder> 
    +        getShapeFieldBuilder() {
    +      if (shapeBuilder_ == null) {
    +        shapeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
    +            org.tensorflow.proto.TensorShapeProto, org.tensorflow.proto.TensorShapeProto.Builder, org.tensorflow.proto.TensorShapeProtoOrBuilder>(
    +                getShape(),
    +                getParentForChildren(),
    +                isClean());
    +        shape_ = null;
    +      }
    +      return shapeBuilder_;
    +    }
    +
    +    // @@protoc_insertion_point(builder_scope:tensorflow.eager.ResourceDtypeAndShape)
    +  }
    +
    +  // @@protoc_insertion_point(class_scope:tensorflow.eager.ResourceDtypeAndShape)
    +  private static final org.tensorflow.proto.eager.ResourceDtypeAndShape DEFAULT_INSTANCE;
    +  static {
    +    DEFAULT_INSTANCE = new org.tensorflow.proto.eager.ResourceDtypeAndShape();
    +  }
    +
    +  public static org.tensorflow.proto.eager.ResourceDtypeAndShape getDefaultInstance() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +  private static final com.google.protobuf.Parser
    +      PARSER = new com.google.protobuf.AbstractParser() {
    +    @java.lang.Override
    +    public ResourceDtypeAndShape parsePartialFrom(
    +        com.google.protobuf.CodedInputStream input,
    +        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    +        throws com.google.protobuf.InvalidProtocolBufferException {
    +      Builder builder = newBuilder();
    +      try {
    +        builder.mergeFrom(input, extensionRegistry);
    +      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +        throw e.setUnfinishedMessage(builder.buildPartial());
    +      } catch (com.google.protobuf.UninitializedMessageException e) {
    +        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +      } catch (java.io.IOException e) {
    +        throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +            .setUnfinishedMessage(builder.buildPartial());
    +      }
    +      return builder.buildPartial();
    +    }
    +  };
    +
    +  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.eager.ResourceDtypeAndShape getDefaultInstanceForType() {
    +    return DEFAULT_INSTANCE;
    +  }
    +
    +}
    +
    diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShapeOrBuilder.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShapeOrBuilder.java
    new file mode 100644
    index 00000000000..62bf875b768
    --- /dev/null
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/eager/ResourceDtypeAndShapeOrBuilder.java
    @@ -0,0 +1,37 @@
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: tensorflow/core/protobuf/remote_tensor_handle.proto
    +// Protobuf Java Version: 4.28.3
    +
    +package org.tensorflow.proto.eager;
    +
    +public interface ResourceDtypeAndShapeOrBuilder extends
    +    // @@protoc_insertion_point(interface_extends:tensorflow.eager.ResourceDtypeAndShape)
    +    com.google.protobuf.MessageOrBuilder {
    +
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The enum numeric value on the wire for dtype.
    +   */
    +  int getDtypeValue();
    +  /**
    +   * .tensorflow.DataType dtype = 1;
    +   * @return The dtype.
    +   */
    +  org.tensorflow.proto.DataType getDtype();
    +
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   * @return Whether the shape field is set.
    +   */
    +  boolean hasShape();
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   * @return The shape.
    +   */
    +  org.tensorflow.proto.TensorShapeProto getShape();
    +  /**
    +   * .tensorflow.TensorShapeProto shape = 2;
    +   */
    +  org.tensorflow.proto.TensorShapeProtoOrBuilder getShapeOrBuilder();
    +}
    diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Code.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/Code.java
    similarity index 85%
    rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Code.java
    rename to tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/Code.java
    index c7eda03f92a..ccc93676255 100644
    --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/proto/framework/Code.java
    +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/Code.java
    @@ -1,18 +1,23 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
    -// source: tensorflow/core/protobuf/error_codes.proto
    +// NO CHECKED-IN PROTOBUF GENCODE
    +// source: xla/tsl/protobuf/error_codes.proto
    +// Protobuf Java Version: 4.28.3
     
    -package org.tensorflow.proto.framework;
    +package org.tensorflow.proto.error;
     
     /**
      * 
      * The canonical error codes for TensorFlow APIs.
    + *
      * Warnings:
    + *
      * -   Do not change any numeric assignments.
      * -   Changes to this list should only be made if there is a compelling
    - *     need that can't be satisfied in another way.  Such changes
    - *     must be approved by at least two OWNERS.
    + * need that can't be satisfied in another way.  Such changes
    + * must be approved by at least two OWNERS.
      * -   These error codes must match gRPC and protobuf error codes (except for
    - *     DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_).
    + * DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_).
    + *
      * Sometimes multiple error codes may apply.  Services should return
      * the most specific error code that applies.  For example, prefer
      * OUT_OF_RANGE over FAILED_PRECONDITION if both codes apply.
    @@ -130,20 +135,21 @@ public enum Code
        * required for the operation's execution.  For example, directory
        * to be deleted may be non-empty, an rmdir operation is applied to
        * a non-directory, etc.
    +   *
        * A litmus test that may help a service implementor in deciding
        * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
    -   *  (a) Use UNAVAILABLE if the client can retry just the failing call.
    -   *  (b) Use ABORTED if the client should retry at a higher-level
    -   *      (e.g., restarting a read-modify-write sequence).
    -   *  (c) Use FAILED_PRECONDITION if the client should not retry until
    -   *      the system state has been explicitly fixed.  E.g., if an "rmdir"
    -   *      fails because the directory is non-empty, FAILED_PRECONDITION
    -   *      should be returned since the client should not retry unless
    -   *      they have first fixed up the directory by deleting files from it.
    -   *  (d) Use FAILED_PRECONDITION if the client performs conditional
    -   *      REST Get/Update/Delete on a resource and the resource on the
    -   *      server does not match the condition. E.g., conflicting
    -   *      read-modify-write on the same resource.
    +   * (a) Use UNAVAILABLE if the client can retry just the failing call.
    +   * (b) Use ABORTED if the client should retry at a higher-level
    +   * (e.g., restarting a read-modify-write sequence).
    +   * (c) Use FAILED_PRECONDITION if the client should not retry until
    +   * the system state has been explicitly fixed.  E.g., if an "rmdir"
    +   * fails because the directory is non-empty, FAILED_PRECONDITION
    +   * should be returned since the client should not retry unless
    +   * they have first fixed up the directory by deleting files from it.
    +   * (d) Use FAILED_PRECONDITION if the client performs conditional
    +   * REST Get/Update/Delete on a resource and the resource on the
    +   * server does not match the condition. E.g., conflicting
    +   * read-modify-write on the same resource.
        * 
    * * FAILED_PRECONDITION = 9; @@ -153,6 +159,7 @@ public enum Code *
        * The operation was aborted, typically due to a concurrency issue
        * like sequencer check failures, transaction aborts, etc.
    +   *
        * See litmus test above for deciding between FAILED_PRECONDITION,
        * ABORTED, and UNAVAILABLE.
        * 
    @@ -164,12 +171,14 @@ public enum Code *
        * Operation tried to iterate past the valid input range.  E.g., seeking or
        * reading past end of file.
    +   *
        * Unlike INVALID_ARGUMENT, this error indicates a problem that may
        * be fixed if the system state changes. For example, a 32-bit file
        * system will generate INVALID_ARGUMENT if asked to read at an
        * offset that is not in the range [0,2^32-1], but it will generate
        * OUT_OF_RANGE if asked to read from an offset past the current
        * file size.
    +   *
        * There is a fair bit of overlap between FAILED_PRECONDITION and
        * OUT_OF_RANGE.  We recommend using OUT_OF_RANGE (the more specific
        * error) when it applies so that callers who are iterating through
    @@ -203,6 +212,7 @@ public enum Code
        * The service is currently unavailable.  This is a most likely a
        * transient condition and may be corrected by retrying with
        * a backoff.
    +   *
        * See litmus test above for deciding between FAILED_PRECONDITION,
        * ABORTED, and UNAVAILABLE.
        * 
    @@ -222,9 +232,11 @@ public enum Code *
        * An extra enum entry to prevent people from writing code that
        * fails to compile when a new code is added.
    +   *
        * Nobody should ever reference this enumeration entry. In particular,
        * if you write C++ code that switches on this enumeration, add a default:
        * case instead of a case that mentions this enumeration entry.
    +   *
        * Nobody should rely on the value (currently 20) listed here.  It
        * may change in the future.
        * 
    @@ -235,6 +247,15 @@ public enum Code UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Code.class.getName()); + } /** *
        * Not an error; returned on success
    @@ -342,20 +363,21 @@ public enum Code
        * required for the operation's execution.  For example, directory
        * to be deleted may be non-empty, an rmdir operation is applied to
        * a non-directory, etc.
    +   *
        * A litmus test that may help a service implementor in deciding
        * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
    -   *  (a) Use UNAVAILABLE if the client can retry just the failing call.
    -   *  (b) Use ABORTED if the client should retry at a higher-level
    -   *      (e.g., restarting a read-modify-write sequence).
    -   *  (c) Use FAILED_PRECONDITION if the client should not retry until
    -   *      the system state has been explicitly fixed.  E.g., if an "rmdir"
    -   *      fails because the directory is non-empty, FAILED_PRECONDITION
    -   *      should be returned since the client should not retry unless
    -   *      they have first fixed up the directory by deleting files from it.
    -   *  (d) Use FAILED_PRECONDITION if the client performs conditional
    -   *      REST Get/Update/Delete on a resource and the resource on the
    -   *      server does not match the condition. E.g., conflicting
    -   *      read-modify-write on the same resource.
    +   * (a) Use UNAVAILABLE if the client can retry just the failing call.
    +   * (b) Use ABORTED if the client should retry at a higher-level
    +   * (e.g., restarting a read-modify-write sequence).
    +   * (c) Use FAILED_PRECONDITION if the client should not retry until
    +   * the system state has been explicitly fixed.  E.g., if an "rmdir"
    +   * fails because the directory is non-empty, FAILED_PRECONDITION
    +   * should be returned since the client should not retry unless
    +   * they have first fixed up the directory by deleting files from it.
    +   * (d) Use FAILED_PRECONDITION if the client performs conditional
    +   * REST Get/Update/Delete on a resource and the resource on the
    +   * server does not match the condition. E.g., conflicting
    +   * read-modify-write on the same resource.
        * 
    * * FAILED_PRECONDITION = 9; @@ -365,6 +387,7 @@ public enum Code *
        * The operation was aborted, typically due to a concurrency issue
        * like sequencer check failures, transaction aborts, etc.
    +   *
        * See litmus test above for deciding between FAILED_PRECONDITION,
        * ABORTED, and UNAVAILABLE.
        * 
    @@ -376,12 +399,14 @@ public enum Code *
        * Operation tried to iterate past the valid input range.  E.g., seeking or
        * reading past end of file.
    +   *
        * Unlike INVALID_ARGUMENT, this error indicates a problem that may
        * be fixed if the system state changes. For example, a 32-bit file
        * system will generate INVALID_ARGUMENT if asked to read at an
        * offset that is not in the range [0,2^32-1], but it will generate
        * OUT_OF_RANGE if asked to read from an offset past the current
        * file size.
    +   *
        * There is a fair bit of overlap between FAILED_PRECONDITION and
        * OUT_OF_RANGE.  We recommend using OUT_OF_RANGE (the more specific
        * error) when it applies so that callers who are iterating through
    @@ -415,6 +440,7 @@ public enum Code
        * The service is currently unavailable.  This is a most likely a
        * transient condition and may be corrected by retrying with
        * a backoff.
    +   *
        * See litmus test above for deciding between FAILED_PRECONDITION,
        * ABORTED, and UNAVAILABLE.
        * 
    @@ -434,9 +460,11 @@ public enum Code *
        * An extra enum entry to prevent people from writing code that
        * fails to compile when a new code is added.
    +   *
        * Nobody should ever reference this enumeration entry. In particular,
        * if you write C++ code that switches on this enumeration, add a default:
        * case instead of a case that mentions this enumeration entry.
    +   *
        * Nobody should rely on the value (currently 20) listed here.  It
        * may change in the future.
        * 
    @@ -455,6 +483,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -462,6 +492,10 @@ public static Code valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static Code forNumber(int value) { switch (value) { case 0: return OK; @@ -500,6 +534,10 @@ public Code findValueByNumber(int number) { public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor @@ -508,7 +546,7 @@ public Code findValueByNumber(int number) { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return org.tensorflow.proto.framework.ErrorCodesProtos.getDescriptor().getEnumTypes().get(0); + return org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor().getEnumTypes().get(0); } private static final Code[] VALUES = values(); diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/ErrorCodesProtos.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/ErrorCodesProtos.java new file mode 100644 index 00000000000..929653c772d --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/ErrorCodesProtos.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: xla/tsl/protobuf/error_codes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.error; + +public final class ErrorCodesProtos { + private ErrorCodesProtos() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ErrorCodesProtos.class.getName()); + } + 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 static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\"xla/tsl/protobuf/error_codes.proto\022\020te" + + "nsorflow.error*\204\003\n\004Code\022\006\n\002OK\020\000\022\r\n\tCANCE" + + "LLED\020\001\022\013\n\007UNKNOWN\020\002\022\024\n\020INVALID_ARGUMENT\020" + + "\003\022\025\n\021DEADLINE_EXCEEDED\020\004\022\r\n\tNOT_FOUND\020\005\022" + + "\022\n\016ALREADY_EXISTS\020\006\022\025\n\021PERMISSION_DENIED" + + "\020\007\022\023\n\017UNAUTHENTICATED\020\020\022\026\n\022RESOURCE_EXHA" + + "USTED\020\010\022\027\n\023FAILED_PRECONDITION\020\t\022\013\n\007ABOR" + + "TED\020\n\022\020\n\014OUT_OF_RANGE\020\013\022\021\n\rUNIMPLEMENTED" + + "\020\014\022\014\n\010INTERNAL\020\r\022\017\n\013UNAVAILABLE\020\016\022\r\n\tDAT" + + "A_LOSS\020\017\022K\nGDO_NOT_USE_RESERVED_FOR_FUTU" + + "RE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTE" + + "AD_\020\024Bs\n\032org.tensorflow.proto.errorB\020Err" + + "orCodesProtosP\001Z>github.com/google/tsl/t" + + "sl/go/protobuf/for_core_protos_go_proto\370" + + "\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/dummy/ErrorCodes.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/dummy/ErrorCodes.java new file mode 100644 index 00000000000..508d4b92941 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/error/dummy/ErrorCodes.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tensorflow/core/protobuf/error_codes.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.error.dummy; + +public final class ErrorCodes { + private ErrorCodes() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + ErrorCodes.class.getName()); + } + 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 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/error_codes.p" + + "roto\022\026tensorflow.error.dummy\032\"xla/tsl/pr" + + "otobuf/error_codes.protoBy\n org.tensorfl" + + "ow.proto.error.dummyZUgithub.com/tensorf" + + "low/tensorflow/tensorflow/go/core/protob" + + "uf/for_core_protos_go_protoP\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor(), + }); + descriptor.resolveAllFeaturesImmutable(); + org.tensorflow.proto.error.ErrorCodesProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/profiler/Xplane.java b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/profiler/Xplane.java new file mode 100644 index 00000000000..957746c4e45 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/proto/profiler/Xplane.java @@ -0,0 +1,11154 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: tsl/profiler/protobuf/xplane.proto +// Protobuf Java Version: 4.28.3 + +package org.tensorflow.proto.profiler; + +public final class Xplane { + private Xplane() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Xplane.class.getName()); + } + 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 XSpaceOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XSpace) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + java.util.List + getPlanesList(); + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + org.tensorflow.proto.profiler.Xplane.XPlane getPlanes(int index); + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + int getPlanesCount(); + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + java.util.List + getPlanesOrBuilderList(); + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder getPlanesOrBuilder( + int index); + + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @return A list containing the errors. + */ + java.util.List + getErrorsList(); + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @return The count of errors. + */ + int getErrorsCount(); + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @param index The index of the element to return. + * @return The errors at the given index. + */ + java.lang.String getErrors(int index); + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @param index The index of the value to return. + * @return The bytes of the errors at the given index. + */ + com.google.protobuf.ByteString + getErrorsBytes(int index); + + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @return A list containing the warnings. + */ + java.util.List + getWarningsList(); + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @return The count of warnings. + */ + int getWarningsCount(); + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + java.lang.String getWarnings(int index); + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + com.google.protobuf.ByteString + getWarningsBytes(int index); + + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @return A list containing the hostnames. + */ + java.util.List + getHostnamesList(); + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @return The count of hostnames. + */ + int getHostnamesCount(); + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @param index The index of the element to return. + * @return The hostnames at the given index. + */ + java.lang.String getHostnames(int index); + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @param index The index of the value to return. + * @return The bytes of the hostnames at the given index. + */ + com.google.protobuf.ByteString + getHostnamesBytes(int index); + } + /** + *
    +   * A container of parallel XPlanes, generated by one or more profiling sources.
    +   * Next ID: 5
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XSpace} + */ + public static final class XSpace extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XSpace) + XSpaceOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XSpace.class.getName()); + } + // Use XSpace.newBuilder() to construct. + private XSpace(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XSpace() { + planes_ = java.util.Collections.emptyList(); + errors_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + warnings_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + hostnames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XSpace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XSpace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XSpace.class, org.tensorflow.proto.profiler.Xplane.XSpace.Builder.class); + } + + public static final int PLANES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List planes_; + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + @java.lang.Override + public java.util.List getPlanesList() { + return planes_; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + @java.lang.Override + public java.util.List + getPlanesOrBuilderList() { + return planes_; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + @java.lang.Override + public int getPlanesCount() { + return planes_.size(); + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XPlane getPlanes(int index) { + return planes_.get(index); + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder getPlanesOrBuilder( + int index) { + return planes_.get(index); + } + + public static final int ERRORS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList errors_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @return A list containing the errors. + */ + public com.google.protobuf.ProtocolStringList + getErrorsList() { + return errors_; + } + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @return The count of errors. + */ + public int getErrorsCount() { + return errors_.size(); + } + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @param index The index of the element to return. + * @return The errors at the given index. + */ + public java.lang.String getErrors(int index) { + return errors_.get(index); + } + /** + *
    +     * Errors (if any) in the generation of planes.
    +     * 
    + * + * repeated string errors = 2; + * @param index The index of the value to return. + * @return The bytes of the errors at the given index. + */ + public com.google.protobuf.ByteString + getErrorsBytes(int index) { + return errors_.getByteString(index); + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList warnings_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList + getWarningsList() { + return warnings_; + } + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + *
    +     * Warnings (if any) in the generation of planes;
    +     * 
    + * + * repeated string warnings = 3; + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString + getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + + public static final int HOSTNAMES_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList hostnames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @return A list containing the hostnames. + */ + public com.google.protobuf.ProtocolStringList + getHostnamesList() { + return hostnames_; + } + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @return The count of hostnames. + */ + public int getHostnamesCount() { + return hostnames_.size(); + } + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @param index The index of the element to return. + * @return The hostnames at the given index. + */ + public java.lang.String getHostnames(int index) { + return hostnames_.get(index); + } + /** + *
    +     * List of hostnames that XPlanes are generated from.
    +     * 
    + * + * repeated string hostnames = 4; + * @param index The index of the value to return. + * @return The bytes of the hostnames at the given index. + */ + public com.google.protobuf.ByteString + getHostnamesBytes(int index) { + return hostnames_.getByteString(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 { + for (int i = 0; i < planes_.size(); i++) { + output.writeMessage(1, planes_.get(i)); + } + for (int i = 0; i < errors_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, errors_.getRaw(i)); + } + for (int i = 0; i < warnings_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, warnings_.getRaw(i)); + } + for (int i = 0; i < hostnames_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, hostnames_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < planes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, planes_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < errors_.size(); i++) { + dataSize += computeStringSizeNoTag(errors_.getRaw(i)); + } + size += dataSize; + size += 1 * getErrorsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < warnings_.size(); i++) { + dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); + } + 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 += getUnknownFields().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.Xplane.XSpace)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XSpace other = (org.tensorflow.proto.profiler.Xplane.XSpace) obj; + + if (!getPlanesList() + .equals(other.getPlanesList())) return false; + if (!getErrorsList() + .equals(other.getErrorsList())) return false; + if (!getWarningsList() + .equals(other.getWarningsList())) return false; + if (!getHostnamesList() + .equals(other.getHostnamesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPlanesCount() > 0) { + hash = (37 * hash) + PLANES_FIELD_NUMBER; + hash = (53 * hash) + getPlanesList().hashCode(); + } + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + if (getWarningsCount() > 0) { + 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace 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.Xplane.XSpace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace 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.Xplane.XSpace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XSpace parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XSpace parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XSpace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XSpace 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * A container of parallel XPlanes, generated by one or more profiling sources.
    +     * Next ID: 5
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XSpace} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XSpace) + org.tensorflow.proto.profiler.Xplane.XSpaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XSpace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XSpace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XSpace.class, org.tensorflow.proto.profiler.Xplane.XSpace.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XSpace.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (planesBuilder_ == null) { + planes_ = java.util.Collections.emptyList(); + } else { + planes_ = null; + planesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + errors_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + warnings_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + hostnames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XSpace_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XSpace getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XSpace.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XSpace build() { + org.tensorflow.proto.profiler.Xplane.XSpace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XSpace buildPartial() { + org.tensorflow.proto.profiler.Xplane.XSpace result = new org.tensorflow.proto.profiler.Xplane.XSpace(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.profiler.Xplane.XSpace result) { + if (planesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + planes_ = java.util.Collections.unmodifiableList(planes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.planes_ = planes_; + } else { + result.planes_ = planesBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XSpace result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + errors_.makeImmutable(); + result.errors_ = errors_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + warnings_.makeImmutable(); + result.warnings_ = warnings_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + hostnames_.makeImmutable(); + result.hostnames_ = hostnames_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XSpace) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XSpace)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XSpace other) { + if (other == org.tensorflow.proto.profiler.Xplane.XSpace.getDefaultInstance()) return this; + if (planesBuilder_ == null) { + if (!other.planes_.isEmpty()) { + if (planes_.isEmpty()) { + planes_ = other.planes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePlanesIsMutable(); + planes_.addAll(other.planes_); + } + onChanged(); + } + } else { + if (!other.planes_.isEmpty()) { + if (planesBuilder_.isEmpty()) { + planesBuilder_.dispose(); + planesBuilder_ = null; + planes_ = other.planes_; + bitField0_ = (bitField0_ & ~0x00000001); + planesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPlanesFieldBuilder() : null; + } else { + planesBuilder_.addAllMessages(other.planes_); + } + } + } + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ |= 0x00000002; + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ |= 0x00000004; + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + if (!other.hostnames_.isEmpty()) { + if (hostnames_.isEmpty()) { + hostnames_ = other.hostnames_; + bitField0_ |= 0x00000008; + } else { + ensureHostnamesIsMutable(); + hostnames_.addAll(other.hostnames_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + org.tensorflow.proto.profiler.Xplane.XPlane m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XPlane.parser(), + extensionRegistry); + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + planes_.add(m); + } else { + planesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + ensureErrorsIsMutable(); + errors_.add(s); + break; + } // case 18 + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + ensureWarningsIsMutable(); + warnings_.add(s); + break; + } // case 26 + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + ensureHostnamesIsMutable(); + hostnames_.add(s); + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List planes_ = + java.util.Collections.emptyList(); + private void ensurePlanesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + planes_ = new java.util.ArrayList(planes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XPlane, org.tensorflow.proto.profiler.Xplane.XPlane.Builder, org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder> planesBuilder_; + + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public java.util.List getPlanesList() { + if (planesBuilder_ == null) { + return java.util.Collections.unmodifiableList(planes_); + } else { + return planesBuilder_.getMessageList(); + } + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public int getPlanesCount() { + if (planesBuilder_ == null) { + return planes_.size(); + } else { + return planesBuilder_.getCount(); + } + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public org.tensorflow.proto.profiler.Xplane.XPlane getPlanes(int index) { + if (planesBuilder_ == null) { + return planes_.get(index); + } else { + return planesBuilder_.getMessage(index); + } + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder setPlanes( + int index, org.tensorflow.proto.profiler.Xplane.XPlane value) { + if (planesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlanesIsMutable(); + planes_.set(index, value); + onChanged(); + } else { + planesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder setPlanes( + int index, org.tensorflow.proto.profiler.Xplane.XPlane.Builder builderForValue) { + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + planes_.set(index, builderForValue.build()); + onChanged(); + } else { + planesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder addPlanes(org.tensorflow.proto.profiler.Xplane.XPlane value) { + if (planesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlanesIsMutable(); + planes_.add(value); + onChanged(); + } else { + planesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder addPlanes( + int index, org.tensorflow.proto.profiler.Xplane.XPlane value) { + if (planesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePlanesIsMutable(); + planes_.add(index, value); + onChanged(); + } else { + planesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder addPlanes( + org.tensorflow.proto.profiler.Xplane.XPlane.Builder builderForValue) { + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + planes_.add(builderForValue.build()); + onChanged(); + } else { + planesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder addPlanes( + int index, org.tensorflow.proto.profiler.Xplane.XPlane.Builder builderForValue) { + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + planes_.add(index, builderForValue.build()); + onChanged(); + } else { + planesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder addAllPlanes( + java.lang.Iterable values) { + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, planes_); + onChanged(); + } else { + planesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder clearPlanes() { + if (planesBuilder_ == null) { + planes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + planesBuilder_.clear(); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public Builder removePlanes(int index) { + if (planesBuilder_ == null) { + ensurePlanesIsMutable(); + planes_.remove(index); + onChanged(); + } else { + planesBuilder_.remove(index); + } + return this; + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public org.tensorflow.proto.profiler.Xplane.XPlane.Builder getPlanesBuilder( + int index) { + return getPlanesFieldBuilder().getBuilder(index); + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder getPlanesOrBuilder( + int index) { + if (planesBuilder_ == null) { + return planes_.get(index); } else { + return planesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public java.util.List + getPlanesOrBuilderList() { + if (planesBuilder_ != null) { + return planesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(planes_); + } + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public org.tensorflow.proto.profiler.Xplane.XPlane.Builder addPlanesBuilder() { + return getPlanesFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.XPlane.getDefaultInstance()); + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public org.tensorflow.proto.profiler.Xplane.XPlane.Builder addPlanesBuilder( + int index) { + return getPlanesFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.XPlane.getDefaultInstance()); + } + /** + * repeated .tensorflow.profiler.XPlane planes = 1; + */ + public java.util.List + getPlanesBuilderList() { + return getPlanesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XPlane, org.tensorflow.proto.profiler.Xplane.XPlane.Builder, org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder> + getPlanesFieldBuilder() { + if (planesBuilder_ == null) { + planesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XPlane, org.tensorflow.proto.profiler.Xplane.XPlane.Builder, org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder>( + planes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + planes_ = null; + } + return planesBuilder_; + } + + private com.google.protobuf.LazyStringArrayList errors_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureErrorsIsMutable() { + if (!errors_.isModifiable()) { + errors_ = new com.google.protobuf.LazyStringArrayList(errors_); + } + bitField0_ |= 0x00000002; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @return A list containing the errors. + */ + public com.google.protobuf.ProtocolStringList + getErrorsList() { + errors_.makeImmutable(); + return errors_; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @return The count of errors. + */ + public int getErrorsCount() { + return errors_.size(); + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param index The index of the element to return. + * @return The errors at the given index. + */ + public java.lang.String getErrors(int index) { + return errors_.get(index); + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param index The index of the value to return. + * @return The bytes of the errors at the given index. + */ + public com.google.protobuf.ByteString + getErrorsBytes(int index) { + return errors_.getByteString(index); + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param index The index to set the value at. + * @param value The errors to set. + * @return This builder for chaining. + */ + public Builder setErrors( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureErrorsIsMutable(); + errors_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param value The errors to add. + * @return This builder for chaining. + */ + public Builder addErrors( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureErrorsIsMutable(); + errors_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param values The errors to add. + * @return This builder for chaining. + */ + public Builder addAllErrors( + java.lang.Iterable values) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, errors_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @return This builder for chaining. + */ + public Builder clearErrors() { + errors_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002);; + onChanged(); + return this; + } + /** + *
    +       * Errors (if any) in the generation of planes.
    +       * 
    + * + * repeated string errors = 2; + * @param value The bytes of the errors to add. + * @return This builder for chaining. + */ + public Builder addErrorsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureErrorsIsMutable(); + errors_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList warnings_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureWarningsIsMutable() { + if (!warnings_.isModifiable()) { + warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); + } + bitField0_ |= 0x00000004; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList + getWarningsList() { + warnings_.makeImmutable(); + return warnings_; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString + getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param index The index to set the value at. + * @param value The warnings to set. + * @return This builder for chaining. + */ + public Builder setWarnings( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWarningsIsMutable(); + warnings_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param value The warnings to add. + * @return This builder for chaining. + */ + public Builder addWarnings( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureWarningsIsMutable(); + warnings_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param values The warnings to add. + * @return This builder for chaining. + */ + public Builder addAllWarnings( + java.lang.Iterable values) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, warnings_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @return This builder for chaining. + */ + public Builder clearWarnings() { + warnings_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004);; + onChanged(); + return this; + } + /** + *
    +       * Warnings (if any) in the generation of planes;
    +       * 
    + * + * repeated string warnings = 3; + * @param value The bytes of the warnings to add. + * @return This builder for chaining. + */ + public Builder addWarningsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureWarningsIsMutable(); + warnings_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList hostnames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureHostnamesIsMutable() { + if (!hostnames_.isModifiable()) { + hostnames_ = new com.google.protobuf.LazyStringArrayList(hostnames_); + } + bitField0_ |= 0x00000008; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @return A list containing the hostnames. + */ + public com.google.protobuf.ProtocolStringList + getHostnamesList() { + hostnames_.makeImmutable(); + return hostnames_; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @return The count of hostnames. + */ + public int getHostnamesCount() { + return hostnames_.size(); + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param index The index of the element to return. + * @return The hostnames at the given index. + */ + public java.lang.String getHostnames(int index) { + return hostnames_.get(index); + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param index The index of the value to return. + * @return The bytes of the hostnames at the given index. + */ + public com.google.protobuf.ByteString + getHostnamesBytes(int index) { + return hostnames_.getByteString(index); + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param index The index to set the value at. + * @param value The hostnames to set. + * @return This builder for chaining. + */ + public Builder setHostnames( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureHostnamesIsMutable(); + hostnames_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param value The hostnames to add. + * @return This builder for chaining. + */ + public Builder addHostnames( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureHostnamesIsMutable(); + hostnames_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param values The hostnames to add. + * @return This builder for chaining. + */ + public Builder addAllHostnames( + java.lang.Iterable values) { + ensureHostnamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, hostnames_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @return This builder for chaining. + */ + public Builder clearHostnames() { + hostnames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
    +       * List of hostnames that XPlanes are generated from.
    +       * 
    + * + * repeated string hostnames = 4; + * @param value The bytes of the hostnames to add. + * @return This builder for chaining. + */ + public Builder addHostnamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureHostnamesIsMutable(); + hostnames_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XSpace) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XSpace) + private static final org.tensorflow.proto.profiler.Xplane.XSpace DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XSpace(); + } + + public static org.tensorflow.proto.profiler.Xplane.XSpace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XSpace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XSpace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XPlaneOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XPlane) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
    +     * Name of this XPlane.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of this XPlane.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + java.util.List + getLinesList(); + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + org.tensorflow.proto.profiler.Xplane.XLine getLines(int index); + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + int getLinesCount(); + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + java.util.List + getLinesOrBuilderList(); + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + org.tensorflow.proto.profiler.Xplane.XLineOrBuilder getLinesOrBuilder( + int index); + + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + int getEventMetadataCount(); + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + boolean containsEventMetadata( + long key); + /** + * Use {@link #getEventMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getEventMetadata(); + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + java.util.Map + getEventMetadataMap(); + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata defaultValue); + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrThrow( + long key); + + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + int getStatMetadataCount(); + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + boolean containsStatMetadata( + long key); + /** + * Use {@link #getStatMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getStatMetadata(); + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + java.util.Map + getStatMetadataMap(); + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata defaultValue); + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrThrow( + long key); + + /** + *
    +     * 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; + */ + 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; + */ + org.tensorflow.proto.profiler.Xplane.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; + */ + 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; + */ + java.util.List + getStatsOrBuilderList(); + /** + *
    +     * 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; + */ + org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index); + } + /** + *
    +   * An XPlane is a container of parallel timelines (XLines), generated by a
    +   * profiling source or by post-processing one or more XPlanes.
    +   * Next ID: 7
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XPlane} + */ + public static final class XPlane extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XPlane) + XPlaneOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XPlane.class.getName()); + } + // Use XPlane.newBuilder() to construct. + private XPlane(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XPlane() { + name_ = ""; + lines_ = java.util.Collections.emptyList(); + stats_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetEventMetadata(); + case 5: + return internalGetStatMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XPlane.class, org.tensorflow.proto.profiler.Xplane.XPlane.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of this XPlane.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of this XPlane.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 LINES_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List lines_; + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + @java.lang.Override + public java.util.List getLinesList() { + return lines_; + } + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + @java.lang.Override + public java.util.List + getLinesOrBuilderList() { + return lines_; + } + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + @java.lang.Override + public int getLinesCount() { + return lines_.size(); + } + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XLine getLines(int index) { + return lines_.get(index); + } + /** + *
    +     * Parallel timelines grouped in this plane. XLines with the same id
    +     * are effectively the same timeline.
    +     * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XLineOrBuilder getLinesOrBuilder( + int index) { + return lines_.get(index); + } + + public static final int EVENT_METADATA_FIELD_NUMBER = 4; + private static final class EventMetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XEventMetadata> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT64, + 0L, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.profiler.Xplane.XEventMetadata.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XEventMetadata> eventMetadata_; + private com.google.protobuf.MapField + internalGetEventMetadata() { + if (eventMetadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EventMetadataDefaultEntryHolder.defaultEntry); + } + return eventMetadata_; + } + public int getEventMetadataCount() { + return internalGetEventMetadata().getMap().size(); + } + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public boolean containsEventMetadata( + long key) { + + return internalGetEventMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getEventMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEventMetadata() { + return getEventMetadataMap(); + } + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public java.util.Map getEventMetadataMap() { + return internalGetEventMetadata().getMap(); + } + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata defaultValue) { + + java.util.Map map = + internalGetEventMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +     * should be used for events that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrThrow( + long key) { + + java.util.Map map = + internalGetEventMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STAT_METADATA_FIELD_NUMBER = 5; + private static final class StatMetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XStatMetadata> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT64, + 0L, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + org.tensorflow.proto.profiler.Xplane.XStatMetadata.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XStatMetadata> statMetadata_; + private com.google.protobuf.MapField + internalGetStatMetadata() { + if (statMetadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + StatMetadataDefaultEntryHolder.defaultEntry); + } + return statMetadata_; + } + public int getStatMetadataCount() { + return internalGetStatMetadata().getMap().size(); + } + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public boolean containsStatMetadata( + long key) { + + return internalGetStatMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getStatMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getStatMetadata() { + return getStatMetadataMap(); + } + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public java.util.Map getStatMetadataMap() { + return internalGetStatMetadata().getMap(); + } + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata defaultValue) { + + java.util.Map map = + internalGetStatMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
    +     * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +     * should be used for stats that share the same ID over the whole XPlane.
    +     * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrThrow( + long key) { + + java.util.Map map = + internalGetStatMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATS_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List stats_; + /** + *
    +     * 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; + */ + @java.lang.Override + public java.util.List getStatsList() { + return stats_; + } + /** + *
    +     * 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; + */ + @java.lang.Override + public java.util.List + getStatsOrBuilderList() { + return stats_; + } + /** + *
    +     * 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; + */ + @java.lang.Override + public int getStatsCount() { + return stats_.size(); + } + /** + *
    +     * 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; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStat getStats(int index) { + return stats_.get(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; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index) { + return stats_.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 { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + for (int i = 0; i < lines_.size(); i++) { + output.writeMessage(3, lines_.get(i)); + } + com.google.protobuf.GeneratedMessage + .serializeLongMapTo( + output, + internalGetEventMetadata(), + EventMetadataDefaultEntryHolder.defaultEntry, + 4); + com.google.protobuf.GeneratedMessage + .serializeLongMapTo( + output, + internalGetStatMetadata(), + StatMetadataDefaultEntryHolder.defaultEntry, + 5); + for (int i = 0; i < stats_.size(); i++) { + output.writeMessage(6, stats_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + for (int i = 0; i < lines_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, lines_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetEventMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + eventMetadata__ = EventMetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, eventMetadata__); + } + for (java.util.Map.Entry entry + : internalGetStatMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + statMetadata__ = StatMetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, statMetadata__); + } + for (int i = 0; i < stats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, stats_.get(i)); + } + size += getUnknownFields().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.Xplane.XPlane)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XPlane other = (org.tensorflow.proto.profiler.Xplane.XPlane) obj; + + if (getId() + != other.getId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getLinesList() + .equals(other.getLinesList())) return false; + if (!internalGetEventMetadata().equals( + other.internalGetEventMetadata())) return false; + if (!internalGetStatMetadata().equals( + other.internalGetStatMetadata())) return false; + if (!getStatsList() + .equals(other.getStatsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getLinesCount() > 0) { + hash = (37 * hash) + LINES_FIELD_NUMBER; + hash = (53 * hash) + getLinesList().hashCode(); + } + if (!internalGetEventMetadata().getMap().isEmpty()) { + hash = (37 * hash) + EVENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetEventMetadata().hashCode(); + } + if (!internalGetStatMetadata().getMap().isEmpty()) { + hash = (37 * hash) + STAT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetStatMetadata().hashCode(); + } + if (getStatsCount() > 0) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStatsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane 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.Xplane.XPlane parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane 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.Xplane.XPlane parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XPlane parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XPlane parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XPlane parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XPlane 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * An XPlane is a container of parallel timelines (XLines), generated by a
    +     * profiling source or by post-processing one or more XPlanes.
    +     * Next ID: 7
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XPlane} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XPlane) + org.tensorflow.proto.profiler.Xplane.XPlaneOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetEventMetadata(); + case 5: + return internalGetStatMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableEventMetadata(); + case 5: + return internalGetMutableStatMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XPlane.class, org.tensorflow.proto.profiler.Xplane.XPlane.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XPlane.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + name_ = ""; + if (linesBuilder_ == null) { + lines_ = java.util.Collections.emptyList(); + } else { + lines_ = null; + linesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableEventMetadata().clear(); + internalGetMutableStatMetadata().clear(); + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + } else { + stats_ = null; + statsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XPlane_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XPlane getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XPlane.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XPlane build() { + org.tensorflow.proto.profiler.Xplane.XPlane result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XPlane buildPartial() { + org.tensorflow.proto.profiler.Xplane.XPlane result = new org.tensorflow.proto.profiler.Xplane.XPlane(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.profiler.Xplane.XPlane result) { + if (linesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + lines_ = java.util.Collections.unmodifiableList(lines_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.lines_ = lines_; + } else { + result.lines_ = linesBuilder_.build(); + } + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XPlane result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.eventMetadata_ = internalGetEventMetadata().build(EventMetadataDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statMetadata_ = internalGetStatMetadata().build(StatMetadataDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XPlane) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XPlane)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XPlane other) { + if (other == org.tensorflow.proto.profiler.Xplane.XPlane.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (linesBuilder_ == null) { + if (!other.lines_.isEmpty()) { + if (lines_.isEmpty()) { + lines_ = other.lines_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLinesIsMutable(); + lines_.addAll(other.lines_); + } + onChanged(); + } + } else { + if (!other.lines_.isEmpty()) { + if (linesBuilder_.isEmpty()) { + linesBuilder_.dispose(); + linesBuilder_ = null; + lines_ = other.lines_; + bitField0_ = (bitField0_ & ~0x00000004); + linesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLinesFieldBuilder() : null; + } else { + linesBuilder_.addAllMessages(other.lines_); + } + } + } + internalGetMutableEventMetadata().mergeFrom( + other.internalGetEventMetadata()); + bitField0_ |= 0x00000008; + internalGetMutableStatMetadata().mergeFrom( + other.internalGetStatMetadata()); + bitField0_ |= 0x00000010; + if (statsBuilder_ == null) { + if (!other.stats_.isEmpty()) { + if (stats_.isEmpty()) { + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureStatsIsMutable(); + stats_.addAll(other.stats_); + } + onChanged(); + } + } else { + if (!other.stats_.isEmpty()) { + if (statsBuilder_.isEmpty()) { + statsBuilder_.dispose(); + statsBuilder_ = null; + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000020); + statsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getStatsFieldBuilder() : null; + } else { + statsBuilder_.addAllMessages(other.stats_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + org.tensorflow.proto.profiler.Xplane.XLine m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XLine.parser(), + extensionRegistry); + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.add(m); + } else { + linesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + eventMetadata__ = input.readMessage( + EventMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableEventMetadata().ensureBuilderMap().put( + eventMetadata__.getKey(), eventMetadata__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + statMetadata__ = input.readMessage( + StatMetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableStatMetadata().ensureBuilderMap().put( + statMetadata__.getKey(), statMetadata__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: { + org.tensorflow.proto.profiler.Xplane.XStat m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XStat.parser(), + extensionRegistry); + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(m); + } else { + statsBuilder_.addMessage(m); + } + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of this XPlane.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of this XPlane.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of this XPlane.
    +       * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Name of this XPlane.
    +       * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Name of this XPlane.
    +       * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List lines_ = + java.util.Collections.emptyList(); + private void ensureLinesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + lines_ = new java.util.ArrayList(lines_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XLine, org.tensorflow.proto.profiler.Xplane.XLine.Builder, org.tensorflow.proto.profiler.Xplane.XLineOrBuilder> linesBuilder_; + + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public java.util.List getLinesList() { + if (linesBuilder_ == null) { + return java.util.Collections.unmodifiableList(lines_); + } else { + return linesBuilder_.getMessageList(); + } + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public int getLinesCount() { + if (linesBuilder_ == null) { + return lines_.size(); + } else { + return linesBuilder_.getCount(); + } + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public org.tensorflow.proto.profiler.Xplane.XLine getLines(int index) { + if (linesBuilder_ == null) { + return lines_.get(index); + } else { + return linesBuilder_.getMessage(index); + } + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder setLines( + int index, org.tensorflow.proto.profiler.Xplane.XLine value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.set(index, value); + onChanged(); + } else { + linesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder setLines( + int index, org.tensorflow.proto.profiler.Xplane.XLine.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.set(index, builderForValue.build()); + onChanged(); + } else { + linesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder addLines(org.tensorflow.proto.profiler.Xplane.XLine value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.add(value); + onChanged(); + } else { + linesBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder addLines( + int index, org.tensorflow.proto.profiler.Xplane.XLine value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.add(index, value); + onChanged(); + } else { + linesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder addLines( + org.tensorflow.proto.profiler.Xplane.XLine.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.add(builderForValue.build()); + onChanged(); + } else { + linesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder addLines( + int index, org.tensorflow.proto.profiler.Xplane.XLine.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.add(index, builderForValue.build()); + onChanged(); + } else { + linesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder addAllLines( + java.lang.Iterable values) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lines_); + onChanged(); + } else { + linesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder clearLines() { + if (linesBuilder_ == null) { + lines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + linesBuilder_.clear(); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public Builder removeLines(int index) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.remove(index); + onChanged(); + } else { + linesBuilder_.remove(index); + } + return this; + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public org.tensorflow.proto.profiler.Xplane.XLine.Builder getLinesBuilder( + int index) { + return getLinesFieldBuilder().getBuilder(index); + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public org.tensorflow.proto.profiler.Xplane.XLineOrBuilder getLinesOrBuilder( + int index) { + if (linesBuilder_ == null) { + return lines_.get(index); } else { + return linesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public java.util.List + getLinesOrBuilderList() { + if (linesBuilder_ != null) { + return linesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(lines_); + } + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public org.tensorflow.proto.profiler.Xplane.XLine.Builder addLinesBuilder() { + return getLinesFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.XLine.getDefaultInstance()); + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public org.tensorflow.proto.profiler.Xplane.XLine.Builder addLinesBuilder( + int index) { + return getLinesFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.XLine.getDefaultInstance()); + } + /** + *
    +       * Parallel timelines grouped in this plane. XLines with the same id
    +       * are effectively the same timeline.
    +       * 
    + * + * repeated .tensorflow.profiler.XLine lines = 3; + */ + public java.util.List + getLinesBuilderList() { + return getLinesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XLine, org.tensorflow.proto.profiler.Xplane.XLine.Builder, org.tensorflow.proto.profiler.Xplane.XLineOrBuilder> + getLinesFieldBuilder() { + if (linesBuilder_ == null) { + linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XLine, org.tensorflow.proto.profiler.Xplane.XLine.Builder, org.tensorflow.proto.profiler.Xplane.XLineOrBuilder>( + lines_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + lines_ = null; + } + return linesBuilder_; + } + + private static final class EventMetadataConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata build(org.tensorflow.proto.profiler.Xplane.XEventMetadataOrBuilder val) { + if (val instanceof org.tensorflow.proto.profiler.Xplane.XEventMetadata) { return (org.tensorflow.proto.profiler.Xplane.XEventMetadata) val; } + return ((org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return EventMetadataDefaultEntryHolder.defaultEntry; + } + }; + private static final EventMetadataConverter eventMetadataConverter = new EventMetadataConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XEventMetadataOrBuilder, org.tensorflow.proto.profiler.Xplane.XEventMetadata, org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder> eventMetadata_; + private com.google.protobuf.MapFieldBuilder + internalGetEventMetadata() { + if (eventMetadata_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(eventMetadataConverter); + } + return eventMetadata_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableEventMetadata() { + if (eventMetadata_ == null) { + eventMetadata_ = new com.google.protobuf.MapFieldBuilder<>(eventMetadataConverter); + } + bitField0_ |= 0x00000008; + onChanged(); + return eventMetadata_; + } + public int getEventMetadataCount() { + return internalGetEventMetadata().ensureBuilderMap().size(); + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public boolean containsEventMetadata( + long key) { + + return internalGetEventMetadata().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getEventMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEventMetadata() { + return getEventMetadataMap(); + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public java.util.Map getEventMetadataMap() { + return internalGetEventMetadata().getImmutableMap(); + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XEventMetadata defaultValue) { + + java.util.Map map = internalGetMutableEventMetadata().ensureBuilderMap(); + return map.containsKey(key) ? eventMetadataConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata getEventMetadataOrThrow( + long key) { + + java.util.Map map = internalGetMutableEventMetadata().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return eventMetadataConverter.build(map.get(key)); + } + public Builder clearEventMetadata() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableEventMetadata().clear(); + return this; + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + public Builder removeEventMetadata( + long key) { + + internalGetMutableEventMetadata().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableEventMetadata() { + bitField0_ |= 0x00000008; + return internalGetMutableEventMetadata().ensureMessageMap(); + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + public Builder putEventMetadata( + long key, + org.tensorflow.proto.profiler.Xplane.XEventMetadata value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableEventMetadata().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + public Builder putAllEventMetadata( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableEventMetadata().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + *
    +       * XEventMetadata map, each entry uses the XEventMetadata.id as key. This map
    +       * should be used for events that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XEventMetadata> event_metadata = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder putEventMetadataBuilderIfAbsent( + long key) { + java.util.Map builderMap = internalGetMutableEventMetadata().ensureBuilderMap(); + org.tensorflow.proto.profiler.Xplane.XEventMetadataOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.profiler.Xplane.XEventMetadata.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.profiler.Xplane.XEventMetadata) { + entry = ((org.tensorflow.proto.profiler.Xplane.XEventMetadata) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder) entry; + } + + private static final class StatMetadataConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata build(org.tensorflow.proto.profiler.Xplane.XStatMetadataOrBuilder val) { + if (val instanceof org.tensorflow.proto.profiler.Xplane.XStatMetadata) { return (org.tensorflow.proto.profiler.Xplane.XStatMetadata) val; } + return ((org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return StatMetadataDefaultEntryHolder.defaultEntry; + } + }; + private static final StatMetadataConverter statMetadataConverter = new StatMetadataConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Long, org.tensorflow.proto.profiler.Xplane.XStatMetadataOrBuilder, org.tensorflow.proto.profiler.Xplane.XStatMetadata, org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder> statMetadata_; + private com.google.protobuf.MapFieldBuilder + internalGetStatMetadata() { + if (statMetadata_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(statMetadataConverter); + } + return statMetadata_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableStatMetadata() { + if (statMetadata_ == null) { + statMetadata_ = new com.google.protobuf.MapFieldBuilder<>(statMetadataConverter); + } + bitField0_ |= 0x00000010; + onChanged(); + return statMetadata_; + } + public int getStatMetadataCount() { + return internalGetStatMetadata().ensureBuilderMap().size(); + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public boolean containsStatMetadata( + long key) { + + return internalGetStatMetadata().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getStatMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getStatMetadata() { + return getStatMetadataMap(); + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public java.util.Map getStatMetadataMap() { + return internalGetStatMetadata().getImmutableMap(); + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrDefault( + long key, + /* nullable */ +org.tensorflow.proto.profiler.Xplane.XStatMetadata defaultValue) { + + java.util.Map map = internalGetMutableStatMetadata().ensureBuilderMap(); + return map.containsKey(key) ? statMetadataConverter.build(map.get(key)) : defaultValue; + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata getStatMetadataOrThrow( + long key) { + + java.util.Map map = internalGetMutableStatMetadata().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return statMetadataConverter.build(map.get(key)); + } + public Builder clearStatMetadata() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableStatMetadata().clear(); + return this; + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + public Builder removeStatMetadata( + long key) { + + internalGetMutableStatMetadata().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableStatMetadata() { + bitField0_ |= 0x00000010; + return internalGetMutableStatMetadata().ensureMessageMap(); + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + public Builder putStatMetadata( + long key, + org.tensorflow.proto.profiler.Xplane.XStatMetadata value) { + + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableStatMetadata().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + public Builder putAllStatMetadata( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableStatMetadata().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + /** + *
    +       * XStatMetadata map, each entry uses the XStatMetadata.id as key. This map
    +       * should be used for stats that share the same ID over the whole XPlane.
    +       * 
    + * + * map<int64, .tensorflow.profiler.XStatMetadata> stat_metadata = 5; + */ + public org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder putStatMetadataBuilderIfAbsent( + long key) { + java.util.Map builderMap = internalGetMutableStatMetadata().ensureBuilderMap(); + org.tensorflow.proto.profiler.Xplane.XStatMetadataOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = org.tensorflow.proto.profiler.Xplane.XStatMetadata.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof org.tensorflow.proto.profiler.Xplane.XStatMetadata) { + entry = ((org.tensorflow.proto.profiler.Xplane.XStatMetadata) entry).toBuilder(); + builderMap.put(key, entry); + } + return (org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder) entry; + } + + private java.util.List stats_ = + java.util.Collections.emptyList(); + private void ensureStatsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + stats_ = new java.util.ArrayList(stats_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder> statsBuilder_; + + /** + *
    +       * 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; + */ + public java.util.List getStatsList() { + if (statsBuilder_ == null) { + return java.util.Collections.unmodifiableList(stats_); + } else { + return statsBuilder_.getMessageList(); + } + } + /** + *
    +       * 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; + */ + public int getStatsCount() { + if (statsBuilder_ == null) { + return stats_.size(); + } else { + return statsBuilder_.getCount(); + } + } + /** + *
    +       * 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; + */ + public org.tensorflow.proto.profiler.Xplane.XStat getStats(int index) { + if (statsBuilder_ == null) { + return stats_.get(index); + } else { + return statsBuilder_.getMessage(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; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.Xplane.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 associated with this plane, e.g. device capabilities.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 6; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.set(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * 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; + */ + public Builder addStats(org.tensorflow.proto.profiler.Xplane.XStat value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(value); + onChanged(); + } else { + statsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * 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; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.Xplane.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 associated with this plane, e.g. device capabilities.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 6; + */ + public Builder addStats( + org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * 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; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * 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; + */ + 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 associated with this plane, e.g. device capabilities.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 6; + */ + public Builder clearStats() { + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + statsBuilder_.clear(); + } + return this; + } + /** + *
    +       * 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; + */ + public Builder removeStats(int index) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.remove(index); + onChanged(); + } else { + statsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * 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; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder getStatsBuilder( + int index) { + return getStatsFieldBuilder().getBuilder(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; + */ + public org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index) { + if (statsBuilder_ == null) { + return stats_.get(index); } else { + return statsBuilder_.getMessageOrBuilder(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; + */ + public java.util.List + getStatsOrBuilderList() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stats_); + } + } + /** + *
    +       * 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; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder addStatsBuilder() { + return getStatsFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance()); + } + /** + *
    +       * 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; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder addStatsBuilder( + int index) { + return getStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance()); + } + /** + *
    +       * 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; + */ + public java.util.List + getStatsBuilderList() { + return getStatsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder>( + stats_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XPlane) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XPlane) + private static final org.tensorflow.proto.profiler.Xplane.XPlane DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XPlane(); + } + + public static org.tensorflow.proto.profiler.Xplane.XPlane getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XPlane parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XPlane getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XLineOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XLine) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * Id of this line, can be repeated within an XPlane. All XLines with the
    +     * same id are effectively the same timeline.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
    +     * Display id of this line. Multiple lines with the same display_id are
    +     * grouped together in the same trace viewer row.
    +     * 
    + * + * int64 display_id = 10; + * @return The displayId. + */ + long getDisplayId(); + + /** + *
    +     * Name of this XLine.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of this XLine.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Name of this XLine to display in trace viewer.
    +     * 
    + * + * string display_name = 11; + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + *
    +     * Name of this XLine to display in trace viewer.
    +     * 
    + * + * string display_name = 11; + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
    +     * Start time of this line in nanoseconds since the UNIX epoch.
    +     * XEvent.offset_ps is relative to this timestamp.
    +     * 
    + * + * int64 timestamp_ns = 3; + * @return The timestampNs. + */ + long getTimestampNs(); + + /** + *
    +     * Profiling duration for this line in picoseconds.
    +     * 
    + * + * int64 duration_ps = 9; + * @return The durationPs. + */ + long getDurationPs(); + + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + java.util.List + getEventsList(); + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + org.tensorflow.proto.profiler.Xplane.XEvent getEvents(int index); + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + int getEventsCount(); + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + java.util.List + getEventsOrBuilderList(); + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + org.tensorflow.proto.profiler.Xplane.XEventOrBuilder getEventsOrBuilder( + int index); + } + /** + *
    +   * An XLine is a timeline of trace events (XEvents).
    +   * Next ID: 12
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XLine} + */ + public static final class XLine extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XLine) + XLineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XLine.class.getName()); + } + // Use XLine.newBuilder() to construct. + private XLine(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XLine() { + name_ = ""; + displayName_ = ""; + events_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XLine_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XLine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XLine.class, org.tensorflow.proto.profiler.Xplane.XLine.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
    +     * Id of this line, can be repeated within an XPlane. All XLines with the
    +     * same id are effectively the same timeline.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int DISPLAY_ID_FIELD_NUMBER = 10; + private long displayId_ = 0L; + /** + *
    +     * Display id of this line. Multiple lines with the same display_id are
    +     * grouped together in the same trace viewer row.
    +     * 
    + * + * int64 display_id = 10; + * @return The displayId. + */ + @java.lang.Override + public long getDisplayId() { + return displayId_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of this XLine.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of this XLine.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 DISPLAY_NAME_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + *
    +     * Name of this XLine to display in trace viewer.
    +     * 
    + * + * string display_name = 11; + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + *
    +     * Name of this XLine to display in trace viewer.
    +     * 
    + * + * string display_name = 11; + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_NS_FIELD_NUMBER = 3; + private long timestampNs_ = 0L; + /** + *
    +     * Start time of this line in nanoseconds since the UNIX epoch.
    +     * XEvent.offset_ps is relative to this timestamp.
    +     * 
    + * + * int64 timestamp_ns = 3; + * @return The timestampNs. + */ + @java.lang.Override + public long getTimestampNs() { + return timestampNs_; + } + + public static final int DURATION_PS_FIELD_NUMBER = 9; + private long durationPs_ = 0L; + /** + *
    +     * Profiling duration for this line in picoseconds.
    +     * 
    + * + * int64 duration_ps = 9; + * @return The durationPs. + */ + @java.lang.Override + public long getDurationPs() { + return durationPs_; + } + + public static final int EVENTS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List events_; + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + @java.lang.Override + public java.util.List getEventsList() { + return events_; + } + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + @java.lang.Override + public java.util.List + getEventsOrBuilderList() { + return events_; + } + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + @java.lang.Override + public int getEventsCount() { + return events_.size(); + } + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEvent getEvents(int index) { + return events_.get(index); + } + /** + *
    +     * XEvents within the same XLine should not overlap in time, but they can be
    +     * nested.
    +     * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventOrBuilder getEventsOrBuilder( + int index) { + return events_.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 { + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (timestampNs_ != 0L) { + output.writeInt64(3, timestampNs_); + } + for (int i = 0; i < events_.size(); i++) { + output.writeMessage(4, events_.get(i)); + } + if (durationPs_ != 0L) { + output.writeInt64(9, durationPs_); + } + if (displayId_ != 0L) { + output.writeInt64(10, displayId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (timestampNs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, timestampNs_); + } + for (int i = 0; i < events_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, events_.get(i)); + } + if (durationPs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, durationPs_); + } + if (displayId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, displayId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, displayName_); + } + size += getUnknownFields().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.Xplane.XLine)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XLine other = (org.tensorflow.proto.profiler.Xplane.XLine) obj; + + if (getId() + != other.getId()) return false; + if (getDisplayId() + != other.getDisplayId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDisplayName() + .equals(other.getDisplayName())) return false; + if (getTimestampNs() + != other.getTimestampNs()) return false; + if (getDurationPs() + != other.getDurationPs()) return false; + if (!getEventsList() + .equals(other.getEventsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + DISPLAY_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDisplayId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TIMESTAMP_NS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestampNs()); + hash = (37 * hash) + DURATION_PS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDurationPs()); + if (getEventsCount() > 0) { + hash = (37 * hash) + EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getEventsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XLine 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.Xplane.XLine parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XLine 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.Xplane.XLine parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XLine parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XLine parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XLine parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XLine 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * An XLine is a timeline of trace events (XEvents).
    +     * Next ID: 12
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XLine} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XLine) + org.tensorflow.proto.profiler.Xplane.XLineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XLine_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XLine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XLine.class, org.tensorflow.proto.profiler.Xplane.XLine.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XLine.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + displayId_ = 0L; + name_ = ""; + displayName_ = ""; + timestampNs_ = 0L; + durationPs_ = 0L; + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + } else { + events_ = null; + eventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XLine_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XLine getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XLine.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XLine build() { + org.tensorflow.proto.profiler.Xplane.XLine result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XLine buildPartial() { + org.tensorflow.proto.profiler.Xplane.XLine result = new org.tensorflow.proto.profiler.Xplane.XLine(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.profiler.Xplane.XLine result) { + if (eventsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + events_ = java.util.Collections.unmodifiableList(events_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.events_ = events_; + } else { + result.events_ = eventsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XLine result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayId_ = displayId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.timestampNs_ = timestampNs_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.durationPs_ = durationPs_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XLine) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XLine)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XLine other) { + if (other == org.tensorflow.proto.profiler.Xplane.XLine.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.getDisplayId() != 0L) { + setDisplayId(other.getDisplayId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getTimestampNs() != 0L) { + setTimestampNs(other.getTimestampNs()); + } + if (other.getDurationPs() != 0L) { + setDurationPs(other.getDurationPs()); + } + if (eventsBuilder_ == null) { + if (!other.events_.isEmpty()) { + if (events_.isEmpty()) { + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureEventsIsMutable(); + events_.addAll(other.events_); + } + onChanged(); + } + } else { + if (!other.events_.isEmpty()) { + if (eventsBuilder_.isEmpty()) { + eventsBuilder_.dispose(); + eventsBuilder_ = null; + events_ = other.events_; + bitField0_ = (bitField0_ & ~0x00000040); + eventsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getEventsFieldBuilder() : null; + } else { + eventsBuilder_.addAllMessages(other.events_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 24: { + timestampNs_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 24 + case 34: { + org.tensorflow.proto.profiler.Xplane.XEvent m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XEvent.parser(), + extensionRegistry); + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(m); + } else { + eventsBuilder_.addMessage(m); + } + break; + } // case 34 + case 72: { + durationPs_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 72 + case 80: { + displayId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 80 + case 90: { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 90 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
    +       * Id of this line, can be repeated within an XPlane. All XLines with the
    +       * same id are effectively the same timeline.
    +       * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
    +       * Id of this line, can be repeated within an XPlane. All XLines with the
    +       * same id are effectively the same timeline.
    +       * 
    + * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * Id of this line, can be repeated within an XPlane. All XLines with the
    +       * same id are effectively the same timeline.
    +       * 
    + * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private long displayId_ ; + /** + *
    +       * Display id of this line. Multiple lines with the same display_id are
    +       * grouped together in the same trace viewer row.
    +       * 
    + * + * int64 display_id = 10; + * @return The displayId. + */ + @java.lang.Override + public long getDisplayId() { + return displayId_; + } + /** + *
    +       * Display id of this line. Multiple lines with the same display_id are
    +       * grouped together in the same trace viewer row.
    +       * 
    + * + * int64 display_id = 10; + * @param value The displayId to set. + * @return This builder for chaining. + */ + public Builder setDisplayId(long value) { + + displayId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Display id of this line. Multiple lines with the same display_id are
    +       * grouped together in the same trace viewer row.
    +       * 
    + * + * int64 display_id = 10; + * @return This builder for chaining. + */ + public Builder clearDisplayId() { + bitField0_ = (bitField0_ & ~0x00000002); + displayId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of this XLine.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of this XLine.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of this XLine.
    +       * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Name of this XLine.
    +       * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Name of this XLine.
    +       * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + *
    +       * Name of this XLine to display in trace viewer.
    +       * 
    + * + * string display_name = 11; + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Name of this XLine to display in trace viewer.
    +       * 
    + * + * string display_name = 11; + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Name of this XLine to display in trace viewer.
    +       * 
    + * + * string display_name = 11; + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Name of this XLine to display in trace viewer.
    +       * 
    + * + * string display_name = 11; + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
    +       * Name of this XLine to display in trace viewer.
    +       * 
    + * + * string display_name = 11; + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private long timestampNs_ ; + /** + *
    +       * Start time of this line in nanoseconds since the UNIX epoch.
    +       * XEvent.offset_ps is relative to this timestamp.
    +       * 
    + * + * int64 timestamp_ns = 3; + * @return The timestampNs. + */ + @java.lang.Override + public long getTimestampNs() { + return timestampNs_; + } + /** + *
    +       * Start time of this line in nanoseconds since the UNIX epoch.
    +       * XEvent.offset_ps is relative to this timestamp.
    +       * 
    + * + * int64 timestamp_ns = 3; + * @param value The timestampNs to set. + * @return This builder for chaining. + */ + public Builder setTimestampNs(long value) { + + timestampNs_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
    +       * Start time of this line in nanoseconds since the UNIX epoch.
    +       * XEvent.offset_ps is relative to this timestamp.
    +       * 
    + * + * int64 timestamp_ns = 3; + * @return This builder for chaining. + */ + public Builder clearTimestampNs() { + bitField0_ = (bitField0_ & ~0x00000010); + timestampNs_ = 0L; + onChanged(); + return this; + } + + private long durationPs_ ; + /** + *
    +       * Profiling duration for this line in picoseconds.
    +       * 
    + * + * int64 duration_ps = 9; + * @return The durationPs. + */ + @java.lang.Override + public long getDurationPs() { + return durationPs_; + } + /** + *
    +       * Profiling duration for this line in picoseconds.
    +       * 
    + * + * int64 duration_ps = 9; + * @param value The durationPs to set. + * @return This builder for chaining. + */ + public Builder setDurationPs(long value) { + + durationPs_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * Profiling duration for this line in picoseconds.
    +       * 
    + * + * int64 duration_ps = 9; + * @return This builder for chaining. + */ + public Builder clearDurationPs() { + bitField0_ = (bitField0_ & ~0x00000020); + durationPs_ = 0L; + onChanged(); + return this; + } + + private java.util.List events_ = + java.util.Collections.emptyList(); + private void ensureEventsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + events_ = new java.util.ArrayList(events_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XEvent, org.tensorflow.proto.profiler.Xplane.XEvent.Builder, org.tensorflow.proto.profiler.Xplane.XEventOrBuilder> eventsBuilder_; + + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public java.util.List getEventsList() { + if (eventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(events_); + } else { + return eventsBuilder_.getMessageList(); + } + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public int getEventsCount() { + if (eventsBuilder_ == null) { + return events_.size(); + } else { + return eventsBuilder_.getCount(); + } + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEvent getEvents(int index) { + if (eventsBuilder_ == null) { + return events_.get(index); + } else { + return eventsBuilder_.getMessage(index); + } + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder setEvents( + int index, org.tensorflow.proto.profiler.Xplane.XEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.set(index, value); + onChanged(); + } else { + eventsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder setEvents( + int index, org.tensorflow.proto.profiler.Xplane.XEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.set(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder addEvents(org.tensorflow.proto.profiler.Xplane.XEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(value); + onChanged(); + } else { + eventsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder addEvents( + int index, org.tensorflow.proto.profiler.Xplane.XEvent value) { + if (eventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventsIsMutable(); + events_.add(index, value); + onChanged(); + } else { + eventsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder addEvents( + org.tensorflow.proto.profiler.Xplane.XEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder addEvents( + int index, org.tensorflow.proto.profiler.Xplane.XEvent.Builder builderForValue) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.add(index, builderForValue.build()); + onChanged(); + } else { + eventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder addAllEvents( + java.lang.Iterable values) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, events_); + onChanged(); + } else { + eventsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder clearEvents() { + if (eventsBuilder_ == null) { + events_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + eventsBuilder_.clear(); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public Builder removeEvents(int index) { + if (eventsBuilder_ == null) { + ensureEventsIsMutable(); + events_.remove(index); + onChanged(); + } else { + eventsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEvent.Builder getEventsBuilder( + int index) { + return getEventsFieldBuilder().getBuilder(index); + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEventOrBuilder getEventsOrBuilder( + int index) { + if (eventsBuilder_ == null) { + return events_.get(index); } else { + return eventsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public java.util.List + getEventsOrBuilderList() { + if (eventsBuilder_ != null) { + return eventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(events_); + } + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEvent.Builder addEventsBuilder() { + return getEventsFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.XEvent.getDefaultInstance()); + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XEvent.Builder addEventsBuilder( + int index) { + return getEventsFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.XEvent.getDefaultInstance()); + } + /** + *
    +       * XEvents within the same XLine should not overlap in time, but they can be
    +       * nested.
    +       * 
    + * + * repeated .tensorflow.profiler.XEvent events = 4; + */ + public java.util.List + getEventsBuilderList() { + return getEventsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XEvent, org.tensorflow.proto.profiler.Xplane.XEvent.Builder, org.tensorflow.proto.profiler.Xplane.XEventOrBuilder> + getEventsFieldBuilder() { + if (eventsBuilder_ == null) { + eventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XEvent, org.tensorflow.proto.profiler.Xplane.XEvent.Builder, org.tensorflow.proto.profiler.Xplane.XEventOrBuilder>( + events_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + events_ = null; + } + return eventsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XLine) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XLine) + private static final org.tensorflow.proto.profiler.Xplane.XLine DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XLine(); + } + + public static org.tensorflow.proto.profiler.Xplane.XLine getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XLine parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XLine getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XEvent) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * XEventMetadata.id of corresponding metadata.
    +     * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + long getMetadataId(); + + /** + *
    +     * Start time of the event in picoseconds, as offset from
    +     * XLine.timestamp_ns().
    +     * 
    + * + * int64 offset_ps = 2; + * @return Whether the offsetPs field is set. + */ + boolean hasOffsetPs(); + /** + *
    +     * Start time of the event in picoseconds, as offset from
    +     * XLine.timestamp_ns().
    +     * 
    + * + * int64 offset_ps = 2; + * @return The offsetPs. + */ + long getOffsetPs(); + + /** + *
    +     * Number of occurrences of the event, if aggregated.
    +     * 
    + * + * int64 num_occurrences = 5; + * @return Whether the numOccurrences field is set. + */ + boolean hasNumOccurrences(); + /** + *
    +     * Number of occurrences of the event, if aggregated.
    +     * 
    + * + * int64 num_occurrences = 5; + * @return The numOccurrences. + */ + long getNumOccurrences(); + + /** + *
    +     * Duration of the event in picoseconds. Can be zero for an instant event.
    +     * 
    + * + * int64 duration_ps = 3; + * @return The durationPs. + */ + long getDurationPs(); + + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + 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; + */ + org.tensorflow.proto.profiler.Xplane.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; + */ + int getStatsCount(); + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + java.util.List + getStatsOrBuilderList(); + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index); + + org.tensorflow.proto.profiler.Xplane.XEvent.DataCase getDataCase(); + } + /** + *
    +   * An XEvent is a trace event, optionally annotated with XStats.
    +   * Next ID: 6
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XEvent} + */ + public static final class XEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XEvent) + XEventOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XEvent.class.getName()); + } + // Use XEvent.newBuilder() to construct. + private XEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XEvent() { + stats_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XEvent.class, org.tensorflow.proto.profiler.Xplane.XEvent.Builder.class); + } + + private int dataCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object data_; + public enum DataCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OFFSET_PS(2), + NUM_OCCURRENCES(5), + DATA_NOT_SET(0); + private final int value; + private DataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 2: return OFFSET_PS; + case 5: return NUM_OCCURRENCES; + case 0: return DATA_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public static final int METADATA_ID_FIELD_NUMBER = 1; + private long metadataId_ = 0L; + /** + *
    +     * XEventMetadata.id of corresponding metadata.
    +     * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + @java.lang.Override + public long getMetadataId() { + return metadataId_; + } + + public static final int OFFSET_PS_FIELD_NUMBER = 2; + /** + *
    +     * Start time of the event in picoseconds, as offset from
    +     * XLine.timestamp_ns().
    +     * 
    + * + * int64 offset_ps = 2; + * @return Whether the offsetPs field is set. + */ + @java.lang.Override + public boolean hasOffsetPs() { + return dataCase_ == 2; + } + /** + *
    +     * Start time of the event in picoseconds, as offset from
    +     * XLine.timestamp_ns().
    +     * 
    + * + * int64 offset_ps = 2; + * @return The offsetPs. + */ + @java.lang.Override + public long getOffsetPs() { + if (dataCase_ == 2) { + return (java.lang.Long) data_; + } + return 0L; + } + + public static final int NUM_OCCURRENCES_FIELD_NUMBER = 5; + /** + *
    +     * Number of occurrences of the event, if aggregated.
    +     * 
    + * + * int64 num_occurrences = 5; + * @return Whether the numOccurrences field is set. + */ + @java.lang.Override + public boolean hasNumOccurrences() { + return dataCase_ == 5; + } + /** + *
    +     * Number of occurrences of the event, if aggregated.
    +     * 
    + * + * int64 num_occurrences = 5; + * @return The numOccurrences. + */ + @java.lang.Override + public long getNumOccurrences() { + if (dataCase_ == 5) { + return (java.lang.Long) data_; + } + return 0L; + } + + public static final int DURATION_PS_FIELD_NUMBER = 3; + private long durationPs_ = 0L; + /** + *
    +     * Duration of the event in picoseconds. Can be zero for an instant event.
    +     * 
    + * + * int64 duration_ps = 3; + * @return The durationPs. + */ + @java.lang.Override + public long getDurationPs() { + return durationPs_; + } + + public static final int STATS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List stats_; + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + @java.lang.Override + public java.util.List getStatsList() { + return stats_; + } + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + @java.lang.Override + public java.util.List + getStatsOrBuilderList() { + return stats_; + } + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + @java.lang.Override + public int getStatsCount() { + return stats_.size(); + } + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStat getStats(int index) { + return stats_.get(index); + } + /** + *
    +     * XStats associated with the event.
    +     * Each of these XStats should have a different metadata_id.
    +     * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index) { + return stats_.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 { + if (metadataId_ != 0L) { + output.writeInt64(1, metadataId_); + } + if (dataCase_ == 2) { + output.writeInt64( + 2, (long)((java.lang.Long) data_)); + } + if (durationPs_ != 0L) { + output.writeInt64(3, durationPs_); + } + for (int i = 0; i < stats_.size(); i++) { + output.writeMessage(4, stats_.get(i)); + } + if (dataCase_ == 5) { + output.writeInt64( + 5, (long)((java.lang.Long) data_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (metadataId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, metadataId_); + } + if (dataCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 2, (long)((java.lang.Long) data_)); + } + if (durationPs_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, durationPs_); + } + for (int i = 0; i < stats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, stats_.get(i)); + } + if (dataCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 5, (long)((java.lang.Long) data_)); + } + size += getUnknownFields().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.Xplane.XEvent)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XEvent other = (org.tensorflow.proto.profiler.Xplane.XEvent) obj; + + if (getMetadataId() + != other.getMetadataId()) return false; + if (getDurationPs() + != other.getDurationPs()) return false; + if (!getStatsList() + .equals(other.getStatsList())) return false; + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 2: + if (getOffsetPs() + != other.getOffsetPs()) return false; + break; + case 5: + if (getNumOccurrences() + != other.getNumOccurrences()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + METADATA_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMetadataId()); + hash = (37 * hash) + DURATION_PS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDurationPs()); + if (getStatsCount() > 0) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStatsList().hashCode(); + } + switch (dataCase_) { + case 2: + hash = (37 * hash) + OFFSET_PS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffsetPs()); + break; + case 5: + hash = (37 * hash) + NUM_OCCURRENCES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNumOccurrences()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent 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.Xplane.XEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent 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.Xplane.XEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XEvent 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * An XEvent is a trace event, optionally annotated with XStats.
    +     * Next ID: 6
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XEvent) + org.tensorflow.proto.profiler.Xplane.XEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XEvent.class, org.tensorflow.proto.profiler.Xplane.XEvent.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XEvent.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metadataId_ = 0L; + durationPs_ = 0L; + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + } else { + stats_ = null; + statsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + dataCase_ = 0; + data_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEvent_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEvent getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XEvent.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEvent build() { + org.tensorflow.proto.profiler.Xplane.XEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEvent buildPartial() { + org.tensorflow.proto.profiler.Xplane.XEvent result = new org.tensorflow.proto.profiler.Xplane.XEvent(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.profiler.Xplane.XEvent result) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metadataId_ = metadataId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.durationPs_ = durationPs_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.profiler.Xplane.XEvent result) { + result.dataCase_ = dataCase_; + result.data_ = this.data_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XEvent) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XEvent other) { + if (other == org.tensorflow.proto.profiler.Xplane.XEvent.getDefaultInstance()) return this; + if (other.getMetadataId() != 0L) { + setMetadataId(other.getMetadataId()); + } + if (other.getDurationPs() != 0L) { + setDurationPs(other.getDurationPs()); + } + if (statsBuilder_ == null) { + if (!other.stats_.isEmpty()) { + if (stats_.isEmpty()) { + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureStatsIsMutable(); + stats_.addAll(other.stats_); + } + onChanged(); + } + } else { + if (!other.stats_.isEmpty()) { + if (statsBuilder_.isEmpty()) { + statsBuilder_.dispose(); + statsBuilder_ = null; + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000010); + statsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getStatsFieldBuilder() : null; + } else { + statsBuilder_.addAllMessages(other.stats_); + } + } + } + switch (other.getDataCase()) { + case OFFSET_PS: { + setOffsetPs(other.getOffsetPs()); + break; + } + case NUM_OCCURRENCES: { + setNumOccurrences(other.getNumOccurrences()); + break; + } + case DATA_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + metadataId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + data_ = input.readInt64(); + dataCase_ = 2; + break; + } // case 16 + case 24: { + durationPs_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 24 + case 34: { + org.tensorflow.proto.profiler.Xplane.XStat m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XStat.parser(), + extensionRegistry); + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(m); + } else { + statsBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: { + data_ = input.readInt64(); + dataCase_ = 5; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int dataCase_ = 0; + private java.lang.Object data_; + public DataCase + getDataCase() { + return DataCase.forNumber( + dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private long metadataId_ ; + /** + *
    +       * XEventMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + @java.lang.Override + public long getMetadataId() { + return metadataId_; + } + /** + *
    +       * XEventMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @param value The metadataId to set. + * @return This builder for chaining. + */ + public Builder setMetadataId(long value) { + + metadataId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * XEventMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @return This builder for chaining. + */ + public Builder clearMetadataId() { + bitField0_ = (bitField0_ & ~0x00000001); + metadataId_ = 0L; + onChanged(); + return this; + } + + /** + *
    +       * Start time of the event in picoseconds, as offset from
    +       * XLine.timestamp_ns().
    +       * 
    + * + * int64 offset_ps = 2; + * @return Whether the offsetPs field is set. + */ + public boolean hasOffsetPs() { + return dataCase_ == 2; + } + /** + *
    +       * Start time of the event in picoseconds, as offset from
    +       * XLine.timestamp_ns().
    +       * 
    + * + * int64 offset_ps = 2; + * @return The offsetPs. + */ + public long getOffsetPs() { + if (dataCase_ == 2) { + return (java.lang.Long) data_; + } + return 0L; + } + /** + *
    +       * Start time of the event in picoseconds, as offset from
    +       * XLine.timestamp_ns().
    +       * 
    + * + * int64 offset_ps = 2; + * @param value The offsetPs to set. + * @return This builder for chaining. + */ + public Builder setOffsetPs(long value) { + + dataCase_ = 2; + data_ = value; + onChanged(); + return this; + } + /** + *
    +       * Start time of the event in picoseconds, as offset from
    +       * XLine.timestamp_ns().
    +       * 
    + * + * int64 offset_ps = 2; + * @return This builder for chaining. + */ + public Builder clearOffsetPs() { + if (dataCase_ == 2) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + /** + *
    +       * Number of occurrences of the event, if aggregated.
    +       * 
    + * + * int64 num_occurrences = 5; + * @return Whether the numOccurrences field is set. + */ + public boolean hasNumOccurrences() { + return dataCase_ == 5; + } + /** + *
    +       * Number of occurrences of the event, if aggregated.
    +       * 
    + * + * int64 num_occurrences = 5; + * @return The numOccurrences. + */ + public long getNumOccurrences() { + if (dataCase_ == 5) { + return (java.lang.Long) data_; + } + return 0L; + } + /** + *
    +       * Number of occurrences of the event, if aggregated.
    +       * 
    + * + * int64 num_occurrences = 5; + * @param value The numOccurrences to set. + * @return This builder for chaining. + */ + public Builder setNumOccurrences(long value) { + + dataCase_ = 5; + data_ = value; + onChanged(); + return this; + } + /** + *
    +       * Number of occurrences of the event, if aggregated.
    +       * 
    + * + * int64 num_occurrences = 5; + * @return This builder for chaining. + */ + public Builder clearNumOccurrences() { + if (dataCase_ == 5) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + return this; + } + + private long durationPs_ ; + /** + *
    +       * Duration of the event in picoseconds. Can be zero for an instant event.
    +       * 
    + * + * int64 duration_ps = 3; + * @return The durationPs. + */ + @java.lang.Override + public long getDurationPs() { + return durationPs_; + } + /** + *
    +       * Duration of the event in picoseconds. Can be zero for an instant event.
    +       * 
    + * + * int64 duration_ps = 3; + * @param value The durationPs to set. + * @return This builder for chaining. + */ + public Builder setDurationPs(long value) { + + durationPs_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Duration of the event in picoseconds. Can be zero for an instant event.
    +       * 
    + * + * int64 duration_ps = 3; + * @return This builder for chaining. + */ + public Builder clearDurationPs() { + bitField0_ = (bitField0_ & ~0x00000008); + durationPs_ = 0L; + onChanged(); + return this; + } + + private java.util.List stats_ = + java.util.Collections.emptyList(); + private void ensureStatsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + stats_ = new java.util.ArrayList(stats_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder> statsBuilder_; + + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public java.util.List getStatsList() { + if (statsBuilder_ == null) { + return java.util.Collections.unmodifiableList(stats_); + } else { + return statsBuilder_.getMessageList(); + } + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public int getStatsCount() { + if (statsBuilder_ == null) { + return stats_.size(); + } else { + return statsBuilder_.getCount(); + } + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XStat getStats(int index) { + if (statsBuilder_ == null) { + return stats_.get(index); + } else { + return statsBuilder_.getMessage(index); + } + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.Xplane.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 associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder setStats( + int index, org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.set(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder addStats(org.tensorflow.proto.profiler.Xplane.XStat value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatsIsMutable(); + stats_.add(value); + onChanged(); + } else { + statsBuilder_.addMessage(value); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.Xplane.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 associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder addStats( + org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder addStats( + int index, org.tensorflow.proto.profiler.Xplane.XStat.Builder builderForValue) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(index, builderForValue.build()); + onChanged(); + } else { + statsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + 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 associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder clearStats() { + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + statsBuilder_.clear(); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public Builder removeStats(int index) { + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.remove(index); + onChanged(); + } else { + statsBuilder_.remove(index); + } + return this; + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder getStatsBuilder( + int index) { + return getStatsFieldBuilder().getBuilder(index); + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index) { + if (statsBuilder_ == null) { + return stats_.get(index); } else { + return statsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public java.util.List + getStatsOrBuilderList() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stats_); + } + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder addStatsBuilder() { + return getStatsFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance()); + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public org.tensorflow.proto.profiler.Xplane.XStat.Builder addStatsBuilder( + int index) { + return getStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance()); + } + /** + *
    +       * XStats associated with the event.
    +       * Each of these XStats should have a different metadata_id.
    +       * 
    + * + * repeated .tensorflow.profiler.XStat stats = 4; + */ + public java.util.List + getStatsBuilderList() { + return getStatsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder>( + stats_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XEvent) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XEvent) + private static final org.tensorflow.proto.profiler.Xplane.XEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XEvent(); + } + + public static org.tensorflow.proto.profiler.Xplane.XEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XStatOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XStat) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * XStatMetadata.id of corresponding metadata.
    +     * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + long getMetadataId(); + + /** + * double double_value = 2; + * @return Whether the doubleValue field is set. + */ + boolean hasDoubleValue(); + /** + * double double_value = 2; + * @return The doubleValue. + */ + double getDoubleValue(); + + /** + * uint64 uint64_value = 3; + * @return Whether the uint64Value field is set. + */ + boolean hasUint64Value(); + /** + * uint64 uint64_value = 3; + * @return The uint64Value. + */ + long getUint64Value(); + + /** + * int64 int64_value = 4; + * @return Whether the int64Value field is set. + */ + boolean hasInt64Value(); + /** + * int64 int64_value = 4; + * @return The int64Value. + */ + long getInt64Value(); + + /** + * string str_value = 5; + * @return Whether the strValue field is set. + */ + boolean hasStrValue(); + /** + * string str_value = 5; + * @return The strValue. + */ + java.lang.String getStrValue(); + /** + * string str_value = 5; + * @return The bytes for strValue. + */ + com.google.protobuf.ByteString + getStrValueBytes(); + + /** + * bytes bytes_value = 6; + * @return Whether the bytesValue field is set. + */ + boolean hasBytesValue(); + /** + * bytes bytes_value = 6; + * @return The bytesValue. + */ + com.google.protobuf.ByteString getBytesValue(); + + /** + *
    +     * A string value that stored in XStatMetadata::name.
    +     * 
    + * + * uint64 ref_value = 7; + * @return Whether the refValue field is set. + */ + boolean hasRefValue(); + /** + *
    +     * A string value that stored in XStatMetadata::name.
    +     * 
    + * + * uint64 ref_value = 7; + * @return The refValue. + */ + long getRefValue(); + + org.tensorflow.proto.profiler.Xplane.XStat.ValueCase getValueCase(); + } + /** + *
    +   * An XStat is a named value associated with an XEvent, e.g., a performance
    +   * counter value, a metric computed by a formula applied over nested XEvents
    +   * and XStats.
    +   * Next ID: 8
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XStat} + */ + public static final class XStat extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XStat) + XStatOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XStat.class.getName()); + } + // Use XStat.newBuilder() to construct. + private XStat(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XStat() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XStat.class, org.tensorflow.proto.profiler.Xplane.XStat.Builder.class); + } + + private int valueCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DOUBLE_VALUE(2), + UINT64_VALUE(3), + INT64_VALUE(4), + STR_VALUE(5), + BYTES_VALUE(6), + REF_VALUE(7), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 2: return DOUBLE_VALUE; + case 3: return UINT64_VALUE; + case 4: return INT64_VALUE; + case 5: return STR_VALUE; + case 6: return BYTES_VALUE; + case 7: return REF_VALUE; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int METADATA_ID_FIELD_NUMBER = 1; + private long metadataId_ = 0L; + /** + *
    +     * XStatMetadata.id of corresponding metadata.
    +     * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + @java.lang.Override + public long getMetadataId() { + return metadataId_; + } + + public static final int DOUBLE_VALUE_FIELD_NUMBER = 2; + /** + * double double_value = 2; + * @return Whether the doubleValue field is set. + */ + @java.lang.Override + public boolean hasDoubleValue() { + return valueCase_ == 2; + } + /** + * double double_value = 2; + * @return The doubleValue. + */ + @java.lang.Override + public double getDoubleValue() { + if (valueCase_ == 2) { + return (java.lang.Double) value_; + } + return 0D; + } + + public static final int UINT64_VALUE_FIELD_NUMBER = 3; + /** + * uint64 uint64_value = 3; + * @return Whether the uint64Value field is set. + */ + @java.lang.Override + public boolean hasUint64Value() { + return valueCase_ == 3; + } + /** + * uint64 uint64_value = 3; + * @return The uint64Value. + */ + @java.lang.Override + public long getUint64Value() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + + public static final int INT64_VALUE_FIELD_NUMBER = 4; + /** + * int64 int64_value = 4; + * @return Whether the int64Value field is set. + */ + @java.lang.Override + public boolean hasInt64Value() { + return valueCase_ == 4; + } + /** + * int64 int64_value = 4; + * @return The int64Value. + */ + @java.lang.Override + public long getInt64Value() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + + public static final int STR_VALUE_FIELD_NUMBER = 5; + /** + * string str_value = 5; + * @return Whether the strValue field is set. + */ + public boolean hasStrValue() { + return valueCase_ == 5; + } + /** + * string str_value = 5; + * @return The strValue. + */ + public java.lang.String getStrValue() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + 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(); + if (valueCase_ == 5) { + value_ = s; + } + return s; + } + } + /** + * string str_value = 5; + * @return The bytes for strValue. + */ + public com.google.protobuf.ByteString + getStrValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 5) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BYTES_VALUE_FIELD_NUMBER = 6; + /** + * bytes bytes_value = 6; + * @return Whether the bytesValue field is set. + */ + @java.lang.Override + public boolean hasBytesValue() { + return valueCase_ == 6; + } + /** + * bytes bytes_value = 6; + * @return The bytesValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBytesValue() { + if (valueCase_ == 6) { + return (com.google.protobuf.ByteString) value_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int REF_VALUE_FIELD_NUMBER = 7; + /** + *
    +     * A string value that stored in XStatMetadata::name.
    +     * 
    + * + * uint64 ref_value = 7; + * @return Whether the refValue field is set. + */ + @java.lang.Override + public boolean hasRefValue() { + return valueCase_ == 7; + } + /** + *
    +     * A string value that stored in XStatMetadata::name.
    +     * 
    + * + * uint64 ref_value = 7; + * @return The refValue. + */ + @java.lang.Override + public long getRefValue() { + if (valueCase_ == 7) { + return (java.lang.Long) value_; + } + return 0L; + } + + 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 (metadataId_ != 0L) { + output.writeInt64(1, metadataId_); + } + if (valueCase_ == 2) { + output.writeDouble( + 2, (double)((java.lang.Double) value_)); + } + if (valueCase_ == 3) { + output.writeUInt64( + 3, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 4) { + output.writeInt64( + 4, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 5) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, value_); + } + if (valueCase_ == 6) { + output.writeBytes( + 6, (com.google.protobuf.ByteString) value_); + } + if (valueCase_ == 7) { + output.writeUInt64( + 7, (long)((java.lang.Long) value_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (metadataId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, metadataId_); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize( + 2, (double)((java.lang.Double) value_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size( + 3, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 4, (long)((java.lang.Long) value_)); + } + if (valueCase_ == 5) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, value_); + } + if (valueCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 6, (com.google.protobuf.ByteString) value_); + } + if (valueCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size( + 7, (long)((java.lang.Long) value_)); + } + size += getUnknownFields().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.Xplane.XStat)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XStat other = (org.tensorflow.proto.profiler.Xplane.XStat) obj; + + if (getMetadataId() + != other.getMetadataId()) return false; + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 2: + if (java.lang.Double.doubleToLongBits(getDoubleValue()) + != java.lang.Double.doubleToLongBits( + other.getDoubleValue())) return false; + break; + case 3: + if (getUint64Value() + != other.getUint64Value()) return false; + break; + case 4: + if (getInt64Value() + != other.getInt64Value()) return false; + break; + case 5: + if (!getStrValue() + .equals(other.getStrValue())) return false; + break; + case 6: + if (!getBytesValue() + .equals(other.getBytesValue())) return false; + break; + case 7: + if (getRefValue() + != other.getRefValue()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + METADATA_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMetadataId()); + switch (valueCase_) { + case 2: + hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getDoubleValue())); + break; + case 3: + hash = (37 * hash) + UINT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUint64Value()); + break; + case 4: + hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInt64Value()); + break; + case 5: + hash = (37 * hash) + STR_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStrValue().hashCode(); + break; + case 6: + hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getBytesValue().hashCode(); + break; + case 7: + hash = (37 * hash) + REF_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRefValue()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStat 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.Xplane.XStat parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStat 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.Xplane.XStat parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XStat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XStat parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XStat parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XStat 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * An XStat is a named value associated with an XEvent, e.g., a performance
    +     * counter value, a metric computed by a formula applied over nested XEvents
    +     * and XStats.
    +     * Next ID: 8
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XStat} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XStat) + org.tensorflow.proto.profiler.Xplane.XStatOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStat_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStat_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XStat.class, org.tensorflow.proto.profiler.Xplane.XStat.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XStat.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metadataId_ = 0L; + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStat_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStat getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStat build() { + org.tensorflow.proto.profiler.Xplane.XStat result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStat buildPartial() { + org.tensorflow.proto.profiler.Xplane.XStat result = new org.tensorflow.proto.profiler.Xplane.XStat(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XStat result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metadataId_ = metadataId_; + } + } + + private void buildPartialOneofs(org.tensorflow.proto.profiler.Xplane.XStat result) { + result.valueCase_ = valueCase_; + result.value_ = this.value_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XStat) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XStat)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XStat other) { + if (other == org.tensorflow.proto.profiler.Xplane.XStat.getDefaultInstance()) return this; + if (other.getMetadataId() != 0L) { + setMetadataId(other.getMetadataId()); + } + switch (other.getValueCase()) { + case DOUBLE_VALUE: { + setDoubleValue(other.getDoubleValue()); + break; + } + case UINT64_VALUE: { + setUint64Value(other.getUint64Value()); + break; + } + case INT64_VALUE: { + setInt64Value(other.getInt64Value()); + break; + } + case STR_VALUE: { + valueCase_ = 5; + value_ = other.value_; + onChanged(); + break; + } + case BYTES_VALUE: { + setBytesValue(other.getBytesValue()); + break; + } + case REF_VALUE: { + setRefValue(other.getRefValue()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + metadataId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + value_ = input.readDouble(); + valueCase_ = 2; + break; + } // case 17 + case 24: { + value_ = input.readUInt64(); + valueCase_ = 3; + break; + } // case 24 + case 32: { + value_ = input.readInt64(); + valueCase_ = 4; + break; + } // case 32 + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 5; + value_ = s; + break; + } // case 42 + case 50: { + value_ = input.readBytes(); + valueCase_ = 6; + break; + } // case 50 + case 56: { + value_ = input.readUInt64(); + valueCase_ = 7; + break; + } // case 56 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private long metadataId_ ; + /** + *
    +       * XStatMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @return The metadataId. + */ + @java.lang.Override + public long getMetadataId() { + return metadataId_; + } + /** + *
    +       * XStatMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @param value The metadataId to set. + * @return This builder for chaining. + */ + public Builder setMetadataId(long value) { + + metadataId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * XStatMetadata.id of corresponding metadata.
    +       * 
    + * + * int64 metadata_id = 1; + * @return This builder for chaining. + */ + public Builder clearMetadataId() { + bitField0_ = (bitField0_ & ~0x00000001); + metadataId_ = 0L; + onChanged(); + return this; + } + + /** + * double double_value = 2; + * @return Whether the doubleValue field is set. + */ + public boolean hasDoubleValue() { + return valueCase_ == 2; + } + /** + * double double_value = 2; + * @return The doubleValue. + */ + public double getDoubleValue() { + if (valueCase_ == 2) { + return (java.lang.Double) value_; + } + return 0D; + } + /** + * double double_value = 2; + * @param value The doubleValue to set. + * @return This builder for chaining. + */ + public Builder setDoubleValue(double value) { + + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * double double_value = 2; + * @return This builder for chaining. + */ + public Builder clearDoubleValue() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * uint64 uint64_value = 3; + * @return Whether the uint64Value field is set. + */ + public boolean hasUint64Value() { + return valueCase_ == 3; + } + /** + * uint64 uint64_value = 3; + * @return The uint64Value. + */ + public long getUint64Value() { + if (valueCase_ == 3) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * uint64 uint64_value = 3; + * @param value The uint64Value to set. + * @return This builder for chaining. + */ + public Builder setUint64Value(long value) { + + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * uint64 uint64_value = 3; + * @return This builder for chaining. + */ + public Builder clearUint64Value() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * int64 int64_value = 4; + * @return Whether the int64Value field is set. + */ + public boolean hasInt64Value() { + return valueCase_ == 4; + } + /** + * int64 int64_value = 4; + * @return The int64Value. + */ + public long getInt64Value() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * int64 int64_value = 4; + * @param value The int64Value to set. + * @return This builder for chaining. + */ + public Builder setInt64Value(long value) { + + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * int64 int64_value = 4; + * @return This builder for chaining. + */ + public Builder clearInt64Value() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * string str_value = 5; + * @return Whether the strValue field is set. + */ + @java.lang.Override + public boolean hasStrValue() { + return valueCase_ == 5; + } + /** + * string str_value = 5; + * @return The strValue. + */ + @java.lang.Override + public java.lang.String getStrValue() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 5) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string str_value = 5; + * @return The bytes for strValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStrValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 5) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 5) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string str_value = 5; + * @param value The strValue to set. + * @return This builder for chaining. + */ + public Builder setStrValue( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + /** + * string str_value = 5; + * @return This builder for chaining. + */ + public Builder clearStrValue() { + if (valueCase_ == 5) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string str_value = 5; + * @param value The bytes for strValue to set. + * @return This builder for chaining. + */ + public Builder setStrValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valueCase_ = 5; + value_ = value; + onChanged(); + return this; + } + + /** + * bytes bytes_value = 6; + * @return Whether the bytesValue field is set. + */ + public boolean hasBytesValue() { + return valueCase_ == 6; + } + /** + * bytes bytes_value = 6; + * @return The bytesValue. + */ + public com.google.protobuf.ByteString getBytesValue() { + if (valueCase_ == 6) { + return (com.google.protobuf.ByteString) value_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes bytes_value = 6; + * @param value The bytesValue to set. + * @return This builder for chaining. + */ + public Builder setBytesValue(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + valueCase_ = 6; + value_ = value; + onChanged(); + return this; + } + /** + * bytes bytes_value = 6; + * @return This builder for chaining. + */ + public Builder clearBytesValue() { + if (valueCase_ == 6) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + *
    +       * A string value that stored in XStatMetadata::name.
    +       * 
    + * + * uint64 ref_value = 7; + * @return Whether the refValue field is set. + */ + public boolean hasRefValue() { + return valueCase_ == 7; + } + /** + *
    +       * A string value that stored in XStatMetadata::name.
    +       * 
    + * + * uint64 ref_value = 7; + * @return The refValue. + */ + public long getRefValue() { + if (valueCase_ == 7) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + *
    +       * A string value that stored in XStatMetadata::name.
    +       * 
    + * + * uint64 ref_value = 7; + * @param value The refValue to set. + * @return This builder for chaining. + */ + public Builder setRefValue(long value) { + + valueCase_ = 7; + value_ = value; + onChanged(); + return this; + } + /** + *
    +       * A string value that stored in XStatMetadata::name.
    +       * 
    + * + * uint64 ref_value = 7; + * @return This builder for chaining. + */ + public Builder clearRefValue() { + if (valueCase_ == 7) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XStat) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XStat) + private static final org.tensorflow.proto.profiler.Xplane.XStat DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XStat(); + } + + public static org.tensorflow.proto.profiler.Xplane.XStat getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XStat parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XStat getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XEventMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XEventMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * XPlane.event_metadata map key.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
    +     * Name of the event.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of the event.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Name of the event shown in trace viewer.
    +     * 
    + * + * string display_name = 4; + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + *
    +     * Name of the event shown in trace viewer.
    +     * 
    + * + * string display_name = 4; + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
    +     * Additional metadata in serialized format.
    +     * 
    + * + * bytes metadata = 3; + * @return The metadata. + */ + 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.Xplane.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.Xplane.XStatOrBuilder getStatsOrBuilder( + int index); + + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @return A list containing the childId. + */ + java.util.List getChildIdList(); + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @return The count of childId. + */ + int getChildIdCount(); + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @param index The index of the element to return. + * @return The childId at the given index. + */ + long getChildId(int index); + } + /** + *
    +   * Metadata for an XEvent, corresponds to an event type and is shared by
    +   * all XEvents with the same metadata_id.
    +   * Next ID: 7
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XEventMetadata} + */ + public static final class XEventMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XEventMetadata) + XEventMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XEventMetadata.class.getName()); + } + // Use XEventMetadata.newBuilder() to construct. + private XEventMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XEventMetadata() { + name_ = ""; + displayName_ = ""; + metadata_ = com.google.protobuf.ByteString.EMPTY; + stats_ = java.util.Collections.emptyList(); + childId_ = emptyLongList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEventMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XEventMetadata.class, org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
    +     * XPlane.event_metadata map key.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of the event.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of the event.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 DISPLAY_NAME_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + *
    +     * Name of the event shown in trace viewer.
    +     * 
    + * + * string display_name = 4; + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + *
    +     * Name of the event shown in trace viewer.
    +     * 
    + * + * string display_name = 4; + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +     * Additional metadata in serialized format.
    +     * 
    + * + * bytes metadata = 3; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetadata() { + return metadata_; + } + + public static final int STATS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.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; + */ + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatOrBuilder getStatsOrBuilder( + int index) { + return stats_.get(index); + } + + public static final int CHILD_ID_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList childId_ = + emptyLongList(); + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @return A list containing the childId. + */ + @java.lang.Override + public java.util.List + getChildIdList() { + return childId_; + } + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @return The count of childId. + */ + public int getChildIdCount() { + return childId_.size(); + } + /** + *
    +     * XPlane.event_metadata map key for children events.
    +     * 
    + * + * repeated int64 child_id = 6; + * @param index The index of the element to return. + * @return The childId at the given index. + */ + public long getChildId(int index) { + return childId_.getLong(index); + } + private int childIdMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (!metadata_.isEmpty()) { + output.writeBytes(3, metadata_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); + } + for (int i = 0; i < stats_.size(); i++) { + output.writeMessage(5, stats_.get(i)); + } + if (getChildIdList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(childIdMemoizedSerializedSize); + } + for (int i = 0; i < childId_.size(); i++) { + output.writeInt64NoTag(childId_.getLong(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (!metadata_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, metadata_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); + } + for (int i = 0; i < stats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, stats_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < childId_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(childId_.getLong(i)); + } + size += dataSize; + if (!getChildIdList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + childIdMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.Xplane.XEventMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XEventMetadata other = (org.tensorflow.proto.profiler.Xplane.XEventMetadata) obj; + + if (getId() + != other.getId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDisplayName() + .equals(other.getDisplayName())) return false; + if (!getMetadata() + .equals(other.getMetadata())) return false; + if (!getStatsList() + .equals(other.getStatsList())) return false; + if (!getChildIdList() + .equals(other.getChildIdList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + 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(); + } + if (getChildIdCount() > 0) { + hash = (37 * hash) + CHILD_ID_FIELD_NUMBER; + hash = (53 * hash) + getChildIdList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata 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.Xplane.XEventMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata 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.Xplane.XEventMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XEventMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for an XEvent, corresponds to an event type and is shared by
    +     * all XEvents with the same metadata_id.
    +     * Next ID: 7
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XEventMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XEventMetadata) + org.tensorflow.proto.profiler.Xplane.XEventMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEventMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XEventMetadata.class, org.tensorflow.proto.profiler.Xplane.XEventMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XEventMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + name_ = ""; + displayName_ = ""; + metadata_ = com.google.protobuf.ByteString.EMPTY; + if (statsBuilder_ == null) { + stats_ = java.util.Collections.emptyList(); + } else { + stats_ = null; + statsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + childId_ = emptyLongList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XEventMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XEventMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata build() { + org.tensorflow.proto.profiler.Xplane.XEventMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XEventMetadata buildPartial() { + org.tensorflow.proto.profiler.Xplane.XEventMetadata result = new org.tensorflow.proto.profiler.Xplane.XEventMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.tensorflow.proto.profiler.Xplane.XEventMetadata result) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + stats_ = java.util.Collections.unmodifiableList(stats_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.stats_ = stats_; + } else { + result.stats_ = statsBuilder_.build(); + } + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XEventMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.metadata_ = metadata_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + childId_.makeImmutable(); + result.childId_ = childId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XEventMetadata) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XEventMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XEventMetadata other) { + if (other == org.tensorflow.proto.profiler.Xplane.XEventMetadata.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + 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_ & ~0x00000010); + } else { + ensureStatsIsMutable(); + stats_.addAll(other.stats_); + } + onChanged(); + } + } else { + if (!other.stats_.isEmpty()) { + if (statsBuilder_.isEmpty()) { + statsBuilder_.dispose(); + statsBuilder_ = null; + stats_ = other.stats_; + bitField0_ = (bitField0_ & ~0x00000010); + statsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getStatsFieldBuilder() : null; + } else { + statsBuilder_.addAllMessages(other.stats_); + } + } + } + if (!other.childId_.isEmpty()) { + if (childId_.isEmpty()) { + childId_ = other.childId_; + childId_.makeImmutable(); + bitField0_ |= 0x00000020; + } else { + ensureChildIdIsMutable(); + childId_.addAll(other.childId_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + metadata_ = input.readBytes(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: { + org.tensorflow.proto.profiler.Xplane.XStat m = + input.readMessage( + org.tensorflow.proto.profiler.Xplane.XStat.parser(), + extensionRegistry); + if (statsBuilder_ == null) { + ensureStatsIsMutable(); + stats_.add(m); + } else { + statsBuilder_.addMessage(m); + } + break; + } // case 42 + case 48: { + long v = input.readInt64(); + ensureChildIdIsMutable(); + childId_.addLong(v); + break; + } // case 48 + case 50: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureChildIdIsMutable(); + while (input.getBytesUntilLimit() > 0) { + childId_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
    +       * XPlane.event_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
    +       * XPlane.event_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * XPlane.event_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of the event.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of the event.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of the event.
    +       * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Name of the event.
    +       * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Name of the event.
    +       * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + *
    +       * Name of the event shown in trace viewer.
    +       * 
    + * + * string display_name = 4; + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Name of the event shown in trace viewer.
    +       * 
    + * + * string display_name = 4; + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Name of the event shown in trace viewer.
    +       * 
    + * + * string display_name = 4; + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Name of the event shown in trace viewer.
    +       * 
    + * + * string display_name = 4; + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Name of the event shown in trace viewer.
    +       * 
    + * + * string display_name = 4; + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; + /** + *
    +       * Additional metadata in serialized format.
    +       * 
    + * + * bytes metadata = 3; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetadata() { + return metadata_; + } + /** + *
    +       * Additional metadata in serialized format.
    +       * 
    + * + * bytes metadata = 3; + * @param value The metadata to set. + * @return This builder for chaining. + */ + public Builder setMetadata(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + metadata_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
    +       * Additional metadata in serialized format.
    +       * 
    + * + * bytes metadata = 3; + * @return This builder for chaining. + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000008); + metadata_ = getDefaultInstance().getMetadata(); + onChanged(); + return this; + } + + private java.util.List stats_ = + java.util.Collections.emptyList(); + private void ensureStatsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + stats_ = new java.util.ArrayList(stats_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.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.Xplane.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.Xplane.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.Xplane.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.Xplane.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.Xplane.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.Xplane.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.Xplane.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_ & ~0x00000010); + 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.Xplane.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.Xplane.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.Xplane.XStat.Builder addStatsBuilder() { + return getStatsFieldBuilder().addBuilder( + org.tensorflow.proto.profiler.Xplane.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.Xplane.XStat.Builder addStatsBuilder( + int index) { + return getStatsFieldBuilder().addBuilder( + index, org.tensorflow.proto.profiler.Xplane.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.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.tensorflow.proto.profiler.Xplane.XStat, org.tensorflow.proto.profiler.Xplane.XStat.Builder, org.tensorflow.proto.profiler.Xplane.XStatOrBuilder>( + stats_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + stats_ = null; + } + return statsBuilder_; + } + + private com.google.protobuf.Internal.LongList childId_ = emptyLongList(); + private void ensureChildIdIsMutable() { + if (!childId_.isModifiable()) { + childId_ = makeMutableCopy(childId_); + } + bitField0_ |= 0x00000020; + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @return A list containing the childId. + */ + public java.util.List + getChildIdList() { + childId_.makeImmutable(); + return childId_; + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @return The count of childId. + */ + public int getChildIdCount() { + return childId_.size(); + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @param index The index of the element to return. + * @return The childId at the given index. + */ + public long getChildId(int index) { + return childId_.getLong(index); + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @param index The index to set the value at. + * @param value The childId to set. + * @return This builder for chaining. + */ + public Builder setChildId( + int index, long value) { + + ensureChildIdIsMutable(); + childId_.setLong(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @param value The childId to add. + * @return This builder for chaining. + */ + public Builder addChildId(long value) { + + ensureChildIdIsMutable(); + childId_.addLong(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @param values The childId to add. + * @return This builder for chaining. + */ + public Builder addAllChildId( + java.lang.Iterable values) { + ensureChildIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, childId_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
    +       * XPlane.event_metadata map key for children events.
    +       * 
    + * + * repeated int64 child_id = 6; + * @return This builder for chaining. + */ + public Builder clearChildId() { + childId_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XEventMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XEventMetadata) + private static final org.tensorflow.proto.profiler.Xplane.XEventMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XEventMetadata(); + } + + public static org.tensorflow.proto.profiler.Xplane.XEventMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XEventMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XEventMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface XStatMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:tensorflow.profiler.XStatMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
    +     * XPlane.stat_metadata map key.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
    +     * Name of the stat (should be short).
    +     * Two XStatMetadata with different id should have different names.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
    +     * Name of the stat (should be short).
    +     * Two XStatMetadata with different id should have different names.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
    +     * Description of the stat (might be long).
    +     * 
    + * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
    +     * Description of the stat (might be long).
    +     * 
    + * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
    +   * Metadata for an XStat, corresponds to a stat type and is shared by all
    +   * XStats with the same metadata_id.
    +   * Next ID: 4
    +   * 
    + * + * Protobuf type {@code tensorflow.profiler.XStatMetadata} + */ + public static final class XStatMetadata extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:tensorflow.profiler.XStatMetadata) + XStatMetadataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + XStatMetadata.class.getName()); + } + // Use XStatMetadata.newBuilder() to construct. + private XStatMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private XStatMetadata() { + name_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStatMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XStatMetadata.class, org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
    +     * XPlane.stat_metadata map key.
    +     * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
    +     * Name of the stat (should be short).
    +     * Two XStatMetadata with different id should have different names.
    +     * 
    + * + * string name = 2; + * @return The name. + */ + @java.lang.Override + 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; + } + } + /** + *
    +     * Name of the stat (should be short).
    +     * Two XStatMetadata with different id should have different names.
    +     * 
    + * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + 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 DESCRIPTION_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
    +     * Description of the stat (might be long).
    +     * 
    + * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
    +     * Description of the stat (might be long).
    +     * 
    + * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (id_ != 0L) { + output.writeInt64(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + size += getUnknownFields().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.Xplane.XStatMetadata)) { + return super.equals(obj); + } + org.tensorflow.proto.profiler.Xplane.XStatMetadata other = (org.tensorflow.proto.profiler.Xplane.XStatMetadata) obj; + + if (getId() + != other.getId()) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata 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.Xplane.XStatMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata 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.Xplane.XStatMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.Xplane.XStatMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
    +     * Metadata for an XStat, corresponds to a stat type and is shared by all
    +     * XStats with the same metadata_id.
    +     * Next ID: 4
    +     * 
    + * + * Protobuf type {@code tensorflow.profiler.XStatMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:tensorflow.profiler.XStatMetadata) + org.tensorflow.proto.profiler.Xplane.XStatMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStatMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.tensorflow.proto.profiler.Xplane.XStatMetadata.class, org.tensorflow.proto.profiler.Xplane.XStatMetadata.Builder.class); + } + + // Construct using org.tensorflow.proto.profiler.Xplane.XStatMetadata.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + name_ = ""; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.tensorflow.proto.profiler.Xplane.internal_static_tensorflow_profiler_XStatMetadata_descriptor; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata getDefaultInstanceForType() { + return org.tensorflow.proto.profiler.Xplane.XStatMetadata.getDefaultInstance(); + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata build() { + org.tensorflow.proto.profiler.Xplane.XStatMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.tensorflow.proto.profiler.Xplane.XStatMetadata buildPartial() { + org.tensorflow.proto.profiler.Xplane.XStatMetadata result = new org.tensorflow.proto.profiler.Xplane.XStatMetadata(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(org.tensorflow.proto.profiler.Xplane.XStatMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.tensorflow.proto.profiler.Xplane.XStatMetadata) { + return mergeFrom((org.tensorflow.proto.profiler.Xplane.XStatMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.tensorflow.proto.profiler.Xplane.XStatMetadata other) { + if (other == org.tensorflow.proto.profiler.Xplane.XStatMetadata.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
    +       * XPlane.stat_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
    +       * XPlane.stat_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
    +       * XPlane.stat_metadata map key.
    +       * 
    + * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
    +       * Name of the stat (should be short).
    +       * Two XStatMetadata with different id should have different names.
    +       * 
    + * + * string name = 2; + * @return The name. + */ + 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; + } + } + /** + *
    +       * Name of the stat (should be short).
    +       * Two XStatMetadata with different id should have different names.
    +       * 
    + * + * string name = 2; + * @return The bytes for name. + */ + 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; + } + } + /** + *
    +       * Name of the stat (should be short).
    +       * Two XStatMetadata with different id should have different names.
    +       * 
    + * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
    +       * Name of the stat (should be short).
    +       * Two XStatMetadata with different id should have different names.
    +       * 
    + * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
    +       * Name of the stat (should be short).
    +       * Two XStatMetadata with different id should have different names.
    +       * 
    + * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
    +       * Description of the stat (might be long).
    +       * 
    + * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
    +       * Description of the stat (might be long).
    +       * 
    + * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
    +       * Description of the stat (might be long).
    +       * 
    + * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
    +       * Description of the stat (might be long).
    +       * 
    + * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
    +       * Description of the stat (might be long).
    +       * 
    + * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:tensorflow.profiler.XStatMetadata) + } + + // @@protoc_insertion_point(class_scope:tensorflow.profiler.XStatMetadata) + private static final org.tensorflow.proto.profiler.Xplane.XStatMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.Xplane.XStatMetadata(); + } + + public static org.tensorflow.proto.profiler.Xplane.XStatMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public XStatMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.Xplane.XStatMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XSpace_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XSpace_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XPlane_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XPlane_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XLine_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XLine_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XStat_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XStat_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XEventMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_tensorflow_profiler_XStatMetadata_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_tensorflow_profiler_XStatMetadata_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\"tsl/profiler/protobuf/xplane.proto\022\023te" + + "nsorflow.profiler\"j\n\006XSpace\022+\n\006planes\030\001 " + + "\003(\0132\033.tensorflow.profiler.XPlane\022\016\n\006erro" + + "rs\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.tensorflow.profiler." + + "XLine\022F\n\016event_metadata\030\004 \003(\0132..tensorfl" + + "ow.profiler.XPlane.EventMetadataEntry\022D\n" + + "\rstat_metadata\030\005 \003(\0132-.tensorflow.profil" + + "er.XPlane.StatMetadataEntry\022)\n\005stats\030\006 \003" + + "(\0132\032.tensorflow.profiler.XStat\032Y\n\022EventM" + + "etadataEntry\022\013\n\003key\030\001 \001(\003\0222\n\005value\030\002 \001(\013" + + "2#.tensorflow.profiler.XEventMetadata:\0028" + + "\001\032W\n\021StatMetadataEntry\022\013\n\003key\030\001 \001(\003\0221\n\005v" + + "alue\030\002 \001(\0132\".tensorflow.profiler.XStatMe" + + "tadata:\0028\001\"\273\001\n\005XLine\022\n\n\002id\030\001 \001(\003\022\022\n\ndisp" + + "lay_id\030\n \001(\003\022\014\n\004name\030\002 \001(\t\022\024\n\014display_na" + + "me\030\013 \001(\t\022\024\n\014timestamp_ns\030\003 \001(\003\022\023\n\013durati" + + "on_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\007J\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\toffs" + + "et_ps\030\002 \001(\003H\000\022\031\n\017num_occurrences\030\005 \001(\003H\000" + + "\022\023\n\013duration_ps\030\003 \001(\003\022)\n\005stats\030\004 \003(\0132\032.t" + + "ensorflow.profiler.XStatB\006\n\004data\"\255\001\n\005XSt" + + "at\022\023\n\013metadata_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\013b" + + "ytes_value\030\006 \001(\014H\000\022\023\n\tref_value\030\007 \001(\004H\000B" + + "\007\n\005value\"\217\001\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\010m" + + "etadata\030\003 \001(\014\022)\n\005stats\030\005 \003(\0132\032.tensorflo" + + "w.profiler.XStat\022\020\n\010child_id\030\006 \003(\003\">\n\rXS" + + "tatMetadata\022\n\n\002id\030\001 \001(\003\022\014\n\004name\030\002 \001(\t\022\023\n" + + "\013description\030\003 \001(\tB\"\n\035org.tensorflow.pro" + + "to.profiler\370\001\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_tensorflow_profiler_XSpace_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_tensorflow_profiler_XSpace_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XSpace_descriptor, + 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 + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XPlane_descriptor, + new java.lang.String[] { "Id", "Name", "Lines", "EventMetadata", "StatMetadata", "Stats", }); + internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor = + internal_static_tensorflow_profiler_XPlane_descriptor.getNestedTypes().get(0); + internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XPlane_EventMetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor = + internal_static_tensorflow_profiler_XPlane_descriptor.getNestedTypes().get(1); + internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XPlane_StatMetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_tensorflow_profiler_XLine_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_tensorflow_profiler_XLine_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XLine_descriptor, + new java.lang.String[] { "Id", "DisplayId", "Name", "DisplayName", "TimestampNs", "DurationPs", "Events", }); + internal_static_tensorflow_profiler_XEvent_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_tensorflow_profiler_XEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XEvent_descriptor, + new java.lang.String[] { "MetadataId", "OffsetPs", "NumOccurrences", "DurationPs", "Stats", "Data", }); + internal_static_tensorflow_profiler_XStat_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_tensorflow_profiler_XStat_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XStat_descriptor, + new java.lang.String[] { "MetadataId", "DoubleValue", "Uint64Value", "Int64Value", "StrValue", "BytesValue", "RefValue", "Value", }); + internal_static_tensorflow_profiler_XEventMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_tensorflow_profiler_XEventMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XEventMetadata_descriptor, + new java.lang.String[] { "Id", "Name", "DisplayName", "Metadata", "Stats", "ChildId", }); + internal_static_tensorflow_profiler_XStatMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_tensorflow_profiler_XStatMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_tensorflow_profiler_XStatMetadata_descriptor, + new java.lang.String[] { "Id", "Name", "Description", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/BUILD b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/BUILD new file mode 100644 index 00000000000..06572a0487e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/BUILD @@ -0,0 +1,22 @@ +# Description: +# Expose TensorFlow base api. + +load("//tensorflow:tensorflow.default.bzl", "filegroup") + +package( + # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"], + licenses = ["notice"], +) + +filegroup( + name = "base_api_def", + srcs = glob( + [ + "*", + ], + exclude = [ + "BUILD", + ], + ), + visibility = ["//tensorflow:internal"], +) diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Abort.pbtxt b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Abort.pbtxt new file mode 100644 index 00000000000..6dd923c512a --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Abort.pbtxt @@ -0,0 +1,16 @@ +op { + graph_op_name: "Abort" + attr { + name: "error_msg" + description: < [nan nan 0. 0.62236255 5.9914584 9.903487 inf] +``` +END +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Add.pbtxt b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Add.pbtxt new file mode 100644 index 00000000000..db0c12a0c59 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_Add.pbtxt @@ -0,0 +1,13 @@ +op { + graph_op_name: "Add" + summary: "Returns x + y element-wise." + description: < 26 + ``` +END +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AddSparseToTensorsMap.pbtxt b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AddSparseToTensorsMap.pbtxt new file mode 100644 index 00000000000..0438eac6549 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AddSparseToTensorsMap.pbtxt @@ -0,0 +1,58 @@ +op { + graph_op_name: "AddSparseToTensorsMap" + in_arg { + name: "sparse_indices" + description: <= 2." +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AdjustContrastv2.pbtxt b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AdjustContrastv2.pbtxt new file mode 100644 index 00000000000..429a5e4434e --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_AdjustContrastv2.pbtxt @@ -0,0 +1,36 @@ +op { + graph_op_name: "AdjustContrastv2" + endpoint { + name: "AdjustContrast" + } + in_arg { + name: "images" + description: <
    ) +END + } + attr { + name: "num_bits" + description: <::max() - numeric_limits::min()` + +*MIN_COMBINED Mode Example* + +Assume the input is type float and has a possible range of [0.0, 6.0] and the +output type is quint8 ([0, 255]). The min_range and max_range values should be +specified as 0.0 and 6.0. Quantizing from float to quint8 will multiply each +value of the input by 255/6 and cast to quint8. + +If the output type was qint8 ([-128, 127]), the operation will additionally +subtract each value by 128 prior to casting, so that the range of values aligns +with the range of qint8. + +If the mode is 'MIN_FIRST', then this approach is used: + +``` +num_discrete_values = 1 << (# of bits in T) +range_adjust = num_discrete_values / (num_discrete_values - 1) +range = (range_max - range_min) * range_adjust +range_scale = num_discrete_values / range +quantized = round(input * range_scale) - round(range_min * range_scale) + + numeric_limits::min() +quantized = max(quantized, numeric_limits::min()) +quantized = min(quantized, numeric_limits::max()) +``` + +The biggest difference between this and MIN_COMBINED is that the minimum range +is rounded first, before it's subtracted from the rounded value. With +MIN_COMBINED, a small bias is introduced where repeated iterations of quantizing +and dequantizing will introduce a larger and larger error. + +*SCALED mode Example* + +`SCALED` mode matches the quantization approach used in +`QuantizeAndDequantize{V2|V3}`. + +If the mode is `SCALED`, the quantization is performed by multiplying each +input value by a scaling_factor. +The scaling_factor is determined from `min_range` and `max_range` to be as large +as possible such that the range from `min_range` to `max_range` is representable +within values of type T. + +```c++ + + const int min_T = std::numeric_limits::min(); + const int max_T = std::numeric_limits::max(); + const float max_float = std::numeric_limits::max(); + + const float scale_factor_from_min_side = + (min_T * min_range > 0) ? min_T / min_range : max_float; + const float scale_factor_from_max_side = + (max_T * max_range > 0) ? max_T / max_range : max_float; + + const float scale_factor = std::min(scale_factor_from_min_side, + scale_factor_from_max_side); +``` + +We next use the scale_factor to adjust min_range and max_range as follows: + +```c++ + min_range = min_T / scale_factor; + max_range = max_T / scale_factor; +``` + + +e.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would +compare -128/-10.0 = 12.8 to 127/9.0 = 14.11, and set scaling_factor = 12.8 +In this case, min_range would remain -10, but max_range would be adjusted to +127 / 12.8 = 9.921875 + +So we will quantize input values in the range (-10, 9.921875) to (-128, 127). + +The input tensor can now be quantized by clipping values to the range +`min_range` to `max_range`, then multiplying by scale_factor as follows: + +```c++ +result = round(min(max_range, max(min_range, input)) * scale_factor) +``` + +The adjusted `min_range` and `max_range` are returned as outputs 2 and 3 of +this operation. These outputs should be used as the range for any further +calculations. + + +*narrow_range (bool) attribute* + +If true, we do not use the minimum quantized value. +i.e. for int8 the quantized output, it would be restricted to the range +-127..127 instead of the full -128..127 range. +This is provided for compatibility with certain inference backends. +(Only applies to SCALED mode) + + +*axis (int) attribute* + +An optional `axis` attribute can specify a dimension index of the input tensor, +such that quantization ranges will be calculated and applied separately for each +slice of the tensor along that dimension. This is useful for per-channel +quantization. + +If axis is specified, min_range and max_range + +if `axis`=None, per-tensor quantization is performed as normal. + + +*ensure_minimum_range (float) attribute* + +Ensures the minimum quantization range is at least this value. +The legacy default value for this is 0.01, but it is strongly suggested to +set it to 0 for new uses. + +END +} diff --git a/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_QuantizedAdd.pbtxt b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_QuantizedAdd.pbtxt new file mode 100644 index 00000000000..193bee4db91 --- /dev/null +++ b/tensorflow-core/tensorflow-core-native/src/gen/resources/org/tensorflow/base_api/api_def_QuantizedAdd.pbtxt @@ -0,0 +1,43 @@ +op { + graph_op_name: "QuantizedAdd" + in_arg { + name: "min_x" + description: < 1, there will be k-1 skipped cells between each +filter element on that dimension. The dimension order is determined by the +value of `data_format`, see above for details. Dilations in the batch and +depth dimensions must be 1. +END + } + summary: "Computes a 2D convolution given quantized 4D input and filter tensors." + description: <
    . * @param sampleWeights Optional sample weight(s) Operand whose dimensions match * * prediction. @@ -180,7 +179,7 @@ private static Operand maybeExpandWeights( * * @param tf the TensorFlowOps * @param labels Label values, a Tensor whose dimensions match predictions - * . + * . * @param predictions Predicted values, a Tensor of arbitrary dimensions. * @param the data type for the labels, predictions and result * @return labels and predictions, possibly with last dim squeezed. @@ -195,7 +194,7 @@ public static LossTuple removeSqueezableDimensions( * * @param tf the TensorFlowOps * @param labels Label values, a Operand whose dimensions match predictions - * . + *
    . * @param predictions Predicted values, a Tensor of arbitrary dimensions. * @param expectedRankDiff Expected result of rank(predictions) - rank(labels). * @param the data type for the labels, predictions and result @@ -223,11 +222,13 @@ public static LossTuple removeSqueezableDimensions( // Use dynamic rank. // TODO: hold for lazy select feature, - // Operand rankDiff = tf.math.sub(tf.rank(predictions), tf.rank(labels)); + // Operand rankDiff = tf.math.sub(tf.rank(predictions), + // tf.rank(labels)); if (predictionsRank == Shape.UNKNOWN_SIZE && Shape.isCompatible(predictionsShape.size(-1), 1)) { /* - * TODO, if we ever get a select that does lazy evaluation, but for now do the tf.squeeze - * predictions = tf.select( tf.math.equal(tf.constant(expectedRankDiff+1),rankDiff ), + * TODO, if we ever get a select that does lazy evaluation, but for now do the + * tf.squeeze predictions = tf.select( + * tf.math.equal(tf.constant(expectedRankDiff+1),rankDiff ), * tf.squeeze(predictions, Squeeze.axis(Arrays.asList(-1L))), predictions ); * */ predictions = tf.squeeze(predictions, Squeeze.axis(Collections.singletonList(-1L))); @@ -283,11 +284,12 @@ private static Operand reduceWeightedLoss( if (reduction == Reduction.NONE) { loss = weightedLoss; } else { - loss = - tf.reduceSum(weightedLoss, allAxes(tf, weightedLoss), ReduceSum.keepDims(Boolean.FALSE)); if (reduction == Reduction.AUTO || reduction == Reduction.SUM_OVER_BATCH_SIZE) { - loss = safeMean(tf, loss, weightedLoss.shape().size()); - } + loss = safeMean(tf, weightedLoss); + } else + loss = + tf.reduceSum( + weightedLoss, allAxes(tf, weightedLoss), ReduceSum.keepDims(Boolean.FALSE)); } return loss; } @@ -297,15 +299,14 @@ private static Operand reduceWeightedLoss( * * @param tf the TensorFlow Ops * @param losses Operand whose elements contain individual loss measurements. - * @param numElements The number of measurable elements in losses. * @param the data type of the losses * @return A scalar representing the mean of losses. If numElements is * zero, then zero is returned. */ - public static Operand safeMean( - Ops tf, Operand losses, long numElements) { - Operand totalLoss = tf.reduceSum(losses, allAxes(tf, losses)); - return tf.math.divNoNan(totalLoss, cast(tf, tf.constant(numElements), losses.type())); + public static Operand safeMean(Ops tf, Operand losses) { + Operand totalLoss = + tf.reduceSum(losses, allAxes(tf, losses), ReduceSum.keepDims(Boolean.FALSE)); + return tf.math.divNoNan(totalLoss, cast(tf, tf.shape.size(tf.shape(losses)), losses.type())); } /** @@ -349,7 +350,8 @@ public static Operand rangeCheck( tf.math.logicalAnd( tf.reduceAll(tf.math.greaterEqual(values, minValue), allDims), tf.reduceAll(tf.math.lessEqual(values, maxValue), allDims)); - // Graph and Eager mode need to be handled differently, control dependencies are not allowed in + // Graph and Eager mode need to be handled differently, control dependencies are + // not allowed in // Eager mode if (tf.scope().env().isGraph()) { AssertThat assertThat = @@ -399,7 +401,8 @@ public static Operand valueCheck( } else return values; } else { // use dynamic shape Operand cond = tf.math.equal(tf.shape.size(tf.shape(diff.out())), tf.constant(0)); - // Graph and Eager mode need to be handled differently, control dependencies are not allowed + // Graph and Eager mode need to be handled differently, control dependencies are + // not allowed // in Eager mode if (tf.scope().env().isGraph()) { AssertThat assertThat = diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/AUC.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/AUC.java index 870f4972c3c..b1f9f2c4e8a 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/AUC.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/AUC.java @@ -31,7 +31,6 @@ import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.Variable; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TNumber; @@ -88,7 +87,7 @@ * * @param The data type for the metric result */ -public class AUC extends Metric { +public class AUC extends BaseMetric { /** Default Fuzz factor. */ public static final float EPSILON = 1e-7f; @@ -109,14 +108,12 @@ public class AUC extends Metric { private final String falsePositivesName; private final String trueNegativesName; private final String falseNegativesName; - private final Map> initializers = new HashMap<>(); private final Class type; - + private final Zeros zeros = new Zeros<>(); /** The size of the label dimension. */ private Integer numLabels; private Operand labelWeights; - /** * If not {@link #multiLabel}, shape (T) where T is the number of thresholds. * @@ -124,7 +121,6 @@ public class AUC extends Metric { * class dimension within each example. */ private Variable truePositives; - /** * If not {@link #multiLabel}, shape (T) where T is the number of thresholds. * @@ -132,7 +128,6 @@ public class AUC extends Metric { * class dimension within each example. */ private Variable falsePositives; - /** * If not {@link #multiLabel}, shape (T) where T is the number of thresholds. * @@ -140,7 +135,6 @@ public class AUC extends Metric { * class dimension within each example. */ private Variable trueNegatives; - /** * If not {@link #multiLabel}, shape (T) where T is the number of thresholds. * @@ -149,7 +143,8 @@ public class AUC extends Metric { */ private Variable falseNegatives; - private boolean initialized; + private Shape variableShape; + private Shape shape; /** * Creates an AUC (Area under the curve) metric using {@link #DEFAULT_NAME} for the metric name, @@ -157,14 +152,12 @@ public class AUC extends Metric { * {@link AUCSummationMethod#INTERPOLATION} for the summation method, {@code null} for thresholds, * {@code false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, long seed, Class type) { + public AUC(long seed, Class type) { this( - tf, null, DEFAULT_NUM_THRESHOLDS, AUCCurve.ROC, @@ -182,15 +175,13 @@ public AUC(Ops tf, long seed, Class type) { * AUCSummationMethod#INTERPOLATION} for the summation method, {@code null} for thresholds, {@code * false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, String name, long seed, Class type) { + public AUC(String name, long seed, Class type) { this( - tf, name, DEFAULT_NUM_THRESHOLDS, AUCCurve.ROC, @@ -208,16 +199,14 @@ public AUC(Ops tf, String name, long seed, Class type) { * summation method, {@code null} for thresholds, {@code false} for multiLabel, and {@code null} * for labelWeights. * - * @param tf The TensorFlow Ops * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, int numThresholds, long seed, Class type) { + public AUC(int numThresholds, long seed, Class type) { this( - tf, null, numThresholds, AUCCurve.ROC, @@ -235,16 +224,14 @@ public AUC(Ops tf, int numThresholds, long seed, Class type) { * summation method, {@code null} for numThresholds, {@code false} for multiLabel, and {@code * null} for labelWeights. * - * @param tf The TensorFlow Ops * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, float[] thresholds, long seed, Class type) { + public AUC(float[] thresholds, long seed, Class type) { this( - tf, null, DEFAULT_NUM_THRESHOLDS, AUCCurve.ROC, @@ -261,7 +248,6 @@ public AUC(Ops tf, float[] thresholds, long seed, Class type) { * {@link AUCSummationMethod#INTERPOLATION} for the summation method, {@code null} for thresholds, * {@code false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. @@ -269,9 +255,8 @@ public AUC(Ops tf, float[] thresholds, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, String name, int numThresholds, long seed, Class type) { + public AUC(String name, int numThresholds, long seed, Class type) { this( - tf, name, numThresholds, AUCCurve.ROC, @@ -289,7 +274,6 @@ public AUC(Ops tf, String name, int numThresholds, long seed, Class type) { * method, {@link #DEFAULT_NUM_THRESHOLDS} num thresholds, {@code false} for multiLabel, and * {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. @@ -297,9 +281,8 @@ public AUC(Ops tf, String name, int numThresholds, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, String name, float[] thresholds, long seed, Class type) { + public AUC(String name, float[] thresholds, long seed, Class type) { this( - tf, name, DEFAULT_NUM_THRESHOLDS, AUCCurve.ROC, @@ -316,7 +299,6 @@ public AUC(Ops tf, String name, float[] thresholds, long seed, Class type) { * the summation method, {@code null} for thresholds, {@code false} for multiLabel, and {@code * null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. @@ -326,9 +308,8 @@ public AUC(Ops tf, String name, float[] thresholds, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, String name, int numThresholds, AUCCurve curve, long seed, Class type) { + public AUC(String name, int numThresholds, AUCCurve curve, long seed, Class type) { this( - tf, name, numThresholds, curve, @@ -345,7 +326,6 @@ public AUC(Ops tf, String name, int numThresholds, AUCCurve curve, long seed, Cl * AUCSummationMethod#INTERPOLATION} for the summation method, {@link #DEFAULT_NUM_THRESHOLDS} num * thresholds, {@code false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. @@ -355,9 +335,8 @@ public AUC(Ops tf, String name, int numThresholds, AUCCurve curve, long seed, Cl * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, String name, float[] thresholds, AUCCurve curve, long seed, Class type) { + public AUC(String name, float[] thresholds, AUCCurve curve, long seed, Class type) { this( - tf, name, DEFAULT_NUM_THRESHOLDS, curve, @@ -374,7 +353,6 @@ public AUC(Ops tf, String name, float[] thresholds, AUCCurve curve, long seed, C * {@link AUCSummationMethod#INTERPOLATION} for the summation method, {@code null} for thresholds, * {@code false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. * @param curve specifies the type of the curve to be computed, {@link AUCCurve#ROC} or {@link @@ -383,9 +361,8 @@ public AUC(Ops tf, String name, float[] thresholds, AUCCurve curve, long seed, C * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, int numThresholds, AUCCurve curve, long seed, Class type) { + public AUC(int numThresholds, AUCCurve curve, long seed, Class type) { this( - tf, null, numThresholds, curve, @@ -402,7 +379,6 @@ public AUC(Ops tf, int numThresholds, AUCCurve curve, long seed, Class type) * AUCSummationMethod#INTERPOLATION} for the summation method, {@code false} for multiLabel, and * {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. * @param curve specifies the type of the curve to be computed, {@link AUCCurve#ROC} or {@link @@ -411,9 +387,8 @@ public AUC(Ops tf, int numThresholds, AUCCurve curve, long seed, Class type) * will always produce the same random tensor for a given shape and data type. * @param type the data type for the confusion matrix variables. */ - public AUC(Ops tf, float[] thresholds, AUCCurve curve, long seed, Class type) { + public AUC(float[] thresholds, AUCCurve curve, long seed, Class type) { this( - tf, null, DEFAULT_NUM_THRESHOLDS, curve, @@ -429,7 +404,6 @@ public AUC(Ops tf, float[] thresholds, AUCCurve curve, long seed, Class type) * Creates an AUC (Area under the curve) metric. using {@link #DEFAULT_NAME} for the metric name,, * {@code null} for thresholds, {@code false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. * @param curve specifies the type of the curve to be computed, {@link AUCCurve#ROC} or {@link @@ -440,13 +414,12 @@ public AUC(Ops tf, float[] thresholds, AUCCurve curve, long seed, Class type) * @param type the data type for the confusion matrix variables. */ public AUC( - Ops tf, int numThresholds, AUCCurve curve, AUCSummationMethod summationMethod, long seed, Class type) { - this(tf, null, numThresholds, curve, summationMethod, null, false, null, seed, type); + this(null, numThresholds, curve, summationMethod, null, false, null, seed, type); } /** @@ -454,7 +427,6 @@ public AUC( * {@code null} for numThresholds, {@code false} for multiLabel, and {@code null} for * labelWeights. * - * @param tf The TensorFlow Ops * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. * @param curve specifies the type of the curve to be computed, {@link AUCCurve#ROC} or {@link @@ -465,30 +437,18 @@ public AUC( * @param type the data type for the confusion matrix variables. */ public AUC( - Ops tf, float[] thresholds, AUCCurve curve, AUCSummationMethod summationMethod, long seed, Class type) { - this( - tf, - null, - DEFAULT_NUM_THRESHOLDS, - curve, - summationMethod, - thresholds, - false, - null, - seed, - type); + this(null, DEFAULT_NUM_THRESHOLDS, curve, summationMethod, thresholds, false, null, seed, type); } /** * Creates an AUC (Area under the curve) metric. using {@code null} for thresholds, {@code false} * for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param numThresholds the number of thresholds to use when discretizing the roc curve. Values * must be > 1. @@ -500,21 +460,19 @@ public AUC( * @param type the data type for the confusion matrix variables. */ public AUC( - Ops tf, String name, int numThresholds, AUCCurve curve, AUCSummationMethod summationMethod, long seed, Class type) { - this(tf, name, numThresholds, curve, summationMethod, null, false, null, seed, type); + this(name, numThresholds, curve, summationMethod, null, false, null, seed, type); } /** * Creates an AUC (Area under the curve) metric. using {@code null} for the numThresholds, {@code * false} for multiLabel, and {@code null} for labelWeights. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if {@code null} defaults to {@link #DEFAULT_NAME} * @param thresholds Optional values to use as the thresholds for discretizing the curve. If set, * the numThresholds parameter is ignored. Values should be in [0, 1]. @@ -526,30 +484,18 @@ public AUC( * @param type the data type for the confusion matrix variables. */ public AUC( - Ops tf, String name, float[] thresholds, AUCCurve curve, AUCSummationMethod summationMethod, long seed, Class type) { - this( - tf, - name, - DEFAULT_NUM_THRESHOLDS, - curve, - summationMethod, - thresholds, - false, - null, - seed, - type); + this(name, DEFAULT_NUM_THRESHOLDS, curve, summationMethod, thresholds, false, null, seed, type); } /** * Creates an AUC (Area under the curve) metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if name is null then use {@link #DEFAULT_NAME}. * @param numThresholds the number of thresholds to use when discretizing the roc curve. This * includes the bracketing 0 and 1 thresholds, so the value must be ≥ 2. @@ -576,7 +522,6 @@ public AUC( * a threshold value is less than 0 or greater than 1. */ public AUC( - Ops tf, String name, int numThresholds, AUCCurve curve, @@ -586,7 +531,7 @@ public AUC( Operand labelWeights, long seed, Class type) { - super(tf, name == null ? DEFAULT_NAME : name, seed); + super(name == null ? DEFAULT_NAME : name, seed); truePositivesName = getVariableName(TRUE_POSITIVES); falsePositivesName = getVariableName(FALSE_POSITIVES); trueNegativesName = getVariableName(TRUE_NEGATIVES); @@ -630,82 +575,71 @@ public AUC( // Handle multilabel arguments. - if (labelWeights != null) { - // assert that labelWeights are non-negative. - - this.labelWeights = labelWeights; - Op checks = - tf.withSubScope("AUC") - .assertThat( - tf.math.greaterEqual(labelWeights, cast(tf, tf.constant(0), labelWeights.type())), - Collections.singletonList( - tf.constant("All values of labelWeights must be non-negative."))); - - Ops ltf = - tf.withSubScope("updateState").withControlDependencies(Collections.singletonList(checks)); - - this.labelWeights = ltf.identity(this.labelWeights); - } + this.labelWeights = labelWeights; if (multiLabel) { numLabels = null; } } - /** - * Initialize truePositives, falsePositives, trueNegatives, and falseNegatives variables, given - * the shape of the data. - * - * @param shape the prediction shape if called from updateState, otherwise null - */ - @SuppressWarnings("unchecked") - private Map> build(Shape shape) { - Shape variableShape; - if (initialized) { - return Collections.EMPTY_MAP; - } - Ops tf = getTF(); - - if (isMultiLabel()) { - if (shape == null) { - throw new IllegalArgumentException("For multiLabel, a shape must be provided"); + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (shape != null && !isInitialized()) { + setTF(tf); + if (labelWeights != null) { + // assert that labelWeights are non-negative. + + Op checks = + tf.withSubScope("AUC") + .assertThat( + tf.math.greaterEqual( + labelWeights, cast(tf, tf.constant(0), labelWeights.type())), + Collections.singletonList( + tf.constant("All values of labelWeights must be non-negative."))); + + Ops ltf = + tf.withSubScope("updateState") + .withControlDependencies(Collections.singletonList(checks)); + + this.labelWeights = ltf.identity(this.labelWeights); + } + if (isMultiLabel()) { + if (shape == null) { + throw new IllegalArgumentException("For multiLabel, a shape must be provided"); + } + if (shape.numDimensions() != 2) + throw new IllegalArgumentException( + String.format( + "labels must have rank=2 when multiLabel is true. Found rank %d.", + shape.numDimensions())); + numLabels = (int) shape.size(1); + variableShape = Shape.of(numThresholds, numLabels); + } else { + variableShape = Shape.of(numThresholds); } - if (shape.numDimensions() != 2) - throw new IllegalArgumentException( - String.format( - "labels must have rank=2 when multiLabel is true. Found rank %d.", - shape.numDimensions())); - numLabels = (int) shape.size(1); - variableShape = Shape.of(numThresholds, numLabels); - } else { - variableShape = Shape.of(numThresholds); - } - // Create metric variables - Zeros zeros = new Zeros<>(); - Operand zero = zeros.call(tf, tf.constant(variableShape), type); - if (truePositives == null) { - truePositives = tf.withName(getTruePositivesName()).withInitScope().variable(zero); - initializers.put(ConfusionMatrixEnum.TRUE_POSITIVES, tf.assign(truePositives, zero)); - } + // Create metric variables - if (falsePositives == null) { - falsePositives = tf.withName(getFalsePositivesName()).withInitScope().variable(zero); - initializers.put(ConfusionMatrixEnum.FALSE_POSITIVES, tf.assign(falsePositives, zero)); - } + Operand zero = zeros.call(tf, tf.constant(variableShape), type); + if (truePositives == null) { + truePositives = tf.withName(getTruePositivesName()).withInitScope().variable(zero); + } - if (trueNegatives == null) { - trueNegatives = tf.withName(getTrueNegativesName()).withInitScope().variable(zero); - initializers.put(ConfusionMatrixEnum.TRUE_NEGATIVES, tf.assign(trueNegatives, zero)); - } + if (falsePositives == null) { + falsePositives = tf.withName(getFalsePositivesName()).withInitScope().variable(zero); + } - if (falseNegatives == null) { - falseNegatives = tf.withName(getFalseNegativesName()).withInitScope().variable(zero); - initializers.put(ConfusionMatrixEnum.FALSE_NEGATIVES, tf.assign(falseNegatives, zero)); - } + if (trueNegatives == null) { + trueNegatives = tf.withName(getTrueNegativesName()).withInitScope().variable(zero); + } - initialized = true; - return initializers; + if (falseNegatives == null) { + falseNegatives = tf.withName(getFalseNegativesName()).withInitScope().variable(zero); + } + setInitialized(true); + } } /** @@ -721,20 +655,20 @@ private Map> build(Shape shape) { * @return a List of Operations to update the metric state */ @Override - @SuppressWarnings("unchecked") public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Ops tf = getTF(); + if (shape == null) { + shape = predictions.shape(); + } + init(tf); Operand tLabels = cast(tf, labels, type); Operand tPredictions = cast(tf, predictions, type); Operand tSampleWeights = sampleWeights != null ? cast(tf, sampleWeights, type) : null; List updateOperations = new ArrayList<>(); - Map> varInitializers = Collections.EMPTY_MAP; - if (!initialized) { - varInitializers = build(tPredictions.shape()); - } + if (isMultiLabel() || getLabelWeights() != null) { // labels should have shape (number of examples, number of labels). List> symbols = new ArrayList<>(); @@ -767,7 +701,6 @@ public List updateStateList( MetricsHelper.updateConfusionMatrixVariables( tf, confusionMatrix, - varInitializers, tLabels, tPredictions, tf.constant(thresholds), @@ -785,8 +718,8 @@ public List updateStateList( * @param input the input * @return the input with all positive numbers. */ - private Operand positive(Operand input) { - return getTF().math.maximum(input, cast(getTF(), getTF().constant(0), input.type())); + private Operand positive(Ops tf, Operand input) { + return tf.math.maximum(input, cast(tf, tf.constant(0), input.type())); } /** @@ -795,8 +728,8 @@ private Operand positive(Operand input) { * @param input the input * @return the truth value of whether {@code input > 0}, element-wise. */ - private Operand isPositive(Operand input) { - return getTF().math.greater(input, cast(getTF(), getTF().constant(0), input.type())); + private Operand isPositive(Ops tf, Operand input) { + return tf.math.greater(input, cast(tf, tf.constant(0), input.type())); } /** @@ -807,9 +740,8 @@ private Operand isPositive(Operand input) { * @param size the size of the slice * @return the slice */ - private Operand slice(Operand input, int begin, int size) { - return getTF() - .slice(input, getTF().constant(new int[] {begin}), getTF().constant(new int[] {size})); + private Operand slice(Ops tf, Operand input, int begin, int size) { + return tf.slice(input, tf.constant(new int[] {begin}), tf.constant(new int[] {size})); } /** @@ -863,38 +795,37 @@ private Operand slice(Operand input, int begin, int size) { * @see The Relationship Between * Precision-Recall and ROC Curves - Davis & Goadrich 2006 */ - private Operand interpolatePRAuc() { + private Operand interpolatePRAuc(Ops tf) { // truePositives[:self.numThresholds - 1] - Ops tf = getTF(); - Operand tp0 = slice(truePositives, 0, getNumThresholds() - 1); + Operand tp0 = slice(tf, truePositives, 0, getNumThresholds() - 1); // truePositives[1:] - Operand tp1 = slice(truePositives, 1, -1); + Operand tp1 = slice(tf, truePositives, 1, -1); Operand dTP = tf.math.sub(tp0, tp1); Operand p = tf.math.add(truePositives, falsePositives); - Operand p0 = slice(p, 0, getNumThresholds() - 1); - Operand p1 = slice(p, 1, -1); + Operand p0 = slice(tf, p, 0, getNumThresholds() - 1); + Operand p1 = slice(tf, p, 1, -1); Operand dP = tf.math.sub(p0, p1); - Operand precisionSlope = tf.math.divNoNan(dTP, positive(dP)); + Operand precisionSlope = tf.math.divNoNan(dTP, positive(tf, dP)); Operand intercept = tf.math.sub(tp1, tf.math.mul(precisionSlope, p1)); Operand safePRatio = tf.select( - tf.math.logicalAnd(isPositive(p0), isPositive(p1)), - tf.math.divNoNan(p0, positive(p1)), + tf.math.logicalAnd(isPositive(tf, p0), isPositive(tf, p1)), + tf.math.divNoNan(p0, positive(tf, p1)), tf.onesLike(p1)); - Operand fn1 = slice(falseNegatives, 1, -1); + Operand fn1 = slice(tf, falseNegatives, 1, -1); Operand aucTotalPos = tf.math.mul( precisionSlope, tf.math.add(dTP, tf.math.mul(intercept, tf.math.log(safePRatio)))); - Operand prAucIncrement = tf.math.divNoNan(aucTotalPos, positive(tf.math.add(tp1, fn1))); + Operand prAucIncrement = tf.math.divNoNan(aucTotalPos, positive(tf, tf.math.add(tp1, fn1))); if (isMultiLabel()) { Operand byLabelAuc = tf.reduceSum(prAucIncrement, tf.constant(0)); @@ -914,13 +845,12 @@ private Operand interpolatePRAuc() { /** {@inheritDoc} */ @Override - public Operand result() { - + public Operand result(Ops tf, Class resultType) { + init(tf); if (getCurve() == AUCCurve.PR && getSummationMethod() == AUCSummationMethod.INTERPOLATION) { // This use case is different and is handled separately. - return interpolatePRAuc(); + return cast(tf, interpolatePRAuc(tf), resultType); } - Ops tf = getTF(); Operand x; Operand y; Operand recall = tf.math.divNoNan(truePositives, tf.math.add(truePositives, falseNegatives)); @@ -940,19 +870,22 @@ public Operand result() { // Find the rectangle heights based on `summationMethod`. // y[:self.numThresholds - 1] - Operand ySlice1 = slice(y, 0, getNumThresholds() - 1); + Operand ySlice1 = slice(tf, y, 0, getNumThresholds() - 1); // y[1:] - Operand ySlice2 = slice(y, 1, -1); + Operand ySlice2 = slice(tf, y, 1, -1); Operand heights; switch (getSummationMethod()) { case INTERPOLATION: + //noinspection SuspiciousNameCombination heights = tf.math.div(tf.math.add(ySlice1, ySlice2), cast(tf, tf.constant(2), y.type())); break; case MINORING: + //noinspection SuspiciousNameCombination heights = tf.math.minimum(ySlice1, ySlice2); break; case MAJORING: + //noinspection SuspiciousNameCombination heights = tf.math.maximum(ySlice1, ySlice2); break; default: @@ -962,111 +895,161 @@ public Operand result() { if (isMultiLabel()) { Operand riemannTerms = - tf.math.mul(tf.math.sub(slice(x, 0, getNumThresholds() - 1), slice(x, 1, -1)), heights); + tf.math.mul( + tf.math.sub(slice(tf, x, 0, getNumThresholds() - 1), slice(tf, x, 1, -1)), heights); Operand byLabelAuc = tf.reduceSum(riemannTerms, tf.constant(0)); if (getLabelWeights() == null) { - return MetricsHelper.mean(tf, byLabelAuc); + return cast(tf, MetricsHelper.mean(tf, byLabelAuc), resultType); } else { // Weighted average of the label AUCs. - return tf.math.divNoNan( - tf.reduceSum( - tf.math.mul(byLabelAuc, getLabelWeights()), allAxes(tf, getLabelWeights())), - tf.reduceSum(getLabelWeights(), allAxes(tf, getLabelWeights()))); + return cast( + tf, + tf.math.divNoNan( + tf.reduceSum( + tf.math.mul(byLabelAuc, getLabelWeights()), allAxes(tf, getLabelWeights())), + tf.reduceSum(getLabelWeights(), allAxes(tf, getLabelWeights()))), + resultType); } } else { - Operand slice1 = slice(x, 0, getNumThresholds() - 1); - Operand slice2 = slice(x, 1, -1); + Operand slice1 = slice(tf, x, 0, getNumThresholds() - 1); + Operand slice2 = slice(tf, x, 1, -1); Operand sub = tf.math.sub(slice1, slice2); Operand operand = tf.math.mul(sub, heights); - return tf.reduceSum(operand, allAxes(tf, operand)); + return cast(tf, tf.reduceSum(operand, allAxes(tf, operand)), resultType); } } /** {@inheritDoc} */ @Override - public Op resetStates() { - List updateOperations = new ArrayList<>(initializers.values()); - return getTF().withSubScope("resetStates").withControlDependencies(updateOperations).noOp(); + public Op resetStates(Ops tf) { + init(tf); + Operand zero = zeros.call(tf, tf.constant(variableShape), type); + List controlList = new ArrayList<>(); + if (truePositives != null) { + controlList.add(tf.assign(truePositives, zero)); + } + if (falsePositives != null) { + controlList.add(tf.assign(falsePositives, zero)); + } + if (trueNegatives != null) { + controlList.add(tf.assign(trueNegatives, zero)); + } + if (falseNegatives != null) { + controlList.add(tf.assign(falseNegatives, zero)); + } + return tf.withControlDependencies(controlList).noOp(); } - /** @return the numThresholds */ + /** + * @return the numThresholds + */ public int getNumThresholds() { return numThresholds; } - /** @return the curve */ + /** + * @return the curve + */ public AUCCurve getCurve() { return curve; } - /** @return the summationMethod */ + /** + * @return the summationMethod + */ public AUCSummationMethod getSummationMethod() { return summationMethod; } - /** @return the thresholds */ + /** + * @return the thresholds + */ public float[] getThresholds() { return thresholds; } - /** @return the multiLabel */ + /** + * @return the multiLabel + */ public boolean isMultiLabel() { return multiLabel; } - /** @return the numLabels */ + /** + * @return the numLabels + */ public Integer getNumLabels() { return numLabels; } - /** @param numLabels the numLabels to set */ + /** + * @param numLabels the numLabels to set + */ public void setNumLabels(Integer numLabels) { this.numLabels = numLabels; } - /** @return the labelWeights */ + /** + * @return the labelWeights + */ public Operand getLabelWeights() { return labelWeights; } - /** @return the truePositives */ + /** + * @return the truePositives + */ public Variable getTruePositives() { return truePositives; } - /** @return the falsePositives */ + /** + * @return the falsePositives + */ public Variable getFalsePositives() { return falsePositives; } - /** @return the trueNegatives */ + /** + * @return the trueNegatives + */ public Variable getTrueNegatives() { return trueNegatives; } - /** @return the falseNegatives */ + /** + * @return the falseNegatives + */ public Variable getFalseNegatives() { return falseNegatives; } - /** @return the truePositivesName */ + /** + * @return the truePositivesName + */ public String getTruePositivesName() { return truePositivesName; } - /** @return the falsePositivesName */ + /** + * @return the falsePositivesName + */ public String getFalsePositivesName() { return falsePositivesName; } - /** @return the trueNegativesName */ + /** + * @return the trueNegativesName + */ public String getTrueNegativesName() { return trueNegativesName; } - /** @return the falseNegativesName */ + /** + * @return the falseNegativesName + */ public String getFalseNegativesName() { return falseNegativesName; } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Accuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Accuracy.java index 14f45020739..f0324e4daa5 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Accuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Accuracy.java @@ -16,10 +16,11 @@ import static org.tensorflow.framework.utils.CastHelper.cast; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.impl.LossTuple; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.framework.metrics.impl.MetricsHelper; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; @@ -36,31 +37,29 @@ * * @param The data type for the metric result */ -public class Accuracy extends MeanMetricWrapper implements LossMetric { +public class Accuracy extends MeanBaseMetricWrapper implements LossMetric { /** * Creates an Accuracy Metric using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Accuracy(Ops tf, long seed, Class type) { - this(tf, null, seed, type); + public Accuracy(long seed, Class type) { + this(null, seed, type); } /** * Creates an Accuracy Metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Accuracy(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public Accuracy(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } @@ -68,18 +67,24 @@ public Accuracy(Ops tf, String name, long seed, Class type) { * Calculates how often predictions equals labels. {@code labels} and {@code predictions} must * have compatible shapes, see {@link Shape @isCompatibleWith}. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels * @param predictions the predictions - * @throws IllegalArgumentException if predictions and labels shapes are not compatible. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return the loss */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); LossTuple tuple = - MetricsHelper.raggedAssertCompatibleAndGetFlatValues(getTF(), tLabels, tPredictions); + MetricsHelper.raggedAssertCompatibleAndGetFlatValues(tf, tLabels, tPredictions); tLabels = tuple.getLabels(); tPredictions = tuple.getTarget(); @@ -91,6 +96,6 @@ public Operand call( } // cast TBool to result type - return cast(getTF(), getTF().math.equal(tLabels, tPredictions), getResultType()); + return cast(tf, tf.math.equal(tLabels, tPredictions), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BaseMetric.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BaseMetric.java new file mode 100644 index 00000000000..0605f0f5ef5 --- /dev/null +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BaseMetric.java @@ -0,0 +1,259 @@ +/* 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. +=======================================================================*/ +package org.tensorflow.framework.metrics; + +import java.util.Collections; +import java.util.List; +import org.tensorflow.Graph; +import org.tensorflow.Operand; +import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; +import org.tensorflow.types.family.TNumber; + +/** Base class for Metrics */ +public abstract class BaseMetric implements Metric { + + /** The seed for random number generation */ + private final long seed; + + private String name; + + private boolean initialized; + + private Ops tf; + + /** + * Creates a Metric with a name of {@link Class#getSimpleName()} + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + */ + protected BaseMetric(long seed) { + this(null, seed); + } + + /** + * Creates a Metric + * + * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + */ + protected BaseMetric(String name, long seed) { + + this.seed = seed; + this.name = name != null ? name : this.getClass().getSimpleName(); + } + + /** + * Creates a List of Operations to update the metric state based on input values. + * + *

    This is an empty implementation that should be overridden in a subclass, if needed. + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param values the inputs to be passed to update state, this may not be null + * @param sampleWeights sample weights to be applied to the values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return a List of Operations to update the metric state + */ + @SuppressWarnings({"unchecked", "unused"}) + @Override + public List updateStateList( + Ops tf, Operand values, Operand sampleWeights) { + checkIsGraph(tf); + return Collections.EMPTY_LIST; + } + + /** + * Creates a List of Operations to update the metric state based on labels and predictions. + * + *

    This is an empty implementation that should be overridden in a subclass, if needed. + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param labels the labels + * @param predictions the predictions + * @param sampleWeights sample weights to be applied to the metric values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return a List of Operations to update the metric state + */ + @Override + @SuppressWarnings({"unchecked", "unused"}) + public List updateStateList( + Ops tf, + Operand labels, + Operand predictions, + Operand sampleWeights) { + checkIsGraph(tf); + return Collections.EMPTY_LIST; + } + + /** + * Creates a NoOp Operation with control dependencies to update the metric state + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param values the inputs to be passed to update state, this may not be null + * @param sampleWeights sample weights to be applied to the values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return the Operation to update the metric state + */ + public final Op updateState( + Ops tf, Operand values, Operand sampleWeights) { + checkIsGraph(tf); + List controlOps = updateStateList(tf, values, sampleWeights); + return tf.withSubScope("updateState").withControlDependencies(controlOps).noOp(); + } + + /** + * Creates a NoOp Operation with control dependencies to update the metric state + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param labels the labels + * @param predictions the predictions + * @param sampleWeights sample weights to be applied to the metric values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return the Operation to update the metric state + */ + public final Op updateState( + Ops tf, + Operand labels, + Operand predictions, + Operand sampleWeights) { + List controlOps = updateStateList(tf, labels, predictions, sampleWeights); + return tf.withSubScope("updateState").withControlDependencies(controlOps).noOp(); + } + + /** + * Calls update state once, followed by a call to get the result + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param values the inputs to be passed to update state, this may not be null + * @param sampleWeights sample weights to be applied to the values, may be null. + * @param The data type for the metric result + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return the result, possibly with control dependencies + */ + @Override + public final Operand callOnce( + Ops tf, + Operand values, + Operand sampleWeights, + Class type) { + checkIsGraph(tf); + List controlOps = updateStateList(tf, values, sampleWeights); + Ops ltf = tf.withSubScope("callOnce").withControlDependencies(controlOps); + return ltf.identity(result(ltf, type)); + } + + /** + * Gets a formatted name for a variable, in the form {@link #name} + "_" + varName. + * + * @param varName the base name for the variable + * @return the formatted variable name + */ + protected String getVariableName(String varName) { + return String.format("%s_%s", this.name, varName); + } + + /** + * The name for this metric. Defaults to {@link Class#getSimpleName()}. + * + *

    Gets the name of this metric. + * + * @return the name of this metric + */ + public String getName() { + return name; + } + + /** + * Sets the metric name + * + * @param name the metric name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Gets the random number generator seed value + * + * @return the random number generator seed value + */ + public long getSeed() { + return seed; + } + + /** + * Initialize the TensorFlow Ops + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @throws IllegalArgumentException if the TensorFlow Ops does not have a Graph environment, + */ + protected abstract void init(Ops tf); + + /** + * Gets the TensorFlow Ops for this metric + * + * @return the TensorFlow Ops for this metric. + */ + protected Ops getTF() { + return tf; + } + + /** + * Sets the TensorFlow Ops for this metric. + * + *

    This should be set from the {@link #init(Ops)} implementation. + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + */ + protected void setTF(Ops tf) { + checkIsGraph(tf); + this.tf = tf; + } + + /** + * Checks whether the Metric is initialized or not. + * + * @return true if the Metric has been initialized. + */ + public boolean isInitialized() { + return initialized; + } + + /** + * Sets the initialized indicator + * + * @param initialized the initialized indicator + */ + protected void setInitialized(boolean initialized) { + this.initialized = initialized; + } + + /** + * Checks if the TensorFlow Ops encapsulates a {@link Graph} environment. + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. + */ + protected void checkIsGraph(Ops tf) { + if (!tf.scope().env().isGraph()) { + throw new IllegalArgumentException( + "The Ops environment is not a Graph, Graph is required for metrics."); + } + } +} diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryAccuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryAccuracy.java index c27bf1b2acf..b230c76b111 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryAccuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryAccuracy.java @@ -16,9 +16,10 @@ import static org.tensorflow.framework.utils.CastHelper.cast; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; @@ -33,8 +34,8 @@ * * @param The data type for the metric result */ -public class BinaryAccuracy extends MeanMetricWrapper - implements LossMetric { +public class BinaryAccuracy extends MeanBaseMetricWrapper + implements LossMetric { /** the default threshold value for deciding whether prediction values are 1 or 0 */ public static final float DEFAULT_THRESHOLD = 0.5f; @@ -45,40 +46,37 @@ public class BinaryAccuracy extends MeanMetricWrapper * Creates a BinaryAccuracy Metric using {@link Class#getSimpleName()} for the metric name and * {@link #DEFAULT_THRESHOLD} for the threshold value. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public BinaryAccuracy(Ops tf, long seed, Class type) { - this(tf, null, DEFAULT_THRESHOLD, seed, type); + public BinaryAccuracy(long seed, Class type) { + this(null, DEFAULT_THRESHOLD, seed, type); } /** * Creates a BinaryAccuracy Metric using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param threshold a threshold for deciding whether prediction values are 1 or 0 * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public BinaryAccuracy(Ops tf, float threshold, long seed, Class type) { - this(tf, null, threshold, seed, type); + public BinaryAccuracy(float threshold, long seed, Class type) { + this(null, threshold, seed, type); } /** * Creates a BinaryAccuracy Metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param threshold a threshold for deciding whether prediction values are 1 or 0 * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public BinaryAccuracy(Ops tf, String name, float threshold, long seed, Class type) { - super(tf, name, seed, type); + public BinaryAccuracy(String name, float threshold, long seed, Class type) { + super(name, seed, type); this.threshold = threshold; setLoss(this); } @@ -86,19 +84,24 @@ public BinaryAccuracy(Ops tf, String name, float threshold, long seed, Class /** * Calculates how often predictions match binary labels. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Binary accuracy values. shape = {@code [batch_size, d0, .. dN-1]} */ @Override - public Operand call( - Operand labels, Operand predictions) { - - Operand tPredictions = cast(getTF(), predictions, getResultType()); - Operand thresholdCast = cast(getTF(), getTF().constant(threshold), getResultType()); - tPredictions = - cast(getTF(), getTF().math.greater(tPredictions, thresholdCast), getResultType()); - Operand tLabels = cast(getTF(), labels, getResultType()); - return cast(getTF(), getTF().math.equal(tLabels, tPredictions), getResultType()); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tPredictions = cast(tf, predictions, getInternalType()); + Operand thresholdCast = cast(tf, tf.constant(threshold), getInternalType()); + tPredictions = cast(tf, tf.math.greater(tPredictions, thresholdCast), getInternalType()); + Operand tLabels = cast(tf, labels, getInternalType()); + return cast(tf, tf.math.equal(tLabels, tPredictions), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryCrossentropy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryCrossentropy.java index 57a6f75375d..d306a00f70d 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryCrossentropy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/BinaryCrossentropy.java @@ -14,15 +14,16 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A Metric that computes the binary cross-entropy loss between true labels and predicted labels. * @@ -31,16 +32,31 @@ * * @param The data type for the metric result */ -public class BinaryCrossentropy extends MeanMetricWrapper - implements LossMetric { +public class BinaryCrossentropy extends MeanBaseMetricWrapper + implements LossMetric { private final boolean fromLogits; private final float labelSmoothing; + /** + * Creates a BinaryCrossentropy metric where name is {@link Class#getSimpleName()}. + * + * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a + * probability distribution. + * @param labelSmoothing value used to smooth labels, When 0, no smoothing occurs. When > 0, + * compute the loss between the predicted labels and a smoothed version of the true labels, + * where the smoothing squeezes the labels towards 0.5. Larger values of label_smoothing + * correspond to heavier smoothing. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public BinaryCrossentropy(boolean fromLogits, float labelSmoothing, long seed, Class type) { + this(null, fromLogits, labelSmoothing, seed, type); + } /** * Creates a BinaryCrossentropy metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a * probability distribution. @@ -53,8 +69,8 @@ public class BinaryCrossentropy extends MeanMetricWrapper * @param type the type for the variables and result */ public BinaryCrossentropy( - Ops tf, String name, boolean fromLogits, float labelSmoothing, long seed, Class type) { - super(tf, name, seed, type); + String name, boolean fromLogits, float labelSmoothing, long seed, Class type) { + super(name, seed, type); setLoss(this); this.fromLogits = fromLogits; this.labelSmoothing = labelSmoothing; @@ -63,16 +79,23 @@ public BinaryCrossentropy( /** * Computes the binary crossentropy loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, has the same shape as predictions and shape = {@code * [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Binary crossentropy loss value. shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.binaryCrossentropy(getTF(), tLabels, tPredictions, fromLogits, labelSmoothing); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.binaryCrossentropy(tf, tLabels, tPredictions, fromLogits, labelSmoothing); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalAccuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalAccuracy.java index 70dfebc508d..19547612503 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalAccuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalAccuracy.java @@ -16,9 +16,10 @@ import static org.tensorflow.framework.utils.CastHelper.cast; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.op.core.OneHot; import org.tensorflow.types.TInt64; @@ -43,32 +44,30 @@ * * @param The data type for the metric result */ -public class CategoricalAccuracy extends MeanMetricWrapper - implements LossMetric { +public class CategoricalAccuracy extends MeanBaseMetricWrapper + implements LossMetric { /** * Creates a CategoricalAccuracy metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public CategoricalAccuracy(Ops tf, long seed, Class type) { - this(tf, null, seed, type); + public CategoricalAccuracy(long seed, Class type) { + this(null, seed, type); } /** * Creates a CategoricalAccuracy metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public CategoricalAccuracy(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public CategoricalAccuracy(String name, long seed, Class type) { + super(name, seed, type); super.setLoss(this); } @@ -79,16 +78,23 @@ public CategoricalAccuracy(Ops tf, String name, long seed, Class type) { * rather than as labels. If necessary, use {@link Ops#oneHot} to expand {@code labels} as a * vector. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels One-hot ground truth values. * @param predictions tThe prediction values. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Categorical accuracy values. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand trueMax = getTF().math.argMax(labels, getTF().constant(-1)); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand trueMax = tf.math.argMax(labels, tf.constant(-1)); - Operand predMax = getTF().math.argMax(predictions, getTF().constant(-1)); - return cast(getTF(), getTF().math.equal(trueMax, predMax), getResultType()); + Operand predMax = tf.math.argMax(predictions, tf.constant(-1)); + return cast(tf, tf.math.equal(trueMax, predMax), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalCrossentropy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalCrossentropy.java index fa7c1a1a626..0390660de1b 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalCrossentropy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalCrossentropy.java @@ -16,10 +16,11 @@ import static org.tensorflow.framework.utils.CastHelper.cast; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; @@ -33,12 +34,54 @@ * * @param The data type for the metric result */ -public class CategoricalCrossentropy extends MeanMetricWrapper - implements LossMetric { +public class CategoricalCrossentropy extends MeanBaseMetricWrapper + implements LossMetric { private final boolean fromLogits; private final float labelSmoothing; private final int axis; + /** + * Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the + * labels and predictions using {@link Class#getSimpleName()} for the metric name + * + *

    Uses a {@link Losses#CHANNELS_LAST} for the channel axis. + * + * @param fromLogits Whether to interpret predictions as a tensor of logit values oras opposed to + * a probability distribution. + * @param labelSmoothing value used to smooth labels, When > 0, label values are smoothed, + * meaning the confidence on label values are relaxed. e.g. {@code labelSmoothing=0.2} means + * that we will use a value of {@code 0.1} for label {@code 0} and {@code 0.9 } for label + * {@code 1} + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CategoricalCrossentropy( + boolean fromLogits, float labelSmoothing, long seed, Class type) { + this(null, fromLogits, labelSmoothing, Losses.CHANNELS_LAST, seed, type); + } + + /** + * Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the + * labels and predictions using {@link Class#getSimpleName()} for the metric name. + * + * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a + * probability distribution. + * @param labelSmoothing value used to smooth labels, When > 0, label values are smoothed, + * meaning the confidence on label values are relaxed. e.g. {@code labelSmoothing=0.2} means + * that we will use a value of {@code 0.1} for label {@code 0} and {@code 0.9 } for label + * {@code 1} + * @param axis Int specifying the channels axis. {@code axis={@link Losses#CHANNELS_LAST}} + * corresponds to data format {@code channels_last}, and {@code axis={@link + * Losses#CHANNELS_FIRST}} corresponds to data format {@code channels_first}. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CategoricalCrossentropy( + boolean fromLogits, float labelSmoothing, int axis, long seed, Class type) { + this(null, fromLogits, labelSmoothing, axis, seed, type); + } /** * Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the @@ -46,7 +89,6 @@ public class CategoricalCrossentropy extends MeanMetricWrappe * *

    Uses a {@link Losses#CHANNELS_LAST} for the channel axis. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param fromLogits Whether to interpret predictions as a tensor of logit values oras opposed to * a probability distribution. @@ -59,15 +101,14 @@ public class CategoricalCrossentropy extends MeanMetricWrappe * @param type the type for the variables and result */ public CategoricalCrossentropy( - Ops tf, String name, boolean fromLogits, float labelSmoothing, long seed, Class type) { - this(tf, name, fromLogits, labelSmoothing, Losses.CHANNELS_LAST, seed, type); + String name, boolean fromLogits, float labelSmoothing, long seed, Class type) { + this(name, fromLogits, labelSmoothing, Losses.CHANNELS_LAST, seed, type); } /** * Creates a CategoricalCrossentropy metric that computes the crossentropy metric between the * labels and predictions. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a * probability distribution. @@ -83,14 +124,8 @@ public CategoricalCrossentropy( * @param type the type for the variables and result */ public CategoricalCrossentropy( - Ops tf, - String name, - boolean fromLogits, - float labelSmoothing, - int axis, - long seed, - Class type) { - super(tf, name, seed, type); + String name, boolean fromLogits, float labelSmoothing, int axis, long seed, Class type) { + super(name, seed, type); setLoss(this); this.fromLogits = fromLogits; this.labelSmoothing = labelSmoothing; @@ -100,16 +135,23 @@ public CategoricalCrossentropy( /** * Computes the crossentropy loss between the labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, of one-hot true targets, same shape as predictions * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Categorical crossentropy loss value. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); return Losses.categoricalCrossentropy( - getTF(), tLabels, tPredictions, fromLogits, labelSmoothing, axis); + tf, tLabels, tPredictions, fromLogits, labelSmoothing, axis); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalHinge.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalHinge.java index 1f6d0fd002c..b7246e66790 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalHinge.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CategoricalHinge.java @@ -14,49 +14,66 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A Metric that computes the categorical hinge loss metric between labels and predictions. * * @param The data type for the metric result */ -public class CategoricalHinge extends MeanMetricWrapper - implements LossMetric { +public class CategoricalHinge extends MeanBaseMetricWrapper + implements LossMetric { + /** + * Creates a CategoricalHinge metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CategoricalHinge(long seed, Class type) { + this(null, seed, type); + } /** * Creates a CategoricalHinge metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public CategoricalHinge(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public CategoricalHinge(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the categorical hinge metric between {@code labels} and @{code predictions}. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, labels values are expected to be 0 or 1. * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Categorical hinge loss values. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.categoricalHinge(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.categoricalHinge(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CosineSimilarity.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CosineSimilarity.java index 230286a738f..c02caa4d8fd 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CosineSimilarity.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/CosineSimilarity.java @@ -14,15 +14,16 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the cosine similarity metric between labels and predictions. * @@ -38,50 +39,83 @@ * @param The data type for the metric result. * @see Cosine Similarity */ -public class CosineSimilarity extends MeanMetricWrapper - implements LossMetric { +public class CosineSimilarity extends MeanBaseMetricWrapper + implements LossMetric { public static final int DEFAULT_AXIS = -1; private final int[] axis; + /** + * Creates a metric that computes the cosine similarity metric between labels and predictions with + * a default axis, {@link #DEFAULT_AXIS} and using {@link Class#getSimpleName()} for the metric + * name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CosineSimilarity(long seed, Class type) { + this(null, DEFAULT_AXIS, seed, type); + } + + /** + * Creates a metric that computes the cosine similarity metric between labels and predictions + * using {@link Class#getSimpleName()} for the metric name. + * + * @param axis The dimension along which the cosine similarity is computed. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CosineSimilarity(int axis, long seed, Class type) { + this(null, new int[] {axis}, seed, type); + } + /** + * Creates a CosineSimilarity metric using {@link Class#getSimpleName()} for the metric name. + * + * @param axis The dimension along which the cosine similarity is computed. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public CosineSimilarity(int[] axis, long seed, Class type) { + this(null, axis, seed, type); + } /** * Creates a metric that computes the cosine similarity metric between labels and predictions with * a default axis, {@link #DEFAULT_AXIS} * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public CosineSimilarity(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_AXIS, seed, type); + public CosineSimilarity(String name, long seed, Class type) { + this(name, DEFAULT_AXIS, seed, type); } /** * Creates a metric that computes the cosine similarity metric between labels and predictions. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param axis The dimension along which the cosine similarity is computed. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public CosineSimilarity(Ops tf, String name, int axis, long seed, Class type) { - this(tf, name, new int[] {axis}, seed, type); + public CosineSimilarity(String name, int axis, long seed, Class type) { + this(name, new int[] {axis}, seed, type); } /** * Creates a CosineSimilarity metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param axis The dimension along which the cosine similarity is computed. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public CosineSimilarity(Ops tf, String name, int[] axis, long seed, Class type) { - super(tf, name, seed, type); + public CosineSimilarity(String name, int[] axis, long seed, Class type) { + super(name, seed, type); this.axis = axis; setLoss(this); } @@ -89,17 +123,24 @@ public CosineSimilarity(Ops tf, String name, int[] axis, long seed, Class typ /** * Computes the cosine similarity loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return the cosine similarity loss */ @Override - public Operand call( - Operand labels, Operand predictions) { + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); // NOTE: metrics.CosineSimilarity is Losses.cosineSimilarity, // while losses.CosineSimilarity is the negative of Losses.cosineSimilarity - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.cosineSimilarity(getTF(), tLabels, tPredictions, axis); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.cosineSimilarity(tf, tLabels, tPredictions, axis); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalseNegatives.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalseNegatives.java index 9f957ee6c17..6f121fd307f 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalseNegatives.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalseNegatives.java @@ -16,7 +16,6 @@ import org.tensorflow.framework.metrics.impl.ConfusionMatrixConditionCount; import org.tensorflow.framework.metrics.impl.ConfusionMatrixEnum; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -37,19 +36,17 @@ public class FalseNegatives extends ConfusionMatrixConditionC * Creates a FalseNegatives metric, using {@link Class#getSimpleName()} for the metric name and a * default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, long seed, Class type) { - this(tf, null, DEFAULT_THRESHOLD, seed, type); + public FalseNegatives(long seed, Class type) { + this(null, DEFAULT_THRESHOLD, seed, type); } /** * Creates a FalseNegatives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -58,14 +55,13 @@ public FalseNegatives(Ops tf, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, float threshold, long seed, Class type) { - this(tf, null, new float[] {threshold}, seed, type); + public FalseNegatives(float threshold, long seed, Class type) { + this(null, new float[] {threshold}, seed, type); } /** * Creates a FalseNegatives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -74,27 +70,25 @@ public FalseNegatives(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, seed, type); + public FalseNegatives(float[] thresholds, long seed, Class type) { + this(null, thresholds, seed, type); } /** * Creates a FalseNegatives metric, using a default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_THRESHOLD, seed, type); + public FalseNegatives(String name, long seed, Class type) { + this(name, DEFAULT_THRESHOLD, seed, type); } /** * Creates a FalseNegatives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -104,14 +98,13 @@ public FalseNegatives(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, new float[] {threshold}, seed, type); + public FalseNegatives(String name, float threshold, long seed, Class type) { + this(name, new float[] {threshold}, seed, type); } /** * Creates a FalseNegatives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -121,7 +114,7 @@ public FalseNegatives(Ops tf, String name, float threshold, long seed, Class * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalseNegatives(Ops tf, String name, float[] thresholds, long seed, Class type) { - super(tf, name, ConfusionMatrixEnum.FALSE_NEGATIVES, thresholds, seed, type); + public FalseNegatives(String name, float[] thresholds, long seed, Class type) { + super(name, ConfusionMatrixEnum.FALSE_NEGATIVES, thresholds, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalsePositives.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalsePositives.java index a3d585dea0f..a072c53fced 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalsePositives.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/FalsePositives.java @@ -16,7 +16,6 @@ import org.tensorflow.framework.metrics.impl.ConfusionMatrixConditionCount; import org.tensorflow.framework.metrics.impl.ConfusionMatrixEnum; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -37,19 +36,17 @@ public class FalsePositives extends ConfusionMatrixConditionC * Creates a FalsePositives metric, using {@link Class#getSimpleName()} for the metric name and a * default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, long seed, Class type) { - this(tf, null, DEFAULT_THRESHOLD, seed, type); + public FalsePositives(long seed, Class type) { + this(null, DEFAULT_THRESHOLD, seed, type); } /** * Creates a FalsePositives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -58,14 +55,13 @@ public FalsePositives(Ops tf, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, float threshold, long seed, Class type) { - this(tf, null, new float[] {threshold}, seed, type); + public FalsePositives(float threshold, long seed, Class type) { + this(null, new float[] {threshold}, seed, type); } /** * Creates a FalsePositives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -74,27 +70,25 @@ public FalsePositives(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, seed, type); + public FalsePositives(float[] thresholds, long seed, Class type) { + this(null, thresholds, seed, type); } /** * Creates a FalsePositives metric, using a default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_THRESHOLD, seed, type); + public FalsePositives(String name, long seed, Class type) { + this(name, DEFAULT_THRESHOLD, seed, type); } /** * Creates a FalsePositives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -104,14 +98,13 @@ public FalsePositives(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, new float[] {threshold}, seed, type); + public FalsePositives(String name, float threshold, long seed, Class type) { + this(name, new float[] {threshold}, seed, type); } /** * Creates a FalsePositives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -121,7 +114,7 @@ public FalsePositives(Ops tf, String name, float threshold, long seed, Class * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public FalsePositives(Ops tf, String name, float[] thresholds, long seed, Class type) { - super(tf, name, ConfusionMatrixEnum.FALSE_POSITIVES, thresholds, seed, type); + public FalsePositives(String name, float[] thresholds, long seed, Class type) { + super(name, ConfusionMatrixEnum.FALSE_POSITIVES, thresholds, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Hinge.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Hinge.java index a2d110867b8..7ce3622099a 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Hinge.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Hinge.java @@ -14,48 +14,65 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the hinge loss metric between labels and predictions. * * @param The data type for the metric result. */ -public class Hinge extends MeanMetricWrapper implements LossMetric { +public class Hinge extends MeanBaseMetricWrapper implements LossMetric { + /** + * Creates a Hinge metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public Hinge(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Hinge metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public Hinge(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public Hinge(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the hinge loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return the hinge loss between labels and predictions. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.hinge(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.hinge(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/KLDivergence.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/KLDivergence.java index 155a891ccc2..b97a0a4355e 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/KLDivergence.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/KLDivergence.java @@ -14,34 +14,44 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the Kullback-Leibler divergence loss metric between labels and * predictions. * * @param The data type for the metric result. */ -public class KLDivergence extends MeanMetricWrapper implements LossMetric { +public class KLDivergence extends MeanBaseMetricWrapper + implements LossMetric { + /** + * Creates a KLDivergence metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public KLDivergence(long seed, Class type) { + this(null, seed, type); + } /** * Creates a KLDivergence metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public KLDivergence(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public KLDivergence(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } @@ -53,10 +63,14 @@ public KLDivergence(Ops tf, String name, long seed, Class type) { * @return the loss with shape {@code [batch_size, d0, .. dN-1]} */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.kullbackLeiblerDivergence(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.kullbackLeiblerDivergence(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/LogCoshError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/LogCoshError.java index 786847d4b32..79e5e99d3c5 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/LogCoshError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/LogCoshError.java @@ -14,49 +14,67 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the logarithm of the hyperbolic cosine of the prediction error metric * between labels and predictions. * * @param The data type for the metric result. */ -public class LogCoshError extends MeanMetricWrapper implements LossMetric { +public class LogCoshError extends MeanBaseMetricWrapper + implements LossMetric { + /** + * Creates a LogCoshError metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public LogCoshError(long seed, Class type) { + this(null, seed, type); + } /** * Creates a LogCoshError metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public LogCoshError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public LogCoshError(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Calculates the Logarithm of the hyperbolic cosine of the prediction error. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels Ground truth values, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. - * @return Logcosh error values, shape = {@code [batch_size, d0, .. dN-1]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. + * @return the Logcosh error values, shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.logCosh(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.logCosh(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Mean.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Mean.java index 8902b329bcc..2fa85de9c10 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Mean.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Mean.java @@ -15,7 +15,6 @@ package org.tensorflow.framework.metrics; import org.tensorflow.framework.metrics.impl.Reduce; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -24,17 +23,27 @@ * @param The data type for the metric result */ public class Mean extends Reduce { + /** + * Creates a Reducible Metric with a metric reductions of {@link MetricReduction#SUM} and using + * {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public Mean(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Reducible Metric with a metric reductions of {@link MetricReduction#SUM} * - * @param tf the TensorFlow Ops * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected Mean(Ops tf, String name, long seed, Class type) { - super(tf, name, MetricReduction.WEIGHTED_MEAN, seed, type); + public Mean(String name, long seed, Class type) { + super(name, MetricReduction.WEIGHTED_MEAN, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsoluteError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsoluteError.java index b38d0a809e1..2fe18c132b6 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsoluteError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsoluteError.java @@ -14,49 +14,66 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the mean of absolute difference between labels and predictions. * * @param The data type for the metric result. */ -public class MeanAbsoluteError extends MeanMetricWrapper - implements LossMetric { +public class MeanAbsoluteError extends MeanBaseMetricWrapper + implements LossMetric { + /** + * Creates a Mean Absolute Error metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public MeanAbsoluteError(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Mean Absolute Error metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public MeanAbsoluteError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public MeanAbsoluteError(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the mean absolute error loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Mean absolute error values, shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.meanAbsoluteError(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.meanAbsoluteError(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageError.java index 22bcd0ab0eb..bd777057210 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageError.java @@ -14,49 +14,67 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the mean of absolute difference between labels and predictions. * * @param The data type for the metric result. */ -public class MeanAbsolutePercentageError extends MeanMetricWrapper - implements LossMetric { +public class MeanAbsolutePercentageError extends MeanBaseMetricWrapper + implements LossMetric { + + /** + * Creates a Mean Absolute Error metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public MeanAbsolutePercentageError(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Mean Absolute Error metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public MeanAbsolutePercentageError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public MeanAbsolutePercentageError(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the mean absolute percentage error loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Mean absolute percentage error values, shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.meanAbsolutePercentageError(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.meanAbsolutePercentageError(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanIoU.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanIoU.java index 6495379c4c4..fba4c5e00cc 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanIoU.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanIoU.java @@ -19,6 +19,7 @@ import java.util.Collections; import java.util.List; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.initializers.Zeros; import org.tensorflow.framework.metrics.impl.MetricsHelper; @@ -43,99 +44,94 @@ * * @param The data type for the metric result */ -public class MeanIoU extends Metric { +public class MeanIoU extends BaseMetric { public static final String TOTAL_CONFUSION_MATRIX = "TOTAL_CONFUSION_MATRIX"; private final String totalCMName; private final Class type; + + private final Zeros zeros = new Zeros<>(); /** * The possible number of labels the prediction task can have. This value must be provided, since * a confusion matrix of dimension = [numClasses, numClasses] will be allocated. */ private final long numClasses; - private Variable totalConfusionMatrix; + private final Shape variableShape; private Assign initializer; + private Variable totalConfusionMatrix; /** * Creates a metric MeanIoU, using name as {@link Class#getSimpleName()} * - * @param tf the TensorFlow Ops * @param numClasses The possible number of labels the prediction task can have * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - protected MeanIoU(Ops tf, long numClasses, long seed, Class type) { - this(tf, null, numClasses, seed, type); + protected MeanIoU(long numClasses, long seed, Class type) { + this(null, numClasses, seed, type); } /** * Creates a MeanIoU metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param numClasses The possible number of labels the prediction task can have * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - protected MeanIoU(Ops tf, String name, long numClasses, long seed, Class type) { - super(tf, name, seed); + protected MeanIoU(String name, long numClasses, long seed, Class type) { + super(name, seed); this.type = type; this.totalCMName = this.getVariableName(TOTAL_CONFUSION_MATRIX); this.numClasses = numClasses; - init(); + variableShape = Shape.of(numClasses, numClasses); } - private void init() { - Shape variableShape = Shape.of(numClasses, numClasses); - - if (totalConfusionMatrix == null) { - Zeros zeros = new Zeros<>(); - totalConfusionMatrix = - getTF() - .withName(totalCMName) - .withInitScope() - .variable(zeros.call(getTF(), getTF().constant(variableShape), type)); - initializer = - getTF() - .assign( - totalConfusionMatrix, zeros.call(getTF(), getTF().constant(variableShape), type)); + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + setTF(tf); + Operand zeroOp = zeros.call(tf, tf.constant(variableShape), type); + totalConfusionMatrix = tf.withName(totalCMName).withInitScope().variable(zeroOp); + initializer = tf.assign(totalConfusionMatrix, zeroOp); + setInitialized(true); } } /** {@inheritDoc} */ @Override - public Op resetStates() { - return initializer; - } - - /** - * Gets the initializer for the totalConfusionMatrix variable - * - * @return the initializer for the totalConfusionMatrix variable - */ - public Assign getInitializer() { - return initializer; + public Op resetStates(Ops tf) { + init(tf); + return tf.withName(totalCMName) + .assign(totalConfusionMatrix, zeros.call(tf, tf.constant(variableShape), type)); } /** * Accumulates the confusion matrix statistics. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the labels * @param predictions the predictions * @param sampleWeights Optional weighting of each example. Defaults to 1, if null. Rank is either * 0, or the same rank as labels, and must be broadcastable to labels. * @return the Operands that updates totalConfusionMatrix variable + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @throws IllegalArgumentException if the weights rank is not 0, and weights rank @{code !=} * labels rank, and if the predictions size is not equal to the labels size */ @Override public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { + init(tf); if (sampleWeights != null) { long weightsRank = sampleWeights.shape().numDimensions(); long labelsRank = labels.shape().numDimensions(); @@ -158,30 +154,30 @@ public List updateStateList( labelsSize, predictionsSize)); } - Operand tLabels = cast(getTF(), labels, type); + Operand tLabels = cast(tf, labels, type); if (tLabels.shape().numDimensions() > 1) { - tLabels = getTF().shape.flatten(tLabels); + tLabels = tf.shape.flatten(tLabels); } - Operand tPredictions = cast(getTF(), predictions, type); + Operand tPredictions = cast(tf, predictions, type); if (tPredictions.shape().numDimensions() > 1) { - tPredictions = getTF().shape.flatten(tPredictions); + tPredictions = tf.shape.flatten(tPredictions); } - Operand tSampleWeights = sampleWeights != null ? cast(getTF(), sampleWeights, type) : null; + Operand tSampleWeights = sampleWeights != null ? cast(tf, sampleWeights, type) : null; if (tSampleWeights != null && tSampleWeights.shape().numDimensions() > 1) { - tSampleWeights = getTF().shape.flatten(tSampleWeights); + tSampleWeights = tf.shape.flatten(tSampleWeights); } // Accumulate the prediction to current confusion matrix. Operand currentCM = MetricsHelper.confusionMatrix( - getTF(), tLabels, tPredictions, getTF().constant(numClasses), tSampleWeights, type); - return Collections.singletonList(getTF().assignAdd(totalConfusionMatrix, currentCM)); + tf, tLabels, tPredictions, tf.constant(numClasses), tSampleWeights, type); + return Collections.singletonList(tf.assignAdd(totalConfusionMatrix, currentCM)); } /** {@inheritDoc} */ @Override - public Operand result() { - Ops tf = getTF(); + public Operand result(Ops tf, Class resultType) { + init(tf); Operand sumOverRow = tf.reduceSum(totalConfusionMatrix, tf.constant(0)); Operand sumOverCol = tf.reduceSum(totalConfusionMatrix, tf.constant(1)); Operand truePositives = @@ -202,6 +198,6 @@ public Operand result() { Operand iou = tf.math.divNoNan(truePositives, denominator); Operand iouSum = tf.reduceSum(iou, allAxes(tf, iou)); - return tf.math.divNoNan(iouSum, numValidEntries); + return cast(tf, tf.math.divNoNan(iouSum, numValidEntries), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanRelativeError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanRelativeError.java index 915d281e44b..50bc52b7d2f 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanRelativeError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanRelativeError.java @@ -17,6 +17,7 @@ import static org.tensorflow.framework.utils.CastHelper.cast; import java.util.List; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.impl.LossTuple; import org.tensorflow.framework.losses.impl.LossesHelper; @@ -38,115 +39,134 @@ */ public class MeanRelativeError extends Mean { private Operand normalizer; + private float[] normalizerFloat; + private double[] normalizerDouble; /** * Creates a MeanRelativeError metric using {@link Class#getSimpleName()} as the name * - * @param tf the TensorFlow Ops * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError(Ops tf, float[] normalizer, long seed, Class type) { - this(tf, null, cast(tf, tf.constant(normalizer), type), seed, type); + protected MeanRelativeError(float[] normalizer, long seed, Class type) { + this(null, normalizer, seed, type); } /** * Creates a MeanRelativeError metric * - * @param tf the TensorFlow Ops * @param name the name of the metric. If null, name defaults to {@link Class#getSimpleName()}. * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError(Ops tf, String name, float[] normalizer, long seed, Class type) { - this(tf, name, cast(tf, tf.constant(normalizer), type), seed, type); + protected MeanRelativeError(String name, float[] normalizer, long seed, Class type) { + super(name, seed, type); + this.normalizerFloat = normalizer; } /** * Creates a MeanRelativeError metric using {@link Class#getSimpleName()} as the name * - * @param tf the TensorFlow Ops * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError(Ops tf, double[] normalizer, long seed, Class type) { - this(tf, null, cast(tf, tf.constant(normalizer), type), seed, type); + protected MeanRelativeError(double[] normalizer, long seed, Class type) { + this(null, normalizer, seed, type); } /** * Creates a MeanRelativeError metric * - * @param tf the TensorFlow Ops * @param name the name of the metric. If null, name defaults to {@link Class#getSimpleName()}. * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError(Ops tf, String name, double[] normalizer, long seed, Class type) { - this(tf, name, cast(tf, tf.constant(normalizer), type), seed, type); + protected MeanRelativeError(String name, double[] normalizer, long seed, Class type) { + super(name, seed, type); + this.normalizerDouble = normalizer; } /** * Creates a MeanRelativeError metric using {@link Class#getSimpleName()} as the name * - * @param tf the TensorFlow Ops * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError(Ops tf, Operand normalizer, long seed, Class type) { - this(tf, null, normalizer, seed, type); + protected MeanRelativeError(Operand normalizer, long seed, Class type) { + this(null, normalizer, seed, type); } /** * Creates a MeanRelativeError metric * - * @param tf the TensorFlow ops * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. * @param normalizer The normalizer values with same shape as predictions. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - protected MeanRelativeError( - Ops tf, String name, Operand normalizer, long seed, Class type) { - super(tf, name, seed, type); + protected MeanRelativeError(String name, Operand normalizer, long seed, Class type) { + super(name, seed, type); this.normalizer = normalizer; } + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + super.init(tf); + if (normalizer == null) { + if (normalizerDouble.length > 0) { + normalizer = cast(tf, tf.constant(normalizerDouble), getInternalType()); + } else if (normalizerFloat.length > 0) { + normalizer = cast(tf, tf.constant(normalizerFloat), getInternalType()); + } + } + setInitialized(true); + } + } + /** * Accumulates metric statistics. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels The ground truth values. * @param predictions The predicted values. Must be the same shape as the normalizer. * @param sampleWeights Optional weighting of each example. A null value defaults to 1. Can be an * {@code Operand} whose rank is either 0, or the same rank as {@code labels}, and must be * broadcastable to {@code labels}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return a List of Operations to update the metric state */ @Override public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); Operand tSampleWeights = - sampleWeights != null ? cast(getTF(), sampleWeights, getResultType()) : null; + sampleWeights != null ? cast(tf, sampleWeights, getInternalType()) : null; - LossTuple tuple = LossesHelper.squeezeOrExpandDimensions(getTF(), tLabels, tPredictions); + LossTuple tuple = LossesHelper.squeezeOrExpandDimensions(tf, tLabels, tPredictions); tPredictions = tuple.getTarget(); tLabels = tuple.getLabels(); - tuple = LossesHelper.removeSqueezableDimensions(getTF(), normalizer, tPredictions); + tuple = LossesHelper.removeSqueezableDimensions(tf, normalizer, tPredictions); normalizer = tuple.getLabels(); tPredictions = tuple.getTarget(); @@ -157,12 +177,9 @@ public List updateStateList( tPredictions.shape(), tLabels.shape())); Operand relativeErrors = - getTF() - .math - .divNoNan( - getTF().math.abs(getTF().math.sub(tLabels, tPredictions)), this.getNormalizer()); + tf.math.divNoNan(tf.math.abs(tf.math.sub(tLabels, tPredictions)), this.getNormalizer()); - return super.updateStateList(relativeErrors, tSampleWeights); + return super.updateStateList(tf, relativeErrors, tSampleWeights); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredError.java index fd8be29875e..d3f5bea03bb 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredError.java @@ -14,15 +14,16 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the mean of absolute difference between labels and predictions. * @@ -41,35 +42,52 @@ * * @param The data type for the metric result. */ -public class MeanSquaredError extends MeanMetricWrapper - implements LossMetric { +public class MeanSquaredError extends MeanBaseMetricWrapper + implements LossMetric { + + /** + * Creates a Mean Absolute Error metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public MeanSquaredError(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Mean Absolute Error metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public MeanSquaredError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public MeanSquaredError(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the mean squared error between the labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels. Must be the same shape as predictions. * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Computes the mean squared error between the labels and predictions. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.meanSquaredError(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.meanSquaredError(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicError.java index 4728cbab12f..34512ef1c34 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicError.java @@ -14,49 +14,67 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the mean of absolute difference between labels and predictions. * * @param The data type for the metric result. */ -public class MeanSquaredLogarithmicError extends MeanMetricWrapper - implements LossMetric { +public class MeanSquaredLogarithmicError extends MeanBaseMetricWrapper + implements LossMetric { + + /** + * Creates a Mean Absolute Error metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public MeanSquaredLogarithmicError(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Mean Absolute Error metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public MeanSquaredLogarithmicError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public MeanSquaredLogarithmicError(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the mean squared logarithmic error between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Mean squared logarithmic error values, shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.meanSquaredLogarithmicError(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.meanSquaredLogarithmicError(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanTensor.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanTensor.java index fa86125dbe7..b98dac5a328 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanTensor.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/MeanTensor.java @@ -35,7 +35,7 @@ * * @param The data type for the metric result */ -public class MeanTensor extends Metric { +public class MeanTensor extends BaseMetric { public static final String TOTAL = "total"; public static final String COUNT = "count"; private final String totalName; @@ -46,59 +46,50 @@ public class MeanTensor extends Metric { private Variable count; private Assign totalInitializer; private Assign countInitializer; - private boolean initialized; /** * Creates a MeanTensor metric, using {@link Class#getSimpleName()} as the name * - * @param tf the TensorFlow ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public MeanTensor(Ops tf, long seed, Class type) { - this(tf, null, seed, type); + public MeanTensor(long seed, Class type) { + this(null, seed, type); } /** * Creates a MeanTensor metric * - * @param tf the TensorFlow ops * @param name the name of this metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public MeanTensor(Ops tf, String name, long seed, Class type) { - super(tf, name, seed); + public MeanTensor(String name, long seed, Class type) { + super(name, seed); this.type = type; this.totalName = this.getVariableName(TOTAL); this.countName = this.getVariableName(COUNT); } - /** - * Creates the Operations that initialize the total and count variables. - * - * @param shape the shape of the variables - * @return true if the variables need initialization, otherwise false; - */ - private boolean init(Shape shape) { - if (!initialized) { - this.shape = shape; + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized() && shape != null) { + setTF(tf); Zeros zeros = new Zeros<>(); - Operand zero = zeros.call(getTF(), getTF().constant(shape), type); + Operand zero = zeros.call(tf, tf.constant(shape), type); if (total == null) { - total = getTF().withName(totalName).withInitScope().variable(zero); - totalInitializer = getTF().assign(total, zero); + total = tf.withName(totalName).withInitScope().variable(zero); + totalInitializer = tf.assign(total, zero); } if (count == null) { - count = getTF().withName(countName).withInitScope().variable(zero); - countInitializer = getTF().assign(count, zero); + count = tf.withName(countName).withInitScope().variable(zero); + countInitializer = tf.assign(count, zero); } - this.initialized = true; - return true; - } else { - return false; + setInitialized(true); } } @@ -113,19 +104,19 @@ private boolean init(Shape shape) { */ @Override public List updateStateList( - Operand values, Operand sampleWeights) { - Ops tf = getTF(); + Ops tf, Operand values, Operand sampleWeights) { + if (shape == null) { + shape = values.shape(); + } + init(tf); Operand tValues = cast(tf, values, type); Operand tSampleWeights = sampleWeights == null ? null : cast(tf, sampleWeights, type); - // update the shape if it is the first call. - boolean needsInitialization = init(values.shape()); - - if (!this.shape.equals(values.shape())) { + if (!shape.equals(values.shape())) { throw new IllegalArgumentException( String.format( "MeanTensor input values must always have the same shape. Expected shape (set during the first call): %s. Got %s", - this.shape.toString(), values.shape().toString())); + shape.toString(), values.shape().toString())); } Operand numValues = tf.onesLike(tValues); @@ -153,12 +144,7 @@ public List updateStateList( tValues = tf.math.mul(tValues, tSampleWeights); } - List controlOpsPre = new ArrayList<>(); - if (needsInitialization) { - controlOpsPre.add(countInitializer); - controlOpsPre.add(totalInitializer); - } - Ops tf1 = tf.withSubScope("variables").withControlDependencies(controlOpsPre); + Ops tf1 = tf.withSubScope("MeanTensor.variables"); List controlOps = new ArrayList<>(); controlOps.add(tf1.assignAdd(this.count, numValues)); @@ -168,30 +154,40 @@ public List updateStateList( /** {@inheritDoc} */ @Override - public Operand result() { - if (!this.initialized) { - throw new IllegalStateException( - "MeanTensor does not have any result yet. Please use `.update_state(value)` before retrieving the result."); + public Operand result(Ops tf, Class resultType) { + init(tf); + if (!isInitialized()) { + return cast(tf, tf.constant(0), resultType); + } else { + return cast(tf, tf.math.divNoNan(total, count), resultType); } - return getTF().math.divNoNan(total, count); } - /** @return the total */ + /** + * @return the total + */ public Variable getTotal() { return total; } - /** @return the count */ + /** + * @return the count + */ public Variable getCount() { return count; } /** {@inheritDoc} */ @Override - public Op resetStates() { - List controlOpsPre = new ArrayList<>(); - controlOpsPre.add(countInitializer); - controlOpsPre.add(totalInitializer); - return getTF().withSubScope("resetStates").withControlDependencies(controlOpsPre).noOp(); + public Op resetStates(Ops tf) { + init(tf); + if (!isInitialized()) { + return tf.withSubScope("resetStates").noOp(); + } else { + List controlOpsPre = new ArrayList<>(); + controlOpsPre.add(countInitializer); + controlOpsPre.add(totalInitializer); + return tf.withSubScope("resetStates").withControlDependencies(controlOpsPre).noOp(); + } } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metric.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metric.java index 468919e696d..c2982e9b0b0 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metric.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metric.java @@ -1,4 +1,4 @@ -/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2021 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. @@ -14,182 +14,109 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import java.util.List; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import java.util.Collections; -import java.util.List; - -/** - * Base class for Metrics - * - * @param The data type for the metric result - */ -public abstract class Metric { - - /** The TensorFlow Ops */ - private final Ops tf; - - /** The seed for random number generation */ - private final long seed; - - /** The name for this metric. Defaults to {@link Class#getSimpleName()}. */ - private final String name; - - /** - * Creates a Metric with a name of {@link Class#getSimpleName()} - * - * @param tf the TensorFlow Ops - * @param seed the seed for random number generation. An initializer created with a given seed - * will always produce the same random tensor for a given shape and data type. - */ - protected Metric(Ops tf, long seed) { - this(tf, null, seed); - } - - /** - * Creates a Metric - * - * @param tf the TensorFlow Ops - * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. - * @param seed the seed for random number generation. An initializer created with a given seed - * will always produce the same random tensor for a given shape and data type. - */ - protected Metric(Ops tf, String name, long seed) { - if (!tf.scope().env().isGraph()) { - throw new IllegalArgumentException("Metrics are required to execute in Graph mode."); - } - this.seed = seed; - this.name = name != null ? name : this.getClass().getSimpleName(); - this.tf = tf.withName(this.getClass().getSimpleName()); - } +/** Interface for metrics */ +public interface Metric { /** * Creates a List of Operations to update the metric state based on input values. * - *

    This is an empty implementation that should be overridden in a subclass, if needed. - * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. encapsulating a {@link + * Graph} environment. * @param values the inputs to be passed to update state, this may not be null * @param sampleWeights sample weights to be applied to values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. * @return a List of Operations to update the metric state */ - @SuppressWarnings({"unchecked", "unused"}) - public List updateStateList( - Operand values, Operand sampleWeights) { - return Collections.EMPTY_LIST; - } + List updateStateList( + Ops tf, Operand values, Operand sampleWeights); /** * Creates a List of Operations to update the metric state based on labels and predictions. * *

    This is an empty implementation that should be overridden in a sub class, if needed. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the labels * @param predictions the predictions * @param sampleWeights sample weights to be applied to values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. * @return a List of Operations to update the metric state */ - @SuppressWarnings({"unchecked", "unused"}) - public List updateStateList( + List updateStateList( + Ops tf, Operand labels, Operand predictions, - Operand sampleWeights) { - return Collections.EMPTY_LIST; - } + Operand sampleWeights); + + /** + * Gets the current result of the metric + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @param type the data type for the result + * @param the date type for the result + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return the result, possibly with control dependencies + */ + Operand result(Ops tf, Class type); + + /** + * Resets any state variables to their initial values + * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. + * @return the operation for doing the reset + */ + Op resetStates(Ops tf); /** * Creates a NoOp Operation with control dependencies to update the metric state * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param values the inputs to be passed to update state, this may not be null * @param sampleWeights sample weights to be applied to values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. * @return the Operation to update the metric state */ - public final Op updateState( - Operand values, Operand sampleWeights) { - List controlOps = updateStateList(values, sampleWeights); - return tf.withSubScope("updateState").withControlDependencies(controlOps).noOp(); - } + Op updateState( + Ops tf, Operand values, Operand sampleWeights); /** * Creates a NoOp Operation with control dependencies to update the metric state * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the labels * @param predictions the predictions * @param sampleWeights sample weights to be applied to values, may be null. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. * @return the Operation to update the metric state */ - public final Op updateState( + Op updateState( + Ops tf, Operand labels, Operand predictions, - Operand sampleWeights) { - List controlOps = updateStateList(labels, predictions, sampleWeights); - return tf.withSubScope("updateState").withControlDependencies(controlOps).noOp(); - } - - /** - * Gets the current result of the metric - * - * @return the result, possibly with control dependencies - */ - public abstract Operand result(); - - /** - * Resets any state variables to their initial values - * - * @return the control operation for doing the reset - */ - public abstract Op resetStates(); + Operand sampleWeights); /** * Calls update state once, followed by a call to get the result * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param values the inputs to be passed to update state, this may not be null * @param sampleWeights sample weights to be applied to values, may be null. + * @param type the data type for the result + * @param the date type for the result + * @throws IllegalArgumentException if the TensorFlow Ops scope does not have a Graph environment. * @return the result, possibly with control dependencies */ - public final Operand callOnce( - Operand values, Operand sampleWeights) { - List controlOps = updateStateList(values, sampleWeights); - Ops ltf = tf.withSubScope("callOnce").withControlDependencies(controlOps); - return ltf.identity(result()); - } - - /** - * Gets a formatted name for a variable, in the form {@link #name} + "_" + varName. - * - * @param varName the base name for the variable - * @return the formatted variable name - */ - protected String getVariableName(String varName) { - return String.format("%s_%s", this.name, varName); - } - - /** - * Gets the TensorFlow Ops - * - * @return the TensorFlow Ops - */ - public Ops getTF() { - return tf; - } - - /** - * Gets the name of this metric. - * - * @return the name of this metric - */ - public String getName() { - return name; - } - - /** - * Gets the random number generator seed value - * - * @return the random number generator seed value - */ - public long getSeed() { - return seed; - } + Operand callOnce( + Ops tf, + Operand values, + Operand sampleWeights, + Class type); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metrics.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metrics.java index a33750ac3f6..beb86ee5c0f 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metrics.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Metrics.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; @@ -21,8 +24,6 @@ import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** Static methods for computing metrics. */ public class Metrics { @@ -41,10 +42,12 @@ public class Metrics { * //m.shape().toString == "[2]" *

    * - * @param tf the TensorFlow Ops. + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment.. * @param labels the ground truth values. * @param predictions The prediction values. * @param k Number of top elements to look at for computing accuracy. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @param the data type for the predictions and results * @return the Operand for the Top K categorical accuracy value. */ @@ -71,15 +74,16 @@ public static Operand topKCategoricalAccuracy( * //m.shape().toString == "[2]" *
    * - * @param tf the TensorFlow Ops. + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment.. * @param labels the ground truth values. * @param predictions The prediction values. * @param k Number of top elements to look at for computing accuracy. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @param the data type for the predictions and results * @param the data type ofr the labels. * @return the Operand for the Sparse top K categorical accuracy value. */ - @SuppressWarnings("unchecked") public static Operand sparseTopKCategoricalAccuracy( Ops tf, Operand labels, Operand predictions, int k) { Operand tLabels = cast(tf, labels, predictions.type()); diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Poisson.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Poisson.java index 2e4bde8ec55..706eb4fc385 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Poisson.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Poisson.java @@ -14,48 +14,66 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the poisson loss metric between labels and predictions. * * @param The data type for the metric result. */ -public class Poisson extends MeanMetricWrapper implements LossMetric { +public class Poisson extends MeanBaseMetricWrapper implements LossMetric { + + /** + * Creates a Poisson metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public Poisson(long seed, Class type) { + this(null, seed, type); + } /** * Creates a Poisson metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public Poisson(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public Poisson(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the Poisson loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels, shape = {@code [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Poisson loss value, shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.poisson(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, resultType); + Operand tPredictions = cast(tf, predictions, resultType); + return Losses.poisson(tf, tLabels, tPredictions); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Precision.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Precision.java index d81030ebedb..c1df3ac952e 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Precision.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Precision.java @@ -17,7 +17,6 @@ import static org.tensorflow.framework.utils.CastHelper.cast; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -54,7 +53,7 @@ * * @param The data type for the metric result */ -public class Precision extends Metric { +public class Precision extends BaseMetric { public static final String TRUE_POSITIVES = "TRUE_POSITIVES"; public static final String FALSE_POSITIVES = "FALSE_POSITIVES"; public static final float DEFAULT_THRESHOLD = 0.5f; @@ -66,6 +65,7 @@ public class Precision extends Metric { private final String falsePositivesName; private final Class type; private final List initializers = new ArrayList<>(); + private final Zeros zeros = new Zeros<>(); private Variable truePositives; private Variable falsePositives; @@ -73,35 +73,32 @@ public class Precision extends Metric { * Creates a Precision Metric with a name of {@link Class#getSimpleName()} and no topK or classId * values and with a threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, long seed, Class type) { - this(tf, null, null, null, null, seed, type); + public Precision(long seed, Class type) { + this(null, null, null, null, seed, type); } /** * Creates a Precision Metric with no topK or classId values with a threshold of {@link * #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, String name, long seed, Class type) { - this(tf, name, null, null, null, seed, type); + public Precision(String name, long seed, Class type) { + this(name, null, null, null, seed, type); } /** * Creates a Precision Metric with a name of {@link Class#getSimpleName()} and no topK or classId * values. * - * @param tf the TensorFlow Ops * @param threshold Optional threshold value in the range {@code [0, 1]}. A threshold is compared * with prediction values to determine the truth value of predictions (i.e., above the * threshold is true, below is false). One metric value is generated for each threshold value. @@ -109,15 +106,14 @@ public Precision(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, float threshold, long seed, Class type) { - this(tf, null, new float[] {threshold}, null, null, seed, type); + public Precision(float threshold, long seed, Class type) { + this(null, new float[] {threshold}, null, null, seed, type); } /** * Creates a Precision Metric with a name of {@link Class#getSimpleName()} and no topK or classId * values. * - * @param tf the TensorFlow Ops * @param thresholds Optional threshold values in the range {@code [0, 1]}. A threshold is * compared with prediction values to determine the truth value of predictions (i.e., above * the threshold is true, below is false). One metric value is generated for each threshold @@ -126,14 +122,13 @@ public Precision(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, null, null, seed, type); + public Precision(float[] thresholds, long seed, Class type) { + this(null, thresholds, null, null, seed, type); } /** * Creates a Precision Metric with no topK or classId values. * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param threshold Optional threshold value in the range {@code [0, 1]}. A threshold is compared @@ -143,14 +138,13 @@ public Precision(Ops tf, float[] thresholds, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, new float[] {threshold}, null, null, seed, type); + public Precision(String name, float threshold, long seed, Class type) { + this(name, new float[] {threshold}, null, null, seed, type); } /** * Creates a Precision Metric with no topK or classId values. * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param thresholds Optional threshold values in the range {@code [0, 1]}. A threshold is @@ -161,14 +155,13 @@ public Precision(Ops tf, String name, float threshold, long seed, Class type) * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision(Ops tf, String name, float[] thresholds, long seed, Class type) { - this(tf, name, thresholds, null, null, seed, type); + public Precision(String name, float[] thresholds, long seed, Class type) { + this(name, thresholds, null, null, seed, type); } /** * Creates a Precision Metric with a name of {@link Class#getSimpleName()} * - * @param tf the TensorFlow Ops * @param threshold Optional threshold value in the range {@code [0, 1]}. A threshold is compared * with prediction values to determine the truth value of predictions (i.e., above the * threshold is true, below is false). One metric value is generated for each threshold value. @@ -180,15 +173,13 @@ public Precision(Ops tf, String name, float[] thresholds, long seed, Class ty * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision( - Ops tf, float threshold, Integer topK, Integer classId, long seed, Class type) { - this(tf, null, new float[] {threshold}, topK, classId, seed, type); + public Precision(float threshold, Integer topK, Integer classId, long seed, Class type) { + this(null, new float[] {threshold}, topK, classId, seed, type); } /** * Creates a Precision Metric with a name of {@link Class#getSimpleName()} * - * @param tf the TensorFlow Ops * @param thresholds Optional threshold values in the range {@code [0, 1]}. A threshold is * compared with prediction values to determine the truth value of predictions (i.e., above * the threshold is true, below is false). One metric value is generated for each threshold @@ -201,15 +192,13 @@ public Precision( * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Precision( - Ops tf, float[] thresholds, Integer topK, Integer classId, long seed, Class type) { - this(tf, null, thresholds, topK, classId, seed, type); + public Precision(float[] thresholds, Integer topK, Integer classId, long seed, Class type) { + this(null, thresholds, topK, classId, seed, type); } /** * Creates a Precision Metric. * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param threshold Optional threshold value in the range {@code [0, 1]}. A threshold is compared @@ -224,20 +213,13 @@ public Precision( * @param type the data type for the variables */ public Precision( - Ops tf, - String name, - float threshold, - Integer topK, - Integer classId, - long seed, - Class type) { - this(tf, name, new float[] {threshold}, topK, classId, seed, type); + String name, float threshold, Integer topK, Integer classId, long seed, Class type) { + this(name, new float[] {threshold}, topK, classId, seed, type); } /** * Creates a Precision Metric. * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param thresholds Optional threshold values in the range {@code [0, 1]}. A threshold is @@ -253,14 +235,8 @@ public Precision( * @param type the data type for the variables */ public Precision( - Ops tf, - String name, - float[] thresholds, - Integer topK, - Integer classId, - long seed, - Class type) { - super(tf, name, seed); + String name, float[] thresholds, Integer topK, Integer classId, long seed, Class type) { + super(name, seed); this.type = type; this.truePositivesName = this.getVariableName(TRUE_POSITIVES); this.falsePositivesName = this.getVariableName(FALSE_POSITIVES); @@ -268,23 +244,25 @@ public Precision( this.thresholds = thresholds == null ? new float[] {defaultThreshold} : thresholds; this.topK = topK; this.classId = classId; - - init(); } - /** Initializes the variables */ - private void init() { - Ops tf = getTF(); - Zeros zeros = new Zeros<>(); - Operand zero = zeros.call(tf, tf.constant(Shape.of(thresholds.length)), type); - - if (this.truePositives == null) { - this.truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); - initializers.add(tf.assign(truePositives, zero)); - } - if (this.falsePositives == null) { - this.falsePositives = tf.withName(falsePositivesName).withInitScope().variable(zero); - initializers.add(tf.assign(falsePositives, zero)); + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + setTF(tf); + Operand zero = zeros.call(tf, tf.constant(Shape.of(thresholds.length)), type); + + if (this.truePositives == null) { + this.truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); + initializers.add(tf.assign(truePositives, zero)); + } + if (this.falsePositives == null) { + this.falsePositives = tf.withName(falsePositivesName).withInitScope().variable(zero); + initializers.add(tf.assign(falsePositives, zero)); + } + setInitialized(true); } } @@ -299,12 +277,12 @@ private void init() { * @return a List of Operations to update the metric state. */ @Override - @SuppressWarnings("unchecked") public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Ops tf = getTF(); + init(tf); Map> confusionMatrix = new HashMap<>(); confusionMatrix.put(ConfusionMatrixEnum.TRUE_POSITIVES, truePositives); confusionMatrix.put(ConfusionMatrixEnum.FALSE_POSITIVES, falsePositives); @@ -313,11 +291,10 @@ public List updateStateList( Operand tLabels = cast(tf, labels, type); Operand tSampleWeights = sampleWeights != null ? cast(tf, sampleWeights, type) : null; - return new ArrayList( + return new ArrayList<>( MetricsHelper.updateConfusionMatrixVariables( tf, confusionMatrix, - Collections.EMPTY_MAP, tLabels, tPredictions, tf.constant(thresholds), @@ -330,23 +307,27 @@ public List updateStateList( /** {@inheritDoc} */ @Override - public Operand result() { - Ops tf = getTF(); + public Operand result(Ops tf, Class resultType) { + init(tf); Operand result = tf.math.divNoNan(truePositives, tf.math.add(truePositives, falsePositives)); - return thresholds.length == 1 - ? tf.reshape( - tf.slice( - result, - tf.expandDims(tf.constant(0), tf.constant(0)), - tf.expandDims(tf.constant(1), tf.constant(0))), - tf.constant(Shape.scalar())) - : result; + return cast( + tf, + thresholds.length == 1 + ? tf.reshape( + tf.slice( + result, + tf.expandDims(tf.constant(0), tf.constant(0)), + tf.expandDims(tf.constant(1), tf.constant(0))), + tf.constant(Shape.scalar())) + : result, + resultType); } /** {@inheritDoc} */ @Override - public Op resetStates() { - return getTF().withSubScope("resetStates").withControlDependencies(initializers).noOp(); + public Op resetStates(Ops tf) { + init(tf); + return tf.withSubScope("resetStates").withControlDependencies(initializers).noOp(); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/PrecisionAtRecall.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/PrecisionAtRecall.java index a5285ff6b2d..f6c2251ddaf 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/PrecisionAtRecall.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/PrecisionAtRecall.java @@ -42,7 +42,6 @@ public class PrecisionAtRecall extends SensitivitySpecificity * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()} and {@link * #DEFAULT_NUM_THRESHOLDS} for the number of thresholds * - * @param tf The TensorFlow Ops * @param recall the recall. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. @@ -50,15 +49,14 @@ public class PrecisionAtRecall extends SensitivitySpecificity * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public PrecisionAtRecall(Ops tf, float recall, long seed, Class type) { - this(tf, null, recall, DEFAULT_NUM_THRESHOLDS, seed, type); + public PrecisionAtRecall(float recall, long seed, Class type) { + this(null, recall, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with {@link #DEFAULT_NUM_THRESHOLDS} for the number of * thresholds * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param recall the recall. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed @@ -67,14 +65,13 @@ public PrecisionAtRecall(Ops tf, float recall, long seed, Class type) { * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public PrecisionAtRecall(Ops tf, String name, float recall, long seed, Class type) { - this(tf, name, recall, DEFAULT_NUM_THRESHOLDS, seed, type); + public PrecisionAtRecall(String name, float recall, long seed, Class type) { + this(name, recall, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()}. * - * @param tf The TensorFlow Ops * @param recall the recall. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given * recall. @@ -84,14 +81,13 @@ public PrecisionAtRecall(Ops tf, String name, float recall, long seed, Class * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public PrecisionAtRecall(Ops tf, float recall, int numThresholds, long seed, Class type) { - this(tf, null, recall, numThresholds, seed, type); + public PrecisionAtRecall(float recall, int numThresholds, long seed, Class type) { + this(null, recall, numThresholds, seed, type); } /** * Creates a PrecisionRecall metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param recall the recall. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given @@ -102,9 +98,8 @@ public PrecisionAtRecall(Ops tf, float recall, int numThresholds, long seed, Cla * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public PrecisionAtRecall( - Ops tf, String name, float recall, int numThresholds, long seed, Class type) { - super(tf, name, numThresholds, seed, type); + public PrecisionAtRecall(String name, float recall, int numThresholds, long seed, Class type) { + super(name, numThresholds, seed, type); if (recall < 0f || recall > 1f) throw new IllegalArgumentException("recall must be in the range [0, 1]."); this.recall = recall; @@ -112,9 +107,8 @@ public PrecisionAtRecall( /** {@inheritDoc} */ @Override - public Operand result() { - Ops tf = getTF(); - + public Operand result(Ops tf, Class resultType) { + init(tf); Operand div = tf.math.divNoNan(truePositives, tf.math.add(truePositives, falseNegatives)); Operand sub = tf.math.sub(div, cast(tf, tf.constant(recall), getType())); Operand minIndex = tf.math.argMin(tf.math.abs(sub), tf.constant(0), TInt32.class); @@ -122,7 +116,7 @@ public Operand result() { Operand trueSlice = tf.slice(truePositives, minIndex, tf.constant(new int[] {1})); Operand falseSlice = tf.slice(falsePositives, minIndex, tf.constant(new int[] {1})); - return tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)); + return cast(tf, tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)), resultType); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Recall.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Recall.java index 7cdd01f0c56..4becc6e8908 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Recall.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Recall.java @@ -17,10 +17,10 @@ import static org.tensorflow.framework.utils.CastHelper.cast; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.initializers.Zeros; import org.tensorflow.framework.metrics.impl.ConfusionMatrixEnum; @@ -52,7 +52,7 @@ * * @param The data type for the metric result */ -public class Recall extends Metric { +public class Recall extends BaseMetric { public static final float DEFAULT_THRESHOLD = 0.5f; public static final String TRUE_POSITIVES = "TRUE_POSITIVES"; public static final String FALSE_NEGATIVES = "FALSE_NEGATIVES"; @@ -71,35 +71,32 @@ public class Recall extends Metric { * Creates a Recall metric with a name of {@link Class#getSimpleName()}, and topK and classId set * to null, and thresholds set to {@link #DEFAULT_THRESHOLD} * - * @param tf The TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, long seed, Class type) { - this(tf, null, null, null, null, seed, type); + public Recall(long seed, Class type) { + this(null, null, null, null, seed, type); } /** * Creates a Recall metric with topK and classId set to null and thresholds set to {@link * #DEFAULT_THRESHOLD}. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, String name, long seed, Class type) { - this(tf, name, null, null, null, seed, type); + public Recall(String name, long seed, Class type) { + this(name, null, null, null, seed, type); } /** * Creates a Recall metric with a name of {@link Class#getSimpleName()}, and topK and classId set * to null. * - * @param tf The TensorFlow Ops * @param threshold A threshold is compared with prediction values to determine the truth value of * predictions (i.e., above the threshold is `true`, below is `false`). If null, defaults to * {@link #DEFAULT_THRESHOLD}. @@ -107,15 +104,14 @@ public Recall(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, float threshold, long seed, Class type) { - this(tf, null, threshold, null, null, seed, type); + public Recall(float threshold, long seed, Class type) { + this(null, threshold, null, null, seed, type); } /** * Creates a Recall metric with a name of {@link Class#getSimpleName()}, and topK and classId set * to null. * - * @param tf The TensorFlow Ops * @param thresholds A threshold is compared with prediction values to determine the truth value * of predictions (i.e., above the threshold is `true`, below is `false`). If null, defaults * to {@link #DEFAULT_THRESHOLD}. @@ -123,14 +119,13 @@ public Recall(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, null, null, seed, type); + public Recall(float[] thresholds, long seed, Class type) { + this(null, thresholds, null, null, seed, type); } /** * Creates a Recall metric with topK and classId set to null. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param threshold A threshold is compared with prediction values to determine the truth value of @@ -140,14 +135,13 @@ public Recall(Ops tf, float[] thresholds, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, threshold, null, null, seed, type); + public Recall(String name, float threshold, long seed, Class type) { + this(name, threshold, null, null, seed, type); } /** * Creates a Recall metric with topK and classId set to null. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param thresholds A threshold is compared with prediction values to determine the truth value @@ -157,15 +151,14 @@ public Recall(Ops tf, String name, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, String name, float[] thresholds, long seed, Class type) { - this(tf, name, thresholds, null, null, seed, type); + public Recall(String name, float[] thresholds, long seed, Class type) { + this(name, thresholds, null, null, seed, type); } /** * Creates a Recall metric with a name of {@link Class#getSimpleName()} and using a threshold * value of {@link #DEFAULT_THRESHOLD}. * - * @param tf The TensorFlow Ops * @param topK An optional value specifying the top-k predictions to consider when calculating * precision. * @param classId Optional Integer class ID for which we want binary metrics. This must be in the @@ -174,14 +167,13 @@ public Recall(Ops tf, String name, float[] thresholds, long seed, Class type) * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, Integer topK, Integer classId, long seed, Class type) { - this(tf, null, null, topK, classId, seed, type); + public Recall(Integer topK, Integer classId, long seed, Class type) { + this(null, null, topK, classId, seed, type); } /** * Creates a Recall metric using a threshold value of {@link #DEFAULT_THRESHOLD}. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param topK An optional value specifying the top-k predictions to consider when calculating @@ -192,14 +184,13 @@ public Recall(Ops tf, Integer topK, Integer classId, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, String name, Integer topK, Integer classId, long seed, Class type) { - this(tf, name, null, topK, classId, seed, type); + public Recall(String name, Integer topK, Integer classId, long seed, Class type) { + this(name, null, topK, classId, seed, type); } /** * Creates a Recall metric with a name of {@link Class#getSimpleName()} * - * @param tf The TensorFlow Ops * @param threshold A threshold is compared with prediction values to determine the truth value of * predictions (i.e., above the threshold is `true`, below is `false`). If null, defaults to * {@link #DEFAULT_THRESHOLD}. @@ -211,14 +202,13 @@ public Recall(Ops tf, String name, Integer topK, Integer classId, long seed, Cla * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall(Ops tf, float threshold, Integer topK, Integer classId, long seed, Class type) { - this(tf, null, new float[] {threshold}, topK, classId, seed, type); + public Recall(float threshold, Integer topK, Integer classId, long seed, Class type) { + this(null, new float[] {threshold}, topK, classId, seed, type); } /** * Creates a Recall metric with a name of {@link Class#getSimpleName()} * - * @param tf The TensorFlow Ops * @param thresholds A threshold is compared with prediction values to determine the truth value * of predictions (i.e., above the threshold is `true`, below is `false`). If null, defaults * to {@link #DEFAULT_THRESHOLD}. @@ -230,15 +220,13 @@ public Recall(Ops tf, float threshold, Integer topK, Integer classId, long seed, * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public Recall( - Ops tf, float[] thresholds, Integer topK, Integer classId, long seed, Class type) { - this(tf, null, thresholds, topK, classId, seed, type); + public Recall(float[] thresholds, Integer topK, Integer classId, long seed, Class type) { + this(null, thresholds, topK, classId, seed, type); } /** * Creates a Recall metric. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param threshold A threshold is compared with prediction values to determine the truth value of @@ -253,20 +241,13 @@ public Recall( * @param type the data type for the variables */ public Recall( - Ops tf, - String name, - float threshold, - Integer topK, - Integer classId, - long seed, - Class type) { - this(tf, name, new float[] {threshold}, topK, classId, seed, type); + String name, float threshold, Integer topK, Integer classId, long seed, Class type) { + this(name, new float[] {threshold}, topK, classId, seed, type); } /** * Creates a Recall metric. * - * @param tf The TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param thresholds A threshold is compared with prediction values to determine the truth value @@ -281,14 +262,8 @@ public Recall( * @param type the data type for the variables */ public Recall( - Ops tf, - String name, - float[] thresholds, - Integer topK, - Integer classId, - long seed, - Class type) { - super(tf, name, seed); + String name, float[] thresholds, Integer topK, Integer classId, long seed, Class type) { + super(name, seed); this.type = type; this.truePositivesName = this.getVariableName(TRUE_POSITIVES); this.falseNegativesName = this.getVariableName(FALSE_NEGATIVES); @@ -297,51 +272,58 @@ public Recall( this.thresholds = thresholds == null ? new float[] {defaultThreshold} : thresholds; this.topK = topK; this.classId = classId; - - init(); } - /** Initializes the Variables */ - private void init() { - Ops tf = getTF(); - Zeros zeros = new Zeros<>(); - Operand zero = zeros.call(tf, tf.constant(Shape.of(this.thresholds.length)), type); - if (truePositives == null) { - - truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); - initializers.add(tf.assign(truePositives, zero)); - } - - if (this.falseNegatives == null) { - - falseNegatives = tf.withName(falseNegativesName).withInitScope().variable(zero); - initializers.add(tf.assign(falseNegatives, zero)); + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + setTF(tf); + Zeros zeros = new Zeros<>(); + Operand zero = zeros.call(tf, tf.constant(Shape.of(this.thresholds.length)), type); + if (truePositives == null) { + + truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); + initializers.add(tf.assign(truePositives, zero)); + } + + if (this.falseNegatives == null) { + + falseNegatives = tf.withName(falseNegativesName).withInitScope().variable(zero); + initializers.add(tf.assign(falseNegatives, zero)); + } + setInitialized(true); } } /** {@inheritDoc} */ @Override - public Op resetStates() { - return getTF().withSubScope("resetStates").withControlDependencies(initializers).noOp(); + public Op resetStates(Ops tf) { + init(tf); + return tf.withSubScope("resetStates").withControlDependencies(initializers).noOp(); } /** * Accumulates true positive and false negative statistics. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. The TensorFlow Ops * @param labels the labels The ground truth values, with the same dimensions as predictions. Will * be cast to {@link TBool}. * @param predictions the predictions, each element must be in the range {@code [0, 1]}. * @param sampleWeights Optional weighting of each example. Defaults to 1. Rank is either 0, or * * the same rank as labels, and must be broadcastable to labels. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return a List of Operations to update the metric state. */ @Override - @SuppressWarnings("unchecked") public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Ops tf = getTF(); + init(tf); Map> confusionMatrix = new HashMap<>(); confusionMatrix.put(ConfusionMatrixEnum.TRUE_POSITIVES, this.truePositives); confusionMatrix.put(ConfusionMatrixEnum.FALSE_NEGATIVES, this.falseNegatives); @@ -353,7 +335,6 @@ public List updateStateList( return MetricsHelper.updateConfusionMatrixVariables( tf, confusionMatrix, - Collections.EMPTY_MAP, tLabels, tPredictions, tf.constant(thresholds), @@ -365,13 +346,16 @@ public List updateStateList( } @Override - public Operand result() { - Ops tf = getTF(); + public Operand result(Ops tf, Class resultType) { + init(tf); Operand result = tf.math.divNoNan(this.truePositives, tf.math.add(this.truePositives, this.falseNegatives)); - return this.thresholds.length == 1 - ? tf.slice(result, tf.constant(new int[] {0}), tf.constant(new int[1])) - : result; + return cast( + tf, + this.thresholds.length == 1 + ? tf.slice(result, tf.constant(new int[] {0}), tf.constant(new int[1])) + : result, + resultType); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RecallAtPrecision.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RecallAtPrecision.java index 2386087e8a2..be821681704 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RecallAtPrecision.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RecallAtPrecision.java @@ -47,7 +47,6 @@ public class RecallAtPrecision extends SensitivitySpecificity * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()} and {@link * #DEFAULT_NUM_THRESHOLDS} for the number of thresholds * - * @param tf The TensorFlow Ops * @param precision the precision. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. @@ -55,15 +54,14 @@ public class RecallAtPrecision extends SensitivitySpecificity * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public RecallAtPrecision(Ops tf, float precision, long seed, Class type) { - this(tf, null, precision, DEFAULT_NUM_THRESHOLDS, seed, type); + public RecallAtPrecision(float precision, long seed, Class type) { + this(null, precision, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with {@link #DEFAULT_NUM_THRESHOLDS} for the number of * thresholds * - * @param tf The TensorFlow Ops * @param name the name of the metric. If null, defaults to {@link Class#getSimpleName()} * @param precision the precision. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed @@ -72,14 +70,13 @@ public RecallAtPrecision(Ops tf, float precision, long seed, Class type) { * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public RecallAtPrecision(Ops tf, String name, float precision, long seed, Class type) { - this(tf, name, precision, DEFAULT_NUM_THRESHOLDS, seed, type); + public RecallAtPrecision(String name, float precision, long seed, Class type) { + this(name, precision, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()}. * - * @param tf The TensorFlow Ops * @param precision the precision. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given * recall. @@ -89,14 +86,13 @@ public RecallAtPrecision(Ops tf, String name, float precision, long seed, Class< * @throws IllegalArgumentException if numThresholds <= 0 or if recall is not in the range * [0-1]. */ - public RecallAtPrecision(Ops tf, float precision, int numThresholds, long seed, Class type) { - this(tf, null, precision, numThresholds, seed, type); + public RecallAtPrecision(float precision, int numThresholds, long seed, Class type) { + this(null, precision, numThresholds, seed, type); } /** * Creates a PrecisionRecall metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param precision the precision. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given @@ -108,8 +104,8 @@ public RecallAtPrecision(Ops tf, float precision, int numThresholds, long seed, * [0-1]. */ public RecallAtPrecision( - Ops tf, String name, float precision, int numThresholds, long seed, Class type) { - super(tf, name, numThresholds, seed, type); + String name, float precision, int numThresholds, long seed, Class type) { + super(name, numThresholds, seed, type); if (precision < 0f || precision > 1f) throw new IllegalArgumentException("recall must be in the range [0, 1]."); this.precision = precision; @@ -117,9 +113,8 @@ public RecallAtPrecision( /** {@inheritDoc} */ @Override - public Operand result() { - Ops tf = getTF(); - + public Operand result(Ops tf, Class resultType) { + init(tf); Operand precisions = tf.math.divNoNan(truePositives, tf.math.add(truePositives, falsePositives)); Operand recalls = @@ -130,10 +125,13 @@ public Operand result() { Operand feasibleExists = tf.math.greater(tf.size(feasible), tf.constant(0)); Operand gather = tf.expandDims(tf.gather(recalls, feasible, tf.constant(0)), tf.constant(0)); - return tf.select( - feasibleExists, - tf.reduceMax(gather, allAxes(tf, gather)), - cast(tf, tf.constant(0), getType())); + return cast( + tf, + tf.select( + feasibleExists, + tf.reduceMax(gather, allAxes(tf, gather)), + cast(tf, tf.constant(0), getType())), + resultType); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RootMeanSquaredError.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RootMeanSquaredError.java index 8b0b06e788d..65a2ce2e687 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RootMeanSquaredError.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/RootMeanSquaredError.java @@ -35,27 +35,25 @@ public class RootMeanSquaredError extends Mean { /** * Creates a RootMeanSquaredError metric with a name of {@link Class#getSimpleName()} * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public RootMeanSquaredError(Ops tf, long seed, Class type) { - this(tf, null, seed, type); + public RootMeanSquaredError(long seed, Class type) { + this(null, seed, type); } /** * Creates a RootMeanSquaredError metric * - * @param tf the TensorFlow Ops * @param name name of the metric instance. If null, name defaults to {@link * Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public RootMeanSquaredError(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public RootMeanSquaredError(String name, long seed, Class type) { + super(name, seed, type); } /** @@ -69,28 +67,30 @@ public RootMeanSquaredError(Ops tf, String name, long seed, Class type) { */ @Override public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); Operand tSampleWeights = - sampleWeights != null ? cast(getTF(), sampleWeights, getResultType()) : null; + sampleWeights != null ? cast(tf, sampleWeights, getInternalType()) : null; - LossTuple ops = LossesHelper.squeezeOrExpandDimensions(getTF(), tLabels, tPredictions); + LossTuple ops = LossesHelper.squeezeOrExpandDimensions(tf, tLabels, tPredictions); tPredictions = ops.getTarget(); tLabels = ops.getLabels(); Operand errorSquared = - cast(getTF(), getTF().math.squaredDifference(tPredictions, tLabels), getResultType()); + cast(tf, tf.math.squaredDifference(tPredictions, tLabels), getInternalType()); - return super.updateStateList(errorSquared, tSampleWeights); + return super.updateStateList(tf, errorSquared, tSampleWeights); } /** {@inheritDoc} */ @Override - public Operand result() { - return getTF().math.sqrt(getTF().math.divNoNan(this.total, this.count)); + public Operand result(Ops tf, Class resultType) { + init(tf); + return cast(tf, tf.math.sqrt(tf.math.divNoNan(this.total, this.count)), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SensitivityAtSpecificity.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SensitivityAtSpecificity.java index 3892af920e9..0e25c42e6fa 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SensitivityAtSpecificity.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SensitivityAtSpecificity.java @@ -51,7 +51,6 @@ public class SensitivityAtSpecificity extends SensitivitySpec * Creates a SpecificityAtSensitivity metric with a name of {@link Class#getSimpleName()} and * {@link #DEFAULT_NUM_THRESHOLDS} for the number of thresholds * - * @param tf The TensorFlow Ops * @param specificity the specificity. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. @@ -59,15 +58,14 @@ public class SensitivityAtSpecificity extends SensitivitySpec * @throws IllegalArgumentException if numThresholds <= 0 or if specificity is not in the range * [0-1]. */ - public SensitivityAtSpecificity(Ops tf, float specificity, long seed, Class type) { - this(tf, null, specificity, DEFAULT_NUM_THRESHOLDS, seed, type); + public SensitivityAtSpecificity(float specificity, long seed, Class type) { + this(null, specificity, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a SpecificityAtSensitivity metric with {@link #DEFAULT_NUM_THRESHOLDS} for the number * of thresholds * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param specificity the specificity. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed @@ -76,15 +74,13 @@ public SensitivityAtSpecificity(Ops tf, float specificity, long seed, Class t * @throws IllegalArgumentException if numThresholds <= 0 or if specificity is not in the range * [0-1]. */ - public SensitivityAtSpecificity( - Ops tf, String name, float specificity, long seed, Class type) { - this(tf, name, specificity, DEFAULT_NUM_THRESHOLDS, seed, type); + public SensitivityAtSpecificity(String name, float specificity, long seed, Class type) { + this(name, specificity, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()}. * - * @param tf The TensorFlow Ops * @param specificity the specificity. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given * specificity. @@ -94,15 +90,13 @@ public SensitivityAtSpecificity( * @throws IllegalArgumentException if numThresholds <= 0 or if specificity is not in the range * [0-1]. */ - public SensitivityAtSpecificity( - Ops tf, float specificity, int numThresholds, long seed, Class type) { - this(tf, null, specificity, numThresholds, seed, type); + public SensitivityAtSpecificity(float specificity, int numThresholds, long seed, Class type) { + this(null, specificity, numThresholds, seed, type); } /** * Creates a PrecisionRecall metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param specificity the specificity. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given @@ -114,8 +108,8 @@ public SensitivityAtSpecificity( * [0-1]. */ public SensitivityAtSpecificity( - Ops tf, String name, float specificity, int numThresholds, long seed, Class type) { - super(tf, name, numThresholds, seed, type); + String name, float specificity, int numThresholds, long seed, Class type) { + super(name, numThresholds, seed, type); if (specificity < 0f || specificity > 1f) throw new IllegalArgumentException("specificity must be in the range [0, 1]."); this.specificity = specificity; @@ -123,8 +117,8 @@ public SensitivityAtSpecificity( /** {@inheritDoc} */ @Override - public Operand result() { - Ops tf = getTF(); + public Operand result(Ops tf, Class resultType) { + init(tf); Operand specificities = tf.math.divNoNan(trueNegatives, tf.math.add(trueNegatives, falsePositives)); Operand sub = tf.math.sub(specificities, cast(tf, tf.constant(specificity), getType())); @@ -133,7 +127,7 @@ public Operand result() { Operand trueSlice = tf.slice(truePositives, minIndex, tf.constant(new int[] {1})); Operand falseSlice = tf.slice(falseNegatives, minIndex, tf.constant(new int[] {1})); - return tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)); + return cast(tf, tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)), resultType); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalAccuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalAccuracy.java index 10d33c31508..e1f097994e0 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalAccuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalAccuracy.java @@ -17,9 +17,10 @@ import static org.tensorflow.framework.utils.CastHelper.cast; import java.util.Collections; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Ops; import org.tensorflow.op.core.Squeeze; @@ -64,48 +65,52 @@ * * @param The data type for the metric result */ -public class SparseCategoricalAccuracy extends MeanMetricWrapper - implements LossMetric { +public class SparseCategoricalAccuracy extends MeanBaseMetricWrapper + implements LossMetric { /** * Creates a SparseCategoricalAccuracy metric, using name of {@link Class#getSimpleName()}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type The data type for the metric result */ - public SparseCategoricalAccuracy(Ops tf, long seed, Class type) { - this(tf, null, seed, type); + public SparseCategoricalAccuracy(long seed, Class type) { + this(null, seed, type); } /** * Creates a SparseCategoricalAccuracy metric. * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null use {@link Class#getSimpleName()} * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type of the metric result. */ - public SparseCategoricalAccuracy(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public SparseCategoricalAccuracy(String name, long seed, Class type) { + super(name, seed, type); super.setLoss(this); } /** * Calculates how often predictions matches integer labels. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. the TensorFlowOps * @param labels Integer ground truth values. * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Sparse categorical accuracy values. */ @Override - public Operand call( - Operand labels, Operand predictions) { - - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); Shape predShape = predictions.asOutput().shape(); Shape labelsShape = labels.asOutput().shape(); long predictionsRank = predShape.numDimensions(); @@ -115,15 +120,12 @@ public Operand call( if (predictionsRank != Shape.UNKNOWN_SIZE && labelsRank != Shape.UNKNOWN_SIZE && labelsShape.size((int) labelsRank - 1) == 1) { - tLabels = getTF().squeeze(tLabels, Squeeze.axis(Collections.singletonList(labelsRank - 1L))); + tLabels = tf.squeeze(tLabels, Squeeze.axis(Collections.singletonList(labelsRank - 1L))); } Operand argMaxPred = - cast( - getTF(), - getTF().math.argMax(tPredictions, getTF().constant(-1L), TInt64.class), - getResultType()); + cast(tf, tf.math.argMax(tPredictions, tf.constant(-1L), TInt64.class), getInternalType()); - Equal equals = getTF().math.equal(tLabels, argMaxPred); - return getTF().dtypes.cast(equals, getResultType()); + Equal equals = tf.math.equal(tLabels, argMaxPred); + return cast(tf, equals, resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropy.java index 04555d85b66..501bdd81770 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropy.java @@ -14,15 +14,16 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the sparse categorical cross-entropy loss between true labels and * predicted labels. @@ -32,16 +33,29 @@ * * @param The data type for the metric result. */ -public class SparseCategoricalCrossentropy extends MeanMetricWrapper - implements LossMetric { +public class SparseCategoricalCrossentropy extends MeanBaseMetricWrapper + implements LossMetric { private final boolean fromLogits; private final int axis; + /** + * Creates a SparseCategoricalCrossentropy metric using {@link Class#getSimpleName()} for the + * metric name. + * + * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a + * probability distribution. + * @param axis The dimension along which the entropy is computed. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public SparseCategoricalCrossentropy(boolean fromLogits, int axis, long seed, Class type) { + this(null, fromLogits, axis, seed, type); + } /** * Creates a SparseCategoricalCrossentropy metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param fromLogits Whether to interpret predictions as a tensor of logit values as opposed to a * probability distribution. @@ -51,8 +65,8 @@ public class SparseCategoricalCrossentropy extends MeanMetric * @param type the type for the variables and result */ public SparseCategoricalCrossentropy( - Ops tf, String name, boolean fromLogits, int axis, long seed, Class type) { - super(tf, name, seed, type); + String name, boolean fromLogits, int axis, long seed, Class type) { + super(name, seed, type); setLoss(this); this.fromLogits = fromLogits; this.axis = axis; @@ -61,15 +75,25 @@ public SparseCategoricalCrossentropy( /** * Calculates how often predictions matches integer labels. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels Integer ground truth values. * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Sparse categorical accuracy values. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.sparseCategoricalCrossentropy(getTF(), tLabels, tPredictions, fromLogits, axis); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); + return cast( + tf, + Losses.sparseCategoricalCrossentropy(tf, tLabels, tPredictions, fromLogits, axis), + resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseTopKCategoricalAccuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseTopKCategoricalAccuracy.java index 29dc91298d3..e4bc6fcda2a 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseTopKCategoricalAccuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SparseTopKCategoricalAccuracy.java @@ -14,51 +14,75 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * Computes how often integer targets are in the top `K` predictions. * * @param The data type for the metric result */ -public class SparseTopKCategoricalAccuracy extends MeanMetricWrapper - implements LossMetric { +public class SparseTopKCategoricalAccuracy extends MeanBaseMetricWrapper + implements LossMetric { public static final int DEFAULT_K = 5; /** Number of top elements to look at for computing accuracy. */ private final int k; + /** + * Creates a SparseTopKCategoricalAccuracy metric using {@link #DEFAULT_K} for the number of top + * elements using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the date type for the result + */ + public SparseTopKCategoricalAccuracy(long seed, Class type) { + this(null, DEFAULT_K, seed, type); + } + + /** + * Creates a SparseTopKCategoricalAccuracy metric using {@link Class#getSimpleName()} for the + * metric name. + * + * @param k Number of top elements to look at for computing accuracy. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the date type for the result + */ + public SparseTopKCategoricalAccuracy(int k, long seed, Class type) { + this(null, k, seed, type); + } + /** * Creates a SparseTopKCategoricalAccuracy metric using {@link #DEFAULT_K} for the number of top * elements. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the date type for the result */ - public SparseTopKCategoricalAccuracy(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_K, seed, type); + public SparseTopKCategoricalAccuracy(String name, long seed, Class type) { + this(name, DEFAULT_K, seed, type); } /** * Creates a SparseTopKCategoricalAccuracy metric. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param k Number of top elements to look at for computing accuracy. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the date type for the result */ - public SparseTopKCategoricalAccuracy(Ops tf, String name, int k, long seed, Class type) { - super(tf, name, seed, type); + public SparseTopKCategoricalAccuracy(String name, int k, long seed, Class type) { + super(name, seed, type); this.k = k; setLoss(this); } @@ -66,15 +90,23 @@ public SparseTopKCategoricalAccuracy(Ops tf, String name, int k, long seed, Clas /** * Computes how often integer targets are in the top {@code K} predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Sparse top K categorical accuracy value. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Metrics.sparseTopKCategoricalAccuracy(getTF(), tLabels, tPredictions, k); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); + return cast( + tf, Metrics.sparseTopKCategoricalAccuracy(tf, tLabels, tPredictions, k), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SpecificityAtSensitivity.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SpecificityAtSensitivity.java index aa8eeb062b3..03f7b0fc472 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SpecificityAtSensitivity.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SpecificityAtSensitivity.java @@ -50,7 +50,6 @@ public class SpecificityAtSensitivity extends SensitivitySpec * Creates a SpecificityAtSensitivity metric with a name of {@link Class#getSimpleName()} and * {@link #DEFAULT_NUM_THRESHOLDS} for the number of thresholds * - * @param tf The TensorFlow Ops * @param sensitivity the sensitivity. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. @@ -58,15 +57,14 @@ public class SpecificityAtSensitivity extends SensitivitySpec * @throws IllegalArgumentException if numThresholds <= 0 or if sensitivity is not in the range * [0-1]. */ - public SpecificityAtSensitivity(Ops tf, float sensitivity, long seed, Class type) { - this(tf, null, sensitivity, DEFAULT_NUM_THRESHOLDS, seed, type); + public SpecificityAtSensitivity(float sensitivity, long seed, Class type) { + this(null, sensitivity, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a SpecificityAtSensitivity metric with {@link #DEFAULT_NUM_THRESHOLDS} for the number * of thresholds * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param sensitivity the sensitivity. A scalar value in range [0, 1] * @param seed the seed for random number generation. An initializer created with a given seed @@ -75,15 +73,13 @@ public SpecificityAtSensitivity(Ops tf, float sensitivity, long seed, Class t * @throws IllegalArgumentException if numThresholds <= 0 or if sensitivity is not in the range * [0-1]. */ - public SpecificityAtSensitivity( - Ops tf, String name, float sensitivity, long seed, Class type) { - this(tf, name, sensitivity, DEFAULT_NUM_THRESHOLDS, seed, type); + public SpecificityAtSensitivity(String name, float sensitivity, long seed, Class type) { + this(name, sensitivity, DEFAULT_NUM_THRESHOLDS, seed, type); } /** * Creates a PrecisionRecall metric with a name of {@link Class#getSimpleName()}. * - * @param tf The TensorFlow Ops * @param sensitivity the sensitivity. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given * sensitivity. @@ -93,15 +89,13 @@ public SpecificityAtSensitivity( * @throws IllegalArgumentException if numThresholds <= 0 or if sensitivity is not in the range * [0-1]. */ - public SpecificityAtSensitivity( - Ops tf, float sensitivity, int numThresholds, long seed, Class type) { - this(tf, null, sensitivity, numThresholds, seed, type); + public SpecificityAtSensitivity(float sensitivity, int numThresholds, long seed, Class type) { + this(null, sensitivity, numThresholds, seed, type); } /** * Creates a PrecisionRecall metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric, if null defaults to {@link Class#getSimpleName()} * @param sensitivity the sensitivity. A scalar value in range [0, 1] * @param numThresholds Defaults to 200. The number of thresholds to use for matching the given @@ -113,8 +107,8 @@ public SpecificityAtSensitivity( * [0-1]. */ public SpecificityAtSensitivity( - Ops tf, String name, float sensitivity, int numThresholds, long seed, Class type) { - super(tf, name, numThresholds, seed, type); + String name, float sensitivity, int numThresholds, long seed, Class type) { + super(name, numThresholds, seed, type); if (sensitivity < 0f || sensitivity > 1f) throw new IllegalArgumentException("sensitivity must be in the range [0, 1]."); this.sensitivity = sensitivity; @@ -122,9 +116,8 @@ public SpecificityAtSensitivity( /** {@inheritDoc} */ @Override - public Operand result() { - - Ops tf = getTF(); + public Operand result(Ops tf, Class resultType) { + init(tf); Operand sensitivities = tf.math.divNoNan(truePositives, tf.math.add(truePositives, falseNegatives)); @@ -134,7 +127,7 @@ public Operand result() { Operand trueSlice = tf.slice(trueNegatives, minIndex, tf.constant(new int[] {1})); Operand falseSlice = tf.slice(falsePositives, minIndex, tf.constant(new int[] {1})); - return tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)); + return cast(tf, tf.math.divNoNan(trueSlice, tf.math.add(trueSlice, falseSlice)), resultType); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SquaredHinge.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SquaredHinge.java index e2ff208b8f5..f29aac4e200 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SquaredHinge.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/SquaredHinge.java @@ -14,50 +14,69 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.Losses; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -import static org.tensorflow.framework.utils.CastHelper.cast; - /** * A metric that computes the squared hinge loss metric between labels and predictions. * * @param The data type for the metric result. */ -public class SquaredHinge extends MeanMetricWrapper implements LossMetric { +public class SquaredHinge extends MeanBaseMetricWrapper + implements LossMetric { + + /** + * Creates a SquaredHinge metric using {@link Class#getSimpleName()} for the metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + public SquaredHinge(long seed, Class type) { + this(null, seed, type); + } /** * Creates a SquaredHinge metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public SquaredHinge(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); + public SquaredHinge(String name, long seed, Class type) { + super(name, seed, type); setLoss(this); } /** * Computes the squared hinge loss between labels and predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels The ground truth values. {@code labels} values are expected to be -1 or 1. If * binary (0 or 1) labels are provided we will convert them to -1 or 1. shape = {@code * [batch_size, d0, .. dN]}. * @param predictions the predictions, shape = {@code [batch_size, d0, .. dN]}. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Squared hinge loss values. shape = {@code [batch_size, d0, .. dN-1]}. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Losses.squaredHinge(getTF(), tLabels, tPredictions); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); + return cast(tf, Losses.squaredHinge(tf, tLabels, tPredictions), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Sum.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Sum.java index bcb1d7b9a36..4010e760d1c 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Sum.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/Sum.java @@ -15,7 +15,6 @@ package org.tensorflow.framework.metrics; import org.tensorflow.framework.metrics.impl.Reduce; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -34,25 +33,23 @@ public class Sum extends Reduce { /** * Creates a Sum metric with a name of {@link Class#getSimpleName()} * - * @param tf The TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public Sum(Ops tf, long seed, Class type) { - super(tf, null, MetricReduction.SUM, seed, type); + public Sum(long seed, Class type) { + super(null, MetricReduction.SUM, seed, type); } /** * Creates a Sum metric. * - * @param tf The TensorFlow Ops * @param name the name of the metric instance. If null, defaults to {@link Class#getSimpleName()} * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the type for the variables and result */ - public Sum(Ops tf, String name, long seed, Class type) { - super(tf, name, MetricReduction.SUM, seed, type); + public Sum(String name, long seed, Class type) { + super(name, MetricReduction.SUM, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracy.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracy.java index b630be5bcc2..7d6586325b2 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracy.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracy.java @@ -16,9 +16,10 @@ import static org.tensorflow.framework.utils.CastHelper.cast; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.metrics.impl.LossMetric; -import org.tensorflow.framework.metrics.impl.MeanMetricWrapper; +import org.tensorflow.framework.metrics.impl.MeanBaseMetricWrapper; import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; @@ -27,38 +28,62 @@ * * @param The data type for the metric result */ -public class TopKCategoricalAccuracy extends MeanMetricWrapper - implements LossMetric { +public class TopKCategoricalAccuracy extends MeanBaseMetricWrapper + implements LossMetric { public static final int DEFAULT_K = 5; /** Number of top elements to look at for computing accuracy. */ private final int k; + /** + * Creates a TopKCategoricalAccuracy metric using {@link #DEFAULT_K} for {@code k}, Number of top + * elements to look at for computing accuracy and using {@link Class#getSimpleName()} for the + * metric name. + * + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type The data type for the metric result + */ + public TopKCategoricalAccuracy(long seed, Class type) { + this(null, DEFAULT_K, seed, type); + } + + /** + * Creates a TopKCategoricalAccuracy metric using {@link Class#getSimpleName()} for the metric + * name. + * + * @param k Number of top elements to look at for computing accuracy. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type The data type for the metric result + */ + public TopKCategoricalAccuracy(int k, long seed, Class type) { + this(null, k, seed, type); + } + /** * Creates a TopKCategoricalAccuracy metric using {@link #DEFAULT_K} for {@code k}, Number of top * elements to look at for computing accuracy. * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type The data type for the metric result */ - public TopKCategoricalAccuracy(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_K, seed, type); + public TopKCategoricalAccuracy(String name, long seed, Class type) { + this(name, DEFAULT_K, seed, type); } /** * Creates a TopKCategoricalAccuracy metric * - * @param tf the TensorFlow Ops * @param name the name of this metric, if null then metric name is {@link Class#getSimpleName()}. * @param k Number of top elements to look at for computing accuracy. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type The data type for the metric result */ - public TopKCategoricalAccuracy(Ops tf, String name, int k, long seed, Class type) { - super(tf, name, seed, type); + public TopKCategoricalAccuracy(String name, int k, long seed, Class type) { + super(name, seed, type); this.k = k; setLoss(this); } @@ -66,15 +91,22 @@ public TopKCategoricalAccuracy(Ops tf, String name, int k, long seed, Class t /** * Computes how often targets are in the top {@code K} predictions. * + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param labels the truth values or labels * @param predictions the predictions + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return Top K categorical accuracy value. */ @Override - public Operand call( - Operand labels, Operand predictions) { - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - return Metrics.topKCategoricalAccuracy(getTF(), tLabels, tPredictions, k); + public Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType) { + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); + return cast(tf, Metrics.topKCategoricalAccuracy(tf, tLabels, tPredictions, k), resultType); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TrueNegatives.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TrueNegatives.java index fd6b95df6d2..4110d988bcc 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TrueNegatives.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TrueNegatives.java @@ -16,7 +16,6 @@ import org.tensorflow.framework.metrics.impl.ConfusionMatrixConditionCount; import org.tensorflow.framework.metrics.impl.ConfusionMatrixEnum; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -37,19 +36,17 @@ public class TrueNegatives extends ConfusionMatrixConditionCo * Creates a TrueNegatives metric, using {@link Class#getSimpleName()} for the metric name and a * default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, long seed, Class type) { - this(tf, null, DEFAULT_THRESHOLD, seed, type); + public TrueNegatives(long seed, Class type) { + this(null, DEFAULT_THRESHOLD, seed, type); } /** * Creates a TrueNegatives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -58,14 +55,13 @@ public TrueNegatives(Ops tf, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, float threshold, long seed, Class type) { - this(tf, null, new float[] {threshold}, seed, type); + public TrueNegatives(float threshold, long seed, Class type) { + this(null, new float[] {threshold}, seed, type); } /** * Creates a TrueNegatives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -74,27 +70,25 @@ public TrueNegatives(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, seed, type); + public TrueNegatives(float[] thresholds, long seed, Class type) { + this(null, thresholds, seed, type); } /** * Creates a TrueNegatives metric, using a default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_THRESHOLD, seed, type); + public TrueNegatives(String name, long seed, Class type) { + this(name, DEFAULT_THRESHOLD, seed, type); } /** * Creates a TrueNegatives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -104,14 +98,13 @@ public TrueNegatives(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, new float[] {threshold}, seed, type); + public TrueNegatives(String name, float threshold, long seed, Class type) { + this(name, new float[] {threshold}, seed, type); } /** * Creates a TrueNegatives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -121,7 +114,7 @@ public TrueNegatives(Ops tf, String name, float threshold, long seed, Class t * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TrueNegatives(Ops tf, String name, float[] thresholds, long seed, Class type) { - super(tf, name, ConfusionMatrixEnum.TRUE_NEGATIVES, thresholds, seed, type); + public TrueNegatives(String name, float[] thresholds, long seed, Class type) { + super(name, ConfusionMatrixEnum.TRUE_NEGATIVES, thresholds, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TruePositives.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TruePositives.java index 90fe9142014..7df1a54a345 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TruePositives.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/TruePositives.java @@ -16,7 +16,6 @@ import org.tensorflow.framework.metrics.impl.ConfusionMatrixConditionCount; import org.tensorflow.framework.metrics.impl.ConfusionMatrixEnum; -import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; /** @@ -37,19 +36,17 @@ public class TruePositives extends ConfusionMatrixConditionCo * Creates a TruePositives metric, using {@link Class#getSimpleName()} for the metric name and a * default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, long seed, Class type) { - this(tf, null, DEFAULT_THRESHOLD, seed, type); + public TruePositives(long seed, Class type) { + this(null, DEFAULT_THRESHOLD, seed, type); } /** * Creates a TruePositives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -58,14 +55,13 @@ public TruePositives(Ops tf, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, float threshold, long seed, Class type) { - this(tf, null, new float[] {threshold}, seed, type); + public TruePositives(float threshold, long seed, Class type) { + this(null, new float[] {threshold}, seed, type); } /** * Creates a TruePositives metric, using {@link Class#getSimpleName()} for the metric name * - * @param tf the TensorFlow Ops * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is * {@code true}, below is {@code false}). One metric value is generated for each threshold @@ -74,27 +70,25 @@ public TruePositives(Ops tf, float threshold, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, float[] thresholds, long seed, Class type) { - this(tf, null, thresholds, seed, type); + public TruePositives(float[] thresholds, long seed, Class type) { + this(null, thresholds, seed, type); } /** * Creates a TruePositives metric, using a default threshold of {@link #DEFAULT_THRESHOLD}. * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, String name, long seed, Class type) { - this(tf, name, DEFAULT_THRESHOLD, seed, type); + public TruePositives(String name, long seed, Class type) { + this(name, DEFAULT_THRESHOLD, seed, type); } /** * Creates a TruePositives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param threshold a threshold value in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -104,14 +98,13 @@ public TruePositives(Ops tf, String name, long seed, Class type) { * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, String name, float threshold, long seed, Class type) { - this(tf, name, new float[] {threshold}, seed, type); + public TruePositives(String name, float threshold, long seed, Class type) { + this(name, new float[] {threshold}, seed, type); } /** * Creates a TruePositives metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param thresholds threshold values in the range {@code [0, 1]}. A threshold is compared with * prediction values to determine the truth value of predictions (i.e., above the threshold is @@ -121,7 +114,7 @@ public TruePositives(Ops tf, String name, float threshold, long seed, Class t * will always produce the same random tensor for a given shape and data type. * @param type the data type for the variables */ - public TruePositives(Ops tf, String name, float[] thresholds, long seed, Class type) { - super(tf, name, ConfusionMatrixEnum.TRUE_POSITIVES, thresholds, seed, type); + public TruePositives(String name, float[] thresholds, long seed, Class type) { + super(name, ConfusionMatrixEnum.TRUE_POSITIVES, thresholds, seed, type); } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/ConfusionMatrixConditionCount.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/ConfusionMatrixConditionCount.java index cbff958fc6f..5ab22480760 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/ConfusionMatrixConditionCount.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/ConfusionMatrixConditionCount.java @@ -21,11 +21,10 @@ import java.util.List; import org.tensorflow.Operand; import org.tensorflow.framework.initializers.Zeros; -import org.tensorflow.framework.metrics.Metric; +import org.tensorflow.framework.metrics.BaseMetric; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.Variable; import org.tensorflow.types.family.TNumber; @@ -35,21 +34,20 @@ * * @param The data type for the metric result */ -public abstract class ConfusionMatrixConditionCount extends Metric { +public abstract class ConfusionMatrixConditionCount extends BaseMetric { public static final String ACCUMULATOR = "accumulator"; public static final float DEFAULT_THRESHOLD = 0.5f; private final ConfusionMatrixEnum confusionMatrixCond; private final float[] thresholds; private final String accumulatorName; private final Class type; + private final Zeros zeros = new Zeros<>(); private Variable accumulator; - private Assign initializer; /** * Creates a ConfusionMatrixConditionCount type of Metric, using a threshold of {@link * #DEFAULT_THRESHOLD} * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param confusionMatrixCond the confusion matrix condition to calculate * @param seed the seed for random number generation. An initializer created with a given seed @@ -57,13 +55,12 @@ public abstract class ConfusionMatrixConditionCount extends M * @param type the data type for the variables */ public ConfusionMatrixConditionCount( - Ops tf, String name, ConfusionMatrixEnum confusionMatrixCond, long seed, Class type) { - this(tf, name, confusionMatrixCond, DEFAULT_THRESHOLD, seed, type); + String name, ConfusionMatrixEnum confusionMatrixCond, long seed, Class type) { + this(name, confusionMatrixCond, DEFAULT_THRESHOLD, seed, type); } /** * Creates a ConfusionMatrixConditionCount type of Metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param confusionMatrixCond the confusion matrix condition to calculate * @param threshold a threshold value in {@code [0, 1]}. A threshold is compared with prediction @@ -74,19 +71,17 @@ public ConfusionMatrixConditionCount( * @param type the data type for the variables */ public ConfusionMatrixConditionCount( - Ops tf, String name, ConfusionMatrixEnum confusionMatrixCond, float threshold, long seed, Class type) { - this(tf, name, confusionMatrixCond, new float[] {threshold}, seed, type); + this(name, confusionMatrixCond, new float[] {threshold}, seed, type); } /** * Creates a ConfusionMatrixConditionCount type of Metric * - * @param tf the TensorFlow Ops * @param name the name of the metric, if null then {@link Class#getSimpleName()} is used * @param confusionMatrixCond the confusion matrix condition to calculate * @param thresholds threshold values in {@code [0, 1]}. A threshold is compared with prediction @@ -97,41 +92,32 @@ public ConfusionMatrixConditionCount( * @param type the data type for the variables */ public ConfusionMatrixConditionCount( - Ops tf, String name, ConfusionMatrixEnum confusionMatrixCond, float[] thresholds, long seed, Class type) { - super(tf, name, seed); + super(name, seed); accumulatorName = this.getVariableName(ACCUMULATOR); this.type = type; this.confusionMatrixCond = confusionMatrixCond; this.thresholds = thresholds; - init(); - } - - /** Initialize the metric */ - private void init() { - Shape variableShape = Shape.of(this.thresholds.length); - - Zeros zeros = new Zeros<>(); - accumulator = - getTF() - .withName(getAccumulatorName()) - .withInitScope() - .variable(zeros.call(getTF(), getTF().constant(variableShape), type)); - initializer = - getTF().assign(accumulator, zeros.call(getTF(), getTF().constant(variableShape), type)); } - /** - * Gets the initializer for the accumulator variable - * - * @return the initializer for the accumulator variable - */ - public Assign getInitializer() { - return initializer; + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + setTF(tf); + Shape variableShape = Shape.of(this.thresholds.length); + + accumulator = + tf.withName(getAccumulatorName()) + .withInitScope() + .variable(zeros.call(tf.withInitScope(), tf.constant(variableShape), type)); + setInitialized(true); + } } /** @@ -145,18 +131,18 @@ public Assign getInitializer() { */ @Override public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Ops tf = getTF(); + init(tf); Operand tLabels = cast(tf, labels, type); Operand tPredictions = cast(tf, predictions, type); Operand tSampleWeights = sampleWeights != null ? cast(tf, sampleWeights, type) : null; return new ArrayList<>( MetricsHelper.updateConfusionMatrixVariables( - getTF(), + tf, Collections.singletonMap(confusionMatrixCond, accumulator), - Collections.singletonMap(confusionMatrixCond, initializer), tLabels, tPredictions, tf.constant(thresholds), @@ -169,14 +155,17 @@ public List updateStateList( /** {@inheritDoc} */ @Override - public Operand result() { - return getTF().identity(accumulator); + public Operand result(Ops tf, Class type) { + init(tf); + return cast(tf, tf.identity(accumulator), type); } /** {@inheritDoc} */ @Override - public Op resetStates() { - return initializer; + public Op resetStates(Ops tf) { + init(tf); + return tf.withName(accumulatorName) + .assign(accumulator, zeros.call(tf, tf.constant(accumulator.shape()), type)); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/LossMetric.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/LossMetric.java index 76c21aebefc..3729cdd7265 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/LossMetric.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/LossMetric.java @@ -15,21 +15,25 @@ package org.tensorflow.framework.metrics.impl; import org.tensorflow.Operand; +import org.tensorflow.op.Ops; import org.tensorflow.types.family.TNumber; -/** - * Interface for Metrics that wrap AbstractLoss functions. - * - * @param The data type of the predictions. - */ -public interface LossMetric { +/** Interface for Metrics that wrap AbstractLoss functions. */ +public interface LossMetric { /** * Calculates the weighted loss between {@code labels} and {@code predictions} * + * @param tf the TensorFlow Ops * @param labels the truth values or labels * @param predictions the predictions + * @param resultType the data type for the result + * @param The data type of the predictions. * @return the loss */ - Operand call(Operand labels, Operand predictions); + Operand call( + Ops tf, + Operand labels, + Operand predictions, + Class resultType); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanBaseMetricWrapper.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanBaseMetricWrapper.java new file mode 100644 index 00000000000..e53368cfda9 --- /dev/null +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanBaseMetricWrapper.java @@ -0,0 +1,107 @@ +/* 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. +=======================================================================*/ +package org.tensorflow.framework.metrics.impl; + +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.List; +import org.tensorflow.Operand; +import org.tensorflow.framework.metrics.Mean; +import org.tensorflow.framework.metrics.MetricReduction; +import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; +import org.tensorflow.types.family.TNumber; + +/** + * A class that bridges a stateless loss function with the {@link Mean} metric using a reduction of + * {@link MetricReduction#WEIGHTED_MEAN}. + * + *

    The loss function calculates the loss between the {@code labels} and {@code predictions } then + * passes this loss to the {@link Mean} metric to calculate the weighted mean of the loss over many + * iterations or epochs + * + * @param The data type for the metric result + */ +public class MeanBaseMetricWrapper extends Mean { + + /** The loss function interface */ + protected LossMetric loss; + + /** + * Creates a Reducible Metric with a metric reductions of {@link MetricReduction#WEIGHTED_MEAN} + * + * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. + * @param seed the seed for random number generation. An initializer created with a given seed + * will always produce the same random tensor for a given shape and data type. + * @param type the type for the variables and result + */ + protected MeanBaseMetricWrapper(String name, long seed, Class type) { + super(name, seed, type); + } + + /** + * Gets the loss function. + * + * @return the loss function. + */ + public LossMetric getLoss() { + return loss; + } + + /** + * Sets the AbstractLoss function for this wrapper. + * + * @param loss the loss function. + */ + protected void setLoss(LossMetric loss) { + this.loss = loss; + } + + /** + * Creates Operations that update the state of the mean metric, by calling the loss function and + * passing the loss to the Mean metric to calculate the weighted mean of the loss over many + * iterations. + * + * @param labels the truth values or labels + * @param predictions the predictions + * @param sampleWeights Optional sampleWeights acts as a coefficient for the loss. If a scalar is + * provided, then the loss is simply scaled by the given value. If sampleWeights is a tensor + * of size [batch_size], then the total loss for each sample of the batch is rescaled by the + * corresponding element in the sampleWeights vector. If the shape of sampleWeights is + * [batch_size, d0, .. dN-1] (or can be broadcasted to this shape), then each loss element of + * predictions is scaled by the corresponding value of sampleWeights. (Note on dN-1: all loss + * functions reduce by 1 dimension, usually axis=-1.) + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. + * @return a List of control operations that updates the Mean state variables. + */ + public List updateStateList( + Ops tf, + Operand labels, + Operand predictions, + Operand sampleWeights) { + if (labels == null || predictions == null) { + throw new IllegalArgumentException("missing required inputs for labels and predictions"); + } + + init(tf); + Operand tLabels = cast(tf, labels, getInternalType()); + Operand tPredictions = cast(tf, predictions, getInternalType()); + + Operand losses = loss.call(tf, tLabels, tPredictions, getInternalType()); + + return super.updateStateList(tf, cast(tf, losses, predictions.type()), sampleWeights); + } +} diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanMetricWrapper.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanMetricWrapper.java deleted file mode 100644 index d9f4bb60cba..00000000000 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MeanMetricWrapper.java +++ /dev/null @@ -1,104 +0,0 @@ -/* 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. -=======================================================================*/ -package org.tensorflow.framework.metrics.impl; - -import static org.tensorflow.framework.utils.CastHelper.cast; - -import java.util.List; -import org.tensorflow.Operand; -import org.tensorflow.framework.metrics.Mean; -import org.tensorflow.framework.metrics.MetricReduction; -import org.tensorflow.op.Op; -import org.tensorflow.op.Ops; -import org.tensorflow.types.family.TNumber; - -/** - * A class that bridges a stateless loss function with the {@link Mean} metric using a reduction of - * {@link MetricReduction#WEIGHTED_MEAN}. - * - *

    The loss function calculates the loss between the {@code labels} and {@code predictions } then - * passes this loss to the {@link Mean} metric to calculate the weighted mean of the loss over many - * iterations or epochs - * - * @param The data type for the metric result - */ -public class MeanMetricWrapper extends Mean { - - /** The loss function interface */ - protected LossMetric loss; - - /** - * Creates a Reducible Metric with a metric reductions of {@link MetricReduction#WEIGHTED_MEAN} - * - * @param tf the TensorFlow Ops - * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. - * @param seed the seed for random number generation. An initializer created with a given seed - * will always produce the same random tensor for a given shape and data type. - * @param type the type for the variables and result - */ - protected MeanMetricWrapper(Ops tf, String name, long seed, Class type) { - super(tf, name, seed, type); - } - - /** - * Gets the loss function. - * - * @return the loss function. - */ - public LossMetric getLoss() { - return loss; - } - - /** - * Sets the AbstractLoss function for this wrapper. - * - * @param loss the loss function. - */ - protected void setLoss(LossMetric loss) { - this.loss = loss; - } - - /** - * Creates Operations that update the state of the mean metric, by calling the loss function and - * passing the loss to the Mean metric to calculate the weighted mean of the loss over many - * iterations. - * - * @param labels the truth values or labels - * @param predictions the predictions - * @param sampleWeights Optional sampleWeights acts as a coefficient for the loss. If a scalar is - * provided, then the loss is simply scaled by the given value. If sampleWeights is a tensor - * of size [batch_size], then the total loss for each sample of the batch is rescaled by the - * corresponding element in the sampleWeights vector. If the shape of sampleWeights is - * [batch_size, d0, .. dN-1] (or can be broadcasted to this shape), then each loss element of - * predictions is scaled by the corresponding value of sampleWeights. (Note on dN-1: all loss - * functions reduce by 1 dimension, usually axis=-1.) - * @return a List of control operations that updates the Mean state variables. - */ - public List updateStateList( - Operand labels, - Operand predictions, - Operand sampleWeights) { - if (labels == null || predictions == null) { - throw new IllegalArgumentException("missing required inputs for labels and predictions"); - } - - Operand tLabels = cast(getTF(), labels, getResultType()); - Operand tPredictions = cast(getTF(), predictions, getResultType()); - - Operand losses = loss.call(tLabels, tPredictions); - - return super.updateStateList(cast(getTF(), losses, predictions.type()), sampleWeights); - } -} diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MetricsHelper.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MetricsHelper.java index 7d265ef7651..12f7d0cbb3d 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MetricsHelper.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/MetricsHelper.java @@ -24,15 +24,16 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicLong; +import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.framework.losses.impl.LossTuple; import org.tensorflow.framework.losses.impl.LossesHelper; import org.tensorflow.framework.metrics.exceptions.NotBroadcastableException; +import org.tensorflow.framework.op.FrameworkOps; import org.tensorflow.framework.utils.SparseTensor; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.OneHot; import org.tensorflow.op.core.Rank; import org.tensorflow.op.core.Squeeze; @@ -40,6 +41,7 @@ import org.tensorflow.op.core.Variable; import org.tensorflow.op.math.Mean; import org.tensorflow.op.nn.TopK; +import org.tensorflow.op.nn.TopK.Options; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; @@ -50,7 +52,7 @@ /** * These are helper methods for Metrics and will be module private when Java modularity is applied - * to TensorFlow Java. These methods should not be used outside of the metrics packages. + * to TensorFlow Java. These methods should not be used outside the metrics packages. */ public class MetricsHelper { public static final float NEG_INF = -1e10f; @@ -64,12 +66,14 @@ public class MetricsHelper { * scalar, or the same rank as the target values, with each dimension either 1, or the same as the * corresponding values dimension. * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param sampleWeights the sample weights. * @param values the values to which weights are applied. + * @param the data type for the parameters and result * @return {@code Operation} with control dependencies to ensure {@code sampleWeight} can be * broadcast to {@code values} - * @param the type of Operand + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @throws NotBroadcastableException If static checks determine {@code sampleWeights} has an * incorrect shape that prohibit broadcasting to {@code values} */ @@ -154,12 +158,14 @@ public static Op assertBroadcastable( /** * Gets an operand that tests if the shapes have the same rank and valid dimensions. * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param weightsRank the operand for the rank of the sample weights * @param weightsShape the operand for the shape of the sample weights * @param valuesRank the operand for the rank of the sample weights * @param valuesShape the operand for the shape of the sample weights * @param the data type for the operands + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return a boolean operand to determine if the Shape is scalar or not. */ private static Operand canBroadcastNonscalarShapes( @@ -176,10 +182,12 @@ private static Operand canBroadcastNonscalarShapes( /** * Gets an operand that tests if the shapes have valid dimensions or not. * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param weightsShape the operand for the shape of the sample weights * @param valuesShape the operand for the shape of the values * @param the data type for the operands + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return a boolean operand to determine if the shapes have valid dimensions or not. */ private static Operand canBroadcastDims( @@ -190,7 +198,8 @@ private static Operand canBroadcastDims( tf.concat(Arrays.asList(valuesShape2d, tf.onesLike(valuesShape2d)), tf.constant(1)); Operand weightsShape2D = tf.expandDims(weightsShape, tf.constant(-1)); - Operand diffResult = SetsOps.difference(tf, weightsShape2D, validDims); + FrameworkOps fops = FrameworkOps.create(tf); + Operand diffResult = fops.sets.difference(weightsShape2D, validDims); Operand numInvalidDims = tf.size(diffResult); return tf.math.equal(tf.constant(0), numInvalidDims); } @@ -198,10 +207,12 @@ private static Operand canBroadcastDims( /** * Broadcast {@code weights} to the same shape as {@code values}. * - * @param tf the TensorFlow ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. the TensorFlow ops * @param weights Operand whose shape is broadcastable to {@code values}. * @param values Operand of any shape * @param the type of Operands + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return {@code weights} broadcast to {@code values} shape */ public static Operand broadcastWeights( @@ -306,14 +317,12 @@ public static List assertShapes( * LossesHelper#removeSqueezableDimensions(Ops, Operand, Operand)}. {@code sampleWeight} is then * broadcast to the shape of {@code predictions}. * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. * @param variablesToUpdate map with {@link ConfusionMatrixEnum} values as valid keys and * corresponding variables to update as values. If {@code multiLabel}, then the variable * shapes are (T, D), where T is the number of thresholds and D is the number of classes * (after slicing by {@code classIndex}, if provided). If {@code multiLabels}, then the * variable shapes are (T). - * @param varInitializers map with {@link ConfusionMatrixEnum} values as valid keys and - * corresponding initializer Operands to for {@code variablesToUpdate}. * @param labels the labels. Will be cast to {@link TBool}. Shape (N, Cx, L1?), where N is the * number of examples, Cx is zero or more class dimensions, and L1 is a potential extra * dimension of size 1 that would be squeezed. @@ -338,6 +347,8 @@ public static List assertShapes( * the 0th dimension (the examples dimension) of {@code predictions}. May be null. Must be * null if {@code multiLabel}. * @param the data type for the variables + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @throws IllegalArgumentException If {@code predictions} and {@code labels} have mismatched * shapes, or if {@code sampleWeight} is not null and its shape doesn't match {@code * predictions}, or if {@code multiLabel && labelWeights != null}.. @@ -347,7 +358,6 @@ public static List assertShapes( public static List updateConfusionMatrixVariables( Ops tf, Map> variablesToUpdate, - Map> varInitializers, Operand labels, Operand predictions, Operand thresholds, @@ -594,13 +604,7 @@ tPredictions, cast(tf, tf.constant(0), tPredictions.type())), Operand[] op = loopVars.get(c); // op[0] = label, op[1] == prediction controlOps.add( - weightedAssignAdd( - tf, - op[0], - op[1], - weightsTiledF, - variablesToUpdate.get(c), - varInitializers.get(c))); + weightedAssignAdd(tf, op[0], op[1], weightsTiledF, variablesToUpdate.get(c))); } }); @@ -611,13 +615,14 @@ tPredictions, cast(tf, tf.constant(0), tPredictions.type())), * Creates an Operand that adds the values by taking the logical and of labels and predictions to * the specified confusion matrix variable. * - * @param tf The TensorFlow Ops + * @param tf the TensorFlow Ops encapsulating a {@link Graph} environment. The TensorFlow Ops * @param labels the labels * @param predictions the predictions * @param weights the weights applied to the logical and result, may be null * @param variable the variable to update - * @param initializer the variable initializer to be applied to the variable, may be null. * @param the data type for the variable. + * @throws IllegalArgumentException if the TensorFlow Ops scope does not encapsulate a Graph + * environment. * @return an Operand that updates the variable. */ private static Operand weightedAssignAdd( @@ -625,8 +630,7 @@ private static Operand weightedAssignAdd( Operand labels, Operand predictions, Operand weights, - Variable variable, - Assign initializer) { + Variable variable) { Class type = variable.type(); Operand labelAndPred = cast(tf, tf.math.logicalAnd(labels, predictions), type); @@ -638,16 +642,7 @@ private static Operand weightedAssignAdd( // else: // sum across ND, leaving shape (T) Operand valueSum = tf.reduceSum(labelAndPred, tf.constant(1)); - Operand assignAdd; - if (initializer != null) { - Ops tfc = - tf.withSubScope("weightedAssignAdd") - .withControlDependencies(Collections.singletonList(initializer)); - assignAdd = tfc.assignAdd(variable, valueSum); - } else { - assignAdd = tf.assignAdd(variable, valueSum); - } - return assignAdd; + return tf.assignAdd(variable, valueSum); } /** @@ -656,7 +651,7 @@ private static Operand weightedAssignAdd( *

    Used for computing top-k prediction values in dense labels (which has the same shape as * predictions) for recall and precision top-k metrics. * - * @param tf The TensorFlow Ops + * @param tf the TensorFlow Ops * @param x the tensor with any dimensions to filter * @param topK the number of values to keep. * @param the data type for x and the return value. @@ -666,7 +661,7 @@ private static Operand filterTopK(Ops tf, Operand x, i Class type = x.type(); Shape xShape = x.shape(); // top has the same rank as x; the last dimension becomes indices of the topK features. - TopK top = tf.nn.topK(x, tf.constant(topK), TopK.sorted(false)); + TopK top = tf.nn.topK(x, tf.constant(topK), new Options[] {TopK.sorted(false)}); // oneHot has an additional dimension: the one-hot representation of each topK index. OneHot oneHot = tf.oneHot( diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/Reduce.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/Reduce.java index b96d2dfa1d0..f304d81fc71 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/Reduce.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/Reduce.java @@ -14,35 +14,29 @@ =======================================================================*/ package org.tensorflow.framework.metrics.impl; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.ArrayList; +import java.util.List; import org.tensorflow.Operand; import org.tensorflow.framework.losses.impl.LossTuple; import org.tensorflow.framework.losses.impl.LossesHelper; -import org.tensorflow.framework.metrics.Metric; +import org.tensorflow.framework.metrics.BaseMetric; import org.tensorflow.framework.metrics.MetricReduction; -import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.types.family.TNumber; -import java.util.ArrayList; -import java.util.List; - -import static org.tensorflow.framework.utils.CastHelper.cast; - -/** - * Encapsulates metrics that perform a reduce operation on the metric values. - * - * @param The data type for the metric result - */ -public abstract class Reduce extends Metric { +/** Encapsulates metrics that perform a reduce operation on the metric values. */ +public abstract class Reduce extends BaseMetric { public static final String TOTAL = "total"; public static final String COUNT = "count"; protected final MetricReduction reduction; private final String totalName; private final String countName; - private final Class resultType; + private final Class internalType; /** the variable that holds the total of the metric values */ protected Variable total; /** @@ -54,55 +48,68 @@ public abstract class Reduce extends Metric { /** * Creates a Reducible Metric with a metric reductions of {@link MetricReduction#SUM} * - * @param tf the TensorFlow Ops * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. - * @param resultType the type for the variables and result + * @param internalType the type for the internal variables */ - protected Reduce(Ops tf, String name, long seed, Class resultType) { - this(tf, name, MetricReduction.SUM, seed, resultType); + protected Reduce(String name, long seed, Class internalType) { + this(name, MetricReduction.SUM, seed, internalType); } /** - * @param tf The TensorFlow Ops * @param name the name for this metric. If null, name defaults to {@link Class#getSimpleName()}. * @param reduction The type of metric reduction to apply * @param seed the seed for random number generation. An initializer created with a given seed * will always produce the same random tensor for a given shape and data type. - * @param resultType the type for the variables and result + * @param internalType the type for the internal variables */ - protected Reduce(Ops tf, String name, MetricReduction reduction, long seed, Class resultType) { - super(tf, name, seed); + protected Reduce(String name, MetricReduction reduction, long seed, Class internalType) { + super(name, seed); this.reduction = reduction; this.totalName = this.getVariableName(TOTAL); this.countName = this.getVariableName(COUNT); - this.resultType = resultType; - setupVars(); + this.internalType = internalType; } - /** Initializes the Variables */ - private void setupVars() { - if (total == null) { - total = getTF().withName(totalName).variable(Shape.scalar(), resultType); - } - if (reduction == MetricReduction.SUM_OVER_BATCH_SIZE - || reduction == MetricReduction.WEIGHTED_MEAN) { - if (count == null) { - count = getTF().withName(countName).variable(Shape.scalar(), resultType); + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + + if (!isInitialized()) { + setTF(tf); + Operand zero = cast(tf, tf.constant(0), internalType); + if (total == null) { + total = tf.withInitScope().withName(totalName).variable(zero); + } + if (reduction == MetricReduction.SUM_OVER_BATCH_SIZE + || reduction == MetricReduction.WEIGHTED_MEAN) { + if (count == null) { + count = tf.withInitScope().withName(countName).variable(zero); + } } + setInitialized(true); } } /** {@inheritDoc} */ - public Op resetStates() { - List controls = new ArrayList<>(); + @Override + public Op resetStates(Ops tf) { + if (!isInitialized()) { + init(tf); + } + List operandList = new ArrayList<>(); if (total != null) { - controls.add(getTF().assign(total, cast(getTF(), getTF().constant(0), total.type()))); + operandList.add(tf.assign(total, cast(tf, tf.constant(0), total.type()))); } if (count != null) { - controls.add(getTF().assign(count, cast(getTF(), getTF().constant(0), count.type()))); + operandList.add(tf.assign(count, cast(tf, tf.constant(0), count.type()))); + } + if (operandList.size() == 1) { + return operandList.get(0); + } else { + return tf.withControlDependencies(operandList).noOp(); } - return getTF().withControlDependencies(controls).noOp(); } /** @@ -116,27 +123,27 @@ public Op resetStates() { */ @Override public List updateStateList( - Operand values, Operand sampleWeights) { + Ops tf, Operand values, Operand sampleWeights) { if (values == null) { throw new IllegalArgumentException("values is required."); } - Ops tf = getTF(); + init(tf); List updateOperations = new ArrayList<>(); // cast everything to match the variables Operand tSampleWeights = null; - Operand tValues = cast(tf, values, getResultType()); + Operand tValues = cast(tf, values, getInternalType()); if (sampleWeights != null) { - tSampleWeights = cast(getTF(), sampleWeights, getResultType()); + tSampleWeights = cast(tf, sampleWeights, getInternalType()); // Update dimensions of weights to match with values if possible. LossTuple tuple = - LossesHelper.squeezeOrExpandDimensions(getTF(), null, tValues, tSampleWeights); + LossesHelper.squeezeOrExpandDimensions(tf, null, tValues, tSampleWeights); tValues = tuple.getTarget(); tSampleWeights = tuple.getSampleWeights(); try { // Broadcast weights if possible - tSampleWeights = MetricsHelper.broadcastWeights(getTF(), tSampleWeights, tValues); + tSampleWeights = MetricsHelper.broadcastWeights(tf, tSampleWeights, tValues); } catch (IllegalArgumentException ex) { // reduce values to same ndim as weight array // if we get here we have static shapes with either @@ -150,19 +157,18 @@ public List updateStateList( int[] axes = new int[numAxes]; for (int i = 0; i < numAxes; i++) axes[i] = i + weightsRank; if (reduction == MetricReduction.SUM) { - tValues = getTF().reduceSum(tValues, getTF().constant(axes)); + tValues = tf.reduceSum(tValues, tf.constant(axes)); } else { - tValues = getTF().math.mean(tValues, getTF().constant(axes)); + tValues = tf.math.mean(tValues, tf.constant(axes)); } } } - tValues = getTF().math.mul(tValues, tSampleWeights); + tValues = tf.math.mul(tValues, tSampleWeights); } Operand weightedValueSum = - getTF().reduceSum(tValues, LossesHelper.allAxes(getTF(), tValues)); - Operand totalUpdate = - getTF().assignAdd(total, cast(getTF(), weightedValueSum, total.type())); + tf.reduceSum(tValues, LossesHelper.allAxes(tf, tValues)); + Operand totalUpdate = tf.assignAdd(total, cast(tf, weightedValueSum, total.type())); updateOperations.add(totalUpdate); Operand numValues; // Exit early if the reduction doesn't have a denominator. @@ -170,18 +176,17 @@ public List updateStateList( // Update `count` for reductions that require a denominator. switch (reduction) { case SUM_OVER_BATCH_SIZE: - numValues = cast(getTF(), getTF().constant(tValues.shape().size()), resultType); + numValues = cast(tf, tf.constant(tValues.shape().size()), internalType); break; case WEIGHTED_MEAN: if (tSampleWeights == null) { - numValues = cast(getTF(), getTF().constant(tValues.shape().size()), resultType); + numValues = cast(tf, tf.constant(tValues.shape().size()), internalType); } else { numValues = cast( - getTF(), - getTF() - .reduceSum(tSampleWeights, LossesHelper.allAxes(getTF(), tSampleWeights)), - resultType); + tf, + tf.reduceSum(tSampleWeights, LossesHelper.allAxes(tf, tSampleWeights)), + internalType); } break; default: @@ -189,7 +194,7 @@ public List updateStateList( String.format("reduction [%s] not implemented", reduction)); } - Operand totalCount = getTF().assignAdd(this.count, numValues); + Operand totalCount = tf.assignAdd(this.count, numValues); updateOperations.add(totalCount); } @@ -199,16 +204,16 @@ public List updateStateList( /** {@inheritDoc} */ @Override - public Operand result() { - Operand fResult; - + public Operand result(Ops tf, Class type) { + Operand fResult; + init(tf); switch (this.reduction) { case SUM: - fResult = getTF().identity(total); + fResult = cast(tf, tf.identity(total), type); break; case WEIGHTED_MEAN: case SUM_OVER_BATCH_SIZE: - fResult = getTF().math.divNoNan(total, cast(getTF(), count, resultType)); + fResult = cast(tf, tf.math.divNoNan(total, count), type); break; default: throw new UnsupportedOperationException( @@ -240,7 +245,7 @@ public Variable getCount() { * * @return the type for the variables */ - public Class getResultType() { - return resultType; + public Class getInternalType() { + return internalType; } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SensitivitySpecificityBase.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SensitivitySpecificityBase.java index 870579ad636..376ac4f4388 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SensitivitySpecificityBase.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SensitivitySpecificityBase.java @@ -3,26 +3,24 @@ import static org.tensorflow.framework.utils.CastHelper.cast; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.tensorflow.Operand; import org.tensorflow.framework.initializers.Zeros; -import org.tensorflow.framework.metrics.Metric; +import org.tensorflow.framework.metrics.BaseMetric; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.Variable; import org.tensorflow.types.family.TNumber; /** * Abstract base class for computing sensitivity and specificity. * - * @param The data type for the metric result + * @param The data internalType for the metric result */ -public abstract class SensitivitySpecificityBase extends Metric { +public abstract class SensitivitySpecificityBase extends BaseMetric { public static final int DEFAULT_NUM_THRESHOLDS = 200; @@ -37,33 +35,30 @@ public abstract class SensitivitySpecificityBase extends Metr private final String falsePositivesName; private final String trueNegativesName; private final String falseNegativesName; - private final Class type; + private final Zeros zeros = new Zeros<>(); + private final Class internalType; protected Variable truePositives; protected Variable falsePositives; protected Variable trueNegatives; protected Variable falseNegatives; - private Assign truePositivesInitializer; - private Assign falsePositivesInitializer; - private Assign trueNegativesInitializer; - private Assign falseNegativesInitializer; - /** * Creates a SensitivitySpecificityBase Metric * - * @param tf the TensorFlow Ops * @param name the name of the metric instance, if null then {@link Class#getSimpleName()} is used * @param numThresholds The number of thresholds to use for matching the given recall. * @param seed the seed for random number generation. An initializer created with a given seed - * will always produce the same random tensor for a given shape and data type. - * @param type the data type for the variables + * will always produce the same random tensor for a given shape and data internalType. + * @param internalType the data internalType for the variables * @throws IllegalArgumentException if numThresholds <= 0. */ protected SensitivitySpecificityBase( - Ops tf, String name, int numThresholds, long seed, Class type) { - super(tf, name, seed); - if (numThresholds <= 0) throw new IllegalArgumentException("numThresholds must be > 0."); - this.type = type; + String name, int numThresholds, long seed, Class internalType) { + super(name, seed); + if (numThresholds <= 0) { + throw new IllegalArgumentException("numThresholds must be > 0."); + } + this.internalType = internalType; this.truePositivesName = this.getVariableName(TRUE_POSITIVES); this.falsePositivesName = this.getVariableName(FALSE_POSITIVES); this.trueNegativesName = this.getVariableName(TRUE_NEGATIVES); @@ -80,60 +75,35 @@ protected SensitivitySpecificityBase( } this.thresholds[numThresholds - 1] = 1f; } - init(); } - /** Initializes the Variables */ - private void init() { - Ops tf = getTF(); - Zeros zeros = new Zeros<>(); - Shape varShape = Shape.of(numThresholds); - Operand zero = zeros.call(tf, tf.constant(varShape), type); - - if (this.getTruePositives() == null) { - - truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); - truePositivesInitializer = tf.assign(truePositives, zero); - } - if (this.getFalsePositives() == null) { + /** {@inheritDoc} */ + @Override + protected void init(Ops tf) { + checkIsGraph(tf); + if (!isInitialized()) { + setTF(tf); + Shape varShape = Shape.of(numThresholds); + Operand zero = zeros.call(tf, tf.constant(varShape), internalType); - falsePositives = tf.withName(falsePositivesName).withInitScope().variable(zero); - falsePositivesInitializer = tf.assign(falsePositives, zero); - } - if (this.getTrueNegatives() == null) { + if (this.getTruePositives() == null) { - trueNegatives = tf.withInitScope().withName(trueNegativesName).variable(zero); - trueNegativesInitializer = tf.assign(trueNegatives, zero); - } - if (this.getFalseNegatives() == null) { + truePositives = tf.withName(truePositivesName).withInitScope().variable(zero); + } + if (this.getFalsePositives() == null) { - falseNegatives = tf.withInitScope().withName(falseNegativesName).variable(zero); - falseNegativesInitializer = tf.assign(falseNegatives, zero); - } - } + falsePositives = tf.withName(falsePositivesName).withInitScope().variable(zero); + } + if (this.getTrueNegatives() == null) { - /** - * Gets a control dependency Op to initialize all the variables - * - * @return a control dependency Op to initialize all the variables - */ - public Op initializeVariables() { - List varInitializers = new ArrayList<>(); + trueNegatives = tf.withInitScope().withName(trueNegativesName).variable(zero); + } + if (this.getFalseNegatives() == null) { - if (truePositivesInitializer != null) { - varInitializers.add(truePositivesInitializer); - } - if (falsePositivesInitializer != null) { - varInitializers.add(falsePositivesInitializer); - } - if (trueNegativesInitializer != null) { - varInitializers.add(trueNegativesInitializer); - } - if (falseNegativesInitializer != null) { - varInitializers.add(falseNegativesInitializer); + falseNegatives = tf.withInitScope().withName(falseNegativesName).variable(zero); + } + setInitialized(true); } - - return getTF().withControlDependencies(varInitializers).noOp(); } /** @@ -146,15 +116,16 @@ public Op initializeVariables() { * @return a List of Operations to update the metric state. */ @Override - @SuppressWarnings("unchecked") public List updateStateList( + Ops tf, Operand labels, Operand predictions, Operand sampleWeights) { - Ops tf = getTF(); - Operand tLabels = cast(tf, labels, type); - Operand tPredictions = cast(tf, predictions, type); - Operand tSampleWeights = sampleWeights != null ? cast(tf, sampleWeights, type) : null; + init(tf); + Operand tLabels = cast(tf, labels, internalType); + Operand tPredictions = cast(tf, predictions, internalType); + Operand tSampleWeights = + sampleWeights != null ? cast(tf, sampleWeights, internalType) : null; Map> confusionMatrix = new HashMap<>(); confusionMatrix.put(ConfusionMatrixEnum.TRUE_POSITIVES, getTruePositives()); @@ -165,7 +136,6 @@ public List updateStateList( return MetricsHelper.updateConfusionMatrixVariables( tf, confusionMatrix, - Collections.EMPTY_MAP, tLabels, tPredictions, tf.constant(thresholds), @@ -178,8 +148,29 @@ public List updateStateList( /** {@inheritDoc} */ @Override - public Op resetStates() { - return initializeVariables(); + public Op resetStates(Ops tf) { + + Shape varShape = Shape.of(numThresholds); + Operand zero = zeros.call(tf, tf.constant(varShape), internalType); + + List controlList = new ArrayList<>(); + if (this.getTruePositives() != null) { + controlList.add(tf.withName(truePositivesName).assign(this.getTruePositives(), zero)); + } + if (this.getFalsePositives() != null) { + controlList.add(tf.withName(falsePositivesName).assign(this.getFalsePositives(), zero)); + } + if (this.getTrueNegatives() != null) { + controlList.add(tf.withName(trueNegativesName).assign(this.getTrueNegatives(), zero)); + } + if (this.getFalseNegatives() != null) { + controlList.add(tf.withName(falseNegativesName).assign(this.getFalseNegatives(), zero)); + } + if (controlList.size() == 1) { + return controlList.get(0); + } else { + return tf.withControlDependencies(controlList).noOp(); + } } /** @@ -273,11 +264,15 @@ public String getFalseNegativesName() { } /** - * Gets the type + * Gets the internalType * - * @return the type + * @return the internalType */ public Class getType() { - return type; + return internalType; + } + + public Class getInternalType() { + return internalType; } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SetsOps.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SetsOps.java deleted file mode 100644 index dd77a1be4aa..00000000000 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/SetsOps.java +++ /dev/null @@ -1,147 +0,0 @@ -/* 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. -=======================================================================*/ -package org.tensorflow.framework.metrics.impl; - -import static org.tensorflow.framework.utils.CastHelper.cast; - -import org.tensorflow.Operand; -import org.tensorflow.op.Ops; -import org.tensorflow.op.SparseOps; -import org.tensorflow.op.sparse.DenseToDenseSetOperation; -import org.tensorflow.types.family.TNumber; - -/** Implementation of set operations */ -public class SetsOps { - - /** - * Computes set difference of elements in last dimension of {@code a} and {@code b} with {@code - * aMinusB} set to true. - * - *

    All but the last dimension of {@code a} and {@code b} must match - * - * @param tf the TensorFlow Ops - * @param a The first operand representing set {@code a} - * @param b The other operand representing set {@code b} - * @param the data type for the sets - * @return An Operand with the same rank as {@code a} and {@code b}, and all but the last - * dimension the * same. Elements along the last dimension contain the results of the set - * operation. - */ - public static Operand difference(Ops tf, Operand a, Operand b) { - return difference(tf, a, b, true); - } - - /** - * Computes set difference of elements in last dimension of {@code a} and {@code b}. - * - *

    All but the last dimension of {@code a} and {@code b} must match - * - * @param tf the TensorFlow Ops - * @param a The first operand representing set {@code a} - * @param b The other operand representing set {@code b} - * @param aMinusB whether to subtract b from a, vs vice versa. - * @param the data type for the sets - * @return An Operand with the same rank as {@code a} and {@code b}, and all but the last - * dimension the * same. Elements along the last dimension contain the results of the set - * operation. - */ - public static Operand difference( - Ops tf, Operand a, Operand b, boolean aMinusB) { - return setOperation(tf, a, b, aMinusB ? Operation.A_MINUS_B : Operation.B_MINUS_A); - } - - /** - * Computes set union of elements in last dimension of {@code a} and {@code b}. - * - * @param tf the TensorFlow Ops - * @param a The first operand representing set {@code a} - * @param b The other operand representing set {@code b} - * @param the data type for the sets - * @return An Operand with the same rank as {@code a} and {@code b}, and all but the last - * dimension the * same. Elements along the last dimension contain the results of the set - * operation. - */ - public static Operand union(Ops tf, Operand a, Operand b) { - return setOperation(tf, a, b, Operation.UNION); - } - - /** - * Computes set intersection of elements in last dimension of {@code a} and {@code b}. - * - * @param tf the TensorFlow Ops - * @param a The first operand representing set {@code a} - * @param b The other operand representing set {@code b} - * @param the data type for the sets - * @return An Operand with the same rank as {@code a} and {@code b}, and all but the last - * dimension the * same. Elements along the last dimension contain the results of the set - * operation. - */ - public static Operand intersection(Ops tf, Operand a, Operand b) { - return setOperation(tf, a, b, Operation.INTERSECTION); - } - - /** - * Compute set operation of elements in last dimension of {@code a} and {@code b}. - * - * @param tf the TensorFlow Ops - * @param a The first set operation operand - * @param b The other et operation operand - * @param setOperation The set operation to perform, {@link Operation}. - * @param the data type for the sets - * @return An Operand with the same rank as {@code a} and {@code b}, and all but the last - * dimension the same. Elements along the last dimension contain the results of the set - * operation. - */ - public static Operand setOperation( - Ops tf, Operand a, Operand b, Operation setOperation) { - - DenseToDenseSetOperation setOperationResult = - tf.sparse.denseToDenseSetOperation( - a, b, setOperation.getSetOperation(), DenseToDenseSetOperation.validateIndices(true)); - - return tf.sparse.sparseToDense( - setOperationResult.resultIndices(), - setOperationResult.resultShape(), - setOperationResult.resultValues(), - cast(tf, tf.constant(0), a.type())); - } - - /** - * Enumeration containing the string operation values to be passed to the TensorFlow Sparse Ops - * function {@link SparseOps#denseToDenseSetOperation} - */ - public enum Operation { - A_MINUS_B("a-b"), - B_MINUS_A("b-a"), - INTERSECTION("intersection"), - UNION("union"); - - private final String setOperation; - - Operation(String setOperation) { - this.setOperation = setOperation; - } - - /** - * Gets the set operation String value used to pass as the stringOperation value to {@link - * SparseOps#denseToDenseSetOperation} - * - * @return the set operation String value - */ - public String getSetOperation() { - return setOperation; - } - } -} diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/WeightsBroadcastOps.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/WeightsBroadcastOps.java index 2df90a841ee..79dc6e765ab 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/WeightsBroadcastOps.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/metrics/impl/WeightsBroadcastOps.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.List; import org.tensorflow.Operand; +import org.tensorflow.framework.op.FrameworkOps; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; @@ -42,7 +43,7 @@ public class WeightsBroadcastOps { /** * Asserts that {@code weights} can be broadcast to {@code values} * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops. * @param weights the weights Operand * @param values Operand of values to which weights are applied. * @return {@code Operation} raising a tensorflow InvalidArgumentError if {@code weights} has @@ -118,7 +119,7 @@ public static Op assertBroadcastable( * Check to see that weights and values have the same rank, if they do, then check each * corresponding dim of each. * - * @param tf The TensorFlow Ops + * @param tf the TensorFlow Ops * @param weightsRank the rank operand for the weights * @param weightsShape the shape operand for the weights * @param valuesRank the rank operand for the values @@ -141,7 +142,7 @@ private static Operand hasValidNonscalarShape( * Checks that each dimension of the two shapes are the same size, or that the weight dimension * size is 1. * - * @param tf the TensorFlow Ops + * @param tf the TensorFlow Ops. * @param weightsShape the shape of the weights * @param valuesShape the shape of the values * @return a boolean Operand, true if all the dimensions of the two shapes are the same. @@ -155,7 +156,8 @@ private static Operand hasValidDims( tf.concat(Arrays.asList(valuesShape2d, tf.onesLike(valuesShape2d)), tf.constant(1)); Operand weightsShape2d = tf.expandDims(weightsShape, tf.constant(-1)); - Operand invalidDims = SetsOps.difference(tf, weightsShape2d, validDims); + FrameworkOps fops = FrameworkOps.create(tf); + Operand invalidDims = fops.sets.difference(weightsShape2d, validDims); Operand numInvalidDims = tf.size(invalidDims, TInt32.class); return tf.math.equal(tf.constant(0), numInvalidDims); } @@ -168,7 +170,7 @@ private static Operand hasValidDims( * When computing a weighted average, use this function to broadcast {@code weights} before * summing them; e.g., {@code reduceSum(w * v) / reduceSum(_broadcast_weights(w, v))}. * - * @param tf the TensorFlow ops + * @param tf the TensorFlow Ops * @param weights Operand whose shape is able to be broadcast to {@code values} * @param values Tensor` of any shape * @param the type of Operand diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/FrameworkOps.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/FrameworkOps.java index 7b6322d0f0d..15bf224a5de 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/FrameworkOps.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/FrameworkOps.java @@ -18,6 +18,7 @@ import org.tensorflow.EagerSession; import org.tensorflow.ExecutionEnvironment; import org.tensorflow.op.Op; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Ops; import org.tensorflow.op.Scope; @@ -71,7 +72,7 @@ private FrameworkOps(Ops core) { * @return the FrameworkOps */ public static FrameworkOps create(ExecutionEnvironment env) { - return new FrameworkOps(new Scope(env)); + return new FrameworkOps(new OpScope(env)); } /** @@ -83,7 +84,7 @@ public static FrameworkOps create(ExecutionEnvironment env) { * @return the FrameworkOps */ public static FrameworkOps create() { - return new FrameworkOps(new Scope(EagerSession.getDefault())); + return new FrameworkOps(new OpScope(EagerSession.getDefault())); } /** @@ -109,6 +110,10 @@ public final Scope scope() { * Returns an API that builds operations with the provided name prefix. * *

    @link Scope#withSubScope(String)} + * + * @param childScopeName name for the new child scope + * @return a new FrameworkOps that uses the child sub scope + * @throws IllegalArgumentException if the name is invalid */ public FrameworkOps withSubScope(String childScopeName) { return new FrameworkOps(scope.withSubScope(childScopeName)); @@ -118,6 +123,10 @@ public FrameworkOps withSubScope(String childScopeName) { * Returns an API that uses the provided name for an op. * *

    {@link Scope#withName(String)} + * + * @param opName name for an operator in the returned scope + * @return a new FrameworkOps that uses opName for operations. + * @throws IllegalArgumentException if the name is invalid */ public FrameworkOps withName(String opName) { return new FrameworkOps(scope.withName(opName)); @@ -146,4 +155,20 @@ public FrameworkOps withDevice(DeviceSpec deviceSpec) { public FrameworkOps withControlDependencies(Iterable controls) { return new FrameworkOps(scope.withControlDependencies(controls)); } + + /** + * Returns an FrameworkOps that builds init operations. + * + *

    Init operations will be initialized at session creation, will have their inputs (and control + * inputs) made init ops as well, and are ignored when used as control dependencies. Additionally, + * this scope ignores any control dependencies. + * + *

    If an input can not be made an init op (i.e. a Placeholder), will throw an {@link + * IllegalStateException} on op creation. + * + * @return a FrameworkOps with a scope that builds init operations + */ + public FrameworkOps withInitScope() { + return new FrameworkOps(scope.withInitScope()); + } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/NnOps.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/NnOps.java index 96f023ffedf..e02f38286b0 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/NnOps.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/NnOps.java @@ -15,6 +15,7 @@ package org.tensorflow.framework.op; import org.tensorflow.Operand; +import org.tensorflow.framework.op.nn.GELU; import org.tensorflow.framework.op.nn.SigmoidCrossEntropyWithLogits; import org.tensorflow.framework.op.nn.SoftmaxCrossEntropyWithLogits; import org.tensorflow.framework.op.nn.SparseSoftmaxCrossEntropyWithLogits; @@ -190,4 +191,35 @@ public Operand sparseSoftmaxCrossEntro return SparseSoftmaxCrossEntropyWithLogits.sparseSoftmaxCrossEntropyWithLogits( scope, labels, logits); } + + /** + * Compute the Gaussian Error Linear Unit (GELU) activation function without approximation. + * + *

    Gaussian error linear unit (GELU) computes {@code x * P(X <= x)}, where {@code P(X) ~ N(0, + * 1)}. The (GELU) nonlinearity weights inputs by their value, rather than gates inputs by their + * sign as in ReLU. + * + * @param input the input + * @param the data type for the input and result + * @return The Gaussian Error Linear Unit computation + */ + public Operand gelu(Operand input) { + return GELU.gelu(scope, input); + } + + /** + * Compute the Gaussian Error Linear Unit (GELU) activation function. + * + *

    Gaussian error linear unit (GELU) computes {@code x * P(X <= x)}, where {@code P(X) ~ N(0, + * 1)}. The (GELU) nonlinearity weights inputs by their value, rather than gates inputs by their + * sign as in ReLU. + * + * @param input the input + * @param approximate Whether to enable approximation. + * @param the data type for the input and result + * @return The Gaussian Error Linear Unit computation + */ + public Operand gelu(Operand input, boolean approximate) { + return GELU.gelu(scope, input, approximate); + } } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/linalg/MatMul.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/linalg/MatMul.java index d8beacaa32f..3b02461e0d1 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/linalg/MatMul.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/linalg/MatMul.java @@ -21,7 +21,6 @@ import org.tensorflow.op.dtypes.Cast; import org.tensorflow.op.math.Conj; import org.tensorflow.op.sparse.SparseMatMul; -import org.tensorflow.op.train.BatchMatMul; import org.tensorflow.types.TBfloat16; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -234,14 +233,16 @@ public static Operand matmul( // use adjoint instead. Conj() is a noop for real matrices. if (transposeA) { a = Conj.create(scope, a); - adjointA = true; } if (transposeB) { b = Conj.create(scope, b); - adjointB = true; } - return BatchMatMul.create( - lscope, a, b, a.type(), BatchMatMul.adjX(adjointA), BatchMatMul.adjY(adjointB)); + return org.tensorflow.op.linalg.MatMul.create( + lscope, + a, + b, + org.tensorflow.op.linalg.MatMul.transposeA(transposeA), + org.tensorflow.op.linalg.MatMul.transposeB(transposeB)); } // Neither matmul nor sparse_matmul support adjoint, so we conjugate diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/math/TensorDot.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/math/TensorDot.java index a222f64679e..bbe509414c3 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/math/TensorDot.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/math/TensorDot.java @@ -396,6 +396,7 @@ private static Operand[] tensordotAxes( * *

    In general, {@code order(c) = order(a) + order(b) - 2*len(axes[0])}. * + * @param scope current scope * @param a {@code Operand} of type {@code TFloat32} or {@code TFloat64}. * @param b {@code Operand} with the same type as {@code a}. * @param axis sum over the last N axes of a and the first N axes of b in order. If {@code @@ -447,6 +448,7 @@ public static Operand tensordot( * *

    * + * @param scope current scope * @param a {@code Operand} of type {@code TFloat32} or {@code TFloat64}. * @param b {@code Operand} with the same type as {@code a}. * @param axes If axes is a scalar, sum over the last N axes of a and the first N axes of b in @@ -502,6 +504,7 @@ public static Operand tensordot( * *

    * + * @param scope current scope * @param a {@code Operand} of type {@code TFloat32} or {@code TFloat64}. * @param b {@code Operand} with the same type as {@code a}. * @param axes the first and second row contain the set of unique integers specifying axes along @@ -555,6 +558,7 @@ public static Operand tensordot( * *

    * + * @param scope current scope * @param a {@code Operand} of type {@code TFloat32} or {@code TFloat64}. * @param b {@code Operand} with the same type as {@code a}. * @param axes the first and second row contain the set of unique integers specifying axes along @@ -608,6 +612,7 @@ public static Operand tensordot( * *

    * + * @param scope current scope * @param a {@code Operand} of type {@code TFloat32} or {@code TFloat64}. * @param b {@code Operand} with the same type as {@code a}. * @param aAxis axes for the a Operand diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/GELU.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/GELU.java new file mode 100644 index 00000000000..d1f583a31d3 --- /dev/null +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/GELU.java @@ -0,0 +1,102 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.framework.op.nn; + +import org.tensorflow.Operand; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Endpoint; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.op.core.Constant; +import org.tensorflow.op.dtypes.Cast; +import org.tensorflow.op.math.Add; +import org.tensorflow.op.math.Div; +import org.tensorflow.op.math.Erf; +import org.tensorflow.op.math.Mul; +import org.tensorflow.op.math.Pow; +import org.tensorflow.op.math.Tanh; +import org.tensorflow.types.family.TNumber; + +/** + * The Gaussian Error Linear Unit (GELU) activation function. + * + *

    Gaussian error linear unit (GELU) computes {@code x * P(X <= x)}, where {@code P(X) ~ N(0, + * 1)}. The (GELU) nonlinearity weights inputs by their value, rather than gates inputs by their + * sign as in ReLU. + * + * @see Gaussian Error Linear Units (GELUs) + */ +@Operator(group = "nn") +public class GELU { + + /** + * Compute the Gaussian Error Linear Unit (GELU) activation function without approximation. + * + * @param scope The TensorFlow scope + * @param input the input + * @param the data type for the input and result + * @return The Gaussian Error Linear Unit + */ + @Endpoint(name = "gelu") + public static Operand gelu(Scope scope, Operand input) { + return gelu(scope, input, false); + } + + /** + * Compute the Gaussian Error Linear Unit (GELU) activation function. + * + * @param scope The TensorFlow scope + * @param input the input + * @param approximate Whether to enable approximation. + * @param the data type for the input and result + * @return The Gaussian Error Linear Unit computation + */ + @Endpoint(name = "gelu") + public static Operand gelu( + Scope scope, Operand input, boolean approximate) { + Cast point5 = Cast.create(scope, Constant.scalarOf(scope, 0.5), input.type()); + Cast one = Cast.create(scope, Constant.scalarOf(scope, 1.0), input.type()); + Mul inputMul = Mul.create(scope, point5, input); + if (approximate) { + Operand coeff = Cast.create(scope, Constant.scalarOf(scope, 0.044715), input.type()); + Operand tanhMul = + Cast.create(scope, Constant.scalarOf(scope, 0.7978845608028654), input.type()); + Operand three = Cast.create(scope, Constant.scalarOf(scope, 3), input.type()); + return Mul.create( + scope, + inputMul, + Add.create( + scope, + one, + Tanh.create( + scope, + Mul.create( + scope, + tanhMul, + Add.create( + scope, + input, + Mul.create(scope, coeff, Pow.create(scope, input, three))))))); + + } else { + Operand mulConstant = + Cast.create(scope, Constant.scalarOf(scope, 1.4142135623730951), input.type()); + + return Mul.create( + scope, + inputMul, + Add.create(scope, one, Erf.create(scope, Div.create(scope, input, mulConstant)))); + } + } +} diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/SoftmaxCrossEntropyWithLogits.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/SoftmaxCrossEntropyWithLogits.java index a95110c9a96..10106723fba 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/SoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/nn/SoftmaxCrossEntropyWithLogits.java @@ -42,15 +42,12 @@ public class SoftmaxCrossEntropyWithLogits { *

    Usage: * *

    -   *   Operand<TFloat32> logits =
    -   *       tf.constant(new float[][] {{4.0F, 2.0F, 1.0F}, {0.0F, 5.0F, 1.0F}} );
    -   *   Operand<TFloat32> labels =
    -   *       tf.constant(new float[][] {{1.0F, 0.0F, 0.0F}, {0.0F, 0.8F, 0.2F}} );
    -   *   Operand<TFloat32> output =
    -   *       tf.nn.softmaxCrossEntropyWithLogits(labels, logits, -1);
    -   *   // output Shape = [2]
    -   *   // dataType = FLOAT (1)
    -   *   // values { 0.169846, 0.824745 }
    +   * Operand<TFloat32> logits = tf.constant(new float[][] { { 4.0F, 2.0F, 1.0F }, { 0.0F, 5.0F, 1.0F } });
    +   * Operand<TFloat32> labels = tf.constant(new float[][] { { 1.0F, 0.0F, 0.0F }, { 0.0F, 0.8F, 0.2F } });
    +   * Operand<TFloat32> output = tf.nn.softmaxCrossEntropyWithLogits(labels, logits, -1);
    +   * // output Shape = [2]
    +   * // dataType = FLOAT (1)
    +   * // values { 0.169846, 0.824745 }
        * 
    * *

    Backpropagation will happen into both logits and labels. To @@ -157,7 +154,7 @@ public static Operand softmaxCrossEntr * @return the flattened logits */ private static Operand flattenOuterDims(Scope scope, Operand logits) { - Operand one = Constant.scalarOf(scope, 1L); + Operand one = Constant.arrayOf(scope, 1L); Shape shape = logits.shape(); int ndims = shape.numDimensions(); diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/sets/Sets.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/sets/Sets.java index 0cbfa74e770..c91581632d8 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/op/sets/Sets.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/op/sets/Sets.java @@ -31,6 +31,7 @@ public class Sets { * *

    All but the last dimension of a and b must match * + * @param scope current scope * @param a The first operand representing set a * @param b The other operand representing set b * @param the data type for the sets @@ -47,6 +48,7 @@ public static Operand difference(Scope scope, Operand * *

    All but the last dimension of a and b must match * + * @param scope current scope * @param a The first operand representing set a * @param b The other operand representing set b * @param aMinusB whether to subtract b from a, vs vice versa. @@ -63,6 +65,7 @@ public static Operand difference( /** * Computes set union of elements in last dimension of a and b. * + * @param scope current scope * @param a The first operand representing set a * @param b The other operand representing set b * @param the data type for the sets @@ -77,6 +80,7 @@ public static Operand union(Scope scope, Operand a, Op /** * Computes set intersection of elements in last dimension of a and b. * + * @param scope current scope * @param a The first operand representing set a * @param b The other operand representing set b * @param the data type for the sets @@ -92,6 +96,7 @@ public static Operand intersection( /** * Compute set operation of elements in last dimension of a and b. * + * @param scope current scope * @param a The first set operation operand * @param b The other et operation operand * @param setOperation The set operation to perform, {@link Operation}. diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaDelta.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaDelta.java index 19f7584b152..15c5ff4d0cb 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaDelta.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaDelta.java @@ -20,6 +20,7 @@ import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyAdadelta; import org.tensorflow.types.family.TType; @@ -150,16 +151,16 @@ private void createAdaDeltaSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable accumSlot = getSlot(variable, ACCUMULATOR).get(); Variable accumUpdateSlot = getSlot(variable, ACCUMULATOR_UPDATE).get(); - return tf.train.applyAdadelta( + return deps.train.applyAdadelta( variable, accumSlot, accumUpdateSlot, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), - tf.dtypes.cast(tf.constant(rho), gradient.type()), - tf.dtypes.cast(tf.constant(epsilon), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(rho), gradient.type()), + deps.dtypes.cast(deps.constant(epsilon), gradient.type()), gradient, ApplyAdadelta.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGrad.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGrad.java index 5c51bbc1e4b..5901a28f25f 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGrad.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGrad.java @@ -20,6 +20,7 @@ import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyAdagrad; import org.tensorflow.types.family.TType; @@ -140,10 +141,14 @@ private void createAdaGradSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable slot = getSlot(variable, ACCUMULATOR).get(); - return tf.train.applyAdagrad( - variable, slot, tf.dtypes.cast(tf.constant(learningRate), gradient.type()), gradient, opts); + return deps.train.applyAdagrad( + variable, + slot, + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), + gradient, + opts); } /** {@inheritDoc} */ diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGradDA.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGradDA.java index 62ab8d309c9..8dba8105d3e 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGradDA.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/AdaGradDA.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyAdagradDa; import org.tensorflow.types.TInt64; @@ -209,17 +210,17 @@ private void createAdaGradDASlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable gradSlot = getSlot(variable, ACCUMULATOR).get(); Variable gradSquaredSlot = getSlot(variable, SQUARED_ACCUMULATOR).get(); - return tf.train.applyAdagradDa( + return deps.train.applyAdagradDa( variable, gradSlot, gradSquaredSlot, gradient, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), - tf.dtypes.cast(tf.constant(l1Strength), gradient.type()), - tf.dtypes.cast(tf.constant(l2Strength), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(l1Strength), gradient.type()), + deps.dtypes.cast(deps.constant(l2Strength), gradient.type()), globalStep, ApplyAdagradDa.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adam.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adam.java index 6cf1dbcc7c5..c9a2a483c73 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adam.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adam.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; @@ -223,19 +224,19 @@ private void createAdamSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable firstMomentSlot = getSlot(variable, FIRST_MOMENT).get(); Variable secondMomentSlot = getSlot(variable, SECOND_MOMENT).get(); - return tf.train.applyAdam( + return deps.train.applyAdam( variable, firstMomentSlot, secondMomentSlot, - tf.dtypes.cast(betaOnePower, gradient.type()), - tf.dtypes.cast(betaTwoPower, gradient.type()), - tf.dtypes.cast(learningRateConst, gradient.type()), - tf.dtypes.cast(betaOneConst, gradient.type()), - tf.dtypes.cast(betaTwoConst, gradient.type()), - tf.dtypes.cast(epsilonConst, gradient.type()), + deps.dtypes.cast(betaOnePower, gradient.type()), + deps.dtypes.cast(betaTwoPower, gradient.type()), + deps.dtypes.cast(learningRateConst, gradient.type()), + deps.dtypes.cast(betaOneConst, gradient.type()), + deps.dtypes.cast(betaTwoConst, gradient.type()), + deps.dtypes.cast(epsilonConst, gradient.type()), gradient, ApplyAdam.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adamax.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adamax.java index 635c2ecb862..0e6abfa0032 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adamax.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Adamax.java @@ -7,6 +7,7 @@ import org.tensorflow.Output; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Constant; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyAdaMax; @@ -155,19 +156,19 @@ private void createAdamaxSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable firstMomentSlot = getSlot(variable, FIRST_MOMENT).get(); Variable secondMomentSlot = getSlot(variable, SECOND_MOMENT).get(); return ApplyAdaMax.create( - this.tf.scope(), + deps.scope(), variable, firstMomentSlot, secondMomentSlot, - tf.dtypes.cast(betaOnePower, gradient.type()), - tf.dtypes.cast(learningRateConst, gradient.type()), - tf.dtypes.cast(betaOneConst, gradient.type()), - tf.dtypes.cast(betaTwoConst, gradient.type()), - tf.dtypes.cast(epsilonConst, gradient.type()), + deps.dtypes.cast(betaOnePower, gradient.type()), + deps.dtypes.cast(learningRateConst, gradient.type()), + deps.dtypes.cast(betaOneConst, gradient.type()), + deps.dtypes.cast(betaTwoConst, gradient.type()), + deps.dtypes.cast(epsilonConst, gradient.type()), gradient, ApplyAdaMax.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Ftrl.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Ftrl.java index 962b64bab8e..ad97573f586 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Ftrl.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Ftrl.java @@ -5,6 +5,7 @@ import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyFtrl; import org.tensorflow.types.family.TType; @@ -238,21 +239,21 @@ private void createFtrlSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable accumSlot = getSlot(variable, ACCUMULATOR).get(); Variable linearSlot = getSlot(variable, LINEAR_ACCUMULATOR).get(); ApplyFtrl.Options options = ApplyFtrl.useLocking(true); - return this.tf.train.applyFtrl( + return deps.train.applyFtrl( variable, accumSlot, // accum linearSlot, // linear gradient, // gradient - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), // lr - tf.dtypes.cast(tf.constant(l1RegularizationStrength), gradient.type()), // l1 - tf.dtypes.cast(tf.constant(l2RegularizationStrength), gradient.type()), // l2 - tf.dtypes.cast( - tf.constant(l2ShrinkageRegularizationStrength), gradient.type()), // l2Shrinkage - tf.dtypes.cast(tf.constant(learningRatePower), gradient.type()), // lrPower + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), // lr + deps.dtypes.cast(deps.constant(l1RegularizationStrength), gradient.type()), // l1 + deps.dtypes.cast(deps.constant(l2RegularizationStrength), gradient.type()), // l2 + deps.dtypes.cast( + deps.constant(l2ShrinkageRegularizationStrength), gradient.type()), // l2Shrinkage + deps.dtypes.cast(deps.constant(learningRatePower), gradient.type()), // lrPower options); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/GradientDescent.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/GradientDescent.java index 7e2ec9593ed..682f128f680 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/GradientDescent.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/GradientDescent.java @@ -18,6 +18,7 @@ import org.tensorflow.Graph; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.train.ApplyGradientDescent; import org.tensorflow.types.family.TType; @@ -65,10 +66,10 @@ public GradientDescent(Graph graph, String name, float learningRate) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { - return tf.train.applyGradientDescent( + protected Op applyDense(Ops deps, Output gradient, Output variable) { + return deps.train.applyGradientDescent( variable, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), gradient, ApplyGradientDescent.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Momentum.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Momentum.java index b1f6ac8f4e5..4de600808cf 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Momentum.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Momentum.java @@ -20,6 +20,7 @@ import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyMomentum; import org.tensorflow.types.family.TType; @@ -130,14 +131,14 @@ private void createMomentumSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable slot = getSlot(variable, MOMENTUM).get(); - return tf.train.applyMomentum( + return deps.train.applyMomentum( variable, slot, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), gradient, - tf.dtypes.cast(tf.constant(momentum), gradient.type()), + deps.dtypes.cast(deps.constant(momentum), gradient.type()), ApplyMomentum.useNesterov(useNesterov), ApplyMomentum.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Nadam.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Nadam.java index f55fb8cdc59..680a6bdcfbc 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Nadam.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Nadam.java @@ -7,6 +7,7 @@ import org.tensorflow.Output; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Assign; import org.tensorflow.op.core.Constant; import org.tensorflow.op.core.Variable; @@ -32,6 +33,7 @@ public class Nadam extends Optimizer { public static final String MOMENTUM = "momentum"; private static final float DECAY_BASE = 0.96f; private static final float DECAY = 0.004f; + /** The learning rate. */ private final float learningRate; @@ -224,53 +226,53 @@ protected Optional prepare(String scopeName) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Class type = gradient.type(); Variable m = getSlot(variable, FIRST_MOMENT).get(); // first Moment Variable v = getSlot(variable, SECOND_MOMENT).get(); // Second Moment // gPrime = grad / coefficients['oneMinusMScheduleNew'] - Operand gPrime = tf.math.div(gradient, tf.dtypes.cast(oneMinusMScheduleNew, type)); + Operand gPrime = deps.math.div(gradient, deps.dtypes.cast(oneMinusMScheduleNew, type)); // mT = (coefficients['beta_1_t'] * m + coefficients['one_minus_beta_1_t'] * grad) Operand mT = - tf.math.add( - tf.math.mul(tf.dtypes.cast(betaOneConst, type), m), - tf.math.mul(tf.dtypes.cast(oneMinusBeta1, type), gradient)); + deps.math.add( + deps.math.mul(deps.dtypes.cast(betaOneConst, type), m), + deps.math.mul(deps.dtypes.cast(oneMinusBeta1, type), gradient)); // mT = state_ops.assign(m, mT, use_locking=self._use_locking) // update m - mT = tf.assign(m, mT, Assign.useLocking(true)); + mT = deps.assign(m, mT, Assign.useLocking(true)); // mTPrime = mT / coefficients['oneMinusMScheduleNext'] - Operand mTPrime = tf.math.div(mT, tf.dtypes.cast(oneMinusMScheduleNext, type)); + Operand mTPrime = deps.math.div(mT, deps.dtypes.cast(oneMinusMScheduleNext, type)); // vT = (coefficients['beta_2_t'] * v + coefficients['one_minus_beta_2_t'] * // math_ops.square(grad)) Operand vT = - tf.math.add( - tf.math.mul(tf.dtypes.cast(betaTwoConst, type), v), - tf.math.mul(tf.dtypes.cast(oneMinusBeta2, type), tf.math.square(gradient))); + deps.math.add( + deps.math.mul(deps.dtypes.cast(betaTwoConst, type), v), + deps.math.mul(deps.dtypes.cast(oneMinusBeta2, type), deps.math.square(gradient))); // vT = state_ops.assign(v, vT, use_locking=self._use_locking) // update v - vT = tf.assign(v, vT, Assign.useLocking(true)); + vT = deps.assign(v, vT, Assign.useLocking(true)); // vTPrime = vT / coefficients['vTPrimeDenominator'] - Operand vTPrime = tf.math.div(vT, tf.dtypes.cast(vTPrimeDenominator, type)); + Operand vTPrime = deps.math.div(vT, deps.dtypes.cast(vTPrimeDenominator, type)); // m_t_bar = (coefficients['oneMinusMT'] * gPrime + coefficients['mT1'] * mTPrime) Operand m_t_bar = - tf.math.add( - tf.math.mul(tf.dtypes.cast(oneMinusMT, type), gPrime), - tf.math.mul(tf.dtypes.cast(mT1, type), mTPrime)); + deps.math.add( + deps.math.mul(deps.dtypes.cast(oneMinusMT, type), gPrime), + deps.math.mul(deps.dtypes.cast(mT1, type), mTPrime)); // varT = var - coefficients['lr_t'] * m_t_bar / (math_ops.sqrt(vTPrime) + // coefficients['epsilon']) Operand varT = - tf.math.sub( + deps.math.sub( variable, - tf.math.div( - tf.math.mul(tf.dtypes.cast(learningRateConst, type), m_t_bar), - tf.math.add(tf.math.sqrt(vTPrime), tf.dtypes.cast(epsilonConst, type)))); + deps.math.div( + deps.math.mul(deps.dtypes.cast(learningRateConst, type), m_t_bar), + deps.math.add(deps.math.sqrt(vTPrime), deps.dtypes.cast(epsilonConst, type)))); - return tf.assign(variable, varT, Assign.useLocking(true)); + return deps.assign(variable, varT, Assign.useLocking(true)); } /** diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizer.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizer.java index b1366146836..4cbee44d226 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizer.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizer.java @@ -26,6 +26,7 @@ import org.tensorflow.Operation; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.OpScope; import org.tensorflow.op.Ops; import org.tensorflow.op.Scope; import org.tensorflow.op.core.NoOp; @@ -36,11 +37,14 @@ public abstract class Optimizer { public static final String VARIABLE_V2 = "VariableV2"; + /** Global state variables */ // TODO make this be used. protected final List> globals; + /** The Graph this optimizer is operating on. */ protected final Graph graph; + /** The ops builder for the graph. */ protected final Ops tf; @@ -167,13 +171,21 @@ public Op applyGradients(List> gradsAndVars, String gradsAndVars.stream().map(GradAndVar::getVariable).collect(Collectors.toList()); createSlots(variables); + List gradients = + gradsAndVars.stream() + .map(GradAndVar::getGradient) + .filter(g -> !g.isClosed()) + .collect(Collectors.toList()); + Ops tfOpsGrads = tf.withControlDependencies(gradients); Optional prepOp = prepare(name + "/prepare"); List updateOps = new ArrayList<>(); prepOp.ifPresent(updateOps::add); for (GradAndVar pair : gradsAndVars) { - updateOps.add(applyDense(pair)); + if (!pair.gradient.isClosed()) { + updateOps.add(applyDense(tfOpsGrads, pair)); + } } return finish(updateOps, name); @@ -258,8 +270,8 @@ protected void createSlots(List> variables) {} * @param the datatype of the gradients and variables. * @return An operand which applies the desired optimizer update to the variable. */ - private Op applyDense(GradAndVar gradVarPair) { - return applyDense(gradVarPair.getGradient(), gradVarPair.getVariable()); + private Op applyDense(Ops opDependencies, GradAndVar gradVarPair) { + return applyDense(opDependencies, gradVarPair.getGradient(), gradVarPair.getVariable()); } /** @@ -270,7 +282,8 @@ private Op applyDense(GradAndVar gradVarPair) { * @param The type of the variable. * @return An operand which applies the desired optimizer update to the variable. */ - protected abstract Op applyDense(Output gradient, Output variable); + protected abstract Op applyDense( + Ops opDependencies, Output gradient, Output variable); /** * Gathers up the update operations into a single op that can be used as a run target. @@ -280,7 +293,7 @@ private Op applyDense(GradAndVar gradVarPair) { * @return A NoOp with a control dependency on each update operation. */ protected Op finish(List updateOperations, String name) { - Scope scope = new Scope(graph); + Scope scope = new OpScope(graph); scope = scope.withName(name); scope = scope.withControlDependencies(updateOperations); return NoOp.create(scope); diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizers.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizers.java index 8d7f9620984..7683bbc5d37 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizers.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/Optimizers.java @@ -1,8 +1,7 @@ package org.tensorflow.framework.optimizers; -import org.tensorflow.Graph; - import java.util.function.Function; +import org.tensorflow.Graph; /** Enumerator used to create a new Optimizer with default parameters. */ public enum Optimizers { diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/RMSProp.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/RMSProp.java index 0d4daf748d4..433f969a0db 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/RMSProp.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/optimizers/RMSProp.java @@ -20,6 +20,7 @@ import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; +import org.tensorflow.op.Ops; import org.tensorflow.op.core.Variable; import org.tensorflow.op.train.ApplyCenteredRmsProp; import org.tensorflow.op.train.ApplyRmsProp; @@ -189,31 +190,31 @@ private void createRMSPropSlot(Output v) { /** {@inheritDoc} */ @Override - protected Op applyDense(Output gradient, Output variable) { + protected Op applyDense(Ops deps, Output gradient, Output variable) { Variable rmsSlot = getSlot(variable, RMS).get(); Variable momentumSlot = getSlot(variable, MOMENTUM).get(); if (centered) { Variable mgSlot = getSlot(variable, MG).get(); - return tf.train.applyCenteredRmsProp( + return deps.train.applyCenteredRmsProp( variable, mgSlot, rmsSlot, momentumSlot, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), - tf.dtypes.cast(tf.constant(decay), gradient.type()), - tf.dtypes.cast(tf.constant(momentum), gradient.type()), - tf.dtypes.cast(tf.constant(epsilon), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(decay), gradient.type()), + deps.dtypes.cast(deps.constant(momentum), gradient.type()), + deps.dtypes.cast(deps.constant(epsilon), gradient.type()), gradient, ApplyCenteredRmsProp.useLocking(true)); } - return tf.train.applyRmsProp( + return deps.train.applyRmsProp( variable, rmsSlot, momentumSlot, - tf.dtypes.cast(tf.constant(learningRate), gradient.type()), - tf.dtypes.cast(tf.constant(decay), gradient.type()), - tf.dtypes.cast(tf.constant(momentum), gradient.type()), - tf.dtypes.cast(tf.constant(epsilon), gradient.type()), + deps.dtypes.cast(deps.constant(learningRate), gradient.type()), + deps.dtypes.cast(deps.constant(decay), gradient.type()), + deps.dtypes.cast(deps.constant(momentum), gradient.type()), + deps.dtypes.cast(deps.constant(epsilon), gradient.type()), gradient, ApplyRmsProp.useLocking(true)); } diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/ShapeUtils.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/ShapeUtils.java index e730c79cfbf..c98fa95937e 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/ShapeUtils.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/ShapeUtils.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.utils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.Session; @@ -24,10 +27,6 @@ import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TIntegral; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** Various methods for processing with Shapes and Operands */ public class ShapeUtils { diff --git a/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/SparseTensor.java b/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/SparseTensor.java index 81d658ff3a5..cc16130e2fb 100644 --- a/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/SparseTensor.java +++ b/tensorflow-framework/src/main/java/org/tensorflow/framework/utils/SparseTensor.java @@ -24,57 +24,58 @@ * This is a helper class that represents a sparse tensor who's attributes may be passed to {@link * SparseOps} methods. * - *

    This class does not inherit from {@link Tensor}, but is merely a place to accumulate the - * properties that are needed for the {@link SparseOps} methods. + *

    This class does not inherit from {@link Tensor}, but is merely a place to accumulate + * the properties that are needed for the {@link SparseOps} methods. * * @param the type of the SparseTensor's values. */ public class SparseTensor { - private final Operand indices; - private final Operand values; - private final Operand denseShape; + private final Operand indices; + private final Operand values; + private final Operand denseShape; - /** - * Creates a SparseTensor - * - * @param indices A 2-D int64 tensor of shape `[N, ndims]`, which specifies the - * indices of the elements in the sparse tensor that contain nonzero values - * @param values A 1-D tensor of any type and shape `[N]`, which supplies the - * values for each element in `indices`. - * @param denseShape A 1-D int64 tensor of shape `[ndims]`, which specifies the - * dense_shape of the sparse tensor - * @throws IllegalArgumentException When building an eager SparseTensor if `dense_shape` is - * unknown or contains unknown elements (None or -1). - */ - public SparseTensor (Operand indices, Operand values, Operand denseShape) { - this.indices = indices; - this.values = values; - this.denseShape = denseShape; - } + /** + * Creates a SparseTensor + * + * @param indices A 2-D int64 tensor of shape `[N, ndims]`, which specifies the indices of the + * elements in the sparse tensor that contain nonzero values + * @param values A 1-D tensor of any type and shape `[N]`, which supplies the values for each + * element in `indices`. + * @param denseShape A 1-D int64 tensor of shape `[ndims]`, which specifies the dense_shape of the + * sparse tensor + * @throws IllegalArgumentException When building an eager SparseTensor if `dense_shape` is + * unknown or contains unknown elements (None or -1). + */ + public SparseTensor(Operand indices, Operand values, Operand denseShape) { + this.indices = indices; + this.values = values; + this.denseShape = denseShape; + } - /** - * Gets the indices for the Sparse Tensor - * @return the indices - */ - public Operand getIndices() { - return indices; - } + /** + * Gets the indices for the Sparse Tensor + * + * @return the indices + */ + public Operand getIndices() { + return indices; + } - /** - * Get the values for the Sparse Tensor - * @return the values - */ - public Operand getValues() { - return values; - } - - /** - * Gets the dense shape for the Sparse Tensor - * - * @return the denseShape - */ - public Operand getDenseShape() { - return denseShape; - } + /** + * Get the values for the Sparse Tensor + * + * @return the values + */ + public Operand getValues() { + return values; + } + /** + * Gets the dense shape for the Sparse Tensor + * + * @return the denseShape + */ + public Operand getDenseShape() { + return denseShape; + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ActivationTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ActivationTest.java new file mode 100644 index 00000000000..327d23f6033 --- /dev/null +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ActivationTest.java @@ -0,0 +1,93 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.framework.activations; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import org.junit.jupiter.api.Test; + +public class ActivationTest { + + /** Test of Activation create method */ + @Test + public void testCreateActivation() { + assertTrue(Activation.create("elu") instanceof ELU); + assertTrue(Activation.create("exponential") instanceof Exponential); + assertTrue(Activation.create("gelu") instanceof GELU); + assertTrue(Activation.create("hard_sigmoid") instanceof HardSigmoid); + assertTrue(Activation.create("linear") instanceof Linear); + assertTrue(Activation.create("relu") instanceof ReLU); + assertTrue(Activation.create("selu") instanceof SELU); + assertTrue(Activation.create("sigmoid") instanceof Sigmoid); + assertTrue(Activation.create("softmax") instanceof Softmax); + assertTrue(Activation.create("softplus") instanceof Softplus); + assertTrue(Activation.create("softsign") instanceof Softsign); + assertTrue(Activation.create("swish") instanceof Swish); + assertTrue(Activation.create("tanh") instanceof Tanh); + } + + /** Test of Activation create method */ + @Test + public void testCreateActivationConfig() { + + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "elu")) + instanceof ELU); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "exponential")) + instanceof Exponential); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "gelu")) + instanceof GELU); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "hard_sigmoid")) + instanceof HardSigmoid); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "linear")) + instanceof Linear); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "relu")) + instanceof ReLU); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "selu")) + instanceof SELU); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "sigmoid")) + instanceof Sigmoid); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "softmax")) + instanceof Softmax); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "softplus")) + instanceof Softplus); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "softsign")) + instanceof Softsign); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "swish")) + instanceof Swish); + assertTrue( + Activation.create(Collections.singletonMap(AbstractActivation.NAME_KEY, "tanh")) + instanceof Tanh); + } + + /** Test of Activation create method */ + @Test + public void testCreateUnknownActivation() { + assertThrows(IllegalArgumentException.class, () -> Activation.create("bogus")); + } +} diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ELUTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ELUTest.java index 9f3fa75e95d..3f54750a0cd 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ELUTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ELUTest.java @@ -14,6 +14,13 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,7 +40,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ELU instance = new ELU<>(); + ELU instance = new ELU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -47,7 +54,7 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ELU instance = new ELU<>(); + ELU instance = new ELU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -61,9 +68,49 @@ public void testAlpha() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ELU instance = new ELU<>(2.0f); + ELU instance = new ELU(2.0f); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(ELU.NAME); + assertTrue(instance instanceof ELU); + + Map config = new HashMap<>(); + config.put("alpha", 2.0f); + config.put(AbstractActivation.NAME_KEY, ELU.NAME); + + instance = Activation.create(config); + assertTrue(instance instanceof ELU); + assertEquals(2.0, ((ELU) instance).getAlpha()); + + instance = Activation.create("elu"); + assertNotNull(instance); + assertEquals(1.0f, ((ELU) instance).getAlpha()); + } + + @Test + public void testGetConfig() { + ELU instance = new ELU(2.0f); + Map config = instance.getConfig(); + assertEquals(ELU.NAME, config.get(AbstractActivation.NAME_KEY)); + assertEquals(2.0f, ((Number) config.get("alpha")).floatValue()); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(AbstractActivation.NAME_KEY, ELU.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put("alpha", 2.0f); + configBadClass.put(AbstractActivation.NAME_KEY, "bogus"); + assertThrows(IllegalArgumentException.class, () -> new ELU(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ExponentialTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ExponentialTest.java index f82c19987d1..6f384ca531f 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ExponentialTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ExponentialTest.java @@ -14,6 +14,14 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +29,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class ExponentialTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -42,7 +49,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Exponential instance = new Exponential<>(); + Exponential instance = new Exponential(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -60,9 +67,38 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Exponential instance = new Exponential<>(); + Exponential instance = new Exponential(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Exponential.NAME); + assertTrue(instance instanceof Exponential); + Exponential exponential = + new Exponential(Collections.singletonMap(Exponential.NAME_KEY, Exponential.NAME)); + assertNotNull(exponential); + } + + @Test + public void testGetConfig() { + Exponential instance = new Exponential(); + assertEquals(Exponential.NAME, instance.getConfig().get(Exponential.NAME_KEY)); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Exponential.NAME_KEY, Exponential.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Exponential.NAME_KEY, "bogus"); + assertThrows(IllegalArgumentException.class, () -> new Exponential(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/GELUTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/GELUTest.java new file mode 100644 index 00000000000..f34344639d8 --- /dev/null +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/GELUTest.java @@ -0,0 +1,148 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.framework.activations; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.tensorflow.Operand; +import org.tensorflow.framework.utils.TestSession; +import org.tensorflow.op.Ops; +import org.tensorflow.types.TFloat64; + +public class GELUTest { + + private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; + + /** Test of GELU call method */ + @Test + public void testCallNoAproximate() { + double[][] input = { + { + 0.18463433217903202, + 0.7748109168364575, + 0.5901821703159541, + 0.11772865177047143, + 0.39442705615436113 + }, + { + 0.14569713527198846, + 0.022968622140421502, + 0.19299343598670116, + 0.8063201076826957, + 0.2908883528612243 + } + }; + + double[][] expected = { + {0.10584016, 0.60495245, 0.42638642, 0.06438094, 0.2577057}, + {0.08128731, 0.011694758, 0.11126418, 0.63696945, 0.178731} + }; + + for (TestSession.Mode tfMode : tfModes) + try (TestSession session = TestSession.createTestSession(tfMode)) { + Ops tf = session.getTF(); + GELU instance = new GELU(); + Operand result = instance.call(tf, tf.constant(input)); + session.evaluate(tf.constant(expected), result); + } + } + + /** Test of GELU call method */ + @Test + public void testCallAproximate() { + double[][] input = { + { + 0.7528694935987742, + 0.9496349687413689, + 0.6676759543267402, + 0.5424082144274655, + 0.16766158529053699 + }, + { + 0.1022611836463726, + 0.7906577638705719, + 0.9607832735098116, + 0.5693112764986582, + 0.731933160073661 + } + }; + + double[][] expected = { + { + 0.5828287788543643, + 0.7869710854047693, + 0.4992606099752831, + 0.38304258917872785, + 0.09499264800335701 + }, + { + 0.055295175281590385, + 0.620923776708609, + 0.798915192168026, + 0.40727355470673604, + 0.5619842135196427 + } + }; + + for (TestSession.Mode tfMode : tfModes) + try (TestSession session = TestSession.createTestSession(tfMode)) { + Ops tf = session.getTF(); + GELU instance = new GELU(true); + Operand result = instance.call(tf, tf.constant(input)); + session.evaluate(tf.constant(expected), result); + } + } + + @Test + public void testConfig() { + Activation instance = Activation.create(GELU.NAME); + assertTrue(instance instanceof GELU); + + Map config = new HashMap<>(); + config.put("name", GELU.NAME); + config.put("approximate", true); + instance = Activation.create(config); + assertNotNull(instance); + assertTrue(((GELU) instance).isApproximate()); + } + + @Test + public void testGetConfig() { + GELU instance = new GELU(true); + Map config = instance.getConfig(); + assertTrue(config.containsKey("approximate")); + assertTrue(config.get("approximate") instanceof Boolean); + assertTrue((Boolean) config.get("approximate")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(GELU.NAME_KEY, GELU.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(GELU.NAME_KEY, "bogus"); + assertThrows(IllegalArgumentException.class, () -> new GELU(configBadClass)); + } +} diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/HardSigmoidTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/HardSigmoidTest.java index 0e32201c3e6..9a059c12756 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/HardSigmoidTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/HardSigmoidTest.java @@ -14,6 +14,14 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +29,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class HardSigmoidTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -33,7 +40,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - HardSigmoid instance = new HardSigmoid<>(); + HardSigmoid instance = new HardSigmoid(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -47,9 +54,38 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - HardSigmoid instance = new HardSigmoid<>(); + HardSigmoid instance = new HardSigmoid(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(HardSigmoid.NAME); + assertTrue(instance instanceof HardSigmoid); + HardSigmoid hardSigmoid = + new HardSigmoid(Collections.singletonMap(HardSigmoid.NAME_KEY, HardSigmoid.NAME)); + assertNotNull(hardSigmoid); + } + + @Test + public void testGetConfig() { + HardSigmoid instance = new HardSigmoid(); + assertEquals(HardSigmoid.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(HardSigmoid.NAME_KEY, HardSigmoid.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(HardSigmoid.NAME_KEY, "bogus"); + assertThrows(IllegalArgumentException.class, () -> new HardSigmoid(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/LinearTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/LinearTest.java index 817940688e8..2541b903bd9 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/LinearTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/LinearTest.java @@ -14,6 +14,14 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -22,7 +30,6 @@ import org.tensorflow.types.TFloat64; import org.tensorflow.types.TInt32; -/** @author Jim Clarke */ public class LinearTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -34,7 +41,7 @@ public void testCallInt() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Linear instance = new Linear<>(); + Linear instance = new Linear(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -48,7 +55,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Linear instance = new Linear<>(); + Linear instance = new Linear(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -62,9 +69,37 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Linear instance = new Linear<>(); + Linear instance = new Linear(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Linear.NAME); + assertTrue(instance instanceof Linear); + Linear linear = new Linear(Collections.singletonMap(Linear.NAME_KEY, Linear.NAME)); + assertNotNull(linear); + } + + @Test + public void testGetConfig() { + Linear instance = new Linear(); + assertEquals(Linear.NAME, instance.getConfig().get(Linear.NAME_KEY)); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Linear.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Linear.NAME_KEY, "bogus"); + assertThrows(IllegalArgumentException.class, () -> new Linear(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ReLUTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ReLUTest.java index 94f803d6b1c..584e674e58e 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ReLUTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/ReLUTest.java @@ -14,6 +14,13 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -24,7 +31,6 @@ import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; -/** @author Jim Clarke */ public class ReLUTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -36,7 +42,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(); + ReLU instance = new ReLU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -50,7 +56,7 @@ public void testCallInt() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(); + ReLU instance = new ReLU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -64,7 +70,7 @@ public void testCallLong() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(); + ReLU instance = new ReLU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -78,7 +84,7 @@ public void testCallFloat16() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(); + ReLU instance = new ReLU(); Operand result = instance.call(tf, tf.dtypes.cast(tf.constant(input), TFloat16.class)); session.evaluate(tf.dtypes.cast(tf.constant(expected), TFloat16.class), result); @@ -93,7 +99,7 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(); + ReLU instance = new ReLU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -106,7 +112,7 @@ public void testAlpha() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(0.5f, ReLU.MAX_VALUE_DEFAULT, ReLU.THRESHOLD_DEFAULT); + ReLU instance = new ReLU(0.5f, ReLU.MAX_VALUE_DEFAULT, ReLU.THRESHOLD_DEFAULT); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -119,7 +125,7 @@ public void testMaxValue() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(ReLU.ALPHA_DEFAULT, 5, ReLU.THRESHOLD_DEFAULT); + ReLU instance = new ReLU(ReLU.ALPHA_DEFAULT, 5, ReLU.THRESHOLD_DEFAULT); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -132,9 +138,52 @@ public void testThreshold() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - ReLU instance = new ReLU<>(ReLU.ALPHA_DEFAULT, ReLU.MAX_VALUE_DEFAULT, 5.0f); + ReLU instance = new ReLU(ReLU.ALPHA_DEFAULT, ReLU.MAX_VALUE_DEFAULT, 5.0f); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(ReLU.NAME); + assertTrue(instance instanceof ReLU); + Map config = new HashMap<>(); + config.put("name", ReLU.NAME); + config.put("alpha", 2.0); + config.put("max_value", 25); + config.put("threshold", .95); + + instance = Activation.create(config); + assertNotNull(instance); + assertEquals(2.0f, ((ReLU) instance).getAlpha()); + assertEquals(25.0f, ((ReLU) instance).getMaxValue()); + assertEquals(.95f, ((ReLU) instance).getThreshold()); + } + + @Test + public void testGetConfig() { + ReLU instance = new ReLU(); + Map config = instance.getConfig(); + assertTrue(config.containsKey("alpha")); + assertEquals(instance.getAlpha(), ((Number) config.get("alpha")).floatValue()); + assertTrue(config.containsKey("max_value")); + assertEquals(instance.getMaxValue(), ((Number) config.get("max_value")).floatValue()); + assertTrue(config.containsKey("threshold")); + assertEquals(instance.getThreshold(), ((Number) config.get("threshold")).floatValue()); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(ReLU.NAME_KEY, ReLU.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(ReLU.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new ReLU(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SELUTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SELUTest.java index df1cfb9bd05..dc9e92709d4 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SELUTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SELUTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SELUTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -35,7 +40,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - SELU instance = new SELU<>(); + SELU instance = new SELU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -58,9 +63,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - SELU instance = new SELU<>(); + SELU instance = new SELU(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(SELU.NAME); + assertTrue(instance instanceof SELU); + } + + @Test + public void testGetConfig() { + SELU instance = new SELU(); + assertEquals(SELU.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(SELU.NAME_KEY, SELU.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(SELU.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new SELU(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SigmoidTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SigmoidTest.java index 0c59eeaba6e..3945b796aff 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SigmoidTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SigmoidTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SigmoidTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -42,7 +47,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Sigmoid instance = new Sigmoid<>(); + Sigmoid instance = new Sigmoid(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -60,9 +65,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Sigmoid instance = new Sigmoid<>(); + Sigmoid instance = new Sigmoid(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Sigmoid.NAME); + assertTrue(instance instanceof Sigmoid); + } + + @Test + public void testGetConfig() { + Sigmoid instance = new Sigmoid(); + assertEquals(Sigmoid.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Sigmoid.NAME_KEY, Sigmoid.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Sigmoid.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Sigmoid(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftmaxTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftmaxTest.java index aeb971905a2..696030cafab 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftmaxTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftmaxTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SoftmaxTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -37,7 +42,7 @@ public void testSoftmaxOpsOperandFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softmax instance = new Softmax<>(); + Softmax instance = new Softmax(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -54,7 +59,7 @@ public void testSoftmaxOpsOperandDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softmax instance = new Softmax<>(); + Softmax instance = new Softmax(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -71,7 +76,7 @@ public void testSoftmaxOpsOperandDoubleNegative() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softmax instance = new Softmax<>(); + Softmax instance = new Softmax(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -88,7 +93,7 @@ public void testSoftmax1D() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softmax instance = new Softmax<>(); + Softmax instance = new Softmax(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } @@ -105,9 +110,35 @@ public void testSoftmax3D() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softmax instance = new Softmax<>(); + Softmax instance = new Softmax(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(tf.constant(expected), result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Softmax.NAME); + assertTrue(instance instanceof Softmax); + } + + @Test + public void testGetConfig() { + Softmax instance = new Softmax(); + assertEquals(Softmax.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Softmax.NAME_KEY, Softmax.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Softmax.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Softmax(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftplusTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftplusTest.java index e896807d9f7..3407b5f7e11 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftplusTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftplusTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SoftplusTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -36,7 +41,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softplus instance = new Softplus<>(); + Softplus instance = new Softplus(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -54,9 +59,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softplus instance = new Softplus<>(); + Softplus instance = new Softplus(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Softplus.NAME); + assertTrue(instance instanceof Softplus); + } + + @Test + public void testGetConfig() { + Softplus instance = new Softplus(); + assertEquals(Softplus.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Softplus.NAME_KEY, Softplus.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Softplus.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Softplus(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftsignTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftsignTest.java index 2f9a17caf59..27d9c4631e4 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftsignTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SoftsignTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SoftsignTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -34,7 +39,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softsign instance = new Softsign<>(); + Softsign instance = new Softsign(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -57,9 +62,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Softsign instance = new Softsign<>(); + Softsign instance = new Softsign(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Softsign.NAME); + assertTrue(instance instanceof Softsign); + } + + @Test + public void testGetConfig() { + Softsign instance = new Softsign(); + assertEquals(Softsign.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Softsign.NAME_KEY, Softsign.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Softsign.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Softsign(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SwishTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SwishTest.java index 8dabfaf379a..4918e04589f 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SwishTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/SwishTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class SwishTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -42,7 +47,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Swish instance = new Swish<>(); + Swish instance = new Swish(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -65,9 +70,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Swish instance = new Swish<>(); + Swish instance = new Swish(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Swish.NAME); + assertTrue(instance instanceof Swish); + } + + @Test + public void testGetConfig() { + Swish instance = new Swish(); + assertEquals(Swish.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Swish.NAME_KEY, Swish.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Swish.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Swish(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/TanhTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/TanhTest.java index 696f96a367e..dc458f6bf52 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/TanhTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/activations/TanhTest.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.activations; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -21,7 +27,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -/** @author Jim Clarke */ public class TanhTest { private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; @@ -42,7 +47,7 @@ public void testCallFloat() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Tanh instance = new Tanh<>(); + Tanh instance = new Tanh(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } @@ -65,9 +70,35 @@ public void testCallDouble() { for (TestSession.Mode tfMode : tfModes) try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Tanh instance = new Tanh<>(); + Tanh instance = new Tanh(); Operand result = instance.call(tf, tf.constant(input)); session.evaluate(expected, result); } } + + @Test + public void testConfig() { + Activation instance = Activation.create(Tanh.NAME); + assertTrue(instance instanceof Tanh); + } + + @Test + public void testGetConfig() { + Tanh instance = new Tanh(); + assertEquals(Tanh.NAME, instance.getConfig().get("name")); + } + + /** Test of Activation create method with bad data */ + @Test + public void testBadConfig() { + + final Map configBadKey = new HashMap<>(); + configBadKey.put("beta", 2.0f); + configBadKey.put(Tanh.NAME_KEY, Tanh.NAME); + assertThrows(IllegalArgumentException.class, () -> Activation.create(configBadKey)); + + final Map configBadClass = new HashMap<>(); + configBadClass.put(Tanh.NAME_KEY, Linear.NAME); + assertThrows(IllegalArgumentException.class, () -> new Tanh(configBadClass)); + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/BatchDatasetTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/BatchDatasetTest.java index 2d282e5dcf7..b17a1d978a7 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/BatchDatasetTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/BatchDatasetTest.java @@ -15,18 +15,17 @@ */ package org.tensorflow.framework.data; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.tensorflow.ndarray.index.Indices.range; + +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.op.Ops; import org.tensorflow.types.TInt32; -import java.util.Arrays; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.tensorflow.ndarray.index.Indices.range; - public class BatchDatasetTest extends DatasetTestBase { @Test @@ -34,19 +33,17 @@ public void testEagerBatchDataset() { Ops tf = Ops.create(); // EVEN BATCH SIZES - Dataset dataset = Dataset - .fromTensorSlices(tf, - Arrays.asList( - tf.constant(testMatrix1), - tf.constant(testMatrix2)), - Arrays.asList(TInt32.class, TInt32.class)) - .batch(2); + Dataset dataset = + Dataset.fromTensorSlices( + tf, + Arrays.asList(tf.constant(testMatrix1), tf.constant(testMatrix2)), + Arrays.asList(TInt32.class, TInt32.class)) + .batch(2); int count = 0; for (List> components : dataset) { - try (TInt32 batch1 = - (TInt32)components.get(0).asTensor(); - TInt32 batch2 = (TInt32)components.get(1).asTensor()) { + try (TInt32 batch1 = (TInt32) components.get(0).asTensor(); + TInt32 batch2 = (TInt32) components.get(1).asTensor()) { assertEquals(testMatrix1.slice(range(count, count + 2)), batch1); assertEquals(testMatrix2.slice(range(count, count + 2)), batch2); @@ -58,20 +55,18 @@ public void testEagerBatchDataset() { @Test public void testDropLastBatch() { Ops tf = Ops.create(); - Dataset dataset = Dataset - .fromTensorSlices(tf, - Arrays.asList( - tf.constant(testMatrix1), - tf.constant(testMatrix2)), - Arrays.asList(TInt32.class, TInt32.class)) - .batch(3, true); + Dataset dataset = + Dataset.fromTensorSlices( + tf, + Arrays.asList(tf.constant(testMatrix1), tf.constant(testMatrix2)), + Arrays.asList(TInt32.class, TInt32.class)) + .batch(3, true); int count = 0; for (List> components : dataset) { - try (TInt32 batch1 = - (TInt32)components.get(0).asTensor(); - TInt32 batch2 = (TInt32)components.get(1).asTensor()) { + try (TInt32 batch1 = (TInt32) components.get(0).asTensor(); + TInt32 batch2 = (TInt32) components.get(1).asTensor()) { assertEquals(testMatrix1.slice(range(count, count + 3)), batch1); assertEquals(testMatrix2.slice(range(count, count + 3)), batch2); @@ -83,33 +78,26 @@ public void testDropLastBatch() { @Test public void testKeepLastBatch() { Ops tf = Ops.create(); - Dataset dataset = Dataset - .fromTensorSlices(tf, - Arrays.asList( - tf.constant(testMatrix1), - tf.constant(testMatrix2)), - Arrays.asList(TInt32.class, TInt32.class)) - .batch(3, false); + Dataset dataset = + Dataset.fromTensorSlices( + tf, + Arrays.asList(tf.constant(testMatrix1), tf.constant(testMatrix2)), + Arrays.asList(TInt32.class, TInt32.class)) + .batch(3, false); int count = 0; boolean foundLastBatch = false; for (List> components : dataset) { - try (TInt32 batch1 = - (TInt32)components.get(0).asTensor(); - TInt32 batch2 = - (TInt32)components.get(1).asTensor();) { + try (TInt32 batch1 = (TInt32) components.get(0).asTensor(); + TInt32 batch2 = (TInt32) components.get(1).asTensor(); ) { if (count == 0) { - assertEquals(testMatrix1.slice(range(count, count + 3)), - batch1); - assertEquals(testMatrix2.slice(range(count, count + 3)), - batch2); + assertEquals(testMatrix1.slice(range(count, count + 3)), batch1); + assertEquals(testMatrix2.slice(range(count, count + 3)), batch2); count += 3; } else { - assertEquals(testMatrix1.slice(range(count, count + 1)), - batch1); - assertEquals(testMatrix2.slice(range(count, count + 1)), - batch2); + assertEquals(testMatrix1.slice(range(count, count + 1)), batch1); + assertEquals(testMatrix2.slice(range(count, count + 1)), batch2); foundLastBatch = true; } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/DatasetIteratorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/DatasetIteratorTest.java index 1f8503829b7..1bbeb1a3f0a 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/DatasetIteratorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/DatasetIteratorTest.java @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test; import org.tensorflow.Graph; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Session; import org.tensorflow.exceptions.TFOutOfRangeException; import org.tensorflow.op.Ops; @@ -51,15 +52,10 @@ public void testGraphIteration() { int batches = 0; while (true) { - try { - List outputs = session.runner().fetch(x).fetch(y).run(); - - try (TInt32 xBatch = (TInt32) outputs.get(0); - TInt32 yBatch = (TInt32) outputs.get(1)) { - assertEquals(testMatrix1.get(batches), xBatch); - assertEquals(testMatrix2.get(batches), yBatch); - batches++; - } + try (Result outputs = session.runner().fetch(x).fetch(y).run()) { + assertEquals(testMatrix1.get(batches), outputs.get(0)); + assertEquals(testMatrix2.get(batches), outputs.get(1)); + batches++; } catch (TFOutOfRangeException e) { break; } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/MapDatasetTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/MapDatasetTest.java index afa38e04ee8..e75bdde766e 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/MapDatasetTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/MapDatasetTest.java @@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test; import org.tensorflow.Graph; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Session; import org.tensorflow.exceptions.TFOutOfRangeException; import org.tensorflow.ndarray.IntNdArray; @@ -76,17 +77,11 @@ public void testGraphIteration() { int batches = 0; while (true) { - try { - List outputs = session.runner().fetch(X).fetch(y).run(); + try (Result outputs = session.runner().fetch(X).fetch(y).run()) { + assertEquals(mapped1.get(batches), outputs.get(0)); + assertEquals(mapped2.get(batches), outputs.get(1)); - try (TInt32 XBatch = (TInt32) outputs.get(0); - TInt32 yBatch = (TInt32) outputs.get(1)) { - - assertEquals(mapped1.get(batches), XBatch); - assertEquals(mapped2.get(batches), yBatch); - - batches++; - } + batches++; } catch (TFOutOfRangeException e) { break; } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/SkipDatasetTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/SkipDatasetTest.java index d0cdb4527a5..d8625448034 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/SkipDatasetTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/SkipDatasetTest.java @@ -15,16 +15,15 @@ */ package org.tensorflow.framework.data; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.op.Ops; import org.tensorflow.types.TInt32; -import java.util.Arrays; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - public class SkipDatasetTest extends DatasetTestBase { @Test public void testEagerSkipDataset() { @@ -39,8 +38,8 @@ public void testEagerSkipDataset() { int count = 2; for (List> components : dataset) { - try (TInt32 batch1 = (TInt32)components.get(0).asTensor(); - TInt32 batch2 = (TInt32)components.get(1).asTensor()) { + try (TInt32 batch1 = (TInt32) components.get(0).asTensor(); + TInt32 batch2 = (TInt32) components.get(1).asTensor()) { assertEquals(testMatrix1.get(count), batch1); assertEquals(testMatrix2.get(count), batch2); count++; diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/TakeDatasetTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/TakeDatasetTest.java index 79a2e79c72e..5fb0c3b2dff 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/data/TakeDatasetTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/data/TakeDatasetTest.java @@ -15,16 +15,15 @@ */ package org.tensorflow.framework.data; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.op.Ops; import org.tensorflow.types.TInt32; -import java.util.Arrays; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - public class TakeDatasetTest extends DatasetTestBase { @Test @@ -40,8 +39,8 @@ public void testEagerTakeDataset() { int count = 0; for (List> components : dataset) { - try (TInt32 batch1 = (TInt32)components.get(0).asTensor(); - TInt32 batch2 = (TInt32)components.get(1).asTensor()) { + try (TInt32 batch1 = (TInt32) components.get(0).asTensor(); + TInt32 batch2 = (TInt32) components.get(1).asTensor()) { assertEquals(testMatrix1.get(count), batch1); assertEquals(testMatrix2.get(count), batch2); count++; diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/losses/CategoricalCrossentropyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/losses/CategoricalCrossentropyTest.java index 25f5e5a54f1..1be85927d4f 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/losses/CategoricalCrossentropyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/losses/CategoricalCrossentropyTest.java @@ -17,10 +17,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; +import org.tensorflow.Graph; import org.tensorflow.Operand; +import org.tensorflow.Session; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffers; import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Placeholder; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -36,16 +40,8 @@ public void testAllCorrectUnweighted() { try (TestSession testSession = TestSession.createTestSession(tfMode)) { Ops tf = testSession.getTF(); - long[] trueArray = { - 1L, 0L, 0L, - 0L, 1L, 0L, - 0L, 0L, 1L - }; - float[] predArray = { - 1.F, 0.F, 0.F, - 0.F, 1.F, 0.F, - 0.F, 0.F, 1.F - }; + long[] trueArray = {1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L}; + float[] predArray = {1.F, 0.F, 0.F, 0.F, 1.F, 0.F, 0.F, 0.F, 1.F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand yPred = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(3, 3))); CategoricalCrossentropy instance = new CategoricalCrossentropy(); @@ -55,11 +51,7 @@ public void testAllCorrectUnweighted() { testSession.evaluate(expected, loss); // Test with logits. - float[] logitsArray = { - 10.F, 0.F, 0.F, - 0.F, 10.F, 0.F, - 0.F, 0.F, 10.F - }; + float[] logitsArray = {10.F, 0.F, 0.F, 0.F, 10.F, 0.F, 0.F, 0.F, 10.F}; yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(3, 3))); @@ -85,11 +77,7 @@ public void testInvalidPredictionsRange() { Ops tf = testSession.getTF(); CategoricalCrossentropy instance = new CategoricalCrossentropy(); - float[] trueArray = { - 1L, 0L, 0L, - 0L, 1L, 0L, - 0L, 0L, 1L - }; + float[] trueArray = {1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L}; float[] predArray = {-1.F, 0.F, 0.F, 0.F, 1.F, 0.F, 0.F, 0.F, 1.F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); @@ -111,11 +99,7 @@ public void testUnweighted() { CategoricalCrossentropy instance = new CategoricalCrossentropy(); int[] trueArray = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - float[] predArray = { - .9F, .05F, .05F, - .5F, .89F, .6F, - .05F, .01F, .94F - }; + float[] predArray = {.9F, .05F, .05F, .5F, .89F, .6F, .05F, .01F, .94F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand yPred = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(3, 3))); Operand loss = instance.call(tf, yTrue, yPred); @@ -123,11 +107,7 @@ public void testUnweighted() { testSession.evaluate(expected, loss); // Test with logits. - float[] logitsArray = { - 8.F, 1.F, 1.F, - 0.F, 9.F, 1.F, - 2.F, 3.F, 5.F - }; + float[] logitsArray = {8.F, 1.F, 1.F, 0.F, 9.F, 1.F, 2.F, 3.F, 5.F}; Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(3, 3))); instance = new CategoricalCrossentropy(true); @@ -145,16 +125,8 @@ public void testScalarWeighted() { try (TestSession testSession = TestSession.createTestSession(tfMode)) { Ops tf = testSession.getTF(); - int[] trueArray = { - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 - }; - float[] predArray = { - .9F, .05F, .05F, - .5F, .89F, .6F, - .05F, .01F, .94F - }; + int[] trueArray = {1, 0, 0, 0, 1, 0, 0, 0, 1}; + float[] predArray = {.9F, .05F, .05F, .5F, .89F, .6F, .05F, .01F, .94F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand yPred = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(3, 3))); Operand sampleWeight = tf.constant(2.3F); @@ -166,11 +138,7 @@ public void testScalarWeighted() { testSession.evaluate(expected, loss); // Test with logits. - float[] logitsArray = { - 8.F, 1.F, 1.F, - 0.F, 9.F, 1.F, - 2.F, 3.F, 5.F - }; + float[] logitsArray = {8.F, 1.F, 1.F, 0.F, 9.F, 1.F, 2.F, 3.F, 5.F}; Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(3, 3))); instance = new CategoricalCrossentropy(true); @@ -189,16 +157,8 @@ public void testSsampleWeighted() { CategoricalCrossentropy instance = new CategoricalCrossentropy(); float[] sampeWeightArray = {1.2F, 3.4F, 5.6F}; - int[] trueArray = { - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 - }; - float[] predArray = { - .9F, .05F, .05F, - .5F, .89F, .6F, - .05F, .01F, .94F - }; + int[] trueArray = {1, 0, 0, 0, 1, 0, 0, 0, 1}; + float[] predArray = {.9F, .05F, .05F, .5F, .89F, .6F, .05F, .01F, .94F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand yPred = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(3, 3))); Operand sampleWeight = @@ -208,11 +168,7 @@ public void testSsampleWeighted() { testSession.evaluate(expected, loss); // Test with logits. - float[] logitsArray = { - 8.F, 1.F, 1.F, - 0.F, 9.F, 1.F, - 2.F, 3.F, 5.F - }; + float[] logitsArray = {8.F, 1.F, 1.F, 0.F, 9.F, 1.F, 2.F, 3.F, 5.F}; Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(3, 3))); instance = new CategoricalCrossentropy(true); @@ -231,11 +187,7 @@ public void testNoReduction() { // Test with logits. int[] trueArray = {1, 0, 0, 0, 1, 0, 0, 0, 1}; - float[] logitsArray = { - 8.F, 1.F, 1.F, - 0.F, 9.F, 1.F, - 2.F, 3.F, 5.F - }; + float[] logitsArray = {8.F, 1.F, 1.F, 0.F, 9.F, 1.F, 2.F, 3.F, 5.F}; Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(3, 3))); Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(3, 3))); @@ -266,4 +218,34 @@ public void testLabelSmoothing() { testSession.evaluate(expected, loss); } } + + @Test + public void testCategoricalCrossEntopyWithDynamicBatchSize() { + try (Graph graph = new Graph()) { + Ops tf = Ops.create(graph); + Operand yPred = tf.placeholder(TFloat32.class, Placeholder.shape(Shape.of(-1, 3))); + Operand yTrue = + tf.reshape(tf.constant(new float[] {1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 1f}), tf.array(3, 3)); + CategoricalCrossentropy instance = new CategoricalCrossentropy(true); + Operand loss = + instance.call(tf, yTrue, yPred); // Throw TFInvalidArgument Exception without fix + try (Session session = new Session(graph); + TFloat32 result = + (TFloat32) + session + .runner() + .feed( + yPred, + TFloat32.tensorOf( + Shape.of(3, 3), + DataBuffers.of( + new float[] {1.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 1.f}))) + .fetch(loss) + .run() + .get(0)) { + if (Math.abs(0.5514477f - result.getFloat()) > 0.01) + throw new IllegalStateException("Invalid result :" + result.getFloat()); + } + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AUCTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AUCTest.java index ae40074f3f6..e4f486b8a08 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AUCTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AUCTest.java @@ -45,20 +45,18 @@ public void testValueIsIdempotent() { Ops tf = session.getTF(); Operand yPred = tf.constant(predArray); Operand yTrue = tf.constant(trueArray); - AUC instance = new AUC<>(tf, numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(numThresholds, 1001L, TFloat32.class); - session.initialize(); - - Op update = instance.updateState(yTrue, yPred, null); + Op update = instance.updateState(tf, yTrue, yPred, null); for (int i = 0; i < 10; i++) { session.run(update); } - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); for (int i = 0; i < 10; i++) { - session.evaluate(result, instance.result()); + session.evaluate(result, instance.result(tf, TFloat32.class)); } } } @@ -75,7 +73,7 @@ public void testCumulative() { Ops tf = session.getTF(); Operand yPred = tf.constant(predArray); Operand yTrue = tf.constant(trueArray); - AUC instance = new AUC<>(tf, numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(numThresholds, 1001L, TFloat32.class); session.initialize(); @@ -85,7 +83,7 @@ public void testCumulative() { assertNull(instance.getFalseNegatives()); for (int i = 0; i < 3; i++) { - Op update = instance.updateState(yTrue, yPred, null); + Op update = instance.updateState(tf, yTrue, yPred, null); session.run(update); session.evaluate(tp[i], instance.getTruePositives()); session.evaluate(fp[i], instance.getFalsePositives()); @@ -94,9 +92,9 @@ public void testCumulative() { } // test reset - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); for (int i = 0; i < 3; i++) { - Op update = instance.updateState(yTrue, yPred, null); + Op update = instance.updateState(tf, yTrue, yPred, null); session.run(update); session.evaluate(tp[i], instance.getTruePositives()); session.evaluate(fp[i], instance.getFalsePositives()); @@ -110,7 +108,7 @@ public void testCumulative() { public void basicTestSampleWeight() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - AUC instance = new AUC<>(tf, numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(numThresholds, 1001L, TFloat32.class); assertEquals(numThresholds, instance.getNumThresholds()); float[] expectedThresholds = new float[] {-1e-7f, 0.5f, 1 + 1e-7f}; assertArrayEquals(expectedThresholds, instance.getThresholds(), epsilon); @@ -119,9 +117,9 @@ public void basicTestSampleWeight() { Operand yTrue = tf.constant(new float[] {0f, 0.5f, 0.3f, 0.9f}); Operand sampleWeights = tf.constant(new float[] {1, 0, 0, 1}); - Op update = instance.updateState(yTrue, yPred, sampleWeights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWeights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(1.0f, result); } } @@ -131,12 +129,12 @@ public void testUnweightedAllCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Operand yTrue = cast(tf, tf.constant(this.trueArray), TFloat32.class); - AUC instance = new AUC<>(tf, this.numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(this.numThresholds, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yTrue, null); + Op update = instance.updateState(tf, yTrue, yTrue, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(1f, result); } @@ -148,11 +146,11 @@ public void testUnweighted() { Ops tf = session.getTF(); Operand yPred = tf.constant(this.predArray); Operand yTrue = tf.constant(this.trueArray); - AUC instance = new AUC<>(tf, this.numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(this.numThresholds, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, null); + Op update = instance.updateState(tf, yTrue, yPred, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); // float expectedResult = (0.75f * 1 + 0.25f * 0); session.evaluate(0.75f, result); @@ -165,13 +163,13 @@ public void testManualThresholds() { Ops tf = session.getTF(); Operand yPred = tf.constant(this.predArray); Operand yTrue = tf.constant(this.trueArray); - AUC instance = new AUC<>(tf, new float[] {0.5f}, 1001L, TFloat32.class); + AUC instance = new AUC<>(new float[] {0.5f}, 1001L, TFloat32.class); float[] expectedThresholds = new float[] {-AUC.EPSILON, 0.5f, 1 + AUC.EPSILON}; assertArrayEquals(expectedThresholds, instance.getThresholds(), epsilon); session.initialize(); - Op update = instance.updateState(yTrue, yPred, null); + Op update = instance.updateState(tf, yTrue, yPred, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); // float expectedResult = (0.75f * 1 + 0.25f * 0); session.evaluate(0.75f, result); @@ -186,11 +184,11 @@ public void testWeightedRocInterpolation() { Operand yTrue = tf.constant(this.trueArray); Operand sampleWights = tf.constant(this.sampleWeight); - AUC instance = new AUC<>(tf, this.numThresholds, 1001L, TFloat32.class); + AUC instance = new AUC<>(this.numThresholds, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = (0.78571427f * 1 + 0.2857145f * 0); session.evaluate(expectedResult, result); @@ -207,16 +205,11 @@ public void testWeightedRocMajoring() { AUC instance = new AUC<>( - tf, - this.numThresholds, - AUCCurve.ROC, - AUCSummationMethod.MAJORING, - 1001L, - TFloat32.class); + this.numThresholds, AUCCurve.ROC, AUCSummationMethod.MAJORING, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = (1.0f + .5714285f * 0f); session.evaluate(expectedResult, result); @@ -233,16 +226,11 @@ public void testWeightedRocMinoring() { AUC instance = new AUC<>( - tf, - this.numThresholds, - AUCCurve.ROC, - AUCSummationMethod.MINORING, - 1001L, - TFloat32.class); + this.numThresholds, AUCCurve.ROC, AUCSummationMethod.MINORING, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = (0.5714285f + 0f * 0f); session.evaluate(expectedResult, result); @@ -259,16 +247,11 @@ public void testWeightedPrMajoring() { AUC instance = new AUC<>( - tf, - this.numThresholds, - AUCCurve.PR, - AUCSummationMethod.MAJORING, - 1001L, - TFloat32.class); + this.numThresholds, AUCCurve.PR, AUCSummationMethod.MAJORING, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = 0.4285715f + 0.5714285f; session.evaluate(expectedResult, result); } @@ -284,16 +267,11 @@ public void testWeightedPrMinoring() { AUC instance = new AUC<>( - tf, - this.numThresholds, - AUCCurve.PR, - AUCSummationMethod.MINORING, - 1001L, - TFloat32.class); + this.numThresholds, AUCCurve.PR, AUCSummationMethod.MINORING, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = 0.7f * 0.4285715f + 0f * 0.5714285f; session.evaluate(expectedResult, result); } @@ -307,12 +285,11 @@ public void testWeightedPrInterpolation() { Operand yTrue = tf.constant(this.trueArray); Operand sampleWights = tf.constant(this.sampleWeight); - AUC instance = - new AUC<>(tf, this.numThresholds, AUCCurve.PR, 1001L, TFloat32.class); + AUC instance = new AUC<>(this.numThresholds, AUCCurve.PR, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(yTrue, yPred, sampleWights); + Op update = instance.updateState(tf, yTrue, yPred, sampleWights); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = 0.916613f; session.evaluate(expectedResult, result); } @@ -320,24 +297,13 @@ public void testWeightedPrInterpolation() { @Test public void testInvalidNumThresholds() { - assertThrows( - IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - - new AUC<>(tf, -1, 1001L, TFloat32.class); - } - }); + assertThrows(IllegalArgumentException.class, () -> new AUC<>(-1, 1001L, TFloat32.class)); } @Test public void testExtraDims() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - // logits = scipy.special.expit(-np.array([[[-10., 10., -10.], [10., -10., 10.]], - // [[-12., 12., -12.], [12., -12., 12.]]], - // dtype=np.float32)) float[][][] logitsArray = { { {9.99954602e-01f, 4.53978687e-05f, 9.99954602e-01f}, @@ -357,13 +323,26 @@ public void testExtraDims() { Operand logits = tf.constant(logitsArray); Operand labels = tf.constant(labelArray); - AUC instance = new AUC<>(tf, 1001L, TFloat32.class); + AUC instance = new AUC<>(1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(labels, logits, null); + Op update = instance.updateState(tf, labels, logits, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expectedResult = 0.5f; session.evaluate(expectedResult, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + AUC instance = new AUC<>(1001L, TFloat32.class); + Operand yPred = tf.constant(this.predArray); + Operand yTrue = tf.constant(this.trueArray); + assertThrows( + IllegalArgumentException.class, () -> instance.updateState(tf, yTrue, yPred, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AccuracyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AccuracyTest.java index 48cac95b8a6..1af3100641b 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AccuracyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/AccuracyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -31,18 +33,17 @@ public class AccuracyTest { public void testCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Accuracy instance = new Accuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Accuracy instance = new Accuracy<>(1001L, TFloat32.class); int[] trueArray = {1, 2, 3, 4}; float[] predArray = {1, 2, 3, 4}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 1))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(4, 1))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(4F, total); session.evaluate(4, count); session.evaluate(1F, result); @@ -53,8 +54,7 @@ public void testCorrect() { public void testSampleWeight() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Accuracy instance = new Accuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Accuracy instance = new Accuracy<>(1001L, TFloat32.class); float[] trueArray = {2, 1}; float[] predArray = {2, 0}; @@ -64,12 +64,12 @@ public void testSampleWeight() { Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(.5F, total); session.evaluate(.7, count); session.evaluate(0.71428573f, result); @@ -80,51 +80,59 @@ public void testSampleWeight() { public void testVariableState() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Accuracy instance = new Accuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Accuracy instance = new Accuracy<>(1001L, TFloat32.class); float[] trueArray = {2, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 1))); Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, labels, sampleWeight); + Op op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); // 2nd run - op = instance.updateState(labels, labels, sampleWeight); + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(1.4F, total); session.evaluate(1.4, count); session.evaluate(1.0F, result); // new instance same graph - instance = new Accuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); - op = instance.updateState(labels, labels, sampleWeight); + instance = new Accuracy<>(1001L, TFloat32.class); + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); total = instance.getTotal(); count = instance.getCount(); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); // reset variables - session.run(instance.resetStates()); - result = instance.result(); - op = instance.updateState(labels, labels, sampleWeight); + session.run(instance.resetStates(tf)); + result = instance.result(tf, TFloat32.class); + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Accuracy instance = new Accuracy<>(1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryAccuracyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryAccuracyTest.java index d203815f4ab..691c2ab9cce 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryAccuracyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryAccuracyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -31,18 +33,17 @@ public class BinaryAccuracyTest { public void testCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - BinaryAccuracy instance = new BinaryAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + BinaryAccuracy instance = new BinaryAccuracy<>(1001L, TFloat32.class); int[] trueArray = {1, 0}; float[] predArray = {1, 0}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 1))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(2F, total); session.evaluate(2, count); session.evaluate(1F, result); @@ -53,18 +54,17 @@ public void testCorrect() { public void testPredictionSqueeze() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - BinaryAccuracy instance = new BinaryAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + BinaryAccuracy instance = new BinaryAccuracy<>(1001L, TFloat32.class); int[] trueArray = {1, 0}; float[] predArray = {1, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 1))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 1, 1))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(2F, total); session.evaluate(4, count); session.evaluate(0.5F, result); @@ -75,8 +75,8 @@ public void testPredictionSqueeze() { public void testSampleWeight() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - BinaryAccuracy instance = new BinaryAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + BinaryAccuracy instance = new BinaryAccuracy<>(1001L, TFloat32.class); + int[] trueArray = {1, 1}; float[] predArray = {1, 0}; @@ -86,11 +86,11 @@ public void testSampleWeight() { Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.5F, total); session.evaluate(.7, count); session.evaluate(0.71428573f, result); @@ -101,50 +101,50 @@ public void testSampleWeight() { public void testVariableState() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - BinaryAccuracy instance = new BinaryAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + BinaryAccuracy instance = new BinaryAccuracy<>(1001L, TFloat32.class); + float[] trueArray = {2, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 1))); Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, labels, sampleWeight); + Op op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.2F, total); session.evaluate(.7, count); session.evaluate(0.2857143F, result); // 2nd run - op = instance.updateState(labels, labels, sampleWeight); + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(0.4F, total); session.evaluate(1.4, count); session.evaluate(0.2857143F, result); // new instance same graph - instance = new BinaryAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); - op = instance.updateState(labels, labels, sampleWeight); + instance = new BinaryAccuracy<>(1001L, TFloat32.class); + + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); total = instance.getTotal(); count = instance.getCount(); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(0.2F, total); session.evaluate(.7, count); session.evaluate(0.2857143F, result); // reset variables - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(0.0, total); session.evaluate(0.0, count); - op = instance.updateState(labels, labels, sampleWeight); + op = instance.updateState(tf, labels, labels, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(0.2F, total); session.evaluate(.7, count); session.evaluate(0.2857143F, result); @@ -155,22 +155,32 @@ public void testVariableState() { public void testBinaryAccuracyAThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - BinaryAccuracy instance = new BinaryAccuracy<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + BinaryAccuracy instance = new BinaryAccuracy<>(0.7f, 1001L, TFloat32.class); + int[] trueArray = {1, 1, 0, 0}; float[] predArray = {0.9f, 0.6f, 0.4f, 0.8f}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 1))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(4, 1))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(2F, total); session.evaluate(4, count); session.evaluate(0.5F, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + BinaryAccuracy instance = new BinaryAccuracy<>(1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryCrossentropyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryCrossentropyTest.java index be46bb5c282..8ca0c12462d 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryCrossentropyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/BinaryCrossentropyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,18 +35,18 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); BinaryCrossentropy instance = - new BinaryCrossentropy<>(tf, "BCE_testUnweighted", false, 0, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new BinaryCrossentropy<>("BCE_testUnweighted", false, 0, 1001L, TFloat64.class); + float[] trueArray = {1, 0, 1, 0}; float[] predictionArray = {1, 1, 1, 0}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 2))); Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(2, 2))); - Op op = instance.updateState(labels, yPrediction, null); + Op op = instance.updateState(tf, labels, yPrediction, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.71247434F, total); session.evaluate(2, count); session.evaluate(3.85623717F, result); @@ -56,17 +58,17 @@ public void testUnweightedLogits() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); BinaryCrossentropy instance = - new BinaryCrossentropy<>(tf, "BCE_testUnweightedLogits", true, 0, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new BinaryCrossentropy<>("BCE_testUnweightedLogits", true, 0, 1001L, TFloat64.class); + float[] trueArray = {1, 0, 1, 0, 1, 1}; double[] logitsArray = {100.0, -100.0, 100.0, 100.0, 100.0, -100.0}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, logits, null); + Op op = instance.updateState(tf, labels, logits, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(66.66667, total); session.evaluate(2, count); session.evaluate(33.333332, result); @@ -78,20 +80,20 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); BinaryCrossentropy instance = - new BinaryCrossentropy<>(tf, "BCE_testWeighted", false, 0, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new BinaryCrossentropy<>("BCE_testWeighted", false, 0, 1001L, TFloat32.class); + int[] trueArray = {1, 0, 1, 0}; float[] predictionArray = {1, 1, 1, 0}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 2))); Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(2, 2))); Operand sampleWeight = tf.constant(new float[] {1.5f, 2.f}); - Op op = instance.updateState(labels, yPrediction, sampleWeight); + Op op = instance.updateState(tf, labels, yPrediction, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(11.499929f, total); session.evaluate(3.5f, count); session.evaluate(3.285694f, result); @@ -103,20 +105,20 @@ public void testWeightedLogits() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); BinaryCrossentropy instance = - new BinaryCrossentropy<>(tf, "BCE_testWeightedLogits", true, 0, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new BinaryCrossentropy<>("BCE_testWeightedLogits", true, 0, 1001L, TFloat64.class); + float[] trueArray = {1, 0, 1, 0, 1, 1}; double[] logitsArray = {100.0, -100.0, 100.0, 100.0, 100.0, -100.0}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new double[] {2, 2.5}); - Op op = instance.updateState(labels, logits, sampleWeight); + Op op = instance.updateState(tf, labels, logits, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(166.66666, total); session.evaluate(4.5, count); session.evaluate(37.037033, result); @@ -130,22 +132,35 @@ public void testLabelSmoothing() { float labelSmoothing = 0.1F; BinaryCrossentropy instance = new BinaryCrossentropy<>( - tf, "BCE_testWeightedLabS", true, labelSmoothing, 1001L, TFloat64.class); - session.run(instance.resetStates()); + "BCE_testWeightedLabS", true, labelSmoothing, 1001L, TFloat64.class); + float[] trueArray = {1, 0, 1}; double[] logitsArray = {100., -100., -100.}; Operand labels = tf.constant(trueArray); Operand logits = tf.constant(logitsArray); - Op op = instance.updateState(labels, logits, null); + Op op = instance.updateState(tf, labels, logits, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(35, total); session.evaluate(1, count); session.evaluate(35, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + float labelSmoothing = 0.1F; + BinaryCrossentropy instance = + new BinaryCrossentropy<>( + "BCE_testWeightedLabS", true, labelSmoothing, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalAccuracyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalAccuracyTest.java index aea2e4e0d6e..c57b39db158 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalAccuracyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalAccuracyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -31,8 +33,7 @@ public class CategoricalAccuracyTest { public void testCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - CategoricalAccuracy instance = new CategoricalAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + CategoricalAccuracy instance = new CategoricalAccuracy<>(1001L, TFloat32.class); int[] trueArray = { 0, 0, 1, 0, 1, 0 @@ -44,11 +45,11 @@ public void testCorrect() { Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(2F, total); session.evaluate(2, count); session.evaluate(1F, result); @@ -59,8 +60,7 @@ public void testCorrect() { public void testSampleWeight() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - CategoricalAccuracy instance = new CategoricalAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + CategoricalAccuracy instance = new CategoricalAccuracy<>(1001L, TFloat32.class); int[] trueArray = { 0, 0, 1, 0, 1, 0 @@ -75,11 +75,11 @@ public void testSampleWeight() { Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); @@ -90,8 +90,7 @@ public void testSampleWeight() { public void testVariableState() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - CategoricalAccuracy instance = new CategoricalAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + CategoricalAccuracy instance = new CategoricalAccuracy<>(1001L, TFloat32.class); int[] trueArray = { 0, 0, 1, 0, 1, 0 @@ -107,29 +106,28 @@ public void testVariableState() { Operand sampleWeight = tf.reshape(tf.constant(new float[] {.5F, .2F}), tf.constant(Shape.of(2, 1))); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); // 2nd run - op = instance.updateState(labels, predictions, sampleWeight); + op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(1.4F, total); session.evaluate(1.4, count); session.evaluate(1.0F, result); // new instance same graph - instance = new CategoricalAccuracy<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); - op = instance.updateState(labels, predictions, sampleWeight); + instance = new CategoricalAccuracy<>(1001L, TFloat32.class); + op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); total = instance.getTotal(); count = instance.getCount(); session.evaluate(0.7F, total); @@ -137,17 +135,28 @@ public void testVariableState() { session.evaluate(1.0F, result); // reset variables - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(0, total); session.evaluate(0, count); session.evaluate(0, result); - op = instance.updateState(labels, predictions, sampleWeight); + op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat32.class); session.evaluate(0.7F, total); session.evaluate(.7, count); session.evaluate(1.0F, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + float labelSmoothing = 0.1F; + CategoricalAccuracy instance = new CategoricalAccuracy<>(1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalCrossentropyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalCrossentropyTest.java index 34fc3eef884..fb77efa9fa7 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalCrossentropyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalCrossentropyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,19 +34,17 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CategoricalCrossentropy instance = - new CategoricalCrossentropy<>( - tf, "CCE_testUnweighted", false, 0, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new CategoricalCrossentropy<>("CCE_testUnweighted", false, 0, -1, 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 0, 0, 1}; double[] predArray = {0.05, 0.95, 0, 0.1, 0.8, 0.1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2.3538785, total); session.evaluate(2, count); session.evaluate(1.1769392, result); @@ -57,18 +57,17 @@ public void testUnweightedLogits() { Ops tf = session.getTF(); CategoricalCrossentropy instance = new CategoricalCrossentropy<>( - tf, "CCE_testUnweightedLogits", true, 0, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + "CCE_testUnweightedLogits", true, 0, -1, 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 0, 0, 1}; double[] predArray = {1, 9, 0, 1, 8, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.0022807, total); session.evaluate(2, count); session.evaluate(3.5011404, result); @@ -80,20 +79,18 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CategoricalCrossentropy instance = - new CategoricalCrossentropy<>( - tf, "CCE_testWeighted", false, 0, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new CategoricalCrossentropy<>("CCE_testWeighted", false, 0, -1, 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 0, 0, 1}; double[] predArray = {0.05f, 0.95f, 0f, 0.1f, 0.8f, 0.1f}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new double[] {1.5f, 2.}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(4.6821095, total); session.evaluate(3.5, count); session.evaluate(1.3377455, result); @@ -105,19 +102,18 @@ public void testWeightedLogits() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CategoricalCrossentropy instance = - new CategoricalCrossentropy<>(tf, "CCE_testWeighted", true, 0, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new CategoricalCrossentropy<>("CCE_testWeighted", true, 0, -1, 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 0, 0, 1}; double[] predArray = {1, 9, 0, 1, 8, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new double[] {1.5, 2.f}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(14.004333, total); session.evaluate(3.5, count); session.evaluate(4.0012328, result); @@ -131,21 +127,31 @@ public void testLabelSmoothing() { float labelSmoothing = 0.1F; CategoricalCrossentropy instance = new CategoricalCrossentropy<>( - tf, "CCE_testWeighted", true, labelSmoothing, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + "CCE_testWeighted", true, labelSmoothing, -1, 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 0, 0, 1}; double[] predArray = {1, 9, 0, 1, 8, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.3356137, total); session.evaluate(2, count); session.evaluate(3.6678069, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + CategoricalCrossentropy instance = + new CategoricalCrossentropy<>("CCE_testWeighted", false, 0, -1, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalHingeTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalHingeTest.java index 78b25a21b60..728242eb59a 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalHingeTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CategoricalHingeTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,8 +34,7 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CategoricalHinge instance = - new CategoricalHinge<>(tf, "CH_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new CategoricalHinge<>("CH_testUnweighted", 1001L, TFloat64.class); int[] trueArray = { 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, @@ -49,11 +50,11 @@ public void testUnweighted() { Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 5))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(4, 5))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2., total); session.evaluate(4, count); session.evaluate(0.5, result); @@ -65,8 +66,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CategoricalHinge instance = - new CategoricalHinge<>(tf, "CH_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new CategoricalHinge<>("CH_testWeighted", 1001L, TFloat64.class); int[] trueArray = { 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, @@ -84,14 +84,24 @@ public void testWeighted() { tf.reshape(tf.constant(predArray), tf.constant(Shape.of(4, 5))); Operand sampleWeight = tf.constant(new double[] {1., 1.5, 2., 2.5}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(3.5F, total); session.evaluate(7, count); session.evaluate(0.5, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + CategoricalHinge instance = new CategoricalHinge<>(null, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CosineSimilarityTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CosineSimilarityTest.java index 18410416c42..f40e0647dcb 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CosineSimilarityTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/CosineSimilarityTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,18 +34,17 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CosineSimilarity instance = - new CosineSimilarity<>(tf, "CS_testUnweighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); + new CosineSimilarity<>("CS_testUnweighted", 1001L, TFloat32.class); int[] trueArray = {1, 9, 2, -5, -2, 6}; float[] predArray = {4, 8, 12, 8, 1, 3}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.3744381F, total); session.evaluate(2, count); session.evaluate(0.18721905F, result); @@ -55,8 +56,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); CosineSimilarity instance = - new CosineSimilarity<>(tf, "CS_testWeighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); + new CosineSimilarity<>("CS_testWeighted", 1001L, TFloat32.class); int[] trueArray = {1, 9, 2, -5, -2, 6}; float[] predArray = {4, 8, 12, 8, 1, 3}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); @@ -64,11 +64,11 @@ public void testWeighted() { tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new float[] {1.2f, 3.4f}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(-0.3119840621948241F, total); session.evaluate(4.6, count); session.evaluate(-0.06782262221626612F, result); @@ -81,21 +81,30 @@ public void test_axis() { Ops tf = session.getTF(); int axis = 1; CosineSimilarity instance = - new CosineSimilarity<>(tf, "CS_testWeighted", axis, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new CosineSimilarity<>("CS_testWeighted", axis, 1001L, TFloat32.class); int[] trueArray = {1, 9, 2, -5, -2, 6}; float[] predArray = {4, 8, 12, 8, 1, 3}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.3744381F, total); session.evaluate(2, count); session.evaluate(0.18721905F, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + CosineSimilarity instance = new CosineSimilarity<>(null, 1, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalseNegativesTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalseNegativesTest.java index 4bd8d99586e..34e41f50fa3 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalseNegativesTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalseNegativesTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -45,11 +47,10 @@ public void testUnweighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); - FalseNegatives instance = new FalseNegatives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + FalseNegatives instance = new FalseNegatives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(3.0, result); } @@ -63,11 +64,10 @@ public void testWeighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); Operand sampleWeight = tf.constant(this.sampleWeightArray); - FalseNegatives instance = new FalseNegatives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + FalseNegatives instance = new FalseNegatives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(5.0, result); } @@ -95,11 +95,10 @@ public void testUnweightedWithThresholds() { {1, 1, 1, 1} }); FalseNegatives instance = - new FalseNegatives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + new FalseNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float[] expected = new float[] {1.f, 4.f, 6.f}; session.evaluate(expected, result); } @@ -129,13 +128,23 @@ public void testWeightedWithThresholds() { Operand sampleWeight = tf.constant(new double[][] {{3.0}, {5.0}, {7.0}, {4.0}}); FalseNegatives instance = - new FalseNegatives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + new FalseNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected = new double[] {4., 16., 23.}; session.evaluate(expected, result); } } + + /** Test that Eager mode throws IllegalArgument Exception */ + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + FalseNegatives instance = + new FalseNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalsePositivesTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalsePositivesTest.java index 2584c7a3244..a4a105e2dfc 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalsePositivesTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/FalsePositivesTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -45,11 +47,10 @@ public void testUnweighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); - FalsePositives instance = new FalsePositives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + FalsePositives instance = new FalsePositives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.0, result); } @@ -63,11 +64,10 @@ public void testWeighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); Operand sampleWeight = tf.constant(this.sampleWeightArray); - FalsePositives instance = new FalsePositives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + FalsePositives instance = new FalsePositives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(14.0, result); } @@ -95,11 +95,10 @@ public void testUnweightedWithThresholds() { {1, 1, 1, 1} }); FalsePositives instance = - new FalsePositives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + new FalsePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float[] expected = new float[] {7.f, 4.f, 2.f}; session.evaluate(expected, result); } @@ -136,13 +135,22 @@ public void testWeightedWithThresholds() { {19.0, 23.0, 29.0, 31.0} }); FalsePositives instance = - new FalsePositives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + new FalsePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected = new double[] {125., 42., 12.}; session.evaluate(expected, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + FalsePositives instance = + new FalsePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/HingeTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/HingeTest.java index 90531d21fde..cfa22415b73 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/HingeTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/HingeTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,18 +34,17 @@ class HingeTest { public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Hinge instance = new Hinge<>(tf, "Hinge_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + Hinge instance = new Hinge<>("Hinge_testUnweighted", 1001L, TFloat64.class); int[] trueArray = {0, 1, 0, 1, 0, 0, 1, 1}; double[] predArray = {-0.3, 0.2, -0.1, 1.6, -0.25, -1., 0.5, 0.6}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 4))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 4))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(1.0125, total); session.evaluate(2, count); session.evaluate(.5062500, result); @@ -54,29 +55,34 @@ public void testUnweighted() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Hinge instance = new Hinge<>(tf, "Hinge_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + Hinge instance = new Hinge<>("Hinge_testWeighted", 1001L, TFloat64.class); int[] trueArray = { -1, 1, -1, 1, -1, -1, 1, 1 }; - float[] predArray = { - -0.3f, 0.2f, -0.1f, 1.6f, - -0.25f, -1.f, 0.5f, 0.6f - }; + float[] predArray = {-0.3f, 0.2f, -0.1f, 1.6f, -0.25f, -1.f, 0.5f, 0.6f}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 4))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 4))); Operand sampleWeight = tf.constant(new double[] {1.5, 2.}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(1.7250f, total); session.evaluate(3.5, count); session.evaluate(.49285714f, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Hinge instance = new Hinge<>(null, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/KLDivergenceTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/KLDivergenceTest.java index 267578a492c..d14346a3486 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/KLDivergenceTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/KLDivergenceTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,18 +34,17 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); KLDivergence instance = - new KLDivergence<>(tf, "KLD_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new KLDivergence<>("KLD_testUnweighted", 1001L, TFloat64.class); float[][] trueArray = {{.5f, .8f, .12f}, {.7f, .43f, .8f}}; float[][] predArray = {{.4f, .9f, .12f}, {.36f, .3f, .4f}}; Operand labels = tf.constant(trueArray); Operand predictions = tf.constant(predArray); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(1.1921477, total); session.evaluate(2, count); session.evaluate(0.5960738, result); @@ -55,8 +56,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); KLDivergence instance = - new KLDivergence<>(tf, "KLD_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new KLDivergence<>("KLD_testWeighted", 1001L, TFloat64.class); float[] trueArray = { .5f, .8f, .12f, .7f, .43f, .8f @@ -70,14 +70,23 @@ public void testWeighted() { tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new double[][] {{1.2}, {3.4}}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(4.015142, total); session.evaluate(4.6, count); session.evaluate(0.872857, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + KLDivergence instance = new KLDivergence<>(null, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/LogCoshErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/LogCoshErrorTest.java index 1b5b8fb7d49..bc99dcfd085 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/LogCoshErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/LogCoshErrorTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,19 +35,18 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); LogCoshError instance = - new LogCoshError<>(tf, "LogCosh_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new LogCoshError<>("LogCosh_testUnweighted", 1001L, TFloat64.class); float[] trueArray = {1, 9, 2, -5, -2, 6}; float[] predArray = {4, 8, 12, 8, 1, 3}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(4.829245, result); session.evaluate(9.65849, total); session.evaluate(2, count); @@ -57,8 +58,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); LogCoshError instance = - new LogCoshError<>(tf, "LogCosh_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new LogCoshError<>("LogCosh_testWeighted", 1001L, TFloat64.class); int[] trueArray = {1, 9, 2, -5, -2, 6}; float[] predArray = {4, 8, 12, 8, 1, 3}; double[][] sampleArray = {{1.2}, {3.4}}; @@ -67,14 +67,23 @@ public void testWeighted() { tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(sampleArray); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(5.2178759, result); session.evaluate(24.002228, total); session.evaluate(4.6, count); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + LogCoshError instance = new LogCoshError<>(null, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsoluteErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsoluteErrorTest.java index 984895f2ad9..7878fdcf841 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsoluteErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsoluteErrorTest.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,11 +36,9 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanAbsoluteError instance = - new MeanAbsoluteError<>(tf, "MAE_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0f, instance.getTotal()); - session.evaluate(0f, instance.getCount()); - session.evaluate(0.f, instance.getCount()); + new MeanAbsoluteError<>("MAE_testUnweighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -54,16 +55,16 @@ public void testUnweighted() { Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 5))); Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); - Op op = instance.updateState(yTrue, yPrediction, null); + Op op = instance.updateState(tf, yTrue, yPrediction, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2.0, total); session.evaluate(4, count); session.evaluate(0.5, result); - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(0.0, instance.getTotal()); session.evaluate(0, instance.getCount()); session.evaluate(0., instance.getCount()); @@ -75,11 +76,9 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanAbsoluteError instance = - new MeanAbsoluteError<>(tf, "MAE_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0, instance.getTotal()); - session.evaluate(0, instance.getCount()); - session.evaluate(0., instance.getCount()); + new MeanAbsoluteError<>("MAE_testWeighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -98,19 +97,28 @@ public void testWeighted() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); Operand sampleWeight = tf.constant(new double[] {1., 1.5, 2., 2.5}); - Op op = instance.updateState(yTrue, yPrediction, sampleWeight); + Op op = instance.updateState(tf, yTrue, yPrediction, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(3.8, total); session.evaluate(7, count); session.evaluate(0.54285, result); - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(0.0, instance.getTotal()); session.evaluate(0, instance.getCount()); session.evaluate(0., instance.getCount()); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanAbsoluteError instance = new MeanAbsoluteError<>("MAE", 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageErrorTest.java index 0b9e7f6b538..a38095d4cf7 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanAbsolutePercentageErrorTest.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -35,11 +38,9 @@ public void testUnweighted() { session.setEpsilon(1E-6f); Ops tf = session.getTF(); MeanAbsolutePercentageError instance = - new MeanAbsolutePercentageError<>(tf, "MAPE_testUnweighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); - session.evaluate(0.0f, instance.getTotal()); - session.evaluate(0f, instance.getCount()); - session.evaluate(0.f, instance.getCount()); + new MeanAbsolutePercentageError<>("MAPE_testUnweighted", 1001L, TFloat32.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -58,13 +59,13 @@ public void testUnweighted() { Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); - Op op = instance.updateState(yTrue, yPrediction, null); + Op op = instance.updateState(tf, yTrue, yPrediction, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(1.4E9f, total); session.evaluate(4f, count); session.evaluate(35e7f, result); @@ -77,11 +78,9 @@ public void testWeighted() { session.setEpsilon(1E-6f); Ops tf = session.getTF(); MeanAbsolutePercentageError instance = - new MeanAbsolutePercentageError<>(tf, "MAPE_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0, instance.getTotal()); - session.evaluate(0, instance.getCount()); - session.evaluate(0, instance.getCount()); + new MeanAbsolutePercentageError<>("MAPE_testWeighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); long[] trueArray = { 0, 1, 0, 1, 0, @@ -100,16 +99,26 @@ public void testWeighted() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); Operand sampleWeight = tf.constant(new double[] {1.f, 1.5f, 2.f, 2.5f}); - Op op = instance.updateState(yTrue, yPrediction, sampleWeight); + Op op = instance.updateState(tf, yTrue, yPrediction, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2.800000067278928E9, total); session.evaluate(7, count); session.evaluate(4.000000096112754E8, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanAbsolutePercentageError instance = + new MeanAbsolutePercentageError<>("MAPE", 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanIoUTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanIoUTest.java index 686e6371bc0..f055497ff73 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanIoUTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanIoUTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -34,11 +36,10 @@ public void testUnweighted() { Ops tf = session.getTF().withSubScope("testUnweighted"); Operand predictions = tf.constant(new long[] {0, 1, 0, 1}); Operand labels = tf.constant(new long[] {0, 0, 1, 1}); - MeanIoU instance = new MeanIoU<>(tf, numClasses, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double expected_result = (1. / (2. + 2. - 1.) + 1. / (2. + 2. - 1.)) / 2.; session.evaluate(expected_result, result); } @@ -51,11 +52,10 @@ public void testWeighted() { Operand predictions = tf.constant(new long[] {0, 1, 0, 1}); Operand labels = tf.constant(new long[] {0, 0, 1, 1}); Operand sampleWeight = tf.constant(new float[] {0.2f, 0.3f, 0.4f, 0.1f}); - MeanIoU instance = new MeanIoU<>(tf, numClasses, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expected_result = (0.2f / (0.6f + 0.5f - 0.2f) + 0.1f / (0.4f + 0.5f - 0.1f)) / 2f; session.evaluate(expected_result, result); } @@ -69,11 +69,10 @@ public void testMultiDimInput() { Operand predictions = tf.constant(new long[][] {{0, 1}, {0, 1}}); Operand labels = tf.constant(new long[][] {{0, 0}, {1, 1}}); Operand sampleWeight = tf.constant(new float[][] {{0.2f, 0.3f}, {0.4f, 0.1f}}); - MeanIoU instance = new MeanIoU<>(tf, numClasses, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expected_result = (0.2f / (0.6f + 0.5f - 0.2f) + 0.1f / (0.4f + 0.5f - 0.1f)) / 2f; session.evaluate(expected_result, result); } @@ -83,10 +82,9 @@ public void testMultiDimInput() { public void testZeroValidEntries() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF().withSubScope("testZeroValidEntries"); - MeanIoU instance = new MeanIoU<>(tf, numClasses, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Operand result = instance.result(); - session.evaluate(0.0f, result); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat32.class); + Operand result = instance.result(tf, TFloat32.class); + session.evaluate(0f, result); } } @@ -97,13 +95,22 @@ public void testZeroAndNonZeroEntries() { Operand predictions = tf.constant(new float[] {1}); Operand labels = tf.constant(new int[] {1}); - MeanIoU instance = new MeanIoU<>(tf, numClasses, 1001L, TFloat32.class); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat32.class); session.initialize(); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float expected_result = (0f + 1f / (1f + 1f - 1f)) / 1f; session.evaluate(expected_result, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanIoU instance = new MeanIoU<>(numClasses, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanRelativeErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanRelativeErrorTest.java index ce5d87869ee..4504d1437d0 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanRelativeErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanRelativeErrorTest.java @@ -14,6 +14,7 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.tensorflow.framework.utils.CastHelper.cast; import org.junit.jupiter.api.Test; @@ -36,13 +37,10 @@ public void testUnweighted() { Operand predictions = tf.constant(predArray); Operand labels = tf.constant(trueArray); - MeanRelativeError instance = - new MeanRelativeError<>(tf, labels, 1001L, TFloat32.class); - session.initialize(); - session.run(instance.resetStates()); - Op update = instance.updateState(labels, predictions, null); + MeanRelativeError instance = new MeanRelativeError<>(labels, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); double expected_result = 1.25; session.evaluate(expected_result, result); @@ -61,13 +59,10 @@ public void testWeighted() { Operand labels = tf.constant(trueArray); Operand sampleWeight = tf.constant(sampleWeightArray); - MeanRelativeError instance = - new MeanRelativeError<>(tf, labels, 1001L, TFloat32.class); - session.initialize(); - session.run(instance.resetStates()); - Op update = instance.updateState(labels, predictions, sampleWeight); + MeanRelativeError instance = new MeanRelativeError<>(labels, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); double expectedResult = 1.3; session.evaluate(expectedResult, result); @@ -86,15 +81,23 @@ public void testZeroNormalizer() { MeanRelativeError instance = new MeanRelativeError<>( - tf, cast(tf, tf.zerosLike(labels), TFloat32.class), 1001L, TFloat32.class); - session.initialize(); - session.run(instance.resetStates()); - Op update = instance.updateState(labels, predictions, null); + cast(tf, tf.zerosLike(labels), TFloat32.class), 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); double expectedResult = 0; session.evaluate(expectedResult, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanRelativeError instance = + new MeanRelativeError<>(new float[] {0, 0, 0, 0}, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredErrorTest.java index e42052a9ef1..dec3e96787a 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredErrorTest.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -34,11 +37,9 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanSquaredError instance = - new MeanSquaredError<>(tf, "MSE_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0, instance.getTotal()); - session.evaluate(0, instance.getCount()); - session.evaluate(0., instance.getCount()); + new MeanSquaredError<>("MSE_testUnweighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -55,11 +56,11 @@ public void testUnweighted() { Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 5))); Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); - Op op = instance.updateState(yTrue, yPrediction, null); + Op op = instance.updateState(tf, yTrue, yPrediction, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2.0, total); session.evaluate(4, count); session.evaluate(0.5, result); @@ -71,11 +72,9 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanSquaredError instance = - new MeanSquaredError<>(tf, "MSE_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0, instance.getTotal()); - session.evaluate(0, instance.getCount()); - session.evaluate(0., instance.getCount()); + new MeanSquaredError<>("MSE_testWeighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); long[] trueArray = { 0, 1, 0, 1, 0, @@ -94,14 +93,23 @@ public void testWeighted() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); Operand sampleWeight = tf.constant(new double[] {1., 1.5, 2., 2.5}); - Op op = instance.updateState(yTrue, yPrediction, sampleWeight); + Op op = instance.updateState(tf, yTrue, yPrediction, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(3.8, total); session.evaluate(7, count); session.evaluate(0.542857, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanSquaredError instance = new MeanSquaredError<>("MSE", 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicErrorTest.java index e68d63b8778..88d04205c37 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanSquaredLogarithmicErrorTest.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,11 +36,9 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanSquaredLogarithmicError instance = - new MeanSquaredLogarithmicError<>(tf, "MSLE_testUnweighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); - session.evaluate(0.0f, instance.getTotal()); - session.evaluate(0f, instance.getCount()); - session.evaluate(0.f, instance.getCount()); + new MeanSquaredLogarithmicError<>("MSLE_testUnweighted", 1001L, TFloat32.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -54,11 +55,11 @@ public void testUnweighted() { Operand yTrue = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(4, 5))); Operand yPrediction = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); - Op op = instance.updateState(yTrue, yPrediction, null); + Op op = instance.updateState(tf, yTrue, yPrediction, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.96090573f, total); session.evaluate(4f, count); session.evaluate(0.24022f, result); @@ -70,11 +71,9 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); MeanSquaredLogarithmicError instance = - new MeanSquaredLogarithmicError<>(tf, "MSLE_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); - session.evaluate(0.0, instance.getTotal()); - session.evaluate(0, instance.getCount()); - session.evaluate(0., instance.getCount()); + new MeanSquaredLogarithmicError<>("MSLE_testWeighted", 1001L, TFloat64.class); + assertNull(instance.getTotal()); + assertNull(instance.getCount()); int[] trueArray = { 0, 1, 0, 1, 0, @@ -93,14 +92,24 @@ public void testWeighted() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(4, 5))); Operand sampleWeight = tf.constant(new double[] {1., 1.5, 2., 2.5}); - Op op = instance.updateState(yTrue, yPrediction, sampleWeight); + Op op = instance.updateState(tf, yTrue, yPrediction, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(1.8257208, total); session.evaluate(7, count); session.evaluate(0.26082, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanSquaredLogarithmicError instance = + new MeanSquaredLogarithmicError<>("MSLE", 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanTensorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanTensorTest.java index 3fb11f86b45..83db73ab346 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanTensorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/MeanTensorTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -31,18 +33,18 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Operand values = tf.constant(new long[] {100, 40}); - MeanTensor instance = new MeanTensor<>(tf, 1001L, TFloat64.class); + MeanTensor instance = new MeanTensor<>(1001L, TFloat64.class); session.initialize(); - Op update = instance.updateState(values, null); + Op update = instance.updateState(tf, values, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected_result = new double[] {100, 40}; session.evaluate(expected_result, result); session.evaluate(expected_result, instance.getTotal()); session.evaluate(new double[] {1, 1}, instance.getCount()); - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(new double[] {0, 0}, instance.getTotal()); session.evaluate(new double[] {0, 0}, instance.getCount()); } @@ -53,13 +55,13 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Operand values = tf.constant(new long[] {100, 30}); - MeanTensor instance = new MeanTensor<>(tf, 1001L, TFloat64.class); + MeanTensor instance = new MeanTensor<>(1001L, TFloat64.class); session.initialize(); // check scalar weight - Op update = instance.updateState(values, tf.constant(0.5f)); + Op update = instance.updateState(tf, values, tf.constant(0.5f)); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected_result = new double[] {100, 30}; session.evaluate(expected_result, result); session.evaluate(new double[] {50, 15}, instance.getTotal()); @@ -67,9 +69,9 @@ public void testWeighted() { // check weights not scalar and weights rank matches values rank values = tf.constant(new long[] {1, 5}); - update = instance.updateState(values, tf.constant(new double[] {1f, 0.2f})); + update = instance.updateState(tf, values, tf.constant(new double[] {1f, 0.2f})); session.run(update); - result = instance.result(); + result = instance.result(tf, TFloat64.class); expected_result = new double[] {51 / 1.5, 16 / 0.7}; session.evaluate(expected_result, result); session.evaluate(new double[] {51, 16}, instance.getTotal()); @@ -77,9 +79,9 @@ public void testWeighted() { // check weights broadcast values = tf.constant(new long[] {1, 2}); - update = instance.updateState(values, tf.constant(0.5f)); + update = instance.updateState(tf, values, tf.constant(0.5f)); session.run(update); - result = instance.result(); + result = instance.result(tf, TFloat64.class); expected_result = new double[] {51.5 / 2, 17 / 1.2}; session.evaluate(expected_result, result); session.evaluate(new double[] {51.5, 17}, instance.getTotal()); @@ -88,9 +90,9 @@ public void testWeighted() { // check weights squeeze values = tf.constant(new long[] {1, 5}); Operand sampleWeight = tf.constant(new double[][] {{1}, {0.2}}); - update = instance.updateState(values, sampleWeight); + update = instance.updateState(tf, values, sampleWeight); session.run(update); - result = instance.result(); + result = instance.result(tf, TFloat64.class); expected_result = new double[] {52.5 / 3, 18 / 1.4}; session.evaluate(expected_result, result); session.evaluate(new double[] {52.5, 18}, instance.getTotal()); @@ -104,16 +106,25 @@ public void testWeightedExpand() { Ops tf = session.getTF(); // check weights expand - MeanTensor instance = new MeanTensor<>(tf, 1001L, TFloat32.class); + MeanTensor instance = new MeanTensor<>(1001L, TFloat32.class); Operand values = tf.constant(new long[][] {{1}, {5}}); Operand sampleWeight = tf.constant(new float[] {1f, 0.2f}); - Op update = instance.updateState(values, sampleWeight); + Op update = instance.updateState(tf, values, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(tf.constant(new float[][] {{1f}, {5f}}), result); session.evaluate(tf.constant(new float[][] {{1f}, {1f}}), instance.getTotal()); session.evaluate(tf.constant(new float[][] {{1f}, {0.2f}}), instance.getCount()); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + MeanTensor instance = new MeanTensor<>(1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PoissonTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PoissonTest.java index 5631bac15ee..0bd84f81561 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PoissonTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PoissonTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -32,19 +34,17 @@ class PoissonTest { public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Poisson instance = - new Poisson<>(tf, "Poisson_testUnweighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + Poisson instance = new Poisson<>("Poisson_testUnweighted", 1001L, TFloat64.class); int[] trueArray = {4, 8, 12, 8, 1, 3}; float[] predArray = {1, 9, 2, 5, 2, 6}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 3))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(-6.6131644, total); session.evaluate(2, count); session.evaluate(-3.3065822, result); @@ -55,8 +55,7 @@ public void testUnweighted() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Poisson instance = new Poisson<>(tf, "Poisson_testWeighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); + Poisson instance = new Poisson<>("Poisson_testWeighted", 1001L, TFloat32.class); int[] trueArray = {4, 8, 12, 8, 1, 3}; float[] predArray = {1, 9, 2, 5, 2, 6}; @@ -65,14 +64,23 @@ public void testWeighted() { tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new float[] {1.2f, 3.4f}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(-12.29468f, total); session.evaluate(4.6f, count); session.evaluate(-2.6727562f, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Poisson instance = new Poisson<>("Poisson", 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionAtRecallTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionAtRecallTest.java index a817a3dc5df..756a7651363 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionAtRecallTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionAtRecallTest.java @@ -14,21 +14,19 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.Random; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.random.RandomUniform; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; -import java.util.Random; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.tensorflow.framework.utils.CastHelper.cast; - public class PrecisionAtRecallTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; private final Random random = new Random(); @@ -37,24 +35,23 @@ public class PrecisionAtRecallTest { public void testValueIsIdempotent() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - PrecisionAtRecall instance = - new PrecisionAtRecall<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + PrecisionAtRecall instance = new PrecisionAtRecall<>(0.7f, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); for (int i = 0; i < 10; i++) session.run(update); - Operand initialPrecision = instance.result(); + Operand initialPrecision = instance.result(tf, TFloat32.class); - for (int i = 0; i < 10; i++) session.evaluate(initialPrecision, instance.result()); + for (int i = 0; i < 10; i++) + session.evaluate(initialPrecision, instance.result(tf, TFloat32.class)); } } @@ -73,19 +70,17 @@ private int[][] generateRandomArray(int dim1, int dim2) { public void testUnweightedAllCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - PrecisionAtRecall instance = - new PrecisionAtRecall<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + PrecisionAtRecall instance = new PrecisionAtRecall<>(0.7f, 1001L, TFloat32.class); int[][] predArray = generateRandomArray(100, 1); int[][] trueArray = new int[100][1]; // 100,1 System.arraycopy(predArray, 0, trueArray, 0, predArray.length); Operand predictions = cast(tf, tf.constant(predArray), TFloat32.class); Operand labels = cast(tf, tf.constant(trueArray), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1f, precision); } @@ -95,17 +90,15 @@ public void testUnweightedAllCorrect() { public void testUnweightedHighRecall() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - PrecisionAtRecall instance = - new PrecisionAtRecall<>(tf, 0.8f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + PrecisionAtRecall instance = new PrecisionAtRecall<>(0.8f, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.5f, 0.4f, 0.5f, 0.6f, 0.8f, 0.9f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.8f, precision); } @@ -115,17 +108,15 @@ public void testUnweightedHighRecall() { public void testUnweightedLowRecall() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - PrecisionAtRecall instance = - new PrecisionAtRecall<>(tf, 0.4f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + PrecisionAtRecall instance = new PrecisionAtRecall<>(0.4f, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.1f, 0.15f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.5f, precision); } @@ -135,19 +126,17 @@ public void testUnweightedLowRecall() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - PrecisionAtRecall instance = - new PrecisionAtRecall<>(tf, 0.4f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + PrecisionAtRecall instance = new PrecisionAtRecall<>(0.4f, 1001L, TFloat32.class); Operand predictions = tf.constant( new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.01f, 0.02f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); Operand sampleWeight = tf.constant(new float[] {2, 2, 1, 1, 1, 1, 1, 2, 2, 2}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(2.f / 3.f, precision); } @@ -156,24 +145,23 @@ public void testWeighted() { @Test public void testInvalidSensitivity() { assertThrows( - IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new PrecisionAtRecall<>(tf, -1f, 1001L, TFloat32.class); - } - }); + IllegalArgumentException.class, () -> new PrecisionAtRecall<>(-1f, 1001L, TFloat32.class)); } @Test public void testInvalidNumThresholds() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new PrecisionAtRecall<>(tf, 0.7f, -1, 1001L, TFloat32.class); - } - }); + () -> new PrecisionAtRecall<>(0.7f, -1, 1001L, TFloat32.class)); + } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + PrecisionAtRecall instance = + new PrecisionAtRecall<>(0.7f, 9, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionTest.java index cfe5b483e2b..673a563f894 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/PrecisionTest.java @@ -14,13 +14,14 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.random.RandomUniform; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; import org.tensorflow.types.TInt32; @@ -35,25 +36,24 @@ public void testValueIsIdempotent() { Ops tf = session.getTF(); Precision instance = - new Precision<>(tf, new float[] {0.3f, 0.72f}, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new Precision<>(new float[] {0.3f, 0.72f}, 1001L, TFloat64.class); Operand predictions = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1001L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1001L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1001L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1001L, 0L}), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); for (int i = 0; i < 10; i++) { session.run(update); } - Operand initialPrecision = instance.result(); + Operand initialPrecision = instance.result(tf, TFloat64.class); for (int i = 0; i < 10; i++) { - session.evaluate(initialPrecision, instance.result()); + session.evaluate(initialPrecision, instance.result(tf, TFloat64.class)); } } } @@ -62,14 +62,13 @@ public void testValueIsIdempotent() { public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Precision instance = new Precision<>(tf, 1001L, TFloat64.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(1001L, TFloat64.class); Operand predictions = tf.constant(new long[][] {{1, 0, 1, 0}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); session.evaluate(0.5, precision); } } @@ -78,15 +77,18 @@ public void testUnweighted() { public void testUnweightedAllIncorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Precision instance = new Precision<>(tf, 0.5f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(0.5f, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniformInt(tf.constant(Shape.of(100, 1)), tf.constant(0), tf.constant(2)); + tf.random.statelessMultinomial( + tf.constant(new float[][] {{0.5f, 0.5f}}), + tf.constant(100), + tf.constant(new long[] {1001L, 0L}), + TInt32.class); Operand labels = tf.math.sub(tf.constant(1), predictions); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.0f, precision); } } @@ -95,15 +97,14 @@ public void testUnweightedAllIncorrect() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Precision instance = new Precision<>(tf, 1001L, TFloat64.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(1001L, TFloat64.class); Operand predictions = tf.constant(new long[][] {{1, 0, 1, 0}, {1, 0, 1, 0}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0}, {1, 0, 0, 1}}); Operand sampleWeight = tf.constant(new double[][] {{1, 2, 3, 4}, {4, 3, 2, 1}}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); double weightedTP = 3.0f + 4.0f; double weightedPositives = (1.0f + 3.0f) + (4.0f + 2.0f); @@ -117,14 +118,13 @@ public void testWeighted() { public void testDivByZero() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Precision instance = new Precision<>(tf, 1001L, TFloat64.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(1001L, TFloat64.class); Operand predictions = tf.constant(new int[] {0, 0, 0, 0}); Operand labels = tf.constant(new int[] {0, 0, 0, 0}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); session.evaluate(0, precision); } } @@ -134,14 +134,13 @@ public void testUnweightedWithThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Precision instance = - new Precision<>(tf, new float[] {0.5f, 0.7f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new Precision<>(new float[] {0.5f, 0.7f}, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{1f, 0f, 0.6f, 0f}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); float[] expected = new float[] {0.5f, 0.f}; @@ -154,15 +153,14 @@ public void testWeightedWithThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Precision instance = - new Precision<>(tf, new float[] {0.5f, 1.f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new Precision<>(new float[] {0.5f, 1.f}, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{1f, 0f}, {0.6f, 0f}}); Operand labels = tf.constant(new long[][] {{0, 1}, {1, 0}}); Operand sampleWeight = tf.constant(new float[][] {{4, 0}, {3, 1}}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); float weightedTP = 0f + 3.f; float weightedPositives = (0f + 3.f) + (4.f + 0.f); @@ -178,15 +176,14 @@ public void testMultipleUpdates() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); Precision instance = - new Precision<>(tf, new float[] {0.5f, 1.f}, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new Precision<>(new float[] {0.5f, 1.f}, 1001L, TFloat64.class); Operand predictions = tf.constant(new float[][] {{1f, 0f}, {0.6f, 0f}}); Operand labels = tf.constant(new long[][] {{0, 1}, {1, 0}}); Operand sampleWeight = tf.constant(new double[][] {{4, 0}, {3, 1}}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); for (int i = 0; i < 2; i++) session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); double weighted_tp = (0 + 3.) + (0 + 3.); double weighted_positives = ((0 + 3.) + (4. + 0.)) + ((0 + 3.) + (4. + 0.)); @@ -202,13 +199,12 @@ public void testUnweightedTopK() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); // set topK to 3 - Precision instance = new Precision<>(tf, null, 3, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(null, 3, null, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.5f, 0f, 0.2f}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1.0f / 3.0f, precision); } } @@ -218,21 +214,20 @@ public void testWeightedTopK() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); // set topK to 3 - Precision instance = new Precision<>(tf, null, 3, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(null, 3, null, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.2f, 0.1f, 0.4f, 0f, 0.2f}); Operand labels = tf.constant(new long[] {0, 1, 1, 0, 1}); Operand sampleWeight = tf.constant(new float[][] {{1, 4, 2, 3, 5}}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); predictions = tf.constant(new float[][] {{0.2f, 0.6f, 0.4f, 0.2f, 0.2f}}); labels = tf.constant(new long[][] {{1, 0, 1, 1, 1}}); - update = instance.updateState(labels, predictions, tf.constant(3.f)); + update = instance.updateState(tf, labels, predictions, tf.constant(3.f)); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); float tp = (2f + 5f) + (3f + 3f); float predicted_positives = (1f + 2f + 5f) + (3f + 3f + 3f); @@ -246,14 +241,13 @@ public void testUnweightedClassId() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); // set classId to 2 - Precision instance = new Precision<>(tf, null, null, 2, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(null, null, 2, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.6f, 0f, 0.2f}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1, precision); session.evaluate(1, instance.getTruePositives()); @@ -261,9 +255,9 @@ public void testUnweightedClassId() { predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0f, 0f, 0.2f}}); labels = tf.constant(new long[][] {{0, 1, 1, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - precision = instance.result(); + precision = instance.result(tf, TFloat32.class); session.evaluate(1, precision); session.evaluate(1, instance.getTruePositives()); @@ -271,9 +265,9 @@ public void testUnweightedClassId() { predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.6f, 0f, 0.2f}}); labels = tf.constant(new long[][] {{0, 1, 0, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - precision = instance.result(); + precision = instance.result(tf, TFloat32.class); session.evaluate(0.5f, precision); session.evaluate(1, instance.getTruePositives()); @@ -286,14 +280,13 @@ public void testUnweightedTopKAndClassId() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); // set topK and classId to 2 - Precision instance = new Precision<>(tf, null, 2, 2, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(null, 2, 2, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.6f, 0.3f, 0f, 0.2f}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1, precision); session.evaluate(1, instance.getTruePositives()); @@ -301,9 +294,9 @@ public void testUnweightedTopKAndClassId() { predictions = tf.constant(new float[][] {{1f, 1f, 0.9f, 1f, 1f}}); labels = tf.constant(new long[][] {{0, 1, 1, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - precision = instance.result(); + precision = instance.result(tf, TFloat32.class); session.evaluate(1, precision); session.evaluate(1, instance.getTruePositives()); @@ -316,18 +309,26 @@ public void testUnweightedTopKAndThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); // set topK to 2 - Precision instance = new Precision<>(tf, 0.7f, 2, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Precision instance = new Precision<>(0.7f, 2, null, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.8f, 0.6f, 0f, 0.2f}}); Operand labels = tf.constant(new long[][] {{0, 1, 1, 0, 1}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1, precision); session.evaluate(1, instance.getTruePositives()); session.evaluate(0, instance.getFalsePositives()); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Precision instance = new Precision<>(0.7f, 2, null, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallAtPrecisionTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallAtPrecisionTest.java index bd3a5273668..184c42b7326 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallAtPrecisionTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallAtPrecisionTest.java @@ -14,21 +14,19 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.Random; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.random.RandomUniform; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; -import java.util.Random; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.tensorflow.framework.utils.CastHelper.cast; - public class RecallAtPrecisionTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; private final Random random = new Random(); @@ -37,28 +35,26 @@ public class RecallAtPrecisionTest { public void testValueIsIdempotent() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + RecallAtPrecision instance = new RecallAtPrecision<>(0.7f, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); labels = tf.math.mul(labels, tf.constant(2.0f)); - Op update = instance.updateState(labels, predictions); + Op update = instance.updateState(tf, labels, predictions); for (int i = 0; i < 10; i++) { session.run(update); } - Operand initialPrecision = instance.result(); + Operand initialPrecision = instance.result(tf, TFloat32.class); for (int i = 0; i < 10; i++) { - session.evaluate(initialPrecision, instance.result()); + session.evaluate(initialPrecision, instance.result(tf, TFloat32.class)); } } } @@ -78,18 +74,16 @@ private int[][] generateRandomArray(int dim1, int dim2, int maxVal) { public void test_unweighted_all_correct() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + RecallAtPrecision instance = new RecallAtPrecision<>(0.7f, 1001L, TFloat32.class); int[][] predArray = generateRandomArray(100, 1, 2); int[][] trueArray = new int[100][1]; // 100,1 System.arraycopy(predArray, 0, trueArray, 0, predArray.length); Operand predictions = cast(tf, tf.constant(predArray), TFloat32.class); Operand labels = cast(tf, tf.constant(trueArray), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1f, precision); } @@ -99,9 +93,7 @@ public void test_unweighted_all_correct() { public void testUnweightedHighPrecision() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 0.75f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + RecallAtPrecision instance = new RecallAtPrecision<>(0.75f, 1001L, TFloat32.class); Operand predictions = tf.constant( new float[] { @@ -109,10 +101,10 @@ public void testUnweightedHighPrecision() { }); Operand labels = tf.constant(new long[] {0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.5f, precision); } @@ -123,8 +115,7 @@ public void testUnweightedLowPrecision() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 2.0f / 3f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new RecallAtPrecision<>(2.0f / 3f, 1001L, TFloat32.class); Operand predictions = tf.constant( new float[] { @@ -132,10 +123,10 @@ public void testUnweightedLowPrecision() { }); Operand labels = tf.constant(new long[] {0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(5.f / 6f, precision); } @@ -145,18 +136,16 @@ public void testUnweightedLowPrecision() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 0.75f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + RecallAtPrecision instance = new RecallAtPrecision<>(0.75f, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.1f, 0.2f, 0.3f, 0.5f, 0.6f, 0.9f, 0.9f}); Operand labels = tf.constant(new long[] {0, 1, 0, 0, 0, 1, 1}); Operand sampleWeight = tf.constant(new float[] {1, 2, 1, 2, 1, 2, 1}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.6f, precision); } @@ -167,15 +156,14 @@ public void testUnachievablePrecision() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); RecallAtPrecision instance = - new RecallAtPrecision<>(tf, 2.0f / 3f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new RecallAtPrecision<>(2.0f / 3f, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.1f, 0.2f, 0.3f, 0.9f}); Operand labels = tf.constant(new long[] {1, 1, 0, 0}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); // The highest possible precision is 1/2 which is below the required session.evaluate(0f, precision); } @@ -184,24 +172,23 @@ public void testUnachievablePrecision() { @Test public void test_invalid_sensitivity() { assertThrows( - IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new RecallAtPrecision<>(tf, -1f, 1001L, TFloat32.class); - } - }); + IllegalArgumentException.class, () -> new RecallAtPrecision<>(-1f, 1001L, TFloat32.class)); } @Test public void test_invalid_num_thresholds() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new RecallAtPrecision<>(tf, 0.7f, -1, 1001L, TFloat32.class); - } - }); + () -> new RecallAtPrecision<>(0.7f, -1, 1001L, TFloat32.class)); + } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + RecallAtPrecision instance = + new RecallAtPrecision<>(2.0f / 3f, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallTest.java index bd9fbb1ab66..e862ffe280e 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RecallTest.java @@ -14,6 +14,9 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.Random; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -22,8 +25,6 @@ import org.tensorflow.op.Ops; import org.tensorflow.types.TFloat32; -import java.util.Random; - public class RecallTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; private final Random random = new Random(); @@ -32,20 +33,21 @@ public class RecallTest { public void testValueIsIdempotent() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = - new Recall<>(tf, new float[] {0.3f, 0.72f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(new float[] {0.3f, 0.72f}, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniform(tf.constant(Shape.of(10, 3)), TFloat32.class); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform(tf.constant(Shape.of(10, 3)), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); for (int i = 0; i < 10; i++) session.run(update); - Operand initialRecall = instance.result(); - for (int i = 0; i < 10; i++) session.evaluate(initialRecall, instance.result()); + Operand initialRecall = instance.result(tf, TFloat32.class); + for (int i = 0; i < 10; i++) + session.evaluate(initialRecall, instance.result(tf, TFloat32.class)); } } @@ -53,15 +55,14 @@ public void testValueIsIdempotent() { public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{1, 0, 1, 0}}); Operand labels = tf.constant(new float[][] {{0, 1, 1, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5f, instance.result()); + session.evaluate(0.5f, instance.result(tf, TFloat32.class)); } } @@ -80,16 +81,15 @@ private int[][] generateRandomArray(int dim1, int dim2, int maxInt) { public void testUnweightedAllIncorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(1001L, TFloat32.class); int[][] array = generateRandomArray(100, 1, 2); Operand predictions = tf.dtypes.cast(tf.constant(array), TFloat32.class); Operand labels = tf.dtypes.cast(tf.math.sub(tf.constant(1), tf.constant(array)), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.f, instance.result()); + session.evaluate(0.f, instance.result(tf, TFloat32.class)); } } @@ -97,8 +97,7 @@ public void testUnweightedAllIncorrect() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(1001L, TFloat32.class); Operand predictions = tf.constant( new float[][] { @@ -118,14 +117,14 @@ public void testWeighted() { {1, 2, 3, 4}, {4, 3, 2, 1} }); - Op update = instance.updateState(labels, predictions, sampleWeights); + Op update = instance.updateState(tf, labels, predictions, sampleWeights); session.run(update); float weightedTp = 3.0f + 1.0f; float weightedT = (2.0f + 3.0f) + (4.0f + 1.0f); float expectedRecall = weightedTp / weightedT; - session.evaluate(expectedRecall, instance.result()); + session.evaluate(expectedRecall, instance.result(tf, TFloat32.class)); } } @@ -133,16 +132,15 @@ public void testWeighted() { public void testDivByZero() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0, 0, 0, 0}); Operand labels = tf.constant(new float[] {0, 0, 0, 0}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0f, instance.result()); + session.evaluate(0f, instance.result(tf, TFloat32.class)); } } @@ -150,17 +148,16 @@ public void testDivByZero() { public void testUnweightedWithThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, new float[] {0.5f, 0.7f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(new float[] {0.5f, 0.7f}, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{1, 0, 0.6f, 0}}); Operand labels = tf.constant(new float[][] {{0, 1, 1, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); Float[] expected = new Float[] {0.5f, 0f}; - session.evaluate(expected, instance.result()); + session.evaluate(expected, instance.result(tf, TFloat32.class)); } } @@ -168,21 +165,20 @@ public void testUnweightedWithThreshold() { public void testWeightedWithThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, new float[] {0.5f, 1.f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(new float[] {0.5f, 1.f}, 1001L, TFloat32.class); Operand labels = tf.constant(new float[][] {{0, 1}, {1, 0}}); Operand predictions = tf.constant(new float[][] {{1, 0}, {0.6f, 0}}); Operand weights = tf.constant(new float[][] {{1, 4}, {3, 2}}); - Op update = instance.updateState(labels, predictions, weights); + Op update = instance.updateState(tf, labels, predictions, weights); session.run(update); float weightedTp = 0 + 3.f; float weightedPositives = (0 + 3.f) + (4.f + 0.f); float expectedRecall = weightedTp / weightedPositives; float[] expected = new float[] {expectedRecall, 0f}; - session.evaluate(expected, instance.result()); + session.evaluate(expected, instance.result(tf, TFloat32.class)); } } @@ -190,21 +186,20 @@ public void testWeightedWithThreshold() { public void testMultipleUpdates() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, new float[] {0.5f, 1.f}, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(new float[] {0.5f, 1.f}, 1001L, TFloat32.class); Operand labels = tf.constant(new float[][] {{0, 1}, {1, 0}}); Operand predictions = tf.constant(new float[][] {{1, 0}, {0.6f, 0}}); Operand weights = tf.constant(new float[][] {{1, 4}, {3, 2}}); - Op update = instance.updateState(labels, predictions, weights); + Op update = instance.updateState(tf, labels, predictions, weights); for (int i = 0; i < 2; i++) session.run(update); float weightedTp = (0f + 3.f) + (0f + 3.f); float weightedPositives = ((0f + 3.f) + (4.f + 0.f)) + ((0f + 3.f) + (4.f + 0.f)); float expectedRecall = weightedTp / weightedPositives; float[] expected = new float[] {expectedRecall, 0f}; - session.evaluate(expected, instance.result()); + session.evaluate(expected, instance.result(tf, TFloat32.class)); } } @@ -212,16 +207,15 @@ public void testMultipleUpdates() { public void testUnweightedTopK() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, null, null, 3, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(null, null, 3, null, 1001L, TFloat32.class); Operand labels = tf.constant(new float[][] {{0f, 1f, 1f, 0f, 0f}}); Operand predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.5f, 0f, 0.2f}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5f, instance.result()); + session.evaluate(0.5f, instance.result(tf, TFloat32.class)); } } @@ -229,27 +223,26 @@ public void testUnweightedTopK() { public void testWeightedTopK() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, null, null, 3, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(null, null, 3, null, 1001L, TFloat32.class); Operand labels = tf.constant(new float[][] {{0, 1, 1, 0, 1}}); Operand predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.4f, 0f, 0.2f}}); Operand weights = tf.constant(new float[][] {{1, 4, 2, 3, 5}}); - Op update = instance.updateState(labels, predictions, weights); + Op update = instance.updateState(tf, labels, predictions, weights); session.run(update); labels = tf.constant(new float[][] {{1, 0, 1, 1, 1}}); predictions = tf.constant(new float[][] {{0.2f, 0.6f, 0.4f, 0.2f, 0.2f}}); weights = tf.constant(3.f); - update = instance.updateState(labels, predictions, weights); + update = instance.updateState(tf, labels, predictions, weights); session.run(update); float weightedTp = (2 + 5) + (3 + 3); float weightedPositives = (4 + 2 + 5) + (3 + 3 + 3 + 3); float expectedRecall = weightedTp / weightedPositives; - session.evaluate(expectedRecall, instance.result()); + session.evaluate(expectedRecall, instance.result(tf, TFloat32.class)); } } @@ -257,30 +250,29 @@ public void testWeightedTopK() { public void testUnweightedClassId() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, null, null, null, 2, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(null, null, null, 2, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.6f, 0f, 0.2f}}); Operand labels = tf.constant(new float[][] {{0, 1, 1, 0, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(1f, instance.result()); + session.evaluate(1f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(0f, instance.getFalseNegatives()); predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0f, 0f, 0.2f}}); labels = tf.constant(new float[][] {{0, 1, 1, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5f, instance.result()); + session.evaluate(0.5f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(1f, instance.getFalseNegatives()); predictions = tf.constant(new float[][] {{0.2f, 0.1f, 0.6f, 0f, 0.2f}}); labels = tf.constant(new float[][] {{0, 1, 0, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5f, instance.result()); + session.evaluate(0.5f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(1f, instance.getFalseNegatives()); } @@ -290,24 +282,23 @@ public void testUnweightedClassId() { public void testUnweightedTopKAndClassId() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, null, null, 2, 2, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(null, null, 2, 2, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.6f, 0.3f, 0, 0.2f}}); Operand labels = tf.constant(new float[][] {{0, 1, 1, 0, 0}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(1f, instance.result()); + session.evaluate(1f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(0f, instance.getFalseNegatives()); predictions = tf.constant(new float[][] {{1, 1, 0.9f, 1, 1}}); labels = tf.constant(new float[][] {{0, 1, 1, 0, 0}}); - update = instance.updateState(labels, predictions, null); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5f, instance.result()); + session.evaluate(0.5f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(1f, instance.getFalseNegatives()); } @@ -317,17 +308,25 @@ public void testUnweightedTopKAndClassId() { public void testUnweightedTopKAndThreshold() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Recall instance = new Recall<>(tf, null, 0.7f, 2, null, 1001L, TFloat32.class); - session.run(instance.resetStates()); + Recall instance = new Recall<>(null, 0.7f, 2, null, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[][] {{0.2f, 0.8f, 0.6f, 0f, 0.2f}}); Operand labels = tf.constant(new float[][] {{1, 1, 1, 0, 1}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.25f, instance.result()); + session.evaluate(0.25f, instance.result(tf, TFloat32.class)); session.evaluate(1f, instance.getTruePositives()); session.evaluate(3f, instance.getFalseNegatives()); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Recall instance = new Recall<>(null, 0.7f, 2, null, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RootMeanSquaredErrorTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RootMeanSquaredErrorTest.java index c9ced9f5946..116c929a701 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RootMeanSquaredErrorTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/RootMeanSquaredErrorTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -30,18 +32,16 @@ public class RootMeanSquaredErrorTest { public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RootMeanSquaredError instance = - new RootMeanSquaredError<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); + RootMeanSquaredError instance = new RootMeanSquaredError<>(1001L, TFloat32.class); Operand labels = tf.constant(new float[] {2, 4, 6}); Operand predictions = tf.constant(new float[] {1, 3, 2}); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(18, total); session.evaluate(3, count); session.evaluate(Math.sqrt(6), result); @@ -52,21 +52,28 @@ public void testUnweighted() { public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - RootMeanSquaredError instance = - new RootMeanSquaredError<>(tf, 1001L, TFloat64.class); - session.run(instance.resetStates()); + RootMeanSquaredError instance = new RootMeanSquaredError<>(1001L, TFloat64.class); Operand labels = tf.constant(new float[][] {{2, 4, 6, 8}}); Operand predictions = tf.constant(new float[][] {{1, 3, 2, 3}}); Operand sampleWeight = tf.constant(new double[][] {{0, 1, 0, 1}}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(26, total); session.evaluate(2, count); session.evaluate(Math.sqrt(13), result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + RootMeanSquaredError instance = new RootMeanSquaredError<>(1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SensitivityAtSpecificityTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SensitivityAtSpecificityTest.java index a65dc3b53da..179dbf2b9fc 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SensitivityAtSpecificityTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SensitivityAtSpecificityTest.java @@ -14,22 +14,20 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.Random; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.random.RandomUniform; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; import org.tensorflow.types.TInt64; -import java.util.Random; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.tensorflow.framework.utils.CastHelper.cast; - public class SensitivityAtSpecificityTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; private final Random random = new Random(); @@ -39,24 +37,24 @@ public void testValueIsIdempotent() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SensitivityAtSpecificity instance = - new SensitivityAtSpecificity<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SensitivityAtSpecificity<>(0.7f, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); labels = tf.math.mul(labels, tf.constant(2.0f)); // instance.setDebug(session.getGraphSession()); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); for (int i = 0; i < 10; i++) session.run(update); - Operand initialSensitivity = instance.result(); + Operand initialSensitivity = instance.result(tf, TFloat32.class); - for (int i = 0; i < 10; i++) session.evaluate(initialSensitivity, instance.result()); + for (int i = 0; i < 10; i++) + session.evaluate(initialSensitivity, instance.result(tf, TFloat32.class)); // instance.setDebug(null); @@ -79,18 +77,17 @@ public void testUnweightedAllCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SensitivityAtSpecificity instance = - new SensitivityAtSpecificity<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SensitivityAtSpecificity<>(0.7f, 1001L, TFloat32.class); int[][] predArray = generateRandomArray(100, 1); int[][] trueArray = new int[100][1]; // 100,1 System.arraycopy(predArray, 0, trueArray, 0, predArray.length); Operand predictions = cast(tf, tf.constant(predArray), TFloat32.class); Operand labels = cast(tf, tf.constant(trueArray), TFloat32.class); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1f, precision); } @@ -101,16 +98,15 @@ public void testUnweightedHighSpecificity() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SensitivityAtSpecificity instance = - new SensitivityAtSpecificity<>(tf, 0.8f, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SensitivityAtSpecificity<>(0.8f, 1001L, TFloat64.class); Operand predictions = tf.constant(new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.1f, 0.45f, 0.5f, 0.8f, 0.9f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); session.evaluate(0.8, precision); } @@ -121,17 +117,16 @@ public void testUnweightedLowSpecificity() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SensitivityAtSpecificity instance = - new SensitivityAtSpecificity<>(tf, 0.4f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SensitivityAtSpecificity<>(0.4f, 1001L, TFloat32.class); Operand predictions = tf.constant( new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.01f, 0.02f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.6f, precision); } @@ -142,18 +137,17 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SensitivityAtSpecificity instance = - new SensitivityAtSpecificity<>(tf, 0.4f, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SensitivityAtSpecificity<>(0.4f, 1001L, TFloat64.class); Operand predictions = tf.constant( new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.01f, 0.02f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); Operand sampleWeight = tf.constant(new double[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); session.evaluate(0.675, precision); } @@ -163,23 +157,23 @@ public void testWeighted() { public void testInvalidSensitivity() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new SensitivityAtSpecificity<>(tf, -1f, 1001L, TFloat32.class); - } - }); + () -> new SensitivityAtSpecificity<>(-1f, 1001L, TFloat32.class)); } @Test public void testInvalidNumThresholds() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new SensitivityAtSpecificity<>(tf, 0.7f, -1, 1001L, TFloat32.class); - } - }); + () -> new SensitivityAtSpecificity<>(0.7f, -1, 1001L, TFloat32.class)); + } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + SensitivityAtSpecificity instance = + new SensitivityAtSpecificity<>(0.4f, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropyTest.java index 0aece8c8ac9..4ce84a26ac7 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SparseCategoricalCrossentropyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -34,18 +36,17 @@ public void testUnweighted() { Ops tf = session.getTF(); SparseCategoricalCrossentropy instance = new SparseCategoricalCrossentropy<>( - tf, "SCE_testUnweighted", false, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + "SCE_testUnweighted", false, -1, 1001L, TFloat64.class); int[] trueArray = {1, 2}; double[] predictionArray = {0.05, 0.95, 0, 0.1, 0.8, 0.1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2))); Operand predictions = tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(2.3538785, total); session.evaluate(2, count); session.evaluate(1.1769392, result); @@ -57,18 +58,16 @@ public void testUnweightedLogits() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SparseCategoricalCrossentropy instance = - new SparseCategoricalCrossentropy<>( - tf, "SCE_testWeighted", true, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SparseCategoricalCrossentropy<>("SCE_testWeighted", true, -1, 1001L, TFloat64.class); int[] trueArray = {1, 2}; double[] logitsArray = {1, 9, 0, 1, 8, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2))); Operand logits = tf.reshape(tf.constant(logitsArray), tf.constant(Shape.of(2, 3))); - Op op = instance.updateState(labels, logits, null); + Op op = instance.updateState(tf, labels, logits, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.002277, total); session.evaluate(2, count); session.evaluate(3.501135, result); @@ -80,9 +79,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SparseCategoricalCrossentropy instance = - new SparseCategoricalCrossentropy<>( - tf, "SCE_testWeighted", false, -1, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SparseCategoricalCrossentropy<>("SCE_testWeighted", false, -1, 1001L, TFloat32.class); int[] trueArray = {1, 2}; double[] predictionArray = {0.05, 0.95, 0, 0.1, 0.8, 0.1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2))); @@ -90,11 +87,11 @@ public void testWeighted() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new float[] {1.5F, 2.F}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(4.6821103f, total); session.evaluate(3.5f, count); session.evaluate(1.3377458f, result); @@ -106,9 +103,7 @@ public void testWeightedLogits() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SparseCategoricalCrossentropy instance = - new SparseCategoricalCrossentropy<>( - tf, "SCE_testWeighted", true, -1, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SparseCategoricalCrossentropy<>("SCE_testWeighted", true, -1, 1001L, TFloat64.class); int[] trueArray = {1, 2}; double[] predictionArray = {1, 9, 0, 1, 8, 1}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2))); @@ -116,14 +111,24 @@ public void testWeightedLogits() { tf.reshape(tf.constant(predictionArray), tf.constant(Shape.of(2, 3))); Operand sampleWeight = tf.constant(new double[] {1.5, 2}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(14.004333, total); session.evaluate(3.5, count); session.evaluate(4.001232, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + SparseCategoricalCrossentropy instance = + new SparseCategoricalCrossentropy<>("SCE", true, -1, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SpecificityAtSensitivityTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SpecificityAtSensitivityTest.java index ff5834eda8e..6507345bbb4 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SpecificityAtSensitivityTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SpecificityAtSensitivityTest.java @@ -14,23 +14,21 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.tensorflow.framework.utils.CastHelper.cast; + +import java.util.Random; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.Op; import org.tensorflow.op.Ops; -import org.tensorflow.op.random.RandomUniform; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; -import java.util.Random; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.tensorflow.framework.utils.CastHelper.cast; - public class SpecificityAtSensitivityTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; private final Random random = new Random(); @@ -40,24 +38,24 @@ public void testValueIsIdempotent() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SpecificityAtSensitivity instance = - new SpecificityAtSensitivity<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SpecificityAtSensitivity<>(0.7f, 1001L, TFloat32.class); Operand predictions = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); Operand labels = - tf.random.randomUniform( - tf.constant(Shape.of(10, 3)), TFloat32.class, RandomUniform.seed(1L)); + tf.random.statelessRandomUniform( + tf.constant(Shape.of(10, 3)), tf.constant(new long[] {1L, 0L}), TFloat32.class); // instance.setDebug(session.getGraphSession()); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); for (int i = 0; i < 10; i++) session.run(update); - Operand initialSpecificity = instance.result(); + Operand initialSpecificity = instance.result(tf, TFloat32.class); - for (int i = 0; i < 10; i++) session.evaluate(initialSpecificity, instance.result()); + for (int i = 0; i < 10; i++) + session.evaluate(initialSpecificity, instance.result(tf, TFloat32.class)); } } @@ -77,8 +75,7 @@ public void testUnweightedAllCorrect() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SpecificityAtSensitivity instance = - new SpecificityAtSensitivity<>(tf, 0.7f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SpecificityAtSensitivity<>(0.7f, 1001L, TFloat32.class); int[][] predArray = generateRandomArray(100, 1); int[][] trueArray = new int[100][1]; // 100,1 System.arraycopy(predArray, 0, trueArray, 0, predArray.length); @@ -86,10 +83,10 @@ public void testUnweightedAllCorrect() { Operand labels = tf.constant(trueArray); labels = tf.math.mul(labels, tf.constant(2)); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(1f, precision); } @@ -100,16 +97,15 @@ public void testUnweightedHighSensitivity() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SpecificityAtSensitivity instance = - new SpecificityAtSensitivity<>(tf, 0.8f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SpecificityAtSensitivity<>(0.8f, 1001L, TFloat32.class); Operand predictions = tf.constant(new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.1f, 0.45f, 0.5f, 0.8f, 0.9f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.4f, precision); } @@ -120,17 +116,16 @@ public void testUnweightedLowSensitivity() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SpecificityAtSensitivity instance = - new SpecificityAtSensitivity<>(tf, 0.4f, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SpecificityAtSensitivity<>(0.4f, 1001L, TFloat64.class); Operand predictions = tf.constant( new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.01f, 0.02f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat64.class); session.evaluate(0.6f, precision); } @@ -141,18 +136,17 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SpecificityAtSensitivity instance = - new SpecificityAtSensitivity<>(tf, 0.4f, 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SpecificityAtSensitivity<>(0.4f, 1001L, TFloat32.class); Operand predictions = tf.constant( new float[] {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.01f, 0.02f, 0.25f, 0.26f, 0.26f}); Operand labels = tf.constant(new long[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1}); Operand sampleWeight = tf.constant(new float[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand precision = instance.result(); + Operand precision = instance.result(tf, TFloat32.class); session.evaluate(0.4f, precision); } @@ -162,23 +156,23 @@ public void testWeighted() { public void testInvalidSensitivity() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new SpecificityAtSensitivity<>(tf, -1f, 1001L, TFloat32.class); - } - }); + () -> new SpecificityAtSensitivity<>(-1f, 1001L, TFloat32.class)); } @Test public void testInvalidNumThresholds() { assertThrows( IllegalArgumentException.class, - () -> { - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - new SpecificityAtSensitivity<>(tf, 0.4f, -1, 1001L, TFloat32.class); - } - }); + () -> new SpecificityAtSensitivity<>(0.4f, -1, 1001L, TFloat32.class)); + } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + SpecificityAtSensitivity instance = + new SpecificityAtSensitivity<>(0.4f, 1001L, TFloat32.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SquaredHingeTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SquaredHingeTest.java index 2c80b3451ad..b6f0a2956d4 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SquaredHingeTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SquaredHingeTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -33,24 +35,20 @@ public void testUnweighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SquaredHinge instance = - new SquaredHinge<>(tf, "SCE_testUnweighted", 1001L, TFloat32.class); - session.run(instance.resetStates()); + new SquaredHinge<>("SCE_testUnweighted", 1001L, TFloat32.class); int[] trueArray = { 0, 1, 0, 1, 0, 0, 1, 1 }; - float[] predArray = { - -0.3f, 0.2f, -0.1f, 1.6f, - -0.25f, -1.f, 0.5f, 0.6f - }; + float[] predArray = {-0.3f, 0.2f, -0.1f, 1.6f, -0.25f, -1.f, 0.5f, 0.6f}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 4))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 4))); - Op op = instance.updateState(labels, predictions, null); + Op op = instance.updateState(tf, labels, predictions, null); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); session.evaluate(0.72812f, total); session.evaluate(2f, count); session.evaluate(0.3640625f, result); @@ -62,29 +60,34 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); SquaredHinge instance = - new SquaredHinge<>(tf, "SCE_testWeighted", 1001L, TFloat64.class); - session.run(instance.resetStates()); + new SquaredHinge<>("SCE_testWeighted", 1001L, TFloat64.class); int[] trueArray = { 0, 1, 0, 1, 0, 0, 1, 1 }; - double[] predArray = { - -0.3, 0.2, -0.1, 1.6, - -0.25, -1., 0.5, 0.6 - }; + double[] predArray = {-0.3, 0.2, -0.1, 1.6, -0.25, -1., 0.5, 0.6}; Operand labels = tf.reshape(tf.constant(trueArray), tf.constant(Shape.of(2, 4))); Operand predictions = tf.reshape(tf.constant(predArray), tf.constant(Shape.of(2, 4))); Operand sampleWeight = tf.constant(new double[] {1.5f, 2.f}); - Op op = instance.updateState(labels, predictions, sampleWeight); + Op op = instance.updateState(tf, labels, predictions, sampleWeight); session.run(op); Variable total = instance.getTotal(); Variable count = instance.getCount(); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(1.2137499, total); session.evaluate(3.5, count); session.evaluate(0.3467857, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + SquaredHinge instance = new SquaredHinge<>("SCE", 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SumTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SumTest.java index 941f882b8c8..09a35c406db 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SumTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/SumTest.java @@ -14,6 +14,10 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -22,8 +26,6 @@ import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; -import static org.junit.jupiter.api.Assertions.assertEquals; - public class SumTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; @@ -32,22 +34,21 @@ public class SumTest { public void testUnWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Sum instance = new Sum<>(tf, 1001L, TFloat32.class); - session.run(instance.resetStates()); - assertEquals(TFloat32.class, instance.getResultType()); - session.evaluate(0f, instance.getTotal()); + Sum instance = new Sum<>(1001L, TFloat32.class); + assertEquals(TFloat32.class, instance.getInternalType()); + assertNull(instance.getTotal()); - Op update = instance.updateState(tf.constant(100f), null); + Op update = instance.updateState(tf, tf.constant(100f), null); session.run(update); - session.evaluate(100f, instance.result()); + session.evaluate(100f, instance.result(tf, TFloat64.class)); session.evaluate(100f, instance.getTotal()); - update = instance.updateState(tf.constant(new float[] {1, 5}), null); + update = instance.updateState(tf, tf.constant(new float[] {1, 5}), null); session.run(update); - session.evaluate(106f, instance.result()); + session.evaluate(106f, instance.result(tf, TFloat64.class)); session.evaluate(106f, instance.getTotal()); - session.run(instance.resetStates()); + session.run(instance.resetStates(tf)); session.evaluate(0f, instance.getTotal()); } } @@ -56,58 +57,68 @@ public void testUnWeighted() { public void testSumWithSampleWeight() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); - Sum instance = new Sum<>(tf, 1001L, TFloat64.class); - session.run(instance.resetStates()); + Sum instance = new Sum<>(1001L, TFloat64.class); // check scalar weight - Op op = instance.updateState(tf.constant(100f), tf.constant(0.5)); + Op op = instance.updateState(tf, tf.constant(100f), tf.constant(0.5)); session.run(op); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(50.0, instance.getTotal()); session.evaluate(50.0, result); // check weights not scalar and weights rank matches values rank op = - instance.updateState(tf.constant(new float[] {1, 5}), tf.constant(new double[] {1, 0.2})); + instance.updateState( + tf, tf.constant(new float[] {1, 5}), tf.constant(new double[] {1, 0.2})); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat64.class); session.evaluate(52., instance.getTotal()); session.evaluate(52., result); // check weights broadcast - op = instance.updateState(tf.constant(new float[] {1, 2}), tf.constant(0.5)); + op = instance.updateState(tf, tf.constant(new float[] {1, 2}), tf.constant(0.5)); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat64.class); session.evaluate(53.5, instance.getTotal()); session.evaluate(53.5, result); // check weights squeeze op = instance.updateState( - tf.constant(new float[] {1, 5}), tf.constant(new double[][] {{1}, {0.2}})); + tf, tf.constant(new float[] {1, 5}), tf.constant(new double[][] {{1}, {0.2}})); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat64.class); session.evaluate(55.5, instance.getTotal()); session.evaluate(55.5, result); // check weights expand op = instance.updateState( - tf.constant(new float[][] {{1}, {5}}), tf.constant(new double[] {1, 0.2})); + tf, tf.constant(new float[][] {{1}, {5}}), tf.constant(new double[] {1, 0.2})); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat64.class); session.evaluate(57.5, instance.getTotal()); session.evaluate(57.5, result); // heck values reduced to the dimensions of weight op = instance.updateState( + tf, tf.constant(new float[][][] {{{1.f, 2.f}, {3.f, 2.f}, {0.5f, 4.f}}}), tf.constant(new double[] {0.5})); session.run(op); - result = instance.result(); + result = instance.result(tf, TFloat64.class); session.evaluate(63.75, instance.getTotal()); session.evaluate(63.75, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + Sum instance = new Sum<>(1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracyTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracyTest.java index 023796ba367..95e73e5893d 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracyTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TopKCategoricalAccuracyTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -30,23 +32,20 @@ public void testCorrectness() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); TopKCategoricalAccuracy instance = - new TopKCategoricalAccuracy<>(tf, "TopK_testUnweighted", 5, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new TopKCategoricalAccuracy<>("TopK_testUnweighted", 5, 1001L, TFloat64.class); Operand labels = tf.constant(new float[][] {{0, 0, 1}, {0, 1, 0}}); Operand predictions = tf.constant(new double[][] {{0.1f, 0.9f, 0.8f}, {0.05f, 0.95f, 0f}}); - Op update = instance.updateState(labels, predictions, null); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(1., instance.result()); + session.evaluate(1., instance.result(tf, TFloat64.class)); // With `k` < 5. - instance = - new TopKCategoricalAccuracy<>(tf, "TopK_testUnweighted1", 1, 1001L, TFloat64.class); - session.run(instance.resetStates()); - update = instance.updateState(labels, predictions, null); + instance = new TopKCategoricalAccuracy<>("TopK_testUnweighted1", 1, 1001L, TFloat64.class); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5, instance.result()); + session.evaluate(0.5, instance.result(tf, TFloat64.class)); // With `k` > 5. labels = @@ -61,12 +60,10 @@ public void testCorrectness() { {0.5f, 0.9f, 0.1f, 0.7f, 0.6f, 0.5f, 0.4f}, {0.05f, 0.95f, 0f, 0f, 0f, 0f, 0f} }); - instance = - new TopKCategoricalAccuracy<>(tf, "TopK_testUnweighted6", 6, 1001L, TFloat64.class); - session.run(instance.resetStates()); - update = instance.updateState(labels, predictions, null); + instance = new TopKCategoricalAccuracy<>("TopK_testUnweighted6", 6, 1001L, TFloat64.class); + update = instance.updateState(tf, labels, predictions, null); session.run(update); - session.evaluate(0.5, instance.result()); + session.evaluate(0.5, instance.result(tf, TFloat64.class)); } } @@ -75,8 +72,7 @@ public void testWeighted() { try (TestSession session = TestSession.createTestSession(tfMode)) { Ops tf = session.getTF(); TopKCategoricalAccuracy instance = - new TopKCategoricalAccuracy<>(tf, "TopK_testWeighted", 5, 1001L, TFloat64.class); - session.run(instance.resetStates()); + new TopKCategoricalAccuracy<>("TopK_testWeighted", 5, 1001L, TFloat64.class); Operand labels = tf.constant( @@ -95,9 +91,19 @@ public void testWeighted() { Operand sampleWeight = tf.constant(new double[] {1, 0, 1}); - Op update = instance.updateState(labels, predictions, sampleWeight); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - session.evaluate(1., instance.result()); + session.evaluate(1., instance.result(tf, TFloat64.class)); + } + } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + TopKCategoricalAccuracy instance = + new TopKCategoricalAccuracy<>("TopK", 5, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TrueNegativesTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TrueNegativesTest.java index 1a68c2ed8b8..d6cdc51e2fc 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TrueNegativesTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TrueNegativesTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -45,11 +47,10 @@ public void testUnweighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); - TrueNegatives instance = new TrueNegatives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + TrueNegatives instance = new TrueNegatives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(3.0, result); } @@ -63,11 +64,10 @@ public void testWeighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); Operand sampleWeight = tf.constant(this.sampleWeightArray); - TrueNegatives instance = new TrueNegatives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + TrueNegatives instance = new TrueNegatives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(4.0, result); } @@ -95,11 +95,10 @@ public void testUnweightedWithThresholds() { {1, 1, 1, 1} }); TrueNegatives instance = - new TrueNegatives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + new TrueNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float[] expected = new float[] {2.f, 5.f, 7.f}; session.evaluate(expected, result); } @@ -129,13 +128,22 @@ public void testWeightedWithThresholds() { Operand sampleWeight = tf.constant(new double[][] {{0.0, 2.0, 3.0, 5.0}}); TrueNegatives instance = - new TrueNegatives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + new TrueNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected = new double[] {5., 15., 23.}; session.evaluate(expected, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + TrueNegatives instance = + new TrueNegatives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TruePositivesTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TruePositivesTest.java index c22c1245d97..15645355230 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TruePositivesTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/TruePositivesTest.java @@ -14,6 +14,8 @@ =======================================================================*/ package org.tensorflow.framework.metrics; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; import org.tensorflow.framework.utils.TestSession; @@ -45,11 +47,10 @@ public void testUnweighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); - TruePositives instance = new TruePositives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + TruePositives instance = new TruePositives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(7.0, result); } @@ -63,11 +64,10 @@ public void testWeighted() { Operand predictions = tf.constant(this.predArray); Operand labels = tf.constant(this.trueArray); Operand sampleWeight = tf.constant(this.sampleWeightArray); - TruePositives instance = new TruePositives<>(tf, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + TruePositives instance = new TruePositives<>(1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); session.evaluate(12.0, result); } @@ -95,11 +95,10 @@ public void testUnweightedWithThresholds() { {1, 1, 1, 1} }); TruePositives instance = - new TruePositives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, null); + new TruePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat32.class); + Op update = instance.updateState(tf, labels, predictions, null); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat32.class); float[] expected = new float[] {6.f, 3.f, 1.f}; session.evaluate(expected, result); } @@ -129,13 +128,22 @@ public void testWeightedWithThresholds() { Operand sampleWeight = tf.constant(37.); TruePositives instance = - new TruePositives<>(tf, new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); - session.run(instance.getInitializer()); - Op update = instance.updateState(labels, predictions, sampleWeight); + new TruePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + Op update = instance.updateState(tf, labels, predictions, sampleWeight); session.run(update); - Operand result = instance.result(); + Operand result = instance.result(tf, TFloat64.class); double[] expected = new double[] {222., 111., 37.}; session.evaluate(expected, result); } } + + @Test + public void testEagerEnvironment() { + try (TestSession session = TestSession.createTestSession(TestSession.Mode.EAGER)) { + Ops tf = session.getTF(); + TruePositives instance = + new TruePositives<>(new float[] {0.15f, 0.5f, 0.85f}, 1001L, TFloat64.class); + assertThrows(IllegalArgumentException.class, () -> instance.updateState(tf, null, null)); + } + } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/AssertBroadcastableTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/AssertBroadcastableTest.java index 4330fa0aed7..fc1e2fe9573 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/AssertBroadcastableTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/AssertBroadcastableTest.java @@ -14,8 +14,11 @@ =======================================================================*/ package org.tensorflow.framework.metrics.impl; +import static org.junit.jupiter.api.Assertions.assertThrows; + import org.junit.jupiter.api.Test; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Tensor; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.op.Op; @@ -26,10 +29,6 @@ import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertThrows; - public class AssertBroadcastableTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; @@ -69,10 +68,10 @@ private void testValid( Operand weightsPlaceholder = tf.placeholder(type); Operand valuesPlaceholder = tf.placeholder(type); - List tensors = - testSession.getGraphSession().runner().fetch(weights).fetch(values).run(); - try (Tensor weightsTensor = tensors.get(0); - Tensor valuesTensor = tensors.get(1)) { + try (Result tensors = + testSession.getGraphSession().runner().fetch(weights).fetch(values).run()) { + Tensor weightsTensor = tensors.get(0); + Tensor valuesTensor = tensors.get(1); Op dynamicOp = MetricsHelper.assertBroadcastable(tf, weightsPlaceholder, valuesPlaceholder); testSession diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/BroadcastWeightsTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/BroadcastWeightsTest.java index 3322a81fe5b..9df29436e31 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/BroadcastWeightsTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/BroadcastWeightsTest.java @@ -14,8 +14,13 @@ =======================================================================*/ package org.tensorflow.framework.metrics.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.Test; import org.tensorflow.Operand; +import org.tensorflow.Result; import org.tensorflow.Tensor; import org.tensorflow.framework.utils.TestSession; import org.tensorflow.op.Ops; @@ -25,12 +30,6 @@ import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class BroadcastWeightsTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; @@ -78,55 +77,57 @@ private void testValid( Operand weightsPlaceholder = tf.placeholder(type); Operand valuesPlaceholder = tf.placeholder(type); - List tensors = - testSession.getGraphSession().runner().fetch(weights).fetch(values).run(); - try (Tensor weightsTensor = tensors.get(0); - Tensor valuesTensor = tensors.get(1)) { + try (Result tensors = + testSession.getGraphSession().runner().fetch(weights).fetch(values).run()) { + Tensor weightsTensor = tensors.get(0); + Tensor valuesTensor = tensors.get(1); Operand dynamicOp = MetricsHelper.broadcastWeights(tf, weightsPlaceholder, valuesPlaceholder); - List result = + try (Result result = testSession .getGraphSession() .runner() .feed(weightsPlaceholder, weightsTensor) .feed(valuesPlaceholder, valuesTensor) .fetch(dynamicOp) - .run(); - - if (expected != null) { - if (type.equals(TInt32.class)) { - TInt32 intT = (TInt32) result.get(0); - AtomicInteger i = new AtomicInteger(); - intT.scalars() - .forEachIndexed( - (idx, f) -> assertEquals(expected[i.getAndIncrement()].intValue(), f.getInt())); - } else if (type.equals(TInt64.class)) { - TInt64 floatT = (TInt64) result.get(0); - AtomicInteger i = new AtomicInteger(); - floatT - .scalars() - .forEachIndexed( - (idx, f) -> assertEquals(expected[i.getAndIncrement()].longValue(), f.getLong())); - } else if (type.equals(TFloat32.class)) { - TFloat32 floatT = (TFloat32) result.get(0); - AtomicInteger i = new AtomicInteger(); - floatT - .scalars() - .forEachIndexed( - (idx, f) -> - assertEquals( - expected[i.getAndIncrement()].floatValue(), f.getFloat(), 1e-5F)); - } else if (type.equals(TFloat64.class)) { - TFloat64 doubleT = (TFloat64) result.get(0); - AtomicInteger i = new AtomicInteger(); - doubleT - .scalars() - .forEachIndexed( - (idx, f) -> - assertEquals( - expected[i.getAndIncrement()].doubleValue(), f.getDouble(), 1e-5F)); + .run()) { + + if (expected != null) { + if (type.equals(TInt32.class)) { + TInt32 intT = (TInt32) result.get(0); + AtomicInteger i = new AtomicInteger(); + intT.scalars() + .forEachIndexed( + (idx, f) -> assertEquals(expected[i.getAndIncrement()].intValue(), f.getInt())); + } else if (type.equals(TInt64.class)) { + TInt64 floatT = (TInt64) result.get(0); + AtomicInteger i = new AtomicInteger(); + floatT + .scalars() + .forEachIndexed( + (idx, f) -> + assertEquals(expected[i.getAndIncrement()].longValue(), f.getLong())); + } else if (type.equals(TFloat32.class)) { + TFloat32 floatT = (TFloat32) result.get(0); + AtomicInteger i = new AtomicInteger(); + floatT + .scalars() + .forEachIndexed( + (idx, f) -> + assertEquals( + expected[i.getAndIncrement()].floatValue(), f.getFloat(), 1e-5F)); + } else if (type.equals(TFloat64.class)) { + TFloat64 doubleT = (TFloat64) result.get(0); + AtomicInteger i = new AtomicInteger(); + doubleT + .scalars() + .forEachIndexed( + (idx, f) -> + assertEquals( + expected[i.getAndIncrement()].doubleValue(), f.getDouble(), 1e-5F)); + } } } } diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/SetsOpsTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/SetsOpsTest.java deleted file mode 100644 index eceff2797f8..00000000000 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/metrics/impl/SetsOpsTest.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.tensorflow.framework.metrics.impl; - -import org.junit.jupiter.api.Test; -import org.tensorflow.Operand; -import org.tensorflow.framework.utils.TestSession; -import org.tensorflow.ndarray.Shape; -import org.tensorflow.op.Ops; -import org.tensorflow.types.TInt32; -import org.tensorflow.types.TInt64; -import org.tensorflow.types.TUint8; -import org.tensorflow.types.family.TType; - -import java.util.Arrays; -import java.util.List; - -import static org.tensorflow.framework.utils.CastHelper.cast; - -class SetsOpsTest { - - private final TestSession.Mode[] tfModes = {TestSession.Mode.EAGER, TestSession.Mode.GRAPH}; - - List> types = Arrays.asList(TInt32.class, TInt64.class, TUint8.class); - - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) - public void testSetIntersectionMultirow2() { - - for (TestSession.Mode tfMode : tfModes) - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - Operand a = tf.constant(new int[][] {{9, 1, 5}, {2, 4, 3}}); - Operand b = tf.constant(new int[][] {{1, 9}, {1, 5}}); - int[][] expected = new int[][] {{1, 9}, {0, 0}}; - Shape expectedShape = Shape.of(2, 2); - for (Class type : types) { - Operand aa = cast(tf, a, type); - Operand bb = cast(tf, b, type); - Operand intersection = SetsOps.intersection(tf, aa, bb); - session.evaluate(cast(tf, tf.constant(expected), type), intersection); - session.evaluate(tf.constant(expectedShape), tf.shape(intersection, TInt64.class)); - } - } - } - - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) - public void testSetIntersectionDuplicates2d() { - - for (TestSession.Mode tfMode : tfModes) - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - Operand a = tf.constant(new int[][] {{1, 1, 3}}); - Operand b = tf.constant(new int[][] {{1, 1}}); - int[][] expected = {{1}}; - Shape expectedShape = Shape.of(1, 1); - for (Class type : types) { - Operand aa = cast(tf, a, type); - Operand bb = cast(tf, b, type); - Operand intersection = SetsOps.intersection(tf, aa, bb); - - session.evaluate(cast(tf, tf.constant(expected), type), intersection); - - session.evaluate(tf.constant(expectedShape), tf.shape(intersection, TInt64.class)); - } - } - } - - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) - public void testDenseSetDifferenceMultirow2d() { - - for (TestSession.Mode tfMode : tfModes) - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - Operand a = tf.constant(new int[][] {{1, 5, 9}, {4, 5, 3}}); - Operand b = tf.constant(new int[][] {{1, 2, 6}, {1, 2, 2}}); - - for (Class type : types) { - Operand aa = cast(tf, a, type); - Operand bb = cast(tf, b, type); - int[][] expected = {{5, 9, 0}, {3, 4, 5}}; - // a- b - Shape expectedShape = Shape.of(2, 3); - Operand intersection = SetsOps.difference(tf, aa, bb); - session.evaluate(cast(tf, tf.constant(expected), type), intersection); - session.evaluate(tf.constant(expectedShape), tf.shape(intersection, TInt64.class)); - - // b - a - expected = new int[][] {{2, 6}, {1, 2}}; - expectedShape = Shape.of(2, 2); - intersection = SetsOps.difference(tf, aa, bb, false); - - session.evaluate(cast(tf, tf.constant(expected), type), intersection); - session.evaluate(tf.constant(expectedShape), tf.shape(intersection, TInt64.class)); - } - } - } - - @Test - @SuppressWarnings({"unchecked", "rawtypes"}) - public void testDenseUnionMultirow2d() { - - for (TestSession.Mode tfMode : tfModes) - try (TestSession session = TestSession.createTestSession(tfMode)) { - Ops tf = session.getTF(); - Operand a = tf.constant(new int[][] {{9, 1, 5}, {2, 4, 3}}); - Operand b = tf.constant(new int[][] {{1, 9}, {1, 2}}); - int[][] expected = new int[][] {{5, 0}, {3, 4}}; - for (Class type : types) { - Operand aa = cast(tf, a, type); - Operand bb = cast(tf, b, type); - Shape expectedShape = Shape.of(2, 2); - // a- b - Operand intersection = SetsOps.difference(tf, aa, bb); - session.evaluate(cast(tf, tf.constant(expected), type), intersection); - session.evaluate(tf.constant(expectedShape), tf.shape(intersection, TInt64.class)); - } - } - } -} diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/GradientDescentTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/GradientDescentTest.java index 909fd53ca27..90891ee748b 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/GradientDescentTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/GradientDescentTest.java @@ -4,13 +4,14 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.tensorflow.Graph; +import org.tensorflow.Result; import org.tensorflow.Session; import org.tensorflow.Tensor; import org.tensorflow.framework.initializers.Glorot; @@ -26,8 +27,8 @@ import org.tensorflow.op.math.Add; import org.tensorflow.op.math.Mean; import org.tensorflow.op.nn.Relu; -import org.tensorflow.proto.framework.ConfigProto; -import org.tensorflow.proto.framework.GraphDef; +import org.tensorflow.proto.ConfigProto; +import org.tensorflow.proto.GraphDef; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TType; @@ -108,10 +109,6 @@ public void testBasic() { } } - // This test fails due to incorrect gradients being generated some of the time, when - // using an identical graph on identical data. It should not, but it seems to be a - // problem in TF-core. - @Disabled @Test public void testDeterminism() { ConfigProto config = @@ -189,13 +186,18 @@ public void testDeterminism() { g.importGraphDef(def); s.initialize(); - initialized.add( + Result initializationRes = s.runner() .fetch(fcWeightName) .fetch(fcBiasName) .fetch(outputWeightName) .fetch(outputBiasName) - .run()); + .run(); + List initializedRun = new ArrayList<>(); + for (Map.Entry e : initializationRes) { + initializedRun.add(e.getValue()); + } + initialized.add(initializedRun); TFloat32 lossVal = (TFloat32) @@ -209,13 +211,18 @@ public void testDeterminism() { initialLoss[i] = lossVal.getFloat(); lossVal.close(); - trained.add( + Result trainedRes = s.runner() .fetch(fcWeightName) .fetch(fcBiasName) .fetch(outputWeightName) .fetch(outputBiasName) - .run()); + .run(); + List trainedRun = new ArrayList<>(); + for (Map.Entry e : trainedRes) { + trainedRun.add(e.getValue()); + } + trained.add(trainedRun); lossVal = (TFloat32) diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/OptimizersTest.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/OptimizersTest.java index 78b56c8289e..f7eba2e828f 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/OptimizersTest.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/optimizers/OptimizersTest.java @@ -1,11 +1,11 @@ package org.tensorflow.framework.optimizers; +import static org.junit.jupiter.api.Assertions.assertEquals; + import org.junit.jupiter.api.*; import org.tensorflow.Graph; import org.tensorflow.framework.utils.TestSession; -import static org.junit.jupiter.api.Assertions.assertEquals; - public class OptimizersTest { private final TestSession.Mode tfMode = TestSession.Mode.GRAPH; diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/EagerTestSession.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/EagerTestSession.java index 7884308c9fb..59ef1ce302a 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/EagerTestSession.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/EagerTestSession.java @@ -14,6 +14,12 @@ =======================================================================*/ package org.tensorflow.framework.utils; +import static org.junit.jupiter.api.Assertions.*; + +import java.io.PrintWriter; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Predicate; import org.tensorflow.*; import org.tensorflow.ndarray.FloatNdArray; import org.tensorflow.ndarray.IntNdArray; @@ -23,13 +29,6 @@ import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; -import java.io.PrintWriter; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -import java.util.function.Predicate; - -import static org.junit.jupiter.api.Assertions.*; - /** Eager Mode Test Session */ public class EagerTestSession extends TestSession { @@ -296,7 +295,8 @@ public void evaluateString(Output input, Predicate predicate) { if (debug) { if (isScalar) { System.out.printf( - "0). %b <==> %s\n", predicate.test(input.asTensor().getObject()), input.asTensor().getObject()); + "0). %b <==> %s\n", + predicate.test(input.asTensor().getObject()), input.asTensor().getObject()); } else { input .asTensor() @@ -312,7 +312,10 @@ public void evaluateString(Output input, Predicate predicate) { if (isScalar) { assertTrue(predicate.test(input.asTensor().getObject())); } else { - input.asTensor().scalars().forEachIndexed((idx, s) -> assertTrue(predicate.test(s.getObject()))); + input + .asTensor() + .scalars() + .forEachIndexed((idx, s) -> assertTrue(predicate.test(s.getObject()))); } } @@ -351,7 +354,8 @@ public void evaluate(Output input, Predicate predic if (debug) { if (isScalar) { System.out.printf( - "0). %b <==> %f\n", predicate.test(o.asTensor().getDouble()), o.asTensor().getDouble()); + "0). %b <==> %f\n", + predicate.test(o.asTensor().getDouble()), o.asTensor().getDouble()); } else { o.asTensor() .scalars() @@ -657,7 +661,8 @@ public void evaluate(Output expected, Output input) { AtomicInteger index = new AtomicInteger(); if (debug) { if (isScalar) { - System.out.printf("0). %s <==> %s\n", x.asTensor().getObject(), o.asTensor().getObject()); + System.out.printf( + "0). %s <==> %s\n", x.asTensor().getObject(), o.asTensor().getObject()); } else { o.asTensor() .scalars() @@ -682,7 +687,8 @@ public void evaluate(Output expected, Output input) { AtomicInteger index = new AtomicInteger(); if (debug) { if (isScalar) { - System.out.printf("0). %b <==> %b\n", x.asTensor().getBoolean(), o.asTensor().getBoolean()); + System.out.printf( + "0). %b <==> %b\n", x.asTensor().getBoolean(), o.asTensor().getBoolean()); } else { o.asTensor() .scalars() diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/ND.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/ND.java index c0c0f12fbf9..a9d2f39a8fd 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/ND.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/ND.java @@ -14,12 +14,11 @@ =======================================================================*/ package org.tensorflow.framework.utils; -import org.tensorflow.ndarray.*; - import java.util.Arrays; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import org.tensorflow.ndarray.*; // TODO used in the Callbacks, this should be a part of NDArray? diff --git a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/TestSession.java b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/TestSession.java index 2c252d467c7..ce408c5bcfd 100644 --- a/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/TestSession.java +++ b/tensorflow-framework/src/test/java/org/tensorflow/framework/utils/TestSession.java @@ -14,6 +14,13 @@ =======================================================================*/ package org.tensorflow.framework.utils; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.function.Predicate; import org.tensorflow.*; import org.tensorflow.ndarray.DoubleNdArray; import org.tensorflow.ndarray.FloatNdArray; @@ -24,14 +31,6 @@ import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.Writer; -import java.util.function.Predicate; - -import static org.junit.jupiter.api.Assertions.assertTrue; - /** Base class for Test Session */ public abstract class TestSession implements AutoCloseable { @@ -654,7 +653,9 @@ public void setEpsilon(float epsilon) { @Override public abstract void close(); - /** @return the debug setting */ + /** + * @return the debug setting + */ public boolean isDebug() { return debug; } diff --git a/tensorflow-ndarray/pom.xml b/tensorflow-ndarray/pom.xml new file mode 100644 index 00000000000..8f1df831143 --- /dev/null +++ b/tensorflow-ndarray/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + + + org.tensorflow + tensorflow-java + 1.2.0-SNAPSHOT + + tensorflow-ndarray + jar + + TensorFlow NdArray Library + + Utility library for N-dimensional data I/O operations in Java. + + + + org.tensorflow.ndarray + + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.openjdk.jmh + jmh-core + test + + + org.openjdk.jmh + jmh-generator-annprocess + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${java.module.name} + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 1 + false + -Xmx2G + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-testCompile + + + --add-modules=java.desktop + + + + + + + + + diff --git a/tensorflow-ndarray/src/main/java/module-info.java b/tensorflow-ndarray/src/main/java/module-info.java new file mode 100644 index 00000000000..e9f351a878c --- /dev/null +++ b/tensorflow-ndarray/src/main/java/module-info.java @@ -0,0 +1,38 @@ +/* +Copyright 2022 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. +======================================================================= +*/ +module org.tensorflow.ndarray { + requires jdk.unsupported; // required by raw buffer implementations using Unsafe + + exports org.tensorflow.ndarray; + exports org.tensorflow.ndarray.buffer; + exports org.tensorflow.ndarray.buffer.layout; + exports org.tensorflow.ndarray.index; + + // Expose all implementations of our interfaces, so consumers can write custom + // implementations easily by extending from them + exports org.tensorflow.ndarray.impl.buffer; + exports org.tensorflow.ndarray.impl.buffer.adapter; + exports org.tensorflow.ndarray.impl.buffer.layout; + exports org.tensorflow.ndarray.impl.buffer.misc; + exports org.tensorflow.ndarray.impl.buffer.nio; + exports org.tensorflow.ndarray.impl.buffer.raw; + exports org.tensorflow.ndarray.impl.dense; + exports org.tensorflow.ndarray.impl.dimension; + exports org.tensorflow.ndarray.impl.sequence; + exports org.tensorflow.ndarray.impl.sparse; + exports org.tensorflow.ndarray.impl.sparse.slice; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java new file mode 100644 index 00000000000..58f9c71456b --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/BooleanNdArray.java @@ -0,0 +1,115 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of booleans. */ +public interface BooleanNdArray extends NdArray { + + /** + * Returns the boolean value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
    +   * matrix.getBoolean(0, 1);  // succeeds, returns false
    +   * matrix.getBoolean(0);  // throws IllegalRankException
    +   *
    +   * BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getBoolean();  // succeeds, returns false
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + boolean getBoolean(long... coordinates); + + /** + * Assigns the boolean value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
    +   * matrix.setBoolean(true, 0, 1);  // succeeds
    +   * matrix.setBoolean(true, 0);  // throws IllegalRankException
    +   *
    +   * BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setBoolean(true);  // succeeds
    +   * }
    + * + * @param value the value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + BooleanNdArray setBoolean(boolean value, long... coordinates); + + @Override + BooleanNdArray withShape(Shape shape); + + @Override + BooleanNdArray slice(Index... indices); + + @Override + BooleanNdArray get(long... coordinates); + + @Override + BooleanNdArray set(NdArray src, long... coordinates); + + @Override + default Boolean getObject(long... coordinates) { + return getBoolean(coordinates); + } + + @Override + default BooleanNdArray setObject(Boolean value, long... coordinates) { + return setBoolean(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + BooleanNdArray copyTo(NdArray dst); + + @Override + BooleanNdArray copyTo(DataBuffer dst); + + BooleanNdArray copyTo(BooleanDataBuffer dst); + + @Override + BooleanNdArray copyFrom(DataBuffer src); + + BooleanNdArray copyFrom(BooleanDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java new file mode 100644 index 00000000000..9354b474f27 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ByteNdArray.java @@ -0,0 +1,115 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of bytes. */ +public interface ByteNdArray extends NdArray { + + /** + * Returns the byte value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
    +   * matrix.getByte(0, 1);  // succeeds, returns 0
    +   * matrix.getByte(0);  // throws IllegalRankException
    +   *
    +   * ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getByte();  // succeeds, returns 0
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + byte getByte(long... coordinates); + + /** + * Assigns the byte value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
    +   * matrix.setByte(10, 0, 1);  // succeeds
    +   * matrix.setByte(10, 0);  // throws IllegalRankException
    +   *
    +   * ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setByte(10);  // succeeds
    +   * }
    + * + * @param value the value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + ByteNdArray setByte(byte value, long... coordinates); + + @Override + ByteNdArray withShape(Shape shape); + + @Override + ByteNdArray slice(Index... indices); + + @Override + ByteNdArray get(long... coordinates); + + @Override + ByteNdArray set(NdArray src, long... coordinates); + + @Override + default Byte getObject(long... coordinates) { + return getByte(coordinates); + } + + @Override + default ByteNdArray setObject(Byte value, long... coordinates) { + return setByte(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + ByteNdArray copyTo(NdArray dst); + + @Override + ByteNdArray copyTo(DataBuffer dst); + + ByteNdArray copyTo(ByteDataBuffer dst); + + @Override + ByteNdArray copyFrom(DataBuffer src); + + ByteNdArray copyFrom(ByteDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java new file mode 100644 index 00000000000..f631a1c7522 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/DoubleNdArray.java @@ -0,0 +1,130 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import java.util.stream.DoubleStream; +import java.util.stream.StreamSupport; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of doubles. */ +public interface DoubleNdArray extends NdArray { + + /** + * Returns the double value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2));  // matrix rank = 2
    +   * matrix.getDouble(0, 1);  // succeeds, returns 0.0
    +   * matrix.getDouble(0);  // throws IllegalRankException
    +   *
    +   * DoubleNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getDouble();  // succeeds, returns 0.0
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + double getDouble(long... coordinates); + + /** + * Assigns the double value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2));  // matrix rank = 2
    +   * matrix.setDouble(10.0, 0, 1);  // succeeds
    +   * matrix.setDouble(10.0, 0);  // throws IllegalRankException
    +   *
    +   * DoubleNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setDouble(10.0);  // succeeds
    +   * }
    + * + * @param value value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + DoubleNdArray setDouble(double value, long... coordinates); + + /** + * Retrieve all scalar values of this array as a stream of doubles. + * + *

    For {@code rank() > 1} arrays, all vectors of the last dimension are collated so that the + * scalar values are returned in sequential order. + * + * @return scalar values as a stream + */ + default DoubleStream streamOfDoubles() { + return StreamSupport.stream(scalars().spliterator(), false) + .mapToDouble(DoubleNdArray::getDouble); + } + + @Override + DoubleNdArray withShape(Shape shape); + + @Override + DoubleNdArray slice(Index... indices); + + @Override + DoubleNdArray get(long... coordinates); + + @Override + DoubleNdArray set(NdArray src, long... coordinates); + + @Override + default Double getObject(long... coordinates) { + return getDouble(coordinates); + } + + @Override + default DoubleNdArray setObject(Double value, long... coordinates) { + return setDouble(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + DoubleNdArray copyTo(NdArray dst); + + @Override + DoubleNdArray copyTo(DataBuffer dst); + + DoubleNdArray copyTo(DoubleDataBuffer dst); + + @Override + DoubleNdArray copyFrom(DataBuffer src); + + DoubleNdArray copyFrom(DoubleDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java new file mode 100644 index 00000000000..1d564370b51 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/FloatNdArray.java @@ -0,0 +1,115 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of floats. */ +public interface FloatNdArray extends NdArray { + + /** + * Returns the float value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
    +   * matrix.getFloat(0, 1);  // succeeds, returns 0.0f
    +   * matrix.getFloat(0);  // throws IllegalRankException
    +   *
    +   * FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getFloat();  // succeeds, returns 0.0f
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + float getFloat(long... coordinates); + + /** + * Assigns the float value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
    +   * matrix.setFloat(10.0f, 0, 1);  // succeeds
    +   * matrix.setFloat(10.0f, 0);  // throws IllegalRankException
    +   *
    +   * FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setFloat(10.0f);  // succeeds
    +   * }
    + * + * @param value value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + FloatNdArray setFloat(float value, long... coordinates); + + @Override + FloatNdArray withShape(Shape shape); + + @Override + FloatNdArray slice(Index... coordinates); + + @Override + FloatNdArray get(long... coordinates); + + @Override + FloatNdArray set(NdArray src, long... coordinates); + + @Override + default Float getObject(long... coordinates) { + return getFloat(coordinates); + } + + @Override + default FloatNdArray setObject(Float value, long... coordinates) { + return setFloat(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + FloatNdArray copyTo(NdArray dst); + + @Override + FloatNdArray copyTo(DataBuffer dst); + + FloatNdArray copyTo(FloatDataBuffer dst); + + @Override + FloatNdArray copyFrom(DataBuffer src); + + FloatNdArray copyFrom(FloatDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java new file mode 100644 index 00000000000..4f4efd281b2 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IllegalRankException.java @@ -0,0 +1,27 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +/** + * Exception thrown when an operation cannot be completed because of the rank of the targeted array. + */ +public class IllegalRankException extends IllegalArgumentException { + + public IllegalRankException(String message) { + super(message); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java new file mode 100644 index 00000000000..74bd7429213 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/IntNdArray.java @@ -0,0 +1,129 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import java.util.stream.IntStream; +import java.util.stream.StreamSupport; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of integers. */ +public interface IntNdArray extends NdArray { + + /** + * Returns the integer value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * IntNdArray matrix = NdArrays.ofInts(shape(2, 2));  // matrix rank = 2
    +   * matrix.getInt(0, 1);  // succeeds, returns 0
    +   * matrix.getInt(0);  // throws IllegalRankException
    +   *
    +   * IntNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getInt();  // succeeds, returns 0
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + int getInt(long... coordinates); + + /** + * Assigns the integer value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * IntNdArray matrix = NdArrays.ofInts(shape(2, 2));  // matrix rank = 2
    +   * matrix.setInt(10, 0, 1);  // succeeds
    +   * matrix.setInt(10, 0);  // throws IllegalRankException
    +   *
    +   * IntNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setInt(10);  // succeeds
    +   * }
    + * + * @param value value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + IntNdArray setInt(int value, long... coordinates); + + /** + * Retrieve all scalar values of this array as a stream of integers. + * + *

    For {@code rank() > 1} arrays, all vectors of the last dimension are collated so that the + * scalar values are returned in sequential order. + * + * @return scalar values as a stream + */ + default IntStream streamOfInts() { + return StreamSupport.stream(scalars().spliterator(), false).mapToInt(IntNdArray::getInt); + } + + @Override + IntNdArray withShape(Shape shape); + + @Override + IntNdArray slice(Index... indices); + + @Override + IntNdArray get(long... coordinates); + + @Override + IntNdArray set(NdArray src, long... coordinates); + + @Override + default Integer getObject(long... coordinates) { + return getInt(coordinates); + } + + @Override + default IntNdArray setObject(Integer value, long... coordinates) { + return setInt(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + IntNdArray copyTo(NdArray dst); + + @Override + IntNdArray copyTo(DataBuffer dst); + + IntNdArray copyTo(IntDataBuffer dst); + + @Override + IntNdArray copyFrom(DataBuffer src); + + IntNdArray copyFrom(IntDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java new file mode 100644 index 00000000000..dc781be6957 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/LongNdArray.java @@ -0,0 +1,129 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import java.util.stream.LongStream; +import java.util.stream.StreamSupport; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of longs. */ +public interface LongNdArray extends NdArray { + + /** + * Returns the long value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * LongNdArray matrix = NdArrays.ofLongs(shape(2, 2));  // matrix rank = 2
    +   * matrix.getLong(0, 1);  // succeeds, returns 0L
    +   * matrix.getLong(0);  // throws IllegalRankException
    +   *
    +   * LongNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getLong();  // succeeds, returns 0L
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + long getLong(long... coordinates); + + /** + * Assigns the long value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * LongNdArray matrix = NdArrays.ofLongs(shape(2, 2));  // matrix rank = 2
    +   * matrix.setLong(10L, 0, 1);  // succeeds
    +   * matrix.setLong(10L, 0);  // throws IllegalRankException
    +   *
    +   * LongNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setLong(10L);  // succeeds
    +   * }
    + * + * @param value value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + LongNdArray setLong(long value, long... coordinates); + + /** + * Retrieve all scalar values of this array as a stream of longs. + * + *

    For {@code rank() > 1} arrays, all vectors of the last dimension are collated so that the + * scalar values are returned in sequential order. + * + * @return scalar values as a stream + */ + default LongStream streamOfLongs() { + return StreamSupport.stream(scalars().spliterator(), false).mapToLong(LongNdArray::getLong); + } + + @Override + LongNdArray withShape(Shape shape); + + @Override + LongNdArray slice(Index... indices); + + @Override + LongNdArray get(long... coordinates); + + @Override + LongNdArray set(NdArray src, long... coordinates); + + @Override + default Long getObject(long... coordinates) { + return getLong(coordinates); + } + + @Override + default LongNdArray setObject(Long value, long... coordinates) { + return setLong(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + LongNdArray copyTo(NdArray dst); + + @Override + LongNdArray copyTo(DataBuffer dst); + + LongNdArray copyTo(LongDataBuffer dst); + + @Override + LongNdArray copyFrom(DataBuffer src); + + LongNdArray copyFrom(LongDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java new file mode 100644 index 00000000000..4f7e4fbf5d6 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArray.java @@ -0,0 +1,361 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** + * A data structure of N-dimensions. + * + *

    The `NdArray` interface creates an abstraction between the physical storage of a data record, + * which can be linear or segmented, and its logical representation. In general, they achieve better + * performances than standard multi-dimensional arrays in Java by mapping directly linear data + * segments in memory. + * + *

    Like {@link DataBuffer}, {@code NdArray} instances support 64-bits indexing so they can be + * used to map very large data records. They also support special coordinates that allow traversing + * their values in any direction or to select only a subset of them. + * + *

    Example of usage: + * + *

    {@code
    + * // Creates a 2x3x2 matrix (of rank 3)
    + * FloatNdArray matrix3d = NdArrays.ofFloats(shape(2, 3, 2));
    + *
    + * // Initialize sub-matrices data with vectors
    + * matrix.set(NdArrays.vectorOf(1.0f, 2.0f), 0, 0)
    + *       .set(NdArrays.vectorOf(3.0f, 4.0f), 0, 1)
    + *       .set(NdArrays.vectorOf(5.0f, 6.0f), 0, 2)
    + *       .set(NdArrays.vectorOf(7.0f, 8.0f), 1, 0)
    + *       .set(NdArrays.vectorOf(9.0f, 10.0f), 1, 1)
    + *       .set(NdArrays.vectorOf(11.0f, 12.0f), 1, 2);
    + *
    + * // Access the second 3x2 matrix (of rank 2)
    + * FloatNdArray matrix = matrix3d.get(1);
    + *
    + * // Access directly the float value at (1, 0) from the second matrix
    + * assertEquals(9.0f, matrix.getFloat(1, 0));
    + * }
    + * + * @param the type of values to be mapped + */ +public interface NdArray extends Shaped { + + /** + * Returns a sequence of all elements at a given dimension. + * + *

    Logically, the N-dimensional array can be flatten in a single vector, where the scalars of + * the {@code (n - 1)}th element precedes those of the {@code (n)}th element, for a total of + * {@link #size()} values. + * + *

    For example, given a {@code n x m} matrix on the {@code [x, y]} axes, elements are iterated + * in the following order: + * + *

    x0y0, x0y1, ..., x0ym-1, + * x1y0, x1y1, ..., xn-1ym-1 + * + *

    The returned sequence can then be iterated to visit each elements, either by calling {@link + * NdArraySequence#forEach(Consumer)} or {@link NdArraySequence#forEachIndexed(BiConsumer)}. + * + *

    {@code
    +   * // Iterate matrix for initializing each of its vectors
    +   * matrixOfFloats.elements(0).forEach(v -> {
    +   *   v.set(vector(1.0f, 2.0f, 3.0f));
    +   * });
    +   *
    +   * // Iterate a vector for reading each of its scalar
    +   * vectorOfFloats.scalars().forEachIdx((coords, s) -> {
    +   *   System.out.println("Value " + s.getFloat() + " found at " + coords);
    +   * });
    +   * }
    + * + * @param dimensionIdx index of the dimension + * @return an {@code NdArray} sequence + * @throws IllegalArgumentException if {@code dimensionIdx} is greater or equal to the total + * number of dimensions of this array + */ + NdArraySequence> elements(int dimensionIdx); + + /** + * Returns a sequence of all scalars in this array. + * + *

    This is equivalent to call {@code elements(shape().numDimensions() - 1)} + * + * @return an {@code NdArray} sequence + */ + NdArraySequence> scalars(); + + /** + * Returns a new N-dimensional view of this array with the given {@code shape}. + * + *

    The provided {@code shape} must comply to the following characteristics: + * + *

      + *
    • new shape is known (i.e. has no unknown dimension) + *
    • new shape size is equal to the size of the current shape (i.e. same number of elements) + *
    + * + * For example, + * + *
    {@code
    +   * NdArrays.ofInts(Shape.scalar()).withShape(Shape.of(1, 1));  // ok
    +   * NdArrays.ofInts(Shape.of(2, 3).withShape(Shape.of(3, 2));   // ok
    +   * NdArrays.ofInts(Shape.scalar()).withShape(Shape.of(1, 2));  // not ok, sizes are different (1 != 2)
    +   * NdArrays.ofInts(Shape.of(2, 3)).withShape(Shape.unknown()); // not ok, new shape unknown
    +   * }
    + * + *

    Any changes applied to the returned view affect the data of this array as well, as there is + * no copy involved. + * + * @param shape the new shape to apply + * @return a new array viewing the data according to the new shape, or this array if shapes are + * the same + * @throws IllegalArgumentException if the provided {@code shape} is not compliant + * @throws UnsupportedOperationException if this array does not support this operation + */ + NdArray withShape(Shape shape); + + /** + * Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions to + * the given index selectors. + * + *

    Slices allow to traverse an N-dimensional array in any of its axis and/or to filter only + * elements of interest. For example, for a given matrix on the {@code [x, y]} axes, it is + * possible to iterate elements at {@code y=0} for all {@code x}. + * + *

    Any changes applied to the returned slice affect the data of this array as well, as there is + * no copy involved. + * + *

    Example of usage: + * + *

    {@code
    +   * FloatNdArray matrix3d = NdArrays.ofFloats(shape(3, 2, 4));  // with [x, y, z] axes
    +   *
    +   * // Iterates elements on the x axis by preserving only the 3rd value on the z axis,
    +   * // (i.e. [x, y, 2])
    +   * matrix3d.slice(all(), all(), at(2)).elements(0).forEach(m -> {
    +   *   assertEquals(shape(2), m); // y=2, z=0 (scalar)
    +   * });
    +   *
    +   * // Creates a slice that contains only the last element of the y axis and elements with an
    +   * // odd `z` coordinate.
    +   * FloatNdArray slice = matrix3d.slice(all(), at(1), odd());
    +   * assertEquals(shape(3, 2), slice.shape());  // x=3, y=0 (scalar), z=2 (odd coordinates)
    +   *
    +   * // Iterates backward the elements on the x axis
    +   * matrix3d.slice(flip()).elements(0).forEach(m -> {
    +   *   assertEquals(shape(2, 4), m);  // y=2, z=4
    +   * });
    +   * }
    + * + * @param indices index selectors per dimensions, starting from dimension 0 of this array. + * @return the element resulting of the index selection + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray slice(Index... indices); + + /** + * Returns the N-dimensional element of this array at the given coordinates. + * + *

    Elements of any of the dimensions of this array can be retrieved. For example, if the number + * of coordinates is equal to the number of dimensions of this array, then a rank-0 (scalar) array + * is returned, which value can then be obtained by calling `array.getObject()`. + * + *

    Any changes applied to the returned elements affect the data of this array as well, as there + * is no copy involved. + * + *

    Note that invoking this method is an equivalent and more efficient way to slice this array + * on single scalar, i.e. {@code array.get(x, y, z)} is equal to {@code array.slice(at(x), at(y), + * at(z))} + * + * @param coordinates coordinates of the element to access, none will return this array + * @return the element at this index + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray get(long... coordinates); + + /** + * Assigns the value of the N-dimensional element found at the given coordinates. + * + *

    The number of coordinates provided can be anywhere between 0 and rank - 1. For example: + * + *

    {@code
    +   * FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
    +   * matrix.set(vector(10.0f, 20.0f), 0);  // success
    +   * matrix.set(scalar(10.0f), 1, 0); // success
    +   * }
    + * + * @param src an array of the values to assign + * @param coordinates coordinates of the element to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray set(NdArray src, long... coordinates); + + /** + * Returns the value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
    +   * matrix.getObject(0, 1);  // succeeds, returns 0.0f
    +   * matrix.getObject(0);  // throws IllegalRankException
    +   *
    +   * FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getObject();  // succeeds, returns 0.0f
    +   * }
    + * + * Note: if this array stores values of a primitive type, prefer the usage of the specialized + * method in the subclass for that type. For example, {@code floatArray.getFloat(0); }. + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + T getObject(long... coordinates); + + /** + * Assigns the value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
    +   * matrix.setObject(10.0f, 0, 1);  // succeeds
    +   * matrix.setObject(10.0f, 0);  // throws IllegalRankException
    +   *
    +   * FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setObject(10.0f);  // succeeds
    +   * }
    + * + * Note: if this array stores values of a primitive type, prefer the usage of the specialized + * method in the subclass for that type. For example, {@code floatArray.setFloat(10.0f, 0); } + * + * @param value the value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + NdArray setObject(T value, long... coordinates); + + /** + * Retrieve all scalar values of this array as a stream of objects. + * + *

    For {@code rank() > 1} arrays, all vectors of the last dimension are collated so that the + * scalar values are returned in sequential order. + * + * @return scalar values as a stream + */ + default Stream streamOfObjects() { + return StreamSupport.stream(scalars().spliterator(), false).map(NdArray::getObject); + } + + /** + * Copy the content of this array to the destination array. + * + *

    The {@link #shape()} of the destination array must be equal to the shape of this array, or + * an exception is thrown. After the copy, the content of both arrays can be altered + * independently, without affecting each other. + * + * @param dst array to receive a copy of the content of this array + * @return this array + * @throws IllegalArgumentException if the shape of {@code dst} is not equal to the shape of this + * array + */ + NdArray copyTo(NdArray dst); + + /** + * Copy the content of this N-dimensional array into the destination buffer. + * + *

    The size of the buffer must be equal or greater to the {@link #size()} of this array, or an + * exception is thrown. After the copy, content of the buffer and of the array can be altered + * independently, without affecting each other. + * + *

    Note: in version 0.4.0 and earlier, this method was named {@code read(DataBuffer)}. It + * has been renamed to explicitly indicate the direction of the data flow to avoid confusion. + * + * @param dst the destination buffer + * @return this array + * @throws java.nio.BufferOverflowException if the buffer cannot hold the content of this array + * @see DataBuffer#size() + */ + NdArray copyTo(DataBuffer dst); + + /** + * Copy the content of the source buffer into this N-dimensional array. + * + *

    The size of the buffer must be equal or greater to the {@link #size()} of this array, or an + * exception is thrown. After the copy, content of the buffer and of the array can be altered + * independently, without affecting each other. + * + *

    Note: in version 0.4.0 and earlier, this method was named {@code write(DataBuffer)}. + * It has been renamed to explicitly indicate the direction of the data flow to avoid + * confusion. + * + * @param src the source buffer + * @return this array + * @throws java.nio.BufferUnderflowException if the buffer has not enough remaining data to write + * into this array + * @see DataBuffer#size() + */ + NdArray copyFrom(DataBuffer src); + + /** + * Checks equality between n-dimensional arrays. + * + *

    An array is equal to another object if this object is another {@link NdArray} of the same + * shape, type and the elements are equal and in the same order. For example: + * + *

    {@code
    +   * IntNdArray array = NdArrays.ofInts(Shape.of(2, 2))
    +   *    .set(NdArrays.vectorOf(1, 2), 0)
    +   *    .set(NdArrays.vectorOf(3, 4), 1);
    +   *
    +   * assertEquals(array, StdArrays.ndCopyOf(new int[][] {{1, 2}, {3, 4}}));  // true
    +   * assertEquals(array, StdArrays.ndCopyOf(new Integer[][] {{1, 2}, {3, 4}}));  // true, as Integers are equal to ints
    +   * assertNotEquals(array, NdArrays.vectorOf(1, 2, 3, 4));  // false, different shapes
    +   * assertNotEquals(array, StdArrays.ndCopyOf(new int[][] {{3, 4}, {1, 2}}));  // false, different order
    +   * assertNotEquals(array, StdArrays.ndCopyOf(new long[][] {{1L, 2L}, {3L, 4L}}));  // false, different types
    +   * }
    + * + *

    Note that the computation required to verify equality between two arrays can be expensive in + * some cases and therefore, it is recommended to not use this method in a critical path where + * performances matter. + * + * @param obj object to compare this array with + * @return true if this array is equal to the provided object + */ + @Override + boolean equals(Object obj); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java new file mode 100644 index 00000000000..bda82cec383 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArraySequence.java @@ -0,0 +1,71 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray; + +import java.util.function.BiConsumer; +import org.tensorflow.ndarray.buffer.DataBufferWindow; + +/** + * A sequence of elements of an N-dimensional array. + * + *

    An {@code NdArraySequence} is used to traverse an {@code NdArray} in a given dimension and + * visit each of its elements. For example, given a {@code n x m} matrix on the {@code [x, y]} axes, + * elements are iterated in the following order: + * + *

    x0y0, x0y1, ..., x0ym-1, + * x1y0, x1y1, ..., xn-1ym-1 + * + * @param data type of the array being iterated + */ +public interface NdArraySequence> extends Iterable { + + /** + * Visit each elements of this iteration and their respective coordinates. + * + *

    Important: the consumer method should not keep a reference to the coordinates as they + * might be mutable and reused during the iteration to improve performance. + * + * @param consumer method to invoke for each elements + */ + void forEachIndexed(BiConsumer consumer); + + /** + * Returns each element as a new slice. + * + *

    Unlike conventional Java collections, elements of a {@code NdArraySequence} are transient, + * i.e. new {@code NdArray} instances are allocated for each iteration. To improve performance, + * the same instance can be recycled to view all elements of this sequence, using a {@link + * DataBufferWindow}. + * + *

    In some cases though, it might be preferable to disable such optimizations to ensure that + * each element returned is a new slice of the original array. For example, if one or more + * elements visited must live beyond the scope of the sequence iteration, {@code asSlices()} makes + * sure that all elements returned by the sequence are unique instances. + * + *

    {@code
    +   * final List vectors = new ArrayList<>();
    +   * IntNdArray matrix = NdArrays.ofInts(Shape.of(6, 6));
    +   * ndArray.elements(0).forEach(e -> vectors::add);  // Not safe, as `e` might always be the same recycled instance
    +   * ndArray.elements(0).asSlices().forEach(e -> vectors::add);  // Safe, each `e` is a distinct NdArray instance
    +   * }
    + * + * @return a sequence that returns each elements iterated as a new slice + * @see DataBufferWindow + */ + NdArraySequence asSlices(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java new file mode 100644 index 00000000000..6caceb7d24b --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/NdArrays.java @@ -0,0 +1,819 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dense.BooleanDenseNdArray; +import org.tensorflow.ndarray.impl.dense.ByteDenseNdArray; +import org.tensorflow.ndarray.impl.dense.DenseNdArray; +import org.tensorflow.ndarray.impl.dense.DoubleDenseNdArray; +import org.tensorflow.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.ndarray.impl.dense.IntDenseNdArray; +import org.tensorflow.ndarray.impl.dense.LongDenseNdArray; +import org.tensorflow.ndarray.impl.dense.ShortDenseNdArray; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.BooleanSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.ByteSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.DoubleSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.FloatSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.IntSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.LongSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.ShortSparseNdArray; + +/** Utility class for instantiating {@link NdArray} objects. */ +public final class NdArrays { + + // BYTE ARRAYS + + /** + * Creates byte scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new byte scalar + */ + public static ByteNdArray scalarOf(byte value) { + return ofBytes(Shape.scalar()).setByte(value); + } + + /** + * Creates a byte vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new byte vector + * @throws IllegalArgumentException if values is null + */ + public static ByteNdArray vectorOf(byte... values) { + if (values == null) { + throw new IllegalArgumentException("Values cannot be null"); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of bytes of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static ByteNdArray ofBytes(Shape shape) { + if (shape == null) { + throw new IllegalArgumentException("Shape cannot be null"); + } + return wrap(shape, DataBuffers.ofBytes(shape.size())); + } + + /** + * Wraps a buffer in a byte N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static ByteNdArray wrap(Shape shape, ByteDataBuffer buffer) { + return ByteDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of byte values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D ByteNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the byte sparse array. + */ + public static ByteSparseNdArray sparseOf(LongNdArray indices, ByteNdArray values, Shape shape) { + return ByteSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of byte values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non default values. + * @param values A 1-D ByteNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the byte sparse array. + */ + public static ByteSparseNdArray sparseOf( + LongNdArray indices, ByteNdArray values, byte defaultValue, Shape shape) { + return ByteSparseNdArray.create(indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // LONG ARRAYS + + /** + * Creates long scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new long scalar + */ + public static LongNdArray scalarOf(long value) { + return ofLongs(Shape.scalar()).setLong(value); + } + + /** + * Creates a long vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new long vector + * @throws IllegalArgumentException if values is null + */ + public static LongNdArray vectorOf(long... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of longs of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static LongNdArray ofLongs(Shape shape) { + return wrap(shape, DataBuffers.ofLongs(shape.size())); + } + + /** + * Wraps a buffer in a long N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static LongNdArray wrap(Shape shape, LongDataBuffer buffer) { + return LongDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of long values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D LongNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18L, 3L]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18L}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3L}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the long sparse array. + */ + public static LongSparseNdArray sparseOf(LongNdArray indices, LongNdArray values, Shape shape) { + return LongSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of long values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D LongNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18L, 3L]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18L}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3L}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the long sparse array. + */ + public static LongSparseNdArray sparseOf( + LongNdArray indices, LongNdArray values, long defaultValue, Shape shape) { + return LongSparseNdArray.create(indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // INT ARRAYS + + /** + * Creates long scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new long scalar + */ + public static IntNdArray scalarOf(int value) { + return ofInts(Shape.scalar()).setInt(value); + } + + /** + * Creates a int vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new int vector + * @throws IllegalArgumentException if values is null + */ + public static IntNdArray vectorOf(int... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of ints of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static IntNdArray ofInts(Shape shape) { + return wrap(shape, DataBuffers.ofInts(shape.size())); + } + + /** + * Wraps a buffer in an int N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static IntNdArray wrap(Shape shape, IntDataBuffer buffer) { + return IntDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of int values with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D IntNdArray of shape {@code [N]}, which supplies the values for each element + * in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the int sparse array. + */ + public static IntSparseNdArray sparseOf(LongNdArray indices, IntNdArray values, Shape shape) { + return IntSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of int values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D IntNdArray of shape {@code [N]}, which supplies the values for each element + * in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the int sparse array. + */ + public static IntSparseNdArray sparseOf( + LongNdArray indices, IntNdArray values, int defaultValue, Shape shape) { + return IntSparseNdArray.create(indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // SHORT ARRAYS + + /** + * Creates short scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new short scalar + */ + public static ShortNdArray scalarOf(short value) { + return ofShorts(Shape.scalar()).setShort(value); + } + + /** + * Creates a short vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new short vector + * @throws IllegalArgumentException if values is null + */ + public static ShortNdArray vectorOf(short... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of shorts of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static ShortNdArray ofShorts(Shape shape) { + return wrap(shape, DataBuffers.ofShorts(shape.size())); + } + + /** + * Wraps a buffer in a short N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static ShortNdArray wrap(Shape shape, ShortDataBuffer buffer) { + return ShortDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of short values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D ShortNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the short sparse array. + */ + public static ShortSparseNdArray sparseOf(LongNdArray indices, ShortNdArray values, Shape shape) { + return ShortSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of short values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D ShortNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the short sparse array. + */ + public static ShortSparseNdArray sparseOf( + LongNdArray indices, ShortNdArray values, short defaultValue, Shape shape) { + return ShortSparseNdArray.create(indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // FLOAT ARRAYS + + /** + * Creates float scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new float scalar + */ + public static FloatNdArray scalarOf(float value) { + return ofFloats(Shape.scalar()).setFloat(value); + } + + /** + * Creates a float vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new float vector + * @throws IllegalArgumentException if values is null + */ + public static FloatNdArray vectorOf(float... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of floats of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static FloatNdArray ofFloats(Shape shape) { + return wrap(shape, DataBuffers.ofFloats(shape.size())); + } + + /** + * Wraps a buffer in a float N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static FloatNdArray wrap(Shape shape, FloatDataBuffer buffer) { + return FloatDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of float values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D FloatNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18f, 3.8f]} specifies that element {@code [1,3,1]} of the sparse NdArray has + * a value of {@code 18f}, and element {@code [2,4,0]} of the NdArray has a value of {@code + * 3.8f}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static FloatSparseNdArray sparseOf(LongNdArray indices, FloatNdArray values, Shape shape) { + return FloatSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of float values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D FloatNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18f, 3.8f]} specifies that element {@code [1,3,1]} of the sparse NdArray has + * a value of {@code 18f}, and element {@code [2,4,0]} of the NdArray has a value of {@code + * 3.8f}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static FloatSparseNdArray sparseOf( + LongNdArray indices, FloatNdArray values, float defaultValue, Shape shape) { + return FloatSparseNdArray.create(indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // DOUBLE ARRAYS + + /** + * Creates double scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new double scalar + */ + public static DoubleNdArray scalarOf(double value) { + return ofDoubles(Shape.scalar()).setDouble(value); + } + + /** + * Creates a double vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new double vector + * @throws IllegalArgumentException if values is null + */ + public static DoubleNdArray vectorOf(double... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of doubles of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static DoubleNdArray ofDoubles(Shape shape) { + return wrap(shape, DataBuffers.ofDoubles(shape.size())); + } + + /** + * Wraps a buffer in a double N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static DoubleNdArray wrap(Shape shape, DoubleDataBuffer buffer) { + return DoubleDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of double values with a default value of zero + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D DoubleNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3.8]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3.8}. + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static DoubleSparseNdArray sparseOf( + LongNdArray indices, DoubleNdArray values, Shape shape) { + return DoubleSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of double values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D DoubleNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[18, 3.8]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4,0]} of the NdArray has a value of {@code 3.8}. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static DoubleSparseNdArray sparseOf( + LongNdArray indices, DoubleNdArray values, double defaultValue, Shape shape) { + return DoubleSparseNdArray.create( + indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // BOOLEAN ARRAYS + + /** + * Creates boolean scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new boolean scalar + */ + public static BooleanNdArray scalarOf(boolean value) { + return ofBooleans(Shape.scalar()).setBoolean(value); + } + + /** + * Creates a boolean vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @return new boolean vector + * @throws IllegalArgumentException if values is null + */ + public static BooleanNdArray vectorOf(boolean... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of booleans of the given shape. + * + *

    All values are initialized to zeros. + * + * @param shape shape of the array + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static BooleanNdArray ofBooleans(Shape shape) { + return wrap(shape, DataBuffers.ofBooleans(shape.size())); + } + + /** + * Wraps a buffer in a boolean N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static BooleanNdArray wrap(Shape shape, BooleanDataBuffer buffer) { + return BooleanDenseNdArray.create(buffer, shape); + } + + /** + * Creates a Sparse array of boolean values with a default value of 'false' + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D BooleanNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[true, true]} specifies that element {@code [1,3,1]} of the sparse NdArray + * has a value of true, and element {@code [2,4,0]} of the NdArray has a value of true. All + * other values are false. + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static BooleanSparseNdArray sparseOf( + LongNdArray indices, BooleanNdArray values, Shape shape) { + return BooleanSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of boolean values + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D BooleanNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter + * {@code values=[true, true]} specifies that element {@code [1,3,1]} of the sparse NdArray + * has a value of true, and element {@code [2,4,0]} of the NdArray has a value of true. All + * other values are false. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static BooleanSparseNdArray sparseOf( + LongNdArray indices, BooleanNdArray values, boolean defaultValue, Shape shape) { + return BooleanSparseNdArray.create( + indices, values, defaultValue, DimensionalSpace.create(shape)); + } + + // OBJECT ARRAYS + + /** + * Creates scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @param the data type + * @return new scalar + */ + @SuppressWarnings("unchecked") + public static NdArray scalarOfObject(T value) { + if (value == null) { + throw new IllegalArgumentException(); + } + return ofObjects((Class) value.getClass(), Shape.scalar()).setObject(value); + } + + /** + * Creates a vector (rank 1) initialized with the given values. + * + *

    Modifying the data of the returned vector will also impact the values in the array passed in + * parameter. + * + * @param values vector values + * @param the data type + * @return new vector + * @throws IllegalArgumentException if values is null + */ + @SafeVarargs + public static NdArray vectorOfObjects(T... values) { + if (values == null || values.length == 0) { + throw new IllegalArgumentException("Null or zero length input supplied to vectorOfObjects."); + } + return wrap(Shape.of(values.length), DataBuffers.of(values, false, false)); + } + + /** + * Creates an N-dimensional array of the given shape. + * + *

    All values are initialized to zeros. + * + * @param clazz class of the data to be stored in this array + * @param shape shape of the array + * @param the data type + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static NdArray ofObjects(Class clazz, Shape shape) { + return wrap(shape, DataBuffers.ofObjects(clazz, shape.size())); + } + + /** + * Wraps a buffer in an N-dimensional array of a given shape. + * + * @param shape shape of the array + * @param buffer buffer to wrap + * @param the data type + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger in + * the buffer size + */ + public static NdArray wrap(Shape shape, DataBuffer buffer) { + return DenseNdArray.wrap(buffer, shape); + } + + /** + * Creates a Sparse array of values with a null default value + * + * @param type the class type represented by this sparse array. + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D NdArray of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=["one", "two"]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of "one", and element {@code [2,4,0]} of the NdArray has a value of "two"". All other + * values are null. + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static NdArray sparseOfObjects( + Class type, LongNdArray indices, NdArray values, Shape shape) { + return org.tensorflow.ndarray.impl.sparse.SparseNdArray.create( + type, indices, values, DimensionalSpace.create(shape)); + } + + /** + * Creates a Sparse array of values + * + * @param type the class type represented by this sparse array. + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3,1], [2,4,0]]} specifies that the elements with indexes of + * {@code [1,3,1]} and {@code [2,4,0]} have non-default values. + * @param values A 1-D NdArray of shape {@code [N]}, which supplies the values for each element in + * indices. For example, given {@code indices=[[1,3,1], [2,4,0]]}, the parameter {@code + * values=["one", "two"]} specifies that element {@code [1,3,1]} of the sparse NdArray has a + * value of "one", and element {@code [2,4,0]} of the NdArray has a value of "two"". All other + * values are null. + * @param defaultValue Scalar value to set for indices not specified in 'indices' + * @param shape the shape of the dense array represented by this sparse array. + * @return the float sparse array. + */ + public static NdArray sparseOfObjects( + Class type, LongNdArray indices, NdArray values, T defaultValue, Shape shape) { + return org.tensorflow.ndarray.impl.sparse.SparseNdArray.create( + type, indices, values, defaultValue, DimensionalSpace.create(shape)); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shape.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shape.java new file mode 100644 index 00000000000..9dbbdc44e74 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shape.java @@ -0,0 +1,498 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * The shape of a Tensor or {@link NdArray}. + * + *

    A {@code Shape} defines sizes along its axes. It may contain an unknown size for one of the + * axes or may be totally unknown, in which case not even the number of axes is known. If the size + * of an axis is unknown, {@link Shape#UNKNOWN_SIZE} should be used as its size. + */ +public final class Shape { + + /** The size of an unknown axis or the total unknown size for an unknown Shape. */ + public static long UNKNOWN_SIZE = -1L; + + /** + * Creates a Shape representing an unknown number of dimensions. + * + * @return A Shape for which {@link Shape#isUnknown()} is true, never null. + */ + public static Shape unknown() { + return new Shape(null); + } + + /** + * Creates a Shape representing a scalar value. + * + * @return A Shape without dimensions for which {@link Shape#isScalar()} is true, never null. + */ + public static Shape scalar() { + return new Shape(new long[0]); + } + + /** + * Create a Shape representing a scalar or an N-dimensional value. + * + *

    Creates a Shape representing a scalar or an N-dimensional value (N being at least 1), with + * the provided size for each dimension. A -1 indicates that the size of the corresponding + * dimension is unknown. If no sizes are provided, a Shape representing a scalar is created. For + * example: + * + *

    {@code
    +   * // A 2-element vector.
    +   * Shape vector = Shape.of(2);
    +   *
    +   * // A 2x3 matrix.
    +   * Shape matrix = Shape.of(2, 3);
    +   *
    +   * // A matrix with 4 columns but an unknown number of rows.
    +   * // This is typically used to indicate the shape of tensors that represent
    +   * // a variable-sized batch of values. The Shape below might represent a
    +   * // variable-sized batch of 4-element vectors.
    +   * Shape batch = Shape.of(-1, 4);
    +   *
    +   * // A scalar. For readability, you should prefer calling Shape.scalar()
    +   * Shape scalar = Shape.of()
    +   * }
    + * + * @param dimensionSizes number of elements in each dimension of this shape, if any, or {@link + * Shape#UNKNOWN_SIZE} if unknown. + * @return a new shape + */ + public static Shape of(long... dimensionSizes) { + if (dimensionSizes == null || dimensionSizes.length == 0) { + return scalar(); + } + return new Shape(dimensionSizes); + } + + /** + * Returns the total number of elements a Tensor with this Shape would have. + * + *

    If {@link Shape#isUnknown()} is true or {@link Shape#hasUnknownDimension()} is true, {@link + * Shape#UNKNOWN_SIZE} is returned. + * + * @return The total number of elements a Tensor with this shape would have if it can be + * calculated, else {@link Shape#UNKNOWN_SIZE}. + */ + public long size() { + if (size == null) { + size = computeSize(dimensionSizes); + } + return size; + } + + /** + * The size of the dimension with the given index. + * + *

    If {@link Shape#isUnknown()} is true or the size of the dimension with the given index has + * an unknown size, {@link Shape#UNKNOWN_SIZE} is returned. + * + * @param i the index of the dimension to get the size for. If this Shape has a known number of + * dimensions, it must be < {@link Shape#numDimensions()}. The index may be negative, in + * which case the position is counted from the end of the shape. E.g.: {@code size(-1)} + * returns the size of the last dimension, {@code size(-2)} the size of the second to last + * dimension etc. + * @return The size of the dimension with the given index if known, {@link Shape#UNKNOWN_SIZE} + * otherwise. + * @deprecated Renamed to {@link #get(int)}. + */ + @Deprecated + public long size(int i) { + return get(i); + } + + /** + * The size of the dimension with the given index. + * + *

    If {@link Shape#isUnknown()} is true or the size of the dimension with the given index has + * an unknown size, {@link Shape#UNKNOWN_SIZE} is returned. + * + * @param i the index of the dimension to get the size for. If this Shape has a known number of + * dimensions, it must be < {@link Shape#numDimensions()}. The index may be negative, in + * which case the position is counted from the end of the shape. E.g.: {@code size(-1)} + * returns the size of the last dimension, {@code size(-2)} the size of the second to last + * dimension etc. + * @return The size of the dimension with the given index if known, {@link Shape#UNKNOWN_SIZE} + * otherwise. + */ + public long get(int i) { + if (dimensionSizes == null) { + return UNKNOWN_SIZE; + } else if (i >= 0) { + return dimensionSizes[i]; + } else { + return dimensionSizes[dimensionSizes.length + i]; + } + } + + /** + * Returns the number of dimensions of this Shape. -1 if unknown, 0 for a scalar, 1 for a vector, + * 2 for a matrix etc. + */ + public int numDimensions() { + return dimensionSizes != null ? dimensionSizes.length : -1; + } + + /** Returns whether one or more dimensions of this Shape have an unknown size. */ + public boolean hasUnknownDimension() { + if (dimensionSizes == null) { + return true; + } + for (long dimSize : dimensionSizes) { + if (dimSize == UNKNOWN_SIZE) { + return true; + } + } + return false; + } + + /** Returns whether this Shape represents a scalar. */ + public boolean isScalar() { + return dimensionSizes != null && dimensionSizes.length == 0; + } + + /** Returns whether this Shape is the shape of a vector. */ + public boolean isVector() { + return dimensionSizes != null && dimensionSizes.length == 1; + } + + /** Returns whether this Shape is the shape of a matrix */ + public boolean isMatrix() { + return dimensionSizes != null && dimensionSizes.length == 2; + } + + /** Returns whether the number of dimensions of this Shape is unknown. */ + public boolean isUnknown() { + return dimensionSizes == null; + } + + /** + * Returns a defensive copy of the this Shape's axes. Changes to the returned array to not change + * this Shape's state. Returns null if {@link Shape#isUnknown()} is true. + */ + public long[] asArray() { + if (this.dimensionSizes == null) { + return null; + } else { + return Arrays.copyOf(dimensionSizes, dimensionSizes.length); + } + } + + /** + * Returns a defensive copy of the this Shape's axes. Changes to the returned list do not change + * this Shape's state. Returns null if {@link Shape#isUnknown()} is true. + */ + public List toListOrNull() { + long[] array = asArray(); + if (array == null) { + return null; + } + + List list = new ArrayList<>(array.length); + for (long l : array) { + list.add(l); + } + + return list; + } + + @Override + public int hashCode() { + return dimensionSizes != null ? Arrays.hashCode(dimensionSizes) : super.hashCode(); + } + + /** + * Equals implementation for Shapes. Two Shapes are considered equal iff: + * + *

    + * + *

      + *
    • the number of dimensions is defined and equal for both + *
    • the size of each dimension is defined and equal for both + *
    + * + *

    If either Shape has unknown dimensions (even if they are the same in both) or if either + * shape has an unknown number of dimensions (even if both return {@code true} for {@link + * Shape#isUnknown()}), they are not considered equal! However, a shape will always equal itself, + * even if it is unknown or contains unknown dimensions. + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + // Shapes are equivalent if all of their dimensions are equals + if (obj instanceof Shape) { + Shape otherShape = (Shape) obj; + if (otherShape.hasUnknownDimension()) { + return false; + } + return Arrays.equals(dimensionSizes, otherShape.dimensionSizes); + } + return false; + } + + /** Succinct description of the Shape meant for debugging. */ + @Override + public String toString() { + return Arrays.toString(dimensionSizes); + } + + private Shape(long[] dimensionSizes) { + this.dimensionSizes = dimensionSizes; + } + + private final long[] dimensionSizes; + private Long size; + + /** + * Returns a 1-dimensional Shape with first dimension matching the first dimension of this Shape. + */ + public Shape head() { + return take(1); + } + + /** + * Returns an n-dimensional Shape with the dimensions matching the first n dimensions of this + * shape + * + * @param n the number of leading dimensions to get, must be <= than {@link + * Shape#numDimensions()} + * @return an n-dimensional Shape with the first n dimensions matching the first n dimensions of + * this Shape + */ + public Shape take(int n) { + if (n > numDimensions()) { + throw new ArrayIndexOutOfBoundsException( + "Cannot take " + n + " dimensions, shape has only " + numDimensions() + "."); + } + long[] newDimensions = new long[n]; + System.arraycopy(dimensionSizes, 0, newDimensions, 0, n); + return Shape.of(newDimensions); + } + + /** Returns a new Shape, with this Shape's first dimension removed. */ + public Shape tail() { + if (dimensionSizes.length < 2) { + return Shape.of(); + } + return Shape.of(Arrays.copyOfRange(dimensionSizes, 1, dimensionSizes.length)); + } + + /** + * Returns an n-dimensional Shape with the dimensions matching the last n dimensions of this + * Shape. + * + * @param n the number of trailing dimensions to get, must be <= than {@link + * Shape#numDimensions()} + * @return an n-dimensional shape with the dimensions matching the last n dimensions of this + * Shape, never null + */ + public Shape takeLast(int n) { + if (n > numDimensions()) { + throw new ArrayIndexOutOfBoundsException( + "Cannot take last " + n + " dimensions, shape has only " + numDimensions() + "."); + } + long[] newDimensions = new long[n]; + System.arraycopy(dimensionSizes, numDimensions() - n, newDimensions, 0, n); + return Shape.of(newDimensions); + } + + /** + * Return a {@code end - begin} dimensional shape with dimensions matching this Shape from {@code + * begin} to {@code end}. + * + * @param begin Where to start the sub-shape. + * @param end Where to end the sub-shape, exclusive. + * @return the sub-shape bounded by begin and end. + */ + public Shape subShape(int begin, int end) { + if (end > numDimensions()) { + throw new ArrayIndexOutOfBoundsException( + "End index " + + end + + " out of bounds: shape only has " + + numDimensions() + + " dimensions."); + } + if (begin < 0) { + throw new ArrayIndexOutOfBoundsException( + "Begin index " + begin + " out of bounds: cannot be less than 0."); + } + + long[] newDimensions = new long[end - begin]; + System.arraycopy(dimensionSizes, begin, newDimensions, 0, end - begin); + return Shape.of(newDimensions); + } + + /** + * Returns a new Shape, with a new first dimension added. In order for this call to succeed, + * {@link Shape#isUnknown()} must be {@code false}. + * + * @param firstDimension the dimension to prepend + * @return a new shape with the given dimension first, followed by this Shape's dimensions, never + * null + */ + public Shape prepend(long firstDimension) { + long[] newDimensions = new long[dimensionSizes.length + 1]; + newDimensions[0] = firstDimension; + System.arraycopy(dimensionSizes, 0, newDimensions, 1, dimensionSizes.length); + + return Shape.of(newDimensions); + } + + /** + * Returns a new Shape, with a new last dimension added. In order for this call to succeed, {@link + * Shape#isUnknown()} must be {@code false}. + * + * @param lastDimension the dimension to append + * @return a new Shape with this Shape's dimensions followed by the given dimension, never null + */ + public Shape append(long lastDimension) { + long[] newDimensions = new long[dimensionSizes.length + 1]; + newDimensions[newDimensions.length - 1] = lastDimension; + System.arraycopy(dimensionSizes, 0, newDimensions, 0, dimensionSizes.length); + + return Shape.of(newDimensions); + } + + /** + * Returns a new Shape, with another Shape's dimensions prepended. For both this Shape and the + * other Shape, {@link Shape#isUnknown()} must return false. E.g. {@code + * Shape.of(3,4).prepend(Shape.of(1,2)) => Shape.of(1,2,3,4) } + * + * @param other another Shape, must not be {@code null}, must not be unknown + * @return A new Shape consisting of the given Shape's dimensions followed by this Shape's + * dimensions, never null + */ + public Shape prepend(Shape other) { + long[] newDimensions = new long[other.dimensionSizes.length + dimensionSizes.length]; + System.arraycopy(other.dimensionSizes, 0, newDimensions, 0, other.dimensionSizes.length); + System.arraycopy( + dimensionSizes, 0, newDimensions, other.dimensionSizes.length, dimensionSizes.length); + return Shape.of(newDimensions); + } + + /** + * Returns a new Shape, with another Shapes' dimensions appended. For both this Shape and the + * other Shape, {@link Shape#isUnknown()} must return false. E.g. @code + * Shape.of(3,4).append(Shape.of(1,2)) => Shape.of(3,4,1,2) } + * + * @param other another Shape, must not be {@code null}, must not be unknown + * @return A new Shape consisting of this Shape's dimensions followed by the given Shape's + * dimensions + */ + public Shape append(Shape other) { + long[] newDimensions = new long[dimensionSizes.length + other.dimensionSizes.length]; + System.arraycopy(dimensionSizes, 0, newDimensions, 0, dimensionSizes.length); + System.arraycopy( + other.dimensionSizes, 0, newDimensions, dimensionSizes.length, other.dimensionSizes.length); + return Shape.of(newDimensions); + } + + private static long computeSize(long[] dimensionSizes) { + if (dimensionSizes == null) { + return UNKNOWN_SIZE; + } + long computedSize = 1L; + for (long dimensionSize : dimensionSizes) { + if (dimensionSize == UNKNOWN_SIZE) { + return UNKNOWN_SIZE; + } + computedSize *= dimensionSize; + } + return computedSize; + } + + /** + * Determines whether another shape is compatible with this one. + * + *

    + * + *

    Two possibly-partially-defined shapes are compatible if there exists a fully-defined shape + * that both shapes can represent. Thus, compatibility allows the shape inference code to reason + * about partially-defined shapes. For example: + * + *

      + *
    • Shape.unknown() is compatible with all shapes. + *
    • Shape(UNKNOWN_SIZE, UNKNOWN_SIZE) is compatible with all two-dimensional + * shapes, such as Shape(32, 784), and also Shape.unknown(). It is + * not compatible with, for example, Shape(UNKNOWN_SIZE) or + * Shape(UNKNOWN_SIZE, UNKNOWN_SIZE, UNKNOWN_SIZE). + *
    • Shape(32, UNKNOWN_SIZE) is compatible with all two-dimensional shapes with + * size 32 in the 0th dimension, and also Shape(UNKNOWN_SIZE, UNKNOWN_SIZE) and + * Shape.unknown(). It is not compatible with, for example, Shape(32) + * , Shape(32, UNKNOWN_SIZE, 1) or Shape(64, UNKNOWN_SIZE). + *
    • Shape(32, 784) is compatible with itself, and also + * Shape(32, UNKNOWN_SIZE), Shape(UNKNOWN_SIZE, 784), + * Shape(UNKNOWN_SIZE, UNKNOWN_SIZE) and Shape.unknown(). It is not + * compatible with, for example, Shape(32, 1, 784) or Shape(UNKNOWN_SIZE) + * . + *
    + * + *

    The compatibility relation is reflexive and symmetric, but not transitive. For example, + * Shape(32, 784) is compatible with Shape.unknown(), and + * Shape.unknown() is compatible with Shape(4, 4), but Shape(32, 784) + * is not compatible with Shape(4, 4). + * + *

    Compatibility is not the same as broadcasting. Compatible shapes must have the same number + * of dimensions and for each dimension pair, one dimension has to equal the other dimensions or + * at least one of the dimensions in the pair has to be UNKNOWN_SIZE. + * + *

    Broadcasting allows different dimensions, but paired dimensions have to either be equal, or + * one dimension must be 1. If one shape has less dimensions than another shape, the smaller shape + * is "stretched" with dimensions of 1. + * + * @param shape The other shape + * @return true, if the two shapes are compatible. + */ + public boolean isCompatibleWith(Shape shape) { + if (!this.isUnknown() && !shape.isUnknown()) { + if (numDimensions() != shape.numDimensions()) { + return false; + } + for (int i = 0; i < numDimensions(); i++) { + if (!isCompatible(get(i), shape.get(i))) { + return false; + } + } + } + return true; + } + + /** + * Test to see if two shape dimensions are compatible. + * + *

    The dimensions are compatible if either dimension is Shape.UNKNOWN_SIZE or both + * dimensions are equal + * + * @param dim the first dimension + * @param otherDim the second dimension + * @return true, if both dimensions are compatible + */ + public static boolean isCompatible(long dim, long otherDim) { + return dim == Shape.UNKNOWN_SIZE || otherDim == Shape.UNKNOWN_SIZE || dim == otherDim; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java new file mode 100644 index 00000000000..244550bb4a7 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/Shaped.java @@ -0,0 +1,44 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +/** Any data container with a given {@link Shape}. */ +public interface Shaped { + + /** + * @return the shape of this container + */ + Shape shape(); + + /** + * @return the rank of this container + */ + default int rank() { + return shape().numDimensions(); + } + + /** + * Computes and returns the total size of this container, in number of values. + * + *

    For example, given a 3x3x2 matrix, the return value will be 18. + * + * @return number of values in this element + */ + default long size() { + return shape().size(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java new file mode 100644 index 00000000000..1cf837cd15e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/ShortNdArray.java @@ -0,0 +1,115 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.index.Index; + +/** An {@link NdArray} of shorts. */ +public interface ShortNdArray extends NdArray { + + /** + * Returns the short value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2));  // matrix rank = 2
    +   * matrix.getShort(0, 1);  // succeeds, returns 0.0f
    +   * matrix.getShort(0);  // throws IllegalRankException
    +   *
    +   * ShortNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.getShort();  // succeeds, returns 0.0f
    +   * }
    + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + short getShort(long... coordinates); + + /** + * Assigns the short value of the scalar found at the given coordinates. + * + *

    To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + * + *

    {@code
    +   * ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2));  // matrix rank = 2
    +   * matrix.setShort(10.0f, 0, 1);  // succeeds
    +   * matrix.setShort(10.0f, 0);  // throws IllegalRankException
    +   *
    +   * ShortNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
    +   * scalar.setShort(10.0f);  // succeeds
    +   * }
    + * + * @param value value to assign + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + ShortNdArray setShort(short value, long... coordinates); + + @Override + ShortNdArray withShape(Shape shape); + + @Override + ShortNdArray slice(Index... coordinates); + + @Override + ShortNdArray get(long... coordinates); + + @Override + ShortNdArray set(NdArray src, long... coordinates); + + @Override + default Short getObject(long... coordinates) { + return getShort(coordinates); + } + + @Override + default ShortNdArray setObject(Short value, long... coordinates) { + return setShort(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + ShortNdArray copyTo(NdArray dst); + + @Override + ShortNdArray copyTo(DataBuffer dst); + + ShortNdArray copyTo(ShortDataBuffer dst); + + @Override + ShortNdArray copyFrom(DataBuffer src); + + ShortNdArray copyFrom(ShortDataBuffer src); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/SparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/SparseNdArray.java new file mode 100644 index 00000000000..ab91d1c1448 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/SparseNdArray.java @@ -0,0 +1,50 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray; + +/** + * Interface for Sparse Arrays + * + * @param the type that the array contains + * @param the type of dense NdArray + */ +public interface SparseNdArray> extends NdArray { + /** + * Gets the Indices + * + *

    Indices are a A 2-D long array of shape {@code [N, ndims]}, that specifies the indices of + * the elements in the sparse array that contain nonzero values (elements are zero-indexed). + * + *

    For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * coordinates {@code [1,3]} and {@code [2,4]} have nonzero values. + * + * @return the Indices + */ + LongNdArray getIndices(); + + /** + * Gets the values. + * + *

    Values are a 1-D array of any type and shape {@code [N]}, that supplies the values for each + * element in indices. + * + *

    For example, given {@code indices=[[1,3], [2,4]]}, and {@code values=[18, 3.6]} specifies + * that element {@code [1,3]} of the sparse array has a value of {@code 18}, and element {@code + * [2,4]} of the sparse array has a value of {@code 3.6}. + * + * @return the values + */ + U getValues(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/StdArrays.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/StdArrays.java new file mode 100644 index 00000000000..3ec5ec77df8 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/StdArrays.java @@ -0,0 +1,3898 @@ +package org.tensorflow.ndarray; + +import java.lang.reflect.Array; +import org.tensorflow.ndarray.buffer.DataBuffers; + +/** Utility class for working with {@link NdArray} instances mixed with standard Java arrays. */ +public final class StdArrays { + + /** + * Copy an array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[][] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[][][] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[][][][] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[][][][][] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of ints in a new {@link IntNdArray} + * + * @param array source array + * @return the {@code IntNdArray} copy + */ + public static IntNdArray ndCopyOf(int[][][][][][] array) { + IntNdArray ndArray = NdArrays.ofInts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[][] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[][][] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[][][][] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[][][][][] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of longs in a new {@link LongNdArray} + * + * @param array source array + * @return the {@code LongNdArray} copy + */ + public static LongNdArray ndCopyOf(long[][][][][][] array) { + LongNdArray ndArray = NdArrays.ofLongs(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[][] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[][][] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[][][][] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[][][][][] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of floats in a new {@link FloatNdArray} + * + * @param array source array + * @return the {@code FloatNdArray} copy + */ + public static FloatNdArray ndCopyOf(float[][][][][][] array) { + FloatNdArray ndArray = NdArrays.ofFloats(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[][] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[][][] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[][][][] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[][][][][] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of doubles in a new {@link DoubleNdArray} + * + * @param array source array + * @return the {@code DoubleNdArray} copy + */ + public static DoubleNdArray ndCopyOf(double[][][][][][] array) { + DoubleNdArray ndArray = NdArrays.ofDoubles(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[][] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[][][] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[][][][] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[][][][][] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of bytes in a new {@link ByteNdArray} + * + * @param array source array + * @return the {@code ByteNdArray} copy + */ + public static ByteNdArray ndCopyOf(byte[][][][][][] array) { + ByteNdArray ndArray = NdArrays.ofBytes(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[][] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[][][] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[][][][] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[][][][][] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of shorts in a new {@link ShortNdArray} + * + * @param array source array + * @return the {@code ShortNdArray} copy + */ + public static ShortNdArray ndCopyOf(short[][][][][][] array) { + ShortNdArray ndArray = NdArrays.ofShorts(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[][] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[][][] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[][][][] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[][][][][] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of booleans in a new {@link BooleanNdArray} + * + * @param array source array + * @return the {@code BooleanNdArray} copy + */ + public static BooleanNdArray ndCopyOf(boolean[][][][][][] array) { + BooleanNdArray ndArray = NdArrays.ofBooleans(shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy an array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 2-dimensional array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[][] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 3-dimensional array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[][][] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 4-dimensional array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[][][][] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 5-dimensional array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[][][][][] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a 6-dimensional array of objects in a new {@link NdArray} + * + * @param array source array + * @param data type + * @return the {@code NdArray} copy + */ + public static NdArray ndCopyOf(T[][][][][][] array) { + @SuppressWarnings("unchecked") + NdArray ndArray = NdArrays.ofObjects(componentTypeOf(array), shapeOf(array)); + copyTo(array, ndArray); + return ndArray; + } + + /** + * Copy a {@link IntNdArray} in a new 1-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static int[] array1dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + int[] array = new int[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link IntNdArray} in a new 2-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static int[][] array2dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + int[][] array = new int[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link IntNdArray} in a new 3-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static int[][][] array3dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + int[][][] array = new int[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link IntNdArray} in a new 4-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static int[][][][] array4dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + int[][][][] array = new int[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link IntNdArray} in a new 5-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static int[][][][][] array5dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + int[][][][][] array = new int[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link IntNdArray} in a new 6-dimension standard array of ints + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static int[][][][][][] array6dCopyOf(IntNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + int[][][][][][] array = new int[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 1-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static long[] array1dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + long[] array = new long[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 2-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static long[][] array2dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + long[][] array = new long[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 3-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static long[][][] array3dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + long[][][] array = new long[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 4-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static long[][][][] array4dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + long[][][][] array = new long[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 5-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static long[][][][][] array5dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + long[][][][][] array = new long[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link LongNdArray} in a new 6-dimension standard array of longs + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static long[][][][][][] array6dCopyOf(LongNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + long[][][][][][] array = new long[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 1-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static float[] array1dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + float[] array = new float[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 2-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static float[][] array2dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + float[][] array = new float[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 3-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static float[][][] array3dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + float[][][] array = new float[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 4-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static float[][][][] array4dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + float[][][][] array = new float[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 5-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static float[][][][][] array5dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + float[][][][][] array = new float[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link FloatNdArray} in a new 6-dimension standard array of floats + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static float[][][][][][] array6dCopyOf(FloatNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + float[][][][][][] array = new float[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 1-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static double[] array1dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + double[] array = new double[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 2-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static double[][] array2dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + double[][] array = new double[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 3-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static double[][][] array3dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + double[][][] array = new double[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 4-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static double[][][][] array4dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + double[][][][] array = new double[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 5-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static double[][][][][] array5dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + double[][][][][] array = new double[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link DoubleNdArray} in a new 6-dimension standard array of doubles + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static double[][][][][][] array6dCopyOf(DoubleNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + double[][][][][][] array = new double[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 1-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static byte[] array1dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + byte[] array = new byte[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 2-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static byte[][] array2dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + byte[][] array = new byte[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 3-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static byte[][][] array3dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + byte[][][] array = new byte[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 4-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static byte[][][][] array4dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + byte[][][][] array = new byte[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 5-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static byte[][][][][] array5dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + byte[][][][][] array = new byte[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ByteNdArray} in a new 6-dimension standard array of bytes + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static byte[][][][][][] array6dCopyOf(ByteNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + byte[][][][][][] array = new byte[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 1-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static short[] array1dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + short[] array = new short[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 2-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static short[][] array2dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + short[][] array = new short[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 3-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static short[][][] array3dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + short[][][] array = new short[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 4-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static short[][][][] array4dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + short[][][][] array = new short[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 5-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static short[][][][][] array5dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + short[][][][][] array = new short[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link ShortNdArray} in a new 6-dimension standard array of shorts + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static short[][][][][][] array6dCopyOf(ShortNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + short[][][][][][] array = new short[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 1-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[] array1dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 1); + boolean[] array = new boolean[dims[0]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 2-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[][] array2dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 2); + boolean[][] array = new boolean[dims[0]][dims[1]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 3-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[][][] array3dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 3); + boolean[][][] array = new boolean[dims[0]][dims[1]][dims[2]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 4-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[][][][] array4dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 4); + boolean[][][][] array = new boolean[dims[0]][dims[1]][dims[2]][dims[3]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 5-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[][][][][] array5dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 5); + boolean[][][][][] array = new boolean[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link BooleanNdArray} in a new 6-dimension standard array of booleans + * + * @param ndArray source array + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static boolean[][][][][][] array6dCopyOf(BooleanNdArray ndArray) { + int[] dims = computeArrayDims(ndArray, 6); + boolean[][][][][][] array = new boolean[dims[0]][dims[1]][dims[2]][dims[3]][dims[4]][dims[5]]; + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 1-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-1 or has a shape that + * exceeds standard arrays limits + */ + public static T[] array1dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 1); + T[] array = (T[]) Array.newInstance(objectType, dims[0]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 2-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-2 or has a shape that + * exceeds standard arrays limits + */ + public static T[][] array2dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 2); + T[][] array = (T[][]) Array.newInstance(objectType, dims[0], dims[1]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 3-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-3 or has a shape that + * exceeds standard arrays limits + */ + public static T[][][] array3dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 3); + T[][][] array = (T[][][]) Array.newInstance(objectType, dims[0], dims[1], dims[2]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 4-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-4 or has a shape that + * exceeds standard arrays limits + */ + public static T[][][][] array4dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 4); + T[][][][] array = (T[][][][]) Array.newInstance(objectType, dims[0], dims[1], dims[2], dims[3]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 5-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-5 or has a shape that + * exceeds standard arrays limits + */ + public static T[][][][][] array5dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 5); + T[][][][][] array = + (T[][][][][]) Array.newInstance(objectType, dims[0], dims[1], dims[2], dims[3], dims[4]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy a {@link NdArray NdArray<T>} in a new 6-dimension standard array of objects + * + * @param ndArray source array + * @param objectType type of object + * @param data type + * @return the array copy + * @throws IllegalArgumentException if {@code ndArray} is not of rank-6 or has a shape that + * exceeds standard arrays limits + */ + public static T[][][][][][] array6dCopyOf(NdArray ndArray, Class objectType) { + int[] dims = computeArrayDims(ndArray, 6); + T[][][][][][] array = + (T[][][][][][]) + Array.newInstance(objectType, dims[0], dims[1], dims[2], dims[3], dims[4], dims[5]); + copyFrom(ndArray, array); + return array; + } + + /** + * Copy an array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[] src, IntNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[][] src, IntNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[][][] src, IntNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[][][][] src, IntNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[][][][][] src, IntNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of ints into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(int[][][][][][] src, IntNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[] src, LongNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[][] src, LongNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[][][] src, LongNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[][][][] src, LongNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[][][][][] src, LongNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of longs into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(long[][][][][][] src, LongNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[] src, FloatNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[][] src, FloatNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[][][] src, FloatNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[][][][] src, FloatNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[][][][][] src, FloatNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of floats into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(float[][][][][][] src, FloatNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[] src, DoubleNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[][] src, DoubleNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[][][] src, DoubleNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[][][][] src, DoubleNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[][][][][] src, DoubleNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of doubles into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(double[][][][][][] src, DoubleNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[] src, ByteNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[][] src, ByteNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[][][] src, ByteNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[][][][] src, ByteNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[][][][][] src, ByteNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of bytes into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(byte[][][][][][] src, ByteNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[] src, ShortNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[][] src, ShortNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[][][] src, ShortNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[][][][] src, ShortNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[][][][][] src, ShortNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of shorts into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(short[][][][][][] src, ShortNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[] src, BooleanNdArray dst) { + NdArrays.vectorOf(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[][] src, BooleanNdArray dst) { + dst.elements(0).forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[][][] src, BooleanNdArray dst) { + dst.elements(1) + .forEachIndexed((idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[][][][] src, BooleanNdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[][][][][] src, BooleanNdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf(src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of booleans into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(boolean[][][][][][] src, BooleanNdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOf( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy an array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-1 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-1 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[] src, NdArray dst) { + NdArrays.vectorOfObjects(src).copyTo(dst); + } + + /** + * Copy a 2-dimensional array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-2 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-2 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[][] src, NdArray dst) { + dst.elements(0) + .forEachIndexed((idx, e) -> NdArrays.vectorOfObjects(src[(int) idx[0]]).copyTo(e)); + } + + /** + * Copy a 3-dimensional array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-3 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-3 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[][][] src, NdArray dst) { + dst.elements(1) + .forEachIndexed( + (idx, e) -> NdArrays.vectorOfObjects(src[(int) idx[0]][(int) idx[1]]).copyTo(e)); + } + + /** + * Copy a 4-dimensional array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-4 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-4 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[][][][] src, NdArray dst) { + dst.elements(2) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOfObjects(src[(int) idx[0]][(int) idx[1]][(int) idx[2]]).copyTo(e)); + } + + /** + * Copy a 5-dimensional array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-5 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-5 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[][][][][] src, NdArray dst) { + dst.elements(3) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOfObjects( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]]) + .copyTo(e)); + } + + /** + * Copy a 6-dimensional array of objects into the {@code dst} {@link NdArray} + * + * @param src source array + * @param dst destination rank-6 array + * @param data type + * @throws IllegalArgumentException if {@code dst} is not of rank-6 or has an incompatible shape + * with the source array + */ + public static void copyTo(T[][][][][][] src, NdArray dst) { + dst.elements(4) + .forEachIndexed( + (idx, e) -> + NdArrays.vectorOfObjects( + src[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]]) + .copyTo(e)); + } + + /** + * Copy a {@link NdArray} to an array of ints + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of ints + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of ints + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of ints + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of ints + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of ints + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(IntNdArray src, int[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of longs + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of longs + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of longs + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of longs + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of longs + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of longs + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(LongNdArray src, long[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of floats + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of floats + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of floats + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of floats + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of floats + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of floats + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(FloatNdArray src, float[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of doubles + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of doubles + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of doubles + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of doubles + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of doubles + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of doubles + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(DoubleNdArray src, double[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of bytes + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of bytes + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of bytes + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of bytes + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of bytes + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of bytes + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ByteNdArray src, byte[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of shorts + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of shorts + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of shorts + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of shorts + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of shorts + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of shorts + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(ShortNdArray src, short[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of booleans. + * + * @param src source rank-1 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of booleans + * + * @param src source rank-2 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of booleans + * + * @param src source rank-3 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of booleans + * + * @param src source rank-4 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of booleans + * + * @param src source rank-5 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of booleans + * + * @param src source rank-6 array + * @param dst destination array + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(BooleanNdArray src, boolean[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Copy a {@link NdArray} to an array of objects + * + * @param src source rank-1 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-1 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[] dst) { + if (src.rank() != 1) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + if (src.size() > dst.length) { + throw new ArrayIndexOutOfBoundsException(String.valueOf(src.size()) + " > " + dst.length); + } + src.copyTo(DataBuffers.of(dst, false, false)); + } + + /** + * Copy a {@link NdArray} to a 2-dimensional array of objects + * + * @param src source rank-2 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-2 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[][] dst) { + if (src.rank() != 2) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(0).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]])); + } + + /** + * Copy a {@link NdArray} to a 3-dimensional array of objects + * + * @param src source rank-3 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-3 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[][][] dst) { + if (src.rank() != 3) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(1).forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]])); + } + + /** + * Copy a {@link NdArray} to a 4-dimensional array of objects + * + * @param src source rank-4 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-4 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[][][][] dst) { + if (src.rank() != 4) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(2) + .forEachIndexed((idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]])); + } + + /** + * Copy a {@link NdArray} to a 5-dimensional array of objects + * + * @param src source rank-5 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-5 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[][][][][] dst) { + if (src.rank() != 5) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(3) + .forEachIndexed( + (idx, e) -> copyFrom(e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]])); + } + + /** + * Copy a {@link NdArray} to a 6-dimensional array of objects + * + * @param src source rank-6 array + * @param dst destination array + * @param data type + * @throws IllegalArgumentException if {@code src} is not of rank-6 + * @throws ArrayIndexOutOfBoundsException if not all elements of {@code src} can fit it the + * destination array + */ + public static void copyFrom(NdArray src, T[][][][][][] dst) { + if (src.rank() != 6) { + throw new IllegalArgumentException( + "Array cannot be copied from NdArray of rank " + src.rank()); + } + src.elements(4) + .forEachIndexed( + (idx, e) -> + copyFrom( + e, dst[(int) idx[0]][(int) idx[1]][(int) idx[2]][(int) idx[3]][(int) idx[4]])); + } + + /** + * Compute the shape of an int array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(int[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional int array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(int[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional int array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(int[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional int array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(int[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional int array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(int[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional int array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(int[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a long array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(long[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional long array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(long[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional long array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(long[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional long array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(long[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional long array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(long[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional long array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(long[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a float array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(float[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional float array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(float[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional float array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(float[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional float array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(float[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional float array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(float[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional float array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(float[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a double array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(double[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional double array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(double[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional double array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(double[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional double array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(double[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional double array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(double[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional double array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(double[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a byte array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(byte[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional byte array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(byte[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional byte array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(byte[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional byte array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(byte[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional byte array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(byte[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional byte array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(byte[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a short array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(short[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional short array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(short[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional short array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(short[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional short array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(short[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional short array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(short[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional short array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(short[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of a boolean array. + * + * @param array 1D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional boolean array. + * + * @param array 2D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional boolean array. + * + * @param array 3D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional boolean array. + * + * @param array 4D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional boolean array. + * + * @param array 5D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional boolean array. + * + * @param array 6D array + * @return shape of the array + */ + public static Shape shapeOf(boolean[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + /** + * Compute the shape of an object array. + * + * @param array 1D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[] array) { + return Shape.of(array.length); + } + + /** + * Compute the shape of a 2-dimensional object array. + * + * @param array 2D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[][] array) { + return Shape.of(computeShape(array, new long[2])); + } + + /** + * Compute the shape of a 3-dimensional object array. + * + * @param array 3D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[][][] array) { + return Shape.of(computeShape(array, new long[3])); + } + + /** + * Compute the shape of a 4-dimensional object array. + * + * @param array 4D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[][][][] array) { + return Shape.of(computeShape(array, new long[4])); + } + + /** + * Compute the shape of a 5-dimensional object array. + * + * @param array 5D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[][][][][] array) { + return Shape.of(computeShape(array, new long[5])); + } + + /** + * Compute the shape of a 6-dimensional object array. + * + * @param array 6D array + * @param data type + * @return shape of the array + */ + public static Shape shapeOf(T[][][][][][] array) { + return Shape.of(computeShape(array, new long[6])); + } + + private static void dimSize(int arrayLength, long[] shape, int dimIdx) { + if (shape[dimIdx] == 0) { + shape[dimIdx] = arrayLength; + } else if (shape[dimIdx] != arrayLength) { + shape[dimIdx] = Shape.UNKNOWN_SIZE; + } + } + + private static long[] computeShape(int[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(int[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(int[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(int[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(int[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(long[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(long[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(long[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(long[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(long[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(float[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(float[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(float[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(float[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(float[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(double[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(double[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(double[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(double[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(double[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(byte[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(byte[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(byte[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(byte[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(byte[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(short[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(short[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(short[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(short[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(short[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(boolean[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(boolean[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(boolean[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(boolean[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(boolean[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(T[][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 2); + for (int i = 0; i < array.length; ++i) { + if (array[i] == null) { + throw new IllegalStateException("One of the subarray is null"); + } + dimSize(array[i].length, shape, shape.length - 1); + } + return shape; + } + + private static long[] computeShape(T[][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 3); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(T[][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 4); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(T[][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 5); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static long[] computeShape(T[][][][][][] array, long[] shape) { + if (array == null) { + throw new IllegalStateException("The array or one of its subarray is null"); + } + dimSize(array.length, shape, shape.length - 6); + for (int i = 0; i < array.length; ++i) { + computeShape(array[i], shape); + } + return shape; + } + + private static Class componentTypeOf(Object array) { + Class componentType = array.getClass().getComponentType(); + while (componentType.isArray()) { + componentType = componentType.getComponentType(); + } + return (Class) componentType; + } + + private static int[] computeArrayDims(NdArray ndArray, int expectedRank) { + Shape shape = ndArray.shape(); + if (shape.numDimensions() != expectedRank) { + throw new IllegalArgumentException("NdArray must be of rank " + expectedRank); + } + int[] arrayShape = new int[expectedRank]; + for (int i = 0; i < expectedRank; ++i) { + long dimSize = shape.get(i); + if (dimSize > Integer.MAX_VALUE) { + throw new IllegalArgumentException( + "Dimension " + i + " is too large to fit in a standard array (" + shape.get(i) + ")"); + } + arrayShape[i] = (int) dimSize; + } + return arrayShape; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java new file mode 100644 index 00000000000..f1a1dc3cacf --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/BooleanDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of booleans. */ +public interface BooleanDataBuffer extends DataBuffer { + + /** + * Reads the boolean at the given index. + * + * @param index the index from which the float will be read + * @return the boolean at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + boolean getBoolean(long index); + + /** + * Writes the given boolean into this buffer at the given index. + * + * @param value the boolean to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + BooleanDataBuffer setBoolean(boolean value, long index); + + /** + * Bulk get method, using boolean arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default BooleanDataBuffer read(boolean[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using boolean arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + BooleanDataBuffer read(boolean[] dst, int offset, int length); + + /** + * Bulk put method, using boolean arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default BooleanDataBuffer write(boolean[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using boolean arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + BooleanDataBuffer write(boolean[] src, int offset, int length); + + @Override + default Boolean getObject(long index) { + return getBoolean(index); + } + + @Override + default BooleanDataBuffer setObject(Boolean value, long index) { + return setBoolean(value, index); + } + + @Override + BooleanDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default BooleanDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default BooleanDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + BooleanDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java new file mode 100644 index 00000000000..72610170fb7 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ByteDataBuffer.java @@ -0,0 +1,225 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of bytes. */ +public interface ByteDataBuffer extends DataBuffer { + + /** + * Reads the byte at the given index. + * + * @param index the index from which the float will be read + * @return the byte at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + byte getByte(long index); + + /** + * Writes the given byte into this buffer at the given index. + * + * @param value the byte to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ByteDataBuffer setByte(byte value, long index); + + /** + * Bulk get method, using byte arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default ByteDataBuffer read(byte[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using byte arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + ByteDataBuffer read(byte[] dst, int offset, int length); + + /** + * Bulk put method, using byte arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default ByteDataBuffer write(byte[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using byte arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ByteDataBuffer write(byte[] src, int offset, int length); + + /** + * Return this byte buffer as a buffer of ints. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link IntDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + IntDataBuffer asInts(); + + /** + * Return this byte buffer as a buffer of shorts. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link ShortDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + ShortDataBuffer asShorts(); + + /** + * Return this byte buffer as a buffer of longs. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link LongDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + LongDataBuffer asLongs(); + + /** + * Return this byte buffer as a buffer of floats. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link FloatDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + FloatDataBuffer asFloats(); + + /** + * Return this byte buffer as a buffer of doubles. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link DoubleDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + DoubleDataBuffer asDoubles(); + + /** + * Return this byte buffer as a buffer of booleans. + * + *

    The returned buffer provides a different view on the same memory as the original byte + * buffer, meaning that changing a value in one will affect the other. + * + * @return this buffer as a {@link BooleanDataBuffer} + * @throws IllegalStateException if this buffer cannot be converted + */ + BooleanDataBuffer asBooleans(); + + @Override + default Byte getObject(long index) { + return getByte(index); + } + + @Override + default ByteDataBuffer setObject(Byte value, long index) { + return setByte(value, index); + } + + @Override + ByteDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default ByteDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default ByteDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + ByteDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java new file mode 100644 index 00000000000..e21c45d345c --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffer.java @@ -0,0 +1,322 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A container of data of a specific type. + * + *

    Instances of {@code DataBuffer} map native or heap memory segments to a linear view that + * supports: + * + *

      + *
    • 64-bits indexing, allowing to work with buffer larger than 231 bytes + *
    • Storage of object of any types and not only primitives + *
    • Generic types allows to work directly with boxed types as well, which does not require + * explicit buffer types as with the standard JDK buffers. + *
    + * + * It is important to note that there is no guarantee the memory managed by a {@code DataBuffer} is + * linear, specially when dealing with non-primitive types or large buffers. + * + * @param type of data stored in this buffer + */ +public interface DataBuffer { + + /** + * Size of the buffer, in elements. + * + *

    For exemple, in case of a byte buffer, this value is equal to the number of bytes this + * buffer can hold. For an integer buffer, it is equal to the number of integers, therefore the + * size in bytes of this buffer is {@code size() * Integer.BYTES}. + * + * @return the buffer size + */ + long size(); + + /** + * Tells whether or not this buffer is backed by an accessible array. + * + * @return true if, and only if, this buffer is read-only + */ + boolean isReadOnly(); + + /** + * Reads the value at the given index. + * + *

    Important: Usage of this method should be limited to buffers of non-primitive types + * or when the data type is not deterministically known by the caller. In any other case, prefer + * the usage of its primitive variant which will significantly improve performances (e.g. {@code + * IntDataBuffer.getInt(idx)} + * + * @param index the index from which the float will be read + * @return the value at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + T getObject(long index); + + /** + * Writes the given value into this buffer at the given index. + * + *

    Important: Usage of this method should be limited to buffers of non-primitive types + * or when the data type is not deterministically known by the caller. In any other case, prefer + * the usage of its primitive variant which will significantly improve performances (e.g. {@code + * IntDataBuffer.setInt(idx)} + * + * @param value the value to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DataBuffer setObject(T value, long index); + + /** + * Read the references of the objects in this buffer into the destination array. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default DataBuffer read(T[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Read the references of the objects in this buffer into the destination array. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + DataBuffer read(T[] dst, int offset, int length); + + /** + * Write the references of the objects in the source array into this buffer. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default DataBuffer write(T[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using int arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DataBuffer write(T[] src, int offset, int length); + + /** + * Write the references of the objects in the source array into this buffer. + * + *

    If there are more values to copy than the destination buffer size, i.e. {@code size > + * dst.size()}, then no values are transferred and a BufferOverflowException is thrown. On the + * other hand, if there are more values to copy that the source buffer size, i.e. {@code > + * src.size()}, then a BufferUnderfloatException is thrown. + * + *

    Otherwise, this method copies {@code n = size} values from this buffer into the destination + * buffer. + * + * @param dst the destination buffer into which values are copied; must not be this buffer + * @param size number of values to copy to the destination buffer + * @return this buffer + * @throws IllegalArgumentException if the destination buffer is this buffer + * @throws ReadOnlyBufferException if the destination buffer is read-only + * @throws java.nio.BufferOverflowException if there is not enough space in destination buffer + * @throws java.nio.BufferUnderflowException if there are not enough values in the source buffer + */ + DataBuffer copyTo(DataBuffer dst, long size); + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content, starting + * at the given index. + * + *

    The index must not be greater than this buffer size. Changes to this buffer's content will + * be visible in the new buffer and vice versa. The new buffer will be read-only if, and only if, + * this buffer is read-only. + * + *

    This call is equivalent to {@link #slice(long, long) slice(index, size() - index)} + * + * @param index index of the first value of the new buffer created, must not be greater than + * {@code size()} + * @return the new buffer + * @throws IllegalArgumentException if index do not pass validation checks + */ + default DataBuffer offset(long index) { + return slice(index, size() - index); + } + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content, whose size + * is set to the given value. + * + *

    The new size must not be greater than this buffer size. Changes to this buffer's content + * will be visible in the new buffer and vice versa. The new buffer will be read-only if, and only + * if, this buffer is read-only. + * + *

    This call is equivalent to {@link #slice(long, long) slice(0, size)} + * + * @param size size of this new buffer + * @return the new buffer + * @throws IllegalArgumentException if index and/or size values do not pass validation checks + */ + default DataBuffer narrow(long size) { + return slice(0, size); + } + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content, starting + * at the given index and of the given size. + * + *

    The index plus the new size must not be greater than this buffer size. Changes to this + * buffer's content will be visible in the new buffer and vice versa. The new buffer will be + * read-only if, and only if, this buffer is read-only. + * + * @param index index of the first value of the new buffer created + * @param size size of this new buffer, must not be greater than {@code size()} + * @return the new buffer + * @throws IllegalArgumentException if size value do not pass validation checks + */ + DataBuffer slice(long index, long size); + + /** + * Creates a {@link DataBufferWindow} that provides a partial view of this buffer. + * + *

    The created window has a fixed size and can {@link DataBufferWindow#slide(long) "slide"} + * along this buffer to provide different views of the data without allocating a new buffer + * instance, like {@link #offset(long)} does. This improves overall performance when this + * operation is repeated frequently. For example: + * + *

    {@code
    +   * IntDataBuffer bufferA = DataBuffers.ofInts(1024);
    +   * // ... init buffer data
    +   * IntDataBuffer bufferB = DataBuffers.ofInts(1, 2, 3, 4);
    +   *
    +   * // Return the index of the first occurrence of bufferB in bufferA using a sliding window
    +   * DataBufferWindow windowA = bufferA.window(4);
    +   * for (int i = 0; i < bufferA.size() - bufferB.size(); ++i) {
    +   *     if (windowA.slideTo(i).buffer().equals(bufferB)) {
    +   *         return i;
    +   *     }
    +   * }
    +   * }
    + * + *

    The returned object is stateful and is not thread-safe. + * + * @param size size of the window + * @return a new window that starts at the index 0 of this buffer + * @throws UnsupportedOperationException if this type of buffer does not support buffer windows + */ + default DataBufferWindow> window(long size) { + throw new UnsupportedOperationException(); + } + + /** + * Visits the backing storage of this buffer. + * + *

    The buffer implementation is responsible of passing back a reference to the actual data + * storage to the provided visitor. The visitor does not have to handle all possible types of data + * storage and can override only methods for storage it is actually interested in. For any other + * type of storage, this call will fallback to {@link DataStorageVisitor#fallback()} so the + * visitor can execute some generic routine if needed. + * + * @param visitor visits the data storage of this buffer + * @param type of value returned by the visitor + * @return the same value returned by the visitor + */ + default R accept(DataStorageVisitor visitor) { + return visitor.fallback(); + } + + /** + * Checks equality between data buffers. + * + *

    A data buffer is equal to another object if this object is another {@link DataBuffer} of the + * same size, type and the elements are equal and in the same order. For example: + * + *

    {@code
    +   * IntDataBuffer buffer = DataBuffers.of(1, 2, 3);
    +   *
    +   * assertEquals(buffer, DataBuffers.of(1, 2, 3));  // true
    +   * assertEquals(buffer, DataBuffers.ofObjects(1, 2, 3));  // true, as Integers are equal to ints
    +   * assertNotEquals(buffer, DataBuffers.of(1, 2, 3, 0));  // false, different sizes
    +   * assertNotEquals(buffer, DataBuffers.of(1, 3, 2));  // false, different order
    +   * assertNotEquals(buffer, DataBuffers.of(1L, 2L, 3L));  // false, different types
    +   * }
    + * + *

    Note that the computation required to verify equality between two buffers can be expensive + * in some cases and therefore, it is recommended to not use this method in a critical path where + * performances matter. + * + * @param obj object to compare this buffer with + * @return true if this buffer is equal to the provided object + */ + @Override + boolean equals(Object obj); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBufferWindow.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBufferWindow.java new file mode 100644 index 00000000000..c153200fd5f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBufferWindow.java @@ -0,0 +1,88 @@ +package org.tensorflow.ndarray.buffer; + +/** + * A mutable container for viewing part of a {@link DataBuffer}. + * + *

    Data buffer windows have a fixed size and can {@link DataBufferWindow#slide(long) "slide"} + * along a buffer to provide different views of the data without allocating a new buffer instance, + * like {@link DataBuffer#offset(long)} does. This improves overall performance when this operation + * is repeated frequently. For example: + * + *

    {@code
    + * IntDataBuffer bufferA = DataBuffers.ofInts(1024);
    + * // ... init buffer data
    + * IntDataBuffer bufferB = DataBuffers.ofInts(1, 2, 3, 4);
    + *
    + * // Return the index of the first occurrence of bufferB in bufferA using a sliding window
    + * DataBufferWindow windowA = bufferA.window(4);
    + * for (int i = 0; i < bufferA.size() - bufferB.size(); ++i) {
    + *     if (windowA.slideTo(i).buffer().equals(bufferB)) {
    + *         return i;
    + *     }
    + * }
    + * }
    + * + *

    {@code DataBufferWindow} instances are stateful and not thread-safe. + * + * @param the type of buffer being viewed + */ +public interface DataBufferWindow> { + + /** Returns the current offset of this window in the original buffer. */ + long offset(); + + /** Returns the size of this buffer window. */ + long size(); + + /** + * Moves the window at the given position in the original buffer. + * + *

    The size of the window remains the same and its offset is set to {@code index}, so that + * accessing the value of {@link #buffer()} at index {@code x} will return the value at {@code + * index + x} in the original buffer. + * + * @param index new offset for this window + * @return this instance + * @throws IndexOutOfBoundsException if the window cannot be slid because it goes beyond the + * original buffer limits + */ + DataBufferWindow slideTo(long index); + + /** + * Moves the window of {@code step} elements in the original buffer. + * + *

    The size of the window remains the same and its offset is set to {@code offset() + step}. If + * {@code step} is positive, then the window will slide forward. If it is negative, it will slide + * backward. + * + * @param step value to add to the current offset of this window + * @return this instance + * @throws IndexOutOfBoundsException if the window cannot be slid because it goes beyond the + * original buffer limits + */ + DataBufferWindow slide(long step); + + /** + * Returns the buffer backing this window. + * + *

    Each window instance has it's own buffer providing a view onto the original {@link + * DataBuffer}. The buffers are mutated when the window slides to different offsets. For example: + * + *

    {@code
    +   * IntDataBuffer buffer = DataBuffers.of(0, 1, 2, 3);
    +   * DataBufferWindow window = buffer.window(0, 2);
    +   *
    +   * IntDataBuffer windowBuffer = window.buffer();
    +   * assertEquals(0, windowBuffer.getInt(0));
    +   * assertEquals(1, windowBuffer.getInt(1));
    +   *
    +   * window.slideTo(2);
    +   * assertEquals(2, windowBuffer.getInt(0));
    +   * assertEquals(3, windowBuffer.getInt(1));
    +   * assertSame(windowBuffer, window.buffer());
    +   * }
    + * + * @return this window's buffer + */ + B buffer(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffers.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffers.java new file mode 100644 index 00000000000..cc60aa8a68a --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataBuffers.java @@ -0,0 +1,463 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.lang.reflect.Array; +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import java.util.Arrays; +import java.util.BitSet; +import org.tensorflow.ndarray.impl.buffer.Validator; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +/** Helper class for creating {@code DataBuffer} instances. */ +public final class DataBuffers { + + /** + * Creates a buffer of bytes that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static ByteDataBuffer ofBytes(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new byte[(int) size], false); + } + return NioDataBufferFactory.create(ByteBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of longs that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static LongDataBuffer ofLongs(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new long[(int) size], false); + } + return NioDataBufferFactory.create(LongBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of integers that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static IntDataBuffer ofInts(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new int[(int) size], false); + } + return NioDataBufferFactory.create(IntBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of shorts that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static ShortDataBuffer ofShorts(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new short[(int) size], false); + } + return NioDataBufferFactory.create(ShortBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of doubles that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static DoubleDataBuffer ofDoubles(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new double[(int) size], false); + } + return NioDataBufferFactory.create(DoubleBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of floats that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static FloatDataBuffer ofFloats(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new float[(int) size], false); + } + return NioDataBufferFactory.create(FloatBuffer.allocate((int) size)); + } + + /** + * Creates a buffer of booleans that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static BooleanDataBuffer ofBooleans(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new boolean[(int) size], false); + } + return MiscDataBufferFactory.create(new BitSet((int) size), size, false); + } + + /** + * Creates a buffer of references to objects of type {@code clazz` that can store up to `size} + * values. + * + * @param type the type of object stored in this buffer + * @param size size of the buffer to allocate + * @param data type + * @return a new buffer + */ + public static DataBuffer ofObjects(Class type, long size) { + Validator.createArgs(size, MAX_32BITS); + @SuppressWarnings("unchecked") + T[] array = (T[]) Array.newInstance(type, (int) size); + return MiscDataBufferFactory.create(array, false); + } + + /** + * Create a buffer from an array of floats into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(float[], boolean, boolean) of(values, false, + * false}} + * + * @param values float values + * @return a new buffer + */ + public static FloatDataBuffer of(float... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of bytes into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(byte[], boolean, boolean) of(values, false, + * false}} + * + * @param values byte values + * @return a new buffer + */ + public static ByteDataBuffer of(byte... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of longs into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(long[], boolean, boolean) of(values, false, + * false}} + * + * @param values long values + * @return a new buffer + */ + public static LongDataBuffer of(long... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of ints into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(int[], boolean, boolean) of(values, false, + * false}} + * + * @param values int values + * @return a new buffer + */ + public static IntDataBuffer of(int... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of shorts into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(short[], boolean, boolean) of(values, false, + * false}} + * + * @param values short values + * @return a new buffer + */ + public static ShortDataBuffer of(short... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of doubles into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(double[], boolean, boolean) of(array, false, + * false}} + * + * @param values double values + * @return a new buffer + */ + public static DoubleDataBuffer of(double... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of booleans into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(boolean[], boolean, boolean) of(values, false, + * false}} + * + * @param values booleans values + * @return a new buffer + */ + public static BooleanDataBuffer of(boolean... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of objects into a data buffer. + * + *

    The returned buffer allows read and write operations and share the memory of the source + * array, which is equivalent to call {@link #of(Object[], boolean, boolean) of(values, false, + * false}} + * + * @param values objects values + * @param data type + * @return a new buffer + */ + @SafeVarargs + public static DataBuffer ofObjects(T... values) { + return of(values, false, false); + } + + /** + * Create a buffer from an array of floats into a data buffer. + * + * @param array array of floats + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static FloatDataBuffer of(float[] array, boolean readOnly, boolean makeCopy) { + float[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + FloatBuffer buf = FloatBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of bytes into a data buffer. + * + * @param array array of bytes + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ByteDataBuffer of(byte[] array, boolean readOnly, boolean makeCopy) { + byte[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + ByteBuffer buf = ByteBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of longs into a data buffer. + * + * @param array array of longs + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static LongDataBuffer of(long[] array, boolean readOnly, boolean makeCopy) { + long[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + LongBuffer buf = LongBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of ints into a data buffer. + * + * @param array array of ints + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static IntDataBuffer of(int[] array, boolean readOnly, boolean makeCopy) { + int[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + IntBuffer buf = IntBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of shorts into a data buffer. + * + * @param array array of shorts + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ShortDataBuffer of(short[] array, boolean readOnly, boolean makeCopy) { + short[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + ShortBuffer buf = ShortBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of doubles into a data buffer. + * + * @param array array of doubles + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static DoubleDataBuffer of(double[] array, boolean readOnly, boolean makeCopy) { + double[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + DoubleBuffer buf = DoubleBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of booleans into a data buffer. + * + * @param array array of booleans + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static BooleanDataBuffer of(boolean[] array, boolean readOnly, boolean makeCopy) { + boolean[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + return MiscDataBufferFactory.create(bufferArray, readOnly); + } + + /** + * Create a buffer from an array of objects into a data buffer. + * + * @param array array of objects + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @param data type + * @return a new buffer + */ + public static DataBuffer of(T[] array, boolean readOnly, boolean makeCopy) { + T[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + return MiscDataBufferFactory.create(bufferArray, readOnly); + } + + /** + * Wraps a JDK NIO {@link ByteBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static ByteDataBuffer of(ByteBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link IntBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static IntDataBuffer of(IntBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link ShortBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static ShortDataBuffer of(ShortBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link LongBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static LongDataBuffer of(LongBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link FloatBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static FloatDataBuffer of(FloatBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link DoubleBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static DoubleDataBuffer of(DoubleBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /* + * The maximum size for a buffer of this type, i.e. the maximum number of bytes it can store. + *

    + * As the maximum size may vary depending on the JVM implementation and on the platform, this + * property returns a value that is safe for most of them. + */ + static long MAX_32BITS = Integer.MAX_VALUE - 10; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataStorageVisitor.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataStorageVisitor.java new file mode 100644 index 00000000000..fa6ef03e570 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DataStorageVisitor.java @@ -0,0 +1,147 @@ +package org.tensorflow.ndarray.buffer; + +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import java.util.BitSet; + +/** + * Visit the backing storage of {@link DataBuffer} instances. + * + * @param value type returned by the visitor + */ +public interface DataStorageVisitor { + + /** + * Visit the {@link ByteBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(ByteBuffer buffer) { + return fallback(); + } + + /** + * Visit the {@link ShortBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(ShortBuffer buffer) { + return fallback(); + } + + /** + * Visit the {@link IntBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(IntBuffer buffer) { + return fallback(); + } + + /** + * Visit the {@link LongBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(LongBuffer buffer) { + return fallback(); + } + + /** + * Visit the {@link FloatBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(FloatBuffer buffer) { + return fallback(); + } + + /** + * Visit the {@link DoubleBuffer} backing a given instance of a {@link DataBuffer} + * + * @param buffer underlying buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(DoubleBuffer buffer) { + return fallback(); + } + + /** + * Visit the boolean array backing a given instance of a {@link DataBuffer} + * + * @param array underlying array + * @param offset offset of the buffer within the array + * @param length length of the buffer within the array + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(boolean[] array, int offset, int length) { + return fallback(); + } + + /** + * Visit the bit set backing a given instance of a {@link DataBuffer} + * + * @param bitSet underlying bit set + * @param offset offset of the buffer within the bit set + * @param numBits number of bits used to represent the buffer within the bit set + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(BitSet bitSet, int offset, long numBits) { + return fallback(); + } + + /** + * Visit the object array backing a given instance of a {@link DataBuffer} + * + * @param array underlying array + * @param offset offset of the buffer within the array + * @param length length of the buffer within the array + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(Object[] array, int offset, int length) { + return fallback(); + } + + /** + * Visit the raw memory segment of a given instance of a {@link DataBuffer} + * + * @param address native address of the buffer + * @param length length of the buffer + * @param scale number of bytes required to store a single value of this buffer + * @return any value + * @see DataBuffer#accept(DataStorageVisitor) + */ + default R visit(long address, long length, long scale) { + return fallback(); + } + + /** + * Fallback method called if the visitor implementation does not support the type of backing + * storage for a given {@link DataBuffer} + * + *

    The implementor of this interface must override the {@code visit} methods for type of + * storage it supports. If {@link DataBuffer#accept(DataStorageVisitor)} is called on a buffer + * using a different type of storage, the invocation will fallback to this method. + * + * @return any value + */ + R fallback(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java new file mode 100644 index 00000000000..50367c38a06 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/DoubleDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of doubles. */ +public interface DoubleDataBuffer extends DataBuffer { + + /** + * Reads the double at the given index. + * + * @param index the index from which the float will be read + * @return the double at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + double getDouble(long index); + + /** + * Writes the given double into this buffer at the given index. + * + * @param value the double to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DoubleDataBuffer setDouble(double value, long index); + + /** + * Bulk get method, using double arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default DoubleDataBuffer read(double[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using double arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + DoubleDataBuffer read(double[] dst, int offset, int length); + + /** + * Bulk put method, using double arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default DoubleDataBuffer write(double[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using double arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DoubleDataBuffer write(double[] src, int offset, int length); + + @Override + default Double getObject(long index) { + return getDouble(index); + } + + @Override + default DoubleDataBuffer setObject(Double value, long index) { + return setDouble(value, index); + } + + @Override + DoubleDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default DoubleDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default DoubleDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + DoubleDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java new file mode 100644 index 00000000000..45e389a559e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/FloatDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of floats. */ +public interface FloatDataBuffer extends DataBuffer { + + /** + * Reads the float at the given index. + * + * @param index the index from which the float will be read + * @return the float at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + float getFloat(long index); + + /** + * Writes the given float into this buffer at the given index. + * + * @param value the float to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + FloatDataBuffer setFloat(float value, long index); + + /** + * Bulk get method, using float arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default FloatDataBuffer read(float[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using float arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + FloatDataBuffer read(float[] dst, int offset, int length); + + /** + * Bulk put method, using float arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default FloatDataBuffer write(float[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using float arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + FloatDataBuffer write(float[] src, int offset, int length); + + @Override + default Float getObject(long index) { + return getFloat(index); + } + + @Override + default FloatDataBuffer setObject(Float value, long index) { + return setFloat(value, index); + } + + @Override + FloatDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default FloatDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default FloatDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + FloatDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java new file mode 100644 index 00000000000..52e3428f02d --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/IntDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of ints. */ +public interface IntDataBuffer extends DataBuffer { + + /** + * Reads the int at the given index. + * + * @param index the index from which the float will be read + * @return the int at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + int getInt(long index); + + /** + * Writes the given int into this buffer at the given index. + * + * @param value the int to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + IntDataBuffer setInt(int value, long index); + + /** + * Bulk get method, using int arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default IntDataBuffer read(int[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using int arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + IntDataBuffer read(int[] dst, int offset, int length); + + /** + * Bulk put method, using int arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default IntDataBuffer write(int[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using int arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + IntDataBuffer write(int[] src, int offset, int length); + + @Override + default Integer getObject(long index) { + return getInt(index); + } + + @Override + default IntDataBuffer setObject(Integer value, long index) { + return setInt(value, index); + } + + @Override + IntDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default IntDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default IntDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + IntDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java new file mode 100644 index 00000000000..89ae7ae3aed --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/LongDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of longs. */ +public interface LongDataBuffer extends DataBuffer { + + /** + * Reads the long at the given index. + * + * @param index the index from which the float will be read + * @return the long at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + long getLong(long index); + + /** + * Writes the given long into this buffer at the given index. + * + * @param value the long to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + LongDataBuffer setLong(long value, long index); + + /** + * Bulk get method, using long arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default LongDataBuffer read(long[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using long arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + LongDataBuffer read(long[] dst, int offset, int length); + + /** + * Bulk put method, using long arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default LongDataBuffer write(long[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using long arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + LongDataBuffer write(long[] src, int offset, int length); + + @Override + default Long getObject(long index) { + return getLong(index); + } + + @Override + default LongDataBuffer setObject(Long value, long index) { + return setLong(value, index); + } + + @Override + LongDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default LongDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default LongDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + LongDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java new file mode 100644 index 00000000000..1ae128d4e69 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/ShortDataBuffer.java @@ -0,0 +1,159 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** A {@link DataBuffer} of shorts. */ +public interface ShortDataBuffer extends DataBuffer { + + /** + * Reads the short at the given index. + * + * @param index the index from which the float will be read + * @return the short at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + short getShort(long index); + + /** + * Writes the given short into this buffer at the given index. + * + * @param value the short to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ShortDataBuffer setShort(short value, long index); + + /** + * Bulk get method, using short arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code + * dst.length > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default ShortDataBuffer read(short[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using short arrays. + * + *

    This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if {@code length + * > size()}, then no values are transferred and a BufferUnderflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from this buffer into the given + * array starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + ShortDataBuffer read(short[] dst, int offset, int length); + + /** + * Bulk put method, using short arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code src.length > size()}, + * then no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default ShortDataBuffer write(short[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using short arrays. + * + *

    This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if {@code length > size()}, then + * no values are transferred and a BufferOverflowException is thrown. + * + *

    Otherwise, this method copies {@code n = length} values from the given array into this + * buffer, starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ShortDataBuffer write(short[] src, int offset, int length); + + @Override + default Short getObject(long index) { + return getShort(index); + } + + @Override + default ShortDataBuffer setObject(Short value, long index) { + return setShort(value, index); + } + + @Override + ShortDataBuffer copyTo(DataBuffer dst, long size); + + @Override + default ShortDataBuffer offset(long index) { + return slice(index, size() - index); + } + + @Override + default ShortDataBuffer narrow(long size) { + return slice(0, size); + } + + @Override + ShortDataBuffer slice(long index, long size); + + @Override + default DataBufferWindow window(long size) { + throw new UnsupportedOperationException(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/BooleanDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/BooleanDataLayout.java new file mode 100644 index 00000000000..fd69a957e69 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/BooleanDataLayout.java @@ -0,0 +1,66 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to booleans. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface BooleanDataLayout> extends DataLayout { + + @Override + default BooleanDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a boolean into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the boolean to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Boolean, long) + */ + void writeBoolean(S buffer, boolean value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as a + * boolean. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the boolean value + * @see #readObject(DataBuffer, long) + */ + boolean readBoolean(S buffer, long index); + + @Override + default void writeObject(S buffer, Boolean value, long index) { + writeBoolean(buffer, value, index); + } + + @Override + default Boolean readObject(S buffer, long index) { + return readBoolean(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java new file mode 100644 index 00000000000..f9d868dabdd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ByteDataLayout.java @@ -0,0 +1,65 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to bytes. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface ByteDataLayout> extends DataLayout { + + @Override + default ByteDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a byte into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the byte to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Byte, long) + */ + void writeByte(S buffer, byte value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as a byte. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the byte value + * @see #readObject(DataBuffer, long) + */ + byte readByte(S buffer, long index); + + @Override + default void writeObject(S buffer, Byte value, long index) { + writeByte(buffer, value, index); + } + + @Override + default Byte readObject(S buffer, long index) { + return readByte(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayout.java new file mode 100644 index 00000000000..97c26530ddd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayout.java @@ -0,0 +1,134 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * Converts data stored in a buffer to a given type. + * + *

    {@code DataLayout} instances are used to define a custom format for storing and reading data + * of a {@link DataBuffer}. They provide a segregation layer between the type of data stored in the + * buffer (the buffer type) and the type of data manipulated by the end user (the user + * type). + * + *

    Since the conversion methods are invoked for every value that is written or read, working with + * data layouts may have a negative impact on the performances so using primitive types directly + * should be preferred whenever possible. + * + *

    It is also recommended to implement immutable data layouts so they can be reapplied to + * multiple buffers without reallocating a new instance for each of them. For example: + * + *

    + * class BigIntegerBufferAllocator {
    + *
    + *     public DataBuffer<BigInteger> allocate(long size) {
    + *         return LAYOUT.applyTo(DataBuffers.ofLongs(size * LAYOUT.scale()));  // scale is 1 by default
    + *     }
    + *
    + *     private static final DataLayout<LongDataBuffer, BigInteger> LAYOUT = new DataLayout<LongDataBuffer, BigInteger>() {
    + *
    + *         @Override
    + *         public void writeObject(LongDataBuffer buffer, BigInteger value, long index) {
    + *             buffer.setLong(value.longValue(), index);
    + *         }
    + *
    + *         @Override
    + *         public BigInteger readObject(LongDataBuffer buffer, long index) {
    + *             return BigInteger.valueOf(buffer.getLong(index));
    + *         }
    + *     };
    + * }
    + * 
    + * + * @param type of buffer this layout can be applied to + * @param user data type of this layout + */ +public interface DataLayout, T> { + + /** + * Apply this layout to the provided buffer. + * + *

    The returned {@link DataBuffer} instance is simply a wrapper to the original buffer and does + * not have a backing storage of his own. + * + * @param buffer the target buffer to apply this layout to + * @return a buffer with this layout + */ + default DataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a user value into the buffer at the given index after converting it to the buffer type. + * + *

    It is the responsibility of the implementors of this interface to write the converted value + * to the given buffer before this call returns, using the most appropriate method. For example, + * for a layout converting a {@code BigInteger} to a single {@code long}, + * + *

    +   * @Override
    +   * public void writeObject(LongDataBuffer buffer, BigInteger value, long index) {
    +   *   buffer.setLong(value.longValue(), index);
    +   * }
    +   * 
    + * + * If a single user value scales over more than one buffer values, {@code index} indicates the + * starting position of the sequence to be written to the buffer. + * + * @param buffer the buffer to write to + * @param value the value in the user type to convert and write + * @param index index in the buffer where the converted value should be written + */ + void writeObject(S buffer, T value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as a single + * value in the user type. + * + *

    It is the responsibility of the implementors of this interface to read the value to be + * converted from the given buffer, using the most appropriate method. For example, for a layout + * that converting a single {@code long} to a {@code BigInteger}, + * + *

    +   * @Override
    +   * public BigInteger readObject(LongDataBuffer buffer, long index) {
    +   *   return BigInteger.valueOf(buffer.getLong(index));
    +   * }
    +   * 
    + * + * If a single user value scales over more than one buffer values, {@code index} indicates the + * starting position of the sequence to be read from the buffer. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the converted value + */ + T readObject(S buffer, long index); + + /** + * Indicates the number of buffer values are required to represent a single user value, default is + * 1. + * + *

    Scale must be positive and must be an integer, meaning that a single buffer value in a + * buffer cannot be used to represent more than one user value. + */ + default int scale() { + return 1; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayouts.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayouts.java new file mode 100644 index 00000000000..e58ca550636 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DataLayouts.java @@ -0,0 +1,99 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.buffer.layout; + +import java.nio.charset.Charset; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.layout.Bfloat16Layout; +import org.tensorflow.ndarray.impl.buffer.layout.BoolLayout; +import org.tensorflow.ndarray.impl.buffer.layout.Float16Layout; +import org.tensorflow.ndarray.impl.buffer.layout.StringLayout; + +/** + * Exposes {@link DataLayout} instances of data formats frequently used in linear algebra + * computation. + * + *

    Example of usage: + * + *

    {@code
    + * // Storing boolean values in a ByteDataBuffer
    + * BooleanDataBuffer boolBuffer = DataLayouts.BOOL.applyTo(byteDataBuffer);
    + *
    + * // Allocating a new buffer of 256 half floats
    + * FloatDataBuffer halfBuffer = DataLayouts.FLOAT16.applyTo(DataBuffers.ofShorts(256 * DataLayouts.FLOAT16.scale());
    + * }
    + */ +public final class DataLayouts { + + /** + * Data layout for converting 16-bit bfloats to/from short values. + * + *

    This format used to be specific to TensorFlow but has now been adopted more broadly in the + * machine learning field. It is optimized for fast conversion with single-precision 32-bit + * floating points by simply shifting their value and truncating the mantissa to only 7 bits. + * + *

    Therefore, this is a lost of precision in the fraction part compared to the IEEE-754 + * half-precision floating point specification (see {@link #FLOAT16} but it has a larger range of + * possible values in the whole part as it preserves the 8-bit exponent and uses the same bias, + * (i.e. an absolute range above 0 of approximately [10-40, 3.39 × + * 1038] + * + *

    Some CPUs support the bfloat16 format natively for better performances. + */ + public static final FloatDataLayout BFLOAT16 = new Bfloat16Layout(); + + /** + * Data layout for converting 16-bit half floats to/from short values. + * + *

    Half floats are stored in memory accordingly to the IEEE-754 half-precision floating point + * specification, and are converted to/from 32-bit floats in the user space. + * + *

    There is a potential loss of precision when converting a single float (32-bit) to a half + * float (16-bit). Absolute range of values above 0 for a half float is approximately [5.96 × + * 10-8, 6.55 × 104] and their decimal part is rounded up to a 10 bits + * mantissa. + * + *

    In general, half float computation perform better on GPUs since, in general, CPUs do not + * support this format natively. + */ + public static final FloatDataLayout FLOAT16 = new Float16Layout(); + + /** + * Data layout for converting booleans to/from byte values. + * + *

    Since there is no Java NIO boolean buffer, this layout is particularly useful for mapping + * booleans values to standard byte buffers. The conversion between a boolean and a byte requires + * explicit type casting. + */ + public static final BooleanDataLayout BOOL = new BoolLayout(); + + /** + * Creates a data layout for converting strings to/from byte sequences. + * + *

    This layout requires a {@code charset} in parameter to specify how the strings must be + * encoded/decoded as byte sequences. So a new layout instance is always returned. + * + * @param charset charset to use + * @return a new string layout + */ + public static DataLayout, String> ofStrings(Charset charset) { + return StringLayout.of(charset); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DoubleDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DoubleDataLayout.java new file mode 100644 index 00000000000..efd1e461802 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/DoubleDataLayout.java @@ -0,0 +1,65 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to doubles. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface DoubleDataLayout> extends DataLayout { + + @Override + default DoubleDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a double into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the double to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Double, long) + */ + void writeDouble(S buffer, double value, long index); + + /** + * Reads {@code n = scale()} buffer values at the given index and return them as a double. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the double value + * @see #readObject(DataBuffer, long) + */ + double readDouble(S buffer, long index); + + @Override + default void writeObject(S buffer, Double value, long index) { + writeDouble(buffer, value, index); + } + + @Override + default Double readObject(S buffer, long index) { + return readDouble(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout.java new file mode 100644 index 00000000000..a57f525d69f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout.java @@ -0,0 +1,65 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to floats. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface FloatDataLayout> extends DataLayout { + + @Override + default FloatDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a float into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the float to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Float, long) + */ + void writeFloat(S buffer, float value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as a float. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the float value + * @see #readObject(DataBuffer, long) + */ + float readFloat(S buffer, long index); + + @Override + default void writeObject(S buffer, Float value, long index) { + writeFloat(buffer, value, index); + } + + @Override + default Float readObject(S buffer, long index) { + return readFloat(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/IntDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/IntDataLayout.java new file mode 100644 index 00000000000..718deac9b9f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/IntDataLayout.java @@ -0,0 +1,66 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to ints. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface IntDataLayout> extends DataLayout { + + @Override + default IntDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a int into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the int to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Integer, long) + */ + void writeInt(S buffer, int value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as an int. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the int value + * @see #readObject(DataBuffer, long) + */ + int readInt(S buffer, long index); + + @Override + default void writeObject(S buffer, Integer value, long index) { + writeInt(buffer, value, index); + } + + @Override + default Integer readObject(S buffer, long index) { + return readInt(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/LongDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/LongDataLayout.java new file mode 100644 index 00000000000..de8fddc8407 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/LongDataLayout.java @@ -0,0 +1,65 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to longs. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface LongDataLayout> extends DataLayout { + + @Override + default LongDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a long into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the long to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Long, long) + */ + void writeLong(S buffer, long value, long index); + + /** + * Reads {@code n = scale()} values from the buffer at the given index and return them as a long. + * + * @param buffer the buffer to read from + * @param index position of the buffer to read in the buffer + * @return the long value + * @see #readObject(DataBuffer, long) + */ + long readLong(S buffer, long index); + + @Override + default void writeObject(S buffer, Long value, long index) { + writeLong(buffer, value, index); + } + + @Override + default Long readObject(S buffer, long index) { + return readLong(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ShortDataLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ShortDataLayout.java new file mode 100644 index 00000000000..89c1fd0dec4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/buffer/layout/ShortDataLayout.java @@ -0,0 +1,65 @@ +/* + * 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. + * ======================================================================= + */ +package org.tensorflow.ndarray.buffer.layout; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** + * A {@link DataLayout} that converts data stored in a buffer to shorts. + * + * @param type of buffer this layout can be applied to + * @see DataLayout + */ +public interface ShortDataLayout> extends DataLayout { + + @Override + default ShortDataBuffer applyTo(S buffer) { + return DataBufferAdapterFactory.create(buffer, this); + } + + /** + * Writes a short into the buffer at the given index after converting it to the buffer type. + * + * @param buffer the buffer to write to + * @param value the short to convert and write + * @param index index in the buffer where the converted value should be written + * @see #writeObject(DataBuffer, Short, long) + */ + void writeShort(S buffer, short value, long index); + + /** + * Reads {@code n = scale()} buffer values at the given index and return them as a short. + * + * @param buffer the buffer to read from + * @param index position of the value to read in the buffer + * @return the short value + * @see #readObject(DataBuffer, long) + */ + short readShort(S buffer, long index); + + @Override + default void writeObject(S buffer, Short value, long index) { + writeShort(buffer, value, index); + } + + @Override + default Short readObject(S buffer, long index) { + return readShort(buffer, index); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java new file mode 100644 index 00000000000..41f2cb5977f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/AbstractNdArray.java @@ -0,0 +1,98 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl; + +import java.util.Iterator; +import java.util.Objects; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +@SuppressWarnings("unchecked") +public abstract class AbstractNdArray> implements NdArray { + + protected final DimensionalSpace dimensions; + + protected AbstractNdArray(DimensionalSpace dimensions) { + this.dimensions = dimensions; + } + + public abstract U slice(long position, DimensionalSpace dimensions); + + public DimensionalSpace dimensions() { + return dimensions; + } + + @Override + public Shape shape() { + return dimensions.shape(); + } + + @Override + public NdArraySequence scalars() { + // negative if this array is a scalar, should be handled in `elements(dimIdx)` + return (NdArraySequence) elements(shape().numDimensions() - 1); + } + + @Override + public int hashCode() { + return slowHashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NdArray)) { + return false; + } + return slowEquals((NdArray) obj); + } + + protected void slowCopyTo(NdArray array) { + scalars().forEachIndexed((coords, e) -> array.setObject(e.getObject(), coords)); + } + + protected int slowHashCode() { + final int prime = 31; + int result = 1; + for (NdArray scalar : scalars()) { + result = prime * result + scalar.getObject().hashCode(); + } + result = prime * result + shape().hashCode(); + return result; + } + + protected boolean slowEquals(NdArray array) { + if (!shape() + .equals( + array.shape())) { // this guarantees also that we have the same number of scalar values + return false; + } + for (Iterator> thisIter = scalars().iterator(), + otherIter = array.scalars().iterator(); + thisIter.hasNext(); ) { + // Use Object.equals to handle nulls. + if (!Objects.equals(thisIter.next().getObject(), otherIter.next().getObject())) { + return false; + } + } + return true; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java new file mode 100644 index 00000000000..da7ca2354e0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/Validator.java @@ -0,0 +1,59 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.buffer.DataBuffer; + +public class Validator { + + public static void copyToNdArrayArgs(NdArray ndArray, NdArray otherNdArray) { + if (!ndArray.shape().equals(otherNdArray.shape())) { + throw new IllegalArgumentException( + "Can only copy to arrays of the same shape (" + + ndArray.shape() + + " != " + + otherNdArray.shape() + + ")"); + } + } + + public static void copyToBufferArgs(NdArray ndArray, DataBuffer dst) { + if (dst.size() < ndArray.size()) { + throw new BufferOverflowException(); + } + } + + public static void copyFromBufferArgs(NdArray ndArray, DataBuffer src) { + if (src.size() < ndArray.size()) { + throw new BufferUnderflowException(); + } + } + + private static void copyArrayArgs(int arrayLength, int arrayOffset) { + if (arrayOffset < 0) { + throw new IndexOutOfBoundsException("Offset must be non-negative"); + } + if (arrayOffset > arrayLength) { + throw new IndexOutOfBoundsException("Offset must be no larger than array length"); + } + } + + protected Validator() {} +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java new file mode 100644 index 00000000000..5de34b23f7e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBuffer.java @@ -0,0 +1,206 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.tensorflow.ndarray.buffer.DataBuffer; + +public abstract class AbstractDataBuffer implements DataBuffer { + + @Override + public DataBuffer read(T[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0; i < length; ++i) { + dst[i + offset] = getObject(i); + } + return this; + } + + @Override + public DataBuffer write(T[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0; i < length; ++i) { + setObject(src[i + offset], i); + } + return this; + } + + @Override + public DataBuffer copyTo(DataBuffer dst, long size) { + return slowCopyTo(dst, size); + } + + @Override + public int hashCode() { + // This hash code computation is generic to all types of data buffers and accurate but not + // optimized + // for performances, it needs to be improved if there is a present use case for such hash codes. + return slowHashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataBuffer)) { + return false; + } + return slowEquals((DataBuffer) obj); + } + + @SuppressWarnings("unchecked") + protected > U slowCopyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + for (long idx = 0L; idx < size; ++idx) { + dst.setObject(getObject(idx), idx); + } + return (U) this; + } + + protected int slowHashCode() { + final int prime = 31; + int result = 1; + + // First check from the first non-null element if we are dealing with a buffer of arrays + long idx = 0L; + for (; idx < size(); ++idx) { + T o = getObject(idx); + if (o != null) { + if (o.getClass().isArray()) { + result = + prime * result + + arrayHashCode(idx, o.getClass()); // compute hash codes based on array elements + return result; + } + result = prime * result + o.hashCode(); + break; // continue hash code computation without array type check + } + result = prime * result; + } + while (++idx < size()) { + result = prime * result + Objects.hashCode(getObject(idx)); + } + return result; + } + + protected boolean slowEquals(DataBuffer other) { + if (other.size() != size()) { + return false; + } + long idx = 0L; + for (; idx < size(); ++idx) { + Object thisObject = getObject(idx); + if (thisObject != null) { + if (thisObject.getClass().isArray()) { + return arrayEquals(idx, thisObject.getClass(), other); + } + if (!Objects.equals(other.getObject(idx), thisObject)) { + return false; + } + break; // continue equality comparison without array type check + } + if (other.getObject(idx) != null) { + return false; + } + } + while (++idx < size()) { + if (!Objects.equals(other.getObject(idx), getObject(idx))) { + return false; + } + } + return true; + } + + private int arrayHashCode(long startIdx, Class arrayClass) { + ArrayHashCoder hashCoder = ARRAY_HASH_CODERS.getOrDefault(arrayClass, DEFAULT_ARRAY_HASH_CODER); + final int prime = 31; + int result = 1; + for (long idx = startIdx; idx < size(); ++idx) { + result = prime * result + hashCoder.hashCode(this, idx); + } + return result; + } + + private boolean arrayEquals(long startIdx, Class arrayClass, DataBuffer other) { + ArrayComparator comparator = + ARRAY_COMPARATORS.getOrDefault(arrayClass, DEFAULT_ARRAY_COMPARATOR); + for (long idx = startIdx; idx < size(); ++idx) { + if (!comparator.equals(this, other, idx)) { + return false; + } + } + return true; + } + + @FunctionalInterface + private static interface ArrayHashCoder { + int hashCode(DataBuffer buffer, long index); + } + + private static final Map, ArrayHashCoder> ARRAY_HASH_CODERS = new HashMap<>(); + private static final ArrayHashCoder DEFAULT_ARRAY_HASH_CODER; + + @FunctionalInterface + private static interface ArrayComparator { + boolean equals(DataBuffer buffer, DataBuffer otherBuffer, long index); + } + + private static final Map, ArrayComparator> ARRAY_COMPARATORS = new HashMap<>(); + private static final ArrayComparator DEFAULT_ARRAY_COMPARATOR; + + static { + ARRAY_HASH_CODERS.put(byte[].class, (b, idx) -> Arrays.hashCode((byte[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put(int[].class, (b, idx) -> Arrays.hashCode((int[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put(short[].class, (b, idx) -> Arrays.hashCode((short[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put(long[].class, (b, idx) -> Arrays.hashCode((long[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put(float[].class, (b, idx) -> Arrays.hashCode((float[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put(double[].class, (b, idx) -> Arrays.hashCode((double[]) b.getObject(idx))); + ARRAY_HASH_CODERS.put( + boolean[].class, (b, idx) -> Arrays.hashCode((boolean[]) b.getObject(idx))); + DEFAULT_ARRAY_HASH_CODER = (b, idx) -> Arrays.deepHashCode((Object[]) b.getObject(idx)); + + ARRAY_COMPARATORS.put( + byte[].class, + (b1, b2, idx) -> Arrays.equals((byte[]) b1.getObject(idx), (byte[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + int[].class, + (b1, b2, idx) -> Arrays.equals((int[]) b1.getObject(idx), (int[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + short[].class, + (b1, b2, idx) -> Arrays.equals((short[]) b1.getObject(idx), (short[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + long[].class, + (b1, b2, idx) -> Arrays.equals((long[]) b1.getObject(idx), (long[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + float[].class, + (b1, b2, idx) -> Arrays.equals((float[]) b1.getObject(idx), (float[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + double[].class, + (b1, b2, idx) -> Arrays.equals((double[]) b1.getObject(idx), (double[]) b2.getObject(idx))); + ARRAY_COMPARATORS.put( + boolean[].class, + (b1, b2, idx) -> + Arrays.equals((boolean[]) b1.getObject(idx), (boolean[]) b2.getObject(idx))); + DEFAULT_ARRAY_COMPARATOR = + (b1, b2, idx) -> + Arrays.deepEquals((Object[]) b1.getObject(idx), (Object[]) b2.getObject(idx)); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow.java new file mode 100644 index 00000000000..cf28df86ca1 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/AbstractDataBufferWindow.java @@ -0,0 +1,49 @@ +package org.tensorflow.ndarray.impl.buffer; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferWindow; + +public abstract class AbstractDataBufferWindow> + implements DataBufferWindow { + + @Override + public final long offset() { + return offset; + } + + @Override + public final long size() { + return windowBuffer.size(); + } + + @Override + public final DataBufferWindow slideTo(long index) { + if (index < 0 || index > maxOffset) { + throw new IndexOutOfBoundsException(); + } + offset(index); + offset = index; + return this; + } + + @Override + public final DataBufferWindow slide(long step) { + return slideTo(offset + step); + } + + @Override + public final B buffer() { + return windowBuffer; + } + + protected abstract void offset(long offset); + + protected AbstractDataBufferWindow(B windowBuffer, long bufferLimit) { + this.windowBuffer = windowBuffer; + maxOffset = bufferLimit - windowBuffer.size(); + } + + private final B windowBuffer; + private final long maxOffset; + private long offset = 0; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java new file mode 100644 index 00000000000..d85a6ded17f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/Validator.java @@ -0,0 +1,135 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; +import org.tensorflow.ndarray.buffer.DataBuffer; + +public class Validator { + + public static void createArgs(long size, long maxSize) { + if (size < 0) { + throw new IllegalArgumentException("Size must be non-negative"); + } + if (size > maxSize) { + throw new IllegalArgumentException( + "Buffer size must be no greater than maximum size allowed (" + maxSize + ")"); + } + } + + public static void getArgs(DataBuffer buffer, long index) { + if (index < 0) { + throw new IndexOutOfBoundsException("Index must be non-negative"); + } + if (index >= buffer.size()) { + throw new IndexOutOfBoundsException("Index must be smaller than the buffer size"); + } + } + + public static void setArgs(DataBuffer buffer, long index) { + if (index < 0) { + throw new IndexOutOfBoundsException("Index must be non-negative"); + } + if (index >= buffer.size()) { + throw new IndexOutOfBoundsException("Index must be smaller than the buffer size"); + } + if (buffer.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + } + + public static void copyToArgs(DataBuffer src, DataBuffer dst, long size) { + if (dst == src) { + throw new IllegalArgumentException("Source cannot be the same buffer as destination"); + } + if (size > dst.size()) { + throw new BufferOverflowException(); + } + if (size > src.size()) { + throw new BufferUnderflowException(); + } + if (dst.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + } + + public static void readArgs(DataBuffer buffer, int arrayLength, int offset, int length) { + if (length > buffer.size()) { + throw new BufferUnderflowException(); + } + arrayArgs(arrayLength, offset, length); + } + + public static void writeArgs(DataBuffer buffer, int arrayLength, int offset, int length) { + if (length > buffer.size()) { + throw new BufferOverflowException(); + } + if (buffer.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + arrayArgs(arrayLength, offset, length); + } + + public static void offsetArgs(DataBuffer buffer, long index) { + if (index < 0) { + throw new IllegalArgumentException("Index must be non-negative"); + } + if (index > buffer.size()) { + throw new IllegalArgumentException("Index must not exceed buffer size"); + } + } + + public static void narrowArgs(DataBuffer buffer, long size) { + if (size < 0) { + throw new IllegalArgumentException("Size must be non-negative"); + } + if (size > buffer.size()) { + throw new IllegalArgumentException( + "Cannot narrow a buffer of size " + buffer.size() + " to " + size); + } + } + + public static void sliceArgs(DataBuffer buffer, long index, long size) { + if (index < 0) { + throw new IllegalArgumentException("Index must be non-negative"); + } + if (size < 0) { + throw new IllegalArgumentException("Size must be non-negative"); + } + if (index + size > buffer.size()) { + throw new IllegalArgumentException("Buffer view must not exceed original buffer limits"); + } + } + + private static void arrayArgs(int arrayLength, int offset, int length) { + if (offset < 0) { + throw new IndexOutOfBoundsException("Offset must be non-negative"); + } + if (offset > arrayLength) { + throw new IndexOutOfBoundsException("Offset must be no larger than array length"); + } + if (length < 0) { + throw new IndexOutOfBoundsException("Length must be non-negative"); + } + if (length > arrayLength - offset) { + throw new IndexOutOfBoundsException( + "Length must be no larger than array length minus the offset"); + } + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/AbstractDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/AbstractDataBufferAdapter.java new file mode 100644 index 00000000000..901a7ed8905 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/AbstractDataBufferAdapter.java @@ -0,0 +1,69 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.layout.DataLayout; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +@SuppressWarnings("unchecked") +abstract class AbstractDataBufferAdapter, T, U extends DataBuffer> + extends AbstractDataBuffer { + + @Override + public long size() { + return size; + } + + @Override + public boolean isReadOnly() { + return buffer.isReadOnly(); + } + + @Override + public T getObject(long index) { + Validator.getArgs(this, index); + return layout.readObject(buffer, index * layout.scale()); + } + + @Override + public U setObject(T value, long index) { + Validator.setArgs(this, index); + layout.writeObject(buffer, value, index * layout.scale()); + return (U) this; + } + + AbstractDataBufferAdapter(S buffer, DataLayout layout) { + this.buffer = buffer; + this.layout = layout; + size = buffer.size() / layout.scale(); + } + + DataLayout layout() { + return layout; + } + + S buffer() { + return buffer; + } + + private final S buffer; + private final DataLayout layout; + private final long size; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapter.java new file mode 100644 index 00000000000..f32d2292423 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.layout.BooleanDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class BooleanDataBufferAdapter> + extends AbstractDataBufferAdapter implements BooleanDataBuffer { + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return layout.readBoolean(buffer(), index * layout.scale()); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + layout.writeBoolean(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readBoolean(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeBoolean(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof BooleanDataBuffer) { + BooleanDataBuffer booleanDst = (BooleanDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + booleanDst.setBoolean(getBoolean(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public BooleanDataBuffer offset(long index) { + return new BooleanDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public BooleanDataBuffer narrow(long size) { + return new BooleanDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public BooleanDataBuffer slice(long index, long size) { + return new BooleanDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BooleanDataBuffer)) { + return super.equals(obj); + } + BooleanDataBuffer other = (BooleanDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getBoolean(idx) != getBoolean(idx)) { + return false; + } + } + return true; + } + + BooleanDataBufferAdapter(S buffer, BooleanDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private BooleanDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapter.java new file mode 100644 index 00000000000..e93ce3054b0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapter.java @@ -0,0 +1,136 @@ +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.ByteDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class ByteDataBufferAdapter> + extends AbstractDataBufferAdapter implements ByteDataBuffer { + + @Override + public byte getByte(long index) { + Validator.getArgs(this, index); + return layout.readByte(buffer(), index * layout.scale()); + } + + @Override + public ByteDataBuffer setByte(byte value, long index) { + Validator.setArgs(this, index); + layout.writeByte(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public ByteDataBuffer read(byte[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readByte(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public ByteDataBuffer write(byte[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeByte(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public ByteDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof ByteDataBuffer) { + ByteDataBuffer byteDst = (ByteDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + byteDst.setByte(getByte(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + public IntDataBuffer asInts() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + public ShortDataBuffer asShorts() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + public LongDataBuffer asLongs() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + public FloatDataBuffer asFloats() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + public DoubleDataBuffer asDoubles() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + public BooleanDataBuffer asBooleans() { + throw new IllegalStateException("Byte buffers with layout cannot be converted"); + } + + @Override + @SuppressWarnings("unchecked") + public ByteDataBuffer offset(long index) { + return new ByteDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public ByteDataBuffer narrow(long size) { + return new ByteDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public ByteDataBuffer slice(long index, long size) { + return new ByteDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ByteDataBuffer)) { + return super.equals(obj); + } + ByteDataBuffer other = (ByteDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getByte(idx) != getByte(idx)) { + return false; + } + } + return true; + } + + ByteDataBufferAdapter(S buffer, ByteDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private ByteDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapter.java new file mode 100644 index 00000000000..3d5e98111d2 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapter.java @@ -0,0 +1,49 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.layout.DataLayout; + +@SuppressWarnings("unchecked") +class DataBufferAdapter, T> + extends AbstractDataBufferAdapter> { + + @Override + @SuppressWarnings("unchecked") + public DataBuffer offset(long index) { + return new DataBufferAdapter<>((S) buffer().offset(index * layout().scale()), layout()); + } + + @Override + @SuppressWarnings("unchecked") + public DataBuffer narrow(long size) { + return new DataBufferAdapter<>((S) buffer().narrow(size * layout().scale()), layout()); + } + + @Override + @SuppressWarnings("unchecked") + public DataBuffer slice(long index, long size) { + return new DataBufferAdapter<>( + (S) buffer().slice(index * layout().scale(), size * layout().scale()), layout()); + } + + DataBufferAdapter(S buffer, DataLayout layout) { + super(buffer, layout); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapterFactory.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapterFactory.java new file mode 100644 index 00000000000..8b82282864e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DataBufferAdapterFactory.java @@ -0,0 +1,149 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.BooleanDataLayout; +import org.tensorflow.ndarray.buffer.layout.ByteDataLayout; +import org.tensorflow.ndarray.buffer.layout.DataLayout; +import org.tensorflow.ndarray.buffer.layout.DoubleDataLayout; +import org.tensorflow.ndarray.buffer.layout.FloatDataLayout; +import org.tensorflow.ndarray.buffer.layout.IntDataLayout; +import org.tensorflow.ndarray.buffer.layout.LongDataLayout; +import org.tensorflow.ndarray.buffer.layout.ShortDataLayout; + +/** + * Factory of data buffer adapters. + * + *

    Data buffer adapters are used to apply a {@link DataLayout} to a buffer. Conceptually, they + * act as a proxy that intercept each I/O call and perform the required type conversions + * after/before delegating the task to the underlying buffer. + */ +public class DataBufferAdapterFactory { + + /** + * Creates an adapter that applies a byte data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > ByteDataBuffer create( + S buffer, ByteDataLayout layout) { + return new ByteDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a boolean data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > BooleanDataBuffer create( + S buffer, BooleanDataLayout layout) { + return new BooleanDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a double data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > DoubleDataBuffer create( + S buffer, DoubleDataLayout layout) { + return new DoubleDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a float data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > FloatDataBuffer create( + S buffer, FloatDataLayout layout) { + return new FloatDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a integer data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > IntDataBuffer create(S buffer, IntDataLayout layout) { + return new IntDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a long data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > LongDataBuffer create( + S buffer, LongDataLayout layout) { + return new LongDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a short data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @return buffer adapter + */ + public static > ShortDataBuffer create( + S buffer, ShortDataLayout layout) { + return new ShortDataBufferAdapter<>(buffer, layout); + } + + /** + * Creates an adapter that applies a data layout to the given buffer. + * + * @param buffer the delegate buffer + * @param layout layout to apply + * @param the type of the buffer + * @param the type of data returned by the layout + * @return buffer adapter + */ + public static , T> DataBuffer create( + S buffer, DataLayout layout) { + return new DataBufferAdapter<>(buffer, layout); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapter.java new file mode 100644 index 00000000000..542b4dfe4dd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.layout.DoubleDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class DoubleDataBufferAdapter> + extends AbstractDataBufferAdapter implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + Validator.getArgs(this, index); + return layout.readDouble(buffer(), index * layout.scale()); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + Validator.setArgs(this, index); + layout.writeDouble(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readDouble(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeDouble(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public DoubleDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof DoubleDataBuffer) { + DoubleDataBuffer doubleDst = (DoubleDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + doubleDst.setDouble(getDouble(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public DoubleDataBuffer offset(long index) { + return new DoubleDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public DoubleDataBuffer narrow(long size) { + return new DoubleDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public DoubleDataBuffer slice(long index, long size) { + return new DoubleDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DoubleDataBuffer)) { + return super.equals(obj); + } + DoubleDataBuffer other = (DoubleDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getDouble(idx) != getDouble(idx)) { + return false; + } + } + return true; + } + + DoubleDataBufferAdapter(S buffer, DoubleDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private DoubleDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapter.java new file mode 100644 index 00000000000..2c581f4b1e0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.layout.FloatDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class FloatDataBufferAdapter> + extends AbstractDataBufferAdapter implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + Validator.getArgs(this, index); + return layout.readFloat(buffer(), index * layout.scale()); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + Validator.setArgs(this, index); + layout.writeFloat(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readFloat(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeFloat(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public FloatDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof FloatDataBuffer) { + FloatDataBuffer floatDst = (FloatDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + floatDst.setFloat(getFloat(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public FloatDataBuffer offset(long index) { + return new FloatDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public FloatDataBuffer narrow(long size) { + return new FloatDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public FloatDataBuffer slice(long index, long size) { + return new FloatDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof FloatDataBuffer)) { + return super.equals(obj); + } + FloatDataBuffer other = (FloatDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getFloat(idx) != getFloat(idx)) { + return false; + } + } + return true; + } + + FloatDataBufferAdapter(S buffer, FloatDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private FloatDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapter.java new file mode 100644 index 00000000000..7a93d52e6a7 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.layout.IntDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class IntDataBufferAdapter> + extends AbstractDataBufferAdapter implements IntDataBuffer { + + @Override + public int getInt(long index) { + Validator.getArgs(this, index); + return layout.readInt(buffer(), index * layout.scale()); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + Validator.setArgs(this, index); + layout.writeInt(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readInt(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeInt(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public IntDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof IntDataBuffer) { + IntDataBuffer intDst = (IntDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + intDst.setInt(getInt(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public IntDataBuffer offset(long index) { + return new IntDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public IntDataBuffer narrow(long size) { + return new IntDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public IntDataBuffer slice(long index, long size) { + return new IntDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IntDataBuffer)) { + return super.equals(obj); + } + IntDataBuffer other = (IntDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getInt(idx) != getInt(idx)) { + return false; + } + } + return true; + } + + IntDataBufferAdapter(S buffer, IntDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private IntDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapter.java new file mode 100644 index 00000000000..db31050b02f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.layout.LongDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class LongDataBufferAdapter> + extends AbstractDataBufferAdapter implements LongDataBuffer { + + @Override + public long getLong(long index) { + Validator.getArgs(this, index); + return layout.readLong(buffer(), index * layout.scale()); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + Validator.setArgs(this, index); + layout.writeLong(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readLong(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeLong(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public LongDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof LongDataBuffer) { + LongDataBuffer longDst = (LongDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + longDst.setLong(getLong(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public LongDataBuffer offset(long index) { + return new LongDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public LongDataBuffer narrow(long size) { + return new LongDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public LongDataBuffer slice(long index, long size) { + return new LongDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LongDataBuffer)) { + return super.equals(obj); + } + LongDataBuffer other = (LongDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getLong(idx) != getLong(idx)) { + return false; + } + } + return true; + } + + LongDataBufferAdapter(S buffer, LongDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private LongDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapter.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapter.java new file mode 100644 index 00000000000..001b31ef176 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapter.java @@ -0,0 +1,117 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.ShortDataLayout; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class ShortDataBufferAdapter> + extends AbstractDataBufferAdapter implements ShortDataBuffer { + + @Override + public short getShort(long index) { + Validator.getArgs(this, index); + return layout.readShort(buffer(), index * layout.scale()); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + Validator.setArgs(this, index); + layout.writeShort(buffer(), value, index * layout.scale()); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readShort(buffer(), i * layout.scale()); + } + return this; + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeShort(buffer(), src[j], i * layout.scale()); + } + return this; + } + + @Override + public ShortDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof ShortDataBuffer) { + ShortDataBuffer shortDst = (ShortDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + shortDst.setShort(getShort(idx), idx); + } + return this; + } + return slowCopyTo(dst, size); + } + + @Override + @SuppressWarnings("unchecked") + public ShortDataBuffer offset(long index) { + return new ShortDataBufferAdapter<>((S) buffer().offset(index * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public ShortDataBuffer narrow(long size) { + return new ShortDataBufferAdapter<>((S) buffer().narrow(size * layout.scale()), layout); + } + + @Override + @SuppressWarnings("unchecked") + public ShortDataBuffer slice(long index, long size) { + return new ShortDataBufferAdapter<>( + (S) buffer().slice(index * layout.scale(), size * layout.scale()), layout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ShortDataBuffer)) { + return super.equals(obj); + } + ShortDataBuffer other = (ShortDataBuffer) obj; + if (other.size() != size()) { + return false; + } + for (long idx = 0L; idx < size(); ++idx) { + if (other.getShort(idx) != getShort(idx)) { + return false; + } + } + return true; + } + + ShortDataBufferAdapter(S buffer, ShortDataLayout layout) { + super(buffer, layout); + this.layout = layout; + } + + private ShortDataLayout layout; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout.java new file mode 100644 index 00000000000..444e7f8f674 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout.java @@ -0,0 +1,54 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.FloatDataLayout; + +/** + * Data layout that converts 32-bit floats from/to 16-bit, truncating their mantissa to 7 bits but + * preserving the 8-bit exponent with the same bias. + */ +public final class Bfloat16Layout implements FloatDataLayout { + + @Override + public void writeFloat(ShortDataBuffer buffer, float value, long index) { + buffer.setShort(float32to16(value), index); + } + + @Override + public float readFloat(ShortDataBuffer buffer, long index) { + return float16to32(buffer.getShort(index)); + } + + // + // FLOAT 32-bit to/from BFLOAT 16-bit conversions + // + // We simply shift the value from 32-bit to 16-bit and vice-versa. NaN special case is ignored. + // + + // VisibleForTesting + static short float32to16(float f32) { + return (short) (Float.floatToIntBits(f32) >>> 16); + } + + // Visible for testing + static float float16to32(short i16) { + return Float.intBitsToFloat((int) i16 << 16); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayout.java new file mode 100644 index 00000000000..ea76aafb823 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayout.java @@ -0,0 +1,45 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.layout.BooleanDataLayout; + +/** Data layout that converts booleans from/to bytes. */ +public final class BoolLayout implements BooleanDataLayout { + + @Override + public void writeBoolean(ByteDataBuffer buffer, boolean value, long index) { + buffer.setByte(booleanToByte(value), index); + } + + @Override + public boolean readBoolean(ByteDataBuffer buffer, long index) { + return byteToBoolean(buffer.getByte(index)); + } + + // Visible for testing + static byte booleanToByte(boolean b) { + return (byte) (b ? 0x1 : 0x0); + } + + // Visible for testing + static boolean byteToBoolean(byte b) { + return b != 0x0; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java new file mode 100644 index 00000000000..7d7a32ad203 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/Float16Layout.java @@ -0,0 +1,122 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.FloatDataLayout; + +/** + * Data layout that converts 32-bit floats from/to 16-bit, accordingly to the IEEE-754 + * half-precision floating point specification. + */ +public final class Float16Layout implements FloatDataLayout { + + @Override + public void writeFloat(ShortDataBuffer buffer, float value, long index) { + buffer.setShort(float32to16(value), index); + } + + @Override + public float readFloat(ShortDataBuffer buffer, long index) { + return float16to32(buffer.getShort(index)); + } + + // + // FLOAT 32-bit to/from 16-bit conversions + // + // The following conversion algorithms are issued from the C++ implementation found in the + // Eigen library used by TensorFlow native library. + // See https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html for more details. + // + + // VisibleForTesting + static short float32to16(float f32) { + int i16; + int i32 = Float.floatToIntBits(f32); + short sign16 = (short) ((i32 >>> 16) & 0x8000); + i32 &= 0x7FFFFFFF; // remove sign + + if (i32 >= (E32BIAS + E16MAX + 1) << E32SHIFT) { + // float32 value is higher than float16 max value (max16 -> 2^15 * 2 -> 2^16) + // - if float32 value is higher than infinite (i.e. s32 > 0), then it is NaN and should also + // be NaN in float16 (0x7e00) + // - else, float16 value is forced to infinite (0x7c00) + i16 = i32 > E32MASK ? 0x7E00 : 0x7C00; + + } else if (i32 < (E32BIAS + E16MIN) << E32SHIFT) { + // float32 abs value is smaller than float16 min abs value (min16 = 2^-14), could also be 0 + // - apply magic number to align significand 10 bits at the bottom on the float and subtract + // bias + i16 = Float.floatToIntBits(Float.intBitsToFloat(i32) + MAGIC_32_16_FLOAT) - MAGIC_32_16; + + } else { + // float32 value can be rounded up to a normalized float16 value (i.e. exp32 = [113(-14), + // 142(15)]) + // - rebase exponent to float16 + // - round up significand to the 13nd bit if s16 is even, on the 12nd bit if it is odd + int round = 0xFFF + ((i32 >>> 13) & 0x1); + i16 = (i32 + ((E16BIAS - E32BIAS) << E32SHIFT) + round) >>> 13; + } + return (short) (i16 | sign16); + } + + // Visible for testing + static float float16to32(short i16) { + int i32 = (i16 & 0x7FFF) << (S32BITS - S16BITS); // remove sign and align in float32 + i32 += (E32BIAS - E16BIAS) << E32SHIFT; // rebase exponent to float32 + + // Handle float16 exponent special cases + switch (i16 & E16MASK) { + case E16MASK: + // float16 value is infinite or NaN + // - adjust float32 exponent one more time + i32 += (E32BIAS - E16BIAS) << E32SHIFT; + break; + case 0x0: + // float16 value is zero or subnormal + // - adjust float32 exponent + // - renormalize using magic number + i32 = Float.floatToIntBits(Float.intBitsToFloat(i32 + (1 << E32SHIFT)) - MAGIC_16_32_FLOAT); + break; + default: + break; + } + return Float.intBitsToFloat(i32 | ((i16 & 0x8000) << 16)); // reapply sign + } + + // float32 format + private static final int E32SHIFT = 23; // position of the exponent in float32 + private static final int E32MASK = 0xFF << E32SHIFT; // mask for float32 exponent (== Infinity) + private static final int E32BIAS = 127; // exponent bias for float32 + private static final int S32BITS = 23; // number of bits in float32 significand + + // float16 format + private static final int E16SHIFT = 10; // position of the exponent in float16 + private static final int E16MASK = 0x1F << E16SHIFT; // mask for float16 exponent (== Infinity) + private static final int E16BIAS = 15; // exponent bias for float16 + private static final int E16MAX = 15; // max value for float16 exponent + private static final int E16MIN = -14; // min value for float16 exponent + private static final int S16BITS = 10; // number of bits in float16 significand + + // magic numbers used when converting denormalized values + private static final int MAGIC_32_16 = + ((E32BIAS - E16BIAS) + (S32BITS - S16BITS) + 1) << E32SHIFT; + private static final float MAGIC_32_16_FLOAT = Float.intBitsToFloat(MAGIC_32_16); + private static final int MAGIC_16_32 = (E32BIAS - E16BIAS + 1) << E32SHIFT; + private static final float MAGIC_16_32_FLOAT = Float.intBitsToFloat(MAGIC_16_32); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/StringLayout.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/StringLayout.java new file mode 100644 index 00000000000..e77427bd4e8 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/layout/StringLayout.java @@ -0,0 +1,46 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import java.nio.charset.Charset; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.layout.DataLayout; + +/** Data layout that converts a String to/from a sequence of bytes applying a given charset. */ +public final class StringLayout implements DataLayout, String> { + + public static StringLayout of(Charset charset) { + return new StringLayout(charset); + } + + @Override + public void writeObject(DataBuffer buffer, String value, long index) { + buffer.setObject(value.getBytes(charset), index); + } + + @Override + public String readObject(DataBuffer buffer, long index) { + return new String(buffer.getObject(index), charset); + } + + private StringLayout(Charset charset) { + this.charset = charset; + } + + private final Charset charset; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java new file mode 100644 index 00000000000..1a26843713f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBuffer.java @@ -0,0 +1,131 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.misc; + +import java.util.Arrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class ArrayDataBuffer extends AbstractDataBuffer { + + @Override + public long size() { + return length; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public T getObject(long index) { + Validator.getArgs(this, index); + return values[(int) index + offset]; + } + + @Override + public DataBuffer setObject(T value, long index) { + Validator.setArgs(this, index); + values[(int) index + offset] = value; + return this; + } + + @Override + public DataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor>() { + + @Override + public DataBuffer visit(Object[] array, int arrayOffset, int arrayLength) { + System.arraycopy(values, offset, array, arrayOffset, (int) size); + return ArrayDataBuffer.this; + } + + @Override + public DataBuffer fallback() { + for (int idx = 0; idx < size; ++idx) { + dst.setObject(values[idx + offset], idx); + } + return ArrayDataBuffer.this; + } + }); + } + + @Override + public DataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + return new ArrayDataBuffer<>(values, readOnly, offset + (int) index, (int) size); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(values, offset, length); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataBuffer)) { + return false; + } + DataBuffer other = (DataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(Object[] array, int arrayOffset, int arrayLength) { + if (offset == 0 + && values.length == length + && arrayOffset == 0 + && array.length == arrayLength) { + return Arrays.deepEquals(array, values); + } + return slowEquals(other); + } + + @Override + public Boolean fallback() { + return slowEquals(other); + } + }); + } + + ArrayDataBuffer(T[] values, boolean readOnly) { + this(values, readOnly, 0, values.length); + } + + private ArrayDataBuffer(T[] values, boolean readOnly, int offset, int length) { + this.values = values; + this.readOnly = readOnly; + this.offset = offset; + this.length = length; + } + + private final T[] values; + private final boolean readOnly; + private final int offset; + private final int length; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java new file mode 100644 index 00000000000..62b658f7cf4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBuffer.java @@ -0,0 +1,185 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.misc; + +import java.util.BitSet; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class BitSetDataBuffer extends AbstractDataBuffer implements BooleanDataBuffer { + + @Override + public long size() { + return numBits; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return bitSet.get((int) index + offset); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + bitSet.set((int) index + offset, value); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = this.offset, j = offset; i < this.offset + length; ++i, ++j) { + dst[j] = bitSet.get(i); + } + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + Validator.readArgs(this, src.length, offset, length); + for (int i = this.offset, j = offset; i < this.offset + length; ++i, ++j) { + bitSet.set(i, src[j]); + } + return this; + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public BooleanDataBuffer visit(boolean[] array, int arrayOffset, int arrayLength) { + for (int idx = 0; idx < size; ++idx) { + array[idx + arrayOffset] = bitSet.get(idx + offset); + } + return BitSetDataBuffer.this; + } + + @Override + public BooleanDataBuffer visit(BitSet dstBitSet, int dstOffset, long numBits) { + for (int idx = 0; idx < size; ++idx) { + dstBitSet.set(idx + dstOffset, bitSet.get(idx + offset)); + } + return BitSetDataBuffer.this; + } + + @Override + public BooleanDataBuffer fallback() { + if (dst instanceof BooleanDataBuffer) { + BooleanDataBuffer booleanDst = (BooleanDataBuffer) dst; + for (int idx = 0; idx < size; ++idx) { + booleanDst.setBoolean(bitSet.get(idx + offset), idx); + } + } else { + for (int idx = 0; idx < size; ++idx) { + dst.setObject(bitSet.get(idx + offset), idx); + } + } + return BitSetDataBuffer.this; + } + }); + } + + @Override + public BooleanDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + return new BitSetDataBuffer(bitSet, size, readOnly, offset + (int) index); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(bitSet, offset, numBits); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BooleanDataBuffer)) { + return super.equals(obj); + } + BooleanDataBuffer other = (BooleanDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(boolean[] array, int arrayOffset, int length) { + for (int idx = 0; idx < size(); ++idx) { + if (array[idx + arrayOffset] != bitSet.get(idx + offset)) { + return false; + } + } + return true; + } + + @Override + public Boolean visit(BitSet otherBitSet, int otherOffset, long otherNumBits) { + if (offset == 0 && otherOffset == 0 && numBits == otherNumBits) { + return bitSet.equals(otherBitSet); + } + for (int idx = 0; idx < size(); ++idx) { + if (otherBitSet.get(idx + otherOffset) != bitSet.get(idx + offset)) { + return false; + } + } + return true; + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getBoolean(idx) != bitSet.get(idx + offset)) { + return false; + } + } + return true; + } + }); + } + + BitSetDataBuffer(BitSet bitSet, long numBits, boolean readOnly) { + this(bitSet, numBits, readOnly, 0); + } + + private BitSetDataBuffer(BitSet bitSet, long numBits, boolean readOnly, int offset) { + this.bitSet = bitSet; + this.numBits = numBits; + this.readOnly = readOnly; + this.offset = offset; + } + + private final BitSet bitSet; + private final long numBits; + private final boolean readOnly; + private final int offset; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java new file mode 100644 index 00000000000..ac1715a7d27 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/BooleanArrayDataBuffer.java @@ -0,0 +1,180 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.misc; + +import java.util.Arrays; +import java.util.BitSet; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +class BooleanArrayDataBuffer extends AbstractDataBuffer implements BooleanDataBuffer { + + @Override + public long size() { + return length; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return values[(int) index + offset]; + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + values[(int) index + offset] = value; + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + System.arraycopy(values, this.offset, dst, offset, length); + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + System.arraycopy(src, offset, values, this.offset, length); + return null; + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public BooleanDataBuffer visit(boolean[] array, int arrayOffset, int arrayLength) { + System.arraycopy(values, offset, array, arrayOffset, (int) size); + return BooleanArrayDataBuffer.this; + } + + @Override + public BooleanDataBuffer visit(BitSet bitSet, int bitSetOffset, long numBits) { + for (int idx = 0; idx < size; ++idx) { + bitSet.set(idx + bitSetOffset, values[idx + offset]); + } + return BooleanArrayDataBuffer.this; + } + + @Override + public BooleanDataBuffer fallback() { + if (dst instanceof BooleanDataBuffer) { + BooleanDataBuffer booleanDst = (BooleanDataBuffer) dst; + for (int idx = 0; idx < size; ++idx) { + booleanDst.setBoolean(values[idx + offset], idx); + } + } else { + for (int idx = 0; idx < size; ++idx) { + dst.setObject(values[idx + offset], idx); + } + } + return BooleanArrayDataBuffer.this; + } + }); + } + + @Override + public BooleanDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + return new BooleanArrayDataBuffer(values, readOnly, offset + (int) index, (int) size); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(values, offset, length); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BooleanDataBuffer)) { + return super.equals(obj); + } + BooleanDataBuffer other = (BooleanDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(boolean[] array, int arrayOffset, int arrayLength) { + if (offset == 0 + && values.length == length + && arrayOffset == 0 + && array.length == arrayLength) { + return Arrays.equals(array, values); + } + for (int idx = 0; idx < size(); ++idx) { + if (array[idx + arrayOffset] != values[idx + offset]) { + return false; + } + } + return true; + } + + @Override + public Boolean visit(BitSet bitSet, int bitSetOffset, long numBits) { + for (int idx = 0; idx < size(); ++idx) { + if (bitSet.get(idx + bitSetOffset) != values[idx + offset]) { + return false; + } + } + return true; + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getBoolean(idx) != values[idx + offset]) { + return false; + } + } + return true; + } + }); + } + + BooleanArrayDataBuffer(boolean[] values, boolean readOnly) { + this(values, readOnly, 0, values.length); + } + + private BooleanArrayDataBuffer(boolean[] values, boolean readOnly, int offset, int length) { + this.values = values; + this.readOnly = readOnly; + this.offset = offset; + this.length = length; + } + + private final boolean[] values; + private final boolean readOnly; + private final int offset; + private final int length; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/MiscDataBufferFactory.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/MiscDataBufferFactory.java new file mode 100644 index 00000000000..73bbaa2d3d3 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/misc/MiscDataBufferFactory.java @@ -0,0 +1,38 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.misc; + +import java.util.BitSet; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; + +/** Factory of miscellaneous data buffers */ +public class MiscDataBufferFactory { + + public static BooleanDataBuffer create(BitSet bitSet, long numBits, boolean readOnly) { + return new BitSetDataBuffer(bitSet, numBits, readOnly); + } + + public static BooleanDataBuffer create(boolean[] array, boolean readOnly) { + return new BooleanArrayDataBuffer(array, readOnly); + } + + public static DataBuffer create(T[] array, boolean readOnly) { + return new ArrayDataBuffer<>(array, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java new file mode 100644 index 00000000000..3709b97008c --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/AbstractNioDataBuffer.java @@ -0,0 +1,41 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.Buffer; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; + +/** + * Base class for all JDK-based data buffers. + * + * @param type of elements (or values) stored in this buffer + */ +abstract class AbstractNioDataBuffer extends AbstractDataBuffer { + + @Override + public long size() { + return buf().capacity(); + } + + @Override + public boolean isReadOnly() { + return buf().isReadOnly(); + } + + abstract Buffer buf(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java new file mode 100644 index 00000000000..9263286ddb4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBuffer.java @@ -0,0 +1,184 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.ByteBuffer; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.DataLayouts; +import org.tensorflow.ndarray.impl.buffer.Validator; +import org.tensorflow.ndarray.impl.buffer.adapter.DataBufferAdapterFactory; + +/** A buffer of bytes using a JDK {@link ByteBuffer} for storage. */ +final class ByteNioDataBuffer extends AbstractNioDataBuffer implements ByteDataBuffer { + + @Override + public byte getByte(long index) { + return buf.get((int) index); + } + + @Override + public ByteDataBuffer setByte(byte value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public ByteDataBuffer read(byte[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public ByteDataBuffer write(byte[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public ByteDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public ByteDataBuffer visit(ByteBuffer buffer) { + buffer.duplicate().put((ByteBuffer) buf.duplicate().limit((int) size)); + return ByteNioDataBuffer.this; + } + + @Override + public ByteDataBuffer fallback() { + if (dst instanceof ByteDataBuffer) { + ByteDataBuffer byteDst = (ByteDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + byteDst.setByte(getByte(idx), idx); + } + return ByteNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public IntDataBuffer asInts() { + return new IntNioDataBuffer(buf.asIntBuffer()); + } + + @Override + public ShortDataBuffer asShorts() { + return new ShortNioDataBuffer(buf.asShortBuffer()); + } + + @Override + public LongDataBuffer asLongs() { + return new LongNioDataBuffer(buf.asLongBuffer()); + } + + @Override + public FloatDataBuffer asFloats() { + return new FloatNioDataBuffer(buf.asFloatBuffer()); + } + + @Override + public DoubleDataBuffer asDoubles() { + return new DoubleNioDataBuffer(buf.asDoubleBuffer()); + } + + @Override + public BooleanDataBuffer asBooleans() { + return DataBufferAdapterFactory.create(this, DataLayouts.BOOL); + } + + @Override + public ByteDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new ByteNioDataBuffer(((ByteBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public ByteDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new ByteNioDataBuffer(((ByteBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public ByteDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + ByteBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new ByteNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ByteDataBuffer)) { + return super.equals(obj); + } + ByteDataBuffer other = (ByteDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(ByteBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getByte(idx) != getByte(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + ByteBuffer buf() { + return buf; + } + + ByteNioDataBuffer(ByteBuffer buf) { + this.buf = buf; + } + + private ByteBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java new file mode 100644 index 00000000000..87d16da292d --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBuffer.java @@ -0,0 +1,146 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.DoubleBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** A buffer of bytes using a JDK {@link DoubleBuffer} for storage. */ +final class DoubleNioDataBuffer extends AbstractNioDataBuffer implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + return buf.get((int) index); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public DoubleDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public DoubleDataBuffer visit(DoubleBuffer buffer) { + buffer.duplicate().put((DoubleBuffer) buf.duplicate().limit((int) size)); + return DoubleNioDataBuffer.this; + } + + @Override + public DoubleDataBuffer fallback() { + if (dst instanceof DoubleDataBuffer) { + DoubleDataBuffer doubleDst = (DoubleDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + doubleDst.setDouble(getDouble(idx), idx); + } + return DoubleNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public DoubleDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new DoubleNioDataBuffer(((DoubleBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public DoubleDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new DoubleNioDataBuffer(((DoubleBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public DoubleDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + DoubleBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new DoubleNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DoubleDataBuffer)) { + return super.equals(obj); + } + DoubleDataBuffer other = (DoubleDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(DoubleBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getDouble(idx) != getDouble(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + DoubleBuffer buf() { + return buf; + } + + DoubleNioDataBuffer(DoubleBuffer buf) { + this.buf = buf; + } + + private DoubleBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java new file mode 100644 index 00000000000..8fc3d2681e6 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBuffer.java @@ -0,0 +1,146 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.FloatBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** A buffer of bytes using a JDK {@link FloatBuffer} for storage. */ +final class FloatNioDataBuffer extends AbstractNioDataBuffer implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + return buf.get((int) index); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public FloatDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public FloatDataBuffer visit(FloatBuffer buffer) { + buffer.duplicate().put((FloatBuffer) buf.duplicate().limit((int) size)); + return FloatNioDataBuffer.this; + } + + @Override + public FloatDataBuffer fallback() { + if (dst instanceof FloatDataBuffer) { + FloatDataBuffer floatDst = (FloatDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + floatDst.setFloat(getFloat(idx), idx); + } + return FloatNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public FloatDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new FloatNioDataBuffer(((FloatBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public FloatDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new FloatNioDataBuffer(((FloatBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public FloatDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + FloatBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new FloatNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof FloatDataBuffer)) { + return super.equals(obj); + } + FloatDataBuffer other = (FloatDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(FloatBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getFloat(idx) != getFloat(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + FloatBuffer buf() { + return buf; + } + + FloatNioDataBuffer(FloatBuffer buf) { + this.buf = buf; + } + + private FloatBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java new file mode 100644 index 00000000000..eda8c8f61b5 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBuffer.java @@ -0,0 +1,146 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.IntBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** A buffer of bytes using a JDK {@link IntBuffer} for storage. */ +final class IntNioDataBuffer extends AbstractNioDataBuffer implements IntDataBuffer { + + @Override + public int getInt(long index) { + return buf.get((int) index); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public IntDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public IntDataBuffer visit(IntBuffer buffer) { + buffer.duplicate().put((IntBuffer) buf.duplicate().limit((int) size)); + return IntNioDataBuffer.this; + } + + @Override + public IntDataBuffer fallback() { + if (dst instanceof IntDataBuffer) { + IntDataBuffer intDst = (IntDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + intDst.setInt(getInt(idx), idx); + } + return IntNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public IntDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new IntNioDataBuffer(((IntBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public IntDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new IntNioDataBuffer(((IntBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public IntDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + IntBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new IntNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IntDataBuffer)) { + return super.equals(obj); + } + IntDataBuffer other = (IntDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(IntBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getInt(idx) != getInt(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + IntBuffer buf() { + return buf; + } + + IntNioDataBuffer(IntBuffer buf) { + this.buf = buf; + } + + private IntBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java new file mode 100644 index 00000000000..ceffbeb216e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBuffer.java @@ -0,0 +1,146 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.LongBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** A buffer of bytes using a JDK {@link LongBuffer} for storage. */ +final class LongNioDataBuffer extends AbstractNioDataBuffer implements LongDataBuffer { + + @Override + public long getLong(long index) { + return buf.get((int) index); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public LongDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public LongDataBuffer visit(LongBuffer buffer) { + buffer.duplicate().put((LongBuffer) buf.duplicate().limit((int) size)); + return LongNioDataBuffer.this; + } + + @Override + public LongDataBuffer fallback() { + if (dst instanceof LongDataBuffer) { + LongDataBuffer longDst = (LongDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + longDst.setLong(getLong(idx), idx); + } + return LongNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public LongDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new LongNioDataBuffer(((LongBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public LongDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new LongNioDataBuffer(((LongBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public LongDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + LongBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new LongNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LongDataBuffer)) { + return super.equals(obj); + } + LongDataBuffer other = (LongDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(LongBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getLong(idx) != getLong(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + LongBuffer buf() { + return buf; + } + + LongNioDataBuffer(LongBuffer buf) { + this.buf = buf; + } + + private LongBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/NioDataBufferFactory.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/NioDataBufferFactory.java new file mode 100644 index 00000000000..e26b2a702ff --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/NioDataBufferFactory.java @@ -0,0 +1,59 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; + +/** Factory of JDK NIO-based data buffers */ +public class NioDataBufferFactory { + + public static ByteDataBuffer create(ByteBuffer buffer) { + return new ByteNioDataBuffer(buffer); + } + + public static DoubleDataBuffer create(DoubleBuffer buffer) { + return new DoubleNioDataBuffer(buffer); + } + + public static FloatDataBuffer create(FloatBuffer buffer) { + return new FloatNioDataBuffer(buffer); + } + + public static IntDataBuffer create(IntBuffer buffer) { + return new IntNioDataBuffer(buffer); + } + + public static LongDataBuffer create(LongBuffer buffer) { + return new LongNioDataBuffer(buffer); + } + + public static ShortDataBuffer create(ShortBuffer buffer) { + return new ShortNioDataBuffer(buffer); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java new file mode 100644 index 00000000000..e6535275f07 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBuffer.java @@ -0,0 +1,146 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.ShortBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** A buffer of bytes using a JDK {@link ShortBuffer} for storage. */ +final class ShortNioDataBuffer extends AbstractNioDataBuffer implements ShortDataBuffer { + + @Override + public short getShort(long index) { + return buf.get((int) index); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + buf.put((int) index, value); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public ShortDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public ShortDataBuffer visit(ShortBuffer buffer) { + buffer.duplicate().put((ShortBuffer) buf.duplicate().limit((int) size)); + return ShortNioDataBuffer.this; + } + + @Override + public ShortDataBuffer fallback() { + if (dst instanceof ShortDataBuffer) { + ShortDataBuffer shortDst = (ShortDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + shortDst.setShort(getShort(idx), idx); + } + return ShortNioDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public ShortDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new ShortNioDataBuffer(((ShortBuffer) buf.duplicate().position((int) index)).slice()); + } + + @Override + public ShortDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new ShortNioDataBuffer(((ShortBuffer) buf.duplicate().limit((int) size)).slice()); + } + + @Override + public ShortDataBuffer slice(long index, long size) { + Validator.sliceArgs(this, index, size); + ShortBuffer sliceBuf = buf.duplicate(); + sliceBuf.position((int) index); + sliceBuf.limit((int) index + (int) size); + return new ShortNioDataBuffer(sliceBuf.slice()); + } + + @Override + public R accept(DataStorageVisitor visitor) { + return visitor.visit(buf); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ShortDataBuffer)) { + return super.equals(obj); + } + ShortDataBuffer other = (ShortDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(ShortBuffer buffer) { + return buf.equals(buffer); + } + + @Override + public Boolean fallback() { + for (int idx = 0; idx < size(); ++idx) { + if (other.getShort(idx) != getShort(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + ShortBuffer buf() { + return buf; + } + + ShortNioDataBuffer(ShortBuffer buf) { + this.buf = buf; + } + + private ShortBuffer buf; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/AbstractRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/AbstractRawDataBuffer.java new file mode 100644 index 00000000000..0ce4da0f602 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/AbstractRawDataBuffer.java @@ -0,0 +1,94 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferWindow; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +@SuppressWarnings("unchecked") +abstract class AbstractRawDataBuffer> extends AbstractDataBuffer { + + public long size() { + return memory.size(); + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + public B read(Object dst, int dstLength) { + Validator.readArgs(this, dstLength, 0, dstLength); + memory.copyTo(UnsafeMemoryHandle.fromArray(dst, dstLength), dstLength); + return (B) this; + } + + public B read(Object dst, int dstLength, int offset, int length) { + Validator.readArgs(this, dstLength, offset, length); + memory.copyTo(UnsafeMemoryHandle.fromArray(dst, dstLength).offset(offset), length); + return (B) this; + } + + public B write(Object src, int srcLength) { + Validator.writeArgs(this, srcLength, 0, srcLength); + UnsafeMemoryHandle.fromArray(src, srcLength).copyTo(memory, srcLength); + return (B) this; + } + + public B write(Object src, int srcLength, int offset, int length) { + Validator.writeArgs(this, srcLength, offset, length); + UnsafeMemoryHandle.fromArray(src, srcLength).offset(offset).copyTo(memory, length); + return (B) this; + } + + @Override + public B copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof AbstractRawDataBuffer) { + AbstractRawDataBuffer unsafeDst = (AbstractRawDataBuffer) dst; + memory.copyTo(unsafeDst.memory, size); + } else { + super.copyTo(dst, size); + } + return (B) this; + } + + @Override + public B slice(long index, long size) { + Validator.sliceArgs(this, index, size); + return instantiate(memory.slice(index, size)); + } + + @Override + public DataBufferWindow window(long size) { + B windowBuffer = instantiate(memory.slice(0, size)); + return new RawDataBufferWindow<>((AbstractRawDataBuffer) windowBuffer, size()); + } + + protected final UnsafeMemoryHandle memory; + protected final boolean readOnly; + + protected abstract B instantiate(UnsafeMemoryHandle region); + + AbstractRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + this.memory = memory; + this.readOnly = readOnly; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java new file mode 100644 index 00000000000..ecde38f72d8 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBuffer.java @@ -0,0 +1,149 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.util.Arrays; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class BooleanRawDataBuffer extends AbstractRawDataBuffer + implements BooleanDataBuffer { + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return memory.getBoolean(index); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + memory.setBoolean(value, index); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst) { + return read(dst, dst.length); + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public BooleanDataBuffer write(boolean[] src) { + return write(src, src.length); + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public BooleanDataBuffer visit(boolean[] array, int offset, int length) { + memory.copyTo(UnsafeMemoryHandle.fromArray(array, offset, length), size); + return BooleanRawDataBuffer.this; + } + + @Override + public BooleanDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return BooleanRawDataBuffer.this; + } + + @Override + public BooleanDataBuffer fallback() { + if (dst instanceof BooleanDataBuffer) { + BooleanDataBuffer booleanDst = (BooleanDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + booleanDst.setBoolean(getBoolean(idx), idx); + } + return BooleanRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit( + (boolean[]) memory.object, memory.arrayOffset(boolean[].class), (int) memory.size()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof BooleanDataBuffer)) { + return super.equals(obj); + } + BooleanDataBuffer other = (BooleanDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(boolean[] array, int offset, int length) { + if (memory.isArray() && memory.arrayOffset(boolean[].class) == 0 && offset == 0) { + boolean[] thisArray = memory.array(); + if (thisArray.length == array.length) { + return Arrays.equals(thisArray, array); + } + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getBoolean(idx) != getBoolean(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected BooleanDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new BooleanRawDataBuffer(memory, readOnly); + } + + BooleanRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java new file mode 100644 index 00000000000..5916064a516 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBuffer.java @@ -0,0 +1,189 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.ByteBuffer; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class ByteRawDataBuffer extends AbstractRawDataBuffer + implements ByteDataBuffer { + + @Override + public byte getByte(long index) { + Validator.getArgs(this, index); + return memory.getByte(index); + } + + @Override + public ByteDataBuffer setByte(byte value, long index) { + Validator.setArgs(this, index); + memory.setByte(value, index); + return this; + } + + @Override + public ByteDataBuffer read(byte[] dst) { + return read(dst, dst.length); + } + + @Override + public ByteDataBuffer read(byte[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public ByteDataBuffer write(byte[] src) { + return write(src, src.length); + } + + @Override + public ByteDataBuffer write(byte[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public ByteDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public ByteDataBuffer visit(ByteBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayByteBuffer()); + } else { + slowCopyTo(dst, size); + } + return ByteRawDataBuffer.this; + } + + @Override + public ByteDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return ByteRawDataBuffer.this; + } + + @Override + public ByteDataBuffer fallback() { + if (dst instanceof ByteDataBuffer) { + ByteDataBuffer byteDst = (ByteDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + byteDst.setByte(getByte(idx), idx); + } + return ByteRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public IntDataBuffer asInts() { + return new IntRawDataBuffer(memory.rescale(Integer.BYTES), readOnly); + } + + @Override + public ShortDataBuffer asShorts() { + return new ShortRawDataBuffer(memory.rescale(Short.BYTES), readOnly); + } + + @Override + public LongDataBuffer asLongs() { + return new LongRawDataBuffer(memory.rescale(Long.BYTES), readOnly); + } + + @Override + public FloatDataBuffer asFloats() { + return new FloatRawDataBuffer(memory.rescale(Float.BYTES), readOnly); + } + + @Override + public DoubleDataBuffer asDoubles() { + return new DoubleRawDataBuffer(memory.rescale(Double.BYTES), readOnly); + } + + @Override + public BooleanDataBuffer asBooleans() { + return new BooleanRawDataBuffer(memory.rescale(Byte.BYTES), readOnly); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayByteBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ByteDataBuffer)) { + return super.equals(obj); + } + ByteDataBuffer other = (ByteDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(ByteBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayByteBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getByte(idx) != getByte(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected ByteDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new ByteRawDataBuffer(memory, readOnly); + } + + ByteRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java new file mode 100644 index 00000000000..c6259f7aa61 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBuffer.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.DoubleBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class DoubleRawDataBuffer extends AbstractRawDataBuffer + implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + Validator.getArgs(this, index); + return memory.getDouble(index); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + Validator.setArgs(this, index); + memory.setDouble(value, index); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst) { + return read(dst, dst.length); + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public DoubleDataBuffer write(double[] src) { + return write(src, src.length); + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public DoubleDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public DoubleDataBuffer visit(DoubleBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayDoubleBuffer()); + } else { + slowCopyTo(dst, size); + } + return DoubleRawDataBuffer.this; + } + + @Override + public DoubleDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return DoubleRawDataBuffer.this; + } + + @Override + public DoubleDataBuffer fallback() { + if (dst instanceof DoubleDataBuffer) { + DoubleDataBuffer doubleDst = (DoubleDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + doubleDst.setDouble(getDouble(idx), idx); + } + return DoubleRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayDoubleBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DoubleDataBuffer)) { + return super.equals(obj); + } + DoubleDataBuffer other = (DoubleDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(DoubleBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayDoubleBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getDouble(idx) != getDouble(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected DoubleDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new DoubleRawDataBuffer(memory, readOnly); + } + + DoubleRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java new file mode 100644 index 00000000000..2a9d12f47b3 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBuffer.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.FloatBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class FloatRawDataBuffer extends AbstractRawDataBuffer + implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + Validator.getArgs(this, index); + return memory.getFloat(index); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + Validator.setArgs(this, index); + memory.setFloat(value, index); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst) { + return read(dst, dst.length); + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public FloatDataBuffer write(float[] src) { + return write(src, src.length); + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public FloatDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public FloatDataBuffer visit(FloatBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayFloatBuffer()); + } else { + slowCopyTo(dst, size); + } + return FloatRawDataBuffer.this; + } + + @Override + public FloatDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return FloatRawDataBuffer.this; + } + + @Override + public FloatDataBuffer fallback() { + if (dst instanceof FloatDataBuffer) { + FloatDataBuffer floatDst = (FloatDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + floatDst.setFloat(getFloat(idx), idx); + } + return FloatRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayFloatBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof FloatDataBuffer)) { + return super.equals(obj); + } + FloatDataBuffer other = (FloatDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(FloatBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayFloatBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getFloat(idx) != getFloat(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected FloatDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new FloatRawDataBuffer(memory, readOnly); + } + + FloatRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java new file mode 100644 index 00000000000..891c4c6f3aa --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBuffer.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.IntBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class IntRawDataBuffer extends AbstractRawDataBuffer + implements IntDataBuffer { + + @Override + public int getInt(long index) { + Validator.getArgs(this, index); + return memory.getInt(index); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + Validator.setArgs(this, index); + memory.setInt(value, index); + return this; + } + + @Override + public IntDataBuffer read(int[] dst) { + return read(dst, dst.length); + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public IntDataBuffer write(int[] src) { + return write(src, src.length); + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public IntDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public IntDataBuffer visit(IntBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayIntBuffer()); + } else { + slowCopyTo(dst, size); + } + return IntRawDataBuffer.this; + } + + @Override + public IntDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return IntRawDataBuffer.this; + } + + @Override + public IntDataBuffer fallback() { + if (dst instanceof IntDataBuffer) { + IntDataBuffer intDst = (IntDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + intDst.setInt(getInt(idx), idx); + } + return IntRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayIntBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof IntDataBuffer)) { + return super.equals(obj); + } + IntDataBuffer other = (IntDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(IntBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayIntBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getInt(idx) != getInt(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected IntDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new IntRawDataBuffer(memory, readOnly); + } + + IntRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java new file mode 100644 index 00000000000..6fb918ae093 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBuffer.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.LongBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class LongRawDataBuffer extends AbstractRawDataBuffer + implements LongDataBuffer { + + @Override + public long getLong(long index) { + Validator.getArgs(this, index); + return memory.getLong(index); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + Validator.setArgs(this, index); + memory.setLong(value, index); + return this; + } + + @Override + public LongDataBuffer read(long[] dst) { + return read(dst, dst.length); + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public LongDataBuffer write(long[] src) { + return write(src, src.length); + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public LongDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public LongDataBuffer visit(LongBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayLongBuffer()); + } else { + slowCopyTo(dst, size); + } + return LongRawDataBuffer.this; + } + + @Override + public LongDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return LongRawDataBuffer.this; + } + + @Override + public LongDataBuffer fallback() { + if (dst instanceof LongDataBuffer) { + LongDataBuffer longDst = (LongDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + longDst.setLong(getLong(idx), idx); + } + return LongRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayLongBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LongDataBuffer)) { + return super.equals(obj); + } + LongDataBuffer other = (LongDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(LongBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayLongBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getLong(idx) != getLong(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected LongDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new LongRawDataBuffer(memory, readOnly); + } + + LongRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferFactory.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferFactory.java new file mode 100644 index 00000000000..b185eefa6b5 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferFactory.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +/** Factory of raw data buffers */ +public class RawDataBufferFactory { + + public static boolean canBeUsed() { + return UnsafeReference.isAvailable(); + } + + public static BooleanDataBuffer create(boolean[] array, boolean readOnly) { + return new BooleanRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static ByteDataBuffer create(byte[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new ByteRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static DoubleDataBuffer create(double[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new DoubleRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static FloatDataBuffer create(float[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new FloatRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static IntDataBuffer create(int[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new IntRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static LongDataBuffer create(long[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new LongRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static ShortDataBuffer create(short[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new ShortRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + protected static BooleanDataBuffer mapNativeBooleans(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new BooleanRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Byte.BYTES), readOnly); + } + + protected static ByteDataBuffer mapNativeBytes(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new ByteRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Byte.BYTES), readOnly); + } + + protected static DoubleDataBuffer mapNativeDoubles(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new DoubleRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Double.BYTES), readOnly); + } + + protected static FloatDataBuffer mapNativeFloats(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new FloatRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Float.BYTES), readOnly); + } + + protected static IntDataBuffer mapNativeInts(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new IntRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Integer.BYTES), readOnly); + } + + protected static LongDataBuffer mapNativeLongs(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new LongRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Long.BYTES), readOnly); + } + + protected static ShortDataBuffer mapNativeShorts(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new ShortRawDataBuffer( + UnsafeMemoryHandle.fromAddress(address, size, Short.BYTES), readOnly); + } + + /* + * The maximum size for a buffer of this type, i.e. the maximum number of bytes it can store. + *

    + * As the maximum size may vary depending on the JVM implementation and on the platform, this + * property returns a value that is safe for most of them. + */ + static long MAX_32BITS = Integer.MAX_VALUE - 10; + static long MAX_64BITS = Long.MAX_VALUE - 10; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferWindow.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferWindow.java new file mode 100644 index 00000000000..0b5aa464ea3 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/RawDataBufferWindow.java @@ -0,0 +1,19 @@ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.buffer.AbstractDataBufferWindow; + +final class RawDataBufferWindow> extends AbstractDataBufferWindow { + + @Override + public void offset(long offset) { + windowMemory.rebase(offset); + } + + > RawDataBufferWindow(R windowBuffer, long bufferLimit) { + super((B) windowBuffer, bufferLimit); + this.windowMemory = windowBuffer.memory; + } + + private final UnsafeMemoryHandle windowMemory; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java new file mode 100644 index 00000000000..df3320ff4bd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBuffer.java @@ -0,0 +1,153 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.ShortBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataStorageVisitor; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.Validator; + +final class ShortRawDataBuffer extends AbstractRawDataBuffer + implements ShortDataBuffer { + + @Override + public short getShort(long index) { + Validator.getArgs(this, index); + return memory.getShort(index); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + Validator.setArgs(this, index); + memory.setShort(value, index); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst) { + return read(dst, dst.length); + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public ShortDataBuffer write(short[] src) { + return write(src, src.length); + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + public ShortDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + return dst.accept( + new DataStorageVisitor() { + + @Override + public ShortDataBuffer visit(ShortBuffer buffer) { + if (buffer.hasArray()) { + memory.copyTo( + UnsafeMemoryHandle.fromArray(buffer.array(), buffer.position(), buffer.limit()), + size); + } else if (memory.isArray()) { + buffer.put(memory.toArrayShortBuffer()); + } else { + slowCopyTo(dst, size); + } + return ShortRawDataBuffer.this; + } + + @Override + public ShortDataBuffer visit(long address, long length, long scale) { + memory.copyTo(UnsafeMemoryHandle.fromAddress(address, length, scale), size); + return ShortRawDataBuffer.this; + } + + @Override + public ShortDataBuffer fallback() { + if (dst instanceof ShortDataBuffer) { + ShortDataBuffer shortDst = (ShortDataBuffer) dst; + for (long idx = 0L; idx < size; ++idx) { + shortDst.setShort(getShort(idx), idx); + } + return ShortRawDataBuffer.this; + } + return slowCopyTo(dst, size); + } + }); + } + + @Override + public R accept(DataStorageVisitor visitor) { + if (memory.isArray()) { + return visitor.visit(memory.toArrayShortBuffer()); + } + return visitor.visit(memory.byteOffset, memory.byteSize, memory.scale); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ShortDataBuffer)) { + return super.equals(obj); + } + ShortDataBuffer other = (ShortDataBuffer) obj; + if (size() != other.size()) { + return false; + } + return other.accept( + new DataStorageVisitor() { + + @Override + public Boolean visit(ShortBuffer buffer) { + if (memory.isArray()) { + return buffer.equals(memory.toArrayShortBuffer()); + } + return fallback(); + } + + @Override + public Boolean fallback() { + for (long idx = 0L; idx < size(); ++idx) { + if (other.getShort(idx) != getShort(idx)) { + return false; + } + } + return true; + } + }); + } + + @Override + protected ShortDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new ShortRawDataBuffer(memory, readOnly); + } + + ShortRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeMemoryHandle.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeMemoryHandle.java new file mode 100644 index 00000000000..e2022cb9dc7 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeMemoryHandle.java @@ -0,0 +1,214 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; + +final class UnsafeMemoryHandle { + + static UnsafeMemoryHandle fromArray(Object array, int length) { + return fromArray(array, 0, length); + } + + static UnsafeMemoryHandle fromArray(Object array, int arrayOffset, int length) { + long scale = UnsafeReference.UNSAFE.arrayIndexScale(array.getClass()); + int baseOffset = UnsafeReference.UNSAFE.arrayBaseOffset(array.getClass()); + return new UnsafeMemoryHandle(array, baseOffset + (arrayOffset * scale), length * scale, scale); + } + + static UnsafeMemoryHandle fromAddress(long address, long byteSize, long scale) { + return new UnsafeMemoryHandle(address, byteSize, scale); + } + + long size() { + return size; + } + + byte getByte(long index) { + return UnsafeReference.UNSAFE.getByte(object, align(index)); + } + + void setByte(byte value, long index) { + UnsafeReference.UNSAFE.putByte(object, align(index), value); + } + + boolean getBoolean(long index) { + return UnsafeReference.UNSAFE.getBoolean(object, align(index)); + } + + void setBoolean(boolean value, long index) { + UnsafeReference.UNSAFE.putBoolean(object, align(index), value); + } + + short getShort(long index) { + return UnsafeReference.UNSAFE.getShort(object, align(index)); + } + + void setShort(short value, long index) { + UnsafeReference.UNSAFE.putShort(object, align(index), value); + } + + int getInt(long index) { + return UnsafeReference.UNSAFE.getInt(object, align(index)); + } + + void setInt(int value, long index) { + UnsafeReference.UNSAFE.putInt(object, align(index), value); + } + + float getFloat(long index) { + return UnsafeReference.UNSAFE.getFloat(object, align(index)); + } + + void setFloat(float value, long index) { + UnsafeReference.UNSAFE.putFloat(object, align(index), value); + } + + double getDouble(long index) { + return UnsafeReference.UNSAFE.getDouble(object, align(index)); + } + + void setDouble(double value, long index) { + UnsafeReference.UNSAFE.putDouble(object, align(index), value); + } + + long getLong(long index) { + return UnsafeReference.UNSAFE.getLong(object, align(index)); + } + + void setLong(long value, long index) { + UnsafeReference.UNSAFE.putLong(object, align(index), value); + } + + void copyTo(UnsafeMemoryHandle memory, long length) { + UnsafeReference.UNSAFE.copyMemory( + object, byteOffset, memory.object, memory.byteOffset, length * scale); + } + + UnsafeMemoryHandle offset(long index) { + long offset = scale(index); + return new UnsafeMemoryHandle(object, this.byteOffset + offset, byteSize - offset, scale); + } + + UnsafeMemoryHandle narrow(long size) { + return new UnsafeMemoryHandle(object, byteOffset, scale(size), scale); + } + + UnsafeMemoryHandle slice(long index, long size) { + return new UnsafeMemoryHandle(object, this.byteOffset + scale(index), scale(size), scale); + } + + UnsafeMemoryHandle rescale(long scale) { + if (object != null) { + throw new IllegalStateException("Raw heap memory cannot be rescaled"); + } + return new UnsafeMemoryHandle(null, byteOffset, byteSize, scale); + } + + void rebase(long index) { + byteOffset = baseOffset + scale(index); + } + + boolean isArray() { + return object != null; + } + + @SuppressWarnings("unchecked") + A array() { + return (A) object; + } + + int arrayOffset(Class arrayClass) { + return (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(arrayClass)) / scale); + } + + ByteBuffer toArrayByteBuffer() { + return ByteBuffer.wrap( + (byte[]) object, + (int) byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(byte[].class), + (int) size); + } + + ShortBuffer toArrayShortBuffer() { + return ShortBuffer.wrap( + (short[]) object, + (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(short[].class)) / scale), + (int) size); + } + + IntBuffer toArrayIntBuffer() { + return IntBuffer.wrap( + (int[]) object, + (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(int[].class)) / scale), + (int) size); + } + + LongBuffer toArrayLongBuffer() { + return LongBuffer.wrap( + (long[]) object, + (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(long[].class)) / scale), + (int) size); + } + + FloatBuffer toArrayFloatBuffer() { + return FloatBuffer.wrap( + (float[]) object, + (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(float[].class)) / scale), + (int) size); + } + + DoubleBuffer toArrayDoubleBuffer() { + return DoubleBuffer.wrap( + (double[]) object, + (int) ((byteOffset - UnsafeReference.UNSAFE.arrayBaseOffset(double[].class)) / scale), + (int) size); + } + + final Object object; + final long baseOffset; + long byteOffset; + final long byteSize; + final long scale; + final long size; + + private UnsafeMemoryHandle(Object object, long baseOffset, long byteSize, long scale) { + this.object = object; + this.baseOffset = baseOffset; + byteOffset = baseOffset; + this.byteSize = byteSize; + this.scale = scale; + size = byteSize / scale; + } + + private UnsafeMemoryHandle(long address, long byteSize, long scale) { + this(null, address, byteSize, scale); + } + + private long align(long index) { + return byteOffset + index * scale; + } + + private long scale(long value) { + return value * scale; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java new file mode 100644 index 00000000000..d0a4e1a3e89 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/buffer/raw/UnsafeReference.java @@ -0,0 +1,83 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.raw; + +import java.lang.reflect.Field; +import sun.misc.Unsafe; + +final class UnsafeReference { + + static boolean isAvailable() { + return UNSAFE != null; + } + + static final Unsafe UNSAFE; + + static { + Unsafe unsafe = null; + try { + Class clazz = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = clazz.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + Object instance = theUnsafe.get(null); + if (instance.getClass() == clazz) { + checkMethod(clazz, "getByte", Object.class, long.class); + checkMethod(clazz, "putByte", Object.class, long.class, byte.class); + checkMethod(clazz, "getShort", Object.class, long.class); + checkMethod(clazz, "putShort", Object.class, long.class, short.class); + checkMethod(clazz, "getInt", Object.class, long.class); + checkMethod(clazz, "putInt", Object.class, long.class, int.class); + checkMethod(clazz, "getLong", Object.class, long.class); + checkMethod(clazz, "putLong", Object.class, long.class, long.class); + checkMethod(clazz, "getFloat", Object.class, long.class); + checkMethod(clazz, "putFloat", Object.class, long.class, float.class); + checkMethod(clazz, "getDouble", Object.class, long.class); + checkMethod(clazz, "putDouble", Object.class, long.class, double.class); + checkMethod(clazz, "getBoolean", Object.class, long.class); + checkMethod(clazz, "putBoolean", Object.class, long.class, boolean.class); + checkMethod( + clazz, "copyMemory", Object.class, long.class, Object.class, long.class, long.class); + checkMethod(clazz, "arrayBaseOffset", Class.class); + checkMethod(clazz, "arrayIndexScale", Class.class); + + unsafe = (Unsafe) instance; + } + } catch (ClassNotFoundException + | NoSuchMethodException + | NoSuchFieldException + | SecurityException + | IllegalAccessException + | ClassCastException ex) { + // Do nothing, keep unsafe as null + } + UNSAFE = unsafe; + } + + /** + * Validate that this Unsafe instance exposes this method + * + *

    ErrorProne does not like that we do nothing with the returned method... but there is nothing + * to do with it, so disable the check + */ + @SuppressWarnings("ReturnValueIgnored") + private static void checkMethod( + Class unsafeClass, String methodName, Class... parameterTypes) + throws NoSuchMethodException { + unsafeClass.getDeclaredMethod(methodName, parameterTypes); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java new file mode 100644 index 00000000000..399e45d2934 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/AbstractDenseNdArray.java @@ -0,0 +1,190 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferWindow; +import org.tensorflow.ndarray.impl.AbstractNdArray; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sequence.FastElementSequence; +import org.tensorflow.ndarray.impl.sequence.SingleElementSequence; +import org.tensorflow.ndarray.impl.sequence.SlicingElementSequence; +import org.tensorflow.ndarray.index.Index; + +@SuppressWarnings("unchecked") +public abstract class AbstractDenseNdArray> extends AbstractNdArray { + + @Override + public NdArraySequence elements(int dimensionIdx) { + if (dimensionIdx >= shape().numDimensions()) { + throw new IllegalArgumentException( + "Cannot iterate elements in dimension '" + + dimensionIdx + + "' of array with shape " + + shape()); + } + if (rank() == 0 && dimensionIdx < 0) { + return new SingleElementSequence<>(this); + } + DimensionalSpace elemDims = dimensions().from(dimensionIdx + 1); + try { + DataBufferWindow> elemWindow = + buffer().window(elemDims.physicalSize()); + U element = instantiateView(elemWindow.buffer(), elemDims); + return new FastElementSequence(this, dimensionIdx, element, elemWindow); + } catch (UnsupportedOperationException e) { + // If buffer windows are not supported, fallback to slicing (and slower) sequence + return new SlicingElementSequence<>(this, dimensionIdx, elemDims); + } + } + + @Override + public U withShape(Shape shape) { + if (shape == null || shape.isUnknown() || shape.size() != this.shape().size()) { + throw new IllegalArgumentException( + "Shape " + shape + " cannot be used to reshape ndarray of shape " + this.shape()); + } + if (shape.equals(this.shape())) { + return (U) this; + } + return instantiateView(buffer(), DimensionalSpace.create(shape)); + } + + @Override + public U slice(long position, DimensionalSpace sliceDimensions) { + DataBuffer sliceBuffer = buffer().slice(position, sliceDimensions.physicalSize()); + return instantiateView(sliceBuffer, sliceDimensions); + } + + @Override + public U slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + @Override + public U get(long... coords) { + return slice(positionOf(coords, false), dimensions().from(coords.length)); + } + + @Override + public T getObject(long... coords) { + return buffer().getObject(positionOf(coords, true)); + } + + @Override + public U set(NdArray src, long... coordinates) { + src.copyTo((coordinates == null || coordinates.length == 0) ? this : get(coordinates)); + return (U) this; + } + + @Override + public U setObject(T value, long... coords) { + buffer().setObject(value, positionOf(coords, true)); + return (U) this; + } + + @Override + public U copyTo(DataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer(), dimensions(), dst, DataTransfer::ofValue); + return (U) this; + } + + @Override + public U copyFrom(DataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer(), dimensions(), DataTransfer::ofValue); + return (U) this; + } + + @Override + public int hashCode() { + if (dimensions().isSegmented()) { + return slowHashCode(); + } + final int prime = 31; + int result = 1; + result = prime * result + buffer().hashCode(); + result = prime * result + shape().hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AbstractDenseNdArray)) { + return super.equals(obj); + } + AbstractDenseNdArray other = (AbstractDenseNdArray) obj; + if (dimensions().isSegmented() || other.dimensions().isSegmented()) { + return slowEquals(other); + } + if (!shape().equals(other.shape())) { + return false; + } + return buffer().equals(other.buffer()); + } + + /** + * A String showing the type and shape of this dense ndarray. + * + * @return A string containing the type and shape. + */ + @Override + public String toString() { + return this.getClass().getSimpleName() + "(shape=" + this.shape() + ")"; + } + + protected AbstractDenseNdArray(DimensionalSpace dimensions) { + super(dimensions); + } + + protected abstract DataBuffer buffer(); + + abstract U instantiateView(DataBuffer buffer, DimensionalSpace dimensions); + + long positionOf(long[] coords, boolean isValue) { + if (coords == null || coords.length == 0) { + return 0; + } + Validator.coordinates(dimensions, coords, isValue); + return dimensions.positionOf(coords); + } + + @Override + protected void slowCopyTo(NdArray array) { + if (array instanceof AbstractDenseNdArray) { + AbstractDenseNdArray dst = (AbstractDenseNdArray) array; + long offset = 0L; + for (NdArray s : scalars()) { + dst.buffer().setObject(s.getObject(), offset++); + } + } else { + super.slowCopyTo(array); + } + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java new file mode 100644 index 00000000000..ea428b02ca2 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArray.java @@ -0,0 +1,96 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.BooleanNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class BooleanDenseNdArray extends AbstractDenseNdArray + implements BooleanNdArray { + + public static BooleanNdArray create(BooleanDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new BooleanDenseNdArray(buffer, shape); + } + + @Override + public boolean getBoolean(long... indices) { + return buffer.getBoolean(positionOf(indices, true)); + } + + @Override + public BooleanNdArray setBoolean(boolean value, long... indices) { + buffer.setBoolean(value, positionOf(indices, true)); + return this; + } + + @Override + public BooleanNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof BooleanDenseNdArray) { + BooleanDenseNdArray booleanDst = (BooleanDenseNdArray) dst; + DataTransfer.execute( + buffer, + dimensions(), + booleanDst.buffer, + booleanDst.dimensions(), + DataTransfer::ofBoolean); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public BooleanNdArray copyTo(BooleanDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofBoolean); + return this; + } + + @Override + public BooleanNdArray copyFrom(BooleanDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofBoolean); + return this; + } + + protected BooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + BooleanDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new BooleanDenseNdArray((BooleanDataBuffer) buffer, dimensions); + } + + @Override + protected BooleanDataBuffer buffer() { + return buffer; + } + + private final BooleanDataBuffer buffer; + + private BooleanDenseNdArray(BooleanDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java new file mode 100644 index 00000000000..a8aff33063a --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.ByteNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class ByteDenseNdArray extends AbstractDenseNdArray + implements ByteNdArray { + + public static ByteNdArray create(ByteDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new ByteDenseNdArray(buffer, shape); + } + + @Override + public byte getByte(long... indices) { + return buffer.getByte(positionOf(indices, true)); + } + + @Override + public ByteNdArray setByte(byte value, long... indices) { + buffer.setByte(value, positionOf(indices, true)); + return this; + } + + @Override + public ByteNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof ByteDenseNdArray) { + ByteDenseNdArray byteDst = (ByteDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), byteDst.buffer, byteDst.dimensions(), DataTransfer::ofByte); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public ByteNdArray copyTo(ByteDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofByte); + return this; + } + + @Override + public ByteNdArray copyFrom(ByteDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofByte); + return this; + } + + protected ByteDenseNdArray(ByteDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + ByteDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new ByteDenseNdArray((ByteDataBuffer) buffer, dimensions); + } + + @Override + protected ByteDataBuffer buffer() { + return buffer; + } + + private final ByteDataBuffer buffer; + + private ByteDenseNdArray(ByteDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DataTransfer.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DataTransfer.java new file mode 100644 index 00000000000..aa3c874e021 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DataTransfer.java @@ -0,0 +1,143 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sequence.PositionIterator; + +final class DataTransfer { + + @FunctionalInterface + interface OfValue> { + void copy(B srcBuffer, long srcIndex, B dstBuffer, long dstIndex); + } + + static > void ofValue(B srcBuf, long srcIdx, B dstBuf, long dstIdx) { + dstBuf.setObject(srcBuf.getObject(srcIdx), dstIdx); + } + + static void ofByte(ByteDataBuffer srcBuf, long srcIdx, ByteDataBuffer dstBuf, long dstIdx) { + dstBuf.setByte(srcBuf.getByte(srcIdx), dstIdx); + } + + static void ofInt(IntDataBuffer srcBuf, long srcIdx, IntDataBuffer dstBuf, long dstIdx) { + dstBuf.setInt(srcBuf.getInt(srcIdx), dstIdx); + } + + static void ofLong(LongDataBuffer srcBuf, long srcIdx, LongDataBuffer dstBuf, long dstIdx) { + dstBuf.setLong(srcBuf.getLong(srcIdx), dstIdx); + } + + static void ofDouble(DoubleDataBuffer srcBuf, long srcIdx, DoubleDataBuffer dstBuf, long dstIdx) { + dstBuf.setDouble(srcBuf.getDouble(srcIdx), dstIdx); + } + + static void ofFloat(FloatDataBuffer srcBuf, long srcIdx, FloatDataBuffer dstBuf, long dstIdx) { + dstBuf.setFloat(srcBuf.getFloat(srcIdx), dstIdx); + } + + static void ofShort(ShortDataBuffer srcBuf, long srcIdx, ShortDataBuffer dstBuf, long dstIdx) { + dstBuf.setShort(srcBuf.getShort(srcIdx), dstIdx); + } + + static void ofBoolean( + BooleanDataBuffer srcBuf, long srcIdx, BooleanDataBuffer dstBuf, long dstIdx) { + dstBuf.setBoolean(srcBuf.getBoolean(srcIdx), dstIdx); + } + + static > void execute( + B srcBuffer, + DimensionalSpace srcDimensions, + B dstBuffer, + DimensionalSpace dstDimensions, + OfValue valueTransfer) { + if (srcDimensions.isSegmented() || dstDimensions.isSegmented()) { + int segmentationIdx = + Math.max(srcDimensions.segmentationIdx(), dstDimensions.segmentationIdx()); + copyByElement( + srcBuffer, + PositionIterator.create(srcDimensions, segmentationIdx), + dstBuffer, + PositionIterator.create(dstDimensions, segmentationIdx), + srcDimensions.get(segmentationIdx).elementSize(), + valueTransfer); + } else { + srcBuffer.copyTo(dstBuffer, srcDimensions.physicalSize()); + } + } + + static > void execute( + B srcBuffer, B dstBuffer, DimensionalSpace dstDimensions, OfValue valueTransfer) { + if (dstDimensions.isSegmented()) { + long elementSize = dstDimensions.get(dstDimensions.segmentationIdx()).elementSize(); + copyByElement( + srcBuffer, + PositionIterator.sequence(elementSize, srcBuffer.size()), + dstBuffer, + PositionIterator.create(dstDimensions, dstDimensions.segmentationIdx()), + elementSize, + valueTransfer); + } else { + srcBuffer.copyTo(dstBuffer, dstDimensions.physicalSize()); + } + } + + static > void execute( + B srcBuffer, DimensionalSpace srcDimensions, B dstBuffer, OfValue valueTransfer) { + if (srcDimensions.isSegmented()) { + long elementSize = srcDimensions.get(srcDimensions.segmentationIdx()).elementSize(); + copyByElement( + srcBuffer, + PositionIterator.create(srcDimensions, srcDimensions.segmentationIdx()), + dstBuffer, + PositionIterator.sequence(elementSize, dstBuffer.size()), + elementSize, + valueTransfer); + } else { + srcBuffer.copyTo(dstBuffer, srcDimensions.physicalSize()); + } + } + + private static > void copyByElement( + B srcBuffer, + PositionIterator srcIterator, + B dstBuffer, + PositionIterator dstIterator, + long elementSize, + OfValue valueTransfer) { + if (elementSize == 1) { + while (srcIterator.hasNext()) { + valueTransfer.copy(srcBuffer, srcIterator.nextLong(), dstBuffer, dstIterator.nextLong()); + } + } else { + while (srcIterator.hasNext()) { + srcBuffer + .offset(srcIterator.nextLong()) + .copyTo(dstBuffer.offset(dstIterator.nextLong()), elementSize); + } + } + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java new file mode 100644 index 00000000000..1006b5c05c5 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DenseNdArray.java @@ -0,0 +1,64 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class DenseNdArray extends AbstractDenseNdArray> { + + public static NdArray wrap(DataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new DenseNdArray<>(buffer, shape); + } + + @Override + public NdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof DenseNdArray) { + DenseNdArray denseDst = (DenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), denseDst.buffer, denseDst.dimensions(), DataTransfer::ofValue); + } else { + slowCopyTo(dst); + } + return this; + } + + protected DenseNdArray(DataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + DenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new DenseNdArray<>(buffer, dimensions); + } + + @Override + protected DataBuffer buffer() { + return buffer; + } + + private final DataBuffer buffer; + + private DenseNdArray(DataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java new file mode 100644 index 00000000000..4e9883c9c80 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class DoubleDenseNdArray extends AbstractDenseNdArray + implements DoubleNdArray { + + public static DoubleNdArray create(DoubleDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new DoubleDenseNdArray(buffer, shape); + } + + @Override + public double getDouble(long... indices) { + return buffer.getDouble(positionOf(indices, true)); + } + + @Override + public DoubleNdArray setDouble(double value, long... indices) { + buffer.setDouble(value, positionOf(indices, true)); + return this; + } + + @Override + public DoubleNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof DoubleDenseNdArray) { + DoubleDenseNdArray doubleDst = (DoubleDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), doubleDst.buffer, doubleDst.dimensions(), DataTransfer::ofDouble); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public DoubleNdArray copyTo(DoubleDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofDouble); + return this; + } + + @Override + public DoubleNdArray copyFrom(DoubleDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofDouble); + return this; + } + + protected DoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + DoubleDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new DoubleDenseNdArray((DoubleDataBuffer) buffer, dimensions); + } + + @Override + protected DoubleDataBuffer buffer() { + return buffer; + } + + private final DoubleDataBuffer buffer; + + private DoubleDenseNdArray(DoubleDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java new file mode 100644 index 00000000000..74369bcf1bc --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class FloatDenseNdArray extends AbstractDenseNdArray + implements FloatNdArray { + + public static FloatNdArray create(FloatDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new FloatDenseNdArray(buffer, shape); + } + + @Override + public float getFloat(long... indices) { + return buffer.getFloat(positionOf(indices, true)); + } + + @Override + public FloatNdArray setFloat(float value, long... indices) { + buffer.setFloat(value, positionOf(indices, true)); + return this; + } + + @Override + public FloatNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof FloatDenseNdArray) { + FloatDenseNdArray floatDst = (FloatDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), floatDst.buffer, floatDst.dimensions(), DataTransfer::ofFloat); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public FloatNdArray copyTo(FloatDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofFloat); + return this; + } + + @Override + public FloatNdArray copyFrom(FloatDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofFloat); + return this; + } + + protected FloatDenseNdArray(FloatDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + FloatDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new FloatDenseNdArray((FloatDataBuffer) buffer, dimensions); + } + + @Override + public FloatDataBuffer buffer() { + return buffer; + } + + private final FloatDataBuffer buffer; + + private FloatDenseNdArray(FloatDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java new file mode 100644 index 00000000000..e3210b18a7f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class IntDenseNdArray extends AbstractDenseNdArray + implements IntNdArray { + + public static IntNdArray create(IntDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new IntDenseNdArray(buffer, shape); + } + + @Override + public int getInt(long... indices) { + return buffer.getInt(positionOf(indices, true)); + } + + @Override + public IntNdArray setInt(int value, long... indices) { + buffer.setInt(value, positionOf(indices, true)); + return this; + } + + @Override + public IntNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof IntDenseNdArray) { + IntDenseNdArray intDst = (IntDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), intDst.buffer, intDst.dimensions(), DataTransfer::ofInt); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public IntNdArray copyTo(IntDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofInt); + return this; + } + + @Override + public IntNdArray copyFrom(IntDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofInt); + return this; + } + + protected IntDenseNdArray(IntDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + IntDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new IntDenseNdArray((IntDataBuffer) buffer, dimensions); + } + + @Override + protected IntDataBuffer buffer() { + return buffer; + } + + private final IntDataBuffer buffer; + + private IntDenseNdArray(IntDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java new file mode 100644 index 00000000000..7018f756c4f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class LongDenseNdArray extends AbstractDenseNdArray + implements LongNdArray { + + public static LongNdArray create(LongDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new LongDenseNdArray(buffer, shape); + } + + @Override + public long getLong(long... indices) { + return buffer.getLong(positionOf(indices, true)); + } + + @Override + public LongNdArray setLong(long value, long... indices) { + buffer.setLong(value, positionOf(indices, true)); + return this; + } + + @Override + public LongNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof LongDenseNdArray) { + LongDenseNdArray longDst = (LongDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), longDst.buffer, longDst.dimensions(), DataTransfer::ofLong); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public LongNdArray copyTo(LongDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofLong); + return this; + } + + @Override + public LongNdArray copyFrom(LongDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofLong); + return this; + } + + protected LongDenseNdArray(LongDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + LongDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new LongDenseNdArray((LongDataBuffer) buffer, dimensions); + } + + @Override + protected LongDataBuffer buffer() { + return buffer; + } + + private final LongDataBuffer buffer; + + private LongDenseNdArray(LongDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java new file mode 100644 index 00000000000..3aa2880adae --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArray.java @@ -0,0 +1,92 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public class ShortDenseNdArray extends AbstractDenseNdArray + implements ShortNdArray { + + public static ShortNdArray create(ShortDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new ShortDenseNdArray(buffer, shape); + } + + @Override + public short getShort(long... indices) { + return buffer.getShort(positionOf(indices, true)); + } + + @Override + public ShortNdArray setShort(short value, long... indices) { + buffer.setShort(value, positionOf(indices, true)); + return this; + } + + @Override + public ShortNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof ShortDenseNdArray) { + ShortDenseNdArray shortDst = (ShortDenseNdArray) dst; + DataTransfer.execute( + buffer, dimensions(), shortDst.buffer, shortDst.dimensions(), DataTransfer::ofShort); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public ShortNdArray copyTo(ShortDataBuffer dst) { + Validator.copyToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofShort); + return this; + } + + @Override + public ShortNdArray copyFrom(ShortDataBuffer src) { + Validator.copyFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofShort); + return this; + } + + protected ShortDenseNdArray(ShortDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + ShortDenseNdArray instantiateView(DataBuffer buffer, DimensionalSpace dimensions) { + return new ShortDenseNdArray((ShortDataBuffer) buffer, dimensions); + } + + @Override + protected ShortDataBuffer buffer() { + return buffer; + } + + private final ShortDataBuffer buffer; + + private ShortDenseNdArray(ShortDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java new file mode 100644 index 00000000000..3d2e9c5ed9b --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dense/Validator.java @@ -0,0 +1,49 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.IllegalRankException; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +final class Validator extends org.tensorflow.ndarray.impl.Validator { + + static void coordinates(DimensionalSpace dimensions, long[] coords, boolean isValue) { + if (coords.length > dimensions.numDimensions()) { + throw new IndexOutOfBoundsException(); + } + if (isValue && coords.length != dimensions.numDimensions()) { + throw new IllegalRankException("Not a scalar value"); + } + } + + static void denseShape(DataBuffer buffer, Shape shape) { + if (shape == null) { + throw new IllegalArgumentException("Shape cannot be null"); + } + if (shape.hasUnknownDimension()) { + throw new IllegalArgumentException("Dense arrays cannot have unknown dimension(s)"); + } + if (buffer.size() < shape.size()) { + throw new IllegalArgumentException("Buffer size is smaller than the shape size"); + } + ; + } + + private Validator() {} +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java new file mode 100644 index 00000000000..4c038ef581e --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/AbstractDimension.java @@ -0,0 +1,41 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dimension; + +abstract class AbstractDimension implements Dimension { + + /** Dimensions are known to be equal if they have the same number of elements */ + @Override + public int hashCode() { + final int prime = 17; + long numElements = numElements(); + return 31 * prime + (int) (numElements ^ (numElements >>> 32)); + } + + /** Dimensions are known to be equal if they have the same number of elements */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Dimension) { + Dimension otherDimension = (Dimension) obj; + return numElements() == otherDimension.numElements(); + } + return false; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java new file mode 100644 index 00000000000..e031150efc3 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Axis.java @@ -0,0 +1,61 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dimension; + +final class Axis extends AbstractDimension { + + @Override + public long numElements() { + return numElements; + } + + @Override + public long positionOf(long coord) { + if (coord >= numElements) { + throw new IndexOutOfBoundsException(); + } + return elementSize * coord; + } + + @Override + public boolean isSegmented() { + return false; // all axis are continuous + } + + @Override + public long elementSize() { + return elementSize; + } + + @Override + public long physicalSize() { + return elementSize * numElements; + } + + @Override + public String toString() { + return String.valueOf(numElements); + } + + Axis(long numElements, long elementSize) { + this.numElements = numElements; + this.elementSize = elementSize; + } + + private final long numElements; + private final long elementSize; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java new file mode 100644 index 00000000000..c24cd825403 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/Dimension.java @@ -0,0 +1,36 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dimension; + +import org.tensorflow.ndarray.index.Index; + +public interface Dimension { + + default Dimension withIndex(Index index) { + return new IndexedDimension(index, this); + } + + long numElements(); + + long elementSize(); + + long physicalSize(); + + long positionOf(long coord); + + boolean isSegmented(); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/DimensionalSpace.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/DimensionalSpace.java new file mode 100644 index 00000000000..598000d23e0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/DimensionalSpace.java @@ -0,0 +1,229 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.dimension; + +import java.util.Arrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.index.Index; + +public class DimensionalSpace { + + public static DimensionalSpace create(Shape shape) { + Dimension[] dimensions = new Dimension[shape.numDimensions()]; + + // Start from the last dimension, where all elements are continuous + for (int i = dimensions.length - 1, elementSize = 1; i >= 0; --i) { + dimensions[i] = new Axis(shape.get(i), elementSize); + elementSize *= dimensions[i].numElements(); + } + return new DimensionalSpace(dimensions, shape); + } + + public RelativeDimensionalSpace mapTo(Index[] indices) { + if (dimensions == null) { + throw new ArrayIndexOutOfBoundsException(); + } + int dimIdx = 0; + int indexIdx = 0; + int newDimIdx = 0; + int segmentationIdx = -1; + long initialOffset = 0; + + int newAxes = 0; + boolean seenEllipsis = false; + for (Index idx : indices) { + if (idx.isNewAxis()) { + newAxes += 1; + } + if (idx.isEllipsis()) { + if (seenEllipsis) { + throw new IllegalArgumentException("Only one ellipsis allowed"); + } else { + seenEllipsis = true; + } + } + } + int newLength = dimensions.length + newAxes; + + Dimension[] newDimensions = new Dimension[newLength]; + while (indexIdx < indices.length) { + + if (indices[indexIdx].isPoint()) { + // When an index targets a single point in a given dimension, calculate the offset of this + // point and cumulate the offset of any subsequent point as well + long offset = 0; + do { + offset += indices[indexIdx].mapCoordinate(0, dimensions[dimIdx]); + dimIdx++; + } while (++indexIdx < indices.length && indices[indexIdx].isPoint()); + + // If this is the first index, then the offset is the position of the whole dimension + // space within the original one. If not, then we apply the offset to the last vectorial + // dimension + if (newDimIdx == 0) { + initialOffset = offset; + } else { + long reducedSize = dimensions[dimIdx - 1].elementSize(); + newDimensions[newDimIdx - 1] = + new ReducedDimension(newDimensions[newDimIdx - 1], offset, reducedSize); + segmentationIdx = newDimIdx - 1; + } + + } else if (indices[indexIdx].isNewAxis()) { + long newSize; + if (dimIdx == 0) { + // includes everything. Should really include future reduction (at()) but that doesn't + // seem to cause issues + // elsewhere + newSize = dimensions[0].numElements() * dimensions[0].elementSize(); + } else { + newSize = dimensions[dimIdx - 1].elementSize(); + } + + newDimensions[newDimIdx] = new Axis(1, newSize); + segmentationIdx = newDimIdx; // is this correct? + ++newDimIdx; + ++indexIdx; + } else if (indices[indexIdx].isEllipsis()) { + int remainingDimensions = dimensions.length - dimIdx; + int requiredDimensions = 0; + for (int i = indexIdx + 1; i < indices.length; i++) { + if (!indices[i].isNewAxis()) { + requiredDimensions++; + } + } + // while the number of dimensions left < the number of indices that consume axes + while (remainingDimensions > requiredDimensions) { + Dimension dim = dimensions[dimIdx++]; + if (dim.isSegmented()) { + segmentationIdx = newDimIdx; + } + newDimensions[newDimIdx++] = dim; + remainingDimensions--; + } + indexIdx++; + } else { + // Map any other index to the appropriate dimension of this space + Dimension newDimension = indices[indexIdx].apply(dimensions[dimIdx++]); + newDimensions[newDimIdx] = newDimension; + if (newDimension.isSegmented()) { + segmentationIdx = newDimIdx; + } + ++newDimIdx; + ++indexIdx; + } + } + + // When the number of indices provided is smaller than the number of dimensions in this space, + // we copy the remaining dimensions directly to the new space as well. + for (; dimIdx < dimensions.length; ++dimIdx, ++newDimIdx) { + Dimension dim = dimensions[dimIdx]; + newDimensions[newDimIdx] = dim; + if (dim.isSegmented()) { + segmentationIdx = newDimIdx; + } + } + return new RelativeDimensionalSpace( + Arrays.copyOf(newDimensions, newDimIdx), segmentationIdx, initialOffset); + } + + public DimensionalSpace from(int dimensionStart) { + if (dimensionStart > dimensions.length) { + throw new IndexOutOfBoundsException(); + } + Dimension[] newDimensions = Arrays.copyOfRange(dimensions, dimensionStart, dimensions.length); + if (segmentationIdx >= dimensionStart) { + return new DimensionalSpace(newDimensions, segmentationIdx - dimensionStart); + } + return new DimensionalSpace(newDimensions); + } + + public Shape shape() { + if (shape == null) { + shape = toShape(dimensions); + } + return shape; + } + + public int numDimensions() { + return dimensions.length; + } + + public long numElements(int i) { + return dimensions[i].numElements(); + } + + public long physicalSize() { + return dimensions.length > 0 + ? dimensions[0].physicalSize() + : 1; // dimensions.length == 0 for scalars + } + + public Dimension get(int i) { + return dimensions[i]; + } + + public boolean isSegmented() { + return segmentationIdx >= 0; + } + + public int segmentationIdx() { + return segmentationIdx; + } + + public long positionOf(long[] coords) { + long position = 0L; + for (int i = 0; i < coords.length; ++i) { + position += dimensions[i].positionOf(coords[i]); + } + return position; + } + + /** Succinct description of the shape meant for debugging. */ + @Override + public String toString() { + return Arrays.toString(dimensions); + } + + DimensionalSpace(Dimension[] dimensions, int segmentationIdx) { + this.dimensions = dimensions; + this.segmentationIdx = segmentationIdx; + } + + private DimensionalSpace(Dimension[] dimensions) { + this(dimensions, -1); + } + + private DimensionalSpace(Dimension[] dimensions, Shape shape) { + this(dimensions); + this.shape = shape; + } + + private final Dimension[] dimensions; + private final int segmentationIdx; + private Shape shape; + + private static Shape toShape(Dimension[] dimensions) { + long[] shapeDimSizes = new long[dimensions.length]; + int i = 0; + for (Dimension dimension : dimensions) { + shapeDimSizes[i++] = dimension.numElements(); + } + return Shape.of(shapeDimSizes); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java new file mode 100644 index 00000000000..6129ff55e71 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/IndexedDimension.java @@ -0,0 +1,69 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dimension; + +import org.tensorflow.ndarray.index.Index; + +final class IndexedDimension extends AbstractDimension { + + @Override + public long numElements() { + return numElements; + } + + @Override + public long positionOf(long coord) { + if (coord >= numElements()) { + throw new IndexOutOfBoundsException(); + } + return originalDimension.positionOf(index.mapCoordinate(coord, originalDimension)); + } + + @Override + public boolean isSegmented() { + // TODO (karllessard) for now we consider all indexed dimensions as segmented but might depend + // on the actual index + return true; + } + + @Override + public long elementSize() { + return originalDimension.elementSize(); // indices do not change the size of an inner element + } + + @Override + public long physicalSize() { + // TODO (karllessard) we consider this dimension takes the same amount of memory that the + // original one but might depend on the actual index + return originalDimension.physicalSize(); + } + + @Override + public String toString() { + return String.valueOf(numElements()); + } + + IndexedDimension(Index index, Dimension originalDimension) { + this.index = index; + this.originalDimension = originalDimension; + this.numElements = index.numElements(originalDimension); + } + + private final Index index; + private final Dimension originalDimension; + private final long numElements; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java new file mode 100644 index 00000000000..a432b0754dd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/ReducedDimension.java @@ -0,0 +1,62 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dimension; + +final class ReducedDimension extends AbstractDimension { + + @Override + public long numElements() { + return originalDimension.numElements(); + } + + @Override + public long positionOf(long coord) { + return originalDimension.positionOf(coord) + offset; + } + + @Override + public boolean isSegmented() { + return true; + } + + @Override + public long elementSize() { + return elementSize; + } + + @Override + public long physicalSize() { + // We simplify the computation by assuming that a reduced dimension takes the same amount of + // memory than the original one + return originalDimension.physicalSize(); + } + + @Override + public String toString() { + return String.valueOf(numElements()); + } + + ReducedDimension(Dimension originalDimension, long offset, long elementSize) { + this.originalDimension = originalDimension; + this.offset = offset; + this.elementSize = elementSize; + } + + private final Dimension originalDimension; + private final long offset; + private final long elementSize; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java new file mode 100644 index 00000000000..b2d3cdd91a4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/RelativeDimensionalSpace.java @@ -0,0 +1,32 @@ +/* +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. +======================================================================= +*/ + +package org.tensorflow.ndarray.impl.dimension; + +public class RelativeDimensionalSpace extends DimensionalSpace { + + public long position() { + return position; + } + + RelativeDimensionalSpace(Dimension[] dimensions, int segmentationIdx, long position) { + super(dimensions, segmentationIdx); + this.position = position; + } + + private long position; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/CoordinatesIncrementor.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/CoordinatesIncrementor.java new file mode 100644 index 00000000000..8c9c9f86f4c --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/CoordinatesIncrementor.java @@ -0,0 +1,38 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +final class CoordinatesIncrementor { + + boolean increment() { + for (int i = coords.length - 1; i >= 0; --i) { + if ((coords[i] = (coords[i] + 1) % shape[i]) > 0) { + return true; + } + } + return false; + } + + CoordinatesIncrementor(long[] shape, int dimensionIdx) { + this.shape = shape; + this.coords = new long[dimensionIdx + 1]; + } + + final long[] shape; + final long[] coords; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java new file mode 100644 index 00000000000..eec12671911 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/FastElementSequence.java @@ -0,0 +1,87 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.Iterator; +import java.util.function.BiConsumer; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.buffer.DataBufferWindow; +import org.tensorflow.ndarray.impl.AbstractNdArray; + +/** + * A sequence recycling the same {@code NdArray} instance when iterating its elements + * + * @param Type of the elements + * @param Type of the {@code NdArray} with this sequence + */ +public final class FastElementSequence> implements NdArraySequence { + + public FastElementSequence( + AbstractNdArray ndArray, + int dimensionIdx, + U element, + DataBufferWindow elementWindow) { + this.ndArray = ndArray; + this.dimensionIdx = dimensionIdx; + this.element = element; + this.elementWindow = elementWindow; + } + + @Override + public Iterator iterator() { + return new SequenceIterator(); + } + + @Override + public void forEachIndexed(BiConsumer consumer) { + PositionIterator.createIndexed(ndArray.dimensions(), dimensionIdx) + .forEachIndexed( + (long[] coords, long position) -> { + elementWindow.slideTo(position); + consumer.accept(coords, element); + }); + } + + @Override + public NdArraySequence asSlices() { + return new SlicingElementSequence(ndArray, dimensionIdx); + } + + private class SequenceIterator implements Iterator { + + @Override + public boolean hasNext() { + return positionIterator.hasNext(); + } + + @Override + public U next() { + elementWindow.slideTo(positionIterator.nextLong()); + return element; + } + + private final PositionIterator positionIterator = + PositionIterator.create(ndArray.dimensions(), dimensionIdx); + } + + private final AbstractNdArray ndArray; + private final int dimensionIdx; + private final U element; + private final DataBufferWindow elementWindow; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedPositionIterator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedPositionIterator.java new file mode 100644 index 00000000000..30ece1599b6 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedPositionIterator.java @@ -0,0 +1,28 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +public interface IndexedPositionIterator extends PositionIterator { + + @FunctionalInterface + interface CoordsLongConsumer { + void consume(long[] coords, long position); + } + + void forEachIndexed(CoordsLongConsumer consumer); +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedSequentialPositionIterator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedSequentialPositionIterator.java new file mode 100644 index 00000000000..9ba90130ae1 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/IndexedSequentialPositionIterator.java @@ -0,0 +1,53 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +class IndexedSequentialPositionIterator extends SequentialPositionIterator + implements IndexedPositionIterator { + + @Override + public void forEachIndexed(CoordsLongConsumer consumer) { + while (hasNext()) { + consumer.consume(coords, nextLong()); + incrementCoords(); + } + } + + private void incrementCoords() { + for (int i = coords.length - 1; i >= 0; --i) { + if (coords[i] < shape[i] - 1) { + coords[i] += 1L; + return; + } + coords[i] = 0L; + } + } + + IndexedSequentialPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + super(dimensions, dimensionIdx); + this.shape = dimensions.shape().asArray(); + this.coords = new long[dimensionIdx + 1]; + // this.coordsIncrementor = new CoordinatesIncrementor(dimensions.shape().asArray(), + // dimensionIdx); + } + + private final long[] shape; + private final long[] coords; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/NdPositionIterator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/NdPositionIterator.java new file mode 100644 index 00000000000..789474c58ae --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/NdPositionIterator.java @@ -0,0 +1,70 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.NoSuchElementException; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +class NdPositionIterator implements IndexedPositionIterator { + + @Override + public boolean hasNext() { + return coords != null; + } + + @Override + public long nextLong() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + long position = dimensions.positionOf(coords); + increment(); + return position; + } + + @Override + public void forEachIndexed(CoordsLongConsumer consumer) { + while (hasNext()) { + consumer.consume(coords, dimensions.positionOf(coords)); + increment(); + } + } + + private void increment() { + if (!increment(coords, dimensions)) { + coords = null; + } + } + + static boolean increment(long[] coords, DimensionalSpace dimensions) { + for (int i = coords.length - 1; i >= 0; --i) { + if ((coords[i] = (coords[i] + 1) % dimensions.get(i).numElements()) > 0) { + return true; + } + } + return false; + } + + NdPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + this.dimensions = dimensions; + this.coords = new long[dimensionIdx + 1]; + } + + private final DimensionalSpace dimensions; + private long[] coords; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/PositionIterator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/PositionIterator.java new file mode 100644 index 00000000000..83ed940563c --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/PositionIterator.java @@ -0,0 +1,42 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.PrimitiveIterator; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +public interface PositionIterator extends PrimitiveIterator.OfLong { + + static PositionIterator create(DimensionalSpace dimensions, int dimensionIdx) { + if (dimensions.isSegmented()) { + return new NdPositionIterator(dimensions, dimensionIdx); + } + return new SequentialPositionIterator(dimensions, dimensionIdx); + } + + static IndexedPositionIterator createIndexed(DimensionalSpace dimensions, int dimensionIdx) { + if (dimensions.isSegmented()) { + return new NdPositionIterator(dimensions, dimensionIdx); + } + return new IndexedSequentialPositionIterator(dimensions, dimensionIdx); + } + + static PositionIterator sequence(long stride, long end) { + return new SequentialPositionIterator(stride, end); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SequentialPositionIterator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SequentialPositionIterator.java new file mode 100644 index 00000000000..65c6fc966cc --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SequentialPositionIterator.java @@ -0,0 +1,55 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.NoSuchElementException; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +class SequentialPositionIterator implements PositionIterator { + + @Override + public boolean hasNext() { + return index < end; + } + + @Override + public long nextLong() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return stride * index++; + } + + SequentialPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + long size = 1; + for (int i = 0; i <= dimensionIdx; ++i) { + size *= dimensions.get(i).numElements(); + } + this.stride = dimensions.get(dimensionIdx).elementSize(); + this.end = size; + } + + SequentialPositionIterator(long stride, long end) { + this.stride = stride; + this.end = end; + } + + private final long stride; + private final long end; + private long index; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SingleElementSequence.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SingleElementSequence.java new file mode 100644 index 00000000000..98f7b1919ca --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SingleElementSequence.java @@ -0,0 +1,72 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.Iterator; +import java.util.function.BiConsumer; +import org.tensorflow.ndarray.IllegalRankException; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.impl.AbstractNdArray; + +/** + * A sequence of one single element + * + * @param Type of the element + * @param Type of the {@code NdArray} with this sequence + */ +public final class SingleElementSequence> implements NdArraySequence { + + public SingleElementSequence(AbstractNdArray ndArray) { + this.ndArray = ndArray; + } + + @Override + public Iterator iterator() { + return new Iterator() { + + @Override + public boolean hasNext() { + return element != null; + } + + @Override + public U next() { + U ret = element; + element = null; + return ret; + } + + @SuppressWarnings("unchecked") + private U element = (U) ndArray; + }; + } + + @Override + public NdArraySequence asSlices() { + return this; // no need to slice, as there are only one element + } + + @Override + public void forEachIndexed(BiConsumer consumer) { + throw new IllegalRankException( + "Single element has no coordinates to iterate on, use forEach()"); + } + + private final AbstractNdArray ndArray; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SlicingElementSequence.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SlicingElementSequence.java new file mode 100644 index 00000000000..9d550d387d6 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sequence/SlicingElementSequence.java @@ -0,0 +1,79 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import java.util.Iterator; +import java.util.function.BiConsumer; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.impl.AbstractNdArray; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +/** + * A sequence creating a new {@code NdArray} instance (slice) for each element of an iteration + * + * @param Type of the element + * @param Type of the {@code NdArray} with this sequence + */ +public final class SlicingElementSequence> implements NdArraySequence { + + public SlicingElementSequence(AbstractNdArray ndArray, int dimensionIdx) { + this(ndArray, dimensionIdx, ndArray.dimensions().from(dimensionIdx + 1)); + } + + public SlicingElementSequence( + AbstractNdArray ndArray, int dimensionIdx, DimensionalSpace elementDimensions) { + this.ndArray = ndArray; + this.dimensionIdx = dimensionIdx; + this.elementDimensions = elementDimensions; + } + + @Override + public Iterator iterator() { + PositionIterator positionIterator = PositionIterator.create(ndArray.dimensions(), dimensionIdx); + return new Iterator() { + + @Override + public boolean hasNext() { + return positionIterator.hasNext(); + } + + @Override + public U next() { + return ndArray.slice(positionIterator.next(), elementDimensions); + } + }; + } + + @Override + public void forEachIndexed(BiConsumer consumer) { + PositionIterator.createIndexed(ndArray.dimensions(), dimensionIdx) + .forEachIndexed( + (long[] coords, long position) -> + consumer.accept(coords, ndArray.slice(position, elementDimensions))); + } + + @Override + public NdArraySequence asSlices() { + return this; + } + + private final AbstractNdArray ndArray; + private final int dimensionIdx; + private final DimensionalSpace elementDimensions; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java new file mode 100644 index 00000000000..2a471aca19f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/AbstractSparseNdArray.java @@ -0,0 +1,557 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.LongStream; +import org.tensorflow.ndarray.IllegalRankException; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.SparseNdArray; +import org.tensorflow.ndarray.impl.AbstractNdArray; +import org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray; +import org.tensorflow.ndarray.impl.dimension.Dimension; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sequence.SingleElementSequence; +import org.tensorflow.ndarray.impl.sequence.SlicingElementSequence; +import org.tensorflow.ndarray.index.Index; + +/** + * Abstract base class for sparse array. + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Object, long...)} methods + * + *

    {@code
    + * FloatSparseNdArray st = new FloatSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf(1f, 2f),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 2, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + * + * @param the type that the array contains + * @param the type of dense NdArray + */ +public abstract class AbstractSparseNdArray> extends AbstractNdArray + implements SparseNdArray { + /** + * A 2-D long array of shape {@code [N, ndims]}, that specifies the indices of the elements in the + * sparse array that contain non-default values (elements are zero-indexed). + * + *

    For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * coordinates {@code [1,3]} and {@code [2,4]} have non-default values. + */ + private LongNdArray indices; + + /** + * A 1-D array of any type and shape {@code [N]}, that supplies the values for each element in + * indices. + * + *

    For example, given {@code indices=[[1,3], [2,4]]}, and {@code values=[18, 3.6]} specifies + * that element {@code [1,3]} of the sparse array has a value of {@code 18}, and element {@code + * [2,4]} of the sparse array has a value of {@code 3.6}. + */ + private U values; + + /** + * Scalar value to set for indices not specified in {@link #getIndices()} This will default to + * zero, false, or the empty string depending on the data type of the values. + */ + private T defaultValue; + + /** + * Scalar NdArray to use for indices not specified in {@link #getIndices()} This will default to + * zero, false, or the empty string depending on the data type of the values, otherwise it will + * contain the defaultValue. + */ + private U defaultArray; + + /** + * Creates an abstract SparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #indices} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + */ + protected AbstractSparseNdArray( + LongNdArray indices, U values, T defaultValue, DimensionalSpace dimensions) { + super(dimensions); + this.indices = indices; + this.values = values; + setDefaultValue(defaultValue); + + // sanity checks on shapes, indices (shape = {@code [N, ndims]}, where N is the number of values + // (shape = {@code [N]}}. + if (this.indices.shape().get(0) != this.values.shape().get(0)) { + throw new IllegalArgumentException( + String.format( + "The number of rows in indices (%d) does not match the number of elements in values(%d).", + this.indices.shape().get(0), this.values.shape().get(0))); + } + + // sanity checks on shapes, indices (shape = {@code [N, ndims]}, where ndims = the number of + // dimensions in the dense shape. + if (this.indices.shape().get(1) != shape().numDimensions()) { + throw new IllegalArgumentException( + String.format( + "The number of columns in indices (%d) does not match the number of dimensions in shape (%d).", + this.indices.shape().get(1), shape().get(0))); + } + } + + /** + * Creates an abstract SparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected AbstractSparseNdArray(T defaultValue, DimensionalSpace dimensions) { + super(dimensions); + setDefaultValue(defaultValue); + } + + /** {@inheritDoc} */ + @Override + public NdArraySequence elements(int dimensionIdx) { + if (dimensionIdx >= shape().numDimensions()) { + throw new IllegalArgumentException( + "Cannot iterate elements in dimension '" + + dimensionIdx + + "' of array with shape " + + shape()); + } + if (rank() == 0 && dimensionIdx < 0) { + return new SingleElementSequence<>(this); + } + DimensionalSpace elemDims = dimensions().from(dimensionIdx + 1); + + return new SlicingElementSequence<>(this, dimensionIdx, elemDims); + } + + /** + * Computes the coordinates based on a relative position to the beginning of the dimension space. + * + * @param dimensions the dimension space + * @param position relative position to the beginning of the dimension space. + * @return the coordinates + */ + // TODO should have automatical access to the coordinates from which this position is coming from. + // But that will require some refactoring even at the dense level. + protected long[] toCoordinates(DimensionalSpace dimensions, long position) { + long[] result = new long[dimensions.numDimensions()]; + long p = position; + + for (int dim = 0; dim < dimensions.numDimensions(); dim++) { + Dimension dimension = dimensions.get(dim); + result[dim] = p / dimension.elementSize(); + p = p % dimension.elementSize(); + } + return result; + } + + /** + * Converts the given set of indices coordinates to a long array of coordinates. + * + *

    The shape of the NdArray is {@code [ndims]} + * + * @param l the LongNdArray containing the coordinates + * @return the long array containing the coordinates. + */ + protected long[] getIndicesCoordinates(LongNdArray l) { + long[] results = new long[(int) l.size()]; + for (int i = 0; i < l.size(); i++) { + results[i] = l.getLong(i); + } + return results; + } + + /** + * Converts this sparse array to a dense array. + * + * @return the dense array. + */ + public abstract U toDense(); + + @Override + public U withShape(Shape shape) { + throw new UnsupportedOperationException( + "Sparse NdArrays cannot be viewed with a different shape"); + } + + /** {@inheritDoc} */ + @Override + public NdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public NdArray get(long... coordinates) { + return slice(positionOf(coordinates, false), dimensions().from(coordinates.length)); + } + + /** {@inheritDoc} */ + @Override + public T getObject(long... coordinates) { + if (coordinates.length != shape().numDimensions()) { + throw new IllegalRankException( + String.format( + "Length of coordinates (%s)%s does not match the rank %d", + coordinates.length, Arrays.toString(coordinates), shape().numDimensions())); + } + long index = locateIndex(coordinates); + if (index >= 0) { + return getValues().getObject(index); + } else { + return defaultValue; + } + } + + /** {@inheritDoc} */ + @Override + public NdArray setObject(T value, long... coords) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public NdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** + * Creates a dense array of the type that this sparse array represents. + * + * @param shape the shape of the dense array. + * @return the dense of the type that this sparse array represents. + */ + public abstract U createValues(Shape shape); + + /** {@inheritDoc} */ + @Override + public NdArray copyTo(NdArray dst) { + if (dst instanceof AbstractSparseNdArray) { + AbstractSparseNdArray sparse = (AbstractSparseNdArray) dst; + LongNdArray indicesCopy = NdArrays.ofLongs(indices.shape()); + this.indices.copyTo(indicesCopy); + U valuesCopy = createValues(values.shape()); + this.values.copyTo(valuesCopy); + sparse.setIndices(indicesCopy); + sparse.setValues(valuesCopy); + } else { + U dense = toDense(); + dense.copyTo(dst); + } + return this; + } + + /** + * Computes the position within the dense array given by the coordinates + * + * @param coords the coordinates within the dense array + * @param isValue indicator whether the coordinates represents a value or higher level dimension. + * @return the position within the array + */ + protected long positionOf(long[] coords, boolean isValue) { + if (coords == null || coords.length == 0) { + return 0; + } + Validator.coordinates(dimensions, coords, isValue); + return dimensions.positionOf(coords); + } + + /** {@inheritDoc} */ + @Override + protected void slowCopyTo(NdArray array) { + if (array instanceof AbstractDenseNdArray) { + AbstractDenseNdArray dst = (AbstractDenseNdArray) array; + long offset = 0L; + for (NdArray s : scalars()) { + dst.setObject(s.getObject(), offset++); + } + } else if (array instanceof AbstractSparseNdArray) { + AbstractSparseNdArray dst = (AbstractSparseNdArray) array; + indices.copyTo(dst.getIndices()); + values.copyTo(dst.values); + } else { + super.slowCopyTo(array); + } + } + + /** + * Gets the Indices + * + * @return the Indices + */ + public LongNdArray getIndices() { + return indices; + } + + /** + * Sets the Indices + * + * @param indices the Indices + */ + public void setIndices(LongNdArray indices) { + this.indices = indices; + } + + /** + * Gets the values + * + * @return the values + */ + public U getValues() { + return values; + } + + /** + * Sets the values + * + * @param values the values + */ + public void setValues(U values) { + this.values = values; + } + + /** + * Gets the values index by coordinates + * + * @param coordinates the coordinates to locate + * @return index of the coordinates, if the coordinates are contained in the {@code indices} + * array; otherwise, {@code (-(insertion point) - 1)}. The insertion point is defined as the + * point at which the {@code coordinates} would be inserted into the {@code indices} array: + * the index of the first element greater than the key, or {@code indices.shape().get(0)}; if + * all elements in the array are less than the specified key. Note that this guarantees that + * the return value will be {@code >= 0}, only if the coordinates are found. + */ + protected long locateIndex(long[] coordinates) { + long size = indices.shape().get(0); + LongNdArray coordArray = NdArrays.vectorOf(coordinates); + return binarySearch(size, coordArray); + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + if (dimensions().isSegmented()) { + return slowHashCode(); + } + final int prime = 31; + int result = 1; + result = prime * result + indices.hashCode(); + result = prime * result + values.hashCode(); + result = prime * result + shape().hashCode(); + return result; + } + + /** {@inheritDoc} */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AbstractSparseNdArray)) { + return super.equals(obj); + } + AbstractSparseNdArray other = (AbstractSparseNdArray) obj; + if (!shape().equals(other.shape())) { + return false; + } + if (!indices.equals(other.indices)) { + return false; + } + return values.equals(other.values); + } + + /** + * A String showing the type, default value, number of elements and the dense shape of this sparse + * ndarray. + * + * @return A string containing the type, default value, number of elements and shape. + */ + @Override + public String toString() { + long numElements = values == null ? 0 : values.size(); + String strDefault; + if (defaultValue == null) { + strDefault = ""; + } else if (defaultValue instanceof Number) { + strDefault = defaultValue.toString(); + } else { + strDefault = "'" + defaultValue + "'"; + } + return this.getClass().getSimpleName() + + "(defaultValue=" + + strDefault + + ", numElements=" + + numElements + + ", shape=" + + this.shape() + + ")"; + } + + /** + * Performs a binary search on the indices array to locate the index of the specified coordinates. + * The indices array must be sorted by coordinates, row major. + * + * @param toIndex the index of the last element (exclusive) to be searched + * @param coordinates the coordinates to locate + * @return index of the coordinates, if the coordinates are contained in the {@code indices} + * array; otherwise, {@code (-(insertion point) - 1)}. The insertion point is defined as the + * point at which the {@code coordinates} would be inserted into the {@code indices} array: + * the index of the first element greater than the key, or {@code indices.shape().get(0)}; if + * all elements in the array are less than the specified key. Note that this guarantees that + * the return value will be @{code >= 0}, only if the coordinates are found. + */ + private long binarySearch(long toIndex, LongNdArray coordinates) { + + long low = 0; + long high = toIndex - 1; + + while (low <= high) { + long mid = (low + high) >>> 1; + LongNdArray comparable = indices.get(mid); + int rc = compareCoordinates(comparable, coordinates); + if (rc < 0) { // less than + low = mid + 1; + } else if (rc > 0) { // higher than + high = mid - 1; + } else { // match + return mid; + } + } + return -(low + 1); // no match + } + + /** + * Sorts the indices and values in ascending row-major coordinates. + * + * @return this instance + */ + @SuppressWarnings("UnusedReturnValue") + public AbstractSparseNdArray sortIndicesAndValues() { + + // indices will contain the indexes into the indices and values ndArrays, resorted. + List indexes = new ArrayList<>(); + // create a range for the length of values + LongStream.range(0, values.size()).forEach(indexes::add); + + // then sort this range based on ascending row-wise coordinates. + indexes.sort((a, b) -> compareCoordinates(indices.get(a), indices.get(b))); + + LongNdArray newIndices = NdArrays.ofLongs(indices.shape()); + U newValues = createValues(values.shape()); + // used the sorted indexes to set up the sorted Indices and Values + for (long i = 0; i < indexes.size(); i++) { + long moveIndex = indexes.get((int) i); + newIndices.set(indices.get(moveIndex), i); + newValues.setObject(values.getObject(moveIndex), i); + } + indices = newIndices; + values = newValues; + return this; + } + + /** + * Compares its two arguments for row major coordinate order. + * + * @return a negative integer, zero, or a positive integer as the first argument is less than, + * equal to, or greater than the second. + */ + private int compareCoordinates(LongNdArray a, LongNdArray b) { + int rc = (int) (a.size() - b.size()); + if (rc != 0) { + return rc; + } + + for (long i = 0; i < a.size(); i++) { + long l = a.getLong(i); + rc = (int) (l - b.getLong(i)); + if (rc != 0) { + return rc; + } + } + return 0; + } + + /** + * Scalar value to set for indices not specified in {@link #indices}, defaults to zero, false, or + * the empty String depending on the data type. + */ + public T getDefaultValue() { + return defaultValue; + } + + /** + * Sets the defaultValue + * + * @param defaultValue the default value + */ + public void setDefaultValue(T defaultValue) { + this.defaultValue = defaultValue; + defaultArray = null; + } + + /** + * Creates the NdArray with the default value as a scalar + * + * @return the default NdArray of the default value as a scalar + */ + public abstract U createDefaultArray(); + + /** + * Scalar NdArray to use for indices not specified in {@link #getIndices()} This will default to + * zero, false, or the empty string depending on the data type of the values, otherwise it will + * contain the {@link #defaultValue}. + */ + public U getDefaultArray() { + if (defaultArray == null) { + defaultArray = createDefaultArray(); + } + return defaultArray; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArray.java new file mode 100644 index 00000000000..d000eddaed9 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArray.java @@ -0,0 +1,428 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.BooleanNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.BooleanSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the boolean data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Boolean, long...)} methods + * + *

    {@code
    + * FloatSparseNdArray st = new BooleanSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf(true, true),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[true, false, false, false]
    + *  [false, false, true, false]
    + *  [false, false, false, false]]
    + *
    + * }
    + */ +public class BooleanSparseNdArray extends AbstractSparseNdArray + implements BooleanNdArray { + + /** + * Creates a BooleanSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Boolean type and shape {@code [N]}, which supplies the values + * for each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the + * parameter {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse + * NdArray has a value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of + * {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected BooleanSparseNdArray( + LongNdArray indices, + BooleanNdArray values, + boolean defaultValue, + DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a BooleanSparseNdArray with a default value of false. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Boolean type and shape {@code [N]}, which supplies the values + * for each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the + * parameter {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse + * NdArray has a value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of + * {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + BooleanSparseNdArray(LongNdArray indices, BooleanNdArray values, DimensionalSpace dimensions) { + this(indices, values, false, dimensions); + } + + /** + * Creates a BooleanSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + BooleanSparseNdArray(BooleanDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, false, dimensions); + } + + /** + * Creates a BooleanSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + BooleanSparseNdArray( + BooleanDataBuffer dataBuffer, boolean defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled BooleanSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + BooleanSparseNdArray(DimensionalSpace dimensions) { + this(false, dimensions); + } + + /** + * Creates a zero-filled BooleanSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + BooleanSparseNdArray(boolean defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new BooleanSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create( + LongNdArray indices, BooleanNdArray values, DimensionalSpace dimensions) { + return new BooleanSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new BooleanSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create( + LongNdArray indices, + BooleanNdArray values, + boolean defaultValue, + DimensionalSpace dimensions) { + return new BooleanSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new BooleanSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create( + BooleanDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new BooleanSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new BooleanSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create( + BooleanDataBuffer dataBuffer, boolean defaultValue, DimensionalSpace dimensions) { + return new BooleanSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty BooleanSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create(DimensionalSpace dimensions) { + return new BooleanSparseNdArray(dimensions); + } + + /** + * Creates a new empty BooleanSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create(boolean defaultValue, DimensionalSpace dimensions) { + return new BooleanSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty BooleanSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create(BooleanDataBuffer buffer, Shape shape) { + return new BooleanSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty BooleanSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create( + BooleanDataBuffer buffer, boolean defaultValue, Shape shape) { + return new BooleanSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new BooleanSparseNdArray from a BooleanNdArray + * + * @param src the BooleanNdArray + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create(BooleanNdArray src) { + BooleanDataBuffer buffer = DataBuffers.ofBooleans(src.size()); + src.copyTo(buffer); + return new BooleanSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new BooleanSparseNdArray from a BooleanNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param src the BooleanNdArray + * @return the new Sparse Array + */ + public static BooleanSparseNdArray create(BooleanNdArray src, boolean defaultValue) { + BooleanDataBuffer buffer = DataBuffers.ofBooleans(src.size()); + src.copyTo(buffer); + return new BooleanSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } + + /** + * Creates a BooleanNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a BooleanNdArray of the specified shape + */ + public BooleanNdArray createValues(Shape shape) { + return NdArrays.ofBooleans(shape); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new BooleanSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public boolean getBoolean(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray setBoolean(boolean value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyTo(DataBuffer dst) { + return copyTo((BooleanDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyTo(BooleanDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Boolean[] defaults = new Boolean[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + boolean value = getValues().getBoolean(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyFrom(BooleanDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + boolean[] valuesArray = new boolean[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyFrom(DataBuffer src) { + return copyFrom((BooleanDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public BooleanNdArray toDense() { + BooleanDataBuffer dataBuffer = DataBuffers.ofBooleans(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public BooleanNdArray fromDense(BooleanNdArray src) { + BooleanDataBuffer buffer = DataBuffers.ofBooleans(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray slice(Index... indices) { + return (BooleanNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray get(long... coordinates) { + return (BooleanNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray setObject(Boolean value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyTo(NdArray dst) { + return (BooleanNdArray) super.copyTo(dst); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArray.java new file mode 100644 index 00000000000..5614c233fe0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArray.java @@ -0,0 +1,417 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.ByteNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.ByteSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the byte data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Byte, long...)} methods + * + *

    {@code
    + * ByteSparseNdArray st = new ByteSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf((byte)1, (byte)255),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[(byte)1, (byte)0, (byte)0, (byte)0]
    + *  [(byte)0, (byte)0, (byte)1, (byte)0]
    + *  [(byte)0, (byte)0, (byte)0, (byte)0]]
    + *
    + * }
    + */ +public class ByteSparseNdArray extends AbstractSparseNdArray + implements ByteNdArray { + + /** + * Creates a ByteSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Byte type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected ByteSparseNdArray( + LongNdArray indices, ByteNdArray values, byte defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a ByteSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Byte type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ByteSparseNdArray(LongNdArray indices, ByteNdArray values, DimensionalSpace dimensions) { + this(indices, values, (byte) 0, dimensions); + } + + /** + * Creates a ByteSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ByteSparseNdArray(ByteDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, (byte) 0, dimensions); + } + + /** + * Creates a ByteSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ByteSparseNdArray(ByteDataBuffer dataBuffer, byte defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled ByteSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ByteSparseNdArray(DimensionalSpace dimensions) { + this((byte) 0, dimensions); + } + + /** + * Creates a zero-filled ByteSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ByteSparseNdArray(byte defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new ByteSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static ByteSparseNdArray create( + LongNdArray indices, ByteNdArray values, DimensionalSpace dimensions) { + return new ByteSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new ByteSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static ByteSparseNdArray create( + LongNdArray indices, ByteNdArray values, byte defaultValue, DimensionalSpace dimensions) { + return new ByteSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new ByteSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(ByteDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new ByteSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new ByteSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static ByteSparseNdArray create( + ByteDataBuffer dataBuffer, byte defaultValue, DimensionalSpace dimensions) { + return new ByteSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty ByteSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(DimensionalSpace dimensions) { + return new ByteSparseNdArray(dimensions); + } + + /** + * Creates a new empty ByteSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(byte defaultValue, DimensionalSpace dimensions) { + return new ByteSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty ByteSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(ByteDataBuffer buffer, Shape shape) { + return new ByteSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty ByteSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(ByteDataBuffer buffer, byte defaultValue, Shape shape) { + return new ByteSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new ByteSparseNdArray from a ByteNdArray + * + * @param src the ByteNdArray + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(ByteNdArray src) { + ByteDataBuffer buffer = DataBuffers.ofBytes(src.size()); + src.copyTo(buffer); + return new ByteSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new ByteSparseNdArray from a ByteNdArray + * + * @param src the ByteNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static ByteSparseNdArray create(ByteNdArray src, byte defaultValue) { + ByteDataBuffer buffer = DataBuffers.ofBytes(src.size()); + src.copyTo(buffer); + return new ByteSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a ByteNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a ByteNdArray of the specified shape + */ + public ByteNdArray createValues(Shape shape) { + return NdArrays.ofBytes(shape); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new ByteSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public byte getByte(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray setByte(byte value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyTo(DataBuffer dst) { + return copyTo((ByteDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyTo(ByteDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Byte[] defaults = new Byte[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + byte value = getValues().getByte(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyFrom(ByteDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + byte[] valuesArray = new byte[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyFrom(DataBuffer src) { + return copyFrom((ByteDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public ByteNdArray toDense() { + ByteDataBuffer dataBuffer = DataBuffers.ofBytes(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public ByteNdArray fromDense(ByteNdArray src) { + ByteDataBuffer buffer = DataBuffers.ofBytes(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray slice(Index... indices) { + return (ByteNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray get(long... coordinates) { + return (ByteNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray setObject(Byte value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyTo(NdArray dst) { + return (ByteNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArray.java new file mode 100644 index 00000000000..2a1611725f4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArray.java @@ -0,0 +1,420 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.DoubleSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * A sparse array for the double data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Double, long...)} methods + * + *

    {@code
    + * DoubleSparseNdArray st = new DoubleSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorsOf(new double[] {1, 2}),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 2, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + */ +public class DoubleSparseNdArray extends AbstractSparseNdArray + implements DoubleNdArray { + + /** + * Creates a DoubleSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D DoubleNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected DoubleSparseNdArray( + LongNdArray indices, DoubleNdArray values, double defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a DoubleSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D DoubleNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + DoubleSparseNdArray(LongNdArray indices, DoubleNdArray values, DimensionalSpace dimensions) { + this(indices, values, 0d, dimensions); + } + + /** + * Creates a DoubleSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + DoubleSparseNdArray(DoubleDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, 0d, dimensions); + } + + /** + * Creates a DoubleSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + DoubleSparseNdArray( + DoubleDataBuffer dataBuffer, double defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled DoubleSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + DoubleSparseNdArray(DimensionalSpace dimensions) { + this(0d, dimensions); + } + + /** + * Creates a zero-filled DoubleSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + DoubleSparseNdArray(double defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new DoubleSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create( + LongNdArray indices, DoubleNdArray values, DimensionalSpace dimensions) { + return new DoubleSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new DoubleSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create( + LongNdArray indices, DoubleNdArray values, double defaultValue, DimensionalSpace dimensions) { + return new DoubleSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new DoubleSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create( + DoubleDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new DoubleSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new DoubleSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create( + DoubleDataBuffer dataBuffer, double defaultValue, DimensionalSpace dimensions) { + return new DoubleSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty DoubleSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create(DimensionalSpace dimensions) { + return new DoubleSparseNdArray(dimensions); + } + + /** + * Creates a new empty DoubleSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create(double defaultValue, DimensionalSpace dimensions) { + return new DoubleSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty DoubleSparseNdArray from a double data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create(DoubleDataBuffer buffer, Shape shape) { + return new DoubleSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty DoubleSparseNdArray from a double data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create( + DoubleDataBuffer buffer, double defaultValue, Shape shape) { + return new DoubleSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new DoubleSparseNdArray from a DoubleNdArray + * + * @param src the DoubleNdArray + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create(DoubleNdArray src) { + DoubleDataBuffer buffer = DataBuffers.ofDoubles(src.size()); + src.copyTo(buffer); + return new DoubleSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new DoubleSparseNdArray from a DoubleNdArray + * + * @param src the DoubleNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static DoubleSparseNdArray create(DoubleNdArray src, double defaultValue) { + DoubleDataBuffer buffer = DataBuffers.ofDoubles(src.size()); + src.copyTo(buffer); + return new DoubleSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a DoubleNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a DoubleNdArray of the specified shape + */ + public DoubleNdArray createValues(Shape shape) { + return NdArrays.ofDoubles(shape); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new DoubleSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public double getDouble(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray setDouble(double value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyTo(DataBuffer dst) { + return copyTo((DoubleDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyTo(DoubleDataBuffer dst) { + // set buf to the default values, then overwrite with the indices/values. + Double[] defaults = new Double[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + double value = getValues().getDouble(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyFrom(DoubleDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + double[] valuesArray = new double[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyFrom(DataBuffer src) { + return copyFrom((DoubleDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public DoubleNdArray toDense() { + DoubleDataBuffer dataBuffer = DataBuffers.ofDoubles(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public DoubleNdArray fromDense(DoubleNdArray src) { + DoubleDataBuffer buffer = DataBuffers.ofDoubles(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray slice(Index... indices) { + return (DoubleNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray get(long... coordinates) { + return (DoubleNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray setObject(Double value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyTo(NdArray dst) { + return (DoubleNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArray.java new file mode 100644 index 00000000000..accb92f385d --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArray.java @@ -0,0 +1,417 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.FloatSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the float data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Float, long...)} methods + * + *

    {@code
    + * FloatSparseNdArray st = new FloatSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf(1f, 3.14f}),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 3.14, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + */ +public class FloatSparseNdArray extends AbstractSparseNdArray + implements FloatNdArray { + + /** + * Creates a FloatSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D FloatNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected FloatSparseNdArray( + LongNdArray indices, FloatNdArray values, float defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a FloatSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D FloatNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + FloatSparseNdArray(LongNdArray indices, FloatNdArray values, DimensionalSpace dimensions) { + this(indices, values, 0f, dimensions); + } + + /** + * Creates a FloatSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + FloatSparseNdArray(FloatDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, 0f, dimensions); + } + + /** + * Creates a FloatSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + FloatSparseNdArray(FloatDataBuffer dataBuffer, float defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled FloatSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + FloatSparseNdArray(DimensionalSpace dimensions) { + this(0f, dimensions); + } + + /** + * Creates a zero-filled FloatSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + FloatSparseNdArray(float defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new FloatSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static FloatSparseNdArray create( + LongNdArray indices, FloatNdArray values, DimensionalSpace dimensions) { + return new FloatSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new FloatSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static FloatSparseNdArray create( + LongNdArray indices, FloatNdArray values, float defaultValue, DimensionalSpace dimensions) { + return new FloatSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new FloatSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(FloatDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new FloatSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new FloatSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static FloatSparseNdArray create( + FloatDataBuffer dataBuffer, float defaultValue, DimensionalSpace dimensions) { + return new FloatSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty FloatSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(DimensionalSpace dimensions) { + return new FloatSparseNdArray(dimensions); + } + + /** + * Creates a new empty FloatSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(float defaultValue, DimensionalSpace dimensions) { + return new FloatSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty FloatSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(FloatDataBuffer buffer, Shape shape) { + return new FloatSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty FloatSparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(FloatDataBuffer buffer, float defaultValue, Shape shape) { + return new FloatSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new FloatSparseNdArray from a FloatNdArray + * + * @param src the FloatNdArray + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(FloatNdArray src) { + FloatDataBuffer buffer = DataBuffers.ofFloats(src.size()); + src.copyTo(buffer); + return new FloatSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new FloatSparseNdArray from a FloatNdArray + * + * @param src the FloatNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static FloatSparseNdArray create(FloatNdArray src, float defaultValue) { + FloatDataBuffer buffer = DataBuffers.ofFloats(src.size()); + src.copyTo(buffer); + return new FloatSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a FloatNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a FloatNdArray of the specified shape + */ + public FloatNdArray createValues(Shape shape) { + return NdArrays.ofFloats(shape); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new FloatSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public float getFloat(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray setFloat(float value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyTo(DataBuffer dst) { + return copyTo((FloatDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyTo(FloatDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Float[] defaults = new Float[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + float value = getValues().getFloat(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyFrom(FloatDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + float[] valuesArray = new float[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyFrom(DataBuffer src) { + return copyFrom((FloatDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public FloatNdArray toDense() { + FloatDataBuffer dataBuffer = DataBuffers.ofFloats(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public FloatNdArray fromDense(FloatNdArray src) { + FloatDataBuffer buffer = DataBuffers.ofFloats(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray slice(Index... indices) { + return (FloatNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray get(long... coordinates) { + return (FloatNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray setObject(Float value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyTo(NdArray dst) { + return (FloatNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArray.java new file mode 100644 index 00000000000..46be8f624cd --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArray.java @@ -0,0 +1,433 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.IntSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the int data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Integer, long...)} methods + * + *

    {@code
    + * IntSparseNdArray st = new IntSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf(1, 256),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 256, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + */ +public class IntSparseNdArray extends AbstractSparseNdArray + implements IntNdArray { + + /** + * Creates a IntSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D IntNdArray of shape {@code [N]}, which supplies the values for each element + * in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected IntSparseNdArray( + LongNdArray indices, IntNdArray values, int defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a IntSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D IntNdArray of shape {@code [N]}, which supplies the values for each element + * in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + IntSparseNdArray(LongNdArray indices, IntNdArray values, DimensionalSpace dimensions) { + this(indices, values, 0, dimensions); + } + + /** + * Creates a IntSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + IntSparseNdArray(IntDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, 0, dimensions); + } + + /** + * Creates a IntSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + IntSparseNdArray(IntDataBuffer dataBuffer, int defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled IntSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + IntSparseNdArray(DimensionalSpace dimensions) { + this(0, dimensions); + } + + /** + * Creates a zero-filled IntSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + IntSparseNdArray(int defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new IntSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static IntSparseNdArray create( + LongNdArray indices, IntNdArray values, DimensionalSpace dimensions) { + return new IntSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new IntSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static IntSparseNdArray create( + LongNdArray indices, IntNdArray values, int defaultValue, DimensionalSpace dimensions) { + return new IntSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new IntSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static IntSparseNdArray create(IntDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new IntSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new IntSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static IntSparseNdArray create( + IntDataBuffer dataBuffer, int defaultValue, DimensionalSpace dimensions) { + return new IntSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty IntSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static IntSparseNdArray create(DimensionalSpace dimensions) { + return new IntSparseNdArray(dimensions); + } + + /** + * Creates a new empty IntSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static IntSparseNdArray create(int defaultValue, DimensionalSpace dimensions) { + return new IntSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty IntSparseNdArray from a data buffer + * + * @param shape the shape of the debse array that this sparse array represents + * @return the new Sparse Array + */ + public static IntSparseNdArray create(Shape shape) { + return new IntSparseNdArray(DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty IntSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the debse array that this sparse array represents + * @return the new Sparse Array + */ + public static IntSparseNdArray create(int defaultValue, Shape shape) { + return new IntSparseNdArray(defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty IntSparseNdArray from a int data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static IntSparseNdArray create(IntDataBuffer buffer, Shape shape) { + return new IntSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty IntSparseNdArray from a int data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static IntSparseNdArray create(IntDataBuffer buffer, int defaultValue, Shape shape) { + return new IntSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new IntSparseNdArray from a IntNdArray + * + * @param src the IntNdArray + * @return the new Sparse Array + */ + public static IntSparseNdArray create(IntNdArray src) { + IntDataBuffer buffer = DataBuffers.ofInts(src.size()); + src.copyTo(buffer); + return new IntSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new IntSparseNdArray from a IntNdArray + * + * @param src the IntNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static IntSparseNdArray create(IntNdArray src, int defaultValue) { + IntDataBuffer buffer = DataBuffers.ofInts(src.size()); + src.copyTo(buffer); + return new IntSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a IntNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a IntNdArray of the specified shape + */ + public IntNdArray createValues(Shape shape) { + return NdArrays.ofInts(shape); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new IntSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public int getInt(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray setInt(int value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyTo(DataBuffer dst) { + return copyTo((IntDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyTo(IntDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Integer[] defaults = new Integer[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + int value = getValues().getInt(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyFrom(IntDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + int[] valuesArray = new int[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyFrom(DataBuffer src) { + return copyFrom((IntDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public IntNdArray toDense() { + IntDataBuffer dataBuffer = DataBuffers.ofInts(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public IntNdArray fromDense(IntNdArray src) { + IntDataBuffer buffer = DataBuffers.ofInts(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public IntNdArray slice(Index... indices) { + return (IntNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray get(long... coordinates) { + return (IntNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray setObject(Integer value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyTo(NdArray dst) { + return (IntNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArray.java new file mode 100644 index 00000000000..098482e4cc0 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArray.java @@ -0,0 +1,416 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.LongSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the long data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Long, long...)} methods + * + *

    {@code
    + * LongSparseNdArray st = new LongSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf(1L, 256L),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 256, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + */ +public class LongSparseNdArray extends AbstractSparseNdArray + implements LongNdArray { + + /** + * Creates a LongSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D LongNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected LongSparseNdArray( + LongNdArray indices, LongNdArray values, long defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a LongSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D LongNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + LongSparseNdArray(LongNdArray indices, LongNdArray values, DimensionalSpace dimensions) { + this(indices, values, 0L, dimensions); + } + + /** + * Creates a LongSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + LongSparseNdArray(LongDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, 0L, dimensions); + } + + /** + * Creates a LongSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + LongSparseNdArray(LongDataBuffer dataBuffer, long defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled LongSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + LongSparseNdArray(DimensionalSpace dimensions) { + this(0L, dimensions); + } + + /** + * Creates a zero-filled LongSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + LongSparseNdArray(long defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new LongSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static LongSparseNdArray create( + LongNdArray indices, LongNdArray values, DimensionalSpace dimensions) { + return new LongSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new LongSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static LongSparseNdArray create( + LongNdArray indices, LongNdArray values, long defaultValue, DimensionalSpace dimensions) { + return new LongSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new LongSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static LongSparseNdArray create(LongDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new LongSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new LongSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static LongSparseNdArray create( + LongDataBuffer dataBuffer, long defaultValue, DimensionalSpace dimensions) { + return new LongSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty LongSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static LongSparseNdArray create(DimensionalSpace dimensions) { + return new LongSparseNdArray(dimensions); + } + + /** + * Creates a new empty LongSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static LongSparseNdArray create(long defaultValue, DimensionalSpace dimensions) { + return new LongSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty LongSparseNdArray from a long data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static LongSparseNdArray create(LongDataBuffer buffer, Shape shape) { + return new LongSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty LongSparseNdArray from a long data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static LongSparseNdArray create(LongDataBuffer buffer, long defaultValue, Shape shape) { + return new LongSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new LongSparseNdArray from a LongNdArray + * + * @param src the LongNdArray + * @return the new Sparse Array + */ + public static LongSparseNdArray create(LongNdArray src) { + LongDataBuffer buffer = DataBuffers.ofLongs(src.size()); + src.copyTo(buffer); + return new LongSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new LongSparseNdArray from a LongNdArray + * + * @param src the LongNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static LongSparseNdArray create(LongNdArray src, long defaultValue) { + LongDataBuffer buffer = DataBuffers.ofLongs(src.size()); + src.copyTo(buffer); + return new LongSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a LongNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a LongNdArray of the specified shape + */ + public LongNdArray createValues(Shape shape) { + return NdArrays.ofLongs(shape); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new LongSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public long getLong(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray setLong(long value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyTo(DataBuffer dst) { + return copyTo((LongDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyTo(LongDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Long[] defaults = new Long[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicLong i = new AtomicLong(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + long value = getValues().getLong(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyFrom(LongDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + long[] valuesArray = new long[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyFrom(DataBuffer src) { + return copyFrom((LongDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public LongNdArray toDense() { + LongDataBuffer dataBuffer = DataBuffers.ofLongs(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public LongNdArray fromDense(LongNdArray src) { + LongDataBuffer buffer = DataBuffers.ofLongs(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public LongNdArray slice(Index... indices) { + return (LongNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray get(long... coordinates) { + return (LongNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray setObject(Long value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyTo(NdArray dst) { + return (LongNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArray.java new file mode 100644 index 00000000000..f9c9c1bf1c9 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArray.java @@ -0,0 +1,417 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.nio.ReadOnlyBufferException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.ShortSparseSlice; +import org.tensorflow.ndarray.index.Index; + +/** + * sparse array for the short data type + * + *

    A sparse array as two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Short, long...)} methods + * + *

    {@code
    + * ShortSparseNdArray st = new ShortSparseNdArray(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf((short)1, (short)256}),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[1, 0, 0, 0]
    + *  [0, 0, 256, 0]
    + *  [0, 0, 0, 0]]
    + *
    + * }
    + */ +public class ShortSparseNdArray extends AbstractSparseNdArray + implements ShortNdArray { + + /** + * Creates a ShortSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D ShortNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected ShortSparseNdArray( + LongNdArray indices, ShortNdArray values, short defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + } + + /** + * Creates a ShortSparseNdArray with a default value of zero. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D ShortNdArray of shape {@code [N]}, which supplies the values for each + * element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter {@code + * values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a value of + * {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ShortSparseNdArray(LongNdArray indices, ShortNdArray values, DimensionalSpace dimensions) { + this(indices, values, (short) 0, dimensions); + } + + /** + * Creates a ShortSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ShortSparseNdArray(ShortDataBuffer dataBuffer, DimensionalSpace dimensions) { + this(dataBuffer, (short) 0, dimensions); + } + + /** + * Creates a ShortSparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ShortSparseNdArray(ShortDataBuffer dataBuffer, short defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled ShortSparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ShortSparseNdArray(DimensionalSpace dimensions) { + this((short) 0, dimensions); + } + + /** + * Creates a zero-filled ShortSparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + ShortSparseNdArray(short defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + } + + /** + * Creates a new ShortSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static ShortSparseNdArray create( + LongNdArray indices, ShortNdArray values, DimensionalSpace dimensions) { + return new ShortSparseNdArray(indices, values, dimensions); + } + + /** + * Creates a new ShortSparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static ShortSparseNdArray create( + LongNdArray indices, ShortNdArray values, short defaultValue, DimensionalSpace dimensions) { + return new ShortSparseNdArray(indices, values, defaultValue, dimensions); + } + + /** + * Creates a new ShortSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(ShortDataBuffer dataBuffer, DimensionalSpace dimensions) { + return new ShortSparseNdArray(dataBuffer, dimensions); + } + + /** + * Creates a new ShortSparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static ShortSparseNdArray create( + ShortDataBuffer dataBuffer, short defaultValue, DimensionalSpace dimensions) { + return new ShortSparseNdArray(dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty ShortSparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(DimensionalSpace dimensions) { + return new ShortSparseNdArray(dimensions); + } + + /** + * Creates a new empty ShortSparseNdArray from a data buffer + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(short defaultValue, DimensionalSpace dimensions) { + return new ShortSparseNdArray(defaultValue, dimensions); + } + + /** + * Creates a new empty ShortSparseNdArray from a short data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(ShortDataBuffer buffer, Shape shape) { + return new ShortSparseNdArray(buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty ShortSparseNdArray from a short data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(ShortDataBuffer buffer, short defaultValue, Shape shape) { + return new ShortSparseNdArray(buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new ShortSparseNdArray from a ShortNdArray + * + * @param src the ShortNdArray + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(ShortNdArray src) { + ShortDataBuffer buffer = DataBuffers.ofShorts(src.size()); + src.copyTo(buffer); + return new ShortSparseNdArray(buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new ShortSparseNdArray from a ShortNdArray + * + * @param src the ShortNdArray + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static ShortSparseNdArray create(ShortNdArray src, short defaultValue) { + ShortDataBuffer buffer = DataBuffers.ofShorts(src.size()); + src.copyTo(buffer); + return new ShortSparseNdArray(buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a ShortNdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a ShortNdArray of the specified shape + */ + public ShortNdArray createValues(Shape shape) { + return NdArrays.ofShorts(shape); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new ShortSparseSlice(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public short getShort(long... coordinates) { + return getObject(coordinates); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray setShort(short value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyTo(DataBuffer dst) { + return copyTo((ShortDataBuffer) dst); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyTo(ShortDataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Short[] defaults = new Short[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + short value = getValues().getShort(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyFrom(ShortDataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (short i = 0; i < src.size(); i++) { + if (!src.getObject(i).equals(getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + short[] valuesArray = new short[values.size()]; + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + setValues(NdArrays.vectorOf(valuesArray)); + return this; + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyFrom(DataBuffer src) { + return copyFrom((ShortDataBuffer) src); + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + public ShortNdArray toDense() { + ShortDataBuffer dataBuffer = DataBuffers.ofShorts(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public ShortNdArray fromDense(ShortNdArray src) { + ShortDataBuffer buffer = DataBuffers.ofShorts(src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray slice(Index... indices) { + return (ShortNdArray) super.slice(indices); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray get(long... coordinates) { + return (ShortNdArray) super.get(coordinates); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray setObject(Short value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyTo(NdArray dst) { + return (ShortNdArray) super.copyTo(dst); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray createDefaultArray() { + return NdArrays.scalarOf(getDefaultValue()); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/SparseNdArray.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/SparseNdArray.java new file mode 100644 index 00000000000..10a854ff47d --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/SparseNdArray.java @@ -0,0 +1,428 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.slice.ObjectSparseSlice; + +/** + * sparse array for the any data type + * + *

    A sparse array has two separate dense arrays: indices, values, and a shape that represents the + * dense shape. + * + *

    NOTE: all Sparse Arrays are readonly for the {@link #set(NdArray, long...)} and + * {@link #setObject(Object, long...)} methods + * + *

    {@code
    + * SparseNdArray st = new SparseNdArray<>(
    + *      StdArrays.of(new long[][] {{0, 0}, {1, 2}}),
    + *      NdArrays.vectorOf("first", "second"),
    + *      Shape.of(3, 4));
    + *
    + * }
    + * + *

    represents the dense array: + * + *

    {@code
    + * [[true, false, false, false]
    + *  [false, false, true, false]
    + *  [false, false, false, false]]
    + *
    + * }
    + */ +public class SparseNdArray> extends AbstractSparseNdArray + implements org.tensorflow.ndarray.SparseNdArray { + + private final Class type; + + /** + * Creates a SparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Boolean type and shape {@code [N]}, which supplies the values + * for each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the + * parameter {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse + * NdArray has a value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of + * {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + protected SparseNdArray( + Class type, LongNdArray indices, U values, T defaultValue, DimensionalSpace dimensions) { + super(indices, values, defaultValue, dimensions); + this.type = type; + } + + /** + * Creates a SparseNdArray with a default value of null. + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of Boolean type and shape {@code [N]}, which supplies the values + * for each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the + * parameter {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse + * NdArray has a value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of + * {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + SparseNdArray(Class type, LongNdArray indices, U values, DimensionalSpace dimensions) { + this(type, indices, values, null, dimensions); + } + + /** + * Creates a SparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + SparseNdArray(Class type, DataBuffer dataBuffer, DimensionalSpace dimensions) { + this(type, dataBuffer, null, dimensions); + } + + /** + * Creates a SparseNdArray + * + * @param dataBuffer a dense dataBuffer used to create the spars array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + SparseNdArray( + Class type, DataBuffer dataBuffer, T defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + this.type = type; + // use write to set up the indices and values + copyFrom(dataBuffer); + } + + /** + * Creates a zero-filled SparseNdArray + * + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + SparseNdArray(Class type, DimensionalSpace dimensions) { + this(type, (T) null, dimensions); + } + + /** + * Creates a zero-filled SparseNdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array, + */ + SparseNdArray(Class type, T defaultValue, DimensionalSpace dimensions) { + super(defaultValue, dimensions); + this.type = type; + } + + /** + * Creates a new SparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, LongNdArray indices, U values, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, indices, values, dimensions); + } + + /** + * Creates a new SparseNdArray + * + * @param indices A 2-D LongNdArray of shape {@code [N, ndims]}, that specifies the indices of the + * elements in the sparse array that contain non-default values (elements are zero-indexed). + * For example, {@code indices=[[1,3], [2,4]]} specifies that the elements with indexes of + * {@code [1,3]} and {@code [2,4]} have non-default values. + * @param values A 1-D NdArray of any type and shape {@code [N]}, which supplies the values for + * each element in indices. For example, given {@code indices=[[1,3], [2,4]]}, the parameter + * {@code values=[18, 3.6]} specifies that element {@code [1,3]} of the sparse NdArray has a + * value of {@code 18}, and element {@code [2,4]} of the NdArray has a value of {@code 3.6}. + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the dense object represented by this sparse array. + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, LongNdArray indices, U values, T defaultValue, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, indices, values, defaultValue, dimensions); + } + + /** + * Creates a new SparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, DataBuffer dataBuffer, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, dataBuffer, dimensions); + } + + /** + * Creates a new SparseNdArray from a data buffer + * + * @param dataBuffer the databuffer containing the dense array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param dimensions the dimensional space for the sparse array + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, DataBuffer dataBuffer, T defaultValue, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, dataBuffer, defaultValue, dimensions); + } + + /** + * Creates a new empty SparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, dimensions); + } + + /** + * Creates a new empty SparseNdArray from a data buffer + * + * @param dimensions the dimensions array + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, T defaultValue, DimensionalSpace dimensions) { + return new SparseNdArray<>(type, defaultValue, dimensions); + } + + /** + * Creates a new empty SparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, DataBuffer buffer, Shape shape) { + return new SparseNdArray<>(type, buffer, DimensionalSpace.create(shape)); + } + + /** + * Creates a new empty SparseNdArray from a float data buffer + * + * @param buffer the data buffer + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param shape the shape of the sparse array. + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, DataBuffer buffer, T defaultValue, Shape shape) { + return new SparseNdArray<>(type, buffer, defaultValue, DimensionalSpace.create(shape)); + } + + /** + * Creates a new SparseNdArray from a NdArray + * + * @param src the NdArray + * @return the new Sparse Array + */ + public static > SparseNdArray create(Class type, U src) { + DataBuffer buffer = DataBuffers.ofObjects(type, src.size()); + src.copyTo(buffer); + return new SparseNdArray<>(type, buffer, DimensionalSpace.create(src.shape())); + } + + /** + * Creates a new SparseNdArray from a NdArray + * + * @param defaultValue Scalar value to set for indices not specified in {@link #getIndices()} + * @param src the NdArray + * @return the new Sparse Array + */ + public static > SparseNdArray create( + Class type, U src, T defaultValue) { + DataBuffer buffer = DataBuffers.ofObjects(type, src.size()); + src.copyTo(buffer); + return new SparseNdArray<>(type, buffer, defaultValue, DimensionalSpace.create(src.shape())); + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings("unchecked") + public U createDefaultArray() { + return getDefaultValue() == null + ? (U) NdArrays.ofObjects(type, Shape.scalar()) + : (U) NdArrays.scalarOfObject(getDefaultValue()); + } + + /** + * Creates a NdArray of the specified shape + * + * @param shape the shape of the dense array. + * @return a NdArray of the specified shape + */ + @SuppressWarnings("unchecked") + public U createValues(Shape shape) { + return (U) NdArrays.ofObjects(type, shape); + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings("unchecked") + public U slice(long position, DimensionalSpace sliceDimensions) { + return (U) new ObjectSparseSlice<>(this, position, sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public NdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + @SuppressWarnings("unchecked") + T[] defaults = (T[]) Array.newInstance(type, (int) dst.size()); + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + T value = getValues().getObject(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings({ + "unchecked", + }) + public NdArray copyFrom(DataBuffer src) { + List indices = new ArrayList<>(); + List values = new ArrayList<>(); + + for (long i = 0; i < src.size(); i++) { + if (!Objects.equals(src.getObject(i), getDefaultValue())) { + indices.add(toCoordinates(dimensions, i)); + values.add(src.getObject(i)); + } + } + long[][] indicesArray = new long[indices.size()][]; + // unchecked cast, suppressed. + T[] valuesArray = (T[]) Array.newInstance(type, values.size()); + for (int i = 0; i < indices.size(); i++) { + indicesArray[i] = indices.get(i); + valuesArray[i] = values.get(i); + } + + setIndices(StdArrays.ndCopyOf(indicesArray)); + + // unchecked cast, suppressed. + setValues((U) NdArrays.vectorOfObjects(valuesArray)); + return this; + } + + /** + * Converts the sparse array to a dense array + * + * @return the dense array + */ + @SuppressWarnings("unchecked") + public U toDense() { + DataBuffer dataBuffer = DataBuffers.ofObjects(type, shape().size()); + copyTo(dataBuffer); + // unchecked cast, suppressed. + return (U) NdArrays.wrap(shape(), dataBuffer); + } + + /** + * Populates this sparse array from a dense array + * + * @param src the dense array + * @return this sparse array + */ + public NdArray fromDense(NdArray src) { + DataBuffer buffer = DataBuffers.ofObjects(type, src.size()); + src.copyTo(buffer); + copyFrom(buffer); + return this; + } + + /** + * Gets the class type for this sparse array + * + * @return the class type for this sparse array. + */ + public Class getType() { + return type; + } + + /** + * A String showing the type, default value, number of elements and the dense shape of this sparse + * ndarray. + * + * @return A string containing the type, default value, number of elements and shape. + */ + @Override + public String toString() { + long numElements = getValues() == null ? 0 : getValues().size(); + String strDefault; + T defaultVal = getDefaultValue(); + if (defaultVal == null) { + strDefault = ""; + } else if (defaultVal instanceof Number) { + strDefault = defaultVal.toString(); + } else { + strDefault = "'" + defaultVal + "'"; + } + return this.getClass().getSimpleName() + + "(type=" + + type.getSimpleName() + + ", defaultValue=" + + strDefault + + ", numElements=" + + numElements + + ", shape=" + + this.shape() + + ")"; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/Validator.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/Validator.java new file mode 100644 index 00000000000..2fa77366c9d --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/Validator.java @@ -0,0 +1,46 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import org.tensorflow.ndarray.IllegalRankException; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; + +final class Validator extends org.tensorflow.ndarray.impl.Validator { + + private Validator() {} + + static void coordinates(DimensionalSpace dimensions, long[] coords, boolean isValue) { + if (coords.length > dimensions.numDimensions()) { + throw new IndexOutOfBoundsException(); + } + if (isValue && coords.length != dimensions.numDimensions()) { + throw new IllegalRankException("Not a scalar value"); + } + } + + static void denseShape(DataBuffer buffer, Shape shape) { + if (shape == null) { + throw new IllegalArgumentException("Shape cannot be null"); + } + if (shape.hasUnknownDimension()) { + throw new IllegalArgumentException("Sparse arrays cannot have unknown dimension(s)"); + } + if (buffer.size() < shape.size()) { + throw new IllegalArgumentException("Buffer size is smaller than the shape size"); + } + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/BooleanSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/BooleanSparseSlice.java new file mode 100644 index 00000000000..0f31c7181a4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/BooleanSparseSlice.java @@ -0,0 +1,138 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.BooleanNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class BooleanSparseSlice extends SparseSlice + implements BooleanNdArray { + + /** + * Creates a BooleanSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public BooleanSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray toDense() { + BooleanDataBuffer dataBuffer = DataBuffers.ofBooleans(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public boolean getBoolean(long... coordinates) { + return getObject(coordinates); + } + + @Override + public BooleanNdArray setBoolean(boolean value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public BooleanNdArray setObject(Boolean value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public BooleanNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray copyTo(DataBuffer dst) { + // zero out buf. + Boolean[] defaults = new Boolean[(int) shape().size()]; + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + boolean value = getValues().getBoolean(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public BooleanNdArray copyTo(BooleanDataBuffer dst) { + return copyTo((DataBuffer) dst); + } + + @Override + public BooleanNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public BooleanNdArray copyFrom(BooleanDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public BooleanNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public BooleanNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new BooleanSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public BooleanNdArray get(long... coordinates) { + return (BooleanNdArray) super.get(coordinates); + } + + @Override + public BooleanNdArray copyTo(NdArray dst) { + return (BooleanNdArray) super.copyTo(dst); + } + + @Override + public BooleanNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ByteSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ByteSparseSlice.java new file mode 100644 index 00000000000..1da93a133de --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ByteSparseSlice.java @@ -0,0 +1,137 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.ByteNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class ByteSparseSlice extends SparseSlice implements ByteNdArray { + + /** + * Creates a ByteSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public ByteSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray toDense() { + ByteDataBuffer dataBuffer = DataBuffers.ofBytes(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public byte getByte(long... coordinates) { + return getObject(coordinates); + } + + @Override + public ByteNdArray setByte(byte value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public ByteNdArray setObject(Byte value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public ByteNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray copyTo(DataBuffer dst) { + // zero out buf. + Byte[] defaults = new Byte[(int) shape().size()]; + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + byte value = getValues().getByte(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public ByteNdArray copyTo(ByteDataBuffer dst) { + return this.copyTo((DataBuffer) dst); + } + + @Override + public ByteNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public ByteNdArray copyFrom(ByteDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public ByteNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public ByteNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new ByteSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public ByteNdArray get(long... coordinates) { + return (ByteNdArray) super.get(coordinates); + } + + @Override + public ByteNdArray copyTo(NdArray dst) { + return (ByteNdArray) super.copyTo(dst); + } + + @Override + public ByteNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/DoubleSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/DoubleSparseSlice.java new file mode 100644 index 00000000000..0e99aa4750f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/DoubleSparseSlice.java @@ -0,0 +1,139 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class DoubleSparseSlice extends SparseSlice implements DoubleNdArray { + + /** + * Creates a DoubleSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public DoubleSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray toDense() { + DoubleDataBuffer dataBuffer = DataBuffers.ofDoubles(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public double getDouble(long... coordinates) { + return getObject(coordinates); + } + + @Override + public DoubleNdArray setDouble(double value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public DoubleNdArray setObject(Double value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public DoubleNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Double[] defaults = new Double[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + double value = getValues().getDouble(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public DoubleNdArray copyTo(DoubleDataBuffer dst) { + return this.copyTo((DataBuffer) dst); + } + + @Override + public DoubleNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public DoubleNdArray copyFrom(DoubleDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public DoubleNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public DoubleNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new DoubleSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public DoubleNdArray get(long... coordinates) { + return (DoubleNdArray) super.get(coordinates); + } + + @Override + public DoubleNdArray copyTo(NdArray dst) { + return (DoubleNdArray) super.copyTo(dst); + } + + @Override + public DoubleNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/FloatSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/FloatSparseSlice.java new file mode 100644 index 00000000000..75abfe46f54 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/FloatSparseSlice.java @@ -0,0 +1,139 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class FloatSparseSlice extends SparseSlice implements FloatNdArray { + + /** + * Creates a FloatSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public FloatSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray toDense() { + FloatDataBuffer dataBuffer = DataBuffers.ofFloats(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public float getFloat(long... coordinates) { + return getObject(coordinates); + } + + @Override + public FloatNdArray setFloat(float value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public FloatNdArray setObject(Float value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public FloatNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Float[] defaults = new Float[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + float value = getValues().getFloat(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public FloatNdArray copyTo(FloatDataBuffer dst) { + return this.copyTo((DataBuffer) dst); + } + + @Override + public FloatNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public FloatNdArray copyFrom(FloatDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public FloatNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public FloatNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new FloatSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public FloatNdArray get(long... coordinates) { + return (FloatNdArray) super.get(coordinates); + } + + @Override + public FloatNdArray copyTo(NdArray dst) { + return (FloatNdArray) super.copyTo(dst); + } + + @Override + public FloatNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/IntSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/IntSparseSlice.java new file mode 100644 index 00000000000..831d6727d4f --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/IntSparseSlice.java @@ -0,0 +1,139 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class IntSparseSlice extends SparseSlice implements IntNdArray { + + /** + * Creates a IntSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public IntSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray toDense() { + IntDataBuffer dataBuffer = DataBuffers.ofInts(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public int getInt(long... coordinates) { + return getObject(coordinates); + } + + @Override + public IntNdArray setInt(int value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public IntNdArray setObject(Integer value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public IntNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Integer[] defaults = new Integer[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + int value = getValues().getInt(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public IntNdArray copyTo(IntDataBuffer dst) { + return this.copyTo((DataBuffer) dst); + } + + @Override + public IntNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public IntNdArray copyFrom(IntDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public IntNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public IntNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new IntSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public IntNdArray get(long... coordinates) { + return (IntNdArray) super.get(coordinates); + } + + @Override + public IntNdArray copyTo(NdArray dst) { + return (IntNdArray) super.copyTo(dst); + } + + @Override + public IntNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/LongSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/LongSparseSlice.java new file mode 100644 index 00000000000..e882eb08a34 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/LongSparseSlice.java @@ -0,0 +1,139 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicLong; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class LongSparseSlice extends SparseSlice implements LongNdArray { + + /** + * Creates a LongSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public LongSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray toDense() { + LongDataBuffer dataBuffer = DataBuffers.ofLongs(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public long getLong(long... coordinates) { + return getObject(coordinates); + } + + @Override + public LongNdArray setLong(long value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public LongNdArray setObject(Long value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public LongNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Long[] defaults = new Long[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicLong i = new AtomicLong(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + long value = getValues().getLong(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public LongNdArray copyTo(LongDataBuffer dst) { + return copyTo((DataBuffer) dst); + } + + @Override + public LongNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public LongNdArray copyFrom(LongDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public LongNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public LongNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new LongSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public LongNdArray get(long... coordinates) { + return (LongNdArray) super.get(coordinates); + } + + @Override + public LongNdArray copyTo(NdArray dst) { + return (LongNdArray) super.copyTo(dst); + } + + @Override + public LongNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ObjectSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ObjectSparseSlice.java new file mode 100644 index 00000000000..9d547670803 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ObjectSparseSlice.java @@ -0,0 +1,114 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.lang.reflect.Array; +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.SparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class ObjectSparseSlice> extends SparseSlice + implements NdArray { + + /** + * Creates a BooleanSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public ObjectSparseSlice( + SparseNdArray source, long sourcePosition, DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings("unchecked") + public U toDense() { + DataBuffer dataBuffer = DataBuffers.ofObjects(getType(), shape().size()); + copyTo(dataBuffer); + // unchecked NdArray to U + return (U) NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public U setObject(T value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public U set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings("unchecked") + public U copyTo(DataBuffer dst) { + // unchecked Object to T[] + T[] defaults = (T[]) Array.newInstance(getType(), (int) dst.size()); + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicInteger i = new AtomicInteger(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + T value = getValues().getObject(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + // Unchecked cast ObjectSparseSlice to U + return (U) this; + } + + @Override + public U slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + @SuppressWarnings("unchecked") + public U slice(long position, DimensionalSpace sliceDimensions) { + // unchecked ObjectSparseSlice to U + return (U) + new ObjectSparseSlice<>( + (SparseNdArray) this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public U createDefaultArray() { + return source.getDefaultArray(); + } + + public Class getType() { + return ((SparseNdArray) source).getType(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ShortSparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ShortSparseSlice.java new file mode 100644 index 00000000000..43424d25fce --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/ShortSparseSlice.java @@ -0,0 +1,139 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicLong; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +public class ShortSparseSlice extends SparseSlice implements ShortNdArray { + + /** + * Creates a LongSparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative source position into the source + * @param dimensions the dimensional space for the window + */ + public ShortSparseSlice( + AbstractSparseNdArray source, + long sourcePosition, + DimensionalSpace dimensions) { + super(source, sourcePosition, dimensions); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray toDense() { + ShortDataBuffer dataBuffer = DataBuffers.ofShorts(shape().size()); + copyTo(dataBuffer); + return NdArrays.wrap(shape(), dataBuffer); + } + + @Override + public short getShort(long... coordinates) { + return getObject(coordinates); + } + + @Override + public ShortNdArray setShort(short value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public ShortNdArray setObject(Short value, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + @Override + public ShortNdArray set(NdArray src, long... coordinates) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray copyTo(DataBuffer dst) { + // set the values in buf to the default, then overwrite with indices/values + Short[] defaults = new Short[(int) shape().size()]; + Arrays.fill(defaults, getDefaultValue()); + dst.write(defaults); + + AtomicLong i = new AtomicLong(); + getIndices() + .elements(0) + .forEachIndexed( + (idx, l) -> { + long[] coordinates = getIndicesCoordinates(l); + short value = getValues().getShort(i.getAndIncrement()); + dst.setObject(value, dimensions.positionOf(coordinates)); + }); + return this; + } + + @Override + public ShortNdArray copyTo(ShortDataBuffer dst) { + return this.copyTo((DataBuffer) dst); + } + + @Override + public ShortNdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public ShortNdArray copyFrom(ShortDataBuffer src) { + throw new ReadOnlyBufferException(); + } + + @Override + public ShortNdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public ShortNdArray slice(long position, DimensionalSpace sliceDimensions) { + return new ShortSparseSlice(this.source, position + sourcePosition, sliceDimensions); + } + + @Override + public ShortNdArray get(long... coordinates) { + return (ShortNdArray) super.get(coordinates); + } + + @Override + public ShortNdArray copyTo(NdArray dst) { + return (ShortNdArray) super.copyTo(dst); + } + + @Override + public ShortNdArray createDefaultArray() { + return source.getDefaultArray(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/SparseSlice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/SparseSlice.java new file mode 100644 index 00000000000..3f09456ec8b --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/impl/sparse/slice/SparseSlice.java @@ -0,0 +1,144 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse.slice; + +import java.nio.ReadOnlyBufferException; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.ndarray.impl.sequence.SingleElementSequence; +import org.tensorflow.ndarray.impl.sequence.SlicingElementSequence; +import org.tensorflow.ndarray.impl.sparse.AbstractSparseNdArray; +import org.tensorflow.ndarray.index.Index; + +/** + * A sparse window is a view into an AbstractSparseNdArray. It is used internally by the slice + * methods. + * + * @param the type that the array contains + * @param the type of dense NdArray + */ +public abstract class SparseSlice> extends AbstractSparseNdArray { + protected final AbstractSparseNdArray source; + protected final long sourcePosition; + + /** + * Creates a SparseSlice + * + * @param source the source Sparse Array that this object slices. + * @param sourcePosition the relative position into the source array + * @param dimensions the dimensional space for the window + */ + public SparseSlice( + AbstractSparseNdArray source, long sourcePosition, DimensionalSpace dimensions) { + super(source.getDefaultValue(), dimensions); + this.source = source; + this.sourcePosition = sourcePosition; + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + source.hashCode(); + result = prime * result + (int) sourcePosition; + return result; + } + + /** {@inheritDoc} */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SparseSlice)) { + return super.equals(obj); + } + SparseSlice other = (SparseSlice) obj; + if (!source.equals(other.source)) { + return false; + } + if (!shape().equals(other.shape())) { + return false; + } + return sourcePosition == other.sourcePosition; + } + + /** {@inheritDoc} */ + @Override + public T getObject(long... coordinates) { + long position = dimensions().positionOf(coordinates); + long[] sourceCoordinates = toCoordinates(source.dimensions(), sourcePosition + position); + return source.getObject(sourceCoordinates); + } + + /** {@inheritDoc} */ + @Override + public NdArray get(long... coordinates) { + long position = dimensions().positionOf(coordinates); + long[] sourceCoordinates = toCoordinates(source.dimensions(), sourcePosition + position); + return source.get(sourceCoordinates); + } + + /** {@inheritDoc} */ + @Override + public NdArray slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + /** {@inheritDoc} */ + @Override + public NdArraySequence elements(int dimensionIdx) { + if (dimensionIdx >= shape().numDimensions()) { + throw new IllegalArgumentException( + "Cannot iterate elements in dimension '" + + dimensionIdx + + "' of array with shape " + + shape()); + } + if (rank() == 0 && dimensionIdx < 0) { + return new SingleElementSequence<>(this); + } + DimensionalSpace elemDims = dimensions().from(dimensionIdx + 1); + return new SlicingElementSequence<>(this, dimensionIdx, elemDims); + } + + /** + * Converts the sparse window to a dense NdArray + * + * @return the NdArray + */ + public abstract U toDense(); + + /** {@inheritDoc} */ + @Override + public NdArray copyFrom(DataBuffer src) { + throw new ReadOnlyBufferException(); + } + + /** {@inheritDoc} */ + @Override + public U createValues(Shape shape) { + return source.createValues(shape); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/All.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/All.java new file mode 100644 index 00000000000..e21b9030315 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/All.java @@ -0,0 +1,56 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.index; + +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class All implements Index { + + static final All INSTANCE = new All(); + + @Override + public long numElements(Dimension dim) { + return dim.numElements(); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate; + } + + @Override + public Dimension apply(Dimension dim) { + return dim; + } + + private All() {} + + @Override + public boolean beginMask() { + return true; + } + + @Override + public boolean endMask() { + return true; + } + + @Override + public String toString() { + return All.class.getSimpleName() + "()"; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/At.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/At.java new file mode 100644 index 00000000000..cbe142a84b1 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/At.java @@ -0,0 +1,74 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class At implements Index { + + @Override + public long numElements(Dimension dim) { + return 1; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + long coord = this.coord >= 0 ? this.coord : dim.numElements() + this.coord; + return dim.positionOf(coord); + } + + @Override + public Dimension apply(Dimension dim) { + if (!keepDim) { + throw new UnsupportedOperationException("Should be handled in DimensionalSpace."); + } + + return dim.withIndex(this); + } + + @Override + public boolean isPoint() { + return !keepDim; + } + + At(long coord, boolean keepDim) { + this.coord = coord; + this.keepDim = keepDim; + } + + private final long coord; + private final boolean keepDim; + + @Override + public long begin() { + return coord; + } + + @Override + public long end() { + return coord + 1; + } + + @Override + public String toString() { + return new StringJoiner(", ", At.class.getSimpleName() + "(", ")") + .add("coord=" + coord) + .add("keepDim=" + keepDim) + .toString(); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java new file mode 100644 index 00000000000..244ea333bd4 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Ellipsis.java @@ -0,0 +1,46 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class Ellipsis implements Index { + + static final Ellipsis INSTANCE = new Ellipsis(); + + private Ellipsis() {} + + @Override + public long numElements(Dimension dim) { + throw new UnsupportedOperationException("Should be handled in DimensionalSpace."); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + throw new UnsupportedOperationException("Should be handled in DimensionalSpace."); + } + + @Override + public boolean isEllipsis() { + return true; + } + + @Override + public String toString() { + return Ellipsis.class.getSimpleName() + "()"; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java new file mode 100644 index 00000000000..8d01b3d21d6 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Matteo Di Giovinazzo. + * + * 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. + */ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +/** + * A hyperslab is a rectangular pattern defined by four arrays. + * + *

    The {@code start} defines the origin of the hyperslab in the original coordinates. The {@code + * stride} is the number of elements to increment between selected elements. A stride of '1' is + * every element, a stride of '2' is every second element, etc. The default stride is 1. The {@code + * count} is the number of elements in the hyperslab selection. When the stride is 1, the selection + * is a hyper rectangle with a corner at {@code start} and size {@code count[0]} by {@code count[1]} + * by ... When stride is greater than one, the hyperslab bounded by start and the corners defined by + * {@code stride[n] * count[n]}. The {@code block} is a count on the number of repetitions of the + * hyperslab. The default block size is '1', which is one hyperslab. A block of 2 would be two + * hyperslabs in that dimension, with the second starting at {@code start[n]+ (count[n] * stride[n]) + * + 1}. + * + * @see https://portal.hdfgroup.org/display/HDF5/Reading+From+or+Writing+To+a+Subset+of+a+Dataset + * @see https://portal.hdfgroup.org/display/HDF5/H5S_SELECT_HYPERSLAB + * @see https://support.hdfgroup.org/HDF5/doc1.6/UG/12_Dataspaces.html + * @author Matteo Di Giovinazzo + */ +final class Hyperslab implements Index { + + @Override + public long numElements(Dimension dimension) { + return count * block; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dimension) { + return start + stride * (coordinate / block) + (coordinate % block); + } + + @Override + public Dimension apply(Dimension dim) { + return dim.withIndex(this); + } + + @Override + public boolean isPoint() { + return false; + } + + Hyperslab(long start, long stride, long count, long block) { + this.start = start; + this.stride = stride; + this.count = count; + this.block = block; + } + + private final long start; + private final long stride; + private final long count; + private final long block; + + @Override + public String toString() { + return new StringJoiner(", ", Hyperslab.class.getSimpleName() + "Hyperslab(", ")") + .add("start=" + start) + .add("stride=" + stride) + .add("count=" + count) + .add("block=" + block) + .toString(); + } + + @Override + public boolean isStridedSlicingCompliant() { + return false; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java new file mode 100644 index 00000000000..b98bb0dc988 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java @@ -0,0 +1,126 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.index; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +/** + * An index used for slicing a view out of an N-dimensional array. + * + *

    A slice, i.e. a reduced view, of an N-dimensional array is obtain by calling {@link + * NdArray#slice(Index...)}, given a list of indices that select which elements on a given dimension + * should be included/excluded from that view. + */ +public interface Index { + + /** + * Returns the number of elements that can be retrieved using this index on the given dimension. + * + *

    An index that maps one-by-one all elements of the dimensions will return a value equal to + * {@code dim.numElements()}, while an index that only maps a subset of these will return a + * smaller value. + * + * @param dim the indexed dimension + * @return number of elements accessible + */ + long numElements(Dimension dim); + + /** + * Transforms an element coordinate to a new coordinate by applying this index to the given + * dimension. + * + *

    For example, if the coordinate is 0 and this index flips the {@code n} elements on this + * dimension, then the returned value will be {@code n-1}. + * + * @param coordinate coordinate to transform + * @param dim dimension the indexed dimension + * @return transformed coordinate + */ + long mapCoordinate(long coordinate, Dimension dim); + + /** + * Applies this index to the given dimension. + * + *

    When accessing the elements from the returned dimension, this index will automatically apply + * and may transform the original position. + * + * @param dim dimension to apply this index to + * @return an indexed dimension + */ + default Dimension apply(Dimension dim) { + return dim.withIndex(this); + } + + /** Returns true if this index is a single point, reducing the number of dimensions by one */ + default boolean isPoint() { + return false; + } + + /** Returns true if this index is a new axis, adding a dimension of size 1 */ + default boolean isNewAxis() { + return false; + } + + /** + * Returns true if this index is an ellipsis, expanding to take as many dimensions as possible + * (and applying all() to them) + */ + default boolean isEllipsis() { + return false; + } + + /** + * Get whether the Index supports strided slice style indexing (using start, end, stride, and + * flags, i.e. TensorFlow's). + */ + default boolean isStridedSlicingCompliant() { + return true; + } + + /** Get the start of the index, for strided slice style indexing. */ + default long begin() { + return 0; + } + + /** Get the end of the index, strided slice style indexing. */ + default long end() { + return 0; + } + + /** Get the stride of the index, for strided slice style indexing. */ + default long stride() { + return 1; + } + + /** + * Get whether the Index should start at the beginning of the dimension, for strided slice style + * indexing. + */ + default boolean beginMask() { + return false; + } + + /** + * Get whether the Index should end at the beginning of the dimension, for strided slice style + * indexing. + */ + default boolean endMask() { + return false; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java new file mode 100644 index 00000000000..39f37b90205 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java @@ -0,0 +1,365 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.index; + +import org.tensorflow.ndarray.IllegalRankException; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffers; + +/** Helper class for instantiating {@link Index} objects. */ +public final class Indices { + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

    When this index is applied to a given dimension, the dimension is resolved as a single + * element and therefore is excluded from the computation of the rank. + * + *

    For example, given a 3D matrix on the axis [x, y, z], if {@code matrix.slice(all(), at(0), + * at(0)}, then the rank of the returned slice is 1 and its number of elements is {@code + * x.numElements()} + * + * @param coord coordinate of the element on the indexed axis + * @return index + */ + public static Index at(long coord) { + return new At(coord, false); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

    This is equivalent to call {@link #at(long)} but where the value of the coordinate is + * provided by an N-dimensional array. + * + * @param coord scalar indicating the coordinate of the element on the indexed axis + * @return index + * @throws IllegalRankException if {@code coord} is not a scalar (rank 0) + */ + public static Index at(NdArray coord) { + if (coord.rank() > 0) { + throw new IllegalRankException("Only scalars are accepted as a value index"); + } + return new At(coord.getObject().longValue(), false); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

    When this index is applied to a given dimension, the dimension is resolved as a single + * element and therefore, if {@code keepDim} is false, is excluded from the computation of the + * rank. If {@code} keepDim is true, the dimension is collapsed down to one element. + * + *

    For example, given a 3D matrix on the axis [x, y, z], if {@code matrix.slice(all(), at(0), + * at(0)}, then the rank of the returned slice is 1 and its number of elements is {@code + * x.numElements()} + * + * @param coord coordinate of the element on the indexed axis + * @param keepDim whether to remove the dimension. + * @return index + */ + public static Index at(long coord, boolean keepDim) { + return new At(coord, keepDim); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

    This is equivalent to call {@link #at(long, boolean)} but where the value of the coordinate + * is provided by an N-dimensional array. + * + *

    If {@code} keepDim is true, the dimension is collapsed down to one element instead of being + * removed. + * + * @param coord scalar indicating the coordinate of the element on the indexed axis + * @param keepDim whether to remove the dimension. + * @return index + * @throws IllegalRankException if {@code coord} is not a scalar (rank 0) + */ + public static Index at(NdArray coord, boolean keepDim) { + if (coord.rank() > 0) { + throw new IllegalRankException("Only scalars are accepted as a value index"); + } + return new At(coord.getObject().longValue(), keepDim); + } + + /** + * An index that returns all elements of a dimension in the original order. + * + *

    Applying this index to a given dimension will return the original dimension directly. + * + *

    For example, given a vector with {@code n} elements, {@code all()} returns x0, + * x1, ..., xn-1 + * + * @return index + */ + public static Index all() { + return All.INSTANCE; + } + + /** + * An index that returns only specific elements on a given dimension. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > + * 10}, {@code seq(8, 0, 3)} returns x8, x0, x3 + * + * @param coords coordinates of the elements in the sequence + * @return index + */ + public static Index seq(long... coords) { + if (coords == null) { + throw new IllegalArgumentException(); + } + return new Sequence( + NdArrays.wrap(Shape.of(coords.length), DataBuffers.of(coords, true, false))); + } + + /** + * An index that returns only specific elements on a given dimension. + * + *

    This is equivalent to {@link #seq(long...)} but where the coordinates of the elements in the + * sequence are provided by an N-dimensional array. + * + * @param coords vector of coordinates of the elements in the sequence + * @return index + * @throws IllegalRankException if {@code coords} is not a vector (rank 1) + */ + public static Index seq(NdArray coords) { + if (coords.rank() != 1) { + throw new IllegalRankException("Only vectors are accepted as an element index"); + } + return new Sequence(coords); + } + + /** + * An index that returns only elements found at an even position in the original dimension. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and n is even, + * {@code even()} returns x0, x2, ..., xn-2 + * + * @return index + */ + public static Index even() { + return step(2); + } + + /** + * An index that returns only elements found at an odd position in the original dimension. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and n is even, + * {@code odd()} returns x1, x3, ..., xn-1 + * + * @return index + */ + public static Index odd() { + return sliceFrom(1, 2); + } + + /** + * An index that skips a fixed amount of coordinates between each values returned. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, {@code step(k)} + * returns x0, xk, xk*2, ... + * + * @param stride the number of elements between each steps + * @return index + */ + public static Index step(long stride) { + return new Step(stride); + } + + /** + * An index that returns only elements on a given dimension starting at a specific coordinate. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > + * k}, {@code from(k)} returns xk, xk+1, ..., xn-1 + * + * @param start coordinate of the first element of the sequence + * @return index + */ + public static Index sliceFrom(long start) { + return sliceFrom(start, 1); + } + + /** + * An index that returns only elements on a given dimension starting at a specific coordinate, + * using the given stride. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > + * k}, {@code from(k)} returns xk, xk+1, ..., xn-1 + * + * @param start coordinate of the first element of the sequence + * @param stride the stride to use + * @return index + * @see #slice(long, long, long) + */ + public static Index sliceFrom(long start, long stride) { + return new SliceFrom(start, stride); + } + + /** + * An index that returns only elements on a given dimension up to a specific coordinate. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > + * k}, {@code to(k)} returns x0, x1, ..., xk + * + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + */ + public static Index sliceTo(long end) { + return sliceTo(end, 1); + } + + /** + * An index that returns only elements on a given dimension up to a specific coordinate, using the + * given stride. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > + * k}, {@code to(k)} returns x0, x1, ..., xk + * + * @param end coordinate of the last element of the sequence (exclusive) + * @param stride the stride to use + * @return index + * @see #slice(long, long, long) + */ + public static Index sliceTo(long end, long stride) { + return new SliceTo(end, stride); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k + * > j}, {@code range(j, k)} returns xj, xj+1, ..., xk + * + * @param start coordinate of the first element of the sequence + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + */ + public static Index range(long start, long end) { + return slice(start, end); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + *

    For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k + * > j}, {@code range(j, k)} returns xj, xj+1, ..., xk + * + * @return index + */ + public static Index flip() { + return slice(null, null, -1); + } + + /** + * An index that returns elements according to an hyperslab defined by {@code start}, {@code + * stride}, {@code count}, {@code block}. See {@link Hyperslab}. + * + * @param start Starting location for the hyperslab. + * @param stride The number of elements to separate each element or block to be selected. + * @param count The number of elements or blocks to select along the dimension. + * @param block The size of the block selected from the dimension. + * @return index + */ + public static Index hyperslab(long start, long stride, long count, long block) { + return new Hyperslab(start, stride, count, block); + } + + /** + * An index that inserts a new dimension of size 1 into the resulting array. + * + * @return index + */ + public static Index newAxis() { + return NewAxis.INSTANCE; + } + + /** + * An index that expands to fill all available source dimensions. Works the same as Python's + * {@code ...}. + * + * @return index + */ + public static Index ellipsis() { + return Ellipsis.INSTANCE; + } + + /** + * An index that returns elements between {@code start} and {@code end}. If {@code start} or + * {@code end} is {@code null}, starts or ends at the beginning or the end, respectively. + * + *

    Analogous to Python's {@code :} slice syntax. + * + * @return index + */ + public static Index slice(long start, long end) { + return slice(start, end, 1); + } + + /** + * An index that returns every {@code stride}-th element between {@code start} and {@code end}. If + * {@code start} or {@code end} is {@code null}, starts or ends at the beginning or the end, + * respectively. + * + *

    Analogous to Python's {@code :} slice syntax. + * + * @return index + */ + public static Index slice(long start, long end, long stride) { + return new Slice(start, end, stride); + } + + /** + * An index that returns elements between {@code start} and {@code end}. If {@code start} or + * {@code end} is {@code null}, starts or ends at the beginning or the end, respectively. + * + *

    Analogous to Python's {@code :} slice syntax. + * + * @return index + */ + public static Index slice(Long start, Long end) { + return slice(start, end, 1); + } + + /** + * An index that returns every {@code stride}-th element between {@code start} and {@code end}. If + * {@code start} or {@code end} is {@code null}, starts or ends at the beginning or the end, + * respectively. + * + *

    Analogous to Python's {@code :} slice syntax. + * + * @return index + */ + public static Index slice(Long start, Long end, long stride) { + if (start == null && end == null) { + if (stride == 1) { + return Indices.all(); + } else { + return Indices.step(stride); + } + } else if (start == null) { + return Indices.sliceTo(end, stride); + } else if (end == null) { + return Indices.sliceFrom(start, stride); + } + + return slice(start.longValue(), end.longValue(), stride); + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java new file mode 100644 index 00000000000..47f31bdf9b1 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/NewAxis.java @@ -0,0 +1,51 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class NewAxis implements Index { + + static final NewAxis INSTANCE = new NewAxis(); + + private NewAxis() {} + + @Override + public long numElements(Dimension dim) { + return 1; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate; + } + + @Override + public Dimension apply(Dimension dim) { + throw new IllegalStateException(); + } + + @Override + public boolean isNewAxis() { + return true; + } + + @Override + public String toString() { + return NewAxis.class.getSimpleName() + "()"; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java new file mode 100644 index 00000000000..beda853abb3 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java @@ -0,0 +1,52 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class Sequence implements Index { + + @Override + public long numElements(Dimension dim) { + return coords.size(); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coords.getObject(coordinate).longValue(); + } + + Sequence(NdArray coords) { + this.coords = coords; + } + + private final NdArray coords; + + @Override + public String toString() { + return new StringJoiner(", ", Sequence.class.getSimpleName() + "(", ")") + .add("coords=" + coords) + .toString(); + } + + @Override + public boolean isStridedSlicingCompliant() { + return false; + } +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java new file mode 100644 index 00000000000..74743c68fa2 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Slice.java @@ -0,0 +1,89 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class Slice implements Index { + + Slice(long start, long end, long stride) { + this.start = start; + this.end = end; + this.stride = stride; + + if (stride == 0) { + throw new IllegalArgumentException("Can not have a stride of 0"); + } + } + + @Override + public long numElements(Dimension dim) { + long length = end(dim) - start(dim); + + return (length / stride) + (length % stride != 0 ? 1 : 0); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start(dim) + stride * coordinate; + } + + @Override + public long begin() { + return start; + } + + @Override + public long end() { + return end; + } + + @Override + public long stride() { + return stride; + } + + @Override + public String toString() { + return new StringJoiner(", ", Slice.class.getSimpleName() + "(", ")") + .add("start=" + start) + .add("end=" + end) + .add("stride=" + stride) + .toString(); + } + + private long start(Dimension dim) { + if (start < 0) { + return dim.numElements() + start; + } + + return start; + } + + private long end(Dimension dim) { + if (end < 0) { + return dim.numElements() + end; + } else { + return end; + } + } + + private final long start; + private final long end; + private final long stride; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java new file mode 100644 index 00000000000..10ae6d0f09a --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceFrom.java @@ -0,0 +1,86 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class SliceFrom implements Index { + + SliceFrom(long start, long stride) { + this.start = start; + this.stride = stride; + + if (stride == 0) { + throw new IllegalArgumentException("Can not have a stride of 0"); + } + } + + @Override + public long numElements(Dimension dim) { + long length = end(dim) - start(dim); + + return (length / stride) + (length % stride != 0 ? 1 : 0); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start(dim) + stride * coordinate; + } + + @Override + public long begin() { + return start; + } + + @Override + public boolean endMask() { + return true; + } + + @Override + public long stride() { + return stride; + } + + @Override + public String toString() { + return new StringJoiner(", ", SliceFrom.class.getSimpleName() + "(", ")") + .add("start=" + start) + .add("stride=" + stride) + .toString(); + } + + private long start(Dimension dim) { + if (start < 0) { + return dim.numElements() + start; + } + + return start; + } + + private long end(Dimension dim) { + if (stride > 0) { + return dim.numElements(); + } else { + return -1; // it's exclusive + } + } + + private final long start; + private final long stride; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java new file mode 100644 index 00000000000..18f72585530 --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/SliceTo.java @@ -0,0 +1,86 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class SliceTo implements Index { + + SliceTo(long end, long stride) { + this.end = end; + this.stride = stride; + + if (stride == 0) { + throw new IllegalArgumentException("Can not have a stride of 0"); + } + } + + @Override + public long numElements(Dimension dim) { + long length = end(dim) - start(dim); + + return (length / stride) + (length % stride != 0 ? 1 : 0); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start(dim) + stride * coordinate; + } + + @Override + public long end() { + return end; + } + + @Override + public boolean beginMask() { + return true; + } + + @Override + public long stride() { + return stride; + } + + @Override + public String toString() { + return new StringJoiner(", ", SliceTo.class.getSimpleName() + "(", ")") + .add("end=" + end) + .add("stride=" + stride) + .toString(); + } + + private long start(Dimension dim) { + if (stride > 0) { + return 0; + } + + return dim.numElements() - 1; // it's inclusive + } + + private long end(Dimension dim) { + if (end < 0) { + return dim.numElements() + end; + } else { + return end; + } + } + + private final long end; + private final long stride; +} diff --git a/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java new file mode 100644 index 00000000000..fc407bbe55b --- /dev/null +++ b/tensorflow-ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java @@ -0,0 +1,83 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray.index; + +import java.util.StringJoiner; +import org.tensorflow.ndarray.impl.dimension.Dimension; + +final class Step implements Index { + + Step(long stride) { + this.stride = stride; + + if (stride == 0) { + throw new IllegalArgumentException("Can not have a stride of 0"); + } + } + + @Override + public long numElements(Dimension dim) { + long length = end(dim) - start(dim); + + return (length / stride) + (length % stride != 0 ? 1 : 0); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start(dim) + stride * coordinate; + } + + @Override + public boolean beginMask() { + return true; + } + + @Override + public boolean endMask() { + return true; + } + + @Override + public long stride() { + return stride; + } + + @Override + public String toString() { + return new StringJoiner(", ", Step.class.getSimpleName() + "(", ")") + .add("stride=" + stride) + .toString(); + } + + private long start(Dimension dim) { + if (stride > 0) { + return 0; + } + + return dim.numElements() - 1; // it's inclusive + } + + private long end(Dimension dim) { + if (stride > 0) { + return dim.numElements(); + } else { + return -1; // it's exclusive + } + } + + private final long stride; +} diff --git a/tensorflow-ndarray/src/test/java/module-info.test b/tensorflow-ndarray/src/test/java/module-info.test new file mode 100644 index 00000000000..310e500ee47 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/module-info.test @@ -0,0 +1,22 @@ +/* + Copyright 2022 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. + ======================================================================= + */ +module org.tensorflow.ndarray { + requires java.desktop; // required for java.awt.* + + requires transitive org.junit.jupiter.engine; + requires transitive org.junit.jupiter.api; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.java new file mode 100644 index 00000000000..f11a1193a35 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/BooleanNdArrayTestBase.java @@ -0,0 +1,53 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.tensorflow.ndarray.NdArrays.vectorOf; + +import org.junit.jupiter.api.Test; + +public abstract class BooleanNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract BooleanNdArray allocate(Shape shape); + + @Override + protected Boolean valueOf(Long val) { + return val > 0; + } + + @Test + public void iteratePrimitiveElements() { + BooleanNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setBoolean(coords[2] > 0)); + + assertFalse(matrix3d.getBoolean(0, 0, 0)); + assertTrue(matrix3d.getBoolean(0, 0, 1)); + assertTrue(matrix3d.getBoolean(0, 0, 4)); + assertTrue(matrix3d.getBoolean(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> vector.set(vectorOf(true, false, true, false, true))); + + assertTrue(matrix3d.getBoolean(0, 0, 0)); + assertFalse(matrix3d.getBoolean(0, 0, 1)); + assertTrue(matrix3d.getBoolean(0, 0, 4)); + assertTrue(matrix3d.getBoolean(0, 1, 2)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java new file mode 100644 index 00000000000..be8c99a6b1e --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ByteNdArrayTestBase.java @@ -0,0 +1,55 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class ByteNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract ByteNdArray allocate(Shape shape); + + @Override + protected Byte valueOf(Long val) { + return val.byteValue(); + } + + @Test + public void iteratePrimitiveElements() { + ByteNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setByte((byte) coords[2])); + + assertEquals(0, matrix3d.getByte(0, 0, 0)); + assertEquals(1, matrix3d.getByte(0, 0, 1)); + assertEquals(4, matrix3d.getByte(0, 0, 4)); + assertEquals(2, matrix3d.getByte(0, 1, 2)); + + matrix3d + .elements(1) + .forEach( + vector -> + vector.set(NdArrays.vectorOf((byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9))); + + assertEquals(5, matrix3d.getByte(0, 0, 0)); + assertEquals(6, matrix3d.getByte(0, 0, 1)); + assertEquals(9, matrix3d.getByte(0, 0, 4)); + assertEquals(7, matrix3d.getByte(0, 1, 2)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java new file mode 100644 index 00000000000..1bcca203ff7 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/DoubleNdArrayTestBase.java @@ -0,0 +1,51 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class DoubleNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract DoubleNdArray allocate(Shape shape); + + @Override + protected Double valueOf(Long val) { + return val.doubleValue(); + } + + @Test + public void iteratePrimitiveElements() { + DoubleNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setDouble((double) coords[2])); + + assertEquals(0.0, matrix3d.getDouble(0, 0, 0), 0.0); + assertEquals(1.0, matrix3d.getDouble(0, 0, 1), 0.0); + assertEquals(4.0, matrix3d.getDouble(0, 0, 4), 0.0); + assertEquals(2.0, matrix3d.getDouble(0, 1, 2), 0.0); + + matrix3d.elements(1).forEach(vector -> vector.set(NdArrays.vectorOf(5.0, 6.0, 7.0, 8.0, 9.0))); + + assertEquals(5, matrix3d.getDouble(0, 0, 0), 0.0); + assertEquals(6, matrix3d.getDouble(0, 0, 1), 0.0); + assertEquals(9, matrix3d.getDouble(0, 0, 4), 0.0); + assertEquals(7, matrix3d.getDouble(0, 1, 2), 0.0); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java new file mode 100644 index 00000000000..6d11346df76 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/FloatNdArrayTestBase.java @@ -0,0 +1,53 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class FloatNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract FloatNdArray allocate(Shape shape); + + @Override + protected Float valueOf(Long val) { + return val.floatValue(); + } + + @Test + public void iteratePrimitiveElements() { + FloatNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setFloat((float) coords[2])); + + assertEquals(0.0f, matrix3d.getFloat(0, 0, 0), 0.0f); + assertEquals(1.0f, matrix3d.getFloat(0, 0, 1), 0.0f); + assertEquals(4.0f, matrix3d.getFloat(0, 0, 4), 0.0f); + assertEquals(2.0f, matrix3d.getFloat(0, 1, 2), 0.0f); + + matrix3d + .elements(1) + .forEach(vector -> vector.set(NdArrays.vectorOf(5.0f, 6.0f, 7.0f, 8.0f, 9.0f))); + + assertEquals(5, matrix3d.getFloat(0, 0, 0), 0.0f); + assertEquals(6, matrix3d.getFloat(0, 0, 1), 0.0f); + assertEquals(9, matrix3d.getFloat(0, 0, 4), 0.0f); + assertEquals(7, matrix3d.getFloat(0, 1, 2), 0.0f); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java new file mode 100644 index 00000000000..94897f63129 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IndexTest.java @@ -0,0 +1,555 @@ +/* + 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. +============================================================================== +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.index.Indices; + +public class IndexTest { + @Test + public void testNullConversions() { + assertTrue( + Indices.slice(null, 0L).beginMask(), + "Passed null for slice start but didn't set begin mask"); + + assertTrue( + Indices.slice(null, 0L).beginMask(), + "Passed null for slice start but didn't set begin mask"); + + assertTrue( + Indices.slice(null, null).beginMask(), + "Passed null for slice start but didn't set begin mask"); + + assertTrue( + Indices.slice(0L, null).endMask(), "Passed null for slice end but didn't set end mask"); + + assertTrue( + Indices.slice(0L, null).endMask(), "Passed null for slice end but didn't set end mask"); + + assertTrue( + Indices.slice(null, null).endMask(), "Passed null for slice end but didn't set end mask"); + } + + @Test + public void testIndices() { + + String[][] indexData = new String[5][4]; + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 4; j++) indexData[i][j] = "(" + j + ", " + i + ")"; + } + + NdArray matrix2d = StdArrays.ndCopyOf(indexData); + assertEquals(2, matrix2d.rank()); + + /* + |(0, 0), (1, 0), (2, 0), (3, 0)| + |(0, 1), (1, 1), (2, 1), (3, 1)| + |(0, 2), (1, 2), (2, 2), (3, 2)| + |(0, 3), (1, 3), (2, 3), (3, 3)| + |(0, 4), (1, 4), (2, 4), (3, 4)| + */ + assertArrayEquals(new String[] {"(0, 0)", "(1, 0)", "(2, 0)", "(3, 0)"}, indexData[0]); + + NdArray same1 = matrix2d.slice(Indices.all()); + String[][] same1j = StdArrays.array2dCopyOf(same1, String.class); + assertEquals(2, same1.rank()); + assertEquals(same1, matrix2d); + assertEquals(matrix2d, StdArrays.ndCopyOf(same1j)); + + NdArray same2 = matrix2d.slice(Indices.ellipsis()); + String[][] same2j = StdArrays.array2dCopyOf(same2, String.class); + assertEquals(2, same2.rank()); + assertEquals(matrix2d, same2); + assertEquals(matrix2d, StdArrays.ndCopyOf(same2j)); + + // All rows, column 1 + NdArray same3 = matrix2d.slice(Indices.all(), Indices.at(1)); + assertEquals(1, same3.rank()); + String[] same3j = StdArrays.array1dCopyOf(same3, String.class); + assertArrayEquals(new String[] {"(1, 0)", "(1, 1)", "(1, 2)", "(1, 3)", "(1, 4)"}, same3j); + + // row 2, all columns + NdArray same4 = matrix2d.slice(Indices.at(2), Indices.all()); + assertEquals(1, same4.rank()); + String[] same4j = StdArrays.array1dCopyOf(same4, String.class); + assertArrayEquals(new String[] {"(0, 2)", "(1, 2)", "(2, 2)", "(3, 2)"}, same4j); + assertEquals(NdArrays.vectorOfObjects("(0, 2)", "(1, 2)", "(2, 2)", "(3, 2)"), same4); + + // row 2, column 1 + NdArray same5 = matrix2d.slice(Indices.at(2), Indices.at(1)); + assertEquals(0, same5.rank()); + assertTrue(same5.shape().isScalar()); + // Don't use an index + String same5j = same5.getObject(); + assertEquals("(1, 2)", same5j); + + // rows 1 to 2, all columns + NdArray same6 = matrix2d.slice(Indices.slice(1, 3)); + assertEquals(2, same6.rank()); + String[][] same6j = StdArrays.array2dCopyOf(same6, String.class); + assertArrayEquals( + new String[][] { + {"(0, 1)", "(1, 1)", "(2, 1)", "(3, 1)"}, + {"(0, 2)", "(1, 2)", "(2, 2)", "(3, 2)"} + }, + same6j); + + // Exception in thread "main" java.nio.BufferOverflowException + // all rows, columns 1 to 2 + NdArray same7 = matrix2d.slice(Indices.all(), Indices.slice(1, 3)); + assertEquals(2, same7.rank()); + assertEquals(Shape.of(5, 2), same7.shape()); + assertEquals(10, same7.size()); + NdArray r7_0 = same7.get(0); + NdArray r7_1 = same7.get(1); + NdArray r7_2 = same7.get(2); + NdArray r7_3 = same7.get(3); + NdArray r7_4 = same7.get(4); + assertEquals(1, r7_0.rank()); + assertEquals(Shape.of(2), r7_0.shape()); + assertEquals(2, r7_0.size()); + // TODO: I get a (0,0) which is not what I expected + // System.out.println(r7_0.getObject()); + // assertEquals("(1,0)", r7_0.getObject()); + assertEquals("(1, 0)", r7_0.getObject(0)); + assertEquals("(2, 0)", r7_0.getObject(1)); + assertEquals("(1, 1)", r7_1.getObject(0)); + assertEquals("(2, 1)", r7_1.getObject(1)); + assertEquals("(1, 2)", r7_2.getObject(0)); + assertEquals("(2, 2)", r7_2.getObject(1)); + assertEquals("(1, 3)", r7_3.getObject(0)); + assertEquals("(2, 3)", r7_3.getObject(1)); + assertEquals("(1, 4)", r7_4.getObject(0)); + assertEquals("(2, 4)", r7_4.getObject(1)); + String[][] expectedr7 = + new String[][] { + {"(1, 0)", "(2, 0)"}, + {"(1, 1)", "(2, 1)"}, + {"(1, 2)", "(2, 2)"}, + {"(1, 3)", "(2, 3)"}, + {"(1, 4)", "(2, 4)"} + }; + String[][] lArray = new String[5][2]; + StdArrays.copyFrom(same7, lArray); + assertArrayEquals(expectedr7, lArray); + String[][] same7j = StdArrays.array2dCopyOf(same7, String.class); + assertArrayEquals(expectedr7, same7j); + + // rows 1 to 2, columns 1 to 2 + NdArray same8 = matrix2d.slice(Indices.slice(1, 3), Indices.slice(1, 3)); + assertEquals(2, same8.rank()); + assertEquals(Shape.of(2, 2), same8.shape()); + assertEquals(4, same8.size()); + String[][] same8j = StdArrays.array2dCopyOf(same8, String.class); + // print2D(same8j) + String[][] expected_r8 = + new String[][] { + {"(1, 1)", "(2, 1)"}, + {"(1, 2)", "(2, 2)"} + }; + assertArrayEquals(expected_r8, same8j); + NdArray r8_0 = same8.get(0); + NdArray r8_1 = same8.get(1); + assertEquals(1, r8_0.rank()); + assertEquals(Shape.of(2), r8_0.shape()); + assertEquals(2, r8_0.size()); + assertEquals("(1, 1)", r8_0.getObject(0)); + assertEquals("(2, 1)", r8_0.getObject(1)); + assertEquals("(1, 2)", r8_1.getObject(0)); + assertEquals("(2, 2)", r8_1.getObject(1)); + + // rows 1 to 2, columns 1 to 2 + NdArray same9 = matrix2d.slice(Indices.range(1, 3), Indices.range(1, 3)); + assertEquals(2, same9.rank()); + assertEquals(Shape.of(2, 2), same9.shape()); + assertEquals(4, same9.size()); + String[][] same9j = StdArrays.array2dCopyOf(same9, String.class); + String[][] expected_r9 = + new String[][] { + {"(1, 1)", "(2, 1)"}, + {"(1, 2)", "(2, 2)"} + }; + assertArrayEquals(expected_r9, same9j); + NdArray r9_0 = same9.get(0); + NdArray r9_1 = same9.get(1); + assertEquals(1, r9_0.rank()); + assertEquals(Shape.of(2), r9_0.shape()); + assertEquals(2, r9_0.size()); + assertEquals("(1, 1)", r9_0.getObject(0)); + assertEquals("(2, 1)", r9_0.getObject(1)); + assertEquals("(1, 2)", r9_1.getObject(0)); + assertEquals("(2, 2)", r9_1.getObject(1)); + + // rows 1, 3 and 4, columns 0 to 2 + NdArray same10 = matrix2d.slice(Indices.odd(), Indices.even()); + String[][] same10j = StdArrays.array2dCopyOf(same10, String.class); + assertEquals(2, same10.rank()); + assertEquals(Shape.of(2, 2), same10.shape()); + assertEquals(4, same10.size()); + String[][] expected_r10 = + new String[][] { + {"(0, 1)", "(2, 1)"}, + {"(0, 3)", "(2, 3)"} + }; + assertArrayEquals(expected_r10, same10j); + NdArray r10_0 = same10.get(0); + NdArray r10_1 = same10.get(1); + assertEquals(1, r10_0.rank()); + assertEquals(Shape.of(2), r10_0.shape()); + assertEquals(2, r10_0.size()); + assertEquals("(0, 1)", r10_0.getObject(0)); + assertEquals("(2, 1)", r10_0.getObject(1)); + assertEquals("(0, 3)", r10_1.getObject(0)); + assertEquals("(2, 3)", r10_1.getObject(1)); + + // rows 3 and 4, columns 0 and 1. Second value is stride + NdArray same11 = matrix2d.slice(Indices.sliceFrom(3, 1), Indices.sliceFrom(2, 1)); + String[][] same11j = StdArrays.array2dCopyOf(same11, String.class); + assertEquals(2, same11.rank()); + assertEquals(Shape.of(2, 2), same11.shape()); + assertEquals(4, same11.size()); + String[][] expected_r11 = + new String[][] { + {"(2, 3)", "(3, 3)"}, + {"(2, 4)", "(3, 4)"} + }; + assertArrayEquals(expected_r11, same11j); + NdArray r11_0 = same11.get(0); + NdArray r11_1 = same11.get(1); + assertEquals(1, r11_0.rank()); + assertEquals(Shape.of(2), r11_0.shape()); + assertEquals(2, r11_0.size()); + assertEquals("(2, 3)", r11_0.getObject(0)); + assertEquals("(3, 3)", r11_0.getObject(1)); + assertEquals("(2, 4)", r11_1.getObject(0)); + assertEquals("(3, 4)", r11_1.getObject(1)); + + // rows 0 and 2, columns 0 and 1. Second value is stride. Index non inclusive + NdArray same12 = matrix2d.slice(Indices.sliceTo(3, 2), Indices.sliceTo(2, 1)); + String[][] same12j = StdArrays.array2dCopyOf(same12, String.class); + assertEquals(2, same12.rank()); + assertEquals(Shape.of(2, 2), same12.shape()); + assertEquals(4, same12.size()); + String[][] expected_r12 = + new String[][] { + {"(0, 0)", "(1, 0)"}, + {"(0, 2)", "(1, 2)"} + }; + assertArrayEquals(expected_r12, same12j); + NdArray r12_0 = same12.get(0); + NdArray r12_1 = same12.get(1); + assertEquals(1, r12_0.rank()); + assertEquals(Shape.of(2), r12_0.shape()); + assertEquals(2, r12_0.size()); + assertEquals("(0, 0)", r12_0.getObject(0)); + assertEquals("(1, 0)", r12_0.getObject(1)); + assertEquals("(0, 2)", r12_1.getObject(0)); + assertEquals("(1, 2)", r12_1.getObject(1)); + + // rows 0 and 2, columns 0 and 1. Second value is stride. Index non inclusive + NdArray same13 = matrix2d.slice(Indices.step(2), Indices.step(2)); + String[][] same13j = StdArrays.array2dCopyOf(same13, String.class); + assertEquals(2, same13.rank()); + assertEquals(Shape.of(3, 2), same13.shape()); + assertEquals(6, same13.size()); + String[][] expected_r13 = + new String[][] { + {"(0, 0)", "(2, 0)"}, + {"(0, 2)", "(2, 2)"}, + {"(0, 4)", "(2, 4)"} + }; + assertArrayEquals(expected_r13, same13j); + NdArray r13_0 = same13.get(0); + NdArray r13_1 = same13.get(1); + NdArray r13_2 = same13.get(2); + assertEquals(1, r13_0.rank()); + assertEquals(Shape.of(2), r13_0.shape()); + assertEquals(2, r13_0.size()); + assertEquals("(0, 0)", r13_0.getObject(0)); + assertEquals("(2, 0)", r13_0.getObject(1)); + assertEquals("(0, 2)", r13_1.getObject(0)); + assertEquals("(2, 2)", r13_1.getObject(1)); + assertEquals("(0, 4)", r13_2.getObject(0)); + assertEquals("(2, 4)", r13_2.getObject(1)); + + NdArray same14 = same13.slice(Indices.flip(), Indices.flip()); + String[][] same14j = StdArrays.array2dCopyOf(same14, String.class); + assertEquals(2, same14.rank()); + assertEquals(Shape.of(3, 2), same14.shape()); + assertEquals(6, same14.size()); + String[][] expected_r14 = + new String[][] { + {"(2, 4)", "(0, 4)"}, + {"(2, 2)", "(0, 2)"}, + {"(2, 0)", "(0, 0)"} + }; + assertArrayEquals(same14j, expected_r14); + NdArray r14_0 = same14.get(0); + NdArray r14_1 = same14.get(1); + NdArray r14_2 = same14.get(2); + assertEquals(1, r14_0.rank()); + assertEquals(Shape.of(2), r14_0.shape()); + assertEquals(2, r14_0.size()); + assertEquals("(0, 0)", r14_2.getObject(1)); + assertEquals("(2, 0)", r14_2.getObject(0)); + assertEquals("(0, 2)", r14_1.getObject(1)); + assertEquals("(2, 2)", r14_1.getObject(0)); + assertEquals("(0, 4)", r14_0.getObject(1)); + assertEquals("(2, 4)", r14_0.getObject(0)); + + NdArray same15 = matrix2d.slice(Indices.slice(4, 0, -2), Indices.slice(3L, null, -2)); + String[][] same15j = StdArrays.array2dCopyOf(same15, String.class); + assertEquals(2, same15.rank()); + assertEquals(Shape.of(2, 2), same15.shape()); + assertEquals(4, same15.size()); + String[][] expected_r15 = + new String[][] { + {"(3, 4)", "(1, 4)"}, + {"(3, 2)", "(1, 2)"}, + }; + assertArrayEquals(expected_r15, same15j); + NdArray r15_0 = same15.get(0); + NdArray r15_1 = same15.get(1); + assertEquals(1, r15_0.rank()); + assertEquals(Shape.of(2), r15_0.shape()); + assertEquals(2, r15_0.size()); + assertEquals("(3, 4)", r15_0.getObject(0)); + assertEquals("(1, 4)", r15_0.getObject(1)); + assertEquals("(3, 2)", r15_1.getObject(0)); + assertEquals("(1, 2)", r15_1.getObject(1)); + + NdArray same16 = matrix2d.slice(Indices.seq(4, 2), Indices.seq(3, 1)); + String[][] same16j = StdArrays.array2dCopyOf(same16, String.class); + assertEquals(2, same16.rank()); + assertEquals(Shape.of(2, 2), same16.shape()); + assertEquals(4, same16.size()); + String[][] expected_r16 = + new String[][] { + {"(3, 4)", "(1, 4)"}, + {"(3, 2)", "(1, 2)"} + }; + assertArrayEquals(expected_r16, same16j); + NdArray r16_0 = same16.get(0); + NdArray r16_1 = same16.get(1); + assertEquals(1, r16_0.rank()); + assertEquals(Shape.of(2), r16_0.shape()); + assertEquals(2, r16_0.size()); + assertEquals("(3, 4)", r16_0.getObject(0)); + assertEquals("(1, 4)", r16_0.getObject(1)); + assertEquals("(3, 2)", r16_1.getObject(0)); + assertEquals("(1, 2)", r16_1.getObject(1)); + + // New axis always has size 1 + NdArray same17 = matrix2d.slice(Indices.all(), Indices.all(), Indices.newAxis()); + String[][][] same17j = StdArrays.array3dCopyOf(same17, String.class); + assertEquals(3, same17.rank()); + assertEquals(Shape.of(5, 4, 1), same17.shape()); + assertEquals(20, same17.size()); + String[][][] expected_r17 = + new String[][][] { + {{"(0, 0)"}, {"(1, 0)"}, {"(2, 0)"}, {"(3, 0)"}}, + {{"(0, 1)"}, {"(1, 1)"}, {"(2, 1)"}, {"(3, 1)"}}, + {{"(0, 2)"}, {"(1, 2)"}, {"(2, 2)"}, {"(3, 2)"}}, + {{"(0, 3)"}, {"(1, 3)"}, {"(2, 3)"}, {"(3, 3)"}}, + {{"(0, 4)"}, {"(1, 4)"}, {"(2, 4)"}, {"(3, 4)"}} + }; + assertArrayEquals(expected_r17, same17j); + NdArray r17_0 = same17.get(0); + NdArray r17_1 = same17.get(1); + NdArray r17_2 = same17.get(2); + NdArray r17_3 = same17.get(3); + NdArray r17_4 = same17.get(4); + assertEquals(2, r17_0.rank()); + assertEquals(Shape.of(4, 1), r17_0.shape()); + assertEquals(4, r17_0.size()); + // row 0 + // What use case can we have for a new index of size 1? + // row 1 + assertEquals("(0, 1)", r17_1.getObject(0, 0)); + assertEquals("(1, 1)", r17_1.getObject(1, 0)); + assertEquals("(2, 1)", r17_1.getObject(2, 0)); + assertEquals("(3, 1)", r17_1.getObject(3, 0)); + // row 2 + assertEquals("(0, 2)", r17_2.getObject(0, 0)); + assertEquals("(1, 2)", r17_2.getObject(1, 0)); + assertEquals("(2, 2)", r17_2.getObject(2, 0)); + assertEquals("(3, 2)", r17_2.getObject(3, 0)); + // row 3 + assertEquals("(0, 3)", r17_3.getObject(0, 0)); + assertEquals("(1, 3)", r17_3.getObject(1, 0)); + assertEquals("(2, 3)", r17_3.getObject(2, 0)); + assertEquals("(3, 3)", r17_3.getObject(3, 0)); + // row 4 + assertEquals("(0, 4)", r17_4.getObject(0, 0)); + assertEquals("(1, 4)", r17_4.getObject(1, 0)); + assertEquals("(2, 4)", r17_4.getObject(2, 0)); + assertEquals("(3, 4)", r17_4.getObject(3, 0)); + } + + @Test + public void testNewaxis() { + IntNdArray matrix3d = NdArrays.ofInts(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setInt((int) coords[2])); + + IntNdArray slice1 = + matrix3d.slice(Indices.all(), Indices.all(), Indices.all(), Indices.newAxis()); + + assertEquals(Shape.of(5, 4, 5, 1), slice1.shape()); + assertEquals(0, slice1.getInt(0, 0, 0, 0)); + assertEquals(1, slice1.getInt(0, 0, 1, 0)); + assertEquals(4, slice1.getInt(0, 0, 4, 0)); + assertEquals(2, slice1.getInt(0, 1, 2, 0)); + + IntNdArray slice2 = + matrix3d.slice(Indices.all(), Indices.all(), Indices.newAxis(), Indices.all()); + + assertEquals(Shape.of(5, 4, 1, 5), slice2.shape()); + assertEquals(0, slice2.getInt(0, 0, 0, 0)); + assertEquals(1, slice2.getInt(0, 0, 0, 1)); + assertEquals(4, slice2.getInt(0, 0, 0, 4)); + assertEquals(2, slice2.getInt(0, 1, 0, 2)); + + IntNdArray slice3 = + matrix3d.slice(Indices.all(), Indices.newAxis(), Indices.all(), Indices.all()); + + assertEquals(Shape.of(5, 1, 4, 5), slice3.shape()); + assertEquals(0, slice3.getInt(0, 0, 0, 0)); + assertEquals(1, slice3.getInt(0, 0, 0, 1)); + assertEquals(4, slice3.getInt(0, 0, 0, 4)); + assertEquals(2, slice3.getInt(0, 0, 1, 2)); + + IntNdArray slice4 = + matrix3d.slice(Indices.newAxis(), Indices.all(), Indices.all(), Indices.all()); + + assertEquals(Shape.of(1, 5, 4, 5), slice4.shape()); + assertEquals(0, slice4.getInt(0, 0, 0, 0)); + assertEquals(1, slice4.getInt(0, 0, 0, 1)); + assertEquals(4, slice4.getInt(0, 0, 0, 4)); + assertEquals(2, slice4.getInt(0, 0, 1, 2)); + } + + @Test + public void testEllipsis() { + IntNdArray matrix3d = NdArrays.ofInts(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setInt((int) coords[2])); + + assertEquals( + matrix3d.slice(Indices.all(), Indices.all(), Indices.at(0)), + matrix3d.slice(Indices.ellipsis(), Indices.at(0))); + + assertEquals( + matrix3d.slice(Indices.at(0), Indices.all(), Indices.all()), + matrix3d.slice(Indices.at(0), Indices.ellipsis())); + + assertEquals( + matrix3d.slice(Indices.at(0), Indices.all(), Indices.at(0)), + matrix3d.slice(Indices.at(0), Indices.ellipsis(), Indices.at(0))); + + // newaxis interacts specially with ellipsis (since it doesn't consume a dimension), test this + + assertEquals( + matrix3d.slice(Indices.all(), Indices.all(), Indices.newAxis(), Indices.at(0)), + matrix3d.slice(Indices.ellipsis(), Indices.newAxis(), Indices.at(0))); + + assertEquals( + matrix3d.slice(Indices.newAxis(), Indices.all(), Indices.all(), Indices.at(0)), + matrix3d.slice(Indices.newAxis(), Indices.ellipsis(), Indices.at(0))); + + assertEquals( + matrix3d.slice(Indices.all(), Indices.all(), Indices.at(0), Indices.newAxis()), + matrix3d.slice(Indices.ellipsis(), Indices.at(0), Indices.newAxis())); + } + + @Test + public void testSlice() { + IntNdArray matrix3d = NdArrays.ofInts(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setInt((int) coords[2])); + + IntNdArray slice1 = matrix3d.slice(Indices.all(), Indices.sliceTo(3), Indices.all()); + + assertEquals(Shape.of(5, 3, 5), slice1.shape()); + assertEquals(0, slice1.getInt(0, 0, 0)); + assertEquals(1, slice1.getInt(0, 0, 1)); + assertEquals(2, slice1.getInt(0, 1, 2)); + + IntNdArray slice2 = matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(1, 4)); + + assertEquals(Shape.of(5, 4, 3), slice2.shape()); + assertEquals(1, slice2.getInt(0, 0, 0)); + assertEquals(3, slice2.getInt(0, 0, 2)); + assertEquals(2, slice2.getInt(0, 1, 1)); + + assertEquals(slice2, matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(1, -1))); + + assertEquals(slice2, matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(-4, -1))); + + assertEquals( + Shape.of(5, 4, 0), + matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(1, 4, -2)).shape()); + + IntNdArray slice3 = matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(4, 1, -2)); + + assertEquals(Shape.of(5, 4, 2), slice3.shape()); + assertEquals(4, slice3.getInt(0, 0, 0)); + assertEquals(2, slice3.getInt(0, 1, 1)); + + assertEquals(slice3, matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(-1, 1, -2))); + + assertEquals(slice3, matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(-1, -4, -2))); + + IntNdArray slice4 = matrix3d.slice(Indices.all(), Indices.all(), Indices.slice(null, null, -1)); + + assertEquals(Shape.of(5, 4, 5), slice4.shape()); + assertEquals(4, slice4.getInt(0, 0, 0)); + assertEquals(3, slice4.getInt(0, 0, 1)); + assertEquals(2, slice4.getInt(0, 1, 2)); + } + + @Test + public void testAt() { + IntNdArray matrix3d = NdArrays.ofInts(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setInt((int) coords[2])); + + IntNdArray slice1 = matrix3d.slice(Indices.all(), Indices.all(), Indices.at(0)); + + assertEquals(Shape.of(5, 4), slice1.shape()); + assertEquals(0, slice1.getInt(0, 0)); + + IntNdArray slice2 = matrix3d.slice(Indices.all(), Indices.all(), Indices.at(3)); + + assertEquals(Shape.of(5, 4), slice2.shape()); + assertEquals(3, slice2.getInt(0, 0)); + + IntNdArray slice3 = matrix3d.slice(Indices.all(), Indices.all(), Indices.at(-3)); + + assertEquals(Shape.of(5, 4), slice3.shape()); + assertEquals(2, slice3.getInt(0, 0)); + + IntNdArray slice4 = matrix3d.slice(Indices.all(), Indices.all(), Indices.at(-3, true)); + + assertEquals(Shape.of(5, 4, 1), slice4.shape()); + assertEquals(2, slice4.getInt(0, 0, 0)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java new file mode 100644 index 00000000000..f3278196901 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/IntNdArrayTestBase.java @@ -0,0 +1,77 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class IntNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract IntNdArray allocate(Shape shape); + + @Override + protected Integer valueOf(Long val) { + return val.intValue(); + } + + @Test + public void iteratePrimitiveElements() { + IntNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setInt((int) coords[2])); + + assertEquals(0, matrix3d.getInt(0, 0, 0)); + assertEquals(1, matrix3d.getInt(0, 0, 1)); + assertEquals(4, matrix3d.getInt(0, 0, 4)); + assertEquals(2, matrix3d.getInt(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> vector.set(NdArrays.vectorOf(5, 6, 7, 8, 9))); + + assertEquals(5, matrix3d.getInt(0, 0, 0)); + assertEquals(6, matrix3d.getInt(0, 0, 1)); + assertEquals(9, matrix3d.getInt(0, 0, 4)); + assertEquals(7, matrix3d.getInt(0, 1, 2)); + } + + @Test + public void streamingInts() { + IntNdArray scalar = allocate(Shape.scalar()); + scalar.setInt(1); + var values = scalar.streamOfInts().toArray(); + assertArrayEquals(new int[] {1}, values); + + IntNdArray vector = allocate(Shape.of(5)); + vector.setInt(1, 0); + vector.setInt(2, 1); + vector.setInt(3, 2); + vector.setInt(4, 3); + vector.setInt(5, 4); + values = vector.streamOfInts().toArray(); + assertArrayEquals(new int[] {1, 2, 3, 4, 5}, values); + + IntNdArray matrix = allocate(Shape.of(2, 2)); + matrix.setInt(1, 0, 0); + matrix.setInt(2, 0, 1); + matrix.setInt(3, 1, 0); + matrix.setInt(4, 1, 1); + values = matrix.streamOfInts().toArray(); + assertArrayEquals(new int[] {1, 2, 3, 4}, values); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java new file mode 100644 index 00000000000..ad8023284f1 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/LongNdArrayTestBase.java @@ -0,0 +1,77 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class LongNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract LongNdArray allocate(Shape shape); + + @Override + protected Long valueOf(Long val) { + return val; + } + + @Test + public void iteratePrimitiveElements() { + LongNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setLong(coords[2])); + + assertEquals(0, matrix3d.getLong(0, 0, 0)); + assertEquals(1, matrix3d.getLong(0, 0, 1)); + assertEquals(4, matrix3d.getLong(0, 0, 4)); + assertEquals(2, matrix3d.getLong(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> vector.set(NdArrays.vectorOf(5L, 6L, 7L, 8L, 9L))); + + assertEquals(5, matrix3d.getLong(0, 0, 0)); + assertEquals(6, matrix3d.getLong(0, 0, 1)); + assertEquals(9, matrix3d.getLong(0, 0, 4)); + assertEquals(7, matrix3d.getLong(0, 1, 2)); + } + + @Test + public void streamingLongs() { + LongNdArray scalar = allocate(Shape.scalar()); + scalar.setLong(1L); + var values = scalar.streamOfLongs().toArray(); + assertArrayEquals(new long[] {1L}, values); + + LongNdArray vector = allocate(Shape.of(5)); + vector.setLong(1L, 0); + vector.setLong(2L, 1); + vector.setLong(3L, 2); + vector.setLong(4L, 3); + vector.setLong(5L, 4); + values = vector.streamOfLongs().toArray(); + assertArrayEquals(new long[] {1L, 2L, 3L, 4L, 5L}, values); + + LongNdArray matrix = allocate(Shape.of(2, 2)); + matrix.setLong(1L, 0, 0); + matrix.setLong(2L, 0, 1); + matrix.setLong(3L, 1, 0); + matrix.setLong(4L, 1, 1); + values = matrix.streamOfLongs().toArray(); + assertArrayEquals(new long[] {1L, 2L, 3L, 4L}, values); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java new file mode 100644 index 00000000000..ce6d990dd90 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/NdArrayTestBase.java @@ -0,0 +1,428 @@ +/* +Copyright 2019-2023 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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.*; +import static org.tensorflow.ndarray.NdArrays.vectorOfObjects; +import static org.tensorflow.ndarray.index.Indices.all; +import static org.tensorflow.ndarray.index.Indices.at; +import static org.tensorflow.ndarray.index.Indices.even; +import static org.tensorflow.ndarray.index.Indices.flip; +import static org.tensorflow.ndarray.index.Indices.odd; +import static org.tensorflow.ndarray.index.Indices.range; +import static org.tensorflow.ndarray.index.Indices.seq; +import static org.tensorflow.ndarray.index.Indices.sliceFrom; +import static org.tensorflow.ndarray.index.Indices.sliceTo; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.index.Indices; + +public abstract class NdArrayTestBase { + + protected abstract NdArray allocate(Shape shape); + + protected abstract DataBuffer allocateBuffer(long size); + + protected abstract T valueOf(Long val); + + protected T zeroOrNull() { + return valueOf(0L); + } + + @Test + public void shapeAndSizes() { + Shape scalarShape = Shape.scalar(); + NdArray scalar = allocate(scalarShape); + assertEquals(scalarShape, scalar.shape()); + assertEquals(0, scalar.rank()); + assertEquals(scalarShape, Shape.of()); + + Shape vectorShape = Shape.of(10); + NdArray vector = allocate(vectorShape); + assertEquals(vectorShape, vector.shape()); + assertEquals(1, vector.rank()); + } + + @Test + public void setAndGetValues() { + NdArray matrix = allocate(Shape.of(5, 4)); + assertEquals(zeroOrNull(), matrix.getObject(3, 3)); + + matrix.setObject(valueOf(10L), 3, 3); + assertEquals(valueOf(10L), matrix.getObject(3, 3)); + try { + matrix.setObject(valueOf(10L), 3, 4); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.setObject(valueOf(10L), -1, 3); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.getObject(3); + fail(); + } catch (IllegalRankException e) { + // as expected + } + try { + matrix.setObject(valueOf(10L), 3); + fail(); + } catch (IllegalRankException e) { + // as expected + } + + NdArray matrix2 = + allocate(Shape.of(3, 2)) + .set(vectorOfObjects(valueOf(1L), valueOf(2L)), 0) + .set(vectorOfObjects(valueOf(3L), valueOf(4L)), 1) + .setObject(valueOf(5L), 2, 0) + .setObject(valueOf(6L), 2, 1); + + assertEquals(valueOf(1L), matrix2.getObject(0, 0)); + assertEquals(valueOf(2L), matrix2.getObject(0, 1)); + assertEquals(valueOf(3L), matrix2.getObject(1, 0)); + assertEquals(valueOf(4L), matrix2.getObject(1, 1)); + assertEquals(valueOf(5L), matrix2.getObject(2, 0)); + assertEquals(valueOf(6L), matrix2.getObject(2, 1)); + } + + @Test + public void iterateElements() { + NdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d + .scalars() + .forEachIndexed( + (coords, scalar) -> { + scalar.setObject(valueOf(coords[2])); + }); + + assertEquals(valueOf(0L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(1L), matrix3d.getObject(0, 0, 1)); + assertEquals(valueOf(4L), matrix3d.getObject(0, 0, 4)); + assertEquals(valueOf(2L), matrix3d.getObject(0, 1, 2)); + + matrix3d + .elements(1) + .forEach( + vector -> { + vector.set( + vectorOfObjects(valueOf(5L), valueOf(6L), valueOf(7L), valueOf(8L), valueOf(9L))); + }); + + assertEquals(valueOf(5L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(6L), matrix3d.getObject(0, 0, 1)); + assertEquals(valueOf(9L), matrix3d.getObject(0, 0, 4)); + assertEquals(valueOf(7L), matrix3d.getObject(0, 1, 2)); + + long value = 0L; + for (NdArray matrix : matrix3d.elements(0)) { + assertEquals(2L, matrix.shape().numDimensions()); + assertEquals(4L, matrix.shape().get(0)); + assertEquals(5L, matrix.shape().get(1)); + + for (NdArray vector : matrix.elements(0)) { + assertEquals(1L, vector.shape().numDimensions()); + assertEquals(5L, vector.shape().get(0)); + + for (NdArray scalar : vector.scalars()) { + assertEquals(0L, scalar.shape().numDimensions()); + scalar.setObject(valueOf(value++)); + try { + scalar.elements(0); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + } + } + assertEquals(valueOf(0L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(5L), matrix3d.getObject(0, 1, 0)); + assertEquals(valueOf(9L), matrix3d.getObject(0, 1, 4)); + assertEquals(valueOf(20L), matrix3d.getObject(1, 0, 0)); + assertEquals(valueOf(25L), matrix3d.getObject(1, 1, 0)); + assertEquals(valueOf(99L), matrix3d.getObject(4, 3, 4)); + } + + @Test + public void slices() { + NdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + T val100 = valueOf(100L); + matrix3d.setObject(val100, 1, 0, 0); + T val101 = valueOf(101L); + matrix3d.setObject(val101, 1, 0, 1); + + // Vector (1,0,*) + NdArray vector10X = matrix3d.get(1, 0); + assertEquals(Shape.of(5), vector10X.shape()); + assertEquals(val100, vector10X.getObject(0)); + assertEquals(val101, vector10X.getObject(1)); + + T val102 = valueOf(102L); + vector10X.setObject(val102, 2); + assertEquals(val102, vector10X.getObject(2)); + assertEquals(val102, matrix3d.getObject(1, 0, 2)); + + // Vector (*,0,0) + NdArray vectorX00 = matrix3d.slice(all(), at(0), at(0)); + assertEquals(Shape.of(5), vectorX00.shape()); + assertEquals(val100, vectorX00.getObject(1)); + T val200 = valueOf(200L); + vectorX00.setObject(val200, 2); + assertEquals(val200, vectorX00.getObject(2)); + assertEquals(val200, matrix3d.getObject(2, 0, 0)); + + // Vector (1,0,[2,0]) + NdArray vector10_20 = matrix3d.slice(at(1), at(0), seq(2, 0)); + assertEquals(vector10_20.shape(), Shape.of(2)); + assertEquals(val102, vector10_20.getObject(0)); + assertEquals(val100, vector10_20.getObject(1)); + + // Vector (1,0,[even]) + NdArray vector10_even = matrix3d.slice(at(1), at(0), even()); + assertEquals(vector10_even.shape(), Shape.of(3)); + assertEquals(val100, vector10_even.getObject(0)); + assertEquals(val102, vector10_even.getObject(1)); + + // Vector ([odd]) from vector (1,0,[even]) + NdArray vector10_even_odd = vector10_even.slice(odd()); + assertEquals(vector10_even_odd.shape(), Shape.of(1)); + assertEquals(val102, vector10_even_odd.getObject(0)); + + // Vector (1,0,[flip]) + NdArray vector10_flip = matrix3d.slice(at(1), at(0), flip()); + assertEquals(vector10_flip.shape(), Shape.of(5)); + assertEquals(val100, vector10_flip.getObject(4)); + assertEquals(val101, vector10_flip.getObject(3)); + + // Vector (1,0,[from 1]) from vector (1,0,*) + NdArray vector10_1toX = vector10X.slice(sliceFrom(1)); + assertEquals(vector10_1toX.shape(), Shape.of(4)); + assertEquals(val101, vector10_1toX.getObject(0)); + assertEquals(val102, vector10_1toX.getObject(1)); + + // Vector (1,0,[to 1]) from vector (1,0,*) + NdArray vector10_Xto1 = vector10X.slice(sliceTo(2)); + assertEquals(vector10_Xto1.shape(), Shape.of(2)); + assertEquals(val100, vector10_Xto1.getObject(0)); + assertEquals(val101, vector10_Xto1.getObject(1)); + + // Vector (1,0,[1 to 3]) + NdArray vector10_1to3 = matrix3d.slice(at(1), at(0), range(1, 3)); + assertEquals(vector10_1to3.shape(), Shape.of(2)); + assertEquals(val101, vector10_1to3.getObject(0)); + assertEquals(val102, vector10_1to3.getObject(1)); + + // Scalar (1,0,0) from vector (1,0,*) + NdArray scalar100 = vector10X.get(0); + assertEquals(Shape.of(), scalar100.shape()); + assertEquals(val100, scalar100.getObject()); + + // Slice scalar (1,0,z) + LongNdArray z = NdArrays.scalarOf(2L); + NdArray scalar102 = matrix3d.slice(at(1), at(0), at(z)); + assertEquals(scalar102.shape(), Shape.of()); + assertEquals(val102, scalar102.getObject()); + + // Slicing the 3D matrix so we only keep the first element of the second dimension + NdArray matrix_X0Z = matrix3d.slice(all(), at(0)); + assertEquals(2, matrix_X0Z.rank()); + assertEquals(Shape.of(5, 5), matrix_X0Z.shape()); + assertEquals(val100, matrix_X0Z.getObject(1, 0)); + assertEquals(val101, matrix_X0Z.getObject(1, 1)); + assertEquals(val200, matrix_X0Z.getObject(2, 0)); + } + + @Test + public void writeAndReadWithBuffers() { + DataBuffer buffer = allocateBuffer(15L); + for (long val = 0L; val < buffer.size(); ++val) { + buffer.setObject(valueOf(val), val); + } + NdArray matrix = allocate(Shape.of(3, 5)); + matrix.copyFrom(buffer); + assertEquals(valueOf(0L), matrix.getObject(0, 0)); + assertEquals(valueOf(4L), matrix.getObject(0, 4)); + assertEquals(valueOf(5L), matrix.getObject(1, 0)); + assertEquals(valueOf(10L), matrix.getObject(2, 0)); + assertEquals(valueOf(14L), matrix.getObject(2, 4)); + + matrix.setObject(valueOf(100L), 1, 0); + matrix.copyTo(buffer); + assertEquals(valueOf(0L), buffer.getObject(0)); + assertEquals(valueOf(4L), buffer.getObject(4)); + assertEquals(valueOf(100L), buffer.getObject(5)); + assertEquals(valueOf(10L), buffer.getObject(10)); + assertEquals(valueOf(14L), buffer.getObject(14)); + + try { + matrix.copyFrom(buffer.narrow(10)); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.copyTo(buffer.narrow(10)); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + } + + @Test + public void ndArrayCopies() { + NdArray matrixA = allocate(Shape.of(3, 5)); + + long value = 0L; + for (NdArray s : matrixA.scalars()) { + s.setObject(valueOf(value++)); + } + NdArray matrixB = allocate(Shape.of(3, 5)).setObject(valueOf(100L), 1, 0); + matrixA.copyTo(matrixB); + assertEquals(valueOf(0L), matrixB.getObject(0, 0)); + assertEquals(valueOf(4L), matrixB.getObject(0, 4)); + assertEquals(valueOf(5L), matrixB.getObject(1, 0)); + assertEquals(valueOf(10L), matrixB.getObject(2, 0)); + assertEquals(valueOf(14L), matrixB.getObject(2, 4)); + + NdArray matrixC = allocate(Shape.of(3, 4)); + try { + matrixA.copyTo(matrixC); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void equalsAndHashCode() { + NdArray array1 = allocate(Shape.of(2, 2)); + NdArray array2 = allocate(Shape.of(2, 2)); + NdArray array3 = allocate(Shape.of(2, 2)); + NdArray array4 = allocate(Shape.of(1, 2, 2)); + + @SuppressWarnings("unchecked") + T[][][] values = + (T[][][]) (new Object[][][] {{{valueOf(0L), valueOf(1L)}, {valueOf(2L), valueOf(0L)}}}); + + StdArrays.copyTo(values[0], array1); + StdArrays.copyTo(values[0], array2); + StdArrays.copyTo(values[0], array3); + array3.setObject(valueOf(0L), 0, 1); + StdArrays.copyTo(values, array4); + + assertEquals(array1, array2); + assertEquals(array1.hashCode(), array2.hashCode()); + assertNotEquals(array1, array3); + assertNotEquals(array1.hashCode(), array3.hashCode()); + assertNotEquals(array1, array4); + assertNotEquals(array1.hashCode(), array4.hashCode()); + } + + @Test + public void iterateScalarsOnSegmentedElements() { + NdArray originalTensor = allocate(Shape.of(2, 3)); + + originalTensor + .setObject(valueOf(0L), 0, 0) + .setObject(valueOf(1L), 0, 1) + .setObject(valueOf(2L), 0, 2) + .setObject(valueOf(3L), 1, 0) + .setObject(valueOf(4L), 1, 1) + .setObject(valueOf(5L), 1, 2); + + NdArray slice = originalTensor.slice(Indices.all(), Indices.sliceFrom(1)); + assertEquals(Shape.of(2, 2), slice.shape()); + + slice + .elements(0) + .forEachIndexed( + (eCoord, e) -> { + e.scalars() + .forEachIndexed( + (sCoord, s) -> { + assertEquals( + valueOf((eCoord[0] * originalTensor.shape().get(1)) + sCoord[0] + 1), + s.getObject()); + }); + }); + } + + @Test + public void streamingObjects() { + NdArray scalar = allocate(Shape.scalar()); + scalar.setObject(valueOf(1L)); + var values = scalar.streamOfObjects().collect(Collectors.toList()); + assertIterableEquals(List.of(valueOf(1L)), values); + + NdArray vector = allocate(Shape.of(5)); + vector.setObject(valueOf(1L), 0); + vector.setObject(valueOf(2L), 1); + vector.setObject(valueOf(3L), 2); + vector.setObject(valueOf(4L), 3); + vector.setObject(valueOf(5L), 4); + values = vector.streamOfObjects().collect(Collectors.toList()); + assertIterableEquals( + List.of(valueOf(1L), valueOf(2L), valueOf(3L), valueOf(4L), valueOf(5L)), values); + + NdArray matrix = allocate(Shape.of(2, 2)); + matrix.setObject(valueOf(1L), 0, 0); + matrix.setObject(valueOf(2L), 0, 1); + matrix.setObject(valueOf(3L), 1, 0); + matrix.setObject(valueOf(4L), 1, 1); + values = matrix.streamOfObjects().collect(Collectors.toList()); + assertIterableEquals(List.of(valueOf(1L), valueOf(2L), valueOf(3L), valueOf(4L)), values); + } + + @Test + public void withShape() { + Shape originalShape = Shape.scalar(); + Shape newShape = originalShape.prepend(1).prepend(1); // [1, 1] + + NdArray originalArray = allocate(originalShape); + originalArray.setObject(valueOf(10L)); + assertEquals(valueOf(10L), originalArray.getObject()); + + NdArray newArray = originalArray.withShape(newShape); + assertNotNull(newArray); + assertEquals(newShape, newArray.shape()); + assertEquals(originalShape, originalArray.shape()); + assertEquals(valueOf(10L), newArray.getObject(0, 0)); + + NdArray sameArray = originalArray.withShape(Shape.scalar()); + assertSame(originalArray, sameArray); + + assertThrows(IllegalArgumentException.class, () -> originalArray.withShape(Shape.of(2))); + assertThrows(IllegalArgumentException.class, () -> originalArray.withShape(Shape.unknown())); + + NdArray originalMatrix = allocate(Shape.of(2, 3)); + assertThrows(IllegalArgumentException.class, () -> originalMatrix.withShape(Shape.scalar())); + NdArray newMatrix = originalMatrix.withShape(Shape.of(3, 2)); + assertEquals(Shape.of(3, 2), newMatrix.shape()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShapeTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShapeTest.java new file mode 100644 index 00000000000..f6bec66cb25 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShapeTest.java @@ -0,0 +1,176 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import org.junit.jupiter.api.Test; + +public class ShapeTest { + + @Test + public void allKnownDimensions() { + Shape shape = Shape.of(5, 4, 5); + assertEquals(3, shape.numDimensions()); + assertEquals(5, shape.get(0)); + assertEquals(4, shape.get(1)); + assertEquals(5, shape.get(2)); + assertEquals(100, shape.size()); + assertArrayEquals(new long[] {5, 4, 5}, shape.asArray()); + try { + shape.get(3); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + assertEquals(5, shape.get(-1)); + assertEquals(4, shape.get(-2)); + assertEquals(5, shape.get(-3)); + try { + shape.get(-4); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + assertFalse(shape.isUnknown()); + assertFalse(shape.hasUnknownDimension()); + assertFalse(shape.isScalar()); + } + + @Test + public void hashCodeEquals() { + Shape shape1 = Shape.of(5, 4, 5); + Shape shape2 = Shape.of(5, 4, 5); + Shape shape3 = Shape.of(5, 4, 5, 6); + Shape shape4 = Shape.of(5, 4, 1); + + assertEquals(shape1, shape2); + assertEquals(shape1.hashCode(), shape2.hashCode()); + assertNotEquals(shape1, shape3); + assertNotEquals(shape1.hashCode(), shape3.hashCode()); + assertNotEquals(shape1, shape4); + assertNotEquals(shape1.hashCode(), shape4.hashCode()); + + Shape scalar1 = Shape.of(); + Shape scalar2 = Shape.of(); + assertEquals(scalar1, scalar2); + assertNotEquals(scalar1, shape1); + + Shape unknown1 = Shape.of(-1, 4, 5); + Shape unknown2 = Shape.of(-1, 4, 5); + assertNotEquals(unknown1, unknown2); + assertNotEquals(unknown1, shape1); + assertEquals(unknown1, unknown1); + + Shape sizeUnknown1 = Shape.unknown(); + Shape sizeUnknown2 = Shape.unknown(); + assertNotEquals(sizeUnknown1, sizeUnknown2); + assertEquals(sizeUnknown1, sizeUnknown1); + } + + @Test + public void testShapeModification() { + Shape one = Shape.of(2, 4, 6, 8); + assertEquals(one.head(), Shape.of(2)); + assertEquals(one.tail(), Shape.of(4, 6, 8)); + + Shape two = Shape.of(5); + assertEquals(two.head(), two); + assertEquals(two.tail(), Shape.of()); + + try { + Shape.of().head(); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + + assertEquals(Shape.of().tail(), Shape.of()); + + Shape three = Shape.of(2, 4, 6); + assertEquals(three.prepend(5), Shape.of(5, 2, 4, 6)); + + assertEquals(Shape.of(5, 2, 4, 6), two.append(three)); + assertEquals(Shape.of(2, 4, 6, 5), two.prepend(three)); + assertEquals(Shape.of(1, 2, 3, 4), Shape.of(1, 2).append(Shape.of(3, 4))); + assertEquals(Shape.of(1, 2, 3, 4), Shape.of(1, 2, 3).append(4)); + assertEquals(Shape.of(1, 2, 3, 4), Shape.of(1, 2, 3, 4).append(Shape.scalar())); + assertEquals(Shape.of(3, 4, 1, 2), Shape.of(1, 2).prepend(Shape.of(3, 4))); + assertEquals(Shape.of(4, 6), three.takeLast(2)); + assertEquals(Shape.scalar(), three.takeLast(0)); + assertEquals(Shape.of(2, 4), three.take(2)); + assertEquals(Shape.scalar(), three.take(0)); + + try { + Shape.unknown().append(Shape.of(1, 2)); + fail(); + } catch (NullPointerException e) { + // as expected + } + + try { + Shape.unknown().prepend(Shape.of(1, 2)); + fail(); + } catch (NullPointerException e) { + // as expected + } + + // changing the values of the array returned by asArray should not mutate the shape + long[] internalShape = one.asArray(); + assertNotNull(internalShape); + internalShape[0] = 42L; + assertEquals(2L, one.get(0)); + } + + @Test + public void testShapeCompatible() { + Shape a = Shape.unknown(); + Shape b = Shape.of(2, 2); + assertTrue(a.isCompatibleWith(b)); + assertTrue(b.isCompatibleWith(a)); + + a = Shape.of(2, 2); + assertTrue(a.isCompatibleWith(b)); + assertTrue(b.isCompatibleWith(a)); + + a = Shape.of(2, -1); + assertTrue(a.isCompatibleWith(b)); + assertTrue(b.isCompatibleWith(a)); + + a = Shape.of(-1, 2); + assertTrue(a.isCompatibleWith(b)); + assertTrue(b.isCompatibleWith(a)); + + a = Shape.of(-1, -1); + assertTrue(a.isCompatibleWith(b)); + assertTrue(b.isCompatibleWith(a)); + + a = Shape.of(1, 2); + assertFalse(a.isCompatibleWith(b)); + assertFalse(b.isCompatibleWith(a)); + + a = Shape.of(1, 2, 3); + assertFalse(a.isCompatibleWith(b)); + assertFalse(b.isCompatibleWith(a)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java new file mode 100644 index 00000000000..347ac7a7b6a --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/ShortNdArrayTestBase.java @@ -0,0 +1,56 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public abstract class ShortNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract ShortNdArray allocate(Shape shape); + + @Override + protected Short valueOf(Long val) { + return val.shortValue(); + } + + @Test + public void iteratePrimitiveElements() { + ShortNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> scalar.setShort((short) coords[2])); + + assertEquals(0, matrix3d.getShort(0, 0, 0)); + assertEquals(1, matrix3d.getShort(0, 0, 1)); + assertEquals(4, matrix3d.getShort(0, 0, 4)); + assertEquals(2, matrix3d.getShort(0, 1, 2)); + + matrix3d + .elements(1) + .forEach( + vector -> + vector.set( + NdArrays.vectorOf((short) 5, (short) 6, (short) 7, (short) 8, (short) 9))); + + assertEquals(5, matrix3d.getShort(0, 0, 0)); + assertEquals(6, matrix3d.getShort(0, 0, 1)); + assertEquals(9, matrix3d.getShort(0, 0, 4)); + assertEquals(7, matrix3d.getShort(0, 1, 2)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/SparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/SparseNdArrayTest.java new file mode 100644 index 00000000000..9c001dbaf80 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/SparseNdArrayTest.java @@ -0,0 +1,196 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.sparse.BooleanSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.ByteSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.DoubleSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.FloatSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.IntSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.LongSparseNdArray; +import org.tensorflow.ndarray.impl.sparse.ShortSparseNdArray; + +public class SparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}, {2, 3}}; + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + Shape shape = Shape.of(3, 4); + double epsilon = 0.001; + + @Test + public void testBoolean() { + BooleanSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf(true, true, true), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertTrue(instance.getBoolean(0, 0)); + assertFalse(instance.getBoolean(0, 1)); + assertFalse(instance.getBoolean(0, 2)); + assertFalse(instance.getBoolean(0, 3)); + + assertFalse(instance.getBoolean(1, 0)); + assertFalse(instance.getBoolean(1, 1)); + assertTrue(instance.getBoolean(1, 2)); + assertFalse(instance.getBoolean(1, 3)); + + assertFalse(instance.getBoolean(2, 0)); + assertFalse(instance.getBoolean(2, 1)); + assertFalse(instance.getBoolean(2, 2)); + assertTrue(instance.getBoolean(2, 3)); + } + + @Test + public void testByte() { + ByteSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf((byte) 1, (byte) 18, (byte) 0xff), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals((byte) 1, instance.getByte(0, 0)); + assertEquals((byte) 0, instance.getByte(0, 1)); + assertEquals((byte) 0, instance.getByte(0, 2)); + assertEquals((byte) 0, instance.getByte(0, 3)); + + assertEquals((byte) 0, instance.getByte(1, 0)); + assertEquals((byte) 0, instance.getByte(1, 1)); + assertEquals((byte) 18, instance.getByte(1, 2)); + assertEquals((byte) 0, instance.getByte(1, 3)); + + assertEquals((byte) 0, instance.getByte(2, 0)); + assertEquals((byte) 0, instance.getByte(2, 1)); + assertEquals((byte) 0, instance.getByte(2, 2)); + assertEquals((byte) 0xff, instance.getByte(2, 3)); + } + + @Test + public void testDouble() { + DoubleSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf(1., 1.8, 3.14), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals(1., instance.getDouble(0, 0), epsilon); + assertEquals(0, instance.getDouble(0, 1), epsilon); + assertEquals(0, instance.getDouble(0, 2), epsilon); + assertEquals(0, instance.getDouble(0, 3), epsilon); + + assertEquals(0, instance.getDouble(1, 0), epsilon); + assertEquals(0, instance.getDouble(1, 1), epsilon); + assertEquals(1.8, instance.getDouble(1, 2), epsilon); + assertEquals(0, instance.getDouble(1, 3), epsilon); + + assertEquals(0, instance.getDouble(2, 0), epsilon); + assertEquals(0, instance.getDouble(2, 1), epsilon); + assertEquals(0, instance.getDouble(2, 2), epsilon); + assertEquals(3.14, instance.getDouble(2, 3), epsilon); + } + + @Test + public void testFloat() { + FloatSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf(1.f, 1.8f, 3.14f), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals(1.f, instance.getFloat(0, 0), epsilon); + assertEquals(0f, instance.getFloat(0, 1), epsilon); + assertEquals(0f, instance.getFloat(0, 2), epsilon); + assertEquals(0f, instance.getFloat(0, 3), epsilon); + + assertEquals(0f, instance.getFloat(1, 0), epsilon); + assertEquals(0f, instance.getFloat(1, 1), epsilon); + assertEquals(1.8f, instance.getFloat(1, 2), epsilon); + assertEquals(0f, instance.getFloat(1, 3), epsilon); + + assertEquals(0f, instance.getFloat(2, 0), epsilon); + assertEquals(0f, instance.getFloat(2, 1), epsilon); + assertEquals(0f, instance.getFloat(2, 2), epsilon); + assertEquals(3.14f, instance.getFloat(2, 3), epsilon); + } + + @Test + public void testInt() { + IntSparseNdArray instance = NdArrays.sparseOf(indices, NdArrays.vectorOf(1, 18, 256), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals(1, instance.getInt(0, 0)); + assertEquals(0, instance.getInt(0, 1)); + assertEquals(0, instance.getInt(0, 2)); + assertEquals(0, instance.getInt(0, 3)); + + assertEquals(0, instance.getInt(1, 0)); + assertEquals(0, instance.getInt(1, 1)); + assertEquals(18, instance.getInt(1, 2)); + assertEquals(0, instance.getInt(1, 3)); + + assertEquals(0, instance.getInt(2, 0)); + assertEquals(0, instance.getInt(2, 1)); + assertEquals(0, instance.getInt(2, 2)); + assertEquals(256, instance.getInt(2, 3)); + } + + @Test + public void testLong() { + LongSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf(1L, 18L, 256L), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals(1L, instance.getLong(0, 0)); + assertEquals(0L, instance.getLong(0, 1)); + assertEquals(0L, instance.getLong(0, 2)); + assertEquals(0L, instance.getLong(0, 3)); + + assertEquals(0L, instance.getLong(1, 0)); + assertEquals(0L, instance.getLong(1, 1)); + assertEquals(18, instance.getLong(1, 2)); + assertEquals(0L, instance.getLong(1, 3)); + + assertEquals(0L, instance.getLong(2, 0)); + assertEquals(0L, instance.getLong(2, 1)); + assertEquals(0L, instance.getLong(2, 2)); + assertEquals(256L, instance.getLong(2, 3)); + } + + @Test + public void testShort() { + ShortSparseNdArray instance = + NdArrays.sparseOf(indices, NdArrays.vectorOf((short) 1, (short) 18, (short) 0xff00), shape); + assertEquals(6, instance.getIndices().size()); + assertEquals(3, instance.getValues().size()); + assertEquals((short) 1, instance.getShort(0, 0)); + assertEquals((short) 0, instance.getShort(0, 1)); + assertEquals((short) 0, instance.getShort(0, 2)); + assertEquals((short) 0, instance.getShort(0, 3)); + + assertEquals((short) 0, instance.getShort(1, 0)); + assertEquals((short) 0, instance.getShort(1, 1)); + assertEquals((short) 18, instance.getShort(1, 2)); + assertEquals((short) 0, instance.getShort(1, 3)); + + assertEquals((short) 0, instance.getShort(2, 0)); + assertEquals((short) 0, instance.getShort(2, 1)); + assertEquals((short) 0, instance.getShort(2, 2)); + assertEquals((short) 0xff00, instance.getShort(2, 3)); + } + + @Test + public void withShape() { + NdArray sparseArray = NdArrays.sparseOf(indices, NdArrays.vectorOf(1, 2, 3), shape); + assertThrows( + UnsupportedOperationException.class, () -> sparseArray.withShape(shape.prepend(1))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/StdArraysTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/StdArraysTest.java new file mode 100644 index 00000000000..7b1c9663a39 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/StdArraysTest.java @@ -0,0 +1,211 @@ +package org.tensorflow.ndarray; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; + +import org.junit.jupiter.api.Test; + +public class StdArraysTest { + + @Test + public void vectors() { + IntNdArray vector = NdArrays.ofInts(Shape.of(2)); + + StdArrays.copyTo(new int[] {1, 2}, vector); + assertEquals(1, vector.getInt(0)); + assertEquals(2, vector.getInt(1)); + + try { + StdArrays.copyTo(new int[] {1, 2, 3}, vector); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyTo(new int[] {1, 2}, NdArrays.ofInts(Shape.of(4))); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyTo(new int[] {1, 2}, NdArrays.ofInts(Shape.of(2, 2))); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + + int[] array = StdArrays.array1dCopyOf(vector); + assertEquals(1, array[0]); + assertEquals(2, array[1]); + + array = new int[3]; + StdArrays.copyFrom(vector, array); + assertEquals(1, array[0]); + assertEquals(2, array[1]); + assertEquals(0, array[2]); + + try { + StdArrays.copyFrom(vector, new int[1]); + fail(); + } catch (ArrayIndexOutOfBoundsException e) { + // as expected + } + try { + StdArrays.copyFrom(vector, new int[1][2]); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyFrom(vector, new int[2][2][2]); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void matrices() { + IntNdArray matrix = NdArrays.ofInts(Shape.of(2, 2)); + + StdArrays.copyTo( + new int[][] { + {1, 2}, + {3, 4} + }, + matrix); + assertEquals(1, matrix.getInt(0, 0)); + assertEquals(2, matrix.getInt(0, 1)); + assertEquals(3, matrix.getInt(1, 0)); + assertEquals(4, matrix.getInt(1, 1)); + try { + StdArrays.copyTo(new int[][] {{1, 2, 3}, {4, 5, 6}}, matrix); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyTo(new int[][] {{1, 2}, {3, 4}}, NdArrays.ofInts(Shape.of(3, 3))); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyTo(new int[][] {{1, 2}, {3, 4}}, NdArrays.ofInts(Shape.of(2, 2, 1))); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + + int[][] array = StdArrays.array2dCopyOf(matrix); + assertEquals(1, array[0][0]); + assertEquals(2, array[0][1]); + assertEquals(3, array[1][0]); + assertEquals(4, array[1][1]); + + array = new int[3][3]; + StdArrays.copyFrom(matrix, array); + assertArrayEquals(new int[] {1, 2, 0}, array[0]); + assertArrayEquals(new int[] {3, 4, 0}, array[1]); + assertArrayEquals(new int[] {0, 0, 0}, array[2]); + + try { + StdArrays.copyFrom(matrix, new int[1][2]); + fail(); + } catch (ArrayIndexOutOfBoundsException e) { + // as expected + } + try { + StdArrays.copyFrom(matrix, new int[2][1]); + fail(); + } catch (ArrayIndexOutOfBoundsException e) { + // as expected + } + try { + StdArrays.copyFrom(matrix, new int[2]); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyFrom(matrix, new int[1][2][2]); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + StdArrays.copyFrom(matrix, new int[2][2][2]); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void objectMatrix() { + NdArray matrix = StdArrays.ndCopyOf(new String[][] {{"ab", "bc"}, {"cd", "de"}}); + assertEquals(NdArrays.vectorOfObjects("ab", "bc"), matrix.get(0)); + assertEquals(NdArrays.vectorOfObjects("cd", "de"), matrix.get(1)); + + String[][] array = StdArrays.array2dCopyOf(matrix, String.class); + assertEquals("ab", array[0][0]); + assertEquals("bc", array[0][1]); + assertEquals("cd", array[1][0]); + assertEquals("de", array[1][1]); + + array = new String[2][3]; + StdArrays.copyFrom(matrix, array); + assertEquals("ab", array[0][0]); + assertEquals("bc", array[0][1]); + assertNull(array[0][2]); + assertEquals("cd", array[1][0]); + assertEquals("de", array[1][1]); + assertNull(array[1][2]); + } + + @Test + public void cannotInitDenseMatrixWithRaggedArray() { + IntNdArray matrix = NdArrays.ofInts(Shape.of(2, 2)); + try { + StdArrays.copyTo( + new int[][] { + {1, 2}, + {3} + }, + matrix); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void computeShapeDense3DMatrix() { + Shape shape = + StdArrays.shapeOf( + new int[][][] { + {{1, 2, 3}, {4, 5, 6}}, + {{1, 2, 3}, {4, 5, 6}} + }); + assertArrayEquals(new long[] {2, 2, 3}, shape.asArray()); + } + + @Test + public void shapeOfRagged3DMatrix() { + Shape shape = + StdArrays.shapeOf( + new int[][][] { + {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, + {{1, 2, 3}, {4, 5, 6}} + }); + assertArrayEquals(new long[] {2, Shape.UNKNOWN_SIZE, 3}, shape.asArray()); + } + + @Test + public void shapeOfEmptyArray() { + Shape shape = StdArrays.shapeOf(new int[2][2][3]); + assertArrayEquals(new long[] {2, 2, 3}, shape.asArray()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java new file mode 100644 index 00000000000..5dbb5b034eb --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/benchmark/NdArrayBenchmark.java @@ -0,0 +1,171 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.benchmark; + +import static org.tensorflow.ndarray.index.Indices.all; +import static org.tensorflow.ndarray.index.Indices.at; + +import java.awt.image.BufferedImage; +import java.awt.image.Raster; +import java.io.IOException; +import javax.imageio.ImageIO; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.runner.RunnerException; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; + +@Fork( + value = 1, + jvmArgs = {"-Xms4G", "-Xmx4G"}) +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 3) +@Measurement(iterations = 5) +@State(Scope.Benchmark) +public class NdArrayBenchmark { + + public static void main(String[] args) throws IOException, RunnerException { + org.openjdk.jmh.Main.main(args); + } + + @Setup + public void setUp() throws IOException { + BufferedImage image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(TEST_IMAGE)); + + int numPixels = image.getWidth() * image.getHeight(); + pixels = NdArrays.ofFloats(Shape.of(numPixels, 3)); + channels = NdArrays.ofFloats(Shape.of(3, numPixels)); + + Raster imageData = image.getData(); + float[] pixel = new float[3]; + for (int y = 0, pixelIdx = 0; y < image.getHeight(); ++y) { + for (int x = 0; x < image.getWidth(); ++x, ++pixelIdx) { + imageData.getPixel(x, y, pixel); + StdArrays.copyTo(pixel, pixels.get(pixelIdx)); + StdArrays.copyTo(pixel, channels.slice(all(), at(pixelIdx))); + } + } + batches = NdArrays.ofFloats(Shape.of(BATCH_SIZE, 3, numPixels)); + firstBatch = batches.get(0); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void getElementAtIndex() { + pixels.get(0); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void slicing() { + batches.slice(at(0), all(), at(0)); + } + + @Benchmark + public void readingAllPixelsChannelsBySequence() { + pixels.scalars().forEach(pixel -> pixel.getFloat()); + } + + @Benchmark + public void readingAllPixelsChannelsBySequenceSlices() { + pixels.scalars().asSlices().forEach(pixel -> pixel.getFloat()); + } + + @Benchmark + @Measurement(batchSize = 100) + public void readingAllPixelsChannelsByIndex() { + long[] shape = pixels.shape().asArray(); + for (int i = 0; i < shape[0]; ++i) { + for (int j = 0; j < shape[1]; ++j) { + pixels.getFloat(i, j); + } + } + } + + @Benchmark + @Measurement(batchSize = BATCH_SIZE) + public void writeFirstBatchChannels() { + firstBatch.set(channels); + } + + @Benchmark + public void writeAllBatchChannels() { + batches.elements(0).forEach(batch -> batch.set(channels)); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void writeOnePixelBySlicing() { + batches.slice(at(0), all(), at(0)).set(pixels.get(0)); + } + + @Benchmark + public void writeAllPixelsBySlicing() { + batches + .elements(0) + .forEach( + batch -> + pixels + .elements(0) + .forEachIndexed( + (coords, pixel) -> batch.slice(all(), at(coords[0])).set(pixel))); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void writeOnePixelsByIndex() { + batches + .setFloat(pixels.getFloat(0, 0), 0, 0, 0) + .setFloat(pixels.getFloat(0, 1), 0, 1, 0) + .setFloat(pixels.getFloat(0, 2), 0, 2, 0); + } + + @Benchmark + public void writeAllPixelsByIndex() { + batches + .elements(0) + .forEach( + batch -> + pixels + .elements(0) + .forEachIndexed( + (coords, pixel) -> { + long pixelIndex = coords[0]; + batch + .setFloat(pixel.getFloat(0), 0, pixelIndex) + .setFloat(pixel.getFloat(1), 1, pixelIndex) + .setFloat(pixel.getFloat(2), 2, pixelIndex); + })); + } + + private static final String TEST_IMAGE = "castle.jpg"; + private static final int BATCH_SIZE = 60; + + private FloatNdArray pixels; + private FloatNdArray channels; + private FloatNdArray batches; + private FloatNdArray firstBatch; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java new file mode 100644 index 00000000000..e1d522e689f --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/BooleanDataBufferTestBase.java @@ -0,0 +1,134 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.BitSet; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; + +public abstract class BooleanDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract BooleanDataBuffer allocate(long size); + + @Override + protected Boolean valueOf(Long val) { + return val != 0; + } + + @Test + public void writeAndReadFromArray() { + BooleanDataBuffer buffer = allocate(10L); + boolean[] values = new boolean[] {true, false, false, true, false}; + + buffer.write(values); + assertTrue(buffer.getObject(0)); + assertFalse(buffer.getObject(1)); + + buffer.offset(5).write(values); + assertTrue(buffer.getObject(5)); + + boolean[] read = new boolean[5]; + buffer.read(read); + assertArrayEquals(values, read); + + buffer.write(values, 2, 3); + assertFalse(buffer.getObject(0)); + assertTrue(buffer.getObject(1)); + assertFalse(buffer.getObject(2)); + + Arrays.fill(read, false); + buffer.read(read, 1, 2); + assertFalse(read[0]); + assertFalse(read[1]); + assertTrue(read[2]); + assertFalse(read[3]); + } + + @Test + public void equalWithBitSetBuffer() { + BitSet bitSet1 = BitSet.valueOf(new byte[] {0x01, 0x01}); + BooleanDataBuffer bitSet1Buffer = MiscDataBufferFactory.create(bitSet1, 12, true); + + BitSet bitSet2 = BitSet.valueOf(new byte[] {0x11, 0x01}); + BooleanDataBuffer bitSet2Buffer = MiscDataBufferFactory.create(bitSet2, 12, true); + + BooleanDataBuffer buffer = allocate(12).setBoolean(true, 0).setBoolean(true, 8); + + assertTrue(bitSet1Buffer.equals(buffer)); + assertTrue(buffer.equals(bitSet1Buffer)); + assertEquals(bitSet1Buffer.hashCode(), buffer.hashCode()); + + assertFalse(bitSet2Buffer.equals(buffer)); + assertFalse(buffer.equals(bitSet2Buffer)); + assertNotEquals(bitSet2Buffer.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithBooleanArrayBuffer() { + boolean[] array1 = new boolean[] {false, false, false, true, true, false}; + BooleanDataBuffer array1Buffer = MiscDataBufferFactory.create(array1, true); + + boolean[] array2 = new boolean[] {false, false, false, true, true, true}; + BooleanDataBuffer array2Buffer = MiscDataBufferFactory.create(array2, true); + + BooleanDataBuffer buffer = allocate(6).setBoolean(true, 3).setBoolean(true, 4); + + assertTrue(array1Buffer.equals(buffer)); + assertTrue(buffer.equals(array1Buffer)); + assertEquals(array1Buffer.hashCode(), buffer.hashCode()); + + assertFalse(array2Buffer.equals(buffer)); + assertFalse(buffer.equals(array2Buffer)); + assertNotEquals(array2Buffer.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithBooleanObjectBuffer() { + Boolean[] array1 = new Boolean[] {false, false, false, true, true, false}; + DataBuffer array1Buffer = MiscDataBufferFactory.create(array1, true); + + boolean[] array2 = new boolean[] {false, false, false, true, true, true}; + DataBuffer array2Buffer = MiscDataBufferFactory.create(array2, true); + + BooleanDataBuffer buffer = allocate(6).setBoolean(true, 3).setBoolean(true, 4); + + assertTrue(array1Buffer.equals(buffer)); + assertTrue(buffer.equals(array1Buffer)); + assertEquals(array1Buffer.hashCode(), buffer.hashCode()); + + assertFalse(array2Buffer.equals(buffer)); + assertFalse(buffer.equals(array2Buffer)); + assertNotEquals(array2Buffer.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + BooleanDataBuffer buffer = allocate(2).setBoolean(false, 0).setBoolean(true, 1); + ByteDataBuffer byteBuffer = DataBuffers.of((byte) 0, (byte) 1); + + assertFalse(buffer.equals(byteBuffer)); + assertFalse(byteBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java new file mode 100644 index 00000000000..59f27cabfae --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ByteDataBufferTestBase.java @@ -0,0 +1,139 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class ByteDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract ByteDataBuffer allocate(long size); + + @Override + protected Byte valueOf(Long val) { + return val.byteValue(); + } + + @Test + public void writeAndReadFromArray() { + ByteDataBuffer buffer = allocate(10L); + byte[] oneToFive = new byte[] {1, 2, 3, 4, 5}; + + buffer.write(oneToFive); + assertEquals(2, buffer.getByte(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getByte(1)); + assertEquals(2, buffer.getByte(6)); + + byte[] read = new byte[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getByte(0)); + assertEquals(4, buffer.getByte(1)); + assertEquals(3, buffer.getByte(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } + + @Test + public void equalWithByteNioBuffer() { + ByteDataBuffer nioBuffer1 = + NioDataBufferFactory.create(ByteBuffer.wrap(new byte[] {0x01, 0x10})); + ByteDataBuffer nioBuffer2 = + NioDataBufferFactory.create(ByteBuffer.wrap(new byte[] {0x01, 0x11})); + + ByteDataBuffer buffer = allocate(2).setByte((byte) 0x01, 0).setByte((byte) 0x10, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithByteRawBuffer() { + ByteDataBuffer rawBuffer1 = RawDataBufferFactory.create(new byte[] {0x01, 0x10}, true); + ByteDataBuffer rawBuffer2 = RawDataBufferFactory.create(new byte[] {0x01, 0x11}, true); + + ByteDataBuffer buffer = allocate(2).setByte((byte) 0x01, 0).setByte((byte) 0x10, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithByteObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Byte[] {0x01, 0x10}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Byte[] {0x01, 0x11}, true); + + ByteDataBuffer buffer = allocate(2).setByte((byte) 0x01, 0).setByte((byte) 0x10, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + ByteDataBuffer buffer = allocate(2).setByte((byte) 1, 0).setByte((byte) 16, 1); + LongDataBuffer longBuffer = DataBuffers.of(1L, 16L); + + assertFalse(buffer.equals(longBuffer)); + assertFalse(longBuffer.equals(buffer)); + + try { + IntDataBuffer intBuffer = buffer.asInts(); + + assertFalse(buffer.equals(intBuffer)); + assertFalse(intBuffer.equals(buffer)); + + } catch (IllegalStateException e) { + // some byte buffers cannot be converted to ints, ignore the test in that case + } + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DataBufferTestBase.java new file mode 100644 index 00000000000..46ec6520210 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DataBufferTestBase.java @@ -0,0 +1,281 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.jupiter.api.Test; + +public abstract class DataBufferTestBase { + + protected final boolean enableLargeBufferTests = System.getProperty("testLargeBuffers") != null; + + protected long maxSize() { + return DataBuffers.MAX_32BITS; + } + + protected abstract DataBuffer allocate(long size); + + protected abstract T valueOf(Long val); + + @Test + public void bufferSize() { + DataBuffer buffer = allocate(10L); + assertEquals(10L, buffer.size()); + + buffer = allocate(0L); + assertEquals(0L, buffer.size()); + + if (enableLargeBufferTests) { + buffer = allocate(maxSize()); + assertEquals(maxSize(), buffer.size()); + } + } + + @Test + public void offsetNarrowAndSlice() { + DataBuffer buffer = allocate(10L).setObject(valueOf(1L), 5); // 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 + assertEquals(10L, buffer.size()); + assertEquals(valueOf(1L), buffer.getObject(5)); + + DataBuffer subBuffer = buffer.slice(2, 6); // 0, 0, 0, 1, 0, 0 + assertEquals(6L, subBuffer.size()); + assertEquals(valueOf(1L), subBuffer.getObject(3)); + + subBuffer = subBuffer.offset(2L); // 0, 1, 0, 0 + assertEquals(4L, subBuffer.size()); + assertEquals(valueOf(1L), subBuffer.getObject(1)); + + subBuffer = subBuffer.narrow(2L); // 0, 1 + assertEquals(2L, subBuffer.size()); + assertEquals(valueOf(1L), subBuffer.getObject(1)); + try { + subBuffer.getObject(2); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.slice(2, 12); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.slice(-1, 3); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.slice(2, -1); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.offset(-1L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.offset(11L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.narrow(-1L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.narrow(11L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void putAndGet() { + DataBuffer buffer = allocate(10L); + + buffer.setObject(valueOf(5L), 5L); + assertEquals(valueOf(5L), buffer.getObject(5L)); + try { + buffer.setObject(valueOf(10L), 10L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.getObject(10L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.setObject(valueOf(-1L), -1L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.getObject(-1L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } + + @Test + public void copyToBuffer() { + DataBuffer srcBuffer = allocate(25L); + srcBuffer.setObject(valueOf(5L), 5L); + srcBuffer.setObject(valueOf(10L), 10L); + srcBuffer.setObject(valueOf(15L), 15L); + srcBuffer.setObject(valueOf(20L), 20L); + try { + srcBuffer.copyTo(srcBuffer, srcBuffer.size()); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + DataBuffer dstBuffer = allocate(30L); + srcBuffer.copyTo(dstBuffer, srcBuffer.size()); + assertEquals(valueOf(5L), dstBuffer.getObject(5L)); + try { + srcBuffer.copyTo(dstBuffer, dstBuffer.size()); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + dstBuffer.copyTo(srcBuffer, dstBuffer.size()); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + } + + @Test + public void createFromVarargs() { + DataBuffer buffer = DataBuffers.ofObjects(valueOf(1L), valueOf(2L), valueOf(3L)); + assertEquals(3, buffer.size()); + assertEquals(valueOf(1L), buffer.getObject(0)); + assertEquals(valueOf(2L), buffer.getObject(1)); + assertEquals(valueOf(3L), buffer.getObject(2)); + } + + @Test + public void equalWithObjectBuffer() { + DataBuffer buffer1 = allocate(2).setObject(valueOf(0L), 0).setObject(valueOf(1L), 1); + DataBuffer buffer2 = allocate(2).setObject(valueOf(0L), 0).setObject(valueOf(1L), 1); + DataBuffer buffer3 = allocate(2).setObject(valueOf(1L), 0).setObject(valueOf(0L), 1); + DataBuffer buffer4 = allocate(1).setObject(valueOf(0L), 0); + DataBuffer buffer5 = + allocate(3).setObject(valueOf(0L), 0).setObject(valueOf(1L), 1).setObject(valueOf(2L), 2); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer1.hashCode()); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer3.equals(buffer1)); + assertFalse(buffer1.equals(buffer3)); + assertNotEquals(buffer3.hashCode(), buffer1.hashCode()); + + assertFalse(buffer4.equals(buffer1)); + assertFalse(buffer1.equals(buffer4)); + assertNotEquals(buffer4.hashCode(), buffer1.hashCode()); + + assertFalse(buffer5.equals(buffer1)); + assertFalse(buffer1.equals(buffer5)); + assertNotEquals(buffer5.hashCode(), buffer1.hashCode()); + } + + @Test + public void bufferWindow() { + DataBuffer buffer = allocate(20); + DataBufferWindow> bufferWindow; + try { + bufferWindow = buffer.window(4); + } catch (UnsupportedOperationException e) { + return; // skip test if this buffer does not support windows + } + assertEquals(0, bufferWindow.offset()); + assertEquals(4, bufferWindow.size()); + assertEquals(4, bufferWindow.buffer().size()); + + for (long i = 0; i < buffer.size(); ++i) { + buffer.setObject(valueOf(i), i); + } + assertEquals(valueOf(2L), bufferWindow.buffer().getObject(2)); + DataBuffer windowBuffer = bufferWindow.buffer(); + + bufferWindow.slide(10); + assertEquals(10, bufferWindow.offset()); + assertEquals(4, bufferWindow.size()); + assertEquals(valueOf(12L), bufferWindow.buffer().getObject(2)); + assertSame(windowBuffer, bufferWindow.buffer()); + + bufferWindow.slide(-2); + assertEquals(8, bufferWindow.offset()); + assertEquals(4, bufferWindow.size()); + assertEquals(valueOf(10L), bufferWindow.buffer().getObject(2)); + + bufferWindow.slideTo(16); + assertEquals(16, bufferWindow.offset()); + assertEquals(4, bufferWindow.size()); + assertEquals(valueOf(18L), bufferWindow.buffer().getObject(2)); + + try { + bufferWindow.slide(1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + bufferWindow.slide(-17); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + bufferWindow.slideTo(-1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + bufferWindow.slideTo(17); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java new file mode 100644 index 00000000000..c09badfc415 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/DoubleDataBufferTestBase.java @@ -0,0 +1,129 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.DoubleBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class DoubleDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract DoubleDataBuffer allocate(long size); + + @Override + protected Double valueOf(Long val) { + return val.doubleValue(); + } + + @Test + public void writeAndReadFromArray() { + DoubleDataBuffer buffer = allocate(10L); + double[] oneToFive = new double[] {1.0, 2.0, 3.0, 4.0, 5.0}; + + buffer.write(oneToFive); + assertEquals(2.0, buffer.getDouble(1), 0.0); + + buffer.offset(5).write(oneToFive); + assertEquals(2.0, buffer.getDouble(1), 0.0); + assertEquals(2.0, buffer.getDouble(6), 0.0); + + double[] read = new double[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read, 0.0); + + buffer.write(oneToFive, 2, 2); + assertEquals(3.0, buffer.getDouble(0), 0.0); + assertEquals(4.0, buffer.getDouble(1), 0.0); + assertEquals(3.0, buffer.getDouble(2), 0.0); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0.0, read[0], 0.0); + assertEquals(3.0, read[1], 0.0); + assertEquals(4.0, read[2], 0.0); + assertEquals(0.0, read[3], 0.0); + } + + @Test + public void equalWithDoubleNioBuffer() { + DoubleDataBuffer nioBuffer1 = + NioDataBufferFactory.create(DoubleBuffer.wrap(new double[] {1.0, 16.0})); + DoubleDataBuffer nioBuffer2 = + NioDataBufferFactory.create(DoubleBuffer.wrap(new double[] {1.0, 25.0})); + + DoubleDataBuffer buffer = allocate(2).setDouble(1.0, 0).setDouble(16.0, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithDoubleRawBuffer() { + DoubleDataBuffer rawBuffer1 = RawDataBufferFactory.create(new double[] {1.0, 16.0}, true); + DoubleDataBuffer rawBuffer2 = RawDataBufferFactory.create(new double[] {1.0, 25.0}, true); + + DoubleDataBuffer buffer = allocate(2).setDouble(1.0, 0).setDouble(16.0, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithDoubleObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Double[] {1.0, 16.0}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Double[] {1.0, 25.0}, true); + + DoubleDataBuffer buffer = allocate(2).setDouble(1.0, 0).setDouble(16.0, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + DoubleDataBuffer buffer = allocate(2).setDouble(1.0, 0).setDouble(16.0, 1); + FloatDataBuffer floatBuffer = DataBuffers.of(1.0f, 16.0f); + + assertFalse(buffer.equals(floatBuffer)); + assertFalse(floatBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java new file mode 100644 index 00000000000..7fca8363634 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/FloatDataBufferTestBase.java @@ -0,0 +1,129 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.FloatBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class FloatDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract FloatDataBuffer allocate(long size); + + @Override + protected Float valueOf(Long val) { + return val.floatValue(); + } + + @Test + public void writeAndReadFromArray() { + FloatDataBuffer buffer = allocate(10L); + float[] oneToFive = new float[] {1.0f, 2.0f, 3.0f, 4.0f, 5.0f}; + + buffer.write(oneToFive); + assertEquals(2.0f, buffer.getFloat(1), 0.0f); + + buffer.offset(5).write(oneToFive); + assertEquals(2.0f, buffer.getFloat(1), 0.0f); + assertEquals(2.0f, buffer.getFloat(6), 0.0f); + + float[] read = new float[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read, 0.0f); + + buffer.write(oneToFive, 2, 2); + assertEquals(3.0f, buffer.getFloat(0), 0.0f); + assertEquals(4.0f, buffer.getFloat(1), 0.0f); + assertEquals(3.0f, buffer.getFloat(2), 0.0f); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0.0f, read[0], 0.0f); + assertEquals(3.0f, read[1], 0.0f); + assertEquals(4.0f, read[2], 0.0f); + assertEquals(0.0f, read[3], 0.0f); + } + + @Test + public void equalWithFloatNioBuffer() { + FloatDataBuffer nioBuffer1 = + NioDataBufferFactory.create(FloatBuffer.wrap(new float[] {1.0f, 16.0f})); + FloatDataBuffer nioBuffer2 = + NioDataBufferFactory.create(FloatBuffer.wrap(new float[] {1.0f, 25.0f})); + + FloatDataBuffer buffer = allocate(2).setFloat(1.0f, 0).setFloat(16.0f, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithFloatRawBuffer() { + FloatDataBuffer rawBuffer1 = RawDataBufferFactory.create(new float[] {1.0f, 16.0f}, true); + FloatDataBuffer rawBuffer2 = RawDataBufferFactory.create(new float[] {1.0f, 25.0f}, true); + + FloatDataBuffer buffer = allocate(2).setFloat(1.0f, 0).setFloat(16.0f, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithFloatObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Float[] {1.0f, 16.0f}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Float[] {1.0f, 25.0f}, true); + + FloatDataBuffer buffer = allocate(2).setFloat(1.0f, 0).setFloat(16.0f, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + FloatDataBuffer buffer = allocate(2).setFloat(1.0f, 0).setFloat(16.0f, 1); + DoubleDataBuffer doubleBuffer = DataBuffers.of(1.0, 16.0); + + assertFalse(buffer.equals(doubleBuffer)); + assertFalse(doubleBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java new file mode 100644 index 00000000000..7593411a85a --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/IntDataBufferTestBase.java @@ -0,0 +1,127 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.IntBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class IntDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract IntDataBuffer allocate(long size); + + @Override + protected Integer valueOf(Long val) { + return val.intValue(); + } + + @Test + public void writeAndReadFromArray() { + IntDataBuffer buffer = allocate(10L); + int[] oneToFive = new int[] {1, 2, 3, 4, 5}; + + buffer.write(oneToFive); + assertEquals(2, buffer.getInt(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getInt(1)); + assertEquals(2, buffer.getInt(6)); + + int[] read = new int[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getInt(0)); + assertEquals(4, buffer.getInt(1)); + assertEquals(3, buffer.getInt(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } + + @Test + public void equalWithIntNioBuffer() { + IntDataBuffer nioBuffer1 = NioDataBufferFactory.create(IntBuffer.wrap(new int[] {1, 16})); + IntDataBuffer nioBuffer2 = NioDataBufferFactory.create(IntBuffer.wrap(new int[] {1, 25})); + + IntDataBuffer buffer = allocate(2).setInt(1, 0).setInt(16, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithIntRawBuffer() { + IntDataBuffer rawBuffer1 = RawDataBufferFactory.create(new int[] {1, 16}, true); + IntDataBuffer rawBuffer2 = RawDataBufferFactory.create(new int[] {1, 25}, true); + + IntDataBuffer buffer = allocate(2).setInt(1, 0).setInt(16, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithIntObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Integer[] {1, 16}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Integer[] {1, 25}, true); + + IntDataBuffer buffer = allocate(2).setInt(1, 0).setInt(16, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + IntDataBuffer buffer = allocate(2).setInt(1, 0).setInt(16, 1); + LongDataBuffer longBuffer = DataBuffers.of(1L, 16L); + + assertFalse(buffer.equals(longBuffer)); + assertFalse(longBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java new file mode 100644 index 00000000000..a3bdb068113 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/LongDataBufferTestBase.java @@ -0,0 +1,127 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.LongBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class LongDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract LongDataBuffer allocate(long size); + + @Override + protected Long valueOf(Long val) { + return val; + } + + @Test + public void writeAndReadFromArray() { + LongDataBuffer buffer = allocate(10L); + long[] oneToFive = new long[] {1L, 2L, 3L, 4L, 5L}; + + buffer.write(oneToFive); + assertEquals(2, buffer.getLong(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2L, buffer.getLong(1)); + assertEquals(2L, buffer.getLong(6)); + + long[] read = new long[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3L, buffer.getLong(0)); + assertEquals(4L, buffer.getLong(1)); + assertEquals(3L, buffer.getLong(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0L, read[0]); + assertEquals(3L, read[1]); + assertEquals(4L, read[2]); + assertEquals(0L, read[3]); + } + + @Test + public void equalWithLongNioBuffer() { + LongDataBuffer nioBuffer1 = NioDataBufferFactory.create(LongBuffer.wrap(new long[] {1, 16})); + LongDataBuffer nioBuffer2 = NioDataBufferFactory.create(LongBuffer.wrap(new long[] {1, 25})); + + LongDataBuffer buffer = allocate(2).setLong(1, 0).setLong(16, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithLongRawBuffer() { + LongDataBuffer rawBuffer1 = RawDataBufferFactory.create(new long[] {1, 16}, true); + LongDataBuffer rawBuffer2 = RawDataBufferFactory.create(new long[] {1, 25}, true); + + LongDataBuffer buffer = allocate(2).setLong(1, 0).setLong(16, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithLongObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Long[] {1L, 16L}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Long[] {1L, 25L}, true); + + LongDataBuffer buffer = allocate(2).setLong(1, 0).setLong(16, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + LongDataBuffer buffer = allocate(2).setLong(1L, 0).setLong(16L, 1); + IntDataBuffer intBuffer = DataBuffers.of(1, 16); + + assertFalse(buffer.equals(intBuffer)); + assertFalse(intBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java new file mode 100644 index 00000000000..40569842125 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/buffer/ShortDataBufferTestBase.java @@ -0,0 +1,127 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.buffer; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.ShortBuffer; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.impl.buffer.misc.MiscDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; + +public abstract class ShortDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract ShortDataBuffer allocate(long size); + + @Override + protected Short valueOf(Long val) { + return val.shortValue(); + } + + @Test + public void writeAndReadFromArray() { + ShortDataBuffer buffer = allocate(10L); + short[] oneToFive = new short[] {1, 2, 3, 4, 5}; + + buffer.write(oneToFive); + assertEquals(2, buffer.getShort(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getShort(1), 0); + assertEquals(2, buffer.getShort(6), 0); + + short[] read = new short[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getShort(0)); + assertEquals(4, buffer.getShort(1)); + assertEquals(3, buffer.getShort(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } + + @Test + public void equalWithShortNioBuffer() { + ShortDataBuffer nioBuffer1 = NioDataBufferFactory.create(ShortBuffer.wrap(new short[] {1, 16})); + ShortDataBuffer nioBuffer2 = NioDataBufferFactory.create(ShortBuffer.wrap(new short[] {1, 25})); + + ShortDataBuffer buffer = allocate(2).setShort((short) 1, 0).setShort((short) 16, 1); + + assertTrue(nioBuffer1.equals(buffer)); + assertTrue(buffer.equals(nioBuffer1)); + assertEquals(nioBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(nioBuffer2.equals(buffer)); + assertFalse(buffer.equals(nioBuffer2)); + assertNotEquals(nioBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithShortRawBuffer() { + ShortDataBuffer rawBuffer1 = RawDataBufferFactory.create(new short[] {1, 16}, true); + ShortDataBuffer rawBuffer2 = RawDataBufferFactory.create(new short[] {1, 25}, true); + + ShortDataBuffer buffer = allocate(2).setShort((short) 1, 0).setShort((short) 16, 1); + + assertTrue(rawBuffer1.equals(buffer)); + assertTrue(buffer.equals(rawBuffer1)); + assertEquals(rawBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(rawBuffer2.equals(buffer)); + assertFalse(buffer.equals(rawBuffer2)); + assertNotEquals(rawBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void equalWithShortObjectBuffer() { + DataBuffer objBuffer1 = MiscDataBufferFactory.create(new Short[] {1, 16}, true); + DataBuffer objBuffer2 = MiscDataBufferFactory.create(new Short[] {1, 25}, true); + + ShortDataBuffer buffer = allocate(2).setShort((short) 1, 0).setShort((short) 16, 1); + + assertTrue(objBuffer1.equals(buffer)); + assertTrue(buffer.equals(objBuffer1)); + assertEquals(objBuffer1.hashCode(), buffer.hashCode()); + + assertFalse(objBuffer2.equals(buffer)); + assertFalse(buffer.equals(objBuffer2)); + assertNotEquals(objBuffer2.hashCode(), buffer.hashCode()); + } + + @Test + public void notEqualWithOtherTypes() { + ShortDataBuffer buffer = allocate(2).setShort((short) 1, 0).setShort((short) 16, 1); + LongDataBuffer longBuffer = DataBuffers.of(1L, 16L); + + assertFalse(buffer.equals(longBuffer)); + assertFalse(longBuffer.equals(buffer)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java new file mode 100644 index 00000000000..f8109666b1f --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BigIntegerDataBufferAdapterTest.java @@ -0,0 +1,68 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import java.math.BigInteger; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferTestBase; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.layout.DataLayout; + +public class BigIntegerDataBufferAdapterTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofBytes(size * LAYOUT.scale())); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + @Override + protected BigInteger valueOf(Long val) { + return BigInteger.valueOf(val); + } + + private static DataLayout LAYOUT = + new DataLayout() { + + @Override + public void writeObject(ByteDataBuffer buffer, BigInteger value, long index) { + byte[] bytes = value.toByteArray(); + buffer.setByte(bytes.length > 2 ? bytes[2] : 0, index); + buffer.setByte(bytes.length > 1 ? bytes[1] : 0, index + 1); + buffer.setByte(bytes[0], index + 2); + } + + @Override + public BigInteger readObject(ByteDataBuffer buffer, long index) { + byte byte2 = buffer.getByte(index); + byte byte1 = buffer.getByte(index + 1); + byte byte0 = buffer.getByte(index + 2); + return new BigInteger(new byte[] {byte2, byte1, byte0}); + } + + @Override + public int scale() { + return 3; + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java new file mode 100644 index 00000000000..9507cef3456 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/BooleanDataBufferAdapterTest.java @@ -0,0 +1,46 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.BooleanDataBufferTestBase; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.layout.BooleanDataLayout; + +public class BooleanDataBufferAdapterTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofBytes(size * LAYOUT.scale())); + } + + private static BooleanDataLayout LAYOUT = + new BooleanDataLayout() { + + @Override + public void writeBoolean(ByteDataBuffer buffer, boolean value, long index) { + buffer.setByte((byte) (value ? 1 : 0), index); + } + + @Override + public boolean readBoolean(ByteDataBuffer buffer, long index) { + return buffer.getByte(index) > 0; + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java new file mode 100644 index 00000000000..59462ba436a --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ByteDataBufferAdapterTest.java @@ -0,0 +1,28 @@ +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBufferTestBase; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.ByteDataLayout; + +public class ByteDataBufferAdapterTest extends ByteDataBufferTestBase { + + public ByteDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofShorts(size * LAYOUT.scale())); + } + + private static ByteDataLayout LAYOUT = + new ByteDataLayout() { + + @Override + public void writeByte(ShortDataBuffer buffer, byte value, long index) { + buffer.setShort(value, index); + } + + @Override + public byte readByte(ShortDataBuffer buffer, long index) { + return (byte) buffer.getShort(index); + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java new file mode 100644 index 00000000000..898409f3541 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/DoubleDataBufferAdapterTest.java @@ -0,0 +1,63 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBufferTestBase; +import org.tensorflow.ndarray.buffer.layout.DoubleDataLayout; + +public class DoubleDataBufferAdapterTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofBytes(size * LAYOUT.scale())); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + private static DoubleDataLayout LAYOUT = + new DoubleDataLayout() { + + @Override + public void writeDouble(ByteDataBuffer buffer, double value, long index) { + long bits = Double.doubleToLongBits(value); + buffer.setByte((byte) ((bits >> 56) & 0xFF), index); + buffer.setByte((byte) ((bits >> 48) & 0xFF), index + 1); + buffer.setByte((byte) ((bits >> 40) & 0xFF), index + 2); + } + + @Override + public double readDouble(ByteDataBuffer buffer, long index) { + long byte7 = buffer.getByte(index); + long byte6 = buffer.getByte(index + 1); + long byte5 = buffer.getByte(index + 2); + return Double.longBitsToDouble( + ((byte7 & 0xFF) << 56) | ((byte6 & 0xFF) << 48) | ((byte5 & 0xFF) << 40)); + } + + @Override + public int scale() { + return 3; + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java new file mode 100644 index 00000000000..325ef9c05cf --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/FloatDataBufferAdapterTest.java @@ -0,0 +1,53 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBufferTestBase; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.FloatDataLayout; + +public class FloatDataBufferAdapterTest extends FloatDataBufferTestBase { + + @Override + public FloatDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofShorts(size * LAYOUT.scale())); + } + + @Override + protected long maxSize() { + return super.maxSize() / 2; + } + + private static FloatDataLayout LAYOUT = + new FloatDataLayout() { + + @Override + public void writeFloat(ShortDataBuffer buffer, float value, long index) { + int bits = Float.floatToIntBits(value); + buffer.setShort((short) (bits >> 16), index); + } + + @Override + public float readFloat(ShortDataBuffer buffer, long index) { + int i = buffer.getShort(index); + return Float.intBitsToFloat(i << 16); + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java new file mode 100644 index 00000000000..ac045e24662 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/IntDataBufferAdapterTest.java @@ -0,0 +1,52 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBufferTestBase; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.layout.IntDataLayout; + +public class IntDataBufferAdapterTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofShorts(size * LAYOUT.scale())); + } + + @Override + protected long maxSize() { + return super.maxSize() / 2; + } + + private static IntDataLayout LAYOUT = + new IntDataLayout() { + + @Override + public void writeInt(ShortDataBuffer buffer, int value, long index) { + buffer.setShort((short) (((value & 0x80000000) >> 16) | (value & 0x7FFF)), index); + } + + @Override + public int readInt(ShortDataBuffer buffer, long index) { + int i = buffer.getShort(index); + return ((i & 0x8000) << 16) | ((i & 0x7FFF)); + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java new file mode 100644 index 00000000000..bdb17d50fed --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/LongDataBufferAdapterTest.java @@ -0,0 +1,61 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBufferTestBase; +import org.tensorflow.ndarray.buffer.layout.LongDataLayout; + +public class LongDataBufferAdapterTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofBytes(size * LAYOUT.scale())); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + private static LongDataLayout LAYOUT = + new LongDataLayout() { + + @Override + public void writeLong(ByteDataBuffer buffer, long value, long index) { + buffer.setByte((byte) (((value >> 56) & 0x80) | ((value >> 16) & 0x7F)), index); + buffer.setByte((byte) ((value >> 8) & 0xFF), index + 1); + buffer.setByte((byte) (value & 0xFF), index + 2); + } + + @Override + public long readLong(ByteDataBuffer buffer, long index) { + long msb = buffer.getByte(index); + long midb = buffer.getByte(index + 1); + long lsb = buffer.getByte(index + 2); + return ((msb & 0x80) << 56) | ((msb & 0x7F) << 16) | ((midb & 0xFF) << 8) | (lsb & 0xFF); + } + + @Override + public int scale() { + return 3; + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java new file mode 100644 index 00000000000..dd446028c60 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/adapter/ShortDataBufferAdapterTest.java @@ -0,0 +1,46 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.adapter; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBufferTestBase; +import org.tensorflow.ndarray.buffer.layout.ShortDataLayout; + +public class ShortDataBufferAdapterTest extends ShortDataBufferTestBase { + + public ShortDataBuffer allocate(long size) { + return LAYOUT.applyTo(DataBuffers.ofBytes(size * LAYOUT.scale())); + } + + private static ShortDataLayout LAYOUT = + new ShortDataLayout() { + + @Override + public void writeShort(ByteDataBuffer buffer, short value, long index) { + buffer.setByte((byte) (((value & 0x8000) >> 8) | (value & 0x7F)), index); + } + + @Override + public short readShort(ByteDataBuffer buffer, long index) { + int b = buffer.getByte(index); + return (short) (((b & 0x80) << 8) | (b & 0x7F)); + } + }; +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java new file mode 100644 index 00000000000..30eff04bfac --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16LayoutTest.java @@ -0,0 +1,84 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class Bfloat16LayoutTest { + + @Test + public void testFloat32to16() { + + // Zero and subnormals + assertEquals((short) 0x0000, Bfloat16Layout.float32to16(0.0f)); + assertEquals((short) 0x8000, Bfloat16Layout.float32to16(-0.0f)); + assertEquals((short) 0x0001, Bfloat16Layout.float32to16(1e-40f)); + assertEquals((short) 0xC000, Bfloat16Layout.float32to16(-2.0f)); + assertEquals((short) 0x0000, Bfloat16Layout.float32to16(4.59e-41f)); + + // Infinite and NaN + assertEquals((short) 0x7F80, Bfloat16Layout.float32to16(Float.POSITIVE_INFINITY)); + assertEquals((short) 0xFF80, Bfloat16Layout.float32to16(Float.NEGATIVE_INFINITY)); + assertEquals((short) 0x7FC0, Bfloat16Layout.float32to16(Float.NaN)); + assertEquals((short) 0x7FC0, Bfloat16Layout.float32to16(Float.intBitsToFloat(0xFFFFFFFF))); + + // Normalized + assertEquals((short) 0x3F80, Bfloat16Layout.float32to16(1.0f)); + assertEquals((short) 0xBF80, Bfloat16Layout.float32to16(-1.0f)); + assertEquals((short) 0x42C8, Bfloat16Layout.float32to16(100.0f)); + assertEquals((short) 0xC2CA, Bfloat16Layout.float32to16(-101.0f)); + assertEquals((short) 0x3F8F, Bfloat16Layout.float32to16(1.1171875f)); + assertEquals((short) 0x4800, Bfloat16Layout.float32to16(131072f)); + assertEquals((short) 0x7F7F, Bfloat16Layout.float32to16(3.3895314e38f)); + assertEquals((short) 0xFF7F, Bfloat16Layout.float32to16(-3.3895314e38f)); + + // Rounding up + assertEquals((short) 0x3FCF, Bfloat16Layout.float32to16(1.6191406f)); // 1.6171875 + assertEquals((short) 0x4780, Bfloat16Layout.float32to16(65600.0f)); // 65536.0 + } + + @Test + public void testFloat16to32() { + + // Zero and subnormals + assertEquals(0.0f, Bfloat16Layout.float16to32((short) 0x0000), 0); + assertEquals(-0.0f, Bfloat16Layout.float16to32((short) 0x8000), 0); + assertEquals(9.18355E-41f, Bfloat16Layout.float16to32((short) 0x0001), 1e-8f); + assertEquals(-9.403955E-38, Bfloat16Layout.float16to32((short) 0x8200), 1e-8f); + + // Infinite and NaN + assertEquals(Float.POSITIVE_INFINITY, Bfloat16Layout.float16to32((short) 0x7F80), 0); + assertEquals(Float.NEGATIVE_INFINITY, Bfloat16Layout.float16to32((short) 0xFF80), 0); + assertEquals(Float.NaN, Bfloat16Layout.float16to32((short) 0x7FC0), 0); + assertEquals(Float.intBitsToFloat(0xFFFFFFFF), Bfloat16Layout.float16to32((short) 0x7FC0), 0); + + // Normalized + assertEquals(1.0f, Bfloat16Layout.float16to32((short) 0x3F80), 0); + assertEquals(-1.0f, Bfloat16Layout.float16to32((short) 0xBF80), 0); + assertEquals(100.0f, Bfloat16Layout.float16to32((short) 0x42C8), 0); + assertEquals(-101.0f, Bfloat16Layout.float16to32((short) 0xC2CA), 0); + assertEquals(1.1171875f, Bfloat16Layout.float16to32((short) 0x3F8F), 0); + assertEquals(131072f, Bfloat16Layout.float16to32((short) 0x4800), 0); + assertEquals(3.3895314e38f, Bfloat16Layout.float16to32((short) 0x7F7F), 0); + assertEquals(-3.3895314e38f, Bfloat16Layout.float16to32((short) 0xFF7F), 0); + assertEquals(1.6171875f, Bfloat16Layout.float16to32((short) 0x3FCF), 0); + assertEquals(65536.0, Bfloat16Layout.float16to32((short) 0x4780), 0); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java new file mode 100644 index 00000000000..7cdc010e478 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/BoolLayoutTest.java @@ -0,0 +1,42 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +public class BoolLayoutTest { + + @Test + public void booleanToByteTest() { + assertEquals((byte) 1, BoolLayout.booleanToByte(true)); + assertEquals((byte) 0, BoolLayout.booleanToByte(false)); + } + + @Test + public void byteToBooleanTest() { + assertTrue(BoolLayout.byteToBoolean((byte) 1)); + assertTrue(BoolLayout.byteToBoolean((byte) 127)); + assertTrue(BoolLayout.byteToBoolean((byte) -128)); + assertTrue(BoolLayout.byteToBoolean((byte) 255)); + assertFalse(BoolLayout.byteToBoolean((byte) 0)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java new file mode 100644 index 00000000000..2c7c8c281a6 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/layout/Float16LayoutTest.java @@ -0,0 +1,90 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.buffer.layout; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class Float16LayoutTest { + + @Test + public void testFloat32to16() { + + // Zero and subnormals + assertEquals((short) 0x0000, Float16Layout.float32to16(0.0f)); + assertEquals((short) 0x8000, Float16Layout.float32to16(-0.0f)); + assertEquals((short) 0x0001, Float16Layout.float32to16(6e-8f)); + assertEquals((short) 0x8200, Float16Layout.float32to16(-3.052e-5f)); + assertEquals((short) 0x0000, Float16Layout.float32to16(6e-9f)); + + // Infinite and NaN + assertEquals((short) 0x7C00, Float16Layout.float32to16(Float.POSITIVE_INFINITY)); + assertEquals((short) 0xFC00, Float16Layout.float32to16(Float.NEGATIVE_INFINITY)); + assertEquals((short) 0x7C00, Float16Layout.float32to16(65520.0f)); + assertEquals((short) 0x7C00, Float16Layout.float32to16(165536.0f)); + assertEquals((short) 0xFC00, Float16Layout.float32to16(-65520.0f)); + assertEquals((short) 0x7E00, Float16Layout.float32to16(Float.NaN)); + assertEquals((short) 0x7E00, Float16Layout.float32to16(Float.intBitsToFloat(0xFFFFFFFF))); + + // Normalized + assertEquals((short) 0x7BFF, Float16Layout.float32to16(65519.0f)); + assertEquals((short) 0x3C00, Float16Layout.float32to16(1.0f)); + assertEquals((short) 0xBC00, Float16Layout.float32to16(-1.0f)); + assertEquals((short) 0x5640, Float16Layout.float32to16(100.0f)); + assertEquals((short) 0xD650, Float16Layout.float32to16(-101.0f)); + assertEquals((short) 0x3C7E, Float16Layout.float32to16(1.123f)); + + // Rounding up + assertEquals((short) 0x3C7E, Float16Layout.float32to16(1.1235f)); // 1.123 + assertEquals((short) 0x3C7F, Float16Layout.float32to16(1.1236f)); // 1.124 + assertEquals((short) 0x4000, Float16Layout.float32to16(2.0009f)); // 2.0 + assertEquals((short) 0x4001, Float16Layout.float32to16(2.001f)); // 2.002 + assertEquals((short) 0x5C00, Float16Layout.float32to16(256.125f)); // 256.0 + assertEquals((short) 0x5C01, Float16Layout.float32to16(256.126f)); // 256.3 + assertEquals((short) 0x5C01, Float16Layout.float32to16(256.30f)); // 256.3 + assertEquals((short) 0x5C01, Float16Layout.float32to16(256.374f)); // 256.3 + assertEquals((short) 0x5C02, Float16Layout.float32to16(256.375f)); // 256.5 + assertEquals((short) 0x5C02, Float16Layout.float32to16(256.51f)); // 256.5 + } + + @Test + public void testFloat16to32() { + + // Zero and subnormals + assertEquals(0.0f, Float16Layout.float16to32((short) 0x0000), 0); + assertEquals(-0.0f, Float16Layout.float16to32((short) 0x8000), 0); + assertEquals(6e-8f, Float16Layout.float16to32((short) 0x0001), 1e-8f); + assertEquals(-3.052e-5f, Float16Layout.float16to32((short) 0x8200), 1e-8f); + + // Infinite and NaN + assertEquals(Float.POSITIVE_INFINITY, Float16Layout.float16to32((short) 0x7C00), 0); + assertEquals(Float.NEGATIVE_INFINITY, Float16Layout.float16to32((short) 0xFC00), 0); + assertEquals(Float.NaN, Float16Layout.float16to32((short) 0x7E00), 0); + assertEquals(Float.intBitsToFloat(0xFFFFFFFF), Float16Layout.float16to32((short) 0x7E00), 0); + + // Normalized + assertEquals(1.0f, Float16Layout.float16to32((short) 0x3C00), 1e-1f); + assertEquals(-1.0f, Float16Layout.float16to32((short) 0xBC00), 1e-1f); + assertEquals(100.0f, Float16Layout.float16to32((short) 0x5640), 1e-1f); + assertEquals(-101.0f, Float16Layout.float16to32((short) 0xD650), 1e-1f); + assertEquals(1.123f, Float16Layout.float16to32((short) 0x3C7E), 1e-3f); + assertEquals(1.123f, Float16Layout.float16to32((short) 0x3C7E), 1e-3f); + assertEquals(-62.34f, Float16Layout.float16to32((short) 0xD3CB), 1e-2f); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBufferTest.java new file mode 100644 index 00000000000..60ab337c8f2 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/ArrayDataBufferTest.java @@ -0,0 +1,269 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.misc; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferTestBase; + +public class ArrayDataBufferTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return new ArrayDataBuffer<>(new BigDecimal[(int) size], false); + } + + @Override + protected BigDecimal valueOf(Long val) { + return BigDecimal.valueOf(val); + } + + @Test + public void byteArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new byte[][] {{0x01}, {0x03}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new byte[][] {{0x01}, {0x03}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new byte[][] {{0x02}, {0x03}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new byte[][][] {{{0x01}}, {{0x03}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new byte[][][] {{{0x01}}, {{0x03}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void intArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new int[][] {{10}, {30}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new int[][] {{10}, {30}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new int[][] {{20}, {30}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new int[][][] {{{10}}, {{30}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new int[][][] {{{10}}, {{30}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void shortArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new short[][] {{10}, {30}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new short[][] {{10}, {30}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new short[][] {{20}, {30}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new short[][][] {{{10}}, {{30}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new short[][][] {{{10}}, {{30}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void longArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new long[][] {{10}, {30}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new long[][] {{10}, {30}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new long[][] {{20}, {30}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new long[][][] {{{10}}, {{30}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new long[][][] {{{10}}, {{30}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void floatArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new float[][] {{10}, {30}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new float[][] {{10}, {30}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new float[][] {{20}, {30}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new float[][][] {{{10}}, {{30}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new float[][][] {{{10}}, {{30}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void doubleArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new double[][] {{10}, {30}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new double[][] {{10}, {30}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new double[][] {{20}, {30}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new double[][][] {{{10}}, {{30}}}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new double[][][] {{{10}}, {{30}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void booleanArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new boolean[][] {{true}, {false}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new boolean[][] {{true}, {false}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new boolean[][] {{false}, {false}}, true); + DataBuffer buffer4 = + new ArrayDataBuffer<>(new boolean[][][] {{{true}}, {{false}}}, true); + DataBuffer buffer5 = + new ArrayDataBuffer<>(new boolean[][][] {{{true}}, {{false}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void objectArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new String[][] {{"10"}, {"30"}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new String[][] {{"10"}, {"30"}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new String[][] {{"20"}, {"30"}}, true); + DataBuffer buffer4 = + new ArrayDataBuffer<>(new String[][][] {{{"10"}}, {{"30"}}}, true); + DataBuffer buffer5 = + new ArrayDataBuffer<>(new String[][][] {{{"10"}}, {{"30"}}}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } + + @Test + public void nullableObjectArrayBufferEquals() { + DataBuffer buffer1 = new ArrayDataBuffer<>(new String[][] {null, {"30"}}, true); + DataBuffer buffer2 = new ArrayDataBuffer<>(new String[][] {null, {"30"}}, true); + DataBuffer buffer3 = new ArrayDataBuffer<>(new String[][] {{"20"}, {"30"}}, true); + DataBuffer buffer4 = new ArrayDataBuffer<>(new String[][][] {{{"10"}}, null}, true); + DataBuffer buffer5 = new ArrayDataBuffer<>(new String[][][] {{{"10"}}, null}, true); + + assertTrue(buffer1.equals(buffer2)); + assertTrue(buffer2.equals(buffer1)); + assertEquals(buffer1.hashCode(), buffer2.hashCode()); + + assertFalse(buffer1.equals(buffer3)); + assertFalse(buffer3.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer3.hashCode()); + + assertFalse(buffer1.equals(buffer4)); + assertFalse(buffer4.equals(buffer1)); + assertNotEquals(buffer1.hashCode(), buffer4.hashCode()); + + assertTrue(buffer4.equals(buffer5)); + assertTrue(buffer4.equals(buffer5)); + assertEquals(buffer4.hashCode(), buffer5.hashCode()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java new file mode 100644 index 00000000000..2ebd7c492d3 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/BitSetDataBufferTest.java @@ -0,0 +1,34 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.misc; + +import java.util.BitSet; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.BooleanDataBufferTestBase; + +public class BitSetDataBufferTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return new BitSetDataBuffer(new BitSet((int) size), size, false); + } + + @Override + protected Boolean valueOf(Long val) { + return val != 0; + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java new file mode 100644 index 00000000000..e91f44bbb9e --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/misc/StringArrayDataBufferTest.java @@ -0,0 +1,33 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.misc; + +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBufferTestBase; + +public class StringArrayDataBufferTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return new ArrayDataBuffer<>(new String[(int) size], false); + } + + @Override + protected String valueOf(Long val) { + return val.toString(); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java new file mode 100644 index 00000000000..8c80e1cbac5 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ByteNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.ByteBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBufferTestBase; + +public class ByteNioDataBufferTest extends ByteDataBufferTestBase { + + @Override + protected ByteDataBuffer allocate(long size) { + return new ByteNioDataBuffer(ByteBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java new file mode 100644 index 00000000000..47b9562ec1e --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/DoubleNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.DoubleBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBufferTestBase; + +public class DoubleNioDataBufferTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return new DoubleNioDataBuffer(DoubleBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java new file mode 100644 index 00000000000..2dfe3620556 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/FloatNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.FloatBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBufferTestBase; + +public class FloatNioDataBufferTest extends FloatDataBufferTestBase { + + @Override + protected FloatDataBuffer allocate(long size) { + return new FloatNioDataBuffer(FloatBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java new file mode 100644 index 00000000000..28e9525f4a0 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/IntNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.IntBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBufferTestBase; + +public class IntNioDataBufferTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return new IntNioDataBuffer(IntBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java new file mode 100644 index 00000000000..57538c7d348 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/LongNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.LongBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBufferTestBase; + +public class LongNioDataBufferTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return new LongNioDataBuffer(LongBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java new file mode 100644 index 00000000000..dc2d5f8aea6 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/nio/ShortNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.nio; + +import java.nio.ShortBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBufferTestBase; + +public class ShortNioDataBufferTest extends ShortDataBufferTestBase { + + @Override + protected ShortDataBuffer allocate(long size) { + return new ShortNioDataBuffer(ShortBuffer.allocate((int) size)); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java new file mode 100644 index 00000000000..bd0f18d861c --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/BooleanRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.BooleanDataBufferTestBase; + +public class BooleanRawDataBufferTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return new BooleanRawDataBuffer( + UnsafeMemoryHandle.fromArray(new boolean[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java new file mode 100644 index 00000000000..79d07e8644c --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ByteRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBufferTestBase; + +public class ByteRawDataBufferTest extends ByteDataBufferTestBase { + + @Override + protected ByteDataBuffer allocate(long size) { + return new ByteRawDataBuffer( + UnsafeMemoryHandle.fromArray(new byte[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java new file mode 100644 index 00000000000..b2d82fc3d26 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/DoubleRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBufferTestBase; + +public class DoubleRawDataBufferTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return new DoubleRawDataBuffer( + UnsafeMemoryHandle.fromArray(new double[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java new file mode 100644 index 00000000000..ef4fbbce6cd --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/FloatRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBufferTestBase; + +public class FloatRawDataBufferTest extends FloatDataBufferTestBase { + + @Override + protected FloatDataBuffer allocate(long size) { + return new FloatRawDataBuffer( + UnsafeMemoryHandle.fromArray(new float[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java new file mode 100644 index 00000000000..f2efd0324cb --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/IntRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBufferTestBase; + +public class IntRawDataBufferTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return new IntRawDataBuffer( + UnsafeMemoryHandle.fromArray(new int[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java new file mode 100644 index 00000000000..e2cacf4a84d --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/LongRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBufferTestBase; + +public class LongRawDataBufferTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return new LongRawDataBuffer( + UnsafeMemoryHandle.fromArray(new long[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java new file mode 100644 index 00000000000..887a3d747f7 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/buffer/raw/ShortRawDataBufferTest.java @@ -0,0 +1,29 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.buffer.raw; + +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.buffer.ShortDataBufferTestBase; + +public class ShortRawDataBufferTest extends ShortDataBufferTestBase { + + @Override + protected ShortDataBuffer allocate(long size) { + return new ShortRawDataBuffer( + UnsafeMemoryHandle.fromArray(new short[(int) size], (int) size), false); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java new file mode 100644 index 00000000000..35cbf07fab9 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/BooleanDenseNdArrayTest.java @@ -0,0 +1,47 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.BooleanNdArray; +import org.tensorflow.ndarray.BooleanNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class BooleanDenseNdArrayTest extends BooleanNdArrayTestBase { + + @Override + protected BooleanNdArray allocate(Shape shape) { + return NdArrays.ofBooleans(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofBooleans(size); + } + + @Test + public void testToString() { + BooleanNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + Assertions.assertEquals("BooleanDenseNdArray(shape=[5, 4, 5])", matrix3d.toString()); + BooleanNdArray scalar = allocate(Shape.of()); + Assertions.assertEquals("BooleanDenseNdArray(shape=[])", scalar.toString()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java new file mode 100644 index 00000000000..848999025d9 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ByteDenseNdArrayTest.java @@ -0,0 +1,37 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.ByteNdArray; +import org.tensorflow.ndarray.ByteNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class ByteDenseNdArrayTest extends ByteNdArrayTestBase { + + @Override + protected ByteNdArray allocate(Shape shape) { + return NdArrays.ofBytes(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofBytes(size); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DenseNdArrayTest.java new file mode 100644 index 00000000000..fb3a44ccb39 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DenseNdArrayTest.java @@ -0,0 +1,56 @@ +package org.tensorflow.ndarray.impl.dense; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.index.Indices; + +public class DenseNdArrayTest { + + @Test + public void arrayEquals() { + IntNdArray array = + NdArrays.ofInts(Shape.of(2, 2)) + .set(NdArrays.vectorOf(1, 2), 0) + .set(NdArrays.vectorOf(3, 4), 1); + + assertTrue(array.equals(StdArrays.ndCopyOf(new int[][] {{1, 2}, {3, 4}}))); + assertTrue(array.equals(StdArrays.ndCopyOf(new Integer[][] {{1, 2}, {3, 4}}))); + assertFalse(array.equals(NdArrays.vectorOf(1, 2, 3, 4))); + assertFalse(array.equals(StdArrays.ndCopyOf(new int[][] {{3, 4}, {1, 2}}))); + assertFalse(array.equals(StdArrays.ndCopyOf(new long[][] {{1L, 2L}, {3L, 4L}}))); + } + + @Test + public void equalsAndHashCodeOnSlices() { + IntNdArray vector1 = NdArrays.vectorOf(3, 4); + IntNdArray vector2 = NdArrays.vectorOf(1, 2, 3, 4); + IntNdArray matrix1 = StdArrays.ndCopyOf(new int[][] {{1, 2}, {3, 4}}); + IntNdArray matrix2 = StdArrays.ndCopyOf(new int[][] {{1, 0, 2, 0}, {3, 0, 4, 0}}); + IntNdArray matrix3d1 = + StdArrays.ndCopyOf( + new int[][][] { + {{1, 2}, {3, 4}}, + {{5, 6}, {7, 8}} + }); + IntNdArray matrix3d2 = + StdArrays.ndCopyOf( + new int[][][] { + {{1, 2}, {4, 5}}, + {{3, 4}, {6, 7}} + }); + + assertTrue(vector1.equals(vector2.slice(Indices.sliceFrom(2)))); + assertTrue(vector1.equals(matrix1.get(1))); + assertTrue(vector1.equals(matrix2.get(1).slice(Indices.even()))); + assertTrue(matrix1.equals(matrix2.slice(Indices.all(), Indices.even()))); + assertTrue(matrix3d1.get(0).equals(matrix1)); + assertFalse(matrix3d1.get(0).equals(vector2)); + assertTrue(matrix1.equals(matrix3d2.slice(Indices.all(), Indices.at(0)))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java new file mode 100644 index 00000000000..1d5ad93bc27 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DoubleDenseNdArrayTest.java @@ -0,0 +1,49 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.DoubleNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class DoubleDenseNdArrayTest extends DoubleNdArrayTestBase { + + @Override + protected DoubleNdArray allocate(Shape shape) { + return NdArrays.ofDoubles(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofDoubles(size); + } + + @Test + public void testToString() { + DoubleNdArray matrix3d = allocate(Shape.of(5, 4, 5)); + Assertions.assertEquals("DoubleDenseNdArray(shape=[5, 4, 5])", matrix3d.toString()); + DoubleNdArray vector = allocate(Shape.of(5)); + Assertions.assertEquals("DoubleDenseNdArray(shape=[5])", vector.toString()); + DoubleNdArray scalar = allocate(Shape.of()); + Assertions.assertEquals("DoubleDenseNdArray(shape=[])", scalar.toString()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java new file mode 100644 index 00000000000..5023d832edd --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/FloatDenseNdArrayTest.java @@ -0,0 +1,76 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.FloatNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.index.Indices; + +public class FloatDenseNdArrayTest extends FloatNdArrayTestBase { + + @Override + protected FloatNdArray allocate(Shape shape) { + return NdArrays.ofFloats(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofFloats(size); + } + + @Test + public void testSlice() { + Shape shape = Shape.of(3, 4); + Float[] values = { + 1f, 0f, 0f, 0f, + 0f, 0f, 2f, 0f, + 0f, 0f, 0f, 0f + }; + + float[] expected = {0, 0, 2, 0, 0, 0}; + + FloatDataBuffer buffer = (FloatDataBuffer) allocateBuffer(shape.size()); + buffer.write(values); + FloatNdArray instance = FloatDenseNdArray.create(buffer, shape); + + FloatNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getFloat())); + + // check values from elements(0) of a slice against the original array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getFloat()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java new file mode 100644 index 00000000000..8a6496976ec --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/IntDenseNdArrayTest.java @@ -0,0 +1,37 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.IntNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class IntDenseNdArrayTest extends IntNdArrayTestBase { + + @Override + protected IntNdArray allocate(Shape shape) { + return NdArrays.ofInts(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofInts(size); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java new file mode 100644 index 00000000000..a8affa58ef0 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/LongDenseNdArrayTest.java @@ -0,0 +1,37 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.LongNdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class LongDenseNdArrayTest extends LongNdArrayTestBase { + + @Override + protected LongNdArray allocate(Shape shape) { + return NdArrays.ofLongs(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofLongs(size); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java new file mode 100644 index 00000000000..0b41cb8a575 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/ShortDenseNdArrayTest.java @@ -0,0 +1,37 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.ShortNdArrayTestBase; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class ShortDenseNdArrayTest extends ShortNdArrayTestBase { + + @Override + protected ShortNdArray allocate(Shape shape) { + return NdArrays.ofShorts(shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofShorts(size); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java new file mode 100644 index 00000000000..76168b7cc1c --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/StringDenseNdArrayTest.java @@ -0,0 +1,46 @@ +/* +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. +======================================================================= +*/ +package org.tensorflow.ndarray.impl.dense; + +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrayTestBase; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; + +public class StringDenseNdArrayTest extends NdArrayTestBase { + + @Override + protected NdArray allocate(Shape shape) { + return NdArrays.ofObjects(String.class, shape); + } + + @Override + protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofObjects(String.class, size); + } + + @Override + protected String valueOf(Long val) { + return val.toString(); + } + + protected String zeroOrNull() { + return null; + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sequence/ElementSequenceTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sequence/ElementSequenceTest.java new file mode 100644 index 00000000000..87ebd4da4be --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sequence/ElementSequenceTest.java @@ -0,0 +1,149 @@ +/* + * 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. + * ======================================================================= + */ + +package org.tensorflow.ndarray.impl.sequence; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.NdArraySequence; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.DataBufferWindow; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.AbstractNdArray; + +public class ElementSequenceTest { + + @Test + public void iterateVectorsWithIndex() { + IntNdArray array = NdArrays.ofInts(Shape.of(2, 3, 2)); + + NdArraySequence sequence = + new SlicingElementSequence((AbstractNdArray) array, 1); + List coords = new ArrayList<>((int) array.shape().size()); + sequence.forEachIndexed((c, e) -> coords.add(Arrays.copyOf(c, c.length))); + + assertEquals(6, coords.size()); + assertArrayEquals(new long[] {0, 0}, coords.get(0)); + assertArrayEquals(new long[] {0, 1}, coords.get(1)); + assertArrayEquals(new long[] {0, 2}, coords.get(2)); + assertArrayEquals(new long[] {1, 0}, coords.get(3)); + assertArrayEquals(new long[] {1, 1}, coords.get(4)); + assertArrayEquals(new long[] {1, 2}, coords.get(5)); + } + + @Test + public void iterateScalarsWithIndex() { + IntNdArray array = NdArrays.ofInts(Shape.of(2, 3, 2)); + + NdArraySequence cursor = + new SlicingElementSequence((AbstractNdArray) array, 2); + List coords = new ArrayList<>((int) array.shape().size()); + cursor.forEachIndexed((c, e) -> coords.add(Arrays.copyOf(c, c.length))); + + assertEquals(12, coords.size()); + assertArrayEquals(new long[] {0, 0, 0}, coords.get(0)); + assertArrayEquals(new long[] {0, 0, 1}, coords.get(1)); + assertArrayEquals(new long[] {0, 1, 0}, coords.get(2)); + assertArrayEquals(new long[] {0, 1, 1}, coords.get(3)); + assertArrayEquals(new long[] {0, 2, 0}, coords.get(4)); + assertArrayEquals(new long[] {0, 2, 1}, coords.get(5)); + assertArrayEquals(new long[] {1, 0, 0}, coords.get(6)); + assertArrayEquals(new long[] {1, 0, 1}, coords.get(7)); + assertArrayEquals(new long[] {1, 1, 0}, coords.get(8)); + assertArrayEquals(new long[] {1, 1, 1}, coords.get(9)); + assertArrayEquals(new long[] {1, 2, 0}, coords.get(10)); + assertArrayEquals(new long[] {1, 2, 1}, coords.get(11)); + } + + @Test + public void slicingElementSequenceReturnsUniqueInstances() { + IntNdArray array = NdArrays.ofInts(Shape.of(2, 3, 2)); + NdArraySequence sequence = + new SlicingElementSequence((AbstractNdArray) array, 1); + List elements = new ArrayList<>(); + sequence.forEach( + e -> { + elements.forEach( + tmp -> { + if (tmp == e) { + fail(); + } + }); + elements.add(e); + }); + } + + @Test + public void fastElementSequenceReturnsSameInstance() { + IntNdArray array = NdArrays.ofInts(Shape.of(2, 3, 2)); + IntNdArray element = array.get(0); + NdArraySequence sequence = + new FastElementSequence( + (AbstractNdArray) array, 1, element, mockDataBufferWindow(2)); + sequence.forEach( + e -> { + if (e != element) { + fail(); + } + }); + } + + private DataBufferWindow mockDataBufferWindow(long size) { + return new DataBufferWindow() { + + @Override + public long offset() { + return offset; + } + + @Override + public long size() { + return size; + } + + @Override + public DataBufferWindow slideTo(long index) { + offset = index; + return this; + } + + @Override + public DataBufferWindow slide(long step) { + offset += step; + return this; + } + + @Override + public IntDataBuffer buffer() { + return buffer; + } + + private long offset; + private final long size = 2; + private final IntDataBuffer buffer = DataBuffers.ofInts(2); + }; + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArrayTest.java new file mode 100644 index 00000000000..32ea120e0e1 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/BooleanSparseNdArrayTest.java @@ -0,0 +1,313 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.BooleanNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class BooleanSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + boolean[] valuesArray = {true, true}; + boolean[] valuesArrayDefaultValue = {false, false}; + boolean[] denseArray = { + true, false, false, false, + false, false, true, false, + false, false, false, false + }; + boolean[][] dense2DArray = { + {true, false, false, false}, {false, false, true, false}, {false, false, false, false} + }; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + BooleanNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + BooleanDataBuffer dataBuffer = DataBuffers.ofBooleans(instance.shape().size()); + + instance.copyTo(dataBuffer); + + boolean[] array = new boolean[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + BooleanDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + BooleanSparseNdArray instance = BooleanSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // invert true/false + boolean[] denseArrayDefaultValue = new boolean[denseArray.length]; + for (int i = 0; i < denseArrayDefaultValue.length; i++) { + denseArrayDefaultValue[i] = !denseArray[i]; + } + + BooleanNdArray valuesDefault = StdArrays.ndCopyOf(new boolean[] {false, false}); + BooleanDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + BooleanSparseNdArray instance = + BooleanSparseNdArray.create(true, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(valuesDefault, instance.getValues()); + } + + @Test + public void testGetObject() { + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetBoolean() { + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getBoolean(n, m), instance.getBoolean(n, m)); + } + } + } + + @Test + public void testGetBooleanDefaultValue() { + // flip the truth table + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instance = + new BooleanSparseNdArray( + indices, + NdArrays.vectorOf(valuesArrayDefaultValue), + true, + DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertNotEquals(ndArray.getBoolean(n, m), instance.getBoolean(n, m)); + } + } + } + + @Test + public void testGet() { + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(false, 0, 0)); + } + + @Test + public void testSet() { + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + boolean[] valuesArray = {true, true, false, true, false}; + boolean[] sortedValuesArray = {true, false, true, false, true}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + BooleanNdArray values = StdArrays.ndCopyOf(valuesArray); + BooleanNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + boolean[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + BooleanNdArray denseInstance = instance.toDense(); + BooleanNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instance = + BooleanSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getBoolean(n, m), instance.getBoolean(n, m)); + } + } + } + + @Test + public void testElements1() { + boolean[] expected = {true, false, false}; + + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + BooleanNdArray dst = NdArrays.ofBooleans(shape); + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getBoolean(n, m), dst.getBoolean(n, m)); + } + } + } + + @Test + public void testCreate() { + + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + BooleanSparseNdArray instanceA = + BooleanSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + BooleanDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + BooleanSparseNdArray instanceB = BooleanSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + BooleanSparseNdArray instanceC = + BooleanSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + BooleanSparseNdArray instanceD = BooleanSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + BooleanNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + BooleanSparseNdArray instanceE = BooleanSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + boolean[] expected = {false, false, true, false, false, false}; + BooleanSparseNdArray instance = + new BooleanSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + BooleanNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getBoolean())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getBoolean()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArrayTest.java new file mode 100644 index 00000000000..b0504659055 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ByteSparseNdArrayTest.java @@ -0,0 +1,304 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.ByteNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class ByteSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + byte[] valuesArray = {1, 16}; + byte[] denseArray = { + 1, 0, 0, 0, + 0, 0, 16, 0, + 0, 0, 0, 0 + }; + byte[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 16, 0}, {0, 0, 0, 0}}; + + byte[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 16, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + ByteNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ByteDataBuffer dataBuffer = DataBuffers.ofBytes(instance.shape().size()); + + instance.copyTo(dataBuffer); + + byte[] array = new byte[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + ByteDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + ByteSparseNdArray instance = ByteSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + byte[] denseArrayDefaultValue = new byte[denseArray.length]; + for (int i = 0; i < denseArrayDefaultValue.length; i++) { + denseArrayDefaultValue[i] = denseArray[i] == 0 ? -1 : denseArray[i]; + } + ByteDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + ByteSparseNdArray instance = + ByteSparseNdArray.create((byte) -1, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals((byte) -1, instance.getByte(2, 0)); + } + + @Test + public void testGetObject() { + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetByte() { + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getByte(n, m), instance.getByte(n, m)); + } + } + } + + @Test + public void testGetByteDefaultValue() { + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, (byte) -1, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getByte(n, m), instance.getByte(n, m)); + } + } + } + + @Test + public void testGet() { + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject((byte) 0, 0, 0)); + } + + @Test + public void testSet() { + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + byte[] valuesArray = {1, 3, 2, 5, 4}; + byte[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + ByteNdArray values = StdArrays.ndCopyOf(valuesArray); + ByteNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + byte[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ByteNdArray denseInstance = instance.toDense(); + ByteNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ByteSparseNdArray instance = ByteSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getByte(n, m), instance.getByte(n, m)); + } + } + } + + @Test + public void testElements1() { + byte[] expected = {1, 0, 0}; + + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + ByteNdArray dst = NdArrays.ofBytes(shape); + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getByte(n, m), dst.getByte(n, m)); + } + } + } + + @Test + public void testCreate() { + + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ByteSparseNdArray instanceA = + ByteSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + ByteDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + ByteSparseNdArray instanceB = ByteSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + ByteSparseNdArray instanceC = + ByteSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + ByteSparseNdArray instanceD = ByteSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + ByteNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ByteSparseNdArray instanceE = ByteSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + byte[] expected = {0, 0, 16, 0, 0, 0}; + ByteSparseNdArray instance = + new ByteSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + ByteNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getByte())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getByte()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArrayTest.java new file mode 100644 index 00000000000..e7209902d86 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/DoubleSparseNdArrayTest.java @@ -0,0 +1,318 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.nio.DoubleBuffer; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class DoubleSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + double[] valuesArray = {1, 256}; + double[] denseArray = { + 1, 0, 0, 0, + 0, 0, 256, 0, + 0, 0, 0, 0 + }; + double[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 256, 0}, {0, 0, 0, 0}}; + + double[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 256, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + DoubleNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + DoubleDataBuffer dataBuffer = DataBuffers.ofDoubles(instance.shape().size()); + + instance.copyTo(dataBuffer); + + double[] array = new double[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + DoubleDataBuffer dataBuffer = NioDataBufferFactory.create(DoubleBuffer.wrap(denseArray)); + // use a zero buffer + DoubleSparseNdArray instance = DoubleSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + double[] denseArrayDefaultValue = Arrays.stream(denseArray).map(x -> x == 0 ? -1 : x).toArray(); + DoubleDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + DoubleSparseNdArray instance = DoubleSparseNdArray.create(-1d, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(-1d, instance.getDouble(2, 0)); + } + + @Test + public void testGetObject() { + + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetDouble() { + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getDouble(n, m), instance.getDouble(n, m)); + } + } + } + + @Test + public void testGetDoubleDefaultValue() { + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, -1d, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getDouble(n, m), instance.getDouble(n, m)); + } + } + } + + @Test + public void testGet() { + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(2d, 0, 0)); + } + + @Test + public void testSet() { + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + double[] valuesArray = {1, 3, 2, 5, 4}; + double[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + DoubleNdArray values = StdArrays.ndCopyOf(valuesArray); + DoubleNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + double[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + DoubleNdArray denseInstance = instance.toDense(); + DoubleNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instance = + DoubleSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getDouble(n, m), instance.getDouble(n, m)); + } + } + } + + @Test + public void testElements1() { + double[] expected = {1, 0, 0}; + + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + DoubleNdArray dst = NdArrays.ofDoubles(shape); + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getDouble(n, m), dst.getDouble(n, m)); + } + } + } + + @Test + public void testCreate() { + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + DoubleSparseNdArray instanceA = + DoubleSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + DoubleDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + DoubleSparseNdArray instanceB = DoubleSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + DoubleSparseNdArray instanceC = + DoubleSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + DoubleSparseNdArray instanceD = DoubleSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instanceE = DoubleSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + double[] expected = {0, 0, 256, 0, 0, 0}; + DoubleSparseNdArray instance = + new DoubleSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + DoubleNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getDouble())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getDouble()))); + } + + @Test + public void testToString() { + DoubleNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + DoubleSparseNdArray instance = + DoubleSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + Assertions.assertEquals( + "DoubleSparseNdArray(defaultValue=0.0, numElements=2, shape=[3, 4])", instance.toString()); + DoubleSparseNdArray empty = DoubleSparseNdArray.create(DimensionalSpace.create(Shape.of(5))); + Assertions.assertEquals( + "DoubleSparseNdArray(defaultValue=0.0, numElements=0, shape=[5])", empty.toString()); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArrayTest.java new file mode 100644 index 00000000000..de5d3bbb634 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/FloatSparseNdArrayTest.java @@ -0,0 +1,313 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.nio.FloatBuffer; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class FloatSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + float[] valuesArray = {1, 2}; + float[] denseArray = { + 1, 0, 0, 0, + 0, 0, 2, 0, + 0, 0, 0, 0 + }; + + float[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 2, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + FloatNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + FloatDataBuffer dataBuffer = DataBuffers.ofFloats(instance.shape().size()); + + instance.copyTo(dataBuffer); + + float[] array = new float[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + FloatDataBuffer dataBuffer = NioDataBufferFactory.create(FloatBuffer.wrap(denseArray)); + // use a zero buffer + FloatSparseNdArray instance = FloatSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + float[] denseArrayDefaultValue = new float[denseArray.length]; + for (int i = 0; i < denseArrayDefaultValue.length; i++) { + denseArrayDefaultValue[i] = denseArray[i] == 0f ? -1f : denseArray[i]; + } + FloatDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + FloatSparseNdArray instance = FloatSparseNdArray.create(-1f, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(-1f, instance.getFloat(2, 0)); + } + + @Test + public void testGetObject() { + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetFloat() { + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getFloat(n, m), instance.getFloat(n, m)); + } + } + } + + @Test + public void testGetFloatDefaultValue() { + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, -1, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getFloat(n, m), instance.getFloat(n, m)); + } + } + } + + @Test + public void testGet() { + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(2f, 0, 0)); + } + + @Test + public void testSet() { + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + float[] valuesArray = {1, 3, 2, 5, 4}; + float[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + FloatNdArray values = StdArrays.ndCopyOf(valuesArray); + FloatNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + float[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + FloatNdArray denseInstance = instance.toDense(); + FloatNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + FloatSparseNdArray instance = + FloatSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getFloat(n, m), instance.getFloat(n, m)); + } + } + } + + @Test + public void testElements1() { + float[] expected = {1, 0, 0}; + float[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + FloatNdArray dst = NdArrays.ofFloats(shape); + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getFloat(n, m), dst.getFloat(n, m)); + } + } + } + + @Test + public void testCreate() { + float[] denseArray = {1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0}; + float[][] dense2Array = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + FloatSparseNdArray instanceA = + FloatSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + FloatDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + FloatSparseNdArray instanceB = FloatSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + FloatSparseNdArray instanceC = + FloatSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + FloatSparseNdArray instanceD = FloatSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + FloatNdArray ndArray = StdArrays.ndCopyOf(dense2Array); + FloatSparseNdArray instanceE = FloatSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + float[] expected = {0, 0, 2, 0, 0, 0}; + FloatSparseNdArray instance = + new FloatSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + FloatNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getFloat())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getFloat()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArrayTest.java new file mode 100644 index 00000000000..669cd8080e5 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/IntSparseNdArrayTest.java @@ -0,0 +1,311 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.nio.IntBuffer; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class IntSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + int[] valuesArray = {1, 2}; + int[] denseArray = { + 1, 0, 0, 0, + 0, 0, 2, 0, + 0, 0, 0, 0 + }; + + int[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 2, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + IntNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + IntDataBuffer dataBuffer = DataBuffers.ofInts(instance.shape().size()); + + instance.copyTo(dataBuffer); + + int[] array = new int[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBufferBuffer() { + + IntDataBuffer dataBuffer = NioDataBufferFactory.create(IntBuffer.wrap(denseArray)); + // use a zero buffer + IntSparseNdArray instance = IntSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + int[] denseArrayDefaultValue = Arrays.stream(denseArray).map(x -> x == 0 ? -1 : x).toArray(); + + IntDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + IntSparseNdArray instance = IntSparseNdArray.create(-1, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(-1, instance.getInt(2, 0)); + } + + @Test + public void testGetObject() { + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + IntNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetInt() { + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + IntNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getInt(n, m), instance.getInt(n, m)); + } + } + } + + @Test + public void testGetIntDefaultValue() { + IntNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, -1, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getInt(n, m), instance.getInt(n, m)); + } + } + } + + @Test + public void testGet() { + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + IntNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(2, 0, 0)); + } + + @Test + public void testSet() { + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + int[] valuesArray = {1, 3, 2, 5, 4}; + int[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + IntNdArray values = StdArrays.ndCopyOf(valuesArray); + IntNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + int[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + IntNdArray denseInstance = instance.toDense(); + IntNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + IntNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + IntSparseNdArray instance = IntSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getInt(n, m), instance.getInt(n, m)); + } + } + } + + @Test + public void testElements1() { + int[] expected = {1, 0, 0}; + int[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + IntNdArray dst = NdArrays.ofInts(shape); + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getInt(n, m), dst.getInt(n, m)); + } + } + } + + @Test + public void testCreate() { + int[] denseArray = {1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0}; + int[][] dense2Array = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + IntSparseNdArray instanceA = + IntSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + IntDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + IntSparseNdArray instanceB = IntSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + IntSparseNdArray instanceC = + IntSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + IntSparseNdArray instanceD = IntSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + IntNdArray ndArray = StdArrays.ndCopyOf(dense2Array); + IntSparseNdArray instanceE = IntSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + int[] expected = {0, 0, 2, 0, 0, 0}; + IntSparseNdArray instance = + new IntSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + IntNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getInt())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getInt()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArrayTest.java new file mode 100644 index 00000000000..93864683650 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/LongSparseNdArrayTest.java @@ -0,0 +1,310 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.nio.LongBuffer; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class LongSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + long[] valuesArray = {1, 2}; + long[] denseArray = { + 1, 0, 0, 0, + 0, 0, 2, 0, + 0, 0, 0, 0 + }; + + long[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 2, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + LongDataBuffer dataBuffer = DataBuffers.ofLongs(instance.shape().size()); + + instance.copyTo(dataBuffer); + + long[] array = new long[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + LongDataBuffer dataBuffer = NioDataBufferFactory.create(LongBuffer.wrap(denseArray)); + // use a zero buffer + LongSparseNdArray instance = LongSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + long[] denseArrayDefaultValue = Arrays.stream(denseArray).map(x -> x == 0 ? -1 : x).toArray(); + + LongDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + LongSparseNdArray instance = LongSparseNdArray.create(-1L, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(-1L, instance.getLong(2, 0)); + } + + @Test + public void testGetObject() { + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + LongNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetLong() { + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + LongNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getLong(n, m), instance.getLong(n, m)); + } + } + } + + @Test + public void testGetLongDefaultValue() { + LongNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, -1L, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getLong(n, m), instance.getLong(n, m)); + } + } + } + + @Test + public void testGet() { + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + LongNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(2L, 0, 0)); + } + + @Test + public void testSet() { + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + long[] valuesArray = {1, 3, 2, 5, 4}; + long[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + LongNdArray values = StdArrays.ndCopyOf(valuesArray); + LongNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + long[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + LongNdArray denseInstance = instance.toDense(); + LongNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + LongNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + LongSparseNdArray instance = LongSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getLong(n, m), instance.getLong(n, m)); + } + } + } + + @Test + public void testElements1() { + long[] expected = {1, 0, 0}; + long[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + LongNdArray dst = NdArrays.ofLongs(shape); + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getLong(n, m), dst.getLong(n, m)); + } + } + } + + @Test + public void testCreate() { + long[] denseArray = {1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0}; + long[][] dense2Array = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + LongSparseNdArray instanceA = + LongSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + LongDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + LongSparseNdArray instanceB = LongSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + LongSparseNdArray instanceC = + LongSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + LongSparseNdArray instanceD = LongSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + LongNdArray ndArray = StdArrays.ndCopyOf(dense2Array); + LongSparseNdArray instanceE = LongSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + long[] expected = {0, 0, 2, 0, 0, 0}; + LongSparseNdArray instance = + new LongSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + LongNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getLong())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getLong()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArrayTest.java new file mode 100644 index 00000000000..ae5b8ffef44 --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/ShortSparseNdArrayTest.java @@ -0,0 +1,314 @@ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.nio.ShortBuffer; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.ShortNdArray; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.buffer.ShortDataBuffer; +import org.tensorflow.ndarray.impl.buffer.nio.NioDataBufferFactory; +import org.tensorflow.ndarray.impl.buffer.raw.RawDataBufferFactory; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +class ShortSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + short[] valuesArray = {1, 2}; + short[] denseArray = { + 1, 0, 0, 0, + 0, 0, 2, 0, + 0, 0, 0, 0 + }; + short[][] dense2DArrayDefaultValue = {{1, -1, -1, -1}, {-1, -1, 2, -1}, {-1, -1, -1, -1}}; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + ShortNdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ShortDataBuffer dataBuffer = DataBuffers.ofShorts(instance.shape().size()); + + instance.copyTo(dataBuffer); + + short[] array = new short[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + ShortDataBuffer dataBuffer = NioDataBufferFactory.create(ShortBuffer.wrap(denseArray)); + // use a zero buffer + ShortSparseNdArray instance = ShortSparseNdArray.create(DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + } + + @Test + public void testWriteDefaultValue() { + // change 0 to -1 + short[] denseArrayDefaultValue = new short[denseArray.length]; + for (int i = 0; i < denseArrayDefaultValue.length; i++) { + denseArrayDefaultValue[i] = denseArray[i] == 0 ? (short) -1 : denseArray[i]; + } + + ShortDataBuffer dataBuffer = RawDataBufferFactory.create(denseArrayDefaultValue, false); + // use a zero buffer + ShortSparseNdArray instance = + ShortSparseNdArray.create((short) -1, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals((short) -1, instance.getShort(2, 0)); + } + + @Test + public void testGetObject() { + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetShort() { + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getShort(n, m), instance.getShort(n, m)); + } + } + } + + @Test + public void testGetShortDefaultValue() { + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefaultValue); + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, (short) -1, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getShort(n, m), instance.getShort(n, m)); + } + } + } + + @Test + public void testGet() { + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject((short) 2, 0, 0)); + } + + @Test + public void testSet() { + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + short[] valuesArray = {1, 3, 2, 5, 4}; + short[] sortedValuesArray = {1, 2, 3, 4, 5}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + ShortNdArray values = StdArrays.ndCopyOf(valuesArray); + ShortNdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + short[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ShortNdArray denseInstance = instance.toDense(); + ShortNdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + ShortSparseNdArray instance = + ShortSparseNdArray.create(DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getShort(n, m), instance.getShort(n, m)); + } + } + } + + @Test + public void testElements1() { + short[] expected = {1, 0, 0}; + short[][] dense2DArray = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + ShortNdArray dst = NdArrays.ofShorts(shape); + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getShort(n, m), dst.getShort(n, m)); + } + } + } + + @Test + public void testCreate() { + short[] denseArray = {1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0}; + short[][] dense2Array = {{1, 0, 0, 0}, {0, 0, 2, 0}, {0, 0, 0, 0}}; + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + ShortSparseNdArray instanceA = + ShortSparseNdArray.create(indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + ShortDataBuffer dataBuffer = RawDataBufferFactory.create(denseArray, false); + // use a zero buffer + ShortSparseNdArray instanceB = ShortSparseNdArray.create(DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + ShortSparseNdArray instanceC = + ShortSparseNdArray.create(dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + ShortSparseNdArray instanceD = ShortSparseNdArray.create(dataBuffer, shape); + assertEquals(instanceB, instanceD); + + ShortNdArray ndArray = StdArrays.ndCopyOf(dense2Array); + ShortSparseNdArray instanceE = ShortSparseNdArray.create(ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + short[] expected = {0, 0, 2, 0, 0, 0}; + ShortSparseNdArray instance = + new ShortSparseNdArray(indices, values, DimensionalSpace.create(shape)); + + ShortNdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getShort())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getShort()))); + } +} diff --git a/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/StringSparseNdArrayTest.java b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/StringSparseNdArrayTest.java new file mode 100644 index 00000000000..32b83ef702f --- /dev/null +++ b/tensorflow-ndarray/src/test/java/org/tensorflow/ndarray/impl/sparse/StringSparseNdArrayTest.java @@ -0,0 +1,356 @@ +/* Copyright 2021 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. +=======================================================================*/ +package org.tensorflow.ndarray.impl.sparse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.NdArrays; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.StdArrays; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffers; +import org.tensorflow.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.ndarray.index.Indices; + +public class StringSparseNdArrayTest { + long[][] indicesArray = {{0, 0}, {1, 2}}; + String[] valuesArray = {"alpha", "omega"}; + String[] denseArray = { + "alpha", null, null, null, null, null, "omega", null, null, null, null, null + }; + String[][] dense2DArray = { + {"alpha", null, null, null}, {null, null, "omega", null}, {null, null, null, null} + }; + + String[][] dense2DArrayDefault = { + {"alpha", "default", "default", "default"}, + {"default", "default", "omega", "default"}, + {"default", "default", "default", "default"} + }; + + Shape shape = Shape.of(3, 4); + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + NdArray values = StdArrays.ndCopyOf(valuesArray); + + @Test + public void testBasic() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(shape, instance.shape()); + } + + @Test + public void testCopyToBuffer() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + DataBuffer dataBuffer = DataBuffers.ofObjects(String.class, instance.shape().size()); + + instance.copyTo(dataBuffer); + + String[] array = new String[denseArray.length]; + dataBuffer.read(array); + assertArrayEquals(denseArray, array); + } + + @Test + public void testCopyFromBuffer() { + + DataBuffer dataBuffer = DataBuffers.ofObjects(denseArray); + // use a zero buffer + SparseNdArray> instance = + SparseNdArray.create(String.class, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(indices.shape().get(0), values.size()); + assertEquals(2, values.size()); + } + + @Test + public void testWriteDefaultValue() { + String defaultValue = "default"; + String[] denseArrayDefaultValue = new String[denseArray.length]; + for (int i = 0; i < denseArrayDefaultValue.length; i++) { + denseArrayDefaultValue[i] = denseArray[i] == null ? defaultValue : denseArray[i]; + } + + DataBuffer dataBuffer = DataBuffers.ofObjects(denseArrayDefaultValue); + // use a zero buffer + SparseNdArray> instance = + SparseNdArray.create(String.class, defaultValue, DimensionalSpace.create(shape)); + instance.copyFrom(dataBuffer); + + assertEquals(indices, instance.getIndices()); + assertEquals(values, instance.getValues()); + assertEquals(2, values.size()); + assertEquals(indices.shape().get(0), values.size()); + } + + @Test + public void testGetObject() { + NdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGetObjectDefaultValue() { + String defaultValue = "default"; + + NdArray ndArray = StdArrays.ndCopyOf(dense2DArrayDefault); + SparseNdArray> instance = + new SparseNdArray<>( + String.class, indices, values, defaultValue, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testGet() { + NdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + for (int n = 0; n < ndArray.shape().get(0); n++) { + assertEquals(ndArray.get(n), instance.get(n)); + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.get(n, m), instance.get(n, m)); + } + } + } + + @Test + public void testSetObject() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + assertThrows(java.nio.ReadOnlyBufferException.class, () -> instance.setObject(null, 0, 0)); + } + + @Test + public void testSet() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + assertThrows( + java.nio.ReadOnlyBufferException.class, + () -> instance.set(instance.getDefaultArray(), 0, 0)); + } + + @Test + public void testSort() { + + long[][] indicesArray = {{0, 0}, {1, 2}, {0, 1}, {2, 3}, {1, 4}}; + long[][] sortedIndicesArray = {{0, 0}, {0, 1}, {1, 2}, {1, 4}, {2, 3}}; + String[] valuesArray = {"b", "d", "a", null, "c"}; + String[] sortedValuesArray = {"b", "a", "d", "c", null}; + + LongNdArray indices = StdArrays.ndCopyOf(indicesArray); + LongNdArray sortedIndices = StdArrays.ndCopyOf(sortedIndicesArray); + NdArray values = StdArrays.ndCopyOf(valuesArray); + NdArray sortedValues = StdArrays.ndCopyOf(sortedValuesArray); + + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + instance.sortIndicesAndValues(); + + // should be sorted in ascending row-wise coordinate order based on test values + assertEquals(sortedIndices, instance.getIndices()); + assertEquals(sortedValues, instance.getValues()); + } + + @Test + public void testElements() { + + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + instance + .elements(0) + .forEachIndexed( + (idx, item) -> { + String[] slice = dense2DArray[(int) idx[0]]; + item.scalars() + .forEachIndexed((dx, f) -> assertEquals(slice[(int) dx[0]], f.getObject())); + }); + } + + @Test + public void testDense() { + + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + NdArray denseInstance = instance.toDense(); + NdArray expectedDense = StdArrays.ndCopyOf(dense2DArray); + assertEquals(expectedDense, denseInstance); + } + + @Test + public void testFromDense() { + NdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + SparseNdArray> instance = + SparseNdArray.create(String.class, DimensionalSpace.create(ndArray.shape())); + instance.fromDense(ndArray); + assertNotNull(instance.getIndices()); + assertEquals(2, instance.getIndices().shape().get(0)); + assertNotNull(instance.getValues()); + assertEquals(2, instance.getValues().size()); + + assertEquals(ndArray.shape(), instance.shape()); + for (int n = 0; n < ndArray.shape().get(0); n++) { + for (int m = 0; m < ndArray.shape().get(1); m++) { + assertEquals(ndArray.getObject(n, m), instance.getObject(n, m)); + } + } + } + + @Test + public void testElements1() { + String[] expected = {"alpha", null, null}; + + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + instance + .elements(0) + .forEachIndexed((idx, l) -> assertEquals(expected[(int) idx[0]], l.getObject())); + instance + .elements(1) + .forEachIndexed( + (idx, l) -> assertEquals(dense2DArray[(int) idx[0]][(int) idx[1]], l.getObject())); + } + + @Test + public void testCopyTo() { + NdArray dst = NdArrays.ofObjects(String.class, shape); + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + instance.copyTo(dst); + for (int n = 0; n < instance.shape().get(0); n++) { + for (int m = 0; m < instance.shape().get(1); m++) { + assertEquals(instance.getObject(n, m), dst.getObject(n, m)); + } + } + } + + @Test + public void testCreate() { + + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + SparseNdArray> instanceA = + SparseNdArray.create(String.class, indices, values, DimensionalSpace.create(shape)); + assertEquals(instance, instanceA); + + DataBuffer dataBuffer = DataBuffers.ofObjects(denseArray); + + // use a zero buffer + SparseNdArray> instanceB = + SparseNdArray.create(String.class, DimensionalSpace.create(shape)); + instanceB.copyFrom(dataBuffer); + assertEquals(instance, instanceB); + + SparseNdArray> instanceC = + SparseNdArray.create(String.class, dataBuffer, DimensionalSpace.create(shape)); + assertEquals(instanceB, instanceC); + + SparseNdArray> instanceD = + SparseNdArray.create(String.class, dataBuffer, shape); + assertEquals(instanceB, instanceD); + + NdArray ndArray = StdArrays.ndCopyOf(dense2DArray); + SparseNdArray> instanceE = SparseNdArray.create(String.class, ndArray); + assertEquals(instance, instanceE); + } + + @Test + public void testSlice() { + String[] expected = {null, null, "omega", null, null, null}; + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + NdArray sliceInstance = instance.slice(Indices.all(), Indices.sliceFrom(2)); + // check the values of the slice against the original sparse array + AtomicInteger i = new AtomicInteger(); + sliceInstance + .scalars() + .forEachIndexed((idx, f) -> assertEquals(expected[i.getAndIncrement()], f.getObject())); + // check values from elements(0) of a slice against the original sparse array + i.set(0); + sliceInstance + .elements(0) + .forEachIndexed( + (idx, l) -> + l.scalars() + .forEachIndexed( + (lidx, f) -> assertEquals(expected[i.getAndIncrement()], f.getObject()))); + } + + @Test + public void testNullDefault() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + + NdArray dArray = instance.getDefaultArray(); + assertEquals(1L, dArray.size()); + assertNull(dArray.getObject()); + + instance = + new SparseNdArray<>( + String.class, indices, values, "a default", DimensionalSpace.create(shape)); + + dArray = instance.getDefaultArray(); + assertEquals(1L, dArray.size()); + assertNotNull(dArray.getObject()); + assertEquals("a default", dArray.getObject()); + } + + @Test + public void testToString() { + SparseNdArray> instance = + new SparseNdArray<>(String.class, indices, values, DimensionalSpace.create(shape)); + Assertions.assertEquals( + "SparseNdArray(type=String, defaultValue=, numElements=2, shape=[3, 4])", + instance.toString()); + instance = + new SparseNdArray<>( + String.class, indices, values, "a default", DimensionalSpace.create(shape)); + Assertions.assertEquals( + "SparseNdArray(type=String, defaultValue='a default', numElements=2, shape=[3, 4])", + instance.toString()); + } +} diff --git a/tensorflow-ndarray/src/test/resources/COPYRIGHT.txt b/tensorflow-ndarray/src/test/resources/COPYRIGHT.txt new file mode 100644 index 00000000000..5e7bd50bb48 --- /dev/null +++ b/tensorflow-ndarray/src/test/resources/COPYRIGHT.txt @@ -0,0 +1 @@ +All images in this folder and its subfolders are free of any copyright. \ No newline at end of file diff --git a/tensorflow-ndarray/src/test/resources/castle.jpg b/tensorflow-ndarray/src/test/resources/castle.jpg new file mode 100644 index 00000000000..c5b07b4bc2a Binary files /dev/null and b/tensorflow-ndarray/src/test/resources/castle.jpg differ diff --git a/tools/build_java_api_docs.py b/tools/build_java_api_docs.py deleted file mode 100644 index 42a83703ecf..00000000000 --- a/tools/build_java_api_docs.py +++ /dev/null @@ -1,83 +0,0 @@ -# Lint as: python3 -# 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. -# ============================================================================== -"""Generate TensorFlow Lite Java reference docs for TensorFlow.org.""" -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - -import pathlib -import shutil -import tempfile - -from absl import app -from absl import flags - -from tensorflow_docs.api_generator import gen_java - -FLAGS = flags.FLAGS - -# These flags are required by infrastructure, not all of them are used. -flags.DEFINE_string('output_dir', '/tmp/java_api/', - ("Use this branch as the root version and don't" - ' create in version directory')) - -flags.DEFINE_string('site_path', 'java/api_docs/java', - 'Path prefix in the _toc.yaml') - -flags.DEFINE_string('code_url_prefix', None, - '[UNUSED] The url prefix for links to code.') - -flags.DEFINE_bool( - 'search_hints', True, - '[UNUSED] Include metadata search hints in the generated files') - -# __file__ is the path to this file -TOOLS_DIR = pathlib.Path(__file__).resolve().parent -REPO_ROOT = TOOLS_DIR.parent - -def overlay(from_root, to_root): - for from_path in pathlib.Path(from_root).rglob('*'): - relpath = from_path.relative_to(from_root) - to_path = to_root/relpath - if from_path.is_file(): - assert not to_path.exists() - shutil.copyfile(from_path, to_path) - else: - to_path.mkdir(exist_ok=True) - -def main(unused_argv): - merged_source = pathlib.Path(tempfile.mkdtemp()) - (merged_source / 'java/org').mkdir(parents=True) - - shutil.copytree(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/', - merged_source/'java/org/tensorflow') - overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow', - merged_source/'java/org/tensorflow') - shutil.copytree(REPO_ROOT/'tensorflow-framework/src/main/java/org/tensorflow/framework', - merged_source/'java/org/tensorflow/framework') - shutil.copytree(REPO_ROOT/'ndarray/src/main/java/org/tensorflow/ndarray', - merged_source/'java/org/tensorflow/ndarray') - - gen_java.gen_java_docs( - package='org.tensorflow', - source_path=merged_source / 'java', - output_dir=pathlib.Path(FLAGS.output_dir), - site_path=pathlib.Path(FLAGS.site_path)) - - -if __name__ == '__main__': - flags.mark_flags_as_required(['output_dir']) - app.run(main)